@ethora/chat-component 26.7.8 → 26.8.1
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/{ChatProfileModal-k4_0ol-1.js → ChatProfileModal-DZVi2WRb.js} +3 -3
- package/dist/{FilePreviewModal-BYoSZ4d1.js → FilePreviewModal-BelSYN5e.js} +1 -1
- package/dist/{ManageDataModal-Dje7zTG4.js → ManageDataModal-Bs_0SHBL.js} +2 -2
- package/dist/{MarkdownBody-Cm3GPQGA.js → MarkdownBody-BYUK4GVM.js} +1 -1
- package/dist/{SideDrawer-DWeOHKWM.js → SideDrawer-C_nWZRwH.js} +1 -1
- package/dist/{UserProfileModal-CUcGYJb9.js → UserProfileModal-CD2IB5SD.js} +3 -3
- package/dist/{UserSettingsModal-LWwOt5TY.js → UserSettingsModal-J7uJfki1.js} +2 -2
- package/dist/{VideoCallOverlay-Dw_ydJ2K.js → VideoCallOverlay-BXHNEhdX.js} +1 -1
- package/dist/{VisibilityModal-D06gXwjS.js → VisibilityModal-4QJnWpAL.js} +2 -2
- package/dist/{handleCopyClick-BOESIBUL.js → handleCopyClick-Bj2V_brV.js} +1 -1
- package/dist/{main-SdAeI1xI.js → main-DmtEeYji.js} +745 -718
- package/dist/main.js +1 -1
- package/dist/networking/api-requests/rooms.api.d.ts +5 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as O, jsx as h, Fragment as Ee } from "react/jsx-runtime";
|
|
2
2
|
import * as ct from "react";
|
|
3
|
-
import Te, { useRef as X, useState as K, useCallback as G, useEffect as
|
|
3
|
+
import Te, { useRef as X, useState as K, useCallback as G, useEffect as Z, useDebugValue as Zd, createElement as Fg, useContext as Ko, useMemo as ge, createContext as Qo, Fragment as Os, Suspense as Nl, useSyncExternalStore as jg, useLayoutEffect as Ug, forwardRef as Tp, lazy as xr, PureComponent as Bg } from "react";
|
|
4
4
|
import { createPortal as Pp } from "react-dom";
|
|
5
5
|
function Yo(e) {
|
|
6
6
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -658,7 +658,7 @@ function Bo() {
|
|
|
658
658
|
const e = d5(), t = Ip(), r = $l(), o = u5(), n = Zo(), i = f5();
|
|
659
659
|
return Lt.EventEmitter = n, Lt.timeout = e, Lt.delay = t, Lt.TimeoutError = r, Lt.promise = o, Lt.Deferred = i, Lt;
|
|
660
660
|
}
|
|
661
|
-
var
|
|
661
|
+
var xt = { exports: {} }, ao = {}, uu;
|
|
662
662
|
function _p() {
|
|
663
663
|
return uu || (uu = 1, ao.detect = function(t) {
|
|
664
664
|
return !(!t || t.replaceAll(String.raw`\20`, "").replaceAll(String.raw`\22`, "").replaceAll(String.raw`\26`, "").replaceAll(String.raw`\27`, "").replaceAll(String.raw`\2f`, "").replaceAll(String.raw`\3a`, "").replaceAll(String.raw`\3c`, "").replaceAll(String.raw`\3e`, "").replaceAll(String.raw`\40`, "").replaceAll(String.raw`\5c`, "").search(/[ "&'/:<>@\\]/g) === -1);
|
|
@@ -753,15 +753,15 @@ function h5() {
|
|
|
753
753
|
}
|
|
754
754
|
var pu;
|
|
755
755
|
function Yi() {
|
|
756
|
-
if (pu) return
|
|
756
|
+
if (pu) return xt.exports;
|
|
757
757
|
pu = 1;
|
|
758
758
|
const e = Dp(), t = _p(), r = h5();
|
|
759
759
|
function o(...n) {
|
|
760
760
|
return !n[1] && !n[2] ? r(...n) : new e(...n);
|
|
761
761
|
}
|
|
762
|
-
return
|
|
762
|
+
return xt.exports = o.bind(), xt.exports.jid = o, xt.exports.JID = e, xt.exports.equal = function(i, s) {
|
|
763
763
|
return i.equals(s);
|
|
764
|
-
},
|
|
764
|
+
}, xt.exports.detectEscape = t.detect, xt.exports.escapeLocal = t.escape, xt.exports.unescapeLocal = t.unescape, xt.exports.parse = r, xt.exports;
|
|
765
765
|
}
|
|
766
766
|
var qs = { exports: {} }, Sr = {}, mu;
|
|
767
767
|
function Fl() {
|
|
@@ -2427,8 +2427,8 @@ function l4() {
|
|
|
2427
2427
|
}
|
|
2428
2428
|
return io.xml = e, io.jid = t, io.client = w, io;
|
|
2429
2429
|
}
|
|
2430
|
-
var
|
|
2431
|
-
const d4 = /* @__PURE__ */ Yo(
|
|
2430
|
+
var te = l4();
|
|
2431
|
+
const d4 = /* @__PURE__ */ Yo(te);
|
|
2432
2432
|
function u4(e, t, r, o) {
|
|
2433
2433
|
const n = {
|
|
2434
2434
|
senderJID: e.jid?.toString(),
|
|
@@ -2463,7 +2463,7 @@ function u4(e, t, r, o) {
|
|
|
2463
2463
|
push: "true"
|
|
2464
2464
|
};
|
|
2465
2465
|
r?.attachments && (n.attachments = r.attachments);
|
|
2466
|
-
const i =
|
|
2466
|
+
const i = te.xml(
|
|
2467
2467
|
"message",
|
|
2468
2468
|
{
|
|
2469
2469
|
id: o,
|
|
@@ -2471,9 +2471,9 @@ function u4(e, t, r, o) {
|
|
|
2471
2471
|
from: e.jid?.toString(),
|
|
2472
2472
|
to: t
|
|
2473
2473
|
},
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2474
|
+
te.xml("body", {}, "media"),
|
|
2475
|
+
te.xml("store", { xmlns: "urn:xmpp:hints" }),
|
|
2476
|
+
te.xml("data", n)
|
|
2477
2477
|
);
|
|
2478
2478
|
e.send(i);
|
|
2479
2479
|
}
|
|
@@ -2515,13 +2515,13 @@ async function Fp(e) {
|
|
|
2515
2515
|
r(null);
|
|
2516
2516
|
}
|
|
2517
2517
|
}, e?.on?.("stanza", n);
|
|
2518
|
-
const c =
|
|
2518
|
+
const c = te.xml(
|
|
2519
2519
|
"iq",
|
|
2520
2520
|
{ id: t, type: "get" },
|
|
2521
|
-
|
|
2521
|
+
te.xml(
|
|
2522
2522
|
"query",
|
|
2523
2523
|
{ xmlns: "jabber:iq:private" },
|
|
2524
|
-
|
|
2524
|
+
te.xml("chatjson", { xmlns: "chatjson:store" })
|
|
2525
2525
|
)
|
|
2526
2526
|
), l = e?.send?.(c);
|
|
2527
2527
|
if (!l || typeof l.catch != "function") {
|
|
@@ -2568,16 +2568,16 @@ async function u1(e, t) {
|
|
|
2568
2568
|
o = (d) => {
|
|
2569
2569
|
d.is("iq") && d.attrs.id === r && a(!0);
|
|
2570
2570
|
}, e?.on("stanza", o);
|
|
2571
|
-
const l =
|
|
2571
|
+
const l = te.xml(
|
|
2572
2572
|
"iq",
|
|
2573
2573
|
{
|
|
2574
2574
|
id: r,
|
|
2575
2575
|
type: "set"
|
|
2576
2576
|
},
|
|
2577
|
-
|
|
2577
|
+
te.xml(
|
|
2578
2578
|
"query",
|
|
2579
2579
|
{ xmlns: "jabber:iq:private" },
|
|
2580
|
-
|
|
2580
|
+
te.xml("chatjson", { xmlns: "chatjson:store", value: t })
|
|
2581
2581
|
)
|
|
2582
2582
|
);
|
|
2583
2583
|
e?.send(l);
|
|
@@ -2603,17 +2603,17 @@ function h4(e, t, r, o) {
|
|
|
2603
2603
|
if (!t || typeof t != "string" || !t.includes("@"))
|
|
2604
2604
|
return;
|
|
2605
2605
|
let n = o ? `typing-${Date.now()}` : `stop-typing-${Date.now()}`;
|
|
2606
|
-
const i =
|
|
2606
|
+
const i = te.xml(
|
|
2607
2607
|
"message",
|
|
2608
2608
|
{
|
|
2609
2609
|
type: "groupchat",
|
|
2610
2610
|
id: n,
|
|
2611
2611
|
to: t
|
|
2612
2612
|
},
|
|
2613
|
-
|
|
2613
|
+
te.xml(o ? "composing" : "paused", {
|
|
2614
2614
|
xmlns: "http://jabber.org/protocol/chatstates"
|
|
2615
2615
|
}),
|
|
2616
|
-
|
|
2616
|
+
te.xml("data", {
|
|
2617
2617
|
fullName: r
|
|
2618
2618
|
})
|
|
2619
2619
|
);
|
|
@@ -2645,14 +2645,14 @@ const f1 = (e) => (e || "").replace(/^https?:\/\//, "").replace(/\/.*$/, "").tri
|
|
|
2645
2645
|
}, v4 = (e, t) => e ? e.includes("@") ? e : t ? `${e}@${t}` : e : "", b4 = {}, w4 = b4 || {}, en = m4(w4), x4 = en.apiUrl, h1 = en.webUrl, S4 = en.xmppBaseDomain, jp = S4, No = en.xmppConference, Mo = en.service, C4 = (e, t, r, o, n, i, s, a, c, l, d, u, f, p) => {
|
|
2646
2646
|
const m = f || (c ? `send-reply-message-${Date.now().toString()}` : `send-text-message-${Date.now().toString()}`);
|
|
2647
2647
|
try {
|
|
2648
|
-
const y =
|
|
2648
|
+
const y = te.xml(
|
|
2649
2649
|
"message",
|
|
2650
2650
|
{
|
|
2651
2651
|
to: t,
|
|
2652
2652
|
type: "groupchat",
|
|
2653
2653
|
id: m
|
|
2654
2654
|
},
|
|
2655
|
-
|
|
2655
|
+
te.xml("data", {
|
|
2656
2656
|
xmlns: u || Mo,
|
|
2657
2657
|
senderFirstName: r,
|
|
2658
2658
|
senderLastName: o,
|
|
@@ -2682,7 +2682,7 @@ const f1 = (e) => (e || "").replace(/^https?:\/\//, "").replace(/\/.*$/, "").tri
|
|
|
2682
2682
|
...p && p.length > 0 ? { mentions: JSON.stringify(p) } : {},
|
|
2683
2683
|
push: "true"
|
|
2684
2684
|
}),
|
|
2685
|
-
|
|
2685
|
+
te.xml("body", {}, s)
|
|
2686
2686
|
);
|
|
2687
2687
|
return e.send(y), !0;
|
|
2688
2688
|
} catch (y) {
|
|
@@ -2690,7 +2690,7 @@ const f1 = (e) => (e || "").replace(/^https?:\/\//, "").replace(/\/.*$/, "").tri
|
|
|
2690
2690
|
}
|
|
2691
2691
|
};
|
|
2692
2692
|
function E4(e, t, r) {
|
|
2693
|
-
const o =
|
|
2693
|
+
const o = te.xml(
|
|
2694
2694
|
"message",
|
|
2695
2695
|
{
|
|
2696
2696
|
from: e.jid?.toString(),
|
|
@@ -2698,8 +2698,8 @@ function E4(e, t, r) {
|
|
|
2698
2698
|
id: "deleteMessageStanza",
|
|
2699
2699
|
type: "groupchat"
|
|
2700
2700
|
},
|
|
2701
|
-
|
|
2702
|
-
|
|
2701
|
+
te.xml("body", "wow"),
|
|
2702
|
+
te.xml("delete", {
|
|
2703
2703
|
id: r
|
|
2704
2704
|
})
|
|
2705
2705
|
);
|
|
@@ -2735,14 +2735,14 @@ const T4 = () => `presenceInRoom-${Date.now().toString(36)}-${(++R4).toString(36
|
|
|
2735
2735
|
u(a, p);
|
|
2736
2736
|
}
|
|
2737
2737
|
}, e.on("stanza", n);
|
|
2738
|
-
const f =
|
|
2738
|
+
const f = te.xml(
|
|
2739
2739
|
"presence",
|
|
2740
2740
|
{
|
|
2741
2741
|
from: e.jid?.toString(),
|
|
2742
2742
|
to: `${t}/${e.jid?.getLocal()}`,
|
|
2743
2743
|
id: s
|
|
2744
2744
|
},
|
|
2745
|
-
|
|
2745
|
+
te.xml("x", { xmlns: "http://jabber.org/protocol/muc" })
|
|
2746
2746
|
);
|
|
2747
2747
|
e.send(f).then(() => {
|
|
2748
2748
|
const { promise: p, cancel: m } = Bl(
|
|
@@ -2762,21 +2762,21 @@ const T4 = () => `presenceInRoom-${Date.now().toString(36)}-${(++R4).toString(36
|
|
|
2762
2762
|
});
|
|
2763
2763
|
};
|
|
2764
2764
|
function P4(e, t) {
|
|
2765
|
-
const r =
|
|
2765
|
+
const r = te.xml(
|
|
2766
2766
|
"iq",
|
|
2767
2767
|
{
|
|
2768
2768
|
type: "set",
|
|
2769
2769
|
to: t,
|
|
2770
2770
|
id: "GetArchive"
|
|
2771
2771
|
},
|
|
2772
|
-
|
|
2772
|
+
te.xml(
|
|
2773
2773
|
"query",
|
|
2774
2774
|
{ xmlns: "urn:xmpp:mam:2" },
|
|
2775
|
-
|
|
2775
|
+
te.xml(
|
|
2776
2776
|
"set",
|
|
2777
2777
|
{ xmlns: "http://jabber.org/protocol/rsm" },
|
|
2778
|
-
|
|
2779
|
-
|
|
2778
|
+
te.xml("max", {}, "1"),
|
|
2779
|
+
te.xml("before")
|
|
2780
2780
|
)
|
|
2781
2781
|
)
|
|
2782
2782
|
);
|
|
@@ -5498,11 +5498,11 @@ const {
|
|
|
5498
5498
|
editRoomMessage: jc,
|
|
5499
5499
|
setMessageTranslation: ry,
|
|
5500
5500
|
setComposing: oy,
|
|
5501
|
-
setIsLoading:
|
|
5501
|
+
setIsLoading: je,
|
|
5502
5502
|
setLastViewedTimestamp: Uc,
|
|
5503
5503
|
setRoomNoMessages: uM,
|
|
5504
5504
|
setRoomsLoadResolved: ny,
|
|
5505
|
-
setCurrentRoom:
|
|
5505
|
+
setCurrentRoom: Ue,
|
|
5506
5506
|
setMemberOnline: iy,
|
|
5507
5507
|
setMemberOffline: sy,
|
|
5508
5508
|
setChatUiVisible: O1,
|
|
@@ -8075,7 +8075,16 @@ const df = () => {
|
|
|
8075
8075
|
// reopen a report dialog by itself.
|
|
8076
8076
|
"presenceByRoom",
|
|
8077
8077
|
"isLoading",
|
|
8078
|
-
"reportRoom"
|
|
8078
|
+
"reportRoom",
|
|
8079
|
+
// Per-session facts about THIS page load's rooms fetch, for the same
|
|
8080
|
+
// reason isLoading is here. Rehydrating roomsLoadedOnce: true from a
|
|
8081
|
+
// previous session tells ChatRoom "the room list is final" before this
|
|
8082
|
+
// session has asked the server anything, which re-opens the empty-state
|
|
8083
|
+
// flash the flag exists to close (the persisted rooms map can come back
|
|
8084
|
+
// empty while the flag comes back true: eviction by the size cap, a
|
|
8085
|
+
// sanitized-away ghost room, or a different account signing in).
|
|
8086
|
+
"roomsLoadedOnce",
|
|
8087
|
+
"roomsLoadError"
|
|
8079
8088
|
],
|
|
8080
8089
|
transforms: [W6, V6, Fm]
|
|
8081
8090
|
}, Q6 = Bp({
|
|
@@ -8185,12 +8194,12 @@ function jm(e, t) {
|
|
|
8185
8194
|
}
|
|
8186
8195
|
}
|
|
8187
8196
|
}, t.on("stanza", r);
|
|
8188
|
-
const c =
|
|
8197
|
+
const c = te.xml(
|
|
8189
8198
|
"presence",
|
|
8190
8199
|
{
|
|
8191
8200
|
to: `${e}/${t.jid.getLocal()}`
|
|
8192
8201
|
},
|
|
8193
|
-
|
|
8202
|
+
te.xml("x", "http://jabber.org/protocol/muc")
|
|
8194
8203
|
);
|
|
8195
8204
|
t.send(c);
|
|
8196
8205
|
}), i = Zi(2e3, o);
|
|
@@ -8205,17 +8214,17 @@ function Um(e, t) {
|
|
|
8205
8214
|
o = (l) => {
|
|
8206
8215
|
l.is("iq") && l.attrs.id === r && l.attrs.type === "result" && (n(), a(!0));
|
|
8207
8216
|
}, t.on("stanza", o);
|
|
8208
|
-
const c =
|
|
8217
|
+
const c = te.xml(
|
|
8209
8218
|
"iq",
|
|
8210
8219
|
{
|
|
8211
8220
|
to: e,
|
|
8212
8221
|
id: r,
|
|
8213
8222
|
type: "set"
|
|
8214
8223
|
},
|
|
8215
|
-
|
|
8224
|
+
te.xml(
|
|
8216
8225
|
"query",
|
|
8217
8226
|
{ xmlns: "http://jabber.org/protocol/muc#owner" },
|
|
8218
|
-
|
|
8227
|
+
te.xml("x", { xmlns: "jabber:x:data", type: "submit" })
|
|
8219
8228
|
)
|
|
8220
8229
|
);
|
|
8221
8230
|
t.send(c);
|
|
@@ -8231,33 +8240,33 @@ function Bm(e, t, r, o) {
|
|
|
8231
8240
|
i = (u) => {
|
|
8232
8241
|
u.attrs.id === n && u.attrs.type === "result" && (s(), l(!0));
|
|
8233
8242
|
}, o.on("stanza", i);
|
|
8234
|
-
const d =
|
|
8243
|
+
const d = te.xml(
|
|
8235
8244
|
"iq",
|
|
8236
8245
|
{
|
|
8237
8246
|
id: n,
|
|
8238
8247
|
to: e,
|
|
8239
8248
|
type: "set"
|
|
8240
8249
|
},
|
|
8241
|
-
|
|
8250
|
+
te.xml(
|
|
8242
8251
|
"query",
|
|
8243
8252
|
{ xmlns: "http://jabber.org/protocol/muc#owner" },
|
|
8244
|
-
|
|
8253
|
+
te.xml(
|
|
8245
8254
|
"x",
|
|
8246
8255
|
{ xmlns: "jabber:x:data", type: "submit" },
|
|
8247
|
-
|
|
8256
|
+
te.xml(
|
|
8248
8257
|
"field",
|
|
8249
8258
|
{ var: "FORM_TYPE" },
|
|
8250
|
-
|
|
8259
|
+
te.xml("value", {}, "http://jabber.org/protocol/muc#roomconfig")
|
|
8251
8260
|
),
|
|
8252
|
-
|
|
8261
|
+
te.xml(
|
|
8253
8262
|
"field",
|
|
8254
8263
|
{ var: "muc#roomconfig_roomname" },
|
|
8255
|
-
|
|
8264
|
+
te.xml("value", {}, t)
|
|
8256
8265
|
),
|
|
8257
|
-
|
|
8266
|
+
te.xml(
|
|
8258
8267
|
"field",
|
|
8259
8268
|
{ var: "muc#roomconfig_roomdesc" },
|
|
8260
|
-
|
|
8269
|
+
te.xml("value", {}, r)
|
|
8261
8270
|
)
|
|
8262
8271
|
)
|
|
8263
8272
|
)
|
|
@@ -8278,13 +8287,13 @@ async function t8(e, t, r) {
|
|
|
8278
8287
|
}
|
|
8279
8288
|
function r8(e, t, r, o, n) {
|
|
8280
8289
|
{
|
|
8281
|
-
const i =
|
|
8290
|
+
const i = te.xml(
|
|
8282
8291
|
"iq",
|
|
8283
8292
|
{
|
|
8284
8293
|
id: r === "icon" ? "setRoomImage" : "setRoomBackgroundImage",
|
|
8285
8294
|
type: "set"
|
|
8286
8295
|
},
|
|
8287
|
-
|
|
8296
|
+
te.xml("query", {
|
|
8288
8297
|
xmlns: "ns:getrooms:setprofile",
|
|
8289
8298
|
room_thumbnail: t,
|
|
8290
8299
|
room_background: n || "",
|
|
@@ -8295,24 +8304,24 @@ function r8(e, t, r, o, n) {
|
|
|
8295
8304
|
}
|
|
8296
8305
|
}
|
|
8297
8306
|
const o8 = (e, t) => {
|
|
8298
|
-
const r =
|
|
8307
|
+
const r = te.xml(
|
|
8299
8308
|
"iq",
|
|
8300
8309
|
{
|
|
8301
8310
|
id: "roomMemberInfo",
|
|
8302
8311
|
type: "get"
|
|
8303
8312
|
},
|
|
8304
|
-
|
|
8313
|
+
te.xml("query", { xmlns: "ns:room:last", room: e })
|
|
8305
8314
|
);
|
|
8306
8315
|
t.send(r);
|
|
8307
8316
|
}, n8 = (e, t) => {
|
|
8308
|
-
const r =
|
|
8317
|
+
const r = te.xml(
|
|
8309
8318
|
"iq",
|
|
8310
8319
|
{
|
|
8311
8320
|
id: "roomInfo",
|
|
8312
8321
|
to: e,
|
|
8313
8322
|
type: "get"
|
|
8314
8323
|
},
|
|
8315
|
-
|
|
8324
|
+
te.xml("query", { xmlns: "http://jabber.org/protocol/disco#info" })
|
|
8316
8325
|
);
|
|
8317
8326
|
t.send(r);
|
|
8318
8327
|
}, i8 = (e, t) => {
|
|
@@ -8320,21 +8329,21 @@ const o8 = (e, t) => {
|
|
|
8320
8329
|
throw new Error(
|
|
8321
8330
|
"Client JID is not set. Ensure the client is authenticated before calling this function."
|
|
8322
8331
|
);
|
|
8323
|
-
const r =
|
|
8332
|
+
const r = te.xml("presence", {
|
|
8324
8333
|
to: `${e}/${t.jid.getLocal()}`,
|
|
8325
8334
|
type: "unavailable"
|
|
8326
8335
|
});
|
|
8327
8336
|
t.send(r);
|
|
8328
8337
|
};
|
|
8329
8338
|
async function s8(e, t, r, o) {
|
|
8330
|
-
const n = `edit-message-${Date.now().toString()}`, i =
|
|
8339
|
+
const n = `edit-message-${Date.now().toString()}`, i = te.xml(
|
|
8331
8340
|
"message",
|
|
8332
8341
|
{
|
|
8333
8342
|
to: t,
|
|
8334
8343
|
type: "groupchat",
|
|
8335
8344
|
id: n
|
|
8336
8345
|
},
|
|
8337
|
-
|
|
8346
|
+
te.xml(
|
|
8338
8347
|
"replace",
|
|
8339
8348
|
{
|
|
8340
8349
|
id: r,
|
|
@@ -8345,44 +8354,44 @@ async function s8(e, t, r, o) {
|
|
|
8345
8354
|
e.send(i);
|
|
8346
8355
|
}
|
|
8347
8356
|
async function a8(e, t, r) {
|
|
8348
|
-
const o = `invite-rooms:${Date.now().toString()}`, n =
|
|
8357
|
+
const o = `invite-rooms:${Date.now().toString()}`, n = te.xml(
|
|
8349
8358
|
"message",
|
|
8350
8359
|
{
|
|
8351
8360
|
to: r,
|
|
8352
8361
|
id: o
|
|
8353
8362
|
},
|
|
8354
|
-
|
|
8363
|
+
te.xml(
|
|
8355
8364
|
"x",
|
|
8356
8365
|
"http://jabber.org/protocol/muc#user",
|
|
8357
|
-
|
|
8366
|
+
te.xml("invite", { to: t + e8 })
|
|
8358
8367
|
)
|
|
8359
8368
|
);
|
|
8360
8369
|
e.send(n);
|
|
8361
8370
|
}
|
|
8362
8371
|
const Hm = "ethora:chats:members-refresh";
|
|
8363
8372
|
async function c8(e, t, r, o = "member") {
|
|
8364
|
-
const n = `members-changed-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`, i =
|
|
8373
|
+
const n = `members-changed-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`, i = te.xml(
|
|
8365
8374
|
"message",
|
|
8366
8375
|
{ to: t, type: "groupchat", id: n },
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8376
|
+
te.xml("members-refresh", { xmlns: Hm }),
|
|
8377
|
+
te.xml("no-store", "urn:xmpp:hints"),
|
|
8378
|
+
te.xml(
|
|
8370
8379
|
"x",
|
|
8371
8380
|
"http://jabber.org/protocol/muc#user",
|
|
8372
|
-
|
|
8381
|
+
te.xml("item", { affiliation: o, nick: r })
|
|
8373
8382
|
)
|
|
8374
8383
|
);
|
|
8375
8384
|
e.send(i);
|
|
8376
8385
|
}
|
|
8377
8386
|
const l8 = async (e) => {
|
|
8378
|
-
const t =
|
|
8387
|
+
const t = te.xml(
|
|
8379
8388
|
"iq",
|
|
8380
8389
|
{
|
|
8381
8390
|
type: "get",
|
|
8382
8391
|
from: e.jid?.toString(),
|
|
8383
8392
|
id: "getUserRooms"
|
|
8384
8393
|
},
|
|
8385
|
-
|
|
8394
|
+
te.xml("query", { xmlns: "ns:getrooms" })
|
|
8386
8395
|
);
|
|
8387
8396
|
try {
|
|
8388
8397
|
return await e.send(t), null;
|
|
@@ -8953,11 +8962,11 @@ function t2(e, t) {
|
|
|
8953
8962
|
const { toString: k8 } = Object.prototype, { getPrototypeOf: ad } = Object, { iterator: ss, toStringTag: r2 } = Symbol, as = /* @__PURE__ */ ((e) => (t) => {
|
|
8954
8963
|
const r = k8.call(t);
|
|
8955
8964
|
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
|
|
8956
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
8965
|
+
})(/* @__PURE__ */ Object.create(null)), bt = (e) => (e = e.toLowerCase(), (t) => as(t) === e), cs = (e) => (t) => typeof t === e, { isArray: Qr } = Array, Hr = cs("undefined");
|
|
8957
8966
|
function nn(e) {
|
|
8958
8967
|
return e !== null && !Hr(e) && e.constructor !== null && !Hr(e.constructor) && ot(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
8959
8968
|
}
|
|
8960
|
-
const o2 =
|
|
8969
|
+
const o2 = bt("ArrayBuffer");
|
|
8961
8970
|
function R8(e) {
|
|
8962
8971
|
let t;
|
|
8963
8972
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && o2(e.buffer), t;
|
|
@@ -8975,7 +8984,7 @@ const T8 = cs("string"), ot = cs("function"), n2 = cs("number"), sn = (e) => e !
|
|
|
8975
8984
|
} catch {
|
|
8976
8985
|
return !1;
|
|
8977
8986
|
}
|
|
8978
|
-
}, M8 =
|
|
8987
|
+
}, M8 = bt("Date"), I8 = bt("File"), _8 = (e) => !!(e && typeof e.uri < "u"), D8 = (e) => e && typeof e.getParts < "u", N8 = bt("Blob"), O8 = bt("FileList"), L8 = (e) => sn(e) && ot(e.pipe);
|
|
8979
8988
|
function $8() {
|
|
8980
8989
|
return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" || typeof window < "u" ? window : {};
|
|
8981
8990
|
}
|
|
@@ -8983,12 +8992,12 @@ const kf = $8(), Rf = typeof kf.FormData < "u" ? kf.FormData : void 0, F8 = (e)
|
|
|
8983
8992
|
let t;
|
|
8984
8993
|
return e && (Rf && e instanceof Rf || ot(e.append) && ((t = as(e)) === "formdata" || // detect form-data instance
|
|
8985
8994
|
t === "object" && ot(e.toString) && e.toString() === "[object FormData]"));
|
|
8986
|
-
}, j8 =
|
|
8995
|
+
}, j8 = bt("URLSearchParams"), [U8, B8, z8, H8] = [
|
|
8987
8996
|
"ReadableStream",
|
|
8988
8997
|
"Request",
|
|
8989
8998
|
"Response",
|
|
8990
8999
|
"Headers"
|
|
8991
|
-
].map(
|
|
9000
|
+
].map(bt), V8 = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
8992
9001
|
function an(e, t, { allOwnKeys: r = !1 } = {}) {
|
|
8993
9002
|
if (e === null || typeof e > "u")
|
|
8994
9003
|
return;
|
|
@@ -9089,9 +9098,9 @@ const q8 = (e, t, r, { allOwnKeys: o } = {}) => (an(
|
|
|
9089
9098
|
for (; (r = e.exec(t)) !== null; )
|
|
9090
9099
|
o.push(r);
|
|
9091
9100
|
return o;
|
|
9092
|
-
}, e7 =
|
|
9101
|
+
}, e7 = bt("HTMLFormElement"), t7 = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(r, o, n) {
|
|
9093
9102
|
return o.toUpperCase() + n;
|
|
9094
|
-
}), Tf = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), r7 =
|
|
9103
|
+
}), Tf = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), r7 = bt("RegExp"), a2 = (e, t) => {
|
|
9095
9104
|
const r = Object.getOwnPropertyDescriptors(e), o = {};
|
|
9096
9105
|
an(r, (n, i) => {
|
|
9097
9106
|
let s;
|
|
@@ -9143,7 +9152,7 @@ const c7 = (e) => {
|
|
|
9143
9152
|
return o;
|
|
9144
9153
|
};
|
|
9145
9154
|
return r(e, 0);
|
|
9146
|
-
}, l7 =
|
|
9155
|
+
}, l7 = bt("AsyncFunction"), d7 = (e) => e && (sn(e) || ot(e)) && ot(e.then) && ot(e.catch), c2 = ((e, t) => e ? setImmediate : t ? ((r, o) => (or.addEventListener(
|
|
9147
9156
|
"message",
|
|
9148
9157
|
({ source: n, data: i }) => {
|
|
9149
9158
|
n === or && i === r && o.length && o.shift()();
|
|
@@ -9187,7 +9196,7 @@ const c7 = (e) => {
|
|
|
9187
9196
|
inherits: J8,
|
|
9188
9197
|
toFlatObject: X8,
|
|
9189
9198
|
kindOf: as,
|
|
9190
|
-
kindOfTest:
|
|
9199
|
+
kindOfTest: bt,
|
|
9191
9200
|
endsWith: G8,
|
|
9192
9201
|
toArray: K8,
|
|
9193
9202
|
forEachEntry: Y8,
|
|
@@ -11092,7 +11101,7 @@ async function ps(e) {
|
|
|
11092
11101
|
} catch (i) {
|
|
11093
11102
|
if (Pe.isCancel(i))
|
|
11094
11103
|
throw i;
|
|
11095
|
-
return q.log("Error loading rooms"), { items: [] };
|
|
11104
|
+
return q.log("Error loading rooms"), { items: [], failed: !0 };
|
|
11096
11105
|
} finally {
|
|
11097
11106
|
Un = null, Ja = "";
|
|
11098
11107
|
}
|
|
@@ -11763,7 +11772,7 @@ const zi = new Uv(), fi = (e) => e ? String(e).split("@")[0] : "", D2 = (e) => {
|
|
|
11763
11772
|
lastViewedTimestamp: 0,
|
|
11764
11773
|
historyPreloadState: "idle"
|
|
11765
11774
|
};
|
|
11766
|
-
j.dispatch(mm({ roomData: c })), j.getState().rooms.activeRoomJID || j.dispatch(
|
|
11775
|
+
j.dispatch(mm({ roomData: c })), j.getState().rooms.activeRoomJID || j.dispatch(Ue({ roomJID: r }));
|
|
11767
11776
|
}
|
|
11768
11777
|
await t.presenceInRoomStanza(r, 0, 1500, !0).catch(() => !1) || t.prioritizeRoomPresence(r).catch(() => {
|
|
11769
11778
|
}), t.getHistoryStanza(r, 20, void 0, void 0, {
|
|
@@ -11829,7 +11838,7 @@ const zi = new Uv(), fi = (e) => e ? String(e).split("@")[0] : "", D2 = (e) => {
|
|
|
11829
11838
|
);
|
|
11830
11839
|
}
|
|
11831
11840
|
}, r9 = (e, t) => {
|
|
11832
|
-
j.dispatch(
|
|
11841
|
+
j.dispatch(Ue({ roomJID: e.attrs.from })), t.getRoomsStanza();
|
|
11833
11842
|
}, o9 = (e, t) => {
|
|
11834
11843
|
e.attrs.id === "getUserRooms" && Array.isArray(e.getChild("query")?.children) && e.getChild("query")?.children.forEach(async (r) => {
|
|
11835
11844
|
const o = j.getState().rooms.rooms;
|
|
@@ -11849,7 +11858,7 @@ const zi = new Uv(), fi = (e) => e ? String(e).split("@")[0] : "", D2 = (e) => {
|
|
|
11849
11858
|
lastViewedTimestamp: 0,
|
|
11850
11859
|
historyPreloadState: "idle"
|
|
11851
11860
|
};
|
|
11852
|
-
j.dispatch(mm({ roomData: { ...i } })), j.getState().rooms.activeRoomJID || j.dispatch(
|
|
11861
|
+
j.dispatch(mm({ roomData: { ...i } })), j.getState().rooms.activeRoomJID || j.dispatch(Ue({ roomJID: i.jid })), i.jid && t.presencesReady && t.presenceInRoomStanza(i.jid, 0, 5e3, !1);
|
|
11853
11862
|
} catch {
|
|
11854
11863
|
}
|
|
11855
11864
|
});
|
|
@@ -12211,14 +12220,14 @@ const zi = new Uv(), fi = (e) => e ? String(e).split("@")[0] : "", D2 = (e) => {
|
|
|
12211
12220
|
if (!i) return;
|
|
12212
12221
|
const s = o.callId || "", a = o.roomBareName || (o.roomJid || "").split("@")[0] || "";
|
|
12213
12222
|
try {
|
|
12214
|
-
const c =
|
|
12223
|
+
const c = te.xml(
|
|
12215
12224
|
"message",
|
|
12216
12225
|
{
|
|
12217
12226
|
to: n.includes("@") ? n : `${n}@${i}`,
|
|
12218
12227
|
type: "chat",
|
|
12219
12228
|
id: `call-state-${Date.now()}`
|
|
12220
12229
|
},
|
|
12221
|
-
|
|
12230
|
+
te.xml("data", {
|
|
12222
12231
|
type: "call-state",
|
|
12223
12232
|
state: e,
|
|
12224
12233
|
callId: s,
|
|
@@ -12236,14 +12245,14 @@ const zi = new Uv(), fi = (e) => e ? String(e).split("@")[0] : "", D2 = (e) => {
|
|
|
12236
12245
|
const n = r.host || "";
|
|
12237
12246
|
if (n)
|
|
12238
12247
|
try {
|
|
12239
|
-
const i =
|
|
12248
|
+
const i = te.xml(
|
|
12240
12249
|
"message",
|
|
12241
12250
|
{
|
|
12242
12251
|
to: o.includes("@") ? o : `${o}@${n}`,
|
|
12243
12252
|
type: "chat",
|
|
12244
12253
|
id: `call-invite-${Date.now()}`
|
|
12245
12254
|
},
|
|
12246
|
-
|
|
12255
|
+
te.xml("data", {
|
|
12247
12256
|
type: "call-invite",
|
|
12248
12257
|
kind: e,
|
|
12249
12258
|
room: t.roomBareName || "",
|
|
@@ -12280,18 +12289,18 @@ function T9(e, t) {
|
|
|
12280
12289
|
}
|
|
12281
12290
|
}
|
|
12282
12291
|
function P9(e, t) {
|
|
12283
|
-
const r =
|
|
12292
|
+
const r = te.xml(
|
|
12284
12293
|
"iq",
|
|
12285
12294
|
{
|
|
12286
12295
|
type: "set",
|
|
12287
12296
|
id: "setVcard"
|
|
12288
12297
|
},
|
|
12289
|
-
|
|
12298
|
+
te.xml(
|
|
12290
12299
|
"vCard",
|
|
12291
12300
|
{
|
|
12292
12301
|
xmlns: "vcard-temp"
|
|
12293
12302
|
},
|
|
12294
|
-
|
|
12303
|
+
te.xml("FN", null, e)
|
|
12295
12304
|
)
|
|
12296
12305
|
);
|
|
12297
12306
|
t.send(r);
|
|
@@ -12310,7 +12319,7 @@ function M9(e, t, r, o, n, i) {
|
|
|
12310
12319
|
const s = `message-reaction:${Date.now().toString()}`, a = {
|
|
12311
12320
|
senderFirstName: n.firstName,
|
|
12312
12321
|
senderLastName: n.lastName
|
|
12313
|
-
}, c =
|
|
12322
|
+
}, c = te.xml(
|
|
12314
12323
|
"message",
|
|
12315
12324
|
{
|
|
12316
12325
|
id: s,
|
|
@@ -12318,40 +12327,40 @@ function M9(e, t, r, o, n, i) {
|
|
|
12318
12327
|
from: e.jid?.toString(),
|
|
12319
12328
|
to: r
|
|
12320
12329
|
},
|
|
12321
|
-
|
|
12330
|
+
te.xml(
|
|
12322
12331
|
"reactions",
|
|
12323
12332
|
{
|
|
12324
12333
|
id: t,
|
|
12325
12334
|
from: e.jid?.toString(),
|
|
12326
12335
|
xmlns: "urn:xmpp:reactions:0"
|
|
12327
12336
|
},
|
|
12328
|
-
...o.map((l) =>
|
|
12337
|
+
...o.map((l) => te.xml("reaction", {}, l ?? ""))
|
|
12329
12338
|
// xml('reaction', {}, reactionSymbol ?? '👋'),
|
|
12330
12339
|
),
|
|
12331
|
-
|
|
12332
|
-
|
|
12340
|
+
te.xml("data", a),
|
|
12341
|
+
te.xml("store", { xmlns: "urn:xmpp:hints" })
|
|
12333
12342
|
);
|
|
12334
12343
|
e.send(c);
|
|
12335
12344
|
}
|
|
12336
12345
|
const I9 = (e, t, r, o) => {
|
|
12337
12346
|
const n = o || `get-translate-messsage:${Date.now().toString()}`;
|
|
12338
12347
|
try {
|
|
12339
|
-
const { mentions: i, ...s } = t, a =
|
|
12348
|
+
const { mentions: i, ...s } = t, a = te.xml(
|
|
12340
12349
|
"message",
|
|
12341
12350
|
{
|
|
12342
12351
|
to: t.roomJID,
|
|
12343
12352
|
type: "groupchat",
|
|
12344
12353
|
id: n
|
|
12345
12354
|
},
|
|
12346
|
-
|
|
12355
|
+
te.xml("data", {
|
|
12347
12356
|
...s,
|
|
12348
12357
|
// Same side-channel encoding as sendTextMessage.xmpp.ts: a JSON
|
|
12349
12358
|
// array of {jid, name, offset, length} spans into `userMessage`.
|
|
12350
12359
|
...i && i.length > 0 ? { mentions: JSON.stringify(i) } : {},
|
|
12351
12360
|
push: "true"
|
|
12352
12361
|
}),
|
|
12353
|
-
|
|
12354
|
-
|
|
12362
|
+
te.xml("body", {}, t.userMessage),
|
|
12363
|
+
te.xml("translate", { source: r })
|
|
12355
12364
|
);
|
|
12356
12365
|
return e.send(a), !0;
|
|
12357
12366
|
} catch (i) {
|
|
@@ -12367,13 +12376,13 @@ const I9 = (e, t, r, o) => {
|
|
|
12367
12376
|
o = (m) => {
|
|
12368
12377
|
m.is("iq") && m.attrs.id === "getUserRoomsPaged" && (a = !0, c?.(), n(), i(m));
|
|
12369
12378
|
}, e.on("stanza", o);
|
|
12370
|
-
const l =
|
|
12379
|
+
const l = te.xml("query", { xmlns: "ns:getrooms" }), d = te.xml(
|
|
12371
12380
|
"set",
|
|
12372
12381
|
{ xmlns: "http://jabber.org/protocol/rsm" },
|
|
12373
|
-
|
|
12382
|
+
te.xml("max", {}, t.toString())
|
|
12374
12383
|
);
|
|
12375
|
-
r && d.append(
|
|
12376
|
-
const u =
|
|
12384
|
+
r && d.append(te.xml("before", {}, r)), l.append(d);
|
|
12385
|
+
const u = te.xml(
|
|
12377
12386
|
"iq",
|
|
12378
12387
|
{ type: "get", from: e.jid?.toString(), id: "getUserRoomsPaged" },
|
|
12379
12388
|
l
|
|
@@ -12457,10 +12466,10 @@ async function O9(e, t) {
|
|
|
12457
12466
|
function Qa(e, t, r) {
|
|
12458
12467
|
if (e.status !== "online" || e._status === "closing" || e._status === "closed")
|
|
12459
12468
|
return null;
|
|
12460
|
-
const o = "ping-" + Date.now() + "-" + Math.floor(Math.random() * 1e4), n =
|
|
12469
|
+
const o = "ping-" + Date.now() + "-" + Math.floor(Math.random() * 1e4), n = te.xml(
|
|
12461
12470
|
"iq",
|
|
12462
12471
|
{ type: "get", to: t, id: o },
|
|
12463
|
-
|
|
12472
|
+
te.xml("ping", "urn:xmpp:ping")
|
|
12464
12473
|
);
|
|
12465
12474
|
return e.send(n), o;
|
|
12466
12475
|
}
|
|
@@ -12818,7 +12827,7 @@ class U9 {
|
|
|
12818
12827
|
this.resource = t.resource || "default", q.log("Client is online.", /* @__PURE__ */ new Date()), this.status = "online", this.authFailureDetected = !1, this.authRecoveryAttempts = 0, this.reconnectAttempts = 0, this.offlineReconnectAttempts = 0, this.pausedDueToOfflineCap = !1, this.reconnectTimer && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
|
|
12819
12828
|
try {
|
|
12820
12829
|
const o = Date.now();
|
|
12821
|
-
q.log("[XMPP] online: sendPresence:start"), this.client.send(
|
|
12830
|
+
q.log("[XMPP] online: sendPresence:start"), this.client.send(te.xml("presence")), q.log("[XMPP] online: sendPresence:done"), q.log(
|
|
12822
12831
|
`[InitTiming] online:send_presence ${Date.now() - o}ms`
|
|
12823
12832
|
);
|
|
12824
12833
|
} catch (o) {
|
|
@@ -13353,21 +13362,21 @@ class U9 {
|
|
|
13353
13362
|
timeout: c,
|
|
13354
13363
|
resolve: a
|
|
13355
13364
|
});
|
|
13356
|
-
const l =
|
|
13365
|
+
const l = te.xml(
|
|
13357
13366
|
"iq",
|
|
13358
13367
|
{
|
|
13359
13368
|
type: "set",
|
|
13360
13369
|
to: s,
|
|
13361
13370
|
id: n
|
|
13362
13371
|
},
|
|
13363
|
-
|
|
13372
|
+
te.xml(
|
|
13364
13373
|
"query",
|
|
13365
13374
|
{ xmlns: "urn:xmpp:mam:2", queryid: n },
|
|
13366
|
-
|
|
13375
|
+
te.xml(
|
|
13367
13376
|
"set",
|
|
13368
13377
|
{ xmlns: "http://jabber.org/protocol/rsm" },
|
|
13369
|
-
|
|
13370
|
-
o ?
|
|
13378
|
+
te.xml("max", {}, r.toString()),
|
|
13379
|
+
o ? te.xml("before", {}, o.toString()) : te.xml("before")
|
|
13371
13380
|
)
|
|
13372
13381
|
)
|
|
13373
13382
|
);
|
|
@@ -13991,16 +14000,16 @@ const md = {
|
|
|
13991
14000
|
storageBucket: "ethora-668e9.appspot.com",
|
|
13992
14001
|
messagingSenderId: "972933470054",
|
|
13993
14002
|
appId: "1:972933470054:web:d4682e76ef02fd9b9cdaa7"
|
|
13994
|
-
}, Za = /* @__PURE__ */ new Map(), Xf = /* @__PURE__ */ new Map(),
|
|
14003
|
+
}, Za = /* @__PURE__ */ new Map(), Xf = /* @__PURE__ */ new Map(), St = (e) => (e || "").toString().trim().toLowerCase(), B9 = (e) => Gr.sha256(
|
|
13995
14004
|
[
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14001
|
-
|
|
14005
|
+
St(e?.appId),
|
|
14006
|
+
St(e?.projectId),
|
|
14007
|
+
St(e?.messagingSenderId),
|
|
14008
|
+
St(e?.apiKey),
|
|
14009
|
+
St(e?.authDomain),
|
|
14010
|
+
St(e?.storageBucket)
|
|
14002
14011
|
].join("|")
|
|
14003
|
-
).slice(0, 16), z9 = (e) => `ethora-firebase-${B9(e)}`, H9 = (e) => e || md, V9 = (e) => e ?
|
|
14012
|
+
).slice(0, 16), z9 = (e) => `ethora-firebase-${B9(e)}`, H9 = (e) => e || md, V9 = (e) => e ? St(e.apiKey) !== "" && St(e.appId) !== "" && St(e.projectId) !== "" && St(e.messagingSenderId) !== "" : !1, L2 = async (e) => {
|
|
14004
14013
|
try {
|
|
14005
14014
|
const t = H9(e);
|
|
14006
14015
|
if (!V9(t))
|
|
@@ -14230,17 +14239,17 @@ async function eb(e, t, r) {
|
|
|
14230
14239
|
}
|
|
14231
14240
|
}
|
|
14232
14241
|
}, e.on("stanza", n);
|
|
14233
|
-
const u = e.jid?.getLocal() || "", f =
|
|
14242
|
+
const u = e.jid?.getLocal() || "", f = te.xml(
|
|
14234
14243
|
"iq",
|
|
14235
14244
|
{
|
|
14236
14245
|
to: t,
|
|
14237
14246
|
type: "set",
|
|
14238
14247
|
id: o
|
|
14239
14248
|
},
|
|
14240
|
-
|
|
14249
|
+
te.xml(
|
|
14241
14250
|
"subscribe",
|
|
14242
14251
|
{ xmlns: "urn:xmpp:mucsub:0", nick: u },
|
|
14243
|
-
|
|
14252
|
+
te.xml("event", { node: "urn:xmpp:mucsub:nodes:messages" })
|
|
14244
14253
|
)
|
|
14245
14254
|
);
|
|
14246
14255
|
try {
|
|
@@ -14351,7 +14360,7 @@ const rb = new tb(), ob = 4, nb = async (e, t, r = ob) => {
|
|
|
14351
14360
|
callerName: ft(t, ["callerName", "callerDisplayName", "senderName", "title"]) || null,
|
|
14352
14361
|
callerXmppUsername: ft(t, ["callerXmppUsername", "callerUsername", "userJid", "senderJid"]).split("@")[0] || null
|
|
14353
14362
|
};
|
|
14354
|
-
}, ms = "ethora-chat-root",
|
|
14363
|
+
}, ms = "ethora-chat-root", Et = "ethora-message-highlight", sb = "ethora-message-notification-container", ab = "ethora-apple-emoji", cb = {};
|
|
14355
14364
|
let go = !1, Cr = null, yo = /* @__PURE__ */ new Set(), vo = null;
|
|
14356
14365
|
const $2 = (e = {}) => {
|
|
14357
14366
|
const { softAsk: t = !1, enabled: r = !1 } = e, o = e.vapidPublicKey || typeof import.meta < "u" && cb?.VITE_VAPID_PUBLIC_KEY || "", n = ae((k) => k.chatSettingStore.user.token), i = ae(
|
|
@@ -14366,7 +14375,7 @@ const $2 = (e = {}) => {
|
|
|
14366
14375
|
const _ = document.querySelector(
|
|
14367
14376
|
`[data-message-id="${k}"]`
|
|
14368
14377
|
);
|
|
14369
|
-
_ && (_.scrollIntoView({ behavior: "smooth", block: "center" }), _.classList.add(
|
|
14378
|
+
_ && (_.scrollIntoView({ behavior: "smooth", block: "center" }), _.classList.add(Et), setTimeout(() => _.classList.remove(Et), 2e3));
|
|
14370
14379
|
}, []), M = G(
|
|
14371
14380
|
(k, _) => {
|
|
14372
14381
|
if (!k) return;
|
|
@@ -14405,7 +14414,7 @@ const $2 = (e = {}) => {
|
|
|
14405
14414
|
);
|
|
14406
14415
|
return;
|
|
14407
14416
|
}
|
|
14408
|
-
N && l(
|
|
14417
|
+
N && l(Ue({ roomJID: N })), q.log(
|
|
14409
14418
|
"[PushNotifications] incoming call push without LiveKit token; awaiting XMPP call-token",
|
|
14410
14419
|
{ callId: _.callId, roomJid: N }
|
|
14411
14420
|
);
|
|
@@ -14442,7 +14451,7 @@ const $2 = (e = {}) => {
|
|
|
14442
14451
|
}
|
|
14443
14452
|
return;
|
|
14444
14453
|
}
|
|
14445
|
-
B && (l(
|
|
14454
|
+
B && (l(Ue({ roomJID: B })), M(B, J ? String(J) : void 0));
|
|
14446
14455
|
},
|
|
14447
14456
|
[a?.pushNotifications?.onClick, l, M, x, e.onClick, I]
|
|
14448
14457
|
), E = G(async () => {
|
|
@@ -14498,7 +14507,7 @@ const $2 = (e = {}) => {
|
|
|
14498
14507
|
i,
|
|
14499
14508
|
o
|
|
14500
14509
|
]);
|
|
14501
|
-
return
|
|
14510
|
+
return Z(() => {
|
|
14502
14511
|
if (!r || typeof window > "u") return;
|
|
14503
14512
|
const k = (_) => {
|
|
14504
14513
|
const N = _.data ?? {};
|
|
@@ -14506,14 +14515,14 @@ const $2 = (e = {}) => {
|
|
|
14506
14515
|
I(N);
|
|
14507
14516
|
return;
|
|
14508
14517
|
}
|
|
14509
|
-
const F = _.notification?.title || N.title || "New message", B = _.notification?.body || N.body || "You have a new message.", J = x(N.jid || ""), z = N.userJid || "", ie = _.messageId || N.msgID || String(Date.now()), L = D2(_), $ = document.visibilityState === "visible", U = Date.now(), D = _.messageId || N.msgID || `${J}|${z}|${F}|${B}`, H = m.current.get(D),
|
|
14518
|
+
const F = _.notification?.title || N.title || "New message", B = _.notification?.body || N.body || "You have a new message.", J = x(N.jid || ""), z = N.userJid || "", ie = _.messageId || N.msgID || String(Date.now()), L = D2(_), $ = document.visibilityState === "visible", U = Date.now(), D = _.messageId || N.msgID || `${J}|${z}|${F}|${B}`, H = m.current.get(D), ee = _.messageId || N.msgID, re = Wv(s, ee), oe = !!(H && U - H < 3e4), Q = window._ethoraAppLoadTime || Date.now(), ce = Date.now() - Q < 2e3, Y = L ? !1 : !!_.isHistory, ue = qv({
|
|
14510
14519
|
config: a,
|
|
14511
14520
|
tabVisible: $,
|
|
14512
|
-
alreadyInStore:
|
|
14513
|
-
deduped:
|
|
14521
|
+
alreadyInStore: re,
|
|
14522
|
+
deduped: oe,
|
|
14514
14523
|
isSystem: L,
|
|
14515
|
-
isHistory:
|
|
14516
|
-
isCatchup:
|
|
14524
|
+
isHistory: Y,
|
|
14525
|
+
isCatchup: ce
|
|
14517
14526
|
}), se = L && a?.inAppNotifications?.enabled === !0 && $, pe = {
|
|
14518
14527
|
id: ie,
|
|
14519
14528
|
user: {
|
|
@@ -14525,12 +14534,12 @@ const $2 = (e = {}) => {
|
|
|
14525
14534
|
body: B,
|
|
14526
14535
|
roomJid: J
|
|
14527
14536
|
}, ve = L ? "System" : J || F, Ie = L ? "System" : z || "Ethora";
|
|
14528
|
-
if ((se ||
|
|
14537
|
+
if ((se || ue.show) && zi.showNotification(
|
|
14529
14538
|
pe,
|
|
14530
14539
|
ve,
|
|
14531
14540
|
Ie,
|
|
14532
14541
|
J
|
|
14533
|
-
), m.current.set(D, U), J && !
|
|
14542
|
+
), m.current.set(D, U), J && !re && M(J, ee), a?.useStoreConsoleEnabled) {
|
|
14534
14543
|
const ze = N2({ config: a, tabVisible: $ });
|
|
14535
14544
|
q.log(`[NotifyPolicy] source=push action=check_os_delegated show=${ze.show} reason=${ze.reason} msgId=${ie}`);
|
|
14536
14545
|
}
|
|
@@ -14540,7 +14549,7 @@ const $2 = (e = {}) => {
|
|
|
14540
14549
|
}, e.firebaseConfig || a?.pushNotifications?.firebaseConfig)), yo.add(k), () => {
|
|
14541
14550
|
yo.delete(k), yo.size === 0 && vo && (vo(), vo = null);
|
|
14542
14551
|
};
|
|
14543
|
-
}, [a, r, s, x, M, I]),
|
|
14552
|
+
}, [a, r, s, x, M, I]), Z(() => {
|
|
14544
14553
|
if (!r || typeof window > "u" || !("serviceWorker" in navigator)) return;
|
|
14545
14554
|
const k = (_) => {
|
|
14546
14555
|
const N = _?.data;
|
|
@@ -14563,7 +14572,7 @@ const $2 = (e = {}) => {
|
|
|
14563
14572
|
return navigator.serviceWorker.addEventListener("message", k), () => {
|
|
14564
14573
|
navigator.serviceWorker.removeEventListener("message", k);
|
|
14565
14574
|
};
|
|
14566
|
-
}, [r, T]),
|
|
14575
|
+
}, [r, T]), Z(() => {
|
|
14567
14576
|
if (!r || typeof window > "u") return;
|
|
14568
14577
|
const k = new URL(window.location.href);
|
|
14569
14578
|
if (k.searchParams.get("fromPush") !== "1") return;
|
|
@@ -14584,11 +14593,11 @@ const $2 = (e = {}) => {
|
|
|
14584
14593
|
k.searchParams.delete("fromPush"), window.history.replaceState({}, document.title, k.toString());
|
|
14585
14594
|
} catch {
|
|
14586
14595
|
}
|
|
14587
|
-
}, [r, T]),
|
|
14596
|
+
}, [r, T]), Z(() => {
|
|
14588
14597
|
(!n || b.current !== i) && (d.current = !1, u.current = null, p(null), el(""), y.current = "", g.current = !1, go = !1, Cr = null), b.current = i || "";
|
|
14589
|
-
}, [n, i]),
|
|
14598
|
+
}, [n, i]), Z(() => {
|
|
14590
14599
|
n && (t || d.current || (d.current = !0, E()));
|
|
14591
|
-
}, [n, t, E]),
|
|
14600
|
+
}, [n, t, E]), Z(() => {
|
|
14592
14601
|
if (!r || !n || t || typeof window > "u" || typeof Notification > "u") return;
|
|
14593
14602
|
const k = () => {
|
|
14594
14603
|
go || Notification.permission === "granted" && E();
|
|
@@ -14596,7 +14605,7 @@ const $2 = (e = {}) => {
|
|
|
14596
14605
|
return window.addEventListener("focus", k), document.addEventListener("visibilitychange", k), () => {
|
|
14597
14606
|
window.removeEventListener("focus", k), document.removeEventListener("visibilitychange", k);
|
|
14598
14607
|
};
|
|
14599
|
-
}, [r, t, n, E]),
|
|
14608
|
+
}, [r, t, n, E]), Z(() => {
|
|
14600
14609
|
if (!r || !f) return;
|
|
14601
14610
|
const k = Object.keys(s || {}).filter(fn).sort(), _ = k.map((B) => `${B}:${c[B] || "idle"}`).join(",");
|
|
14602
14611
|
if (_ === y.current)
|
|
@@ -15242,7 +15251,7 @@ function qe(e, t) {
|
|
|
15242
15251
|
function Vr(e, t, r) {
|
|
15243
15252
|
return e.slice(t, r);
|
|
15244
15253
|
}
|
|
15245
|
-
function
|
|
15254
|
+
function Ct(e) {
|
|
15246
15255
|
return e.length;
|
|
15247
15256
|
}
|
|
15248
15257
|
function G2(e) {
|
|
@@ -15328,7 +15337,7 @@ function nl(e) {
|
|
|
15328
15337
|
return 0;
|
|
15329
15338
|
}
|
|
15330
15339
|
function zb(e) {
|
|
15331
|
-
return vs = qr = 1, K2 =
|
|
15340
|
+
return vs = qr = 1, K2 = Ct(Yr = e), ht = 0, [];
|
|
15332
15341
|
}
|
|
15333
15342
|
function Hb(e) {
|
|
15334
15343
|
return Yr = "", e;
|
|
@@ -15421,7 +15430,7 @@ function yi(e, t, r, o, n, i, s, a, c) {
|
|
|
15421
15430
|
break;
|
|
15422
15431
|
// {
|
|
15423
15432
|
case 123 * y:
|
|
15424
|
-
a[l++] =
|
|
15433
|
+
a[l++] = Ct(R) * w;
|
|
15425
15434
|
// } ; \0
|
|
15426
15435
|
case 125 * y:
|
|
15427
15436
|
case 59:
|
|
@@ -15433,7 +15442,7 @@ function yi(e, t, r, o, n, i, s, a, c) {
|
|
|
15433
15442
|
v = 0;
|
|
15434
15443
|
// ;
|
|
15435
15444
|
case 59 + d:
|
|
15436
|
-
w == -1 && (R = ye(R, /\f/g, "")), p > 0 &&
|
|
15445
|
+
w == -1 && (R = ye(R, /\f/g, "")), p > 0 && Ct(R) - u && _o(p > 32 ? sh(R + ";", o, r, u - 1, c) : sh(ye(R, " ", "") + ";", o, r, u - 2, c), c);
|
|
15437
15446
|
break;
|
|
15438
15447
|
// @ ;
|
|
15439
15448
|
case 59:
|
|
@@ -15460,7 +15469,7 @@ function yi(e, t, r, o, n, i, s, a, c) {
|
|
|
15460
15469
|
break;
|
|
15461
15470
|
// :
|
|
15462
15471
|
case 58:
|
|
15463
|
-
u = 1 +
|
|
15472
|
+
u = 1 + Ct(R), p = m;
|
|
15464
15473
|
default:
|
|
15465
15474
|
if (y < 1) {
|
|
15466
15475
|
if (S == 123)
|
|
@@ -15475,15 +15484,15 @@ function yi(e, t, r, o, n, i, s, a, c) {
|
|
|
15475
15484
|
break;
|
|
15476
15485
|
// ,
|
|
15477
15486
|
case 44:
|
|
15478
|
-
a[l++] = (
|
|
15487
|
+
a[l++] = (Ct(R) - 1) * w, w = 1;
|
|
15479
15488
|
break;
|
|
15480
15489
|
// @
|
|
15481
15490
|
case 64:
|
|
15482
|
-
cr() === 45 && (R += tc(yt())), f = cr(), d = u =
|
|
15491
|
+
cr() === 45 && (R += tc(yt())), f = cr(), d = u = Ct(g = R += Jb(gi())), S++;
|
|
15483
15492
|
break;
|
|
15484
15493
|
// -
|
|
15485
15494
|
case 45:
|
|
15486
|
-
m === 45 &&
|
|
15495
|
+
m === 45 && Ct(R) == 2 && (y = 0);
|
|
15487
15496
|
}
|
|
15488
15497
|
}
|
|
15489
15498
|
return i;
|
|
@@ -15636,7 +15645,7 @@ function Q2(e, t, r) {
|
|
|
15636
15645
|
case 5789:
|
|
15637
15646
|
case 5021:
|
|
15638
15647
|
case 4765:
|
|
15639
|
-
if (
|
|
15648
|
+
if (Ct(e) - 1 - t > 6)
|
|
15640
15649
|
switch (qe(e, t + 1)) {
|
|
15641
15650
|
// (m)ax-content, (m)in-content
|
|
15642
15651
|
case 109:
|
|
@@ -15699,9 +15708,9 @@ function Kb(e, t, r, o) {
|
|
|
15699
15708
|
case W2:
|
|
15700
15709
|
return e.return = e.value + "{" + Hi(e.children, o) + "}";
|
|
15701
15710
|
case ys:
|
|
15702
|
-
if (!
|
|
15711
|
+
if (!Ct(e.value = e.props.join(","))) return "";
|
|
15703
15712
|
}
|
|
15704
|
-
return
|
|
15713
|
+
return Ct(r = Hi(e.children, o)) ? e.return = e.value + "{" + r + "}" : "";
|
|
15705
15714
|
}
|
|
15706
15715
|
function Qb(e) {
|
|
15707
15716
|
var t = G2(e);
|
|
@@ -16259,17 +16268,17 @@ function $w(e, t, r) {
|
|
|
16259
16268
|
return (function(x, R, M) {
|
|
16260
16269
|
var I = x.attrs, T = x.componentStyle, E = x.defaultProps, P = x.foldedComponentIds, k = x.styledComponentId, _ = x.target, N = Te.useContext(p0), F = mh(), B = x.shouldForwardProp || F.shouldForwardProp;
|
|
16261
16270
|
process.env.NODE_ENV !== "production" && Zd(k);
|
|
16262
|
-
var J = ow(R, N, E) || Wr, z = (function(H,
|
|
16263
|
-
for (var
|
|
16264
|
-
var
|
|
16265
|
-
for (var
|
|
16271
|
+
var J = ow(R, N, E) || Wr, z = (function(H, ee, re) {
|
|
16272
|
+
for (var oe, Q = tt(tt({}, ee), { className: void 0, theme: re }), ce = 0; ce < H.length; ce += 1) {
|
|
16273
|
+
var Y = Jr(oe = H[ce]) ? oe(Q) : oe;
|
|
16274
|
+
for (var ue in Y) Q[ue] = ue === "className" ? nr(Q[ue], Y[ue]) : ue === "style" ? tt(tt({}, Q[ue]), Y[ue]) : Y[ue];
|
|
16266
16275
|
}
|
|
16267
|
-
return
|
|
16276
|
+
return ee.className && (Q.className = nr(Q.className, ee.className)), Q;
|
|
16268
16277
|
})(I, R, J), ie = z.as || _, L = {};
|
|
16269
16278
|
for (var $ in z) z[$] === void 0 || $[0] === "$" || $ === "as" || $ === "theme" && z.theme === J || ($ === "forwardedAs" ? L.as = z.forwardedAs : B && !B($, ie) || (L[$] = z[$], B || process.env.NODE_ENV !== "development" || Ob($) || yh.has($) || !sl.has(ie) || (yh.add($), console.warn('styled-components: it looks like an unknown prop "'.concat($, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
|
|
16270
|
-
var U = (function(H,
|
|
16271
|
-
var
|
|
16272
|
-
return process.env.NODE_ENV !== "production" && Zd(
|
|
16279
|
+
var U = (function(H, ee) {
|
|
16280
|
+
var re = mh(), oe = H.generateAndInjectStyles(ee, re.styleSheet, re.stylis);
|
|
16281
|
+
return process.env.NODE_ENV !== "production" && Zd(oe), oe;
|
|
16273
16282
|
})(T, z);
|
|
16274
16283
|
process.env.NODE_ENV !== "production" && x.warnTooManyClasses && x.warnTooManyClasses(U);
|
|
16275
16284
|
var D = nr(P, k);
|
|
@@ -16590,7 +16599,7 @@ const Fw = 10, jw = /<bot-data\b[^>]*\btype\s*=\s*["']?buttons["']?[^>]*>([\s\S]
|
|
|
16590
16599
|
] });
|
|
16591
16600
|
}, y0 = () => {
|
|
16592
16601
|
const [e, t] = K(() => typeof document > "u" ? !1 : !document.hidden);
|
|
16593
|
-
return
|
|
16602
|
+
return Z(() => {
|
|
16594
16603
|
if (typeof document > "u")
|
|
16595
16604
|
return;
|
|
16596
16605
|
const r = () => {
|
|
@@ -16645,20 +16654,20 @@ const ax = Qo(void 0), cx = 3, lx = 3e4, dx = ({ children: e, config: t }) => {
|
|
|
16645
16654
|
(B) => B.filter((J) => F - J.timestamp < y)
|
|
16646
16655
|
);
|
|
16647
16656
|
}, [y]);
|
|
16648
|
-
|
|
16657
|
+
Z(() => {
|
|
16649
16658
|
const F = setInterval(() => {
|
|
16650
16659
|
n && I();
|
|
16651
16660
|
}, 1e3);
|
|
16652
16661
|
return () => clearInterval(F);
|
|
16653
|
-
}, [n, I]),
|
|
16662
|
+
}, [n, I]), Z(() => {
|
|
16654
16663
|
n && I();
|
|
16655
16664
|
}, [n, I]);
|
|
16656
16665
|
const T = G((F) => {
|
|
16657
16666
|
F && o((B) => B.filter((J) => J.roomJID !== F));
|
|
16658
16667
|
}, []);
|
|
16659
|
-
|
|
16668
|
+
Z(() => {
|
|
16660
16669
|
s && T(s);
|
|
16661
|
-
}, [s, T]),
|
|
16670
|
+
}, [s, T]), Z(() => {
|
|
16662
16671
|
p && typeof window < "u" && "Notification" in window && Notification.permission === "default" && Notification.requestPermission();
|
|
16663
16672
|
}, [p]);
|
|
16664
16673
|
const E = G(() => {
|
|
@@ -16679,9 +16688,9 @@ const ax = Qo(void 0), cx = 3, lx = 3e4, dx = ({ children: e, config: t }) => {
|
|
|
16679
16688
|
});
|
|
16680
16689
|
return;
|
|
16681
16690
|
}
|
|
16682
|
-
F && (i(
|
|
16691
|
+
F && (i(Ue({ roomJID: F })), setTimeout(() => {
|
|
16683
16692
|
const $ = document.querySelector(`[data-message-id="${B}"]`);
|
|
16684
|
-
$ && ($.scrollIntoView({ behavior: "smooth", block: "center" }), $.classList.add(
|
|
16693
|
+
$ && ($.scrollIntoView({ behavior: "smooth", block: "center" }), $.classList.add(Et), setTimeout(() => $.classList.remove(Et), 2e3));
|
|
16685
16694
|
}, 100));
|
|
16686
16695
|
},
|
|
16687
16696
|
[T, i, f]
|
|
@@ -16696,11 +16705,11 @@ const ax = Qo(void 0), cx = 3, lx = 3e4, dx = ({ children: e, config: t }) => {
|
|
|
16696
16705
|
timestamp: Date.now()
|
|
16697
16706
|
};
|
|
16698
16707
|
o((U) => {
|
|
16699
|
-
const D = Date.now(), H = U.filter((
|
|
16700
|
-
if (ie !== `${z}:` && H.some((
|
|
16708
|
+
const D = Date.now(), H = U.filter((re) => D - re.timestamp < y);
|
|
16709
|
+
if (ie !== `${z}:` && H.some((oe) => `${oe.roomJID}:${String(oe.message?.xmppId || oe.message?.id || "").trim()}` === ie))
|
|
16701
16710
|
return H;
|
|
16702
|
-
const
|
|
16703
|
-
return
|
|
16711
|
+
const ee = [...H, $];
|
|
16712
|
+
return ee.length > m ? ee.slice(-m) : ee;
|
|
16704
16713
|
});
|
|
16705
16714
|
},
|
|
16706
16715
|
[m, y]
|
|
@@ -16733,7 +16742,7 @@ const ax = Qo(void 0), cx = 3, lx = 3e4, dx = ({ children: e, config: t }) => {
|
|
|
16733
16742
|
},
|
|
16734
16743
|
[u, p, n, a, d, k, P]
|
|
16735
16744
|
);
|
|
16736
|
-
|
|
16745
|
+
Z(() => {
|
|
16737
16746
|
if (!p || !d) return;
|
|
16738
16747
|
const F = zi.addCallback(
|
|
16739
16748
|
_
|
|
@@ -18536,7 +18545,7 @@ class v0 extends Te.Component {
|
|
|
18536
18545
|
}
|
|
18537
18546
|
}
|
|
18538
18547
|
const Ix = Te.lazy(
|
|
18539
|
-
() => import("./VideoCallOverlay-
|
|
18548
|
+
() => import("./VideoCallOverlay-BXHNEhdX.js").then((e) => ({
|
|
18540
18549
|
default: e.VideoCallOverlay
|
|
18541
18550
|
}))
|
|
18542
18551
|
), b0 = Qo(null), _x = ({ pushNotifications: e }) => ($2({
|
|
@@ -18656,10 +18665,10 @@ const Ix = Te.lazy(
|
|
|
18656
18665
|
console.error("Reconnection failed:", R);
|
|
18657
18666
|
})));
|
|
18658
18667
|
};
|
|
18659
|
-
return
|
|
18660
|
-
}), [o?.status, u]),
|
|
18668
|
+
return Z(() => (o && (o.status === "offline" || o.status === "error") && u < 3 && x(), () => {
|
|
18669
|
+
}), [o?.status, u]), Z(() => {
|
|
18661
18670
|
j.dispatch(ql(t));
|
|
18662
|
-
}, [t]),
|
|
18671
|
+
}, [t]), Z(() => {
|
|
18663
18672
|
if (!t?.initBeforeLoad) {
|
|
18664
18673
|
s("idle");
|
|
18665
18674
|
return;
|
|
@@ -18758,9 +18767,9 @@ const Ix = Te.lazy(
|
|
|
18758
18767
|
t?.baseUrl,
|
|
18759
18768
|
t?.customAppToken,
|
|
18760
18769
|
t?.appId
|
|
18761
|
-
]),
|
|
18770
|
+
]), Z(() => {
|
|
18762
18771
|
t?.initBeforeLoad && o && (o.status === "online" || o.status === "connecting") && s("ready");
|
|
18763
|
-
}, [o, o?.status, t?.initBeforeLoad]),
|
|
18772
|
+
}, [o, o?.status, t?.initBeforeLoad]), Z(() => {
|
|
18764
18773
|
if (typeof window > "u")
|
|
18765
18774
|
return;
|
|
18766
18775
|
const R = () => {
|
|
@@ -19342,7 +19351,7 @@ const eS = A.div`
|
|
|
19342
19351
|
`, uS = Be`
|
|
19343
19352
|
0% { transform: rotate(0deg); }
|
|
19344
19353
|
100% { transform: rotate(360deg); }
|
|
19345
|
-
`,
|
|
19354
|
+
`, vt = A.div`
|
|
19346
19355
|
border: ${({ size: e }) => e ? e / 4 : 4}px solid #f3f3f3;
|
|
19347
19356
|
border-top: ${({ size: e }) => e ? e / 4 : 4}px solid
|
|
19348
19357
|
${({ color: e }) => e || "#3498db"};
|
|
@@ -20775,7 +20784,7 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
20775
20784
|
return e.__ethoraLoaderStats || (e.__ethoraLoaderStats = {}), e.__ethoraLoaderStats;
|
|
20776
20785
|
}, _t = (e, t) => {
|
|
20777
20786
|
const r = X(!1);
|
|
20778
|
-
|
|
20787
|
+
Z(() => {
|
|
20779
20788
|
const o = kh();
|
|
20780
20789
|
o[e] || (o[e] = {
|
|
20781
20790
|
count: 0,
|
|
@@ -20788,7 +20797,7 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
20788
20797
|
n.totalVisibleMs += i, n.activeSince = null;
|
|
20789
20798
|
}
|
|
20790
20799
|
r.current = t;
|
|
20791
|
-
}, [e, t]),
|
|
20800
|
+
}, [e, t]), Z(() => () => {
|
|
20792
20801
|
if (!r.current) return;
|
|
20793
20802
|
const n = kh()[e];
|
|
20794
20803
|
if (!n) return;
|
|
@@ -20808,15 +20817,15 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
20808
20817
|
_t("chat-room-load-more-loader", n);
|
|
20809
20818
|
const [v, w] = K(!1), [S, g] = K(0), [b, C] = K(null), x = X(d.length), R = X(null), M = X({}), I = X(!0), T = ge(() => {
|
|
20810
20819
|
const ne = /* @__PURE__ */ new Map();
|
|
20811
|
-
for (const
|
|
20812
|
-
const Ce = Gi(
|
|
20820
|
+
for (const de of d) {
|
|
20821
|
+
const Ce = Gi(de.mainMessage)?.id;
|
|
20813
20822
|
if (!Ce) continue;
|
|
20814
20823
|
const Fe = ne.get(Ce);
|
|
20815
|
-
Fe ? Fe.push(
|
|
20824
|
+
Fe ? Fe.push(de) : ne.set(Ce, [de]);
|
|
20816
20825
|
}
|
|
20817
|
-
return d.map((
|
|
20818
|
-
const Ce = ne.get(
|
|
20819
|
-
return { ...
|
|
20826
|
+
return d.map((de) => {
|
|
20827
|
+
const Ce = ne.get(de.id) ?? [];
|
|
20828
|
+
return { ...de, reply: Ce };
|
|
20820
20829
|
});
|
|
20821
20830
|
}, [d]), E = ge(() => i ? T.filter(
|
|
20822
20831
|
(ne) => ne.roomJid === r && ne.isReply && ne.isReply === "true" && Gi(ne.mainMessage)?.id === s.id
|
|
@@ -20830,41 +20839,41 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
20830
20839
|
(Ce) => Ce.id === "delimiter-new"
|
|
20831
20840
|
);
|
|
20832
20841
|
if (ne === -1) return Rh;
|
|
20833
|
-
const
|
|
20834
|
-
return Math.max(Rh,
|
|
20842
|
+
const de = E.length - ne + 10;
|
|
20843
|
+
return Math.max(Rh, de);
|
|
20835
20844
|
}), N = X(!1), F = X(null), B = X(null), J = X(
|
|
20836
20845
|
E[E.length - 1]
|
|
20837
|
-
), z = X(!1), ie = X(null), L = X(0), $ = X(null), U = X(!0), D = X(!1), H = X(!1),
|
|
20838
|
-
if (
|
|
20839
|
-
const ne = d[d.length - 1],
|
|
20840
|
-
!
|
|
20846
|
+
), z = X(!1), ie = X(null), L = X(0), $ = X(null), U = X(!0), D = X(!1), H = X(!1), ee = X(null), re = X(0), oe = G(() => {
|
|
20847
|
+
if (ee.current = null, o?.disableLastRead || !y || !m || !r) return;
|
|
20848
|
+
const ne = d[d.length - 1], de = ne ? xe(ne.date) || xe(ne?.timestamp) || xe(ne.id) : 0;
|
|
20849
|
+
!de || de <= re.current || (re.current = de, m.actionSetTimestampToPrivateStoreStanza(r, Date.now())?.catch?.(() => {
|
|
20841
20850
|
}));
|
|
20842
|
-
}, [o?.disableLastRead, y, m, r, d]),
|
|
20843
|
-
o?.disableLastRead || y && (
|
|
20844
|
-
}, [o?.disableLastRead, y,
|
|
20845
|
-
|
|
20846
|
-
|
|
20851
|
+
}, [o?.disableLastRead, y, m, r, d]), Q = G(() => {
|
|
20852
|
+
o?.disableLastRead || y && (ee.current && clearTimeout(ee.current), ee.current = setTimeout(oe, KS));
|
|
20853
|
+
}, [o?.disableLastRead, y, oe]);
|
|
20854
|
+
Z(() => (re.current = 0, () => {
|
|
20855
|
+
ee.current && clearTimeout(ee.current);
|
|
20847
20856
|
}), [r]);
|
|
20848
|
-
const
|
|
20857
|
+
const ce = () => {
|
|
20849
20858
|
const ne = F.current;
|
|
20850
20859
|
return ne ? {
|
|
20851
20860
|
top: ne.scrollTop,
|
|
20852
20861
|
height: ne.scrollHeight
|
|
20853
20862
|
} : null;
|
|
20854
|
-
},
|
|
20863
|
+
}, Y = G(() => {
|
|
20855
20864
|
const ne = F.current;
|
|
20856
20865
|
if (!ne) return Promise.resolve();
|
|
20857
|
-
const
|
|
20858
|
-
if (
|
|
20859
|
-
const Ce = Array.from(
|
|
20866
|
+
const de = ne.getElementsByTagName("img");
|
|
20867
|
+
if (de.length === 0) return Promise.resolve();
|
|
20868
|
+
const Ce = Array.from(de).map((Fe) => Fe.complete ? Promise.resolve() : new Promise((Ye) => {
|
|
20860
20869
|
Fe.onload = Ye, Fe.onerror = Ye;
|
|
20861
20870
|
}));
|
|
20862
20871
|
return Promise.all(Ce).then(() => {
|
|
20863
20872
|
});
|
|
20864
|
-
}, []),
|
|
20873
|
+
}, []), ue = G(async () => {
|
|
20865
20874
|
const ne = F.current;
|
|
20866
20875
|
if (ne)
|
|
20867
|
-
if (await
|
|
20876
|
+
if (await Y(), I.current)
|
|
20868
20877
|
E.findIndex(
|
|
20869
20878
|
(Ce) => Ce.id === "delimiter-new"
|
|
20870
20879
|
) !== -1 ? setTimeout(() => {
|
|
@@ -20877,32 +20886,32 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
20877
20886
|
}) : ne.scrollTop = ne.scrollHeight;
|
|
20878
20887
|
}, 100) : ne.scrollTop = ne.scrollHeight, I.current = !1;
|
|
20879
20888
|
else {
|
|
20880
|
-
const
|
|
20881
|
-
|
|
20889
|
+
const de = M.current[r];
|
|
20890
|
+
de !== void 0 ? ne.scrollTop = de : ne.scrollTop = ne.scrollHeight;
|
|
20882
20891
|
}
|
|
20883
|
-
}, [r, E,
|
|
20884
|
-
|
|
20892
|
+
}, [r, E, Y]);
|
|
20893
|
+
Z(() => {
|
|
20885
20894
|
E.length > 0 && C(
|
|
20886
20895
|
new Date(E[E.length - 1].date).getTime()
|
|
20887
20896
|
);
|
|
20888
|
-
}, []),
|
|
20897
|
+
}, []), Z(() => {
|
|
20889
20898
|
if (P) return;
|
|
20890
20899
|
new Date(
|
|
20891
20900
|
E[E.length - 1]?.date
|
|
20892
|
-
)?.getTime() > b && g((
|
|
20893
|
-
}, [E.length]),
|
|
20894
|
-
|
|
20901
|
+
)?.getTime() > b && g((de) => de += 1);
|
|
20902
|
+
}, [E.length]), Z(() => {
|
|
20903
|
+
ue(), ie.current = null;
|
|
20895
20904
|
}, [r]);
|
|
20896
20905
|
const se = G(() => {
|
|
20897
|
-
const ne =
|
|
20906
|
+
const ne = ce();
|
|
20898
20907
|
if (!ne || ne.top >= 150 || z.current) return;
|
|
20899
20908
|
if (E.length > k) {
|
|
20900
20909
|
if (N.current) return;
|
|
20901
|
-
N.current = !0, $.current =
|
|
20910
|
+
N.current = !0, $.current = ce(), _((Ye) => Ye + QS);
|
|
20902
20911
|
return;
|
|
20903
20912
|
}
|
|
20904
|
-
const [
|
|
20905
|
-
Fe && Fe !== ie.current && ($.current =
|
|
20913
|
+
const [de, Ce] = E, Fe = de?.id === "delimiter-new" ? Ce?.id : de?.id;
|
|
20914
|
+
Fe && Fe !== ie.current && ($.current = ce(), z.current = !0, ie.current = Fe, t(de.roomJid, 30, Number(Fe)).finally(
|
|
20906
20915
|
() => {
|
|
20907
20916
|
z.current = !1, J.current = E[E.length - 1];
|
|
20908
20917
|
}
|
|
@@ -20911,23 +20920,23 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
20911
20920
|
if (E.length <= k) return E;
|
|
20912
20921
|
const ne = E.findIndex(
|
|
20913
20922
|
(Ce) => Ce.id === "delimiter-new"
|
|
20914
|
-
),
|
|
20915
|
-
return
|
|
20923
|
+
), de = ne === -1 ? k : Math.max(k, E.length - ne + 10);
|
|
20924
|
+
return de >= E.length ? E : E.slice(-de);
|
|
20916
20925
|
}, [E, k]), ve = X(E.length);
|
|
20917
|
-
|
|
20926
|
+
Z(() => {
|
|
20918
20927
|
const ne = E.length - ve.current;
|
|
20919
|
-
ve.current = E.length, ne > 0 && D.current && E.length > k && _((
|
|
20928
|
+
ve.current = E.length, ne > 0 && D.current && E.length > k && _((de) => de + ne);
|
|
20920
20929
|
}, [E.length, k]);
|
|
20921
20930
|
const Ie = G(() => {
|
|
20922
20931
|
const ne = F.current;
|
|
20923
20932
|
ne && (ne.scrollTo({
|
|
20924
20933
|
top: ne.scrollHeight,
|
|
20925
20934
|
behavior: "smooth"
|
|
20926
|
-
}), w(!1), g(0),
|
|
20927
|
-
}, [
|
|
20935
|
+
}), w(!1), g(0), Q());
|
|
20936
|
+
}, [Q]), ze = () => {
|
|
20928
20937
|
const ne = F.current;
|
|
20929
20938
|
if (ne) {
|
|
20930
|
-
const
|
|
20939
|
+
const de = ne.scrollTop, Ce = ne.scrollHeight, Fe = ne.clientHeight, Ye = Ce - Fe - de, vn = Ye <= 150, ro = Ye <= 5;
|
|
20931
20940
|
U.current = ro, D.current = !vn, Ye > 150 ? w(!0) : ro && (Ie(), w(!1), g(0)), x.current = d.length, se();
|
|
20932
20941
|
} else
|
|
20933
20942
|
L.current = null;
|
|
@@ -20936,43 +20945,43 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
20936
20945
|
Qt.current();
|
|
20937
20946
|
}, 50));
|
|
20938
20947
|
}, Qt = X(ze);
|
|
20939
|
-
Qt.current = ze,
|
|
20948
|
+
Qt.current = ze, Z(() => {
|
|
20940
20949
|
const ne = B.current;
|
|
20941
20950
|
return ne && ne.addEventListener("scroll", Kt, !0), () => {
|
|
20942
20951
|
ne && ne.removeEventListener("scroll", Kt, !0);
|
|
20943
20952
|
};
|
|
20944
|
-
}, []),
|
|
20953
|
+
}, []), Z(() => {
|
|
20945
20954
|
if (pe.length > 30) {
|
|
20946
20955
|
const ne = F.current;
|
|
20947
20956
|
if (ne && $.current) {
|
|
20948
|
-
const
|
|
20949
|
-
ne.scrollTop =
|
|
20957
|
+
const de = $.current.top + (ne.scrollHeight - $.current.height);
|
|
20958
|
+
ne.scrollTop = de;
|
|
20950
20959
|
}
|
|
20951
20960
|
$.current = null;
|
|
20952
20961
|
}
|
|
20953
20962
|
N.current = !1;
|
|
20954
|
-
}, [pe.length, l, k]),
|
|
20963
|
+
}, [pe.length, l, k]), Z(() => {
|
|
20955
20964
|
if (d.length > 0) {
|
|
20956
|
-
const ne = d[d.length - 1],
|
|
20957
|
-
ne && ne.id !== R.current &&
|
|
20965
|
+
const ne = d[d.length - 1], de = ne && P;
|
|
20966
|
+
ne && ne.id !== R.current && de && (R.current = ne.id, Ie());
|
|
20958
20967
|
}
|
|
20959
|
-
}, [d, P]),
|
|
20968
|
+
}, [d, P]), Z(() => {
|
|
20960
20969
|
if (!F.current) return;
|
|
20961
|
-
const
|
|
20962
|
-
H.current = u?.length > 0, D.current || (
|
|
20970
|
+
const de = E.length > x.current, Ce = u?.length > 0 && !H.current;
|
|
20971
|
+
H.current = u?.length > 0, D.current || (de || Ce) && Y().then(() => {
|
|
20963
20972
|
Ie(), w(!1), g(0);
|
|
20964
20973
|
});
|
|
20965
20974
|
}, [
|
|
20966
20975
|
E.length,
|
|
20967
20976
|
u,
|
|
20968
20977
|
Ie,
|
|
20969
|
-
|
|
20978
|
+
Y
|
|
20970
20979
|
]);
|
|
20971
20980
|
const mt = (ne) => {
|
|
20972
|
-
let
|
|
20981
|
+
let de = null;
|
|
20973
20982
|
return ne.map((Ce) => {
|
|
20974
|
-
const Fe = new Date(Ce.date).toDateString(), Ye = Fe !==
|
|
20975
|
-
return
|
|
20983
|
+
const Fe = new Date(Ce.date).toDateString(), Ye = Fe !== de;
|
|
20984
|
+
return de = Fe, { message: Ce, showDateLabel: Ye };
|
|
20976
20985
|
});
|
|
20977
20986
|
}, Yt = ge(
|
|
20978
20987
|
() => mt(E),
|
|
@@ -20982,28 +20991,28 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
20982
20991
|
[pe, E, Yt]
|
|
20983
20992
|
), Qe = G(
|
|
20984
20993
|
(ne) => {
|
|
20985
|
-
const { message:
|
|
20986
|
-
return
|
|
20994
|
+
const { message: de, showDateLabel: Ce } = ne;
|
|
20995
|
+
return de.id === "delimiter-new" ? /* @__PURE__ */ h(
|
|
20987
20996
|
"div",
|
|
20988
20997
|
{
|
|
20989
20998
|
"data-message-id": "delimiter-new",
|
|
20990
20999
|
className: "message-container",
|
|
20991
21000
|
children: c ? /* @__PURE__ */ h(c, { color: o?.colors?.primary }) : /* @__PURE__ */ h(R0, { color: o?.colors?.primary })
|
|
20992
21001
|
},
|
|
20993
|
-
|
|
21002
|
+
de.id
|
|
20994
21003
|
) : /* @__PURE__ */ h(
|
|
20995
21004
|
P0,
|
|
20996
21005
|
{
|
|
20997
21006
|
CustomMessage: e,
|
|
20998
|
-
message:
|
|
21007
|
+
message: de,
|
|
20999
21008
|
activeMessage: s,
|
|
21000
21009
|
config: o,
|
|
21001
21010
|
xmppUsername: f.xmppUsername,
|
|
21002
21011
|
isReply: i,
|
|
21003
21012
|
showDateLabel: Ce,
|
|
21004
|
-
"data-message-id":
|
|
21013
|
+
"data-message-id": de.id
|
|
21005
21014
|
},
|
|
21006
|
-
|
|
21015
|
+
de.id
|
|
21007
21016
|
);
|
|
21008
21017
|
},
|
|
21009
21018
|
[
|
|
@@ -21040,7 +21049,7 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
21040
21049
|
renderMessage: Qe,
|
|
21041
21050
|
scrollController: {
|
|
21042
21051
|
scrollToBottom: Ie,
|
|
21043
|
-
waitForImagesLoaded:
|
|
21052
|
+
waitForImagesLoaded: Y,
|
|
21044
21053
|
showScrollButton: v,
|
|
21045
21054
|
newMessagesCount: S,
|
|
21046
21055
|
resetNewMessageCounter: Ms
|
|
@@ -21056,7 +21065,7 @@ const gS = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
|
|
|
21056
21065
|
onScroll: Kt,
|
|
21057
21066
|
color: o?.colors?.primary,
|
|
21058
21067
|
children: [
|
|
21059
|
-
n && /* @__PURE__ */ h(
|
|
21068
|
+
n && /* @__PURE__ */ h(vt, { color: o?.colors?.primary }),
|
|
21060
21069
|
s && /* @__PURE__ */ O(Te.Fragment, { children: [
|
|
21061
21070
|
/* @__PURE__ */ h(
|
|
21062
21071
|
e,
|
|
@@ -21423,7 +21432,7 @@ const iC = A.div`
|
|
|
21423
21432
|
children: [
|
|
21424
21433
|
!r && c,
|
|
21425
21434
|
!r && a,
|
|
21426
|
-
r ? /* @__PURE__ */ h(
|
|
21435
|
+
r ? /* @__PURE__ */ h(vt, { size: 24 }) : e,
|
|
21427
21436
|
!r && t
|
|
21428
21437
|
]
|
|
21429
21438
|
}
|
|
@@ -21597,12 +21606,12 @@ const z0 = [], AC = () => new Promise((e) => {
|
|
|
21597
21606
|
}, []), S = G(() => {
|
|
21598
21607
|
y(!0), p((g) => g + 1);
|
|
21599
21608
|
}, []);
|
|
21600
|
-
return
|
|
21609
|
+
return Z(
|
|
21601
21610
|
() => () => {
|
|
21602
21611
|
v.current && (URL.revokeObjectURL(v.current), v.current = void 0);
|
|
21603
21612
|
},
|
|
21604
21613
|
[]
|
|
21605
|
-
),
|
|
21614
|
+
), Z(() => {
|
|
21606
21615
|
if (!e || !t) return;
|
|
21607
21616
|
if (!m && typeof n == "number" && n > o) {
|
|
21608
21617
|
a("skipped");
|
|
@@ -21773,7 +21782,7 @@ const z0 = [], AC = () => new Promise((e) => {
|
|
|
21773
21782
|
)}">${q0(s)}</mention>${a}`;
|
|
21774
21783
|
}
|
|
21775
21784
|
return o;
|
|
21776
|
-
}, BC = Te.lazy(() => import("./MarkdownBody-
|
|
21785
|
+
}, BC = Te.lazy(() => import("./MarkdownBody-BYUK4GVM.js")), zC = {
|
|
21777
21786
|
fontFamily: 'var(--ethora-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif)',
|
|
21778
21787
|
fontSize: "var(--ethora-font-size, 16px)",
|
|
21779
21788
|
color: "#24292f",
|
|
@@ -22237,7 +22246,7 @@ const Ts = ({
|
|
|
22237
22246
|
online: l = !1
|
|
22238
22247
|
}) => {
|
|
22239
22248
|
const { config: d } = ke(), u = be(), f = d?.colors?.iconsBg, p = d?.colors?.icons, { backgroundColor: m } = Q0(e), y = f || m, [v, w] = K(!1);
|
|
22240
|
-
|
|
22249
|
+
Z(() => {
|
|
22241
22250
|
w(!1);
|
|
22242
22251
|
}, [t]);
|
|
22243
22252
|
const S = e ? u("avatar.altWithName", { name: e }) : u("avatar.altGeneric"), g = (M) => {
|
|
@@ -22359,9 +22368,9 @@ const Ts = ({
|
|
|
22359
22368
|
}, 100),
|
|
22360
22369
|
[g, b]
|
|
22361
22370
|
);
|
|
22362
|
-
|
|
22371
|
+
Z(() => {
|
|
22363
22372
|
x(p), S(Ih);
|
|
22364
|
-
}, [p, x]),
|
|
22373
|
+
}, [p, x]), Z(() => {
|
|
22365
22374
|
const E = b ? g.filter((P) => (P.jid || P.xmppUsername || "").split("@")[0] !== b) : g;
|
|
22366
22375
|
v(E);
|
|
22367
22376
|
}, [g, b]);
|
|
@@ -22466,7 +22475,7 @@ const Ts = ({
|
|
|
22466
22475
|
const s = X(e);
|
|
22467
22476
|
s.current = e;
|
|
22468
22477
|
const a = X(i);
|
|
22469
|
-
a.current = i,
|
|
22478
|
+
a.current = i, Z(() => {
|
|
22470
22479
|
if (!t || typeof document > "u") return;
|
|
22471
22480
|
const l = {
|
|
22472
22481
|
token: /* @__PURE__ */ Symbol("dismiss-layer"),
|
|
@@ -22567,53 +22576,53 @@ const Ts = ({
|
|
|
22567
22576
|
}) => {
|
|
22568
22577
|
const S = be(), [g, b] = K(""), [C, x] = K(!1), [R, M] = K(40), [I, T] = K(!1), [E, P] = K([]), [k, _] = K(null), [N, F] = K(!1), B = X(null), J = X(null), z = X(null), ie = X(null), L = X(null), $ = X(
|
|
22569
22578
|
null
|
|
22570
|
-
), U = X(null), D = X(0), H = ae((W) => Z6(W)),
|
|
22579
|
+
), U = X(null), D = X(0), H = ae((W) => Z6(W)), ee = ae((W) => W.rooms.usersSet), re = ae(
|
|
22571
22580
|
(W) => W.chatSettingStore.user
|
|
22572
|
-
),
|
|
22573
|
-
const fe = String(
|
|
22581
|
+
), oe = ge(() => (Array.isArray(H?.members) ? H.members : []).map((le) => {
|
|
22582
|
+
const fe = String(le?.xmppUsername || ""), me = fe.split("@")[0], Ae = ee?.[fe] || ee?.[me];
|
|
22574
22583
|
return Ae ? {
|
|
22575
|
-
...
|
|
22576
|
-
firstName:
|
|
22577
|
-
lastName:
|
|
22578
|
-
} :
|
|
22579
|
-
}), [H?.members,
|
|
22580
|
-
roomMembers:
|
|
22581
|
-
selfId:
|
|
22582
|
-
}),
|
|
22583
|
-
|
|
22584
|
-
if (!
|
|
22584
|
+
...le,
|
|
22585
|
+
firstName: le.firstName || Ae.firstName || "",
|
|
22586
|
+
lastName: le.lastName || Ae.lastName || ""
|
|
22587
|
+
} : le;
|
|
22588
|
+
}), [H?.members, ee]), Q = HC({
|
|
22589
|
+
roomMembers: oe,
|
|
22590
|
+
selfId: re?.xmppUsername || re?.id
|
|
22591
|
+
}), ce = !v, Y = Rs(), ue = X(null);
|
|
22592
|
+
Z(() => {
|
|
22593
|
+
if (!ce) return;
|
|
22585
22594
|
const W = H?.jid;
|
|
22586
|
-
W && (Array.isArray(H?.members) && H.members.length > 0 ||
|
|
22587
|
-
!
|
|
22595
|
+
W && (Array.isArray(H?.members) && H.members.length > 0 || ue.current !== W && (ue.current = W, T2(W.split("@")[0]).then((le) => {
|
|
22596
|
+
!le || !Array.isArray(le.members) || Y(it({ jid: W, updates: { members: le.members } }));
|
|
22588
22597
|
}).catch(() => {
|
|
22589
22598
|
})));
|
|
22590
|
-
}, [
|
|
22599
|
+
}, [ce, H?.jid, H?.members, Y]);
|
|
22591
22600
|
const se = G((W) => {
|
|
22592
22601
|
U.current = W;
|
|
22593
22602
|
}, []);
|
|
22594
|
-
|
|
22603
|
+
Z(() => {
|
|
22595
22604
|
if (U.current == null) return;
|
|
22596
|
-
const W = $.current,
|
|
22597
|
-
U.current = null, W && (W.focus(), W.setSelectionRange(
|
|
22605
|
+
const W = $.current, le = U.current;
|
|
22606
|
+
U.current = null, W && (W.focus(), W.setSelectionRange(le, le));
|
|
22598
22607
|
}, [g]);
|
|
22599
22608
|
const pe = Math.min(
|
|
22600
22609
|
Math.max(1, n?.attachments?.maxFiles ?? sE),
|
|
22601
22610
|
is
|
|
22602
22611
|
), ve = n?.attachments?.maxFileSizeMb, Ie = X(/* @__PURE__ */ new Map()), [ze, Kt] = K({});
|
|
22603
|
-
|
|
22604
|
-
const W = Ie.current,
|
|
22612
|
+
Z(() => {
|
|
22613
|
+
const W = Ie.current, le = new Set(E.map(Tr));
|
|
22605
22614
|
E.forEach((fe) => {
|
|
22606
22615
|
const me = Tr(fe);
|
|
22607
22616
|
if (W.has(me)) return;
|
|
22608
22617
|
const Ae = pn(fe.type, fe.name);
|
|
22609
22618
|
(Ae === "image" || Ae === "video" || Ae === "pdf") && W.set(me, URL.createObjectURL(fe));
|
|
22610
22619
|
}), W.forEach((fe, me) => {
|
|
22611
|
-
|
|
22620
|
+
le.has(me) || (URL.revokeObjectURL(fe), W.delete(me));
|
|
22612
22621
|
}), Kt(Object.fromEntries(W));
|
|
22613
|
-
}, [E]),
|
|
22622
|
+
}, [E]), Z(() => {
|
|
22614
22623
|
const W = Ie.current;
|
|
22615
22624
|
return () => {
|
|
22616
|
-
W.forEach((
|
|
22625
|
+
W.forEach((le) => URL.revokeObjectURL(le)), W.clear();
|
|
22617
22626
|
};
|
|
22618
22627
|
}, []);
|
|
22619
22628
|
const Qt = G(() => {
|
|
@@ -22621,12 +22630,12 @@ const Ts = ({
|
|
|
22621
22630
|
}, []), mt = G(
|
|
22622
22631
|
(W) => {
|
|
22623
22632
|
if (W.length === 0) return;
|
|
22624
|
-
const
|
|
22633
|
+
const le = ve ? ve * 1024 * 1024 : null, fe = new Set(E.map(Tr)), me = [], Ae = [];
|
|
22625
22634
|
let _e = 0;
|
|
22626
22635
|
W.forEach((wr) => {
|
|
22627
22636
|
const Yd = Tr(wr);
|
|
22628
22637
|
if (!fe.has(Yd)) {
|
|
22629
|
-
if (
|
|
22638
|
+
if (le && wr.size > le) {
|
|
22630
22639
|
Ae.push(wr.name);
|
|
22631
22640
|
return;
|
|
22632
22641
|
}
|
|
@@ -22648,42 +22657,42 @@ const Ts = ({
|
|
|
22648
22657
|
[E, pe, ve, S]
|
|
22649
22658
|
), Yt = G(
|
|
22650
22659
|
(W) => {
|
|
22651
|
-
const
|
|
22652
|
-
B.current && (B.current.value = ""), mt(
|
|
22660
|
+
const le = Array.from(W.target.files || []);
|
|
22661
|
+
B.current && (B.current.value = ""), mt(le);
|
|
22653
22662
|
},
|
|
22654
22663
|
[mt]
|
|
22655
|
-
), yr = !n?.disableMedia, [Qe, yn] = K(null), [Ms, ne] = K(!1),
|
|
22656
|
-
|
|
22664
|
+
), yr = !n?.disableMedia, [Qe, yn] = K(null), [Ms, ne] = K(!1), de = X(0);
|
|
22665
|
+
Z(() => {
|
|
22657
22666
|
const W = ie.current;
|
|
22658
22667
|
W && yn(
|
|
22659
22668
|
W.closest(`[${cE}]`) ?? W
|
|
22660
22669
|
);
|
|
22661
|
-
}, []),
|
|
22670
|
+
}, []), Z(() => {
|
|
22662
22671
|
if (!Qe || !yr) return;
|
|
22663
22672
|
const W = () => {
|
|
22664
|
-
|
|
22665
|
-
},
|
|
22666
|
-
xo(_e) && (_e.preventDefault(),
|
|
22673
|
+
de.current = 0, ne(!1);
|
|
22674
|
+
}, le = (_e) => {
|
|
22675
|
+
xo(_e) && (_e.preventDefault(), de.current += 1, ne(!0));
|
|
22667
22676
|
}, fe = (_e) => {
|
|
22668
22677
|
xo(_e) && (_e.preventDefault(), _e.dataTransfer && (_e.dataTransfer.dropEffect = "copy"));
|
|
22669
22678
|
}, me = (_e) => {
|
|
22670
|
-
xo(_e) && (
|
|
22679
|
+
xo(_e) && (de.current = Math.max(0, de.current - 1), de.current === 0 && ne(!1));
|
|
22671
22680
|
}, Ae = (_e) => {
|
|
22672
22681
|
xo(_e) && (_e.preventDefault(), W(), mt(Array.from(_e.dataTransfer?.files || [])));
|
|
22673
22682
|
};
|
|
22674
|
-
return Qe.addEventListener("dragenter",
|
|
22675
|
-
Qe.removeEventListener("dragenter",
|
|
22683
|
+
return Qe.addEventListener("dragenter", le), Qe.addEventListener("dragover", fe), Qe.addEventListener("dragleave", me), Qe.addEventListener("drop", Ae), () => {
|
|
22684
|
+
Qe.removeEventListener("dragenter", le), Qe.removeEventListener("dragover", fe), Qe.removeEventListener("dragleave", me), Qe.removeEventListener("drop", Ae);
|
|
22676
22685
|
};
|
|
22677
|
-
}, [Qe, yr, mt]),
|
|
22686
|
+
}, [Qe, yr, mt]), Z(() => {
|
|
22678
22687
|
const W = (me) => {
|
|
22679
22688
|
me.defaultPrevented || xo(me) && me.preventDefault();
|
|
22680
|
-
},
|
|
22681
|
-
W(me),
|
|
22689
|
+
}, le = (me) => {
|
|
22690
|
+
W(me), de.current = 0, ne(!1);
|
|
22682
22691
|
}, fe = () => {
|
|
22683
|
-
|
|
22692
|
+
de.current = 0, ne(!1);
|
|
22684
22693
|
};
|
|
22685
|
-
return window.addEventListener("dragover", W), window.addEventListener("drop",
|
|
22686
|
-
window.removeEventListener("dragover", W), window.removeEventListener("drop",
|
|
22694
|
+
return window.addEventListener("dragover", W), window.addEventListener("drop", le), window.addEventListener("dragend", fe), () => {
|
|
22695
|
+
window.removeEventListener("dragover", W), window.removeEventListener("drop", le), window.removeEventListener("dragend", fe);
|
|
22687
22696
|
};
|
|
22688
22697
|
}, []);
|
|
22689
22698
|
const Ce = G(
|
|
@@ -22700,73 +22709,73 @@ const Ts = ({
|
|
|
22700
22709
|
}, Ye = () => {
|
|
22701
22710
|
T(!1), o?.();
|
|
22702
22711
|
}, vn = G((W) => {
|
|
22703
|
-
P((
|
|
22712
|
+
P((le) => le.filter((fe) => fe !== W)), _(null);
|
|
22704
22713
|
}, []), ro = G(
|
|
22705
22714
|
(W) => {
|
|
22706
22715
|
if (!l) return 40;
|
|
22707
|
-
const
|
|
22716
|
+
const le = (W.match(/\n/g) || []).length, fe = 40, me = 13, Ae = 92, _e = fe + le * me;
|
|
22708
22717
|
return Math.min(Math.max(_e, fe), Ae);
|
|
22709
22718
|
},
|
|
22710
22719
|
[l]
|
|
22711
22720
|
), st = G(
|
|
22712
22721
|
(W) => {
|
|
22713
|
-
const
|
|
22714
|
-
M(
|
|
22722
|
+
const le = ro(W);
|
|
22723
|
+
M(le);
|
|
22715
22724
|
},
|
|
22716
22725
|
[ro]
|
|
22717
22726
|
), Vd = G(
|
|
22718
22727
|
(W) => {
|
|
22719
|
-
const
|
|
22720
|
-
|
|
22728
|
+
const le = W.target.value, fe = W.target.selectionStart ?? le.length;
|
|
22729
|
+
ce && Q.handleTextChange(g, le, fe), b(le), st(le);
|
|
22721
22730
|
},
|
|
22722
|
-
[st,
|
|
22731
|
+
[st, ce, Q, g]
|
|
22723
22732
|
), bn = G(
|
|
22724
|
-
(W,
|
|
22725
|
-
const fe = $.current, me =
|
|
22733
|
+
(W, le) => {
|
|
22734
|
+
const fe = $.current, me = le ?? fe?.selectionStart ?? g.length, Ae = Q.selectCandidate(W, g, me);
|
|
22726
22735
|
Ae && (b(Ae.text), st(Ae.text), se(Ae.caret));
|
|
22727
22736
|
},
|
|
22728
|
-
[
|
|
22737
|
+
[Q, g, st, se]
|
|
22729
22738
|
), Is = G(() => {
|
|
22730
|
-
D.current = $.current?.selectionStart ?? g.length,
|
|
22731
|
-
}, [
|
|
22739
|
+
D.current = $.current?.selectionStart ?? g.length, Q.setOverflowOpen(!0);
|
|
22740
|
+
}, [Q, g]), Og = G(
|
|
22732
22741
|
(W) => {
|
|
22733
22742
|
if (!W) return;
|
|
22734
|
-
const
|
|
22735
|
-
|
|
22743
|
+
const le = $.current, fe = le?.selectionStart ?? g.length, me = le?.selectionEnd ?? fe, Ae = g.slice(0, fe) + W + g.slice(me), _e = fe + W.length;
|
|
22744
|
+
ce && (Q.handleTextChange(g, Ae, _e), Q.closeDropdown()), b(Ae), st(Ae), se(_e);
|
|
22736
22745
|
},
|
|
22737
|
-
[g,
|
|
22746
|
+
[g, ce, Q, st, se]
|
|
22738
22747
|
), Lg = G(() => {
|
|
22739
|
-
F((W) => (!W &&
|
|
22740
|
-
}, [
|
|
22741
|
-
|
|
22748
|
+
F((W) => (!W && ce && Q.closeDropdown(), !W));
|
|
22749
|
+
}, [ce, Q]);
|
|
22750
|
+
Z(() => {
|
|
22742
22751
|
if (!N) return;
|
|
22743
22752
|
const W = (fe) => {
|
|
22744
22753
|
const me = fe.target;
|
|
22745
22754
|
me && (J.current?.contains(me) || z.current?.contains(me) || F(!1));
|
|
22746
|
-
},
|
|
22755
|
+
}, le = (fe) => {
|
|
22747
22756
|
fe.key === "Escape" && (F(!1), $.current?.focus());
|
|
22748
22757
|
};
|
|
22749
|
-
return document.addEventListener("mousedown", W), document.addEventListener("keydown",
|
|
22750
|
-
document.removeEventListener("mousedown", W), document.removeEventListener("keydown",
|
|
22758
|
+
return document.addEventListener("mousedown", W), document.addEventListener("keydown", le), () => {
|
|
22759
|
+
document.removeEventListener("mousedown", W), document.removeEventListener("keydown", le);
|
|
22751
22760
|
};
|
|
22752
|
-
}, [N]),
|
|
22761
|
+
}, [N]), Z(() => {
|
|
22753
22762
|
b(i ?? ""), i && st(i);
|
|
22754
22763
|
}, [i, st]);
|
|
22755
22764
|
const Tt = !w, gt = H?.jid, qd = ae(
|
|
22756
22765
|
(W) => Tt && gt ? W.rooms.drafts?.[gt] ?? "" : ""
|
|
22757
22766
|
), Wd = X(qd);
|
|
22758
22767
|
Wd.current = qd;
|
|
22759
|
-
const
|
|
22760
|
-
|
|
22768
|
+
const wt = X(null), vr = X(null), _s = X(!1), Jd = X(null), Xd = X(!1), wn = G(() => {
|
|
22769
|
+
wt.current && (clearTimeout(wt.current), wt.current = null);
|
|
22761
22770
|
const W = vr.current;
|
|
22762
|
-
vr.current = null, W &&
|
|
22763
|
-
}, [
|
|
22771
|
+
vr.current = null, W && Y($1(W));
|
|
22772
|
+
}, [Y]), xn = G(() => {
|
|
22764
22773
|
const W = Wd.current || "";
|
|
22765
|
-
_s.current = !0, b(W), st(W),
|
|
22766
|
-
}, [st,
|
|
22767
|
-
|
|
22768
|
-
}, [Tt, gt,
|
|
22769
|
-
|
|
22774
|
+
_s.current = !0, b(W), st(W), ce && Q.resetMentions(), W && se(W.length);
|
|
22775
|
+
}, [st, ce, Q, se]), oo = G(() => {
|
|
22776
|
+
wt.current && (clearTimeout(wt.current), wt.current = null), vr.current = null, !(!Tt || !gt) && Y(dy({ jid: gt }));
|
|
22777
|
+
}, [Tt, gt, Y]);
|
|
22778
|
+
Z(() => {
|
|
22770
22779
|
Tt && Jd.current !== (gt ?? null) && (wn(), Jd.current = gt ?? null, !i && xn());
|
|
22771
22780
|
}, [
|
|
22772
22781
|
Tt,
|
|
@@ -22774,24 +22783,24 @@ const Ts = ({
|
|
|
22774
22783
|
i,
|
|
22775
22784
|
wn,
|
|
22776
22785
|
xn
|
|
22777
|
-
]),
|
|
22778
|
-
const W = !!i,
|
|
22779
|
-
Xd.current = W, !(!Tt || !
|
|
22780
|
-
}, [i, Tt, xn]),
|
|
22786
|
+
]), Z(() => {
|
|
22787
|
+
const W = !!i, le = Xd.current;
|
|
22788
|
+
Xd.current = W, !(!Tt || !le || W) && xn();
|
|
22789
|
+
}, [i, Tt, xn]), Z(() => {
|
|
22781
22790
|
if (!(!Tt || !gt)) {
|
|
22782
22791
|
if (_s.current) {
|
|
22783
22792
|
_s.current = !1;
|
|
22784
22793
|
return;
|
|
22785
22794
|
}
|
|
22786
|
-
i || (vr.current = { jid: gt, text: g },
|
|
22787
|
-
|
|
22795
|
+
i || (vr.current = { jid: gt, text: g }, wt.current && clearTimeout(wt.current), wt.current = setTimeout(() => {
|
|
22796
|
+
wt.current = null;
|
|
22788
22797
|
const W = vr.current;
|
|
22789
|
-
vr.current = null, W &&
|
|
22798
|
+
vr.current = null, W && Y($1(W));
|
|
22790
22799
|
}, aE));
|
|
22791
22800
|
}
|
|
22792
|
-
}, [g, gt, Tt, i,
|
|
22801
|
+
}, [g, gt, Tt, i, Y]);
|
|
22793
22802
|
const Gd = X(wn);
|
|
22794
|
-
Gd.current = wn,
|
|
22803
|
+
Gd.current = wn, Z(() => () => Gd.current(), []);
|
|
22795
22804
|
const no = p || e, Ds = m || t, br = G(
|
|
22796
22805
|
(W) => /\S/.test(String(W || "")),
|
|
22797
22806
|
[]
|
|
@@ -22799,7 +22808,7 @@ const Ts = ({
|
|
|
22799
22808
|
// AudioRecorder hands over the recorded Blob, not a URL - the old name
|
|
22800
22809
|
// stuck around from when it did.
|
|
22801
22810
|
async (W) => {
|
|
22802
|
-
const
|
|
22811
|
+
const le = c ? c(g) : g, fe = br(le) ? le : null;
|
|
22803
22812
|
let me;
|
|
22804
22813
|
if (E.length > 0)
|
|
22805
22814
|
me = Ds(E, "media"), x(!1);
|
|
@@ -22808,15 +22817,15 @@ const Ts = ({
|
|
|
22808
22817
|
else {
|
|
22809
22818
|
if (!fe)
|
|
22810
22819
|
return;
|
|
22811
|
-
no(fe,
|
|
22820
|
+
no(fe, Q.mentionSpans), Q.resetMentions(), oo(), b(""), P([]), _(null), M(40);
|
|
22812
22821
|
return;
|
|
22813
22822
|
}
|
|
22814
|
-
if (
|
|
22823
|
+
if (Q.resetMentions(), oo(), b(""), P([]), _(null), M(40), fe) {
|
|
22815
22824
|
try {
|
|
22816
22825
|
await me;
|
|
22817
22826
|
} catch {
|
|
22818
22827
|
}
|
|
22819
|
-
no(fe,
|
|
22828
|
+
no(fe, Q.mentionSpans);
|
|
22820
22829
|
}
|
|
22821
22830
|
},
|
|
22822
22831
|
[
|
|
@@ -22826,50 +22835,50 @@ const Ts = ({
|
|
|
22826
22835
|
c,
|
|
22827
22836
|
br,
|
|
22828
22837
|
g,
|
|
22829
|
-
|
|
22838
|
+
Q,
|
|
22830
22839
|
oo
|
|
22831
22840
|
]
|
|
22832
22841
|
), Ns = G(() => {
|
|
22833
|
-
const W = n.secondarySendButton.messageEdit + g,
|
|
22834
|
-
br(
|
|
22842
|
+
const W = n.secondarySendButton.messageEdit + g, le = c ? c(W) : W;
|
|
22843
|
+
br(le) && (no(le, Q.mentionSpans), Q.resetMentions(), oo(), b(""), P([]), _(null), M(40));
|
|
22835
22844
|
}, [
|
|
22836
22845
|
no,
|
|
22837
22846
|
g,
|
|
22838
22847
|
n?.secondarySendButton?.messageEdit,
|
|
22839
22848
|
c,
|
|
22840
22849
|
br,
|
|
22841
|
-
|
|
22850
|
+
Q,
|
|
22842
22851
|
oo
|
|
22843
|
-
]), Kd =
|
|
22852
|
+
]), Kd = ce && Q.isDropdownOpen && !Q.overflowOpen && (Q.visibleCandidates.length > 0 || Q.hasOverflow), Qd = G(
|
|
22844
22853
|
(W) => {
|
|
22845
22854
|
if (Kd) {
|
|
22846
22855
|
if (W.key === "Escape") {
|
|
22847
|
-
W.preventDefault(),
|
|
22856
|
+
W.preventDefault(), Q.closeDropdown();
|
|
22848
22857
|
return;
|
|
22849
22858
|
}
|
|
22850
22859
|
if (W.key === "ArrowDown") {
|
|
22851
|
-
W.preventDefault(),
|
|
22860
|
+
W.preventDefault(), Q.moveHighlight(1);
|
|
22852
22861
|
return;
|
|
22853
22862
|
}
|
|
22854
22863
|
if (W.key === "ArrowUp") {
|
|
22855
|
-
W.preventDefault(),
|
|
22864
|
+
W.preventDefault(), Q.moveHighlight(-1);
|
|
22856
22865
|
return;
|
|
22857
22866
|
}
|
|
22858
22867
|
if (W.key === "Enter" || W.key === "Tab") {
|
|
22859
|
-
const fe =
|
|
22860
|
-
if (
|
|
22868
|
+
const fe = Q.visibleCandidates.length;
|
|
22869
|
+
if (Q.hasOverflow && Q.highlightedIndex === fe) {
|
|
22861
22870
|
W.preventDefault(), Is();
|
|
22862
22871
|
return;
|
|
22863
22872
|
}
|
|
22864
|
-
const me =
|
|
22873
|
+
const me = Q.visibleCandidates[Q.highlightedIndex];
|
|
22865
22874
|
if (me) {
|
|
22866
22875
|
W.preventDefault(), bn(me);
|
|
22867
22876
|
return;
|
|
22868
22877
|
}
|
|
22869
22878
|
}
|
|
22870
22879
|
}
|
|
22871
|
-
if (
|
|
22872
|
-
const fe = W.target, me = fe.selectionStart ?? 0, Ae = fe.selectionEnd ?? 0, _e =
|
|
22880
|
+
if (ce && W.key === "Backspace" && !Q.isDropdownOpen) {
|
|
22881
|
+
const fe = W.target, me = fe.selectionStart ?? 0, Ae = fe.selectionEnd ?? 0, _e = Q.handleBackspace(g, me, Ae);
|
|
22873
22882
|
if (_e) {
|
|
22874
22883
|
W.preventDefault(), b(_e.text), st(_e.text), se(_e.caret);
|
|
22875
22884
|
return;
|
|
@@ -22891,9 +22900,9 @@ const Ts = ({
|
|
|
22891
22900
|
br,
|
|
22892
22901
|
g,
|
|
22893
22902
|
l,
|
|
22894
|
-
|
|
22903
|
+
ce,
|
|
22895
22904
|
Kd,
|
|
22896
|
-
|
|
22905
|
+
Q,
|
|
22897
22906
|
bn,
|
|
22898
22907
|
Is,
|
|
22899
22908
|
st,
|
|
@@ -22918,27 +22927,27 @@ const Ts = ({
|
|
|
22918
22927
|
/* @__PURE__ */ h(tC, { role: "status", "aria-live": "polite", children: /* @__PURE__ */ h(rC, { children: S("attachment.dropHint") }) }),
|
|
22919
22928
|
Qe
|
|
22920
22929
|
),
|
|
22921
|
-
|
|
22930
|
+
ce && Q.isDropdownOpen && !Q.overflowOpen && /* @__PURE__ */ h(
|
|
22922
22931
|
WC,
|
|
22923
22932
|
{
|
|
22924
|
-
candidates:
|
|
22925
|
-
totalCount:
|
|
22926
|
-
hasOverflow:
|
|
22927
|
-
highlightedIndex:
|
|
22928
|
-
onHoverIndex:
|
|
22933
|
+
candidates: Q.visibleCandidates,
|
|
22934
|
+
totalCount: Q.candidates.length,
|
|
22935
|
+
hasOverflow: Q.hasOverflow,
|
|
22936
|
+
highlightedIndex: Q.highlightedIndex,
|
|
22937
|
+
onHoverIndex: Q.setHighlightedIndex,
|
|
22929
22938
|
onSelect: bn,
|
|
22930
22939
|
onShowAll: Is
|
|
22931
22940
|
}
|
|
22932
22941
|
),
|
|
22933
|
-
|
|
22942
|
+
ce && Q.overflowOpen && /* @__PURE__ */ h(
|
|
22934
22943
|
iE,
|
|
22935
22944
|
{
|
|
22936
|
-
members:
|
|
22937
|
-
selfId:
|
|
22945
|
+
members: oe,
|
|
22946
|
+
selfId: re?.xmppUsername || re?.id,
|
|
22938
22947
|
onSelect: (W) => {
|
|
22939
|
-
bn(W, D.current),
|
|
22948
|
+
bn(W, D.current), Q.setOverflowOpen(!1);
|
|
22940
22949
|
},
|
|
22941
|
-
onClose: () =>
|
|
22950
|
+
onClose: () => Q.closeDropdown()
|
|
22942
22951
|
}
|
|
22943
22952
|
),
|
|
22944
22953
|
N && /* @__PURE__ */ h(eC, { ref: J, children: /* @__PURE__ */ h(
|
|
@@ -23187,7 +23196,7 @@ const Ts = ({
|
|
|
23187
23196
|
}, f = (p) => {
|
|
23188
23197
|
c(!!p.target.value);
|
|
23189
23198
|
};
|
|
23190
|
-
return
|
|
23199
|
+
return Z(() => {
|
|
23191
23200
|
if (i && t) {
|
|
23192
23201
|
const p = setTimeout(() => {
|
|
23193
23202
|
l.current?.focus();
|
|
@@ -23353,13 +23362,13 @@ const Ts = ({
|
|
|
23353
23362
|
`;
|
|
23354
23363
|
function Go(e, t) {
|
|
23355
23364
|
const [r, o] = K(e ? "open" : "closed"), n = X();
|
|
23356
|
-
return
|
|
23365
|
+
return Z(() => {
|
|
23357
23366
|
if (n.current && clearTimeout(n.current), e) {
|
|
23358
23367
|
o("open");
|
|
23359
23368
|
return;
|
|
23360
23369
|
}
|
|
23361
23370
|
o((i) => i === "closed" ? "closed" : "closing");
|
|
23362
|
-
}, [e]),
|
|
23371
|
+
}, [e]), Z(() => {
|
|
23363
23372
|
if (r === "closing") {
|
|
23364
23373
|
if (t <= 0 || S0()) {
|
|
23365
23374
|
o("closed");
|
|
@@ -23557,7 +23566,7 @@ const vE = A.div`
|
|
|
23557
23566
|
{ name: "Members-only", id: "group" }
|
|
23558
23567
|
], og = (e = 480) => {
|
|
23559
23568
|
const t = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(`(max-width: ${e}px)`).matches, [r, o] = K(t);
|
|
23560
|
-
return
|
|
23569
|
+
return Z(() => {
|
|
23561
23570
|
if (typeof window > "u" || typeof window.matchMedia != "function")
|
|
23562
23571
|
return;
|
|
23563
23572
|
const n = window.matchMedia(`(max-width: ${e}px)`), i = () => o(n.matches);
|
|
@@ -23635,7 +23644,7 @@ const vE = A.div`
|
|
|
23635
23644
|
name: "Members-only",
|
|
23636
23645
|
id: "group"
|
|
23637
23646
|
}, [l, d] = K(!1), [u, f] = K(!1), [p, m] = K(""), [y, v] = K(""), [w, S] = K(s), [g, b] = K(null), [C, x] = K({ name: "", description: "" }), [R, M] = K([]), I = X(null), T = w.id === "group", [E, P] = K(!1);
|
|
23638
|
-
|
|
23647
|
+
Z(() => {
|
|
23639
23648
|
if (!T) {
|
|
23640
23649
|
P(!1);
|
|
23641
23650
|
return;
|
|
@@ -23648,10 +23657,10 @@ const vE = A.div`
|
|
|
23648
23657
|
() => p.length >= 3,
|
|
23649
23658
|
[p, y]
|
|
23650
23659
|
), _ = (H) => H.trim().length < 3 ? "Room name must be at least 3 characters." : "", N = (H) => {
|
|
23651
|
-
const
|
|
23652
|
-
m(
|
|
23653
|
-
...
|
|
23654
|
-
name: _(
|
|
23660
|
+
const ee = H.target.value;
|
|
23661
|
+
m(ee), x((re) => ({
|
|
23662
|
+
...re,
|
|
23663
|
+
name: _(ee)
|
|
23655
23664
|
}));
|
|
23656
23665
|
}, F = () => d(!0), B = () => {
|
|
23657
23666
|
d(!1), m(""), v(""), S(s), b(null), x({ name: "", description: "" }), M([]);
|
|
@@ -23665,35 +23674,35 @@ const vE = A.div`
|
|
|
23665
23674
|
b(H);
|
|
23666
23675
|
}, L = async () => {
|
|
23667
23676
|
b(null);
|
|
23668
|
-
}, $ = async (H,
|
|
23677
|
+
}, $ = async (H, ee) => {
|
|
23669
23678
|
try {
|
|
23670
|
-
const
|
|
23679
|
+
const re = un(
|
|
23671
23680
|
H,
|
|
23672
23681
|
e?.xmppSettings?.conference,
|
|
23673
|
-
|
|
23682
|
+
ee
|
|
23674
23683
|
);
|
|
23675
|
-
return !
|
|
23684
|
+
return !re || !re.jid ? (console.error(
|
|
23676
23685
|
"handleRoomCreation: failed to normalize the new room",
|
|
23677
23686
|
H
|
|
23678
23687
|
), null) : (t(
|
|
23679
23688
|
rn({
|
|
23680
|
-
room:
|
|
23689
|
+
room: re,
|
|
23681
23690
|
xmpp: r
|
|
23682
23691
|
})
|
|
23683
|
-
), t(
|
|
23684
|
-
} catch (
|
|
23685
|
-
return console.error("Error handling room creation:",
|
|
23692
|
+
), t(Ue({ roomJID: re.jid })), re.jid);
|
|
23693
|
+
} catch (re) {
|
|
23694
|
+
return console.error("Error handling room creation:", re), null;
|
|
23686
23695
|
}
|
|
23687
23696
|
}, U = async (H) => {
|
|
23688
23697
|
if (g)
|
|
23689
23698
|
try {
|
|
23690
|
-
const
|
|
23691
|
-
|
|
23692
|
-
const
|
|
23693
|
-
if (!
|
|
23694
|
-
r.setRoomImageStanza(H,
|
|
23695
|
-
} catch (
|
|
23696
|
-
console.error("Room avatar upload failed:",
|
|
23699
|
+
const ee = new FormData();
|
|
23700
|
+
ee.append("files", g);
|
|
23701
|
+
const oe = (await B2(ee, H))?.data?.results?.[0]?.location;
|
|
23702
|
+
if (!oe) return;
|
|
23703
|
+
r.setRoomImageStanza(H, oe, "icon", "none"), t(it({ jid: H, updates: { icon: oe } }));
|
|
23704
|
+
} catch (ee) {
|
|
23705
|
+
console.error("Room avatar upload failed:", ee);
|
|
23697
23706
|
}
|
|
23698
23707
|
}, D = async () => {
|
|
23699
23708
|
if (o({
|
|
@@ -23704,20 +23713,20 @@ const vE = A.div`
|
|
|
23704
23713
|
duration: 3e3
|
|
23705
23714
|
}), f(!0), k) {
|
|
23706
23715
|
if (e?.newArch !== !1) {
|
|
23707
|
-
const H = R.map((
|
|
23716
|
+
const H = R.map((oe) => oe.xmppUsername), ee = await Ev({
|
|
23708
23717
|
title: p,
|
|
23709
23718
|
description: y && y !== "" ? y : "No description",
|
|
23710
23719
|
picture: "",
|
|
23711
23720
|
type: w.id || "public",
|
|
23712
23721
|
members: H
|
|
23713
|
-
}),
|
|
23714
|
-
|
|
23722
|
+
}), re = await $(ee, H.length);
|
|
23723
|
+
re && await U(re);
|
|
23715
23724
|
} else {
|
|
23716
23725
|
const H = await r.createRoomStanza(
|
|
23717
23726
|
p,
|
|
23718
23727
|
y && y !== "" ? y : "No description"
|
|
23719
23728
|
);
|
|
23720
|
-
r.getRoomsStanza(), t(
|
|
23729
|
+
r.getRoomsStanza(), t(Ue({ roomJID: H })), await U(H);
|
|
23721
23730
|
}
|
|
23722
23731
|
d(!1), x({ name: "", description: "" }), b(null), m(""), v(""), f(!1), o({
|
|
23723
23732
|
id: Date.now().toString(),
|
|
@@ -23798,9 +23807,9 @@ const vE = A.div`
|
|
|
23798
23807
|
onKeyDown: (H) => {
|
|
23799
23808
|
if (H.key !== "ArrowLeft" && H.key !== "ArrowRight") return;
|
|
23800
23809
|
H.preventDefault();
|
|
23801
|
-
const
|
|
23802
|
-
S(
|
|
23803
|
-
`#ethora-chattype-${
|
|
23810
|
+
const ee = T ? a : c;
|
|
23811
|
+
S(ee), H.currentTarget.querySelector(
|
|
23812
|
+
`#ethora-chattype-${ee.id}`
|
|
23804
23813
|
)?.focus();
|
|
23805
23814
|
},
|
|
23806
23815
|
children: [
|
|
@@ -23880,7 +23889,7 @@ const vE = A.div`
|
|
|
23880
23889
|
style: { width: "100%" },
|
|
23881
23890
|
variant: "filled",
|
|
23882
23891
|
disabled: !k || u,
|
|
23883
|
-
EndIcon: u ? /* @__PURE__ */ h(
|
|
23892
|
+
EndIcon: u ? /* @__PURE__ */ h(vt, { size: 16 }) : void 0
|
|
23884
23893
|
}
|
|
23885
23894
|
)
|
|
23886
23895
|
] })
|
|
@@ -24326,7 +24335,7 @@ const uk = () => (dc || (dc = import("./native-CDi4YD_s.js").then((e) => (Qi = e
|
|
|
24326
24335
|
return t ? t.skins?.[0]?.native ?? "" : dk[e] ?? "";
|
|
24327
24336
|
}, Ud = () => {
|
|
24328
24337
|
const [e, t] = K(Qi !== null);
|
|
24329
|
-
return
|
|
24338
|
+
return Z(() => {
|
|
24330
24339
|
if (e) return;
|
|
24331
24340
|
let r = !0;
|
|
24332
24341
|
return uk().then(() => {
|
|
@@ -24449,7 +24458,7 @@ const uk = () => (dc || (dc = import("./native-CDi4YD_s.js").then((e) => (Qi = e
|
|
|
24449
24458
|
myXmppUsername: r
|
|
24450
24459
|
}) => {
|
|
24451
24460
|
const o = be(), [n, i] = K(!1), s = X(null), a = ae((l) => l.rooms.usersSet);
|
|
24452
|
-
|
|
24461
|
+
Z(() => {
|
|
24453
24462
|
if (!n) return;
|
|
24454
24463
|
const l = (d) => {
|
|
24455
24464
|
s.current && !s.current.contains(d.target) && i(!1);
|
|
@@ -24808,7 +24817,7 @@ const uk = () => (dc || (dc = import("./native-CDi4YD_s.js").then((e) => (Qi = e
|
|
|
24808
24817
|
window.dispatchEvent(new Event("ethora-xmpp-logout"));
|
|
24809
24818
|
} catch {
|
|
24810
24819
|
}
|
|
24811
|
-
j.dispatch(
|
|
24820
|
+
j.dispatch(Ue({ roomJID: null }));
|
|
24812
24821
|
try {
|
|
24813
24822
|
e?.setActiveRoomJid?.(null);
|
|
24814
24823
|
} catch {
|
|
@@ -24917,7 +24926,7 @@ function Ok(e) {
|
|
|
24917
24926
|
},
|
|
24918
24927
|
[S]
|
|
24919
24928
|
);
|
|
24920
|
-
|
|
24929
|
+
Z(() => (o || g(0, !0), () => {
|
|
24921
24930
|
v.current?.abort();
|
|
24922
24931
|
}), [r]);
|
|
24923
24932
|
const b = G(() => {
|
|
@@ -25557,7 +25566,7 @@ const dR = 6, Gh = (e) => {
|
|
|
25557
25566
|
U ? x.current.set(L, U) : x.current.delete(L);
|
|
25558
25567
|
}, P.current.set(L, $)), $;
|
|
25559
25568
|
}, []);
|
|
25560
|
-
|
|
25569
|
+
Z(() => {
|
|
25561
25570
|
const L = (e || []).filter(($) => !Kh($)).map(uR).filter(Boolean);
|
|
25562
25571
|
if (L.length && (L.forEach(($) => {
|
|
25563
25572
|
f(Kl({ jid: $ }));
|
|
@@ -25565,9 +25574,9 @@ const dR = 6, Gh = (e) => {
|
|
|
25565
25574
|
const $ = (e || []).find(
|
|
25566
25575
|
(U) => Kh(U) && U.jid !== y
|
|
25567
25576
|
)?.jid || null;
|
|
25568
|
-
f(
|
|
25577
|
+
f(Ue({ roomJID: $ }));
|
|
25569
25578
|
}
|
|
25570
|
-
}, [y, e, f]),
|
|
25579
|
+
}, [y, e, f]), Z(() => {
|
|
25571
25580
|
!g && d === "files" && u("chats");
|
|
25572
25581
|
}, [g, d]);
|
|
25573
25582
|
const _ = G((L) => {
|
|
@@ -25589,9 +25598,9 @@ const dR = 6, Gh = (e) => {
|
|
|
25589
25598
|
(H) => !!H && typeof H == "object" && typeof H.jid == "string" && H.jid.length > 0 && !Bd(H, p)
|
|
25590
25599
|
).filter(
|
|
25591
25600
|
(H) => lg(H).toLowerCase().includes(L)
|
|
25592
|
-
).sort((H,
|
|
25593
|
-
const
|
|
25594
|
-
return Gh(
|
|
25601
|
+
).sort((H, ee) => {
|
|
25602
|
+
const re = Gh(H);
|
|
25603
|
+
return Gh(ee) - re;
|
|
25595
25604
|
});
|
|
25596
25605
|
$.set(L, D);
|
|
25597
25606
|
}
|
|
@@ -25599,24 +25608,24 @@ const dR = 6, Gh = (e) => {
|
|
|
25599
25608
|
}, [e, c, p?.hiddenRooms]);
|
|
25600
25609
|
Ug(() => {
|
|
25601
25610
|
const L = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, $ = R.current, U = /* @__PURE__ */ new Map(), D = M.current?.scrollTop ?? 0, H = D - I.current;
|
|
25602
|
-
B.forEach((
|
|
25603
|
-
const
|
|
25604
|
-
if (!
|
|
25605
|
-
const
|
|
25606
|
-
|
|
25607
|
-
const
|
|
25608
|
-
if (U.set(
|
|
25609
|
-
const
|
|
25610
|
-
if (
|
|
25611
|
-
const se =
|
|
25611
|
+
B.forEach((ee, re) => {
|
|
25612
|
+
const oe = ee.jid || `${ee.id}-${re}`, Q = x.current.get(oe);
|
|
25613
|
+
if (!Q) return;
|
|
25614
|
+
const ce = E.current.get(oe);
|
|
25615
|
+
ce !== void 0 && (cancelAnimationFrame(ce), E.current.delete(oe)), (Q.style.transform || Q.style.transition) && (Q.style.transition = "none", Q.style.transform = "");
|
|
25616
|
+
const Y = Q.getBoundingClientRect().top;
|
|
25617
|
+
if (U.set(oe, Y), !T.current || L) return;
|
|
25618
|
+
const ue = $.get(oe);
|
|
25619
|
+
if (ue === void 0) return;
|
|
25620
|
+
const se = ue - Y - H;
|
|
25612
25621
|
if (!se) return;
|
|
25613
|
-
|
|
25622
|
+
Q.style.transition = "none", Q.style.transform = `translateY(${se}px)`, Q.getBoundingClientRect();
|
|
25614
25623
|
const pe = requestAnimationFrame(() => {
|
|
25615
|
-
E.current.delete(
|
|
25624
|
+
E.current.delete(oe), Q.style.transition = "transform var(--ethora-motion-base, 220ms) var(--ethora-motion-ease, cubic-bezier(.2,.8,.2,1))", Q.style.transform = "";
|
|
25616
25625
|
});
|
|
25617
|
-
E.current.set(
|
|
25626
|
+
E.current.set(oe, pe);
|
|
25618
25627
|
}), R.current = U, I.current = D, T.current = !0;
|
|
25619
|
-
}, [B]),
|
|
25628
|
+
}, [B]), Z(() => {
|
|
25620
25629
|
if (t)
|
|
25621
25630
|
return document.addEventListener("mousedown", _), () => {
|
|
25622
25631
|
document.removeEventListener("mousedown", _);
|
|
@@ -25801,15 +25810,15 @@ const dR = 6, Gh = (e) => {
|
|
|
25801
25810
|
/* @__PURE__ */ h($h, { $width: "70%" })
|
|
25802
25811
|
] })
|
|
25803
25812
|
] }, `skeleton-${$}`)) : B.map((L, $) => {
|
|
25804
|
-
const U = $ === B.length - 1, D = J(L) || !U && J(B[$ + 1]), H = L.jid || `${L.id}-${$}`,
|
|
25805
|
-
let
|
|
25806
|
-
return
|
|
25813
|
+
const U = $ === B.length - 1, D = J(L) || !U && J(B[$ + 1]), H = L.jid || `${L.id}-${$}`, ee = C.current;
|
|
25814
|
+
let re = !0, oe = 0;
|
|
25815
|
+
return ee.has(H) ? oe = ee.get(H) : (oe = ee.size * 24, ee.set(H, oe), re = !1), /* @__PURE__ */ O(Te.Fragment, { children: [
|
|
25807
25816
|
/* @__PURE__ */ h(
|
|
25808
25817
|
JE,
|
|
25809
25818
|
{
|
|
25810
25819
|
ref: k(H),
|
|
25811
|
-
$delay:
|
|
25812
|
-
$skipAnimation:
|
|
25820
|
+
$delay: oe,
|
|
25821
|
+
$skipAnimation: re,
|
|
25813
25822
|
children: /* @__PURE__ */ h(
|
|
25814
25823
|
Tk,
|
|
25815
25824
|
{
|
|
@@ -26171,7 +26180,7 @@ function SR({
|
|
|
26171
26180
|
JSON.stringify(e?.typography?.weights ?? {})
|
|
26172
26181
|
]
|
|
26173
26182
|
), r = ge(() => xR++, []);
|
|
26174
|
-
return
|
|
26183
|
+
return Z(() => (Cl.set(r, t), Qh(), () => {
|
|
26175
26184
|
Cl.delete(r), Qh();
|
|
26176
26185
|
}), [r, t]), null;
|
|
26177
26186
|
}
|
|
@@ -26210,7 +26219,7 @@ const CR = [
|
|
|
26210
26219
|
checked: n
|
|
26211
26220
|
}) => {
|
|
26212
26221
|
const [i, s] = K(n ?? !1);
|
|
26213
|
-
return
|
|
26222
|
+
return Z(() => {
|
|
26214
26223
|
n !== void 0 && s(n);
|
|
26215
26224
|
}, [n]), /* @__PURE__ */ h(
|
|
26216
26225
|
kR,
|
|
@@ -26547,7 +26556,7 @@ const CR = [
|
|
|
26547
26556
|
}, N = (D) => {
|
|
26548
26557
|
r(
|
|
26549
26558
|
it({ jid: D.jid, updates: { ...D, unreadMessages: 0 } })
|
|
26550
|
-
), r(
|
|
26559
|
+
), r(Ue({ roomJID: D.jid })), r(je({ chatJID: D.jid, loading: !0 }));
|
|
26551
26560
|
}, F = G(() => {
|
|
26552
26561
|
i(!0);
|
|
26553
26562
|
}, []), B = G(() => {
|
|
@@ -26557,29 +26566,29 @@ const CR = [
|
|
|
26557
26566
|
i(!1);
|
|
26558
26567
|
return;
|
|
26559
26568
|
}
|
|
26560
|
-
o.leaveTheRoomStanza(a), r(Kl({ jid: a })), typeof window < "u" && window.history.pushState(null, "", window.location.pathname), r(
|
|
26569
|
+
o.leaveTheRoomStanza(a), r(Kl({ jid: a })), typeof window < "u" && window.history.pushState(null, "", window.location.pathname), r(Ue({ roomJID: null })), i(!1);
|
|
26561
26570
|
}, [a, r, o]), z = G(
|
|
26562
26571
|
async (D) => {
|
|
26563
26572
|
if (!E || T || !e?.jid)
|
|
26564
26573
|
return;
|
|
26565
26574
|
const H = e.jid.split("@")[0];
|
|
26566
26575
|
if (!H) return;
|
|
26567
|
-
const
|
|
26576
|
+
const ee = String(d?.xmppUsername || "").split("@")[0], re = (e.members || []).find((se) => {
|
|
26568
26577
|
const pe = String(se?.xmppUsername || "").split("@")[0];
|
|
26569
|
-
return pe && pe !==
|
|
26570
|
-
}),
|
|
26571
|
-
|
|
26572
|
-
),
|
|
26578
|
+
return pe && pe !== ee;
|
|
26579
|
+
}), oe = re?.xmppUsername || null, Q = String(e.name || "").trim(), ce = !Q || ["deleted", "deleted user", "unknown", "null"].includes(
|
|
26580
|
+
Q.toLowerCase()
|
|
26581
|
+
), Y = re && (`${re.firstName || ""} ${re.lastName || ""}`.trim() || re.name) || "", ue = (ce ? Y : Q) || Y || H;
|
|
26573
26582
|
r(
|
|
26574
26583
|
py({
|
|
26575
26584
|
roomJid: e.jid,
|
|
26576
|
-
roomName:
|
|
26585
|
+
roomName: ue,
|
|
26577
26586
|
roomBareName: H,
|
|
26578
26587
|
kind: D,
|
|
26579
|
-
peerXmppUsername:
|
|
26588
|
+
peerXmppUsername: oe
|
|
26580
26589
|
})
|
|
26581
|
-
),
|
|
26582
|
-
peerXmppUsername:
|
|
26590
|
+
), oe && k9(D, {
|
|
26591
|
+
peerXmppUsername: oe,
|
|
26583
26592
|
roomBareName: H
|
|
26584
26593
|
});
|
|
26585
26594
|
try {
|
|
@@ -26924,14 +26933,14 @@ const CR = [
|
|
|
26924
26933
|
] });
|
|
26925
26934
|
}, lT = (e, t, r) => {
|
|
26926
26935
|
const o = Me();
|
|
26927
|
-
|
|
26936
|
+
Z(() => {
|
|
26928
26937
|
if (!(typeof window > "u")) {
|
|
26929
26938
|
if (r?.setRoomJidInPath && e && typeof e == "string") {
|
|
26930
26939
|
const n = e.split("@")[0], i = new URLSearchParams(window.location.search);
|
|
26931
26940
|
i.set("chatId", n);
|
|
26932
26941
|
const s = `${window.location.pathname}?${i.toString()}`;
|
|
26933
26942
|
window.history.pushState(null, "", s);
|
|
26934
|
-
} else !e && Object.values(t).length > 0 && o(
|
|
26943
|
+
} else !e && Object.values(t).length > 0 && o(Ue({ roomJID: t[0]?.jid }));
|
|
26935
26944
|
return () => {
|
|
26936
26945
|
if (r?.setRoomJidInPath && typeof window < "u") {
|
|
26937
26946
|
const n = new URLSearchParams(window.location.search);
|
|
@@ -27062,11 +27071,11 @@ const pT = (e) => {
|
|
|
27062
27071
|
},
|
|
27063
27072
|
[w, g, S, o, c]
|
|
27064
27073
|
);
|
|
27065
|
-
|
|
27074
|
+
Z(() => () => {
|
|
27066
27075
|
f.current.forEach((P) => clearTimeout(P)), f.current.clear(), p.current.clear();
|
|
27067
|
-
}, []),
|
|
27076
|
+
}, []), Z(() => {
|
|
27068
27077
|
w()?.enabled || (f.current.forEach((k) => clearTimeout(k)), f.current.clear(), p.current.clear(), v(/* @__PURE__ */ new Set()));
|
|
27069
|
-
}, [w]),
|
|
27078
|
+
}, [w]), Z(() => {
|
|
27070
27079
|
w()?.enabled && Object.keys(u || {}).forEach((k) => {
|
|
27071
27080
|
if (!y.has(k)) return;
|
|
27072
27081
|
const _ = u[k];
|
|
@@ -27102,7 +27111,7 @@ const pT = (e) => {
|
|
|
27102
27111
|
},
|
|
27103
27112
|
[o]
|
|
27104
27113
|
);
|
|
27105
|
-
|
|
27114
|
+
Z(() => {
|
|
27106
27115
|
const P = m.current;
|
|
27107
27116
|
return () => {
|
|
27108
27117
|
P.forEach((k) => clearTimeout(k)), P.clear();
|
|
@@ -27461,59 +27470,59 @@ const pT = (e) => {
|
|
|
27461
27470
|
);
|
|
27462
27471
|
try {
|
|
27463
27472
|
const D = new FormData();
|
|
27464
|
-
J.forEach((
|
|
27465
|
-
const H = await B2(D, _),
|
|
27466
|
-
if (
|
|
27473
|
+
J.forEach((Y) => D.append("files", Y));
|
|
27474
|
+
const H = await B2(D, _), ee = Array.isArray(H?.data?.results) ? H.data.results : [];
|
|
27475
|
+
if (ee.length === 0)
|
|
27467
27476
|
throw new Error("media_upload_empty_response");
|
|
27468
|
-
const
|
|
27469
|
-
attachmentId:
|
|
27470
|
-
location:
|
|
27471
|
-
locationPreview:
|
|
27472
|
-
mimetype:
|
|
27473
|
-
originalName:
|
|
27474
|
-
fileName:
|
|
27475
|
-
size:
|
|
27476
|
-
duration:
|
|
27477
|
-
ownerKey:
|
|
27478
|
-
userId:
|
|
27479
|
-
createdAt:
|
|
27480
|
-
updatedAt:
|
|
27481
|
-
expiresAt:
|
|
27482
|
-
isVisible:
|
|
27483
|
-
isPrivate:
|
|
27484
|
-
})), [
|
|
27477
|
+
const re = ee.map((Y) => ({
|
|
27478
|
+
attachmentId: Y?._id,
|
|
27479
|
+
location: Y?.location,
|
|
27480
|
+
locationPreview: Y?.locationPreview,
|
|
27481
|
+
mimetype: Y?.mimetype,
|
|
27482
|
+
originalName: Y?.originalname,
|
|
27483
|
+
fileName: Y?.filename,
|
|
27484
|
+
size: Y?.size?.toString?.() ?? Y?.size,
|
|
27485
|
+
duration: Y?.duration,
|
|
27486
|
+
ownerKey: Y?.ownerKey,
|
|
27487
|
+
userId: Y?.userId,
|
|
27488
|
+
createdAt: Y?.createdAt,
|
|
27489
|
+
updatedAt: Y?.updatedAt,
|
|
27490
|
+
expiresAt: Y?.expiresAt,
|
|
27491
|
+
isVisible: Y?.isVisible,
|
|
27492
|
+
isPrivate: Y?.isPrivate
|
|
27493
|
+
})), [oe] = ee, Q = {
|
|
27485
27494
|
firstName: l.firstName,
|
|
27486
27495
|
lastName: l.lastName,
|
|
27487
27496
|
walletAddress: l.walletAddress,
|
|
27488
|
-
createdAt:
|
|
27489
|
-
expiresAt:
|
|
27490
|
-
fileName:
|
|
27491
|
-
isVisible:
|
|
27492
|
-
location:
|
|
27493
|
-
locationPreview:
|
|
27494
|
-
mimetype:
|
|
27495
|
-
originalName:
|
|
27496
|
-
ownerKey:
|
|
27497
|
-
size:
|
|
27498
|
-
duration:
|
|
27499
|
-
updatedAt:
|
|
27500
|
-
userId:
|
|
27501
|
-
attachmentId:
|
|
27497
|
+
createdAt: oe.createdAt,
|
|
27498
|
+
expiresAt: oe.expiresAt,
|
|
27499
|
+
fileName: oe.filename,
|
|
27500
|
+
isVisible: oe?.isVisible,
|
|
27501
|
+
location: oe.location,
|
|
27502
|
+
locationPreview: oe.locationPreview,
|
|
27503
|
+
mimetype: oe.mimetype,
|
|
27504
|
+
originalName: oe?.originalname,
|
|
27505
|
+
ownerKey: oe?.ownerKey,
|
|
27506
|
+
size: oe.size,
|
|
27507
|
+
duration: oe?.duration,
|
|
27508
|
+
updatedAt: oe?.updatedAt,
|
|
27509
|
+
userId: oe?.userId,
|
|
27510
|
+
attachmentId: oe?._id,
|
|
27502
27511
|
// Only stamped when there is genuinely more than one file, so
|
|
27503
27512
|
// single-file stanzas stay byte-identical to what we sent before.
|
|
27504
|
-
attachments:
|
|
27513
|
+
attachments: re.length > 1 ? y8(re) : void 0,
|
|
27505
27514
|
wrappable: !0,
|
|
27506
27515
|
roomJid: _,
|
|
27507
27516
|
showInChannel: F,
|
|
27508
27517
|
isReply: N,
|
|
27509
27518
|
mainMessage: B,
|
|
27510
|
-
isPrivate:
|
|
27511
|
-
__v:
|
|
27519
|
+
isPrivate: oe?.isPrivate,
|
|
27520
|
+
__v: oe.__v
|
|
27512
27521
|
};
|
|
27513
27522
|
if (!await M(
|
|
27514
27523
|
_,
|
|
27515
27524
|
z,
|
|
27516
|
-
() => o?.sendMediaMessageStanza(_,
|
|
27525
|
+
() => o?.sendMediaMessageStanza(_, Q, z)
|
|
27517
27526
|
))
|
|
27518
27527
|
throw new Error("media_send_failed");
|
|
27519
27528
|
a({
|
|
@@ -27528,7 +27537,7 @@ const pT = (e) => {
|
|
|
27528
27537
|
fileData: Array.isArray(P) ? P : $,
|
|
27529
27538
|
fileType: k,
|
|
27530
27539
|
messageId: z,
|
|
27531
|
-
uploadResults:
|
|
27540
|
+
uploadResults: ee
|
|
27532
27541
|
}
|
|
27533
27542
|
});
|
|
27534
27543
|
} catch (D) {
|
|
@@ -27566,7 +27575,10 @@ const pT = (e) => {
|
|
|
27566
27575
|
return G(
|
|
27567
27576
|
async (o, n, i) => {
|
|
27568
27577
|
i?.force && hs();
|
|
27569
|
-
const
|
|
27578
|
+
const s = await ps();
|
|
27579
|
+
if (s?.failed)
|
|
27580
|
+
throw new Error("Failed to load rooms");
|
|
27581
|
+
const a = s?.items || [];
|
|
27570
27582
|
return a.forEach((c) => {
|
|
27571
27583
|
t(
|
|
27572
27584
|
rn({
|
|
@@ -27574,7 +27586,7 @@ const pT = (e) => {
|
|
|
27574
27586
|
xmpp: o
|
|
27575
27587
|
})
|
|
27576
27588
|
);
|
|
27577
|
-
}), t(
|
|
27589
|
+
}), t(je({ loading: !1, loadingText: void 0 })), t(Ql({ rooms: a })), a;
|
|
27578
27590
|
},
|
|
27579
27591
|
[t]
|
|
27580
27592
|
);
|
|
@@ -27587,12 +27599,12 @@ const pT = (e) => {
|
|
|
27587
27599
|
const t = document.querySelector(
|
|
27588
27600
|
`[data-message-id="${e}"]`
|
|
27589
27601
|
);
|
|
27590
|
-
t && (t.scrollIntoView({ behavior: "smooth", block: "center" }), t.classList.add(
|
|
27602
|
+
t && (t.scrollIntoView({ behavior: "smooth", block: "center" }), t.classList.add(Et), setTimeout(() => t.classList.remove(Et), 2e3));
|
|
27591
27603
|
}, wT = (e, t, r, o) => {
|
|
27592
27604
|
const { client: n } = pt(), i = Me(), s = bg(), a = X(
|
|
27593
27605
|
null
|
|
27594
27606
|
), c = X(/* @__PURE__ */ new Set());
|
|
27595
|
-
|
|
27607
|
+
Z(() => {
|
|
27596
27608
|
if (n && e) {
|
|
27597
27609
|
n.setActiveRoomJid(e), n.promoteRoomHistory(e);
|
|
27598
27610
|
const d = n.presenceInRoomStanza(
|
|
@@ -27610,7 +27622,7 @@ const pT = (e) => {
|
|
|
27610
27622
|
});
|
|
27611
27623
|
}
|
|
27612
27624
|
n && !e && n.setActiveRoomJid(null);
|
|
27613
|
-
}, [n, e]),
|
|
27625
|
+
}, [n, e]), Z(() => {
|
|
27614
27626
|
const d = t?.[e], u = !!e && !mT(d), f = async () => {
|
|
27615
27627
|
if (!n || !e) return;
|
|
27616
27628
|
await ((a.current?.jid === e ? a.current.promise : null) || n.presenceInRoomStanza(
|
|
@@ -27619,10 +27631,10 @@ const pT = (e) => {
|
|
|
27619
27631
|
sp,
|
|
27620
27632
|
!0
|
|
27621
27633
|
)).catch(() => !1) || n.prioritizeRoomPresence(e).catch(() => {
|
|
27622
|
-
}), i(
|
|
27634
|
+
}), i(je({ loading: !0, chatJID: e }));
|
|
27623
27635
|
let v = !1;
|
|
27624
27636
|
const w = setTimeout(() => {
|
|
27625
|
-
v = !0, i(
|
|
27637
|
+
v = !0, i(je({ loading: !1, chatJID: e }));
|
|
27626
27638
|
}, yT);
|
|
27627
27639
|
try {
|
|
27628
27640
|
const S = await n.getHistoryStanza(
|
|
@@ -27637,7 +27649,7 @@ const pT = (e) => {
|
|
|
27637
27649
|
}
|
|
27638
27650
|
);
|
|
27639
27651
|
S?.length || n.prioritizeRoomPresence(e).catch(() => {
|
|
27640
|
-
}), S && op(S) > 0 && (i(
|
|
27652
|
+
}), S && op(S) > 0 && (i(je({ loading: !1, chatJID: e })), await n.getHistoryStanza(
|
|
27641
27653
|
e,
|
|
27642
27654
|
20 + op(S),
|
|
27643
27655
|
Number(S[0].id),
|
|
@@ -27649,7 +27661,7 @@ const pT = (e) => {
|
|
|
27649
27661
|
));
|
|
27650
27662
|
} finally {
|
|
27651
27663
|
clearTimeout(w), v || i(
|
|
27652
|
-
|
|
27664
|
+
je({
|
|
27653
27665
|
loading: !1,
|
|
27654
27666
|
chatJID: e,
|
|
27655
27667
|
loadingText: void 0
|
|
@@ -27667,7 +27679,9 @@ const pT = (e) => {
|
|
|
27667
27679
|
await n.getRoomsStanza();
|
|
27668
27680
|
else {
|
|
27669
27681
|
const m = e, y = String(m).split("@")[0];
|
|
27670
|
-
!(await s(n, r, { force: !0 })
|
|
27682
|
+
!(await s(n, r, { force: !0 }).catch(
|
|
27683
|
+
() => []
|
|
27684
|
+
))?.some((S) => S?.name === y) && !c.current.has(m) && (c.current.add(m), (async () => {
|
|
27671
27685
|
for (const S of vT)
|
|
27672
27686
|
if (await new Promise((b) => setTimeout(b, S)), (await s(n, r, {
|
|
27673
27687
|
force: !0
|
|
@@ -27678,13 +27692,13 @@ const pT = (e) => {
|
|
|
27678
27692
|
} else
|
|
27679
27693
|
await f();
|
|
27680
27694
|
};
|
|
27681
|
-
Object.keys(t)?.length > 0 ? e && !t?.[e] && Object.keys(t).length > 0 ? (i(
|
|
27695
|
+
Object.keys(t)?.length > 0 ? e && !t?.[e] && Object.keys(t).length > 0 ? (i(je({ loading: !0, chatJID: e })), p()) : e && u ? (i(je({ loading: !0, chatJID: e })), f()) : i(je({ loading: !1, chatJID: e })) : t?.[e] || p();
|
|
27682
27696
|
}, [
|
|
27683
27697
|
e,
|
|
27684
27698
|
Object.keys(t).length,
|
|
27685
27699
|
o,
|
|
27686
27700
|
t?.[e]?.messages?.length
|
|
27687
|
-
]),
|
|
27701
|
+
]), Z(() => {
|
|
27688
27702
|
if (!n || !e || typeof window > "u") return;
|
|
27689
27703
|
const d = typeof localStorage < "u" ? localStorage.getItem(np) : null, u = typeof localStorage < "u" ? localStorage.getItem(ip) : null;
|
|
27690
27704
|
d && (!u || u === e) && n.getHistoryStanza(e, 30, void 0, void 0, {
|
|
@@ -27696,7 +27710,7 @@ const pT = (e) => {
|
|
|
27696
27710
|
});
|
|
27697
27711
|
}, [n, e]);
|
|
27698
27712
|
const l = X(/* @__PURE__ */ new Set());
|
|
27699
|
-
|
|
27713
|
+
Z(() => {
|
|
27700
27714
|
const d = Array.isArray(r?.defaultRooms) ? r.defaultRooms : [];
|
|
27701
27715
|
if (!n || !d.length || !t) return;
|
|
27702
27716
|
const u = d.filter(
|
|
@@ -27722,7 +27736,7 @@ const pT = (e) => {
|
|
|
27722
27736
|
!1
|
|
27723
27737
|
);
|
|
27724
27738
|
}, [r]);
|
|
27725
|
-
return
|
|
27739
|
+
return Z(() => {
|
|
27726
27740
|
const s = setTimeout(() => {
|
|
27727
27741
|
i();
|
|
27728
27742
|
}, 100);
|
|
@@ -27736,7 +27750,7 @@ const pT = (e) => {
|
|
|
27736
27750
|
let n = r.key, i = r.phase;
|
|
27737
27751
|
n !== e && (n = e, i = "opening"), (n !== r.key || i !== r.phase) && o({ key: n, phase: i });
|
|
27738
27752
|
const s = X(null);
|
|
27739
|
-
return
|
|
27753
|
+
return Z(() => {
|
|
27740
27754
|
if (s.current && (clearTimeout(s.current), s.current = null), !(i !== "opening" || !e) && !t)
|
|
27741
27755
|
return s.current = setTimeout(() => {
|
|
27742
27756
|
o(
|
|
@@ -27768,7 +27782,7 @@ const pT = (e) => {
|
|
|
27768
27782
|
padding: "var(--ethora-space-4, 16px) 0"
|
|
27769
27783
|
},
|
|
27770
27784
|
children: /* @__PURE__ */ h(
|
|
27771
|
-
|
|
27785
|
+
vt,
|
|
27772
27786
|
{
|
|
27773
27787
|
"data-testid": "chat-room-opening-loader",
|
|
27774
27788
|
color: t?.colors?.primary,
|
|
@@ -27820,20 +27834,20 @@ const pT = (e) => {
|
|
|
27820
27834
|
sendEditMessage: C,
|
|
27821
27835
|
isLastMessageFromUserAndProcessing: x
|
|
27822
27836
|
} = zd(), { sendStartComposing: R, sendEndComposing: M } = xT(d), I = G(
|
|
27823
|
-
(
|
|
27824
|
-
g(
|
|
27837
|
+
(Y, ue) => {
|
|
27838
|
+
g(Y, f, void 0, void 0, void 0, ue);
|
|
27825
27839
|
},
|
|
27826
27840
|
[f, g]
|
|
27827
27841
|
), T = G(
|
|
27828
|
-
(
|
|
27842
|
+
(Y, ue) => b(Y, ue, f),
|
|
27829
27843
|
[f]
|
|
27830
27844
|
), E = G(
|
|
27831
|
-
async (
|
|
27832
|
-
if (!a && !u?.[
|
|
27845
|
+
async (Y, ue, se) => {
|
|
27846
|
+
if (!a && !u?.[Y]?.historyComplete) {
|
|
27833
27847
|
const pe = typeof se != "string" ? se : Number(
|
|
27834
|
-
u[
|
|
27848
|
+
u[Y].messages[u[Y].messages.length - 2].id
|
|
27835
27849
|
);
|
|
27836
|
-
c(!0), o?.getHistoryStanza(
|
|
27850
|
+
c(!0), o?.getHistoryStanza(Y, ue, pe, void 0, {
|
|
27837
27851
|
source: "active"
|
|
27838
27852
|
}).then(() => {
|
|
27839
27853
|
c(!1);
|
|
@@ -27844,20 +27858,20 @@ const pT = (e) => {
|
|
|
27844
27858
|
), P = () => {
|
|
27845
27859
|
s(zt({ isEdit: !1 }));
|
|
27846
27860
|
};
|
|
27847
|
-
|
|
27848
|
-
const
|
|
27861
|
+
Z(() => {
|
|
27862
|
+
const Y = Date.now();
|
|
27849
27863
|
return s(
|
|
27850
27864
|
Uc({
|
|
27851
27865
|
chatJID: f,
|
|
27852
|
-
timestamp:
|
|
27866
|
+
timestamp: Y
|
|
27853
27867
|
})
|
|
27854
27868
|
), c(!1), () => {
|
|
27855
|
-
const
|
|
27856
|
-
o && !d?.disableLastRead && o.actionSetTimestampToPrivateStoreStanza(f,
|
|
27869
|
+
const ue = Date.now();
|
|
27870
|
+
o && !d?.disableLastRead && o.actionSetTimestampToPrivateStoreStanza(f, ue)?.catch?.(() => {
|
|
27857
27871
|
}), s(
|
|
27858
27872
|
Uc({
|
|
27859
27873
|
chatJID: f,
|
|
27860
|
-
timestamp:
|
|
27874
|
+
timestamp: ue
|
|
27861
27875
|
})
|
|
27862
27876
|
), s(
|
|
27863
27877
|
Jl({
|
|
@@ -27873,8 +27887,8 @@ const pT = (e) => {
|
|
|
27873
27887
|
v.length
|
|
27874
27888
|
);
|
|
27875
27889
|
const k = f ? u?.[f] : void 0, _ = d?.noMessagesPlaceholder, N = (k?.messages?.length || 0) > 0, F = !!y, B = !!m, J = !!k?.isLoading, z = !N && k?.historyPreloadState === "loading", ie = F || B || J || z, $ = CT(f, !N && (B || J || z)), U = k?.lastMessage, D = !!U && (k?.messages || []).some(
|
|
27876
|
-
(
|
|
27877
|
-
),
|
|
27890
|
+
(Y) => !!U.id && Y.id === U.id || !!U.xmppId && !!Y.xmppId && Y.xmppId === U.xmppId
|
|
27891
|
+
), ee = !N && !!U?.body && !D ? {
|
|
27878
27892
|
...U,
|
|
27879
27893
|
id: U.id || U.xmppId || "seed-last-message",
|
|
27880
27894
|
roomJid: U.roomJid || f,
|
|
@@ -27895,11 +27909,17 @@ const pT = (e) => {
|
|
|
27895
27909
|
"chat-room-history-loader:(!hasMessages&&historyPreloadState==='loading')",
|
|
27896
27910
|
z
|
|
27897
27911
|
);
|
|
27898
|
-
const
|
|
27899
|
-
return Object.keys(u)?.length < 1
|
|
27912
|
+
const re = i === "provider" && n !== "ready" && n !== "failed", oe = !o || o.status !== "online" && o.status !== "auth_failed", Q = w && !S && !m && !y && !re && !oe, ce = w && S && !m && !y && !re && !oe;
|
|
27913
|
+
return Object.keys(u)?.length < 1 ? Q ? /* @__PURE__ */ O(Sh, { children: [
|
|
27900
27914
|
"No room. Let's create one!",
|
|
27901
27915
|
/* @__PURE__ */ h(ng, {})
|
|
27902
|
-
] }) :
|
|
27916
|
+
] }) : S ? /* @__PURE__ */ h(Sh, { children: "Couldn't load your chats. Retrying..." }) : /* @__PURE__ */ h(
|
|
27917
|
+
vt,
|
|
27918
|
+
{
|
|
27919
|
+
"data-testid": "chat-room-rooms-loader",
|
|
27920
|
+
color: d?.colors?.primary
|
|
27921
|
+
}
|
|
27922
|
+
) : !f || !u?.[f] ? /* @__PURE__ */ h(cT, { unavailable: !!f && (Q || ce) }) : /* @__PURE__ */ O(
|
|
27903
27923
|
C0,
|
|
27904
27924
|
{
|
|
27905
27925
|
"data-ethora-drop-zone": "",
|
|
@@ -27916,10 +27936,10 @@ const pT = (e) => {
|
|
|
27916
27936
|
}
|
|
27917
27937
|
),
|
|
27918
27938
|
d?.chatHeaderAdditional?.enabled && d.chatHeaderAdditional.element(),
|
|
27919
|
-
|
|
27939
|
+
ee ? /* @__PURE__ */ h(
|
|
27920
27940
|
ET,
|
|
27921
27941
|
{
|
|
27922
|
-
seedMessage:
|
|
27942
|
+
seedMessage: ee,
|
|
27923
27943
|
config: d,
|
|
27924
27944
|
xmppUsername: l?.xmppUsername,
|
|
27925
27945
|
isReply: !1,
|
|
@@ -27927,7 +27947,7 @@ const pT = (e) => {
|
|
|
27927
27947
|
loading: $ === "opening"
|
|
27928
27948
|
}
|
|
27929
27949
|
) : $ === "opening" && !N ? /* @__PURE__ */ h(
|
|
27930
|
-
|
|
27950
|
+
vt,
|
|
27931
27951
|
{
|
|
27932
27952
|
"data-testid": "chat-room-opening-loader",
|
|
27933
27953
|
color: d?.colors?.primary
|
|
@@ -27953,7 +27973,7 @@ const pT = (e) => {
|
|
|
27953
27973
|
) : _ ? /* @__PURE__ */ h(_, {}) : /* @__PURE__ */ h(ZR, {}),
|
|
27954
27974
|
p.isEdit && /* @__PURE__ */ h(yg, { text: p.text, onClose: P }),
|
|
27955
27975
|
(() => {
|
|
27956
|
-
const
|
|
27976
|
+
const Y = {
|
|
27957
27977
|
editMessage: p.text,
|
|
27958
27978
|
sendMessage: p.isEdit ? C : I,
|
|
27959
27979
|
sendMedia: T,
|
|
@@ -27968,12 +27988,12 @@ const pT = (e) => {
|
|
|
27968
27988
|
// string overrode that - the composer stayed "Type message" in
|
|
27969
27989
|
// every language. Hosts can still pass their own via
|
|
27970
27990
|
// CustomInputComponent.
|
|
27971
|
-
},
|
|
27972
|
-
...
|
|
27973
|
-
onSendMessage:
|
|
27974
|
-
onSendMedia:
|
|
27991
|
+
}, ue = {
|
|
27992
|
+
...Y,
|
|
27993
|
+
onSendMessage: Y.sendMessage,
|
|
27994
|
+
onSendMedia: Y.sendMedia
|
|
27975
27995
|
};
|
|
27976
|
-
return r ? /* @__PURE__ */ h(r, { ...
|
|
27996
|
+
return r ? /* @__PURE__ */ h(r, { ...ue }) : /* @__PURE__ */ h(eg, { ...Y });
|
|
27977
27997
|
})(),
|
|
27978
27998
|
d?.customTypingIndicator?.enabled && (d.customTypingIndicator.position === "overlay" || d.customTypingIndicator.position === "floating") && u[f]?.composing && /* @__PURE__ */ h(
|
|
27979
27999
|
Pd,
|
|
@@ -28210,7 +28230,7 @@ const RT = A.button`
|
|
|
28210
28230
|
locationPreview: o
|
|
28211
28231
|
}) => {
|
|
28212
28232
|
const n = Me(), [i, s] = K("loading");
|
|
28213
|
-
|
|
28233
|
+
Z(() => {
|
|
28214
28234
|
if (!o) {
|
|
28215
28235
|
s("loading");
|
|
28216
28236
|
return;
|
|
@@ -28293,7 +28313,7 @@ const jT = ({
|
|
|
28293
28313
|
mimetype: r
|
|
28294
28314
|
}) => {
|
|
28295
28315
|
const o = Me(), [n, i] = K(!1);
|
|
28296
|
-
|
|
28316
|
+
Z(() => {
|
|
28297
28317
|
if (i(!1), !t) return;
|
|
28298
28318
|
let a = !1;
|
|
28299
28319
|
const c = document.createElement("video");
|
|
@@ -28322,7 +28342,7 @@ const jT = ({
|
|
|
28322
28342
|
const t = ae(
|
|
28323
28343
|
(d) => d.chatSettingStore.config
|
|
28324
28344
|
), r = X(null), o = X(null), [n, i] = K(!1), [s, a] = K(1);
|
|
28325
|
-
|
|
28345
|
+
Z(() => {
|
|
28326
28346
|
let d = !1;
|
|
28327
28347
|
return import("./wavesurfer.esm-D_a19qBW.js").then(({ default: u }) => {
|
|
28328
28348
|
if (d || !r.current) return;
|
|
@@ -28408,7 +28428,7 @@ const jT = ({
|
|
|
28408
28428
|
const r = X(null), [o, n] = K(
|
|
28409
28429
|
() => typeof IntersectionObserver > "u"
|
|
28410
28430
|
);
|
|
28411
|
-
return
|
|
28431
|
+
return Z(() => {
|
|
28412
28432
|
if (typeof IntersectionObserver > "u") return;
|
|
28413
28433
|
const i = r.current;
|
|
28414
28434
|
if (!i || o && t) return;
|
|
@@ -28815,7 +28835,7 @@ const jT = ({
|
|
|
28815
28835
|
let N = I, F = T;
|
|
28816
28836
|
return I + 320 > k && (N = k - 320 - 10), T + 435 > _ && (F = _ - 435 - 10), { adjustedX: N, adjustedY: F };
|
|
28817
28837
|
};
|
|
28818
|
-
return
|
|
28838
|
+
return Z(() => {
|
|
28819
28839
|
if (typeof window > "u" || !o)
|
|
28820
28840
|
return;
|
|
28821
28841
|
const I = () => {
|
|
@@ -29358,7 +29378,7 @@ const jT = ({
|
|
|
29358
29378
|
return xc.set(e, o), o;
|
|
29359
29379
|
}, _P = ({ url: e }) => {
|
|
29360
29380
|
const [t, r] = K(null), [o, n] = K(!0), [i, s] = K(null);
|
|
29361
|
-
if (
|
|
29381
|
+
if (Z(() => {
|
|
29362
29382
|
let c = !0;
|
|
29363
29383
|
return e && (e.startsWith("http://") || e.startsWith("https://")) ? (n(!0), s(null), r(null), IP(e).then((l) => {
|
|
29364
29384
|
c && (l ? r(l) : s("Preview data not found"), n(!1));
|
|
@@ -29660,7 +29680,7 @@ const HP = A.span`
|
|
|
29660
29680
|
y: 0
|
|
29661
29681
|
}
|
|
29662
29682
|
), [k, _] = K(null);
|
|
29663
|
-
|
|
29683
|
+
Z(() => {
|
|
29664
29684
|
if (e && e.body && typeof e.body == "string") {
|
|
29665
29685
|
const se = e.body.match(WP);
|
|
29666
29686
|
_(se ? se[0] : null);
|
|
@@ -29762,18 +29782,18 @@ const HP = A.span`
|
|
|
29762
29782
|
[...e.reaction[a.xmppUsername]?.emoji || [], se],
|
|
29763
29783
|
{ firstName: a.firstName, lastName: a.lastName }
|
|
29764
29784
|
);
|
|
29765
|
-
},
|
|
29785
|
+
}, ee = f.has(e.id) || e?.pending || !1, re = !c?.disableSentLogic, oe = !!(re && t && e?.failed), Q = ge(
|
|
29766
29786
|
() => t ? null : g0(e.body),
|
|
29767
29787
|
[t, e.body]
|
|
29768
|
-
),
|
|
29788
|
+
), ce = ge(() => {
|
|
29769
29789
|
if (t) return [];
|
|
29770
|
-
const se = Ym(e.quickReplies), pe =
|
|
29790
|
+
const se = Ym(e.quickReplies), pe = Q?.buttons ?? [];
|
|
29771
29791
|
if (!pe.length) return se;
|
|
29772
29792
|
const ve = new Set(se.map((ze) => ze.value)), Ie = [...se];
|
|
29773
29793
|
for (const ze of pe)
|
|
29774
29794
|
ve.has(ze.value) || (ve.add(ze.value), Ie.push(ze));
|
|
29775
29795
|
return Ie;
|
|
29776
|
-
}, [t, e.quickReplies,
|
|
29796
|
+
}, [t, e.quickReplies, Q]), Y = G(
|
|
29777
29797
|
(se, pe) => {
|
|
29778
29798
|
i(se.value, e.roomJid);
|
|
29779
29799
|
try {
|
|
@@ -29791,8 +29811,8 @@ const HP = A.span`
|
|
|
29791
29811
|
}
|
|
29792
29812
|
},
|
|
29793
29813
|
[c?.eventHandlers, e.id, e.roomJid, i]
|
|
29794
|
-
),
|
|
29795
|
-
|
|
29814
|
+
), ue = () => {
|
|
29815
|
+
oe && zP(
|
|
29796
29816
|
{
|
|
29797
29817
|
originalMessageId: e.id,
|
|
29798
29818
|
body: e.body,
|
|
@@ -29877,7 +29897,7 @@ const HP = A.span`
|
|
|
29877
29897
|
// Muted while unsent so the bubble reads as "not landed yet"
|
|
29878
29898
|
// without shouting - the danger tone belongs on the notice below,
|
|
29879
29899
|
// which is the part carrying the action.
|
|
29880
|
-
/* @__PURE__ */ h(k0, { style: { opacity:
|
|
29900
|
+
/* @__PURE__ */ h(k0, { style: { opacity: oe ? 0.6 : 1 }, children: e.isDeleted && e.id !== "delimiter-new" ? /* @__PURE__ */ h(pP, {}) : (() => {
|
|
29881
29901
|
const se = c?.messageTextFilter?.enabled ? c.messageTextFilter.filterFunction(
|
|
29882
29902
|
g.displayText
|
|
29883
29903
|
) : g.displayText, pe = t ? se : Xo(se), ve = pe === e.body ? e.mentions : void 0, Ie = /* @__PURE__ */ h("div", { className: "message-body", children: G0({
|
|
@@ -29905,31 +29925,31 @@ const HP = A.span`
|
|
|
29905
29925
|
}
|
|
29906
29926
|
),
|
|
29907
29927
|
/* @__PURE__ */ O(Kx, { children: [
|
|
29908
|
-
|
|
29928
|
+
re && t && ee && !oe && "sending...",
|
|
29909
29929
|
e.isEdited && !e.isDeleted && /* @__PURE__ */ h(HP, { children: s("message.edited") }),
|
|
29910
29930
|
new Date(e.date).toLocaleTimeString([], {
|
|
29911
29931
|
hour: "2-digit",
|
|
29912
29932
|
minute: "2-digit"
|
|
29913
29933
|
}),
|
|
29914
|
-
|
|
29934
|
+
re && t && !ee && /* @__PURE__ */ h(GS, {})
|
|
29915
29935
|
] }),
|
|
29916
|
-
|
|
29936
|
+
ce.length > 0 && !e.isDeleted && /* @__PURE__ */ h(
|
|
29917
29937
|
BP,
|
|
29918
29938
|
{
|
|
29919
|
-
replies:
|
|
29939
|
+
replies: ce,
|
|
29920
29940
|
messageId: e.id,
|
|
29921
29941
|
accentColor: c?.colors?.primary,
|
|
29922
29942
|
answered: S8(e.id),
|
|
29923
|
-
onSelect:
|
|
29943
|
+
onSelect: Y
|
|
29924
29944
|
}
|
|
29925
29945
|
),
|
|
29926
|
-
|
|
29946
|
+
oe && /* @__PURE__ */ O(VP, { children: [
|
|
29927
29947
|
/* @__PURE__ */ h("span", { children: s("message.notDelivered") }),
|
|
29928
29948
|
/* @__PURE__ */ h(
|
|
29929
29949
|
qP,
|
|
29930
29950
|
{
|
|
29931
29951
|
type: "button",
|
|
29932
|
-
onClick:
|
|
29952
|
+
onClick: ue,
|
|
29933
29953
|
"aria-label": s("message.retryAriaLabel"),
|
|
29934
29954
|
children: s("message.retry")
|
|
29935
29955
|
}
|
|
@@ -30232,22 +30252,22 @@ const HP = A.span`
|
|
|
30232
30252
|
}
|
|
30233
30253
|
`, YP = {
|
|
30234
30254
|
[Le.SETTINGS]: xr(
|
|
30235
|
-
() => import("./UserSettingsModal-
|
|
30255
|
+
() => import("./UserSettingsModal-J7uJfki1.js")
|
|
30236
30256
|
),
|
|
30237
30257
|
[Le.PROFILE]: xr(
|
|
30238
|
-
() => import("./UserProfileModal-
|
|
30258
|
+
() => import("./UserProfileModal-CD2IB5SD.js")
|
|
30239
30259
|
),
|
|
30240
30260
|
[Le.CHAT_PROFILE]: xr(
|
|
30241
|
-
() => import("./ChatProfileModal-
|
|
30261
|
+
() => import("./ChatProfileModal-DZVi2WRb.js")
|
|
30242
30262
|
),
|
|
30243
30263
|
[Le.MANAGE_DATA]: xr(
|
|
30244
|
-
() => import("./ManageDataModal-
|
|
30264
|
+
() => import("./ManageDataModal-Bs_0SHBL.js")
|
|
30245
30265
|
),
|
|
30246
30266
|
[Le.VISIBILITY]: xr(
|
|
30247
|
-
() => import("./VisibilityModal-
|
|
30267
|
+
() => import("./VisibilityModal-4QJnWpAL.js")
|
|
30248
30268
|
),
|
|
30249
30269
|
[Le.FILE_PREVIEW]: xr(
|
|
30250
|
-
() => import("./FilePreviewModal-
|
|
30270
|
+
() => import("./FilePreviewModal-BelSYN5e.js")
|
|
30251
30271
|
)
|
|
30252
30272
|
}, Mg = ({ modal: e, setOpenModal: t }) => {
|
|
30253
30273
|
const r = Me(), o = () => t(), n = () => r(Ke(Le.SETTINGS)), i = sg.includes(e), s = X(null), a = X(0);
|
|
@@ -30255,7 +30275,7 @@ const HP = A.span`
|
|
|
30255
30275
|
enabled: !!e,
|
|
30256
30276
|
onClose: i ? n : o,
|
|
30257
30277
|
containerRef: s
|
|
30258
|
-
}),
|
|
30278
|
+
}), Z(() => {
|
|
30259
30279
|
if (!e) return;
|
|
30260
30280
|
const d = s.current;
|
|
30261
30281
|
if (!d) return;
|
|
@@ -30381,7 +30401,7 @@ function nA(e, t) {
|
|
|
30381
30401
|
const [r, o] = K(!1), n = X(e);
|
|
30382
30402
|
n.current = e;
|
|
30383
30403
|
const i = X(), s = X(!1);
|
|
30384
|
-
return
|
|
30404
|
+
return Z(() => () => clearTimeout(i.current), []), { requestAction: () => {
|
|
30385
30405
|
if (!s.current) {
|
|
30386
30406
|
if (S0()) {
|
|
30387
30407
|
n.current();
|
|
@@ -30766,9 +30786,9 @@ const iA = A(C0)`
|
|
|
30766
30786
|
return o ? `${r}@${o}` : "";
|
|
30767
30787
|
}, hA = (e, t, r) => {
|
|
30768
30788
|
const [o, n] = K(!1), [i, s] = K(null), a = r?.rooms, c = r?.activeRoomJID, l = r?.isReady, d = X(e);
|
|
30769
|
-
return d.current = e,
|
|
30789
|
+
return d.current = e, Z(() => {
|
|
30770
30790
|
typeof window < "u" && uA();
|
|
30771
|
-
}, []),
|
|
30791
|
+
}, []), Z(() => {
|
|
30772
30792
|
if (!(typeof window > "u"))
|
|
30773
30793
|
try {
|
|
30774
30794
|
const u = dA();
|
|
@@ -30792,7 +30812,7 @@ const iA = A(C0)`
|
|
|
30792
30812
|
dispatch: o
|
|
30793
30813
|
}) => {
|
|
30794
30814
|
if (e) {
|
|
30795
|
-
o(
|
|
30815
|
+
o(Ue({ roomJID: e }));
|
|
30796
30816
|
return;
|
|
30797
30817
|
}
|
|
30798
30818
|
if (!t && typeof window < "u") {
|
|
@@ -30802,7 +30822,7 @@ const iA = A(C0)`
|
|
|
30802
30822
|
if (!a) return;
|
|
30803
30823
|
const c = i.includes("@") ? i : `${i}@${a}`;
|
|
30804
30824
|
s && typeof localStorage < "u" && (localStorage.setItem(pA, s), localStorage.setItem(mA, c)), o(
|
|
30805
|
-
|
|
30825
|
+
Ue({
|
|
30806
30826
|
roomJID: c
|
|
30807
30827
|
})
|
|
30808
30828
|
);
|
|
@@ -31005,16 +31025,16 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31005
31025
|
const { roomsList: M, activeRoomJID: I } = Ot(), { user: T } = ke(), E = X({}), P = X({}), k = (D) => {
|
|
31006
31026
|
E.current[D] = Date.now();
|
|
31007
31027
|
}, _ = (D, H) => {
|
|
31008
|
-
const
|
|
31009
|
-
if (!
|
|
31010
|
-
const
|
|
31011
|
-
P.current[D] =
|
|
31028
|
+
const ee = E.current[H];
|
|
31029
|
+
if (!ee) return;
|
|
31030
|
+
const re = Date.now() - ee;
|
|
31031
|
+
P.current[D] = re, q.log(`[InitTiming] ${D} ${re}ms`);
|
|
31012
31032
|
}, N = () => {
|
|
31013
31033
|
v.current || (v.current = setTimeout(() => {
|
|
31014
|
-
const D = E.current, H = P.current,
|
|
31015
|
-
Object.keys(H).forEach((
|
|
31016
|
-
re
|
|
31017
|
-
}), Object.keys(
|
|
31034
|
+
const D = E.current, H = P.current, ee = {};
|
|
31035
|
+
Object.keys(H).forEach((re) => {
|
|
31036
|
+
ee[re] = H[re];
|
|
31037
|
+
}), Object.keys(ee).length === 0 && [
|
|
31018
31038
|
"xmpp:initClient:start",
|
|
31019
31039
|
"initClient:create_instance:start",
|
|
31020
31040
|
"initClient:wait_online:start",
|
|
@@ -31024,63 +31044,63 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31024
31044
|
"bg:getChatsPrivateStore:start",
|
|
31025
31045
|
"bg:stagedPreload:start",
|
|
31026
31046
|
"bg:updateMessagesTillLast:start"
|
|
31027
|
-
].forEach((
|
|
31028
|
-
D[
|
|
31029
|
-
}), q.log("[InitTiming] startup_summary",
|
|
31047
|
+
].forEach((re) => {
|
|
31048
|
+
D[re] && (ee[re] = Date.now() - D[re]);
|
|
31049
|
+
}), q.log("[InitTiming] startup_summary", ee);
|
|
31030
31050
|
}, 1e4));
|
|
31031
31051
|
}, F = async (D, H = 3e4) => {
|
|
31032
|
-
const
|
|
31033
|
-
return new Promise((
|
|
31034
|
-
const
|
|
31052
|
+
const ee = Date.now();
|
|
31053
|
+
return new Promise((re) => {
|
|
31054
|
+
const oe = () => {
|
|
31035
31055
|
if (D?.checkOnline?.()) {
|
|
31036
|
-
|
|
31056
|
+
re(!0);
|
|
31037
31057
|
return;
|
|
31038
31058
|
}
|
|
31039
|
-
if (Date.now() -
|
|
31040
|
-
|
|
31059
|
+
if (Date.now() - ee > H) {
|
|
31060
|
+
re(!1);
|
|
31041
31061
|
return;
|
|
31042
31062
|
}
|
|
31043
|
-
setTimeout(
|
|
31063
|
+
setTimeout(oe, 200);
|
|
31044
31064
|
};
|
|
31045
|
-
|
|
31065
|
+
oe();
|
|
31046
31066
|
});
|
|
31047
31067
|
}, B = async (D, H = 12e3) => {
|
|
31048
|
-
const
|
|
31049
|
-
return new Promise((
|
|
31050
|
-
const
|
|
31068
|
+
const ee = Date.now();
|
|
31069
|
+
return new Promise((re) => {
|
|
31070
|
+
const oe = () => {
|
|
31051
31071
|
if (D.presencesReady) {
|
|
31052
|
-
|
|
31072
|
+
re(!0);
|
|
31053
31073
|
return;
|
|
31054
31074
|
}
|
|
31055
|
-
if (Date.now() -
|
|
31056
|
-
|
|
31075
|
+
if (Date.now() - ee > H) {
|
|
31076
|
+
re(!1);
|
|
31057
31077
|
return;
|
|
31058
31078
|
}
|
|
31059
|
-
setTimeout(
|
|
31079
|
+
setTimeout(oe, 150);
|
|
31060
31080
|
};
|
|
31061
|
-
|
|
31081
|
+
oe();
|
|
31062
31082
|
});
|
|
31063
31083
|
}, J = async (D = 6e3) => {
|
|
31064
31084
|
const H = Date.now();
|
|
31065
|
-
return new Promise((
|
|
31066
|
-
const
|
|
31067
|
-
const
|
|
31068
|
-
if (!
|
|
31069
|
-
|
|
31085
|
+
return new Promise((ee) => {
|
|
31086
|
+
const re = () => {
|
|
31087
|
+
const oe = j.getState().rooms, Q = oe.activeRoomJID, ce = Q ? oe.rooms?.[Q] : null;
|
|
31088
|
+
if (!Q || !ce) {
|
|
31089
|
+
ee(!0);
|
|
31070
31090
|
return;
|
|
31071
31091
|
}
|
|
31072
|
-
const
|
|
31073
|
-
if (!
|
|
31074
|
-
|
|
31092
|
+
const Y = (ce.messages?.length || 0) > 0, ue = ce.historyPreloadState === "done" || ce.historyPreloadState === "partial" || ce.historyPreloadState === "error";
|
|
31093
|
+
if (!ce.isLoading || Y || ue) {
|
|
31094
|
+
ee(!0);
|
|
31075
31095
|
return;
|
|
31076
31096
|
}
|
|
31077
31097
|
if (Date.now() - H > D) {
|
|
31078
|
-
|
|
31098
|
+
ee(!1);
|
|
31079
31099
|
return;
|
|
31080
31100
|
}
|
|
31081
|
-
setTimeout(
|
|
31101
|
+
setTimeout(re, 120);
|
|
31082
31102
|
};
|
|
31083
|
-
|
|
31103
|
+
re();
|
|
31084
31104
|
});
|
|
31085
31105
|
}, z = (D) => {
|
|
31086
31106
|
const H = D.client?.jid?.toString() || D.username || "xmpp-client";
|
|
@@ -31094,8 +31114,8 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31094
31114
|
k("bg:initRoomsPresence:start");
|
|
31095
31115
|
try {
|
|
31096
31116
|
await yA(D, M), _("bg:initRoomsPresence", "bg:initRoomsPresence:start");
|
|
31097
|
-
} catch (
|
|
31098
|
-
console.warn("[InitTiming] bg:initRoomsPresence:error",
|
|
31117
|
+
} catch (re) {
|
|
31118
|
+
console.warn("[InitTiming] bg:initRoomsPresence:error", re);
|
|
31099
31119
|
}
|
|
31100
31120
|
}
|
|
31101
31121
|
})(), (async () => {
|
|
@@ -31106,77 +31126,77 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31106
31126
|
else {
|
|
31107
31127
|
m.current.add(H), k("bg:getChatsPrivateStore:start");
|
|
31108
31128
|
try {
|
|
31109
|
-
const
|
|
31129
|
+
const ue = await D.getChatsPrivateStoreRequestStanza();
|
|
31110
31130
|
F2(
|
|
31111
|
-
|
|
31131
|
+
ue,
|
|
31112
31132
|
o
|
|
31113
31133
|
), _("bg:getChatsPrivateStore", "bg:getChatsPrivateStore:start");
|
|
31114
|
-
} catch (
|
|
31115
|
-
m.current.delete(H), console.warn("[InitTiming] bg:getChatsPrivateStore:error",
|
|
31134
|
+
} catch (ue) {
|
|
31135
|
+
m.current.delete(H), console.warn("[InitTiming] bg:getChatsPrivateStore:error", ue);
|
|
31116
31136
|
}
|
|
31117
31137
|
}
|
|
31118
31138
|
if (f.current || y.current.has(H)) return;
|
|
31119
31139
|
y.current.add(H);
|
|
31120
|
-
const
|
|
31140
|
+
const re = !!r?.historyQoS?.stagedPreloadEnabled, oe = Math.max(
|
|
31121
31141
|
1,
|
|
31122
31142
|
Number(r?.historyQoS?.stagedPreloadFirstPassSize || 1)
|
|
31123
|
-
),
|
|
31143
|
+
), Q = Math.max(
|
|
31124
31144
|
1,
|
|
31125
31145
|
Number(r?.historyQoS?.stagedPreloadSecondPassSize || 15)
|
|
31126
|
-
),
|
|
31146
|
+
), ce = Math.max(
|
|
31127
31147
|
1,
|
|
31128
31148
|
Number(r?.historyQoS?.stagedPreloadConcurrency || 3)
|
|
31129
|
-
),
|
|
31149
|
+
), Y = Math.max(
|
|
31130
31150
|
1,
|
|
31131
31151
|
Number(r?.historyQoS?.preloadTopKRooms || 20)
|
|
31132
31152
|
);
|
|
31133
31153
|
k(
|
|
31134
|
-
|
|
31154
|
+
re ? "bg:stagedPreload:start" : "bg:updateMessagesTillLast:start"
|
|
31135
31155
|
);
|
|
31136
31156
|
try {
|
|
31137
|
-
if (await J(),
|
|
31138
|
-
const
|
|
31157
|
+
if (await J(), re) {
|
|
31158
|
+
const ue = (r?.defaultRooms || []).map(
|
|
31139
31159
|
(ve) => ve.jid
|
|
31140
|
-
), pe = !!j.getState().rooms.activeRoomJID ? 1 :
|
|
31160
|
+
), pe = !!j.getState().rooms.activeRoomJID ? 1 : ce;
|
|
31141
31161
|
await tl({
|
|
31142
31162
|
client: D,
|
|
31143
31163
|
concurrency: pe,
|
|
31144
|
-
pageSize:
|
|
31164
|
+
pageSize: oe,
|
|
31145
31165
|
retryLimit: 2,
|
|
31146
|
-
roomLimit:
|
|
31166
|
+
roomLimit: Y,
|
|
31147
31167
|
selectedRoomJid: j.getState().rooms.activeRoomJID || null,
|
|
31148
|
-
defaultRoomJids:
|
|
31168
|
+
defaultRoomJids: ue,
|
|
31149
31169
|
// Teaser pass: mark rooms 'partial' so the second pass below
|
|
31150
31170
|
// still fetches the real page (marking them 'done' here made
|
|
31151
31171
|
// the second pass skip every room, leaving 1-message rooms).
|
|
31152
31172
|
completionState: "partial"
|
|
31153
31173
|
}), await tl({
|
|
31154
31174
|
client: D,
|
|
31155
|
-
concurrency:
|
|
31156
|
-
pageSize:
|
|
31175
|
+
concurrency: ce,
|
|
31176
|
+
pageSize: Q,
|
|
31157
31177
|
retryLimit: 2,
|
|
31158
31178
|
selectedRoomJid: j.getState().rooms.activeRoomJID || null,
|
|
31159
|
-
defaultRoomJids:
|
|
31179
|
+
defaultRoomJids: ue
|
|
31160
31180
|
});
|
|
31161
31181
|
} else {
|
|
31162
|
-
const
|
|
31163
|
-
await vA(
|
|
31182
|
+
const ue = j.getState().rooms.rooms || {}, se = j.getState().rooms.activeRoomJID ? 1 : 2;
|
|
31183
|
+
await vA(ue, D, se);
|
|
31164
31184
|
}
|
|
31165
|
-
f.current = !0,
|
|
31166
|
-
} catch (
|
|
31185
|
+
f.current = !0, re ? _("bg:stagedPreload", "bg:stagedPreload:start") : _("bg:updateMessagesTillLast", "bg:updateMessagesTillLast:start");
|
|
31186
|
+
} catch (ue) {
|
|
31167
31187
|
y.current.delete(H), console.warn(
|
|
31168
|
-
|
|
31169
|
-
|
|
31188
|
+
re ? "[InitTiming] bg:stagedPreload:error" : "[InitTiming] bg:updateMessagesTillLast:error",
|
|
31189
|
+
ue
|
|
31170
31190
|
);
|
|
31171
31191
|
}
|
|
31172
31192
|
})();
|
|
31173
31193
|
};
|
|
31174
|
-
|
|
31194
|
+
Z(() => () => {
|
|
31175
31195
|
w && T.xmppPassword === "" && (q.log("closing client"), w.close(), g(null));
|
|
31176
|
-
}, [w, g, T.xmppPassword]),
|
|
31196
|
+
}, [w, g, T.xmppPassword]), Z(() => {
|
|
31177
31197
|
o(ql(r));
|
|
31178
31198
|
const { changed: D } = V2(r);
|
|
31179
|
-
D && (f.current = !1, p.current.clear(), m.current.clear(), y.current.clear(), o(Gl()), o(bm()), o(
|
|
31199
|
+
D && (f.current = !1, p.current.clear(), m.current.clear(), y.current.clear(), o(Gl()), o(bm()), o(Ue({ roomJID: null })), Or.pause(), Or.purge().catch((H) => {
|
|
31180
31200
|
console.warn("[CacheScope] Persist purge failed", H);
|
|
31181
31201
|
}).finally(() => {
|
|
31182
31202
|
Or.persist();
|
|
@@ -31195,10 +31215,10 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31195
31215
|
u(!1);
|
|
31196
31216
|
}, L = async (D, H = !1) => {
|
|
31197
31217
|
!H && o(
|
|
31198
|
-
|
|
31218
|
+
je({ loading: !0, loadingText: "Loading chats..." })
|
|
31199
31219
|
), k("loadRooms:start");
|
|
31200
|
-
const
|
|
31201
|
-
return _("loadRooms", "loadRooms:start"), await D.sendAllPresencesAndMarkReady(), o(
|
|
31220
|
+
const ee = await x(D, r);
|
|
31221
|
+
return _("loadRooms", "loadRooms:start"), await D.sendAllPresencesAndMarkReady(), o(je({ loading: !1, loadingText: void 0 })), ee;
|
|
31202
31222
|
}, $ = G((D) => {
|
|
31203
31223
|
if (!D) return "";
|
|
31204
31224
|
if (D.jid) return D.jid;
|
|
@@ -31207,64 +31227,71 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31207
31227
|
}, [r?.xmppSettings?.conference]), U = G((D) => {
|
|
31208
31228
|
const H = (D || []).map($).filter(Boolean);
|
|
31209
31229
|
if (H.length === 0) return;
|
|
31210
|
-
const
|
|
31211
|
-
if (
|
|
31212
|
-
I !==
|
|
31230
|
+
const ee = e || null;
|
|
31231
|
+
if (ee && H.includes(ee)) {
|
|
31232
|
+
I !== ee && o(Ue({ roomJID: ee }));
|
|
31213
31233
|
return;
|
|
31214
31234
|
}
|
|
31215
31235
|
I && H.includes(I);
|
|
31216
31236
|
}, [I, o, $, e]);
|
|
31217
|
-
return
|
|
31237
|
+
return Z(() => {
|
|
31218
31238
|
const D = SA(
|
|
31219
31239
|
r?.translates?.readerLocale
|
|
31220
31240
|
);
|
|
31221
31241
|
D && o(Dc(D));
|
|
31222
|
-
}, [r?.translates?.readerLocale, o]),
|
|
31223
|
-
let D;
|
|
31224
|
-
const
|
|
31225
|
-
|
|
31226
|
-
|
|
31242
|
+
}, [r?.translates?.readerLocale, o]), Z(() => {
|
|
31243
|
+
let D, H = !1;
|
|
31244
|
+
const ee = async (oe) => {
|
|
31245
|
+
try {
|
|
31246
|
+
const Q = await L(oe);
|
|
31247
|
+
return H = !1, R(!0), Q;
|
|
31248
|
+
} catch (Q) {
|
|
31249
|
+
return q.log("loadRooms failed", Q), H = !0, R(!1), o(je({ loading: !1, loadingText: void 0 })), clearTimeout(D), D = setTimeout(re, 5e3), null;
|
|
31250
|
+
}
|
|
31251
|
+
}, re = async () => {
|
|
31252
|
+
const oe = xA(r?.translates);
|
|
31253
|
+
oe && o(Dc(oe));
|
|
31227
31254
|
try {
|
|
31228
31255
|
if (T.xmppUsername)
|
|
31229
31256
|
if (gA({ roomJID: e, wasAutoSelected: t, config: r, dispatch: o }), w) {
|
|
31230
31257
|
if (r?.newArch !== !1) {
|
|
31231
|
-
let
|
|
31258
|
+
let Q = [];
|
|
31232
31259
|
if (!M || Object.keys(M).length === 0) {
|
|
31233
31260
|
i(!1);
|
|
31234
|
-
const
|
|
31235
|
-
U(
|
|
31261
|
+
const ce = await ee(w);
|
|
31262
|
+
U(ce), Q = Array.isArray(ce) ? ce : [];
|
|
31236
31263
|
} else
|
|
31237
|
-
U(Object.values(M)),
|
|
31238
|
-
q.log("background loadRooms failed",
|
|
31264
|
+
U(Object.values(M)), Q = Object.values(M), L(w, !0).catch((ce) => {
|
|
31265
|
+
q.log("background loadRooms failed", ce);
|
|
31239
31266
|
});
|
|
31240
31267
|
r?.enableRoomsRetry?.enabled && (Tl(
|
|
31241
31268
|
e,
|
|
31242
|
-
|
|
31269
|
+
Q
|
|
31243
31270
|
) || await ie());
|
|
31244
31271
|
}
|
|
31245
|
-
i(!0), R(!0), g(w), l(!1), o(
|
|
31272
|
+
i(!0), H || R(!0), g(w), l(!1), o(je({ loading: !1 })), N(), z(w), r?.refreshTokens?.enabled && Xc();
|
|
31246
31273
|
} else {
|
|
31247
31274
|
if (r?.initBeforeLoad && C === "provider" && b !== "idle") {
|
|
31248
31275
|
if (b === "failed") {
|
|
31249
|
-
o(
|
|
31276
|
+
o(je({ loading: !1, loadingText: void 0 })), l(!0), i(!1), q.log(
|
|
31250
31277
|
"[InitPolicy] initBeforeLoad=true and provider bootstrap failed. ChatWrapper init is locked."
|
|
31251
|
-
), D = setTimeout(
|
|
31278
|
+
), D = setTimeout(re, 2e3);
|
|
31252
31279
|
return;
|
|
31253
31280
|
}
|
|
31254
31281
|
o(
|
|
31255
|
-
|
|
31282
|
+
je({ loading: !0, loadingText: "Connecting..." })
|
|
31256
31283
|
), l(!1), q.log(
|
|
31257
31284
|
`[InitPolicy] initBeforeLoad=true, waiting provider client (status=${b})`
|
|
31258
|
-
), D = setTimeout(
|
|
31285
|
+
), D = setTimeout(re, 400);
|
|
31259
31286
|
return;
|
|
31260
31287
|
}
|
|
31261
31288
|
try {
|
|
31262
31289
|
o(
|
|
31263
|
-
|
|
31290
|
+
je({ loading: !0, loadingText: "Connecting..." })
|
|
31264
31291
|
), i(!1), a(!1), o(
|
|
31265
|
-
|
|
31292
|
+
je({ loading: !0, loadingText: "Connecting..." })
|
|
31266
31293
|
), q.log("No client, so initing one"), k("xmpp:initClient:start"), k("initClient:create_instance:start"), k("initClient:wait_online:start");
|
|
31267
|
-
const
|
|
31294
|
+
const Q = await S(
|
|
31268
31295
|
T.xmppUsername || T?.defaultWallet?.walletAddress,
|
|
31269
31296
|
T?.xmppPassword,
|
|
31270
31297
|
{
|
|
@@ -31273,35 +31300,35 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31273
31300
|
historyQoS: r?.historyQoS
|
|
31274
31301
|
},
|
|
31275
31302
|
M
|
|
31276
|
-
).then((
|
|
31303
|
+
).then((ce) => ce);
|
|
31277
31304
|
if (_("xmpp:initClient", "xmpp:initClient:start"), _("initClient:create_instance", "initClient:create_instance:start"), M && Object.keys(M).length > 0)
|
|
31278
|
-
i(!0), R(!0), r?.newArch !== !1 && L(
|
|
31279
|
-
q.log("background loadRooms failed",
|
|
31305
|
+
i(!0), R(!0), r?.newArch !== !1 && L(Q, !0).catch((ce) => {
|
|
31306
|
+
q.log("background loadRooms failed", ce);
|
|
31280
31307
|
});
|
|
31281
31308
|
else if (r?.newArch === !1)
|
|
31282
|
-
k("xmpp:getRoomsStanza:start"), await
|
|
31309
|
+
k("xmpp:getRoomsStanza:start"), await Q.getRoomsStanza(), _("xmpp:getRoomsStanza", "xmpp:getRoomsStanza:start");
|
|
31283
31310
|
else {
|
|
31284
|
-
const
|
|
31285
|
-
U(
|
|
31311
|
+
const ce = await ee(Q);
|
|
31312
|
+
ce && (U(ce), r?.enableRoomsRetry?.enabled && (Tl(
|
|
31286
31313
|
e,
|
|
31287
|
-
|
|
31288
|
-
) || await ie()), i(!0)
|
|
31314
|
+
ce
|
|
31315
|
+
) || await ie()), i(!0));
|
|
31289
31316
|
}
|
|
31290
|
-
g(
|
|
31291
|
-
} catch (
|
|
31292
|
-
q.log("err",
|
|
31317
|
+
g(Q), l(!1), o(je({ loading: !1 })), N(), z(Q), r?.refreshTokens?.enabled && Xc();
|
|
31318
|
+
} catch (Q) {
|
|
31319
|
+
q.log("err", Q), l(!0), R(!1), D = setTimeout(re, 5e3);
|
|
31293
31320
|
}
|
|
31294
31321
|
}
|
|
31295
31322
|
else {
|
|
31296
|
-
a(!1), o(
|
|
31323
|
+
a(!1), o(je({ loading: !1, loadingText: void 0 })), q.log("No user yet, waiting for login");
|
|
31297
31324
|
return;
|
|
31298
31325
|
}
|
|
31299
|
-
o(
|
|
31300
|
-
} catch (
|
|
31301
|
-
a(!1), l(!0), i(!1), o(
|
|
31326
|
+
o(je({ loading: !1 }));
|
|
31327
|
+
} catch (Q) {
|
|
31328
|
+
a(!1), l(!0), i(!1), o(je({ loading: !1 })), R(!1), q.log(Q), D = setTimeout(re, 5e3);
|
|
31302
31329
|
}
|
|
31303
31330
|
};
|
|
31304
|
-
return
|
|
31331
|
+
return re(), () => {
|
|
31305
31332
|
clearTimeout(D), v.current && (clearTimeout(v.current), v.current = null);
|
|
31306
31333
|
};
|
|
31307
31334
|
}, [
|
|
@@ -31311,21 +31338,21 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31311
31338
|
r?.initBeforeLoad,
|
|
31312
31339
|
C,
|
|
31313
31340
|
b
|
|
31314
|
-
]),
|
|
31341
|
+
]), Z(() => {
|
|
31315
31342
|
w && E.current["initClient:wait_online:start"] && w.status === "online" && _("initClient:wait_online", "initClient:wait_online:start");
|
|
31316
|
-
}, [w?.status]),
|
|
31343
|
+
}, [w?.status]), Z(() => {
|
|
31317
31344
|
if (!w) return;
|
|
31318
31345
|
l(Cp(w.status));
|
|
31319
31346
|
const D = setInterval(() => {
|
|
31320
31347
|
l((H) => {
|
|
31321
|
-
const
|
|
31322
|
-
return H ===
|
|
31348
|
+
const ee = Cp(w.status);
|
|
31349
|
+
return H === ee ? H : ee;
|
|
31323
31350
|
});
|
|
31324
31351
|
}, 1e3);
|
|
31325
31352
|
return () => clearInterval(D);
|
|
31326
|
-
}, [w]),
|
|
31353
|
+
}, [w]), Z(() => {
|
|
31327
31354
|
U(Object.values(M));
|
|
31328
|
-
}, [M, I, U]),
|
|
31355
|
+
}, [M, I, U]), Z(() => (o(O1(!0)), () => {
|
|
31329
31356
|
o(O1(!1));
|
|
31330
31357
|
}), [o]), {
|
|
31331
31358
|
client: w,
|
|
@@ -31430,7 +31457,7 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31430
31457
|
const s = X(
|
|
31431
31458
|
null
|
|
31432
31459
|
);
|
|
31433
|
-
|
|
31460
|
+
Z(() => {
|
|
31434
31461
|
const a = s.current;
|
|
31435
31462
|
if (s.current = { threadOpen: e, panelOpen: t }, !(!e || !t)) {
|
|
31436
31463
|
if (!a) {
|
|
@@ -31452,23 +31479,23 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31452
31479
|
const { CustomMessageComponent: o } = ks(), n = o || XP, { user: i, activeModal: s, deleteModal: a } = ke(), [c, l] = K(!1), [d, u] = K(
|
|
31453
31480
|
() => typeof window < "u" && window.innerWidth < 768
|
|
31454
31481
|
), [f, p] = K(!0), m = t?.xmppSettings?.conference, y = Me();
|
|
31455
|
-
|
|
31482
|
+
Z(() => {
|
|
31456
31483
|
if (typeof window > "u")
|
|
31457
31484
|
return;
|
|
31458
|
-
const
|
|
31485
|
+
const Y = () => {
|
|
31459
31486
|
u(window.innerWidth < 768);
|
|
31460
31487
|
};
|
|
31461
|
-
return
|
|
31462
|
-
typeof window < "u" && window.removeEventListener("resize",
|
|
31488
|
+
return Y(), window.addEventListener("resize", Y), () => {
|
|
31489
|
+
typeof window < "u" && window.removeEventListener("resize", Y);
|
|
31463
31490
|
};
|
|
31464
31491
|
}, []);
|
|
31465
|
-
const v = (
|
|
31466
|
-
l(
|
|
31467
|
-
}, w = ae((
|
|
31468
|
-
(
|
|
31492
|
+
const v = (Y) => {
|
|
31493
|
+
l(Y);
|
|
31494
|
+
}, w = ae((Y) => Y.rooms.rooms), S = ae((Y) => Y.rooms.activeRoomJID), g = ae((Y) => Y.rooms.isLoading), b = ae(
|
|
31495
|
+
(Y) => !!Y.rooms?.reportRoom?.isOpen
|
|
31469
31496
|
), { loadingText: C } = Ot(), { wasAutoSelected: x } = hA(
|
|
31470
31497
|
G(
|
|
31471
|
-
(
|
|
31498
|
+
(Y) => y(Ue(Y)),
|
|
31472
31499
|
[y]
|
|
31473
31500
|
),
|
|
31474
31501
|
m,
|
|
@@ -31478,7 +31505,7 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31478
31505
|
isReady: !g && Object.keys(w || {}).length > 0
|
|
31479
31506
|
}
|
|
31480
31507
|
), R = X(null);
|
|
31481
|
-
|
|
31508
|
+
Z(() => {
|
|
31482
31509
|
d && S && (!x && !r || R.current !== S && (R.current = S, l(!0)));
|
|
31483
31510
|
}, [d, S, x, r]);
|
|
31484
31511
|
const M = Go(
|
|
@@ -31487,10 +31514,10 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31487
31514
|
), I = Go(b, pl), T = ge(() => Object.values(w), [w]), E = ge(() => {
|
|
31488
31515
|
if (S)
|
|
31489
31516
|
return w[S]?.messages?.find(
|
|
31490
|
-
(
|
|
31517
|
+
(Y) => Y?.activeMessage
|
|
31491
31518
|
);
|
|
31492
|
-
}, [w, S]), P = (
|
|
31493
|
-
y(
|
|
31519
|
+
}, [w, S]), P = (Y) => {
|
|
31520
|
+
y(Ue({ roomJID: null })), y(je({ chatJID: Y.jid, loading: !0 })), y(Ue({ roomJID: Y.jid })), y(zt({ isEdit: !1 })), z?.promoteRoomHistory(Y.jid), v(!0), !Y?.historyComplete && Y.messages?.length < 30 && z?.getHistoryStanza(Y.jid, 30, void 0, void 0, {
|
|
31494
31521
|
source: "active",
|
|
31495
31522
|
coalesceRoom: !0,
|
|
31496
31523
|
skipIfPreloaded: !0
|
|
@@ -31519,17 +31546,17 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31519
31546
|
roomJID: r,
|
|
31520
31547
|
wasAutoSelected: x,
|
|
31521
31548
|
config: t
|
|
31522
|
-
}), H = Object.keys(w || {}).length > 0,
|
|
31523
|
-
return _t("chat-wrapper-connecting-loader",
|
|
31549
|
+
}), H = Object.keys(w || {}).length > 0, re = (ie || !!z && !D && H) && !(g && !H), oe = D && !ie, Q = !!(t?.enableRoomsRetry?.enabled && L && L !== "norooms"), ce = !$ && !oe && !Q && i.xmppPassword !== "" && i.xmppUsername !== "" && f && !re;
|
|
31550
|
+
return _t("chat-wrapper-connecting-loader", oe), _t("chat-wrapper-retry-loader", Q), _t("chat-wrapper-startup-loader", ce), Z(() => {
|
|
31524
31551
|
if (typeof window > "u") return;
|
|
31525
|
-
const
|
|
31526
|
-
const pe = window.location.pathname ===
|
|
31527
|
-
p(pe), !pe && S && y(
|
|
31552
|
+
const Y = window.location.pathname, ue = () => {
|
|
31553
|
+
const pe = window.location.pathname === Y;
|
|
31554
|
+
p(pe), !pe && S && y(Ue({ roomJID: null }));
|
|
31528
31555
|
};
|
|
31529
|
-
|
|
31530
|
-
const se = window.setInterval(
|
|
31531
|
-
return window.addEventListener("popstate",
|
|
31532
|
-
window.clearInterval(se), window.removeEventListener("popstate",
|
|
31556
|
+
ue();
|
|
31557
|
+
const se = window.setInterval(ue, 250);
|
|
31558
|
+
return window.addEventListener("popstate", ue), window.addEventListener("hashchange", ue), () => {
|
|
31559
|
+
window.clearInterval(se), window.removeEventListener("popstate", ue), window.removeEventListener("hashchange", ue);
|
|
31533
31560
|
};
|
|
31534
31561
|
}, [S, y]), $ ? /* @__PURE__ */ h(
|
|
31535
31562
|
Dg,
|
|
@@ -31552,7 +31579,7 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31552
31579
|
{
|
|
31553
31580
|
style: { alignItems: "center", flexDirection: "column", gap: "10px" },
|
|
31554
31581
|
children: [
|
|
31555
|
-
/* @__PURE__ */ h(
|
|
31582
|
+
/* @__PURE__ */ h(vt, { color: t?.colors?.primary, style: { margin: "0px" } }),
|
|
31556
31583
|
/* @__PURE__ */ h("div", { children: "Connecting..." })
|
|
31557
31584
|
]
|
|
31558
31585
|
}
|
|
@@ -31570,12 +31597,12 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31570
31597
|
{
|
|
31571
31598
|
style: { alignItems: "center", flexDirection: "column", gap: "10px" },
|
|
31572
31599
|
children: [
|
|
31573
|
-
/* @__PURE__ */ h(
|
|
31600
|
+
/* @__PURE__ */ h(vt, { color: t?.colors?.primary, style: { margin: "0px" } }),
|
|
31574
31601
|
C && /* @__PURE__ */ h("div", { children: C })
|
|
31575
31602
|
]
|
|
31576
31603
|
}
|
|
31577
31604
|
) : i.xmppPassword === "" && i.xmppUsername === "" ? t?.fallbackScreens?.noUser != null ? /* @__PURE__ */ h(tr, { style: { ...e }, children: /* @__PURE__ */ h(Ir, { content: t.fallbackScreens.noUser }) }) : /* @__PURE__ */ h(Ag, { config: t }) : f ? t?.fallbackScreens?.noRoom != null && ie && !g && !H ? /* @__PURE__ */ h(tr, { style: { ...e }, children: /* @__PURE__ */ h(Ir, { content: t.fallbackScreens.noRoom }) }) : /* @__PURE__ */ O(Ee, { children: [
|
|
31578
|
-
|
|
31605
|
+
re ? /* @__PURE__ */ h(
|
|
31579
31606
|
tr,
|
|
31580
31607
|
{
|
|
31581
31608
|
style: {
|
|
@@ -31633,14 +31660,14 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31633
31660
|
rA,
|
|
31634
31661
|
{
|
|
31635
31662
|
modal: s,
|
|
31636
|
-
setOpenModal: (
|
|
31663
|
+
setOpenModal: (Y) => y(Ke(Y))
|
|
31637
31664
|
}
|
|
31638
31665
|
),
|
|
31639
31666
|
/* @__PURE__ */ h(
|
|
31640
31667
|
ZP,
|
|
31641
31668
|
{
|
|
31642
31669
|
modal: s,
|
|
31643
|
-
setOpenModal: (
|
|
31670
|
+
setOpenModal: (Y) => y(Ke(Y))
|
|
31644
31671
|
}
|
|
31645
31672
|
)
|
|
31646
31673
|
]
|
|
@@ -31652,7 +31679,7 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31652
31679
|
{
|
|
31653
31680
|
style: { alignItems: "center", flexDirection: "column", gap: "10px" },
|
|
31654
31681
|
children: [
|
|
31655
|
-
/* @__PURE__ */ h(
|
|
31682
|
+
/* @__PURE__ */ h(vt, { color: t?.colors?.primary, style: { margin: "0px" } }),
|
|
31656
31683
|
/* @__PURE__ */ h("div", { children: C || "Loading chat..." })
|
|
31657
31684
|
]
|
|
31658
31685
|
}
|
|
@@ -31693,7 +31720,7 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31693
31720
|
return console.error("Login failed:", d), null;
|
|
31694
31721
|
}
|
|
31695
31722
|
}, [e?.user?.email, e?.user?.password]), l = Me();
|
|
31696
|
-
return
|
|
31723
|
+
return Z(() => {
|
|
31697
31724
|
let d = !1;
|
|
31698
31725
|
return (async () => {
|
|
31699
31726
|
o?.baseUrl && pd(o.baseUrl, o.customAppToken);
|
|
@@ -31768,7 +31795,7 @@ const xA = (e) => e?.enabled && e?.translations ? e.translations : void 0, SA =
|
|
|
31768
31795
|
Do,
|
|
31769
31796
|
{
|
|
31770
31797
|
style: { alignItems: "center", flexDirection: "column", gap: "10px" },
|
|
31771
|
-
children: /* @__PURE__ */ h(
|
|
31798
|
+
children: /* @__PURE__ */ h(vt, { color: o?.colors?.primary, style: { margin: "0px" } })
|
|
31772
31799
|
}
|
|
31773
31800
|
) : o?.fallbackScreens?.noUser != null ? (
|
|
31774
31801
|
// Host opted out of the built-in Ethora login screen (e.g. they drive
|
|
@@ -31867,18 +31894,18 @@ Ci(Ng, "defaultProps", {
|
|
|
31867
31894
|
});
|
|
31868
31895
|
const LA = () => {
|
|
31869
31896
|
const e = Me();
|
|
31870
|
-
return
|
|
31897
|
+
return Z(() => () => {
|
|
31871
31898
|
}, []), {
|
|
31872
31899
|
navigateToMessage: (t, r) => {
|
|
31873
|
-
e(
|
|
31900
|
+
e(Ue({ roomJID: t })), setTimeout(() => {
|
|
31874
31901
|
const o = document.querySelector(
|
|
31875
31902
|
`[data-message-id="${r}"]`
|
|
31876
31903
|
);
|
|
31877
31904
|
o ? (o.scrollIntoView({
|
|
31878
31905
|
behavior: "smooth",
|
|
31879
31906
|
block: "center"
|
|
31880
|
-
}), o.classList.add(
|
|
31881
|
-
o.classList.remove(
|
|
31907
|
+
}), o.classList.add(Et), setTimeout(() => {
|
|
31908
|
+
o.classList.remove(Et);
|
|
31882
31909
|
}, 2e3)) : setTimeout(() => {
|
|
31883
31910
|
const n = document.querySelector(
|
|
31884
31911
|
`[data-message-id="${r}"]`
|
|
@@ -31886,8 +31913,8 @@ const LA = () => {
|
|
|
31886
31913
|
n && (n.scrollIntoView({
|
|
31887
31914
|
behavior: "smooth",
|
|
31888
31915
|
block: "center"
|
|
31889
|
-
}), n.classList.add(
|
|
31890
|
-
n.classList.remove(
|
|
31916
|
+
}), n.classList.add(Et), setTimeout(() => {
|
|
31917
|
+
n.classList.remove(Et);
|
|
31891
31918
|
}, 2e3));
|
|
31892
31919
|
}, 500);
|
|
31893
31920
|
}, 100);
|
|
@@ -31909,7 +31936,7 @@ const LA = () => {
|
|
|
31909
31936
|
return !1;
|
|
31910
31937
|
}
|
|
31911
31938
|
}), [c, l] = K(!1);
|
|
31912
|
-
|
|
31939
|
+
Z(() => {
|
|
31913
31940
|
if (typeof window > "u" || typeof Notification > "u")
|
|
31914
31941
|
return;
|
|
31915
31942
|
const g = () => i(Notification.permission);
|
|
@@ -32108,7 +32135,7 @@ function mI() {
|
|
|
32108
32135
|
}));
|
|
32109
32136
|
}
|
|
32110
32137
|
function WA(e) {
|
|
32111
|
-
|
|
32138
|
+
Z(() => {
|
|
32112
32139
|
qA(e);
|
|
32113
32140
|
}, [
|
|
32114
32141
|
e?.fontFamily,
|
|
@@ -32166,7 +32193,7 @@ const JA = { display: "contents" }, XA = () => (LA(), null), GA = ({ config: e }
|
|
|
32166
32193
|
...i.config,
|
|
32167
32194
|
newArch: i.config.newArch ?? !0
|
|
32168
32195
|
} : i.config, [i.config]);
|
|
32169
|
-
return /* @__PURE__ */ h("div", { className: ms, style: JA, children: /* @__PURE__ */ h(Ol, { store: j, children: /* @__PURE__ */ h(v0, { config: s, scope: "chat", children: /* @__PURE__ */ h(Ng, { loading: /* @__PURE__ */ h(
|
|
32196
|
+
return /* @__PURE__ */ h("div", { className: ms, style: JA, children: /* @__PURE__ */ h(Ol, { store: j, children: /* @__PURE__ */ h(v0, { config: s, scope: "chat", children: /* @__PURE__ */ h(Ng, { loading: /* @__PURE__ */ h(vt, {}), persistor: Or, children: /* @__PURE__ */ O(NE, { children: [
|
|
32170
32197
|
/* @__PURE__ */ h(XA, {}),
|
|
32171
32198
|
/* @__PURE__ */ h(KA, { config: s }),
|
|
32172
32199
|
/* @__PURE__ */ h(SR, { config: s }),
|
|
@@ -32219,7 +32246,7 @@ const JA = { display: "contents" }, XA = () => (LA(), null), GA = ({ config: e }
|
|
|
32219
32246
|
const f = j.getState().rooms.rooms, p = Ec(), m = !e.current;
|
|
32220
32247
|
return { ...eM(f, p), loading: m, isLoading: m };
|
|
32221
32248
|
}, [d, u] = K(() => l());
|
|
32222
|
-
return
|
|
32249
|
+
return Z(() => {
|
|
32223
32250
|
const f = () => {
|
|
32224
32251
|
const v = l(), w = `${v.loading ? 1 : 0}#${Rp(
|
|
32225
32252
|
j.getState().rooms.rooms,
|
|
@@ -32253,7 +32280,7 @@ const JA = { display: "contents" }, XA = () => (LA(), null), GA = ({ config: e }
|
|
|
32253
32280
|
};
|
|
32254
32281
|
typeof window < "u" && (window._ethoraAppLoadTime = Date.now());
|
|
32255
32282
|
export {
|
|
32256
|
-
|
|
32283
|
+
Ue as $,
|
|
32257
32284
|
US as A,
|
|
32258
32285
|
Re as B,
|
|
32259
32286
|
Rs as C,
|
|
@@ -32321,7 +32348,7 @@ export {
|
|
|
32321
32348
|
oI as aZ,
|
|
32322
32349
|
YM as a_,
|
|
32323
32350
|
Y0 as aa,
|
|
32324
|
-
|
|
32351
|
+
vt as ab,
|
|
32325
32352
|
FM as ac,
|
|
32326
32353
|
it as ad,
|
|
32327
32354
|
Sd as ae,
|