platypush/platypush/backend/http/webapp/dist/static/js/app.9978a5f2.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(e){function t(t){for(var c,s,i=t[0],o=t[1],u=t[2],l=0,d=[];l<i.length;l++)s=i[l],Object.prototype.hasOwnProperty.call(a,s)&&a[s]&&d.push(a[s][0]),a[s]=0;for(c in o)Object.prototype.hasOwnProperty.call(o,c)&&(e[c]=o[c]);h&&h(t);while(d.length)d.shift()();return r.push.apply(r,u||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],c=!0,s=1;s<n.length;s++){var i=n[s];0!==a[i]&&(c=!1)}c&&(r.splice(t--,1),e=o(o.s=n[0]))}return e}var c={},s={app:0},a={app:0},r=[];function i(e){return o.p+"static/js/"+({}[e]||e)+"."+{"chunk-01c1b3b0":"33dec1bb","chunk-06539e5d":"1a0f4e72","chunk-5d632024":"5840de9b","chunk-0021f7ee":"d66579e6","chunk-07773226":"6dacd37d","chunk-0827360a":"dc951e0a","chunk-35986630":"c4a2021e","chunk-60dbbc82":"478f9d0a","chunk-972487d6":"5f1981e6","chunk-c4aee99e":"9dc547f2","chunk-6ee47cbe":"3a207d3e","chunk-178b19d7":"1c7265c0","chunk-2d2091df":"f4b1ca67","chunk-45557166":"38c65779","chunk-49f94906":"c4aff4c4","chunk-6c14c2d1":"94636887","chunk-75da0704":"8ee2e66d","chunk-09eaa919":"4ce3bde5","chunk-0b810405":"8d15fdfc","chunk-1ad96db7":"02188e12","chunk-31bc5041":"ff5b04fa","chunk-40ee55e4":"0f249e23","chunk-57f8147d":"da91a3db","chunk-2d0d6b06":"619bfe58","chunk-2d22495e":"eee3df12","chunk-5d73ace1":"8c73eb72","chunk-690ef4aa":"f4ca9bdd","chunk-6c9a679d":"32394b9f","chunk-437beeb4":"a95dbde9","chunk-b6886800":"dc96fe16","chunk-db69e00c":"ff21720b","chunk-571780de":"56f07ce7","chunk-2d21da1a":"7fc760ec","chunk-9684cd10":"16a1722a","chunk-052643ba":"e6175d94","chunk-2d0b270c":"6c0f5d6c","chunk-2d0c1eb0":"13e71eba","chunk-2d21b0dc":"d599a7c3","chunk-2d231217":"4d511b64","chunk-6f3814a8":"40fe4e1f","chunk-74fb6755":"ac3b8fd6","chunk-2d0aa612":"e0afa3cd","chunk-2d0c229a":"89f6da32","chunk-2d0d5f97":"804f6cc8","chunk-2d0da3df":"1ed597cb","chunk-2d208116":"78fc8daf","chunk-75e68c24":"0b0c9dd6","chunk-a018ff46":"c0daa80d","chunk-2d0cc2be":"2dbd327d","chunk-2d237d41":"7c3c1e49","chunk-d8561e02":"586340f2"}[e]+".js"}function o(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],n={"chunk-01c1b3b0":1,"chunk-06539e5d":1,"chunk-5d632024":1,"chunk-0021f7ee":1,"chunk-07773226":1,"chunk-0827360a":1,"chunk-35986630":1,"chunk-60dbbc82":1,"chunk-972487d6":1,"chunk-c4aee99e":1,"chunk-6ee47cbe":1,"chunk-178b19d7":1,"chunk-45557166":1,"chunk-49f94906":1,"chunk-6c14c2d1":1,"chunk-75da0704":1,"chunk-09eaa919":1,"chunk-0b810405":1,"chunk-1ad96db7":1,"chunk-31bc5041":1,"chunk-40ee55e4":1,"chunk-57f8147d":1,"chunk-5d73ace1":1,"chunk-690ef4aa":1,"chunk-6c9a679d":1,"chunk-437beeb4":1,"chunk-b6886800":1,"chunk-db69e00c":1,"chunk-571780de":1,"chunk-9684cd10":1,"chunk-052643ba":1,"chunk-6f3814a8":1,"chunk-74fb6755":1,"chunk-75e68c24":1,"chunk-a018ff46":1,"chunk-d8561e02":1};s[e]?t.push(s[e]):0!==s[e]&&n[e]&&t.push(s[e]=new Promise((function(t,n){for(var c="static/css/"+({}[e]||e)+"."+{"chunk-01c1b3b0":"6bf22fce","chunk-06539e5d":"a37063a7","chunk-5d632024":"4e589a50","chunk-0021f7ee":"0a2f05d9","chunk-07773226":"3ce5e818","chunk-0827360a":"54ee8b20","chunk-35986630":"2ebc3de8","chunk-60dbbc82":"55f7ede0","chunk-972487d6":"f475a218","chunk-c4aee99e":"c669bc57","chunk-6ee47cbe":"d1c66125","chunk-178b19d7":"33531ad8","chunk-2d2091df":"31d6cfe0","chunk-45557166":"080e2847","chunk-49f94906":"c1f5e8de","chunk-6c14c2d1":"5354e645","chunk-75da0704":"0ac8383d","chunk-09eaa919":"38a05394","chunk-0b810405":"96d60845","chunk-1ad96db7":"42375467","chunk-31bc5041":"49496a07","chunk-40ee55e4":"58afedb7","chunk-57f8147d":"b22779c7","chunk-2d0d6b06":"31d6cfe0","chunk-2d22495e":"31d6cfe0","chunk-5d73ace1":"c5e74fa9","chunk-690ef4aa":"6711f0b2","chunk-6c9a679d":"83cde918","chunk-437beeb4":"1582e2d0","chunk-b6886800":"594b16d3","chunk-db69e00c":"dccd4270","chunk-571780de":"f28ca7e9","chunk-2d21da1a":"31d6cfe0","chunk-9684cd10":"7cdaa500","chunk-052643ba":"b0333423","chunk-2d0b270c":"31d6cfe0","chunk-2d0c1eb0":"31d6cfe0","chunk-2d21b0dc":"31d6cfe0","chunk-2d231217":"31d6cfe0","chunk-6f3814a8":"0021da66","chunk-74fb6755":"a7fa242b","chunk-2d0aa612":"31d6cfe0","chunk-2d0c229a":"31d6cfe0","chunk-2d0d5f97":"31d6cfe0","chunk-2d0da3df":"31d6cfe0","chunk-2d208116":"31d6cfe0","chunk-75e68c24":"397c4e62","chunk-a018ff46":"edca8ceb","chunk-2d0cc2be":"31d6cfe0","chunk-2d237d41":"31d6cfe0","chunk-d8561e02":"cbfca9f4"}[e]+".css",a=o.p+c,r=document.getElementsByTagName("link"),i=0;i<r.length;i++){var u=r[i],l=u.getAttribute("data-href")||u.getAttribute("href");if("stylesheet"===u.rel&&(l===c||l===a))return t()}var d=document.getElementsByTagName("style");for(i=0;i<d.length;i++){u=d[i],l=u.getAttribute("data-href");if(l===c||l===a)return t()}var h=document.createElement("link");h.rel="stylesheet",h.type="text/css",h.onload=t,h.onerror=function(t){var c=t&&t.target&&t.target.src||a,r=new Error("Loading CSS chunk "+e+" failed.\n("+c+")");r.code="CSS_CHUNK_LOAD_FAILED",r.request=c,delete s[e],h.parentNode.removeChild(h),n(r)},h.href=a;var b=document.getElementsByTagName("head")[0];b.appendChild(h)})).then((function(){s[e]=0})));var c=a[e];if(0!==c)if(c)t.push(c[2]);else{var r=new Promise((function(t,n){c=a[e]=[t,n]}));t.push(c[2]=r);var u,l=document.createElement("script");l.charset="utf-8",l.timeout=120,o.nc&&l.setAttribute("nonce",o.nc),l.src=i(e);var d=new Error;u=function(t){l.onerror=l.onload=null,clearTimeout(h);var n=a[e];if(0!==n){if(n){var c=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+c+": "+s+")",d.name="ChunkLoadError",d.type=c,d.request=s,n[1](d)}a[e]=void 0}};var h=setTimeout((function(){u({type:"timeout",target:l})}),12e4);l.onerror=l.onload=u,document.head.appendChild(l)}return Promise.all(t)},o.m=e,o.c=c,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)o.d(n,c,function(t){return e[t]}.bind(null,c));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/",o.oe=function(e){throw console.error(e),e};var u=window["webpackJsonp"]=window["webpackJsonp"]||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var d=0;d<u.length;d++)t(u[d]);var h=l;r.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"0159":function(e,t,n){"use strict";n("f67c")},"02bd":function(e,t,n){},"0604":function(e,t,n){},"0f0c":function(e,t,n){var c={"./Camera/Index":["1ed9","chunk-74fb6755"],"./CameraAndroidIpcam/Index":["4626","chunk-690ef4aa"],"./CameraCv/Index":["6b85","chunk-74fb6755","chunk-2d0da3df"],"./CameraFfmpeg/Index":["a2e4","chunk-74fb6755","chunk-2d208116"],"./CameraGstreamer/Index":["48aa","chunk-74fb6755","chunk-2d0c229a"],"./CameraIrMlx90640/Index":["1184","chunk-74fb6755","chunk-2d0aa612"],"./CameraPi/Index":["7129","chunk-74fb6755","chunk-2d0d5f97"],"./Execute/Index":["10ff","chunk-1ad96db7"],"./Light/Index":["cf99","chunk-06539e5d","chunk-6ee47cbe","chunk-178b19d7"],"./LightHue/Index":["a84f","chunk-06539e5d","chunk-6ee47cbe","chunk-178b19d7","chunk-2d2091df"],"./Media/Index":["3951","chunk-6ee47cbe","chunk-db69e00c","chunk-9684cd10","chunk-052643ba"],"./MediaMplayer/Index":["47a8","chunk-6ee47cbe","chunk-db69e00c","chunk-9684cd10","chunk-052643ba","chunk-2d0c1eb0"],"./MediaMpv/Index":["23b7","chunk-6ee47cbe","chunk-db69e00c","chunk-9684cd10","chunk-052643ba","chunk-2d0b270c"],"./MediaOmxplayer/Index":["eede","chunk-6ee47cbe","chunk-db69e00c","chunk-9684cd10","chunk-052643ba","chunk-2d231217"],"./MediaVlc/Index":["bdae","chunk-6ee47cbe","chunk-db69e00c","chunk-9684cd10","chunk-052643ba","chunk-2d21b0dc"],"./Music/Index":["0d41","chunk-6ee47cbe","chunk-db69e00c","chunk-571780de"],"./MusicMpd/Index":["d1b9","chunk-6ee47cbe","chunk-db69e00c","chunk-571780de","chunk-2d21da1a"],"./MusicSnapcast/Index":["d5eb","chunk-06539e5d","chunk-6ee47cbe","chunk-45557166"],"./Rtorrent/Index":["4d91","chunk-9684cd10","chunk-a018ff46","chunk-2d0cc2be"],"./Settings/Index":["68c5"],"./Sound/Index":["dbf7","chunk-40ee55e4"],"./Switches/Index":["6341","chunk-31bc5041"],"./Switches/LightHue/Index":["0219","chunk-06539e5d","chunk-5d632024","chunk-35986630"],"./Switches/Smartthings/Index":["6e68","chunk-06539e5d","chunk-5d632024","chunk-972487d6"],"./Switches/SwitchSwitchbot/Index":["5083","chunk-06539e5d","chunk-5d632024","chunk-0021f7ee"],"./Switches/SwitchTplink/Index":["d11f","chunk-06539e5d","chunk-5d632024","chunk-c4aee99e"],"./Switches/SwitchWemo/Index":["bedd","chunk-06539e5d","chunk-5d632024","chunk-60dbbc82"],"./Switches/ZigbeeMqtt/Index":["65d6","chunk-06539e5d","chunk-5d632024","chunk-07773226"],"./Switches/Zwave/Index":["e170","chunk-06539e5d","chunk-5d632024","chunk-0827360a"],"./Torrent/Index":["fd7d","chunk-9684cd10","chunk-a018ff46","chunk-2d237d41"],"./Tts/Index":["e184","chunk-57f8147d","chunk-2d22495e"],"./TtsGoogle/Index":["742e","chunk-57f8147d","chunk-2d0d6b06"],"./TvSamsungWs/Index":["0f3a","chunk-0b810405"],"./ZigbeeMqtt/Index":["655e","chunk-06539e5d","chunk-6ee47cbe","chunk-6c14c2d1"],"./Zwave/Index":["234d","chunk-06539e5d","chunk-6ee47cbe","chunk-75da0704"]};function s(e){if(!n.o(c,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=c[e],s=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(s)}))}s.keys=function(){return Object.keys(c)},s.id="0f0c",e.exports=s},"191e":function(e,t,n){"use strict";n("737e")},"2bfe":function(e,t,n){"use strict";n("0604")},"2e56":function(e,t,n){"use strict";n("7907")},"3a5e":function(e,t,n){"use strict";var c=n("7a23"),s=Object(c["K"])("data-v-4d9c871b");Object(c["u"])("data-v-4d9c871b");var a={class:"loading"},r={class:"icon"};Object(c["s"])();var i=s((function(e,t){return Object(c["r"])(),Object(c["e"])("div",a,[Object(c["h"])("div",r,[(Object(c["r"])(),Object(c["e"])(c["a"],null,Object(c["x"])(4,(function(e){return Object(c["h"])("div",{key:e})})),64))])])}));n("4f22");const o={};o.render=i,o.__scopeId="data-v-4d9c871b";t["a"]=o},"3e54":function(e,t,n){"use strict";n("d3b7");var c=n("bc3a"),s=n.n(c),a={name:"Api",methods:{execute:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,c={};return"target"in e&&e["target"]||(e["target"]="localhost"),"type"in e&&e["type"]||(e["type"]="request"),n&&(c.timeout=n),new Promise((function(n,a){s.a.post("/execute",e,c).then((function(e){var c;if(e=e.data.response,null===(c=e.errors)||void 0===c?void 0:c.length){var s,r=(null===(s=e.errors)||void 0===s?void 0:s[0])||e;t.notify({text:r,error:!0}),a(r)}else n(e.output)})).catch((function(e){t.notify({text:e,error:!0}),a(e)}))}))},request:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6e4;return this.execute({type:"request",action:e,args:t},n)}}},r=a,i=(n("13d5"),n("ac1f"),n("1276"),n("3835")),o={name:"Cookies",methods:{getCookies:function(){return document.cookie.split(/;\s*/).reduce((function(e,t){var n=t.split("="),c=Object(i["a"])(n,2),s=c[0],a=c[1];return e[s]=a,e}),{})}}},u=o,l=(n("99af"),{name:"DateTime",methods:{formatDate:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"===typeof e&&(e=new Date(Date.parse(e))),e.toDateString().substring(0,t?15:10)},formatTime:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return"string"===typeof e&&(e=new Date(Date.parse(e))),e.toTimeString().substring(0,t?8:5)},formatDateTime:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return"string"===typeof e&&(e=new Date(Date.parse(e))),"".concat(this.formatDate(e,t),", ").concat(this.formatTime(e,n))}}}),d=l,h=(n("d81d"),n("ddb0"),n("2909")),b=n("f5ef"),f={name:"Events",computed:{_eventsReady:function(){var e;return null===(e=this.$root.$refs.events)||void 0===e?void 0:e.initialized}},methods:{subscribe:function(e,t){for(var n=this,c=arguments.length,s=new Array(c>2?c-2:0),a=2;a<c;a++)s[a-2]=arguments[a];var r=function(){b["a"].emit("subscribe",{events:s,handler:e,handlerName:t||n.generateId()})};if(!this._eventsReady){var i=this,o=this.$watch((function(){return i._eventsReady}),(function(e){e&&(r(),o())}));return o}r()},unsubscribe:function(e){b["a"].emit("unsubscribe",e)},generateId:function(){return btoa(Object(h["a"])(Array(11).keys()).map((function(){return String.fromCharCode(Math.round(255*Math.random()))})))}}},p=f,m={name:"Notification",methods:{notify:function(e){b["a"].emit("notification-create",e)},warn:function(e){this.notify({text:e,warning:!0})},error:function(e){throw this.notify({text:e,error:!0}),e}}},O=m,g={name:"Screen",methods:{isMobile:function(){return window.matchMedia("only screen and (max-width: 760px)").matches},isTablet:function(){return!this.isMobile()&&window.matchMedia("only screen and (max-width: 960px)").matches},isDesktop:function(){return window.matchMedia("only screen and (min-width: 1152px)").matches}}},j=g,v=(n("4160"),n("b680"),{name:"Types",methods:{parseBoolean:function(e){return"string"===typeof e?(e=e.toLowerCase(),"true"===e||"false"!==e&&!!parseInt(e)):!!e},convertSize:function(e){"string"===typeof e&&(e=parseInt(e));var t=null,n=["B","KB","MB","GB","TB"];return n.forEach((function(c,s){e<=1024&&null==t?t=c:e>1024&&(s===n.length-1?t=c:e/=1024)})),"".concat(e.toFixed(2)," ").concat(t)}}}),k=v,y={name:"Utils",mixins:[r,u,O,p,d,j,k]};t["a"]=y},4206:function(e,t,n){},"4f22":function(e,t,n){"use strict";n("d4c7")},5056:function(e){e.exports=JSON.parse('{"a":{"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"},"execute":{"class":"fa fa-play"},"light.hue":{"class":"fas fa-lightbulb"},"media.omxplayer":{"class":"fa fa-film"},"media.mplayer":{"class":"fa fa-film"},"media.mpv":{"class":"fa fa-film"},"media.vlc":{"class":"fa fa-film"},"music.mpd":{"class":"fas fa-music"},"music.snapcast":{"class":"fa fa-volume-up"},"torrent":{"class":"fa fa-magnet"},"rtorrent":{"class":"fa fa-magnet"},"switches":{"class":"fas fa-toggle-on"},"sound":{"class":"fa fa-microphone"},"tts":{"class":"far fa-comment"},"tts.google":{"class":"fas fa-comment"},"tv.samsung.ws":{"class":"fas fa-tv"},"zigbee.mqtt":{"imgUrl":"/icons/zigbee.svg"},"zwave":{"imgUrl":"/icons/z-wave.png"}}}')},"524a":function(e,t,n){"use strict";var c=n("7a23"),s=Object(c["K"])("data-v-3cb494ce");Object(c["u"])("data-v-3cb494ce");var a={key:0,class:"col-1 icon"};Object(c["s"])();var r=s((function(e,t,n,s,r,i){return Object(c["r"])(),Object(c["e"])("div",{class:"row item",onClick:t[1]||(t[1]=function(){return i.clicked.apply(i,arguments)})},[n.iconClass?(Object(c["r"])(),Object(c["e"])("div",a,[Object(c["h"])("i",{class:n.iconClass},null,2)])):Object(c["f"])("",!0),Object(c["h"])("div",{class:["text",{"col-11":null!=n.iconClass}],textContent:Object(c["C"])(n.text)},null,10,["textContent"])])})),i={name:"DropdownItem",props:{iconClass:{type:String},text:{type:String},disabled:{type:Boolean,default:!1}},methods:{clicked:function(e){this.$parent.$emit("click",e),this.$parent.visible=!1}}};n("c9a1");i.render=r,i.__scopeId="data-v-3cb494ce";t["a"]=i},5611:function(e,t,n){},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var c=n("7a23");function s(e,t,n,s,a,r){var i=Object(c["z"])("Events"),o=Object(c["z"])("Notifications"),u=Object(c["z"])("VoiceAssistant"),l=Object(c["z"])("Pushbullet"),d=Object(c["z"])("router-view");return Object(c["r"])(),Object(c["e"])(c["a"],null,[r.hasWebsocket?(Object(c["r"])(),Object(c["e"])(i,{key:0,ref:"events","ws-port":a.config["backend.http"].websocket_port},null,8,["ws-port"])):Object(c["f"])("",!0),Object(c["h"])(o,{ref:"notifications"},null,512),r.hasAssistant?(Object(c["r"])(),Object(c["e"])(u,{key:1,ref:"voice-assistant"},null,512)):Object(c["f"])("",!0),r.hasPushbullet?(Object(c["r"])(),Object(c["e"])(l,{key:2,ref:"pushbullet"},null,512)):Object(c["f"])("",!0),Object(c["h"])(d)],64)}n("96cf");var a=n("1da1"),r=(n("9911"),Object(c["K"])("data-v-6dc8bebc"));Object(c["u"])("data-v-6dc8bebc");var i={class:"notifications"};Object(c["s"])();var o=r((function(e,t,n,s,a,r){var o=Object(c["z"])("Notification");return Object(c["r"])(),Object(c["e"])("div",i,[(Object(c["r"])(!0),Object(c["e"])(c["a"],null,Object(c["x"])(e.notifications,(function(e,t,n){return Object(c["r"])(),Object(c["e"])(o,{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:r.destroy},null,8,["id","text","html","title","link","image","warning","error","onClicked"])})),128))])})),u=(n("a9e3"),Object(c["K"])("data-v-7646705e"));Object(c["u"])("data-v-7646705e");var l={class:"body"},d={key:0,class:"image col-3"},h={class:"row"},b={key:3,class:"fa fa-exclamation"},f={key:4,class:"fa fa-times"};Object(c["s"])();var p=u((function(e,t,n,s,a,r){return Object(c["r"])(),Object(c["e"])("div",{class:["notification fade-in",{warning:n.warning,error:n.error}],onClick:t[1]||(t[1]=function(){return r.clicked.apply(r,arguments)})},[n.title?(Object(c["r"])(),Object(c["e"])("div",{key:0,class:"title",textContent:Object(c["C"])(n.title)},null,8,["textContent"])):Object(c["f"])("",!0),Object(c["h"])("div",l,[n.image||n.warning||n.error?(Object(c["r"])(),Object(c["e"])("div",d,[Object(c["h"])("div",h,[n.image&&n.image.src?(Object(c["r"])(),Object(c["e"])("img",{key:0,src:n.image.src,alt:""},null,8,["src"])):n.image&&n.image.icon?(Object(c["r"])(),Object(c["e"])("i",{key:1,class:["fa","fa-"+n.image.icon],style:n.image.color?"--color: "+n.image.color:""},null,6)):n.image&&n.image.iconClass?(Object(c["r"])(),Object(c["e"])("i",{key:2,class:n.image.iconClass,style:n.image.color?"--color: "+n.image.color:""},null,6)):n.warning?(Object(c["r"])(),Object(c["e"])("i",b)):n.error?(Object(c["r"])(),Object(c["e"])("i",f)):Object(c["f"])("",!0)])])):Object(c["f"])("",!0),n.text&&n.image?(Object(c["r"])(),Object(c["e"])("div",{key:1,class:"text col-9",textContent:Object(c["C"])(n.text)},null,8,["textContent"])):Object(c["f"])("",!0),n.html&&n.image?(Object(c["r"])(),Object(c["e"])("div",{key:2,class:"text col-9",innerHTML:n.html},null,8,["innerHTML"])):Object(c["f"])("",!0),n.text&&!n.image?(Object(c["r"])(),Object(c["e"])("div",{key:3,class:"text row horizontal-center",textContent:Object(c["C"])(n.text)},null,8,["textContent"])):Object(c["f"])("",!0),n.html&&!n.image?(Object(c["r"])(),Object(c["e"])("div",{key:4,class:"text row horizontal-center",innerHTML:n.html},null,8,["innerHTML"])):Object(c["f"])("",!0)])],2)})),m={name:"Notification",props:["id","text","html","title","image","link","error","warning"],methods:{clicked:function(){this.link&&window.open(this.link,"_blank"),this.$emit("clicked",this.id)}}};n("f34e");m.render=p,m.__scopeId="data-v-7646705e";var O=m,g={name:"Notifications",components:{Notification:O},props:{duration:{type:Number,default:1e4}},data:function(){return{index:0,notifications:{},timeouts:{}}},methods:{create:function(e){var t=this.index++;this.notifications[t]=e,null==e.duration&&(e.duration=this.duration);var 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]}}};n("2e56");g.render=o,g.__scopeId="data-v-6dc8bebc";var j=g,v=n("3e54");function k(e,t,n,s,a,r){return Object(c["r"])(),Object(c["e"])("div")}n("99af"),n("b64b"),n("07ac");var y=n("b85c"),w=n("2909"),x=n("f5ef"),C={name:"Events",props:{wsPort:{type:Number,default:8009}},data:function(){return{ws:null,initialized:!1,pending:!1,opened:!1,timeout:null,reconnectMsecs:3e4,handlers:{},handlerNameToEventTypes:{}}},methods:{onWebsocketTimeout:function(){console.log("Websocket reconnection timed out, retrying"),this.pending=!1,this.ws&&this.ws.close(),this.onClose()},onMessage:function(e){var t=[];if(e=e.data,"string"===typeof e)try{e=JSON.parse(e)}catch(a){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.apply(t,Object(w["a"])(Object.values(this.handlers[e.args.type])));for(var n=0,c=t;n<c.length;n++){var s=c[n];s&&(s instanceof Array?s=s[0]:s instanceof Object&&!(s instanceof Function)&&(s=Object.values(s)[0]),s(e.args))}}},onOpen:function(){this.opened&&(console.log("There's already an opened websocket connection, closing the newly opened one"),this.ws&&(this.ws.onclose=function(){},this.ws.close())),console.log("Websocket connection successful"),this.opened=!0,this.pending&&(this.pending=!1),this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)},onError:function(e){console.error("Websocket error"),console.error(e)},onClose:function(e){e&&console.log("Websocket closed - code: "+e.code+" - reason: "+e.reason),this.opened=!1,this.pending||(this.pending=!0,this.init())},init:function(){try{var e="https:"===location.protocol?"wss":"ws",t="".concat(e,"://").concat(location.hostname,":").concat(this.wsPort);this.ws=new WebSocket(t)}catch(n){return console.error("Websocket initialization error"),void console.error(n)}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:function(e){var t,n=this,c=e.handler,s=e.events.length?e.events:[null],a=e.handlerName,r=Object(y["a"])(s);try{for(r.s();!(t=r.n()).done;){var i=t.value;i in this.handlers||(this.handlers[i]={}),a in this.handlerNameToEventTypes||(this.handlerNameToEventTypes[a]=s),this.handlers[i][a]=c}}catch(o){r.e(o)}finally{r.f()}return function(){n.unsubscribe(a)}},unsubscribe:function(e){var t=this.handlerNameToEventTypes[e];if(t){var n,c=Object(y["a"])(t);try{for(c.s();!(n=c.n()).done;){var s,a=n.value;(null===(s=this.handlers[a])||void 0===s?void 0:s[e])&&(delete this.handlers[a][e],Object.keys(this.handlers[a]).length||delete this.handlers[a])}}catch(r){c.e(r)}finally{c.f()}delete this.handlerNameToEventTypes[e]}}},created:function(){x["a"].on("subscribe",this.subscribe),x["a"].on("unsubscribe",this.unsubscribe),this.init()}};C.render=k;var S=C,_={class:"assistant-modal"},I={class:"icon"},T={key:0,class:"fa fa-bell"},R={key:1,class:"fa fa-volume-up"},P={key:2,class:"fa fa-comment-dots"},M={key:3,class:"fa fa-microphone"},z={class:"text"},N={key:0,class:"listening"},U=Object(c["h"])("span",null,"Assistant listening",-1),$={key:1,class:"speech-recognized"},E={key:2,class:"responding"};function D(e,t,n,s,a,r){var i=Object(c["z"])("Modal");return Object(c["r"])(),Object(c["e"])("div",_,[Object(c["h"])(i,{ref:"assistantModal"},{default:Object(c["H"])((function(){return[Object(c["h"])("div",I,[a.state.alerting?(Object(c["r"])(),Object(c["e"])("i",T)):a.state.responding?(Object(c["r"])(),Object(c["e"])("i",R)):a.state.speechRecognized?(Object(c["r"])(),Object(c["e"])("i",P)):(Object(c["r"])(),Object(c["e"])("i",M))]),Object(c["h"])("div",z,[a.state.listening?(Object(c["r"])(),Object(c["e"])("div",N,[U])):a.state.speechRecognized?(Object(c["r"])(),Object(c["e"])("div",$,[Object(c["h"])("span",{textContent:Object(c["C"])(a.phrase)},null,8,["textContent"])])):a.state.responding?(Object(c["r"])(),Object(c["e"])("div",E,[Object(c["h"])("span",{textContent:Object(c["C"])(a.responseText)},null,8,["textContent"])])):Object(c["f"])("",!0)])]})),_:1},512)])}var A=n("714b"),V={name:"VoiceAssistant",components:{Modal:A["a"]},mixins:[v["a"]],data:function(){return{responseText:"",phrase:"",hideTimeout:void 0,state:{listening:!1,speechRecognized:!1,responding:!1,alerting:!1}}},methods:{reset:function(){this.state.listening=!1,this.state.speechRecognized=!1,this.state.responding=!1,this.state.alerting=!1,this.phrase="",this.responseText=""},conversationStart:function(){this.reset(),this.state.listening=!0,this.$refs.assistantModal.show(),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0)},conversationEnd:function(){var e=this,t=this;this.hideTimeout=setTimeout((function(){e.reset(),t.$refs.assistantModal.close(),t.hideTimeout=void 0}),4e3)},speechRecognized:function(e){this.reset(),this.state.speechRecognized=!0,this.phrase=e.phrase,this.$refs.assistantModal.show()},response:function(e){this.reset(),this.state.responding=!0,this.responseText=e.response_text,this.$refs.assistantModal.show()},alertOn:function(){this.reset(),this.state.alerting=!0,this.$refs.assistantModal.show()},alertOff:function(){this.reset(),this.state.alerting=!1,this.$refs.assistantModal.close()},registerHandlers:function(){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:function(){this.registerHandlers()}};n("d73f");V.render=D;var q=V;function L(e,t,n,s,a,r){return Object(c["r"])(),Object(c["e"])("div")}var W={name:"Pushbullet",mixins:[v["a"]],methods:{onMessage:function(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:function(){this.subscribe(this.onMessage,null,"platypush.message.event.pushbullet.PushbulletEvent")}};W.render=L;var H=W,B={name:"App",mixins:[v["a"]],components:{Pushbullet:H,Notifications:j,Events:S,VoiceAssistant:q},data:function(){return{config:{},userAuthenticated:!1}},computed:{hasWebsocket:function(){return this.userAuthenticated&&"backend.http"in this.config},hasAssistant:function(){return this.hasWebsocket},hasPushbullet:function(){return this.hasWebsocket&&("pushbullet"in this.config||"backend.pushbullet"in this.config)}},methods:{onNotification:function(e){this.$refs.notifications.create(e)},initConfig:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("config.get");case 2:e.config=t.sent,e.userAuthenticated=!0;case 4:case"end":return t.stop()}}),t)})))()}},created:function(){this.initConfig()},mounted:function(){x["a"].on("notification-create",this.onNotification)}};n("d08b");B.render=s;var F=B,K=n("6c02"),J=Object(c["K"])("data-v-5c64bb76"),G=J((function(e,t,n,s,a,r){var i=Object(c["z"])("Loading"),o=Object(c["z"])("Widget"),u=Object(c["z"])("Row");return Object(c["r"])(),Object(c["e"])(c["a"],null,[a.loading?(Object(c["r"])(),Object(c["e"])(i,{key:0})):Object(c["f"])("",!0),Object(c["h"])("div",{id:"dashboard",class:["columns is-mobile",r.classes],style:a.style},[(Object(c["r"])(!0),Object(c["e"])(c["a"],null,Object(c["x"])(a.rows,(function(e,t){return Object(c["r"])(),Object(c["e"])(u,{key:t,class:e.class,style:e.style},{default:J((function(){return[(Object(c["r"])(!0),Object(c["e"])(c["a"],null,Object(c["x"])(e.widgets,(function(e,t){return Object(c["r"])(),Object(c["e"])(c["b"],{key:t},[Object(c["h"])(o,{style:e.style,class:e.class},{default:J((function(){return[(Object(c["r"])(),Object(c["e"])(Object(c["A"])(e.component),r.getWidgetProps(e),null,16))]})),_:2},1032,["style","class"])],1024)})),128))]})),_:2},1032,["class","style"])})),128))],6)],64)})),Z=(n("d81d"),n("13d5"),n("b0c0"),n("b680"),n("d3b7"),n("5530")),X=n("3a5e"),Y=Object(c["K"])("data-v-1b4663f2"),Q=Y((function(e,t,n,s,a,r){return Object(c["r"])(),Object(c["e"])("div",{class:["row",r.classes],style:n.style},[Object(c["y"])(e.$slots,"default")],6)})),ee={name:"Row",props:{class:{type:String,required:!1,default:""},style:{type:String,required:!1,default:""}},computed:{classes:function(){return this.class}}};n("6682");ee.render=Q,ee.__scopeId="data-v-1b4663f2";var te=ee,ne=Object(c["K"])("data-v-5df52982"),ce=ne((function(e,t,n,s,a,r){return Object(c["r"])(),Object(c["e"])("div",{style:n.style,class:r.classes},[Object(c["y"])(e.$slots,"default")],6)})),se=(n("ac1f"),n("1276"),{name:"Widget",props:{style:{type:String,required:!1,default:""},class:{type:String,required:!1,default:""}},computed:{classes:function(){var e;return((null===(e=this.class)||void 0===e?void 0:e.length)?this.class.split(" "):["col-3"]).concat(["widget","column"])}}});n("db09");se.render=ce,se.__scopeId="data-v-5df52982";var ae=se,re={name:"Dashboard",mixins:[v["a"]],components:{Widget:ae,Loading:X["a"],Row:te},props:{refreshSeconds:{type:Number,required:!1,default:0}},data:function(){return{rows:[],loading:!1,style:void 0,class:void 0}},computed:{classes:function(){return this.class}},methods:{getWidgetProps:function(e){var t=Object(Z["a"])({},e.props);return t.class&&delete t.class,t},parseTemplate:function(e,t){var s,a,r=(new DOMParser).parseFromString(t,"text/xml").childNodes[0],i=this;this.style=null===(s=r.attributes.style)||void 0===s?void 0:s.nodeValue,this.class=null===(a=r.attributes.class)||void 0===a?void 0:a.nodeValue,this.rows=Object(w["a"])(r.getElementsByTagName("Row")).map((function(e){var t,s;return{style:null===(t=e.attributes.style)||void 0===t?void 0:t.nodeValue,class:null===(s=e.attributes.class)||void 0===s?void 0:s.nodeValue,widgets:Object(w["a"])(e.children).map((function(e){var t,s,a=Object(c["i"])((function(){return n("cdb9")("./".concat(e.nodeName,"/Index"))})),r=null===(t=e.attributes.style)||void 0===t?void 0:t.nodeValue,o=null===(s=e.attributes.class)||void 0===s?void 0:s.nodeValue,u=Object(w["a"])(e.attributes).reduce((function(e,t){return"style"!==t.nodeName&&(e[t.nodeName]=t.nodeValue),e}),{content:e.innerHTML}),l={component:a,style:r,class:o,props:u||{}};return i.$options.components[e.nodeName]=a,l}))}})),this.loading=!1},refreshDashboard:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){var n,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,e.widgets=[],n=e.$route.params.name,t.next=5,e.request("config.get_dashboard",{name:n});case 5:c=t.sent,c||e.error("Dashboard ".concat(n," not found")),e.parseTemplate(n,c);case 8:case"end":return t.stop()}}),t)})))()}},mounted:function(){if(this.refreshDashboard(),this.refreshSeconds){var e=this;setInterval((function(){e.refreshDashboard()}),parseInt((1e3*this.refreshSeconds).toFixed(0)))}}};n("7ef9"),n("dde2");re.render=G,re.__scopeId="data-v-5c64bb76";var ie=re;function oe(e,t,n,s,a,r){return Object(c["r"])(),Object(c["e"])("h1",null,"Object not found")}var ue={name:"NotFound"};ue.render=oe;var le=ue,de={class:"login-container"},he={class:"login",method:"POST"},be={class:"description"},fe=Object(c["h"])("div",{class:"row"},[Object(c["h"])("label",null,[Object(c["h"])("input",{type:"text",name:"username",placeholder:"Username"})])],-1),pe=Object(c["h"])("div",{class:"row"},[Object(c["h"])("label",null,[Object(c["h"])("input",{type:"password",name:"password",placeholder:"Password"})])],-1),me={key:0,class:"row"},Oe=Object(c["h"])("label",null,[Object(c["h"])("input",{type:"password",name:"confirm_password",placeholder:"Confirm password"})],-1),ge={class:"row pull-right"},je=Object(c["h"])("div",{class:"row pull-right"},[Object(c["h"])("label",{class:"checkbox"},[Object(c["h"])("input",{type:"checkbox",name:"remember"}),Object(c["g"])("  Keep me logged in on this device   ")])],-1);function ve(e,t,n,s,a,r){return Object(c["r"])(),Object(c["e"])("div",de,[Object(c["h"])("form",he,[Object(c["h"])("div",be,Object(c["C"])(r._register?"Welcome":"Authenticate")+" to platypush ",1),fe,pe,r._register?(Object(c["r"])(),Object(c["e"])("div",me,[Oe])):Object(c["f"])("",!0),Object(c["h"])("div",ge,[Object(c["h"])("input",{type:"submit",class:"btn btn-primary",value:r._register?"Register":"Login"},null,8,["value"])]),je])])}var ke={name:"Login",mixins:[v["a"]],props:{register:{type:Boolean,required:!1,default:!1}},computed:{_register:function(){return this.parseBoolean(this.register)}}};n("9528");ke.render=ve;var ye=ke;function we(e,t,n,s,a,r){var i=Object(c["z"])("Login");return Object(c["r"])(),Object(c["e"])(i,{register:!0})}var xe={name:"Register",mixins:[ye],components:{Login:ye},props:{register:{type:Boolean,required:!1,default:!0}}};xe.render=we;var Ce=xe,Se=Object(c["K"])("data-v-5ec69f95");Object(c["u"])("data-v-5ec69f95");var _e={key:2,class:"canvas"},Ie={class:"panel"},Te={key:3,class:"canvas"};Object(c["s"])();var Re=Se((function(e,t,n,s,a,r){var i=Object(c["z"])("Loading"),o=Object(c["z"])("Nav"),u=Object(c["z"])("Settings");return Object(c["r"])(),Object(c["e"])("main",null,[a.loading?(Object(c["r"])(),Object(c["e"])(i,{key:0})):(Object(c["r"])(),Object(c["e"])(o,{key:1,panels:a.components,"selected-panel":a.selectedPanel,hostname:a.hostname,onSelect:t[1]||(t[1]=function(e){return a.selectedPanel=e})},null,8,["panels","selected-panel","hostname"])),"settings"===a.selectedPanel?(Object(c["r"])(),Object(c["e"])("div",_e,[Object(c["h"])("div",Ie,[Object(c["h"])(u)])])):(Object(c["r"])(),Object(c["e"])("div",Te,[(Object(c["r"])(!0),Object(c["e"])(c["a"],null,Object(c["x"])(a.components,(function(e,t){return Object(c["r"])(),Object(c["e"])("div",{class:["panel",{hidden:t!==a.selectedPanel}],key:t},[t===a.selectedPanel?(Object(c["r"])(),Object(c["e"])(Object(c["A"])(e.component),{key:0,config:e.config,"plugin-name":t},null,8,["config","plugin-name"])):Object(c["f"])("",!0)],2)})),128))]))])})),Pe=(n("4160"),n("a15b"),n("fb6a"),n("4fad"),n("3ca3"),n("466d"),n("159b"),n("ddb0"),n("3835")),Me=Object(c["K"])("data-v-7cd654a6");Object(c["u"])("data-v-7cd654a6");var ze=Object(c["h"])("i",{class:"fas fa-bars"},null,-1),Ne={class:"plugins"},Ue={class:"icon"},$e={key:2,class:"fas fa-puzzle-piece"},Ee={class:"footer"},De={href:"/#settings"},Ae=Object(c["h"])("span",{class:"icon"},[Object(c["h"])("i",{class:"fa fa-cog"})],-1),Ve={key:0,class:"name"},qe={href:"/logout"},Le=Object(c["h"])("span",{class:"icon"},[Object(c["h"])("i",{class:"fas fa-sign-out-alt"})],-1),We={key:0,class:"name"};Object(c["s"])();var He=Me((function(e,t,n,s,a,r){return Object(c["r"])(),Object(c["e"])("nav",{class:{collapsed:a.collapsed}},[Object(c["h"])("div",{class:"toggler",onClick:t[1]||(t[1]=function(e){return a.collapsed=!a.collapsed})},[ze,n.hostname?(Object(c["r"])(),Object(c["e"])("span",{key:0,class:"hostname",textContent:Object(c["C"])(n.hostname)},null,8,["textContent"])):Object(c["f"])("",!0)]),Object(c["h"])("ul",Ne,[(Object(c["r"])(!0),Object(c["e"])(c["a"],null,Object(c["x"])(Object.keys(n.panels).sort(),(function(e){var t,s;return Object(c["r"])(),Object(c["e"])("li",{key:e,class:["entry",{selected:e===n.selectedPanel}],title:e,onClick:function(t){return r.onItemClick(e)}},[Object(c["h"])("a",{href:"/#".concat(e)},[Object(c["h"])("span",Ue,[(null===(t=a.icons[e])||void 0===t?void 0:t.class)?(Object(c["r"])(),Object(c["e"])("i",{key:0,class:a.icons[e].class},null,2)):(null===(s=a.icons[e])||void 0===s?void 0:s.imgUrl)?(Object(c["r"])(),Object(c["e"])("img",{key:1,src:a.icons[e].imgUrl,alt:"name"},null,8,["src"])):(Object(c["r"])(),Object(c["e"])("i",$e))]),a.collapsed?Object(c["f"])("",!0):(Object(c["r"])(),Object(c["e"])("span",{key:0,class:"name",textContent:Object(c["C"])(e)},null,8,["textContent"]))],8,["href"])],10,["title","onClick"])})),128))]),Object(c["h"])("ul",Ee,[Object(c["h"])("li",{class:{selected:"settings"===n.selectedPanel},title:"Settings",onClick:t[2]||(t[2]=function(e){return r.onItemClick("settings")})},[Object(c["h"])("a",De,[Ae,a.collapsed?Object(c["f"])("",!0):(Object(c["r"])(),Object(c["e"])("span",Ve,"Settings"))])],2),Object(c["h"])("li",{title:"Logout",onClick:t[3]||(t[3]=function(e){return r.onItemClick("logout")})},[Object(c["h"])("a",qe,[Le,a.collapsed?Object(c["f"])("",!0):(Object(c["r"])(),Object(c["e"])("span",We,"Logout"))])])])],2)})),Be=n("5056"),Fe={name:"Nav",emits:["select"],mixins:[v["a"]],props:{panels:{type:Object,required:!0},selectedPanel:{type:String},hostname:{type:String}},methods:{onItemClick:function(e){this.$emit("select",e),this.collapsed=!0}},data:function(){return{collapsed:!0,icons:Be["a"],host:null}},mounted:function(){this.isMobile()&&!this.$root.$route.hash.length&&(this.collapsed=!1)}};n("0159");Fe.render=He,Fe.__scopeId="data-v-7cd654a6";var Ke=Fe,Je=n("68c5"),Ge={name:"Panel",mixins:[v["a"]],components:{Settings:Je["default"],Nav:Ke,Loading:X["a"]},data:function(){return{loading:!1,plugins:{},backends:{},procedures:{},components:{},hostname:void 0,selectedPanel:void 0}},methods:{initSelectedPanel:function(){var e=this.$route.hash.match("#?([a-zA-Z0-9.]+)[?]?(.*)");if(e){var t=e[1];(null===t||void 0===t?void 0:t.length)&&(this.selectedPanel=t)}},initPanels:function(){var e=this;this.components={},Object.entries(this.plugins).forEach(function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(s){var r,i,o,u,l,d;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=Object(Pe["a"])(s,2),i=r[0],o=r[1],u=i.split(".").map((function(e){return e[0].toUpperCase()+e.slice(1)})).join(""),l=null,t.prev=3,t.next=6,n("0f0c")("./".concat(u,"/Index"));case 6:l=t.sent,t.next=12;break;case 9:return t.prev=9,t.t0=t["catch"](3),t.abrupt("return");case 12:d=Object(c["i"])(Object(a["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",l);case 1:case"end":return e.stop()}}),e)})))),e.$options.components[i]=d,e.components[i]={component:d,pluginName:i,config:o};case 15:case"end":return t.stop()}}),t,null,[[3,9]])})));return function(e){return t.apply(this,arguments)}}())},parseConfig:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){var n,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([e.request("config.get_plugins"),e.request("config.get_backends"),e.request("config.get_procedures"),e.request("config.get_device_id")]);case 2:n=t.sent,c=Object(Pe["a"])(n,4),e.plugins=c[0],e.backends=c[1],e.procedures=c[2],e.hostname=c[3],e.initializeDefaultViews();case 9:case"end":return t.stop()}}),t)})))()},initializeDefaultViews:function(){this.plugins.execute={},this.plugins.switches={}}},mounted:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.parseConfig();case 4:e.initPanels(),e.initSelectedPanel();case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()}};n("e90c"),n("c22c");Ge.render=Re,Ge.__scopeId="data-v-5ec69f95";var Ze=Ge,Xe=Object(c["K"])("data-v-67571c94");Object(c["u"])("data-v-67571c94");var Ye={key:1,class:"canvas"};Object(c["s"])();var Qe=Xe((function(e,t,n,s,a,r){var i=Object(c["z"])("Loading");return Object(c["r"])(),Object(c["e"])("main",null,[a.loading?(Object(c["r"])(),Object(c["e"])(i,{key:0})):(Object(c["r"])(),Object(c["e"])("div",Ye,[(Object(c["r"])(),Object(c["e"])(Object(c["A"])(a.component),{config:a.config,"plugin-name":r.pluginName},null,8,["config","plugin-name"]))]))])})),et=(n("25f0"),{name:"Panel",mixins:[v["a"]],components:{Settings:Je["default"],Nav:Ke,Loading:X["a"]},data:function(){return{loading:!1,config:{},plugins:{},backends:{},procedures:{},component:void 0,hostname:void 0,selectedPanel:void 0}},computed:{pluginName:function(){return this.$route.params.plugin}},methods:{initPanel:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){var s,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return s=e.pluginName.split(".").map((function(e){return e[0].toUpperCase()+e.slice(1)})).join(""),r=null,t.prev=2,t.next=5,n("0f0c")("./".concat(s,"/Index"));case 5:r=t.sent,t.next=13;break;case 8:return t.prev=8,t.t0=t["catch"](2),console.error(t.t0),e.notify({error:!0,title:"Cannot load plugin ".concat(e.pluginName),text:t.t0.toString()}),t.abrupt("return");case 13:e.component=Object(c["i"])(Object(a["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",r);case 1:case"end":return e.stop()}}),e)})))),e.$options.components[name]=e.component;case 15:case"end":return t.stop()}}),t,null,[[2,8]])})))()},initConfig:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("config.get");case 2:return n=t.sent,e.config=n[e.pluginName]||{},t.next=6,e.request("config.get_device_id");case 6:e.hostname=t.sent;case 7:case"end":return t.stop()}}),t)})))()}},mounted:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.initConfig();case 4:return t.next=6,e.initPanel();case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()}});n("888d"),n("dac5");et.render=Qe,et.__scopeId="data-v-67571c94";var tt=et,nt=[{path:"/",name:"Panel",component:Ze},{path:"/dashboard/:name",name:"Dashboard",component:ie},{path:"/plugin/:plugin",name:"Plugin",component:tt},{path:"/login",name:"Login",component:ye},{path:"/register",name:"Register",component:Ce},{path:"/:catchAll(.*)",component:le}],ct=Object(K["a"])({history:Object(K["b"])(),routes:nt}),st=ct,at=Object(c["d"])(F);at.config.globalProperties._config=window.config,at.use(st).mount("#app")},6682:function(e,t,n){"use strict";n("9430")},"67fe":function(e,t,n){},"68c5":function(e,t,n){"use strict";n.r(t);var c=n("7a23"),s={class:"settings-container"},a={class:"col-8"},r={class:"col-4 pull-right"},i=Object(c["h"])("i",{class:"fa fa-plus"},null,-1);function o(e,t,n,o,u,l){var d=Object(c["z"])("Users"),h=Object(c["z"])("Token");return Object(c["r"])(),Object(c["e"])("div",s,[Object(c["h"])("header",null,[Object(c["h"])("div",a,[Object(c["h"])("select",{title:"View",onChange:t[1]||(t[1]=function(e){return u.selectedView=e.target.value})},[Object(c["h"])("option",{value:"users",selected:"users"===u.selectedView},"Users",8,["selected"]),Object(c["h"])("option",{value:"token",selected:"token"===u.selectedView},"Generate Token",8,["selected"])],32)]),Object(c["h"])("div",r,["users"===u.selectedView?(Object(c["r"])(),Object(c["e"])("button",{key:0,title:"Add User",onClick:t[2]||(t[2]=function(t){return e.$refs.usersView.$refs.addUserModal.show()})},[i])):Object(c["f"])("",!0)])]),Object(c["h"])("main",null,["users"===u.selectedView?(Object(c["r"])(),Object(c["e"])(d,{key:0,"session-token":u.sessionToken,"current-user":u.currentUser,ref:"usersView"},null,8,["session-token","current-user"])):"token"===u.selectedView?(Object(c["r"])(),Object(c["e"])(h,{key:1,"session-token":u.sessionToken,"current-user":u.currentUser,ref:"tokenView"},null,8,["session-token","current-user"])):Object(c["f"])("",!0)])])}n("96cf");var u=n("1da1"),l={class:"token-container"},d={class:"token-container"},h=Object(c["g"])(" This is your generated token. Treat it carefully and do not share it with untrusted parties."),b=Object(c["h"])("br",null,null,-1),f=Object(c["g"])(" Also, make sure to save it - it WILL NOT be displayed again. "),p={class:"body"},m={class:"description"},O=Object(c["g"])("Generate a JWT authentication token that can be used for API calls to the "),g=Object(c["g"])("/execute"),j=Object(c["g"])(" endpoint."),v=Object(c["h"])("br",null,null,-1),k=Object(c["h"])("p",null,"You can include the token in your requests in any of the following ways:",-1),y=Object(c["g"])("Specify it on the "),w=Object(c["g"])("Authorization: Bearer"),x=Object(c["g"])(" header;"),C=Object(c["g"])("Specify it on the "),S=Object(c["g"])("X-Token"),_=Object(c["g"])(" header;"),I=Object(c["g"])("Specify it as a URL parameter: "),T=Object(c["g"])("http://site:8008/execute?token=..."),R=Object(c["g"])(";"),P=Object(c["g"])("Specify it on the body of your JSON request: "),M=Object(c["g"])('{"type":"request", "action", "...", "token":"..."}'),z=Object(c["g"])("."),N=Object(c["g"])(" Confirm your credentials in order to generate a new token. "),U={class:"form-container"},$=Object(c["g"])(" Username "),E=Object(c["h"])("label",null,[Object(c["g"])(" Password "),Object(c["h"])("input",{type:"password",name:"password"})],-1),D=Object(c["h"])("label",null,[Object(c["g"])(" Token validity in days "),Object(c["h"])("input",{type:"text",name:"validityDays"}),Object(c["h"])("span",{class:"note"},[Object(c["g"])(" Decimal values are also supported (e.g. "),Object(c["h"])("i",null,"0.5"),Object(c["g"])(" to identify 6 hours). An empty or zero value means that the token has no expiry date. ")])],-1),A=Object(c["h"])("input",{type:"submit",value:"Generate token"},null,-1);function V(e,t,n,s,a,r){var i=Object(c["z"])("Loading"),o=Object(c["z"])("Modal"),u=Object(c["z"])("tt");return Object(c["r"])(),Object(c["e"])("div",l,[a.loading?(Object(c["r"])(),Object(c["e"])(i,{key:0})):Object(c["f"])("",!0),Object(c["h"])(o,{ref:"tokenModal"},{default:Object(c["H"])((function(){return[Object(c["h"])("div",d,[Object(c["h"])("label",null,[h,b,f,Object(c["h"])("textarea",{class:"token",textContent:Object(c["C"])(a.token),onFocus:t[1]||(t[1]=function(){return r.onTokenSelect.apply(r,arguments)})},null,40,["textContent"])])])]})),_:1},512),Object(c["h"])("div",p,[Object(c["h"])("div",m,[Object(c["h"])("p",null,[O,Object(c["h"])(u,null,{default:Object(c["H"])((function(){return[g]})),_:1}),j]),v,k,Object(c["h"])("ul",null,[Object(c["h"])("li",null,[y,Object(c["h"])(u,null,{default:Object(c["H"])((function(){return[w]})),_:1}),x]),Object(c["h"])("li",null,[C,Object(c["h"])(u,null,{default:Object(c["H"])((function(){return[S]})),_:1}),_]),Object(c["h"])("li",null,[I,Object(c["h"])(u,null,{default:Object(c["H"])((function(){return[T]})),_:1}),R]),Object(c["h"])("li",null,[P,Object(c["h"])(u,null,{default:Object(c["H"])((function(){return[M]})),_:1}),z])]),N]),Object(c["h"])("div",U,[Object(c["h"])("form",{onSubmit:t[2]||(t[2]=Object(c["J"])((function(){return r.generateToken.apply(r,arguments)}),["prevent"])),ref:"generateTokenForm"},[Object(c["h"])("label",null,[$,Object(c["h"])("input",{type:"text",name:"username",value:n.currentUser.username,disabled:""},null,8,["value"])]),E,D,A],544)])])])}n("d3b7"),n("25f0");var q=n("bc3a"),L=n.n(q),W=n("3a5e"),H=n("3e54"),B=n("714b"),F={name:"Token",components:{Modal:B["a"],Loading:W["a"]},mixins:[H["a"]],props:{currentUser:{type:Object,required:!0}},data:function(){return{loading:!1,token:null}},methods:{generateToken:function(e){var t=this;return Object(u["a"])(regeneratorRuntime.mark((function n(){var c,s,a,r,i;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return s=t.currentUser.username,a=e.target.password.value,r=(null===(c=e.target.validityDays)||void 0===c?void 0:c.length)?parseInt(e.target.validityDays.value):0,r||(r=null),t.loading=!0,n.prev=5,n.next=8,L.a.post("/auth",{username:s,password:a,expiry_days:r});case 8:t.token=n.sent.data.token,(null===(i=t.token)||void 0===i?void 0:i.length)&&t.$refs.tokenModal.show(),n.next=16;break;case 12:n.prev=12,n.t0=n["catch"](5),console.error(n.t0.toString()),t.notify({text:n.t0.toString(),error:!0});case 16:return n.prev=16,t.loading=!1,n.finish(16);case 19:case"end":return n.stop()}}),n,null,[[5,12,16,19]])})))()},onTokenSelect:function(e){e.target.select(),document.execCommand("copy"),this.notify({text:"Token copied to clipboard",image:{iconClass:"fa fa-check"}})}}};n("191e");F.render=V;var K=F,J={class:"body"},G={class:"users-list"},Z={class:"actions pull-right col-4"};function X(e,t,n,s,a,r){var i=Object(c["z"])("Loading"),o=Object(c["z"])("Modal"),u=Object(c["z"])("DropdownItem"),l=Object(c["z"])("Dropdown");return Object(c["r"])(),Object(c["e"])(c["a"],null,[a.loading?(Object(c["r"])(),Object(c["e"])(i,{key:0})):Object(c["f"])("",!0),Object(c["h"])(o,{ref:"addUserModal",title:"Add User"},{default:Object(c["H"])((function(){return[Object(c["h"])("form",{action:"#",method:"POST",ref:"addUserForm",onSubmit:t[1]||(t[1]=function(){return r.createUser.apply(r,arguments)})},[Object(c["h"])("label",null,[Object(c["h"])("input",{type:"text",name:"username",placeholder:"Username",disabled:a.commandRunning},null,8,["disabled"])]),Object(c["h"])("label",null,[Object(c["h"])("input",{type:"password",name:"password",placeholder:"Password",disabled:a.commandRunning},null,8,["disabled"])]),Object(c["h"])("label",null,[Object(c["h"])("input",{type:"password",name:"confirm_password",placeholder:"Confirm password",disabled:a.commandRunning},null,8,["disabled"])]),Object(c["h"])("input",{type:"submit",value:"Create User",disabled:a.commandRunning},null,8,["disabled"])],544)]})),_:1},512),Object(c["h"])(o,{ref:"changePasswordModal",title:"Change Password"},{default:Object(c["H"])((function(){return[Object(c["h"])("form",{action:"#",method:"POST",ref:"changePasswordForm",onSubmit:t[2]||(t[2]=function(){return r.changePassword.apply(r,arguments)})},[Object(c["h"])("label",null,[Object(c["h"])("input",{type:"text",name:"username",placeholder:"Username",value:a.selectedUser,disabled:"disabled"},null,8,["value"])]),Object(c["h"])("label",null,[Object(c["h"])("input",{type:"password",name:"password",placeholder:"Current password",disabled:a.commandRunning},null,8,["disabled"])]),Object(c["h"])("label",null,[Object(c["h"])("input",{type:"password",name:"new_password",placeholder:"New password",disabled:a.commandRunning},null,8,["disabled"])]),Object(c["h"])("label",null,[Object(c["h"])("input",{type:"password",name:"confirm_new_password",placeholder:"Confirm new password",disabled:a.commandRunning},null,8,["disabled"])]),Object(c["h"])("input",{type:"submit",value:"Change Password",disabled:a.commandRunning},null,8,["disabled"])],544)]})),_:1},512),Object(c["h"])("div",J,[Object(c["h"])("ul",G,[(Object(c["r"])(!0),Object(c["e"])(c["a"],null,Object(c["x"])(a.users,(function(t){return Object(c["r"])(),Object(c["e"])("li",{key:t.user_id,class:"item user",onClick:function(e){return a.selectedUser=t.username}},[Object(c["h"])("div",{class:"name col-8",textContent:Object(c["C"])(t.username)},null,8,["textContent"]),Object(c["h"])("div",Z,[Object(c["h"])(l,{title:"User Actions","icon-class":"fa fa-cog"},{default:Object(c["H"])((function(){return[Object(c["h"])(u,{text:"Change Password",disabled:a.commandRunning,"icon-class":"fa fa-key",onClick:function(n){a.selectedUser=t.username,e.$refs.changePasswordModal.show()}},null,8,["disabled","onClick"]),Object(c["h"])(u,{text:"Delete User",disabled:a.commandRunning,"icon-class":"fa fa-trash",onClick:function(e){return r.deleteUser(t)}},null,8,["disabled","onClick"])]})),_:1})])],8,["onClick"])})),128))])])],64)}n("13d5"),n("b0c0");var Y=n("2909"),Q=n("ab0f"),ee=n("524a"),te={name:"Users",components:{DropdownItem:ee["a"],Loading:W["a"],Modal:B["a"],Dropdown:Q["a"]},mixins:[H["a"]],props:{sessionToken:{type:String,required:!0},currentUser:{type:Object,required:!0}},data:function(){return{users:[],commandRunning:!1,loading:!1,selectedUser:null}},methods:{refresh:function(){var e=this;return Object(u["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.request("user.get_users");case 4:e.users=t.sent;case 5:return t.prev=5,e.loading=!1,t.finish(5);case 8:case"end":return t.stop()}}),t,null,[[1,,5,8]])})))()},createUser:function(e){var t=this;return Object(u["a"])(regeneratorRuntime.mark((function n(){var c;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.preventDefault(),c=Object(Y["a"])(t.$refs.addUserForm.querySelectorAll("input[name]")).reduce((function(e,t){return e[t.name]=t.value,e}),{}),c.password===c.confirm_password){n.next=5;break}return t.notify({title:"Unable to create user",text:"Please check that the passwords match",error:!0,image:{iconClass:"fas fa-times"}}),n.abrupt("return");case 5:return t.commandRunning=!0,n.prev=6,n.next=9,t.request("user.create_user",{username:c.username,password:c.password,session_token:t.sessionToken});case 9:return n.prev=9,t.commandRunning=!1,n.finish(9);case 12:return t.notify({text:"User "+c.username+" created",image:{iconClass:"fas fa-check"}}),t.$refs.addUserModal.close(),n.next=16,t.refresh();case 16:case"end":return n.stop()}}),n,null,[[6,,9,12]])})))()},changePassword:function(e){var t=this;return Object(u["a"])(regeneratorRuntime.mark((function n(){var c,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.preventDefault(),c=Object(Y["a"])(t.$refs.changePasswordForm.querySelectorAll("input[name]")).reduce((function(e,t){return e[t.name]=t.value,e}),{}),c.new_password===c.confirm_new_password){n.next=5;break}return t.notify({title:"Unable to update password",text:"Please check that the passwords match",error:!0,image:{iconClass:"fas fa-times"}}),n.abrupt("return");case 5:return t.commandRunning=!0,s=!1,n.prev=7,n.next=10,t.request("user.update_password",{username:c.username,old_password:c.password,new_password:c.new_password});case 10:s=n.sent;case 11:return n.prev=11,t.commandRunning=!1,n.finish(11);case 14:s?(t.$refs.changePasswordModal.close(),t.notify({text:"Password successfully updated",image:{iconClass:"fas fa-check"}})):t.notify({title:"Unable to update password",text:"The current password is incorrect",error:!0,image:{iconClass:"fas fa-times"}});case 15:case"end":return n.stop()}}),n,null,[[7,,11,14]])})))()},deleteUser:function(e){var t=this;return Object(u["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(confirm("Are you sure that you want to remove the user "+e.username+"?")){n.next=2;break}return n.abrupt("return");case 2:return t.commandRunning=!0,n.prev=3,n.next=6,t.request("user.delete_user",{username:e.username,session_token:t.sessionToken});case 6:return n.prev=6,t.commandRunning=!1,n.finish(6);case 9:return t.notify({text:"User "+e.username+" removed",image:{iconClass:"fas fa-check"}}),n.next=12,t.refresh();case 12:case"end":return n.stop()}}),n,null,[[3,,6,9]])})))()}},mounted:function(){this.refresh()}};n("cd96");te.render=X;var ne=te,ce={name:"Settings",components:{Users:ne,Token:K},mixins:[H["a"]],data:function(){return{selectedView:"users",currentUser:null,sessionToken:null}},methods:{refresh:function(){var e=this;return Object(u["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.sessionToken=e.getCookies()["session_token"],t.next=3,e.request("user.get_user_by_session",{session_token:e.sessionToken});case 3:e.currentUser=t.sent;case 4:case"end":return t.stop()}}),t)})))()}},mounted:function(){this.refresh()}};n("82a0");ce.render=o;t["default"]=ce},"714b":function(e,t,n){"use strict";var c=n("7a23"),s=Object(c["K"])("data-v-010fadd6");Object(c["u"])("data-v-010fadd6");var a={class:"modal"},r={class:"body"};Object(c["s"])();var i=s((function(e,t,n,s,i,o){return Object(c["r"])(),Object(c["e"])("div",{class:["modal-container fade-in",{hidden:!i.isVisible}],id:n.id,style:{"--z-index":o.zIndex},onClick:t[3]||(t[3]=function(){return o.close.apply(o,arguments)})},[Object(c["h"])("div",a,[Object(c["h"])("div",{class:"content",style:{"--width":n.width,"--height":n.height},onClick:t[2]||(t[2]=function(e){return e.stopPropagation()})},[n.title?(Object(c["r"])(),Object(c["e"])("div",{key:0,class:"header",textContent:Object(c["C"])(n.title)},null,8,["textContent"])):Object(c["f"])("",!0),Object(c["h"])("div",r,[Object(c["y"])(e.$slots,"default",{onModalClose:t[1]||(t[1]=function(){return o.close.apply(o,arguments)})})])],4)])],14,["id"])})),o=(n("c975"),n("a9e3"),n("b85c")),u={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:function(){return{timeoutId:void 0,prevVisible:this.visible,isVisible:this.visible}},computed:{zIndex:function(){return 500+this.level}},methods:{close:function(){this.prevVisible=this.isVisible,this.isVisible=!1},hide:function(){this.close()},show:function(){this.prevVisible=this.isVisible,this.isVisible=!0},toggle:function(){this.isVisible?this.close():this.show()}},mounted:function(){var e=this,t=this,n=function(e){e?t.$emit("open"):t.$emit("close"),t.isVisible=e};this.$watch((function(){return e.visible}),n),this.$watch((function(){return e.isVisible}),n)},updated:function(){if(this.prevVisible=this.isVisible,this.isVisible){var e,t=parseInt(getComputedStyle(this.$el).zIndex),n=[],c=Object(o["a"])(document.querySelectorAll(".modal-container:not(.hidden)"));try{for(c.s();!(e=c.n()).done;){var s=e.value,a=parseInt(getComputedStyle(s).zIndex);a>t?(t=a,n=[s]):a===t&&n.push(s)}}catch(i){c.e(i)}finally{c.f()}(n.indexOf(this.$el)<0||n.length>1)&&(this.$el.style.zIndex=t+1)}if(this.isVisible&&this.timeout&&!this.timeoutId){var r=function(e){return function(){e.close(),e.timeoutId=void 0}};this.timeoutId=setTimeout(r(this),0+this.timeout)}}};n("2bfe");u.render=i,u.__scopeId="data-v-010fadd6";t["a"]=u},"737e":function(e,t,n){},7907:function(e,t,n){},"7ef9":function(e,t,n){"use strict";n("de13")},"82a0":function(e,t,n){"use strict";n("9712")},"843b":function(e,t,n){},"87ac":function(e,t,n){"use strict";n("843b")},"888d":function(e,t,n){"use strict";n("d27e")},9430:function(e,t,n){},9528:function(e,t,n){"use strict";n("c4b6")},9712:function(e,t,n){},9802:function(e,t,n){},ab0f:function(e,t,n){"use strict";var c=n("7a23"),s=Object(c["K"])("data-v-00fa59b4");Object(c["u"])("data-v-00fa59b4");var a={class:"dropdown-container",ref:"container"};Object(c["s"])();var r=s((function(e,t,n,s,r,i){return Object(c["r"])(),Object(c["e"])("div",a,[Object(c["h"])("button",{title:n.title,ref:"button",onClick:t[1]||(t[1]=Object(c["J"])((function(e){return i.toggle(e)}),["stop"]))},[n.iconClass?(Object(c["r"])(),Object(c["e"])("i",{key:0,class:["icon",n.iconClass]},null,2)):Object(c["f"])("",!0),n.text?(Object(c["r"])(),Object(c["e"])("span",{key:1,class:"text",textContent:Object(c["C"])(n.text)},null,8,["textContent"])):Object(c["f"])("",!0)],8,["title"]),Object(c["h"])("div",{class:["dropdown fade-in",{hidden:!r.visible}],id:n.id,ref:"dropdown"},[Object(c["y"])(e.$slots,"default")],10,["id"])],512)})),i={name:"Dropdown",emits:["click"],props:{id:{type:String},items:{type:Array,default:function(){return[]}},iconClass:{type:String,default:"fa fa-ellipsis-h"},text:{type:String},title:{type:String}},data:function(){return{visible:!1}},methods:{documentClickHndl:function(e){if(this.visible){var t=e.target;while(t){if(!this.$refs.dropdown)break;if(t===this.$refs.dropdown.element)return;t=t.parentElement}this.close()}},close:function(){this.visible=!1,document.removeEventListener("click",this.documentClickHndl)},open:function(){var e=this;document.addEventListener("click",this.documentClickHndl),this.visible=!0,setTimeout((function(){var t=e.$refs.dropdown;t.style.left=0,t.style.top=parseFloat(getComputedStyle(e.$refs.button).height)+"px",t.getBoundingClientRect().left>window.innerWidth/2&&(t.style.left=-t.clientWidth+parseFloat(getComputedStyle(e.$refs.button).width)+"px"),t.getBoundingClientRect().top>window.innerHeight/2&&(t.style.top=-t.clientHeight+parseFloat(getComputedStyle(e.$refs.button).height)+"px")}),10)},toggle:function(e){e.stopPropagation(),this.$emit("click"),this.visible?this.close():this.open()}}};n("87ac");i.render=r,i.__scopeId="data-v-00fa59b4";t["a"]=i},b022:function(e,t,n){},b3bd:function(e,t,n){},b895:function(e,t,n){},c22c:function(e,t,n){"use strict";n("02bd")},c4b6:function(e,t,n){},c9a1:function(e,t,n){"use strict";n("f75c")},cd96:function(e,t,n){"use strict";n("4206")},cdb9:function(e,t,n){var c={"./Calendar/Index":["3c97","chunk-09eaa919"],"./Camera/Index":["9b92","chunk-5d73ace1"],"./Component/Index":["9b3c","chunk-06539e5d","chunk-6ee47cbe","chunk-49f94906"],"./DateTime/Index":["365a","chunk-01c1b3b0"],"./DateTimeWeather/Index":["3737","chunk-6c9a679d","chunk-01c1b3b0","chunk-b6886800"],"./ImageCarousel/Index":["c845","chunk-6c9a679d","chunk-01c1b3b0","chunk-437beeb4"],"./Music/Index":["bcf7","chunk-6f3814a8"],"./Plugin/Index":["dabe","chunk-d8561e02"],"./RssNews/Index":["c306","chunk-75e68c24"],"./Weather/Index":["5b43","chunk-6c9a679d"]};function s(e){if(!n.o(c,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=c[e],s=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(s)}))}s.keys=function(){return Object.keys(c)},s.id="cdb9",e.exports=s},d08b:function(e,t,n){"use strict";n("b3bd")},d27e:function(e,t,n){},d4c7:function(e,t,n){},d73f:function(e,t,n){"use strict";n("b895")},dac5:function(e,t,n){"use strict";n("9802")},db09:function(e,t,n){"use strict";n("b022")},dde2:function(e,t,n){"use strict";n("67fe")},de13:function(e,t,n){},e90c:function(e,t,n){"use strict";n("5611")},f34e:function(e,t,n){"use strict";n("f5d6")},f5d6:function(e,t,n){},f5ef:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var c=n("14b7"),s=Object(c["a"])()},f67c:function(e,t,n){},f75c:function(e,t,n){}});
//# sourceMappingURL=app.9978a5f2.js.map