platypush/platypush/backend/http/webapp/dist/static/js/app.96a099d1.js

2 lines
61 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,s){"use strict";s.d(t,{$:function(){return i}});var n=s(9652);const i=(0,n.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)}},7981:function(e,t,s){"use strict";var n=s(9963),i=s(6252);function o(e,t,s,n,o,a){const r=(0,i.up)("Events"),l=(0,i.up)("Notifications"),c=(0,i.up)("VoiceAssistant"),d=(0,i.up)("Pushbullet"),u=(0,i.up)("Ntfy"),p=(0,i.up)("ConfirmDialog"),h=(0,i.up)("router-view");return(0,i.wg)(),(0,i.iD)(i.HY,null,[a.hasWebsocket?((0,i.wg)(),(0,i.j4)(r,{key:0,ref:"events"},null,512)):(0,i.kq)("",!0),(0,i.Wm)(l,{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)(p,{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)(h)],64)}var a=s(6936);const r={class:"notifications"};function l(e,t,s,n,o,a){const l=(0,i.up)("Notification");return(0,i.wg)(),(0,i.iD)("div",r,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.notifications,((e,t,s)=>((0,i.wg)(),(0,i.j4)(l,{key:s,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 c=s(3577);const d=["textContent"],u={class:"body"},p={key:0,class:"image col-3"},h={class:"row"},f=["src"],m={key:3,class:"fa fa-exclamation"},g={key:4,class:"fa fa-times"},b=["textContent"],y=["innerHTML"],v=["textContent"],w=["innerHTML"];function k(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("div",{class:(0,c.C_)(["notification fade-in",{warning:s.warning,error:s.error}]),onClick:t[0]||(t[0]=(...e)=>a.clicked&&a.clicked(...e))},[s.title?((0,i.wg)(),(0,i.iD)("div",{key:0,class:"title",textContent:(0,c.zw)(s.title)},null,8,d)):(0,i.kq)("",!0),(0,i._)("div",u,[s.image||s.warning||s.error?((0,i.wg)(),(0,i.iD)("div",p,[(0,i._)("div",h,[s.image&&s.image.src?((0,i.wg)(),(0,i.iD)("img",{key:0,src:s.image.src,alt:""},null,8,f)):s.image&&s.image.icon?((0,i.wg)(),(0,i.iD)("i",{key:1,class:(0,c.C_)(["fa","fa-"+s.image.icon]),style:(0,c.j5)(s.image.color?"--color: "+s.image.color:"")},null,6)):s.image&&s.image.iconClass?((0,i.wg)(),(0,i.iD)("i",{key:2,class:(0,c.C_)(s.image.iconClass),style:(0,c.j5)(s.image.color?"--color: "+s.image.color:"")},null,6)):s.warning?((0,i.wg)(),(0,i.iD)("i",m)):s.error?((0,i.wg)(),(0,i.iD)("i",g)):(0,i.kq)("",!0)])])):(0,i.kq)("",!0),s.text&&s.image?((0,i.wg)(),(0,i.iD)("div",{key:1,class:"text col-9",textContent:(0,c.zw)(s.text)},null,8,b)):(0,i.kq)("",!0),s.html&&s.image?((0,i.wg)(),(0,i.iD)("div",{key:2,class:"text col-9",innerHTML:s.html},null,8,y)):(0,i.kq)("",!0),s.text&&!s.image?((0,i.wg)(),(0,i.iD)("div",{key:3,class:"text row horizontal-center",textContent:(0,c.zw)(s.text)},null,8,v)):(0,i.kq)("",!0),s.html&&!s.image?((0,i.wg)(),(0,i.iD)("div",{key:4,class:"text row horizontal-center",innerHTML:s.html},null,8,w)):(0,i.kq)("",!0)])],2)}var _={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)}}},x=s(3744);const C=(0,x.Z)(_,[["render",k],["__scopeId","data-v-7646705e"]]);var D=C,T={name:"Notifications",components:{Notification:D},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 s=e.duration?parseInt(e.duration):0;s&&(this.timeouts[t]=setTimeout(this.destroy.bind(null,t),s))},destroy:function(e){delete this.notifications[e],delete this.timeouts[e]}}};const I=(0,x.Z)(T,[["render",l],["__scopeId","data-v-6dc8bebc"]]);var S=I,M=s(6397);function $(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("div")}s(7658);var P=s(5250),U={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(s){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 s of t)s&&(s instanceof Array?s=s[0]:s instanceof Object&&!(s instanceof Function)&&(s=Object.values(s)[0]),s(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,s=e.events.length?e.events:[null],n=e.handlerName;for(const i of s)i in this.handlers||(this.handlers[i]={}),n in this.handlerNameToEventTypes||(this.handlerNameToEventTypes[n]=s),this.handlers[i][n]=t;return()=>{this.unsubscribe(n)}},unsubscribe(e){const t=this.handlerNameToEventTypes[e];if(t){for(const s of t)this.handlers[s]?.[e]&&(delete this.handlers[s][e],Object.keys(this.handlers[s]).length||delete this.handlers[s]);delete this.handlerNameToEventTypes[e]}}},created(){P.$.on("subscribe",this.subscribe),P.$.on("unsubscribe",this.unsubscribe),this.init()}};const q=(0,x.Z)(U,[["render",$]]);var N=q;const j={class:"assistant-modal"},E={class:"icon"},O={key:0,class:"fa fa-bell"},Z={key:1,class:"fa fa-volume-up"},z={key:2,class:"fa fa-comment-dots"},W={key:3,class:"fa fa-microphone"},R={class:"text"},A={key:0,class:"listening"},L=(0,i._)("span",null,"Assistant listening",-1),F=[L],V={key:1,class:"speech-recognized"},H=["textContent"],B={key:2,class:"responding"},K=["textContent"];function Y(e,t,s,n,o,a){const r=(0,i.up)("Modal");return(0,i.wg)(),(0,i.iD)("div",j,[(0,i.Wm)(r,{ref:"assistantModal"},{default:(0,i.w5)((()=>[(0,i._)("div",E,[o.state.alerting?((0,i.wg)(),(0,i.iD)("i",O)):o.state.responding?((0,i.wg)(),(0,i.iD)("i",Z)):o.state.speechRecognized?((0,i.wg)(),(0,i.iD)("i",z)):((0,i.wg)(),(0,i.iD)("i",W))]),(0,i._)("div",R,[o.state.listening?((0,i.wg)(),(0,i.iD)("div",A,F)):o.state.speechRecognized?((0,i.wg)(),(0,i.iD)("div",V,[(0,i._)("span",{textContent:(0,c.zw)(o.phrase)},null,8,H)])):o.state.responding?((0,i.wg)(),(0,i.iD)("div",B,[(0,i._)("span",{textContent:(0,c.zw)(o.responseText)},null,8,K)])):(0,i.kq)("",!0)])])),_:1},512)])}var J=s(9417),G={name:"VoiceAssistant",components:{Modal:J.Z},mixins:[M.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 X=(0,x.Z)(G,[["render",Y]]);var Q=X;function ee(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("div")}var te={name:"Ntfy",mixins:[M.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 se=(0,x.Z)(te,[["render",ee]]);var ne=se;function ie(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("div")}var oe={name:"Pushbullet",mixins:[M.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 ae=(0,x.Z)(oe,[["render",ie]]);var re=ae,le={name:"App",mixins:[M.Z],components:{ConfirmDialog:a.Z,Pushbullet:re,Ntfy:ne,Notifications:S,Events:N,VoiceAssistant:Q},data(){return{config:{},userAuthenticated:!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(){P.$.onNotification(this.onNotification)}};const ce=(0,x.Z)(le,[["render",o]]);var de=ce,ue=s(2201);function pe(e,t,s,n,o,a){const r=(0,i.up)("Loading"),l=(0,i.up)("Widget"),d=(0,i.up)("Row");return(0,i.wg)(),(0,i.iD)(i.HY,null,[o.loading?((0,i.wg)(),(0,i.j4)(r,{key:0})):(0,i.kq)("",!0),(0,i._)("div",{id:"dashboard",class:(0,c.C_)(["col-12",a.classes]),style:(0,c.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)(d,{key:t,class:(0,c.C_)(e.class),style:(0,c.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)(l,{style:(0,c.j5)(e.style),class:(0,c.C_)(e.class)},{default:(0,i.w5)((()=>[((0,i.wg)(),(0,i.j4)((0,i.LL)(e.component),(0,c.vs)((0,i.F4)(a.getWidgetProps(e))),null,16))])),_:2},1032,["style","class"])],1024)))),128))])),_:2},1032,["class","style"])))),128))],6)],64)}var he=s(2262),fe=s(6791);function me(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("div",{class:(0,c.C_)(["row",a.classes]),style:(0,c.j5)(s.style)},[(0,i.WI)(e.$slots,"default",{},void 0,!0)],6)}var ge={name:"Row",props:{class:{type:String,required:!1,default:""},style:{type:String,required:!1,default:""}},computed:{classes(){return this.class}}};const be=(0,x.Z)(ge,[["render",me],["__scopeId","data-v-1b4663f2"]]);var ye=be;function ve(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("div",{style:(0,c.j5)(s.style),class:(0,c.C_)(a.classes)},[(0,i.WI)(e.$slots,"default",{},void 0,!0)],6)}var we={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 ke=(0,x.Z)(we,[["render",ve],["__scopeId","data-v-5df52982"]]);var _e=ke,xe={name:"Dashboard",mixins:[M.Z],components:{Widget:_e,Loading:fe.Z,Row:ye},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 n=(new DOMParser).parseFromString(t,"text/xml").childNodes[0],o=this;this.style=n.attributes.style?.nodeValue,this.class=n.attributes.class?.nodeValue,this.rows=[...n.getElementsByTagName("Row")].map((e=>({style:e.attributes.style?.nodeValue,class:e.attributes.class?.nodeValue,widgets:[...e.children].map((e=>{const t=(0,he.XI)((0,i.RC)((()=>s(6725)(`./${e.nodeName}/Index`)))),n=e.attributes.style?.nodeValue,a=e.attributes.class?.nodeValue,r=[...e.attributes].reduce(((e,t)=>("style"!==t.nodeName&&(e[t.nodeName]=t.nodeValue),e)),{content:e.innerHTML}),l={component:t,style:n,class:a,props:r||{}};return o.$options.components[e.nodeName]=t,l}))}))),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 Ce=(0,x.Z)(xe,[["render",pe],["__scopeId","data-v-54e0248a"]]);var De=Ce;function Te(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("h1",null,"Object not found")}var Ie={name:"NotFound"};const Se=(0,x.Z)(Ie,[["render",Te]]);var Me=Se;const $e=e=>((0,i.dD)("data-v-af0b14d0"),e=e(),(0,i.Cn)(),e),Pe={class:"login-container"},Ue={class:"login",method:"POST"},qe=(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),Ne={key:0,class:"row"},je=$e((()=>(0,i._)("label",null,[(0,i._)("input",{type:"password",name:"confirm_password",placeholder:"Confirm password"})],-1))),Ee=[je],Oe={class:"row buttons"},Ze=["value"],ze=$e((()=>(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 We(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("div",Pe,[(0,i._)("form",Ue,[qe,a._register?((0,i.wg)(),(0,i.iD)("div",Ne,Ee)):(0,i.kq)("",!0),(0,i._)("div",Oe,[(0,i._)("input",{type:"submit",class:"btn btn-primary",value:a._register?"Register":"Login"},null,8,Ze)]),ze])])}var Re={name:"Login",mixins:[M.Z],props:{register:{type:Boolean,required:!1,default:!1}},computed:{_register(){return this.parseBoolean(this.register)}}};const Ae=(0,x.Z)(Re,[["render",We],["__scopeId","data-v-af0b14d0"]]);var Le=Ae;function Fe(e,t,s,n,o,a){const r=(0,i.up)("Login");return(0,i.wg)(),(0,i.j4)(r,{register:!0})}var Ve={name:"Register",mixins:[Le],components:{Login:Le},props:{register:{type:Boolean,required:!1,default:!0}}};const He=(0,x.Z)(Ve,[["render",Fe]]);var Be=He;const Ke={key:2,class:"canvas"},Ye={class:"panel"},Je={key:3,class:"canvas"};function Ge(e,t,s,n,o,a){const r=(0,i.up)("Loading"),l=(0,i.up)("Nav"),d=(0,i.up)("Settings");return(0,i.wg)(),(0,i.iD)("main",null,[o.loading?((0,i.wg)(),(0,i.j4)(r,{key:0})):((0,i.wg)(),(0,i.j4)(l,{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",Ke,[(0,i._)("div",Ye,[(0,i.Wm)(d,{"selected-panel":o.selectedConfigPanel},null,8,["selected-panel"])])])):((0,i.wg)(),(0,i.iD)("div",Je,[((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,c.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 Xe=e=>((0,i.dD)("data-v-933dd93c"),e=e(),(0,i.Cn)(),e),Qe=Xe((()=>(0,i._)("i",{class:"fas fa-bars"},null,-1))),et=["textContent"],tt={key:0,class:"plugins"},st={href:"/#"},nt=Xe((()=>(0,i._)("i",{class:"fas fa-home"},null,-1))),it={key:0,class:"name"},ot=["title","onClick"],at={href:"/#settings"},rt={class:"icon"},lt=["src"],ct={key:2,class:"fas fa-puzzle-piece"},dt=["textContent"],ut={key:1,class:"plugins"},pt=["title","onClick"],ht=["href"],ft={class:"icon"},mt=["src"],gt={key:2,class:"fas fa-puzzle-piece"},bt=["textContent"],yt={class:"footer"},vt={href:"/#settings"},wt=Xe((()=>(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fa fa-cog"})],-1))),kt={key:0,class:"name"},_t={href:"/logout"},xt=Xe((()=>(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fas fa-sign-out-alt"})],-1))),Ct={key:0,class:"name"};function Dt(e,t,s,n,o,a){return(0,i.wg)(),(0,i.iD)("nav",{class:(0,c.C_)({collapsed:o.collapsed})},[(0,i._)("div",{class:"toggler",onClick:t[0]||(t[0]=e=>o.collapsed=!o.collapsed)},[Qe,s.hostname?((0,i.wg)(),(0,i.iD)("span",{key:0,class:"hostname",textContent:(0,c.zw)(s.hostname)},null,8,et)):(0,i.kq)("",!0)]),"settings"===s.selectedPanel?((0,i.wg)(),(0,i.iD)("ul",tt,[(0,i._)("li",{class:"entry",title:"Home",onClick:t[1]||(t[1]=e=>a.onItemClick("entities"))},[(0,i._)("a",st,[nt,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",it,"Home"))])]),((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(o.configSections,((t,n)=>((0,i.wg)(),(0,i.iD)("li",{key:n,class:(0,c.C_)(["entry",{selected:n===s.selectedConfigPanel}]),title:t.name,onClick:t=>e.$emit("select-config",n)},[(0,i._)("a",at,[(0,i._)("span",rt,[t.icon?.["class"]?((0,i.wg)(),(0,i.iD)("i",{key:0,class:(0,c.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,lt)):((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,c.zw)(t.name)},null,8,dt))])],10,ot)))),128))])):((0,i.wg)(),(0,i.iD)("ul",ut,[((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,c.C_)(["entry",{selected:e===s.selectedPanel}]),title:e,onClick:t=>a.onItemClick(e)},[(0,i._)("a",{href:`/#${e}`},[(0,i._)("span",ft,[o.icons[e]?.class?((0,i.wg)(),(0,i.iD)("i",{key:0,class:(0,c.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,mt)):((0,i.wg)(),(0,i.iD)("i",gt))]),o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",{key:0,class:"name",textContent:(0,c.zw)(a.displayName(e))},null,8,bt))],8,ht)],10,pt)))),128))])),(0,i._)("ul",yt,[(0,i._)("li",{class:(0,c.C_)({selected:"settings"===s.selectedPanel}),title:"Settings",onClick:t[2]||(t[2]=e=>a.onItemClick("settings"))},[(0,i._)("a",vt,[wt,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",kt,"Settings"))])],2),(0,i._)("li",{title:"Logout",onClick:t[3]||(t[3]=e=>a.onItemClick("logout"))},[(0,i._)("a",_t,[xt,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",Ct,"Logout"))])])])],2)}var Tt=s(1359),It=JSON.parse('{"users":{"name":"Users","icon":{"class":"fas fa-user"}},"tokens":{"name":"Tokens","icon":{"class":"fas fa-key"}}}'),St={name:"Nav",emits:["select","select-config"],mixins:[M.Z],props:{panels:{type:Object,required:!0},selectedPanel:{type:String},selectedConfigPanel:{type:String},hostname:{type:String}},computed:{panelNames(){const e=(e,s)=>{const n=t.indexOf(s);return n>=0&&(e=[s].concat(e.slice(0,n).concat(e.slice(n+1)))),e};let t=Object.keys(this.panels).sort();return t=e(t,"extensions"),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":"extensions"===e?"Extensions":e}},data(){return{collapsed:!0,icons:Tt,host:null,configSections:It}},mounted(){this.collapsed=this.collapsedDefault}};const Mt=(0,x.Z)(St,[["render",Dt],["__scopeId","data-v-933dd93c"]]);var $t=Mt,Pt=s(2431),Ut={name:"Panel",mixins:[M.Z],components:{Settings:Pt["default"],Nav:$t,Loading:fe.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,n])=>{const o=t.split(".").map((e=>e[0].toUpperCase()+e.slice(1))).join("");let a=null;try{a=await s(3379)(`./${o}/Index`)}catch(l){return}const r=(0,he.XI)((0,i.RC)((async()=>a)));e.$options.components[t]=r,e.components[t]={component:r,pluginName:t,config:n}}))},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={},this.plugins.extensions={}}},async mounted(){this.loading=!0;try{await this.parseConfig(),this.initPanels(),this.initSelectedPanel()}finally{this.loading=!1}}};const qt=(0,x.Z)(Ut,[["render",Ge],["__scopeId","data-v-b815bd9e"]]);var Nt=qt;const jt={key:1,class:"canvas"};function Et(e,t,s,n,o,a){const r=(0,i.up)("Loading");return(0,i.wg)(),(0,i.iD)("main",null,[o.loading?((0,i.wg)(),(0,i.j4)(r,{key:0})):((0,i.wg)(),(0,i.iD)("div",jt,[((0,i.wg)(),(0,i.j4)((0,i.LL)(o.component),{config:o.config,"plugin-name":a.pluginName},null,8,["config","plugin-name"]))]))])}var Ot={name:"Panel",mixins:[M.Z],components:{Settings:Pt["default"],Nav:$t,Loading:fe.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 s(3379)(`./${e}/Index`)}catch(n){return console.error(n),void this.notify({error:!0,title:`Cannot load plugin ${this.pluginName}`,text:n.toString()})}this.component=(0,he.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 Zt=(0,x.Z)(Ot,[["render",Et],["__scopeId","data-v-e339182c"]]);var zt=Zt;const Wt=[{path:"/",name:"Panel",component:Nt},{path:"/dashboard/:name",name:"Dashboard",component:De},{path:"/plugin/:plugin",name:"Plugin",component:zt},{path:"/login",name:"Login",component:Le},{path:"/register",name:"Register",component:Be},{path:"/:catchAll(.*)",component:Me}],Rt=(0,ue.p7)({history:(0,ue.PO)(),routes:Wt});var At=Rt,Lt=s(5205);(0,Lt.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 Ft=(0,n.ri)(de);Ft.config.globalProperties._config=window.config,Ft.use(At).mount("#app")},6397:function(e,t,s){"use strict";s.d(t,{Z:function(){return Z}});var n=s(9669),i=s.n(n),o={name:"Api",methods:{execute(e,t=6e4,s=!0){const n={};return"target"in e&&e["target"]||(e["target"]="localhost"),"type"in e&&e["type"]||(e["type"]="request"),t&&(n.timeout=t),new Promise(((t,o)=>{i().post("/execute",e,n).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),s&&this.notify({text:e,error:!0}),o(e))}))}))},request(e,t={},s=6e4,n=!0){return this.execute({type:"request",action:e,args:t},s,n)}}};const a=o;var r=a,l={name:"Clipboard",methods:{async copyToClipboard(e){await navigator.clipboard.writeText(e),this.notify({text:"Copied to the clipboard",image:{icon:"clipboard"}})}}};const c=l;var d=c,u={name:"Cookies",methods:{getCookies(){return document.cookie.split(/;\s*/).reduce(((e,t)=>{const[s,n]=t.split("=");return e[s]=n,e}),{})},getCookie(e){return this.getCookies()[e]},setCookie(e,t,s){document.cookie=`${e}=${t}; path=${s?.path||"/"}`+(s?.expires?`; expires=${s?.expires.toISOString()}`:"")},deleteCookie(e){document.cookie=`${e}=; expires=1970-01-01T00:00:00Z`}}};const p=u;var h=p,f={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,s=!0){return"string"===typeof e&&(e=new Date(Date.parse(e))),`${this.formatDate(e,t)}, ${this.formatTime(e,s)}`}}};const m=f;var g=m,b=(s(2801),s(5250)),y={name:"Events",computed:{_eventsReady(){return this.$root.$refs.events?.initialized}},methods:{subscribe(e,t,...s){const n=()=>{b.$.emit("subscribe",{events:s,handler:e,handlerName:t||this.generateId()})};if(this._eventsReady)return void n();const i=this,o=this.$watch((()=>i._eventsReady),(e=>{e&&(n(),o())}));return o},unsubscribe(e){b.$.emit("unsubscribe",e)},generateId(){return btoa([...Array(11).keys()].map((()=>String.fromCharCode(Math.round(255*Math.random())))))}}};const v=y;var w=v,k={name:"Extensions",methods:{pluginDisplayName(e){const t=e.split(".");return t.forEach(((e,s)=>{t[s]=e.charAt(0).toUpperCase()+e.slice(1)})),t.length>1&&(t[0]=`[${t[0]}]`),t.join(" ")}}};const _=k;var x=_,C={name:"Notification",methods:{notify(e){b.$.publishNotification(e)},notifyWarning(e){this.notify({text:e,warning:!0})},notifyError(e){throw this.notify({text:e,error:!0}),e}}};const D=C;var T=D,I={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 S=I;var M=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 P=$;var U=P,q=(s(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 s=["B","KB","MB","GB","TB"];return s.forEach(((n,i)=>{e<=1024&&null==t?t=n:e>1024&&(i===s.length-1?t=n:e/=1024)})),`${e.toFixed(2)} ${t}`},convertTime(e){const t={},s=[];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"),s.push(e)}if(parseInt(t.h)){let e=t.h+" hour";t.h>1&&(e+="s"),s.push(e)}if(parseInt(t.m)){let e=t.m+" minute";t.m>1&&(e+="s"),s.push(e)}let n=t.s+" second";return t.s>1&&(n+="s"),s.push(n),s.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 s of Object.keys(e||{}))switch(typeof e[s]){case"object":if(!this.objectsEqual(e[s],t[s]))return!1;break;case"function":if(e[s].toString()!=t[s]?.toString())return!1;break;default:if(e[s]!=t[s])return!1;break}for(const s of Object.keys(t||{}))if(null==e[s]&&null!=t[s])return!1;return!0}}});const N=q;var j=N,E={name:"Utils",mixins:[r,d,h,g,w,T,x,M,U,j]};const O=E;var Z=O},6791:function(e,t,s){"use strict";s.d(t,{Z:function(){return d}});var n=s(6252);const i={class:"loading"},o={class:"icon"};function a(e,t){return(0,n.wg)(),(0,n.iD)("div",i,[(0,n._)("div",o,[((0,n.wg)(),(0,n.iD)(n.HY,null,(0,n.Ko)(4,(e=>(0,n._)("div",{key:e}))),64))])])}var r=s(3744);const l={},c=(0,r.Z)(l,[["render",a],["__scopeId","data-v-4d9c871b"]]);var d=c},9417:function(e,t,s){"use strict";s.d(t,{Z:function(){return g}});var n=s(6252),i=s(3577);const o=e=>((0,n.dD)("data-v-18f9fdba"),e=e(),(0,n.Cn)(),e),a=["id"],r={key:0,class:"header"},l=["textContent"],c=o((()=>(0,n._)("i",{class:"fas fa-xmark"},null,-1))),d=[c],u={class:"body"};function p(e,t,s,o,c,p){return(0,n.wg)(),(0,n.iD)("div",{class:(0,i.C_)(["modal-container fade-in",{hidden:!c.isVisible}]),id:s.id,style:(0,i.j5)({"--z-index":p.zIndex}),onClick:t[3]||(t[3]=(...e)=>p.close&&p.close(...e))},[(0,n._)("div",{class:(0,i.C_)(["modal",e.$attrs.class])},[(0,n._)("div",{class:"content",style:(0,i.j5)({"--width":s.width,"--height":s.height}),onClick:t[2]||(t[2]=e=>e.stopPropagation())},[s.title?((0,n.wg)(),(0,n.iD)("div",r,[s.title?((0,n.wg)(),(0,n.iD)("div",{key:0,class:"title",textContent:(0,i.zw)(s.title)},null,8,l)):(0,n.kq)("",!0),(0,n._)("button",{title:"Close",alt:"Close",onClick:t[0]||(t[0]=(...e)=>p.close&&p.close(...e))},d)])):(0,n.kq)("",!0),(0,n._)("div",u,[(0,n.WI)(e.$slots,"default",{onModalClose:t[1]||(t[1]=(...e)=>p.close&&p.close(...e))},void 0,!0)])],4)],2)],14,a)}s(7658);var h={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 s of document.querySelectorAll(".modal-container:not(.hidden)")){const n=parseInt(getComputedStyle(s).zIndex);n>e?(e=n,t=[s]):n===e&&t.push(s)}(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=s(3744);const m=(0,f.Z)(h,[["render",p],["__scopeId","data-v-18f9fdba"]]);var g=m},6936:function(e,t,s){"use strict";s.d(t,{Z:function(){return m}});var n=s(6252),i=s(9963),o=s(3577);const a=e=>((0,n.dD)("data-v-db648f4c"),e=e(),(0,n.Cn)(),e),r={class:"dialog-content"},l=a((()=>(0,n._)("i",{class:"fas fa-check"},null,-1))),c=a((()=>(0,n._)("i",{class:"fas fa-xmark"},null,-1)));function d(e,t,s,a,d,u){const p=(0,n.up)("Modal");return(0,n.wg)(),(0,n.j4)(p,{ref:"modal",title:s.title},{default:(0,n.w5)((()=>[(0,n._)("div",r,[(0,n.WI)(e.$slots,"default",{},void 0,!0)]),(0,n._)("form",{class:"buttons",onSubmit:t[4]||(t[4]=(0,i.iM)(((...e)=>u.onConfirm&&u.onConfirm(...e)),["prevent"]))},[(0,n._)("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))},[l,(0,n.Uk)("   "+(0,o.zw)(s.confirmText),1)],32),(0,n._)("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,n.Uk)("   "+(0,o.zw)(s.cancelText),1)],32)],32)])),_:3},8,["title"])}var u=s(9417),p={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()}}},h=s(3744);const f=(0,h.Z)(p,[["render",d],["__scopeId","data-v-db648f4c"]]);var m=f},7261:function(e,t,s){"use strict";s.d(t,{Z:function(){return f}});var n=s(6252),i=s(9963),o=s(3577);const a={class:"dropdown-container",ref:"container"},r=["title"],l=["textContent"],c=["id"];function d(e,t,s,d,u,p){return(0,n.wg)(),(0,n.iD)("div",a,[(0,n._)("button",{title:s.title,ref:"button",onClick:t[0]||(t[0]=(0,i.iM)((e=>p.toggle(e)),["stop"]))},[s.iconClass?((0,n.wg)(),(0,n.iD)("i",{key:0,class:(0,o.C_)(["icon",s.iconClass])},null,2)):(0,n.kq)("",!0),s.text?((0,n.wg)(),(0,n.iD)("span",{key:1,class:"text",textContent:(0,o.zw)(s.text)},null,8,l)):(0,n.kq)("",!0)],8,r),(0,n._)("div",{class:(0,o.C_)(["dropdown fade-in",{hidden:!u.visible}]),id:s.id,ref:"dropdown"},[(0,n.WI)(e.$slots,"default",{},void 0,!0)],10,c)],512)}var u={name:"Dropdown",emits:["click"],props:{id:{type:String},items:{type:Array,default:()=>[]},iconClass:{default:"fa fa-ellipsis-h"},text:{type:String},title:{type:String},keepOpenOnItemClick:{type:Boolean,default:!1}},data(){return{visible:!1}},methods:{documentClickHndl(e){if(!this.visible)return;let t=e.target;while(t){if(!this.$refs.dropdown)break;if(t===this.$refs.dropdown.element)return;t=t.parentElement}this.close()},close(){this.visible=!1,document.removeEventListener("click",this.documentClickHndl)},open(){document.addEventListener("click",this.documentClickHndl),this.visible=!0,setTimeout((()=>{const e=this.$refs.dropdown;e.style.left=0,e.style.top=parseFloat(getComputedStyle(this.$refs.button).height)+"px",e.getBoundingClientRect().left>window.innerWidth/2&&(e.style.left=-e.clientWidth+parseFloat(getComputedStyle(this.$refs.button).width)+"px"),e.getBoundingClientRect().top>window.innerHeight/2&&(e.style.top=-e.clientHeight+parseFloat(getComputedStyle(this.$refs.button).height)+"px")}),10)},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)}},p=s(3744);const h=(0,p.Z)(u,[["render",d],["__scopeId","data-v-5b964c03"]]);var f=h},1950:function(e,t,s){"use strict";s.d(t,{Z:function(){return p}});var n=s(6252),i=s(3577);const o={key:0,class:"col-2 icon"},a=["textContent"];function r(e,t,s,r,l,c){const d=(0,n.up)("Icon");return(0,n.wg)(),(0,n.iD)("div",{class:(0,i.C_)(["row item",s.itemClass]),onClick:t[0]||(t[0]=(...e)=>c.clicked&&c.clicked(...e))},[s.iconClass?.length||s.iconUrl?.length?((0,n.wg)(),(0,n.iD)("div",o,[(0,n.Wm)(d,{class:(0,i.C_)(s.iconClass),url:s.iconUrl},null,8,["class","url"])])):(0,n.kq)("",!0),(0,n._)("div",{class:(0,i.C_)(["text",{"col-10":null!=s.iconClass}]),textContent:(0,i.zw)(s.text)},null,10,a)],2)}var l=s(657),c={name:"DropdownItem",components:{Icon:l.Z},props:{iconClass:{type:String},iconUrl:{type:String},text:{type:String},disabled:{type:Boolean,default:!1},itemClass:{}},methods:{clicked(e){if(this.disabled)return!1;this.$parent.$emit("click",e),this.$parent.keepOpenOnItemClick||(this.$parent.visible=!1)}}},d=s(3744);const u=(0,d.Z)(c,[["render",r],["__scopeId","data-v-29ddda9f"]]);var p=u},657:function(e,t,s){"use strict";s.d(t,{Z:function(){return u}});var n=s(6252),i=s(3577);const o={class:"icon-container"},a=["src","alt"];function r(e,t,s,r,l,c){return(0,n.wg)(),(0,n.iD)("div",o,[s.url?.length?((0,n.wg)(),(0,n.iD)("img",{key:0,class:"icon",src:s.url,alt:s.alt},null,8,a)):c.className?.length?((0,n.wg)(),(0,n.iD)("i",{key:1,class:(0,i.C_)(["icon",c.className]),style:(0,i.j5)({color:s.color})},null,6)):(0,n.kq)("",!0)])}var l={props:{class:{type:String},url:{type:String},color:{type:String,default:""},alt:{type:String,default:""}},computed:{className(){return this.class}}},c=s(3744);const d=(0,c.Z)(l,[["render",r],["__scopeId","data-v-706a3bd1"]]);var u=d},2431:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return le}});var n=s(6252);const i={class:"settings-container"};function o(e,t,s,o,a,r){const l=(0,n.up)("Users"),c=(0,n.up)("Token");return(0,n.wg)(),(0,n.iD)("div",i,[(0,n._)("main",null,["users"===s.selectedPanel&&a.currentUser?((0,n.wg)(),(0,n.j4)(l,{key:0,"session-token":a.sessionToken,"current-user":a.currentUser},null,8,["session-token","current-user"])):"tokens"===s.selectedPanel&&a.currentUser?((0,n.wg)(),(0,n.j4)(c,{key:1,"session-token":a.sessionToken,"current-user":a.currentUser},null,8,["session-token","current-user"])):(0,n.kq)("",!0)])])}var a=s(3577),r=s(9963);const l={class:"token-container"},c={class:"token-container"},d=(0,n._)("label",null,[(0,n.Uk)(" This is your generated token. Treat it carefully and do not share it with untrusted parties."),(0,n._)("br"),(0,n.Uk)(" Also, make sure to save it - it WILL NOT be displayed again. ")],-1),u=["textContent"],p={class:"token-container"},h=(0,n._)("label",null," This is your current session token. It will be invalidated once you log out of the current session. ",-1),f=["textContent"],m={class:"body"},g=(0,n.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),b={class:"form-container"},y=(0,n._)("span",null,"Username",-1),v=["value"],w=(0,n._)("label",null,[(0,n._)("span",null,"Confirm password"),(0,n._)("span",null,[(0,n._)("input",{type:"password",name:"password"})])],-1),k=(0,n._)("label",null,[(0,n._)("span",null,"Token validity in days"),(0,n._)("span",null,[(0,n._)("input",{type:"text",name:"validityDays"})]),(0,n._)("span",{class:"note"},[(0,n.Uk)(" Decimal values are also supported - e.g. "),(0,n._)("i",null,"0.5"),(0,n.Uk)(" means half a day (12 hours). An empty or zero value means that the token has no expiry date. ")])],-1),_=(0,n._)("label",null,[(0,n._)("input",{type:"submit",class:"btn btn-primary",value:"Generate JWT token"})],-1);function x(e,t,s,i,o,x){const C=(0,n.up)("Loading"),D=(0,n.up)("Modal");return(0,n.wg)(),(0,n.iD)("div",l,[o.loading?((0,n.wg)(),(0,n.j4)(C,{key:0})):(0,n.kq)("",!0),(0,n.Wm)(D,{ref:"tokenModal"},{default:(0,n.w5)((()=>[(0,n._)("div",c,[d,(0,n._)("textarea",{class:"token",textContent:(0,a.zw)(o.token),onFocus:t[0]||(t[0]=(...e)=>x.onTokenSelect&&x.onTokenSelect(...e))},null,40,u)])])),_:1},512),(0,n.Wm)(D,{ref:"sessionTokenModal"},{default:(0,n.w5)((()=>[(0,n._)("div",p,[h,(0,n._)("textarea",{class:"token",textContent:(0,a.zw)(s.sessionToken),onFocus:t[1]||(t[1]=(...e)=>x.onTokenSelect&&x.onTokenSelect(...e))},null,40,f)])])),_:1},512),(0,n._)("div",m,[g,(0,n._)("div",b,[(0,n._)("form",{onSubmit:t[3]||(t[3]=(0,r.iM)(((...e)=>x.generateToken&&x.generateToken(...e)),["prevent"])),ref:"generateTokenForm"},[(0,n._)("label",null,[y,(0,n._)("span",null,[(0,n._)("input",{type:"text",name:"username",value:s.currentUser.username,disabled:""},null,8,v)])]),w,k,_,(0,n._)("label",null,[(0,n._)("input",{type:"button",class:"btn btn-default",value:"Show session token",onClick:t[2]||(t[2]=(0,r.iM)((t=>e.$refs.sessionTokenModal.show()),["stop"]))})])],544)])])])}var C=s(9669),D=s.n(C),T=s(6791),I=s(6397),S=s(9417),M={name:"Token",components:{Modal:S.Z,Loading:T.Z},mixins:[I.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,s=e.target.password.value;let n=e.target.validityDays?.length?parseInt(e.target.validityDays.value):0;n||(n=null),this.loading=!0;try{this.token=(await D().post("/auth",{username:t,password:s,expiry_days:n})).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"}})}}},$=s(3744);const P=(0,$.Z)(M,[["render",x]]);var U=P;const q=["disabled"],N=["disabled"],j=["disabled"],E=["disabled"],O=["value"],Z=["disabled"],z=["disabled"],W=["disabled"],R=["disabled"],A={class:"body"},L={class:"users-list"},F=["onClick"],V=["textContent"],H={class:"actions pull-right col-4"};function B(e,t,s,i,o,r){const l=(0,n.up)("Loading"),c=(0,n.up)("Modal"),d=(0,n.up)("DropdownItem"),u=(0,n.up)("Dropdown"),p=(0,n.up)("FloatingButton"),h=(0,n.up)("ConfirmDialog");return(0,n.wg)(),(0,n.iD)(n.HY,null,[o.loading?((0,n.wg)(),(0,n.j4)(l,{key:0})):(0,n.kq)("",!0),(0,n.Wm)(c,{ref:"addUserModal",title:"Add User"},{default:(0,n.w5)((()=>[(0,n._)("form",{action:"#",method:"POST",ref:"addUserForm",onSubmit:t[0]||(t[0]=(...e)=>r.createUser&&r.createUser(...e))},[(0,n._)("label",null,[(0,n._)("input",{type:"text",name:"username",placeholder:"Username",disabled:o.commandRunning},null,8,q)]),(0,n._)("label",null,[(0,n._)("input",{type:"password",name:"password",placeholder:"Password",disabled:o.commandRunning},null,8,N)]),(0,n._)("label",null,[(0,n._)("input",{type:"password",name:"confirm_password",placeholder:"Confirm password",disabled:o.commandRunning},null,8,j)]),(0,n._)("label",null,[(0,n._)("input",{type:"submit",class:"btn btn-primary",value:"Create User",disabled:o.commandRunning},null,8,E)])],544)])),_:1},512),(0,n.Wm)(c,{ref:"changePasswordModal",title:"Change Password"},{default:(0,n.w5)((()=>[(0,n._)("form",{action:"#",method:"POST",ref:"changePasswordForm",onSubmit:t[1]||(t[1]=(...e)=>r.changePassword&&r.changePassword(...e))},[(0,n._)("label",null,[(0,n._)("input",{type:"text",name:"username",placeholder:"Username",value:o.selectedUser,disabled:"disabled"},null,8,O)]),(0,n._)("label",null,[(0,n._)("input",{type:"password",name:"password",placeholder:"Current password",disabled:o.commandRunning},null,8,Z)]),(0,n._)("label",null,[(0,n._)("input",{type:"password",name:"new_password",placeholder:"New password",disabled:o.commandRunning},null,8,z)]),(0,n._)("label",null,[(0,n._)("input",{type:"password",name:"confirm_new_password",placeholder:"Confirm new password",disabled:o.commandRunning},null,8,W)]),(0,n._)("label",null,[(0,n._)("input",{type:"submit",class:"btn btn-primary",value:"Change Password",disabled:o.commandRunning},null,8,R)])],544)])),_:1},512),(0,n._)("div",A,[(0,n._)("ul",L,[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(o.users,(s=>((0,n.wg)(),(0,n.iD)("li",{key:s.user_id,class:"item user",onClick:e=>o.selectedUser=s.username},[(0,n._)("div",{class:"name col-8",textContent:(0,a.zw)(s.username)},null,8,V),(0,n._)("div",H,[(0,n.Wm)(u,{title:"User Actions","icon-class":"fa fa-ellipsis"},{default:(0,n.w5)((()=>[(0,n.Wm)(d,{text:"Change Password",disabled:o.commandRunning,"icon-class":"fa fa-key",onClick:e=>r.showChangePasswordModal(s)},null,8,["disabled","onClick"]),(0,n.Wm)(d,{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,F)))),128))]),(0,n.Wm)(p,{"icon-class":"fa fa-plus",text:"Add User",onClick:r.showAddUserModal},null,8,["onClick"]),(0,n.Wm)(h,{ref:"deleteUserDialog",onInput:t[3]||(t[3]=e=>r.deleteUser(o.selectedUser))},{default:(0,n.w5)((()=>[(0,n.Uk)(" Are you sure that you want to remove the user "+(0,a.zw)(o.selectedUser)+"? ",1)])),_:1},512)])],64)}var K=s(6936),Y=s(7261),J=s(1950);const G=["title"];function X(e,t,s,i,o,r){const l=(0,n.up)("Icon");return(0,n.wg)(),(0,n.iD)("div",{class:(0,a.C_)(["floating-btn",r.className])},[(0,n._)("button",{type:"button",class:"btn btn-primary",title:s.title,onClick:t[0]||(t[0]=t=>e.$emit("click",t))},[(0,n.Wm)(l,{class:(0,a.C_)(s.iconClass),url:s.iconUrl},null,8,["class","url"])],8,G)],2)}var Q=s(657),ee={name:"FloatingButton",components:{Icon:Q.Z},emits:["click"],props:{iconClass:{type:String},iconUrl:{type:String},class:{type:String},title:{type:String}},computed:{className(){return this.class}}};const te=(0,$.Z)(ee,[["render",X],["__scopeId","data-v-133e57f8"]]);var se=te,ne={name:"Users",components:{ConfirmDialog:K.Z,Dropdown:Y.Z,DropdownItem:J.Z,FloatingButton:se,Loading:T.Z,Modal:S.Z},mixins:[I.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 s=!1;try{s=await this.request("user.update_password",{username:t.username,old_password:t.password,new_password:t.new_password})}finally{this.commandRunning=!1}s?(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 ie=(0,$.Z)(ne,[["render",B],["__scopeId","data-v-510035f2"]]);var oe=ie,ae={name:"Settings",components:{Users:oe,Token:U},mixins:[I.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 re=(0,$.Z)(ae,[["render",o]]);var le=re},3379:function(e,t,s){var n={"./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":[8895,8039,8895],"./Entities/Index":[8770,4558],"./Execute/Index":[3598,8327,3598],"./Extensions/Index":[523,8327,523],"./Light/Index":[7184,2471,5040,7184],"./LightHue/Index":[2976,2471,5040,7184,2976],"./Media/Index":[1880,2471,3694,6079,1880],"./MediaMplayer/Index":[3518,2471,3694,6079,1880,3518],"./MediaMpv/Index":[4765,2471,3694,6079,1880,4765],"./MediaOmxplayer/Index":[7819,2471,3694,6079,1880,7819],"./MediaVlc/Index":[2614,2471,3694,6079,1880,2614],"./Music/Index":[2986,2471,3694,2986],"./MusicMpd/Index":[1309,2471,3694,2986,1309],"./MusicSnapcast/Index":[6215,2471,5040,6215],"./MusicSpotify/Index":[2068,2471,3694,2986,2068],"./Rtorrent/Index":[2183,6079,7968,2183],"./Settings/Index":[2431],"./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,5040,1259],"./Zwave/Index":[2732,2471,5040,7880,2732],"./ZwaveMqtt/Index":[1088,2471,5040,7880,1088]};function i(e){if(!s.o(n,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],i=t[0];return Promise.all(t.slice(1).map(s.e)).then((function(){return s(i)}))}i.keys=function(){return Object.keys(n)},i.id=3379,e.exports=i},6725:function(e,t,s){var n={"./Calendar/Index":[5638,5638],"./Camera/Index":[446,446],"./Component/Index":[1449,2471,5040,1449],"./DateTime/Index":[4619,1391,4619],"./DateTimeWeather/Index":[9962,3594,1391,9962],"./ImageCarousel/Index":[306,3594,1391,306],"./Music/Index":[311,311],"./Plugin/Index":[8179,8179],"./RssNews/Index":[6523,6523],"./Weather/Index":[3594,3594]};function i(e){if(!s.o(n,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],i=t[0];return Promise.all(t.slice(1).map(s.e)).then((function(){return s(i)}))}i.keys=function(){return Object.keys(n)},i.id=6725,e.exports=i},1359:function(e){"use strict";e.exports=JSON.parse('{"arduino":{"class":"fas fa-microchip"},"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"},"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"},"zigbee.mqtt":{"imgUrl":"/icons/zigbee.svg"},"zwave":{"imgUrl":"/icons/z-wave.png"},"zwave.mqtt":{"imgUrl":"/icons/z-wave.png"}}')}},t={};function s(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,s),o.exports}s.m=e,function(){var e=[];s.O=function(t,n,i,o){if(!n){var a=1/0;for(d=0;d<e.length;d++){n=e[d][0],i=e[d][1],o=e[d][2];for(var r=!0,l=0;l<n.length;l++)(!1&o||a>=o)&&Object.keys(s.O).every((function(e){return s.O[e](n[l])}))?n.splice(l--,1):(r=!1,o<a&&(a=o));if(r){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]=[n,i,o]}}(),function(){s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,{a:t}),t}}(),function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};s.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"===typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"===typeof n.then)return n}var o=Object.create(null);s.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var r=2&i&&n;"object"==typeof r&&!~e.indexOf(r);r=t(r))Object.getOwnPropertyNames(r).forEach((function(e){a[e]=function(){return n[e]}}));return a["default"]=function(){return n},s.d(o,a),o}}(),function(){s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce((function(t,n){return s.f[n](e,t),t}),[]))}}(),function(){s.u=function(e){return"static/js/"+e+"."+{65:"ae7df477",169:"ebdd7044",306:"88479b13",311:"afbc6940",446:"8573f8ea",523:"0107f5bd",729:"1b92c9f7",746:"796a0d60",813:"83f8caf2",984:"ae424e7e",1088:"22c3f8aa",1259:"ca167116",1309:"21b7ef6c",1391:"a76844c2",1449:"b808488b",1880:"901d17c0",2068:"54bc6baf",2183:"1facc63d",2217:"6b927594",2460:"567e73f6",2471:"da49c64a",2614:"fab6d354",2732:"34e0816d",2853:"c73d8892",2893:"519a1554",2976:"e313a256",2986:"f310f8b6",3368:"cb04738a",3369:"c099f8d0",3518:"a4edecee",3559:"df95d103",3594:"e9a98d8e",3598:"dcf54926",3694:"27088782",3732:"1eccc404",3798:"1f9f57bb",3826:"cc264dd1",3835:"11129165",4558:"73df4285",4589:"dd4afd37",4619:"e04ba413",4765:"217643df",5040:"f02b705d",5207:"7f241e21",5324:"0ddd22b2",5329:"444a9cf1",5638:"bb98bbae",5794:"a8984e80",6079:"b020e16c",6148:"f2658e9e",6215:"42246cd5",6324:"c3f621ef",6362:"95da0eb4",6523:"1e9ed5ec",6561:"fc5ef77b",7184:"c69b8bdd",7381:"a790cfcf",7523:"367c2045",7590:"6cda174b",7819:"2e3d6738",7880:"30966ce3",7968:"cd528c98",8039:"951792f1",8069:"51c1e8b1",8179:"7efc9777",8327:"37498f25",8391:"119357c7",8621:"0aa03df1",8769:"5ea5c0cb",8784:"9c2c1b4c",8825:"b660e217",8895:"743146b8",9334:"a97412a1",9962:"b6c8008e"}[e]+".js"}}(),function(){s.miniCssF=function(e){return"static/css/"+e+"."+{65:"65fe087a",169:"18c97596",306:"919e2cb6",311:"ce3daf0e",446:"ac7021e0",523:"727edb4d",729:"d9e08bd0",746:"36a26270",984:"7571e216",1259:"28135e7d",1391:"cb558276",1449:"64ebf9cc",1880:"9df66cb4",2217:"664973a5",2460:"c44d2954",2471:"750151be",2893:"7780abf3",2976:"5cb4fa57",2986:"3d6a6efd",3368:"771f452b",3369:"56bab933",3559:"5e597f7f",3594:"eefea329",3598:"28666b80",3694:"ae679692",3798:"6a1b7cf0",3826:"fbeeb43c",3835:"fbe4d9b1",4558:"7388ce67",4589:"e78ef44e",5040:"a5bd22c4",5207:"d95cde39",5329:"32a328a7",5638:"089f217d",5794:"82cc8a21",6079:"36c8e849",6215:"a48cbf18",6324:"157a52a9",6523:"d4d5365a",6561:"f0cece07",7184:"e666172f",7523:"a18b735e",7590:"727bfece",7880:"5e6febf3",7968:"1d0824b1",8039:"eeeae3a7",8069:"5ef4c270",8179:"2fdb982c",8327:"4b4058a8",8391:"3ecab78d",8621:"a58665a4",8769:"294a7607",8825:"d5cc7895",9962:"68c87814"}[e]+".css"}}(),function(){s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="platypush:";s.l=function(n,i,o,a){if(e[n])e[n].push(i);else{var r,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+o){r=u;break}}r||(l=!0,r=document.createElement("script"),r.charset="utf-8",r.timeout=120,s.nc&&r.setAttribute("nonce",s.nc),r.setAttribute("data-webpack",t+o),r.src=n),e[n]=[i];var p=function(t,s){r.onerror=r.onload=null,clearTimeout(h);var i=e[n];if(delete e[n],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach((function(e){return e(s)})),t)return t(s)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}}}(),function(){s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){s.p="/"}(),function(){if("undefined"!==typeof document){var e=function(e,t,s,n,i){var o=document.createElement("link");o.rel="stylesheet",o.type="text/css";var a=function(s){if(o.onerror=o.onload=null,"load"===s.type)n();else{var a=s&&("load"===s.type?"missing":s.type),r=s&&s.target&&s.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=a,l.request=r,o.parentNode&&o.parentNode.removeChild(o),i(l)}};return o.onerror=o.onload=a,o.href=t,s?s.parentNode.insertBefore(o,s.nextSibling):document.head.appendChild(o),o},t=function(e,t){for(var s=document.getElementsByTagName("link"),n=0;n<s.length;n++){var i=s[n],o=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(o===e||o===t))return i}var a=document.getElementsByTagName("style");for(n=0;n<a.length;n++){i=a[n],o=i.getAttribute("data-href");if(o===e||o===t)return i}},n=function(n){return new Promise((function(i,o){var a=s.miniCssF(n),r=s.p+a;if(t(a,r))return i();e(n,r,null,i,o)}))},i={2143:0};s.f.miniCss=function(e,t){var s={65:1,169:1,306:1,311:1,446:1,523:1,729:1,746:1,984:1,1259:1,1391:1,1449:1,1880:1,2217:1,2460:1,2471:1,2893:1,2976:1,2986:1,3368:1,3369:1,3559:1,3594:1,3598:1,3694:1,3798:1,3826:1,3835:1,4558:1,4589:1,5040:1,5207:1,5329:1,5638:1,5794:1,6079:1,6215:1,6324:1,6523:1,6561:1,7184:1,7523:1,7590:1,7880:1,7968:1,8039:1,8069:1,8179:1,8327:1,8391:1,8621:1,8769:1,8825:1,9962:1};i[e]?t.push(i[e]):0!==i[e]&&s[e]&&t.push(i[e]=n(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))}}}(),function(){var e={2143:0};s.f.j=function(t,n){var i=s.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else if(/^(80[36]9|(139|247|656)1|3826|5040|6079)$/.test(t))e[t]=0;else{var o=new Promise((function(s,n){i=e[t]=[s,n]}));n.push(i[2]=o);var a=s.p+s.u(t),r=new Error,l=function(n){if(s.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",r.name="ChunkLoadError",r.type=o,r.request=a,i[1](r)}};s.l(a,l,"chunk-"+t,t)}},s.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,a=n[0],r=n[1],l=n[2],c=0;if(a.some((function(t){return 0!==e[t]}))){for(i in r)s.o(r,i)&&(s.m[i]=r[i]);if(l)var d=l(s)}for(t&&t(n);c<a.length;c++)o=a[c],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return s.O(d)},n=self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var n=s.O(void 0,[4998],(function(){return s(7981)}));n=s.O(n)})();
//# sourceMappingURL=app.96a099d1.js.map