@tixyel/streamelements 6.4.1 → 6.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -5649,7 +5649,7 @@ var w;
5649
5649
  let y = "$", v = "USD";
5650
5650
  if (typeof window < "u")
5651
5651
  try {
5652
- const u = window.client?.details?.currency;
5652
+ const u = window?.client?.details?.currency;
5653
5653
  u?.symbol && (y = String(u.symbol)), u?.code && (v = String(u.code));
5654
5654
  } catch {
5655
5655
  }
@@ -6584,9 +6584,9 @@ var G;
6584
6584
  l.queue = new gt({
6585
6585
  duration: "client",
6586
6586
  processor: async function(a) {
6587
- if (window.dispatchEvent(new CustomEvent(a.listener, { detail: a.data })), a.listener === "onEventReceived" && a.session && client instanceof q && client && client?.session) {
6587
+ if (window.dispatchEvent(new CustomEvent(a.listener, { detail: a.data })), a.listener === "onEventReceived" && a.session && client instanceof q && window?.client && window?.client?.session) {
6588
6588
  const i = await l.generate.event.onSessionUpdate(
6589
- client.session,
6589
+ window?.client?.session,
6590
6590
  w.event.parseProvider(a.data)
6591
6591
  );
6592
6592
  window.dispatchEvent(new CustomEvent("onSessionUpdate", { detail: i }));
@@ -7252,7 +7252,7 @@ var G;
7252
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
7253
  i?.badges ?? [],
7254
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 ?? client?.details?.user?.username ?? "local";
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";
7256
7256
  return {
7257
7257
  listener: "message",
7258
7258
  event: {
@@ -7477,7 +7477,7 @@ var G;
7477
7477
  case "mute":
7478
7478
  case "unmute":
7479
7479
  case "alertService:toggleSound": {
7480
- var J = i?.muted ?? client?.details?.overlay?.muted ?? !1;
7480
+ var J = i?.muted ?? window?.client?.details?.overlay?.muted ?? !1;
7481
7481
  return {
7482
7482
  listener: "alertService:toggleSound",
7483
7483
  event: {
@@ -7514,7 +7514,7 @@ var G;
7514
7514
  i?.badges ?? [],
7515
7515
  t
7516
7516
  );
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 ?? client?.details?.user?.username ?? "local";
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";
7518
7518
  return {
7519
7519
  listener: "message",
7520
7520
  event: {
@@ -7899,7 +7899,7 @@ var ot;
7899
7899
  l.list = t;
7900
7900
  async function a(i) {
7901
7901
  if (!i) throw new Error("Username is required to fetch Alejo data.");
7902
- if (i = i.toLowerCase(), !client) {
7902
+ if (i = i.toLowerCase(), !window?.client) {
7903
7903
  try {
7904
7904
  const s = await fetch(`https://pronouns.alejo.io/api/users/${i}`).then((n) => n.json()).then(([n]) => n);
7905
7905
  if (s)
@@ -7911,16 +7911,16 @@ var ot;
7911
7911
  }
7912
7912
  return;
7913
7913
  }
7914
- if (i in client.storage.data.pronoun && client.storage.data.pronoun[i].expire > Date.now())
7915
- return client.storage.data.pronoun[i].value;
7914
+ if (i in window?.client?.storage.data.pronoun && window?.client?.storage.data.pronoun[i].expire > Date.now())
7915
+ return window?.client?.storage.data.pronoun[i].value;
7916
7916
  try {
7917
7917
  const s = await fetch(`https://pronouns.alejo.io/api/users/${i}`).then((n) => n.json()).then(([n]) => n);
7918
7918
  if (s)
7919
- return client.storage.add(`pronoun.${i}`, {
7919
+ return window?.client?.storage.add(`pronoun.${i}`, {
7920
7920
  value: s.pronoun_id,
7921
7921
  timestamp: Date.now(),
7922
- expire: Date.now() + client.cache.pronoun * 60 * 1e3
7923
- }), client.storage.data.pronoun[i].value ?? s.pronoun_id;
7922
+ expire: Date.now() + window?.client?.cache.pronoun * 60 * 1e3
7923
+ }), window?.client?.storage.data.pronoun[i].value ?? s.pronoun_id;
7924
7924
  } catch (s) {
7925
7925
  throw new Error(
7926
7926
  `Failed to fetch pronoun data for user "${i}": ${s instanceof Error ? s.message : s}`