!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=e(require("video.js")):"function"==typeofdefine&&define.amd?define(["video.js"],e):t.videojsVttThumbnails=e(t.videojs)}(this,function(o){"use strict";o=o&&o.hasOwnProperty("default")?o.default:o;!function(){functionl(t){this.value=t}functiont(o){vari,n;functiona(t,e){try{varr=o[t](e),s=r.value;sinstanceofl?Promise.resolve(s.value).then(function(t){a("next",t)},function(t){a("throw",t)}):u(r.done?"return":"normal",r.value)}catch(t){u("throw",t)}}functionu(t,e){switch(t){case"return":i.resolve({value:e,done:!0});break;case"throw":i.reject(e);break;default:i.resolve({value:e,done:!1})}(i=i.next)?a(i.key,i.arg):n=null}this._invoke=function(s,o){returnnewPromise(function(t,e){varr={key:s,arg:o,resolve:t,reject:e,next:null};n?n=n.next=r:(i=n=r,a(s,o))})},"function"!=typeofo.return&&(this.return=void0)}"function"==typeofSymbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){returnthis}),t.prototype.next=function(t){returnthis._invoke("next",t)},t.prototype.throw=function(t){returnthis._invoke("throw",t)},t.prototype.return=function(t){returnthis._invoke("return",t)}}();vari={},t=o.registerPlugin||o.plugin,e=function(r){vars=this;this.ready(function(){vart,e;t=s,e=o.mergeOptions(i,r),t.addClass("vjs-vtt-thumbnails"),t.vttThumbnails=newn(t,e)})},n=function(){functionr(t,e){returnfunction(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}(this,r),this.player=t,this.options=e,this.listenForDurationChange(),this.initializeThumbnails(),this.registeredEvents={},this}returnr.prototype.src=function(t){this.resetPlugin(),this.options.src=t,this.initializeThumbnails()},r.prototype.detach=function(){this.resetPlugin()},r.prototype.resetPlugin=function(){this.thumbnailHolder&&this.thumbnailHolder.parentNode.removeChild(this.thumbnailHolder),this.progressBar&&this.progressBar.removeEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar&&this.progressBar.removeEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave),this.progressBar&&this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove),deletethis.registeredEvents.progressBarMouseEnter,deletethis.registeredEvents.progressBarMouseLeave,deletethis.registeredEvents.progressBarMouseMove,deletethis.progressBar,deletethis.vttData,deletethis.thumbnailHolder,deletethis.lastStyle},r.prototype.listenForDurationChange=function(){this.player.on("durationchange",function(){})},r.prototype.initializeThumbnails=function(){vare=this;if(this.options.src){vart=this.getBaseUrl(),r=this.getFullyQualifiedUrl(this.options.src,t);this.getVttFile(r).then(function(t){e.vttData=e.processVtt(t),e.setupThumbnailElement()})}},r.prototype.getBaseUrl=function(){return[window.location.protocol,"//",window.location.hostname,window.location.port?":"+window.location.port:"",window.location.pathname].join("").split(/([^\/]*)$/gi).shift()},r.prototype.getVttFile=function(s){varo=this;returnnewPromise(function(t,e){varr=newXMLHttpRequest;r.data={resolve:t},r.addEventListener("load",o.vttFileLoaded),r.open("GET",s),r.send()})},r.prototype.vttFileLoaded=function(){this.data.resolve(this.responseText)},r.prototype.setupThumbnailElement=function(t){vare=this;this.progressBar=this.player.$(".vjs-progress-control");varr=document.createElement("div");r.setAttribute("class","vjs-vtt-thumbnail-display"),this.progressBar.appendChild(r),this.thumbnailHolder=r,this.registeredEvents.progressBarMouseEnter=function(){returne.onBarMouseenter()},this.registeredEvents.progressBarMouseLeave=function(){returne.onBarMouseleave()},this.progressBar.addEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar.addEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave)},r.prototype.onBarMouseenter=function(){vare=this;this.mouseMoveCallback=function(t){e.onBarMousemove(t)},this.registeredEvents.progressBarMouseMove=this.mouseMoveCallback,this.