@vlprojects-chat/chat 0.17.0-LD-8093.17 → 0.17.0-LD-8093.19
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.mjs +78 -79
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var S_ = Object.defineProperty;
|
|
|
2
2
|
var E_ = (e, t, n) => t in e ? S_(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Hf = (e, t, n) => E_(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as j from "react";
|
|
5
|
-
import pe, { useState as Qe, forwardRef as Hs, memo as Lc, version as p3, useEffect as
|
|
5
|
+
import pe, { useState as Qe, forwardRef as Hs, memo as Lc, version as p3, useEffect as yt, createContext as h3, useContext as CE, useRef as On, useCallback as bn, createElement as _s, cloneElement as Sd, useMemo as po, useLayoutEffect as x_, Component as C_, isValidElement as Ed, Children as T_, Fragment as m3, useReducer as O_, useImperativeHandle as R_ } from "react";
|
|
6
6
|
import { CacheProvider as A_, Global as P_, ThemeContext as g3, keyframes as Va, css as Pp } from "@emotion/react";
|
|
7
7
|
import * as I_ from "react-dom";
|
|
8
8
|
import ld, { unstable_batchedUpdates as N_, createPortal as k_ } from "react-dom";
|
|
@@ -20040,7 +20040,7 @@ function bk(e, t, n, r) {
|
|
|
20040
20040
|
}
|
|
20041
20041
|
var xK = Rx.exports;
|
|
20042
20042
|
const Oo = new xK.EventEmitter(), wk = (e, t) => {
|
|
20043
|
-
|
|
20043
|
+
yt(() => (Oo.on(e, t), () => {
|
|
20044
20044
|
Oo.off(e, t);
|
|
20045
20045
|
}), []);
|
|
20046
20046
|
};
|
|
@@ -33761,18 +33761,15 @@ const C2 = async (e, t) => {
|
|
|
33761
33761
|
};
|
|
33762
33762
|
var ur = /* @__PURE__ */ ((e) => (e.Message = "message", e.DirectMessage = "direct-message", e.SystemMessage = "system:message", e.NewPublic = "new-public", e.NewChannelUser = "new-channel-user", e.NewDirect = "new-direct", e.TriggerDirectUiRedirect = "trigger-direct-ui-redirect", e.PollStart = "poll-start", e.PollStop = "poll-stop", e.PollVoteOpenEnded = "poll-vote-open-ended", e.PollVotesUpdate = "poll-votes-update", e.UserUpdateProfile = "user-update-profile", e.MessagePinned = "message-pinned", e.DeleteMessages = "delete-messages", e.CleanChannelMessages = "clean-channel-messages", e.UserConnected = "user-connected", e.UserMuted = "user-muted", e.UserUnmuted = "user-unmuted", e.UpdateChannelSettings = "user-update-channel-settings", e))(ur || {});
|
|
33763
33763
|
const Xoe = async (e) => {
|
|
33764
|
-
var n;
|
|
33765
33764
|
const t = e.ui.channelId;
|
|
33766
33765
|
try {
|
|
33767
|
-
const
|
|
33768
|
-
e.chat.addUsers([
|
|
33769
|
-
const a = ((n = s[0]) == null ? void 0 : n.messages.length) || 0;
|
|
33770
|
-
e.setUnreadMsgsCount(a), e.chat.sendUnreadMsgCount(a), i.lang && e.ui.setLang(i.lang), _e.info("Inital data received", {
|
|
33766
|
+
const n = await xl(`get-initial?externalId=${t}`), { publics: r, user: o, channels: i } = n;
|
|
33767
|
+
e.chat.addUsers([o]), e.chat.addChannels(i), e.chat.addPubs(r), e.auth.setMe(o), o.lang && e.ui.setLang(o.lang), _e.info("Inital data received", {
|
|
33771
33768
|
externalId: t,
|
|
33772
|
-
user:
|
|
33769
|
+
user: o
|
|
33773
33770
|
});
|
|
33774
|
-
} catch (
|
|
33775
|
-
throw _e.error("Failed to get initial data", { case: "getInitialData", error:
|
|
33771
|
+
} catch (n) {
|
|
33772
|
+
throw _e.error("Failed to get initial data", { case: "getInitialData", error: n, appId: e.auth.appId }), Bt(n, (r) => r.setTransactionName("getInitialData")), n;
|
|
33776
33773
|
}
|
|
33777
33774
|
}, Joe = async (e, t, n) => {
|
|
33778
33775
|
try {
|
|
@@ -38458,7 +38455,7 @@ var kD = /* @__PURE__ */ Hs(function(e, t) {
|
|
|
38458
38455
|
}, x = bn(function() {
|
|
38459
38456
|
g.current && fm(o, g.current);
|
|
38460
38457
|
}, [o]);
|
|
38461
|
-
return
|
|
38458
|
+
return yt(function() {
|
|
38462
38459
|
if (!(i || o === "down" || o === "right")) {
|
|
38463
38460
|
var O = zae(function() {
|
|
38464
38461
|
g.current && fm(o, g.current);
|
|
@@ -38467,7 +38464,7 @@ var kD = /* @__PURE__ */ Hs(function(e, t) {
|
|
|
38467
38464
|
O.clear(), A.removeEventListener("resize", O);
|
|
38468
38465
|
};
|
|
38469
38466
|
}
|
|
38470
|
-
}, [o, i]),
|
|
38467
|
+
}, [o, i]), yt(function() {
|
|
38471
38468
|
i || x();
|
|
38472
38469
|
}, [i, x]), _s(j2, Object.assign({
|
|
38473
38470
|
appear: !0,
|
|
@@ -38683,7 +38680,7 @@ function _d(e, t) {
|
|
|
38683
38680
|
};
|
|
38684
38681
|
}, oce);
|
|
38685
38682
|
}
|
|
38686
|
-
var ice = typeof window < "u" ? x_ :
|
|
38683
|
+
var ice = typeof window < "u" ? x_ : yt;
|
|
38687
38684
|
function pP(e) {
|
|
38688
38685
|
var t = On(e);
|
|
38689
38686
|
return ice(function() {
|
|
@@ -38703,7 +38700,7 @@ var jD = /* @__PURE__ */ Hs(function(e, t) {
|
|
|
38703
38700
|
m(null, "timeout", c);
|
|
38704
38701
|
}, b));
|
|
38705
38702
|
});
|
|
38706
|
-
|
|
38703
|
+
yt(function() {
|
|
38707
38704
|
return l && g(o), function() {
|
|
38708
38705
|
d.current && clearTimeout(d.current);
|
|
38709
38706
|
};
|
|
@@ -38717,7 +38714,7 @@ var jD = /* @__PURE__ */ Hs(function(e, t) {
|
|
|
38717
38714
|
}, C = function(E) {
|
|
38718
38715
|
p.onMouseLeave && p.onMouseLeave(E), y();
|
|
38719
38716
|
};
|
|
38720
|
-
return
|
|
38717
|
+
return yt(function() {
|
|
38721
38718
|
if (!s && l)
|
|
38722
38719
|
return window.addEventListener("focus", y), window.addEventListener("blur", v), function() {
|
|
38723
38720
|
window.removeEventListener("focus", y), window.removeEventListener("blur", v);
|
|
@@ -38827,7 +38824,7 @@ var ace = /* @__PURE__ */ Lc(_D), cce = /* @__PURE__ */ yh({
|
|
|
38827
38824
|
});
|
|
38828
38825
|
}, 125);
|
|
38829
38826
|
}, []);
|
|
38830
|
-
|
|
38827
|
+
yt(function() {
|
|
38831
38828
|
return function() {
|
|
38832
38829
|
n.current && clearTimeout(n.current);
|
|
38833
38830
|
};
|
|
@@ -39135,7 +39132,7 @@ const vP = {
|
|
|
39135
39132
|
}, gce = () => {
|
|
39136
39133
|
const e = pe.useContext(D2);
|
|
39137
39134
|
return e ? e.chatSnackbarContainer : null;
|
|
39138
|
-
}, vce = "@vlprojects-chat/chat", yce = "vlprojects", bce = "0.17.0-LD-8093.
|
|
39135
|
+
}, vce = "@vlprojects-chat/chat", yce = "vlprojects", bce = "0.17.0-LD-8093.18", wce = "vlprojects chat", Sce = "ISC", Ece = "dist/index.d.ts", xce = "./dist/index.mjs", Cce = "./dist/index.mjs", Tce = [
|
|
39139
39136
|
"dist"
|
|
39140
39137
|
], Oce = {
|
|
39141
39138
|
type: "git",
|
|
@@ -46525,7 +46522,7 @@ function xh(e) {
|
|
|
46525
46522
|
var Kde = xh, Xde = Kde, Jde = Xde;
|
|
46526
46523
|
const Zde = /* @__PURE__ */ of(Jde), _i = it(({ route: e, children: t }) => {
|
|
46527
46524
|
const { ui: n } = ot(), [r, o] = Qe(!1);
|
|
46528
|
-
return
|
|
46525
|
+
return yt(
|
|
46529
46526
|
() => Ra(() => {
|
|
46530
46527
|
const i = new Zde(e).match(n.route);
|
|
46531
46528
|
i ? (n.setParams(i), o(!0)) : o(!1);
|
|
@@ -47094,7 +47091,7 @@ const Zde = /* @__PURE__ */ of(Jde), _i = it(({ route: e, children: t }) => {
|
|
|
47094
47091
|
] });
|
|
47095
47092
|
}, fpe = it(upe), dpe = it(({ children: e }) => {
|
|
47096
47093
|
const t = ot();
|
|
47097
|
-
return
|
|
47094
|
+
return yt(
|
|
47098
47095
|
() => Ra(async () => {
|
|
47099
47096
|
if (!t.auth.isAuthorized)
|
|
47100
47097
|
if (t.auth.isAnonymousAllowed) {
|
|
@@ -55881,9 +55878,9 @@ const J6 = (e) => {
|
|
|
55881
55878
|
}, S = () => {
|
|
55882
55879
|
zoe(s);
|
|
55883
55880
|
};
|
|
55884
|
-
return
|
|
55881
|
+
return yt(() => {
|
|
55885
55882
|
n(u.throttleMessages);
|
|
55886
|
-
}, [u]),
|
|
55883
|
+
}, [u]), yt(() => {
|
|
55887
55884
|
setTimeout(() => {
|
|
55888
55885
|
o(!0);
|
|
55889
55886
|
}, 0);
|
|
@@ -56962,7 +56959,7 @@ function u9() {
|
|
|
56962
56959
|
}
|
|
56963
56960
|
}, 300);
|
|
56964
56961
|
};
|
|
56965
|
-
|
|
56962
|
+
yt(function() {
|
|
56966
56963
|
return window.addEventListener("focus", W, !1), function() {
|
|
56967
56964
|
window.removeEventListener("focus", W, !1);
|
|
56968
56965
|
};
|
|
@@ -56970,11 +56967,11 @@ function u9() {
|
|
|
56970
56967
|
var U = On([]), Y = function(be) {
|
|
56971
56968
|
F.current && F.current.contains(be.target) || (be.preventDefault(), U.current = []);
|
|
56972
56969
|
};
|
|
56973
|
-
|
|
56970
|
+
yt(function() {
|
|
56974
56971
|
return b && (document.addEventListener("dragover", mI, !1), document.addEventListener("drop", Y, !1)), function() {
|
|
56975
56972
|
b && (document.removeEventListener("dragover", mI), document.removeEventListener("drop", Y));
|
|
56976
56973
|
};
|
|
56977
|
-
}, [F, b]),
|
|
56974
|
+
}, [F, b]), yt(function() {
|
|
56978
56975
|
return !r && C && F.current && F.current.focus(), function() {
|
|
56979
56976
|
};
|
|
56980
56977
|
}, [F, C, r]);
|
|
@@ -57385,7 +57382,7 @@ const cve = $s("div")({
|
|
|
57385
57382
|
}, bve = ft(yve, { name: "SubmitDelayed" }), wve = it(({ onTimeout: e, submitAttemptTime: t }) => {
|
|
57386
57383
|
var u;
|
|
57387
57384
|
const n = ot(), r = Yn(), o = bve(), [i, s] = Qe(((u = n.currentChannel) == null ? void 0 : u.settings.slowModeInSecs) || 0), [a, c] = Qe(!1), l = On(null);
|
|
57388
|
-
return
|
|
57385
|
+
return yt(() => {
|
|
57389
57386
|
const { settings: p } = n.currentChannel || {};
|
|
57390
57387
|
if (!(p != null && p.slowModeInSecs))
|
|
57391
57388
|
return;
|
|
@@ -57398,9 +57395,9 @@ const cve = $s("div")({
|
|
|
57398
57395
|
s(0), clearInterval(d);
|
|
57399
57396
|
}, 100);
|
|
57400
57397
|
return () => clearTimeout(d);
|
|
57401
|
-
}, []),
|
|
57398
|
+
}, []), yt(() => {
|
|
57402
57399
|
i <= 0 && e();
|
|
57403
|
-
}, [i, e]),
|
|
57400
|
+
}, [i, e]), yt(() => {
|
|
57404
57401
|
if (!l.current)
|
|
57405
57402
|
return c(!0), l.current = setTimeout(() => {
|
|
57406
57403
|
c(!1), l.current = null;
|
|
@@ -57675,7 +57672,7 @@ const wI = ({ value: e, size: t, icon: n, width: r = 2, color: o = "#FF0000" })
|
|
|
57675
57672
|
}, U = (ie) => {
|
|
57676
57673
|
ie.key === "Enter" && !ie.shiftKey && (ie.preventDefault(), ie.stopPropagation(), ae());
|
|
57677
57674
|
};
|
|
57678
|
-
|
|
57675
|
+
yt(() => {
|
|
57679
57676
|
if (_.messageListDimensions === null)
|
|
57680
57677
|
return;
|
|
57681
57678
|
const ie = _.messageListDimensions.height, ee = R ? 9 : 12, Ce = Tve(ie, ee);
|
|
@@ -57843,7 +57840,7 @@ function Vf() {
|
|
|
57843
57840
|
function Qt(e, t) {
|
|
57844
57841
|
return e($a, t);
|
|
57845
57842
|
}
|
|
57846
|
-
function
|
|
57843
|
+
function bt(e, t) {
|
|
57847
57844
|
e(Cb, t);
|
|
57848
57845
|
}
|
|
57849
57846
|
function nC(e) {
|
|
@@ -58017,7 +58014,7 @@ function nr(...e) {
|
|
|
58017
58014
|
return e.forEach((i, s) => {
|
|
58018
58015
|
const a = Math.pow(2, s);
|
|
58019
58016
|
Qt(i, (c) => {
|
|
58020
|
-
n[s] = c, r = r | a, r === o &&
|
|
58017
|
+
n[s] = c, r = r | a, r === o && bt(t, n);
|
|
58021
58018
|
});
|
|
58022
58019
|
}), function(i, s) {
|
|
58023
58020
|
switch (i) {
|
|
@@ -58062,22 +58059,22 @@ const Sm = typeof document < "u" ? pe.useLayoutEffect : pe.useEffect;
|
|
|
58062
58059
|
function v9(e, t, n) {
|
|
58063
58060
|
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), i = Object.keys(t.methods || {}), s = Object.keys(t.events || {}), a = pe.createContext({});
|
|
58064
58061
|
function c(S, C) {
|
|
58065
|
-
S.propsReady &&
|
|
58062
|
+
S.propsReady && bt(S.propsReady, !1);
|
|
58066
58063
|
for (const b of r) {
|
|
58067
58064
|
const E = S[t.required[b]];
|
|
58068
|
-
|
|
58065
|
+
bt(E, C[b]);
|
|
58069
58066
|
}
|
|
58070
58067
|
for (const b of o)
|
|
58071
58068
|
if (b in C) {
|
|
58072
58069
|
const E = S[t.optional[b]];
|
|
58073
|
-
|
|
58070
|
+
bt(E, C[b]);
|
|
58074
58071
|
}
|
|
58075
|
-
S.propsReady &&
|
|
58072
|
+
S.propsReady && bt(S.propsReady, !0);
|
|
58076
58073
|
}
|
|
58077
58074
|
function l(S) {
|
|
58078
58075
|
return i.reduce((C, b) => (C[b] = (E) => {
|
|
58079
58076
|
const x = S[t.methods[b]];
|
|
58080
|
-
|
|
58077
|
+
bt(x, E);
|
|
58081
58078
|
}, C), {});
|
|
58082
58079
|
}
|
|
58083
58080
|
function u(S) {
|
|
@@ -58096,7 +58093,7 @@ function v9(e, t, n) {
|
|
|
58096
58093
|
}), pe.useImperativeHandle(C, EI(l(x)));
|
|
58097
58094
|
const A = n;
|
|
58098
58095
|
return /* @__PURE__ */ h.jsx(a.Provider, { value: x, children: n ? /* @__PURE__ */ h.jsx(A, { ...Dve([...r, ...o, ...s], E), children: b }) : b });
|
|
58099
|
-
}), d = (S) => pe.useCallback(m9(
|
|
58096
|
+
}), d = (S) => pe.useCallback(m9(bt, pe.useContext(a)[S]), [S]), m = (S) => {
|
|
58100
58097
|
const b = pe.useContext(a)[S], E = pe.useCallback(
|
|
58101
58098
|
(x) => Qt(b, x),
|
|
58102
58099
|
[b]
|
|
@@ -58694,10 +58691,10 @@ const Zve = {
|
|
|
58694
58691
|
(x) => {
|
|
58695
58692
|
const { groupIndices: O } = xr(v);
|
|
58696
58693
|
if (x > 0)
|
|
58697
|
-
|
|
58694
|
+
bt(t, !0), bt(i, x + RI(x, O));
|
|
58698
58695
|
else if (x < 0) {
|
|
58699
58696
|
const A = xr(y);
|
|
58700
|
-
A.length > 0 && (x -= RI(-x, A)),
|
|
58697
|
+
A.length > 0 && (x -= RI(-x, A)), bt(s, x);
|
|
58701
58698
|
}
|
|
58702
58699
|
}
|
|
58703
58700
|
), Qt(xe(a, St(e)), ([x, O]) => {
|
|
@@ -58864,7 +58861,7 @@ const Th = en(
|
|
|
58864
58861
|
const m = Nt(), g = Nt(), v = ke(0);
|
|
58865
58862
|
let y = null, S = null, C = null;
|
|
58866
58863
|
function b() {
|
|
58867
|
-
y && (y(), y = null), C && (C(), C = null), S && (clearTimeout(S), S = null),
|
|
58864
|
+
y && (y(), y = null), C && (C(), C = null), S && (clearTimeout(S), S = null), bt(o, !1);
|
|
58868
58865
|
}
|
|
58869
58866
|
return qe(
|
|
58870
58867
|
xe(
|
|
@@ -58882,7 +58879,7 @@ const Th = en(
|
|
|
58882
58879
|
let q = Tp(V, x.offsetTree, B) + N;
|
|
58883
58880
|
G === "end" ? (q += K + Ai(x.sizeTree, V)[1] - O + F, V === Z && (q += R)) : G === "center" ? q += (K + Ai(x.sizeTree, V)[1] - O + F) / 2 : q -= k, ae && (q += ae);
|
|
58884
58881
|
const D = (W) => {
|
|
58885
|
-
b(), W ? (_("retrying to scroll to", { location: E }, Mo.DEBUG),
|
|
58882
|
+
b(), W ? (_("retrying to scroll to", { location: E }, Mo.DEBUG), bt(m, E)) : (bt(g, !0), _("list did not change, scroll successful", {}, Mo.DEBUG));
|
|
58886
58883
|
};
|
|
58887
58884
|
if (b(), re === "smooth") {
|
|
58888
58885
|
let W = !1;
|
|
@@ -58895,7 +58892,7 @@ const Th = en(
|
|
|
58895
58892
|
y = vs(xe(n, $ve(150)), D);
|
|
58896
58893
|
return S = setTimeout(() => {
|
|
58897
58894
|
b();
|
|
58898
|
-
}, 1200),
|
|
58895
|
+
}, 1200), bt(o, !0), _("scrolling from index to", { index: V, top: q, behavior: re }, Mo.DEBUG), { top: q, behavior: re };
|
|
58899
58896
|
}
|
|
58900
58897
|
)
|
|
58901
58898
|
),
|
|
@@ -59112,11 +59109,11 @@ const Rh = en(
|
|
|
59112
59109
|
),
|
|
59113
59110
|
([, u]) => {
|
|
59114
59111
|
vs(i, () => {
|
|
59115
|
-
|
|
59112
|
+
bt(l, !0);
|
|
59116
59113
|
}), sC(4, () => {
|
|
59117
59114
|
vs(r, () => {
|
|
59118
|
-
|
|
59119
|
-
}),
|
|
59115
|
+
bt(a, !0);
|
|
59116
|
+
}), bt(o, u);
|
|
59120
59117
|
});
|
|
59121
59118
|
}
|
|
59122
59119
|
), {
|
|
@@ -59144,7 +59141,7 @@ const rye = (e, t) => typeof e == "function" ? AI(e(t)) : t && AI(e), oye = en(
|
|
|
59144
59141
|
const u = ke(!1), p = Nt();
|
|
59145
59142
|
let d = null;
|
|
59146
59143
|
function m(v) {
|
|
59147
|
-
|
|
59144
|
+
bt(o, {
|
|
59148
59145
|
index: "LAST",
|
|
59149
59146
|
align: "end",
|
|
59150
59147
|
behavior: v
|
|
@@ -59650,10 +59647,10 @@ const lye = D9(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.te
|
|
|
59650
59647
|
)
|
|
59651
59648
|
);
|
|
59652
59649
|
function y(S) {
|
|
59653
|
-
S > 0 ? (
|
|
59650
|
+
S > 0 ? (bt(e, { top: -S, behavior: "auto" }), bt(n, 0)) : (bt(n, 0), bt(e, { top: -S, behavior: "auto" }));
|
|
59654
59651
|
}
|
|
59655
59652
|
return Qt(xe(v, St(n, o)), ([S, C, b]) => {
|
|
59656
|
-
b && lye() ?
|
|
59653
|
+
b && lye() ? bt(n, C - S) : y(-S);
|
|
59657
59654
|
}), Qt(
|
|
59658
59655
|
xe(
|
|
59659
59656
|
nr(Ur(o, !1), n, g),
|
|
@@ -59692,9 +59689,9 @@ const lye = D9(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.te
|
|
|
59692
59689
|
})
|
|
59693
59690
|
),
|
|
59694
59691
|
(S) => {
|
|
59695
|
-
|
|
59696
|
-
|
|
59697
|
-
|
|
59692
|
+
bt(n, S), requestAnimationFrame(() => {
|
|
59693
|
+
bt(e, { top: S }), requestAnimationFrame(() => {
|
|
59694
|
+
bt(n, 0), bt(g, !1);
|
|
59698
59695
|
});
|
|
59699
59696
|
});
|
|
59700
59697
|
}
|
|
@@ -59720,7 +59717,7 @@ const lye = D9(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.te
|
|
|
59720
59717
|
),
|
|
59721
59718
|
() => {
|
|
59722
59719
|
requestAnimationFrame(() => {
|
|
59723
|
-
|
|
59720
|
+
bt(t, o);
|
|
59724
59721
|
});
|
|
59725
59722
|
}
|
|
59726
59723
|
);
|
|
@@ -60366,7 +60363,7 @@ const Uye = /* @__PURE__ */ en(
|
|
|
60366
60363
|
nt(([z, te]) => !!te)
|
|
60367
60364
|
),
|
|
60368
60365
|
() => {
|
|
60369
|
-
|
|
60366
|
+
bt(V, !1);
|
|
60370
60367
|
}
|
|
60371
60368
|
), Qt(
|
|
60372
60369
|
xe(
|
|
@@ -60374,10 +60371,10 @@ const Uye = /* @__PURE__ */ en(
|
|
|
60374
60371
|
nt(([z, te, oe, ie, , ee]) => z && !te && oe.height !== 0 && ie.height !== 0 && !ee)
|
|
60375
60372
|
),
|
|
60376
60373
|
([, , , , z]) => {
|
|
60377
|
-
|
|
60378
|
-
|
|
60374
|
+
bt(q, !0), sC(1, () => {
|
|
60375
|
+
bt(_, z);
|
|
60379
60376
|
}), vs(xe(o), () => {
|
|
60380
|
-
|
|
60377
|
+
bt(n, [0, 0]), bt(V, !0);
|
|
60381
60378
|
});
|
|
60382
60379
|
}
|
|
60383
60380
|
), qe(
|
|
@@ -60394,9 +60391,9 @@ const Uye = /* @__PURE__ */ en(
|
|
|
60394
60391
|
nt(([, z]) => z != null)
|
|
60395
60392
|
),
|
|
60396
60393
|
([, z]) => {
|
|
60397
|
-
z && (
|
|
60398
|
-
|
|
60399
|
-
}),
|
|
60394
|
+
z && (bt(N, z.viewport), bt(R, z == null ? void 0 : z.item), bt(L, z.gap), z.scrollTop > 0 && (bt(ae, !0), vs(xe(o, nf(1)), (te) => {
|
|
60395
|
+
bt(ae, !1);
|
|
60396
|
+
}), bt(a, { top: z.scrollTop })));
|
|
60400
60397
|
}
|
|
60401
60398
|
), qe(
|
|
60402
60399
|
xe(
|
|
@@ -62256,20 +62253,20 @@ const Mbe = (e) => {
|
|
|
62256
62253
|
})), Gbe = it((e) => {
|
|
62257
62254
|
var S, C;
|
|
62258
62255
|
const { channelId: t } = e, n = On(null), { ui: r, chat: o } = ot(), i = ot(), [s, a] = Qe(Qye), [c, l] = Qe(0), [u, p] = Qe(!1), d = On(null), m = gce(), g = o.channels.get(t);
|
|
62259
|
-
if (
|
|
62256
|
+
if (yt(() => {
|
|
62260
62257
|
g && (Oo.emit(ro.App, {
|
|
62261
62258
|
event: Io.ChatIsReady
|
|
62262
62259
|
}), Kd.post("chat.isReady", !0), _e.info("Channel is ready", { channelId: g.id }));
|
|
62263
62260
|
}, [g]), !g)
|
|
62264
62261
|
return /* @__PURE__ */ h.jsx(h.Fragment, { children: "Channel not found" });
|
|
62265
62262
|
const v = g.sortedMessages;
|
|
62266
|
-
|
|
62263
|
+
yt(() => {
|
|
62267
62264
|
const b = v.length - c;
|
|
62268
62265
|
l(v.length), b > 1 && a(s - b);
|
|
62269
62266
|
}, [g.sortedMessages.length]), wk(ro.App, ({ event: b }) => {
|
|
62270
62267
|
var E;
|
|
62271
62268
|
b === Io.MessageSent && ((E = n.current) == null || E.scrollToIndex({ index: g.sortedMessages.length - 1, behavior: "smooth" }));
|
|
62272
|
-
}),
|
|
62269
|
+
}), yt(() => {
|
|
62273
62270
|
r.setJumpToMessage((E) => {
|
|
62274
62271
|
var x;
|
|
62275
62272
|
(x = n.current) == null || x.scrollToIndex({ index: E, behavior: "smooth" });
|
|
@@ -62285,7 +62282,7 @@ const Mbe = (e) => {
|
|
|
62285
62282
|
var b;
|
|
62286
62283
|
u || await O2(i, Number(t), Number((b = v[0]) == null ? void 0 : b.id)) || p(!0);
|
|
62287
62284
|
}, [(S = v[0]) == null ? void 0 : S.id, u]);
|
|
62288
|
-
return
|
|
62285
|
+
return yt(() => Gc(
|
|
62289
62286
|
() => {
|
|
62290
62287
|
var b;
|
|
62291
62288
|
return (b = i.currentChannel) == null ? void 0 : b.loaded;
|
|
@@ -62468,15 +62465,15 @@ const Mbe = (e) => {
|
|
|
62468
62465
|
await O2(e, Number(t.id)), await C2(e, t.id), t.setLoaded(!0);
|
|
62469
62466
|
}, Qbe = it(() => {
|
|
62470
62467
|
const e = ot(), { auth: t } = e, n = e.currentChannel;
|
|
62471
|
-
|
|
62468
|
+
yt(() => {
|
|
62472
62469
|
n != null && n.id && C2(e, n == null ? void 0 : n.id);
|
|
62473
|
-
}, []),
|
|
62470
|
+
}, []), yt(() => {
|
|
62474
62471
|
n && !(n != null && n.loaded) && (n.type === _n.Direct ? Zbe(e, n) : n.setLoaded(!0));
|
|
62475
|
-
}, [n, n == null ? void 0 : n.loaded]),
|
|
62472
|
+
}, [n, n == null ? void 0 : n.loaded]), yt(() => {
|
|
62476
62473
|
n && n.id && (n.setLastReadTimestamp(Date.now()), n.setUnreadMessagesCount(0));
|
|
62477
62474
|
}, [n]);
|
|
62478
62475
|
const r = On(!1);
|
|
62479
|
-
if (
|
|
62476
|
+
if (yt(() => {
|
|
62480
62477
|
var s;
|
|
62481
62478
|
n != null && n.id && e.ui.route.includes(n == null ? void 0 : n.id) && !r.current && e.ui.isVisible && (n.setLastReadTimestamp(Date.now()), n.setUnreadMessagesCount(0), n.id === ((s = e.initialChannel) == null ? void 0 : s.id) && (e.setUnreadMsgsCount(0), e.chat.sendUnreadMsgCount(0))), r.current = e.ui.isVisible;
|
|
62482
62479
|
}, [
|
|
@@ -62730,7 +62727,7 @@ const Mbe = (e) => {
|
|
|
62730
62727
|
] })
|
|
62731
62728
|
] }), f0e = () => {
|
|
62732
62729
|
const e = ot(), [t, n] = Qe(!1);
|
|
62733
|
-
|
|
62730
|
+
yt(() => {
|
|
62734
62731
|
(async () => {
|
|
62735
62732
|
try {
|
|
62736
62733
|
n(!0), await vC(e);
|
|
@@ -64660,7 +64657,7 @@ const C1e = (e) => {
|
|
|
64660
64657
|
return /* @__PURE__ */ h.jsx(h.Fragment, { children: r == null ? void 0 : r.map((i) => /* @__PURE__ */ h.jsx(k1e, { templatePoll: i, onDelete: o }, `${i.question}-${i.id}`)) });
|
|
64661
64658
|
}, j1e = it(M1e), D1e = () => {
|
|
64662
64659
|
const e = ot(), { ui: t } = e, n = e.currentChannel;
|
|
64663
|
-
|
|
64660
|
+
yt(() => {
|
|
64664
64661
|
async function o() {
|
|
64665
64662
|
const i = await Yle(n == null ? void 0 : n.id);
|
|
64666
64663
|
i && (n == null || n.setPollList(i));
|
|
@@ -64694,7 +64691,7 @@ const C1e = (e) => {
|
|
|
64694
64691
|
{ name: "Profile" }
|
|
64695
64692
|
), B1e = it(() => {
|
|
64696
64693
|
const e = Yn(), t = L1e(), { auth: n, ui: r } = ot(), o = ot(), { enqueueSnackbar: i } = _f(), [s, a] = Qe(""), [c, l] = Qe(void 0);
|
|
64697
|
-
|
|
64694
|
+
yt(() => {
|
|
64698
64695
|
a(n.me.displayName), l(n.me.avatarUrl);
|
|
64699
64696
|
}, [n.me]);
|
|
64700
64697
|
const u = async () => {
|
|
@@ -64772,7 +64769,7 @@ const C1e = (e) => {
|
|
|
64772
64769
|
return "loadingInitial";
|
|
64773
64770
|
}, V1e = ({ children: e }) => {
|
|
64774
64771
|
const { socket: t } = ot(), n = ot(), { enqueueSnackbar: r } = _f(), [o, i] = Qe(!1);
|
|
64775
|
-
|
|
64772
|
+
yt(
|
|
64776
64773
|
() => Ra(async () => {
|
|
64777
64774
|
if (!t.isSocketConnected)
|
|
64778
64775
|
try {
|
|
@@ -64781,7 +64778,7 @@ const C1e = (e) => {
|
|
|
64781
64778
|
_e.info("Failed to connect to socket server", { error: b2(a) }), r(ll(a));
|
|
64782
64779
|
}
|
|
64783
64780
|
})
|
|
64784
|
-
),
|
|
64781
|
+
), yt(
|
|
64785
64782
|
() => Gc(
|
|
64786
64783
|
() => t.isSocketConnected,
|
|
64787
64784
|
(a) => {
|
|
@@ -65195,7 +65192,7 @@ const C1e = (e) => {
|
|
|
65195
65192
|
l(i.current);
|
|
65196
65193
|
}
|
|
65197
65194
|
};
|
|
65198
|
-
return
|
|
65195
|
+
return yt(() => t ? (r == null || r.addEventListener("mousedown", p), r == null || r.addEventListener("touchstart", p), window.addEventListener("mousemove", d), window.addEventListener("touchmove", d), window.addEventListener("mouseup", m), window.addEventListener("touchend", m), () => {
|
|
65199
65196
|
r == null || r.addEventListener("mousedown", p), r == null || r.addEventListener("touchstart", p), window.addEventListener("mousemove", d), window.addEventListener("touchmove", d), window.addEventListener("mouseup", m), window.addEventListener("touchend", m);
|
|
65200
65197
|
}) : () => {
|
|
65201
65198
|
}, [t, r]), {
|
|
@@ -65374,24 +65371,26 @@ const C1e = (e) => {
|
|
|
65374
65371
|
chatVisualState: m
|
|
65375
65372
|
}), A.ui.setChatVisualState(m);
|
|
65376
65373
|
};
|
|
65377
|
-
|
|
65374
|
+
yt(() => {
|
|
65378
65375
|
A.ui.setIsVisible(e || !1);
|
|
65379
|
-
}, [e, A]),
|
|
65376
|
+
}, [e, A]), yt(() => {
|
|
65377
|
+
A.setUnreadMsgsCount(0);
|
|
65378
|
+
}, [A.initialChannel]), yt(() => Gc(
|
|
65380
65379
|
() => A.toggleReset,
|
|
65381
65380
|
() => {
|
|
65382
65381
|
k();
|
|
65383
65382
|
}
|
|
65384
|
-
), []),
|
|
65383
|
+
), []), yt(() => Gc(
|
|
65385
65384
|
() => A.auth.isModerator,
|
|
65386
65385
|
(R, _) => {
|
|
65387
65386
|
!R && _ && k();
|
|
65388
65387
|
}
|
|
65389
|
-
), []),
|
|
65388
|
+
), []), yt(() => {
|
|
65390
65389
|
x && A.ui.isMobile && A.ui.setChatVisualState(m), _e.info("Change chat visual state", {
|
|
65391
65390
|
chatVisualState: m,
|
|
65392
65391
|
isReady: x
|
|
65393
65392
|
});
|
|
65394
|
-
}, [m, x]),
|
|
65393
|
+
}, [m, x]), yt(() => {
|
|
65395
65394
|
if (!E)
|
|
65396
65395
|
return;
|
|
65397
65396
|
E(() => {
|
|
@@ -65401,7 +65400,7 @@ const C1e = (e) => {
|
|
|
65401
65400
|
isModerator: A.auth.isModerator
|
|
65402
65401
|
};
|
|
65403
65402
|
});
|
|
65404
|
-
}, [E]),
|
|
65403
|
+
}, [E]), yt(() => (k(), () => {
|
|
65405
65404
|
_e.info("Chat unmount");
|
|
65406
65405
|
}), [
|
|
65407
65406
|
r,
|
|
@@ -65409,7 +65408,7 @@ const C1e = (e) => {
|
|
|
65409
65408
|
n,
|
|
65410
65409
|
i,
|
|
65411
65410
|
a
|
|
65412
|
-
]),
|
|
65411
|
+
]), yt(() => {
|
|
65413
65412
|
A.settings.setShowCloseButton(c), A.settings.setShowHeader(l), A.settings.setShowMessageInput(u), A.settings.setShowOpenInPopupButton(p), A.settings.setShowPolls(d);
|
|
65414
65413
|
}, [
|
|
65415
65414
|
c,
|