@overlayed/app 0.9.1 → 0.10.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.js CHANGED
@@ -1,33 +1,33 @@
1
1
  var ut = Object.defineProperty;
2
- var ht = (s, e, t) => e in s ? ut(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var c = (s, e, t) => ht(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { type as F } from "arktype";
5
- import A, { mkdirSync as be, existsSync as ve, writeFileSync as we, createWriteStream as Ge, readdirSync as je, unlinkSync as Ue, readFileSync as ze, copyFileSync as dt } from "node:fs";
2
+ var ht = (n, e, t) => e in n ? ut(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var c = (n, e, t) => ht(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { type as R } from "arktype";
5
+ import O, { mkdirSync as be, existsSync as ve, writeFileSync as we, createWriteStream as Ge, readdirSync as je, unlinkSync as Ue, readFileSync as ze, copyFileSync as dt } from "node:fs";
6
6
  import m, { join as x, resolve as gt } from "node:path";
7
- import { createRequire as ie } from "node:module";
8
- import P from "node:fs/promises";
7
+ import { createRequire as ae } from "node:module";
8
+ import S from "node:fs/promises";
9
9
  import He from "jszip";
10
10
  import { createHash as ft } from "node:crypto";
11
11
  import pt from "node:events";
12
12
  import yt, { app as Ve } from "electron";
13
- var mt = Object.defineProperty, bt = (s, e, t) => e in s ? mt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, E = (s, e, t) => bt(s, typeof e != "symbol" ? e + "" : e, t);
14
- function vt(s) {
15
- return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
16
- var r = s.get(e);
17
- r ? r.push(t) : s.set(e, [t]);
13
+ var mt = Object.defineProperty, bt = (n, e, t) => e in n ? mt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, E = (n, e, t) => bt(n, typeof e != "symbol" ? e + "" : e, t);
14
+ function vt(n) {
15
+ return { all: n = n || /* @__PURE__ */ new Map(), on: function(e, t) {
16
+ var r = n.get(e);
17
+ r ? r.push(t) : n.set(e, [t]);
18
18
  }, off: function(e, t) {
19
- var r = s.get(e);
20
- r && (t ? r.splice(r.indexOf(t) >>> 0, 1) : s.set(e, []));
19
+ var r = n.get(e);
20
+ r && (t ? r.splice(r.indexOf(t) >>> 0, 1) : n.set(e, []));
21
21
  }, emit: function(e, t) {
22
- var r = s.get(e);
23
- r && r.slice().map(function(n) {
24
- n(t);
25
- }), (r = s.get("*")) && r.slice().map(function(n) {
26
- n(e, t);
22
+ var r = n.get(e);
23
+ r && r.slice().map(function(s) {
24
+ s(t);
25
+ }), (r = n.get("*")) && r.slice().map(function(s) {
26
+ s(e, t);
27
27
  });
28
28
  } };
29
29
  }
30
- class Ee {
30
+ let Ee = class {
31
31
  constructor() {
32
32
  E(this, "emitter"), this.emitter = vt();
33
33
  }
@@ -43,15 +43,15 @@ class Ee {
43
43
  removeAllListeners() {
44
44
  this.emitter.all.clear();
45
45
  }
46
- }
47
- function Ie(s, ...e) {
46
+ };
47
+ function Ie(n, ...e) {
48
48
  var t;
49
- return t = class extends s {
49
+ return t = class extends n {
50
50
  /**
51
51
  * Lazy get the static instance
52
52
  */
53
53
  static getInstance() {
54
- return this._instance || (this._instance = new s(...e)), this._instance;
54
+ return this._instance || (this._instance = new n(...e)), this._instance;
55
55
  }
56
56
  /**
57
57
  * Release the instance (most of the time you won't need this)
@@ -166,26 +166,26 @@ let Et = class We extends Ee {
166
166
  cleanupOldLogs() {
167
167
  const e = je(this.logPath), t = /* @__PURE__ */ new Date();
168
168
  t.setDate(t.getDate() - 3), e.filter((r) => r.startsWith(this.baseFileName) && r.endsWith(".log")).filter((r) => {
169
- const n = r.replace(`${this.baseFileName}-`, "").replace(".log", "");
170
- return new Date(n) < t;
169
+ const s = r.replace(`${this.baseFileName}-`, "").replace(".log", "");
170
+ return new Date(s) < t;
171
171
  }).forEach((r) => {
172
172
  try {
173
173
  Ue(x(this.logPath, r));
174
- } catch (n) {
175
- console.error(`Failed to delete old log file ${r}:`, n);
174
+ } catch (s) {
175
+ console.error(`Failed to delete old log file ${r}:`, s);
176
176
  }
177
177
  });
178
178
  }
179
179
  write(e, ...t) {
180
- const r = /* @__PURE__ */ new Date(), n = r.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${r.getMilliseconds().toString().padStart(3, "0")}`, a = t.map((i) => typeof i == "object" ? JSON.stringify(i, void 0, 2) : String(i)).join(" "), o = `[${n}] [${e}] ${a}
180
+ const r = /* @__PURE__ */ new Date(), s = r.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${r.getMilliseconds().toString().padStart(3, "0")}`, a = t.map((i) => typeof i == "object" ? JSON.stringify(i, void 0, 2) : String(i)).join(" "), o = `[${s}] [${e}] ${a}
181
181
  `;
182
182
  this.stream.write(o, (i) => {
183
183
  i ? this.emit("error", i) : this.emit("write", o);
184
184
  });
185
185
  }
186
186
  };
187
- const It = () => m.join(process.env.APPDATA ?? "", "overlayed"), kt = (s) => m.join(It(), "apps", s), _t = (s) => m.join(kt(s), "logs");
188
- let St = class {
187
+ const It = () => m.join(process.env.APPDATA ?? "", "overlayed"), kt = (n) => m.join(It(), "apps", n), _t = (n) => m.join(kt(n), "logs");
188
+ let Pt = class {
189
189
  constructor() {
190
190
  E(this, "data", []);
191
191
  }
@@ -207,9 +207,9 @@ let St = class {
207
207
  e && (yield e);
208
208
  }
209
209
  }
210
- }, Pt = class {
210
+ }, St = class {
211
211
  constructor() {
212
- E(this, "fileName", "app.log"), E(this, "fileLogger"), E(this, "path"), E(this, "appId"), E(this, "messageQueue", new St());
212
+ E(this, "fileName", "app.log"), E(this, "fileLogger"), E(this, "path"), E(this, "appId"), E(this, "messageQueue", new Pt());
213
213
  }
214
214
  init(e) {
215
215
  this.appId = e, this.path = _t(e), this.fileLogger = new Et(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
@@ -269,16 +269,16 @@ let St = class {
269
269
  console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
270
270
  }
271
271
  };
272
- Ie(Pt);
273
- const Ct = ie(import.meta.url), {
272
+ Ie(St);
273
+ const Ct = ae(import.meta.url), {
274
274
  PipeEventServer: Lt,
275
- PipeEventClient: ps,
276
- PipeEventBase: ys,
277
- ProcessMonitor: ms,
278
- Process: bs,
279
- InjectionMethod: vs,
280
- AccessLevel: ws,
281
- HardwareInterface: Es
275
+ PipeEventClient: vn,
276
+ PipeEventBase: wn,
277
+ ProcessMonitor: En,
278
+ Process: In,
279
+ InjectionMethod: kn,
280
+ AccessLevel: _n,
281
+ HardwareInterface: Pn
282
282
  } = Ct("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
283
283
  let Dt = class extends Ee {
284
284
  constructor(e) {
@@ -309,26 +309,26 @@ let Dt = class extends Ee {
309
309
  }
310
310
  };
311
311
  const ke = Ie(Dt, "stats-cc");
312
- function Mt(s) {
313
- return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
314
- var r = s.get(e);
315
- r ? r.push(t) : s.set(e, [t]);
312
+ function At(n) {
313
+ return { all: n = n || /* @__PURE__ */ new Map(), on: function(e, t) {
314
+ var r = n.get(e);
315
+ r ? r.push(t) : n.set(e, [t]);
316
316
  }, off: function(e, t) {
317
- var r = s.get(e);
318
- r && (t ? r.splice(r.indexOf(t) >>> 0, 1) : s.set(e, []));
317
+ var r = n.get(e);
318
+ r && (t ? r.splice(r.indexOf(t) >>> 0, 1) : n.set(e, []));
319
319
  }, emit: function(e, t) {
320
- var r = s.get(e);
321
- r && r.slice().map(function(n) {
322
- n(t);
323
- }), (r = s.get("*")) && r.slice().map(function(n) {
324
- n(e, t);
320
+ var r = n.get(e);
321
+ r && r.slice().map(function(s) {
322
+ s(t);
323
+ }), (r = n.get("*")) && r.slice().map(function(s) {
324
+ s(e, t);
325
325
  });
326
326
  } };
327
327
  }
328
328
  class _e {
329
329
  constructor() {
330
330
  c(this, "emitter");
331
- this.emitter = Mt();
331
+ this.emitter = At();
332
332
  }
333
333
  on(e, t) {
334
334
  this.emitter.on(e, t);
@@ -343,7 +343,7 @@ class _e {
343
343
  this.emitter.all.clear();
344
344
  }
345
345
  }
346
- class At {
346
+ class Mt {
347
347
  constructor() {
348
348
  c(this, "listeners");
349
349
  this.listeners = /* @__PURE__ */ new Map();
@@ -357,7 +357,7 @@ class At {
357
357
  r && r.delete(t);
358
358
  }
359
359
  async emit(e, ...t) {
360
- const r = this.listeners.get(e) || /* @__PURE__ */ new Set(), n = this.listeners.get("*") || /* @__PURE__ */ new Set(), a = [...Array.from(r), ...Array.from(n)];
360
+ const r = this.listeners.get(e) || /* @__PURE__ */ new Set(), s = this.listeners.get("*") || /* @__PURE__ */ new Set(), a = [...Array.from(r), ...Array.from(s)];
361
361
  return a.length === 0 ? [] : await Promise.all(
362
362
  a.map(async (i) => {
363
363
  try {
@@ -374,14 +374,14 @@ class At {
374
374
  this.listeners.clear();
375
375
  }
376
376
  }
377
- function L(s, ...e) {
377
+ function L(n, ...e) {
378
378
  var r;
379
- return r = class extends s {
379
+ return r = class extends n {
380
380
  /**
381
381
  * Lazy get the static instance
382
382
  */
383
383
  static getInstance() {
384
- return this._instance || (this._instance = new s(...e)), this._instance;
384
+ return this._instance || (this._instance = new n(...e)), this._instance;
385
385
  }
386
386
  /**
387
387
  * Release the instance (most of the time you won't need this)
@@ -391,7 +391,7 @@ function L(s, ...e) {
391
391
  }
392
392
  }, c(r, "_instance"), r;
393
393
  }
394
- class Kt extends _e {
394
+ class Ot extends _e {
395
395
  destroy() {
396
396
  this.removeAllListeners();
397
397
  }
@@ -420,15 +420,15 @@ class Kt extends _e {
420
420
  });
421
421
  }
422
422
  }
423
- const C = L(Kt);
424
- class Ot {
423
+ const C = L(Ot);
424
+ class Kt {
425
425
  constructor(e) {
426
426
  c(this, "data");
427
427
  c(this, "_schema");
428
428
  c(this, "_defaultValue");
429
429
  c(this, "_path");
430
- const { schema: t, default: r, path: n } = e;
431
- this._schema = t, this._defaultValue = r, this._path = n;
430
+ const { schema: t, default: r, path: s } = e;
431
+ this._schema = t, this._defaultValue = r, this._path = s;
432
432
  }
433
433
  set(e) {
434
434
  const t = this._schema["~standard"].validate(e);
@@ -449,7 +449,7 @@ class Ot {
449
449
  save(e) {
450
450
  const t = this.onBeforeSave(e);
451
451
  try {
452
- A.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
452
+ O.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
453
453
  } catch {
454
454
  return;
455
455
  }
@@ -462,7 +462,7 @@ class Ot {
462
462
  return this.data = e, e;
463
463
  }
464
464
  try {
465
- const e = A.readFileSync(this.getFilePath(), "utf8"), t = this.onAfterLoad(this.parseStoredData(e));
465
+ const e = O.readFileSync(this.getFilePath(), "utf8"), t = this.onAfterLoad(this.parseStoredData(e));
466
466
  return this.data = t, t;
467
467
  } catch {
468
468
  return this.data = this._defaultValue;
@@ -479,35 +479,35 @@ class Ot {
479
479
  }
480
480
  parseStoredData(e) {
481
481
  try {
482
- const r = F("string.json.parse").to("object")(e);
483
- if (r instanceof F.errors)
482
+ const r = R("string.json.parse").to("object")(e);
483
+ if (r instanceof R.errors)
484
484
  return this._defaultValue;
485
- const n = this._schema["~standard"].validate(r);
486
- if (n instanceof Promise)
485
+ const s = this._schema["~standard"].validate(r);
486
+ if (s instanceof Promise)
487
487
  throw new Error("StructuredConfigFile does not support async validation");
488
- return n.issues ? this.migrate(r, this._defaultValue) : this.migrate(n.value, this._defaultValue);
488
+ return s.issues ? this.migrate(r, this._defaultValue) : this.migrate(s.value, this._defaultValue);
489
489
  } catch {
490
490
  return this._defaultValue;
491
491
  }
492
492
  }
493
493
  canReadWriteFile(e) {
494
494
  try {
495
- return A.accessSync(e, A.constants.R_OK | A.constants.W_OK), !0;
495
+ return O.accessSync(e, O.constants.R_OK | O.constants.W_OK), !0;
496
496
  } catch {
497
497
  return !1;
498
498
  }
499
499
  }
500
500
  fileExists(e) {
501
501
  try {
502
- return A.accessSync(e, A.constants.F_OK), !0;
502
+ return O.accessSync(e, O.constants.F_OK), !0;
503
503
  } catch {
504
504
  return !1;
505
505
  }
506
506
  }
507
507
  migrate(e, t) {
508
508
  const r = { ...e };
509
- for (const n in t)
510
- Object.prototype.hasOwnProperty.call(t, n) && (n in e ? e[n] !== null && t[n] !== null && typeof e[n] == "object" && typeof t[n] == "object" && !Array.isArray(e[n]) && !Array.isArray(t[n]) ? r[n] = this.migrate(e[n], t[n]) : Array.isArray(t[n]) && (r[n] = e[n]) : r[n] = t[n]);
509
+ for (const s in t)
510
+ Object.prototype.hasOwnProperty.call(t, s) && (s in e ? e[s] !== null && t[s] !== null && typeof e[s] == "object" && typeof t[s] == "object" && !Array.isArray(e[s]) && !Array.isArray(t[s]) ? r[s] = this.migrate(e[s], t[s]) : Array.isArray(t[s]) && (r[s] = e[s]) : r[s] = t[s]);
511
511
  return r;
512
512
  }
513
513
  reportInvalidConfigFile(e) {
@@ -518,7 +518,7 @@ class Ot {
518
518
  });
519
519
  }
520
520
  }
521
- class Se extends _e {
521
+ class Pe extends _e {
522
522
  constructor(t, r) {
523
523
  super();
524
524
  c(this, "stream");
@@ -530,7 +530,7 @@ class Se extends _e {
530
530
  this.logPath = t, this.baseFileName = r.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
531
531
  }
532
532
  static scope(t, r) {
533
- return new Se(t, r);
533
+ return new Pe(t, r);
534
534
  }
535
535
  log(...t) {
536
536
  this.write("log", ...t);
@@ -599,26 +599,26 @@ class Se extends _e {
599
599
  }
600
600
  cleanupOldLogs() {
601
601
  const t = je(this.logPath), r = /* @__PURE__ */ new Date();
602
- r.setDate(r.getDate() - 3), t.filter((n) => n.startsWith(this.baseFileName) && n.endsWith(".log")).filter((n) => {
603
- const a = n.replace(`${this.baseFileName}-`, "").replace(".log", "");
602
+ r.setDate(r.getDate() - 3), t.filter((s) => s.startsWith(this.baseFileName) && s.endsWith(".log")).filter((s) => {
603
+ const a = s.replace(`${this.baseFileName}-`, "").replace(".log", "");
604
604
  return new Date(a) < r;
605
- }).forEach((n) => {
605
+ }).forEach((s) => {
606
606
  try {
607
- Ue(x(this.logPath, n));
607
+ Ue(x(this.logPath, s));
608
608
  } catch (a) {
609
- console.error(`Failed to delete old log file ${n}:`, a);
609
+ console.error(`Failed to delete old log file ${s}:`, a);
610
610
  }
611
611
  });
612
612
  }
613
613
  write(t, ...r) {
614
- const n = /* @__PURE__ */ new Date(), a = n.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${n.getMilliseconds().toString().padStart(3, "0")}`, o = r.map((l) => typeof l == "object" ? JSON.stringify(l, void 0, 2) : String(l)).join(" "), i = `[${a}] [${t}] ${o}
614
+ const s = /* @__PURE__ */ new Date(), a = s.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${s.getMilliseconds().toString().padStart(3, "0")}`, o = r.map((l) => typeof l == "object" ? JSON.stringify(l, void 0, 2) : String(l)).join(" "), i = `[${a}] [${t}] ${o}
615
615
  `;
616
616
  this.stream.write(i, (l) => {
617
617
  l ? this.emit("error", l) : this.emit("write", i);
618
618
  });
619
619
  }
620
620
  }
621
- const Pe = () => m.join(process.env.APPDATA ?? "", "overlayed"), qe = (s) => m.join(Pe(), "apps", s), Ft = (s) => m.join(qe(s), "logs");
621
+ const Se = () => m.join(process.env.APPDATA ?? "", "overlayed"), qe = (n) => m.join(Se(), "apps", n), Rt = (n) => m.join(qe(n), "logs");
622
622
  class Qe {
623
623
  constructor() {
624
624
  c(this, "data", []);
@@ -642,7 +642,7 @@ class Qe {
642
642
  }
643
643
  }
644
644
  }
645
- class Rt {
645
+ class Ft {
646
646
  constructor() {
647
647
  c(this, "fileName", "app.log");
648
648
  c(this, "fileLogger");
@@ -651,7 +651,7 @@ class Rt {
651
651
  c(this, "messageQueue", new Qe());
652
652
  }
653
653
  init(e) {
654
- this.appId = e, this.path = Ft(e), this.fileLogger = new Se(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
654
+ this.appId = e, this.path = Rt(e), this.fileLogger = new Pe(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
655
655
  var r;
656
656
  (r = this.fileLogger) == null || r[t.type](...t.args);
657
657
  });
@@ -708,11 +708,11 @@ class Rt {
708
708
  console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
709
709
  }
710
710
  }
711
- const ae = L(Rt);
712
- function $t(s) {
713
- return s;
711
+ const oe = L(Ft);
712
+ function $t(n) {
713
+ return n;
714
714
  }
715
- function xt(s) {
715
+ function xt(n) {
716
716
  return $t;
717
717
  }
718
718
  class Tt extends pt {
@@ -728,18 +728,18 @@ class Tt extends pt {
728
728
  return Math.ceil(this.blob.size / (this.chunkSizeMb * 1024 * 1024));
729
729
  }
730
730
  async chunk(t) {
731
- const r = this.chunkSizeMb * 1024 * 1024, n = this.totalChunks;
732
- if (n === 0) return;
731
+ const r = this.chunkSizeMb * 1024 * 1024, s = this.totalChunks;
732
+ if (s === 0) return;
733
733
  const a = 5, o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), h = [];
734
- for (let u = 0; u < n; u++)
734
+ for (let u = 0; u < s; u++)
735
735
  h.push(u);
736
736
  const g = async (u) => {
737
737
  const d = u * r, b = Math.min(d + r, this.blob.size), k = this.blob.slice(d, b);
738
738
  try {
739
739
  await t(k, u), l.add(u), this.emit("chunkComplete", u), i.delete(u);
740
- } catch (S) {
740
+ } catch (P) {
741
741
  const D = o.get(u) || 0;
742
- D < a ? (o.set(u, D + 1), await new Promise((v) => setTimeout(v, (D + 1) * 1e3)), h.push(u)) : (l.add(u), this.emit("error", S), this.shouldStop = !0, i.delete(u));
742
+ D < a ? (o.set(u, D + 1), await new Promise((v) => setTimeout(v, (D + 1) * 1e3)), h.push(u)) : (l.add(u), this.emit("error", P), this.shouldStop = !0, i.delete(u));
743
743
  }
744
744
  }, f = [], p = async () => {
745
745
  for (; (h.length > 0 || i.size > 0) && !this.shouldStop; ) {
@@ -756,11 +756,11 @@ class Tt extends pt {
756
756
  return await Promise.all(f);
757
757
  }
758
758
  }
759
- class Je {
759
+ class Ye {
760
760
  constructor(e) {
761
761
  c(this, "logger");
762
762
  c(this, "initialized", !1);
763
- this.logger = ae.getInstance().scope(e);
763
+ this.logger = oe.getInstance().scope(e);
764
764
  }
765
765
  init() {
766
766
  this.logger.log("Initializing"), this.initialized = !0;
@@ -769,12 +769,12 @@ class Je {
769
769
  this.logger.log("Destroying"), this.initialized = !1;
770
770
  }
771
771
  }
772
- class oe extends _e {
772
+ class le extends _e {
773
773
  constructor(t) {
774
774
  super();
775
775
  c(this, "logger");
776
776
  c(this, "initialized", !1);
777
- this.logger = ae.getInstance().scope(t);
777
+ this.logger = oe.getInstance().scope(t);
778
778
  }
779
779
  init() {
780
780
  this.logger.log("Initializing"), this.initialized = !0;
@@ -783,12 +783,12 @@ class oe extends _e {
783
783
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
784
784
  }
785
785
  }
786
- class Nt extends At {
786
+ class Nt extends Mt {
787
787
  constructor(t) {
788
788
  super();
789
789
  c(this, "logger");
790
790
  c(this, "initialized", !1);
791
- this.logger = ae.getInstance().scope(t);
791
+ this.logger = oe.getInstance().scope(t);
792
792
  }
793
793
  init() {
794
794
  this.logger.log("Initializing"), this.initialized = !0;
@@ -797,52 +797,52 @@ class Nt extends At {
797
797
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
798
798
  }
799
799
  }
800
- var N = "object", Ye = "function", Xe = "prototype", ue = "text", Ce = "json", Oe = "abort", de = "paramsSerializer", Fe = "addEventListener", W = "status", M = "headers", le = Object, R = void 0, te = null, ge = le[Xe], re = le.keys, j = Array.isArray, Re = "method", Ze = "HEAD", fe = "GET", et = "OPTIONS", Bt = "POST", Gt = "PUT", jt = "PATCH", Ut = "DELETE";
801
- function zt(s, e) {
800
+ var N = "object", Je = "function", Xe = "prototype", ue = "text", Ce = "json", Ke = "abort", de = "paramsSerializer", Re = "addEventListener", q = "status", A = "headers", ce = Object, F = void 0, re = null, ge = ce[Xe], ne = ce.keys, j = Array.isArray, Fe = "method", Ze = "HEAD", fe = "GET", et = "OPTIONS", Bt = "POST", Gt = "PUT", jt = "PATCH", Ut = "DELETE";
801
+ function zt(n, e) {
802
802
  let t = new AbortController();
803
803
  function r(i) {
804
804
  t.abort(i), a();
805
805
  }
806
- let n = [];
807
- for (let i of s) {
806
+ let s = [];
807
+ for (let i of n) {
808
808
  if ((i == null ? void 0 : i.aborted) === !0) {
809
809
  r(i.reason);
810
810
  break;
811
811
  }
812
- if (i != null && i[Fe]) {
812
+ if (i != null && i[Re]) {
813
813
  let l = () => {
814
814
  r(i.reason);
815
815
  };
816
- n.push(() => {
816
+ s.push(() => {
817
817
  var h;
818
- (h = i.removeEventListener) == null || h.call(i, Oe, l);
819
- }), i[Fe](Oe, l);
818
+ (h = i.removeEventListener) == null || h.call(i, Ke, l);
819
+ }), i[Re](Ke, l);
820
820
  }
821
821
  }
822
822
  function a() {
823
- n.forEach((i) => i()), e == null || e();
823
+ s.forEach((i) => i()), e == null || e();
824
824
  }
825
825
  let o = t.signal;
826
826
  return o.clear = a, o;
827
827
  }
828
- var $e = le.getPrototypeOf, xe = (s) => {
829
- if (s !== te && typeof s === N) {
830
- if (typeof $e === Ye) {
831
- let e = $e(s);
832
- return e === ge || e === te;
828
+ var $e = ce.getPrototypeOf, xe = (n) => {
829
+ if (n !== re && typeof n === N) {
830
+ if (typeof $e === Je) {
831
+ let e = $e(n);
832
+ return e === ge || e === re;
833
833
  }
834
- return ge.toString.call(s) === `[${N} Object]`;
834
+ return ge.toString.call(n) === `[${N} Object]`;
835
835
  }
836
836
  return !1;
837
- }, Le = (...s) => s.reduce((e, t) => {
837
+ }, Le = (...n) => n.reduce((e, t) => {
838
838
  if (j(t)) throw new TypeError(`Arguments must be ${N}s, not arrays.`);
839
- return re(t).forEach((r) => {
839
+ return ne(t).forEach((r) => {
840
840
  ["__proto__", "constructor", Xe].includes(r) || (j(e[r]) && j(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : xe(e[r]) && xe(t[r]) ? e[r] = Le(e[r], t[r]) : e[r] = t[r]);
841
841
  }), e;
842
842
  }, {});
843
- function De(s, e = !0, t = te, r) {
844
- if (s === R || s === te) return "";
845
- let n = [], a = e ? encodeURIComponent : (f) => f, o = j(s), { arrayFormat: i, allowDots: l, serializeDate: h } = r || {}, g = (f) => {
843
+ function De(n, e = !0, t = re, r) {
844
+ if (n === F || n === re) return "";
845
+ let s = [], a = e ? encodeURIComponent : (f) => f, o = j(n), { arrayFormat: i, allowDots: l, serializeDate: h } = r || {}, g = (f) => {
846
846
  if (l && !o) return `.${f}`;
847
847
  if (o) {
848
848
  if (i === "brackets") return "[]";
@@ -850,104 +850,104 @@ function De(s, e = !0, t = te, r) {
850
850
  }
851
851
  return `[${f}]`;
852
852
  };
853
- for (let f in s) if (ge.hasOwnProperty.call(s, f)) {
854
- let p = s[f];
855
- if (p !== R) {
853
+ for (let f in n) if (ge.hasOwnProperty.call(n, f)) {
854
+ let p = n[f];
855
+ if (p !== F) {
856
856
  let u = t ? `${t}${g(f)}` : a(f);
857
857
  if (!isNaN(p) && p instanceof Date && (p = h ? h(p) : p.toISOString()), typeof p === N) {
858
858
  let d = De(p, e, u, r);
859
- d !== "" && n.push(d);
860
- } else n.push(`${a(u)}=${a(p)}`);
859
+ d !== "" && s.push(d);
860
+ } else s.push(`${a(u)}=${a(p)}`);
861
861
  }
862
862
  }
863
- return n.join("&");
863
+ return s.join("&");
864
864
  }
865
- function pe(s) {
866
- return j(s) ? s.map(pe) : (s && typeof s === N && re(s).forEach((e) => {
867
- let t = s[e];
868
- t === R ? delete s[e] : pe(t);
869
- }), s);
865
+ function pe(n) {
866
+ return j(n) ? n.map(pe) : (n && typeof n === N && ne(n).forEach((e) => {
867
+ let t = n[e];
868
+ t === F ? delete n[e] : pe(t);
869
+ }), n);
870
870
  }
871
- function Ht(s) {
872
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
871
+ function Ht(n) {
872
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(n);
873
873
  }
874
- function Vt(s, e) {
875
- return s ? e ? (s.endsWith("/") ? s : s + "/") + (e[0] === "/" ? e.slice(1) : e) : s : e || "";
874
+ function Vt(n, e) {
875
+ return n ? e ? (n.endsWith("/") ? n : n + "/") + (e[0] === "/" ? e.slice(1) : e) : n : e || "";
876
876
  }
877
877
  var Wt = "XiorError", qt = "XiorTimeoutError", tt = class extends Error {
878
- constructor(s, e, t) {
879
- super(s), this.name = Wt, this.request = e, this.config = e, this.response = t;
878
+ constructor(n, e, t) {
879
+ super(n), this.name = Wt, this.request = e, this.config = e, this.response = t;
880
880
  }
881
881
  }, Qt = class extends tt {
882
882
  constructor(e, t, r) {
883
883
  super(e, t, r), this.name = qt;
884
884
  }
885
- }, Jt = Object.defineProperty, Yt = Object.defineProperties, Xt = Object.getOwnPropertyDescriptors, se = Object.getOwnPropertySymbols, rt = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable, Te = (s, e, t) => e in s ? Jt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e) => {
886
- for (var t in e || (e = {})) rt.call(e, t) && Te(s, t, e[t]);
887
- if (se) for (var t of se(e)) st.call(e, t) && Te(s, t, e[t]);
888
- return s;
889
- }, X = (s, e) => Yt(s, Xt(e)), Zt = (s, e) => {
885
+ }, Yt = Object.defineProperty, Jt = Object.defineProperties, Xt = Object.getOwnPropertyDescriptors, se = Object.getOwnPropertySymbols, rt = Object.prototype.hasOwnProperty, nt = Object.prototype.propertyIsEnumerable, Te = (n, e, t) => e in n ? Yt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, U = (n, e) => {
886
+ for (var t in e || (e = {})) rt.call(e, t) && Te(n, t, e[t]);
887
+ if (se) for (var t of se(e)) nt.call(e, t) && Te(n, t, e[t]);
888
+ return n;
889
+ }, Z = (n, e) => Jt(n, Xt(e)), Zt = (n, e) => {
890
890
  var t = {};
891
- for (var r in s) rt.call(s, r) && e.indexOf(r) < 0 && (t[r] = s[r]);
892
- if (s != null && se) for (var r of se(s)) e.indexOf(r) < 0 && st.call(s, r) && (t[r] = s[r]);
891
+ for (var r in n) rt.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
892
+ if (n != null && se) for (var r of se(n)) e.indexOf(r) < 0 && nt.call(n, r) && (t[r] = n[r]);
893
893
  return t;
894
- }, z = (s, e, t) => new Promise((r, n) => {
894
+ }, z = (n, e, t) => new Promise((r, s) => {
895
895
  var a = (l) => {
896
896
  try {
897
897
  i(t.next(l));
898
898
  } catch (h) {
899
- n(h);
899
+ s(h);
900
900
  }
901
901
  }, o = (l) => {
902
902
  try {
903
903
  i(t.throw(l));
904
904
  } catch (h) {
905
- n(h);
905
+ s(h);
906
906
  }
907
907
  }, i = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(a, o);
908
- i((t = t.apply(s, e)).next());
909
- }), Me = "application/", nt = `${Me}x-www-form-urlencoded`, it = RegExp, er = new it(`^${nt}`, "i"), tr = `${Me}${Ce}`, rr = new it(`^${Me}.*${Ce}.*`, "i");
910
- function sr(s = fe) {
911
- return [Ze, fe, et].includes(s);
908
+ i((t = t.apply(n, e)).next());
909
+ }), Ae = "application/", st = `${Ae}x-www-form-urlencoded`, it = RegExp, er = new it(`^${st}`, "i"), tr = `${Ae}${Ce}`, rr = new it(`^${Ae}.*${Ce}.*`, "i");
910
+ function nr(n = fe) {
911
+ return [Ze, fe, et].includes(n);
912
912
  }
913
- var nr = typeof URLSearchParams != `${R}`;
914
- function ir(s) {
913
+ var sr = typeof URLSearchParams != `${F}`;
914
+ function ir(n) {
915
915
  return z(this, null, function* () {
916
- let e = s[de] || De, t = s.encodeURI !== !1, r = s[Re] && s[Re].toUpperCase(), n = s.url, a = n, o = nr && s.data instanceof URLSearchParams, i = o ? le.fromEntries(s.data.entries()) : s.data, l = i, h = s != null && s[M] ? U({}, s[M]) : {}, g = s.params, f = sr(r);
917
- if (i && typeof i.append !== Ye) {
916
+ let e = n[de] || De, t = n.encodeURI !== !1, r = n[Fe] && n[Fe].toUpperCase(), s = n.url, a = s, o = sr && n.data instanceof URLSearchParams, i = o ? ce.fromEntries(n.data.entries()) : n.data, l = i, h = n != null && n[A] ? U({}, n[A]) : {}, g = n.params, f = nr(r);
917
+ if (i && typeof i.append !== Je) {
918
918
  let p = "", u = "content-type";
919
- if (s != null && s[M]) {
920
- let d = re(s[M]).find((b) => b.toLowerCase() === u);
921
- d && (u = d, p = s[M][d]);
919
+ if (n != null && n[A]) {
920
+ let d = ne(n[A]).find((b) => b.toLowerCase() === u);
921
+ d && (u = d, p = n[A][d]);
922
922
  }
923
- (!p || o) && (p = f || o ? nt : tr, h[u] = p), typeof i === N && (f && g && (g = Le(i, g)), rr.test(p) ? l = JSON.stringify(pe(i)) : !f && er.test(p) && (l = e(i)));
923
+ (!p || o) && (p = f || o ? st : tr, h[u] = p), typeof i === N && (f && g && (g = Le(i, g)), rr.test(p) ? l = JSON.stringify(pe(i)) : !f && er.test(p) && (l = e(i)));
924
924
  }
925
- if (g && re(g).length > 0) {
925
+ if (g && ne(g).length > 0) {
926
926
  let p = e(g, t);
927
- n += n.includes("?") ? `&${p}` : `?${p}`;
927
+ s += s.includes("?") ? `&${p}` : `?${p}`;
928
928
  }
929
- return X(U({}, s), { _data: l, _url: n, data: i, url: a, method: r, [M]: h, isGet: f });
929
+ return Z(U({}, n), { _data: l, _url: s, data: i, url: a, method: r, [A]: h, isGet: f });
930
930
  });
931
931
  }
932
- var ar = typeof AbortController != `${R}`;
933
- function or(s, e) {
932
+ var ar = typeof AbortController != `${F}`;
933
+ function or(n, e) {
934
934
  return z(this, null, function* () {
935
935
  let t;
936
- if (!e || !s.ok || [ue, Ce].includes(e)) {
937
- if (t = yield s[ue](), t && e !== ue) try {
936
+ if (!e || !n.ok || [ue, Ce].includes(e)) {
937
+ if (t = yield n[ue](), t && e !== ue) try {
938
938
  t = JSON.parse(t);
939
939
  } catch {
940
940
  }
941
941
  } else {
942
- if (e === "blob") return s.blob();
943
- if (e === "arraybuffer") return s.arrayBuffer();
942
+ if (e === "blob") return n.blob();
943
+ if (e === "arraybuffer") return n.arrayBuffer();
944
944
  }
945
945
  return t;
946
946
  });
947
947
  }
948
- var lr = (s) => new T(s), T = class {
948
+ var lr = (n) => new T(n), T = class {
949
949
  constructor(e) {
950
- this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [M]: {} };
950
+ this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [A]: {} };
951
951
  }
952
952
  get interceptors() {
953
953
  return { request: { use: (e, t, r) => (this.REQI.push(e), e), eject: (e) => {
@@ -972,11 +972,11 @@ var lr = (s) => new T(s), T = class {
972
972
  let t = Le(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
973
973
  t.withCredentials && !t[r] && (t[r] = "include"), t[de] || (t[de] = De);
974
974
  for (let o of this.REQI) t = yield o(t);
975
- let n = this._.bind(this);
975
+ let s = this._.bind(this);
976
976
  this.P.forEach((o) => {
977
- n = o(n, this);
977
+ s = o(s, this);
978
978
  });
979
- let a = n(t);
979
+ let a = s(t);
980
980
  if (!t._did) {
981
981
  let o = 0, i = [];
982
982
  for (this.RESI.forEach(function(l) {
@@ -988,9 +988,9 @@ var lr = (s) => new T(s), T = class {
988
988
  }
989
989
  _(e) {
990
990
  return z(this, null, function* () {
991
- let t = yield ir(e), { url: r, method: n, headers: a, timeout: o, signal: i, data: l, _data: h, _url: g, isGet: f, fetch: p } = t, u = Zt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
991
+ let t = yield ir(e), { url: r, method: s, headers: a, timeout: o, signal: i, data: l, _data: h, _url: g, isGet: f, fetch: p } = t, u = Zt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
992
992
  e._url = g;
993
- let d, b = [], k = R;
993
+ let d, b = [], k = F;
994
994
  if (o && ar) {
995
995
  let v = new AbortController();
996
996
  k = setTimeout(() => {
@@ -1000,11 +1000,11 @@ var lr = (s) => new T(s), T = class {
1000
1000
  i && b.push(i), d = b[0], b.length > 1 && (d = zt(b, () => {
1001
1001
  clearTimeout(k);
1002
1002
  }));
1003
- let S = g || r, D = "baseURL";
1004
- return e[D] && !Ht(S) && (S = Vt(e[D], S)), (p || fetch)(S, X(U({ body: f ? R : h }, u), { signal: d, method: n, headers: a })).then((v) => z(this, null, function* () {
1005
- let { responseType: V } = e, y = { data: yield or(v, V), response: v, config: e, request: e, [W]: v[W], statusText: v.statusText, [M]: v[M] };
1003
+ let P = g || r, D = "baseURL";
1004
+ return e[D] && !Ht(P) && (P = Vt(e[D], P)), (p || fetch)(P, Z(U({ body: f ? F : h }, u), { signal: d, method: s, headers: a })).then((v) => z(this, null, function* () {
1005
+ let { responseType: W } = e, y = { data: yield or(v, W), response: v, config: e, request: e, [q]: v[q], statusText: v.statusText, [A]: v[A] };
1006
1006
  if (!v.ok) {
1007
- let I = new tt(v[W] ? `Request failed with status code ${v[W]}` : "Network error", e, y);
1007
+ let I = new tt(v[q] ? `Request failed with status code ${v[q]}` : "Network error", e, y);
1008
1008
  return Promise.reject(I);
1009
1009
  }
1010
1010
  return y;
@@ -1015,10 +1015,10 @@ var lr = (s) => new T(s), T = class {
1015
1015
  });
1016
1016
  }
1017
1017
  cG(e) {
1018
- return (t, r) => this.request(r ? X(U({}, r), { method: e, url: t }) : { method: e, url: t });
1018
+ return (t, r) => this.request(r ? Z(U({}, r), { method: e, url: t }) : { method: e, url: t });
1019
1019
  }
1020
1020
  cP(e) {
1021
- return (t, r, n) => this.request(n ? X(U({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
1021
+ return (t, r, s) => this.request(s ? Z(U({}, s), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
1022
1022
  }
1023
1023
  get(e, t) {
1024
1024
  return this.cG(fe)(e, t);
@@ -1044,7 +1044,7 @@ var lr = (s) => new T(s), T = class {
1044
1044
  };
1045
1045
  T.create = lr, T.VERSION = "0.7.7";
1046
1046
  var cr = Object.assign(T.create(), { create: T.create, VERSION: T.VERSION }), at = cr;
1047
- const Ae = at.create({
1047
+ const Me = at.create({
1048
1048
  baseURL: "https://updater.stats.cc",
1049
1049
  headers: {
1050
1050
  Accept: "application/json",
@@ -1052,74 +1052,77 @@ const Ae = at.create({
1052
1052
  }
1053
1053
  });
1054
1054
  let ye;
1055
- function Ss(s) {
1056
- ye = s;
1055
+ function Dn(n) {
1056
+ ye = n;
1057
1057
  }
1058
- const ce = at.create({
1058
+ const V = at.create({
1059
1059
  baseURL: "https://api.overlayed.gg",
1060
1060
  headers: {
1061
1061
  Accept: "application/json",
1062
1062
  "Accept-Encoding": "gzip, deflate, br"
1063
1063
  }
1064
1064
  });
1065
- Ae.interceptors.request.use((s) => {
1065
+ Me.interceptors.request.use((n) => {
1066
1066
  const e = ye == null ? void 0 : ye();
1067
- return e && (s.headers ?? (s.headers = {}), s.headers.Authorization = e), s;
1067
+ return e && (n.headers ?? (n.headers = {}), n.headers.Authorization = e), n;
1068
1068
  });
1069
- function ur(s, e) {
1070
- return Ae.get(`/v1/native/${ot(s)}/version.txt`, {
1069
+ function ur(n) {
1070
+ return V.get(`/v1/public/applications/${n}`);
1071
+ }
1072
+ function hr(n, e) {
1073
+ return Me.get(`/v1/native/${ot(n)}/version.txt`, {
1071
1074
  params: { channel: e },
1072
1075
  responseType: "text"
1073
1076
  });
1074
1077
  }
1075
- function hr(s, e) {
1076
- return Ae.get(`/v1/native/${ot(s)}/files`, {
1078
+ function dr(n, e) {
1079
+ return Me.get(`/v1/native/${ot(n)}/files`, {
1077
1080
  params: { channel: e },
1078
1081
  responseType: "arraybuffer"
1079
1082
  });
1080
1083
  }
1081
- function ot(s) {
1082
- return s === "01JXPFK6YQ3N00N2Y9JHFNG55D" || s === "01JZEBPGHT5M4Y6SGY4P7Q9EZT" ? "siege-game-module" : s;
1084
+ function ot(n) {
1085
+ return n === "01JXPFK6YQ3N00N2Y9JHFNG55D" || n === "01JZEBPGHT5M4Y6SGY4P7Q9EZT" ? "siege-game-module" : n;
1083
1086
  }
1084
- function dr() {
1085
- return ce.get("/v1/public/raven/config");
1087
+ function gr() {
1088
+ return V.get("/v1/public/raven/config");
1086
1089
  }
1087
- const gr = xt();
1088
- function fr(s, e) {
1089
- return ce.get(`/v1/public/raven/games/${s}/builds/${e}`);
1090
+ const fr = xt();
1091
+ function pr(n, e) {
1092
+ return V.get(`/v1/public/raven/games/${n}/builds/${e}`);
1090
1093
  }
1091
- function pr(s, e) {
1092
- return ce.post(`/v1/public/raven/games/${s}/builds/upload`, null, {
1094
+ function yr(n, e) {
1095
+ return V.post(`/v1/public/raven/games/${n}/builds/upload`, null, {
1093
1096
  params: e
1094
1097
  });
1095
1098
  }
1096
- function yr(s, e) {
1099
+ function mr(n, e) {
1097
1100
  const t = new FormData();
1098
- return t.append("file", e.chunk), ce.patch(`/v1/public/raven/games/${s}/builds/upload`, t, {
1101
+ return t.append("file", e.chunk), V.patch(`/v1/public/raven/games/${n}/builds/upload`, t, {
1099
1102
  params: e
1100
1103
  });
1101
1104
  }
1102
- function mr(s) {
1103
- return s instanceof Error && (s.name === "XiorError" || s.name === "XiorTimeoutError");
1105
+ function br(n) {
1106
+ return n instanceof Error && (n.name === "XiorError" || n.name === "XiorTimeoutError");
1104
1107
  }
1105
- function br(s) {
1106
- return !!(s && "kind" in s.data && "message" in s.data);
1108
+ function vr(n) {
1109
+ return !!(n && "kind" in n.data && "message" in n.data);
1107
1110
  }
1108
- let Z;
1109
- function Ps(s) {
1110
- Z = s;
1111
+ let ee;
1112
+ function An(n) {
1113
+ ee = n;
1111
1114
  }
1112
- class vr extends oe {
1115
+ class wr extends le {
1113
1116
  constructor() {
1114
1117
  super("NativeModuleManager");
1115
1118
  c(this, "UPDATE_CHECK_INTERVAL_MS", 1e3 * 60 * 5);
1116
1119
  // 5 minutes
1117
1120
  c(this, "targetDir");
1118
1121
  c(this, "updateInterval");
1119
- this.targetDir = m.join(Pe(), "resources"), this.logger.log("Target directory", this.targetDir);
1122
+ this.targetDir = m.join(Se(), "resources"), this.logger.log("Target directory", this.targetDir);
1120
1123
  }
1121
1124
  async initWithDlls(t) {
1122
- super.init(), await P.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
1125
+ super.init(), await S.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
1123
1126
  }
1124
1127
  destroy() {
1125
1128
  this.updateInterval && (clearInterval(this.updateInterval), this.updateInterval = void 0), super.destroy();
@@ -1127,7 +1130,7 @@ class vr extends oe {
1127
1130
  async getCurrentVersion(t) {
1128
1131
  try {
1129
1132
  const r = m.join(this.targetDir, t, "version.txt");
1130
- return await P.readFile(r, "utf-8");
1133
+ return await S.readFile(r, "utf-8");
1131
1134
  } catch {
1132
1135
  return null;
1133
1136
  }
@@ -1144,20 +1147,20 @@ class vr extends oe {
1144
1147
  this.logger.sentryError("Invalid VITE_BUILD_CHANNEL");
1145
1148
  return;
1146
1149
  }
1147
- await (Z == null ? void 0 : Z());
1148
- for (const n of t)
1150
+ await (ee == null ? void 0 : ee());
1151
+ for (const s of t)
1149
1152
  try {
1150
- const { data: a } = await ur(n, r), o = await this.getCurrentVersion(n);
1151
- this.logger.log(`${n} > Update Check. current: ${o}, latest: ${a}`);
1153
+ const { data: a } = await hr(s, r), o = await this.getCurrentVersion(s);
1154
+ this.logger.log(`${s} > Update Check. current: ${o}, latest: ${a}`);
1152
1155
  const i = a !== o;
1153
- this.logger.log(`${n} > Update found: ${o} -> ${a}`), await this.downloadAndExtractDll(n, a, r, i), this.logger.log(`${n} > Downloaded and extracted`), i && (this.logger.log(`${n} > Cleaning up versions older than ${a}`), await this.cleanupOldVersions(n, a)), this.emit("dllUpdated", { identifier: n, version: a });
1156
+ this.logger.log(`${s} > Update found: ${o} -> ${a}`), await this.downloadAndExtractDll(s, a, r, i), this.logger.log(`${s} > Downloaded and extracted`), i && (this.logger.log(`${s} > Cleaning up versions older than ${a}`), await this.cleanupOldVersions(s, a)), this.emit("dllUpdated", { identifier: s, version: a });
1154
1157
  } catch (a) {
1155
- this.logger.captureSentryException(`${n} > Error checking/updating`, a);
1158
+ this.logger.captureSentryException(`${s} > Error checking/updating`, a);
1156
1159
  }
1157
1160
  }
1158
- async downloadAndExtractDll(t, r, n, a) {
1159
- const { data: o } = await hr(t, n), i = this.getTargetPath(t), l = this.getTargetVersionPath(t, r);
1160
- await P.mkdir(l, { recursive: !0 });
1161
+ async downloadAndExtractDll(t, r, s, a) {
1162
+ const { data: o } = await dr(t, s), i = this.getTargetPath(t), l = this.getTargetVersionPath(t, r);
1163
+ await S.mkdir(l, { recursive: !0 });
1161
1164
  const h = new He();
1162
1165
  await h.loadAsync(o);
1163
1166
  const g = Object.keys(h.files).map(async (p) => {
@@ -1166,27 +1169,27 @@ class vr extends oe {
1166
1169
  const d = m.join(l, p);
1167
1170
  if (!a)
1168
1171
  try {
1169
- await P.access(d, P.constants.F_OK);
1172
+ await S.access(d, S.constants.F_OK);
1170
1173
  return;
1171
1174
  } catch {
1172
1175
  this.logger.warn(`${t} > File missing, re-downloading: ${d}`);
1173
1176
  }
1174
1177
  const b = await u.async("nodebuffer");
1175
- await P.writeFile(d, b);
1178
+ await S.writeFile(d, b);
1176
1179
  }
1177
1180
  });
1178
1181
  await Promise.all(g);
1179
1182
  const f = m.join(i, "version.txt");
1180
- this.logger.log("Saving version file", f), await P.writeFile(f, r);
1183
+ this.logger.log("Saving version file", f), await S.writeFile(f, r);
1181
1184
  }
1182
1185
  async cleanupOldVersions(t, r) {
1183
- const n = m.join(this.targetDir, t), a = await P.readdir(n, { withFileTypes: !0 });
1186
+ const s = m.join(this.targetDir, t), a = await S.readdir(s, { withFileTypes: !0 });
1184
1187
  for (const o of a)
1185
- o.isDirectory() && o.name !== r && await P.rm(m.join(n, o.name), { recursive: !0, force: !0 });
1188
+ o.isDirectory() && o.name !== r && await S.rm(m.join(s, o.name), { recursive: !0, force: !0 });
1186
1189
  }
1187
1190
  }
1188
- const ne = L(vr);
1189
- class wr extends oe {
1191
+ const ie = L(wr);
1192
+ class Er extends le {
1190
1193
  constructor() {
1191
1194
  super("RavenManager");
1192
1195
  c(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
@@ -1212,31 +1215,31 @@ class wr extends oe {
1212
1215
  return this._executableToGameMap;
1213
1216
  }
1214
1217
  destroy() {
1215
- this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), ne.getInstance().destroy(), super.destroy();
1218
+ this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), ie.getInstance().destroy(), super.destroy();
1216
1219
  }
1217
1220
  async fetchRavenConfig() {
1218
1221
  try {
1219
1222
  const r = {
1220
1223
  games: [
1221
- ...(await dr()).data.games,
1224
+ ...(await gr()).data.games,
1222
1225
  {
1223
1226
  name: "Valorant",
1224
- identifier: gr("valorant"),
1227
+ identifier: fr("valorant"),
1225
1228
  executables: ["VALORANT-Win64-Shipping.exe"],
1226
1229
  modules: []
1227
1230
  }
1228
1231
  ]
1229
1232
  };
1230
1233
  this._ravenConfig = r, this.resetState();
1231
- const n = /* @__PURE__ */ new Set();
1234
+ const s = /* @__PURE__ */ new Set();
1232
1235
  for (const a of this._ravenConfig.games) {
1233
1236
  for (const o of a.executables) {
1234
1237
  const i = o.toLowerCase();
1235
1238
  this._executableToGameMap.set(i, a), this._executablesArray.push(i);
1236
1239
  }
1237
- a.modules.forEach((o) => n.add(o));
1240
+ a.modules.forEach((o) => s.add(o));
1238
1241
  }
1239
- await ne.getInstance().initWithDlls(Array.from(n)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1242
+ await ie.getInstance().initWithDlls(Array.from(s)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1240
1243
  } catch (t) {
1241
1244
  this.logger.captureSentryException("Failed to fetch Raven config", t), this._failedRefetchTimeoutHandler = setTimeout(() => this.fetchRavenConfig(), this.FAILED_REFETCH_INTERVAL);
1242
1245
  }
@@ -1245,23 +1248,23 @@ class wr extends oe {
1245
1248
  this._executableToGameMap.clear(), this._executablesArray = [];
1246
1249
  }
1247
1250
  }
1248
- const H = L(wr), Er = ie(import.meta.url), {
1249
- PipeEventServer: Cs,
1250
- PipeEventClient: Ls,
1251
- PipeEventBase: Ds,
1252
- ProcessMonitor: Ir,
1253
- Process: q,
1254
- InjectionMethod: Ms,
1255
- AccessLevel: As,
1251
+ const H = L(Er), Ir = ae(import.meta.url), {
1252
+ PipeEventServer: Mn,
1253
+ PipeEventClient: On,
1254
+ PipeEventBase: Kn,
1255
+ ProcessMonitor: kr,
1256
+ Process: Q,
1257
+ InjectionMethod: Rn,
1258
+ AccessLevel: Fn,
1256
1259
  HardwareInterface: lt
1257
- } = Er("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1258
- class kr extends oe {
1260
+ } = Ir("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1261
+ class _r extends le {
1259
1262
  constructor() {
1260
1263
  super("ProcessManager");
1261
1264
  c(this, "_processMonitor");
1262
1265
  c(this, "_processes", /* @__PURE__ */ new Map());
1263
1266
  c(this, "boundOnRavenManagerExecutablesUpdated", this.onRavenManagerExecutablesUpdated.bind(this));
1264
- this._processMonitor = new Ir();
1267
+ this._processMonitor = new kr();
1265
1268
  }
1266
1269
  get hasAnyActiveProcesses() {
1267
1270
  return this.activeProcesses.length > 0;
@@ -1281,7 +1284,7 @@ class kr extends oe {
1281
1284
  }
1282
1285
  isProcessRunning(t) {
1283
1286
  const r = this._processes.get(t);
1284
- return (r == null ? void 0 : r.some((n) => !n.destroyedAt)) ?? !1;
1287
+ return (r == null ? void 0 : r.some((s) => !s.destroyedAt)) ?? !1;
1285
1288
  }
1286
1289
  onRavenManagerExecutablesUpdated(t) {
1287
1290
  t.executables.forEach((r) => {
@@ -1301,15 +1304,15 @@ class kr extends oe {
1301
1304
  deleteProcess(t) {
1302
1305
  if (!t.name)
1303
1306
  return;
1304
- const r = this._processes.get(t.name), n = (r == null ? void 0 : r.filter((a) => a.id !== t.id)) ?? [];
1305
- n.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, n);
1307
+ const r = this._processes.get(t.name), s = (r == null ? void 0 : r.filter((a) => a.id !== t.id)) ?? [];
1308
+ s.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, s);
1306
1309
  }
1307
1310
  }
1308
- const O = L(kr), _r = ie(import.meta.url), { RenderInterface: Sr, renderHookPath: Ks } = _r("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1309
- var Pr = Object.defineProperty, Cr = (s, e, t) => e in s ? Pr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, ee = (s, e, t) => Cr(s, typeof e != "symbol" ? e + "" : e, t);
1310
- let Lr = class {
1311
+ const K = L(_r), Pr = ae(import.meta.url), { RenderInterface: Sr, renderHookPath: $n } = Pr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1312
+ var Cr = Object.defineProperty, Lr = (n, e, t) => e in n ? Cr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, te = (n, e, t) => Lr(n, typeof e != "symbol" ? e + "" : e, t);
1313
+ let Dr = class {
1311
1314
  constructor(e) {
1312
- ee(this, "_instance"), ee(this, "_resolution"), ee(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
1315
+ te(this, "_instance"), te(this, "_resolution"), te(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
1313
1316
  }
1314
1317
  destroy() {
1315
1318
  this._instance.off("resolution", this.boundOnResolutionChanged);
@@ -1323,23 +1326,22 @@ let Lr = class {
1323
1326
  onResolutionChanged(e, t) {
1324
1327
  this._resolution = { width: e, height: t };
1325
1328
  }
1326
- };
1327
- class Dr {
1329
+ }, Ar = class {
1328
1330
  constructor() {
1329
- ee(this, "interfaces", {});
1331
+ te(this, "interfaces", {});
1330
1332
  }
1331
1333
  createInterface(e) {
1332
- return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new Lr(new Sr(e, { access: 1 })), this.interfaces[e]);
1334
+ return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new Dr(new Sr(e, { access: 1 })), this.interfaces[e]);
1333
1335
  }
1334
1336
  getInterface(e) {
1335
1337
  return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
1336
1338
  }
1337
- }
1338
- const B = L(Dr);
1339
- var Mr = Object.defineProperty, Ar = (s, e, t) => e in s ? Mr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, Q = (s, e, t) => Ar(s, typeof e != "symbol" ? e + "" : e, t);
1339
+ };
1340
+ const B = L(Ar);
1341
+ var Mr = Object.defineProperty, Or = (n, e, t) => e in n ? Mr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Y = (n, e, t) => Or(n, typeof e != "symbol" ? e + "" : e, t);
1340
1342
  class Kr {
1341
1343
  constructor(e) {
1342
- Q(this, "_clientId", null), Q(this, "_userId", null), Q(this, "options"), Q(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new Qe(), this.setupFlushInterval();
1344
+ Y(this, "_clientId", null), Y(this, "_userId", null), Y(this, "options"), Y(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new Qe(), this.setupFlushInterval();
1343
1345
  }
1344
1346
  set clientId(e) {
1345
1347
  this._clientId = e;
@@ -1347,25 +1349,37 @@ class Kr {
1347
1349
  set userId(e) {
1348
1350
  this._userId = e;
1349
1351
  }
1350
- track(e, t) {
1351
- this.eventQueue.add({ name: e, data: t, createdAt: (/* @__PURE__ */ new Date()).toISOString() });
1352
+ trackEvent(e, t) {
1353
+ this.track(e, t, "event");
1354
+ }
1355
+ trackLog(e, t) {
1356
+ this.track(e, t, "log");
1352
1357
  }
1353
1358
  flush() {
1354
- return Array.from(this.eventQueue.flush());
1359
+ const e = Array.from(this.eventQueue.flush()), t = e.filter((s) => s.type === "log"), r = e.filter((s) => s.type === "event").concat({
1360
+ type: "event",
1361
+ name: "ping",
1362
+ data: {},
1363
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
1364
+ });
1365
+ return t.length > 0, r.concat(t);
1355
1366
  }
1356
1367
  setupFlushInterval() {
1357
1368
  setInterval(() => {
1358
1369
  this.flush();
1359
1370
  }, this.options.batchIntervalSeconds * 1e3);
1360
1371
  }
1372
+ track(e, t, r) {
1373
+ this.eventQueue.add({ type: r, name: e, data: t, createdAt: (/* @__PURE__ */ new Date()).toISOString() });
1374
+ }
1361
1375
  resolveOptions(e) {
1362
1376
  return {
1363
1377
  batchIntervalSeconds: (e == null ? void 0 : e.batchIntervalSeconds) ?? 15
1364
1378
  };
1365
1379
  }
1366
1380
  }
1367
- const K = L(Kr), Or = ie(import.meta.url), Fr = Or.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1368
- class Rr extends Nt {
1381
+ const M = L(Kr), Rr = ae(import.meta.url), Fr = Rr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1382
+ class $r extends Nt {
1369
1383
  constructor() {
1370
1384
  super("GameLaunchManager");
1371
1385
  c(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
@@ -1376,10 +1390,10 @@ class Rr extends Nt {
1376
1390
  this.subscribedGames = new Set(t);
1377
1391
  }
1378
1392
  init() {
1379
- super.init(), B.getInstance().createInterface("OGG_SIEGE"), O.getInstance().on("create", this.boundOnProcessCreate), O.getInstance().on("destroy", this.boundOnProcessDestroy);
1393
+ super.init(), B.getInstance().createInterface("OGG_SIEGE"), K.getInstance().on("create", this.boundOnProcessCreate), K.getInstance().on("destroy", this.boundOnProcessDestroy);
1380
1394
  }
1381
1395
  destroy() {
1382
- O.getInstance().off("create", this.boundOnProcessCreate), O.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
1396
+ K.getInstance().off("create", this.boundOnProcessCreate), K.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
1383
1397
  }
1384
1398
  async onProcessCreate({ process: t }) {
1385
1399
  const r = this.getRavenGame(t);
@@ -1391,15 +1405,15 @@ class Rr extends Nt {
1391
1405
  }
1392
1406
  if (!this.subscribedGames.has(r.identifier) && !this.subscribedGames.has("*"))
1393
1407
  return;
1394
- const n = new AbortController();
1395
- if (await this.emit("gameLaunch", { game: r.identifier, reject: () => n.abort }), n.signal.aborted)
1408
+ const s = new AbortController();
1409
+ if (await this.emit("gameLaunch", { game: r.identifier, reject: () => s.abort }), s.signal.aborted)
1396
1410
  return;
1397
- if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", q.currentProcess.isElevated), t.isElevated && !q.currentProcess.isElevated) {
1411
+ if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", Q.currentProcess.isElevated), t.isElevated && !Q.currentProcess.isElevated) {
1398
1412
  C.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
1399
- appElevated: !!q.currentProcess.isElevated,
1413
+ appElevated: !!Q.currentProcess.isElevated,
1400
1414
  gameElevated: !!t.isElevated
1401
1415
  }), this.logger.sentryLog("Game elevated but App is not", {
1402
- appElevated: q.currentProcess.isElevated,
1416
+ appElevated: Q.currentProcess.isElevated,
1403
1417
  gameElevated: t.isElevated
1404
1418
  });
1405
1419
  return;
@@ -1414,10 +1428,10 @@ class Rr extends Nt {
1414
1428
  });
1415
1429
  }
1416
1430
  const o = r == null ? void 0 : r.modules.map(async (i) => {
1417
- const l = await ne.getInstance().getCurrentVersion(i);
1431
+ const l = await ie.getInstance().getCurrentVersion(i);
1418
1432
  if (!l)
1419
1433
  return this.logger.sentryError("No version found for DLL", { identifier: i }), Promise.resolve();
1420
- const h = ne.getInstance().getTargetVersionPath(i, l);
1434
+ const h = ie.getInstance().getTargetVersionPath(i, l);
1421
1435
  this.logger.log("DLL Path", h);
1422
1436
  const g = await this.getDllFiles(h);
1423
1437
  return this.logger.log("DLL Files", g), Promise.all(
@@ -1438,32 +1452,32 @@ class Rr extends Nt {
1438
1452
  })
1439
1453
  );
1440
1454
  });
1441
- await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), K.getInstance().track("game_launch", {
1455
+ await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), M.getInstance().trackEvent("game_launch", {
1442
1456
  game: r.identifier
1443
1457
  });
1444
1458
  }
1445
1459
  copyDll(t) {
1446
- const r = m.basename(t), n = gt(t), a = m.join(Pe(), "resources"), o = m.join(a, r);
1447
- this.logger.debug("Copying", n, "to", o);
1460
+ const r = m.basename(t), s = gt(t), a = m.join(Se(), "resources"), o = m.join(a, r);
1461
+ this.logger.debug("Copying", s, "to", o);
1448
1462
  try {
1449
1463
  ve(a) || be(a, { recursive: !0 });
1450
- const i = ze(n);
1451
- we(o, i), dt(n, o);
1464
+ const i = ze(s);
1465
+ we(o, i), dt(s, o);
1452
1466
  } catch (i) {
1453
- return i.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", i), this.logger.sentryError("Failed to copy", { originalPath: n, targetPath: o }), !1);
1467
+ return i.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", i), this.logger.sentryError("Failed to copy", { originalPath: s, targetPath: o }), !1);
1454
1468
  }
1455
1469
  return o;
1456
1470
  }
1457
1471
  async getDllFiles(t) {
1458
1472
  try {
1459
- return (await P.readdir(t)).filter((n) => n.endsWith(".dll")).map((n) => m.join(t, n));
1473
+ return (await S.readdir(t)).filter((s) => s.endsWith(".dll")).map((s) => m.join(t, s));
1460
1474
  } catch (r) {
1461
1475
  return this.logger.captureSentryException("Failed to read DLL directory", r), this.logger.sentryError("Failed to read DLL directory", { dllPath: t }), [];
1462
1476
  }
1463
1477
  }
1464
1478
  onProcessDestroy({ process: t }) {
1465
1479
  const r = this.getRavenGame(t);
1466
- r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }), K.getInstance().track("game_close", {
1480
+ r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }), M.getInstance().trackEvent("game_close", {
1467
1481
  game: r.identifier
1468
1482
  }));
1469
1483
  }
@@ -1478,8 +1492,8 @@ class Rr extends Nt {
1478
1492
  return r;
1479
1493
  }
1480
1494
  }
1481
- const G = L(Rr);
1482
- class $r extends Je {
1495
+ const G = L($r);
1496
+ class xr extends Ye {
1483
1497
  constructor() {
1484
1498
  super("GameBuildManager");
1485
1499
  c(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
@@ -1491,20 +1505,20 @@ class $r extends Je {
1491
1505
  G.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
1492
1506
  }
1493
1507
  async onGameLaunch(...t) {
1494
- const [{ ravenGame: r, process: n }] = t;
1495
- if (!n.path || !n.name) {
1508
+ const [{ ravenGame: r, process: s }] = t;
1509
+ if (!s.path || !s.name) {
1496
1510
  this.logger.sentryError(
1497
1511
  "Process path or name not found, could not check for build hash",
1498
1512
  void 0,
1499
- n
1513
+ s
1500
1514
  );
1501
1515
  return;
1502
1516
  }
1503
- const a = ze(n.path), o = ft("sha256").update(a).digest("hex");
1504
- this.logger.log("Process Path", n.path), this.logger.log("Process Name", n.name), this.logger.log("Build Hash", o);
1517
+ const a = ze(s.path), o = ft("sha256").update(a).digest("hex");
1518
+ this.logger.log("Process Path", s.path), this.logger.log("Process Name", s.name), this.logger.log("Build Hash", o);
1505
1519
  let i = !1;
1506
1520
  try {
1507
- i = (await fr(r.identifier, o)).data.upload;
1521
+ i = (await pr(r.identifier, o)).data.upload;
1508
1522
  } catch (g) {
1509
1523
  this.logger.captureSentryException("Error checking game build hash", g);
1510
1524
  return;
@@ -1514,20 +1528,20 @@ class $r extends Je {
1514
1528
  return;
1515
1529
  }
1516
1530
  const l = new He();
1517
- l.file(n.name, a);
1531
+ l.file(s.name, a);
1518
1532
  const h = await l.generateAsync({ type: "blob" });
1519
1533
  try {
1520
1534
  this.logger.log("Uploading build (size: ", h.size, " bytes)");
1521
1535
  const g = new Tt(h, {
1522
1536
  chunkSizeMb: 25,
1523
1537
  maxConcurrent: 1
1524
- }), f = await pr(r.identifier, {
1538
+ }), f = await yr(r.identifier, {
1525
1539
  build_hash: o,
1526
1540
  chunk_count: g.totalChunks,
1527
1541
  file_size_bytes: h.size
1528
1542
  });
1529
1543
  await g.chunk(async (p, u) => {
1530
- this.logger.log("Uploading chunk", u), await yr(r.identifier, {
1544
+ this.logger.log("Uploading chunk", u), await mr(r.identifier, {
1531
1545
  chunk: p,
1532
1546
  build_hash: o,
1533
1547
  chunk_index: u,
@@ -1535,15 +1549,15 @@ class $r extends Je {
1535
1549
  });
1536
1550
  }), this.logger.log("Build uploaded successfully");
1537
1551
  } catch (g) {
1538
- mr(g) ? br(g.response) ? this.logger.captureSentryException("Error uploading build hash, api error", g) : this.logger.captureSentryException("Error uploading build hash, request error", g) : this.logger.captureSentryException("Error uploading build hash, unknown error", g);
1552
+ br(g) ? vr(g.response) ? this.logger.captureSentryException("Error uploading build hash, api error", g) : this.logger.captureSentryException("Error uploading build hash, request error", g) : this.logger.captureSentryException("Error uploading build hash, unknown error", g);
1539
1553
  }
1540
1554
  }
1541
1555
  }
1542
- const ct = L($r);
1543
- function xr(s = []) {
1544
- return m.normalize(m.join(qe(global.OVERLAYED.APP_NAME), ...s));
1556
+ const ct = L(xr);
1557
+ function Tr(n = []) {
1558
+ return m.normalize(m.join(qe(global.OVERLAYED.APPLICATION_ID), ...n));
1545
1559
  }
1546
- const Tr = F({
1560
+ const Nr = R({
1547
1561
  game: "string",
1548
1562
  type: "string",
1549
1563
  creation_time: "number"
@@ -1740,13 +1754,13 @@ const Tr = F({
1740
1754
  [252, "Noname"],
1741
1755
  [253, "PA1"],
1742
1756
  [254, "OEM_Clear"]
1743
- ]), Ne = new Map(me.entries().map(([s, e]) => [e, s])), Nr = F({
1757
+ ]), Ne = new Map(me.entries().map(([n, e]) => [e, n])), Br = R({
1744
1758
  "[string]": {
1745
1759
  keys: "string[]",
1746
- mode: F("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
1760
+ mode: R("'toggle' | 'hold'").pipe((n) => n ?? "toggle")
1747
1761
  }
1748
1762
  });
1749
- class Br extends oe {
1763
+ class Gr extends le {
1750
1764
  constructor(t) {
1751
1765
  super("KeybindManager");
1752
1766
  c(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
@@ -1759,9 +1773,9 @@ class Br extends oe {
1759
1773
  c(this, "keybindsFile");
1760
1774
  // TODO try to figure out a better way to handle this
1761
1775
  c(this, "keybindListeningPaused", !1);
1762
- this.keybindsFile = new Ot({
1763
- path: xr(["keybinds.json"]),
1764
- schema: Nr,
1776
+ this.keybindsFile = new Kt({
1777
+ path: Tr(["keybinds.json"]),
1778
+ schema: Br,
1765
1779
  default: t
1766
1780
  });
1767
1781
  }
@@ -1772,16 +1786,16 @@ class Br extends oe {
1772
1786
  }
1773
1787
  // TODO support multiple callbacks
1774
1788
  async onKeybindToggled(t, r) {
1775
- const n = this.preferencesKeybindToCallbacks.get(t) || {};
1776
- n.toggle = r, this.preferencesKeybindToCallbacks.set(t, n);
1789
+ const s = this.preferencesKeybindToCallbacks.get(t) || {};
1790
+ s.toggle = r, this.preferencesKeybindToCallbacks.set(t, s);
1777
1791
  }
1778
1792
  async onKeybindDown(t, r) {
1779
- const n = this.preferencesKeybindToCallbacks.get(t) || {};
1780
- n.down = r, this.preferencesKeybindToCallbacks.set(t, n);
1793
+ const s = this.preferencesKeybindToCallbacks.get(t) || {};
1794
+ s.down = r, this.preferencesKeybindToCallbacks.set(t, s);
1781
1795
  }
1782
1796
  async onKeybindUp(t, r) {
1783
- const n = this.preferencesKeybindToCallbacks.get(t) || {};
1784
- n.up = r, this.preferencesKeybindToCallbacks.set(t, n);
1797
+ const s = this.preferencesKeybindToCallbacks.get(t) || {};
1798
+ s.up = r, this.preferencesKeybindToCallbacks.set(t, s);
1785
1799
  }
1786
1800
  async updateKeybind(t, r) {
1787
1801
  this.keybindsFile.set({
@@ -1790,7 +1804,7 @@ class Br extends oe {
1790
1804
  }
1791
1805
  async updateKeybinds(t) {
1792
1806
  const r = Object.fromEntries(
1793
- Object.entries(t).filter(([n, a]) => a !== void 0)
1807
+ Object.entries(t).filter(([s, a]) => a !== void 0)
1794
1808
  );
1795
1809
  this.keybindsFile.set({
1796
1810
  ...this.keybindsFile.get(),
@@ -1824,52 +1838,52 @@ class Br extends oe {
1824
1838
  if (!r)
1825
1839
  return;
1826
1840
  this.pressedKeys.delete(r);
1827
- const n = this.keybindsFile.get();
1841
+ const s = this.keybindsFile.get();
1828
1842
  for (const [a] of this.preferencesKeybindToCallbacks.entries())
1829
- n[a].keys.includes(r) && this.triggeredToggleKeybinds.delete(a);
1843
+ s[a].keys.includes(r) && this.triggeredToggleKeybinds.delete(a);
1830
1844
  this.checkKeybindUps();
1831
1845
  }
1832
1846
  async checkKeybindUps() {
1833
1847
  const t = this.keybindsFile.get();
1834
- for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1835
- if (!n.up) continue;
1848
+ for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
1849
+ if (!s.up) continue;
1836
1850
  const a = t[r];
1837
- this.activeKeybinds.has(r) && a.keys.some((o) => !this.pressedKeys.has(o)) && (this.activeKeybinds.delete(r), n.up(), this.logger.log("Keybind up triggered", this.getKeybindToString(a)));
1851
+ this.activeKeybinds.has(r) && a.keys.some((o) => !this.pressedKeys.has(o)) && (this.activeKeybinds.delete(r), s.up(), this.logger.log("Keybind up triggered", this.getKeybindToString(a)));
1838
1852
  }
1839
1853
  }
1840
1854
  async checkKeybindings() {
1841
1855
  const t = this.keybindsFile.get();
1842
- for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1856
+ for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
1843
1857
  const a = t[r];
1844
1858
  if (a.keys.length === this.pressedKeys.size && a.keys.every((i) => Ne.has(i) ? this.pressedKeys.has(i) : !1)) {
1845
- this.triggerKeybind(a, n, r);
1859
+ this.triggerKeybind(a, s, r);
1846
1860
  return;
1847
1861
  }
1848
1862
  }
1849
- for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1863
+ for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
1850
1864
  const a = t[r];
1851
- a.keys.every((i) => Ne.has(i) ? this.pressedKeys.has(i) : (this.logger.error("Unknown key", i, a), !1)) && this.triggerKeybind(a, n, r);
1865
+ a.keys.every((i) => Ne.has(i) ? this.pressedKeys.has(i) : (this.logger.error("Unknown key", i, a), !1)) && this.triggerKeybind(a, s, r);
1852
1866
  }
1853
1867
  }
1854
- triggerKeybind(t, r, n) {
1868
+ triggerKeybind(t, r, s) {
1855
1869
  const a = t.mode;
1856
- if (a === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(n)) {
1870
+ if (a === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(s)) {
1857
1871
  const o = r.toggle();
1858
- this.triggeredToggleKeybinds.add(n), this.logger.log(
1872
+ this.triggeredToggleKeybinds.add(s), this.logger.log(
1859
1873
  o ? `Keybind pressed rejected: ${o}` : "Keybind pressed accepted",
1860
1874
  this.getKeybindToString(t)
1861
1875
  );
1862
1876
  }
1863
- if (a === "hold" && r.down && !this.activeKeybinds.has(n)) {
1877
+ if (a === "hold" && r.down && !this.activeKeybinds.has(s)) {
1864
1878
  const o = r.down();
1865
- o ? this.logger.log(`Keybind down rejected: ${o}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(n), this.logger.log("Keybind down accepted", this.getKeybindToString(t)));
1879
+ o ? this.logger.log(`Keybind down rejected: ${o}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(s), this.logger.log("Keybind down accepted", this.getKeybindToString(t)));
1866
1880
  }
1867
1881
  }
1868
1882
  getKeybindToString(t) {
1869
1883
  return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
1870
1884
  }
1871
1885
  }
1872
- class Gr extends Je {
1886
+ class jr extends Ye {
1873
1887
  constructor(t) {
1874
1888
  super("OverridesManager");
1875
1889
  c(this, "renderInterface");
@@ -1884,7 +1898,7 @@ class Gr extends Je {
1884
1898
  setGlobalCursorOverride: (r) => this.setGlobalCursorOverride(t, r),
1885
1899
  setGlobalMouseBlock: (r) => this.setGlobalMouseBlock(t, r),
1886
1900
  setGlobalKeyboardBlock: (r) => this.setGlobalKeyboardBlock(t, r),
1887
- setKeyInputBlock: (r, n) => this.setKeyInputBlock(t, r, n)
1901
+ setKeyInputBlock: (r, s) => this.setKeyInputBlock(t, r, s)
1888
1902
  };
1889
1903
  }
1890
1904
  setGlobalCursorOverride(t, r) {
@@ -1896,16 +1910,16 @@ class Gr extends Je {
1896
1910
  setGlobalKeyboardBlock(t, r) {
1897
1911
  r ? this.globalKeyboardBlockCount.add(t) : this.globalKeyboardBlockCount.delete(t), r && this.globalKeyboardBlockCount.size === 1 ? this.renderInterface.instance.setGlobalKeyboardBlock(!0) : !r && this.globalKeyboardBlockCount.size === 0 && this.renderInterface.instance.setGlobalKeyboardBlock(!1);
1898
1912
  }
1899
- setKeyInputBlock(t, r, n) {
1900
- this.keyInputBlocks[r] || (this.keyInputBlocks[r] = /* @__PURE__ */ new Set()), n ? this.keyInputBlocks[r].add(t) : this.keyInputBlocks[r].delete(t), n && this.keyInputBlocks[r].size === 1 ? this.renderInterface.instance.setKeyInputBlock(r, !0) : !n && this.keyInputBlocks[r].size === 0 && this.renderInterface.instance.setKeyInputBlock(r, !1);
1913
+ setKeyInputBlock(t, r, s) {
1914
+ this.keyInputBlocks[r] || (this.keyInputBlocks[r] = /* @__PURE__ */ new Set()), s ? this.keyInputBlocks[r].add(t) : this.keyInputBlocks[r].delete(t), s && this.keyInputBlocks[r].size === 1 ? this.renderInterface.instance.setKeyInputBlock(r, !0) : !s && this.keyInputBlocks[r].size === 0 && this.renderInterface.instance.setKeyInputBlock(r, !1);
1901
1915
  }
1902
1916
  }
1903
- const jr = L(Gr, "OGG_SIEGE");
1917
+ const Ur = L(jr, "OGG_SIEGE");
1904
1918
  var he, Be;
1905
- function Ur() {
1919
+ function zr() {
1906
1920
  if (Be) return he;
1907
1921
  Be = 1;
1908
- var s = (o, i) => () => (i || o((i = { exports: {} }).exports, i), i.exports), e = s((o, i) => {
1922
+ var n = (o, i) => () => (i || o((i = { exports: {} }).exports, i), i.exports), e = n((o, i) => {
1909
1923
  var l = /* @__PURE__ */ new Set(["mouseDown", "mouseUp", "pointerDown", "pointerUp"]), h = /* @__PURE__ */ new WeakSet();
1910
1924
  function g(f, p, { allowHosts: u } = {}) {
1911
1925
  let { shell: d } = p;
@@ -1913,16 +1927,16 @@ function Ur() {
1913
1927
  h.add(f);
1914
1928
  let b = f.webContents;
1915
1929
  function k(y) {
1916
- return !!(!S(y) || u != null && u.includes(y.host));
1930
+ return !!(!P(y) || u != null && u.includes(y.host));
1917
1931
  }
1918
- function S(y) {
1932
+ function P(y) {
1919
1933
  return new URL(b.getURL()).origin !== y.origin;
1920
1934
  }
1921
1935
  let D = 0;
1922
1936
  function v() {
1923
1937
  D = Date.now();
1924
1938
  }
1925
- function V() {
1939
+ function W() {
1926
1940
  let y = Date.now() - D, I = y < 150;
1927
1941
  return I || console.warn("was not recently active", y), I;
1928
1942
  }
@@ -1935,13 +1949,13 @@ function Ur() {
1935
1949
  }), b.on("will-navigate", (y, I) => {
1936
1950
  let _ = y.url || I;
1937
1951
  if (console.log("will-navigate", _), !_) return;
1938
- let Ke = new URL(_);
1939
- if (!k(Ke)) {
1940
- if (!V()) {
1952
+ let Oe = new URL(_);
1953
+ if (!k(Oe)) {
1954
+ if (!W()) {
1941
1955
  console.log("blocked navigation", _), y.preventDefault();
1942
1956
  return;
1943
1957
  }
1944
- S(Ke) && (console.log("external navigation", _), y.preventDefault(), d.openExternal(_));
1958
+ P(Oe) && (console.log("external navigation", _), y.preventDefault(), d.openExternal(_));
1945
1959
  }
1946
1960
  }), b.session.on("will-download", (y, I) => {
1947
1961
  let _ = I.getURL();
@@ -1949,11 +1963,11 @@ function Ur() {
1949
1963
  }), b.setWindowOpenHandler((y) => {
1950
1964
  console.log("window-open", y.url);
1951
1965
  let { url: I } = y, _ = new URL(I);
1952
- if (!k(_)) return V() ? (S(_) && d.openExternal(y.url), { action: "deny" }) : (console.log("blocked navigation", I), { action: "deny" });
1966
+ if (!k(_)) return W() ? (P(_) && d.openExternal(y.url), { action: "deny" }) : (console.log("blocked navigation", I), { action: "deny" });
1953
1967
  });
1954
1968
  }
1955
1969
  i.exports = g;
1956
- }), t = s((o, i) => {
1970
+ }), t = n((o, i) => {
1957
1971
  var l = /* @__PURE__ */ new Set(["Mozilla", "AppleWebKit", "Chrome", "Safari", "Gecko", "Firefox", "OPR", "Edg", "Version", "Mobile", "curl", "PostmanRuntime"]);
1958
1972
  async function h(g, f, p) {
1959
1973
  let { webContents: u } = g, d = await u.executeJavaScript("navigator.userAgent");
@@ -1963,42 +1977,43 @@ function Ur() {
1963
1977
  }).join(" "), u.setUserAgent(d), f.app.userAgentFallback = d;
1964
1978
  }
1965
1979
  i.exports = h;
1966
- }), r = e(), n = t();
1980
+ }), r = e(), s = t();
1967
1981
  function a(o, i, l = {}) {
1968
- r(o, i, l.linkHandler), n(o, i, l.userAgent);
1982
+ r(o, i, l.linkHandler), s(o, i, l.userAgent);
1969
1983
  }
1970
- return he = { setupRevUtils: a, setupLinkHandler: r, setUserAgent: n }, he;
1984
+ return he = { setupRevUtils: a, setupLinkHandler: r, setUserAgent: s }, he;
1971
1985
  }
1972
- var zr = Ur();
1973
- let J = !1, Y;
1974
- function Fs(s) {
1975
- const { init: e = !0 } = s;
1976
- if (Hr(s), ae.getInstance().init(s.appName), J)
1977
- return Y;
1986
+ var Hr = zr();
1987
+ let J = !1, X;
1988
+ function Nn(n) {
1989
+ const { init: e = !0 } = n;
1990
+ if (Vr(n), oe.getInstance().init(n.applicationId), J)
1991
+ return X;
1978
1992
  function t() {
1979
- ts(s);
1980
- const r = /* @__PURE__ */ new Map(), n = qr(s.modules, r), a = Qr(), o = Yr(s.keybinds), i = Xr(), l = Zr(), h = es();
1981
- Vr(s), Jr(s, r), J = !0, Y = {
1982
- ...n,
1993
+ nn(n);
1994
+ const r = /* @__PURE__ */ new Map(), s = Qr(n.modules, r), a = Yr(), o = Xr(n.keybinds), i = Zr(), l = en(), h = rn(), g = tn();
1995
+ Wr(n), Jr(n, r), J = !0, X = {
1996
+ ...s,
1983
1997
  ...a,
1984
1998
  ads: h,
1985
1999
  keybinds: o,
1986
2000
  windows: i,
1987
2001
  input: l,
1988
- hasAnyActiveProcesses: () => O.getInstance().hasAnyActiveProcesses,
2002
+ cortex: g,
2003
+ hasAnyActiveProcesses: () => K.getInstance().hasAnyActiveProcesses,
1989
2004
  init: t,
1990
2005
  initialized: J
1991
2006
  };
1992
2007
  }
1993
- return e ? (t(), Y) : new Proxy(
2008
+ return e ? (t(), X) : new Proxy(
1994
2009
  {
1995
2010
  init: t
1996
2011
  },
1997
2012
  {
1998
- get: (r, n) => {
1999
- if (n !== "init" && !J)
2000
- throw new Error(`overlayed was called before initialized: ${n}`);
2001
- return n === "init" ? r[n] : Y[n];
2013
+ get: (r, s) => {
2014
+ if (s !== "init" && !J)
2015
+ throw new Error(`overlayed was called before initialized: ${s}`);
2016
+ return s === "init" ? r[s] : X[s];
2002
2017
  }
2003
2018
  }
2004
2019
  );
@@ -2008,64 +2023,66 @@ global.OVERLAYED = new Proxy({}, {
2008
2023
  throw new Error("function overlayed was not called");
2009
2024
  }
2010
2025
  });
2011
- function Hr(s) {
2026
+ function Vr(n) {
2012
2027
  global.OVERLAYED = {
2013
- APP_NAME: s.appName,
2014
- APP_BUILD_CHANNEL: s.channel ?? "alpha",
2015
- electron: s.electron
2028
+ APPLICATION_ID: n.applicationId,
2029
+ APP_BUILD_CHANNEL: n.channel ?? "alpha",
2030
+ electron: n.electron
2016
2031
  };
2017
2032
  }
2018
- function Vr(s) {
2019
- const e = s.universal ? ["*"] : s.modules.map((t) => t.key);
2020
- G.getInstance().setSubscribedGames(e), ct.getInstance().init(), G.getInstance().init(), O.getInstance().init(), H.getInstance().init(), global.OVERLAYED.electron.contextBridge.exposeInMainWorld("overlayed", {
2021
- appSlug: "TODO",
2033
+ function Wr(n) {
2034
+ const e = n.universal ? ["*"] : n.modules.map((r) => r.key);
2035
+ G.getInstance().setSubscribedGames(e), ct.getInstance().init(), G.getInstance().init(), K.getInstance().init(), H.getInstance().init();
2036
+ let t;
2037
+ global.OVERLAYED.electron.ipcMain.handle("getAppInfo", async () => t || (t = ur(global.OVERLAYED.APPLICATION_ID).then((s) => s.data), {
2038
+ ...await t,
2022
2039
  userId: lt.generateUniqueIdentifier()
2023
- }), Ve.on("quit", () => {
2024
- Wr();
2040
+ })), Ve.on("quit", () => {
2041
+ qr();
2025
2042
  });
2026
2043
  }
2027
- function Wr() {
2028
- H.getInstance().destroy(), G.getInstance().destroy(), ct.getInstance().destroy(), O.getInstance().destroy(), B.getInstance().getInterface("OGG_SIEGE").destroy(), ke.getInstance().destroy(), C.getInstance().destroy();
2044
+ function qr() {
2045
+ H.getInstance().destroy(), G.getInstance().destroy(), ct.getInstance().destroy(), K.getInstance().destroy(), B.getInstance().getInterface("OGG_SIEGE").destroy(), ke.getInstance().destroy(), C.getInstance().destroy();
2029
2046
  }
2030
- function qr(s, e) {
2031
- return s.reduce((t, r) => {
2032
- const n = r.key;
2033
- return t[n] = {
2047
+ function Qr(n, e) {
2048
+ return n.reduce((t, r) => {
2049
+ const s = r.key;
2050
+ return t[s] = {
2034
2051
  // prettier-ignore
2035
2052
  on(a, o) {
2036
- const i = $(n, a), l = e.get(i) ?? /* @__PURE__ */ new Set();
2053
+ const i = $(s, a), l = e.get(i) ?? /* @__PURE__ */ new Set();
2037
2054
  l.add(o), e.set(i, l);
2038
2055
  },
2039
2056
  onAny(a) {
2040
- const o = $(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
2057
+ const o = $(s, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
2041
2058
  i.add(a), e.set(o, i);
2042
2059
  },
2043
2060
  // prettier-ignore
2044
2061
  off(a, o) {
2045
- const i = $(n, a), l = e.get(i) ?? /* @__PURE__ */ new Set();
2062
+ const i = $(s, a), l = e.get(i) ?? /* @__PURE__ */ new Set();
2046
2063
  l.delete(o), e.set(i, l);
2047
2064
  },
2048
2065
  // prettier-ignore
2049
2066
  offAny(a) {
2050
- const o = $(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
2067
+ const o = $(s, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
2051
2068
  i.delete(a), e.set(o, i);
2052
2069
  }
2053
2070
  }, t;
2054
2071
  }, {});
2055
2072
  }
2056
- function Qr() {
2057
- const s = C.getInstance(), e = G.getInstance();
2073
+ function Yr() {
2074
+ const n = C.getInstance(), e = G.getInstance();
2058
2075
  return {
2059
2076
  on: (t, r) => {
2060
2077
  switch (t) {
2061
2078
  case "fatal":
2062
- s.on("fatal", r);
2079
+ n.on("fatal", r);
2063
2080
  break;
2064
2081
  case "error":
2065
- s.on("error", r);
2082
+ n.on("error", r);
2066
2083
  break;
2067
2084
  case "warning":
2068
- s.on("warning", r);
2085
+ n.on("warning", r);
2069
2086
  break;
2070
2087
  case "gameLaunch":
2071
2088
  e.on("gameLaunch", r);
@@ -2083,13 +2100,13 @@ function Qr() {
2083
2100
  off: (t, r) => {
2084
2101
  switch (t) {
2085
2102
  case "fatal":
2086
- s.off("fatal", r);
2103
+ n.off("fatal", r);
2087
2104
  break;
2088
2105
  case "error":
2089
- s.off("error", r);
2106
+ n.off("error", r);
2090
2107
  break;
2091
2108
  case "warning":
2092
- s.off("warning", r);
2109
+ n.off("warning", r);
2093
2110
  break;
2094
2111
  case "gameLaunch":
2095
2112
  e.off("gameLaunch", r);
@@ -2106,24 +2123,24 @@ function Qr() {
2106
2123
  }
2107
2124
  };
2108
2125
  }
2109
- function $(s, e) {
2110
- return `${s}:${e}`;
2126
+ function $(n, e) {
2127
+ return `${n}:${e}`;
2111
2128
  }
2112
- function Jr(s, e) {
2129
+ function Jr(n, e) {
2113
2130
  const t = ke.getInstance();
2114
- function r(n) {
2115
- const a = Tr(n);
2116
- if (a instanceof F.errors) {
2131
+ function r(s) {
2132
+ const a = Nr(s);
2133
+ if (a instanceof R.errors) {
2117
2134
  C.getInstance().warn("Invalid event", "INVALID_EVENT", {
2118
2135
  summary: a.summary
2119
2136
  });
2120
2137
  return;
2121
2138
  }
2122
- const o = s.modules.find((d) => d.key === a.game), i = o == null ? void 0 : o.events.event;
2139
+ const o = n.modules.find((d) => d.key === a.game), i = o == null ? void 0 : o.events.event;
2123
2140
  if (!i)
2124
2141
  return;
2125
- const l = i(n);
2126
- if (l instanceof F.errors) {
2142
+ const l = i(s);
2143
+ if (l instanceof R.errors) {
2127
2144
  C.getInstance().warn("Invalid event", "INVALID_EVENT", {
2128
2145
  summary: l.summary
2129
2146
  });
@@ -2134,26 +2151,26 @@ function Jr(s, e) {
2134
2151
  d(l);
2135
2152
  });
2136
2153
  }
2137
- return t.on("data", (n) => n.forEach(r)), t.on("error", (n) => {
2154
+ return t.on("data", (s) => s.forEach(r)), t.on("error", (s) => {
2138
2155
  C.getInstance().error("Pipe server error", "PIPE_SERVER_ERROR", {
2139
- error: n
2156
+ error: s
2140
2157
  });
2141
2158
  }), t;
2142
2159
  }
2143
- function Yr(s) {
2144
- const e = new Br(s), t = {};
2145
- for (const n in s)
2146
- t[n] = {
2160
+ function Xr(n) {
2161
+ const e = new Gr(n), t = {};
2162
+ for (const s in n)
2163
+ t[s] = {
2147
2164
  on: (a, o) => {
2148
2165
  switch (a) {
2149
2166
  case "down":
2150
- e.onKeybindDown(n, o);
2167
+ e.onKeybindDown(s, o);
2151
2168
  break;
2152
2169
  case "up":
2153
- e.onKeybindUp(n, o);
2170
+ e.onKeybindUp(s, o);
2154
2171
  break;
2155
2172
  case "toggle":
2156
- e.onKeybindToggled(n, o);
2173
+ e.onKeybindToggled(s, o);
2157
2174
  break;
2158
2175
  default:
2159
2176
  throw new Error(`Event type not implemented ${a}`, { cause: [a, o] });
@@ -2169,74 +2186,80 @@ function Yr(s) {
2169
2186
  resumeKeybindListening: () => {
2170
2187
  e.keybindListeningPaused = !1;
2171
2188
  },
2172
- updateKeybind: (n, a) => {
2173
- e.updateKeybind(n, a);
2189
+ updateKeybind: (s, a) => {
2190
+ e.updateKeybind(s, a);
2174
2191
  },
2175
- updateKeybinds: (n) => {
2176
- e.updateKeybinds(n);
2192
+ updateKeybinds: (s) => {
2193
+ e.updateKeybinds(s);
2177
2194
  }
2178
2195
  };
2179
2196
  return e.init(), Ve.on("quit", () => {
2180
2197
  e.destroy();
2181
2198
  }), r;
2182
2199
  }
2183
- function Xr() {
2200
+ function Zr() {
2184
2201
  return {
2185
- createWindow: (s) => w().instance.newWindowInternal(yt.BrowserWindow, s),
2186
- on: (s, e) => w().instance.on(s, e),
2187
- off: (s, e) => w().instance.off(s, e),
2188
- once: (s, e) => w().instance.once(s, e),
2189
- addListener: (s, e) => w().instance.addListener(s, e),
2190
- removeListener: (s, e) => w().instance.removeListener(s, e),
2202
+ createWindow: (n) => w().instance.newWindowInternal(yt.BrowserWindow, n),
2203
+ on: (n, e) => w().instance.on(n, e),
2204
+ off: (n, e) => w().instance.off(n, e),
2205
+ once: (n, e) => w().instance.once(n, e),
2206
+ addListener: (n, e) => w().instance.addListener(n, e),
2207
+ removeListener: (n, e) => w().instance.removeListener(n, e),
2191
2208
  removeAllListeners: () => w().instance.removeAllListeners(),
2192
- prependListener: (s, e) => w().instance.prependListener(s, e),
2193
- prependOnceListener: (s, e) => w().instance.prependOnceListener(s, e),
2209
+ prependListener: (n, e) => w().instance.prependListener(n, e),
2210
+ prependOnceListener: (n, e) => w().instance.prependOnceListener(n, e),
2194
2211
  getActiveGameInfo: () => {
2195
- const s = w(), e = ke.getInstance();
2212
+ const n = w(), e = ke.getInstance();
2196
2213
  return {
2197
- resolution: s.resolution,
2214
+ resolution: n.resolution,
2198
2215
  isConnected: e.hasConnection
2199
2216
  };
2200
2217
  }
2201
2218
  };
2202
2219
  }
2203
- function Zr() {
2220
+ function en() {
2204
2221
  return {
2205
- scope: (s) => jr.getInstance().scope(s),
2222
+ scope: (n) => Ur.getInstance().scope(n),
2206
2223
  raw: {
2207
- setGlobalMouseBlock: (s) => w().instance.setGlobalMouseBlock(s),
2208
- setGlobalKeyboardBlock: (s) => w().instance.setGlobalKeyboardBlock(s),
2209
- setGlobalCursorOverride: (s) => w().instance.setGlobalCursorOverride(s),
2210
- setKeyInputBlock: (s, e) => w().instance.setKeyInputBlock(s, e),
2224
+ setGlobalMouseBlock: (n) => w().instance.setGlobalMouseBlock(n),
2225
+ setGlobalKeyboardBlock: (n) => w().instance.setGlobalKeyboardBlock(n),
2226
+ setGlobalCursorOverride: (n) => w().instance.setGlobalCursorOverride(n),
2227
+ setKeyInputBlock: (n, e) => w().instance.setKeyInputBlock(n, e),
2211
2228
  getGlobalMouseBlock: () => w().instance.getGlobalMouseBlock(),
2212
2229
  getGlobalKeyboardBlock: () => w().instance.getGlobalKeyboardBlock(),
2213
2230
  getGlobalCursorOverride: () => w().instance.getGlobalCursorOverride(),
2214
- getKeyInputBlock: (s) => w().instance.getKeyInputBlock(s)
2231
+ getKeyInputBlock: (n) => w().instance.getKeyInputBlock(n)
2215
2232
  }
2216
2233
  };
2217
2234
  }
2218
- function es() {
2235
+ function tn() {
2236
+ return {
2237
+ trackEvent: (n, e) => M.getInstance().trackEvent(`custom__${n}`, e),
2238
+ trackLog: (n, e) => M.getInstance().trackLog(`custom__${n}`, e)
2239
+ };
2240
+ }
2241
+ function rn() {
2219
2242
  return {
2220
- registerWindow: (s) => {
2221
- zr.setupRevUtils(s, global.OVERLAYED.electron);
2243
+ registerWindow: (n) => {
2244
+ Hr.setupRevUtils(n, global.OVERLAYED.electron);
2222
2245
  }
2223
2246
  };
2224
2247
  }
2225
- function ts(s) {
2226
- K.getInstance().clientId = s.appName, K.getInstance().userId = lt.generateUniqueIdentifier(), C.getInstance().on("fatal", (e) => {
2227
- K.getInstance().track("fatal", {
2248
+ function nn(n) {
2249
+ M.getInstance().clientId = n.applicationId, M.getInstance().userId = lt.generateUniqueIdentifier(), C.getInstance().on("fatal", (e) => {
2250
+ M.getInstance().trackLog("fatal", {
2228
2251
  message: e.message,
2229
2252
  code: e.code,
2230
2253
  data: e.data
2231
2254
  });
2232
2255
  }), C.getInstance().on("error", (e) => {
2233
- K.getInstance().track("error", {
2256
+ M.getInstance().trackLog("error", {
2234
2257
  message: e.message,
2235
2258
  code: e.code,
2236
2259
  data: e.data
2237
2260
  });
2238
2261
  }), C.getInstance().on("warning", (e) => {
2239
- K.getInstance().track("warning", {
2262
+ M.getInstance().trackLog("warning", {
2240
2263
  message: e.message,
2241
2264
  code: e.code,
2242
2265
  data: e.data
@@ -2247,7 +2270,7 @@ function w() {
2247
2270
  return B.getInstance().getInterface("OGG_SIEGE");
2248
2271
  }
2249
2272
  export {
2250
- Fs as overlayed,
2251
- Ps as setFetchLatestTokenCallback,
2252
- Ss as setUpdaterTokenResolver
2273
+ Nn as overlayed,
2274
+ An as setFetchLatestTokenCallback,
2275
+ Dn as setUpdaterTokenResolver
2253
2276
  };