@tixyel/streamelements 6.4.9 → 6.5.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 +18 -2
- package/dist/index.es.js +655 -650
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -174,13 +174,13 @@ class et {
|
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
case "youtube": {
|
|
177
|
-
const c = t.data,
|
|
177
|
+
const c = t.data, y = {
|
|
178
178
|
isVerified: "verified",
|
|
179
179
|
isChatOwner: "owner",
|
|
180
180
|
isChatSponsor: "sponsor",
|
|
181
181
|
isChatModerator: "moderator"
|
|
182
182
|
};
|
|
183
|
-
i = c.event.data.nick || c.event.data.displayName, s = Object.entries(c.event.data.authorDetails).filter(([p,
|
|
183
|
+
i = c.event.data.nick || c.event.data.displayName, s = Object.entries(c.event.data.authorDetails).filter(([p, l]) => p.startsWith("is") && l).map(([p]) => y[p]).filter(Boolean), s.includes("sponsor") && (s.push("premium"), s.push("prime")), s.includes("owner") && (s.push("moderator"), s.push("broadcaster"));
|
|
184
184
|
break;
|
|
185
185
|
}
|
|
186
186
|
case "kick":
|
|
@@ -369,17 +369,17 @@ const pt = [
|
|
|
369
369
|
"yellowgreen",
|
|
370
370
|
"transparent"
|
|
371
371
|
];
|
|
372
|
-
function wt(
|
|
372
|
+
function wt(h, e) {
|
|
373
373
|
if (!e) return null;
|
|
374
374
|
switch (e) {
|
|
375
375
|
case "hex": {
|
|
376
|
-
const t =
|
|
376
|
+
const t = h.replace("#", "");
|
|
377
377
|
let a = 0, i = 0, s = 0, n = 1;
|
|
378
378
|
return t.length === 3 ? (a = parseInt(t[0] + t[0], 16), i = parseInt(t[1] + t[1], 16), s = parseInt(t[2] + t[2], 16)) : t.length === 6 ? (a = parseInt(t.slice(0, 2), 16), i = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16)) : t.length === 4 ? (a = parseInt(t[0] + t[0], 16), i = parseInt(t[1] + t[1], 16), s = parseInt(t[2] + t[2], 16), n = parseInt(t[3] + t[3], 16) / 255) : t.length === 8 && (a = parseInt(t.slice(0, 2), 16), i = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16), n = parseInt(t.slice(6, 8), 16) / 255), { r: a, g: i, b: s, a: n };
|
|
379
379
|
}
|
|
380
380
|
case "rgb":
|
|
381
381
|
case "rgba": {
|
|
382
|
-
const t =
|
|
382
|
+
const t = h.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);
|
|
383
383
|
return t ? {
|
|
384
384
|
r: parseInt(t[1]),
|
|
385
385
|
g: parseInt(t[2]),
|
|
@@ -389,7 +389,7 @@ function wt(l, e) {
|
|
|
389
389
|
}
|
|
390
390
|
case "hsl":
|
|
391
391
|
case "hsla": {
|
|
392
|
-
const t =
|
|
392
|
+
const t = h.match(/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*([\d.]+))?\s*\)/);
|
|
393
393
|
if (!t) return null;
|
|
394
394
|
const a = parseInt(t[1]), i = parseInt(t[2]), s = parseInt(t[3]), n = t[4] ? parseFloat(t[4]) : 1;
|
|
395
395
|
return { ...kt(a, i, s), a: n };
|
|
@@ -399,7 +399,7 @@ function wt(l, e) {
|
|
|
399
399
|
t.width = t.height = 1;
|
|
400
400
|
const a = t.getContext("2d");
|
|
401
401
|
if (!a) return null;
|
|
402
|
-
a.fillStyle =
|
|
402
|
+
a.fillStyle = h, a.fillRect(0, 0, 1, 1);
|
|
403
403
|
const [i, s, n] = a.getImageData(0, 0, 1, 1).data;
|
|
404
404
|
return { r: i, g: s, b: n, a: 1 };
|
|
405
405
|
}
|
|
@@ -407,26 +407,26 @@ function wt(l, e) {
|
|
|
407
407
|
return null;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
function vt(
|
|
410
|
+
function vt(h, e = !0) {
|
|
411
411
|
const t = (i) => Math.round(i).toString(16).padStart(2, "0");
|
|
412
|
-
let a = `#${t(
|
|
413
|
-
return e &&
|
|
412
|
+
let a = `#${t(h.r)}${t(h.g)}${t(h.b)}`;
|
|
413
|
+
return e && h.a < 1 && (a += t(h.a * 255)), a;
|
|
414
414
|
}
|
|
415
|
-
function ut(
|
|
416
|
-
|
|
417
|
-
const a = Math.max(
|
|
415
|
+
function ut(h, e, t) {
|
|
416
|
+
h /= 255, e /= 255, t /= 255;
|
|
417
|
+
const a = Math.max(h, e, t), i = Math.min(h, e, t), s = a - i;
|
|
418
418
|
let n = 0, m = 0;
|
|
419
419
|
const c = (a + i) / 2;
|
|
420
420
|
if (s !== 0)
|
|
421
421
|
switch (m = c > 0.5 ? s / (2 - a - i) : s / (a + i), a) {
|
|
422
|
-
case
|
|
422
|
+
case h:
|
|
423
423
|
n = ((e - t) / s + (e < t ? 6 : 0)) / 6;
|
|
424
424
|
break;
|
|
425
425
|
case e:
|
|
426
|
-
n = ((t -
|
|
426
|
+
n = ((t - h) / s + 2) / 6;
|
|
427
427
|
break;
|
|
428
428
|
case t:
|
|
429
|
-
n = ((
|
|
429
|
+
n = ((h - e) / s + 4) / 6;
|
|
430
430
|
break;
|
|
431
431
|
}
|
|
432
432
|
return {
|
|
@@ -435,14 +435,14 @@ function ut(l, e, t) {
|
|
|
435
435
|
l: Math.round(c * 100)
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
|
-
function kt(
|
|
439
|
-
|
|
438
|
+
function kt(h, e, t) {
|
|
439
|
+
h /= 360, e /= 100, t /= 100;
|
|
440
440
|
let a, i, s;
|
|
441
441
|
if (e === 0)
|
|
442
442
|
a = i = s = t;
|
|
443
443
|
else {
|
|
444
|
-
const n = (
|
|
445
|
-
a = n(c, m,
|
|
444
|
+
const n = (y, p, l) => (l < 0 && (l += 1), l > 1 && (l -= 1), l < 0.16666666666666666 ? y + (p - y) * 6 * l : l < 0.5 ? p : l < 0.6666666666666666 ? y + (p - y) * (0.6666666666666666 - l) * 6 : y), m = t < 0.5 ? t * (1 + e) : t + e - t * e, c = 2 * t - m;
|
|
445
|
+
a = n(c, m, h + 1 / 3), i = n(c, m, h), s = n(c, m, h - 1 / 3);
|
|
446
446
|
}
|
|
447
447
|
return {
|
|
448
448
|
r: Math.round(a * 255),
|
|
@@ -450,7 +450,7 @@ function kt(l, e, t) {
|
|
|
450
450
|
b: Math.round(s * 255)
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
|
-
async function Ct(
|
|
453
|
+
async function Ct(h, e, t) {
|
|
454
454
|
const a = pt;
|
|
455
455
|
let i = a[0], s = 1 / 0;
|
|
456
456
|
for await (const n of a) {
|
|
@@ -459,8 +459,8 @@ async function Ct(l, e, t) {
|
|
|
459
459
|
const c = m.getContext("2d");
|
|
460
460
|
if (!c) continue;
|
|
461
461
|
c.fillStyle = n, c.fillRect(0, 0, 1, 1);
|
|
462
|
-
const [
|
|
463
|
-
if (
|
|
462
|
+
const [y, p, l] = c.getImageData(0, 0, 1, 1).data, o = Math.sqrt(Math.pow(h - y, 2) + Math.pow(e - p, 2) + Math.pow(t - l, 2));
|
|
463
|
+
if (o < s && (s = o, i = n), o === 0) break;
|
|
464
464
|
}
|
|
465
465
|
return i;
|
|
466
466
|
}
|
|
@@ -1914,11 +1914,11 @@ const jt = [
|
|
|
1914
1914
|
}
|
|
1915
1915
|
}
|
|
1916
1916
|
]).reduce(
|
|
1917
|
-
(
|
|
1917
|
+
(h, e) => (h.some((t) => t.name === e.name) || h.push({
|
|
1918
1918
|
...e,
|
|
1919
1919
|
start: 0,
|
|
1920
1920
|
end: 0
|
|
1921
|
-
}),
|
|
1921
|
+
}), h),
|
|
1922
1922
|
[]
|
|
1923
1923
|
), Et = [], It = [
|
|
1924
1924
|
"Hello everyone!",
|
|
@@ -5233,15 +5233,15 @@ const jt = [
|
|
|
5233
5233
|
index: 121
|
|
5234
5234
|
}
|
|
5235
5235
|
];
|
|
5236
|
-
var
|
|
5237
|
-
((
|
|
5238
|
-
|
|
5239
|
-
})(
|
|
5240
|
-
var
|
|
5241
|
-
((
|
|
5236
|
+
var P;
|
|
5237
|
+
((h) => {
|
|
5238
|
+
h.avatars = jt, h.badges = xt, h.css_color_names = pt, h.emotes = Ut, h.items = Et, h.messages = It, h.names = Tt, h.tiers = St, h.tts = Dt, h.youtube_emotes = At;
|
|
5239
|
+
})(P || (P = {}));
|
|
5240
|
+
var w;
|
|
5241
|
+
((h) => {
|
|
5242
5242
|
let e;
|
|
5243
5243
|
((n) => {
|
|
5244
|
-
function m(
|
|
5244
|
+
function m(l, o = "cardinal") {
|
|
5245
5245
|
const f = {
|
|
5246
5246
|
single: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"],
|
|
5247
5247
|
tens: [
|
|
@@ -5292,7 +5292,7 @@ var y;
|
|
|
5292
5292
|
"eightieth",
|
|
5293
5293
|
"ninetieth"
|
|
5294
5294
|
]
|
|
5295
|
-
}, g = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"],
|
|
5295
|
+
}, g = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"], b = [
|
|
5296
5296
|
"",
|
|
5297
5297
|
"thousand",
|
|
5298
5298
|
"million",
|
|
@@ -5300,288 +5300,293 @@ var y;
|
|
|
5300
5300
|
"trillion",
|
|
5301
5301
|
"quadrillion",
|
|
5302
5302
|
"quintillion"
|
|
5303
|
-
],
|
|
5304
|
-
if (
|
|
5305
|
-
const
|
|
5306
|
-
if (
|
|
5307
|
-
const M =
|
|
5308
|
-
return `${
|
|
5309
|
-
}
|
|
5310
|
-
function
|
|
5311
|
-
if (
|
|
5312
|
-
if (
|
|
5313
|
-
const H = Math.floor(
|
|
5303
|
+
], v = b.map((U) => U ? `${U}th` : "");
|
|
5304
|
+
if (l = Math.abs(Math.floor(l)), o === "suffix") {
|
|
5305
|
+
const U = l % 100;
|
|
5306
|
+
if (U >= 11 && U <= 13) return `${l}th`;
|
|
5307
|
+
const M = l % 10;
|
|
5308
|
+
return `${l}${g[M]}`;
|
|
5309
|
+
}
|
|
5310
|
+
function j(U, M) {
|
|
5311
|
+
if (U < 10) return M === "ordinal" ? d.single[U] : f.single[U];
|
|
5312
|
+
if (U < 20) return M === "ordinal" ? d.tens[U - 10] : f.tens[U - 10];
|
|
5313
|
+
const H = Math.floor(U / 10), O = U % 10;
|
|
5314
5314
|
if (O === 0)
|
|
5315
5315
|
return M === "ordinal" ? d.decades[H - 2] : f.decades[H - 2];
|
|
5316
5316
|
const W = f.decades[H - 2], S = M === "ordinal" ? d.single[O] : f.single[O];
|
|
5317
5317
|
return `${W}-${S}`;
|
|
5318
5318
|
}
|
|
5319
|
-
function
|
|
5320
|
-
if (
|
|
5321
|
-
const H = Math.floor(
|
|
5322
|
-
return H > 0 && (M === "ordinal" && O === 0 ? W.push(`${f.single[H]} hundredth`) : W.push(`${f.single[H]} hundred`)), O > 0 && W.push(
|
|
5323
|
-
}
|
|
5324
|
-
if (
|
|
5325
|
-
const
|
|
5326
|
-
let
|
|
5327
|
-
for (;
|
|
5328
|
-
|
|
5329
|
-
let
|
|
5330
|
-
for (let
|
|
5319
|
+
function C(U, M) {
|
|
5320
|
+
if (U === 0) return M === "ordinal" ? d.single[0] : f.single[0];
|
|
5321
|
+
const H = Math.floor(U / 100), O = U % 100, W = [];
|
|
5322
|
+
return H > 0 && (M === "ordinal" && O === 0 ? W.push(`${f.single[H]} hundredth`) : W.push(`${f.single[H]} hundred`)), O > 0 && W.push(j(O, M)), W.join(" ");
|
|
5323
|
+
}
|
|
5324
|
+
if (l < 1e3) return C(l, o);
|
|
5325
|
+
const x = [];
|
|
5326
|
+
let A = l;
|
|
5327
|
+
for (; A > 0; )
|
|
5328
|
+
x.push(A % 1e3), A = Math.floor(A / 1e3);
|
|
5329
|
+
let J = -1;
|
|
5330
|
+
for (let U = 0; U < x.length; U++) x[U] !== 0 && (J = U);
|
|
5331
5331
|
const _ = [];
|
|
5332
|
-
for (let
|
|
5333
|
-
const M = U
|
|
5332
|
+
for (let U = x.length - 1; U >= 0; U--) {
|
|
5333
|
+
const M = x[U];
|
|
5334
5334
|
if (M === 0) continue;
|
|
5335
|
-
const H =
|
|
5336
|
-
if (
|
|
5337
|
-
let O =
|
|
5335
|
+
const H = b[U];
|
|
5336
|
+
if (o === "cardinal") {
|
|
5337
|
+
let O = C(M, "cardinal");
|
|
5338
5338
|
H && (O += ` ${H}`), _.push(O);
|
|
5339
|
-
} else if (
|
|
5340
|
-
if (
|
|
5341
|
-
const W =
|
|
5339
|
+
} else if (U === J)
|
|
5340
|
+
if (U > 0) {
|
|
5341
|
+
const W = C(M, "cardinal"), S = v[U];
|
|
5342
5342
|
_.push(W ? `${W} ${S}` : S);
|
|
5343
5343
|
} else {
|
|
5344
|
-
const W =
|
|
5344
|
+
const W = C(M, "ordinal");
|
|
5345
5345
|
_.push(W);
|
|
5346
5346
|
}
|
|
5347
5347
|
else {
|
|
5348
|
-
let W =
|
|
5348
|
+
let W = C(M, "cardinal");
|
|
5349
5349
|
H && (W += ` ${H}`), _.push(W);
|
|
5350
5350
|
}
|
|
5351
5351
|
}
|
|
5352
5352
|
return _.join(", ");
|
|
5353
5353
|
}
|
|
5354
5354
|
n.translate = m;
|
|
5355
|
-
function c(
|
|
5356
|
-
const g = Math.min(Math.max(
|
|
5357
|
-
return
|
|
5355
|
+
function c(l, o = 0, f = 100, d = 0) {
|
|
5356
|
+
const g = Math.min(Math.max(l, o), f);
|
|
5357
|
+
return y(g, d);
|
|
5358
5358
|
}
|
|
5359
5359
|
n.balance = c;
|
|
5360
|
-
function
|
|
5361
|
-
const f = Math.pow(10,
|
|
5362
|
-
return Math.round(
|
|
5360
|
+
function y(l, o = 2) {
|
|
5361
|
+
const f = Math.pow(10, o);
|
|
5362
|
+
return Math.round(l * f) / f;
|
|
5363
5363
|
}
|
|
5364
|
-
n.round =
|
|
5365
|
-
function p(
|
|
5366
|
-
|
|
5367
|
-
const d = Math.random() * (
|
|
5364
|
+
n.round = y;
|
|
5365
|
+
function p(l, o, f = 0) {
|
|
5366
|
+
l > o && ([l, o] = [o, l]);
|
|
5367
|
+
const d = Math.random() * (o - l) + l;
|
|
5368
5368
|
return f ? Number(d.toFixed(f)) : Math.round(d);
|
|
5369
5369
|
}
|
|
5370
5370
|
n.number = p;
|
|
5371
|
-
})(e =
|
|
5371
|
+
})(e = h.number || (h.number = {}));
|
|
5372
5372
|
let t;
|
|
5373
5373
|
((n) => {
|
|
5374
|
-
function m(
|
|
5374
|
+
function m(o, f, d) {
|
|
5375
5375
|
const g = f.match(/^<span(?: class="[^"]*")? style="([^"]*)">(.*)<\/span>$/s);
|
|
5376
5376
|
if (g) {
|
|
5377
|
-
const
|
|
5378
|
-
let
|
|
5379
|
-
return
|
|
5377
|
+
const b = g[1], v = g[2], j = g[0].match(/class="([^"]*)"/)?.[1] || "";
|
|
5378
|
+
let C = [b, o].filter((x) => x.length).map((x) => x.endsWith(";") ? x.slice(0, -1) : x).join("; ").replace(/\s*;\s*/g, "; ").trim();
|
|
5379
|
+
return C.endsWith(";") || (C += ";"), `<span${j ? ` class="${j} ${d ?? ""}"` : ""}${C ? ` style="${C}"` : ""}>${v}</span>`;
|
|
5380
5380
|
} else
|
|
5381
|
-
return
|
|
5381
|
+
return o && o.length && !o.endsWith(";") && (o += ";"), `<span${d ? ` class="${d}"` : ""}${o ? ` style="${o}"` : ""}>${f}</span>`;
|
|
5382
5382
|
}
|
|
5383
5383
|
n.mergeSpanStyles = m;
|
|
5384
|
-
function c(
|
|
5385
|
-
const { return:
|
|
5386
|
-
if (!
|
|
5384
|
+
function c(o, f = 0, d = 1, g) {
|
|
5385
|
+
const { return: b = !1, parent: v, base: j } = g || {}, C = v || o.parentElement || document.body;
|
|
5386
|
+
if (!C)
|
|
5387
5387
|
throw new Error("No parent element found for scaling");
|
|
5388
|
-
const
|
|
5389
|
-
if (
|
|
5388
|
+
const x = C.getBoundingClientRect(), A = o.offsetWidth, J = o.offsetHeight;
|
|
5389
|
+
if (A === 0 || J === 0)
|
|
5390
5390
|
throw new Error("Element has zero width or height, cannot scale");
|
|
5391
|
-
const _ =
|
|
5392
|
-
let M =
|
|
5391
|
+
const _ = x.width * d / A, U = x.height * d / J;
|
|
5392
|
+
let M = j === "width" ? _ : j === "height" ? U : Math.min(_, U);
|
|
5393
5393
|
if (f > 0) {
|
|
5394
|
-
const O =
|
|
5394
|
+
const O = x.width * f / A, W = x.height * f / J, S = Math.max(O, W);
|
|
5395
5395
|
M = Math.max(S, M);
|
|
5396
5396
|
}
|
|
5397
5397
|
const H = {
|
|
5398
|
-
width:
|
|
5399
|
-
height:
|
|
5398
|
+
width: A * M,
|
|
5399
|
+
height: J * M,
|
|
5400
5400
|
scale: M
|
|
5401
5401
|
};
|
|
5402
|
-
return
|
|
5402
|
+
return b || (o.style.transform = `scale(${M})`, o.style.transformOrigin = "center center"), H;
|
|
5403
5403
|
}
|
|
5404
5404
|
n.scale = c;
|
|
5405
|
-
function
|
|
5405
|
+
function y(o, f = {}) {
|
|
5406
5406
|
const {
|
|
5407
|
-
parent: d =
|
|
5407
|
+
parent: d = o.parentElement,
|
|
5408
5408
|
prefer: g = "auto",
|
|
5409
|
-
min:
|
|
5410
|
-
max:
|
|
5411
|
-
apply:
|
|
5409
|
+
min: b = 0,
|
|
5410
|
+
max: v = 1,
|
|
5411
|
+
apply: j = () => {
|
|
5412
5412
|
}
|
|
5413
5413
|
} = f;
|
|
5414
5414
|
if (!d)
|
|
5415
5415
|
throw new Error("No parent element found for scaling");
|
|
5416
|
-
const
|
|
5417
|
-
let M =
|
|
5416
|
+
const C = d.getBoundingClientRect(), x = o.getBoundingClientRect(), A = C.width, J = C.height, _ = x.width, U = x.height;
|
|
5417
|
+
let M = A * b / _, H = J * b / U, O = A * v / _, W = J * v / U, S = Math.min(O, W);
|
|
5418
5418
|
const it = Math.max(M, H);
|
|
5419
5419
|
S = Math.max(S, it);
|
|
5420
|
-
const q = _ * S, G =
|
|
5421
|
-
return g === "width" ? S = Math.max(M, Math.min(O,
|
|
5420
|
+
const q = _ * S, G = U * S;
|
|
5421
|
+
return g === "width" ? S = Math.max(M, Math.min(O, A / _)) : g === "height" ? S = Math.max(H, Math.min(W, J / U)) : q > A ? S = Math.max(M, Math.min(O, A / _)) : G > J && (S = Math.max(H, Math.min(W, J / U))), j.apply(o, [S, o]), S;
|
|
5422
5422
|
}
|
|
5423
|
-
n.scalev2 =
|
|
5424
|
-
function p(
|
|
5425
|
-
const g = parseFloat(getComputedStyle(
|
|
5423
|
+
n.scalev2 = y;
|
|
5424
|
+
function p(o, f = 1, d = {}) {
|
|
5425
|
+
const g = parseFloat(getComputedStyle(o).getPropertyValue("font-size")), b = {
|
|
5426
5426
|
minFontSize: d?.minFontSize ?? 0,
|
|
5427
5427
|
maxFontSize: d?.maxFontSize ?? g
|
|
5428
|
-
},
|
|
5429
|
-
if (!
|
|
5428
|
+
}, v = d?.parent || o.parentElement;
|
|
5429
|
+
if (!v)
|
|
5430
5430
|
throw new Error("No parent element found for fitting text");
|
|
5431
|
-
const
|
|
5432
|
-
return
|
|
5431
|
+
const j = v.clientWidth * f, C = o.offsetWidth, x = j / C, A = g * x, J = e.balance(A, b.minFontSize, b.maxFontSize);
|
|
5432
|
+
return o.style.fontSize = J + "px", o;
|
|
5433
5433
|
}
|
|
5434
5434
|
n.fitText = p;
|
|
5435
|
-
function o
|
|
5436
|
-
const g = new DOMParser(),
|
|
5437
|
-
let
|
|
5438
|
-
function
|
|
5439
|
-
if (
|
|
5440
|
-
const
|
|
5435
|
+
function l(o, f = 0, d = !1) {
|
|
5436
|
+
const g = new DOMParser(), b = document.createElement("div");
|
|
5437
|
+
let v = f;
|
|
5438
|
+
function j(x) {
|
|
5439
|
+
if (x.nodeType === Node.TEXT_NODE) {
|
|
5440
|
+
const J = (x.textContent || "").split("").map((U, M) => {
|
|
5441
5441
|
const H = document.createElement("span");
|
|
5442
|
-
return H.classList.add("char"), H.dataset.index = String(
|
|
5443
|
-
` ||
|
|
5442
|
+
return H.classList.add("char"), H.dataset.index = String(v), H.dataset.exclusivityIndex = String(M), H.style.setProperty("--char-index", String(v)), H.style.setProperty("--exclusivity-index", String(M)), U === " " || U === `
|
|
5443
|
+
` || U === " " ? H.style.whiteSpace = "pre-wrap" : v++, H.textContent = U, H;
|
|
5444
5444
|
}), _ = document.createDocumentFragment();
|
|
5445
|
-
return
|
|
5446
|
-
} else if (
|
|
5447
|
-
const
|
|
5448
|
-
return
|
|
5449
|
-
const _ =
|
|
5450
|
-
|
|
5451
|
-
}),
|
|
5452
|
-
}
|
|
5453
|
-
return
|
|
5454
|
-
}
|
|
5455
|
-
g.parseFromString(
|
|
5456
|
-
if (!d &&
|
|
5445
|
+
return J.forEach((U) => _.appendChild(U)), _;
|
|
5446
|
+
} else if (x.nodeType === Node.ELEMENT_NODE) {
|
|
5447
|
+
const A = x.cloneNode(!1);
|
|
5448
|
+
return A.classList.add("container"), A.dataset.index = String(v), A.style.setProperty("--char-index", String(v)), A.style.setProperty("--exclusivity-index", String(v)), v++, x.childNodes.forEach((J) => {
|
|
5449
|
+
const _ = j(J);
|
|
5450
|
+
A.appendChild(_);
|
|
5451
|
+
}), A;
|
|
5452
|
+
}
|
|
5453
|
+
return x.cloneNode(!0);
|
|
5454
|
+
}
|
|
5455
|
+
g.parseFromString(o, "text/html").body.childNodes.forEach((x) => {
|
|
5456
|
+
if (!d && x.nodeType === Node.TEXT_NODE && !x.textContent?.trim())
|
|
5457
5457
|
return;
|
|
5458
|
-
const
|
|
5459
|
-
|
|
5458
|
+
const A = j(x);
|
|
5459
|
+
b.appendChild(A);
|
|
5460
5460
|
});
|
|
5461
|
-
let
|
|
5462
|
-
return Array.from(
|
|
5463
|
-
|
|
5464
|
-
}),
|
|
5461
|
+
let C = "";
|
|
5462
|
+
return Array.from(b.childNodes).forEach((x) => {
|
|
5463
|
+
x.nodeType === Node.TEXT_NODE ? C += x.textContent : C += x.outerHTML;
|
|
5464
|
+
}), C;
|
|
5465
5465
|
}
|
|
5466
|
-
n.splitTextToChars =
|
|
5467
|
-
})(t =
|
|
5466
|
+
n.splitTextToChars = l;
|
|
5467
|
+
})(t = h.element || (h.element = {}));
|
|
5468
5468
|
let a;
|
|
5469
5469
|
((n) => {
|
|
5470
|
-
function m(
|
|
5470
|
+
function m(l, o = !0, f = "") {
|
|
5471
5471
|
const d = {};
|
|
5472
|
-
for (const g in
|
|
5473
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
5474
|
-
const
|
|
5475
|
-
if (
|
|
5476
|
-
d[
|
|
5472
|
+
for (const g in l) {
|
|
5473
|
+
if (!Object.prototype.hasOwnProperty.call(l, g)) continue;
|
|
5474
|
+
const b = l[g], v = f ? `${f}.${g}` : g;
|
|
5475
|
+
if (b == null) {
|
|
5476
|
+
d[v] = String(b);
|
|
5477
5477
|
continue;
|
|
5478
5478
|
}
|
|
5479
|
-
if (typeof
|
|
5480
|
-
d[
|
|
5479
|
+
if (typeof b == "number" && isNaN(b)) {
|
|
5480
|
+
d[v] = "NaN";
|
|
5481
5481
|
continue;
|
|
5482
5482
|
}
|
|
5483
|
-
if (typeof
|
|
5484
|
-
d[
|
|
5483
|
+
if (typeof b == "number" && !isNaN(b)) {
|
|
5484
|
+
d[v] = o ? String(b) : b;
|
|
5485
5485
|
continue;
|
|
5486
5486
|
}
|
|
5487
|
-
if (
|
|
5488
|
-
d[
|
|
5487
|
+
if (b instanceof Date) {
|
|
5488
|
+
d[v] = b.toISOString();
|
|
5489
5489
|
continue;
|
|
5490
5490
|
}
|
|
5491
|
-
if (
|
|
5492
|
-
|
|
5493
|
-
d[`${
|
|
5491
|
+
if (b instanceof Map) {
|
|
5492
|
+
b.forEach((j, C) => {
|
|
5493
|
+
d[`${v}.${C}`] = JSON.stringify(j);
|
|
5494
5494
|
});
|
|
5495
5495
|
continue;
|
|
5496
5496
|
}
|
|
5497
|
-
if (Array.isArray(
|
|
5498
|
-
|
|
5499
|
-
const
|
|
5500
|
-
typeof
|
|
5497
|
+
if (Array.isArray(b)) {
|
|
5498
|
+
b.forEach((j, C) => {
|
|
5499
|
+
const x = `${v}:${C}`;
|
|
5500
|
+
typeof j == "object" ? Object.assign(d, m(j, o, x)) : d[x] = o ? String(j) : j;
|
|
5501
5501
|
});
|
|
5502
5502
|
continue;
|
|
5503
5503
|
}
|
|
5504
|
-
if (typeof
|
|
5505
|
-
Object.assign(d, m(
|
|
5504
|
+
if (typeof b == "object") {
|
|
5505
|
+
Object.assign(d, m(b, o, v));
|
|
5506
5506
|
continue;
|
|
5507
5507
|
}
|
|
5508
|
-
d[
|
|
5508
|
+
d[v] = String(b);
|
|
5509
5509
|
}
|
|
5510
5510
|
return d;
|
|
5511
5511
|
}
|
|
5512
5512
|
n.flatten = m;
|
|
5513
|
-
function c(
|
|
5514
|
-
return Object.entries(
|
|
5513
|
+
function c(l) {
|
|
5514
|
+
return Object.entries(l);
|
|
5515
5515
|
}
|
|
5516
5516
|
n.entries = c;
|
|
5517
|
-
function
|
|
5518
|
-
return Object.values(
|
|
5517
|
+
function y(l) {
|
|
5518
|
+
return Object.values(l);
|
|
5519
5519
|
}
|
|
5520
|
-
n.values =
|
|
5521
|
-
function p(
|
|
5522
|
-
return Object.keys(
|
|
5520
|
+
n.values = y;
|
|
5521
|
+
function p(l) {
|
|
5522
|
+
return Object.keys(l);
|
|
5523
5523
|
}
|
|
5524
5524
|
n.keys = p;
|
|
5525
|
-
})(a =
|
|
5526
|
-
function m(o,
|
|
5527
|
-
const
|
|
5528
|
-
return
|
|
5529
|
-
const
|
|
5530
|
-
let
|
|
5531
|
-
for (;
|
|
5532
|
-
const
|
|
5533
|
-
if (
|
|
5534
|
-
const
|
|
5535
|
-
/\s/.test(
|
|
5536
|
-
}
|
|
5537
|
-
}),
|
|
5525
|
+
})(a = h.object || (h.object = {})), ((n) => {
|
|
5526
|
+
function m(o, f = P.emotes) {
|
|
5527
|
+
const d = [];
|
|
5528
|
+
return f.filter((g) => g.type !== "emoji").forEach((g) => {
|
|
5529
|
+
const b = g.name;
|
|
5530
|
+
let v = 0, j = 0;
|
|
5531
|
+
for (; v < o.length; ) {
|
|
5532
|
+
const C = o.indexOf(b, j);
|
|
5533
|
+
if (C === -1) break;
|
|
5534
|
+
const x = C > 0 ? o[C - 1] : " ", A = C + b.length < o.length ? o[C + b.length] : " ";
|
|
5535
|
+
/\s/.test(x) && /\s/.test(A) && d.push({ ...g, start: C, end: C + b.length }), j = C + 1;
|
|
5536
|
+
}
|
|
5537
|
+
}), d;
|
|
5538
5538
|
}
|
|
5539
5539
|
n.findEmotesInText = m;
|
|
5540
|
-
function c(o,
|
|
5541
|
-
if (!
|
|
5542
|
-
let
|
|
5543
|
-
return
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5540
|
+
function c(o, f) {
|
|
5541
|
+
if (!f.length) return o;
|
|
5542
|
+
let d = "", g = 0;
|
|
5543
|
+
return f.filter((b) => b.type !== "emoji").forEach((b) => {
|
|
5544
|
+
if (b.start < g) return;
|
|
5545
|
+
d += o.substring(g, b.start);
|
|
5546
|
+
const j = Array.from({ ...b.urls, length: 5 }).slice(1).reverse().filter(Boolean)[0] || b.urls[1];
|
|
5547
|
+
d += `<img src="${j}" alt="${b.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`, g = b.end;
|
|
5548
|
+
}), d += o.substring(g), d;
|
|
5548
5549
|
}
|
|
5549
5550
|
n.replaceEmotesWithHTML = c;
|
|
5550
|
-
function
|
|
5551
|
-
return
|
|
5552
|
-
|
|
5553
|
-
|
|
5551
|
+
function y(o, f) {
|
|
5552
|
+
return f.reduce((g, b) => g.replace(new RegExp(`\\b${b.name}\\b`, "g"), "").replace(/<img[^>]*class="emote"[^>]*>/gi, ""), o).trim().length === 0;
|
|
5553
|
+
}
|
|
5554
|
+
n.hasOnlyEmotes = y;
|
|
5555
|
+
function p(o, f = P.youtube_emotes) {
|
|
5556
|
+
return Array.from(o.matchAll(/:(.*?):/gim), (g) => g[0]).forEach((g) => {
|
|
5557
|
+
const b = f.find(
|
|
5558
|
+
(v) => v.shortcuts.includes(g) || v.searchTerms.includes(g.slice(1, -1))
|
|
5554
5559
|
);
|
|
5555
|
-
if (
|
|
5556
|
-
const
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
`<img src="${
|
|
5560
|
+
if (b) {
|
|
5561
|
+
const v = b.image.thumbnails.at(-1)?.url, j = b.image.accessibility.accessibilityData.label;
|
|
5562
|
+
v && (o = o.replace(
|
|
5563
|
+
g,
|
|
5564
|
+
`<img src="${v}" alt="${j}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`
|
|
5560
5565
|
));
|
|
5561
5566
|
}
|
|
5562
5567
|
}), o;
|
|
5563
5568
|
}
|
|
5564
|
-
n.replaceYoutubeEmotesWithHTML =
|
|
5565
|
-
async function
|
|
5566
|
-
!Array.isArray(o) && typeof o == "string" && (o = o.split(",").map((
|
|
5567
|
-
var
|
|
5568
|
-
if (!
|
|
5569
|
-
var
|
|
5570
|
-
for await (const
|
|
5571
|
-
var
|
|
5572
|
-
!
|
|
5573
|
-
}
|
|
5574
|
-
}
|
|
5575
|
-
var
|
|
5576
|
-
switch (
|
|
5569
|
+
n.replaceYoutubeEmotesWithHTML = p;
|
|
5570
|
+
async function l(o = [], f) {
|
|
5571
|
+
!Array.isArray(o) && typeof o == "string" && (o = o.split(",").map((C) => C.trim()));
|
|
5572
|
+
var d = o.map((C) => C.split("/")[0]);
|
|
5573
|
+
if (!d || !d.length) {
|
|
5574
|
+
var g = s.number(1, 3);
|
|
5575
|
+
for await (const C of Array.from({ length: g }, () => "")) {
|
|
5576
|
+
var b = s.array(Object.keys(P.badges))[0];
|
|
5577
|
+
!d.includes(b) && Array.isArray(d) ? d.push(b) : d = [b];
|
|
5578
|
+
}
|
|
5579
|
+
}
|
|
5580
|
+
var v;
|
|
5581
|
+
switch (f) {
|
|
5577
5582
|
case "twitch": {
|
|
5578
|
-
|
|
5579
|
-
keys: Array.from(
|
|
5580
|
-
badges: Array.from(
|
|
5583
|
+
v = {
|
|
5584
|
+
keys: Array.from(d).filter((C) => C in P.badges),
|
|
5585
|
+
badges: Array.from(d).slice(0, 3).map((C) => P.badges[C]).filter(Boolean),
|
|
5581
5586
|
amount: o.reduce(
|
|
5582
|
-
(
|
|
5583
|
-
var [
|
|
5584
|
-
return (isNaN(parseInt(
|
|
5587
|
+
(C, x) => {
|
|
5588
|
+
var [A, J = "1"] = x.split("/");
|
|
5589
|
+
return (isNaN(parseInt(J)) || !J.length) && (J = "1"), C[A] = parseInt(J) || 1, C;
|
|
5585
5590
|
},
|
|
5586
5591
|
{}
|
|
5587
5592
|
)
|
|
@@ -5589,7 +5594,7 @@ var y;
|
|
|
5589
5594
|
break;
|
|
5590
5595
|
}
|
|
5591
5596
|
case "youtube": {
|
|
5592
|
-
var
|
|
5597
|
+
var j = {
|
|
5593
5598
|
verified: { isVerified: !0 },
|
|
5594
5599
|
broadcaster: { isChatOwner: !0 },
|
|
5595
5600
|
host: { isChatOwner: !0 },
|
|
@@ -5597,8 +5602,8 @@ var y;
|
|
|
5597
5602
|
subscriber: { isChatSponsor: !0 },
|
|
5598
5603
|
moderator: { isChatModerator: !0 }
|
|
5599
5604
|
};
|
|
5600
|
-
|
|
5601
|
-
(
|
|
5605
|
+
v = Object.entries(d).reduce(
|
|
5606
|
+
(C, [x]) => (x in j && Object.assign(C, j[x]), C),
|
|
5602
5607
|
{
|
|
5603
5608
|
isVerified: !1,
|
|
5604
5609
|
isChatOwner: !1,
|
|
@@ -5609,14 +5614,14 @@ var y;
|
|
|
5609
5614
|
break;
|
|
5610
5615
|
}
|
|
5611
5616
|
}
|
|
5612
|
-
return
|
|
5617
|
+
return v;
|
|
5613
5618
|
}
|
|
5614
|
-
n.generateBadges =
|
|
5615
|
-
})(
|
|
5616
|
-
function m(c,
|
|
5619
|
+
n.generateBadges = l;
|
|
5620
|
+
})(h.message || (h.message = {})), ((n) => {
|
|
5621
|
+
function m(c, y) {
|
|
5617
5622
|
var p = (
|
|
5618
5623
|
// @ts-ignore
|
|
5619
|
-
|
|
5624
|
+
y || // @ts-ignore
|
|
5620
5625
|
c.event?.provider || // @ts-ignore
|
|
5621
5626
|
c.event?.service || // @ts-ignore
|
|
5622
5627
|
c.event?.data?.provider || // @ts-ignore
|
|
@@ -5632,122 +5637,122 @@ var y;
|
|
|
5632
5637
|
].some((f) => f === c.listener) && (p = "streamelements"), { provider: p, data: c };
|
|
5633
5638
|
}
|
|
5634
5639
|
n.parseProvider = m;
|
|
5635
|
-
})(
|
|
5640
|
+
})(h.event || (h.event = {})), ((n) => {
|
|
5636
5641
|
n.PRESETS = {};
|
|
5637
|
-
async function m(p,
|
|
5642
|
+
async function m(p, l, o) {
|
|
5638
5643
|
const f = [];
|
|
5639
|
-
p.replace(
|
|
5640
|
-
const
|
|
5641
|
-
return f.push(Promise.resolve(
|
|
5644
|
+
p.replace(l, (g, ...b) => {
|
|
5645
|
+
const v = typeof o == "function" ? o(g, ...b) : g;
|
|
5646
|
+
return f.push(Promise.resolve(v)), g;
|
|
5642
5647
|
});
|
|
5643
5648
|
const d = await Promise.all(f);
|
|
5644
|
-
return p.replace(
|
|
5649
|
+
return p.replace(l, () => d.shift() ?? "");
|
|
5645
5650
|
}
|
|
5646
5651
|
n.replace = m;
|
|
5647
5652
|
function c(p) {
|
|
5648
5653
|
return p.charAt(0).toUpperCase() + p.slice(1);
|
|
5649
5654
|
}
|
|
5650
5655
|
n.capitalize = c;
|
|
5651
|
-
function
|
|
5656
|
+
function y(p, l = {}, o = {
|
|
5652
5657
|
method: "index",
|
|
5653
5658
|
html: !1,
|
|
5654
5659
|
debug: !1,
|
|
5655
5660
|
modifiers: {},
|
|
5656
5661
|
aliases: {}
|
|
5657
5662
|
}) {
|
|
5658
|
-
const { mergeSpanStyles: f } = t, d = (r, u, k) =>
|
|
5663
|
+
const { mergeSpanStyles: f } = t, d = (r, u, k) => o.html ? f(r, u, k) : u, g = {
|
|
5659
5664
|
skip: "<br/>",
|
|
5660
5665
|
newline: "<br/>",
|
|
5661
|
-
...
|
|
5666
|
+
...l
|
|
5662
5667
|
};
|
|
5663
|
-
let
|
|
5668
|
+
let b = "$", v = "USD";
|
|
5664
5669
|
if (typeof window < "u")
|
|
5665
5670
|
try {
|
|
5666
5671
|
const u = window?.client?.details?.currency;
|
|
5667
|
-
u?.symbol && (
|
|
5672
|
+
u?.symbol && (b = String(u.symbol)), u?.code && (v = String(u.code));
|
|
5668
5673
|
} catch {
|
|
5669
5674
|
}
|
|
5670
|
-
const
|
|
5675
|
+
const j = Object.entries(a.flatten(g)).reduce(
|
|
5671
5676
|
(r, [u, k]) => {
|
|
5672
|
-
if (r[u] = String(k), ["username", "name", "nick", "nickname", "sender"].some((
|
|
5673
|
-
const
|
|
5674
|
-
r.username = r.username ||
|
|
5677
|
+
if (r[u] = String(k), ["username", "name", "nick", "nickname", "sender"].some((E) => u === E)) {
|
|
5678
|
+
const E = r?.username || r?.name || r?.nick || r?.nickname || r?.sender;
|
|
5679
|
+
r.username = r.username || E, r.usernameAt = `@${r.username}`, r.name = r.name || E, r.nick = r.nick || E, r.nickname = r.nickname || E, r.sender = r.sender || E, r.senderAt = `@${r.sender}`;
|
|
5675
5680
|
}
|
|
5676
|
-
return ["amount", "count"].some((
|
|
5681
|
+
return ["amount", "count"].some((E) => u === E) && (r.amount = String(r?.amount || r.count || k), r.count = String(r?.count || r?.amount || k)), r.currency = r.currency || b, r.currencyCode = r.currencyCode || v, r;
|
|
5677
5682
|
},
|
|
5678
5683
|
{}
|
|
5679
|
-
),
|
|
5684
|
+
), C = {
|
|
5680
5685
|
PLACEHOLDERS: /{([^}]+)}/g,
|
|
5681
5686
|
MODIFIERS: /\[([^\]=]+)=([^\]]+)\]/g
|
|
5682
5687
|
};
|
|
5683
|
-
var
|
|
5684
|
-
function
|
|
5688
|
+
var x = parseFloat(j?.amount ?? j?.count ?? 0);
|
|
5689
|
+
function A(r, u) {
|
|
5685
5690
|
const k = r?.trim?.() ?? "";
|
|
5686
5691
|
if (!k.length) return null;
|
|
5687
|
-
const
|
|
5688
|
-
return isNaN(
|
|
5692
|
+
const E = u[k], T = parseFloat(String(E !== void 0 ? E : k).replace(/\s/g, ""));
|
|
5693
|
+
return isNaN(T) ? null : T;
|
|
5689
5694
|
}
|
|
5690
|
-
function
|
|
5691
|
-
const
|
|
5695
|
+
function J(r, u, k) {
|
|
5696
|
+
const E = isNaN(Number(u)) ? 0 : Math.max(0, parseInt(String(u))), N = A(r, k);
|
|
5692
5697
|
if (N === null) return r;
|
|
5693
5698
|
try {
|
|
5694
5699
|
return N.toLocaleString(void 0, {
|
|
5695
|
-
minimumFractionDigits:
|
|
5696
|
-
maximumFractionDigits:
|
|
5700
|
+
minimumFractionDigits: E,
|
|
5701
|
+
maximumFractionDigits: E
|
|
5697
5702
|
});
|
|
5698
5703
|
} catch {
|
|
5699
|
-
return N.toFixed(
|
|
5704
|
+
return N.toFixed(E);
|
|
5700
5705
|
}
|
|
5701
5706
|
}
|
|
5702
5707
|
function _(r, u = /* @__PURE__ */ new Date()) {
|
|
5703
|
-
const k = u.getTime() - r.getTime(),
|
|
5704
|
-
return V > 0 ? `${V}y ${X}` : L > 0 ? `${L}mo ${X}` :
|
|
5705
|
-
}
|
|
5706
|
-
function
|
|
5707
|
-
const
|
|
5708
|
-
if (!
|
|
5709
|
-
const N = k[
|
|
5710
|
-
if (isNaN(
|
|
5711
|
-
const
|
|
5708
|
+
const k = u.getTime() - r.getTime(), E = k >= 0, N = Math.abs(k), T = Math.floor(N / 1e3), D = Math.floor(T / 60), z = Math.floor(D / 60), I = Math.floor(z / 24), L = Math.floor(I / 30), V = Math.floor(I / 365), X = E ? "ago" : "from now";
|
|
5709
|
+
return V > 0 ? `${V}y ${X}` : L > 0 ? `${L}mo ${X}` : I > 0 ? `${I}d ${X}` : z > 0 ? `${z}h ${X}` : D > 0 ? `${D}m ${X}` : `${Math.max(T, 0)}s ${X}`;
|
|
5710
|
+
}
|
|
5711
|
+
function U(r, u, k) {
|
|
5712
|
+
const E = r?.trim?.() ?? "";
|
|
5713
|
+
if (!E.length) return r;
|
|
5714
|
+
const N = k[E] ?? E, T = new Date(N);
|
|
5715
|
+
if (isNaN(T.getTime())) return r;
|
|
5716
|
+
const D = (u ?? "date").toString().toLowerCase();
|
|
5712
5717
|
try {
|
|
5713
|
-
switch (
|
|
5718
|
+
switch (D) {
|
|
5714
5719
|
case "time":
|
|
5715
|
-
return
|
|
5720
|
+
return T.toLocaleTimeString();
|
|
5716
5721
|
case "datetime":
|
|
5717
5722
|
case "full":
|
|
5718
|
-
return
|
|
5723
|
+
return T.toLocaleString();
|
|
5719
5724
|
case "relative":
|
|
5720
5725
|
case "ago":
|
|
5721
|
-
return _(
|
|
5726
|
+
return _(T);
|
|
5722
5727
|
case "iso":
|
|
5723
|
-
return
|
|
5728
|
+
return T.toISOString();
|
|
5724
5729
|
default:
|
|
5725
|
-
return
|
|
5730
|
+
return T.toLocaleDateString();
|
|
5726
5731
|
}
|
|
5727
5732
|
} catch {
|
|
5728
5733
|
return r;
|
|
5729
5734
|
}
|
|
5730
5735
|
}
|
|
5731
5736
|
function M(r, u, k) {
|
|
5732
|
-
const
|
|
5737
|
+
const E = r ?? "", [N, T = N] = E.split("|", 2), D = u?.trim();
|
|
5733
5738
|
let z;
|
|
5734
|
-
|
|
5735
|
-
const
|
|
5736
|
-
return isNaN(
|
|
5739
|
+
D && k[D] !== void 0 ? z = k[D] : z = k.amount ?? k.count;
|
|
5740
|
+
const I = parseFloat(String(z));
|
|
5741
|
+
return isNaN(I) ? N : Math.abs(I) !== 1 ? T : N;
|
|
5737
5742
|
}
|
|
5738
5743
|
function H(r, u, k) {
|
|
5739
|
-
const
|
|
5744
|
+
const E = u?.trim() ?? "", N = E && k[E] !== void 0 ? k[E] : "", T = String(N), D = (r ?? "").split("|").map((I) => I.trim()).filter((I) => I.length);
|
|
5740
5745
|
let z;
|
|
5741
|
-
for (const
|
|
5742
|
-
const L =
|
|
5746
|
+
for (const I of D) {
|
|
5747
|
+
const L = I.indexOf(":");
|
|
5743
5748
|
if (L === -1) continue;
|
|
5744
|
-
const V =
|
|
5749
|
+
const V = I.slice(0, L).trim(), X = I.slice(L + 1);
|
|
5745
5750
|
if (V.length) {
|
|
5746
5751
|
if (V.toLowerCase() === "default") {
|
|
5747
5752
|
z = X;
|
|
5748
5753
|
continue;
|
|
5749
5754
|
}
|
|
5750
|
-
if (
|
|
5755
|
+
if (T === V) return X;
|
|
5751
5756
|
}
|
|
5752
5757
|
}
|
|
5753
5758
|
return z ?? "";
|
|
@@ -5758,17 +5763,17 @@ var y;
|
|
|
5758
5763
|
function W(r, u) {
|
|
5759
5764
|
let k = r.trim();
|
|
5760
5765
|
if (!k.length) return;
|
|
5761
|
-
const
|
|
5762
|
-
if (
|
|
5766
|
+
const E = k[0], N = k[k.length - 1];
|
|
5767
|
+
if (E === '"' && N === '"' || E === "'" && N === "'")
|
|
5763
5768
|
return k.slice(1, -1);
|
|
5764
|
-
const
|
|
5765
|
-
if (
|
|
5766
|
-
if (
|
|
5769
|
+
const T = k.toLowerCase();
|
|
5770
|
+
if (T === "true") return !0;
|
|
5771
|
+
if (T === "false") return !1;
|
|
5767
5772
|
if (/^-?\d+(\.\d+)?$/.test(k)) return parseFloat(k);
|
|
5768
|
-
const
|
|
5769
|
-
if (
|
|
5770
|
-
const z = String(
|
|
5771
|
-
return
|
|
5773
|
+
const D = u?.[k];
|
|
5774
|
+
if (D === void 0) return k;
|
|
5775
|
+
const z = String(D).trim(), I = z.toLowerCase();
|
|
5776
|
+
return I === "true" ? !0 : I === "false" ? !1 : /^-?\d+(\.\d+)?$/.test(z) ? parseFloat(z) : D;
|
|
5772
5777
|
}
|
|
5773
5778
|
function S(r) {
|
|
5774
5779
|
if (typeof r == "boolean") return r;
|
|
@@ -5779,76 +5784,76 @@ var y;
|
|
|
5779
5784
|
function it(r, u) {
|
|
5780
5785
|
let k = r.trim();
|
|
5781
5786
|
if (!k.length) return !1;
|
|
5782
|
-
let
|
|
5787
|
+
let E = !1;
|
|
5783
5788
|
for (; k.startsWith("!"); )
|
|
5784
|
-
|
|
5789
|
+
E = !E, k = k.slice(1).trim();
|
|
5785
5790
|
const N = ["===", "!==", "==", "!=", ">=", "<=", ">", "<"];
|
|
5786
|
-
let
|
|
5791
|
+
let T = null, D = k, z = "";
|
|
5787
5792
|
for (const L of N) {
|
|
5788
5793
|
const V = k.indexOf(L);
|
|
5789
5794
|
if (V !== -1) {
|
|
5790
|
-
|
|
5795
|
+
T = L, D = k.slice(0, V), z = k.slice(V + L.length);
|
|
5791
5796
|
break;
|
|
5792
5797
|
}
|
|
5793
5798
|
}
|
|
5794
|
-
let
|
|
5795
|
-
if (
|
|
5796
|
-
const L = W(
|
|
5797
|
-
switch (
|
|
5799
|
+
let I;
|
|
5800
|
+
if (T) {
|
|
5801
|
+
const L = W(D, u), V = W(z, u);
|
|
5802
|
+
switch (T) {
|
|
5798
5803
|
case "===":
|
|
5799
|
-
|
|
5804
|
+
I = L === V;
|
|
5800
5805
|
break;
|
|
5801
5806
|
case "!==":
|
|
5802
|
-
|
|
5807
|
+
I = L !== V;
|
|
5803
5808
|
break;
|
|
5804
5809
|
case "==":
|
|
5805
|
-
|
|
5810
|
+
I = L == V;
|
|
5806
5811
|
break;
|
|
5807
5812
|
case "!=":
|
|
5808
|
-
|
|
5813
|
+
I = L != V;
|
|
5809
5814
|
break;
|
|
5810
5815
|
case ">=":
|
|
5811
|
-
|
|
5816
|
+
I = L >= V;
|
|
5812
5817
|
break;
|
|
5813
5818
|
case "<=":
|
|
5814
|
-
|
|
5819
|
+
I = L <= V;
|
|
5815
5820
|
break;
|
|
5816
5821
|
case ">":
|
|
5817
|
-
|
|
5822
|
+
I = L > V;
|
|
5818
5823
|
break;
|
|
5819
5824
|
case "<":
|
|
5820
|
-
|
|
5825
|
+
I = L < V;
|
|
5821
5826
|
break;
|
|
5822
5827
|
default:
|
|
5823
|
-
|
|
5828
|
+
I = !1;
|
|
5824
5829
|
break;
|
|
5825
5830
|
}
|
|
5826
5831
|
} else {
|
|
5827
|
-
const L = W(
|
|
5828
|
-
|
|
5832
|
+
const L = W(D, u);
|
|
5833
|
+
I = S(L);
|
|
5829
5834
|
}
|
|
5830
|
-
return
|
|
5835
|
+
return E ? !I : I;
|
|
5831
5836
|
}
|
|
5832
5837
|
function q(r, u) {
|
|
5833
5838
|
let k = r.trim();
|
|
5834
5839
|
if (!k.length) return !1;
|
|
5835
|
-
let
|
|
5840
|
+
let E = !1;
|
|
5836
5841
|
for (; k.startsWith("!"); )
|
|
5837
|
-
|
|
5838
|
-
const N = k.split("||").map((
|
|
5839
|
-
if (!N.length) return !!
|
|
5840
|
-
let
|
|
5841
|
-
for (const
|
|
5842
|
-
const z =
|
|
5842
|
+
E = !E, k = k.slice(1).trim();
|
|
5843
|
+
const N = k.split("||").map((D) => D.trim()).filter((D) => D.length);
|
|
5844
|
+
if (!N.length) return !!E;
|
|
5845
|
+
let T = !1;
|
|
5846
|
+
for (const D of N) {
|
|
5847
|
+
const z = D.split("&&").map((L) => L.trim()).filter((L) => L.length);
|
|
5843
5848
|
if (!z.length) continue;
|
|
5844
|
-
let
|
|
5849
|
+
let I = !0;
|
|
5845
5850
|
for (const L of z) {
|
|
5846
5851
|
const V = it(L, u);
|
|
5847
|
-
if (
|
|
5852
|
+
if (I = I && V, !I) break;
|
|
5848
5853
|
}
|
|
5849
|
-
if (
|
|
5854
|
+
if (T = T || I, T) break;
|
|
5850
5855
|
}
|
|
5851
|
-
return
|
|
5856
|
+
return E ? !T : T;
|
|
5852
5857
|
}
|
|
5853
5858
|
const G = {
|
|
5854
5859
|
COLOR: (r, u) => d(u && i.validate(u) ? `color: ${u}` : "", r, "color"),
|
|
@@ -5869,46 +5874,46 @@ var y;
|
|
|
5869
5874
|
SIZE: (r, u) => d(u ? `font-size: ${u}` : "", r, "size")
|
|
5870
5875
|
}, Y = {
|
|
5871
5876
|
...{
|
|
5872
|
-
BT1: (r) =>
|
|
5873
|
-
BT0: (r) =>
|
|
5874
|
-
ST1: (r) =>
|
|
5875
|
-
ST0: (r) =>
|
|
5877
|
+
BT1: (r) => x > 1 ? r : "",
|
|
5878
|
+
BT0: (r) => x > 0 ? r : "",
|
|
5879
|
+
ST1: (r) => x < 1 ? r : "",
|
|
5880
|
+
ST0: (r) => x < 0 ? r : "",
|
|
5876
5881
|
UPC: (r) => r.toUpperCase(),
|
|
5877
5882
|
LOW: (r) => r.toLowerCase(),
|
|
5878
5883
|
REV: (r) => r.split("").reverse().join(""),
|
|
5879
5884
|
CAP: (r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase(),
|
|
5880
|
-
NUMBER: (r, u, k) =>
|
|
5885
|
+
NUMBER: (r, u, k) => J(r, u, k),
|
|
5881
5886
|
PLURAL: (r, u, k) => M(r, u, k),
|
|
5882
|
-
DATE: (r, u, k) =>
|
|
5887
|
+
DATE: (r, u, k) => U(r, u, k),
|
|
5883
5888
|
MAP: (r, u, k) => H(r, u, k),
|
|
5884
5889
|
ESCAPE: (r) => O(r),
|
|
5885
5890
|
IF: (r, u, k) => {
|
|
5886
|
-
const
|
|
5887
|
-
if (!
|
|
5888
|
-
const [
|
|
5891
|
+
const E = r ?? "", [N, T] = E.split("?", 2);
|
|
5892
|
+
if (!T) return E;
|
|
5893
|
+
const [D, z = ""] = T.split("|", 2);
|
|
5889
5894
|
return q(
|
|
5890
5895
|
N,
|
|
5891
5896
|
k
|
|
5892
|
-
) ?
|
|
5897
|
+
) ? D : z;
|
|
5893
5898
|
},
|
|
5894
5899
|
PRESET: (r, u) => {
|
|
5895
5900
|
const k = u?.trim() ?? "";
|
|
5896
5901
|
if (!k.length) return r;
|
|
5897
|
-
const
|
|
5898
|
-
if (!
|
|
5899
|
-
const N =
|
|
5900
|
-
const [z,
|
|
5901
|
-
return { name: z.trim(), param:
|
|
5902
|
+
const E = n.PRESETS[k];
|
|
5903
|
+
if (!E || !E.length) return r;
|
|
5904
|
+
const N = E.split(",").map((D) => D.trim()).filter((D) => D.length).map((D) => {
|
|
5905
|
+
const [z, I] = D.split(":");
|
|
5906
|
+
return { name: z.trim(), param: I?.trim() ?? null };
|
|
5902
5907
|
});
|
|
5903
|
-
let
|
|
5904
|
-
for (const { name:
|
|
5905
|
-
|
|
5906
|
-
return
|
|
5908
|
+
let T = r;
|
|
5909
|
+
for (const { name: D, param: z } of N)
|
|
5910
|
+
T = ot(T, D, z);
|
|
5911
|
+
return T;
|
|
5907
5912
|
},
|
|
5908
5913
|
FALLBACK: (r, u) => r.length ? r : u ?? r
|
|
5909
5914
|
},
|
|
5910
|
-
...
|
|
5911
|
-
...
|
|
5915
|
+
...o?.html ? G : {},
|
|
5916
|
+
...o.modifiers ?? {}
|
|
5912
5917
|
}, yt = {
|
|
5913
5918
|
UPC: ["UPPERCASE", "UPPER", "UPP"],
|
|
5914
5919
|
LOW: ["LOWERCASE", "LOWER", "LWC"],
|
|
@@ -5937,50 +5942,50 @@ var y;
|
|
|
5937
5942
|
SHADOW: ["SHADOW", "SHD"],
|
|
5938
5943
|
FALLBACK: ["FALLBACK", "FB"],
|
|
5939
5944
|
IF: ["IF", "COND", "CONDITION"],
|
|
5940
|
-
...
|
|
5945
|
+
...o.aliases ?? {}
|
|
5941
5946
|
};
|
|
5942
5947
|
function ot(r, u, k) {
|
|
5943
|
-
const
|
|
5948
|
+
const E = Object.entries(yt).find(([T, D]) => D.some((z) => z.toUpperCase() === u.toUpperCase()) ? !0 : T.toUpperCase() === u.toUpperCase()), N = E ? E[0] : u.toUpperCase();
|
|
5944
5949
|
try {
|
|
5945
|
-
return Y[N] ? Y[N](r, typeof k == "string" ? k.trim() : null,
|
|
5946
|
-
} catch (
|
|
5947
|
-
return
|
|
5950
|
+
return Y[N] ? Y[N](r, typeof k == "string" ? k.trim() : null, j) : o?.html ? d("", r, N.toLowerCase()) : r;
|
|
5951
|
+
} catch (T) {
|
|
5952
|
+
return o?.debug && typeof console < "u" && typeof console.error == "function" && console.error("[Helper.string.compose] Modifier error", { name: u, param: k, error: T }), r;
|
|
5948
5953
|
}
|
|
5949
5954
|
}
|
|
5950
5955
|
function lt(r) {
|
|
5951
5956
|
let u = r, k;
|
|
5952
|
-
for (; (k =
|
|
5953
|
-
const [
|
|
5954
|
-
const [L, V] =
|
|
5957
|
+
for (; (k = C.MODIFIERS.exec(u)) !== null; ) {
|
|
5958
|
+
const [E, N, T] = k, D = N.split(",").map((I) => I.trim()).filter((I) => I.length).map((I) => {
|
|
5959
|
+
const [L, V] = I.split(":");
|
|
5955
5960
|
return { name: L.trim(), param: V?.trim() ?? null };
|
|
5956
5961
|
});
|
|
5957
|
-
let z = lt(
|
|
5958
|
-
for (const { name:
|
|
5959
|
-
z = ot(z,
|
|
5960
|
-
u = u.replace(
|
|
5962
|
+
let z = lt(T);
|
|
5963
|
+
for (const { name: I, param: L } of D)
|
|
5964
|
+
z = ot(z, I, L);
|
|
5965
|
+
u = u.replace(E, z ?? ""), C.MODIFIERS.lastIndex = 0;
|
|
5961
5966
|
}
|
|
5962
5967
|
return u;
|
|
5963
5968
|
}
|
|
5964
5969
|
function mt(r) {
|
|
5965
5970
|
let u = 0;
|
|
5966
5971
|
const k = r.length;
|
|
5967
|
-
function
|
|
5968
|
-
let
|
|
5972
|
+
function E(T) {
|
|
5973
|
+
let D = "";
|
|
5969
5974
|
for (; u < k; )
|
|
5970
5975
|
if (r[u] === "\\")
|
|
5971
|
-
u + 1 < k ? (
|
|
5972
|
-
else if (r[u] === "[" && (!
|
|
5973
|
-
|
|
5974
|
-
else if (
|
|
5976
|
+
u + 1 < k ? (D += r[u + 1], u += 2) : u++;
|
|
5977
|
+
else if (r[u] === "[" && (!T || T !== "["))
|
|
5978
|
+
D += N();
|
|
5979
|
+
else if (T && r[u] === T) {
|
|
5975
5980
|
u++;
|
|
5976
5981
|
break;
|
|
5977
5982
|
} else
|
|
5978
|
-
|
|
5979
|
-
return
|
|
5983
|
+
D += r[u++];
|
|
5984
|
+
return D;
|
|
5980
5985
|
}
|
|
5981
5986
|
function N() {
|
|
5982
5987
|
u++;
|
|
5983
|
-
const
|
|
5988
|
+
const T = [];
|
|
5984
5989
|
for (; u < k && r[u] !== "="; ) {
|
|
5985
5990
|
if (r[u] === ",") {
|
|
5986
5991
|
u++;
|
|
@@ -5988,82 +5993,82 @@ var y;
|
|
|
5988
5993
|
}
|
|
5989
5994
|
let z = "";
|
|
5990
5995
|
for (; u < k && /[A-Za-z0-9]/.test(r[u]); ) z += r[u++];
|
|
5991
|
-
let
|
|
5996
|
+
let I = null;
|
|
5992
5997
|
if (r[u] === ":") {
|
|
5993
5998
|
u++;
|
|
5994
5999
|
const L = u;
|
|
5995
6000
|
for (; u < k && r[u] !== "," && r[u] !== "="; ) u++;
|
|
5996
|
-
|
|
6001
|
+
I = r.slice(L, u);
|
|
5997
6002
|
}
|
|
5998
|
-
z.length &&
|
|
6003
|
+
z.length && T.push({ name: z, param: I }), r[u] === "," && u++;
|
|
5999
6004
|
}
|
|
6000
6005
|
r[u] === "=" && u++;
|
|
6001
|
-
const
|
|
6002
|
-
return
|
|
6006
|
+
const D = E("]");
|
|
6007
|
+
return T.reduce((z, { name: I, param: L }) => ot(z, I, L), D);
|
|
6003
6008
|
}
|
|
6004
|
-
return
|
|
6009
|
+
return E();
|
|
6005
6010
|
}
|
|
6006
6011
|
let K = p.replace(
|
|
6007
|
-
|
|
6008
|
-
(r, u) => typeof
|
|
6012
|
+
C.PLACEHOLDERS,
|
|
6013
|
+
(r, u) => typeof j[u] == "string" || typeof j[u] == "number" ? String(j[u]) : u ?? u
|
|
6009
6014
|
);
|
|
6010
|
-
return K =
|
|
6015
|
+
return K = o.method === "loop" ? lt(K) : mt(K), K;
|
|
6011
6016
|
}
|
|
6012
|
-
n.compose =
|
|
6013
|
-
})(
|
|
6017
|
+
n.compose = y;
|
|
6018
|
+
})(h.string || (h.string = {})), ((n) => {
|
|
6014
6019
|
n.playing = !1;
|
|
6015
|
-
function m(c,
|
|
6020
|
+
function m(c, y = 100, p = !1) {
|
|
6016
6021
|
if (!c || !c.length)
|
|
6017
6022
|
throw new Error("No sound URL provided");
|
|
6018
6023
|
try {
|
|
6019
6024
|
p && n.playing && n.audio && n.audio.state !== "closed" && n.audio.close();
|
|
6020
|
-
let
|
|
6021
|
-
|
|
6022
|
-
if (
|
|
6023
|
-
const d =
|
|
6024
|
-
d.buffer = f, d.connect(
|
|
6025
|
+
let l = new AudioContext(), o = l.createGain();
|
|
6026
|
+
o.connect(l.destination), p && (n.audio = l, n.playing = !0), fetch(c).then((f) => f.arrayBuffer()).then((f) => l.decodeAudioData(f)).then((f) => {
|
|
6027
|
+
if (l.state !== "closed") {
|
|
6028
|
+
const d = l.createBufferSource();
|
|
6029
|
+
d.buffer = f, d.connect(o), o.gain.value = y / 100, d.start(l.currentTime);
|
|
6025
6030
|
}
|
|
6026
6031
|
});
|
|
6027
|
-
} catch (
|
|
6028
|
-
throw new Error(`Error playing sound: ${
|
|
6032
|
+
} catch (l) {
|
|
6033
|
+
throw new Error(`Error playing sound: ${l}`);
|
|
6029
6034
|
}
|
|
6030
6035
|
}
|
|
6031
6036
|
n.play = m;
|
|
6032
|
-
})(
|
|
6037
|
+
})(h.sound || (h.sound = {}));
|
|
6033
6038
|
let i;
|
|
6034
6039
|
((n) => {
|
|
6035
|
-
function m(
|
|
6036
|
-
|
|
6037
|
-
let f = Math.round(Math.min(Math.max(
|
|
6038
|
-
return
|
|
6040
|
+
function m(l = 100, o = "") {
|
|
6041
|
+
o = o.length > 7 ? o?.substring(0, 6) : o, l = l > 1 ? l / 100 : l;
|
|
6042
|
+
let f = Math.round(Math.min(Math.max(l, 0), 1) * 255).toString(16).toLowerCase().padStart(2, "0");
|
|
6043
|
+
return o + f;
|
|
6039
6044
|
}
|
|
6040
6045
|
n.opacity = m;
|
|
6041
|
-
function c(
|
|
6042
|
-
if (!
|
|
6046
|
+
function c(l) {
|
|
6047
|
+
if (!l.startsWith("#") || l.length <= 7)
|
|
6043
6048
|
return {
|
|
6044
|
-
color:
|
|
6049
|
+
color: l,
|
|
6045
6050
|
opacity: 100
|
|
6046
6051
|
};
|
|
6047
|
-
var d =
|
|
6052
|
+
var d = l.slice(-2), o = parseInt(d, 16) / 255, f = Math.round(o * 100), d = l.length > 7 ? l.slice(0, 7) : l;
|
|
6048
6053
|
return {
|
|
6049
6054
|
color: d,
|
|
6050
6055
|
opacity: f
|
|
6051
6056
|
};
|
|
6052
6057
|
}
|
|
6053
6058
|
n.extract = c;
|
|
6054
|
-
function
|
|
6055
|
-
if (typeof
|
|
6056
|
-
const
|
|
6057
|
-
return /^#([A-Fa-f0-9]{3}){1,2}$/.test(
|
|
6059
|
+
function y(l) {
|
|
6060
|
+
if (typeof l != "string" || !String(l).trim().length) return !1;
|
|
6061
|
+
const o = l.trim();
|
|
6062
|
+
return /^#([A-Fa-f0-9]{3}){1,2}$/.test(o) || /^#([A-Fa-f0-9]{4}|[A-Fa-f0-9]{8})$/.test(o) ? "hex" : /^rgb\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(o) ? "rgb" : /^rgba\(\s*(?:\d{1,3}\s*,\s*){3}(?:0|1|0?\.\d+)\s*\)$/.test(o) ? "rgba" : /^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(o) ? "hsl" : /^hsla\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*,\s*(?:0|1|0?\.\d+)\s*\)$/.test(o) ? "hsla" : P.css_color_names.includes(o.toLowerCase()) ? "css-color-name" : !1;
|
|
6058
6063
|
}
|
|
6059
|
-
n.validate =
|
|
6060
|
-
async function p(
|
|
6061
|
-
const f =
|
|
6062
|
-
if (!f) throw new Error(`Invalid color format: ${
|
|
6063
|
-
if (f ===
|
|
6064
|
-
const d = wt(
|
|
6065
|
-
if (!d) throw new Error(`Failed to parse color: ${
|
|
6066
|
-
switch (
|
|
6064
|
+
n.validate = y;
|
|
6065
|
+
async function p(l, o) {
|
|
6066
|
+
const f = y(l);
|
|
6067
|
+
if (!f) throw new Error(`Invalid color format: ${l}`);
|
|
6068
|
+
if (f === o) throw new Error(`Color is already in the desired format: ${o}`);
|
|
6069
|
+
const d = wt(l.trim(), f);
|
|
6070
|
+
if (!d) throw new Error(`Failed to parse color: ${l}`);
|
|
6071
|
+
switch (o) {
|
|
6067
6072
|
case "hex":
|
|
6068
6073
|
return vt(d, !1);
|
|
6069
6074
|
case "rgb":
|
|
@@ -6085,7 +6090,7 @@ var y;
|
|
|
6085
6090
|
}
|
|
6086
6091
|
}
|
|
6087
6092
|
n.convert = p;
|
|
6088
|
-
})(i =
|
|
6093
|
+
})(i = h.color || (h.color = {}));
|
|
6089
6094
|
let s;
|
|
6090
6095
|
((n) => {
|
|
6091
6096
|
function m(g = "hex") {
|
|
@@ -6094,124 +6099,124 @@ var y;
|
|
|
6094
6099
|
case "hex":
|
|
6095
6100
|
return `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
|
|
6096
6101
|
case "hexa": {
|
|
6097
|
-
const
|
|
6098
|
-
return
|
|
6102
|
+
const v = `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`, j = Math.floor(Math.random() * 256).toString(16).padStart(2, "0");
|
|
6103
|
+
return v + j;
|
|
6099
6104
|
}
|
|
6100
6105
|
case "rgb": {
|
|
6101
|
-
const
|
|
6102
|
-
return `rgb(${
|
|
6106
|
+
const v = Math.floor(Math.random() * 256), j = Math.floor(Math.random() * 256), C = Math.floor(Math.random() * 256);
|
|
6107
|
+
return `rgb(${v}, ${j}, ${C})`;
|
|
6103
6108
|
}
|
|
6104
6109
|
case "rgba": {
|
|
6105
|
-
const
|
|
6106
|
-
return `rgba(${
|
|
6110
|
+
const v = Math.floor(Math.random() * 256), j = Math.floor(Math.random() * 256), C = Math.floor(Math.random() * 256), x = Math.random().toFixed(2);
|
|
6111
|
+
return `rgba(${v}, ${j}, ${C}, ${x})`;
|
|
6107
6112
|
}
|
|
6108
6113
|
case "hsl": {
|
|
6109
|
-
const
|
|
6110
|
-
return `hsl(${
|
|
6114
|
+
const v = Math.floor(Math.random() * 361), j = Math.floor(Math.random() * 101), C = Math.floor(Math.random() * 101);
|
|
6115
|
+
return `hsl(${v}, ${j}%, ${C}%)`;
|
|
6111
6116
|
}
|
|
6112
6117
|
case "hsla": {
|
|
6113
|
-
const
|
|
6114
|
-
return `hsla(${
|
|
6118
|
+
const v = Math.floor(Math.random() * 361), j = Math.floor(Math.random() * 101), C = Math.floor(Math.random() * 101), x = Math.random().toFixed(2);
|
|
6119
|
+
return `hsla(${v}, ${j}%, ${C}%, ${x})`;
|
|
6115
6120
|
}
|
|
6116
6121
|
case "css-color-name": {
|
|
6117
|
-
var
|
|
6118
|
-
return
|
|
6122
|
+
var b = P.css_color_names;
|
|
6123
|
+
return l(b)[0];
|
|
6119
6124
|
}
|
|
6120
6125
|
}
|
|
6121
6126
|
}
|
|
6122
6127
|
n.color = m;
|
|
6123
|
-
function c(g,
|
|
6124
|
-
g >
|
|
6125
|
-
const
|
|
6126
|
-
return
|
|
6128
|
+
function c(g, b, v = 0) {
|
|
6129
|
+
g > b && ([g, b] = [b, g]);
|
|
6130
|
+
const j = Math.random() * (b - g) + g;
|
|
6131
|
+
return v ? Number(j.toFixed(v)) : Math.round(j);
|
|
6127
6132
|
}
|
|
6128
6133
|
n.number = c;
|
|
6129
|
-
function
|
|
6134
|
+
function y(g = 0.5) {
|
|
6130
6135
|
return Math.random() > g;
|
|
6131
6136
|
}
|
|
6132
|
-
n.boolean =
|
|
6133
|
-
function p(g,
|
|
6134
|
-
let
|
|
6135
|
-
for (let
|
|
6136
|
-
|
|
6137
|
-
return
|
|
6137
|
+
n.boolean = y;
|
|
6138
|
+
function p(g, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
|
|
6139
|
+
let v = "";
|
|
6140
|
+
for (let j = 0; j < g; j++)
|
|
6141
|
+
v += b.charAt(Math.floor(Math.random() * b.length));
|
|
6142
|
+
return v;
|
|
6138
6143
|
}
|
|
6139
6144
|
n.string = p;
|
|
6140
|
-
function
|
|
6141
|
-
const
|
|
6142
|
-
return [g[
|
|
6145
|
+
function l(g) {
|
|
6146
|
+
const b = c(0, g.length - 1);
|
|
6147
|
+
return [g[b], b];
|
|
6143
6148
|
}
|
|
6144
|
-
n.array =
|
|
6145
|
-
function
|
|
6146
|
-
return new Date(c(g.getTime(),
|
|
6149
|
+
n.array = l;
|
|
6150
|
+
function o(g = new Date(2e3, 0, 1), b = /* @__PURE__ */ new Date()) {
|
|
6151
|
+
return new Date(c(g.getTime(), b.getTime()));
|
|
6147
6152
|
}
|
|
6148
|
-
n.date =
|
|
6153
|
+
n.date = o;
|
|
6149
6154
|
function f(g) {
|
|
6150
|
-
const
|
|
6151
|
-
return new Date(
|
|
6155
|
+
const v = Date.now() - c(0, g * 24 * 60 * 60 * 1e3);
|
|
6156
|
+
return new Date(v).toISOString();
|
|
6152
6157
|
}
|
|
6153
6158
|
n.daysOffset = f;
|
|
6154
6159
|
function d() {
|
|
6155
6160
|
return crypto.randomUUID();
|
|
6156
6161
|
}
|
|
6157
6162
|
n.uuid = d;
|
|
6158
|
-
})(s =
|
|
6159
|
-
function m(
|
|
6160
|
-
return
|
|
6163
|
+
})(s = h.random || (h.random = {})), ((n) => {
|
|
6164
|
+
function m(y, p, l) {
|
|
6165
|
+
return y.apply(p, l);
|
|
6161
6166
|
}
|
|
6162
6167
|
n.apply = m;
|
|
6163
|
-
function c(
|
|
6164
|
-
return
|
|
6168
|
+
function c(y, p, ...l) {
|
|
6169
|
+
return y.call(p, ...l);
|
|
6165
6170
|
}
|
|
6166
6171
|
n.call = c;
|
|
6167
|
-
})(
|
|
6168
|
-
function m(
|
|
6172
|
+
})(h.fn || (h.fn = {})), ((n) => {
|
|
6173
|
+
function m(o, f) {
|
|
6169
6174
|
return new Promise(
|
|
6170
6175
|
(d) => setTimeout(() => {
|
|
6171
6176
|
if (f) {
|
|
6172
6177
|
const g = f();
|
|
6173
6178
|
d(g ?? null);
|
|
6174
6179
|
} else d(null);
|
|
6175
|
-
},
|
|
6180
|
+
}, o)
|
|
6176
6181
|
);
|
|
6177
6182
|
}
|
|
6178
6183
|
n.delay = m;
|
|
6179
|
-
function c(
|
|
6180
|
-
return Object.entries(
|
|
6184
|
+
function c(o) {
|
|
6185
|
+
return Object.entries(o);
|
|
6181
6186
|
}
|
|
6182
6187
|
n.typedEntries = c;
|
|
6183
|
-
function
|
|
6184
|
-
return Object.values(
|
|
6188
|
+
function y(o) {
|
|
6189
|
+
return Object.values(o);
|
|
6185
6190
|
}
|
|
6186
|
-
n.typedValues =
|
|
6187
|
-
function p(
|
|
6188
|
-
return Object.keys(
|
|
6191
|
+
n.typedValues = y;
|
|
6192
|
+
function p(o) {
|
|
6193
|
+
return Object.keys(o);
|
|
6189
6194
|
}
|
|
6190
6195
|
n.typedKeys = p;
|
|
6191
|
-
function o
|
|
6192
|
-
const f = Object.values(
|
|
6193
|
-
let
|
|
6194
|
-
for (const [
|
|
6195
|
-
if (
|
|
6196
|
-
return
|
|
6196
|
+
function l(o) {
|
|
6197
|
+
const f = Object.values(o).reduce((v, j) => v + j, 0), d = c(o).sort((v, j) => j[1] - v[1]), g = Math.random() * f;
|
|
6198
|
+
let b = 0;
|
|
6199
|
+
for (const [v, j] of d)
|
|
6200
|
+
if (b += j, g < b)
|
|
6201
|
+
return v;
|
|
6197
6202
|
}
|
|
6198
|
-
n.probability =
|
|
6199
|
-
})(
|
|
6200
|
-
})(
|
|
6203
|
+
n.probability = l;
|
|
6204
|
+
})(h.utils || (h.utils = {}));
|
|
6205
|
+
})(w || (w = {}));
|
|
6201
6206
|
const $ = [];
|
|
6202
6207
|
class rt {
|
|
6203
6208
|
constructor(e) {
|
|
6204
6209
|
this.field = "button", this.template = "button", this.name = "Button", this.value = "", this.field = e.field ?? this.field, this.template = e.template ?? (typeof this.field == "string" ? this.field : this.template), this.name = e.name ?? this.name, this.value = e.value ?? this.value, this.run = e.run, $.push(this), window?.client instanceof B && (window?.client?.actions.buttons.push(this), window?.client?.emit("action", this, "created"));
|
|
6205
6210
|
}
|
|
6206
6211
|
generate(e) {
|
|
6207
|
-
return
|
|
6212
|
+
return w.utils.typedValues(e).reduce(
|
|
6208
6213
|
(a, i, s) => {
|
|
6209
|
-
const n =
|
|
6214
|
+
const n = w.string.compose(this.template, { index: s, ...i }, { html: !1 }), m = w.string.compose(this.name, { index: s, ...i }, { html: !1 });
|
|
6210
6215
|
a[n] = {
|
|
6211
6216
|
type: "button",
|
|
6212
6217
|
label: m
|
|
6213
6218
|
};
|
|
6214
|
-
let c =
|
|
6219
|
+
let c = w.string.compose(
|
|
6215
6220
|
String(this.value),
|
|
6216
6221
|
{ index: s, ...i },
|
|
6217
6222
|
{ html: !1 }
|
|
@@ -6301,8 +6306,8 @@ class Jt extends tt {
|
|
|
6301
6306
|
return e === "load" && this.loaded ? (t.apply(this), this) : (super.on(e, t), this);
|
|
6302
6307
|
}
|
|
6303
6308
|
}
|
|
6304
|
-
typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (
|
|
6305
|
-
const { detail: e } =
|
|
6309
|
+
typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (h) => {
|
|
6310
|
+
const { detail: e } = h;
|
|
6306
6311
|
if (window.client instanceof B && client instanceof B && client) {
|
|
6307
6312
|
const t = window.client;
|
|
6308
6313
|
if (t.fields = e.fieldData, t.session = e.session.data, t.details = {
|
|
@@ -6317,8 +6322,8 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
|
|
|
6317
6322
|
}).catch(() => {
|
|
6318
6323
|
t.details.provider = "local";
|
|
6319
6324
|
}) : t.details.provider = "local", t.emit("load", e), t.debug) {
|
|
6320
|
-
R.received("Widget loaded!",
|
|
6321
|
-
const a =
|
|
6325
|
+
R.received("Widget loaded!", h.detail);
|
|
6326
|
+
const a = h.detail.fieldData;
|
|
6322
6327
|
Object.keys(a).length && R.received("Field data:", a);
|
|
6323
6328
|
}
|
|
6324
6329
|
t.loaded = !0, t.storage.on("load", (a) => {
|
|
@@ -6335,14 +6340,14 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
|
|
|
6335
6340
|
`Provider: "${t.details.provider}";`,
|
|
6336
6341
|
"No data found."
|
|
6337
6342
|
), a) {
|
|
6338
|
-
const i = (
|
|
6339
|
-
const p = Date.now(),
|
|
6340
|
-
for (const
|
|
6341
|
-
if (
|
|
6342
|
-
const f =
|
|
6343
|
-
f.expire && f.expire > p && (o
|
|
6343
|
+
const i = (y) => {
|
|
6344
|
+
const p = Date.now(), l = {};
|
|
6345
|
+
for (const o in y)
|
|
6346
|
+
if (y.hasOwnProperty(o)) {
|
|
6347
|
+
const f = y[o];
|
|
6348
|
+
f.expire && f.expire > p && (l[o] = f);
|
|
6344
6349
|
}
|
|
6345
|
-
return
|
|
6350
|
+
return l;
|
|
6346
6351
|
}, s = i(a.user || {}), n = i(a.avatar || {}), m = i(a.pronoun || {}), c = i(a.emote || {});
|
|
6347
6352
|
t.storage.update({
|
|
6348
6353
|
user: s,
|
|
@@ -6358,15 +6363,15 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
|
|
|
6358
6363
|
});
|
|
6359
6364
|
});
|
|
6360
6365
|
}
|
|
6361
|
-
}), window.addEventListener("onSessionUpdate", (
|
|
6362
|
-
const { detail: e } =
|
|
6366
|
+
}), window.addEventListener("onSessionUpdate", (h) => {
|
|
6367
|
+
const { detail: e } = h;
|
|
6363
6368
|
if (window.client instanceof B && client instanceof B && client) {
|
|
6364
6369
|
const t = window.client;
|
|
6365
6370
|
t.session = e.session, t.emit("session", e.session), t.debug && R.debug("[Client]", "Session updated", e.session);
|
|
6366
6371
|
}
|
|
6367
|
-
}), window.addEventListener("onEventReceived", ({ detail:
|
|
6372
|
+
}), window.addEventListener("onEventReceived", ({ detail: h }) => {
|
|
6368
6373
|
if (window.client instanceof B && client instanceof B && client) {
|
|
6369
|
-
const t =
|
|
6374
|
+
const t = w.event.parseProvider(h);
|
|
6370
6375
|
switch (t.provider) {
|
|
6371
6376
|
case "streamelements": {
|
|
6372
6377
|
const i = t.data;
|
|
@@ -6606,26 +6611,26 @@ class ft extends tt {
|
|
|
6606
6611
|
}
|
|
6607
6612
|
}
|
|
6608
6613
|
var F;
|
|
6609
|
-
((
|
|
6610
|
-
|
|
6614
|
+
((h) => {
|
|
6615
|
+
h.queue = new ft({
|
|
6611
6616
|
duration: "client",
|
|
6612
6617
|
processor: async function(a) {
|
|
6613
6618
|
if (window.dispatchEvent(new CustomEvent(a.listener, { detail: a.data })), a.listener === "onEventReceived" && a.session) {
|
|
6614
|
-
const i = await
|
|
6619
|
+
const i = await h.generate.event.onSessionUpdate(
|
|
6615
6620
|
window?.client && window?.client instanceof B ? window.client.session : void 0,
|
|
6616
|
-
|
|
6621
|
+
w.event.parseProvider(a.data)
|
|
6617
6622
|
);
|
|
6618
6623
|
window.dispatchEvent(new CustomEvent("onSessionUpdate", { detail: i }));
|
|
6619
6624
|
}
|
|
6620
6625
|
}
|
|
6621
|
-
}),
|
|
6626
|
+
}), h.generate = {
|
|
6622
6627
|
session: {
|
|
6623
6628
|
types: {
|
|
6624
|
-
name: { type: "string", options:
|
|
6625
|
-
tier: { type: "string", options:
|
|
6626
|
-
message: { type: "string", options:
|
|
6627
|
-
item: { type: "array", options:
|
|
6628
|
-
avatar: { type: "string", options:
|
|
6629
|
+
name: { type: "string", options: P.names.filter((t) => t.length) },
|
|
6630
|
+
tier: { type: "string", options: P.tiers.filter((t) => t.length) },
|
|
6631
|
+
message: { type: "string", options: P.messages.filter((t) => t.length) },
|
|
6632
|
+
item: { type: "array", options: P.items },
|
|
6633
|
+
avatar: { type: "string", options: P.avatars.filter((t) => t.length) }
|
|
6629
6634
|
},
|
|
6630
6635
|
available() {
|
|
6631
6636
|
const t = this.types;
|
|
@@ -6998,43 +7003,43 @@ var F;
|
|
|
6998
7003
|
const i = (n) => {
|
|
6999
7004
|
const m = (p) => {
|
|
7000
7005
|
if (!p || !("amount" in p)) return [];
|
|
7001
|
-
const
|
|
7002
|
-
for (let
|
|
7003
|
-
|
|
7004
|
-
return
|
|
7005
|
-
(
|
|
7006
|
+
const l = [];
|
|
7007
|
+
for (let o = 0; o < p.amount; o++)
|
|
7008
|
+
l.push(i(p.value));
|
|
7009
|
+
return l.sort(
|
|
7010
|
+
(o, f) => new Date(f.createdAt).getTime() - new Date(o.createdAt).getTime()
|
|
7006
7011
|
);
|
|
7007
7012
|
}, c = (p) => {
|
|
7008
|
-
const
|
|
7009
|
-
for (const
|
|
7010
|
-
const f =
|
|
7011
|
-
|
|
7013
|
+
const l = {};
|
|
7014
|
+
for (const o in p) {
|
|
7015
|
+
const f = o.replace("_type", "type");
|
|
7016
|
+
l[f] = i(p[o]);
|
|
7012
7017
|
}
|
|
7013
|
-
return
|
|
7014
|
-
},
|
|
7018
|
+
return l;
|
|
7019
|
+
}, y = (p) => {
|
|
7015
7020
|
if (!p) return p;
|
|
7016
7021
|
switch (p.type) {
|
|
7017
7022
|
case "int":
|
|
7018
|
-
return
|
|
7023
|
+
return w.random.number(p.min, p.max);
|
|
7019
7024
|
case "string":
|
|
7020
|
-
return
|
|
7025
|
+
return w.random.array(p.options)[0];
|
|
7021
7026
|
case "date":
|
|
7022
|
-
return
|
|
7027
|
+
return w.random.daysOffset(p.range);
|
|
7023
7028
|
case "array":
|
|
7024
|
-
return
|
|
7029
|
+
return w.random.array(p.options)[0];
|
|
7025
7030
|
case "recent":
|
|
7026
7031
|
return m(p);
|
|
7027
7032
|
default:
|
|
7028
7033
|
return p;
|
|
7029
7034
|
}
|
|
7030
7035
|
};
|
|
7031
|
-
return typeof n != "object" || n === null ? n : "type" in n && typeof n.type == "string" ?
|
|
7036
|
+
return typeof n != "object" || n === null ? n : "type" in n && typeof n.type == "string" ? y(n) : c(n);
|
|
7032
7037
|
};
|
|
7033
7038
|
var s = Object.entries(i(a)).reduce(
|
|
7034
7039
|
(n, [m, c]) => (Object.entries(c).forEach(
|
|
7035
|
-
([
|
|
7040
|
+
([y, p]) => (
|
|
7036
7041
|
//
|
|
7037
|
-
n[`${m}-${
|
|
7042
|
+
n[`${m}-${y}`] = p
|
|
7038
7043
|
)
|
|
7039
7044
|
), n),
|
|
7040
7045
|
{}
|
|
@@ -7088,7 +7093,7 @@ var F;
|
|
|
7088
7093
|
* @returns A Promise that resolves to the simulated onSessionUpdate event data.
|
|
7089
7094
|
*/
|
|
7090
7095
|
async onSessionUpdate(t, a) {
|
|
7091
|
-
if (t ??= await
|
|
7096
|
+
if (t ??= await h.generate.session.get(), a) {
|
|
7092
7097
|
const i = (s, n) => new Date(n.createdAt).getTime() - new Date(s.createdAt).getTime();
|
|
7093
7098
|
switch (a.provider) {
|
|
7094
7099
|
case "twitch": {
|
|
@@ -7097,17 +7102,17 @@ var F;
|
|
|
7097
7102
|
case "cheer-latest": {
|
|
7098
7103
|
const n = s.event.amount, m = s.event.displayName ?? s.event.name, c = s.event.message;
|
|
7099
7104
|
t["cheer-latest"] = { name: m, amount: n, message: c };
|
|
7100
|
-
const
|
|
7105
|
+
const y = (p) => {
|
|
7101
7106
|
if (p === "all") {
|
|
7102
|
-
|
|
7107
|
+
y("alltime"), y("monthly"), y("weekly"), y("session");
|
|
7103
7108
|
return;
|
|
7104
7109
|
}
|
|
7105
|
-
const
|
|
7106
|
-
|
|
7107
|
-
const
|
|
7108
|
-
d > f && (
|
|
7110
|
+
const l = t[`cheer-${p}-top-donation`];
|
|
7111
|
+
l && n > l.amount && (l.amount = n, l.name = m);
|
|
7112
|
+
const o = t[`cheer-${p}-top-donator`], f = t["cheer-recent"].filter((g) => g.name.toLowerCase() === o.name.toLowerCase()).reduce((g, b) => g + b.amount, 0), d = t["cheer-recent"].filter((g) => g.name.toLowerCase() === m.toLowerCase()).reduce((g, b) => g + b.amount, 0);
|
|
7113
|
+
d > f && (o.amount = d, o.name = m);
|
|
7109
7114
|
};
|
|
7110
|
-
|
|
7115
|
+
y("all"), t["cheer-session"].amount += n, t["cheer-week"].amount += n, t["cheer-month"].amount += n, t["cheer-total"].amount += n, t["cheer-count"].count += 1, t["cheer-goal"].amount += n, t["cheer-recent"].unshift({
|
|
7111
7116
|
name: m,
|
|
7112
7117
|
amount: n,
|
|
7113
7118
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -7125,16 +7130,16 @@ var F;
|
|
|
7125
7130
|
break;
|
|
7126
7131
|
}
|
|
7127
7132
|
case "subscriber-latest": {
|
|
7128
|
-
const n = s.event.displayName ?? s.event.name, m = s.event.amount, c = s.event.tier,
|
|
7129
|
-
if (t["subscriber-latest"] = { name: n, amount: m, tier: c, message:
|
|
7133
|
+
const n = s.event.displayName ?? s.event.name, m = s.event.amount, c = s.event.tier, y = s.event.message;
|
|
7134
|
+
if (t["subscriber-latest"] = { name: n, amount: m, tier: c, message: y ?? "" }, t["subscriber-recent"].find(
|
|
7130
7135
|
(p) => p.name.toLowerCase() === n.toLowerCase()
|
|
7131
|
-
) ? m > 1 && (t["subscriber-resub-latest"] = { name: n, amount: m, message:
|
|
7136
|
+
) ? m > 1 && (t["subscriber-resub-latest"] = { name: n, amount: m, message: y ?? "" }, t["subscriber-resub-session"].count += 1) : (t["subscriber-new-latest"] = { name: n, amount: m, message: y ?? "" }, t["subscriber-new-session"].count += 1), !(!s.event.gifted && !s.event.bulkGifted && !s.event.isCommunityGift)) if (s.event.gifted && !s.event.bulkGifted && !s.event.isCommunityGift) {
|
|
7132
7137
|
const p = s.event.sender;
|
|
7133
7138
|
t["subscriber-gifted-latest"] = {
|
|
7134
7139
|
name: n,
|
|
7135
7140
|
amount: m,
|
|
7136
7141
|
tier: c,
|
|
7137
|
-
message:
|
|
7142
|
+
message: y ?? "",
|
|
7138
7143
|
sender: p
|
|
7139
7144
|
}, t["subscriber-gifted-session"].count += 1, t["subscriber-alltime-gifter"] = { name: p, amount: m };
|
|
7140
7145
|
} else s.event.gifted && !s.event.bulkGifted && s.event.isCommunityGift || !s.event.gifted && s.event.bulkGifted && s.event.isCommunityGift;
|
|
@@ -7168,28 +7173,28 @@ var F;
|
|
|
7168
7173
|
name: n.toLowerCase(),
|
|
7169
7174
|
displayName: n,
|
|
7170
7175
|
amount: m,
|
|
7171
|
-
_id:
|
|
7176
|
+
_id: w.random.uuid(),
|
|
7172
7177
|
sessionTop: !1,
|
|
7173
7178
|
type: "superchat",
|
|
7174
7179
|
originalEventName: "superchat-latest",
|
|
7175
7180
|
providerId: "",
|
|
7176
7181
|
avatar: ""
|
|
7177
7182
|
};
|
|
7178
|
-
const c = (
|
|
7179
|
-
if (
|
|
7183
|
+
const c = (y) => {
|
|
7184
|
+
if (y === "all") {
|
|
7180
7185
|
c("alltime"), c("monthly"), c("weekly"), c("session");
|
|
7181
7186
|
return;
|
|
7182
7187
|
}
|
|
7183
|
-
const p = t[`superchat-${
|
|
7188
|
+
const p = t[`superchat-${y}-top-donation`];
|
|
7184
7189
|
p && m > p.amount && (p.amount = m, p.name = n);
|
|
7185
|
-
const
|
|
7186
|
-
f >
|
|
7190
|
+
const l = t[`superchat-${y}-top-donator`], o = t["superchat-recent"].filter((d) => d.name.toLowerCase() === l.name.toLowerCase()).reduce((d, g) => d + g.amount, 0), f = t["superchat-recent"].filter((d) => d.name.toLowerCase() === n.toLowerCase()).reduce((d, g) => d + g.amount, 0);
|
|
7191
|
+
f > o && (l.amount = f, l.name = n);
|
|
7187
7192
|
};
|
|
7188
7193
|
c("all"), t["superchat-session"].amount += m, t["superchat-week"].amount += m, t["superchat-month"].amount += m, t["superchat-total"].amount += m, t["superchat-count"].count += 1, t["superchat-goal"].amount += m, t["superchat-recent"].unshift({
|
|
7189
7194
|
name: n.toLowerCase(),
|
|
7190
7195
|
displayName: n,
|
|
7191
7196
|
amount: m,
|
|
7192
|
-
_id:
|
|
7197
|
+
_id: w.random.uuid(),
|
|
7193
7198
|
sessionTop: !1,
|
|
7194
7199
|
type: "superchat",
|
|
7195
7200
|
originalEventName: "superchat-latest",
|
|
@@ -7204,15 +7209,15 @@ var F;
|
|
|
7204
7209
|
if (s.listener === "tip-latest") {
|
|
7205
7210
|
const n = s.event.displayName ?? s.event.name, m = s.event.amount;
|
|
7206
7211
|
t["tip-latest"] = { name: n, amount: m };
|
|
7207
|
-
const c = (
|
|
7208
|
-
if (
|
|
7212
|
+
const c = (y) => {
|
|
7213
|
+
if (y === "all") {
|
|
7209
7214
|
c("alltime"), c("monthly"), c("weekly"), c("session");
|
|
7210
7215
|
return;
|
|
7211
7216
|
}
|
|
7212
|
-
const p = t[`tip-${
|
|
7217
|
+
const p = t[`tip-${y}-top-donation`];
|
|
7213
7218
|
p && m > p.amount && (p.amount = m, p.name = n);
|
|
7214
|
-
const
|
|
7215
|
-
f >
|
|
7219
|
+
const l = t[`tip-${y}-top-donator`], o = t["tip-recent"].filter((d) => d.name.toLowerCase() === l.name.toLowerCase()).reduce((d, g) => d + g.amount, 0), f = t["tip-recent"].filter((d) => d.name.toLowerCase() === n.toLowerCase()).reduce((d, g) => d + g.amount, 0);
|
|
7220
|
+
f > o && (l.amount = f, l.name = n);
|
|
7216
7221
|
};
|
|
7217
7222
|
c("all"), t["tip-session"].amount += m, t["tip-week"].amount += m, t["tip-month"].amount += m, t["tip-total"].amount += m, t["tip-count"].count += 1, t["tip-goal"].amount += m, t["tip-recent"].unshift({
|
|
7218
7223
|
name: n,
|
|
@@ -7258,9 +7263,9 @@ var F;
|
|
|
7258
7263
|
switch (t) {
|
|
7259
7264
|
default:
|
|
7260
7265
|
case "random": {
|
|
7261
|
-
var n =
|
|
7266
|
+
var n = w.random.array(
|
|
7262
7267
|
Object.keys(s).filter((S) => s[S].length)
|
|
7263
|
-
)[0], m =
|
|
7268
|
+
)[0], m = w.random.array(
|
|
7264
7269
|
s[n]
|
|
7265
7270
|
)[0];
|
|
7266
7271
|
return this.onEventReceived(n, m);
|
|
@@ -7269,23 +7274,23 @@ var F;
|
|
|
7269
7274
|
switch (a) {
|
|
7270
7275
|
default:
|
|
7271
7276
|
case "random": {
|
|
7272
|
-
var m =
|
|
7277
|
+
var m = w.random.array(
|
|
7273
7278
|
s[t]
|
|
7274
7279
|
)[0];
|
|
7275
7280
|
return this.onEventReceived(t, m);
|
|
7276
7281
|
}
|
|
7277
7282
|
case "message": {
|
|
7278
7283
|
const S = i;
|
|
7279
|
-
var c = S?.name ??
|
|
7284
|
+
var c = S?.name ?? w.random.array(P.names.filter((q) => q.length))[0], y = S?.message ?? w.random.array(P.messages.filter((q) => q.length))[0], p = await w.message.generateBadges(S?.badges ?? [], t), l = w.message.findEmotesInText(y), o = w.message.replaceEmotesWithHTML(y, l), f = S?.color ?? w.random.color("hex"), d = S?.userId ?? w.random.string(16), g = S?.msgId ?? w.random.string(16), b = S?.time ?? Date.now(), v = S?.channel ?? window?.client?.details?.user?.username ?? "local", j = S?.reply ? {
|
|
7280
7285
|
"reply-parent-display-name": S.reply.name,
|
|
7281
7286
|
"reply-parent-msg-body": S.reply.text,
|
|
7282
7287
|
"reply-parent-msg-id": S.reply.msgId,
|
|
7283
7288
|
"reply-parent-user-id": S.reply.userId,
|
|
7284
7289
|
"reply-parent-user-login": S.reply.name.toLowerCase()
|
|
7285
|
-
} : {},
|
|
7290
|
+
} : {}, C = S?.thread ? {
|
|
7286
7291
|
"reply-thread-parent-msg-id": S.thread.msgId,
|
|
7287
7292
|
"reply-thread-parent-user-login": S.thread.name.toLowerCase()
|
|
7288
|
-
} : {},
|
|
7293
|
+
} : {}, x = {
|
|
7289
7294
|
vip: p.keys.includes("vip") ? "" : void 0,
|
|
7290
7295
|
subscriber: p.keys.includes("subscriber") ? "1" : "0",
|
|
7291
7296
|
mod: p.keys.includes("moderator") ? "1" : "0",
|
|
@@ -7296,37 +7301,37 @@ var F;
|
|
|
7296
7301
|
event: {
|
|
7297
7302
|
service: t,
|
|
7298
7303
|
data: {
|
|
7299
|
-
time:
|
|
7304
|
+
time: b,
|
|
7300
7305
|
tags: {
|
|
7301
|
-
"badge-info": `${p.keys.map((q) => `${q}/${p.amount[q] ??
|
|
7306
|
+
"badge-info": `${p.keys.map((q) => `${q}/${p.amount[q] ?? w.random.number(1, 5)}`).join(",")}`,
|
|
7302
7307
|
badges: p.keys.map((q) => `${q}/1`).join(","),
|
|
7303
|
-
...
|
|
7304
|
-
"tmi-sent-ts":
|
|
7308
|
+
...x,
|
|
7309
|
+
"tmi-sent-ts": b.toString(),
|
|
7305
7310
|
"user-id": d,
|
|
7306
7311
|
"user-type": "",
|
|
7307
7312
|
color: f,
|
|
7308
7313
|
"display-name": c,
|
|
7309
7314
|
emotes: "",
|
|
7310
|
-
"client-nonce":
|
|
7315
|
+
"client-nonce": w.random.string(16),
|
|
7311
7316
|
flags: "",
|
|
7312
7317
|
id: g,
|
|
7313
7318
|
"first-msg": S?.firstMsg ? "1" : "0",
|
|
7314
7319
|
"returning-chatter": S?.returningChatter ? "1" : "0",
|
|
7315
|
-
...
|
|
7316
|
-
...
|
|
7320
|
+
...j,
|
|
7321
|
+
...C
|
|
7317
7322
|
},
|
|
7318
7323
|
nick: c.toLowerCase(),
|
|
7319
7324
|
displayName: c,
|
|
7320
7325
|
displayColor: f,
|
|
7321
|
-
channel:
|
|
7322
|
-
text:
|
|
7326
|
+
channel: v,
|
|
7327
|
+
text: y,
|
|
7323
7328
|
isAction: !1,
|
|
7324
7329
|
userId: d,
|
|
7325
7330
|
msgId: g,
|
|
7326
7331
|
badges: p.badges,
|
|
7327
|
-
emotes:
|
|
7332
|
+
emotes: l
|
|
7328
7333
|
},
|
|
7329
|
-
renderedText:
|
|
7334
|
+
renderedText: o
|
|
7330
7335
|
},
|
|
7331
7336
|
// @ts-ignore
|
|
7332
7337
|
emulated: !0
|
|
@@ -7334,17 +7339,17 @@ var F;
|
|
|
7334
7339
|
}
|
|
7335
7340
|
case "cheer":
|
|
7336
7341
|
case "cheer-latest": {
|
|
7337
|
-
var
|
|
7342
|
+
var A = i?.amount ?? w.random.number(100, 1e4), J = i?.avatar ?? w.random.array(P.avatars)[0], c = i?.name ?? w.random.array(P.names.filter((G) => G.length))[0], y = i?.message ?? w.random.array(P.messages.filter((G) => G.length))[0];
|
|
7338
7343
|
return {
|
|
7339
7344
|
listener: "cheer-latest",
|
|
7340
7345
|
event: {
|
|
7341
|
-
amount:
|
|
7342
|
-
avatar:
|
|
7346
|
+
amount: A,
|
|
7347
|
+
avatar: J,
|
|
7343
7348
|
name: c.toLowerCase(),
|
|
7344
7349
|
displayName: c,
|
|
7345
|
-
message:
|
|
7350
|
+
message: y,
|
|
7346
7351
|
providerId: "",
|
|
7347
|
-
_id:
|
|
7352
|
+
_id: w.random.uuid(),
|
|
7348
7353
|
sessionTop: !1,
|
|
7349
7354
|
type: "cheer",
|
|
7350
7355
|
originalEventName: "cheer-latest",
|
|
@@ -7356,15 +7361,15 @@ var F;
|
|
|
7356
7361
|
}
|
|
7357
7362
|
case "follower":
|
|
7358
7363
|
case "follower-latest": {
|
|
7359
|
-
var
|
|
7364
|
+
var J = i?.avatar ?? w.random.array(P.avatars)[0], c = i?.name ?? w.random.array(P.names.filter((G) => G.length))[0];
|
|
7360
7365
|
return {
|
|
7361
7366
|
listener: "follower-latest",
|
|
7362
7367
|
event: {
|
|
7363
|
-
avatar:
|
|
7368
|
+
avatar: J,
|
|
7364
7369
|
name: c.toLowerCase(),
|
|
7365
7370
|
displayName: c,
|
|
7366
7371
|
providerId: "",
|
|
7367
|
-
_id:
|
|
7372
|
+
_id: w.random.uuid(),
|
|
7368
7373
|
sessionTop: !1,
|
|
7369
7374
|
type: "follower",
|
|
7370
7375
|
originalEventName: "follower-latest",
|
|
@@ -7376,16 +7381,16 @@ var F;
|
|
|
7376
7381
|
}
|
|
7377
7382
|
case "raid":
|
|
7378
7383
|
case "raid-latest": {
|
|
7379
|
-
var
|
|
7384
|
+
var A = i?.amount ?? w.random.number(1, 100), J = i?.avatar ?? w.random.array(P.avatars)[0], c = i?.name ?? w.random.array(P.names.filter((Q) => Q.length))[0];
|
|
7380
7385
|
return {
|
|
7381
7386
|
listener: "raid-latest",
|
|
7382
7387
|
event: {
|
|
7383
|
-
amount:
|
|
7384
|
-
avatar:
|
|
7388
|
+
amount: A,
|
|
7389
|
+
avatar: J,
|
|
7385
7390
|
name: c.toLowerCase(),
|
|
7386
7391
|
displayName: c,
|
|
7387
7392
|
providerId: "",
|
|
7388
|
-
_id:
|
|
7393
|
+
_id: w.random.uuid(),
|
|
7389
7394
|
sessionTop: !1,
|
|
7390
7395
|
type: "raid",
|
|
7391
7396
|
originalEventName: "raid-latest",
|
|
@@ -7397,37 +7402,37 @@ var F;
|
|
|
7397
7402
|
}
|
|
7398
7403
|
case "subscriber":
|
|
7399
7404
|
case "subscriber-latest": {
|
|
7400
|
-
var _ = i?.tier ??
|
|
7405
|
+
var _ = i?.tier ?? w.random.array(["1000", "2000", "3000", "prime"])[0], A = i?.amount ?? w.random.number(1, 24), J = i?.avatar ?? w.random.array(P.avatars)[0], c = i?.name ?? w.random.array(P.names.filter((Y) => Y.length))[0], U = i?.sender ?? w.random.array(P.names.filter((Y) => Y.length && Y !== c))[0], y = i?.message ?? w.random.array(P.messages.filter((Y) => Y.length))[0], M = {
|
|
7401
7406
|
default: {
|
|
7402
|
-
avatar:
|
|
7407
|
+
avatar: J,
|
|
7403
7408
|
playedAsCommunityGift: !1
|
|
7404
7409
|
},
|
|
7405
7410
|
gift: {
|
|
7406
|
-
sender:
|
|
7411
|
+
sender: U,
|
|
7407
7412
|
gifted: !0
|
|
7408
7413
|
},
|
|
7409
7414
|
community: {
|
|
7410
|
-
message:
|
|
7411
|
-
sender:
|
|
7415
|
+
message: y,
|
|
7416
|
+
sender: U,
|
|
7412
7417
|
bulkGifted: !0
|
|
7413
7418
|
},
|
|
7414
7419
|
spam: {
|
|
7415
|
-
sender:
|
|
7420
|
+
sender: U,
|
|
7416
7421
|
gifted: !0,
|
|
7417
7422
|
isCommunityGift: !0
|
|
7418
7423
|
}
|
|
7419
|
-
}, H = ["default", "gift", "community", "spam"], O = i?.subType ??
|
|
7424
|
+
}, H = ["default", "gift", "community", "spam"], O = i?.subType ?? w.random.array(H)[0];
|
|
7420
7425
|
return O = H.includes(O) ? O : "default", {
|
|
7421
7426
|
listener: "subscriber-latest",
|
|
7422
7427
|
event: {
|
|
7423
|
-
amount:
|
|
7428
|
+
amount: A,
|
|
7424
7429
|
name: c.toLowerCase(),
|
|
7425
7430
|
displayName: c,
|
|
7426
7431
|
providerId: "",
|
|
7427
7432
|
tier: _,
|
|
7428
7433
|
...M.default,
|
|
7429
7434
|
...M[O],
|
|
7430
|
-
_id:
|
|
7435
|
+
_id: w.random.uuid(),
|
|
7431
7436
|
sessionTop: !1,
|
|
7432
7437
|
type: "subscriber",
|
|
7433
7438
|
originalEventName: "subscriber-latest",
|
|
@@ -7441,7 +7446,7 @@ var F;
|
|
|
7441
7446
|
return {
|
|
7442
7447
|
listener: "delete-message",
|
|
7443
7448
|
event: {
|
|
7444
|
-
msgId: i?.id ??
|
|
7449
|
+
msgId: i?.id ?? w.random.uuid(),
|
|
7445
7450
|
provider: t
|
|
7446
7451
|
},
|
|
7447
7452
|
// @ts-ignore
|
|
@@ -7451,7 +7456,7 @@ var F;
|
|
|
7451
7456
|
return {
|
|
7452
7457
|
listener: "delete-messages",
|
|
7453
7458
|
event: {
|
|
7454
|
-
userId: i?.id ??
|
|
7459
|
+
userId: i?.id ?? w.random.number(1e7, 99999999).toString(),
|
|
7455
7460
|
provider: t
|
|
7456
7461
|
},
|
|
7457
7462
|
// @ts-ignore
|
|
@@ -7462,23 +7467,23 @@ var F;
|
|
|
7462
7467
|
switch (a) {
|
|
7463
7468
|
default:
|
|
7464
7469
|
case "random": {
|
|
7465
|
-
var m =
|
|
7470
|
+
var m = w.random.array(
|
|
7466
7471
|
s[t]
|
|
7467
7472
|
)[0];
|
|
7468
7473
|
return this.onEventReceived(t, m);
|
|
7469
7474
|
}
|
|
7470
7475
|
case "tip":
|
|
7471
7476
|
case "tip-latest": {
|
|
7472
|
-
var
|
|
7477
|
+
var A = i?.amount ?? w.random.number(100, 4e3), J = i?.avatar ?? w.random.array(P.avatars)[0], c = i?.name ?? w.random.array(P.names.filter((Q) => Q.length))[0];
|
|
7473
7478
|
return {
|
|
7474
7479
|
listener: "tip-latest",
|
|
7475
7480
|
event: {
|
|
7476
|
-
amount:
|
|
7477
|
-
avatar:
|
|
7481
|
+
amount: A,
|
|
7482
|
+
avatar: J,
|
|
7478
7483
|
name: c.toLowerCase(),
|
|
7479
7484
|
displayName: c,
|
|
7480
7485
|
providerId: "",
|
|
7481
|
-
_id:
|
|
7486
|
+
_id: w.random.uuid(),
|
|
7482
7487
|
sessionTop: !1,
|
|
7483
7488
|
type: "tip",
|
|
7484
7489
|
originalEventName: "tip-latest",
|
|
@@ -7506,7 +7511,7 @@ var F;
|
|
|
7506
7511
|
listener: "bot:counter",
|
|
7507
7512
|
event: {
|
|
7508
7513
|
counter: i?.counter ?? "sampleCounter",
|
|
7509
|
-
value: i?.value ??
|
|
7514
|
+
value: i?.value ?? w.random.number(0, 100),
|
|
7510
7515
|
provider: t
|
|
7511
7516
|
},
|
|
7512
7517
|
// @ts-ignore
|
|
@@ -7541,18 +7546,18 @@ var F;
|
|
|
7541
7546
|
switch (a) {
|
|
7542
7547
|
default:
|
|
7543
7548
|
case "random": {
|
|
7544
|
-
var m =
|
|
7549
|
+
var m = w.random.array(
|
|
7545
7550
|
s[t]
|
|
7546
7551
|
)[0];
|
|
7547
7552
|
return this.onEventReceived(t, m);
|
|
7548
7553
|
}
|
|
7549
7554
|
case "message": {
|
|
7550
|
-
var c = i?.name ??
|
|
7551
|
-
const q = await
|
|
7555
|
+
var c = i?.name ?? w.random.array(P.names.filter((u) => u.length))[0], y = i?.message ?? w.random.array(P.messages.filter((u) => u.length))[0];
|
|
7556
|
+
const q = await w.message.generateBadges(
|
|
7552
7557
|
i?.badges ?? [],
|
|
7553
7558
|
t
|
|
7554
7559
|
);
|
|
7555
|
-
var
|
|
7560
|
+
var l = w.message.findEmotesInText(y), o = w.message.replaceEmotesWithHTML(y, l), f = i?.color ?? w.random.color("hex"), d = i?.userId ?? w.random.number(1e7, 99999999).toString(), g = i?.msgId ?? w.random.uuid(), b = i?.time ?? Date.now(), J = i?.avatar ?? w.random.array(P.avatars)[0], v = i?.channel ?? window?.client?.details?.user?.username ?? "local";
|
|
7556
7561
|
return {
|
|
7557
7562
|
listener: "message",
|
|
7558
7563
|
event: {
|
|
@@ -7564,19 +7569,19 @@ var F;
|
|
|
7564
7569
|
snippet: {
|
|
7565
7570
|
type: "",
|
|
7566
7571
|
liveChatId: "",
|
|
7567
|
-
authorChannelId:
|
|
7572
|
+
authorChannelId: v,
|
|
7568
7573
|
publishedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7569
7574
|
hasDisplayContent: !0,
|
|
7570
|
-
displayMessage:
|
|
7575
|
+
displayMessage: y,
|
|
7571
7576
|
textMessageDetails: {
|
|
7572
|
-
messageText:
|
|
7577
|
+
messageText: y
|
|
7573
7578
|
}
|
|
7574
7579
|
},
|
|
7575
7580
|
authorDetails: {
|
|
7576
|
-
channelId:
|
|
7581
|
+
channelId: v,
|
|
7577
7582
|
channelUrl: "",
|
|
7578
7583
|
displayName: c,
|
|
7579
|
-
profileImageUrl:
|
|
7584
|
+
profileImageUrl: J,
|
|
7580
7585
|
...q
|
|
7581
7586
|
},
|
|
7582
7587
|
msgId: g,
|
|
@@ -7585,15 +7590,15 @@ var F;
|
|
|
7585
7590
|
badges: [],
|
|
7586
7591
|
displayName: c,
|
|
7587
7592
|
isAction: !1,
|
|
7588
|
-
time:
|
|
7593
|
+
time: b,
|
|
7589
7594
|
tags: [],
|
|
7590
7595
|
displayColor: f,
|
|
7591
|
-
channel:
|
|
7592
|
-
text:
|
|
7593
|
-
avatar:
|
|
7596
|
+
channel: v,
|
|
7597
|
+
text: y,
|
|
7598
|
+
avatar: J,
|
|
7594
7599
|
emotes: []
|
|
7595
7600
|
},
|
|
7596
|
-
renderedText:
|
|
7601
|
+
renderedText: y
|
|
7597
7602
|
},
|
|
7598
7603
|
// @ts-ignore
|
|
7599
7604
|
emulated: !0
|
|
@@ -7601,15 +7606,15 @@ var F;
|
|
|
7601
7606
|
}
|
|
7602
7607
|
case "subscriber":
|
|
7603
7608
|
case "subscriber-latest": {
|
|
7604
|
-
var
|
|
7609
|
+
var J = i?.avatar ?? w.random.array(P.avatars)[0], c = i?.name ?? w.random.array(P.names.filter((G) => G.length))[0];
|
|
7605
7610
|
return {
|
|
7606
7611
|
listener: "subscriber-latest",
|
|
7607
7612
|
event: {
|
|
7608
|
-
avatar:
|
|
7613
|
+
avatar: J,
|
|
7609
7614
|
displayName: c,
|
|
7610
7615
|
name: c.toLowerCase(),
|
|
7611
7616
|
providerId: "",
|
|
7612
|
-
_id:
|
|
7617
|
+
_id: w.random.uuid(),
|
|
7613
7618
|
sessionTop: !1,
|
|
7614
7619
|
type: "subscriber",
|
|
7615
7620
|
originalEventName: "subscriber-latest",
|
|
@@ -7621,16 +7626,16 @@ var F;
|
|
|
7621
7626
|
}
|
|
7622
7627
|
case "superchat":
|
|
7623
7628
|
case "superchat-latest": {
|
|
7624
|
-
var
|
|
7629
|
+
var A = i?.amount ?? w.random.number(100, 4e3), J = i?.avatar ?? w.random.array(P.avatars)[0], c = i?.name ?? w.random.array(P.names.filter((Q) => Q.length))[0];
|
|
7625
7630
|
return {
|
|
7626
7631
|
listener: "superchat-latest",
|
|
7627
7632
|
event: {
|
|
7628
|
-
amount:
|
|
7629
|
-
avatar:
|
|
7633
|
+
amount: A,
|
|
7634
|
+
avatar: J,
|
|
7630
7635
|
name: c.toLowerCase(),
|
|
7631
7636
|
displayName: c,
|
|
7632
7637
|
providerId: "",
|
|
7633
|
-
_id:
|
|
7638
|
+
_id: w.random.uuid(),
|
|
7634
7639
|
sessionTop: !1,
|
|
7635
7640
|
type: "superchat",
|
|
7636
7641
|
originalEventName: "superchat-latest",
|
|
@@ -7642,36 +7647,36 @@ var F;
|
|
|
7642
7647
|
}
|
|
7643
7648
|
case "sponsor":
|
|
7644
7649
|
case "sponsor-latest": {
|
|
7645
|
-
var _ = i?.tier ??
|
|
7650
|
+
var _ = i?.tier ?? w.random.array(["1000", "2000", "3000"])[0], A = i?.amount ?? w.random.number(1, 24), J = i?.avatar ?? w.random.array(P.avatars)[0], c = i?.name ?? w.random.array(P.names.filter((K) => K.length))[0], U = i?.sender ?? w.random.array(P.names.filter((K) => K.length && K !== c))[0], y = i?.message ?? w.random.array(P.messages.filter((K) => K.length))[0], M = {
|
|
7646
7651
|
default: {
|
|
7647
|
-
avatar:
|
|
7652
|
+
avatar: J,
|
|
7648
7653
|
playedAsCommunityGift: !1
|
|
7649
7654
|
},
|
|
7650
7655
|
gift: {
|
|
7651
|
-
sender:
|
|
7656
|
+
sender: U,
|
|
7652
7657
|
gifted: !0
|
|
7653
7658
|
},
|
|
7654
7659
|
community: {
|
|
7655
|
-
message:
|
|
7656
|
-
sender:
|
|
7660
|
+
message: y,
|
|
7661
|
+
sender: U,
|
|
7657
7662
|
bulkGifted: !0
|
|
7658
7663
|
},
|
|
7659
7664
|
spam: {
|
|
7660
|
-
sender:
|
|
7665
|
+
sender: U,
|
|
7661
7666
|
gifted: !0,
|
|
7662
7667
|
isCommunityGift: !0
|
|
7663
7668
|
}
|
|
7664
|
-
}, H = ["default", "gift", "community", "spam"], O = i?.subType ??
|
|
7669
|
+
}, H = ["default", "gift", "community", "spam"], O = i?.subType ?? w.random.array(H)[0];
|
|
7665
7670
|
return O = H.includes(O) ? O : "default", {
|
|
7666
7671
|
listener: "sponsor-latest",
|
|
7667
7672
|
event: {
|
|
7668
|
-
amount:
|
|
7673
|
+
amount: A,
|
|
7669
7674
|
name: c.toLowerCase(),
|
|
7670
7675
|
displayName: c,
|
|
7671
7676
|
providerId: "",
|
|
7672
7677
|
...M.default,
|
|
7673
7678
|
...M[O],
|
|
7674
|
-
_id:
|
|
7679
|
+
_id: w.random.uuid(),
|
|
7675
7680
|
sessionTop: !1,
|
|
7676
7681
|
type: "sponsor",
|
|
7677
7682
|
originalEventName: "sponsor-latest",
|
|
@@ -7685,11 +7690,11 @@ var F;
|
|
|
7685
7690
|
}
|
|
7686
7691
|
}
|
|
7687
7692
|
}
|
|
7688
|
-
},
|
|
7693
|
+
}, h.emulate = {
|
|
7689
7694
|
twitch: {
|
|
7690
7695
|
message(t = {}) {
|
|
7691
|
-
|
|
7692
|
-
a &&
|
|
7696
|
+
h.generate.event.onEventReceived("twitch", "message", t).then((a) => {
|
|
7697
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7693
7698
|
});
|
|
7694
7699
|
},
|
|
7695
7700
|
deleteMessage(t) {
|
|
@@ -7700,7 +7705,7 @@ var F;
|
|
|
7700
7705
|
msgId: t
|
|
7701
7706
|
}
|
|
7702
7707
|
};
|
|
7703
|
-
|
|
7708
|
+
h.emulate.send("onEventReceived", a);
|
|
7704
7709
|
},
|
|
7705
7710
|
deleteMessages(t) {
|
|
7706
7711
|
if (!t || typeof t != "string") return;
|
|
@@ -7710,104 +7715,104 @@ var F;
|
|
|
7710
7715
|
userId: t
|
|
7711
7716
|
}
|
|
7712
7717
|
};
|
|
7713
|
-
|
|
7718
|
+
h.emulate.send("onEventReceived", a);
|
|
7714
7719
|
},
|
|
7715
7720
|
follower(t = {}) {
|
|
7716
|
-
|
|
7721
|
+
h.generate.event.onEventReceived(
|
|
7717
7722
|
"twitch",
|
|
7718
7723
|
"follower-latest",
|
|
7719
7724
|
t
|
|
7720
7725
|
).then((a) => {
|
|
7721
|
-
a &&
|
|
7726
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7722
7727
|
});
|
|
7723
7728
|
},
|
|
7724
7729
|
raid(t = {}) {
|
|
7725
|
-
|
|
7730
|
+
h.generate.event.onEventReceived(
|
|
7726
7731
|
"twitch",
|
|
7727
7732
|
"raid-latest",
|
|
7728
7733
|
t
|
|
7729
7734
|
).then((a) => {
|
|
7730
|
-
a &&
|
|
7735
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7731
7736
|
});
|
|
7732
7737
|
},
|
|
7733
7738
|
cheer(t = {}) {
|
|
7734
|
-
|
|
7739
|
+
h.generate.event.onEventReceived(
|
|
7735
7740
|
"twitch",
|
|
7736
7741
|
"cheer-latest",
|
|
7737
7742
|
t
|
|
7738
7743
|
).then((a) => {
|
|
7739
|
-
a &&
|
|
7744
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7740
7745
|
});
|
|
7741
7746
|
},
|
|
7742
7747
|
subscriber(t = {}) {
|
|
7743
|
-
|
|
7748
|
+
h.generate.event.onEventReceived(
|
|
7744
7749
|
"twitch",
|
|
7745
7750
|
"subscriber-latest",
|
|
7746
7751
|
t
|
|
7747
7752
|
).then((a) => {
|
|
7748
|
-
a &&
|
|
7753
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7749
7754
|
});
|
|
7750
7755
|
}
|
|
7751
7756
|
},
|
|
7752
7757
|
streamelements: {
|
|
7753
7758
|
tip(t = {}) {
|
|
7754
|
-
|
|
7759
|
+
h.generate.event.onEventReceived(
|
|
7755
7760
|
"streamelements",
|
|
7756
7761
|
"tip-latest",
|
|
7757
7762
|
t
|
|
7758
7763
|
).then((a) => {
|
|
7759
|
-
a &&
|
|
7764
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7760
7765
|
});
|
|
7761
7766
|
}
|
|
7762
7767
|
},
|
|
7763
7768
|
youtube: {
|
|
7764
7769
|
message(t = {}) {
|
|
7765
|
-
|
|
7770
|
+
h.generate.event.onEventReceived(
|
|
7766
7771
|
"youtube",
|
|
7767
7772
|
"message",
|
|
7768
7773
|
t
|
|
7769
7774
|
).then((a) => {
|
|
7770
|
-
a &&
|
|
7775
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7771
7776
|
});
|
|
7772
7777
|
},
|
|
7773
7778
|
subscriber(t = {}) {
|
|
7774
|
-
|
|
7779
|
+
h.generate.event.onEventReceived(
|
|
7775
7780
|
"youtube",
|
|
7776
7781
|
"subscriber-latest",
|
|
7777
7782
|
t
|
|
7778
7783
|
).then((a) => {
|
|
7779
|
-
a &&
|
|
7784
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7780
7785
|
});
|
|
7781
7786
|
},
|
|
7782
7787
|
superchat(t = {}) {
|
|
7783
|
-
|
|
7788
|
+
h.generate.event.onEventReceived(
|
|
7784
7789
|
"youtube",
|
|
7785
7790
|
"superchat-latest",
|
|
7786
7791
|
t
|
|
7787
7792
|
).then((a) => {
|
|
7788
|
-
a &&
|
|
7793
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7789
7794
|
});
|
|
7790
7795
|
},
|
|
7791
7796
|
sponsor(t = {}) {
|
|
7792
|
-
|
|
7797
|
+
h.generate.event.onEventReceived(
|
|
7793
7798
|
"youtube",
|
|
7794
7799
|
"sponsor-latest",
|
|
7795
7800
|
t
|
|
7796
7801
|
).then((a) => {
|
|
7797
|
-
a &&
|
|
7802
|
+
a && h.emulate.send("onEventReceived", a);
|
|
7798
7803
|
});
|
|
7799
7804
|
}
|
|
7800
7805
|
},
|
|
7801
7806
|
kick: {},
|
|
7802
7807
|
facebook: {},
|
|
7803
7808
|
send(t, a) {
|
|
7804
|
-
if (!
|
|
7809
|
+
if (!h.queue) {
|
|
7805
7810
|
R.warn("Local queue is not initialized."), window.dispatchEvent(new CustomEvent(t, { detail: a }));
|
|
7806
7811
|
return;
|
|
7807
7812
|
}
|
|
7808
7813
|
switch (t) {
|
|
7809
7814
|
case "onEventReceived": {
|
|
7810
|
-
|
|
7815
|
+
h.queue.enqueue({
|
|
7811
7816
|
listener: t,
|
|
7812
7817
|
data: a,
|
|
7813
7818
|
session: t === "onEventReceived" ? !0 : void 0
|
|
@@ -7815,14 +7820,14 @@ var F;
|
|
|
7815
7820
|
break;
|
|
7816
7821
|
}
|
|
7817
7822
|
case "onSessionUpdate": {
|
|
7818
|
-
|
|
7823
|
+
h.queue.enqueue({
|
|
7819
7824
|
listener: t,
|
|
7820
7825
|
data: a
|
|
7821
7826
|
});
|
|
7822
7827
|
break;
|
|
7823
7828
|
}
|
|
7824
7829
|
case "onWidgetLoad": {
|
|
7825
|
-
|
|
7830
|
+
h.queue.enqueue({
|
|
7826
7831
|
listener: t,
|
|
7827
7832
|
data: a
|
|
7828
7833
|
});
|
|
@@ -7856,19 +7861,19 @@ var F;
|
|
|
7856
7861
|
await fetch("./" + (s.fields ?? "fields.json"), {
|
|
7857
7862
|
cache: "no-store"
|
|
7858
7863
|
}).then((m) => m.json()).then(async (m) => {
|
|
7859
|
-
const c = Object.entries(m).filter(([p, { value:
|
|
7860
|
-
(p, [
|
|
7864
|
+
const c = Object.entries(m).filter(([p, { value: l }]) => l != null).reduce(
|
|
7865
|
+
(p, [l, { value: o }]) => (n && n[l] !== void 0 && (o = n[l]), p[l] = o, p),
|
|
7861
7866
|
{
|
|
7862
7867
|
...n
|
|
7863
7868
|
}
|
|
7864
|
-
),
|
|
7869
|
+
), y = await h.generate.event.onWidgetLoad(
|
|
7865
7870
|
c,
|
|
7866
|
-
await
|
|
7871
|
+
await h.generate.session.get(i)
|
|
7867
7872
|
);
|
|
7868
|
-
window.dispatchEvent(new CustomEvent("onWidgetLoad", { detail:
|
|
7873
|
+
window.dispatchEvent(new CustomEvent("onWidgetLoad", { detail: y }));
|
|
7869
7874
|
});
|
|
7870
7875
|
}
|
|
7871
|
-
|
|
7876
|
+
h.start = e;
|
|
7872
7877
|
})(F || (F = {}));
|
|
7873
7878
|
const ct = {
|
|
7874
7879
|
getOverlayStatus: () => ({
|
|
@@ -7878,43 +7883,43 @@ const ct = {
|
|
|
7878
7883
|
resumeQueue: () => {
|
|
7879
7884
|
},
|
|
7880
7885
|
responses: {},
|
|
7881
|
-
sendMessage(
|
|
7886
|
+
sendMessage(h, e) {
|
|
7882
7887
|
},
|
|
7883
7888
|
counters: {
|
|
7884
|
-
get(
|
|
7889
|
+
get(h) {
|
|
7885
7890
|
return null;
|
|
7886
7891
|
}
|
|
7887
7892
|
},
|
|
7888
|
-
sanitize(
|
|
7889
|
-
return
|
|
7893
|
+
sanitize(h) {
|
|
7894
|
+
return h;
|
|
7890
7895
|
},
|
|
7891
|
-
cheerFilter(
|
|
7892
|
-
return
|
|
7896
|
+
cheerFilter(h) {
|
|
7897
|
+
return h;
|
|
7893
7898
|
},
|
|
7894
|
-
setField(
|
|
7899
|
+
setField(h, e, t) {
|
|
7895
7900
|
},
|
|
7896
7901
|
store: {
|
|
7897
|
-
set: function(
|
|
7898
|
-
this.list[
|
|
7902
|
+
set: function(h, e) {
|
|
7903
|
+
this.list[h] = e, localStorage.setItem("SE_API-STORE", JSON.stringify(ct.store.list));
|
|
7899
7904
|
},
|
|
7900
|
-
get: async function(
|
|
7901
|
-
return this.list[
|
|
7905
|
+
get: async function(h) {
|
|
7906
|
+
return this.list[h] ? this.list[h] : null;
|
|
7902
7907
|
},
|
|
7903
7908
|
list: {}
|
|
7904
7909
|
}
|
|
7905
7910
|
};
|
|
7906
7911
|
async function Pt() {
|
|
7907
|
-
let
|
|
7912
|
+
let h = localStorage.getItem("SE_API-STORE") ?? "", e = h ? JSON.parse(h) : {};
|
|
7908
7913
|
return ct.store.list = e, ct;
|
|
7909
7914
|
}
|
|
7910
7915
|
var dt;
|
|
7911
|
-
((
|
|
7916
|
+
((h) => {
|
|
7912
7917
|
let e;
|
|
7913
7918
|
((i) => {
|
|
7914
7919
|
((s) => {
|
|
7915
7920
|
s.hehim = "He/Him", s.sheher = "She/Her", s.theythem = "They/Them", s.shethem = "She/They", s.hethem = "He/They", s.heshe = "He/She", s.xexem = "Xe/Xem", s.faefaer = "Fae/Faer", s.vever = "Ve/Ver", s.aeaer = "Ae/Aer", s.ziehir = "Zie/Hir", s.perper = "Per/Per", s.eem = "E/Em", s.itits = "It/Its";
|
|
7916
7921
|
})(i.map || (i.map = {}));
|
|
7917
|
-
})(e =
|
|
7922
|
+
})(e = h.Pronouns || (h.Pronouns = {}));
|
|
7918
7923
|
async function t() {
|
|
7919
7924
|
try {
|
|
7920
7925
|
const i = await fetch("https://pronouns.alejo.io/api/pronouns").then(
|
|
@@ -7930,7 +7935,7 @@ var dt;
|
|
|
7930
7935
|
}
|
|
7931
7936
|
return { ...e.map };
|
|
7932
7937
|
}
|
|
7933
|
-
|
|
7938
|
+
h.list = t;
|
|
7934
7939
|
async function a(i) {
|
|
7935
7940
|
if (!i) throw new Error("Username is required to fetch Alejo data.");
|
|
7936
7941
|
if (i = i.toLowerCase(), !window?.client) {
|
|
@@ -7961,7 +7966,7 @@ var dt;
|
|
|
7961
7966
|
);
|
|
7962
7967
|
}
|
|
7963
7968
|
}
|
|
7964
|
-
|
|
7969
|
+
h.get = a;
|
|
7965
7970
|
})(dt || (dt = {}));
|
|
7966
7971
|
class Mt extends tt {
|
|
7967
7972
|
/**
|
|
@@ -8008,7 +8013,7 @@ class Mt extends tt {
|
|
|
8008
8013
|
}, m = {
|
|
8009
8014
|
name: e,
|
|
8010
8015
|
message: `!${t} ${a}`,
|
|
8011
|
-
badges: Object.entries(n).map(([c,
|
|
8016
|
+
badges: Object.entries(n).map(([c, y]) => y ? c : null).filter(Boolean),
|
|
8012
8017
|
color: s.userColor,
|
|
8013
8018
|
time: new Date(s.timestamp).getTime(),
|
|
8014
8019
|
userId: s.userId,
|
|
@@ -8245,9 +8250,9 @@ class bt {
|
|
|
8245
8250
|
const ht = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(Pt()), R = new bt(), gt = {
|
|
8246
8251
|
SeAPI: ht,
|
|
8247
8252
|
Client: B,
|
|
8248
|
-
Helper:
|
|
8253
|
+
Helper: w,
|
|
8249
8254
|
Local: F,
|
|
8250
|
-
Data:
|
|
8255
|
+
Data: P,
|
|
8251
8256
|
logger: R,
|
|
8252
8257
|
modules: {
|
|
8253
8258
|
EventProvider: tt,
|