@tixyel/streamelements 6.4.2 → 6.4.4

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.es.js CHANGED
@@ -1,4 +1,4 @@
1
- class X {
1
+ class Z {
2
2
  constructor() {
3
3
  this.registeredEvents = {};
4
4
  }
@@ -49,10 +49,10 @@ class X {
49
49
  return this.registeredEvents[e] = [], this;
50
50
  }
51
51
  }
52
- const tt = [];
53
- class it extends X {
52
+ const et = [];
53
+ class at extends Z {
54
54
  constructor(e) {
55
- super(), this.SE_API = null, this.id = "default", this.loaded = !1, this.id = e.id || this.id, this.data = e.data ?? {}, tt.push(this), ct?.then((t) => {
55
+ super(), this.SE_API = null, this.id = "default", this.loaded = !1, this.id = e.id || this.id, this.data = e.data ?? {}, et.push(this), ct?.then((t) => {
56
56
  this.SE_API = t, t.store.get(this.id).then((a) => {
57
57
  this.data = a ?? this.data, this.loaded = !0, this.emit("load", this.data), JSON.stringify(this.data) !== JSON.stringify(a) && this.emit("update", this.data);
58
58
  }).catch(() => {
@@ -83,7 +83,7 @@ class it extends X {
83
83
  * @param value Value to add
84
84
  */
85
85
  add(e, t) {
86
- this.loaded && (it.setByPath(this.data, e, t), this.save(this.data));
86
+ this.loaded && (at.setByPath(this.data, e, t), this.save(this.data));
87
87
  }
88
88
  /**
89
89
  * Clears all data from the storage.
@@ -109,7 +109,7 @@ class it extends X {
109
109
  return e === "load" && this.loaded ? (t.apply(this, [this.data]), this) : (super.on(e, t), this);
110
110
  }
111
111
  }
112
- class q extends X {
112
+ class G extends Z {
113
113
  constructor(e) {
114
114
  super(), this.id = "default", this.debug = !1, this.fields = {}, this.loaded = !1, this.actions = {
115
115
  commands: [],
@@ -118,7 +118,7 @@ class q extends X {
118
118
  avatar: 30,
119
119
  pronoun: 60,
120
120
  emote: 120
121
- }, this.id = e.id || this.id, this.storage = new it({
121
+ }, this.id = e.id || this.id, this.storage = new at({
122
122
  id: this.id,
123
123
  data: {
124
124
  user: {},
@@ -151,17 +151,19 @@ class q extends X {
151
151
  ]), this) : (super.on(e, t), this);
152
152
  }
153
153
  }
154
- class Z {
154
+ class $ {
155
155
  constructor(e) {
156
- this.prefix = "!", this.arguments = !1, this.test = `${this.prefix}${this.name} arg1 arg2`, this.aliases = [], this.permissions = void 0, this.admins = [], window.client instanceof q && (this.prefix = e.prefix ?? this.prefix, this.name = e.name, this.description = e.description ?? this.description, this.arguments = e.arguments ?? this.arguments, this.run = e.run, this.test = e.test ?? this.test, this.aliases = e.aliases ?? this.aliases, this.permissions = e.permissions ?? this.permissions, this.admins = e.admins ?? this.admins, window.client.actions.commands.push(this), window.client.emit("action", this, "created"));
156
+ this.prefix = "!", this.arguments = !1, this.test = `${this.prefix}${this.name} arg1 arg2`, this.aliases = [], this.permissions = void 0, this.admins = [], window.client instanceof G && (this.prefix = e.prefix ?? this.prefix, this.name = e.name, this.description = e.description ?? this.description, this.arguments = e.arguments ?? this.arguments, this.run = e.run, this.test = e.test ?? this.test, this.aliases = e.aliases ?? this.aliases, this.permissions = e.permissions ?? this.permissions, this.admins = e.admins ?? this.admins, window.client.actions.commands.push(this), window.client.emit("action", this, "created"));
157
157
  }
158
158
  run(e, t) {
159
159
  }
160
160
  verify(e, t, a) {
161
- return this.arguments === !0 && (!a || !a.length) ? !1 : !!(this.admins.some((i) => e.toLocaleLowerCase() === i.toLocaleLowerCase()) || this.permissions === !0 || typeof this.permissions > "u" || Array.isArray(this.permissions) && !this.permissions.length || Array.isArray(this.permissions) && (this.permissions.some((i) => e.toLowerCase() === i.toLowerCase() || t.map((s) => s.toLowerCase()).includes(i.toLowerCase())) || this.permissions.includes("*")));
161
+ return this.arguments === !0 && (!a || !a.length) ? !1 : !!(this.admins.some((i) => e.toLocaleLowerCase() === i.toLocaleLowerCase()) || this.permissions === !0 || typeof this.permissions > "u" || Array.isArray(this.permissions) && !this.permissions.length || Array.isArray(this.permissions) && (this.permissions.some(
162
+ (i) => e.toLowerCase() === i.toLowerCase() || t.map((s) => s.toLowerCase()).includes(i.toLowerCase())
163
+ ) || this.permissions.includes("*")));
162
164
  }
163
165
  parse(e, t) {
164
- if (!(window.client instanceof q)) return !1;
166
+ if (!(window.client instanceof G)) return !1;
165
167
  const a = e.replace(this.prefix, "").split(" ").slice(1).map((c) => c.trim());
166
168
  var i = "", s = [];
167
169
  const n = { bits: "cheer", premium: "prime" };
@@ -188,12 +190,12 @@ class Z {
188
190
  return m === !0 && this.run.apply(window.client, [a, t]), m;
189
191
  }
190
192
  remove() {
191
- if (!(window.client instanceof q)) return;
193
+ if (!(window.client instanceof G)) return;
192
194
  const e = window.client.actions.commands.indexOf(this);
193
195
  e > -1 && (window.client.actions.commands.splice(e, 1), window.client.emit("action", this, "removed"));
194
196
  }
195
197
  static execute(e) {
196
- if (!(window.client instanceof q)) return !1;
198
+ if (!(window.client instanceof G)) return !1;
197
199
  const t = e.data;
198
200
  try {
199
201
  if (window.client.actions.commands.length && window.client.actions.commands.some((a) => t.event.data.text.startsWith(a.prefix))) {
@@ -201,9 +203,12 @@ class Z {
201
203
  var s = [i.name, ...i.aliases ?? []], n = t.event.data.text.replace(i.prefix, "").split(" ")[0];
202
204
  return s.includes(n);
203
205
  });
204
- if (a.length && a.every((i) => i instanceof Z))
206
+ if (a.length && a.every((i) => i instanceof $))
205
207
  return a.forEach((i) => {
206
- i.parse(t.event.data.text, e), window.client.emit("action", i, "executed"), N.received(`Command executed: ${t.event.data.text} by ${t.event.data.nick || t.event.data.displayName}`, t);
208
+ i.parse(t.event.data.text, e), window?.client?.emit("action", i, "executed"), R.received(
209
+ `Command executed: ${t.event.data.text} by ${t.event.data.nick || t.event.data.displayName}`,
210
+ t
211
+ );
207
212
  }), !0;
208
213
  }
209
214
  } catch {
@@ -364,7 +369,7 @@ const ut = [
364
369
  "yellowgreen",
365
370
  "transparent"
366
371
  ];
367
- function ft(l, e) {
372
+ function bt(l, e) {
368
373
  if (!e) return null;
369
374
  switch (e) {
370
375
  case "hex": {
@@ -387,7 +392,7 @@ function ft(l, e) {
387
392
  const t = l.match(/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*([\d.]+))?\s*\)/);
388
393
  if (!t) return null;
389
394
  const a = parseInt(t[1]), i = parseInt(t[2]), s = parseInt(t[3]), n = t[4] ? parseFloat(t[4]) : 1;
390
- return { ...yt(a, i, s), a: n };
395
+ return { ...wt(a, i, s), a: n };
391
396
  }
392
397
  case "css-color-name": {
393
398
  const t = document.createElement("canvas");
@@ -402,7 +407,7 @@ function ft(l, e) {
402
407
  return null;
403
408
  }
404
409
  }
405
- function bt(l, e = !0) {
410
+ function yt(l, e = !0) {
406
411
  const t = (i) => Math.round(i).toString(16).padStart(2, "0");
407
412
  let a = `#${t(l.r)}${t(l.g)}${t(l.b)}`;
408
413
  return e && l.a < 1 && (a += t(l.a * 255)), a;
@@ -430,7 +435,7 @@ function lt(l, e, t) {
430
435
  l: Math.round(c * 100)
431
436
  };
432
437
  }
433
- function yt(l, e, t) {
438
+ function wt(l, e, t) {
434
439
  l /= 360, e /= 100, t /= 100;
435
440
  let a, i, s;
436
441
  if (e === 0)
@@ -445,7 +450,7 @@ function yt(l, e, t) {
445
450
  b: Math.round(s * 255)
446
451
  };
447
452
  }
448
- async function wt(l, e, t) {
453
+ async function vt(l, e, t) {
449
454
  const a = ut;
450
455
  let i = a[0], s = 1 / 0;
451
456
  for await (const n of a) {
@@ -454,12 +459,12 @@ async function wt(l, e, t) {
454
459
  const c = m.getContext("2d");
455
460
  if (!c) continue;
456
461
  c.fillStyle = n, c.fillRect(0, 0, 1, 1);
457
- const [b, p, o] = c.getImageData(0, 0, 1, 1).data, h = Math.sqrt(Math.pow(l - b, 2) + Math.pow(e - p, 2) + Math.pow(t - o, 2));
458
- if (h < s && (s = h, i = n), h === 0) break;
462
+ const [b, p, o] = c.getImageData(0, 0, 1, 1).data, d = Math.sqrt(Math.pow(l - b, 2) + Math.pow(e - p, 2) + Math.pow(t - o, 2));
463
+ if (d < s && (s = d, i = n), d === 0) break;
459
464
  }
460
465
  return i;
461
466
  }
462
- const vt = [
467
+ const kt = [
463
468
  "https://static-cdn.jtvnw.net/user-default-pictures-uv/13e5fa74-defa-11e9-809c-784f43822e80-profile_image-300x300.png",
464
469
  "https://static-cdn.jtvnw.net/user-default-pictures-uv/dbdc9198-def8-11e9-8681-784f43822e80-profile_image-300x300.png",
465
470
  "https://static-cdn.jtvnw.net/user-default-pictures-uv/998f01ae-def8-11e9-b95c-784f43822e80-profile_image-300x300.png",
@@ -467,7 +472,7 @@ const vt = [
467
472
  "https://static-cdn.jtvnw.net/user-default-pictures-uv/ebe4cd89-b4f4-4cd9-adac-2f30151b4209-profile_image-300x300.png",
468
473
  "https://static-cdn.jtvnw.net/user-default-pictures-uv/215b7342-def9-11e9-9a66-784f43822e80-profile_image-300x300.png",
469
474
  "https://static-cdn.jtvnw.net/user-default-pictures-uv/ead5c8b2-a4c9-4724-b1dd-9f00b46cbd3d-profile_image-300x300.png"
470
- ], kt = {
475
+ ], Ct = {
471
476
  "100 bits": {
472
477
  type: "100 bits",
473
478
  version: "1",
@@ -558,7 +563,7 @@ const vt = [
558
563
  url: "https://static-cdn.jtvnw.net/badges/v1/b817aba4-fad8-49e2-b88a-7cc744dfa6ec/3",
559
564
  description: "VIP"
560
565
  }
561
- }, Ct = Object.values([
566
+ }, jt = Object.values([
562
567
  {
563
568
  type: "twitch",
564
569
  name: "TheIlluminati",
@@ -1915,7 +1920,7 @@ const vt = [
1915
1920
  end: 0
1916
1921
  }), l),
1917
1922
  []
1918
- ), jt = [], xt = [
1923
+ ), xt = [], Ut = [
1919
1924
  "Hello everyone!",
1920
1925
  "PogChamp",
1921
1926
  "This stream is amazing!",
@@ -1966,7 +1971,7 @@ const vt = [
1966
1971
  "BloodTrail hunting time",
1967
1972
  "CatBag kitty!",
1968
1973
  "c! poggers"
1969
- ], Ut = ["Local", "Tixyel", "Urie_s2", "itzzcatt", "BeniArts", "Cupidiko", "shy_madeit"], Et = ["1000", "2000", "3000", "prime"], It = [
1974
+ ], Et = ["Local", "Tixyel", "Urie_s2", "itzzcatt", "BeniArts", "Cupidiko", "shy_madeit"], It = ["1000", "2000", "3000", "prime"], Tt = [
1970
1975
  "Filiz",
1971
1976
  "Astrid",
1972
1977
  "Tatyana",
@@ -2054,7 +2059,7 @@ const vt = [
2054
2059
  "Szabolcs",
2055
2060
  "Hoda",
2056
2061
  "Naayf"
2057
- ], Tt = [
2062
+ ], St = [
2058
2063
  {
2059
2064
  emojiId: "UCkszU2WH9gy1mb0dV-11UJg/flower-rainbow-heart-red",
2060
2065
  shortcuts: [":pride-flower-rainbow-heart:"],
@@ -5228,15 +5233,15 @@ const vt = [
5228
5233
  index: 121
5229
5234
  }
5230
5235
  ];
5231
- var A;
5236
+ var M;
5232
5237
  ((l) => {
5233
- l.avatars = vt, l.badges = kt, l.css_color_names = ut, l.emotes = Ct, l.items = jt, l.messages = xt, l.names = Ut, l.tiers = Et, l.tts = It, l.youtube_emotes = Tt;
5234
- })(A || (A = {}));
5238
+ l.avatars = kt, l.badges = Ct, l.css_color_names = ut, l.emotes = jt, l.items = xt, l.messages = Ut, l.names = Et, l.tiers = It, l.tts = Tt, l.youtube_emotes = St;
5239
+ })(M || (M = {}));
5235
5240
  var w;
5236
5241
  ((l) => {
5237
5242
  let e;
5238
5243
  ((n) => {
5239
- function m(o, h = "cardinal") {
5244
+ function m(o, d = "cardinal") {
5240
5245
  const f = {
5241
5246
  single: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"],
5242
5247
  tens: [
@@ -5252,7 +5257,7 @@ var w;
5252
5257
  "nineteen"
5253
5258
  ],
5254
5259
  decades: ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
5255
- }, d = {
5260
+ }, h = {
5256
5261
  single: [
5257
5262
  "zeroth",
5258
5263
  "first",
@@ -5295,215 +5300,215 @@ var w;
5295
5300
  "trillion",
5296
5301
  "quadrillion",
5297
5302
  "quintillion"
5298
- ], v = y.map((j) => j ? `${j}th` : "");
5299
- if (o = Math.abs(Math.floor(o)), h === "suffix") {
5303
+ ], C = y.map((j) => j ? `${j}th` : "");
5304
+ if (o = Math.abs(Math.floor(o)), d === "suffix") {
5300
5305
  const j = o % 100;
5301
5306
  if (j >= 11 && j <= 13) return `${o}th`;
5302
- const J = o % 10;
5303
- return `${o}${g[J]}`;
5304
- }
5305
- function C(j, J) {
5306
- if (j < 10) return J === "ordinal" ? d.single[j] : f.single[j];
5307
- if (j < 20) return J === "ordinal" ? d.tens[j - 10] : f.tens[j - 10];
5308
- const R = Math.floor(j / 10), H = j % 10;
5309
- if (H === 0)
5310
- return J === "ordinal" ? d.decades[R - 2] : f.decades[R - 2];
5311
- const W = f.decades[R - 2], O = J === "ordinal" ? d.single[H] : f.single[H];
5312
- return `${W}-${O}`;
5313
- }
5314
- function x(j, J) {
5315
- if (j === 0) return J === "ordinal" ? d.single[0] : f.single[0];
5316
- const R = Math.floor(j / 100), H = j % 100, W = [];
5317
- return R > 0 && (J === "ordinal" && H === 0 ? W.push(`${f.single[R]} hundredth`) : W.push(`${f.single[R]} hundred`)), H > 0 && W.push(C(H, J)), W.join(" ");
5318
- }
5319
- if (o < 1e3) return x(o, h);
5320
- const S = [];
5321
- let D = o;
5322
- for (; D > 0; )
5323
- S.push(D % 1e3), D = Math.floor(D / 1e3);
5324
- let M = -1;
5325
- for (let j = 0; j < S.length; j++) S[j] !== 0 && (M = j);
5307
+ const P = o % 10;
5308
+ return `${o}${g[P]}`;
5309
+ }
5310
+ function k(j, P) {
5311
+ if (j < 10) return P === "ordinal" ? h.single[j] : f.single[j];
5312
+ if (j < 20) return P === "ordinal" ? h.tens[j - 10] : f.tens[j - 10];
5313
+ const O = Math.floor(j / 10), z = j % 10;
5314
+ if (z === 0)
5315
+ return P === "ordinal" ? h.decades[O - 2] : f.decades[O - 2];
5316
+ const W = f.decades[O - 2], D = P === "ordinal" ? h.single[z] : f.single[z];
5317
+ return `${W}-${D}`;
5318
+ }
5319
+ function S(j, P) {
5320
+ if (j === 0) return P === "ordinal" ? h.single[0] : f.single[0];
5321
+ const O = Math.floor(j / 100), z = j % 100, W = [];
5322
+ return O > 0 && (P === "ordinal" && z === 0 ? W.push(`${f.single[O]} hundredth`) : W.push(`${f.single[O]} hundred`)), z > 0 && W.push(k(z, P)), W.join(" ");
5323
+ }
5324
+ if (o < 1e3) return S(o, d);
5325
+ const J = [];
5326
+ let E = o;
5327
+ for (; E > 0; )
5328
+ J.push(E % 1e3), E = Math.floor(E / 1e3);
5329
+ let T = -1;
5330
+ for (let j = 0; j < J.length; j++) J[j] !== 0 && (T = j);
5326
5331
  const _ = [];
5327
- for (let j = S.length - 1; j >= 0; j--) {
5328
- const J = S[j];
5329
- if (J === 0) continue;
5330
- const R = y[j];
5331
- if (h === "cardinal") {
5332
- let H = x(J, "cardinal");
5333
- R && (H += ` ${R}`), _.push(H);
5334
- } else if (j === M)
5332
+ for (let j = J.length - 1; j >= 0; j--) {
5333
+ const P = J[j];
5334
+ if (P === 0) continue;
5335
+ const O = y[j];
5336
+ if (d === "cardinal") {
5337
+ let z = S(P, "cardinal");
5338
+ O && (z += ` ${O}`), _.push(z);
5339
+ } else if (j === T)
5335
5340
  if (j > 0) {
5336
- const W = x(J, "cardinal"), O = v[j];
5337
- _.push(W ? `${W} ${O}` : O);
5341
+ const W = S(P, "cardinal"), D = C[j];
5342
+ _.push(W ? `${W} ${D}` : D);
5338
5343
  } else {
5339
- const W = x(J, "ordinal");
5344
+ const W = S(P, "ordinal");
5340
5345
  _.push(W);
5341
5346
  }
5342
5347
  else {
5343
- let W = x(J, "cardinal");
5344
- R && (W += ` ${R}`), _.push(W);
5348
+ let W = S(P, "cardinal");
5349
+ O && (W += ` ${O}`), _.push(W);
5345
5350
  }
5346
5351
  }
5347
5352
  return _.join(", ");
5348
5353
  }
5349
5354
  n.translate = m;
5350
- function c(o, h = 0, f = 100, d = 0) {
5351
- const g = Math.min(Math.max(o, h), f);
5352
- return b(g, d);
5355
+ function c(o, d = 0, f = 100, h = 0) {
5356
+ const g = Math.min(Math.max(o, d), f);
5357
+ return b(g, h);
5353
5358
  }
5354
5359
  n.balance = c;
5355
- function b(o, h = 2) {
5356
- const f = Math.pow(10, h);
5360
+ function b(o, d = 2) {
5361
+ const f = Math.pow(10, d);
5357
5362
  return Math.round(o * f) / f;
5358
5363
  }
5359
5364
  n.round = b;
5360
- function p(o, h, f = 0) {
5361
- o > h && ([o, h] = [h, o]);
5362
- const d = Math.random() * (h - o) + o;
5363
- return f ? Number(d.toFixed(f)) : Math.round(d);
5365
+ function p(o, d, f = 0) {
5366
+ o > d && ([o, d] = [d, o]);
5367
+ const h = Math.random() * (d - o) + o;
5368
+ return f ? Number(h.toFixed(f)) : Math.round(h);
5364
5369
  }
5365
5370
  n.number = p;
5366
5371
  })(e = l.number || (l.number = {}));
5367
5372
  let t;
5368
5373
  ((n) => {
5369
- function m(h, f, d) {
5374
+ function m(d, f, h) {
5370
5375
  const g = f.match(/^<span(?: class="[^"]*")? style="([^"]*)">(.*)<\/span>$/s);
5371
5376
  if (g) {
5372
- const y = g[1], v = g[2], C = g[0].match(/class="([^"]*)"/)?.[1] || "";
5373
- let x = [y, h].filter((S) => S.length).map((S) => S.endsWith(";") ? S.slice(0, -1) : S).join("; ").replace(/\s*;\s*/g, "; ").trim();
5374
- return x.endsWith(";") || (x += ";"), `<span${C ? ` class="${C} ${d ?? ""}"` : ""}${x ? ` style="${x}"` : ""}>${v}</span>`;
5377
+ const y = g[1], C = g[2], k = g[0].match(/class="([^"]*)"/)?.[1] || "";
5378
+ let S = [y, d].filter((J) => J.length).map((J) => J.endsWith(";") ? J.slice(0, -1) : J).join("; ").replace(/\s*;\s*/g, "; ").trim();
5379
+ return S.endsWith(";") || (S += ";"), `<span${k ? ` class="${k} ${h ?? ""}"` : ""}${S ? ` style="${S}"` : ""}>${C}</span>`;
5375
5380
  } else
5376
- return h && h.length && !h.endsWith(";") && (h += ";"), `<span${d ? ` class="${d}"` : ""}${h ? ` style="${h}"` : ""}>${f}</span>`;
5381
+ return d && d.length && !d.endsWith(";") && (d += ";"), `<span${h ? ` class="${h}"` : ""}${d ? ` style="${d}"` : ""}>${f}</span>`;
5377
5382
  }
5378
5383
  n.mergeSpanStyles = m;
5379
- function c(h, f = 0, d = 1, g) {
5380
- const { return: y = !1, parent: v, base: C } = g || {}, x = v || h.parentElement || document.body;
5381
- if (!x)
5384
+ function c(d, f = 0, h = 1, g) {
5385
+ const { return: y = !1, parent: C, base: k } = g || {}, S = C || d.parentElement || document.body;
5386
+ if (!S)
5382
5387
  throw new Error("No parent element found for scaling");
5383
- const S = x.getBoundingClientRect(), D = h.offsetWidth, M = h.offsetHeight;
5384
- if (D === 0 || M === 0)
5388
+ const J = S.getBoundingClientRect(), E = d.offsetWidth, T = d.offsetHeight;
5389
+ if (E === 0 || T === 0)
5385
5390
  throw new Error("Element has zero width or height, cannot scale");
5386
- const _ = S.width * d / D, j = S.height * d / M;
5387
- let J = C === "width" ? _ : C === "height" ? j : Math.min(_, j);
5391
+ const _ = J.width * h / E, j = J.height * h / T;
5392
+ let P = k === "width" ? _ : k === "height" ? j : Math.min(_, j);
5388
5393
  if (f > 0) {
5389
- const H = S.width * f / D, W = S.height * f / M, O = Math.max(H, W);
5390
- J = Math.max(O, J);
5394
+ const z = J.width * f / E, W = J.height * f / T, D = Math.max(z, W);
5395
+ P = Math.max(D, P);
5391
5396
  }
5392
- const R = {
5393
- width: D * J,
5394
- height: M * J,
5395
- scale: J
5397
+ const O = {
5398
+ width: E * P,
5399
+ height: T * P,
5400
+ scale: P
5396
5401
  };
5397
- return y || (h.style.transform = `scale(${J})`, h.style.transformOrigin = "center center"), R;
5402
+ return y || (d.style.transform = `scale(${P})`, d.style.transformOrigin = "center center"), O;
5398
5403
  }
5399
5404
  n.scale = c;
5400
- function b(h, f = {}) {
5405
+ function b(d, f = {}) {
5401
5406
  const {
5402
- parent: d = h.parentElement,
5407
+ parent: h = d.parentElement,
5403
5408
  prefer: g = "auto",
5404
5409
  min: y = 0,
5405
- max: v = 1,
5406
- apply: C = () => {
5410
+ max: C = 1,
5411
+ apply: k = () => {
5407
5412
  }
5408
5413
  } = f;
5409
- if (!d)
5414
+ if (!h)
5410
5415
  throw new Error("No parent element found for scaling");
5411
- const x = d.getBoundingClientRect(), S = h.getBoundingClientRect(), D = x.width, M = x.height, _ = S.width, j = S.height;
5412
- let J = D * y / _, R = M * y / j, H = D * v / _, W = M * v / j, O = Math.min(H, W);
5413
- const F = Math.max(J, R);
5414
- O = Math.max(O, F);
5415
- const B = _ * O, st = j * O;
5416
- return g === "width" ? O = Math.max(J, Math.min(H, D / _)) : g === "height" ? O = Math.max(R, Math.min(W, M / j)) : B > D ? O = Math.max(J, Math.min(H, D / _)) : st > M && (O = Math.max(R, Math.min(W, M / j))), C.apply(h, [O, h]), O;
5416
+ const S = h.getBoundingClientRect(), J = d.getBoundingClientRect(), E = S.width, T = S.height, _ = J.width, j = J.height;
5417
+ let P = E * y / _, O = T * y / j, z = E * C / _, W = T * C / j, D = Math.min(z, W);
5418
+ const tt = Math.max(P, O);
5419
+ D = Math.max(D, tt);
5420
+ const q = _ * D, F = j * D;
5421
+ return g === "width" ? D = Math.max(P, Math.min(z, E / _)) : g === "height" ? D = Math.max(O, Math.min(W, T / j)) : q > E ? D = Math.max(P, Math.min(z, E / _)) : F > T && (D = Math.max(O, Math.min(W, T / j))), k.apply(d, [D, d]), D;
5417
5422
  }
5418
5423
  n.scalev2 = b;
5419
- function p(h, f = 1, d = {}) {
5420
- const g = parseFloat(getComputedStyle(h).getPropertyValue("font-size")), y = {
5421
- minFontSize: d?.minFontSize ?? 0,
5422
- maxFontSize: d?.maxFontSize ?? g
5423
- }, v = d?.parent || h.parentElement;
5424
- if (!v)
5424
+ function p(d, f = 1, h = {}) {
5425
+ const g = parseFloat(getComputedStyle(d).getPropertyValue("font-size")), y = {
5426
+ minFontSize: h?.minFontSize ?? 0,
5427
+ maxFontSize: h?.maxFontSize ?? g
5428
+ }, C = h?.parent || d.parentElement;
5429
+ if (!C)
5425
5430
  throw new Error("No parent element found for fitting text");
5426
- const C = v.clientWidth * f, x = h.offsetWidth, S = C / x, D = g * S, M = e.balance(D, y.minFontSize, y.maxFontSize);
5427
- return h.style.fontSize = M + "px", h;
5431
+ const k = C.clientWidth * f, S = d.offsetWidth, J = k / S, E = g * J, T = e.balance(E, y.minFontSize, y.maxFontSize);
5432
+ return d.style.fontSize = T + "px", d;
5428
5433
  }
5429
5434
  n.fitText = p;
5430
- function o(h, f = 0) {
5431
- const g = new DOMParser().parseFromString(h, "text/html");
5435
+ function o(d, f = 0) {
5436
+ const g = new DOMParser().parseFromString(d, "text/html");
5432
5437
  let y = f;
5433
- function v(D) {
5434
- if (D.nodeType === Node.TEXT_NODE) {
5435
- const _ = (D.textContent || "").split("").map((J, R) => {
5436
- const H = document.createElement("span");
5437
- return H.classList.add("char"), H.dataset.index = String(y), H.dataset.exclusivityIndex = String(y), H.style.setProperty("--char-index", String(y)), H.style.setProperty("--exclusivity-index", String(y)), (J === " " || J === `
5438
- ` || J === " ") && (H.style.whiteSpace = "pre-wrap"), H.textContent = J, y++, H;
5438
+ function C(E) {
5439
+ if (E.nodeType === Node.TEXT_NODE) {
5440
+ const _ = (E.textContent || "").split("").map((P, O) => {
5441
+ const z = document.createElement("span");
5442
+ return z.classList.add("char"), z.dataset.index = String(y), z.dataset.exclusivityIndex = String(y), z.style.setProperty("--char-index", String(y)), z.style.setProperty("--exclusivity-index", String(y)), (P === " " || P === `
5443
+ ` || P === " ") && (z.style.whiteSpace = "pre-wrap"), z.textContent = P, y++, z;
5439
5444
  }), j = document.createDocumentFragment();
5440
- return _.forEach((J) => j.appendChild(J)), j;
5441
- } else if (D.nodeType === Node.ELEMENT_NODE) {
5442
- const M = D.cloneNode(!1);
5443
- return M.classList.add("container"), M.dataset.index = String(y), M.style.setProperty("--char-index", String(y)), D.childNodes.forEach((_) => {
5444
- const j = v(_);
5445
- (j instanceof DocumentFragment || j instanceof Node) && M.appendChild(j);
5446
- }), M;
5447
- }
5448
- return D.cloneNode(!0);
5449
- }
5450
- const C = g.body, x = document.createElement("div");
5451
- C.childNodes.forEach((D) => {
5452
- if (D.nodeType === Node.TEXT_NODE && !D.textContent?.trim())
5445
+ return _.forEach((P) => j.appendChild(P)), j;
5446
+ } else if (E.nodeType === Node.ELEMENT_NODE) {
5447
+ const T = E.cloneNode(!1);
5448
+ return T.classList.add("container"), T.dataset.index = String(y), T.style.setProperty("--char-index", String(y)), E.childNodes.forEach((_) => {
5449
+ const j = C(_);
5450
+ (j instanceof DocumentFragment || j instanceof Node) && T.appendChild(j);
5451
+ }), T;
5452
+ }
5453
+ return E.cloneNode(!0);
5454
+ }
5455
+ const k = g.body, S = document.createElement("div");
5456
+ k.childNodes.forEach((E) => {
5457
+ if (E.nodeType === Node.TEXT_NODE && !E.textContent?.trim())
5453
5458
  return;
5454
- const M = v(D);
5455
- (M instanceof DocumentFragment || M instanceof Node) && x.appendChild(M);
5459
+ const T = C(E);
5460
+ (T instanceof DocumentFragment || T instanceof Node) && S.appendChild(T);
5456
5461
  });
5457
- let S = "";
5458
- return Array.from(x.childNodes).forEach((D) => {
5459
- D.nodeType === Node.TEXT_NODE ? S += D.textContent : S += D.outerHTML;
5460
- }), S;
5462
+ let J = "";
5463
+ return Array.from(S.childNodes).forEach((E) => {
5464
+ E.nodeType === Node.TEXT_NODE ? J += E.textContent : J += E.outerHTML;
5465
+ }), J;
5461
5466
  }
5462
5467
  n.splitTextToChars = o;
5463
5468
  })(t = l.element || (l.element = {}));
5464
5469
  let a;
5465
5470
  ((n) => {
5466
- function m(o, h = !0, f = "") {
5467
- const d = {};
5471
+ function m(o, d = !0, f = "") {
5472
+ const h = {};
5468
5473
  for (const g in o) {
5469
5474
  if (!Object.prototype.hasOwnProperty.call(o, g)) continue;
5470
- const y = o[g], v = f ? `${f}.${g}` : g;
5475
+ const y = o[g], C = f ? `${f}.${g}` : g;
5471
5476
  if (y == null) {
5472
- d[v] = String(y);
5477
+ h[C] = String(y);
5473
5478
  continue;
5474
5479
  }
5475
5480
  if (typeof y == "number" && isNaN(y)) {
5476
- d[v] = "NaN";
5481
+ h[C] = "NaN";
5477
5482
  continue;
5478
5483
  }
5479
5484
  if (typeof y == "number" && !isNaN(y)) {
5480
- d[v] = h ? String(y) : y;
5485
+ h[C] = d ? String(y) : y;
5481
5486
  continue;
5482
5487
  }
5483
5488
  if (y instanceof Date) {
5484
- d[v] = y.toISOString();
5489
+ h[C] = y.toISOString();
5485
5490
  continue;
5486
5491
  }
5487
5492
  if (y instanceof Map) {
5488
- y.forEach((C, x) => {
5489
- d[`${v}.${x}`] = JSON.stringify(C);
5493
+ y.forEach((k, S) => {
5494
+ h[`${C}.${S}`] = JSON.stringify(k);
5490
5495
  });
5491
5496
  continue;
5492
5497
  }
5493
5498
  if (Array.isArray(y)) {
5494
- y.forEach((C, x) => {
5495
- const S = `${v}:${x}`;
5496
- typeof C == "object" ? Object.assign(d, m(C, h, S)) : d[S] = h ? String(C) : C;
5499
+ y.forEach((k, S) => {
5500
+ const J = `${C}:${S}`;
5501
+ typeof k == "object" ? Object.assign(h, m(k, d, J)) : h[J] = d ? String(k) : k;
5497
5502
  });
5498
5503
  continue;
5499
5504
  }
5500
5505
  if (typeof y == "object") {
5501
- Object.assign(d, m(y, h, v));
5506
+ Object.assign(h, m(y, d, C));
5502
5507
  continue;
5503
5508
  }
5504
- d[v] = String(y);
5509
+ h[C] = String(y);
5505
5510
  }
5506
- return d;
5511
+ return h;
5507
5512
  }
5508
5513
  n.flatten = m;
5509
5514
  function c(o) {
@@ -5519,64 +5524,73 @@ var w;
5519
5524
  }
5520
5525
  n.keys = p;
5521
5526
  })(a = l.object || (l.object = {})), ((n) => {
5522
- function m(o, h = A.emotes) {
5527
+ function m(o, d = M.emotes) {
5523
5528
  const f = [];
5524
- return h.forEach((d) => {
5525
- const g = d.name;
5526
- let y = 0, v = 0;
5529
+ return d.forEach((h) => {
5530
+ const g = h.name;
5531
+ let y = 0, C = 0;
5527
5532
  for (; y < o.length; ) {
5528
- const C = o.indexOf(g, v);
5529
- if (C === -1) break;
5530
- const x = C > 0 ? o[C - 1] : " ", S = C + g.length < o.length ? o[C + g.length] : " ";
5531
- /\s/.test(x) && /\s/.test(S) && f.push({ ...d, start: C, end: C + g.length }), v = C + 1;
5533
+ const k = o.indexOf(g, C);
5534
+ if (k === -1) break;
5535
+ const S = k > 0 ? o[k - 1] : " ", J = k + g.length < o.length ? o[k + g.length] : " ";
5536
+ /\s/.test(S) && /\s/.test(J) && f.push({ ...h, start: k, end: k + g.length }), C = k + 1;
5532
5537
  }
5533
- }), f.sort((d, g) => d.start - g.start);
5538
+ }), f.sort((h, g) => h.start - g.start);
5534
5539
  }
5535
5540
  n.findEmotesInText = m;
5536
- function c(o, h) {
5537
- if (!h.length) return o;
5538
- let f = "", d = 0;
5539
- return h.forEach((g) => {
5540
- f += o.substring(d, g.start);
5541
- const v = Array.from({ ...g.urls, length: 5 }).slice(1).reverse().filter(Boolean)[0] || g.urls[1];
5542
- f += `<img src="${v}" alt="${g.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`, d = g.end;
5543
- }), f += o.substring(d), f;
5541
+ function c(o, d) {
5542
+ if (!d.length) return o;
5543
+ let f = "", h = 0;
5544
+ return d.forEach((g) => {
5545
+ f += o.substring(h, g.start);
5546
+ const C = Array.from({ ...g.urls, length: 5 }).slice(1).reverse().filter(Boolean)[0] || g.urls[1];
5547
+ f += `<img src="${C}" alt="${g.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`, h = g.end;
5548
+ }), f += o.substring(h), f;
5544
5549
  }
5545
5550
  n.replaceEmotesWithHTML = c;
5546
- function b(o, h = A.youtube_emotes) {
5547
- return Array.from(o.matchAll(/:(.*?):/gim), (d) => d[0]).forEach((d) => {
5548
- const g = h.find(
5549
- (y) => y.shortcuts.includes(d) || y.searchTerms.includes(d.slice(1, -1))
5551
+ function b(o, d = M.youtube_emotes) {
5552
+ return Array.from(o.matchAll(/:(.*?):/gim), (h) => h[0]).forEach((h) => {
5553
+ const g = d.find(
5554
+ (y) => y.shortcuts.includes(h) || y.searchTerms.includes(h.slice(1, -1))
5550
5555
  );
5551
5556
  if (g) {
5552
- const y = g.image.thumbnails.at(-1)?.url, v = g.image.accessibility.accessibilityData.label;
5557
+ const y = g.image.thumbnails.at(-1)?.url, C = g.image.accessibility.accessibilityData.label;
5553
5558
  y && (o = o.replace(
5554
- d,
5555
- `<img src="${y}" alt="${v}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`
5559
+ h,
5560
+ `<img src="${y}" alt="${C}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`
5556
5561
  ));
5557
5562
  }
5558
5563
  }), o;
5559
5564
  }
5560
5565
  n.replaceYoutubeEmotesWithHTML = b;
5561
- async function p(o = [], h) {
5562
- if (!Array.isArray(o) && typeof o == "string" && (o = o.split(",").map((v) => v.trim())), !o || !o.length) {
5563
- var f = s.number(1, 3);
5564
- for await (const v of Array.from({ length: f }, () => "")) {
5565
- var d = s.array(Object.keys(A.badges))[0];
5566
- !o.includes(d) && Array.isArray(o) ? o.push(d) : o = [d];
5567
- }
5568
- }
5569
- var g;
5570
- switch (h) {
5566
+ async function p(o = [], d) {
5567
+ !Array.isArray(o) && typeof o == "string" && (o = o.split(",").map((k) => k.trim()));
5568
+ var f = o.map((k) => k.split("/")[0]);
5569
+ if (!f || !f.length) {
5570
+ var h = s.number(1, 3);
5571
+ for await (const k of Array.from({ length: h }, () => "")) {
5572
+ var g = s.array(Object.keys(M.badges))[0];
5573
+ !f.includes(g) && Array.isArray(f) ? f.push(g) : f = [g];
5574
+ }
5575
+ }
5576
+ var y;
5577
+ switch (d) {
5571
5578
  case "twitch": {
5572
- g = {
5573
- keys: Array.from(o).filter((v) => v in A.badges),
5574
- badges: Array.from(o).slice(0, 3).map((v) => A.badges[v]).filter(Boolean)
5579
+ y = {
5580
+ keys: Array.from(f).filter((k) => k in M.badges),
5581
+ badges: Array.from(f).slice(0, 3).map((k) => M.badges[k]).filter(Boolean),
5582
+ amount: o.reduce(
5583
+ (k, S) => {
5584
+ var [J, E = "1"] = S.split("/");
5585
+ return (isNaN(parseInt(E)) || !E.length) && (E = "1"), k[J] = parseInt(E) || 1, k;
5586
+ },
5587
+ {}
5588
+ )
5575
5589
  };
5576
5590
  break;
5577
5591
  }
5578
5592
  case "youtube": {
5579
- var y = {
5593
+ var C = {
5580
5594
  verified: { isVerified: !0 },
5581
5595
  broadcaster: { isChatOwner: !0 },
5582
5596
  host: { isChatOwner: !0 },
@@ -5584,8 +5598,8 @@ var w;
5584
5598
  subscriber: { isChatSponsor: !0 },
5585
5599
  moderator: { isChatModerator: !0 }
5586
5600
  };
5587
- g = Object.entries(o).reduce(
5588
- (v, [C]) => (C in y && Object.assign(v, y[C]), v),
5601
+ y = Object.entries(f).reduce(
5602
+ (k, [S]) => (S in C && Object.assign(k, C[S]), k),
5589
5603
  {
5590
5604
  isVerified: !1,
5591
5605
  isChatOwner: !1,
@@ -5596,7 +5610,7 @@ var w;
5596
5610
  break;
5597
5611
  }
5598
5612
  }
5599
- return g;
5613
+ return y;
5600
5614
  }
5601
5615
  n.generateBadges = p;
5602
5616
  })(l.message || (l.message = {})), ((n) => {
@@ -5615,88 +5629,88 @@ var w;
5615
5629
  "tip-latest",
5616
5630
  "event:test",
5617
5631
  "event:skip"
5618
- ].some((h) => h === c.listener) && (b = "streamelements"), { provider: b, data: c };
5632
+ ].some((d) => d === c.listener) && (b = "streamelements"), { provider: b, data: c };
5619
5633
  }
5620
5634
  n.parseProvider = m;
5621
5635
  })(l.event || (l.event = {})), ((n) => {
5622
5636
  n.PRESETS = {};
5623
- async function m(p, o, h) {
5637
+ async function m(p, o, d) {
5624
5638
  const f = [];
5625
5639
  p.replace(o, (g, ...y) => {
5626
- const v = typeof h == "function" ? h(g, ...y) : g;
5627
- return f.push(Promise.resolve(v)), g;
5640
+ const C = typeof d == "function" ? d(g, ...y) : g;
5641
+ return f.push(Promise.resolve(C)), g;
5628
5642
  });
5629
- const d = await Promise.all(f);
5630
- return p.replace(o, () => d.shift() ?? "");
5643
+ const h = await Promise.all(f);
5644
+ return p.replace(o, () => h.shift() ?? "");
5631
5645
  }
5632
5646
  n.replace = m;
5633
5647
  function c(p) {
5634
5648
  return p.charAt(0).toUpperCase() + p.slice(1);
5635
5649
  }
5636
5650
  n.capitalize = c;
5637
- function b(p, o = {}, h = {
5651
+ function b(p, o = {}, d = {
5638
5652
  method: "index",
5639
5653
  html: !1,
5640
5654
  debug: !1,
5641
5655
  modifiers: {},
5642
5656
  aliases: {}
5643
5657
  }) {
5644
- const { mergeSpanStyles: f } = t, d = (r, u, k) => h.html ? f(r, u, k) : u, g = {
5658
+ const { mergeSpanStyles: f } = t, h = (r, u, v) => d.html ? f(r, u, v) : u, g = {
5645
5659
  skip: "<br/>",
5646
5660
  newline: "<br/>",
5647
5661
  ...o
5648
5662
  };
5649
- let y = "$", v = "USD";
5663
+ let y = "$", C = "USD";
5650
5664
  if (typeof window < "u")
5651
5665
  try {
5652
5666
  const u = window?.client?.details?.currency;
5653
- u?.symbol && (y = String(u.symbol)), u?.code && (v = String(u.code));
5667
+ u?.symbol && (y = String(u.symbol)), u?.code && (C = String(u.code));
5654
5668
  } catch {
5655
5669
  }
5656
- const C = Object.entries(a.flatten(g)).reduce(
5657
- (r, [u, k]) => {
5658
- if (r[u] = String(k), ["username", "name", "nick", "nickname", "sender"].some((U) => u === U)) {
5659
- const U = r?.username || r?.name || r?.nick || r?.nickname || r?.sender;
5660
- r.username = r.username || U, r.usernameAt = `@${r.username}`, r.name = r.name || U, r.nick = r.nick || U, r.nickname = r.nickname || U, r.sender = r.sender || U, r.senderAt = `@${r.sender}`;
5670
+ const k = Object.entries(a.flatten(g)).reduce(
5671
+ (r, [u, v]) => {
5672
+ if (r[u] = String(v), ["username", "name", "nick", "nickname", "sender"].some((x) => u === x)) {
5673
+ const x = r?.username || r?.name || r?.nick || r?.nickname || r?.sender;
5674
+ r.username = r.username || x, r.usernameAt = `@${r.username}`, r.name = r.name || x, r.nick = r.nick || x, r.nickname = r.nickname || x, r.sender = r.sender || x, r.senderAt = `@${r.sender}`;
5661
5675
  }
5662
- return ["amount", "count"].some((U) => u === U) && (r.amount = String(r?.amount || r.count || k), r.count = String(r?.count || r?.amount || k)), r.currency = r.currency || y, r.currencyCode = r.currencyCode || v, r;
5676
+ return ["amount", "count"].some((x) => u === x) && (r.amount = String(r?.amount || r.count || v), r.count = String(r?.count || r?.amount || v)), r.currency = r.currency || y, r.currencyCode = r.currencyCode || C, r;
5663
5677
  },
5664
5678
  {}
5665
- ), x = {
5679
+ ), S = {
5666
5680
  PLACEHOLDERS: /{([^}]+)}/g,
5667
5681
  MODIFIERS: /\[([^\]=]+)=([^\]]+)\]/g
5668
5682
  };
5669
- var S = parseFloat(C?.amount ?? C?.count ?? 0);
5670
- function D(r, u) {
5671
- const k = r?.trim?.() ?? "";
5672
- if (!k.length) return null;
5673
- const U = u[k], I = parseFloat(String(U !== void 0 ? U : k).replace(/\s/g, ""));
5683
+ var J = parseFloat(k?.amount ?? k?.count ?? 0);
5684
+ function E(r, u) {
5685
+ const v = r?.trim?.() ?? "";
5686
+ if (!v.length) return null;
5687
+ const x = u[v], I = parseFloat(String(x !== void 0 ? x : v).replace(/\s/g, ""));
5674
5688
  return isNaN(I) ? null : I;
5675
5689
  }
5676
- function M(r, u, k) {
5677
- const U = isNaN(Number(u)) ? 0 : Math.max(0, parseInt(String(u))), L = D(r, k);
5678
- if (L === null) return r;
5690
+ function T(r, u, v) {
5691
+ const x = isNaN(Number(u)) ? 0 : Math.max(0, parseInt(String(u))), N = E(r, v);
5692
+ if (N === null) return r;
5679
5693
  try {
5680
- return L.toLocaleString(void 0, {
5681
- minimumFractionDigits: U,
5682
- maximumFractionDigits: U
5694
+ return N.toLocaleString(void 0, {
5695
+ minimumFractionDigits: x,
5696
+ maximumFractionDigits: x
5683
5697
  });
5684
5698
  } catch {
5685
- return L.toFixed(U);
5699
+ return N.toFixed(x);
5686
5700
  }
5687
5701
  }
5688
5702
  function _(r, u = /* @__PURE__ */ new Date()) {
5689
- const k = u.getTime() - r.getTime(), U = k >= 0, L = Math.abs(k), I = Math.floor(L / 1e3), T = Math.floor(I / 60), P = Math.floor(T / 60), E = Math.floor(P / 24), z = Math.floor(E / 30), V = Math.floor(E / 365), Y = U ? "ago" : "from now";
5690
- return V > 0 ? `${V}y ${Y}` : z > 0 ? `${z}mo ${Y}` : E > 0 ? `${E}d ${Y}` : P > 0 ? `${P}h ${Y}` : T > 0 ? `${T}m ${Y}` : `${Math.max(I, 0)}s ${Y}`;
5703
+ const v = u.getTime() - r.getTime(), x = v >= 0, N = Math.abs(v), I = Math.floor(N / 1e3), A = Math.floor(I / 60), H = Math.floor(A / 60), U = Math.floor(H / 24), L = Math.floor(U / 30), V = Math.floor(U / 365), X = x ? "ago" : "from now";
5704
+ return V > 0 ? `${V}y ${X}` : L > 0 ? `${L}mo ${X}` : U > 0 ? `${U}d ${X}` : H > 0 ? `${H}h ${X}` : A > 0 ? `${A}m ${X}` : `${Math.max(I, 0)}s ${X}`;
5691
5705
  }
5692
- function j(r, u, k) {
5693
- const U = r?.trim?.() ?? "";
5694
- if (!U.length) return r;
5695
- const L = k[U] ?? U, I = new Date(L);
5706
+ function j(r, u, v) {
5707
+ const x = r?.trim?.() ?? "";
5708
+ if (!x.length) return r;
5709
+ const N = v[x] ?? x, I = new Date(N);
5696
5710
  if (isNaN(I.getTime())) return r;
5697
- const T = (u ?? "date").toString().toLowerCase();
5711
+ const A = (u ?? "date").toString().toLowerCase();
5698
5712
  try {
5699
- switch (T) {
5713
+ switch (A) {
5700
5714
  case "time":
5701
5715
  return I.toLocaleTimeString();
5702
5716
  case "datetime":
@@ -5714,188 +5728,188 @@ var w;
5714
5728
  return r;
5715
5729
  }
5716
5730
  }
5717
- function J(r, u, k) {
5718
- const U = r ?? "", [L, I = L] = U.split("|", 2), T = u?.trim();
5719
- let P;
5720
- T && k[T] !== void 0 ? P = k[T] : P = k.amount ?? k.count;
5721
- const E = parseFloat(String(P));
5722
- return isNaN(E) ? L : Math.abs(E) !== 1 ? I : L;
5723
- }
5724
- function R(r, u, k) {
5725
- const U = u?.trim() ?? "", L = U && k[U] !== void 0 ? k[U] : "", I = String(L), T = (r ?? "").split("|").map((E) => E.trim()).filter((E) => E.length);
5726
- let P;
5727
- for (const E of T) {
5728
- const z = E.indexOf(":");
5729
- if (z === -1) continue;
5730
- const V = E.slice(0, z).trim(), Y = E.slice(z + 1);
5731
+ function P(r, u, v) {
5732
+ const x = r ?? "", [N, I = N] = x.split("|", 2), A = u?.trim();
5733
+ let H;
5734
+ A && v[A] !== void 0 ? H = v[A] : H = v.amount ?? v.count;
5735
+ const U = parseFloat(String(H));
5736
+ return isNaN(U) ? N : Math.abs(U) !== 1 ? I : N;
5737
+ }
5738
+ function O(r, u, v) {
5739
+ const x = u?.trim() ?? "", N = x && v[x] !== void 0 ? v[x] : "", I = String(N), A = (r ?? "").split("|").map((U) => U.trim()).filter((U) => U.length);
5740
+ let H;
5741
+ for (const U of A) {
5742
+ const L = U.indexOf(":");
5743
+ if (L === -1) continue;
5744
+ const V = U.slice(0, L).trim(), X = U.slice(L + 1);
5731
5745
  if (V.length) {
5732
5746
  if (V.toLowerCase() === "default") {
5733
- P = Y;
5747
+ H = X;
5734
5748
  continue;
5735
5749
  }
5736
- if (I === V) return Y;
5750
+ if (I === V) return X;
5737
5751
  }
5738
5752
  }
5739
- return P ?? "";
5753
+ return H ?? "";
5740
5754
  }
5741
- function H(r) {
5755
+ function z(r) {
5742
5756
  return r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
5743
5757
  }
5744
5758
  function W(r, u) {
5745
- let k = r.trim();
5746
- if (!k.length) return;
5747
- const U = k[0], L = k[k.length - 1];
5748
- if (U === '"' && L === '"' || U === "'" && L === "'")
5749
- return k.slice(1, -1);
5750
- const I = k.toLowerCase();
5759
+ let v = r.trim();
5760
+ if (!v.length) return;
5761
+ const x = v[0], N = v[v.length - 1];
5762
+ if (x === '"' && N === '"' || x === "'" && N === "'")
5763
+ return v.slice(1, -1);
5764
+ const I = v.toLowerCase();
5751
5765
  if (I === "true") return !0;
5752
5766
  if (I === "false") return !1;
5753
- if (/^-?\d+(\.\d+)?$/.test(k)) return parseFloat(k);
5754
- const T = u?.[k];
5755
- if (T === void 0) return k;
5756
- const P = String(T).trim(), E = P.toLowerCase();
5757
- return E === "true" ? !0 : E === "false" ? !1 : /^-?\d+(\.\d+)?$/.test(P) ? parseFloat(P) : T;
5767
+ if (/^-?\d+(\.\d+)?$/.test(v)) return parseFloat(v);
5768
+ const A = u?.[v];
5769
+ if (A === void 0) return v;
5770
+ const H = String(A).trim(), U = H.toLowerCase();
5771
+ return U === "true" ? !0 : U === "false" ? !1 : /^-?\d+(\.\d+)?$/.test(H) ? parseFloat(H) : A;
5758
5772
  }
5759
- function O(r) {
5773
+ function D(r) {
5760
5774
  if (typeof r == "boolean") return r;
5761
5775
  if (r == null) return !1;
5762
5776
  const u = String(r).trim().toLowerCase();
5763
5777
  return !(!u.length || ["false", "0", "no", "off", "null", "undefined", "nan"].includes(u));
5764
5778
  }
5765
- function F(r, u) {
5766
- let k = r.trim();
5767
- if (!k.length) return !1;
5768
- let U = !1;
5769
- for (; k.startsWith("!"); )
5770
- U = !U, k = k.slice(1).trim();
5771
- const L = ["===", "!==", "==", "!=", ">=", "<=", ">", "<"];
5772
- let I = null, T = k, P = "";
5773
- for (const z of L) {
5774
- const V = k.indexOf(z);
5779
+ function tt(r, u) {
5780
+ let v = r.trim();
5781
+ if (!v.length) return !1;
5782
+ let x = !1;
5783
+ for (; v.startsWith("!"); )
5784
+ x = !x, v = v.slice(1).trim();
5785
+ const N = ["===", "!==", "==", "!=", ">=", "<=", ">", "<"];
5786
+ let I = null, A = v, H = "";
5787
+ for (const L of N) {
5788
+ const V = v.indexOf(L);
5775
5789
  if (V !== -1) {
5776
- I = z, T = k.slice(0, V), P = k.slice(V + z.length);
5790
+ I = L, A = v.slice(0, V), H = v.slice(V + L.length);
5777
5791
  break;
5778
5792
  }
5779
5793
  }
5780
- let E;
5794
+ let U;
5781
5795
  if (I) {
5782
- const z = W(T, u), V = W(P, u);
5796
+ const L = W(A, u), V = W(H, u);
5783
5797
  switch (I) {
5784
5798
  case "===":
5785
- E = z === V;
5799
+ U = L === V;
5786
5800
  break;
5787
5801
  case "!==":
5788
- E = z !== V;
5802
+ U = L !== V;
5789
5803
  break;
5790
5804
  case "==":
5791
- E = z == V;
5805
+ U = L == V;
5792
5806
  break;
5793
5807
  case "!=":
5794
- E = z != V;
5808
+ U = L != V;
5795
5809
  break;
5796
5810
  case ">=":
5797
- E = z >= V;
5811
+ U = L >= V;
5798
5812
  break;
5799
5813
  case "<=":
5800
- E = z <= V;
5814
+ U = L <= V;
5801
5815
  break;
5802
5816
  case ">":
5803
- E = z > V;
5817
+ U = L > V;
5804
5818
  break;
5805
5819
  case "<":
5806
- E = z < V;
5820
+ U = L < V;
5807
5821
  break;
5808
5822
  default:
5809
- E = !1;
5823
+ U = !1;
5810
5824
  break;
5811
5825
  }
5812
5826
  } else {
5813
- const z = W(T, u);
5814
- E = O(z);
5815
- }
5816
- return U ? !E : E;
5817
- }
5818
- function B(r, u) {
5819
- let k = r.trim();
5820
- if (!k.length) return !1;
5821
- let U = !1;
5822
- for (; k.startsWith("!"); )
5823
- U = !U, k = k.slice(1).trim();
5824
- const L = k.split("||").map((T) => T.trim()).filter((T) => T.length);
5825
- if (!L.length) return !!U;
5827
+ const L = W(A, u);
5828
+ U = D(L);
5829
+ }
5830
+ return x ? !U : U;
5831
+ }
5832
+ function q(r, u) {
5833
+ let v = r.trim();
5834
+ if (!v.length) return !1;
5835
+ let x = !1;
5836
+ for (; v.startsWith("!"); )
5837
+ x = !x, v = v.slice(1).trim();
5838
+ const N = v.split("||").map((A) => A.trim()).filter((A) => A.length);
5839
+ if (!N.length) return !!x;
5826
5840
  let I = !1;
5827
- for (const T of L) {
5828
- const P = T.split("&&").map((z) => z.trim()).filter((z) => z.length);
5829
- if (!P.length) continue;
5830
- let E = !0;
5831
- for (const z of P) {
5832
- const V = F(z, u);
5833
- if (E = E && V, !E) break;
5841
+ for (const A of N) {
5842
+ const H = A.split("&&").map((L) => L.trim()).filter((L) => L.length);
5843
+ if (!H.length) continue;
5844
+ let U = !0;
5845
+ for (const L of H) {
5846
+ const V = tt(L, u);
5847
+ if (U = U && V, !U) break;
5834
5848
  }
5835
- if (I = I || E, I) break;
5836
- }
5837
- return U ? !I : I;
5838
- }
5839
- const st = {
5840
- COLOR: (r, u) => d(u && i.validate(u) ? `color: ${u}` : "", r, "color"),
5841
- WEIGHT: (r, u) => d(u && !isNaN(parseInt(u)) ? `font-weight: ${u}` : "", r, "weight"),
5842
- SEMIBOLD: (r) => d("font-weight: 600", r, "semibold"),
5843
- BOLD: (r) => d("font-weight: bold", r, "bold"),
5844
- BLACK: (r) => d("font-weight: 900", r, "black"),
5845
- LIGHT: (r) => d("font-weight: lighter", r, "light"),
5846
- STRONG: (r) => d("font-weight: bolder", r, "strong"),
5847
- ITALIC: (r) => d("font-style: italic", r, "italic"),
5848
- UNDERLINE: (r) => d("text-decoration: underline", r, "underline"),
5849
- STRIKETHROUGH: (r) => d("text-decoration: line-through", r, "strikethrough"),
5850
- SUB: (r) => d("vertical-align: sub", r, "sub"),
5851
- SUP: (r) => d("vertical-align: super", r, "sup"),
5852
- LARGER: (r) => d("font-size: larger", r, "larger"),
5853
- SMALL: (r) => d("font-size: smaller", r, "small"),
5854
- SHADOW: (r, u) => d(`text-shadow: ${u}`, r, "shadow"),
5855
- SIZE: (r, u) => d(u ? `font-size: ${u}` : "", r, "size")
5856
- }, dt = {
5849
+ if (I = I || U, I) break;
5850
+ }
5851
+ return x ? !I : I;
5852
+ }
5853
+ const F = {
5854
+ COLOR: (r, u) => h(u && i.validate(u) ? `color: ${u}` : "", r, "color"),
5855
+ WEIGHT: (r, u) => h(u && !isNaN(parseInt(u)) ? `font-weight: ${u}` : "", r, "weight"),
5856
+ SEMIBOLD: (r) => h("font-weight: 600", r, "semibold"),
5857
+ BOLD: (r) => h("font-weight: bold", r, "bold"),
5858
+ BLACK: (r) => h("font-weight: 900", r, "black"),
5859
+ LIGHT: (r) => h("font-weight: lighter", r, "light"),
5860
+ STRONG: (r) => h("font-weight: bolder", r, "strong"),
5861
+ ITALIC: (r) => h("font-style: italic", r, "italic"),
5862
+ UNDERLINE: (r) => h("text-decoration: underline", r, "underline"),
5863
+ STRIKETHROUGH: (r) => h("text-decoration: line-through", r, "strikethrough"),
5864
+ SUB: (r) => h("vertical-align: sub", r, "sub"),
5865
+ SUP: (r) => h("vertical-align: super", r, "sup"),
5866
+ LARGER: (r) => h("font-size: larger", r, "larger"),
5867
+ SMALL: (r) => h("font-size: smaller", r, "small"),
5868
+ SHADOW: (r, u) => h(`text-shadow: ${u}`, r, "shadow"),
5869
+ SIZE: (r, u) => h(u ? `font-size: ${u}` : "", r, "size")
5870
+ }, Y = {
5857
5871
  ...{
5858
- BT1: (r) => S > 1 ? r : "",
5859
- BT0: (r) => S > 0 ? r : "",
5860
- ST1: (r) => S < 1 ? r : "",
5861
- ST0: (r) => S < 0 ? r : "",
5872
+ BT1: (r) => J > 1 ? r : "",
5873
+ BT0: (r) => J > 0 ? r : "",
5874
+ ST1: (r) => J < 1 ? r : "",
5875
+ ST0: (r) => J < 0 ? r : "",
5862
5876
  UPC: (r) => r.toUpperCase(),
5863
5877
  LOW: (r) => r.toLowerCase(),
5864
5878
  REV: (r) => r.split("").reverse().join(""),
5865
5879
  CAP: (r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase(),
5866
- NUMBER: (r, u, k) => M(r, u, k),
5867
- PLURAL: (r, u, k) => J(r, u, k),
5868
- DATE: (r, u, k) => j(r, u, k),
5869
- MAP: (r, u, k) => R(r, u, k),
5870
- ESCAPE: (r) => H(r),
5871
- IF: (r, u, k) => {
5872
- const U = r ?? "", [L, I] = U.split("?", 2);
5873
- if (!I) return U;
5874
- const [T, P = ""] = I.split("|", 2);
5875
- return B(
5876
- L,
5877
- k
5878
- ) ? T : P;
5880
+ NUMBER: (r, u, v) => T(r, u, v),
5881
+ PLURAL: (r, u, v) => P(r, u, v),
5882
+ DATE: (r, u, v) => j(r, u, v),
5883
+ MAP: (r, u, v) => O(r, u, v),
5884
+ ESCAPE: (r) => z(r),
5885
+ IF: (r, u, v) => {
5886
+ const x = r ?? "", [N, I] = x.split("?", 2);
5887
+ if (!I) return x;
5888
+ const [A, H = ""] = I.split("|", 2);
5889
+ return q(
5890
+ N,
5891
+ v
5892
+ ) ? A : H;
5879
5893
  },
5880
5894
  PRESET: (r, u) => {
5881
- const k = u?.trim() ?? "";
5882
- if (!k.length) return r;
5883
- const U = n.PRESETS[k];
5884
- if (!U || !U.length) return r;
5885
- const L = U.split(",").map((T) => T.trim()).filter((T) => T.length).map((T) => {
5886
- const [P, E] = T.split(":");
5887
- return { name: P.trim(), param: E?.trim() ?? null };
5895
+ const v = u?.trim() ?? "";
5896
+ if (!v.length) return r;
5897
+ const x = n.PRESETS[v];
5898
+ if (!x || !x.length) return r;
5899
+ const N = x.split(",").map((A) => A.trim()).filter((A) => A.length).map((A) => {
5900
+ const [H, U] = A.split(":");
5901
+ return { name: H.trim(), param: U?.trim() ?? null };
5888
5902
  });
5889
5903
  let I = r;
5890
- for (const { name: T, param: P } of L)
5891
- I = K(I, T, P);
5904
+ for (const { name: A, param: H } of N)
5905
+ I = nt(I, A, H);
5892
5906
  return I;
5893
5907
  },
5894
5908
  FALLBACK: (r, u) => r.length ? r : u ?? r
5895
5909
  },
5896
- ...h?.html ? st : {},
5897
- ...h.modifiers ?? {}
5898
- }, ht = {
5910
+ ...d?.html ? F : {},
5911
+ ...d.modifiers ?? {}
5912
+ }, ft = {
5899
5913
  UPC: ["UPPERCASE", "UPPER", "UPP"],
5900
5914
  LOW: ["LOWERCASE", "LOWER", "LWC"],
5901
5915
  REV: ["REVERSE", "RVS"],
@@ -5923,77 +5937,77 @@ var w;
5923
5937
  SHADOW: ["SHADOW", "SHD"],
5924
5938
  FALLBACK: ["FALLBACK", "FB"],
5925
5939
  IF: ["IF", "COND", "CONDITION"],
5926
- ...h.aliases ?? {}
5940
+ ...d.aliases ?? {}
5927
5941
  };
5928
- function K(r, u, k) {
5929
- const U = Object.entries(ht).find(([I, T]) => T.some((P) => P.toUpperCase() === u.toUpperCase()) ? !0 : I.toUpperCase() === u.toUpperCase()), L = U ? U[0] : u.toUpperCase();
5942
+ function nt(r, u, v) {
5943
+ const x = Object.entries(ft).find(([I, A]) => A.some((H) => H.toUpperCase() === u.toUpperCase()) ? !0 : I.toUpperCase() === u.toUpperCase()), N = x ? x[0] : u.toUpperCase();
5930
5944
  try {
5931
- return dt[L] ? dt[L](r, typeof k == "string" ? k.trim() : null, C) : h?.html ? d("", r, L.toLowerCase()) : r;
5945
+ return Y[N] ? Y[N](r, typeof v == "string" ? v.trim() : null, k) : d?.html ? h("", r, N.toLowerCase()) : r;
5932
5946
  } catch (I) {
5933
- return h?.debug && typeof console < "u" && typeof console.error == "function" && console.error("[Helper.string.compose] Modifier error", { name: u, param: k, error: I }), r;
5947
+ return d?.debug && typeof console < "u" && typeof console.error == "function" && console.error("[Helper.string.compose] Modifier error", { name: u, param: v, error: I }), r;
5934
5948
  }
5935
5949
  }
5936
- function nt(r) {
5937
- let u = r, k;
5938
- for (; (k = x.MODIFIERS.exec(u)) !== null; ) {
5939
- const [U, L, I] = k, T = L.split(",").map((E) => E.trim()).filter((E) => E.length).map((E) => {
5940
- const [z, V] = E.split(":");
5941
- return { name: z.trim(), param: V?.trim() ?? null };
5950
+ function dt(r) {
5951
+ let u = r, v;
5952
+ for (; (v = S.MODIFIERS.exec(u)) !== null; ) {
5953
+ const [x, N, I] = v, A = N.split(",").map((U) => U.trim()).filter((U) => U.length).map((U) => {
5954
+ const [L, V] = U.split(":");
5955
+ return { name: L.trim(), param: V?.trim() ?? null };
5942
5956
  });
5943
- let P = nt(I);
5944
- for (const { name: E, param: z } of T)
5945
- P = K(P, E, z);
5946
- u = u.replace(U, P ?? ""), x.MODIFIERS.lastIndex = 0;
5957
+ let H = dt(I);
5958
+ for (const { name: U, param: L } of A)
5959
+ H = nt(H, U, L);
5960
+ u = u.replace(x, H ?? ""), S.MODIFIERS.lastIndex = 0;
5947
5961
  }
5948
5962
  return u;
5949
5963
  }
5950
- function Q(r) {
5964
+ function ht(r) {
5951
5965
  let u = 0;
5952
- const k = r.length;
5953
- function U(I) {
5954
- let T = "";
5955
- for (; u < k; )
5966
+ const v = r.length;
5967
+ function x(I) {
5968
+ let A = "";
5969
+ for (; u < v; )
5956
5970
  if (r[u] === "\\")
5957
- u + 1 < k ? (T += r[u + 1], u += 2) : u++;
5971
+ u + 1 < v ? (A += r[u + 1], u += 2) : u++;
5958
5972
  else if (r[u] === "[" && (!I || I !== "["))
5959
- T += L();
5973
+ A += N();
5960
5974
  else if (I && r[u] === I) {
5961
5975
  u++;
5962
5976
  break;
5963
5977
  } else
5964
- T += r[u++];
5965
- return T;
5978
+ A += r[u++];
5979
+ return A;
5966
5980
  }
5967
- function L() {
5981
+ function N() {
5968
5982
  u++;
5969
5983
  const I = [];
5970
- for (; u < k && r[u] !== "="; ) {
5984
+ for (; u < v && r[u] !== "="; ) {
5971
5985
  if (r[u] === ",") {
5972
5986
  u++;
5973
5987
  continue;
5974
5988
  }
5975
- let P = "";
5976
- for (; u < k && /[A-Za-z0-9]/.test(r[u]); ) P += r[u++];
5977
- let E = null;
5989
+ let H = "";
5990
+ for (; u < v && /[A-Za-z0-9]/.test(r[u]); ) H += r[u++];
5991
+ let U = null;
5978
5992
  if (r[u] === ":") {
5979
5993
  u++;
5980
- const z = u;
5981
- for (; u < k && r[u] !== "," && r[u] !== "="; ) u++;
5982
- E = r.slice(z, u);
5994
+ const L = u;
5995
+ for (; u < v && r[u] !== "," && r[u] !== "="; ) u++;
5996
+ U = r.slice(L, u);
5983
5997
  }
5984
- P.length && I.push({ name: P, param: E }), r[u] === "," && u++;
5998
+ H.length && I.push({ name: H, param: U }), r[u] === "," && u++;
5985
5999
  }
5986
6000
  r[u] === "=" && u++;
5987
- const T = U("]");
5988
- return I.reduce((P, { name: E, param: z }) => K(P, E, z), T);
6001
+ const A = x("]");
6002
+ return I.reduce((H, { name: U, param: L }) => nt(H, U, L), A);
5989
6003
  }
5990
- return U();
6004
+ return x();
5991
6005
  }
5992
- let $ = p.replace(
5993
- x.PLACEHOLDERS,
5994
- (r, u) => typeof C[u] == "string" || typeof C[u] == "number" ? String(C[u]) : u ?? u
6006
+ let K = p.replace(
6007
+ S.PLACEHOLDERS,
6008
+ (r, u) => typeof k[u] == "string" || typeof k[u] == "number" ? String(k[u]) : u ?? u
5995
6009
  );
5996
- return $ = h.method === "loop" ? nt($) : Q($), $;
6010
+ return K = d.method === "loop" ? dt(K) : ht(K), K;
5997
6011
  }
5998
6012
  n.compose = b;
5999
6013
  })(l.string || (l.string = {})), ((n) => {
@@ -6003,11 +6017,11 @@ var w;
6003
6017
  throw new Error("No sound URL provided");
6004
6018
  try {
6005
6019
  p && n.playing && n.audio && n.audio.state !== "closed" && n.audio.close();
6006
- let o = new AudioContext(), h = o.createGain();
6007
- h.connect(o.destination), p && (n.audio = o, n.playing = !0), fetch(c).then((f) => f.arrayBuffer()).then((f) => o.decodeAudioData(f)).then((f) => {
6020
+ let o = new AudioContext(), d = o.createGain();
6021
+ d.connect(o.destination), p && (n.audio = o, n.playing = !0), fetch(c).then((f) => f.arrayBuffer()).then((f) => o.decodeAudioData(f)).then((f) => {
6008
6022
  if (o.state !== "closed") {
6009
- const d = o.createBufferSource();
6010
- d.buffer = f, d.connect(h), h.gain.value = b / 100, d.start(o.currentTime);
6023
+ const h = o.createBufferSource();
6024
+ h.buffer = f, h.connect(d), d.gain.value = b / 100, h.start(o.currentTime);
6011
6025
  }
6012
6026
  });
6013
6027
  } catch (o) {
@@ -6018,10 +6032,10 @@ var w;
6018
6032
  })(l.sound || (l.sound = {}));
6019
6033
  let i;
6020
6034
  ((n) => {
6021
- function m(o = 100, h = "") {
6022
- h = h.length > 7 ? h?.substring(0, 6) : h, o = o > 1 ? o / 100 : o;
6035
+ function m(o = 100, d = "") {
6036
+ d = d.length > 7 ? d?.substring(0, 6) : d, o = o > 1 ? o / 100 : o;
6023
6037
  let f = Math.round(Math.min(Math.max(o, 0), 1) * 255).toString(16).toLowerCase().padStart(2, "0");
6024
- return h + f;
6038
+ return d + f;
6025
6039
  }
6026
6040
  n.opacity = m;
6027
6041
  function c(o) {
@@ -6030,42 +6044,42 @@ var w;
6030
6044
  color: o,
6031
6045
  opacity: 100
6032
6046
  };
6033
- var d = o.slice(-2), h = parseInt(d, 16) / 255, f = Math.round(h * 100), d = o.length > 7 ? o.slice(0, 7) : o;
6047
+ var h = o.slice(-2), d = parseInt(h, 16) / 255, f = Math.round(d * 100), h = o.length > 7 ? o.slice(0, 7) : o;
6034
6048
  return {
6035
- color: d,
6049
+ color: h,
6036
6050
  opacity: f
6037
6051
  };
6038
6052
  }
6039
6053
  n.extract = c;
6040
6054
  function b(o) {
6041
6055
  if (typeof o != "string" || !String(o).trim().length) return !1;
6042
- const h = o.trim();
6043
- return /^#([A-Fa-f0-9]{3}){1,2}$/.test(h) || /^#([A-Fa-f0-9]{4}|[A-Fa-f0-9]{8})$/.test(h) ? "hex" : /^rgb\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(h) ? "rgb" : /^rgba\(\s*(?:\d{1,3}\s*,\s*){3}(?:0|1|0?\.\d+)\s*\)$/.test(h) ? "rgba" : /^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(h) ? "hsl" : /^hsla\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*,\s*(?:0|1|0?\.\d+)\s*\)$/.test(h) ? "hsla" : A.css_color_names.includes(h.toLowerCase()) ? "css-color-name" : !1;
6056
+ const d = o.trim();
6057
+ return /^#([A-Fa-f0-9]{3}){1,2}$/.test(d) || /^#([A-Fa-f0-9]{4}|[A-Fa-f0-9]{8})$/.test(d) ? "hex" : /^rgb\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(d) ? "rgb" : /^rgba\(\s*(?:\d{1,3}\s*,\s*){3}(?:0|1|0?\.\d+)\s*\)$/.test(d) ? "rgba" : /^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(d) ? "hsl" : /^hsla\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*,\s*(?:0|1|0?\.\d+)\s*\)$/.test(d) ? "hsla" : M.css_color_names.includes(d.toLowerCase()) ? "css-color-name" : !1;
6044
6058
  }
6045
6059
  n.validate = b;
6046
- async function p(o, h) {
6060
+ async function p(o, d) {
6047
6061
  const f = b(o);
6048
6062
  if (!f) throw new Error(`Invalid color format: ${o}`);
6049
- if (f === h) throw new Error(`Color is already in the desired format: ${h}`);
6050
- const d = ft(o.trim(), f);
6051
- if (!d) throw new Error(`Failed to parse color: ${o}`);
6052
- switch (h) {
6063
+ if (f === d) throw new Error(`Color is already in the desired format: ${d}`);
6064
+ const h = bt(o.trim(), f);
6065
+ if (!h) throw new Error(`Failed to parse color: ${o}`);
6066
+ switch (d) {
6053
6067
  case "hex":
6054
- return bt(d, !1);
6068
+ return yt(h, !1);
6055
6069
  case "rgb":
6056
- return `rgb(${d.r}, ${d.g}, ${d.b})`;
6070
+ return `rgb(${h.r}, ${h.g}, ${h.b})`;
6057
6071
  case "rgba":
6058
- return `rgba(${d.r}, ${d.g}, ${d.b}, ${d.a})`;
6072
+ return `rgba(${h.r}, ${h.g}, ${h.b}, ${h.a})`;
6059
6073
  case "hsl": {
6060
- const g = lt(d.r, d.g, d.b);
6074
+ const g = lt(h.r, h.g, h.b);
6061
6075
  return `hsl(${g.h}, ${g.s}%, ${g.l}%)`;
6062
6076
  }
6063
6077
  case "hsla": {
6064
- const g = lt(d.r, d.g, d.b);
6065
- return `hsla(${g.h}, ${g.s}%, ${g.l}%, ${d.a})`;
6078
+ const g = lt(h.r, h.g, h.b);
6079
+ return `hsla(${g.h}, ${g.s}%, ${g.l}%, ${h.a})`;
6066
6080
  }
6067
6081
  case "css-color-name":
6068
- return await wt(d.r, d.g, d.b);
6082
+ return await vt(h.r, h.g, h.b);
6069
6083
  default:
6070
6084
  return null;
6071
6085
  }
@@ -6080,36 +6094,36 @@ var w;
6080
6094
  case "hex":
6081
6095
  return `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
6082
6096
  case "hexa": {
6083
- const v = `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`, C = Math.floor(Math.random() * 256).toString(16).padStart(2, "0");
6084
- return v + C;
6097
+ const C = `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`, k = Math.floor(Math.random() * 256).toString(16).padStart(2, "0");
6098
+ return C + k;
6085
6099
  }
6086
6100
  case "rgb": {
6087
- const v = Math.floor(Math.random() * 256), C = Math.floor(Math.random() * 256), x = Math.floor(Math.random() * 256);
6088
- return `rgb(${v}, ${C}, ${x})`;
6101
+ const C = Math.floor(Math.random() * 256), k = Math.floor(Math.random() * 256), S = Math.floor(Math.random() * 256);
6102
+ return `rgb(${C}, ${k}, ${S})`;
6089
6103
  }
6090
6104
  case "rgba": {
6091
- const v = Math.floor(Math.random() * 256), C = Math.floor(Math.random() * 256), x = Math.floor(Math.random() * 256), S = Math.random().toFixed(2);
6092
- return `rgba(${v}, ${C}, ${x}, ${S})`;
6105
+ const C = Math.floor(Math.random() * 256), k = Math.floor(Math.random() * 256), S = Math.floor(Math.random() * 256), J = Math.random().toFixed(2);
6106
+ return `rgba(${C}, ${k}, ${S}, ${J})`;
6093
6107
  }
6094
6108
  case "hsl": {
6095
- const v = Math.floor(Math.random() * 361), C = Math.floor(Math.random() * 101), x = Math.floor(Math.random() * 101);
6096
- return `hsl(${v}, ${C}%, ${x}%)`;
6109
+ const C = Math.floor(Math.random() * 361), k = Math.floor(Math.random() * 101), S = Math.floor(Math.random() * 101);
6110
+ return `hsl(${C}, ${k}%, ${S}%)`;
6097
6111
  }
6098
6112
  case "hsla": {
6099
- const v = Math.floor(Math.random() * 361), C = Math.floor(Math.random() * 101), x = Math.floor(Math.random() * 101), S = Math.random().toFixed(2);
6100
- return `hsla(${v}, ${C}%, ${x}%, ${S})`;
6113
+ const C = Math.floor(Math.random() * 361), k = Math.floor(Math.random() * 101), S = Math.floor(Math.random() * 101), J = Math.random().toFixed(2);
6114
+ return `hsla(${C}, ${k}%, ${S}%, ${J})`;
6101
6115
  }
6102
6116
  case "css-color-name": {
6103
- var y = A.css_color_names;
6117
+ var y = M.css_color_names;
6104
6118
  return o(y)[0];
6105
6119
  }
6106
6120
  }
6107
6121
  }
6108
6122
  n.color = m;
6109
- function c(g, y, v = 0) {
6123
+ function c(g, y, C = 0) {
6110
6124
  g > y && ([g, y] = [y, g]);
6111
- const C = Math.random() * (y - g) + g;
6112
- return v ? Number(C.toFixed(v)) : Math.round(C);
6125
+ const k = Math.random() * (y - g) + g;
6126
+ return C ? Number(k.toFixed(C)) : Math.round(k);
6113
6127
  }
6114
6128
  n.number = c;
6115
6129
  function b(g = 0.5) {
@@ -6117,10 +6131,10 @@ var w;
6117
6131
  }
6118
6132
  n.boolean = b;
6119
6133
  function p(g, y = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
6120
- let v = "";
6121
- for (let C = 0; C < g; C++)
6122
- v += y.charAt(Math.floor(Math.random() * y.length));
6123
- return v;
6134
+ let C = "";
6135
+ for (let k = 0; k < g; k++)
6136
+ C += y.charAt(Math.floor(Math.random() * y.length));
6137
+ return C;
6124
6138
  }
6125
6139
  n.string = p;
6126
6140
  function o(g) {
@@ -6128,19 +6142,19 @@ var w;
6128
6142
  return [g[y], y];
6129
6143
  }
6130
6144
  n.array = o;
6131
- function h(g = new Date(2e3, 0, 1), y = /* @__PURE__ */ new Date()) {
6145
+ function d(g = new Date(2e3, 0, 1), y = /* @__PURE__ */ new Date()) {
6132
6146
  return new Date(c(g.getTime(), y.getTime()));
6133
6147
  }
6134
- n.date = h;
6148
+ n.date = d;
6135
6149
  function f(g) {
6136
- const v = Date.now() - c(0, g * 24 * 60 * 60 * 1e3);
6137
- return new Date(v).toISOString();
6150
+ const C = Date.now() - c(0, g * 24 * 60 * 60 * 1e3);
6151
+ return new Date(C).toISOString();
6138
6152
  }
6139
6153
  n.daysOffset = f;
6140
- function d() {
6154
+ function h() {
6141
6155
  return crypto.randomUUID();
6142
6156
  }
6143
- n.uuid = d;
6157
+ n.uuid = h;
6144
6158
  })(s = l.random || (l.random = {})), ((n) => {
6145
6159
  function m(b, p, o) {
6146
6160
  return b.apply(p, o);
@@ -6151,42 +6165,42 @@ var w;
6151
6165
  }
6152
6166
  n.call = c;
6153
6167
  })(l.fn || (l.fn = {})), ((n) => {
6154
- function m(h, f) {
6168
+ function m(d, f) {
6155
6169
  return new Promise(
6156
- (d) => setTimeout(() => {
6170
+ (h) => setTimeout(() => {
6157
6171
  if (f) {
6158
6172
  const g = f();
6159
- d(g ?? null);
6160
- } else d(null);
6161
- }, h)
6173
+ h(g ?? null);
6174
+ } else h(null);
6175
+ }, d)
6162
6176
  );
6163
6177
  }
6164
6178
  n.delay = m;
6165
- function c(h) {
6166
- return Object.entries(h);
6179
+ function c(d) {
6180
+ return Object.entries(d);
6167
6181
  }
6168
6182
  n.typedEntries = c;
6169
- function b(h) {
6170
- return Object.values(h);
6183
+ function b(d) {
6184
+ return Object.values(d);
6171
6185
  }
6172
6186
  n.typedValues = b;
6173
- function p(h) {
6174
- return Object.keys(h);
6187
+ function p(d) {
6188
+ return Object.keys(d);
6175
6189
  }
6176
6190
  n.typedKeys = p;
6177
- function o(h) {
6178
- const f = Object.values(h).reduce((v, C) => v + C, 0), d = c(h).sort((v, C) => C[1] - v[1]), g = Math.random() * f;
6191
+ function o(d) {
6192
+ const f = Object.values(d).reduce((C, k) => C + k, 0), h = c(d).sort((C, k) => k[1] - C[1]), g = Math.random() * f;
6179
6193
  let y = 0;
6180
- for (const [v, C] of d)
6181
- if (y += C, g < y)
6182
- return v;
6194
+ for (const [C, k] of h)
6195
+ if (y += k, g < y)
6196
+ return C;
6183
6197
  }
6184
6198
  n.probability = o;
6185
6199
  })(l.utils || (l.utils = {}));
6186
6200
  })(w || (w = {}));
6187
- class at {
6201
+ class st {
6188
6202
  constructor(e) {
6189
- this.field = "button", this.template = "button", this.name = "Button", this.value = "", window.client instanceof q && (this.field = e.field ?? this.field, this.template = e.template ?? (typeof this.field == "string" ? this.field : this.template), this.name = e.name ?? this.name, this.value = e.value ?? this.value, this.run = e.run, window.client.actions.buttons.push(this), window.client.emit("action", this, "created"));
6203
+ this.field = "button", this.template = "button", this.name = "Button", this.value = "", window.client instanceof G && (this.field = e.field ?? this.field, this.template = e.template ?? (typeof this.field == "string" ? this.field : this.template), this.name = e.name ?? this.name, this.value = e.value ?? this.value, this.run = e.run, window.client.actions.buttons.push(this), window.client.emit("action", this, "created"));
6190
6204
  }
6191
6205
  generate(e) {
6192
6206
  return w.utils.typedValues(e).reduce(
@@ -6196,37 +6210,48 @@ class at {
6196
6210
  type: "button",
6197
6211
  label: m
6198
6212
  };
6199
- let c = w.string.compose(String(this.value), { index: s, ...i }, { html: !1 });
6213
+ let c = w.string.compose(
6214
+ String(this.value),
6215
+ { index: s, ...i },
6216
+ { html: !1 }
6217
+ );
6200
6218
  return isNaN(Number(c)) ? c.toLowerCase() === "true" ? c = !0 : c.toLowerCase() === "false" && (c = !1) : c = Number(c), typeof c < "u" && c && (typeof c != "string" || c.length) && (a[n].value = c), a;
6201
6219
  },
6202
6220
  {}
6203
6221
  );
6204
6222
  }
6205
6223
  parse(e, t) {
6206
- var a = e.replace(typeof this.field == "string" ? this.field : this.template.replace(/\{[^}]*\}/g, "") ?? "", "").trim();
6224
+ var a = e.replace(
6225
+ typeof this.field == "string" ? this.field : this.template.replace(/\{[^}]*\}/g, "") ?? "",
6226
+ ""
6227
+ ).trim();
6207
6228
  try {
6208
6229
  this.run.apply(window.client, [a.length ? a : e ?? e, t]);
6209
6230
  } catch (i) {
6210
- throw new Error(`Error running button "${this.field}": ${i instanceof Error ? i.message : i}`);
6231
+ throw new Error(
6232
+ `Error running button "${this.field}": ${i instanceof Error ? i.message : i}`
6233
+ );
6211
6234
  }
6212
6235
  return this;
6213
6236
  }
6214
6237
  remove() {
6215
- if (!(window.client instanceof q)) return;
6238
+ if (!(window.client instanceof G)) return;
6216
6239
  const e = window.client.actions.buttons.indexOf(this);
6217
6240
  e > -1 && (window.client.actions.buttons.splice(e, 1), window.client.emit("action", this, "removed"));
6218
6241
  }
6219
6242
  static execute(e, t) {
6220
6243
  try {
6221
- if (!(window.client instanceof q)) return !1;
6244
+ if (!(window.client instanceof G)) return !1;
6222
6245
  if (window.client.actions.buttons.length) {
6223
6246
  const a = window.client.actions.buttons.filter((i) => typeof i.field == "string" ? i.field === e : typeof i.field == "function" ? i.field(e, t) : !1);
6224
- if (a.length && a.every((i) => i instanceof at))
6247
+ if (a.length && a.every((i) => i instanceof st))
6225
6248
  return a.forEach((i) => {
6226
6249
  try {
6227
- i.parse(e, t), window.client.emit("action", i, "executed"), N.received(`Button executed: ${e}${t ? ` with value: ${t}` : ""}`);
6250
+ i.parse(e, t), window?.client?.emit("action", i, "executed"), R.received(`Button executed: ${e}${t ? ` with value: ${t}` : ""}`);
6228
6251
  } catch (s) {
6229
- N.error(`Error executing button "${e}": ${s instanceof Error ? s.message : s}`);
6252
+ R.error(
6253
+ `Error executing button "${e}": ${s instanceof Error ? s.message : s}`
6254
+ );
6230
6255
  }
6231
6256
  }), !0;
6232
6257
  }
@@ -6237,10 +6262,10 @@ class at {
6237
6262
  }
6238
6263
  }
6239
6264
  }
6240
- const et = [];
6241
- class St extends X {
6265
+ const it = [];
6266
+ class Dt extends Z {
6242
6267
  constructor(e = {}) {
6243
- super(), this.SE_API = null, this.id = "widget communications", this.loaded = !1, this.history = [], this.detected = /* @__PURE__ */ new Set(), this.id = e.id || this.id, et.push(this), ct?.then(async (t) => {
6268
+ super(), this.SE_API = null, this.id = "widget communications", this.loaded = !1, this.history = [], this.detected = /* @__PURE__ */ new Set(), this.id = e.id || this.id, it.push(this), ct?.then(async (t) => {
6244
6269
  this.loaded = !0, this.SE_API = t, Promise.all([
6245
6270
  async () => {
6246
6271
  const a = await t.store.get(this.id);
@@ -6277,7 +6302,7 @@ class St extends X {
6277
6302
  }
6278
6303
  typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) => {
6279
6304
  const { detail: e } = l;
6280
- if (window.client instanceof q && client instanceof q && client) {
6305
+ if (window.client instanceof G && client instanceof G && client) {
6281
6306
  const t = window.client;
6282
6307
  if (t.fields = e.fieldData, t.session = e.session.data, t.details = {
6283
6308
  ...t.details,
@@ -6291,18 +6316,18 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6291
6316
  }).catch(() => {
6292
6317
  t.details.provider = "local";
6293
6318
  }) : t.details.provider = "local", t.emit("load", e), t.debug) {
6294
- N.received("Widget loaded!", l.detail);
6319
+ R.received("Widget loaded!", l.detail);
6295
6320
  const a = l.detail.fieldData;
6296
- Object.keys(a).length && N.received("Field data:", a);
6321
+ Object.keys(a).length && R.received("Field data:", a);
6297
6322
  }
6298
6323
  t.loaded = !0, t.storage.on("load", (a) => {
6299
- if (t.debug && a ? N.debug(
6324
+ if (t.debug && a ? R.debug(
6300
6325
  "[Client]",
6301
6326
  "Storage loaded for client",
6302
6327
  `"${t.id}";`,
6303
6328
  `Provider: "${t.details.provider}";`,
6304
6329
  a
6305
- ) : t.debug && N.debug(
6330
+ ) : t.debug && R.debug(
6306
6331
  "[Client]",
6307
6332
  "Storage loaded for client",
6308
6333
  `"${t.id}";`,
@@ -6311,10 +6336,10 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6311
6336
  ), a) {
6312
6337
  const i = (b) => {
6313
6338
  const p = Date.now(), o = {};
6314
- for (const h in b)
6315
- if (b.hasOwnProperty(h)) {
6316
- const f = b[h];
6317
- f.expire && f.expire > p && (o[h] = f);
6339
+ for (const d in b)
6340
+ if (b.hasOwnProperty(d)) {
6341
+ const f = b[d];
6342
+ f.expire && f.expire > p && (o[d] = f);
6318
6343
  }
6319
6344
  return o;
6320
6345
  }, s = i(a.user || {}), n = i(a.avatar || {}), m = i(a.pronoun || {}), c = i(a.emote || {});
@@ -6334,12 +6359,12 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6334
6359
  }
6335
6360
  }), window.addEventListener("onSessionUpdate", (l) => {
6336
6361
  const { detail: e } = l;
6337
- if (window.client instanceof q && client instanceof q && client) {
6362
+ if (window.client instanceof G && client instanceof G && client) {
6338
6363
  const t = window.client;
6339
- t.session = e.session, t.emit("session", e.session), t.debug && N.debug("[Client]", "Session updated", e.session);
6364
+ t.session = e.session, t.emit("session", e.session), t.debug && R.debug("[Client]", "Session updated", e.session);
6340
6365
  }
6341
6366
  }), window.addEventListener("onEventReceived", ({ detail: l }) => {
6342
- if (window.client instanceof q && client instanceof q && client) {
6367
+ if (window.client instanceof G && client instanceof G && client) {
6343
6368
  const t = w.event.parseProvider(l);
6344
6369
  switch (t.provider) {
6345
6370
  case "streamelements": {
@@ -6357,7 +6382,7 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6357
6382
  switch (i.event.listener) {
6358
6383
  case "widget-button": {
6359
6384
  const s = i.event;
6360
- at.execute(s.field, s.value);
6385
+ st.execute(s.field, s.value);
6361
6386
  break;
6362
6387
  }
6363
6388
  case "subscriber-latest": {
@@ -6369,14 +6394,14 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6369
6394
  }
6370
6395
  case "kvstore:update": {
6371
6396
  const s = i.event;
6372
- if (tt.length) {
6373
- var e = tt.find(
6397
+ if (et.length) {
6398
+ var e = et.find(
6374
6399
  (n) => n.id === s.data.key.replace("customWidget.", "") || n.id === s.data.key
6375
6400
  );
6376
6401
  e && e.update(s.data.value);
6377
6402
  }
6378
- if (et.length) {
6379
- const n = et.find(
6403
+ if (it.length) {
6404
+ const n = it.find(
6380
6405
  (m) => m.id === s.data.key.replace("customWidget.", "") || m.id === s.data.key
6381
6406
  );
6382
6407
  n && n.update(s.data.value);
@@ -6408,7 +6433,7 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6408
6433
  break;
6409
6434
  }
6410
6435
  case "message": {
6411
- i.event, Z.execute({ provider: "twitch", data: i });
6436
+ i.event, $.execute({ provider: "twitch", data: i });
6412
6437
  break;
6413
6438
  }
6414
6439
  case "follower-latest": {
@@ -6435,7 +6460,7 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6435
6460
  const i = t.data;
6436
6461
  switch (i.listener) {
6437
6462
  case "message": {
6438
- i.event, Z.execute({ provider: "youtube", data: i });
6463
+ i.event, $.execute({ provider: "youtube", data: i });
6439
6464
  break;
6440
6465
  }
6441
6466
  case "subscriber-latest": {
@@ -6471,21 +6496,21 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6471
6496
  "event:test",
6472
6497
  "kvstore:update"
6473
6498
  ];
6474
- client.debug && !a.some((i) => i === t.data.listener) && N.received(
6499
+ client.debug && !a.some((i) => i === t.data.listener) && R.received(
6475
6500
  "[Client]",
6476
6501
  `Event ${t.data.listener} received from ${t.provider}`,
6477
6502
  t.data.event
6478
6503
  );
6479
6504
  }
6480
6505
  }));
6481
- class gt extends X {
6506
+ class gt extends Z {
6482
6507
  constructor(e) {
6483
6508
  if (super(), this.queue = [], this.priorityQueue = [], this.history = [], this.timeouts = [], this.running = !1, this.duration = void 0, this.loaded = !1, this.clientWaitRetryDelay = 50, !e.processor || typeof e.processor != "function")
6484
6509
  throw new Error("A valid processor function must be provided to useQueue.");
6485
6510
  this.processor = e.processor, e.duration !== "client" && (this.duration = e.duration ?? 0), this.waitForClientAndBindLoad(e.duration);
6486
6511
  }
6487
6512
  waitForClientAndBindLoad(e = this.duration, t) {
6488
- if (!(window?.client instanceof q)) {
6513
+ if (!(window?.client instanceof G)) {
6489
6514
  setTimeout(
6490
6515
  () => this.waitForClientAndBindLoad(e, t),
6491
6516
  this.clientWaitRetryDelay
@@ -6493,7 +6518,7 @@ class gt extends X {
6493
6518
  return;
6494
6519
  }
6495
6520
  window.client.on("load", () => {
6496
- e === "client" && (this.duration = window.client.fields?.widgetDuration ?? 0), this.emit("load"), this.loaded = !0, t && t();
6521
+ e === "client" && (this.duration = window?.client?.fields?.widgetDuration ?? 0), this.emit("load"), this.loaded = !0, t && t();
6497
6522
  });
6498
6523
  }
6499
6524
  enqueue(e, t = {}) {
@@ -6526,7 +6551,7 @@ class gt extends X {
6526
6551
  try {
6527
6552
  await this.processor.apply(this, [e.value, this]), this.emit("process", e, this);
6528
6553
  } catch (a) {
6529
- N.error(
6554
+ R.error(
6530
6555
  `Error during item processing: ${a instanceof Error ? a.message : String(a)}`
6531
6556
  );
6532
6557
  }
@@ -6579,14 +6604,14 @@ class gt extends X {
6579
6604
  return e === "load" && this.loaded ? (t.apply(this), this) : (super.on(e, t), this);
6580
6605
  }
6581
6606
  }
6582
- var G;
6607
+ var B;
6583
6608
  ((l) => {
6584
6609
  l.queue = new gt({
6585
6610
  duration: "client",
6586
6611
  processor: async function(a) {
6587
- if (window.dispatchEvent(new CustomEvent(a.listener, { detail: a.data })), a.listener === "onEventReceived" && a.session && client instanceof q && window?.client && window?.client?.session) {
6612
+ if (window.dispatchEvent(new CustomEvent(a.listener, { detail: a.data })), a.listener === "onEventReceived" && a.session) {
6588
6613
  const i = await l.generate.event.onSessionUpdate(
6589
- window?.client?.session,
6614
+ window?.client && window?.client instanceof G ? window.client.session : void 0,
6590
6615
  w.event.parseProvider(a.data)
6591
6616
  );
6592
6617
  window.dispatchEvent(new CustomEvent("onSessionUpdate", { detail: i }));
@@ -6595,11 +6620,11 @@ var G;
6595
6620
  }), l.generate = {
6596
6621
  session: {
6597
6622
  types: {
6598
- name: { type: "string", options: A.names.filter((t) => t.length) },
6599
- tier: { type: "string", options: A.tiers.filter((t) => t.length) },
6600
- message: { type: "string", options: A.messages.filter((t) => t.length) },
6601
- item: { type: "array", options: A.items },
6602
- avatar: { type: "string", options: A.avatars.filter((t) => t.length) }
6623
+ name: { type: "string", options: M.names.filter((t) => t.length) },
6624
+ tier: { type: "string", options: M.tiers.filter((t) => t.length) },
6625
+ message: { type: "string", options: M.messages.filter((t) => t.length) },
6626
+ item: { type: "array", options: M.items },
6627
+ avatar: { type: "string", options: M.avatars.filter((t) => t.length) }
6603
6628
  },
6604
6629
  available() {
6605
6630
  const t = this.types;
@@ -6973,16 +6998,16 @@ var G;
6973
6998
  const m = (p) => {
6974
6999
  if (!p || !("amount" in p)) return [];
6975
7000
  const o = [];
6976
- for (let h = 0; h < p.amount; h++)
7001
+ for (let d = 0; d < p.amount; d++)
6977
7002
  o.push(i(p.value));
6978
7003
  return o.sort(
6979
- (h, f) => new Date(f.createdAt).getTime() - new Date(h.createdAt).getTime()
7004
+ (d, f) => new Date(f.createdAt).getTime() - new Date(d.createdAt).getTime()
6980
7005
  );
6981
7006
  }, c = (p) => {
6982
7007
  const o = {};
6983
- for (const h in p) {
6984
- const f = h.replace("_type", "type");
6985
- o[f] = i(p[h]);
7008
+ for (const d in p) {
7009
+ const f = d.replace("_type", "type");
7010
+ o[f] = i(p[d]);
6986
7011
  }
6987
7012
  return o;
6988
7013
  }, b = (p) => {
@@ -7078,8 +7103,8 @@ var G;
7078
7103
  }
7079
7104
  const o = t[`cheer-${p}-top-donation`];
7080
7105
  o && n > o.amount && (o.amount = n, o.name = m);
7081
- const h = t[`cheer-${p}-top-donator`], f = t["cheer-recent"].filter((g) => g.name.toLowerCase() === h.name.toLowerCase()).reduce((g, y) => g + y.amount, 0), d = t["cheer-recent"].filter((g) => g.name.toLowerCase() === m.toLowerCase()).reduce((g, y) => g + y.amount, 0);
7082
- d > f && (h.amount = d, h.name = m);
7106
+ const d = t[`cheer-${p}-top-donator`], f = t["cheer-recent"].filter((g) => g.name.toLowerCase() === d.name.toLowerCase()).reduce((g, y) => g + y.amount, 0), h = t["cheer-recent"].filter((g) => g.name.toLowerCase() === m.toLowerCase()).reduce((g, y) => g + y.amount, 0);
7107
+ h > f && (d.amount = h, d.name = m);
7083
7108
  };
7084
7109
  b("all"), t["cheer-session"].amount += n, t["cheer-week"].amount += n, t["cheer-month"].amount += n, t["cheer-total"].amount += n, t["cheer-count"].count += 1, t["cheer-goal"].amount += n, t["cheer-recent"].unshift({
7085
7110
  name: m,
@@ -7156,8 +7181,8 @@ var G;
7156
7181
  }
7157
7182
  const p = t[`superchat-${b}-top-donation`];
7158
7183
  p && m > p.amount && (p.amount = m, p.name = n);
7159
- const o = t[`superchat-${b}-top-donator`], h = t["superchat-recent"].filter((d) => d.name.toLowerCase() === o.name.toLowerCase()).reduce((d, g) => d + g.amount, 0), f = t["superchat-recent"].filter((d) => d.name.toLowerCase() === n.toLowerCase()).reduce((d, g) => d + g.amount, 0);
7160
- f > h && (o.amount = f, o.name = n);
7184
+ const o = t[`superchat-${b}-top-donator`], d = t["superchat-recent"].filter((h) => h.name.toLowerCase() === o.name.toLowerCase()).reduce((h, g) => h + g.amount, 0), f = t["superchat-recent"].filter((h) => h.name.toLowerCase() === n.toLowerCase()).reduce((h, g) => h + g.amount, 0);
7185
+ f > d && (o.amount = f, o.name = n);
7161
7186
  };
7162
7187
  c("all"), t["superchat-session"].amount += m, t["superchat-week"].amount += m, t["superchat-month"].amount += m, t["superchat-total"].amount += m, t["superchat-count"].count += 1, t["superchat-goal"].amount += m, t["superchat-recent"].unshift({
7163
7188
  name: n.toLowerCase(),
@@ -7185,8 +7210,8 @@ var G;
7185
7210
  }
7186
7211
  const p = t[`tip-${b}-top-donation`];
7187
7212
  p && m > p.amount && (p.amount = m, p.name = n);
7188
- const o = t[`tip-${b}-top-donator`], h = t["tip-recent"].filter((d) => d.name.toLowerCase() === o.name.toLowerCase()).reduce((d, g) => d + g.amount, 0), f = t["tip-recent"].filter((d) => d.name.toLowerCase() === n.toLowerCase()).reduce((d, g) => d + g.amount, 0);
7189
- f > h && (o.amount = f, o.name = n);
7213
+ const o = t[`tip-${b}-top-donator`], d = t["tip-recent"].filter((h) => h.name.toLowerCase() === o.name.toLowerCase()).reduce((h, g) => h + g.amount, 0), f = t["tip-recent"].filter((h) => h.name.toLowerCase() === n.toLowerCase()).reduce((h, g) => h + g.amount, 0);
7214
+ f > d && (o.amount = f, o.name = n);
7190
7215
  };
7191
7216
  c("all"), t["tip-session"].amount += m, t["tip-week"].amount += m, t["tip-month"].amount += m, t["tip-total"].amount += m, t["tip-count"].count += 1, t["tip-goal"].amount += m, t["tip-recent"].unshift({
7192
7217
  name: n,
@@ -7233,7 +7258,7 @@ var G;
7233
7258
  default:
7234
7259
  case "random": {
7235
7260
  var n = w.random.array(
7236
- Object.keys(s).filter((R) => s[R].length)
7261
+ Object.keys(s).filter((D) => s[D].length)
7237
7262
  )[0], m = w.random.array(
7238
7263
  s[n]
7239
7264
  )[0];
@@ -7249,10 +7274,22 @@ var G;
7249
7274
  return this.onEventReceived(t, m);
7250
7275
  }
7251
7276
  case "message": {
7252
- var c = i?.name ?? w.random.array(A.names.filter((H) => H.length))[0], b = i?.message ?? w.random.array(A.messages.filter((H) => H.length))[0], p = await w.message.generateBadges(
7253
- i?.badges ?? [],
7254
- t
7255
- ), o = w.message.findEmotesInText(b), h = w.message.replaceEmotesWithHTML(b, o), f = i?.color ?? w.random.color("hex"), d = i?.userId ?? w.random.number(1e7, 99999999).toString(), g = i?.msgId ?? w.random.uuid(), y = i?.time ?? Date.now(), v = i?.channel ?? window?.client?.details?.user?.username ?? "local";
7277
+ const D = i;
7278
+ var c = D?.name ?? w.random.array(M.names.filter((q) => q.length))[0], b = D?.message ?? w.random.array(M.messages.filter((q) => q.length))[0], p = await w.message.generateBadges(D?.badges ?? [], t), o = w.message.findEmotesInText(b), d = w.message.replaceEmotesWithHTML(b, o), f = D?.color ?? w.random.color("hex"), h = D?.userId ?? w.random.string(16), g = D?.msgId ?? w.random.string(16), y = D?.time ?? Date.now(), C = D?.channel ?? window?.client?.details?.user?.username ?? "local", k = D?.reply ? {
7279
+ "reply-parent-display-name": D.reply.name,
7280
+ "reply-parent-msg-body": D.reply.text,
7281
+ "reply-parent-msg-id": D.reply.msgId,
7282
+ "reply-parent-user-id": D.reply.userId,
7283
+ "reply-parent-user-login": D.reply.name.toLowerCase()
7284
+ } : {}, S = D?.thread ? {
7285
+ "reply-thread-parent-msg-id": D.thread.msgId,
7286
+ "reply-thread-parent-user-login": D.thread.name.toLowerCase()
7287
+ } : {}, J = {
7288
+ vip: p.keys.includes("vip") ? "" : void 0,
7289
+ subscriber: p.keys.includes("subscriber") ? "1" : "0",
7290
+ mod: p.keys.includes("moderator") ? "1" : "0",
7291
+ turbo: p.keys.includes("turbo") ? "1" : "0"
7292
+ };
7256
7293
  return {
7257
7294
  listener: "message",
7258
7295
  event: {
@@ -7260,13 +7297,11 @@ var G;
7260
7297
  data: {
7261
7298
  time: y,
7262
7299
  tags: {
7263
- "badge-info": `${p.keys.map((H) => `${H}/${w.random.number(1, 5)}`).join(",")}`,
7264
- badges: p.keys.join("/1,"),
7265
- mod: p.keys.includes("moderator") ? "1" : "0",
7266
- subscriber: p.keys.includes("subscriber") ? "1" : "0",
7267
- turbo: p.keys.includes("turbo") ? "1" : "0",
7300
+ "badge-info": `${p.keys.map((q) => `${q}/${p.amount[q] ?? w.random.number(1, 5)}`).join(",")}`,
7301
+ badges: p.keys.map((q) => `${q}/1`).join(","),
7302
+ ...J,
7268
7303
  "tmi-sent-ts": y.toString(),
7269
- "user-id": d,
7304
+ "user-id": h,
7270
7305
  "user-type": "",
7271
7306
  color: f,
7272
7307
  "display-name": c,
@@ -7274,21 +7309,23 @@ var G;
7274
7309
  "client-nonce": w.random.string(16),
7275
7310
  flags: "",
7276
7311
  id: g,
7277
- "first-msg": "0",
7278
- "returning-chatter": "0"
7312
+ "first-msg": D?.firstMsg ? "1" : "0",
7313
+ "returning-chatter": D?.returningChatter ? "1" : "0",
7314
+ ...k,
7315
+ ...S
7279
7316
  },
7280
7317
  nick: c.toLowerCase(),
7281
7318
  displayName: c,
7282
7319
  displayColor: f,
7283
- channel: v,
7320
+ channel: C,
7284
7321
  text: b,
7285
7322
  isAction: !1,
7286
- userId: d,
7323
+ userId: h,
7287
7324
  msgId: g,
7288
7325
  badges: p.badges,
7289
7326
  emotes: o
7290
7327
  },
7291
- renderedText: h
7328
+ renderedText: d
7292
7329
  },
7293
7330
  // @ts-ignore
7294
7331
  emulated: !0
@@ -7296,12 +7333,12 @@ var G;
7296
7333
  }
7297
7334
  case "cheer":
7298
7335
  case "cheer-latest": {
7299
- var C = i?.amount ?? w.random.number(100, 1e4), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((O) => O.length))[0], b = i?.message ?? w.random.array(A.messages.filter((O) => O.length))[0];
7336
+ var E = i?.amount ?? w.random.number(100, 1e4), T = i?.avatar ?? w.random.array(M.avatars)[0], c = i?.name ?? w.random.array(M.names.filter((F) => F.length))[0], b = i?.message ?? w.random.array(M.messages.filter((F) => F.length))[0];
7300
7337
  return {
7301
7338
  listener: "cheer-latest",
7302
7339
  event: {
7303
- amount: C,
7304
- avatar: x,
7340
+ amount: E,
7341
+ avatar: T,
7305
7342
  name: c.toLowerCase(),
7306
7343
  displayName: c,
7307
7344
  message: b,
@@ -7318,11 +7355,11 @@ var G;
7318
7355
  }
7319
7356
  case "follower":
7320
7357
  case "follower-latest": {
7321
- var x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((O) => O.length))[0];
7358
+ var T = i?.avatar ?? w.random.array(M.avatars)[0], c = i?.name ?? w.random.array(M.names.filter((F) => F.length))[0];
7322
7359
  return {
7323
7360
  listener: "follower-latest",
7324
7361
  event: {
7325
- avatar: x,
7362
+ avatar: T,
7326
7363
  name: c.toLowerCase(),
7327
7364
  displayName: c,
7328
7365
  providerId: "",
@@ -7338,12 +7375,12 @@ var G;
7338
7375
  }
7339
7376
  case "raid":
7340
7377
  case "raid-latest": {
7341
- var C = i?.amount ?? w.random.number(1, 100), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((F) => F.length))[0];
7378
+ var E = i?.amount ?? w.random.number(1, 100), T = i?.avatar ?? w.random.array(M.avatars)[0], c = i?.name ?? w.random.array(M.names.filter((Q) => Q.length))[0];
7342
7379
  return {
7343
7380
  listener: "raid-latest",
7344
7381
  event: {
7345
- amount: C,
7346
- avatar: x,
7382
+ amount: E,
7383
+ avatar: T,
7347
7384
  name: c.toLowerCase(),
7348
7385
  displayName: c,
7349
7386
  providerId: "",
@@ -7359,36 +7396,36 @@ var G;
7359
7396
  }
7360
7397
  case "subscriber":
7361
7398
  case "subscriber-latest": {
7362
- var S = i?.tier ?? w.random.array(["1000", "2000", "3000", "prime"])[0], C = i?.amount ?? w.random.number(1, 24), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((B) => B.length))[0], D = i?.sender ?? w.random.array(A.names.filter((B) => B.length && B !== c))[0], b = i?.message ?? w.random.array(A.messages.filter((B) => B.length))[0], M = {
7399
+ var _ = i?.tier ?? w.random.array(["1000", "2000", "3000", "prime"])[0], E = i?.amount ?? w.random.number(1, 24), T = i?.avatar ?? w.random.array(M.avatars)[0], c = i?.name ?? w.random.array(M.names.filter((Y) => Y.length))[0], j = i?.sender ?? w.random.array(M.names.filter((Y) => Y.length && Y !== c))[0], b = i?.message ?? w.random.array(M.messages.filter((Y) => Y.length))[0], P = {
7363
7400
  default: {
7364
- avatar: x,
7401
+ avatar: T,
7365
7402
  playedAsCommunityGift: !1
7366
7403
  },
7367
7404
  gift: {
7368
- sender: D,
7405
+ sender: j,
7369
7406
  gifted: !0
7370
7407
  },
7371
7408
  community: {
7372
7409
  message: b,
7373
- sender: D,
7410
+ sender: j,
7374
7411
  bulkGifted: !0
7375
7412
  },
7376
7413
  spam: {
7377
- sender: D,
7414
+ sender: j,
7378
7415
  gifted: !0,
7379
7416
  isCommunityGift: !0
7380
7417
  }
7381
- }, _ = ["default", "gift", "community", "spam"], j = i?.subType ?? w.random.array(_)[0];
7382
- return j = _.includes(j) ? j : "default", {
7418
+ }, O = ["default", "gift", "community", "spam"], z = i?.subType ?? w.random.array(O)[0];
7419
+ return z = O.includes(z) ? z : "default", {
7383
7420
  listener: "subscriber-latest",
7384
7421
  event: {
7385
- amount: C,
7422
+ amount: E,
7386
7423
  name: c.toLowerCase(),
7387
7424
  displayName: c,
7388
7425
  providerId: "",
7389
- tier: S,
7390
- ...M.default,
7391
- ...M[j],
7426
+ tier: _,
7427
+ ...P.default,
7428
+ ...P[z],
7392
7429
  _id: w.random.uuid(),
7393
7430
  sessionTop: !1,
7394
7431
  type: "subscriber",
@@ -7431,12 +7468,12 @@ var G;
7431
7468
  }
7432
7469
  case "tip":
7433
7470
  case "tip-latest": {
7434
- var C = i?.amount ?? w.random.number(100, 4e3), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((F) => F.length))[0];
7471
+ var E = i?.amount ?? w.random.number(100, 4e3), T = i?.avatar ?? w.random.array(M.avatars)[0], c = i?.name ?? w.random.array(M.names.filter((Q) => Q.length))[0];
7435
7472
  return {
7436
7473
  listener: "tip-latest",
7437
7474
  event: {
7438
- amount: C,
7439
- avatar: x,
7475
+ amount: E,
7476
+ avatar: T,
7440
7477
  name: c.toLowerCase(),
7441
7478
  displayName: c,
7442
7479
  providerId: "",
@@ -7477,11 +7514,11 @@ var G;
7477
7514
  case "mute":
7478
7515
  case "unmute":
7479
7516
  case "alertService:toggleSound": {
7480
- var J = i?.muted ?? window?.client?.details?.overlay?.muted ?? !1;
7517
+ var W = i?.muted ?? window?.client?.details?.overlay?.muted ?? !1;
7481
7518
  return {
7482
7519
  listener: "alertService:toggleSound",
7483
7520
  event: {
7484
- muted: J,
7521
+ muted: W,
7485
7522
  provider: t
7486
7523
  },
7487
7524
  // @ts-ignore
@@ -7509,12 +7546,12 @@ var G;
7509
7546
  return this.onEventReceived(t, m);
7510
7547
  }
7511
7548
  case "message": {
7512
- var c = i?.name ?? w.random.array(A.names.filter((Q) => Q.length))[0], b = i?.message ?? w.random.array(A.messages.filter((Q) => Q.length))[0];
7513
- const W = await w.message.generateBadges(
7549
+ var c = i?.name ?? w.random.array(M.names.filter((u) => u.length))[0], b = i?.message ?? w.random.array(M.messages.filter((u) => u.length))[0];
7550
+ const q = await w.message.generateBadges(
7514
7551
  i?.badges ?? [],
7515
7552
  t
7516
7553
  );
7517
- var o = w.message.findEmotesInText(b), h = w.message.replaceEmotesWithHTML(b, o), f = i?.color ?? w.random.color("hex"), d = i?.userId ?? w.random.number(1e7, 99999999).toString(), g = i?.msgId ?? w.random.uuid(), y = i?.time ?? Date.now(), x = i?.avatar ?? w.random.array(A.avatars)[0], v = i?.channel ?? window?.client?.details?.user?.username ?? "local";
7554
+ var o = w.message.findEmotesInText(b), d = w.message.replaceEmotesWithHTML(b, o), f = i?.color ?? w.random.color("hex"), h = i?.userId ?? w.random.number(1e7, 99999999).toString(), g = i?.msgId ?? w.random.uuid(), y = i?.time ?? Date.now(), T = i?.avatar ?? w.random.array(M.avatars)[0], C = i?.channel ?? window?.client?.details?.user?.username ?? "local";
7518
7555
  return {
7519
7556
  listener: "message",
7520
7557
  event: {
@@ -7526,7 +7563,7 @@ var G;
7526
7563
  snippet: {
7527
7564
  type: "",
7528
7565
  liveChatId: "",
7529
- authorChannelId: v,
7566
+ authorChannelId: C,
7530
7567
  publishedAt: (/* @__PURE__ */ new Date()).toISOString(),
7531
7568
  hasDisplayContent: !0,
7532
7569
  displayMessage: b,
@@ -7535,14 +7572,14 @@ var G;
7535
7572
  }
7536
7573
  },
7537
7574
  authorDetails: {
7538
- channelId: v,
7575
+ channelId: C,
7539
7576
  channelUrl: "",
7540
7577
  displayName: c,
7541
- profileImageUrl: x,
7542
- ...W
7578
+ profileImageUrl: T,
7579
+ ...q
7543
7580
  },
7544
7581
  msgId: g,
7545
- userId: d,
7582
+ userId: h,
7546
7583
  nick: c.toLowerCase(),
7547
7584
  badges: [],
7548
7585
  displayName: c,
@@ -7550,9 +7587,9 @@ var G;
7550
7587
  time: y,
7551
7588
  tags: [],
7552
7589
  displayColor: f,
7553
- channel: v,
7590
+ channel: C,
7554
7591
  text: b,
7555
- avatar: x,
7592
+ avatar: T,
7556
7593
  emotes: []
7557
7594
  },
7558
7595
  renderedText: b
@@ -7563,11 +7600,11 @@ var G;
7563
7600
  }
7564
7601
  case "subscriber":
7565
7602
  case "subscriber-latest": {
7566
- var x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((O) => O.length))[0];
7603
+ var T = i?.avatar ?? w.random.array(M.avatars)[0], c = i?.name ?? w.random.array(M.names.filter((F) => F.length))[0];
7567
7604
  return {
7568
7605
  listener: "subscriber-latest",
7569
7606
  event: {
7570
- avatar: x,
7607
+ avatar: T,
7571
7608
  displayName: c,
7572
7609
  name: c.toLowerCase(),
7573
7610
  providerId: "",
@@ -7583,12 +7620,12 @@ var G;
7583
7620
  }
7584
7621
  case "superchat":
7585
7622
  case "superchat-latest": {
7586
- var C = i?.amount ?? w.random.number(100, 4e3), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((F) => F.length))[0];
7623
+ var E = i?.amount ?? w.random.number(100, 4e3), T = i?.avatar ?? w.random.array(M.avatars)[0], c = i?.name ?? w.random.array(M.names.filter((Q) => Q.length))[0];
7587
7624
  return {
7588
7625
  listener: "superchat-latest",
7589
7626
  event: {
7590
- amount: C,
7591
- avatar: x,
7627
+ amount: E,
7628
+ avatar: T,
7592
7629
  name: c.toLowerCase(),
7593
7630
  displayName: c,
7594
7631
  providerId: "",
@@ -7604,35 +7641,35 @@ var G;
7604
7641
  }
7605
7642
  case "sponsor":
7606
7643
  case "sponsor-latest": {
7607
- var S = i?.tier ?? w.random.array(["1000", "2000", "3000"])[0], C = i?.amount ?? w.random.number(1, 24), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((K) => K.length))[0], D = i?.sender ?? w.random.array(A.names.filter((K) => K.length && K !== c))[0], b = i?.message ?? w.random.array(A.messages.filter((K) => K.length))[0], M = {
7644
+ var _ = i?.tier ?? w.random.array(["1000", "2000", "3000"])[0], E = i?.amount ?? w.random.number(1, 24), T = i?.avatar ?? w.random.array(M.avatars)[0], c = i?.name ?? w.random.array(M.names.filter((K) => K.length))[0], j = i?.sender ?? w.random.array(M.names.filter((K) => K.length && K !== c))[0], b = i?.message ?? w.random.array(M.messages.filter((K) => K.length))[0], P = {
7608
7645
  default: {
7609
- avatar: x,
7646
+ avatar: T,
7610
7647
  playedAsCommunityGift: !1
7611
7648
  },
7612
7649
  gift: {
7613
- sender: D,
7650
+ sender: j,
7614
7651
  gifted: !0
7615
7652
  },
7616
7653
  community: {
7617
7654
  message: b,
7618
- sender: D,
7655
+ sender: j,
7619
7656
  bulkGifted: !0
7620
7657
  },
7621
7658
  spam: {
7622
- sender: D,
7659
+ sender: j,
7623
7660
  gifted: !0,
7624
7661
  isCommunityGift: !0
7625
7662
  }
7626
- }, _ = ["default", "gift", "community", "spam"], j = i?.subType ?? w.random.array(_)[0];
7627
- return j = _.includes(j) ? j : "default", {
7663
+ }, O = ["default", "gift", "community", "spam"], z = i?.subType ?? w.random.array(O)[0];
7664
+ return z = O.includes(z) ? z : "default", {
7628
7665
  listener: "sponsor-latest",
7629
7666
  event: {
7630
- amount: C,
7667
+ amount: E,
7631
7668
  name: c.toLowerCase(),
7632
7669
  displayName: c,
7633
7670
  providerId: "",
7634
- ...M.default,
7635
- ...M[j],
7671
+ ...P.default,
7672
+ ...P[z],
7636
7673
  _id: w.random.uuid(),
7637
7674
  sessionTop: !1,
7638
7675
  type: "sponsor",
@@ -7650,11 +7687,7 @@ var G;
7650
7687
  }, l.emulate = {
7651
7688
  twitch: {
7652
7689
  message(t = {}) {
7653
- l.generate.event.onEventReceived(
7654
- "twitch",
7655
- "message",
7656
- t
7657
- ).then((a) => {
7690
+ l.generate.event.onEventReceived("twitch", "message", t).then((a) => {
7658
7691
  a && l.emulate.send("onEventReceived", a);
7659
7692
  });
7660
7693
  },
@@ -7768,7 +7801,7 @@ var G;
7768
7801
  facebook: {},
7769
7802
  send(t, a) {
7770
7803
  if (!l.queue) {
7771
- N.warn("Local queue is not initialized."), window.dispatchEvent(new CustomEvent(t, { detail: a }));
7804
+ R.warn("Local queue is not initialized."), window.dispatchEvent(new CustomEvent(t, { detail: a }));
7772
7805
  return;
7773
7806
  }
7774
7807
  switch (t) {
@@ -7823,7 +7856,7 @@ var G;
7823
7856
  cache: "no-store"
7824
7857
  }).then((m) => m.json()).then(async (m) => {
7825
7858
  const c = Object.entries(m).filter(([p, { value: o }]) => o != null).reduce(
7826
- (p, [o, { value: h }]) => (n && n[o] !== void 0 && (h = n[o]), p[o] = h, p),
7859
+ (p, [o, { value: d }]) => (n && n[o] !== void 0 && (d = n[o]), p[o] = d, p),
7827
7860
  {
7828
7861
  ...n
7829
7862
  }
@@ -7835,7 +7868,7 @@ var G;
7835
7868
  });
7836
7869
  }
7837
7870
  l.start = e;
7838
- })(G || (G = {}));
7871
+ })(B || (B = {}));
7839
7872
  const rt = {
7840
7873
  getOverlayStatus: () => ({
7841
7874
  isEditorMode: !1,
@@ -7869,7 +7902,7 @@ const rt = {
7869
7902
  list: {}
7870
7903
  }
7871
7904
  };
7872
- async function Dt() {
7905
+ async function At() {
7873
7906
  let l = localStorage.getItem("SE_API-STORE") ?? "", e = l ? JSON.parse(l) : {};
7874
7907
  return rt.store.list = e, rt;
7875
7908
  }
@@ -7929,7 +7962,7 @@ var ot;
7929
7962
  }
7930
7963
  l.get = a;
7931
7964
  })(ot || (ot = {}));
7932
- class At extends X {
7965
+ class Jt extends Z {
7933
7966
  /**
7934
7967
  * Initializes a new ComfyJS instance and connects to Twitch chat.
7935
7968
  * @param options - Configuration options for ComfyJS instance.
@@ -7939,7 +7972,7 @@ class At extends X {
7939
7972
  super(), this.isDebug = !1, this.init = !1, this.emulate = !1, this.username = e.username, this.password = e.password, this.channels = e.channels, this.isDebug = !!e.isDebug, this.init = !!e.init, this.emulate = t, this.load().then((a) => {
7940
7973
  this.instance = a, this.emit("load", a), this.connect();
7941
7974
  }).catch((a) => {
7942
- N.error("useComfyJs: Failed to load ComfyJS", a);
7975
+ R.error("useComfyJs: Failed to load ComfyJS", a);
7943
7976
  });
7944
7977
  }
7945
7978
  /**
@@ -7961,9 +7994,9 @@ class At extends X {
7961
7994
  */
7962
7995
  connect() {
7963
7996
  this.instance.onError = (e) => {
7964
- this.emit("error", e), client?.debug && N.error("[Client]", "ComfyJS Error:", e);
7997
+ this.emit("error", e), client?.debug && R.error("[Client]", "ComfyJS Error:", e);
7965
7998
  }, this.instance.onCommand = (e, t, a, i, s) => {
7966
- if (this.emit("command", e, t, a, i, s), client?.debug && N.debug("[Client]", `ComfyJS Command: !${t} ${a} (User: ${e})`), this.emulate) {
7999
+ if (this.emit("command", e, t, a, i, s), client?.debug && R.debug("[Client]", `ComfyJS Command: !${t} ${a} (User: ${e})`), this.emulate) {
7967
8000
  const n = {
7968
8001
  ...i,
7969
8002
  broadcaster: i.broadcaster,
@@ -7981,10 +8014,10 @@ class At extends X {
7981
8014
  msgId: s.id,
7982
8015
  channel: s.channel
7983
8016
  };
7984
- G.emulate.twitch.message(m);
8017
+ B.emulate.twitch.message(m);
7985
8018
  }
7986
8019
  }, this.instance.onChat = (e, t, a, i, s) => {
7987
- if (this.emit("chat", e, t, a, i, s), client?.debug && N.debug("[Client]", `ComfyJS Chat: ${t} (User: ${e})`), this.emulate) {
8020
+ if (this.emit("chat", e, t, a, i, s), client?.debug && R.debug("[Client]", `ComfyJS Chat: ${t} (User: ${e})`), this.emulate) {
7988
8021
  const n = {
7989
8022
  ...a,
7990
8023
  ...s.userBadges,
@@ -7994,7 +8027,7 @@ class At extends X {
7994
8027
  subscriber: a.subscriber,
7995
8028
  founder: a.founder
7996
8029
  };
7997
- G.emulate.twitch.message({
8030
+ B.emulate.twitch.message({
7998
8031
  name: e,
7999
8032
  message: t,
8000
8033
  badges: Object.entries(n).map(([m, c]) => c ? m : null).filter(Boolean),
@@ -8006,24 +8039,24 @@ class At extends X {
8006
8039
  });
8007
8040
  }
8008
8041
  }, this.instance.onWhisper = (e, t, a, i, s) => {
8009
- this.emit("whisper", e, t, a, i, s), client?.debug && N.debug("[Client]", `ComfyJS Whisper: ${t} (User: ${e})`);
8042
+ this.emit("whisper", e, t, a, i, s), client?.debug && R.debug("[Client]", `ComfyJS Whisper: ${t} (User: ${e})`);
8010
8043
  }, this.instance.onMessageDeleted = (e, t) => {
8011
- this.emit("messageDeleted", e, t), client?.debug && N.debug("[Client]", `ComfyJS Message Deleted: ${e}`), this.emulate && G.emulate.twitch.deleteMessage(e);
8044
+ this.emit("messageDeleted", e, t), client?.debug && R.debug("[Client]", `ComfyJS Message Deleted: ${e}`), this.emulate && B.emulate.twitch.deleteMessage(e);
8012
8045
  }, this.instance.onJoin = (e, t, a) => {
8013
- this.emit("join", e, t, a), client?.debug && N.debug("[Client]", `ComfyJS Join: ${e}`);
8046
+ this.emit("join", e, t, a), client?.debug && R.debug("[Client]", `ComfyJS Join: ${e}`);
8014
8047
  }, this.instance.onPart = (e, t, a) => {
8015
- this.emit("part", e, t, a), client?.debug && N.debug("[Client]", `ComfyJS Part: ${e}`);
8048
+ this.emit("part", e, t, a), client?.debug && R.debug("[Client]", `ComfyJS Part: ${e}`);
8016
8049
  }, this.instance.onHosted = (e, t, a, i) => {
8017
- this.emit("hosted", e, t, a, i), client?.debug && N.debug("[Client]", `ComfyJS Hosted: ${e} (${t} viewers)`);
8050
+ this.emit("hosted", e, t, a, i), client?.debug && R.debug("[Client]", `ComfyJS Hosted: ${e} (${t} viewers)`);
8018
8051
  }, this.instance.onRaid = (e, t, a) => {
8019
- this.emit("raid", e, t, a), client?.debug && N.debug("[Client]", `ComfyJS Raid: ${e} (${t} viewers)`), this.emulate && G.emulate.twitch.raid({
8052
+ this.emit("raid", e, t, a), client?.debug && R.debug("[Client]", `ComfyJS Raid: ${e} (${t} viewers)`), this.emulate && B.emulate.twitch.raid({
8020
8053
  name: e,
8021
8054
  amount: t
8022
8055
  });
8023
8056
  }, this.instance.onSub = (e, t, a, i) => {
8024
- if (this.emit("sub", e, t, a, i), client?.debug && N.debug("[Client]", `ComfyJS Sub: ${e} (${a.plan})`), this.emulate) {
8057
+ if (this.emit("sub", e, t, a, i), client?.debug && R.debug("[Client]", `ComfyJS Sub: ${e} (${a.plan})`), this.emulate) {
8025
8058
  const s = a.plan === "Prime" ? "prime" : a.plan;
8026
- G.emulate.twitch.subscriber({
8059
+ B.emulate.twitch.subscriber({
8027
8060
  name: e,
8028
8061
  message: t,
8029
8062
  tier: s,
@@ -8031,9 +8064,9 @@ class At extends X {
8031
8064
  });
8032
8065
  }
8033
8066
  }, this.instance.onResub = (e, t, a, i, s, n) => {
8034
- if (this.emit("resub", e, t, a, i, s, n), client?.debug && N.debug("[Client]", `ComfyJS Resub: ${e} (${i} months)`), this.emulate) {
8067
+ if (this.emit("resub", e, t, a, i, s, n), client?.debug && R.debug("[Client]", `ComfyJS Resub: ${e} (${i} months)`), this.emulate) {
8035
8068
  const m = s.plan === "Prime" ? "prime" : s.plan;
8036
- G.emulate.twitch.subscriber({
8069
+ B.emulate.twitch.subscriber({
8037
8070
  name: e,
8038
8071
  message: t,
8039
8072
  tier: m,
@@ -8050,9 +8083,9 @@ class At extends X {
8050
8083
  i,
8051
8084
  s,
8052
8085
  n
8053
- ), client?.debug && N.debug("[Client]", `ComfyJS Sub Gift: ${e} gifted ${i} subs`), this.emulate) {
8086
+ ), client?.debug && R.debug("[Client]", `ComfyJS Sub Gift: ${e} gifted ${i} subs`), this.emulate) {
8054
8087
  const m = s.plan === "Prime" ? "prime" : s.plan;
8055
- G.emulate.twitch.subscriber({
8088
+ B.emulate.twitch.subscriber({
8056
8089
  name: a,
8057
8090
  message: "",
8058
8091
  sender: e,
@@ -8062,12 +8095,12 @@ class At extends X {
8062
8095
  });
8063
8096
  }
8064
8097
  }, this.instance.onSubMysteryGift = (e, t, a, i, s) => {
8065
- if (this.emit("subMysteryGift", e, t, a, i, s), client?.debug && N.debug(
8098
+ if (this.emit("subMysteryGift", e, t, a, i, s), client?.debug && R.debug(
8066
8099
  "[Client]",
8067
8100
  `ComfyJS Sub Mystery Gift: ${e} gifted ${t} subs`
8068
8101
  ), this.emulate) {
8069
8102
  const n = i.plan === "Prime" ? "prime" : i.plan;
8070
- G.emulate.twitch.subscriber({
8103
+ B.emulate.twitch.subscriber({
8071
8104
  name: e,
8072
8105
  message: "",
8073
8106
  amount: t,
@@ -8076,10 +8109,10 @@ class At extends X {
8076
8109
  });
8077
8110
  }
8078
8111
  }, this.instance.onGiftSubContinue = (e, t, a) => {
8079
- this.emit("giftSubContinue", e, t, a), client?.debug && N.debug(
8112
+ this.emit("giftSubContinue", e, t, a), client?.debug && R.debug(
8080
8113
  "[Client]",
8081
8114
  `ComfyJS Gift Sub Continue: ${e} continued their gifted sub from ${t}`
8082
- ), this.emulate && G.emulate.twitch.subscriber({
8115
+ ), this.emulate && B.emulate.twitch.subscriber({
8083
8116
  name: e,
8084
8117
  message: "",
8085
8118
  sender: t,
@@ -8087,25 +8120,25 @@ class At extends X {
8087
8120
  subType: "gift"
8088
8121
  });
8089
8122
  }, this.instance.onCheer = (e, t, a, i, s) => {
8090
- this.emit("cheer", e, t, a, i, s), client?.debug && N.debug("[Client]", `ComfyJS Cheer: ${e} cheered ${a} bits - ${t}`), this.emulate && G.emulate.twitch.cheer({
8123
+ this.emit("cheer", e, t, a, i, s), client?.debug && R.debug("[Client]", `ComfyJS Cheer: ${e} cheered ${a} bits - ${t}`), this.emulate && B.emulate.twitch.cheer({
8091
8124
  name: e,
8092
8125
  message: t,
8093
8126
  amount: a
8094
8127
  });
8095
8128
  }, this.instance.onChatMode = (e, t) => {
8096
- this.emit("chatMode", e, t), client?.debug && N.debug("[Client]", `ComfyJS Chat Mode Changed on ${t}`);
8129
+ this.emit("chatMode", e, t), client?.debug && R.debug("[Client]", `ComfyJS Chat Mode Changed on ${t}`);
8097
8130
  }, this.instance.onReward = (e, t, a, i, s) => {
8098
- this.emit("reward", e, t, a, i, s), client?.debug && N.debug(
8131
+ this.emit("reward", e, t, a, i, s), client?.debug && R.debug(
8099
8132
  "[Client]",
8100
8133
  `ComfyJS Reward: ${e} redeemed ${t} for ${a} - ${i}`
8101
8134
  );
8102
8135
  }, this.instance.onConnected = (e, t, a) => {
8103
- this.emit("connected", e, t, a), client?.debug && N.debug(
8136
+ this.emit("connected", e, t, a), client?.debug && R.debug(
8104
8137
  "[Client]",
8105
8138
  `ComfyJS Connected: ${e}:${t} (First Connect: ${a})`
8106
8139
  );
8107
8140
  }, this.instance.onReconnect = (e) => {
8108
- this.emit("reconnect", e), client?.debug && N.debug("[Client]", `ComfyJS Reconnect: Attempt #${e}`);
8141
+ this.emit("reconnect", e), client?.debug && R.debug("[Client]", `ComfyJS Reconnect: Attempt #${e}`);
8109
8142
  }, this.init && this.instance.Init(this.username, this.password, this.channels, this.isDebug);
8110
8143
  }
8111
8144
  }
@@ -8208,30 +8241,30 @@ class pt {
8208
8241
  !this.enabled || !console.timeEnd || console.timeEnd(e);
8209
8242
  }
8210
8243
  }
8211
- const ct = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(Dt()), N = new pt(), mt = {
8244
+ const ct = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(At()), R = new pt(), mt = {
8212
8245
  SeAPI: ct,
8213
- Client: q,
8246
+ Client: G,
8214
8247
  Helper: w,
8215
- Local: G,
8216
- Data: A,
8217
- logger: N,
8248
+ Local: B,
8249
+ Data: M,
8250
+ logger: R,
8218
8251
  modules: {
8219
- EventProvider: X,
8220
- useStorage: it,
8252
+ EventProvider: Z,
8253
+ useStorage: at,
8221
8254
  useQueue: gt,
8222
8255
  useLogger: pt,
8223
- useComms: St
8256
+ useComms: Dt
8224
8257
  },
8225
8258
  actions: {
8226
- Button: at,
8227
- Command: Z
8259
+ Button: st,
8260
+ Command: $
8228
8261
  },
8229
8262
  multistream: {
8230
- useComfyJs: At
8263
+ useComfyJs: Jt
8231
8264
  },
8232
8265
  data: {
8233
- usedStorages: tt,
8234
- usedComms: et
8266
+ usedStorages: et,
8267
+ usedComms: it
8235
8268
  },
8236
8269
  pronouns: {
8237
8270
  Alejo: ot