@overlayed/app 0.9.2 → 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.d.ts +17 -9
- package/dist/index.js +344 -324
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var ut = Object.defineProperty;
|
|
2
|
-
var ht = (
|
|
3
|
-
var c = (
|
|
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
4
|
import { type as R } from "arktype";
|
|
5
|
-
import
|
|
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
7
|
import { createRequire as ae } from "node:module";
|
|
8
8
|
import S from "node:fs/promises";
|
|
@@ -10,24 +10,24 @@ 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 = (
|
|
14
|
-
function vt(
|
|
15
|
-
return { all:
|
|
16
|
-
var r =
|
|
17
|
-
r ? r.push(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 =
|
|
20
|
-
r && (t ? r.splice(r.indexOf(t) >>> 0, 1) :
|
|
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 =
|
|
23
|
-
r && r.slice().map(function(
|
|
24
|
-
|
|
25
|
-
}), (r =
|
|
26
|
-
|
|
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
|
-
|
|
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(
|
|
46
|
+
};
|
|
47
|
+
function Ie(n, ...e) {
|
|
48
48
|
var t;
|
|
49
|
-
return t = class extends
|
|
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
|
|
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,25 +166,25 @@ 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
|
|
170
|
-
return new Date(
|
|
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 (
|
|
175
|
-
console.error(`Failed to delete old log file ${r}:`,
|
|
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(),
|
|
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 = (
|
|
187
|
+
const It = () => m.join(process.env.APPDATA ?? "", "overlayed"), kt = (n) => m.join(It(), "apps", n), _t = (n) => m.join(kt(n), "logs");
|
|
188
188
|
let Pt = class {
|
|
189
189
|
constructor() {
|
|
190
190
|
E(this, "data", []);
|
|
@@ -272,13 +272,13 @@ let Pt = class {
|
|
|
272
272
|
Ie(St);
|
|
273
273
|
const Ct = ae(import.meta.url), {
|
|
274
274
|
PipeEventServer: Lt,
|
|
275
|
-
PipeEventClient:
|
|
276
|
-
PipeEventBase:
|
|
277
|
-
ProcessMonitor:
|
|
278
|
-
Process:
|
|
279
|
-
InjectionMethod:
|
|
280
|
-
AccessLevel:
|
|
281
|
-
HardwareInterface:
|
|
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,19 +309,19 @@ let Dt = class extends Ee {
|
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
const ke = Ie(Dt, "stats-cc");
|
|
312
|
-
function At(
|
|
313
|
-
return { all:
|
|
314
|
-
var r =
|
|
315
|
-
r ? r.push(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 =
|
|
318
|
-
r && (t ? r.splice(r.indexOf(t) >>> 0, 1) :
|
|
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 =
|
|
321
|
-
r && r.slice().map(function(
|
|
322
|
-
|
|
323
|
-
}), (r =
|
|
324
|
-
|
|
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
|
}
|
|
@@ -357,7 +357,7 @@ class Mt {
|
|
|
357
357
|
r && r.delete(t);
|
|
358
358
|
}
|
|
359
359
|
async emit(e, ...t) {
|
|
360
|
-
const r = this.listeners.get(e) || /* @__PURE__ */ new Set(),
|
|
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 Mt {
|
|
|
374
374
|
this.listeners.clear();
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
function L(
|
|
377
|
+
function L(n, ...e) {
|
|
378
378
|
var r;
|
|
379
|
-
return r = class extends
|
|
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
|
|
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)
|
|
@@ -427,8 +427,8 @@ class Kt {
|
|
|
427
427
|
c(this, "_schema");
|
|
428
428
|
c(this, "_defaultValue");
|
|
429
429
|
c(this, "_path");
|
|
430
|
-
const { schema: t, default: r, path:
|
|
431
|
-
this._schema = t, this._defaultValue = r, this._path =
|
|
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 Kt {
|
|
|
449
449
|
save(e) {
|
|
450
450
|
const t = this.onBeforeSave(e);
|
|
451
451
|
try {
|
|
452
|
-
|
|
452
|
+
O.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
|
|
453
453
|
} catch {
|
|
454
454
|
return;
|
|
455
455
|
}
|
|
@@ -462,7 +462,7 @@ class Kt {
|
|
|
462
462
|
return this.data = e, e;
|
|
463
463
|
}
|
|
464
464
|
try {
|
|
465
|
-
const 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;
|
|
@@ -482,32 +482,32 @@ class Kt {
|
|
|
482
482
|
const r = R("string.json.parse").to("object")(e);
|
|
483
483
|
if (r instanceof R.errors)
|
|
484
484
|
return this._defaultValue;
|
|
485
|
-
const
|
|
486
|
-
if (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
510
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
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) {
|
|
@@ -599,26 +599,26 @@ class Pe 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((
|
|
603
|
-
const a =
|
|
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((
|
|
605
|
+
}).forEach((s) => {
|
|
606
606
|
try {
|
|
607
|
-
Ue(x(this.logPath,
|
|
607
|
+
Ue(x(this.logPath, s));
|
|
608
608
|
} catch (a) {
|
|
609
|
-
console.error(`Failed to delete old log file ${
|
|
609
|
+
console.error(`Failed to delete old log file ${s}:`, a);
|
|
610
610
|
}
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
613
|
write(t, ...r) {
|
|
614
|
-
const
|
|
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 Se = () => m.join(process.env.APPDATA ?? "", "overlayed"), qe = (
|
|
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", []);
|
|
@@ -709,10 +709,10 @@ class Ft {
|
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
const oe = L(Ft);
|
|
712
|
-
function $t(
|
|
713
|
-
return
|
|
712
|
+
function $t(n) {
|
|
713
|
+
return n;
|
|
714
714
|
}
|
|
715
|
-
function xt(
|
|
715
|
+
function xt(n) {
|
|
716
716
|
return $t;
|
|
717
717
|
}
|
|
718
718
|
class Tt extends pt {
|
|
@@ -728,10 +728,10 @@ 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,
|
|
732
|
-
if (
|
|
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 <
|
|
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);
|
|
@@ -797,14 +797,14 @@ class Nt extends Mt {
|
|
|
797
797
|
this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
|
|
798
798
|
}
|
|
799
799
|
}
|
|
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],
|
|
801
|
-
function zt(
|
|
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
|
|
807
|
-
for (let i of
|
|
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;
|
|
@@ -813,36 +813,36 @@ function zt(s, e) {
|
|
|
813
813
|
let l = () => {
|
|
814
814
|
r(i.reason);
|
|
815
815
|
};
|
|
816
|
-
|
|
816
|
+
s.push(() => {
|
|
817
817
|
var h;
|
|
818
818
|
(h = i.removeEventListener) == null || h.call(i, Ke, l);
|
|
819
819
|
}), i[Re](Ke, l);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
function a() {
|
|
823
|
-
|
|
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 = ce.getPrototypeOf, xe = (
|
|
829
|
-
if (
|
|
828
|
+
var $e = ce.getPrototypeOf, xe = (n) => {
|
|
829
|
+
if (n !== re && typeof n === N) {
|
|
830
830
|
if (typeof $e === Je) {
|
|
831
|
-
let e = $e(
|
|
831
|
+
let e = $e(n);
|
|
832
832
|
return e === ge || e === re;
|
|
833
833
|
}
|
|
834
|
-
return ge.toString.call(
|
|
834
|
+
return ge.toString.call(n) === `[${N} Object]`;
|
|
835
835
|
}
|
|
836
836
|
return !1;
|
|
837
|
-
}, Le = (...
|
|
837
|
+
}, Le = (...n) => n.reduce((e, t) => {
|
|
838
838
|
if (j(t)) throw new TypeError(`Arguments must be ${N}s, not arrays.`);
|
|
839
|
-
return
|
|
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(
|
|
844
|
-
if (
|
|
845
|
-
let
|
|
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,102 +850,102 @@ function De(s, e = !0, t = re, r) {
|
|
|
850
850
|
}
|
|
851
851
|
return `[${f}]`;
|
|
852
852
|
};
|
|
853
|
-
for (let f in
|
|
854
|
-
let p =
|
|
853
|
+
for (let f in n) if (ge.hasOwnProperty.call(n, f)) {
|
|
854
|
+
let p = n[f];
|
|
855
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 !== "" &&
|
|
860
|
-
} else
|
|
859
|
+
d !== "" && s.push(d);
|
|
860
|
+
} else s.push(`${a(u)}=${a(p)}`);
|
|
861
861
|
}
|
|
862
862
|
}
|
|
863
|
-
return
|
|
863
|
+
return s.join("&");
|
|
864
864
|
}
|
|
865
|
-
function pe(
|
|
866
|
-
return j(
|
|
867
|
-
let t =
|
|
868
|
-
t === F ? delete
|
|
869
|
-
}),
|
|
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(
|
|
872
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(
|
|
871
|
+
function Ht(n) {
|
|
872
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(n);
|
|
873
873
|
}
|
|
874
|
-
function Vt(
|
|
875
|
-
return
|
|
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(
|
|
879
|
-
super(
|
|
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
|
-
}, Yt = Object.defineProperty, Jt = Object.defineProperties, Xt = Object.getOwnPropertyDescriptors,
|
|
886
|
-
for (var t in e || (e = {})) rt.call(e, t) && Te(
|
|
887
|
-
if (
|
|
888
|
-
return
|
|
889
|
-
}, Z = (
|
|
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
|
|
892
|
-
if (
|
|
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 = (
|
|
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
|
-
|
|
899
|
+
s(h);
|
|
900
900
|
}
|
|
901
901
|
}, o = (l) => {
|
|
902
902
|
try {
|
|
903
903
|
i(t.throw(l));
|
|
904
904
|
} catch (h) {
|
|
905
|
-
|
|
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(
|
|
909
|
-
}), Ae = "application/",
|
|
910
|
-
function
|
|
911
|
-
return [Ze, fe, et].includes(
|
|
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
|
|
914
|
-
function ir(
|
|
913
|
+
var sr = typeof URLSearchParams != `${F}`;
|
|
914
|
+
function ir(n) {
|
|
915
915
|
return z(this, null, function* () {
|
|
916
|
-
let e =
|
|
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
917
|
if (i && typeof i.append !== Je) {
|
|
918
918
|
let p = "", u = "content-type";
|
|
919
|
-
if (
|
|
920
|
-
let d =
|
|
921
|
-
d && (u = d, p =
|
|
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 ?
|
|
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 &&
|
|
925
|
+
if (g && ne(g).length > 0) {
|
|
926
926
|
let p = e(g, t);
|
|
927
|
-
|
|
927
|
+
s += s.includes("?") ? `&${p}` : `?${p}`;
|
|
928
928
|
}
|
|
929
|
-
return Z(U({},
|
|
929
|
+
return Z(U({}, n), { _data: l, _url: s, data: i, url: a, method: r, [A]: h, isGet: f });
|
|
930
930
|
});
|
|
931
931
|
}
|
|
932
932
|
var ar = typeof AbortController != `${F}`;
|
|
933
|
-
function or(
|
|
933
|
+
function or(n, e) {
|
|
934
934
|
return z(this, null, function* () {
|
|
935
935
|
let t;
|
|
936
|
-
if (!e || !
|
|
937
|
-
if (t = yield
|
|
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
|
|
943
|
-
if (e === "arraybuffer") return
|
|
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 = (
|
|
948
|
+
var lr = (n) => new T(n), T = class {
|
|
949
949
|
constructor(e) {
|
|
950
950
|
this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [A]: {} };
|
|
951
951
|
}
|
|
@@ -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
|
|
975
|
+
let s = this._.bind(this);
|
|
976
976
|
this.P.forEach((o) => {
|
|
977
|
-
|
|
977
|
+
s = o(s, this);
|
|
978
978
|
});
|
|
979
|
-
let a =
|
|
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,7 +988,7 @@ 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:
|
|
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
993
|
let d, b = [], k = F;
|
|
994
994
|
if (o && ar) {
|
|
@@ -1001,7 +1001,7 @@ var lr = (s) => new T(s), T = class {
|
|
|
1001
1001
|
clearTimeout(k);
|
|
1002
1002
|
}));
|
|
1003
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:
|
|
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
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
1007
|
let I = new tt(v[q] ? `Request failed with status code ${v[q]}` : "Network error", e, y);
|
|
@@ -1018,7 +1018,7 @@ var lr = (s) => new T(s), T = class {
|
|
|
1018
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,
|
|
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);
|
|
@@ -1052,8 +1052,8 @@ const Me = at.create({
|
|
|
1052
1052
|
}
|
|
1053
1053
|
});
|
|
1054
1054
|
let ye;
|
|
1055
|
-
function
|
|
1056
|
-
ye =
|
|
1055
|
+
function Dn(n) {
|
|
1056
|
+
ye = n;
|
|
1057
1057
|
}
|
|
1058
1058
|
const V = at.create({
|
|
1059
1059
|
baseURL: "https://api.overlayed.gg",
|
|
@@ -1062,55 +1062,55 @@ const V = at.create({
|
|
|
1062
1062
|
"Accept-Encoding": "gzip, deflate, br"
|
|
1063
1063
|
}
|
|
1064
1064
|
});
|
|
1065
|
-
Me.interceptors.request.use((
|
|
1065
|
+
Me.interceptors.request.use((n) => {
|
|
1066
1066
|
const e = ye == null ? void 0 : ye();
|
|
1067
|
-
return e && (
|
|
1067
|
+
return e && (n.headers ?? (n.headers = {}), n.headers.Authorization = e), n;
|
|
1068
1068
|
});
|
|
1069
|
-
function ur(
|
|
1070
|
-
return V.get(`/v1/public/applications/${
|
|
1069
|
+
function ur(n) {
|
|
1070
|
+
return V.get(`/v1/public/applications/${n}`);
|
|
1071
1071
|
}
|
|
1072
|
-
function hr(
|
|
1073
|
-
return Me.get(`/v1/native/${ot(
|
|
1072
|
+
function hr(n, e) {
|
|
1073
|
+
return Me.get(`/v1/native/${ot(n)}/version.txt`, {
|
|
1074
1074
|
params: { channel: e },
|
|
1075
1075
|
responseType: "text"
|
|
1076
1076
|
});
|
|
1077
1077
|
}
|
|
1078
|
-
function dr(
|
|
1079
|
-
return Me.get(`/v1/native/${ot(
|
|
1078
|
+
function dr(n, e) {
|
|
1079
|
+
return Me.get(`/v1/native/${ot(n)}/files`, {
|
|
1080
1080
|
params: { channel: e },
|
|
1081
1081
|
responseType: "arraybuffer"
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
|
-
function ot(
|
|
1085
|
-
return
|
|
1084
|
+
function ot(n) {
|
|
1085
|
+
return n === "01JXPFK6YQ3N00N2Y9JHFNG55D" || n === "01JZEBPGHT5M4Y6SGY4P7Q9EZT" ? "siege-game-module" : n;
|
|
1086
1086
|
}
|
|
1087
1087
|
function gr() {
|
|
1088
1088
|
return V.get("/v1/public/raven/config");
|
|
1089
1089
|
}
|
|
1090
1090
|
const fr = xt();
|
|
1091
|
-
function pr(
|
|
1092
|
-
return V.get(`/v1/public/raven/games/${
|
|
1091
|
+
function pr(n, e) {
|
|
1092
|
+
return V.get(`/v1/public/raven/games/${n}/builds/${e}`);
|
|
1093
1093
|
}
|
|
1094
|
-
function yr(
|
|
1095
|
-
return V.post(`/v1/public/raven/games/${
|
|
1094
|
+
function yr(n, e) {
|
|
1095
|
+
return V.post(`/v1/public/raven/games/${n}/builds/upload`, null, {
|
|
1096
1096
|
params: e
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
|
-
function mr(
|
|
1099
|
+
function mr(n, e) {
|
|
1100
1100
|
const t = new FormData();
|
|
1101
|
-
return t.append("file", e.chunk), V.patch(`/v1/public/raven/games/${
|
|
1101
|
+
return t.append("file", e.chunk), V.patch(`/v1/public/raven/games/${n}/builds/upload`, t, {
|
|
1102
1102
|
params: e
|
|
1103
1103
|
});
|
|
1104
1104
|
}
|
|
1105
|
-
function br(
|
|
1106
|
-
return
|
|
1105
|
+
function br(n) {
|
|
1106
|
+
return n instanceof Error && (n.name === "XiorError" || n.name === "XiorTimeoutError");
|
|
1107
1107
|
}
|
|
1108
|
-
function vr(
|
|
1109
|
-
return !!(
|
|
1108
|
+
function vr(n) {
|
|
1109
|
+
return !!(n && "kind" in n.data && "message" in n.data);
|
|
1110
1110
|
}
|
|
1111
1111
|
let ee;
|
|
1112
|
-
function
|
|
1113
|
-
ee =
|
|
1112
|
+
function An(n) {
|
|
1113
|
+
ee = n;
|
|
1114
1114
|
}
|
|
1115
1115
|
class wr extends le {
|
|
1116
1116
|
constructor() {
|
|
@@ -1148,18 +1148,18 @@ class wr extends le {
|
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
1150
|
await (ee == null ? void 0 : ee());
|
|
1151
|
-
for (const
|
|
1151
|
+
for (const s of t)
|
|
1152
1152
|
try {
|
|
1153
|
-
const { data: a } = await hr(
|
|
1154
|
-
this.logger.log(`${
|
|
1153
|
+
const { data: a } = await hr(s, r), o = await this.getCurrentVersion(s);
|
|
1154
|
+
this.logger.log(`${s} > Update Check. current: ${o}, latest: ${a}`);
|
|
1155
1155
|
const i = a !== o;
|
|
1156
|
-
this.logger.log(`${
|
|
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 });
|
|
1157
1157
|
} catch (a) {
|
|
1158
|
-
this.logger.captureSentryException(`${
|
|
1158
|
+
this.logger.captureSentryException(`${s} > Error checking/updating`, a);
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
|
-
async downloadAndExtractDll(t, r,
|
|
1162
|
-
const { data: o } = await dr(t,
|
|
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
1163
|
await S.mkdir(l, { recursive: !0 });
|
|
1164
1164
|
const h = new He();
|
|
1165
1165
|
await h.loadAsync(o);
|
|
@@ -1183,9 +1183,9 @@ class wr extends le {
|
|
|
1183
1183
|
this.logger.log("Saving version file", f), await S.writeFile(f, r);
|
|
1184
1184
|
}
|
|
1185
1185
|
async cleanupOldVersions(t, r) {
|
|
1186
|
-
const
|
|
1186
|
+
const s = m.join(this.targetDir, t), a = await S.readdir(s, { withFileTypes: !0 });
|
|
1187
1187
|
for (const o of a)
|
|
1188
|
-
o.isDirectory() && o.name !== r && await S.rm(m.join(
|
|
1188
|
+
o.isDirectory() && o.name !== r && await S.rm(m.join(s, o.name), { recursive: !0, force: !0 });
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
const ie = L(wr);
|
|
@@ -1231,15 +1231,15 @@ class Er extends le {
|
|
|
1231
1231
|
]
|
|
1232
1232
|
};
|
|
1233
1233
|
this._ravenConfig = r, this.resetState();
|
|
1234
|
-
const
|
|
1234
|
+
const s = /* @__PURE__ */ new Set();
|
|
1235
1235
|
for (const a of this._ravenConfig.games) {
|
|
1236
1236
|
for (const o of a.executables) {
|
|
1237
1237
|
const i = o.toLowerCase();
|
|
1238
1238
|
this._executableToGameMap.set(i, a), this._executablesArray.push(i);
|
|
1239
1239
|
}
|
|
1240
|
-
a.modules.forEach((o) =>
|
|
1240
|
+
a.modules.forEach((o) => s.add(o));
|
|
1241
1241
|
}
|
|
1242
|
-
await ie.getInstance().initWithDlls(Array.from(
|
|
1242
|
+
await ie.getInstance().initWithDlls(Array.from(s)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
|
|
1243
1243
|
} catch (t) {
|
|
1244
1244
|
this.logger.captureSentryException("Failed to fetch Raven config", t), this._failedRefetchTimeoutHandler = setTimeout(() => this.fetchRavenConfig(), this.FAILED_REFETCH_INTERVAL);
|
|
1245
1245
|
}
|
|
@@ -1249,13 +1249,13 @@ class Er extends le {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
1251
|
const H = L(Er), Ir = ae(import.meta.url), {
|
|
1252
|
-
PipeEventServer:
|
|
1253
|
-
PipeEventClient:
|
|
1254
|
-
PipeEventBase:
|
|
1252
|
+
PipeEventServer: Mn,
|
|
1253
|
+
PipeEventClient: On,
|
|
1254
|
+
PipeEventBase: Kn,
|
|
1255
1255
|
ProcessMonitor: kr,
|
|
1256
1256
|
Process: Q,
|
|
1257
|
-
InjectionMethod:
|
|
1258
|
-
AccessLevel:
|
|
1257
|
+
InjectionMethod: Rn,
|
|
1258
|
+
AccessLevel: Fn,
|
|
1259
1259
|
HardwareInterface: lt
|
|
1260
1260
|
} = Ir("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
|
|
1261
1261
|
class _r extends le {
|
|
@@ -1284,7 +1284,7 @@ class _r extends le {
|
|
|
1284
1284
|
}
|
|
1285
1285
|
isProcessRunning(t) {
|
|
1286
1286
|
const r = this._processes.get(t);
|
|
1287
|
-
return (r == null ? void 0 : r.some((
|
|
1287
|
+
return (r == null ? void 0 : r.some((s) => !s.destroyedAt)) ?? !1;
|
|
1288
1288
|
}
|
|
1289
1289
|
onRavenManagerExecutablesUpdated(t) {
|
|
1290
1290
|
t.executables.forEach((r) => {
|
|
@@ -1304,12 +1304,12 @@ class _r extends le {
|
|
|
1304
1304
|
deleteProcess(t) {
|
|
1305
1305
|
if (!t.name)
|
|
1306
1306
|
return;
|
|
1307
|
-
const r = this._processes.get(t.name),
|
|
1308
|
-
|
|
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);
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
1311
|
-
const K = L(_r), Pr = ae(import.meta.url), { RenderInterface: Sr, renderHookPath:
|
|
1312
|
-
var Cr = Object.defineProperty, Lr = (
|
|
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
1313
|
let Dr = class {
|
|
1314
1314
|
constructor(e) {
|
|
1315
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);
|
|
@@ -1326,8 +1326,7 @@ let Dr = class {
|
|
|
1326
1326
|
onResolutionChanged(e, t) {
|
|
1327
1327
|
this._resolution = { width: e, height: t };
|
|
1328
1328
|
}
|
|
1329
|
-
}
|
|
1330
|
-
class Ar {
|
|
1329
|
+
}, Ar = class {
|
|
1331
1330
|
constructor() {
|
|
1332
1331
|
te(this, "interfaces", {});
|
|
1333
1332
|
}
|
|
@@ -1337,9 +1336,9 @@ class Ar {
|
|
|
1337
1336
|
getInterface(e) {
|
|
1338
1337
|
return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
|
|
1339
1338
|
}
|
|
1340
|
-
}
|
|
1339
|
+
};
|
|
1341
1340
|
const B = L(Ar);
|
|
1342
|
-
var Mr = Object.defineProperty, Or = (
|
|
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);
|
|
1343
1342
|
class Kr {
|
|
1344
1343
|
constructor(e) {
|
|
1345
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();
|
|
@@ -1350,24 +1349,36 @@ class Kr {
|
|
|
1350
1349
|
set userId(e) {
|
|
1351
1350
|
this._userId = e;
|
|
1352
1351
|
}
|
|
1353
|
-
|
|
1354
|
-
this.
|
|
1352
|
+
trackEvent(e, t) {
|
|
1353
|
+
this.track(e, t, "event");
|
|
1354
|
+
}
|
|
1355
|
+
trackLog(e, t) {
|
|
1356
|
+
this.track(e, t, "log");
|
|
1355
1357
|
}
|
|
1356
1358
|
flush() {
|
|
1357
|
-
|
|
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);
|
|
1358
1366
|
}
|
|
1359
1367
|
setupFlushInterval() {
|
|
1360
1368
|
setInterval(() => {
|
|
1361
1369
|
this.flush();
|
|
1362
1370
|
}, this.options.batchIntervalSeconds * 1e3);
|
|
1363
1371
|
}
|
|
1372
|
+
track(e, t, r) {
|
|
1373
|
+
this.eventQueue.add({ type: r, name: e, data: t, createdAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
1374
|
+
}
|
|
1364
1375
|
resolveOptions(e) {
|
|
1365
1376
|
return {
|
|
1366
1377
|
batchIntervalSeconds: (e == null ? void 0 : e.batchIntervalSeconds) ?? 15
|
|
1367
1378
|
};
|
|
1368
1379
|
}
|
|
1369
1380
|
}
|
|
1370
|
-
const
|
|
1381
|
+
const M = L(Kr), Rr = ae(import.meta.url), Fr = Rr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
|
|
1371
1382
|
class $r extends Nt {
|
|
1372
1383
|
constructor() {
|
|
1373
1384
|
super("GameLaunchManager");
|
|
@@ -1394,8 +1405,8 @@ class $r extends Nt {
|
|
|
1394
1405
|
}
|
|
1395
1406
|
if (!this.subscribedGames.has(r.identifier) && !this.subscribedGames.has("*"))
|
|
1396
1407
|
return;
|
|
1397
|
-
const
|
|
1398
|
-
if (await this.emit("gameLaunch", { game: r.identifier, reject: () =>
|
|
1408
|
+
const s = new AbortController();
|
|
1409
|
+
if (await this.emit("gameLaunch", { game: r.identifier, reject: () => s.abort }), s.signal.aborted)
|
|
1399
1410
|
return;
|
|
1400
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) {
|
|
1401
1412
|
C.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
|
|
@@ -1441,32 +1452,32 @@ class $r extends Nt {
|
|
|
1441
1452
|
})
|
|
1442
1453
|
);
|
|
1443
1454
|
});
|
|
1444
|
-
await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }),
|
|
1455
|
+
await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), M.getInstance().trackEvent("game_launch", {
|
|
1445
1456
|
game: r.identifier
|
|
1446
1457
|
});
|
|
1447
1458
|
}
|
|
1448
1459
|
copyDll(t) {
|
|
1449
|
-
const r = m.basename(t),
|
|
1450
|
-
this.logger.debug("Copying",
|
|
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);
|
|
1451
1462
|
try {
|
|
1452
1463
|
ve(a) || be(a, { recursive: !0 });
|
|
1453
|
-
const i = ze(
|
|
1454
|
-
we(o, i), dt(
|
|
1464
|
+
const i = ze(s);
|
|
1465
|
+
we(o, i), dt(s, o);
|
|
1455
1466
|
} catch (i) {
|
|
1456
|
-
return i.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", i), this.logger.sentryError("Failed to copy", { originalPath:
|
|
1467
|
+
return i.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", i), this.logger.sentryError("Failed to copy", { originalPath: s, targetPath: o }), !1);
|
|
1457
1468
|
}
|
|
1458
1469
|
return o;
|
|
1459
1470
|
}
|
|
1460
1471
|
async getDllFiles(t) {
|
|
1461
1472
|
try {
|
|
1462
|
-
return (await S.readdir(t)).filter((
|
|
1473
|
+
return (await S.readdir(t)).filter((s) => s.endsWith(".dll")).map((s) => m.join(t, s));
|
|
1463
1474
|
} catch (r) {
|
|
1464
1475
|
return this.logger.captureSentryException("Failed to read DLL directory", r), this.logger.sentryError("Failed to read DLL directory", { dllPath: t }), [];
|
|
1465
1476
|
}
|
|
1466
1477
|
}
|
|
1467
1478
|
onProcessDestroy({ process: t }) {
|
|
1468
1479
|
const r = this.getRavenGame(t);
|
|
1469
|
-
r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }),
|
|
1480
|
+
r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }), M.getInstance().trackEvent("game_close", {
|
|
1470
1481
|
game: r.identifier
|
|
1471
1482
|
}));
|
|
1472
1483
|
}
|
|
@@ -1494,17 +1505,17 @@ class xr extends Ye {
|
|
|
1494
1505
|
G.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
|
|
1495
1506
|
}
|
|
1496
1507
|
async onGameLaunch(...t) {
|
|
1497
|
-
const [{ ravenGame: r, process:
|
|
1498
|
-
if (!
|
|
1508
|
+
const [{ ravenGame: r, process: s }] = t;
|
|
1509
|
+
if (!s.path || !s.name) {
|
|
1499
1510
|
this.logger.sentryError(
|
|
1500
1511
|
"Process path or name not found, could not check for build hash",
|
|
1501
1512
|
void 0,
|
|
1502
|
-
|
|
1513
|
+
s
|
|
1503
1514
|
);
|
|
1504
1515
|
return;
|
|
1505
1516
|
}
|
|
1506
|
-
const a = ze(
|
|
1507
|
-
this.logger.log("Process Path",
|
|
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);
|
|
1508
1519
|
let i = !1;
|
|
1509
1520
|
try {
|
|
1510
1521
|
i = (await pr(r.identifier, o)).data.upload;
|
|
@@ -1517,7 +1528,7 @@ class xr extends Ye {
|
|
|
1517
1528
|
return;
|
|
1518
1529
|
}
|
|
1519
1530
|
const l = new He();
|
|
1520
|
-
l.file(
|
|
1531
|
+
l.file(s.name, a);
|
|
1521
1532
|
const h = await l.generateAsync({ type: "blob" });
|
|
1522
1533
|
try {
|
|
1523
1534
|
this.logger.log("Uploading build (size: ", h.size, " bytes)");
|
|
@@ -1543,8 +1554,8 @@ class xr extends Ye {
|
|
|
1543
1554
|
}
|
|
1544
1555
|
}
|
|
1545
1556
|
const ct = L(xr);
|
|
1546
|
-
function Tr(
|
|
1547
|
-
return m.normalize(m.join(qe(global.OVERLAYED.APPLICATION_ID), ...
|
|
1557
|
+
function Tr(n = []) {
|
|
1558
|
+
return m.normalize(m.join(qe(global.OVERLAYED.APPLICATION_ID), ...n));
|
|
1548
1559
|
}
|
|
1549
1560
|
const Nr = R({
|
|
1550
1561
|
game: "string",
|
|
@@ -1743,10 +1754,10 @@ const Nr = R({
|
|
|
1743
1754
|
[252, "Noname"],
|
|
1744
1755
|
[253, "PA1"],
|
|
1745
1756
|
[254, "OEM_Clear"]
|
|
1746
|
-
]), Ne = new Map(me.entries().map(([
|
|
1757
|
+
]), Ne = new Map(me.entries().map(([n, e]) => [e, n])), Br = R({
|
|
1747
1758
|
"[string]": {
|
|
1748
1759
|
keys: "string[]",
|
|
1749
|
-
mode: R("'toggle' | 'hold'").pipe((
|
|
1760
|
+
mode: R("'toggle' | 'hold'").pipe((n) => n ?? "toggle")
|
|
1750
1761
|
}
|
|
1751
1762
|
});
|
|
1752
1763
|
class Gr extends le {
|
|
@@ -1775,16 +1786,16 @@ class Gr extends le {
|
|
|
1775
1786
|
}
|
|
1776
1787
|
// TODO support multiple callbacks
|
|
1777
1788
|
async onKeybindToggled(t, r) {
|
|
1778
|
-
const
|
|
1779
|
-
|
|
1789
|
+
const s = this.preferencesKeybindToCallbacks.get(t) || {};
|
|
1790
|
+
s.toggle = r, this.preferencesKeybindToCallbacks.set(t, s);
|
|
1780
1791
|
}
|
|
1781
1792
|
async onKeybindDown(t, r) {
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1793
|
+
const s = this.preferencesKeybindToCallbacks.get(t) || {};
|
|
1794
|
+
s.down = r, this.preferencesKeybindToCallbacks.set(t, s);
|
|
1784
1795
|
}
|
|
1785
1796
|
async onKeybindUp(t, r) {
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1797
|
+
const s = this.preferencesKeybindToCallbacks.get(t) || {};
|
|
1798
|
+
s.up = r, this.preferencesKeybindToCallbacks.set(t, s);
|
|
1788
1799
|
}
|
|
1789
1800
|
async updateKeybind(t, r) {
|
|
1790
1801
|
this.keybindsFile.set({
|
|
@@ -1793,7 +1804,7 @@ class Gr extends le {
|
|
|
1793
1804
|
}
|
|
1794
1805
|
async updateKeybinds(t) {
|
|
1795
1806
|
const r = Object.fromEntries(
|
|
1796
|
-
Object.entries(t).filter(([
|
|
1807
|
+
Object.entries(t).filter(([s, a]) => a !== void 0)
|
|
1797
1808
|
);
|
|
1798
1809
|
this.keybindsFile.set({
|
|
1799
1810
|
...this.keybindsFile.get(),
|
|
@@ -1827,45 +1838,45 @@ class Gr extends le {
|
|
|
1827
1838
|
if (!r)
|
|
1828
1839
|
return;
|
|
1829
1840
|
this.pressedKeys.delete(r);
|
|
1830
|
-
const
|
|
1841
|
+
const s = this.keybindsFile.get();
|
|
1831
1842
|
for (const [a] of this.preferencesKeybindToCallbacks.entries())
|
|
1832
|
-
|
|
1843
|
+
s[a].keys.includes(r) && this.triggeredToggleKeybinds.delete(a);
|
|
1833
1844
|
this.checkKeybindUps();
|
|
1834
1845
|
}
|
|
1835
1846
|
async checkKeybindUps() {
|
|
1836
1847
|
const t = this.keybindsFile.get();
|
|
1837
|
-
for (const [r,
|
|
1838
|
-
if (!
|
|
1848
|
+
for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1849
|
+
if (!s.up) continue;
|
|
1839
1850
|
const a = t[r];
|
|
1840
|
-
this.activeKeybinds.has(r) && a.keys.some((o) => !this.pressedKeys.has(o)) && (this.activeKeybinds.delete(r),
|
|
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)));
|
|
1841
1852
|
}
|
|
1842
1853
|
}
|
|
1843
1854
|
async checkKeybindings() {
|
|
1844
1855
|
const t = this.keybindsFile.get();
|
|
1845
|
-
for (const [r,
|
|
1856
|
+
for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1846
1857
|
const a = t[r];
|
|
1847
1858
|
if (a.keys.length === this.pressedKeys.size && a.keys.every((i) => Ne.has(i) ? this.pressedKeys.has(i) : !1)) {
|
|
1848
|
-
this.triggerKeybind(a,
|
|
1859
|
+
this.triggerKeybind(a, s, r);
|
|
1849
1860
|
return;
|
|
1850
1861
|
}
|
|
1851
1862
|
}
|
|
1852
|
-
for (const [r,
|
|
1863
|
+
for (const [r, s] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1853
1864
|
const a = t[r];
|
|
1854
|
-
a.keys.every((i) => Ne.has(i) ? this.pressedKeys.has(i) : (this.logger.error("Unknown key", i, a), !1)) && this.triggerKeybind(a,
|
|
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);
|
|
1855
1866
|
}
|
|
1856
1867
|
}
|
|
1857
|
-
triggerKeybind(t, r,
|
|
1868
|
+
triggerKeybind(t, r, s) {
|
|
1858
1869
|
const a = t.mode;
|
|
1859
|
-
if (a === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(
|
|
1870
|
+
if (a === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(s)) {
|
|
1860
1871
|
const o = r.toggle();
|
|
1861
|
-
this.triggeredToggleKeybinds.add(
|
|
1872
|
+
this.triggeredToggleKeybinds.add(s), this.logger.log(
|
|
1862
1873
|
o ? `Keybind pressed rejected: ${o}` : "Keybind pressed accepted",
|
|
1863
1874
|
this.getKeybindToString(t)
|
|
1864
1875
|
);
|
|
1865
1876
|
}
|
|
1866
|
-
if (a === "hold" && r.down && !this.activeKeybinds.has(
|
|
1877
|
+
if (a === "hold" && r.down && !this.activeKeybinds.has(s)) {
|
|
1867
1878
|
const o = r.down();
|
|
1868
|
-
o ? this.logger.log(`Keybind down rejected: ${o}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(
|
|
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)));
|
|
1869
1880
|
}
|
|
1870
1881
|
}
|
|
1871
1882
|
getKeybindToString(t) {
|
|
@@ -1887,7 +1898,7 @@ class jr extends Ye {
|
|
|
1887
1898
|
setGlobalCursorOverride: (r) => this.setGlobalCursorOverride(t, r),
|
|
1888
1899
|
setGlobalMouseBlock: (r) => this.setGlobalMouseBlock(t, r),
|
|
1889
1900
|
setGlobalKeyboardBlock: (r) => this.setGlobalKeyboardBlock(t, r),
|
|
1890
|
-
setKeyInputBlock: (r,
|
|
1901
|
+
setKeyInputBlock: (r, s) => this.setKeyInputBlock(t, r, s)
|
|
1891
1902
|
};
|
|
1892
1903
|
}
|
|
1893
1904
|
setGlobalCursorOverride(t, r) {
|
|
@@ -1899,8 +1910,8 @@ class jr extends Ye {
|
|
|
1899
1910
|
setGlobalKeyboardBlock(t, r) {
|
|
1900
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);
|
|
1901
1912
|
}
|
|
1902
|
-
setKeyInputBlock(t, r,
|
|
1903
|
-
this.keyInputBlocks[r] || (this.keyInputBlocks[r] = /* @__PURE__ */ new Set()),
|
|
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);
|
|
1904
1915
|
}
|
|
1905
1916
|
}
|
|
1906
1917
|
const Ur = L(jr, "OGG_SIEGE");
|
|
@@ -1908,7 +1919,7 @@ var he, Be;
|
|
|
1908
1919
|
function zr() {
|
|
1909
1920
|
if (Be) return he;
|
|
1910
1921
|
Be = 1;
|
|
1911
|
-
var
|
|
1922
|
+
var n = (o, i) => () => (i || o((i = { exports: {} }).exports, i), i.exports), e = n((o, i) => {
|
|
1912
1923
|
var l = /* @__PURE__ */ new Set(["mouseDown", "mouseUp", "pointerDown", "pointerUp"]), h = /* @__PURE__ */ new WeakSet();
|
|
1913
1924
|
function g(f, p, { allowHosts: u } = {}) {
|
|
1914
1925
|
let { shell: d } = p;
|
|
@@ -1956,7 +1967,7 @@ function zr() {
|
|
|
1956
1967
|
});
|
|
1957
1968
|
}
|
|
1958
1969
|
i.exports = g;
|
|
1959
|
-
}), t =
|
|
1970
|
+
}), t = n((o, i) => {
|
|
1960
1971
|
var l = /* @__PURE__ */ new Set(["Mozilla", "AppleWebKit", "Chrome", "Safari", "Gecko", "Firefox", "OPR", "Edg", "Version", "Mobile", "curl", "PostmanRuntime"]);
|
|
1961
1972
|
async function h(g, f, p) {
|
|
1962
1973
|
let { webContents: u } = g, d = await u.executeJavaScript("navigator.userAgent");
|
|
@@ -1966,28 +1977,29 @@ function zr() {
|
|
|
1966
1977
|
}).join(" "), u.setUserAgent(d), f.app.userAgentFallback = d;
|
|
1967
1978
|
}
|
|
1968
1979
|
i.exports = h;
|
|
1969
|
-
}), r = e(),
|
|
1980
|
+
}), r = e(), s = t();
|
|
1970
1981
|
function a(o, i, l = {}) {
|
|
1971
|
-
r(o, i, l.linkHandler),
|
|
1982
|
+
r(o, i, l.linkHandler), s(o, i, l.userAgent);
|
|
1972
1983
|
}
|
|
1973
|
-
return he = { setupRevUtils: a, setupLinkHandler: r, setUserAgent:
|
|
1984
|
+
return he = { setupRevUtils: a, setupLinkHandler: r, setUserAgent: s }, he;
|
|
1974
1985
|
}
|
|
1975
1986
|
var Hr = zr();
|
|
1976
1987
|
let J = !1, X;
|
|
1977
|
-
function
|
|
1978
|
-
const { init: e = !0 } =
|
|
1979
|
-
if (Vr(
|
|
1988
|
+
function Nn(n) {
|
|
1989
|
+
const { init: e = !0 } = n;
|
|
1990
|
+
if (Vr(n), oe.getInstance().init(n.applicationId), J)
|
|
1980
1991
|
return X;
|
|
1981
1992
|
function t() {
|
|
1982
|
-
|
|
1983
|
-
const r = /* @__PURE__ */ new Map(),
|
|
1984
|
-
Wr(
|
|
1985
|
-
...
|
|
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,
|
|
1986
1997
|
...a,
|
|
1987
1998
|
ads: h,
|
|
1988
1999
|
keybinds: o,
|
|
1989
2000
|
windows: i,
|
|
1990
2001
|
input: l,
|
|
2002
|
+
cortex: g,
|
|
1991
2003
|
hasAnyActiveProcesses: () => K.getInstance().hasAnyActiveProcesses,
|
|
1992
2004
|
init: t,
|
|
1993
2005
|
initialized: J
|
|
@@ -1998,10 +2010,10 @@ function Fs(s) {
|
|
|
1998
2010
|
init: t
|
|
1999
2011
|
},
|
|
2000
2012
|
{
|
|
2001
|
-
get: (r,
|
|
2002
|
-
if (
|
|
2003
|
-
throw new Error(`overlayed was called before initialized: ${
|
|
2004
|
-
return
|
|
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];
|
|
2005
2017
|
}
|
|
2006
2018
|
}
|
|
2007
2019
|
);
|
|
@@ -2011,17 +2023,19 @@ global.OVERLAYED = new Proxy({}, {
|
|
|
2011
2023
|
throw new Error("function overlayed was not called");
|
|
2012
2024
|
}
|
|
2013
2025
|
});
|
|
2014
|
-
function Vr(
|
|
2026
|
+
function Vr(n) {
|
|
2015
2027
|
global.OVERLAYED = {
|
|
2016
|
-
APPLICATION_ID:
|
|
2017
|
-
APP_BUILD_CHANNEL:
|
|
2018
|
-
electron:
|
|
2028
|
+
APPLICATION_ID: n.applicationId,
|
|
2029
|
+
APP_BUILD_CHANNEL: n.channel ?? "alpha",
|
|
2030
|
+
electron: n.electron
|
|
2019
2031
|
};
|
|
2020
2032
|
}
|
|
2021
|
-
function Wr(
|
|
2022
|
-
const e =
|
|
2023
|
-
G.getInstance().setSubscribedGames(e), ct.getInstance().init(), G.getInstance().init(), K.getInstance().init(), H.getInstance().init()
|
|
2024
|
-
|
|
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,
|
|
2025
2039
|
userId: lt.generateUniqueIdentifier()
|
|
2026
2040
|
})), Ve.on("quit", () => {
|
|
2027
2041
|
qr();
|
|
@@ -2030,45 +2044,45 @@ function Wr(s) {
|
|
|
2030
2044
|
function qr() {
|
|
2031
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();
|
|
2032
2046
|
}
|
|
2033
|
-
function Qr(
|
|
2034
|
-
return
|
|
2035
|
-
const
|
|
2036
|
-
return t[
|
|
2047
|
+
function Qr(n, e) {
|
|
2048
|
+
return n.reduce((t, r) => {
|
|
2049
|
+
const s = r.key;
|
|
2050
|
+
return t[s] = {
|
|
2037
2051
|
// prettier-ignore
|
|
2038
2052
|
on(a, o) {
|
|
2039
|
-
const i = $(
|
|
2053
|
+
const i = $(s, a), l = e.get(i) ?? /* @__PURE__ */ new Set();
|
|
2040
2054
|
l.add(o), e.set(i, l);
|
|
2041
2055
|
},
|
|
2042
2056
|
onAny(a) {
|
|
2043
|
-
const o = $(
|
|
2057
|
+
const o = $(s, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
|
|
2044
2058
|
i.add(a), e.set(o, i);
|
|
2045
2059
|
},
|
|
2046
2060
|
// prettier-ignore
|
|
2047
2061
|
off(a, o) {
|
|
2048
|
-
const i = $(
|
|
2062
|
+
const i = $(s, a), l = e.get(i) ?? /* @__PURE__ */ new Set();
|
|
2049
2063
|
l.delete(o), e.set(i, l);
|
|
2050
2064
|
},
|
|
2051
2065
|
// prettier-ignore
|
|
2052
2066
|
offAny(a) {
|
|
2053
|
-
const o = $(
|
|
2067
|
+
const o = $(s, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
|
|
2054
2068
|
i.delete(a), e.set(o, i);
|
|
2055
2069
|
}
|
|
2056
2070
|
}, t;
|
|
2057
2071
|
}, {});
|
|
2058
2072
|
}
|
|
2059
2073
|
function Yr() {
|
|
2060
|
-
const
|
|
2074
|
+
const n = C.getInstance(), e = G.getInstance();
|
|
2061
2075
|
return {
|
|
2062
2076
|
on: (t, r) => {
|
|
2063
2077
|
switch (t) {
|
|
2064
2078
|
case "fatal":
|
|
2065
|
-
|
|
2079
|
+
n.on("fatal", r);
|
|
2066
2080
|
break;
|
|
2067
2081
|
case "error":
|
|
2068
|
-
|
|
2082
|
+
n.on("error", r);
|
|
2069
2083
|
break;
|
|
2070
2084
|
case "warning":
|
|
2071
|
-
|
|
2085
|
+
n.on("warning", r);
|
|
2072
2086
|
break;
|
|
2073
2087
|
case "gameLaunch":
|
|
2074
2088
|
e.on("gameLaunch", r);
|
|
@@ -2086,13 +2100,13 @@ function Yr() {
|
|
|
2086
2100
|
off: (t, r) => {
|
|
2087
2101
|
switch (t) {
|
|
2088
2102
|
case "fatal":
|
|
2089
|
-
|
|
2103
|
+
n.off("fatal", r);
|
|
2090
2104
|
break;
|
|
2091
2105
|
case "error":
|
|
2092
|
-
|
|
2106
|
+
n.off("error", r);
|
|
2093
2107
|
break;
|
|
2094
2108
|
case "warning":
|
|
2095
|
-
|
|
2109
|
+
n.off("warning", r);
|
|
2096
2110
|
break;
|
|
2097
2111
|
case "gameLaunch":
|
|
2098
2112
|
e.off("gameLaunch", r);
|
|
@@ -2109,23 +2123,23 @@ function Yr() {
|
|
|
2109
2123
|
}
|
|
2110
2124
|
};
|
|
2111
2125
|
}
|
|
2112
|
-
function $(
|
|
2113
|
-
return `${
|
|
2126
|
+
function $(n, e) {
|
|
2127
|
+
return `${n}:${e}`;
|
|
2114
2128
|
}
|
|
2115
|
-
function Jr(
|
|
2129
|
+
function Jr(n, e) {
|
|
2116
2130
|
const t = ke.getInstance();
|
|
2117
|
-
function r(
|
|
2118
|
-
const a = Nr(
|
|
2131
|
+
function r(s) {
|
|
2132
|
+
const a = Nr(s);
|
|
2119
2133
|
if (a instanceof R.errors) {
|
|
2120
2134
|
C.getInstance().warn("Invalid event", "INVALID_EVENT", {
|
|
2121
2135
|
summary: a.summary
|
|
2122
2136
|
});
|
|
2123
2137
|
return;
|
|
2124
2138
|
}
|
|
2125
|
-
const o =
|
|
2139
|
+
const o = n.modules.find((d) => d.key === a.game), i = o == null ? void 0 : o.events.event;
|
|
2126
2140
|
if (!i)
|
|
2127
2141
|
return;
|
|
2128
|
-
const l = i(
|
|
2142
|
+
const l = i(s);
|
|
2129
2143
|
if (l instanceof R.errors) {
|
|
2130
2144
|
C.getInstance().warn("Invalid event", "INVALID_EVENT", {
|
|
2131
2145
|
summary: l.summary
|
|
@@ -2137,26 +2151,26 @@ function Jr(s, e) {
|
|
|
2137
2151
|
d(l);
|
|
2138
2152
|
});
|
|
2139
2153
|
}
|
|
2140
|
-
return t.on("data", (
|
|
2154
|
+
return t.on("data", (s) => s.forEach(r)), t.on("error", (s) => {
|
|
2141
2155
|
C.getInstance().error("Pipe server error", "PIPE_SERVER_ERROR", {
|
|
2142
|
-
error:
|
|
2156
|
+
error: s
|
|
2143
2157
|
});
|
|
2144
2158
|
}), t;
|
|
2145
2159
|
}
|
|
2146
|
-
function Xr(
|
|
2147
|
-
const e = new Gr(
|
|
2148
|
-
for (const
|
|
2149
|
-
t[
|
|
2160
|
+
function Xr(n) {
|
|
2161
|
+
const e = new Gr(n), t = {};
|
|
2162
|
+
for (const s in n)
|
|
2163
|
+
t[s] = {
|
|
2150
2164
|
on: (a, o) => {
|
|
2151
2165
|
switch (a) {
|
|
2152
2166
|
case "down":
|
|
2153
|
-
e.onKeybindDown(
|
|
2167
|
+
e.onKeybindDown(s, o);
|
|
2154
2168
|
break;
|
|
2155
2169
|
case "up":
|
|
2156
|
-
e.onKeybindUp(
|
|
2170
|
+
e.onKeybindUp(s, o);
|
|
2157
2171
|
break;
|
|
2158
2172
|
case "toggle":
|
|
2159
|
-
e.onKeybindToggled(
|
|
2173
|
+
e.onKeybindToggled(s, o);
|
|
2160
2174
|
break;
|
|
2161
2175
|
default:
|
|
2162
2176
|
throw new Error(`Event type not implemented ${a}`, { cause: [a, o] });
|
|
@@ -2172,11 +2186,11 @@ function Xr(s) {
|
|
|
2172
2186
|
resumeKeybindListening: () => {
|
|
2173
2187
|
e.keybindListeningPaused = !1;
|
|
2174
2188
|
},
|
|
2175
|
-
updateKeybind: (
|
|
2176
|
-
e.updateKeybind(
|
|
2189
|
+
updateKeybind: (s, a) => {
|
|
2190
|
+
e.updateKeybind(s, a);
|
|
2177
2191
|
},
|
|
2178
|
-
updateKeybinds: (
|
|
2179
|
-
e.updateKeybinds(
|
|
2192
|
+
updateKeybinds: (s) => {
|
|
2193
|
+
e.updateKeybinds(s);
|
|
2180
2194
|
}
|
|
2181
2195
|
};
|
|
2182
2196
|
return e.init(), Ve.on("quit", () => {
|
|
@@ -2185,61 +2199,67 @@ function Xr(s) {
|
|
|
2185
2199
|
}
|
|
2186
2200
|
function Zr() {
|
|
2187
2201
|
return {
|
|
2188
|
-
createWindow: (
|
|
2189
|
-
on: (
|
|
2190
|
-
off: (
|
|
2191
|
-
once: (
|
|
2192
|
-
addListener: (
|
|
2193
|
-
removeListener: (
|
|
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),
|
|
2194
2208
|
removeAllListeners: () => w().instance.removeAllListeners(),
|
|
2195
|
-
prependListener: (
|
|
2196
|
-
prependOnceListener: (
|
|
2209
|
+
prependListener: (n, e) => w().instance.prependListener(n, e),
|
|
2210
|
+
prependOnceListener: (n, e) => w().instance.prependOnceListener(n, e),
|
|
2197
2211
|
getActiveGameInfo: () => {
|
|
2198
|
-
const
|
|
2212
|
+
const n = w(), e = ke.getInstance();
|
|
2199
2213
|
return {
|
|
2200
|
-
resolution:
|
|
2214
|
+
resolution: n.resolution,
|
|
2201
2215
|
isConnected: e.hasConnection
|
|
2202
2216
|
};
|
|
2203
2217
|
}
|
|
2204
2218
|
};
|
|
2205
2219
|
}
|
|
2206
|
-
function
|
|
2220
|
+
function en() {
|
|
2207
2221
|
return {
|
|
2208
|
-
scope: (
|
|
2222
|
+
scope: (n) => Ur.getInstance().scope(n),
|
|
2209
2223
|
raw: {
|
|
2210
|
-
setGlobalMouseBlock: (
|
|
2211
|
-
setGlobalKeyboardBlock: (
|
|
2212
|
-
setGlobalCursorOverride: (
|
|
2213
|
-
setKeyInputBlock: (
|
|
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),
|
|
2214
2228
|
getGlobalMouseBlock: () => w().instance.getGlobalMouseBlock(),
|
|
2215
2229
|
getGlobalKeyboardBlock: () => w().instance.getGlobalKeyboardBlock(),
|
|
2216
2230
|
getGlobalCursorOverride: () => w().instance.getGlobalCursorOverride(),
|
|
2217
|
-
getKeyInputBlock: (
|
|
2231
|
+
getKeyInputBlock: (n) => w().instance.getKeyInputBlock(n)
|
|
2218
2232
|
}
|
|
2219
2233
|
};
|
|
2220
2234
|
}
|
|
2221
|
-
function
|
|
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() {
|
|
2222
2242
|
return {
|
|
2223
|
-
registerWindow: (
|
|
2224
|
-
Hr.setupRevUtils(
|
|
2243
|
+
registerWindow: (n) => {
|
|
2244
|
+
Hr.setupRevUtils(n, global.OVERLAYED.electron);
|
|
2225
2245
|
}
|
|
2226
2246
|
};
|
|
2227
2247
|
}
|
|
2228
|
-
function
|
|
2229
|
-
|
|
2230
|
-
|
|
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", {
|
|
2231
2251
|
message: e.message,
|
|
2232
2252
|
code: e.code,
|
|
2233
2253
|
data: e.data
|
|
2234
2254
|
});
|
|
2235
2255
|
}), C.getInstance().on("error", (e) => {
|
|
2236
|
-
|
|
2256
|
+
M.getInstance().trackLog("error", {
|
|
2237
2257
|
message: e.message,
|
|
2238
2258
|
code: e.code,
|
|
2239
2259
|
data: e.data
|
|
2240
2260
|
});
|
|
2241
2261
|
}), C.getInstance().on("warning", (e) => {
|
|
2242
|
-
|
|
2262
|
+
M.getInstance().trackLog("warning", {
|
|
2243
2263
|
message: e.message,
|
|
2244
2264
|
code: e.code,
|
|
2245
2265
|
data: e.data
|
|
@@ -2250,7 +2270,7 @@ function w() {
|
|
|
2250
2270
|
return B.getInstance().getInterface("OGG_SIEGE");
|
|
2251
2271
|
}
|
|
2252
2272
|
export {
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2273
|
+
Nn as overlayed,
|
|
2274
|
+
An as setFetchLatestTokenCallback,
|
|
2275
|
+
Dn as setUpdaterTokenResolver
|
|
2256
2276
|
};
|