@vlprojects-chat/chat 0.17.0-LD-8093.18 → 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 +73 -71
- 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
|
};
|
|
@@ -38455,7 +38455,7 @@ var kD = /* @__PURE__ */ Hs(function(e, t) {
|
|
|
38455
38455
|
}, x = bn(function() {
|
|
38456
38456
|
g.current && fm(o, g.current);
|
|
38457
38457
|
}, [o]);
|
|
38458
|
-
return
|
|
38458
|
+
return yt(function() {
|
|
38459
38459
|
if (!(i || o === "down" || o === "right")) {
|
|
38460
38460
|
var O = zae(function() {
|
|
38461
38461
|
g.current && fm(o, g.current);
|
|
@@ -38464,7 +38464,7 @@ var kD = /* @__PURE__ */ Hs(function(e, t) {
|
|
|
38464
38464
|
O.clear(), A.removeEventListener("resize", O);
|
|
38465
38465
|
};
|
|
38466
38466
|
}
|
|
38467
|
-
}, [o, i]),
|
|
38467
|
+
}, [o, i]), yt(function() {
|
|
38468
38468
|
i || x();
|
|
38469
38469
|
}, [i, x]), _s(j2, Object.assign({
|
|
38470
38470
|
appear: !0,
|
|
@@ -38680,7 +38680,7 @@ function _d(e, t) {
|
|
|
38680
38680
|
};
|
|
38681
38681
|
}, oce);
|
|
38682
38682
|
}
|
|
38683
|
-
var ice = typeof window < "u" ? x_ :
|
|
38683
|
+
var ice = typeof window < "u" ? x_ : yt;
|
|
38684
38684
|
function pP(e) {
|
|
38685
38685
|
var t = On(e);
|
|
38686
38686
|
return ice(function() {
|
|
@@ -38700,7 +38700,7 @@ var jD = /* @__PURE__ */ Hs(function(e, t) {
|
|
|
38700
38700
|
m(null, "timeout", c);
|
|
38701
38701
|
}, b));
|
|
38702
38702
|
});
|
|
38703
|
-
|
|
38703
|
+
yt(function() {
|
|
38704
38704
|
return l && g(o), function() {
|
|
38705
38705
|
d.current && clearTimeout(d.current);
|
|
38706
38706
|
};
|
|
@@ -38714,7 +38714,7 @@ var jD = /* @__PURE__ */ Hs(function(e, t) {
|
|
|
38714
38714
|
}, C = function(E) {
|
|
38715
38715
|
p.onMouseLeave && p.onMouseLeave(E), y();
|
|
38716
38716
|
};
|
|
38717
|
-
return
|
|
38717
|
+
return yt(function() {
|
|
38718
38718
|
if (!s && l)
|
|
38719
38719
|
return window.addEventListener("focus", y), window.addEventListener("blur", v), function() {
|
|
38720
38720
|
window.removeEventListener("focus", y), window.removeEventListener("blur", v);
|
|
@@ -38824,7 +38824,7 @@ var ace = /* @__PURE__ */ Lc(_D), cce = /* @__PURE__ */ yh({
|
|
|
38824
38824
|
});
|
|
38825
38825
|
}, 125);
|
|
38826
38826
|
}, []);
|
|
38827
|
-
|
|
38827
|
+
yt(function() {
|
|
38828
38828
|
return function() {
|
|
38829
38829
|
n.current && clearTimeout(n.current);
|
|
38830
38830
|
};
|
|
@@ -39132,7 +39132,7 @@ const vP = {
|
|
|
39132
39132
|
}, gce = () => {
|
|
39133
39133
|
const e = pe.useContext(D2);
|
|
39134
39134
|
return e ? e.chatSnackbarContainer : null;
|
|
39135
|
-
}, 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 = [
|
|
39136
39136
|
"dist"
|
|
39137
39137
|
], Oce = {
|
|
39138
39138
|
type: "git",
|
|
@@ -46522,7 +46522,7 @@ function xh(e) {
|
|
|
46522
46522
|
var Kde = xh, Xde = Kde, Jde = Xde;
|
|
46523
46523
|
const Zde = /* @__PURE__ */ of(Jde), _i = it(({ route: e, children: t }) => {
|
|
46524
46524
|
const { ui: n } = ot(), [r, o] = Qe(!1);
|
|
46525
|
-
return
|
|
46525
|
+
return yt(
|
|
46526
46526
|
() => Ra(() => {
|
|
46527
46527
|
const i = new Zde(e).match(n.route);
|
|
46528
46528
|
i ? (n.setParams(i), o(!0)) : o(!1);
|
|
@@ -47091,7 +47091,7 @@ const Zde = /* @__PURE__ */ of(Jde), _i = it(({ route: e, children: t }) => {
|
|
|
47091
47091
|
] });
|
|
47092
47092
|
}, fpe = it(upe), dpe = it(({ children: e }) => {
|
|
47093
47093
|
const t = ot();
|
|
47094
|
-
return
|
|
47094
|
+
return yt(
|
|
47095
47095
|
() => Ra(async () => {
|
|
47096
47096
|
if (!t.auth.isAuthorized)
|
|
47097
47097
|
if (t.auth.isAnonymousAllowed) {
|
|
@@ -55878,9 +55878,9 @@ const J6 = (e) => {
|
|
|
55878
55878
|
}, S = () => {
|
|
55879
55879
|
zoe(s);
|
|
55880
55880
|
};
|
|
55881
|
-
return
|
|
55881
|
+
return yt(() => {
|
|
55882
55882
|
n(u.throttleMessages);
|
|
55883
|
-
}, [u]),
|
|
55883
|
+
}, [u]), yt(() => {
|
|
55884
55884
|
setTimeout(() => {
|
|
55885
55885
|
o(!0);
|
|
55886
55886
|
}, 0);
|
|
@@ -56959,7 +56959,7 @@ function u9() {
|
|
|
56959
56959
|
}
|
|
56960
56960
|
}, 300);
|
|
56961
56961
|
};
|
|
56962
|
-
|
|
56962
|
+
yt(function() {
|
|
56963
56963
|
return window.addEventListener("focus", W, !1), function() {
|
|
56964
56964
|
window.removeEventListener("focus", W, !1);
|
|
56965
56965
|
};
|
|
@@ -56967,11 +56967,11 @@ function u9() {
|
|
|
56967
56967
|
var U = On([]), Y = function(be) {
|
|
56968
56968
|
F.current && F.current.contains(be.target) || (be.preventDefault(), U.current = []);
|
|
56969
56969
|
};
|
|
56970
|
-
|
|
56970
|
+
yt(function() {
|
|
56971
56971
|
return b && (document.addEventListener("dragover", mI, !1), document.addEventListener("drop", Y, !1)), function() {
|
|
56972
56972
|
b && (document.removeEventListener("dragover", mI), document.removeEventListener("drop", Y));
|
|
56973
56973
|
};
|
|
56974
|
-
}, [F, b]),
|
|
56974
|
+
}, [F, b]), yt(function() {
|
|
56975
56975
|
return !r && C && F.current && F.current.focus(), function() {
|
|
56976
56976
|
};
|
|
56977
56977
|
}, [F, C, r]);
|
|
@@ -57382,7 +57382,7 @@ const cve = $s("div")({
|
|
|
57382
57382
|
}, bve = ft(yve, { name: "SubmitDelayed" }), wve = it(({ onTimeout: e, submitAttemptTime: t }) => {
|
|
57383
57383
|
var u;
|
|
57384
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);
|
|
57385
|
-
return
|
|
57385
|
+
return yt(() => {
|
|
57386
57386
|
const { settings: p } = n.currentChannel || {};
|
|
57387
57387
|
if (!(p != null && p.slowModeInSecs))
|
|
57388
57388
|
return;
|
|
@@ -57395,9 +57395,9 @@ const cve = $s("div")({
|
|
|
57395
57395
|
s(0), clearInterval(d);
|
|
57396
57396
|
}, 100);
|
|
57397
57397
|
return () => clearTimeout(d);
|
|
57398
|
-
}, []),
|
|
57398
|
+
}, []), yt(() => {
|
|
57399
57399
|
i <= 0 && e();
|
|
57400
|
-
}, [i, e]),
|
|
57400
|
+
}, [i, e]), yt(() => {
|
|
57401
57401
|
if (!l.current)
|
|
57402
57402
|
return c(!0), l.current = setTimeout(() => {
|
|
57403
57403
|
c(!1), l.current = null;
|
|
@@ -57672,7 +57672,7 @@ const wI = ({ value: e, size: t, icon: n, width: r = 2, color: o = "#FF0000" })
|
|
|
57672
57672
|
}, U = (ie) => {
|
|
57673
57673
|
ie.key === "Enter" && !ie.shiftKey && (ie.preventDefault(), ie.stopPropagation(), ae());
|
|
57674
57674
|
};
|
|
57675
|
-
|
|
57675
|
+
yt(() => {
|
|
57676
57676
|
if (_.messageListDimensions === null)
|
|
57677
57677
|
return;
|
|
57678
57678
|
const ie = _.messageListDimensions.height, ee = R ? 9 : 12, Ce = Tve(ie, ee);
|
|
@@ -57840,7 +57840,7 @@ function Vf() {
|
|
|
57840
57840
|
function Qt(e, t) {
|
|
57841
57841
|
return e($a, t);
|
|
57842
57842
|
}
|
|
57843
|
-
function
|
|
57843
|
+
function bt(e, t) {
|
|
57844
57844
|
e(Cb, t);
|
|
57845
57845
|
}
|
|
57846
57846
|
function nC(e) {
|
|
@@ -58014,7 +58014,7 @@ function nr(...e) {
|
|
|
58014
58014
|
return e.forEach((i, s) => {
|
|
58015
58015
|
const a = Math.pow(2, s);
|
|
58016
58016
|
Qt(i, (c) => {
|
|
58017
|
-
n[s] = c, r = r | a, r === o &&
|
|
58017
|
+
n[s] = c, r = r | a, r === o && bt(t, n);
|
|
58018
58018
|
});
|
|
58019
58019
|
}), function(i, s) {
|
|
58020
58020
|
switch (i) {
|
|
@@ -58059,22 +58059,22 @@ const Sm = typeof document < "u" ? pe.useLayoutEffect : pe.useEffect;
|
|
|
58059
58059
|
function v9(e, t, n) {
|
|
58060
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({});
|
|
58061
58061
|
function c(S, C) {
|
|
58062
|
-
S.propsReady &&
|
|
58062
|
+
S.propsReady && bt(S.propsReady, !1);
|
|
58063
58063
|
for (const b of r) {
|
|
58064
58064
|
const E = S[t.required[b]];
|
|
58065
|
-
|
|
58065
|
+
bt(E, C[b]);
|
|
58066
58066
|
}
|
|
58067
58067
|
for (const b of o)
|
|
58068
58068
|
if (b in C) {
|
|
58069
58069
|
const E = S[t.optional[b]];
|
|
58070
|
-
|
|
58070
|
+
bt(E, C[b]);
|
|
58071
58071
|
}
|
|
58072
|
-
S.propsReady &&
|
|
58072
|
+
S.propsReady && bt(S.propsReady, !0);
|
|
58073
58073
|
}
|
|
58074
58074
|
function l(S) {
|
|
58075
58075
|
return i.reduce((C, b) => (C[b] = (E) => {
|
|
58076
58076
|
const x = S[t.methods[b]];
|
|
58077
|
-
|
|
58077
|
+
bt(x, E);
|
|
58078
58078
|
}, C), {});
|
|
58079
58079
|
}
|
|
58080
58080
|
function u(S) {
|
|
@@ -58093,7 +58093,7 @@ function v9(e, t, n) {
|
|
|
58093
58093
|
}), pe.useImperativeHandle(C, EI(l(x)));
|
|
58094
58094
|
const A = n;
|
|
58095
58095
|
return /* @__PURE__ */ h.jsx(a.Provider, { value: x, children: n ? /* @__PURE__ */ h.jsx(A, { ...Dve([...r, ...o, ...s], E), children: b }) : b });
|
|
58096
|
-
}), d = (S) => pe.useCallback(m9(
|
|
58096
|
+
}), d = (S) => pe.useCallback(m9(bt, pe.useContext(a)[S]), [S]), m = (S) => {
|
|
58097
58097
|
const b = pe.useContext(a)[S], E = pe.useCallback(
|
|
58098
58098
|
(x) => Qt(b, x),
|
|
58099
58099
|
[b]
|
|
@@ -58691,10 +58691,10 @@ const Zve = {
|
|
|
58691
58691
|
(x) => {
|
|
58692
58692
|
const { groupIndices: O } = xr(v);
|
|
58693
58693
|
if (x > 0)
|
|
58694
|
-
|
|
58694
|
+
bt(t, !0), bt(i, x + RI(x, O));
|
|
58695
58695
|
else if (x < 0) {
|
|
58696
58696
|
const A = xr(y);
|
|
58697
|
-
A.length > 0 && (x -= RI(-x, A)),
|
|
58697
|
+
A.length > 0 && (x -= RI(-x, A)), bt(s, x);
|
|
58698
58698
|
}
|
|
58699
58699
|
}
|
|
58700
58700
|
), Qt(xe(a, St(e)), ([x, O]) => {
|
|
@@ -58861,7 +58861,7 @@ const Th = en(
|
|
|
58861
58861
|
const m = Nt(), g = Nt(), v = ke(0);
|
|
58862
58862
|
let y = null, S = null, C = null;
|
|
58863
58863
|
function b() {
|
|
58864
|
-
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);
|
|
58865
58865
|
}
|
|
58866
58866
|
return qe(
|
|
58867
58867
|
xe(
|
|
@@ -58879,7 +58879,7 @@ const Th = en(
|
|
|
58879
58879
|
let q = Tp(V, x.offsetTree, B) + N;
|
|
58880
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);
|
|
58881
58881
|
const D = (W) => {
|
|
58882
|
-
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));
|
|
58883
58883
|
};
|
|
58884
58884
|
if (b(), re === "smooth") {
|
|
58885
58885
|
let W = !1;
|
|
@@ -58892,7 +58892,7 @@ const Th = en(
|
|
|
58892
58892
|
y = vs(xe(n, $ve(150)), D);
|
|
58893
58893
|
return S = setTimeout(() => {
|
|
58894
58894
|
b();
|
|
58895
|
-
}, 1200),
|
|
58895
|
+
}, 1200), bt(o, !0), _("scrolling from index to", { index: V, top: q, behavior: re }, Mo.DEBUG), { top: q, behavior: re };
|
|
58896
58896
|
}
|
|
58897
58897
|
)
|
|
58898
58898
|
),
|
|
@@ -59109,11 +59109,11 @@ const Rh = en(
|
|
|
59109
59109
|
),
|
|
59110
59110
|
([, u]) => {
|
|
59111
59111
|
vs(i, () => {
|
|
59112
|
-
|
|
59112
|
+
bt(l, !0);
|
|
59113
59113
|
}), sC(4, () => {
|
|
59114
59114
|
vs(r, () => {
|
|
59115
|
-
|
|
59116
|
-
}),
|
|
59115
|
+
bt(a, !0);
|
|
59116
|
+
}), bt(o, u);
|
|
59117
59117
|
});
|
|
59118
59118
|
}
|
|
59119
59119
|
), {
|
|
@@ -59141,7 +59141,7 @@ const rye = (e, t) => typeof e == "function" ? AI(e(t)) : t && AI(e), oye = en(
|
|
|
59141
59141
|
const u = ke(!1), p = Nt();
|
|
59142
59142
|
let d = null;
|
|
59143
59143
|
function m(v) {
|
|
59144
|
-
|
|
59144
|
+
bt(o, {
|
|
59145
59145
|
index: "LAST",
|
|
59146
59146
|
align: "end",
|
|
59147
59147
|
behavior: v
|
|
@@ -59647,10 +59647,10 @@ const lye = D9(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.te
|
|
|
59647
59647
|
)
|
|
59648
59648
|
);
|
|
59649
59649
|
function y(S) {
|
|
59650
|
-
S > 0 ? (
|
|
59650
|
+
S > 0 ? (bt(e, { top: -S, behavior: "auto" }), bt(n, 0)) : (bt(n, 0), bt(e, { top: -S, behavior: "auto" }));
|
|
59651
59651
|
}
|
|
59652
59652
|
return Qt(xe(v, St(n, o)), ([S, C, b]) => {
|
|
59653
|
-
b && lye() ?
|
|
59653
|
+
b && lye() ? bt(n, C - S) : y(-S);
|
|
59654
59654
|
}), Qt(
|
|
59655
59655
|
xe(
|
|
59656
59656
|
nr(Ur(o, !1), n, g),
|
|
@@ -59689,9 +59689,9 @@ const lye = D9(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.te
|
|
|
59689
59689
|
})
|
|
59690
59690
|
),
|
|
59691
59691
|
(S) => {
|
|
59692
|
-
|
|
59693
|
-
|
|
59694
|
-
|
|
59692
|
+
bt(n, S), requestAnimationFrame(() => {
|
|
59693
|
+
bt(e, { top: S }), requestAnimationFrame(() => {
|
|
59694
|
+
bt(n, 0), bt(g, !1);
|
|
59695
59695
|
});
|
|
59696
59696
|
});
|
|
59697
59697
|
}
|
|
@@ -59717,7 +59717,7 @@ const lye = D9(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.te
|
|
|
59717
59717
|
),
|
|
59718
59718
|
() => {
|
|
59719
59719
|
requestAnimationFrame(() => {
|
|
59720
|
-
|
|
59720
|
+
bt(t, o);
|
|
59721
59721
|
});
|
|
59722
59722
|
}
|
|
59723
59723
|
);
|
|
@@ -60363,7 +60363,7 @@ const Uye = /* @__PURE__ */ en(
|
|
|
60363
60363
|
nt(([z, te]) => !!te)
|
|
60364
60364
|
),
|
|
60365
60365
|
() => {
|
|
60366
|
-
|
|
60366
|
+
bt(V, !1);
|
|
60367
60367
|
}
|
|
60368
60368
|
), Qt(
|
|
60369
60369
|
xe(
|
|
@@ -60371,10 +60371,10 @@ const Uye = /* @__PURE__ */ en(
|
|
|
60371
60371
|
nt(([z, te, oe, ie, , ee]) => z && !te && oe.height !== 0 && ie.height !== 0 && !ee)
|
|
60372
60372
|
),
|
|
60373
60373
|
([, , , , z]) => {
|
|
60374
|
-
|
|
60375
|
-
|
|
60374
|
+
bt(q, !0), sC(1, () => {
|
|
60375
|
+
bt(_, z);
|
|
60376
60376
|
}), vs(xe(o), () => {
|
|
60377
|
-
|
|
60377
|
+
bt(n, [0, 0]), bt(V, !0);
|
|
60378
60378
|
});
|
|
60379
60379
|
}
|
|
60380
60380
|
), qe(
|
|
@@ -60391,9 +60391,9 @@ const Uye = /* @__PURE__ */ en(
|
|
|
60391
60391
|
nt(([, z]) => z != null)
|
|
60392
60392
|
),
|
|
60393
60393
|
([, z]) => {
|
|
60394
|
-
z && (
|
|
60395
|
-
|
|
60396
|
-
}),
|
|
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 })));
|
|
60397
60397
|
}
|
|
60398
60398
|
), qe(
|
|
60399
60399
|
xe(
|
|
@@ -62253,20 +62253,20 @@ const Mbe = (e) => {
|
|
|
62253
62253
|
})), Gbe = it((e) => {
|
|
62254
62254
|
var S, C;
|
|
62255
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);
|
|
62256
|
-
if (
|
|
62256
|
+
if (yt(() => {
|
|
62257
62257
|
g && (Oo.emit(ro.App, {
|
|
62258
62258
|
event: Io.ChatIsReady
|
|
62259
62259
|
}), Kd.post("chat.isReady", !0), _e.info("Channel is ready", { channelId: g.id }));
|
|
62260
62260
|
}, [g]), !g)
|
|
62261
62261
|
return /* @__PURE__ */ h.jsx(h.Fragment, { children: "Channel not found" });
|
|
62262
62262
|
const v = g.sortedMessages;
|
|
62263
|
-
|
|
62263
|
+
yt(() => {
|
|
62264
62264
|
const b = v.length - c;
|
|
62265
62265
|
l(v.length), b > 1 && a(s - b);
|
|
62266
62266
|
}, [g.sortedMessages.length]), wk(ro.App, ({ event: b }) => {
|
|
62267
62267
|
var E;
|
|
62268
62268
|
b === Io.MessageSent && ((E = n.current) == null || E.scrollToIndex({ index: g.sortedMessages.length - 1, behavior: "smooth" }));
|
|
62269
|
-
}),
|
|
62269
|
+
}), yt(() => {
|
|
62270
62270
|
r.setJumpToMessage((E) => {
|
|
62271
62271
|
var x;
|
|
62272
62272
|
(x = n.current) == null || x.scrollToIndex({ index: E, behavior: "smooth" });
|
|
@@ -62282,7 +62282,7 @@ const Mbe = (e) => {
|
|
|
62282
62282
|
var b;
|
|
62283
62283
|
u || await O2(i, Number(t), Number((b = v[0]) == null ? void 0 : b.id)) || p(!0);
|
|
62284
62284
|
}, [(S = v[0]) == null ? void 0 : S.id, u]);
|
|
62285
|
-
return
|
|
62285
|
+
return yt(() => Gc(
|
|
62286
62286
|
() => {
|
|
62287
62287
|
var b;
|
|
62288
62288
|
return (b = i.currentChannel) == null ? void 0 : b.loaded;
|
|
@@ -62465,15 +62465,15 @@ const Mbe = (e) => {
|
|
|
62465
62465
|
await O2(e, Number(t.id)), await C2(e, t.id), t.setLoaded(!0);
|
|
62466
62466
|
}, Qbe = it(() => {
|
|
62467
62467
|
const e = ot(), { auth: t } = e, n = e.currentChannel;
|
|
62468
|
-
|
|
62468
|
+
yt(() => {
|
|
62469
62469
|
n != null && n.id && C2(e, n == null ? void 0 : n.id);
|
|
62470
|
-
}, []),
|
|
62470
|
+
}, []), yt(() => {
|
|
62471
62471
|
n && !(n != null && n.loaded) && (n.type === _n.Direct ? Zbe(e, n) : n.setLoaded(!0));
|
|
62472
|
-
}, [n, n == null ? void 0 : n.loaded]),
|
|
62472
|
+
}, [n, n == null ? void 0 : n.loaded]), yt(() => {
|
|
62473
62473
|
n && n.id && (n.setLastReadTimestamp(Date.now()), n.setUnreadMessagesCount(0));
|
|
62474
62474
|
}, [n]);
|
|
62475
62475
|
const r = On(!1);
|
|
62476
|
-
if (
|
|
62476
|
+
if (yt(() => {
|
|
62477
62477
|
var s;
|
|
62478
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;
|
|
62479
62479
|
}, [
|
|
@@ -62727,7 +62727,7 @@ const Mbe = (e) => {
|
|
|
62727
62727
|
] })
|
|
62728
62728
|
] }), f0e = () => {
|
|
62729
62729
|
const e = ot(), [t, n] = Qe(!1);
|
|
62730
|
-
|
|
62730
|
+
yt(() => {
|
|
62731
62731
|
(async () => {
|
|
62732
62732
|
try {
|
|
62733
62733
|
n(!0), await vC(e);
|
|
@@ -64657,7 +64657,7 @@ const C1e = (e) => {
|
|
|
64657
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}`)) });
|
|
64658
64658
|
}, j1e = it(M1e), D1e = () => {
|
|
64659
64659
|
const e = ot(), { ui: t } = e, n = e.currentChannel;
|
|
64660
|
-
|
|
64660
|
+
yt(() => {
|
|
64661
64661
|
async function o() {
|
|
64662
64662
|
const i = await Yle(n == null ? void 0 : n.id);
|
|
64663
64663
|
i && (n == null || n.setPollList(i));
|
|
@@ -64691,7 +64691,7 @@ const C1e = (e) => {
|
|
|
64691
64691
|
{ name: "Profile" }
|
|
64692
64692
|
), B1e = it(() => {
|
|
64693
64693
|
const e = Yn(), t = L1e(), { auth: n, ui: r } = ot(), o = ot(), { enqueueSnackbar: i } = _f(), [s, a] = Qe(""), [c, l] = Qe(void 0);
|
|
64694
|
-
|
|
64694
|
+
yt(() => {
|
|
64695
64695
|
a(n.me.displayName), l(n.me.avatarUrl);
|
|
64696
64696
|
}, [n.me]);
|
|
64697
64697
|
const u = async () => {
|
|
@@ -64769,7 +64769,7 @@ const C1e = (e) => {
|
|
|
64769
64769
|
return "loadingInitial";
|
|
64770
64770
|
}, V1e = ({ children: e }) => {
|
|
64771
64771
|
const { socket: t } = ot(), n = ot(), { enqueueSnackbar: r } = _f(), [o, i] = Qe(!1);
|
|
64772
|
-
|
|
64772
|
+
yt(
|
|
64773
64773
|
() => Ra(async () => {
|
|
64774
64774
|
if (!t.isSocketConnected)
|
|
64775
64775
|
try {
|
|
@@ -64778,7 +64778,7 @@ const C1e = (e) => {
|
|
|
64778
64778
|
_e.info("Failed to connect to socket server", { error: b2(a) }), r(ll(a));
|
|
64779
64779
|
}
|
|
64780
64780
|
})
|
|
64781
|
-
),
|
|
64781
|
+
), yt(
|
|
64782
64782
|
() => Gc(
|
|
64783
64783
|
() => t.isSocketConnected,
|
|
64784
64784
|
(a) => {
|
|
@@ -65192,7 +65192,7 @@ const C1e = (e) => {
|
|
|
65192
65192
|
l(i.current);
|
|
65193
65193
|
}
|
|
65194
65194
|
};
|
|
65195
|
-
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), () => {
|
|
65196
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);
|
|
65197
65197
|
}) : () => {
|
|
65198
65198
|
}, [t, r]), {
|
|
@@ -65371,24 +65371,26 @@ const C1e = (e) => {
|
|
|
65371
65371
|
chatVisualState: m
|
|
65372
65372
|
}), A.ui.setChatVisualState(m);
|
|
65373
65373
|
};
|
|
65374
|
-
|
|
65374
|
+
yt(() => {
|
|
65375
65375
|
A.ui.setIsVisible(e || !1);
|
|
65376
|
-
}, [e, A]),
|
|
65376
|
+
}, [e, A]), yt(() => {
|
|
65377
|
+
A.setUnreadMsgsCount(0);
|
|
65378
|
+
}, [A.initialChannel]), yt(() => Gc(
|
|
65377
65379
|
() => A.toggleReset,
|
|
65378
65380
|
() => {
|
|
65379
65381
|
k();
|
|
65380
65382
|
}
|
|
65381
|
-
), []),
|
|
65383
|
+
), []), yt(() => Gc(
|
|
65382
65384
|
() => A.auth.isModerator,
|
|
65383
65385
|
(R, _) => {
|
|
65384
65386
|
!R && _ && k();
|
|
65385
65387
|
}
|
|
65386
|
-
), []),
|
|
65388
|
+
), []), yt(() => {
|
|
65387
65389
|
x && A.ui.isMobile && A.ui.setChatVisualState(m), _e.info("Change chat visual state", {
|
|
65388
65390
|
chatVisualState: m,
|
|
65389
65391
|
isReady: x
|
|
65390
65392
|
});
|
|
65391
|
-
}, [m, x]),
|
|
65393
|
+
}, [m, x]), yt(() => {
|
|
65392
65394
|
if (!E)
|
|
65393
65395
|
return;
|
|
65394
65396
|
E(() => {
|
|
@@ -65398,7 +65400,7 @@ const C1e = (e) => {
|
|
|
65398
65400
|
isModerator: A.auth.isModerator
|
|
65399
65401
|
};
|
|
65400
65402
|
});
|
|
65401
|
-
}, [E]),
|
|
65403
|
+
}, [E]), yt(() => (k(), () => {
|
|
65402
65404
|
_e.info("Chat unmount");
|
|
65403
65405
|
}), [
|
|
65404
65406
|
r,
|
|
@@ -65406,7 +65408,7 @@ const C1e = (e) => {
|
|
|
65406
65408
|
n,
|
|
65407
65409
|
i,
|
|
65408
65410
|
a
|
|
65409
|
-
]),
|
|
65411
|
+
]), yt(() => {
|
|
65410
65412
|
A.settings.setShowCloseButton(c), A.settings.setShowHeader(l), A.settings.setShowMessageInput(u), A.settings.setShowOpenInPopupButton(p), A.settings.setShowPolls(d);
|
|
65411
65413
|
}, [
|
|
65412
65414
|
c,
|