@college-africa/chat-ui 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DateSeparator.d.ts +6 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +86 -56
- package/dist/{summaries-BT8fDYEs.cjs → summaries-BLYBgHwg.cjs} +1 -1
- package/dist/{summaries-DRFP-wEb.js → summaries-DI36-zkM.js} +7 -5
- package/dist/utils/date.d.ts +5 -0
- package/dist/utils/sdk.d.ts +5 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, s as g, t as _, u as v, v as y, w as b, x, y as S } from "./summaries-
|
|
1
|
+
import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, s as g, t as _, u as v, v as y, w as b, x, y as S } from "./summaries-DI36-zkM.js";
|
|
2
2
|
import * as C from "react";
|
|
3
3
|
import w, { Children as ee, Component as te, createContext as ne, createElement as T, forwardRef as E, useCallback as D, useContext as re, useEffect as O, useLayoutEffect as ie, useMemo as ae, useRef as k, useState as A } from "react";
|
|
4
4
|
import { Alert as j, AlertTitle as oe, AppBar as se, Autocomplete as ce, Avatar as M, Badge as le, Box as N, Button as P, Chip as ue, CircularProgress as F, Dialog as de, DialogActions as fe, DialogContent as pe, DialogTitle as me, Divider as he, Drawer as ge, FormControlLabel as _e, IconButton as ve, InputAdornment as ye, List as be, ListItem as xe, ListItemAvatar as Se, ListItemButton as Ce, ListItemText as we, Menu as Te, MenuItem as Ee, Paper as De, Select as Oe, Skeleton as ke, Snackbar as Ae, Switch as je, TextField as Me, Toolbar as Ne, Tooltip as Pe, Typography as I } from "@mui/material";
|
|
@@ -6063,9 +6063,22 @@ function vf(e) {
|
|
|
6063
6063
|
hour12: !0
|
|
6064
6064
|
});
|
|
6065
6065
|
}
|
|
6066
|
+
function yf(e) {
|
|
6067
|
+
let t = typeof e == "string" ? new Date(e) : e, n = /* @__PURE__ */ new Date(), r = new Date(n.getFullYear(), n.getMonth(), n.getDate()), i = new Date(r);
|
|
6068
|
+
i.setDate(i.getDate() - 1);
|
|
6069
|
+
let a = new Date(t.getFullYear(), t.getMonth(), t.getDate());
|
|
6070
|
+
return a.getTime() === r.getTime() ? "Today" : a.getTime() === i.getTime() ? "Yesterday" : a.getTime() > r.getTime() - 10080 * 60 * 1e3 ? t.toLocaleDateString("en-US", { weekday: "long" }) : t.getFullYear() === n.getFullYear() ? t.toLocaleDateString("en-US", {
|
|
6071
|
+
month: "short",
|
|
6072
|
+
day: "numeric"
|
|
6073
|
+
}) : t.toLocaleDateString("en-US", {
|
|
6074
|
+
month: "short",
|
|
6075
|
+
day: "numeric",
|
|
6076
|
+
year: "numeric"
|
|
6077
|
+
});
|
|
6078
|
+
}
|
|
6066
6079
|
//#endregion
|
|
6067
6080
|
//#region src/components/MessageBubble.tsx
|
|
6068
|
-
var
|
|
6081
|
+
var bf = w.memo(({ message: e, isOwnMessage: t, senderName: n, showSenderName: r = !0, isFirstInGroup: i = !0, isLastInGroup: a = !0, status: o = "sent" }) => {
|
|
6069
6082
|
let s = e.id.startsWith("temp-"), c = () => {
|
|
6070
6083
|
if (!t || !a) return null;
|
|
6071
6084
|
let e = {
|
|
@@ -6139,7 +6152,7 @@ var yf = w.memo(({ message: e, isOwnMessage: t, senderName: n, showSenderName: r
|
|
|
6139
6152
|
t && l
|
|
6140
6153
|
]
|
|
6141
6154
|
});
|
|
6142
|
-
}),
|
|
6155
|
+
}), xf = ({ isOwnMessage: e = !1 }) => /* @__PURE__ */ L(N, {
|
|
6143
6156
|
display: "flex",
|
|
6144
6157
|
justifyContent: e ? "flex-end" : "flex-start",
|
|
6145
6158
|
mb: 1,
|
|
@@ -6159,7 +6172,7 @@ var yf = w.memo(({ message: e, isOwnMessage: t, senderName: n, showSenderName: r
|
|
|
6159
6172
|
}
|
|
6160
6173
|
})]
|
|
6161
6174
|
})
|
|
6162
|
-
}),
|
|
6175
|
+
}), Sf = ({ hasMore: e, loading: t, onLoadMore: n, threshold: r = 1, rootMargin: i = "100px" }) => {
|
|
6163
6176
|
let a = k(null), o = k(null);
|
|
6164
6177
|
return O(() => {
|
|
6165
6178
|
if (!e || t) return;
|
|
@@ -6191,22 +6204,39 @@ var yf = w.memo(({ message: e, isOwnMessage: t, senderName: n, showSenderName: r
|
|
|
6191
6204
|
children: "Scroll to load more"
|
|
6192
6205
|
})
|
|
6193
6206
|
}) : null;
|
|
6194
|
-
},
|
|
6207
|
+
}, Cf = ({ date: e }) => /* @__PURE__ */ L(N, {
|
|
6208
|
+
display: "flex",
|
|
6209
|
+
justifyContent: "center",
|
|
6210
|
+
my: 1.5,
|
|
6211
|
+
children: /* @__PURE__ */ L(I, {
|
|
6212
|
+
variant: "caption",
|
|
6213
|
+
color: "text.secondary",
|
|
6214
|
+
fontWeight: 500,
|
|
6215
|
+
sx: {
|
|
6216
|
+
userSelect: "none",
|
|
6217
|
+
bgcolor: "background.paper",
|
|
6218
|
+
px: 1.5,
|
|
6219
|
+
py: .5,
|
|
6220
|
+
borderRadius: .5
|
|
6221
|
+
},
|
|
6222
|
+
children: yf(e)
|
|
6223
|
+
})
|
|
6224
|
+
}), wf = (e, t, n) => {
|
|
6195
6225
|
O(() => ((async () => {
|
|
6196
6226
|
await e();
|
|
6197
6227
|
})(), n), t);
|
|
6198
6228
|
};
|
|
6199
6229
|
//#endregion
|
|
6200
6230
|
//#region src/hooks/useSenderNames.ts
|
|
6201
|
-
function
|
|
6231
|
+
function Tf(e) {
|
|
6202
6232
|
let t = e.map((e) => Number(e.sender));
|
|
6203
6233
|
return new Set(t);
|
|
6204
6234
|
}
|
|
6205
|
-
function
|
|
6235
|
+
function Ef(e) {
|
|
6206
6236
|
let [t, n] = A(() => /* @__PURE__ */ new Map()), i = D(async () => {
|
|
6207
6237
|
if (!e.length) return t;
|
|
6208
6238
|
try {
|
|
6209
|
-
let n =
|
|
6239
|
+
let n = Tf(e), i = Array.from(n);
|
|
6210
6240
|
if (console.log("[names] size:", n.size), !n.size) return t;
|
|
6211
6241
|
let a = (await o.users.bulkGet(i)).filter((e) => !!e), s = /* @__PURE__ */ new Map();
|
|
6212
6242
|
if (a.forEach((e) => {
|
|
@@ -6223,14 +6253,14 @@ function wf(e) {
|
|
|
6223
6253
|
}
|
|
6224
6254
|
return t;
|
|
6225
6255
|
}, [e, t]);
|
|
6226
|
-
return
|
|
6256
|
+
return wf(async () => {
|
|
6227
6257
|
n(await i());
|
|
6228
6258
|
}, [e]), t;
|
|
6229
6259
|
}
|
|
6230
6260
|
//#endregion
|
|
6231
6261
|
//#region src/components/MessageList.tsx
|
|
6232
|
-
var
|
|
6233
|
-
let c = k(null), l = k(null), u = k(0), d = k(!0), [f, p] = A(i), m =
|
|
6262
|
+
var Df = ({ messages: e, currentUserId: t, loading: n = !1, error: r = null, autoScroll: i = !0, hasMore: a = !1, loadingMore: o = !1, onLoadMore: s }) => {
|
|
6263
|
+
let c = k(null), l = k(null), u = k(0), d = k(!0), [f, p] = A(i), m = Ef(e), h = () => {
|
|
6234
6264
|
if (!l.current) return !1;
|
|
6235
6265
|
let { scrollTop: e, scrollHeight: t, clientHeight: n } = l.current;
|
|
6236
6266
|
return t - e - n < 100;
|
|
@@ -6257,7 +6287,7 @@ var Tf = ({ messages: e, currentUserId: t, loading: n = !1, error: r = null, aut
|
|
|
6257
6287
|
3,
|
|
6258
6288
|
4,
|
|
6259
6289
|
5
|
|
6260
|
-
].map((e) => /* @__PURE__ */ L(
|
|
6290
|
+
].map((e) => /* @__PURE__ */ L(xf, { isOwnMessage: e % 3 == 0 }, e))
|
|
6261
6291
|
}) : r && !e.length ? /* @__PURE__ */ L(N, {
|
|
6262
6292
|
display: "flex",
|
|
6263
6293
|
justifyContent: "center",
|
|
@@ -6293,26 +6323,26 @@ var Tf = ({ messages: e, currentUserId: t, loading: n = !1, error: r = null, aut
|
|
|
6293
6323
|
d.current = h();
|
|
6294
6324
|
},
|
|
6295
6325
|
children: [
|
|
6296
|
-
a && s && /* @__PURE__ */ L(
|
|
6326
|
+
a && s && /* @__PURE__ */ L(Sf, {
|
|
6297
6327
|
hasMore: a,
|
|
6298
6328
|
loading: o,
|
|
6299
6329
|
onLoadMore: s
|
|
6300
6330
|
}),
|
|
6301
6331
|
e.map((n, r) => {
|
|
6302
|
-
let i = n.sender, a = n.sender === t, o = m.get(i), s = r > 0 ? e[r - 1] : null, c = r < e.length - 1 ? e[r + 1] : null, l = !s || !v(s, n);
|
|
6303
|
-
return /* @__PURE__ */ L(
|
|
6332
|
+
let i = n.sender, a = n.sender === t, o = m.get(i), s = r > 0 ? e[r - 1] : null, c = r < e.length - 1 ? e[r + 1] : null, l = new Date(n.created_at).toDateString(), u = l !== (s ? new Date(s.created_at).toDateString() : null), d = u || !s || !v(s, n), f = l !== (c ? new Date(c.created_at).toDateString() : null) || !c || !v(n, c);
|
|
6333
|
+
return /* @__PURE__ */ R(w.Fragment, { children: [u && /* @__PURE__ */ L(Cf, { date: n.created_at }), /* @__PURE__ */ L(bf, {
|
|
6304
6334
|
message: n,
|
|
6305
6335
|
isOwnMessage: a,
|
|
6306
6336
|
senderName: o,
|
|
6307
|
-
showSenderName:
|
|
6308
|
-
isFirstInGroup:
|
|
6309
|
-
isLastInGroup:
|
|
6310
|
-
}, n.id);
|
|
6337
|
+
showSenderName: d,
|
|
6338
|
+
isFirstInGroup: d,
|
|
6339
|
+
isLastInGroup: f
|
|
6340
|
+
})] }, n.id);
|
|
6311
6341
|
}),
|
|
6312
6342
|
/* @__PURE__ */ L("div", { ref: c })
|
|
6313
6343
|
]
|
|
6314
6344
|
});
|
|
6315
|
-
},
|
|
6345
|
+
}, Of = ({ onSend: e, sending: t = !1, placeholder: n = "Type a message...", disabled: r = !1, disableReason: i }) => {
|
|
6316
6346
|
let [a, o] = A(""), s = k(null), c = () => {
|
|
6317
6347
|
let n = a.trim();
|
|
6318
6348
|
n && !t && !r && (e(n), o(""), setTimeout(() => {
|
|
@@ -6350,9 +6380,9 @@ var Tf = ({ messages: e, currentUserId: t, loading: n = !1, error: r = null, aut
|
|
|
6350
6380
|
};
|
|
6351
6381
|
//#endregion
|
|
6352
6382
|
//#region src/hooks/useMessages.ts
|
|
6353
|
-
function
|
|
6383
|
+
function kf({ conversation: e, limit: t = 50 }) {
|
|
6354
6384
|
let n = h(e), [r, i] = A(!1), [s, c] = A(!1), [l, u] = A(), d = ff(() => o.messages.where("conversationId").equals(n).sortBy("created_at"), [n]) || [], f = ff(() => o.msgCursor.where("id").equals(n).first(), [n]);
|
|
6355
|
-
return
|
|
6385
|
+
return wf(async () => {
|
|
6356
6386
|
let r = { limit: t };
|
|
6357
6387
|
d.length && (r.cursorType = "after", r.cursorDatetime = d[d.length - 1]?.created_at), i(!0), await a(e, r).catch(u), i(!1), await o.summaries.update(n, { unread_count: 0 });
|
|
6358
6388
|
}, [e, t]), console.log("mw", d.length), {
|
|
@@ -6384,10 +6414,10 @@ function Df({ conversation: e, limit: t = 50 }) {
|
|
|
6384
6414
|
}
|
|
6385
6415
|
//#endregion
|
|
6386
6416
|
//#region src/components/ChatWindow.tsx
|
|
6387
|
-
var
|
|
6417
|
+
var Af = ({ conversation: e, user: t, isConnected: n, onBack: i }) => {
|
|
6388
6418
|
let a = r();
|
|
6389
6419
|
if (!a) return null;
|
|
6390
|
-
let { messages: s, cursor: c, loading: l, error: u, loadMore: d, loadingMore: f } =
|
|
6420
|
+
let { messages: s, cursor: c, loading: l, error: u, loadMore: d, loadingMore: f } = kf({ conversation: e }), p = ff(async () => e.type === "group" ? await o.groups.get(e.id) : null, [e.id, e.type]), m = t?.role === "admin", g = t?.role === "moderator", v = p?.is_member ?? !0, y = p?.system ?? !1, b = m && e.type === "group" && !v, x = e.type === "group" && !v, S = e.type === "group" && (m || v), C = e.type === "group" && !y && (m || g && v), w = m && e.type === "group" && !y, [ee, te] = A(!1), [ne, T] = A(!1), [E, D] = A(""), [re, O] = A(!1), [ie, ae] = A(null), k = () => {
|
|
6391
6421
|
D(e.name || ""), ae(null), T(!0);
|
|
6392
6422
|
}, oe = async () => {
|
|
6393
6423
|
if (E.trim()) {
|
|
@@ -6511,7 +6541,7 @@ var Of = ({ conversation: e, user: t, isConnected: n, onBack: i }) => {
|
|
|
6511
6541
|
onClose: () => we(null),
|
|
6512
6542
|
children: Ce.message
|
|
6513
6543
|
}),
|
|
6514
|
-
/* @__PURE__ */ L(
|
|
6544
|
+
/* @__PURE__ */ L(Df, {
|
|
6515
6545
|
messages: s,
|
|
6516
6546
|
currentUserId: t?.id || 0,
|
|
6517
6547
|
loading: l,
|
|
@@ -6526,7 +6556,7 @@ var Of = ({ conversation: e, user: t, isConnected: n, onBack: i }) => {
|
|
|
6526
6556
|
severity: "warning",
|
|
6527
6557
|
sx: { m: 2 },
|
|
6528
6558
|
children: "You must be a group member to send messages"
|
|
6529
|
-
}) : /* @__PURE__ */ L(
|
|
6559
|
+
}) : /* @__PURE__ */ L(Of, {
|
|
6530
6560
|
onSend: async (n) => {
|
|
6531
6561
|
if (!n.trim()) return;
|
|
6532
6562
|
Se(!0), we(null), Ee(!0);
|
|
@@ -6552,7 +6582,7 @@ var Of = ({ conversation: e, user: t, isConnected: n, onBack: i }) => {
|
|
|
6552
6582
|
})
|
|
6553
6583
|
]
|
|
6554
6584
|
});
|
|
6555
|
-
},
|
|
6585
|
+
}, jf = class extends te {
|
|
6556
6586
|
constructor(e) {
|
|
6557
6587
|
super(e), this.state = {
|
|
6558
6588
|
hasError: !1,
|
|
@@ -6608,7 +6638,7 @@ var Of = ({ conversation: e, user: t, isConnected: n, onBack: i }) => {
|
|
|
6608
6638
|
};
|
|
6609
6639
|
//#endregion
|
|
6610
6640
|
//#region src/hooks/useWebSocket.ts
|
|
6611
|
-
function
|
|
6641
|
+
function Mf({ onMessage: e, onConnect: t, onDisconnect: n, onError: i } = {}) {
|
|
6612
6642
|
let [a, o] = A(!1), s = D((t) => {
|
|
6613
6643
|
e?.(t);
|
|
6614
6644
|
}, [e]), c = D(() => {
|
|
@@ -6636,15 +6666,15 @@ function Af({ onMessage: e, onConnect: t, onDisconnect: n, onError: i } = {}) {
|
|
|
6636
6666
|
}
|
|
6637
6667
|
//#endregion
|
|
6638
6668
|
//#region src/components/ChatContainer.tsx
|
|
6639
|
-
var
|
|
6669
|
+
var Nf = ({ initialConversation: e }) => {
|
|
6640
6670
|
let [t, n] = A(e ?? null), [i, a] = A(), [s, c] = A(!0), [l, u] = A(() => r()), d = D((e) => () => c(e), []);
|
|
6641
6671
|
return O(() => {
|
|
6642
6672
|
l || r(u);
|
|
6643
|
-
}, [l]),
|
|
6673
|
+
}, [l]), wf(async () => {
|
|
6644
6674
|
if (!l) return;
|
|
6645
6675
|
let e = await l.getMe();
|
|
6646
6676
|
a(e), o.users.put(e);
|
|
6647
|
-
}, [l]),
|
|
6677
|
+
}, [l]), Mf({
|
|
6648
6678
|
onError: d(!1),
|
|
6649
6679
|
onConnect: d(!0),
|
|
6650
6680
|
onDisconnect: d(!1)
|
|
@@ -6674,7 +6704,7 @@ var jf = ({ initialConversation: e }) => {
|
|
|
6674
6704
|
},
|
|
6675
6705
|
flexDirection: "column"
|
|
6676
6706
|
},
|
|
6677
|
-
children: /* @__PURE__ */ L(
|
|
6707
|
+
children: /* @__PURE__ */ L(jf, { children: /* @__PURE__ */ L(pf, {
|
|
6678
6708
|
currentUser: i,
|
|
6679
6709
|
selectedConversation: t,
|
|
6680
6710
|
onConversationSelect: (e) => {
|
|
@@ -6692,7 +6722,7 @@ var jf = ({ initialConversation: e }) => {
|
|
|
6692
6722
|
},
|
|
6693
6723
|
flexDirection: "column"
|
|
6694
6724
|
},
|
|
6695
|
-
children: t ? /* @__PURE__ */ L(
|
|
6725
|
+
children: t ? /* @__PURE__ */ L(jf, { children: /* @__PURE__ */ L(Af, {
|
|
6696
6726
|
conversation: t,
|
|
6697
6727
|
user: i,
|
|
6698
6728
|
isConnected: s,
|
|
@@ -6715,7 +6745,7 @@ var jf = ({ initialConversation: e }) => {
|
|
|
6715
6745
|
height: "100%",
|
|
6716
6746
|
children: /* @__PURE__ */ L(F, {})
|
|
6717
6747
|
});
|
|
6718
|
-
},
|
|
6748
|
+
}, Pf = ({ count: e, children: t, max: n = 99 }) => /* @__PURE__ */ L(le, {
|
|
6719
6749
|
badgeContent: e,
|
|
6720
6750
|
color: "error",
|
|
6721
6751
|
max: n,
|
|
@@ -6726,26 +6756,26 @@ var jf = ({ initialConversation: e }) => {
|
|
|
6726
6756
|
transform: "translateY(-50%)"
|
|
6727
6757
|
} },
|
|
6728
6758
|
children: t
|
|
6729
|
-
}),
|
|
6759
|
+
}), Ff = /* @__PURE__ */ e(((e, t) => {
|
|
6730
6760
|
var n = i();
|
|
6731
6761
|
t.exports = function() {
|
|
6732
6762
|
return n.Date.now();
|
|
6733
6763
|
};
|
|
6734
|
-
})),
|
|
6764
|
+
})), If = /* @__PURE__ */ e(((e, t) => {
|
|
6735
6765
|
var n = /\s/;
|
|
6736
6766
|
function r(e) {
|
|
6737
6767
|
for (var t = e.length; t-- && n.test(e.charAt(t)););
|
|
6738
6768
|
return t;
|
|
6739
6769
|
}
|
|
6740
6770
|
t.exports = r;
|
|
6741
|
-
})),
|
|
6742
|
-
var n =
|
|
6771
|
+
})), Lf = /* @__PURE__ */ e(((e, t) => {
|
|
6772
|
+
var n = If(), r = /^\s+/;
|
|
6743
6773
|
function i(e) {
|
|
6744
6774
|
return e && e.slice(0, n(e) + 1).replace(r, "");
|
|
6745
6775
|
}
|
|
6746
6776
|
t.exports = i;
|
|
6747
|
-
})),
|
|
6748
|
-
var r =
|
|
6777
|
+
})), Rf = /* @__PURE__ */ e(((e, t) => {
|
|
6778
|
+
var r = Lf(), i = n(), a = Vd(), o = NaN, s = /^[-+]0x[0-9a-f]+$/i, c = /^0b[01]+$/i, l = /^0o[0-7]+$/i, u = parseInt;
|
|
6749
6779
|
function d(e) {
|
|
6750
6780
|
if (typeof e == "number") return e;
|
|
6751
6781
|
if (a(e)) return o;
|
|
@@ -6759,8 +6789,8 @@ var jf = ({ initialConversation: e }) => {
|
|
|
6759
6789
|
return n || l.test(e) ? u(e.slice(2), n ? 2 : 8) : s.test(e) ? o : +e;
|
|
6760
6790
|
}
|
|
6761
6791
|
t.exports = d;
|
|
6762
|
-
})),
|
|
6763
|
-
var r = n(), i =
|
|
6792
|
+
})), zf = /* @__PURE__ */ b((/* @__PURE__ */ e(((e, t) => {
|
|
6793
|
+
var r = n(), i = Ff(), a = Rf(), o = "Expected a function", s = Math.max, c = Math.min;
|
|
6764
6794
|
function l(e, t, n) {
|
|
6765
6795
|
var l, u, d, f, p, m, h = 0, g = !1, _ = !1, v = !0;
|
|
6766
6796
|
if (typeof e != "function") throw TypeError(o);
|
|
@@ -6805,25 +6835,25 @@ var jf = ({ initialConversation: e }) => {
|
|
|
6805
6835
|
return ne.cancel = ee, ne.flush = te, ne;
|
|
6806
6836
|
}
|
|
6807
6837
|
t.exports = l;
|
|
6808
|
-
})))(), 1),
|
|
6838
|
+
})))(), 1), Bf = 0, Vf = (0, zf.default)(() => {
|
|
6809
6839
|
r() && _().catch(console.warn);
|
|
6810
6840
|
}, 600);
|
|
6811
|
-
function
|
|
6812
|
-
return O(() => (
|
|
6813
|
-
document.visibilityState === "visible" &&
|
|
6841
|
+
function Hf() {
|
|
6842
|
+
return O(() => (Bf++, Bf === 1 && (document.addEventListener("visibilitychange", () => {
|
|
6843
|
+
document.visibilityState === "visible" && Vf();
|
|
6814
6844
|
}), r((e) => {
|
|
6815
|
-
e.on("open",
|
|
6845
|
+
e.on("open", Vf);
|
|
6816
6846
|
})), () => {
|
|
6817
|
-
|
|
6847
|
+
Bf--, Bf === 0 && (r()?.off("open", Vf), Vf.cancel());
|
|
6818
6848
|
}), []), ff(() => o.summaries.toArray().then((e) => e.reduce((e, t) => e + t.unread_count, 0)), [], void 0);
|
|
6819
6849
|
}
|
|
6820
6850
|
//#endregion
|
|
6821
6851
|
//#region src/hooks/constants.ts
|
|
6822
|
-
var
|
|
6852
|
+
var Uf = {
|
|
6823
6853
|
SUMMARIES: 300 * 1e3,
|
|
6824
6854
|
USER: 3600 * 1e3,
|
|
6825
6855
|
MESSAGES: Infinity
|
|
6826
|
-
},
|
|
6856
|
+
}, Wf = () => typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches, Gf = {
|
|
6827
6857
|
mode: "dark",
|
|
6828
6858
|
background: {
|
|
6829
6859
|
paper: "#3d3d43",
|
|
@@ -6833,17 +6863,17 @@ var Vf = {
|
|
|
6833
6863
|
primary: "#eee",
|
|
6834
6864
|
secondary: "#aaa"
|
|
6835
6865
|
}
|
|
6836
|
-
},
|
|
6866
|
+
}, Kf = {
|
|
6837
6867
|
mode: "light",
|
|
6838
6868
|
background: {
|
|
6839
6869
|
default: "#f5f5f5",
|
|
6840
6870
|
paper: "#ffff"
|
|
6841
6871
|
}
|
|
6842
|
-
},
|
|
6843
|
-
let t =
|
|
6872
|
+
}, qf = (e) => {
|
|
6873
|
+
let t = Wf(), n = (e || (t ? "dark" : "light")) === "dark";
|
|
6844
6874
|
return qi({
|
|
6845
6875
|
palette: {
|
|
6846
|
-
...n ?
|
|
6876
|
+
...n ? Gf : Kf,
|
|
6847
6877
|
primary: {
|
|
6848
6878
|
main: "#E91E63",
|
|
6849
6879
|
light: "#F48FB1",
|
|
@@ -6966,6 +6996,6 @@ var Vf = {
|
|
|
6966
6996
|
} } }
|
|
6967
6997
|
}
|
|
6968
6998
|
});
|
|
6969
|
-
},
|
|
6999
|
+
}, Jf = qf();
|
|
6970
7000
|
//#endregion
|
|
6971
|
-
export {
|
|
7001
|
+
export { Uf as CACHE_TTL, Be as ChatApp, Nf as ChatContainer, mf as ChatHeader, Af as ChatWindow, Da as ConversationItem, Oa as ConversationItemSkeleton, pf as ConversationList, sf as CreateGroupDialog, jf as ErrorBoundary, Sf as LoadMoreTrigger, bf as MessageBubble, Of as MessageInput, Df as MessageList, xf as MessageSkeleton, Pf as UnreadBadge, o as db, u as disconnectSDK, _ as fetchSummaries, r as getSDK, qf as getTheme, m as initSDK, g as isSDKInitialized, Jf as theme, kf as useMessages, Ef as useSenderNames, Hf as useUnreadCount, Mf as useWebSocket };
|