ravnur-player-public 3.4.13 → 3.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var e={};function n(t){try{return t instanceof Element}catch(e){return!!t.nodeName}}function i(t){return Array.isArray(t)}function s(t){return null!==t&&"object"==typeof t&&!1===i(t)}function o(t){return"function"==typeof t}function r(t){return"string"==typeof t}function a(t,e){return r(t)&&r(e)?(n=e,t.indexOf(n)>-1):function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(t,o(e)?e:t=>t===e);var n}t.d(e,{default:()=>qo});const l=Object.prototype.hasOwnProperty;function h(t,e){return l.call(t,e)}function c(t,e){t instanceof Array?function(t,e){for(let n=0;n<t.length;n++)e(t[n],n,t)}(t,e):function(t,e){for(const n in t)h(t,n)&&e(t[n],n,t)}(t,e)}function p(t,e,n=null){return c(t,(t,i,s)=>{n=e(n,t,i,s)}),n}function u(t,e){return t===e||(i(t)&&i(e)?t.length===e.length&&p(t,(t,n)=>t&&a(e,n),!0):!(!s(t)||!s(e))&&(!!u(Object.keys(t),Object.keys(e))&&p(t,(t,n,i)=>t&&u(n,e[i]),!0)))}function d(){}const g=Number.MAX_VALUE;function m(t,e=0,n=g){return t>=e&&t<n}function b(t){return null!=t}function y(t){return e=>!t(e)}const f=y(b);function v(t){return f(t)||t instanceof Array&&!t.length||"string"==typeof t&&!t.length}const $=y(v);function x(){return"rav_id_xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})}function _(t,e,i){t&&(b(i)&&n(i)?t.insertBefore(e,i):t.appendChild(e))}function w(t,e={},i=null,s="http://www.w3.org/1999/xhtml"){let o;return o=b(document.createElementNS)?document.createElementNS(s,t):document.createElement(t),c(e,(t,e)=>{o.setAttribute(e,t)}),b(i)&&n(i)&&_(i,o),o}function C(t,e,n,i=!1){return t.addEventListener?(t.addEventListener(e,s,i),{elem:t,handler:s,event:e}):(t.attachEvent("on"+e,o),{elem:t,handler:o,event:e});function s(e){const i=n.apply(t,arguments);return!1===i&&(e.stopPropagation(),e.preventDefault()),i}function o(){const e=n.call(t,window.event);return!1===e&&(window.event.returnValue=!1,window.event.cancelBubble=!0),e}}function k(t){t.elem.removeEventListener?t.elem.removeEventListener(t.event,t.handler):t.elem.detachEvent("on"+t.event,t.handler)}function T(t,e){return!!t&&!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function S(t,e){T(t,e)||(t.className+=" "+e)}function E(t,e){if(T(t,e)){const n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ").trim()}}function P(t,e,n){let i=n;f(n)&&(i=!T(t,e)),i?S(t,e):E(t,e)}function L(t,e=$){const n=[];return c(t,t=>{e(t)&&n.push(t)}),n}function M(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(e(i))return i}return null}function A(t,e){const n=[];return c(t,(t,i,s)=>n.push(e(t,i,s))),n}function F(t){return t[0]}function z(t){return t[t.length-1]}function N(t){return t[0]}function O(t,e){const n=o(e)?e:t=>t===e;for(let e=0;e<t.length;e++)if(n(t[e]))return e;return-1}function R(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}function j(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n]);return e}function H(t,...e){return c(e,e=>{f(e)||c(e,(e,n)=>{t[n]=e})}),t}function D(t,e="",n=null){const i=e.split(".");for(;b(t)&&i.length;)t=t[i.shift()];return b(t)?t:n}function B(t,e,n,i){const s=t[e],o=()=>n.apply(t,[s]),r=e=>i.apply(t,[e]);if(Object.defineProperty)Object.defineProperty(t,e,{get:o,set:r});else if(t.__defineGetter__)t.__defineGetter__(e,o),t.__defineSetter__(e,r);else{const n=i=>{i.propertyName===e&&(t.detachEvent("onpropertychange",n),r(t[e]),t[e]=o,t[e].toString=()=>o().toString(),t.attachEvent("onpropertychange",n))};try{t[e]=o,t[e].toString=()=>o().toString()}catch(t){}t.attachEvent("onpropertychange",n)}}function I(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class V{constructor(t,e){I(this,"_tokens",[]),I(this,"bus",void 0),I(this,"logger",void 0),this.bus=t,this.logger=e}addEvent(t,e,n,i=!1){const s=C(t,e,n,i);this._tokens.push(s)}destroy(){c(this._tokens,k),this._tokens.length=0}}function U(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const W=1e3;class q extends V{constructor(t,e){super(t.bus,t.logger),U(this,"options",void 0),U(this,"state",void 0),U(this,"$el",void 0),this.state=e,this.logger.debug("player:created"),this.options=t,setTimeout(()=>this.getElement().setAttribute("tabindex","-1"))}focus(){let t=this.getElement();this.options.isAudio&&(t=t.parentNode.parentNode),t&&t instanceof HTMLElement&&t.focus()}getTimeCode(){return this.options.timecode}getCurrentTime(){return this.getElement().currentTime+this.getTimeCode()}setCurrentTime(t,e=!0){if(!this.getElement())return;t-=this.getTimeCode();const{clip:n}=this.options;if(n){let[e,i]=n;e=e||0,i=i||this.getElement().duration,t=Math.max(t,e),t=Math.min(t,i)}this.getElement().currentTime=t,e||this.focus()}nextFrame(){const t=this._getFrameDuration();let e=this.getElement().currentTime,n=Math.floor(e*W/t);e=Math.ceil(++n*t)/W,this.setCurrentTime(e+this.getTimeCode())}prevFrame(){const t=this._getFrameDuration();let e=this.getElement().currentTime,n=Math.floor(e*W/t);e=Math.ceil(--n*t)/W,this.setCurrentTime(e+this.getTimeCode())}isPaused(){return!!this.getElement()&&this.getElement().paused}isEnded(){if(!this.getElement())return!1;const{clip:t}=this.options;if(t){const e=this.getElement().duration;let[n,i]=t;return i=i||e,i+=this.getTimeCode(),this.getCurrentTime()>=i}return this.getElement().ended}play(t=!0){this.bus.emit("handle-play-clicked"),t||this.focus();const{clip:e}=this.options;if(this.isEnded()&&e){const[t]=e;this.setCurrentTime(t||0)}return this.getElement().play()}pause(t=!0){t||this.focus(),this.getElement().pause()}getDuration(){if(!this.getElement())return null;let t=this.getElement().duration;const{clip:e}=this.options;if(e){let[n,i]=e;n=n||0,i=i||t,t=i-n}return t+this.getTimeCode()}isMuted(){return this.getElement().muted}setMuted(t,e=!0){this.getElement().muted=t,e||this.focus()}getVolume(){return this.getElement().volume}setVolume(t,e=!0){this.getElement().volume=t,e||this.focus()}destroy(){this.logger.debug("player:destroy"),super.destroy()}getLevels(){throw new Error("You must override it")}getLevel(){throw new Error("You must override it")}setLevel(t){throw new Error("You must override it")}goToLive(){throw new Error("You must override it")}setPlaybackRate(t){throw new Error("You must override it")}isLive(){return!1}isMultiAudioTracks(){return this.getAudioTracks().length>1}getAudioTracks(){return[]}getAudioTrack(){return 0}setAudioTrack(t){}getTextTracks(){}load(t){throw new Error("You must override it")}isMultiQuality(){return this.getLevels().length>1}getBufferedPercent(){return 0}getElement(){throw new Error("You must override it")}_getFrameDuration(){return W/this.options.frameRate}}const G=["loadstart","progress","suspend","abort","error","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"];function Q(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}function Y(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Z extends q{constructor(t,e){super(t,e),Y(this,"$el",void 0),Y(this,"source",null),Y(this,"_levels",[]),Y(this,"_currentLevel",null),this.logger.debug("html:player:creating");let n="video";const i={id:x(),tabindex:-1};t.disableAutoFullScreenOnIOS&&(i["webkit-playsinline"]=!0,i.playsinline=!0),t.isMobile&&(i.preload="metadata",n=t.isAudio?"audio":"video"),this.$el=w(n,i),c(G,t=>{this.addEvent(this.$el,t,e=>{this.logger.debug("triggered event",t),this.bus.emit(t,e)})}),this.handleFullscreenChanging=this.handleFullscreenChanging.bind(this),this.handleWebkitEndFullscreen=this.handleWebkitEndFullscreen.bind(this),Q()&&this.bus.on("fullscreenchanging",this.handleFullscreenChanging),this.logger.debug("html:player:created")}load({type:t,src:e,cc:n}){let s={type:t,src:e};if(this.options.isMobile&&"audio/mp3"===t&&(s={src:e}),i(e)){if(this._levels=e,this.options.qualityLevel){const t=parseInt(this.options.qualityLevel,10);t&&(this._currentLevel=M(this._levels,e=>parseInt(e.name,10)===t))}this._currentLevel=this._currentLevel||M(this._levels,t=>t.default),this._currentLevel=this._currentLevel||N(this._levels),s.src=this._currentLevel.src}this.logger.debug("html:player:loading",e),this.source=w("source",s),this.source.addEventListener("error",t=>{this.bus.emit("error",t),this.logger.error(t)}),_(this.$el,this.source),Q()&&n&&c(n,t=>{3!==t.state&&"json"!==t.type&&_(this.$el,w("track",t))}),this.$el.audioTracks&&(this.$el.audioTracks.onchange=()=>{this.bus.emit("audiotrackswitched")}),this.$el.addEventListener("webkitendfullscreen",this.handleWebkitEndFullscreen),Q()&&this.bus.once("loadeddata",()=>{const t=this.getTextTracks();t instanceof TextTrackList&&t.addEventListener("change",()=>{const e=M(t,t=>"showing"===t.mode);e&&this.bus.emit("cclang",e.language)}),this.handleWebkitEndFullscreen()})}getLevels(){return this._levels}setLevel(t){const e=this.$el.currentTime,n=this.$el.paused;this._currentLevel=t,this.$el.pause(),this.source&&(this.source.src=t.src),this.bus.once("loadedmetadata",()=>{this.$el.currentTime=e,n||this.$el.play()}),this.$el.currentTime=e,this.$el.load()}setPlaybackRate(t){this.$el.playbackRate=t,this.$el.defaultPlaybackRate=t}getLevel(){return this._currentLevel}getElement(){return this.$el}getBufferedPercent(){const t=this.$el;return t&&t.buffered&&t.buffered.length>0&&t.buffered.end&&t.duration?t.buffered.end(t.buffered.length-1)/t.duration:0}getAudioTrack(){return O(this.getAudioTracks(),t=>t.enabled)}getAudioTracks(){return this.$el.audioTracks||[]}setAudioTrack(t){c(this.getAudioTracks(),(e,n)=>{e&&"object"==typeof e&&(e.enabled=n==t)})}getTextTracks(){return this.$el.textTracks||[]}handleFullscreenChanging(t){const e=!0!==t?this.state.getCCLang():"__";this._textTrackWalker(t=>t.language===e?"showing":"disabled")}handleWebkitEndFullscreen(){this.handleFullscreenChanging(this.$el.webkitDisplayingFullscreen)}_textTrackWalker(t){c(this.getTextTracks(),e=>{e&&"object"==typeof e&&(e.mode=t(e))})}destroy(){this.$el.removeEventListener("webkitendfullscreen",this.handleWebkitEndFullscreen),this.bus.off("fullscreenchanging",this.handleFullscreenChanging),super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null,this.source=null}}const K={name:"Auto"},J={maxFragLookUpTolerance:.5,maxMaxBufferLength:600,highBufferWatchdogPeriod:3,playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:10,retryDelayMs:3e3,maxRetryDelayMs:8e3}}}};const X={name:"Auto"},tt=["application/x-mpegURL","vnd.apple.mpegURL","application/vnd.apple.mpegurl"],et="HTML5",nt="Shaka",it={};function st(t){const{type:e,logger:n}=t;return t.useHTMLPlayer?(n?.debug("Using html player for type: ",e),et):function(){const t=window.ManagedMediaSource||window.MediaSource||window.WebKitMediaSource;return b(t)&&o(t.isTypeSupported)&&t.isTypeSupported("video/mp4; codecs=avc1.42E01E,mp4a.40.2")}()&&(t.useHLSJSPlayer||t.isLive)?(n?.debug("Using hlsjs player for type: ",e),"HLS"):(n?.debug("Using shaka player for type: ",e),nt)}it.HLS=class extends Z{constructor(t,e){var n,i,s;super(t,e),n=this,s=void 0,(i=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(i="hls"))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,this.logger.debug("hls:player:created")}load({src:t}){let e=i(t)?F(t):t;e=s(e)?e.src:e,this.logger.debug("hls:player:loading",e),b(window.Hls)?this._attachMedia(e):this._loadLibraryAndAttachMedia(e)}_loadLibraryAndAttachMedia(t){if("function"==typeof window.define&&window.define.amd)window.require.config({paths:{hlsjs:this.options.hlsjsURL}}),window.require(["hlsjs"],e=>{window.Hls=e,this._attachMedia(t)});else{const e=w("script",{src:this.options.hlsjsURL}),n=N(Array.from(document.getElementsByTagName("script")));if(e.onload=e.onreadystatechange=()=>this._attachMedia(t),!n||!n.parentNode)return;n.parentNode.insertBefore(e,n)}}_attachMedia(t){const e=window.Hls;if(e.isSupported())if(this.hls=new e(H(J,this.options.hls)),this.hls.loadSource(t),this.hls.attachMedia(this.$el),this.hls.on(e.Events.ERROR,(t,e)=>{this.bus.emit("error",e),this.logger.error(e)}),this.hls.on(e.Events.AUDIO_TRACK_SWITCHED,()=>{this.bus.emit("audiotrackswitched")}),this.hls.on(e.Events.MANIFEST_PARSED,(t,e)=>{if(this.options.showSubtitles||(this.hls.subtitleDisplay=!1),this.options.qualityLevel){const t=parseInt(this.options.qualityLevel,10);if(t){const n=M(e.levels,e=>e.height===t);n&&this.setLevel(n)}}if(this.options.maxQualityLevel&&this.limitLevel(this.options.maxQualityLevel),this.options.startLevel){const t=parseInt(this.options.startLevel,10);if(t){const n=O(e.levels,e=>e.height===t);this.hls.startLevel=n}}}),this.hls.on(e.Events.BUFFER_CREATED,()=>{this.options.isLive&&this.goToLive()}),this.options.aesToken){let t;this.hls.config.xhrSetup=(e,n)=>{e.addEventListener("load",()=>{if("string"==typeof e.response&&e.response.indexOf("#EXTM3U")>=0){const i=e.response.split("\n").find(t=>0===t.indexOf("#EXT-X-KEY")),s=i?.split('URI="')[1].split('"')[0],o="https://"+n.split("/")[2];s&&(t=o+s)}}),n===t&&e.setRequestHeader("Authorization","Bearer "+this.options.aesToken)}}else{const e=t.split("?")[1];e&&(this.hls.config.xhrSetup=(t,n)=>{t.open("GET",n+`?${e}`,!0)})}else this.logger.error("HLS is not supported for this browser")}goToLive(){this.hls.media&&(this.logger.debug("hls:player:live"),this.hls.media.currentTime=this.hls.liveSyncPosition||this.hls.media.duration-10)}isLive(){return this.hls?.liveSyncPosition?this.hls?.media.currentTime>=this.hls?.liveSyncPosition-10:this.hls?.media.currentTime>=this.hls?.media.duration-10}getLevels(){return[K].concat(this.hls.levels)}setLevel(t){const e=O(this.hls.levels,t);this.hls.currentLevel=e}limitLevel(t){const e=parseInt(t,10);if(e){const t=O(this.hls.levels,t=>t.height===e);this.hls.autoLevelCapping=t}}getLevel(){return this.hls.levels[this.hls.manualLevel]||K}isMultiQuality(){return this.hls.levels.length>1}getAudioTracks(){return this.hls.audioTracks}getAudioTrack(){return this.hls.audioTrack}getTextTracks(){return this.$el.textTracks||[]}setAudioTrack(t){this.hls.audioTrack=t}destroy(){this.hls.destroy(),super.destroy()}},it[et]=Z,it[nt]=class extends Z{constructor(t,e){var n,i,s;super(t,e),n=this,s=void 0,(i=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(i="shaka"))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,this.logger.debug("shaka:player:created")}load({src:t,type:e}){let n=i(t)?F(t):t;n=s(n)?n.src:n;let o=e;/format=mpd-time-csf/.test(n)&&Q()&&!this.options.disableAutoUrlRewrite&&(o="application/x-mpegurl",n=n.replace("format=mpd-time-csf","format=m3u8-cmaf")),this.onError=this.onError.bind(this),this.logger.debug("shaka:player:loading",n),this._loadLibraryAndAttachMedia(n,o)}_loadLibraryAndAttachMedia(t,e){if("function"==typeof window.define&&window.define.amd)window.require.config({paths:{shakajs:this.options.shakaURL}}),window.require(["shakajs"],n=>{window.shaka=n,this._attachMedia(t,e)});else{const n=w("script",{src:this.options.shakaURL}),i=N(Array.from(document.getElementsByTagName("script")));if(n.onload=n.onreadystatechange=()=>this._attachMedia(t,e),!i||!i.parentNode)return;i.parentNode.insertBefore(n,i)}}async _attachMedia(t,e){const n=this.options.shaka;if(window.shaka.polyfill.installAll(),window.shaka.Player.isBrowserSupported()){this.shaka=new window.shaka.Player,this.options.shaka&&this.shaka.configure(this.options.shaka),this.shaka.setTextTrackVisibility(!!this.options.showSubtitles),this.preselectQuality(),this.modifyRequests(t),this.options.maxQualityLevel&&this.limitLevel(this.options.maxQualityLevel),await this.configureDRM(),await this.shaka.attach(this.$el);const i=e.toLowerCase();await this.shaka.load(t,null,i).catch(this.onError),(new window.shaka.util.EventManager).listen(this.shaka,"error",t=>this.onError(t.detail)),this.shaka.configure(n)}else this.logger.error("Browser not supported!")}async configureDRM(){const t={};if(this.options.widevineURL&&(t["com.widevine.alpha"]=this.options.widevineURL),this.options.playreadyURL&&(t["com.microsoft.playready"]=this.options.playreadyURL),this.options.fairplayURL&&(t["com.apple.fps.1_0"]=this.options.fairplayURL),this.shaka.configure({drm:{servers:t}}),this.options.fairplayCertificateUrl){const t=await fetch(this.options.fairplayCertificateUrl),e=await t.arrayBuffer();this.shaka.configure("drm.advanced.com\\.apple\\.fps\\.1_0.serverCertificate",new Uint8Array(e)),window.shaka.polyfill.PatchedMediaKeysApple.install();const n=window.shaka.util.FairPlayUtils;this.shaka.getNetworkingEngine().registerRequestFilter(n.ezdrmFairPlayRequest),this.shaka.getNetworkingEngine().registerResponseFilter(n.commonFairPlayResponse),this.shaka.configure("drm.initDataTransform",n.ezdrmInitDataTransform)}}onError(t){this.bus.emit("error",t),this.logger.error(t)}modifyRequests(t){this.shaka.getNetworkingEngine().registerRequestFilter((e,n)=>{e===window.shaka.net.NetworkingEngine.RequestType.KEY&&this.options.aesToken&&(n.headers.Authorization="Bearer "+this.options.aesToken);const i=t?.split("?")[1]?.split("&");i?.length&&i.forEach(t=>{const e=n.uris[0]?.split("?")[1];e?n.uris[0].includes(t)||(n.uris[0]+="&"+t):n.uris[0]+="?"+t})})}preselectQuality(){this.options.qualityLevel&&(new window.shaka.util.EventManager).listen(this.shaka,"streaming",()=>{const t=parseInt(this.options.qualityLevel,10),e=this.getLevels().find(e=>e.height===t);e&&this.setLevel(e)})}getLevels(){return[X].concat(this.shaka.getVariantTracks())}setLevel(t){t===X?this.shaka.configure({abr:{enabled:!0}}):(this.shaka.configure({abr:{enabled:!1}}),this.shaka.selectVariantTrack(t,!0))}limitLevel(t){const e=parseInt(t,10);e&&this.shaka.configure({abr:{restrictions:{maxHeight:e}}})}goToLive(){this.shaka.goToLive()}isLive(){return this.$el.currentTime>=this.shaka?.seekRange()?.end-10}getLevel(){const t=this.shaka.getVariantTracks().find(t=>t.active);return this.shaka.getConfiguration().abr.enabled?X:t}isMultiQuality(){return this.shaka.getVariantTracks().length>1}destroy(){this.shaka.destroy(),super.destroy()}};var ot=(()=>{for(var t,e,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],i=0,s=n.length,o={};i<s;i++)if((t=n[i])&&t[1]in document){for(i=0,e=t.length;i<e;i++)o[n[0][i]]=t[i];return o}return!1})();const rt={request(t){var e=ot.requestFullscreen;t=t||document.documentElement,/5\.1[\.\d]* Safari/.test(navigator.userAgent),t[e]()},exit(){this.isFullscreen&&document[ot.exitFullscreen]()},toggle(t){this.isFullscreen?this.exit():this.request(t)},raw:ot,isFullscreen:!1,element:null,enabled:!1};B(rt,"isFullscreen",function(){return Boolean(document[ot.fullscreenElement])},d),B(rt,"element",function(){return document[ot.fullscreenElement]},d),B(rt,"enabled",function(){return Boolean(document[ot.fullscreenEnabled])},d);const at=!!ot&&rt,lt={fullscreen:"Fullscreen","exit-fullscreen":"Exit full screen",theater:"Theater mode","exit-theater":"Standard mode",play:"Play",pause:"Pause",replay:"Replay","standard-playbackrate":"Standard",forward:"Forward 10 sec",backward:"Back 10 sec",prevframe:"Move to previous frame",nextframe:"Move to next frame",annotations:"Annotations",quality:"Quality","audio-tracks":"Audio tracks","playback-rate":"Playback rate",settings:"Settings",buffering:"Buffering...",cc:"Closed Captions",transcript:"Transcript",chapters:"Chapters",back:"Back","settings-fontcolor":"Font color","settings-fontsize":"Font size","settings-fontfamily":"Font family","settings-background":"Background color","settings-captionlocations":"Captions location",help:"Help",download:"Download","video-drm":"Video","video-only":"Video Only","video-and":"Video and",language:"Language","unapproved-source":"(unapproved)",translate:"Translate",translating:"Translating...",monoserif:"Monospace serif",propserif:"Proportionate serif",monosans:"Monospace sans serif",propssans:"Proportionate sans serif","cc-location-over":"Overlay video","cc-location-below":"Below the video",red:"Red",purple:"Purple",indigo:"Indigo",blue:"Blue",green:"Green",yellow:"Yellow",orange:"Orange",brown:"Brown",grey:"Grey",white:"White",black:"Black","help-bacward":'"Left (◄)" - Jump backward by 10 seconds',"help-play":'"Space" - Toggle playback',"help-skip":'"Right (►)" - Skip 10 seconds',"help-volume":'"UP/DOWN (▲/▼)" - Change volume by 10%',"help-esc":'"ESC" - exit fullscreen',"no-video":"No playable sources found","playlist-count-of":"videos","caption-search":"Search captions",next:"Next",prev:"Previous",error:"An error occurred while playing the media."};function ht(t={},e){return(t?t[e]:null)||lt[e]}function ct(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class pt extends V{constructor(t,e,n,i=[]){super(n.bus,n.logger),ct(this,"player",void 0),ct(this,"options",void 0),ct(this,"state",void 0),ct(this,"_events",void 0),ct(this,"_listener",void 0),this.player=t,this.options=n,this.state=e,this._events=i;const s=this._listenerMethod.bind(this);s._safe_inner=!0,$(i)&&(this._listener=s,this.bus.on("*",s))}$t(t){return ht(this.options.i18n,t)}_listenerMethod(t,...e){if(a(this._events,t)){const i=this[`on${n=t,n.substring(0,1).toUpperCase()+n.substring(1)}`];o(i)&&i.apply(this,e)}var n}destroy(){super.destroy(),this.bus.off("*",this._listener)}getElement(){return null}getOuter(){return null}}function ut({url:t,success:e,responseType:n,rangeStart:i,rangeEnd:s,error:o}){const r=function(t,e){const n=new XMLHttpRequest;return n.onreadystatechange=function(){try{4===n.readyState&&(200===n.status?setTimeout(t):e&&(!n.status||n.status>=400)&&setTimeout(e))}catch(t){}},n}(()=>{const t="arraybuffer"===r.responseType?r.response:r.responseText;e({url:r.responseURL,data:t})},o);r.open("GET",t,!0),b(s)&&b(i)&&r.setRequestHeader("Range","bytes="+i+"-"+--s),b(n)&&(r.responseType=n),r.send(null)}function dt(t){const e=t.split(":"),n=[3600,60,1];let i=0;for(;e.length&&n.length;)i+=e.pop()*n.pop();return i}function gt(t,e=!1,n=!1){const i=Math.round(1e3*t)%1e3;t=Math.floor(t);const s=e?[24,60,60]:[60,60],o=[];for(;s.length;){const e=s.pop();o.unshift(mt(t%e)),t=Math.floor(t/e)}return n?o.join(":")+"."+i:o.join(":")}function mt(t){return t<10?`0${t}`:`${t}`}const bt=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;function yt(t,e,n){ut({url:t,success:({data:t})=>{e(function(t){let e=t.split(/\n\s*\n+/gm);if("WEBVTT"!==e.shift().trim())return[];return A(L(e),t=>{const e=t.split(/\n/g),n=F(e).indexOf("--\x3e")<0?e.shift():"",i=e.shift().split("--\x3e");return{from:dt(F(i).trim()),to:dt(z(i).trim()),text:e.filter(t=>!!t).join("<br/>&nbsp;").replace(bt,""),title:n,id:x()}})}(t))},error:n})}function ft(t,e,i){i.style.display="block";let s=t.getElement();const o=s?s.offsetWidth:0;if(n(e)){const t=(o?s:s.parentNode).getBoundingClientRect(),n=e.getBoundingClientRect();e=vt(n.left+n.right)-t.left}const r=i.offsetWidth;let a=Math.max(3,e-vt(r));o&&(a=Math.min(a,o-r-3)),i.style.left=`${a}px`,i.style.display=""}function vt(t){return Math.floor(t/2)}function $t(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const xt="rmp-ext-progress",_t=`${xt}__current`,wt=`${xt}__duration`,Ct=`${xt}__bar`,kt=`${xt}__bar-padding`,Tt=`${xt}__handle`,St=`${xt}__overlay`,Et=`${xt}__play-progress`,Pt=`${xt}__progress`,Lt=`${xt}__tooltip`,Mt=`${xt}__tooltip--visible`,At=`${xt}__thumbmail`,Ft=`${xt}__thumbmail-time`,zt=`${xt}__generic-live-stream`,Nt=`${xt}__hidden`,Ot=`${xt}__chapter-bubble`;function Rt(t){if(t===1/0||isNaN(t))return"--:--";const e=Math.floor(t/3600),n=Math.floor(t/60)%60,i=Math.floor(t%60);return(e?jt(e)+":":"")+jt(n)+":"+jt(i)}function jt(t){return t<10?`0${t}`:`${t}`}const Ht={width:32,height:32,viewBox:"0 0 24 24"},Dt="M8 5v14l11-7z",Bt="M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z",It="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z",Vt="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z",Ut="M6 6h2v12H6zm3.5 6l8.5 6V6z",Wt="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z",qt="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z",Gt="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z",Qt="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z";function Yt(t,e,n={}){const i=w("svg",n=H({},Ht,n),t,"http://www.w3.org/2000/svg");return Array.isArray(e)?e.forEach(t=>{w("path",Zt(t),i,"http://www.w3.org/2000/svg")}):w("path",Zt(e),i,"http://www.w3.org/2000/svg"),i}function Zt(t){return"string"==typeof t?{d:t}:{...t}}const Kt="rmp-ext-popover",Jt=`${Kt}--visible`;function Xt(t,{$button:e,text:n}){const i=e.parentNode,s=w("span",{class:Kt,tabindex:"0"});_(i,s,e),e.setAttribute("aria-label",o(n)?n():n);let r=null;function a(){s.textContent=o(n)?n():n,s.style.left="0",ft(t.player,e,s),S(s,Jt)}function l(){clearTimeout(r),E(s,Jt)}t.addEvent(e,"mouseenter",()=>r=setTimeout(a,500)),t.addEvent(e,"mouseleave",l),t.addEvent(e,"click",l)}const te="rmp-ext-play",ee=`${te}--playing`,ne=`${te}--paused`,ie=`${te}--ended`,se="rmp-";function oe(t,e){try{localStorage.setItem(se+t,e)}catch(t){}}function re(t,e){try{const n=localStorage.getItem(se+t);return b(n)?n:e}catch(t){return e}}function ae(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const le="rmp-ext-volume",he=`${le}__btn`,ce=`${he}--muted`,pe=`${le}__selector`,ue=`${pe}--open`,de=`${pe}--active`,ge=`${le}__slider`,me=`${le}__handle`,be=`${le}__progress`,ye=`${le}__overlay`,fe="volume",ve="muted";function $e(t){return t=Math.max(0,t),Math.min(t,1)}const xe="rmp-ext-fullscreen",_e=`${xe}--exit`;function we(t,e){if(!t||!t.getElement())return;e.style.maxHeight="";const n=t.getElement().parentNode.getBoundingClientRect(),i=(n.height||n.bottom-n.top)-100;e.style.maxHeight=`${Math.min(i,300)}px`}function Ce(t,{$button:e,$selector:n,SELECTOR_OPEN_CN:i,reposition:s=!0,closeOnClick:o=!1,heightControl:r=!1,firstFocusItemSelector:a="",toMainFn:l=()=>{}}){let h=null;function c(t,e){const n=document.activeElement;let i=t;return!i&&n.parentElement.classList.value.includes("tab-content")&&(i=n.parentElement[e]),i}function p(t,e){let n=t;return n&&n.classList.value.includes("tab-content")&&(n=n[e]),n}function u(t,e){let n=t,i=t&&(n.offsetWidth>0||n.offsetHeight>0);for(;!i&&n;)n=n[e],i=t&&(n.offsetWidth>0||n.offsetHeight>0);return n}function d(){l(),t.bus.emit("hidepopup"),E(n,i),b(h)&&(k(h),h=null)}t.addEvent(e,"click",function(){b(h)?d():(S(n,i),s&&ft(t.player,e,n),setTimeout(()=>{t.bus.emit("showpopup",n),h=C(document,"click",d)}),r&&we(t.player,n),a&&setTimeout(()=>{n.querySelector(a).focus()}))}),o||t.addEvent(n,"click",t=>t.stopPropagation()),t.addEvent(t.player.getElement(),"mouseleave",d),t.addEvent(t.$selector,"keydown",function(e){e.stopPropagation();const n=e.keyCode,i=document.activeElement;if(27===n)return e.preventDefault(),d(),void t.$button.focus();if(39===n)return e.preventDefault(),void(i.classList.value.includes("__more")&&i.click());if(37===n){e.preventDefault();const n=t.$selector.querySelectorAll('button[class$="__back"]'),i=Array.from(n).find(t=>t.offsetWidth>0||t.offsetHeight>0);return void(i&&i.click())}if(40===n){e.preventDefault();let t=i.nextElementSibling;return t=u(t,"nextElementSibling"),t=p(t,"firstElementChild"),t||(t=c(t,"nextElementSibling")),void(t&&t.focus())}if(38===n){e.preventDefault();let t=i.previousElementSibling;t=c(t,"previousElementSibling"),t=u(t,"previousElementSibling"),t=p(t,"lastElementChild"),t&&t.focus()}}),t.bus.on("resizeplayer",d)}function ke(t,e){c(e,e=>{t[e]=t[e].bind(t)})}const Te=[{key:"red",value:"#F44336"},{key:"purple",value:"#9C27B0"},{key:"indigo",value:"#3F51B5"},{key:"blue",value:"#2196F3"},{key:"green",value:"#4CAF50"},{key:"yellow",value:"#FFEB3B"},{key:"orange",value:"#FF9800"},{key:"brown",value:"#795548"},{key:"grey",value:"#9E9E9E"},{key:"white",value:"#FFF"},{key:"black",value:"#000"}],Se=[{label:"75%",value:"75%"},{label:"100%",value:"100%"},{label:"125%",value:"125%"},{label:"150%",value:"150%"},{label:"200%",value:"200%"}],Ee=[{key:"monoserif",value:'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace'},{key:"propserif",value:'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif'},{key:"monosans",value:'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace'},{key:"propssans",value:'Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif'}],Pe=[{key:"cc-location-over",value:"over"},{key:"cc-location-below",value:"below"}];function Le(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Me="rmp-ext-cc",Ae=`${Me}__button`,Fe=`${Me}__selector`,ze=`${Fe}--open`,Ne=`${Fe}--main-step`,Oe=`${Fe}--settings-step`,Re=`${Fe}--additional-step`,je=`${Fe}--translate-step`,He=`${Me}__main-step`,De=`${Me}__settings-step`,Be=`${Me}__additional-step`,Ie=`${Me}__item`,Ve=`${Ie}--checked`,Ue=`${Me}__settings`,We=`${Ue}--progress`,qe=`${Me}__more`,Ge=`${Me}__current-value`,Qe=`${Me}__text`,Ye=`${Qe}--visible`,Ze=`${Me}__text-holder`,Ke=`${Me}__back`,Je=`${Me}__translate-wrapper`,Xe=`${Me}__settings-wrapper`;function tn(t){S(t,qe);const e=w("span",{class:"arrow"},t);return Yt(e,qt),e}function en(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const nn="rmp-ext-toc",sn=`${nn}__button`,on=`${nn}__selector`,rn=`${on}--main-step`,an=`${on}--languages-step`,ln=`${on}--translate-step`,hn=`${on}--open`,cn=`${nn}__languages-step`,pn=`${nn}__more`,un=`${nn}__back`,dn=`${nn}__main-step`,gn=`${nn}__languge-btn`,mn=`${nn}__chapters`,bn=`${nn}__item`,yn=`${nn}__lang-item`,fn=`${yn}--checked`,vn=`${nn}__translate-step`,$n=`${nn}__current-value`;function xn(t){S(t,pn);const e=w("span",{class:"arrow"},t);return Yt(e,qt),e}function _n(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const wn="rmp-annotation",Cn=`${wn}--visible`,kn=`${wn}__holder`,Tn=`${wn}__button`,Sn=/(https?:\/\/[^\s]+)/g;function En({text:t,starts:e,ends:n,top:i,left:s,width:o,height:r,fontsize:a,fontcolor:l,background:h}){return{text:t,top:i,left:s,width:o,height:r,fontsize:a,fontcolor:l,background:h,from:dt(`${e.hh}:${e.mm}:${e.ss}`),to:dt(`${n.hh}:${n.mm}:${n.ss}`)}}const Pn="rmp-ext-poster",Ln=`${Pn}--video`,Mn=`${Pn}--hidden`;function An(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Fn="rmp-ext-placeholder",zn=`${Fn}--animation`,Nn=`${Fn}__icon`,On=`${Fn}__play-btn`,Rn={32:"_togglePlay",37:"_skeepLeft",39:"_skeepRight",38:"_upVolume",40:"_downVolume",74:"_prevFrame",75:"_nextFrame"};let jn,Hn,Dn;var Bn="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof t.g&&t.g.global===t.g?t.g:void 0;function In(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){qn(i.response,e,n)},i.onerror=function(){console.error("could not download file")},i.send()}function Vn(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function Un(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var Wn=/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),qn=Bn.saveAs||("object"!=typeof window||window!==Bn?function(){}:"download"in HTMLAnchorElement.prototype&&!Wn?function(t,e,n){var i=Bn.URL||Bn.webkitURL,s=document.createElement("a");e=e||t.name||"download",s.download=e,s.rel="noopener","string"==typeof t?(s.href=t,s.origin!==location.origin&&Vn(s.href)?In(t,e,n):Un(s)):(s.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(s.href)},4e4),setTimeout(function(){Un(s)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download","string"==typeof t)if(Vn(t))In(t,e,n);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){Un(i)})}else navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,n),e)}:function(t,e,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return In(t,e,n);var s="application/octet-stream"===t.type,o=/constructor/i.test(Bn.HTMLElement)||Bn.safari,r=/CriOS\/[\d]+/.test(navigator.userAgent);if((r||s&&o||Wn)&&"undefined"!=typeof FileReader){var a=new FileReader;a.onloadend=function(){var t=a.result;t=r?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=t:location=t,i=null},a.readAsDataURL(t)}else{var l=Bn.URL||Bn.webkitURL,h=l.createObjectURL(t);i?i.location=h:location.href=h,i=null,setTimeout(function(){l.revokeObjectURL(h)},4e4)}});function Gn(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Qn="rmp-ext-download",Yn=`${Qn}__button`,Zn=`${Qn}__selector`,Kn=`${Zn}--open`,Jn=`${Zn}--additional`,Xn=`${Qn}__more`,ti=`${Qn}__main-step`,ei=`${Qn}__additional-step`,ni=`${Qn}__back`,ii=`${Qn}__download-cc`;function si(t){const e=w("span",{class:"arrow"},t);return Yt(e,qt),e}function oi(t){return 1!==t.state&&0!==t.state}function ri(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ai="rmp-ext-settings",li=`${ai}__button`,hi=`${ai}__selector`,ci=`${hi}--open`,pi=`${hi}--additional`,ui=`${ai}__main-step`,di=`${ai}__additional-step`,gi=`${ai}__annotations`,mi=`${ai}__quality`,bi=`${ai}__playback-rate`,yi=`${ai}__back`,fi=`${ai}__more`,vi=`${ai}__current-value`,$i=`${ai}__item`,xi=`${$i}--checked`,_i="annotationslang",wi={label:"None",srclang:""},Ci=[{rate:.5},{rate:.8},{rate:1,labelKey:"standard-playbackrate"},{rate:1.5},{rate:2},{rate:3,hide:t=>t.isLive},{rate:5,hide:t=>t.isAudio||t.isLive}];function ki(t){const e=w("span",{class:"arrow"},t);return Yt(e,qt),e}function Ti(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Si="rmp-ext-title",Ei=`${Si}__title`;function Pi(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Li="rmp-ext-prev",Mi=`${Li}__button`,Ai=`${Li}__thumbnail`;function Fi(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const zi="rmp-ext-next",Ni=`${zi}__button`,Oi=`${zi}__thumbnail`;function Ri(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ji="rmp-ext-buffering",Hi=`${ji}--processing`,Di={page_type:"watchpage",player_name:"RavnurPlayer",player_version:"3.3.3",video_stream_type:"on-demand"};const Bi="rmp-ext-theater",Ii=`${Bi}--exit`,Vi=`${Bi}--hidden`;function Ui(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Wi="rmp-ext-audio-tracks",qi=`${Wi}__button`,Gi=`${Wi}__selector`,Qi=`${Gi}--open`,Yi=`${Wi}__item`,Zi=`${Yi}--checked`,Ki=document.createElement("span");function Ji(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Xi="rmp-ext-search",ts="rmp-ext-search--hidden",es=`${Xi}__button`,ns=`${Xi}__selector`,is=`${ns}--open`,ss=`${Xi}__captions`,os=`${Xi}__input`,rs=`${Xi}__item`,as=`${rs}--current`,ls=`${Xi}__cc-time`,hs=`${Xi}__cc-text`,cs=`${Xi}__cc-clear`;function ps(t){return`cc-${t}`}const us="rmp-ext-bottom-next",ds=`${us}--hidden`;const gs="rmp-ext-bottom-prev",ms=`${gs}--hidden`;function bs(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ys="rmp-ext-crawl",fs=`${ys}__text`;class vs extends pt{constructor(t,e,n){super(t,e,n,[]),bs(this,"$crawl",null),bs(this,"$intervalId",null),this.logger.debug("crawl:extensions:creating"),this.render(),this.logger.debug("crawl:extensions:created"),n.bus.on("fullscreenchanging",()=>{setTimeout(()=>this.refresh(this.options.crawl,this.options.showCrawl),100)}),n.bus.on("resizeplayer",()=>{setTimeout(()=>this.refresh(this.options.crawl,this.options.showCrawl),100)})}startAnimation(t=100){if(this.$intervalId)return;const e=document.getElementById("crawlText"),n=document.querySelector(".rmp-ext-crawl");if(!e||!n)return;const i=n.offsetWidth,s=e.offsetWidth;let o=i;this.$intervalId=setInterval(()=>{o--,o<-s&&(o=i),e.style.transform=`translateX(${o}px)`},t)}render(){this.$crawl=w("div",{class:ys,"data-testid":"crawl"}),w("div",{id:"crawlText",class:fs,title:this.options.crawl.text,tabindex:0},this.$crawl).innerHTML=$s(this.options.crawl.text)||"",this.$crawl.style.color=this.options.crawl.textColor,this.$crawl.style.backgroundColor=this.options.crawl.backgroundColor,this.toggle(this.options.showCrawl),setTimeout(()=>this.startAnimation(this.options.crawl.speed))}getOuter(){return this.$crawl}toggle(t){this.$crawl&&(this.$crawl.style.display=t?"block":"none")}refresh(t,e){if(!this.$crawl)return;const n=document.getElementById("crawlText");n&&(n.innerHTML=$s(t.text)||"",this.$crawl.style.color=t.textColor,this.$crawl.style.backgroundColor=t.backgroundColor,this.clearInterval(),this.toggle(e),e&&this.startAnimation(t.speed))}destroy(){if(super.destroy(),!this.$crawl)return;const t=this.$crawl.parentNode;t&&t.removeChild(this.$crawl),this.$crawl=null,this.clearInterval()}clearInterval(){this.$intervalId&&(clearInterval(this.$intervalId),this.$intervalId=null)}}function $s(t){return t.replace(/(\r\n|\n|\r)/gm,"").replace(/<br\s*[\/]?>/gi,"")}const xs="rmp-ext-live",_s=`${xs}--live`;const ws="rmp-ext-error",Cs=`${ws}--hidden`,ks=`${ws}__content`,Ts=[["showTitle",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$outer"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("title:extension:creating"),this.render(),this.logger.debug("title:extension:created")}render(){this.$outer=w("div",{class:Si,"data-testid":"title"}),w("span",{class:Ei,title:this.options.title,tabindex:0},this.$outer).textContent=this.options.title||""}getOuter(){return this.$outer}destroy(){if(super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],[!0,class extends pt{constructor(t,e,n){super(t,e,n,["seeking","waiting","seeked","canplay","playing","timeupdate"]),Ri(this,"$outer",void 0),Ri(this,"_timerId",void 0),this.logger.debug("buffering:extension:creating"),this.render(),n.isMobile||this.startProcessing(),this.logger.debug("buffering:extension:created")}onWaiting(){this.startProcessing()}onSeeking(){this.startProcessing()}startProcessing(){clearTimeout(this._timerId),this._timerId=setTimeout(()=>S(this.$outer,Hi),this.options.bufferingTimeout)}onTimeupdate(){this.hideProcessing()}onSeeked(){this.hideProcessing()}onCanplay(){this.hideProcessing()}onPlaying(){this.hideProcessing()}render(){this.$outer=w("div",{class:ji}),Yt(w("span",{class:`${ji}__message`},this.$outer),"M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z",{})}getOuter(){return this.$outer}hideProcessing(){clearTimeout(this._timerId),E(this.$outer,Hi)}destroy(){super.destroy();const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["showPoster",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$outer"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("poster:extension:creating"),this._hidePoster=this._hidePoster.bind(this),this.render(),this.logger.debug("poster:extension:created")}render(){this.$outer=w("div",{class:Pn,tabindex:-1}),w("img",{src:this.options.poster},this.$outer).setAttribute("aria-label",this.options.title||""),this.options.isAudio||(S(this.$outer,Ln),this.bus.on("play",this._hidePoster))}_hidePoster(){S(this.$outer,Mn)}getOuter(){return this.$outer}destroy(){if(this.bus.off("play",this._hidePoster),super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["showError",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["error"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$outer"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("error:extension:creating"),this.onError=this.onError.bind(this),this.render(),this.logger.debug("error:extension:created")}render(){this.$outer=w("div",{class:`${ws} ${Cs}`,tabindex:-1}),Yt(this.$outer,"M7.493 0.015 C 7.442 0.021,7.268 0.039,7.107 0.055 C 5.234 0.242,3.347 1.208,2.071 2.634 C 0.660 4.211,-0.057 6.168,0.009 8.253 C 0.124 11.854,2.599 14.903,6.110 15.771 C 8.169 16.280,10.433 15.917,12.227 14.791 C 14.017 13.666,15.270 11.933,15.771 9.887 C 15.943 9.186,15.983 8.829,15.983 8.000 C 15.983 7.171,15.943 6.814,15.771 6.113 C 14.979 2.878,12.315 0.498,9.000 0.064 C 8.716 0.027,7.683 -0.006,7.493 0.015 M8.853 1.563 C 9.967 1.707,11.010 2.136,11.944 2.834 C 12.273 3.080,12.920 3.727,13.166 4.056 C 13.727 4.807,14.142 5.690,14.330 6.535 C 14.544 7.500,14.544 8.500,14.330 9.465 C 13.916 11.326,12.605 12.978,10.867 13.828 C 10.239 14.135,9.591 14.336,8.880 14.444 C 8.456 14.509,7.544 14.509,7.120 14.444 C 5.172 14.148,3.528 13.085,2.493 11.451 C 2.279 11.114,1.999 10.526,1.859 10.119 C 1.618 9.422,1.514 8.781,1.514 8.000 C 1.514 6.961,1.715 6.075,2.160 5.160 C 2.500 4.462,2.846 3.980,3.413 3.413 C 3.980 2.846,4.462 2.500,5.160 2.160 C 6.313 1.599,7.567 1.397,8.853 1.563 M7.706 4.290 C 7.482 4.363,7.355 4.491,7.293 4.705 C 7.257 4.827,7.253 5.106,7.259 6.816 C 7.267 8.786,7.267 8.787,7.325 8.896 C 7.398 9.033,7.538 9.157,7.671 9.204 C 7.803 9.250,8.197 9.250,8.329 9.204 C 8.462 9.157,8.602 9.033,8.675 8.896 C 8.733 8.787,8.733 8.786,8.741 6.816 C 8.749 4.664,8.749 4.662,8.596 4.481 C 8.472 4.333,8.339 4.284,8.040 4.276 C 7.893 4.272,7.743 4.278,7.706 4.290 M7.786 10.530 C 7.597 10.592,7.410 10.753,7.319 10.932 C 7.249 11.072,7.237 11.325,7.294 11.495 C 7.388 11.780,7.697 12.000,8.000 12.000 C 8.303 12.000,8.612 11.780,8.706 11.495 C 8.763 11.325,8.751 11.072,8.681 10.932 C 8.616 10.804,8.460 10.646,8.333 10.580 C 8.217 10.520,7.904 10.491,7.786 10.530",{class:"error",width:800,height:800,viewBox:"0 0 16 16"}),w("div",{class:ks},this.$outer).textContent=this.$t("error"),this.logger.debug("error:extension:rendered")}onError(){this.logger.debug("error:extension:onError"),E(this.$outer,Cs)}getOuter(){return this.$outer}destroy(){if(super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["showBackward",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("backward:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.backward.bind(this)),this.logger.debug("backward:extension:created")}render(){this.$el=w("button",{type:"button",class:"rmp-ext-backward"}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("backward")})),Yt(this.$el,Bt)}backward(){this.player.setCurrentTime(this.player.getCurrentTime()-(this.options.skipDelta||0)),this.bus.emit("heartbeatextensions")}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showPrevFrame",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("prevframe:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.prevframe.bind(this)),this.logger.debug("prevframe:extension:created")}render(){this.$el=w("button",{type:"button",class:"rmp-ext-prev-frame"}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("prevframe")})),Yt(this.$el,Ut)}prevframe(){this.player.prevFrame()}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showBottomPrev",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("bottom-prev:extension:creating"),this.render();const r=this.options.bus;this.addEvent(this.$el,"click",()=>r.emit("prevtrack")),this.logger.debug("bottom-prev:extension:created")}render(){this.$el=w("button",{type:"button",class:`${gs}`}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("prev")})),Yt(this.$el,Ut),this.player.options.prevTrackTitle||this.$el.classList.add(ms)}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showPlay",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["pause","play","ended","seeking"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("play:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.toggle.bind(this)),this.logger.debug("play:extension:created")}render(){this.$el=w("button",{type:"button",class:`${te} ${ne}`}),setTimeout(()=>{Xt(this,{$button:this.$el,text:()=>this.player.isEnded()?this.$t("replay"):this.player.isPaused()?this.$t("play"):this.$t("pause")})}),Yt(this.$el,Dt,{class:"play"}),Yt(this.$el,"M6 19h4V5H6v14zm8-14v14h4V5h-4z",{class:"pause"}),Yt(this.$el,"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z",{class:"replay"})}toggle(){this.player.isPaused()||this.player.isEnded()?this.player.play():this.player.pause()}onPause(){this.$el.setAttribute("aria-label","Play"),E(this.$el,ee),E(this.$el,ie),S(this.$el,ne)}onPlay(){this.$el.setAttribute("aria-label","Pause"),E(this.$el,ne),E(this.$el,ie),S(this.$el,ee)}onEnded(){this.options.playLoop||(this.$el.setAttribute("aria-label","Reply"),E(this.$el,ne),E(this.$el,ee),S(this.$el,ie))}onSeeking(){E(this.$el,ie),E(this.$el,ne),E(this.$el,ee),this.player.isPaused()?S(this.$el,ne):S(this.$el,ee)}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showBottomNext",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("bottom-next:extension:creating"),this.render();const r=this.options.bus;this.addEvent(this.$el,"click",()=>r.emit("nexttrack")),this.logger.debug("bottom-next:extension:created")}render(){this.$el=w("button",{type:"button",class:`${us}`}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("next")})),Yt(this.$el,Vt),this.player.options.nextTrackTitle||this.$el.classList.add(ds)}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showNextFrame",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("nextframe:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.nextframe.bind(this)),this.logger.debug("nextframe:extension:created")}render(){this.$el=w("button",{type:"button",class:"rmp-ext-next-frame"}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("nextframe")})),Yt(this.$el,Vt)}nextframe(){this.player.nextFrame()}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showForward",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("forward:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.forward.bind(this)),this.logger.debug("forward:extension:created")}render(){this.$el=w("button",{type:"button",class:"rmp-ext-forward"}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("forward")})),Yt(this.$el,It)}forward(){this.player.setCurrentTime(this.player.getCurrentTime()+(this.options.skipDelta||0)),this.bus.emit("heartbeatextensions")}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showVolume",class extends pt{constructor(t,e,n){super(t,e,n,["volumechange","loadedmetadata"]),ae(this,"$el",void 0),ae(this,"$button",void 0),ae(this,"$selector",void 0),ae(this,"$slider",void 0),ae(this,"$progress",void 0),ae(this,"$handle",void 0),ae(this,"_dragNdropTokens",[]),this.logger.debug("volume:extension:creating"),this.onHandleMouseUp=this.onHandleMouseUp.bind(this),this.onHandleMouseDown=this.onHandleMouseDown.bind(this),this.onHandleMouseMove=this.onHandleMouseMove.bind(this),this.onHandleEsqKey=this.onHandleEsqKey.bind(this),this.render(),this.addEvent(this.$button,"click",this.toggle.bind(this)),this.addEvent(this.$slider,"click",this.changeVolume.bind(this)),this.addEvent(this.$handle,"mousedown",this.onHandleMouseDown),function(t,{$button:e,$selector:n,SELECTOR_OPEN_CN:i}){t.addEvent(e,"click",function(){P(n,i),ft(t.player,e,n)});let s=null;function o(){S(n,i),ft(t.player,e,n)}t.addEvent(t.getElement(),"mouseleave",function(){clearTimeout(s),E(n,i)}),t.addEvent(e,"mouseenter",()=>s=setTimeout(o,200))}(this,{$button:this.$button,$selector:this.$selector,SELECTOR_OPEN_CN:ue,closeOnClick:!1}),this.refreshHandle(),this.logger.debug("volume:extension:created")}render(){this.$el=w("span",{class:le}),this.$button=w("button",{type:"button",class:he},this.$el),this.$button.setAttribute("aria-label","Volume"),this.$button.addEventListener("keydown",this.onHandleEsqKey),this.$selector=w("div",{class:pe},this.$el),this.$slider=w("span",{class:ge},this.$selector),w("span",{class:ye},this.$slider),this.$progress=w("span",{class:be},this.$slider),this.$handle=w("span",{class:me},this.$slider),Yt(this.$button,Gt,{class:"muted"}),Yt(this.$button,Qt,{class:"unmuted"})}toggle(){const t=!this.player.isMuted();if(this.player.setMuted(t),oe(ve,t.toString()),!t){const t=Math.max(this.player.getVolume(),.1);this.player.setVolume(t),oe(fe,t.toString())}}_getVolumeByEvent(t){const e=this.$slider.getBoundingClientRect();return(1-(function(t){return t.clientY}(t)-e.top)/this.$slider.offsetHeight).toFixed(2)}changeVolume(t){const e=this._getVolumeByEvent(t);this.updateVolume(Number(e))}updateVolume(t){t=$e(t),this.logger.debug("changevolume",t),t?(this.player.setVolume(t),this.player.setMuted(!1),oe(fe,t),oe(ve,!1)):(this.player.setMuted(!0),oe(ve,!0))}onVolumechange(){this.player.isMuted()?S(this.$button,ce):E(this.$button,ce),this.refreshHandle()}onLoadedmetadata(){const t=this.player.isMuted();this.player.setVolume(parseFloat(re(fe,"1.0"))),"boolean"==typeof t?this.player.setMuted(t):this.player.setMuted("true"===re(ve,"false"),!0)}refreshHandle(){this._refreshHadle4volume(this.player.getVolume())}_refreshHadle4volume(t){const e=this.player.isMuted()?"100%":100*(1-t)+"%";this.$handle.style.top=this.$progress.style.top=e}onHandleMouseDown(){S(this.$selector,de),this._dragNdropTokens.push(C(document,"mouseup",this.onHandleMouseUp)),this._dragNdropTokens.push(C(document,"mousemove",this.onHandleMouseMove))}onHandleMouseUp(t){c(this._dragNdropTokens,k),this._dragNdropTokens.length=0,this.changeVolume(t),E(this.$selector,de)}onHandleMouseMove(t){let e=Number(this._getVolumeByEvent(t));e=$e(e),this._refreshHadle4volume(e)}onHandleEsqKey(t){27===t.keyCode&&(E(this.$selector,ue),t.preventDefault())}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$button&&this.$button.removeEventListener("keydown",this.onHandleEsqKey),this.$el=null,this.$button=null,this.$selector=null,this.$slider=null,this.$progress=null,this.$handle=null}}],["isLive",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["timeupdate","progress"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("play:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.toggle.bind(this)),this.logger.debug("live:extension:created")}render(){this.$el=w("button",{type:"button",class:xs}),Yt(this.$el,"M 8.0136719 7.0292969 A 1.0001 1.0001 0 0 0 7.3222656 7.3222656 C 2.7995047 11.846068 -1.1842379e-15 18.102792 0 25 C 0 31.897208 2.7995047 38.153932 7.3222656 42.677734 A 1.0001 1.0001 0 0 0 8.7363281 42.677734 L 11.570312 39.84375 A 1.0001 1.0001 0 0 0 11.570312 38.429688 C 8.1286602 34.987084 6 30.242812 6 25 C 6 19.757188 8.1297921 15.013788 11.572266 11.572266 A 1.0001 1.0001 0 0 0 11.572266 10.158203 L 8.7363281 7.3222656 A 1.0001 1.0001 0 0 0 8.0136719 7.0292969 z M 41.957031 7.0292969 A 1.0001 1.0001 0 0 0 41.263672 7.3222656 L 38.427734 10.158203 A 1.0001 1.0001 0 0 0 38.427734 11.572266 C 41.870208 15.013788 44 19.757188 44 25 C 44 30.242812 41.870208 34.986212 38.427734 38.427734 A 1.0001 1.0001 0 0 0 38.427734 39.841797 L 41.263672 42.677734 A 1.0001 1.0001 0 0 0 42.677734 42.677734 C 47.201645 38.154865 50 31.897208 50 25 C 50 18.102792 47.200495 11.846068 42.677734 7.3222656 A 1.0001 1.0001 0 0 0 41.957031 7.0292969 z M 8.0976562 9.5117188 L 9.5195312 10.933594 C 6.1269359 14.664061 4 19.575176 4 25 C 4 30.424712 6.1260807 35.337173 9.5175781 39.068359 L 8.0976562 40.488281 C 4.3450168 36.394537 2 30.995061 2 25 C 2 19.004939 4.3450168 13.605463 8.0976562 9.5117188 z M 41.902344 9.5117188 C 45.654983 13.605463 48 19.004939 48 25 C 48 30.995061 45.655695 36.395442 41.902344 40.488281 L 40.480469 39.066406 C 43.873064 35.335939 46 30.424824 46 25 C 46 19.575176 43.873064 14.664061 40.480469 10.933594 L 41.902344 9.5117188 z M 14.382812 13.398438 A 1.0001 1.0001 0 0 0 13.691406 13.691406 C 10.796092 16.587786 9 20.593819 9 25 C 9 29.406181 10.796092 33.412214 13.691406 36.308594 A 1.0001 1.0001 0 0 0 15.105469 36.308594 L 17.931641 33.482422 A 1.0001 1.0001 0 0 0 17.931641 32.068359 C 16.119902 30.255711 15 27.761761 15 25 C 15 22.238239 16.119902 19.744289 17.931641 17.931641 A 1.0001 1.0001 0 0 0 17.931641 16.517578 L 15.105469 13.691406 A 1.0001 1.0001 0 0 0 14.382812 13.398438 z M 35.587891 13.398438 A 1.0001 1.0001 0 0 0 34.894531 13.691406 L 32.068359 16.517578 A 1.0001 1.0001 0 0 0 32.068359 17.931641 C 33.880098 19.744289 35 22.238239 35 25 C 35 27.761761 33.880098 30.255711 32.068359 32.068359 A 1.0001 1.0001 0 0 0 32.068359 33.482422 L 34.894531 36.308594 A 1.0001 1.0001 0 0 0 36.308594 36.308594 C 39.203908 33.412214 41 29.406181 41 25 C 41 20.593819 39.203908 16.587786 36.308594 13.691406 A 1.0001 1.0001 0 0 0 35.587891 13.398438 z M 14.466797 15.880859 L 15.947266 17.361328 C 14.184764 19.450917 13 22.061346 13 25 C 13 27.938654 14.184764 30.549083 15.947266 32.638672 L 14.466797 34.119141 C 12.335969 31.66133 11 28.50273 11 25 C 11 21.49727 12.335969 18.33867 14.466797 15.880859 z M 35.533203 15.880859 C 37.664031 18.33867 39 21.49727 39 25 C 39 28.50273 37.664031 31.66133 35.533203 34.119141 L 34.052734 32.638672 C 35.815236 30.549083 37 27.938654 37 25 C 37 22.061346 35.815236 19.450917 34.052734 17.361328 L 35.533203 15.880859 z M 25 18 C 21.134 18 18 21.134 18 25 C 18 28.866 21.134 32 25 32 C 28.866 32 32 28.866 32 25 C 32 21.134 28.866 18 25 18 z M 25 20 C 27.757 20 30 22.243 30 25 C 30 27.757 27.757 30 25 30 C 22.243 30 20 27.757 20 25 C 20 22.243 22.243 20 25 20 z",{class:"broadcast-off",width:50,height:50,viewBox:"0 0 50 50"}),Yt(this.$el,"M 8.03125 8.4570312 C 7.770375 8.4589063 7.5103125 8.5625312 7.3203125 8.7695312 C 3.3953125 13.041531 1 18.741 1 25 C 1 31.259 3.3953125 36.958469 7.3203125 41.230469 C 7.7003125 41.644469 8.3569063 41.643094 8.7539062 41.246094 L 10.882812 39.117188 C 11.265812 38.734187 11.263391 38.124656 10.900391 37.722656 C 7.8553906 34.352656 6 29.889 6 25 C 6 20.111 7.8553906 15.647344 10.900391 12.277344 C 11.263391 11.875344 11.265813 11.266812 10.882812 10.882812 L 8.7539062 8.7539062 C 8.5554063 8.5554063 8.292125 8.4551562 8.03125 8.4570312 z M 41.96875 8.4570312 C 41.707625 8.4554062 41.444594 8.5554062 41.246094 8.7539062 L 39.115234 10.884766 C 38.732234 11.267766 38.734656 11.875344 39.097656 12.277344 C 42.143656 15.646344 44 20.111 44 25 C 44 29.889 42.144609 34.352656 39.099609 37.722656 C 38.736609 38.124656 38.734188 38.733187 39.117188 39.117188 L 41.246094 41.246094 C 41.643094 41.643094 42.299687 41.643469 42.679688 41.230469 C 46.604687 36.958469 49 31.259 49 25 C 49 18.741 46.604687 13.041531 42.679688 8.7695312 C 42.489688 8.5625312 42.229875 8.4586563 41.96875 8.4570312 z M 35.625 14.837891 C 35.355125 14.824516 35.079594 14.920406 34.871094 15.128906 L 32.740234 17.259766 C 32.381234 17.618766 32.341969 18.196938 32.667969 18.585938 C 34.123969 20.323937 35 22.561 35 25 C 35 27.439 34.123969 29.675109 32.667969 31.412109 C 32.341969 31.801109 32.381234 32.379281 32.740234 32.738281 L 34.871094 34.871094 C 35.288094 35.288094 35.967516 35.250687 36.353516 34.804688 C 38.625516 32.175687 40 28.748 40 25 C 40 21.252 38.625516 17.824312 36.353516 15.195312 C 36.160516 14.972313 35.894875 14.851266 35.625 14.837891 z M 14.375 14.839844 C 14.105125 14.853219 13.839484 14.974266 13.646484 15.197266 C 11.374484 17.825266 10 21.252 10 25 C 10 28.748 11.374484 32.175688 13.646484 34.804688 C 14.032484 35.250687 14.711906 35.288094 15.128906 34.871094 L 17.259766 32.740234 C 17.618766 32.381234 17.658031 31.803062 17.332031 31.414062 C 15.876031 29.676062 15 27.439 15 25 C 15 22.561 15.876031 20.324891 17.332031 18.587891 C 17.658031 18.198891 17.618766 17.620719 17.259766 17.261719 L 15.128906 15.128906 C 14.920406 14.920406 14.644875 14.826469 14.375 14.839844 z M 25 19 C 21.686 19 19 21.686 19 25 C 19 28.314 21.686 31 25 31 C 28.314 31 31 28.314 31 25 C 31 21.686 28.314 19 25 19 z",{class:"broadcast-on",width:50,height:50,viewBox:"0 0 50 50"}),setTimeout(()=>{const t=this.player.isLive()?"Live":"Go to live";Xt(this,{$button:this.$el,text:t})},100)}toggle(){this.goToLive()}goToLive(){this.player.goToLive(),S(this.$el,_s)}onTimeupdate(){this.player.isLive()?(this.$el.setAttribute("aria-label","Live"),S(this.$el,_s)):(this.$el.setAttribute("aria-label","Go to live"),E(this.$el,_s))}onProgress(){this.player.isLive()?(this.$el.setAttribute("aria-label","Live"),S(this.$el,_s)):(this.$el.setAttribute("aria-label","Go to live"),E(this.$el,_s))}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showProgress",class extends pt{constructor(t,e,n){super(t,e,n,["progress","timeupdate","loadedmetadata","canplaythrough","statechanged","durationchange"]),$t(this,"$el",void 0),$t(this,"$bar",void 0),$t(this,"$handle",void 0),$t(this,"$current",void 0),$t(this,"$duration",void 0),$t(this,"$playProgress",void 0),$t(this,"$progress",void 0),$t(this,"$tooltip",void 0),$t(this,"$thumbnail",void 0),$t(this,"$thumbnailTime",void 0),$t(this,"thumbnails",[]),$t(this,"_dragNdropTokens",[]),$t(this,"_isLoadedMetadata",!1),$t(this,"_chapters",[]),$t(this,"_bubbles",[]),this.logger.debug("progress:extension:creating"),this.onLeave=this.onLeave.bind(this),this.onHover=this.onHover.bind(this),this.onHandleMouseUp=this.onHandleMouseUp.bind(this),this.onHandleMouseDown=this.onHandleMouseDown.bind(this),this.onHandleMouseMove=this.onHandleMouseMove.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.render(),this.addEvent(this.$bar,"click",e=>{if((e.target||e.srcElement)===this.$handle)e.stopPropagation();else{const n=this._getTimeByEventPosition(e);t.setCurrentTime(n),this._moveHandle2time(n)}}),this.addEvent(this.$bar,"mouseleave",this.onLeave),this.addEvent(this.$bar,"mousemove",this.onHover),this.addEvent(this.$handle,"mousedown",this.onHandleMouseDown),this.addEvent(this.$handle,"touchstart",this.onTouchStart),b(n.preview)&&yt(n.preview||"",t=>{this.thumbnails=t}),this.logger.debug("progress:extension:created")}render(){this.$el=w("span",{class:xt});const t=this.player.$el?.parentNode?.querySelector(".rmp-extensions");this.$bar=w("span",{class:Ct,tabindex:"-1"},t),w("span",{class:kt},this.$bar),w("span",{class:St},this.$bar),this.$handle=w("span",{class:Tt},this.$bar),this.$current=w("span",{class:_t},this.$el),w("span",{},this.$el).textContent="/",this.$duration=w("span",{class:wt},this.$el),this.$playProgress=w("span",{class:Et},this.$bar),this.$progress=w("span",{class:Pt},this.$bar),this.$tooltip=w("div",{class:Lt},this.$el),this.$thumbnail=w("div",{class:At},this.$tooltip),this.$thumbnailTime=w("span",{class:Ft},this.$tooltip),this.options.isProgressLiveStream&&(S(this.$el,zt),S(this.$bar,zt)),this.options.isLive&&S(this.$el,Nt),this.options.isMobile&&(this.$tooltip.style.visibility="hidden")}onTimeupdate(){$(this._dragNdropTokens)||(this.options.isLive&&this.player.isLive()?(this.$progress.style.width="100%",this.$handle.style.left=this.$playProgress.style.width="100%",this.$current.textContent=Rt(+this._getCurrentTime()),this.$bar.setAttribute("aria-label",this._getAriaLabelValue())):this._moveHandle2time(this._getCurrentTime()))}_moveHandle2time(t){const e=this.player.getDuration(),n=this.options,i=Number(n.timecode)||0,s=n.clip;if(b(t)&&e){let n;if(this.$current.textContent=Rt(+t),this.$bar.setAttribute("aria-label",this._getAriaLabelValue()),s&&Array.isArray(s)){const o=Number(s[0])||0,r=Number(s[1]),a=isNaN(r)?null:r;n=(t-o-i)/((null!==a?a+i:e+o)-o-i)}else n=(t-i)/(e-i);const o=(100*n).toFixed(2)+"%";this.$handle.style.left=this.$playProgress.style.width=o}}onProgress(){this.$duration.textContent=Rt(this._getDuration()),this.$progress.style.width=100*this.player.getBufferedPercent()+"%"}onHandleMouseDown(){this._dragNdropTokens.push(C(document,"mouseup",this.onHandleMouseUp)),this._dragNdropTokens.push(C(document,"mousemove",this.onHandleMouseMove))}onTouchStart(){this._dragNdropTokens.push(C(document,"touchend",this.onTouchEnd)),this._dragNdropTokens.push(C(document,"touchmove",this.onTouchMove))}onHandleMouseUp(t){t.stopPropagation(),t.preventDefault(),c(this._dragNdropTokens,k),this._dragNdropTokens.length=0,this.player.setCurrentTime(this._getTimeByEventPosition(t))}onTouchMove(t){t.stopPropagation(),t.preventDefault();const e=this.$bar.getBoundingClientRect(),n=t.touches[0];let i=Math.max(e.left,n.clientX);i=Math.min(e.right,i),i-=e.left;const s=i/this.$bar.offsetWidth*100+"%";this.$handle.style.left=this.$playProgress.style.width=s;const o=this._getTimeByEventPosition(n);this.player.setCurrentTime(o),this.bus.emit("heartbeatextensions")}onTouchEnd(t){t.stopPropagation(),t.preventDefault(),c(this._dragNdropTokens,k),this._dragNdropTokens.length=0}onHandleMouseMove(t){const e=this.$bar.getBoundingClientRect();let n=Math.max(e.left,t.clientX);n=Math.min(e.right,n),n-=e.left;const i=n/this.$bar.offsetWidth*100+"%";this.$handle.style.left=this.$playProgress.style.width=i}onDurationchange(){const t=this.options;t.isLive||t.isProgressLiveStream||this._updateTimes()}onCanplaythrough(){this._updateTimes()}onLoadedmetadata(){this._updateTimes()}_getAriaLabelValue(){const t=this.$current.textContent||"",e=this.$duration.textContent||"";return`Current: ${this._timeCodeToSentence(t)} Total: ${this._timeCodeToSentence(e)}`}_timeCodeToSentence(t){const e=t.split(":"),n=["minutes","seconds"];return e.length>2&&n.unshift("hours"),e.map((t,e)=>`${"0"===t.charAt(0)?t.charAt(1):t} ${n[e]}`).join(" ")}_getDuration(){const{clip:t,timecode:e}=this.options,n=this.player.getDuration();if(t){let[i,s]=t;return i=i||0,s?s+e:n+i}return n}_getCurrentTime(){const t=this.player.getCurrentTime(),{clip:e,timecode:n}=this.options,[i]=e||[0];return Math.max(t,i+n)}onLeave(){this.$tooltip.classList.remove(Mt)}onHover(t){let e;const{useOriginTimeForPreview:n,timecode:i}=this.options,s=t.target||t.srcElement;if(T(s,Ot)){const t=parseInt(s.getAttribute("data-idx")||"0",10),n=this._chapters[t];e=n.from,this.$thumbnailTime.innerHTML=n.text||n.title}else e=this._getTimeByEventPosition(t),this.$thumbnailTime.textContent=Rt(e);if(v(this.thumbnails))return void this._popoverPosition(t);const o=n?e-i:e,r=M(this.thumbnails,({from:t,to:e})=>m(o,t,e));if(r){const[t,e]=String(r.text).split("#");this.$thumbnail.style.backgroundImage=`url("${t}")`;const n=z(e.split("=")).split(","),i=n.pop().trim(),s=n.pop().trim(),o=n.pop().trim(),a=n.pop().trim();this.$thumbnail.style.width=`${s}px`,this.$thumbnail.style.height=`${i}px`,this.$thumbnail.style.backgroundPosition=`-${a}px -${o}px`,this.$thumbnail.style.marginBottom="7px"}else this.$thumbnail.style.height="",this.$thumbnail.style.width="",this.$thumbnail.style.marginBottom="";this._popoverPosition(t)}_updateTimes(){this.$duration.textContent=Rt(this._getDuration()),this.$current.textContent=Rt(this._getCurrentTime()),this.$bar.setAttribute("aria-label",this._getAriaLabelValue()),this._isLoadedMetadata=!0,this._renderChaptersIfNeeded()}_popoverPosition(t){ft(this.player,this._offsetX(t),this.$tooltip),this.$tooltip.classList.add(Mt)}onStatechanged(t,e){(t.toc.lang!==e.toc.lang||t.toc.timedata!==e.toc.timedata)&&this._refreshTOC()}_refreshTOC(){const t=this.state.getTOCTimeData(),e=this.state.getTOCLang();this._chapters=e?t:[],this._renderChaptersIfNeeded()}_renderChaptersIfNeeded(){if(c(this._bubbles,t=>this.$bar.removeChild(t)),this._bubbles.length=0,v(this._chapters)||!this._isLoadedMetadata)return;const t=this.player.getDuration();c(this._chapters,(e,n)=>{const i=w("span",{class:Ot,"data-idx":String(n)},this.$bar);i.style.left=(100*e.from/t).toFixed(0)+"%",this.addEvent(i,"click",t=>{t.stopPropagation(),this._moveHandle2time(e.from),this.player.setCurrentTime(e.from)}),this._bubbles.push(i)})}_getTimeByEventPosition(t){const e=this.player.getDuration(),{timecode:n,clip:i}=this.options,s=this._getPercentageByPosition(t);if(i){let[t,o]=i;return t=t||0,o=o||e+t-n,parseFloat(((o-t)*s+t+n).toFixed(2))}return parseFloat(((e-n)*s+n).toFixed(2))}_getPercentageByPosition(t){const e=this.$bar.getBoundingClientRect();let n=Math.max(e.left,t.clientX);return n=Math.min(e.right,n),n-=e.left,parseFloat((n/this.$bar.offsetWidth).toFixed(2))}_offsetX(t){if(!this.player.getElement())return 0;const e=this.$bar.getBoundingClientRect(),n=this.player.getElement().parentNode,i=n?n.getBoundingClientRect():e;let s=Math.max(e.left,t.clientX);return s=Math.min(e.right,s),s-=i.left,s}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null,this.$bar=null,this.$handle=null,this.$current=null,this.$duration=null,this.$playProgress=null,this.$progress=null,this.$tooltip=null,this.$thumbnail=null,this.$thumbnailTime=null}}],["showAnnotations",class extends pt{constructor(t,e,n){super(t,e,n,["timeupdate","annotationslang"]),_n(this,"$outer",void 0),_n(this,"$button",void 0),_n(this,"$outerHolder",void 0),_n(this,"annotations",[]),_n(this,"sources",[]),_n(this,"current",null),this.logger.debug("annotations:extension:creating"),this.render(),this.init(),this.logger.debug("annotations:extension:created")}init(){this.addEvent(this.$button,"click",()=>{R(this.annotations,this.current),E(this.$outer,Cn),this.current=null,this.player.focus()});const{annotations:t}=this.options;this.sources=i(t)?t:[t]}onAnnotationslang(t){this.annotations.length=0,this.current=null,this.onTimeupdate();const e=M(this.sources,e=>e.srclang===t);e&&ut({url:e.src,success:t=>{try{this.annotations=A(JSON.parse(t.data),En),this.onTimeupdate()}catch(e){this.logger.error("Error occurred when parsing the response",t.data,e)}}})}render(){this.$outer=w("div",{class:wn}),this.$button=w("button",{type:"button",class:Tn},this.$outer),this.$button.setAttribute("aria-label","Close annotation"),Yt(this.$button,"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",{width:16,height:16}),this.$outerHolder=w("div",{class:kn},this.$outer)}onTimeupdate(){const t=this.player.getCurrentTime();var e,n;b(this.current)&&m(t,this.current.from,this.current.to)||(this.current=M(this.annotations,e=>m(t,e.from,e.to)),b(this.current)?(e=this.$outer,n=this.current,e.style.top=`${n.top}px`,e.style.left=`${n.left}px`,e.style.width=`${n.width}px`,e.style.height=`${n.height}px`,e.style.fontSize=n.fontsize,e.style.color=`#${n.fontcolor}`,e.style.backgroundColor=`#${n.background}`,function(t,e){t.textContent=e;let n=function(t){return t.replace(Sn,'<a href="$1">$1</a>')}(t.innerHTML);n=function(t){return t.replace(/\n/g,"<br />")}(n),t.innerHTML=n}(this.$outerHolder,this.current.text),S(this.$outer,Cn)):E(this.$outer,Cn))}getOuter(){return this.$outer}destroy(){if(super.destroy(),this.$outer){const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}}],["showTheaterMode",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["statechanged"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("theater:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.toggle.bind(this)),P(this.$el,Ii,e.isTheaterMode()),this.logger.debug("theater:extension:created")}render(){this.$el=w("button",{type:"button",class:Bi}),Yt(this.$el,"M19 7H5c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm0 8H5V9h14v6z",{class:`${Bi}__icon`}),Yt(this.$el,"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z",{class:`${Bi}__exit-icon`});const t=()=>this.$t(this.state.isTheaterMode()?"exit-theater":"theater");setTimeout(()=>Xt(this,{$button:this.$el,text:t}))}toggle(){this.bus.emit("theaterchanging")}onStatechanged(t){P(this.$el,Ii,t.isTheaterMode),P(this.$el,Vi,t.isFullScreen)}getElement(){return this.$el}}],["showClosedCaptions",class extends pt{constructor(t,e,n){super(t,e,n,["timeupdate","showpopup","statechanged"]),Le(this,"$el",void 0),Le(this,"$button",void 0),Le(this,"$selector",void 0),Le(this,"$text",void 0),Le(this,"$textHolder",void 0),Le(this,"$mainStep",void 0),Le(this,"$embedCaptions",void 0),Le(this,"$settingsStep",void 0),Le(this,"$settings",void 0),Le(this,"$toMain",void 0),Le(this,"$toSettings",void 0),Le(this,"$fontColorSettings",void 0),Le(this,"$backgroundColorSettings",void 0),Le(this,"$fontSizeSettings",void 0),Le(this,"$fontFamilySettings",void 0),Le(this,"$locationSettings",null),Le(this,"$currentColor",void 0),Le(this,"$currentSize",void 0),Le(this,"$currentBgColor",void 0),Le(this,"$currentLocation",void 0),Le(this,"$currentFamily",void 0),Le(this,"$additionalStep",void 0),Le(this,"$additionalBackText",void 0),Le(this,"$additionalStepWrapper",void 0),Le(this,"$translate",null),Le(this,"$currentCustomTranslate",null),Le(this,"$captions",[]),Le(this,"$translatableCaptions",[]),Le(this,"embedCaptionsAutoShow",!0),this.logger.debug("cc:extension:creating"),this.render(),this.init(),this.logger.debug("cc:extension:created")}init(){ke(this,["_toSettingsPage","_toMainPage","_toColorPage","_toBackgroundColorPage","_toFontFamilyPage","_toSizesPage","_toLocationsPage","_toTranslatePage","_handleEmbedChanged"]),Ce(this,{$button:this.$button,$selector:this.$selector,SELECTOR_OPEN_CN:ze,heightControl:!0,firstFocusItemSelector:`.${Ie}`,toMainFn:this._toMainPage.bind(this)}),Xt(this,{$button:this.$button,text:this.$t("cc")}),this.addEvent(this.$settings,"click",this._toSettingsPage),this.addEvent(this.$toMain,"click",this._toMainPage),this.addEvent(this.$toSettings,"click",this._toSettingsPage),this.addEvent(this.$fontColorSettings,"click",this._toColorPage),this.addEvent(this.$backgroundColorSettings,"click",this._toBackgroundColorPage),this.addEvent(this.$fontFamilySettings,"click",this._toFontFamilyPage),this.addEvent(this.$fontSizeSettings,"click",this._toSizesPage),this.$locationSettings&&this.addEvent(this.$locationSettings,"click",this._toLocationsPage),this.$translate&&this.addEvent(this.$translate,"click",this._toTranslatePage),this.player.$el?.textTracks.addEventListener("addtrack",this._handleEmbedChanged),this.player.$el?.textTracks.addEventListener("change",this._handleEmbedChanged),this._toMainPage(),this._refresh(),this.changeLang(this.state.getCCLang())}render(){this.$el=w("div",{class:Me}),this.$button=w("button",{type:"button",class:Ae},this.$el),this.$selector=w("div",{class:Fe},this.$el),this.$text=w("span",{class:Qe}),this.$textHolder=w("span",{class:Ze},this.$text),this._renderMainPage(),this._renderSettingsPage(),this._renderAdditionalPage()}_handleEmbedChanged(){const t=this.player.getTextTracks(),e=this.state.getCCSources();this.$el.style.display=e.length||t?.length?"block":"none";const n=()=>{const e=w("button",{type:"button",class:Ie},this.$embedCaptions);e.textContent="None",this.addEvent(e,"click",()=>{c(t,t=>{c(this.$captions,t=>E(t,Ve)),t.mode="disabled",S(e,Ve)})}),this.$captions.push(e)};if(e.length)this.$settings.style.display="block";else{this.$settings.style.display="none";const t=this.$embedCaptions.childNodes[0];t&&"None"===t?.textContent||n()}t?.length&&c(t,e=>{if(M(this.$captions,t=>t.textContent===e.label))return;const n=w("button",{type:"button",class:Ie},this.$embedCaptions);n.textContent=e.label,this.addEvent(n,"click",()=>{c(this.$captions,t=>E(t,Ve)),c(this.$translatableCaptions,t=>E(t,Ve));const i=this.$captions.findIndex(t=>t===n);S(this.$captions[i],Ve),c(t,(e,n)=>{t[n].mode="disabled"}),e.mode="showing"}),this.$captions.push(n),this.embedCaptionsAutoShow&&(n.click(),this.embedCaptionsAutoShow=!1)})}_renderMainPage(){this.$mainStep=w("div",{class:He,tabindex:"-1"},this.$selector),Yt(this.$button,"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z");const t=this.state.getCCSources();this.$el.style.display=t.length?"block":"none";const e=L(t,t=>3!==t.state&&0!==t.state);c(e,t=>{const e=w("button",{type:"button",class:Ie},this.$mainStep);e.textContent=1===t.state?`${t.label} ${this.$t("unapproved-source")}`:t.label,this.addEvent(e,"click",()=>this.bus.emit("cclang",t.srclang)),this.$captions.push(e)}),this.$embedCaptions=w("div",{},this.$mainStep);const n=w("button",{type:"button",class:Ue},this.$mainStep);this.$translate=n;let i=w("span",{},n);i.textContent=this.$t("translate"),tn(n),this.$currentCustomTranslate=w("span",{class:Ge},this.$translate);const s=e.length!==t.length;n.style.display=s?"block":"none",this.$settings=w("button",{type:"button",class:Ue},this.$mainStep),i=w("span",{},this.$settings),i.textContent=this.$t("settings"),tn(this.$settings)}_rerenderLanguages(t){const{$mainStep:e,$translate:n,$settings:i}=this;if(this.$el.style.display=t.length?"block":"none",!e)return;c(this.$captions,t=>{e.removeChild(t)}),this.$captions.length=0;const s=L(t,t=>3!==t.state&&0!==t.state);if(c(s,t=>{const e=w("button",{type:"button",class:Ie},this.$mainStep);e.textContent=1===t.state?`${t.label} ${this.$t("unapproved-source")}`:t.label,this.addEvent(e,"click",()=>this.bus.emit("cclang",t.srclang)),this.$captions.push(e)}),n){e.removeChild(n);const i=s.length!==t.length;n.style.display=i?"block":"none",_(e,n)}i&&(e.removeChild(i),_(e,i))}_renderSettingsPage(){this.$settingsStep=w("div",{class:De},this.$selector),this.$toMain=w("button",{type:"button",class:Ke},this.$settingsStep),Yt(w("span",{class:"arrow"},this.$toMain),Wt,{class:"arrow"}),w("span",{},this.$toMain).textContent=this.$t("cc");const t=w("div",{class:`${Xe} tab-content`},this.$settingsStep);this.$fontColorSettings=w("button",{type:"button"},t);let e=w("span",{},this.$fontColorSettings);e.textContent=this.$t("settings-fontcolor"),tn(this.$fontColorSettings),this.$currentColor=w("span",{class:Ge},this.$fontColorSettings);let n=M(Te,t=>t.value===this.state.getCCTextColor());this.$currentColor.textContent=n&&n.key?this.$t(n.key):"",this.$fontSizeSettings=w("button",{type:"button"},t),e=w("span",{},this.$fontSizeSettings),e.textContent=this.$t("settings-fontsize"),tn(this.$fontSizeSettings),this.$currentSize=w("span",{class:Ge},this.$fontSizeSettings),this.$currentSize.textContent=this.state.getCCFontSize(),this.$fontFamilySettings=w("button",{type:"button"},t),e=w("span",{},this.$fontFamilySettings),e.textContent=this.$t("settings-fontfamily"),tn(this.$fontFamilySettings),this.$currentFamily=w("span",{class:Ge},this.$fontFamilySettings);const i=M(Ee,t=>t.value===this.state.getCCFontFamily());if(this.$currentFamily.textContent=i&&i.key?this.$t(i.key):"",this.$backgroundColorSettings=w("button",{type:"button"},t),e=w("span",{},this.$backgroundColorSettings),e.textContent=this.$t("settings-background"),tn(this.$backgroundColorSettings),this.$currentBgColor=w("span",{class:Ge},this.$backgroundColorSettings),n=M(Te,t=>t.value===this.state.getCCBgColor()),this.$currentBgColor.textContent=n&&n.key?this.$t(n.key):"",this.options.showCCLayout){const n=w("button",{type:"button"},t);this.$locationSettings=n,e=w("span",{},n),e.textContent=this.$t("settings-captionlocations"),tn(n),this.$currentLocation=w("span",{class:Ge},this.$locationSettings);const i=M(Pe,t=>t.value===this.state.getCCLocation());this.$currentLocation.textContent=i&&i.key?this.$t(i.key):""}const s=w("div",{class:`${Je} tab-content`},this.$settingsStep);c(L(this.state.getCCSources(),t=>3===t.state||0===t.state),t=>{const e=w("button",{type:"button",class:Ie},s);e.textContent=t.label,this.addEvent(e,"click",()=>{this.bus.emit("cclang",t.srclang),this._toMainPage()}),this.$translatableCaptions.push(e)})}_renderAdditionalPage(){this.$additionalStep=w("div",{class:Be},this.$selector),this.$toSettings=w("button",{type:"button",class:Ke},this.$additionalStep),Yt(w("span",{class:"arrow"},this.$toSettings),Wt,{class:"arrow"}),this.$additionalBackText=w("span",{},this.$toSettings),this.$additionalStepWrapper=w("div",{class:"tab-content"},this.$additionalStep)}onStatechanged(t,e){t.cc.sources!==e.cc.sources?(this._rerenderLanguages(t.cc.sources),this.changeLang(t.cc.lang)):t.cc.lang!==e.cc.lang?this.changeLang(t.cc.lang):t.cc.timedata!==e.cc.timedata?this.onLoadingTimedata():t.cc.location===e.cc.location&&t.cc.fontFamily===e.cc.fontFamily&&t.cc.fontSize===e.cc.fontSize&&t.cc.bgcolor===e.cc.bgcolor&&t.cc.color===e.cc.color||this._refresh()}onLoadingTimedata(){const t=this.state.getSelectedCC(),{$currentCustomTranslate:e,$translate:n}=this;e&&n&&(E(n,We),e.textContent="",t&&!t.state&&(e.textContent=t.label)),this.onTimeupdate()}changeLang(t){c(this.$captions,t=>E(t,Ve)),c(this.$translatableCaptions,t=>E(t,Ve));const e=this.player.getTextTracks();e?.length&&c(e,t=>{t.mode="disabled"});const n=this.state.getCCSources(),i=L(n,t=>3!==t.state&&0!==t.state),{$currentCustomTranslate:s,$translate:o}=this;s&&(s.textContent="");let r=O(i,e=>e.srclang===t);if(-1===r){const e=L(n,t=>!t.state);r=O(e,e=>e.srclang===t),this.$translatableCaptions[r]&&S(this.$translatableCaptions[r],Ve),s&&e[r]&&(s.textContent=this.$t("translating")),o&&S(o,We)}else this.$captions[r]&&S(this.$captions[r],Ve),t||E(this.$text,Ye)}onTimeupdate(){const t=this.state.getCCLang(),e=this.state.getCCTimeData();if(!t)return;if(v(e))return void E(this.$text,Ye);const n=this.player.getCurrentTime(),i=M(e,({from:t,to:e})=>m(n,t,e));i?(this.$textHolder.innerHTML=i.text.split("\n").join("<br>"),S(this.$text,Ye)):E(this.$text,Ye)}onShowpopup(t){t===this.$selector&&(T(this.$selector,Ne)?we(this.player,this.$mainStep):T(this.$selector,Oe)?we(this.player,this.$settingsStep):T(this.$selector,Re)&&we(this.player,this.$additionalStep))}_toMainPage(){S(this.$selector,Ne),E(this.$selector,Oe),E(this.$selector,Re),E(this.$selector,je),we(this.player,this.$mainStep);const t=document.querySelectorAll(`.${He} > .${Ie}`);t[0]&&t[0].focus()}_toSettingsPage(){S(this.$selector,Oe),E(this.$selector,Ne),E(this.$selector,Re),E(this.$selector,je),we(this.player,this.$settingsStep),document.querySelector(`.${Ke}`).focus()}_toAdditionalPage(){S(this.$selector,Re),E(this.$selector,Oe),E(this.$selector,Ne),E(this.$selector,je),c(j(this.$additionalStepWrapper.childNodes),t=>this.$additionalStepWrapper.removeChild(t)),we(this.player,this.$additionalStep)}_toTranslatePage(){this.state.isTranslatingCC()||(S(this.$selector,je),E(this.$selector,Oe),E(this.$selector,Ne),E(this.$selector,Re),we(this.player,this.$settingsStep),document.querySelector(`.${Ke}`).focus())}_prepareAdditionalPage(t,e,n,i){this._toAdditionalPage(),this.$additionalBackText.textContent=this.$t(t),this.$toSettings.focus();const s=[],o=this.state[e]();c(i,t=>{const e=w("button",{type:"button",class:Ie},this.$additionalStepWrapper),i=t.key;e.textContent=i?this.$t(i):t.label||"",o===t.value&&S(e,Ve),this.addEvent(e,"click",()=>{c(s,t=>E(t,Ve)),S(e,Ve),this.bus.emit(n,t.value),this._toSettingsPage()}),s.push(e)})}_toColorPage(){this._prepareAdditionalPage("settings-fontcolor","getCCTextColor","cccolor",Te)}_toBackgroundColorPage(){this._prepareAdditionalPage("settings-background","getCCBgColor","ccbgcolor",Te)}_toSizesPage(){this._prepareAdditionalPage("settings-fontsize","getCCFontSize","ccfontsize",Se)}_toFontFamilyPage(){this._prepareAdditionalPage("settings-fontfamily","getCCFontFamily","ccfontfamily",Ee)}_toLocationsPage(){this._prepareAdditionalPage("settings-captionlocations","getCCLocation","cclocation",Pe)}_detectLabel(t,e){const n=M(t,t=>t.value===e);if(!n)return"";const i=n.key;return i?this.$t(i):n.label||""}_refresh(){const t=this.state.getCCTextColor(),e=this.state.getCCBgColor(),n=this.state.getCCFontSize(),i=this.state.getCCFontFamily();this.$textHolder.style.color=t,this.$textHolder.style.backgroundColor=e,this.$textHolder.style.fontSize=n,this.$textHolder.style.fontFamily=i,this.$currentColor.textContent=this._detectLabel(Te,t),this.$currentBgColor.textContent=this._detectLabel(Te,e),this.$currentSize.textContent=this._detectLabel(Se,n),this.$currentFamily.textContent=this._detectLabel(Ee,i),this.$currentLocation&&(this.$currentLocation.textContent=this._detectLabel(Pe,this.state.getCCLocation()))}getElement(){return this.$el}getOuter(){return this.$text}destroy(){super.destroy(),this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el),this.$text.parentNode&&this.$text.parentNode.removeChild(this.$text)}}],["showTOC",class extends pt{constructor(t,e,n){super(t,e,n,["statechanged"]),en(this,"$el",void 0),en(this,"$button",void 0),en(this,"$selector",void 0),en(this,"$mainStep",void 0),en(this,"$languagesStep",void 0),en(this,"$chaptersWrapper",void 0),en(this,"$moreLanguages",void 0),en(this,"$currentLanguage",void 0),en(this,"$toMain",void 0),en(this,"$translateStep",void 0),en(this,"$toLanguages",void 0),en(this,"$translate",null),en(this,"$currentCustomTranslate",null),en(this,"$languages",[]),en(this,"$translatableLanguages",[]),en(this,"$items",[]),this.logger.debug("toc:extension:creating"),ke(this,["_toMainPage","_toLanguagesPage","_toTranslatePage"]),this.render(),this.init(),this.changeLang(this.state.getTOCLang()),this.logger.debug("toc:extension:created")}init(){const{$button:t,$selector:e}=this;Ce(this,{$button:t,$selector:e,SELECTOR_OPEN_CN:hn,heightControl:!0,firstFocusItemSelector:"button",toMainFn:this._toMainPage.bind(this)}),Xt(this,{$button:t,text:this.$t("chapters")}),this.addEvent(this.$moreLanguages,"click",this._toLanguagesPage),this.addEvent(this.$toMain,"click",this._toMainPage),this.addEvent(this.$toLanguages,"click",this._toLanguagesPage),this._toMainPage()}render(){this.$el=w("div",{class:nn}),this.$button=w("button",{type:"button",class:sn},this.$el),this.$selector=w("div",{class:on},this.$el),Yt(this.$button,"M3 9h14V7H3v2zm0 4h14v-2H3v2zm0 4h14v-2H3v2zm16 0h2v-2h-2v2zm0-10v2h2V7h-2zm0 6h2v-2h-2v2z"),this.$mainStep=w("div",{class:dn,tabindex:-1},this.$selector),this.$languagesStep=w("div",{class:cn},this.$selector),this.$chaptersWrapper=w("div",{class:`${mn} tab-content`},this.$mainStep),this.$moreLanguages=w("button",{type:"button",class:gn},this.$mainStep),w("span",{},this.$moreLanguages).textContent=this.$t("language"),xn(this.$moreLanguages),this.$currentLanguage=w("span",{class:$n},this.$moreLanguages),this.$toMain=w("button",{type:"button",class:un},this.$languagesStep);let t=w("span",{class:"arrow"},this.$toMain);Yt(t,Wt,{class:"arrow"});let e=w("span",{},this.$toMain);e.textContent=this.$t("chapters"),this.$translateStep=w("div",{class:vn},this.$selector),this.$toLanguages=w("button",{type:"button",class:un},this.$translateStep),t=w("span",{class:"arrow"},this.$toLanguages),Yt(t,Wt,{class:"arrow"}),e=w("span",{},this.$toLanguages),e.textContent=this.$t("language"),this.fillLanguages()}fillLanguages(){c(this.$languages,t=>{this.$languagesStep&&this.$languagesStep.removeChild(t)}),c(this.$translatableLanguages,t=>{this.$languagesStep&&this.$languagesStep.removeChild(t)}),this.$translate&&this.$languagesStep.removeChild(this.$translate),this.$languages=[],this.$translatableLanguages=[];const t=this.state.getTOCSources(),e=L(t,t=>!!t.state);if(this.$el.style.display=t.length?"block":"none",c(e,t=>{const e=w("button",{type:"button",class:yn},this.$languagesStep);e.textContent=1===t.state?`${t.label} ${this.$t("unapproved-source")}`:t.label,this.addEvent(e,"click",()=>{this._toMainPage(),this.bus.emit("toclang",t.srclang)}),this.$languages.push(e)}),e.length!==t.length){const t=w("button",{type:"button",class:mn},this.$languagesStep);this.$translate=t,w("span",{},t).textContent=this.$t("translate"),xn(t),this.$currentCustomTranslate=w("span",{class:$n},this.$translate),this.addEvent(t,"click",this._toTranslatePage)}c(L(t,t=>!t.state),t=>{const e=w("button",{type:"button",class:yn},this.$translateStep);e.textContent=t.label,this.addEvent(e,"click",()=>{this._toMainPage(),this.bus.emit("toclang",t.srclang)}),this.$translatableLanguages.push(e)})}onStatechanged(t,e){t.toc.sources!==e.toc.sources&&this.fillLanguages(),t.toc.lang!==e.toc.lang&&this.changeLang(t.toc.lang),t.toc.timedata!==e.toc.timedata&&this.renderTimeData()}changeLang(t){c(this.$languages,t=>E(t,fn)),c(this.$translatableLanguages,t=>E(t,fn));const e=this.state.getTOCSources(),n=L(e,t=>!!t.state);this.$currentCustomTranslate&&(this.$currentCustomTranslate.textContent="");let i=O(n,e=>e.srclang===t);if(-1===i){const n=L(e,t=>!t.state);if(i=O(n,e=>e.srclang===t),-1===i)return;S(this.$translatableLanguages[i],fn),this.$currentCustomTranslate&&(this.$currentCustomTranslate.textContent=n[i].label),this.$currentLanguage.textContent=n[i].label}else S(this.$languages[i],fn),this.$currentLanguage.textContent=n[i].label;this.renderTimeData()}renderTimeData(){const t=this.state.getTOCLang()?this.state.getTOCTimeData():[];c(this.$items,t=>{this.$chaptersWrapper.removeChild(t)}),this._toMainPage(),this.$items.length=0,c(t,t=>{const e=w("button",{href:"#",class:bn},this.$chaptersWrapper);e.innerHTML=t.text||t.title,this.addEvent(e,"click",e=>{e.preventDefault(),e.stopPropagation();const n=this.player.isPaused();this.player.setCurrentTime(t.from),n&&this.player.play()}),this.$items.push(e)})}_toMainPage(){S(this.$selector,rn),E(this.$selector,an),E(this.$selector,ln),we(this.player,this.$mainStep),setTimeout(()=>{const t=document.querySelectorAll(`.${mn} > .${bn}`);if(t[0])t[0].focus();else{const t=document.querySelector(`.${gn}`);t&&t.focus()}})}_toLanguagesPage(){S(this.$selector,an),E(this.$selector,rn),E(this.$selector,ln),we(this.player,this.$languagesStep);const t=document.querySelector(`.${cn} > .${un}`);t&&t.focus()}_toTranslatePage(){S(this.$selector,ln),E(this.$selector,rn),E(this.$selector,an),this.$translateStep&&we(this.player,this.$translateStep);const t=document.querySelector(`.${vn} > .${un}`);t&&t.focus()}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$items.length=0,this.$languages.length=0,this.$translatableLanguages.length=0}}],["showAudioTracks",class extends pt{constructor(t,e,n){super(t,e,n,["loadeddata","audiotrackswitched"]),Ui(this,"$el",void 0),Ui(this,"$button",void 0),Ui(this,"$selector",void 0),this.logger.debug("audio-tracks:extension:creating"),this.render(),this.init(),this.logger.debug("audio-tracks:extension:created")}render(){this.$el=w("div",{class:Wi}),this.$button=w("button",{type:"button",class:qi},this.$el),this.$selector=w("div",{class:Gi,tabindex:"-1"},this.$el),Yt(this.$button,"M12 1c-4.97 0-9 4.03-9 9v7c0 1.66 1.34 3 3 3h3v-8H5v-2c0-3.87 3.13-7 7-7s7 3.13 7 7v2h-4v8h3c1.66 0 3-1.34 3-3v-7c0-4.97-4.03-9-9-9z")}init(){const t=this.$button,e=this.$selector;Xt(this,{$button:t,text:this.$t("audio-tracks")}),Ce(this,{$button:t,$selector:e,SELECTOR_OPEN_CN:Qi,reposition:!1,closeOnClick:!0,heightControl:!0,firstFocusItemSelector:`.${Yi}`})}_renderAudioTracks(){c(j(this.$selector.childNodes),t=>this.$selector.removeChild(t));const t=this.player.getAudioTrack(),e=[];c(this.player.getAudioTracks(),(n,i)=>{if(!n||"object"!=typeof n)return;const s=w("button",{type:"button",class:Yi},this.$selector);s.textContent=n.name||n.label,+i===t&&S(s,Zi),this.addEvent(s,"click",()=>{c(e,t=>E(t,Zi)),S(s,Zi),this.player.setAudioTrack(n.id)}),e.push(s)})}onAudiotrackswitched(){this._renderAudioTracks()}onLoadeddata(){this.player.isMultiAudioTracks()?this._renderAudioTracks():this.$el.style.display="none"}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showPlaceholder",class extends pt{constructor(t,e,n){super(t,e,n),An(this,"$outer",void 0),An(this,"$placeholderIcon",void 0),An(this,"$playButton",void 0),this.logger.debug("placeholder:extension:creating"),Dn=this.options.accessibility,this.render(),n.isHandlingKeyboardEvents&&this.addEvent(document,"keydown",this.onKeyDown.bind(this),n.globalKeyboardListeners),this.addEvent(this.$outer,"click",this.onPlaceholderClick.bind(this)),this.addEvent(this.$playButton,"click",this.onPlaceholderClick.bind(this)),setTimeout(()=>{const t=this.$outer.parentNode?.querySelector(".rmp-ext-title");t&&this.addEvent(t,"click",this.onPlaceholderClick.bind(this)),this.$outer.parentNode&&this.addEvent(this.$outer.parentNode,"dblclick",this.toggleFullScreen.bind(this))}),this.logger.debug("placeholder:extension:created")}render(){this.$outer=w("div",{class:Fn,tabindex:-1}),this.$placeholderIcon=w("div",{class:Nn,tabindex:-1},this.$outer),this.$playButton=w("button",{type:"button",class:On,tabindex:-1},this.$outer),Yt(this.$playButton,Dt),this.$playButton.setAttribute("aria-label","Play")}onPlaceholderClick(){this.logger.debug("placeholder:click"),clearTimeout(jn),jn=setTimeout(()=>this._togglePlay(),350)}onKeyDown(t){if(!this.player.getElement())return;this.logger.debug("placeholder:keydown");const e=t.target||t.srcElement;let n=e===this.player.getElement();n=n||T(e,"rplayer"),n=n||this.player.getElement().parentNode?.contains(e)||!1,(n||this.options.globalKeyboardListeners&&!function(t){let e=!1;return e=e||t instanceof HTMLTextAreaElement,e=e||t instanceof HTMLInputElement&&"text"===t.type,e}(t.target))&&this._processKeyDown(t)}_processKeyDown(t){if(t.target instanceof HTMLInputElement)return;const e=t.keyCode;if(32===e&&Dn&&"BUTTON"===t.target.tagName)return;let n=Rn[e];b(n)&&o(this[n])&&(this[n](this.player),t.preventDefault(),t.stopPropagation());const i=this.options.keyboardListeners?this.options.keyboardListeners[e]:null;b(i)&&o(i)&&(i(this.player),t.preventDefault(),t.stopPropagation())}toggleFullScreen(){this.logger.debug("placeholder:toggleFullScreen"),clearTimeout(jn),this.options.showFullScreen&&this.bus.emit("fullscreenchanging")}_togglePlay(){this.logger.debug("placeholder:togglePlay"),this.options.isMobile?this.bus.emit("mobiletouch"):this.player.isPaused()?(this.player.play(),this._showAction("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z")):(this.player.pause(),this._showAction("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"))}_skeepLeft(){this.logger.debug("placeholder:skeepLeft"),this.player.setCurrentTime(this.player.getCurrentTime()-(this.options.skipDelta||0)),this._showAction(Bt)}_skeepRight(){this.logger.debug("placeholder:skeepRight"),this.player.setCurrentTime(this.player.getCurrentTime()+(this.options.skipDelta||0)),this._showAction(It)}_upVolume(){this.logger.debug("placeholder:volumeup");const t=Math.min(1,.1+this.player.getVolume());this.player.setMuted(!1),this.player.setVolume(t),this._showAction(Qt)}_downVolume(){this.logger.debug("placeholder:volumedown");const t=Math.max(0,this.player.getVolume()-.1).toFixed(2);t==(0).toString()?(this.player.setVolume(0),this.player.setMuted(!0),this._showAction(Gt)):(this.player.setVolume(parseFloat(t)),this._showAction("M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z"))}_showAction(t){this.logger.debug("placeholder:showaction"),E(this.$outer,zn),clearTimeout(Hn),Hn=setTimeout(()=>{this.logger.debug("placeholder:showaction:clear"),this._clearPlaceholderIcon(),Yt(this.$placeholderIcon,t),S(this.$outer,zn),Hn=setTimeout(()=>{this.logger.debug("placeholder:showaction:remove"),this._clearPlaceholderIcon(),E(this.$outer,zn)},500)},350)}_clearPlaceholderIcon(){this.$placeholderIcon.childNodes.length&&c(j(this.$placeholderIcon.childNodes),t=>{this.$placeholderIcon.removeChild(t)})}_prevFrame(){this.player.prevFrame()}_nextFrame(){this.player.nextFrame()}getOuter(){return this.$outer}destroy(){super.destroy(),this.$outer.removeChild(this.$placeholderIcon),this.$outer.parentNode&&this.$outer.parentNode.removeChild(this.$outer),this.$outer=null,this.$placeholderIcon=null}}],["showCaptionSearch",class extends pt{constructor(t,e,n){super(t,e,n,["statechanged","timeupdate","showpopup","loadedmetadata","canplaythrough"]),Ji(this,"$el",void 0),Ji(this,"$button",void 0),Ji(this,"$selector",void 0),Ji(this,"$captions",void 0),Ji(this,"$input",void 0),Ji(this,"$clearBtn",void 0),Ji(this,"filter",""),this.logger.debug("search:extension:creating"),this.render(),this.init(),ke(this,["onTimeupdate"]),this.logger.debug("search:extension:created")}render(){this.$el=w("div",{class:Xi}),this.$button=w("button",{type:"button",class:es},this.$el),this.$selector=w("div",{class:ns},this.$el),this.$captions=w("div",{class:ss},this.$selector),this.$input=w("input",{class:os,placeholder:this.$t("caption-search")},this.$selector),this.$clearBtn=w("button",{class:`${cs} ${ts}`},this.$selector),Yt(this.$clearBtn,"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"),Yt(this.$button,"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z")}init(){const t=this.$button,e=this.$selector;Xt(this,{$button:t,text:this.$t("caption-search")}),Ce(this,{$button:t,$selector:e,SELECTOR_OPEN_CN:is,reposition:!1,closeOnClick:!1,heightControl:!1}),this.addEvent(this.$input,"input",()=>{this.filter=this.$input.value,this.renderCaptions(),this.$input.value?this.$clearBtn.classList.remove(ts):this.$clearBtn.classList.add(ts)}),this.$clearBtn.addEventListener("click",()=>{this.$input.value="",this.filter="",this.renderCaptions()})}onStatechanged(t,e){t.cc.lang!==e.cc.lang?this.handleCaptionLanguageChanged(t.cc.lang):t.cc.timedata!==e.cc.timedata&&this.handleTimeDataChanged()}onCanplaythrough(){this.handleTimeDataChanged()}onLoadedmetadata(){this.handleTimeDataChanged()}handleCaptionLanguageChanged(t){P(this.$el,ts,!t)}handleTimeDataChanged(){const t=this.state.getCCLang();this.handleCaptionLanguageChanged(t),this.renderCaptions()}filteredCaptions(){const t=new RegExp(this.filter.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"ig");return L(this.state.getCCTimeData(),e=>(t.lastIndex=0,t.test(e.text)))}renderCaptions(){const t=this.player.getDuration();if(!t)return;const e=t>3600;c(j(this.$captions.childNodes),t=>this.$captions.removeChild(t)),c(this.filteredCaptions(),t=>{const n=w("button",{type:"button",class:rs,id:ps(t.id)},this.$captions);w("span",{class:ls},n).textContent=gt(t.from,e);const i=(s=t.text,Ki.innerHTML=s,Ki.textContent);var s;w("span",{class:hs,title:i},n).textContent=i,this.addEvent(n,"click",e=>{e.preventDefault(),e.stopPropagation();const n=this.player.isPaused();this.player.setCurrentTime(t.from),n&&this.player.play()})})}onShowpopup(){this.onTimeupdate(),this.scrollToCurrentCaption()}scrollToCurrentCaption(){const t=this.filteredCaptions(),e=this.player.getCurrentTime(),n=O(t,({from:t,to:n})=>m(e,t,n));if(n>-1){const t=j(this.$captions.childNodes)[Math.max(0,n-2)];t&&function(t,e){const{top:n}=t.getBoundingClientRect(),i=e.getBoundingClientRect(),s=e.scrollTop,o=Math.floor(n-i.top);e.scrollTop=s+o}(t,this.$captions)}}onTimeupdate(){const t=this.filteredCaptions();if(v(t))return;const e=this.player.getCurrentTime(),n=O(t,({from:t,to:n})=>m(e,t,n));if(n>-1){const e=t[n],i=document.getElementById(ps(e.id));if(!i)return void c(j(this.$captions.childNodes),t=>E(t,as));if(T(i,as))return;c(j(this.$captions.childNodes),t=>E(t,as)),S(i,as)}else c(j(this.$captions.childNodes),t=>E(t,as))}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t instanceof HTMLElement&&t.removeChild(this.$el),this.$el=null}}],["showDownload",class extends pt{constructor(t,e,n){super(t,e,n),Gn(this,"$el",void 0),Gn(this,"$button",void 0),Gn(this,"$selector",void 0),Gn(this,"$link",void 0),Gn(this,"$mainStep",void 0),Gn(this,"$video",void 0),Gn(this,"$cc",void 0),Gn(this,"$transcript",void 0),Gn(this,"$mp4",void 0),Gn(this,"$svg",void 0),Gn(this,"$spinner",void 0),Gn(this,"$additionalStep",void 0),Gn(this,"$back",void 0),Gn(this,"$backText",void 0),Gn(this,"$additional",void 0),this.logger.debug("download:extension:creating"),this.render(),this.init(),this.logger.debug("download:extension:created")}render(){this.$el=w("span",{class:Qn,"data-testid":"download"}),this.$button=w("button",{type:"button",class:Yn},this.$el),this.$selector=w("div",{class:Zn},this.$el),this.$link=w("a",{style:"display: none;"},this.$selector),this.$mainStep=w("div",{class:ti},this.$selector),this.options.showDownloadVideo&&(this.$video=w("button",{type:"button",class:ii},this.$mainStep),w("span",{},this.$video).textContent=this.$t("video-drm"),S(this.$video,Xn),si(this.$video)),this.options.showDownloadCC&&(this.$cc=w("button",{type:"button",class:ii},this.$mainStep),w("span",{},this.$cc).textContent=this.$t("cc"),S(this.$cc,Xn),si(this.$cc),this.$transcript=w("button",{type:"button",class:ii},this.$mainStep),w("span",{},this.$transcript).textContent=this.$t("transcript"),S(this.$transcript,Xn),si(this.$transcript)),this.options.downloadVideoURL&&(this.$mp4=w("button",{type:"button",class:ii},this.$mainStep),w("span",{},this.$mp4).textContent=this.$t("video-drm")),this.$svg=Yt(this.$button,"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"),this.$spinner=w("img",{src:"/images/Spinner-small.gif",height:"26",width:"26"}),this.$additionalStep=w("div",{class:ei},this.$selector),this.$back=w("button",{type:"button",class:ni},this.$additionalStep),Yt(w("span",{class:"arrow"},this.$back),Wt),this.$backText=w("span",{},this.$back),this.$additional=w("div",{class:"tab-content"},this.$additionalStep)}init(){const t=this.$button,e=this.$selector,n=this.options;Ce(this,{$button:t,$selector:e,SELECTOR_OPEN_CN:Kn,reposition:!1,closeOnClick:!1,firstFocusItemSelector:`.${ii}`,toMainFn:this._toMain.bind(this)}),Xt(this,{$button:t,text:this.$t("download")}),!v(n.downloadCCLanguages)||n.showDownloadCC||n.downloadVideoURL?(n.downloadVideoURL&&this.addEvent(this.$mp4,"click",this.performClick.bind(this,n.downloadVideoURL)),this.addEvent(this.$back,"click",()=>this._toMain()),n.showDownloadVideo&&this.addEvent(this.$video,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("video-drm")),this._renderVideos()}),n.showDownloadCC&&(this.addEvent(this.$transcript,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("transcript")),this._renderTranscripts()}),this.addEvent(this.$cc,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("cc")),this._renderClosedCaptions()}))):this.addEvent(this.$el,"click",this.downloadDRMVideo.bind(this,null))}downloadDRMVideo(t){let e=this.options.downloadURL;null!==t&&(e+="?ccLang="+t),this.bus.emit("downloadRequested",e,this.performClick.bind(this)),this.$button.removeChild(this.$svg),this.$button.appendChild(this.$spinner)}downloadTranscript(t){const e=`transcript__${t.srclang}.txt`;"json"===t.type?ut({url:t.src,success:t=>this.prepareTranscriptForDownload(JSON.parse(t.data),e)}):yt(t.src,t=>this.prepareTranscriptForDownload(t,e),()=>{})}prepareTranscriptForDownload(t,e){const{text:n}=t.reduce(({prevSegmentTime:t,text:e},n)=>(t>0&&n.from>=t+.1&&(e+="\r\n"),e=e+n.text.replace(/(\r?\n|\r)$/,"").replace(/<br\s*\/?>/gm,"\r\n")+"\r\n",{prevSegmentTime:n.to,text:e}),{text:"",prevSegmentTime:0});var i=new Blob([n],{type:"text/plain;charset=utf-8"});qn(i,e)}downloadCC(t){const e=`captions__${t.srclang}.vtt`;"json"===t.type?ut({url:t.src,success:t=>this.prepareCCForDownload(JSON.parse(t.data),e)}):ut({url:t.src,success:t=>{var n=new Blob([t.data],{type:"text/plain;charset=utf-8"});qn(n,e)}})}prepareCCForDownload(t,e){const n=t.reduce((t,e)=>(t||(t+="WEBVTT\r\n"),t+="\r\n",t+=gt(e.from,!1,!0)+" --\x3e "+gt(e.to,!1,!0),t+="\r\n",(t+=e.text)+"\r\n"),"");var i=new Blob([n],{type:"text/plain;charset=utf-8"});qn(i,e)}getElement(){return this.$el}destroy(){super.destroy(),this.$el.parentNode.removeChild(this.$el),this.$el=null}performClick(t){var e=document.createElement("a");e.href=t,e.target="_blank",e.className="rmp-ext-download-hidden",e.download=z(t.split("/"))||"video.mp4",document.body.appendChild(e),e.click();try{this.$button.removeChild(this.$spinner),this.$button.appendChild(this.$svg)}catch(t){}}_toMain(){E(this.$selector,Jn),we(this.player,this.$mainStep);const t=document.querySelectorAll(`.${ti} > .${ii}`);t[0]&&t[0].focus()}_toAdditional(t){c(j(this.$additional.childNodes),t=>this.$additional.removeChild(t)),S(this.$selector,Jn),this.$backText.textContent=t,we(this.player,this.$additionalStep),this.$back.focus()}_renderVideos(){const t=w("button",{type:"button",class:ii},this.$additional);this.addEvent(t,"click",()=>this.downloadDRMVideo(null)),w("span",{},t).textContent=this.$t("video-only"),c(this.options.downloadCCLanguages,t=>{const e=w("button",{type:"button",class:ii},this.$additional);this.addEvent(e,"click",()=>this.downloadDRMVideo(t.code)),w("span",{},e).textContent=`${this.$t("video-and")} ${t.label} CC`})}_renderTranscripts(){c(this.options.cc.filter(oi),t=>{const e=w("button",{type:"button",class:ii},this.$additional);this.addEvent(e,"click",()=>this.downloadTranscript(t)),w("span",{},e).textContent=t.label})}_renderClosedCaptions(){c(this.options.cc.filter(oi),t=>{const e=w("button",{type:"button",class:ii},this.$additional);this.addEvent(e,"click",()=>this.downloadCC(t)),w("span",{},e).textContent=t.label})}}],["showPrev",class extends pt{constructor(t,e,n){super(t,e,n),Pi(this,"$outer",void 0),Pi(this,"$button",void 0),this.logger.debug("prev:extension:creating"),this.render();const i=this.options.bus;this.addEvent(this.$outer,"click",()=>i.emit("prevtrack")),this.logger.debug("prev:extension:created")}render(){const t=this.options.prevTrackTitle;this.$outer=w("div",{class:Li,title:t}),this.$button=w("button",{type:"button",class:Mi},this.$outer),Yt(this.$button,Ut),this.$button.setAttribute("aria-label","Go to previous track"),w("img",{src:this.options.prevTrackThumbnails,class:Ai},this.$outer)}getOuter(){return this.$outer}destroy(){if(super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["showNext",class extends pt{constructor(t,e,n){super(t,e,n),Fi(this,"$outer",void 0),Fi(this,"$button",void 0),this.logger.debug("next:extension:creating"),this.render();const i=this.options.bus;this.addEvent(this.$outer,"click",()=>i.emit("nexttrack")),this.logger.debug("next:extension:created")}render(){const t=this.options.nextTrackTitle;this.$outer=w("div",{class:zi,title:t}),this.$button=w("button",{type:"button",class:Ni},this.$outer),Yt(this.$button,Vt),this.$button.setAttribute("aria-label","Go to next track"),w("img",{src:this.options.nextTrackThumbnails,class:Oi},this.$outer)}getOuter(){return this.$outer}destroy(){if(super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["useMux",class extends pt{constructor(t,e,n){super(t,e,n),this.logger.debug("mux:extension:creating"),this.init(),this.logger.debug("mux:extension:created")}init(){b(window.mux)?this.monitor():this.loadLibraryAndStartMonitor()}loadLibraryAndStartMonitor(){const t=w("script",{src:this.options.muxURL}),e=N(j(document.getElementsByTagName("script")));t.onload=t.onload=()=>this.monitor(),e.parentNode&&e.parentNode.insertBefore(t,e)}monitor(){const t=this.player.getElement(),e=H({},Di,this.options.mux);window.mux.monitor(`#${t.id}`,{debug:!1,data:e})}destroy(){const t=this.player.getElement();t&&"mux"in t&&t.mux.destroy(),super.destroy()}}],[!0,class extends pt{constructor(t,e,n){super(t,e,n),Ti(this,"_w",void 0),Ti(this,"_h",void 0),this.onResize=this.onResize.bind(this),setTimeout(this.onResize),this.addEvent(window,"resize",()=>setTimeout(this.onResize)),this.bus.on("fullscreenchanged",()=>setTimeout(this.onResize,500)),this.bus.on("cclayoutchange",()=>setTimeout(this.onResize))}onResize(){const t=this.player.getElement();if(!t)return;const e=t.parentNode?t.parentNode:t,n=Math.max(t.offsetWidth,e.offsetWidth),i=Math.max(t.offsetHeight,e.offsetHeight,e.parentNode?.offsetHeight||0),s=Math.max(t.offsetWidth,e.parentNode?.offsetWidth||0);n===this._w&&i===this._h||(this._h=i,this._w=n,setTimeout(()=>this.bus.emit("resizeplayer",{width:n,height:i,outerWidth:s})))}}],["showCrawl",vs],["showSettings",class extends pt{constructor(t,e,n){super(t,e,n,["loadedmetadata","annotationslang","qualitychange","timeupdate"]),ri(this,"$el",void 0),ri(this,"$button",void 0),ri(this,"$selector",void 0),ri(this,"$mainStep",void 0),ri(this,"$annotations",void 0),ri(this,"$currentAnnotation",void 0),ri(this,"$quality",void 0),ri(this,"$currentQuality",void 0),ri(this,"$speed",void 0),ri(this,"$currentSpeed",void 0),ri(this,"$additionalStep",void 0),ri(this,"$back",void 0),ri(this,"$backText",void 0),ri(this,"$additional",void 0),ri(this,"playbackRate",1),ri(this,"annLang",""),this.logger.debug("settings:extension:creating"),this.render(),this.init(),this.logger.debug("settings:extension:created")}render(){this.$el=w("div",{class:ai}),this.$button=w("button",{type:"button",class:li},this.$el),this.$selector=w("div",{class:hi},this.$el),this.$mainStep=w("div",{class:ui},this.$selector),Yt(this.$button,"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"),this.options.showAnnotations&&(this.$annotations=w("button",{type:"button",class:gi},this.$mainStep),w("span",{},this.$annotations).textContent=this.$t("annotations"),S(this.$annotations,fi),ki(this.$annotations),this.$currentAnnotation=w("span",{class:vi},this.$annotations)),this.options.showQuality&&(this.$quality=w("button",{type:"button",class:mi},this.$mainStep),w("span",{},this.$quality).textContent=this.$t("quality"),S(this.$quality,fi),ki(this.$quality),this.$currentQuality=w("span",{class:vi},this.$quality)),this.options.showPlaybackRate&&(this.$speed=w("button",{type:"button",class:bi},this.$mainStep),w("span",{},this.$speed).textContent=this.$t("playback-rate"),S(this.$speed,fi),ki(this.$speed),this.$currentSpeed=w("span",{class:vi},this.$speed),this.$currentSpeed.textContent=this.$t("standard-playbackrate")),this.$additionalStep=w("div",{class:di},this.$selector),this.$back=w("button",{type:"button",class:yi},this.$additionalStep),Yt(w("span",{class:"arrow"},this.$back),Wt),this.$backText=w("span",{},this.$back),this.$additional=w("div",{class:"tab-content"},this.$additionalStep)}init(){const t=this.$button;if(Ce(this,{$button:t,$selector:this.$selector,SELECTOR_OPEN_CN:ci,reposition:!1,closeOnClick:!1,firstFocusItemSelector:`.${fi}`,toMainFn:this._toMain.bind(this)}),this.options.showAnnotations){this.addEvent(this.$annotations,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("annotations")),this._renderAnnotationsLanguages()});const t=[wi].concat(this.options.annotations),e=re(_i,"");let n=M(t,t=>t.srclang===e);n||(n=M(t,t=>t.default)),n=n||t[1],this.bus.emit("annotationslang",n.srclang)}this.options.showQuality&&this.addEvent(this.$quality,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("quality")),this._renderQualities()}),this.options.showPlaybackRate&&this.addEvent(this.$speed,"click",()=>{this._toAdditional(this.$t("playback-rate")),this._renderPlaybackRate()}),this.addEvent(this.$back,"click",()=>this._toMain()),Xt(this,{$button:t,text:this.$t("settings")})}_toAdditional(t){c(j(this.$additional.childNodes),t=>this.$additional.removeChild(t)),S(this.$selector,pi),this.$backText.textContent=t,we(this.player,this.$additionalStep),this.$back.focus()}_renderQualities(){c(j(this.$additional.childNodes),t=>this.$additional.removeChild(t));const t=this.player.getLevel(),e=[],n=this.player.getLevels();n.sort((t,e)=>e.height-t.height),c(n,n=>{if(!n.name&&!n.height)return;const i=w("button",{type:"button",class:$i},this.$additional);i.textContent=n.name||`${n.height}p`,(u(n,t)||D(n,"index",-1)===D(t,"index",-2))&&(S(i,xi),this.$currentQuality.textContent||this.bus.emit("qualitychange",i.textContent)),this.addEvent(i,"click",()=>{this.bus.emit("qualitychange",i.textContent),this.bus.emit("manualquality",i.textContent),c(e,t=>E(t,xi)),S(i,xi),this.player.setLevel(n),this._toMain()}),e.push(i)})}_renderAnnotationsLanguages(){const t=[],e=this.annLang;c([wi].concat(this.options.annotations),n=>{const i=w("button",{type:"button",class:$i},this.$additional);i.textContent=n.label,e===n.srclang&&S(i,xi),this.addEvent(i,"click",()=>{oe(_i,n.srclang),this.bus.emit("annotationslang",n.srclang),this._toMain()}),t.push(i)})}_mapRates(){const t=this.options.playbackRates;-1===t.indexOf(1)&&t.push(1);let e=t.map(t=>{const e=Math.round(100*t)/100;return 1===e?{rate:e,labelKey:"standard-playbackrate"}:5===e?{rate:e,hide:t=>t.isAudio}:{rate:e}});return e=e.filter((t,e)=>t.rate<=5&&t.rate>0).sort((t,e)=>t.rate-e.rate),e}_renderPlaybackRate(){const t=[];c(Array.isArray(this.options.playbackRates)?this._mapRates():Ci,e=>{if(h(e,"hide")&&o(e.hide)&&e.hide(this.options))return;const n=w("button",{type:"button",class:$i},this.$additional);n.textContent=b(e.labelKey)?this.$t(e.labelKey):String(e.rate),e.rate===this.playbackRate&&(S(n,xi),this.$currentSpeed.textContent=n.textContent),this.addEvent(n,"click",()=>{c(t,t=>E(t,xi)),S(n,xi),this.player.setPlaybackRate(e.rate),this.playbackRate=e.rate,this.$currentSpeed.textContent=n.textContent,this._toMain()}),t.push(n)})}_toMain(){E(this.$selector,pi),we(this.player,this.$mainStep);const t=document.querySelectorAll(`.${ui} > .${fi}`);t[0]&&t[0].focus()}onAnnotationslang(t){const e=M([wi].concat(this.options.annotations),e=>e.srclang===t)||wi;this.annLang=e.srclang,this.$currentAnnotation.textContent=e.label}onLoadedmetadata(){this.options.showQuality&&(this.player.isMultiQuality()?this._renderQualities():this.$quality.style.display="none")}onQualitychange(t){this.$currentQuality&&(this.$currentQuality.textContent=t)}onTimeupdate(){this.player.isLive()&&(this.player.setPlaybackRate(1),this.playbackRate=1,this.options.showPlaybackRate&&(this.$currentSpeed.textContent=this.$t("standard-playbackrate")))}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null,this.$button=null,this.$selector=null}}],["showFullScreen",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["statechanged"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("fullscreen:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.toggle.bind(this)),this.addEvent(document,"keyup",this.onKeyup.bind(this)),navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)&&this.addEvent(window,"resize",this.onResize.bind(this)),P(this.$el,_e,this.state.isFullScreen()),this.logger.debug("fullscreen:extension:created")}render(){this.$el=w("button",{type:"button",class:xe,"data-testid":"fullscreen"}),Yt(this.$el,"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",{class:"fullscreen-icon"}),Yt(this.$el,"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",{class:"exit-fullscreen-icon"});const t=()=>this.$t(this.state.isFullScreen()?"exit-fullscreen":"fullscreen");setTimeout(()=>Xt(this,{$button:this.$el,text:t}))}onResize(){this.state.isFullScreen()&&this.bus.emit("fullscreenchanging",!0)}onKeyup(t){27===t.keyCode&&this.bus.emit("fullscreenchanging",!1)}onStatechanged(t){P(this.$el,_e,t.isFullScreen)}toggle(){this.bus.emit("fullscreenchanging")}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}]];function Ss(t,e){const n=function(t,e){let n="calc(100% - 160px)";return e&&(n=e.bottom-e.top-160+"px"),`\n.rplayer {\n font-family: 'Roboto',sans-serif;\n width: 100%;\n height: 100%;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n outline: 0;\n position: relative;\n z-index: 1;\n text-align: left;\n}\n\n.rplayer, .rplayer * {\n box-sizing: border-box;\n}\n\n.rplayer--fullscreen .rplayer__inner {\n height: 100% !important;\n width: 100% !important;\n min-height: 100vh;\n min-width: 100vw;\n z-index: 9999999;\n position: static;\n padding-bottom: 0;\n margin: 0 auto\n}\n\n@media (orientation: portrait) {\n .rplayer--fullscreen .rplayer--iphone .rmp-extensions {\n bottom: 40px;\n }\n .rplayer--fullscreen .rplayer--iphone .rmp-ext-cc__text {\n bottom: 125px;\n }\n}\n\n.rplayer--fullscreen:-webkit-full-screen .rplayer__inner,\n.rplayer--fullscreen:-moz-full-screen .rplayer__inner,\n.rplayer--fullscreen:-ms-fullscreen .rplayer__inner,\n.rplayer--fullscreen:fullscreen .rplayer__inner,\n min-height: 100vh;\n min-width: 100vw;\n}\n\n.rplayer--fullscreen .rplayer__playlist-wrapper {\n display: none;\n}\n\n.rplayer button span {\n display: inline;\n padding: 0;\n}\n\n.rplayer--fullscreen .rplayer video {\n background-color: black;\n}\n\n.rplayer audio {\n width: 100%\n}\n\n.rplayer video {\n outline: 0\n}\n\n.rplayer--fullscreen {\n position: fixed!important;\n top: 0!important;\n bottom: 0!important;\n right: 0!important;\n left: 0!important;\n background-color: black;\n width: 100%!important;\n max-width: 100% !important;\n height: 100vh !important;\n z-index: 9999999!important;\n display: block;\n}\n\n.rplayer--fullscreen .rplayer {\n display: table-cell;\n vertical-align: middle\n}\n\n.rplayer__inner {\n margin: auto;\n background-color: black;\n}\n\n.rplayer__inner, .rplayer__playlist-wrapper {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n}\n\n.rplayer__inner--playing .rmp-ext-help, .rplayer__inner--playing .rmp-ext-title {\n opacity: 0;\n z-index: -9;\n}\n\n.rplayer__inner--loading>* {\n visibility: hidden\n}\n\n.rplayer__inner--loading>.loader {\n border: 4px solid #f3f3f3;\n border-top: 4px solid #666;\n border-radius: 50%;\n width: 60px;\n height: 60px;\n animation: spin 2s linear infinite;\n visibility: visible;\n position: absolute;\n left: 50%;\n top: 50%;\n margin-top: -30px;\n margin-left: -30px\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg)\n }\n\n to {\n transform: rotate(-360deg)\n }\n}\n\n@-webkit-keyframes spin {\n 0% {\n transform: rotate(0deg)\n }\n\n to {\n transform: rotate(360deg)\n }\n}\n\n.rplayer video {\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n border: 0\n}\n\n.rplayer .rplayer__inner--cc-below video {\n position: relative;\n height: ${n};\n}\n\n.rplayer--cc-75-below .rplayer__inner--cc-below video {\n height: calc(100% - 110px);\n}\n\n.rplayer--cc-100-below .rplayer__inner--cc-below video {\n height: calc(100% - 140px);\n}\n\n.rplayer--cc-125-below .rplayer__inner--cc-below video {\n height: calc(100% - 150px);\n}\n\n.rplayer--cc-150-below .rplayer__inner--cc-below video {\n height: calc(100% - 170px);\n}\n\n.rplayer--cc-200-below .rplayer__inner--cc-below video {\n height: calc(100% - 200px);\n}\n\n.rplayer--fullscreen .rplayer--cc-75-below .rplayer__inner--cc-below video {\n height: calc(100vh - 130px);\n}\n\n.rplayer--fullscreen .rplayer--cc-100-below .rplayer__inner--cc-below video {\n height: calc(100vh - 160px);\n}\n\n.rplayer--fullscreen .rplayer--cc-125-below .rplayer__inner--cc-below video {\n height: calc(100vh - 180px);\n}\n\n.rplayer--fullscreen .rplayer--cc-150-below .rplayer__inner--cc-below video {\n height: calc(100vh - 210px);\n}\n\n.rplayer--fullscreen .rplayer--cc-200-below .rplayer__inner--cc-below video {\n height: calc(100vh - 230px);\n}\n\n.rmp-extensions, .rmp-ext-title {\n height: 86px;\n left: 0;\n right: 0;\n position: absolute;\n background-repeat: repeat-x;\n\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA0xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDg2NUVBOEM1QTQ0MTFFNzlGNTJDQTRCNzY1MURGNEMiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDg2NUVBOEI1QTQ0MTFFNzlGNTJDQTRCNzY1MURGNEMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjAzOTcwY2FjLWEyYWMtMTE3YS05OGUxLWI5NzUzOTY2ZTQ4MyIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjAzOTcwY2FjLWEyYWMtMTE3YS05OGUxLWI5NzUzOTY2ZTQ4MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoORptwAAACaSURBVHjafFBbDoAgDBsbev87egsF8fEBtqmY2LRrGRtmZpvfcD7QEE7BKtYIinAruoNVAQXvKAjv2R27HHiMOpN7TN0qWjVRo7XU5iNnKFuvqfczwZTxgbj/hNJUDj/3n5xPpTJcSDIokrrMGM6dJZQvBOaisyRqgXLB2jJ1s3DHLCuOkXEMNQF1plUDt1Sbkxv4iMQG+CXAAOG1UnHx2OgyAAAAAElFTkSuQmCC');\n\n color: ${t.mainColor};\n z-index: 4;\n transition: opacity 500ms ease;\n}\n\n.rplayer--iphone .rmp-extensions, .rplayer--iphone .rmp-ext-title {\n transition: none;\n transform: translateZ(0);\n z-index: 9;\n background: linear-gradient(360deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.75) 50%, rgba(0,0,0,0) 100%);\n}\n\n.rmp-extensions {\n background-position: bottom;\n bottom: -26px;\n padding-top: 26px;\n padding-right: 5px;\n font-size: 12px;\n z-index: 5;\n display: flex;\n}\n\n.rmp-ext-backward, .rmp-ext-prev-frame, .rmp-ext-play, .rmp-ext-next-frame, .rmp-ext-forward, \n.rmp-ext-volume, .rmp-ext-progress, .rmp-ext-settings, .rmp-ext-theater, .rmp-ext-cc, .rmp-ext-toc,\n.rmp-ext-audio-tracks, .rmp-ext-search, .rmp-ext-settings, .rmp-ext-fullscreen, .rmp-ext-bottom-next,\n.rmp-ext-bottom-prev {\n max-height: 31px;\n}\n\n.rplayer--mobile .rmp-extensions {\n bottom: -20px;\n}\n\n.rplayer__inner--light .rmp-ext-help,\n.rmp-extensions--hidden > .rmp-extensions, .rmp-extensions--hidden > .rmp-ext-title, .rmp-extensions--hidden > .rmp-ext-help {\n opacity: 0;\n}\n\n.rplayer__inner--light.rplayer__inner--hovering .rmp-extensions, .rplayer__inner--light.rplayer__inner--hovering .rmp-ext-help,\n.rplayer__inner--active .rmp-extensions, .rplayer__inner--active .rmp-ext-help {\n opacity: 1;\n}\n\n.rmp-extensions button, .rmp-ext-help__button {\n height: 32px;\n border: none;\n cursor: pointer;\n position: relative;\n background-color: transparent;\n float: left;\n color: ${t.submenuColor};\n width: 36px\n}\n\n\n.rplayer--mobile .rmp-extensions .rmp-ext-forward, .rplayer--mobile .rmp-extensions .rmp-ext-backward {\n display: none;\n}\n\n.rplayer--mobile .arrow svg {\n width: 24px !important;\n height: 24px !important;\n}\n\n.rmp-extensions button svg, .rmp-ext-help__button {\n width: 24px;\n height: 24px;\n display: block;\n fill: ${t.mainColor};\n opacity: .75\n}\n\n.rmp-extensions button:hover svg, .rmp-ext-help__button:hover {\n opacity: 1\n}\n\n.rmp-extensions button, .rmp-ext-title__title,\n.rplayer__playlist-item {\n padding: 0 5px;\n outline-offset: -2px;\n}\n\n.rplayer__inner--accessibility .rmp-extensions button:focus,\n.rplayer__inner--accessibility .rmp-ext-progress__bar:focus,\n.rplayer__inner--accessibility .rmp-ext-title__title:focus,\n.rplayer__inner--accessibility .rplayer__playlist-item:focus,\n.rplayer__inner--accessibility .rmp-ext-buffering:focus {\n outline: 2px solid blue;\n}\n\n.rmp-extensions > button:first-of-type {\n margin-left: 6px\n}\n\n.rmp-ext-placeholder {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n background-color: #000;\n opacity: 0.001;\n}\n\n.rmp-ext-placeholder--animation {\n background-color: transparent;\n opacity: 1;\n}\n\n.rplayer__inner--light .rmp-ext-placeholder__play-btn {\n display: inline-block;\n}\n\n.rplayer__inner--light .rmp-ext-placeholder {\n background-color: transparent;\n opacity: 1;\n cursor: pointer;\n}\n\n.rplayer__inner--light.rplayer__inner--hovering .rmp-ext-placeholder__play-btn {\n width: 78px;\n height: 78px;\n margin-top: -40px;\n margin-left: -40px;\n cursor: pointer;\n}\n\n.rplayer__inner--light.rplayer__inner--hovering .rmp-ext-placeholder__play-btn svg {\n top: 11px;\n left: 11px;\n cursor: pointer;\n}\n\n.rmp-ext-placeholder__play-btn {\n background-color: rgba(61,61,61,.75);\n border: 0 none;\n border-radius: 50%;\n position: absolute;\n width: 72px;\n height: 72px;\n left: 50%;\n top: 50%;\n margin-top: -36px;\n margin-left: -36px;\n display: none;\n outline: none;\n}\n\n.rmp-ext-placeholder__icon {\n position: absolute;\n width: 56px;\n height: 56px;\n left: 50%;\n top: 50%;\n margin-top: -28px;\n margin-left: -28px\n}\n\n.rmp-ext-placeholder__icon svg, .rmp-ext-placeholder__play-btn svg {\n position: absolute;\n width: 56px;\n height: 56px;\n fill: #222\n}\n\n.rmp-ext-placeholder__play-btn svg {\n fill: ${t.mainColor};\n position: absolute;\n top: 8px;\n left: 8px;\n}\n\n.rmp-ext-placeholder--animation .rmp-ext-placeholder__icon {\n animation: disappear-icon .75s ease 1\n}\n\n@keyframes disappear-icon {\n 0% {\n opacity: 1\n }\n\n to {\n transform: scale(2);\n opacity: 0\n }\n}\n\n@-webkit-keyframes disappear-icon {\n 0% {\n opacity: 1\n }\n\n to {\n transform: scale(2);\n opacity: 0\n }\n}\n\n.rmp-extensions .rmp-ext-play svg {\n display: none\n}\n\n.rmp-extensions .rmp-ext-play--paused .play,.rmp-extensions .rmp-ext-play--playing .pause, .rmp-extensions .rmp-ext-play--ended .replay {\n display: block\n}\n\n.rmp-ext-progress {\n flex-grow: 1;\n}\n\n.rmp-ext-progress__current {\n line-height: 32px;\n padding: 0 8px;\n user-select: none\n}\n\n.rmp-ext-progress__overlay {\n background-color: #fff;\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: .75\n}\n\n.rmp-ext-progress__bar {\n cursor: pointer;\n height: 4px;\n border-radius: 2px;\n position: absolute;\n top: 14px;\n left: 16px;\n right: 16px;\n display: block;\n -webkit-box-shadow: 0 0 2px 0 rgba(51,51,51,.5);\n box-shadow: 0 0 2px 0 rgba(51,51,51,.5);\n transition: all 50ms linear\n}\n\n.rmp-ext-progress__generic-live-stream.rmp-ext-progress__bar {\n pointer-events: none;\n}\n.rmp-ext-progress__generic-live-stream .rmp-ext-progress__progress {\n width: 100% !important;\n background-color: #e62048;\n}\n.rmp-ext-progress__generic-live-stream .rmp-ext-progress__handle,\n.rmp-ext-progress__generic-live-stream .rmp-ext-progress__play-progress,\n.rmp-ext-progress__generic-live-stream.rmp-ext-progress > span:nth-child(2),\n.rmp-ext-progress__generic-live-stream.rmp-ext-progress > span:nth-child(3) {\n display: none;\n}\n\n.rmp-ext-progress__bar:hover {\n height: 8px;\n margin-top: -2px\n}\n\n.rmp-ext-progress__bar-padding {\n position: absolute;\n z-index: 5;\n bottom: -2px;\n left: 0;\n right: 0;\n display: block;\n height: 18px;\n cursor: pointer;\n}\n\n.rmp-ext-progress__duration {\n line-height: 32px;\n padding: 0 8px;\n user-select: none;\n position: relative\n}\n\n.rmp-ext-progress__handle {\n position: absolute;\n left: 0;\n width: 6px;\n height: 10px;\n top: -3px;\n margin-left: -3px;\n cursor: pointer;\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 0 2px 0 rgba(51,51,51,.25);\n box-shadow: 0 0 2px 0 rgba(51,51,51,.25);\n z-index: 7;\n transform: translateZ(0);\n}\n\n@media only screen and (max-device-width: 768px) and (pointer:coarse) {\n .rmp-ext-progress__handle {\n width: 12px !important;\n height: 24px !important;\n top: -9px !important;\n margin-left: -6px !important;\n background-color: transparent;\n box-shadow: none;\n transform: translateZ(0);\n padding: 6px 5px;\n }\n\n .rmp-ext-progress__chapter-bubble {\n z-index: 5;\n }\n\n .rmp-ext-progress__handle:before {\n content: '';\n display: block;\n width: 6px;\n height: 10px;\n top: -3px;\n margin-left: -3px;\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 0 2px 0 rgba(51,51,51,.25);\n box-shadow: 0 0 2px 0 rgba(51,51,51,.25);\n transform: translateZ(0);\n }\n\n .rmp-ext-progress__bar:hover .rmp-ext-progress__handle:before {\n height: 14px;\n }\n}\n\n.rmp-ext-progress__progress {\n left: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n background: #fff;\n z-index: 2\n}\n\n.rmp-ext-progress__play-progress {\n left: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n background: ${t.accentColor};\n z-index: 3\n}\n\n.rmp-ext-progress__bar:hover .rmp-ext-progress__handle {\n top: -4px;\n height: 16px\n}\n\n.rmp-ext-progress__tooltip {\n position: absolute;\n bottom: 80px;\n background-color: #333;\n padding: 4px 8px;\n font-size: 12px;\n border-radius: 4px;\n display: none;\n text-align: center;\n z-index: 5\n}\n\n.rmp-ext-progress__thumbmail:not(:empty) {\n margin-bottom: 7px\n}\n\n.rmp-ext-progress__thumbmail-time,.rmp-ext-volume {\n display: inline-block\n}\n\n.rmp-ext-volume__btn .muted,.rmp-ext-volume__btn--muted .unmuted {\n display: none\n}\n\n.rmp-ext-volume__btn--muted .muted {\n display: block\n}\n\n.rmp-ext-progress__tooltip--visible {\n display: flex !important;\n justify-content: center !important;\n flex-direction: column !important;\n align-items: center !important;\n}\n\n.rmp-ext-progress__chapter-bubble {\n position: absolute;\n display: block;\n width: 12px;\n height: 12px;\n top: 50%;\n margin-top: -6px;\n margin-left: -6px;\n z-index: 6\n}\n\n.rmp-ext-progress__chapter-bubble:before {\n content: '';\n position: absolute;\n display: block;\n position: absolute;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: ${t.chaptersBubbleColor};\n top: 50%;\n margin-top: -4px;\n margin-left: 2px;\n -webkit-box-shadow: 0 0 2px 0 rgba(251,251,251,.85);\n box-shadow: 0 0 2px 0 rgba(251,251,251,.85);\n}\n\n.rmp-ext-volume__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n background-color: ${t.submenuBgColor};\n width: 33px;\n}\n\n.rmp-ext-volume__selector--open, .rmp-ext-volume__selector--active {\n display: block;\n}\n\n.rmp-ext-volume__slider {\n cursor: pointer;\n height: 100px;\n display: inline-block;\n width: 4px;\n margin: 6px 14px;\n position: relative;\n line-height: 32px\n}\n\n.rmp-ext-volume__handle,.rmp-ext-volume__overlay,.rmp-ext-volume__progress {\n position: absolute;\n -webkit-box-shadow: 0 0 2px 0 rgba(51,51,51,.5);\n box-shadow: 0 0 2px 0 rgba(51,51,51,.5);\n border-radius: 2px\n}\n\n.rmp-ext-volume__handle {\n width: 12px;\n height: 8px;\n margin-top: -4px;\n cursor: pointer;\n z-index: 2;\n left: -4px;\n border: 1px solid #90A4AE;\n background-color: #fff\n}\n\n.rmp-ext-volume__overlay,.rmp-ext-volume__progress {\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ${t.accentColor}\n}\n\n.rmp-ext-volume__overlay {\n display: block;\n top: 0;\n background-color: #fff;\n opacity: .75\n}\n\n.rmp-ext-theater--hidden {\n display: none;\n}\n\n.rmp-ext-fullscreen .exit-fullscreen-icon,.rmp-ext-fullscreen--exit .fullscreen-icon,\n.rmp-ext-theater--exit .rmp-ext-theater__icon,.rmp-ext-theater .rmp-ext-theater__exit-icon {\n display: none\n}\n\n.rmp-ext-fullscreen--exit .exit-fullscreen-icon, .rmp-ext-theater--exit .rmp-ext-theater__exit-icon {\n display: block\n}\n\n.rmp-ext-cc__text {\n position: absolute;\n bottom: 60px;\n left: 0;\n right: 0;\n text-align: center;\n display: none;\n pointer-events: none;\n color: ${t.mainColor};\n font-size: 18px;\n opacity: .85;\n z-index: 3;\n transition: bottom 250ms ease\n}\n\n.rmp-ext-crawl {\n position: absolute;\n bottom: 60px;\n left: 0;\n right: 0;\n pointer-events: none;\n z-index: 3;\n transition: bottom 250ms ease;\n background-color: #224367;\n color: #FFFFFF;\n padding: 5px 0;\n overflow: hidden;\n white-space: nowrap;\n}\n \n .rmp-ext-crawl__text {\n width: max-content;\n will-change: transform;\n }\n\n .rmp-ext-crawl__text * {\n color: inherit !important;\n }\n\n .rmp-ext-crawl > .rmp-ext-crawl__text, .rmp-ext-crawl > .rmp-ext-crawl__text > * {\n display: inline-block;\n margin: 0;\n padding: 0;\n }\n\n.rmp-ext-crawl--exist > .rmp-ext-cc__text {\n bottom: 100px;\n}\n\n.rplayer--iphone .rmp-ext-cc__text {\n transition: none;\n bottom: 100px;\n will-change: auto;\n}\n\n.rmp-extensions--hidden > .rmp-ext-cc__text {\n bottom: 10px\n}\n\n.rmp-extensions--hidden > .rmp-ext-crawl {\n bottom: 10px\n}\n\n.rmp-extensions--hidden.rmp-ext-crawl--exist > .rmp-ext-cc__text {\n bottom: 50px\n}\n\n.rmp-ext-cc__text--visible {\n display: block\n}\n\n.rmp-ext-cc__text-holder {\n background-color: #333;\n padding: 4px 8px;\n border-radius: 4px;\n display: inline-block;\n line-height: 1.2\n}\n\n.rplayer__inner--cc-below .rmp-ext-cc__text {\n position: static;\n margin-top: 5px;\n}\n\n.rmp-ext-cc__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n margin-left: -15px;\n background-color: ${t.submenuBgColor};\n overflow: hidden;\n width: 250px\n}\n\n.rmp-ext-cc__selector--open {\n display: block\n}\n\n.rmp-ext-cc__selector .rmp-ext-cc__item {\n padding-left: 18px;\n}\n\n.rmp-ext-cc__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n.rmp-ext-cc__item--checked:before,.rmp-ext-settings__item--checked:before,.rmp-ext-toc__lang-item--checked:before,.rmp-ext-audio-tracks__item--checked:before {\n position: absolute;\n content: '•';\n margin-left: -12px;\n font-size: 24px;\n margin-top: -1px\n}\n\n.rmp-ext-toc {\n width: 34px;\n padding: 0 2px\n}\n\n.rmp-ext-toc__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n overflow: hidden;\n background-color: ${t.submenuBgColor};\n width: 250px\n}\n\n.rmp-ext-toc__chapters > .rmp-ext-toc__item {\n width: 100%;\n height: auto;\n min-height: 32px;\n text-align: left;\n padding: 0 15px;\n}\n\n.rmp-ext-toc__chapters:empty {\n padding-top: 0;\n}\n\n\n.rmp-ext-toc__selector--open {\n display: block\n}\n\n.rmp-ext-toc__item,.rmp-ext-toc__selector a:hover {\n text-decoration: none;\n color: #000\n}\n\n.rmp-ext-toc__item {\n margin-bottom: 14px;\n display: block;\n color: ${t.submenuColor};\n padding: 8px 0\n}\n\n.rmp-ext-toc__item:hover {\n color: #333;\n text-decoration: underline\n}\n\n.rmp-ext-toc__item:last-child {\n margin-bottom: 0\n}\n\nbutton.rmp-ext-toc__more {\n text-align: left;\n width: 100%;\n line-height: 32px;\n padding-left: 12px;\n border-top: 1px solid #AAA;\n}\n\n.rmp-ext-toc__more .arrow {\n float: right;\n width: 20px;\n margin-top: 4px;\n}\n\n.rmp-ext-toc__more .arrow svg, button.rmp-ext-toc__back svg {\n fill: ${t.submenuColor}\n}\n\n.rmp-ext-toc__main-step:after, .rmp-ext-toc__languages-step:after {\n content: ' ';\n display: table;\n clear: both;\n}\n\n.rmp-ext-toc__main-step, .rmp-ext-toc__languages-step, .rmp-ext-toc__translate-step {\n display: none;\n position: absolute;\n left: 265px;\n bottom: 0;\n width: 100%;\n overflow: auto;\n}\n\n.rmp-ext-toc__selector--main-step .rmp-ext-toc__main-step,\n.rmp-ext-toc__selector--translate-step .rmp-ext-toc__translate-step,\n.rmp-ext-toc__selector--languages-step .rmp-ext-toc__languages-step {\n display: block;\n position: relative;\n left: 0;\n width: 100%;\n}\n\n.rmp-ext-toc__selector--languages-step .rmp-ext-toc__main-step,\n.rmp-ext-toc__selector--translate-step .rmp-ext-toc__main-step,\n.rmp-ext-toc__selector--translate-step .rmp-ext-toc__languages-step {\n display: none;\n position: absolute;\n left: -265px;\n}\n\n.rmp-ext-toc__selector--languages-step .rmp-ext-toc__back,\n.rmp-ext-toc__selector--translate-step .rmp-ext-toc__back {\n border-bottom: 1px solid #AAA;\n text-align: left;\n width: 100%;\n line-height: 32px;\n}\n\n.rmp-ext-toc__back span:first-of-type {\n float: left;\n padding: 3px 0;\n}\n\nbutton.rmp-ext-toc__lang-item {\n width: 100%;\n text-align: left;\n padding: 0 12px 0 20px;\n line-height: 32px;\n}\n\n\n.rmp-ext-toc__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n\n.rmp-ext-popover {\n position: absolute;\n bottom: 56px;\n background-color: #666;\n z-index: 9;\n padding: 4px 6px;\n border-radius: 4px;\n font-size: 12px;\n opacity: .875;\n display: none\n}\n\n.rmp-annotation:hover .rmp-annotation__button,.rmp-ext-popover--visible {\n display: block\n}\n\n.rmp-annotation {\n position: absolute;\n background-color: rgba(0,0,0,.8);\n padding: 4px 6px;\n color: #fff;\n border: 1px solid #888;\n display: none;\n z-index: 3\n}\n\n.rmp-annotation--visible {\n display: block\n}\n\n.rmp-annotation__button {\n position: absolute;\n top: -6px;\n right: -6px;\n background-color: #eee;\n height: 18px;\n width: 18px;\n border-radius: 50%;\n border: 0 none;\n display: none;\n cursor: pointer\n}\n\n.rmp-annotation__button svg {\n fill: #666;\n position: absolute;\n top: 1px;\n left: 1px\n}\n\n.rmp-annotation__button:hover svg {\n fill: #333\n}\n\n.rmp-ext-poster, .rmp-ext-poster img {\n width: 100%\n}\n.rmp-ext-poster img {\n position: absolute;\n margin: auto;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n width: 100% !important;\n height: auto !important;\n}\n\n.rmp-ext-poster {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: black;\n}\n\n.rmp-ext-poster--hidden {\n display: none\n}\n\n.rmp-ext-settings {\n width: 34px;\n padding: 0 2px;\n}\n\n.rmp-ext-settings__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n background-color: ${t.submenuBgColor};\n width: 260px;\n right: 5px;\n overflow: hidden;\n}\n\n.rmp-ext-settings__selector--open {\n display: block\n}\n\n.rmp-ext-settings__selector button {\n width: 100%;\n text-align: left;\n padding: 0 6px;\n line-height: 32px;\n}\n\n.rmp-ext-settings__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n.rmp-ext-download__more .arrow, .rmp-ext-settings__more .arrow {\n float: right;\n width: 20px;\n margin-top: 5px;\n}\n\n.rmp-ext-download__more .arrow svg, .rmp-ext-settings__more .arrow svg {\n fill: ${t.submenuColor}\n}\n\n.rmp-ext-settings__current-value, .rmp-ext-cc__current-value, .rmp-ext-toc__current-value {\n float: right;\n font-size: 11px;\n color: #757575\n}\n\n.rmp-ext-cc__settings--progress .rmp-ext-cc__current-value {\n font-style: italic;\n}\n\n.rmp-ext-cc__settings--progress {\n background-color: transparent !important;\n}\n\n\n.rmp-ext-cc__settings--progress > span {\n opacity: 0.5;\n}\n\n.rmp-ext-download__main-step, .rmp-ext-settings__main-step {\n width: 100%;\n left: 0;\n position: relative;\n}\n\n.rmp-ext-download__main-step:after, .rmp-ext-download__additional-step:after,\n.rmp-ext-settings__main-step:after, .rmp-ext-settings__additional-step:after, .rplayer--right-playlist:after {\n content: ' ';\n display: table;\n clear: both;\n}\n\n.rmp-ext-download__additional-step, .rmp-ext-settings__additional-step {\n display: none;\n position: absolute;\n left: 265px;\n bottom: 0;\n width: 100%;\n overflow: auto;\n}\n\n.rmp-ext-download__selector--additional .rmp-ext-download__additional-step,\n.rmp-ext-settings__selector--additional .rmp-ext-settings__additional-step {\n display: block;\n position: relative;\n left: 0;\n width: 100%;\n}\n\n.rmp-ext-download__selector--additional .rmp-ext-download__main-step,\n.rmp-ext-settings__selector--additional .rmp-ext-settings__main-step {\n display: none;\n position: absolute;\n left: -265px;\n}\n\nbutton.rmp-ext-download__back, button.rmp-ext-settings__back {\n border-bottom: 1px solid #AAA;\n}\n\nbutton.rmp-ext-download__back svg, button.rmp-ext-settings__back svg {\n fill: ${t.submenuColor};\n float: left;\n}\n\n.rmp-ext-download__back > span:first-of-type, .rmp-ext-settings__back > span:first-of-type {\n display: block;\n float: left;\n padding: 4px 0;\n}\n\nbutton.rmp-ext-settings__item {\n padding-left: 20px\n}\n\nbutton.rmp-ext-settings__item.rmp-ext-settings__item--checked:before {\n margin-top: -1px;\n}\n\n.rmp-ext-audio-tracks, .rmp-ext-search {\n width: 34px;\n padding: 0 2px;\n}\n\n.rmp-ext-search--hidden {\n display: none;\n}\n\n.rmp-ext-audio-tracks__selector, .rmp-ext-search__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n background-color: ${t.submenuBgColor};\n width: 260px;\n right: 5px;\n overflow: auto;\n}\n\n.rmp-ext-audio-tracks__selector--open, .rmp-ext-search__selector--open {\n display: block\n}\n\n.rmp-ext-audio-tracks__selector button, .rmp-ext-search__selector button {\n width: 100%;\n text-align: left;\n padding: 0 6px 0 20px;\n line-height: 32px;\n}\n\n.rmp-ext-audio-tracks__selector button:hover, .rmp-ext-search__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n.rmp-ext-search__captions {\n overflow: auto;\n max-height: 160px;\n}\n\n.rmp-ext-search__input {\n width: 100%;\n margin-top: 2px;\n}\n\n.rplayer--mobile .rmp-ext-search__input {\n height: 40px;\n}\n\n.rmp-ext-search__item--current {\n font-weight: 600;\n}\n\n.rmp-ext-search__cc-text {\n font-family: Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif;\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block !important;\n white-space: nowrap;\n width: 156px;\n padding-left: 6px !important;\n vertical-align: middle;\n}\n\n.rmp-ext-search__cc-time {\n font-family: Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif;\n display: inline-block !important;\n width: 59px;\n padding-right: 5px;\n vertical-align: middle;\n overflow: hidden;\n margin-left: -5px;\n}\n\nbutton.rmp-ext-cc__more {\n text-align: left;\n width: 100%;\n line-height: 32px;\n padding-left: 20px;\n}\n\n.rmp-ext-cc__main-step button.rmp-ext-cc__more {\n border-top: 1px solid #AAA;\n}\n\n.rmp-ext-cc__more .arrow {\n float: right;\n width: 20px;\n margin-top: 4px;\n}\n\n.rmp-ext-cc__more .arrow svg, button.rmp-ext-cc__back svg {\n fill: ${t.submenuColor}\n}\n\n.rmp-ext-cc__main-step, .rmp-ext-cc__settings-step, .rmp-ext-cc__additional-step {\n position: relative;\n left: 0;\n width: 100%;\n overflow: auto;\n display: block;\n}\n\n.rmp-ext-cc__selector--settings-step .rmp-ext-cc__main-step, .rmp-ext-cc__selector--additional-step .rmp-ext-cc__main-step,\n.rmp-ext-cc__selector--additional-step .rmp-ext-cc__settings-step, .rmp-ext-cc__selector--translate-step .rmp-ext-cc__main-step {\n display: none;\n position: absolute;\n left: -255px;\n}\n\n.rmp-ext-cc__selector--main-step .rmp-ext-cc__settings-step, .rmp-ext-cc__selector--main-step .rmp-ext-cc__additional-step,\n.rmp-ext-cc__selector--settings-step .rmp-ext-cc__additional-step, .rmp-ext-cc__selector--translate-step .rmp-ext-cc__additional-step {\n display: none;\n position: absolute;\n left: 255px;\n}\n\n.rmp-ext-cc__selector--settings-step .rmp-ext-cc__translate-wrapper, .rmp-ext-cc__selector--translate-step .rmp-ext-cc__settings-wrapper {\n display: none;\n}\n\n.rmp-ext-cc__selector button {\n text-align: left;\n width: 100%;\n line-height: 32px;\n}\n\nbutton.rmp-ext-cc__back {\n border-bottom: 1px solid #AAA;\n}\n\n.rmp-ext-cc__back span:first-of-type {\n float: left;\n padding: 3px 0;\n}\n\n.rmp-ext-help__button {\n position: absolute;\n top: 8px;\n right: 10px;\n z-index: 6;\n width: 32px;\n height: 32px;\n padding: 0;\n}\n\n.rmp-ext-help, .rmp-ext-help__canvas {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n}\n\n.rmp-ext-help__canvas, rmp-ext-help__canvas--visible .rmp-ext-help__button {\n display: none;\n}\n\n.rmp-ext-help__canvas--visible, .rmp-ext-help__canvas--visible .rmp-ext-help__canvas {\n display: block;\n z-index: 999;\n}\n\n.rmp-ext-title {\n width: 100%;\n top: 0;\n z-index: 2\n}\n\n.rmp-ext-title__title {\n font-size: 20px;\n padding: 12px 50px 0 12px;\n opacity: 0.95;\n display: block;\n\n max-height: 60px;\n overflow: hidden;\n\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n -webkit-line-clamp: 2;\n}\n\n.rmp-ext-prev, .rmp-ext-next {\n display: none;\n position: absolute;\n top: 50%;\n margin-top: -34px;\n cursor: pointer;\n opacity: 0.75;\n z-index: 4;\n}\n\n.rplayer--fullscreen .rmp-ext-prev, .rplayer--fullscreen .rmp-ext-next {\n display: block;\n}\n\n.rmp-ext-prev:hover, .rmp-ext-next:hover {\n opacity: 1;\n}\n\n.rmp-ext-prev {\n transition: left 150ms ease\n}\n\n.rmp-ext-next {\n transition: right 150ms ease\n}\n\n.rmp-ext-prev, .rplayer__inner--light.rplayer__inner--hovering .rmp-ext-prev {\n left: -120px;\n}\n\n.rplayer__inner--light .rmp-ext-prev,\n.rmp-extensions--hidden > .rmp-ext-prev {\n left: -175px;\n}\n\n.rmp-ext-next, .rplayer__inner--light.rplayer__inner--hovering .rmp-ext-next {\n right: -120px;\n}\n\n.rplayer__inner--light .rmp-ext-next,\n.rmp-extensions--hidden > .rmp-ext-next {\n right: -175px;\n}\n\n@media only screen and (max-device-width: 768px){\n.rplayer__inner .rmp-ext-next:hover {\n right: -120px !important;\n}\n\n.rplayer__inner .rmp-ext-prev:hover {\n left: -120px !important;\n}\n}\n\n.rmp-ext-prev__button, .rmp-ext-next__button {\n background-color: #333;\n border: 0;\n height: 67.5px;\n cursor: pointer\n}\n\n.rmp-ext-prev__button {\n border-radius: 0 50% 50% 0;\n float: right;\n padding-left: 0;\n}\n\n.rmp-ext-next__button {\n border-radius: 50% 0 0 50%;\n float: left;\n padding-right: 0;\n}\n\n.rmp-ext-prev__thumbnail, .rmp-ext-next__thumbnail {\n width: 120px;\n height: 67.5px;\n border: 5px solid #333;\n}\n\n.rmp-ext-prev__button, .rmp-ext-prev__thumbnail {\n -webkit-box-shadow: -2px 4px 5px 0px rgba(50, 50, 50, 0.75);\n box-shadow: -2px 4px 5px 0px rgba(50, 50, 50, 0.75);\n}\n\n.rmp-ext-next__button, .rmp-ext-next__thumbnail {\n -webkit-box-shadow: 2px 4px 5px 0px rgba(50, 50, 50, 0.75);\n box-shadow: 2px 4px 5px 0px rgba(50, 50, 50, 0.75);\n}\n\n.rmp-ext-next:hover {\n right: 0 !important;\n}\n\n.rmp-ext-prev:hover {\n left: 0 !important;\n}\n\n.rmp-ext-prev__button svg, .rmp-ext-next__button svg {\n fill: ${t.mainColor};\n}\n\n.rmp-no-video {\n position: absolute;\n top: 50%;\n margin-top: -.5em;\n display: block;\n text-align: center;\n left: 0;\n right: 0;\n}\n\n.rmp-ext-buffering {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(51,51,51,.5);\n display: none;\n z-index: 9999;\n}\n\n.rmp-ext-buffering--processing {\n display: block;\n}\n\n.rmp-ext-buffering__message {\n padding: 20px;\n display: inline-block;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.rmp-ext-buffering__message svg {\n fill: #FFF;\n opacity: .75;\n width: 50px;\n height: 50px;\n animation: spin 1.5s linear infinite;\n animation-direction: reverse;\n}\n\n.rmp-ext-buffering--processing ~ .rmp-ext-placeholder {\n opacity: 0;\n}\n\n.rmp-ext-download__main-step {\n position: relative;\n left: 0;\n width: 100%;\n overflow: auto;\n\n -webkit-transition: left .25s ease;\n transition: left .25s ease;\n}\n\n.rmp-ext-download-hidden {\n position: absolute;\n opacity: 0;\n}\n\n.rmp-ext-download__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n background-color: ${t.submenuBgColor};\n width: 200px;\n right: 5px;\n overflow: hidden;\n}\n\n.rmp-ext-download__selector--open {\n display: block\n}\n\n.rmp-ext-download__selector button {\n width: 100%;\n text-align: left;\n padding: 0 6px;\n line-height: 32px;\n}\n\n.rmp-ext-download__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n.rmp-ext-bottom-next--hidden, .rmp-ext-bottom-prev--hidden {\n display: none;\n}\n\n.rmp-ext-search__selector > .rmp-ext-search__cc-clear {\n position: absolute;\n bottom: 3px;\n right: 5px;\n width: 15px;\n height: 15px;\n padding: 0;\n}\n\n.rmp-ext-search__selector > .rmp-ext-search__cc-clear:hover {\n background-color: transparent;\n opacity: 0.8;\n}\n\n.rmp-ext-search__selector > .rmp-ext-search__cc-clear svg {\n width: 15px;\n height: 15px;\n fill: #707070;\n}\n\n.rmp-ext-live {\n width: 34px;\n}\n\n.rmp-ext-live .broadcast-off {\n display: block;\n}\n\n.rmp-ext-live .broadcast-on {\n display: none;\n}\n\n.rmp-ext-live--live .broadcast-off {\n display: none;\n}\n\n.rmp-ext-live--live .broadcast-on {\n display: block;\n fill: #ff1111;\n}\n\n.rmp-ext-progress__hidden > span{\n visibility: hidden;\n}\n\n@media only screen and (max-width: 1224px) {\n .rmp-ext-progress__hidden > .rmp-ext-progress__current {\n visibility: visible !important;\n }\n}\n\n.rmp-ext-error {\n padding: 20px;\n text-align: center;\n z-index: 9999;\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: black;\n color: #FFFFFF;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n}\n\n.rmp-ext-error > svg {\n width: 50px;\n height: 50px;\n fill: #FFFFFF;\n margin-bottom: 20px;\n}\n \n.rmp-ext-error--hidden {\n display: none;\n}\n\n\n\n `}(t,e)+" "+function(t,e){const n=function(t,e){let n=`calc(100% - ${t.rplaylistHeight})`,i=t.rplaylistHeight;if(e){const t=e.right-e.left;n=.7*t+"px",i=.3*t+"px"}return`\n\n.rplayer--fullscreen .rplayer--right-playlist .rplayer__playlist-wrapper {\n max-height: calc(100vh - 44px);\n width: 0;\n}\n\n.rplayer--right-playlist .rplayer__playlist-wrapper {\n width: ${i};\n float: right;\n height: 100%;\n}\n\n.rplayer--right-playlist .rplayer__playlist {\n background-color: #424242;\n overflow-y: auto;\n overflow-x: hidden;\n position: absolute;\n top: 78px;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.rplayer--right-playlist .rplayer__playlist-wrapper.rplayer__playlist-wrapper--wot-title .rplayer__playlist {\n top: 22px;\n}\n\n.rplayer--right-playlist .rplayer__playlist-header {\n max-height: 56px;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n -webkit-line-clamp: 2;\n}\n\n.rplayer--right-playlist .rplayer__inner {\n width: ${n};\n float: left;\n}\n\n.rplayer--right-playlist .rplayer__playlist-item {\n padding: 8px;\n height: 70px;\n border-top: 1px solid #000;\n}\n\n.rplayer--right-playlist .rplayer__playlist-item-title {\n font-size: 13px;\n line-height: 1.4;\n height: 52px;\n display: block;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n -webkit-line-clamp: 3;\n}\n\n.rplayer--right-playlist .rplayer__playlist-item-thumb {\n margin-right: 6px;\n width: 96px;\n height: 54px;\n float: left;\n}\n\n.rplayer--right-playlist .rplayer__playlist-item--current .rplayer__playlist-item-thumb:before {\n font-size: 28px;\n line-height: 54px;\n}\n\n.rplayer--right-playlist .rplayer__playlist-of {\n left: 8px;\n top: 58px;\n}\n\n.rplayer--right-playlist .rplayer__playlist-wrapper.rplayer__playlist-wrapper--wot-title .rplayer__playlist-of {\n top: 5px;\n}\n\n.rplayer--right-playlist .rplayer__playlist-left-btn, .rplayer--right-playlist .rplayer__playlist-right-btn {\n display: none !important;\n}\n\n `}(t,e),i=function(t,e){let n="calc(100% - 152px)";return e&&(n=e.bottom-e.top-152+"px"),`\n\n\n.rplayer--fullscreen .rplayer--bottom-playlist .rplayer__playlist-wrapper {\n height: 0;\n width: 0;\n}\n\n.rplayer--bottom-playlist .rplayer__inner {\n height: ${n};\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-wrapper {\n height: 152px\n}\n\n.rplayer--bottom-playlist .rplayer__playlist {\n margin-top: 6px;\n position: absolute;\n bottom: 0\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-header {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n height: 30px;\n position: absolute;\n left: 0;\n right: 65px;\n top: 0;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-of {\n top: 12px;\n right: 8px;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-current-title {\n display: block;\n position: absolute;\n left: 8px;\n top: 40px;\n color: ${t.mainColor};\n font-size: 12px;\n right: 8px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item {\n margin-right: 10px;\n float: left\n}\n\n.rplayer__playlist-left-btn, .rplayer__playlist-right-btn {\n position: absolute;\n bottom: 1px;\n z-index: 10;\n background-color: rgba(0,0,0,.75);\n border: 0;\n cursor: pointer;\n height: 92px\n}\n\n.rplayer__playlist-left-btn svg, .rplayer__playlist-right-btn svg {\n fill: ${t.mainColor}\n}\n\n.rplayer__playlist-left-btn {\n left: 0;\n}\n\n.rplayer__playlist-right-btn {\n right: 0;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item-thumb {\n width: 160px;\n height: 90px;\n float: left;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item--current .rplayer__playlist-item-thumb:before {\n font-size: 36px;\n line-height: 90px;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item .rplayer__playlist-item-title {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n\n font-size: 11px;\n padding: 6px;\n line-height: 1.1;\n background-color: rgba(31,31,31,0.625);\n display: block;\n\n height: 32px;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n -webkit-line-clamp: 2;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item--current .rplayer__playlist-item-title {\n display: none;\n}\n\n `}(t,e);return`\n\n.rplayer__playlist-wrapper {\n background-color: #000;\n}\n\n.rplayer__playlist {\n color: ${t.mainColor}\n}\n\n.rplayer__playlist-header {\n padding: 8px;\n margin: 0;\n font-size: 16px;\n line-height: 1.4;\n display: block;\n overflow: hidden;\n color: ${t.mainColor};\n font-weight: 400;\n}\n\n.rplayer__playlist-current-title {\n display: none;\n}\n\n.rplayer__playlist-item {\n position: relative;\n cursor: pointer;\n}\n\n.rplayer__playlist-item-thumb {\n position: relative;\n overflow: hidden;\n}\n\n.rplayer__playlist-of {\n position: absolute;\n font-size: 12px;\n color: ${t.mainColor};\n}\n\n.rplayer__playlist .rplayer__playlist-item:last-child {\n margin: 0 !important\n}\n\n.rplayer__playlist-item--current {\n cursor: inherit;\n background-color: #757575\n}\n\n.rplayer__playlist-item--current .rplayer__playlist-item-thumb:before {\n display: block;\n content: '►';\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n text-align: center;\n z-index: 9;\n background-color: rgba(255,255,255,0.5);\n text-shadow: 0.125rem 0.125rem 0.5rem #333\n}\n\n.rplayer__playlist-item-thumb img {\n position: absolute;\n width: 100%\n}\n\n\n${n}\n\n${i}\n\n `}(t,e),i=document.head||N(document.getElementsByTagName("head")),s=w("style",{type:"text/css"});s.styleSheet?window.$?window.$('<style type="text/css">'+n+"</style>").appendTo("head"):s.styleSheet.cssText=n:s.appendChild(document.createTextNode(n)),i.appendChild(s)}function Es(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Ps="rplayer",Ls=`${Ps}__playlist`,Ms=`${Ps}__playlist-wrapper`,As=`${Ms}--wot-title`,Fs=`${Ps}__playlist-header`,zs=`${Ps}__playlist-of`,Ns=`${Ps}__playlist-current-title`,Os=`${Ps}__playlist-item`,Rs=`${Ps}__playlist-item-thumb`,js=`${Os}--current`,Hs=`${Ps}__playlist-item-title`,Ds=`${Ps}__playlist-left-btn`,Bs=`${Ps}__playlist-right-btn`;class Is extends V{constructor(t,e){super(e.bus,e.logger),Es(this,"$element",void 0),Es(this,"$wrapper",void 0),Es(this,"$of",void 0),Es(this,"$currentTitle",void 0),Es(this,"$header",void 0),Es(this,"$left",void 0),Es(this,"$right",void 0),Es(this,"$items",[]),Es(this,"_playlist",[]),Es(this,"_current",null),Es(this,"_header",""),Es(this,"_label","videos"),Es(this,"_point",void 0),Es(this,"_mode",void 0),Es(this,"_forceDowngrade",!1),Es(this,"_isLoop",!1),this._playlist=t,this._mode=e.mode,this._header=e.title,this._label=e.label,this._point=e.forcePoint,this._isLoop=e.loop,this._onResize=this._onResize.bind(this),this._onFullScreenChanged=this._onFullScreenChanged.bind(this),this._gotoNextTrack=this._gotoNextTrack.bind(this),this._gotoPrevTrack=this._gotoPrevTrack.bind(this),e.bus.on("resizeplayer",this._onResize),e.bus.on("nexttrack",this._gotoNextTrack),e.bus.on("prevtrack",this._gotoPrevTrack),e.bus.on("fullscreenchanged",this._onFullScreenChanged),this.render(),this.addEvent(this.$left,"click",()=>this.slideLeft(250)),this.addEvent(this.$right,"click",()=>this.slideRight(250))}isBottom(){return!!this._forceDowngrade||"bottom"===this._mode}_gotoNextTrack(){let t=O(this.$items,this._current),e=this.$items[++t];this._isLoop&&!e&&(e=this.$items[0]),Vs(e,"click")}_gotoPrevTrack(){let t=O(this.$items,this._current);const e=this.$items[--t];e&&Vs(e,"click")}render(){this.$wrapper=w("div",{class:`${Ms} ${this._header?"":As}`}),this.$header=w("h3",{class:Fs,title:this._header},this.$wrapper),this.$header.textContent=this._header,this.$of=w("span",{class:zs},this.$wrapper),this.$currentTitle=w("span",{class:Ns},this.$wrapper),this.$element=w("div",{class:Ls,tabindex:-1},this.$wrapper);const t={type:"button",class:Ds,style:"display: none;"};this.$left=w("button",t,this.$wrapper),Yt(this.$left,Wt),this.$left.setAttribute("aria-label","Scroll left"),this.$right=w("button",{type:"button",class:Bs},this.$wrapper),Yt(this.$right,qt),this.$right.setAttribute("aria-label","Scroll right");const e=F(this._playlist);c(this._playlist,t=>{const n=this._renderItem(t);t===e&&(this._changeSource(e),this._changeCurrent(n)),this.$items.push(n)})}_changeSource(t){this.bus.emit("changesource",t),this.bus.emit("changeplaylistmode",this.isBottom()?"bottom":"right");const e=this._playlist.indexOf(t)+1;this.$of.textContent=`${e}/${this._playlist.length} ${this._label}`,this.$currentTitle.textContent=t.title,this.$currentTitle.setAttribute("title",t.title)}_changeCurrent(t){this._current&&E(this._current,js),S(t,js),this._current=t,this._stablePlaylist()}_stablePlaylist(){if(!this._current)return;const t=this._current.getBoundingClientRect();if(this.isBottom()){if(this.$left){const e=this.$left.getBoundingClientRect();e.right>t.left&&this.slideLeft(e.right-t.left)}if(this.$right){const e=this.$right.getBoundingClientRect();e.left<t.right&&this.slideRight(t.right-e.left)}}else{const e=this.$element.getBoundingClientRect();this.$element.scrollTop-=Math.max(0,e.top-t.top),this.$element.scrollTop+=Math.max(0,t.bottom-e.bottom)}}_renderItem(t){const e=w("div",{class:Os,title:t.title,tabindex:0},this.$element),n=w("div",{class:Rs},e);w("img",{src:t.poster},n),w("span",{class:Hs},e).textContent=t.title,w("b",{},e);const i=()=>{T(e,js)||(this._changeSource(t),this._changeCurrent(e))};return this.addEvent(e,"click",i),this.addEvent(e,"keydown",t=>{32===t.keyCode&&(t.preventDefault(),i())}),e}_onResize(t){const{outerWidth:e}=t;this._forceDowngrade!==e<this._point&&(this._forceDowngrade=!this._forceDowngrade,this.bus.emit("changeplaylistmode",this.isBottom()?"bottom":"right"),this.$wrapper.style.height="",this.$element.style.width="",this.$element.style.marginLeft="",this._stablePlaylist()),this.isBottom()?this._resize4bottom(t):this._resize4right(t)}_resize4right({height:t}){if(this.$wrapper.style.height=`${t}px`,!this._current)return;const e=this._current.getBoundingClientRect(),n=this.$element.getBoundingClientRect();n.top>e.top?this.$element.scrollTop=this.$element.scrollTop-(n.top-e.top):n.bottom<e.bottom&&(this.$element.scrollTop=this.$element.scrollTop+e.bottom-n.bottom)}_resize4bottom({width:t}){c(this.$items,t=>{t.style.width=""}),this.$element.style.width=`${t}px`,t=0,c(this.$items,e=>{t+=e.offsetWidth;const n=e.currentStyle||window.getComputedStyle(e);t+=parseFloat(n.marginRight)}),this.$element.style.width=`${t}px`,this._stableBottomPosition()}_stableBottomPosition(){if(!this._current)return;const t=this._current.getBoundingClientRect(),e=this.$wrapper.getBoundingClientRect();e.left>t.left?(Vs(this.$left,"click"),setTimeout(()=>this._stableBottomPosition())):e.right<t.right&&(Vs(this.$right,"click"),setTimeout(()=>this._stableBottomPosition()))}_onFullScreenChanged(t){this.$element.style.display=t?"none":"block"}slideLeft(t){let e=parseInt(this.$element.style.marginLeft,10)||0;e=Math.min(0,e+t),this.$element.style.marginLeft=`${e}px`,this.$right.style.display="block",e||(this.$left.style.display="none")}slideRight(t){const e=this.$element.parentNode;if(!(e instanceof HTMLElement))return;let n=parseInt(this.$element.style.marginLeft,10)||0;n-=t;const i=e.offsetWidth-this.$element.offsetWidth;n=Math.max(i,n),this.$element.style.marginLeft=`${n}px`,this.$left.style.display="block",n===i&&(this.$right.style.display="none")}getElement(){return this.$wrapper}destroy(){super.destroy(),this.bus.off("resizeplayer",this._onResize),this.bus.off("nexttrack",this._gotoNextTrack),this.bus.off("prevtrack",this._gotoPrevTrack),this.bus.off("fullscreenchanged",this._onFullScreenChanged),this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element),this.$items.length=0,this._playlist.length=0,this._current=null}}function Vs(t,e){let n;document.createEvent?(n=document.createEvent("HTMLEvents"),n.initEvent(e,!0,!0)):(n=document.createEventObject(),n.eventType=e),n.eventName=e,t.dispatchEvent?t.dispatchEvent(n):t.fireEvent("on"+e,n)}class Us{constructor(){var t,e,n;t=this,n={},(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e="_events"))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}on(t,e){this._events[t]=this._events[t]||[],this._events[t].push(e)}off(t,e){this._events=this._events||{},t in this._events!=0&&R(this._events[t],e)}once(t,e){const n=(...i)=>{this._call(e,i),this.off(t,n)};this.on(t,n)}emit(t,...e){if("*"!==t&&this.emit.apply(this,["*",t].concat(e)),this._events=this._events||{},t in this._events!=0)for(let n=this._events[t].length-1;n>=0;n--)this._call(this._events[t][n],e)}destroy(){this._events={}}_call(t,e){if(t._safe_inner)t.apply(this,e);else try{t.apply(this,e)}catch(t){console.error(t)}}}function Ws(t){return window.console?function(...e){t in console&&o(console[t])&&(e.unshift((new Date).toString()),console[t].apply(console,e))}:d}function qs(t=2){let e=1;const n={};return n.debug=++e>t?Ws("debug"):d,n.log=++e>t?Ws("log"):d,n.warn=++e>t?Ws("warn"):d,n.error=++e>t?Ws("error"):d,n}function Gs(){return!!navigator.userAgent.match(/Android/i)}function Qs(){return Gs()||Q()||!!navigator.userAgent.match(/(IEMobile|Windows Phone)/i)}function Ys(){const t=navigator.userAgent.toLowerCase();return-1!==t.indexOf("msie")&&parseInt(t.split("msie")[1],10)}function Zs(){return 8===Ys()}const Ks={annotations:null,chapters:null,cc:null,preview:null,poster:null,title:"",nextTrackTitle:"",nextTrackThumbnails:"",clip:null,isAudio:!1},Js=["audio/mp3","audio/mpeg","audio/mp4"];function Xs(t,e){const n={showAnnotations:!b((e=H({},Ks,t,e)).showAnnotations)||e.showAnnotations,showQuality:!b(e.showQuality)||e.showQuality,showPlaceholder:!b(e.showPlaceholder)||e.showPlaceholder};var i;return n.showPoster=e.showPoster&&b(e.poster),e.showHelp&&(n.showHelp=function(){const t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))}()),i=e.type,(a(Js,i)||e.isAudio)&&(n.showFullScreen=!1,n.showClosedCaptions=!1,n.showTOC=!1,n.showAnnotations=!1,n.showQuality=!1,n.isAudio=!0),Qs()&&(n.showVolume=!1,n.showQuality=!1,n.showHelp=!1,n.preview=null,n.showTitle=!1,n.showCCLayout=!1,n.isMobile=!0,n.extensionsVisibilityTimeout=4e3),Gs()&&(n.showPlaybackRate=!1),Zs()&&(n.showCCLayout=!1,n.useMux=!1),!e.startTime&&Q()&&(n.startTime=.5),f(e.annotations)&&(n.showAnnotations=!1),e.startTime&&!n.isAudio&&(n.showPoster=!1),st(e),e.showAnnotations&&(n.showAnnotations=b(e.annotations)&&$(e.annotations)),!1===n.showAnnotations&&!1===n.showPlaybackRate&&!1===n.showQuality&&(n.showSettings=!1,e.showSettings=!1),n.showDownloadCC=e.showDownloadCC&&b(e.cc)&&$(e.cc),e.showDownloadVideo&&(n.showDownloadVideo=!!navigator.userAgent.match(/(Windows NT 10)/i)&&b(e.downloadURL)&&$(e.downloadURL)),n.showDownload=e.showDownload&&(n.showDownloadVideo||n.showDownloadCC||!!e.downloadVideoURL),n.showCaptionSearch=e.showCaptionSearch&&b(e.cc)&&$(e.cc),e.showExtensions||(n.showPlay=!1,n.showProgress=!1,n.showVolume=!1,n.showFullScreen=!1,n.showClosedCaptions=!1,n.showTOC=!1,n.showAnnotations=!1,n.showQuality=!1,n.showPoster=!1,n.showPlaceholder=!1,n.showPlaybackRate=!1,n.showForward=!1,n.showBackward=!1,n.showSettings=!1,n.showDownload=!1,n.showHelp=!1,n.showTitle=!1,n.showNext=!1),H(e,n)}const to="bottom",eo="right",no="auto",io=[no,to,eo],so={loggerLevel:2,timecode:0,frameRate:23.976,autoStart:!1,startTime:null,endTime:null,useNativeControls:!1,useOriginTimeForPreview:!0,playlistmode:no,playlistAutoGoNext:!0,playlistitle:"",playlistforcepoint:0,showExtensions:!0,alwaysShowExtensions:!1,extensionsVisibilityTimeout:2e3,showPlay:!0,showProgress:!0,showVolume:!0,showFullScreen:!0,showClosedCaptions:!0,showTOC:!0,showAnnotations:!0,showQuality:!0,showAudioTracks:!1,showPoster:!0,showError:!1,showPlaceholder:!0,showPlaybackRate:!0,showForward:!0,showBackward:!0,showSettings:!0,showDownload:!0,showDownloadVideo:!0,showDownloadCC:!1,showBottomNext:!1,showBottomPrev:!1,showCaptionSearch:!1,showCrawl:!1,crawl:null,downloadVideoURL:null,showHelp:!0,showTitle:!0,showNext:!1,showNextFrame:!1,showPrevFrame:!1,showCCLayout:!0,showTheaterMode:!1,useMux:!1,showSubtitles:!1,skipDelta:10,keyboardListeners:{},globalKeyboardListeners:!1,isHandlingKeyboardEvents:!0,bufferingTimeout:200,hls:{maxFragLookUpTolerance:.001,maxMaxBufferLength:60},shaka:{},mux:{env_key:"",page_type:"watchpage",viewer_user_id:"",experiment_name:"",sub_property_id:"",player_name:"RavnurPlayer",player_version:"3.3.3",player_init_time:"",video_id:"",video_title:"",video_series:"",video_producer:"",video_content_type:"",video_language_code:"",video_variant_name:"",video_variant_id:"",video_duration:"",video_stream_type:"on-demand",video_encoding_variant:"",video_cdn:""},i18n:null,hlsjsURL:"https://cdn.jsdelivr.net/npm/hls.js@1.5.17/dist/hls.min.js",shakaURL:"https://cdn.jsdelivr.net/npm/shaka-player@4.16.10/dist/shaka-player.compiled.min.js",muxURL:"https://src.litix.io/core/4/mux.js",disableAutoUrlRewrite:!1,useHTMLPlayer:!1,useHLSJSPlayer:!1},oo={accentColor:"#81d4fa",mainColor:"#fff",submenuBgColor:"#eee",submenuColor:"#333",chaptersBubbleColor:"#1565C0",pltHeight:"135px",rplaylistHeight:"30%"};const ro={label:"None",srclang:"",src:"",state:2},ao={color:"fontcolor",bgcolor:"bgcolor",fontSize:"fontsize",fontFamily:"fontfamily",location:"cc_location",lang:"cclang"},lo="toclang",ho={theaterchanging:(t,e)=>H({},e,{isTheaterMode:!e.isTheaterMode}),fullscreenchanging:(t,e,n)=>H({},e,{isFullScreen:"boolean"==typeof n?n:!e.isFullScreen}),cclang(t,e,n){const i=e.cc.sources,s=i[Math.max(O(i,t=>t.srclang===n),0)];if(!s)return e;2===s.state&&oe(ao.lang,n);const o=H({},e.cc,{lang:n,loading:!1}),r=H({},e,{cc:o});return t.emit("captionschange",s),s.srclang&&(r.cc.loading=!0,fo(t,"refreshcaptions",s)),e.cc.lang&&n||t.emit("cclayoutchange",{mode:n&&e.cc.location||"over",fontSize:e.cc.fontSize}),r},ccsources(t,e,n,i=!1){const s=yo(n,e.cc.lang);n=s.sources;const o=s.current&&s.current.srclang||"";i||setTimeout(()=>t.emit("cclang",o),5);const r=H({},e.cc,{sources:n,lang:o,timedata:[]});return H({},e,{cc:r})},refreshcaptions(t,e,n,i){const s=H({},e.cc,{timedata:n});return s.timedataLang=i,s.loading=!1,H({},e,{cc:s})},cclocation(t,e,n){oe(ao.location,n),t.emit("cclayoutchange",{mode:e.cc.lang&&n||"over",fontSize:e.cc.fontSize});const i=H({},e.cc,{location:n});return H({},e,{cc:i})},ccfontfamily(t,e,n){oe(ao.fontFamily,n);const i=H({},e.cc,{fontFamily:n});return H({},e,{cc:i})},ccfontsize(t,e,n){oe(ao.fontSize,n),t.emit("cclayoutchange",{mode:e.cc.lang&&e.cc.location||"over",fontSize:n});const i=H({},e.cc,{fontSize:n});return H({},e,{cc:i})},ccbgcolor(t,e,n){oe(ao.bgcolor,n);const i=H({},e.cc,{bgcolor:n});return H({},e,{cc:i})},cccolor(t,e,n){oe(ao.color,n);const i=H({},e.cc,{color:n});return H({},e,{cc:i})},chaptersloaded(t,e,n,i){const s=H({},e.toc,{timedata:n});return s.timedataLang=i,H({},e,{toc:s})},tocsources(t,e,n){const i=mo(),s=yo(n,i.lang);i.sources=s.sources,i.lang=s.current&&s.current.srclang||"";const o=M(i.sources,t=>t.srclang===i.lang);if(o&&o.srclang)fo(t,"chaptersloaded",o);else{const e=1;fo(t,"chaptersloaded",M(i.sources,t=>!!t.default)||i.sources[e])}return H({},e,{toc:i})},changesource(t,e,n){const i=go(),s=yo(n.cc,i.lang);i.sources=s.sources,i.lang=s.current&&s.current.srclang||"";const o=M(i.sources,t=>t.srclang===i.lang);if(o&&o.srclang)fo(t,"refreshcaptions",o);else{const e=1;fo(t,"refreshcaptions",M(i.sources,t=>!!t.default)||i.sources[e])}const r=mo(),a=yo(n.chapters,r.lang);r.sources=a.sources,r.lang=a.current&&a.current.srclang||"";const l=M(r.sources,t=>t.srclang===r.lang);if(l&&l.srclang)fo(t,"chaptersloaded",l);else{const e=1;fo(t,"chaptersloaded",M(r.sources,t=>!!t.default)||r.sources[e])}return H({},e,{cc:i,toc:r})},toclang(t,e,n){const i=e.toc.sources,s=i[Math.max(O(i,t=>t.srclang===n),0)];2===s.state&&oe(lo,n);const o=H({},e.toc,{lang:n}),r=H({},e,{toc:o});return s.srclang&&fo(t,"chaptersloaded",s),r}},co={isFullScreen:!1,isTheaterMode:!1,cc:{color:"#FFF",bgcolor:"#000",fontSize:"100%",fontFamily:'Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif',location:"over",lang:null,sources:[],timedata:[],timedataLang:"",loading:!1},toc:{lang:null,sources:[],timedata:[],timedataLang:""}},po={};class uo extends V{constructor(t,e){var n,i,s;super(t,e),n=this,s=void 0,(i=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(i="_uid"))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,this._uid=x(),po[this._uid]=H({},co),po[this._uid].cc=go(),c(ho,(e,n)=>{"number"!=typeof n&&t.on(n,(...n)=>{const i=po[this._uid],s=e.apply(this,[t,i].concat(n));po[this._uid]=s,t.emit("statechanged",s,i)})})}isFullScreen(){return po[this._uid].isFullScreen}isTheaterMode(){return po[this._uid].isTheaterMode}getCCLang(){return po[this._uid].cc.lang}getCCTextColor(){return po[this._uid].cc.color}getCCBgColor(){return po[this._uid].cc.bgcolor}getCCFontSize(){return po[this._uid].cc.fontSize}getCCFontFamily(){return po[this._uid].cc.fontFamily}getCCLocation(){return po[this._uid].cc.location}getCCSources(){const t=po[this._uid].cc.sources||[];return Qs()?L(t,t=>3!==t.state):t}getCCTimeData(){return po[this._uid].cc.timedata}getCCTimeDataLang(){return po[this._uid].cc.timedataLang}getSelectedCC(){const t=po[this._uid],{sources:e,lang:n}=t.cc;return e[Math.max(O(e,t=>t.srclang===n),0)]}isTranslatingCC(){const t=po[this._uid],{sources:e,lang:n,loading:i}=t.cc,s=Math.max(O(e,t=>t.srclang===n),0);return i&&0===e[s].state}getTOCSources(){return po[this._uid].toc.sources}getTOCLang(){return po[this._uid].toc.lang}getTOCTimeData(){return po[this._uid].toc.timedata}getTOCTimeDataLang(){return po[this._uid].toc.timedataLang}}function go(){const t=H({},co.cc);return c(ao,(e,n)=>{t[n]=re(e,co.cc[n])}),t}function mo(){const t=H({},co.toc);return t.lang=re(lo,co.toc.lang),t}function bo(t){return H({},t,{state:"number"==typeof t.state?t.state:2})}function yo(t,e){const n=function(t){return t.sort((t,e)=>{const n="number"==typeof t.state?t.state:2,i="number"==typeof e.state?t.state:2;return n===i?t.label<e.label?-1:1:"number"==typeof n&&"number"==typeof i?i-n:0})}(A(t||[],bo)),i=n.length?[ro].concat(n):[];let s=M(i,t=>t.srclang===e&&0!==t.state);if(!s){const t=L(i,t=>0!==t.state),e=1;s=M(i,t=>!!t.default)||t[e]}return{sources:i,current:s||null}}function fo(t,e,n){if(!n||!n.src)return void t.emit(e,[]);const i=n.srclang,s=()=>t.emit(e,[],i);"json"===n.type?ut({url:n.src,success:n=>t.emit(e,JSON.parse(n.data),i),error:s}):yt(n.src,n=>t.emit(e,n,i),s)}function vo(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const $o="rplayer",xo=`${$o}--fullscreen`,_o=`${$o}--iphone`,wo=`${$o}--mobile`,Co=`${$o}--cc-75-below`,ko=`${$o}--cc-100-below`,To=`${$o}--cc-125-below`,So=`${$o}--cc-150-below`,Eo=`${$o}--cc-200-below`,Po=`${$o}__inner`,Lo=`${Po}--playing`,Mo=`${Po}--active`,Ao=`${Po}--hovering`,Fo=`${Po}--light`,zo=`${Po}--cc-below`,No=`${Po}--accessibility`,Oo="rmp-extensions",Ro=`${Oo}--hidden`,jo="last-play-time";let Ho,Do=!1,Bo=!1,Io=0;const Vo={[to]:`${$o}--bottom-playlist`,[eo]:`${$o}--right-playlist`};class Uo extends V{constructor(t,e={},n=qs()){super(new Us,n),vo(this,"controller",null),vo(this,"extensions",[]),vo(this,"state",void 0),vo(this,"_playlist",[]),vo(this,"originOptions",null),vo(this,"options",null),vo(this,"activeSourceId",void 0),vo(this,"$el",void 0),vo(this,"$inner",void 0),vo(this,"$extensionsWrapper",null),vo(this,"playlistController",null),vo(this,"_timerId",null),vo(this,"_isOpenPopup",!1),vo(this,"_clipStopInterval",null),vo(this,"_isPlaylist",!1),Do||(Ss(e=H({},oo,e),Zs()?t.getBoundingClientRect():null),Do=!0);const i=t;this.$el=w("div",{class:$o},i),P(this.$el,_o,Q()),P(this.$el,wo,Qs()),this.$inner=w("div",{class:Po},this.$el),ke(this,["onStateChanged","onFullScreenChanged","disappearExtensions","appearExtensions","_renderPlayer","onPlay","onPause","onEnded","onMouseMove","onClick","_disappearExtensionsDelayed","_appearExtensionsImmediately","onOpenPopup","onClosePopup","onPlayClicked","onChangePlaylistMode","onMouseEnter","onMouseLeave","onKeydown","onMobileTouch","_heartbeatExtension","_handleQualityChange","onTimeUpdate","_handleLastPlayTime"]),this.bus.on("statechanged",this.onStateChanged),this.bus.on("pause",this.onPause),this.bus.on("timeupdate",this.onTimeUpdate),this.bus.on("ended",this.onEnded),this.bus.on("play",this.onPlay),this.bus.on("changesource",this._renderPlayer),this.bus.on("showpopup",this.onOpenPopup),this.bus.on("hidepopup",this.onClosePopup),this.bus.on("handle-play-clicked",this.onPlayClicked),this.bus.on("changeplaylistmode",this.onChangePlaylistMode),this.bus.on("heartbeatextensions",this._heartbeatExtension),this.bus.on("manualquality",this._handleQualityChange),this.state=new uo(this.bus,n),Qs()?this.bus.on("mobiletouch",this.onMobileTouch):(this.addEvent(this.$el,"mouseleave",this.onMouseLeave),this.addEvent(this.$el,"mouseenter",this.onMouseEnter),this.addEvent(this.$el,"mousemove",this.onMouseMove),this.addEvent(this.$el,"keydown",this.onKeydown),this.addEvent(this.$el,"click",this.onClick)),at&&at.enabled&&(this.$el.addEventListener("webkitfullscreenchange",this.onFullScreenChanged),this.$el.addEventListener("fullscreenchange",this.onFullScreenChanged),document.addEventListener("mozfullscreenchange",this.onFullScreenChanged),document.addEventListener("MSFullscreenChange",this.onFullScreenChanged))}onMouseLeave(){E(this.$inner,Ao),this.disappearExtensions()}onMouseEnter(){S(this.$inner,Ao),this.appearExtensions()}onKeydown(t){Bo&&(clearInterval(Ho),Io=0,9===t.keyCode&&this.appearExtensions(),Ho=setInterval(()=>{Io++,Io>5&&(Io=0,this.disappearExtensions(),clearInterval(Ho))},1e3))}onPlay(){S(this.$inner,Lo),this.onMouseMove()}onPause(){this.originOptions&&!this.originOptions.playLoop&&(E(this.$inner,Lo),this.appearExtensions())}onEnded(){this.originOptions&&this.originOptions.playLoop?this.controller?.play():(E(this.$inner,Lo),this.appearExtensions())}onPlayClicked(){E(this.$inner,Fo)}onTimeUpdate(){const{activeSourceId:t,controller:e}=this;if(!this.originOptions||!e)return;const{savePlayTime:n}=this.originOptions,i=e.getDuration()<=15;let s=e.getCurrentTime();if(s<5||i)return;if(!n||!t)return;let o=re(jo,{});if(o=JSON.parse(o),!o.expires){const t=new Date;o.expires=(new Date).setMonth(t.getMonth()+1)}(new Date).getTime()>o.expires&&(o={},o.expires=(new Date).setMonth((new Date).getMonth()+1));const r=e.getDuration()-10;s=s<=r?s:r,o[t]=s,oe(jo,JSON.stringify(o))}isShownExtensions(){const{$extensionsWrapper:t}=this;if(!t)return!1;let e=!T(this.$inner,Ro);return e=e||T(this.$inner,Fo),e}onMobileTouch(){const{controller:t}=this;t&&this.isShownExtensions()&&(t.isPaused()?t.play():t.pause()),this._heartbeatExtension()}onMouseMove(){this._heartbeatExtension()}onClick(){this._heartbeatExtension()}_heartbeatExtension(){this._appearExtensionsImmediately(),this._isOpenPopup||this._disappearExtensionsDelayed()}onOpenPopup(){this._isOpenPopup=!0,S(this.$inner,Mo),this._appearExtensionsImmediately()}onClosePopup(){this._isOpenPopup=!1,E(this.$inner,Mo),this._disappearExtensionsDelayed()}_appearExtensionsImmediately(){this.appearExtensions(),this._timerId&&clearTimeout(this._timerId)}_disappearExtensionsDelayed(){const{originOptions:t}=this;t&&!t.alwaysShowExtensions&&(this._timerId=setTimeout(this.disappearExtensions,t.extensionsVisibilityTimeout))}_getParentElementForController(){const{controller:t}=this;if(!t)return null;const e=t.getElement();if(!e)return null;const n=e.parentNode;return n&&n instanceof HTMLElement?n:null}changeFullScreenMode(){if(!this._getParentElementForController()&&!Q())return;const t=this.state.isFullScreen();if(this.$inner.style.width="",this.$inner.style.height="",at&&at.enabled)t?at.request(this.$el):at.exit();else if(Q()&&this.controller)this.controller.getElement().webkitEnterFullscreen(),this.bus.emit("fullscreenchanging",!1);else{const n=this.$el.parentNode;if(!(n&&n instanceof HTMLElement))return;t?(S(n,xo),function(t){const e=function(){const t=document.documentElement;return t?t.clientWidth:null}(),n=function(){const t=document.documentElement;return t?t.clientHeight:null}();"number"==typeof e&&"number"==typeof n&&function(t,e,n){t.style.width=`${e}px`,t.style.height=`${n}px`}(t,e,n)}(n)):(E(n,xo),(e=n).style.width="",e.style.height=""),this.bus.emit("fullscreenchanged",t)}var e}onStateChanged(t,e){if(t.isFullScreen!==e.isFullScreen&&this.changeFullScreenMode(),t.cc.fontSize!==e.cc.fontSize||t.cc.location!==e.cc.location||t.cc.lang!==e.cc.lang){const e=t.cc.lang;e&&this.changeLayout(e,t.cc.fontSize,t.cc.location)}}onFullScreenChanged(){if(!at)return;const t=at.isFullscreen;this.bus.emit("fullscreenchanging",t);const e=this.$el.parentNode;e&&e instanceof HTMLElement&&P(e,xo,at.isFullscreen)}changeLayout(t,e,n){const i=t&&"below"===n;P(this.$inner,zo,i),P(this.$el,Co,i&&"75%"===e),P(this.$el,ko,i&&"100%"===e),P(this.$el,To,i&&"125%"===e),P(this.$el,So,i&&"150%"===e),P(this.$el,Eo,i&&"200%"===e)}_detectPlaylistMode(){const{originOptions:t}=this;if(!t)return"auto";let e=t.playlistmode;return e=a(io,e)?e:F(io),e===no&&(e=Qs()?to:eo),e}setup(t,e={}){const n=b(e.loggerLevel)?e.loggerLevel:so.loggerLevel,s=e.logger||qs(n),o=H({bus:this.bus,logger:e.logger||s},so,e);if(Bo=e.accessibility||!1,Bo&&S(this.$inner,No),this.originOptions=o,this._isPlaylist=i(t),this._playlist=[].concat(t),!this._playlist.length)return void setTimeout(()=>{const t=this.$el.parentNode;t&&t instanceof HTMLElement&&(t.style.position="relative",t.style.border="1px solid grey"),this.destroy(),w("i",{class:"rmp-no-video"},t).textContent=ht(o.i18n,"no-video")},5);if(this._isPlaylist){const t=this._detectPlaylistMode();this.onChangePlaylistMode(t);const e=ht(o.i18n,"playlist-count-of"),n=o.playlistitle,i=o.playlistforcepoint,r=o.playLoop,a={mode:t,bus:this.bus,title:n,label:e,forcePoint:i,logger:s,loop:r};this.playlistController=new Is(this._playlist,a),o.hideplaylist||_(this.$el,this.playlistController.getElement()),(Object.keys(o).includes("plalistAutoGoNext")?o.plalistAutoGoNext:o.playlistAutoGoNext)&&this.bus.on("ended",()=>{this.bus.emit("nexttrack"),this._playOnLoad()})}this._isPlaylist&&!this.originOptions.hideplaylist||this.bus.emit("changesource",F(this._playlist)),this.bus.on("*",t=>o.logger.debug(t));const r=this.state,a=r.getCCLang()&&r.getCCLocation()||"over";this._afterSetup(),setTimeout(()=>{this.bus.emit("cclayoutchange",{mode:a,fontSize:r.getCCFontSize()})})}onChangePlaylistMode(t){this.originOptions&&!this.originOptions.hideplaylist&&c(Vo,(e,n)=>P(this.$el,e,n===t))}_runOnce(t){this.bus.once("canplaythrough",()=>setTimeout(t)),this.bus.once("loadedmetadata",()=>setTimeout(t))}_playOnLoad(){this._runOnce(()=>{const{controller:t}=this;t&&t.play()})}_afterSetup(){const{controller:t,originOptions:e}=this;if(!t||!e)return;const{autoStart:n,startTime:i,endTime:s}=e;n&&this._playOnLoad(),(i||s)&&this.playPart(i,s,!0)}_handleLastPlayTime(){if(!this.originOptions)return;const{savePlayTime:t,startTime:e}=this.originOptions,{activeSourceId:n}=this;if(e||!t||!n)return;let i=re(jo,"{}");if(!i)return;i=JSON.parse(i);const s=i[n];s&&this.playPart(s,void 0,!0)}playPart(t,e,n=!1){const{controller:i}=this;if(i){if("number"==typeof t)if(n){const e=t;this._runOnce(()=>i.setCurrentTime(e))}else i.setCurrentTime(t);if("number"==typeof e){const t=()=>{const n=i.getCurrentTime();"number"==typeof n&&"number"==typeof e&&n>e&&(i.pause(),this.bus.off("timeupdate",t))};this.bus.on("timeupdate",t)}n||i.play()}}_renderPlayer(t){if(!t.src)throw new Error("Incorrent load's options.");this.activeSourceId=t.id;const e=this.state.getCCLang();e&&this.changeLayout(e,this.state.getCCFontSize(),this.state.getCCLocation());let n={};if(this._isPlaylist&&this.originOptions&&!this.originOptions.hideplaylist){const e=O(this._playlist,t),i=this._playlist[e+1]||null,s=this._playlist[e-1]||null;n={showNext:b(i),nextTrackThumbnails:D(i,"poster",""),nextTrackTitle:D(i,"title",""),showPrev:b(s),prevTrackThumbnails:D(s,"poster",""),prevTrackTitle:D(s,"title","")}}const i=Xs(this.originOptions||{},H({},t,n));if(this.options=i,this.controller&&this.controller.destroy(),this.destroyExtensions(),s=i.type,a(tt,s)&&!Uo.canPlayHLS){const t=this.$el.parentNode;t&&t instanceof HTMLElement&&(t.style.position="relative",t.style.border="1px solid grey"),this.destroy();const e=w("i",{class:"rmp-no-video"},t);return void(this.originOptions&&(e.textContent=ht(this.originOptions.i18n||{},"no-video")))}var s;this._beforeRender(i);const o=function(t,e){const n=st(t);return new(0,it[n])(t,e)}(i,this.state);if(this.controller=o,_(this.$inner,o.$el),o.load(i),this._handleLastPlayTime(),i.useNativeControls)return;E(this.$inner,Lo),S(this.$inner,Fo),i.showCrawl&&S(this.$inner,"rmp-ext-crawl--exist");const r=w("div",{class:Oo},this.$inner);this.$extensionsWrapper=r,c(function(t,e,n){const i=[];return c(Ts,([s,o])=>{(!0===s||"string"==typeof s&&!0===n[s])&&i.push(new o(t,e,n))}),i}(o,this.state,i),t=>{try{const e=t.getElement();e&&(_(r,e),t.addEvent(e,"dblclick",Wo));const n=t.getOuter();n&&_(this.$inner,n,r),this.extensions.push(t)}catch(t){i.logger.error(t)}})}_beforeRender({clip:t,timecode:e}){if(this._clipStopInterval&&clearInterval(this._clipStopInterval),t){const[n,i]=t;n&&this._runOnce(()=>{this.controller&&this.controller.setCurrentTime(n)}),i&&(this._clipStopInterval=setInterval(()=>{const t=this.controller;t&&!t.isPaused()&&t.getCurrentTime()>i+(e||0)&&(t.pause(),setTimeout(()=>this.bus.emit("ended")))},26))}}_handleQualityChange(t){this.originOptions&&(this.originOptions.qualityLevel=t)}refreshCrawlExtension(t,e=!0){if(!this.originOptions)return;if(this.originOptions.logger.debug("crawl:extensions:refreshing"),!t)throw new Error("Crawl options not found");const n=this.extensions.find(t=>"$crawl"in t);if(!n){this.originOptions.logger.debug("crawl:extensions:creating");const e=H({},this.originOptions,{crawl:t}),n=new vs(this.controller,this.state,e),i=n.getOuter();return i&&_(this.$inner,i,this.$extensionsWrapper),void this.extensions.push(n)}this.logger.debug("crawl:extensions:refreshing"),n.refresh(t,e)}destroyExtensions(){c(this.extensions,t=>t.destroy()),this.extensions.length=0;const{$extensionsWrapper:t}=this;if(t&&n(t)){const e=t.parentNode;e&&e.removeChild(t)}}disappearExtensions(){const{originOptions:t,$inner:e}=this;if(!t||!e)return;const n=t.alwaysShowExtensions;this.controller&&(n||this._isOpenPopup||this.controller.isPaused())||S(e,Ro)}appearExtensions(){E(this.$inner,Ro)}on(t,e){this.bus.on(t,e)}off(t,e){this.bus.off(t,e)}destroy(){super.destroy(),this.bus.destroy(),this._clipStopInterval&&clearInterval(this._clipStopInterval),this.destroyExtensions();const{controller:t}=this;t&&(t.pause(),t.destroy()),this.controller=null,at&&at.enabled&&(this.$el.removeEventListener("webkitfullscreenchange",this.onFullScreenChanged),this.$el.removeEventListener("fullscreenchange",this.onFullScreenChanged),document.removeEventListener("mozfullscreenchange",this.onFullScreenChanged),document.removeEventListener("MSFullscreenChange",this.onFullScreenChanged)),this.playlistController&&this.playlistController.destroy();const e=this.$el.parentNode;this.$el.removeChild(this.$inner),e&&e.removeChild(this.$el)}static addStyles(t){Ss(H({},oo,t))}}function Wo(t){t.stopPropagation()}vo(Uo,"canPlayHLS",!(Ys()||window.MSInputMethodContext&&document.documentMode));const qo=Uo;exports.RavnurMediaPlayer=e.default})();
1
+ (()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var e={};function n(t){try{return t instanceof Element}catch(e){return!!t.nodeName}}function i(t){return Array.isArray(t)}function s(t){return null!==t&&"object"==typeof t&&!1===i(t)}function o(t){return"function"==typeof t}function r(t){return"string"==typeof t}function a(t,e){return r(t)&&r(e)?(n=e,t.indexOf(n)>-1):function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(t,o(e)?e:t=>t===e);var n}t.d(e,{default:()=>qo});const l=Object.prototype.hasOwnProperty;function h(t,e){return l.call(t,e)}function c(t,e){t instanceof Array?function(t,e){for(let n=0;n<t.length;n++)e(t[n],n,t)}(t,e):function(t,e){for(const n in t)h(t,n)&&e(t[n],n,t)}(t,e)}function p(t,e,n=null){return c(t,(t,i,s)=>{n=e(n,t,i,s)}),n}function u(t,e){return t===e||(i(t)&&i(e)?t.length===e.length&&p(t,(t,n)=>t&&a(e,n),!0):!(!s(t)||!s(e))&&(!!u(Object.keys(t),Object.keys(e))&&p(t,(t,n,i)=>t&&u(n,e[i]),!0)))}function d(){}const g=Number.MAX_VALUE;function m(t,e=0,n=g){return t>=e&&t<n}function b(t){return null!=t}function y(t){return e=>!t(e)}const f=y(b);function v(t){return f(t)||t instanceof Array&&!t.length||"string"==typeof t&&!t.length}const $=y(v);function x(){return"rav_id_xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})}function _(t,e,i){t&&(b(i)&&n(i)?t.insertBefore(e,i):t.appendChild(e))}function w(t,e={},i=null,s="http://www.w3.org/1999/xhtml"){let o;return o=b(document.createElementNS)?document.createElementNS(s,t):document.createElement(t),c(e,(t,e)=>{o.setAttribute(e,t)}),b(i)&&n(i)&&_(i,o),o}function C(t,e,n,i=!1){return t.addEventListener?(t.addEventListener(e,s,i),{elem:t,handler:s,event:e}):(t.attachEvent("on"+e,o),{elem:t,handler:o,event:e});function s(e){const i=n.apply(t,arguments);return!1===i&&(e.stopPropagation(),e.preventDefault()),i}function o(){const e=n.call(t,window.event);return!1===e&&(window.event.returnValue=!1,window.event.cancelBubble=!0),e}}function k(t){t.elem.removeEventListener?t.elem.removeEventListener(t.event,t.handler):t.elem.detachEvent("on"+t.event,t.handler)}function T(t,e){return!!t&&!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function S(t,e){T(t,e)||(t.className+=" "+e)}function E(t,e){if(T(t,e)){const n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ").trim()}}function P(t,e,n){let i=n;f(n)&&(i=!T(t,e)),i?S(t,e):E(t,e)}function L(t,e=$){const n=[];return c(t,t=>{e(t)&&n.push(t)}),n}function M(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(e(i))return i}return null}function A(t,e){const n=[];return c(t,(t,i,s)=>n.push(e(t,i,s))),n}function F(t){return t[0]}function z(t){return t[t.length-1]}function N(t){return t[0]}function O(t,e){const n=o(e)?e:t=>t===e;for(let e=0;e<t.length;e++)if(n(t[e]))return e;return-1}function R(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}function j(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n]);return e}function H(t,...e){return c(e,e=>{f(e)||c(e,(e,n)=>{t[n]=e})}),t}function D(t,e="",n=null){const i=e.split(".");for(;b(t)&&i.length;)t=t[i.shift()];return b(t)?t:n}function B(t,e,n,i){const s=t[e],o=()=>n.apply(t,[s]),r=e=>i.apply(t,[e]);if(Object.defineProperty)Object.defineProperty(t,e,{get:o,set:r});else if(t.__defineGetter__)t.__defineGetter__(e,o),t.__defineSetter__(e,r);else{const n=i=>{i.propertyName===e&&(t.detachEvent("onpropertychange",n),r(t[e]),t[e]=o,t[e].toString=()=>o().toString(),t.attachEvent("onpropertychange",n))};try{t[e]=o,t[e].toString=()=>o().toString()}catch(t){}t.attachEvent("onpropertychange",n)}}function I(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class V{constructor(t,e){I(this,"_tokens",[]),I(this,"bus",void 0),I(this,"logger",void 0),this.bus=t,this.logger=e}addEvent(t,e,n,i=!1){const s=C(t,e,n,i);this._tokens.push(s)}destroy(){c(this._tokens,k),this._tokens.length=0}}function U(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const W=1e3;class q extends V{constructor(t,e){super(t.bus,t.logger),U(this,"options",void 0),U(this,"state",void 0),U(this,"$el",void 0),this.state=e,this.logger.debug("player:created"),this.options=t,setTimeout(()=>this.getElement().setAttribute("tabindex","-1"))}focus(){let t=this.getElement();this.options.isAudio&&(t=t.parentNode.parentNode),t&&t instanceof HTMLElement&&t.focus()}getTimeCode(){return this.options.timecode}getCurrentTime(){return this.getElement().currentTime+this.getTimeCode()}setCurrentTime(t,e=!0){if(!this.getElement())return;t-=this.getTimeCode();const{clip:n}=this.options;if(n){let[e,i]=n;e=e||0,i=i||this.getElement().duration,t=Math.max(t,e),t=Math.min(t,i)}this.getElement().currentTime=t,e||this.focus()}nextFrame(){const t=this._getFrameDuration();let e=this.getElement().currentTime,n=Math.floor(e*W/t);e=Math.ceil(++n*t)/W,this.setCurrentTime(e+this.getTimeCode())}prevFrame(){const t=this._getFrameDuration();let e=this.getElement().currentTime,n=Math.floor(e*W/t);e=Math.ceil(--n*t)/W,this.setCurrentTime(e+this.getTimeCode())}isPaused(){return!!this.getElement()&&this.getElement().paused}isEnded(){if(!this.getElement())return!1;const{clip:t}=this.options;if(t){const e=this.getElement().duration;let[n,i]=t;return i=i||e,i+=this.getTimeCode(),this.getCurrentTime()>=i}return this.getElement().ended}play(t=!0){this.bus.emit("handle-play-clicked"),t||this.focus();const{clip:e}=this.options;if(this.isEnded()&&e){const[t]=e;this.setCurrentTime(t||0)}return this.getElement().play()}pause(t=!0){t||this.focus(),this.getElement().pause()}getDuration(){if(!this.getElement())return null;let t=this.getElement().duration;const{clip:e}=this.options;if(e){let[n,i]=e;n=n||0,i=i||t,t=i-n}return t+this.getTimeCode()}isMuted(){return this.getElement().muted}setMuted(t,e=!0){this.getElement().muted=t,e||this.focus()}getVolume(){return this.getElement().volume}setVolume(t,e=!0){this.getElement().volume=t,e||this.focus()}destroy(){this.logger.debug("player:destroy"),super.destroy()}getLevels(){throw new Error("You must override it")}getLevel(){throw new Error("You must override it")}setLevel(t){throw new Error("You must override it")}goToLive(){throw new Error("You must override it")}setPlaybackRate(t){throw new Error("You must override it")}isLive(){return!1}isMultiAudioTracks(){return this.getAudioTracks().length>1}getAudioTracks(){return[]}getAudioTrack(){return 0}setAudioTrack(t){}getTextTracks(){}load(t){throw new Error("You must override it")}isMultiQuality(){return this.getLevels().length>1}getBufferedPercent(){return 0}getElement(){throw new Error("You must override it")}_getFrameDuration(){return W/this.options.frameRate}}const G=["loadstart","progress","suspend","abort","error","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"];function Q(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}function Y(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Z extends q{constructor(t,e){super(t,e),Y(this,"$el",void 0),Y(this,"source",null),Y(this,"_levels",[]),Y(this,"_currentLevel",null),this.logger.debug("html:player:creating");let n="video";const i={id:x(),tabindex:-1};t.disableAutoFullScreenOnIOS&&(i["webkit-playsinline"]=!0,i.playsinline=!0),t.isMobile&&(i.preload="metadata",n=t.isAudio?"audio":"video"),this.$el=w(n,i),c(G,t=>{this.addEvent(this.$el,t,e=>{this.logger.debug("triggered event",t),this.bus.emit(t,e)})}),this.handleFullscreenChanging=this.handleFullscreenChanging.bind(this),this.handleWebkitEndFullscreen=this.handleWebkitEndFullscreen.bind(this),Q()&&this.bus.on("fullscreenchanging",this.handleFullscreenChanging),this.logger.debug("html:player:created")}load({type:t,src:e,cc:n}){let s={type:t,src:e};if(this.options.isMobile&&"audio/mp3"===t&&(s={src:e}),i(e)){if(this._levels=e,this.options.qualityLevel){const t=parseInt(this.options.qualityLevel,10);t&&(this._currentLevel=M(this._levels,e=>parseInt(e.name,10)===t))}this._currentLevel=this._currentLevel||M(this._levels,t=>t.default),this._currentLevel=this._currentLevel||N(this._levels),s.src=this._currentLevel.src}this.logger.debug("html:player:loading",e),this.source=w("source",s),this.source.addEventListener("error",t=>{this.bus.emit("error",t),this.logger.error(t)}),_(this.$el,this.source),Q()&&n&&c(n,t=>{3!==t.state&&"json"!==t.type&&_(this.$el,w("track",t))}),this.$el.audioTracks&&(this.$el.audioTracks.onchange=()=>{this.bus.emit("audiotrackswitched")}),this.$el.addEventListener("webkitendfullscreen",this.handleWebkitEndFullscreen),Q()&&this.bus.once("loadeddata",()=>{const t=this.getTextTracks();t instanceof TextTrackList&&t.addEventListener("change",()=>{const e=M(t,t=>"showing"===t.mode);e&&this.bus.emit("cclang",e.language)}),this.handleWebkitEndFullscreen()})}getLevels(){return this._levels}setLevel(t){const e=this.$el.currentTime,n=this.$el.paused;this._currentLevel=t,this.$el.pause(),this.source&&(this.source.src=t.src),this.bus.once("loadedmetadata",()=>{this.$el.currentTime=e,n||this.$el.play()}),this.$el.currentTime=e,this.$el.load()}setPlaybackRate(t){this.$el.playbackRate=t,this.$el.defaultPlaybackRate=t}getLevel(){return this._currentLevel}getElement(){return this.$el}getBufferedPercent(){const t=this.$el;return t&&t.buffered&&t.buffered.length>0&&t.buffered.end&&t.duration?t.buffered.end(t.buffered.length-1)/t.duration:0}getAudioTrack(){return O(this.getAudioTracks(),t=>t.enabled)}getAudioTracks(){return this.$el.audioTracks||[]}setAudioTrack(t){c(this.getAudioTracks(),(e,n)=>{e&&"object"==typeof e&&(e.enabled=n==t)})}getTextTracks(){return this.$el.textTracks||[]}handleFullscreenChanging(t){const e=!0!==t?this.state.getCCLang():"__";this._textTrackWalker(t=>t.language===e?"showing":"disabled")}handleWebkitEndFullscreen(){this.handleFullscreenChanging(this.$el.webkitDisplayingFullscreen)}_textTrackWalker(t){c(this.getTextTracks(),e=>{e&&"object"==typeof e&&(e.mode=t(e))})}destroy(){this.$el.removeEventListener("webkitendfullscreen",this.handleWebkitEndFullscreen),this.bus.off("fullscreenchanging",this.handleFullscreenChanging),super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null,this.source=null}}const K={name:"Auto"},J={maxFragLookUpTolerance:.5,maxMaxBufferLength:600,highBufferWatchdogPeriod:3,playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:10,retryDelayMs:3e3,maxRetryDelayMs:8e3}}}};const X={name:"Auto"},tt=["application/x-mpegURL","vnd.apple.mpegURL","application/vnd.apple.mpegurl"],et="HTML5",nt="Shaka",it={};function st(t){const{type:e,logger:n}=t;return t.useHTMLPlayer?(n?.debug("Using html player for type: ",e),et):function(){const t=window.ManagedMediaSource||window.MediaSource||window.WebKitMediaSource;return b(t)&&o(t.isTypeSupported)&&t.isTypeSupported("video/mp4; codecs=avc1.42E01E,mp4a.40.2")}()&&(t.useHLSJSPlayer||t.isLive)?(n?.debug("Using hlsjs player for type: ",e),"HLS"):(n?.debug("Using shaka player for type: ",e),nt)}it.HLS=class extends Z{constructor(t,e){var n,i,s;super(t,e),n=this,s=void 0,(i=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(i="hls"))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,this.logger.debug("hls:player:created")}load({src:t}){let e=i(t)?F(t):t;e=s(e)?e.src:e,this.logger.debug("hls:player:loading",e),b(window.Hls)?this._attachMedia(e):this._loadLibraryAndAttachMedia(e)}_loadLibraryAndAttachMedia(t){if("function"==typeof window.define&&window.define.amd)window.require.config({paths:{hlsjs:this.options.hlsjsURL}}),window.require(["hlsjs"],e=>{window.Hls=e,this._attachMedia(t)});else{const e=w("script",{src:this.options.hlsjsURL}),n=N(Array.from(document.getElementsByTagName("script")));if(e.onload=e.onreadystatechange=()=>this._attachMedia(t),!n||!n.parentNode)return;n.parentNode.insertBefore(e,n)}}_attachMedia(t){const e=window.Hls;if(e.isSupported())if(this.hls=new e(H(J,this.options.hls)),this.hls.loadSource(t),this.hls.attachMedia(this.$el),this.hls.on(e.Events.ERROR,(t,e)=>{this.bus.emit("error",e),this.logger.error(e)}),this.hls.on(e.Events.AUDIO_TRACK_SWITCHED,()=>{this.bus.emit("audiotrackswitched")}),this.hls.on(e.Events.MANIFEST_PARSED,(t,e)=>{if(this.options.showSubtitles||(this.hls.subtitleDisplay=!1),this.options.qualityLevel){const t=parseInt(this.options.qualityLevel,10);if(t){const n=M(e.levels,e=>e.height===t);n&&this.setLevel(n)}}if(this.options.maxQualityLevel&&this.limitLevel(this.options.maxQualityLevel),this.options.startLevel){const t=parseInt(this.options.startLevel,10);if(t){const n=O(e.levels,e=>e.height===t);this.hls.startLevel=n}}}),this.hls.on(e.Events.BUFFER_CREATED,()=>{this.options.isLive&&this.goToLive()}),this.options.aesToken){let t;this.hls.config.xhrSetup=(e,n)=>{e.addEventListener("load",()=>{if("string"==typeof e.response&&e.response.indexOf("#EXTM3U")>=0){const i=e.response.split("\n").find(t=>0===t.indexOf("#EXT-X-KEY")),s=i?.split('URI="')[1].split('"')[0],o="https://"+n.split("/")[2];s&&(t=o+s)}}),n===t&&e.setRequestHeader("Authorization","Bearer "+this.options.aesToken)}}else{const e=t.split("?")[1];e&&(this.hls.config.xhrSetup=(t,n)=>{t.open("GET",n+`?${e}`,!0)})}else this.logger.error("HLS is not supported for this browser")}goToLive(){this.hls.media&&(this.logger.debug("hls:player:live"),this.hls.media.currentTime=this.hls.liveSyncPosition||this.hls.media.duration-10)}isLive(){return this.hls?.liveSyncPosition?this.hls?.media.currentTime>=this.hls?.liveSyncPosition-10:this.hls?.media.currentTime>=this.hls?.media.duration-10}getLevels(){return[K].concat(this.hls.levels)}setLevel(t){const e=O(this.hls.levels,t);this.hls.currentLevel=e}limitLevel(t){const e=parseInt(t,10);if(e){const t=O(this.hls.levels,t=>t.height===e);this.hls.autoLevelCapping=t}}getLevel(){return this.hls.levels[this.hls.manualLevel]||K}isMultiQuality(){return this.hls.levels.length>1}getAudioTracks(){return this.hls.audioTracks}getAudioTrack(){return this.hls.audioTrack}getTextTracks(){return this.$el.textTracks||[]}setAudioTrack(t){this.hls.audioTrack=t}destroy(){this.hls.destroy(),super.destroy()}},it[et]=Z,it[nt]=class extends Z{constructor(t,e){var n,i,s;super(t,e),n=this,s=void 0,(i=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(i="shaka"))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,this.logger.debug("shaka:player:created")}load({src:t,type:e}){let n=i(t)?F(t):t;n=s(n)?n.src:n;let o=e;/format=mpd-time-csf/.test(n)&&Q()&&!this.options.disableAutoUrlRewrite&&(o="application/x-mpegurl",n=n.replace("format=mpd-time-csf","format=m3u8-cmaf")),this.onError=this.onError.bind(this),this.logger.debug("shaka:player:loading",n),this._loadLibraryAndAttachMedia(n,o)}_loadLibraryAndAttachMedia(t,e){if("function"==typeof window.define&&window.define.amd)window.require.config({paths:{shakajs:this.options.shakaURL}}),window.require(["shakajs"],n=>{window.shaka=n,this._attachMedia(t,e)});else{const n=w("script",{src:this.options.shakaURL}),i=N(Array.from(document.getElementsByTagName("script")));if(n.onload=n.onreadystatechange=()=>this._attachMedia(t,e),!i||!i.parentNode)return;i.parentNode.insertBefore(n,i)}}async _attachMedia(t,e){const n=this.options.shaka;if(window.shaka.polyfill.installAll(),window.shaka.Player.isBrowserSupported()){this.shaka=new window.shaka.Player,this.options.shaka&&this.shaka.configure(this.options.shaka),this.shaka.setTextTrackVisibility(!!this.options.showSubtitles),this.preselectQuality(),this.modifyRequests(t),this.options.maxQualityLevel&&this.limitLevel(this.options.maxQualityLevel),await this.configureDRM(),await this.shaka.attach(this.$el);const i=e.toLowerCase();await this.shaka.load(t,null,i).catch(this.onError),(new window.shaka.util.EventManager).listen(this.shaka,"error",t=>this.onError(t.detail)),this.shaka.configure(n)}else this.logger.error("Browser not supported!")}async configureDRM(){const t={};if(this.options.widevineURL&&(t["com.widevine.alpha"]=this.options.widevineURL),this.options.playreadyURL&&(t["com.microsoft.playready"]=this.options.playreadyURL),this.options.fairplayURL&&(t["com.apple.fps.1_0"]=this.options.fairplayURL),this.shaka.configure({drm:{servers:t}}),this.options.fairplayCertificateUrl){const t=await fetch(this.options.fairplayCertificateUrl),e=await t.arrayBuffer();this.shaka.configure("drm.advanced.com\\.apple\\.fps\\.1_0.serverCertificate",new Uint8Array(e)),window.shaka.polyfill.PatchedMediaKeysApple.install();const n=window.shaka.util.FairPlayUtils;this.shaka.getNetworkingEngine().registerRequestFilter(n.ezdrmFairPlayRequest),this.shaka.getNetworkingEngine().registerResponseFilter(n.commonFairPlayResponse),this.shaka.configure("drm.initDataTransform",n.ezdrmInitDataTransform)}}onError(t){this.bus.emit("error",t),this.logger.error(t)}modifyRequests(t){this.shaka.getNetworkingEngine().registerRequestFilter((e,n)=>{e===window.shaka.net.NetworkingEngine.RequestType.KEY&&this.options.aesToken&&(n.headers.Authorization="Bearer "+this.options.aesToken);const i=t?.split("?")[1]?.split("&");i?.length&&i.forEach(t=>{const e=n.uris[0]?.split("?")[1];e?n.uris[0].includes(t)||(n.uris[0]+="&"+t):n.uris[0]+="?"+t})})}preselectQuality(){this.options.qualityLevel&&(new window.shaka.util.EventManager).listen(this.shaka,"streaming",()=>{const t=parseInt(this.options.qualityLevel,10),e=this.getLevels().find(e=>e.height===t);e&&this.setLevel(e)})}getLevels(){return[X].concat(this.shaka.getVariantTracks())}setLevel(t){t===X?this.shaka.configure({abr:{enabled:!0}}):(this.shaka.configure({abr:{enabled:!1}}),this.shaka.selectVariantTrack(t,!0))}limitLevel(t){const e=parseInt(t,10);e&&this.shaka.configure({abr:{restrictions:{maxHeight:e}}})}goToLive(){this.shaka.goToLive()}isLive(){return this.$el.currentTime>=this.shaka?.seekRange()?.end-10}getLevel(){const t=this.shaka.getVariantTracks().find(t=>t.active);return this.shaka.getConfiguration().abr.enabled?X:t}isMultiQuality(){return this.shaka.getVariantTracks().length>1}destroy(){this.shaka.destroy(),super.destroy()}};var ot=(()=>{for(var t,e,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],i=0,s=n.length,o={};i<s;i++)if((t=n[i])&&t[1]in document){for(i=0,e=t.length;i<e;i++)o[n[0][i]]=t[i];return o}return!1})();const rt={request(t){var e=ot.requestFullscreen;t=t||document.documentElement,/5\.1[\.\d]* Safari/.test(navigator.userAgent),t[e]()},exit(){this.isFullscreen&&document[ot.exitFullscreen]()},toggle(t){this.isFullscreen?this.exit():this.request(t)},raw:ot,isFullscreen:!1,element:null,enabled:!1};B(rt,"isFullscreen",function(){return Boolean(document[ot.fullscreenElement])},d),B(rt,"element",function(){return document[ot.fullscreenElement]},d),B(rt,"enabled",function(){return Boolean(document[ot.fullscreenEnabled])},d);const at=!!ot&&rt,lt={fullscreen:"Fullscreen","exit-fullscreen":"Exit full screen",theater:"Theater mode","exit-theater":"Standard mode",play:"Play",pause:"Pause",replay:"Replay","standard-playbackrate":"Standard",forward:"Forward 10 sec",backward:"Back 10 sec",prevframe:"Move to previous frame",nextframe:"Move to next frame",annotations:"Annotations",quality:"Quality","audio-tracks":"Audio tracks","playback-rate":"Playback rate",settings:"Settings",buffering:"Buffering...",cc:"Closed Captions",transcript:"Transcript",chapters:"Chapters",back:"Back","settings-fontcolor":"Font color","settings-fontsize":"Font size","settings-fontfamily":"Font family","settings-background":"Background color","settings-captionlocations":"Captions location",help:"Help",download:"Download","video-drm":"Video","video-only":"Video Only","video-and":"Video and",language:"Language","unapproved-source":"(unapproved)",translate:"Translate",translating:"Translating...",monoserif:"Monospace serif",propserif:"Proportionate serif",monosans:"Monospace sans serif",propssans:"Proportionate sans serif","cc-location-over":"Overlay video","cc-location-below":"Below the video",red:"Red",purple:"Purple",indigo:"Indigo",blue:"Blue",green:"Green",yellow:"Yellow",orange:"Orange",brown:"Brown",grey:"Grey",white:"White",black:"Black","help-bacward":'"Left (◄)" - Jump backward by 10 seconds',"help-play":'"Space" - Toggle playback',"help-skip":'"Right (►)" - Skip 10 seconds',"help-volume":'"UP/DOWN (▲/▼)" - Change volume by 10%',"help-esc":'"ESC" - exit fullscreen',"no-video":"No playable sources found","playlist-count-of":"videos","caption-search":"Search captions",next:"Next",prev:"Previous",error:"An error occurred while playing the media."};function ht(t={},e){return(t?t[e]:null)||lt[e]}function ct(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class pt extends V{constructor(t,e,n,i=[]){super(n.bus,n.logger),ct(this,"player",void 0),ct(this,"options",void 0),ct(this,"state",void 0),ct(this,"_events",void 0),ct(this,"_listener",void 0),this.player=t,this.options=n,this.state=e,this._events=i;const s=this._listenerMethod.bind(this);s._safe_inner=!0,$(i)&&(this._listener=s,this.bus.on("*",s))}$t(t){return ht(this.options.i18n,t)}_listenerMethod(t,...e){if(a(this._events,t)){const i=this[`on${n=t,n.substring(0,1).toUpperCase()+n.substring(1)}`];o(i)&&i.apply(this,e)}var n}destroy(){super.destroy(),this.bus.off("*",this._listener)}getElement(){return null}getOuter(){return null}}function ut({url:t,success:e,responseType:n,rangeStart:i,rangeEnd:s,error:o}){const r=function(t,e){const n=new XMLHttpRequest;return n.onreadystatechange=function(){try{4===n.readyState&&(200===n.status?setTimeout(t):e&&(!n.status||n.status>=400)&&setTimeout(e))}catch(t){}},n}(()=>{const t="arraybuffer"===r.responseType?r.response:r.responseText;e({url:r.responseURL,data:t})},o);r.open("GET",t,!0),b(s)&&b(i)&&r.setRequestHeader("Range","bytes="+i+"-"+--s),b(n)&&(r.responseType=n),r.send(null)}function dt(t){const e=t.split(":"),n=[3600,60,1];let i=0;for(;e.length&&n.length;)i+=e.pop()*n.pop();return i}function gt(t,e=!1,n=!1){const i=Math.round(1e3*t)%1e3;t=Math.floor(t);const s=e?[24,60,60]:[60,60],o=[];for(;s.length;){const e=s.pop();o.unshift(mt(t%e)),t=Math.floor(t/e)}return n?o.join(":")+"."+i:o.join(":")}function mt(t){return t<10?`0${t}`:`${t}`}const bt=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;function yt(t,e,n){ut({url:t,success:({data:t})=>{e(function(t){let e=t.split(/\n\s*\n+/gm);if("WEBVTT"!==e.shift().trim())return[];return A(L(e),t=>{const e=t.split(/\n/g),n=F(e).indexOf("--\x3e")<0?e.shift():"",i=e.shift().split("--\x3e");return{from:dt(F(i).trim()),to:dt(z(i).trim()),text:e.filter(t=>!!t).join("<br/>&nbsp;").replace(bt,""),title:n,id:x()}})}(t))},error:n})}function ft(t,e,i){i.style.display="block";let s=t.getElement();const o=s?s.offsetWidth:0;if(n(e)){const t=(o?s:s.parentNode).getBoundingClientRect(),n=e.getBoundingClientRect();e=vt(n.left+n.right)-t.left}const r=i.offsetWidth;let a=Math.max(3,e-vt(r));o&&(a=Math.min(a,o-r-3)),i.style.left=`${a}px`,i.style.display=""}function vt(t){return Math.floor(t/2)}function $t(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const xt="rmp-ext-progress",_t=`${xt}__current`,wt=`${xt}__duration`,Ct=`${xt}__bar`,kt=`${xt}__bar-padding`,Tt=`${xt}__handle`,St=`${xt}__overlay`,Et=`${xt}__play-progress`,Pt=`${xt}__progress`,Lt=`${xt}__tooltip`,Mt=`${xt}__tooltip--visible`,At=`${xt}__thumbmail`,Ft=`${xt}__thumbmail-time`,zt=`${xt}__generic-live-stream`,Nt=`${xt}__hidden`,Ot=`${xt}__chapter-bubble`;function Rt(t){if(t===1/0||isNaN(t))return"--:--";const e=Math.floor(t/3600),n=Math.floor(t/60)%60,i=Math.floor(t%60);return(e?jt(e)+":":"")+jt(n)+":"+jt(i)}function jt(t){return t<10?`0${t}`:`${t}`}const Ht={width:32,height:32,viewBox:"0 0 24 24"},Dt="M8 5v14l11-7z",Bt="M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z",It="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z",Vt="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z",Ut="M6 6h2v12H6zm3.5 6l8.5 6V6z",Wt="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z",qt="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z",Gt="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z",Qt="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z";function Yt(t,e,n={}){const i=w("svg",n=H({},Ht,n),t,"http://www.w3.org/2000/svg");return Array.isArray(e)?e.forEach(t=>{w("path",Zt(t),i,"http://www.w3.org/2000/svg")}):w("path",Zt(e),i,"http://www.w3.org/2000/svg"),i}function Zt(t){return"string"==typeof t?{d:t}:{...t}}const Kt="rmp-ext-popover",Jt=`${Kt}--visible`;function Xt(t,{$button:e,text:n}){const i=e.parentNode,s=w("span",{class:Kt,tabindex:"0"});_(i,s,e),e.setAttribute("aria-label",o(n)?n():n);let r=null;function a(){s.textContent=o(n)?n():n,s.style.left="0",ft(t.player,e,s),S(s,Jt)}function l(){clearTimeout(r),E(s,Jt)}t.addEvent(e,"mouseenter",()=>r=setTimeout(a,500)),t.addEvent(e,"mouseleave",l),t.addEvent(e,"click",l)}const te="rmp-ext-play",ee=`${te}--playing`,ne=`${te}--paused`,ie=`${te}--ended`,se="rmp-";function oe(t,e){try{localStorage.setItem(se+t,e)}catch(t){}}function re(t,e){try{const n=localStorage.getItem(se+t);return b(n)?n:e}catch(t){return e}}function ae(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const le="rmp-ext-volume",he=`${le}__btn`,ce=`${he}--muted`,pe=`${le}__selector`,ue=`${pe}--open`,de=`${pe}--active`,ge=`${le}__slider`,me=`${le}__handle`,be=`${le}__progress`,ye=`${le}__overlay`,fe="volume",ve="muted";function $e(t){return t=Math.max(0,t),Math.min(t,1)}const xe="rmp-ext-fullscreen",_e=`${xe}--exit`;function we(t,e){if(!t||!t.getElement())return;e.style.maxHeight="";const n=t.getElement().parentNode.getBoundingClientRect(),i=(n.height||n.bottom-n.top)-100;e.style.maxHeight=`${Math.min(i,300)}px`}function Ce(t,{$button:e,$selector:n,SELECTOR_OPEN_CN:i,reposition:s=!0,closeOnClick:o=!1,heightControl:r=!1,firstFocusItemSelector:a="",toMainFn:l=()=>{}}){let h=null;function c(t,e){const n=document.activeElement;let i=t;return!i&&n.parentElement.classList.value.includes("tab-content")&&(i=n.parentElement[e]),i}function p(t,e){let n=t;return n&&n.classList.value.includes("tab-content")&&(n=n[e]),n}function u(t,e){let n=t,i=t&&(n.offsetWidth>0||n.offsetHeight>0);for(;!i&&n;)n=n[e],i=t&&(n.offsetWidth>0||n.offsetHeight>0);return n}function d(){l(),t.bus.emit("hidepopup"),E(n,i),b(h)&&(k(h),h=null)}t.addEvent(e,"click",function(){b(h)?d():(S(n,i),s&&ft(t.player,e,n),setTimeout(()=>{t.bus.emit("showpopup",n),h=C(document,"click",d)}),r&&we(t.player,n),a&&setTimeout(()=>{n.querySelector(a).focus()}))}),o||t.addEvent(n,"click",t=>t.stopPropagation()),t.addEvent(t.player.getElement(),"mouseleave",d),t.addEvent(t.$selector,"keydown",function(e){e.stopPropagation();const n=e.keyCode,i=document.activeElement;if(27===n)return e.preventDefault(),d(),void t.$button.focus();if(39===n)return e.preventDefault(),void(i.classList.value.includes("__more")&&i.click());if(37===n){e.preventDefault();const n=t.$selector.querySelectorAll('button[class$="__back"]'),i=Array.from(n).find(t=>t.offsetWidth>0||t.offsetHeight>0);return void(i&&i.click())}if(40===n){e.preventDefault();let t=i.nextElementSibling;return t=u(t,"nextElementSibling"),t=p(t,"firstElementChild"),t||(t=c(t,"nextElementSibling")),void(t&&t.focus())}if(38===n){e.preventDefault();let t=i.previousElementSibling;t=c(t,"previousElementSibling"),t=u(t,"previousElementSibling"),t=p(t,"lastElementChild"),t&&t.focus()}}),t.bus.on("resizeplayer",d)}function ke(t,e){c(e,e=>{t[e]=t[e].bind(t)})}const Te=[{key:"red",value:"#F44336"},{key:"purple",value:"#9C27B0"},{key:"indigo",value:"#3F51B5"},{key:"blue",value:"#2196F3"},{key:"green",value:"#4CAF50"},{key:"yellow",value:"#FFEB3B"},{key:"orange",value:"#FF9800"},{key:"brown",value:"#795548"},{key:"grey",value:"#9E9E9E"},{key:"white",value:"#FFF"},{key:"black",value:"#000"}],Se=[{label:"75%",value:"75%"},{label:"100%",value:"100%"},{label:"125%",value:"125%"},{label:"150%",value:"150%"},{label:"200%",value:"200%"}],Ee=[{key:"monoserif",value:'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace'},{key:"propserif",value:'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif'},{key:"monosans",value:'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace'},{key:"propssans",value:'Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif'}],Pe=[{key:"cc-location-over",value:"over"},{key:"cc-location-below",value:"below"}];function Le(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Me="rmp-ext-cc",Ae=`${Me}__button`,Fe=`${Me}__selector`,ze=`${Fe}--open`,Ne=`${Fe}--main-step`,Oe=`${Fe}--settings-step`,Re=`${Fe}--additional-step`,je=`${Fe}--translate-step`,He=`${Me}__main-step`,De=`${Me}__settings-step`,Be=`${Me}__additional-step`,Ie=`${Me}__item`,Ve=`${Ie}--checked`,Ue=`${Me}__settings`,We=`${Ue}--progress`,qe=`${Me}__more`,Ge=`${Me}__current-value`,Qe=`${Me}__text`,Ye=`${Qe}--visible`,Ze=`${Me}__text-holder`,Ke=`${Me}__back`,Je=`${Me}__translate-wrapper`,Xe=`${Me}__settings-wrapper`;function tn(t){S(t,qe);const e=w("span",{class:"arrow"},t);return Yt(e,qt),e}function en(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const nn="rmp-ext-toc",sn=`${nn}__button`,on=`${nn}__selector`,rn=`${on}--main-step`,an=`${on}--languages-step`,ln=`${on}--translate-step`,hn=`${on}--open`,cn=`${nn}__languages-step`,pn=`${nn}__more`,un=`${nn}__back`,dn=`${nn}__main-step`,gn=`${nn}__languge-btn`,mn=`${nn}__chapters`,bn=`${nn}__item`,yn=`${nn}__lang-item`,fn=`${yn}--checked`,vn=`${nn}__translate-step`,$n=`${nn}__current-value`;function xn(t){S(t,pn);const e=w("span",{class:"arrow"},t);return Yt(e,qt),e}function _n(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const wn="rmp-annotation",Cn=`${wn}--visible`,kn=`${wn}__holder`,Tn=`${wn}__button`,Sn=/(https?:\/\/[^\s]+)/g;function En({text:t,starts:e,ends:n,top:i,left:s,width:o,height:r,fontsize:a,fontcolor:l,background:h}){return{text:t,top:i,left:s,width:o,height:r,fontsize:a,fontcolor:l,background:h,from:dt(`${e.hh}:${e.mm}:${e.ss}`),to:dt(`${n.hh}:${n.mm}:${n.ss}`)}}const Pn="rmp-ext-poster",Ln=`${Pn}--video`,Mn=`${Pn}--hidden`;function An(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Fn="rmp-ext-placeholder",zn=`${Fn}--animation`,Nn=`${Fn}__icon`,On=`${Fn}__play-btn`,Rn={32:"_togglePlay",37:"_skeepLeft",39:"_skeepRight",38:"_upVolume",40:"_downVolume",74:"_prevFrame",75:"_nextFrame"};let jn,Hn,Dn;var Bn="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof t.g&&t.g.global===t.g?t.g:void 0;function In(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){qn(i.response,e,n)},i.onerror=function(){console.error("could not download file")},i.send()}function Vn(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function Un(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var Wn=/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),qn=Bn.saveAs||("object"!=typeof window||window!==Bn?function(){}:"download"in HTMLAnchorElement.prototype&&!Wn?function(t,e,n){var i=Bn.URL||Bn.webkitURL,s=document.createElement("a");e=e||t.name||"download",s.download=e,s.rel="noopener","string"==typeof t?(s.href=t,s.origin!==location.origin&&Vn(s.href)?In(t,e,n):Un(s)):(s.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(s.href)},4e4),setTimeout(function(){Un(s)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download","string"==typeof t)if(Vn(t))In(t,e,n);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){Un(i)})}else navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,n),e)}:function(t,e,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return In(t,e,n);var s="application/octet-stream"===t.type,o=/constructor/i.test(Bn.HTMLElement)||Bn.safari,r=/CriOS\/[\d]+/.test(navigator.userAgent);if((r||s&&o||Wn)&&"undefined"!=typeof FileReader){var a=new FileReader;a.onloadend=function(){var t=a.result;t=r?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=t:location=t,i=null},a.readAsDataURL(t)}else{var l=Bn.URL||Bn.webkitURL,h=l.createObjectURL(t);i?i.location=h:location.href=h,i=null,setTimeout(function(){l.revokeObjectURL(h)},4e4)}});function Gn(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Qn="rmp-ext-download",Yn=`${Qn}__button`,Zn=`${Qn}__selector`,Kn=`${Zn}--open`,Jn=`${Zn}--additional`,Xn=`${Qn}__more`,ti=`${Qn}__main-step`,ei=`${Qn}__additional-step`,ni=`${Qn}__back`,ii=`${Qn}__download-cc`;function si(t){const e=w("span",{class:"arrow"},t);return Yt(e,qt),e}function oi(t){return 1!==t.state&&0!==t.state}function ri(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ai="rmp-ext-settings",li=`${ai}__button`,hi=`${ai}__selector`,ci=`${hi}--open`,pi=`${hi}--additional`,ui=`${ai}__main-step`,di=`${ai}__additional-step`,gi=`${ai}__annotations`,mi=`${ai}__quality`,bi=`${ai}__playback-rate`,yi=`${ai}__back`,fi=`${ai}__more`,vi=`${ai}__current-value`,$i=`${ai}__item`,xi=`${$i}--checked`,_i="annotationslang",wi={label:"None",srclang:""},Ci=[{rate:.5},{rate:.8},{rate:1,labelKey:"standard-playbackrate"},{rate:1.5},{rate:2},{rate:3,hide:t=>t.isLive},{rate:5,hide:t=>t.isAudio||t.isLive}];function ki(t){const e=w("span",{class:"arrow"},t);return Yt(e,qt),e}function Ti(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Si="rmp-ext-title",Ei=`${Si}__title`;function Pi(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Li="rmp-ext-prev",Mi=`${Li}__button`,Ai=`${Li}__thumbnail`;function Fi(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const zi="rmp-ext-next",Ni=`${zi}__button`,Oi=`${zi}__thumbnail`;function Ri(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ji="rmp-ext-buffering",Hi=`${ji}--processing`,Di={page_type:"watchpage",player_name:"RavnurPlayer",player_version:"3.3.3",video_stream_type:"on-demand"};const Bi="rmp-ext-theater",Ii=`${Bi}--exit`,Vi=`${Bi}--hidden`;function Ui(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Wi="rmp-ext-audio-tracks",qi=`${Wi}__button`,Gi=`${Wi}__selector`,Qi=`${Gi}--open`,Yi=`${Wi}__item`,Zi=`${Yi}--checked`,Ki=document.createElement("span");function Ji(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Xi="rmp-ext-search",ts="rmp-ext-search--hidden",es=`${Xi}__button`,ns=`${Xi}__selector`,is=`${ns}--open`,ss=`${Xi}__captions`,os=`${Xi}__input`,rs=`${Xi}__item`,as=`${rs}--current`,ls=`${Xi}__cc-time`,hs=`${Xi}__cc-text`,cs=`${Xi}__cc-clear`;function ps(t){return`cc-${t}`}const us="rmp-ext-bottom-next",ds=`${us}--hidden`;const gs="rmp-ext-bottom-prev",ms=`${gs}--hidden`;function bs(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ys="rmp-ext-crawl",fs=`${ys}__text`;class vs extends pt{constructor(t,e,n){super(t,e,n,[]),bs(this,"$crawl",null),bs(this,"$intervalId",null),this.logger.debug("crawl:extensions:creating"),this.render(),this.logger.debug("crawl:extensions:created"),n.bus.on("fullscreenchanging",()=>{setTimeout(()=>this.refresh(this.options.crawl,this.options.showCrawl),100)}),n.bus.on("resizeplayer",()=>{setTimeout(()=>this.refresh(this.options.crawl,this.options.showCrawl),100)})}startAnimation(t=100){if(this.$intervalId)return;const e=document.getElementById("crawlText"),n=document.querySelector(".rmp-ext-crawl");if(!e||!n)return;const i=n.offsetWidth,s=e.offsetWidth;let o=i;this.$intervalId=setInterval(()=>{o--,o<-s&&(o=i),e.style.transform=`translateX(${o}px)`},t)}render(){this.$crawl=w("div",{class:ys,"data-testid":"crawl"}),w("div",{id:"crawlText",class:fs,title:this.options.crawl.text,tabindex:0},this.$crawl).innerHTML=$s(this.options.crawl.text)||"",this.$crawl.style.color=this.options.crawl.textColor,this.$crawl.style.backgroundColor=this.options.crawl.backgroundColor,this.toggle(this.options.showCrawl),setTimeout(()=>this.startAnimation(this.options.crawl.speed))}getOuter(){return this.$crawl}toggle(t){this.$crawl&&(this.$crawl.style.display=t?"block":"none")}refresh(t,e){if(!this.$crawl)return;const n=document.getElementById("crawlText");n&&(n.innerHTML=$s(t.text)||"",this.$crawl.style.color=t.textColor,this.$crawl.style.backgroundColor=t.backgroundColor,this.clearInterval(),this.toggle(e),e&&this.startAnimation(t.speed))}destroy(){if(super.destroy(),!this.$crawl)return;const t=this.$crawl.parentNode;t&&t.removeChild(this.$crawl),this.$crawl=null,this.clearInterval()}clearInterval(){this.$intervalId&&(clearInterval(this.$intervalId),this.$intervalId=null)}}function $s(t){return t.replace(/(\r\n|\n|\r)/gm,"").replace(/<br\s*[\/]?>/gi,"")}const xs="rmp-ext-live",_s=`${xs}--live`;const ws="rmp-ext-error",Cs=`${ws}--hidden`,ks=`${ws}__content`,Ts=[["showTitle",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$outer"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("title:extension:creating"),this.render(),this.logger.debug("title:extension:created")}render(){this.$outer=w("div",{class:Si,"data-testid":"title"}),w("span",{class:Ei,title:this.options.title,tabindex:0},this.$outer).textContent=this.options.title||""}getOuter(){return this.$outer}destroy(){if(super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],[!0,class extends pt{constructor(t,e,n){super(t,e,n,["seeking","waiting","seeked","canplay","playing","timeupdate"]),Ri(this,"$outer",void 0),Ri(this,"_timerId",void 0),this.logger.debug("buffering:extension:creating"),this.render(),n.isMobile||this.startProcessing(),this.logger.debug("buffering:extension:created")}onWaiting(){this.startProcessing()}onSeeking(){this.startProcessing()}startProcessing(){clearTimeout(this._timerId),this._timerId=setTimeout(()=>S(this.$outer,Hi),this.options.bufferingTimeout)}onTimeupdate(){this.hideProcessing()}onSeeked(){this.hideProcessing()}onCanplay(){this.hideProcessing()}onPlaying(){this.hideProcessing()}render(){this.$outer=w("div",{class:ji}),Yt(w("span",{class:`${ji}__message`},this.$outer),"M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z",{})}getOuter(){return this.$outer}hideProcessing(){clearTimeout(this._timerId),E(this.$outer,Hi)}destroy(){super.destroy();const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["showPoster",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$outer"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("poster:extension:creating"),this._hidePoster=this._hidePoster.bind(this),this.render(),this.logger.debug("poster:extension:created")}render(){this.$outer=w("div",{class:Pn,tabindex:-1}),w("img",{src:this.options.poster},this.$outer).setAttribute("aria-label",this.options.title||""),this.options.isAudio||(S(this.$outer,Ln),this.bus.on("play",this._hidePoster))}_hidePoster(){S(this.$outer,Mn)}getOuter(){return this.$outer}destroy(){if(this.bus.off("play",this._hidePoster),super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["showError",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["error"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$outer"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("error:extension:creating"),this.onError=this.onError.bind(this),this.render(),this.logger.debug("error:extension:created")}render(){this.$outer=w("div",{class:`${ws} ${Cs}`,tabindex:-1}),Yt(this.$outer,"M7.493 0.015 C 7.442 0.021,7.268 0.039,7.107 0.055 C 5.234 0.242,3.347 1.208,2.071 2.634 C 0.660 4.211,-0.057 6.168,0.009 8.253 C 0.124 11.854,2.599 14.903,6.110 15.771 C 8.169 16.280,10.433 15.917,12.227 14.791 C 14.017 13.666,15.270 11.933,15.771 9.887 C 15.943 9.186,15.983 8.829,15.983 8.000 C 15.983 7.171,15.943 6.814,15.771 6.113 C 14.979 2.878,12.315 0.498,9.000 0.064 C 8.716 0.027,7.683 -0.006,7.493 0.015 M8.853 1.563 C 9.967 1.707,11.010 2.136,11.944 2.834 C 12.273 3.080,12.920 3.727,13.166 4.056 C 13.727 4.807,14.142 5.690,14.330 6.535 C 14.544 7.500,14.544 8.500,14.330 9.465 C 13.916 11.326,12.605 12.978,10.867 13.828 C 10.239 14.135,9.591 14.336,8.880 14.444 C 8.456 14.509,7.544 14.509,7.120 14.444 C 5.172 14.148,3.528 13.085,2.493 11.451 C 2.279 11.114,1.999 10.526,1.859 10.119 C 1.618 9.422,1.514 8.781,1.514 8.000 C 1.514 6.961,1.715 6.075,2.160 5.160 C 2.500 4.462,2.846 3.980,3.413 3.413 C 3.980 2.846,4.462 2.500,5.160 2.160 C 6.313 1.599,7.567 1.397,8.853 1.563 M7.706 4.290 C 7.482 4.363,7.355 4.491,7.293 4.705 C 7.257 4.827,7.253 5.106,7.259 6.816 C 7.267 8.786,7.267 8.787,7.325 8.896 C 7.398 9.033,7.538 9.157,7.671 9.204 C 7.803 9.250,8.197 9.250,8.329 9.204 C 8.462 9.157,8.602 9.033,8.675 8.896 C 8.733 8.787,8.733 8.786,8.741 6.816 C 8.749 4.664,8.749 4.662,8.596 4.481 C 8.472 4.333,8.339 4.284,8.040 4.276 C 7.893 4.272,7.743 4.278,7.706 4.290 M7.786 10.530 C 7.597 10.592,7.410 10.753,7.319 10.932 C 7.249 11.072,7.237 11.325,7.294 11.495 C 7.388 11.780,7.697 12.000,8.000 12.000 C 8.303 12.000,8.612 11.780,8.706 11.495 C 8.763 11.325,8.751 11.072,8.681 10.932 C 8.616 10.804,8.460 10.646,8.333 10.580 C 8.217 10.520,7.904 10.491,7.786 10.530",{class:"error",width:800,height:800,viewBox:"0 0 16 16"}),w("div",{class:ks},this.$outer).textContent=this.$t("error"),this.logger.debug("error:extension:rendered")}onError(){this.logger.debug("error:extension:onError"),E(this.$outer,Cs)}getOuter(){return this.$outer}destroy(){if(super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["showBackward",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("backward:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.backward.bind(this)),this.logger.debug("backward:extension:created")}render(){this.$el=w("button",{type:"button",class:"rmp-ext-backward"}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("backward")})),Yt(this.$el,Bt)}backward(){this.player.setCurrentTime(this.player.getCurrentTime()-(this.options.skipDelta||0)),this.bus.emit("heartbeatextensions")}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showPrevFrame",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("prevframe:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.prevframe.bind(this)),this.logger.debug("prevframe:extension:created")}render(){this.$el=w("button",{type:"button",class:"rmp-ext-prev-frame"}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("prevframe")})),Yt(this.$el,Ut)}prevframe(){this.player.prevFrame()}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showBottomPrev",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("bottom-prev:extension:creating"),this.render();const r=this.options.bus;this.addEvent(this.$el,"click",()=>r.emit("prevtrack")),this.logger.debug("bottom-prev:extension:created")}render(){this.$el=w("button",{type:"button",class:`${gs}`}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("prev")})),Yt(this.$el,Ut),this.player.options.prevTrackTitle||this.$el.classList.add(ms)}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showPlay",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["pause","play","ended","seeking"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("play:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.toggle.bind(this)),this.logger.debug("play:extension:created")}render(){this.$el=w("button",{type:"button",class:`${te} ${ne}`}),setTimeout(()=>{Xt(this,{$button:this.$el,text:()=>this.player.isEnded()?this.$t("replay"):this.player.isPaused()?this.$t("play"):this.$t("pause")})}),Yt(this.$el,Dt,{class:"play"}),Yt(this.$el,"M6 19h4V5H6v14zm8-14v14h4V5h-4z",{class:"pause"}),Yt(this.$el,"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z",{class:"replay"})}toggle(){this.player.isPaused()||this.player.isEnded()?this.player.play():this.player.pause()}onPause(){this.$el.setAttribute("aria-label","Play"),E(this.$el,ee),E(this.$el,ie),S(this.$el,ne)}onPlay(){this.$el.setAttribute("aria-label","Pause"),E(this.$el,ne),E(this.$el,ie),S(this.$el,ee)}onEnded(){this.options.playLoop||(this.$el.setAttribute("aria-label","Reply"),E(this.$el,ne),E(this.$el,ee),S(this.$el,ie))}onSeeking(){E(this.$el,ie),E(this.$el,ne),E(this.$el,ee),this.player.isPaused()?S(this.$el,ne):S(this.$el,ee)}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showBottomNext",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("bottom-next:extension:creating"),this.render();const r=this.options.bus;this.addEvent(this.$el,"click",()=>r.emit("nexttrack")),this.logger.debug("bottom-next:extension:created")}render(){this.$el=w("button",{type:"button",class:`${us}`}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("next")})),Yt(this.$el,Vt),this.player.options.nextTrackTitle||this.$el.classList.add(ds)}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showNextFrame",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("nextframe:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.nextframe.bind(this)),this.logger.debug("nextframe:extension:created")}render(){this.$el=w("button",{type:"button",class:"rmp-ext-next-frame"}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("nextframe")})),Yt(this.$el,Vt)}nextframe(){this.player.nextFrame()}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showForward",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("forward:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.forward.bind(this)),this.logger.debug("forward:extension:created")}render(){this.$el=w("button",{type:"button",class:"rmp-ext-forward"}),setTimeout(()=>Xt(this,{$button:this.$el,text:this.$t("forward")})),Yt(this.$el,It)}forward(){this.player.setCurrentTime(this.player.getCurrentTime()+(this.options.skipDelta||0)),this.bus.emit("heartbeatextensions")}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showVolume",class extends pt{constructor(t,e,n){super(t,e,n,["volumechange","loadedmetadata"]),ae(this,"$el",void 0),ae(this,"$button",void 0),ae(this,"$selector",void 0),ae(this,"$slider",void 0),ae(this,"$progress",void 0),ae(this,"$handle",void 0),ae(this,"_dragNdropTokens",[]),this.logger.debug("volume:extension:creating"),this.onHandleMouseUp=this.onHandleMouseUp.bind(this),this.onHandleMouseDown=this.onHandleMouseDown.bind(this),this.onHandleMouseMove=this.onHandleMouseMove.bind(this),this.onHandleEsqKey=this.onHandleEsqKey.bind(this),this.render(),this.addEvent(this.$button,"click",this.toggle.bind(this)),this.addEvent(this.$slider,"click",this.changeVolume.bind(this)),this.addEvent(this.$handle,"mousedown",this.onHandleMouseDown),function(t,{$button:e,$selector:n,SELECTOR_OPEN_CN:i}){t.addEvent(e,"click",function(){P(n,i),ft(t.player,e,n)});let s=null;function o(){S(n,i),ft(t.player,e,n)}t.addEvent(t.getElement(),"mouseleave",function(){clearTimeout(s),E(n,i)}),t.addEvent(e,"mouseenter",()=>s=setTimeout(o,200))}(this,{$button:this.$button,$selector:this.$selector,SELECTOR_OPEN_CN:ue,closeOnClick:!1}),this.refreshHandle(),this.logger.debug("volume:extension:created")}render(){this.$el=w("span",{class:le}),this.$button=w("button",{type:"button",class:he},this.$el),this.$button.setAttribute("aria-label","Volume"),this.$button.addEventListener("keydown",this.onHandleEsqKey),this.$selector=w("div",{class:pe},this.$el),this.$slider=w("span",{class:ge},this.$selector),w("span",{class:ye},this.$slider),this.$progress=w("span",{class:be},this.$slider),this.$handle=w("span",{class:me},this.$slider),Yt(this.$button,Gt,{class:"muted"}),Yt(this.$button,Qt,{class:"unmuted"})}toggle(){const t=!this.player.isMuted();if(this.player.setMuted(t),oe(ve,t.toString()),!t){const t=Math.max(this.player.getVolume(),.1);this.player.setVolume(t),oe(fe,t.toString())}}_getVolumeByEvent(t){const e=this.$slider.getBoundingClientRect();return(1-(function(t){return t.clientY}(t)-e.top)/this.$slider.offsetHeight).toFixed(2)}changeVolume(t){const e=this._getVolumeByEvent(t);this.updateVolume(Number(e))}updateVolume(t){t=$e(t),this.logger.debug("changevolume",t),t?(this.player.setVolume(t),this.player.setMuted(!1),oe(fe,t),oe(ve,!1)):(this.player.setMuted(!0),oe(ve,!0))}onVolumechange(){this.player.isMuted()?S(this.$button,ce):E(this.$button,ce),this.refreshHandle()}onLoadedmetadata(){const t=this.options.muted;this.player.setVolume(parseFloat(re(fe,"1.0"))),"boolean"==typeof t?this.player.setMuted(t):this.player.setMuted("true"===re(ve,"false"),!0)}refreshHandle(){this._refreshHadle4volume(this.player.getVolume())}_refreshHadle4volume(t){const e=this.player.isMuted()?"100%":100*(1-t)+"%";this.$handle.style.top=this.$progress.style.top=e}onHandleMouseDown(){S(this.$selector,de),this._dragNdropTokens.push(C(document,"mouseup",this.onHandleMouseUp)),this._dragNdropTokens.push(C(document,"mousemove",this.onHandleMouseMove))}onHandleMouseUp(t){c(this._dragNdropTokens,k),this._dragNdropTokens.length=0,this.changeVolume(t),E(this.$selector,de)}onHandleMouseMove(t){let e=Number(this._getVolumeByEvent(t));e=$e(e),this._refreshHadle4volume(e)}onHandleEsqKey(t){27===t.keyCode&&(E(this.$selector,ue),t.preventDefault())}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$button&&this.$button.removeEventListener("keydown",this.onHandleEsqKey),this.$el=null,this.$button=null,this.$selector=null,this.$slider=null,this.$progress=null,this.$handle=null}}],["isLive",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["timeupdate","progress"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("play:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.toggle.bind(this)),this.logger.debug("live:extension:created")}render(){this.$el=w("button",{type:"button",class:xs}),Yt(this.$el,"M 8.0136719 7.0292969 A 1.0001 1.0001 0 0 0 7.3222656 7.3222656 C 2.7995047 11.846068 -1.1842379e-15 18.102792 0 25 C 0 31.897208 2.7995047 38.153932 7.3222656 42.677734 A 1.0001 1.0001 0 0 0 8.7363281 42.677734 L 11.570312 39.84375 A 1.0001 1.0001 0 0 0 11.570312 38.429688 C 8.1286602 34.987084 6 30.242812 6 25 C 6 19.757188 8.1297921 15.013788 11.572266 11.572266 A 1.0001 1.0001 0 0 0 11.572266 10.158203 L 8.7363281 7.3222656 A 1.0001 1.0001 0 0 0 8.0136719 7.0292969 z M 41.957031 7.0292969 A 1.0001 1.0001 0 0 0 41.263672 7.3222656 L 38.427734 10.158203 A 1.0001 1.0001 0 0 0 38.427734 11.572266 C 41.870208 15.013788 44 19.757188 44 25 C 44 30.242812 41.870208 34.986212 38.427734 38.427734 A 1.0001 1.0001 0 0 0 38.427734 39.841797 L 41.263672 42.677734 A 1.0001 1.0001 0 0 0 42.677734 42.677734 C 47.201645 38.154865 50 31.897208 50 25 C 50 18.102792 47.200495 11.846068 42.677734 7.3222656 A 1.0001 1.0001 0 0 0 41.957031 7.0292969 z M 8.0976562 9.5117188 L 9.5195312 10.933594 C 6.1269359 14.664061 4 19.575176 4 25 C 4 30.424712 6.1260807 35.337173 9.5175781 39.068359 L 8.0976562 40.488281 C 4.3450168 36.394537 2 30.995061 2 25 C 2 19.004939 4.3450168 13.605463 8.0976562 9.5117188 z M 41.902344 9.5117188 C 45.654983 13.605463 48 19.004939 48 25 C 48 30.995061 45.655695 36.395442 41.902344 40.488281 L 40.480469 39.066406 C 43.873064 35.335939 46 30.424824 46 25 C 46 19.575176 43.873064 14.664061 40.480469 10.933594 L 41.902344 9.5117188 z M 14.382812 13.398438 A 1.0001 1.0001 0 0 0 13.691406 13.691406 C 10.796092 16.587786 9 20.593819 9 25 C 9 29.406181 10.796092 33.412214 13.691406 36.308594 A 1.0001 1.0001 0 0 0 15.105469 36.308594 L 17.931641 33.482422 A 1.0001 1.0001 0 0 0 17.931641 32.068359 C 16.119902 30.255711 15 27.761761 15 25 C 15 22.238239 16.119902 19.744289 17.931641 17.931641 A 1.0001 1.0001 0 0 0 17.931641 16.517578 L 15.105469 13.691406 A 1.0001 1.0001 0 0 0 14.382812 13.398438 z M 35.587891 13.398438 A 1.0001 1.0001 0 0 0 34.894531 13.691406 L 32.068359 16.517578 A 1.0001 1.0001 0 0 0 32.068359 17.931641 C 33.880098 19.744289 35 22.238239 35 25 C 35 27.761761 33.880098 30.255711 32.068359 32.068359 A 1.0001 1.0001 0 0 0 32.068359 33.482422 L 34.894531 36.308594 A 1.0001 1.0001 0 0 0 36.308594 36.308594 C 39.203908 33.412214 41 29.406181 41 25 C 41 20.593819 39.203908 16.587786 36.308594 13.691406 A 1.0001 1.0001 0 0 0 35.587891 13.398438 z M 14.466797 15.880859 L 15.947266 17.361328 C 14.184764 19.450917 13 22.061346 13 25 C 13 27.938654 14.184764 30.549083 15.947266 32.638672 L 14.466797 34.119141 C 12.335969 31.66133 11 28.50273 11 25 C 11 21.49727 12.335969 18.33867 14.466797 15.880859 z M 35.533203 15.880859 C 37.664031 18.33867 39 21.49727 39 25 C 39 28.50273 37.664031 31.66133 35.533203 34.119141 L 34.052734 32.638672 C 35.815236 30.549083 37 27.938654 37 25 C 37 22.061346 35.815236 19.450917 34.052734 17.361328 L 35.533203 15.880859 z M 25 18 C 21.134 18 18 21.134 18 25 C 18 28.866 21.134 32 25 32 C 28.866 32 32 28.866 32 25 C 32 21.134 28.866 18 25 18 z M 25 20 C 27.757 20 30 22.243 30 25 C 30 27.757 27.757 30 25 30 C 22.243 30 20 27.757 20 25 C 20 22.243 22.243 20 25 20 z",{class:"broadcast-off",width:50,height:50,viewBox:"0 0 50 50"}),Yt(this.$el,"M 8.03125 8.4570312 C 7.770375 8.4589063 7.5103125 8.5625312 7.3203125 8.7695312 C 3.3953125 13.041531 1 18.741 1 25 C 1 31.259 3.3953125 36.958469 7.3203125 41.230469 C 7.7003125 41.644469 8.3569063 41.643094 8.7539062 41.246094 L 10.882812 39.117188 C 11.265812 38.734187 11.263391 38.124656 10.900391 37.722656 C 7.8553906 34.352656 6 29.889 6 25 C 6 20.111 7.8553906 15.647344 10.900391 12.277344 C 11.263391 11.875344 11.265813 11.266812 10.882812 10.882812 L 8.7539062 8.7539062 C 8.5554063 8.5554063 8.292125 8.4551562 8.03125 8.4570312 z M 41.96875 8.4570312 C 41.707625 8.4554062 41.444594 8.5554062 41.246094 8.7539062 L 39.115234 10.884766 C 38.732234 11.267766 38.734656 11.875344 39.097656 12.277344 C 42.143656 15.646344 44 20.111 44 25 C 44 29.889 42.144609 34.352656 39.099609 37.722656 C 38.736609 38.124656 38.734188 38.733187 39.117188 39.117188 L 41.246094 41.246094 C 41.643094 41.643094 42.299687 41.643469 42.679688 41.230469 C 46.604687 36.958469 49 31.259 49 25 C 49 18.741 46.604687 13.041531 42.679688 8.7695312 C 42.489688 8.5625312 42.229875 8.4586563 41.96875 8.4570312 z M 35.625 14.837891 C 35.355125 14.824516 35.079594 14.920406 34.871094 15.128906 L 32.740234 17.259766 C 32.381234 17.618766 32.341969 18.196938 32.667969 18.585938 C 34.123969 20.323937 35 22.561 35 25 C 35 27.439 34.123969 29.675109 32.667969 31.412109 C 32.341969 31.801109 32.381234 32.379281 32.740234 32.738281 L 34.871094 34.871094 C 35.288094 35.288094 35.967516 35.250687 36.353516 34.804688 C 38.625516 32.175687 40 28.748 40 25 C 40 21.252 38.625516 17.824312 36.353516 15.195312 C 36.160516 14.972313 35.894875 14.851266 35.625 14.837891 z M 14.375 14.839844 C 14.105125 14.853219 13.839484 14.974266 13.646484 15.197266 C 11.374484 17.825266 10 21.252 10 25 C 10 28.748 11.374484 32.175688 13.646484 34.804688 C 14.032484 35.250687 14.711906 35.288094 15.128906 34.871094 L 17.259766 32.740234 C 17.618766 32.381234 17.658031 31.803062 17.332031 31.414062 C 15.876031 29.676062 15 27.439 15 25 C 15 22.561 15.876031 20.324891 17.332031 18.587891 C 17.658031 18.198891 17.618766 17.620719 17.259766 17.261719 L 15.128906 15.128906 C 14.920406 14.920406 14.644875 14.826469 14.375 14.839844 z M 25 19 C 21.686 19 19 21.686 19 25 C 19 28.314 21.686 31 25 31 C 28.314 31 31 28.314 31 25 C 31 21.686 28.314 19 25 19 z",{class:"broadcast-on",width:50,height:50,viewBox:"0 0 50 50"}),setTimeout(()=>{const t=this.player.isLive()?"Live":"Go to live";Xt(this,{$button:this.$el,text:t})},100)}toggle(){this.goToLive()}goToLive(){this.player.goToLive(),S(this.$el,_s)}onTimeupdate(){this.player.isLive()?(this.$el.setAttribute("aria-label","Live"),S(this.$el,_s)):(this.$el.setAttribute("aria-label","Go to live"),E(this.$el,_s))}onProgress(){this.player.isLive()?(this.$el.setAttribute("aria-label","Live"),S(this.$el,_s)):(this.$el.setAttribute("aria-label","Go to live"),E(this.$el,_s))}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showProgress",class extends pt{constructor(t,e,n){super(t,e,n,["progress","timeupdate","loadedmetadata","canplaythrough","statechanged","durationchange"]),$t(this,"$el",void 0),$t(this,"$bar",void 0),$t(this,"$handle",void 0),$t(this,"$current",void 0),$t(this,"$duration",void 0),$t(this,"$playProgress",void 0),$t(this,"$progress",void 0),$t(this,"$tooltip",void 0),$t(this,"$thumbnail",void 0),$t(this,"$thumbnailTime",void 0),$t(this,"thumbnails",[]),$t(this,"_dragNdropTokens",[]),$t(this,"_isLoadedMetadata",!1),$t(this,"_chapters",[]),$t(this,"_bubbles",[]),this.logger.debug("progress:extension:creating"),this.onLeave=this.onLeave.bind(this),this.onHover=this.onHover.bind(this),this.onHandleMouseUp=this.onHandleMouseUp.bind(this),this.onHandleMouseDown=this.onHandleMouseDown.bind(this),this.onHandleMouseMove=this.onHandleMouseMove.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.render(),this.addEvent(this.$bar,"click",e=>{if((e.target||e.srcElement)===this.$handle)e.stopPropagation();else{const n=this._getTimeByEventPosition(e);t.setCurrentTime(n),this._moveHandle2time(n)}}),this.addEvent(this.$bar,"mouseleave",this.onLeave),this.addEvent(this.$bar,"mousemove",this.onHover),this.addEvent(this.$handle,"mousedown",this.onHandleMouseDown),this.addEvent(this.$handle,"touchstart",this.onTouchStart),b(n.preview)&&yt(n.preview||"",t=>{this.thumbnails=t}),this.logger.debug("progress:extension:created")}render(){this.$el=w("span",{class:xt});const t=this.player.$el?.parentNode?.querySelector(".rmp-extensions");this.$bar=w("span",{class:Ct,tabindex:"-1"},t),w("span",{class:kt},this.$bar),w("span",{class:St},this.$bar),this.$handle=w("span",{class:Tt},this.$bar),this.$current=w("span",{class:_t},this.$el),w("span",{},this.$el).textContent="/",this.$duration=w("span",{class:wt},this.$el),this.$playProgress=w("span",{class:Et},this.$bar),this.$progress=w("span",{class:Pt},this.$bar),this.$tooltip=w("div",{class:Lt},this.$el),this.$thumbnail=w("div",{class:At},this.$tooltip),this.$thumbnailTime=w("span",{class:Ft},this.$tooltip),this.options.isProgressLiveStream&&(S(this.$el,zt),S(this.$bar,zt)),this.options.isLive&&S(this.$el,Nt),this.options.isMobile&&(this.$tooltip.style.visibility="hidden")}onTimeupdate(){$(this._dragNdropTokens)||(this.options.isLive&&this.player.isLive()?(this.$progress.style.width="100%",this.$handle.style.left=this.$playProgress.style.width="100%",this.$current.textContent=Rt(+this._getCurrentTime()),this.$bar.setAttribute("aria-label",this._getAriaLabelValue())):this._moveHandle2time(this._getCurrentTime()))}_moveHandle2time(t){const e=this.player.getDuration(),n=this.options,i=Number(n.timecode)||0,s=n.clip;if(b(t)&&e){let n;if(this.$current.textContent=Rt(+t),this.$bar.setAttribute("aria-label",this._getAriaLabelValue()),s&&Array.isArray(s)){const o=Number(s[0])||0,r=Number(s[1]),a=isNaN(r)?null:r;n=(t-o-i)/((null!==a?a+i:e+o)-o-i)}else n=(t-i)/(e-i);const o=(100*n).toFixed(2)+"%";this.$handle.style.left=this.$playProgress.style.width=o}}onProgress(){this.$duration.textContent=Rt(this._getDuration()),this.$progress.style.width=100*this.player.getBufferedPercent()+"%"}onHandleMouseDown(){this._dragNdropTokens.push(C(document,"mouseup",this.onHandleMouseUp)),this._dragNdropTokens.push(C(document,"mousemove",this.onHandleMouseMove))}onTouchStart(){this._dragNdropTokens.push(C(document,"touchend",this.onTouchEnd)),this._dragNdropTokens.push(C(document,"touchmove",this.onTouchMove))}onHandleMouseUp(t){t.stopPropagation(),t.preventDefault(),c(this._dragNdropTokens,k),this._dragNdropTokens.length=0,this.player.setCurrentTime(this._getTimeByEventPosition(t))}onTouchMove(t){t.stopPropagation(),t.preventDefault();const e=this.$bar.getBoundingClientRect(),n=t.touches[0];let i=Math.max(e.left,n.clientX);i=Math.min(e.right,i),i-=e.left;const s=i/this.$bar.offsetWidth*100+"%";this.$handle.style.left=this.$playProgress.style.width=s;const o=this._getTimeByEventPosition(n);this.player.setCurrentTime(o),this.bus.emit("heartbeatextensions")}onTouchEnd(t){t.stopPropagation(),t.preventDefault(),c(this._dragNdropTokens,k),this._dragNdropTokens.length=0}onHandleMouseMove(t){const e=this.$bar.getBoundingClientRect();let n=Math.max(e.left,t.clientX);n=Math.min(e.right,n),n-=e.left;const i=n/this.$bar.offsetWidth*100+"%";this.$handle.style.left=this.$playProgress.style.width=i}onDurationchange(){const t=this.options;t.isLive||t.isProgressLiveStream||this._updateTimes()}onCanplaythrough(){this._updateTimes()}onLoadedmetadata(){this._updateTimes()}_getAriaLabelValue(){const t=this.$current.textContent||"",e=this.$duration.textContent||"";return`Current: ${this._timeCodeToSentence(t)} Total: ${this._timeCodeToSentence(e)}`}_timeCodeToSentence(t){const e=t.split(":"),n=["minutes","seconds"];return e.length>2&&n.unshift("hours"),e.map((t,e)=>`${"0"===t.charAt(0)?t.charAt(1):t} ${n[e]}`).join(" ")}_getDuration(){const{clip:t,timecode:e}=this.options,n=this.player.getDuration();if(t){let[i,s]=t;return i=i||0,s?s+e:n+i}return n}_getCurrentTime(){const t=this.player.getCurrentTime(),{clip:e,timecode:n}=this.options,[i]=e||[0];return Math.max(t,i+n)}onLeave(){this.$tooltip.classList.remove(Mt)}onHover(t){let e;const{useOriginTimeForPreview:n,timecode:i}=this.options,s=t.target||t.srcElement;if(T(s,Ot)){const t=parseInt(s.getAttribute("data-idx")||"0",10),n=this._chapters[t];e=n.from,this.$thumbnailTime.innerHTML=n.text||n.title}else e=this._getTimeByEventPosition(t),this.$thumbnailTime.textContent=Rt(e);if(v(this.thumbnails))return void this._popoverPosition(t);const o=n?e-i:e,r=M(this.thumbnails,({from:t,to:e})=>m(o,t,e));if(r){const[t,e]=String(r.text).split("#");this.$thumbnail.style.backgroundImage=`url("${t}")`;const n=z(e.split("=")).split(","),i=n.pop().trim(),s=n.pop().trim(),o=n.pop().trim(),a=n.pop().trim();this.$thumbnail.style.width=`${s}px`,this.$thumbnail.style.height=`${i}px`,this.$thumbnail.style.backgroundPosition=`-${a}px -${o}px`,this.$thumbnail.style.marginBottom="7px"}else this.$thumbnail.style.height="",this.$thumbnail.style.width="",this.$thumbnail.style.marginBottom="";this._popoverPosition(t)}_updateTimes(){this.$duration.textContent=Rt(this._getDuration()),this.$current.textContent=Rt(this._getCurrentTime()),this.$bar.setAttribute("aria-label",this._getAriaLabelValue()),this._isLoadedMetadata=!0,this._renderChaptersIfNeeded()}_popoverPosition(t){ft(this.player,this._offsetX(t),this.$tooltip),this.$tooltip.classList.add(Mt)}onStatechanged(t,e){(t.toc.lang!==e.toc.lang||t.toc.timedata!==e.toc.timedata)&&this._refreshTOC()}_refreshTOC(){const t=this.state.getTOCTimeData(),e=this.state.getTOCLang();this._chapters=e?t:[],this._renderChaptersIfNeeded()}_renderChaptersIfNeeded(){if(c(this._bubbles,t=>this.$bar.removeChild(t)),this._bubbles.length=0,v(this._chapters)||!this._isLoadedMetadata)return;const t=this.player.getDuration();c(this._chapters,(e,n)=>{const i=w("span",{class:Ot,"data-idx":String(n)},this.$bar);i.style.left=(100*e.from/t).toFixed(0)+"%",this.addEvent(i,"click",t=>{t.stopPropagation(),this._moveHandle2time(e.from),this.player.setCurrentTime(e.from)}),this._bubbles.push(i)})}_getTimeByEventPosition(t){const e=this.player.getDuration(),{timecode:n,clip:i}=this.options,s=this._getPercentageByPosition(t);if(i){let[t,o]=i;return t=t||0,o=o||e+t-n,parseFloat(((o-t)*s+t+n).toFixed(2))}return parseFloat(((e-n)*s+n).toFixed(2))}_getPercentageByPosition(t){const e=this.$bar.getBoundingClientRect();let n=Math.max(e.left,t.clientX);return n=Math.min(e.right,n),n-=e.left,parseFloat((n/this.$bar.offsetWidth).toFixed(2))}_offsetX(t){if(!this.player.getElement())return 0;const e=this.$bar.getBoundingClientRect(),n=this.player.getElement().parentNode,i=n?n.getBoundingClientRect():e;let s=Math.max(e.left,t.clientX);return s=Math.min(e.right,s),s-=i.left,s}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null,this.$bar=null,this.$handle=null,this.$current=null,this.$duration=null,this.$playProgress=null,this.$progress=null,this.$tooltip=null,this.$thumbnail=null,this.$thumbnailTime=null}}],["showAnnotations",class extends pt{constructor(t,e,n){super(t,e,n,["timeupdate","annotationslang"]),_n(this,"$outer",void 0),_n(this,"$button",void 0),_n(this,"$outerHolder",void 0),_n(this,"annotations",[]),_n(this,"sources",[]),_n(this,"current",null),this.logger.debug("annotations:extension:creating"),this.render(),this.init(),this.logger.debug("annotations:extension:created")}init(){this.addEvent(this.$button,"click",()=>{R(this.annotations,this.current),E(this.$outer,Cn),this.current=null,this.player.focus()});const{annotations:t}=this.options;this.sources=i(t)?t:[t]}onAnnotationslang(t){this.annotations.length=0,this.current=null,this.onTimeupdate();const e=M(this.sources,e=>e.srclang===t);e&&ut({url:e.src,success:t=>{try{this.annotations=A(JSON.parse(t.data),En),this.onTimeupdate()}catch(e){this.logger.error("Error occurred when parsing the response",t.data,e)}}})}render(){this.$outer=w("div",{class:wn}),this.$button=w("button",{type:"button",class:Tn},this.$outer),this.$button.setAttribute("aria-label","Close annotation"),Yt(this.$button,"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",{width:16,height:16}),this.$outerHolder=w("div",{class:kn},this.$outer)}onTimeupdate(){const t=this.player.getCurrentTime();var e,n;b(this.current)&&m(t,this.current.from,this.current.to)||(this.current=M(this.annotations,e=>m(t,e.from,e.to)),b(this.current)?(e=this.$outer,n=this.current,e.style.top=`${n.top}px`,e.style.left=`${n.left}px`,e.style.width=`${n.width}px`,e.style.height=`${n.height}px`,e.style.fontSize=n.fontsize,e.style.color=`#${n.fontcolor}`,e.style.backgroundColor=`#${n.background}`,function(t,e){t.textContent=e;let n=function(t){return t.replace(Sn,'<a href="$1">$1</a>')}(t.innerHTML);n=function(t){return t.replace(/\n/g,"<br />")}(n),t.innerHTML=n}(this.$outerHolder,this.current.text),S(this.$outer,Cn)):E(this.$outer,Cn))}getOuter(){return this.$outer}destroy(){if(super.destroy(),this.$outer){const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}}],["showTheaterMode",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["statechanged"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("theater:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.toggle.bind(this)),P(this.$el,Ii,e.isTheaterMode()),this.logger.debug("theater:extension:created")}render(){this.$el=w("button",{type:"button",class:Bi}),Yt(this.$el,"M19 7H5c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm0 8H5V9h14v6z",{class:`${Bi}__icon`}),Yt(this.$el,"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z",{class:`${Bi}__exit-icon`});const t=()=>this.$t(this.state.isTheaterMode()?"exit-theater":"theater");setTimeout(()=>Xt(this,{$button:this.$el,text:t}))}toggle(){this.bus.emit("theaterchanging")}onStatechanged(t){P(this.$el,Ii,t.isTheaterMode),P(this.$el,Vi,t.isFullScreen)}getElement(){return this.$el}}],["showClosedCaptions",class extends pt{constructor(t,e,n){super(t,e,n,["timeupdate","showpopup","statechanged"]),Le(this,"$el",void 0),Le(this,"$button",void 0),Le(this,"$selector",void 0),Le(this,"$text",void 0),Le(this,"$textHolder",void 0),Le(this,"$mainStep",void 0),Le(this,"$embedCaptions",void 0),Le(this,"$settingsStep",void 0),Le(this,"$settings",void 0),Le(this,"$toMain",void 0),Le(this,"$toSettings",void 0),Le(this,"$fontColorSettings",void 0),Le(this,"$backgroundColorSettings",void 0),Le(this,"$fontSizeSettings",void 0),Le(this,"$fontFamilySettings",void 0),Le(this,"$locationSettings",null),Le(this,"$currentColor",void 0),Le(this,"$currentSize",void 0),Le(this,"$currentBgColor",void 0),Le(this,"$currentLocation",void 0),Le(this,"$currentFamily",void 0),Le(this,"$additionalStep",void 0),Le(this,"$additionalBackText",void 0),Le(this,"$additionalStepWrapper",void 0),Le(this,"$translate",null),Le(this,"$currentCustomTranslate",null),Le(this,"$captions",[]),Le(this,"$translatableCaptions",[]),Le(this,"embedCaptionsAutoShow",!0),this.logger.debug("cc:extension:creating"),this.render(),this.init(),this.logger.debug("cc:extension:created")}init(){ke(this,["_toSettingsPage","_toMainPage","_toColorPage","_toBackgroundColorPage","_toFontFamilyPage","_toSizesPage","_toLocationsPage","_toTranslatePage","_handleEmbedChanged"]),Ce(this,{$button:this.$button,$selector:this.$selector,SELECTOR_OPEN_CN:ze,heightControl:!0,firstFocusItemSelector:`.${Ie}`,toMainFn:this._toMainPage.bind(this)}),Xt(this,{$button:this.$button,text:this.$t("cc")}),this.addEvent(this.$settings,"click",this._toSettingsPage),this.addEvent(this.$toMain,"click",this._toMainPage),this.addEvent(this.$toSettings,"click",this._toSettingsPage),this.addEvent(this.$fontColorSettings,"click",this._toColorPage),this.addEvent(this.$backgroundColorSettings,"click",this._toBackgroundColorPage),this.addEvent(this.$fontFamilySettings,"click",this._toFontFamilyPage),this.addEvent(this.$fontSizeSettings,"click",this._toSizesPage),this.$locationSettings&&this.addEvent(this.$locationSettings,"click",this._toLocationsPage),this.$translate&&this.addEvent(this.$translate,"click",this._toTranslatePage),this.player.$el?.textTracks.addEventListener("addtrack",this._handleEmbedChanged),this.player.$el?.textTracks.addEventListener("change",this._handleEmbedChanged),this._toMainPage(),this._refresh(),this.changeLang(this.state.getCCLang())}render(){this.$el=w("div",{class:Me}),this.$button=w("button",{type:"button",class:Ae},this.$el),this.$selector=w("div",{class:Fe},this.$el),this.$text=w("span",{class:Qe}),this.$textHolder=w("span",{class:Ze},this.$text),this._renderMainPage(),this._renderSettingsPage(),this._renderAdditionalPage()}_handleEmbedChanged(){const t=this.player.getTextTracks(),e=this.state.getCCSources();this.$el.style.display=e.length||t?.length?"block":"none";const n=()=>{const e=w("button",{type:"button",class:Ie},this.$embedCaptions);e.textContent="None",this.addEvent(e,"click",()=>{c(t,t=>{c(this.$captions,t=>E(t,Ve)),t.mode="disabled",S(e,Ve)})}),this.$captions.push(e)};if(e.length)this.$settings.style.display="block";else{this.$settings.style.display="none";const t=this.$embedCaptions.childNodes[0];t&&"None"===t?.textContent||n()}t?.length&&c(t,e=>{if(M(this.$captions,t=>t.textContent===e.label))return;const n=w("button",{type:"button",class:Ie},this.$embedCaptions);n.textContent=e.label,this.addEvent(n,"click",()=>{c(this.$captions,t=>E(t,Ve)),c(this.$translatableCaptions,t=>E(t,Ve));const i=this.$captions.findIndex(t=>t===n);S(this.$captions[i],Ve),c(t,(e,n)=>{t[n].mode="disabled"}),e.mode="showing"}),this.$captions.push(n),this.embedCaptionsAutoShow&&(n.click(),this.embedCaptionsAutoShow=!1)})}_renderMainPage(){this.$mainStep=w("div",{class:He,tabindex:"-1"},this.$selector),Yt(this.$button,"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z");const t=this.state.getCCSources();this.$el.style.display=t.length?"block":"none";const e=L(t,t=>3!==t.state&&0!==t.state);c(e,t=>{const e=w("button",{type:"button",class:Ie},this.$mainStep);e.textContent=1===t.state?`${t.label} ${this.$t("unapproved-source")}`:t.label,this.addEvent(e,"click",()=>this.bus.emit("cclang",t.srclang)),this.$captions.push(e)}),this.$embedCaptions=w("div",{},this.$mainStep);const n=w("button",{type:"button",class:Ue},this.$mainStep);this.$translate=n;let i=w("span",{},n);i.textContent=this.$t("translate"),tn(n),this.$currentCustomTranslate=w("span",{class:Ge},this.$translate);const s=e.length!==t.length;n.style.display=s?"block":"none",this.$settings=w("button",{type:"button",class:Ue},this.$mainStep),i=w("span",{},this.$settings),i.textContent=this.$t("settings"),tn(this.$settings)}_rerenderLanguages(t){const{$mainStep:e,$translate:n,$settings:i}=this;if(this.$el.style.display=t.length?"block":"none",!e)return;c(this.$captions,t=>{e.removeChild(t)}),this.$captions.length=0;const s=L(t,t=>3!==t.state&&0!==t.state);if(c(s,t=>{const e=w("button",{type:"button",class:Ie},this.$mainStep);e.textContent=1===t.state?`${t.label} ${this.$t("unapproved-source")}`:t.label,this.addEvent(e,"click",()=>this.bus.emit("cclang",t.srclang)),this.$captions.push(e)}),n){e.removeChild(n);const i=s.length!==t.length;n.style.display=i?"block":"none",_(e,n)}i&&(e.removeChild(i),_(e,i))}_renderSettingsPage(){this.$settingsStep=w("div",{class:De},this.$selector),this.$toMain=w("button",{type:"button",class:Ke},this.$settingsStep),Yt(w("span",{class:"arrow"},this.$toMain),Wt,{class:"arrow"}),w("span",{},this.$toMain).textContent=this.$t("cc");const t=w("div",{class:`${Xe} tab-content`},this.$settingsStep);this.$fontColorSettings=w("button",{type:"button"},t);let e=w("span",{},this.$fontColorSettings);e.textContent=this.$t("settings-fontcolor"),tn(this.$fontColorSettings),this.$currentColor=w("span",{class:Ge},this.$fontColorSettings);let n=M(Te,t=>t.value===this.state.getCCTextColor());this.$currentColor.textContent=n&&n.key?this.$t(n.key):"",this.$fontSizeSettings=w("button",{type:"button"},t),e=w("span",{},this.$fontSizeSettings),e.textContent=this.$t("settings-fontsize"),tn(this.$fontSizeSettings),this.$currentSize=w("span",{class:Ge},this.$fontSizeSettings),this.$currentSize.textContent=this.state.getCCFontSize(),this.$fontFamilySettings=w("button",{type:"button"},t),e=w("span",{},this.$fontFamilySettings),e.textContent=this.$t("settings-fontfamily"),tn(this.$fontFamilySettings),this.$currentFamily=w("span",{class:Ge},this.$fontFamilySettings);const i=M(Ee,t=>t.value===this.state.getCCFontFamily());if(this.$currentFamily.textContent=i&&i.key?this.$t(i.key):"",this.$backgroundColorSettings=w("button",{type:"button"},t),e=w("span",{},this.$backgroundColorSettings),e.textContent=this.$t("settings-background"),tn(this.$backgroundColorSettings),this.$currentBgColor=w("span",{class:Ge},this.$backgroundColorSettings),n=M(Te,t=>t.value===this.state.getCCBgColor()),this.$currentBgColor.textContent=n&&n.key?this.$t(n.key):"",this.options.showCCLayout){const n=w("button",{type:"button"},t);this.$locationSettings=n,e=w("span",{},n),e.textContent=this.$t("settings-captionlocations"),tn(n),this.$currentLocation=w("span",{class:Ge},this.$locationSettings);const i=M(Pe,t=>t.value===this.state.getCCLocation());this.$currentLocation.textContent=i&&i.key?this.$t(i.key):""}const s=w("div",{class:`${Je} tab-content`},this.$settingsStep);c(L(this.state.getCCSources(),t=>3===t.state||0===t.state),t=>{const e=w("button",{type:"button",class:Ie},s);e.textContent=t.label,this.addEvent(e,"click",()=>{this.bus.emit("cclang",t.srclang),this._toMainPage()}),this.$translatableCaptions.push(e)})}_renderAdditionalPage(){this.$additionalStep=w("div",{class:Be},this.$selector),this.$toSettings=w("button",{type:"button",class:Ke},this.$additionalStep),Yt(w("span",{class:"arrow"},this.$toSettings),Wt,{class:"arrow"}),this.$additionalBackText=w("span",{},this.$toSettings),this.$additionalStepWrapper=w("div",{class:"tab-content"},this.$additionalStep)}onStatechanged(t,e){t.cc.sources!==e.cc.sources?(this._rerenderLanguages(t.cc.sources),this.changeLang(t.cc.lang)):t.cc.lang!==e.cc.lang?this.changeLang(t.cc.lang):t.cc.timedata!==e.cc.timedata?this.onLoadingTimedata():t.cc.location===e.cc.location&&t.cc.fontFamily===e.cc.fontFamily&&t.cc.fontSize===e.cc.fontSize&&t.cc.bgcolor===e.cc.bgcolor&&t.cc.color===e.cc.color||this._refresh()}onLoadingTimedata(){const t=this.state.getSelectedCC(),{$currentCustomTranslate:e,$translate:n}=this;e&&n&&(E(n,We),e.textContent="",t&&!t.state&&(e.textContent=t.label)),this.onTimeupdate()}changeLang(t){c(this.$captions,t=>E(t,Ve)),c(this.$translatableCaptions,t=>E(t,Ve));const e=this.player.getTextTracks();e?.length&&c(e,t=>{t.mode="disabled"});const n=this.state.getCCSources(),i=L(n,t=>3!==t.state&&0!==t.state),{$currentCustomTranslate:s,$translate:o}=this;s&&(s.textContent="");let r=O(i,e=>e.srclang===t);if(-1===r){const e=L(n,t=>!t.state);r=O(e,e=>e.srclang===t),this.$translatableCaptions[r]&&S(this.$translatableCaptions[r],Ve),s&&e[r]&&(s.textContent=this.$t("translating")),o&&S(o,We)}else this.$captions[r]&&S(this.$captions[r],Ve),t||E(this.$text,Ye)}onTimeupdate(){const t=this.state.getCCLang(),e=this.state.getCCTimeData();if(!t)return;if(v(e))return void E(this.$text,Ye);const n=this.player.getCurrentTime(),i=M(e,({from:t,to:e})=>m(n,t,e));i?(this.$textHolder.innerHTML=i.text.split("\n").join("<br>"),S(this.$text,Ye)):E(this.$text,Ye)}onShowpopup(t){t===this.$selector&&(T(this.$selector,Ne)?we(this.player,this.$mainStep):T(this.$selector,Oe)?we(this.player,this.$settingsStep):T(this.$selector,Re)&&we(this.player,this.$additionalStep))}_toMainPage(){S(this.$selector,Ne),E(this.$selector,Oe),E(this.$selector,Re),E(this.$selector,je),we(this.player,this.$mainStep);const t=document.querySelectorAll(`.${He} > .${Ie}`);t[0]&&t[0].focus()}_toSettingsPage(){S(this.$selector,Oe),E(this.$selector,Ne),E(this.$selector,Re),E(this.$selector,je),we(this.player,this.$settingsStep),document.querySelector(`.${Ke}`).focus()}_toAdditionalPage(){S(this.$selector,Re),E(this.$selector,Oe),E(this.$selector,Ne),E(this.$selector,je),c(j(this.$additionalStepWrapper.childNodes),t=>this.$additionalStepWrapper.removeChild(t)),we(this.player,this.$additionalStep)}_toTranslatePage(){this.state.isTranslatingCC()||(S(this.$selector,je),E(this.$selector,Oe),E(this.$selector,Ne),E(this.$selector,Re),we(this.player,this.$settingsStep),document.querySelector(`.${Ke}`).focus())}_prepareAdditionalPage(t,e,n,i){this._toAdditionalPage(),this.$additionalBackText.textContent=this.$t(t),this.$toSettings.focus();const s=[],o=this.state[e]();c(i,t=>{const e=w("button",{type:"button",class:Ie},this.$additionalStepWrapper),i=t.key;e.textContent=i?this.$t(i):t.label||"",o===t.value&&S(e,Ve),this.addEvent(e,"click",()=>{c(s,t=>E(t,Ve)),S(e,Ve),this.bus.emit(n,t.value),this._toSettingsPage()}),s.push(e)})}_toColorPage(){this._prepareAdditionalPage("settings-fontcolor","getCCTextColor","cccolor",Te)}_toBackgroundColorPage(){this._prepareAdditionalPage("settings-background","getCCBgColor","ccbgcolor",Te)}_toSizesPage(){this._prepareAdditionalPage("settings-fontsize","getCCFontSize","ccfontsize",Se)}_toFontFamilyPage(){this._prepareAdditionalPage("settings-fontfamily","getCCFontFamily","ccfontfamily",Ee)}_toLocationsPage(){this._prepareAdditionalPage("settings-captionlocations","getCCLocation","cclocation",Pe)}_detectLabel(t,e){const n=M(t,t=>t.value===e);if(!n)return"";const i=n.key;return i?this.$t(i):n.label||""}_refresh(){const t=this.state.getCCTextColor(),e=this.state.getCCBgColor(),n=this.state.getCCFontSize(),i=this.state.getCCFontFamily();this.$textHolder.style.color=t,this.$textHolder.style.backgroundColor=e,this.$textHolder.style.fontSize=n,this.$textHolder.style.fontFamily=i,this.$currentColor.textContent=this._detectLabel(Te,t),this.$currentBgColor.textContent=this._detectLabel(Te,e),this.$currentSize.textContent=this._detectLabel(Se,n),this.$currentFamily.textContent=this._detectLabel(Ee,i),this.$currentLocation&&(this.$currentLocation.textContent=this._detectLabel(Pe,this.state.getCCLocation()))}getElement(){return this.$el}getOuter(){return this.$text}destroy(){super.destroy(),this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el),this.$text.parentNode&&this.$text.parentNode.removeChild(this.$text)}}],["showTOC",class extends pt{constructor(t,e,n){super(t,e,n,["statechanged"]),en(this,"$el",void 0),en(this,"$button",void 0),en(this,"$selector",void 0),en(this,"$mainStep",void 0),en(this,"$languagesStep",void 0),en(this,"$chaptersWrapper",void 0),en(this,"$moreLanguages",void 0),en(this,"$currentLanguage",void 0),en(this,"$toMain",void 0),en(this,"$translateStep",void 0),en(this,"$toLanguages",void 0),en(this,"$translate",null),en(this,"$currentCustomTranslate",null),en(this,"$languages",[]),en(this,"$translatableLanguages",[]),en(this,"$items",[]),this.logger.debug("toc:extension:creating"),ke(this,["_toMainPage","_toLanguagesPage","_toTranslatePage"]),this.render(),this.init(),this.changeLang(this.state.getTOCLang()),this.logger.debug("toc:extension:created")}init(){const{$button:t,$selector:e}=this;Ce(this,{$button:t,$selector:e,SELECTOR_OPEN_CN:hn,heightControl:!0,firstFocusItemSelector:"button",toMainFn:this._toMainPage.bind(this)}),Xt(this,{$button:t,text:this.$t("chapters")}),this.addEvent(this.$moreLanguages,"click",this._toLanguagesPage),this.addEvent(this.$toMain,"click",this._toMainPage),this.addEvent(this.$toLanguages,"click",this._toLanguagesPage),this._toMainPage()}render(){this.$el=w("div",{class:nn}),this.$button=w("button",{type:"button",class:sn},this.$el),this.$selector=w("div",{class:on},this.$el),Yt(this.$button,"M3 9h14V7H3v2zm0 4h14v-2H3v2zm0 4h14v-2H3v2zm16 0h2v-2h-2v2zm0-10v2h2V7h-2zm0 6h2v-2h-2v2z"),this.$mainStep=w("div",{class:dn,tabindex:-1},this.$selector),this.$languagesStep=w("div",{class:cn},this.$selector),this.$chaptersWrapper=w("div",{class:`${mn} tab-content`},this.$mainStep),this.$moreLanguages=w("button",{type:"button",class:gn},this.$mainStep),w("span",{},this.$moreLanguages).textContent=this.$t("language"),xn(this.$moreLanguages),this.$currentLanguage=w("span",{class:$n},this.$moreLanguages),this.$toMain=w("button",{type:"button",class:un},this.$languagesStep);let t=w("span",{class:"arrow"},this.$toMain);Yt(t,Wt,{class:"arrow"});let e=w("span",{},this.$toMain);e.textContent=this.$t("chapters"),this.$translateStep=w("div",{class:vn},this.$selector),this.$toLanguages=w("button",{type:"button",class:un},this.$translateStep),t=w("span",{class:"arrow"},this.$toLanguages),Yt(t,Wt,{class:"arrow"}),e=w("span",{},this.$toLanguages),e.textContent=this.$t("language"),this.fillLanguages()}fillLanguages(){c(this.$languages,t=>{this.$languagesStep&&this.$languagesStep.removeChild(t)}),c(this.$translatableLanguages,t=>{this.$languagesStep&&this.$languagesStep.removeChild(t)}),this.$translate&&this.$languagesStep.removeChild(this.$translate),this.$languages=[],this.$translatableLanguages=[];const t=this.state.getTOCSources(),e=L(t,t=>!!t.state);if(this.$el.style.display=t.length?"block":"none",c(e,t=>{const e=w("button",{type:"button",class:yn},this.$languagesStep);e.textContent=1===t.state?`${t.label} ${this.$t("unapproved-source")}`:t.label,this.addEvent(e,"click",()=>{this._toMainPage(),this.bus.emit("toclang",t.srclang)}),this.$languages.push(e)}),e.length!==t.length){const t=w("button",{type:"button",class:mn},this.$languagesStep);this.$translate=t,w("span",{},t).textContent=this.$t("translate"),xn(t),this.$currentCustomTranslate=w("span",{class:$n},this.$translate),this.addEvent(t,"click",this._toTranslatePage)}c(L(t,t=>!t.state),t=>{const e=w("button",{type:"button",class:yn},this.$translateStep);e.textContent=t.label,this.addEvent(e,"click",()=>{this._toMainPage(),this.bus.emit("toclang",t.srclang)}),this.$translatableLanguages.push(e)})}onStatechanged(t,e){t.toc.sources!==e.toc.sources&&this.fillLanguages(),t.toc.lang!==e.toc.lang&&this.changeLang(t.toc.lang),t.toc.timedata!==e.toc.timedata&&this.renderTimeData()}changeLang(t){c(this.$languages,t=>E(t,fn)),c(this.$translatableLanguages,t=>E(t,fn));const e=this.state.getTOCSources(),n=L(e,t=>!!t.state);this.$currentCustomTranslate&&(this.$currentCustomTranslate.textContent="");let i=O(n,e=>e.srclang===t);if(-1===i){const n=L(e,t=>!t.state);if(i=O(n,e=>e.srclang===t),-1===i)return;S(this.$translatableLanguages[i],fn),this.$currentCustomTranslate&&(this.$currentCustomTranslate.textContent=n[i].label),this.$currentLanguage.textContent=n[i].label}else S(this.$languages[i],fn),this.$currentLanguage.textContent=n[i].label;this.renderTimeData()}renderTimeData(){const t=this.state.getTOCLang()?this.state.getTOCTimeData():[];c(this.$items,t=>{this.$chaptersWrapper.removeChild(t)}),this._toMainPage(),this.$items.length=0,c(t,t=>{const e=w("button",{href:"#",class:bn},this.$chaptersWrapper);e.innerHTML=t.text||t.title,this.addEvent(e,"click",e=>{e.preventDefault(),e.stopPropagation();const n=this.player.isPaused();this.player.setCurrentTime(t.from),n&&this.player.play()}),this.$items.push(e)})}_toMainPage(){S(this.$selector,rn),E(this.$selector,an),E(this.$selector,ln),we(this.player,this.$mainStep),setTimeout(()=>{const t=document.querySelectorAll(`.${mn} > .${bn}`);if(t[0])t[0].focus();else{const t=document.querySelector(`.${gn}`);t&&t.focus()}})}_toLanguagesPage(){S(this.$selector,an),E(this.$selector,rn),E(this.$selector,ln),we(this.player,this.$languagesStep);const t=document.querySelector(`.${cn} > .${un}`);t&&t.focus()}_toTranslatePage(){S(this.$selector,ln),E(this.$selector,rn),E(this.$selector,an),this.$translateStep&&we(this.player,this.$translateStep);const t=document.querySelector(`.${vn} > .${un}`);t&&t.focus()}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$items.length=0,this.$languages.length=0,this.$translatableLanguages.length=0}}],["showAudioTracks",class extends pt{constructor(t,e,n){super(t,e,n,["loadeddata","audiotrackswitched"]),Ui(this,"$el",void 0),Ui(this,"$button",void 0),Ui(this,"$selector",void 0),this.logger.debug("audio-tracks:extension:creating"),this.render(),this.init(),this.logger.debug("audio-tracks:extension:created")}render(){this.$el=w("div",{class:Wi}),this.$button=w("button",{type:"button",class:qi},this.$el),this.$selector=w("div",{class:Gi,tabindex:"-1"},this.$el),Yt(this.$button,"M12 1c-4.97 0-9 4.03-9 9v7c0 1.66 1.34 3 3 3h3v-8H5v-2c0-3.87 3.13-7 7-7s7 3.13 7 7v2h-4v8h3c1.66 0 3-1.34 3-3v-7c0-4.97-4.03-9-9-9z")}init(){const t=this.$button,e=this.$selector;Xt(this,{$button:t,text:this.$t("audio-tracks")}),Ce(this,{$button:t,$selector:e,SELECTOR_OPEN_CN:Qi,reposition:!1,closeOnClick:!0,heightControl:!0,firstFocusItemSelector:`.${Yi}`})}_renderAudioTracks(){c(j(this.$selector.childNodes),t=>this.$selector.removeChild(t));const t=this.player.getAudioTrack(),e=[];c(this.player.getAudioTracks(),(n,i)=>{if(!n||"object"!=typeof n)return;const s=w("button",{type:"button",class:Yi},this.$selector);s.textContent=n.name||n.label,+i===t&&S(s,Zi),this.addEvent(s,"click",()=>{c(e,t=>E(t,Zi)),S(s,Zi),this.player.setAudioTrack(n.id)}),e.push(s)})}onAudiotrackswitched(){this._renderAudioTracks()}onLoadeddata(){this.player.isMultiAudioTracks()?this._renderAudioTracks():this.$el.style.display="none"}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}],["showPlaceholder",class extends pt{constructor(t,e,n){super(t,e,n),An(this,"$outer",void 0),An(this,"$placeholderIcon",void 0),An(this,"$playButton",void 0),this.logger.debug("placeholder:extension:creating"),Dn=this.options.accessibility,this.render(),n.isHandlingKeyboardEvents&&this.addEvent(document,"keydown",this.onKeyDown.bind(this),n.globalKeyboardListeners),this.addEvent(this.$outer,"click",this.onPlaceholderClick.bind(this)),this.addEvent(this.$playButton,"click",this.onPlaceholderClick.bind(this)),setTimeout(()=>{const t=this.$outer.parentNode?.querySelector(".rmp-ext-title");t&&this.addEvent(t,"click",this.onPlaceholderClick.bind(this)),this.$outer.parentNode&&this.addEvent(this.$outer.parentNode,"dblclick",this.toggleFullScreen.bind(this))}),this.logger.debug("placeholder:extension:created")}render(){this.$outer=w("div",{class:Fn,tabindex:-1}),this.$placeholderIcon=w("div",{class:Nn,tabindex:-1},this.$outer),this.$playButton=w("button",{type:"button",class:On,tabindex:-1},this.$outer),Yt(this.$playButton,Dt),this.$playButton.setAttribute("aria-label","Play")}onPlaceholderClick(){this.logger.debug("placeholder:click"),clearTimeout(jn),jn=setTimeout(()=>this._togglePlay(),350)}onKeyDown(t){if(!this.player.getElement())return;this.logger.debug("placeholder:keydown");const e=t.target||t.srcElement;let n=e===this.player.getElement();n=n||T(e,"rplayer"),n=n||this.player.getElement().parentNode?.contains(e)||!1,(n||this.options.globalKeyboardListeners&&!function(t){let e=!1;return e=e||t instanceof HTMLTextAreaElement,e=e||t instanceof HTMLInputElement&&"text"===t.type,e}(t.target))&&this._processKeyDown(t)}_processKeyDown(t){if(t.target instanceof HTMLInputElement)return;const e=t.keyCode;if(32===e&&Dn&&"BUTTON"===t.target.tagName)return;let n=Rn[e];b(n)&&o(this[n])&&(this[n](this.player),t.preventDefault(),t.stopPropagation());const i=this.options.keyboardListeners?this.options.keyboardListeners[e]:null;b(i)&&o(i)&&(i(this.player),t.preventDefault(),t.stopPropagation())}toggleFullScreen(){this.logger.debug("placeholder:toggleFullScreen"),clearTimeout(jn),this.options.showFullScreen&&this.bus.emit("fullscreenchanging")}_togglePlay(){this.logger.debug("placeholder:togglePlay"),this.options.isMobile?this.bus.emit("mobiletouch"):this.player.isPaused()?(this.player.play(),this._showAction("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z")):(this.player.pause(),this._showAction("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"))}_skeepLeft(){this.logger.debug("placeholder:skeepLeft"),this.player.setCurrentTime(this.player.getCurrentTime()-(this.options.skipDelta||0)),this._showAction(Bt)}_skeepRight(){this.logger.debug("placeholder:skeepRight"),this.player.setCurrentTime(this.player.getCurrentTime()+(this.options.skipDelta||0)),this._showAction(It)}_upVolume(){this.logger.debug("placeholder:volumeup");const t=Math.min(1,.1+this.player.getVolume());this.player.setMuted(!1),this.player.setVolume(t),this._showAction(Qt)}_downVolume(){this.logger.debug("placeholder:volumedown");const t=Math.max(0,this.player.getVolume()-.1).toFixed(2);t==(0).toString()?(this.player.setVolume(0),this.player.setMuted(!0),this._showAction(Gt)):(this.player.setVolume(parseFloat(t)),this._showAction("M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z"))}_showAction(t){this.logger.debug("placeholder:showaction"),E(this.$outer,zn),clearTimeout(Hn),Hn=setTimeout(()=>{this.logger.debug("placeholder:showaction:clear"),this._clearPlaceholderIcon(),Yt(this.$placeholderIcon,t),S(this.$outer,zn),Hn=setTimeout(()=>{this.logger.debug("placeholder:showaction:remove"),this._clearPlaceholderIcon(),E(this.$outer,zn)},500)},350)}_clearPlaceholderIcon(){this.$placeholderIcon.childNodes.length&&c(j(this.$placeholderIcon.childNodes),t=>{this.$placeholderIcon.removeChild(t)})}_prevFrame(){this.player.prevFrame()}_nextFrame(){this.player.nextFrame()}getOuter(){return this.$outer}destroy(){super.destroy(),this.$outer.removeChild(this.$placeholderIcon),this.$outer.parentNode&&this.$outer.parentNode.removeChild(this.$outer),this.$outer=null,this.$placeholderIcon=null}}],["showCaptionSearch",class extends pt{constructor(t,e,n){super(t,e,n,["statechanged","timeupdate","showpopup","loadedmetadata","canplaythrough"]),Ji(this,"$el",void 0),Ji(this,"$button",void 0),Ji(this,"$selector",void 0),Ji(this,"$captions",void 0),Ji(this,"$input",void 0),Ji(this,"$clearBtn",void 0),Ji(this,"filter",""),this.logger.debug("search:extension:creating"),this.render(),this.init(),ke(this,["onTimeupdate"]),this.logger.debug("search:extension:created")}render(){this.$el=w("div",{class:Xi}),this.$button=w("button",{type:"button",class:es},this.$el),this.$selector=w("div",{class:ns},this.$el),this.$captions=w("div",{class:ss},this.$selector),this.$input=w("input",{class:os,placeholder:this.$t("caption-search")},this.$selector),this.$clearBtn=w("button",{class:`${cs} ${ts}`},this.$selector),Yt(this.$clearBtn,"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"),Yt(this.$button,"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z")}init(){const t=this.$button,e=this.$selector;Xt(this,{$button:t,text:this.$t("caption-search")}),Ce(this,{$button:t,$selector:e,SELECTOR_OPEN_CN:is,reposition:!1,closeOnClick:!1,heightControl:!1}),this.addEvent(this.$input,"input",()=>{this.filter=this.$input.value,this.renderCaptions(),this.$input.value?this.$clearBtn.classList.remove(ts):this.$clearBtn.classList.add(ts)}),this.$clearBtn.addEventListener("click",()=>{this.$input.value="",this.filter="",this.renderCaptions()})}onStatechanged(t,e){t.cc.lang!==e.cc.lang?this.handleCaptionLanguageChanged(t.cc.lang):t.cc.timedata!==e.cc.timedata&&this.handleTimeDataChanged()}onCanplaythrough(){this.handleTimeDataChanged()}onLoadedmetadata(){this.handleTimeDataChanged()}handleCaptionLanguageChanged(t){P(this.$el,ts,!t)}handleTimeDataChanged(){const t=this.state.getCCLang();this.handleCaptionLanguageChanged(t),this.renderCaptions()}filteredCaptions(){const t=new RegExp(this.filter.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"ig");return L(this.state.getCCTimeData(),e=>(t.lastIndex=0,t.test(e.text)))}renderCaptions(){const t=this.player.getDuration();if(!t)return;const e=t>3600;c(j(this.$captions.childNodes),t=>this.$captions.removeChild(t)),c(this.filteredCaptions(),t=>{const n=w("button",{type:"button",class:rs,id:ps(t.id)},this.$captions);w("span",{class:ls},n).textContent=gt(t.from,e);const i=(s=t.text,Ki.innerHTML=s,Ki.textContent);var s;w("span",{class:hs,title:i},n).textContent=i,this.addEvent(n,"click",e=>{e.preventDefault(),e.stopPropagation();const n=this.player.isPaused();this.player.setCurrentTime(t.from),n&&this.player.play()})})}onShowpopup(){this.onTimeupdate(),this.scrollToCurrentCaption()}scrollToCurrentCaption(){const t=this.filteredCaptions(),e=this.player.getCurrentTime(),n=O(t,({from:t,to:n})=>m(e,t,n));if(n>-1){const t=j(this.$captions.childNodes)[Math.max(0,n-2)];t&&function(t,e){const{top:n}=t.getBoundingClientRect(),i=e.getBoundingClientRect(),s=e.scrollTop,o=Math.floor(n-i.top);e.scrollTop=s+o}(t,this.$captions)}}onTimeupdate(){const t=this.filteredCaptions();if(v(t))return;const e=this.player.getCurrentTime(),n=O(t,({from:t,to:n})=>m(e,t,n));if(n>-1){const e=t[n],i=document.getElementById(ps(e.id));if(!i)return void c(j(this.$captions.childNodes),t=>E(t,as));if(T(i,as))return;c(j(this.$captions.childNodes),t=>E(t,as)),S(i,as)}else c(j(this.$captions.childNodes),t=>E(t,as))}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t instanceof HTMLElement&&t.removeChild(this.$el),this.$el=null}}],["showDownload",class extends pt{constructor(t,e,n){super(t,e,n),Gn(this,"$el",void 0),Gn(this,"$button",void 0),Gn(this,"$selector",void 0),Gn(this,"$link",void 0),Gn(this,"$mainStep",void 0),Gn(this,"$video",void 0),Gn(this,"$cc",void 0),Gn(this,"$transcript",void 0),Gn(this,"$mp4",void 0),Gn(this,"$svg",void 0),Gn(this,"$spinner",void 0),Gn(this,"$additionalStep",void 0),Gn(this,"$back",void 0),Gn(this,"$backText",void 0),Gn(this,"$additional",void 0),this.logger.debug("download:extension:creating"),this.render(),this.init(),this.logger.debug("download:extension:created")}render(){this.$el=w("span",{class:Qn,"data-testid":"download"}),this.$button=w("button",{type:"button",class:Yn},this.$el),this.$selector=w("div",{class:Zn},this.$el),this.$link=w("a",{style:"display: none;"},this.$selector),this.$mainStep=w("div",{class:ti},this.$selector),this.options.showDownloadVideo&&(this.$video=w("button",{type:"button",class:ii},this.$mainStep),w("span",{},this.$video).textContent=this.$t("video-drm"),S(this.$video,Xn),si(this.$video)),this.options.showDownloadCC&&(this.$cc=w("button",{type:"button",class:ii},this.$mainStep),w("span",{},this.$cc).textContent=this.$t("cc"),S(this.$cc,Xn),si(this.$cc),this.$transcript=w("button",{type:"button",class:ii},this.$mainStep),w("span",{},this.$transcript).textContent=this.$t("transcript"),S(this.$transcript,Xn),si(this.$transcript)),this.options.downloadVideoURL&&(this.$mp4=w("button",{type:"button",class:ii},this.$mainStep),w("span",{},this.$mp4).textContent=this.$t("video-drm")),this.$svg=Yt(this.$button,"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"),this.$spinner=w("img",{src:"/images/Spinner-small.gif",height:"26",width:"26"}),this.$additionalStep=w("div",{class:ei},this.$selector),this.$back=w("button",{type:"button",class:ni},this.$additionalStep),Yt(w("span",{class:"arrow"},this.$back),Wt),this.$backText=w("span",{},this.$back),this.$additional=w("div",{class:"tab-content"},this.$additionalStep)}init(){const t=this.$button,e=this.$selector,n=this.options;Ce(this,{$button:t,$selector:e,SELECTOR_OPEN_CN:Kn,reposition:!1,closeOnClick:!1,firstFocusItemSelector:`.${ii}`,toMainFn:this._toMain.bind(this)}),Xt(this,{$button:t,text:this.$t("download")}),!v(n.downloadCCLanguages)||n.showDownloadCC||n.downloadVideoURL?(n.downloadVideoURL&&this.addEvent(this.$mp4,"click",this.performClick.bind(this,n.downloadVideoURL)),this.addEvent(this.$back,"click",()=>this._toMain()),n.showDownloadVideo&&this.addEvent(this.$video,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("video-drm")),this._renderVideos()}),n.showDownloadCC&&(this.addEvent(this.$transcript,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("transcript")),this._renderTranscripts()}),this.addEvent(this.$cc,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("cc")),this._renderClosedCaptions()}))):this.addEvent(this.$el,"click",this.downloadDRMVideo.bind(this,null))}downloadDRMVideo(t){let e=this.options.downloadURL;null!==t&&(e+="?ccLang="+t),this.bus.emit("downloadRequested",e,this.performClick.bind(this)),this.$button.removeChild(this.$svg),this.$button.appendChild(this.$spinner)}downloadTranscript(t){const e=`transcript__${t.srclang}.txt`;"json"===t.type?ut({url:t.src,success:t=>this.prepareTranscriptForDownload(JSON.parse(t.data),e)}):yt(t.src,t=>this.prepareTranscriptForDownload(t,e),()=>{})}prepareTranscriptForDownload(t,e){const{text:n}=t.reduce(({prevSegmentTime:t,text:e},n)=>(t>0&&n.from>=t+.1&&(e+="\r\n"),e=e+n.text.replace(/(\r?\n|\r)$/,"").replace(/<br\s*\/?>/gm,"\r\n")+"\r\n",{prevSegmentTime:n.to,text:e}),{text:"",prevSegmentTime:0});var i=new Blob([n],{type:"text/plain;charset=utf-8"});qn(i,e)}downloadCC(t){const e=`captions__${t.srclang}.vtt`;"json"===t.type?ut({url:t.src,success:t=>this.prepareCCForDownload(JSON.parse(t.data),e)}):ut({url:t.src,success:t=>{var n=new Blob([t.data],{type:"text/plain;charset=utf-8"});qn(n,e)}})}prepareCCForDownload(t,e){const n=t.reduce((t,e)=>(t||(t+="WEBVTT\r\n"),t+="\r\n",t+=gt(e.from,!1,!0)+" --\x3e "+gt(e.to,!1,!0),t+="\r\n",(t+=e.text)+"\r\n"),"");var i=new Blob([n],{type:"text/plain;charset=utf-8"});qn(i,e)}getElement(){return this.$el}destroy(){super.destroy(),this.$el.parentNode.removeChild(this.$el),this.$el=null}performClick(t){var e=document.createElement("a");e.href=t,e.target="_blank",e.className="rmp-ext-download-hidden",e.download=z(t.split("/"))||"video.mp4",document.body.appendChild(e),e.click();try{this.$button.removeChild(this.$spinner),this.$button.appendChild(this.$svg)}catch(t){}}_toMain(){E(this.$selector,Jn),we(this.player,this.$mainStep);const t=document.querySelectorAll(`.${ti} > .${ii}`);t[0]&&t[0].focus()}_toAdditional(t){c(j(this.$additional.childNodes),t=>this.$additional.removeChild(t)),S(this.$selector,Jn),this.$backText.textContent=t,we(this.player,this.$additionalStep),this.$back.focus()}_renderVideos(){const t=w("button",{type:"button",class:ii},this.$additional);this.addEvent(t,"click",()=>this.downloadDRMVideo(null)),w("span",{},t).textContent=this.$t("video-only"),c(this.options.downloadCCLanguages,t=>{const e=w("button",{type:"button",class:ii},this.$additional);this.addEvent(e,"click",()=>this.downloadDRMVideo(t.code)),w("span",{},e).textContent=`${this.$t("video-and")} ${t.label} CC`})}_renderTranscripts(){c(this.options.cc.filter(oi),t=>{const e=w("button",{type:"button",class:ii},this.$additional);this.addEvent(e,"click",()=>this.downloadTranscript(t)),w("span",{},e).textContent=t.label})}_renderClosedCaptions(){c(this.options.cc.filter(oi),t=>{const e=w("button",{type:"button",class:ii},this.$additional);this.addEvent(e,"click",()=>this.downloadCC(t)),w("span",{},e).textContent=t.label})}}],["showPrev",class extends pt{constructor(t,e,n){super(t,e,n),Pi(this,"$outer",void 0),Pi(this,"$button",void 0),this.logger.debug("prev:extension:creating"),this.render();const i=this.options.bus;this.addEvent(this.$outer,"click",()=>i.emit("prevtrack")),this.logger.debug("prev:extension:created")}render(){const t=this.options.prevTrackTitle;this.$outer=w("div",{class:Li,title:t}),this.$button=w("button",{type:"button",class:Mi},this.$outer),Yt(this.$button,Ut),this.$button.setAttribute("aria-label","Go to previous track"),w("img",{src:this.options.prevTrackThumbnails,class:Ai},this.$outer)}getOuter(){return this.$outer}destroy(){if(super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["showNext",class extends pt{constructor(t,e,n){super(t,e,n),Fi(this,"$outer",void 0),Fi(this,"$button",void 0),this.logger.debug("next:extension:creating"),this.render();const i=this.options.bus;this.addEvent(this.$outer,"click",()=>i.emit("nexttrack")),this.logger.debug("next:extension:created")}render(){const t=this.options.nextTrackTitle;this.$outer=w("div",{class:zi,title:t}),this.$button=w("button",{type:"button",class:Ni},this.$outer),Yt(this.$button,Vt),this.$button.setAttribute("aria-label","Go to next track"),w("img",{src:this.options.nextTrackThumbnails,class:Oi},this.$outer)}getOuter(){return this.$outer}destroy(){if(super.destroy(),!this.$outer)return;const t=this.$outer.parentNode;t&&t.removeChild(this.$outer),this.$outer=null}}],["useMux",class extends pt{constructor(t,e,n){super(t,e,n),this.logger.debug("mux:extension:creating"),this.init(),this.logger.debug("mux:extension:created")}init(){b(window.mux)?this.monitor():this.loadLibraryAndStartMonitor()}loadLibraryAndStartMonitor(){const t=w("script",{src:this.options.muxURL}),e=N(j(document.getElementsByTagName("script")));t.onload=t.onload=()=>this.monitor(),e.parentNode&&e.parentNode.insertBefore(t,e)}monitor(){const t=this.player.getElement(),e=H({},Di,this.options.mux);window.mux.monitor(`#${t.id}`,{debug:!1,data:e})}destroy(){const t=this.player.getElement();t&&"mux"in t&&t.mux.destroy(),super.destroy()}}],[!0,class extends pt{constructor(t,e,n){super(t,e,n),Ti(this,"_w",void 0),Ti(this,"_h",void 0),this.onResize=this.onResize.bind(this),setTimeout(this.onResize),this.addEvent(window,"resize",()=>setTimeout(this.onResize)),this.bus.on("fullscreenchanged",()=>setTimeout(this.onResize,500)),this.bus.on("cclayoutchange",()=>setTimeout(this.onResize))}onResize(){const t=this.player.getElement();if(!t)return;const e=t.parentNode?t.parentNode:t,n=Math.max(t.offsetWidth,e.offsetWidth),i=Math.max(t.offsetHeight,e.offsetHeight,e.parentNode?.offsetHeight||0),s=Math.max(t.offsetWidth,e.parentNode?.offsetWidth||0);n===this._w&&i===this._h||(this._h=i,this._w=n,setTimeout(()=>this.bus.emit("resizeplayer",{width:n,height:i,outerWidth:s})))}}],["showCrawl",vs],["showSettings",class extends pt{constructor(t,e,n){super(t,e,n,["loadedmetadata","annotationslang","qualitychange","timeupdate"]),ri(this,"$el",void 0),ri(this,"$button",void 0),ri(this,"$selector",void 0),ri(this,"$mainStep",void 0),ri(this,"$annotations",void 0),ri(this,"$currentAnnotation",void 0),ri(this,"$quality",void 0),ri(this,"$currentQuality",void 0),ri(this,"$speed",void 0),ri(this,"$currentSpeed",void 0),ri(this,"$additionalStep",void 0),ri(this,"$back",void 0),ri(this,"$backText",void 0),ri(this,"$additional",void 0),ri(this,"playbackRate",1),ri(this,"annLang",""),this.logger.debug("settings:extension:creating"),this.render(),this.init(),this.logger.debug("settings:extension:created")}render(){this.$el=w("div",{class:ai}),this.$button=w("button",{type:"button",class:li},this.$el),this.$selector=w("div",{class:hi},this.$el),this.$mainStep=w("div",{class:ui},this.$selector),Yt(this.$button,"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"),this.options.showAnnotations&&(this.$annotations=w("button",{type:"button",class:gi},this.$mainStep),w("span",{},this.$annotations).textContent=this.$t("annotations"),S(this.$annotations,fi),ki(this.$annotations),this.$currentAnnotation=w("span",{class:vi},this.$annotations)),this.options.showQuality&&(this.$quality=w("button",{type:"button",class:mi},this.$mainStep),w("span",{},this.$quality).textContent=this.$t("quality"),S(this.$quality,fi),ki(this.$quality),this.$currentQuality=w("span",{class:vi},this.$quality)),this.options.showPlaybackRate&&(this.$speed=w("button",{type:"button",class:bi},this.$mainStep),w("span",{},this.$speed).textContent=this.$t("playback-rate"),S(this.$speed,fi),ki(this.$speed),this.$currentSpeed=w("span",{class:vi},this.$speed),this.$currentSpeed.textContent=this.$t("standard-playbackrate")),this.$additionalStep=w("div",{class:di},this.$selector),this.$back=w("button",{type:"button",class:yi},this.$additionalStep),Yt(w("span",{class:"arrow"},this.$back),Wt),this.$backText=w("span",{},this.$back),this.$additional=w("div",{class:"tab-content"},this.$additionalStep)}init(){const t=this.$button;if(Ce(this,{$button:t,$selector:this.$selector,SELECTOR_OPEN_CN:ci,reposition:!1,closeOnClick:!1,firstFocusItemSelector:`.${fi}`,toMainFn:this._toMain.bind(this)}),this.options.showAnnotations){this.addEvent(this.$annotations,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("annotations")),this._renderAnnotationsLanguages()});const t=[wi].concat(this.options.annotations),e=re(_i,"");let n=M(t,t=>t.srclang===e);n||(n=M(t,t=>t.default)),n=n||t[1],this.bus.emit("annotationslang",n.srclang)}this.options.showQuality&&this.addEvent(this.$quality,"click",t=>{t.preventDefault(),t.stopPropagation(),this._toAdditional(this.$t("quality")),this._renderQualities()}),this.options.showPlaybackRate&&this.addEvent(this.$speed,"click",()=>{this._toAdditional(this.$t("playback-rate")),this._renderPlaybackRate()}),this.addEvent(this.$back,"click",()=>this._toMain()),Xt(this,{$button:t,text:this.$t("settings")})}_toAdditional(t){c(j(this.$additional.childNodes),t=>this.$additional.removeChild(t)),S(this.$selector,pi),this.$backText.textContent=t,we(this.player,this.$additionalStep),this.$back.focus()}_renderQualities(){c(j(this.$additional.childNodes),t=>this.$additional.removeChild(t));const t=this.player.getLevel(),e=[],n=this.player.getLevels();n.sort((t,e)=>e.height-t.height),c(n,n=>{if(!n.name&&!n.height)return;const i=w("button",{type:"button",class:$i},this.$additional);i.textContent=n.name||`${n.height}p`,(u(n,t)||D(n,"index",-1)===D(t,"index",-2))&&(S(i,xi),this.$currentQuality.textContent||this.bus.emit("qualitychange",i.textContent)),this.addEvent(i,"click",()=>{this.bus.emit("qualitychange",i.textContent),this.bus.emit("manualquality",i.textContent),c(e,t=>E(t,xi)),S(i,xi),this.player.setLevel(n),this._toMain()}),e.push(i)})}_renderAnnotationsLanguages(){const t=[],e=this.annLang;c([wi].concat(this.options.annotations),n=>{const i=w("button",{type:"button",class:$i},this.$additional);i.textContent=n.label,e===n.srclang&&S(i,xi),this.addEvent(i,"click",()=>{oe(_i,n.srclang),this.bus.emit("annotationslang",n.srclang),this._toMain()}),t.push(i)})}_mapRates(){const t=this.options.playbackRates;-1===t.indexOf(1)&&t.push(1);let e=t.map(t=>{const e=Math.round(100*t)/100;return 1===e?{rate:e,labelKey:"standard-playbackrate"}:5===e?{rate:e,hide:t=>t.isAudio}:{rate:e}});return e=e.filter((t,e)=>t.rate<=5&&t.rate>0).sort((t,e)=>t.rate-e.rate),e}_renderPlaybackRate(){const t=[];c(Array.isArray(this.options.playbackRates)?this._mapRates():Ci,e=>{if(h(e,"hide")&&o(e.hide)&&e.hide(this.options))return;const n=w("button",{type:"button",class:$i},this.$additional);n.textContent=b(e.labelKey)?this.$t(e.labelKey):String(e.rate),e.rate===this.playbackRate&&(S(n,xi),this.$currentSpeed.textContent=n.textContent),this.addEvent(n,"click",()=>{c(t,t=>E(t,xi)),S(n,xi),this.player.setPlaybackRate(e.rate),this.playbackRate=e.rate,this.$currentSpeed.textContent=n.textContent,this._toMain()}),t.push(n)})}_toMain(){E(this.$selector,pi),we(this.player,this.$mainStep);const t=document.querySelectorAll(`.${ui} > .${fi}`);t[0]&&t[0].focus()}onAnnotationslang(t){const e=M([wi].concat(this.options.annotations),e=>e.srclang===t)||wi;this.annLang=e.srclang,this.$currentAnnotation.textContent=e.label}onLoadedmetadata(){this.options.showQuality&&(this.player.isMultiQuality()?this._renderQualities():this.$quality.style.display="none")}onQualitychange(t){this.$currentQuality&&(this.$currentQuality.textContent=t)}onTimeupdate(){this.player.isLive()&&(this.player.setPlaybackRate(1),this.playbackRate=1,this.options.showPlaybackRate&&(this.$currentSpeed.textContent=this.$t("standard-playbackrate")))}getElement(){return this.$el}destroy(){super.destroy();const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null,this.$button=null,this.$selector=null}}],["showFullScreen",class extends pt{constructor(t,e,n){var i,s,o;super(t,e,n,["statechanged"]),i=this,o=void 0,(s=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(s="$el"))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this.logger.debug("fullscreen:extension:creating"),this.render(),this.addEvent(this.$el,"click",this.toggle.bind(this)),this.addEvent(document,"keyup",this.onKeyup.bind(this)),navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)&&this.addEvent(window,"resize",this.onResize.bind(this)),P(this.$el,_e,this.state.isFullScreen()),this.logger.debug("fullscreen:extension:created")}render(){this.$el=w("button",{type:"button",class:xe,"data-testid":"fullscreen"}),Yt(this.$el,"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",{class:"fullscreen-icon"}),Yt(this.$el,"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",{class:"exit-fullscreen-icon"});const t=()=>this.$t(this.state.isFullScreen()?"exit-fullscreen":"fullscreen");setTimeout(()=>Xt(this,{$button:this.$el,text:t}))}onResize(){this.state.isFullScreen()&&this.bus.emit("fullscreenchanging",!0)}onKeyup(t){27===t.keyCode&&this.bus.emit("fullscreenchanging",!1)}onStatechanged(t){P(this.$el,_e,t.isFullScreen)}toggle(){this.bus.emit("fullscreenchanging")}getElement(){return this.$el}destroy(){if(super.destroy(),!this.$el)return;const t=this.$el.parentNode;t&&t.removeChild(this.$el),this.$el=null}}]];function Ss(t,e){const n=function(t,e){let n="calc(100% - 160px)";return e&&(n=e.bottom-e.top-160+"px"),`\n.rplayer {\n font-family: 'Roboto',sans-serif;\n width: 100%;\n height: 100%;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n outline: 0;\n position: relative;\n z-index: 1;\n text-align: left;\n}\n\n.rplayer, .rplayer * {\n box-sizing: border-box;\n}\n\n.rplayer--fullscreen .rplayer__inner {\n height: 100% !important;\n width: 100% !important;\n min-height: 100vh;\n min-width: 100vw;\n z-index: 9999999;\n position: static;\n padding-bottom: 0;\n margin: 0 auto\n}\n\n@media (orientation: portrait) {\n .rplayer--fullscreen .rplayer--iphone .rmp-extensions {\n bottom: 40px;\n }\n .rplayer--fullscreen .rplayer--iphone .rmp-ext-cc__text {\n bottom: 125px;\n }\n}\n\n.rplayer--fullscreen:-webkit-full-screen .rplayer__inner,\n.rplayer--fullscreen:-moz-full-screen .rplayer__inner,\n.rplayer--fullscreen:-ms-fullscreen .rplayer__inner,\n.rplayer--fullscreen:fullscreen .rplayer__inner,\n min-height: 100vh;\n min-width: 100vw;\n}\n\n.rplayer--fullscreen .rplayer__playlist-wrapper {\n display: none;\n}\n\n.rplayer button span {\n display: inline;\n padding: 0;\n}\n\n.rplayer--fullscreen .rplayer video {\n background-color: black;\n}\n\n.rplayer audio {\n width: 100%\n}\n\n.rplayer video {\n outline: 0\n}\n\n.rplayer--fullscreen {\n position: fixed!important;\n top: 0!important;\n bottom: 0!important;\n right: 0!important;\n left: 0!important;\n background-color: black;\n width: 100%!important;\n max-width: 100% !important;\n height: 100vh !important;\n z-index: 9999999!important;\n display: block;\n}\n\n.rplayer--fullscreen .rplayer {\n display: table-cell;\n vertical-align: middle\n}\n\n.rplayer__inner {\n margin: auto;\n background-color: black;\n}\n\n.rplayer__inner, .rplayer__playlist-wrapper {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n}\n\n.rplayer__inner--playing .rmp-ext-help, .rplayer__inner--playing .rmp-ext-title {\n opacity: 0;\n z-index: -9;\n}\n\n.rplayer__inner--loading>* {\n visibility: hidden\n}\n\n.rplayer__inner--loading>.loader {\n border: 4px solid #f3f3f3;\n border-top: 4px solid #666;\n border-radius: 50%;\n width: 60px;\n height: 60px;\n animation: spin 2s linear infinite;\n visibility: visible;\n position: absolute;\n left: 50%;\n top: 50%;\n margin-top: -30px;\n margin-left: -30px\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg)\n }\n\n to {\n transform: rotate(-360deg)\n }\n}\n\n@-webkit-keyframes spin {\n 0% {\n transform: rotate(0deg)\n }\n\n to {\n transform: rotate(360deg)\n }\n}\n\n.rplayer video {\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n border: 0\n}\n\n.rplayer .rplayer__inner--cc-below video {\n position: relative;\n height: ${n};\n}\n\n.rplayer--cc-75-below .rplayer__inner--cc-below video {\n height: calc(100% - 110px);\n}\n\n.rplayer--cc-100-below .rplayer__inner--cc-below video {\n height: calc(100% - 140px);\n}\n\n.rplayer--cc-125-below .rplayer__inner--cc-below video {\n height: calc(100% - 150px);\n}\n\n.rplayer--cc-150-below .rplayer__inner--cc-below video {\n height: calc(100% - 170px);\n}\n\n.rplayer--cc-200-below .rplayer__inner--cc-below video {\n height: calc(100% - 200px);\n}\n\n.rplayer--fullscreen .rplayer--cc-75-below .rplayer__inner--cc-below video {\n height: calc(100vh - 130px);\n}\n\n.rplayer--fullscreen .rplayer--cc-100-below .rplayer__inner--cc-below video {\n height: calc(100vh - 160px);\n}\n\n.rplayer--fullscreen .rplayer--cc-125-below .rplayer__inner--cc-below video {\n height: calc(100vh - 180px);\n}\n\n.rplayer--fullscreen .rplayer--cc-150-below .rplayer__inner--cc-below video {\n height: calc(100vh - 210px);\n}\n\n.rplayer--fullscreen .rplayer--cc-200-below .rplayer__inner--cc-below video {\n height: calc(100vh - 230px);\n}\n\n.rmp-extensions, .rmp-ext-title {\n height: 86px;\n left: 0;\n right: 0;\n position: absolute;\n background-repeat: repeat-x;\n\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA0xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDg2NUVBOEM1QTQ0MTFFNzlGNTJDQTRCNzY1MURGNEMiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDg2NUVBOEI1QTQ0MTFFNzlGNTJDQTRCNzY1MURGNEMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjAzOTcwY2FjLWEyYWMtMTE3YS05OGUxLWI5NzUzOTY2ZTQ4MyIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjAzOTcwY2FjLWEyYWMtMTE3YS05OGUxLWI5NzUzOTY2ZTQ4MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoORptwAAACaSURBVHjafFBbDoAgDBsbev87egsF8fEBtqmY2LRrGRtmZpvfcD7QEE7BKtYIinAruoNVAQXvKAjv2R27HHiMOpN7TN0qWjVRo7XU5iNnKFuvqfczwZTxgbj/hNJUDj/3n5xPpTJcSDIokrrMGM6dJZQvBOaisyRqgXLB2jJ1s3DHLCuOkXEMNQF1plUDt1Sbkxv4iMQG+CXAAOG1UnHx2OgyAAAAAElFTkSuQmCC');\n\n color: ${t.mainColor};\n z-index: 4;\n transition: opacity 500ms ease;\n}\n\n.rplayer--iphone .rmp-extensions, .rplayer--iphone .rmp-ext-title {\n transition: none;\n transform: translateZ(0);\n z-index: 9;\n background: linear-gradient(360deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.75) 50%, rgba(0,0,0,0) 100%);\n}\n\n.rmp-extensions {\n background-position: bottom;\n bottom: -26px;\n padding-top: 26px;\n padding-right: 5px;\n font-size: 12px;\n z-index: 5;\n display: flex;\n}\n\n.rmp-ext-backward, .rmp-ext-prev-frame, .rmp-ext-play, .rmp-ext-next-frame, .rmp-ext-forward, \n.rmp-ext-volume, .rmp-ext-progress, .rmp-ext-settings, .rmp-ext-theater, .rmp-ext-cc, .rmp-ext-toc,\n.rmp-ext-audio-tracks, .rmp-ext-search, .rmp-ext-settings, .rmp-ext-fullscreen, .rmp-ext-bottom-next,\n.rmp-ext-bottom-prev {\n max-height: 31px;\n}\n\n.rplayer--mobile .rmp-extensions {\n bottom: -20px;\n}\n\n.rplayer__inner--light .rmp-ext-help,\n.rmp-extensions--hidden > .rmp-extensions, .rmp-extensions--hidden > .rmp-ext-title, .rmp-extensions--hidden > .rmp-ext-help {\n opacity: 0;\n}\n\n.rplayer__inner--light.rplayer__inner--hovering .rmp-extensions, .rplayer__inner--light.rplayer__inner--hovering .rmp-ext-help,\n.rplayer__inner--active .rmp-extensions, .rplayer__inner--active .rmp-ext-help {\n opacity: 1;\n}\n\n.rmp-extensions button, .rmp-ext-help__button {\n height: 32px;\n border: none;\n cursor: pointer;\n position: relative;\n background-color: transparent;\n float: left;\n color: ${t.submenuColor};\n width: 36px\n}\n\n\n.rplayer--mobile .rmp-extensions .rmp-ext-forward, .rplayer--mobile .rmp-extensions .rmp-ext-backward {\n display: none;\n}\n\n.rplayer--mobile .arrow svg {\n width: 24px !important;\n height: 24px !important;\n}\n\n.rmp-extensions button svg, .rmp-ext-help__button {\n width: 24px;\n height: 24px;\n display: block;\n fill: ${t.mainColor};\n opacity: .75\n}\n\n.rmp-extensions button:hover svg, .rmp-ext-help__button:hover {\n opacity: 1\n}\n\n.rmp-extensions button, .rmp-ext-title__title,\n.rplayer__playlist-item {\n padding: 0 5px;\n outline-offset: -2px;\n}\n\n.rplayer__inner--accessibility .rmp-extensions button:focus,\n.rplayer__inner--accessibility .rmp-ext-progress__bar:focus,\n.rplayer__inner--accessibility .rmp-ext-title__title:focus,\n.rplayer__inner--accessibility .rplayer__playlist-item:focus,\n.rplayer__inner--accessibility .rmp-ext-buffering:focus {\n outline: 2px solid blue;\n}\n\n.rmp-extensions > button:first-of-type {\n margin-left: 6px\n}\n\n.rmp-ext-placeholder {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n background-color: #000;\n opacity: 0.001;\n}\n\n.rmp-ext-placeholder--animation {\n background-color: transparent;\n opacity: 1;\n}\n\n.rplayer__inner--light .rmp-ext-placeholder__play-btn {\n display: inline-block;\n}\n\n.rplayer__inner--light .rmp-ext-placeholder {\n background-color: transparent;\n opacity: 1;\n cursor: pointer;\n}\n\n.rplayer__inner--light.rplayer__inner--hovering .rmp-ext-placeholder__play-btn {\n width: 78px;\n height: 78px;\n margin-top: -40px;\n margin-left: -40px;\n cursor: pointer;\n}\n\n.rplayer__inner--light.rplayer__inner--hovering .rmp-ext-placeholder__play-btn svg {\n top: 11px;\n left: 11px;\n cursor: pointer;\n}\n\n.rmp-ext-placeholder__play-btn {\n background-color: rgba(61,61,61,.75);\n border: 0 none;\n border-radius: 50%;\n position: absolute;\n width: 72px;\n height: 72px;\n left: 50%;\n top: 50%;\n margin-top: -36px;\n margin-left: -36px;\n display: none;\n outline: none;\n}\n\n.rmp-ext-placeholder__icon {\n position: absolute;\n width: 56px;\n height: 56px;\n left: 50%;\n top: 50%;\n margin-top: -28px;\n margin-left: -28px\n}\n\n.rmp-ext-placeholder__icon svg, .rmp-ext-placeholder__play-btn svg {\n position: absolute;\n width: 56px;\n height: 56px;\n fill: #222\n}\n\n.rmp-ext-placeholder__play-btn svg {\n fill: ${t.mainColor};\n position: absolute;\n top: 8px;\n left: 8px;\n}\n\n.rmp-ext-placeholder--animation .rmp-ext-placeholder__icon {\n animation: disappear-icon .75s ease 1\n}\n\n@keyframes disappear-icon {\n 0% {\n opacity: 1\n }\n\n to {\n transform: scale(2);\n opacity: 0\n }\n}\n\n@-webkit-keyframes disappear-icon {\n 0% {\n opacity: 1\n }\n\n to {\n transform: scale(2);\n opacity: 0\n }\n}\n\n.rmp-extensions .rmp-ext-play svg {\n display: none\n}\n\n.rmp-extensions .rmp-ext-play--paused .play,.rmp-extensions .rmp-ext-play--playing .pause, .rmp-extensions .rmp-ext-play--ended .replay {\n display: block\n}\n\n.rmp-ext-progress {\n flex-grow: 1;\n}\n\n.rmp-ext-progress__current {\n line-height: 32px;\n padding: 0 8px;\n user-select: none\n}\n\n.rmp-ext-progress__overlay {\n background-color: #fff;\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: .75\n}\n\n.rmp-ext-progress__bar {\n cursor: pointer;\n height: 4px;\n border-radius: 2px;\n position: absolute;\n top: 14px;\n left: 16px;\n right: 16px;\n display: block;\n -webkit-box-shadow: 0 0 2px 0 rgba(51,51,51,.5);\n box-shadow: 0 0 2px 0 rgba(51,51,51,.5);\n transition: all 50ms linear\n}\n\n.rmp-ext-progress__generic-live-stream.rmp-ext-progress__bar {\n pointer-events: none;\n}\n.rmp-ext-progress__generic-live-stream .rmp-ext-progress__progress {\n width: 100% !important;\n background-color: #e62048;\n}\n.rmp-ext-progress__generic-live-stream .rmp-ext-progress__handle,\n.rmp-ext-progress__generic-live-stream .rmp-ext-progress__play-progress,\n.rmp-ext-progress__generic-live-stream.rmp-ext-progress > span:nth-child(2),\n.rmp-ext-progress__generic-live-stream.rmp-ext-progress > span:nth-child(3) {\n display: none;\n}\n\n.rmp-ext-progress__bar:hover {\n height: 8px;\n margin-top: -2px\n}\n\n.rmp-ext-progress__bar-padding {\n position: absolute;\n z-index: 5;\n bottom: -2px;\n left: 0;\n right: 0;\n display: block;\n height: 18px;\n cursor: pointer;\n}\n\n.rmp-ext-progress__duration {\n line-height: 32px;\n padding: 0 8px;\n user-select: none;\n position: relative\n}\n\n.rmp-ext-progress__handle {\n position: absolute;\n left: 0;\n width: 6px;\n height: 10px;\n top: -3px;\n margin-left: -3px;\n cursor: pointer;\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 0 2px 0 rgba(51,51,51,.25);\n box-shadow: 0 0 2px 0 rgba(51,51,51,.25);\n z-index: 7;\n transform: translateZ(0);\n}\n\n@media only screen and (max-device-width: 768px) and (pointer:coarse) {\n .rmp-ext-progress__handle {\n width: 12px !important;\n height: 24px !important;\n top: -9px !important;\n margin-left: -6px !important;\n background-color: transparent;\n box-shadow: none;\n transform: translateZ(0);\n padding: 6px 5px;\n }\n\n .rmp-ext-progress__chapter-bubble {\n z-index: 5;\n }\n\n .rmp-ext-progress__handle:before {\n content: '';\n display: block;\n width: 6px;\n height: 10px;\n top: -3px;\n margin-left: -3px;\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 0 2px 0 rgba(51,51,51,.25);\n box-shadow: 0 0 2px 0 rgba(51,51,51,.25);\n transform: translateZ(0);\n }\n\n .rmp-ext-progress__bar:hover .rmp-ext-progress__handle:before {\n height: 14px;\n }\n}\n\n.rmp-ext-progress__progress {\n left: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n background: #fff;\n z-index: 2\n}\n\n.rmp-ext-progress__play-progress {\n left: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n background: ${t.accentColor};\n z-index: 3\n}\n\n.rmp-ext-progress__bar:hover .rmp-ext-progress__handle {\n top: -4px;\n height: 16px\n}\n\n.rmp-ext-progress__tooltip {\n position: absolute;\n bottom: 80px;\n background-color: #333;\n padding: 4px 8px;\n font-size: 12px;\n border-radius: 4px;\n display: none;\n text-align: center;\n z-index: 5\n}\n\n.rmp-ext-progress__thumbmail:not(:empty) {\n margin-bottom: 7px\n}\n\n.rmp-ext-progress__thumbmail-time,.rmp-ext-volume {\n display: inline-block\n}\n\n.rmp-ext-volume__btn .muted,.rmp-ext-volume__btn--muted .unmuted {\n display: none\n}\n\n.rmp-ext-volume__btn--muted .muted {\n display: block\n}\n\n.rmp-ext-progress__tooltip--visible {\n display: flex !important;\n justify-content: center !important;\n flex-direction: column !important;\n align-items: center !important;\n}\n\n.rmp-ext-progress__chapter-bubble {\n position: absolute;\n display: block;\n width: 12px;\n height: 12px;\n top: 50%;\n margin-top: -6px;\n margin-left: -6px;\n z-index: 6\n}\n\n.rmp-ext-progress__chapter-bubble:before {\n content: '';\n position: absolute;\n display: block;\n position: absolute;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: ${t.chaptersBubbleColor};\n top: 50%;\n margin-top: -4px;\n margin-left: 2px;\n -webkit-box-shadow: 0 0 2px 0 rgba(251,251,251,.85);\n box-shadow: 0 0 2px 0 rgba(251,251,251,.85);\n}\n\n.rmp-ext-volume__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n background-color: ${t.submenuBgColor};\n width: 33px;\n}\n\n.rmp-ext-volume__selector--open, .rmp-ext-volume__selector--active {\n display: block;\n}\n\n.rmp-ext-volume__slider {\n cursor: pointer;\n height: 100px;\n display: inline-block;\n width: 4px;\n margin: 6px 14px;\n position: relative;\n line-height: 32px\n}\n\n.rmp-ext-volume__handle,.rmp-ext-volume__overlay,.rmp-ext-volume__progress {\n position: absolute;\n -webkit-box-shadow: 0 0 2px 0 rgba(51,51,51,.5);\n box-shadow: 0 0 2px 0 rgba(51,51,51,.5);\n border-radius: 2px\n}\n\n.rmp-ext-volume__handle {\n width: 12px;\n height: 8px;\n margin-top: -4px;\n cursor: pointer;\n z-index: 2;\n left: -4px;\n border: 1px solid #90A4AE;\n background-color: #fff\n}\n\n.rmp-ext-volume__overlay,.rmp-ext-volume__progress {\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ${t.accentColor}\n}\n\n.rmp-ext-volume__overlay {\n display: block;\n top: 0;\n background-color: #fff;\n opacity: .75\n}\n\n.rmp-ext-theater--hidden {\n display: none;\n}\n\n.rmp-ext-fullscreen .exit-fullscreen-icon,.rmp-ext-fullscreen--exit .fullscreen-icon,\n.rmp-ext-theater--exit .rmp-ext-theater__icon,.rmp-ext-theater .rmp-ext-theater__exit-icon {\n display: none\n}\n\n.rmp-ext-fullscreen--exit .exit-fullscreen-icon, .rmp-ext-theater--exit .rmp-ext-theater__exit-icon {\n display: block\n}\n\n.rmp-ext-cc__text {\n position: absolute;\n bottom: 60px;\n left: 0;\n right: 0;\n text-align: center;\n display: none;\n pointer-events: none;\n color: ${t.mainColor};\n font-size: 18px;\n opacity: .85;\n z-index: 3;\n transition: bottom 250ms ease\n}\n\n.rmp-ext-crawl {\n position: absolute;\n bottom: 60px;\n left: 0;\n right: 0;\n pointer-events: none;\n z-index: 3;\n transition: bottom 250ms ease;\n background-color: #224367;\n color: #FFFFFF;\n padding: 5px 0;\n overflow: hidden;\n white-space: nowrap;\n}\n \n .rmp-ext-crawl__text {\n width: max-content;\n will-change: transform;\n }\n\n .rmp-ext-crawl__text * {\n color: inherit !important;\n }\n\n .rmp-ext-crawl > .rmp-ext-crawl__text, .rmp-ext-crawl > .rmp-ext-crawl__text > * {\n display: inline-block;\n margin: 0;\n padding: 0;\n }\n\n.rmp-ext-crawl--exist > .rmp-ext-cc__text {\n bottom: 100px;\n}\n\n.rplayer--iphone .rmp-ext-cc__text {\n transition: none;\n bottom: 100px;\n will-change: auto;\n}\n\n.rmp-extensions--hidden > .rmp-ext-cc__text {\n bottom: 10px\n}\n\n.rmp-extensions--hidden > .rmp-ext-crawl {\n bottom: 10px\n}\n\n.rmp-extensions--hidden.rmp-ext-crawl--exist > .rmp-ext-cc__text {\n bottom: 50px\n}\n\n.rmp-ext-cc__text--visible {\n display: block\n}\n\n.rmp-ext-cc__text-holder {\n background-color: #333;\n padding: 4px 8px;\n border-radius: 4px;\n display: inline-block;\n line-height: 1.2\n}\n\n.rplayer__inner--cc-below .rmp-ext-cc__text {\n position: static;\n margin-top: 5px;\n}\n\n.rmp-ext-cc__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n margin-left: -15px;\n background-color: ${t.submenuBgColor};\n overflow: hidden;\n width: 250px\n}\n\n.rmp-ext-cc__selector--open {\n display: block\n}\n\n.rmp-ext-cc__selector .rmp-ext-cc__item {\n padding-left: 18px;\n}\n\n.rmp-ext-cc__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n.rmp-ext-cc__item--checked:before,.rmp-ext-settings__item--checked:before,.rmp-ext-toc__lang-item--checked:before,.rmp-ext-audio-tracks__item--checked:before {\n position: absolute;\n content: '•';\n margin-left: -12px;\n font-size: 24px;\n margin-top: -1px\n}\n\n.rmp-ext-toc {\n width: 34px;\n padding: 0 2px\n}\n\n.rmp-ext-toc__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n overflow: hidden;\n background-color: ${t.submenuBgColor};\n width: 250px\n}\n\n.rmp-ext-toc__chapters > .rmp-ext-toc__item {\n width: 100%;\n height: auto;\n min-height: 32px;\n text-align: left;\n padding: 0 15px;\n}\n\n.rmp-ext-toc__chapters:empty {\n padding-top: 0;\n}\n\n\n.rmp-ext-toc__selector--open {\n display: block\n}\n\n.rmp-ext-toc__item,.rmp-ext-toc__selector a:hover {\n text-decoration: none;\n color: #000\n}\n\n.rmp-ext-toc__item {\n margin-bottom: 14px;\n display: block;\n color: ${t.submenuColor};\n padding: 8px 0\n}\n\n.rmp-ext-toc__item:hover {\n color: #333;\n text-decoration: underline\n}\n\n.rmp-ext-toc__item:last-child {\n margin-bottom: 0\n}\n\nbutton.rmp-ext-toc__more {\n text-align: left;\n width: 100%;\n line-height: 32px;\n padding-left: 12px;\n border-top: 1px solid #AAA;\n}\n\n.rmp-ext-toc__more .arrow {\n float: right;\n width: 20px;\n margin-top: 4px;\n}\n\n.rmp-ext-toc__more .arrow svg, button.rmp-ext-toc__back svg {\n fill: ${t.submenuColor}\n}\n\n.rmp-ext-toc__main-step:after, .rmp-ext-toc__languages-step:after {\n content: ' ';\n display: table;\n clear: both;\n}\n\n.rmp-ext-toc__main-step, .rmp-ext-toc__languages-step, .rmp-ext-toc__translate-step {\n display: none;\n position: absolute;\n left: 265px;\n bottom: 0;\n width: 100%;\n overflow: auto;\n}\n\n.rmp-ext-toc__selector--main-step .rmp-ext-toc__main-step,\n.rmp-ext-toc__selector--translate-step .rmp-ext-toc__translate-step,\n.rmp-ext-toc__selector--languages-step .rmp-ext-toc__languages-step {\n display: block;\n position: relative;\n left: 0;\n width: 100%;\n}\n\n.rmp-ext-toc__selector--languages-step .rmp-ext-toc__main-step,\n.rmp-ext-toc__selector--translate-step .rmp-ext-toc__main-step,\n.rmp-ext-toc__selector--translate-step .rmp-ext-toc__languages-step {\n display: none;\n position: absolute;\n left: -265px;\n}\n\n.rmp-ext-toc__selector--languages-step .rmp-ext-toc__back,\n.rmp-ext-toc__selector--translate-step .rmp-ext-toc__back {\n border-bottom: 1px solid #AAA;\n text-align: left;\n width: 100%;\n line-height: 32px;\n}\n\n.rmp-ext-toc__back span:first-of-type {\n float: left;\n padding: 3px 0;\n}\n\nbutton.rmp-ext-toc__lang-item {\n width: 100%;\n text-align: left;\n padding: 0 12px 0 20px;\n line-height: 32px;\n}\n\n\n.rmp-ext-toc__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n\n.rmp-ext-popover {\n position: absolute;\n bottom: 56px;\n background-color: #666;\n z-index: 9;\n padding: 4px 6px;\n border-radius: 4px;\n font-size: 12px;\n opacity: .875;\n display: none\n}\n\n.rmp-annotation:hover .rmp-annotation__button,.rmp-ext-popover--visible {\n display: block\n}\n\n.rmp-annotation {\n position: absolute;\n background-color: rgba(0,0,0,.8);\n padding: 4px 6px;\n color: #fff;\n border: 1px solid #888;\n display: none;\n z-index: 3\n}\n\n.rmp-annotation--visible {\n display: block\n}\n\n.rmp-annotation__button {\n position: absolute;\n top: -6px;\n right: -6px;\n background-color: #eee;\n height: 18px;\n width: 18px;\n border-radius: 50%;\n border: 0 none;\n display: none;\n cursor: pointer\n}\n\n.rmp-annotation__button svg {\n fill: #666;\n position: absolute;\n top: 1px;\n left: 1px\n}\n\n.rmp-annotation__button:hover svg {\n fill: #333\n}\n\n.rmp-ext-poster, .rmp-ext-poster img {\n width: 100%\n}\n.rmp-ext-poster img {\n position: absolute;\n margin: auto;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n width: 100% !important;\n height: auto !important;\n}\n\n.rmp-ext-poster {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: black;\n}\n\n.rmp-ext-poster--hidden {\n display: none\n}\n\n.rmp-ext-settings {\n width: 34px;\n padding: 0 2px;\n}\n\n.rmp-ext-settings__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n background-color: ${t.submenuBgColor};\n width: 260px;\n right: 5px;\n overflow: hidden;\n}\n\n.rmp-ext-settings__selector--open {\n display: block\n}\n\n.rmp-ext-settings__selector button {\n width: 100%;\n text-align: left;\n padding: 0 6px;\n line-height: 32px;\n}\n\n.rmp-ext-settings__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n.rmp-ext-download__more .arrow, .rmp-ext-settings__more .arrow {\n float: right;\n width: 20px;\n margin-top: 5px;\n}\n\n.rmp-ext-download__more .arrow svg, .rmp-ext-settings__more .arrow svg {\n fill: ${t.submenuColor}\n}\n\n.rmp-ext-settings__current-value, .rmp-ext-cc__current-value, .rmp-ext-toc__current-value {\n float: right;\n font-size: 11px;\n color: #757575\n}\n\n.rmp-ext-cc__settings--progress .rmp-ext-cc__current-value {\n font-style: italic;\n}\n\n.rmp-ext-cc__settings--progress {\n background-color: transparent !important;\n}\n\n\n.rmp-ext-cc__settings--progress > span {\n opacity: 0.5;\n}\n\n.rmp-ext-download__main-step, .rmp-ext-settings__main-step {\n width: 100%;\n left: 0;\n position: relative;\n}\n\n.rmp-ext-download__main-step:after, .rmp-ext-download__additional-step:after,\n.rmp-ext-settings__main-step:after, .rmp-ext-settings__additional-step:after, .rplayer--right-playlist:after {\n content: ' ';\n display: table;\n clear: both;\n}\n\n.rmp-ext-download__additional-step, .rmp-ext-settings__additional-step {\n display: none;\n position: absolute;\n left: 265px;\n bottom: 0;\n width: 100%;\n overflow: auto;\n}\n\n.rmp-ext-download__selector--additional .rmp-ext-download__additional-step,\n.rmp-ext-settings__selector--additional .rmp-ext-settings__additional-step {\n display: block;\n position: relative;\n left: 0;\n width: 100%;\n}\n\n.rmp-ext-download__selector--additional .rmp-ext-download__main-step,\n.rmp-ext-settings__selector--additional .rmp-ext-settings__main-step {\n display: none;\n position: absolute;\n left: -265px;\n}\n\nbutton.rmp-ext-download__back, button.rmp-ext-settings__back {\n border-bottom: 1px solid #AAA;\n}\n\nbutton.rmp-ext-download__back svg, button.rmp-ext-settings__back svg {\n fill: ${t.submenuColor};\n float: left;\n}\n\n.rmp-ext-download__back > span:first-of-type, .rmp-ext-settings__back > span:first-of-type {\n display: block;\n float: left;\n padding: 4px 0;\n}\n\nbutton.rmp-ext-settings__item {\n padding-left: 20px\n}\n\nbutton.rmp-ext-settings__item.rmp-ext-settings__item--checked:before {\n margin-top: -1px;\n}\n\n.rmp-ext-audio-tracks, .rmp-ext-search {\n width: 34px;\n padding: 0 2px;\n}\n\n.rmp-ext-search--hidden {\n display: none;\n}\n\n.rmp-ext-audio-tracks__selector, .rmp-ext-search__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n background-color: ${t.submenuBgColor};\n width: 260px;\n right: 5px;\n overflow: auto;\n}\n\n.rmp-ext-audio-tracks__selector--open, .rmp-ext-search__selector--open {\n display: block\n}\n\n.rmp-ext-audio-tracks__selector button, .rmp-ext-search__selector button {\n width: 100%;\n text-align: left;\n padding: 0 6px 0 20px;\n line-height: 32px;\n}\n\n.rmp-ext-audio-tracks__selector button:hover, .rmp-ext-search__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n.rmp-ext-search__captions {\n overflow: auto;\n max-height: 160px;\n}\n\n.rmp-ext-search__input {\n width: 100%;\n margin-top: 2px;\n}\n\n.rplayer--mobile .rmp-ext-search__input {\n height: 40px;\n}\n\n.rmp-ext-search__item--current {\n font-weight: 600;\n}\n\n.rmp-ext-search__cc-text {\n font-family: Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif;\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block !important;\n white-space: nowrap;\n width: 156px;\n padding-left: 6px !important;\n vertical-align: middle;\n}\n\n.rmp-ext-search__cc-time {\n font-family: Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif;\n display: inline-block !important;\n width: 59px;\n padding-right: 5px;\n vertical-align: middle;\n overflow: hidden;\n margin-left: -5px;\n}\n\nbutton.rmp-ext-cc__more {\n text-align: left;\n width: 100%;\n line-height: 32px;\n padding-left: 20px;\n}\n\n.rmp-ext-cc__main-step button.rmp-ext-cc__more {\n border-top: 1px solid #AAA;\n}\n\n.rmp-ext-cc__more .arrow {\n float: right;\n width: 20px;\n margin-top: 4px;\n}\n\n.rmp-ext-cc__more .arrow svg, button.rmp-ext-cc__back svg {\n fill: ${t.submenuColor}\n}\n\n.rmp-ext-cc__main-step, .rmp-ext-cc__settings-step, .rmp-ext-cc__additional-step {\n position: relative;\n left: 0;\n width: 100%;\n overflow: auto;\n display: block;\n}\n\n.rmp-ext-cc__selector--settings-step .rmp-ext-cc__main-step, .rmp-ext-cc__selector--additional-step .rmp-ext-cc__main-step,\n.rmp-ext-cc__selector--additional-step .rmp-ext-cc__settings-step, .rmp-ext-cc__selector--translate-step .rmp-ext-cc__main-step {\n display: none;\n position: absolute;\n left: -255px;\n}\n\n.rmp-ext-cc__selector--main-step .rmp-ext-cc__settings-step, .rmp-ext-cc__selector--main-step .rmp-ext-cc__additional-step,\n.rmp-ext-cc__selector--settings-step .rmp-ext-cc__additional-step, .rmp-ext-cc__selector--translate-step .rmp-ext-cc__additional-step {\n display: none;\n position: absolute;\n left: 255px;\n}\n\n.rmp-ext-cc__selector--settings-step .rmp-ext-cc__translate-wrapper, .rmp-ext-cc__selector--translate-step .rmp-ext-cc__settings-wrapper {\n display: none;\n}\n\n.rmp-ext-cc__selector button {\n text-align: left;\n width: 100%;\n line-height: 32px;\n}\n\nbutton.rmp-ext-cc__back {\n border-bottom: 1px solid #AAA;\n}\n\n.rmp-ext-cc__back span:first-of-type {\n float: left;\n padding: 3px 0;\n}\n\n.rmp-ext-help__button {\n position: absolute;\n top: 8px;\n right: 10px;\n z-index: 6;\n width: 32px;\n height: 32px;\n padding: 0;\n}\n\n.rmp-ext-help, .rmp-ext-help__canvas {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n}\n\n.rmp-ext-help__canvas, rmp-ext-help__canvas--visible .rmp-ext-help__button {\n display: none;\n}\n\n.rmp-ext-help__canvas--visible, .rmp-ext-help__canvas--visible .rmp-ext-help__canvas {\n display: block;\n z-index: 999;\n}\n\n.rmp-ext-title {\n width: 100%;\n top: 0;\n z-index: 2\n}\n\n.rmp-ext-title__title {\n font-size: 20px;\n padding: 12px 50px 0 12px;\n opacity: 0.95;\n display: block;\n\n max-height: 60px;\n overflow: hidden;\n\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n -webkit-line-clamp: 2;\n}\n\n.rmp-ext-prev, .rmp-ext-next {\n display: none;\n position: absolute;\n top: 50%;\n margin-top: -34px;\n cursor: pointer;\n opacity: 0.75;\n z-index: 4;\n}\n\n.rplayer--fullscreen .rmp-ext-prev, .rplayer--fullscreen .rmp-ext-next {\n display: block;\n}\n\n.rmp-ext-prev:hover, .rmp-ext-next:hover {\n opacity: 1;\n}\n\n.rmp-ext-prev {\n transition: left 150ms ease\n}\n\n.rmp-ext-next {\n transition: right 150ms ease\n}\n\n.rmp-ext-prev, .rplayer__inner--light.rplayer__inner--hovering .rmp-ext-prev {\n left: -120px;\n}\n\n.rplayer__inner--light .rmp-ext-prev,\n.rmp-extensions--hidden > .rmp-ext-prev {\n left: -175px;\n}\n\n.rmp-ext-next, .rplayer__inner--light.rplayer__inner--hovering .rmp-ext-next {\n right: -120px;\n}\n\n.rplayer__inner--light .rmp-ext-next,\n.rmp-extensions--hidden > .rmp-ext-next {\n right: -175px;\n}\n\n@media only screen and (max-device-width: 768px){\n.rplayer__inner .rmp-ext-next:hover {\n right: -120px !important;\n}\n\n.rplayer__inner .rmp-ext-prev:hover {\n left: -120px !important;\n}\n}\n\n.rmp-ext-prev__button, .rmp-ext-next__button {\n background-color: #333;\n border: 0;\n height: 67.5px;\n cursor: pointer\n}\n\n.rmp-ext-prev__button {\n border-radius: 0 50% 50% 0;\n float: right;\n padding-left: 0;\n}\n\n.rmp-ext-next__button {\n border-radius: 50% 0 0 50%;\n float: left;\n padding-right: 0;\n}\n\n.rmp-ext-prev__thumbnail, .rmp-ext-next__thumbnail {\n width: 120px;\n height: 67.5px;\n border: 5px solid #333;\n}\n\n.rmp-ext-prev__button, .rmp-ext-prev__thumbnail {\n -webkit-box-shadow: -2px 4px 5px 0px rgba(50, 50, 50, 0.75);\n box-shadow: -2px 4px 5px 0px rgba(50, 50, 50, 0.75);\n}\n\n.rmp-ext-next__button, .rmp-ext-next__thumbnail {\n -webkit-box-shadow: 2px 4px 5px 0px rgba(50, 50, 50, 0.75);\n box-shadow: 2px 4px 5px 0px rgba(50, 50, 50, 0.75);\n}\n\n.rmp-ext-next:hover {\n right: 0 !important;\n}\n\n.rmp-ext-prev:hover {\n left: 0 !important;\n}\n\n.rmp-ext-prev__button svg, .rmp-ext-next__button svg {\n fill: ${t.mainColor};\n}\n\n.rmp-no-video {\n position: absolute;\n top: 50%;\n margin-top: -.5em;\n display: block;\n text-align: center;\n left: 0;\n right: 0;\n}\n\n.rmp-ext-buffering {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(51,51,51,.5);\n display: none;\n z-index: 9999;\n}\n\n.rmp-ext-buffering--processing {\n display: block;\n}\n\n.rmp-ext-buffering__message {\n padding: 20px;\n display: inline-block;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.rmp-ext-buffering__message svg {\n fill: #FFF;\n opacity: .75;\n width: 50px;\n height: 50px;\n animation: spin 1.5s linear infinite;\n animation-direction: reverse;\n}\n\n.rmp-ext-buffering--processing ~ .rmp-ext-placeholder {\n opacity: 0;\n}\n\n.rmp-ext-download__main-step {\n position: relative;\n left: 0;\n width: 100%;\n overflow: auto;\n\n -webkit-transition: left .25s ease;\n transition: left .25s ease;\n}\n\n.rmp-ext-download-hidden {\n position: absolute;\n opacity: 0;\n}\n\n.rmp-ext-download__selector {\n position: absolute;\n bottom: 56px;\n border-radius: 4px;\n display: none;\n z-index: 8;\n background-color: ${t.submenuBgColor};\n width: 200px;\n right: 5px;\n overflow: hidden;\n}\n\n.rmp-ext-download__selector--open {\n display: block\n}\n\n.rmp-ext-download__selector button {\n width: 100%;\n text-align: left;\n padding: 0 6px;\n line-height: 32px;\n}\n\n.rmp-ext-download__selector button:hover {\n background-color: rgba(51,51,51,.25)\n}\n\n.rmp-ext-bottom-next--hidden, .rmp-ext-bottom-prev--hidden {\n display: none;\n}\n\n.rmp-ext-search__selector > .rmp-ext-search__cc-clear {\n position: absolute;\n bottom: 3px;\n right: 5px;\n width: 15px;\n height: 15px;\n padding: 0;\n}\n\n.rmp-ext-search__selector > .rmp-ext-search__cc-clear:hover {\n background-color: transparent;\n opacity: 0.8;\n}\n\n.rmp-ext-search__selector > .rmp-ext-search__cc-clear svg {\n width: 15px;\n height: 15px;\n fill: #707070;\n}\n\n.rmp-ext-live {\n width: 34px;\n}\n\n.rmp-ext-live .broadcast-off {\n display: block;\n}\n\n.rmp-ext-live .broadcast-on {\n display: none;\n}\n\n.rmp-ext-live--live .broadcast-off {\n display: none;\n}\n\n.rmp-ext-live--live .broadcast-on {\n display: block;\n fill: #ff1111;\n}\n\n.rmp-ext-progress__hidden > span{\n visibility: hidden;\n}\n\n@media only screen and (max-width: 1224px) {\n .rmp-ext-progress__hidden > .rmp-ext-progress__current {\n visibility: visible !important;\n }\n}\n\n.rmp-ext-error {\n padding: 20px;\n text-align: center;\n z-index: 9999;\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: black;\n color: #FFFFFF;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n}\n\n.rmp-ext-error > svg {\n width: 50px;\n height: 50px;\n fill: #FFFFFF;\n margin-bottom: 20px;\n}\n \n.rmp-ext-error--hidden {\n display: none;\n}\n\n\n\n `}(t,e)+" "+function(t,e){const n=function(t,e){let n=`calc(100% - ${t.rplaylistHeight})`,i=t.rplaylistHeight;if(e){const t=e.right-e.left;n=.7*t+"px",i=.3*t+"px"}return`\n\n.rplayer--fullscreen .rplayer--right-playlist .rplayer__playlist-wrapper {\n max-height: calc(100vh - 44px);\n width: 0;\n}\n\n.rplayer--right-playlist .rplayer__playlist-wrapper {\n width: ${i};\n float: right;\n height: 100%;\n}\n\n.rplayer--right-playlist .rplayer__playlist {\n background-color: #424242;\n overflow-y: auto;\n overflow-x: hidden;\n position: absolute;\n top: 78px;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.rplayer--right-playlist .rplayer__playlist-wrapper.rplayer__playlist-wrapper--wot-title .rplayer__playlist {\n top: 22px;\n}\n\n.rplayer--right-playlist .rplayer__playlist-header {\n max-height: 56px;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n -webkit-line-clamp: 2;\n}\n\n.rplayer--right-playlist .rplayer__inner {\n width: ${n};\n float: left;\n}\n\n.rplayer--right-playlist .rplayer__playlist-item {\n padding: 8px;\n height: 70px;\n border-top: 1px solid #000;\n}\n\n.rplayer--right-playlist .rplayer__playlist-item-title {\n font-size: 13px;\n line-height: 1.4;\n height: 52px;\n display: block;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n -webkit-line-clamp: 3;\n}\n\n.rplayer--right-playlist .rplayer__playlist-item-thumb {\n margin-right: 6px;\n width: 96px;\n height: 54px;\n float: left;\n}\n\n.rplayer--right-playlist .rplayer__playlist-item--current .rplayer__playlist-item-thumb:before {\n font-size: 28px;\n line-height: 54px;\n}\n\n.rplayer--right-playlist .rplayer__playlist-of {\n left: 8px;\n top: 58px;\n}\n\n.rplayer--right-playlist .rplayer__playlist-wrapper.rplayer__playlist-wrapper--wot-title .rplayer__playlist-of {\n top: 5px;\n}\n\n.rplayer--right-playlist .rplayer__playlist-left-btn, .rplayer--right-playlist .rplayer__playlist-right-btn {\n display: none !important;\n}\n\n `}(t,e),i=function(t,e){let n="calc(100% - 152px)";return e&&(n=e.bottom-e.top-152+"px"),`\n\n\n.rplayer--fullscreen .rplayer--bottom-playlist .rplayer__playlist-wrapper {\n height: 0;\n width: 0;\n}\n\n.rplayer--bottom-playlist .rplayer__inner {\n height: ${n};\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-wrapper {\n height: 152px\n}\n\n.rplayer--bottom-playlist .rplayer__playlist {\n margin-top: 6px;\n position: absolute;\n bottom: 0\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-header {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n height: 30px;\n position: absolute;\n left: 0;\n right: 65px;\n top: 0;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-of {\n top: 12px;\n right: 8px;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-current-title {\n display: block;\n position: absolute;\n left: 8px;\n top: 40px;\n color: ${t.mainColor};\n font-size: 12px;\n right: 8px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item {\n margin-right: 10px;\n float: left\n}\n\n.rplayer__playlist-left-btn, .rplayer__playlist-right-btn {\n position: absolute;\n bottom: 1px;\n z-index: 10;\n background-color: rgba(0,0,0,.75);\n border: 0;\n cursor: pointer;\n height: 92px\n}\n\n.rplayer__playlist-left-btn svg, .rplayer__playlist-right-btn svg {\n fill: ${t.mainColor}\n}\n\n.rplayer__playlist-left-btn {\n left: 0;\n}\n\n.rplayer__playlist-right-btn {\n right: 0;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item-thumb {\n width: 160px;\n height: 90px;\n float: left;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item--current .rplayer__playlist-item-thumb:before {\n font-size: 36px;\n line-height: 90px;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item .rplayer__playlist-item-title {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n\n font-size: 11px;\n padding: 6px;\n line-height: 1.1;\n background-color: rgba(31,31,31,0.625);\n display: block;\n\n height: 32px;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n -webkit-line-clamp: 2;\n}\n\n.rplayer--bottom-playlist .rplayer__playlist-item--current .rplayer__playlist-item-title {\n display: none;\n}\n\n `}(t,e);return`\n\n.rplayer__playlist-wrapper {\n background-color: #000;\n}\n\n.rplayer__playlist {\n color: ${t.mainColor}\n}\n\n.rplayer__playlist-header {\n padding: 8px;\n margin: 0;\n font-size: 16px;\n line-height: 1.4;\n display: block;\n overflow: hidden;\n color: ${t.mainColor};\n font-weight: 400;\n}\n\n.rplayer__playlist-current-title {\n display: none;\n}\n\n.rplayer__playlist-item {\n position: relative;\n cursor: pointer;\n}\n\n.rplayer__playlist-item-thumb {\n position: relative;\n overflow: hidden;\n}\n\n.rplayer__playlist-of {\n position: absolute;\n font-size: 12px;\n color: ${t.mainColor};\n}\n\n.rplayer__playlist .rplayer__playlist-item:last-child {\n margin: 0 !important\n}\n\n.rplayer__playlist-item--current {\n cursor: inherit;\n background-color: #757575\n}\n\n.rplayer__playlist-item--current .rplayer__playlist-item-thumb:before {\n display: block;\n content: '►';\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n text-align: center;\n z-index: 9;\n background-color: rgba(255,255,255,0.5);\n text-shadow: 0.125rem 0.125rem 0.5rem #333\n}\n\n.rplayer__playlist-item-thumb img {\n position: absolute;\n width: 100%\n}\n\n\n${n}\n\n${i}\n\n `}(t,e),i=document.head||N(document.getElementsByTagName("head")),s=w("style",{type:"text/css"});s.styleSheet?window.$?window.$('<style type="text/css">'+n+"</style>").appendTo("head"):s.styleSheet.cssText=n:s.appendChild(document.createTextNode(n)),i.appendChild(s)}function Es(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Ps="rplayer",Ls=`${Ps}__playlist`,Ms=`${Ps}__playlist-wrapper`,As=`${Ms}--wot-title`,Fs=`${Ps}__playlist-header`,zs=`${Ps}__playlist-of`,Ns=`${Ps}__playlist-current-title`,Os=`${Ps}__playlist-item`,Rs=`${Ps}__playlist-item-thumb`,js=`${Os}--current`,Hs=`${Ps}__playlist-item-title`,Ds=`${Ps}__playlist-left-btn`,Bs=`${Ps}__playlist-right-btn`;class Is extends V{constructor(t,e){super(e.bus,e.logger),Es(this,"$element",void 0),Es(this,"$wrapper",void 0),Es(this,"$of",void 0),Es(this,"$currentTitle",void 0),Es(this,"$header",void 0),Es(this,"$left",void 0),Es(this,"$right",void 0),Es(this,"$items",[]),Es(this,"_playlist",[]),Es(this,"_current",null),Es(this,"_header",""),Es(this,"_label","videos"),Es(this,"_point",void 0),Es(this,"_mode",void 0),Es(this,"_forceDowngrade",!1),Es(this,"_isLoop",!1),this._playlist=t,this._mode=e.mode,this._header=e.title,this._label=e.label,this._point=e.forcePoint,this._isLoop=e.loop,this._onResize=this._onResize.bind(this),this._onFullScreenChanged=this._onFullScreenChanged.bind(this),this._gotoNextTrack=this._gotoNextTrack.bind(this),this._gotoPrevTrack=this._gotoPrevTrack.bind(this),e.bus.on("resizeplayer",this._onResize),e.bus.on("nexttrack",this._gotoNextTrack),e.bus.on("prevtrack",this._gotoPrevTrack),e.bus.on("fullscreenchanged",this._onFullScreenChanged),this.render(),this.addEvent(this.$left,"click",()=>this.slideLeft(250)),this.addEvent(this.$right,"click",()=>this.slideRight(250))}isBottom(){return!!this._forceDowngrade||"bottom"===this._mode}_gotoNextTrack(){let t=O(this.$items,this._current),e=this.$items[++t];this._isLoop&&!e&&(e=this.$items[0]),Vs(e,"click")}_gotoPrevTrack(){let t=O(this.$items,this._current);const e=this.$items[--t];e&&Vs(e,"click")}render(){this.$wrapper=w("div",{class:`${Ms} ${this._header?"":As}`}),this.$header=w("h3",{class:Fs,title:this._header},this.$wrapper),this.$header.textContent=this._header,this.$of=w("span",{class:zs},this.$wrapper),this.$currentTitle=w("span",{class:Ns},this.$wrapper),this.$element=w("div",{class:Ls,tabindex:-1},this.$wrapper);const t={type:"button",class:Ds,style:"display: none;"};this.$left=w("button",t,this.$wrapper),Yt(this.$left,Wt),this.$left.setAttribute("aria-label","Scroll left"),this.$right=w("button",{type:"button",class:Bs},this.$wrapper),Yt(this.$right,qt),this.$right.setAttribute("aria-label","Scroll right");const e=F(this._playlist);c(this._playlist,t=>{const n=this._renderItem(t);t===e&&(this._changeSource(e),this._changeCurrent(n)),this.$items.push(n)})}_changeSource(t){this.bus.emit("changesource",t),this.bus.emit("changeplaylistmode",this.isBottom()?"bottom":"right");const e=this._playlist.indexOf(t)+1;this.$of.textContent=`${e}/${this._playlist.length} ${this._label}`,this.$currentTitle.textContent=t.title,this.$currentTitle.setAttribute("title",t.title)}_changeCurrent(t){this._current&&E(this._current,js),S(t,js),this._current=t,this._stablePlaylist()}_stablePlaylist(){if(!this._current)return;const t=this._current.getBoundingClientRect();if(this.isBottom()){if(this.$left){const e=this.$left.getBoundingClientRect();e.right>t.left&&this.slideLeft(e.right-t.left)}if(this.$right){const e=this.$right.getBoundingClientRect();e.left<t.right&&this.slideRight(t.right-e.left)}}else{const e=this.$element.getBoundingClientRect();this.$element.scrollTop-=Math.max(0,e.top-t.top),this.$element.scrollTop+=Math.max(0,t.bottom-e.bottom)}}_renderItem(t){const e=w("div",{class:Os,title:t.title,tabindex:0},this.$element),n=w("div",{class:Rs},e);w("img",{src:t.poster},n),w("span",{class:Hs},e).textContent=t.title,w("b",{},e);const i=()=>{T(e,js)||(this._changeSource(t),this._changeCurrent(e))};return this.addEvent(e,"click",i),this.addEvent(e,"keydown",t=>{32===t.keyCode&&(t.preventDefault(),i())}),e}_onResize(t){const{outerWidth:e}=t;this._forceDowngrade!==e<this._point&&(this._forceDowngrade=!this._forceDowngrade,this.bus.emit("changeplaylistmode",this.isBottom()?"bottom":"right"),this.$wrapper.style.height="",this.$element.style.width="",this.$element.style.marginLeft="",this._stablePlaylist()),this.isBottom()?this._resize4bottom(t):this._resize4right(t)}_resize4right({height:t}){if(this.$wrapper.style.height=`${t}px`,!this._current)return;const e=this._current.getBoundingClientRect(),n=this.$element.getBoundingClientRect();n.top>e.top?this.$element.scrollTop=this.$element.scrollTop-(n.top-e.top):n.bottom<e.bottom&&(this.$element.scrollTop=this.$element.scrollTop+e.bottom-n.bottom)}_resize4bottom({width:t}){c(this.$items,t=>{t.style.width=""}),this.$element.style.width=`${t}px`,t=0,c(this.$items,e=>{t+=e.offsetWidth;const n=e.currentStyle||window.getComputedStyle(e);t+=parseFloat(n.marginRight)}),this.$element.style.width=`${t}px`,this._stableBottomPosition()}_stableBottomPosition(){if(!this._current)return;const t=this._current.getBoundingClientRect(),e=this.$wrapper.getBoundingClientRect();e.left>t.left?(Vs(this.$left,"click"),setTimeout(()=>this._stableBottomPosition())):e.right<t.right&&(Vs(this.$right,"click"),setTimeout(()=>this._stableBottomPosition()))}_onFullScreenChanged(t){this.$element.style.display=t?"none":"block"}slideLeft(t){let e=parseInt(this.$element.style.marginLeft,10)||0;e=Math.min(0,e+t),this.$element.style.marginLeft=`${e}px`,this.$right.style.display="block",e||(this.$left.style.display="none")}slideRight(t){const e=this.$element.parentNode;if(!(e instanceof HTMLElement))return;let n=parseInt(this.$element.style.marginLeft,10)||0;n-=t;const i=e.offsetWidth-this.$element.offsetWidth;n=Math.max(i,n),this.$element.style.marginLeft=`${n}px`,this.$left.style.display="block",n===i&&(this.$right.style.display="none")}getElement(){return this.$wrapper}destroy(){super.destroy(),this.bus.off("resizeplayer",this._onResize),this.bus.off("nexttrack",this._gotoNextTrack),this.bus.off("prevtrack",this._gotoPrevTrack),this.bus.off("fullscreenchanged",this._onFullScreenChanged),this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element),this.$items.length=0,this._playlist.length=0,this._current=null}}function Vs(t,e){let n;document.createEvent?(n=document.createEvent("HTMLEvents"),n.initEvent(e,!0,!0)):(n=document.createEventObject(),n.eventType=e),n.eventName=e,t.dispatchEvent?t.dispatchEvent(n):t.fireEvent("on"+e,n)}class Us{constructor(){var t,e,n;t=this,n={},(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e="_events"))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}on(t,e){this._events[t]=this._events[t]||[],this._events[t].push(e)}off(t,e){this._events=this._events||{},t in this._events!=0&&R(this._events[t],e)}once(t,e){const n=(...i)=>{this._call(e,i),this.off(t,n)};this.on(t,n)}emit(t,...e){if("*"!==t&&this.emit.apply(this,["*",t].concat(e)),this._events=this._events||{},t in this._events!=0)for(let n=this._events[t].length-1;n>=0;n--)this._call(this._events[t][n],e)}destroy(){this._events={}}_call(t,e){if(t._safe_inner)t.apply(this,e);else try{t.apply(this,e)}catch(t){console.error(t)}}}function Ws(t){return window.console?function(...e){t in console&&o(console[t])&&(e.unshift((new Date).toString()),console[t].apply(console,e))}:d}function qs(t=2){let e=1;const n={};return n.debug=++e>t?Ws("debug"):d,n.log=++e>t?Ws("log"):d,n.warn=++e>t?Ws("warn"):d,n.error=++e>t?Ws("error"):d,n}function Gs(){return!!navigator.userAgent.match(/Android/i)}function Qs(){return Gs()||Q()||!!navigator.userAgent.match(/(IEMobile|Windows Phone)/i)}function Ys(){const t=navigator.userAgent.toLowerCase();return-1!==t.indexOf("msie")&&parseInt(t.split("msie")[1],10)}function Zs(){return 8===Ys()}const Ks={annotations:null,chapters:null,cc:null,preview:null,poster:null,title:"",nextTrackTitle:"",nextTrackThumbnails:"",clip:null,isAudio:!1},Js=["audio/mp3","audio/mpeg","audio/mp4"];function Xs(t,e){const n={showAnnotations:!b((e=H({},Ks,t,e)).showAnnotations)||e.showAnnotations,showQuality:!b(e.showQuality)||e.showQuality,showPlaceholder:!b(e.showPlaceholder)||e.showPlaceholder};var i;return n.showPoster=e.showPoster&&b(e.poster),e.showHelp&&(n.showHelp=function(){const t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))}()),i=e.type,(a(Js,i)||e.isAudio)&&(n.showFullScreen=!1,n.showClosedCaptions=!1,n.showTOC=!1,n.showAnnotations=!1,n.showQuality=!1,n.isAudio=!0),Qs()&&(n.showVolume=!1,n.showQuality=!1,n.showHelp=!1,n.preview=null,n.showTitle=!1,n.showCCLayout=!1,n.isMobile=!0,n.extensionsVisibilityTimeout=4e3),Gs()&&(n.showPlaybackRate=!1),Zs()&&(n.showCCLayout=!1,n.useMux=!1),!e.startTime&&Q()&&(n.startTime=.5),f(e.annotations)&&(n.showAnnotations=!1),e.startTime&&!n.isAudio&&(n.showPoster=!1),st(e),e.showAnnotations&&(n.showAnnotations=b(e.annotations)&&$(e.annotations)),!1===n.showAnnotations&&!1===n.showPlaybackRate&&!1===n.showQuality&&(n.showSettings=!1,e.showSettings=!1),n.showDownloadCC=e.showDownloadCC&&b(e.cc)&&$(e.cc),e.showDownloadVideo&&(n.showDownloadVideo=!!navigator.userAgent.match(/(Windows NT 10)/i)&&b(e.downloadURL)&&$(e.downloadURL)),n.showDownload=e.showDownload&&(n.showDownloadVideo||n.showDownloadCC||!!e.downloadVideoURL),n.showCaptionSearch=e.showCaptionSearch&&b(e.cc)&&$(e.cc),e.showExtensions||(n.showPlay=!1,n.showProgress=!1,n.showVolume=!1,n.showFullScreen=!1,n.showClosedCaptions=!1,n.showTOC=!1,n.showAnnotations=!1,n.showQuality=!1,n.showPoster=!1,n.showPlaceholder=!1,n.showPlaybackRate=!1,n.showForward=!1,n.showBackward=!1,n.showSettings=!1,n.showDownload=!1,n.showHelp=!1,n.showTitle=!1,n.showNext=!1),H(e,n)}const to="bottom",eo="right",no="auto",io=[no,to,eo],so={loggerLevel:2,timecode:0,frameRate:23.976,autoStart:!1,startTime:null,endTime:null,useNativeControls:!1,useOriginTimeForPreview:!0,playlistmode:no,playlistAutoGoNext:!0,playlistitle:"",playlistforcepoint:0,showExtensions:!0,alwaysShowExtensions:!1,extensionsVisibilityTimeout:2e3,showPlay:!0,showProgress:!0,showVolume:!0,showFullScreen:!0,showClosedCaptions:!0,showTOC:!0,showAnnotations:!0,showQuality:!0,showAudioTracks:!1,showPoster:!0,showError:!1,showPlaceholder:!0,showPlaybackRate:!0,showForward:!0,showBackward:!0,showSettings:!0,showDownload:!0,showDownloadVideo:!0,showDownloadCC:!1,showBottomNext:!1,showBottomPrev:!1,showCaptionSearch:!1,showCrawl:!1,crawl:null,downloadVideoURL:null,showHelp:!0,showTitle:!0,showNext:!1,showNextFrame:!1,showPrevFrame:!1,showCCLayout:!0,showTheaterMode:!1,useMux:!1,showSubtitles:!1,skipDelta:10,keyboardListeners:{},globalKeyboardListeners:!1,isHandlingKeyboardEvents:!0,bufferingTimeout:200,hls:{maxFragLookUpTolerance:.001,maxMaxBufferLength:60},shaka:{},mux:{env_key:"",page_type:"watchpage",viewer_user_id:"",experiment_name:"",sub_property_id:"",player_name:"RavnurPlayer",player_version:"3.3.3",player_init_time:"",video_id:"",video_title:"",video_series:"",video_producer:"",video_content_type:"",video_language_code:"",video_variant_name:"",video_variant_id:"",video_duration:"",video_stream_type:"on-demand",video_encoding_variant:"",video_cdn:""},i18n:null,hlsjsURL:"https://cdn.jsdelivr.net/npm/hls.js@1.5.17/dist/hls.min.js",shakaURL:"https://cdn.jsdelivr.net/npm/shaka-player@4.16.10/dist/shaka-player.compiled.min.js",muxURL:"https://src.litix.io/core/4/mux.js",disableAutoUrlRewrite:!1,useHTMLPlayer:!1,useHLSJSPlayer:!1},oo={accentColor:"#81d4fa",mainColor:"#fff",submenuBgColor:"#eee",submenuColor:"#333",chaptersBubbleColor:"#1565C0",pltHeight:"135px",rplaylistHeight:"30%"};const ro={label:"None",srclang:"",src:"",state:2},ao={color:"fontcolor",bgcolor:"bgcolor",fontSize:"fontsize",fontFamily:"fontfamily",location:"cc_location",lang:"cclang"},lo="toclang",ho={theaterchanging:(t,e)=>H({},e,{isTheaterMode:!e.isTheaterMode}),fullscreenchanging:(t,e,n)=>H({},e,{isFullScreen:"boolean"==typeof n?n:!e.isFullScreen}),cclang(t,e,n){const i=e.cc.sources,s=i[Math.max(O(i,t=>t.srclang===n),0)];if(!s)return e;2===s.state&&oe(ao.lang,n);const o=H({},e.cc,{lang:n,loading:!1}),r=H({},e,{cc:o});return t.emit("captionschange",s),s.srclang&&(r.cc.loading=!0,fo(t,"refreshcaptions",s)),e.cc.lang&&n||t.emit("cclayoutchange",{mode:n&&e.cc.location||"over",fontSize:e.cc.fontSize}),r},ccsources(t,e,n,i=!1){const s=yo(n,e.cc.lang);n=s.sources;const o=s.current&&s.current.srclang||"";i||setTimeout(()=>t.emit("cclang",o),5);const r=H({},e.cc,{sources:n,lang:o,timedata:[]});return H({},e,{cc:r})},refreshcaptions(t,e,n,i){const s=H({},e.cc,{timedata:n});return s.timedataLang=i,s.loading=!1,H({},e,{cc:s})},cclocation(t,e,n){oe(ao.location,n),t.emit("cclayoutchange",{mode:e.cc.lang&&n||"over",fontSize:e.cc.fontSize});const i=H({},e.cc,{location:n});return H({},e,{cc:i})},ccfontfamily(t,e,n){oe(ao.fontFamily,n);const i=H({},e.cc,{fontFamily:n});return H({},e,{cc:i})},ccfontsize(t,e,n){oe(ao.fontSize,n),t.emit("cclayoutchange",{mode:e.cc.lang&&e.cc.location||"over",fontSize:n});const i=H({},e.cc,{fontSize:n});return H({},e,{cc:i})},ccbgcolor(t,e,n){oe(ao.bgcolor,n);const i=H({},e.cc,{bgcolor:n});return H({},e,{cc:i})},cccolor(t,e,n){oe(ao.color,n);const i=H({},e.cc,{color:n});return H({},e,{cc:i})},chaptersloaded(t,e,n,i){const s=H({},e.toc,{timedata:n});return s.timedataLang=i,H({},e,{toc:s})},tocsources(t,e,n){const i=mo(),s=yo(n,i.lang);i.sources=s.sources,i.lang=s.current&&s.current.srclang||"";const o=M(i.sources,t=>t.srclang===i.lang);if(o&&o.srclang)fo(t,"chaptersloaded",o);else{const e=1;fo(t,"chaptersloaded",M(i.sources,t=>!!t.default)||i.sources[e])}return H({},e,{toc:i})},changesource(t,e,n){const i=go(),s=yo(n.cc,i.lang);i.sources=s.sources,i.lang=s.current&&s.current.srclang||"";const o=M(i.sources,t=>t.srclang===i.lang);if(o&&o.srclang)fo(t,"refreshcaptions",o);else{const e=1;fo(t,"refreshcaptions",M(i.sources,t=>!!t.default)||i.sources[e])}const r=mo(),a=yo(n.chapters,r.lang);r.sources=a.sources,r.lang=a.current&&a.current.srclang||"";const l=M(r.sources,t=>t.srclang===r.lang);if(l&&l.srclang)fo(t,"chaptersloaded",l);else{const e=1;fo(t,"chaptersloaded",M(r.sources,t=>!!t.default)||r.sources[e])}return H({},e,{cc:i,toc:r})},toclang(t,e,n){const i=e.toc.sources,s=i[Math.max(O(i,t=>t.srclang===n),0)];2===s.state&&oe(lo,n);const o=H({},e.toc,{lang:n}),r=H({},e,{toc:o});return s.srclang&&fo(t,"chaptersloaded",s),r}},co={isFullScreen:!1,isTheaterMode:!1,cc:{color:"#FFF",bgcolor:"#000",fontSize:"100%",fontFamily:'Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif',location:"over",lang:null,sources:[],timedata:[],timedataLang:"",loading:!1},toc:{lang:null,sources:[],timedata:[],timedataLang:""}},po={};class uo extends V{constructor(t,e){var n,i,s;super(t,e),n=this,s=void 0,(i=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(i="_uid"))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,this._uid=x(),po[this._uid]=H({},co),po[this._uid].cc=go(),c(ho,(e,n)=>{"number"!=typeof n&&t.on(n,(...n)=>{const i=po[this._uid],s=e.apply(this,[t,i].concat(n));po[this._uid]=s,t.emit("statechanged",s,i)})})}isFullScreen(){return po[this._uid].isFullScreen}isTheaterMode(){return po[this._uid].isTheaterMode}getCCLang(){return po[this._uid].cc.lang}getCCTextColor(){return po[this._uid].cc.color}getCCBgColor(){return po[this._uid].cc.bgcolor}getCCFontSize(){return po[this._uid].cc.fontSize}getCCFontFamily(){return po[this._uid].cc.fontFamily}getCCLocation(){return po[this._uid].cc.location}getCCSources(){const t=po[this._uid].cc.sources||[];return Qs()?L(t,t=>3!==t.state):t}getCCTimeData(){return po[this._uid].cc.timedata}getCCTimeDataLang(){return po[this._uid].cc.timedataLang}getSelectedCC(){const t=po[this._uid],{sources:e,lang:n}=t.cc;return e[Math.max(O(e,t=>t.srclang===n),0)]}isTranslatingCC(){const t=po[this._uid],{sources:e,lang:n,loading:i}=t.cc,s=Math.max(O(e,t=>t.srclang===n),0);return i&&0===e[s].state}getTOCSources(){return po[this._uid].toc.sources}getTOCLang(){return po[this._uid].toc.lang}getTOCTimeData(){return po[this._uid].toc.timedata}getTOCTimeDataLang(){return po[this._uid].toc.timedataLang}}function go(){const t=H({},co.cc);return c(ao,(e,n)=>{t[n]=re(e,co.cc[n])}),t}function mo(){const t=H({},co.toc);return t.lang=re(lo,co.toc.lang),t}function bo(t){return H({},t,{state:"number"==typeof t.state?t.state:2})}function yo(t,e){const n=function(t){return t.sort((t,e)=>{const n="number"==typeof t.state?t.state:2,i="number"==typeof e.state?t.state:2;return n===i?t.label<e.label?-1:1:"number"==typeof n&&"number"==typeof i?i-n:0})}(A(t||[],bo)),i=n.length?[ro].concat(n):[];let s=M(i,t=>t.srclang===e&&0!==t.state);if(!s){const t=L(i,t=>0!==t.state),e=1;s=M(i,t=>!!t.default)||t[e]}return{sources:i,current:s||null}}function fo(t,e,n){if(!n||!n.src)return void t.emit(e,[]);const i=n.srclang,s=()=>t.emit(e,[],i);"json"===n.type?ut({url:n.src,success:n=>t.emit(e,JSON.parse(n.data),i),error:s}):yt(n.src,n=>t.emit(e,n,i),s)}function vo(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const $o="rplayer",xo=`${$o}--fullscreen`,_o=`${$o}--iphone`,wo=`${$o}--mobile`,Co=`${$o}--cc-75-below`,ko=`${$o}--cc-100-below`,To=`${$o}--cc-125-below`,So=`${$o}--cc-150-below`,Eo=`${$o}--cc-200-below`,Po=`${$o}__inner`,Lo=`${Po}--playing`,Mo=`${Po}--active`,Ao=`${Po}--hovering`,Fo=`${Po}--light`,zo=`${Po}--cc-below`,No=`${Po}--accessibility`,Oo="rmp-extensions",Ro=`${Oo}--hidden`,jo="last-play-time";let Ho,Do=!1,Bo=!1,Io=0;const Vo={[to]:`${$o}--bottom-playlist`,[eo]:`${$o}--right-playlist`};class Uo extends V{constructor(t,e={},n=qs()){super(new Us,n),vo(this,"controller",null),vo(this,"extensions",[]),vo(this,"state",void 0),vo(this,"_playlist",[]),vo(this,"originOptions",null),vo(this,"options",null),vo(this,"activeSourceId",void 0),vo(this,"$el",void 0),vo(this,"$inner",void 0),vo(this,"$extensionsWrapper",null),vo(this,"playlistController",null),vo(this,"_timerId",null),vo(this,"_isOpenPopup",!1),vo(this,"_clipStopInterval",null),vo(this,"_isPlaylist",!1),Do||(Ss(e=H({},oo,e),Zs()?t.getBoundingClientRect():null),Do=!0);const i=t;this.$el=w("div",{class:$o},i),P(this.$el,_o,Q()),P(this.$el,wo,Qs()),this.$inner=w("div",{class:Po},this.$el),ke(this,["onStateChanged","onFullScreenChanged","disappearExtensions","appearExtensions","_renderPlayer","onPlay","onPause","onEnded","onMouseMove","onClick","_disappearExtensionsDelayed","_appearExtensionsImmediately","onOpenPopup","onClosePopup","onPlayClicked","onChangePlaylistMode","onMouseEnter","onMouseLeave","onKeydown","onMobileTouch","_heartbeatExtension","_handleQualityChange","onTimeUpdate","_handleLastPlayTime"]),this.bus.on("statechanged",this.onStateChanged),this.bus.on("pause",this.onPause),this.bus.on("timeupdate",this.onTimeUpdate),this.bus.on("ended",this.onEnded),this.bus.on("play",this.onPlay),this.bus.on("changesource",this._renderPlayer),this.bus.on("showpopup",this.onOpenPopup),this.bus.on("hidepopup",this.onClosePopup),this.bus.on("handle-play-clicked",this.onPlayClicked),this.bus.on("changeplaylistmode",this.onChangePlaylistMode),this.bus.on("heartbeatextensions",this._heartbeatExtension),this.bus.on("manualquality",this._handleQualityChange),this.state=new uo(this.bus,n),Qs()?this.bus.on("mobiletouch",this.onMobileTouch):(this.addEvent(this.$el,"mouseleave",this.onMouseLeave),this.addEvent(this.$el,"mouseenter",this.onMouseEnter),this.addEvent(this.$el,"mousemove",this.onMouseMove),this.addEvent(this.$el,"keydown",this.onKeydown),this.addEvent(this.$el,"click",this.onClick)),at&&at.enabled&&(this.$el.addEventListener("webkitfullscreenchange",this.onFullScreenChanged),this.$el.addEventListener("fullscreenchange",this.onFullScreenChanged),document.addEventListener("mozfullscreenchange",this.onFullScreenChanged),document.addEventListener("MSFullscreenChange",this.onFullScreenChanged))}onMouseLeave(){E(this.$inner,Ao),this.disappearExtensions()}onMouseEnter(){S(this.$inner,Ao),this.appearExtensions()}onKeydown(t){Bo&&(clearInterval(Ho),Io=0,9===t.keyCode&&this.appearExtensions(),Ho=setInterval(()=>{Io++,Io>5&&(Io=0,this.disappearExtensions(),clearInterval(Ho))},1e3))}onPlay(){S(this.$inner,Lo),this.onMouseMove()}onPause(){this.originOptions&&!this.originOptions.playLoop&&(E(this.$inner,Lo),this.appearExtensions())}onEnded(){this.originOptions&&this.originOptions.playLoop?this.controller?.play():(E(this.$inner,Lo),this.appearExtensions())}onPlayClicked(){E(this.$inner,Fo)}onTimeUpdate(){const{activeSourceId:t,controller:e}=this;if(!this.originOptions||!e)return;const{savePlayTime:n}=this.originOptions,i=e.getDuration()<=15;let s=e.getCurrentTime();if(s<5||i)return;if(!n||!t)return;let o=re(jo,{});if(o=JSON.parse(o),!o.expires){const t=new Date;o.expires=(new Date).setMonth(t.getMonth()+1)}(new Date).getTime()>o.expires&&(o={},o.expires=(new Date).setMonth((new Date).getMonth()+1));const r=e.getDuration()-10;s=s<=r?s:r,o[t]=s,oe(jo,JSON.stringify(o))}isShownExtensions(){const{$extensionsWrapper:t}=this;if(!t)return!1;let e=!T(this.$inner,Ro);return e=e||T(this.$inner,Fo),e}onMobileTouch(){const{controller:t}=this;t&&this.isShownExtensions()&&(t.isPaused()?t.play():t.pause()),this._heartbeatExtension()}onMouseMove(){this._heartbeatExtension()}onClick(){this._heartbeatExtension()}_heartbeatExtension(){this._appearExtensionsImmediately(),this._isOpenPopup||this._disappearExtensionsDelayed()}onOpenPopup(){this._isOpenPopup=!0,S(this.$inner,Mo),this._appearExtensionsImmediately()}onClosePopup(){this._isOpenPopup=!1,E(this.$inner,Mo),this._disappearExtensionsDelayed()}_appearExtensionsImmediately(){this.appearExtensions(),this._timerId&&clearTimeout(this._timerId)}_disappearExtensionsDelayed(){const{originOptions:t}=this;t&&!t.alwaysShowExtensions&&(this._timerId=setTimeout(this.disappearExtensions,t.extensionsVisibilityTimeout))}_getParentElementForController(){const{controller:t}=this;if(!t)return null;const e=t.getElement();if(!e)return null;const n=e.parentNode;return n&&n instanceof HTMLElement?n:null}changeFullScreenMode(){if(!this._getParentElementForController()&&!Q())return;const t=this.state.isFullScreen();if(this.$inner.style.width="",this.$inner.style.height="",at&&at.enabled)t?at.request(this.$el):at.exit();else if(Q()&&this.controller)this.controller.getElement().webkitEnterFullscreen(),this.bus.emit("fullscreenchanging",!1);else{const n=this.$el.parentNode;if(!(n&&n instanceof HTMLElement))return;t?(S(n,xo),function(t){const e=function(){const t=document.documentElement;return t?t.clientWidth:null}(),n=function(){const t=document.documentElement;return t?t.clientHeight:null}();"number"==typeof e&&"number"==typeof n&&function(t,e,n){t.style.width=`${e}px`,t.style.height=`${n}px`}(t,e,n)}(n)):(E(n,xo),(e=n).style.width="",e.style.height=""),this.bus.emit("fullscreenchanged",t)}var e}onStateChanged(t,e){if(t.isFullScreen!==e.isFullScreen&&this.changeFullScreenMode(),t.cc.fontSize!==e.cc.fontSize||t.cc.location!==e.cc.location||t.cc.lang!==e.cc.lang){const e=t.cc.lang;e&&this.changeLayout(e,t.cc.fontSize,t.cc.location)}}onFullScreenChanged(){if(!at)return;const t=at.isFullscreen;this.bus.emit("fullscreenchanging",t);const e=this.$el.parentNode;e&&e instanceof HTMLElement&&P(e,xo,at.isFullscreen)}changeLayout(t,e,n){const i=t&&"below"===n;P(this.$inner,zo,i),P(this.$el,Co,i&&"75%"===e),P(this.$el,ko,i&&"100%"===e),P(this.$el,To,i&&"125%"===e),P(this.$el,So,i&&"150%"===e),P(this.$el,Eo,i&&"200%"===e)}_detectPlaylistMode(){const{originOptions:t}=this;if(!t)return"auto";let e=t.playlistmode;return e=a(io,e)?e:F(io),e===no&&(e=Qs()?to:eo),e}setup(t,e={}){const n=b(e.loggerLevel)?e.loggerLevel:so.loggerLevel,s=e.logger||qs(n),o=H({bus:this.bus,logger:e.logger||s},so,e);if(Bo=e.accessibility||!1,Bo&&S(this.$inner,No),this.originOptions=o,this._isPlaylist=i(t),this._playlist=[].concat(t),!this._playlist.length)return void setTimeout(()=>{const t=this.$el.parentNode;t&&t instanceof HTMLElement&&(t.style.position="relative",t.style.border="1px solid grey"),this.destroy(),w("i",{class:"rmp-no-video"},t).textContent=ht(o.i18n,"no-video")},5);if(this._isPlaylist){const t=this._detectPlaylistMode();this.onChangePlaylistMode(t);const e=ht(o.i18n,"playlist-count-of"),n=o.playlistitle,i=o.playlistforcepoint,r=o.playLoop,a={mode:t,bus:this.bus,title:n,label:e,forcePoint:i,logger:s,loop:r};this.playlistController=new Is(this._playlist,a),o.hideplaylist||_(this.$el,this.playlistController.getElement()),(Object.keys(o).includes("plalistAutoGoNext")?o.plalistAutoGoNext:o.playlistAutoGoNext)&&this.bus.on("ended",()=>{this.bus.emit("nexttrack"),this._playOnLoad()})}this._isPlaylist&&!this.originOptions.hideplaylist||this.bus.emit("changesource",F(this._playlist)),this.bus.on("*",t=>o.logger.debug(t));const r=this.state,a=r.getCCLang()&&r.getCCLocation()||"over";this._afterSetup(),setTimeout(()=>{this.bus.emit("cclayoutchange",{mode:a,fontSize:r.getCCFontSize()})})}onChangePlaylistMode(t){this.originOptions&&!this.originOptions.hideplaylist&&c(Vo,(e,n)=>P(this.$el,e,n===t))}_runOnce(t){this.bus.once("canplaythrough",()=>setTimeout(t)),this.bus.once("loadedmetadata",()=>setTimeout(t))}_playOnLoad(){this._runOnce(()=>{const{controller:t}=this;t&&t.play()})}_afterSetup(){const{controller:t,originOptions:e}=this;if(!t||!e)return;const{autoStart:n,startTime:i,endTime:s}=e;n&&this._playOnLoad(),(i||s)&&this.playPart(i,s,!0)}_handleLastPlayTime(){if(!this.originOptions)return;const{savePlayTime:t,startTime:e}=this.originOptions,{activeSourceId:n}=this;if(e||!t||!n)return;let i=re(jo,"{}");if(!i)return;i=JSON.parse(i);const s=i[n];s&&this.playPart(s,void 0,!0)}playPart(t,e,n=!1){const{controller:i}=this;if(i){if("number"==typeof t)if(n){const e=t;this._runOnce(()=>i.setCurrentTime(e))}else i.setCurrentTime(t);if("number"==typeof e){const t=()=>{const n=i.getCurrentTime();"number"==typeof n&&"number"==typeof e&&n>e&&(i.pause(),this.bus.off("timeupdate",t))};this.bus.on("timeupdate",t)}n||i.play()}}_renderPlayer(t){if(!t.src)throw new Error("Incorrent load's options.");this.activeSourceId=t.id;const e=this.state.getCCLang();e&&this.changeLayout(e,this.state.getCCFontSize(),this.state.getCCLocation());let n={};if(this._isPlaylist&&this.originOptions&&!this.originOptions.hideplaylist){const e=O(this._playlist,t),i=this._playlist[e+1]||null,s=this._playlist[e-1]||null;n={showNext:b(i),nextTrackThumbnails:D(i,"poster",""),nextTrackTitle:D(i,"title",""),showPrev:b(s),prevTrackThumbnails:D(s,"poster",""),prevTrackTitle:D(s,"title","")}}const i=Xs(this.originOptions||{},H({},t,n));if(this.options=i,this.controller&&this.controller.destroy(),this.destroyExtensions(),s=i.type,a(tt,s)&&!Uo.canPlayHLS){const t=this.$el.parentNode;t&&t instanceof HTMLElement&&(t.style.position="relative",t.style.border="1px solid grey"),this.destroy();const e=w("i",{class:"rmp-no-video"},t);return void(this.originOptions&&(e.textContent=ht(this.originOptions.i18n||{},"no-video")))}var s;this._beforeRender(i);const o=function(t,e){const n=st(t);return new(0,it[n])(t,e)}(i,this.state);if(this.controller=o,_(this.$inner,o.$el),o.load(i),this._handleLastPlayTime(),i.useNativeControls)return;E(this.$inner,Lo),S(this.$inner,Fo),i.showCrawl&&S(this.$inner,"rmp-ext-crawl--exist");const r=w("div",{class:Oo},this.$inner);this.$extensionsWrapper=r,c(function(t,e,n){const i=[];return c(Ts,([s,o])=>{(!0===s||"string"==typeof s&&!0===n[s])&&i.push(new o(t,e,n))}),i}(o,this.state,i),t=>{try{const e=t.getElement();e&&(_(r,e),t.addEvent(e,"dblclick",Wo));const n=t.getOuter();n&&_(this.$inner,n,r),this.extensions.push(t)}catch(t){i.logger.error(t)}})}_beforeRender({clip:t,timecode:e}){if(this._clipStopInterval&&clearInterval(this._clipStopInterval),t){const[n,i]=t;n&&this._runOnce(()=>{this.controller&&this.controller.setCurrentTime(n)}),i&&(this._clipStopInterval=setInterval(()=>{const t=this.controller;t&&!t.isPaused()&&t.getCurrentTime()>i+(e||0)&&(t.pause(),setTimeout(()=>this.bus.emit("ended")))},26))}}_handleQualityChange(t){this.originOptions&&(this.originOptions.qualityLevel=t)}refreshCrawlExtension(t,e=!0){if(!this.originOptions)return;if(this.originOptions.logger.debug("crawl:extensions:refreshing"),!t)throw new Error("Crawl options not found");const n=this.extensions.find(t=>"$crawl"in t);if(!n){this.originOptions.logger.debug("crawl:extensions:creating");const e=H({},this.originOptions,{crawl:t}),n=new vs(this.controller,this.state,e),i=n.getOuter();return i&&_(this.$inner,i,this.$extensionsWrapper),void this.extensions.push(n)}this.logger.debug("crawl:extensions:refreshing"),n.refresh(t,e)}destroyExtensions(){c(this.extensions,t=>t.destroy()),this.extensions.length=0;const{$extensionsWrapper:t}=this;if(t&&n(t)){const e=t.parentNode;e&&e.removeChild(t)}}disappearExtensions(){const{originOptions:t,$inner:e}=this;if(!t||!e)return;const n=t.alwaysShowExtensions;this.controller&&(n||this._isOpenPopup||this.controller.isPaused())||S(e,Ro)}appearExtensions(){E(this.$inner,Ro)}on(t,e){this.bus.on(t,e)}off(t,e){this.bus.off(t,e)}destroy(){super.destroy(),this.bus.destroy(),this._clipStopInterval&&clearInterval(this._clipStopInterval),this.destroyExtensions();const{controller:t}=this;t&&(t.pause(),t.destroy()),this.controller=null,at&&at.enabled&&(this.$el.removeEventListener("webkitfullscreenchange",this.onFullScreenChanged),this.$el.removeEventListener("fullscreenchange",this.onFullScreenChanged),document.removeEventListener("mozfullscreenchange",this.onFullScreenChanged),document.removeEventListener("MSFullscreenChange",this.onFullScreenChanged)),this.playlistController&&this.playlistController.destroy();const e=this.$el.parentNode;this.$el.removeChild(this.$inner),e&&e.removeChild(this.$el)}static addStyles(t){Ss(H({},oo,t))}}function Wo(t){t.stopPropagation()}vo(Uo,"canPlayHLS",!(Ys()||window.MSInputMethodContext&&document.documentMode));const qo=Uo;exports.RavnurMediaPlayer=e.default})();