Files
DeviceManager/apps/manager/build/_app/immutable/chunks/tauri-serial.32a5689f.js

8 lines
32 KiB
JavaScript

import{s as ve,f as M,a as R,g as P,h as Q,c as U,u as j,d as $,i as Z,v as f,x as C,y as q,I as Me,z as Pe,J as De,$ as $e,l as Ae,m as We,j as B,N as V,n as Te}from "./scheduler.f5cfe514.js";import{e as G}from "./each.94f093eb.js";import{S as Le,i as Ce}from "./index.c2fc59c9.js";var Ee=Object.defineProperty,m=(t, e)=>{for(var a in e)Ee(t,a,{get:e[a],enumerable:!0})},Se={};m(Se,{convertFileSrc:()=>Oe,invoke:()=>z,transformCallback:()=>g});function ze(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function g(t, e=!1){let a=ze(),r=`_${a}`;return Object.defineProperty(window,r,{value: i=>(e&&Reflect.deleteProperty(window,r),t?.(i)),writable:!1,configurable:!0}),a}async function z(t, e={}){return new Promise((a, r)=>{let i=g(o=>{a(o),Reflect.deleteProperty(window,`_${s}`)},!0),s=g(o=>{r(o),Reflect.deleteProperty(window,`_${i}`)},!0);window.__TAURI_IPC__({cmd:t,callback:i,error:s,...e})})}function Oe(t, e="asset"){let a=encodeURIComponent(t);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${a}`:`${e}://localhost/${a}`}async function n(t){return z("tauri",t)}var xe={};m(xe,{TauriEvent:()=>ae,emit:()=>x,listen:()=>ne,once:()=>re});async function X(t, e){return n({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:e}})}async function ee(t, e, a){await n({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:a}})}async function O(t, e, a){return n({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:e,handler:g(a)}}).then(r=>async()=>X(t,r))}async function te(t, e, a){return O(t,e, r=>{a(r),X(t,r.id).catch(()=>{})})}var ae=(t=>(t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",t.MENU="tauri://menu",t.CHECK_UPDATE="tauri://update",t.UPDATE_AVAILABLE="tauri://update-available",t.INSTALL_UPDATE="tauri://update-install",t.STATUS_UPDATE="tauri://update-status",t.DOWNLOAD_PROGRESS="tauri://update-download-progress",t))(ae||{});async function ne(t, e){return O(t,null,e)}async function re(t, e){return te(t,null,e)}async function x(t, e){return ee(t,void 0,e)}var Fe={};m(Fe,{checkUpdate:()=>ke,installUpdate:()=>Ne,onUpdaterEvent:()=>F});async function F(t){return ne("tauri://update-status", e=>{t(e?.payload)})}async function Ne(){let t;function e(){t&&t(),t=void 0}return new Promise((a, r)=>{function i(s){if(s.error){e(),r(s.error);return}s.status==="DONE"&&(e(),a())}F(i).then(s=>{t=s}).catch(s=>{throw e(),s}),x("tauri://update-install").catch(s=>{throw e(),s})})}async function ke(){let t;function e(){t&&t(),t=void 0}return new Promise((a, r)=>{function i(o){e(),a({manifest:o,shouldUpdate:!0})}function s(o){if(o.error){e(),r(o.error);return}o.status==="UPTODATE"&&(e(),a({shouldUpdate:!1}))}re("tauri://update-available", o=>{i(o?.payload)}).catch(o=>{throw e(),o}),F(s).then(o=>{t=o}).catch(o=>{throw e(),o}),x("tauri://update").catch(o=>{throw e(),o})})}var Ie={};m(Ie,{CloseRequestedEvent:()=>ce,LogicalPosition:()=>se,LogicalSize:()=>ie,PhysicalPosition:()=>W,PhysicalSize:()=>A,UserAttentionType:()=>oe,WebviewWindow:()=>b,WebviewWindowHandle:()=>le,WindowManager:()=>ue,appWindow:()=>S,availableMonitors:()=>qe,currentMonitor:()=>Ue,getAll:()=>E,getCurrent:()=>Re,primaryMonitor:()=>je});var ie=class{constructor(e, a){this.type="Logical",this.width=e,this.height=a}},A=class{constructor(e, a){this.type="Physical",this.width=e,this.height=a}toLogical(e){return new ie(this.width/e,this.height/e)}},se=class{constructor(e, a){this.type="Logical",this.x=e,this.y=a}},W=class{constructor(e, a){this.type="Physical",this.x=e,this.y=a}toLogical(e){return new se(this.x/e,this.y/e)}},oe=(t=>(t[t.Critical=1]="Critical",t[t.Informational=2]="Informational",t))(oe||{});function Re(){return new b(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function E(){return window.__TAURI_METADATA__.__windows.map(t=>new b(t.label,{skip:!0}))}var H=["tauri://created","tauri://error"],le=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e, a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(a),1)}):O(e,this.label,a)}async once(e, a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(a),1)}):te(e,this.label,a)}async emit(e, a){if(H.includes(e)){for(let r of this.listeners[e]||[])r({event:e,id:-1,windowLabel:this.label,payload:a});return Promise.resolve()}return ee(e,this.label,a)}_handleTauriEvent(e, a){return H.includes(e)?(e in this.listeners?this.listeners[e].push(a):this.listeners[e]=[a],!0):!1}},ue=class extends le{async scaleFactor(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:a})=>new W(e,a))}async outerPosition(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:a})=>new W(e,a))}async innerSize(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:a})=>new A(e,a))}async outerSize(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:a})=>new A(e,a))}async isFullscreen(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isFocused(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFocused"}}}})}async isDecorated(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isMaximizable(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximizable"}}}})}async isMinimizable(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimizable"}}}})}async isClosable(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isClosable"}}}})}async isVisible(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let a=null;return e&&(e===1?a={type:"Critical"}:a={type:"Informational"}),n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:a}}}})}async setResizable(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setMaximizable(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaximizable",payload:e}}}})}async setMinimizable(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinimizable",payload:e}}}})}async setClosable(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setClosable",payload:e}}}})}async setTitle(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize", a=>{a.payload=me(a.payload),e(a)})}async onMoved(e){return this.listen("tauri://move", a=>{a.payload=de(a.payload),e(a)})}async onCloseRequested(e){return this.listen("tauri://close-requested", a=>{let r=new ce(a);Promise.resolve(e(r)).then(()=>{if(!r.isPreventDefault())return this.close()})})}async onFocusChanged(e){let a=await this.listen("tauri://focus", i=>{e({...i,payload:!0})}),r=await this.listen("tauri://blur", i=>{e({...i,payload:!1})});return()=>{a(),r()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let a=await this.listen("tauri://file-drop", s=>{e({...s,payload:{type:"drop",paths:s.payload}})}),r=await this.listen("tauri://file-drop-hover", s=>{e({...s,payload:{type:"hover",paths:s.payload}})}),i=await this.listen("tauri://file-drop-cancelled", s=>{e({...s,payload:{type:"cancel"}})});return()=>{a(),r(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},ce=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},b=class extends ue{constructor(e, a={}){super(e),a?.skip||n({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...a}}}}).then(async()=>this.emit("tauri://created")).catch(async r=>this.emit("tauri://error",r))}static getByLabel(e){return E().some(a=>a.label===e)?new b(e,{skip:!0}):null}static async getFocusedWindow(){for(let e of E())if(await e.isFocused())return e;return null}},S;"__TAURI_METADATA__"in window?S=new b(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.
Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),S=new b("main",{skip:!0}));function N(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:de(t.position),size:me(t.size)}}function de(t){return new W(t.x,t.y)}function me(t){return new A(t.width,t.height)}async function Ue(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(N)}async function je(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(N)}async function qe(){return n({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(t=>t.map(N))}var Be={};m(Be,{isPermissionGranted:()=>Ve,requestPermission:()=>Ge,sendNotification:()=>He});async function Ve(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):n({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function Ge(){return window.Notification.requestPermission()}function He(t){typeof t=="string"?new window.Notification(t):new window.Notification(t.title,t)}function k(){return navigator.appVersion.includes("Win")}var Je={};m(Je,{EOL:()=>Ye,arch:()=>Xe,locale:()=>tt,platform:()=>Ke,tempdir:()=>et,type:()=>Ze,version:()=>Qe});var Ye=k()?`\r
`:`
`;async function Ke(){return n({__tauriModule:"Os",message:{cmd:"platform"}})}async function Qe(){return n({__tauriModule:"Os",message:{cmd:"version"}})}async function Ze(){return n({__tauriModule:"Os",message:{cmd:"osType"}})}async function Xe(){return n({__tauriModule:"Os",message:{cmd:"arch"}})}async function et(){return n({__tauriModule:"Os",message:{cmd:"tempdir"}})}async function tt(){return n({__tauriModule:"Os",message:{cmd:"locale"}})}var at={};m(at,{BaseDirectory:()=>T,Dir:()=>T,copyFile:()=>ut,createDir:()=>ot,exists:()=>mt,readBinaryFile:()=>rt,readDir:()=>st,readTextFile:()=>nt,removeDir:()=>lt,removeFile:()=>ct,renameFile:()=>dt,writeBinaryFile:()=>it,writeFile:()=>J,writeTextFile:()=>J});var T=(t=>(t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Log=19]="Log",t[t.Temp=20]="Temp",t[t.AppConfig=21]="AppConfig",t[t.AppData=22]="AppData",t[t.AppLocalData=23]="AppLocalData",t[t.AppCache=24]="AppCache",t[t.AppLog=25]="AppLog",t))(T||{});async function nt(t,e={}){return n({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})}async function rt(t,e={}){let a=await n({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:e}});return Uint8Array.from(a)}async function J(t,e,a){typeof a=="object"&&Object.freeze(a),typeof t=="object"&&Object.freeze(t);let r={path:"",contents:""},i=a;return typeof t=="string"?r.path=t:(r.path=t.path,r.contents=t.contents),typeof e=="string"?r.contents=e??"":i=e,n({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(new TextEncoder().encode(r.contents)),options:i}})}async function it(t,e,a){typeof a=="object"&&Object.freeze(a),typeof t=="object"&&Object.freeze(t);let r={path:"",contents:[]},i=a;return typeof t=="string"?r.path=t:(r.path=t.path,r.contents=t.contents),e&&"dir"in e?i=e:typeof t=="string"&&(r.contents=e??[]),n({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(r.contents instanceof ArrayBuffer?new Uint8Array(r.contents):r.contents),options:i}})}async function st(t,e={}){return n({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})}async function ot(t,e={}){return n({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})}async function lt(t,e={}){return n({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})}async function ut(t,e,a={}){return n({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:a}})}async function ct(t,e={}){return n({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})}async function dt(t,e,a={}){return n({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:a}})}async function mt(t,e={}){return n({__tauriModule:"Fs",message:{cmd:"exists",path:t,options:e}})}var ht={};m(ht,{BaseDirectory:()=>T,appCacheDir:()=>gt,appConfigDir:()=>he,appDataDir:()=>yt,appDir:()=>pt,appLocalDataDir:()=>_t,appLogDir:()=>pe,audioDir:()=>ft,basename:()=>Bt,cacheDir:()=>bt,configDir:()=>wt,dataDir:()=>vt,delimiter:()=>kt,desktopDir:()=>Mt,dirname:()=>jt,documentDir:()=>Pt,downloadDir:()=>Dt,executableDir:()=>$t,extname:()=>qt,fontDir:()=>At,homeDir:()=>Wt,isAbsolute:()=>Vt,join:()=>Ut,localDataDir:()=>Tt,logDir:()=>Ft,normalize:()=>Rt,pictureDir:()=>Lt,publicDir:()=>Ct,resolve:()=>It,resolveResource:()=>St,resourceDir:()=>Et,runtimeDir:()=>zt,sep:()=>Nt,templateDir:()=>Ot,videoDir:()=>xt});async function pt(){return he()}async function he(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:21}})}async function yt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:22}})}async function _t(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:23}})}async function gt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:24}})}async function ft(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:1}})}async function bt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:2}})}async function wt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:3}})}async function vt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:4}})}async function Mt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:6}})}async function Pt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:7}})}async function Dt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:8}})}async function $t(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:9}})}async function At(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:10}})}async function Wt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:11}})}async function Tt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:5}})}async function Lt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:12}})}async function Ct(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:13}})}async function Et(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:17}})}async function St(t){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:t,directory:17}})}async function zt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:14}})}async function Ot(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:15}})}async function xt(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:16}})}async function Ft(){return pe()}async function pe(){return n({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:25}})}var Nt=k()?"\\":"/",kt=k()?";":":";async function It(...t){return n({__tauriModule:"Path",message:{cmd:"resolve",paths:t}})}async function Rt(t){return n({__tauriModule:"Path",message:{cmd:"normalize",path:t}})}async function Ut(...t){return n({__tauriModule:"Path",message:{cmd:"join",paths:t}})}async function jt(t){return n({__tauriModule:"Path",message:{cmd:"dirname",path:t}})}async function qt(t){return n({__tauriModule:"Path",message:{cmd:"extname",path:t}})}async function Bt(t,e){return n({__tauriModule:"Path",message:{cmd:"basename",path:t,ext:e}})}async function Vt(t){return n({__tauriModule:"Path",message:{cmd:"isAbsolute",path:t}})}var Gt={};m(Gt,{exit:()=>Ht,relaunch:()=>Jt});async function Ht(t=0){return n({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})}async function Jt(){return n({__tauriModule:"Process",message:{cmd:"relaunch"}})}var Yt={};m(Yt,{Child:()=>ye,Command:()=>_e,EventEmitter:()=>D,open:()=>Qt});async function Kt(t,e,a=[],r){return typeof a=="object"&&Object.freeze(a),n({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:a,options:r,onEventFn:g(t)}})}var D=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,a){return this.on(e,a)}removeListener(e,a){return this.off(e,a)}on(e,a){return e in this.eventListeners?this.eventListeners[e].push(a):this.eventListeners[e]=[a],this}once(e,a){let r=(...i)=>{this.removeListener(e,r),a(...i)};return this.addListener(e,r)}off(e,a){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(r=>r!==a)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...a){if(e in this.eventListeners){let r=this.eventListeners[e];for(let i of r)i(...a);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,a){return e in this.eventListeners?this.eventListeners[e].unshift(a):this.eventListeners[e]=[a],this}prependOnceListener(e,a){let r=(...i)=>{this.removeListener(e,r),a(...i)};return this.prependListener(e,r)}},ye=class{constructor(e){this.pid=e}async write(e){return n({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return n({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},_e=class extends D{constructor(e,a=[],r){super(),this.stdout=new D,this.stderr=new D,this.program=e,this.args=typeof a=="string"?[a]:a,this.options=r??{}}static sidecar(e,a=[],r){let i=new _e(e,a,r);return i.options.sidecar=!0,i}async spawn(){return Kt(e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload);break}},this.program,this.args,this.options).then(e=>new ye(e))}async execute(){return new Promise((e,a)=>{this.on("error",a);let r=[],i=[];this.stdout.on("data",s=>{r.push(s)}),this.stderr.on("data",s=>{i.push(s)}),this.on("close",s=>{e({code:s.code,signal:s.signal,stdout:r.join(`
`),stderr:i.join(`
`)})}),this.spawn().catch(a)})}};async function Qt(t,e){return n({__tauriModule:"Shell",message:{cmd:"open",path:t,with:e}})}var Zt={};m(Zt,{getName:()=>ea,getTauriVersion:()=>ta,getVersion:()=>Xt,hide:()=>na,show:()=>aa});async function Xt(){return n({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function ea(){return n({__tauriModule:"App",message:{cmd:"getAppName"}})}async function ta(){return n({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function aa(){return n({__tauriModule:"App",message:{cmd:"show"}})}async function na(){return n({__tauriModule:"App",message:{cmd:"hide"}})}var ra={};m(ra,{getMatches:()=>ia});async function ia(){return n({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}var sa={};m(sa,{readText:()=>la,writeText:()=>oa});async function oa(t){return n({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})}async function la(){return n({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var ua={};m(ua,{ask:()=>ha,confirm:()=>pa,message:()=>ma,open:()=>ca,save:()=>da});async function ca(t={}){return typeof t=="object"&&Object.freeze(t),n({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})}async function da(t={}){return typeof t=="object"&&Object.freeze(t),n({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})}async function ma(t,e){let a=typeof e=="string"?{title:e}:e;return n({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:a?.title?.toString(),type:a?.type,buttonLabel:a?.okLabel?.toString()}})}async function ha(t,e){let a=typeof e=="string"?{title:e}:e;return n({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:a?.title?.toString(),type:a?.type,buttonLabels:[a?.okLabel?.toString()??"Yes",a?.cancelLabel?.toString()??"No"]}})}async function pa(t,e){let a=typeof e=="string"?{title:e}:e;return n({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:a?.title?.toString(),type:a?.type,buttonLabels:[a?.okLabel?.toString()??"Ok",a?.cancelLabel?.toString()??"Cancel"]}})}var ya={};m(ya,{isRegistered:()=>fa,register:()=>_a,registerAll:()=>ga,unregister:()=>ba,unregisterAll:()=>wa});async function _a(t,e){return n({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:g(e)}})}async function ga(t,e){return n({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:g(e)}})}async function fa(t){return n({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})}async function ba(t){return n({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})}async function wa(){return n({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var va={};m(va,{Body:()=>w,Client:()=>be,Response:()=>fe,ResponseType:()=>ge,fetch:()=>Ma,getClient:()=>we});var ge=(t=>(t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary",t))(ge||{}),w=class{constructor(t,e){this.type=t,this.payload=e}static form(t){let e={},a=(r,i)=>{if(i!==null){let s;typeof i=="string"?s=i:i instanceof Uint8Array||Array.isArray(i)?s=Array.from(i):i instanceof File?s={file:i.name,mime:i.type,fileName:i.name}:typeof i.file=="string"?s={file:i.file,mime:i.mime,fileName:i.fileName}:s={file:Array.from(i.file),mime:i.mime,fileName:i.fileName},e[String(r)]=s}};if(t instanceof FormData)for(let[r,i]of t)a(r,i);else for(let[r,i]of Object.entries(t))a(r,i);return new w("Form",e)}static json(t){return new w("Json",t)}static text(t){return new w("Text",t)}static bytes(t){return new w("Bytes",Array.from(t instanceof ArrayBuffer?new Uint8Array(t):t))}},fe=class{constructor(t){this.url=t.url,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data}},be=class{constructor(t){this.id=t}async drop(){return n({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(t){let e=!t.responseType||t.responseType===1;return e&&(t.responseType=2),n({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then(a=>{let r=new fe(a);if(e){try{r.data=JSON.parse(r.data)}catch(i){if(r.ok&&r.data==="")r.data={};else if(r.ok)throw Error(`Failed to parse response \`${r.data}\` as JSON: ${i};
try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return r}return r})}async get(t,e){return this.request({method:"GET",url:t,...e})}async post(t,e,a){return this.request({method:"POST",url:t,body:e,...a})}async put(t,e,a){return this.request({method:"PUT",url:t,body:e,...a})}async patch(t,e){return this.request({method:"PATCH",url:t,...e})}async delete(t,e){return this.request({method:"DELETE",url:t,...e})}};async function we(t){return n({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(e=>new be(e))}var L=null;async function Ma(t,e){return L===null&&(L=await we()),L.request({url:t,method:e?.method??"GET",...e})}var v=z;function Y(t,e,a){const r=t.slice();r[7]=e[a];const i=r[7].getInfo();return r[8]=i,r}function K(t){let e,a=t[8].product+"",r,i,s,o=!1,p,h,_;return p=$e(t[4][0]),{c(){e=M("label"),r=Ae(a),i=M("input"),this.h()},l(u){e=P(u,"LABEL",{});var l=Q(e);r=We(l,a),i=P(l,"INPUT",{type:!0,name:!0}),l.forEach($),this.h()},h(){B(i,"type","radio"),B(i,"name","port"),i.__value=s=t[8].name,V(i,i.__value),p.p(i)},m(u,l){Z(u,e,l),f(e,r),f(e,i),i.checked=i.__value===t[1],h||(_=C(i,"change",t[3]),h=!0)},p(u,l){l&1&&a!==(a=u[8].product+"")&&Te(r,a),l&1&&s!==(s=u[8].name)&&(i.__value=s,V(i,i.__value),o=!0),(o||l&3)&&(i.checked=i.__value===u[1])},d(u){u&&$(e),p.r(),h=!1,_()}}}function Pa(t){let e,a,r,i="Cancel",s,o,p="Ok",h,_,u=G(t[0]),l=[];for(let d=0;d<u.length;d+=1)l[d]=K(Y(t,u,d));return{c(){e=M("dialog");for(let d=0;d<l.length;d+=1)l[d].c();a=R(),r=M("button"),r.textContent=i,s=R(),o=M("button"),o.textContent=p},l(d){e=P(d,"DIALOG",{});var y=Q(e);for(let c=0;c<l.length;c+=1)l[c].l(y);a=U(y),r=P(y,"BUTTON",{"data-svelte-h":!0}),j(r)!=="svelte-1ays89h"&&(r.textContent=i),s=U(y),o=P(y,"BUTTON",{"data-svelte-h":!0}),j(o)!=="svelte-p0uueg"&&(o.textContent=p),y.forEach($)},m(d,y){Z(d,e,y);for(let c=0;c<l.length;c+=1)l[c]&&l[c].m(e,null);f(e,a),f(e,r),f(e,s),f(e,o),h||(_=[C(r,"click",t[5]),C(o,"click",t[6])],h=!0)},p(d,[y]){if(y&3){u=G(d[0]);let c;for(c=0;c<u.length;c+=1){const I=Y(d,u,c);l[c]?l[c].p(I,y):(l[c]=K(I),l[c].c(),l[c].m(e,a))}for(;c<l.length;c+=1)l[c].d(1);l.length=u.length}},i:q,o:q,d(d){d&&$(e),Me(l,d),h=!1,Pe(_)}}}function Da(t,e,a){let{ports:r}=e;const i=De();let s=r[0].getInfo().name;const o=[[]];function p(){s=this.__value,a(1,s)}const h=()=>i("confirm",void 0),_=()=>i("confirm",r.find(u=>u.getInfo().name===s));return t.$$set=u=>{"ports"in u&&a(0,r=u.ports)},[r,s,i,p,o,h,_]}class $a extends Le{constructor(e){super(),Ce(this,e,Da,Pa,ve,{ports:0})}}function Aa(t){return{getInfo(){return t},async open({baudRate:e}){await v("plugin:serial|open",{path:t.name,baudRate:e})},async close(){await v("plugin:serial|close",{path:t.name})},async forget(){},readable:new ReadableStream({async pull(e){const a=await v("plugin:serial|read",{path:t.name});e.enqueue(new Uint8Array(a))}}),writable:new WritableStream({async write(e){await v("plugin:serial|write",{path:t.name,chunk:Array.from(e)})}})}}navigator.serial={async getPorts(){return v("plugin:serial|get_serial_ports").then(t=>t.map(Aa))},async requestPort(t){const e=await navigator.serial.getPorts().then(i=>t?.filters!==void 0?i.filter(s=>t.filters.some(({usbVendorId:o,usbProductId:p})=>{const h=s.getInfo();return(o===void 0||h.usbVendorId===o)&&(p===void 0||h.usbProductId===p)})):i),a=new $a({target:document.body,props:{ports:e}}),r=await new Promise(i=>a.$on("confirm",i));return a.$destroy(),r}};