@overlayed/app 0.9.1 → 0.9.2

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.d.ts CHANGED
@@ -381,11 +381,9 @@ declare interface OverlayedOptions<TModule extends GameModule, TKeybind extends
381
381
  */
382
382
  electron: electron;
383
383
  /**
384
- * The app name.
385
- *
386
- * TODO: replace with endpoint to get app name from server.
384
+ * The application id, this can be found in the [Overlayed Dashboard](https://dashboard.overlayed.gg/settings/applications).
387
385
  */
388
- appName: string;
386
+ applicationId: string;
389
387
  /**
390
388
  * App modules to load.
391
389
  */
@@ -410,6 +408,14 @@ declare interface OverlayedOptions<TModule extends GameModule, TKeybind extends
410
408
  * @deprecated
411
409
  */
412
410
  channel?: string;
411
+ /**
412
+ * The app name.
413
+ *
414
+ * TODO: replace with endpoint to get app name from server.
415
+ *
416
+ * @deprecated This field will be removed in the future.
417
+ */
418
+ appName: string;
413
419
  }
414
420
 
415
421
  declare class OverridesManager extends Manager {
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  var ut = Object.defineProperty;
2
2
  var ht = (s, e, t) => e in s ? ut(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
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";
4
+ import { type as R } from "arktype";
5
+ import M, { 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";
@@ -185,7 +185,7 @@ let Et = class We extends Ee {
185
185
  }
186
186
  };
187
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 {
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: ys,
276
+ PipeEventBase: ms,
277
+ ProcessMonitor: bs,
278
+ Process: vs,
279
+ InjectionMethod: ws,
280
+ AccessLevel: Es,
281
+ HardwareInterface: Is
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,7 +309,7 @@ let Dt = class extends Ee {
309
309
  }
310
310
  };
311
311
  const ke = Ie(Dt, "stats-cc");
312
- function Mt(s) {
312
+ function At(s) {
313
313
  return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
314
314
  var r = s.get(e);
315
315
  r ? r.push(t) : s.set(e, [t]);
@@ -328,7 +328,7 @@ function Mt(s) {
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();
@@ -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,8 +420,8 @@ 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");
@@ -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
+ M.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 = M.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,8 +479,8 @@ 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
485
  const n = this._schema["~standard"].validate(r);
486
486
  if (n instanceof Promise)
@@ -492,14 +492,14 @@ class Ot {
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 M.accessSync(e, M.constants.R_OK | M.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 M.accessSync(e, M.constants.F_OK), !0;
503
503
  } catch {
504
504
  return !1;
505
505
  }
@@ -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);
@@ -618,7 +618,7 @@ class Se extends _e {
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 = (s) => m.join(Se(), "apps", s), Rt = (s) => m.join(qe(s), "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,7 +708,7 @@ 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);
711
+ const oe = L(Ft);
712
712
  function $t(s) {
713
713
  return s;
714
714
  }
@@ -737,9 +737,9 @@ class Tt extends pt {
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,7 +797,7 @@ 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";
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], se = ce.keys, j = Array.isArray, Fe = "method", Ze = "HEAD", fe = "GET", et = "OPTIONS", Bt = "POST", Gt = "PUT", jt = "PATCH", Ut = "DELETE";
801
801
  function zt(s, e) {
802
802
  let t = new AbortController();
803
803
  function r(i) {
@@ -809,14 +809,14 @@ function zt(s, e) {
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
816
  n.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() {
@@ -825,23 +825,23 @@ function zt(s, e) {
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) {
828
+ var $e = ce.getPrototypeOf, xe = (s) => {
829
+ if (s !== re && typeof s === N) {
830
+ if (typeof $e === Je) {
831
831
  let e = $e(s);
832
- return e === ge || e === te;
832
+ return e === ge || e === re;
833
833
  }
834
834
  return ge.toString.call(s) === `[${N} Object]`;
835
835
  }
836
836
  return !1;
837
837
  }, Le = (...s) => s.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 se(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 "";
843
+ function De(s, e = !0, t = re, r) {
844
+ if (s === F || s === re) return "";
845
845
  let n = [], a = e ? encodeURIComponent : (f) => f, o = j(s), { arrayFormat: i, allowDots: l, serializeDate: h } = r || {}, g = (f) => {
846
846
  if (l && !o) return `.${f}`;
847
847
  if (o) {
@@ -852,7 +852,7 @@ function De(s, e = !0, t = te, r) {
852
852
  };
853
853
  for (let f in s) if (ge.hasOwnProperty.call(s, f)) {
854
854
  let p = s[f];
855
- if (p !== R) {
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);
@@ -863,9 +863,9 @@ function De(s, e = !0, t = te, r) {
863
863
  return n.join("&");
864
864
  }
865
865
  function pe(s) {
866
- return j(s) ? s.map(pe) : (s && typeof s === N && re(s).forEach((e) => {
866
+ return j(s) ? s.map(pe) : (s && typeof s === N && se(s).forEach((e) => {
867
867
  let t = s[e];
868
- t === R ? delete s[e] : pe(t);
868
+ t === F ? delete s[e] : pe(t);
869
869
  }), s);
870
870
  }
871
871
  function Ht(s) {
@@ -882,14 +882,14 @@ var Wt = "XiorError", qt = "XiorTimeoutError", tt = class extends Error {
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) => {
885
+ }, Yt = Object.defineProperty, Jt = Object.defineProperties, Xt = Object.getOwnPropertyDescriptors, ne = Object.getOwnPropertySymbols, rt = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable, Te = (s, e, t) => e in s ? Yt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e) => {
886
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]);
887
+ if (ne) for (var t of ne(e)) st.call(e, t) && Te(s, t, e[t]);
888
888
  return s;
889
- }, X = (s, e) => Yt(s, Xt(e)), Zt = (s, e) => {
889
+ }, Z = (s, e) => Jt(s, Xt(e)), Zt = (s, e) => {
890
890
  var t = {};
891
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]);
892
+ if (s != null && ne) for (var r of ne(s)) e.indexOf(r) < 0 && st.call(s, r) && (t[r] = s[r]);
893
893
  return t;
894
894
  }, z = (s, e, t) => new Promise((r, n) => {
895
895
  var a = (l) => {
@@ -906,30 +906,30 @@ var Wt = "XiorError", qt = "XiorTimeoutError", tt = class extends Error {
906
906
  }
907
907
  }, i = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(a, o);
908
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");
909
+ }), Ae = "application/", nt = `${Ae}x-www-form-urlencoded`, it = RegExp, er = new it(`^${nt}`, "i"), tr = `${Ae}${Ce}`, rr = new it(`^${Ae}.*${Ce}.*`, "i");
910
910
  function sr(s = fe) {
911
911
  return [Ze, fe, et].includes(s);
912
912
  }
913
- var nr = typeof URLSearchParams != `${R}`;
913
+ var nr = typeof URLSearchParams != `${F}`;
914
914
  function ir(s) {
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 = s[de] || De, t = s.encodeURI !== !1, r = s[Fe] && s[Fe].toUpperCase(), n = s.url, a = n, o = nr && s.data instanceof URLSearchParams, i = o ? ce.fromEntries(s.data.entries()) : s.data, l = i, h = s != null && s[A] ? U({}, s[A]) : {}, g = s.params, f = sr(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 (s != null && s[A]) {
920
+ let d = se(s[A]).find((b) => b.toLowerCase() === u);
921
+ d && (u = d, p = s[A][d]);
922
922
  }
923
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)));
924
924
  }
925
- if (g && re(g).length > 0) {
925
+ if (g && se(g).length > 0) {
926
926
  let p = e(g, t);
927
927
  n += n.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({}, s), { _data: l, _url: n, data: i, url: a, method: r, [A]: h, isGet: f });
930
930
  });
931
931
  }
932
- var ar = typeof AbortController != `${R}`;
932
+ var ar = typeof AbortController != `${F}`;
933
933
  function or(s, e) {
934
934
  return z(this, null, function* () {
935
935
  let t;
@@ -947,7 +947,7 @@ function or(s, e) {
947
947
  }
948
948
  var lr = (s) => new T(s), 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) => {
@@ -990,7 +990,7 @@ var lr = (s) => new T(s), T = class {
990
990
  return z(this, null, function* () {
991
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"]);
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: n, 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, n) => this.request(n ? Z(U({}, n), { 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",
@@ -1055,25 +1055,28 @@ let ye;
1055
1055
  function Ss(s) {
1056
1056
  ye = s;
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((s) => {
1066
1066
  const e = ye == null ? void 0 : ye();
1067
1067
  return e && (s.headers ?? (s.headers = {}), s.headers.Authorization = e), s;
1068
1068
  });
1069
- function ur(s, e) {
1070
- return Ae.get(`/v1/native/${ot(s)}/version.txt`, {
1069
+ function ur(s) {
1070
+ return V.get(`/v1/public/applications/${s}`);
1071
+ }
1072
+ function hr(s, e) {
1073
+ return Me.get(`/v1/native/${ot(s)}/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(s, e) {
1079
+ return Me.get(`/v1/native/${ot(s)}/files`, {
1077
1080
  params: { channel: e },
1078
1081
  responseType: "arraybuffer"
1079
1082
  });
@@ -1081,45 +1084,45 @@ function hr(s, e) {
1081
1084
  function ot(s) {
1082
1085
  return s === "01JXPFK6YQ3N00N2Y9JHFNG55D" || s === "01JZEBPGHT5M4Y6SGY4P7Q9EZT" ? "siege-game-module" : s;
1083
1086
  }
1084
- function dr() {
1085
- return ce.get("/v1/public/raven/config");
1086
- }
1087
- const gr = xt();
1088
- function fr(s, e) {
1089
- return ce.get(`/v1/public/raven/games/${s}/builds/${e}`);
1087
+ function gr() {
1088
+ return V.get("/v1/public/raven/config");
1090
1089
  }
1090
+ const fr = xt();
1091
1091
  function pr(s, e) {
1092
- return ce.post(`/v1/public/raven/games/${s}/builds/upload`, null, {
1092
+ return V.get(`/v1/public/raven/games/${s}/builds/${e}`);
1093
+ }
1094
+ function yr(s, e) {
1095
+ return V.post(`/v1/public/raven/games/${s}/builds/upload`, null, {
1093
1096
  params: e
1094
1097
  });
1095
1098
  }
1096
- function yr(s, e) {
1099
+ function mr(s, 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/${s}/builds/upload`, t, {
1099
1102
  params: e
1100
1103
  });
1101
1104
  }
1102
- function mr(s) {
1105
+ function br(s) {
1103
1106
  return s instanceof Error && (s.name === "XiorError" || s.name === "XiorTimeoutError");
1104
1107
  }
1105
- function br(s) {
1108
+ function vr(s) {
1106
1109
  return !!(s && "kind" in s.data && "message" in s.data);
1107
1110
  }
1108
- let Z;
1109
- function Ps(s) {
1110
- Z = s;
1111
+ let ee;
1112
+ function Cs(s) {
1113
+ ee = s;
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,10 +1147,10 @@ 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());
1150
+ await (ee == null ? void 0 : ee());
1148
1151
  for (const n of t)
1149
1152
  try {
1150
- const { data: a } = await ur(n, r), o = await this.getCurrentVersion(n);
1153
+ const { data: a } = await hr(n, r), o = await this.getCurrentVersion(n);
1151
1154
  this.logger.log(`${n} > Update Check. current: ${o}, latest: ${a}`);
1152
1155
  const i = a !== o;
1153
1156
  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,8 +1159,8 @@ class vr extends oe {
1156
1159
  }
1157
1160
  }
1158
1161
  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 });
1162
+ const { data: o } = await dr(t, n), 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 n = m.join(this.targetDir, t), a = await S.readdir(n, { 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(n, 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,16 +1215,16 @@ 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
  }
@@ -1236,7 +1239,7 @@ class wr extends oe {
1236
1239
  }
1237
1240
  a.modules.forEach((o) => n.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(n)), 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,
1251
+ const H = L(Er), Ir = ae(import.meta.url), {
1252
+ PipeEventServer: Ls,
1253
+ PipeEventClient: Ds,
1254
+ PipeEventBase: As,
1255
+ ProcessMonitor: kr,
1256
+ Process: Q,
1254
1257
  InjectionMethod: Ms,
1255
- AccessLevel: As,
1258
+ AccessLevel: Os,
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;
@@ -1305,11 +1308,11 @@ class kr extends oe {
1305
1308
  n.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, n);
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: Ks } = Pr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1312
+ var Cr = Object.defineProperty, Lr = (s, e, t) => e in s ? Cr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, te = (s, e, t) => Lr(s, 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);
@@ -1324,22 +1327,22 @@ let Lr = class {
1324
1327
  this._resolution = { width: e, height: t };
1325
1328
  }
1326
1329
  };
1327
- class Dr {
1330
+ class Ar {
1328
1331
  constructor() {
1329
- ee(this, "interfaces", {});
1332
+ te(this, "interfaces", {});
1330
1333
  }
1331
1334
  createInterface(e) {
1332
- return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new Lr(new Sr(e, { access: 1 })), this.interfaces[e]);
1335
+ return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new Dr(new Sr(e, { access: 1 })), this.interfaces[e]);
1333
1336
  }
1334
1337
  getInterface(e) {
1335
1338
  return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
1336
1339
  }
1337
1340
  }
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);
1341
+ const B = L(Ar);
1342
+ var Mr = Object.defineProperty, Or = (s, e, t) => e in s ? Mr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, Y = (s, e, t) => Or(s, typeof e != "symbol" ? e + "" : e, t);
1340
1343
  class Kr {
1341
1344
  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();
1345
+ 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
1346
  }
1344
1347
  set clientId(e) {
1345
1348
  this._clientId = e;
@@ -1364,8 +1367,8 @@ class Kr {
1364
1367
  };
1365
1368
  }
1366
1369
  }
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 {
1370
+ const O = L(Kr), Rr = ae(import.meta.url), Fr = Rr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1371
+ class $r extends Nt {
1369
1372
  constructor() {
1370
1373
  super("GameLaunchManager");
1371
1374
  c(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
@@ -1376,10 +1379,10 @@ class Rr extends Nt {
1376
1379
  this.subscribedGames = new Set(t);
1377
1380
  }
1378
1381
  init() {
1379
- super.init(), B.getInstance().createInterface("OGG_SIEGE"), O.getInstance().on("create", this.boundOnProcessCreate), O.getInstance().on("destroy", this.boundOnProcessDestroy);
1382
+ super.init(), B.getInstance().createInterface("OGG_SIEGE"), K.getInstance().on("create", this.boundOnProcessCreate), K.getInstance().on("destroy", this.boundOnProcessDestroy);
1380
1383
  }
1381
1384
  destroy() {
1382
- O.getInstance().off("create", this.boundOnProcessCreate), O.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
1385
+ K.getInstance().off("create", this.boundOnProcessCreate), K.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
1383
1386
  }
1384
1387
  async onProcessCreate({ process: t }) {
1385
1388
  const r = this.getRavenGame(t);
@@ -1394,12 +1397,12 @@ class Rr extends Nt {
1394
1397
  const n = new AbortController();
1395
1398
  if (await this.emit("gameLaunch", { game: r.identifier, reject: () => n.abort }), n.signal.aborted)
1396
1399
  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) {
1400
+ 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
1401
  C.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
1399
- appElevated: !!q.currentProcess.isElevated,
1402
+ appElevated: !!Q.currentProcess.isElevated,
1400
1403
  gameElevated: !!t.isElevated
1401
1404
  }), this.logger.sentryLog("Game elevated but App is not", {
1402
- appElevated: q.currentProcess.isElevated,
1405
+ appElevated: Q.currentProcess.isElevated,
1403
1406
  gameElevated: t.isElevated
1404
1407
  });
1405
1408
  return;
@@ -1414,10 +1417,10 @@ class Rr extends Nt {
1414
1417
  });
1415
1418
  }
1416
1419
  const o = r == null ? void 0 : r.modules.map(async (i) => {
1417
- const l = await ne.getInstance().getCurrentVersion(i);
1420
+ const l = await ie.getInstance().getCurrentVersion(i);
1418
1421
  if (!l)
1419
1422
  return this.logger.sentryError("No version found for DLL", { identifier: i }), Promise.resolve();
1420
- const h = ne.getInstance().getTargetVersionPath(i, l);
1423
+ const h = ie.getInstance().getTargetVersionPath(i, l);
1421
1424
  this.logger.log("DLL Path", h);
1422
1425
  const g = await this.getDllFiles(h);
1423
1426
  return this.logger.log("DLL Files", g), Promise.all(
@@ -1438,12 +1441,12 @@ class Rr extends Nt {
1438
1441
  })
1439
1442
  );
1440
1443
  });
1441
- await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), K.getInstance().track("game_launch", {
1444
+ await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), O.getInstance().track("game_launch", {
1442
1445
  game: r.identifier
1443
1446
  });
1444
1447
  }
1445
1448
  copyDll(t) {
1446
- const r = m.basename(t), n = gt(t), a = m.join(Pe(), "resources"), o = m.join(a, r);
1449
+ const r = m.basename(t), n = gt(t), a = m.join(Se(), "resources"), o = m.join(a, r);
1447
1450
  this.logger.debug("Copying", n, "to", o);
1448
1451
  try {
1449
1452
  ve(a) || be(a, { recursive: !0 });
@@ -1456,14 +1459,14 @@ class Rr extends Nt {
1456
1459
  }
1457
1460
  async getDllFiles(t) {
1458
1461
  try {
1459
- return (await P.readdir(t)).filter((n) => n.endsWith(".dll")).map((n) => m.join(t, n));
1462
+ return (await S.readdir(t)).filter((n) => n.endsWith(".dll")).map((n) => m.join(t, n));
1460
1463
  } catch (r) {
1461
1464
  return this.logger.captureSentryException("Failed to read DLL directory", r), this.logger.sentryError("Failed to read DLL directory", { dllPath: t }), [];
1462
1465
  }
1463
1466
  }
1464
1467
  onProcessDestroy({ process: t }) {
1465
1468
  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", {
1469
+ r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }), O.getInstance().track("game_close", {
1467
1470
  game: r.identifier
1468
1471
  }));
1469
1472
  }
@@ -1478,8 +1481,8 @@ class Rr extends Nt {
1478
1481
  return r;
1479
1482
  }
1480
1483
  }
1481
- const G = L(Rr);
1482
- class $r extends Je {
1484
+ const G = L($r);
1485
+ class xr extends Ye {
1483
1486
  constructor() {
1484
1487
  super("GameBuildManager");
1485
1488
  c(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
@@ -1504,7 +1507,7 @@ class $r extends Je {
1504
1507
  this.logger.log("Process Path", n.path), this.logger.log("Process Name", n.name), this.logger.log("Build Hash", o);
1505
1508
  let i = !1;
1506
1509
  try {
1507
- i = (await fr(r.identifier, o)).data.upload;
1510
+ i = (await pr(r.identifier, o)).data.upload;
1508
1511
  } catch (g) {
1509
1512
  this.logger.captureSentryException("Error checking game build hash", g);
1510
1513
  return;
@@ -1521,13 +1524,13 @@ class $r extends Je {
1521
1524
  const g = new Tt(h, {
1522
1525
  chunkSizeMb: 25,
1523
1526
  maxConcurrent: 1
1524
- }), f = await pr(r.identifier, {
1527
+ }), f = await yr(r.identifier, {
1525
1528
  build_hash: o,
1526
1529
  chunk_count: g.totalChunks,
1527
1530
  file_size_bytes: h.size
1528
1531
  });
1529
1532
  await g.chunk(async (p, u) => {
1530
- this.logger.log("Uploading chunk", u), await yr(r.identifier, {
1533
+ this.logger.log("Uploading chunk", u), await mr(r.identifier, {
1531
1534
  chunk: p,
1532
1535
  build_hash: o,
1533
1536
  chunk_index: u,
@@ -1535,15 +1538,15 @@ class $r extends Je {
1535
1538
  });
1536
1539
  }), this.logger.log("Build uploaded successfully");
1537
1540
  } 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);
1541
+ 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
1542
  }
1540
1543
  }
1541
1544
  }
1542
- const ct = L($r);
1543
- function xr(s = []) {
1544
- return m.normalize(m.join(qe(global.OVERLAYED.APP_NAME), ...s));
1545
+ const ct = L(xr);
1546
+ function Tr(s = []) {
1547
+ return m.normalize(m.join(qe(global.OVERLAYED.APPLICATION_ID), ...s));
1545
1548
  }
1546
- const Tr = F({
1549
+ const Nr = R({
1547
1550
  game: "string",
1548
1551
  type: "string",
1549
1552
  creation_time: "number"
@@ -1740,13 +1743,13 @@ const Tr = F({
1740
1743
  [252, "Noname"],
1741
1744
  [253, "PA1"],
1742
1745
  [254, "OEM_Clear"]
1743
- ]), Ne = new Map(me.entries().map(([s, e]) => [e, s])), Nr = F({
1746
+ ]), Ne = new Map(me.entries().map(([s, e]) => [e, s])), Br = R({
1744
1747
  "[string]": {
1745
1748
  keys: "string[]",
1746
- mode: F("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
1749
+ mode: R("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
1747
1750
  }
1748
1751
  });
1749
- class Br extends oe {
1752
+ class Gr extends le {
1750
1753
  constructor(t) {
1751
1754
  super("KeybindManager");
1752
1755
  c(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
@@ -1759,9 +1762,9 @@ class Br extends oe {
1759
1762
  c(this, "keybindsFile");
1760
1763
  // TODO try to figure out a better way to handle this
1761
1764
  c(this, "keybindListeningPaused", !1);
1762
- this.keybindsFile = new Ot({
1763
- path: xr(["keybinds.json"]),
1764
- schema: Nr,
1765
+ this.keybindsFile = new Kt({
1766
+ path: Tr(["keybinds.json"]),
1767
+ schema: Br,
1765
1768
  default: t
1766
1769
  });
1767
1770
  }
@@ -1869,7 +1872,7 @@ class Br extends oe {
1869
1872
  return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
1870
1873
  }
1871
1874
  }
1872
- class Gr extends Je {
1875
+ class jr extends Ye {
1873
1876
  constructor(t) {
1874
1877
  super("OverridesManager");
1875
1878
  c(this, "renderInterface");
@@ -1900,9 +1903,9 @@ class Gr extends Je {
1900
1903
  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);
1901
1904
  }
1902
1905
  }
1903
- const jr = L(Gr, "OGG_SIEGE");
1906
+ const Ur = L(jr, "OGG_SIEGE");
1904
1907
  var he, Be;
1905
- function Ur() {
1908
+ function zr() {
1906
1909
  if (Be) return he;
1907
1910
  Be = 1;
1908
1911
  var s = (o, i) => () => (i || o((i = { exports: {} }).exports, i), i.exports), e = s((o, i) => {
@@ -1913,16 +1916,16 @@ function Ur() {
1913
1916
  h.add(f);
1914
1917
  let b = f.webContents;
1915
1918
  function k(y) {
1916
- return !!(!S(y) || u != null && u.includes(y.host));
1919
+ return !!(!P(y) || u != null && u.includes(y.host));
1917
1920
  }
1918
- function S(y) {
1921
+ function P(y) {
1919
1922
  return new URL(b.getURL()).origin !== y.origin;
1920
1923
  }
1921
1924
  let D = 0;
1922
1925
  function v() {
1923
1926
  D = Date.now();
1924
1927
  }
1925
- function V() {
1928
+ function W() {
1926
1929
  let y = Date.now() - D, I = y < 150;
1927
1930
  return I || console.warn("was not recently active", y), I;
1928
1931
  }
@@ -1935,13 +1938,13 @@ function Ur() {
1935
1938
  }), b.on("will-navigate", (y, I) => {
1936
1939
  let _ = y.url || I;
1937
1940
  if (console.log("will-navigate", _), !_) return;
1938
- let Ke = new URL(_);
1939
- if (!k(Ke)) {
1940
- if (!V()) {
1941
+ let Oe = new URL(_);
1942
+ if (!k(Oe)) {
1943
+ if (!W()) {
1941
1944
  console.log("blocked navigation", _), y.preventDefault();
1942
1945
  return;
1943
1946
  }
1944
- S(Ke) && (console.log("external navigation", _), y.preventDefault(), d.openExternal(_));
1947
+ P(Oe) && (console.log("external navigation", _), y.preventDefault(), d.openExternal(_));
1945
1948
  }
1946
1949
  }), b.session.on("will-download", (y, I) => {
1947
1950
  let _ = I.getURL();
@@ -1949,7 +1952,7 @@ function Ur() {
1949
1952
  }), b.setWindowOpenHandler((y) => {
1950
1953
  console.log("window-open", y.url);
1951
1954
  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" });
1955
+ if (!k(_)) return W() ? (P(_) && d.openExternal(y.url), { action: "deny" }) : (console.log("blocked navigation", I), { action: "deny" });
1953
1956
  });
1954
1957
  }
1955
1958
  i.exports = g;
@@ -1969,28 +1972,28 @@ function Ur() {
1969
1972
  }
1970
1973
  return he = { setupRevUtils: a, setupLinkHandler: r, setUserAgent: n }, he;
1971
1974
  }
1972
- var zr = Ur();
1973
- let J = !1, Y;
1975
+ var Hr = zr();
1976
+ let J = !1, X;
1974
1977
  function Fs(s) {
1975
1978
  const { init: e = !0 } = s;
1976
- if (Hr(s), ae.getInstance().init(s.appName), J)
1977
- return Y;
1979
+ if (Vr(s), oe.getInstance().init(s.appName), J)
1980
+ return X;
1978
1981
  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
+ rs(s);
1983
+ const r = /* @__PURE__ */ new Map(), n = Qr(s.modules, r), a = Yr(), o = Xr(s.keybinds), i = Zr(), l = es(), h = ts();
1984
+ Wr(s), Jr(s, r), J = !0, X = {
1982
1985
  ...n,
1983
1986
  ...a,
1984
1987
  ads: h,
1985
1988
  keybinds: o,
1986
1989
  windows: i,
1987
1990
  input: l,
1988
- hasAnyActiveProcesses: () => O.getInstance().hasAnyActiveProcesses,
1991
+ hasAnyActiveProcesses: () => K.getInstance().hasAnyActiveProcesses,
1989
1992
  init: t,
1990
1993
  initialized: J
1991
1994
  };
1992
1995
  }
1993
- return e ? (t(), Y) : new Proxy(
1996
+ return e ? (t(), X) : new Proxy(
1994
1997
  {
1995
1998
  init: t
1996
1999
  },
@@ -1998,7 +2001,7 @@ function Fs(s) {
1998
2001
  get: (r, n) => {
1999
2002
  if (n !== "init" && !J)
2000
2003
  throw new Error(`overlayed was called before initialized: ${n}`);
2001
- return n === "init" ? r[n] : Y[n];
2004
+ return n === "init" ? r[n] : X[n];
2002
2005
  }
2003
2006
  }
2004
2007
  );
@@ -2008,26 +2011,26 @@ global.OVERLAYED = new Proxy({}, {
2008
2011
  throw new Error("function overlayed was not called");
2009
2012
  }
2010
2013
  });
2011
- function Hr(s) {
2014
+ function Vr(s) {
2012
2015
  global.OVERLAYED = {
2013
- APP_NAME: s.appName,
2016
+ APPLICATION_ID: s.applicationId,
2014
2017
  APP_BUILD_CHANNEL: s.channel ?? "alpha",
2015
2018
  electron: s.electron
2016
2019
  };
2017
2020
  }
2018
- function Vr(s) {
2021
+ function Wr(s) {
2019
2022
  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",
2023
+ G.getInstance().setSubscribedGames(e), ct.getInstance().init(), G.getInstance().init(), K.getInstance().init(), H.getInstance().init(), global.OVERLAYED.electron.ipcMain.handle("getAppInfo", async () => ({
2024
+ ...(await ur(global.OVERLAYED.APPLICATION_ID)).data,
2022
2025
  userId: lt.generateUniqueIdentifier()
2023
- }), Ve.on("quit", () => {
2024
- Wr();
2026
+ })), Ve.on("quit", () => {
2027
+ qr();
2025
2028
  });
2026
2029
  }
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();
2030
+ function qr() {
2031
+ 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
2032
  }
2030
- function qr(s, e) {
2033
+ function Qr(s, e) {
2031
2034
  return s.reduce((t, r) => {
2032
2035
  const n = r.key;
2033
2036
  return t[n] = {
@@ -2053,7 +2056,7 @@ function qr(s, e) {
2053
2056
  }, t;
2054
2057
  }, {});
2055
2058
  }
2056
- function Qr() {
2059
+ function Yr() {
2057
2060
  const s = C.getInstance(), e = G.getInstance();
2058
2061
  return {
2059
2062
  on: (t, r) => {
@@ -2112,8 +2115,8 @@ function $(s, e) {
2112
2115
  function Jr(s, e) {
2113
2116
  const t = ke.getInstance();
2114
2117
  function r(n) {
2115
- const a = Tr(n);
2116
- if (a instanceof F.errors) {
2118
+ const a = Nr(n);
2119
+ if (a instanceof R.errors) {
2117
2120
  C.getInstance().warn("Invalid event", "INVALID_EVENT", {
2118
2121
  summary: a.summary
2119
2122
  });
@@ -2123,7 +2126,7 @@ function Jr(s, e) {
2123
2126
  if (!i)
2124
2127
  return;
2125
2128
  const l = i(n);
2126
- if (l instanceof F.errors) {
2129
+ if (l instanceof R.errors) {
2127
2130
  C.getInstance().warn("Invalid event", "INVALID_EVENT", {
2128
2131
  summary: l.summary
2129
2132
  });
@@ -2140,8 +2143,8 @@ function Jr(s, e) {
2140
2143
  });
2141
2144
  }), t;
2142
2145
  }
2143
- function Yr(s) {
2144
- const e = new Br(s), t = {};
2146
+ function Xr(s) {
2147
+ const e = new Gr(s), t = {};
2145
2148
  for (const n in s)
2146
2149
  t[n] = {
2147
2150
  on: (a, o) => {
@@ -2180,7 +2183,7 @@ function Yr(s) {
2180
2183
  e.destroy();
2181
2184
  }), r;
2182
2185
  }
2183
- function Xr() {
2186
+ function Zr() {
2184
2187
  return {
2185
2188
  createWindow: (s) => w().instance.newWindowInternal(yt.BrowserWindow, s),
2186
2189
  on: (s, e) => w().instance.on(s, e),
@@ -2200,9 +2203,9 @@ function Xr() {
2200
2203
  }
2201
2204
  };
2202
2205
  }
2203
- function Zr() {
2206
+ function es() {
2204
2207
  return {
2205
- scope: (s) => jr.getInstance().scope(s),
2208
+ scope: (s) => Ur.getInstance().scope(s),
2206
2209
  raw: {
2207
2210
  setGlobalMouseBlock: (s) => w().instance.setGlobalMouseBlock(s),
2208
2211
  setGlobalKeyboardBlock: (s) => w().instance.setGlobalKeyboardBlock(s),
@@ -2215,28 +2218,28 @@ function Zr() {
2215
2218
  }
2216
2219
  };
2217
2220
  }
2218
- function es() {
2221
+ function ts() {
2219
2222
  return {
2220
2223
  registerWindow: (s) => {
2221
- zr.setupRevUtils(s, global.OVERLAYED.electron);
2224
+ Hr.setupRevUtils(s, global.OVERLAYED.electron);
2222
2225
  }
2223
2226
  };
2224
2227
  }
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", {
2228
+ function rs(s) {
2229
+ O.getInstance().clientId = s.appName, O.getInstance().userId = lt.generateUniqueIdentifier(), C.getInstance().on("fatal", (e) => {
2230
+ O.getInstance().track("fatal", {
2228
2231
  message: e.message,
2229
2232
  code: e.code,
2230
2233
  data: e.data
2231
2234
  });
2232
2235
  }), C.getInstance().on("error", (e) => {
2233
- K.getInstance().track("error", {
2236
+ O.getInstance().track("error", {
2234
2237
  message: e.message,
2235
2238
  code: e.code,
2236
2239
  data: e.data
2237
2240
  });
2238
2241
  }), C.getInstance().on("warning", (e) => {
2239
- K.getInstance().track("warning", {
2242
+ O.getInstance().track("warning", {
2240
2243
  message: e.message,
2241
2244
  code: e.code,
2242
2245
  data: e.data
@@ -2248,6 +2251,6 @@ function w() {
2248
2251
  }
2249
2252
  export {
2250
2253
  Fs as overlayed,
2251
- Ps as setFetchLatestTokenCallback,
2254
+ Cs as setFetchLatestTokenCallback,
2252
2255
  Ss as setUpdaterTokenResolver
2253
2256
  };
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1,4 @@
1
+ import { contextBridge as e, ipcRenderer as n } from "electron";
2
+ e.exposeInMainWorld("overlayed", {
3
+ getAppInfo: async () => await n.invoke("getAppInfo")
4
+ });
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.9.1",
5
+ "version": "0.9.2",
6
6
  "description": "Overlayed app",
7
7
  "license": "BSD-3-Clause",
8
8
  "repository": {
@@ -27,6 +27,11 @@
27
27
  "import": "./dist/siege.js",
28
28
  "default": "./dist/siege.js"
29
29
  },
30
+ "./preload": {
31
+ "types": "./dist/preload.d.ts",
32
+ "import": "./dist/preload.js",
33
+ "default": "./dist/preload.js"
34
+ },
30
35
  "./dist/render-interface/build/*": "./dist/render-interface/build/*",
31
36
  "./dist/native-interface/build/*": "./dist/native-interface/build/*"
32
37
  },
@@ -58,9 +63,9 @@
58
63
  "@overlayed/api": "0.0.3",
59
64
  "@overlayed/cortex-client": "0.0.2",
60
65
  "@overlayed/events": "0.0.2",
66
+ "@overlayed/native-managers": "0.0.2",
61
67
  "@overlayed/siege": "0.0.2",
62
- "@overlayed/utils": "0.0.2",
63
- "@overlayed/native-managers": "0.0.2"
68
+ "@overlayed/utils": "0.0.2"
64
69
  },
65
70
  "dependencies": {
66
71
  "arktype": "^2.1.10",