import{Q as y}from"./chunk-C2blguT0.js";import{Q as P,a as x}from"./chunk-C64o1gyF.js";import{Q as A,a as V}from"./chunk-DizfBsmk.js";import{Q as w}from"./chunk-BmZ_dvqz.js";import{Q as U,a as N}from"./chunk-Cetswyy9.js";import{Q as T}from"./chunk-CUANlmUG.js";import{C as S}from"./chunk-CsOl3O8E.js";import{Q as I}from"./chunk-CRkDt6fp.js";import{i as O,m as j,t as l,M as E,a as C,u as R,d as M,_ as B}from"./app-CPb3bToC.js";import{D as c,E as u,F as b,ah as $,au as g,as as a,V as o,av as q,an as n,u as d,B as p,q as s,Z as D,X as h,at as z}from"./chunk-DhYw-kuD.js";import"./chunk-DKMcZRgE.js";import{m as k,A as X,b as Z,a as F}from"./chunk-BYpESAhD.js";import{x as G}from"./chunk-BP0XrCdP.js";import{g as H}from"./chunk-CcMVSZaG.js";import"./chunk-CusLMHK2.js";import"./chunk-C7mbSHwF.js";import"./chunk-DfTn_VfD.js";import"./chunk-CoZXVP_c.js";import"./chunk-Bzmka5Fh.js";import"./chunk-DOJZQpJk.js";import"./chunk-xwEmqXCW.js";import"./chunk-8e5kB75k.js";import"./chunk-BjYP5sR0.js";import"./chunk-DBKH8df9.js";import"./chunk-xxORVLuj.js";import"./chunk-C6R67zTo.js";import"./chunk-GYMadCV3.js";import"./chunk-D3Pjrapm.js";import"./chunk-DbbZ0htz.js";import"./chunk-GGPowwzA.js";import"./chunk-C_9zYcUo.js";import"./chunk-DtbgphQc.js";let J=[{name:"简体中文",locale:"zh-cn",country_flag:"fi fi-cn fis",enable:!1},{name:"繁體中文",locale:"zh-tw",country_flag:"fi fi-tw fis",enable:!1},{name:"English",country_flag:"fi fi-us fis",locale:"en-us",enable:!1},{name:"Português (Brasil)",locale:"pt-br",country_flag:"fi fi-br fis",enable:!1},{name:"Deutsch",locale:"de-de",country_flag:"fi fi-de fis",enable:!1},{name:"Español",locale:"es-es",country_flag:"fi fi-es fis",enable:!1},{name:"Français",locale:"fr-fr",country_flag:"fi fi-fr fis",enable:!1},{name:"Italiano",locale:"it-it",country_flag:"fi fi-it fis",enable:!1},{name:"日本語",locale:"ja-jp",country_flag:"fi fi-jp fis",enable:!1},{name:"한국인",locale:"ko-kr",country_flag:"fi fi-kr fis",enable:!1},{name:"Русский",locale:"ru-ru",country_flag:"fi fi-ru fis",enable:!1}];const K={style:{margin:"1rem",display:"flex","flex-direction":"column",width:"14rem"}},W={style:{"margin-left":"8px"}},Y={data(){return{languages:[],current_locale_name:""}},async created(){this.languages=J;const r=j();this.$i18n.locale=r.current_locale;for(let e=0;e(c(),u("div",K,[(c(!0),u(b,null,$(e.languages,(i,m)=>(c(),g(I,{modelValue:i.enable,"onUpdate:modelValue":[_=>i.enable=_,_=>e.on_lang_change(m)],border:"",style:{"margin-top":"4px",width:"12rem"},dark:d(O)()},{default:a(()=>[o("span",{class:q(i.country_flag)},null,2),o("span",W,n(i.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue","dark"]))),256))]))}}),te={style:{margin:"1rem",display:"flex","flex-direction":"column",width:"15rem","justify-content":"center"}},oe={style:{"margin-left":"8px"}},re={props:["lang"],data(){return{current_theme:"light",themes:[{name:"light",enable:!1},{name:"orange",enable:!1},{name:"green",enable:!1},{name:"blue",enable:!1},{name:"pink",enable:!1},{name:"red",enable:!1},{name:"purple",enable:!1},{name:"system",enable:!1}]}},async created(){const r=j();this.current_theme=r.current_theme;for(let e=0;e(c(),u("div",te,[(c(!0),u(b,null,$(e.themes,(i,m)=>(c(),g(I,{modelValue:i.enable,"onUpdate:modelValue":[_=>i.enable=_,_=>e.on_theme_change(m)],border:"",style:{"margin-top":"4px",width:"13rem"},dark:d(O)()},{default:a(()=>[o("span",oe,n(d(l)(i.name)),1)]),_:2},1032,["modelValue","onUpdate:modelValue","dark"]))),256))]))}}),se={style:{"margin-top":"3rem","margin-left":"1rem","background-color":"rgb(255, 255, 255, 0.3)"}},ne={style:{display:"flex","flex-direction":"column"}},ie={style:{"font-size":"2rem","font-weight":"bold",color:"var(--color-60)"}},le={style:{margin:"1rem"}},de={class:"q-ml-sm"},_e={style:{"font-size":"2rem","font-weight":"bold",color:"var(--color-60)"}},ce={style:{"font-size":"2rem","font-weight":"bold",color:"var(--color-60)"}},me={data(){return{loading_clear_local_btn:!1}},methods:{on_clear_local(){setTimeout(async()=>{localStorage.clear(),E.success(l("modify_success")),await this.$router.push({path:"/",params:{}}),this.$router.go(0)},500)}}},ue=Object.assign(me,{__name:"Application",setup(r){return(e,t)=>{const i=p("el-scrollbar");return c(),u("div",se,[o("div",ne,[o("div",ie,n(d(l)("app")),1),o("div",le,[s(T,{modelValue:e.loading_clear_local_btn,"onUpdate:modelValue":t[1]||(t[1]=m=>e.loading_clear_local_btn=m),"backdrop-filter":"blur(4px)",persistent:""},{default:a(()=>[s(w,{style:{"background-color":"rgb(255, 255, 255, 0.3)"}},{default:a(()=>[s(U,{class:"row items-center"},{default:a(()=>[t[3]||(t[3]=o("i",{class:"fa-solid fa-triangle-exclamation"},null,-1)),o("span",de,n(d(l)("clear_local_data_confirm")),1)]),_:1}),s(N,{align:"right"},{default:a(()=>[D((c(),g(y,{"no-caps":"",color:"green"},{default:a(()=>[h(n(d(l)("cancel")),1)]),_:1})),[[S]]),D((c(),g(y,{"no-caps":"",color:"red",onClick:t[0]||(t[0]=m=>e.on_clear_local())},{default:a(()=>[h(n(d(l)("confirm")),1)]),_:1})),[[S]])]),_:1})]),_:1})]),_:1},8,["modelValue"]),s(y,{loading:e.loading_clear_local_btn,"no-caps":"",style:{"background-color":"var(--red)",color:"var(--white)",width:"8rem",height:"1.8rem"},onClick:t[2]||(t[2]=m=>e.loading_clear_local_btn=!0)},{default:a(()=>[h(n(d(l)("clear_local_data")),1)]),_:1},8,["loading"])]),o("div",_e,n(d(l)("theme_settings")),1),s(i,{"max-height":"300px",style:{width:"20rem"}},{default:a(()=>[s(ae)]),_:1}),o("div",ce,n(d(l)("language_settings")),1),s(i,{"max-height":"300px",style:{width:"20rem"}},{default:a(()=>[s(ee)]),_:1})])])}}}),pe={style:{"margin-top":"3rem","margin-left":"2rem"}},fe={style:{display:"flex","flex-direction":"column"}},he={style:{"font-size":"2rem","font-weight":"bold",color:"var(--color-60)"}},ge={style:{margin:"1rem"}},ve={style:{"text-align":"center"}},ye={class:"q-ml-sm"},we={style:{"font-size":"2rem","font-weight":"bold",color:"var(--color-60)"}},be={style:{display:"flex","flex-direction":"row",margin:"1rem"}},$e={style:{display:"flex","flex-direction":"row",margin:"1rem"}},ke={style:{display:"flex","flex-direction":"row",margin:"1rem"}},xe={style:{display:"flex","flex-direction":"row",margin:"1rem"}},Ve={style:{position:"relative"}},Se={style:{}},je={data(){return{loading_clear_local_btn:!1,product_name_text:"",vendor_id:"",product_id:"",firmware_version:"",factory_reseting:!1,percentage:0}},async created(){const r=C();this.product_name_text=r.current_device.product_name_text,this.vendor_id=r.current_device.vendor_id,this.product_id=r.current_device.product_id;let e=k();await e.fetch_firmware_version(),this.firmware_version=e.firmware_version},async updated(){console.log("device: updated")},methods:{async on_reset_factory(){this.factory_reseting=!0,this.percentage=0,setTimeout(async()=>{this.$router.push("/");let e=await R().connect();e!==null&&await e.reset_factory()},2e3),setInterval(async()=>{this.percentage<100&&(this.percentage+=10)},100)}}},Ce=Object.assign(je,{__name:"Device",setup(r){return(e,t)=>{const i=p("n-progress"),m=p("v-card");return c(),u("div",pe,[o("div",fe,[o("div",he,n(d(l)("reset_data")),1),o("div",ge,[s(T,{modelValue:e.loading_clear_local_btn,"onUpdate:modelValue":t[1]||(t[1]=_=>e.loading_clear_local_btn=_),"backdrop-filter":"blur(4px)",persistent:""},{default:a(()=>[e.factory_reseting?(c(),g(w,{key:0},{default:a(()=>[s(U,{class:"row items-center"},{default:a(()=>[s(i,{type:"circle",status:"error",percentage:e.percentage},{default:a(()=>[o("div",ve,n(d(l)("reset_factory")),1)]),_:1},8,["percentage"])]),_:1})]),_:1})):(c(),g(w,{key:1,style:{"background-color":"var(--color-98)"}},{default:a(()=>[s(U,{class:"row items-center"},{default:a(()=>[t[3]||(t[3]=o("i",{color:"red",class:"fa-solid fa-triangle-exclamation"},null,-1)),o("span",ye,n(d(l)("reset_factory_confirm")),1)]),_:1}),s(N,{align:"right"},{default:a(()=>[D((c(),g(y,{color:"green","no-caps":""},{default:a(()=>[h(n(d(l)("cancel")),1)]),_:1})),[[S]]),D((c(),g(y,{color:"red","no-caps":"",onClick:t[0]||(t[0]=_=>e.on_reset_factory())},{default:a(()=>[h(n(d(l)("confirm")),1)]),_:1})),[[S]])]),_:1})]),_:1}))]),_:1},8,["modelValue"]),s(y,{loading:e.loading_clear_local_btn,"no-caps":"",style:{"background-color":"var(--red)",color:"var(--text-light)",width:"10rem",height:"1.8rem"},onClick:t[2]||(t[2]=_=>e.loading_clear_local_btn=!0)},{default:a(()=>[h(n(d(l)("reset_factory")),1)]),_:1},8,["loading"])]),o("div",we,n(d(l)("my_devices")),1),s(m,{style:{margin:"1rem",border:"2px solid red","border-radius":"0.7rem",width:"30rem",color:"var(--text-primary)"}},{default:a(()=>[o("div",be,[t[4]||(t[4]=o("div",{style:{margin:"0 1rem 0 1rem"}},"DeviceModel",-1)),o("div",null,n(e.product_name_text),1)]),o("div",$e,[t[5]||(t[5]=o("div",{style:{margin:"0 1rem 0 1rem"}},"VendorID",-1)),o("div",null,n(Number(e.vendor_id).toString(16).padStart(4,"0")),1)]),o("div",ke,[t[6]||(t[6]=o("div",{style:{margin:"0 1rem 0 1rem"}},"ProductID",-1)),o("div",null,n(Number(e.product_id).toString(16).padStart(4,"0")),1)]),o("div",xe,[t[7]||(t[7]=o("div",{style:{margin:"0 1rem 0 1rem"}},"Version",-1)),o("div",Ve,[o("div",Se,n(Number(e.firmware_version).toString(16).padStart(4,"0")),1)])])]),_:1})])])}}}),De=M("model_update_logs",{state:()=>({update_logs:[]}),actions:{async fetch(){let r=await X.get("/api/v1/update_logs");if(r.data){this.update_logs=[];for(let e=0;e{this.loading_check_update_btn=!0;let r=await this.fetch_update_logs();console.log(r),r&&E.success(l("already_updated")),this.loading_check_update_btn=!1},1e3)}}},Le=Object.assign(Fe,{__name:"About",setup(r){return(e,t)=>{const i=p("el-divider"),m=p("el-scrollbar");return c(),u("div",ze,[o("div",Qe,[o("div",Ue,n(d(l)("about")),1),o("div",Be,[s(y,{loading:e.loading_check_update_btn,"no-caps":"",style:{"background-color":"var(--text-primary)",color:"var(--text-light)",width:"8rem",height:"1.8rem"},onClick:t[0]||(t[0]=_=>e.on_check_update())},{default:a(()=>[h(n(d(l)("check_update")),1)]),_:1},8,["loading"])]),o("div",Ne,n(d(l)("update_logs")),1),o("div",Te,[s(m,{"max-height":"600px",style:{width:"30rem"}},{default:a(()=>[(c(!0),u(b,null,$(e.update_logs,_=>(c(),u("div",null,[o("div",null,[o("div",null,n(_.version),1),t[1]||(t[1]=o("div",null,"Date",-1)),o("div",Ie,n(_.date),1),t[2]||(t[2]=o("div",null,"Channel",-1)),o("div",Oe,n(_.channel),1),t[3]||(t[3]=o("div",null,"Changes",-1)),o("div",Ee,[o("ul",null,[(c(!0),u(b,null,$(_.changes,f=>(c(),u("li",null,n(f),1))),256))])])]),s(i)]))),256))]),_:1})])])])}}}),Pe={class:"col"},Ae={class:"row",style:{"justify-content":"start",width:"24rem"}},Re={style:{color:"var(--color-60)","margin-top":"4px"}},Me={style:{color:"var(--green)","margin-top":"4px"}},qe={class:"row",style:{"justify-content":"start",width:"14rem"}},Xe={style:{color:"var(--color-60)","margin-top":"4px"}},Ze={style:{color:"var(--color-60)","margin-top":"4px"}},Ge={class:"row",style:{"justify-content":"start",width:"14rem"}},He={style:{color:"var(--color-60)","margin-top":"4px"}},Je={style:{color:"var(--color-60)","margin-top":"4px"}},Ke={class:"row",style:{"justify-content":"start",width:"100%"}},We={style:{color:"var(--color-60)","margin-top":"4px"}},Ye={style:{color:"var(--color-60)","margin-top":"4px"}},et={class:"row",style:{"justify-content":"start",width:"100%"}},tt={style:{color:"var(--red)"}},ot={class:"row",style:{width:"35rem","margin-top":"1rem"}},rt={class:"row",style:{width:"30rem","align-items":"center"}},at={style:{color:"var(--white)"}},st={components:{Scroll:G},props:["show","update_info"],emits:["show:change"],data(){return{_show:!1,download_enable:!1,download_progress:0}},methods:{on_close(){this.$emit("show:change",!1)},on_download(){this.download_enable=!0,this.download_progress=0,Z.get(this.$props.update_info.path,{responseType:"blob",onDownloadProgress:r=>{let e=Math.round(r.loaded*100/r.total);this.download_progress=e>this.download_progress?e:this.download_progress}}).then(r=>{const e=new Blob([r.data]),t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=this.$props.update_info.filename,t.click(),URL.revokeObjectURL(t.href),this.download_progress=100})}},watch:{"$props.show":function(r,e){this._show=r},_show:function(r,e){this.download_enable=!1,this.download_progress=0,this.$emit("show:change",r)}}},nt=Object.assign(st,{__name:"DialogFirmwareDownload",setup(r){return(e,t)=>{const i=p("n-scrollbar"),m=p("n-progress"),_=p("n-button"),f=p("n-card"),Q=p("n-modal");return c(),g(Q,{show:e._show,"onUpdate:show":t[2]||(t[2]=v=>e._show=v)},{default:a(()=>[s(f,{style:{width:"40rem"},title:d(l)("download_firmware"),preset:"dialog",bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":a(()=>[o("div",{class:"close-icon-wrapper",onClick:t[0]||(t[0]=v=>e.on_close())},t[3]||(t[3]=[o("i",{class:"fa-solid fa-xmark fa-lg close-icon"},null,-1)]))]),footer:a(()=>t[5]||(t[5]=[])),default:a(()=>[o("div",Pe,[o("div",Ae,[o("div",Re,n(d(l)("firmware_version"))+": ",1),o("div",Me,n(e.$props.update_info.version),1)]),o("div",qe,[o("div",Xe,n(d(l)("update_time"))+": ",1),o("div",Ze,n(e.$props.update_info.date),1)]),o("div",Ge,[o("div",He,n(d(l)("firmware_type"))+": ",1),o("div",Je,n(e.$props.update_info.type),1)]),o("div",Ke,[o("div",We,n(d(l)("file_name"))+": ",1),o("div",Ye,n(e.$props.update_info.filename),1)]),o("div",et,[t[4]||(t[4]=o("div",{style:{color:"var(--color-60)","margin-top":"4px"}},"更新日志",-1)),s(i,{style:{"max-height":"120px",color:"var(--color-60)","margin-top":"4px","margin-left":"1rem"}},{default:a(()=>[(c(!0),u(b,null,$(e.$props.update_info.changes,(v,L)=>(c(),u("div",tt,n(String(L+1)+"."+v),1))),256))]),_:1})]),o("div",ot,[o("div",rt,[e.download_enable?(c(),g(m,{key:0,type:"line",percentage:e.download_progress,"indicator-placement":"inside",processing:""},null,8,["percentage"])):z("",!0)]),s(_,{type:"success",style:{color:"var(--color-60)","margin-top":"4px","margin-left":"1rem"},onClick:t[1]||(t[1]=v=>e.on_download())},{default:a(()=>[o("div",at,n(d(l)("download")),1)]),_:1})])])]),_:1},8,["title"])]),_:1},8,["show"])}}}),it={props:["show","update_info"],emits:["show:change"],data(){return{_show:!1,current:1}},methods:{next(){this.current!==5&&this.current++},prev(){this.current!==1&&this.current--}},watch:{"$props.show":function(r,e){this._show=r},_show:function(r,e){this.$emit("show:change",r)}}},lt=Object.assign(it,{__name:"DialogFirmwareUpgrade",setup(r){return(e,t)=>{const i=p("n-button"),m=p("n-step"),_=p("n-steps"),f=p("n-card"),Q=p("n-modal");return c(),g(Q,{show:e._show,"onUpdate:show":t[1]||(t[1]=v=>e._show=v),"mask-closable":!1},{default:a(()=>[s(f,{style:{width:"40rem"},title:d(l)("firmware_update"),segmented:{content:!0,footer:"soft"},preset:"dialog",bordered:!1,role:"dialog","aria-modal":"true"},{"header-extra":a(()=>[o("div",{class:"close-icon-wrapper",onClick:t[0]||(t[0]=v=>this.$emit("show:change",!1))},t[2]||(t[2]=[o("i",{class:"fa-solid fa-xmark fa-lg close-icon"},null,-1)]))]),default:a(()=>[s(_,{vertical:"",current:e.current},{default:a(()=>[s(m,{title:"选择设备"},{default:a(()=>[s(i,{type:"error"},{default:a(()=>t[3]||(t[3]=[o("div",{style:{color:"var(--color-100)"}},"选择设备",-1)])),_:1})]),_:1}),s(m,{title:"验证固件"},{default:a(()=>[s(i,{type:"error"},{default:a(()=>t[4]||(t[4]=[o("div",{style:{color:"var(--color-100)"}},"验证固件",-1)])),_:1})]),_:1}),s(m,{title:"重启设备至升级模式"},{default:a(()=>[s(i,{type:"error"},{default:a(()=>t[5]||(t[5]=[o("div",{style:{color:"var(--color-100)"}},"重启设备",-1)])),_:1})]),_:1}),s(m,{title:"连接处于升级模式的设备"},{default:a(()=>[s(i,{type:"error"},{default:a(()=>t[6]||(t[6]=[o("div",{style:{color:"var(--color-100)"}},"连接设备",-1)])),_:1})]),_:1}),s(m,{title:"写入固件"},{default:a(()=>[s(i,{type:"error"},{default:a(()=>t[7]||(t[7]=[o("div",{style:{color:"var(--color-100)"}},"写入固件",-1)])),_:1})]),_:1}),s(m,{title:"完成"},{default:a(()=>[s(i,{type:"primary"},{default:a(()=>t[8]||(t[8]=[o("div",{style:{color:"var(--color-100)"}},"完成",-1)])),_:1})]),_:1})]),_:1},8,["current"])]),_:1},8,["title"])]),_:1},8,["show"])}}}),dt=B(lt,[["__scopeId","data-v-59b80adf"]]),_t={style:{"margin-top":"3rem","margin-left":"2rem"}},ct={style:{display:"flex","flex-direction":"column"}},mt={style:{display:"flex","flex-direction":"column","justify-content":"center",height:"100%"}},ut={class:"row",style:{width:"100%","justify-content":"center","margin-top":"2rem"}},pt=["src"],ft={class:"col",style:{"margin-top":"0.5rem"}},ht={class:"row",style:{"justify-content":"center"}},gt={style:{color:"var(--color-60)","margin-top":"4px"}},vt={style:{color:"var(--color-60)","margin-top":"4px"}},yt={class:"row",style:{"justify-content":"center"}},wt={style:{color:"var(--color-60)","margin-top":"4px"}},bt={style:{color:"var(--color-60)","margin-top":"4px"}},$t={key:0,style:{"margin-top":"0.5rem"}},kt={class:"row",style:{"justify-content":"center"}};const xt={style:{color:"var(--white)"}},Vt={key:1,style:{"margin-top":"0.5rem"}},St={class:"row",style:{"justify-content":"center"}};const jt={style:{color:"var(--white)"}},Ct={data(){return{devices:[{product_name:"Device 1",img:"",version:"",uuid:"",update_info:[]}],show_firmware_download:!1,show_firmware_upgrade:!1,update_info:[]}},async created(){let r=C();this.current_device=r.current_device,this.current_device&&(this.devices[0].product_name=r.current_device.product_name_text,this.devices[0].uuid="0x"+String(Number(r.current_device.uuid).toString(16).padStart(12,"0")),this.devices[0].img=H(r.current_device.product_icon).backgroundImage);let e=k();await e.fetch_firmware_version(),this.devices[0].version=e.firmware_version;let t="0x"+Number(e.firmware_version).toString(16),i=F();await i.fetch(this.devices[0].uuid,"EXE",t);let m=[];for(let _=0;_e.firmware_version&&m.push(i.update_info[_]);this.devices[0].update_info=m},methods:{on_online_upgrade(){k(),this.show_firmware_upgrade=!0;let r={version:0};for(let e=0;er.version&&(r=this.devices[0].update_info[e]);this.update_info=r},on_view_firmware(){k(),this.show_firmware_download=!0;let r={version:0};for(let e=0;er.version&&(r=this.devices[0].update_info[e]);this.update_info=r}}},Dt=Object.assign(Ct,{__name:"FirmwareTools",setup(r){return(e,t)=>{const i=p("n-button"),m=p("el-scrollbar");return c(),u("div",_t,[o("div",ct,[s(m,{style:{width:"30rem","max-height":"40rem"}},{default:a(()=>[(c(!0),u(b,null,$(e.devices,_=>(c(),g(w,{class:"dev-card"},{default:a(()=>[o("div",mt,[o("div",ut,[o("img",{alt:"bg",style:{width:"14rem"},src:_.img},null,8,pt)]),o("div",ft,[o("div",ht,[o("div",gt,n(d(l)("device_mode"))+": ",1),o("div",vt,n(_.product_name),1)]),o("div",yt,[o("div",wt,n(d(l)("firmware_version"))+": ",1),o("div",bt,n(Number(_.version).toString(16).padStart(4,"0")),1)]),_.update_info.length!==0?(c(),u("div",$t,[o("div",kt,[z("",!0),s(i,{type:"success",onClick:t[1]||(t[1]=f=>e.on_view_firmware()),style:{"margin-left":"0.5rem"}},{default:a(()=>[o("div",xt,n(d(l)("download_latest")),1)]),_:1})])])):(c(),u("div",Vt,[o("div",St,[z("",!0),s(i,{type:"error",disabled:"",style:{"margin-left":"0.5rem"}},{default:a(()=>[o("div",jt,n(d(l)("no_need_update")),1)]),_:1})])]))])])]),_:2},1024))),256))]),_:1})]),s(dt,{show:e.show_firmware_upgrade,update_info:e.update_info,"onShow:change":t[3]||(t[3]=_=>{e.show_firmware_upgrade=_})},null,8,["show","update_info"]),s(nt,{show:e.show_firmware_download,update_info:e.update_info,"onShow:change":t[4]||(t[4]=_=>{e.show_firmware_download=_})},null,8,["show","update_info"])])}}}),zt=B(Dt,[["__scopeId","data-v-2453b24d"]]),Qt={style:{display:"flex","justify-content":"center","align-items":"center"}},Ut={style:{"border-right":"1px solid #6b7785",width:"18rem"},class:"flex-col"},Bt={style:{display:"flex","justify-content":"center","margin-top":"4rem","margin-bottom":"1rem","font-size":"2rem","font-weight":"bold","user-select":"none",color:"var(--color-60)"}},Nt={key:0,class:"update-dot"},Tt={data(){return{tab:"application",update_flag:!1}},unmounted(){this.$mitt.off("global_device_status_update",()=>{})},async updated(){await this.check_update(),this.$mitt.on("global_device_status_update",async r=>{await this.fetch_device()})},async created(){await this.check_update(),this.$mitt.on("global_device_status_update",async r=>{await this.fetch_device()})},methods:{async fetch_device(){try{let r=C();await r.update_device(),r.current_device=r.online_devices[0],await this.update_device_status(),this.$router.go(0)}catch{}},async check_update(){let r=k(),e=C();await r.fetch_firmware_version();let t="0x"+String(Number(e.current_device.uuid).toString(16).padStart(12,"0")),i="0x"+Number(r.firmware_version).toString(16),m=F();await m.fetch(t,"EXE",i);let _=[];for(let f=0;fr.firmware_version&&_.push(m.update_info[f]);this.update_flag=_.length>0},on_exit(){this.$router.push({path:"/keyboard",params:{}})}}},It=Object.assign(Tt,{__name:"ViewSettings",setup(r){return(e,t)=>(c(),u("div",Qt,[s(w,{class:"flex-row",id:"settings",style:{margin:"1rem","border-radius":"6px",width:"116rem",height:"55rem",background:"rgba(255, 255, 255, 0.2)"}},{default:a(()=>[s(y,{style:{"z-index":"2",position:"absolute",right:"2rem",top:"2rem","background-color":"var(--text-primary)",color:"var(--text-light)"},class:"text-none mb-4",unelevated:"",onClick:t[0]||(t[0]=i=>e.on_exit())},{default:a(()=>[h(n(d(l)("exit")),1)]),_:1}),o("div",Ut,[o("div",Bt,[o("div",null,n(d(l)("settings")),1)]),s(P,{modelValue:e.tab,"onUpdate:modelValue":t[1]||(t[1]=i=>e.tab=i),"active-color":"primary","indicator-color":"primary",vertical:!0,style:{"margin-left":"4rem",display:"flex","flex-direction":"column","justify-content":"end","align-items":"end"}},{default:a(()=>[s(x,{name:"application",style:{"font-size":"1.1rem",width:"10rem",color:"var(--color-60)","margin-top":"1rem"}},{default:a(()=>[h(n(d(l)("application")),1)]),_:1}),s(x,{name:"firmware",style:{"font-size":"1.1rem",width:"10rem",color:"var(--color-60)","margin-top":"1rem"}},{default:a(()=>[h(n(d(l)("firmware_tools"))+" ",1),e.update_flag?(c(),u("div",Nt)):z("",!0)]),_:1}),s(x,{name:"device",style:{"font-size":"1.1rem",width:"10rem",color:"var(--color-60)","margin-top":"1rem"}},{default:a(()=>[h(n(d(l)("device")),1)]),_:1}),s(x,{name:"about",style:{"font-size":"1.1rem",width:"10rem",color:"var(--color-60)","margin-top":"1rem"}},{default:a(()=>[h(n(d(l)("about")),1)]),_:1})]),_:1},8,["modelValue"])]),s(w,{style:{background:"rgba(255, 255, 255, 0.2)"}},{default:a(()=>[s(A,{modelValue:e.tab,"onUpdate:modelValue":t[2]||(t[2]=i=>e.tab=i),animated:"",style:{width:"100rem",background:"rgba(255, 255, 255, 0.2)"}},{default:a(()=>[s(V,{name:"application",style:{height:"55rem"}},{default:a(()=>[s(ue)]),_:1}),s(V,{name:"firmware",style:{height:"55rem"}},{default:a(()=>[s(zt)]),_:1}),s(V,{name:"device",style:{height:"55rem"}},{default:a(()=>[s(Ce)]),_:1}),s(V,{name:"about",style:{height:"55rem"}},{default:a(()=>[s(Le)]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]))}}),ho=B(It,[["__scopeId","data-v-e58c40f8"]]);export{ho as default};