"use strict";const e=require("../../common/vendor.js"),n=require("../../stores/bluetooth.js"),t=e.defineComponent({__name:"bluetooth",setup(t){const i=n.useBluetoothStore(),c=()=>{i.isDiscovering?i.stopScan():i.startScan()},o=async()=>{await i.disconnect(),e.index.showToast({title:"已断开连接",icon:"none"})};return(n,t)=>{var s;return e.e({a:e.t(e.unref(i).isDiscovering?"⏹️":"🔍"),b:e.t(e.unref(i).isDiscovering?"停止搜索":"搜索设备"),c:e.unref(i).isDiscovering?1:"",d:e.o(c),e:e.unref(i).isConnected},e.unref(i).isConnected?{f:e.t(null==(s=e.unref(i).connectedDevice)?void 0:s.name),g:e.o(o)}:{},{h:e.unref(i).deviceList.length>0},e.unref(i).deviceList.length>0?{i:e.f(e.unref(i).deviceList,(n,t,c)=>{return{a:e.t(n.name),b:e.t(n.deviceId),c:e.t((o=n.RSSI,o>=-50?"📶":o>=-70?"📡":"📴")),d:n.deviceId,e:e.o(t=>(async n=>{i.isConnected&&await i.disconnect(),await i.connect(n),i.isConnected&&(e.index.showToast({title:"连接成功",icon:"success"}),setTimeout(()=>{e.index.navigateBack()},1500))})(n.deviceId),n.deviceId)};var o})}:{})}}}),i=e._export_sfc(t,[["__scopeId","data-v-7381148d"]]);wx.createPage(i);