"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[3835],{7514:function(e,t,n){n.d(t,{Z:function(){return h}});var i=n(6252),a=n(3577),l=n(9963);const o=e=>((0,i.dD)("data-v-eff375b6"),e=e(),(0,i.Cn)(),e),s=["checked","id"],c=o((()=>(0,i._)("div",{class:"switch"},[(0,i._)("div",{class:"dot"})],-1))),d={class:"label"};function u(e,t,n,o,u,r){return(0,i.wg)(),(0,i.iD)("div",{class:(0,a.C_)(["power-switch",{disabled:n.disabled}]),onClick:t[0]||(t[0]=(0,l.iM)(((...e)=>r.onInput&&r.onInput(...e)),["stop"]))},[(0,i._)("input",{type:"checkbox",checked:n.value,id:n.id},null,8,s),(0,i._)("label",null,[c,(0,i._)("span",d,[(0,i.WI)(e.$slots,"default",{},void 0,!0)])])],2)}var r={name:"ToggleSwitch",emits:["input"],props:{id:{type:String},value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput(e){if(this.disabled)return!1;this.$emit("input",e)}}},v=n(3744);const p=(0,v.Z)(r,[["render",u],["__scopeId","data-v-eff375b6"]]);var h=p},3835:function(e,t,n){n.r(t),n.d(t,{default:function(){return b}});var i=n(6252),a=n(3577),l=n(9963);const o={class:"entity device-container"},s={class:"head"},c={class:"icon"},d={class:"label"},u=["textContent"];function r(e,t,n,r,v,p){const h=(0,i.up)("EntityIcon"),f=(0,i.up)("ToggleSwitch");return(0,i.wg)(),(0,i.iD)("div",o,[(0,i._)("div",s,[(0,i._)("div",c,[(0,i.Wm)(h,{entity:e.value,loading:e.loading,error:e.error},null,8,["entity","loading","error"])]),(0,i._)("div",d,[(0,i._)("div",{class:"name",textContent:(0,a.zw)(e.value.name)},null,8,u)]),(0,i._)("div",{class:(0,a.C_)(["value-container",{"with-children":e.value?.children_ids?.length}])},[(0,i.Wm)(f,{value:e.value.connected,disabled:e.loading,onInput:p.connect,onClick:t[0]||(t[0]=(0,l.iM)((()=>{}),["stop"]))},null,8,["value","disabled","onInput"])],2)])])}var v=n(847),p=n(4967),h=n(7514),f={name:"BluetoothDevice",components:{EntityIcon:p["default"],ToggleSwitch:h.Z},mixins:[v["default"]],methods:{async connect(e){e.stopPropagation(),this.$emit("loading",!0);const t="bluetooth."+(this.value.connected?"disconnect":"connect");try{await this.request(t,{device:this.value.address})}finally{this.$emit("loading",!1)}}}},g=n(3744);const _=(0,g.Z)(f,[["render",r],["__scopeId","data-v-6aff1eff"]]);var b=_}}]);
//# sourceMappingURL=3835.2db962db.js.map