"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[9767],{6:function(e,n,t){t.d(n,{Z:function(){return f}});var a=t(6252),o=t(3577),i=t(9963),c=function(e){return(0,a.dD)("data-v-a6396ae8"),e=e(),(0,a.Cn)(),e},l=["checked"],u=c((function(){return(0,a._)("div",{class:"switch"},[(0,a._)("div",{class:"dot"})],-1)})),r={class:"label"};function s(e,n,t,c,s,d){return(0,a.wg)(),(0,a.iD)("div",{class:(0,o.C_)(["power-switch",{disabled:t.disabled}]),onClick:n[0]||(n[0]=(0,i.iM)((function(){return d.onInput&&d.onInput.apply(d,arguments)}),["stop"]))},[(0,a._)("input",{type:"checkbox",checked:t.value},null,8,l),(0,a._)("label",null,[u,(0,a._)("span",r,[(0,a.WI)(e.$slots,"default",{},void 0,!0)])])],2)}var d={name:"ToggleSwitch",emits:["input"],props:{value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput:function(e){if(this.disabled)return!1;this.$emit("input",e)}}},p=t(3744);const v=(0,p.Z)(d,[["render",s],["__scopeId","data-v-a6396ae8"]]);var f=v},9767:function(e,n,t){t.r(n),t.d(n,{default:function(){return b}});t(8309);var a=t(6252),o=t(9963),i=t(3577),c={class:"entity device-container"},l={class:"head"},u={class:"col-1 icon"},r={class:"col-2 connector"},s={class:"col-9 label"},d=["textContent"];function p(e,n,t,p,v,f){var h=(0,a.up)("EntityIcon"),g=(0,a.up)("ToggleSwitch");return(0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("div",l,[(0,a._)("div",u,[(0,a.Wm)(h,{entity:e.value,loading:e.loading,error:e.error},null,8,["entity","loading","error"])]),(0,a._)("div",r,[(0,a.Wm)(g,{value:e.value.connected,disabled:e.loading,onInput:f.connect,onClick:n[0]||(n[0]=(0,o.iM)((function(){}),["stop"]))},null,8,["value","disabled","onInput"])]),(0,a._)("div",s,[(0,a._)("div",{class:"name",textContent:(0,i.zw)(e.value.name)},null,8,d)])])])}var v=t(8534),f=(t(5666),t(7909)),h=t(5581),g=t(6),m={name:"BluetoothDevice",components:{EntityIcon:h["default"],ToggleSwitch:g.Z},mixins:[f["default"]],methods:{connect:function(e){var n=this;return(0,v.Z)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.stopPropagation(),n.$emit("loading",!0),a="bluetooth."+(n.value.connected?"disconnect":"connect"),t.prev=3,t.next=6,n.request(a,{device:n.value.address});case 6:return t.prev=6,n.$emit("loading",!1),t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[3,,6,9]])})))()}}},_=t(3744);const w=(0,_.Z)(m,[["render",p],["__scopeId","data-v-653f75c2"]]);var b=w}}]);
//# sourceMappingURL=9767-legacy.522953aa.js.map