(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{30:function(e,t,i){"use strict";i.r(t);var r=i(6),n=i(0),s=i(8);let o,a,d,l,h,u=e=>e;class b extends r.a{static get properties(){return{url:{observe:!0,DOM:!0,fromAttributeConverter:n.d.fromAttribute,changedHandler:"_urlChanged"},subtitlesUrl:{observe:!0,DOM:!0,fromAttributeConverter:n.d.fromAttribute,attributeName:"subtitles-url"},playing:{observe:!0,DOM:!0,reflect:!0,fromAttributeConverter:n.a.fromAttribute,toAttributeConverter:n.a.toAttribute},paused:{observe:!0,DOM:!0,fromAttributeConverter:n.a.fromAttribute,changedHandler:"_pausedChanged"},loading:{observe:!0,DOM:!0,fromAttributeConverter:n.a.fromAttribute},error:{observe:!0,DOM:!0,fromAttributeConverter:n.a.fromAttribute},duration:{observe:!0},elapsedTime:{observe:!0,DOM:!0,fromAttributeConverter:n.b.fromAttribute,changedHandler:"_elapsedTimeChanged"},buffered:{observe:!0},loop:{observe:!0,DOM:!0,fromAttributeConverter:n.a.fromAttribute},muted:{observe:!0,DOM:!0,reflect:!0,fromAttributeConverter:n.a.fromAttribute,toAttributeConverter:n.a.toAttribute},userMuted:{observe:!0},objectFit:{observe:!0,DOM:!0,reflect:!0,attributeName:"object-fit",fromAttributeConverter:n.d.fromAttribute,toAttributeConverter:n.d.toAttribute},objectPosition:{observe:!0,DOM:!0,attributeName:"object-position",fromAttributeConverter:n.d.fromAttribute,changedHandler:"_objectPositionChanged"},unmuteSelector:{observe:!0,DOM:!0,attributeName:"unmute-selector",fromAttributeConverter:n.d.fromAttribute},_currentSubtitleText:{observe:!0},_savedTime:{observe:!0},_videoHeight:{observe:!0},_isEdge:{observe:!0}}}static get propertiesChangedHandlers(){return{render:["url","_savedTime","loop","_videoHeight","subtitlesUrl","_currentSubtitleText"],_toggleSound:["muted","userMuted"]}}constructor(){super(),this.url="#",this.playing=!1,this.paused=!1,this.loading=!0,this.error=!1,this.duration=0,this.elapsedTime=0,this.buffered=0,this.loop=!1,this.muted=!1,this.userMuted=!0,this.unmuteSelector=".unmute",this.objectFit="contain",this.objectPosition="50% 50%",this._currentSubtitleText="",this._savedTime=0,this._videoHeight=0,this._isEdge=/Edge\/\d./i.test(navigator.userAgent),window.addEventListener("online",this._handleOnline.bind(this)),window.addEventListener("click",this._handleClick.bind(this))}reset(){const e=this.shadowRoot.querySelector("video");e&&(e.currentTime=0)}setCurrentTime(e){this.shadowRoot.querySelector("video").currentTime=e}_handleClick(e){if(!this.userMuted)return;!!e.composedPath().filter(e=>e.matches&&e.matches(this.unmuteSelector))[0]&&(this.userMuted=!1,this._toggleSound())}_toggleSound(){const e=this.shadowRoot.querySelector("video");if(e)if(this.muted)e.muted=!0,e.setAttribute("muted","");else{if(this.userMuted)return;e.muted=!1,e.removeAttribute("muted")}}propertiesChangedCallback(e,t,i){super.propertiesChangedCallback(e,t,i),-1!==e.indexOf("playing")&&this._notifyPropChanged("playing",this.playing),-1!==e.indexOf("loading")&&this._notifyPropChanged("loading",this.loading),-1!==e.indexOf("duration")&&this._notifyPropChanged("duration",this.duration),-1!==e.indexOf("elapsedTime")&&this._notifyPropChanged("elapsed-time",this.elapsedTime),-1!==e.indexOf("buffered")&&this._notifyPropChanged("buffered",this.buffered)}_notifyPropChanged(e,t){this.dispatchEvent(new CustomEvent(e+"-changed",{detail:{value:t}}))}_urlChanged(e,t){t&&"#"!==t||(this._savedTime=this.elapsedTime,this.updateStyles("--slicesui-av-player-opacity",0))}_handleWaiting(){this.loading=!0}_handleCanPlay(e){if(this.error=!1,this.paused)return e.target.pause();let t=e.target.play();t&&t.then(()=>{}).catch(()=>{})}_handlePlaying(){this.playing=!0,this.loading=!1}_handlePause(){this.playing=!1}_handleTimeUpdate(e){this.url&&"#"!==this.url&&(this.elapsedTime=parseFloat(e.target.currentTime.toFixed(1)),this.duration=parseFloat(e.target.duration.toFixed(1)),this.paused&&e.target.pause())}_handleEnded(){this.dispatchEvent(new CustomEvent("track-finished")),this.loop||(this.elapsedTime=0)}_handleError(){this.error=!0}_handleLoadedMetadata(e){this._videoHeight=e.target.videoHeight,e.target.currentTime=this._savedTime||0,this.duration=parseFloat(e.target.duration.toFixed(1)),this.updateStyles("--slicesui-av-player-opacity",1)}_pausedChanged(){let e=this.shadowRoot.querySelector("video");if(this.paused&&e)return e.pause();!this.paused&&e&&this.url&&"#"!==this.url&&e.play()}_handleOnline(){this.error&&this.render()}_handleProgress(e){0!==e.target.buffered.length&&(this.buffered=parseFloat(e.target.buffered.end(0).toFixed(1)))}_elapsedTimeChanged(e,t){0===t&&e>0&&this._handleEnded()}_handleCueChange(e){let t=(e.target.track.activeCues||[])[0],i=t&&t.text||"";this._currentSubtitleText=i.replace(/\n/g,"
")}_objectPositionChanged(){const e=(this.objectPosition||"50% 50%").split(" "),t=(e[0]||"50%").trim(),i=(e[1]||"50%").trim();this.updateStyles("--slicesui-av-player-video-top",i),this.updateStyles("--slicesui-av-player-video-left",t),this.updateStyles("--slicesui-av-player-video-transform","translate(-"+t+", -"+i+")")}get template(){return Object(r.b)(o||(o=u`
${0}