platypush/platypush/backend/http/webapp/dist/static/js/app.ebfe47ec.js

2 lines
84 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.

(function(){var e={5250:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var s=n(9652);const i=(0,s.Z)();i.publishEntity=e=>{i.emit("entity-update",e)},i.onEntity=e=>{i.on("entity-update",e)},i.publishNotification=e=>{i.emit("notification-create",e)},i.onNotification=e=>{i.on("notification-create",e)}},6715:function(e,t,n){"use strict";var s=n(9963),i=n(6252);function o(e,t,n,s,o,a){const l=(0,i.up)("Events"),r=(0,i.up)("Notifications"),c=(0,i.up)("VoiceAssistant"),d=(0,i.up)("Pushbullet"),u=(0,i.up)("Ntfy"),h=(0,i.up)("ConfirmDialog"),p=(0,i.up)("DropdownContainer"),f=(0,i.up)("router-view");return(0,i.wg)(),(0,i.iD)(i.HY,null,[a.hasWebsocket?((0,i.wg)(),(0,i.j4)(l,{key:0,ref:"events"},null,512)):(0,i.kq)("",!0),(0,i.Wm)(r,{ref:"notifications"},null,512),a.hasAssistant?((0,i.wg)(),(0,i.j4)(c,{key:1,ref:"voice-assistant"},null,512)):(0,i.kq)("",!0),a.hasPushbullet?((0,i.wg)(),(0,i.j4)(d,{key:2,ref:"pushbullet"},null,512)):(0,i.kq)("",!0),a.hasNtfy?((0,i.wg)(),(0,i.j4)(u,{key:3,ref:"ntfy"},null,512)):(0,i.kq)("",!0),(0,i.Wm)(h,{ref:"pwaDialog",onInput:a.installPWA},{default:(0,i.w5)((()=>[(0,i.Uk)(" Would you like to install this application locally? ")])),_:1},8,["onInput"]),(0,i.Wm)(p),(0,i.Wm)(f)],64)}var a=n(6936);const l={class:"dropdown-container"};function r(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",l)}var c=n(5250),d={methods:{onOpen(e){e?.$el&&(e.keepOpenOnItemClick||this.onClose(),this.$el.appendChild(e.$el))},onClose(){this.$el.innerHTML=""}},mounted(){c.$.on("dropdown-open",this.onOpen),c.$.on("dropdown-close",this.onClose)}},u=n(3744);const h=(0,u.Z)(d,[["render",r],["__scopeId","data-v-c190f656"]]);var p=h;const f={class:"notifications"};function m(e,t,n,s,o,a){const l=(0,i.up)("Notification");return(0,i.wg)(),(0,i.iD)("div",f,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.notifications,((e,t,n)=>((0,i.wg)(),(0,i.j4)(l,{key:n,id:t,text:e.text,html:e.html,title:e.title,link:e.link,image:e.image,warning:e.warning,error:e.error,onClicked:a.destroy},null,8,["id","text","html","title","link","image","warning","error","onClicked"])))),128))])}var g=n(3577);const b=["textContent"],w={class:"body"},y={key:0,class:"image col-3"},v={class:"row"},k=["src"],_={key:3,class:"fa fa-exclamation"},x={key:4,class:"fa fa-times"},C=["textContent"],D=["innerHTML"],$=["textContent"],I=["innerHTML"];function T(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",{class:(0,g.C_)(["notification fade-in",{warning:n.warning,error:n.error}]),onClick:t[0]||(t[0]=(...e)=>a.clicked&&a.clicked(...e))},[n.title?((0,i.wg)(),(0,i.iD)("div",{key:0,class:"title",textContent:(0,g.zw)(n.title)},null,8,b)):(0,i.kq)("",!0),(0,i._)("div",w,[n.image||n.warning||n.error?((0,i.wg)(),(0,i.iD)("div",y,[(0,i._)("div",v,[n.image&&n.image.src?((0,i.wg)(),(0,i.iD)("img",{key:0,src:n.image.src,alt:""},null,8,k)):n.image&&n.image.icon?((0,i.wg)(),(0,i.iD)("i",{key:1,class:(0,g.C_)(["fa","fa-"+n.image.icon]),style:(0,g.j5)(n.image.color?"--color: "+n.image.color:"")},null,6)):n.image&&n.image.iconClass?((0,i.wg)(),(0,i.iD)("i",{key:2,class:(0,g.C_)(n.image.iconClass),style:(0,g.j5)(n.image.color?"--color: "+n.image.color:"")},null,6)):n.warning?((0,i.wg)(),(0,i.iD)("i",_)):n.error?((0,i.wg)(),(0,i.iD)("i",x)):(0,i.kq)("",!0)])])):(0,i.kq)("",!0),n.text&&n.image?((0,i.wg)(),(0,i.iD)("div",{key:1,class:"text col-9",textContent:(0,g.zw)(n.text)},null,8,C)):(0,i.kq)("",!0),n.html&&n.image?((0,i.wg)(),(0,i.iD)("div",{key:2,class:"text col-9",innerHTML:n.html},null,8,D)):(0,i.kq)("",!0),n.text&&!n.image?((0,i.wg)(),(0,i.iD)("div",{key:3,class:"text row horizontal-center",textContent:(0,g.zw)(n.text)},null,8,$)):(0,i.kq)("",!0),n.html&&!n.image?((0,i.wg)(),(0,i.iD)("div",{key:4,class:"text row horizontal-center",innerHTML:n.html},null,8,I)):(0,i.kq)("",!0)])],2)}var S={name:"Notification",props:["id","text","html","title","image","link","error","warning"],methods:{clicked(){this.link&&window.open(this.link,"_blank"),this.$emit("clicked",this.id)}}};const q=(0,u.Z)(S,[["render",T],["__scopeId","data-v-7646705e"]]);var U=q,E={name:"Notifications",components:{Notification:U},props:{duration:{type:Number,default:1e4}},data:function(){return{index:0,notifications:{},timeouts:{}}},methods:{create:function(e){const t=this.index++;this.notifications[t]=e,null==e.duration&&(e.duration=this.duration);const n=e.duration?parseInt(e.duration):0;n&&(this.timeouts[t]=setTimeout(this.destroy.bind(null,t),n))},destroy:function(e){delete this.notifications[e],delete this.timeouts[e]}}};const O=(0,u.Z)(E,[["render",m],["__scopeId","data-v-6dc8bebc"]]);var M=O,Z=n(8637);function P(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div")}n(7658);var j={name:"Events",data(){return{ws:null,initialized:!1,pending:!1,opened:!1,timeout:null,reconnectMsecs:1e3,minReconnectMsecs:1e3,maxReconnectMsecs:3e4,handlers:{},handlerNameToEventTypes:{}}},methods:{onWebsocketTimeout(){console.log("Websocket reconnection timed out, retrying"),this.reconnectMsecs=Math.min(2*this.reconnectMsecs,this.maxReconnectMsecs),this.pending=!1,this.ws&&this.ws.close(),this.onClose()},onMessage(e){const t=[];if(e=e.data,"string"===typeof e)try{e=JSON.parse(e)}catch(n){console.warn("Received invalid non-JSON event"),console.warn(e)}if(console.debug(e),"event"===e.type){null in this.handlers&&t.push(this.handlers[null]),e.args.type in this.handlers&&t.push(...Object.values(this.handlers[e.args.type]));for(let n of t)n&&(n instanceof Array?n=n[0]:n instanceof Object&&!(n instanceof Function)&&(n=Object.values(n)[0]),n(e.args))}},onOpen(){this.opened&&(console.log("There's already an opened websocket connection, closing the newly opened one"),this.ws&&(this.ws.onclose=()=>{},this.ws.close())),console.log("Websocket connection successful"),this.opened=!0,this.reconnectMsecs=this.minReconnectMsecs,this.pending&&(this.pending=!1),this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)},onError(e){console.error("Websocket error"),console.error(e)},onClose(e){e&&console.log(`Websocket closed - code: ${e.code} - reason: ${e.reason}. Retrying in ${this.reconnectMsecs/1e3}s`),this.opened=!1,this.pending||(this.pending=!0,this.init())},init(){try{const e="https:"===location.protocol?"wss":"ws",t=`${e}://${location.host}/ws/events`;this.ws=new WebSocket(t)}catch(e){return console.error("Websocket initialization error"),void console.error(e)}this.pending=!0,this.timeout=setTimeout(this.onWebsocketTimeout,this.reconnectMsecs),this.ws.onmessage=this.onMessage,this.ws.onopen=this.onOpen,this.ws.onerror=this.onError,this.ws.onclose=this.onClose,this.initialized=!0},subscribe(e){const t=e.handler,n=e.events.length?e.events:[null],s=e.handlerName;for(const i of n)i in this.handlers||(this.handlers[i]={}),s in this.handlerNameToEventTypes||(this.handlerNameToEventTypes[s]=n),this.handlers[i][s]=t;return()=>{this.unsubscribe(s)}},unsubscribe(e){const t=this.handlerNameToEventTypes[e];if(t){for(const n of t)this.handlers[n]?.[e]&&(delete this.handlers[n][e],Object.keys(this.handlers[n]).length||delete this.handlers[n]);delete this.handlerNameToEventTypes[e]}}},created(){c.$.on("subscribe",this.subscribe),c.$.on("unsubscribe",this.unsubscribe),this.$watch("opened",(e=>{c.$.emit(e?"connect":"disconnect")})),this.init()}};const N=(0,u.Z)(j,[["render",P]]);var W=N;const R={class:"assistant-modal"},z={class:"icon"},L={key:0,class:"fa fa-bell"},A={key:1,class:"fa fa-volume-up"},F={key:2,class:"fa fa-comment-dots"},H={key:3,class:"fa fa-microphone"},B={class:"text"},V={key:0,class:"listening"},Y=(0,i._)("span",null,"Assistant listening",-1),K=[Y],J={key:1,class:"speech-recognized"},X=["textContent"],G={key:2,class:"responding"},Q=["textContent"];function ee(e,t,n,s,o,a){const l=(0,i.up)("Modal");return(0,i.wg)(),(0,i.iD)("div",R,[(0,i.Wm)(l,{ref:"assistantModal"},{default:(0,i.w5)((()=>[(0,i._)("div",z,[o.state.alerting?((0,i.wg)(),(0,i.iD)("i",L)):o.state.responding?((0,i.wg)(),(0,i.iD)("i",A)):o.state.speechRecognized?((0,i.wg)(),(0,i.iD)("i",F)):((0,i.wg)(),(0,i.iD)("i",H))]),(0,i._)("div",B,[o.state.listening?((0,i.wg)(),(0,i.iD)("div",V,K)):o.state.speechRecognized?((0,i.wg)(),(0,i.iD)("div",J,[(0,i._)("span",{textContent:(0,g.zw)(o.phrase)},null,8,X)])):o.state.responding?((0,i.wg)(),(0,i.iD)("div",G,[(0,i._)("span",{textContent:(0,g.zw)(o.responseText)},null,8,Q)])):(0,i.kq)("",!0)])])),_:1},512)])}var te=n(3493),ne={name:"VoiceAssistant",components:{Modal:te.Z},mixins:[Z.Z],data(){return{responseText:"",phrase:"",hideTimeout:void 0,state:{listening:!1,speechRecognized:!1,responding:!1,alerting:!1}}},methods:{reset(){this.state.listening=!1,this.state.speechRecognized=!1,this.state.responding=!1,this.state.alerting=!1,this.phrase="",this.responseText=""},conversationStart(){this.reset(),this.state.listening=!0,this.$refs.assistantModal.show(),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0)},conversationEnd(){const e=this;this.hideTimeout=setTimeout((()=>{this.reset(),e.$refs.assistantModal.close(),e.hideTimeout=void 0}),4e3)},speechRecognized(e){this.reset(),this.state.speechRecognized=!0,this.phrase=e.phrase,this.$refs.assistantModal.show()},response(e){this.reset(),this.state.responding=!0,this.responseText=e.response_text,this.$refs.assistantModal.show()},alertOn(){this.reset(),this.state.alerting=!0,this.$refs.assistantModal.show()},alertOff(){this.reset(),this.state.alerting=!1,this.$refs.assistantModal.close()},registerHandlers(){this.subscribe(this.conversationStart,null,"platypush.message.event.assistant.ConversationStartEvent"),this.subscribe(this.alertOn,null,"platypush.message.event.assistant.AlertStartedEvent"),this.subscribe(this.alertOff,null,"platypush.message.event.assistant.AlertEndEvent"),this.subscribe(this.speechRecognized,null,"platypush.message.event.assistant.SpeechRecognizedEvent"),this.subscribe(this.response,null,"platypush.message.event.assistant.ResponseEvent"),this.subscribe(this.conversationEnd,null,"platypush.message.event.assistant.ConversationEndEvent","platypush.message.event.assistant.NoResponseEvent","platypush.message.event.assistant.ConversationTimeoutEvent")}},mounted(){this.registerHandlers()}};const se=(0,u.Z)(ne,[["render",ee]]);var ie=se;function oe(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div")}var ae={name:"Ntfy",mixins:[Z.Z],methods:{onMessage(e){this.notify({title:e.title,text:e.message,image:{icon:"bell"}})}},mounted(){this.subscribe(this.onMessage,null,"platypush.message.event.ntfy.NotificationEvent")}};const le=(0,u.Z)(ae,[["render",oe]]);var re=le;function ce(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div")}var de={name:"Pushbullet",mixins:[Z.Z],methods:{onMessage(e){"mirror"===e.push_type&&this.notify({title:e.title,text:e.body,image:{src:e.icon?"data:image/png;base64, "+e.icon:void 0,icon:e.icon?void 0:"bell"}})}},mounted(){this.subscribe(this.onMessage,null,"platypush.message.event.pushbullet.PushbulletEvent")}};const ue=(0,u.Z)(de,[["render",ce]]);var he=ue,pe={mixins:[Z.Z],components:{ConfirmDialog:a.Z,DropdownContainer:p,Events:W,Notifications:M,Ntfy:re,Pushbullet:he,VoiceAssistant:ie},data(){return{config:{},userAuthenticated:!1,connected:!1,pwaInstallEvent:null}},computed:{hasWebsocket(){return this.userAuthenticated&&"backend.http"in this.config},hasAssistant(){return this.hasWebsocket},hasPushbullet(){return this.hasWebsocket&&("pushbullet"in this.config||"backend.pushbullet"in this.config)},hasNtfy(){return this.hasWebsocket&&"ntfy"in this.config}},methods:{onNotification(e){this.$refs.notifications.create(e)},async initConfig(){this.config=await this.request("config.get",{},6e4,!1),this.userAuthenticated=!0},installPWA(){this.pwaInstallEvent&&this.pwaInstallEvent.prompt(),this.$refs.pwaDialog.close()}},created(){this.initConfig()},beforeMount(){this.getCookie("pwa-dialog-shown")?.length||window.addEventListener("beforeinstallprompt",(e=>{e.preventDefault(),this.pwaInstallEvent=e,this.$refs.pwaDialog.show(),this.setCookie("pwa-dialog-shown","1",{expires:new Date((new Date).getTime()+31536e6)})}))},mounted(){c.$.onNotification(this.onNotification),c.$.on("connect",(()=>this.connected=!0)),c.$.on("disconnect",(()=>this.connected=!1))}};const fe=(0,u.Z)(pe,[["render",o]]);var me=fe,ge=n(2201);function be(e,t,n,s,o,a){const l=(0,i.up)("Loading"),r=(0,i.up)("Widget"),c=(0,i.up)("Row");return(0,i.wg)(),(0,i.iD)(i.HY,null,[o.loading?((0,i.wg)(),(0,i.j4)(l,{key:0})):(0,i.kq)("",!0),(0,i._)("div",{id:"dashboard",class:(0,g.C_)(["col-12",a.classes]),style:(0,g.j5)(o.style)},[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(o.rows,((e,t)=>((0,i.wg)(),(0,i.j4)(c,{key:t,class:(0,g.C_)(e.class),style:(0,g.j5)(e.style)},{default:(0,i.w5)((()=>[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.widgets,((e,t)=>((0,i.wg)(),(0,i.j4)(i.Ob,{key:t},[(0,i.Wm)(r,{style:(0,g.j5)(e.style),class:(0,g.C_)(e.class)},{default:(0,i.w5)((()=>[((0,i.wg)(),(0,i.j4)((0,i.LL)(e.component),(0,g.vs)((0,i.F4)(a.getWidgetProps(e))),null,16))])),_:2},1032,["style","class"])],1024)))),128))])),_:2},1032,["class","style"])))),128))],6)],64)}var we=n(2262),ye=n(6791);function ve(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",{class:(0,g.C_)(["row",a.classes]),style:(0,g.j5)(n.style)},[(0,i.WI)(e.$slots,"default",{},void 0,!0)],6)}var ke={name:"Row",props:{class:{type:String,required:!1,default:""},style:{type:String,required:!1,default:""}},computed:{classes(){return this.class}}};const _e=(0,u.Z)(ke,[["render",ve],["__scopeId","data-v-1b4663f2"]]);var xe=_e;function Ce(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",{style:(0,g.j5)(n.style),class:(0,g.C_)(a.classes)},[(0,i.WI)(e.$slots,"default",{},void 0,!0)],6)}var De={name:"Widget",props:{style:{type:String,required:!1,default:""},class:{type:String,required:!1,default:""}},computed:{classes(){return(this.class?.length?this.class.split(" "):["col-3"]).concat(["widget","column"])}}};const $e=(0,u.Z)(De,[["render",Ce],["__scopeId","data-v-5df52982"]]);var Ie=$e,Te={name:"Dashboard",mixins:[Z.Z],components:{Widget:Ie,Loading:ye.Z,Row:xe},props:{refreshSeconds:{type:Number,required:!1,default:0}},data(){return{rows:[],loading:!1,style:void 0,class:void 0}},computed:{classes(){return this.class}},methods:{getWidgetProps(e){const t={...e.props};return t.class&&delete t.class,t},parseTemplate(e,t){const s=(new DOMParser).parseFromString(t,"text/xml").childNodes[0],o=this;this.style=s.attributes.style?.nodeValue,this.class=s.attributes.class?.nodeValue,this.rows=[...s.getElementsByTagName("Row")].map((e=>({style:e.attributes.style?.nodeValue,class:e.attributes.class?.nodeValue,widgets:[...e.children].map((e=>{const t=(0,we.XI)((0,i.RC)((()=>n(6725)(`./${e.nodeName}/Index`)))),s=e.attributes.style?.nodeValue,a=e.attributes.class?.nodeValue,l=[...e.attributes].reduce(((e,t)=>("style"!==t.nodeName&&(e[t.nodeName]=t.nodeValue),e)),{content:e.innerHTML}),r={component:t,style:s,class:a,props:l||{}};return o.$options.components[e.nodeName]=t,r}))}))),this.loading=!1},async refreshDashboard(){this.loading=!0,this.widgets=[];const e=this.$route.params.name,t=await this.request("config.get_dashboard",{name:e});t||this.notifyError(`Dashboard ${e} not found`),this.parseTemplate(e,t)}},mounted(){if(this.refreshDashboard(),this.refreshSeconds){const e=this;setInterval((()=>{e.refreshDashboard()}),parseInt((1e3*this.refreshSeconds).toFixed(0)))}}};const Se=(0,u.Z)(Te,[["render",be],["__scopeId","data-v-54e0248a"]]);var qe=Se;function Ue(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("h1",null,"Object not found")}var Ee={name:"NotFound"};const Oe=(0,u.Z)(Ee,[["render",Ue]]);var Me=Oe;const Ze=e=>((0,i.dD)("data-v-af0b14d0"),e=e(),(0,i.Cn)(),e),Pe={class:"login-container"},je={class:"login",method:"POST"},Ne=(0,i.uE)('<div class="header" data-v-af0b14d0><span class="logo" data-v-af0b14d0><img src="/logo.svg" alt="logo" data-v-af0b14d0></span><span class="text" data-v-af0b14d0>Platypush</span></div><div class="row" data-v-af0b14d0><label data-v-af0b14d0><input type="text" name="username" placeholder="Username" data-v-af0b14d0></label></div><div class="row" data-v-af0b14d0><label data-v-af0b14d0><input type="password" name="password" placeholder="Password" data-v-af0b14d0></label></div>',3),We={key:0,class:"row"},Re=Ze((()=>(0,i._)("label",null,[(0,i._)("input",{type:"password",name:"confirm_password",placeholder:"Confirm password"})],-1))),ze=[Re],Le={class:"row buttons"},Ae=["value"],Fe=Ze((()=>(0,i._)("div",{class:"row pull-right"},[(0,i._)("label",{class:"checkbox"},[(0,i._)("input",{type:"checkbox",name:"remember"}),(0,i.Uk)("  Keep me logged in on this device   ")])],-1)));function He(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",Pe,[(0,i._)("form",je,[Ne,a._register?((0,i.wg)(),(0,i.iD)("div",We,ze)):(0,i.kq)("",!0),(0,i._)("div",Le,[(0,i._)("input",{type:"submit",class:"btn btn-primary",value:a._register?"Register":"Login"},null,8,Ae)]),Fe])])}var Be={name:"Login",mixins:[Z.Z],props:{register:{type:Boolean,required:!1,default:!1}},computed:{_register(){return this.parseBoolean(this.register)}}};const Ve=(0,u.Z)(Be,[["render",He],["__scopeId","data-v-af0b14d0"]]);var Ye=Ve;function Ke(e,t,n,s,o,a){const l=(0,i.up)("Login");return(0,i.wg)(),(0,i.j4)(l,{register:!0})}var Je={name:"Register",mixins:[Ye],components:{Login:Ye},props:{register:{type:Boolean,required:!1,default:!0}}};const Xe=(0,u.Z)(Je,[["render",Ke]]);var Ge=Xe;const Qe={key:2,class:"canvas"},et={class:"panel"},tt={key:3,class:"canvas"},nt={class:"panel"},st={key:4,class:"canvas"};function it(e,t,n,s,o,a){const l=(0,i.up)("Loading"),r=(0,i.up)("Nav"),c=(0,i.up)("Settings"),d=(0,i.up)("Extensions");return(0,i.wg)(),(0,i.iD)("main",null,[o.loading?((0,i.wg)(),(0,i.j4)(l,{key:0})):((0,i.wg)(),(0,i.j4)(r,{key:1,panels:o.components,"selected-panel":o.selectedPanel,"selected-config-panel":o.selectedConfigPanel,hostname:o.hostname,onSelect:t[0]||(t[0]=e=>o.selectedPanel=e),onSelectConfig:t[1]||(t[1]=e=>o.selectedConfigPanel=e)},null,8,["panels","selected-panel","selected-config-panel","hostname"])),"settings"===o.selectedPanel?((0,i.wg)(),(0,i.iD)("div",Qe,[(0,i._)("div",et,[(0,i.Wm)(c,{"selected-panel":o.selectedConfigPanel},null,8,["selected-panel"])])])):"extensions"===o.selectedPanel?((0,i.wg)(),(0,i.iD)("div",tt,[(0,i._)("div",nt,[(0,i.Wm)(d)])])):((0,i.wg)(),(0,i.iD)("div",st,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(o.components,((e,t)=>((0,i.wg)(),(0,i.iD)("div",{class:(0,g.C_)(["panel",{hidden:t!==o.selectedPanel}]),key:t},[t===o.selectedPanel?((0,i.wg)(),(0,i.j4)((0,i.LL)(e.component),{key:0,config:e.config,"plugin-name":t},null,8,["config","plugin-name"])):(0,i.kq)("",!0)],2)))),128))]))])}const ot=e=>((0,i.dD)("data-v-5c6840e6"),e=e(),(0,i.Cn)(),e),at=ot((()=>(0,i._)("i",{class:"fas fa-bars"},null,-1))),lt=["textContent"],rt=["title"],ct={key:0,class:"plugins"},dt={href:"/#"},ut=ot((()=>(0,i._)("i",{class:"fas fa-home"},null,-1))),ht={key:0,class:"name"},pt=["title","onClick"],ft={href:"/#settings"},mt={class:"icon"},gt=["src"],bt={key:2,class:"fas fa-puzzle-piece"},wt=["textContent"],yt={key:1,class:"plugins"},vt=["title","onClick"],kt=["href"],_t={class:"icon"},xt=["src"],Ct={key:2,class:"fas fa-puzzle-piece"},Dt=["textContent"],$t={class:"footer"},It={href:"/#extensions"},Tt=ot((()=>(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fa fa-puzzle-piece"})],-1))),St={key:0,class:"name"},qt={href:"/#settings"},Ut=ot((()=>(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fa fa-cog"})],-1))),Et={key:0,class:"name"},Ot={href:"/logout"},Mt=ot((()=>(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fas fa-sign-out-alt"})],-1))),Zt={key:0,class:"name"};function Pt(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("nav",{class:(0,g.C_)({collapsed:o.collapsed})},[(0,i._)("div",{class:"toggler",onClick:t[0]||(t[0]=e=>o.collapsed=!o.collapsed)},[at,n.hostname?((0,i.wg)(),(0,i.iD)("span",{key:0,class:"hostname",textContent:(0,g.zw)(n.hostname)},null,8,lt)):(0,i.kq)("",!0),(0,i._)("i",{class:(0,g.C_)(["icon status fas fa-circle",{ok:o.connected,error:!o.connected}]),title:o.connected?"Connected":"Disconnected"},null,10,rt)]),"settings"===n.selectedPanel?((0,i.wg)(),(0,i.iD)("ul",ct,[(0,i._)("li",{class:"entry",title:"Home",onClick:t[1]||(t[1]=e=>a.onItemClick("entities"))},[(0,i._)("a",dt,[ut,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",ht,"Home"))])]),((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(o.configSections,((t,s)=>((0,i.wg)(),(0,i.iD)("li",{key:s,class:(0,g.C_)(["entry",{selected:s===n.selectedConfigPanel}]),title:t.name,onClick:t=>e.$emit("select-config",s)},[(0,i._)("a",ft,[(0,i._)("span",mt,[t.icon?.["class"]?((0,i.wg)(),(0,i.iD)("i",{key:0,class:(0,g.C_)(t.icon["class"])},null,2)):t.icon?.imgUrl?((0,i.wg)(),(0,i.iD)("img",{key:1,src:t.icon?.imgUrl,alt:"name"},null,8,gt)):((0,i.wg)(),(0,i.iD)("i",bt))]),o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",{key:0,class:"name",textContent:(0,g.zw)(t.name)},null,8,wt))])],10,pt)))),128))])):((0,i.wg)(),(0,i.iD)("ul",yt,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(a.panelNames,(e=>((0,i.wg)(),(0,i.iD)("li",{key:e,class:(0,g.C_)(["entry",{selected:e===n.selectedPanel}]),title:e,onClick:t=>a.onItemClick(e)},[(0,i._)("a",{href:`/#${e}`},[(0,i._)("span",_t,[o.icons[e]?.class?((0,i.wg)(),(0,i.iD)("i",{key:0,class:(0,g.C_)(o.icons[e].class)},null,2)):o.icons[e]?.imgUrl?((0,i.wg)(),(0,i.iD)("img",{key:1,src:o.icons[e].imgUrl,alt:"name"},null,8,xt)):((0,i.wg)(),(0,i.iD)("i",Ct))]),o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",{key:0,class:"name",textContent:(0,g.zw)(a.displayName(e))},null,8,Dt))],8,kt)],10,vt)))),128))])),(0,i._)("ul",$t,[(0,i._)("li",{class:(0,g.C_)({selected:"extensions"===n.selectedPanel}),title:"Extensions",onClick:t[2]||(t[2]=e=>a.onItemClick("extensions"))},[(0,i._)("a",It,[Tt,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",St,"Extensions"))])],2),(0,i._)("li",{class:(0,g.C_)({selected:"settings"===n.selectedPanel}),title:"Settings",onClick:t[3]||(t[3]=e=>a.onItemClick("settings"))},[(0,i._)("a",qt,[Ut,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",Et,"Settings"))])],2),(0,i._)("li",{title:"Logout",onClick:t[4]||(t[4]=e=>a.onItemClick("logout"))},[(0,i._)("a",Ot,[Mt,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",Zt,"Logout"))])])])],2)}var jt=n(1359),Nt=JSON.parse('{"users":{"name":"Users","icon":{"class":"fas fa-user"}},"tokens":{"name":"Tokens","icon":{"class":"fas fa-key"}},"application":{"name":"Application","icon":{"class":"fas fa-gears"}}}'),Wt={name:"Nav",emits:["select","select-config"],mixins:[Z.Z],props:{panels:{type:Object,required:!0},selectedPanel:{type:String},selectedConfigPanel:{type:String},hostname:{type:String}},computed:{panelNames(){const e=(e,n)=>{const s=t.indexOf(n);return s>=0&&(e=[n].concat(e.slice(0,s).concat(e.slice(s+1)))),e};let t=Object.keys(this.panels).sort();return t=e(t,"execute"),t=e(t,"entities"),t},collapsedDefault(){return!(!this.isMobile()&&!this.isTablet())}},methods:{onItemClick(e){this.$emit("select",e),this.collapsed=!!this.isMobile()||this.collapsedDefault},displayName(e){return"entities"===e?"Home":"execute"===e?"Execute":e},setConnected(e){this.connected=e}},data(){return{collapsed:!0,connected:!1,icons:jt,host:null,configSections:Nt}},mounted(){this.collapsed=this.collapsedDefault,c.$.on("connect",(()=>this.setConnected(!0))),c.$.on("disconnect",(()=>this.setConnected(!1))),this.$watch((()=>this.$root.connected),(e=>this.setConnected(e))),this.setConnected(this.$root.connected)}};const Rt=(0,u.Z)(Wt,[["render",Pt],["__scopeId","data-v-5c6840e6"]]);var zt=Rt,Lt=n(8744),At=n(8369),Ft={name:"Panel",mixins:[Z.Z],components:{Extensions:Lt["default"],Settings:At["default"],Nav:zt,Loading:ye.Z},data(){return{loading:!1,plugins:{},backends:{},procedures:{},components:{},hostname:void 0,selectedPanel:void 0,selectedConfigPanel:"users"}},methods:{initSelectedPanel(){const e=this.$route.hash.match(/^#?([a-zA-Z0-9_.]+)(\?(.+?))?/),t=e?e[1]:"entities";t?.length&&(this.selectedPanel=t)},initPanels(){const e=this;this.components={},Object.entries(this.plugins).forEach((async([t,s])=>{const o=t.split(".").map((e=>e[0].toUpperCase()+e.slice(1))).join("");let a=null;try{a=await n(3379)(`./${o}/Index`)}catch(r){return}const l=(0,we.XI)((0,i.RC)((async()=>a)));e.$options.components[t]=l,e.components[t]={component:l,pluginName:t,config:s}}))},async parseConfig(){[this.plugins,this.backends,this.procedures,this.hostname]=await Promise.all([this.request("config.get_plugins"),this.request("config.get_backends"),this.request("config.get_procedures"),this.request("config.get_device_id")]),this.initializeDefaultViews()},initializeDefaultViews(){this.plugins.entities={},this.plugins.execute={}}},async mounted(){this.loading=!0;try{await this.parseConfig(),this.initPanels(),this.initSelectedPanel(),this.$watch("$route.hash",this.initSelectedPanel)}finally{this.loading=!1}}};const Ht=(0,u.Z)(Ft,[["render",it],["__scopeId","data-v-871fbba0"]]);var Bt=Ht;const Vt={key:1,class:"canvas"};function Yt(e,t,n,s,o,a){const l=(0,i.up)("Loading");return(0,i.wg)(),(0,i.iD)("main",null,[o.loading?((0,i.wg)(),(0,i.j4)(l,{key:0})):((0,i.wg)(),(0,i.iD)("div",Vt,[((0,i.wg)(),(0,i.j4)((0,i.LL)(o.component),{config:o.config,"plugin-name":a.pluginName},null,8,["config","plugin-name"]))]))])}var Kt={name:"Panel",mixins:[Z.Z],components:{Settings:At["default"],Nav:zt,Loading:ye.Z},data(){return{loading:!1,config:{},plugins:{},backends:{},procedures:{},component:void 0,hostname:void 0,selectedPanel:void 0}},computed:{pluginName(){return this.$route.params.plugin}},methods:{async initPanel(){const e=this.pluginName.split(".").map((e=>e[0].toUpperCase()+e.slice(1))).join("");let t=null;try{t=await n(3379)(`./${e}/Index`)}catch(s){return console.error(s),void this.notify({error:!0,title:`Cannot load plugin ${this.pluginName}`,text:s.toString()})}this.component=(0,we.XI)((0,i.RC)((async()=>t))),this.$options.components[e]=this.component},async initConfig(){const e=await this.request("config.get");this.config=e[this.pluginName]||{},this.hostname=await this.request("config.get_device_id")}},async mounted(){this.loading=!0;try{await this.initConfig(),await this.initPanel()}finally{this.loading=!1}}};const Jt=(0,u.Z)(Kt,[["render",Yt],["__scopeId","data-v-e339182c"]]);var Xt=Jt;const Gt=[{path:"/",name:"Panel",component:Bt},{path:"/dashboard/:name",name:"Dashboard",component:qe},{path:"/plugin/:plugin",name:"Plugin",component:Xt},{path:"/login",name:"Login",component:Ye},{path:"/register",name:"Register",component:Ge},{path:"/:catchAll(.*)",component:Me}],Qt=(0,ge.p7)({history:(0,ge.PO)(),routes:Gt});var en=Qt,tn=n(5205);(0,tn.z)("/service-worker.js",{ready(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},registered(){console.log("Service worker has been registered.")},cached(){console.log("Content has been cached for offline use.")},updatefound(){console.log("New content is downloading.")},updated(){console.log("New content is available; please refresh.")},offline(){console.log("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}});const nn=(0,s.ri)(me);nn.config.globalProperties._config=window.config,nn.use(en).mount("#app")},8637:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}});var s=n(6154),i={name:"Api",methods:{execute(e,t=6e4,n=!0){const i={};return"target"in e&&e["target"]||(e["target"]="localhost"),"type"in e&&e["type"]||(e["type"]="request"),t&&(i.timeout=t),new Promise(((t,o)=>{s.Z.post("/execute",e,i).then((e=>{if(e=e.data.response,e.errors?.length){const t=e.errors?.[0]||e;this.notify({text:t,error:!0}),o(t)}else t(e.output)})).catch((e=>{412===e?.response?.data?.code&&window.location.href.indexOf("/register")<0?window.location.href="/register?redirect="+window.location.href:401===e?.response?.data?.code&&window.location.href.indexOf("/login")<0?window.location.href="/login?redirect="+window.location.href:(console.log(e),n&&this.notify({text:e,error:!0}),o(e))}))}))},request(e,t={},n=6e4,s=!0){return this.execute({type:"request",action:e,args:t},n,s)}}};const o=i;var a=o,l={name:"Clipboard",methods:{async copyToClipboard(e){await navigator.clipboard.writeText(e),this.notify({text:"Copied to the clipboard",image:{icon:"clipboard"}})}}};const r=l;var c=r,d={name:"Cookies",methods:{getCookies(){return document.cookie.split(/;\s*/).reduce(((e,t)=>{const[n,s]=t.split("=");return e[n]=s,e}),{})},getCookie(e){return this.getCookies()[e]},setCookie(e,t,n){document.cookie=`${e}=${t}; path=${n?.path||"/"}`+(n?.expires?`; expires=${n?.expires.toISOString()}`:"")},deleteCookie(e){document.cookie=`${e}=; expires=1970-01-01T00:00:00Z`}}};const u=d;var h=u,p={name:"DateTime",methods:{formatDate(e,t=!1){return"string"===typeof e&&(e=new Date(Date.parse(e))),e.toDateString().substring(0,t?15:10)},formatTime(e,t=!0){return"string"===typeof e&&(e=new Date(Date.parse(e))),e.toTimeString().substring(0,t?8:5)},formatDateTime(e,t=!1,n=!0,s=!1){return"string"===typeof e&&(e=new Date(Date.parse(e))),s&&0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds()?this.formatDate(e,t):`${this.formatDate(e,t)}, ${this.formatTime(e,n)}`}}};const f=p;var m=f,g=(n(2801),n(5250)),b={name:"Events",computed:{_eventsReady(){return this.$root.$refs.events?.initialized}},methods:{subscribe(e,t,...n){const s=()=>{g.$.emit("subscribe",{events:n,handler:e,handlerName:t||this.generateId()})};if(this._eventsReady)return void s();const i=this,o=this.$watch((()=>i._eventsReady),(e=>{e&&(s(),o())}));return o},unsubscribe(e){g.$.emit("unsubscribe",e)},generateId(){return btoa([...Array(11).keys()].map((()=>String.fromCharCode(Math.round(255*Math.random())))))}}};const w=b;var y=w,v={name:"Extensions",methods:{pluginDisplayName(e){const t=e.split(".");return t.forEach(((e,n)=>{t[n]=e.charAt(0).toUpperCase()+e.slice(1)})),t.length>1&&(t[0]=`[${t[0]}]`),t.join(" ")}}};const k=v;var _=k,x={name:"Notification",methods:{notify(e){g.$.publishNotification(e)},notifyWarning(e){this.notify({text:e,warning:!0})},notifyError(e){throw this.notify({text:e,error:!0}),e}}};const C=x;var D=C,$={name:"Screen",methods:{isMobile(){return window.matchMedia("only screen and (max-width: 768px)").matches},isTablet(){return!this.isMobile()&&window.matchMedia("only screen and (max-width: 1023px)").matches},isDesktop(){return window.matchMedia("only screen and (min-width: 1024px)").matches}}};const I=$;var T=I,S={name:"Text",methods:{capitalize(e){return e?.length?e.charAt(0).toUpperCase()+e.slice(1):e},prettify(e){return e.split("_").map((e=>this.capitalize(e))).join(" ")},indent(e,t=2){return e.split("\n").map((e=>`${" ".repeat(t)}${e}`)).join("\n")}}};const q=S;var U=q,E=(n(7658),{name:"Types",methods:{parseBoolean(e){return"string"===typeof e?(e=e.toLowerCase(),"true"===e||"false"!==e&&!!parseInt(e)):!!e},convertSize(e){"string"===typeof e&&(e=parseInt(e));let t=null;const n=["B","KB","MB","GB","TB"];return n.forEach(((s,i)=>{e<=1024&&null==t?t=s:e>1024&&(i===n.length-1?t=s:e/=1024)})),`${e.toFixed(2)} ${t}`},convertTime(e){const t={},n=[];if(e=parseFloat(e),t.d=Math.round(e/86400),t.h=Math.round(e/3600-24*t.d),t.m=Math.round(e/60-(24*t.d+60*t.h)),t.s=Math.round(e-(24*t.d+3600*t.h+60*t.m),1),parseInt(t.d)){let e=t.d+" day";t.d>1&&(e+="s"),n.push(e)}if(parseInt(t.h)){let e=t.h+" hour";t.h>1&&(e+="s"),n.push(e)}if(parseInt(t.m)){let e=t.m+" minute";t.m>1&&(e+="s"),n.push(e)}let s=t.s+" second";return t.s>1&&(s+="s"),n.push(s),n.join(" ")},objectsEqual(e,t){if("object"!==typeof e||"object"!==typeof t)return!1;if(null==e||null==t)return null==e&&null==t;for(const n of Object.keys(e||{}))switch(typeof e[n]){case"object":if(!this.objectsEqual(e[n],t[n]))return!1;break;case"function":if(e[n].toString()!=t[n]?.toString())return!1;break;default:if(e[n]!=t[n])return!1;break}for(const n of Object.keys(t||{}))if(null==e[n]&&null!=t[n])return!1;return!0}}});const O=E;var M=O,Z={name:"Url",methods:{parseUrlFragment(){return window.location.hash.replace(/^#/,"").replace(/\?.*/,"")},getUrlArgs(){const e=window.location.hash.split("?").slice(1);return e.length?e[0].split(/[&;]/).reduce(((e,t)=>{const n=t.split("=");return n[0]?.length&&(e[n[0]]=n[1]),e}),{}):{}},setUrlArgs(e){const t=this.getUrlArgs();e=Object.entries(e).reduce(((e,[n,s])=>(null!=s?e[n]=s:null!=t[n]&&delete t[n],e)),{}),e={...t,...e};let n=`${window.location.pathname}#${this.parseUrlFragment()}`;Object.keys(e).length&&(n+=`?${this.fragmentFromArgs(e)}`),window.location.href=n},fragmentFromArgs(e){return Object.entries(e).map((([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}}};const P=Z;var j=P,N={name:"Utils",mixins:[a,c,h,m,y,D,_,T,U,M,j]};const W=N;var R=W},6791:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var s=n(6252);const i={class:"loading"},o={class:"icon"};function a(e,t){return(0,s.wg)(),(0,s.iD)("div",i,[(0,s._)("div",o,[((0,s.wg)(),(0,s.iD)(s.HY,null,(0,s.Ko)(4,(e=>(0,s._)("div",{key:e}))),64))])])}var l=n(3744);const r={},c=(0,l.Z)(r,[["render",a],["__scopeId","data-v-4d9c871b"]]);var d=c},3493:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var s=n(6252),i=n(3577);const o=e=>((0,s.dD)("data-v-09bd997a"),e=e(),(0,s.Cn)(),e),a=["id"],l={key:0,class:"header"},r=["textContent"],c=o((()=>(0,s._)("i",{class:"fas fa-xmark"},null,-1))),d=[c],u={class:"body"};function h(e,t,n,o,c,h){return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["modal-container fade-in",{hidden:!c.isVisible}]),id:n.id,style:(0,i.j5)({"--z-index":h.zIndex}),onClick:t[3]||(t[3]=(...e)=>h.close&&h.close(...e))},[(0,s._)("div",{class:(0,i.C_)(["modal",e.$attrs.class])},[(0,s._)("div",{class:"content",style:(0,i.j5)({"--width":n.width,"--height":n.height}),onClick:t[2]||(t[2]=e=>e.stopPropagation())},[n.title?((0,s.wg)(),(0,s.iD)("div",l,[n.title?((0,s.wg)(),(0,s.iD)("div",{key:0,class:"title",textContent:(0,i.zw)(n.title)},null,8,r)):(0,s.kq)("",!0),(0,s._)("button",{title:"Close",alt:"Close",onClick:t[0]||(t[0]=(...e)=>h.close&&h.close(...e))},d)])):(0,s.kq)("",!0),(0,s._)("div",u,[(0,s.WI)(e.$slots,"default",{onModalClose:t[1]||(t[1]=(...e)=>h.close&&h.close(...e))},void 0,!0)])],4)],2)],14,a)}n(7658);var p={name:"Modal",emits:["close","open"],props:{id:{type:String},title:{type:String},width:{type:[Number,String]},height:{type:[Number,String]},visible:{type:Boolean,default:!1},timeout:{type:[Number,String]},level:{type:Number,default:1}},data(){return{timeoutId:void 0,prevVisible:this.visible,isVisible:this.visible}},computed:{zIndex(){return 500+this.level}},methods:{close(){this.prevVisible=this.isVisible,this.isVisible=!1},hide(){this.close()},show(){this.prevVisible=this.isVisible,this.isVisible=!0},toggle(){this.isVisible?this.close():this.show()},onKeyUp(e){e.stopPropagation(),"Escape"===e.key&&this.close()}},mounted(){const e=this,t=t=>{t?e.$emit("open"):e.$emit("close"),e.isVisible=t};document.body.addEventListener("keyup",this.onKeyUp),this.$watch((()=>this.visible),t),this.$watch((()=>this.isVisible),t)},unmounted(){document.body.removeEventListener("keyup",this.onKeyUp)},updated(){if(this.prevVisible=this.isVisible,this.isVisible){let e=parseInt(getComputedStyle(this.$el).zIndex),t=[];for(const n of document.querySelectorAll(".modal-container:not(.hidden)")){const s=parseInt(getComputedStyle(n).zIndex);s>e?(e=s,t=[n]):s===e&&t.push(n)}(t.indexOf(this.$el)<0||t.length>1)&&(this.$el.style.zIndex=e+1)}if(this.isVisible&&this.timeout&&!this.timeoutId){const e=e=>()=>{e.close(),e.timeoutId=void 0};this.timeoutId=setTimeout(e(this),0+this.timeout)}}},f=n(3744);const m=(0,f.Z)(p,[["render",h],["__scopeId","data-v-09bd997a"]]);var g=m},6936:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var s=n(6252),i=n(9963),o=n(3577);const a=e=>((0,s.dD)("data-v-db648f4c"),e=e(),(0,s.Cn)(),e),l={class:"dialog-content"},r=a((()=>(0,s._)("i",{class:"fas fa-check"},null,-1))),c=a((()=>(0,s._)("i",{class:"fas fa-xmark"},null,-1)));function d(e,t,n,a,d,u){const h=(0,s.up)("Modal");return(0,s.wg)(),(0,s.j4)(h,{ref:"modal",title:n.title},{default:(0,s.w5)((()=>[(0,s._)("div",l,[(0,s.WI)(e.$slots,"default",{},void 0,!0)]),(0,s._)("form",{class:"buttons",onSubmit:t[4]||(t[4]=(0,i.iM)(((...e)=>u.onConfirm&&u.onConfirm(...e)),["prevent"]))},[(0,s._)("button",{type:"submit",class:"ok-btn",onClick:t[0]||(t[0]=(...e)=>u.onConfirm&&u.onConfirm(...e)),onTouch:t[1]||(t[1]=(...e)=>u.onConfirm&&u.onConfirm(...e))},[r,(0,s.Uk)("   "+(0,o.zw)(n.confirmText),1)],32),(0,s._)("button",{type:"button",class:"cancel-btn",onClick:t[2]||(t[2]=(...e)=>u.close&&u.close(...e)),onTouch:t[3]||(t[3]=(...e)=>u.close&&u.close(...e))},[c,(0,s.Uk)("   "+(0,o.zw)(n.cancelText),1)],32)],32)])),_:3},8,["title"])}var u=n(3493),h={emits:["input","click","touch"],components:{Modal:u.Z},props:{title:{type:String},confirmText:{type:String,default:"OK"},cancelText:{type:String,default:"Cancel"}},methods:{onConfirm(){this.$emit("input"),this.close()},show(){this.$refs.modal.show()},close(){this.$refs.modal.hide()}}},p=n(3744);const f=(0,p.Z)(h,[["render",d],["__scopeId","data-v-db648f4c"]]);var m=f},2544:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var s=n(6252),i=n(9963);const o=e=>((0,s.dD)("data-v-0bc64e95"),e=e(),(0,s.Cn)(),e),a=o((()=>(0,s._)("i",{class:"fas fa-clipboard"},null,-1))),l=[a];function r(e,t,n,o,a,r){return(0,s.wg)(),(0,s.iD)("button",{class:"copy-button",ref:"copyButton",title:"Copy to clipboard",onClick:t[0]||(t[0]=(0,i.iM)(((...e)=>r.copy&&r.copy(...e)),["prevent"])),onInput:t[1]||(t[1]=(0,i.iM)(((...e)=>r.copy&&r.copy(...e)),["prevent"]))},l,544)}var c=n(8637),d={name:"CopyButton",emits:["input","click"],mixins:[c.Z],props:{text:{type:String}},methods:{async copy(e){this.text?.length&&await this.copyToClipboard(this.text),this.$emit(e.type,e)}}},u=n(3744);const h=(0,u.Z)(d,[["render",r],["__scopeId","data-v-0bc64e95"]]);var p=h},2787:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var s=n(6252),i=n(9963),o=n(3577);const a={class:"dropdown-container"},l=["title"],r=["textContent"],c={class:"body-container hidden",ref:"dropdownContainer"};function d(e,t,n,d,u,h){const p=(0,s.up)("DropdownBody");return(0,s.wg)(),(0,s.iD)("div",a,[(0,s._)("button",{title:n.title,ref:"button",onClick:t[0]||(t[0]=(0,i.iM)((e=>h.toggle(e)),["stop"]))},[n.iconClass?((0,s.wg)(),(0,s.iD)("i",{key:0,class:(0,o.C_)(["icon",n.iconClass])},null,2)):(0,s.kq)("",!0),n.text?((0,s.wg)(),(0,s.iD)("span",{key:1,class:"text",textContent:(0,o.zw)(n.text)},null,8,r)):(0,s.kq)("",!0)],8,l),(0,s._)("div",c,[(0,s.Wm)(p,{id:n.id,keepOpenOnItemClick:n.keepOpenOnItemClick,ref:"dropdown",onClick:h.onClick},{default:(0,s.w5)((()=>[(0,s.WI)(e.$slots,"default",{},void 0,!0)])),_:3},8,["id","keepOpenOnItemClick","onClick"])],512)])}const u=["id"];function h(e,t,n,i,o,a){return(0,s.wg)(),(0,s.iD)("div",{class:"dropdown",id:n.id,onClick:t[0]||(t[0]=t=>e.$emit("click",t))},[(0,s.WI)(e.$slots,"default",{},void 0,!0)],8,u)}var p={emits:["click"],props:{id:{type:String},keepOpenOnItemClick:{type:Boolean,default:!1}}},f=n(3744);const m=(0,f.Z)(p,[["render",h],["__scopeId","data-v-14579c63"]]);var g=m,b=n(5250),w={components:{DropdownBody:g},emits:["click"],props:{id:{type:String},iconClass:{default:"fa fa-ellipsis-h"},text:{type:String},title:{type:String},keepOpenOnItemClick:{type:Boolean,default:!1}},data(){return{visible:!1}},computed:{buttonStyle(){return this.$refs.button?getComputedStyle(this.$refs.button):{}},buttonWidth(){return parseFloat(this.buttonStyle.width||0)},buttonHeight(){return parseFloat(this.buttonStyle.height||0)}},methods:{documentClickHndl(e){if(!this.visible)return;let t=e.target;while(t){if(t.classList.contains("dropdown"))return;t=t.parentElement}this.close()},getDropdownWidth(){const e=this.$refs.dropdown?.$el;return e?parseFloat(getComputedStyle(e).width):0},getDropdownHeight(){const e=this.$refs.dropdown?.$el;return e?parseFloat(getComputedStyle(e).height):0},onClick(){this.keepOpenOnItemClick||this.close()},close(){this.visible=!1,document.removeEventListener("click",this.documentClickHndl),b.$.emit("dropdown-close")},open(){document.addEventListener("click",this.documentClickHndl);const e=this.$refs.dropdown?.$el;e.parentElement||this.$el.appendChild(e),this.visible=!0,this.$refs.dropdownContainer.classList.remove("hidden"),this.$nextTick((()=>{const e=this.$refs.button.getBoundingClientRect(),t={left:e.left+window.scrollX,top:e.top+window.scrollY},n={left:t.left,top:t.top+this.buttonHeight},s=this.getDropdownWidth(),i=this.getDropdownHeight();n.left+s>(window.innerWidth+window.scrollX)/2&&(n.left-=s-this.buttonWidth),n.top+i>(window.innerHeight+window.scrollY)/2&&(n.top-=i+this.buttonHeight-10);const o=this.$refs.dropdown.$el;o.classList.add("fade-in"),o.style.top=`${n.top}px`,o.style.left=`${n.left}px`,b.$.emit("dropdown-open",this.$refs.dropdown),this.$refs.dropdownContainer.classList.add("hidden")}))},toggle(e){e.stopPropagation(),this.$emit("click"),this.visible?this.close():this.open()},onKeyUp(e){e.stopPropagation(),"Escape"===e.key&&this.close()}},mounted(){document.body.addEventListener("keyup",this.onKeyUp)},unmounted(){document.body.removeEventListener("keyup",this.onKeyUp)}};const y=(0,f.Z)(w,[["render",d],["__scopeId","data-v-3220f58b"]]);var v=y},815:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var s=n(6252),i=n(3577);const o={key:0,class:"col-2 icon"},a=["textContent"];function l(e,t,n,l,r,c){const d=(0,s.up)("Icon");return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["row item",n.itemClass]),onClick:t[0]||(t[0]=(...e)=>c.clicked&&c.clicked(...e))},[n.iconClass?.length||n.iconUrl?.length?((0,s.wg)(),(0,s.iD)("div",o,[(0,s.Wm)(d,{class:(0,i.C_)(n.iconClass),url:n.iconUrl},null,8,["class","url"])])):(0,s.kq)("",!0),(0,s._)("div",{class:(0,i.C_)(["text",{"col-10":null!=n.iconClass}]),textContent:(0,i.zw)(n.text)},null,10,a)],2)}var r=n(657),c=n(5250),d={components:{Icon:r.Z},props:{iconClass:{type:String},iconUrl:{type:String},text:{type:String},disabled:{type:Boolean,default:!1},itemClass:{}},methods:{clicked(){if(this.disabled)return!1;this.$parent.keepOpenOnItemClick||c.$.emit("dropdown-close")}}},u=n(3744);const h=(0,u.Z)(d,[["render",l],["__scopeId","data-v-1311e9ab"]]);var p=h},3901:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var s=n(6252),i=n(3577);const o=["title"];function a(e,t,n,a,l,r){const c=(0,s.up)("Icon");return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["floating-btn",r.className])},[(0,s._)("button",{type:"button",class:"btn btn-primary",title:n.title,onClick:t[0]||(t[0]=t=>e.$emit("click",t))},[(0,s.Wm)(c,{class:(0,i.C_)(n.iconClass),url:n.iconUrl},null,8,["class","url"])],8,o)],2)}var l=n(657),r={name:"FloatingButton",components:{Icon:l.Z},emits:["click"],props:{iconClass:{type:String},iconUrl:{type:String},class:{type:String},title:{type:String}},computed:{className(){return this.class}}},c=n(3744);const d=(0,c.Z)(r,[["render",a],["__scopeId","data-v-681f7492"]]);var u=d},657:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var s=n(6252),i=n(3577);const o={class:"icon-container"},a=["src","alt"];function l(e,t,n,l,r,c){return(0,s.wg)(),(0,s.iD)("div",o,[n.url?.length?((0,s.wg)(),(0,s.iD)("img",{key:0,class:"icon",src:n.url,alt:n.alt},null,8,a)):c.className?.length?((0,s.wg)(),(0,s.iD)("i",{key:1,class:(0,i.C_)(["icon",c.className]),style:(0,i.j5)({color:n.color})},null,6)):(0,s.kq)("",!0)])}var r={props:{class:{type:String},url:{type:String},color:{type:String,default:""},alt:{type:String,default:""}},computed:{className(){return this.class}}},c=n(3744);const d=(0,c.Z)(r,[["render",l],["__scopeId","data-v-706a3bd1"]]);var u=d},2717:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var s=n(6252);const i=e=>((0,s.dD)("data-v-2edff8b7"),e=e(),(0,s.Cn)(),e),o={class:"restart-btn-container"},a=i((()=>(0,s._)("i",{class:"fas fa-redo-alt"},null,-1)));function l(e,t,n,i,l,r){const c=(0,s.up)("ConfirmDialog");return(0,s.wg)(),(0,s.iD)("div",o,[(0,s.Wm)(c,{ref:"modal",onInput:r.restart},{default:(0,s.w5)((()=>[(0,s.Uk)(" Are you sure that you want to restart the application? ")])),_:1},8,["onInput"]),(0,s._)("button",{class:"btn btn-default restart-btn",onClick:t[0]||(t[0]=(...e)=>r.showDialog&&r.showDialog(...e)),onTouch:t[1]||(t[1]=(...e)=>r.showDialog&&r.showDialog(...e))},[a,(0,s.Uk)("   Restart Application ")],32)])}var r=n(6936),c=n(8637),d={name:"RestartButton",components:{ConfirmDialog:r.Z},mixins:[c.Z],methods:{showDialog(){this.$refs.modal.show()},async restart(){await this.request("application.restart")}}},u=n(3744);const h=(0,u.Z)(d,[["render",l],["__scopeId","data-v-2edff8b7"]]);var p=h},8735:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var s=n(6252),i=n(3577);const o={key:0,class:"icon"};function a(e,t,n,a,l,r){const c=(0,s.up)("Icon");return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["tab",n.selected?"selected":""]),onClick:t[0]||(t[0]=t=>e.$emit("input"))},[n.iconClass?.length||n.iconUrl?.length?((0,s.wg)(),(0,s.iD)("span",o,[(0,s.Wm)(c,{class:(0,i.C_)(n.iconClass),url:n.iconUrl},null,8,["class","url"])])):(0,s.kq)("",!0),(0,s.Uk)("   "),(0,s.WI)(e.$slots,"default",{},void 0,!0)],2)}var l=n(657),r={name:"Tab",components:{Icon:l.Z},emits:["input"],props:{selected:{type:Boolean,default:!1},iconClass:{type:String},iconUrl:{type:String}}},c=n(3744);const d=(0,c.Z)(r,[["render",a],["__scopeId","data-v-f3217d34"]]);var u=d},3176:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var s=n(6252);const i={class:"tabs"};function o(e,t,n,o,a,l){return(0,s.wg)(),(0,s.iD)("div",i,[(0,s.WI)(e.$slots,"default",{},void 0,!0)])}var a={name:"Tabs"},l=n(3744);const r=(0,l.Z)(a,[["render",o],["__scopeId","data-v-f4300bb0"]]);var c=r},8744:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Ie}});var s=n(6252),i=n(9963),o=n(3577);const a={class:"row plugin extensions-container"},l={class:"filter-container"},r=["disabled"],c={class:"items"},d={key:0,class:"extension"},u=["data-name","onClick"],h={class:"name"},p={key:0,class:"enabled icon",title:"Enabled"},f={key:0,class:"enabled icon fas fa-circle-check"},m={key:0,class:"extension-body-container until tablet"},g={key:0,class:"extension-body-container from desktop"};function b(e,t,n,b,w,y){const v=(0,s.up)("Loading"),k=(0,s.up)("Extension");return(0,s.wg)(),(0,s.iD)("div",a,[w.loading?((0,s.wg)(),(0,s.j4)(v,{key:0})):(0,s.kq)("",!0),(0,s._)("header",null,[(0,s._)("div",l,[(0,s.wy)((0,s._)("input",{type:"text",ref:"filter",placeholder:"Extension name","onUpdate:modelValue":t[0]||(t[0]=e=>w.filter=e),disabled:w.loading},null,8,r),[[i.nr,w.filter]])])]),(0,s._)("main",null,[(0,s._)("div",c,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(y.extensionNames,(e=>((0,s.wg)(),(0,s.iD)("div",{class:"extension-container",key:e},[y.matchesFilter(e)?((0,s.wg)(),(0,s.iD)("div",d,[(0,s._)("div",{class:(0,o.C_)(["item",{selected:e===w.selectedExtension}]),"data-name":e,onClick:t=>y.onClick(e,!1)},[(0,s._)("span",h,(0,o.zw)(y.extensions[e].name),1),y.enabledExtensions[e]?((0,s.wg)(),(0,s.iD)("span",p,[y.enabledExtensions[e]?((0,s.wg)(),(0,s.iD)("i",f)):(0,s.kq)("",!0)])):(0,s.kq)("",!0)],10,u),w.selectedExtension&&e===w.selectedExtension?((0,s.wg)(),(0,s.iD)("div",m,[(0,s.Wm)(k,{extension:y.extensions[w.selectedExtension],config:y.enabledExtensions[w.selectedExtension],"config-file":w.configFile},null,8,["extension","config","config-file"])])):(0,s.kq)("",!0)])):(0,s.kq)("",!0)])))),128))]),w.selectedExtension?((0,s.wg)(),(0,s.iD)("div",g,[(0,s.Wm)(k,{extension:y.extensions[w.selectedExtension],config:y.enabledExtensions[w.selectedExtension],"config-file":w.configFile},null,8,["extension","config","config-file"])])):(0,s.kq)("",!0)])])}var w=n(6791),y=n(8637);const v=e=>((0,s.dD)("data-v-3fa6b036"),e=e(),(0,s.Cn)(),e),k={class:"extension"},_=v((()=>(0,s._)("span",{class:"from tablet"},"Documentation",-1))),x=v((()=>(0,s._)("span",{class:"from tablet"},"Install",-1))),C=v((()=>(0,s._)("span",{class:"from tablet"},"Configuration",-1))),D={class:"extension-body"};function $(e,t,n,i,o,a){const l=(0,s.up)("Tab"),r=(0,s.up)("Tabs"),c=(0,s.up)("Doc"),d=(0,s.up)("Config"),u=(0,s.up)("Install");return(0,s.wg)(),(0,s.iD)("div",k,[(0,s._)("header",null,[(0,s.Wm)(r,null,{default:(0,s.w5)((()=>[(0,s.Wm)(l,{selected:"doc"===o.selectedTab,"icon-class":"fas fa-book",onInput:t[0]||(t[0]=e=>o.selectedTab="doc")},{default:(0,s.w5)((()=>[_])),_:1},8,["selected"]),(0,s.Wm)(l,{selected:"install"===o.selectedTab,"icon-class":"fas fa-download",onInput:t[1]||(t[1]=e=>o.selectedTab="install")},{default:(0,s.w5)((()=>[x])),_:1},8,["selected"]),(0,s.Wm)(l,{selected:"config"===o.selectedTab,"icon-class":"fas fa-square-check",onInput:t[2]||(t[2]=e=>o.selectedTab="config")},{default:(0,s.w5)((()=>[C])),_:1},8,["selected"])])),_:1})]),(0,s._)("div",D,["doc"===o.selectedTab?((0,s.wg)(),(0,s.j4)(c,{key:0,extension:n.extension},null,8,["extension"])):"config"===o.selectedTab?((0,s.wg)(),(0,s.j4)(d,{key:1,extension:n.extension,config:n.config,"config-file":n.configFile},null,8,["extension","config","config-file"])):"install"===o.selectedTab?((0,s.wg)(),(0,s.j4)(u,{key:2,extension:n.extension},null,8,["extension"])):(0,s.kq)("",!0)])])}var I=n(8735),T=n(3176);const S={key:0,class:"config-container current"},q=["innerHTML"],U=["innerHTML"];function E(e,t,n,i,a,l){const r=(0,s.up)("CopyButton");return(0,s.wg)(),(0,s.iD)(s.HY,null,[l.highlightedCurrentConfig?((0,s.wg)(),(0,s.iD)("div",S,[(0,s.Wm)(r,{text:a.curYamlConfig},null,8,["text"]),(0,s._)("pre",null,[(0,s._)("code",{class:"config-snippet",innerHTML:l.highlightedCurrentConfig},null,8,q)])])):(0,s.kq)("",!0),(0,s._)("div",{class:(0,o.C_)(["config-container snippet",{fullscreen:!l.highlightedCurrentConfig}])},[(0,s.Wm)(r,{text:n.extension.config_snippet},null,8,["text"]),(0,s._)("pre",null,[(0,s._)("code",{class:"config-snippet",innerHTML:l.highlightedConfigSnippet},null,8,U)])],2)],64)}n(8783),n(3465);var O=n(637),M=n(2544),Z={name:"Extension",mixins:[y.Z],components:{CopyButton:M.Z},props:{extension:{type:Object,required:!0},config:{type:Object},configFile:{type:String}},data(){return{curYamlConfig:null}},computed:{highlightedConfigSnippet(){return O.Z.highlight(`# Configuration template. You can add it to ${this.configFile}\n`+this.extension.config_snippet,{language:"yaml"}).value.trim()},highlightedCurrentConfig(){return this.curYamlConfig?O.Z.highlight("yaml","# Currently loaded configuration\n"+this.curYamlConfig).value.trim():null}},methods:{async loadCurrentConfig(){this.config?this.curYamlConfig=await this.request("utils.to_yaml",{obj:{[this.extension.name]:this.config}}):this.curYamlConfig=null}},mounted(){this.loadCurrentConfig(),this.$watch("config",this.loadCurrentConfig)}},P=n(3744);const j=(0,P.Z)(Z,[["render",E],["__scopeId","data-v-4634d8cb"]]);var N=j;const W=e=>((0,s.dD)("data-v-5aac2322"),e=e(),(0,s.Cn)(),e),R={class:"doc"},z=["href"],L=W((()=>(0,s._)("i",{class:"icon fas fa-book"},null,-1))),A=["innerHTML"],F={key:0,class:"actions"},H=W((()=>(0,s._)("h3",null,[(0,s._)("i",{class:"icon fas fa-play"}),(0,s.Uk)("   Actions ")],-1))),B=["href"],V={key:1,class:"events"},Y=W((()=>(0,s._)("h3",null,[(0,s._)("i",{class:"icon fas fa-flag"}),(0,s.Uk)("   Events ")],-1))),K=["href"];function J(e,t,n,i,a,l){return(0,s.wg)(),(0,s.iD)("section",R,[(0,s._)("header",null,[(0,s._)("h2",null,[(0,s._)("a",{class:"title",href:n.extension.doc_url,target:"_blank"},[L,(0,s.Uk)(" "+(0,o.zw)(n.extension.name),1)],8,z)])]),a.doc?((0,s.wg)(),(0,s.iD)("article",{key:0,onClick:t[0]||(t[0]=(...e)=>l.onDocClick&&l.onDocClick(...e))},[(0,s._)("div",{class:"doc-content",innerHTML:a.doc},null,8,A),Object.keys(n.extension.actions||{}).length>0?((0,s.wg)(),(0,s.iD)("div",F,[H,(0,s._)("ul",null,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(l.actionNames,(e=>((0,s.wg)(),(0,s.iD)("li",{class:"action",key:e},[(0,s._)("a",{href:`/#execute?action=${n.extension.name}.${e}`},(0,o.zw)(n.extension.name)+"."+(0,o.zw)(e),9,B)])))),128))])])):(0,s.kq)("",!0),Object.keys(n.extension.events||{}).length>0?((0,s.wg)(),(0,s.iD)("div",V,[Y,(0,s._)("ul",null,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(l.eventNames,(e=>((0,s.wg)(),(0,s.iD)("li",{class:"event",key:e},[(0,s._)("a",{href:n.extension.events[e].doc_url,target:"_blank"},(0,o.zw)(e),9,K)])))),128))])])):(0,s.kq)("",!0)])):(0,s.kq)("",!0)])}var X=n(5250),G={name:"Doc",mixins:[y.Z],props:{extension:{type:Object,required:!0}},data(){return{doc:null,localPageRegex:new RegExp("^/?#.*$")}},computed:{actionNames(){return Object.keys(this.extension.actions).sort()},eventNames(){return Object.keys(this.extension.events).sort()}},methods:{async parseDoc(){return this.extension.doc?.length?await this.request("utils.rst_to_html",{text:this.extension.doc}):null},refreshDoc(){this.parseDoc().then((e=>this.doc=e))},onDocClick(e){if("a"!==e.target.tagName.toLowerCase())return!0;e.preventDefault();const t=e.target.getAttribute("href");if(!t)return!0;if(t.match(this.localPageRegex))return window.location.href=t,!0;const n=t.match(/^https:\/\/docs\.platypush\.tech\/platypush\/(plugins|backend)\/([\w.]+)\.html#?.*$/);if(!n)return e.preventDefault(),window.open(t,"_blank"),!0;let[s,i]=n.slice(1);"backend"===s&&(i=`backend.${i}`),X.$.emit("update:extension",i),e.preventDefault()}},mounted(){this.refreshDoc(),this.$watch("extension.doc",this.refreshDoc)}};const Q=(0,P.Z)(G,[["render",J],["__scopeId","data-v-5aac2322"]]);var ee=Q;const te=e=>((0,s.dD)("data-v-738e2fde"),e=e(),(0,s.Cn)(),e),ne={class:"install-container"},se={class:"top"},ie=te((()=>(0,s._)("header",null,[(0,s._)("h2",null,"Dependencies")],-1))),oe={class:"body"},ae={class:"container install-cmd-container"},le=["innerHTML"],re={key:0,class:"buttons install-btn"},ce=["disabled"],de=te((()=>(0,s._)("i",{class:"fas fa-download"},null,-1))),ue={key:0,class:"bottom"},he=te((()=>(0,s._)("header",null,[(0,s._)("h2",null,"Output")],-1))),pe={class:"body"},fe={class:"container install-output",ref:"installOutput"},me=["textContent"],ge={key:0,class:"loading-container"};function be(e,t,n,i,a,l){const r=(0,s.up)("CopyButton"),c=(0,s.up)("RestartButton"),d=(0,s.up)("Loading");return(0,s.wg)(),(0,s.iD)("div",ne,[(0,s._)("section",se,[ie,(0,s._)("div",oe,[(0,s._)("div",ae,[(0,s.Wm)(r,{text:l.installCmd},null,8,["text"]),(0,s._)("pre",null,[(0,s._)("code",{innerHTML:l.highlightedInstallCmd},null,8,le)])]),l.installCmd?.length?((0,s.wg)(),(0,s.iD)("div",re,[a.installDone?((0,s.wg)(),(0,s.j4)(c,{key:0})):(0,s.kq)("",!0),(0,s._)("button",{type:"button",class:"btn btn-default",disabled:a.installRunning,onClick:t[0]||(t[0]=(...e)=>l.installExtension&&l.installExtension(...e))},[de,(0,s.Uk)(" Install ")],8,ce)])):(0,s.kq)("",!0)])]),a.installRunning||a.installOutput?((0,s.wg)(),(0,s.iD)("section",ue,[he,(0,s._)("div",pe,[(0,s._)("div",fe,[(0,s.Wm)(r,{text:a.installOutput},null,8,["text"]),(0,s._)("pre",null,[(0,s._)("code",{textContent:(0,o.zw)(a.installOutput)},null,8,me),a.installRunning?((0,s.wg)(),(0,s.iD)("div",ge,[(0,s.Uk)("\n "),(0,s.Wm)(d),(0,s.Uk)("\n ")])):(0,s.kq)("",!0)])],512)])])):(0,s.kq)("",!0)])}var we=n(2717),ye={name:"Install",mixins:[y.Z],emit:["install-start","install-end"],components:{CopyButton:M.Z,Loading:w.Z,RestartButton:we.Z},props:{extension:{type:Object,required:!0}},data(){return{installRunning:!1,installDone:!1,installOutput:null,pendingCommands:0,error:null}},computed:{installCmd(){const e=this.extension.deps.install_cmd.join("\n").trim();return e?.length?e:null},highlightedInstallCmd(){return O.Z.highlight(this.installCmd?this.extension.deps.install_cmd.map((e=>`$ ${e}`)).join("\n").trim():"# No extra installation steps required",{language:"bash"}).value}},methods:{wsProcess(e){try{const t="https:"===window.location.protocol?"wss":"ws",n=`${t}://${location.host}${e}`,s=new WebSocket(n);s.onmessage=this.onMessage,s.onerror=this.onError,s.onclose=this.onClose}catch(t){this.notify({error:!0,title:"Websocket initialization error",text:t.toString()}),console.error("Websocket initialization error"),console.error(t),this.error=t,this.installRunning=!1}},onMessage(e){this.installOutput||(this.installOutput=""),this.installOutput+=e.data},onClose(){this.installRunning=!1,this.$emit("install-end",this.extension),this.error||(this.installDone=!0),this.notify({title:"Extension installed",html:`Extension <b>${this.extension.name}</b> installed successfully`,image:{iconClass:"fas fa-check"}})},onError(e){this.notify({error:!0,title:"Websocket error",text:e.toString()}),console.error("Websocket error"),console.error(e),this.error=e,this.installRunning=!1},installExtension(){this.error=null,this.installRunning=!0,this.installOutput="",this.$emit("install-start",this.extension);const e=(this.extension.deps.install_cmd||[]).join(";\n");this.request("shell.exec",{cmd:e,ws:!0}).then((e=>{this.wsProcess(e.ws_path)})).catch((e=>{this.error=e,this.installRunning=!1,this.$emit("install-end",this.extension)}))}},mounted(){this.$watch("installOutput",(()=>{this.$nextTick((()=>{this.$refs.installOutput.focus(),this.$refs.installOutput.scrollTop=this.$refs.installOutput.scrollHeight}))}))}};const ve=(0,P.Z)(ye,[["render",be],["__scopeId","data-v-738e2fde"]]);var ke=ve,_e={name:"Extension",components:{Config:N,Doc:ee,Install:ke,Tab:I.Z,Tabs:T.Z},props:{extension:{type:Object,required:!0},config:{type:Object},configFile:{type:String}},data(){return{selectedTab:"doc"}}};const xe=(0,P.Z)(_e,[["render",$],["__scopeId","data-v-3fa6b036"]]);var Ce=xe,De={name:"Extensions",mixins:[y.Z],components:{Extension:Ce,Loading:w.Z},data(){return{loading:!1,plugins:{},backends:{},enabledPlugins:{},enabledBackends:{},filter:"",selectedExtension:null,configFile:null,config:{}}},computed:{extensions(){const e={};return Object.entries(this.plugins).forEach((([t,n])=>{e[t]={...n,name:t}})),Object.entries(this.backends).forEach((([t,n])=>{t=`backend.${t}`,e[t]={...n,name:t}})),e},enabledExtensions(){return[this.enabledPlugins,this.enabledBackends].reduce(((e,t)=>(Object.entries(t).forEach((([t,n])=>{e[t]=n})),e)),{})},extensionNames(){return Object.keys(this.extensions).sort()}},methods:{onClick(e,t=!0,n=!0){this.selectedExtension===e?this.selectedExtension=null:this.onInput(e,t,n)},onInput(e,t=!0,n=!0){t&&(this.filter=e);const s=e?.toLowerCase()?.trim();if(s?.length&&this.extensions[s]){this.selectedExtension=s,n&&this.setUrlArgs({extension:s});const e=this.$el.querySelector(`.extensions-container .item[data-name="${s}"]`);e&&e.scrollIntoView({behavior:"smooth"})}else this.selectedExtension=null,n&&this.setUrlArgs({})},matchesFilter(e){return!this.filter||e.includes(this.filter.toLowerCase())},async loadExtensions(){this.loading=!0;let[e,t]=[[],[]];try{[this.plugins,this.backends,e,t,this.config]=await Promise.all([this.request("inspect.get_all_plugins"),this.request("inspect.get_all_backends"),this.request("inspect.get_enabled_plugins"),this.request("inspect.get_enabled_backends"),this.request("inspect.get_config")])}finally{this.loading=!1}this.enabledPlugins=e.reduce(((e,t)=>(e[t]=this.config[t]||{},e)),{}),this.enabledBackends=t.reduce(((e,t)=>(t=`backend.${t}`,e[t]=this.config[t]||{},e)),{}),this.loadExtensionFromUrl(),this.$watch("$route.hash",(()=>this.loadExtensionFromUrl()))},async loadConfigFile(){this.configFile=await this.request("config.get_config_file")},loadExtensionFromUrl(){const e=this.getUrlArgs().extension;e&&this.$nextTick((()=>this.onInput(e,!1,!1)))}},mounted(){this.loadConfigFile(),this.loadExtensions(),X.$.on("update:extension",(e=>this.onInput(e,!1))),this.$nextTick((()=>this.$refs.filter.focus()))}};const $e=(0,P.Z)(De,[["render",b],["__scopeId","data-v-985c93da"]]);var Ie=$e},8369:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ve}});var s=n(6252);const i={class:"settings-container"};function o(e,t,n,o,a,l){const r=(0,s.up)("Application"),c=(0,s.up)("Users"),d=(0,s.up)("Token");return(0,s.wg)(),(0,s.iD)("div",i,[(0,s._)("main",null,["application"===n.selectedPanel?((0,s.wg)(),(0,s.j4)(r,{key:0})):(0,s.kq)("",!0),"users"===n.selectedPanel&&a.currentUser?((0,s.wg)(),(0,s.j4)(c,{key:1,"session-token":a.sessionToken,"current-user":a.currentUser},null,8,["session-token","current-user"])):"tokens"===n.selectedPanel&&a.currentUser?((0,s.wg)(),(0,s.j4)(d,{key:2,"session-token":a.sessionToken,"current-user":a.currentUser},null,8,["session-token","current-user"])):(0,s.kq)("",!0)])])}const a={class:"app-container"},l={class:"btn-container"},r={class:"btn-container"};function c(e,t,n,i,o,c){const d=(0,s.up)("RestartButton"),u=(0,s.up)("StopButton");return(0,s.wg)(),(0,s.iD)("div",a,[(0,s._)("div",l,[(0,s.Wm)(d)]),(0,s._)("div",r,[(0,s.Wm)(u)])])}var d=n(2717);const u=e=>((0,s.dD)("data-v-1eab04fa"),e=e(),(0,s.Cn)(),e),h={class:"stop-btn-container"},p=u((()=>(0,s._)("br",null,null,-1))),f=u((()=>(0,s._)("br",null,null,-1))),m=u((()=>(0,s._)("span",{class:"text-danger"}," This will stop the application and you will not be able to restart it through the Web interface! ",-1))),g=u((()=>(0,s._)("i",{class:"fas fa-stop"},null,-1)));function b(e,t,n,i,o,a){const l=(0,s.up)("ConfirmDialog");return(0,s.wg)(),(0,s.iD)("div",h,[(0,s.Wm)(l,{ref:"modal",onInput:a.stop},{default:(0,s.w5)((()=>[(0,s.Uk)(" Are you sure that you want to stop the application? "),p,f,m])),_:1},8,["onInput"]),(0,s._)("button",{class:"btn btn-default stop-btn",onClick:t[0]||(t[0]=(...e)=>a.showDialog&&a.showDialog(...e)),onTouch:t[1]||(t[1]=(...e)=>a.showDialog&&a.showDialog(...e))},[g,(0,s.Uk)("   Stop Application ")],32)])}var w=n(6936),y=n(8637),v={name:"StopButton",components:{ConfirmDialog:w.Z},mixins:[y.Z],methods:{showDialog(){this.$refs.modal.show()},async stop(){await this.request("application.stop")}}},k=n(3744);const _=(0,k.Z)(v,[["render",b],["__scopeId","data-v-1eab04fa"]]);var x=_,C={name:"Application",components:{RestartButton:d.Z,StopButton:x}};const D=(0,k.Z)(C,[["render",c],["__scopeId","data-v-40365cea"]]);var $=D,I=n(3577),T=n(9963);const S={class:"token-container"},q={class:"token-container"},U=(0,s._)("label",null,[(0,s.Uk)(" This is your generated token. Treat it carefully and do not share it with untrusted parties."),(0,s._)("br"),(0,s.Uk)(" Also, make sure to save it - it WILL NOT be displayed again. ")],-1),E=["textContent"],O={class:"token-container"},M=(0,s._)("label",null," This is your current session token. It will be invalidated once you log out of the current session. ",-1),Z=["textContent"],P={class:"body"},j=(0,s.uE)('<div class="description"><p> Platypush provides two types of tokens: <ul><li><b>JWT tokens</b> are bearer-only, and they contain encrypted authentication information.<br> They can be used as permanent or time-based tokens to authenticate with the Platypush API. </li><li><b>Session tokens</b> are randomly generated tokens stored on the application database. A session token generated in this session will expire when you log out of it. </li></ul></p><p>Generate a JWT authentication token that can be used for API calls to the <code>/execute</code> endpoint.</p><br><p>You can include the token in your requests in any of the following ways:</p><ul><li>Specify it on the <code>Authorization: Bearer</code> header;</li><li>Specify it on the <code>X-Token</code> header;</li><li> Specify it as a URL parameter: <code>http://site:8008/execute?token=...</code> for a JWT token and <code>...?session_token=...</code> for a session token; </li><li>Specify it on the body of your JSON request: <code>{&quot;type&quot;:&quot;request&quot;, &quot;action&quot;, &quot;...&quot;, &quot;token&quot;:&quot;...&quot;}</code> for a JWT token, or <code>&quot;session_token&quot;</code> for a session token. </li></ul><p>Confirm your credentials in order to generate a new JWT token.</p><p><i>Show session token</i> will instead show the token cookie associated to the current session. </p></div>',1),N={class:"form-container"},W=(0,s._)("span",null,"Username",-1),R=["value"],z=(0,s._)("label",null,[(0,s._)("span",null,"Confirm password"),(0,s._)("span",null,[(0,s._)("input",{type:"password",name:"password"})])],-1),L=(0,s._)("label",null,[(0,s._)("span",null,"Token validity in days"),(0,s._)("span",null,[(0,s._)("input",{type:"text",name:"validityDays"})]),(0,s._)("span",{class:"note"},[(0,s.Uk)(" Decimal values are also supported - e.g. "),(0,s._)("i",null,"0.5"),(0,s.Uk)(" means half a day (12 hours). An empty or zero value means that the token has no expiry date. ")])],-1),A=(0,s._)("label",null,[(0,s._)("input",{type:"submit",class:"btn btn-primary",value:"Generate JWT token"})],-1);function F(e,t,n,i,o,a){const l=(0,s.up)("Loading"),r=(0,s.up)("Modal");return(0,s.wg)(),(0,s.iD)("div",S,[o.loading?((0,s.wg)(),(0,s.j4)(l,{key:0})):(0,s.kq)("",!0),(0,s.Wm)(r,{ref:"tokenModal"},{default:(0,s.w5)((()=>[(0,s._)("div",q,[U,(0,s._)("textarea",{class:"token",textContent:(0,I.zw)(o.token),onFocus:t[0]||(t[0]=(...e)=>a.onTokenSelect&&a.onTokenSelect(...e))},null,40,E)])])),_:1},512),(0,s.Wm)(r,{ref:"sessionTokenModal"},{default:(0,s.w5)((()=>[(0,s._)("div",O,[M,(0,s._)("textarea",{class:"token",textContent:(0,I.zw)(n.sessionToken),onFocus:t[1]||(t[1]=(...e)=>a.onTokenSelect&&a.onTokenSelect(...e))},null,40,Z)])])),_:1},512),(0,s._)("div",P,[j,(0,s._)("div",N,[(0,s._)("form",{onSubmit:t[3]||(t[3]=(0,T.iM)(((...e)=>a.generateToken&&a.generateToken(...e)),["prevent"])),ref:"generateTokenForm"},[(0,s._)("label",null,[W,(0,s._)("span",null,[(0,s._)("input",{type:"text",name:"username",value:n.currentUser.username,disabled:""},null,8,R)])]),z,L,A,(0,s._)("label",null,[(0,s._)("input",{type:"button",class:"btn btn-default",value:"Show session token",onClick:t[2]||(t[2]=(0,T.iM)((t=>e.$refs.sessionTokenModal.show()),["stop"]))})])],544)])])])}var H=n(6154),B=n(6791),V=n(3493),Y={name:"Token",components:{Modal:V.Z,Loading:B.Z},mixins:[y.Z],props:{currentUser:{type:Object,required:!0},sessionToken:{type:String,required:!0}},data(){return{loading:!1,token:null}},methods:{async generateToken(e){const t=this.currentUser.username,n=e.target.password.value;let s=e.target.validityDays?.length?parseInt(e.target.validityDays.value):0;s||(s=null),this.loading=!0;try{this.token=(await H.Z.post("/auth",{username:t,password:n,expiry_days:s})).data.token,this.token?.length&&this.$refs.tokenModal.show()}catch(i){console.error(i.toString()),this.notify({text:i.toString(),error:!0})}finally{this.loading=!1}},onTokenSelect(e){e.target.select(),document.execCommand("copy"),this.notify({text:"Token copied to clipboard",image:{iconClass:"fa fa-check"}})}}};const K=(0,k.Z)(Y,[["render",F]]);var J=K;const X=["disabled"],G=["disabled"],Q=["disabled"],ee=["disabled"],te=["value"],ne=["disabled"],se=["disabled"],ie=["disabled"],oe=["disabled"],ae={class:"body"},le={class:"users-list"},re=["onClick"],ce=["textContent"],de={class:"actions pull-right col-4"};function ue(e,t,n,i,o,a){const l=(0,s.up)("Loading"),r=(0,s.up)("Modal"),c=(0,s.up)("DropdownItem"),d=(0,s.up)("Dropdown"),u=(0,s.up)("FloatingButton"),h=(0,s.up)("ConfirmDialog");return(0,s.wg)(),(0,s.iD)(s.HY,null,[o.loading?((0,s.wg)(),(0,s.j4)(l,{key:0})):(0,s.kq)("",!0),(0,s.Wm)(r,{ref:"addUserModal",title:"Add User"},{default:(0,s.w5)((()=>[(0,s._)("form",{action:"#",method:"POST",ref:"addUserForm",onSubmit:t[0]||(t[0]=(...e)=>a.createUser&&a.createUser(...e))},[(0,s._)("label",null,[(0,s._)("input",{type:"text",name:"username",placeholder:"Username",disabled:o.commandRunning},null,8,X)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"password",placeholder:"Password",disabled:o.commandRunning},null,8,G)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"confirm_password",placeholder:"Confirm password",disabled:o.commandRunning},null,8,Q)]),(0,s._)("label",null,[(0,s._)("input",{type:"submit",class:"btn btn-primary",value:"Create User",disabled:o.commandRunning},null,8,ee)])],544)])),_:1},512),(0,s.Wm)(r,{ref:"changePasswordModal",title:"Change Password"},{default:(0,s.w5)((()=>[(0,s._)("form",{action:"#",method:"POST",ref:"changePasswordForm",onSubmit:t[1]||(t[1]=(...e)=>a.changePassword&&a.changePassword(...e))},[(0,s._)("label",null,[(0,s._)("input",{type:"text",name:"username",placeholder:"Username",value:o.selectedUser,disabled:"disabled"},null,8,te)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"password",placeholder:"Current password",disabled:o.commandRunning},null,8,ne)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"new_password",placeholder:"New password",disabled:o.commandRunning},null,8,se)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"confirm_new_password",placeholder:"Confirm new password",disabled:o.commandRunning},null,8,ie)]),(0,s._)("label",null,[(0,s._)("input",{type:"submit",class:"btn btn-primary",value:"Change Password",disabled:o.commandRunning},null,8,oe)])],544)])),_:1},512),(0,s._)("div",ae,[(0,s._)("ul",le,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(o.users,(n=>((0,s.wg)(),(0,s.iD)("li",{key:n.user_id,class:"item user",onClick:e=>o.selectedUser=n.username},[(0,s._)("div",{class:"name col-8",textContent:(0,I.zw)(n.username)},null,8,ce),(0,s._)("div",de,[(0,s.Wm)(d,{title:"User Actions","icon-class":"fa fa-ellipsis"},{default:(0,s.w5)((()=>[(0,s.Wm)(c,{text:"Change Password",disabled:o.commandRunning,"icon-class":"fa fa-key",onClick:e=>a.showChangePasswordModal(n)},null,8,["disabled","onClick"]),(0,s.Wm)(c,{text:"Delete User",disabled:o.commandRunning,"icon-class":"fa fa-trash",onClick:t[2]||(t[2]=t=>e.$refs.deleteUserDialog.show())},null,8,["disabled"])])),_:2},1024)])],8,re)))),128))]),(0,s.Wm)(u,{"icon-class":"fa fa-plus",text:"Add User",onClick:a.showAddUserModal},null,8,["onClick"]),(0,s.Wm)(h,{ref:"deleteUserDialog",onInput:t[3]||(t[3]=e=>a.deleteUser(o.selectedUser))},{default:(0,s.w5)((()=>[(0,s.Uk)(" Are you sure that you want to remove the user "+(0,I.zw)(o.selectedUser)+"? ",1)])),_:1},512)])],64)}var he=n(2787),pe=n(815),fe=n(3901),me={name:"Users",components:{ConfirmDialog:w.Z,Dropdown:he.Z,DropdownItem:pe.Z,FloatingButton:fe.Z,Loading:B.Z,Modal:V.Z},mixins:[y.Z],props:{sessionToken:{type:String,required:!0},currentUser:{type:Object,required:!0}},data(){return{users:[],commandRunning:!1,loading:!1,selectedUser:null}},methods:{async refresh(){this.loading=!0;try{this.users=await this.request("user.get_users")}finally{this.loading=!1}},async createUser(e){e.preventDefault();const t=[...this.$refs.addUserForm.querySelectorAll("input[name]")].reduce(((e,t)=>(e[t.name]=t.value,e)),{});if(t.password===t.confirm_password){this.commandRunning=!0;try{await this.request("user.create_user",{username:t.username,password:t.password,session_token:this.sessionToken})}finally{this.commandRunning=!1}this.notify({text:"User "+t.username+" created",image:{iconClass:"fas fa-check"}}),this.$refs.addUserModal.close(),await this.refresh()}else this.notify({title:"Unable to create user",text:"Please check that the passwords match",error:!0,image:{iconClass:"fas fa-times"}})},async changePassword(e){e.preventDefault();const t=[...this.$refs.changePasswordForm.querySelectorAll("input[name]")].reduce(((e,t)=>(e[t.name]=t.value,e)),{});if(t.new_password!==t.confirm_new_password)return void this.notify({title:"Unable to update password",text:"Please check that the passwords match",error:!0,image:{iconClass:"fas fa-times"}});this.commandRunning=!0;let n=!1;try{n=await this.request("user.update_password",{username:t.username,old_password:t.password,new_password:t.new_password})}finally{this.commandRunning=!1}n?(this.$refs.changePasswordModal.close(),this.notify({text:"Password successfully updated",image:{iconClass:"fas fa-check"}})):this.notify({title:"Unable to update password",text:"The current password is incorrect",error:!0,image:{iconClass:"fas fa-times"}})},async deleteUser(e){this.commandRunning=!0;try{await this.request("user.delete_user",{username:e,session_token:this.sessionToken})}finally{this.commandRunning=!1}this.notify({text:`User ${e} removed`,image:{iconClass:"fas fa-check"}}),this.selectedUser=null,await this.refresh()},showAddUserModal(){this.$refs.addUserModal.show(),this.$nextTick((()=>{this.$refs.addUserForm.reset(),this.$refs.addUserForm.username.focus()}))},showChangePasswordModal(e){this.$refs.changePasswordModal.show(),this.$nextTick((()=>{this.$refs.changePasswordForm.password.focus(),this.selectedUser=e.username}))}},mounted(){this.refresh()}};const ge=(0,k.Z)(me,[["render",ue],["__scopeId","data-v-510035f2"]]);var be=ge,we={name:"Settings",components:{Application:$,Users:be,Token:J},mixins:[y.Z],props:{selectedPanel:{type:String}},data(){return{currentUser:null,sessionToken:null}},methods:{async refresh(){this.sessionToken=this.getCookies()["session_token"],this.currentUser=await this.request("user.get_user_by_session",{session_token:this.sessionToken})}},mounted(){this.refresh()}};const ye=(0,k.Z)(we,[["render",o]]);var ve=ye},3379:function(e,t,n){var s={"./Alarm/Index":[1949,2471,2844,2461,2992,1807,1869,6062,1949],"./Camera/Index":[5324,8039,5324],"./CameraAndroidIpcam/Index":[5794,5794],"./CameraCv/Index":[6148,8039,6148],"./CameraFfmpeg/Index":[9334,8039,9334],"./CameraGstreamer/Index":[813,8039,813],"./CameraIrMlx90640/Index":[7381,8039,7381],"./CameraPi/Index":[5214,8039,8895],"./Entities/Index":[7878,2992,669,2154,6062,7878],"./Execute/Index":[4221,1807,4221],"./Extensions/Index":[8744],"./Light/Index":[7184,2471,2844,7184],"./LightHue/Index":[2976,2471,2844,7184,2976],"./Media/Index":[8260,2471,5962,2461,6079,8260],"./Media/Providers/YouTube/Index":[2200,2200],"./MediaMplayer/Index":[3518,2471,5962,2461,6079,8260,3518],"./MediaMpv/Index":[4765,2471,5962,2461,6079,8260,4765],"./MediaOmxplayer/Index":[7819,2471,5962,2461,6079,8260,7819],"./MediaVlc/Index":[2614,2471,5962,2461,6079,8260,2614],"./Music/Index":[4497,2471,5962,4497],"./MusicMpd/Index":[1309,2471,5962,4497,1309],"./MusicSnapcast/Index":[7067,2471,2844,7067],"./MusicSpotify/Index":[2068,2471,5962,4497,2068],"./Rtorrent/Index":[2183,6079,7968,2183],"./Settings/Index":[8369],"./Sound/Index":[746,746],"./Torrent/Index":[8784,6079,7968,8784],"./Tts/Index":[3732,8069,3732],"./TtsGoogle/Index":[7605,8069,2853],"./TvSamsungWs/Index":[4589,4589],"./ZigbeeMqtt/Index":[1259,2471,2844,1259],"./Zwave/Index":[2732,2471,2844,7880,2732],"./ZwaveMqtt/Index":[1088,2471,2844,7880,1088]};function i(e){if(!n.o(s,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=s[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(i)}))}i.keys=function(){return Object.keys(s)},i.id=3379,e.exports=i},6725:function(e,t,n){var s={"./Calendar/Index":[5638,5638],"./Camera/Index":[446,446],"./Component/Index":[1449,2471,2844,1449],"./DateTime/Index":[4619,1391,4619],"./DateTimeWeather/Index":[9962,5193,1391,9962],"./ImageCarousel/Index":[306,5193,1391,306],"./Music/Index":[311,311],"./Plugin/Index":[8179,8179],"./RssNews/Index":[6523,6523],"./Weather/Index":[5193,5193]};function i(e){if(!n.o(s,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=s[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(i)}))}i.keys=function(){return Object.keys(s)},i.id=6725,e.exports=i},1359:function(e){"use strict";e.exports=JSON.parse('{"alarm":{"class":"fas fa-stopwatch"},"arduino":{"class":"fas fa-microchip"},"assistant.google":{"class":"fas fa-microphone-lines"},"bluetooth":{"class":"fab fa-bluetooth"},"camera.android.ipcam":{"class":"fab fa-android"},"camera.cv":{"class":"fas fa-camera"},"camera.ffmpeg":{"class":"fas fa-camera"},"camera.gstreamer":{"class":"fas fa-camera"},"camera.ir.mlx90640":{"class":"fas fa-sun"},"camera.pi":{"class":"fas fa-camera"},"entities":{"class":"fa fa-home"},"execute":{"class":"fa fa-play"},"extensions":{"class":"fas fa-puzzle-piece"},"light.hue":{"class":"fas fa-lightbulb"},"linode":{"class":"fas fa-cloud"},"media.jellyfin":{"imgUrl":"/icons/jellyfin.svg"},"media.kodi":{"imgUrl":"/icons/kodi.svg"},"media.omxplayer":{"class":"fa fa-film"},"media.mplayer":{"class":"fa fa-film"},"media.mpv":{"class":"fa fa-film"},"media.plex":{"imgUrl":"/icons/plex.svg"},"media.vlc":{"class":"fa fa-film"},"music.mpd":{"class":"fas fa-music"},"music.snapcast":{"class":"fa fa-volume-up"},"music.spotify":{"class":"fab fa-spotify"},"ping":{"class":"fas fa-server"},"torrent":{"class":"fa fa-magnet"},"rtorrent":{"class":"fa fa-magnet"},"sensor.bme280":{"class":"fas fa-microchip"},"sensor.dht":{"class":"fas fa-microchip"},"sensor.envirophat":{"class":"fas fa-microchip"},"sensor.ltr559":{"class":"fas fa-microchip"},"sensor.mcp3008":{"class":"fas fa-microchip"},"sensor.pmw3901":{"class":"fas fa-microchip"},"sensor.vl53l1x":{"class":"fas fa-microchip"},"serial":{"class":"fab fa-usb"},"smartthings":{"imgUrl":"/icons/smartthings.png"},"switches":{"class":"fas fa-toggle-on"},"switch.switchbot":{"class":"fas fa-toggle-on"},"switch.tplink":{"class":"fas fa-toggle-on"},"switchbot":{"class":"fas fa-toggle-on"},"sound":{"class":"fa fa-microphone"},"system":{"class":"fas fa-microchip"},"tts":{"class":"far fa-comment"},"tts.google":{"class":"fas fa-comment"},"tv.samsung.ws":{"class":"fas fa-tv"},"variable":{"class":"fas fa-square-root-variable"},"weather.buienradar":{"class":"fas fa-cloud-sun-rain"},"weather.openweathermap":{"class":"fas fa-cloud-sun-rain"},"zigbee.mqtt":{"imgUrl":"/icons/zigbee.svg"},"zwave":{"imgUrl":"/icons/z-wave.png"},"zwave.mqtt":{"imgUrl":"/icons/z-wave.png"}}')}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,n),o.exports}n.m=e,function(){var e=[];n.O=function(t,s,i,o){if(!s){var a=1/0;for(d=0;d<e.length;d++){s=e[d][0],i=e[d][1],o=e[d][2];for(var l=!0,r=0;r<s.length;r++)(!1&o||a>=o)&&Object.keys(n.O).every((function(e){return n.O[e](s[r])}))?s.splice(r--,1):(l=!1,o<a&&(a=o));if(l){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[s,i,o]}}(),function(){n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,{a:t}),t}}(),function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};n.t=function(s,i){if(1&i&&(s=this(s)),8&i)return s;if("object"===typeof s&&s){if(4&i&&s.__esModule)return s;if(16&i&&"function"===typeof s.then)return s}var o=Object.create(null);n.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var l=2&i&&s;"object"==typeof l&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((function(e){a[e]=function(){return s[e]}}));return a["default"]=function(){return s},n.d(o,a),o}}(),function(){n.d=function(e,t){for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}}(),function(){n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,s){return n.f[s](e,t),t}),[]))}}(),function(){n.u=function(e){return"static/js/"+e+"."+{65:"ae7df477",169:"ebdd7044",306:"a654daef",311:"f32aa7b9",446:"453dede2",472:"e4c28199",667:"50a291a6",669:"67b2777b",729:"ba752a1b",746:"d8626378",813:"fb637a75",984:"d599d072",1088:"811c36c9",1259:"dbcb4f7c",1309:"c50c7c5d",1322:"97f4fedc",1391:"a76844c2",1449:"d383429f",1706:"5142eaa5",1807:"4ba7d261",1869:"dfb6d223",1949:"78095338",2068:"58a9b93a",2106:"00c755d8",2154:"81668bf2",2183:"0851f006",2200:"82db69e7",2217:"6b927594",2460:"567e73f6",2461:"a2008efc",2471:"da49c64a",2614:"579799b8",2732:"a3a54d65",2804:"c59fb840",2844:"288f7727",2853:"52711ae0",2892:"179b93be",2893:"519a1554",2976:"bbbc8952",2992:"efd583f8",3322:"12d6bfa0",3368:"0cff7037",3369:"bf44abe0",3390:"3545ba6d",3518:"cc276df3",3557:"44709c4a",3559:"df95d103",3661:"ebdb7d5d",3671:"8c2bb698",3732:"2e772785",3798:"16678c59",3826:"cc264dd1",3835:"f37b0b12",3924:"07fb6660",4221:"bc7a9515",4497:"48f2300f",4589:"f7212e88",4619:"2b7e4216",4765:"0a4e8afb",4790:"7514123b",5193:"4d134540",5207:"7f241e21",5290:"aaba8f2b",5324:"1ec90ff8",5329:"d855e760",5578:"216dad38",5638:"7b12f2d2",5762:"8e831e89",5794:"9859b34c",5795:"e22f5747",5906:"5eaf69b5",5962:"8488ea6d",6062:"7c0fec11",6079:"b020e16c",6123:"e1e59c18",6148:"653a45a9",6324:"254647db",6362:"95da0eb4",6523:"bef9dd6e",6561:"fc5ef77b",6640:"a6538b3b",7067:"96ec64d6",7184:"c64a25db",7381:"84a86f84",7523:"071c4563",7590:"6cda174b",7819:"5b61da37",7878:"f549ed39",7880:"fd2b2cde",7968:"385eb36d",8039:"951792f1",8069:"51c1e8b1",8179:"7d8455aa",8260:"db036ab7",8391:"2706162d",8498:"b92a2952",8621:"074ab290",8769:"5ea5c0cb",8784:"458e26a1",8825:"ae7e9d47",8895:"fa78e0db",8930:"81ced495",8957:"7113d8bf",8989:"d29a4bdb",9091:"8f996e37",9334:"154d9a65",9516:"4b9851c1",9962:"e22a73cc"}[e]+".js"}}(),function(){n.miniCssF=function(e){return"static/css/"+e+"."+{65:"8fe44ae9",169:"c86e450f",306:"f9663a79",311:"68693ced",446:"5bdbb764",472:"febea0e9",669:"7e935ec0",729:"a45ea68d",746:"6413605d",984:"59a361ef",1259:"e599e60c",1322:"8b0fd380",1391:"1806cc6b",1449:"4480d2a5",1706:"87427ff3",1807:"2101d15a",1869:"0d414037",1949:"43b1359d",2154:"dede5287",2217:"9608535a",2460:"c00d2681",2461:"a07ac513",2471:"3bcc7582",2844:"f6b43236",2892:"128f28c4",2893:"0bd3e282",2976:"23a97faa",2992:"1556579d",3368:"7aba956e",3369:"1fba6ed0",3390:"cda00ed5",3557:"e2e81a4f",3559:"6f35cf5d",3661:"61bbb983",3671:"8a4d4660",3798:"a08671cc",3826:"57d1b182",3835:"870845e1",3924:"d88da479",4221:"8aeedd79",4497:"8d800895",4589:"ae0da96d",4790:"748a2a88",5193:"441f6659",5207:"e1870f53",5290:"7516df30",5329:"988ac59d",5638:"6fd55ab0",5794:"04f347eb",5795:"554d600c",5906:"5edcf89b",5962:"c98ec47f",6062:"68815074",6079:"bf97328b",6324:"d51a17a6",6523:"b8cc15c4",6561:"9ac15bdf",7067:"5b6d248f",7184:"6dc06f19",7523:"67447cc4",7590:"70a42f14",7878:"76503d21",7880:"11e4a16e",7968:"0f104f99",8039:"e717dd5f",8069:"a9db7b3a",8179:"bbd5a2a3",8260:"2f885dfd",8391:"83ca69e4",8498:"67b6abee",8621:"e153864e",8769:"6d130260",8825:"2cb9d6e3",8989:"40890487",9962:"de2923cc"}[e]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="platypush:";n.l=function(s,i,o,a){if(e[s])e[s].push(i);else{var l,r;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==s||u.getAttribute("data-webpack")==t+o){l=u;break}}l||(r=!0,l=document.createElement("script"),l.charset="utf-8",l.timeout=120,n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",t+o),l.src=s),e[s]=[i];var h=function(t,n){l.onerror=l.onload=null,clearTimeout(p);var i=e[s];if(delete e[s],l.parentNode&&l.parentNode.removeChild(l),i&&i.forEach((function(e){return e(n)})),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=h.bind(null,l.onerror),l.onload=h.bind(null,l.onload),r&&document.head.appendChild(l)}}}(),function(){n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){n.p="/"}(),function(){if("undefined"!==typeof document){var e=function(e,t,n,s,i){var o=document.createElement("link");o.rel="stylesheet",o.type="text/css";var a=function(n){if(o.onerror=o.onload=null,"load"===n.type)s();else{var a=n&&("load"===n.type?"missing":n.type),l=n&&n.target&&n.target.href||t,r=new Error("Loading CSS chunk "+e+" failed.\n("+l+")");r.code="CSS_CHUNK_LOAD_FAILED",r.type=a,r.request=l,o.parentNode&&o.parentNode.removeChild(o),i(r)}};return o.onerror=o.onload=a,o.href=t,n?n.parentNode.insertBefore(o,n.nextSibling):document.head.appendChild(o),o},t=function(e,t){for(var n=document.getElementsByTagName("link"),s=0;s<n.length;s++){var i=n[s],o=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(o===e||o===t))return i}var a=document.getElementsByTagName("style");for(s=0;s<a.length;s++){i=a[s],o=i.getAttribute("data-href");if(o===e||o===t)return i}},s=function(s){return new Promise((function(i,o){var a=n.miniCssF(s),l=n.p+a;if(t(a,l))return i();e(s,l,null,i,o)}))},i={2143:0};n.f.miniCss=function(e,t){var n={65:1,169:1,306:1,311:1,446:1,472:1,669:1,729:1,746:1,984:1,1259:1,1322:1,1391:1,1449:1,1706:1,1807:1,1869:1,1949:1,2154:1,2217:1,2460:1,2461:1,2471:1,2844:1,2892:1,2893:1,2976:1,2992:1,3368:1,3369:1,3390:1,3557:1,3559:1,3661:1,3671:1,3798:1,3826:1,3835:1,3924:1,4221:1,4497:1,4589:1,4790:1,5193:1,5207:1,5290:1,5329:1,5638:1,5794:1,5795:1,5906:1,5962:1,6062:1,6079:1,6324:1,6523:1,6561:1,7067:1,7184:1,7523:1,7590:1,7878:1,7880:1,7968:1,8039:1,8069:1,8179:1,8260:1,8391:1,8498:1,8621:1,8769:1,8825:1,8989:1,9962:1};i[e]?t.push(i[e]):0!==i[e]&&n[e]&&t.push(i[e]=s(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))}}}(),function(){var e={2143:0};n.f.j=function(t,s){var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else if(/^(13(22|91)|2(154|461|471|844|992)|3(390|661|671|826|924)|6(079|561|69)|8(03|06|98)9|(47|52)90|5906)$/.test(t))e[t]=0;else{var o=new Promise((function(n,s){i=e[t]=[n,s]}));s.push(i[2]=o);var a=n.p+n.u(t),l=new Error,r=function(s){if(n.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){var o=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",l.name="ChunkLoadError",l.type=o,l.request=a,i[1](l)}};n.l(a,r,"chunk-"+t,t)}},n.O.j=function(t){return 0===e[t]};var t=function(t,s){var i,o,a=s[0],l=s[1],r=s[2],c=0;if(a.some((function(t){return 0!==e[t]}))){for(i in l)n.o(l,i)&&(n.m[i]=l[i]);if(r)var d=r(n)}for(t&&t(s);c<a.length;c++)o=a[c],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(d)},s=self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))}();var s=n.O(void 0,[4998],(function(){return n(6715)}));s=n.O(s)})();
//# sourceMappingURL=app.ebfe47ec.js.map