@overlayed/app 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +3 -1
- package/dist/preload.js +1 -1
- package/dist/siege.d.ts +46 -46
- package/package.json +6 -5
package/dist/index.mjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";import{Type as t,scope as n,type as r}from"arktype";import i from"mitt";import a,{createWriteStream as o,existsSync as s,mkdirSync as c,readdirSync as l,unlinkSync as u,writeFileSync as d}from"fs";import{ensureFileSync as f}from"fs-extra";import p,{join as m}from"path";import h,{basename as g,resolve as _}from"node:path";import ee from"events";import{copyFileSync as te,createReadStream as ne,existsSync as v,mkdirSync as re,readFileSync as ie,readdirSync as ae,writeFileSync as oe}from"node:fs";import"glob";import"jiti";import se from"xior";import y from"fs/promises";import b from"jszip";import{createHash as ce}from"node:crypto";import{app as x}from"electron";import*as S from"node:os";import*as le from"node:fs/promises";import ue from"systeminformation";var de=Object.create,fe=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,me=Object.getOwnPropertyNames,he=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty,C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_e=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=me(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ge.call(e,s)&&s!==n&&fe(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=pe(t,s))||r.enumerable});return e},ve=(e,t,n)=>(n=e==null?{}:de(he(e)),_e(t||!e||!e.__esModule?fe(n,`default`,{value:e,enumerable:!0}):n,e));function ye(e){return e}function w(e){return e?Array.isArray(e)?e:[e]:[]}function be(e){return typeof e==`string`&&/^01[0-9A-HJKMNP-TV-Z]{24}$/.test(e)}var xe=class{data=[];constructor(){}get size(){return this.data.length}add(e){this.data.push(e)}next(){return this.data.shift()}clear(){this.data.length=0}*flush(){for(;this.size>0;){let e=this.next();e&&(yield e)}}},T=ve(C(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}))(),1),E=class{emitter;constructor(){this.emitter=i()}on(e,t){w(e).forEach(e=>{this.emitter.on(e,t)})}off(e,t){w(e).forEach(e=>{this.emitter.off(e,t)})}emit(e,t){w(e).forEach(e=>{this.emitter.emit(e,t)})}removeAllListeners(){this.emitter.all.clear()}},Se=class{listeners;constructor(){this.listeners=new Map}on(e,t){w(e).forEach(e=>{let n=this.listeners.get(e)||new Set;n.add(t),this.listeners.set(e,n)})}off(e,t){w(e).forEach(e=>{let n=this.listeners.get(e);n&&n.delete(t)})}async emit(e,...t){let n=w(e).flatMap(e=>{let t=this.listeners.get(e)||new Set,n=this.listeners.get(`*`)||new Set;return[...Array.from(t),...Array.from(n)]});return n.length===0?[]:await Promise.all(n.map(async n=>{try{let e=n(...t);return e instanceof Promise?await e:e}catch(t){console.error(`Error in event listener for ${String(e)}:`,t);return}}))}removeAllListeners(){this.listeners.clear()}};function D(e,...t){return class extends e{static _instance;static getInstance(){return this._instance||=new e(...t),this._instance}static clearInstance(){this._instance=void 0}}}const O=D(class extends E{destroy(){this.removeAllListeners()}fatal(e,t,n){this.emit(`fatal`,{code:t,message:e,data:n,timestamp:Date.now()})}error(e,t,n){this.emit(`error`,{code:t,message:e,data:n,timestamp:Date.now()})}warn(e,t,n){this.emit(`warning`,{code:t,message:e,data:n,timestamp:Date.now()})}});var k=class{data;_schema;_defaultValue;_path;constructor(e){let{schema:t,default:n,path:r}=e;this._schema=t,this._defaultValue=n,this._path=r}set(e){let t=this._schema[`~standard`].validate(e);if(t instanceof Promise)throw Error(`StructuredConfigFile does not support async validation`);if(t.issues){this.reportInvalidConfigFile(t.issues);return}this.data=this.onBeforeSave(e),this.save(e)}get(){return this.data?this.data:this.load()}getKey(e){return this.get()[e]}save(e){let t=this.onBeforeSave(e);try{f(this.getFilePath()),a.writeFileSync(this.getFilePath(),JSON.stringify(t,void 0,2))}catch{return}return this.data=t}load(){if(!this.fileExists(this.getFilePath())||!this.canReadWriteFile(this.getFilePath())){this.save(this._defaultValue);let e=this.onAfterLoad(this._defaultValue);return this.data=e,e}try{let e=a.readFileSync(this.getFilePath(),`utf8`),t=this.onAfterLoad(this.parseStoredData(e));return this.data=t,t}catch{return this.data=this._defaultValue}}onBeforeSave(e){return e}onAfterLoad(e){return e}getFilePath(){return this._path}parseStoredData(e){try{let t=r(`string.json.parse`).to(`object`)(e);if(t instanceof r.errors)return this._defaultValue;let n=this._schema[`~standard`].validate(t);if(n instanceof Promise)throw Error(`StructuredConfigFile does not support async validation`);return n.issues?this.migrate(t,this._defaultValue):this.migrate(n.value,this._defaultValue)}catch{return this._defaultValue}}canReadWriteFile(e){try{return a.accessSync(e,a.constants.R_OK|a.constants.W_OK),!0}catch{return!1}}fileExists(e){try{return a.accessSync(e,a.constants.F_OK),!0}catch{return!1}}migrate(e,t){let n={...e};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(r in e?e[r]!==null&&t[r]!==null&&typeof e[r]==`object`&&typeof t[r]==`object`&&!Array.isArray(e[r])&&!Array.isArray(t[r])?n[r]=this.migrate(e[r],t[r]):Array.isArray(t[r])&&(n[r]=e[r]):n[r]=t[r]);return n}reportInvalidConfigFile(e){O.getInstance().error(`Invalid config file`,`INVALID_CONFIG_FILE`,{issues:e.map(e=>e.message),filePath:this._path,data:this.data})}};function Ce(e,t,n){return typeof e!=`object`||!e?String(e):e instanceof Error?JSON.stringify(e,(e,t)=>{if(t instanceof Error){let e={};for(let n of Object.getOwnPropertyNames(t))e[n]=t[n];return e}return t},n):e instanceof Map?JSON.stringify(Object.fromEntries(e.entries()),t,n):e instanceof Set?JSON.stringify(Array.from(e),t,n):JSON.stringify(e,t,n)}const we=/\x1b\[[0-9;]*m/g;function Te(e){return e.replace(we,``)}var Ee=class e extends E{stream;logPath;baseFileName;currentDate;rotationCheckInterval;isRotating=!1;constructor(e,t){super(),this.logPath=e,this.baseFileName=t.replace(`.log`,``),this.currentDate=this.getDateString(new Date),this.ensureLogDirectory(),this.ensureLogFile(),this.stream=this.createStream(),this.rotationCheckInterval=this.startRotationCheck(),this.cleanupOldLogs()}static scope(t,n){return new e(t,n)}log(...e){this.write(`info`,...e)}error(...e){this.write(`error`,...e)}warn(...e){this.write(`warn`,...e)}info(...e){this.write(`info`,...e)}debug(...e){this.write(`debug`,...e)}async close(){clearInterval(this.rotationCheckInterval),await new Promise(e=>{this.stream.end(()=>e())})}getCurrentFileName(){return this.getFileName(this.currentDate)}static getMessageElements(e,...t){let n=new Date;return{timestamp:n.toISOString().replace(`T`,` `).replace(/\.\d+Z$/,``)+`.${n.getUTCMilliseconds().toString().padStart(3,`0`)}`,level:e,message:t.map(e=>Ce(e)).join(` `)}}getFileName(e){return`${this.baseFileName}-${e}.log`}ensureLogDirectory(){try{c(this.logPath,{recursive:!0})}catch(e){throw console.error(`Failed to create log directory ${this.logPath}:`,e),e}}ensureLogFile(){let e=m(this.logPath,this.getFileName(this.currentDate));if(!s(e))try{d(e,``,`utf8`)}catch(t){throw console.error(`Failed to create log file ${e}:`,t),t}}getDateString(e){return`${e.getUTCFullYear()}-${(e.getUTCMonth()+1).toString().padStart(2,`0`)}-${e.getUTCDate().toString().padStart(2,`0`)}`}createStream(){return o(m(this.logPath,this.getFileName(this.currentDate)),{flags:`a`,encoding:`utf8`})}async rotateLogs(){if(this.isRotating)return;this.isRotating=!0;let e=this.getDateString(new Date);e!==this.currentDate&&await new Promise(t=>{this.stream.end(()=>{this.currentDate=e,this.stream=this.createStream(),this.cleanupOldLogs(),t()})}),this.isRotating=!1}startRotationCheck(){return setInterval(()=>this.rotateLogs(),6e4)}cleanupOldLogs(){let e=l(this.logPath),t=new Date,n=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()-7));e.filter(e=>e.startsWith(this.baseFileName)&&e.endsWith(`.log`)).filter(e=>{let[t,r,i]=e.replace(`${this.baseFileName}-`,``).replace(`.log`,``).split(`-`).map(Number);return new Date(Date.UTC(t,r-1,i))<=n}).forEach(e=>{try{u(m(this.logPath,e))}catch(t){console.error(`Failed to delete old log file ${e}:`,t)}})}write(t,...n){let{timestamp:r,message:i}=e.getMessageElements(t,...n),a=`[${r}] [${t}] ${Te(i)}\n`;this.stream.write(a,e=>{e?this.emit(`error`,e):this.emit(`write`,a)})}};const A=()=>h.join(process.env.APPDATA??``,`overlayed`),De=()=>h.join(A(),`logs`),Oe=e=>h.join(A(),`apps`,e),ke=e=>h.join(Oe(e),`logs`),Ae=()=>h.join(A(),`meta.json`);var je=class{fileLogger;path;appId;messageQueue=new xe;fileName;_debug=!1;silent=!1;constructor(e){this.fileName=e}init(e,t=!1,n=!1){this.appId=e,this._debug=t,this.silent=n,this.path=ke(e),this.fileLogger=new Ee(this.path,this.fileName),this.messageQueue.flush().forEach(e=>{this.fileLogger?.[e.type](...e.args)})}scope(e){if(!this.appId||!this.path)throw Error(`Logger not initialized`);let t=T.default.cyan(`[${e}]`);return{scope:e=>this.scope(e),error:(...e)=>this.error(t,...e),warn:(...e)=>this.warn(t,...e),info:(...e)=>this.info(t,...e),log:(...e)=>this.log(t,...e),debug:(...e)=>this.debug(t,...e)}}error(...e){this.handle(`error`,...e)}warn(...e){this.handle(`warn`,...e)}info(...e){this.handle(`log`,...e)}debug(...e){this._debug&&this.handle(`debug`,...e)}log(...e){this.handle(`log`,...e)}handle(e,...t){this.logToConsole(e,...t),this.fileLogger?this.fileLogger[e](...t):this.messageQueue.add({type:e,args:t})}logToConsole(e,...t){let n={error:T.default.red,warn:T.default.yellow,debug:T.default.blue,log:T.default.white};if(this.silent&&!this._debug)return;let{timestamp:r,message:i}=Ee.getMessageElements(e,...t),a=console[e],o=n[e];a(`${T.default.gray(r)} ${o(i)}`)}};const j=D(je,`overlayed.log`);var Me=class extends ee{blob;chunkSizeMb;maxConcurrent;shouldStop=!1;constructor(e,t){super(),this.blob=e,this.chunkSizeMb=t.chunkSizeMb,this.maxConcurrent=t.maxConcurrent??3}get totalChunks(){return Math.ceil(this.blob.size/(this.chunkSizeMb*1024*1024))}async chunk(e){let t=this.chunkSizeMb*1024*1024,n=this.totalChunks;if(n===0)return;let r=new Map,i=new Set,a=new Set,o=[];for(let e=0;e<n;e++)o.push(e);let s=async n=>{let s=n*t,c=Math.min(s+t,this.blob.size),l=this.blob.slice(s,c);try{await e(l,n),a.add(n),this.emit(`chunkComplete`,n),i.delete(n)}catch(e){let t=r.get(n)||0;t<5?(r.set(n,t+1),await new Promise(e=>setTimeout(e,(t+1)*1e3)),o.push(n)):(a.add(n),this.emit(`error`,e),this.shouldStop=!0,i.delete(n))}},c=[],l=async()=>{for(;(o.length>0||i.size>0)&&!this.shouldStop;){if(o.length===0){await new Promise(e=>setTimeout(e,10));continue}let e=o.shift();a.has(e)||i.has(e)||(i.add(e),await s(e))}};for(let e=0;e<this.maxConcurrent;e++)c.push(l());await Promise.all(c)}};function Ne(e,t){let{recursive:n}=Pe(t);return v(e)?n?Fe(e).map(t=>[e,t]):ae(e).map(t=>[e,t]):[]}function Pe(e){return{recursive:e?.recursive??!0}}function Fe(e){return ae(e,{withFileTypes:!0}).flatMap(t=>{let n=h.join(e,t.name);return t.isDirectory()?Fe(n):[n]})}function Ie(e){return Le(e),e}function Le(e){if(!be(e.applicationId))throw Error(`Invalid applicationId, must be a valid ULID.`)}const{PipeEventServer:Re,PipeEventClient:ze,PipeEventBase:Be,ProcessMonitor:Ve,Process:He,HardwareInterface:Ue}=e(import.meta.url)(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`),M=D(class extends E{server=null;_hasConnection=!1;pipeId;get hasConnection(){return this._hasConnection}constructor(e){super(),this.pipeId=e,this.init()}destroy(){this.server&&=(this._hasConnection=!1,this.server?.removeAllListeners(),null)}init(){this.server=new Re(this.pipeId,{clientCount:1,access:1}),this.server.on(`event`,e=>{try{let t=JSON.parse(e);this.emit(`data`,[t])}catch(e){this.emit(`error`,e)}}),this.server.on(`connected`,()=>{this._hasConnection=!0,this.emit(`connected`,void 0)}),this.server.on(`disconnected`,()=>{this._hasConnection=!1,this.emit(`disconnected`,void 0)})}},`overlayed-event-server`),{RenderInterface:We,renderHookPath:Ge}=e(import.meta.url)(`@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node`);let Ke=function(e){return e[e.LeftButton=1]=`LeftButton`,e[e.RightButton=2]=`RightButton`,e[e.Cancel=3]=`Cancel`,e[e.MiddleButton=4]=`MiddleButton`,e[e.ExtraButton1=5]=`ExtraButton1`,e[e.ExtraButton2=6]=`ExtraButton2`,e[e.Back=8]=`Back`,e[e.Tab=9]=`Tab`,e[e.Clear=12]=`Clear`,e[e.Return=13]=`Return`,e[e.Shift=16]=`Shift`,e[e.Control=17]=`Control`,e[e.Menu=18]=`Menu`,e[e.Pause=19]=`Pause`,e[e.CapsLock=20]=`CapsLock`,e[e.Kana=21]=`Kana`,e[e.Hangeul=21]=`Hangeul`,e[e.Hangul=21]=`Hangul`,e[e.Junja=23]=`Junja`,e[e.Final=24]=`Final`,e[e.Hanja=25]=`Hanja`,e[e.Kanji=25]=`Kanji`,e[e.Escape=27]=`Escape`,e[e.Convert=28]=`Convert`,e[e.NonConvert=29]=`NonConvert`,e[e.Accept=30]=`Accept`,e[e.ModeChange=31]=`ModeChange`,e[e.Space=32]=`Space`,e[e.Prior=33]=`Prior`,e[e.Next=34]=`Next`,e[e.End=35]=`End`,e[e.Home=36]=`Home`,e[e.Left=37]=`Left`,e[e.Up=38]=`Up`,e[e.Right=39]=`Right`,e[e.Down=40]=`Down`,e[e.Select=41]=`Select`,e[e.Print=42]=`Print`,e[e.Execute=43]=`Execute`,e[e.Snapshot=44]=`Snapshot`,e[e.Insert=45]=`Insert`,e[e.Delete=46]=`Delete`,e[e.Help=47]=`Help`,e[e.N0=48]=`N0`,e[e.N1=49]=`N1`,e[e.N2=50]=`N2`,e[e.N3=51]=`N3`,e[e.N4=52]=`N4`,e[e.N5=53]=`N5`,e[e.N6=54]=`N6`,e[e.N7=55]=`N7`,e[e.N8=56]=`N8`,e[e.N9=57]=`N9`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.LeftWindows=91]=`LeftWindows`,e[e.RightWindows=92]=`RightWindows`,e[e.Application=93]=`Application`,e[e.Sleep=95]=`Sleep`,e[e.Numpad0=96]=`Numpad0`,e[e.Numpad1=97]=`Numpad1`,e[e.Numpad2=98]=`Numpad2`,e[e.Numpad3=99]=`Numpad3`,e[e.Numpad4=100]=`Numpad4`,e[e.Numpad5=101]=`Numpad5`,e[e.Numpad6=102]=`Numpad6`,e[e.Numpad7=103]=`Numpad7`,e[e.Numpad8=104]=`Numpad8`,e[e.Numpad9=105]=`Numpad9`,e[e.Multiply=106]=`Multiply`,e[e.Add=107]=`Add`,e[e.Separator=108]=`Separator`,e[e.Subtract=109]=`Subtract`,e[e.Decimal=110]=`Decimal`,e[e.Divide=111]=`Divide`,e[e.F1=112]=`F1`,e[e.F2=113]=`F2`,e[e.F3=114]=`F3`,e[e.F4=115]=`F4`,e[e.F5=116]=`F5`,e[e.F6=117]=`F6`,e[e.F7=118]=`F7`,e[e.F8=119]=`F8`,e[e.F9=120]=`F9`,e[e.F10=121]=`F10`,e[e.F11=122]=`F11`,e[e.F12=123]=`F12`,e[e.F13=124]=`F13`,e[e.F14=125]=`F14`,e[e.F15=126]=`F15`,e[e.F16=127]=`F16`,e[e.F17=128]=`F17`,e[e.F18=129]=`F18`,e[e.F19=130]=`F19`,e[e.F20=131]=`F20`,e[e.F21=132]=`F21`,e[e.F22=133]=`F22`,e[e.F23=134]=`F23`,e[e.F24=135]=`F24`,e[e.NumLock=144]=`NumLock`,e[e.ScrollLock=145]=`ScrollLock`,e[e.NEC_Equal=146]=`NEC_Equal`,e[e.Fujitsu_Jisho=146]=`Fujitsu_Jisho`,e[e.Fujitsu_Masshou=147]=`Fujitsu_Masshou`,e[e.Fujitsu_Touroku=148]=`Fujitsu_Touroku`,e[e.Fujitsu_Loya=149]=`Fujitsu_Loya`,e[e.Fujitsu_Roya=150]=`Fujitsu_Roya`,e[e.LeftShift=160]=`LeftShift`,e[e.RightShift=161]=`RightShift`,e[e.LeftControl=162]=`LeftControl`,e[e.RightControl=163]=`RightControl`,e[e.LeftMenu=164]=`LeftMenu`,e[e.RightMenu=165]=`RightMenu`,e[e.BrowserBack=166]=`BrowserBack`,e[e.BrowserForward=167]=`BrowserForward`,e[e.BrowserRefresh=168]=`BrowserRefresh`,e[e.BrowserStop=169]=`BrowserStop`,e[e.BrowserSearch=170]=`BrowserSearch`,e[e.BrowserFavorites=171]=`BrowserFavorites`,e[e.BrowserHome=172]=`BrowserHome`,e[e.VolumeMute=173]=`VolumeMute`,e[e.VolumeDown=174]=`VolumeDown`,e[e.VolumeUp=175]=`VolumeUp`,e[e.MediaNextTrack=176]=`MediaNextTrack`,e[e.MediaPrevTrack=177]=`MediaPrevTrack`,e[e.MediaStop=178]=`MediaStop`,e[e.MediaPlayPause=179]=`MediaPlayPause`,e[e.LaunchMail=180]=`LaunchMail`,e[e.LaunchMediaSelect=181]=`LaunchMediaSelect`,e[e.LaunchApplication1=182]=`LaunchApplication1`,e[e.LaunchApplication2=183]=`LaunchApplication2`,e[e.OEM1=186]=`OEM1`,e[e.OEMPlus=187]=`OEMPlus`,e[e.OEMComma=188]=`OEMComma`,e[e.OEMMinus=189]=`OEMMinus`,e[e.OEMPeriod=190]=`OEMPeriod`,e[e.OEM2=191]=`OEM2`,e[e.OEM3=192]=`OEM3`,e[e.OEM4=219]=`OEM4`,e[e.OEM5=220]=`OEM5`,e[e.OEM6=221]=`OEM6`,e[e.OEM7=222]=`OEM7`,e[e.OEM8=223]=`OEM8`,e[e.OEMAX=225]=`OEMAX`,e[e.OEM102=226]=`OEM102`,e[e.ICOHelp=227]=`ICOHelp`,e[e.ICO00=228]=`ICO00`,e[e.ProcessKey=229]=`ProcessKey`,e[e.ICOClear=230]=`ICOClear`,e[e.Packet=231]=`Packet`,e[e.OEMReset=233]=`OEMReset`,e[e.OEMJump=234]=`OEMJump`,e[e.OEMPA1=235]=`OEMPA1`,e[e.OEMPA2=236]=`OEMPA2`,e[e.OEMPA3=237]=`OEMPA3`,e[e.OEMWSCtrl=238]=`OEMWSCtrl`,e[e.OEMCUSel=239]=`OEMCUSel`,e[e.OEMATTN=240]=`OEMATTN`,e[e.OEMFinish=241]=`OEMFinish`,e[e.OEMCopy=242]=`OEMCopy`,e[e.OEMAuto=243]=`OEMAuto`,e[e.OEMENLW=244]=`OEMENLW`,e[e.OEMBackTab=245]=`OEMBackTab`,e[e.ATTN=246]=`ATTN`,e[e.CRSel=247]=`CRSel`,e[e.EXSel=248]=`EXSel`,e[e.EREOF=249]=`EREOF`,e[e.Play=250]=`Play`,e[e.Zoom=251]=`Zoom`,e[e.Noname=252]=`Noname`,e[e.PA1=253]=`PA1`,e[e.OEMClear=254]=`OEMClear`,e}({});const N=r({game:`string`,type:`string`,creation_time:`number`}).and({game:`'siege' | 'tft'`}),qe=N.and({type:`'logged_in'`,content:{account_id:`string`}}),Je=N.and({type:`'module_loaded'`,content:{game_version:`string`,process_hash:`string`}}),Ye=N.and({type:`'module_unloaded'`}),Xe=N.and({type:`'unsupported_game_version'`,content:{game_version:`string`,process_hash:`string`}}),Ze=n({"#event1":`logged_in | module_loaded | module_unloaded | unsupported_game_version`,event:`event1`,logged_in:qe,module_loaded:Je,module_unloaded:Ye,unsupported_game_version:Xe}).export(),Qe=Object.keys(Ze).filter(e=>e!==`event`);function $e(){return{key:`universal`,events:Ze}}var et=class{logger;initialized=!1;constructor(e){this.logger=j.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1}},P=class extends E{logger;initialized=!1;constructor(e){super(),this.logger=j.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1,this.removeAllListeners()}},tt=class extends Se{logger;initialized=!1;constructor(e){super(),this.logger=j.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1,this.removeAllListeners()}};const nt=se.create({baseURL:`https://updater.stats.cc`,headers:{Accept:`application/json`,"Accept-Encoding":`gzip, deflate, br`}});let rt;function it(e){rt=e}nt.interceptors.request.use(e=>{let t=rt?.();return t?(e.headers??={},e.headers.Authorization=t,e):e});const F=se.create({baseURL:`https://api.overlayed.gg`,headers:{Accept:`application/json`,"Accept-Encoding":`gzip, deflate, br`}});let at;function ot(e){at=e}let I;function st(e){I=e}function ct(e){return`overlayed/app (${Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`, `)})`}F.interceptors.request.use(e=>{let t=at?.();e.headers??={},t&&(e.headers[`X-Api-Key`]=t);let n=I?.();return n&&(e.headers[`User-Agent`]=ct(n)),e});function lt(e,t){if(t<=0)throw Error(`Chunk size must be greater than 0`);if(e.length===0)return[];let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function ut(e){return e}function dt(e){return e?t=>(e(t),t):ut}const ft=dt();function pt(e){return F.get(`/v1/public/applications/${e}`)}function mt(e,t){let n=new FormData;return n.append(`file`,new Blob([t.file],{type:`application/zip`}),`logs.zip`),n.append(`data`,JSON.stringify(t.data)),F.post(`/v1/public/applications/${e}/feedbacks`,n)}function ht(e,t){return F.get(`/v1/public/applications/${e}/notices`,{params:t})}function gt(e,t){return F.get(`/v1/public/modules/${e}/release`,{params:{cortex_user_id:t}})}function _t(e,t,n){return F.post(`/v1/public/modules/${e}/releases/${t}/download`,n)}async function vt(e,t){if(e.method!==`GET`)throw Error(`Unsupported presigned request method: ${e.method}`);let n=await fetch(e.url,{method:e.method,headers:e.headers,signal:t?.signal});if(!n.ok){let e=await yt(n);throw Error(`Presigned download failed (${n.status} ${n.statusText})${e?`: ${e}`:``}`)}let r=await n.arrayBuffer();return new Uint8Array(r)}async function yt(e){try{let t=(await e.text()).trim();if(t.length===0)return;let n=2048;return t.length>n?`${t.slice(0,n)}…`:t}catch{return}}function bt(){return F.get(`/v1/public/raven/config`)}function xt(e,t){return F.get(`/v1/public/raven/games/${e}/builds/${t}`)}function St(e,t){return F.post(`/v1/public/raven/games/${e}/builds/upload`,null,{params:t})}function Ct(e,t){let n=new FormData;return n.append(`file`,t.chunk),F.patch(`/v1/public/raven/games/${e}/builds/upload`,n,{params:t})}function wt(e){let t=Date.now(),n=lt(e.messages.map(e=>Tt(t,e)),250),r=Promise.all(n.map(async t=>F.post(`/v1/public/cortex/events`,{...e,messages:t})));return r.catch(e=>{let t=e?.response?.data||e?.message||e;console.error(`Failed to submit cortex events`,t)}),r}function Tt(e,t){let n=e-t.created_at.getTime(),r=Math.max(0,Math.floor(n/1e3));return{properties:t.properties,type:t.type,seconds_offset:r}}function Et(e){return e instanceof Error&&(e.name===`XiorError`||e.name===`XiorTimeoutError`)}function Dt(e){return!!(e&&`kind`in e.data&&`message`in e.data)}const{PipeEventServer:Ot,PipeEventClient:kt,PipeEventBase:At,ProcessMonitor:jt,Process:Mt,HardwareInterface:Nt}=e(import.meta.url)(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`);function Pt(e=[]){return h.normalize(h.join(Oe(global.OVERLAYED.APPLICATION_ID),...e))}const Ft=r({game:`string`,type:`string`,creation_time:`number`}),L=new k({path:Ae(),schema:r({userId:`string | undefined`,sessionId:`string | undefined`,sessionLastUsed:`number | undefined`,"debug?":{"ri_disabled?":`boolean`,"gm_disabled?":`boolean`}}),default:{userId:void 0,sessionId:void 0,sessionLastUsed:void 0}});function It(){let{debug:e}=L.get();return e?{ri_disabled:e.ri_disabled??!1,gm_disabled:e.gm_disabled??!1}:{ri_disabled:!1,gm_disabled:!1}}function R(){let e=L.get().userId;if(e)return e;let t=zt();return L.set({...L.get(),userId:t}),t}function Lt(){let e=L.get();if(e.sessionId&&typeof e.sessionLastUsed==`number`&&Date.now()-e.sessionLastUsed<=300*1e3)return e.sessionId;let t=crypto.randomUUID();return L.set({...e,sessionId:t,sessionLastUsed:Date.now()}),t}function Rt(){try{let e=L.get();L.set({...e,sessionLastUsed:Date.now()})}catch(e){j.getInstance().log(`Failed to update sessionLastUsed`,e)}}function zt(){try{return Nt.generateUniqueIdentifier()}catch{return crypto.randomUUID()}}let Bt;function Vt(e){Bt=e}const z=D(class extends P{UPDATE_CHECK_INTERVAL_MS=1e3*60*5;targetDir;updateInterval;constructor(){super(`NativeModuleManager`),this.targetDir=h.join(A(),`resources`),this.logger.log(`Target directory`,this.targetDir)}async initWithDlls(e){super.init(),await y.mkdir(this.targetDir,{recursive:!0}),await this.checkForUpdates(e),clearInterval(this.updateInterval),this.updateInterval=setInterval(()=>this.checkForUpdates(e),this.UPDATE_CHECK_INTERVAL_MS)}destroy(){this.updateInterval&&=(clearInterval(this.updateInterval),void 0),super.destroy()}async getDllFile(e){let t=await this.getCurrentBuildInfo(e);if(!t){this.logger.error(`No build found for module`,{moduleId:e});return}let n=this.getBuildPath(e,t.buildId);if(!v(n)){this.logger.error(`No build file found for module`,{moduleId:e});return}let r=h.join(n,t.buildFileName);if(!v(r)){this.logger.error(`No DLL file found for module`,{moduleId:e});return}return r}async getCurrentBuildInfo(e){try{let t=h.join(this.targetDir,e,`build.json`),n=await y.readFile(t,`utf-8`);return JSON.parse(n)}catch{return null}}getModulePath(e){return h.join(this.targetDir,e)}getBuildPath(e,t){return h.join(this.getModulePath(e),t)}async checkForUpdates(e){this.logger.log(`Checking for updates`);let t=R();if(!t){this.logger.error(`Failed to resolve cortex user id`);return}this.logger.log(`Cortex User ID`,t),await Bt?.();for(let n of e)try{let{data:e}=await gt(n,t);this.logger.log(`Release`,e);let r=(await this.getCurrentBuildInfo(n))?.buildId||null;this.logger.log(`${n} > Performing update check. current: ${r}, requested: ${e.build_id}`),e.build_id!==r||await this.isDownloadCorrupted(this.getBuildPath(n,e.build_id),e)?(this.logger.log(`${n} > Update found. current: ${r}, requested: ${e.build_id}`),this.logger.log(`${n} > Downloading and extracting DLLs`),await this.downloadAndExtractDll(n,e),this.logger.log(`${n} > Cleaning up other builds`),await this.cleanupExistingBuilds(n,e.build_id),this.emit(`dllUpdated`,{moduleId:n,buildId:e.build_id,releaseId:e.release_id})):this.logger.log(`${n} > No update found`)}catch(e){this.logger.error(`${n} > Error checking/updating`,e)}}async downloadAndExtractDll(e,t){this.logger.log(`${e} > Requesting download for build ${t.build_id}`);let n=R();if(!n){this.logger.error(`Failed to resolve cortex user id`);return}let{data:r}=await _t(e,t.release_id,{download_token:t.download_token,cortex_user_id:n});this.logger.log(`${e} > Downloading DLLs for build ${t.build_id}`);let i=await vt(r,{signal:AbortSignal.timeout(1e3*60*5)});this.logger.log(`${e} > Downloaded zip file for build ${t.build_id}`);let a=this.getBuildPath(e,t.build_id);await y.mkdir(a,{recursive:!0});let o=new b;await o.loadAsync(i);let s=Object.keys(o.files).map(e=>({name:e,file:o.files[e]})).filter(({file:e})=>!e.dir);if(s.length!==1){this.logger.error(`${e} > Zip must contain exactly 1 file, got ${s.length}`);return}let c=s[0],l=h.basename(c.name),u=h.normalize(l),d=h.isAbsolute(u),f=u.startsWith(`..`)||u.includes(`..${h.sep}`);if(l===``||l===`.`||l===`..`){this.logger.error(`${e} > Zip contained an invalid file name: ${c.name}`);return}if(!l.toLowerCase().endsWith(`.dll`)){this.logger.error(`${e} > Zip contained a non-dll file: ${c.name}`);return}if(d||f){this.logger.error(`${e} > Zip entry path is unsafe: ${c.name}`);return}let p=h.join(a,u),m=await c.file.async(`nodebuffer`);await y.writeFile(p,m),this.logger.log(`${e} > Extracted 1 file to ${p}`);let g={buildId:t.build_id,buildFileName:t.build_file_name},_=h.join(this.getModulePath(e),`build.json`);await y.writeFile(_,JSON.stringify(g),`utf-8`),this.logger.log(`${e} > Saved buildId to file: ${t.build_id}`)}async cleanupExistingBuilds(e,t){let n=this.getModulePath(e),r=this.getBuildPath(e,t),i=await y.readdir(n,{withFileTypes:!0});for(let t of i)t.isDirectory()&&h.join(n,t.name)!==r&&(await y.rm(h.join(n,t.name),{recursive:!0,force:!0}),this.logger.log(`${e} > Cleaned up build: ${t.name}`))}async hasPathAccess(e){try{return await y.access(e,y.constants.F_OK),!0}catch{return!1}}async isDownloadCorrupted(e,t){if(!await this.hasPathAccess(e))return this.logger.error(`Download is corrupted. Path does not exist: ${e}`),!0;let n=t.build_file_name,r=h.join(e,n);if(!v(r))return this.logger.error(`Download is corrupted. Build file not found: ${r}`),!0;if(t.build_hash){let e=await y.readFile(r),i=ce(`sha256`).update(e).digest(`hex`);if(i.toLowerCase()!==t.build_hash.toLowerCase())return this.logger.error(`Download is corrupted. Build file hash mismatch: ${n} ${i.toLowerCase()} !== ${t.build_hash.toLowerCase()}`),!0}return!1}}),B=D(class extends P{REFETCH_INTERVAL=1e3*60*5;FAILED_REFETCH_INTERVAL=1e3*30;_ravenConfig;_executableToGameMap=new Map;_executablesArray=[];_refetchIntervalHandler=null;_failedRefetchTimeoutHandler=null;constructor(){super(`RavenManager`)}init(){super.init(),this.fetchRavenConfig(),this._refetchIntervalHandler=setInterval(()=>{this._failedRefetchTimeoutHandler&&=(clearTimeout(this._failedRefetchTimeoutHandler),null),this.fetchRavenConfig()},this.REFETCH_INTERVAL)}getExecutableData(e){return this._executableToGameMap.get(e.toLowerCase())??null}get executables(){return this._executablesArray}get executablesMap(){return this._executableToGameMap}destroy(){this._refetchIntervalHandler&&clearInterval(this._refetchIntervalHandler),this._failedRefetchTimeoutHandler&&clearTimeout(this._failedRefetchTimeoutHandler),z.getInstance().destroy(),super.destroy()}async fetchRavenConfig(){try{this._ravenConfig={games:(await bt()).data.games},this.resetState();let e=new Set;for(let t of this._ravenConfig.games){for(let e of t.executables){let n=e.toLowerCase();this._executableToGameMap.set(n,t),this._executablesArray.push(n)}t.modules.forEach(t=>e.add(t))}await z.getInstance().initWithDlls(Array.from(e)),this.logger.log(`Raven updated, monitoring ${this._executableToGameMap.size} executables`),this.emit(`executablesUpdated`,{executables:this.executables,map:this._executableToGameMap})}catch(e){this.logger.error(`Failed to fetch Raven config`,e),this._failedRefetchTimeoutHandler=setTimeout(()=>this.fetchRavenConfig(),this.FAILED_REFETCH_INTERVAL)}}resetState(){this._executableToGameMap.clear(),this._executablesArray=[]}}),V=D(class extends P{_processMonitor;_processes=new Map;boundOnRavenManagerExecutablesUpdated=this.onRavenManagerExecutablesUpdated.bind(this);constructor(){super(`ProcessManager`),this._processMonitor=new jt}get hasAnyActiveProcesses(){return this.activeProcesses.length>0}get activeProcesses(){return Array.from(this._processes.values()).flat().filter(e=>!e.destroyedAt)}init(){super.init(),B.getInstance().on(`executablesUpdated`,this.boundOnRavenManagerExecutablesUpdated),this._processMonitor.on(`create`,e=>{this.logger.log(`Process created`,e),this.addProcess(e),this.logger.log(`Active Process Count: ${this._processes.size}`),this.emit(`create`,{process:e})}),this._processMonitor.on(`destroy`,e=>{this.logger.log(`Process destroyed`,e),this.deleteProcess(e),this.logger.log(`Active Process Count: ${this._processes.size}`),this.emit(`destroy`,{process:e})})}destroy(){B.getInstance().off(`executablesUpdated`,this.boundOnRavenManagerExecutablesUpdated),this._processes.clear(),this._processMonitor.removeAllListeners(),super.destroy()}isProcessRunning(e){return this._processes.get(e)?.some(e=>!e.destroyedAt)??!1}onRavenManagerExecutablesUpdated(e){this.logger.log(`Monitoring ${e.executables.length} processes`),e.executables.forEach(e=>{this._processMonitor.isProcessRegistered(e)||this._processMonitor.registerProcess(e)})}addProcess(e){if(!e.name)return;let t=this._processes.get(e.name);if(!t){this._processes.set(e.name,[e]);return}this._processes.set(e.name,t.concat(e))}deleteProcess(e){if(!e.name)return;let t=this._processes.get(e.name)?.filter(t=>t.id!==e.id)??[];t.length===0?this._processes.delete(e.name):this._processes.set(e.name,t)}});var Ht=class{_instance;_resolution;boundOnResolutionChanged=this.onResolutionChanged.bind(this);constructor(e){this._instance=e,this._resolution={width:0,height:0},this._instance.on(`resolution`,this.boundOnResolutionChanged)}destroy(){this._instance.off(`resolution`,this.boundOnResolutionChanged)}get instance(){return this._instance}get resolution(){return this._resolution}onResolutionChanged(e,t){this._resolution={width:e,height:t}}};const H=D(class{interfaces={};constructor(){}createInterface(e){return this.interfaces[e]||(this.interfaces[e]=new Ht(new We(e,{access:1}))),this.interfaces[e]}getInterface(e){return this.interfaces[e]?this.interfaces[e]:this.createInterface(e)}}),U=D(class{options;eventQueue;meta=null;constructor(e){this.options=this.resolveOptions(e),this.eventQueue=new xe,this.setupFlushInterval()}track(e,t){this.eventQueue.add({type:e,properties:t,created_at:new Date})}flush(){let e=Array.from(this.eventQueue.flush()).concat({type:`ping`,properties:{},created_at:new Date});if(!this.meta)throw Error(`Tried to flush Cortex events before meta was set`);try{wt({...this.meta,messages:e})}catch{}return e}setupFlushInterval(){setInterval(()=>{this.flush()},this.options.batchIntervalSeconds*1e3)}resolveOptions(e){return{batchIntervalSeconds:e?.batchIntervalSeconds??15}}}),W=e(import.meta.url),Ut=W.resolve(`@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll`),Wt=W.resolve(`@overlayed/app/dist/render-interface/build/overlayed_render_hook_x86.dll`),Gt=W.resolve(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`),G=D(class extends tt{boundOnProcessCreate=this.onProcessCreate.bind(this);boundOnProcessDestroy=this.onProcessDestroy.bind(this);subscribedGames=new Set;_activeReadyRavenGames={};get isInGame(){return Object.keys(this._activeReadyRavenGames).length>0}constructor(){super(`GameLaunchManager`)}setSubscribedGames(e){this.subscribedGames=new Set(e)}getActiveGames(){return Object.keys(this._activeReadyRavenGames)}init(){super.init(),H.getInstance().createInterface(`OGG_SIEGE`),V.getInstance().on(`create`,this.boundOnProcessCreate),V.getInstance().on(`destroy`,this.boundOnProcessDestroy)}destroy(){V.getInstance().off(`create`,this.boundOnProcessCreate),V.getInstance().off(`destroy`,this.boundOnProcessDestroy),super.destroy()}on(e,t){super.on(e,t);let n=w(e);if(!(n.includes(`gameReady`)||n.includes(`*`))||Object.keys(this._activeReadyRavenGames).length===0)return;let r=t;for(let e of Object.values(this._activeReadyRavenGames))this.logger.log(`Late calling gameReady callback for game`,e.game),r(e)}async onProcessCreate({process:e}){let t=this.getRavenGame(e);if(!t)return;if(this.subscribedGames.size===0){this.logger.warn(`No subscribed games, skipping`);return}if(U.getInstance().track(`game_launch`,{game:t.identifier}),!this.subscribedGames.has(t.identifier)&&!this.subscribedGames.has(`*`))return;let n=new AbortController;if(await this.emit(`gameLaunch`,{game:t.identifier,reject:()=>n.abort()}),n.signal.aborted)return;let r=Mt.currentProcess;if(this.logger.log(`Game Launched`,t),this.logger.log(`Process is elevated: `,e.isElevated),this.logger.log(`Current process is elevated: `,r.isElevated),e.isElevated&&!r.isElevated){O.getInstance().fatal(`Game is elevated but the App is not`,`ELEVATION_MISMATCH`,{appElevated:!!r.isElevated,gameElevated:!!e.isElevated}),this.logger.log(`Game elevated but App is not`,{appElevated:r.isElevated,gameElevated:e.isElevated});return}let{ri_disabled:i,gm_disabled:a}=It(),o=!1;!i&&t.has_render_support&&t.allow_dll_injections?o=await this.injectRenderInterface(e):this.logger.log(`Skipping render interface injection`,{has_render_support:t.has_render_support,allow_dll_injections:t.allow_dll_injections,ri_disabled:i}),!a&&t.allow_dll_injections?await this.injectGameModules(t,e):this.logger.log(`Skipping game module(s) injection`,{allow_dll_injections:t.allow_dll_injections,gm_disabled:a});let s={game:t.identifier,inGameRenderingSupported:o};this._activeReadyRavenGames[t.identifier]=s,this.logger.debug(`Active ready raven games`,Object.keys(this._activeReadyRavenGames).join(`, `)),this.logger.log(`Game Ready`),this.emit(`gameReadyInternal`,{ravenGame:t,process:e}),this.emit(`gameReady`,s),U.getInstance().track(`game_ready`,{game:t.identifier})}copyDll(e){let t=h.basename(e),n=_(e),r=h.join(A(),`resources`),i=h.join(r,t);this.logger.info(`Copying`,n,`to`,i);try{v(r)||re(r,{recursive:!0}),oe(i,ie(n)),te(n,i)}catch(e){return e.code===`EBUSY`?i:(this.logger.error(`Failed to copy`,e),this.logger.error(`Failed to copy`,{originalPath:n,targetPath:i}),!1)}return i}async injectRenderInterface(e){this.logger.log(`Injecting render interface`,{is32Bit:e.is32Bit,process:e});let t=e.is32Bit?Wt:Ut;this.logger.log(`Render hook path`,t);let n=this.copyDll(t);if(!n)return this.logger.error(`Failed to copy render hook DLL`,{renderHookPath:t}),!1;let r=h.join(h.dirname(Gt));if(!v(r))return this.logger.error(`Failed to find injector path`,{injectorPath:r}),!1;this.logger.log(`Resolved injector path`,r);try{return this.logger.log(`Injecting render interface`,n),await e.injectDll(n,r),this.logger.log(`Render Interface Injection Successful`,n),!0}catch(e){return this.logger.error(`Render Interface Injection Failed`,e),this.logger.error(`Render Interface Injection Failed`,{renderHookPathCopied:n}),!1}}async injectGameModules(e,t){let n=h.join(h.dirname(Gt));if(!v(n)){this.logger.error(`Failed to find injector path`,{injectorPath:n});return}this.logger.log(`Resolved injector path`,n);for(let r of e.modules){let e=await z.getInstance().getDllFile(r);if(!e){this.logger.error(`No DLL file found for module`,{moduleId:r});continue}try{this.logger.log(`Injecting game module`,e),await t.injectDll(e,n),this.logger.log(`Injection Successful`,e)}catch(t){this.logger.error(`Injection Failed`,{dllFile:e},t)}}}onProcessDestroy({process:e}){let t=this.getRavenGame(e);t&&(delete this._activeReadyRavenGames[t.identifier],this.logger.debug(`Active ready raven games`,Object.keys(this._activeReadyRavenGames).join(`, `)),this.emit(`gameCloseInternal`,{ravenGame:t,process:e}),this.emit(`gameClose`,{game:t.identifier}),U.getInstance().track(`game_close`,{game:t.identifier}))}getRavenGame(e){if(!e.name)return;let t=B.getInstance().getExecutableData(e.name);if(!t){this.logger.error(`No raven game found for process`,{process:e});return}return t}}),Kt=D(class extends et{boundOnGameLaunch=this.onGameLaunch.bind(this);constructor(){super(`GameBuildManager`)}init(){super.init(),G.getInstance().on(`gameReadyInternal`,this.boundOnGameLaunch)}destroy(){G.getInstance().off(`gameReadyInternal`,this.boundOnGameLaunch),super.destroy()}async onGameLaunch(...e){let[{ravenGame:t,process:n}]=e;if(!n.path||!n.name){this.logger.error(`Process path or name not found, could not check for build hash`,void 0,n);return}let r=ie(n.path),i=ce(`sha256`).update(r).digest(`hex`);this.logger.log(`Process Path`,n.path),this.logger.log(`Process Name`,n.name),this.logger.log(`Build Hash`,i);let a=!1;try{a=(await xt(t.identifier,i)).data.upload}catch(e){this.logger.error(`Error checking game build hash`,e);return}if(!a){this.logger.log(`Build hash already exists, skipping upload`);return}let o=new b;o.file(n.name,r);let s=await o.generateAsync({type:`blob`});try{this.logger.log(`Uploading build (size: `,s.size,` bytes)`);let e=new Me(s,{chunkSizeMb:25,maxConcurrent:1}),n=await St(t.identifier,{build_hash:i,chunk_count:e.totalChunks,file_size_bytes:s.size});await e.chunk(async(e,r)=>{this.logger.log(`Uploading chunk`,r),await Ct(t.identifier,{chunk:e,build_hash:i,chunk_index:r,upload_token:n.data.upload_token})}),this.logger.log(`Build uploaded successfully`)}catch(e){Et(e)?Dt(e.response)?this.logger.error(`Error uploading build hash, api error`,e):this.logger.error(`Error uploading build hash, request error`,e):this.logger.error(`Error uploading build hash, unknown error`,e)}}}),qt=new k({path:p.normalize(`${process.env.APPDATA||process.env.HOME||`.`}/.overlayed/config.json`),default:void 0,schema:n({Account:r({email:`string`,apiKey:`string`})}).type({currentAccount:`Account | undefined`,accounts:`Account[]`}).or(`undefined`)});function K(e,t){return`${e}:${t}`}function Jt(e,t,n){return e.reduce((e,r)=>{let i=r.key;return e[i]={on(e,n){let r=K(i,e),a=t.get(r)??new Set;a.add(n),t.set(r,a)},onAny(e){let n=K(i,`*`),r=t.get(n)??new Set;r.add(e),t.set(n,r)},off(e,n){let r=K(i,e),a=t.get(r);a&&(a.delete(n),a.size===0&&t.delete(r))},offAny(e){let n=K(i,`*`),r=t.get(n);r&&(r.delete(e),r.size===0&&t.delete(n))},readyForGameEvents:()=>{n.emit(`flushEvents`,i)}},e},{})}function Yt(){let e=O.getInstance(),t=G.getInstance();return{on:(n,r)=>{switch(n){case`fatal`:e.on(`fatal`,r);break;case`error`:e.on(`error`,r);break;case`warning`:e.on(`warning`,r);break;case`gameLaunch`:t.on(`gameLaunch`,r);break;case`gameClose`:t.on(`gameClose`,r);break;case`gameReady`:t.on(`gameReady`,r);break;default:throw Error(`Event type not implemented ${n}`,{cause:[n,r]})}},off:(n,r)=>{switch(n){case`fatal`:e.off(`fatal`,r);break;case`error`:e.off(`error`,r);break;case`warning`:e.off(`warning`,r);break;case`gameLaunch`:t.off(`gameLaunch`,r);break;case`gameClose`:t.off(`gameClose`,r);break;case`gameReady`:t.off(`gameReady`,r);break;default:throw Error(`Event type not implemented ${n}`,{cause:[n,r]})}}}}var q=function(e){return e[e.LeftButton=1]=`LeftButton`,e[e.RightButton=2]=`RightButton`,e[e.Cancel=3]=`Cancel`,e[e.MiddleButton=4]=`MiddleButton`,e[e.ExtraButton1=5]=`ExtraButton1`,e[e.ExtraButton2=6]=`ExtraButton2`,e[e.Back=8]=`Back`,e[e.Tab=9]=`Tab`,e[e.Clear=12]=`Clear`,e[e.Return=13]=`Return`,e[e.Shift=16]=`Shift`,e[e.Control=17]=`Control`,e[e.Menu=18]=`Menu`,e[e.Pause=19]=`Pause`,e[e.CapsLock=20]=`CapsLock`,e[e.Kana=21]=`Kana`,e[e.Hangeul=21]=`Hangeul`,e[e.Hangul=21]=`Hangul`,e[e.Junja=23]=`Junja`,e[e.Final=24]=`Final`,e[e.Hanja=25]=`Hanja`,e[e.Kanji=25]=`Kanji`,e[e.Escape=27]=`Escape`,e[e.Convert=28]=`Convert`,e[e.NonConvert=29]=`NonConvert`,e[e.Accept=30]=`Accept`,e[e.ModeChange=31]=`ModeChange`,e[e.Space=32]=`Space`,e[e.Prior=33]=`Prior`,e[e.Next=34]=`Next`,e[e.End=35]=`End`,e[e.Home=36]=`Home`,e[e.Left=37]=`Left`,e[e.Up=38]=`Up`,e[e.Right=39]=`Right`,e[e.Down=40]=`Down`,e[e.Select=41]=`Select`,e[e.Print=42]=`Print`,e[e.Execute=43]=`Execute`,e[e.Snapshot=44]=`Snapshot`,e[e.Insert=45]=`Insert`,e[e.Delete=46]=`Delete`,e[e.Help=47]=`Help`,e[e.N0=48]=`N0`,e[e.N1=49]=`N1`,e[e.N2=50]=`N2`,e[e.N3=51]=`N3`,e[e.N4=52]=`N4`,e[e.N5=53]=`N5`,e[e.N6=54]=`N6`,e[e.N7=55]=`N7`,e[e.N8=56]=`N8`,e[e.N9=57]=`N9`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.LeftWindows=91]=`LeftWindows`,e[e.RightWindows=92]=`RightWindows`,e[e.Application=93]=`Application`,e[e.Sleep=95]=`Sleep`,e[e.Numpad0=96]=`Numpad0`,e[e.Numpad1=97]=`Numpad1`,e[e.Numpad2=98]=`Numpad2`,e[e.Numpad3=99]=`Numpad3`,e[e.Numpad4=100]=`Numpad4`,e[e.Numpad5=101]=`Numpad5`,e[e.Numpad6=102]=`Numpad6`,e[e.Numpad7=103]=`Numpad7`,e[e.Numpad8=104]=`Numpad8`,e[e.Numpad9=105]=`Numpad9`,e[e.Multiply=106]=`Multiply`,e[e.Add=107]=`Add`,e[e.Separator=108]=`Separator`,e[e.Subtract=109]=`Subtract`,e[e.Decimal=110]=`Decimal`,e[e.Divide=111]=`Divide`,e[e.F1=112]=`F1`,e[e.F2=113]=`F2`,e[e.F3=114]=`F3`,e[e.F4=115]=`F4`,e[e.F5=116]=`F5`,e[e.F6=117]=`F6`,e[e.F7=118]=`F7`,e[e.F8=119]=`F8`,e[e.F9=120]=`F9`,e[e.F10=121]=`F10`,e[e.F11=122]=`F11`,e[e.F12=123]=`F12`,e[e.F13=124]=`F13`,e[e.F14=125]=`F14`,e[e.F15=126]=`F15`,e[e.F16=127]=`F16`,e[e.F17=128]=`F17`,e[e.F18=129]=`F18`,e[e.F19=130]=`F19`,e[e.F20=131]=`F20`,e[e.F21=132]=`F21`,e[e.F22=133]=`F22`,e[e.F23=134]=`F23`,e[e.F24=135]=`F24`,e[e.NumLock=144]=`NumLock`,e[e.ScrollLock=145]=`ScrollLock`,e[e.NEC_Equal=146]=`NEC_Equal`,e[e.Fujitsu_Jisho=146]=`Fujitsu_Jisho`,e[e.Fujitsu_Masshou=147]=`Fujitsu_Masshou`,e[e.Fujitsu_Touroku=148]=`Fujitsu_Touroku`,e[e.Fujitsu_Loya=149]=`Fujitsu_Loya`,e[e.Fujitsu_Roya=150]=`Fujitsu_Roya`,e[e.LeftShift=160]=`LeftShift`,e[e.RightShift=161]=`RightShift`,e[e.LeftControl=162]=`LeftControl`,e[e.RightControl=163]=`RightControl`,e[e.LeftMenu=164]=`LeftMenu`,e[e.RightMenu=165]=`RightMenu`,e[e.BrowserBack=166]=`BrowserBack`,e[e.BrowserForward=167]=`BrowserForward`,e[e.BrowserRefresh=168]=`BrowserRefresh`,e[e.BrowserStop=169]=`BrowserStop`,e[e.BrowserSearch=170]=`BrowserSearch`,e[e.BrowserFavorites=171]=`BrowserFavorites`,e[e.BrowserHome=172]=`BrowserHome`,e[e.VolumeMute=173]=`VolumeMute`,e[e.VolumeDown=174]=`VolumeDown`,e[e.VolumeUp=175]=`VolumeUp`,e[e.MediaNextTrack=176]=`MediaNextTrack`,e[e.MediaPrevTrack=177]=`MediaPrevTrack`,e[e.MediaStop=178]=`MediaStop`,e[e.MediaPlayPause=179]=`MediaPlayPause`,e[e.LaunchMail=180]=`LaunchMail`,e[e.LaunchMediaSelect=181]=`LaunchMediaSelect`,e[e.LaunchApplication1=182]=`LaunchApplication1`,e[e.LaunchApplication2=183]=`LaunchApplication2`,e[e.OEM1=186]=`OEM1`,e[e.OEMPlus=187]=`OEMPlus`,e[e.OEMComma=188]=`OEMComma`,e[e.OEMMinus=189]=`OEMMinus`,e[e.OEMPeriod=190]=`OEMPeriod`,e[e.OEM2=191]=`OEM2`,e[e.OEM3=192]=`OEM3`,e[e.OEM4=219]=`OEM4`,e[e.OEM5=220]=`OEM5`,e[e.OEM6=221]=`OEM6`,e[e.OEM7=222]=`OEM7`,e[e.OEM8=223]=`OEM8`,e[e.OEMAX=225]=`OEMAX`,e[e.OEM102=226]=`OEM102`,e[e.ICOHelp=227]=`ICOHelp`,e[e.ICO00=228]=`ICO00`,e[e.ProcessKey=229]=`ProcessKey`,e[e.ICOClear=230]=`ICOClear`,e[e.Packet=231]=`Packet`,e[e.OEMReset=233]=`OEMReset`,e[e.OEMJump=234]=`OEMJump`,e[e.OEMPA1=235]=`OEMPA1`,e[e.OEMPA2=236]=`OEMPA2`,e[e.OEMPA3=237]=`OEMPA3`,e[e.OEMWSCtrl=238]=`OEMWSCtrl`,e[e.OEMCUSel=239]=`OEMCUSel`,e[e.OEMATTN=240]=`OEMATTN`,e[e.OEMFinish=241]=`OEMFinish`,e[e.OEMCopy=242]=`OEMCopy`,e[e.OEMAuto=243]=`OEMAuto`,e[e.OEMENLW=244]=`OEMENLW`,e[e.OEMBackTab=245]=`OEMBackTab`,e[e.ATTN=246]=`ATTN`,e[e.CRSel=247]=`CRSel`,e[e.EXSel=248]=`EXSel`,e[e.EREOF=249]=`EREOF`,e[e.Play=250]=`Play`,e[e.Zoom=251]=`Zoom`,e[e.Noname=252]=`Noname`,e[e.PA1=253]=`PA1`,e[e.OEMClear=254]=`OEMClear`,e}(q||{});const J=new Map([[q.LeftButton,`LeftButton`],[q.RightButton,`RightButton`],[q.Cancel,`Cancel`],[q.MiddleButton,`MiddleButton`],[q.ExtraButton1,`ExtraButton1`],[q.ExtraButton2,`ExtraButton2`],[q.Back,`Backspace`],[q.Tab,`Tab`],[q.Clear,`Clear`],[q.Return,`Enter`],[q.Shift,`ShiftLeft`],[q.Control,`ControlLeft`],[q.Menu,`AltLeft`],[q.Pause,`Pause`],[q.CapsLock,`CapsLock`],[q.Kana,`KanaMode`],[q.Junja,`JunjaMode`],[q.Final,`Finalize`],[q.Hanja,`HanjaMode`],[q.Escape,`Escape`],[q.Convert,`Convert`],[q.NonConvert,`NonConvert`],[q.Accept,`Accept`],[q.ModeChange,`ModeChange`],[q.Space,`Space`],[q.Prior,`PageUp`],[q.Next,`PageDown`],[q.End,`End`],[q.Home,`Home`],[q.Left,`ArrowLeft`],[q.Up,`ArrowUp`],[q.Right,`ArrowRight`],[q.Down,`ArrowDown`],[q.Select,`Select`],[q.Print,`PrintScreen`],[q.Execute,`Execute`],[q.Snapshot,`Snapshot`],[q.Insert,`Insert`],[q.Delete,`Delete`],[q.Help,`Help`],[q.N0,`Digit0`],[q.N1,`Digit1`],[q.N2,`Digit2`],[q.N3,`Digit3`],[q.N4,`Digit4`],[q.N5,`Digit5`],[q.N6,`Digit6`],[q.N7,`Digit7`],[q.N8,`Digit8`],[q.N9,`Digit9`],[q.A,`KeyA`],[q.B,`KeyB`],[q.C,`KeyC`],[q.D,`KeyD`],[q.E,`KeyE`],[q.F,`KeyF`],[q.G,`KeyG`],[q.H,`KeyH`],[q.I,`KeyI`],[q.J,`KeyJ`],[q.K,`KeyK`],[q.L,`KeyL`],[q.M,`KeyM`],[q.N,`KeyN`],[q.O,`KeyO`],[q.P,`KeyP`],[q.Q,`KeyQ`],[q.R,`KeyR`],[q.S,`KeyS`],[q.T,`KeyT`],[q.U,`KeyU`],[q.V,`KeyV`],[q.W,`KeyW`],[q.X,`KeyX`],[q.Y,`KeyY`],[q.Z,`KeyZ`],[q.LeftWindows,`MetaLeft`],[q.RightWindows,`MetaRight`],[q.Application,`ContextMenu`],[q.Sleep,`Sleep`],[q.Numpad0,`Numpad0`],[q.Numpad1,`Numpad1`],[q.Numpad2,`Numpad2`],[q.Numpad3,`Numpad3`],[q.Numpad4,`Numpad4`],[q.Numpad5,`Numpad5`],[q.Numpad6,`Numpad6`],[q.Numpad7,`Numpad7`],[q.Numpad8,`Numpad8`],[q.Numpad9,`Numpad9`],[q.Multiply,`NumpadMultiply`],[q.Add,`NumpadAdd`],[q.Separator,`NumpadSeparator`],[q.Subtract,`NumpadSubtract`],[q.Decimal,`NumpadDecimal`],[q.Divide,`NumpadDivide`],[q.F1,`F1`],[q.F2,`F2`],[q.F3,`F3`],[q.F4,`F4`],[q.F5,`F5`],[q.F6,`F6`],[q.F7,`F7`],[q.F8,`F8`],[q.F9,`F9`],[q.F10,`F10`],[q.F11,`F11`],[q.F12,`F12`],[q.F13,`F13`],[q.F14,`F14`],[q.F15,`F15`],[q.F16,`F16`],[q.F17,`F17`],[q.F18,`F18`],[q.F19,`F19`],[q.F20,`F20`],[q.F21,`F21`],[q.F22,`F22`],[q.F23,`F23`],[q.F24,`F24`],[q.NumLock,`NumLock`],[q.ScrollLock,`ScrollLock`],[q.NEC_Equal,`NEC_Equal`],[q.Fujitsu_Masshou,`Fujitsu_Masshou`],[q.Fujitsu_Touroku,`Fujitsu_Touroku`],[q.Fujitsu_Loya,`Fujitsu_Loya`],[q.Fujitsu_Roya,`Fujitsu_Roya`],[q.LeftShift,`ShiftLeft`],[q.RightShift,`ShiftRight`],[q.LeftControl,`ControlLeft`],[q.RightControl,`ControlRight`],[q.LeftMenu,`AltLeft`],[q.RightMenu,`AltRight`],[q.BrowserBack,`BrowserBack`],[q.BrowserForward,`BrowserForward`],[q.BrowserRefresh,`BrowserRefresh`],[q.BrowserStop,`BrowserStop`],[q.BrowserSearch,`BrowserSearch`],[q.BrowserFavorites,`BrowserFavorites`],[q.BrowserHome,`BrowserHome`],[q.VolumeMute,`VolumeMute`],[q.VolumeDown,`VolumeDown`],[q.VolumeUp,`VolumeUp`],[q.MediaNextTrack,`MediaTrackNext`],[q.MediaPrevTrack,`MediaTrackPrevious`],[q.MediaStop,`MediaStop`],[q.MediaPlayPause,`MediaPlayPause`],[q.LaunchMail,`LaunchMail`],[q.LaunchMediaSelect,`LaunchMediaSelect`],[q.LaunchApplication1,`LaunchApplication1`],[q.LaunchApplication2,`LaunchApplication2`],[q.OEM1,`OEM_1`],[q.OEMPlus,`Equal`],[q.OEMComma,`Comma`],[q.OEMMinus,`Minus`],[q.OEMPeriod,`Period`],[q.OEM2,`Slash`],[q.OEM3,`Backquote`],[q.OEM4,`BracketLeft`],[q.OEM5,`Backslash`],[q.OEM6,`BracketRight`],[q.OEM7,`Quote`],[q.OEM8,`IntlRo`],[q.OEMAX,`OEM_AX`],[q.OEM102,`IntlBackslash`],[q.ICOHelp,`ICO_HELP`],[q.ICO00,`ICO_00`],[q.ProcessKey,`Process`],[q.ICOClear,`ICO_CLEAR`],[q.Packet,`Packet`],[q.OEMReset,`OEM_Reset`],[q.OEMJump,`OEM_Jump`],[q.OEMPA1,`OEM_PA1`],[q.OEMPA2,`OEM_PA2`],[q.OEMPA3,`OEM_PA3`],[q.OEMWSCtrl,`OEM_WS_Ctrl`],[q.OEMCUSel,`OEM_CU_Sel`],[q.OEMATTN,`OEM_ATTN`],[q.OEMFinish,`OEM_Finish`],[q.OEMCopy,`OEM_Copy`],[q.OEMAuto,`OEM_Auto`],[q.OEMENLW,`OEM_ENLW`],[q.OEMBackTab,`BackTab`],[q.ATTN,`ATTN`],[q.CRSel,`CRSel`],[q.EXSel,`EXSel`],[q.EREOF,`EREOF`],[q.Play,`MediaPlay`],[q.Zoom,`Zoom`],[q.Noname,`Noname`],[q.PA1,`PA1`],[q.OEMClear,`OEM_Clear`]]),Xt=new Map(J.entries().map(([e,t])=>[t,e])),Zt=r({"[string]":{keys:`string[]`,mode:r(`'toggle' | 'hold'`).pipe(e=>e??`toggle`)}});var Qt=class extends P{preferencesKeybindToCallbacks=new Map;pressedKeys=new Set;activeKeybinds=new Set;triggeredToggleKeybinds=new Set;boundHandleKeyboardFocus=this.handleKeyboardFocus.bind(this);boundHandleKeyDown=this.handleKeyDown.bind(this);boundHandleKeyUp=this.handleKeyUp.bind(this);keybindsFile;keybindListeningPaused=!1;constructor(e){super(`KeybindManager`),this.keybindsFile=new k({path:Pt([`keybinds.json`]),schema:Zt,default:e})}init(){super.init();let e=H.getInstance().getInterface(`OGG_SIEGE`);e.instance.on(`keyboardFocus`,this.boundHandleKeyboardFocus),e.instance.on(`keyDown`,this.boundHandleKeyDown),e.instance.on(`keyUp`,this.boundHandleKeyUp)}async onKeybindToggled(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.toggle.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async onKeybindDown(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.down.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async onKeybindUp(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.up.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async updateKeybind(e,t){this.keybindsFile.set({[e]:t})}async updateKeybinds(e){let t=Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0));this.keybindsFile.set({...this.keybindsFile.get(),...t})}getConfig(){return this.keybindsFile.get()}destroy(){let e=H.getInstance().getInterface(`OGG_SIEGE`);e.instance.off(`keyboardFocus`,this.boundHandleKeyboardFocus),e.instance.off(`keyDown`,this.boundHandleKeyDown),e.instance.off(`keyUp`,this.boundHandleKeyUp),super.destroy()}handleKeyDown(e){if(this.keybindListeningPaused)return;let t=J.get(e.key);if(!t){this.logger.error(`Unknown key down`,e);return}this.pressedKeys.add(t),this.checkKeybindings()}handleKeyboardFocus(){this.pressedKeys.clear(),this.activeKeybinds.clear(),this.triggeredToggleKeybinds.clear()}async handleKeyUp(e){if(this.keybindListeningPaused)return;let t=J.get(e.key);if(!t)return;this.pressedKeys.delete(t);let n=this.keybindsFile.get();for(let[e]of this.preferencesKeybindToCallbacks.entries())n[e].keys.includes(t)&&this.triggeredToggleKeybinds.delete(e);this.checkKeybindUps()}async checkKeybindUps(){let e=this.keybindsFile.get();for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){if(!n.up||n.up.length===0)continue;let r=e[t];if(this.activeKeybinds.has(t)&&r.keys.some(e=>!this.pressedKeys.has(e))){this.activeKeybinds.delete(t);for(let e of n.up)e();this.logger.log(`Keybind up triggered`,this.getKeybindToString(r))}}}async checkKeybindings(){let e=this.keybindsFile.get();for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){let r=e[t];if(r.keys.length===this.pressedKeys.size&&r.keys.every(e=>Xt.has(e)?this.pressedKeys.has(e):!1)){this.triggerKeybind(r,n,t);return}}for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){let r=e[t];r.keys.every(e=>Xt.has(e)?this.pressedKeys.has(e):(this.logger.error(`Unknown key`,e,r),!1))&&this.triggerKeybind(r,n,t)}}triggerKeybind(e,t,n){let r=e.mode;if(r===`toggle`&&t.toggle&&t.toggle.length>0&&!this.triggeredToggleKeybinds.has(n)){let r;for(let e of t.toggle){let t=e();typeof t==`string`&&r===void 0&&(r=t)}this.triggeredToggleKeybinds.add(n),this.logger.log(r?`Keybind pressed rejected: ${r}`:`Keybind pressed accepted`,this.getKeybindToString(e))}if(r===`hold`&&t.down&&t.down.length>0&&!this.activeKeybinds.has(n)){let r;for(let e of t.down){let t=e();if(typeof t==`string`){r=t;break}}r?this.logger.log(`Keybind down rejected: ${r}`,this.getKeybindToString(e)):(this.activeKeybinds.add(n),this.logger.log(`Keybind down accepted`,this.getKeybindToString(e)))}}getKeybindToString(e){return`(${e.keys.join(`+`)}${e.mode?` ${e.mode}`:``})`}};function $t(e){let t=new Qt(e),n={};for(let r in e)n[r]={on:(e,n)=>{switch(e){case`down`:t.onKeybindDown(r,n);break;case`up`:t.onKeybindUp(r,n);break;case`toggle`:t.onKeybindToggled(r,n);break;default:throw Error(`Event type not implemented ${e}`,{cause:[e,n]})}}};let r={...n,getConfig:()=>t.getConfig(),pauseKeybindListening:()=>{t.keybindListeningPaused=!0},resumeKeybindListening:()=>{t.keybindListeningPaused=!1},updateKeybind:(e,n)=>{t.updateKeybind(e,n)},updateKeybinds:e=>{t.updateKeybinds(e)}};return t.init(),x.on(`quit`,()=>{t.destroy()}),r}function Y(){return H.getInstance().getInterface(`OGG_SIEGE`)}function en(){let e=G.getInstance(),t=O.getInstance(),n=U.getInstance();n.meta=X(),e.on([`gameReady`,`gameClose`],()=>{n.meta||=X(),n.meta.in_game=e.isInGame}),t.on(`fatal`,e=>{n.track(`fatal`,{message:e.message,code:e.code,data:JSON.stringify(e.data)})}),t.on(`error`,e=>{n.track(`error`,{code:e.code,message:e.message,data:JSON.stringify(e.data)})}),t.on(`warning`,e=>{n.track(`warning`,{message:e.message,code:e.code,data:JSON.stringify(e.data)})})}function X(){return{app_id:global.OVERLAYED.APPLICATION_ID,user_id:R(),app_channel:global.OVERLAYED.APP_BUILD_CHANNEL,app_version:global.OVERLAYED.APP_VERSION,package_version:global.OVERLAYED.PACKAGE_VERSION,frontend_version:global.OVERLAYED.FRONTEND_VERSION,session_id:global.OVERLAYED.sessionId,in_game:!1}}function tn(){function e(e,t){return e.once(`closed`,()=>{e.isDestroyed()||U.getInstance().track(`window_closed`,{url:e.webContents.getURL(),in_game:t})}),e.on(`unresponsive`,()=>{e.isDestroyed()||U.getInstance().track(`window_unresponsive`,{url:e.webContents.getURL(),in_game:t})}),U.getInstance().track(`window_created`,{url:e.webContents.getURL(),in_game:t}),e}return{createWindow:t=>e(new global.OVERLAYED.electron.BrowserWindow(t),!1),createInGameWindow:t=>e(Y().instance.newWindowInternal(global.OVERLAYED.electron.BrowserWindow,t),!0),on:(e,t)=>Y().instance.on(e,t),off:(e,t)=>Y().instance.off(e,t),once:(e,t)=>Y().instance.once(e,t),addListener:(e,t)=>Y().instance.addListener(e,t),removeListener:(e,t)=>Y().instance.removeListener(e,t),removeAllListeners:()=>Y().instance.removeAllListeners(),prependListener:(e,t)=>Y().instance.prependListener(e,t),prependOnceListener:(e,t)=>Y().instance.prependOnceListener(e,t),getActiveGameInfo:()=>{let e=Y(),t=M.getInstance();return{resolution:e.resolution,isConnected:t.hasConnection}}}}const nn=D(class extends et{renderInterface;globalCursorOverrideCount=new Set;globalMouseBlockCount=new Set;globalKeyboardBlockCount=new Set;keyInputBlocks={};constructor(e){super(`OverridesManager`),this.renderInterface=H.getInstance().getInterface(e)}scope(e){return{setGlobalCursorOverride:t=>this.setGlobalCursorOverride(e,t),setGlobalMouseBlock:t=>this.setGlobalMouseBlock(e,t),setGlobalKeyboardBlock:t=>this.setGlobalKeyboardBlock(e,t),setKeyInputBlock:(t,n)=>this.setKeyInputBlock(e,t,n)}}setGlobalCursorOverride(e,t){t?this.globalCursorOverrideCount.add(e):this.globalCursorOverrideCount.delete(e),t&&this.globalCursorOverrideCount.size===1?this.renderInterface.instance.setGlobalCursorOverride(!0):!t&&this.globalCursorOverrideCount.size===0&&this.renderInterface.instance.setGlobalCursorOverride(!1)}setGlobalMouseBlock(e,t){t?this.globalMouseBlockCount.add(e):this.globalMouseBlockCount.delete(e),t&&this.globalMouseBlockCount.size===1?this.renderInterface.instance.setGlobalMouseBlock(!0):!t&&this.globalMouseBlockCount.size===0&&this.renderInterface.instance.setGlobalMouseBlock(!1)}setGlobalKeyboardBlock(e,t){t?this.globalKeyboardBlockCount.add(e):this.globalKeyboardBlockCount.delete(e),t&&this.globalKeyboardBlockCount.size===1?this.renderInterface.instance.setGlobalKeyboardBlock(!0):!t&&this.globalKeyboardBlockCount.size===0&&this.renderInterface.instance.setGlobalKeyboardBlock(!1)}setKeyInputBlock(e,t,n){this.keyInputBlocks[t]||(this.keyInputBlocks[t]=new Set),n?this.keyInputBlocks[t].add(e):this.keyInputBlocks[t].delete(e),n&&this.keyInputBlocks[t].size===1?this.renderInterface.instance.setKeyInputBlock(t,!0):!n&&this.keyInputBlocks[t].size===0&&this.renderInterface.instance.setKeyInputBlock(t,!1)}},`OGG_SIEGE`);function rn(){return{scope:e=>nn.getInstance().scope(e),raw:{setGlobalMouseBlock:e=>Y().instance.setGlobalMouseBlock(e),setGlobalKeyboardBlock:e=>Y().instance.setGlobalKeyboardBlock(e),setGlobalCursorOverride:e=>Y().instance.setGlobalCursorOverride(e),setKeyInputBlock:(e,t)=>Y().instance.setKeyInputBlock(e,t),getGlobalMouseBlock:()=>Y().instance.getGlobalMouseBlock(),getGlobalKeyboardBlock:()=>Y().instance.getGlobalKeyboardBlock(),getGlobalCursorOverride:()=>Y().instance.getGlobalCursorOverride(),getKeyInputBlock:e=>Y().instance.getKeyInputBlock(e)}}}function an(){return{track:(e,t)=>{U.getInstance().track(`custom__${String(e)}`,t)}}}var on=C(((e,t)=>{var n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),r=n((e,t)=>{var n=new Set([`mouseDown`,`mouseUp`,`pointerDown`,`pointerUp`]),r=new WeakSet;function i(e,t,{allowHosts:i}={}){let{shell:a}=t;if(r.has(e))return;r.add(e);let o=e.webContents;function s(e){return!!(!c(e)||i?.includes(e.host))}function c(e){return new URL(o.getURL()).origin!==e.origin}let l=0;function u(){l=Date.now()}function d(){let e=Date.now()-l,t=e<150;return t||console.warn(`was not recently active`,e),t}if(process.platform===`win32`)for(let t of Object.values({KEYDOWN:256,LBUTTONUP:514,MBUTTONUP:520,RBUTTONUP:517,XBUTTONUP:524,TOUCH:576}))e.hookWindowMessage(t,u);o.on(`input-event`,(e,t)=>{n.has(t.type)&&u()}),o.on(`will-navigate`,(e,t)=>{let n=e.url||t;if(console.log(`will-navigate`,n),!n)return;let r=new URL(n);if(!s(r)){if(!d()){console.log(`blocked navigation`,n),e.preventDefault();return}c(r)&&(console.log(`external navigation`,n),e.preventDefault(),a.openExternal(n))}}),o.session.on(`will-download`,(e,t)=>{let n=t.getURL();/^blob:/.test(n)||e.preventDefault()}),o.setWindowOpenHandler(e=>{console.log(`window-open`,e.url);let{url:t}=e,n=new URL(t);if(!s(n))return d()?(c(n)&&a.openExternal(e.url),{action:`deny`}):(console.log(`blocked navigation`,t),{action:`deny`})})}t.exports=i}),i=n((e,t)=>{var n=new Set([`Mozilla`,`AppleWebKit`,`Chrome`,`Safari`,`Gecko`,`Firefox`,`OPR`,`Edg`,`Version`,`Mobile`,`curl`,`PostmanRuntime`]);async function r(e,t,r){let{webContents:i}=e,a=await i.executeJavaScript(`navigator.userAgent`);a=a.match(/[^\/]+\/[^\s]+( \([^\)]+\))?/g).map(e=>e.trim()).filter(e=>{let[t]=e.split(`/`,1);return n.has(t)}).join(` `),i.setUserAgent(a),t.app.userAgentFallback=a}t.exports=r}),a=r(),o=i();function s(e,t,n={}){a(e,t,n.linkHandler),o(e,t,n.userAgent)}t.exports={setupRevUtils:s,setupLinkHandler:a,setUserAgent:o}}))();function sn(){return{registerWindow:e=>{(0,on.setupRevUtils)(e,global.OVERLAYED.electron)}}}function cn(e){let t=ke(global.OVERLAYED.APPLICATION_ID),n=Ne(t,{recursive:!0}),r=De(),i=Ne(r,{recursive:!0});j.getInstance().info(`Logs path: `,t),j.getInstance().info(`Overlayed logs path: `,r);let a=new b;return[...n,...i].forEach(([e,t])=>{j.getInstance().info(`Zipping: `,t);let n=ne(t),r=g(t);a.file(r,n,{compression:`DEFLATE`})}),Object.entries(e?.additionalFiles??{}).forEach(([e,t])=>{j.getInstance().info(`Zipping extra file: `,e),a.file(e,t,{compression:`DEFLATE`})}),a}async function ln(e,t,n){let r={...t,category:e,version:`${global.OVERLAYED.APP_VERSION}@${global.OVERLAYED.APP_BUILD_CHANNEL}`,log_zip:`data:application/zip;base64,${n}`},{app_version:i,app_channel:a,user_id:o}=X();try{let e=await fetch(`https://api.stats.cc/v1/overlay/contact`,{method:`POST`,body:JSON.stringify(r),redirect:`follow`,headers:{"Content-Type":`application/json`}});if(!e.ok){j.getInstance().error(`OLD - Failed to submit feedback`,await e.json());return}}catch(e){j.getInstance().error(`OLD - Failed to submit feedback`,e);return}return mt(global.OVERLAYED.APPLICATION_ID,{file:Buffer.from(n,`base64`),data:{app_version:i,app_channel:a,type:e,cortex_user_id:o,...t}}).then(e=>(j.getInstance().info(`Feedback submitted`,e),e.data.id)).catch(e=>{console.error(JSON.stringify(e,null,2)),j.getInstance().error(`Failed to submit feedback`,e)})}function un(e){let t=new je(`app.log`);return t.init(global.OVERLAYED.APPLICATION_ID,e.debug),{scope:e=>t.scope(e),info:e=>t.info(e),warn:e=>t.warn(e),error:e=>t.error(e),debug:e=>t.debug(e),submitFeedback:async(e,t,n)=>(U.getInstance().track(e===`bug_report`?`bug_report_submitted`:`suggestion_submitted`,{version:global.OVERLAYED.APP_VERSION,channel:global.OVERLAYED.APP_BUILD_CHANNEL}),await ln(e,t,await cn(n).generateAsync({type:`base64`})))}}const dn=1e3;function fn(e,t,n,i,a){let o=M.getInstance(),s=j.getInstance().scope(`SetupPipeServer`);s.log(`Initializing`);function c(e,t){let r=n.get(t);if(!r)n.set(t,[e]);else{if(r.length>=dn){O.getInstance().warn(`Event buffer full, removing oldest event`,`EVENT_BUFFER_FULL`,{summary:`Event buffer overflow for module ${t}. Buffer size: ${r.length}, max: ${dn}`});return}r.push(e)}}function l(n){s.info(n);let i=Ft(n);if(i instanceof r.errors){U.getInstance().track(`invalid_game_event`,{}),O.getInstance().warn(`Invalid event`,`INVALID_EVENT`,{summary:i.summary});return}let o=Qe.includes(i.type),l=e.modules.find(e=>e.key===`universal`),u=o?l:e.modules.find(e=>e.key===i.game);if(!u){s.warn(`Invalid module`,{module:o?`universal`:i.game});return}let d=u.events.event,f=d(n);if(f instanceof r.errors){if(`type`in f.byPath)return;s.warn(`Invalid event`,{summary:f.summary}),U.getInstance().track(`invalid_game_event`,{game:i.game,type:i.type,summary:f.summary}),O.getInstance().warn(`Invalid event`,`INVALID_EVENT`,{summary:f.summary});return}if(!a[u.key]){c(f,u.key);return}if(f.type===`unsupported_game_version`){let{content:e}=f;U.getInstance().track(`unsupported_game_version`,{game:f.game,hash:e.process_hash,version:e.game_version})}let p=K(u.key,f.type),m=K(u.key,`*`),h=t.get(p),g=t.get(m),_=[...Array.from(h??[]),...Array.from(g??[])];if(_.length===0){s.info(`No handlers found for event`,{event:f});return}_.forEach(e=>{e(f)})}return i.on(`flushEvents`,e=>{if(a[e])return;a[e]=!0;let t=n.get(e);t&&(j.getInstance().info(`Flushing ${t.length} events for module ${e}`),t.forEach(e=>l(e)),n.delete(e))}),o.on(`data`,e=>e.forEach(l)),o.on(`error`,e=>{s.error(`Pipe server error`,e),O.getInstance().error(`Pipe server error`,`PIPE_SERVER_ERROR`,{error:e})}),o.on(`connected`,()=>{s.log(`Pipe server connected`)}),o.on(`disconnected`,()=>{s.log(`Pipe server disconnected`)}),o}const pn=r({dismissedNotices:ye(r.string).array()}),mn=D(class extends P{NOTICE_FETCH_INTERVAL=1e3*60*5;MAX_DISMISSED_NOTICES=100;_noticeFetchInterval=null;_notices=[];_noticesFile;_boundOnGameReady=this.onGameReady.bind(this);get notices(){let e=this._noticesFile.get().dismissedNotices;return this._notices.filter(t=>!e.includes(t.id))}constructor(){super(`NoticeManager`),this._noticesFile=this.getNoticesFile(),this._noticesFile.load(),this.fetchNotices(),this.setupNoticeInterval(),G.getInstance().on(`gameReady`,this._boundOnGameReady)}destroy(){this._noticeFetchInterval&&=(clearInterval(this._noticeFetchInterval),null),G.getInstance().off(`gameReady`,this._boundOnGameReady),super.destroy()}dismissNotice(e){let t=this._notices.find(t=>t.id===e);if(!t||!t.dismissible)return;let n=this._noticesFile.get().dismissedNotices;n.unshift(e),this._noticesFile.set({dismissedNotices:n.slice(0,this.MAX_DISMISSED_NOTICES)}),this.emitNoticesUpdated()}onGameReady(){this.fetchNotices()}setupNoticeInterval(){this._noticeFetchInterval=setInterval(()=>{this.fetchNotices()},this.NOTICE_FETCH_INTERVAL)}getNoticesFile(){return new k({path:Pt([`notices.json`]),schema:pn,default:{dismissedNotices:[]}})}async fetchNotices(){let e=G.getInstance().getActiveGames();try{let{data:t}=await ht(global.OVERLAYED.APPLICATION_ID,{channel:global.OVERLAYED.APP_BUILD_CHANNEL,version:global.OVERLAYED.APP_VERSION,games:e});this._notices=t,this.emitNoticesUpdated()}catch(e){this.logger.error(`Failed to fetch notices`,e)}}emitNoticesUpdated(){this.emit(`noticesUpdated`,{notices:this.notices})}});function hn(){let e=mn.getInstance();return{on:(t,n)=>{e.on(t,n)},off:(t,n)=>{e.off(t,n)},dismissNotice:t=>{e.dismissNotice(t)},getNotices:()=>e.notices}}let Z=!1,gn={},Q,_n=new E,$;function vn(e){bn(e);let t=yn(e),{init:n=!0,debug:r=!1,silent:i=!0}=t;if(xn(e),j.getInstance().init(e.applicationId,r,i),Z)return Q;function a(){if(Z){j.getInstance().warn(`Overlayed already initialized`);return}en();let e=qt.get()?.currentAccount;e&&ot(()=>e.apiKey);let n=new Map,r=new Map,i=Jt(t.modules,n,_n),o=Yt(),s=$t(t.keybinds),c=tn(),l=rn(),u=sn(),d=an(),f=un(t),p=hn();j.getInstance().log(`Overlayed initialized`),Sn(t),fn(t,n,r,_n,gn),Z=!0,Q={...i,...o,ads:u,keybinds:s,windows:c,input:l,cortex:d,hasAnyActiveProcesses:()=>V.getInstance().hasAnyActiveProcesses,hasAnyActiveGames:()=>G.getInstance().isInGame,init:a,log:f,initialized:Z,notices:p},Q.universal.on(`logged_in`,e=>{U.getInstance().track(`account_id`,{account_id:e.content.account_id,game:e.game})})}return n?(a(),Q):new Proxy({init:a},{get:(e,t)=>{if(t!==`init`&&!Z)throw Error(`overlayed was called before initialized: ${t}`);return t===`init`?e[t]:Q[t]}})}function yn(e){return{...e,modules:[...e.modules,$e()]}}global.OVERLAYED=new Proxy({},{get:()=>{throw Error(`function overlayed was not called`)}});function bn(e){if(!be(e.applicationId))throw Error(`Invalid applicationId, must be a valid ULID.`)}function xn(e){global.OVERLAYED={APPLICATION_ID:ft(e.applicationId),APP_BUILD_CHANNEL:e.channel??`alpha`,APP_VERSION:e.version??`0.0.0`,PACKAGE_VERSION:`0.35.0`,FRONTEND_VERSION:`0.0.0`,sessionId:Lt(),electron:e.electron};function t(){return{package_version:global.OVERLAYED.PACKAGE_VERSION,application_id:global.OVERLAYED.APPLICATION_ID}}j.getInstance().log(`ua object`,t()),st(()=>t())}function Sn(e){let t=e.universal?[`*`]:e.modules.map(e=>e.key);G.getInstance().setSubscribedGames(t),Kt.getInstance().init(),G.getInstance().init(),V.getInstance().init(),B.getInstance().init();async function n(){let e=pt(global.OVERLAYED.APPLICATION_ID).then(e=>e.data),t=R();j.getInstance().log(`userId`,t);let n={...await e,userId:t};return j.getInstance().log(`appInfo`,n),n}let r;global.OVERLAYED.electron.ipcMain.handle(`getAppInfo`,async()=>(r??=n(),r)),U.getInstance().track(`start`,{});try{$&&clearInterval($),$=setInterval(()=>{try{Rt()}catch{}},3e4),$.unref()}catch(e){j.getInstance().log(`failed to start sessionLastUsed interval`,e)}async function i(){let e={};e.os=S.platform().trim(),e.os_version=process.getSystemVersion().trim(),e.architecture=S.arch().trim();let t=S.cpus();t.length>0?(e.cpu=t[0].model.trim(),e.cpu_cores=t.length,e.cpu_speed=t[0].speed):j.getInstance().warn(`Failed to collect CPU info`);let n=await ue.graphics();j.getInstance().info(`GPU info`,n);let r=n.controllers.sort((e,t)=>(t.vram??0)-(e.vram??0))[0];r?(e.gpu=r.model.trim(),e.gpu_memory=r.vram??0):j.getInstance().warn(`Failed to find primary GPU`),e.display_count=n.displays.length;let i=n.displays.find(e=>e.main)??n.displays[0];i?(e.primary_display_resolution_x=i.resolutionX??void 0,e.primary_display_resolution_y=i.resolutionY??void 0,e.primary_display_refresh_rate=i.currentRefreshRate??void 0):j.getInstance().warn(`Failed to find main display`),e.ram=process.getSystemMemoryInfo().total;let a=S.homedir(),o=await le.statfs(a);return o&&`blocks`in o&&`bsize`in o&&`bavail`in o?(e.disk=o.blocks*o.bsize,e.disk_free=o.bavail*o.bsize):j.getInstance().warn(`Failed to collect disk info`),j.getInstance().log(`Retrieved system information`,e),e}x.on(`ready`,()=>{i().then(e=>{U.getInstance().track(`system_info`,e)}).catch(e=>{j.getInstance().log(`Failed to retrieve system information`,e)})}),x.on(`quit`,()=>{U.getInstance().track(`electron_quit`,{}),Cn()}),process.on(`exit`,()=>{U.getInstance().track(`exit`,{}),Cn()})}async function Cn(){try{Rt()}catch{}try{$&&clearInterval($),$=void 0}catch{}await U.getInstance().flush(),B.getInstance().destroy(),G.getInstance().destroy(),Kt.getInstance().destroy(),V.getInstance().destroy(),H.getInstance().getInterface(`OGG_SIEGE`).destroy(),M.getInstance().destroy(),O.getInstance().destroy()}export{We as RenderInterface,Ke as VirtualKey,Ie as defineConfig,vn as overlayed,Vt as setFetchLatestTokenCallback,it as setUpdaterTokenResolver};
|
|
1
|
+
import{createRequire as e}from"node:module";import{Type as t,scope as n,type as r}from"arktype";import i from"mitt";import a,{createWriteStream as o,existsSync as s,mkdirSync as c,readdirSync as l,unlinkSync as u,writeFileSync as d}from"fs";import{ensureFileSync as f}from"fs-extra";import p,{join as m}from"path";import*as h from"node:path";import g,{basename as _,resolve as ee}from"node:path";import v from"picocolors";import te from"events";import*as y from"node:fs";import{copyFileSync as ne,createReadStream as re,existsSync as b,mkdirSync as ie,readFileSync as ae,readdirSync as oe,writeFileSync as se}from"node:fs";import"glob";import"jiti";import ce from"xior";import x from"fs/promises";import S from"jszip";import{createHash as le}from"node:crypto";import{app as C}from"electron";import*as w from"node:os";import*as ue from"node:fs/promises";import de from"systeminformation";var fe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);function pe(e){return e}function T(e){return e?Array.isArray(e)?e:[e]:[]}function me(e){return typeof e==`string`&&/^01[0-9A-HJKMNP-TV-Z]{24}$/.test(e)}var he=class{data=[];constructor(){}get size(){return this.data.length}add(e){this.data.push(e)}next(){return this.data.shift()}clear(){this.data.length=0}*flush(){for(;this.size>0;){let e=this.next();e&&(yield e)}}},E=class{emitter;constructor(){this.emitter=i()}on(e,t){T(e).forEach(e=>{this.emitter.on(e,t)})}off(e,t){T(e).forEach(e=>{this.emitter.off(e,t)})}emit(e,t){T(e).forEach(e=>{this.emitter.emit(e,t)})}removeAllListeners(){this.emitter.all.clear()}},ge=class{listeners;constructor(){this.listeners=new Map}on(e,t){T(e).forEach(e=>{let n=this.listeners.get(e)||new Set;n.add(t),this.listeners.set(e,n)})}off(e,t){T(e).forEach(e=>{let n=this.listeners.get(e);n&&n.delete(t)})}async emit(e,...t){let n=T(e).flatMap(e=>{let t=this.listeners.get(e)||new Set,n=this.listeners.get(`*`)||new Set;return[...Array.from(t),...Array.from(n)]});return n.length===0?[]:await Promise.all(n.map(async n=>{try{let e=n(...t);return e instanceof Promise?await e:e}catch(t){console.error(`Error in event listener for ${String(e)}:`,t);return}}))}removeAllListeners(){this.listeners.clear()}};function D(e,...t){return class extends e{static _instance;static getInstance(){return this._instance||=new e(...t),this._instance}static clearInstance(){this._instance=void 0}}}const O=D(class extends E{destroy(){this.removeAllListeners()}fatal(e,t,n){this.emit(`fatal`,{code:t,message:e,data:n,timestamp:Date.now()})}error(e,t,n){this.emit(`error`,{code:t,message:e,data:n,timestamp:Date.now()})}warn(e,t,n){this.emit(`warning`,{code:t,message:e,data:n,timestamp:Date.now()})}});var k=class{data;_schema;_defaultValue;_path;constructor(e){let{schema:t,default:n,path:r}=e;this._schema=t,this._defaultValue=n,this._path=r}set(e){let t=this._schema[`~standard`].validate(e);if(t instanceof Promise)throw Error(`StructuredConfigFile does not support async validation`);if(t.issues){this.reportInvalidConfigFile(t.issues);return}this.data=this.onBeforeSave(e),this.save(e)}get(){return this.data?this.data:this.load()}getKey(e){return this.get()[e]}save(e){let t=this.onBeforeSave(e);try{f(this.getFilePath()),a.writeFileSync(this.getFilePath(),JSON.stringify(t,void 0,2))}catch{return}return this.data=t}load(){if(!this.fileExists(this.getFilePath())||!this.canReadWriteFile(this.getFilePath())){this.save(this._defaultValue);let e=this.onAfterLoad(this._defaultValue);return this.data=e,e}try{let e=a.readFileSync(this.getFilePath(),`utf8`),t=this.onAfterLoad(this.parseStoredData(e));return this.data=t,t}catch{return this.data=this._defaultValue}}onBeforeSave(e){return e}onAfterLoad(e){return e}getFilePath(){return this._path}parseStoredData(e){try{let t=r(`string.json.parse`).to(`object`)(e);if(t instanceof r.errors)return this._defaultValue;let n=this._schema[`~standard`].validate(t);if(n instanceof Promise)throw Error(`StructuredConfigFile does not support async validation`);return n.issues?this.migrate(t,this._defaultValue):this.migrate(n.value,this._defaultValue)}catch{return this._defaultValue}}canReadWriteFile(e){try{return a.accessSync(e,a.constants.R_OK|a.constants.W_OK),!0}catch{return!1}}fileExists(e){try{return a.accessSync(e,a.constants.F_OK),!0}catch{return!1}}migrate(e,t){let n={...e};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(r in e?e[r]!==null&&t[r]!==null&&typeof e[r]==`object`&&typeof t[r]==`object`&&!Array.isArray(e[r])&&!Array.isArray(t[r])?n[r]=this.migrate(e[r],t[r]):Array.isArray(t[r])&&(n[r]=e[r]):n[r]=t[r]);return n}reportInvalidConfigFile(e){O.getInstance().error(`Invalid config file`,`INVALID_CONFIG_FILE`,{issues:e.map(e=>e.message),filePath:this._path,data:this.data})}};function _e(e,t,n){return typeof e!=`object`||!e?String(e):e instanceof Error?JSON.stringify(e,(e,t)=>{if(t instanceof Error){let e={};for(let n of Object.getOwnPropertyNames(t))e[n]=t[n];return e}return t},n):e instanceof Map?JSON.stringify(Object.fromEntries(e.entries()),t,n):e instanceof Set?JSON.stringify(Array.from(e),t,n):JSON.stringify(e,t,n)}const ve=/\x1b\[[0-9;]*m/g;function ye(e){return e.replace(ve,``)}var be=class e extends E{stream;logPath;baseFileName;currentDate;rotationCheckInterval;isRotating=!1;constructor(e,t){super(),this.logPath=e,this.baseFileName=t.replace(`.log`,``),this.currentDate=this.getDateString(new Date),this.ensureLogDirectory(),this.ensureLogFile(),this.stream=this.createStream(),this.rotationCheckInterval=this.startRotationCheck(),this.cleanupOldLogs()}static scope(t,n){return new e(t,n)}log(...e){this.write(`info`,...e)}error(...e){this.write(`error`,...e)}warn(...e){this.write(`warn`,...e)}info(...e){this.write(`info`,...e)}debug(...e){this.write(`debug`,...e)}async close(){clearInterval(this.rotationCheckInterval),await new Promise(e=>{this.stream.end(()=>e())})}getCurrentFileName(){return this.getFileName(this.currentDate)}static getMessageElements(e,...t){let n=new Date;return{timestamp:n.toISOString().replace(`T`,` `).replace(/\.\d+Z$/,``)+`.${n.getUTCMilliseconds().toString().padStart(3,`0`)}`,level:e,message:t.map(e=>_e(e)).join(` `)}}getFileName(e){return`${this.baseFileName}-${e}.log`}ensureLogDirectory(){try{c(this.logPath,{recursive:!0})}catch(e){throw console.error(`Failed to create log directory ${this.logPath}:`,e),e}}ensureLogFile(){let e=m(this.logPath,this.getFileName(this.currentDate));if(!s(e))try{d(e,``,`utf8`)}catch(t){throw console.error(`Failed to create log file ${e}:`,t),t}}getDateString(e){return`${e.getUTCFullYear()}-${(e.getUTCMonth()+1).toString().padStart(2,`0`)}-${e.getUTCDate().toString().padStart(2,`0`)}`}createStream(){return o(m(this.logPath,this.getFileName(this.currentDate)),{flags:`a`,encoding:`utf8`})}async rotateLogs(){if(this.isRotating)return;this.isRotating=!0;let e=this.getDateString(new Date);e!==this.currentDate&&await new Promise(t=>{this.stream.end(()=>{this.currentDate=e,this.stream=this.createStream(),this.cleanupOldLogs(),t()})}),this.isRotating=!1}startRotationCheck(){return setInterval(()=>this.rotateLogs(),6e4)}cleanupOldLogs(){let e=l(this.logPath),t=new Date,n=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()-7));e.filter(e=>e.startsWith(this.baseFileName)&&e.endsWith(`.log`)).filter(e=>{let[t,r,i]=e.replace(`${this.baseFileName}-`,``).replace(`.log`,``).split(`-`).map(Number);return new Date(Date.UTC(t,r-1,i))<=n}).forEach(e=>{try{u(m(this.logPath,e))}catch(t){console.error(`Failed to delete old log file ${e}:`,t)}})}write(t,...n){let{timestamp:r,message:i}=e.getMessageElements(t,...n),a=`[${r}] [${t}] ${ye(i)}\n`;this.stream.write(a,e=>{e?this.emit(`error`,e):this.emit(`write`,a)})}};const A=()=>g.join(process.env.APPDATA??``,`overlayed`),xe=()=>g.join(A(),`logs`),Se=e=>g.join(A(),`apps`,e),Ce=e=>g.join(Se(e),`logs`),we=()=>g.join(A(),`meta.json`);var Te=class{fileLogger;path;appId;messageQueue=new he;fileName;_debug=!1;silent=!1;constructor(e){this.fileName=e}init(e,t=!1,n=!1){this.appId=e,this._debug=t,this.silent=n,this.path=Ce(e),this.fileLogger=new be(this.path,this.fileName),this.messageQueue.flush().forEach(e=>{this.fileLogger?.[e.type](...e.args)})}scope(e){if(!this.appId||!this.path)throw Error(`Logger not initialized`);let t=v.cyan(`[${e}]`);return{scope:e=>this.scope(e),error:(...e)=>this.error(t,...e),warn:(...e)=>this.warn(t,...e),info:(...e)=>this.info(t,...e),log:(...e)=>this.log(t,...e),debug:(...e)=>this.debug(t,...e)}}error(...e){this.handle(`error`,...e)}warn(...e){this.handle(`warn`,...e)}info(...e){this.handle(`log`,...e)}debug(...e){this._debug&&this.handle(`debug`,...e)}log(...e){this.handle(`log`,...e)}handle(e,...t){this.logToConsole(e,...t),this.fileLogger?this.fileLogger[e](...t):this.messageQueue.add({type:e,args:t})}logToConsole(e,...t){let n={error:v.red,warn:v.yellow,debug:v.blue,log:v.white};if(this.silent&&!this._debug)return;let{timestamp:r,message:i}=be.getMessageElements(e,...t),a=console[e],o=n[e];a(`${v.gray(r)} ${o(i)}`)}};const j=D(Te,`overlayed.log`);var Ee=class extends te{blob;chunkSizeMb;maxConcurrent;shouldStop=!1;constructor(e,t){super(),this.blob=e,this.chunkSizeMb=t.chunkSizeMb,this.maxConcurrent=t.maxConcurrent??3}get totalChunks(){return Math.ceil(this.blob.size/(this.chunkSizeMb*1024*1024))}async chunk(e){let t=this.chunkSizeMb*1024*1024,n=this.totalChunks;if(n===0)return;let r=new Map,i=new Set,a=new Set,o=[];for(let e=0;e<n;e++)o.push(e);let s=async n=>{let s=n*t,c=Math.min(s+t,this.blob.size),l=this.blob.slice(s,c);try{await e(l,n),a.add(n),this.emit(`chunkComplete`,n),i.delete(n)}catch(e){let t=r.get(n)||0;t<5?(r.set(n,t+1),await new Promise(e=>setTimeout(e,(t+1)*1e3)),o.push(n)):(a.add(n),this.emit(`error`,e),this.shouldStop=!0,i.delete(n))}},c=[],l=async()=>{for(;(o.length>0||i.size>0)&&!this.shouldStop;){if(o.length===0){await new Promise(e=>setTimeout(e,10));continue}let e=o.shift();a.has(e)||i.has(e)||(i.add(e),await s(e))}};for(let e=0;e<this.maxConcurrent;e++)c.push(l());await Promise.all(c)}};function De(e,t){let{recursive:n}=Oe(t);return b(e)?n?ke(e).map(t=>[e,t]):oe(e).map(t=>[e,t]):[]}function Oe(e){return{recursive:e?.recursive??!0}}function ke(e){return oe(e,{withFileTypes:!0}).flatMap(t=>{let n=g.join(e,t.name);return t.isDirectory()?ke(n):[n]})}function Ae(e){return je(e),e}function je(e){if(!me(e.applicationId))throw Error(`Invalid applicationId, must be a valid ULID.`)}function Me(e,t){let n=t?.cwd??process.cwd(),r=h.join(n,`.overlayed`);y.existsSync(r)||y.mkdirSync(r,{recursive:!0});let i={application:{id:e.id,name:e.name,slug:e.slug},release:{id:null,channel:`local`,version:`0.0.0`}},a=h.join(r,`meta.json`);return y.writeFileSync(a,JSON.stringify(i,null,2)),i}const{PipeEventServer:Ne,PipeEventClient:Pe,PipeEventBase:Fe,ProcessMonitor:Ie,Process:Le,HardwareInterface:Re}=e(import.meta.url)(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`),M=D(class extends E{server=null;_hasConnection=!1;pipeId;get hasConnection(){return this._hasConnection}constructor(e){super(),this.pipeId=e,this.init()}destroy(){this.server&&=(this._hasConnection=!1,this.server?.removeAllListeners(),null)}init(){this.server=new Ne(this.pipeId,{clientCount:1,access:1}),this.server.on(`event`,e=>{try{let t=JSON.parse(e);this.emit(`data`,[t])}catch(e){this.emit(`error`,e)}}),this.server.on(`connected`,()=>{this._hasConnection=!0,this.emit(`connected`,void 0)}),this.server.on(`disconnected`,()=>{this._hasConnection=!1,this.emit(`disconnected`,void 0)})}},`overlayed-event-server`),{RenderInterface:ze,renderHookPath:Be}=e(import.meta.url)(`@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node`);let Ve=function(e){return e[e.LeftButton=1]=`LeftButton`,e[e.RightButton=2]=`RightButton`,e[e.Cancel=3]=`Cancel`,e[e.MiddleButton=4]=`MiddleButton`,e[e.ExtraButton1=5]=`ExtraButton1`,e[e.ExtraButton2=6]=`ExtraButton2`,e[e.Back=8]=`Back`,e[e.Tab=9]=`Tab`,e[e.Clear=12]=`Clear`,e[e.Return=13]=`Return`,e[e.Shift=16]=`Shift`,e[e.Control=17]=`Control`,e[e.Menu=18]=`Menu`,e[e.Pause=19]=`Pause`,e[e.CapsLock=20]=`CapsLock`,e[e.Kana=21]=`Kana`,e[e.Hangeul=21]=`Hangeul`,e[e.Hangul=21]=`Hangul`,e[e.Junja=23]=`Junja`,e[e.Final=24]=`Final`,e[e.Hanja=25]=`Hanja`,e[e.Kanji=25]=`Kanji`,e[e.Escape=27]=`Escape`,e[e.Convert=28]=`Convert`,e[e.NonConvert=29]=`NonConvert`,e[e.Accept=30]=`Accept`,e[e.ModeChange=31]=`ModeChange`,e[e.Space=32]=`Space`,e[e.Prior=33]=`Prior`,e[e.Next=34]=`Next`,e[e.End=35]=`End`,e[e.Home=36]=`Home`,e[e.Left=37]=`Left`,e[e.Up=38]=`Up`,e[e.Right=39]=`Right`,e[e.Down=40]=`Down`,e[e.Select=41]=`Select`,e[e.Print=42]=`Print`,e[e.Execute=43]=`Execute`,e[e.Snapshot=44]=`Snapshot`,e[e.Insert=45]=`Insert`,e[e.Delete=46]=`Delete`,e[e.Help=47]=`Help`,e[e.N0=48]=`N0`,e[e.N1=49]=`N1`,e[e.N2=50]=`N2`,e[e.N3=51]=`N3`,e[e.N4=52]=`N4`,e[e.N5=53]=`N5`,e[e.N6=54]=`N6`,e[e.N7=55]=`N7`,e[e.N8=56]=`N8`,e[e.N9=57]=`N9`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.LeftWindows=91]=`LeftWindows`,e[e.RightWindows=92]=`RightWindows`,e[e.Application=93]=`Application`,e[e.Sleep=95]=`Sleep`,e[e.Numpad0=96]=`Numpad0`,e[e.Numpad1=97]=`Numpad1`,e[e.Numpad2=98]=`Numpad2`,e[e.Numpad3=99]=`Numpad3`,e[e.Numpad4=100]=`Numpad4`,e[e.Numpad5=101]=`Numpad5`,e[e.Numpad6=102]=`Numpad6`,e[e.Numpad7=103]=`Numpad7`,e[e.Numpad8=104]=`Numpad8`,e[e.Numpad9=105]=`Numpad9`,e[e.Multiply=106]=`Multiply`,e[e.Add=107]=`Add`,e[e.Separator=108]=`Separator`,e[e.Subtract=109]=`Subtract`,e[e.Decimal=110]=`Decimal`,e[e.Divide=111]=`Divide`,e[e.F1=112]=`F1`,e[e.F2=113]=`F2`,e[e.F3=114]=`F3`,e[e.F4=115]=`F4`,e[e.F5=116]=`F5`,e[e.F6=117]=`F6`,e[e.F7=118]=`F7`,e[e.F8=119]=`F8`,e[e.F9=120]=`F9`,e[e.F10=121]=`F10`,e[e.F11=122]=`F11`,e[e.F12=123]=`F12`,e[e.F13=124]=`F13`,e[e.F14=125]=`F14`,e[e.F15=126]=`F15`,e[e.F16=127]=`F16`,e[e.F17=128]=`F17`,e[e.F18=129]=`F18`,e[e.F19=130]=`F19`,e[e.F20=131]=`F20`,e[e.F21=132]=`F21`,e[e.F22=133]=`F22`,e[e.F23=134]=`F23`,e[e.F24=135]=`F24`,e[e.NumLock=144]=`NumLock`,e[e.ScrollLock=145]=`ScrollLock`,e[e.NEC_Equal=146]=`NEC_Equal`,e[e.Fujitsu_Jisho=146]=`Fujitsu_Jisho`,e[e.Fujitsu_Masshou=147]=`Fujitsu_Masshou`,e[e.Fujitsu_Touroku=148]=`Fujitsu_Touroku`,e[e.Fujitsu_Loya=149]=`Fujitsu_Loya`,e[e.Fujitsu_Roya=150]=`Fujitsu_Roya`,e[e.LeftShift=160]=`LeftShift`,e[e.RightShift=161]=`RightShift`,e[e.LeftControl=162]=`LeftControl`,e[e.RightControl=163]=`RightControl`,e[e.LeftMenu=164]=`LeftMenu`,e[e.RightMenu=165]=`RightMenu`,e[e.BrowserBack=166]=`BrowserBack`,e[e.BrowserForward=167]=`BrowserForward`,e[e.BrowserRefresh=168]=`BrowserRefresh`,e[e.BrowserStop=169]=`BrowserStop`,e[e.BrowserSearch=170]=`BrowserSearch`,e[e.BrowserFavorites=171]=`BrowserFavorites`,e[e.BrowserHome=172]=`BrowserHome`,e[e.VolumeMute=173]=`VolumeMute`,e[e.VolumeDown=174]=`VolumeDown`,e[e.VolumeUp=175]=`VolumeUp`,e[e.MediaNextTrack=176]=`MediaNextTrack`,e[e.MediaPrevTrack=177]=`MediaPrevTrack`,e[e.MediaStop=178]=`MediaStop`,e[e.MediaPlayPause=179]=`MediaPlayPause`,e[e.LaunchMail=180]=`LaunchMail`,e[e.LaunchMediaSelect=181]=`LaunchMediaSelect`,e[e.LaunchApplication1=182]=`LaunchApplication1`,e[e.LaunchApplication2=183]=`LaunchApplication2`,e[e.OEM1=186]=`OEM1`,e[e.OEMPlus=187]=`OEMPlus`,e[e.OEMComma=188]=`OEMComma`,e[e.OEMMinus=189]=`OEMMinus`,e[e.OEMPeriod=190]=`OEMPeriod`,e[e.OEM2=191]=`OEM2`,e[e.OEM3=192]=`OEM3`,e[e.OEM4=219]=`OEM4`,e[e.OEM5=220]=`OEM5`,e[e.OEM6=221]=`OEM6`,e[e.OEM7=222]=`OEM7`,e[e.OEM8=223]=`OEM8`,e[e.OEMAX=225]=`OEMAX`,e[e.OEM102=226]=`OEM102`,e[e.ICOHelp=227]=`ICOHelp`,e[e.ICO00=228]=`ICO00`,e[e.ProcessKey=229]=`ProcessKey`,e[e.ICOClear=230]=`ICOClear`,e[e.Packet=231]=`Packet`,e[e.OEMReset=233]=`OEMReset`,e[e.OEMJump=234]=`OEMJump`,e[e.OEMPA1=235]=`OEMPA1`,e[e.OEMPA2=236]=`OEMPA2`,e[e.OEMPA3=237]=`OEMPA3`,e[e.OEMWSCtrl=238]=`OEMWSCtrl`,e[e.OEMCUSel=239]=`OEMCUSel`,e[e.OEMATTN=240]=`OEMATTN`,e[e.OEMFinish=241]=`OEMFinish`,e[e.OEMCopy=242]=`OEMCopy`,e[e.OEMAuto=243]=`OEMAuto`,e[e.OEMENLW=244]=`OEMENLW`,e[e.OEMBackTab=245]=`OEMBackTab`,e[e.ATTN=246]=`ATTN`,e[e.CRSel=247]=`CRSel`,e[e.EXSel=248]=`EXSel`,e[e.EREOF=249]=`EREOF`,e[e.Play=250]=`Play`,e[e.Zoom=251]=`Zoom`,e[e.Noname=252]=`Noname`,e[e.PA1=253]=`PA1`,e[e.OEMClear=254]=`OEMClear`,e}({});const N=r({game:`string`,type:`string`,creation_time:`number`}).and({game:`'siege' | 'tft'`}),He=N.and({type:`'logged_in'`,content:{account_id:`string`}}),Ue=N.and({type:`'module_loaded'`,content:{game_version:`string`,process_hash:`string`}}),We=N.and({type:`'module_unloaded'`}),Ge=N.and({type:`'unsupported_game_version'`,content:{game_version:`string`,process_hash:`string`}}),Ke=n({"#event1":`logged_in | module_loaded | module_unloaded | unsupported_game_version`,event:`event1`,logged_in:He,module_loaded:Ue,module_unloaded:We,unsupported_game_version:Ge}).export(),qe=Object.keys(Ke).filter(e=>e!==`event`);function Je(){return{key:`universal`,events:Ke}}var Ye=class{logger;initialized=!1;constructor(e){this.logger=j.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1}},P=class extends E{logger;initialized=!1;constructor(e){super(),this.logger=j.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1,this.removeAllListeners()}},Xe=class extends ge{logger;initialized=!1;constructor(e){super(),this.logger=j.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1,this.removeAllListeners()}};const Ze=ce.create({baseURL:`https://updater.stats.cc`,headers:{Accept:`application/json`,"Accept-Encoding":`gzip, deflate, br`}});let Qe;function $e(e){Qe=e}Ze.interceptors.request.use(e=>{let t=Qe?.();return t?(e.headers??={},e.headers.Authorization=t,e):e});const F=ce.create({baseURL:`https://api.overlayed.gg`,headers:{Accept:`application/json`,"Accept-Encoding":`gzip, deflate, br`}});let et;function tt(e){et=e}let nt;function rt(e){nt=e}function it(e){return`overlayed/app (${Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`, `)})`}F.interceptors.request.use(e=>{let t=et?.();e.headers??={},t&&(e.headers[`X-Api-Key`]=t);let n=nt?.();return n&&(e.headers[`User-Agent`]=it(n)),e});function at(e,t){if(t<=0)throw Error(`Chunk size must be greater than 0`);if(e.length===0)return[];let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function ot(e){return e}function st(e){return e?t=>(e(t),t):ot}const ct=st();function lt(e){return F.get(`/v1/public/applications/${e}`)}function ut(e,t){let n=new FormData;return n.append(`file`,new Blob([t.file],{type:`application/zip`}),`logs.zip`),n.append(`data`,JSON.stringify(t.data)),F.post(`/v1/public/applications/${e}/feedbacks`,n)}function dt(e,t){return F.get(`/v1/public/applications/${e}/notices`,{params:t})}function ft(e,t){return F.get(`/v1/public/modules/${e}/release`,{params:{cortex_user_id:t}})}function pt(e,t,n){return F.post(`/v1/public/modules/${e}/releases/${t}/download`,n)}async function mt(e,t){if(e.method!==`GET`)throw Error(`Unsupported presigned request method: ${e.method}`);let n=await fetch(e.url,{method:e.method,headers:e.headers,signal:t?.signal});if(!n.ok){let e=await ht(n);throw Error(`Presigned download failed (${n.status} ${n.statusText})${e?`: ${e}`:``}`)}let r=await n.arrayBuffer();return new Uint8Array(r)}async function ht(e){try{let t=(await e.text()).trim();if(t.length===0)return;let n=2048;return t.length>n?`${t.slice(0,n)}…`:t}catch{return}}function gt(){return F.get(`/v1/public/raven/config`)}function _t(e,t){return F.get(`/v1/public/raven/games/${e}/builds/${t}`)}function vt(e,t){return F.post(`/v1/public/raven/games/${e}/builds/upload`,null,{params:t})}function yt(e,t){let n=new FormData;return n.append(`file`,t.chunk),F.patch(`/v1/public/raven/games/${e}/builds/upload`,n,{params:t})}function bt(e){let t=Date.now(),n=at(e.messages.map(e=>xt(t,e)),250),r=Promise.all(n.map(async t=>F.post(`/v1/public/cortex/events`,{...e,messages:t})));return r.catch(e=>{let t=e?.response?.data||e?.message||e;console.error(`Failed to submit cortex events`,t)}),r}function xt(e,t){let n=e-t.created_at.getTime(),r=Math.max(0,Math.floor(n/1e3));return{properties:t.properties,type:t.type,seconds_offset:r}}function St(e){return e instanceof Error&&(e.name===`XiorError`||e.name===`XiorTimeoutError`)}function Ct(e){return!!(e&&`kind`in e.data&&`message`in e.data)}const{PipeEventServer:wt,PipeEventClient:Tt,PipeEventBase:Et,ProcessMonitor:Dt,Process:Ot,HardwareInterface:kt}=e(import.meta.url)(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`);function At(e=[]){return g.normalize(g.join(Se(global.OVERLAYED.APPLICATION_ID),...e))}const jt=r({game:`string`,type:`string`,creation_time:`number`}),I=new k({path:we(),schema:r({userId:`string | undefined`,sessionId:`string | undefined`,sessionLastUsed:`number | undefined`,"debug?":{"ri_disabled?":`boolean`,"gm_disabled?":`boolean`}}),default:{userId:void 0,sessionId:void 0,sessionLastUsed:void 0}});function Mt(){let{debug:e}=I.get();return e?{ri_disabled:e.ri_disabled??!1,gm_disabled:e.gm_disabled??!1}:{ri_disabled:!1,gm_disabled:!1}}function L(){let e=I.get().userId;if(e)return e;let t=Ft();return I.set({...I.get(),userId:t}),t}function Nt(){let e=I.get();if(e.sessionId&&typeof e.sessionLastUsed==`number`&&Date.now()-e.sessionLastUsed<=300*1e3)return e.sessionId;let t=crypto.randomUUID();return I.set({...e,sessionId:t,sessionLastUsed:Date.now()}),t}function Pt(){try{let e=I.get();I.set({...e,sessionLastUsed:Date.now()})}catch(e){j.getInstance().log(`Failed to update sessionLastUsed`,e)}}function Ft(){try{return kt.generateUniqueIdentifier()}catch{return crypto.randomUUID()}}let It;function Lt(e){It=e}const R=D(class extends P{UPDATE_CHECK_INTERVAL_MS=1e3*60*5;targetDir;updateInterval;constructor(){super(`NativeModuleManager`),this.targetDir=g.join(A(),`resources`),this.logger.log(`Target directory`,this.targetDir)}async initWithDlls(e){super.init(),await x.mkdir(this.targetDir,{recursive:!0}),await this.checkForUpdates(e),clearInterval(this.updateInterval),this.updateInterval=setInterval(()=>this.checkForUpdates(e),this.UPDATE_CHECK_INTERVAL_MS)}destroy(){this.updateInterval&&=(clearInterval(this.updateInterval),void 0),super.destroy()}async getDllFile(e){let t=await this.getCurrentBuildInfo(e);if(!t){this.logger.error(`No build found for module`,{moduleId:e});return}let n=this.getBuildPath(e,t.buildId);if(!b(n)){this.logger.error(`No build file found for module`,{moduleId:e});return}let r=g.join(n,t.buildFileName);if(!b(r)){this.logger.error(`No DLL file found for module`,{moduleId:e});return}return r}async getCurrentBuildInfo(e){try{let t=g.join(this.targetDir,e,`build.json`),n=await x.readFile(t,`utf-8`);return JSON.parse(n)}catch{return null}}getModulePath(e){return g.join(this.targetDir,e)}getBuildPath(e,t){return g.join(this.getModulePath(e),t)}async checkForUpdates(e){this.logger.log(`Checking for updates`);let t=L();if(!t){this.logger.error(`Failed to resolve cortex user id`);return}this.logger.log(`Cortex User ID`,t),await It?.();for(let n of e)try{let{data:e}=await ft(n,t);this.logger.log(`Release`,e);let r=(await this.getCurrentBuildInfo(n))?.buildId||null;this.logger.log(`${n} > Performing update check. current: ${r}, requested: ${e.build_id}`),e.build_id!==r||await this.isDownloadCorrupted(this.getBuildPath(n,e.build_id),e)?(this.logger.log(`${n} > Update found. current: ${r}, requested: ${e.build_id}`),this.logger.log(`${n} > Downloading and extracting DLLs`),await this.downloadAndExtractDll(n,e),this.logger.log(`${n} > Cleaning up other builds`),await this.cleanupExistingBuilds(n,e.build_id),this.emit(`dllUpdated`,{moduleId:n,buildId:e.build_id,releaseId:e.release_id})):this.logger.log(`${n} > No update found`)}catch(e){this.logger.error(`${n} > Error checking/updating`,e)}}async downloadAndExtractDll(e,t){this.logger.log(`${e} > Requesting download for build ${t.build_id}`);let n=L();if(!n){this.logger.error(`Failed to resolve cortex user id`);return}let{data:r}=await pt(e,t.release_id,{download_token:t.download_token,cortex_user_id:n});this.logger.log(`${e} > Downloading DLLs for build ${t.build_id}`);let i=await mt(r,{signal:AbortSignal.timeout(1e3*60*5)});this.logger.log(`${e} > Downloaded zip file for build ${t.build_id}`);let a=this.getBuildPath(e,t.build_id);await x.mkdir(a,{recursive:!0});let o=new S;await o.loadAsync(i);let s=Object.keys(o.files).map(e=>({name:e,file:o.files[e]})).filter(({file:e})=>!e.dir);if(s.length!==1){this.logger.error(`${e} > Zip must contain exactly 1 file, got ${s.length}`);return}let c=s[0],l=g.basename(c.name),u=g.normalize(l),d=g.isAbsolute(u),f=u.startsWith(`..`)||u.includes(`..${g.sep}`);if(l===``||l===`.`||l===`..`){this.logger.error(`${e} > Zip contained an invalid file name: ${c.name}`);return}if(!l.toLowerCase().endsWith(`.dll`)){this.logger.error(`${e} > Zip contained a non-dll file: ${c.name}`);return}if(d||f){this.logger.error(`${e} > Zip entry path is unsafe: ${c.name}`);return}let p=g.join(a,u),m=await c.file.async(`nodebuffer`);await x.writeFile(p,m),this.logger.log(`${e} > Extracted 1 file to ${p}`);let h={buildId:t.build_id,buildFileName:t.build_file_name},_=g.join(this.getModulePath(e),`build.json`);await x.writeFile(_,JSON.stringify(h),`utf-8`),this.logger.log(`${e} > Saved buildId to file: ${t.build_id}`)}async cleanupExistingBuilds(e,t){let n=this.getModulePath(e),r=this.getBuildPath(e,t),i=await x.readdir(n,{withFileTypes:!0});for(let t of i)t.isDirectory()&&g.join(n,t.name)!==r&&(await x.rm(g.join(n,t.name),{recursive:!0,force:!0}),this.logger.log(`${e} > Cleaned up build: ${t.name}`))}async hasPathAccess(e){try{return await x.access(e,x.constants.F_OK),!0}catch{return!1}}async isDownloadCorrupted(e,t){if(!await this.hasPathAccess(e))return this.logger.error(`Download is corrupted. Path does not exist: ${e}`),!0;let n=t.build_file_name,r=g.join(e,n);if(!b(r))return this.logger.error(`Download is corrupted. Build file not found: ${r}`),!0;if(t.build_hash){let e=await x.readFile(r),i=le(`sha256`).update(e).digest(`hex`);if(i.toLowerCase()!==t.build_hash.toLowerCase())return this.logger.error(`Download is corrupted. Build file hash mismatch: ${n} ${i.toLowerCase()} !== ${t.build_hash.toLowerCase()}`),!0}return!1}}),z=D(class extends P{REFETCH_INTERVAL=1e3*60*5;FAILED_REFETCH_INTERVAL=1e3*30;_ravenConfig;_executableToGameMap=new Map;_executablesArray=[];_refetchIntervalHandler=null;_failedRefetchTimeoutHandler=null;constructor(){super(`RavenManager`)}init(){super.init(),this.fetchRavenConfig(),this._refetchIntervalHandler=setInterval(()=>{this._failedRefetchTimeoutHandler&&=(clearTimeout(this._failedRefetchTimeoutHandler),null),this.fetchRavenConfig()},this.REFETCH_INTERVAL)}getExecutableData(e){return this._executableToGameMap.get(e.toLowerCase())??null}get executables(){return this._executablesArray}get executablesMap(){return this._executableToGameMap}destroy(){this._refetchIntervalHandler&&clearInterval(this._refetchIntervalHandler),this._failedRefetchTimeoutHandler&&clearTimeout(this._failedRefetchTimeoutHandler),R.getInstance().destroy(),super.destroy()}async fetchRavenConfig(){try{this._ravenConfig={games:(await gt()).data.games},this.resetState();let e=new Set;for(let t of this._ravenConfig.games){for(let e of t.executables){let n=e.toLowerCase();this._executableToGameMap.set(n,t),this._executablesArray.push(n)}t.modules.forEach(t=>e.add(t))}await R.getInstance().initWithDlls(Array.from(e)),this.logger.log(`Raven updated, monitoring ${this._executableToGameMap.size} executables`),this.emit(`executablesUpdated`,{executables:this.executables,map:this._executableToGameMap})}catch(e){this.logger.error(`Failed to fetch Raven config`,e),this._failedRefetchTimeoutHandler=setTimeout(()=>this.fetchRavenConfig(),this.FAILED_REFETCH_INTERVAL)}}resetState(){this._executableToGameMap.clear(),this._executablesArray=[]}}),B=D(class extends P{_processMonitor;_processes=new Map;boundOnRavenManagerExecutablesUpdated=this.onRavenManagerExecutablesUpdated.bind(this);constructor(){super(`ProcessManager`),this._processMonitor=new Dt}get hasAnyActiveProcesses(){return this.activeProcesses.length>0}get activeProcesses(){return Array.from(this._processes.values()).flat().filter(e=>!e.destroyedAt)}init(){super.init(),z.getInstance().on(`executablesUpdated`,this.boundOnRavenManagerExecutablesUpdated),this._processMonitor.on(`create`,e=>{this.logger.log(`Process created`,e),this.addProcess(e),this.logger.log(`Active Process Count: ${this._processes.size}`),this.emit(`create`,{process:e})}),this._processMonitor.on(`destroy`,e=>{this.logger.log(`Process destroyed`,e),this.deleteProcess(e),this.logger.log(`Active Process Count: ${this._processes.size}`),this.emit(`destroy`,{process:e})})}destroy(){z.getInstance().off(`executablesUpdated`,this.boundOnRavenManagerExecutablesUpdated),this._processes.clear(),this._processMonitor.removeAllListeners(),super.destroy()}isProcessRunning(e){return this._processes.get(e)?.some(e=>!e.destroyedAt)??!1}onRavenManagerExecutablesUpdated(e){this.logger.log(`Monitoring ${e.executables.length} processes`),e.executables.forEach(e=>{this._processMonitor.isProcessRegistered(e)||this._processMonitor.registerProcess(e)})}addProcess(e){if(!e.name)return;let t=this._processes.get(e.name);if(!t){this._processes.set(e.name,[e]);return}this._processes.set(e.name,t.concat(e))}deleteProcess(e){if(!e.name)return;let t=this._processes.get(e.name)?.filter(t=>t.id!==e.id)??[];t.length===0?this._processes.delete(e.name):this._processes.set(e.name,t)}});var Rt=class{_instance;_resolution;boundOnResolutionChanged=this.onResolutionChanged.bind(this);constructor(e){this._instance=e,this._resolution={width:0,height:0},this._instance.on(`resolution`,this.boundOnResolutionChanged)}destroy(){this._instance.off(`resolution`,this.boundOnResolutionChanged)}get instance(){return this._instance}get resolution(){return this._resolution}onResolutionChanged(e,t){this._resolution={width:e,height:t}}};const V=D(class{interfaces={};constructor(){}createInterface(e){return this.interfaces[e]||(this.interfaces[e]=new Rt(new ze(e,{access:1}))),this.interfaces[e]}getInterface(e){return this.interfaces[e]?this.interfaces[e]:this.createInterface(e)}}),H=D(class{options;eventQueue;meta=null;constructor(e){this.options=this.resolveOptions(e),this.eventQueue=new he,this.setupFlushInterval()}track(e,t){this.eventQueue.add({type:e,properties:t,created_at:new Date})}flush(){let e=Array.from(this.eventQueue.flush()).concat({type:`ping`,properties:{},created_at:new Date});if(!this.meta)throw Error(`Tried to flush Cortex events before meta was set`);try{bt({...this.meta,messages:e})}catch{}return e}setupFlushInterval(){setInterval(()=>{this.flush()},this.options.batchIntervalSeconds*1e3)}resolveOptions(e){return{batchIntervalSeconds:e?.batchIntervalSeconds??15}}}),U=e(import.meta.url),zt=U.resolve(`@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll`),Bt=U.resolve(`@overlayed/app/dist/render-interface/build/overlayed_render_hook_x86.dll`),Vt=U.resolve(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`),W=D(class extends Xe{boundOnProcessCreate=this.onProcessCreate.bind(this);boundOnProcessDestroy=this.onProcessDestroy.bind(this);subscribedGames=new Set;_activeReadyRavenGames={};get isInGame(){return Object.keys(this._activeReadyRavenGames).length>0}constructor(){super(`GameLaunchManager`)}setSubscribedGames(e){this.subscribedGames=new Set(e)}getActiveGames(){return Object.keys(this._activeReadyRavenGames)}init(){super.init(),V.getInstance().createInterface(`OGG_SIEGE`),B.getInstance().on(`create`,this.boundOnProcessCreate),B.getInstance().on(`destroy`,this.boundOnProcessDestroy)}destroy(){B.getInstance().off(`create`,this.boundOnProcessCreate),B.getInstance().off(`destroy`,this.boundOnProcessDestroy),super.destroy()}on(e,t){super.on(e,t);let n=T(e);if(!(n.includes(`gameReady`)||n.includes(`*`))||Object.keys(this._activeReadyRavenGames).length===0)return;let r=t;for(let e of Object.values(this._activeReadyRavenGames))this.logger.log(`Late calling gameReady callback for game`,e.game),r(e)}async onProcessCreate({process:e}){let t=this.getRavenGame(e);if(!t)return;if(this.subscribedGames.size===0){this.logger.warn(`No subscribed games, skipping`);return}if(H.getInstance().track(`game_launch`,{game:t.identifier}),!this.subscribedGames.has(t.identifier)&&!this.subscribedGames.has(`*`))return;let n=new AbortController;if(await this.emit(`gameLaunch`,{game:t.identifier,reject:()=>n.abort()}),n.signal.aborted)return;let r=Ot.currentProcess;if(this.logger.log(`Game Launched`,t),this.logger.log(`Process is elevated: `,e.isElevated),this.logger.log(`Current process is elevated: `,r.isElevated),e.isElevated&&!r.isElevated){O.getInstance().fatal(`Game is elevated but the App is not`,`ELEVATION_MISMATCH`,{appElevated:!!r.isElevated,gameElevated:!!e.isElevated}),this.logger.log(`Game elevated but App is not`,{appElevated:r.isElevated,gameElevated:e.isElevated});return}let{ri_disabled:i,gm_disabled:a}=Mt(),o=!1;!i&&t.has_render_support&&t.allow_dll_injections?o=await this.injectRenderInterface(e):this.logger.log(`Skipping render interface injection`,{has_render_support:t.has_render_support,allow_dll_injections:t.allow_dll_injections,ri_disabled:i}),!a&&t.allow_dll_injections?await this.injectGameModules(t,e):this.logger.log(`Skipping game module(s) injection`,{allow_dll_injections:t.allow_dll_injections,gm_disabled:a});let s={game:t.identifier,inGameRenderingSupported:o};this._activeReadyRavenGames[t.identifier]=s,this.logger.debug(`Active ready raven games`,Object.keys(this._activeReadyRavenGames).join(`, `)),this.logger.log(`Game Ready`),this.emit(`gameReadyInternal`,{ravenGame:t,process:e}),this.emit(`gameReady`,s),H.getInstance().track(`game_ready`,{game:t.identifier})}copyDll(e){let t=g.basename(e),n=ee(e),r=g.join(A(),`resources`),i=g.join(r,t);this.logger.info(`Copying`,n,`to`,i);try{b(r)||ie(r,{recursive:!0}),se(i,ae(n)),ne(n,i)}catch(e){return e.code===`EBUSY`?i:(this.logger.error(`Failed to copy`,e),this.logger.error(`Failed to copy`,{originalPath:n,targetPath:i}),!1)}return i}async injectRenderInterface(e){this.logger.log(`Injecting render interface`,{is32Bit:e.is32Bit,process:e});let t=e.is32Bit?Bt:zt;this.logger.log(`Render hook path`,t);let n=this.copyDll(t);if(!n)return this.logger.error(`Failed to copy render hook DLL`,{renderHookPath:t}),!1;let r=g.join(g.dirname(Vt));if(!b(r))return this.logger.error(`Failed to find injector path`,{injectorPath:r}),!1;this.logger.log(`Resolved injector path`,r);try{return this.logger.log(`Injecting render interface`,n),await e.injectDll(n,r),this.logger.log(`Render Interface Injection Successful`,n),!0}catch(e){return this.logger.error(`Render Interface Injection Failed`,e),this.logger.error(`Render Interface Injection Failed`,{renderHookPathCopied:n}),!1}}async injectGameModules(e,t){let n=g.join(g.dirname(Vt));if(!b(n)){this.logger.error(`Failed to find injector path`,{injectorPath:n});return}this.logger.log(`Resolved injector path`,n);for(let r of e.modules){let e=await R.getInstance().getDllFile(r);if(!e){this.logger.error(`No DLL file found for module`,{moduleId:r});continue}try{this.logger.log(`Injecting game module`,e),await t.injectDll(e,n),this.logger.log(`Injection Successful`,e)}catch(t){this.logger.error(`Injection Failed`,{dllFile:e},t)}}}onProcessDestroy({process:e}){let t=this.getRavenGame(e);t&&(delete this._activeReadyRavenGames[t.identifier],this.logger.debug(`Active ready raven games`,Object.keys(this._activeReadyRavenGames).join(`, `)),this.emit(`gameCloseInternal`,{ravenGame:t,process:e}),this.emit(`gameClose`,{game:t.identifier}),H.getInstance().track(`game_close`,{game:t.identifier}))}getRavenGame(e){if(!e.name)return;let t=z.getInstance().getExecutableData(e.name);if(!t){this.logger.error(`No raven game found for process`,{process:e});return}return t}}),Ht=D(class extends Ye{boundOnGameLaunch=this.onGameLaunch.bind(this);constructor(){super(`GameBuildManager`)}init(){super.init(),W.getInstance().on(`gameReadyInternal`,this.boundOnGameLaunch)}destroy(){W.getInstance().off(`gameReadyInternal`,this.boundOnGameLaunch),super.destroy()}async onGameLaunch(...e){let[{ravenGame:t,process:n}]=e;if(!n.path||!n.name){this.logger.error(`Process path or name not found, could not check for build hash`,void 0,n);return}let r=ae(n.path),i=le(`sha256`).update(r).digest(`hex`);this.logger.log(`Process Path`,n.path),this.logger.log(`Process Name`,n.name),this.logger.log(`Build Hash`,i);let a=!1;try{a=(await _t(t.identifier,i)).data.upload}catch(e){this.logger.error(`Error checking game build hash`,e);return}if(!a){this.logger.log(`Build hash already exists, skipping upload`);return}let o=new S;o.file(n.name,r);let s=await o.generateAsync({type:`blob`});try{this.logger.log(`Uploading build (size: `,s.size,` bytes)`);let e=new Ee(s,{chunkSizeMb:25,maxConcurrent:1}),n=await vt(t.identifier,{build_hash:i,chunk_count:e.totalChunks,file_size_bytes:s.size});await e.chunk(async(e,r)=>{this.logger.log(`Uploading chunk`,r),await yt(t.identifier,{chunk:e,build_hash:i,chunk_index:r,upload_token:n.data.upload_token})}),this.logger.log(`Build uploaded successfully`)}catch(e){St(e)?Ct(e.response)?this.logger.error(`Error uploading build hash, api error`,e):this.logger.error(`Error uploading build hash, request error`,e):this.logger.error(`Error uploading build hash, unknown error`,e)}}}),Ut=new k({path:p.normalize(`${process.env.APPDATA||process.env.HOME||`.`}/.overlayed/config.json`),default:void 0,schema:n({Account:r({email:`string`,apiKey:`string`})}).type({currentAccount:`Account | undefined`,accounts:`Account[]`}).or(`undefined`)});function G(e,t){return`${e}:${t}`}function Wt(e,t,n){return e.reduce((e,r)=>{let i=r.key;return e[i]={on(e,n){let r=G(i,e),a=t.get(r)??new Set;a.add(n),t.set(r,a)},onAny(e){let n=G(i,`*`),r=t.get(n)??new Set;r.add(e),t.set(n,r)},off(e,n){let r=G(i,e),a=t.get(r);a&&(a.delete(n),a.size===0&&t.delete(r))},offAny(e){let n=G(i,`*`),r=t.get(n);r&&(r.delete(e),r.size===0&&t.delete(n))},readyForGameEvents:()=>{n.emit(`flushEvents`,i)}},e},{})}function Gt(){let e=O.getInstance(),t=W.getInstance();return{on:(n,r)=>{switch(n){case`fatal`:e.on(`fatal`,r);break;case`error`:e.on(`error`,r);break;case`warning`:e.on(`warning`,r);break;case`gameLaunch`:t.on(`gameLaunch`,r);break;case`gameClose`:t.on(`gameClose`,r);break;case`gameReady`:t.on(`gameReady`,r);break;default:throw Error(`Event type not implemented ${n}`,{cause:[n,r]})}},off:(n,r)=>{switch(n){case`fatal`:e.off(`fatal`,r);break;case`error`:e.off(`error`,r);break;case`warning`:e.off(`warning`,r);break;case`gameLaunch`:t.off(`gameLaunch`,r);break;case`gameClose`:t.off(`gameClose`,r);break;case`gameReady`:t.off(`gameReady`,r);break;default:throw Error(`Event type not implemented ${n}`,{cause:[n,r]})}}}}var K=function(e){return e[e.LeftButton=1]=`LeftButton`,e[e.RightButton=2]=`RightButton`,e[e.Cancel=3]=`Cancel`,e[e.MiddleButton=4]=`MiddleButton`,e[e.ExtraButton1=5]=`ExtraButton1`,e[e.ExtraButton2=6]=`ExtraButton2`,e[e.Back=8]=`Back`,e[e.Tab=9]=`Tab`,e[e.Clear=12]=`Clear`,e[e.Return=13]=`Return`,e[e.Shift=16]=`Shift`,e[e.Control=17]=`Control`,e[e.Menu=18]=`Menu`,e[e.Pause=19]=`Pause`,e[e.CapsLock=20]=`CapsLock`,e[e.Kana=21]=`Kana`,e[e.Hangeul=21]=`Hangeul`,e[e.Hangul=21]=`Hangul`,e[e.Junja=23]=`Junja`,e[e.Final=24]=`Final`,e[e.Hanja=25]=`Hanja`,e[e.Kanji=25]=`Kanji`,e[e.Escape=27]=`Escape`,e[e.Convert=28]=`Convert`,e[e.NonConvert=29]=`NonConvert`,e[e.Accept=30]=`Accept`,e[e.ModeChange=31]=`ModeChange`,e[e.Space=32]=`Space`,e[e.Prior=33]=`Prior`,e[e.Next=34]=`Next`,e[e.End=35]=`End`,e[e.Home=36]=`Home`,e[e.Left=37]=`Left`,e[e.Up=38]=`Up`,e[e.Right=39]=`Right`,e[e.Down=40]=`Down`,e[e.Select=41]=`Select`,e[e.Print=42]=`Print`,e[e.Execute=43]=`Execute`,e[e.Snapshot=44]=`Snapshot`,e[e.Insert=45]=`Insert`,e[e.Delete=46]=`Delete`,e[e.Help=47]=`Help`,e[e.N0=48]=`N0`,e[e.N1=49]=`N1`,e[e.N2=50]=`N2`,e[e.N3=51]=`N3`,e[e.N4=52]=`N4`,e[e.N5=53]=`N5`,e[e.N6=54]=`N6`,e[e.N7=55]=`N7`,e[e.N8=56]=`N8`,e[e.N9=57]=`N9`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.LeftWindows=91]=`LeftWindows`,e[e.RightWindows=92]=`RightWindows`,e[e.Application=93]=`Application`,e[e.Sleep=95]=`Sleep`,e[e.Numpad0=96]=`Numpad0`,e[e.Numpad1=97]=`Numpad1`,e[e.Numpad2=98]=`Numpad2`,e[e.Numpad3=99]=`Numpad3`,e[e.Numpad4=100]=`Numpad4`,e[e.Numpad5=101]=`Numpad5`,e[e.Numpad6=102]=`Numpad6`,e[e.Numpad7=103]=`Numpad7`,e[e.Numpad8=104]=`Numpad8`,e[e.Numpad9=105]=`Numpad9`,e[e.Multiply=106]=`Multiply`,e[e.Add=107]=`Add`,e[e.Separator=108]=`Separator`,e[e.Subtract=109]=`Subtract`,e[e.Decimal=110]=`Decimal`,e[e.Divide=111]=`Divide`,e[e.F1=112]=`F1`,e[e.F2=113]=`F2`,e[e.F3=114]=`F3`,e[e.F4=115]=`F4`,e[e.F5=116]=`F5`,e[e.F6=117]=`F6`,e[e.F7=118]=`F7`,e[e.F8=119]=`F8`,e[e.F9=120]=`F9`,e[e.F10=121]=`F10`,e[e.F11=122]=`F11`,e[e.F12=123]=`F12`,e[e.F13=124]=`F13`,e[e.F14=125]=`F14`,e[e.F15=126]=`F15`,e[e.F16=127]=`F16`,e[e.F17=128]=`F17`,e[e.F18=129]=`F18`,e[e.F19=130]=`F19`,e[e.F20=131]=`F20`,e[e.F21=132]=`F21`,e[e.F22=133]=`F22`,e[e.F23=134]=`F23`,e[e.F24=135]=`F24`,e[e.NumLock=144]=`NumLock`,e[e.ScrollLock=145]=`ScrollLock`,e[e.NEC_Equal=146]=`NEC_Equal`,e[e.Fujitsu_Jisho=146]=`Fujitsu_Jisho`,e[e.Fujitsu_Masshou=147]=`Fujitsu_Masshou`,e[e.Fujitsu_Touroku=148]=`Fujitsu_Touroku`,e[e.Fujitsu_Loya=149]=`Fujitsu_Loya`,e[e.Fujitsu_Roya=150]=`Fujitsu_Roya`,e[e.LeftShift=160]=`LeftShift`,e[e.RightShift=161]=`RightShift`,e[e.LeftControl=162]=`LeftControl`,e[e.RightControl=163]=`RightControl`,e[e.LeftMenu=164]=`LeftMenu`,e[e.RightMenu=165]=`RightMenu`,e[e.BrowserBack=166]=`BrowserBack`,e[e.BrowserForward=167]=`BrowserForward`,e[e.BrowserRefresh=168]=`BrowserRefresh`,e[e.BrowserStop=169]=`BrowserStop`,e[e.BrowserSearch=170]=`BrowserSearch`,e[e.BrowserFavorites=171]=`BrowserFavorites`,e[e.BrowserHome=172]=`BrowserHome`,e[e.VolumeMute=173]=`VolumeMute`,e[e.VolumeDown=174]=`VolumeDown`,e[e.VolumeUp=175]=`VolumeUp`,e[e.MediaNextTrack=176]=`MediaNextTrack`,e[e.MediaPrevTrack=177]=`MediaPrevTrack`,e[e.MediaStop=178]=`MediaStop`,e[e.MediaPlayPause=179]=`MediaPlayPause`,e[e.LaunchMail=180]=`LaunchMail`,e[e.LaunchMediaSelect=181]=`LaunchMediaSelect`,e[e.LaunchApplication1=182]=`LaunchApplication1`,e[e.LaunchApplication2=183]=`LaunchApplication2`,e[e.OEM1=186]=`OEM1`,e[e.OEMPlus=187]=`OEMPlus`,e[e.OEMComma=188]=`OEMComma`,e[e.OEMMinus=189]=`OEMMinus`,e[e.OEMPeriod=190]=`OEMPeriod`,e[e.OEM2=191]=`OEM2`,e[e.OEM3=192]=`OEM3`,e[e.OEM4=219]=`OEM4`,e[e.OEM5=220]=`OEM5`,e[e.OEM6=221]=`OEM6`,e[e.OEM7=222]=`OEM7`,e[e.OEM8=223]=`OEM8`,e[e.OEMAX=225]=`OEMAX`,e[e.OEM102=226]=`OEM102`,e[e.ICOHelp=227]=`ICOHelp`,e[e.ICO00=228]=`ICO00`,e[e.ProcessKey=229]=`ProcessKey`,e[e.ICOClear=230]=`ICOClear`,e[e.Packet=231]=`Packet`,e[e.OEMReset=233]=`OEMReset`,e[e.OEMJump=234]=`OEMJump`,e[e.OEMPA1=235]=`OEMPA1`,e[e.OEMPA2=236]=`OEMPA2`,e[e.OEMPA3=237]=`OEMPA3`,e[e.OEMWSCtrl=238]=`OEMWSCtrl`,e[e.OEMCUSel=239]=`OEMCUSel`,e[e.OEMATTN=240]=`OEMATTN`,e[e.OEMFinish=241]=`OEMFinish`,e[e.OEMCopy=242]=`OEMCopy`,e[e.OEMAuto=243]=`OEMAuto`,e[e.OEMENLW=244]=`OEMENLW`,e[e.OEMBackTab=245]=`OEMBackTab`,e[e.ATTN=246]=`ATTN`,e[e.CRSel=247]=`CRSel`,e[e.EXSel=248]=`EXSel`,e[e.EREOF=249]=`EREOF`,e[e.Play=250]=`Play`,e[e.Zoom=251]=`Zoom`,e[e.Noname=252]=`Noname`,e[e.PA1=253]=`PA1`,e[e.OEMClear=254]=`OEMClear`,e}(K||{});const q=new Map([[K.LeftButton,`LeftButton`],[K.RightButton,`RightButton`],[K.Cancel,`Cancel`],[K.MiddleButton,`MiddleButton`],[K.ExtraButton1,`ExtraButton1`],[K.ExtraButton2,`ExtraButton2`],[K.Back,`Backspace`],[K.Tab,`Tab`],[K.Clear,`Clear`],[K.Return,`Enter`],[K.Shift,`ShiftLeft`],[K.Control,`ControlLeft`],[K.Menu,`AltLeft`],[K.Pause,`Pause`],[K.CapsLock,`CapsLock`],[K.Kana,`KanaMode`],[K.Junja,`JunjaMode`],[K.Final,`Finalize`],[K.Hanja,`HanjaMode`],[K.Escape,`Escape`],[K.Convert,`Convert`],[K.NonConvert,`NonConvert`],[K.Accept,`Accept`],[K.ModeChange,`ModeChange`],[K.Space,`Space`],[K.Prior,`PageUp`],[K.Next,`PageDown`],[K.End,`End`],[K.Home,`Home`],[K.Left,`ArrowLeft`],[K.Up,`ArrowUp`],[K.Right,`ArrowRight`],[K.Down,`ArrowDown`],[K.Select,`Select`],[K.Print,`PrintScreen`],[K.Execute,`Execute`],[K.Snapshot,`Snapshot`],[K.Insert,`Insert`],[K.Delete,`Delete`],[K.Help,`Help`],[K.N0,`Digit0`],[K.N1,`Digit1`],[K.N2,`Digit2`],[K.N3,`Digit3`],[K.N4,`Digit4`],[K.N5,`Digit5`],[K.N6,`Digit6`],[K.N7,`Digit7`],[K.N8,`Digit8`],[K.N9,`Digit9`],[K.A,`KeyA`],[K.B,`KeyB`],[K.C,`KeyC`],[K.D,`KeyD`],[K.E,`KeyE`],[K.F,`KeyF`],[K.G,`KeyG`],[K.H,`KeyH`],[K.I,`KeyI`],[K.J,`KeyJ`],[K.K,`KeyK`],[K.L,`KeyL`],[K.M,`KeyM`],[K.N,`KeyN`],[K.O,`KeyO`],[K.P,`KeyP`],[K.Q,`KeyQ`],[K.R,`KeyR`],[K.S,`KeyS`],[K.T,`KeyT`],[K.U,`KeyU`],[K.V,`KeyV`],[K.W,`KeyW`],[K.X,`KeyX`],[K.Y,`KeyY`],[K.Z,`KeyZ`],[K.LeftWindows,`MetaLeft`],[K.RightWindows,`MetaRight`],[K.Application,`ContextMenu`],[K.Sleep,`Sleep`],[K.Numpad0,`Numpad0`],[K.Numpad1,`Numpad1`],[K.Numpad2,`Numpad2`],[K.Numpad3,`Numpad3`],[K.Numpad4,`Numpad4`],[K.Numpad5,`Numpad5`],[K.Numpad6,`Numpad6`],[K.Numpad7,`Numpad7`],[K.Numpad8,`Numpad8`],[K.Numpad9,`Numpad9`],[K.Multiply,`NumpadMultiply`],[K.Add,`NumpadAdd`],[K.Separator,`NumpadSeparator`],[K.Subtract,`NumpadSubtract`],[K.Decimal,`NumpadDecimal`],[K.Divide,`NumpadDivide`],[K.F1,`F1`],[K.F2,`F2`],[K.F3,`F3`],[K.F4,`F4`],[K.F5,`F5`],[K.F6,`F6`],[K.F7,`F7`],[K.F8,`F8`],[K.F9,`F9`],[K.F10,`F10`],[K.F11,`F11`],[K.F12,`F12`],[K.F13,`F13`],[K.F14,`F14`],[K.F15,`F15`],[K.F16,`F16`],[K.F17,`F17`],[K.F18,`F18`],[K.F19,`F19`],[K.F20,`F20`],[K.F21,`F21`],[K.F22,`F22`],[K.F23,`F23`],[K.F24,`F24`],[K.NumLock,`NumLock`],[K.ScrollLock,`ScrollLock`],[K.NEC_Equal,`NEC_Equal`],[K.Fujitsu_Masshou,`Fujitsu_Masshou`],[K.Fujitsu_Touroku,`Fujitsu_Touroku`],[K.Fujitsu_Loya,`Fujitsu_Loya`],[K.Fujitsu_Roya,`Fujitsu_Roya`],[K.LeftShift,`ShiftLeft`],[K.RightShift,`ShiftRight`],[K.LeftControl,`ControlLeft`],[K.RightControl,`ControlRight`],[K.LeftMenu,`AltLeft`],[K.RightMenu,`AltRight`],[K.BrowserBack,`BrowserBack`],[K.BrowserForward,`BrowserForward`],[K.BrowserRefresh,`BrowserRefresh`],[K.BrowserStop,`BrowserStop`],[K.BrowserSearch,`BrowserSearch`],[K.BrowserFavorites,`BrowserFavorites`],[K.BrowserHome,`BrowserHome`],[K.VolumeMute,`VolumeMute`],[K.VolumeDown,`VolumeDown`],[K.VolumeUp,`VolumeUp`],[K.MediaNextTrack,`MediaTrackNext`],[K.MediaPrevTrack,`MediaTrackPrevious`],[K.MediaStop,`MediaStop`],[K.MediaPlayPause,`MediaPlayPause`],[K.LaunchMail,`LaunchMail`],[K.LaunchMediaSelect,`LaunchMediaSelect`],[K.LaunchApplication1,`LaunchApplication1`],[K.LaunchApplication2,`LaunchApplication2`],[K.OEM1,`OEM_1`],[K.OEMPlus,`Equal`],[K.OEMComma,`Comma`],[K.OEMMinus,`Minus`],[K.OEMPeriod,`Period`],[K.OEM2,`Slash`],[K.OEM3,`Backquote`],[K.OEM4,`BracketLeft`],[K.OEM5,`Backslash`],[K.OEM6,`BracketRight`],[K.OEM7,`Quote`],[K.OEM8,`IntlRo`],[K.OEMAX,`OEM_AX`],[K.OEM102,`IntlBackslash`],[K.ICOHelp,`ICO_HELP`],[K.ICO00,`ICO_00`],[K.ProcessKey,`Process`],[K.ICOClear,`ICO_CLEAR`],[K.Packet,`Packet`],[K.OEMReset,`OEM_Reset`],[K.OEMJump,`OEM_Jump`],[K.OEMPA1,`OEM_PA1`],[K.OEMPA2,`OEM_PA2`],[K.OEMPA3,`OEM_PA3`],[K.OEMWSCtrl,`OEM_WS_Ctrl`],[K.OEMCUSel,`OEM_CU_Sel`],[K.OEMATTN,`OEM_ATTN`],[K.OEMFinish,`OEM_Finish`],[K.OEMCopy,`OEM_Copy`],[K.OEMAuto,`OEM_Auto`],[K.OEMENLW,`OEM_ENLW`],[K.OEMBackTab,`BackTab`],[K.ATTN,`ATTN`],[K.CRSel,`CRSel`],[K.EXSel,`EXSel`],[K.EREOF,`EREOF`],[K.Play,`MediaPlay`],[K.Zoom,`Zoom`],[K.Noname,`Noname`],[K.PA1,`PA1`],[K.OEMClear,`OEM_Clear`]]),Kt=new Map(q.entries().map(([e,t])=>[t,e])),qt=r({"[string]":{keys:`string[]`,mode:r(`'toggle' | 'hold'`).pipe(e=>e??`toggle`)}});var Jt=class extends P{preferencesKeybindToCallbacks=new Map;pressedKeys=new Set;activeKeybinds=new Set;triggeredToggleKeybinds=new Set;boundHandleKeyboardFocus=this.handleKeyboardFocus.bind(this);boundHandleKeyDown=this.handleKeyDown.bind(this);boundHandleKeyUp=this.handleKeyUp.bind(this);keybindsFile;keybindListeningPaused=!1;constructor(e){super(`KeybindManager`),this.keybindsFile=new k({path:At([`keybinds.json`]),schema:qt,default:e})}init(){super.init();let e=V.getInstance().getInterface(`OGG_SIEGE`);e.instance.on(`keyboardFocus`,this.boundHandleKeyboardFocus),e.instance.on(`keyDown`,this.boundHandleKeyDown),e.instance.on(`keyUp`,this.boundHandleKeyUp)}async onKeybindToggled(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.toggle.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async onKeybindDown(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.down.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async onKeybindUp(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.up.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async updateKeybind(e,t){this.keybindsFile.set({[e]:t})}async updateKeybinds(e){let t=Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0));this.keybindsFile.set({...this.keybindsFile.get(),...t})}getConfig(){return this.keybindsFile.get()}destroy(){let e=V.getInstance().getInterface(`OGG_SIEGE`);e.instance.off(`keyboardFocus`,this.boundHandleKeyboardFocus),e.instance.off(`keyDown`,this.boundHandleKeyDown),e.instance.off(`keyUp`,this.boundHandleKeyUp),super.destroy()}handleKeyDown(e){if(this.keybindListeningPaused)return;let t=q.get(e.key);if(!t){this.logger.error(`Unknown key down`,e);return}this.pressedKeys.add(t),this.checkKeybindings()}handleKeyboardFocus(){this.pressedKeys.clear(),this.activeKeybinds.clear(),this.triggeredToggleKeybinds.clear()}async handleKeyUp(e){if(this.keybindListeningPaused)return;let t=q.get(e.key);if(!t)return;this.pressedKeys.delete(t);let n=this.keybindsFile.get();for(let[e]of this.preferencesKeybindToCallbacks.entries())n[e].keys.includes(t)&&this.triggeredToggleKeybinds.delete(e);this.checkKeybindUps()}async checkKeybindUps(){let e=this.keybindsFile.get();for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){if(!n.up||n.up.length===0)continue;let r=e[t];if(this.activeKeybinds.has(t)&&r.keys.some(e=>!this.pressedKeys.has(e))){this.activeKeybinds.delete(t);for(let e of n.up)e();this.logger.log(`Keybind up triggered`,this.getKeybindToString(r))}}}async checkKeybindings(){let e=this.keybindsFile.get();for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){let r=e[t];if(r.keys.length===this.pressedKeys.size&&r.keys.every(e=>Kt.has(e)?this.pressedKeys.has(e):!1)){this.triggerKeybind(r,n,t);return}}for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){let r=e[t];r.keys.every(e=>Kt.has(e)?this.pressedKeys.has(e):(this.logger.error(`Unknown key`,e,r),!1))&&this.triggerKeybind(r,n,t)}}triggerKeybind(e,t,n){let r=e.mode;if(r===`toggle`&&t.toggle&&t.toggle.length>0&&!this.triggeredToggleKeybinds.has(n)){let r;for(let e of t.toggle){let t=e();typeof t==`string`&&r===void 0&&(r=t)}this.triggeredToggleKeybinds.add(n),this.logger.log(r?`Keybind pressed rejected: ${r}`:`Keybind pressed accepted`,this.getKeybindToString(e))}if(r===`hold`&&t.down&&t.down.length>0&&!this.activeKeybinds.has(n)){let r;for(let e of t.down){let t=e();if(typeof t==`string`){r=t;break}}r?this.logger.log(`Keybind down rejected: ${r}`,this.getKeybindToString(e)):(this.activeKeybinds.add(n),this.logger.log(`Keybind down accepted`,this.getKeybindToString(e)))}}getKeybindToString(e){return`(${e.keys.join(`+`)}${e.mode?` ${e.mode}`:``})`}};function Yt(e){let t=new Jt(e),n={};for(let r in e)n[r]={on:(e,n)=>{switch(e){case`down`:t.onKeybindDown(r,n);break;case`up`:t.onKeybindUp(r,n);break;case`toggle`:t.onKeybindToggled(r,n);break;default:throw Error(`Event type not implemented ${e}`,{cause:[e,n]})}}};let r={...n,getConfig:()=>t.getConfig(),pauseKeybindListening:()=>{t.keybindListeningPaused=!0},resumeKeybindListening:()=>{t.keybindListeningPaused=!1},updateKeybind:(e,n)=>{t.updateKeybind(e,n)},updateKeybinds:e=>{t.updateKeybinds(e)}};return t.init(),C.on(`quit`,()=>{t.destroy()}),r}function J(){return V.getInstance().getInterface(`OGG_SIEGE`)}function Xt(){let e=W.getInstance(),t=O.getInstance(),n=H.getInstance();n.meta=Y(),e.on([`gameReady`,`gameClose`],()=>{n.meta||=Y(),n.meta.in_game=e.isInGame}),t.on(`fatal`,e=>{n.track(`fatal`,{message:e.message,code:e.code,data:JSON.stringify(e.data)})}),t.on(`error`,e=>{n.track(`error`,{code:e.code,message:e.message,data:JSON.stringify(e.data)})}),t.on(`warning`,e=>{n.track(`warning`,{message:e.message,code:e.code,data:JSON.stringify(e.data)})})}function Y(){return{app_id:global.OVERLAYED.APPLICATION_ID,user_id:L(),app_channel:global.OVERLAYED.APP_BUILD_CHANNEL,app_version:global.OVERLAYED.APP_VERSION,package_version:global.OVERLAYED.PACKAGE_VERSION,frontend_version:global.OVERLAYED.FRONTEND_VERSION,session_id:global.OVERLAYED.sessionId,in_game:!1}}function Zt(){function e(e,t){return e.once(`closed`,()=>{e.isDestroyed()||H.getInstance().track(`window_closed`,{url:e.webContents.getURL(),in_game:t})}),e.on(`unresponsive`,()=>{e.isDestroyed()||H.getInstance().track(`window_unresponsive`,{url:e.webContents.getURL(),in_game:t})}),H.getInstance().track(`window_created`,{url:e.webContents.getURL(),in_game:t}),e}return{createWindow:t=>{let n=global.OVERLAYED_META,r=global.OVERLAYED_RUNTIME,i={...t,webPreferences:{...t.webPreferences,additionalArguments:[...t.webPreferences?.additionalArguments||[],`--overlayed-meta=${JSON.stringify(n)}`,`--overlayed-runtime=${JSON.stringify(r)}`]}};return e(new global.OVERLAYED.electron.BrowserWindow(i),!1)},createInGameWindow:t=>{let n=global.OVERLAYED_META,r=global.OVERLAYED_RUNTIME,i={...t,webPreferences:{...t.webPreferences,additionalArguments:[...t.webPreferences?.additionalArguments||[],`--overlayed-meta=${JSON.stringify(n)}`,`--overlayed-runtime=${JSON.stringify(r)}`]}};return e(J().instance.newWindowInternal(global.OVERLAYED.electron.BrowserWindow,i),!0)},on:(e,t)=>J().instance.on(e,t),off:(e,t)=>J().instance.off(e,t),once:(e,t)=>J().instance.once(e,t),addListener:(e,t)=>J().instance.addListener(e,t),removeListener:(e,t)=>J().instance.removeListener(e,t),removeAllListeners:()=>J().instance.removeAllListeners(),prependListener:(e,t)=>J().instance.prependListener(e,t),prependOnceListener:(e,t)=>J().instance.prependOnceListener(e,t),getActiveGameInfo:()=>{let e=J(),t=M.getInstance();return{resolution:e.resolution,isConnected:t.hasConnection}}}}const Qt=D(class extends Ye{renderInterface;globalCursorOverrideCount=new Set;globalMouseBlockCount=new Set;globalKeyboardBlockCount=new Set;keyInputBlocks={};constructor(e){super(`OverridesManager`),this.renderInterface=V.getInstance().getInterface(e)}scope(e){return{setGlobalCursorOverride:t=>this.setGlobalCursorOverride(e,t),setGlobalMouseBlock:t=>this.setGlobalMouseBlock(e,t),setGlobalKeyboardBlock:t=>this.setGlobalKeyboardBlock(e,t),setKeyInputBlock:(t,n)=>this.setKeyInputBlock(e,t,n)}}setGlobalCursorOverride(e,t){t?this.globalCursorOverrideCount.add(e):this.globalCursorOverrideCount.delete(e),t&&this.globalCursorOverrideCount.size===1?this.renderInterface.instance.setGlobalCursorOverride(!0):!t&&this.globalCursorOverrideCount.size===0&&this.renderInterface.instance.setGlobalCursorOverride(!1)}setGlobalMouseBlock(e,t){t?this.globalMouseBlockCount.add(e):this.globalMouseBlockCount.delete(e),t&&this.globalMouseBlockCount.size===1?this.renderInterface.instance.setGlobalMouseBlock(!0):!t&&this.globalMouseBlockCount.size===0&&this.renderInterface.instance.setGlobalMouseBlock(!1)}setGlobalKeyboardBlock(e,t){t?this.globalKeyboardBlockCount.add(e):this.globalKeyboardBlockCount.delete(e),t&&this.globalKeyboardBlockCount.size===1?this.renderInterface.instance.setGlobalKeyboardBlock(!0):!t&&this.globalKeyboardBlockCount.size===0&&this.renderInterface.instance.setGlobalKeyboardBlock(!1)}setKeyInputBlock(e,t,n){this.keyInputBlocks[t]||(this.keyInputBlocks[t]=new Set),n?this.keyInputBlocks[t].add(e):this.keyInputBlocks[t].delete(e),n&&this.keyInputBlocks[t].size===1?this.renderInterface.instance.setKeyInputBlock(t,!0):!n&&this.keyInputBlocks[t].size===0&&this.renderInterface.instance.setKeyInputBlock(t,!1)}},`OGG_SIEGE`);function $t(){return{scope:e=>Qt.getInstance().scope(e),raw:{setGlobalMouseBlock:e=>J().instance.setGlobalMouseBlock(e),setGlobalKeyboardBlock:e=>J().instance.setGlobalKeyboardBlock(e),setGlobalCursorOverride:e=>J().instance.setGlobalCursorOverride(e),setKeyInputBlock:(e,t)=>J().instance.setKeyInputBlock(e,t),getGlobalMouseBlock:()=>J().instance.getGlobalMouseBlock(),getGlobalKeyboardBlock:()=>J().instance.getGlobalKeyboardBlock(),getGlobalCursorOverride:()=>J().instance.getGlobalCursorOverride(),getKeyInputBlock:e=>J().instance.getKeyInputBlock(e)}}}function en(){return{track:(e,t)=>{H.getInstance().track(`custom__${String(e)}`,t)}}}var tn=fe(((e,t)=>{var n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),r=n((e,t)=>{var n=new Set([`mouseDown`,`mouseUp`,`pointerDown`,`pointerUp`]),r=new WeakSet;function i(e,t,{allowHosts:i}={}){let{shell:a}=t;if(r.has(e))return;r.add(e);let o=e.webContents;function s(e){return!!(!c(e)||i?.includes(e.host))}function c(e){return new URL(o.getURL()).origin!==e.origin}let l=0;function u(){l=Date.now()}function d(){let e=Date.now()-l,t=e<150;return t||console.warn(`was not recently active`,e),t}if(process.platform===`win32`)for(let t of Object.values({KEYDOWN:256,LBUTTONUP:514,MBUTTONUP:520,RBUTTONUP:517,XBUTTONUP:524,TOUCH:576}))e.hookWindowMessage(t,u);o.on(`input-event`,(e,t)=>{n.has(t.type)&&u()}),o.on(`will-navigate`,(e,t)=>{let n=e.url||t;if(console.log(`will-navigate`,n),!n)return;let r=new URL(n);if(!s(r)){if(!d()){console.log(`blocked navigation`,n),e.preventDefault();return}c(r)&&(console.log(`external navigation`,n),e.preventDefault(),a.openExternal(n))}}),o.session.on(`will-download`,(e,t)=>{let n=t.getURL();/^blob:/.test(n)||e.preventDefault()}),o.setWindowOpenHandler(e=>{console.log(`window-open`,e.url);let{url:t}=e,n=new URL(t);if(!s(n))return d()?(c(n)&&a.openExternal(e.url),{action:`deny`}):(console.log(`blocked navigation`,t),{action:`deny`})})}t.exports=i}),i=n((e,t)=>{var n=new Set([`Mozilla`,`AppleWebKit`,`Chrome`,`Safari`,`Gecko`,`Firefox`,`OPR`,`Edg`,`Version`,`Mobile`,`curl`,`PostmanRuntime`]);async function r(e,t,r){let{webContents:i}=e,a=await i.executeJavaScript(`navigator.userAgent`);a=a.match(/[^\/]+\/[^\s]+( \([^\)]+\))?/g).map(e=>e.trim()).filter(e=>{let[t]=e.split(`/`,1);return n.has(t)}).join(` `),i.setUserAgent(a),t.app.userAgentFallback=a}t.exports=r}),a=r(),o=i();function s(e,t,n={}){a(e,t,n.linkHandler),o(e,t,n.userAgent)}t.exports={setupRevUtils:s,setupLinkHandler:a,setUserAgent:o}}))();function nn(){return{registerWindow:e=>{(0,tn.setupRevUtils)(e,global.OVERLAYED.electron)}}}function rn(e){let t=Ce(global.OVERLAYED.APPLICATION_ID),n=De(t,{recursive:!0}),r=xe(),i=De(r,{recursive:!0});j.getInstance().info(`Logs path: `,t),j.getInstance().info(`Overlayed logs path: `,r);let a=new S;return[...n,...i].forEach(([e,t])=>{j.getInstance().info(`Zipping: `,t);let n=re(t),r=_(t);a.file(r,n,{compression:`DEFLATE`})}),Object.entries(e?.additionalFiles??{}).forEach(([e,t])=>{j.getInstance().info(`Zipping extra file: `,e),a.file(e,t,{compression:`DEFLATE`})}),a}async function an(e,t,n){let r={...t,category:e,version:`${global.OVERLAYED.APP_VERSION}@${global.OVERLAYED.APP_BUILD_CHANNEL}`,log_zip:`data:application/zip;base64,${n}`},{app_version:i,app_channel:a,user_id:o}=Y();try{let e=await fetch(`https://api.stats.cc/v1/overlay/contact`,{method:`POST`,body:JSON.stringify(r),redirect:`follow`,headers:{"Content-Type":`application/json`}});if(!e.ok){j.getInstance().error(`OLD - Failed to submit feedback`,await e.json());return}}catch(e){j.getInstance().error(`OLD - Failed to submit feedback`,e);return}return ut(global.OVERLAYED.APPLICATION_ID,{file:Buffer.from(n,`base64`),data:{app_version:i,app_channel:a,type:e,cortex_user_id:o,...t}}).then(e=>(j.getInstance().info(`Feedback submitted`,e),e.data.id)).catch(e=>{console.error(JSON.stringify(e,null,2)),j.getInstance().error(`Failed to submit feedback`,e)})}function on(e){let t=new Te(`app.log`);return t.init(global.OVERLAYED.APPLICATION_ID,e.debug),{scope:e=>t.scope(e),info:e=>t.info(e),warn:e=>t.warn(e),error:e=>t.error(e),debug:e=>t.debug(e),submitFeedback:async(e,t,n)=>(H.getInstance().track(e===`bug_report`?`bug_report_submitted`:`suggestion_submitted`,{version:global.OVERLAYED.APP_VERSION,channel:global.OVERLAYED.APP_BUILD_CHANNEL}),await an(e,t,await rn(n).generateAsync({type:`base64`})))}}const sn=1e3;function cn(e,t,n,i,a){let o=M.getInstance(),s=j.getInstance().scope(`SetupPipeServer`);s.log(`Initializing`);function c(e,t){let r=n.get(t);if(!r)n.set(t,[e]);else{if(r.length>=sn){O.getInstance().warn(`Event buffer full, removing oldest event`,`EVENT_BUFFER_FULL`,{summary:`Event buffer overflow for module ${t}. Buffer size: ${r.length}, max: ${sn}`});return}r.push(e)}}function l(n){s.info(n);let i=jt(n);if(i instanceof r.errors){H.getInstance().track(`invalid_game_event`,{}),O.getInstance().warn(`Invalid event`,`INVALID_EVENT`,{summary:i.summary});return}let o=qe.includes(i.type),l=e.modules.find(e=>e.key===`universal`),u=o?l:e.modules.find(e=>e.key===i.game);if(!u){s.warn(`Invalid module`,{module:o?`universal`:i.game});return}let d=u.events.event,f=d(n);if(f instanceof r.errors){if(`type`in f.byPath)return;s.warn(`Invalid event`,{summary:f.summary}),H.getInstance().track(`invalid_game_event`,{game:i.game,type:i.type,summary:f.summary}),O.getInstance().warn(`Invalid event`,`INVALID_EVENT`,{summary:f.summary});return}if(!a[u.key]){c(f,u.key);return}if(f.type===`unsupported_game_version`){let{content:e}=f;H.getInstance().track(`unsupported_game_version`,{game:f.game,hash:e.process_hash,version:e.game_version})}let p=G(u.key,f.type),m=G(u.key,`*`),h=t.get(p),g=t.get(m),_=[...Array.from(h??[]),...Array.from(g??[])];if(_.length===0){s.info(`No handlers found for event`,{event:f});return}_.forEach(e=>{e(f)})}return i.on(`flushEvents`,e=>{if(a[e])return;a[e]=!0;let t=n.get(e);t&&(j.getInstance().info(`Flushing ${t.length} events for module ${e}`),t.forEach(e=>l(e)),n.delete(e))}),o.on(`data`,e=>e.forEach(l)),o.on(`error`,e=>{s.error(`Pipe server error`,e),O.getInstance().error(`Pipe server error`,`PIPE_SERVER_ERROR`,{error:e})}),o.on(`connected`,()=>{s.log(`Pipe server connected`)}),o.on(`disconnected`,()=>{s.log(`Pipe server disconnected`)}),o}const ln=r({dismissedNotices:pe(r.string).array()}),un=D(class extends P{NOTICE_FETCH_INTERVAL=1e3*60*5;MAX_DISMISSED_NOTICES=100;_noticeFetchInterval=null;_notices=[];_noticesFile;_boundOnGameReady=this.onGameReady.bind(this);get notices(){let e=this._noticesFile.get().dismissedNotices;return this._notices.filter(t=>!e.includes(t.id))}constructor(){super(`NoticeManager`),this._noticesFile=this.getNoticesFile(),this._noticesFile.load(),this.fetchNotices(),this.setupNoticeInterval(),W.getInstance().on(`gameReady`,this._boundOnGameReady)}destroy(){this._noticeFetchInterval&&=(clearInterval(this._noticeFetchInterval),null),W.getInstance().off(`gameReady`,this._boundOnGameReady),super.destroy()}dismissNotice(e){let t=this._notices.find(t=>t.id===e);if(!t||!t.dismissible)return;let n=this._noticesFile.get().dismissedNotices;n.unshift(e),this._noticesFile.set({dismissedNotices:n.slice(0,this.MAX_DISMISSED_NOTICES)}),this.emitNoticesUpdated()}onGameReady(){this.fetchNotices()}setupNoticeInterval(){this._noticeFetchInterval=setInterval(()=>{this.fetchNotices()},this.NOTICE_FETCH_INTERVAL)}getNoticesFile(){return new k({path:At([`notices.json`]),schema:ln,default:{dismissedNotices:[]}})}async fetchNotices(){let e=W.getInstance().getActiveGames();try{let{data:t}=await dt(global.OVERLAYED.APPLICATION_ID,{channel:global.OVERLAYED.APP_BUILD_CHANNEL,version:global.OVERLAYED.APP_VERSION,games:e});this._notices=t,this.emitNoticesUpdated()}catch(e){this.logger.error(`Failed to fetch notices`,e)}}emitNoticesUpdated(){this.emit(`noticesUpdated`,{notices:this.notices})}});function dn(){let e=un.getInstance();return{on:(t,n)=>{e.on(t,n)},off:(t,n)=>{e.off(t,n)},dismissNotice:t=>{e.dismissNotice(t)},getNotices:()=>e.notices}}let X=!1,fn={},Z,Q=new E,$;function pn(e){hn(e);let t=mn(e),{init:n=!0,debug:r=!1,silent:i=!0}=t;if(gn(e),j.getInstance().init(e.applicationId,r,i),yn(global.OVERLAYED.APPLICATION_ID,!1).catch(()=>{}),X)return Z;function a(){if(X){j.getInstance().warn(`Overlayed already initialized`);return}Xt();let e=Ut.get()?.currentAccount;e&&tt(()=>e.apiKey);let n=new Map,r=new Map,i=Wt(t.modules,n,Q),o=Gt(),s=Yt(t.keybinds),c=Zt(),l=$t(),u=nn(),d=en(),f=on(t),p=dn();j.getInstance().log(`Overlayed initialized`),_n(t),cn(t,n,r,Q,fn),X=!0,Z={...i,...o,ads:u,keybinds:s,windows:c,input:l,cortex:d,hasAnyActiveProcesses:()=>B.getInstance().hasAnyActiveProcesses,hasAnyActiveGames:()=>W.getInstance().isInGame,init:a,log:f,initialized:X,notices:p},Z.universal.on(`logged_in`,e=>{H.getInstance().track(`account_id`,{account_id:e.content.account_id,game:e.game})})}return n?(a(),Z):new Proxy({init:a},{get:(e,t)=>{if(t!==`init`&&!X)throw Error(`overlayed was called before initialized: ${t}`);return t===`init`?e[t]:Z[t]}})}function mn(e){return{...e,modules:[...e.modules,Je()]}}global.OVERLAYED=new Proxy({},{get:()=>{throw Error(`function overlayed was not called`)}});function hn(e){if(!me(e.applicationId))throw Error(`Invalid applicationId, must be a valid ULID.`)}function gn(e){global.OVERLAYED={APPLICATION_ID:ct(e.applicationId),APP_BUILD_CHANNEL:e.channel??`alpha`,APP_VERSION:e.version??`0.0.0`,PACKAGE_VERSION:`0.36.0`,FRONTEND_VERSION:`0.0.0`,sessionId:Nt(),electron:e.electron};function t(){return{package_version:global.OVERLAYED.PACKAGE_VERSION,application_id:global.OVERLAYED.APPLICATION_ID}}j.getInstance().log(`ua object`,t()),rt(()=>t());let n=vn();if(n===null){yn(global.OVERLAYED.APPLICATION_ID,!0);return}global.OVERLAYED_META=n,global.OVERLAYED_RUNTIME={userId:L()}}function _n(e){let t=e.universal?[`*`]:e.modules.map(e=>e.key);W.getInstance().setSubscribedGames(t),Ht.getInstance().init(),W.getInstance().init(),B.getInstance().init(),z.getInstance().init(),H.getInstance().track(`start`,{});try{$&&clearInterval($),$=setInterval(()=>{try{Pt()}catch{}},3e4),$.unref()}catch(e){j.getInstance().log(`failed to start sessionLastUsed interval`,e)}async function n(){let e={};e.os=w.platform().trim(),e.os_version=process.getSystemVersion().trim(),e.architecture=w.arch().trim();let t=w.cpus();t.length>0?(e.cpu=t[0].model.trim(),e.cpu_cores=t.length,e.cpu_speed=t[0].speed):j.getInstance().warn(`Failed to collect CPU info`);let n=await de.graphics();j.getInstance().info(`GPU info`,n);let r=n.controllers.sort((e,t)=>(t.vram??0)-(e.vram??0))[0];r?(e.gpu=r.model.trim(),e.gpu_memory=r.vram??0):j.getInstance().warn(`Failed to find primary GPU`),e.display_count=n.displays.length;let i=n.displays.find(e=>e.main)??n.displays[0];i?(e.primary_display_resolution_x=i.resolutionX??void 0,e.primary_display_resolution_y=i.resolutionY??void 0,e.primary_display_refresh_rate=i.currentRefreshRate??void 0):j.getInstance().warn(`Failed to find main display`),e.ram=process.getSystemMemoryInfo().total;let a=w.homedir(),o=await ue.statfs(a);return o&&`blocks`in o&&`bsize`in o&&`bavail`in o?(e.disk=o.blocks*o.bsize,e.disk_free=o.bavail*o.bsize):j.getInstance().warn(`Failed to collect disk info`),j.getInstance().log(`Retrieved system information`,e),e}C.on(`ready`,()=>{n().then(e=>{H.getInstance().track(`system_info`,e)}).catch(e=>{j.getInstance().log(`Failed to retrieve system information`,e)})}),C.on(`quit`,()=>{H.getInstance().track(`electron_quit`,{}),bn()}),process.on(`exit`,()=>{H.getInstance().track(`exit`,{}),bn()})}function vn(){if(C.isPackaged)try{let e=h.join(process.resourcesPath,`meta.json`);return JSON.parse(y.readFileSync(e,`utf-8`))}catch(e){throw Error(`Failed to read application metadata from resources/meta.json`,{cause:e})}else{let e=h.join(process.cwd(),`.overlayed`,`meta.json`);return y.existsSync(e)?JSON.parse(y.readFileSync(e,`utf-8`)):null}}async function yn(e,t=!1){if(!C.isPackaged)try{j.getInstance().log(`Fetching application metadata from API...`);let n=Me((await lt(e)).data);t&&(j.getInstance().log(v.yellowBright(`Uninitialized development environment detected. Created .overlayed folder. In the future, run ${v.bold(`overlayed init`)} to do so. \n\nThe process will now exit to load the cached metadata.\n\n${v.italic(`Note: This will never happen in a packaged application, and will only happen once in local development so long as the .overlayed folder exists.`)}`)),process.exit(0)),global.OVERLAYED_META=n}catch(e){j.getInstance().error(`Failed to fetch application meta`,e),t&&(console.error(`
|
|
2
|
+
Failed to fetch application metadata. Please ensure you're authenticated with 'overlayed login'.
|
|
3
|
+
`),process.exit(1))}}async function bn(){try{Pt()}catch{}try{$&&clearInterval($),$=void 0}catch{}await H.getInstance().flush(),z.getInstance().destroy(),W.getInstance().destroy(),Ht.getInstance().destroy(),B.getInstance().destroy(),V.getInstance().getInterface(`OGG_SIEGE`).destroy(),M.getInstance().destroy(),O.getInstance().destroy()}export{ze as RenderInterface,Ve as VirtualKey,Ae as defineConfig,pn as overlayed,Lt as setFetchLatestTokenCallback,$e as setUpdaterTokenResolver};
|
package/dist/preload.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{contextBridge as e
|
|
1
|
+
import{contextBridge as e}from"electron";const t=process.argv.find(e=>e.startsWith(`--overlayed-meta=`)),n=process.argv.find(e=>e.startsWith(`--overlayed-runtime=`));let r,i;try{r=t?JSON.parse(t.slice(t.indexOf(`=`)+1)):void 0}catch(e){console.error(`[overlayed] Failed to parse meta argument:`,t,e)}try{i=n?JSON.parse(n.slice(n.indexOf(`=`)+1)):void 0}catch(e){console.error(`[overlayed] Failed to parse runtime argument:`,n,e)}r&&e.exposeInMainWorld(`__overlayed`,{meta:r}),i&&e.exposeInMainWorld(`__overlayedRuntime`,i);
|
package/dist/siege.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as arktype0 from "arktype";
|
|
2
2
|
import { Type } from "arktype";
|
|
3
3
|
import * as arktype_internal_variants_string_ts0 from "arktype/internal/variants/string.ts";
|
|
4
4
|
import * as arktype_internal_variants_number_ts0 from "arktype/internal/variants/number.ts";
|
|
5
|
-
import * as
|
|
5
|
+
import * as arktype_internal_variants_object_ts5 from "arktype/internal/variants/object.ts";
|
|
6
6
|
|
|
7
7
|
//#region ../utils/dist/index.d.ts
|
|
8
8
|
|
|
@@ -625,7 +625,7 @@ declare const SIEGE_TIME_OF_DAY_LABELS: Record<SiegeTimeOfDay, string>;
|
|
|
625
625
|
//#region src/module.d.ts
|
|
626
626
|
declare function module(): {
|
|
627
627
|
readonly key: "siege";
|
|
628
|
-
readonly events:
|
|
628
|
+
readonly events: arktype0.Module<{
|
|
629
629
|
event: {
|
|
630
630
|
game: "siege";
|
|
631
631
|
type: "started_queuing";
|
|
@@ -812,7 +812,7 @@ declare function module(): {
|
|
|
812
812
|
life_state: (string & {}) | "downed" | "normal" | "overhealed" | "low_health" | "dead" | "respawning";
|
|
813
813
|
ping: number;
|
|
814
814
|
};
|
|
815
|
-
}) =>
|
|
815
|
+
}) => arktype0.Out<{
|
|
816
816
|
content: {
|
|
817
817
|
starting_side: "attacker" | "defender" | "both" | "invalid" | (string & {});
|
|
818
818
|
player_id: SiegePlayerId;
|
|
@@ -1192,7 +1192,7 @@ declare function module(): {
|
|
|
1192
1192
|
life_state: (string & {}) | "downed" | "normal" | "overhealed" | "low_health" | "dead" | "respawning";
|
|
1193
1193
|
ping: number;
|
|
1194
1194
|
};
|
|
1195
|
-
}) =>
|
|
1195
|
+
}) => arktype0.Out<{
|
|
1196
1196
|
content: {
|
|
1197
1197
|
starting_side: "attacker" | "defender" | "both" | "invalid" | (string & {});
|
|
1198
1198
|
player_id: SiegePlayerId;
|
|
@@ -1399,7 +1399,7 @@ declare function module(): {
|
|
|
1399
1399
|
};
|
|
1400
1400
|
//#endregion
|
|
1401
1401
|
//#region src/utils.d.ts
|
|
1402
|
-
declare const BaseEvent:
|
|
1402
|
+
declare const BaseEvent: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1403
1403
|
game: string;
|
|
1404
1404
|
type: string;
|
|
1405
1405
|
creation_time: number;
|
|
@@ -1426,7 +1426,7 @@ declare const TranslationSchema: <T extends AnyBrand | number = number>() => Typ
|
|
|
1426
1426
|
value: string;
|
|
1427
1427
|
}>;
|
|
1428
1428
|
type Translation<T extends AnyBrand | number = number> = ReturnType<typeof TranslationSchema<T>>["infer"];
|
|
1429
|
-
declare const PlayerMatchStatsDataSchema:
|
|
1429
|
+
declare const PlayerMatchStatsDataSchema: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1430
1430
|
kills: number;
|
|
1431
1431
|
deaths: number;
|
|
1432
1432
|
assists: number;
|
|
@@ -1434,7 +1434,7 @@ declare const PlayerMatchStatsDataSchema: arktype_internal_variants_object_ts0.O
|
|
|
1434
1434
|
score: number;
|
|
1435
1435
|
}, {}>;
|
|
1436
1436
|
type PlayerMatchStatsData = typeof PlayerMatchStatsDataSchema.infer;
|
|
1437
|
-
declare const PlayerDamageDataSchema:
|
|
1437
|
+
declare const PlayerDamageDataSchema: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1438
1438
|
instigator_player_id: SiegePlayerId;
|
|
1439
1439
|
receiver_player_id: SiegePlayerId;
|
|
1440
1440
|
damage_amount: number;
|
|
@@ -1450,7 +1450,7 @@ declare const PlayerDamageDataSchema: arktype_internal_variants_object_ts0.Objec
|
|
|
1450
1450
|
damage_time: number;
|
|
1451
1451
|
}, {}>;
|
|
1452
1452
|
type PlayerDamageData = typeof PlayerDamageDataSchema.infer;
|
|
1453
|
-
declare const MatchRoundDataSchema:
|
|
1453
|
+
declare const MatchRoundDataSchema: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1454
1454
|
index: number;
|
|
1455
1455
|
rounds_until_next_segment: number;
|
|
1456
1456
|
segment_size: number;
|
|
@@ -1465,7 +1465,7 @@ declare const MatchRoundDataSchema: arktype_internal_variants_object_ts0.ObjectT
|
|
|
1465
1465
|
};
|
|
1466
1466
|
}, {}>;
|
|
1467
1467
|
type MatchRoundData = typeof MatchRoundDataSchema.infer;
|
|
1468
|
-
declare const MapDataSchema:
|
|
1468
|
+
declare const MapDataSchema: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1469
1469
|
name: {
|
|
1470
1470
|
id: SiegeMapNameId;
|
|
1471
1471
|
value: string;
|
|
@@ -1476,7 +1476,7 @@ declare const MapDataSchema: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1476
1476
|
};
|
|
1477
1477
|
}, {}>;
|
|
1478
1478
|
type MapData = typeof MapDataSchema.infer;
|
|
1479
|
-
declare const RoundEndPlayerDataSchema:
|
|
1479
|
+
declare const RoundEndPlayerDataSchema: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1480
1480
|
player_id: SiegePlayerId;
|
|
1481
1481
|
final_health: number;
|
|
1482
1482
|
final_life_state: (string & {}) | "downed" | "normal" | "overhealed" | "low_health" | "dead" | "respawning";
|
|
@@ -1486,7 +1486,7 @@ declare const RoundEndPlayerDataSchema: arktype_internal_variants_object_ts0.Obj
|
|
|
1486
1486
|
};
|
|
1487
1487
|
}, {}>;
|
|
1488
1488
|
type RoundEndPlayerData = typeof RoundEndPlayerDataSchema.infer;
|
|
1489
|
-
declare const RoundEndDataSchema:
|
|
1489
|
+
declare const RoundEndDataSchema: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1490
1490
|
round_data: {
|
|
1491
1491
|
index: number;
|
|
1492
1492
|
rounds_until_next_segment: number;
|
|
@@ -1529,7 +1529,7 @@ declare const RoundEndDataSchema: arktype_internal_variants_object_ts0.ObjectTyp
|
|
|
1529
1529
|
type RoundEndData = typeof RoundEndDataSchema.infer;
|
|
1530
1530
|
//#endregion
|
|
1531
1531
|
//#region src/events/matchStarted.d.ts
|
|
1532
|
-
declare const MatchStarted:
|
|
1532
|
+
declare const MatchStarted: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1533
1533
|
game: "siege";
|
|
1534
1534
|
type: "match_started";
|
|
1535
1535
|
creation_time: number;
|
|
@@ -1572,7 +1572,7 @@ declare const MatchStarted: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1572
1572
|
type MatchStartedEvent = typeof MatchStarted.infer;
|
|
1573
1573
|
//#endregion
|
|
1574
1574
|
//#region src/events/startedQueuing.d.ts
|
|
1575
|
-
declare const StartedQueuing:
|
|
1575
|
+
declare const StartedQueuing: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1576
1576
|
game: "siege";
|
|
1577
1577
|
type: "started_queuing";
|
|
1578
1578
|
creation_time: number;
|
|
@@ -1588,7 +1588,7 @@ declare const StartedQueuing: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1588
1588
|
type StartedQueuingEvent = typeof StartedQueuing.infer;
|
|
1589
1589
|
//#endregion
|
|
1590
1590
|
//#region src/events/stoppedQueueing.d.ts
|
|
1591
|
-
declare const StoppedQueueing:
|
|
1591
|
+
declare const StoppedQueueing: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1592
1592
|
game: "siege";
|
|
1593
1593
|
type: "stopped_queuing";
|
|
1594
1594
|
creation_time: number;
|
|
@@ -1596,7 +1596,7 @@ declare const StoppedQueueing: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1596
1596
|
type StoppedQueueingEvent = typeof StoppedQueueing.infer;
|
|
1597
1597
|
//#endregion
|
|
1598
1598
|
//#region src/events/matchEnded.d.ts
|
|
1599
|
-
declare const MatchEnded:
|
|
1599
|
+
declare const MatchEnded: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1600
1600
|
game: "siege";
|
|
1601
1601
|
type: "match_ended";
|
|
1602
1602
|
creation_time: number;
|
|
@@ -1604,7 +1604,7 @@ declare const MatchEnded: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1604
1604
|
type MatchEndedEvent = typeof MatchEnded.infer;
|
|
1605
1605
|
//#endregion
|
|
1606
1606
|
//#region src/events/mapChanged.d.ts
|
|
1607
|
-
declare const MapChanged:
|
|
1607
|
+
declare const MapChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1608
1608
|
game: "siege";
|
|
1609
1609
|
type: "map_changed";
|
|
1610
1610
|
creation_time: number;
|
|
@@ -1624,7 +1624,7 @@ declare const MapChanged: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1624
1624
|
type MapChangedEvent = typeof MapChanged.infer;
|
|
1625
1625
|
//#endregion
|
|
1626
1626
|
//#region src/events/operatorBanVotingStarted.d.ts
|
|
1627
|
-
declare const OperatorBanVotingStarted:
|
|
1627
|
+
declare const OperatorBanVotingStarted: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1628
1628
|
game: "siege";
|
|
1629
1629
|
type: "operator_ban_voting_started";
|
|
1630
1630
|
creation_time: number;
|
|
@@ -1637,7 +1637,7 @@ declare const OperatorBanVotingStarted: arktype_internal_variants_object_ts0.Obj
|
|
|
1637
1637
|
type OperatorBanVotingStartedEvent = typeof OperatorBanVotingStarted.infer;
|
|
1638
1638
|
//#endregion
|
|
1639
1639
|
//#region src/events/operatorBanned.d.ts
|
|
1640
|
-
declare const OperatorBanned:
|
|
1640
|
+
declare const OperatorBanned: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1641
1641
|
game: "siege";
|
|
1642
1642
|
type: "operator_banned";
|
|
1643
1643
|
creation_time: number;
|
|
@@ -1654,7 +1654,7 @@ declare const OperatorBanned: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1654
1654
|
type OperatorBannedEvent = typeof OperatorBanned.infer;
|
|
1655
1655
|
//#endregion
|
|
1656
1656
|
//#region src/events/operatorBanCleared.d.ts
|
|
1657
|
-
declare const OperatorBanCleared:
|
|
1657
|
+
declare const OperatorBanCleared: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1658
1658
|
game: "siege";
|
|
1659
1659
|
type: "operator_ban_cleared";
|
|
1660
1660
|
creation_time: number;
|
|
@@ -1666,7 +1666,7 @@ declare const OperatorBanCleared: arktype_internal_variants_object_ts0.ObjectTyp
|
|
|
1666
1666
|
type OperatorBanClearedEvent = typeof OperatorBanCleared.infer;
|
|
1667
1667
|
//#endregion
|
|
1668
1668
|
//#region src/events/roundEnded.d.ts
|
|
1669
|
-
declare const RoundEnded:
|
|
1669
|
+
declare const RoundEnded: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1670
1670
|
game: "siege";
|
|
1671
1671
|
type: "round_ended";
|
|
1672
1672
|
creation_time: number;
|
|
@@ -1714,7 +1714,7 @@ declare const RoundEnded: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1714
1714
|
type RoundEndedEvent = typeof RoundEnded.infer;
|
|
1715
1715
|
//#endregion
|
|
1716
1716
|
//#region src/events/phaseChanged.d.ts
|
|
1717
|
-
declare const PhaseChanged:
|
|
1717
|
+
declare const PhaseChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1718
1718
|
game: "siege";
|
|
1719
1719
|
type: "phase_changed";
|
|
1720
1720
|
creation_time: number;
|
|
@@ -1725,7 +1725,7 @@ declare const PhaseChanged: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1725
1725
|
type PhaseChangedEvent = typeof PhaseChanged.infer;
|
|
1726
1726
|
//#endregion
|
|
1727
1727
|
//#region src/events/playerJoined.d.ts
|
|
1728
|
-
declare const PlayerJoined:
|
|
1728
|
+
declare const PlayerJoined: arktype_internal_variants_object_ts5.ObjectType<(In: {
|
|
1729
1729
|
game: "siege";
|
|
1730
1730
|
type: "player_joined";
|
|
1731
1731
|
creation_time: number;
|
|
@@ -1755,7 +1755,7 @@ declare const PlayerJoined: arktype_internal_variants_object_ts0.ObjectType<(In:
|
|
|
1755
1755
|
life_state: (string & {}) | "downed" | "normal" | "overhealed" | "low_health" | "dead" | "respawning";
|
|
1756
1756
|
ping: number;
|
|
1757
1757
|
};
|
|
1758
|
-
}) =>
|
|
1758
|
+
}) => arktype0.Out<{
|
|
1759
1759
|
content: {
|
|
1760
1760
|
starting_side: "attacker" | "defender" | "both" | "invalid" | (string & {});
|
|
1761
1761
|
player_id: SiegePlayerId;
|
|
@@ -1790,7 +1790,7 @@ declare const PlayerJoined: arktype_internal_variants_object_ts0.ObjectType<(In:
|
|
|
1790
1790
|
type PlayerJoinedEvent = typeof PlayerJoined.infer;
|
|
1791
1791
|
//#endregion
|
|
1792
1792
|
//#region src/events/playerLeft.d.ts
|
|
1793
|
-
declare const PlayerLeft:
|
|
1793
|
+
declare const PlayerLeft: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1794
1794
|
game: "siege";
|
|
1795
1795
|
type: "player_left";
|
|
1796
1796
|
creation_time: number;
|
|
@@ -1801,7 +1801,7 @@ declare const PlayerLeft: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1801
1801
|
type PlayerLeftEvent = typeof PlayerLeft.infer;
|
|
1802
1802
|
//#endregion
|
|
1803
1803
|
//#region src/events/playerOperatorChanged.d.ts
|
|
1804
|
-
declare const PlayerOperatorChanged:
|
|
1804
|
+
declare const PlayerOperatorChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1805
1805
|
game: "siege";
|
|
1806
1806
|
type: "player_operator_changed";
|
|
1807
1807
|
creation_time: number;
|
|
@@ -1816,7 +1816,7 @@ declare const PlayerOperatorChanged: arktype_internal_variants_object_ts0.Object
|
|
|
1816
1816
|
type PlayerOperatorChangedEvent = typeof PlayerOperatorChanged.infer;
|
|
1817
1817
|
//#endregion
|
|
1818
1818
|
//#region src/events/playerLocationChanged.d.ts
|
|
1819
|
-
declare const PlayerLocationChanged:
|
|
1819
|
+
declare const PlayerLocationChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1820
1820
|
game: "siege";
|
|
1821
1821
|
type: "player_location_changed";
|
|
1822
1822
|
creation_time: number;
|
|
@@ -1828,7 +1828,7 @@ declare const PlayerLocationChanged: arktype_internal_variants_object_ts0.Object
|
|
|
1828
1828
|
type PlayerLocationChangedEvent = typeof PlayerLocationChanged.infer;
|
|
1829
1829
|
//#endregion
|
|
1830
1830
|
//#region src/events/playerSideChanged.d.ts
|
|
1831
|
-
declare const PlayerSideChanged:
|
|
1831
|
+
declare const PlayerSideChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1832
1832
|
game: "siege";
|
|
1833
1833
|
type: "player_side_changed";
|
|
1834
1834
|
creation_time: number;
|
|
@@ -1840,7 +1840,7 @@ declare const PlayerSideChanged: arktype_internal_variants_object_ts0.ObjectType
|
|
|
1840
1840
|
type PlayerSideChangedEvent = typeof PlayerSideChanged.infer;
|
|
1841
1841
|
//#endregion
|
|
1842
1842
|
//#region src/events/playerScoreChanged.d.ts
|
|
1843
|
-
declare const PlayerScoreChanged:
|
|
1843
|
+
declare const PlayerScoreChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1844
1844
|
game: "siege";
|
|
1845
1845
|
type: "player_score_changed";
|
|
1846
1846
|
creation_time: number;
|
|
@@ -1852,7 +1852,7 @@ declare const PlayerScoreChanged: arktype_internal_variants_object_ts0.ObjectTyp
|
|
|
1852
1852
|
type PlayerScoreChangedEvent = typeof PlayerScoreChanged.infer;
|
|
1853
1853
|
//#endregion
|
|
1854
1854
|
//#region src/events/playerKillsChanged.d.ts
|
|
1855
|
-
declare const PlayerKillsChanged:
|
|
1855
|
+
declare const PlayerKillsChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1856
1856
|
game: "siege";
|
|
1857
1857
|
type: "player_kills_changed";
|
|
1858
1858
|
creation_time: number;
|
|
@@ -1864,7 +1864,7 @@ declare const PlayerKillsChanged: arktype_internal_variants_object_ts0.ObjectTyp
|
|
|
1864
1864
|
type PlayerKillsChangedEvent = typeof PlayerKillsChanged.infer;
|
|
1865
1865
|
//#endregion
|
|
1866
1866
|
//#region src/events/playerDeathsChanged.d.ts
|
|
1867
|
-
declare const PlayerDeathsChanged:
|
|
1867
|
+
declare const PlayerDeathsChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1868
1868
|
game: "siege";
|
|
1869
1869
|
type: "player_deaths_changed";
|
|
1870
1870
|
creation_time: number;
|
|
@@ -1876,7 +1876,7 @@ declare const PlayerDeathsChanged: arktype_internal_variants_object_ts0.ObjectTy
|
|
|
1876
1876
|
type PlayerDeathsChangedEvent = typeof PlayerDeathsChanged.infer;
|
|
1877
1877
|
//#endregion
|
|
1878
1878
|
//#region src/events/playerAssistsChanged.d.ts
|
|
1879
|
-
declare const PlayerAssistsChanged:
|
|
1879
|
+
declare const PlayerAssistsChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1880
1880
|
game: "siege";
|
|
1881
1881
|
type: "player_assists_changed";
|
|
1882
1882
|
creation_time: number;
|
|
@@ -1888,7 +1888,7 @@ declare const PlayerAssistsChanged: arktype_internal_variants_object_ts0.ObjectT
|
|
|
1888
1888
|
type PlayerAssistsChangedEvent = typeof PlayerAssistsChanged.infer;
|
|
1889
1889
|
//#endregion
|
|
1890
1890
|
//#region src/events/playerGameModeActionsChanged.d.ts
|
|
1891
|
-
declare const PlayerGameModeActionsChanged:
|
|
1891
|
+
declare const PlayerGameModeActionsChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1892
1892
|
game: "siege";
|
|
1893
1893
|
type: "player_game_mode_actions_changed";
|
|
1894
1894
|
creation_time: number;
|
|
@@ -1900,7 +1900,7 @@ declare const PlayerGameModeActionsChanged: arktype_internal_variants_object_ts0
|
|
|
1900
1900
|
type PlayerGameModeActionsChangedEvent = typeof PlayerGameModeActionsChanged.infer;
|
|
1901
1901
|
//#endregion
|
|
1902
1902
|
//#region src/events/playerPingUpdated.d.ts
|
|
1903
|
-
declare const PlayerPingUpdated:
|
|
1903
|
+
declare const PlayerPingUpdated: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1904
1904
|
game: "siege";
|
|
1905
1905
|
type: "player_ping_updated";
|
|
1906
1906
|
creation_time: number;
|
|
@@ -1912,7 +1912,7 @@ declare const PlayerPingUpdated: arktype_internal_variants_object_ts0.ObjectType
|
|
|
1912
1912
|
type PlayerPingUpdatedEvent = typeof PlayerPingUpdated.infer;
|
|
1913
1913
|
//#endregion
|
|
1914
1914
|
//#region src/events/defuserPlanted.d.ts
|
|
1915
|
-
declare const DefuserPlanted:
|
|
1915
|
+
declare const DefuserPlanted: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1916
1916
|
game: "siege";
|
|
1917
1917
|
type: "defuser_planted";
|
|
1918
1918
|
creation_time: number;
|
|
@@ -1923,7 +1923,7 @@ declare const DefuserPlanted: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1923
1923
|
type DefuserPlantedEvent = typeof DefuserPlanted.infer;
|
|
1924
1924
|
//#endregion
|
|
1925
1925
|
//#region src/events/defuserSabotaged.d.ts
|
|
1926
|
-
declare const DefuserSabotaged:
|
|
1926
|
+
declare const DefuserSabotaged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1927
1927
|
game: "siege";
|
|
1928
1928
|
type: "defuser_sabotaged";
|
|
1929
1929
|
creation_time: number;
|
|
@@ -1934,7 +1934,7 @@ declare const DefuserSabotaged: arktype_internal_variants_object_ts0.ObjectType<
|
|
|
1934
1934
|
type DefuserSabotagedEvent = typeof DefuserSabotaged.infer;
|
|
1935
1935
|
//#endregion
|
|
1936
1936
|
//#region src/events/defuserPickedUp.d.ts
|
|
1937
|
-
declare const DefuserPickedUp:
|
|
1937
|
+
declare const DefuserPickedUp: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1938
1938
|
game: "siege";
|
|
1939
1939
|
type: "defuser_picked_up";
|
|
1940
1940
|
creation_time: number;
|
|
@@ -1946,7 +1946,7 @@ declare const DefuserPickedUp: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1946
1946
|
type DefuserPickedUpEvent = typeof DefuserPickedUp.infer;
|
|
1947
1947
|
//#endregion
|
|
1948
1948
|
//#region src/events/defuserDropped.d.ts
|
|
1949
|
-
declare const DefuserDropped:
|
|
1949
|
+
declare const DefuserDropped: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1950
1950
|
game: "siege";
|
|
1951
1951
|
type: "defuser_dropped";
|
|
1952
1952
|
creation_time: number;
|
|
@@ -1957,7 +1957,7 @@ declare const DefuserDropped: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1957
1957
|
type DefuserDroppedEvent = typeof DefuserDropped.infer;
|
|
1958
1958
|
//#endregion
|
|
1959
1959
|
//#region src/events/playerLifeStateChanged.d.ts
|
|
1960
|
-
declare const PlayerLifeStateChanged:
|
|
1960
|
+
declare const PlayerLifeStateChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1961
1961
|
game: "siege";
|
|
1962
1962
|
type: "player_life_state_changed";
|
|
1963
1963
|
creation_time: number;
|
|
@@ -1969,7 +1969,7 @@ declare const PlayerLifeStateChanged: arktype_internal_variants_object_ts0.Objec
|
|
|
1969
1969
|
type PlayerLifeStateChangedEvent = typeof PlayerLifeStateChanged.infer;
|
|
1970
1970
|
//#endregion
|
|
1971
1971
|
//#region src/events/playerDied.d.ts
|
|
1972
|
-
declare const PlayerDied:
|
|
1972
|
+
declare const PlayerDied: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1973
1973
|
game: "siege";
|
|
1974
1974
|
type: "player_died";
|
|
1975
1975
|
creation_time: number;
|
|
@@ -1982,7 +1982,7 @@ declare const PlayerDied: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1982
1982
|
type PlayerDiedEvent = typeof PlayerDied.infer;
|
|
1983
1983
|
//#endregion
|
|
1984
1984
|
//#region src/events/playerDowned.d.ts
|
|
1985
|
-
declare const PlayerDowned:
|
|
1985
|
+
declare const PlayerDowned: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1986
1986
|
game: "siege";
|
|
1987
1987
|
type: "player_downed";
|
|
1988
1988
|
creation_time: number;
|
|
@@ -1994,7 +1994,7 @@ declare const PlayerDowned: arktype_internal_variants_object_ts0.ObjectType<{
|
|
|
1994
1994
|
type PlayerDownedEvent = typeof PlayerDowned.infer;
|
|
1995
1995
|
//#endregion
|
|
1996
1996
|
//#region src/events/playerPingIdChanged.d.ts
|
|
1997
|
-
declare const PlayerPingIdChanged:
|
|
1997
|
+
declare const PlayerPingIdChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
1998
1998
|
game: "siege";
|
|
1999
1999
|
type: "player_ping_id_changed";
|
|
2000
2000
|
creation_time: number;
|
|
@@ -2006,7 +2006,7 @@ declare const PlayerPingIdChanged: arktype_internal_variants_object_ts0.ObjectTy
|
|
|
2006
2006
|
type PlayerPingIdChangedEvent = typeof PlayerPingIdChanged.infer;
|
|
2007
2007
|
//#endregion
|
|
2008
2008
|
//#region src/events/playerTeamChanged.d.ts
|
|
2009
|
-
declare const PlayerTeamChanged:
|
|
2009
|
+
declare const PlayerTeamChanged: arktype_internal_variants_object_ts5.ObjectType<{
|
|
2010
2010
|
game: "siege";
|
|
2011
2011
|
type: "player_team_changed";
|
|
2012
2012
|
creation_time: number;
|
|
@@ -2018,7 +2018,7 @@ declare const PlayerTeamChanged: arktype_internal_variants_object_ts0.ObjectType
|
|
|
2018
2018
|
type PlayerTeamChangedEvent = typeof PlayerTeamChanged.infer;
|
|
2019
2019
|
//#endregion
|
|
2020
2020
|
//#region src/events/index.d.ts
|
|
2021
|
-
declare const siegeEvents:
|
|
2021
|
+
declare const siegeEvents: arktype0.Module<{
|
|
2022
2022
|
event: {
|
|
2023
2023
|
game: "siege";
|
|
2024
2024
|
type: "started_queuing";
|
|
@@ -2205,7 +2205,7 @@ declare const siegeEvents: arktype2.Module<{
|
|
|
2205
2205
|
life_state: (string & {}) | "downed" | "normal" | "overhealed" | "low_health" | "dead" | "respawning";
|
|
2206
2206
|
ping: number;
|
|
2207
2207
|
};
|
|
2208
|
-
}) =>
|
|
2208
|
+
}) => arktype0.Out<{
|
|
2209
2209
|
content: {
|
|
2210
2210
|
starting_side: "attacker" | "defender" | "both" | "invalid" | (string & {});
|
|
2211
2211
|
player_id: SiegePlayerId;
|
|
@@ -2585,7 +2585,7 @@ declare const siegeEvents: arktype2.Module<{
|
|
|
2585
2585
|
life_state: (string & {}) | "downed" | "normal" | "overhealed" | "low_health" | "dead" | "respawning";
|
|
2586
2586
|
ping: number;
|
|
2587
2587
|
};
|
|
2588
|
-
}) =>
|
|
2588
|
+
}) => arktype0.Out<{
|
|
2589
2589
|
content: {
|
|
2590
2590
|
starting_side: "attacker" | "defender" | "both" | "invalid" | (string & {});
|
|
2591
2591
|
player_id: SiegePlayerId;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@overlayed/app",
|
|
3
3
|
"author": "overlayed.gg",
|
|
4
4
|
"homepage": "https://overlayed.gg",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.36.0",
|
|
6
6
|
"description": "Overlayed app",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
8
8
|
"repository": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"./security": {
|
|
46
46
|
"types": "./dist/security.d.ts",
|
|
47
|
-
"import": "./dist/security.
|
|
48
|
-
"default": "./dist/security.
|
|
47
|
+
"import": "./dist/security.mjs",
|
|
48
|
+
"default": "./dist/security.mjs"
|
|
49
49
|
},
|
|
50
50
|
"./dist/render-interface/build/*": "./dist/render-interface/build/*",
|
|
51
51
|
"./dist/native-interface/build/*": "./dist/native-interface/build/*"
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
"@overlayed/cortex-client": "0.0.5",
|
|
79
79
|
"@overlayed/events": "0.0.4",
|
|
80
80
|
"@overlayed/native-managers": "0.0.4",
|
|
81
|
+
"@overlayed/shared-node": "0.0.4",
|
|
81
82
|
"@overlayed/siege": "0.0.5",
|
|
82
83
|
"@overlayed/universal": "0.0.0",
|
|
83
84
|
"@overlayed/utils": "0.0.4",
|
|
84
|
-
"@overlayed/utils-node": "0.0.4"
|
|
85
|
-
"@overlayed/shared-node": "0.0.4"
|
|
85
|
+
"@overlayed/utils-node": "0.0.4"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"arktype": "^2.1.29",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"jiti": "^2.6.1",
|
|
92
92
|
"jszip": "^3.10.1",
|
|
93
93
|
"mitt": "^3.0.1",
|
|
94
|
+
"picocolors": "^1.1.1",
|
|
94
95
|
"systeminformation": "^5.27.14",
|
|
95
96
|
"xior": "^0.7.8"
|
|
96
97
|
},
|