@tixyel/streamelements 3.7.0 → 3.8.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 +7 -1
- package/dist/index.es.js +833 -829
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Q = [
|
|
2
2
|
"https://static-cdn.jtvnw.net/user-default-pictures-uv/13e5fa74-defa-11e9-809c-784f43822e80-profile_image-300x300.png",
|
|
3
3
|
"https://static-cdn.jtvnw.net/user-default-pictures-uv/dbdc9198-def8-11e9-8681-784f43822e80-profile_image-300x300.png",
|
|
4
4
|
"https://static-cdn.jtvnw.net/user-default-pictures-uv/998f01ae-def8-11e9-b95c-784f43822e80-profile_image-300x300.png",
|
|
@@ -6,7 +6,7 @@ const X = [
|
|
|
6
6
|
"https://static-cdn.jtvnw.net/user-default-pictures-uv/ebe4cd89-b4f4-4cd9-adac-2f30151b4209-profile_image-300x300.png",
|
|
7
7
|
"https://static-cdn.jtvnw.net/user-default-pictures-uv/215b7342-def9-11e9-9a66-784f43822e80-profile_image-300x300.png",
|
|
8
8
|
"https://static-cdn.jtvnw.net/user-default-pictures-uv/ead5c8b2-a4c9-4724-b1dd-9f00b46cbd3d-profile_image-300x300.png"
|
|
9
|
-
],
|
|
9
|
+
], Z = {
|
|
10
10
|
"100 bits": {
|
|
11
11
|
type: "100 bits",
|
|
12
12
|
version: "1",
|
|
@@ -97,7 +97,7 @@ const X = [
|
|
|
97
97
|
url: "https://static-cdn.jtvnw.net/badges/v1/b817aba4-fad8-49e2-b88a-7cc744dfa6ec/3",
|
|
98
98
|
description: "VIP"
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, $ = Object.values([
|
|
101
101
|
{
|
|
102
102
|
type: "twitch",
|
|
103
103
|
name: "TheIlluminati",
|
|
@@ -1448,13 +1448,13 @@ const X = [
|
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
1450
|
]).reduce(
|
|
1451
|
-
(
|
|
1452
|
-
...
|
|
1451
|
+
(e, s) => (e.some((i) => i.name === s.name) || e.push({
|
|
1452
|
+
...s,
|
|
1453
1453
|
start: 0,
|
|
1454
1454
|
end: 0
|
|
1455
|
-
}),
|
|
1455
|
+
}), e),
|
|
1456
1456
|
[]
|
|
1457
|
-
),
|
|
1457
|
+
), tt = [
|
|
1458
1458
|
"Hello everyone!",
|
|
1459
1459
|
"PogChamp",
|
|
1460
1460
|
"This stream is amazing!",
|
|
@@ -1505,7 +1505,7 @@ const X = [
|
|
|
1505
1505
|
"BloodTrail hunting time",
|
|
1506
1506
|
"CatBag kitty!",
|
|
1507
1507
|
"c! poggers"
|
|
1508
|
-
],
|
|
1508
|
+
], et = ["Local", "Tixyel", "Urie_s2", "itzzcatt", "BeniArts", "Cupidiko", "shy_madeit"], st = [
|
|
1509
1509
|
"Filiz",
|
|
1510
1510
|
"Astrid",
|
|
1511
1511
|
"Tatyana",
|
|
@@ -1593,7 +1593,7 @@ const X = [
|
|
|
1593
1593
|
"Szabolcs",
|
|
1594
1594
|
"Hoda",
|
|
1595
1595
|
"Naayf"
|
|
1596
|
-
],
|
|
1596
|
+
], at = [], it = ["1000", "2000", "3000", "prime"], nt = [
|
|
1597
1597
|
"aliceblue",
|
|
1598
1598
|
"antiquewhite",
|
|
1599
1599
|
"aqua",
|
|
@@ -1743,7 +1743,7 @@ const X = [
|
|
|
1743
1743
|
"yellow",
|
|
1744
1744
|
"yellowgreen",
|
|
1745
1745
|
"transparent"
|
|
1746
|
-
],
|
|
1746
|
+
], rt = [
|
|
1747
1747
|
{
|
|
1748
1748
|
emojiId: "UCkszU2WH9gy1mb0dV-11UJg/flower-rainbow-heart-red",
|
|
1749
1749
|
shortcuts: [":pride-flower-rainbow-heart:"],
|
|
@@ -4917,164 +4917,164 @@ const X = [
|
|
|
4917
4917
|
index: 121
|
|
4918
4918
|
}
|
|
4919
4919
|
];
|
|
4920
|
-
var
|
|
4921
|
-
((
|
|
4922
|
-
let
|
|
4923
|
-
((
|
|
4924
|
-
((
|
|
4925
|
-
|
|
4926
|
-
})(
|
|
4927
|
-
})(
|
|
4928
|
-
async function
|
|
4920
|
+
var O;
|
|
4921
|
+
((e) => {
|
|
4922
|
+
let s;
|
|
4923
|
+
((o) => {
|
|
4924
|
+
((t) => {
|
|
4925
|
+
t.hehim = "He/Him", t.sheher = "She/Her", t.theythem = "They/Them", t.shethem = "She/They", t.hethem = "He/They", t.heshe = "He/She", t.xexem = "Xe/Xem", t.faefaer = "Fae/Faer", t.vever = "Ve/Ver", t.aeaer = "Ae/Aer", t.ziehir = "Zie/Hir", t.perper = "Per/Per", t.eem = "E/Em", t.itits = "It/Its";
|
|
4926
|
+
})(o.map || (o.map = {}));
|
|
4927
|
+
})(s = e.Pronouns || (e.Pronouns = {}));
|
|
4928
|
+
async function i() {
|
|
4929
4929
|
try {
|
|
4930
|
-
const
|
|
4931
|
-
if (Array.isArray(
|
|
4932
|
-
const
|
|
4933
|
-
return { ...
|
|
4930
|
+
const o = await fetch("https://pronouns.alejo.io/api/pronouns").then((t) => t.json());
|
|
4931
|
+
if (Array.isArray(o) && o.length) {
|
|
4932
|
+
const t = Object.fromEntries(o.map(({ name: a, display: n }) => [a, n]));
|
|
4933
|
+
return { ...s.map, ...t };
|
|
4934
4934
|
}
|
|
4935
4935
|
} catch {
|
|
4936
4936
|
}
|
|
4937
|
-
return { ...
|
|
4937
|
+
return { ...s.map };
|
|
4938
4938
|
}
|
|
4939
|
-
|
|
4940
|
-
async function o
|
|
4941
|
-
if (!
|
|
4942
|
-
if (
|
|
4943
|
-
return client.storage.data.pronoun[
|
|
4939
|
+
e.list = i;
|
|
4940
|
+
async function d(o) {
|
|
4941
|
+
if (!o) throw new Error("Username is required to fetch Alejo data.");
|
|
4942
|
+
if (o = o.toLowerCase(), o in client.storage.data.pronoun && client.storage.data.pronoun[o].expire > Date.now())
|
|
4943
|
+
return client.storage.data.pronoun[o].value;
|
|
4944
4944
|
try {
|
|
4945
|
-
const
|
|
4946
|
-
if (
|
|
4947
|
-
return client.storage.add(`pronoun.${
|
|
4948
|
-
value:
|
|
4945
|
+
const t = await fetch(`https://pronouns.alejo.io/api/users/${o}`).then((a) => a.json()).then(([a]) => a);
|
|
4946
|
+
if (t)
|
|
4947
|
+
return client.storage.add(`pronoun.${o}`, {
|
|
4948
|
+
value: t.pronoun_id,
|
|
4949
4949
|
timestamp: Date.now(),
|
|
4950
4950
|
expire: Date.now() + client.cache.pronoun * 60 * 1e3
|
|
4951
|
-
}), client.storage.data.pronoun[
|
|
4952
|
-
} catch (
|
|
4953
|
-
throw new Error(`Failed to fetch pronoun data for user "${
|
|
4951
|
+
}), client.storage.data.pronoun[o].value ?? t.pronoun_id;
|
|
4952
|
+
} catch (t) {
|
|
4953
|
+
throw new Error(`Failed to fetch pronoun data for user "${o}": ${t instanceof Error ? t.message : t}`);
|
|
4954
4954
|
}
|
|
4955
4955
|
}
|
|
4956
|
-
|
|
4957
|
-
})(
|
|
4958
|
-
function
|
|
4959
|
-
if (!
|
|
4960
|
-
switch (
|
|
4956
|
+
e.get = d;
|
|
4957
|
+
})(O || (O = {}));
|
|
4958
|
+
function ct(e, s) {
|
|
4959
|
+
if (!s) return null;
|
|
4960
|
+
switch (s) {
|
|
4961
4961
|
case "hex": {
|
|
4962
|
-
const
|
|
4963
|
-
let
|
|
4964
|
-
return
|
|
4962
|
+
const i = e.replace("#", "");
|
|
4963
|
+
let d = 0, o = 0, t = 0, a = 1;
|
|
4964
|
+
return i.length === 3 ? (d = parseInt(i[0] + i[0], 16), o = parseInt(i[1] + i[1], 16), t = parseInt(i[2] + i[2], 16)) : i.length === 6 ? (d = parseInt(i.slice(0, 2), 16), o = parseInt(i.slice(2, 4), 16), t = parseInt(i.slice(4, 6), 16)) : i.length === 4 ? (d = parseInt(i[0] + i[0], 16), o = parseInt(i[1] + i[1], 16), t = parseInt(i[2] + i[2], 16), a = parseInt(i[3] + i[3], 16) / 255) : i.length === 8 && (d = parseInt(i.slice(0, 2), 16), o = parseInt(i.slice(2, 4), 16), t = parseInt(i.slice(4, 6), 16), a = parseInt(i.slice(6, 8), 16) / 255), { r: d, g: o, b: t, a };
|
|
4965
4965
|
}
|
|
4966
4966
|
case "rgb":
|
|
4967
4967
|
case "rgba": {
|
|
4968
|
-
const
|
|
4969
|
-
return
|
|
4970
|
-
r: parseInt(
|
|
4971
|
-
g: parseInt(
|
|
4972
|
-
b: parseInt(
|
|
4973
|
-
a:
|
|
4968
|
+
const i = e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);
|
|
4969
|
+
return i ? {
|
|
4970
|
+
r: parseInt(i[1]),
|
|
4971
|
+
g: parseInt(i[2]),
|
|
4972
|
+
b: parseInt(i[3]),
|
|
4973
|
+
a: i[4] ? parseFloat(i[4]) : 1
|
|
4974
4974
|
} : null;
|
|
4975
4975
|
}
|
|
4976
4976
|
case "hsl":
|
|
4977
4977
|
case "hsla": {
|
|
4978
|
-
const
|
|
4979
|
-
if (!
|
|
4980
|
-
const
|
|
4981
|
-
return { ...
|
|
4978
|
+
const i = e.match(/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*([\d.]+))?\s*\)/);
|
|
4979
|
+
if (!i) return null;
|
|
4980
|
+
const d = parseInt(i[1]), o = parseInt(i[2]), t = parseInt(i[3]), a = i[4] ? parseFloat(i[4]) : 1;
|
|
4981
|
+
return { ...dt(d, o, t), a };
|
|
4982
4982
|
}
|
|
4983
4983
|
case "css-color-name": {
|
|
4984
|
-
const
|
|
4985
|
-
|
|
4986
|
-
const
|
|
4987
|
-
if (!
|
|
4988
|
-
|
|
4989
|
-
const [
|
|
4990
|
-
return { r:
|
|
4984
|
+
const i = document.createElement("canvas");
|
|
4985
|
+
i.width = i.height = 1;
|
|
4986
|
+
const d = i.getContext("2d");
|
|
4987
|
+
if (!d) return null;
|
|
4988
|
+
d.fillStyle = e, d.fillRect(0, 0, 1, 1);
|
|
4989
|
+
const [o, t, a] = d.getImageData(0, 0, 1, 1).data;
|
|
4990
|
+
return { r: o, g: t, b: a, a: 1 };
|
|
4991
4991
|
}
|
|
4992
4992
|
default:
|
|
4993
4993
|
return null;
|
|
4994
4994
|
}
|
|
4995
4995
|
}
|
|
4996
|
-
function
|
|
4997
|
-
const
|
|
4998
|
-
let
|
|
4999
|
-
return
|
|
4996
|
+
function ot(e, s = !0) {
|
|
4997
|
+
const i = (o) => Math.round(o).toString(16).padStart(2, "0");
|
|
4998
|
+
let d = `#${i(e.r)}${i(e.g)}${i(e.b)}`;
|
|
4999
|
+
return s && e.a < 1 && (d += i(e.a * 255)), d;
|
|
5000
5000
|
}
|
|
5001
|
-
function
|
|
5002
|
-
|
|
5003
|
-
const
|
|
5004
|
-
let
|
|
5005
|
-
const
|
|
5006
|
-
if (
|
|
5007
|
-
switch (
|
|
5008
|
-
case
|
|
5009
|
-
|
|
5001
|
+
function B(e, s, i) {
|
|
5002
|
+
e /= 255, s /= 255, i /= 255;
|
|
5003
|
+
const d = Math.max(e, s, i), o = Math.min(e, s, i), t = d - o;
|
|
5004
|
+
let a = 0, n = 0;
|
|
5005
|
+
const r = (d + o) / 2;
|
|
5006
|
+
if (t !== 0)
|
|
5007
|
+
switch (n = r > 0.5 ? t / (2 - d - o) : t / (d + o), d) {
|
|
5008
|
+
case e:
|
|
5009
|
+
a = ((s - i) / t + (s < i ? 6 : 0)) / 6;
|
|
5010
5010
|
break;
|
|
5011
|
-
case
|
|
5012
|
-
|
|
5011
|
+
case s:
|
|
5012
|
+
a = ((i - e) / t + 2) / 6;
|
|
5013
5013
|
break;
|
|
5014
|
-
case
|
|
5015
|
-
|
|
5014
|
+
case i:
|
|
5015
|
+
a = ((e - s) / t + 4) / 6;
|
|
5016
5016
|
break;
|
|
5017
5017
|
}
|
|
5018
5018
|
return {
|
|
5019
|
-
h: Math.round(
|
|
5020
|
-
s: Math.round(
|
|
5021
|
-
l: Math.round(
|
|
5019
|
+
h: Math.round(a * 360),
|
|
5020
|
+
s: Math.round(n * 100),
|
|
5021
|
+
l: Math.round(r * 100)
|
|
5022
5022
|
};
|
|
5023
5023
|
}
|
|
5024
|
-
function
|
|
5025
|
-
|
|
5026
|
-
let o, t
|
|
5027
|
-
if (
|
|
5028
|
-
|
|
5024
|
+
function dt(e, s, i) {
|
|
5025
|
+
e /= 360, s /= 100, i /= 100;
|
|
5026
|
+
let d, o, t;
|
|
5027
|
+
if (s === 0)
|
|
5028
|
+
d = o = t = i;
|
|
5029
5029
|
else {
|
|
5030
|
-
const
|
|
5031
|
-
|
|
5030
|
+
const a = (h, u, l) => (l < 0 && (l += 1), l > 1 && (l -= 1), l < 0.16666666666666666 ? h + (u - h) * 6 * l : l < 0.5 ? u : l < 0.6666666666666666 ? h + (u - h) * (0.6666666666666666 - l) * 6 : h), n = i < 0.5 ? i * (1 + s) : i + s - i * s, r = 2 * i - n;
|
|
5031
|
+
d = a(r, n, e + 1 / 3), o = a(r, n, e), t = a(r, n, e - 1 / 3);
|
|
5032
5032
|
}
|
|
5033
5033
|
return {
|
|
5034
|
-
r: Math.round(
|
|
5035
|
-
g: Math.round(
|
|
5036
|
-
b: Math.round(
|
|
5034
|
+
r: Math.round(d * 255),
|
|
5035
|
+
g: Math.round(o * 255),
|
|
5036
|
+
b: Math.round(t * 255)
|
|
5037
5037
|
};
|
|
5038
5038
|
}
|
|
5039
|
-
function
|
|
5040
|
-
const
|
|
5041
|
-
let
|
|
5042
|
-
for (const
|
|
5043
|
-
const
|
|
5044
|
-
|
|
5045
|
-
const
|
|
5046
|
-
if (!
|
|
5047
|
-
|
|
5048
|
-
const [
|
|
5049
|
-
if (g <
|
|
5039
|
+
function ht(e, s, i) {
|
|
5040
|
+
const d = D.data.css_color_names;
|
|
5041
|
+
let o = d[0], t = 1 / 0;
|
|
5042
|
+
for (const a of d) {
|
|
5043
|
+
const n = document.createElement("canvas");
|
|
5044
|
+
n.width = n.height = 1;
|
|
5045
|
+
const r = n.getContext("2d");
|
|
5046
|
+
if (!r) continue;
|
|
5047
|
+
r.fillStyle = a, r.fillRect(0, 0, 1, 1);
|
|
5048
|
+
const [h, u, l] = r.getImageData(0, 0, 1, 1).data, g = Math.sqrt(Math.pow(e - h, 2) + Math.pow(s - u, 2) + Math.pow(i - l, 2));
|
|
5049
|
+
if (g < t && (t = g, o = a), g === 0) break;
|
|
5050
5050
|
}
|
|
5051
|
-
return
|
|
5051
|
+
return o;
|
|
5052
5052
|
}
|
|
5053
|
-
var
|
|
5054
|
-
((
|
|
5055
|
-
|
|
5056
|
-
names:
|
|
5057
|
-
messages:
|
|
5058
|
-
tiers:
|
|
5059
|
-
avatars:
|
|
5060
|
-
emotes:
|
|
5061
|
-
youtube_emotes:
|
|
5062
|
-
badges:
|
|
5063
|
-
items:
|
|
5064
|
-
tts:
|
|
5065
|
-
pronouns:
|
|
5066
|
-
css_color_names:
|
|
5067
|
-
},
|
|
5053
|
+
var D;
|
|
5054
|
+
((e) => {
|
|
5055
|
+
e.data = {
|
|
5056
|
+
names: et,
|
|
5057
|
+
messages: tt,
|
|
5058
|
+
tiers: it,
|
|
5059
|
+
avatars: Q,
|
|
5060
|
+
emotes: $,
|
|
5061
|
+
youtube_emotes: rt,
|
|
5062
|
+
badges: Z,
|
|
5063
|
+
items: at,
|
|
5064
|
+
tts: st,
|
|
5065
|
+
pronouns: O.Pronouns.map,
|
|
5066
|
+
css_color_names: nt
|
|
5067
|
+
}, e.color = {
|
|
5068
5068
|
/**
|
|
5069
5069
|
* Generate opacity hex value
|
|
5070
5070
|
* @param opacity - Opacity value from 0 to 100
|
|
5071
5071
|
* @param color - Hex color code
|
|
5072
5072
|
* @returns - Hex color code with opacity
|
|
5073
5073
|
*/
|
|
5074
|
-
opacity(t = 100,
|
|
5075
|
-
|
|
5076
|
-
let
|
|
5077
|
-
return
|
|
5074
|
+
opacity(t = 100, a = "") {
|
|
5075
|
+
a = a.length > 7 ? a?.substring(0, 6) : a, t = t > 1 ? t / 100 : t;
|
|
5076
|
+
let n = Math.round(Math.min(Math.max(t, 0), 1) * 255).toString(16).toLowerCase().padStart(2, "0");
|
|
5077
|
+
return a + n;
|
|
5078
5078
|
},
|
|
5079
5079
|
/**
|
|
5080
5080
|
* Extract color and opacity from hex code
|
|
@@ -5087,16 +5087,16 @@ var T;
|
|
|
5087
5087
|
color: t,
|
|
5088
5088
|
opacity: 100
|
|
5089
5089
|
};
|
|
5090
|
-
var r = t.slice(-2),
|
|
5090
|
+
var r = t.slice(-2), a = parseInt(r, 16) / 255, n = Math.round(a * 100), r = t.length > 7 ? t.slice(0, 7) : t;
|
|
5091
5091
|
return {
|
|
5092
5092
|
color: r,
|
|
5093
|
-
opacity:
|
|
5093
|
+
opacity: n
|
|
5094
5094
|
};
|
|
5095
5095
|
},
|
|
5096
5096
|
validate(t) {
|
|
5097
5097
|
if (typeof t != "string" || !String(t).trim().length) return !1;
|
|
5098
|
-
const
|
|
5099
|
-
return /^#([A-Fa-f0-9]{3}){1,2}$/.test(
|
|
5098
|
+
const a = t.trim();
|
|
5099
|
+
return /^#([A-Fa-f0-9]{3}){1,2}$/.test(a) || /^#([A-Fa-f0-9]{4}|[A-Fa-f0-9]{8})$/.test(a) ? "hex" : /^rgb\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(a) ? "rgb" : /^rgba\(\s*(?:\d{1,3}\s*,\s*){3}(?:0|1|0?\.\d+)\s*\)$/.test(a) ? "rgba" : /^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(a) ? "hsl" : /^hsla\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*,\s*(?:0|1|0?\.\d+)\s*\)$/.test(a) ? "hsla" : e.data.css_color_names.includes(a.toLowerCase()) ? "css-color-name" : !1;
|
|
5100
5100
|
},
|
|
5101
5101
|
/**
|
|
5102
5102
|
* Convert color to different format
|
|
@@ -5111,37 +5111,37 @@ var T;
|
|
|
5111
5111
|
* const colorName = Simulation.color.convert("#FF5733", "css-color-name"); // "orangered"
|
|
5112
5112
|
* ```
|
|
5113
5113
|
*/
|
|
5114
|
-
convert(t,
|
|
5115
|
-
const
|
|
5116
|
-
if (!
|
|
5114
|
+
convert(t, a) {
|
|
5115
|
+
const n = this.validate(t);
|
|
5116
|
+
if (!n)
|
|
5117
5117
|
throw new Error(`Invalid color format: ${t}`);
|
|
5118
|
-
if (
|
|
5119
|
-
throw new Error(`Color is already in the desired format: ${
|
|
5120
|
-
const r =
|
|
5118
|
+
if (n === a)
|
|
5119
|
+
throw new Error(`Color is already in the desired format: ${a}`);
|
|
5120
|
+
const r = ct(t.trim(), n);
|
|
5121
5121
|
if (!r)
|
|
5122
5122
|
throw new Error(`Failed to parse color: ${t}`);
|
|
5123
|
-
switch (
|
|
5123
|
+
switch (a) {
|
|
5124
5124
|
case "hex":
|
|
5125
|
-
return
|
|
5125
|
+
return ot(r, !1);
|
|
5126
5126
|
case "rgb":
|
|
5127
5127
|
return `rgb(${r.r}, ${r.g}, ${r.b})`;
|
|
5128
5128
|
case "rgba":
|
|
5129
5129
|
return `rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`;
|
|
5130
5130
|
case "hsl": {
|
|
5131
|
-
const
|
|
5132
|
-
return `hsl(${
|
|
5131
|
+
const h = B(r.r, r.g, r.b);
|
|
5132
|
+
return `hsl(${h.h}, ${h.s}%, ${h.l}%)`;
|
|
5133
5133
|
}
|
|
5134
5134
|
case "hsla": {
|
|
5135
|
-
const
|
|
5136
|
-
return `hsla(${
|
|
5135
|
+
const h = B(r.r, r.g, r.b);
|
|
5136
|
+
return `hsla(${h.h}, ${h.s}%, ${h.l}%, ${r.a})`;
|
|
5137
5137
|
}
|
|
5138
5138
|
case "css-color-name":
|
|
5139
|
-
return
|
|
5139
|
+
return ht(r.r, r.g, r.b);
|
|
5140
5140
|
default:
|
|
5141
5141
|
return null;
|
|
5142
5142
|
}
|
|
5143
5143
|
}
|
|
5144
|
-
},
|
|
5144
|
+
}, e.rand = {
|
|
5145
5145
|
/**
|
|
5146
5146
|
* Generate random color
|
|
5147
5147
|
* @param type - Color format
|
|
@@ -5161,28 +5161,28 @@ var T;
|
|
|
5161
5161
|
case "hex":
|
|
5162
5162
|
return `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
|
|
5163
5163
|
case "hexa": {
|
|
5164
|
-
const
|
|
5165
|
-
return
|
|
5164
|
+
const n = `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`, r = Math.floor(Math.random() * 256).toString(16).padStart(2, "0");
|
|
5165
|
+
return n + r;
|
|
5166
5166
|
}
|
|
5167
5167
|
case "rgb": {
|
|
5168
|
-
const
|
|
5169
|
-
return `rgb(${
|
|
5168
|
+
const n = Math.floor(Math.random() * 256), r = Math.floor(Math.random() * 256), h = Math.floor(Math.random() * 256);
|
|
5169
|
+
return `rgb(${n}, ${r}, ${h})`;
|
|
5170
5170
|
}
|
|
5171
5171
|
case "rgba": {
|
|
5172
|
-
const
|
|
5173
|
-
return `rgba(${
|
|
5172
|
+
const n = Math.floor(Math.random() * 256), r = Math.floor(Math.random() * 256), h = Math.floor(Math.random() * 256), u = Math.random().toFixed(2);
|
|
5173
|
+
return `rgba(${n}, ${r}, ${h}, ${u})`;
|
|
5174
5174
|
}
|
|
5175
5175
|
case "hsl": {
|
|
5176
|
-
const
|
|
5177
|
-
return `hsl(${
|
|
5176
|
+
const n = Math.floor(Math.random() * 361), r = Math.floor(Math.random() * 101), h = Math.floor(Math.random() * 101);
|
|
5177
|
+
return `hsl(${n}, ${r}%, ${h}%)`;
|
|
5178
5178
|
}
|
|
5179
5179
|
case "hsla": {
|
|
5180
|
-
const
|
|
5181
|
-
return `hsla(${
|
|
5180
|
+
const n = Math.floor(Math.random() * 361), r = Math.floor(Math.random() * 101), h = Math.floor(Math.random() * 101), u = Math.random().toFixed(2);
|
|
5181
|
+
return `hsla(${n}, ${r}%, ${h}%, ${u})`;
|
|
5182
5182
|
}
|
|
5183
5183
|
case "css-color-name": {
|
|
5184
|
-
var
|
|
5185
|
-
return this.array(
|
|
5184
|
+
var a = e.data.css_color_names;
|
|
5185
|
+
return this.array(a)[0];
|
|
5186
5186
|
}
|
|
5187
5187
|
}
|
|
5188
5188
|
},
|
|
@@ -5201,10 +5201,10 @@ var T;
|
|
|
5201
5201
|
* console.log(floatNumber); // e.g. 3.14
|
|
5202
5202
|
* ```
|
|
5203
5203
|
*/
|
|
5204
|
-
number(t,
|
|
5205
|
-
t >
|
|
5206
|
-
const r = Math.random() * (
|
|
5207
|
-
return
|
|
5204
|
+
number(t, a, n = 0) {
|
|
5205
|
+
t > a && ([t, a] = [a, t]);
|
|
5206
|
+
const r = Math.random() * (a - t) + t;
|
|
5207
|
+
return n ? Number(r.toFixed(n)) : Math.round(r);
|
|
5208
5208
|
},
|
|
5209
5209
|
/**
|
|
5210
5210
|
* Generate random boolean
|
|
@@ -5230,11 +5230,11 @@ var T;
|
|
|
5230
5230
|
* console.log(randString); // e.g. "aZ3bT9xYqP"
|
|
5231
5231
|
* ```
|
|
5232
5232
|
*/
|
|
5233
|
-
string(t,
|
|
5234
|
-
let
|
|
5233
|
+
string(t, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
|
|
5234
|
+
let n = "";
|
|
5235
5235
|
for (let r = 0; r < t; r++)
|
|
5236
|
-
|
|
5237
|
-
return
|
|
5236
|
+
n += a.charAt(Math.floor(Math.random() * a.length));
|
|
5237
|
+
return n;
|
|
5238
5238
|
},
|
|
5239
5239
|
/**
|
|
5240
5240
|
* Pick random element from array
|
|
@@ -5247,8 +5247,8 @@ var T;
|
|
|
5247
5247
|
* ```
|
|
5248
5248
|
*/
|
|
5249
5249
|
array(t) {
|
|
5250
|
-
const
|
|
5251
|
-
return [t[
|
|
5250
|
+
const a = this.number(0, t.length - 1);
|
|
5251
|
+
return [t[a], a];
|
|
5252
5252
|
},
|
|
5253
5253
|
/**
|
|
5254
5254
|
* Generate random date
|
|
@@ -5261,8 +5261,8 @@ var T;
|
|
|
5261
5261
|
* console.log(randDate); // e.g. 2022-05-15T10:30:00.000Z
|
|
5262
5262
|
* ```
|
|
5263
5263
|
*/
|
|
5264
|
-
date(t = new Date(2e3, 0, 1),
|
|
5265
|
-
return new Date(this.number(t.getTime(),
|
|
5264
|
+
date(t = new Date(2e3, 0, 1), a = /* @__PURE__ */ new Date()) {
|
|
5265
|
+
return new Date(this.number(t.getTime(), a.getTime()));
|
|
5266
5266
|
},
|
|
5267
5267
|
/**
|
|
5268
5268
|
* Generate ISO date string offset by days
|
|
@@ -5278,8 +5278,8 @@ var T;
|
|
|
5278
5278
|
* ```
|
|
5279
5279
|
*/
|
|
5280
5280
|
daysOffset(t) {
|
|
5281
|
-
const
|
|
5282
|
-
return new Date(
|
|
5281
|
+
const n = Date.now() - this.number(0, t * 24 * 60 * 60 * 1e3);
|
|
5282
|
+
return new Date(n).toISOString();
|
|
5283
5283
|
},
|
|
5284
5284
|
/**
|
|
5285
5285
|
* Generate UUID v4
|
|
@@ -5296,7 +5296,7 @@ var T;
|
|
|
5296
5296
|
(t) => (+t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +t / 4).toString(16)
|
|
5297
5297
|
);
|
|
5298
5298
|
}
|
|
5299
|
-
},
|
|
5299
|
+
}, e.string = {
|
|
5300
5300
|
/**
|
|
5301
5301
|
* Replaces occurrences in a string based on a pattern with the result of an asynchronous callback function.
|
|
5302
5302
|
* @param string - The input string to perform replacements on.
|
|
@@ -5311,14 +5311,14 @@ var T;
|
|
|
5311
5311
|
* console.log(result); // Output will depend on the fetched data
|
|
5312
5312
|
* ```
|
|
5313
5313
|
*/
|
|
5314
|
-
async replace(t,
|
|
5314
|
+
async replace(t, a, n) {
|
|
5315
5315
|
const r = [];
|
|
5316
|
-
t.replace(
|
|
5317
|
-
const
|
|
5318
|
-
return r.push(Promise.resolve(
|
|
5316
|
+
t.replace(a, (u, ...l) => {
|
|
5317
|
+
const g = typeof n == "function" ? n(u, ...l) : u;
|
|
5318
|
+
return r.push(Promise.resolve(g)), u;
|
|
5319
5319
|
});
|
|
5320
|
-
const
|
|
5321
|
-
return t.replace(
|
|
5320
|
+
const h = await Promise.all(r);
|
|
5321
|
+
return t.replace(a, () => h.shift() ?? "");
|
|
5322
5322
|
},
|
|
5323
5323
|
/**
|
|
5324
5324
|
* Capitalizes the first letter of a given string.
|
|
@@ -5347,31 +5347,31 @@ var T;
|
|
|
5347
5347
|
* console.log(result); // Output: "Hello, john_doe! You have 5 MESSAGES and your name is John."
|
|
5348
5348
|
* ```
|
|
5349
5349
|
*/
|
|
5350
|
-
compose(t,
|
|
5350
|
+
compose(t, a = {}, n = {
|
|
5351
5351
|
method: "index",
|
|
5352
5352
|
html: !1,
|
|
5353
5353
|
modifiers: {},
|
|
5354
5354
|
aliases: {}
|
|
5355
5355
|
}) {
|
|
5356
|
-
const { mergeSpanStyles: r } =
|
|
5357
|
-
|
|
5358
|
-
const
|
|
5359
|
-
(c, [
|
|
5360
|
-
if (c[
|
|
5361
|
-
const
|
|
5362
|
-
c.username = c.username ||
|
|
5356
|
+
const { mergeSpanStyles: r } = e.element;
|
|
5357
|
+
a.skip = "<br/>", a.newline = "<br/>";
|
|
5358
|
+
const h = Object.entries(e.object.flatten(a)).reduce(
|
|
5359
|
+
(c, [m, b]) => {
|
|
5360
|
+
if (c[m] = String(b), ["username", "name", "nick", "nickname", "sender"].some((v) => m === v)) {
|
|
5361
|
+
const v = c?.username || c?.name || c?.nick || c?.nickname || c?.sender;
|
|
5362
|
+
c.username = c.username || v, c.usernameAt = `@${c.username}`, c.name = c.name || v, c.nick = c.nick || v, c.nickname = c.nickname || v, c.sender = c.sender || v, c.senderAt = `@${c.sender}`;
|
|
5363
5363
|
}
|
|
5364
|
-
return ["amount", "count"].some((
|
|
5364
|
+
return ["amount", "count"].some((v) => m === v) && (c.amount = String(c?.amount || c.count || b), c.count = String(c?.count || c?.amount || b)), c.currency = c.currency || window.client?.details.currency.symbol || "$", c.currencyCode = c.currencyCode || window.client?.details.currency.code || "USD", c;
|
|
5365
5365
|
},
|
|
5366
5366
|
{}
|
|
5367
5367
|
), u = {
|
|
5368
5368
|
PLACEHOLDERS: /{([^}]+)}/g,
|
|
5369
5369
|
MODIFIERS: /\[(\w+)(:[^=]+)?=([^\]]+)\]/g
|
|
5370
5370
|
};
|
|
5371
|
-
var
|
|
5372
|
-
const
|
|
5373
|
-
COLOR: (c,
|
|
5374
|
-
WEIGHT: (c,
|
|
5371
|
+
var l = parseFloat(h?.amount ?? h?.count ?? 0);
|
|
5372
|
+
const g = {
|
|
5373
|
+
COLOR: (c, m) => r(m && e.color.validate(m) ? `color: ${m}` : "", c),
|
|
5374
|
+
WEIGHT: (c, m) => r(m && !isNaN(parseInt(m)) ? `font-weight: ${m}` : "", c),
|
|
5375
5375
|
BOLD: (c) => r("font-weight: bold", c),
|
|
5376
5376
|
LIGHT: (c) => r("font-weight: lighter", c),
|
|
5377
5377
|
STRONG: (c) => r("font-weight: bolder", c),
|
|
@@ -5382,23 +5382,23 @@ var T;
|
|
|
5382
5382
|
SUP: (c) => r("vertical-align: super", c),
|
|
5383
5383
|
LARGER: (c) => r("font-size: larger", c),
|
|
5384
5384
|
SMALL: (c) => r("font-size: smaller", c),
|
|
5385
|
-
SHADOW: (c,
|
|
5386
|
-
SIZE: (c,
|
|
5387
|
-
},
|
|
5385
|
+
SHADOW: (c, m) => r(`text-shadow: ${m}`, c),
|
|
5386
|
+
SIZE: (c, m) => r(m ? `font-size: ${m}` : "", c)
|
|
5387
|
+
}, y = {
|
|
5388
5388
|
...{
|
|
5389
|
-
BT1: (c) =>
|
|
5390
|
-
BT0: (c) =>
|
|
5391
|
-
ST1: (c) =>
|
|
5392
|
-
ST0: (c) =>
|
|
5389
|
+
BT1: (c) => l > 1 ? c : "",
|
|
5390
|
+
BT0: (c) => l > 0 ? c : "",
|
|
5391
|
+
ST1: (c) => l < 1 ? c : "",
|
|
5392
|
+
ST0: (c) => l < 0 ? c : "",
|
|
5393
5393
|
UPC: (c) => c.toUpperCase(),
|
|
5394
5394
|
LOW: (c) => c.toLowerCase(),
|
|
5395
5395
|
REV: (c) => c.split("").reverse().join(""),
|
|
5396
5396
|
CAP: (c) => c.charAt(0).toUpperCase() + c.slice(1).toLowerCase(),
|
|
5397
|
-
FALLBACK: (c,
|
|
5397
|
+
FALLBACK: (c, m) => c.length ? c : m ?? c
|
|
5398
5398
|
},
|
|
5399
|
-
...
|
|
5400
|
-
...
|
|
5401
|
-
},
|
|
5399
|
+
...n?.html ? g : {},
|
|
5400
|
+
...n.modifiers ?? {}
|
|
5401
|
+
}, k = {
|
|
5402
5402
|
UPC: ["UPPERCASE", "UPPER", "UPP"],
|
|
5403
5403
|
LOW: ["LOWERCASE", "LOWER", "LWC"],
|
|
5404
5404
|
REV: ["REVERSE", "RVS"],
|
|
@@ -5419,61 +5419,61 @@ var T;
|
|
|
5419
5419
|
SMALL: ["SMALLER", "SM"],
|
|
5420
5420
|
SHADOW: ["SHADOW", "SHD"],
|
|
5421
5421
|
FALLBACK: ["FALLBACK", "FB"],
|
|
5422
|
-
...
|
|
5422
|
+
...n.aliases ?? {}
|
|
5423
5423
|
};
|
|
5424
|
-
function
|
|
5425
|
-
const
|
|
5426
|
-
return
|
|
5424
|
+
function U(c, m, b) {
|
|
5425
|
+
const v = Object.entries(k).find(([j, I]) => I.some((x) => x.toUpperCase() === m.toUpperCase()) ? !0 : j.toUpperCase() === m.toUpperCase()), E = v ? v[0] : m.toUpperCase();
|
|
5426
|
+
return y[E] ? y[E](c, typeof b == "string" ? b.trim() : null, h) : c;
|
|
5427
5427
|
}
|
|
5428
|
-
function
|
|
5429
|
-
let
|
|
5430
|
-
for (; (b = u.MODIFIERS.exec(
|
|
5431
|
-
const [
|
|
5432
|
-
|
|
5428
|
+
function C(c) {
|
|
5429
|
+
let m = c, b;
|
|
5430
|
+
for (; (b = u.MODIFIERS.exec(m)) !== null; ) {
|
|
5431
|
+
const [v, E, j, I] = b, x = U(C(I), E, j);
|
|
5432
|
+
m = m.replace(v, x ?? ""), u.MODIFIERS.lastIndex = 0;
|
|
5433
5433
|
}
|
|
5434
|
-
return
|
|
5434
|
+
return m;
|
|
5435
5435
|
}
|
|
5436
5436
|
function p(c) {
|
|
5437
|
-
let
|
|
5437
|
+
let m = 0;
|
|
5438
5438
|
const b = c.length;
|
|
5439
|
-
function
|
|
5440
|
-
let
|
|
5441
|
-
for (;
|
|
5442
|
-
if (c[
|
|
5443
|
-
|
|
5444
|
-
else if (c[
|
|
5445
|
-
|
|
5446
|
-
else if (
|
|
5447
|
-
|
|
5439
|
+
function v(j) {
|
|
5440
|
+
let I = "";
|
|
5441
|
+
for (; m < b; )
|
|
5442
|
+
if (c[m] === "\\")
|
|
5443
|
+
m + 1 < b ? (I += c[m + 1], m += 2) : m++;
|
|
5444
|
+
else if (c[m] === "[" && (!j || j !== "["))
|
|
5445
|
+
I += E();
|
|
5446
|
+
else if (j && c[m] === j) {
|
|
5447
|
+
m++;
|
|
5448
5448
|
break;
|
|
5449
5449
|
} else
|
|
5450
|
-
|
|
5451
|
-
return
|
|
5452
|
-
}
|
|
5453
|
-
function
|
|
5454
|
-
|
|
5455
|
-
let
|
|
5456
|
-
for (;
|
|
5457
|
-
let
|
|
5458
|
-
if (c[
|
|
5459
|
-
|
|
5460
|
-
const
|
|
5461
|
-
for (;
|
|
5462
|
-
|
|
5450
|
+
I += c[m++];
|
|
5451
|
+
return I;
|
|
5452
|
+
}
|
|
5453
|
+
function E() {
|
|
5454
|
+
m++;
|
|
5455
|
+
let j = "";
|
|
5456
|
+
for (; m < b && /[A-Za-z0-9]/.test(c[m]); ) j += c[m++];
|
|
5457
|
+
let I = null;
|
|
5458
|
+
if (c[m] === ":") {
|
|
5459
|
+
m++;
|
|
5460
|
+
const J = m;
|
|
5461
|
+
for (; m < b && c[m] !== "="; ) m++;
|
|
5462
|
+
I = c.slice(J, m);
|
|
5463
5463
|
}
|
|
5464
|
-
c[
|
|
5465
|
-
const
|
|
5466
|
-
return
|
|
5464
|
+
c[m] === "=" && m++;
|
|
5465
|
+
const x = v("]");
|
|
5466
|
+
return U(x, j, I);
|
|
5467
5467
|
}
|
|
5468
|
-
return
|
|
5468
|
+
return v();
|
|
5469
5469
|
}
|
|
5470
|
-
let
|
|
5470
|
+
let w = t.replace(
|
|
5471
5471
|
u.PLACEHOLDERS,
|
|
5472
|
-
(c,
|
|
5472
|
+
(c, m) => typeof h[m] == "string" || typeof h[m] == "number" ? String(h[m]) : m ?? m
|
|
5473
5473
|
);
|
|
5474
|
-
return
|
|
5474
|
+
return w = n.method === "loop" ? C(w) : p(w), w;
|
|
5475
5475
|
}
|
|
5476
|
-
},
|
|
5476
|
+
}, e.number = {
|
|
5477
5477
|
/**
|
|
5478
5478
|
* Translate number to words
|
|
5479
5479
|
* @param num - Number to translate
|
|
@@ -5485,8 +5485,8 @@ var T;
|
|
|
5485
5485
|
* console.log(cardinal); // "forty-two"
|
|
5486
5486
|
* ```
|
|
5487
5487
|
*/
|
|
5488
|
-
translate(t,
|
|
5489
|
-
const
|
|
5488
|
+
translate(t, a = "cardinal") {
|
|
5489
|
+
const n = {
|
|
5490
5490
|
single: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"],
|
|
5491
5491
|
tens: ["ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"],
|
|
5492
5492
|
decades: ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
|
|
@@ -5494,55 +5494,55 @@ var T;
|
|
|
5494
5494
|
single: ["zeroth", "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth"],
|
|
5495
5495
|
tens: ["tenth", "eleventh", "twelfth", "thirteenth", "fourteenth", "fifteenth", "sixteenth", "seventeenth", "eighteenth", "nineteenth"],
|
|
5496
5496
|
decades: ["twentieth", "thirtieth", "fortieth", "fiftieth", "sixtieth", "seventieth", "eightieth", "ninetieth"]
|
|
5497
|
-
},
|
|
5498
|
-
if (t = Math.abs(Math.floor(t)),
|
|
5497
|
+
}, h = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"], u = ["", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion"], l = u.map((p) => p ? `${p}th` : "");
|
|
5498
|
+
if (t = Math.abs(Math.floor(t)), a === "suffix") {
|
|
5499
5499
|
const p = t % 100;
|
|
5500
5500
|
if (p >= 11 && p <= 13) return `${t}th`;
|
|
5501
|
-
const
|
|
5502
|
-
return `${t}${
|
|
5503
|
-
}
|
|
5504
|
-
function
|
|
5505
|
-
if (p < 10) return
|
|
5506
|
-
if (p < 20) return
|
|
5507
|
-
const c = Math.floor(p / 10),
|
|
5508
|
-
if (
|
|
5509
|
-
const b =
|
|
5510
|
-
return `${b}-${
|
|
5511
|
-
}
|
|
5512
|
-
function
|
|
5513
|
-
if (p === 0) return
|
|
5514
|
-
const c = Math.floor(p / 100),
|
|
5515
|
-
return c > 0 && (
|
|
5516
|
-
}
|
|
5517
|
-
if (t < 1e3) return
|
|
5518
|
-
const
|
|
5519
|
-
let
|
|
5520
|
-
for (;
|
|
5521
|
-
|
|
5522
|
-
let
|
|
5523
|
-
for (let p = 0; p <
|
|
5524
|
-
const
|
|
5525
|
-
for (let p =
|
|
5526
|
-
const
|
|
5527
|
-
if (
|
|
5501
|
+
const w = t % 10;
|
|
5502
|
+
return `${t}${h[w]}`;
|
|
5503
|
+
}
|
|
5504
|
+
function g(p, w) {
|
|
5505
|
+
if (p < 10) return w === "ordinal" ? r.single[p] : n.single[p];
|
|
5506
|
+
if (p < 20) return w === "ordinal" ? r.tens[p - 10] : n.tens[p - 10];
|
|
5507
|
+
const c = Math.floor(p / 10), m = p % 10;
|
|
5508
|
+
if (m === 0) return w === "ordinal" ? r.decades[c - 2] : n.decades[c - 2];
|
|
5509
|
+
const b = n.decades[c - 2], v = w === "ordinal" ? r.single[m] : n.single[m];
|
|
5510
|
+
return `${b}-${v}`;
|
|
5511
|
+
}
|
|
5512
|
+
function f(p, w) {
|
|
5513
|
+
if (p === 0) return w === "ordinal" ? r.single[0] : n.single[0];
|
|
5514
|
+
const c = Math.floor(p / 100), m = p % 100, b = [];
|
|
5515
|
+
return c > 0 && (w === "ordinal" && m === 0 ? b.push(`${n.single[c]} hundredth`) : b.push(`${n.single[c]} hundred`)), m > 0 && b.push(g(m, w)), b.join(" ");
|
|
5516
|
+
}
|
|
5517
|
+
if (t < 1e3) return f(t, a);
|
|
5518
|
+
const y = [];
|
|
5519
|
+
let k = t;
|
|
5520
|
+
for (; k > 0; )
|
|
5521
|
+
y.push(k % 1e3), k = Math.floor(k / 1e3);
|
|
5522
|
+
let U = -1;
|
|
5523
|
+
for (let p = 0; p < y.length; p++) y[p] !== 0 && (U = p);
|
|
5524
|
+
const C = [];
|
|
5525
|
+
for (let p = y.length - 1; p >= 0; p--) {
|
|
5526
|
+
const w = y[p];
|
|
5527
|
+
if (w === 0) continue;
|
|
5528
5528
|
const c = u[p];
|
|
5529
|
-
if (
|
|
5530
|
-
let
|
|
5531
|
-
c && (
|
|
5532
|
-
} else if (p ===
|
|
5529
|
+
if (a === "cardinal") {
|
|
5530
|
+
let m = f(w, "cardinal");
|
|
5531
|
+
c && (m += ` ${c}`), C.push(m);
|
|
5532
|
+
} else if (p === U)
|
|
5533
5533
|
if (p > 0) {
|
|
5534
|
-
const b =
|
|
5535
|
-
|
|
5534
|
+
const b = f(w, "cardinal"), v = l[p];
|
|
5535
|
+
C.push(b ? `${b} ${v}` : v);
|
|
5536
5536
|
} else {
|
|
5537
|
-
const b =
|
|
5538
|
-
|
|
5537
|
+
const b = f(w, "ordinal");
|
|
5538
|
+
C.push(b);
|
|
5539
5539
|
}
|
|
5540
5540
|
else {
|
|
5541
|
-
let b =
|
|
5542
|
-
c && (b += ` ${c}`),
|
|
5541
|
+
let b = f(w, "cardinal");
|
|
5542
|
+
c && (b += ` ${c}`), C.push(b);
|
|
5543
5543
|
}
|
|
5544
5544
|
}
|
|
5545
|
-
return
|
|
5545
|
+
return C.join(", ");
|
|
5546
5546
|
},
|
|
5547
5547
|
/**
|
|
5548
5548
|
* Balances a number within a specified range
|
|
@@ -5556,10 +5556,10 @@ var T;
|
|
|
5556
5556
|
* console.log(balancedValue); // 100
|
|
5557
5557
|
* ```
|
|
5558
5558
|
*/
|
|
5559
|
-
balance(t,
|
|
5560
|
-
return Math.min(Math.max(t,
|
|
5559
|
+
balance(t, a = 0, n = 100) {
|
|
5560
|
+
return Math.min(Math.max(t, a), n);
|
|
5561
5561
|
}
|
|
5562
|
-
},
|
|
5562
|
+
}, e.element = {
|
|
5563
5563
|
/**
|
|
5564
5564
|
* Merges outer span styles with inner span styles in the provided HTML string.
|
|
5565
5565
|
* @param outerStyle - The style string to be applied to the outer span.
|
|
@@ -5571,13 +5571,13 @@ var T;
|
|
|
5571
5571
|
* console.log(result); // Output: '<span style="font-size: 14px; color: red; font-weight: bold;">Hello World</span>'
|
|
5572
5572
|
* ```
|
|
5573
5573
|
*/
|
|
5574
|
-
mergeSpanStyles(t,
|
|
5575
|
-
const
|
|
5576
|
-
if (
|
|
5577
|
-
const r =
|
|
5578
|
-
return `<span style="${[r, t].filter(Boolean).join("; ").replace(/\s*;\s*/g, "; ").trim()}">${
|
|
5574
|
+
mergeSpanStyles(t, a) {
|
|
5575
|
+
const n = a.match(/^<span style="([^"]*)">(.*)<\/span>$/s);
|
|
5576
|
+
if (n) {
|
|
5577
|
+
const r = n[1], h = n[2];
|
|
5578
|
+
return `<span style="${[r, t].filter(Boolean).join("; ").replace(/\s*;\s*/g, "; ").trim()}">${h}</span>`;
|
|
5579
5579
|
} else
|
|
5580
|
-
return `<span style="${t}">${
|
|
5580
|
+
return `<span style="${t}">${a}</span>`;
|
|
5581
5581
|
},
|
|
5582
5582
|
/**
|
|
5583
5583
|
* Scales an HTML element to fit within its parent element based on specified minimum and maximum scale factors.
|
|
@@ -5592,29 +5592,29 @@ var T;
|
|
|
5592
5592
|
* Simulation.element.scale(element, 0.5, 1, { return: false });
|
|
5593
5593
|
* ```
|
|
5594
5594
|
*/
|
|
5595
|
-
scale(t,
|
|
5596
|
-
const { return:
|
|
5597
|
-
if (!
|
|
5598
|
-
|
|
5595
|
+
scale(t, a = 0, n = 1, r) {
|
|
5596
|
+
const { return: h = !1, parent: u, base: l } = r || {}, g = u || t.parentElement || document.body;
|
|
5597
|
+
if (!g) {
|
|
5598
|
+
z.warn("No parent element found for scaling");
|
|
5599
5599
|
return;
|
|
5600
5600
|
}
|
|
5601
|
-
const
|
|
5602
|
-
if (
|
|
5603
|
-
|
|
5601
|
+
const f = g.getBoundingClientRect(), y = t.offsetWidth, k = t.offsetHeight;
|
|
5602
|
+
if (y === 0 || k === 0) {
|
|
5603
|
+
z.warn("Element has zero width or height, cannot scale");
|
|
5604
5604
|
return;
|
|
5605
5605
|
}
|
|
5606
|
-
const
|
|
5607
|
-
let p =
|
|
5608
|
-
if (
|
|
5609
|
-
const c =
|
|
5606
|
+
const U = f.width * n / y, C = f.height * n / k;
|
|
5607
|
+
let p = l === "width" ? U : l === "height" ? C : Math.min(U, C);
|
|
5608
|
+
if (a > 0) {
|
|
5609
|
+
const c = f.width * a / y, m = f.height * a / k, b = Math.max(c, m);
|
|
5610
5610
|
p = Math.max(b, p);
|
|
5611
5611
|
}
|
|
5612
|
-
const
|
|
5613
|
-
width:
|
|
5614
|
-
height:
|
|
5612
|
+
const w = {
|
|
5613
|
+
width: y * p,
|
|
5614
|
+
height: k * p,
|
|
5615
5615
|
scale: p
|
|
5616
5616
|
};
|
|
5617
|
-
return
|
|
5617
|
+
return h || (t.style.transform = `scale(${p})`, t.style.transformOrigin = "center center"), w;
|
|
5618
5618
|
},
|
|
5619
5619
|
/**
|
|
5620
5620
|
* Splits the text content of an HTML string into individual characters wrapped in span elements with a data-index attribute.
|
|
@@ -5628,34 +5628,34 @@ var T;
|
|
|
5628
5628
|
* // Output: '<p><span class="char" data-index="0">H</span><span class="char" data-index="1">e</span><span class="char" data-index="2">l</span><span class="char" data-index="3">l</span><span class="char" data-index="4">o</span></p>'
|
|
5629
5629
|
* ```
|
|
5630
5630
|
*/
|
|
5631
|
-
splitTextToChars(t,
|
|
5631
|
+
splitTextToChars(t, a = 0) {
|
|
5632
5632
|
const r = new DOMParser().parseFromString(t, "text/html");
|
|
5633
|
-
let
|
|
5634
|
-
function u(
|
|
5635
|
-
if (
|
|
5636
|
-
const
|
|
5633
|
+
let h = a;
|
|
5634
|
+
function u(f) {
|
|
5635
|
+
if (f.nodeType === Node.TEXT_NODE) {
|
|
5636
|
+
const k = f.textContent?.split("").map((C) => {
|
|
5637
5637
|
const p = document.createElement("span");
|
|
5638
|
-
return p.className = "char", p.dataset.index = String(
|
|
5639
|
-
}),
|
|
5640
|
-
return
|
|
5641
|
-
} else if (
|
|
5642
|
-
const
|
|
5643
|
-
return
|
|
5644
|
-
const
|
|
5645
|
-
|
|
5646
|
-
|
|
5638
|
+
return p.className = "char", p.dataset.index = String(h++), p.textContent = C, h++, p.outerHTML;
|
|
5639
|
+
}), U = document.createElement("span");
|
|
5640
|
+
return U.innerHTML = k?.join("") ?? "", U;
|
|
5641
|
+
} else if (f.nodeType === Node.ELEMENT_NODE) {
|
|
5642
|
+
const y = f.cloneNode(!1);
|
|
5643
|
+
return f.childNodes.forEach((k) => {
|
|
5644
|
+
const U = u(k);
|
|
5645
|
+
U instanceof Node && Array.from(U.childNodes).forEach((C) => {
|
|
5646
|
+
y.appendChild(C);
|
|
5647
5647
|
});
|
|
5648
|
-
}),
|
|
5648
|
+
}), y;
|
|
5649
5649
|
}
|
|
5650
|
-
return
|
|
5650
|
+
return f.cloneNode(!0);
|
|
5651
5651
|
}
|
|
5652
|
-
const
|
|
5653
|
-
return
|
|
5654
|
-
const
|
|
5655
|
-
|
|
5656
|
-
}),
|
|
5652
|
+
const l = r.body, g = document.createElement("div");
|
|
5653
|
+
return l.childNodes.forEach((f) => {
|
|
5654
|
+
const y = u(f);
|
|
5655
|
+
y instanceof Node && g.appendChild(y);
|
|
5656
|
+
}), g.innerHTML;
|
|
5657
5657
|
}
|
|
5658
|
-
},
|
|
5658
|
+
}, e.object = {
|
|
5659
5659
|
/**
|
|
5660
5660
|
* Flattens a nested object into a single-level object with dot-separated keys.
|
|
5661
5661
|
* @param obj - The nested object to be flattened.
|
|
@@ -5669,48 +5669,48 @@ var T;
|
|
|
5669
5669
|
* // Output: { 'a.b': '1', 'a.c.d': '2', 'e:0': '3', 'e:1': '4' }
|
|
5670
5670
|
* ```
|
|
5671
5671
|
*/
|
|
5672
|
-
flatten(t,
|
|
5673
|
-
const
|
|
5672
|
+
flatten(t, a = "") {
|
|
5673
|
+
const n = {};
|
|
5674
5674
|
for (const r in t) {
|
|
5675
5675
|
if (!Object.prototype.hasOwnProperty.call(t, r)) continue;
|
|
5676
|
-
const
|
|
5677
|
-
if (
|
|
5678
|
-
|
|
5676
|
+
const h = t[r], u = a ? `${a}.${r}` : r;
|
|
5677
|
+
if (h == null) {
|
|
5678
|
+
n[u] = String(h);
|
|
5679
5679
|
continue;
|
|
5680
5680
|
}
|
|
5681
|
-
if (
|
|
5682
|
-
|
|
5681
|
+
if (h instanceof Date) {
|
|
5682
|
+
n[u] = h.toISOString();
|
|
5683
5683
|
continue;
|
|
5684
5684
|
}
|
|
5685
|
-
if (
|
|
5686
|
-
|
|
5687
|
-
|
|
5685
|
+
if (h instanceof Map) {
|
|
5686
|
+
h.forEach((l, g) => {
|
|
5687
|
+
n[`${u}.${g}`] = JSON.stringify(l);
|
|
5688
5688
|
});
|
|
5689
5689
|
continue;
|
|
5690
5690
|
}
|
|
5691
|
-
if (Array.isArray(
|
|
5692
|
-
|
|
5693
|
-
const
|
|
5694
|
-
typeof
|
|
5691
|
+
if (Array.isArray(h)) {
|
|
5692
|
+
h.forEach((l, g) => {
|
|
5693
|
+
const f = `${u}:${g}`;
|
|
5694
|
+
typeof l == "object" ? Object.assign(n, this.flatten(l, f)) : n[f] = String(l);
|
|
5695
5695
|
});
|
|
5696
5696
|
continue;
|
|
5697
5697
|
}
|
|
5698
|
-
if (typeof
|
|
5699
|
-
Object.assign(
|
|
5698
|
+
if (typeof h == "object") {
|
|
5699
|
+
Object.assign(n, this.flatten(h, u));
|
|
5700
5700
|
continue;
|
|
5701
5701
|
}
|
|
5702
|
-
|
|
5702
|
+
n[u] = String(h);
|
|
5703
5703
|
}
|
|
5704
|
-
return
|
|
5704
|
+
return n;
|
|
5705
5705
|
}
|
|
5706
|
-
},
|
|
5706
|
+
}, e.generate = {
|
|
5707
5707
|
session: {
|
|
5708
5708
|
types: {
|
|
5709
|
-
name: { type: "string", options:
|
|
5710
|
-
tier: { type: "string", options:
|
|
5711
|
-
message: { type: "string", options:
|
|
5712
|
-
item: { type: "array", options:
|
|
5713
|
-
avatar: { type: "string", options:
|
|
5709
|
+
name: { type: "string", options: e.data.names.filter((t) => t.length) },
|
|
5710
|
+
tier: { type: "string", options: e.data.tiers.filter((t) => t.length) },
|
|
5711
|
+
message: { type: "string", options: e.data.messages.filter((t) => t.length) },
|
|
5712
|
+
item: { type: "array", options: e.data.items },
|
|
5713
|
+
avatar: { type: "string", options: e.data.avatars.filter((t) => t.length) }
|
|
5714
5714
|
},
|
|
5715
5715
|
available() {
|
|
5716
5716
|
const t = this.types;
|
|
@@ -5956,49 +5956,49 @@ var T;
|
|
|
5956
5956
|
};
|
|
5957
5957
|
},
|
|
5958
5958
|
async get() {
|
|
5959
|
-
const t = this.available(),
|
|
5960
|
-
const
|
|
5961
|
-
if (!
|
|
5962
|
-
const
|
|
5963
|
-
for (let
|
|
5964
|
-
|
|
5965
|
-
return
|
|
5966
|
-
}, u = (
|
|
5967
|
-
const
|
|
5968
|
-
for (const
|
|
5969
|
-
const
|
|
5970
|
-
|
|
5959
|
+
const t = this.available(), a = (r) => {
|
|
5960
|
+
const h = (g) => {
|
|
5961
|
+
if (!g || !("amount" in g)) return [];
|
|
5962
|
+
const f = [];
|
|
5963
|
+
for (let y = 0; y < g.amount; y++)
|
|
5964
|
+
f.push(a(g.value));
|
|
5965
|
+
return f.sort((y, k) => new Date(k.createdAt).getTime() - new Date(y.createdAt).getTime());
|
|
5966
|
+
}, u = (g) => {
|
|
5967
|
+
const f = {};
|
|
5968
|
+
for (const y in g) {
|
|
5969
|
+
const k = y.replace("_type", "type");
|
|
5970
|
+
f[k] = a(g[y]);
|
|
5971
5971
|
}
|
|
5972
|
-
return
|
|
5973
|
-
},
|
|
5974
|
-
if (!
|
|
5975
|
-
switch (
|
|
5972
|
+
return f;
|
|
5973
|
+
}, l = (g) => {
|
|
5974
|
+
if (!g) return g;
|
|
5975
|
+
switch (g.type) {
|
|
5976
5976
|
case "int":
|
|
5977
|
-
return
|
|
5977
|
+
return e.rand.number(g.min, g.max);
|
|
5978
5978
|
case "string":
|
|
5979
|
-
return
|
|
5979
|
+
return e.rand.array(g.options)[0];
|
|
5980
5980
|
case "date":
|
|
5981
|
-
return
|
|
5981
|
+
return e.rand.daysOffset(g.range);
|
|
5982
5982
|
case "array":
|
|
5983
|
-
return
|
|
5983
|
+
return e.rand.array(g.options)[0];
|
|
5984
5984
|
case "recent":
|
|
5985
|
-
return
|
|
5985
|
+
return h(g);
|
|
5986
5986
|
default:
|
|
5987
|
-
return
|
|
5987
|
+
return g;
|
|
5988
5988
|
}
|
|
5989
5989
|
};
|
|
5990
|
-
return typeof r != "object" || r === null ? r : "type" in r && typeof r.type == "string" ?
|
|
5990
|
+
return typeof r != "object" || r === null ? r : "type" in r && typeof r.type == "string" ? l(r) : u(r);
|
|
5991
5991
|
};
|
|
5992
|
-
var
|
|
5993
|
-
(r, [
|
|
5994
|
-
([
|
|
5992
|
+
var n = Object.entries(a(t)).reduce(
|
|
5993
|
+
(r, [h, u]) => (Object.entries(u).forEach(
|
|
5994
|
+
([l, g]) => (
|
|
5995
5995
|
//
|
|
5996
|
-
r[`${
|
|
5996
|
+
r[`${h}-${l}`] = g
|
|
5997
5997
|
)
|
|
5998
5998
|
), r),
|
|
5999
5999
|
{}
|
|
6000
6000
|
);
|
|
6001
|
-
return
|
|
6001
|
+
return n;
|
|
6002
6002
|
}
|
|
6003
6003
|
},
|
|
6004
6004
|
event: {
|
|
@@ -6009,7 +6009,7 @@ var T;
|
|
|
6009
6009
|
* @param currency - The currency to be used (default is 'USD').
|
|
6010
6010
|
* @returns A Promise that resolves to the simulated onWidgetLoad event data.
|
|
6011
6011
|
*/
|
|
6012
|
-
async onWidgetLoad(t,
|
|
6012
|
+
async onWidgetLoad(t, a, n = "USD") {
|
|
6013
6013
|
const r = {
|
|
6014
6014
|
BRL: { code: "BRL", name: "Brazilian Real", symbol: "R$" },
|
|
6015
6015
|
USD: { code: "USD", name: "US Dollar", symbol: "$" },
|
|
@@ -6023,11 +6023,11 @@ var T;
|
|
|
6023
6023
|
providerId: "",
|
|
6024
6024
|
avatar: ""
|
|
6025
6025
|
},
|
|
6026
|
-
currency: r[
|
|
6026
|
+
currency: r[n] ?? r.USD,
|
|
6027
6027
|
fieldData: t,
|
|
6028
6028
|
recents: [],
|
|
6029
6029
|
session: {
|
|
6030
|
-
data:
|
|
6030
|
+
data: a,
|
|
6031
6031
|
settings: {
|
|
6032
6032
|
autoReset: !1,
|
|
6033
6033
|
calendar: !1,
|
|
@@ -6047,7 +6047,7 @@ var T;
|
|
|
6047
6047
|
* @returns A Promise that resolves to the simulated onSessionUpdate event data.
|
|
6048
6048
|
*/
|
|
6049
6049
|
async onSessionUpdate(t) {
|
|
6050
|
-
return t ??= await
|
|
6050
|
+
return t ??= await e.generate.session.get(), { session: t };
|
|
6051
6051
|
},
|
|
6052
6052
|
/**
|
|
6053
6053
|
* Simulates the onEventReceived event for a widget.
|
|
@@ -6064,7 +6064,7 @@ var T;
|
|
|
6064
6064
|
* const twitchMessageEvent = await Simulation.generate.event.onEventReceived('twitch', 'message', { name: 'Streamer', message: 'Hello World!' });
|
|
6065
6065
|
* ```
|
|
6066
6066
|
*/
|
|
6067
|
-
async onEventReceived(t = "random",
|
|
6067
|
+
async onEventReceived(t = "random", a = "random", n = {}) {
|
|
6068
6068
|
const r = {
|
|
6069
6069
|
twitch: ["message", "follower-latest", "cheer-latest", "raid-latest", "subscriber-latest"],
|
|
6070
6070
|
streamelements: ["tip-latest"],
|
|
@@ -6075,18 +6075,18 @@ var T;
|
|
|
6075
6075
|
switch (t) {
|
|
6076
6076
|
default:
|
|
6077
6077
|
case "random": {
|
|
6078
|
-
var
|
|
6079
|
-
return this.onEventReceived(
|
|
6078
|
+
var h = e.rand.array(Object.keys(r).filter((x) => r[x].length))[0], u = e.rand.array(r[h])[0];
|
|
6079
|
+
return this.onEventReceived(h, u);
|
|
6080
6080
|
}
|
|
6081
6081
|
case "twitch":
|
|
6082
|
-
switch (
|
|
6082
|
+
switch (a) {
|
|
6083
6083
|
default:
|
|
6084
6084
|
case "random": {
|
|
6085
|
-
var u =
|
|
6085
|
+
var u = e.rand.array(r[t])[0];
|
|
6086
6086
|
return this.onEventReceived(t, u);
|
|
6087
6087
|
}
|
|
6088
6088
|
case "message": {
|
|
6089
|
-
var
|
|
6089
|
+
var l = n?.name ?? e.rand.array(e.data.names.filter((J) => J.length))[0], g = n?.message ?? e.rand.array(e.data.messages.filter((J) => J.length))[0], f = await S(n?.badges ?? [], t), y = q(g), k = G(g, y), U = n?.color ?? e.rand.color("hex"), C = n?.userId ?? e.rand.number(1e7, 99999999).toString(), p = Date.now();
|
|
6090
6090
|
return {
|
|
6091
6091
|
listener: "message",
|
|
6092
6092
|
event: {
|
|
@@ -6094,51 +6094,51 @@ var T;
|
|
|
6094
6094
|
data: {
|
|
6095
6095
|
time: p,
|
|
6096
6096
|
tags: {
|
|
6097
|
-
"badge-info": `${
|
|
6098
|
-
badges:
|
|
6099
|
-
mod:
|
|
6100
|
-
subscriber:
|
|
6101
|
-
turbo:
|
|
6097
|
+
"badge-info": `${f.keys.map((J) => `${J}/${e.rand.number(1, 5)}`).join(",")}`,
|
|
6098
|
+
badges: f.keys.join("/1,"),
|
|
6099
|
+
mod: f.keys.includes("moderator") ? "1" : "0",
|
|
6100
|
+
subscriber: f.keys.includes("subscriber") ? "1" : "0",
|
|
6101
|
+
turbo: f.keys.includes("turbo") ? "1" : "0",
|
|
6102
6102
|
"tmi-sent-ts": p.toString(),
|
|
6103
|
-
"user-id":
|
|
6103
|
+
"user-id": C,
|
|
6104
6104
|
"user-type": "",
|
|
6105
|
-
color:
|
|
6106
|
-
"display-name":
|
|
6105
|
+
color: U,
|
|
6106
|
+
"display-name": l,
|
|
6107
6107
|
emotes: "",
|
|
6108
|
-
"client-nonce":
|
|
6108
|
+
"client-nonce": e.rand.string(16),
|
|
6109
6109
|
flags: "",
|
|
6110
|
-
id:
|
|
6110
|
+
id: e.rand.uuid(),
|
|
6111
6111
|
"first-msg": "0",
|
|
6112
6112
|
"returning-chatter": "0"
|
|
6113
6113
|
},
|
|
6114
|
-
nick:
|
|
6115
|
-
displayName:
|
|
6116
|
-
displayColor:
|
|
6114
|
+
nick: l.toLowerCase(),
|
|
6115
|
+
displayName: l,
|
|
6116
|
+
displayColor: U,
|
|
6117
6117
|
channel: "local",
|
|
6118
|
-
text:
|
|
6118
|
+
text: g,
|
|
6119
6119
|
isAction: !1,
|
|
6120
|
-
userId:
|
|
6121
|
-
msgId:
|
|
6122
|
-
badges:
|
|
6123
|
-
emotes:
|
|
6120
|
+
userId: C,
|
|
6121
|
+
msgId: e.rand.uuid(),
|
|
6122
|
+
badges: f.badges,
|
|
6123
|
+
emotes: y
|
|
6124
6124
|
},
|
|
6125
|
-
renderedText:
|
|
6125
|
+
renderedText: k
|
|
6126
6126
|
}
|
|
6127
6127
|
};
|
|
6128
6128
|
}
|
|
6129
6129
|
case "cheer":
|
|
6130
6130
|
case "cheer-latest": {
|
|
6131
|
-
var
|
|
6131
|
+
var w = n?.amount ?? e.rand.number(100, 1e4), c = n?.avatar ?? e.rand.array(e.data.avatars)[0], l = n?.name ?? e.rand.array(e.data.names.filter((A) => A.length))[0], g = n?.message ?? e.rand.array(e.data.messages.filter((A) => A.length))[0];
|
|
6132
6132
|
return {
|
|
6133
6133
|
listener: "cheer-latest",
|
|
6134
6134
|
event: {
|
|
6135
|
-
amount:
|
|
6135
|
+
amount: w,
|
|
6136
6136
|
avatar: c,
|
|
6137
|
-
name:
|
|
6138
|
-
displayName:
|
|
6139
|
-
message:
|
|
6137
|
+
name: l.toLowerCase(),
|
|
6138
|
+
displayName: l,
|
|
6139
|
+
message: g,
|
|
6140
6140
|
providerId: "",
|
|
6141
|
-
_id:
|
|
6141
|
+
_id: e.rand.uuid(),
|
|
6142
6142
|
sessionTop: !1,
|
|
6143
6143
|
type: "cheer",
|
|
6144
6144
|
originalEventName: "cheer-latest",
|
|
@@ -6148,15 +6148,15 @@ var T;
|
|
|
6148
6148
|
}
|
|
6149
6149
|
case "follower":
|
|
6150
6150
|
case "follower-latest": {
|
|
6151
|
-
var c =
|
|
6151
|
+
var c = n?.avatar ?? e.rand.array(e.data.avatars)[0], l = n?.name ?? e.rand.array(e.data.names.filter((A) => A.length))[0];
|
|
6152
6152
|
return {
|
|
6153
6153
|
listener: "follower-latest",
|
|
6154
6154
|
event: {
|
|
6155
6155
|
avatar: c,
|
|
6156
|
-
name:
|
|
6157
|
-
displayName:
|
|
6156
|
+
name: l.toLowerCase(),
|
|
6157
|
+
displayName: l,
|
|
6158
6158
|
providerId: "",
|
|
6159
|
-
_id:
|
|
6159
|
+
_id: e.rand.uuid(),
|
|
6160
6160
|
sessionTop: !1,
|
|
6161
6161
|
type: "follower",
|
|
6162
6162
|
originalEventName: "follower-latest",
|
|
@@ -6166,16 +6166,16 @@ var T;
|
|
|
6166
6166
|
}
|
|
6167
6167
|
case "raid":
|
|
6168
6168
|
case "raid-latest": {
|
|
6169
|
-
var
|
|
6169
|
+
var w = n?.amount ?? e.rand.number(1, 100), c = n?.avatar ?? e.rand.array(e.data.avatars)[0], l = n?.name ?? e.rand.array(e.data.names.filter((P) => P.length))[0];
|
|
6170
6170
|
return {
|
|
6171
6171
|
listener: "raid-latest",
|
|
6172
6172
|
event: {
|
|
6173
|
-
amount:
|
|
6173
|
+
amount: w,
|
|
6174
6174
|
avatar: c,
|
|
6175
|
-
name:
|
|
6176
|
-
displayName:
|
|
6175
|
+
name: l.toLowerCase(),
|
|
6176
|
+
displayName: l,
|
|
6177
6177
|
providerId: "",
|
|
6178
|
-
_id:
|
|
6178
|
+
_id: e.rand.uuid(),
|
|
6179
6179
|
sessionTop: !1,
|
|
6180
6180
|
type: "raid",
|
|
6181
6181
|
originalEventName: "raid-latest",
|
|
@@ -6185,10 +6185,10 @@ var T;
|
|
|
6185
6185
|
}
|
|
6186
6186
|
case "subscriber":
|
|
6187
6187
|
case "subscriber-latest": {
|
|
6188
|
-
var
|
|
6188
|
+
var m = n?.tier ?? e.rand.array(["1000", "2000", "3000"])[0], w = n?.amount ?? e.rand.number(1, 24), c = n?.avatar ?? e.rand.array(e.data.avatars)[0], l = n?.name ?? e.rand.array(e.data.names.filter((M) => M.length))[0], b = n?.sender ?? e.rand.array(e.data.names.filter((M) => M.length && M !== l))[0], g = n?.message ?? e.rand.array(e.data.messages.filter((M) => M.length))[0], v = {
|
|
6189
6189
|
default: {
|
|
6190
6190
|
avatar: c,
|
|
6191
|
-
tier:
|
|
6191
|
+
tier: m,
|
|
6192
6192
|
playedAsCommunityGift: !1
|
|
6193
6193
|
},
|
|
6194
6194
|
gift: {
|
|
@@ -6196,7 +6196,7 @@ var T;
|
|
|
6196
6196
|
gifted: !0
|
|
6197
6197
|
},
|
|
6198
6198
|
community: {
|
|
6199
|
-
message:
|
|
6199
|
+
message: g,
|
|
6200
6200
|
sender: b,
|
|
6201
6201
|
bulkGifted: !0
|
|
6202
6202
|
},
|
|
@@ -6205,17 +6205,17 @@ var T;
|
|
|
6205
6205
|
gifted: !0,
|
|
6206
6206
|
isCommunityGift: !0
|
|
6207
6207
|
}
|
|
6208
|
-
},
|
|
6209
|
-
return
|
|
6208
|
+
}, E = ["default", "gift", "community", "spam"], j = n?.subType ?? e.rand.array(E)[0];
|
|
6209
|
+
return j = E.includes(j) ? j : "default", {
|
|
6210
6210
|
listener: "subscriber-latest",
|
|
6211
6211
|
event: {
|
|
6212
|
-
amount:
|
|
6213
|
-
name:
|
|
6214
|
-
displayName:
|
|
6212
|
+
amount: w,
|
|
6213
|
+
name: l.toLowerCase(),
|
|
6214
|
+
displayName: l,
|
|
6215
6215
|
providerId: "",
|
|
6216
|
-
...
|
|
6217
|
-
...
|
|
6218
|
-
_id:
|
|
6216
|
+
...v.default,
|
|
6217
|
+
...v[j],
|
|
6218
|
+
_id: e.rand.uuid(),
|
|
6219
6219
|
sessionTop: !1,
|
|
6220
6220
|
type: "subscriber",
|
|
6221
6221
|
originalEventName: "subscriber-latest",
|
|
@@ -6227,7 +6227,7 @@ var T;
|
|
|
6227
6227
|
return {
|
|
6228
6228
|
listener: "delete-message",
|
|
6229
6229
|
event: {
|
|
6230
|
-
msgId:
|
|
6230
|
+
msgId: n?.id ?? e.rand.uuid(),
|
|
6231
6231
|
provider: t
|
|
6232
6232
|
}
|
|
6233
6233
|
};
|
|
@@ -6235,30 +6235,30 @@ var T;
|
|
|
6235
6235
|
return {
|
|
6236
6236
|
listener: "delete-messages",
|
|
6237
6237
|
event: {
|
|
6238
|
-
userId:
|
|
6238
|
+
userId: n?.id ?? e.rand.number(1e7, 99999999).toString(),
|
|
6239
6239
|
provider: t
|
|
6240
6240
|
}
|
|
6241
6241
|
};
|
|
6242
6242
|
}
|
|
6243
6243
|
case "streamelements":
|
|
6244
|
-
switch (
|
|
6244
|
+
switch (a) {
|
|
6245
6245
|
default:
|
|
6246
6246
|
case "random": {
|
|
6247
|
-
var u =
|
|
6247
|
+
var u = e.rand.array(r[t])[0];
|
|
6248
6248
|
return this.onEventReceived(t, u);
|
|
6249
6249
|
}
|
|
6250
6250
|
case "tip":
|
|
6251
6251
|
case "tip-latest": {
|
|
6252
|
-
var
|
|
6252
|
+
var w = n?.amount ?? e.rand.number(100, 4e3), c = n?.avatar ?? e.rand.array(e.data.avatars)[0], l = n?.name ?? e.rand.array(e.data.names.filter((P) => P.length))[0];
|
|
6253
6253
|
return {
|
|
6254
6254
|
listener: "tip-latest",
|
|
6255
6255
|
event: {
|
|
6256
|
-
amount:
|
|
6256
|
+
amount: w,
|
|
6257
6257
|
avatar: c,
|
|
6258
|
-
name:
|
|
6259
|
-
displayName:
|
|
6258
|
+
name: l.toLowerCase(),
|
|
6259
|
+
displayName: l,
|
|
6260
6260
|
providerId: "",
|
|
6261
|
-
_id:
|
|
6261
|
+
_id: e.rand.uuid(),
|
|
6262
6262
|
sessionTop: !1,
|
|
6263
6263
|
type: "tip",
|
|
6264
6264
|
originalEventName: "tip-latest",
|
|
@@ -6271,8 +6271,8 @@ var T;
|
|
|
6271
6271
|
listener: "kvstore:update",
|
|
6272
6272
|
event: {
|
|
6273
6273
|
data: {
|
|
6274
|
-
key: `customWidget.${
|
|
6275
|
-
value:
|
|
6274
|
+
key: `customWidget.${n?.key ?? "sampleKey"}`,
|
|
6275
|
+
value: n?.value ?? "sampleValue"
|
|
6276
6276
|
},
|
|
6277
6277
|
provider: t
|
|
6278
6278
|
}
|
|
@@ -6281,19 +6281,19 @@ var T;
|
|
|
6281
6281
|
return {
|
|
6282
6282
|
listener: "bot:counter",
|
|
6283
6283
|
event: {
|
|
6284
|
-
counter:
|
|
6285
|
-
value:
|
|
6284
|
+
counter: n?.counter ?? "sampleCounter",
|
|
6285
|
+
value: n?.value ?? e.rand.number(0, 100),
|
|
6286
6286
|
provider: t
|
|
6287
6287
|
}
|
|
6288
6288
|
};
|
|
6289
6289
|
case "mute":
|
|
6290
6290
|
case "unmute":
|
|
6291
6291
|
case "alertService:toggleSound": {
|
|
6292
|
-
var
|
|
6292
|
+
var I = n?.muted ?? !client.details.overlay.muted;
|
|
6293
6293
|
return {
|
|
6294
6294
|
listener: "alertService:toggleSound",
|
|
6295
6295
|
event: {
|
|
6296
|
-
muted:
|
|
6296
|
+
muted: I,
|
|
6297
6297
|
provider: t
|
|
6298
6298
|
}
|
|
6299
6299
|
};
|
|
@@ -6308,16 +6308,16 @@ var T;
|
|
|
6308
6308
|
};
|
|
6309
6309
|
}
|
|
6310
6310
|
case "youtube":
|
|
6311
|
-
switch (
|
|
6311
|
+
switch (a) {
|
|
6312
6312
|
default:
|
|
6313
6313
|
case "random": {
|
|
6314
|
-
var u =
|
|
6314
|
+
var u = e.rand.array(r[t])[0];
|
|
6315
6315
|
return this.onEventReceived(t, u);
|
|
6316
6316
|
}
|
|
6317
6317
|
case "message": {
|
|
6318
|
-
var
|
|
6319
|
-
const
|
|
6320
|
-
var
|
|
6318
|
+
var l = n?.name ?? e.rand.array(e.data.names.filter((H) => H.length))[0], g = n?.message ?? e.rand.array(e.data.messages.filter((H) => H.length))[0];
|
|
6319
|
+
const R = await S(n?.badges ?? [], t);
|
|
6320
|
+
var y = q(g), k = G(g, y), U = n?.color ?? e.rand.color("hex"), C = n?.userId ?? e.rand.number(1e7, 99999999).toString(), p = Date.now(), c = n?.avatar ?? e.rand.array(e.data.avatars)[0];
|
|
6321
6321
|
return {
|
|
6322
6322
|
listener: "message",
|
|
6323
6323
|
event: {
|
|
@@ -6332,47 +6332,47 @@ var T;
|
|
|
6332
6332
|
authorChannelId: "local",
|
|
6333
6333
|
publishedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6334
6334
|
hasDisplayContent: !0,
|
|
6335
|
-
displayMessage:
|
|
6335
|
+
displayMessage: g,
|
|
6336
6336
|
textMessageDetails: {
|
|
6337
|
-
messageText:
|
|
6337
|
+
messageText: g
|
|
6338
6338
|
}
|
|
6339
6339
|
},
|
|
6340
6340
|
authorDetails: {
|
|
6341
6341
|
channelId: "local",
|
|
6342
6342
|
channelUrl: "",
|
|
6343
|
-
displayName:
|
|
6343
|
+
displayName: l,
|
|
6344
6344
|
profileImageUrl: c,
|
|
6345
|
-
...
|
|
6345
|
+
...R
|
|
6346
6346
|
},
|
|
6347
|
-
msgId:
|
|
6348
|
-
userId:
|
|
6349
|
-
nick:
|
|
6347
|
+
msgId: e.rand.uuid(),
|
|
6348
|
+
userId: e.rand.uuid(),
|
|
6349
|
+
nick: l.toLowerCase(),
|
|
6350
6350
|
badges: [],
|
|
6351
|
-
displayName:
|
|
6351
|
+
displayName: l,
|
|
6352
6352
|
isAction: !1,
|
|
6353
6353
|
time: Date.now(),
|
|
6354
6354
|
tags: [],
|
|
6355
|
-
displayColor:
|
|
6355
|
+
displayColor: e.rand.color("hex"),
|
|
6356
6356
|
channel: "local",
|
|
6357
|
-
text:
|
|
6357
|
+
text: g,
|
|
6358
6358
|
avatar: c,
|
|
6359
6359
|
emotes: []
|
|
6360
6360
|
},
|
|
6361
|
-
renderedText:
|
|
6361
|
+
renderedText: g
|
|
6362
6362
|
}
|
|
6363
6363
|
};
|
|
6364
6364
|
}
|
|
6365
6365
|
case "subscriber":
|
|
6366
6366
|
case "subscriber-latest": {
|
|
6367
|
-
var c =
|
|
6367
|
+
var c = n?.avatar ?? e.rand.array(e.data.avatars)[0], l = n?.name ?? e.rand.array(e.data.names.filter((A) => A.length))[0];
|
|
6368
6368
|
return {
|
|
6369
6369
|
listener: "subscriber-latest",
|
|
6370
6370
|
event: {
|
|
6371
6371
|
avatar: c,
|
|
6372
|
-
displayName:
|
|
6373
|
-
name:
|
|
6372
|
+
displayName: l,
|
|
6373
|
+
name: l.toLowerCase(),
|
|
6374
6374
|
providerId: "",
|
|
6375
|
-
_id:
|
|
6375
|
+
_id: e.rand.uuid(),
|
|
6376
6376
|
sessionTop: !1,
|
|
6377
6377
|
type: "subscriber",
|
|
6378
6378
|
originalEventName: "subscriber-latest",
|
|
@@ -6382,16 +6382,16 @@ var T;
|
|
|
6382
6382
|
}
|
|
6383
6383
|
case "superchat":
|
|
6384
6384
|
case "superchat-latest": {
|
|
6385
|
-
var
|
|
6385
|
+
var w = n?.amount ?? e.rand.number(100, 4e3), c = n?.avatar ?? e.rand.array(e.data.avatars)[0], l = n?.name ?? e.rand.array(e.data.names.filter((P) => P.length))[0];
|
|
6386
6386
|
return {
|
|
6387
6387
|
listener: "superchat-latest",
|
|
6388
6388
|
event: {
|
|
6389
|
-
amount:
|
|
6389
|
+
amount: w,
|
|
6390
6390
|
avatar: c,
|
|
6391
|
-
name:
|
|
6392
|
-
displayName:
|
|
6391
|
+
name: l.toLowerCase(),
|
|
6392
|
+
displayName: l,
|
|
6393
6393
|
providerId: "",
|
|
6394
|
-
_id:
|
|
6394
|
+
_id: e.rand.uuid(),
|
|
6395
6395
|
sessionTop: !1,
|
|
6396
6396
|
type: "superchat",
|
|
6397
6397
|
originalEventName: "superchat-latest",
|
|
@@ -6401,10 +6401,10 @@ var T;
|
|
|
6401
6401
|
}
|
|
6402
6402
|
case "sponsor":
|
|
6403
6403
|
case "sponsor-latest": {
|
|
6404
|
-
var
|
|
6404
|
+
var m = n?.tier ?? e.rand.array(["1000", "2000", "3000"])[0], w = n?.amount ?? e.rand.number(1, 24), c = n?.avatar ?? e.rand.array(e.data.avatars)[0], l = n?.name ?? e.rand.array(e.data.names.filter((H) => H.length))[0], b = n?.sender ?? e.rand.array(e.data.names.filter((H) => H.length && H !== l))[0], g = n?.message ?? e.rand.array(e.data.messages.filter((H) => H.length))[0], v = {
|
|
6405
6405
|
default: {
|
|
6406
6406
|
avatar: c,
|
|
6407
|
-
tier:
|
|
6407
|
+
tier: m,
|
|
6408
6408
|
playedAsCommunityGift: !1
|
|
6409
6409
|
},
|
|
6410
6410
|
gift: {
|
|
@@ -6412,7 +6412,7 @@ var T;
|
|
|
6412
6412
|
gifted: !0
|
|
6413
6413
|
},
|
|
6414
6414
|
community: {
|
|
6415
|
-
message:
|
|
6415
|
+
message: g,
|
|
6416
6416
|
sender: b,
|
|
6417
6417
|
bulkGifted: !0
|
|
6418
6418
|
},
|
|
@@ -6421,17 +6421,17 @@ var T;
|
|
|
6421
6421
|
gifted: !0,
|
|
6422
6422
|
isCommunityGift: !0
|
|
6423
6423
|
}
|
|
6424
|
-
},
|
|
6425
|
-
return
|
|
6424
|
+
}, E = ["default", "gift", "community", "spam"], j = n?.subType ?? e.rand.array(E)[0];
|
|
6425
|
+
return j = E.includes(j) ? j : "default", {
|
|
6426
6426
|
listener: "sponsor-latest",
|
|
6427
6427
|
event: {
|
|
6428
|
-
amount:
|
|
6429
|
-
name:
|
|
6430
|
-
displayName:
|
|
6428
|
+
amount: w,
|
|
6429
|
+
name: l.toLowerCase(),
|
|
6430
|
+
displayName: l,
|
|
6431
6431
|
providerId: "",
|
|
6432
|
-
...
|
|
6433
|
-
...
|
|
6434
|
-
_id:
|
|
6432
|
+
...v.default,
|
|
6433
|
+
...v[j],
|
|
6434
|
+
_id: e.rand.uuid(),
|
|
6435
6435
|
sessionTop: !1,
|
|
6436
6436
|
type: "sponsor",
|
|
6437
6437
|
originalEventName: "sponsor-latest",
|
|
@@ -6443,164 +6443,168 @@ var T;
|
|
|
6443
6443
|
}
|
|
6444
6444
|
}
|
|
6445
6445
|
}
|
|
6446
|
-
},
|
|
6446
|
+
}, e.emulate = {
|
|
6447
6447
|
twitch: {
|
|
6448
6448
|
message(t = {}) {
|
|
6449
|
-
|
|
6450
|
-
|
|
6449
|
+
e.generate.event.onEventReceived("twitch", "message", t).then((a) => {
|
|
6450
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6451
6451
|
});
|
|
6452
6452
|
},
|
|
6453
6453
|
follower(t = {}) {
|
|
6454
|
-
|
|
6455
|
-
|
|
6454
|
+
e.generate.event.onEventReceived("twitch", "follower-latest", t).then((a) => {
|
|
6455
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6456
6456
|
});
|
|
6457
6457
|
},
|
|
6458
6458
|
raid(t = {}) {
|
|
6459
|
-
|
|
6460
|
-
|
|
6459
|
+
e.generate.event.onEventReceived("twitch", "raid-latest", t).then((a) => {
|
|
6460
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6461
6461
|
});
|
|
6462
6462
|
},
|
|
6463
6463
|
cheer(t = {}) {
|
|
6464
|
-
|
|
6465
|
-
|
|
6464
|
+
e.generate.event.onEventReceived("twitch", "cheer-latest", t).then((a) => {
|
|
6465
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6466
6466
|
});
|
|
6467
6467
|
},
|
|
6468
6468
|
subscriber(t = {}) {
|
|
6469
|
-
|
|
6470
|
-
|
|
6469
|
+
e.generate.event.onEventReceived("twitch", "subscriber-latest", t).then((a) => {
|
|
6470
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6471
6471
|
});
|
|
6472
6472
|
}
|
|
6473
6473
|
},
|
|
6474
6474
|
streamelements: {
|
|
6475
6475
|
tip(t = {}) {
|
|
6476
|
-
|
|
6477
|
-
|
|
6476
|
+
e.generate.event.onEventReceived("streamelements", "tip-latest", t).then((a) => {
|
|
6477
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6478
6478
|
});
|
|
6479
6479
|
}
|
|
6480
6480
|
},
|
|
6481
6481
|
youtube: {
|
|
6482
6482
|
message(t = {}) {
|
|
6483
|
-
|
|
6484
|
-
|
|
6483
|
+
e.generate.event.onEventReceived("youtube", "message", t).then((a) => {
|
|
6484
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6485
6485
|
});
|
|
6486
6486
|
},
|
|
6487
6487
|
subscriber(t = {}) {
|
|
6488
|
-
|
|
6489
|
-
|
|
6488
|
+
e.generate.event.onEventReceived("youtube", "subscriber-latest", t).then((a) => {
|
|
6489
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6490
6490
|
});
|
|
6491
6491
|
},
|
|
6492
6492
|
superchat(t = {}) {
|
|
6493
|
-
|
|
6494
|
-
|
|
6493
|
+
e.generate.event.onEventReceived("youtube", "superchat-latest", t).then((a) => {
|
|
6494
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6495
6495
|
});
|
|
6496
6496
|
},
|
|
6497
6497
|
sponsor(t = {}) {
|
|
6498
|
-
|
|
6499
|
-
|
|
6498
|
+
e.generate.event.onEventReceived("youtube", "sponsor-latest", t).then((a) => {
|
|
6499
|
+
a && e.emulate.send("onEventReceived", a);
|
|
6500
6500
|
});
|
|
6501
6501
|
}
|
|
6502
6502
|
},
|
|
6503
6503
|
kick: {},
|
|
6504
6504
|
facebook: {},
|
|
6505
|
-
send(t,
|
|
6506
|
-
window.dispatchEvent(new CustomEvent(t, { detail:
|
|
6505
|
+
send(t, a) {
|
|
6506
|
+
window.dispatchEvent(new CustomEvent(t, { detail: a }));
|
|
6507
6507
|
}
|
|
6508
6508
|
};
|
|
6509
|
-
function
|
|
6510
|
-
return new Promise((
|
|
6509
|
+
function s(t) {
|
|
6510
|
+
return new Promise((a) => setTimeout(a, t));
|
|
6511
|
+
}
|
|
6512
|
+
e.delay = s;
|
|
6513
|
+
function i(t) {
|
|
6514
|
+
return Object.entries(t);
|
|
6511
6515
|
}
|
|
6512
|
-
|
|
6513
|
-
function
|
|
6514
|
-
const
|
|
6515
|
-
let
|
|
6516
|
-
for (const [u,
|
|
6517
|
-
if (
|
|
6516
|
+
e.typedEntries = i;
|
|
6517
|
+
function d(t) {
|
|
6518
|
+
const a = Object.values(t).reduce((u, l) => u + l, 0), n = i(t).sort((u, l) => l[1] - u[1]), r = Math.random() * a;
|
|
6519
|
+
let h = 0;
|
|
6520
|
+
for (const [u, l] of n)
|
|
6521
|
+
if (h += l, r < h)
|
|
6518
6522
|
return u;
|
|
6519
6523
|
}
|
|
6520
|
-
|
|
6521
|
-
async function o(t = ["fields.json", "cf.json", "field.json", "customfields.json"],
|
|
6522
|
-
const
|
|
6523
|
-
fields: t.find((
|
|
6524
|
+
e.probability = d;
|
|
6525
|
+
async function o(t = ["fields.json", "cf.json", "field.json", "customfields.json"], a = ["data.json", "fielddata.json", "fd.json", "DATA.json"]) {
|
|
6526
|
+
const n = {
|
|
6527
|
+
fields: t.find((h) => {
|
|
6524
6528
|
try {
|
|
6525
|
-
return new URL("./" +
|
|
6529
|
+
return new URL("./" + h, window.location.href), !0;
|
|
6526
6530
|
} catch {
|
|
6527
6531
|
return !1;
|
|
6528
6532
|
}
|
|
6529
6533
|
}),
|
|
6530
|
-
data:
|
|
6534
|
+
data: a.find((h) => {
|
|
6531
6535
|
try {
|
|
6532
|
-
return new URL("./" +
|
|
6536
|
+
return new URL("./" + h, window.location.href), !0;
|
|
6533
6537
|
} catch {
|
|
6534
6538
|
return !1;
|
|
6535
6539
|
}
|
|
6536
6540
|
})
|
|
6537
|
-
}, r = await fetch("./" + (
|
|
6541
|
+
}, r = await fetch("./" + (n.data ?? "data.json"), {
|
|
6538
6542
|
cache: "no-store"
|
|
6539
|
-
}).then((
|
|
6540
|
-
await fetch("./" + (
|
|
6543
|
+
}).then((h) => h.json()).catch(() => ({}));
|
|
6544
|
+
await fetch("./" + (n.fields ?? "fields.json"), {
|
|
6541
6545
|
cache: "no-store"
|
|
6542
|
-
}).then((
|
|
6543
|
-
const u = Object.entries(
|
|
6544
|
-
(
|
|
6546
|
+
}).then((h) => h.json()).then(async (h) => {
|
|
6547
|
+
const u = Object.entries(h).filter(([g, { value: f }]) => f != null).reduce(
|
|
6548
|
+
(g, [f, { value: y }]) => (r && r[f] !== void 0 && (y = r[f]), g[f] = y, g),
|
|
6545
6549
|
{
|
|
6546
6550
|
...r
|
|
6547
6551
|
}
|
|
6548
|
-
),
|
|
6549
|
-
window.dispatchEvent(new CustomEvent("onWidgetLoad", { detail:
|
|
6552
|
+
), l = await e.generate.event.onWidgetLoad(u, await e.generate.session.get());
|
|
6553
|
+
window.dispatchEvent(new CustomEvent("onWidgetLoad", { detail: l }));
|
|
6550
6554
|
});
|
|
6551
6555
|
}
|
|
6552
|
-
|
|
6553
|
-
})(
|
|
6554
|
-
function
|
|
6555
|
-
const
|
|
6556
|
-
return
|
|
6557
|
-
const
|
|
6558
|
-
let
|
|
6559
|
-
for (;
|
|
6560
|
-
const
|
|
6561
|
-
if (
|
|
6562
|
-
const
|
|
6563
|
-
/\s/.test(
|
|
6556
|
+
e.start = o;
|
|
6557
|
+
})(D || (D = {}));
|
|
6558
|
+
function q(e, s = D.data.emotes) {
|
|
6559
|
+
const i = [];
|
|
6560
|
+
return s.forEach((d) => {
|
|
6561
|
+
const o = d.name;
|
|
6562
|
+
let t = 0, a = 0;
|
|
6563
|
+
for (; t < e.length; ) {
|
|
6564
|
+
const n = e.indexOf(o, a);
|
|
6565
|
+
if (n === -1) break;
|
|
6566
|
+
const r = n > 0 ? e[n - 1] : " ", h = n + o.length < e.length ? e[n + o.length] : " ";
|
|
6567
|
+
/\s/.test(r) && /\s/.test(h) && i.push({ ...d, start: n, end: n + o.length }), a = n + 1;
|
|
6564
6568
|
}
|
|
6565
|
-
}),
|
|
6569
|
+
}), i.sort((d, o) => d.start - o.start);
|
|
6566
6570
|
}
|
|
6567
|
-
function
|
|
6568
|
-
if (!
|
|
6569
|
-
let
|
|
6570
|
-
return
|
|
6571
|
-
|
|
6572
|
-
const
|
|
6573
|
-
|
|
6574
|
-
}),
|
|
6571
|
+
function G(e, s) {
|
|
6572
|
+
if (!s.length) return e;
|
|
6573
|
+
let i = "", d = 0;
|
|
6574
|
+
return s.forEach((o) => {
|
|
6575
|
+
i += e.substring(d, o.start);
|
|
6576
|
+
const a = Array.from({ ...o.urls, length: 5 }).slice(1).reverse().filter(Boolean)[0] || o.urls[1];
|
|
6577
|
+
i += `<img src="${a}" alt="${o.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`, d = o.end;
|
|
6578
|
+
}), i += e.substring(d), i;
|
|
6575
6579
|
}
|
|
6576
|
-
function
|
|
6577
|
-
return Array.from(
|
|
6578
|
-
const
|
|
6579
|
-
if (
|
|
6580
|
-
const
|
|
6581
|
-
|
|
6580
|
+
function lt(e, s = D.data.youtube_emotes) {
|
|
6581
|
+
return Array.from(e.matchAll(/:(.*?):/gim), (d) => d[0]).forEach((d) => {
|
|
6582
|
+
const o = s.find((t) => t.shortcuts.includes(d) || t.searchTerms.includes(d.slice(1, -1)));
|
|
6583
|
+
if (o) {
|
|
6584
|
+
const t = o.image.thumbnails.at(-1)?.url, a = o.image.accessibility.accessibilityData.label;
|
|
6585
|
+
t && (e = e.replace(d, `<img src="${t}" alt="${a}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`));
|
|
6582
6586
|
}
|
|
6583
|
-
}),
|
|
6587
|
+
}), e;
|
|
6584
6588
|
}
|
|
6585
|
-
async function
|
|
6586
|
-
if (!Array.isArray(
|
|
6587
|
-
var
|
|
6588
|
-
for await (const
|
|
6589
|
-
var
|
|
6590
|
-
!
|
|
6589
|
+
async function S(e = [], s = "twitch") {
|
|
6590
|
+
if (!Array.isArray(e) && typeof e == "string" && (e = e.split(",").map((a) => a.trim())), !e || !e.length) {
|
|
6591
|
+
var i = D.rand.number(1, 3);
|
|
6592
|
+
for await (const a of Array.from({ length: i }, () => "")) {
|
|
6593
|
+
var d = D.rand.array(Object.keys(D.data.badges))[0];
|
|
6594
|
+
!e.includes(d) && Array.isArray(e) ? e.push(d) : e = [d];
|
|
6591
6595
|
}
|
|
6592
6596
|
}
|
|
6593
|
-
var
|
|
6594
|
-
switch (
|
|
6597
|
+
var o;
|
|
6598
|
+
switch (s) {
|
|
6595
6599
|
case "twitch": {
|
|
6596
|
-
|
|
6597
|
-
keys: Array.from(
|
|
6598
|
-
badges: Array.from(
|
|
6600
|
+
o = {
|
|
6601
|
+
keys: Array.from(e).filter((a) => a in D.data.badges),
|
|
6602
|
+
badges: Array.from(e).slice(0, 3).map((a) => D.data.badges[a]).filter(Boolean)
|
|
6599
6603
|
};
|
|
6600
6604
|
break;
|
|
6601
6605
|
}
|
|
6602
6606
|
case "youtube": {
|
|
6603
|
-
var
|
|
6607
|
+
var t = {
|
|
6604
6608
|
verified: { isVerified: !1 },
|
|
6605
6609
|
broadcaster: { isChatOwner: !1 },
|
|
6606
6610
|
host: { isChatOwner: !1 },
|
|
@@ -6608,8 +6612,8 @@ async function G(s = [], a = "twitch") {
|
|
|
6608
6612
|
subscriber: { isChatSponsor: !1 },
|
|
6609
6613
|
moderator: { isChatModerator: !1 }
|
|
6610
6614
|
};
|
|
6611
|
-
|
|
6612
|
-
(
|
|
6615
|
+
o = Object.entries(e).reduce(
|
|
6616
|
+
(a, [n]) => (n in t && Object.assign(a, t[n]), a),
|
|
6613
6617
|
{
|
|
6614
6618
|
isVerified: !1,
|
|
6615
6619
|
isChatOwner: !1,
|
|
@@ -6620,9 +6624,9 @@ async function G(s = [], a = "twitch") {
|
|
|
6620
6624
|
break;
|
|
6621
6625
|
}
|
|
6622
6626
|
}
|
|
6623
|
-
return
|
|
6627
|
+
return o;
|
|
6624
6628
|
}
|
|
6625
|
-
const
|
|
6629
|
+
const F = {
|
|
6626
6630
|
getOverlayStatus: () => ({
|
|
6627
6631
|
isEditorMode: !1,
|
|
6628
6632
|
muted: !1
|
|
@@ -6630,36 +6634,36 @@ const S = {
|
|
|
6630
6634
|
resumeQueue: () => {
|
|
6631
6635
|
},
|
|
6632
6636
|
responses: {},
|
|
6633
|
-
sendMessage(
|
|
6637
|
+
sendMessage(e, s) {
|
|
6634
6638
|
},
|
|
6635
6639
|
counters: {
|
|
6636
|
-
get(
|
|
6640
|
+
get(e) {
|
|
6637
6641
|
return null;
|
|
6638
6642
|
}
|
|
6639
6643
|
},
|
|
6640
|
-
sanitize(
|
|
6641
|
-
return
|
|
6644
|
+
sanitize(e) {
|
|
6645
|
+
return e;
|
|
6642
6646
|
},
|
|
6643
|
-
cheerFilter(
|
|
6644
|
-
return
|
|
6647
|
+
cheerFilter(e) {
|
|
6648
|
+
return e;
|
|
6645
6649
|
},
|
|
6646
|
-
setField(
|
|
6650
|
+
setField(e, s, i) {
|
|
6647
6651
|
},
|
|
6648
6652
|
store: {
|
|
6649
|
-
set: function(
|
|
6650
|
-
this.list[
|
|
6653
|
+
set: function(e, s) {
|
|
6654
|
+
this.list[e] = s, localStorage.setItem("SE_API-STORE", JSON.stringify(F.store.list));
|
|
6651
6655
|
},
|
|
6652
|
-
get: async function(
|
|
6653
|
-
return this.list[
|
|
6656
|
+
get: async function(e) {
|
|
6657
|
+
return this.list[e] ? this.list[e] : null;
|
|
6654
6658
|
},
|
|
6655
6659
|
list: {}
|
|
6656
6660
|
}
|
|
6657
6661
|
};
|
|
6658
|
-
async function
|
|
6659
|
-
let
|
|
6660
|
-
return
|
|
6662
|
+
async function mt() {
|
|
6663
|
+
let e = localStorage.getItem("SE_API-STORE") ?? "", s = e ? JSON.parse(e) : {};
|
|
6664
|
+
return F.store.list = s, F;
|
|
6661
6665
|
}
|
|
6662
|
-
class
|
|
6666
|
+
class W {
|
|
6663
6667
|
/**
|
|
6664
6668
|
* Stores registered event listeners.
|
|
6665
6669
|
*/
|
|
@@ -6670,63 +6674,63 @@ class N {
|
|
|
6670
6674
|
* @param eventName The name of the event.
|
|
6671
6675
|
* @param args Arguments to pass to the listeners.
|
|
6672
6676
|
*/
|
|
6673
|
-
emit(
|
|
6674
|
-
return (this.registeredEvents[
|
|
6677
|
+
emit(s, ...i) {
|
|
6678
|
+
return (this.registeredEvents[s] || []).map((o) => o.apply(this, i));
|
|
6675
6679
|
}
|
|
6676
6680
|
/**
|
|
6677
6681
|
* Registers an event listener.
|
|
6678
6682
|
* @param eventName The name of the event.
|
|
6679
6683
|
* @param callback The callback function.
|
|
6680
6684
|
*/
|
|
6681
|
-
on(
|
|
6682
|
-
if (typeof
|
|
6685
|
+
on(s, i) {
|
|
6686
|
+
if (typeof i != "function")
|
|
6683
6687
|
throw new TypeError("Callback must be a function");
|
|
6684
|
-
return this.registeredEvents[
|
|
6688
|
+
return this.registeredEvents[s] || (this.registeredEvents[s] = []), this.registeredEvents[s].push(i), this;
|
|
6685
6689
|
}
|
|
6686
6690
|
/**
|
|
6687
6691
|
* Removes a specific event listener.
|
|
6688
6692
|
* @param eventName The name of the event.
|
|
6689
6693
|
* @param callback The callback function to remove.
|
|
6690
6694
|
*/
|
|
6691
|
-
off(
|
|
6692
|
-
const
|
|
6693
|
-
return
|
|
6695
|
+
off(s, i) {
|
|
6696
|
+
const d = this.registeredEvents[s] || [];
|
|
6697
|
+
return i ? (this.registeredEvents[s] = d.filter((o) => o !== i), this) : (this.registeredEvents[s] = [], this);
|
|
6694
6698
|
}
|
|
6695
6699
|
/**
|
|
6696
6700
|
* Registers a listener that is executed only once.
|
|
6697
6701
|
* @param eventName The name of the event.
|
|
6698
6702
|
* @param callback The callback function.
|
|
6699
6703
|
*/
|
|
6700
|
-
once(
|
|
6701
|
-
const
|
|
6702
|
-
this.off(
|
|
6704
|
+
once(s, i) {
|
|
6705
|
+
const d = (...o) => {
|
|
6706
|
+
this.off(s, d), i.apply(this, o);
|
|
6703
6707
|
};
|
|
6704
|
-
return this.on(
|
|
6708
|
+
return this.on(s, d), this;
|
|
6705
6709
|
}
|
|
6706
6710
|
/**
|
|
6707
6711
|
* Removes all listeners for a specific event.
|
|
6708
6712
|
* @param eventName The name of the event.
|
|
6709
6713
|
*/
|
|
6710
|
-
removeAllListeners(
|
|
6711
|
-
return this.registeredEvents[
|
|
6714
|
+
removeAllListeners(s) {
|
|
6715
|
+
return this.registeredEvents[s] = [], this;
|
|
6712
6716
|
}
|
|
6713
6717
|
}
|
|
6714
|
-
var
|
|
6715
|
-
class
|
|
6718
|
+
var N = [];
|
|
6719
|
+
class _ extends W {
|
|
6716
6720
|
/**
|
|
6717
6721
|
* The unique identifier for the storage instance.
|
|
6718
6722
|
*/
|
|
6719
6723
|
id = "default";
|
|
6720
6724
|
loaded = !1;
|
|
6721
6725
|
data;
|
|
6722
|
-
constructor(
|
|
6723
|
-
super(), this.id =
|
|
6726
|
+
constructor(s) {
|
|
6727
|
+
super(), this.id = s.id || this.id, this.data = s.data ?? {}, N.push(this), this.start();
|
|
6724
6728
|
}
|
|
6725
6729
|
SE_API = null;
|
|
6726
6730
|
start() {
|
|
6727
|
-
|
|
6728
|
-
this.SE_API =
|
|
6729
|
-
this.data =
|
|
6731
|
+
Y?.then((s) => {
|
|
6732
|
+
this.SE_API = s, s.store.get(this.id).then((i) => {
|
|
6733
|
+
this.data = i ?? this.data, this.loaded = !0, this.emit("load", this.data), JSON.stringify(this.data) !== JSON.stringify(i) && this.emit("update", this.data);
|
|
6730
6734
|
}).catch(() => {
|
|
6731
6735
|
this.loaded = !0, this.emit("load", this.data);
|
|
6732
6736
|
});
|
|
@@ -6736,23 +6740,23 @@ class W extends N {
|
|
|
6736
6740
|
* Saves the current data to storage.
|
|
6737
6741
|
* @param data Data to save (defaults to current)
|
|
6738
6742
|
*/
|
|
6739
|
-
save(
|
|
6740
|
-
this.loaded && this.SE_API && (this.data =
|
|
6743
|
+
save(s = this.data) {
|
|
6744
|
+
this.loaded && this.SE_API && (this.data = s, this.SE_API.store.set(this.id, this.data), this.emit("update", this.data));
|
|
6741
6745
|
}
|
|
6742
6746
|
/**
|
|
6743
6747
|
* Updates the storage data and emits an update event
|
|
6744
6748
|
* @param data Data to update (defaults to current)
|
|
6745
6749
|
*/
|
|
6746
|
-
update(
|
|
6747
|
-
this.loaded && JSON.stringify(this.data) !== JSON.stringify(
|
|
6750
|
+
update(s = this.data) {
|
|
6751
|
+
this.loaded && JSON.stringify(this.data) !== JSON.stringify(s) && (this.data = { ...this.data, ...s }, this.save(this.data));
|
|
6748
6752
|
}
|
|
6749
6753
|
/**
|
|
6750
6754
|
* Adds a value to the storage at the specified path.
|
|
6751
6755
|
* @param path Path to add the value to
|
|
6752
6756
|
* @param value Value to add
|
|
6753
6757
|
*/
|
|
6754
|
-
add(
|
|
6755
|
-
this.loaded && (
|
|
6758
|
+
add(s, i) {
|
|
6759
|
+
this.loaded && (_.setByPath(this.data, s, i), this.save(this.data));
|
|
6756
6760
|
}
|
|
6757
6761
|
/**
|
|
6758
6762
|
* Clears all data from the storage.
|
|
@@ -6767,25 +6771,25 @@ class W extends N {
|
|
|
6767
6771
|
* @param value The value to set
|
|
6768
6772
|
* @returns The updated object
|
|
6769
6773
|
*/
|
|
6770
|
-
static setByPath(
|
|
6771
|
-
const
|
|
6772
|
-
let
|
|
6773
|
-
for (let
|
|
6774
|
-
(typeof
|
|
6775
|
-
return
|
|
6774
|
+
static setByPath(s, i, d) {
|
|
6775
|
+
const o = i.split(".");
|
|
6776
|
+
let t = s;
|
|
6777
|
+
for (let a = 0; a < o.length - 1; a++)
|
|
6778
|
+
(typeof t[o[a]] != "object" || t[o[a]] == null) && (t[o[a]] = {}), t = t[o[a]];
|
|
6779
|
+
return t[o[o.length - 1]] = d, t;
|
|
6776
6780
|
}
|
|
6777
|
-
on(
|
|
6778
|
-
return
|
|
6781
|
+
on(s, i) {
|
|
6782
|
+
return s === "load" && this.loaded ? (i.apply(this, [this.data]), this) : (super.on(s, i), this);
|
|
6779
6783
|
}
|
|
6780
6784
|
}
|
|
6781
|
-
class
|
|
6785
|
+
class T extends W {
|
|
6782
6786
|
id = "default";
|
|
6783
6787
|
storage;
|
|
6784
6788
|
fields = {};
|
|
6785
6789
|
session;
|
|
6786
6790
|
loaded = !1;
|
|
6787
|
-
constructor(
|
|
6788
|
-
super(), this.id =
|
|
6791
|
+
constructor(s) {
|
|
6792
|
+
super(), this.id = s.id || this.id, this.storage = new _({
|
|
6789
6793
|
id: this.id,
|
|
6790
6794
|
data: {
|
|
6791
6795
|
user: {},
|
|
@@ -6805,8 +6809,8 @@ class E extends N {
|
|
|
6805
6809
|
pronoun: 60,
|
|
6806
6810
|
emote: 120
|
|
6807
6811
|
};
|
|
6808
|
-
on(
|
|
6809
|
-
return
|
|
6812
|
+
on(s, i) {
|
|
6813
|
+
return s === "load" && this.loaded ? (i.apply(this, [
|
|
6810
6814
|
{
|
|
6811
6815
|
channel: this.details.user,
|
|
6812
6816
|
currency: this.details.currency,
|
|
@@ -6823,10 +6827,10 @@ class E extends N {
|
|
|
6823
6827
|
overlay: this.details.overlay,
|
|
6824
6828
|
emulated: !1
|
|
6825
6829
|
}
|
|
6826
|
-
]), this) : (super.on(
|
|
6830
|
+
]), this) : (super.on(s, i), this);
|
|
6827
6831
|
}
|
|
6828
6832
|
}
|
|
6829
|
-
class
|
|
6833
|
+
class L {
|
|
6830
6834
|
prefix = "!";
|
|
6831
6835
|
name;
|
|
6832
6836
|
description;
|
|
@@ -6835,58 +6839,58 @@ class M {
|
|
|
6835
6839
|
aliases = [];
|
|
6836
6840
|
permissions = void 0;
|
|
6837
6841
|
admins = [];
|
|
6838
|
-
constructor(
|
|
6839
|
-
window.client instanceof
|
|
6842
|
+
constructor(s) {
|
|
6843
|
+
window.client instanceof T && (this.prefix = s.prefix ?? this.prefix, this.name = s.name, this.description = s.description ?? this.description, this.arguments = s.arguments ?? this.arguments, this.run = s.run, this.test = s.test ?? this.test, this.aliases = s.aliases ?? this.aliases, this.permissions = s.permissions ?? this.permissions, this.admins = s.admins ?? this.admins, window.client.actions.commands.push(this), window.client.emit("action", this, "created"));
|
|
6840
6844
|
}
|
|
6841
|
-
run(
|
|
6845
|
+
run(s, i) {
|
|
6842
6846
|
}
|
|
6843
|
-
verify(
|
|
6844
|
-
return this.arguments === !0 && (!
|
|
6847
|
+
verify(s, i, d) {
|
|
6848
|
+
return this.arguments === !0 && (!d || !d.length) ? !1 : this.admins.some((o) => s.toLocaleLowerCase() === o.toLocaleLowerCase()) ? !0 : this.permissions === !0 || typeof this.permissions > "u" || Array.isArray(this.permissions) && !this.permissions.length ? !1 : !!(Array.isArray(this.permissions) && this.permissions.some((o) => s.toLowerCase() === o.toLowerCase() || i.map((t) => t.toLowerCase()).includes(o.toLowerCase())));
|
|
6845
6849
|
}
|
|
6846
|
-
parse(
|
|
6847
|
-
if (!(window.client instanceof
|
|
6848
|
-
const
|
|
6849
|
-
var
|
|
6850
|
-
const
|
|
6851
|
-
switch (
|
|
6850
|
+
parse(s, i) {
|
|
6851
|
+
if (!(window.client instanceof T)) return !1;
|
|
6852
|
+
const d = s.replace(this.prefix, "").split(" ").slice(1).map((r) => r.trim());
|
|
6853
|
+
var o = "", t = [];
|
|
6854
|
+
const a = { bits: "cheer", premium: "prime" };
|
|
6855
|
+
switch (i.provider) {
|
|
6852
6856
|
case "twitch": {
|
|
6853
|
-
const
|
|
6854
|
-
|
|
6857
|
+
const r = i.data;
|
|
6858
|
+
o = r.event.data.nick || r.event.data.displayName, r.event.data.tags?.badges && (t = r.event.data.tags.badges.toString().replace(/\/\d+/g, "").split(",").map((u) => u in a ? a[u] : u));
|
|
6855
6859
|
break;
|
|
6856
6860
|
}
|
|
6857
6861
|
case "youtube": {
|
|
6858
|
-
const
|
|
6862
|
+
const r = i.data, h = {
|
|
6859
6863
|
isVerified: "verified",
|
|
6860
6864
|
isChatOwner: "owner",
|
|
6861
6865
|
isChatSponsor: "sponsor",
|
|
6862
6866
|
isChatModerator: "moderator"
|
|
6863
6867
|
};
|
|
6864
|
-
|
|
6868
|
+
o = r.event.data.nick || r.event.data.displayName, t = Object.entries(r.event.data.authorDetails).filter(([u, l]) => u.startsWith("is") && l).map(([u]) => h[u]).filter(Boolean);
|
|
6865
6869
|
break;
|
|
6866
6870
|
}
|
|
6867
6871
|
case "kick":
|
|
6868
6872
|
return !1;
|
|
6869
6873
|
}
|
|
6870
|
-
const
|
|
6871
|
-
return
|
|
6874
|
+
const n = this.verify(o, t, d);
|
|
6875
|
+
return n === !0 && this.run.apply(window.client, [d, i]), n;
|
|
6872
6876
|
}
|
|
6873
6877
|
remove() {
|
|
6874
|
-
if (!(window.client instanceof
|
|
6875
|
-
const
|
|
6876
|
-
|
|
6878
|
+
if (!(window.client instanceof T)) return;
|
|
6879
|
+
const s = window.client.actions.commands.indexOf(this);
|
|
6880
|
+
s > -1 && (window.client.actions.commands.splice(s, 1), window.client.emit("action", this, "removed"));
|
|
6877
6881
|
}
|
|
6878
|
-
static execute(
|
|
6879
|
-
if (!(window.client instanceof
|
|
6880
|
-
const
|
|
6882
|
+
static execute(s) {
|
|
6883
|
+
if (!(window.client instanceof T)) return !1;
|
|
6884
|
+
const i = s.data;
|
|
6881
6885
|
try {
|
|
6882
|
-
if (window.client.actions.commands.length && window.client.actions.commands.some((
|
|
6883
|
-
const
|
|
6884
|
-
var
|
|
6885
|
-
return
|
|
6886
|
+
if (window.client.actions.commands.length && window.client.actions.commands.some((d) => i.event.data.text.startsWith(d.prefix))) {
|
|
6887
|
+
const d = window.client.actions.commands.filter((o) => {
|
|
6888
|
+
var t = [o.name, ...o.aliases ?? []], a = i.event.data.text.replace(o.prefix, "").split(" ")[0];
|
|
6889
|
+
return t.includes(a);
|
|
6886
6890
|
});
|
|
6887
|
-
if (
|
|
6888
|
-
return
|
|
6889
|
-
|
|
6891
|
+
if (d.length && d.every((o) => o instanceof L))
|
|
6892
|
+
return d.forEach((o) => {
|
|
6893
|
+
o.parse(i.event.data.text, s), window.client.emit("action", o, "executed"), z.received(`Command executed: ${i.event.data.text} by ${i.event.data.nick || i.event.data.displayName}`, i);
|
|
6890
6894
|
}), !0;
|
|
6891
6895
|
}
|
|
6892
6896
|
} catch {
|
|
@@ -6896,7 +6900,7 @@ class M {
|
|
|
6896
6900
|
}
|
|
6897
6901
|
}
|
|
6898
6902
|
}
|
|
6899
|
-
class
|
|
6903
|
+
class ut extends W {
|
|
6900
6904
|
queue = [];
|
|
6901
6905
|
priorityQueue = [];
|
|
6902
6906
|
history = [];
|
|
@@ -6905,20 +6909,20 @@ class mt extends N {
|
|
|
6905
6909
|
duration = void 0;
|
|
6906
6910
|
loaded = !1;
|
|
6907
6911
|
processor;
|
|
6908
|
-
constructor(
|
|
6909
|
-
window.client instanceof
|
|
6912
|
+
constructor(s) {
|
|
6913
|
+
window.client instanceof T && (super(), this.duration = s.duration, this.processor = s.processor, window.client.on("load", () => {
|
|
6910
6914
|
this.emit("load"), this.loaded = !0;
|
|
6911
6915
|
}));
|
|
6912
6916
|
}
|
|
6913
|
-
enqueue(
|
|
6914
|
-
const
|
|
6917
|
+
enqueue(s, i = {}) {
|
|
6918
|
+
const d = {
|
|
6915
6919
|
isoDate: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6916
|
-
isLoop:
|
|
6917
|
-
isPriority:
|
|
6918
|
-
isImmediate:
|
|
6919
|
-
value:
|
|
6920
|
-
},
|
|
6921
|
-
return
|
|
6920
|
+
isLoop: i?.isLoop ?? !1,
|
|
6921
|
+
isPriority: i?.isPriority ?? !1,
|
|
6922
|
+
isImmediate: i?.isImmediate ?? !1,
|
|
6923
|
+
value: s
|
|
6924
|
+
}, o = this.hasItems();
|
|
6925
|
+
return d.isPriority && d.isImmediate ? (this.cancel(), this.priorityQueue.unshift(d)) : (d.isPriority ? this.priorityQueue : this.queue).push(d), this.running === !1 && o === !1 && this.run(), this.emit("update", this.queue, this.priorityQueue, this.history, this.timeouts), this;
|
|
6922
6926
|
}
|
|
6923
6927
|
async run() {
|
|
6924
6928
|
if (!this.hasItems()) {
|
|
@@ -6928,68 +6932,68 @@ class mt extends N {
|
|
|
6928
6932
|
this.running = !0, await this.next(), typeof this.duration == "number" && this.duration > 0 ? this.timeouts.push(setTimeout(() => this.run(), this.duration)) : (this.duration === 0 || this.duration !== -1 && this.duration !== !1) && this.run();
|
|
6929
6933
|
}
|
|
6930
6934
|
async next() {
|
|
6931
|
-
const
|
|
6932
|
-
if (!
|
|
6935
|
+
const s = this.priorityQueue.length > 0 ? this.priorityQueue.shift() : this.queue.shift();
|
|
6936
|
+
if (!s) {
|
|
6933
6937
|
this.running = !1;
|
|
6934
6938
|
return;
|
|
6935
6939
|
}
|
|
6936
6940
|
try {
|
|
6937
|
-
await this.processor.apply(this, [
|
|
6938
|
-
} catch (
|
|
6939
|
-
|
|
6941
|
+
await this.processor.apply(this, [s.value, this]), this.emit("process", s, this);
|
|
6942
|
+
} catch (d) {
|
|
6943
|
+
z.error(`Error during item processing: ${d instanceof Error ? d.message : String(d)}`);
|
|
6940
6944
|
}
|
|
6941
|
-
this.history.push(
|
|
6942
|
-
const
|
|
6943
|
-
|
|
6945
|
+
this.history.push(s);
|
|
6946
|
+
const i = s.isPriority ? this.priorityQueue : this.queue;
|
|
6947
|
+
s.isLoop && i.push(s);
|
|
6944
6948
|
}
|
|
6945
6949
|
resume() {
|
|
6946
6950
|
return this.running && this.cancel(), this.hasItems() && this.run(), this;
|
|
6947
6951
|
}
|
|
6948
|
-
update(
|
|
6949
|
-
return this.queue =
|
|
6952
|
+
update(s) {
|
|
6953
|
+
return this.queue = s.queue ?? this.queue, this.priorityQueue = s.priorityQueue ?? this.priorityQueue, this.history = s.history ?? this.history, this.hasItems() && this.running === !1 && window.client?.on("load", () => this.run()), this;
|
|
6950
6954
|
}
|
|
6951
6955
|
cancel() {
|
|
6952
|
-
this.running && (this.timeouts.forEach((
|
|
6956
|
+
this.running && (this.timeouts.forEach((s) => clearTimeout(s)), this.timeouts = [], this.running = !1, this.emit("cancel"));
|
|
6953
6957
|
}
|
|
6954
6958
|
hasItems() {
|
|
6955
6959
|
return this.queue.length > 0 || this.priorityQueue.length > 0;
|
|
6956
6960
|
}
|
|
6957
|
-
on(
|
|
6958
|
-
return
|
|
6961
|
+
on(s, i) {
|
|
6962
|
+
return s === "load" && this.loaded ? (i.apply(this), this) : (super.on(s, i), this);
|
|
6959
6963
|
}
|
|
6960
6964
|
}
|
|
6961
|
-
class
|
|
6965
|
+
class V {
|
|
6962
6966
|
field = "button";
|
|
6963
6967
|
template = "button";
|
|
6964
6968
|
run;
|
|
6965
|
-
constructor(
|
|
6966
|
-
window.client instanceof
|
|
6969
|
+
constructor(s) {
|
|
6970
|
+
window.client instanceof T && (this.field = s.field ?? this.field, this.template = s.template ?? this.template, this.run = s.run, window.client.actions.buttons.push(this), window.client.emit("action", this, "created"));
|
|
6967
6971
|
}
|
|
6968
|
-
parse(
|
|
6969
|
-
var
|
|
6972
|
+
parse(s, i) {
|
|
6973
|
+
var d = s.replace(typeof this.field == "string" ? this.field : this.template.replace(/\{[^}]*\}/g, "") ?? "", "").trim();
|
|
6970
6974
|
try {
|
|
6971
|
-
this.run.apply(window.client, [
|
|
6972
|
-
} catch (
|
|
6973
|
-
throw new Error(`Error running button "${this.field}": ${
|
|
6975
|
+
this.run.apply(window.client, [d.length ? d : s ?? s, i]);
|
|
6976
|
+
} catch (o) {
|
|
6977
|
+
throw new Error(`Error running button "${this.field}": ${o instanceof Error ? o.message : o}`);
|
|
6974
6978
|
}
|
|
6975
6979
|
return this;
|
|
6976
6980
|
}
|
|
6977
6981
|
remove() {
|
|
6978
|
-
if (!(window.client instanceof
|
|
6979
|
-
const
|
|
6980
|
-
|
|
6982
|
+
if (!(window.client instanceof T)) return;
|
|
6983
|
+
const s = window.client.actions.buttons.indexOf(this);
|
|
6984
|
+
s > -1 && (window.client.actions.buttons.splice(s, 1), window.client.emit("action", this, "removed"));
|
|
6981
6985
|
}
|
|
6982
|
-
static execute(
|
|
6986
|
+
static execute(s, i) {
|
|
6983
6987
|
try {
|
|
6984
|
-
if (!(window.client instanceof
|
|
6988
|
+
if (!(window.client instanceof T)) return !1;
|
|
6985
6989
|
if (window.client.actions.buttons.length) {
|
|
6986
|
-
const
|
|
6987
|
-
if (
|
|
6988
|
-
return
|
|
6990
|
+
const d = window.client.actions.buttons.filter((o) => typeof o.field == "string" ? o.field === s : typeof o.field == "function" ? o.field(s, i) : !1);
|
|
6991
|
+
if (d.length && d.every((o) => o instanceof V))
|
|
6992
|
+
return d.forEach((o) => {
|
|
6989
6993
|
try {
|
|
6990
|
-
|
|
6991
|
-
} catch (
|
|
6992
|
-
|
|
6994
|
+
o.parse(s, i), window.client.emit("action", o, "executed"), z.received(`Button executed: ${s}${i ? ` with value: ${i}` : ""}`);
|
|
6995
|
+
} catch (t) {
|
|
6996
|
+
z.error(`Error executing button "${s}": ${t instanceof Error ? t.message : t}`);
|
|
6993
6997
|
}
|
|
6994
6998
|
}), !0;
|
|
6995
6999
|
}
|
|
@@ -7000,7 +7004,7 @@ class _ {
|
|
|
7000
7004
|
}
|
|
7001
7005
|
}
|
|
7002
7006
|
}
|
|
7003
|
-
class
|
|
7007
|
+
class K {
|
|
7004
7008
|
enabled;
|
|
7005
7009
|
prefix;
|
|
7006
7010
|
error = this.apply({
|
|
@@ -7069,244 +7073,244 @@ class B {
|
|
|
7069
7073
|
fontSize: 14,
|
|
7070
7074
|
icon: "☼"
|
|
7071
7075
|
});
|
|
7072
|
-
constructor(
|
|
7073
|
-
this.enabled =
|
|
7076
|
+
constructor(s = {}) {
|
|
7077
|
+
this.enabled = s.enabled ?? !0, this.prefix = s.prefix ? `[${s.prefix}]` : "";
|
|
7074
7078
|
}
|
|
7075
|
-
apply(
|
|
7076
|
-
const
|
|
7077
|
-
return (...
|
|
7079
|
+
apply(s) {
|
|
7080
|
+
const i = this.style(s), d = s.icon ? `${s.icon} ` : "";
|
|
7081
|
+
return (...o) => {
|
|
7078
7082
|
if (!this.enabled || typeof console > "u") return;
|
|
7079
|
-
const
|
|
7080
|
-
if (
|
|
7081
|
-
typeof
|
|
7082
|
-
}),
|
|
7083
|
-
const
|
|
7084
|
-
console.log(`%c${
|
|
7085
|
-
} else
|
|
7083
|
+
const t = this.prefix ? `${this.prefix} ` : "", a = [], n = [];
|
|
7084
|
+
if (o.forEach((r) => {
|
|
7085
|
+
typeof r == "string" || typeof r == "number" || typeof r == "boolean" ? a.push(r) : n.push(r);
|
|
7086
|
+
}), a.length > 0) {
|
|
7087
|
+
const r = a.join(" ");
|
|
7088
|
+
console.log(`%c${d}${t}${r}`, i, ...n);
|
|
7089
|
+
} else n.length > 0 && console.log(`%c${d}${t}`, i, ...n);
|
|
7086
7090
|
};
|
|
7087
7091
|
}
|
|
7088
|
-
style(
|
|
7089
|
-
const
|
|
7090
|
-
return
|
|
7092
|
+
style(s) {
|
|
7093
|
+
const i = [];
|
|
7094
|
+
return s.background && s.background !== "transparent" && (i.push(`background: ${s.background}`), i.push("padding: 2px 6px"), i.push("border-radius: 3px")), s.color && i.push(`color: ${s.color}`), s.bold && i.push("font-weight: bold"), s.italic && i.push("font-style: italic"), s.fontSize && i.push(`font-size: ${s.fontSize}px`), i.join("; ");
|
|
7091
7095
|
}
|
|
7092
|
-
group(
|
|
7093
|
-
!this.enabled || !console.group || console.group(
|
|
7096
|
+
group(s) {
|
|
7097
|
+
!this.enabled || !console.group || console.group(s);
|
|
7094
7098
|
}
|
|
7095
|
-
groupCollapsed(
|
|
7096
|
-
!this.enabled || !console.groupCollapsed || console.groupCollapsed(
|
|
7099
|
+
groupCollapsed(s) {
|
|
7100
|
+
!this.enabled || !console.groupCollapsed || console.groupCollapsed(s);
|
|
7097
7101
|
}
|
|
7098
7102
|
groupEnd() {
|
|
7099
7103
|
!this.enabled || !console.groupEnd || console.groupEnd();
|
|
7100
7104
|
}
|
|
7101
|
-
table(
|
|
7102
|
-
!this.enabled || !console.table || console.table(
|
|
7105
|
+
table(s) {
|
|
7106
|
+
!this.enabled || !console.table || console.table(s);
|
|
7103
7107
|
}
|
|
7104
|
-
time(
|
|
7105
|
-
!this.enabled || !console.time || console.time(
|
|
7108
|
+
time(s) {
|
|
7109
|
+
!this.enabled || !console.time || console.time(s);
|
|
7106
7110
|
}
|
|
7107
|
-
timeEnd(
|
|
7108
|
-
!this.enabled || !console.timeEnd || console.timeEnd(
|
|
7111
|
+
timeEnd(s) {
|
|
7112
|
+
!this.enabled || !console.timeEnd || console.timeEnd(s);
|
|
7109
7113
|
}
|
|
7110
7114
|
}
|
|
7111
7115
|
window.addEventListener("load", () => {
|
|
7112
7116
|
});
|
|
7113
|
-
window.addEventListener("onWidgetLoad", async (
|
|
7114
|
-
const { detail:
|
|
7115
|
-
if (window.client instanceof
|
|
7116
|
-
const
|
|
7117
|
-
|
|
7118
|
-
...
|
|
7119
|
-
user:
|
|
7120
|
-
currency:
|
|
7121
|
-
overlay:
|
|
7122
|
-
},
|
|
7123
|
-
if (
|
|
7124
|
-
return
|
|
7125
|
-
|
|
7117
|
+
window.addEventListener("onWidgetLoad", async (e) => {
|
|
7118
|
+
const { detail: s } = e;
|
|
7119
|
+
if (window.client instanceof T) {
|
|
7120
|
+
const i = window.client;
|
|
7121
|
+
i.fields = s.fieldData, i.session = s.session.data, i.details = {
|
|
7122
|
+
...i.details,
|
|
7123
|
+
user: s.channel,
|
|
7124
|
+
currency: s.currency,
|
|
7125
|
+
overlay: s.overlay
|
|
7126
|
+
}, s.channel.id && !s.emulated ? await fetch(`https://api.streamelements.com/kappa/v2/channels/${s.channel.id}/`).then((d) => d.json()).then((d) => {
|
|
7127
|
+
if (d.provider)
|
|
7128
|
+
return i.details.provider = d.provider, d.provider;
|
|
7129
|
+
i.details.provider = "local";
|
|
7126
7130
|
}).catch(() => {
|
|
7127
|
-
|
|
7128
|
-
}) :
|
|
7129
|
-
if (
|
|
7130
|
-
const
|
|
7131
|
-
const
|
|
7132
|
-
for (const g in
|
|
7133
|
-
if (
|
|
7134
|
-
const f =
|
|
7135
|
-
f.expire && f.expire >
|
|
7131
|
+
i.details.provider = "local";
|
|
7132
|
+
}) : i.details.provider = "local", i.emit("load", s), i.loaded = !0, i.storage.on("load", (d) => {
|
|
7133
|
+
if (d) {
|
|
7134
|
+
const o = (h) => {
|
|
7135
|
+
const u = Date.now(), l = {};
|
|
7136
|
+
for (const g in h)
|
|
7137
|
+
if (h.hasOwnProperty(g)) {
|
|
7138
|
+
const f = h[g];
|
|
7139
|
+
f.expire && f.expire > u && (l[g] = f);
|
|
7136
7140
|
}
|
|
7137
|
-
return
|
|
7138
|
-
},
|
|
7139
|
-
|
|
7140
|
-
user:
|
|
7141
|
-
avatar:
|
|
7142
|
-
pronoun:
|
|
7143
|
-
emote:
|
|
7141
|
+
return l;
|
|
7142
|
+
}, t = o(d.user || {}), a = o(d.avatar || {}), n = o(d.pronoun || {}), r = o(d.emote || {});
|
|
7143
|
+
i.storage.update({
|
|
7144
|
+
user: t,
|
|
7145
|
+
avatar: a,
|
|
7146
|
+
pronoun: n,
|
|
7147
|
+
emote: r
|
|
7144
7148
|
});
|
|
7145
7149
|
}
|
|
7146
|
-
|
|
7147
|
-
value:
|
|
7150
|
+
s.channel.providerId.length && i.storage.add(`avatar.${s.channel.providerId.toLowerCase()}`, {
|
|
7151
|
+
value: s.channel.avatar,
|
|
7148
7152
|
timestamp: Date.now(),
|
|
7149
|
-
expire: Date.now() +
|
|
7153
|
+
expire: Date.now() + i.cache.avatar * 60 * 1e3
|
|
7150
7154
|
});
|
|
7151
7155
|
});
|
|
7152
7156
|
}
|
|
7153
7157
|
});
|
|
7154
|
-
window.addEventListener("onSessionUpdate", (
|
|
7155
|
-
const { detail:
|
|
7156
|
-
if (window.client instanceof
|
|
7157
|
-
const
|
|
7158
|
-
|
|
7158
|
+
window.addEventListener("onSessionUpdate", (e) => {
|
|
7159
|
+
const { detail: s } = e;
|
|
7160
|
+
if (window.client instanceof T) {
|
|
7161
|
+
const i = window.client;
|
|
7162
|
+
i.session = s.session, i.emit("session", s.session);
|
|
7159
7163
|
}
|
|
7160
7164
|
});
|
|
7161
|
-
window.addEventListener("onEventReceived", ({ detail:
|
|
7162
|
-
if (window.client instanceof
|
|
7163
|
-
var
|
|
7164
|
-
["kvstore:update", "bot:counter", "alertService:toggleSound", "event:skip", "tip-latest", "event:test"].some((
|
|
7165
|
-
const
|
|
7166
|
-
switch (
|
|
7165
|
+
window.addEventListener("onEventReceived", ({ detail: e }) => {
|
|
7166
|
+
if (window.client instanceof T) {
|
|
7167
|
+
var s = e.event?.provider || e.event?.service || e.event?.data?.provider || window.client.details.provider;
|
|
7168
|
+
["kvstore:update", "bot:counter", "alertService:toggleSound", "event:skip", "tip-latest", "event:test"].some((t) => t === e.listener) && (s = "streamelements");
|
|
7169
|
+
const o = { provider: s, data: e };
|
|
7170
|
+
switch (o.provider) {
|
|
7167
7171
|
case "streamelements": {
|
|
7168
|
-
const
|
|
7169
|
-
switch (
|
|
7172
|
+
const t = o.data;
|
|
7173
|
+
switch (t.listener) {
|
|
7170
7174
|
case "tip-latest": {
|
|
7171
|
-
|
|
7175
|
+
t.event;
|
|
7172
7176
|
break;
|
|
7173
7177
|
}
|
|
7174
7178
|
case "event:skip": {
|
|
7175
|
-
|
|
7179
|
+
t.event;
|
|
7176
7180
|
break;
|
|
7177
7181
|
}
|
|
7178
7182
|
case "event:test": {
|
|
7179
|
-
switch (
|
|
7183
|
+
switch (t.event.listener) {
|
|
7180
7184
|
case "widget-button": {
|
|
7181
|
-
const
|
|
7182
|
-
|
|
7185
|
+
const a = t.event;
|
|
7186
|
+
V.execute(a.field, a.value);
|
|
7183
7187
|
break;
|
|
7184
7188
|
}
|
|
7185
7189
|
case "subscriber-latest": {
|
|
7186
|
-
|
|
7190
|
+
t.event;
|
|
7187
7191
|
break;
|
|
7188
7192
|
}
|
|
7189
7193
|
}
|
|
7190
7194
|
break;
|
|
7191
7195
|
}
|
|
7192
7196
|
case "kvstore:update": {
|
|
7193
|
-
const
|
|
7194
|
-
if (
|
|
7195
|
-
var
|
|
7196
|
-
|
|
7197
|
+
const a = t.event;
|
|
7198
|
+
if (N.length) {
|
|
7199
|
+
var i = N.find((n) => n.id === a.data.key.replace("customWidget.", ""));
|
|
7200
|
+
i && i.update(a.data.value);
|
|
7197
7201
|
}
|
|
7198
7202
|
break;
|
|
7199
7203
|
}
|
|
7200
7204
|
case "bot:counter": {
|
|
7201
|
-
|
|
7205
|
+
t.event;
|
|
7202
7206
|
break;
|
|
7203
7207
|
}
|
|
7204
7208
|
case "alertService:toggleSound": {
|
|
7205
|
-
const
|
|
7206
|
-
client.details.overlay.muted = !!
|
|
7209
|
+
const a = t.event;
|
|
7210
|
+
client.details.overlay.muted = !!a.muted;
|
|
7207
7211
|
break;
|
|
7208
7212
|
}
|
|
7209
7213
|
}
|
|
7210
|
-
window.client.emit("event", "streamelements",
|
|
7214
|
+
window.client.emit("event", "streamelements", o.data);
|
|
7211
7215
|
break;
|
|
7212
7216
|
}
|
|
7213
7217
|
case "twitch": {
|
|
7214
|
-
const
|
|
7215
|
-
switch (
|
|
7218
|
+
const t = o.data;
|
|
7219
|
+
switch (t.listener) {
|
|
7216
7220
|
case "delete-message": {
|
|
7217
|
-
|
|
7221
|
+
t.event;
|
|
7218
7222
|
break;
|
|
7219
7223
|
}
|
|
7220
7224
|
case "delete-messages": {
|
|
7221
|
-
|
|
7225
|
+
t.event;
|
|
7222
7226
|
break;
|
|
7223
7227
|
}
|
|
7224
7228
|
case "message": {
|
|
7225
|
-
|
|
7229
|
+
t.event, L.execute({ provider: "twitch", data: t });
|
|
7226
7230
|
break;
|
|
7227
7231
|
}
|
|
7228
7232
|
case "follower-latest": {
|
|
7229
|
-
|
|
7233
|
+
t.event;
|
|
7230
7234
|
break;
|
|
7231
7235
|
}
|
|
7232
7236
|
case "cheer-latest": {
|
|
7233
|
-
|
|
7237
|
+
t.event;
|
|
7234
7238
|
break;
|
|
7235
7239
|
}
|
|
7236
7240
|
case "subscriber-latest": {
|
|
7237
|
-
(!
|
|
7241
|
+
(!t.event.gifted && !t.event.bulkGifted && !t.event.isCommunityGift || t.event.gifted && !t.event.bulkGifted && !t.event.isCommunityGift || t.event.gifted && !t.event.bulkGifted && t.event.isCommunityGift || !t.event.gifted && t.event.bulkGifted && !t.event.isCommunityGift) && t.event;
|
|
7238
7242
|
break;
|
|
7239
7243
|
}
|
|
7240
7244
|
case "raid-latest": {
|
|
7241
|
-
|
|
7245
|
+
t.event;
|
|
7242
7246
|
break;
|
|
7243
7247
|
}
|
|
7244
7248
|
}
|
|
7245
|
-
window.client.emit("event", "twitch",
|
|
7249
|
+
window.client.emit("event", "twitch", o.data);
|
|
7246
7250
|
break;
|
|
7247
7251
|
}
|
|
7248
7252
|
case "youtube": {
|
|
7249
|
-
const
|
|
7250
|
-
switch (
|
|
7253
|
+
const t = o.data;
|
|
7254
|
+
switch (t.listener) {
|
|
7251
7255
|
case "message": {
|
|
7252
|
-
|
|
7256
|
+
t.event, L.execute({ provider: "youtube", data: t });
|
|
7253
7257
|
break;
|
|
7254
7258
|
}
|
|
7255
7259
|
case "subscriber-latest": {
|
|
7256
|
-
|
|
7260
|
+
t.event;
|
|
7257
7261
|
break;
|
|
7258
7262
|
}
|
|
7259
7263
|
case "sponsor-latest": {
|
|
7260
|
-
|
|
7264
|
+
t.event, (!t.event.gifted && !t.event.bulkGifted && !t.event.isCommunityGift || t.event.gifted && !t.event.bulkGifted && !t.event.isCommunityGift || t.event.gifted && !t.event.bulkGifted && t.event.isCommunityGift || !t.event.gifted && t.event.bulkGifted && !t.event.isCommunityGift) && t.event;
|
|
7261
7265
|
break;
|
|
7262
7266
|
}
|
|
7263
7267
|
case "superchat-latest": {
|
|
7264
|
-
|
|
7268
|
+
t.event;
|
|
7265
7269
|
break;
|
|
7266
7270
|
}
|
|
7267
7271
|
}
|
|
7268
|
-
window.client.emit("event", "youtube",
|
|
7272
|
+
window.client.emit("event", "youtube", o.data);
|
|
7269
7273
|
break;
|
|
7270
7274
|
}
|
|
7271
7275
|
case "kick": {
|
|
7272
|
-
window.client.emit("event", "kick",
|
|
7276
|
+
window.client.emit("event", "kick", o.data);
|
|
7273
7277
|
break;
|
|
7274
7278
|
}
|
|
7275
7279
|
case "facebook": {
|
|
7276
|
-
window.client.emit("event", "facebook",
|
|
7280
|
+
window.client.emit("event", "facebook", o.data);
|
|
7277
7281
|
break;
|
|
7278
7282
|
}
|
|
7279
7283
|
}
|
|
7280
7284
|
}
|
|
7281
7285
|
});
|
|
7282
|
-
const
|
|
7283
|
-
Client:
|
|
7284
|
-
USE_SE_API:
|
|
7285
|
-
Simulation:
|
|
7286
|
-
logger:
|
|
7287
|
-
Alejo:
|
|
7286
|
+
const Y = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(mt()), z = new K(), gt = {
|
|
7287
|
+
Client: T,
|
|
7288
|
+
USE_SE_API: Y,
|
|
7289
|
+
Simulation: D,
|
|
7290
|
+
logger: z,
|
|
7291
|
+
Alejo: O,
|
|
7288
7292
|
utils: {
|
|
7289
|
-
findEmotesInText:
|
|
7290
|
-
replaceEmotesWithHTML:
|
|
7291
|
-
replaceYoutubeEmotesWithHTML:
|
|
7292
|
-
generateBadges:
|
|
7293
|
+
findEmotesInText: q,
|
|
7294
|
+
replaceEmotesWithHTML: G,
|
|
7295
|
+
replaceYoutubeEmotesWithHTML: lt,
|
|
7296
|
+
generateBadges: S
|
|
7293
7297
|
},
|
|
7294
7298
|
modules: {
|
|
7295
|
-
Button:
|
|
7296
|
-
Command:
|
|
7297
|
-
EventProvider:
|
|
7298
|
-
useStorage:
|
|
7299
|
-
useQueue:
|
|
7300
|
-
Logger:
|
|
7299
|
+
Button: V,
|
|
7300
|
+
Command: L,
|
|
7301
|
+
EventProvider: W,
|
|
7302
|
+
useStorage: _,
|
|
7303
|
+
useQueue: ut,
|
|
7304
|
+
Logger: K
|
|
7301
7305
|
},
|
|
7302
7306
|
data: {
|
|
7303
|
-
usedStorages:
|
|
7307
|
+
usedStorages: N
|
|
7304
7308
|
}
|
|
7305
7309
|
};
|
|
7306
|
-
typeof window < "u" && (window.Tixyel =
|
|
7310
|
+
typeof window < "u" && (window.Tixyel = gt);
|
|
7307
7311
|
export {
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7312
|
+
gt as Tixyel,
|
|
7313
|
+
Y as USE_SE_API,
|
|
7314
|
+
z as logger
|
|
7311
7315
|
};
|
|
7312
7316
|
//# sourceMappingURL=index.es.js.map
|