(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-44c9221e"],{"0565":function(e,t,i){"use strict";i("5c31")},"0afc":function(e,t,i){e.exports=i.p+"img/noneData.919a3c84.png"},1:function(e,t){},"17a3":function(e,t,i){"use strict";i.d(t,"i",(function(){return u})),i.d(t,"h",(function(){return l})),i.d(t,"d",(function(){return c})),i.d(t,"f",(function(){return d})),i.d(t,"e",(function(){return p})),i.d(t,"c",(function(){return f})),i.d(t,"g",(function(){return m})),i.d(t,"a",(function(){return g})),i.d(t,"b",(function(){return v}));var n=i("be09"),r=i.n(n),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^/},s=["video","audio","text"],o=["Video","Audio","Text"],u=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),r=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+r})):e},l=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),s.forEach((function(n){var r=a[n].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=n;var s=e.substring(0,r[1].length),o=e.replace(s,"");i.push({type:s,details:o,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},c=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return l(r.playlists[0].attributes.CODECS)}return null},d=function(e){return void 0===e&&(e=""),a.audio.test(e.trim().toLowerCase())},h=function(e){return void 0===e&&(e=""),a.text.test(e.trim().toLowerCase())},p=function(e){if(e&&"string"===typeof e){var t=e.toLowerCase().split(",").map((function(e){return u(e.trim())})),i="video";1===t.length&&d(t[0])?i="audio":1===t.length&&h(t[0])&&(i="application");var n="mp4";return t.every((function(e){return a.mp4.test(e)}))?n="mp4":t.every((function(e){return a.webm.test(e)}))?n="webm":t.every((function(e){return a.ogg.test(e)}))&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'}},f=function(e){return void 0===e&&(e=""),r.a.MediaSource&&r.a.MediaSource.isTypeSupported&&r.a.MediaSource.isTypeSupported(p(e))||!1},m=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var n=i===t?0:4-i%4;return[i,n]}function c(e){var t=l(e),i=t[0],n=t[1];return 3*(i+n)/4-n}function d(e,t,i){return 3*(t+i)/4-i}function h(e){var t,i,n=l(e),s=n[0],o=n[1],u=new a(d(e,s,o)),c=0,h=o>0?s-4:s;for(i=0;i>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===o&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,u[c++]=255&t),1===o&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u}function p(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,i){for(var n,r=[],a=t;au?u:o+s));return 1===r?(t=e[i-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},"210b":function(e,t,i){var n=i("e1c8");t.DOMImplementation=n.DOMImplementation,t.XMLSerializer=n.XMLSerializer,t.DOMParser=i("b074").DOMParser},"298b":function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"i",(function(){return a})),i.d(t,"c",(function(){return s})),i.d(t,"e",(function(){return o})),i.d(t,"f",(function(){return u})),i.d(t,"d",(function(){return l})),i.d(t,"g",(function(){return c})),i.d(t,"b",(function(){return d})),i.d(t,"h",(function(){return h}));var n=i("b775");function r(e){return Object(n["a"])({url:"/client/index/signUp",method:"post",data:e})}function a(e){return Object(n["a"])({url:"/client/index/visit_due_time",method:"post",data:e})}function s(e){return Object(n["a"])({url:"/api/designer/select",method:"post",data:e})}function o(e){return Object(n["a"])({url:"/api/designer/index",method:"post",data:e})}function u(e){return Object(n["a"])({url:"/api/designer/read",method:"post",data:e})}function l(e){return Object(n["a"])({url:"/api/caselist",method:"get",params:e})}function c(e){return Object(n["a"])({url:"/api/designer/edit",method:"post",data:e})}function d(e){return Object(n["a"])({url:"/client/designer/designer_make",method:"post",data:e})}function h(e){return Object(n["a"])({url:"/api/tool/priceCalculation_set",method:"post",data:e})}},"2b8c":function(e,t,i){var n=i("be09"),r=e.exports={WebVTT:i("d02c"),VTTCue:i("b03c"),VTTRegion:i("f97d")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},"321f":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i("de66"),r=Object(n["j"])([73,68,51]),a=function(e,t){void 0===t&&(t=0),e=Object(n["j"])(e);var i=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],a=(16&i)>>4;return a?r+20:r+10},s=function e(t,i){return void 0===i&&(i=0),t=Object(n["j"])(t),t.length-i<10||!Object(n["a"])(t,r,{offset:i})?i:(i+=a(t,i),e(t,i))}},3603:function(e,t,i){"use strict";var n=i("be09"),r=i("a559"),a=i("8362");c.httpHandler=i("8c00"); /** * @license * slighly modified parse-headers 2.0.2 * Copyright (c) 2014 David Björklund * Available under the MIT license * */ var s=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();"undefined"===typeof t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t};function o(e,t){for(var i=0;i0&&(f=setTimeout((function(){if(!d){d=!0,p.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",a(e)}}),e.timeout)),p.setRequestHeader)for(l in y)y.hasOwnProperty(l)&&p.setRequestHeader(l,y[l]);else if(e.headers&&!u(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(p.responseType=e.responseType),"beforeSend"in e&&"function"===typeof e.beforeSend&&e.beforeSend(p),p.send(v||null),p}function h(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(i){}return null}function p(){}e.exports=c,e.exports.default=c,c.XMLHttpRequest=n.XMLHttpRequest||p,c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:n.XDomainRequest,o(["get","put","post","patch","head","delete"],(function(e){c["delete"===e?"del":e]=function(t,i,n){return i=l(t,i,n),i.method=e.toUpperCase(),d(i)}}))},"36c6":function(e,t){var i,n,r,a,s,o,u,l=9e4;i=function(e){return e*l},n=function(e,t){return e*t},r=function(e){return e/l},a=function(e,t){return e/t},s=function(e,t){return i(a(e,t))},o=function(e,t){return n(r(e),t)},u=function(e,t,i){return r(i?e:e-t)},e.exports={ONE_SECOND_IN_TS:l,secondsToVideoTs:i,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:a,audioTsToVideoTs:s,videoTsToAudioTs:o,metadataTsToSeconds:u}},"3c96":function(e,t){function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=i,e.exports.__esModule=!0,e.exports["default"]=e.exports},"4a4b":function(e,t){function i(t,n){return e.exports=i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports["default"]=e.exports,i(t,n)}e.exports=i,e.exports.__esModule=!0,e.exports["default"]=e.exports},"55b5":function(e,t,i){var n=i("4a4b");function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}e.exports=r,e.exports.__esModule=!0,e.exports["default"]=e.exports},"5c31":function(e,t,i){},"63ec":function(e,t,i){"use strict";var n=i("d136"),r=i.n(n),a=i("be09"),s=i.n(a),o="http://example.com",u=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=s.a.location&&s.a.location.href||"");var i="function"===typeof s.a.URL,n=/^\/\//.test(e),a=!s.a.location&&!/\/\//i.test(e);if(i?e=new s.a.URL(e,s.a.location||o):/\/\//i.test(e)||(e=r.a.buildAbsoluteURL(s.a.location&&s.a.location.href||"",e)),i){var u=new URL(t,e);return a?u.href.slice(o.length):n?u.href.slice(u.protocol.length):u.href}return r.a.buildAbsoluteURL(e,t)};t["a"]=u},"6f8f":function(e,t,i){function n(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}i("d3b7"),i("f8c9"),i("4ae1"),e.exports=n,e.exports.__esModule=!0,e.exports["default"]=e.exports},"81c08":function(e,t,i){var n=i("a968").getUint64,r=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},r=12;0===i.version?(i.earliestPresentationTime=t.getUint32(r),i.firstOffset=t.getUint32(r+4),r+=8):(i.earliestPresentationTime=n(e.subarray(r)),i.firstOffset=n(e.subarray(r+8)),r+=16),r+=2;var a=t.getUint16(r);for(r+=2;a>0;r+=12,a--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return i};e.exports=r},8362:function(e,t){e.exports=n;var i=Object.prototype.toString;function n(e){if(!e)return!1;var t=i.call(e);return"[object Function]"===t||"function"===typeof e&&"[object RegExp]"!==t||"undefined"!==typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}},8484:function(e,t,i){"use strict";i.d(t,"a",(function(){return C})),i.d(t,"b",(function(){return N})),i.d(t,"c",(function(){return Ce})),i.d(t,"d",(function(){return Ie}));var n=i("63ec"),r=i("be09"),a=i.n(r),s=function(e,t,i){t.forEach((function(t){for(var n in e.mediaGroups[t])for(var r in e.mediaGroups[t][n]){var a=e.mediaGroups[t][n][r];i(a,t,n,r)}}))},o=i("ffdf"),u=i("210b"),l=function(e){return!!e&&"object"===typeof e},c=function e(){for(var t=arguments.length,i=new Array(t),n=0;nt.timeline?1:-1}))},P=function(e,t){for(var i=0;ii.timeline||i.segments.length&&e.timeline>i.segments[i.segments.length-1].timeline)&&e.discontinuitySequence--);var s=i.segments[a];s.discontinuity&&!r.discontinuity&&(r.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),O({playlist:e,mediaSequence:i.segments[a].number})}}))},R=function(e){var t=e.oldManifest,i=e.newManifest,n=t.playlists.concat(D(t)),r=i.playlists.concat(D(i));return i.timelineStarts=A([t.timelineStarts,i.timelineStarts]),L({oldPlaylists:n,newPlaylists:r,timelineStarts:i.timelineStarts}),i},N=function(e){return e&&e.uri+"-"+b(e.byterange)},M=function(e){var t=d(e.reduce((function(e,t){var i=t.attributes.id+(t.attributes.lang||"");if(e[i]){var n;if(t.segments)t.segments[0]&&(t.segments[0].discontinuity=!0),(n=e[i].segments).push.apply(n,t.segments);t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)}else e[i]=t,e[i].attributes.timelineStarts=[];return e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{}));return t.map((function(e){return e.discontinuityStarts=m(e.segments||[],"discontinuity"),e}))},U=function(e,t){var i=N(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&C(e,n,e.sidx.resolvedUri),e},B=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=U(e[i],t);return e},j=function(e,t){var i,n=e.attributes,r=e.segments,a=e.sidx,s=e.mediaSequence,o=e.discontinuitySequence,u=e.discontinuityStarts,l={attributes:(i={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuitySequence:o,discontinuityStarts:u,timelineStarts:n.timelineStarts,mediaSequence:s,segments:r};return n.contentProtection&&(l.contentProtection=n.contentProtection),a&&(l.sidx=a),t&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},F=function(e){var t,i=e.attributes,n=e.segments,r=e.mediaSequence,a=e.discontinuityStarts,s=e.discontinuitySequence;"undefined"===typeof n&&(n=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var o=(t={NAME:i.id,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t);return i.codecs&&(o.CODECS=i.codecs),{attributes:o,uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:a,discontinuitySequence:s,mediaSequence:r,segments:n}},H=function(e,t,i){var n;void 0===t&&(t={}),void 0===i&&(i=!1);var r=e.reduce((function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",o=r.attributes.label||"main";if(s&&!r.attributes.label){var u=a?" ("+a+")":"";o=""+r.attributes.lang+u}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=U(j(r,i),t);return e[o].playlists.push(l),"undefined"===typeof n&&"main"===a&&(n=r,n.default=!0),e}),{});if(!n){var a=Object.keys(r)[0];r[a].default=!0}return r},q=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,i){var n=i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(U(F(i),t)),e}),{})},V=function(e){return e.reduce((function(e,t){return t?(t.forEach((function(t){var i=t.channel,n=t.language;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e}),{})},W=function(e){var t,i=e.attributes,n=e.segments,r=e.sidx,a=e.discontinuityStarts,s={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuityStarts:a,timelineStarts:i.timelineStarts,segments:n};return i.contentProtection&&(s.contentProtection=i.contentProtection),r&&(s.sidx=r),s},z=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},G=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},X=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},K=function(e,t){e.forEach((function(e){e.mediaSequence=0,e.discontinuitySequence=g(t,(function(t){var i=t.timeline;return i===e.timeline})),e.segments&&e.segments.forEach((function(e,t){e.number=t}))}))},Y=function(e){return e?Object.keys(e).reduce((function(t,i){var n=e[i];return t.concat(n.playlists)}),[]):[]},Q=function(e){var t,i=e.dashPlaylists,n=e.locations,r=e.sidxMapping,a=void 0===r?{}:r,s=e.previousManifest;if(!i.length)return{};var o=i[0].attributes,u=o.sourceDuration,l=o.type,c=o.suggestedPresentationDelay,d=o.minimumUpdatePeriod,h=M(i.filter(z)).map(W),p=M(i.filter(G)),f=M(i.filter(X)),m=i.map((function(e){return e.attributes.captionServices})).filter(Boolean),g={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:B(h,a)};d>=0&&(g.minimumUpdatePeriod=1e3*d),n&&(g.locations=n),"dynamic"===l&&(g.suggestedPresentationDelay=c);var v=0===g.playlists.length,y=p.length?H(p,a,v):null,_=f.length?q(f,a):null,b=h.concat(Y(y),Y(_)),T=b.map((function(e){var t=e.timelineStarts;return t}));return g.timelineStarts=A(T),K(b,g.timelineStarts),y&&(g.mediaGroups.AUDIO.audio=y),_&&(g.mediaGroups.SUBTITLES.subs=_),m.length&&(g.mediaGroups["CLOSED-CAPTIONS"].cc=V(m)),s?R({oldManifest:s,newManifest:g}):g},$=function(e,t,i){var n=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.periodStart,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=void 0===c?0:c,h=(n+r)/1e3,p=a+l,f=h+d,m=f-p;return Math.ceil((m*o-t)/i)},J=function(e,t){for(var i=e.type,n=e.minimumUpdatePeriod,r=void 0===n?0:n,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,u=e.timescale,l=void 0===u?1:u,c=e.startNumber,d=void 0===c?1:c,h=e.periodStart,p=[],f=-1,m=0;mf&&(f=_);var b=void 0;if(y<0){var T=m+1;b=T===t.length?"dynamic"===i&&r>0&&s.indexOf("$Number$")>0?$(e,f,v):(o*l-f)/v:(t[T].t-f)/v}else b=y+1;var S=d+p.length+b,w=d+p.length;while(w=r?a:""+new Array(r-a.length+1).join("0")+a)}},te=function(e,t){return e.replace(Z,ee(t))},ie=function(e,t){return e.duration||t?e.duration?E(e):J(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]},ne=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,a=void 0===r?{sourceURL:"",range:""}:r,s=_({baseUrl:e.baseUrl,source:te(a.sourceURL,i),range:a.range}),o=ie(e,t);return o.map((function(t){i.Number=t.number,i.Time=t.time;var r=te(e.media||"",i),a=e.timescale||1,o=e.presentationTimeOffset||0,u=e.periodStart+(t.time-o)/a,l={uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:Object(n["a"])(e.baseUrl||"",r),map:s,number:t.number,presentationTime:u};return l}))},re=function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,a=_({baseUrl:i,source:r.sourceURL,range:r.range}),s=_({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=a,s},ae=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n,a=e.periodStart;if(!i&&!t||i&&t)throw new Error(y.SEGMENT_TIME_UNSPECIFIED);var s,o=r.map((function(t){return re(e,t)}));i&&(s=E(e)),t&&(s=J(e,t));var u=s.map((function(t,i){if(o[i]){var n=o[i],r=e.timescale||1,s=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=a+(t.time-s)/r,n}})).filter((function(e){return e}));return u},se=function(e){var t,i,n=e.attributes,r=e.segmentInfo;r.template?(i=ne,t=c(n,r.template)):r.base?(i=k,t=c(n,r.base)):r.list&&(i=ae,t=c(n,r.list));var a={attributes:n};if(!i)return a;var s=i(t,r.segmentTimeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,d=void 0===l?1:l;t.duration=u/d}else s.length?t.duration=s.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=s,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},oe=function(e){return e.map(se)},ue=function(e,t){return f(e.childNodes).filter((function(e){var i=e.tagName;return i===t}))},le=function(e){return e.textContent.trim()},ce=function(e){var t=31536e3,i=2592e3,n=86400,r=3600,a=60,s=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,o=s.exec(e);if(!o)return 0;var u=o.slice(1),l=u[0],c=u[1],d=u[2],h=u[3],p=u[4],f=u[5];return parseFloat(l||0)*t+parseFloat(c||0)*i+parseFloat(d||0)*n+parseFloat(h||0)*r+parseFloat(p||0)*a+parseFloat(f||0)},de=function(e){var t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return t.test(e)&&(e+="Z"),Date.parse(e)},he={mediaPresentationDuration:function(e){return ce(e)},availabilityStartTime:function(e){return de(e)/1e3},minimumUpdatePeriod:function(e){return ce(e)},suggestedPresentationDelay:function(e){return ce(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return ce(e)},start:function(e){return ce(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?ce(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},pe=function(e){return e&&e.attributes?f(e.attributes).reduce((function(e,t){var i=he[t.name]||he.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}},fe={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},me=function(e,t){return t.length?p(e.map((function(e){return t.map((function(t){return Object(n["a"])(e,le(t))}))}))):e},ge=function(e){var t=ue(e,"SegmentTemplate")[0],i=ue(e,"SegmentList")[0],n=i&&ue(i,"SegmentURL").map((function(e){return c({tag:"SegmentURL"},pe(e))})),r=ue(e,"SegmentBase")[0],a=i||t,s=a&&ue(a,"SegmentTimeline")[0],o=i||r||t,u=o&&ue(o,"Initialization")[0],l=t&&pe(t);l&&u?l.initialization=u&&pe(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var d={template:l,segmentTimeline:s&&ue(s,"S").map((function(e){return pe(e)})),list:i&&c(pe(i),{segmentUrls:n,initialization:pe(u)}),base:r&&c(pe(r),{initialization:pe(u)})};return Object.keys(d).forEach((function(e){d[e]||delete d[e]})),d},ve=function(e,t,i){return function(n){var r=ue(n,"BaseURL"),a=me(t,r),s=c(e,pe(n)),o=ge(n);return a.map((function(e){return{segmentInfo:c(i,o),attributes:c(s,{baseUrl:e})}}))}},ye=function(e){return e.reduce((function(e,t){var i=pe(t),n=fe[i.schemeIdUri];if(n){e[n]={attributes:i};var r=ue(t,"cenc:pssh")[0];if(r){var a=le(r),s=a&&Object(o["a"])(a);e[n].pssh=s}}return e}),{})},_e=function(e){if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri){var t="string"!==typeof e.value?[]:e.value.split(";");return t.map((function(e){var t,i;if(i=e,/^CC\d=/.test(e)){var n=e.split("=");t=n[0],i=n[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:i}}))}if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri){var i="string"!==typeof e.value?[]:e.value.split(";");return i.map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var i=e.split("="),n=i[0],r=i[1],a=void 0===r?"":r;t.channel=n,t.language=e,a.split(",").forEach((function(e){var i=e.split(":"),n=i[0],r=i[1];"lang"===n?t.language=r:"er"===n?t.easyReader=Number(r):"war"===n?t.aspectRatio=Number(r):"3D"===n&&(t["3D"]=Number(r))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}))}},be=function(e,t,i){return function(n){var r=pe(n),a=me(t,ue(n,"BaseURL")),s=ue(n,"Role")[0],o={role:pe(s)},u=c(e,r,o),l=ue(n,"Accessibility")[0],d=_e(pe(l));d&&(u=c(u,{captionServices:d}));var h=ue(n,"Label")[0];if(h&&h.childNodes.length){var f=h.childNodes[0].nodeValue.trim();u=c(u,{label:f})}var m=ye(ue(n,"ContentProtection"));Object.keys(m).length&&(u=c(u,{contentProtection:m}));var g=ge(n),v=ue(n,"Representation"),y=c(i,g);return p(v.map(ve(u,a,y)))}},Te=function(e,t){return function(i,n){var r=me(t,ue(i.node,"BaseURL")),a=c(e,{periodStart:i.attributes.start});"number"===typeof i.attributes.duration&&(a.periodDuration=i.attributes.duration);var s=ue(i.node,"AdaptationSet"),o=ge(i.node);return p(s.map(be(a,r,o)))}},Se=function(e){var t=e.attributes,i=e.priorPeriodAttributes,n=e.mpdType;return"number"===typeof t.start?t.start:i&&"number"===typeof i.start&&"number"===typeof i.duration?i.start+i.duration:i||"static"!==n?null:0},we=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,a=i.NOW,s=void 0===a?Date.now():a,o=i.clientOffset,u=void 0===o?0:o,l=ue(e,"Period");if(!l.length)throw new Error(y.INVALID_NUMBER_OF_PERIOD);var c=ue(e,"Location"),d=pe(e),h=me([r],ue(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,c.length&&(d.locations=c.map(le));var f=[];return l.forEach((function(e,t){var i=pe(e),n=f[t-1];i.start=Se({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:d.type}),f.push({node:e,attributes:i})})),{locations:d.locations,representationInfo:p(f.map(Te(d,h)))}},Ee=function(e){if(""===e)throw new Error(y.DASH_EMPTY_MANIFEST);var t,i,n=new u["DOMParser"];try{t=n.parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(r){}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(y.DASH_INVALID_XML);return i},ke=function(e){var t=ue(e,"UTCTiming")[0];if(!t)return null;var i=pe(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(y.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},Ce=function(e,t){void 0===t&&(t={});var i=we(Ee(e),t),n=oe(i.representationInfo);return Q({dashPlaylists:n,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},Ie=function(e){return ke(Ee(e))}},"89a7":function(e,t,i){"use strict";function n(e,t){return void 0===t&&(t=Object),t&&"function"===typeof t.freeze?t.freeze(e):e}var r=n({HTML:"text/html",isHTML:function(e){return e===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),a=n({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===a.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.freeze=n,t.MIME_TYPE=r,t.NAMESPACE=a},"8b53":function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,r=/^application\/dash\+xml/i,a=function(e){return n.test(e)?"hls":r.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}},"8ba7":function(e,t,i){"use strict";i.r(t);var n,r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"designermsg"},[n("mescroll-vue",{ref:"guestclues",staticClass:"guestcluesmescroll",attrs:{down:e.mescrollDown,up:e.mescrollUp},on:{init:e.mescrollInit}},[n("div",{staticClass:"personmsgbox"},[n("div",{staticClass:"clearfix"},[e.designerobj.headimgurl?n("img",{staticClass:"pull-left headimg",attrs:{src:e.designerobj.headimgurl,alt:"头像"}}):e._e(),e.designerobj.headimgurl?e._e():n("img",{staticClass:"pull-left headimg",attrs:{src:i("c329"),alt:"头像"}}),n("div",{staticClass:"rightpersonmsgbox pull-left"},[n("div",{staticClass:"clearfix"},[n("span",{staticClass:"pull-left font40 fontfps fontw600 color384855 lh56 personame ellipsis"},[e._v(e._s(e.designerobj.title))]),n("span",{staticClass:"pull-left color9DB6CF fontfpr font24 lh34 mgt16"},[e._v(e._s(e.designerobj.position?"["+e.designerobj.position+"]":""))])]),n("div",{staticClass:"mt6 color384855 fontfpr lh34"},[e._v(" "+e._s(e.designerobj.work_years?e.designerobj.work_years+"年设计经验":"暂无填写")+" ")]),n("div",{staticClass:"mgt12"},[n("div",{staticClass:"fontfps font24 color384855 fontw600 lh34"},[e._v("擅长风格:")]),n("div",{staticClass:"stylebox clearfix color71C4FF font20"},[e.showAllType?e._l(e.designerobj.good_at,(function(t,i){return n("span",{key:i,staticClass:"align-center justify-center"},[e._v(e._s(t))])})):e._l(e.designerobj.good_at,(function(t,i){return n("span",{directives:[{name:"show",rawName:"v-show",value:i<5,expression:"idx < 5"}],key:i,staticClass:"align-center justify-center"},[e._v(e._s(t))])})),n("span",{directives:[{name:"show",rawName:"v-show",value:e.designerobj.good_at&&e.designerobj.good_at.length>=5,expression:"designerobj.good_at && designerobj.good_at.length >= 5"}],staticClass:"align-center justify-center fontbolder pull-left",class:{ml16:e.designerobj.good_at&&e.designerobj.good_at.length<3},on:{click:function(t){e.showAllType=!e.showAllType}}},[e._v(e._s(e.showAllType?"收起":"..."))])],2),n("div",{staticClass:"stylebox clearfix color999 font24"},[e._v(" "+e._s(e.designerobj.good_at&&e.designerobj.good_at.length?"":"暂未设置")+" ")])]),n("div",{staticClass:"mgt12"},[n("div",{staticClass:"fontfps font24 color384855 fontw600 lh34"},[e._v("擅长户型:")]),n("div",{staticClass:"clearfix fontfpr font20 color384855 lh40"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!e.designerobj.good_house||!e.designerobj.good_house.length,expression:"!designerobj.good_house || !designerobj.good_house.length"}],staticClass:"font24 color999"},[e._v(" 暂未设置 ")]),e._l(e.designerobj.good_house,(function(t,i){return n("div",{key:i,staticClass:"pull-left"},[e._v(" "+e._s(t)),n("span",{directives:[{name:"show",rawName:"v-show",value:i==e.designerobj.good_house.length-1,expression:"index == designerobj.good_house.length - 1"}],staticClass:"linebox pull-left"},[e._v("|")])])}))],2)])])]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.designerobj.design_concept,expression:"designerobj.design_concept"}],staticClass:"wordbox"},[e._v(" "+e._s(e.designerobj.design_concept?"“"+e.designerobj.design_concept+"”":"")+" ")]),n("div",{staticClass:"resumebox center"},[n("div",{staticClass:"font32 fontfps fontw600 color384855 lh44 left"},[e._v("个人履历")]),n("div",{staticClass:"mt6 resumemsgbox font28 color384855 fontfpr lh46 left",class:{ellipsisFive:e.isShow}},[e._v(" "+e._s(e.designerobj.desc?e.designerobj.desc:"暂无数据")+" ")]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.designerobj.desc&&e.designerobj.desc.length>137,expression:"designerobj.desc && designerobj.desc.length > 137"}],staticClass:"arrow-down",on:{click:function(t){e.isShow=!e.isShow}}},[n("van-icon",{attrs:{name:e.isShow?"arrow-up":"arrow-down",color:"#384855",size:"15"}})],1),n("button",{staticClass:"apointbtn fontfor font36 colorfff bg249efb",attrs:{type:"button"},on:{click:function(t){return t.stopPropagation(),e.apointap()}}},[e._v(" 预约Ta ")])])]),e.designerobj.vcr?n("div",{staticClass:"vcrbox"},[n("div",{staticClass:"vcrtitle center relative lh44 font32 color384855 fontfpr"},[e._v(" 个人VCR ")]),n("div",{staticClass:"mgt16 relative"},[n("video",{ref:"videoPlayer",staticClass:"video-js vcrvideo vjs-default-skin vjs-big-play-centered"})])]):e._e(),e.designerobj.caseCount?n("div",{staticClass:"caselistbox"},[n("div",{staticClass:"vcrtitle center relative lh44 font32 color384855 fontfpr"},[e._v(" 设计案例("+e._s(e.designerobj.caseCount)+") ")]),n("div",{staticClass:"caselist clearfix"},e._l(e.caselist,(function(t,i){return n("div",{directives:[{name:"show",rawName:"v-show",value:!!e.showallcase||i<6,expression:"!showallcase ? (index < 6 ? true : false) : true"}],key:t.id,staticClass:"everycase pull-left",on:{click:function(i){return e.casemsgtap(t.id)}}},[n("div",{staticClass:"casecoverimg"},[n("img",{attrs:{src:t.cover_img+"?x-oss-process=image/resize,w_200"}}),n("div",{staticClass:"casetitbox colorfff lh48 font22 fontfpr"},[n("div",{staticClass:"pull-left ellipsis casename"},[e._v(" "+e._s(t.community.name)+" ")]),n("div",{staticClass:"pull-left linebox"},[e._v("|")]),n("div",{staticClass:"pull-left ellipsis casestyle"},[e._v(" "+e._s(t.decostyle.name)+" ")]),n("div",{staticClass:"pull-left linebox"},[e._v("|")]),n("div",{staticClass:"pull-left"},[e._v(e._s(t.square)+"m²")])])]),n("div",{staticClass:"casefootbox font24 fontfpr color384855"},[n("div",{staticClass:"ellipsis"},[e._v(e._s(t.title))]),n("div",{staticClass:"othercase font16 colorB6CADE clearfix"},[n("div",{staticClass:"pull-left clearfix width50_"},[n("img",{staticClass:"pull-left block",attrs:{src:"https://o.nczyzs.com/xcx/aaa/controlshare.png?x-oss-process=image/resize,w_20"}}),n("div",{staticClass:"pull-left lh40"},[e._v(e._s(t.shared_times))])])])])])})),0),e.caselist.length>6&&!e.showallcase?n("div",{staticClass:"lookmore font28 fontfpr color384855 center",on:{click:e.otherlistfun}},[e._v(" 查看更多>> ")]):e._e()]):e._e()]),n("wzhload",{directives:[{name:"show",rawName:"v-show",value:e.loadFlag,expression:"loadFlag"}]})],1)},a=[],s=i("fc11"),o=(i("c3a6"),i("ad06")),u=(i("b0c0"),i("99af"),i("298b")),l=i("8d6b"),c=i("a92e"),d=i("f0e2"),h=i("18a0"),p=i.n(h),f={name:"designermsg",data:function(){return{loadFlag:!0,isShow:!1,showAllType:!1,designerId:"",designId:"",designerobj:{},caselist:[],mescroll:null,mescrollDown:{auto:!1},mescrollUp:{callback:this.caselistfun,page:{num:0,size:10},htmlLoading:"",htmlNodata:"",noMoreSize:5},player:{},showallcase:!1}},components:(n={},Object(s["a"])(n,o["a"].name,o["a"]),Object(s["a"])(n,"MescrollVue",l["a"]),Object(s["a"])(n,"nonedata",c["a"]),n),created:function(){this.designerId=this.$route.query.did,this.designId=this.$route.query.sid,this.designermsgfun()},methods:{otherlistfun:function(){this.showallcase=!0},casemsgtap:function(e){p.a.miniProgram.navigateTo({url:"/index/pages/casemsg/casemsg?cid="+e})},apointap:function(e){var t=this,i={designer_id:this.designId};Object(u["b"])(i).then((function(e){0==e.data.code&&t.$toast(e.data.msg)}))},designermsgfun:function(){var e=this,t=this,i={id:this.designerId};Object(u["f"])(i).then((function(i){"0"==i.data.code&&(e.designerobj=i.data.data,i.data.data.vcr&&t.$nextTick((function(){e.player=Object(d["a"])(e.$refs.videoPlayer,{autoplay:!1,controls:!0,poster:i.data.data.vcr+"?x-oss-process=video/snapshot,t_100,f_jpg,w_500,m_fast",preload:"auto",bigPlayButton:!0,src:i.data.data.vcr,sources:[{src:i.data.data.vcr}]},(function(){}))}))),e.loadFlag=!1}))},mescrollInit:function(e){this.mescroll=e},caselistfun:function(e,t){var i=this,n={page:e.num,limit:10,id:this.designId};Object(u["d"])(n).then((function(n){0==n.data.code&&(1===e.num&&(i.caselist=[]),i.caselist=i.caselist.concat(n.data.data),i.$nextTick((function(){t.endSuccess(n.data.data.length)})))}))}},mounted:function(){var e=this;this.$nextTick((function(){e.mescroll.resetUpScroll()}))}},m=f,g=(i("0565"),i("2877")),v=Object(g["a"])(m,r,a,!1,null,"216e33dc",null);t["default"]=v.exports},"8c00":function(e,t,i){"use strict";var n=i("be09"),r=function(e,t){return void 0===t&&(t=!1),function(i,r,s){if(i)e(i);else if(r.statusCode>=400&&r.statusCode<=599){var o=s;if(t)if(n.TextDecoder){var u=a(r.headers&&r.headers["content-type"]);try{o=new TextDecoder(u).decode(s)}catch(l){}}else o=String.fromCharCode.apply(null,new Uint8Array(s));e({cause:o})}else e(null,s)}};function a(e){return void 0===e&&(e=""),e.toLowerCase().split(";").reduce((function(e,t){var i=t.split("="),n=i[0],r=i[1];return"charset"===n.trim()?r.trim():e}),"utf-8")}e.exports=r},"8c10":function(e,t){function i(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(r){n=r}return[n,i]}e.exports=i},"8d6b":function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"mescroll",staticClass:"mescroll"},[i("div",[e._t("default")],2)])},r=[],a=i("f868"),s=i.n(a),o=(i("f2fd"),{name:"MeScrollVue",data:function(){return{mescroll:null,lastScrollTop:0,lastBounce:null}},props:{up:Object,down:Object},mounted:function(){this.mescroll=new s.a(this.$refs.mescroll,{up:this.up,down:this.down}),this.$emit("init",this.mescroll)},methods:{beforeRouteEnter:function(){var e=this;this.mescroll&&(this.lastScrollTop&&(this.mescroll.setScrollTop(this.lastScrollTop),setTimeout((function(){e.mescroll.setTopBtnFadeDuration(0)}),16)),null!=this.lastBounce&&this.mescroll.setBounce(this.lastBounce))},beforeRouteLeave:function(){this.mescroll&&(this.lastScrollTop=this.mescroll.getScrollTop(),this.mescroll.hideTopBtn(0),this.lastBounce=this.mescroll.optUp.isBounce,this.mescroll.setBounce(!0))}}}),u=o,l=i("2877"),c=Object(l["a"])(u,n,r,!1,null,null,null);t["a"]=c.exports},9152:function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,i,n,r){var a,s,o=8*r-n-1,u=(1<>1,c=-7,d=i?r-1:0,h=i?-1:1,p=e[t+d];for(d+=h,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=h,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),a-=l}return(p?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,i,n,r,a){var s,o,u,l=8*a-r-1,c=(1<>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+d>=1?h/u:h*Math.pow(2,1-d),t*u>=2&&(s++,u/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*u-1)*Math.pow(2,r),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,r),s=0));r>=8;e[i+p]=255&o,p+=f,o/=256,r-=8);for(s=s<0;e[i+p]=255&s,p+=f,s/=256,l-=8);e[i+p-f]|=128*m}},"99af":function(e,t,i){"use strict";var n=i("23e7"),r=i("da84"),a=i("d039"),s=i("e8b5"),o=i("861d"),u=i("7b0b"),l=i("07fa"),c=i("8418"),d=i("65f0"),h=i("1dde"),p=i("b622"),f=i("2d00"),m=p("isConcatSpreadable"),g=9007199254740991,v="Maximum allowed index exceeded",y=r.TypeError,_=f>=51||!a((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),b=h("concat"),T=function(e){if(!o(e))return!1;var t=e[m];return void 0!==t?!!t:s(e)},S=!_||!b;n({target:"Array",proto:!0,forced:S},{concat:function(e){var t,i,n,r,a,s=u(this),o=d(s,0),h=0;for(t=-1,n=arguments.length;tg)throw y(v);for(i=0;i=g)throw y(v);c(o,h++,a)}return o.length=h,o}})},a559:function(e,t){function i(){return e.exports=i=Object.assign||function(e){for(var t=1;t100)throw new Error("Position must be between 0 and 100.");g=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return v},set:function(e){var t=s(e);t?(v=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return _},set:function(e){var t=s(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");_=t,this.hasBeenReset=!0}}}),this.displayState=void 0}o.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=o},b074:function(e,t,i){var n=i("89a7"),r=i("e1c8"),a=i("b30f"),s=i("e003"),o=r.DOMImplementation,u=n.NAMESPACE,l=s.ParseError,c=s.XMLReader;function d(e){this.options=e||{locator:{}}}function h(e,t,i){if(!e){if(t instanceof p)return t;e=t}var n={},r=e instanceof Function;function a(t){var a=e[t];!a&&r&&(a=2==e.length?function(i){e(t,i)}:e),n[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+m(i))}||function(){}}return i=i||{},a("warning"),a("error"),a("fatalError"),n}function p(){this.cdata=!1}function f(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function m(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function g(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function v(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}d.prototype.parseFromString=function(e,t){var i=this.options,n=new c,r=i.domBuilder||new p,s=i.errorHandler,o=i.locator,l=i.xmlns||{},d=/\/x?html?$/.test(t),f=d?a.HTML_ENTITIES:a.XML_ENTITIES;return o&&r.setDocumentLocator(o),n.errorHandler=h(s,r,o),n.domBuilder=i.domBuilder||r,d&&(l[""]=u.HTML),l.xml=l.xml||u.XML,e&&"string"===typeof e?n.parse(e,l,f):n.errorHandler.error("invalid doc source"),r.doc},p.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,a=r.createElementNS(e,i||t),s=n.length;v(this,a),this.currentElement=a,this.locator&&f(this.locator,a);for(var o=0;o",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({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:"♦"}),t.entityMap=t.HTML_ENTITIES},b639:function(e,t,i){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=i("1fb5"),r=i("9152"),a=i("e3db");function s(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"===typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function _(e){return+e!=e&&(e=0),l.alloc(+e)}function b(e,t){if(l.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Z(e).length;default:if(n)return Q(e).length;t=(""+t).toLowerCase(),n=!0}}function T(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if(i>>>=0,t>>>=0,i<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return U(this,t,i);case"utf8":case"utf-8":return O(this,t,i);case"ascii":return N(this,t,i);case"latin1":case"binary":return M(this,t,i);case"base64":return D(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function w(e,t,i,n,r){if(0===e.length)return-1;if("string"===typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"===typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:E(e,t,i,n,r);if("number"===typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):E(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function E(e,t,i,n,r){var a,s=1,o=e.length,u=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,i/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r){var c=-1;for(a=i;ao&&(i=o-u),a=i;a>=0;a--){for(var d=!0,h=0;hr&&(n=r)):n=r;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;s239?4:l>223?3:l>191?2:1;if(r+d<=i)switch(d){case 1:l<128&&(c=l);break;case 2:a=e[r+1],128===(192&a)&&(u=(31&l)<<6|63&a,u>127&&(c=u));break;case 3:a=e[r+1],s=e[r+2],128===(192&a)&&128===(192&s)&&(u=(15&l)<<12|(63&a)<<6|63&s,u>2047&&(u<55296||u>57343)&&(c=u));break;case 4:a=e[r+1],s=e[r+2],o=e[r+3],128===(192&a)&&128===(192&s)&&128===(192&o)&&(u=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o,u>65535&&u<1114112&&(c=u))}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),r+=d}return R(n)}t.Buffer=l,t.SlowBuffer=_,t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return c(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return h(null,e,t,i)},l.allocUnsafe=function(e){return p(null,e)},l.allocUnsafeSlow=function(e){return p(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,a=Math.min(i,n);r0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),""},l.prototype.compare=function(e,t,i,n,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,r>>>=0,this===e)return 0;for(var a=r-n,s=i-t,o=Math.min(a,s),u=this.slice(n,r),c=e.slice(t,i),d=0;dr)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return k(this,e,t,i);case"utf8":case"utf-8":return C(this,e,t,i);case"ascii":return I(this,e,t,i);case"latin1":case"binary":return x(this,e,t,i);case"base64":return A(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function R(e){var t=e.length;if(t<=L)return String.fromCharCode.apply(String,e);var i="",n=0;while(nn)&&(i=n);for(var r="",a=t;ai)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,i,n,r,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function H(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,a=Math.min(e.length-i,2);r>>8*(n?r:1-r)}function q(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,a=Math.min(e.length-i,4);r>>8*(n?r:3-r)&255}function V(e,t,i,n,r,a){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function W(e,t,i,n,a){return a||V(e,t,i,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,i,n,23,4),i+4}function z(e,t,i,n,a){return a||V(e,t,i,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,i,n,52,8),i+8}l.prototype.slice=function(e,t){var i,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t0&&(r*=256))n+=this[e+--t]*r;return n},l.prototype.readUInt8=function(e,t){return t||j(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||j(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||j(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||j(e,t,this.length);var n=this[e],r=1,a=0;while(++a=r&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||j(e,t,this.length);var n=t,r=1,a=this[e+--n];while(n>0&&(r*=256))a+=this[e+--n]*r;return r*=128,a>=r&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||j(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||j(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||j(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||j(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||j(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||j(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t|=0,i|=0,!n){var r=Math.pow(2,8*i)-1;F(this,e,t,i,r,0)}var a=1,s=0;this[t]=255&e;while(++s=0&&(s*=256))this[t+a]=e/s&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):q(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):q(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);F(this,e,t,i,r-1,-r)}var a=0,s=1,o=0;this[t]=255&e;while(++a>0)-o&255;return t+i},l.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);F(this,e,t,i,r-1,-r)}var a=i-1,s=1,o=0;this[t+a]=255&e;while(--a>=0&&(s*=256))e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):q(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):q(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return W(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return W(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return z(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return z(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--r)e[r+t]=this[r+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"===typeof e)for(a=t;a55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function $(e){for(var t=[],i=0;i>8,r=i%256,a.push(r),a.push(n)}return a}function Z(e){return n.toByteArray(X(e))}function ee(e,t,i,n){for(var r=0;r=t.length||r>=e.length)break;t[r+i]=e[r]}return r}function te(e){return e!==e}}).call(this,i("c8ba"))},be09:function(e,t,i){(function(t){var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=i}).call(this,i("c8ba"))},bf10:function(e,t,i){"use strict";i("c93c")},c329:function(e,t,i){e.exports=i.p+"img/unheadimg.1841be31.jpg"},c93c:function(e,t,i){},d02c:function(e,t,i){var n=i("ef34"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"===typeof r[a]){var s=r[a].split(i);if(2===s.length){var o=s[0],u=s[1];t(o,u)}}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(e,t){var n=new o;u(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"]);break}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(r){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(r){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(r){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=r(),c(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),c(),t.endTime=r(),c(),l(e,t)}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100))&&(this.set(e,t),!0)}};var c=n.createElement&&n.createElement("textarea"),d={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"},f={rt:"ruby"};function m(e,t){function i(){if(!t)return null;function e(e){return t=t.substr(e.length),e}var i=t.match(/^([^<]*)(<[^>]*>?)?/);return e(i[1]?i[1]:i[2])}function n(e){return c.innerHTML=e,e=c.textContent,c.textContent="",e}function r(e,t){return!f[t.localName]||f[t.localName]===e.localName}function a(t,i){var n=d[t];if(!n)return null;var r=e.document.createElement(n),a=p[t];return a&&i&&(r[a]=i.trim()),r}var o,u=e.document.createElement("div"),l=u,m=[];while(null!==(o=i()))if("<"!==o[0])l.appendChild(e.document.createTextNode(n(o)));else{if("/"===o[1]){m.length&&m[m.length-1]===o.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,v=s(o.substr(1,o.length-2));if(v){g=e.document.createProcessingInstruction("timestamp",v),l.appendChild(g);continue}var y=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(g=a(y[1],y[3]),!g)continue;if(!r(l,g))continue;if(y[2]){var _=y[2].split(".");_.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(h.hasOwnProperty(i)){var n=t?"background-color":"color",r=h[i];g.style[n]=r}})),g.className=_.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function v(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function y(e){var t,i=[],n="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function a(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?(e.length=0,n[0]):i}return"ruby"===t.tagName?a(e):t.childNodes?(r(e,t),a(e)):void 0}r(i,e);while(n=a(i))for(var s=0;s=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;ru&&(r=new S(e),s=u),e=new S(a)}return r||a}var a=new S(t),s=t.cue,o=_(s),u=[];if(s.snapToLines){var l;switch(s.vertical){case"":u=["+y","-y"],l="height";break;case"rl":u=["+x","-x"],l="width";break;case"lr":u=["-x","+x"],l="width";break}var c=a.lineHeight,d=c*Math.round(o),h=i[l]+c,p=u[0];Math.abs(d)>h&&(d=d<0?-1:1,d*=Math.ceil(h/c)*c),o<0&&(d+=""===s.vertical?i.height:i.width,u=u.reverse()),a.move(p,d)}else{var f=a.lineHeight/i.height*100;switch(s.lineAlign){case"center":o-=f/2;break;case"end":o-=f;break}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break}u=["+y","-x","+x","-y"],a=new S(t)}var m=r(a,u);t.move(m.toCSSCompatValues(i))}function E(){}b.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},b.prototype.formatStyle=function(e,t){return 0===e?0:e+t},T.prototype=r(b.prototype),T.prototype.constructor=T,S.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;break}},S.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},S.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},S.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},S.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),n=t*i;return n/(this.height*this.width)},S.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},S.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var r={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i};return r},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};var k=.05,C="sans-serif",I="1.5%";E.processCues=function(e,t,i){if(!e||!t||!i)return null;while(i.firstChild)i.removeChild(i.firstChild);var n=e.document.createElement("div");function r(e){for(var t=0;t-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(a),h=String.fromCharCode(9),p=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},f=function(){var e="[^=]*",t='"[^"]*"|[^,]*',i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")},m=function(e){var t,i=e.split(f()),n={},r=i.length;while(r--)""!==i[r]&&(t=/([^=]*)=(.*)/.exec(i[r]).slice(1),t[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},g=function(e){function t(){var t;return t=e.call(this)||this,t.customParsers=[],t.tagMappers=[],t}r()(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;if(e=e.trim(),0!==e.length)if("#"===e[0]){var r=this.tagMappers.reduce((function(t,i){var n=i(e);return n===e?t:t.concat([n])}),[e]);r.forEach((function(e){for(var r=0;r0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if(e.attributes.KEYFORMAT===f){var t=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];return-1===t.indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Object(c["a"])(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},"undefined"!==typeof e.attributes.IV&&(n.iv=e.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(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,m=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange),n&&(i.key=n)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||p,e.attributes?(s.attributes||(s.attributes={}),o()(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],l={default:/yes/i.test(e.attributes.DEFAULT)},l.default?l.autoselect=!0:l.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(l.language=e.attributes.LANGUAGE),e.attributes.URI&&(l.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(l.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(l.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(l.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=l}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){m+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){"undefined"===typeof this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,_.call(this,this.manifest))},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data},skip:function(){this.manifest.skip=y(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;u=!0;var i=this.manifest.segments.length,n=y(e.attributes);s.parts=s.parts||[],s.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=b),b=n.byterange.offset+n.byterange.length);var r=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" for segment #"+i,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,i){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+i+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=y(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),_.call(this,this.manifest),t.canSkipDateranges&&!t.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 t=this.manifest.segments.length,i=y(e.attributes),n=i.type&&"PART"===i.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=n?b:0,n&&(b=i.byterange.offset+i.byterange.length)));var r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),i.type)for(var a=0;ac&&(l-=c,l-=c,l-=f(2))}return Number(l)}),v=function(e,t){var i=void 0===t?{}:t,n=i.le,r=void 0!==n&&n;("bigint"!==typeof e&&"number"!==typeof e||"number"===typeof e&&e!==e)&&(e=0),e=f(e);for(var a=o(e),s=new Uint8Array(new ArrayBuffer(a)),u=0;u=t.length&&u.call(t,(function(t,i){var n=o[i]?o[i]&e[a+i]:e[a+i];return t===n}))}},df33:function(e,t){function i(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"===typeof e)return s[e];var i=String(e),a=n[i.toLowerCase()];if(a)return a;a=r[i.toLowerCase()];return a||(1===i.length?i.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"===typeof e){var i=e.which||e.keyCode||e.charCode;if(null===i||void 0===i)return!1;if("string"===typeof t){var a=n[t.toLowerCase()];if(a)return a===i;a=r[t.toLowerCase()];if(a)return a===i}else if("number"===typeof t)return t===i;return!1}},t=e.exports=i;var n=t.code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91}; /*! * Programatically add the following */ for(a=97;a<123;a++)n[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)n[a-48]=a;for(a=1;a<13;a++)n["f"+a]=a+111;for(a=0;a<10;a++)n["numpad "+a]=a+96;var s=t.names=t.title={};for(a in n)s[n[a]]=a;for(var o in r)n[o]=r[o]},e003:function(e,t,i){var n=i("89a7").NAMESPACE,r=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,a=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),s=new RegExp("^"+r.source+a.source+"*(?::"+r.source+a.source+"*)?$"),o=0,u=1,l=2,c=3,d=4,h=5,p=6,f=7;function m(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,m)}function g(){}function v(e,t,i,r,a){function s(e){if(e>65535){e-=65536;var t=55296+(e>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function o(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?s(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function u(t){if(t>v){var i=e.substring(v,t).replace(/&#?\w+;/g,o);p&&l(v),r.characters(i,0,t-v),v=t}}function l(t,i){while(t>=d&&(i=h.exec(e)))c=i.index,d=c+i[0].length,p.lineNumber++;p.columnNumber=t-c+1}var c=0,d=0,h=/.*(?:\r\n?|\n)|.*$/g,p=r.locator,f=[{currentNSMap:t}],g={},v=0;while(1){try{var w=e.indexOf("<",v);if(w<0){if(!e.substr(v).match(/^\s*$/)){var I=r.doc,x=I.createTextNode(e.substr(v));I.appendChild(x),r.currentElement=x}return}switch(w>v&&u(w),e.charAt(w+1)){case"/":var A=e.indexOf(">",w+3),P=e.substring(w+2,A).replace(/[ \t\n\r]+$/g,""),D=f.pop();A<0?(P=e.substring(w+2).replace(/[\s<].*/,""),a.error("end tag name: "+P+" is not complete:"+D.tagName),A=w+1+P.length):P.match(/\sv?v=A:u(Math.max(w,v)+1)}}function y(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function _(e,t,i,r,a,s){function m(e,t,n){i.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),i.addValue(e,t,n)}var g,v=++t,y=o;while(1){var _=e.charAt(v);switch(_){case"=":if(y===u)g=e.slice(t,v),y=c;else{if(y!==l)throw new Error("attribute equal must after attrName");y=c}break;case"'":case'"':if(y===c||y===u){if(y===u&&(s.warning('attribute value must after "="'),g=e.slice(t,v)),t=v+1,v=e.indexOf(_,t),!(v>0))throw new Error("attribute value no end '"+_+"' match");b=e.slice(t,v).replace(/&#?\w+;/g,a),m(g,b,t-1),y=h}else{if(y!=d)throw new Error('attribute value must after "="');b=e.slice(t,v).replace(/&#?\w+;/g,a),m(g,b,t),s.warning('attribute "'+g+'" missed start quot('+_+")!!"),t=v+1,y=h}break;case"/":switch(y){case o:i.setTagName(e.slice(t,v));case h:case p:case f:y=f,i.closed=!0;case d:case u:case l:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),y==o&&i.setTagName(e.slice(t,v)),v;case">":switch(y){case o:i.setTagName(e.slice(t,v));case h:case p:case f:break;case d:case u:b=e.slice(t,v),"/"===b.slice(-1)&&(i.closed=!0,b=b.slice(0,-1));case l:y===l&&(b=g),y==d?(s.warning('attribute "'+b+'" missed quot(")!'),m(g,b.replace(/&#?\w+;/g,a),t)):(n.isHTML(r[""])&&b.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+b+'" missed value!! "'+b+'" instead!!'),m(b,b,t));break;case c:throw new Error("attribute value missed!!")}return v;case"€":_=" ";default:if(_<=" ")switch(y){case o:i.setTagName(e.slice(t,v)),y=p;break;case u:g=e.slice(t,v),y=l;break;case d:var b=e.slice(t,v).replace(/&#?\w+;/g,a);s.warning('attribute "'+b+'" missed quot(")!!'),m(g,b,t);case h:y=p;break}else switch(y){case l:i.tagName;n.isHTML(r[""])&&g.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+g+'" missed value!! "'+g+'" instead2!!'),m(g,g,t),t=v,y=u;break;case h:s.warning('attribute space is required"'+g+'"!!');case p:y=u,t=v;break;case c:y=d,t=v;break;case f:throw new Error("elements closed character '/' and '>' must be connected to")}}v++}}function b(e,t,i){var r=e.tagName,a=null,s=e.length;while(s--){var o=e[s],u=o.qName,l=o.value,c=u.indexOf(":");if(c>0)var d=o.prefix=u.slice(0,c),h=u.slice(c+1),p="xmlns"===d&&h;else h=u,d=null,p="xmlns"===u&&"";o.localName=h,!1!==p&&(null==a&&(a={},w(i,i={})),i[p]=a[p]=l,o.uri=n.XMLNS,t.startPrefixMapping(p,l))}s=e.length;while(s--){o=e[s];d=o.prefix;d&&("xml"===d&&(o.uri=n.XML),"xmlns"!==d&&(o.uri=i[d||""]))}c=r.indexOf(":");c>0?(d=e.prefix=r.slice(0,c),h=e.localName=r.slice(c+1)):(d=null,h=e.localName=r);var f=e.uri=i[d||""];if(t.startElement(f,h,r,e),!e.closed)return e.currentNSMap=i,e.localNSMap=a,!0;if(t.endElement(f,h,r),a)for(d in a)t.endPrefixMapping(d)}function T(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var a=e.indexOf("",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(i)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,n),r.characters(s,0,s.length),a)}return t+1}function S(e,t,i,n){var r=n[i];return null==r&&(r=e.lastIndexOf(""),rt?(i.comment(e,t+4,a-t-4),a+3):(n.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){a=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,a-t-9),i.endCDATA(),a+3}var s=I(e,t),o=s.length;if(o>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],l=!1,c=!1;o>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],c=o>4&&s[4][0]):/^system$/i.test(s[2][0])&&(c=s[3][0]));var d=s[o-1];return i.startDTD(u,l,c),i.endDTD(),d.index+d[0].length}}return-1}function k(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return i.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function C(){this.attributeNames={}}function I(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);while(i=r.exec(e))if(n.push(i),i[1])return n}m.prototype=new Error,m.prototype.name=m.name,g.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),w(t,t={}),v(e,t,i,n,this.errorHandler),n.endDocument()}},C.prototype={setTagName:function(e){if(!s.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!s.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=g,t.ParseError=m},e1c8:function(e,t,i){var n=i("89a7"),r=n.NAMESPACE;function a(e){return""!==e}function s(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function u(e){if(!e)return[];var t=s(e);return Object.keys(t.reduce(o,{}))}function l(e){return function(t){return e&&-1!==e.indexOf(t)}}function c(e,t){for(var i in e)t[i]=e[i]}function d(e,t){var i=e.prototype;if(!(i instanceof t)){function n(){}n.prototype=t.prototype,n=new n,c(i,n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var h={},p=h.ELEMENT_NODE=1,f=h.ATTRIBUTE_NODE=2,m=h.TEXT_NODE=3,g=h.CDATA_SECTION_NODE=4,v=h.ENTITY_REFERENCE_NODE=5,y=h.ENTITY_NODE=6,_=h.PROCESSING_INSTRUCTION_NODE=7,b=h.COMMENT_NODE=8,T=h.DOCUMENT_NODE=9,S=h.DOCUMENT_TYPE_NODE=10,w=h.DOCUMENT_FRAGMENT_NODE=11,E=h.NOTATION_NODE=12,k={},C={},I=(k.INDEX_SIZE_ERR=(C[1]="Index size error",1),k.DOMSTRING_SIZE_ERR=(C[2]="DOMString size error",2),k.HIERARCHY_REQUEST_ERR=(C[3]="Hierarchy request error",3)),x=(k.WRONG_DOCUMENT_ERR=(C[4]="Wrong document",4),k.INVALID_CHARACTER_ERR=(C[5]="Invalid character",5),k.NO_DATA_ALLOWED_ERR=(C[6]="No data allowed",6),k.NO_MODIFICATION_ALLOWED_ERR=(C[7]="No modification allowed",7),k.NOT_FOUND_ERR=(C[8]="Not found",8)),A=(k.NOT_SUPPORTED_ERR=(C[9]="Not supported",9),k.INUSE_ATTRIBUTE_ERR=(C[10]="Attribute in use",10));k.INVALID_STATE_ERR=(C[11]="Invalid state",11),k.SYNTAX_ERR=(C[12]="Syntax error",12),k.INVALID_MODIFICATION_ERR=(C[13]="Invalid modification",13),k.NAMESPACE_ERR=(C[14]="Invalid namespace",14),k.INVALID_ACCESS_ERR=(C[15]="Invalid access",15);function P(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,P);return i.code=e,t&&(this.message=this.message+": "+t),i}function D(){}function O(e,t){this._node=e,this._refresh=t,L(this)}function L(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var i=e._refresh(e._node);fe(e,"length",i.length),c(i,e),e._inc=t}}function R(){}function N(e,t){var i=e.length;while(i--)if(e[i]===t)return i}function M(e,t,i,n){if(n?t[N(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&W(r,e,n),V(r,e,i))}}function U(e,t,i){var n=N(t,i);if(!(n>=0))throw P(x,new Error(e.tagName+"@"+i));var r=t.length-1;while(n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function H(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(H(e,t))return!0}while(e=e.nextSibling)}function q(){}function V(e,t,i){e&&e._inc++;var n=i.namespaceURI;n===r.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}function W(e,t,i,n){e&&e._inc++;var a=i.namespaceURI;a===r.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function z(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{var r=t.firstChild,a=0;while(r)n[a++]=r,r=r.nextSibling;n.length=a}}}function G(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,z(e.ownerDocument,e),t}function X(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===w){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var s=i?i.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=i,s?s.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return z(e.ownerDocument||e,e),t.nodeType==w&&(t.firstChild=t.lastChild=null),t}function K(e,t){var i=t.parentNode;if(i){var n=e.lastChild;i.removeChild(t);n=e.lastChild}n=e.lastChild;return t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,z(e.ownerDocument,e,t),t}function Y(){this._nsMap={}}function Q(){}function $(){}function J(){}function Z(){}function ee(){}function te(){}function ie(){}function ne(){}function re(){}function ae(){}function se(){}function oe(){}function ue(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,a=n.namespaceURI;if(a&&null==r){r=n.lookupPrefix(a);if(null==r)var s=[{namespace:a,prefix:null}]}return de(this,i,e,t,s),i.join("")}function le(e,t,i){var n=e.prefix||"",a=e.namespaceURI;if(!a)return!1;if("xml"===n&&a===r.XML||a===r.XMLNS)return!1;var s=i.length;while(s--){var o=i[s];if(o.prefix===n)return o.namespace!==a}return!0}function ce(e,t,i){e.push(" ",t,'="',i.replace(/[<&"]/g,F),'"')}function de(e,t,i,n,a){if(a||(a=[]),n){if(e=n(e),!e)return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case p:var s=e.attributes,o=s.length,u=e.firstChild,l=e.tagName;i=r.isHTML(e.namespaceURI)||i;var c=l;if(!i&&!e.prefix&&e.namespaceURI){for(var d,h=0;h=0;y--){var E=a[y];if(""===E.prefix&&E.namespace===e.namespaceURI){d=E.namespace;break}}if(d!==e.namespaceURI)for(y=a.length-1;y>=0;y--){E=a[y];if(E.namespace===e.namespaceURI){E.prefix&&(c=E.prefix+":"+l);break}}}t.push("<",c);for(var k=0;k"),i&&/^script$/i.test(l))while(u)u.data?t.push(u.data):de(u,t,i,n,a.slice()),u=u.nextSibling;else while(u)de(u,t,i,n,a.slice()),u=u.nextSibling;t.push("")}else t.push("/>");return;case T:case w:u=e.firstChild;while(u)de(u,t,i,n,a.slice()),u=u.nextSibling;return;case f:return ce(t,e.name,e.value);case m:return t.push(e.data.replace(/[<&]/g,F).replace(/]]>/g,"]]>"));case g:return t.push("");case b:return t.push("\x3c!--",e.data,"--\x3e");case S:var A=e.publicId,P=e.systemId;if(t.push("");else if(P&&"."!=P)t.push(" SYSTEM ",P,">");else{var D=e.internalSubset;D&&t.push(" [",D,"]"),t.push(">")}return;case _:return t.push("");case v:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function he(e,t,i){var n;switch(t.nodeType){case p:n=t.cloneNode(!1),n.ownerDocument=e;case w:break;case f:i=!0;break}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i){var r=t.firstChild;while(r)n.appendChild(he(e,r,i)),r=r.nextSibling}return n}function pe(e,t,i){var n=new t.constructor;for(var r in t){var a=t[r];"object"!=typeof a&&a!=n[r]&&(n[r]=a)}switch(t.childNodes&&(n.childNodes=new D),n.ownerDocument=e,n.nodeType){case p:var s=t.attributes,o=n.attributes=new R,u=s.length;o._ownerElement=n;for(var l=0;l0},lookupPrefix:function(e){var t=this;while(t){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){var t=this;while(t){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return null==t}},c(h,j),c(h,j.prototype),q.prototype={nodeName:"#document",nodeType:T,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==w){var i=e.firstChild;while(i){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return null==this.documentElement&&e.nodeType==p&&(this.documentElement=e),X(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),G(this,e)},importNode:function(e,t){return he(this,e,t)},getElementById:function(e){var t=null;return H(this.documentElement,(function(i){if(i.nodeType==p&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=u(e);return new O(this,(function(i){var n=[];return t.length>0&&H(i.documentElement,(function(r){if(r!==i&&r.nodeType===p){var a=r.getAttribute("class");if(a){var s=e===a;if(!s){var o=u(a);s=t.every(l(o))}s&&n.push(r)}}})),n}))},createElement:function(e){var t=new Y;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new D;var i=t.attributes=new R;return i._ownerElement=t,t},createDocumentFragment:function(){var e=new ae;return e.ownerDocument=this,e.childNodes=new D,e},createTextNode:function(e){var t=new J;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Z;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ee;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new se;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new Q;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new re;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Y,n=t.split(":"),r=i.attributes=new R;return i.childNodes=new D,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new Q,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},d(q,j),Y.prototype={nodeType:p,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===w?this.insertBefore(e,null):K(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new O(this,(function(t){var i=[];return H(t,(function(n){n===t||n.nodeType!=p||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new O(this,(function(i){var n=[];return H(i,(function(r){r===i||r.nodeType!==p||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},q.prototype.getElementsByTagName=Y.prototype.getElementsByTagName,q.prototype.getElementsByTagNameNS=Y.prototype.getElementsByTagNameNS,d(Y,j),Q.prototype.nodeType=f,d(Q,j),$.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(C[I])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e),r=this.data.substring(e+t);i=n+i+r,this.nodeValue=this.data=i,this.length=i.length}},d($,j),J.prototype={nodeName:"#text",nodeType:m,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},d(J,$),Z.prototype={nodeName:"#comment",nodeType:b},d(Z,$),ee.prototype={nodeName:"#cdata-section",nodeType:g},d(ee,$),te.prototype.nodeType=S,d(te,j),ie.prototype.nodeType=E,d(ie,j),ne.prototype.nodeType=y,d(ne,j),re.prototype.nodeType=v,d(re,j),ae.prototype.nodeName="#document-fragment",ae.prototype.nodeType=w,d(ae,j),se.prototype.nodeType=_,d(se,j),oe.prototype.serializeToString=function(e,t,i){return ue.call(e,t,i)},j.prototype.toString=ue;try{if(Object.defineProperty){function me(e){switch(e.nodeType){case p:case w:var t=[];e=e.firstChild;while(e)7!==e.nodeType&&8!==e.nodeType&&t.push(me(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(O.prototype,"length",{get:function(){return L(this),this.$$length}}),Object.defineProperty(j.prototype,"textContent",{get:function(){return me(this)},set:function(e){switch(this.nodeType){case p:case w:while(this.firstChild)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),fe=function(e,t,i){e["$$"+t]=i}}}catch(ge){}t.DocumentType=te,t.DOMException=P,t.DOMImplementation=B,t.Element=Y,t.Node=j,t.NodeList=D,t.XMLSerializer=oe},e3db:function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},ed6d:function(e,t,i){var n=i("4a4b");function r(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)}e.exports=r,e.exports.__esModule=!0,e.exports["default"]=e.exports},ef34:function(e,t,i){(function(t){var n,r="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},a=i(1);"undefined"!==typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"],n||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=a)),e.exports=n}).call(this,i("c8ba"))},f0e2:function(e,t,i){"use strict";(function(e){for(var n,r=i("be09"),a=i.n(r),s=i("ef34"),o=i.n(s),u=i("a559"),l=i.n(u),c=i("df33"),d=i.n(c),h=i("3c96"),p=i.n(h),f=i("55b5"),m=i.n(f),g=i("8c10"),v=i.n(g),y=i("3603"),_=i.n(y),b=i("2b8c"),T=i.n(b),S=i("b17c"),w=i.n(S),E=i("ed6d"),k=i.n(E),C=i("63ec"),I=i("d749"),x=i("17a3"),A=i("8b53"),P=i("8484"),D=i("81c08"),O=i.n(D),L=i("321f"),R=i("f8a8"),N=i("de66"),M=i("36c6"),U="7.18.1",B={},j=function(e,t){return B[e]=B[e]||[],t&&(B[e]=B[e].concat(t)),B[e]},F=function(e,t){j(e,t)},H=function(e,t){var i=j(e).indexOf(t);return!(i<=-1)&&(B[e]=B[e].slice(),B[e].splice(i,1),!0)},q=function(e,t){j(e,[].concat(t).map((function(t){var i=function i(){return H(e,i),t.apply(void 0,arguments)};return i})))},V={prefixed:!0},W=[["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"]],z=W[0],G=0;G0?u:0)}if(a.a.console){var l=a.a.console[i];l||"debug"!==i||(l=a.a.console.info||a.a.console.log),l&&s&&o.test(i)&&l[Array.isArray(r)?"apply":"call"](a.a.console,r)}}};function Q(e){var t,i="info",n=function(){for(var e=arguments.length,n=new Array(e),r=0;r1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters")}function Pe(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}function De(){return o.a===a.a.document}function Oe(e){return re(e)&&1===e.nodeType}function Le(){try{return a.a.parent!==a.a.self}catch(e){return!0}}function Re(e){return function(t,i){if(!xe(t))return o.a[e](null);xe(i)&&(i=o.a.querySelector(i));var n=Oe(i)?i:o.a;return n[e]&&n[e](t)}}function Ne(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=o.a.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?($.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?Me(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&tt(r,n),r}function Me(e,t){return"undefined"===typeof e.textContent?e.innerText=t:e.textContent=t,e}function Ue(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Be(e,t){return Ae(t),e.classList?e.classList.contains(t):Pe(t).test(e.className)}function je(e,t){return e.classList?e.classList.add(t):Be(e,t)||(e.className=(e.className+" "+t).trim()),e}function Fe(e,t){return e?(e.classList?e.classList.remove(t):(Ae(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e):($.warn("removeClass was called with an element that doesn't exist"),null)}function He(e,t,i){var n=Be(e,t);if("function"===typeof i&&(i=i(e,t)),"boolean"!==typeof i&&(i=!n),i!==n)return i?je(e,t):Fe(e,t),e}function qe(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null===n||"undefined"===typeof n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function Ve(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!==typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function We(e,t){return e.getAttribute(t)}function ze(e,t,i){e.setAttribute(t,i)}function Ge(e,t){e.removeAttribute(t)}function Xe(){o.a.body.focus(),o.a.onselectstart=function(){return!1}}function Ke(){o.a.onselectstart=function(){return!0}}function Ye(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(se(e,"height"))),i.width||(i.width=parseFloat(se(e,"width"))),i}}function Qe(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;while(e.offsetParent&&e!==o.a[V.fullscreenElement])n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function $e(e,t){var i={x:0,y:0};if(ke){var n=e;while(n&&"html"!==n.nodeName.toLowerCase()){var r=se(n,"transform");if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);i.x+=a[4],i.y+=a[5]}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);i.x+=s[12],i.y+=s[13]}n=n.parentNode}}var o={},u=Qe(t.target),l=Qe(e),c=l.width,d=l.height,h=t.offsetY-(l.top-u.top),p=t.offsetX-(l.left-u.left);return t.changedTouches&&(p=t.changedTouches[0].pageX-l.left,h=t.changedTouches[0].pageY+l.top,ke&&(p-=i.x,h-=i.y)),o.y=1-Math.max(0,Math.min(1,h/d)),o.x=Math.max(0,Math.min(1,p/c)),o}function Je(e){return re(e)&&3===e.nodeType}function Ze(e){while(e.firstChild)e.removeChild(e.firstChild);return e}function et(e){return"function"===typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"===typeof e&&(e=e()),Oe(e)||Je(e)?e:"string"===typeof e&&/\S/.test(e)?o.a.createTextNode(e):void 0})).filter((function(e){return e}))}function tt(e,t){return et(t).forEach((function(t){return e.appendChild(t)})),e}function it(e,t){return tt(Ze(e),t)}function nt(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}var rt,at=Re("querySelector"),st=Re("querySelectorAll"),ot=Object.freeze({__proto__:null,isReal:De,isEl:Oe,isInFrame:Le,createEl:Ne,textContent:Me,prependTo:Ue,hasClass:Be,addClass:je,removeClass:Fe,toggleClass:He,setAttributes:qe,getAttributes:Ve,getAttribute:We,setAttribute:ze,removeAttribute:Ge,blockTextSelection:Xe,unblockTextSelection:Ke,getBoundingClientRect:Ye,findPosition:Qe,getPointerPosition:$e,isTextNode:Je,emptyEl:Ze,normalizeContent:et,appendContent:tt,insertContent:it,isSingleLeftClick:nt,$:at,$$:st}),ut=!1,lt=function(){if(!1!==rt.options.autoSetup){var e=Array.prototype.slice.call(o.a.getElementsByTagName("video")),t=Array.prototype.slice.call(o.a.getElementsByTagName("audio")),i=Array.prototype.slice.call(o.a.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function Ct(e,t,i){if(_t.has(e)){var n=_t.get(e);if(n.handlers){if(Array.isArray(t))return Tt(Ct,e,t,i);var r=function(e,t){n.handlers[t]=[],bt(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s=t&&(e.apply(void 0,arguments),i=n)};return n},Nt=function(e,t,i,n){var r;void 0===n&&(n=a.a);var s=function(){n.clearTimeout(r),r=null},o=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||e.apply(a,s)};!r&&i&&e.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,t)};return o.cancel=s,o},Mt=function(){};Mt.prototype.allowedEvents_={},Mt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},kt(this,e,t),this.addEventListener=i},Mt.prototype.addEventListener=Mt.prototype.on,Mt.prototype.off=function(e,t){Ct(this,e,t)},Mt.prototype.removeEventListener=Mt.prototype.off,Mt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},xt(this,e,t),this.addEventListener=i},Mt.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},At(this,e,t),this.addEventListener=i},Mt.prototype.trigger=function(e){var t=e.type||e;"string"===typeof e&&(e={type:t}),e=St(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),It(this,e)},Mt.prototype.dispatchEvent=Mt.prototype.trigger,Mt.prototype.queueTrigger=function(e){var t=this;Pt||(Pt=new Map);var i=e.type||e,n=Pt.get(this);n||(n=new Map,Pt.set(this,n));var r=n.get(i);n["delete"](i),a.a.clearTimeout(r);var s=a.a.setTimeout((function(){0===n.size&&(n=null,Pt["delete"](t)),t.trigger(e)}),0);n.set(i,s)};var Ut=function(e){return"function"===typeof e.name?e.name():"string"===typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},Bt=function(e){return e instanceof Mt||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"===typeof e[t]}))},jt=function(e,t){Bt(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},Ft=function(e){return"string"===typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ht=function(e,t,i){if(!e||!e.nodeName&&!Bt(e))throw new Error("Invalid target for "+Ut(t)+"#"+i+"; must be a DOM node or evented object.")},qt=function(e,t,i){if(!Ft(e))throw new Error("Invalid event type for "+Ut(t)+"#"+i+"; must be a non-empty string or array.")},Vt=function(e,t,i){if("function"!==typeof e)throw new Error("Invalid listener for "+Ut(t)+"#"+i+"; must be a function.")},Wt=function(e,t,i){var n,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(n=t[0],r=t[1],a=t[2]),Ht(n,e,i),qt(r,e,i),Vt(a,e,i),a=Lt(e,a),{isTargetingSelf:s,target:n,type:r,listener:a}},zt=function(e,t,i,n){Ht(e,e,t),e.nodeName?Dt[t](e,i,n):e[t](i,n)},Gt={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=Zt(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return Ne(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return"undefined"===typeof n&&(r=e),r}))),u},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[$t(e.name())]=null,this.childNameIndex_[Qt(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}},s=e.getComponent("Tech");n=Array.isArray(i)?i:Object.keys(i),n.concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"===typeof t?e===t:e===t.name}))}))).map((function(e){var n,r;return"string"===typeof e?(n=e,r=i[n]||t.options_[n]||{}):(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||$t(t.name));return i&&!s.isTech(i)})).forEach(a)}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return at(e,t||this.contentEl())},t.$$=function(e,t){return st(e,t||this.contentEl())},t.hasClass=function(e){return Be(this.el_,e)},t.addClass=function(e){je(this.el_,e)},t.removeClass=function(e){Fe(this.el_,e)},t.toggleClass=function(e,t){He(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return We(this.el_,e)},t.setAttribute=function(e,t){ze(this.el_,e,t)},t.removeAttribute=function(e){Ge(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+$t(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=se(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){var i="offset"+$t(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(d.a.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,i=null,n=10,r=200;this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=a.a.performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){var r=t.touches[0].pageX-i.pageX,a=t.touches[0].pageY-i.pageY,s=Math.sqrt(r*r+a*a);s>n&&(e=!1)}}));var s=function(){e=!1};this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",(function(n){if(i=null,!0===e){var s=a.a.performance.now()-t;s0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[Qt(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function ai(e,t,i){if("number"!==typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}function si(e,t,i,n){return ai(e,n,i.length-1),i[n][t]}function oi(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:si.bind(null,"start",0,e),end:si.bind(null,"end",1,e)},a.a.Symbol&&a.a.Symbol.iterator&&(t[a.a.Symbol.iterator]=function(){return(e||[]).values()}),t}function ui(e,t){return Array.isArray(e)?oi(e):void 0===e||void 0===t?oi():oi([[e,t]])}function li(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=ui(0,0));for(var a=0;at&&(n=t),r+=n-i;return r/t}function ci(e){if(e instanceof ci)return e;"number"===typeof e?this.code=e:"string"===typeof e?this.message=e:re(e)&&("number"===typeof e.code&&(this.code=e.code),ne(this,e)),this.message||(this.message=ci.defaultMessages[this.code]||"")}ri.prototype.supportsRaf_="function"===typeof a.a.requestAnimationFrame&&"function"===typeof a.a.cancelAnimationFrame,ri.registerComponent("Component",ri),ci.prototype.code=0,ci.prototype.message="",ci.prototype.status=null,ci.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ci.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 di=0;di=0;n--)if(t[n].enabled){Si(t,t[n]);break}return i=e.call(this,t)||this,i.changing_=!1,i}m()(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&Si(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,Si(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(bi),Ei=function(e,t){for(var i=0;i=0;n--)if(t[n].selected){Ei(t,t[n]);break}return i=e.call(this,t)||this,i.changing_=!1,Object.defineProperty(p()(i),"selectedIndex",{get:function(){for(var e=0;e0&&(a.a.console&&a.a.console.groupCollapsed&&a.a.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return $.error(e)})),a.a.console&&a.a.console.groupEnd&&a.a.console.groupEnd()),i.flush()},Fi=function(e,t){var i={uri:e},n=Ui(e);n&&(i.cors=n);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),_()(i,Lt(this,(function(e,i,n){if(e)return $.error(e,i);t.loaded_=!0,"function"!==typeof a.a.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return ji(n,t);$.error("vttjs failed to load, stopping trying to process "+t.src)})):ji(n,t)})))},Hi=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=Zt(t,{kind:Di[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=Oi[n.mode]||"disabled",a=n["default"];"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),i=e.call(this,n)||this,i.tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var s=new xi(i.cues_),o=new xi(i.activeCues_),u=!1,l=Lt(p()(i),(function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1))})),c=function(){i.tech_.off("timeupdate",l)};return i.tech_.one("dispose",c),"disabled"!==r&&i.tech_.on("timeupdate",l),Object.defineProperties(p()(i),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){Oi[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||Fi(this.src,this),this.tech_.off("timeupdate",l),"disabled"!==r&&this.tech_.on("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a0)return void this.trigger("vttjsloaded");var t=o.a.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),a.a.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](n,i)}}function mn(e){tn[e.id()]=null}function gn(e,t){var i=tn[e.id()],n=null;if(void 0===i||null===i)return n=t(e),tn[e.id()]=[[t,n]],n;for(var r=0;r0;!this.player_.tech(!0)||(_e||ge)&&t||this.player_.tech(!0).focus(),this.player_.paused()?pi(this.player_.play()):this.player_.pause()}},t}(En);ri.registerComponent("PosterImage",kn);var Cn="#222",In="#ccc",xn={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 An(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Pn(e,t,i){try{e.style[t]=i}catch(n){return}}var Dn=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var s=function(e){return r.updateDisplay(e)};return t.on("loadstart",(function(e){return r.toggleDisplay(e)})),t.on("texttrackchange",s),t.on("loadedmetadata",(function(e){return r.preselectTrack(e)})),t.ready(Lt(p()(r),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",s),t.on("playerresize",s),a.a.addEventListener("orientationchange",s),t.on("dispose",(function(){return a.a.removeEventListener("orientationchange",s)}));for(var e=this.options_.playerOptions.tracks||[],i=0;i0;return pi(t),void(!this.player_.tech(!0)||(_e||ge)&&i||this.player_.tech(!0).focus())}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var a=function(){return r.focus()};hi(t)?t.then(a,(function(){})):this.setTimeout(a,1)}else this.player_.tech(!0).focus()},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(Ln);Rn.prototype.controlText_="Play Video",ri.registerComponent("BigPlayButton",Rn);var Nn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.controlText(i&&i.controlText||n.localize("Close")),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(t){d.a.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Ln);ri.registerComponent("CloseButton",Nn);var Mn=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",(function(e){return n.handlePlay(e)})),n.on(t,"pause",(function(e){return n.handlePause(e)})),i.replay&&n.on(t,"ended",(function(e){return n.handleEnded(e)})),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?pi(this.player_.play()):this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return t.handleSeeked(e)}))},t}(Ln);Mn.prototype.controlText_="Play",ri.registerComponent("PlayToggle",Mn);var Un=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),r=r>0||s>0?r+":":"",n=((r||a>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,r+n+i},Bn=Un;function jn(e){Bn=e}function Fn(){Bn=Un}function Hn(e,t){return void 0===t&&(t=e),Bn(e,t)}var qn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.on(t,["timeupdate","ended"],(function(e){return n.updateContent(e)})),n.updateTextNode_(),n}m()(t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),n=Ne("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return i.appendChild(n),this.contentEl_=Ne("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Hn(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,$.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=o.a.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}})))},i.updateContent=function(e){},t}(ri);qn.prototype.labelText_="Time",qn.prototype.controlText_="Time",ri.registerComponent("TimeDisplay",qn);var Vn=function(e){function t(){return e.apply(this,arguments)||this}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}(qn);Vn.prototype.labelText_="Current Time",Vn.prototype.controlText_="Current Time",ri.registerComponent("CurrentTimeDisplay",Vn);var Wn=function(e){function t(t,i){var n;n=e.call(this,t,i)||this;var r=function(e){return n.updateContent(e)};return n.on(t,"durationchange",r),n.on(t,"loadstart",r),n.on(t,"loadedmetadata",r),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(qn);Wn.prototype.labelText_="Duration",Wn.prototype.controlText_="Duration",ri.registerComponent("DurationDisplay",Wn);var zn=function(e){function t(){return e.apply(this,arguments)||this}m()(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(n),t.appendChild(i),t},t}(ri);ri.registerComponent("TimeDivider",zn);var Gn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.on(t,"durationchange",(function(e){return n.updateContent(e)})),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var t=e.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&t.insertBefore(Ne("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},i.updateContent=function(e){var t;"number"===typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(qn);Gn.prototype.labelText_="Remaining Time",Gn.prototype.controlText_="Remaining Time",ri.registerComponent("RemainingTimeDisplay",Gn);var Xn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.updateShowing(),n.on(n.player(),"durationchange",(function(e){return n.updateShowing(e)})),n}m()(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Ne("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Ne("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(o.a.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(ri);ri.registerComponent("LiveDisplay",Xn);var Kn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}m()(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Ne("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.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"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(Ln);Kn.prototype.controlText_="Seek to live, currently playing live",ri.registerComponent("SeekToLive",Kn);var Yn=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},Qn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.handleMouseDown_=function(e){return n.handleMouseDown(e)},n.handleMouseUp_=function(e){return n.handleMouseUp(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleMouseMove_=function(e){return n.handleMouseMove(e)},n.update_=function(e){return n.update(e)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}m()(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.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)},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=ne({tabIndex:0},i),n=ne({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||ve||e.preventDefault(),Xe(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Ke(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",(function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%"}))),t}},i.getProgress=function(){return Number(Yn(this.getPercent(),0,1).toFixed(4))},i.calculateDistance=function(e){var t=$e(this.el_,e);return this.vertical()?t.y:t.x},i.handleKeyDown=function(t){d.a.isEventKey(t,"Left")||d.a.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):d.a.isEventKey(t,"Right")||d.a.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},i.handleClick=function(e){e.stopPropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(ri);ri.registerComponent("Slider",Qn);var $n=function(e,t){return Yn(e/t*100,0,100).toFixed(2)+"%"},Jn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.partEls_=[],n.on(t,"progress",(function(e){return n.update(e)})),n}m()(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=Ne("span",{className:"vjs-control-text"}),n=Ne("span",{textContent:this.localize("Loaded")}),r=o.a.createTextNode(": ");return this.percentageEl_=Ne("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=$n(r,n);t.percent_!==s&&(t.el_.style.width=s,Me(t.percentageEl_,s),t.percent_=s);for(var o=0;oi.length;d--)t.el_.removeChild(a[d-1]);a.length=i.length}))},t}(ri);ri.registerComponent("LoadProgressBar",Jn);var Zn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.update=Rt(Lt(p()(n),n.update),Ot),n}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=Qe(this.el_),r=Ye(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;sn.width&&(u=n.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(i)}},i.write=function(e){Me(this.el_,e)},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+Hn(u,o)}else a=Hn(i,s);r.update(e,t,a),n&&n()}))},t}(ri);ri.registerComponent("TimeTooltip",Zn);var er=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.update=Rt(Lt(p()(n),n.update),Ot),n}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(ri);er.prototype.options_={children:[]},ke||he||er.prototype.options_.children.push("timeTooltip"),ri.registerComponent("PlayProgressBar",er);var tr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.update=Rt(Lt(p()(n),n.update),Ot),n}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(function(){i.el_.style.left=e.width*t+"px"}))},t}(ri);tr.prototype.options_={children:["timeTooltip"]},ri.registerComponent("MouseTimeDisplay",tr);var ir=5,nr=12,rr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.setEventHandlers_(),n}m()(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=Lt(this,this.update),this.update=Rt(this.update_,Ot),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(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in o.a&&"visibilityState"in o.a&&this.on(o.a,"visibilitychange",this.toggleVisibility_)},i.toggleVisibility_=function(e){"hidden"===o.a.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Ot))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(t){var i=this;if("hidden"!==o.a.visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),i.currentTime_===e&&i.duration_===r||(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Hn(e,r),Hn(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(Ye(i.el()),i.getProgress())})),n}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},i.handleMouseDown=function(t){nt(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e,t){if(void 0===t&&(t=!1),nt(e)){var i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);var n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(n>=.99)return void r.seekToLiveEdge();var a=r.seekableStart(),s=r.liveCurrentTime();if(i=a+n*r.liveWindow(),i>=s&&(i=s),i<=a&&(i=a+.1),i===1/0)return}else i=n*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?pi(this.player_.play()):this.update_()},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+ir)},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-ir)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(t){var i=this.player_.liveTracker;if(d.a.isEventKey(t,"Space")||d.a.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(d.a.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(d.a.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(d()(t))){t.preventDefault(),t.stopPropagation();var n=10*(d.a.codes[d()(t)]-d.a.codes["0"])/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else d.a.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-ir*nr)):d.a.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+ir*nr)):e.prototype.handleKeyDown.call(this,t)},i.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.a&&"visibilityState"in o.a&&this.off(o.a,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(Qn);rr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},ke||he||rr.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),ri.registerComponent("SeekBar",rr);var ar=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.handleMouseMove=Rt(Lt(p()(n),n.handleMouseMove),Ot),n.throttledHandleMouseSeek=Rt(Lt(p()(n),n.handleMouseSeek),Ot),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e)},n.enable(),n}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),a=Qe(r),s=$e(r,e).x;s=Yn(s,0,1),n&&n.update(a,s),i&&i.update(a,t.getProgress())}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){if(this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&pi(this.player_.play())}},i.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(ri);ar.prototype.options_={children:["seekBar"]},ri.registerComponent("ProgressControl",ar);var sr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return n.handlePictureInPictureChange(e)})),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return n.handlePictureInPictureEnabledChange(e)})),n.disable(),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},i.handlePictureInPictureEnabledChange=function(){o.a.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(Ln);sr.prototype.controlText_="Picture-in-Picture",ri.registerComponent("PictureInPictureToggle",sr);var or=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.on(t,"fullscreenchange",(function(e){return n.handleFullscreenChange(e)})),!1===o.a[t.fsApi_.fullscreenEnabled]&&n.disable(),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Ln);or.prototype.controlText_="Fullscreen",ri.registerComponent("FullscreenToggle",or);var ur=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},lr=function(e){function t(){return e.apply(this,arguments)||this}m()(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(ri);ri.registerComponent("VolumeLevel",lr);var cr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.update=Rt(Lt(p()(n),n.update),Ot),n}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i,n){if(!i){var r=Ye(this.el_),a=Ye(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,u=e.width-s+(a.right-e.right),l=r.width/2;or.width&&(l=r.width),this.el_.style.right="-"+l+"px"}this.write(n+"%")},i.write=function(e){Me(this.el_,e)},i.updateVolume=function(e,t,i,n,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){a.update(e,t,i,n.toFixed(0)),r&&r()}))},t}(ri);ri.registerComponent("VolumeLevelTooltip",cr);var dr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.update=Rt(Lt(p()(n),n.update),Ot),n}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t,i){var n=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,(function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"}))},t}(ri);dr.prototype.options_={children:["volumeLevelTooltip"]},ri.registerComponent("MouseVolumeLevelDisplay",dr);var hr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.on("slideractive",(function(e){return n.updateLastVolume_(e)})),n.on(t,"volumechange",(function(e){return n.updateARIAAttributes(e)})),t.ready((function(){return n.updateARIAAttributes()})),n}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){nt(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var i=this.el(),n=Ye(i),r=this.vertical(),a=$e(i,e);a=r?a.y:a.x,a=Yn(a,0,1),t.update(n,a,r)}nt(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(Qn);hr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ke||he||hr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),hr.prototype.playerEvent="volumechange",ri.registerComponent("VolumeBar",hr);var pr=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,("undefined"===typeof i.volumeBar||ae(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,ur(p()(n),t),n.throttledHandleMouseMove=Rt(Lt(p()(n),n.handleMouseMove),Ot),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",(function(e){return n.handleMouseDown(e)})),n.on("touchstart",(function(e){return n.handleMouseDown(e)})),n.on("mousemove",(function(e){return n.handleMouseMove(e)})),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}m()(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(ri);pr.prototype.options_={children:["volumeBar"]},ri.registerComponent("VolumeControl",pr);var fr=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},mr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,fr(p()(n),t),n.on(t,["loadstart","volumechange"],(function(e){return n.update(e)})),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;ke&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)Fe(this.el_,"vjs-vol-"+i);je(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},t}(Ln);mr.prototype.controlText_="Mute",ri.registerComponent("MuteToggle",mr);var gr=function(e){function t(t,i){var n;return void 0===i&&(i={}),"undefined"!==typeof i.inline?i.inline=i.inline:i.inline=!0,("undefined"===typeof i.volumeControl||ae(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),n=e.call(this,t,i)||this,n.handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(t,["loadstart"],(function(e){return n.volumePanelState_(e)})),n.on(n.muteToggle,"keyup",(function(e){return n.handleKeyPress(e)})),n.on(n.volumeControl,"keyup",(function(e){return n.handleVolumeControlKeyUp(e)})),n.on("keydown",(function(e){return n.handleKeyPress(e)})),n.on("mouseover",(function(e){return n.handleMouseOver(e)})),n.on("mouseout",(function(e){return n.handleMouseOut(e)})),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}m()(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.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")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){d.a.isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),kt(o.a,"keyup",this.handleKeyPressHandler_)},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),Ct(o.a,"keyup",this.handleKeyPressHandler_)},i.handleKeyPress=function(e){d.a.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(ri);gr.prototype.options_={children:["muteToggle","volumeControl"]},ri.registerComponent("VolumePanel",gr);var vr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",(function(e){return n.handleKeyDown(e)})),n.boundHandleBlur_=function(e){return n.handleBlur(e)},n.boundHandleTapClick_=function(e){return n.handleTapClick(e)},n}m()(t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof ri&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof ri&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(t){"string"===typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=Ne(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),kt(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||o.a.activeElement;if(!this.children().some((function(e){return e.el()===t}))){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var i=t.filter((function(t){return t.el()===e.target}))[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}},i.handleKeyDown=function(e){d.a.isEventKey(e,"Left")||d.a.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(d.a.isEventKey(e,"Right")||d.a.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice(),i=t.length&&t[0].hasClass("vjs-menu-title");i&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(ri);ri.registerComponent("Menu",vr);var yr=function(e){function t(t,i){var n;void 0===i&&(i={}),n=e.call(this,t,i)||this,n.menuButton_=new Ln(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=Ln.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function(e){return n.handleClick(e)};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",(function(e){return n.handleKeyDown(e)})),n.on(n.menuButton_,"mouseenter",(function(){n.addClass("vjs-hover"),n.menu.show(),kt(o.a,"keyup",n.handleMenuKeyUp_)})),n.on("mouseleave",(function(e){return n.handleMouseLeave(e)})),n.on("keydown",(function(e){return n.handleSubmenuKeyDown(e)})),n}m()(t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},i.createMenu=function(){var e=new vr(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=Ne("li",{className:"vjs-menu-title",textContent:$t(this.options_.title),tabIndex:-1}),i=new ri(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(var n=0;n-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Sr);ri.registerComponent("OffTextTrackMenuItem",wr);var Er=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}m()(t,e);var i=t.prototype;return i.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=Sr),this.label_&&(i=this.label_+" off"),e.push(new wr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(_r);ri.registerComponent("TextTrackButton",Er);var kr=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize($t(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i-1&&(n.label_="captions"),n.menuButton_.controlText($t(n.label_)),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ar(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Dr),t},t}(Er);Or.prototype.kinds_=["captions","subtitles"],Or.prototype.controlText_="Subtitles",ri.registerComponent("SubsCapsButton",Or);var Lr=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,n=e.call(this,t,i)||this,n.track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--)t.push(new Nr(this.player(),{rate:e[i]+"x"}));return t},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){var t=this.player().playbackRate(),i=this.playbackRates(),n=i.indexOf(t),r=(n+1)%i.length;this.player().playbackRate(i[r])},i.handlePlaybackRateschange=function(e){this.update()},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(yr);Mr.prototype.controlText_="Playback Rate",ri.registerComponent("PlaybackRateMenuButton",Mr);var Ur=function(e){function t(){return e.apply(this,arguments)||this}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(t,i,n){return void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i.className||(i.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,i,n)},t}(ri);ri.registerComponent("Spacer",Ur);var Br=function(e){function t(){return e.apply(this,arguments)||this}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(Ur);ri.registerComponent("CustomControlSpacer",Br);var jr=function(e){function t(){return e.apply(this,arguments)||this}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(ri);jr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in o.a&&jr.prototype.options_.children.splice(jr.prototype.options_.children.length-1,0,"pictureInPictureToggle"),ri.registerComponent("ControlBar",jr);var Fr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,n.on(t,"error",(function(e){return n.open(e)})),n}m()(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(_i);Fr.prototype.options_=l()({},_i.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),ri.registerComponent("ErrorDisplay",Fr);var Hr="vjs-text-track-settings",qr=["#000","Black"],Vr=["#00F","Blue"],Wr=["#0FF","Cyan"],zr=["#0F0","Green"],Gr=["#F0F","Magenta"],Xr=["#F00","Red"],Kr=["#FFF","White"],Yr=["#FF0","Yellow"],Qr=["1","Opaque"],$r=["0.5","Semi-Transparent"],Jr=["0","Transparent"],Zr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[qr,Kr,Xr,zr,Vr,Yr,Gr,Wr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Qr,$r,Jr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Kr,qr,Xr,zr,Vr,Yr,Gr,Wr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Qr,$r]},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:[Jr,$r,Qr]}};function ea(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function ta(e,t){var i=e.options[e.options.selectedIndex].value;return ea(i,t)}function ia(e,t,i){if(t)for(var n=0;n',this.localize(r.label),"",'").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},i.createElColors_=function(){return Ne("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return Ne("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return Ne("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e=this;return ie(Zr,(function(t,i,n){var r=ta(e.$(i.selector),i.parser);return void 0!==r&&(t[n]=r),t}),{})},i.setValues=function(e){var t=this;te(Zr,(function(i,n){ia(t.$(i.selector),e[n],i.parser)}))},i.setDefaults=function(){var e=this;te(Zr,(function(t){var i=t.hasOwnProperty("default")?t["default"]:0;e.$(t.selector).selectedIndex=i}))},i.restoreSettings=function(){var e;try{e=JSON.parse(a.a.localStorage.getItem(Hr))}catch(t){$.warn(t)}e&&this.setValues(e)},i.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?a.a.localStorage.setItem(Hr,JSON.stringify(e)):a.a.localStorage.removeItem(Hr)}catch(t){$.warn(t)}}},i.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},i.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()},t}(_i);ri.registerComponent("TextTrackSettings",na);var ra=function(e){function t(t,i){var n,r=i.ResizeObserver||a.a.ResizeObserver;null===i.ResizeObserver&&(r=!1);var s=Zt({createEl:!r,reportTouchActivity:!1},i);return n=e.call(this,t,s)||this,n.ResizeObserver=i.ResizeObserver||a.a.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=Nt((function(){n.resizeHandler()}),100,!1,p()(n)),r?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(t.el())):(n.loadListener_=function(){if(n.el_&&n.el_.contentWindow){var e=n.debouncedHandler_,t=n.unloadListener_=function(){Ct(this,"resize",e),Ct(this,"unload",t),t=null};kt(n.el_.contentWindow,"unload",t),kt(n.el_.contentWindow,"resize",e)}},n.one("load",n.loadListener_)),n}m()(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},i.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},i.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,e.prototype.dispose.call(this)},t}(ri);ri.registerComponent("ResizeManager",ra);var aa={trackingThreshold:20,liveTolerance:15},sa=function(e){function t(t,i){var n,r=Zt(aa,i,{createEl:!1});return n=e.call(this,t,r)||this,n.handleVisibilityChange_=function(e){return n.handleVisibilityChange(e)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(e){return n.handlePlay(e)},n.handleFirstTimeupdate_=function(e){return n.handleFirstTimeupdate(e)},n.handleSeeked_=function(e){return n.handleSeeked(e)},n.seekToLiveEdge_=function(e){return n.seekToLiveEdge(e)},n.reset_(),n.on(n.player_,"durationchange",(function(e){return n.handleDurationchange(e)})),n.on(n.player_,"canplay",(function(){return n.toggleTracking()})),_e&&"hidden"in o.a&&"visibilityState"in o.a&&n.on(o.a,"visibilitychange",n.handleVisibilityChange_),n}m()(t,e);var i=t.prototype;return i.handleVisibilityChange=function(){this.player_.duration()===1/0&&(o.a.hidden?this.stopTracking():this.startTracking())},i.trackLive_=function(){var e=this.player_.seekable();if(e&&e.length){var t=Number(a.a.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;var n=this.liveCurrentTime(),r=this.player_.currentTime(),s=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-r)>this.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(s=!1),s!==this.behindLiveEdge_&&(this.behindLiveEdge_=s,this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.toggleTracking()},i.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())},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Ot),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_)))},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},i.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_)},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},i.seekableEnd=function(){var e=this.player_.seekable(),t=[],i=e?e.length:0;while(i--)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){var e=this.player_.seekable(),t=[],i=e?e.length:0;while(i--)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"===typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},i.dispose=function(){this.off(o.a,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(ri);ri.registerComponent("LiveTracker",sa);var oa,ua=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},i.setScrubbing=function(e){this.isScrubbing_=e},i.scrubbing=function(){return this.isScrubbing_},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Ce?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){$(t,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&he&&ve&&0===this.el_.currentTime){var t=function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))};return this.on("timeupdate",t),NaN}return this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},i.supportsFullScreen=function(){if("function"===typeof this.el_.webkitEnterFullScreen){var e=a.a.navigator&&a.a.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)pi(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}),0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},i.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=o.a.createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t["default"]&&(i["default"]=t["default"]),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks){var i=this.$$("track"),n=i.length;while(n--)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])}},i.getVideoPlaybackQuality=function(){if("function"===typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return"undefined"!==typeof this.el().webkitDroppedFrameCount&&"undefined"!==typeof this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),a.a.performance&&"function"===typeof a.a.performance.now?e.creationTime=a.a.performance.now():a.a.performance&&a.a.performance.timing&&"number"===typeof a.a.performance.timing.navigationStart&&(e.creationTime=a.a.Date.now()-a.a.performance.timing.navigationStart),e},t}(Zi);ga(va,"TEST_VID",(function(){if(De()){var e=o.a.createElement("video"),t=o.a.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}})),va.isSupported=function(){try{va.TEST_VID.volume=.5}catch(e){return!1}return!(!va.TEST_VID||!va.TEST_VID.canPlayType)},va.canPlayType=function(e){return va.TEST_VID.canPlayType(e)},va.canPlaySource=function(e,t){return va.canPlayType(e.type)},va.canControlVolume=function(){try{var e=va.TEST_VID.volume;va.TEST_VID.volume=e/2+.1;var t=e!==va.TEST_VID.volume;return t&&ke?(a.a.setTimeout((function(){va&&va.prototype&&(va.prototype.featuresVolumeControl=e!==va.TEST_VID.volume)})),!1):t}catch(i){return!1}},va.canMuteVolume=function(){try{var e=va.TEST_VID.muted;return va.TEST_VID.muted=!e,va.TEST_VID.muted?ze(va.TEST_VID,"muted","muted"):Ge(va.TEST_VID,"muted","muted"),e!==va.TEST_VID.muted}catch(t){return!1}},va.canControlPlaybackRate=function(){if(he&&ve&&ye<58)return!1;try{var e=va.TEST_VID.playbackRate;return va.TEST_VID.playbackRate=e/2+.1,e!==va.TEST_VID.playbackRate}catch(t){return!1}},va.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(o.a.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(o.a.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(o.a.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(o.a.createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0},va.supportsNativeTextTracks=function(){return Ce||ke&&ve},va.supportsNativeVideoTracks=function(){return!(!va.TEST_VID||!va.TEST_VID.videoTracks)},va.supportsNativeAudioTracks=function(){return!(!va.TEST_VID||!va.TEST_VID.audioTracks)},va.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],i=e[1];ga(va.prototype,t,(function(){return va[i]()}),!0)})),va.prototype.featuresVolumeControl=va.canControlVolume(),va.prototype.movingMediaElementInDOM=!ke,va.prototype.featuresFullscreenResize=!0,va.prototype.featuresProgressEvents=!0,va.prototype.featuresTimeupdateEvents=!0,va.patchCanPlayType=function(){pe>=4&&!me&&!ve&&(oa=va.TEST_VID&&va.TEST_VID.constructor.prototype.canPlayType,va.TEST_VID.constructor.prototype.canPlayType=function(e){var t=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return e&&t.test(e)?"maybe":oa.call(this,e)})},va.unpatchCanPlayType=function(){var e=va.TEST_VID.constructor.prototype.canPlayType;return oa&&(va.TEST_VID.constructor.prototype.canPlayType=oa),e},va.patchCanPlayType(),va.disposeMediaElement=function(e){if(e){e.parentNode&&e.parentNode.removeChild(e);while(e.hasChildNodes())e.removeChild(e.firstChild);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},va.resetMediaElement=function(e){if(e){var t=e.querySelectorAll("source"),i=t.length;while(i--)e.removeChild(t[i]);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){va.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){va.prototype["set"+$t(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){va.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){va.prototype["set"+$t(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){va.prototype[e]=function(){return this.el_[e]()}})),Zi.withSourceHandlers(va),va.nativeSourceHandler={},va.nativeSourceHandler.canPlayType=function(e){try{return va.TEST_VID.canPlayType(e)}catch(t){return""}},va.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return va.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=Mi(e.src);return va.nativeSourceHandler.canPlayType("video/"+i)}return""},va.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},va.nativeSourceHandler.dispose=function(){},va.registerSourceHandler(va.nativeSourceHandler),Zi.registerTech("Html5",va);var ya=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],_a={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},ba=["tiny","xsmall","small","medium","large","xlarge","huge"],Ta={};ba.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Ta[e]="vjs-layout-"+t}));var Sa={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},wa=function(e){function t(i,n,r){var a;if(i.id=i.id||n.id||"vjs_video_"+vt(),n=ne(t.getTagSettings(i),n),n.initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"===typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else{var u=i;while(u&&1===u.nodeType){if(Ve(u).hasOwnProperty("lang")){n.language=u.getAttribute("lang");break}u=u.parentNode}}if(a=e.call(this,null,n,r)||this,a.boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e)},a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e)},a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e)},a.boundApplyInitTime_=function(e){return a.applyInitTime_(e)},a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e)},a.boundHandleTechClick_=function(e){return a.handleTechClick_(e)},a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e)},a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e)},a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e)},a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e)},a.boundHandleTechTap_=function(e){return a.handleTechTap_(e)},a.isFullscreen_=!1,a.log=J(a.id_),a.fsApi_=V,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=i,a.tagAttributes=i&&Ve(i),a.language(a.options_.language),n.languages){var l={};Object.getOwnPropertyNames(n.languages).forEach((function(e){l[e.toLowerCase()]=n.languages[e]})),a.languages_=l}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=n.poster||"",a.controls_=!!n.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach((function(e){if("function"!==typeof a[e])throw new Error('plugin "'+e+'" does not exist')})),a.scrubbing_=!1,a.el_=a.createEl(),Xt(p()(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(kt(o.a,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=Zt(a.options_);n.plugins&&Object.keys(n.plugins).forEach((function(e){a[e](n.plugins[e])})),n.debug&&a.debug(!0),a.options_.playerOptions=c,a.middleware_=[],a.playbackRates(n.playbackRates),a.initChildren(),a.isAudio("audio"===i.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"),Se&&a.addClass("vjs-touch-enabled"),ke||a.addClass("vjs-workinghover"),t.players[a.id_]=p()(a);var d=U.split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",(function(e){return a.listenForUserActivity_(e)})),a.on("stageclick",(function(e){return a.handleStageClick_(e)})),a.on("keydown",(function(e){return a.handleKeyDown(e)})),a.on("languagechange",(function(e){return a.handleLanguagechange(e)})),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a}m()(t,e);var i=t.prototype;return i.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),Ct(o.a,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ct(o.a,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),mn(this),$i.names.forEach((function(e){var t=$i[e],n=i[t.getterName]();n&&n.off&&n.off()})),e.prototype.dispose.call(this)},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var s=Ve(i);if(r){t=this.el_=i,i=this.tag=o.a.createElement("video");while(t.children.length)i.appendChild(t.firstChild);Be(t,"video-js")||je(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{i[e]=t[e]}catch(n){}}))}if(i.setAttribute("tabindex","-1"),s.tabindex="-1",(_e||ve&&Te)&&(i.setAttribute("role","application"),s.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach((function(e){r&&"class"===e||t.setAttribute(e,s[e]),r&&i.setAttribute(e,s[e])})),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==a.a.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=pt("vjs-styles-dimensions");var u=at(".vjs-styles-defaults"),l=at("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=i.getElementsByTagName("a"),d=0;d0?this.videoWidth()+":"+this.videoHeight():"16:9";var r=i.split(":"),s=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/s:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*s,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),ft(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+n+".vjs-fluid {\n padding-top: "+100*s+"%;\n }\n ")}else{var o="number"===typeof this.width_?this.width_:this.options_.width,u="number"===typeof this.height_?this.height_:this.options_.height,l=this.tech_&&this.tech_.el();l&&(o>=0&&(l.width=o),u>=0&&(l.height=u))}},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=$t(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Zi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a=this.autoplay();("string"===typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};$i.names.forEach((function(e){var t=$i[e];s[t.getterName]=i[t.privateName]})),ne(s,this.options_[n]),ne(s,this.options_[r]),ne(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o=Zi.getTech(e);if(!o)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(Lt(this,this.handleTechReady_),!0),vi.jsonToTextTracks(this.textTracksJson_||[],this.tech_),ya.forEach((function(e){i.on(i.tech_,e,(function(t){return i["handleTech"+$t(e)+"_"](t)}))})),Object.keys(_a).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+_a[e]+"_"].bind(i),event:t}):i["handleTech"+_a[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",(function(e){return i.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return i.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return i.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return i.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return i.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return i.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return i.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return i.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return i.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,t){return i.handleTechFullscreenChange_(e,t)})),this.on(this.tech_,"fullscreenerror",(function(e,t){return i.handleTechFullscreenError_(e,t)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return i.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return i.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return i.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return i.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return i.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return i.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||Ue(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;$i.names.forEach((function(t){var i=$i[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=vi.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return void 0===e&&$.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_},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},i.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_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.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_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},i.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"===typeof e){var i,n=function(){var e=t.muted();t.muted(!0);var i=function(){t.muted(e)};t.playTerminatedQueue_.push(i);var n=t.play();if(hi(n))return n["catch"]((function(e){throw i(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))}))};if("any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():n():(i=this.play(),hi(i)&&(i=i["catch"](n))),hi(i))return i.then((function(){t.trigger({type:"autoplay-success",autoplay:e})}))["catch"]((function(){t.trigger({type:"autoplay-failure",autoplay:e})}))}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!==typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=bn(this,t)),this.cache_.source=Zt({},e,{src:t,type:i});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],a=this.$$("source"),s=[],o=0;o0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime(),i=function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))};this.on("timeupdate",i)},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&($.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")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.handleTechClick_=function(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"===typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?pi(this.play()):this.pause()))},i.handleTechDoubleClick_=function(e){if(this.controls_){var t=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}));t||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"===typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},i.handleStageClick_=function(){this.reportUserActivity()},i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var i=this.el(),n=o.a[this.fsApi_.fullscreenElement]===i;!n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}},i.handleTechFullscreenChange_=function(e,t){var i=this;t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(function(){i.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))},i.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},i.techCall_=function(e,t){this.ready((function(){if(e in dn)return un(this.middleware_,this.tech_,e,t);if(e in hn)return ln(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw $(i),i}}),!0)},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in cn)return on(this.middleware_,this.tech_,e);if(e in hn)return ln(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw $("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw $("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw $(t),t}}},i.play=function(){var e=this,t=this.options_.Promise||a.a.Promise;return t?new t((function(t){e.play_(t)})):this.play_()},i.play_=function(e){var t=this;void 0===e&&(e=pi),this.playCallbacks_.push(e);var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(i||!Ce&&!ke||this.load());var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)},i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))},i.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},i.pause=function(){this.techCall_("pause")},i.paused=function(){return!1!==this.techGet_("paused")},i.played=function(){return this.techGet_("played")||ui(0,0)},i.scrubbing=function(e){if("undefined"===typeof e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){return"undefined"!==typeof e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},i.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=ui(0,0)),e},i.bufferedPercent=function(){return li(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},i.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},i.requestFullscreen=function(e){var t=this.options_.Promise||a.a.Promise;if(t){var i=this;return new t((function(t,n){function r(){i.off("fullscreenerror",s),i.off("fullscreenchange",a)}function a(){r(),t()}function s(e,t){r(),n(t)}i.one("fullscreenchange",a),i.one("fullscreenerror",s);var o=i.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(t,n))}))}return this.requestFullscreenHelper_()},i.requestFullscreenHelper_=function(e){var t,i=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then((function(){return i.isFullscreen(!0)}),(function(){return i.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},i.exitFullscreen=function(){var e=this.options_.Promise||a.a.Promise;if(e){var t=this;return new e((function(e,i){function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){n(),e()}function a(e,t){n(),i(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(n,n),s.then(e,i))}))}return this.exitFullscreenHelper_()},i.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=o.a[this.fsApi_.exitFullscreen]();return t&&pi(t.then((function(){return e.isFullscreen(!1)}))),t}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},i.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=o.a.documentElement.style.overflow,kt(o.a,"keydown",this.boundFullWindowOnEscKey_),o.a.documentElement.style.overflow="hidden",je(o.a.body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){d.a.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},i.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Ct(o.a,"keydown",this.boundFullWindowOnEscKey_),o.a.documentElement.style.overflow=this.docOrigOverflow,Fe(o.a.body,"vjs-full-window"),this.trigger("exitFullWindow")},i.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},i.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in o.a&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in o.a)return o.a.exitPictureInPicture()},i.handleKeyDown=function(e){var t=this.options_.userActions;if(t&&t.hotkeys){var i=function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;var i=["button","checkbox","hidden","radio","reset","submit"];if("input"===t)return-1===i.indexOf(e.type);var n=["textarea"];return-1!==n.indexOf(t)};i(this.el_.ownerDocument.activeElement)||("function"===typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}},i.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=void 0===i?function(e){return d.a.isEventKey(e,"f")}:i,r=t.muteKey,a=void 0===r?function(e){return d.a.isEventKey(e,"m")}:r,s=t.playPauseKey,u=void 0===s?function(e){return d.a.isEventKey(e,"k")||d.a.isEventKey(e,"Space")}:s;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();var l=ri.getComponent("FullscreenToggle");!1!==o.a[this.fsApi_.fullscreenEnabled]&&l.prototype.handleClick.call(this,e)}else if(a.call(this,e)){e.preventDefault(),e.stopPropagation();var c=ri.getComponent("MuteToggle");c.prototype.handleClick.call(this,e)}else if(u.call(this,e)){e.preventDefault(),e.stopPropagation();var h=ri.getComponent("PlayToggle");h.prototype.handleClick.call(this,e)}},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1?i.handleSrc_(n.slice(1)):(i.changingSrc_=!1,i.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void i.triggerReady());sn(r,i.tech_)})),this.options_.retryOnError&&n.length>1){var r=function(){i.error(null),i.handleSrc_(n.slice(1),!0)},a=function(){i.off("error",r)};this.one("error",r),this.one("playing",a),this.resetRetryOnError_=function(){i.off("error",r),i.off("playing",a)}}}else this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},i.src=function(e){return this.handleSrc_(e,!1)},i.src_=function(e){var t=this,i=this.selectSource([e]);return!i||(Jt(i.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(i.tech,i.source),this.tech_.ready((function(){t.changingSrc_=!1})),!1))},i.load=function(){this.techCall_("load")},i.reset=function(){var e=this,t=this.options_.Promise||a.a.Promise;if(this.paused()||!t)this.doReset_();else{var i=this.play();pi(i.then((function(){return e.doReset_()})))}},i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Bt(this)&&this.trigger("playerreset")},i.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},i.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,i=e.remainingTimeDisplay;t&&t.updateContent(),i&&i.updateContent()},i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},i.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"===typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"===typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t="undefined"===typeof t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},i.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(j("beforeerror").forEach((function(i){var n=i(t,e);re(n)&&!Array.isArray(n)||"string"===typeof n||"number"===typeof n||null===n?e=n:t.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){var i=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),void this.one("loadstart",(function(){this.off(["click","touchstart"],i)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new ci(e),this.addClass("vjs-error"),$.error("(CODE:"+this.error_.code+" "+ci.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),j("error").forEach((function(e){return e(t,t.error_)}))},i.reportUserActivity=function(e){this.userActivity_=!0},i.userActive=function(e){if(void 0===e)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,t,i,n=Lt(this,this.reportUserActivity),r=function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())},a=function(){n(),this.clearInterval(e),e=this.setInterval(n,250)},s=function(t){n(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",r),this.on("mouseup",s),this.on("mouseleave",s);var o,u=this.getChild("controlBar");!u||ke||he||(u.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),u.on("mouseleave",(function(e){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 e=this.options_.inactivityTimeout;e<=0||(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e,i=t.track;if(i||(i=e),this.tech_)return this.tech_.removeRemoteTextTrack(i)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Bt(this)&&this.trigger("languagechange"))},i.languages=function(){return Zt(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=Zt(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i"):function(){}},Va=1/30,Wa=3*Va,za=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i=t}))},Xa=function(e,t){return za(e,(function(e){return e-Va>=t}))},Ka=function(e){if(e.length<2)return Ua.createTimeRanges();for(var t=[],i=1;i "+e.end(i));return t.join(", ")},$a=function(e,t,i){void 0===i&&(i=1);var n=e.length?e.end(e.length-1):0;return(n-t)/i},Ja=function(e){for(var t=[],i=0;ia||(i+=t>r&&t<=a?a-t:a-r)}return i},is=Ua.createTimeRange,ns=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},rs=function(e){return(e.segments||[]).reduce((function(e,t,i){return t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e}),[])},as=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},ss=function(e){var t=e.preloadSegment;if(t){var i=t.parts,n=t.preloadHints,r=(n||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0);return r+=i&&i.length?i.length:0,r}},os=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=as(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},us=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if("undefined"!==typeof r.start)return{result:r.start,precise:!0};if("undefined"!==typeof r.end)return{result:r.end-r.duration,precise:!0}}while(n--){if(r=e.segments[n],"undefined"!==typeof r.end)return{result:i+r.end,precise:!0};if(i+=ns(e,r),"undefined"!==typeof r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},ls=function(e,t){for(var i,n=0,r=t-e.mediaSequence;rr){var s=[r,n];n=s[0],r=s[1]}if(n<0){for(var o=n;o0)for(var h=l-1;h>=0;h--){var p=u[h];if(o+=p.duration,s){if(o<0)continue}else if(o+Va<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-hs({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i}}if(l<0){for(var f=l;f<0;f++)if(o-=t.targetDuration,o<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};l=0}for(var m=l;m0)continue}else if(o-Va>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+hs({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i}},gs=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},vs=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ys=function(e){var t=gs(e);return!e.disabled&&!t},_s=function(e){return e.disabled},bs=function(e){for(var t=0;t-1&&o!==s.length-1&&(i._HLS_part=o),(o>-1||s.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var u=new a.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&u.searchParams.set(e,i[e])})),e=u.toString()}return e},Fs=function(e,t){if(!e)return t;var i=Us(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var n=0;n=500?4:2},this.trigger("error")},i.parseManifest_=function(e){var t=this,i=e.url,n=e.manifestString;return Ps({onwarn:function(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n)},oninfo:function(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n)},manifestString:n,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var t=e.playlistString,i=e.playlistObject,n=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=i||this.parseManifest_({url:n,manifestString:t});a.lastRequest=Date.now(),Os({playlist:a,uri:n,id:r});var s=zs(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Gs(this.media(),!!s)),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),a.a.clearTimeout(this.mediaUpdateTimeout),a.a.clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"===typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(a.a.clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=a.a.setTimeout(this.media.bind(this,e,!1),n)}else{var r=this.state,s=!this.media_||e.id!==this.media_.id,o=this.master.playlists[e.id];if(o&&o.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(s&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Gs(e,!0)),s){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=Ha(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange")}}))}}},i.pause=function(){this.mediaUpdateTimeout&&(a.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},i.load=function(e){var t=this;this.mediaUpdateTimeout&&(a.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=a.a.setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},i.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(a.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=a.a.setTimeout((function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)}),e))},i.start=function(){var e=this;if(this.started=!0,"object"===typeof this.src)return this.src.uri||(this.src.uri=a.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){e.setupInitialPlaylist(e.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=Ha(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n)}}))},i.srcUri=function(){return"string"===typeof this.src?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Ms(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=Vs(e),e.segments.forEach((function(t){qs(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||a.a.location.href;this.master=Ns(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Bs),Ks=Ua.xhr,Ys=Ua.mergeOptions,Qs=function(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},$s=function(){var e=function e(t,i){t=Ys({timeout:45e3},t);var n=e.beforeRequest||Ua.Vhs.xhr.beforeRequest;if(n&&"function"===typeof n){var r=n(t);r&&(t=r)}var a=!0===Ua.Vhs.xhr.original?Ks:Ua.Vhs.xhr,s=a(t,(function(e,t){return Qs(s,e,t,i)})),o=s.abort;return s.abort=function(){return s.aborted=!0,o.apply(s,arguments)},s.uri=t.uri,s.requestTime=Date.now(),s};return e.original=!0,e},Js=function(e){var t,i=e.offset;return t="bigint"===typeof e.offset||"bigint"===typeof e.length?a.a.BigInt(e.offset)+a.a.BigInt(e.length)-a.a.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t},Zs=function(e){var t={};return e.byterange&&(t.Range=Js(e.byterange)),t},eo=function(e,t){return e.start(t)+"-"+e.end(t)},to=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},io=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},no=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},ro=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},ao=function(e){return e.resolvedUri},so=function(e){for(var t,i,n=Array.prototype.slice.call(e),r=16,a="",s=0;sl?null:(i>o&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:Is.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})},mo=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i,n=0,r=0;rn){if(e>n+a.duration*co)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},go=function(e,t){var i,n;try{i=new Date(e),n=new Date(t)}catch(s){}var r=i.getTime(),a=n.getTime();return(a-r)/1e3},vo=function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t=c+l)return o(t,{response:a.subarray(l,l+c),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:s,responseType:"arraybuffer",headers:Zs({byterange:e.sidx.byterange})},o)}))}else this.mediaRequest_=a.a.setTimeout((function(){return i(!1)}),0)},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},a.a.clearTimeout(this.minimumUpdatePeriodTimeout_),a.a.clearTimeout(this.mediaRequest_),a.a.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()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"===typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,(function(n){t.haveMetadata({startingState:i,playlist:e})})))},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),a.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(a.a.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},i.load=function(e){var t=this;a.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=a.a.setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},i.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_((function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=a.a.setTimeout((function(){return e.haveMaster_()}),0)},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(i,n){if(!t.requestErrored_(i,n)){var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=Ha(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(n,r)}))):e(n,r)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},i.syncClientServerClock_=function(e){var t=this,i=Object(P["d"])(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Fa(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var a;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}})))},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,t=ko({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=Co(e,t,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=t||e;var i=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return i&&i!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)},i.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(a.a.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!==typeof t||t<=0?t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"):this.createMUPTimeout_(t)},i.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=a.a.setTimeout((function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)},i.refreshXml_=function(){var e=this;this.requestMaster_((function(t,i){i&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=Ao(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,(function(t){e.refreshMedia_(e.media().id)})))}))},i.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var i=this.masterPlaylistLoader_.master.playlists,n=!this.media_||this.media_!==i[e];if(n?this.media_=i[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var r=function e(){t.media().endList||(t.mediaUpdateTimeout=a.a.setTimeout((function(){t.trigger("mediaupdatetimeout"),e()}),Gs(t.media(),Boolean(n))))};r()}this.trigger("loadedplaylist")},t}(So),Do={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},Oo=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t],i)if(2===arguments.length)for(r=i.length,n=0;n>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},a=function(){return i(E.ftyp,k,C,k,I)},v=function(e){return i(E.hdlr,P[e])},s=function(e){return i(E.mdat,e)},g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),i(E.mdhd,t)},m=function(e){return i(E.mdia,g(e),v(e.type),u(e))},o=function(e){return i(E.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return i(E.minf,"video"===e.type?i(E.vmhd,D):i(E.smhd,O),n(),_(e))},l=function(e,t){var n=[],r=t.length;while(r--)n[r]=T(t[r]);return i.apply(null,[E.moof,o(e)].concat(n))},c=function(e){var t=e.length,n=[];while(t--)n[t]=p(e[t]);return i.apply(null,[E.moov,h(4294967295)].concat(n).concat(d(e)))},d=function(e){var t=e.length,n=[];while(t--)n[t]=S(e[t]);return i.apply(null,[E.mvex].concat(n))},h=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return i(E.mvhd,t)},y=function(e){var t,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n>>8),s.push(255&r[t].byteLength),s=s.concat(Array.prototype.slice.call(r[t]));for(t=0;t>>8),o.push(255&a[t].byteLength),o=o.concat(Array.prototype.slice.call(a[t]));if(n=[E.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i(E.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),i(E.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(i(E.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 i.apply(null,n)},t=function(e){return i(E.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),r(e))}}(),f=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return i(E.tkhd,t)},T=function(e){var t,n,r,a,s,o,u;return t=i(E.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(e.baseMediaDecodeTime/q),u=Math.floor(e.baseMediaDecodeTime%q),n=i(E.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,u>>>24&255,u>>>16&255,u>>>8&255,255&u])),s=92,"audio"===e.type?(r=w(e,s),i(E.traf,t,n,r)):(a=y(e),r=w(e,a.length+s),i(E.traf,t,n,r,a))},p=function(e){return e.duration=e.duration||4294967295,i(E.trak,f(e),m(e))},S=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),i(E.trex,t)},function(){var e,t,n;n=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var r,a,s,o,u,l;for(o=e.samples||[],t+=20+16*o.length,s=n(o,t),a=new Uint8Array(s.length+16*o.length),a.set(s),r=s.length,l=0;l>>24,a[r++]=(16711680&u.duration)>>>16,a[r++]=(65280&u.duration)>>>8,a[r++]=255&u.duration,a[r++]=(4278190080&u.size)>>>24,a[r++]=(16711680&u.size)>>>16,a[r++]=(65280&u.size)>>>8,a[r++]=255&u.size,a[r++]=u.flags.isLeading<<2|u.flags.dependsOn,a[r++]=u.flags.isDependedOn<<6|u.flags.hasRedundancy<<4|u.flags.paddingValue<<1|u.flags.isNonSyncSample,a[r++]=61440&u.flags.degradationPriority,a[r++]=15&u.flags.degradationPriority,a[r++]=(4278190080&u.compositionTimeOffset)>>>24,a[r++]=(16711680&u.compositionTimeOffset)>>>16,a[r++]=(65280&u.compositionTimeOffset)>>>8,a[r++]=255&u.compositionTimeOffset;return i(E.trun,a)},e=function(e,t){var r,a,s,o,u,l;for(o=e.samples||[],t+=20+8*o.length,s=n(o,t),r=new Uint8Array(s.length+8*o.length),r.set(s),a=s.length,l=0;l>>24,r[a++]=(16711680&u.duration)>>>16,r[a++]=(65280&u.duration)>>>8,r[a++]=255&u.duration,r[a++]=(4278190080&u.size)>>>24,r[a++]=(16711680&u.size)>>>16,r[a++]=(65280&u.size)>>>8,r[a++]=255&u.size;return i(E.trun,r)},w=function(i,n){return"audio"===i.type?e(i,n):t(i,n)}}();var V,W,z,G,X,K,Y,Q,$={ftyp:a,mdat:s,moof:l,moov:c,initSegment:function(e){var t,i=a(),n=c(e);return t=new Uint8Array(i.byteLength+n.byteLength),t.set(i),t.set(n,i.byteLength),t}},J=function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},te=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ie=function(e,t){var i=te();return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},ne=function(e,t){var i,n,r,a,s,o=t||0,u=[];for(i=0;ife.ONE_SECOND_IN_TS/2))){for(a=he()[e.samplerate],a||(a=t[0].data),s=0;s=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},ye=function(e){var t,i,n=[];for(t=0;t=this.virtualRowCount&&"function"===typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);while(this.rows.length>this.virtualRowCount)this.rows.shift(),this.rowIdx--},Ue.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Ue.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Ue.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Be=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new Ue(-1),this.windows=[],this.stream=i,"string"===typeof t&&this.createTextDecoder(t)};Be.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new Ue(i),"function"===typeof t&&(this.windows[i].beforeRowOverflow=t)},Be.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Be.prototype.createTextDecoder=function(e){if("undefined"===typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var je=function e(t){t=t||{},e.prototype.init.call(this);var i,n=this,r=t.captionServices||{},a={};Object.keys(r).forEach((function(e){i=r[e],/^SERVICE/.test(e)&&(a[e]=i.encoding)})),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};je.prototype=new B,je.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},je.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},je.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r>5,n=31&a,7===i&&n>0&&(a=t[r++],i=a),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},je.prototype.pushServiceBlock=function(e,t,i){var n,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r>5,a.rowLock=(16&n)>>4,a.columnLock=(8&n)>>3,a.priority=7&n,n=i[++e],a.relativePositioning=(128&n)>>7,a.anchorVertical=127&n,n=i[++e],a.anchorHorizontal=n,n=i[++e],a.anchorPoint=(240&n)>>4,a.rowCount=15&n,n=i[++e],a.columnCount=63&n,n=i[++e],a.windowStyle=(56&n)>>3,a.penStyle=7&n,a.virtualRowCount=a.rowCount+1,e},je.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},je.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},je.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},je.prototype.displayWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)n&1<>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},je.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},je.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},je.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Fe={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},He=function(e){return null===e?"":(e=Fe[e]||e,String.fromCharCode(e))},qe=14,Ve=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],We=function(){var e=[],t=qe+1;while(t--)e.push("");return e},ze=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if(t=32639&e.ccData,t!==this.lastControlCode_){if(4096===(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=We();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=We();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=We()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))n=(3&n)<<8,a=He(n|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"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),n=(3&n)<<8,a=He(n|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14===(14&r)&&this.addFormatting(e.pts,["i"]),1===(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=Ve.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16===(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14===(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=He(n),a+=He(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};ze.prototype=new B,ze.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(i){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},ze.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=We(),this.nonDisplayed_=We(),this.lastControlCode_=null,this.column_=0,this.row_=qe,this.rollUpRows_=2,this.formatting_=[]},ze.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_},ze.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},ze.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},ze.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},ze.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},ze.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},ze.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},ze.prototype.isNormalChar=function(e){return e>=32&&e<=127},ze.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=qe,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=We(),this.displayed_=We()),void 0!==t&&t!==this.row_)for(var i=0;i"}),"");this[this.mode_](e,i)},ze.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+""}),"");this.formatting_=[],this[this.mode_](e,t)}},ze.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},ze.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},ze.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(i=-1);while(Math.abs(t-e)>Ye)e+=i*Ke;return e},Je=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||Qe,this.push=function(e){this.type_!==Qe&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=$e(e.dts,n),e.pts=$e(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Je.prototype=new B;var Ze,et={TimestampRolloverStream:Je,handleRollover:$e},tt=function(e,t,i){var n,r="";for(n=t;n>>2;d*=4,d+=3&c[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=s}while(i>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid){i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Xe.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Xe.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},ot.prototype=new B,ot.STREAM_TYPES={h264:27,adts:15},ut=function(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function(e,t){var i,n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,i,n){var r,a=new Uint8Array(e.size),o={type:i},u=0,l=0,c=!1;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u>5,o=1024*(1+(3&t[l+6])),u=o*vt/yt[(60&t[l+2])>>>2],t.byteLength-l>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:yt[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),i++,l+=r}else"number"!==typeof c&&(c=l),l++;"number"===typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},mt.prototype=new B;var _t,bt=mt;_t=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return n-=r,n>0?i<<=r:t>0&&this.loadWord(),r=e-r,r>0?a<>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Tt,St,wt,Et=_t;St=function(){var e,t,i=0;St.prototype.init.call(this),this.push=function(n){var r;t?(r=new Uint8Array(t.byteLength+n.data.byteLength),r.set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var a=t.byteLength;i3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},St.prototype=new B,wt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Tt=function(){var e,t,i,n,r,a,s,o=new St;Tt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:i,dts:n,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp";break}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var i,n,r=8,a=8;for(i=0;i>4;return i=i>=0?i:0,r?i+20:i+10},At=function e(t,i){return t.length-i<10||t[i]!=="I".charCodeAt(0)||t[i+1]!=="D".charCodeAt(0)||t[i+2]!=="3".charCodeAt(0)?i:(i+=xt(t,i),e(t,i))},Pt=function(e){var t=At(e,0);return e.length>=t+2&&255===(255&e[t])&&240===(240&e[t+1])&&16===(22&e[t+1])},Dt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ot=function(e,t,i){var n,r="";for(n=t;n>5,n=e[t+4]<<3,r=6144&e[t+3];return r|n|i},Nt=function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240===(240&e[t+1])?"audio":null},Mt=function(e){var t=0;while(t+5>>2];t++}return null},Ut=function(e){var t,i,n,r;t=10,64&e[5]&&(t+=4,t+=Dt(e.subarray(10,14)));do{if(i=Dt(e.subarray(t+4,t+8)),i<1)return null;if(r=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]),"PRIV"===r){n=e.subarray(t+10,t+i+10);for(var a=0;a>>2;return u*=4,u+=3&o[7],u}break}}t+=10,t+=i}while(t=3)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!==(255&e[u])||240!==(240&e[u+1]))u++;else{if(e.length-u<7)break;if(o=Bt.parseAdtsSize(e,u),u+o>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(o=Bt.parseId3TagSize(e,u),u+o>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}},kt.prototype=new B;var jt,Ft,Ht,qt,Vt=kt,Wt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],zt=Wt,Gt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Xt=Gt,Kt=Ct.H264Stream,Yt=Bt.isLikelyAacData,Qt=fe.ONE_SECOND_IN_TS,$t=function(e,t){t.stream=e,this.trigger("log",t)},Jt=function(e,t){for(var i=Object.keys(t),n=0;n=-u&&i<=o&&(!n||l>i)&&(n=a,l=i)));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,u,l;a=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;while(tn.pts?t++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration)}return 0===i?e:i===e.length?null:(l=e.slice(i),l.byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,o,u;t=s.length-1,i=e.length-1,a=null,o=!1;while(t>=0&&i>=0){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===s.length-1&&(a=i),i--)}if(!o&&null===a)return null;if(u=o?i:a,0===u)return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return 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(e){s=e}},jt.prototype=new B,qt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,e=e||{},"undefined"!==typeof e.remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"===typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,qt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},qt.prototype=new B,qt.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Xt.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,zt.forEach((function(e){s.info[e]=this.audioTrack[e]}),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=$.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},qt.prototype.setRemux=function(e){this.remuxTracks=e},Ht=function(e){var t,i,n=this,r=!0;Ht.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new gt.MetadataStream,r.aacStream=new Vt,r.audioTimestampRolloverStream=new gt.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new gt.TimestampRolloverStream("timed-metadata"),r.adtsStream=new bt,r.coalesceStream=new qt(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ft(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Jt(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new gt.MetadataStream,r.packetStream=new gt.TransportPacketStream,r.parseStream=new gt.TransportParseStream,r.elementaryStream=new gt.ElementaryStream,r.timestampRolloverStream=new gt.TimestampRolloverStream,r.adtsStream=new bt,r.h264Stream=new Kt,r.captionStream=new gt.CaptionStream(e),r.coalesceStream=new qt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){s=a.tracks.length;while(s--)t||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||(i=a.tracks[s],i.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[s],t.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime);t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new jt(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ft(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Jt(this,r)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,ke.clearDtsInfo(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,ke.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=Yt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ht.prototype=new B;var ti,ii={Transmuxer:Ht,VideoSegmentStream:jt,AudioSegmentStream:Ft,AUDIO_PROPERTIES:zt,VIDEO_PROPERTIES:Xt,generateSegmentTimingInfo:ei},ni=function(e){return e>>>0},ri=function(e){return("00"+e.toString(16)).slice(-2)},ai={toUnsigned:ni,toHexString:ri},si=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]),t},oi=si,ui=ai.toUnsigned,li=function e(t,i){var n,r,a,s,o,u=[];if(!i.length)return null;for(n=0;n1?n+r:t.byteLength,a===i[0]&&(1===i.length?u.push(t.subarray(n+8,s)):(o=e(t.subarray(n+8,s),i.slice(1)),o.length&&(u=u.concat(o)))),n=s;return u},ci=li,di=ai.toUnsigned,hi=H.getUint64,pi=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=hi(e.subarray(4)):t.baseMediaDecodeTime=di(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},fi=pi,mi=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},gi=mi,vi=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),d=8;r&&(i.dataOffset=n.getInt32(d),d+=4),a&&c&&(t={flags:gi(e.subarray(d,d+4))},d+=4,s&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),c--);while(c--)t={},s&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),u&&(t.flags=gi(e.subarray(d,d+4)),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},yi=vi,_i=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},bi=_i,Ti="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{};ti="undefined"!==typeof window?window:"undefined"!==typeof Ti?Ti:"undefined"!==typeof self?self:{};var Si,wi,Ei,ki,Ci,Ii,xi=ti,Ai=Oe.discardEmulationPreventionBytes,Pi=Ge.CaptionStream,Di=function(e,t){for(var i=e,n=0;n0?fi(c[0]).baseMediaDecodeTime:0,h=ci(s,["trun"]);t===l&&h.length>0&&(i=Li(h,d,u),n=Oi(a,i,l),r[l]||(r[l]={seiNals:[],logs:[]}),r[l].seiNals=r[l].seiNals.concat(n.seiNals),r[l].logs=r[l].logs.concat(n.logs))})),r},Ni=function(e,t,i){var n;if(null===t)return null;n=Ri(e,t);var r=n[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:i}},Mi=function(){var e,t,i,n,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new Pi,s=!0,a=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0})),e.on("log",(function(e){r.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"===typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))i=a[0],n=s[i];else if(null===i||!n)return t.push(e),null;while(t.length>0){var u=t.shift();this.parse(u,a,s)}return o=Ni(e,i,n),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Ui=Mi,Bi=ai.toUnsigned,ji=ai.toHexString,Fi=H.getUint64;Si=function(e){var t={},i=ci(e,["moov","trak"]);return i.reduce((function(e,t){var i,n,r,a,s;return i=ci(t,["tkhd"])[0],i?(n=i[0],r=0===n?12:20,a=Bi(i[r]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),s=ci(t,["mdia","mdhd"])[0],s?(n=s[0],r=0===n?12:20,e[a]=Bi(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null):null}),t)},wi=function(e,t){var i;i=ci(t,["moof","traf"]);var n=i.reduce((function(t,i){var n,r,a=ci(i,["tfhd"])[0],s=Bi(a[4]<<24|a[5]<<16|a[6]<<8|a[7]),o=e[s]||9e4,u=ci(i,["tfdt"])[0],l=new DataView(u.buffer,u.byteOffset,u.byteLength);return n=1===u[0]?Fi(u.subarray(4,12)):l.getUint32(4),"bigint"===typeof n?r=n/xi.BigInt(o):"number"!==typeof n||isNaN(n)||(r=n/o),r11?(r.codec+=".",r.codec+=ji(c[9]),r.codec+=ji(c[10]),r.codec+=ji(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=h.subarray(28),d=oi(c.subarray(4,8)),"esds"===d&&c.length>20&&0!==c[19]?(r.codec+="."+ji(c[19]),r.codec+="."+ji(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var p=ci(e,["mdia","mdhd"])[0];p&&(r.timescale=Ii(p)),i.push(r)})),i};var Hi={findBox:ci,parseType:oi,timescale:Si,startTime:wi,compositionStartTime:Ei,videoTrackIds:ki,tracks:Ci,getTimescaleFromMediaHeader:Ii},qi=function(e){var t=31&e[1];return t<<=8,t|=e[2],t},Vi=function(e){return!!(64&e[1])},Wi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},zi=function(e,t){var i=qi(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},Gi=function(e){var t=Vi(e),i=4+Wi(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},Xi=function(e){var t={},i=Vi(e),n=4+Wi(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r,a,s;r=(15&e[n+1])<<8|e[n+2],a=3+r-4,s=(15&e[n+10])<<8|e[n+11];var o=12+s;while(o=e.byteLength)return null;var n,r=null;return n=e[i+7],192&n&&(r={},r.pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,r.pts*=4,r.pts+=(6&e[i+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,r.dts*=4,r.dts+=(6&e[i+18])>>>1)),r},Qi=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},$i=function(e){for(var t,i=4+Wi(e),n=e.subarray(i),r=0,a=0,s=!1;a3&&(t=Qi(31&n[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(s=!0)),s},Ji={parseType:zi,parsePat:Gi,parsePmt:Xi,parsePayloadUnitStartIndicator:Vi,parsePesType:Ki,parsePesTime:Yi,videoPacketContainsKeyFrame:$i},Zi=et.handleRollover,en={};en.ts=Ji,en.aac=Bt;var tn=fe.ONE_SECOND_IN_TS,nn=188,rn=71,an=function(e,t){var i,n,r=0,a=nn;while(a=0)if(e[u]!==rn||e[l]!==rn&&l!==e.byteLength)u--,l--;else{switch(n=e.subarray(u,l),r=en.ts.parseType(n,t.pid),r){case"pes":a=en.ts.parsePesType(n,t.table),s=en.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&s&&(o=en.ts.parsePesTime(n),o&&(o.type="audio",i.audio.push(o),c=!0));break}if(c)break;u-=nn,l-=nn}},on=function(e,t,i){var n,r,a,s,o,u,l,c,d=0,h=nn,p=!1,f={data:[],size:0};while(h=0)if(e[d]!==rn||e[h]!==rn)d--,h--;else{switch(n=e.subarray(d,h),r=en.ts.parseType(n,t.pid),r){case"pes":a=en.ts.parsePesType(n,t.table),s=en.ts.parsePayloadUnitStartIndicator(n),"video"===a&&s&&(o=en.ts.parsePesTime(n),o&&(o.type="video",i.video.push(o),p=!0));break}if(p)break;d-=nn,h-=nn}},un=function(e,t){if(e.audio&&e.audio.length){var i=t;("undefined"===typeof i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Zi(e.dts,i),e.pts=Zi(e.pts,i),e.dtsTime=e.dts/tn,e.ptsTime=e.pts/tn}))}if(e.video&&e.video.length){var n=t;if(("undefined"===typeof n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=Zi(e.dts,n),e.pts=Zi(e.pts,n),e.dtsTime=e.dts/tn,e.ptsTime=e.pts/tn})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=Zi(r.dts,n),r.pts=Zi(r.pts,n),r.dtsTime=r.dts/tn,r.ptsTime=r.pts/tn}}},ln=function(e){var t,i=!1,n=0,r=null,a=null,s=0,o=0;while(e.length-o>=3){var u=en.aac.parseType(e,o);switch(u){case"timed-metadata":if(e.length-o<10){i=!0;break}if(s=en.aac.parseId3TagSize(e,o),s>e.length){i=!0;break}null===a&&(t=e.subarray(o,o+s),a=en.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){i=!0;break}if(s=en.aac.parseAdtsSize(e,o),s>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+s),r=en.aac.parseSampleRate(t)),n++,o+=s;break;default:o++;break}if(i)return null}if(null===r||null===a)return null;var l=tn/r,c={audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*l,pts:a+1024*n*l}]};return c},cn=function(e){var t={pid:null,table:null},i={};for(var n in an(e,t),t.table)if(t.table.hasOwnProperty(n)){var r=t.table[n];switch(r){case Xe.H264_STREAM_TYPE:i.video=[],on(e,t,i),0===i.video.length&&delete i.video;break;case Xe.ADTS_STREAM_TYPE:i.audio=[],sn(e,t,i),0===i.audio.length&&delete i.audio;break}}return i},dn=function(e,t){var i,n=en.aac.isLikelyAacData(e);return i=n?ln(e):cn(e),i&&(i.audio||i.video)?(un(i,t),i):null},hn={inspect:dn,parseAudioPes_:sn},pn=function(e,t){t.on("data",(function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){var i={start:{decode:fe.videoTsToSeconds(t.start.dts),presentation:fe.videoTsToSeconds(t.start.pts)},end:{decode:fe.videoTsToSeconds(t.end.dts),presentation:fe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:fe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=fe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){var i={start:{decode:fe.videoTsToSeconds(t.start.dts),presentation:fe.videoTsToSeconds(t.start.pts)},end:{decode:fe.videoTsToSeconds(t.end.dts),presentation:fe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:fe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=fe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:fe.videoTsToSeconds(t.start),end:fe.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:fe.videoTsToSeconds(t.start),end:fe.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))},fn=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new ii.Transmuxer(this.options),pn(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Ui,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,i=e.data,n=Hi.startTime(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:i},[i.buffer])},t.probeMp4Tracks=function(e){var t=e.data,i=Hi.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!==typeof i||isNaN(i)?void 0:i*fe.ONE_SECOND_IN_TS,r=hn.inspect(t,n),a=null;r&&(a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1},a.hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(fe.secondsToVideoTs(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(fe.secondsToVideoTs(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new fn(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new fn(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))),jo=No(Bo),Fo=function(e,t,i){var n=e.data.segment,r=n.type,a=n.initSegment,s=n.captions,o=n.captionStreams,u=n.metadata,l=n.videoFrameDtsTime,c=n.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};"undefined"!==typeof l&&(h.videoFrameDtsTime=l),"undefined"!==typeof c&&(h.videoFramePtsTime=c),i(h)},Ho=function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)},qo=function(e,t){t.gopInfo=e.data.gopInfo},Vo=function(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,v=e.isEndOfTimeline,y={buffer:[]},_=v,b=function(i){t.currentTransmux===e&&("data"===i.data.action&&Fo(i,y,s),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&qo(i,y),"audioTimingInfo"===i.data.action&&u(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&l(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&c(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&d(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,Ho({transmuxedData:y,callback:f}),Wo(t))))};if(t.onmessage=b,n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),"undefined"!==typeof a&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var T=i instanceof ArrayBuffer?i:i.buffer,S=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:T,byteOffset:S,byteLength:i.byteLength},[T])}v&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Wo=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"===typeof e.currentTransmux?e.currentTransmux():Vo(e.currentTransmux))},zo=function(e,t){e.postMessage({action:t}),Wo(e)},Go=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void zo(t,e);t.transmuxQueue.push(zo.bind(null,t,e))},Xo=function(e){Go("reset",e)},Ko=function(e){Go("endTimeline",e)},Yo=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Vo(e);e.transmuxer.transmuxQueue.push(e)},Qo=function(e){var t=new jo;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t},$o={reset:Xo,endTimeline:Ko,transmux:Yo,createTransmuxer:Qo},Jo=function(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=l()({},e,{endAction:null,transmuxer:null,callback:null}),a=function r(a){a.data.action===i&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),n(a.data))};if(t.addEventListener("message",a),e.data){var s=e.data instanceof ArrayBuffer;r.byteOffset=s?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var o=[s?e.data:e.data.buffer];t.postMessage(r,o)}else t.postMessage(r)},Zo={FAILURE:2,TIMEOUT:-101,ABORTED:-102},eu=function(e){e.forEach((function(e){e.abort()}))},tu=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},iu=function(e){var t=e.target,i=Date.now()-t.requestTime,n={bandwidth:1/0,bytesReceived:0,roundTripTime:i||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},nu=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Zo.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Zo.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Zo.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Zo.FAILURE,xhr:t}:null},ru=function(e,t,i){return function(n,r){var a=r.response,s=nu(n,r);if(s)return i(s,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Zo.FAILURE,xhr:r},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l1)return gu("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]})),t},Tu=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Su=function(e,t){var i=t.attributes||{},n=bu(vu(t)||[]);if(yu(e,t)&&!n.audio&&!_u(e,t)){var r=bu(Object(x["d"])(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},wu=qa("PlaylistSelector"),Eu=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},ku=function(e,t){if(!e)return"";var i=a.a.getComputedStyle(e);return i?i[t]:""},Cu=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},Iu=function(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||a.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||a.a.Number.MAX_VALUE,i-n},xu=function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||a.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||a.a.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},Au=function(e,t,i,n,r,s){if(e){var o={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},u=e.playlists;Is.isAudioOnly(e)&&(u=s.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=u.map((function(e){var t,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||a.a.Number.MAX_VALUE,{bandwidth:t,width:i,height:n,playlist:e}}));Cu(l,(function(e,t){return e.bandwidth-t.bandwidth})),l=l.filter((function(e){return!Is.isIncompatible(e.playlist)}));var c=l.filter((function(e){return Is.isEnabled(e.playlist)}));c.length||(c=l.filter((function(e){return!Is.isDisabled(e.playlist)})));var d=c.filter((function(e){return e.bandwidth*Do.BANDWIDTH_VARIANCEi||e.height>n})),_=y.filter((function(e){return e.width===y[0].width&&e.height===y[0].height})),h=_[_.length-1],b=_.filter((function(e){return e.bandwidth===h.bandwidth}))[0]),s.experimentalLeastPixelDiffSelector){var w=g.map((function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e}));Cu(w,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),T=w[0]}var E=T||b||S||p||c[0]||l[0];if(E&&E.playlist){var k="sortedPlaylistReps";return T?k="leastPixelDiffRep":b?k="resolutionPlusOneRep":S?k="resolutionBestRep":p?k="bandwidthBestRep":c[0]&&(k="enabledPlaylistReps"),wu("choosing "+Eu(E)+" using "+k+" with options",o),E.playlist}return wu("could not choose a playlist with options",o),null}},Pu=function(){var e=this.useDevicePixelRatio&&a.a.devicePixelRatio||1;return Au(this.playlists.master,this.systemBandwidth,parseInt(ku(this.tech_.el(),"width"),10)*e,parseInt(ku(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},Du=function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&a.a.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Au(this.playlists.master,t,parseInt(ku(this.tech_.el(),"width"),10)*n,parseInt(ku(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},Ou=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter((function(e){return!Is.isIncompatible(e)})),c=l.filter(Is.isEnabled);c.length||(c=l.filter((function(e){return!Is.isDisabled(e)})));var d=c.filter(Is.hasAttribute.bind(null,"BANDWIDTH")),h=d.map((function(e){var t=u.getSyncPoint(e,r,o,i),l=t?1:2,c=Is.estimateSegmentRequestTime(a,n,e),d=c*l-s;return{playlist:e,rebufferingImpact:d}})),p=h.filter((function(e){return e.rebufferingImpact<=0}));return Cu(p,(function(e,t){return Iu(t.playlist,e.playlist)})),p.length?p[0]:(Cu(h,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),h[0]||null)},Lu=function(){var e=this,t=this.playlists.master.playlists.filter(Is.isEnabled);Cu(t,(function(e,t){return Iu(e,t)}));var i=t.filter((function(t){return!!Su(e.playlists.master,t).video}));return i[0]||null},Ru=function(e){var t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((function(e){t.set(e,i),i+=e.byteLength}))),t},Nu=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},s=i,o=i,u=!1,l=a[n];l&&(s=l.label,o=l.language,u=l["default"]),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:u,label:s,language:o},!1).track}}},Mu=function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=a.a.WebKitDataCue||a.a.VTTCue;i.forEach((function(e){var i=e.stream;t[i].addCue(new r(e.startTime+n,e.endTime+n,e.text))}))}},Uu=function(e){Object.defineProperties(e.frame,{id:{get:function(){return Ua.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Ua.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Ua.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},Bu=function(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var s=a.a.WebKitDataCue||a.a.VTTCue,o=t.metadataTrack_;if(o&&(i.forEach((function(e){var t=e.cueTime+n;!("number"!==typeof t||a.a.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var i=new s(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,Uu(i),o.addCue(i)}))})),o.cues&&o.cues.length)){for(var u=o.cues,l=[],c=0;c=e&&r.endTime<=t&&i.removeCue(r)}},Hu=function(e){var t=e.cues;if(t)for(var i=0;i1&&n.push(t[a]));n.length&&n.forEach((function(t){return e.removeCue(t)}))}},qu=function(e,t,i){if("undefined"===typeof t||null===t||!e.length)return[];var n,r=Math.ceil((t-i+3)*M["ONE_SECOND_IN_TS"]);for(n=0;nr)break;return e.slice(n)},Vu=function(e,t,i){if(!t.length)return e;if(i)return t.slice();var n=t[0].pts,r=0;for(r;r=n)break;return e.slice(0,r).concat(t)},Wu=function(e,t,i,n){var r=Math.ceil((t-n)*M["ONE_SECOND_IN_TS"]),a=Math.ceil((i-n)*M["ONE_SECOND_IN_TS"]),s=e.slice(),o=e.length;while(o--)if(e[o].pts<=a)break;if(-1===o)return s;var u=o+1;while(u--)if(e[u].pts<=r)break;return u=Math.max(u,0),s.splice(u,o-u+1),s},zu=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(var r=0;ri))return a}return 0===n.length?0:n[n.length-1]},Ku=1,Yu=500,Qu=function(e){return"number"===typeof e&&isFinite(e)},$u=1/60,Ju=function(e,t,i){return"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null},Zu=function(e,t,i){var n=t-Do.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));var r=t-i;return Math.min(r,n)},el=function(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,c=e.mediaIndex,d=e.partIndex,h=e.timeline,p=l.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var m="number"===typeof d,g=e.segment.uri?"segment":"pre-segment",v=m?ss({preloadSegment:n})-1:0;return g+" ["+(s+c)+"/"+(s+p)+"]"+(m?" part ["+d+"/"+v+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+h+"] selected by ["+f+"] playlist ["+o+"]"},tl=function(e){return e+"TimingInfo"},il=function(e){var t=e.segmentTimeline,i=e.currentTimeline,n=e.startOfSegment,r=e.buffered,a=e.overrideCheck;return a||t!==i?tt&&(t=r)}})),"bigint"===typeof t&&ti+Va},sl=function(e,t){if("hls"!==t)return null;var i=rl({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;var n=e.playlist.targetDuration,r=al({segmentDuration:i,maxDuration:2*n}),a=al({segmentDuration:i,maxDuration:n}),s="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+i+" when the reported duration is "+e.duration+" and the target duration is "+n+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return r||a?{severity:r?"warn":"info",message:s}:null},ol=function(e){function t(t,i){var n;if(n=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!==typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.captionServices_=t.captionServices,n.experimentalExactManifestTimings=t.experimentalExactManifestTimings,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_=Ua.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_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.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_=qa("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(p()(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,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}m()(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return $o.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&a.a.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},i.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,a.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},i.error=function(e){return"undefined"!==typeof e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&$o.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ua.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=ro(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=ao(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.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"))},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}n&&(n.mediaIndex-=a,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},i.pause=function(){this.checkBufferTimeout_&&(a.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return null===this.checkBufferTimeout_},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&$o.reset(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"})},i.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r=1,a=function(){r--,0===r&&i()};for(var s in!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=Wu(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)Fu(e,t,this.inbandTextTracks_[s]);Fu(e,t,this.segmentMetadataTrack_),a()}else this.logger_("skipping remove because no source updater or starting media info")},i.monitorBuffer_=function(){this.checkBufferTimeout_&&a.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=a.a.setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&a.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=a.a.setTimeout(this.monitorBufferTick_.bind(this),Yu)},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"===typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"===typeof e&&t.segments[e],r=e+1===t.segments.length,a=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},i.chooseNextRequest_=function(){var e=this.buffered_(),t=es(e)||0,i=ts(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=Xu(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],u="number"===typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[u+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=u+1):s.mediaIndex=this.mediaIndex+1}else{var l=Is.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),c=l.segmentIndex,d=l.startTime,h=l.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"===typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"===typeof s.partIndex&&!f)return null;if("number"!==typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!i&&f&&!f.independent)if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var v=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&v&&!this.seeking_()?null:this.generateSegmentInfo_(s)},i.generateSegmentInfo_=function(e){var t=e.independent,i=e.playlist,n=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=i.segments[n],c="number"===typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:n,partIndex:c?s:null,isSyncRequest:a,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},h="undefined"!==typeof o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=es(this.sourceUpdater_.audioBuffered());return"number"===typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=qu(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},i.timestampOffsetForSegment_=function(e){return il(e)},i.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=Is.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),a=$a(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(r<=a)){var s=Ou({master:this.vhs_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a,u=o-s.rebufferingImpact,l=.5;a<=Va&&(l=1),!s.playlist||s.playlist.uri===this.playlist_.uri||u "+s+" for "+e),Nu(u,i.vhs_.tech_,e),Fu(n,s,u[e]),Mu({captionArray:o,inbandTextTracks:u,timestampOffset:r})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t))}else this.logger_("SegmentLoader received no captions from a caption event")},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var n=this.pendingSegment_;if(n.hasAppendedData_){var r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();ju(this.inbandTextTracks_,i,this.vhs_.tech_),Bu({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i))}},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!nl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},i.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed;return!(n&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!nl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[tl(t.type)].start;else{var n,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!==typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){var a=ro(n);if(this.activeInitSegmentId_===a)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=a}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,s=e.bytes,o=this.sourceUpdater_.audioBuffered(),u=this.sourceUpdater_.videoBuffered();o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ja(o).join(", ")),u.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ja(u).join(", "));var l=o.length?o.start(0):0,c=o.length?o.end(o.length-1):0,d=u.length?u.start(0):0,h=u.length?u.end(u.length-1):0;if(c-l<=Ku&&h-d<=Ku)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+s.byteLength+", audio buffer: "+Ja(o).join(", ")+", video buffer: "+Ja(u).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:s}));var p=this.currentTime_(),f=p-Ku;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+f),this.remove(0,f,(function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+Ku+"s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=a.a.setTimeout((function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()}),1e3*Ku)}),!0)},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;t&&(t.code!==Gu?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r}))},i.appendToSourceBuffer_=function(e){var t=e.segmentInfo,i=e.type,n=e.initSegment,r=e.data,a=e.bytes;if(!a){var s=[r],o=r.byteLength;n&&(s.unshift(n),o+=n.byteLength),a=Ru({bytes:o,segments:s})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:i,bytes:a},this.handleAppendError_.bind(this,{segmentInfo:t,type:i,bytes:a}))},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}},i.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"===typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var i=l()({},e,{forceTimestampOffset:!0});l()(e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)}))},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=n||r&&a;this.logger_("Requesting "+el(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=mu({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(i){var n=i.message,r=i.level,a=i.stream;t.logger_(el(e)+" logged from transmuxer stream "+a+" as a "+r+": "+n)}})},i.trimBackBuffer_=function(e){var t=Zu(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=a}return t.map&&(n.map=this.initSegmentForMap(t.map)),n},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<$u?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+$u):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},i.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},i.segmentRequestFinished_=function(e,t,i){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Zo.ABORTED)return;return this.pause(),e.code===Zo.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=Vu(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}},i.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},i.updateMediaSecondsLoaded_=function(e){"number"===typeof e.start&&"number"===typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},i.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if("undefined"!==typeof t)return t;if(!s)return u.start;var l=i.segments[n-1];return 0!==n&&l&&"undefined"!==typeof l.start&&l.end===r+a?o.start:r},i.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&n,s=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!==typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},i.checkForIllegalMediaSwitch=function(e){var t=Ju(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},i.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"===typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo,n=i&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"===typeof n.end?n.end:n.start+e.duration)},i.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=sl(e,this.sourceType_);if(t&&("warn"===t.severity?Ua.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+el(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var i=e.segment,n=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,a=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_("bad "+(r?"segment":"part")+" "+el(e)),void this.resetEverything();var s=null!==this.mediaIndex;s&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+el(e))},i.recordThroughput_=function(e){if(e.duration<$u)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+$u);else{var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},i.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(Qu(i)&&Qu(n)){Fu(i,n,this.segmentMetadataTrack_);var r=a.a.WebKitDataCue||a.a.VTTCue,s={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},o=JSON.stringify(s),u=new r(i,n,o);u.value=s,this.segmentMetadataTrack_.addCue(u)}}},t}(Ua.EventTarget);function ul(){}var ll,cl=function(e){return"string"!==typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))},dl=["video","audio"],hl=function(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},pl=function(e,t){for(var i=0;i=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Zo.TIMEOUT&&this.handleTimeout_(),e.code===Zo.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var s=r.segment;if(s.map&&(s.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!==typeof a.a.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var o,u=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",o),n.stopForError({message:"Error loading vtt.js"})};return o=function(){n.subtitlesTrack_.tech_.off("vttjserror",u),n.segmentRequestFinished_(e,t,i)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",o),void this.subtitlesTrack_.tech_.one("vttjserror",u)}s.requested=!0;try{this.parseVTTCues_(r)}catch(l){return void this.stopForError({message:l.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=s.duration,r.cues.forEach((function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new a.a.VTTCue(e.startTime,e.endTime,e.text):e)})),Hu(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"===typeof a.a.TextDecoder?t=new a.a.TextDecoder("utf8"):(t=a.a.WebVTT.StringDecoder(),i=!0);var n=new a.a.WebVTT.Parser(a.a,a.a.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t},n.onparsingerror=function(e){Ua.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=Tl(r)),n.parse(r)}var s=e.bytes;i&&(s=Tl(s)),n.parse(s),n.flush()},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/M["ONE_SECOND_IN_TS"]-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}else n.empty=!0},t}(ol),El=function(e,t){for(var i=e.cues,n=0;n=r.adStartTime&&t<=r.adEndTime)return r}return null},kl=function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,s=0;s=p)&&(s=p,a={time:h,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return a}return null}}],xl=function(e){function t(t){var i;return i=e.call(this)||this,i.timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=qa("SyncController"),i}m()(t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+hs({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))},i.runStrategies_=function(e,t,i,n){for(var r=[],a=0;aCl)Ua.log.warn("Not saving expired segment info. Media sequence gap "+i+" is too large.");else for(var n=i-1;n>=0;n--){var r=e.segments[n];if(r&&"undefined"!==typeof r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&i&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3)},i.timestampOffsetForTimeline=function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].time},i.mappingForTimeline=function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"===typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=n,s.end=r),(!a.start||no){var u=void 0;u=s<0?i.start-hs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+hs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o}}}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(Ua.EventTarget),Al=function(e){function t(){var t;return t=e.call(this)||this,t.pendingTimelineChanges_={},t.lastTimelineChanges_={},t}m()(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"===typeof i&&"number"===typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"===typeof i&&"number"===typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(Ua.EventTarget),Pl=Mo(Uo((function(){function e(e,i,n){return n={path:i,exports:{},require:function(e,i){return t(e,void 0===i||null===i?n.path:i)}},e(n,n.exports),n.exports}function t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=e((function(e){function t(e,t){for(var i=0;i-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n>7))^e]=e;for(t=i=0;!h[t];t^=n||1,i=m[i]||1)for(s=i^i<<1^i<<2^i<<3^i<<4,s=s>>8^255&s^99,h[t]=s,p[s]=t,a=f[r=f[n=f[t]]],u=16843009*a^65537*r^257*n^16843008*t,o=257*f[s]^16843008*s,e=0;e<4;e++)c[e][t]=o=o<<24^o>>>8,d[e][s]=u=u<<24^u>>>8;for(e=0;e<5;e++)c[e]=c[e].slice(0),d[e]=d[e].slice(0);return l},u=null,l=function(){function e(e){var t,i,n;u||(u=o()),this._tables=[[u[0][0].slice(),u[0][1].slice(),u[0][2].slice(),u[0][3].slice(),u[0][4].slice()],[u[1][0].slice(),u[1][1].slice(),u[1][2].slice(),u[1][3].slice(),u[1][4].slice()]];var r=this._tables[0][4],a=this._tables[1],s=e.length,l=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var c=e.slice(0),d=[];for(this._key=[c,d],t=s;t<4*s+28;t++)n=c[t-1],(t%s===0||8===s&&t%s===4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%s===0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),c[t]=c[t-s]^n;for(i=0;t;i++,t--)n=c[3&i?t:t-4],d[i]=t<=4||i<4?n:a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}var t=e.prototype;return t.decrypt=function(e,t,i,n,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=n^c[1],p=i^c[2],f=t^c[3],m=c.length/4-2,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],T=v[3],S=v[4];for(l=0;l>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=y[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=y[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=y[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[d>>>24]<<24^S[h>>16&255]<<16^S[p>>8&255]<<8^S[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s},e}(),c=function(e){function t(){var t;return t=e.call(this,a)||this,t.jobs=[],t.delay=1,t.timeout_=null,t}r(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(a),d=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},h=function(e,t,i){var n,r,a,s,o,u,c,h,p,f=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new l(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),v=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],s=i[3],p=0;p=0&&(t="main-desc"),t},Ll=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Rl=function(e,t){t.activePlaylistLoader=e,e.load()},Nl=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.getActiveGroup(),u=a.activePlaylistLoader,l=a.lastGroup_;o&&l&&o.id===l.id||(a.lastGroup_=o,a.lastTrack_=s,Ll(n,a),o&&!o.isMasterPlaylist&&(o.playlistLoader?(n.resyncLoader(),Rl(o.playlistLoader,a)):u&&r.resetEverything()))}},Ml=function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];n.lastGroup_=null,i.abort(),i.pause()}},Ul=function(e,t){return function(){var i=t.masterPlaylistLoader,n=t.segmentLoaders,r=n[e],a=n.main,s=t.mediaTypes[e],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!o||c.id!==o.id)&&(s.lastGroup_=u,s.lastTrack_=o,Ll(r,s),u)){if(u.isMasterPlaylist){if(!o||!c||o.id===c.id)return;var d=t.vhs.masterPlaylistController_,h=d.selectPlaylist();if(d.media()===h)return;return s.logger_("track change. Switching master audio from "+c.id+" to "+o.id),i.pause(),a.resetEverything(),void d.fastQualityChange_(h)}if("AUDIO"===e){if(!u.playlistLoader)return a.setAudio(!0),void a.resetEverything();r.setAudio(!0),a.setAudio(!1)}l!==u.playlistLoader?(r.track&&r.track(o),r.resetEverything(),Rl(u.playlistLoader,s)):Rl(u.playlistLoader,s)}}},Bl={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Ll(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e["default"]}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Ua.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 r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Ua.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Ll(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},jl={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Bl[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Bl[e](e,i))}},Fl={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,h=Cs(d.master);for(var p in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main["default"].playlists=d.master.playlists)),s[e])for(var f in u[p]||(u[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(c("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Xs(m.playlists[0],i,a):m.resolvedUri?new Xs(m.resolvedUri,i,a):m.playlists&&"dash"===n?new Po(m.playlists[0],i,a,d):null,m=Ua.mergeOptions({id:f,playlistLoader:g},m),jl[e](e,m.playlistLoader,t),u[p].push(m),"undefined"===typeof l[f]){var v=new Ua.AudioTrack({id:f,kind:Ol(m),enabled:!1,language:m.language,default:m["default"],label:f});l[f]=v}}r.on("error",Bl[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var h in o[e])for(var p in l[h]||(l[h]=[]),o[e][h])if(!o[e][h][p].forced){var f=o[e][h][p],m=void 0;if("hls"===r)m=new Xs(f.resolvedUri,n,s);else if("dash"===r){var g=f.playlists.filter((function(e){return e.excludeUntil!==1/0}));if(!g.length)return;m=new Po(f.playlists[0],n,s,d)}else"vhs-json"===r&&(m=new Xs(f.playlists?f.playlists[0]:f.resolvedUri,n,s));if(f=Ua.mergeOptions({id:p,playlistLoader:m},f),jl[e](e,f.playlistLoader,t),l[h].push(f),"undefined"===typeof c[p]){var v=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f["default"]&&f.autoselect,language:f.language,label:p},!1).track;c[p]=v}}a.on("error",Bl[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var c=i.options_.vhs&&i.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l["default"]&&l.autoselect};if(c[d.instreamId]&&(d=Ua.mergeOptions(d,c[d.instreamId])),void 0===d["default"]&&delete d["default"],a[o].push(Ua.mergeOptions({id:u},l)),"undefined"===typeof s[u]){var h=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d["default"],language:d.language,label:d.label},!1).track;s[u]=h}}}}},Hl=function e(t,i){for(var n=0;n1&&Cs(t.master))for(var u=0;u "+r.id;if(!t)return l(c+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var d=Boolean(Ga(i,n).length);if(!t.endList)return d||"number"!==typeof t.partTargetDuration?(l(c+" as current playlist is live"),!0):(l("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var h=ts(i,n),p=u?Do.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Do.MAX_BUFFER_LOW_WATER_LINE;if(om)&&h>=a){var v=c+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return u&&(v+=" and next bandwidth > current bandwidth ("+f+" > "+m+")"),l(v),!0}return l("not "+c+" as no switching criteria met"),!1},$l=function(e){function t(t){var i;i=e.call(this)||this;var n=t.src,r=t.handleManifestRedirects,s=t.withCredentials,o=t.tech,u=t.bandwidth,l=t.externVhs,c=t.useCueTags,d=t.blacklistDuration,h=t.enableLowInitialPlaylist,f=t.sourceType,m=t.cacheEncryptionKeys,g=t.experimentalBufferBasedABR,v=t.experimentalLeastPixelDiffSelector,y=t.captionServices;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var _=t.maxPlaylistRetries;null!==_&&"undefined"!==typeof _||(_=1/0),ll=l,i.experimentalBufferBasedABR=Boolean(g),i.experimentalLeastPixelDiffSelector=Boolean(v),i.withCredentials=s,i.tech_=o,i.vhs_=o.vhs,i.sourceType_=f,i.useCueTags_=c,i.blacklistDuration=d,i.maxPlaylistRetries=_,i.enableLowInitialPlaylist=h,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:s,handleManifestRedirects:r,maxPlaylistRetries:_,timeout:null},i.on("error",i.pauseLoading),i.mediaTypes_=Gl(),i.mediaSource=new a.a.MediaSource,i.handleDurationChange_=i.handleDurationChange_.bind(p()(i)),i.handleSourceOpen_=i.handleSourceOpen_.bind(p()(i)),i.handleSourceEnded_=i.handleSourceEnded_.bind(p()(i)),i.mediaSource.addEventListener("durationchange",i.handleDurationChange_),i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_),i.mediaSource.addEventListener("sourceended",i.handleSourceEnded_),i.seekable_=Ua.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new xl(t),i.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new Dl,i.sourceUpdater_=new bl(i.mediaSource),i.inbandTextTracks_={},i.timelineChangeController_=new Al;var b={vhs:i.vhs_,parse708captions:t.parse708captions,captionServices:y,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.duration()},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:u,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:m,sourceUpdater:i.sourceUpdater_,timelineChangeController:i.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};i.masterPlaylistLoader_="dash"===i.sourceType_?new Po(n,i.vhs_,i.requestOptions_):new Xs(n,i.vhs_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new ol(Ua.mergeOptions(b,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),t),i.audioSegmentLoader_=new ol(Ua.mergeOptions(b,{loaderType:"audio"}),t),i.subtitleSegmentLoader_=new wl(Ua.mergeOptions(b,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks}),t),i.setupSegmentLoaderListeners_(),i.experimentalBufferBasedABR&&(i.masterPlaylistLoader_.one("loadedplaylist",(function(){return i.startABRTimer_()})),i.tech_.on("pause",(function(){return i.stopABRTimer_()})),i.tech_.on("play",(function(){return i.startABRTimer_()}))),Kl.forEach((function(e){i[e+"_"]=Yl.bind(p()(i),e)})),i.logger_=qa("MPC"),i.triggeredFmp4Usage=!1,"none"===i.tech_.preload()?(i.loadOnPlay_=function(){i.loadOnPlay_=null,i.masterPlaylistLoader_.load()},i.tech_.one("play",i.loadOnPlay_)):i.masterPlaylistLoader_.load(),i.timeToLoadedData__=-1,i.mainAppendsToLoadedData__=-1,i.audioAppendsToLoadedData__=-1;var T="none"===i.tech_.preload()?"play":"loadstart";return i.tech_.one(T,(function(){var e=Date.now();i.tech_.one("loadeddata",(function(){i.timeToLoadedData__=Date.now()-e,i.mainAppendsToLoadedData__=i.mainSegmentLoader_.mediaAppends,i.audioAppendsToLoadedData__=i.audioSegmentLoader_.mediaAppends}))})),i}m()(t,e);var i=t.prototype;return i.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},i.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},i.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},i.timeToLoadedData_=function(){return this.timeToLoadedData__},i.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},i.switchMedia_=function(e,t,i){var n=this.media(),r=n&&(n.id||n.uri),a=e.id||e.uri;r&&r!==a&&(this.logger_("switch media "+r+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=a.a.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(a.a.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s]["default"]){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var c=0;c1&&(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"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine(),a=this.tech_.buffered();return Ql({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},Xl))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Ua.browser.IE_VERSION||Ua.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Ua.log.warn,c=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+c+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=u.targetDuration/2*1e3||5e3,h="number"===typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",s||h)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"===typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Ga(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:ll.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=ll.Playlist.seekable(t,i,ll.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=ll.Playlist.seekable(t,i,ll.Playlist.liveEdgeDelay(n,t)),0===e.length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Ua.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=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(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),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()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Su(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||x["b"]),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||x["a"])),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||x["a"],t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s=function(e,t){return e?Object(x["c"])(t):Object(x["g"])(t)},o={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&!s(t[e].isFmp4,n[e])){var i=t[e].isFmp4?"browser":"muxer";o[i]=o[i]||[],o[i].push(n[e]),"audio"===e&&(a=i)}})),r&&a&&this.media().attributes.AUDIO){var u=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){var i=t.attributes&&t.attributes.AUDIO;i===u&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+u+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var l=[];if(["video","audio"].forEach((function(t){var i=(Object(x["h"])(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(Object(x["h"])(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&l.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),l.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+l.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var c=Object.keys(o).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+o[t].join(",")+'"',e}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:c,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Su(e.master,r),s=[];!a.audio||Object(x["g"])(a.audio)||Object(x["c"])(a.audio)||s.push("audio codec "+a.audio),!a.video||Object(x["g"])(a.video)||Object(x["c"])(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=bu(Object(x["h"])(e)),a=Tu(r),s=r.video&&Object(x["h"])(r.video)[0]||null,o=r.audio&&Object(x["h"])(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Su(t.masterPlaylistLoader_.master,r),c=Tu(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&Object(x["h"])(l.video)[0]||null,h=l.audio&&Object(x["h"])(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),kl(e,this.cueTagsTrack_,t)},i.goalBufferLength=function(){var e=this.tech_.currentTime(),t=Do.GOAL_BUFFER_LENGTH,i=Do.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,Do.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)},i.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=Do.BUFFER_LOW_WATER_LINE,i=Do.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,Do.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,Do.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.experimentalBufferBasedABR?r:n)},i.bufferHighWaterLine=function(){return Do.BUFFER_HIGH_WATER_LINE},t}(Ua.EventTarget),Jl=function(e,t,i){return function(n){var r=e.master.playlists[t],a=vs(r),s=ys(r);return"undefined"===typeof n?s:(n?delete r.disabled:r.disabled=!0,n===s||a||(i(),n?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),n)}},Zl=function(e,t,i){var n=e.masterPlaylistController_,r=e.options_.smoothQualityChange,a=r?"smooth":"fast",s=n[a+"QualityChange_"].bind(n);if(t.attributes){var o=t.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=Su(n.master(),t),this.playlist=t,this.id=i,this.enabled=Jl(e.playlists,t.id,s)},ec=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),i=Cs(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!vs(e)})).map((function(t,i){return new Zl(e,t,t.id)})):[]}},tc=["seeking","seeked","pause","playing","error"],ic=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=qa("PlaybackWatcher"),this.logger_("initialize");var i=function(){return t.monitorCurrentTime_()},n=function(){return t.monitorCurrentTime_()},r=function(){return t.techWaiting_()},s=function(){return t.cancelTimer_()},o=this.masterPlaylistController_,u=["main","subtitle","audio"],l={};u.forEach((function(e){l[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},o[e+"SegmentLoader_"].on("appendsdone",l[e].updateend),o[e+"SegmentLoader_"].on("playlistupdate",l[e].reset),t.tech_.on(["seeked","seeking"],l[e].reset)}));var c=function(e){["main","audio"].forEach((function(i){o[i+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)}))};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=function(){return c("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(tc,s),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",r),t.tech_.off(tc,s),t.tech_.off("canplay",n),t.tech_.off("play",i),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),u.forEach((function(e){o[e+"SegmentLoader_"].off("appendsdone",l[e].updateend),o[e+"SegmentLoader_"].off("playlistupdate",l[e].reset),t.tech_.off(["seeked","seeking"],l[e].reset)})),t.checkCurrentTimeTimeout_&&a.a.clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&a.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=a.a.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=Za(this[e+"Buffered_"],n);this[e+"Buffered_"]=n,r?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:i.playlist_&&i.playlist_.id,buffered:Ja(n)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0)))},t.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Wa>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){var e=this.tech_.seeking();if(!e)return!1;var t,i=this.seekable(),n=this.tech_.currentTime(),r=this.afterSeekableWindow_(i,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);if(r){var a=i.end(i.length-1);t=a}if(this.beforeSeekableWindow_(i,n)){var s=i.start(0);t=s+(s===i.end(0)?0:Wa)}if("undefined"!==typeof t)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+Qa(i)+". Seeking to "+t+"."),this.tech_.setCurrentTime(t),!0;for(var o=this.masterPlaylistController_.sourceUpdater_,u=this.tech_.buffered(),l=o.audioBuffer?o.audioBuffered():null,c=o.videoBuffer?o.videoBuffered():null,d=this.media(),h=d.partTargetDuration?d.partTargetDuration:2*(d.targetDuration-Va),p=[l,c],f=0;f "+i.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}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered(),a=this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t});if(a)return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var s=Xa(r,t);if(s.length>0){var o=s.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+o+", seeking to "+s.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*o,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+Wa,a=!i.endList;return a&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),nc={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_||this.currentSource();return e(i)}},rc=function e(t,i){var n=0,r=0,a=Ua.mergeOptions(nc,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!==e&&void 0!==e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"===typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Ua.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)},c=function(i){l(),e(t,i)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=c},ac=function(e){rc(this,e)},sc="2.13.1",oc="6.0.1",uc="0.21.0",lc="4.7.0",cc="3.1.2",dc={PlaylistLoader:Xs,Playlist:Is,utils:lo,STANDARD_PLAYLIST_SELECTOR:Pu,INITIAL_PLAYLIST_SELECTOR:Lu,lastBandwidthSelector:Pu,movingAverageBandwidthSelector:Du,comparePlaylistBandwidth:Iu,comparePlaylistResolution:xu,xhr:$s()};Object.keys(Do).forEach((function(e){Object.defineProperty(dc,e,{get:function(){return Ua.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Do[e]},set:function(t){Ua.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!==typeof t||t<0?Ua.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Do[e]=t}})}));var hc="videojs-vhs",pc=function(e,t){for(var i=t.media(),n=-1,r=0;r=i&&e>=i?Math.max(e,n):n}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);e=this.throughput>0?1/this.throughput:0;var i=Math.floor(1/(t+e));return i},set:function(){Ua.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 i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Ja(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Ja(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&bc({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){ec(i)})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.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_=a.a.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),vc({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}))["catch"]((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))},i.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=yc({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==Ua.browser.IE_VERSION&&i?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=Ua.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){fc(e.qualityLevels_,e)})),this.playlists.on("mediachange",(function(){pc(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":sc,"mux.js":oc,"mpd-parser":uc,"m3u8-parser":lc,"aes-decrypter":cc}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return bl.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.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_&&a.a.URL.revokeObjectURL&&(a.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return yo({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),_o({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Sc),Ec={name:"videojs-http-streaming",VERSION:sc,canHandleSource:function(e,t){void 0===t&&(t={});var i=Ua.mergeOptions(Ua.options,t);return Ec.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=Ua.mergeOptions(Ua.options,i);return t.vhs=new wc(e,t,n),Ua.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Ua.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=$s(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=Ua.mergeOptions(Ua.options,t),n=i.vhs;n=void 0===n?{}:n;var r=n.overrideNative,a=void 0===r?!Ua.browser.IS_ANY_SAFARI:r,s=i.hls;s=void 0===s?{}:s;var o=s.overrideNative,u=void 0!==o&&o,l=Object(A["a"])(e),c=l&&(!dc.supportsTypeNatively(l)||u||a);return c?"maybe":""}},kc=function(){return Object(x["c"])("avc1.4d400d,mp4a.40.2")};if(kc()&&Ua.getTech("Html5").registerSourceHandler(Ec,0),Ua.VhsHandler=wc,Object.defineProperty(Ua,"HlsHandler",{get:function(){return Ua.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),wc},configurable:!0}),Ua.VhsSourceHandler=Ec,Object.defineProperty(Ua,"HlsSourceHandler",{get:function(){return Ua.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Ec},configurable:!0}),Ua.Vhs=dc,Object.defineProperty(Ua,"Hls",{get:function(){return Ua.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),dc},configurable:!0}),Ua.use||(Ua.registerComponent("Hls",dc),Ua.registerComponent("Vhs",dc)),Ua.options.vhs=Ua.options.vhs||{},Ua.options.hls=Ua.options.hls||{},!Ua.getPlugin||!Ua.getPlugin("reloadSourceOnError")){var Cc=Ua.registerPlugin||Ua.plugin;Cc("reloadSourceOnError",ac)}t["a"]=Ua}).call(this,i("c8ba"))},f2fd:function(e,t,i){},f868:function(e,t,i){var n,r;(function(a,s){n=s,r="function"===typeof n?n.call(t,i,t,e):n,void 0===r||(e.exports=r)})(0,(function(){var e=function(e,t){var i=this;if(i.version="1.4.0",i.isScrollBody=!e||"body"===e,i.scrollDom=i.isScrollBody?document.body:i.getDomById(e),i.scrollDom){i.options=t||{};var n=navigator.userAgent,r=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),a="undefined"===typeof window.orientation,s=n.indexOf("Android")>-1||n.indexOf("Adr")>-1;i.os={ios:r,pc:a,android:s},i.isDownScrolling=!1,i.isUpScrolling=!1;var o=i.options.down&&i.options.down.callback;i.initDownScroll(),i.initUpScroll(),setTimeout((function(){i.optDown.use&&i.optDown.auto&&o&&(i.optDown.autoShowLoading?i.triggerDownScroll():i.optDown.callback&&i.optDown.callback(i)),i.optUp.use&&i.optUp.auto&&!i.isUpAutoLoad&&i.triggerUpScroll()}),30)}};return e.prototype.extendDownScroll=function(t){e.extend(t,{use:!0,auto:!0,autoShowLoading:!1,isLock:!1,isBoth:!1,offset:80,inOffsetRate:1,outOffsetRate:.2,bottomOffset:20,minAngle:45,hardwareClass:"mescroll-hardware",mustToTop:!1,warpId:null,warpClass:"mescroll-downwarp",resetClass:"mescroll-downwarp-reset",textInOffset:"下拉刷新",textOutOffset:"释放更新",textLoading:"加载中 ...",htmlContent:'

',inited:function(e,t){e.downTipDom=t.getElementsByClassName("downwarp-tip")[0],e.downProgressDom=t.getElementsByClassName("downwarp-progress")[0]},inOffset:function(e){e.downTipDom&&(e.downTipDom.innerHTML=e.optDown.textInOffset),e.downProgressDom&&e.downProgressDom.classList.remove("mescroll-rotate")},outOffset:function(e){e.downTipDom&&(e.downTipDom.innerHTML=e.optDown.textOutOffset)},onMoving:function(e,t,i){if(e.downProgressDom){var n=360*t;e.downProgressDom.style.webkitTransform="rotate("+n+"deg)",e.downProgressDom.style.transform="rotate("+n+"deg)"}},beforeLoading:function(e,t){return!1},showLoading:function(e){e.downTipDom&&(e.downTipDom.innerHTML=e.optDown.textLoading),e.downProgressDom&&e.downProgressDom.classList.add("mescroll-rotate")},afterLoading:function(e){return 0},callback:function(e){e.resetUpScroll()}})},e.prototype.extendUpScroll=function(t){var i=this.os.pc;e.extend(t,{use:!0,auto:!0,isLock:!1,isBoth:!1,isBounce:!0,callback:null,page:{num:0,size:10,time:null},noMoreSize:5,offset:100,toTop:{warpId:null,src:null,html:null,offset:1e3,warpClass:"mescroll-totop",showClass:"mescroll-fade-in",hideClass:"mescroll-fade-out",fadeDuration:.5,duration:300,supportTap:!1,btnClick:null},loadFull:{use:!1,delay:500},empty:{warpId:null,icon:null,tip:"暂无相关数据~",btntext:"",btnClick:null,supportTap:!1},clearId:null,clearEmptyId:null,hardwareClass:"mescroll-hardware",warpId:null,warpClass:"mescroll-upwarp",htmlLoading:'

加载中..

',htmlNodata:'

-- END --

',inited:function(e,t){},showLoading:function(e,t){t.innerHTML=e.optUp.htmlLoading},showNoMore:function(e,t){t.innerHTML=e.optUp.htmlNodata},onScroll:null,scrollbar:{use:i,barClass:"mescroll-bar"},lazyLoad:{use:!1,attr:"imgurl",showClass:"mescroll-lazy-in",delay:500,offset:200}})},e.extend=function(t,i){if(!t)return i;for(var n in i)null==t[n]?t[n]=i[n]:"object"===typeof t[n]&&e.extend(t[n],i[n]);return t},e.prototype.initDownScroll=function(){var e=this;if(e.optDown=e.options.down||{},e.extendDownScroll(e.optDown),e.touchstartEvent=function(t){e.isScrollTo&&e.preventDefault(t),e.startPoint=e.getPoint(t),e.lastPoint=e.startPoint,e.maxTouchmoveY=e.getBodyHeight()-e.optDown.bottomOffset,e.inTouchend=!1;var i=e.getScrollTop();e.isKeepTop=0===i,e.os.pc&&i<=0&&(e.scrollDom.addEventListener("mousemove",e.touchmoveEvent,{passive:!1}),document.ondragstart=function(){return!1})},e.scrollDom.addEventListener("mousedown",e.touchstartEvent),e.scrollDom.addEventListener("touchstart",e.touchstartEvent),e.touchmoveEvent=function(t){if(e.startPoint){var i=e.getScrollTop();i>0&&(e.isKeepTop=!1);var n=e.getPoint(t),r=n.y-e.startPoint.y;if(r>0){if(i<=0&&(e.preventDefault(t),e.optDown.use&&!e.inTouchend&&!e.isDownScrolling&&!e.optDown.isLock&&(!e.isUpScrolling||e.isUpScrolling&&e.optUp.isBoth))){if(e.optDown.mustToTop&&!e.isKeepTop)return;var a=Math.abs(e.lastPoint.x-n.x),s=Math.abs(e.lastPoint.y-n.y),o=Math.sqrt(a*a+s*s);if(0!==o){var u=Math.asin(s/o)/Math.PI*180;if(u0&&n.y>=e.maxTouchmoveY)return e.inTouchend=!0,void e.touchendEvent();var l=n.y-e.lastPoint.y;e.downHight||(e.downHight=0),e.downHight0?l*e.optDown.outOffsetRate:l),e.downwarp.style.height=e.downHight+"px";var c=e.downHight/e.optDown.offset;e.optDown.onMoving(e,c,e.downHight)}}else if(r<0){var d=e.getScrollHeight(),h=e.getClientHeight(),p=d-h-i;!e.optUp.isBounce&&p<=0&&e.preventDefault(t),e.optUp.use&&!e.optUp.isLock&&e.optUp.hasNext&&!e.isUpScrolling&&(!e.isDownScrolling||e.isDownScrolling&&e.optDown.isBoth)&&(h+e.optUp.offset>=d||p<=0)&&e.triggerUpScroll()}e.lastPoint=n}},e.scrollDom.addEventListener("touchmove",e.touchmoveEvent,{passive:!1}),e.touchendEvent=function(){e.optDown.use&&e.isMoveDown&&(e.downHight>=e.optDown.offset?e.triggerDownScroll():(e.downwarp.classList.add(e.optDown.resetClass),e.downHight=0,e.downwarp.style.height=0),e.isSetScrollAuto&&(e.scrollDom.style.webkitOverflowScrolling="touch",e.scrollDom.classList.remove(e.optDown.hardwareClass),e.isSetScrollAuto=!1),e.movetype=0,e.isMoveDown=!1),e.os.pc&&(e.scrollDom.removeEventListener("mousemove",e.touchmoveEvent),document.ondragstart=function(){return!0})},e.scrollDom.addEventListener("mouseup",e.touchendEvent),e.scrollDom.addEventListener("mouseleave",e.touchendEvent),e.scrollDom.addEventListener("touchend",e.touchendEvent),e.scrollDom.addEventListener("touchcancel",e.touchendEvent),e.optDown.use){e.downwarp=document.createElement("div"),e.downwarp.className=e.optDown.warpClass,e.downwarp.innerHTML='
'+e.optDown.htmlContent+"
";var t=e.optDown.warpId?e.getDomById(e.optDown.warpId):e.scrollDom;e.optDown.warpId&&t?t.appendChild(e.downwarp):(t||(t=e.scrollDom),t.insertBefore(e.downwarp,e.scrollDom.firstChild)),setTimeout((function(){e.optDown.inited(e,e.downwarp)}),0)}},e.prototype.preventDefault=function(e){e&&e.cancelable&&!e.defaultPrevented&&e.preventDefault()},e.prototype.getPoint=function(e){return{x:e.touches?e.touches[0].pageX:e.clientX,y:e.touches?e.touches[0].pageY:e.clientY}},e.prototype.triggerDownScroll=function(){this.optDown.beforeLoading(this,this.downwarp)||(this.showDownScroll(),this.optDown.callback&&this.optDown.callback(this))},e.prototype.showDownScroll=function(){this.isDownScrolling=!0,this.optDown.showLoading(this),this.downHight=this.optDown.offset,this.downwarp.classList.add(this.optDown.resetClass),this.downwarp.style.height=this.optDown.offset+"px"},e.prototype.endDownScroll=function(){var e=this,t=function(){e.downHight=0,e.downwarp.style.height=0,e.isDownScrolling=!1,e.downProgressDom&&e.downProgressDom.classList.remove("mescroll-rotate")},i=e.optDown.afterLoading(e);"number"===typeof i&&i>0?setTimeout(t,i):t()},e.prototype.lockDownScroll=function(e){null==e&&(e=!0),this.optDown.isLock=e},e.prototype.initUpScroll=function(){var e,t=this;(t.optUp=t.options.up||{use:!1},t.extendUpScroll(t.optUp),t.optUp.scrollbar.use&&t.scrollDom.classList.add(t.optUp.scrollbar.barClass),t.optUp.isBounce||t.setBounce(!1),!1!==t.optUp.use)&&(t.optUp.hasNext=!0,t.upwarp=document.createElement("div"),t.upwarp.className=t.optUp.warpClass,t.optUp.warpId&&(e=t.getDomById(t.optUp.warpId)),e||(e=t.scrollDom),e.appendChild(t.upwarp),t.preScrollY=0,t.lazyStartTime=(new Date).getTime(),t.lazyTag="mescroll-lazying",t.scrollEvent=function(){var e=t.getScrollTop(),i=e-t.preScrollY>0;if(t.preScrollY=e,!t.isUpScrolling&&(!t.isDownScrolling||t.isDownScrolling&&t.optDown.isBoth)&&!t.optUp.isLock&&t.optUp.hasNext){var n=t.getScrollHeight()-t.getClientHeight()-e;n<=t.optUp.offset&&i&&t.triggerUpScroll()}var r=t.optUp.toTop;if((r.src||r.html)&&(e>=r.offset?t.showTopBtn():t.hideTopBtn()),t.optUp.lazyLoad.use){var a=(new Date).getTime();t.lazyTimer&&clearTimeout(t.lazyTimer),a-t.lazyStartTime>=t.optUp.lazyLoad.delay?(t.lazyStartTime=a,t.lazyLoad(0)):t.lazyTimer=t.lazyLoad()}t.optUp.onScroll&&t.optUp.onScroll(t,e,i)},t.isScrollBody?window.addEventListener("scroll",t.scrollEvent):t.scrollDom.addEventListener("scroll",t.scrollEvent),setTimeout((function(){t.optUp.inited(t,t.upwarp)}),0))},e.prototype.setBounce=function(e){!this.isScrollBody&&this.os.ios&&(!1===e?(this.optUp.isBounce=!1,window.addEventListener("touchmove",this.bounceTouchmove,{passive:!1})):(this.optUp.isBounce=!0,window.removeEventListener("touchmove",this.bounceTouchmove)))},e.prototype.bounceTouchmove=function(e){var t=this,i=e.target,n=!0;while(i!==document.body&&i!==document){var r=i.classList;if(r){if(r.contains("mescroll")||r.contains("mescroll-touch")){n=!1;break}if(r.contains("mescroll-touch-x")||r.contains("mescroll-touch-y")){var a=e.touches?e.touches[0].pageX:e.clientX,s=e.touches?e.touches[0].pageY:e.clientY;t.preWinX||(t.preWinX=a),t.preWinY||(t.preWinY=s);var o=Math.abs(t.preWinX-a),u=Math.abs(t.preWinY-s),l=Math.sqrt(o*o+u*u);if(t.preWinX=a,t.preWinY=s,0!==l){var c=Math.asin(u/l)/Math.PI*180;if(c<=45&&r.contains("mescroll-touch-x")||c>45&&r.contains("mescroll-touch-y")){n=!1;break}}}}i=i.parentNode}n&&e.cancelable&&!e.defaultPrevented&&"function"===typeof e.preventDefault&&e.preventDefault()},e.prototype.triggerUpScroll=function(){this.optUp.callback&&!this.isUpScrolling&&(this.showUpScroll(),this.optUp.page.num++,this.isUpAutoLoad=!0,this.optUp.callback(this.optUp.page,this))},e.prototype.showUpScroll=function(){this.isUpScrolling=!0,this.upwarp.classList.add(this.optUp.hardwareClass),this.upwarp.style.visibility="visible",this.upwarp.style.display="block",this.optUp.showLoading(this,this.upwarp)},e.prototype.showNoMore=function(){this.upwarp.style.visibility="visible",this.upwarp.style.display="block",this.optUp.hasNext=!1,this.optUp.showNoMore(this,this.upwarp)},e.prototype.hideUpScroll=function(e){e?this.upwarp.style.display="none":this.upwarp.style.visibility="hidden",this.upwarp.classList.remove(this.optUp.hardwareClass);var t=this.upwarp.getElementsByClassName("upwarp-progress")[0];t&&t.classList.remove("mescroll-rotate")},e.prototype.endUpScroll=function(e,t){null!=e&&(e?this.showNoMore():this.hideUpScroll(t)),this.isUpScrolling=!1},e.prototype.resetUpScroll=function(e){if(this.optUp&&this.optUp.use){var t=this.optUp.page;this.prePageNum=t.num,this.prePageTime=t.time,t.num=1,t.time=null,this.isDownScrolling||!1===e||(null==e?(this.removeEmpty(),this.clearDataList(),this.showUpScroll()):this.showDownScroll()),this.isUpAutoLoad=!0,this.optUp.callback&&this.optUp.callback(t,this)}},e.prototype.setPageNum=function(e){this.optUp.page.num=e-1},e.prototype.setPageSize=function(e){this.optUp.page.size=e},e.prototype.clearDataList=function(){var e=this.optUp.clearId||this.optUp.clearEmptyId;if(e){var t=this.getDomById(e);t&&(t.innerHTML="")}},e.prototype.endByPage=function(e,t,i){var n;this.optUp.use&&null!=t&&(n=this.optUp.page.num'),t.tip&&(r+='

'+t.tip+"

"),t.btntext&&(r+='

'+t.btntext+"

"),e.emptyDom=document.createElement("div"),e.emptyDom.className="mescroll-empty",e.emptyDom.innerHTML=r,n.appendChild(e.emptyDom),t.btnClick){var a=e.emptyDom.getElementsByClassName("empty-btn")[0];t.supportTap?a.addEventListener("tap",(function(i){i.stopPropagation(),e.preventDefault(i),t.btnClick()})):a.onclick=function(){t.btnClick()}}}}},e.prototype.removeEmpty=function(){this.removeChild(this.emptyDom)},e.prototype.showTopBtn=function(e){if(!this.topBtnShow){this.topBtnShow=!0;var t,i=this,n=i.optUp.toTop;if(null==i.toTopBtn)n.html?(i.toTopBtn=document.createElement("div"),i.toTopBtn.innerHTML=n.html):(i.toTopBtn=document.createElement("img"),i.toTopBtn.src=n.src),i.toTopBtn.className=n.warpClass,n.supportTap?i.toTopBtn.addEventListener("tap",(function(e){e.stopPropagation(),i.preventDefault(e);var t=n.btnClick&&n.btnClick();!0!==t&&i.scrollTo(0,i.optUp.toTop.duration)})):i.toTopBtn.onclick=function(){var e=n.btnClick&&n.btnClick();!0!==e&&i.scrollTo(0,i.optUp.toTop.duration)},n.warpId&&(t=i.getDomById(n.warpId)),t||(t=document.body),t.appendChild(i.toTopBtn);i.toTopBtn.classList.remove(n.hideClass),i.toTopBtn.classList.add(n.showClass),i.setTopBtnFadeDuration(e)}},e.prototype.hideTopBtn=function(e){this.topBtnShow&&this.toTopBtn&&(this.topBtnShow=!1,this.toTopBtn.classList.remove(this.optUp.toTop.showClass),this.toTopBtn.classList.add(this.optUp.toTop.hideClass),this.setTopBtnFadeDuration(e))},e.prototype.setTopBtnFadeDuration=function(e){if(this.toTopBtn){var t=(null!=e?e:this.optUp.toTop.fadeDuration)+"s";this.toTopBtn.style.animationDuration=t,this.toTopBtn.style.webkitAnimationDuration=t}},e.prototype.scrollTo=function(e,t){var i=this,n=i.getScrollTop(),r=e;if(r>0){var a=i.getScrollHeight()-i.getClientHeight();r>a&&(r=a)}else r=0;i.isScrollTo=!0,i.scrollDom.style.webkitOverflowScrolling="auto",i.getStep(n,r,(function(e){i.setScrollTop(e),e===r&&(i.scrollDom.style.webkitOverflowScrolling="touch",i.isScrollTo=!1)}),t)},e.prototype.getStep=function(e,t,i,n,r){var a=t-e;if(0!==n&&0!==a){n=n||300,r=r||30;var s=n/r,o=a/s,u=0,l=window.setInterval((function(){u=n||r<=a&&r>n},e.prototype.getOffsetTop=function(e){var t=e.offsetTop,i=e.offsetParent;while(null!=i&&i!==this.scrollDom)t+=i.offsetTop+i.clientTop,i=i.offsetParent;return t},e.prototype.getScrollHeight=function(){return this.scrollDom.scrollHeight},e.prototype.getClientHeight=function(){return this.isScrollBody&&"CSS1Compat"===document.compatMode?document.documentElement.clientHeight:this.scrollDom.clientHeight},e.prototype.getBodyHeight=function(){return document.body.clientHeight||document.documentElement.clientHeight},e.prototype.getScrollTop=function(){return this.isScrollBody?document.documentElement.scrollTop||document.body.scrollTop:this.scrollDom.scrollTop},e.prototype.getToBottom=function(){return this.getScrollHeight()-this.getClientHeight()-this.getScrollTop()},e.prototype.setScrollTop=function(e){"number"===typeof e&&(this.isScrollBody?(document.documentElement.scrollTop=e,document.body.scrollTop=e):this.scrollDom.scrollTop=e)},e.prototype.getDomById=function(e){var t;return e&&("string"===typeof e?t=document.getElementById(e):e.nodeType&&(t=e)),t||console.error('the element with id as "'+e+'" can not be found: document.getElementById("'+e+'")==null'),t},e.prototype.removeChild=function(e){if(e){var t=e.parentNode;t&&t.removeChild(e),e=null}},e.prototype.destroy=function(){var e=this;e.scrollDom.removeEventListener("touchstart",e.touchstartEvent),e.scrollDom.removeEventListener("touchmove",e.touchmoveEvent),e.scrollDom.removeEventListener("touchend",e.touchendEvent),e.scrollDom.removeEventListener("touchcancel",e.touchendEvent),e.scrollDom.removeEventListener("mousedown",e.touchstartEvent),e.scrollDom.removeEventListener("mousemove",e.touchmoveEvent),e.scrollDom.removeEventListener("mouseup",e.touchendEvent),e.scrollDom.removeEventListener("mouseleave",e.touchendEvent),e.removeChild(e.downwarp),e.isScrollBody?window.removeEventListener("scroll",e.scrollEvent):e.scrollDom.removeEventListener("scroll",e.scrollEvent),e.removeChild(e.upwarp),e.removeChild(e.toTopBtn),e.setBounce(!0)},e}))},f8a8:function(e,t,i){"use strict";i.d(t,"a",(function(){return A})),i.d(t,"b",(function(){return P}));var n,r=i("de66"),a=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"===typeof e?Object(r["g"])(e):e}),s=function(e){return Array.isArray(e)?e.map((function(e){return a(e)})):[a(e)]},o=function(e){e=Object(r["j"])(e);var t=[],i=0;while(e.length>i){var a=e[i],s=0,o=0;o++;var u=e[o];o++;while(128&u)s=(127&u)<<7,u=e[o],o++;s+=127&u;for(var l=0;l>>0,l=t.subarray(o+4,o+8);if(0===u)break;var c=o+u;if(c>t.length){if(n)break;c=t.length}var d=t.subarray(o+8,c);Object(r["a"])(l,i[0])&&(1===i.length?a.push(d):a.push.apply(a,e(d,i.slice(1),n))),o=c}return a},l={EBML:Object(r["j"])([26,69,223,163]),DocType:Object(r["j"])([66,130]),Segment:Object(r["j"])([24,83,128,103]),SegmentInfo:Object(r["j"])([21,73,169,102]),Tracks:Object(r["j"])([22,84,174,107]),Track:Object(r["j"])([174]),TrackNumber:Object(r["j"])([215]),DefaultDuration:Object(r["j"])([35,227,131]),TrackEntry:Object(r["j"])([174]),TrackType:Object(r["j"])([131]),FlagDefault:Object(r["j"])([136]),CodecID:Object(r["j"])([134]),CodecPrivate:Object(r["j"])([99,162]),VideoTrack:Object(r["j"])([224]),AudioTrack:Object(r["j"])([225]),Cluster:Object(r["j"])([31,67,182,117]),Timestamp:Object(r["j"])([231]),TimestampScale:Object(r["j"])([42,215,177]),BlockGroup:Object(r["j"])([160]),BlockDuration:Object(r["j"])([155]),Block:Object(r["j"])([161]),SimpleBlock:Object(r["j"])([163])},c=[128,64,32,16,8,4,2,1],d=function(e){for(var t=1,i=0;i=i.length)return i.length;var a=h(i,n,!1);if(Object(r["a"])(t.bytes,a.bytes))return n;var s=h(i,n+a.length);return e(t,i,n+s.length+s.value+a.length)},g=function e(t,i){i=f(i),t=Object(r["j"])(t);var n=[];if(!i.length)return n;var a=0;while(at.length?t.length:u+o.value,c=t.subarray(u,l);Object(r["a"])(i[0],s.bytes)&&(1===i.length?n.push(c):n=n.concat(e(c,i.slice(1))));var d=s.length+o.length+c.length;a+=d}return n},v=i("321f"),y=Object(r["j"])([0,0,0,1]),_=Object(r["j"])([0,0,1]),b=Object(r["j"])([0,0,3]),T=function(e){var t=[],i=1;while(i>1&63),-1!==i.indexOf(l)&&(a=s+u),s+=u+("h264"===t?1:2)}else s++}return e.subarray(0,0)},w=function(e,t,i){return S(e,"h264",t,i)},E=function(e,t,i){return S(e,"h265",t,i)},k={webm:Object(r["j"])([119,101,98,109]),matroska:Object(r["j"])([109,97,116,114,111,115,107,97]),flac:Object(r["j"])([102,76,97,67]),ogg:Object(r["j"])([79,103,103,83]),ac3:Object(r["j"])([11,119]),riff:Object(r["j"])([82,73,70,70]),avi:Object(r["j"])([65,86,73]),wav:Object(r["j"])([87,65,86,69]),"3gp":Object(r["j"])([102,116,121,112,51,103]),mp4:Object(r["j"])([102,116,121,112]),fmp4:Object(r["j"])([115,116,121,112]),mov:Object(r["j"])([102,116,121,112,113,116]),moov:Object(r["j"])([109,111,111,118]),moof:Object(r["j"])([109,111,111,102])},C={aac:function(e){var t=Object(v["a"])(e);return Object(r["a"])(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(v["a"])(e);return Object(r["a"])(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=g(e,[l.EBML,l.DocType])[0];return Object(r["a"])(t,k.webm)},mkv:function(e){var t=g(e,[l.EBML,l.DocType])[0];return Object(r["a"])(t,k.matroska)},mp4:function(e){return!C["3gp"](e)&&!C.mov(e)&&(!(!Object(r["a"])(e,k.mp4,{offset:4})&&!Object(r["a"])(e,k.fmp4,{offset:4}))||(!(!Object(r["a"])(e,k.moof,{offset:4})&&!Object(r["a"])(e,k.moov,{offset:4}))||void 0))},mov:function(e){return Object(r["a"])(e,k.mov,{offset:4})},"3gp":function(e){return Object(r["a"])(e,k["3gp"],{offset:4})},ac3:function(e){var t=Object(v["a"])(e);return Object(r["a"])(e,k.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];var t=0;while(t+1880}},f97d:function(e,t){var i={"":!0,up:!0};function n(e){if("string"!==typeof e)return!1;var t=i[e.toLowerCase()];return!!t&&e.toLowerCase()}function r(e){return"number"===typeof e&&e>=0&&e<=100}function a(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=n(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):u=t}}})}e.exports=a},ffdf:function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return s}));var n=i("be09"),r=i.n(n),a=function(t){return r.a.atob?r.a.atob(t):e.from(t,"base64").toString("binary")};function s(e){for(var t=a(e),i=new Uint8Array(t.length),n=0;n