platypush/platypush/backend/http/dist/static/js/chunk-a60951ae.8bfe85bc.js

2 lines
16 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a60951ae"],{"021b":function(t,e,n){"use strict";n("058f")},"058f":function(t,e,n){},"0d80":function(t,e,n){"use strict";n("9455")},"129f":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},"18dc":function(t,e,n){"use strict";n("a15b");var s={name:"Utils",methods:{convertTime:function(t){t=parseFloat(t);var e={};e.h=""+parseInt(t/3600),e.m=""+parseInt(t/60-60*e.h),e.s=""+parseInt(t-(3600*e.h+60*e.m));for(var n=0,s=["m","s"];n<s.length;n++){var a=s[n];parseInt(e[a])<10&&(e[a]="0"+e[a])}var c=[];return parseInt(e.h)&&c.push(e.h),c.push(e.m,e.s),c.join(":")}}};e["a"]=s},"38cf":function(t,e,n){var s=n("23e7"),a=n("1148");s({target:"String",proto:!0},{repeat:a})},"42c0":function(t,e,n){"use strict";n("587e")},"524a":function(t,e,n){"use strict";var s=n("7a23"),a=Object(s["K"])("data-v-607f43da");Object(s["u"])("data-v-607f43da");var c={class:"col-1 icon"};Object(s["s"])();var o=a((function(t,e,n,a,o,i){return Object(s["r"])(),Object(s["e"])("div",{class:"row item",onClick:e[1]||(e[1]=function(){return i.clicked.apply(i,arguments)})},[Object(s["h"])("div",c,[n.iconClass?(Object(s["r"])(),Object(s["e"])("i",{key:0,class:n.iconClass},null,2)):Object(s["f"])("",!0)]),Object(s["h"])("div",{class:"col-11 text",textContent:Object(s["C"])(n.text)},null,8,["textContent"])])})),i={name:"DropdownItem",props:{iconClass:{type:String},text:{type:String},disabled:{type:Boolean,default:!1}},methods:{clicked:function(t){this.$parent.$emit("click",t),this.$parent.visible=!1}}};n("021b");i.render=o,i.__scopeId="data-v-607f43da";e["a"]=i},"587e":function(t,e,n){},7726:function(t,e,n){"use strict";var s=n("7a23"),a=Object(s["K"])("data-v-0e806206");Object(s["u"])("data-v-0e806206");var c={class:"media-container"},o={class:"view-container"},i={class:"controls-container"};Object(s["s"])();var l=a((function(t,e,n,a,l,u){var r=Object(s["z"])("Controls");return Object(s["r"])(),Object(s["e"])("div",c,[Object(s["h"])("div",o,[Object(s["y"])(t.$slots,"default")]),Object(s["h"])("div",i,[Object(s["h"])(r,{status:n.status,track:n.track,buttons:n.buttons,onPlay:e[1]||(e[1]=function(e){return t.$emit("play",e)}),onPause:e[2]||(e[2]=function(e){return t.$emit("pause",e)}),onStop:e[3]||(e[3]=function(e){return t.$emit("stop")}),onPrevious:e[4]||(e[4]=function(e){return t.$emit("previous")}),onNext:e[5]||(e[5]=function(e){return t.$emit("next")}),onSeek:e[6]||(e[6]=function(e){return t.$emit("seek",e)}),onSetVolume:e[7]||(e[7]=function(e){return t.$emit("set-volume",e)}),onConsume:e[8]||(e[8]=function(e){return t.$emit("consume",e)}),onRepeat:e[9]||(e[9]=function(e){return t.$emit("repeat",e)}),onRandom:e[10]||(e[10]=function(e){return t.$emit("random",e)}),onSearch:e[11]||(e[11]=function(e){return t.$emit("search",e)})},null,8,["status","track","buttons"])])])})),u=(n("38cf"),Object(s["K"])("data-v-2f44ef4a"));Object(s["u"])("data-v-2f44ef4a");var r={class:"row"},b=Object(s["h"])("div",{class:"col-3"},null,-1),d={class:"col-6"},p={class:"buttons"},f=Object(s["h"])("i",{class:"icon fa fa-step-backward"},null,-1),j=Object(s["h"])("i",{class:"icon fa fa-stop"},null,-1),O=Object(s["h"])("i",{class:"icon fa fa-step-forward"},null,-1),v=Object(s["h"])("div",{class:"col-3"},null,-1),m={class:"row"},h={class:"col-9 volume-container"},k={class:"col-1"},y=Object(s["h"])("i",{class:"icon fa fa-volume-up"},null,-1),C={class:"col-11 volume-slider"},g={class:"col-3 list-controls"},x=Object(s["h"])("i",{class:"icon fa fa-utensils"},null,-1),$=Object(s["h"])("i",{class:"icon fa fa-random"},null,-1),w=Object(s["h"])("i",{class:"icon fa fa-redo"},null,-1),S={class:"row"},_={class:"col-s-2 col-m-1 time"},T={class:"col-s-8 col-m-10"},I={class:"col-s-2 col-m-1 time"},P={class:"controls"},R={class:"playback-controls mobile tablet col-2"},H={key:0,class:"icon play-pause fa fa-pause"},J={key:1,class:"icon play-pause fa fa-play"},M={class:"track-container col-s-8 col-m-8 col-l-3"},E={key:0,class:"track-info"},F={class:"title"},K={key:0,class:"artist"},B={class:"playback-controls desktop col-6"},D={class:"row buttons"},z=Object(s["h"])("i",{class:"icon fa fa-step-backward"},null,-1),A={key:0,class:"icon play-pause fa fa-pause"},L={key:1,class:"icon play-pause fa fa-play"},N=Object(s["h"])("i",{class:"icon fa fa-stop"},null,-1),V=Object(s["h"])("i",{class:"icon fa fa-step-forward"},null,-1),W={class:"row"},q={class:"col-1 time"},U={class:"col-10"},G={class:"col-1 time"},Q={class:"col-2 pull-right mobile tablet right-buttons"},X={class:"col-3 pull-right desktop"},Y={class:"row list-controls"},Z=Object(s["h"])("i",{class:"icon fa fa-utensils"},null,-1),tt=Object(s["h"])("i",{class:"icon fa fa-random"},null,-1),et=Object(s["h"])("i",{class:"icon fa fa-redo"},null,-1),nt={class:"row volume-container"},st={class:"col-2"},at=Object(s["h"])("i",{class:"icon fa fa-volume-up"},null,-1),ct={class:"col-10"};Object(s["s"])();var ot=u((function(t,e,n,a,c,o){var i,l=Object(s["z"])("Slider");return Object(s["r"])(),Object(s["e"])(s["a"],null,[Object(s["h"])("div",{class:["extension fade-in",{hidden:!c.expanded}]},[Object(s["h"])("div",r,[b,Object(s["h"])("div",d,[Object(s["h"])("div",p,[c.buttons_.previous?(Object(s["r"])(),Object(s["e"])("button",{key:0,onClick:e[1]||(e[1]=function(e){return t.$emit("previous")}),title:"Play previous track"},[f])):Object(s["f"])("",!0),c.buttons_.stop&&"stop"!==n.status.state?(Object(s["r"])(),Object(s["e"])("button",{key:1,onClick:e[2]||(e[2]=function(e){return t.$emit("stop")}),title:"Stop playback"},[j])):Object(s["f"])("",!0),c.buttons_.next?(Object(s["r"])(),Object(s["e"])("button",{key:2,onClick:e[3]||(e[3]=function(e){return t.$emit("next")}),title:"Play next track"},[O])):Object(s["f"])("",!0)])]),v]),Object(s["h"])("div",m,[Object(s["h"])("div",h,[Object(s["h"])("div",k,[Object(s["h"])("button",{disabled:null==n.status.muted,onClick:e[4]||(e[4]=function(e){return t.$emit(n.status.muted?"unmute":"mute")})},[y],8,["disabled"])]),Object(s["h"])("div",C,[Object(s["h"])(l,{value:n.status.volume,range:n.volumeRange,disabled:null==n.status.volume,onMouseup:e[5]||(e[5]=function(e){return t.$emit("set-volume",e.target.value)})},null,8,["value","range","disabled"])])]),Object(s["h"])("div",g,[c.buttons_.consume?(Object(s["r"])(),Object(s["e"])("button",{key:0,onClick:e[6]||(e[6]=function(e){return t.$emit("consume",!n.status.consume)}),class:{enabled:n.status.consume},title:"Toggle consume mode"},[x],2)):Object(s["f"])("",!0),c.buttons_.random?(Object(s["r"])(),Object(s["e"])("button",{key:1,onClick:e[7]||(e[7]=function(e){return t.$emit("random",!n.status.random)}),class:{enabled:n.status.random},title:"Toggle shuffle"},[$],2)):Object(s["f"])("",!0),c.buttons_.repeat?(Object(s["r"])(),Object(s["e"])("button",{key:2,onClick:e[8]||(e[8]=function(e){return t.$emit("repeat",!n.status.repeat)}),class:{enabled:n.status.repeat},title:"Toggle repeat"},[w],2)):Object(s["f"])("",!0)])]),Object(s["h"])("div",S,[Object(s["h"])("div",_,[Object(s["h"])("span",{class:"elapsed-time",textContent:Object(s["C"])(null!=c.elapsed&&"stop"!==n.status.state?t.convertTime(c.elapsed):"-:--")},null,8,["textContent"])]),Object(s["h"])("div",T,[Object(s["h"])(l,{value:c.elapsed,range:[0,o.duration],disabled:!o.duration||"stop"===n.status.state,onMouseup:e[9]||(e[9]=function(e){return t.$emit("seek",e.target.value)})},null,8,["value","range","disabled"])]),Object(s["h"])("div",I,[Object(s["h"])("span",{class:"total-time",textContent:Object(s["C"])(o.duration&&"stop"!==n.status.state?t.convertTime(o.duration):"-:--")},null,8,["textContent"])])])],2),Object(s["h"])("div",P,[Object(s["h"])("div",R,[Object(s["h"])("button",{onClick:e[10]||(e[10]=function(e){return t.$emit("play"===n.status.state?"pause":"play")}),title:"play"===n.status.state?"Pause":"Play"},["play"===n.status.state?(Object(s["r"])(),Object(s["e"])("i",H)):(Object(s["r"])(),Object(s["e"])("i",J))],8,["title"])]),Object(s["h"])("div",M,[n.track&&"stop"!==(null===(i=n.status)||void 0===i?void 0:i.state)?(Object(s["r"])(),Object(s["e"])("div",E,[Object(s["h"])("div",F,[n.track.album?(Object(s["r"])(),Object(s["e"])("a",{key:0,href:t.$route.fullPath,textContent:Object(s["C"])(n.track.title),onClick:e[11]||(e[11]=Object(s["J"])((function(e){return t.$emit("search",{artist:n.track.artist,album:n.track.album})}),["prevent"]))},null,8,["href","textContent"])):n.track.url?(Object(s["r"])(),Object(s["e"])("a",{key:1,href:n.track.url,textContent:Object(s["C"])(n.track.title)},null,8,["href","textContent"])):(Object(s["r"])(),Object(s["e"])("span",{key:2,textContent:Object(s["C"])(n.track.title)},null,8,["textContent"]))]),n.track.artist?(Object(s["r"])(),Object(s["e"])("div",K,[Object(s["h"])("a",{href:t.$route.fullPath,textContent:Object(s["C"])(n.track.artist),onClick:e[12]||(e[12]=Object(s["J"])((function(e){return t.$emit("search",{artist:n.track.artist})}),["prevent"]))},null,8,["href","textContent"])])):Object(s["f"])("",!0)])):Object(s["f"])("",!0)]),Object(s["h"])("div",B,[Object(s["h"])("div",D,[c.buttons_.previous?(Object(s["r"])(),Object(s["e"])("button",{key:0,onClick:e[13]||(e[13]=function(e){return t.$emit("previous")}),title:"Play previous track"},[z])):Object(s["f"])("",!0),Object(s["h"])("button",{onClick:e[14]||(e[14]=function(e){return t.$emit("play"===n.status.state?"pause":"play")}),title:"play"===n.status.state?"Pause":"Play"},["play"===n.status.state?(Object(s["r"])(),Object(s["e"])("i",A)):(Object(s["r"])(),Object(s["e"])("i",L))],8,["title"]),c.buttons_.stop&&"stop"!==n.status.state?(Object(s["r"])(),Object(s["e"])("button",{key:1,onClick:e[15]||(e[15]=function(e){return t.$emit("stop")}),title:"Stop playback"},[N])):Object(s["f"])("",!0),c.buttons_.next?(Object(s["r"])(),Object(s["e"])("button",{key:2,onClick:e[16]||(e[16]=function(e){return t.$emit("next")}),title:"Play next track"},[V])):Object(s["f"])("",!0)]),Object(s["h"])("div",W,[Object(s["h"])("div",q,[Object(s["h"])("span",{class:"elapsed-time",textContent:Object(s["C"])(null!=c.elapsed&&"stop"!==n.status.state?t.convertTime(c.elapsed):"-:--")},null,8,["textContent"])]),Object(s["h"])("div",U,[Object(s["h"])(l,{value:c.elapsed,range:[0,o.duration],disabled:!o.duration||"stop"===n.status.state,onMouseup:e[17]||(e[17]=function(e){return t.$emit("seek",e.target.value)})},null,8,["value","range","disabled"])]),Object(s["h"])("div",G,[Object(s["h"])("span",{class:"total-time",textContent:Object(s["C"])(o.duration&&"stop"!==n.status.state?t.convertTime(o.duration):"-:--")},null,8,["textContent"])])])]),Object(s["h"])("div",Q,[Object(s["h"])("button",{onClick:e[18]||(e[18]=function(t){return c.expanded=!c.expanded}),title:c.expanded?"Show more controls":"Hide extra controls"},[Object(s["h"])("i",{class:["fas",["fa-chevron-".concat(c.expanded?"down":"up")]]},null,2)],8,["title"])]),Object(s["h"])("div",X,[Object(s["h"])("div",Y,[c.buttons_.consume?(Object(s["r"])(),Object(s["e"])("button",{key:0,onClick:e[19]||(e[19]=function(e){return t.$emit("consume")}),class:{enabled:n.status.consume},title:"Toggle consume mode"},[Z],2)):Object(s["f"])("",!0),c.buttons_.random?(Object(s["r"])(),Object(s["e"])("button",{key:1,onClick:e[20]||(e[20]=function(e){return t.$emit("random")}),class:{enabled:n.status.random},title:"Toggle shuffle"},[tt],2)):Object(s["f"])("",!0),c.buttons_.repeat?(Object(s["r"])(),Object(s["e"])("button",{key:2,onClick:e[21]||(e[21]=function(e){return t.$emit("repeat")}),class:{enabled:n.status.repeat},title:"Toggle repeat"},[et],2)):Object(s["f"])("",!0)]),Object(s["h"])("div",nt,[Object(s["h"])("div",st,[Object(s["h"])("button",{disabled:null==n.status.muted,onClick:e[22]||(e[22]=function(e){return t.$emit(n.status.muted?"unmute":"mute")})},[at],8,["disabled"])]),Object(s["h"])("div",ct,[Object(s["h"])(l,{value:n.status.volume,range:n.volumeRange,disabled:null==n.status.volume,onMouseup:e[23]||(e[23]=function(e){return t.$emit("set-volume",e.target.value)})},null,8,["value","range","disabled"])])])])])],64)})),it=(n("b64b"),n("3e54")),lt=n("18dc"),ut=n("8285"),rt={name:"Controls",components:{Slider:ut["a"]},mixins:[it["a"],lt["a"]],emits:["search","previous","next","play","pause","stop","seek","consume","random","repeat","set-volume","mute","unmute"],props:{track:{type:Object},status:{type:Object,default:function(){}},buttons:{type:Object,default:function(){return{previous:!0,next:!0,stop:!0,consume:!0,random:!0,repeat:!0}}},volumeRange:{type:Array,default:function(){return[0,100]}}},data:function(){var t,e,n,s=(null===(t=Object.keys(this.buttons))||void 0===t?void 0:t.length)?this.buttons:{previous:!0,next:!0,stop:!0,consume:!0,random:!0,repeat:!0};return{expanded:!1,lastSync:0,elapsed:(null===(e=this.status)||void 0===e?void 0:e.elapsed)||(null===(n=this.status)||void 0===n?void 0:n.position),buttons_:s}},computed:{duration:function(){var t,e;return null!=(null===(t=this.status)||void 0===t?void 0:t.duration)?this.status.duration:null===(e=this.track)||void 0===e?void 0:e.duration}},methods:{getTime:function(){return(new Date).getTime()/1e3}},mounted:function(){var t=this,e=this;this.lastSync=this.getTime(),this.$watch((function(){return t.track}),(function(n){var s;n&&"play"===(null===(s=e.status)||void 0===s?void 0:s.state)||(e.lastSync=t.getTime())})),this.$watch((function(){return t.status}),(function(){e.lastSync=t.getTime()})),setInterval((function(){var n,s,a,c;"stop"!==(null===(n=e.status)||void 0===n?void 0:n.state)&&(e.elapsed=(null===(s=e.status)||void 0===s?void 0:s.elapsed)||(null===(a=e.status)||void 0===a?void 0:a.position)||0,"play"===(null===(c=e.status)||void 0===c?void 0:c.state)&&(e.elapsed+=Math.round(t.getTime()-e.lastSync)))}),1e3)}};n("0d80");rt.render=ot,rt.__scopeId="data-v-2f44ef4a";var bt=rt,dt={name:"View",components:{Controls:bt},emits:["play","pause","stop","next","previous","set-volume","seek","consume","random","repeat","search"],props:{pluginName:{type:String,required:!0},status:{type:Object,default:function(){}},track:{type:Object},buttons:{type:Object}}};n("42c0");dt.render=l,dt.__scopeId="data-v-0e806206";e["a"]=dt},"841c":function(t,e,n){"use strict";var s=n("d784"),a=n("825a"),c=n("1d80"),o=n("129f"),i=n("14c3");s("search",1,(function(t,e,n){return[function(e){var n=c(this),s=void 0==e?void 0:e[t];return void 0!==s?s.call(e,n):new RegExp(e)[t](String(n))},function(t){var s=n(e,t,this);if(s.done)return s.value;var c=a(t),l=String(this),u=c.lastIndex;o(u,0)||(c.lastIndex=0);var r=i(c,l);return o(c.lastIndex,u)||(c.lastIndex=u),null===r?-1:r.index}]}))},9455:function(t,e,n){},ab0f:function(t,e,n){"use strict";var s=n("7a23"),a=Object(s["K"])("data-v-27489f72");Object(s["u"])("data-v-27489f72");var c={class:"dropdown-container",ref:"container"};Object(s["s"])();var o=a((function(t,e,n,a,o,i){return Object(s["r"])(),Object(s["e"])("div",c,[Object(s["h"])("button",{title:n.title,ref:"button",onClick:e[1]||(e[1]=Object(s["J"])((function(t){return i.toggle(t)}),["stop"]))},[n.iconClass?(Object(s["r"])(),Object(s["e"])("i",{key:0,class:["icon",n.iconClass]},null,2)):Object(s["f"])("",!0),n.text?(Object(s["r"])(),Object(s["e"])("span",{key:1,class:"text",textContent:Object(s["C"])(n.text)},null,8,["textContent"])):Object(s["f"])("",!0)],8,["title"]),Object(s["h"])("div",{class:["dropdown fade-in",{hidden:!o.visible}],id:n.id,ref:"dropdown"},[Object(s["y"])(t.$slots,"default")],10,["id"])],512)})),i={name:"Dropdown",emits:["click"],props:{id:{type:String},items:{type:Array,default:function(){return[]}},iconClass:{type:String},text:{type:String},title:{type:String}},data:function(){return{visible:!1}},methods:{documentClickHndl:function(t){if(this.visible){var e=t.target;while(e){if(e===this.$refs.dropdown.element)return;e=e.parentElement}this.close()}},close:function(){this.visible=!1,document.removeEventListener("click",this.documentClickHndl)},open:function(){var t=this;document.addEventListener("click",this.documentClickHndl),this.visible=!0,setTimeout((function(){var e=t.$refs.dropdown;e.style.left=0,e.style.top=parseFloat(getComputedStyle(t.$refs.button).height)+"px",e.getBoundingClientRect().left>window.innerWidth/2&&(e.style.left=-e.clientWidth+parseFloat(getComputedStyle(t.$refs.button).width)+"px"),e.getBoundingClientRect().top>window.innerHeight/2&&(e.style.top=-e.clientHeight+parseFloat(getComputedStyle(t.$refs.button).height)+"px")}),10)},toggle:function(t){t.stopPropagation(),this.$emit("click"),this.visible?this.close():this.open()}}};n("e373");i.render=o,i.__scopeId="data-v-27489f72";e["a"]=i},d9b8:function(t,e,n){},e373:function(t,e,n){"use strict";n("d9b8")}}]);
//# sourceMappingURL=chunk-a60951ae.8bfe85bc.js.map