platypush/platypush/backend/http/webapp/dist/static/js/chunk-45557166.38c65779.js

2 lines
37 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-45557166"],{"0e52":function(e,t,n){"use strict";n("4b87")},3193:function(e,t,n){"use strict";n("dd9c")},"467d":function(e,t,n){},"48b6":function(e,t,n){"use strict";n("8eae")},"498a":function(e,t,n){"use strict";var s=n("23e7"),o=n("58a8").trim,c=n("c8d2");s({target:"String",proto:!0,forced:c("trim")},{trim:function(){return o(this)}})},"4b87":function(e,t,n){},6062:function(e,t,n){"use strict";var s=n("6d61"),o=n("6566");e.exports=s("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),o)},6566:function(e,t,n){"use strict";var s=n("9bf2").f,o=n("7c73"),c=n("e2cc"),r=n("0366"),l=n("19aa"),i=n("2266"),a=n("7dd0"),u=n("2626"),d=n("83ab"),v=n("f183").fastKey,h=n("69f3"),b=h.set,p=h.getterFor;e.exports={getConstructor:function(e,t,n,a){var u=e((function(e,s){l(e,u,t),b(e,{type:t,index:o(null),first:void 0,last:void 0,size:0}),d||(e.size=0),void 0!=s&&i(s,e[a],{that:e,AS_ENTRIES:n})})),h=p(t),m=function(e,t,n){var s,o,c=h(e),r=f(e,t);return r?r.value=n:(c.last=r={index:o=v(t,!0),key:t,value:n,previous:s=c.last,next:void 0,removed:!1},c.first||(c.first=r),s&&(s.next=r),d?c.size++:e.size++,"F"!==o&&(c.index[o]=r)),e},f=function(e,t){var n,s=h(e),o=v(t);if("F"!==o)return s.index[o];for(n=s.first;n;n=n.next)if(n.key==t)return n};return c(u.prototype,{clear:function(){var e=this,t=h(e),n=t.index,s=t.first;while(s)s.removed=!0,s.previous&&(s.previous=s.previous.next=void 0),delete n[s.index],s=s.next;t.first=t.last=void 0,d?t.size=0:e.size=0},delete:function(e){var t=this,n=h(t),s=f(t,e);if(s){var o=s.next,c=s.previous;delete n.index[s.index],s.removed=!0,c&&(c.next=o),o&&(o.previous=c),n.first==s&&(n.first=o),n.last==s&&(n.last=c),d?n.size--:t.size--}return!!s},forEach:function(e){var t,n=h(this),s=r(e,arguments.length>1?arguments[1]:void 0,3);while(t=t?t.next:n.first){s(t.value,t.key,this);while(t&&t.removed)t=t.previous}},has:function(e){return!!f(this,e)}}),c(u.prototype,n?{get:function(e){var t=f(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),d&&s(u.prototype,"size",{get:function(){return h(this).size}}),u},setStrong:function(e,t,n){var s=t+" Iterator",o=p(t),c=p(s);a(e,t,(function(e,t){b(this,{type:s,target:e,state:o(e),kind:t,last:void 0})}),(function(){var e=c(this),t=e.kind,n=e.last;while(n&&n.removed)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),u(t)}}},"6d61":function(e,t,n){"use strict";var s=n("23e7"),o=n("da84"),c=n("94ca"),r=n("6eeb"),l=n("f183"),i=n("2266"),a=n("19aa"),u=n("861d"),d=n("d039"),v=n("1c7e"),h=n("d44e"),b=n("7156");e.exports=function(e,t,n){var p=-1!==e.indexOf("Map"),m=-1!==e.indexOf("Weak"),f=p?"set":"add",O=o[e],j=O&&O.prototype,g=O,C={},x=function(e){var t=j[e];r(j,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(m&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!u(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!u(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(c(e,"function"!=typeof O||!(m||j.forEach&&!d((function(){(new O).entries().next()})))))g=n.getConstructor(t,e,p,f),l.REQUIRED=!0;else if(c(e,!0)){var w=new g,y=w[f](m?{}:-0,1)!=w,k=d((function(){w.has(1)})),S=v((function(e){new O(e)})),H=!m&&d((function(){var e=new O,t=5;while(t--)e[f](t,t);return!e.has(-0)}));S||(g=t((function(t,n){a(t,g,e);var s=b(new O,t,g);return void 0!=n&&i(n,s[f],{that:s,AS_ENTRIES:p}),s})),g.prototype=j,j.constructor=g),(k||H)&&(x("delete"),x("has"),p&&x("get")),(H||y)&&x(f),m&&j.clear&&delete j.clear}return C[e]=g,s({global:!0,forced:g!=O},C),h(g,e),m||n.setStrong(g,e,p),g}},"6fdc":function(e,t,n){"use strict";n("cd20")},"875e":function(e,t,n){"use strict";n("f22d")},"8eae":function(e,t,n){},bb2f:function(e,t,n){var s=n("d039");e.exports=!s((function(){return Object.isExtensible(Object.preventExtensions({}))}))},c8d2:function(e,t,n){var s=n("d039"),o=n("5899"),c="…";e.exports=function(e){return s((function(){return!!o[e]()||c[e]()!=c||o[e].name!==e}))}},cd20:function(e,t,n){},d5eb:function(e,t,n){"use strict";n.r(t);var s=n("7a23"),o=Object(s["K"])("data-v-063a7b86");Object(s["u"])("data-v-063a7b86");var c={class:"music-snapcast-container"},r={class:"info"},l={class:"info"},i={class:"info"};Object(s["s"])();var a=o((function(e,t,n,a,u,d){var v=Object(s["z"])("Loading"),h=Object(s["z"])("ModalHost"),b=Object(s["z"])("Modal"),p=Object(s["z"])("ModalGroup"),m=Object(s["z"])("ModalClient"),f=Object(s["z"])("Host");return Object(s["r"])(),Object(s["e"])("div",c,[e.loading?(Object(s["r"])(),Object(s["e"])(v,{key:0})):Object(s["f"])("",!0),Object(s["h"])("div",r,[Object(s["h"])(b,{title:"Server info",ref:"modalHost"},{default:o((function(){return[e.selectedHost?(Object(s["r"])(),Object(s["e"])(h,{key:0,info:e.hosts[e.selectedHost]},null,8,["info"])):Object(s["f"])("",!0)]})),_:1},512)]),Object(s["h"])("div",l,[Object(s["h"])(b,{title:"Group info",ref:"modalGroup"},{default:o((function(){return[e.selectedGroup?(Object(s["r"])(),Object(s["e"])(p,{key:0,group:e.hosts[e.selectedHost].groups[e.selectedGroup],streams:e.hosts[e.selectedHost].streams,clients:d.clientsByHost[e.selectedHost],loading:e.loading,onAddClient:d.addClientToGroup,onRemoveClient:d.removeClientFromGroup,onStreamChange:d.streamChange,onRenameGroup:t[1]||(t[1]=function(e){return d.renameGroup(e)})},null,8,["group","streams","clients","loading","onAddClient","onRemoveClient","onStreamChange"])):Object(s["f"])("",!0)]})),_:1},512)]),Object(s["h"])("div",i,[Object(s["h"])(b,{title:"Client info",ref:"modalClient"},{default:o((function(){return[e.selectedClient?(Object(s["r"])(),Object(s["e"])(m,{key:0,client:e.hosts[e.selectedHost].groups[e.selectedGroup].clients[e.selectedClient],loading:e.loading,onRemoveClient:d.removeClient,onRenameClient:t[2]||(t[2]=function(e){return d.renameClient(e)})},null,8,["client","loading","onRemoveClient"])):Object(s["f"])("",!0)]})),_:1},512)]),(Object(s["r"])(!0),Object(s["e"])(s["a"],null,Object(s["x"])(e.hosts,(function(e,n){return Object(s["r"])(),Object(s["e"])(f,{key:n,server:e.server,streams:e.streams,groups:e.groups,onGroupMuteToggle:t[3]||(t[3]=function(e){return d.groupMute(e)}),onClientMuteToggle:t[4]||(t[4]=function(e){return d.clientMute(e)}),onClientVolumeChange:t[5]||(t[5]=function(e){return d.clientSetVolume(e)}),onModalShow:t[6]||(t[6]=function(e){return d.onModalShow(e)})},null,8,["server","streams","groups"])})),128))])})),u=(n("99af"),n("4160"),n("d81d"),n("13d5"),n("b0c0"),n("4fad"),n("b64b"),n("d3b7"),n("07ac"),n("6062"),n("3ca3"),n("159b"),n("ddb0"),n("2909")),d=(n("96cf"),n("1da1")),v=n("5530"),h=n("3835"),b=n("714b"),p=n("3e54"),m=Object(s["K"])("data-v-7bce419a");Object(s["u"])("data-v-7bce419a");var f={class:"host"},O={class:"header"},j=Object(s["h"])("i",{class:"icon fa fa-server"},null,-1),g={class:"col-2 buttons pull-right"},C={key:0,class:"group-container"};Object(s["s"])();var x=m((function(e,t,n,o,c,r){var l=Object(s["z"])("Group");return Object(s["r"])(),Object(s["e"])("div",f,[Object(s["h"])("div",O,[Object(s["h"])("div",{class:"col-10 name",onClick:t[1]||(t[1]=function(t){return e.$emit("modal-show",{type:"host",host:n.server.host.name})})},[j,Object(s["g"])(" "+Object(s["C"])(n.server.host.name),1)]),Object(s["h"])("div",g,[Object(s["h"])("button",{type:"button",onClick:t[2]||(t[2]=function(e){return c.collapsed=!c.collapsed})},[Object(s["h"])("i",{class:["icon fa",{"fa-chevron-up":!c.collapsed,"fa-chevron-down":c.collapsed}]},null,2)])])]),c.collapsed?Object(s["f"])("",!0):(Object(s["r"])(),Object(s["e"])("div",C,[(Object(s["r"])(!0),Object(s["e"])(s["a"],null,Object(s["x"])(n.groups,(function(o,c){return Object(s["r"])(),Object(s["e"])(l,{key:c,id:o.id,name:o.name,server:n.server.host,muted:o.muted,clients:o.clients,stream:n.streams[o.stream_id],onModalShow:t[3]||(t[3]=function(t){return e.$emit("modal-show",t)}),onGroupMuteToggle:t[4]||(t[4]=function(t){return e.$emit("group-mute-toggle",t)}),onClientMuteToggle:t[5]||(t[5]=function(t){return e.$emit("client-mute-toggle",t)}),onClientVolumeChange:t[6]||(t[6]=function(t){return e.$emit("client-volume-change",t)})},null,8,["id","name","server","muted","clients","stream"])})),128))]))])})),w=Object(s["K"])("data-v-748fccb4");Object(s["u"])("data-v-748fccb4");var y={class:"group"},k={class:"head"},S={class:"col-2 switch pull-right"},H={class:"body"};Object(s["s"])();var _=w((function(e,t,n,o,c,r){var l=Object(s["z"])("ToggleSwitch"),i=Object(s["z"])("Client");return Object(s["r"])(),Object(s["e"])("div",y,[Object(s["h"])("div",k,[Object(s["h"])("div",{class:"col-10 name",onClick:t[1]||(t[1]=function(t){return e.$emit("modal-show",{type:"group",group:n.id,host:n.server.name})})},[Object(s["h"])("i",{class:["icon fa",{"fa-play":"playing"===n.stream.status,"fa-stop":"playing"!==n.stream.status}]},null,2),Object(s["g"])(" "+Object(s["C"])(n.name||n.stream.id||n.id),1)]),Object(s["h"])("div",S,[Object(s["h"])(l,{value:!n.muted,onInput:t[2]||(t[2]=function(t){return e.$emit("group-mute-toggle",{host:n.server.name,group:n.id,muted:!n.muted})})},null,8,["value"])])]),Object(s["h"])("div",H,[(Object(s["r"])(!0),Object(s["e"])(s["a"],null,Object(s["x"])(n.clients,(function(o){return Object(s["r"])(),Object(s["e"])(i,{key:o.id,config:o.config,connected:o.connected,server:n.server,host:o.host,groupId:n.id,id:o.id,lastSeen:o.lastSeen,snapclient:o.snapclient,onModalShow:t[3]||(t[3]=function(t){return e.$emit("modal-show",t)}),onVolumeChange:t[4]||(t[4]=function(t){return e.$emit("client-volume-change",t)}),onMuteToggle:t[5]||(t[5]=function(t){return e.$emit("client-mute-toggle",t)})},null,8,["config","connected","server","host","groupId","id","lastSeen","snapclient"])})),128))])])})),R=n("0279"),G=Object(s["K"])("data-v-12b0e65b");Object(s["u"])("data-v-12b0e65b");var M={class:"col-s-12 col-m-9 controls"},E={class:"col-10 slider-container"},I={class:"col-2 switch pull-right"};Object(s["s"])();var z=G((function(e,t,n,o,c,r){var l,i=Object(s["z"])("Slider"),a=Object(s["z"])("ToggleSwitch");return Object(s["r"])(),Object(s["e"])("div",{class:["row client",{offline:!n.connected}]},[Object(s["h"])("div",{class:"col-s-12 col-m-3 name",textContent:Object(s["C"])((null===(l=n.config.name)||void 0===l?void 0:l.length)?n.config.name:n.host.name),onClick:t[1]||(t[1]=function(t){return e.$emit("modal-show",{type:"client",client:n.id,group:n.groupId,host:n.server.name})})},null,8,["textContent"]),Object(s["h"])("div",M,[Object(s["h"])("div",E,[Object(s["h"])(i,{range:[0,100],value:n.config.volume.percent,onMouseup:t[2]||(t[2]=function(t){return e.$emit("volume-change",{host:n.server.name,client:n.id,volume:t.target.value})})},null,8,["value"])]),Object(s["h"])("div",I,[Object(s["h"])(a,{value:!n.config.volume.muted,onInput:t[3]||(t[3]=function(t){return e.$emit("mute-toggle",{host:n.server.name,client:n.id,muted:!n.config.volume.muted})})},null,8,["value"])])])],2)})),$=n("8285"),q={name:"Client",components:{Slider:$["a"],ToggleSwitch:R["a"]},emits:["volume-change","mute-toggle","modal-show"],props:{config:{type:Object,required:!0},connected:{type:Boolean,default:!1},host:{type:Object,required:!0},id:{type:String,required:!0},groupId:{type:String,required:!0},lastSeen:{type:Object,default:function(){}},snapclient:{type:Object,required:!0},server:{type:Object,required:!0}}};n("6fdc");q.render=z,q.__scopeId="data-v-12b0e65b";var V=q,A={name:"Group",components:{Client:V,ToggleSwitch:R["a"]},emits:["group-mute-toggle","modal-show","client-volume-change","client-mute-toggle"],props:{id:{type:String},clients:{type:Object,default:function(){}},muted:{type:Boolean},name:{type:String},stream:{type:Object},server:{type:Object}}};n("d623");A.render=_,A.__scopeId="data-v-748fccb4";var T=A,U={name:"Host",emits:["modal-show","group-mute-toggle","client-mute-toggle","client-volume-change"],components:{Group:T},props:{groups:{type:Object,default:function(){}},server:{type:Object,default:function(){}},streams:{type:Object,default:function(){}}},data:function(){return{collapsed:!1}}};n("875e");U.render=x,U.__scopeId="data-v-7bce419a";var D=U,P=Object(s["K"])("data-v-4b0dc9f8");Object(s["u"])("data-v-4b0dc9f8");var K={class:"info"},B={key:0,class:"row"},N=Object(s["h"])("div",{class:"label col-3"},"IP Address",-1),F={key:1,class:"row"},L=Object(s["h"])("div",{class:"label col-3"},"MAC Address",-1),Q={key:2,class:"row"},J=Object(s["h"])("div",{class:"label col-3"},"Name",-1),W={key:3,class:"row"},X=Object(s["h"])("div",{class:"label col-3"},"Port",-1),Y={key:4,class:"row"},Z=Object(s["h"])("div",{class:"label col-3"},"OS",-1),ee={key:5,class:"row"},te=Object(s["h"])("div",{class:"label col-3"},"Architecture",-1),ne={key:6,class:"row"},se=Object(s["h"])("div",{class:"label col-3"},"Server name",-1),oe={key:7,class:"row"},ce=Object(s["h"])("div",{class:"label col-3"},"Server version",-1),re={key:8,class:"row"},le=Object(s["h"])("div",{class:"label col-3"},"Protocol version",-1),ie={key:9,class:"row"},ae=Object(s["h"])("div",{class:"label col-3"},"Control protocol version",-1);Object(s["s"])();var ue=P((function(e,t,n,o,c,r){var l,i,a,u,d,v,h,b,p,m,f,O,j,g,C,x,w,y,k,S,H,_,R,G,M,E,I,z,$,q,V,A,T,U,D,P,ue;return Object(s["r"])(),Object(s["e"])("div",K,[(null===(l=n.info)||void 0===l||null===(i=l.server)||void 0===i||null===(a=i.host)||void 0===a||null===(u=a.ip)||void 0===u?void 0:u.length)?(Object(s["r"])(),Object(s["e"])("div",B,[N,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.host.ip)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(d=n.info)||void 0===d||null===(v=d.server)||void 0===v||null===(h=v.host)||void 0===h||null===(b=h.mac)||void 0===b?void 0:b.length)?(Object(s["r"])(),Object(s["e"])("div",F,[L,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.host.mac)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(p=n.info)||void 0===p||null===(m=p.server)||void 0===m||null===(f=m.host)||void 0===f||null===(O=f.name)||void 0===O?void 0:O.length)?(Object(s["r"])(),Object(s["e"])("div",Q,[J,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.host.name)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(j=n.info)||void 0===j||null===(g=j.server)||void 0===g||null===(C=g.host)||void 0===C?void 0:C.port)?(Object(s["r"])(),Object(s["e"])("div",W,[X,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.host.port)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(x=n.info)||void 0===x||null===(w=x.server)||void 0===w||null===(y=w.host)||void 0===y||null===(k=y.os)||void 0===k?void 0:k.length)?(Object(s["r"])(),Object(s["e"])("div",Y,[Z,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.host.os)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(S=n.info)||void 0===S||null===(H=S.server)||void 0===H||null===(_=H.host)||void 0===_||null===(R=_.arch)||void 0===R?void 0:R.length)?(Object(s["r"])(),Object(s["e"])("div",ee,[te,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.host.arch)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(G=n.info)||void 0===G||null===(M=G.server)||void 0===M||null===(E=M.snapserver)||void 0===E||null===(I=E.name)||void 0===I?void 0:I.length)?(Object(s["r"])(),Object(s["e"])("div",ne,[se,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.snapserver.name)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(z=n.info)||void 0===z||null===($=z.server)||void 0===$||null===(q=$.snapserver)||void 0===q||null===(V=q.version)||void 0===V?void 0:V.length)?(Object(s["r"])(),Object(s["e"])("div",oe,[ce,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.snapserver.version)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(A=n.info)||void 0===A||null===(T=A.server)||void 0===T||null===(U=T.snapserver)||void 0===U?void 0:U.protocolVersion)?(Object(s["r"])(),Object(s["e"])("div",re,[le,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.snapserver.protocolVersion)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(D=n.info)||void 0===D||null===(P=D.server)||void 0===P||null===(ue=P.snapserver)||void 0===ue?void 0:ue.controlProtocolVersion)?(Object(s["r"])(),Object(s["e"])("div",ie,[ae,Object(s["h"])("div",{class:"value col-9",textContent:Object(s["C"])(n.info.server.snapserver.controlProtocolVersion)},null,8,["textContent"])])):Object(s["f"])("",!0)])})),de={name:"HostModal",props:{info:{type:Object,default:function(){}}}};de.render=ue,de.__scopeId="data-v-4b0dc9f8";var ve=de,he=Object(s["K"])("data-v-353ffa58");Object(s["u"])("data-v-353ffa58");var be={class:"info"},pe={class:"section name"},me=Object(s["h"])("div",{class:"title"},"Name",-1),fe={class:"row"},Oe={class:"name-value"},je=Object(s["h"])("i",{class:"fa fa-edit"},null,-1),ge={key:0,class:"section clients"},Ce=Object(s["h"])("div",{class:"title"},"Clients",-1),xe={key:1,class:"section streams"},we=Object(s["h"])("div",{class:"title"},"Stream",-1),ye={class:"row"},ke=Object(s["h"])("div",{class:"label col-3"},"ID",-1),Se={class:"value col-9"},He={key:0,class:"row"},_e=Object(s["h"])("div",{class:"label col-m-3"},"Status",-1),Re={key:1,class:"row"},Ge=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Host",-1),Me={key:2,class:"row"},Ee=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Path",-1),Ie={key:3,class:"row"},ze=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"URI",-1);Object(s["s"])();var $e=he((function(e,t,n,o,c,r){var l,i,a,u,d,v,h,b,p,m,f,O,j,g,C,x,w;return Object(s["r"])(),Object(s["e"])("div",be,[Object(s["h"])("div",pe,[me,Object(s["h"])("div",fe,[Object(s["h"])("div",Oe,[Object(s["h"])("span",{class:"name",textContent:Object(s["C"])((null===(l=n.group.name)||void 0===l?void 0:l.length)?n.group.name:"default")},null,8,["textContent"]),Object(s["h"])("button",{class:"pull-right",title:"Rename",onClick:t[1]||(t[1]=function(){return r.renameGroup.apply(r,arguments)})},[je])])])]),Object.keys((null===(i=n.group)||void 0===i?void 0:i.clients)||{}).length>0?(Object(s["r"])(),Object(s["e"])("div",ge,[Ce,(Object(s["r"])(!0),Object(s["e"])(s["a"],null,Object(s["x"])(n.clients||{},(function(t,o){return Object(s["r"])(),Object(s["e"])("div",{class:"row",ref:"groupClients",key:o},[Object(s["h"])("label",{class:"client",for:"snapcast-client-"+t.id},[Object(s["h"])("input",{type:"checkbox",class:"client",id:"snapcast-client-".concat(t.id),value:t.id,checked:t.id in n.group.clients,disabled:n.loading,onInput:function(n){return e.$emit(n.target.checked?"add-client":"remove-client",t.id)}},null,40,["id","value","checked","disabled","onInput"]),Object(s["g"])(" "+Object(s["C"])(t.host.name),1)],8,["for"])],512)})),128))])):Object(s["f"])("",!0),(null===(a=n.group)||void 0===a?void 0:a.stream_id)?(Object(s["r"])(),Object(s["e"])("div",xe,[we,Object(s["h"])("div",ye,[ke,Object(s["h"])("div",Se,[Object(s["h"])("label",null,[Object(s["h"])("select",{ref:"streamSelect",onChange:t[2]||(t[2]=function(t){return e.$emit("stream-change",t.target.value)})},[(Object(s["r"])(!0),Object(s["e"])(s["a"],null,Object(s["x"])(n.streams,(function(e,t){return Object(s["r"])(),Object(s["e"])("option",{key:t,textContent:Object(s["C"])(n.streams[n.group.stream_id].id),name:e.id,value:e.id,disabled:n.loading,selected:e.id===n.group.stream_id},null,8,["textContent","name","value","disabled","selected"])})),128))],544)])])]),(null===(u=n.streams)||void 0===u||null===(d=u[n.group.stream_id])||void 0===d?void 0:d.status)?(Object(s["r"])(),Object(s["e"])("div",He,[_e,Object(s["h"])("div",{class:"value col-m-9",textContent:Object(s["C"])(n.streams[n.group.stream_id].status)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(v=n.streams)||void 0===v||null===(h=v[null===(p=n.group)||void 0===p?void 0:p.stream_id])||void 0===h||null===(b=h.uri)||void 0===b?void 0:b.host)?(Object(s["r"])(),Object(s["e"])("div",Re,[Ge,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.streams[n.group.stream_id].uri.host)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(m=n.streams)||void 0===m||null===(f=m[null===(j=n.group)||void 0===j?void 0:j.stream_id])||void 0===f||null===(O=f.uri)||void 0===O?void 0:O.path)?(Object(s["r"])(),Object(s["e"])("div",Me,[Ee,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.streams[n.group.stream_id].uri.path)},null,8,["textContent"])])):Object(s["f"])("",!0),(null===(g=n.streams)||void 0===g||null===(C=g[null===(w=n.group)||void 0===w?void 0:w.stream_id])||void 0===C||null===(x=C.uri)||void 0===x?void 0:x.raw)?(Object(s["r"])(),Object(s["e"])("div",Ie,[ze,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.streams[n.group.stream_id].uri.raw)},null,8,["textContent"])])):Object(s["f"])("",!0)])):Object(s["f"])("",!0)])})),qe=(n("498a"),{name:"GroupModal",emits:["add-client","remove-client","stream-change","rename-group"],props:{loading:{type:Boolean,default:!1},group:{type:Object},clients:{type:Object},streams:{type:Object}},methods:{renameGroup:function(){var e=(prompt("New group name",this.group.name)||"").trim();(null===e||void 0===e?void 0:e.length)&&this.$emit("rename-group",e)}}});n("3193");qe.render=$e,qe.__scopeId="data-v-353ffa58";var Ve=qe,Ae=Object(s["K"])("data-v-0e55ac54");Object(s["u"])("data-v-0e55ac54");var Te={class:"client-modal"},Ue={key:0,class:"info"},De={class:"row"},Pe=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"ID",-1),Ke={key:0,class:"row"},Be=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Name",-1),Ne={class:"value col-s-12 col-m-9"},Fe=Object(s["h"])("i",{class:"fa fa-edit"},null,-1),Le={class:"row"},Qe=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Connected",-1),Je={class:"row"},We=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Volume",-1),Xe={class:"value col-s-12 col-m-9"},Ye={class:"row"},Ze=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Muted",-1),et={class:"row"},tt=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Latency",-1),nt={key:1,class:"row"},st=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"IP Address",-1),ot={key:2,class:"row"},ct=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"MAC Address",-1),rt={key:3,class:"row"},lt=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"OS",-1),it={key:4,class:"row"},at=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Architecture",-1),ut={class:"row"},dt=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Client name",-1),vt={class:"row"},ht=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Client version",-1),bt={class:"row"},pt=Object(s["h"])("div",{class:"label col-s-12 col-m-3"},"Protocol version",-1),mt={class:"buttons"},ft={class:"row"},Ot=Object(s["h"])("i",{class:"fas fa-trash"},null,-1),jt=Object(s["h"])("span",{class:"name"},"Remove client",-1);Object(s["s"])();var gt=Ae((function(e,t,n,o,c,r){var l,i,a,u,d;return Object(s["r"])(),Object(s["e"])("div",Te,[n.client?(Object(s["r"])(),Object(s["e"])("div",Ue,[Object(s["h"])("div",De,[Pe,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.id)},null,8,["textContent"])]),(null===(l=n.client.config)||void 0===l||null===(i=l.name)||void 0===i?void 0:i.length)||(null===(a=n.client.host)||void 0===a?void 0:a.name)?(Object(s["r"])(),Object(s["e"])("div",Ke,[Be,Object(s["h"])("div",Ne,[Object(s["h"])("span",{class:"name",textContent:Object(s["C"])((null===(u=n.client.config)||void 0===u?void 0:u.name)||(null===(d=n.client.host)||void 0===d?void 0:d.name))},null,8,["textContent"]),Object(s["h"])("button",{title:"Rename",onClick:t[1]||(t[1]=function(){return r.renameClient.apply(r,arguments)})},[Fe])])])):Object(s["f"])("",!0),Object(s["h"])("div",Le,[Qe,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.connected)},null,8,["textContent"])]),Object(s["h"])("div",Je,[We,Object(s["h"])("div",Xe,Object(s["C"])(n.client.config.volume.percent)+"%",1)]),Object(s["h"])("div",Ye,[Ze,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.config.volume.muted)},null,8,["textContent"])]),Object(s["h"])("div",et,[tt,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.config.latency)},null,8,["textContent"])]),n.client.host.ip&&n.client.host.ip.length?(Object(s["r"])(),Object(s["e"])("div",nt,[st,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.host.ip)},null,8,["textContent"])])):Object(s["f"])("",!0),n.client.host.mac&&n.client.host.mac.length?(Object(s["r"])(),Object(s["e"])("div",ot,[ct,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.host.mac)},null,8,["textContent"])])):Object(s["f"])("",!0),n.client.host.os&&n.client.host.os.length?(Object(s["r"])(),Object(s["e"])("div",rt,[lt,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.host.os)},null,8,["textContent"])])):Object(s["f"])("",!0),n.client.host.arch&&n.client.host.arch.length?(Object(s["r"])(),Object(s["e"])("div",it,[at,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.host.arch)},null,8,["textContent"])])):Object(s["f"])("",!0),Object(s["h"])("div",ut,[dt,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.snapclient.name)},null,8,["textContent"])]),Object(s["h"])("div",vt,[ht,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.snapclient.version)},null,8,["textContent"])]),Object(s["h"])("div",bt,[pt,Object(s["h"])("div",{class:"value col-s-12 col-m-9",textContent:Object(s["C"])(n.client.snapclient.protocolVersion)},null,8,["textContent"])])])):Object(s["f"])("",!0),Object(s["h"])("div",mt,[Object(s["h"])("div",ft,[Object(s["h"])("button",{type:"button",disabled:n.loading,onClick:t[2]||(t[2]=function(){return r.removeClient.apply(r,arguments)})},[Ot,jt],8,["disabled"])])])])})),Ct={name:"ClientModal",emits:["remove-client","rename-client"],props:{loading:{type:Boolean,default:!1},client:{type:Object}},methods:{removeClient:function(){window.confirm("Are you sure that you want to remove this client?")&&this.$emit("remove-client")},renameClient:function(){var e,t=(window.prompt("New client name",(null===(e=this.client.config.name)||void 0===e?void 0:e.length)?this.client.config.name:this.client.host.name)||"").trim();t.length&&this.$emit("rename-client",t)}}};n("0e52");Ct.render=gt,Ct.__scopeId="data-v-0e55ac54";var xt=Ct,wt=n("3a5e"),yt={name:"MusicSnapcast",mixins:[p["a"]],components:{Loading:wt["a"],Modal:b["a"],Host:D,ModalHost:ve,ModalGroup:Ve,ModalClient:xt},data:function(){return{loading:!1,hosts:{},ports:{},selectedHost:null,selectedGroup:null,selectedClient:null}},computed:{clientsByHost:function(){return Object.entries(this.hosts).reduce((function(e,t){var n=Object(h["a"])(t,2),s=n[0],o=n[1];return e[s]={},Object.values(o.groups).forEach((function(t){Object.entries(t.clients).forEach((function(t){var n=Object(h["a"])(t,2),o=n[0],c=n[1];e[s][o]=c}))})),e}),{})}},methods:{parseServerStatus:function(e){e.server.host.port=this.ports[e.server.host.name],this.hosts[e.server.host.name]=Object(v["a"])(Object(v["a"])({},e),{},{groups:e.groups.map((function(e){return Object(v["a"])(Object(v["a"])({},e),{},{clients:e.clients.reduce((function(e,t){return e[t.id]=t,e}),{})})})).reduce((function(e,t){return e[t.id]=t,e}),{}),streams:e.streams.reduce((function(e,t){return e[t.id]=t,e}),{})})},refresh:function(){var e=this;return Object(d["a"])(regeneratorRuntime.mark((function t(){var n,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.request("music.snapcast.get_backend_hosts");case 4:return n=t.sent,t.next=7,Promise.all(Object.keys(n).map(function(){var t=Object(d["a"])(regeneratorRuntime.mark((function t(s){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",e.request("music.snapcast.status",{host:s,port:n[s]}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 7:s=t.sent,e.hosts={},s.forEach((function(t){e.ports[t.server.host.name]=n[t.server.host.name],e.parseServerStatus(t)}));case 10:return t.prev=10,e.loading=!1,t.finish(10);case 13:case"end":return t.stop()}}),t,null,[[1,,10,13]])})))()},refreshHost:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e in t.hosts){n.next=2;break}return n.abrupt("return");case 2:return n.t0=t,n.next=5,t.request("music.snapcast.status",{host:e,port:t.ports[e]});case 5:n.t1=n.sent,n.t0.parseServerStatus.call(n.t0,n.t1);case 7:case"end":return n.stop()}}),n)})))()},addClientToGroup:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){var s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.loading=!0,n.prev=1,t.selectedHost&&t.selectedGroup&&e in t.clientsByHost[t.selectedHost]){n.next=4;break}return n.abrupt("return");case 4:return s=Object(u["a"])(new Set([e].concat(Object(u["a"])(Object.keys(t.hosts[t.selectedHost].groups[t.selectedGroup].clients))))),n.next=7,t.request("music.snapcast.group_set_clients",{host:t.selectedHost,port:t.ports[t.selectedHost],group:t.selectedGroup,clients:s});case 7:return n.next=9,t.refreshHost(t.selectedHost);case 9:return n.prev=9,t.loading=!1,n.finish(9);case 12:case"end":return n.stop()}}),n,null,[[1,,9,12]])})))()},removeClientFromGroup:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){var s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.loading=!0,n.prev=1,t.selectedHost&&t.selectedGroup&&e in t.clientsByHost[t.selectedHost]){n.next=4;break}return n.abrupt("return");case 4:if(s=new Set(Object(u["a"])(Object.keys(t.hosts[t.selectedHost].groups[t.selectedGroup].clients))),s.has(e)){n.next=7;break}return n.abrupt("return");case 7:return s.delete(e),n.next=10,t.request("music.snapcast.group_set_clients",{host:t.selectedHost,port:t.ports[t.selectedHost],group:t.selectedGroup,clients:Object(u["a"])(s)});case 10:return n.next=12,t.refreshHost(t.selectedHost);case 12:return n.prev=12,t.loading=!1,n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[1,,12,15]])})))()},renameGroup:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.loading=!0,n.prev=1,t.selectedHost&&t.selectedGroup){n.next=4;break}return n.abrupt("return");case 4:return n.next=6,t.request("music.snapcast.set_group_name",{host:t.selectedHost,port:t.ports[t.selectedHost],group:t.selectedGroup,name:e});case 6:return n.next=8,t.refreshHost(t.selectedHost);case 8:return n.prev=8,t.loading=!1,n.finish(8);case 11:case"end":return n.stop()}}),n,null,[[1,,8,11]])})))()},renameClient:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.loading=!0,n.prev=1,t.selectedHost&&t.selectedClient){n.next=4;break}return n.abrupt("return");case 4:return n.next=6,t.request("music.snapcast.set_client_name",{host:t.selectedHost,port:t.ports[t.selectedHost],client:t.selectedClient,name:e});case 6:return n.next=8,t.refreshHost(t.selectedHost);case 8:return n.prev=8,t.loading=!1,n.finish(8);case 11:case"end":return n.stop()}}),n,null,[[1,,8,11]])})))()},removeClient:function(){var e=this;return Object(d["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.loading=!0,t.prev=1,e.selectedHost&&e.selectedClient){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,e.request("music.snapcast.delete_client",{host:e.selectedHost,port:e.ports[e.selectedHost],client:e.selectedClient});case 6:return e.$refs.modalClient.close(),t.next=9,e.refreshHost(e.selectedHost);case 9:return t.prev=9,e.loading=!1,t.finish(9);case 12:case"end":return t.stop()}}),t,null,[[1,,9,12]])})))()},streamChange:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t.loading=!0,n.prev=1,n.next=4,t.request("music.snapcast.group_set_stream",{host:t.selectedHost,port:t.ports[t.selectedHost],group:t.selectedGroup,stream_id:e});case 4:return n.next=6,t.refreshHost(t.selectedHost);case 6:return n.prev=6,t.loading=!1,n.finish(6);case 9:case"end":return n.stop()}}),n,null,[[1,,6,9]])})))()},onClientUpdate:function(e){var t=this;Object.keys(this.hosts[e.host].groups).forEach((function(n){e.client.id in t.hosts[e.host].groups[n].clients&&(t.hosts[e.host].groups[n].clients[e.client.id]=e.client)}))},onGroupStreamChange:function(e){this.hosts[e.host].groups[e.group].stream_id=e.stream},onServerUpdate:function(e){this.parseServerStatus(e.server)},onStreamUpdate:function(e){this.hosts[e.host].streams[e.stream.id]=e.stream},onClientVolumeChange:function(e){var t=this;Object.keys(this.hosts[e.host].groups).forEach((function(n){e.client in t.hosts[e.host].groups[n].clients&&(null!=e.volume&&(t.hosts[e.host].groups[n].clients[e.client].config.volume.percent=e.volume),null!=e.muted&&(t.hosts[e.host].groups[n].clients[e.client].config.volume.muted=e.muted))}))},onGroupMuteChange:function(e){this.hosts[e.host].groups[e.group].muted=e.muted},modalShow:function(e){switch(e.type){case"host":this.modal[e.type].info=this.hosts[e.host];break;case"group":this.modal[e.type].info.server=this.hosts[e.host].server,this.modal[e.type].info.group=this.hosts[e.host].groups[e.group],this.modal[e.type].info.streams=this.hosts[e.host].streams,this.modal[e.type].info.clients={};for(var t=0,n=Object.values(this.hosts[e.host].groups);t<n.length;t++)for(var s=n[t],o=0,c=Object.values(s.clients);o<c.length;o++){var r=c[o];this.modal[e.type].info.clients[r.id]=r}break;case"client":this.modal[e.type].info=this.hosts[e.host].groups[e.group].clients[e.client],this.modal[e.type].info.server=this.hosts[e.host].server;break}this.modal[e.type].visible=!0},groupMute:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("music.snapcast.mute",{group:e.group,host:e.host,port:t.ports[e.host],mute:e.muted});case 2:return n.next=4,t.refreshHost(e.host);case 4:case"end":return n.stop()}}),n)})))()},clientMute:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("music.snapcast.mute",{client:e.client,host:e.host,port:t.ports[e.host],mute:e.muted});case 2:return n.next=4,t.refreshHost(e.host);case 4:case"end":return n.stop()}}),n)})))()},clientSetVolume:function(e){var t=this;return Object(d["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("music.snapcast.volume",{client:e.client,host:e.host,port:t.ports[e.host],volume:e.volume});case 2:return n.next=4,t.refreshHost(e.host);case 4:case"end":return n.stop()}}),n)})))()},onModalShow:function(e){switch(e.type){case"host":this.selectedHost=e.host,this.$refs.modalHost.show();break;case"group":this.selectedHost=e.host,this.selectedGroup=e.group,this.$refs.modalGroup.show();break;case"client":this.selectedHost=e.host,this.selectedGroup=e.group,this.selectedClient=e.client,this.$refs.modalClient.show();break}}},mounted:function(){this.refresh(),this.subscribe(this.onClientUpdate,null,"platypush.message.event.music.snapcast.ClientConnectedEvent","platypush.message.event.music.snapcast.ClientDisconnectedEvent","platypush.message.event.music.snapcast.ClientNameChangeEvent"),this.subscribe(this.onGroupStreamChange,null,"platypush.message.event.music.snapcast.GroupStreamChangeEvent"),this.subscribe(this.onServerUpdate,null,"platypush.message.event.music.snapcast.ServerUpdateEvent"),this.subscribe(this.onStreamUpdate,null,"platypush.message.event.music.snapcast.StreamUpdateEvent"),this.subscribe(this.onClientVolumeChange,null,"platypush.message.event.music.snapcast.ClientVolumeChangeEvent"),this.subscribe(this.onGroupMuteChange,null,"platypush.message.event.music.snapcast.GroupMuteChangeEvent")}};n("48b6");yt.render=a,yt.__scopeId="data-v-063a7b86";t["default"]=yt},d623:function(e,t,n){"use strict";n("467d")},dd9c:function(e,t,n){},f183:function(e,t,n){var s=n("d012"),o=n("861d"),c=n("5135"),r=n("9bf2").f,l=n("90e3"),i=n("bb2f"),a=l("meta"),u=0,d=Object.isExtensible||function(){return!0},v=function(e){r(e,a,{value:{objectID:"O"+ ++u,weakData:{}}})},h=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!c(e,a)){if(!d(e))return"F";if(!t)return"E";v(e)}return e[a].objectID},b=function(e,t){if(!c(e,a)){if(!d(e))return!0;if(!t)return!1;v(e)}return e[a].weakData},p=function(e){return i&&m.REQUIRED&&d(e)&&!c(e,a)&&v(e),e},m=e.exports={REQUIRED:!1,fastKey:h,getWeakData:b,onFreeze:p};s[a]=!0},f22d:function(e,t,n){}}]);
//# sourceMappingURL=chunk-45557166.38c65779.js.map