@codingfactory/messenger-client 0.2.17 → 0.2.18

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.
Files changed (2) hide show
  1. package/dist/index.js +301 -303
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -400,8 +400,8 @@ function He(e, n) {
400
400
  const i = lo(e, n), o = typeof e.is_muted == "boolean" ? e.is_muted : i !== null || n?.is_muted === !0, c = e.last_message ? at(e.last_message) : n?.last_message, l = e.last_message_at ?? n?.last_message_at, d = typeof e.unread_count == "number" ? e.unread_count : n?.unread_count ?? 0, g = typeof e.is_pinned == "boolean" ? e.is_pinned : e.me?.is_pinned ?? n?.is_pinned ?? !1, h = typeof e.is_archived == "boolean" ? e.is_archived : e.me?.is_archived ?? n?.is_archived ?? !1, x = ho(e, n), M = typeof e.created_at == "string" ? e.created_at : n?.created_at ?? "", _ = (() => {
401
401
  if (!n || n.unread_count !== 0 || d <= 0)
402
402
  return !1;
403
- const C = n.last_message?.id, b = e.last_message?.id;
404
- return !C || !b ? !1 : C === b;
403
+ const C = n.last_message?.id, v = e.last_message?.id;
404
+ return !C || !v ? !1 : C === v;
405
405
  })();
406
406
  return {
407
407
  ...e,
@@ -673,7 +673,7 @@ const Gt = _i("messaging", {
673
673
  "conversations"
674
674
  ), x = g.map((_) => {
675
675
  const C = this.conversations.find(
676
- (b) => b.id === _.id
676
+ (v) => v.id === _.id
677
677
  );
678
678
  return He(_, C);
679
679
  });
@@ -803,7 +803,7 @@ const Gt = _i("messaging", {
803
803
  ..._.handle ? { handle: _.handle } : {}
804
804
  }), o != null && (C.reply_to_id = o), c != null && (C.reply_to = c), this.messages[e] || (this.messages[e] = []), this.messages[e].push(C), this._pendingSendIds.add(h);
805
805
  try {
806
- let b;
806
+ let v;
807
807
  const T = {
808
808
  body: n || "",
809
809
  ...o ? { reply_to_id: o } : {},
@@ -821,26 +821,26 @@ const Gt = _i("messaging", {
821
821
  };
822
822
  })
823
823
  );
824
- b = await W().post(`/v1/messaging/conversations/${e}/messages`, {
824
+ v = await W().post(`/v1/messaging/conversations/${e}/messages`, {
825
825
  ...T,
826
826
  attachments: k
827
827
  });
828
828
  } else
829
- b = await W().post(`/v1/messaging/conversations/${e}/messages`, {
829
+ v = await W().post(`/v1/messaging/conversations/${e}/messages`, {
830
830
  ...T,
831
831
  type: "text"
832
832
  });
833
- const w = b.data.data || b.data, f = { ...C, ...w, attachments: w.attachments ?? C.attachments }, m = at(f), v = this.messages[e], N = v.findIndex((k) => k.id === h);
834
- N >= 0 && (v[N] = m), this._pendingSendIds.delete(h);
833
+ const w = v.data.data || v.data, f = { ...C, ...w, attachments: w.attachments ?? C.attachments }, m = at(f), b = this.messages[e], N = b.findIndex((k) => k.id === h);
834
+ N >= 0 && (b[N] = m), this._pendingSendIds.delete(h);
835
835
  const q = m.id;
836
836
  let G = 0;
837
- for (let k = v.length - 1; k >= 0; k--) {
838
- const O = v[k];
839
- O && O.id === q && (G++, G > 1 && v.splice(k, 1));
837
+ for (let k = b.length - 1; k >= 0; k--) {
838
+ const O = b[k];
839
+ O && O.id === q && (G++, G > 1 && b.splice(k, 1));
840
840
  }
841
841
  return this.updateConversationLastMessage(e, m), m;
842
- } catch (b) {
843
- throw this._pendingSendIds.delete(h), this.messages[e] = this.messages[e].filter((T) => T.id !== h), this.error = Z(b), b;
842
+ } catch (v) {
843
+ throw this._pendingSendIds.delete(h), this.messages[e] = this.messages[e].filter((T) => T.id !== h), this.error = Z(v), v;
844
844
  }
845
845
  },
846
846
  async editMessage(e, n, i) {
@@ -1136,10 +1136,10 @@ const Gt = _i("messaging", {
1136
1136
  );
1137
1137
  (x.length > 0 || d.length === 0) && this.updateMessageReactions(e, n, x);
1138
1138
  try {
1139
- const _ = await W().get(o), C = he(_.data) && "data" in _.data ? _.data.data : _.data, b = Un(
1139
+ const _ = await W().get(o), C = he(_.data) && "data" in _.data ? _.data.data : _.data, v = Un(
1140
1140
  he(C) ? C.reactions : void 0
1141
1141
  );
1142
- this.updateMessageReactions(e, n, b);
1142
+ this.updateMessageReactions(e, n, v);
1143
1143
  } catch {
1144
1144
  }
1145
1145
  } catch (g) {
@@ -1266,7 +1266,7 @@ const Gt = _i("messaging", {
1266
1266
  function Ya(e) {
1267
1267
  const n = Gt(), i = Fe()(), o = ve(!1), c = ve(null), l = ve(null), d = zt(), g = d !== null, h = 20, x = 250;
1268
1268
  let M = 0, _ = null, C = null;
1269
- const b = ie(() => i.currentUser?.id), T = () => Xn(e)?.trim() ?? "";
1269
+ const v = ie(() => i.currentUser?.id), T = () => Xn(e)?.trim() ?? "";
1270
1270
  function w() {
1271
1271
  _ && (clearTimeout(_), _ = null), M = 0;
1272
1272
  }
@@ -1276,13 +1276,13 @@ function Ya(e) {
1276
1276
  }, x));
1277
1277
  }
1278
1278
  function m(y) {
1279
- if (n.addMessage(y.message), y.message.author_id !== b.value) {
1279
+ if (n.addMessage(y.message), y.message.author_id !== v.value) {
1280
1280
  const I = n.getConversationById(y.conversation_id);
1281
1281
  I && (I.unread_count = 0), n.markAsRead(y.conversation_id).catch(() => {
1282
1282
  });
1283
1283
  }
1284
1284
  }
1285
- function v(y) {
1285
+ function b(y) {
1286
1286
  n.applyParticipantReadState(y);
1287
1287
  }
1288
1288
  function N(y) {
@@ -1290,10 +1290,10 @@ function Ya(e) {
1290
1290
  if (ae >= 0) {
1291
1291
  const B = I[ae];
1292
1292
  if (!B) return;
1293
- const A = { ...B };
1294
- y.message.body !== void 0 && (A.body = y.message.body), y.message.edited_at !== void 0 && (A.edited_at = y.message.edited_at), y.message.meta !== void 0 && (A.meta = y.message.meta), I[ae] = A;
1293
+ const E = { ...B };
1294
+ y.message.body !== void 0 && (E.body = y.message.body), y.message.edited_at !== void 0 && (E.edited_at = y.message.edited_at), y.message.meta !== void 0 && (E.meta = y.message.meta), I[ae] = E;
1295
1295
  const V = n.getConversationById(y.conversation_id);
1296
- V && V.last_message?.id === y.message.id && (V.last_message = A);
1296
+ V && V.last_message?.id === y.message.id && (V.last_message = E);
1297
1297
  }
1298
1298
  }
1299
1299
  function q(y) {
@@ -1313,7 +1313,7 @@ function Ya(e) {
1313
1313
  );
1314
1314
  }
1315
1315
  function O(y) {
1316
- y.removed_user_id === b.value && (ee(), n.deleteConversation(y.conversation_id).catch(() => {
1316
+ y.removed_user_id === v.value && (te(), n.deleteConversation(y.conversation_id).catch(() => {
1317
1317
  }));
1318
1318
  }
1319
1319
  function H(y) {
@@ -1331,7 +1331,7 @@ function Ya(e) {
1331
1331
  try {
1332
1332
  C = Mi(y, {
1333
1333
  onMessageSent: m,
1334
- onMessageRead: v,
1334
+ onMessageRead: b,
1335
1335
  onMessageEdited: N,
1336
1336
  onMessageDeleted: q,
1337
1337
  onReactionToggled: G,
@@ -1354,7 +1354,7 @@ function Ya(e) {
1354
1354
  }
1355
1355
  (y === "disconnected" || y === "error") && (w(), H(!1));
1356
1356
  });
1357
- function ee() {
1357
+ function te() {
1358
1358
  if (w(), !(!o.value || !l.value))
1359
1359
  try {
1360
1360
  H(!0), c.value = null;
@@ -1374,12 +1374,12 @@ function Ya(e) {
1374
1374
  }
1375
1375
  }
1376
1376
  ), d !== null && De(() => {
1377
- w(), me(), ee(), typeof window < "u" && window.removeEventListener(We(), J);
1377
+ w(), me(), te(), typeof window < "u" && window.removeEventListener(We(), J);
1378
1378
  }), {
1379
1379
  isSubscribed: ie(() => o.value),
1380
1380
  error: ie(() => c.value),
1381
1381
  subscribe: F,
1382
- unsubscribe: ee
1382
+ unsubscribe: te
1383
1383
  };
1384
1384
  }
1385
1385
  const ls = () => () => {
@@ -1465,7 +1465,7 @@ function Za(e = {}) {
1465
1465
  ...Po,
1466
1466
  ...e.icons
1467
1467
  }, l = ve(o.getConnectionStatus()), d = ve(null), g = ve(0), h = ve(!1), x = ve(!1), M = ve(!1), _ = ve(!1);
1468
- let C = null, b = null, T = null, w = null, f = null, m = null, v = null;
1468
+ let C = null, v = null, T = null, w = null, f = null, m = null, b = null;
1469
1469
  const N = ie(() => l.value === "connected"), q = ie(() => l.value === "connecting"), G = ie(() => l.value === "disconnected"), k = ie(() => l.value === "error"), O = ie(() => G.value || k.value), H = ie(() => {
1470
1470
  switch (l.value) {
1471
1471
  case "connecting":
@@ -1506,9 +1506,9 @@ function Za(e = {}) {
1506
1506
  }
1507
1507
  }), me = async () => {
1508
1508
  qn.debug("Manual reconnect triggered"), g.value += 1, await o.reconnect();
1509
- }, ee = (A, V = l.value) => {
1510
- if (A !== "connecting" && b && (clearTimeout(b), b = null), A === "disconnected" || A === "error") {
1511
- const ne = !_.value && V === A, _e = !x.value && (ne || V === "connected" || V === "connecting");
1509
+ }, te = (E, V = l.value) => {
1510
+ if (E !== "connecting" && v && (clearTimeout(v), v = null), E === "disconnected" || E === "error") {
1511
+ const ne = !_.value && V === E, _e = !x.value && (ne || V === "connected" || V === "connecting");
1512
1512
  if (M.value = !0, _e) {
1513
1513
  h.value = !1, T && clearTimeout(T), T = setTimeout(() => {
1514
1514
  T = null, l.value !== "connected" && (h.value = !0);
@@ -1518,19 +1518,19 @@ function Za(e = {}) {
1518
1518
  T && (clearTimeout(T), T = null), h.value = !0;
1519
1519
  return;
1520
1520
  }
1521
- if (A === "connected") {
1521
+ if (E === "connected") {
1522
1522
  T && (clearTimeout(T), T = null), h.value = !1, x.value = !1, M.value = !1;
1523
1523
  return;
1524
1524
  }
1525
- if (A === "connecting") {
1525
+ if (E === "connecting") {
1526
1526
  if (x.value) {
1527
1527
  h.value = !0;
1528
1528
  return;
1529
1529
  }
1530
- if (M.value || (h.value = !1), b)
1530
+ if (M.value || (h.value = !1), v)
1531
1531
  return;
1532
- b = setTimeout(() => {
1533
- if (b = null, l.value === "connecting") {
1532
+ v = setTimeout(() => {
1533
+ if (v = null, l.value === "connecting") {
1534
1534
  if (jn(o) === "connected") {
1535
1535
  y("connected");
1536
1536
  return;
@@ -1539,33 +1539,33 @@ function Za(e = {}) {
1539
1539
  }
1540
1540
  }, 1e4);
1541
1541
  }
1542
- }, y = (A) => {
1542
+ }, y = (E) => {
1543
1543
  const V = l.value;
1544
- if (A === "connecting" && x.value) {
1545
- l.value = "disconnected", ee("disconnected", V);
1544
+ if (E === "connecting" && x.value) {
1545
+ l.value = "disconnected", te("disconnected", V);
1546
1546
  return;
1547
1547
  }
1548
- l.value = A, A === "connecting" && (V === "disconnected" || V === "error") && g.value === 0 && (g.value = 1), A === "connected" && (d.value = /* @__PURE__ */ new Date(), g.value = 0), ee(A, V);
1548
+ l.value = E, E === "connecting" && (V === "disconnected" || V === "error") && g.value === 0 && (g.value = 1), E === "connected" && (d.value = /* @__PURE__ */ new Date(), g.value = 0), te(E, V);
1549
1549
  }, I = () => {
1550
- const A = jn(o), V = l.value;
1551
- if (A === "connected" && V !== "connected") {
1550
+ const E = jn(o), V = l.value;
1551
+ if (E === "connected" && V !== "connected") {
1552
1552
  y("connected");
1553
1553
  return;
1554
1554
  }
1555
- if (A === "connecting" && V !== "connecting") {
1555
+ if (E === "connecting" && V !== "connecting") {
1556
1556
  y("connecting");
1557
1557
  return;
1558
1558
  }
1559
- if ((A === "unavailable" || A === "failed" || A === "disconnected") && V !== "disconnected") {
1559
+ if ((E === "unavailable" || E === "failed" || E === "disconnected") && V !== "disconnected") {
1560
1560
  y("disconnected");
1561
1561
  return;
1562
1562
  }
1563
1563
  const ne = o.getConnectionStatus();
1564
- !A && ne === "connected" && V !== "connected" && y("connected");
1564
+ !E && ne === "connected" && V !== "connected" && y("connected");
1565
1565
  }, ae = () => {
1566
- if (f?.unbind && v && (f.unbind("connected", v.connected), f.unbind("connecting", v.connecting), f.unbind("disconnected", v.disconnected), f.unbind("unavailable", v.unavailable), f.unbind("error", v.error), f.unbind("state_change", v.stateChange)), f = o.getEchoConnection(), v = null, !f?.bind)
1566
+ if (f?.unbind && b && (f.unbind("connected", b.connected), f.unbind("connecting", b.connecting), f.unbind("disconnected", b.disconnected), f.unbind("unavailable", b.unavailable), f.unbind("error", b.error), f.unbind("state_change", b.stateChange)), f = o.getEchoConnection(), b = null, !f?.bind)
1567
1567
  return;
1568
- v = {
1568
+ b = {
1569
1569
  connected: () => y("connected"),
1570
1570
  connecting: () => y("connecting"),
1571
1571
  disconnected: () => y("disconnected"),
@@ -1583,31 +1583,31 @@ function Za(e = {}) {
1583
1583
  }
1584
1584
  (ne === "unavailable" || ne === "failed" || ne === "disconnected") && y("disconnected");
1585
1585
  }
1586
- }, f.bind("connected", v.connected), f.bind("connecting", v.connecting), f.bind("disconnected", v.disconnected), f.bind("unavailable", v.unavailable), f.bind("error", v.error), f.bind("state_change", v.stateChange);
1587
- const A = f.state ?? null;
1588
- if (A === "connected") {
1586
+ }, f.bind("connected", b.connected), f.bind("connecting", b.connecting), f.bind("disconnected", b.disconnected), f.bind("unavailable", b.unavailable), f.bind("error", b.error), f.bind("state_change", b.stateChange);
1587
+ const E = f.state ?? null;
1588
+ if (E === "connected") {
1589
1589
  y("connected");
1590
1590
  return;
1591
1591
  }
1592
- if (A === "connecting") {
1592
+ if (E === "connecting") {
1593
1593
  y("connecting");
1594
1594
  return;
1595
1595
  }
1596
- (A === "unavailable" || A === "failed" || A === "disconnected") && y("disconnected");
1596
+ (E === "unavailable" || E === "failed" || E === "disconnected") && y("disconnected");
1597
1597
  }, B = ie(() => {
1598
1598
  if (!d.value || !N.value)
1599
1599
  return null;
1600
- const A = Date.now() - d.value.getTime(), V = Math.floor(A / 6e4), ne = Math.floor(A % 6e4 / 1e3);
1600
+ const E = Date.now() - d.value.getTime(), V = Math.floor(E / 6e4), ne = Math.floor(E % 6e4 / 1e3);
1601
1601
  return V > 0 ? `${V}m ${ne}s` : `${ne}s`;
1602
1602
  });
1603
1603
  return jt(() => {
1604
- l.value = o.getConnectionStatus(), C = o.onConnectionStatusChange(y), N.value && (d.value = /* @__PURE__ */ new Date()), ee(l.value, l.value), _.value = !0, ae(), m = () => {
1604
+ l.value = o.getConnectionStatus(), C = o.onConnectionStatusChange(y), N.value && (d.value = /* @__PURE__ */ new Date()), te(l.value, l.value), _.value = !0, ae(), m = () => {
1605
1605
  ae(), I();
1606
1606
  }, window.addEventListener(o.initializedEvent, m), I(), w = setInterval(() => {
1607
1607
  I();
1608
1608
  }, 3e3);
1609
1609
  }), De(() => {
1610
- C?.(), b && (clearTimeout(b), b = null), T && (clearTimeout(T), T = null), w && (clearInterval(w), w = null), m && (window.removeEventListener(o.initializedEvent, m), m = null), f?.unbind && v && (f.unbind("connected", v.connected), f.unbind("connecting", v.connecting), f.unbind("disconnected", v.disconnected), f.unbind("unavailable", v.unavailable), f.unbind("error", v.error), f.unbind("state_change", v.stateChange)), f = null, v = null;
1610
+ C?.(), v && (clearTimeout(v), v = null), T && (clearTimeout(T), T = null), w && (clearInterval(w), w = null), m && (window.removeEventListener(o.initializedEvent, m), m = null), f?.unbind && b && (f.unbind("connected", b.connected), f.unbind("connecting", b.connecting), f.unbind("disconnected", b.disconnected), f.unbind("unavailable", b.unavailable), f.unbind("error", b.error), f.unbind("state_change", b.stateChange)), f = null, b = null;
1611
1611
  }), {
1612
1612
  connectionStatus: ie(() => l.value),
1613
1613
  isConnected: N,
@@ -1717,20 +1717,20 @@ function ec() {
1717
1717
  Ue.warn("Dropping malformed ConversationMessageSent event", B);
1718
1718
  return;
1719
1719
  }
1720
- const A = B, V = n.currentUser?.id;
1721
- if (!V || A.message.author_id === V) return;
1722
- e.addMessage(A.message);
1723
- const ne = e.hasDetailSubscription(A.conversation_id), _e = jo(A.conversation_id);
1720
+ const E = B, V = n.currentUser?.id;
1721
+ if (!V || E.message.author_id === V) return;
1722
+ e.addMessage(E.message);
1723
+ const ne = e.hasDetailSubscription(E.conversation_id), _e = jo(E.conversation_id);
1724
1724
  if (ne || _e) {
1725
- const U = e.getConversationById(A.conversation_id);
1726
- U && (U.unread_count = 0), e.markAsRead(A.conversation_id).catch(() => {
1725
+ const U = e.getConversationById(E.conversation_id);
1726
+ U && (U.unread_count = 0), e.markAsRead(E.conversation_id).catch(() => {
1727
1727
  });
1728
1728
  return;
1729
1729
  }
1730
- const R = e.getConversationById(A.conversation_id);
1731
- if (R) {
1732
- const U = $o(R);
1733
- U || R.unread_count++, i(U);
1730
+ const A = e.getConversationById(E.conversation_id);
1731
+ if (A) {
1732
+ const U = $o(A);
1733
+ U || A.unread_count++, i(U);
1734
1734
  }
1735
1735
  }, me = (B) => {
1736
1736
  if (!Fi(B)) {
@@ -1738,61 +1738,61 @@ function ec() {
1738
1738
  return;
1739
1739
  }
1740
1740
  e.applyParticipantReadState(B);
1741
- }, ee = (B) => {
1741
+ }, te = (B) => {
1742
1742
  if (!qi(B)) {
1743
1743
  Ue.warn("Dropping malformed MessageReactionToggled event", B);
1744
1744
  return;
1745
1745
  }
1746
- const A = B;
1747
- e.updateMessageReactions(A.conversation_id, A.message_id, A.reactions);
1746
+ const E = B;
1747
+ e.updateMessageReactions(E.conversation_id, E.message_id, E.reactions);
1748
1748
  }, y = (B) => {
1749
1749
  if (!Ni(B)) {
1750
1750
  Ue.warn("Dropping malformed ConversationMessageEdited event", B);
1751
1751
  return;
1752
1752
  }
1753
- const A = B, V = e.getMessagesByConversationId(A.conversation_id), ne = V.findIndex((R) => R.id === A.message.id);
1753
+ const E = B, V = e.getMessagesByConversationId(E.conversation_id), ne = V.findIndex((A) => A.id === E.message.id);
1754
1754
  if (ne >= 0) {
1755
- const R = V[ne];
1756
- if (R) {
1757
- const U = { ...R };
1758
- A.message.body !== void 0 && (U.body = A.message.body), A.message.edited_at !== void 0 && (U.edited_at = A.message.edited_at), A.message.meta !== void 0 && (U.meta = A.message.meta), V[ne] = U;
1755
+ const A = V[ne];
1756
+ if (A) {
1757
+ const U = { ...A };
1758
+ E.message.body !== void 0 && (U.body = E.message.body), E.message.edited_at !== void 0 && (U.edited_at = E.message.edited_at), E.message.meta !== void 0 && (U.meta = E.message.meta), V[ne] = U;
1759
1759
  }
1760
1760
  }
1761
- const _e = e.getConversationById(A.conversation_id);
1762
- _e?.last_message?.id === A.message.id && A.message.body !== void 0 && (_e.last_message = {
1761
+ const _e = e.getConversationById(E.conversation_id);
1762
+ _e?.last_message?.id === E.message.id && E.message.body !== void 0 && (_e.last_message = {
1763
1763
  ..._e.last_message,
1764
- body: A.message.body
1764
+ body: E.message.body
1765
1765
  });
1766
1766
  }, I = (B) => {
1767
1767
  if (!Di(B)) {
1768
1768
  Ue.warn("Dropping malformed ConversationMessageDeleted event", B);
1769
1769
  return;
1770
1770
  }
1771
- const A = B;
1772
- e.removeMessage(A.conversation_id, A.message_id);
1771
+ const E = B;
1772
+ e.removeMessage(E.conversation_id, E.message_id);
1773
1773
  }, ae = (B) => {
1774
1774
  if (!zi(B)) {
1775
1775
  Ue.warn("Dropping malformed ConversationRequestAccepted event", B);
1776
1776
  return;
1777
1777
  }
1778
- const A = B, V = e.getConversationById(A.conversation_id);
1778
+ const E = B, V = e.getConversationById(E.conversation_id);
1779
1779
  V && (V.is_request = !1), e.requests = e.requests.filter(
1780
- (ne) => ne.id !== A.conversation_id
1780
+ (ne) => ne.id !== E.conversation_id
1781
1781
  );
1782
1782
  };
1783
- F.listen(".ConversationMessageSent", J), F.listen(".ConversationMessageRead", me), F.listen(".ConversationMessageEdited", y), F.listen(".ConversationMessageDeleted", I), F.listen(".MessageReactionToggled", ee), F.listen(".ConversationRequestAccepted", ae), h.set(k, {
1783
+ F.listen(".ConversationMessageSent", J), F.listen(".ConversationMessageRead", me), F.listen(".ConversationMessageEdited", y), F.listen(".ConversationMessageDeleted", I), F.listen(".MessageReactionToggled", te), F.listen(".ConversationRequestAccepted", ae), h.set(k, {
1784
1784
  channel: F,
1785
1785
  bindings: [
1786
1786
  { event: ".ConversationMessageSent", handler: J },
1787
1787
  { event: ".ConversationMessageRead", handler: me },
1788
1788
  { event: ".ConversationMessageEdited", handler: y },
1789
1789
  { event: ".ConversationMessageDeleted", handler: I },
1790
- { event: ".MessageReactionToggled", handler: ee },
1790
+ { event: ".MessageReactionToggled", handler: te },
1791
1791
  { event: ".ConversationRequestAccepted", handler: ae }
1792
1792
  ]
1793
1793
  }), g.add(k), e.registerGlobalConversationSubscription(k);
1794
1794
  }
1795
- function b() {
1795
+ function v() {
1796
1796
  const k = Pe();
1797
1797
  if (!k) {
1798
1798
  _();
@@ -1854,7 +1854,7 @@ function ec() {
1854
1854
  function m() {
1855
1855
  !Pe() || x || (Ri(w), x = !0);
1856
1856
  }
1857
- function v() {
1857
+ function b() {
1858
1858
  x && (Pi(), x = !1);
1859
1859
  }
1860
1860
  const N = Ot(
@@ -1869,10 +1869,10 @@ function ec() {
1869
1869
  T();
1870
1870
  }
1871
1871
  ), G = ht((k) => {
1872
- k === "connected" ? (_(), T(), v(), m(), f()) : (k === "disconnected" || k === "error") && (_(), v());
1872
+ k === "connected" ? (_(), T(), b(), m(), f()) : (k === "disconnected" || k === "error") && (_(), b());
1873
1873
  });
1874
1874
  T(), m(), f(), l !== null && De(() => {
1875
- N(), q(), G(), b(), v();
1875
+ N(), q(), G(), v(), b();
1876
1876
  });
1877
1877
  }
1878
1878
  function tc() {
@@ -2009,16 +2009,16 @@ function oa(e, n, i) {
2009
2009
  function nc() {
2010
2010
  const e = Fe()(), n = Ho(), i = ps(), o = ta(n.clientIdStorageKey);
2011
2011
  let c = null, l = null, d = !1, g = It(n.accountLimitedUntilStorageKey), h = !1, x = !1, M = null, _ = 0;
2012
- const C = () => Xo(n) ? n.authTokenResolver() !== null : !0, b = () => {
2012
+ const C = () => Xo(n) ? n.authTokenResolver() !== null : !0, v = () => {
2013
2013
  c && (clearInterval(c), c = null);
2014
2014
  }, T = () => {
2015
2015
  l && (clearTimeout(l), l = null);
2016
2016
  }, w = () => {
2017
- b(), c = setInterval(() => {
2017
+ v(), c = setInterval(() => {
2018
2018
  F();
2019
2019
  }, n.heartbeatIntervalMs);
2020
2020
  }, f = (I) => {
2021
- g || console.warn(I), sa(n.accountLimitedUntilStorageKey), g = !0, d = !1, M = null, b(), T();
2021
+ g || console.warn(I), sa(n.accountLimitedUntilStorageKey), g = !0, d = !1, M = null, v(), T();
2022
2022
  }, m = async (I) => {
2023
2023
  if (!(!d || x || g || h) && C() && M !== I)
2024
2024
  try {
@@ -2028,9 +2028,9 @@ function nc() {
2028
2028
  f("[Presence] Presence updates paused: account is temporarily limited");
2029
2029
  return;
2030
2030
  }
2031
- Lt(ae) && (h = !0, d = !1, M = null, b(), T());
2031
+ Lt(ae) && (h = !0, d = !1, M = null, v(), T());
2032
2032
  }
2033
- }, v = () => {
2033
+ }, b = () => {
2034
2034
  T(), !(!d || x || g || h || document.visibilityState !== "visible") && (l = setTimeout(() => {
2035
2035
  l = null, m("idle");
2036
2036
  }, n.idleAfterMs));
@@ -2038,7 +2038,7 @@ function nc() {
2038
2038
  if (x || !d || g || h || document.visibilityState !== "visible")
2039
2039
  return;
2040
2040
  const I = Date.now();
2041
- I - _ < n.activityDebounceMs || (_ = I, m("online"), v());
2041
+ I - _ < n.activityDebounceMs || (_ = I, m("online"), b());
2042
2042
  }, q = () => {
2043
2043
  N();
2044
2044
  }, G = () => {
@@ -2054,7 +2054,7 @@ function nc() {
2054
2054
  user_agent: n.userAgentResolver()
2055
2055
  }), ra(n.accountLimitedUntilStorageKey), g = !1, h = !1, d = !0, M = null, "opened";
2056
2056
  } catch (I) {
2057
- return kt(I) ? (f("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : Lt(I) ? (h = !0, d = !1, M = null, b(), T(), "account_suspended") : "failed";
2057
+ return kt(I) ? (f("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : Lt(I) ? (h = !0, d = !1, M = null, v(), T(), "account_suspended") : "failed";
2058
2058
  }
2059
2059
  }, H = async () => {
2060
2060
  for (let I = 0; I < Zo; I += 1)
@@ -2070,7 +2070,7 @@ function nc() {
2070
2070
  f("[Presence] Heartbeat paused: account is temporarily limited");
2071
2071
  return;
2072
2072
  }
2073
- Lt(I) && (h = !0, d = !1, M = null, b(), T());
2073
+ Lt(I) && (h = !0, d = !1, M = null, v(), T());
2074
2074
  }
2075
2075
  }, J = () => {
2076
2076
  if (!d)
@@ -2094,12 +2094,12 @@ function nc() {
2094
2094
  J();
2095
2095
  return;
2096
2096
  }
2097
- d && (w(), m("online"), v());
2097
+ d && (w(), m("online"), b());
2098
2098
  }
2099
- }, ee = () => {
2099
+ }, te = () => {
2100
2100
  if (!x) {
2101
2101
  if (document.visibilityState === "hidden") {
2102
- J(), b(), T();
2102
+ J(), v(), T();
2103
2103
  return;
2104
2104
  }
2105
2105
  if (document.visibilityState === "visible" && !d) {
@@ -2109,7 +2109,7 @@ function nc() {
2109
2109
  document.visibilityState === "visible" && d && !g && !h && N();
2110
2110
  }
2111
2111
  }, y = () => {
2112
- x || (J(), b(), T());
2112
+ x || (J(), v(), T());
2113
2113
  };
2114
2114
  jt(async () => {
2115
2115
  if (e.isAuthenticated ?? e.currentUser !== null) {
@@ -2117,69 +2117,69 @@ function nc() {
2117
2117
  J();
2118
2118
  return;
2119
2119
  }
2120
- d && (w(), m("online"), v()), G(), document.addEventListener("visibilitychange", ee), window.addEventListener("pagehide", y), window.addEventListener("beforeunload", y);
2120
+ d && (w(), m("online"), b()), G(), document.addEventListener("visibilitychange", te), window.addEventListener("pagehide", y), window.addEventListener("beforeunload", y);
2121
2121
  }
2122
2122
  }), De(() => {
2123
- x = !0, k(), T(), b(), J(), document.removeEventListener("visibilitychange", ee), window.removeEventListener("pagehide", y), window.removeEventListener("beforeunload", y);
2123
+ x = !0, k(), T(), v(), J(), document.removeEventListener("visibilitychange", te), window.removeEventListener("pagehide", y), window.removeEventListener("beforeunload", y);
2124
2124
  });
2125
2125
  }
2126
2126
  const aa = 12e3;
2127
2127
  function sc(e) {
2128
2128
  const n = Gt(), i = Fe()(), o = ve(!1), c = ve(null), l = ve(null), d = ve([]), g = /* @__PURE__ */ new Map(), h = zt(), x = h !== null, M = 20, _ = 250;
2129
- let C = !1, b = null, T = 0, w = null;
2130
- const f = ie(() => i.currentUser?.id), m = () => Xn(e)?.trim() ?? "", v = () => {
2131
- const R = l.value?.trim() ?? "";
2132
- if (R.length > 0)
2133
- return R;
2129
+ let C = !1, v = null, T = 0, w = null;
2130
+ const f = ie(() => i.currentUser?.id), m = () => Xn(e)?.trim() ?? "", b = () => {
2131
+ const A = l.value?.trim() ?? "";
2132
+ if (A.length > 0)
2133
+ return A;
2134
2134
  const U = m();
2135
2135
  return U.length > 0 && (l.value = U), U;
2136
- }, N = (R) => n.getTypingUsers(R), q = (R) => {
2137
- const U = N(R);
2136
+ }, N = (A) => n.getTypingUsers(A), q = (A) => {
2137
+ const U = N(A);
2138
2138
  for (const re of U)
2139
- n.removeTypingUser(R, re.id);
2139
+ n.removeTypingUser(A, re.id);
2140
2140
  d.value = [];
2141
- }, G = (R) => {
2142
- const U = g.get(R);
2143
- U && (clearTimeout(U), g.delete(R));
2141
+ }, G = (A) => {
2142
+ const U = g.get(A);
2143
+ U && (clearTimeout(U), g.delete(A));
2144
2144
  }, k = () => {
2145
- for (const R of g.values())
2146
- clearTimeout(R);
2145
+ for (const A of g.values())
2146
+ clearTimeout(A);
2147
2147
  g.clear();
2148
2148
  }, O = () => {
2149
2149
  w && (clearTimeout(w), w = null), T = 0;
2150
2150
  }, H = () => {
2151
2151
  !x || o.value || w || T >= M || (w = setTimeout(() => {
2152
- w = null, T += 1, ee();
2152
+ w = null, T += 1, te();
2153
2153
  }, _));
2154
- }, F = (R, U) => {
2155
- G(R);
2154
+ }, F = (A, U) => {
2155
+ G(A);
2156
2156
  const re = setTimeout(() => {
2157
- g.delete(R), n.removeTypingUser(U, R), d.value = d.value.filter((fe) => fe.id !== R);
2157
+ g.delete(A), n.removeTypingUser(U, A), d.value = d.value.filter((fe) => fe.id !== A);
2158
2158
  }, aa);
2159
- g.set(R, re);
2159
+ g.set(A, re);
2160
2160
  }, J = () => {
2161
2161
  C = !0, O();
2162
- }, me = (R) => {
2162
+ }, me = (A) => {
2163
2163
  try {
2164
- b && (b(), b = null), b = ki(R, {
2164
+ v && (v(), v = null), v = ki(A, {
2165
2165
  onTypingStart: I,
2166
2166
  onTypingStop: ae
2167
- }), O(), o.value = !0, l.value = R;
2167
+ }), O(), o.value = !0, l.value = A;
2168
2168
  } catch (U) {
2169
2169
  c.value = U instanceof Error ? U.message : "Failed to subscribe to typing channel";
2170
2170
  }
2171
- }, ee = () => {
2172
- const R = m();
2173
- if (!(o.value || !R)) {
2171
+ }, te = () => {
2172
+ const A = m();
2173
+ if (!(o.value || !A)) {
2174
2174
  if (c.value = null, Pe() && Tn() === "connected") {
2175
- me(R);
2175
+ me(A);
2176
2176
  return;
2177
2177
  }
2178
2178
  C = !1, Ti().then((U) => {
2179
2179
  if (C || o.value || !U)
2180
2180
  return;
2181
2181
  const re = m();
2182
- if (re && re === R && Pe() && Tn() === "connected") {
2182
+ if (re && re === A && Pe() && Tn() === "connected") {
2183
2183
  me(re);
2184
2184
  return;
2185
2185
  }
@@ -2187,39 +2187,39 @@ function sc(e) {
2187
2187
  }), H();
2188
2188
  }
2189
2189
  }, y = () => {
2190
- const R = l.value;
2191
- if (J(), !(!o.value || !R))
2190
+ const A = l.value;
2191
+ if (J(), !(!o.value || !A))
2192
2192
  try {
2193
- b && (b(), b = null), Li(R), k(), q(R), o.value = !1, l.value = null, c.value = null;
2193
+ v && (v(), v = null), Li(A), k(), q(A), o.value = !1, l.value = null, c.value = null;
2194
2194
  } catch (U) {
2195
2195
  c.value = U instanceof Error ? U.message : "Failed to unsubscribe from typing channel";
2196
2196
  }
2197
2197
  };
2198
- function I(R) {
2199
- if (R.user_id === f.value)
2198
+ function I(A) {
2199
+ if (A.user_id === f.value)
2200
2200
  return;
2201
- const U = v();
2201
+ const U = b();
2202
2202
  if (!U)
2203
2203
  return;
2204
2204
  const re = {
2205
- id: R.user.id,
2206
- name: R.user.name,
2207
- ...R.user.avatar !== void 0 ? { avatar: R.user.avatar } : {}
2205
+ id: A.user.id,
2206
+ name: A.user.name,
2207
+ ...A.user.avatar !== void 0 ? { avatar: A.user.avatar } : {}
2208
2208
  };
2209
- d.value.some((fe) => fe.id === re.id) || (d.value = [...d.value, re]), n.addTypingUser(U, re), F(R.user_id, U);
2209
+ d.value.some((fe) => fe.id === re.id) || (d.value = [...d.value, re]), n.addTypingUser(U, re), F(A.user_id, U);
2210
2210
  }
2211
- function ae(R) {
2212
- if (R.user_id === f.value)
2211
+ function ae(A) {
2212
+ if (A.user_id === f.value)
2213
2213
  return;
2214
- G(R.user_id);
2215
- const U = v();
2216
- U && (d.value = d.value.filter((re) => re.id !== R.user_id), n.removeTypingUser(U, R.user_id));
2214
+ G(A.user_id);
2215
+ const U = b();
2216
+ U && (d.value = d.value.filter((re) => re.id !== A.user_id), n.removeTypingUser(U, A.user_id));
2217
2217
  }
2218
2218
  const B = ie(() => {
2219
- const R = v();
2220
- if (!R)
2219
+ const A = b();
2220
+ if (!A)
2221
2221
  return d.value;
2222
- const U = N(R);
2222
+ const U = N(A);
2223
2223
  if (d.value.length === 0)
2224
2224
  return U;
2225
2225
  if (U.length === 0)
@@ -2230,34 +2230,34 @@ function sc(e) {
2230
2230
  for (const fe of d.value)
2231
2231
  re.set(fe.id, fe);
2232
2232
  return [...re.values()];
2233
- }), A = ie(() => {
2234
- const R = B.value;
2235
- if (R.length === 0)
2233
+ }), E = ie(() => {
2234
+ const A = B.value;
2235
+ if (A.length === 0)
2236
2236
  return "";
2237
- const U = R[0];
2237
+ const U = A[0];
2238
2238
  if (!U)
2239
2239
  return "";
2240
- if (R.length === 1)
2240
+ if (A.length === 1)
2241
2241
  return `${U.name} is typing...`;
2242
- const re = R[1];
2242
+ const re = A[1];
2243
2243
  if (!re)
2244
- return `${R.length} people are typing...`;
2245
- if (R.length === 2)
2244
+ return `${A.length} people are typing...`;
2245
+ if (A.length === 2)
2246
2246
  return `${U.name} and ${re.name} are typing...`;
2247
- const fe = R[2];
2248
- return fe ? R.length === 3 ? `${U.name}, ${re.name} and ${fe.name} are typing...` : `${R.length} people are typing...` : `${R.length} people are typing...`;
2247
+ const fe = A[2];
2248
+ return fe ? A.length === 3 ? `${U.name}, ${re.name} and ${fe.name} are typing...` : `${A.length} people are typing...` : `${A.length} people are typing...`;
2249
2249
  }), V = ie(() => B.value.length > 0), ne = () => {
2250
- o.value || ee();
2250
+ m() && (v && (v(), v = null), o.value = !1, l.value = null, te());
2251
2251
  };
2252
2252
  typeof window < "u" && window.addEventListener(We(), ne);
2253
- const _e = ht((R) => {
2254
- if (R === "connected") {
2255
- o.value || ee();
2253
+ const _e = ht((A) => {
2254
+ if (A === "connected") {
2255
+ o.value || te();
2256
2256
  return;
2257
2257
  }
2258
- if (R === "disconnected" || R === "error") {
2259
- J(), b && (b(), b = null);
2260
- const U = v();
2258
+ if (A === "disconnected" || A === "error") {
2259
+ J(), v && (v(), v = null);
2260
+ const U = b();
2261
2261
  U && q(U), o.value = !1, l.value = null, k();
2262
2262
  }
2263
2263
  });
@@ -2267,9 +2267,9 @@ function sc(e) {
2267
2267
  isSubscribed: ie(() => o.value),
2268
2268
  error: ie(() => c.value),
2269
2269
  typingUsers: B,
2270
- formatTypingIndicator: A,
2270
+ formatTypingIndicator: E,
2271
2271
  hasTypingUsers: V,
2272
- subscribe: ee,
2272
+ subscribe: te,
2273
2273
  unsubscribe: y
2274
2274
  };
2275
2275
  }
@@ -3282,18 +3282,18 @@ function va() {
3282
3282
  (function(i, o, c) {
3283
3283
  var l = this && this.__extends || /* @__PURE__ */ (function() {
3284
3284
  var w = function(f, m) {
3285
- return w = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(v, N) {
3286
- v.__proto__ = N;
3287
- } || function(v, N) {
3288
- for (var q in N) N.hasOwnProperty(q) && (v[q] = N[q]);
3285
+ return w = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(b, N) {
3286
+ b.__proto__ = N;
3287
+ } || function(b, N) {
3288
+ for (var q in N) N.hasOwnProperty(q) && (b[q] = N[q]);
3289
3289
  }, w(f, m);
3290
3290
  };
3291
3291
  return function(f, m) {
3292
3292
  w(f, m);
3293
- function v() {
3293
+ function b() {
3294
3294
  this.constructor = f;
3295
3295
  }
3296
- f.prototype = m === null ? Object.create(m) : (v.prototype = m.prototype, new v());
3296
+ f.prototype = m === null ? Object.create(m) : (b.prototype = m.prototype, new b());
3297
3297
  };
3298
3298
  })();
3299
3299
  Object.defineProperty(o, "__esModule", { value: !0 });
@@ -3306,13 +3306,13 @@ function va() {
3306
3306
  return w.prototype.encodedLength = function(f) {
3307
3307
  return this._paddingCharacter ? (f + 2) / 3 * 4 | 0 : (f * 8 + 5) / 6 | 0;
3308
3308
  }, w.prototype.encode = function(f) {
3309
- for (var m = "", v = 0; v < f.length - 2; v += 3) {
3310
- var N = f[v] << 16 | f[v + 1] << 8 | f[v + 2];
3309
+ for (var m = "", b = 0; b < f.length - 2; b += 3) {
3310
+ var N = f[b] << 16 | f[b + 1] << 8 | f[b + 2];
3311
3311
  m += this._encodeByte(N >>> 18 & 63), m += this._encodeByte(N >>> 12 & 63), m += this._encodeByte(N >>> 6 & 63), m += this._encodeByte(N >>> 0 & 63);
3312
3312
  }
3313
- var q = f.length - v;
3313
+ var q = f.length - b;
3314
3314
  if (q > 0) {
3315
- var N = f[v] << 16 | (q === 2 ? f[v + 1] << 8 : 0);
3315
+ var N = f[b] << 16 | (q === 2 ? f[b + 1] << 8 : 0);
3316
3316
  m += this._encodeByte(N >>> 18 & 63), m += this._encodeByte(N >>> 12 & 63), q === 2 ? m += this._encodeByte(N >>> 6 & 63) : m += this._paddingCharacter || "", m += this._paddingCharacter || "";
3317
3317
  }
3318
3318
  return m;
@@ -3323,9 +3323,9 @@ function va() {
3323
3323
  }, w.prototype.decode = function(f) {
3324
3324
  if (f.length === 0)
3325
3325
  return new Uint8Array(0);
3326
- for (var m = this._getPaddingLength(f), v = f.length - m, N = new Uint8Array(this.maxDecodedLength(v)), q = 0, G = 0, k = 0, O = 0, H = 0, F = 0, J = 0; G < v - 4; G += 4)
3326
+ for (var m = this._getPaddingLength(f), b = f.length - m, N = new Uint8Array(this.maxDecodedLength(b)), q = 0, G = 0, k = 0, O = 0, H = 0, F = 0, J = 0; G < b - 4; G += 4)
3327
3327
  O = this._decodeChar(f.charCodeAt(G + 0)), H = this._decodeChar(f.charCodeAt(G + 1)), F = this._decodeChar(f.charCodeAt(G + 2)), J = this._decodeChar(f.charCodeAt(G + 3)), N[q++] = O << 2 | H >>> 4, N[q++] = H << 4 | F >>> 2, N[q++] = F << 6 | J, k |= O & d, k |= H & d, k |= F & d, k |= J & d;
3328
- if (G < v - 1 && (O = this._decodeChar(f.charCodeAt(G)), H = this._decodeChar(f.charCodeAt(G + 1)), N[q++] = O << 2 | H >>> 4, k |= O & d, k |= H & d), G < v - 2 && (F = this._decodeChar(f.charCodeAt(G + 2)), N[q++] = H << 4 | F >>> 2, k |= F & d), G < v - 3 && (J = this._decodeChar(f.charCodeAt(G + 3)), N[q++] = F << 6 | J, k |= J & d), k !== 0)
3328
+ if (G < b - 1 && (O = this._decodeChar(f.charCodeAt(G)), H = this._decodeChar(f.charCodeAt(G + 1)), N[q++] = O << 2 | H >>> 4, k |= O & d, k |= H & d), G < b - 2 && (F = this._decodeChar(f.charCodeAt(G + 2)), N[q++] = H << 4 | F >>> 2, k |= F & d), G < b - 3 && (J = this._decodeChar(f.charCodeAt(G + 3)), N[q++] = F << 6 | J, k |= J & d), k !== 0)
3329
3329
  throw new Error("Base64Coder: incorrect characters for decoding");
3330
3330
  return N;
3331
3331
  }, w.prototype._encodeByte = function(f) {
@@ -3337,7 +3337,7 @@ function va() {
3337
3337
  }, w.prototype._getPaddingLength = function(f) {
3338
3338
  var m = 0;
3339
3339
  if (this._paddingCharacter) {
3340
- for (var v = f.length - 1; v >= 0 && f[v] === this._paddingCharacter; v--)
3340
+ for (var b = f.length - 1; b >= 0 && f[b] === this._paddingCharacter; b--)
3341
3341
  m++;
3342
3342
  if (f.length < 4 || m > 2)
3343
3343
  throw new Error("Base64Coder: incorrect padding");
@@ -3364,20 +3364,20 @@ function va() {
3364
3364
  return w !== null && w.apply(this, arguments) || this;
3365
3365
  }
3366
3366
  return f.prototype._encodeByte = function(m) {
3367
- var v = m;
3368
- return v += 65, v += 25 - m >>> 8 & 6, v += 51 - m >>> 8 & -75, v += 61 - m >>> 8 & -13, v += 62 - m >>> 8 & 49, String.fromCharCode(v);
3367
+ var b = m;
3368
+ return b += 65, b += 25 - m >>> 8 & 6, b += 51 - m >>> 8 & -75, b += 61 - m >>> 8 & -13, b += 62 - m >>> 8 & 49, String.fromCharCode(b);
3369
3369
  }, f.prototype._decodeChar = function(m) {
3370
- var v = d;
3371
- return v += (44 - m & m - 46) >>> 8 & -d + m - 45 + 62, v += (94 - m & m - 96) >>> 8 & -d + m - 95 + 63, v += (47 - m & m - 58) >>> 8 & -d + m - 48 + 52, v += (64 - m & m - 91) >>> 8 & -d + m - 65 + 0, v += (96 - m & m - 123) >>> 8 & -d + m - 97 + 26, v;
3370
+ var b = d;
3371
+ return b += (44 - m & m - 46) >>> 8 & -d + m - 45 + 62, b += (94 - m & m - 96) >>> 8 & -d + m - 95 + 63, b += (47 - m & m - 58) >>> 8 & -d + m - 48 + 52, b += (64 - m & m - 91) >>> 8 & -d + m - 65 + 0, b += (96 - m & m - 123) >>> 8 & -d + m - 97 + 26, b;
3372
3372
  }, f;
3373
3373
  })(g)
3374
3374
  );
3375
3375
  o.URLSafeCoder = _;
3376
3376
  var C = new _();
3377
- function b(w) {
3377
+ function v(w) {
3378
3378
  return C.encode(w);
3379
3379
  }
3380
- o.encodeURLSafe = b;
3380
+ o.encodeURLSafe = v;
3381
3381
  function T(w) {
3382
3382
  return C.decode(w);
3383
3383
  }
@@ -3395,23 +3395,23 @@ function va() {
3395
3395
  Object.defineProperty(o, "__esModule", { value: !0 });
3396
3396
  var l = "utf8: invalid string", d = "utf8: invalid source encoding";
3397
3397
  function g(M) {
3398
- for (var _ = new Uint8Array(h(M)), C = 0, b = 0; b < M.length; b++) {
3399
- var T = M.charCodeAt(b);
3400
- T < 128 ? _[C++] = T : T < 2048 ? (_[C++] = 192 | T >> 6, _[C++] = 128 | T & 63) : T < 55296 ? (_[C++] = 224 | T >> 12, _[C++] = 128 | T >> 6 & 63, _[C++] = 128 | T & 63) : (b++, T = (T & 1023) << 10, T |= M.charCodeAt(b) & 1023, T += 65536, _[C++] = 240 | T >> 18, _[C++] = 128 | T >> 12 & 63, _[C++] = 128 | T >> 6 & 63, _[C++] = 128 | T & 63);
3398
+ for (var _ = new Uint8Array(h(M)), C = 0, v = 0; v < M.length; v++) {
3399
+ var T = M.charCodeAt(v);
3400
+ T < 128 ? _[C++] = T : T < 2048 ? (_[C++] = 192 | T >> 6, _[C++] = 128 | T & 63) : T < 55296 ? (_[C++] = 224 | T >> 12, _[C++] = 128 | T >> 6 & 63, _[C++] = 128 | T & 63) : (v++, T = (T & 1023) << 10, T |= M.charCodeAt(v) & 1023, T += 65536, _[C++] = 240 | T >> 18, _[C++] = 128 | T >> 12 & 63, _[C++] = 128 | T >> 6 & 63, _[C++] = 128 | T & 63);
3401
3401
  }
3402
3402
  return _;
3403
3403
  }
3404
3404
  o.encode = g;
3405
3405
  function h(M) {
3406
3406
  for (var _ = 0, C = 0; C < M.length; C++) {
3407
- var b = M.charCodeAt(C);
3408
- if (b < 128)
3407
+ var v = M.charCodeAt(C);
3408
+ if (v < 128)
3409
3409
  _ += 1;
3410
- else if (b < 2048)
3410
+ else if (v < 2048)
3411
3411
  _ += 2;
3412
- else if (b < 55296)
3412
+ else if (v < 55296)
3413
3413
  _ += 3;
3414
- else if (b <= 57343) {
3414
+ else if (v <= 57343) {
3415
3415
  if (C >= M.length - 1)
3416
3416
  throw new Error(l);
3417
3417
  C++, _ += 4;
@@ -3423,41 +3423,41 @@ function va() {
3423
3423
  o.encodedLength = h;
3424
3424
  function x(M) {
3425
3425
  for (var _ = [], C = 0; C < M.length; C++) {
3426
- var b = M[C];
3427
- if (b & 128) {
3426
+ var v = M[C];
3427
+ if (v & 128) {
3428
3428
  var T = void 0;
3429
- if (b < 224) {
3429
+ if (v < 224) {
3430
3430
  if (C >= M.length)
3431
3431
  throw new Error(d);
3432
3432
  var w = M[++C];
3433
3433
  if ((w & 192) !== 128)
3434
3434
  throw new Error(d);
3435
- b = (b & 31) << 6 | w & 63, T = 128;
3436
- } else if (b < 240) {
3435
+ v = (v & 31) << 6 | w & 63, T = 128;
3436
+ } else if (v < 240) {
3437
3437
  if (C >= M.length - 1)
3438
3438
  throw new Error(d);
3439
3439
  var w = M[++C], f = M[++C];
3440
3440
  if ((w & 192) !== 128 || (f & 192) !== 128)
3441
3441
  throw new Error(d);
3442
- b = (b & 15) << 12 | (w & 63) << 6 | f & 63, T = 2048;
3443
- } else if (b < 248) {
3442
+ v = (v & 15) << 12 | (w & 63) << 6 | f & 63, T = 2048;
3443
+ } else if (v < 248) {
3444
3444
  if (C >= M.length - 2)
3445
3445
  throw new Error(d);
3446
3446
  var w = M[++C], f = M[++C], m = M[++C];
3447
3447
  if ((w & 192) !== 128 || (f & 192) !== 128 || (m & 192) !== 128)
3448
3448
  throw new Error(d);
3449
- b = (b & 15) << 18 | (w & 63) << 12 | (f & 63) << 6 | m & 63, T = 65536;
3449
+ v = (v & 15) << 18 | (w & 63) << 12 | (f & 63) << 6 | m & 63, T = 65536;
3450
3450
  } else
3451
3451
  throw new Error(d);
3452
- if (b < T || b >= 55296 && b <= 57343)
3452
+ if (v < T || v >= 55296 && v <= 57343)
3453
3453
  throw new Error(d);
3454
- if (b >= 65536) {
3455
- if (b > 1114111)
3454
+ if (v >= 65536) {
3455
+ if (v > 1114111)
3456
3456
  throw new Error(d);
3457
- b -= 65536, _.push(String.fromCharCode(55296 | b >> 10)), b = 56320 | b & 1023;
3457
+ v -= 65536, _.push(String.fromCharCode(55296 | v >> 10)), v = 56320 | v & 1023;
3458
3458
  }
3459
3459
  }
3460
- _.push(String.fromCharCode(b));
3460
+ _.push(String.fromCharCode(v));
3461
3461
  }
3462
3462
  return _.join("");
3463
3463
  }
@@ -3531,8 +3531,8 @@ function va() {
3531
3531
  delete u.loading[t];
3532
3532
  for (var Q = function(ce) {
3533
3533
  ce || p.cleanup();
3534
- }, te = 0; te < z.length; te++)
3535
- z[te](L, Q);
3534
+ }, ee = 0; ee < z.length; ee++)
3535
+ z[ee](L, Q);
3536
3536
  }
3537
3537
  });
3538
3538
  p.send(S);
@@ -3593,7 +3593,7 @@ function va() {
3593
3593
  super(t), Object.setPrototypeOf(this, new.target.prototype);
3594
3594
  }
3595
3595
  }
3596
- class v extends Error {
3596
+ class b extends Error {
3597
3597
  constructor(t) {
3598
3598
  super(t), Object.setPrototypeOf(this, new.target.prototype);
3599
3599
  }
@@ -3663,11 +3663,11 @@ function va() {
3663
3663
  }, p.send(t), p;
3664
3664
  };
3665
3665
  function me(r) {
3666
- return A(ae(r));
3666
+ return E(ae(r));
3667
3667
  }
3668
- var ee = String.fromCharCode, y = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", I = function(r) {
3668
+ var te = String.fromCharCode, y = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", I = function(r) {
3669
3669
  var t = r.charCodeAt(0);
3670
- return t < 128 ? r : t < 2048 ? ee(192 | t >>> 6) + ee(128 | t & 63) : ee(224 | t >>> 12 & 15) + ee(128 | t >>> 6 & 63) + ee(128 | t & 63);
3670
+ return t < 128 ? r : t < 2048 ? te(192 | t >>> 6) + te(128 | t & 63) : te(224 | t >>> 12 & 15) + te(128 | t >>> 6 & 63) + te(128 | t & 63);
3671
3671
  }, ae = function(r) {
3672
3672
  return r.replace(/[^\x00-\x7F]/g, I);
3673
3673
  }, B = function(r) {
@@ -3678,7 +3678,7 @@ function va() {
3678
3678
  t >= 1 ? "=" : y.charAt(s & 63)
3679
3679
  ];
3680
3680
  return a.join("");
3681
- }, A = window.btoa || function(r) {
3681
+ }, E = window.btoa || function(r) {
3682
3682
  return r.replace(/[\s\S]{1,3}/g, B);
3683
3683
  };
3684
3684
  class V {
@@ -3698,7 +3698,7 @@ function va() {
3698
3698
  function _e(r) {
3699
3699
  window.clearTimeout(r);
3700
3700
  }
3701
- function R(r) {
3701
+ function A(r) {
3702
3702
  window.clearInterval(r);
3703
3703
  }
3704
3704
  class U extends ne {
@@ -3710,7 +3710,7 @@ function va() {
3710
3710
  }
3711
3711
  class re extends ne {
3712
3712
  constructor(t, s) {
3713
- super(setInterval, R, t, function(a) {
3713
+ super(setInterval, A, t, function(a) {
3714
3714
  return s(), a;
3715
3715
  });
3716
3716
  }
@@ -3742,7 +3742,7 @@ function va() {
3742
3742
  typeof arguments[t] == "string" ? r.push(arguments[t]) : r.push(Ye(arguments[t]));
3743
3743
  return r.join(" : ");
3744
3744
  }
3745
- function E(r, t) {
3745
+ function R(r, t) {
3746
3746
  var s = Array.prototype.indexOf;
3747
3747
  if (r === null)
3748
3748
  return -1;
@@ -3892,8 +3892,8 @@ function va() {
3892
3892
  var p = r.nextAuthCallbackID.toString();
3893
3893
  r.nextAuthCallbackID++;
3894
3894
  var S = r.getDocument(), L = S.createElement("script");
3895
- r.auth_callbacks[p] = function(te) {
3896
- u(null, te);
3895
+ r.auth_callbacks[p] = function(ee) {
3896
+ u(null, ee);
3897
3897
  };
3898
3898
  var z = "Pusher.auth_callbacks['" + p + "']";
3899
3899
  L.src = s.endpoint + "?callback=" + encodeURIComponent(z) + "&" + t;
@@ -4226,8 +4226,8 @@ function va() {
4226
4226
  if (p.unbind("closed", z), Q.code === 1002 || Q.code === 1003)
4227
4227
  this.manager.reportDeath();
4228
4228
  else if (!Q.wasClean && S) {
4229
- var te = ue.now() - S;
4230
- te < 2 * this.maxPingDelay && (this.manager.reportDeath(), this.pingDelay = Math.max(te / 2, this.minPingDelay));
4229
+ var ee = ue.now() - S;
4230
+ ee < 2 * this.maxPingDelay && (this.manager.reportDeath(), this.pingDelay = Math.max(ee / 2, this.minPingDelay));
4231
4231
  }
4232
4232
  };
4233
4233
  return p.bind("open", L), p;
@@ -4516,22 +4516,22 @@ function va() {
4516
4516
  });
4517
4517
  }
4518
4518
  return new (s || (s = Promise))(function(p, S) {
4519
- function L(te) {
4519
+ function L(ee) {
4520
4520
  try {
4521
- Q(a.next(te));
4521
+ Q(a.next(ee));
4522
4522
  } catch (ce) {
4523
4523
  S(ce);
4524
4524
  }
4525
4525
  }
4526
- function z(te) {
4526
+ function z(ee) {
4527
4527
  try {
4528
- Q(a.throw(te));
4528
+ Q(a.throw(ee));
4529
4529
  } catch (ce) {
4530
4530
  S(ce);
4531
4531
  }
4532
4532
  }
4533
- function Q(te) {
4534
- te.done ? p(te.value) : u(te.value).then(L, z);
4533
+ function Q(ee) {
4534
+ ee.done ? p(ee.value) : u(ee.value).then(L, z);
4535
4535
  }
4536
4536
  Q((a = a.apply(r, t || [])).next());
4537
4537
  });
@@ -5007,15 +5007,15 @@ function va() {
5007
5007
  failFast: !0
5008
5008
  }))) : p++);
5009
5009
  }
5010
- var z = ue.now(), Q = S.pop().connect(t, function te(ce, nt) {
5011
- ce ? (ln(a), S.length > 0 ? (z = ue.now(), Q = S.pop().connect(t, te)) : s(ce)) : (gr(a, nt.transport.name, ue.now() - z, p), s(null, nt));
5010
+ var z = ue.now(), Q = S.pop().connect(t, function ee(ce, nt) {
5011
+ ce ? (ln(a), S.length > 0 ? (z = ue.now(), Q = S.pop().connect(t, ee)) : s(ce)) : (gr(a, nt.transport.name, ue.now() - z, p), s(null, nt));
5012
5012
  });
5013
5013
  return {
5014
5014
  abort: function() {
5015
5015
  Q.abort();
5016
5016
  },
5017
- forceMinPriority: function(te) {
5018
- t = te, Q && Q.forceMinPriority(te);
5017
+ forceMinPriority: function(ee) {
5018
+ t = ee, Q && Q.forceMinPriority(ee);
5019
5019
  }
5020
5020
  };
5021
5021
  }
@@ -5132,11 +5132,11 @@ function va() {
5132
5132
  }, Q = new un({
5133
5133
  minPingDelay: 1e4,
5134
5134
  maxPingDelay: r.activityTimeout
5135
- }), te = new un({
5135
+ }), ee = new un({
5136
5136
  lives: 2,
5137
5137
  minPingDelay: 1e4,
5138
5138
  maxPingDelay: r.activityTimeout
5139
- }), ce = u("ws", "ws", 3, p, Q), nt = u("wss", "ws", 3, S, Q), di = u("sockjs", "sockjs", 1, L), gn = u("xhr_streaming", "xhr_streaming", 1, L, te), hi = u("xdr_streaming", "xdr_streaming", 1, L, te), mn = u("xhr_polling", "xhr_polling", 1, L), fi = u("xdr_polling", "xdr_polling", 1, L), vn = new Le([ce], z), pi = new Le([nt], z), gi = new Le([di], z), bn = new Le([
5139
+ }), ce = u("ws", "ws", 3, p, Q), nt = u("wss", "ws", 3, S, Q), di = u("sockjs", "sockjs", 1, L), gn = u("xhr_streaming", "xhr_streaming", 1, L, ee), hi = u("xdr_streaming", "xdr_streaming", 1, L, ee), mn = u("xhr_polling", "xhr_polling", 1, L), fi = u("xdr_polling", "xdr_polling", 1, L), vn = new Le([ce], z), pi = new Le([nt], z), gi = new Le([di], z), bn = new Le([
5140
5140
  new ze(je(gn), gn, hi)
5141
5141
  ], z), yn = new Le([
5142
5142
  new ze(je(mn), mn, fi)
@@ -5169,7 +5169,7 @@ function va() {
5169
5169
  getRequest: function(r) {
5170
5170
  var t = new window.XDomainRequest();
5171
5171
  return t.ontimeout = function() {
5172
- r.emit("error", new v()), r.close();
5172
+ r.emit("error", new b()), r.close();
5173
5173
  }, t.onerror = function(s) {
5174
5174
  r.emit("error", s), r.close();
5175
5175
  }, t.onprogress = function() {
@@ -5551,20 +5551,20 @@ function va() {
5551
5551
  u.unbind("initialized", S), u.connect();
5552
5552
  }, L = function() {
5553
5553
  p = Ee.createHandshake(u, function(ce) {
5554
- a = !0, te(), s(null, ce);
5554
+ a = !0, ee(), s(null, ce);
5555
5555
  });
5556
5556
  }, z = function(ce) {
5557
- te(), s(ce);
5557
+ ee(), s(ce);
5558
5558
  }, Q = function() {
5559
- te();
5559
+ ee();
5560
5560
  var ce;
5561
5561
  ce = Ye(u), s(new q(ce));
5562
- }, te = function() {
5562
+ }, ee = function() {
5563
5563
  u.unbind("initialized", S), u.unbind("open", L), u.unbind("error", z), u.unbind("closed", Q);
5564
5564
  };
5565
5565
  return u.bind("initialized", S), u.bind("open", L), u.bind("error", z), u.bind("closed", Q), u.initialize(), {
5566
5566
  abort: () => {
5567
- a || (te(), p ? p.close() : u.close());
5567
+ a || (ee(), p ? p.close() : u.close());
5568
5568
  },
5569
5569
  forceMinPriority: (ce) => {
5570
5570
  a || this.priority < ce && (p ? p.close() : u.close());
@@ -5587,7 +5587,7 @@ function va() {
5587
5587
  var S = $r[s];
5588
5588
  if (!S)
5589
5589
  throw new k(s);
5590
- var L = (!r.enabledTransports || E(r.enabledTransports, t) !== -1) && (!r.disabledTransports || E(r.disabledTransports, t) === -1), z;
5590
+ var L = (!r.enabledTransports || R(r.enabledTransports, t) !== -1) && (!r.disabledTransports || R(r.disabledTransports, t) === -1), z;
5591
5591
  return L ? (u = Object.assign({ ignoreNullOrigin: r.ignoreNullOrigin }, u), z = new jr(t, a, p ? p.getAssistant(S) : S, u)) : z = Br, z;
5592
5592
  }, Br = {
5593
5593
  isSupported: function() {
@@ -6144,68 +6144,68 @@ function Oe(e, n, i, o) {
6144
6144
  function oc(e) {
6145
6145
  const n = e.initializedEvent ?? "messenger-client:echo-initialized", i = e.bootstrapEndpoint ?? _a, o = e.bootstrapRefreshSkewMs ?? Sa, c = e.presenceFreshnessTtlMs ?? wa, l = (e.createLogger ?? Kt())("MessengerEcho");
6146
6146
  typeof window < "u" && (window.Pusher = ya);
6147
- let d = null, g = null, h = null, x = null, M = "disconnected", _ = "available", C = null, b = null;
6148
- const T = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Map(), m = (E) => {
6149
- M = E;
6147
+ let d = null, g = null, h = null, x = null, M = "disconnected", _ = "available", C = null, v = null;
6148
+ const T = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Map(), m = (R) => {
6149
+ M = R;
6150
6150
  for (const P of T)
6151
- P(E);
6152
- }, v = (E) => {
6153
- _ = E;
6151
+ P(R);
6152
+ }, b = (R) => {
6153
+ _ = R;
6154
6154
  for (const P of w)
6155
- P(E);
6155
+ P(R);
6156
6156
  }, N = () => {
6157
- b !== null && (clearTimeout(b), b = null);
6158
- }, q = (E = !0) => {
6159
- h !== null && (h.disconnect(), h = null), x = null, E && m("disconnected");
6157
+ v !== null && (clearTimeout(v), v = null);
6158
+ }, q = (R = !0) => {
6159
+ h !== null && (h.disconnect(), h = null), x = null, R && m("disconnected");
6160
6160
  }, G = () => {
6161
- N(), d = null, g = null, C = null, v("available"), q(), f.clear();
6161
+ N(), d = null, g = null, C = null, b("available"), q(), f.clear();
6162
6162
  }, k = () => {
6163
6163
  if (!e.getSourceToken)
6164
6164
  return null;
6165
- const E = e.getSourceToken();
6166
- return E === null ? (G(), null) : (C !== null && C !== E && (N(), d = null, g = null, v("available"), q()), C = E, E);
6167
- }, O = (E) => {
6168
- if (E === null)
6165
+ const R = e.getSourceToken();
6166
+ return R === null ? (G(), null) : (C !== null && C !== R && (N(), d = null, g = null, b("available"), q()), C = R, R);
6167
+ }, O = (R) => {
6168
+ if (R === null)
6169
6169
  return !1;
6170
- if (E.auth.expiresAt === null)
6171
- return E.auth.token !== "";
6172
- const P = Date.parse(E.auth.expiresAt);
6170
+ if (R.auth.expiresAt === null)
6171
+ return R.auth.token !== "";
6172
+ const P = Date.parse(R.auth.expiresAt);
6173
6173
  return Number.isNaN(P) ? !1 : P - Date.now() > o;
6174
- }, H = (E) => {
6175
- if (N(), E.auth.expiresAt === null)
6174
+ }, H = (R) => {
6175
+ if (N(), R.auth.expiresAt === null)
6176
6176
  return;
6177
- const P = Date.parse(E.auth.expiresAt);
6177
+ const P = Date.parse(R.auth.expiresAt);
6178
6178
  if (Number.isNaN(P))
6179
6179
  return;
6180
6180
  const D = Math.max(0, P - Date.now() - o);
6181
- b = setTimeout(() => {
6181
+ v = setTimeout(() => {
6182
6182
  J();
6183
6183
  }, D);
6184
- }, F = async (E = !1) => e.getSourceToken && k() === null || !E && _ === "account_suspended" ? null : !E && O(d) ? d : !E && g !== null ? await g : (g = (async () => {
6184
+ }, F = async (R = !1) => e.getSourceToken && k() === null || !R && _ === "account_suspended" ? null : !R && O(d) ? d : !R && g !== null ? await g : (g = (async () => {
6185
6185
  try {
6186
6186
  const D = await e.bootstrapClient.get(
6187
6187
  i,
6188
- E ? { params: { refresh: 1 } } : void 0
6188
+ R ? { params: { refresh: 1 } } : void 0
6189
6189
  ), X = Ra(D.data);
6190
- return d = X, v("available"), H(X), X;
6190
+ return d = X, b("available"), H(X), X;
6191
6191
  } catch (D) {
6192
6192
  if (Ma(D))
6193
- return d = null, N(), v("account_suspended"), q(), m("disconnected"), null;
6193
+ return d = null, N(), b("account_suspended"), q(), m("disconnected"), null;
6194
6194
  throw D;
6195
6195
  }
6196
6196
  })().finally(() => {
6197
6197
  g = null;
6198
6198
  }), await g), J = async () => {
6199
- const E = h !== null;
6199
+ const R = h !== null;
6200
6200
  try {
6201
- if (await F(!0), !E)
6201
+ if (await F(!0), !R)
6202
6202
  return;
6203
- q(!1), await ee(!0);
6203
+ q(!1), await te(!0);
6204
6204
  } catch (P) {
6205
6205
  l.warn("Failed to refresh messenger bootstrap", P);
6206
6206
  }
6207
- }, me = (E) => {
6208
- const P = E.connector?.pusher?.connection;
6207
+ }, me = (R) => {
6208
+ const P = R.connector?.pusher?.connection;
6209
6209
  if (!P) {
6210
6210
  l.warn("Messenger echo connector does not expose a Pusher connection");
6211
6211
  return;
@@ -6232,8 +6232,8 @@ function oc(e) {
6232
6232
  }
6233
6233
  (X === "unavailable" || X === "failed" || X === "disconnected") && m("disconnected");
6234
6234
  }), P.state === "connected" && m("connected");
6235
- }, ee = async (E = !1) => !E && h !== null && O(d) ? h : !E && x !== null ? await x : (x = (async () => {
6236
- const D = await F(E);
6235
+ }, te = async (R = !1) => !R && h !== null && O(d) ? h : !R && x !== null ? await x : (x = (async () => {
6236
+ const D = await F(R);
6237
6237
  if (D === null)
6238
6238
  return null;
6239
6239
  h !== null && q(!1);
@@ -6266,35 +6266,33 @@ function oc(e) {
6266
6266
  "X-Requested-With": "XMLHttpRequest"
6267
6267
  }
6268
6268
  });
6269
- y.interceptors.request.use(async (E) => {
6269
+ y.interceptors.request.use(async (R) => {
6270
6270
  const P = await F();
6271
6271
  if (P === null)
6272
6272
  throw new Error("Messenger bootstrap is unavailable.");
6273
- return E.baseURL = P.service.apiBaseUrl, Vn(E, P.auth.token), E;
6273
+ return R.baseURL = P.service.apiBaseUrl, Vn(R, P.auth.token), R;
6274
6274
  }), y.interceptors.response.use(
6275
- (E) => E,
6276
- async (E) => {
6277
- const P = E.config;
6278
- if (E.response?.status === 401 && P && P._messengerRetry !== !0) {
6275
+ (R) => R,
6276
+ async (R) => {
6277
+ const P = R.config;
6278
+ if (R.response?.status === 401 && P && P._messengerRetry !== !0) {
6279
6279
  P._messengerRetry = !0;
6280
6280
  const D = await F(!0);
6281
6281
  if (D !== null)
6282
6282
  return P.baseURL = D.service.apiBaseUrl, Vn(P, D.auth.token), await y(P);
6283
6283
  }
6284
- return Promise.reject(E);
6284
+ return Promise.reject(R);
6285
6285
  }
6286
6286
  );
6287
- const I = () => _ === "account_suspended" ? null : (ee().catch((E) => {
6288
- l.warn("Failed to initialize messenger echo", E);
6289
- }), h), ae = (E) => (T.add(E), E(M), () => {
6290
- T.delete(E);
6291
- }), B = (E) => (w.add(E), E(_), () => {
6292
- w.delete(E);
6293
- }), A = () => d?.auth.tenantId ?? "global", V = (E) => {
6294
- const P = qt(E.ts)?.getTime() ?? qt(E.last_seen_at)?.getTime() ?? null;
6287
+ const I = () => _ === "account_suspended" ? null : h, ae = (R) => (T.add(R), R(M), () => {
6288
+ T.delete(R);
6289
+ }), B = (R) => (w.add(R), R(_), () => {
6290
+ w.delete(R);
6291
+ }), E = () => d?.auth.tenantId ?? "global", V = (R) => {
6292
+ const P = qt(R.ts)?.getTime() ?? qt(R.last_seen_at)?.getTime() ?? null;
6295
6293
  if (P === null)
6296
6294
  return !0;
6297
- const D = `${E.tenant_scope ?? "global"}:${E.user_id}`, X = f.get(D);
6295
+ const D = `${R.tenant_scope ?? "global"}:${R.user_id}`, X = f.get(D);
6298
6296
  if (X && P < X.timestampMs)
6299
6297
  return !1;
6300
6298
  const Y = Date.now();
@@ -6305,11 +6303,11 @@ function oc(e) {
6305
6303
  for (const [ge, we] of f.entries())
6306
6304
  Y - we.seenAt > c && f.delete(ge);
6307
6305
  return !0;
6308
- }, ne = (E) => {
6306
+ }, ne = (R) => {
6309
6307
  const P = I();
6310
6308
  if (!P || typeof P.join != "function")
6311
6309
  return;
6312
- const D = P.join(`online-users.${A()}`), X = [
6310
+ const D = P.join(`online-users.${E()}`), X = [
6313
6311
  ".PresenceStatusChanged",
6314
6312
  "PresenceStatusChanged",
6315
6313
  ".presence.status.changed",
@@ -6321,17 +6319,17 @@ function oc(e) {
6321
6319
  ];
6322
6320
  for (const Y of X)
6323
6321
  D.listen(Y, (ge) => {
6324
- const we = ka(ge, A());
6325
- !we || !V(we) || E(we);
6322
+ const we = ka(ge, E());
6323
+ !we || !V(we) || R(we);
6326
6324
  });
6327
6325
  }, _e = () => {
6328
- h?.leave(`online-users.${A()}`);
6329
- }, R = (E, P) => {
6326
+ h?.leave(`online-users.${E()}`);
6327
+ }, A = (R, P) => {
6330
6328
  const D = I();
6331
6329
  if (!D)
6332
6330
  return () => {
6333
6331
  };
6334
- const X = D.private(`conversation.${E}`), Y = [];
6332
+ const X = D.private(`conversation.${R}`), Y = [];
6335
6333
  return P.onMessageSent && Y.push({
6336
6334
  event: ".ConversationMessageSent",
6337
6335
  handler: Oe(X, ".ConversationMessageSent", Na, P.onMessageSent)
@@ -6358,10 +6356,10 @@ function oc(e) {
6358
6356
  for (const ge of Y)
6359
6357
  X.stopListening(ge.event, ge.handler);
6360
6358
  };
6361
- }, U = (E) => {
6362
- h?.leave(`conversation.${E}`);
6363
- }, re = (E, P, D) => {
6364
- const X = E.private(`typing-conversation.${P}`), Y = [], ge = [
6359
+ }, U = (R) => {
6360
+ h?.leave(`conversation.${R}`);
6361
+ }, re = (R, P, D) => {
6362
+ const X = R.private(`typing-conversation.${P}`), Y = [], ge = [
6365
6363
  ".TypingStateChanged",
6366
6364
  "TypingStateChanged",
6367
6365
  ".typing.changed",
@@ -6434,23 +6432,23 @@ function oc(e) {
6434
6432
  for (const ye of Y)
6435
6433
  X.stopListening(ye.event, ye.handler);
6436
6434
  };
6437
- }, fe = (E, P) => {
6435
+ }, fe = (R, P) => {
6438
6436
  const D = I();
6439
6437
  if (D)
6440
- return re(D, E, P);
6438
+ return re(D, R, P);
6441
6439
  let X = !1, Y = null;
6442
6440
  return Je().then((ge) => {
6443
- X || !ge || (Y = re(ge, E, P));
6441
+ X || !ge || (Y = re(ge, R, P));
6444
6442
  }).catch((ge) => {
6445
6443
  l.warn("Failed to defer typing subscription", ge);
6446
6444
  }), () => {
6447
6445
  X = !0, Y?.();
6448
6446
  };
6449
- }, ue = (E) => {
6450
- h?.leave(`typing-conversation.${E}`);
6447
+ }, ue = (R) => {
6448
+ h?.leave(`typing-conversation.${R}`);
6451
6449
  }, pe = async () => {
6452
- v("available"), q(), await ee(!0);
6453
- }, Je = async () => _ === "account_suspended" ? null : await ee();
6450
+ b("available"), q(), await te(!0);
6451
+ }, Je = async () => _ === "account_suspended" ? null : await te();
6454
6452
  return {
6455
6453
  apiClient: y,
6456
6454
  initializedEvent: n,
@@ -6463,7 +6461,7 @@ function oc(e) {
6463
6461
  reconnect: pe,
6464
6462
  subscribeToPresenceStatus: ne,
6465
6463
  unsubscribeFromPresenceStatus: _e,
6466
- subscribeToConversation: R,
6464
+ subscribeToConversation: A,
6467
6465
  unsubscribeFromConversation: U,
6468
6466
  subscribeToTyping: fe,
6469
6467
  unsubscribeFromTyping: ue,