@linktr.ee/messaging-react 1.38.0 → 1.39.0
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/{Card-RgHsp9x1.js → Card-BjTfMGsC.js} +2 -2
- package/dist/{Card-RgHsp9x1.js.map → Card-BjTfMGsC.js.map} +1 -1
- package/dist/{Card-DwgUtqsA.js → Card-D3E-WTRO.js} +2 -2
- package/dist/{Card-DwgUtqsA.js.map → Card-D3E-WTRO.js.map} +1 -1
- package/dist/{index-B_4pciGp.js → index-j4j9UfK1.js} +971 -1260
- package/dist/index-j4j9UfK1.js.map +1 -0
- package/dist/index.d.ts +0 -60
- package/dist/index.js +9 -11
- package/package.json +1 -1
- package/src/components/ChannelList/ChannelList.stories.tsx +2 -7
- package/src/components/MessagingShell/index.tsx +2 -110
- package/src/index.ts +0 -4
- package/src/types.ts +0 -37
- package/dist/index-B_4pciGp.js.map +0 -1
- package/src/components/ParticipantPicker/ParticipantItem.stories.tsx +0 -190
- package/src/components/ParticipantPicker/ParticipantItem.tsx +0 -63
- package/src/components/ParticipantPicker/ParticipantPicker.stories.tsx +0 -56
- package/src/components/ParticipantPicker/ParticipantPicker.tsx +0 -229
- package/src/components/ParticipantPicker/index.tsx +0 -262
- package/src/hooks/useParticipants.ts +0 -94
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as d, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
+
import L from "classnames";
|
|
3
|
+
import O, { createContext as ot, useContext as lt, useCallback as G, useState as A, useRef as J, useEffect as Z, useMemo as Ce, Suspense as ct } from "react";
|
|
4
|
+
import { StreamChatService as Tt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as oe, useChatContext as Me, areMessageUIPropsEqual as At, useMessageReminder as Ft, useComponentContext as dt, Attachment as Ot, EditMessageModal as Pt, MessageBlocked as Ut, MessageBouncePrompt as Bt, MessageDeleted as zt, MessageIsThreadReplyInChannelButtonIndicator as $t, MessageRepliesCountButton as jt, ReminderNotification as Gt, StreamedMessageText as Vt, messageHasAttachments as Ht, messageHasReactions as Yt, isDateSeparatorMessage as Wt, isMessageBlocked as qt, isMessageBounced as Xt, MessageBounceModal as Zt, MessageText as Xe, Poll as Jt, MessageErrorIcon as Kt, useMessageContext as ut, useMessageComposer as Qt, useStateStore as es, MessageInput as ts, useMessageInputContext as ss, useMessageComposerHasSendableData as ns, SimpleAttachmentSelector as as, QuotedMessagePreview as rs, AttachmentPreviewList as is, TextareaComposer as os, MessageTimestamp as ve, useTypingContext as ls, Channel as cs, WithComponents as ds, Window as us, MessageList as ms } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ee, GiftIcon as hs, XIcon as mt, SpinnerGapIcon as we, SignOutIcon as fs, ProhibitInsetIcon as Ze, FlagIcon as gs, ArrowUpIcon as bs, SparkleIcon as Se, ProhibitIcon as ps, ArrowLeftIcon as Je, CaretRightIcon as Ke, DotsThreeIcon as Qe, FileIcon as ht, ImageIcon as xs, SpeakerHighIcon as vs, VideoCameraIcon as ws, FileMdIcon as Ns, FileTextIcon as _s, FileZipIcon as ys, FilePptIcon as Cs, FileCsvIcon as Es, FileXlsIcon as Ss, FileDocIcon as Is, FilePdfIcon as ks, CircleNotchIcon as ft, PlayIcon as et, PauseIcon as Ms, LinkIcon as Ts, DownloadSimpleIcon as Ds } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as tt } from "stream-chat";
|
|
8
|
+
const gt = ot({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const vt = mt({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), Te = () => lt(gt), ra = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -23,9 +23,9 @@ const vt = mt({
|
|
|
23
23
|
capabilities: o = {},
|
|
24
24
|
debug: l = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const i =
|
|
27
|
-
(
|
|
28
|
-
l && console.log(`🔥 [MessagingProvider] ${
|
|
26
|
+
const i = G(
|
|
27
|
+
(k, ...T) => {
|
|
28
|
+
l && console.log(`🔥 [MessagingProvider] ${k}`, ...T);
|
|
29
29
|
},
|
|
30
30
|
[l]
|
|
31
31
|
);
|
|
@@ -35,84 +35,84 @@ const vt = mt({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(o)
|
|
37
37
|
});
|
|
38
|
-
const [c,
|
|
38
|
+
const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a, y] = A(!1), [b, C] = A(null), x = J(!1), I = J({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: o
|
|
43
|
-
}), w =
|
|
43
|
+
}), w = J(0);
|
|
44
44
|
w.current++, i("📊 RENDER INFO", {
|
|
45
45
|
renderCount: w.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: I.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: I.current.apiKey !== r,
|
|
50
|
+
serviceConfigChanged: I.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: I.current.capabilities !== o
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), I.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: o
|
|
58
|
-
},
|
|
59
|
-
const
|
|
58
|
+
}, Z(() => {
|
|
59
|
+
const k = w.current;
|
|
60
60
|
if (i("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
-
renderCount:
|
|
61
|
+
renderCount: k,
|
|
62
62
|
apiKey: !!r,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: I.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: I.current.apiKey === r
|
|
69
69
|
}
|
|
70
70
|
}), !r || !n) {
|
|
71
71
|
i("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: k,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
i("🚀 CREATING NEW SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: k,
|
|
79
79
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: I.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const T = new Tt({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
85
|
debug: l
|
|
86
86
|
});
|
|
87
|
-
return
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
return m(T), i("✅ SERVICE SET", {
|
|
88
|
+
renderCount: k,
|
|
89
|
+
serviceInstance: !!T
|
|
90
90
|
}), () => {
|
|
91
91
|
i("🧹 SERVICE CLEANUP", {
|
|
92
|
-
renderCount:
|
|
92
|
+
renderCount: k,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), T.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [r, n, l, i]);
|
|
97
|
-
const E =
|
|
98
|
-
|
|
99
|
-
var
|
|
97
|
+
const E = J(null);
|
|
98
|
+
Z(() => {
|
|
99
|
+
var T, M;
|
|
100
100
|
if (i("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
104
|
+
isConnecting: x.current,
|
|
105
105
|
isConnected: f,
|
|
106
106
|
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !c || !s) {
|
|
108
108
|
i("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (x.current) {
|
|
112
112
|
i("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((T = E.current) == null ? void 0 : T.serviceId) === c && ((M = E.current) == null ? void 0 : M.userId) === s.id) {
|
|
116
116
|
i(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,28 +120,28 @@ const vt = mt({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
i("🚀 STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
i("🚀 STARTING USER CONNECTION", { userId: s.id }), x.current = !0, y(!0), C(null);
|
|
124
124
|
try {
|
|
125
125
|
i("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const _ = await c.connectUser(s);
|
|
127
|
+
h(_), v(!0), E.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: _.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (_) {
|
|
132
|
+
const N = _ instanceof Error ? _.message : "Connection failed";
|
|
133
|
+
C(N), i("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: N
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
y(!1), x.current = !1, i("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: f
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s, i, f]),
|
|
144
|
+
}, [c, s, i, f]), Z(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
146
|
isConnected: f
|
|
147
147
|
}), () => {
|
|
@@ -153,7 +153,7 @@ const vt = mt({
|
|
|
153
153
|
isConnected: f
|
|
154
154
|
});
|
|
155
155
|
}), [c, f, i]);
|
|
156
|
-
const
|
|
156
|
+
const P = G(async () => {
|
|
157
157
|
if (i("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,53 +161,53 @@ const vt = mt({
|
|
|
161
161
|
i("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
|
|
165
165
|
try {
|
|
166
166
|
i("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), i("📞 RECONNECTING FOR REFRESH");
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
} catch (
|
|
170
|
-
const
|
|
171
|
-
|
|
167
|
+
const k = await c.connectUser(s);
|
|
168
|
+
h(k), v(!0), C(null), i("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (k) {
|
|
170
|
+
const T = k instanceof Error ? k.message : "Refresh failed";
|
|
171
|
+
C(T), i("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: T
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
y(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s, i]),
|
|
178
|
+
}, [c, s, i]), U = O.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
180
|
hasClient: !!u,
|
|
181
181
|
isConnected: f,
|
|
182
182
|
isLoading: a,
|
|
183
|
-
hasError: !!
|
|
183
|
+
hasError: !!b,
|
|
184
184
|
capabilitiesKeys: Object.keys(o)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
187
|
client: u,
|
|
188
188
|
isConnected: f,
|
|
189
189
|
isLoading: a,
|
|
190
|
-
error:
|
|
190
|
+
error: b,
|
|
191
191
|
capabilities: o,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: P,
|
|
193
193
|
debug: l
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
196
|
u,
|
|
197
197
|
f,
|
|
198
198
|
a,
|
|
199
|
-
|
|
199
|
+
b,
|
|
200
200
|
o,
|
|
201
|
-
|
|
201
|
+
P,
|
|
202
202
|
l,
|
|
203
203
|
i
|
|
204
204
|
]);
|
|
205
205
|
return i("🔄 RENDER END", {
|
|
206
206
|
renderCount: w.current,
|
|
207
207
|
willRenderChat: !!(u && f),
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
208
|
+
contextValueReady: !!U
|
|
209
|
+
}), /* @__PURE__ */ e(gt.Provider, { value: U, children: u && f ? /* @__PURE__ */ e(
|
|
210
|
+
Dt,
|
|
211
211
|
{
|
|
212
212
|
client: u,
|
|
213
213
|
customClasses: {
|
|
@@ -216,25 +216,25 @@ const vt = mt({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, Rs = () => Te();
|
|
220
|
+
function Ls(t) {
|
|
221
221
|
const s = t.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
224
224
|
t.state.addMessageSorted(n.message);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const bt = O.createContext({
|
|
227
227
|
selectedChannel: void 0,
|
|
228
228
|
onChannelSelect: () => {
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
232
|
+
}), As = bt.Provider, Fs = () => O.useContext(bt), pt = (t) => {
|
|
233
233
|
var r, o;
|
|
234
|
-
const [s, n] =
|
|
234
|
+
const [s, n] = A(
|
|
235
235
|
!!((o = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && o.pinned_at)
|
|
236
236
|
);
|
|
237
|
-
return
|
|
237
|
+
return Z(() => {
|
|
238
238
|
var i;
|
|
239
239
|
if (!t) {
|
|
240
240
|
n(!1);
|
|
@@ -242,27 +242,27 @@ const wt = z.createContext({
|
|
|
242
242
|
}
|
|
243
243
|
n(!!((i = t.state.membership) != null && i.pinned_at));
|
|
244
244
|
const l = (c) => {
|
|
245
|
-
var
|
|
245
|
+
var m;
|
|
246
246
|
n(
|
|
247
|
-
c != null && c.member ? !!c.member.pinned_at : !!((
|
|
247
|
+
c != null && c.member ? !!c.member.pinned_at : !!((m = t.state.membership) != null && m.pinned_at)
|
|
248
248
|
);
|
|
249
249
|
};
|
|
250
250
|
return t.on("member.updated", l), () => {
|
|
251
251
|
t.off("member.updated", l);
|
|
252
252
|
};
|
|
253
253
|
}, [t]), s;
|
|
254
|
-
},
|
|
254
|
+
}, Os = (t, s) => {
|
|
255
255
|
const n = new Date(
|
|
256
256
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
257
257
|
), o = new Date(
|
|
258
258
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
259
259
|
).getTime() - n.getTime();
|
|
260
260
|
return Math.floor(o / (1e3 * 60 * 60 * 24));
|
|
261
|
-
},
|
|
261
|
+
}, Ps = (t) => {
|
|
262
262
|
const s = /* @__PURE__ */ new Date();
|
|
263
263
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
264
264
|
return "Just now";
|
|
265
|
-
const r =
|
|
265
|
+
const r = Os(t, s);
|
|
266
266
|
return r === 0 ? t.toLocaleTimeString([], {
|
|
267
267
|
hour: "numeric",
|
|
268
268
|
minute: "2-digit",
|
|
@@ -272,7 +272,7 @@ const wt = z.createContext({
|
|
|
272
272
|
day: "numeric",
|
|
273
273
|
year: "2-digit"
|
|
274
274
|
});
|
|
275
|
-
},
|
|
275
|
+
}, st = [
|
|
276
276
|
"🍎",
|
|
277
277
|
// Apple
|
|
278
278
|
"🍌",
|
|
@@ -300,7 +300,7 @@ const wt = z.createContext({
|
|
|
300
300
|
"🍈"
|
|
301
301
|
// Melon
|
|
302
302
|
];
|
|
303
|
-
function
|
|
303
|
+
function Us(t) {
|
|
304
304
|
let s = 0;
|
|
305
305
|
for (let n = 0; n < t.length; n++) {
|
|
306
306
|
const r = t.charCodeAt(n);
|
|
@@ -308,9 +308,9 @@ function Ys(t) {
|
|
|
308
308
|
}
|
|
309
309
|
return Math.abs(s);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
311
|
+
function Bs(t) {
|
|
312
|
+
const n = Us(t) % st.length;
|
|
313
|
+
return st[n];
|
|
314
314
|
}
|
|
315
315
|
const ne = ({
|
|
316
316
|
id: t,
|
|
@@ -321,7 +321,7 @@ const ne = ({
|
|
|
321
321
|
shape: l = "squircle",
|
|
322
322
|
dmAgentEnabled: i = !1
|
|
323
323
|
}) => {
|
|
324
|
-
const c =
|
|
324
|
+
const c = Bs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
|
|
325
325
|
borderRadius: "33%",
|
|
326
326
|
cornerShape: "superellipse(1.3)"
|
|
327
327
|
}, v = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ e(
|
|
@@ -335,7 +335,7 @@ const ne = ({
|
|
|
335
335
|
"div",
|
|
336
336
|
{
|
|
337
337
|
"aria-hidden": "true",
|
|
338
|
-
className:
|
|
338
|
+
className: L(
|
|
339
339
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
340
340
|
u
|
|
341
341
|
),
|
|
@@ -345,7 +345,7 @@ const ne = ({
|
|
|
345
345
|
return /* @__PURE__ */ d(
|
|
346
346
|
"div",
|
|
347
347
|
{
|
|
348
|
-
className:
|
|
348
|
+
className: L(
|
|
349
349
|
"relative flex-shrink-0 !bg-transparent",
|
|
350
350
|
r
|
|
351
351
|
),
|
|
@@ -359,21 +359,21 @@ const ne = ({
|
|
|
359
359
|
{
|
|
360
360
|
"aria-hidden": "true",
|
|
361
361
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
362
|
-
children: /* @__PURE__ */ e(
|
|
362
|
+
children: /* @__PURE__ */ e(Ee, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
363
363
|
}
|
|
364
364
|
),
|
|
365
365
|
/* @__PURE__ */ e(
|
|
366
366
|
"div",
|
|
367
367
|
{
|
|
368
368
|
"data-testid": "avatar-ring",
|
|
369
|
-
className:
|
|
369
|
+
className: L(
|
|
370
370
|
"h-full w-full",
|
|
371
371
|
"bg-transparent"
|
|
372
372
|
),
|
|
373
373
|
style: {
|
|
374
374
|
...f,
|
|
375
375
|
...i && {
|
|
376
|
-
borderWidth: `${
|
|
376
|
+
borderWidth: `${h}px`,
|
|
377
377
|
borderStyle: "solid",
|
|
378
378
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
379
379
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
@@ -385,7 +385,7 @@ const ne = ({
|
|
|
385
385
|
]
|
|
386
386
|
}
|
|
387
387
|
);
|
|
388
|
-
},
|
|
388
|
+
}, zs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
389
389
|
"svg",
|
|
390
390
|
{
|
|
391
391
|
width: t,
|
|
@@ -402,93 +402,93 @@ const ne = ({
|
|
|
402
402
|
}
|
|
403
403
|
)
|
|
404
404
|
}
|
|
405
|
-
),
|
|
405
|
+
), $s = (t) => {
|
|
406
406
|
var s;
|
|
407
407
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
408
|
-
},
|
|
408
|
+
}, js = (t) => {
|
|
409
409
|
var s;
|
|
410
410
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
411
|
-
},
|
|
411
|
+
}, De = (t) => {
|
|
412
412
|
var s;
|
|
413
413
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
414
|
-
},
|
|
414
|
+
}, Gs = (t) => {
|
|
415
415
|
var s;
|
|
416
416
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
417
|
-
},
|
|
417
|
+
}, xt = (t) => $s(t) || js(t), Vs = (t) => {
|
|
418
418
|
var s;
|
|
419
|
-
return
|
|
420
|
-
},
|
|
419
|
+
return xt(t) && !((s = t.text) != null && s.trim());
|
|
420
|
+
}, Ne = ({
|
|
421
421
|
message: t,
|
|
422
422
|
standalone: s = !1,
|
|
423
423
|
isMyMessage: n = !1,
|
|
424
424
|
hasAttachment: r = !1
|
|
425
425
|
}) => {
|
|
426
426
|
var f;
|
|
427
|
-
const o =
|
|
427
|
+
const o = xt(t), l = De(t);
|
|
428
428
|
if (!o && !l)
|
|
429
429
|
return null;
|
|
430
430
|
if (o) {
|
|
431
431
|
const v = (f = t.metadata) == null ? void 0 : f.amount_text;
|
|
432
432
|
if (!v) return null;
|
|
433
|
-
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
433
|
+
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${v} tip` : `Delivered with ${v} tip`;
|
|
434
434
|
return /* @__PURE__ */ d("div", { className: a, children: [
|
|
435
|
-
/* @__PURE__ */ e(
|
|
436
|
-
/* @__PURE__ */ e("span", { children:
|
|
435
|
+
/* @__PURE__ */ e(hs, { size: s ? 14 : 12 }),
|
|
436
|
+
/* @__PURE__ */ e("span", { children: y })
|
|
437
437
|
] });
|
|
438
438
|
}
|
|
439
|
-
const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent",
|
|
439
|
+
const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent", m = [
|
|
440
440
|
"message-chatbot-indicator",
|
|
441
441
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
442
442
|
i ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
443
|
-
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }),
|
|
444
|
-
return /* @__PURE__ */ e("div", { className:
|
|
443
|
+
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(zs, { size: i ? 12 : 15 }) });
|
|
444
|
+
return /* @__PURE__ */ e("div", { className: m, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(ce, { children: [
|
|
445
445
|
u,
|
|
446
|
-
|
|
447
|
-
] }) : /* @__PURE__ */ d(
|
|
448
|
-
|
|
446
|
+
h
|
|
447
|
+
] }) : /* @__PURE__ */ d(ce, { children: [
|
|
448
|
+
h,
|
|
449
449
|
u
|
|
450
450
|
] }) });
|
|
451
|
-
},
|
|
451
|
+
}, vt = O.memo(
|
|
452
452
|
({ channel: t, unread: s }) => {
|
|
453
|
-
var
|
|
454
|
-
const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } =
|
|
453
|
+
var P, U, k, T;
|
|
454
|
+
const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = Fs(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
455
455
|
t && r(t);
|
|
456
|
-
},
|
|
457
|
-
const
|
|
458
|
-
!
|
|
459
|
-
},
|
|
460
|
-
(
|
|
461
|
-
var
|
|
462
|
-
return ((
|
|
456
|
+
}, m = (M) => {
|
|
457
|
+
const _ = M.key === "Enter" || M.key === " ", N = M.repeat;
|
|
458
|
+
!_ || N || (M.preventDefault(), c());
|
|
459
|
+
}, h = Object.values(((P = t == null ? void 0 : t.state) == null ? void 0 : P.members) || {}).find(
|
|
460
|
+
(M) => {
|
|
461
|
+
var _, N;
|
|
462
|
+
return ((_ = M.user) == null ? void 0 : _.id) && M.user.id !== ((N = t == null ? void 0 : t._client) == null ? void 0 : N.userID);
|
|
463
463
|
}
|
|
464
|
-
), f = ((
|
|
465
|
-
var
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
468
|
-
for (let
|
|
469
|
-
if (
|
|
464
|
+
), f = ((U = h == null ? void 0 : h.user) == null ? void 0 : U.name) || "Conversation", v = (k = h == null ? void 0 : h.user) == null ? void 0 : k.image, a = (() => {
|
|
465
|
+
var _;
|
|
466
|
+
const M = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages;
|
|
467
|
+
if (M != null && M.length) {
|
|
468
|
+
for (let N = M.length - 1; N >= 0; N--)
|
|
469
|
+
if (M[N].type !== "system") return M[N];
|
|
470
470
|
}
|
|
471
|
-
})(),
|
|
472
|
-
var
|
|
471
|
+
})(), b = (() => {
|
|
472
|
+
var N, F;
|
|
473
473
|
if (a != null && a.text) return a.text;
|
|
474
|
-
if (((
|
|
475
|
-
const
|
|
476
|
-
return
|
|
477
|
-
})(),
|
|
474
|
+
if (((N = a == null ? void 0 : a.metadata) == null ? void 0 : N.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
475
|
+
const _ = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
|
|
476
|
+
return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "📷 Sent an image" : _.type === "video" ? "🎥 Sent a video" : _.type === "audio" ? "🎵 Sent audio" : _.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
477
|
+
})(), C = a != null && a.created_at ? Ps(new Date(a.created_at)) : "", x = a ? De(a) : !1, I = l ? l(a, b) : `${x ? "✨ " : ""}${b}`, w = pt(t), E = s ?? 0;
|
|
478
478
|
return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
479
479
|
channelId: t == null ? void 0 : t.id,
|
|
480
480
|
isSelected: i,
|
|
481
481
|
participantName: f,
|
|
482
482
|
unreadCount: E,
|
|
483
|
-
hasTimestamp: !!
|
|
483
|
+
hasTimestamp: !!C
|
|
484
484
|
}), /* @__PURE__ */ e(
|
|
485
485
|
"div",
|
|
486
486
|
{
|
|
487
487
|
role: "button",
|
|
488
488
|
tabIndex: 0,
|
|
489
489
|
onClick: c,
|
|
490
|
-
onKeyDown:
|
|
491
|
-
className:
|
|
490
|
+
onKeyDown: m,
|
|
491
|
+
className: L(
|
|
492
492
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
493
493
|
{
|
|
494
494
|
"bg-primary-alt/10 border-l-4 border-l-primary": i,
|
|
@@ -499,7 +499,7 @@ const ne = ({
|
|
|
499
499
|
/* @__PURE__ */ e(
|
|
500
500
|
ne,
|
|
501
501
|
{
|
|
502
|
-
id: ((
|
|
502
|
+
id: ((T = h == null ? void 0 : h.user) == null ? void 0 : T.id) || t.id || "unknown",
|
|
503
503
|
name: f,
|
|
504
504
|
image: v,
|
|
505
505
|
size: 44,
|
|
@@ -512,7 +512,7 @@ const ne = ({
|
|
|
512
512
|
/* @__PURE__ */ d(
|
|
513
513
|
"h3",
|
|
514
514
|
{
|
|
515
|
-
className:
|
|
515
|
+
className: L(
|
|
516
516
|
"text-sm font-medium truncate",
|
|
517
517
|
i ? "text-primary" : "text-charcoal"
|
|
518
518
|
),
|
|
@@ -522,10 +522,10 @@ const ne = ({
|
|
|
522
522
|
]
|
|
523
523
|
}
|
|
524
524
|
),
|
|
525
|
-
|
|
525
|
+
C && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: C })
|
|
526
526
|
] }),
|
|
527
527
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
528
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
528
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: I }),
|
|
529
529
|
E > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: E > 99 ? "99+" : E })
|
|
530
530
|
] })
|
|
531
531
|
] })
|
|
@@ -534,8 +534,8 @@ const ne = ({
|
|
|
534
534
|
);
|
|
535
535
|
}
|
|
536
536
|
);
|
|
537
|
-
|
|
538
|
-
const
|
|
537
|
+
vt.displayName = "CustomChannelPreview";
|
|
538
|
+
const Hs = { last_message_at: -1 }, wt = O.memo(
|
|
539
539
|
({
|
|
540
540
|
onChannelSelect: t,
|
|
541
541
|
selectedChannel: s,
|
|
@@ -544,18 +544,18 @@ const Qs = { last_message_at: -1 }, _t = z.memo(
|
|
|
544
544
|
onMessageNew: o,
|
|
545
545
|
onAddedToChannel: l,
|
|
546
546
|
channelRenderFilterFn: i,
|
|
547
|
-
sort: c =
|
|
548
|
-
className:
|
|
547
|
+
sort: c = Hs,
|
|
548
|
+
className: m,
|
|
549
549
|
customEmptyStateIndicator: u,
|
|
550
|
-
renderMessagePreview:
|
|
550
|
+
renderMessagePreview: h
|
|
551
551
|
}) => {
|
|
552
|
-
const f =
|
|
552
|
+
const f = O.useRef(0);
|
|
553
553
|
f.current++;
|
|
554
|
-
const { debug: v = !1 } =
|
|
555
|
-
(
|
|
556
|
-
for (const
|
|
557
|
-
|
|
558
|
-
return i ? i(
|
|
554
|
+
const { debug: v = !1 } = Te(), a = O.useCallback(
|
|
555
|
+
(b) => {
|
|
556
|
+
for (const C of b)
|
|
557
|
+
Ls(C);
|
|
558
|
+
return i ? i(b) : b;
|
|
559
559
|
},
|
|
560
560
|
[i]
|
|
561
561
|
);
|
|
@@ -564,24 +564,24 @@ const Qs = { last_message_at: -1 }, _t = z.memo(
|
|
|
564
564
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
565
565
|
filters: n
|
|
566
566
|
});
|
|
567
|
-
const
|
|
567
|
+
const y = O.useMemo(
|
|
568
568
|
() => ({
|
|
569
569
|
selectedChannel: s,
|
|
570
570
|
onChannelSelect: t,
|
|
571
571
|
debug: v,
|
|
572
|
-
renderMessagePreview:
|
|
572
|
+
renderMessagePreview: h
|
|
573
573
|
}),
|
|
574
|
-
[s, t, v,
|
|
574
|
+
[s, t, v, h]
|
|
575
575
|
);
|
|
576
576
|
return /* @__PURE__ */ e(
|
|
577
577
|
"div",
|
|
578
578
|
{
|
|
579
|
-
className:
|
|
579
|
+
className: L(
|
|
580
580
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
581
|
-
|
|
581
|
+
m
|
|
582
582
|
),
|
|
583
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
584
|
-
|
|
583
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(As, { value: y, children: /* @__PURE__ */ e(
|
|
584
|
+
Rt,
|
|
585
585
|
{
|
|
586
586
|
filters: n,
|
|
587
587
|
sort: c,
|
|
@@ -590,7 +590,7 @@ const Qs = { last_message_at: -1 }, _t = z.memo(
|
|
|
590
590
|
onMessageNew: o,
|
|
591
591
|
onAddedToChannel: l,
|
|
592
592
|
channelRenderFilterFn: a,
|
|
593
|
-
Preview:
|
|
593
|
+
Preview: vt,
|
|
594
594
|
EmptyStateIndicator: u
|
|
595
595
|
},
|
|
596
596
|
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
@@ -599,8 +599,8 @@ const Qs = { last_message_at: -1 }, _t = z.memo(
|
|
|
599
599
|
);
|
|
600
600
|
}
|
|
601
601
|
);
|
|
602
|
-
|
|
603
|
-
const
|
|
602
|
+
wt.displayName = "ChannelList";
|
|
603
|
+
const me = ({
|
|
604
604
|
variant: t = "default",
|
|
605
605
|
className: s,
|
|
606
606
|
children: n,
|
|
@@ -609,7 +609,7 @@ const ke = ({
|
|
|
609
609
|
"button",
|
|
610
610
|
{
|
|
611
611
|
type: "button",
|
|
612
|
-
className:
|
|
612
|
+
className: L(
|
|
613
613
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
614
614
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
615
615
|
s
|
|
@@ -618,12 +618,12 @@ const ke = ({
|
|
|
618
618
|
children: n
|
|
619
619
|
}
|
|
620
620
|
);
|
|
621
|
-
function
|
|
621
|
+
function Ys({ label: t, className: s, children: n, ...r }) {
|
|
622
622
|
return /* @__PURE__ */ d(
|
|
623
623
|
"button",
|
|
624
624
|
{
|
|
625
625
|
type: "button",
|
|
626
|
-
className:
|
|
626
|
+
className: L(
|
|
627
627
|
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
628
628
|
{
|
|
629
629
|
"cursor-not-allowed opacity-50": r.disabled,
|
|
@@ -639,10 +639,10 @@ function Et({ label: t, className: s, children: n, ...r }) {
|
|
|
639
639
|
}
|
|
640
640
|
);
|
|
641
641
|
}
|
|
642
|
-
function
|
|
643
|
-
return /* @__PURE__ */ e(
|
|
642
|
+
function Ws({ onClick: t }) {
|
|
643
|
+
return /* @__PURE__ */ e(Ys, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
644
644
|
}
|
|
645
|
-
const
|
|
645
|
+
const qs = ({
|
|
646
646
|
dialogRef: t,
|
|
647
647
|
onClose: s,
|
|
648
648
|
participant: n,
|
|
@@ -651,80 +651,80 @@ const en = ({
|
|
|
651
651
|
onLeaveConversation: l,
|
|
652
652
|
onBlockParticipant: i,
|
|
653
653
|
showDeleteConversation: c = !0,
|
|
654
|
-
onDeleteConversationClick:
|
|
654
|
+
onDeleteConversationClick: m,
|
|
655
655
|
onBlockParticipantClick: u,
|
|
656
|
-
onReportParticipantClick:
|
|
656
|
+
onReportParticipantClick: h,
|
|
657
657
|
customProfileContent: f,
|
|
658
658
|
customChannelActions: v
|
|
659
659
|
}) => {
|
|
660
|
-
var $,
|
|
661
|
-
const { service: a, debug:
|
|
662
|
-
var
|
|
663
|
-
if (!(!a || !((
|
|
660
|
+
var S, $, V, ee, te, W, g;
|
|
661
|
+
const { service: a, debug: y } = Te(), [b, C] = A(!1), [x, I] = A(!1), [w, E] = A(!1), P = G(async () => {
|
|
662
|
+
var p;
|
|
663
|
+
if (!(!a || !((p = n == null ? void 0 : n.user) != null && p.id)))
|
|
664
664
|
try {
|
|
665
|
-
const
|
|
666
|
-
(
|
|
667
|
-
var
|
|
668
|
-
return
|
|
665
|
+
const j = (await a.getBlockedUsers()).some(
|
|
666
|
+
(Y) => {
|
|
667
|
+
var ae;
|
|
668
|
+
return Y.blocked_user_id === ((ae = n == null ? void 0 : n.user) == null ? void 0 : ae.id);
|
|
669
669
|
}
|
|
670
670
|
);
|
|
671
|
-
|
|
672
|
-
} catch (
|
|
671
|
+
C(j);
|
|
672
|
+
} catch (R) {
|
|
673
673
|
console.error(
|
|
674
674
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
675
|
-
|
|
675
|
+
R
|
|
676
676
|
);
|
|
677
677
|
}
|
|
678
|
-
}, [a, (
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
}, [
|
|
682
|
-
const
|
|
683
|
-
var
|
|
684
|
-
if (!
|
|
685
|
-
|
|
678
|
+
}, [a, (S = n == null ? void 0 : n.user) == null ? void 0 : S.id]);
|
|
679
|
+
Z(() => {
|
|
680
|
+
P();
|
|
681
|
+
}, [P]);
|
|
682
|
+
const U = async () => {
|
|
683
|
+
var p;
|
|
684
|
+
if (!x) {
|
|
685
|
+
m == null || m(), y && console.log("[ChannelInfoDialog] Leave conversation", r.cid), I(!0);
|
|
686
686
|
try {
|
|
687
|
-
const
|
|
688
|
-
await r.hide(
|
|
689
|
-
} catch (
|
|
690
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
687
|
+
const R = ((p = r._client) == null ? void 0 : p.userID) ?? null;
|
|
688
|
+
await r.hide(R, !1), l && await l(r), s();
|
|
689
|
+
} catch (R) {
|
|
690
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", R);
|
|
691
691
|
} finally {
|
|
692
|
-
|
|
692
|
+
I(!1);
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
},
|
|
696
|
-
var
|
|
695
|
+
}, k = async () => {
|
|
696
|
+
var p, R, j;
|
|
697
697
|
if (!(w || !a)) {
|
|
698
|
-
u == null || u(),
|
|
698
|
+
u == null || u(), y && console.log("[ChannelInfoDialog] Block member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
|
|
699
699
|
try {
|
|
700
|
-
await a.blockUser((
|
|
701
|
-
} catch (
|
|
702
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
700
|
+
await a.blockUser((R = n == null ? void 0 : n.user) == null ? void 0 : R.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
701
|
+
} catch (Y) {
|
|
702
|
+
console.error("[ChannelInfoDialog] Failed to block member", Y);
|
|
703
703
|
} finally {
|
|
704
704
|
E(!1);
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
-
},
|
|
708
|
-
var
|
|
707
|
+
}, T = async () => {
|
|
708
|
+
var p, R, j;
|
|
709
709
|
if (!(w || !a)) {
|
|
710
|
-
u == null || u(),
|
|
710
|
+
u == null || u(), y && console.log("[ChannelInfoDialog] Unblock member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
|
|
711
711
|
try {
|
|
712
|
-
await a.unBlockUser((
|
|
713
|
-
} catch (
|
|
714
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
712
|
+
await a.unBlockUser((R = n == null ? void 0 : n.user) == null ? void 0 : R.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
713
|
+
} catch (Y) {
|
|
714
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", Y);
|
|
715
715
|
} finally {
|
|
716
716
|
E(!1);
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
},
|
|
720
|
-
|
|
719
|
+
}, M = () => {
|
|
720
|
+
h == null || h(), s(), window.open(
|
|
721
721
|
"https://linktr.ee/s/about/trust-center/report",
|
|
722
722
|
"_blank",
|
|
723
723
|
"noopener,noreferrer"
|
|
724
724
|
);
|
|
725
725
|
};
|
|
726
726
|
if (!n) return null;
|
|
727
|
-
const
|
|
727
|
+
const _ = (($ = n.user) == null ? void 0 : $.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", N = (ee = n.user) == null ? void 0 : ee.image, F = (te = n.user) == null ? void 0 : te.email, H = (W = n.user) == null ? void 0 : W.username, D = F || (H ? `linktr.ee/${H}` : void 0), B = ((g = n.user) == null ? void 0 : g.id) || "unknown";
|
|
728
728
|
return (
|
|
729
729
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
730
730
|
/* @__PURE__ */ e(
|
|
@@ -733,13 +733,13 @@ const en = ({
|
|
|
733
733
|
ref: t,
|
|
734
734
|
className: "mes-dialog group",
|
|
735
735
|
onClose: s,
|
|
736
|
-
onClick: (
|
|
737
|
-
|
|
736
|
+
onClick: (p) => {
|
|
737
|
+
p.target === t.current && s();
|
|
738
738
|
},
|
|
739
739
|
children: /* @__PURE__ */ d("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
740
740
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
741
741
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
742
|
-
/* @__PURE__ */ e(
|
|
742
|
+
/* @__PURE__ */ e(Ws, { onClick: s })
|
|
743
743
|
] }),
|
|
744
744
|
/* @__PURE__ */ d("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
745
745
|
/* @__PURE__ */ d(
|
|
@@ -752,16 +752,16 @@ const en = ({
|
|
|
752
752
|
/* @__PURE__ */ e(
|
|
753
753
|
ne,
|
|
754
754
|
{
|
|
755
|
-
id:
|
|
756
|
-
name:
|
|
757
|
-
image:
|
|
755
|
+
id: B,
|
|
756
|
+
name: _,
|
|
757
|
+
image: N,
|
|
758
758
|
size: 88,
|
|
759
759
|
shape: "circle"
|
|
760
760
|
}
|
|
761
761
|
),
|
|
762
762
|
/* @__PURE__ */ d("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
763
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
764
|
-
|
|
763
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
|
|
764
|
+
D && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: D }),
|
|
765
765
|
o && !f && /* @__PURE__ */ e(
|
|
766
766
|
"span",
|
|
767
767
|
{
|
|
@@ -784,42 +784,42 @@ const en = ({
|
|
|
784
784
|
),
|
|
785
785
|
/* @__PURE__ */ d("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
786
786
|
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
787
|
-
|
|
787
|
+
me,
|
|
788
788
|
{
|
|
789
|
-
onClick:
|
|
790
|
-
disabled:
|
|
791
|
-
"aria-busy":
|
|
789
|
+
onClick: U,
|
|
790
|
+
disabled: x,
|
|
791
|
+
"aria-busy": x,
|
|
792
792
|
children: [
|
|
793
|
-
|
|
793
|
+
x ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(fs, { className: "h-5 w-5" }),
|
|
794
794
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
795
795
|
]
|
|
796
796
|
}
|
|
797
797
|
) }),
|
|
798
|
-
/* @__PURE__ */ e("li", { children:
|
|
799
|
-
|
|
798
|
+
/* @__PURE__ */ e("li", { children: b ? /* @__PURE__ */ d(
|
|
799
|
+
me,
|
|
800
800
|
{
|
|
801
|
-
onClick:
|
|
801
|
+
onClick: T,
|
|
802
802
|
disabled: w,
|
|
803
803
|
"aria-busy": w,
|
|
804
804
|
children: [
|
|
805
|
-
w ? /* @__PURE__ */ e(
|
|
805
|
+
w ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ze, { className: "h-5 w-5" }),
|
|
806
806
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
807
807
|
]
|
|
808
808
|
}
|
|
809
809
|
) : /* @__PURE__ */ d(
|
|
810
|
-
|
|
810
|
+
me,
|
|
811
811
|
{
|
|
812
|
-
onClick:
|
|
812
|
+
onClick: k,
|
|
813
813
|
disabled: w,
|
|
814
814
|
"aria-busy": w,
|
|
815
815
|
children: [
|
|
816
|
-
w ? /* @__PURE__ */ e(
|
|
816
|
+
w ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ze, { className: "h-5 w-5" }),
|
|
817
817
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
818
818
|
]
|
|
819
819
|
}
|
|
820
820
|
) }),
|
|
821
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
822
|
-
/* @__PURE__ */ e(
|
|
821
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(me, { variant: "danger", onClick: M, children: [
|
|
822
|
+
/* @__PURE__ */ e(gs, { className: "h-5 w-5" }),
|
|
823
823
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
824
824
|
] }) }),
|
|
825
825
|
v
|
|
@@ -829,30 +829,30 @@ const en = ({
|
|
|
829
829
|
}
|
|
830
830
|
)
|
|
831
831
|
);
|
|
832
|
-
},
|
|
833
|
-
function
|
|
834
|
-
return t != null && t.length ? t.some((s) => s.type ===
|
|
832
|
+
}, Xs = (t) => /* @__PURE__ */ e(Lt, { ...t, position: "center" }), Ie = "vote_up", ke = "vote_down";
|
|
833
|
+
function Zs(t) {
|
|
834
|
+
return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Ie) ? "up" : null : null;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
837
|
-
const { channel: s } =
|
|
838
|
-
() =>
|
|
836
|
+
function Js(t) {
|
|
837
|
+
const { channel: s } = oe(), { client: n } = Me("useMessageVote"), r = Ce(
|
|
838
|
+
() => Zs(t.own_reactions),
|
|
839
839
|
[t.own_reactions]
|
|
840
|
-
), o =
|
|
840
|
+
), o = G(async () => {
|
|
841
841
|
if (n != null && n.userID)
|
|
842
842
|
try {
|
|
843
|
-
r === "up" ? await s.deleteReaction(t.id,
|
|
843
|
+
r === "up" ? await s.deleteReaction(t.id, Ie) : await s.sendReaction(
|
|
844
844
|
t.id,
|
|
845
|
-
{ type:
|
|
845
|
+
{ type: Ie },
|
|
846
846
|
{ enforce_unique: !0, skip_push: !0 }
|
|
847
847
|
);
|
|
848
848
|
} catch {
|
|
849
849
|
}
|
|
850
|
-
}, [s, n == null ? void 0 : n.userID, t.id, r]), l =
|
|
850
|
+
}, [s, n == null ? void 0 : n.userID, t.id, r]), l = G(async () => {
|
|
851
851
|
if (n != null && n.userID)
|
|
852
852
|
try {
|
|
853
|
-
r === "down" ? await s.deleteReaction(t.id,
|
|
853
|
+
r === "down" ? await s.deleteReaction(t.id, ke) : await s.sendReaction(
|
|
854
854
|
t.id,
|
|
855
|
-
{ type:
|
|
855
|
+
{ type: ke },
|
|
856
856
|
{ enforce_unique: !0, skip_push: !0 }
|
|
857
857
|
);
|
|
858
858
|
} catch {
|
|
@@ -860,21 +860,21 @@ function nn(t) {
|
|
|
860
860
|
}, [s, n == null ? void 0 : n.userID, t.id, r]);
|
|
861
861
|
return { selected: r, voteUp: o, voteDown: l };
|
|
862
862
|
}
|
|
863
|
-
const
|
|
863
|
+
const Ks = O.lazy(() => import("./Card-BjTfMGsC.js")), Qs = O.lazy(() => import("./Card-D3E-WTRO.js")), Nt = () => /* @__PURE__ */ e(
|
|
864
864
|
"div",
|
|
865
865
|
{
|
|
866
866
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
867
867
|
"aria-hidden": !0
|
|
868
868
|
}
|
|
869
|
-
),
|
|
869
|
+
), en = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(Nt, {}), children: /* @__PURE__ */ e(Ks, { ...t }) }), tn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(Nt, {}), children: /* @__PURE__ */ e(Qs, { ...t }) }), nt = { Creator: en, Visitor: tn }, sn = {
|
|
870
870
|
isUnlocking: () => !1
|
|
871
|
-
},
|
|
872
|
-
LockedAttachment:
|
|
873
|
-
},
|
|
874
|
-
function
|
|
875
|
-
return
|
|
871
|
+
}, nn = {
|
|
872
|
+
LockedAttachment: sn
|
|
873
|
+
}, _t = ot({}), ia = _t.Provider;
|
|
874
|
+
function an(t) {
|
|
875
|
+
return lt(_t)[t] ?? nn[t];
|
|
876
876
|
}
|
|
877
|
-
const
|
|
877
|
+
const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
878
878
|
"path",
|
|
879
879
|
{
|
|
880
880
|
d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
|
|
@@ -884,7 +884,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
884
884
|
strokeLinejoin: "round",
|
|
885
885
|
fill: t ? "currentColor" : "none"
|
|
886
886
|
}
|
|
887
|
-
) }),
|
|
887
|
+
) }), on = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
888
888
|
"path",
|
|
889
889
|
{
|
|
890
890
|
d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
|
|
@@ -894,7 +894,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
894
894
|
strokeLinejoin: "round",
|
|
895
895
|
fill: t ? "currentColor" : "none"
|
|
896
896
|
}
|
|
897
|
-
) }),
|
|
897
|
+
) }), ln = ({
|
|
898
898
|
selected: t,
|
|
899
899
|
onVoteUp: s,
|
|
900
900
|
onVoteDown: n
|
|
@@ -907,7 +907,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
907
907
|
onClick: s,
|
|
908
908
|
"aria-label": "Helpful",
|
|
909
909
|
"aria-pressed": t === "up",
|
|
910
|
-
children: /* @__PURE__ */ e(
|
|
910
|
+
children: /* @__PURE__ */ e(rn, { filled: t === "up" })
|
|
911
911
|
}
|
|
912
912
|
),
|
|
913
913
|
/* @__PURE__ */ e(
|
|
@@ -918,11 +918,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
918
918
|
onClick: n,
|
|
919
919
|
"aria-label": "Not helpful",
|
|
920
920
|
"aria-pressed": t === "down",
|
|
921
|
-
children: /* @__PURE__ */ e(
|
|
921
|
+
children: /* @__PURE__ */ e(on, { filled: t === "down" })
|
|
922
922
|
}
|
|
923
923
|
)
|
|
924
|
-
] }),
|
|
925
|
-
var
|
|
924
|
+
] }), cn = (t) => {
|
|
925
|
+
var se, Oe, Pe, Ue, Be, ze, $e, je, Ge, Ve, He, Ye, We, qe;
|
|
926
926
|
const {
|
|
927
927
|
additionalMessageInputProps: s,
|
|
928
928
|
chatbotVotingEnabled: n,
|
|
@@ -931,77 +931,77 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
931
931
|
firstOfGroup: l,
|
|
932
932
|
groupedByUser: i,
|
|
933
933
|
handleAction: c,
|
|
934
|
-
handleOpenThread:
|
|
934
|
+
handleOpenThread: m,
|
|
935
935
|
handleRetry: u,
|
|
936
|
-
highlighted:
|
|
936
|
+
highlighted: h,
|
|
937
937
|
isMessageAIGenerated: f,
|
|
938
938
|
isMyMessage: v,
|
|
939
939
|
message: a,
|
|
940
|
-
renderText:
|
|
941
|
-
threadList:
|
|
942
|
-
} = t, { client:
|
|
943
|
-
Attachment:
|
|
944
|
-
EditMessageModal:
|
|
945
|
-
MessageBlocked:
|
|
946
|
-
MessageBouncePrompt:
|
|
947
|
-
MessageDeleted:
|
|
948
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
949
|
-
MessageRepliesCountButton:
|
|
950
|
-
ReminderNotification:
|
|
951
|
-
StreamedMessageText:
|
|
952
|
-
PinIndicator:
|
|
953
|
-
} =
|
|
940
|
+
renderText: y,
|
|
941
|
+
threadList: b
|
|
942
|
+
} = t, { client: C } = Me("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } = an("LockedAttachment"), [U, k] = A(!1), T = Ft(a.id), { selected: M, voteUp: _, voteDown: N } = Js(a), {
|
|
943
|
+
Attachment: F = Ot,
|
|
944
|
+
EditMessageModal: H = Pt,
|
|
945
|
+
MessageBlocked: D = Ut,
|
|
946
|
+
MessageBouncePrompt: B = Bt,
|
|
947
|
+
MessageDeleted: S = zt,
|
|
948
|
+
MessageIsThreadReplyInChannelButtonIndicator: $ = $t,
|
|
949
|
+
MessageRepliesCountButton: V = jt,
|
|
950
|
+
ReminderNotification: ee = Gt,
|
|
951
|
+
StreamedMessageText: te = Vt,
|
|
952
|
+
PinIndicator: W
|
|
953
|
+
} = dt("CustomMessage"), g = Ht(a), p = Yt(a), R = Ce(
|
|
954
954
|
() => f == null ? void 0 : f(a),
|
|
955
955
|
[f, a]
|
|
956
|
-
),
|
|
956
|
+
), j = Ce(
|
|
957
957
|
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
958
958
|
[a]
|
|
959
959
|
);
|
|
960
|
-
if (
|
|
960
|
+
if (Wt(a))
|
|
961
961
|
return null;
|
|
962
962
|
if (a.deleted_at || a.type === "deleted")
|
|
963
|
-
return /* @__PURE__ */ e(
|
|
964
|
-
if (
|
|
965
|
-
return /* @__PURE__ */ e(
|
|
966
|
-
const
|
|
963
|
+
return /* @__PURE__ */ e(S, { message: a });
|
|
964
|
+
if (qt(a))
|
|
965
|
+
return /* @__PURE__ */ e(D, {});
|
|
966
|
+
const Y = !b && !!a.reply_count, ae = !b && a.show_in_channel && a.parent_id, de = a.status === "failed" && ((se = a.error) == null ? void 0 : se.status) !== 403, re = Xt(a);
|
|
967
967
|
let q;
|
|
968
|
-
|
|
969
|
-
const
|
|
968
|
+
de ? q = () => u(a) : re && (q = () => k(!0));
|
|
969
|
+
const ie = v(), pe = L(
|
|
970
970
|
"str-chat__message str-chat__message-simple",
|
|
971
971
|
`str-chat__message--${a.type}`,
|
|
972
972
|
`str-chat__message--${a.status}`,
|
|
973
|
-
|
|
973
|
+
ie ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
974
974
|
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
975
975
|
{
|
|
976
|
-
"str-chat__message--has-attachment":
|
|
977
|
-
"str-chat__message--highlighted":
|
|
976
|
+
"str-chat__message--has-attachment": g,
|
|
977
|
+
"str-chat__message--highlighted": h,
|
|
978
978
|
"str-chat__message--pinned pinned-message": a.pinned,
|
|
979
|
-
"str-chat__message--with-reactions":
|
|
980
|
-
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((
|
|
981
|
-
"str-chat__message-with-thread-link":
|
|
979
|
+
"str-chat__message--with-reactions": p,
|
|
980
|
+
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((Oe = a == null ? void 0 : a.error) == null ? void 0 : Oe.status) !== 403,
|
|
981
|
+
"str-chat__message-with-thread-link": Y || ae,
|
|
982
982
|
"str-chat__virtual-message__wrapper--end": o,
|
|
983
983
|
"str-chat__virtual-message__wrapper--first": l,
|
|
984
984
|
"str-chat__virtual-message__wrapper--group": i
|
|
985
985
|
}
|
|
986
|
-
),
|
|
987
|
-
return /* @__PURE__ */ d(
|
|
986
|
+
), ue = a.poll_id && C.polls.fromState(a.poll_id), xe = Vs(a), K = De(a), z = Gs(a), X = !!(j != null && j.length && !a.quoted_message), Q = K && ie && X;
|
|
987
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
988
988
|
r && /* @__PURE__ */ e(
|
|
989
|
-
|
|
989
|
+
H,
|
|
990
990
|
{
|
|
991
991
|
additionalMessageInputProps: s
|
|
992
992
|
}
|
|
993
993
|
),
|
|
994
|
-
|
|
995
|
-
|
|
994
|
+
U && /* @__PURE__ */ e(
|
|
995
|
+
Zt,
|
|
996
996
|
{
|
|
997
|
-
MessageBouncePrompt:
|
|
998
|
-
onClose: () =>
|
|
999
|
-
open:
|
|
997
|
+
MessageBouncePrompt: B,
|
|
998
|
+
onClose: () => k(!1),
|
|
999
|
+
open: U
|
|
1000
1000
|
}
|
|
1001
1001
|
),
|
|
1002
|
-
/* @__PURE__ */ d("div", { className:
|
|
1003
|
-
|
|
1004
|
-
!!
|
|
1002
|
+
/* @__PURE__ */ d("div", { className: pe, children: [
|
|
1003
|
+
W && /* @__PURE__ */ e(W, {}),
|
|
1004
|
+
!!T && /* @__PURE__ */ e(ee, { reminder: T }),
|
|
1005
1005
|
a.user && /* @__PURE__ */ e(
|
|
1006
1006
|
ne,
|
|
1007
1007
|
{
|
|
@@ -1014,8 +1014,8 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1014
1014
|
/* @__PURE__ */ e(
|
|
1015
1015
|
"div",
|
|
1016
1016
|
{
|
|
1017
|
-
className:
|
|
1018
|
-
"str-chat__simple-message--error-failed":
|
|
1017
|
+
className: L("str-chat__message-inner", {
|
|
1018
|
+
"str-chat__simple-message--error-failed": de || re
|
|
1019
1019
|
}),
|
|
1020
1020
|
"data-testid": "message-inner",
|
|
1021
1021
|
onClick: q,
|
|
@@ -1028,106 +1028,106 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1028
1028
|
marginInlineEnd: 0,
|
|
1029
1029
|
marginInlineStart: 0
|
|
1030
1030
|
},
|
|
1031
|
-
children:
|
|
1032
|
-
|
|
1033
|
-
|
|
1031
|
+
children: z ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1032
|
+
ie ? /* @__PURE__ */ e(
|
|
1033
|
+
nt.Creator,
|
|
1034
1034
|
{
|
|
1035
|
-
title: (
|
|
1036
|
-
mimeType: (
|
|
1037
|
-
thumbnailUrl: (
|
|
1038
|
-
amountText: (
|
|
1039
|
-
detail: (
|
|
1040
|
-
paymentStatus: (
|
|
1041
|
-
isUnlocking:
|
|
1042
|
-
onPreviewClick: () => w == null ? void 0 : w(a,
|
|
1043
|
-
onFetchSource: async () => await (E == null ? void 0 : E(a,
|
|
1035
|
+
title: (Pe = a.metadata) == null ? void 0 : Pe.attachment_title,
|
|
1036
|
+
mimeType: (Ue = a.metadata) == null ? void 0 : Ue.attachment_mime_type,
|
|
1037
|
+
thumbnailUrl: (Be = a.metadata) == null ? void 0 : Be.attachment_thumbnail,
|
|
1038
|
+
amountText: (ze = a.metadata) == null ? void 0 : ze.amount_text,
|
|
1039
|
+
detail: ($e = a.metadata) == null ? void 0 : $e.attachment_detail,
|
|
1040
|
+
paymentStatus: (je = a.metadata) == null ? void 0 : je.payment_status,
|
|
1041
|
+
isUnlocking: I(a.id),
|
|
1042
|
+
onPreviewClick: () => w == null ? void 0 : w(a, x),
|
|
1043
|
+
onFetchSource: async () => await (E == null ? void 0 : E(a, x))
|
|
1044
1044
|
}
|
|
1045
1045
|
) : /* @__PURE__ */ e(
|
|
1046
|
-
|
|
1046
|
+
nt.Visitor,
|
|
1047
1047
|
{
|
|
1048
|
-
title: (
|
|
1049
|
-
mimeType: (
|
|
1050
|
-
thumbnailUrl: (
|
|
1051
|
-
amountText: (
|
|
1052
|
-
detail: (
|
|
1053
|
-
paymentStatus: (
|
|
1054
|
-
isUnlocking:
|
|
1055
|
-
onUnlockClick: () => w == null ? void 0 : w(a,
|
|
1056
|
-
onFetchSource: async () => await (E == null ? void 0 : E(a,
|
|
1057
|
-
onDownloadClick: () =>
|
|
1048
|
+
title: (Ge = a.metadata) == null ? void 0 : Ge.attachment_title,
|
|
1049
|
+
mimeType: (Ve = a.metadata) == null ? void 0 : Ve.attachment_mime_type,
|
|
1050
|
+
thumbnailUrl: (He = a.metadata) == null ? void 0 : He.attachment_thumbnail,
|
|
1051
|
+
amountText: (Ye = a.metadata) == null ? void 0 : Ye.amount_text,
|
|
1052
|
+
detail: (We = a.metadata) == null ? void 0 : We.attachment_detail,
|
|
1053
|
+
paymentStatus: (qe = a.metadata) == null ? void 0 : qe.payment_status,
|
|
1054
|
+
isUnlocking: I(a.id),
|
|
1055
|
+
onUnlockClick: () => w == null ? void 0 : w(a, x),
|
|
1056
|
+
onFetchSource: async () => await (E == null ? void 0 : E(a, x)),
|
|
1057
|
+
onDownloadClick: () => P == null ? void 0 : P(a, x)
|
|
1058
1058
|
}
|
|
1059
1059
|
),
|
|
1060
|
-
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(
|
|
1061
|
-
] }) :
|
|
1060
|
+
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Xe, { message: a, renderText: y }) })
|
|
1061
|
+
] }) : xe ? (
|
|
1062
1062
|
/* Tip-only messages render as a standalone bubble */
|
|
1063
|
-
/* @__PURE__ */ e(
|
|
1063
|
+
/* @__PURE__ */ e(Ne, { message: a, standalone: !0 })
|
|
1064
1064
|
) : /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1065
1065
|
/* @__PURE__ */ d("div", { className: "str-chat__message-bubble", children: [
|
|
1066
|
-
|
|
1067
|
-
|
|
1066
|
+
K && !Q && /* @__PURE__ */ e(
|
|
1067
|
+
Ne,
|
|
1068
1068
|
{
|
|
1069
1069
|
message: a,
|
|
1070
|
-
hasAttachment:
|
|
1071
|
-
isMyMessage:
|
|
1070
|
+
hasAttachment: X,
|
|
1071
|
+
isMyMessage: ie
|
|
1072
1072
|
}
|
|
1073
1073
|
),
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1074
|
+
ue && /* @__PURE__ */ e(Jt, { poll: ue }),
|
|
1075
|
+
j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
1076
|
+
F,
|
|
1077
1077
|
{
|
|
1078
1078
|
actionHandler: c,
|
|
1079
|
-
attachments:
|
|
1079
|
+
attachments: j
|
|
1080
1080
|
}
|
|
1081
1081
|
) : null,
|
|
1082
|
-
|
|
1083
|
-
|
|
1082
|
+
R ? /* @__PURE__ */ e(
|
|
1083
|
+
te,
|
|
1084
1084
|
{
|
|
1085
1085
|
message: a,
|
|
1086
|
-
renderText:
|
|
1086
|
+
renderText: y
|
|
1087
1087
|
}
|
|
1088
|
-
) : /* @__PURE__ */ e(
|
|
1089
|
-
/* @__PURE__ */ e(
|
|
1088
|
+
) : /* @__PURE__ */ e(Xe, { message: a, renderText: y }),
|
|
1089
|
+
/* @__PURE__ */ e(Kt, {})
|
|
1090
1090
|
] }),
|
|
1091
|
-
(!
|
|
1092
|
-
|
|
1091
|
+
(!K || Q) && /* @__PURE__ */ e(
|
|
1092
|
+
Ne,
|
|
1093
1093
|
{
|
|
1094
1094
|
message: a,
|
|
1095
|
-
hasAttachment:
|
|
1096
|
-
isMyMessage:
|
|
1095
|
+
hasAttachment: X,
|
|
1096
|
+
isMyMessage: ie
|
|
1097
1097
|
}
|
|
1098
1098
|
),
|
|
1099
|
-
n &&
|
|
1100
|
-
|
|
1099
|
+
n && K && /* @__PURE__ */ e(
|
|
1100
|
+
ln,
|
|
1101
1101
|
{
|
|
1102
|
-
selected:
|
|
1103
|
-
onVoteUp:
|
|
1104
|
-
onVoteDown:
|
|
1102
|
+
selected: M,
|
|
1103
|
+
onVoteUp: _,
|
|
1104
|
+
onVoteDown: N
|
|
1105
1105
|
}
|
|
1106
1106
|
)
|
|
1107
1107
|
] })
|
|
1108
1108
|
}
|
|
1109
1109
|
),
|
|
1110
|
-
|
|
1111
|
-
|
|
1110
|
+
Y && /* @__PURE__ */ e(
|
|
1111
|
+
V,
|
|
1112
1112
|
{
|
|
1113
|
-
onClick:
|
|
1113
|
+
onClick: m,
|
|
1114
1114
|
reply_count: a.reply_count
|
|
1115
1115
|
}
|
|
1116
1116
|
),
|
|
1117
|
-
|
|
1117
|
+
ae && /* @__PURE__ */ e($, {})
|
|
1118
1118
|
] }, a.id)
|
|
1119
1119
|
] });
|
|
1120
|
-
},
|
|
1121
|
-
|
|
1122
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 :
|
|
1123
|
-
),
|
|
1124
|
-
const s =
|
|
1125
|
-
return /* @__PURE__ */ e(
|
|
1126
|
-
},
|
|
1120
|
+
}, dn = O.memo(
|
|
1121
|
+
cn,
|
|
1122
|
+
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : At(t, s)
|
|
1123
|
+
), un = (t) => {
|
|
1124
|
+
const s = ut("CustomMessage");
|
|
1125
|
+
return /* @__PURE__ */ e(dn, { ...s, ...t });
|
|
1126
|
+
}, mn = (t) => ({
|
|
1127
1127
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1128
|
-
(s) =>
|
|
1128
|
+
(s) => tt.previewIsLoaded(s) || tt.previewIsLoading(s)
|
|
1129
1129
|
)
|
|
1130
|
-
}),
|
|
1130
|
+
}), hn = ({
|
|
1131
1131
|
link: t,
|
|
1132
1132
|
onDismiss: s
|
|
1133
1133
|
}) => {
|
|
@@ -1157,7 +1157,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1157
1157
|
},
|
|
1158
1158
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1159
1159
|
"aria-label": "Close link preview",
|
|
1160
|
-
children: /* @__PURE__ */ e(
|
|
1160
|
+
children: /* @__PURE__ */ e(mt, { className: "size-4 text-black/90" })
|
|
1161
1161
|
}
|
|
1162
1162
|
),
|
|
1163
1163
|
/* @__PURE__ */ d("div", { className: "p-2", children: [
|
|
@@ -1167,22 +1167,22 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1167
1167
|
]
|
|
1168
1168
|
}
|
|
1169
1169
|
);
|
|
1170
|
-
},
|
|
1171
|
-
const { linkPreviewsManager: t } =
|
|
1170
|
+
}, fn = () => {
|
|
1171
|
+
const { linkPreviewsManager: t } = Qt(), { linkPreviews: s } = es(
|
|
1172
1172
|
t.state,
|
|
1173
|
-
|
|
1173
|
+
mn
|
|
1174
1174
|
), n = (o) => {
|
|
1175
1175
|
t.dismissPreview(o);
|
|
1176
1176
|
};
|
|
1177
1177
|
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
|
|
1178
|
-
|
|
1178
|
+
hn,
|
|
1179
1179
|
{
|
|
1180
1180
|
link: o,
|
|
1181
1181
|
onDismiss: n
|
|
1182
1182
|
},
|
|
1183
1183
|
o.og_scrape_url
|
|
1184
1184
|
)) }) : null;
|
|
1185
|
-
},
|
|
1185
|
+
}, gn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
|
|
1186
1186
|
"button",
|
|
1187
1187
|
{
|
|
1188
1188
|
...n,
|
|
@@ -1190,22 +1190,22 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1190
1190
|
"aria-label": "Send",
|
|
1191
1191
|
disabled: s,
|
|
1192
1192
|
onClick: t,
|
|
1193
|
-
children: /* @__PURE__ */ e(
|
|
1193
|
+
children: /* @__PURE__ */ e(bs, { weight: "bold", className: "size-4" })
|
|
1194
1194
|
}
|
|
1195
|
-
),
|
|
1195
|
+
), bn = () => {
|
|
1196
1196
|
var c;
|
|
1197
|
-
const { channel: t } =
|
|
1197
|
+
const { channel: t } = oe(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = ss(), { SendButton: r } = dt(
|
|
1198
1198
|
"CustomMessageInput"
|
|
1199
|
-
), o = r ??
|
|
1200
|
-
return /* @__PURE__ */ d(
|
|
1201
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1199
|
+
), o = r ?? gn, l = ns();
|
|
1200
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
1201
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(as, {}) }),
|
|
1202
1202
|
/* @__PURE__ */ d("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
1203
|
-
/* @__PURE__ */ e(
|
|
1204
|
-
/* @__PURE__ */ e(
|
|
1205
|
-
/* @__PURE__ */ e(
|
|
1203
|
+
/* @__PURE__ */ e(rs, {}),
|
|
1204
|
+
/* @__PURE__ */ e(fn, {}),
|
|
1205
|
+
/* @__PURE__ */ e(is, {}),
|
|
1206
1206
|
/* @__PURE__ */ d("div", { className: "flex", children: [
|
|
1207
1207
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1208
|
-
|
|
1208
|
+
os,
|
|
1209
1209
|
{
|
|
1210
1210
|
"aria-disabled": s || void 0,
|
|
1211
1211
|
className: "w-full resize-none outline-none leading-6",
|
|
@@ -1229,11 +1229,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1229
1229
|
] })
|
|
1230
1230
|
] })
|
|
1231
1231
|
] });
|
|
1232
|
-
},
|
|
1232
|
+
}, pn = ({
|
|
1233
1233
|
renderActions: t
|
|
1234
1234
|
}) => {
|
|
1235
1235
|
var r;
|
|
1236
|
-
const { channel: s } =
|
|
1236
|
+
const { channel: s } = oe(), n = ((r = s == null ? void 0 : s.data) == null ? void 0 : r.frozen) === !0;
|
|
1237
1237
|
return /* @__PURE__ */ d(
|
|
1238
1238
|
"div",
|
|
1239
1239
|
{
|
|
@@ -1242,65 +1242,65 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1242
1242
|
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1243
1243
|
children: [
|
|
1244
1244
|
t == null ? void 0 : t(),
|
|
1245
|
-
/* @__PURE__ */ e(
|
|
1245
|
+
/* @__PURE__ */ e(ts, { Input: bn })
|
|
1246
1246
|
]
|
|
1247
1247
|
}
|
|
1248
1248
|
);
|
|
1249
|
-
},
|
|
1249
|
+
}, xn = [
|
|
1250
1250
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1251
1251
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1252
|
-
],
|
|
1252
|
+
], vn = {
|
|
1253
1253
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1254
1254
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1255
|
-
},
|
|
1255
|
+
}, wn = [
|
|
1256
1256
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1257
|
-
],
|
|
1257
|
+
], Nn = {
|
|
1258
1258
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1259
|
-
},
|
|
1259
|
+
}, _e = "age safety guidelines.", _n = "https://linktr.ee/s/about/contact", at = (t) => xn.includes(t), yn = (t) => wn.includes(t), Cn = (t) => {
|
|
1260
1260
|
var r;
|
|
1261
1261
|
const s = (r = t.metadata) == null ? void 0 : r.custom_type;
|
|
1262
|
-
if (
|
|
1262
|
+
if (at(s))
|
|
1263
1263
|
return {
|
|
1264
1264
|
kind: "dm-agent",
|
|
1265
1265
|
type: s
|
|
1266
1266
|
};
|
|
1267
|
-
if (
|
|
1267
|
+
if (yn(s))
|
|
1268
1268
|
return {
|
|
1269
1269
|
kind: "age-safety",
|
|
1270
1270
|
type: s
|
|
1271
1271
|
};
|
|
1272
1272
|
const n = t.dm_agent_system_type;
|
|
1273
|
-
if (
|
|
1273
|
+
if (at(n))
|
|
1274
1274
|
return {
|
|
1275
1275
|
kind: "dm-agent",
|
|
1276
1276
|
type: n
|
|
1277
1277
|
};
|
|
1278
|
-
},
|
|
1279
|
-
const s = t.indexOf(
|
|
1278
|
+
}, En = (t) => {
|
|
1279
|
+
const s = t.indexOf(_e);
|
|
1280
1280
|
if (s === -1)
|
|
1281
1281
|
return t;
|
|
1282
|
-
const n = s +
|
|
1283
|
-
return /* @__PURE__ */ d(
|
|
1282
|
+
const n = s + _e.length;
|
|
1283
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
1284
1284
|
t.slice(0, s),
|
|
1285
1285
|
/* @__PURE__ */ e(
|
|
1286
1286
|
"a",
|
|
1287
1287
|
{
|
|
1288
|
-
href:
|
|
1288
|
+
href: _n,
|
|
1289
1289
|
target: "_blank",
|
|
1290
1290
|
rel: "noopener noreferrer",
|
|
1291
1291
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1292
|
-
children:
|
|
1292
|
+
children: _e
|
|
1293
1293
|
}
|
|
1294
1294
|
),
|
|
1295
1295
|
t.slice(n)
|
|
1296
1296
|
] });
|
|
1297
|
-
},
|
|
1297
|
+
}, Sn = (t) => {
|
|
1298
1298
|
var r, o;
|
|
1299
|
-
const s = t.message.hide_date === !0, n =
|
|
1299
|
+
const s = t.message.hide_date === !0, n = Cn(
|
|
1300
1300
|
t.message
|
|
1301
1301
|
);
|
|
1302
1302
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1303
|
-
const l = ((r = t.message.text) == null ? void 0 : r.trim()) ||
|
|
1303
|
+
const l = ((r = t.message.text) == null ? void 0 : r.trim()) || vn[n.type];
|
|
1304
1304
|
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1305
1305
|
/* @__PURE__ */ d(
|
|
1306
1306
|
"div",
|
|
@@ -1310,7 +1310,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1310
1310
|
"data-dm-agent-system-type": n.type,
|
|
1311
1311
|
children: [
|
|
1312
1312
|
/* @__PURE__ */ e(
|
|
1313
|
-
|
|
1313
|
+
Se,
|
|
1314
1314
|
{
|
|
1315
1315
|
size: 16,
|
|
1316
1316
|
weight: "regular",
|
|
@@ -1322,11 +1322,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1322
1322
|
]
|
|
1323
1323
|
}
|
|
1324
1324
|
),
|
|
1325
|
-
!s && /* @__PURE__ */ e(
|
|
1325
|
+
!s && /* @__PURE__ */ e(ve, { message: t.message })
|
|
1326
1326
|
] });
|
|
1327
1327
|
}
|
|
1328
1328
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1329
|
-
const l = ((o = t.message.text) == null ? void 0 : o.trim()) ||
|
|
1329
|
+
const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Nn[n.type];
|
|
1330
1330
|
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1331
1331
|
/* @__PURE__ */ d(
|
|
1332
1332
|
"div",
|
|
@@ -1336,7 +1336,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1336
1336
|
"data-age-safety-system-type": n.type,
|
|
1337
1337
|
children: [
|
|
1338
1338
|
/* @__PURE__ */ e(
|
|
1339
|
-
|
|
1339
|
+
ps,
|
|
1340
1340
|
{
|
|
1341
1341
|
size: 24,
|
|
1342
1342
|
weight: "duotone",
|
|
@@ -1345,11 +1345,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1345
1345
|
"data-testid": "age-safety-system-message-icon"
|
|
1346
1346
|
}
|
|
1347
1347
|
),
|
|
1348
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1348
|
+
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: En(l) }) })
|
|
1349
1349
|
]
|
|
1350
1350
|
}
|
|
1351
1351
|
),
|
|
1352
|
-
!s && /* @__PURE__ */ e(
|
|
1352
|
+
!s && /* @__PURE__ */ e(ve, { message: t.message })
|
|
1353
1353
|
] });
|
|
1354
1354
|
}
|
|
1355
1355
|
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1358,9 +1358,9 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1358
1358
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1359
1359
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1360
1360
|
] }),
|
|
1361
|
-
!s && /* @__PURE__ */ e(
|
|
1361
|
+
!s && /* @__PURE__ */ e(ve, { message: t.message })
|
|
1362
1362
|
] });
|
|
1363
|
-
},
|
|
1363
|
+
}, ye = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
|
|
1364
1364
|
"animateTransform",
|
|
1365
1365
|
{
|
|
1366
1366
|
attributeName: "transform",
|
|
@@ -1370,25 +1370,25 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1370
1370
|
begin: `${120 * s}ms`,
|
|
1371
1371
|
repeatCount: "indefinite"
|
|
1372
1372
|
}
|
|
1373
|
-
) }),
|
|
1374
|
-
var
|
|
1375
|
-
const { channel: s, channelConfig: n, thread: r } =
|
|
1373
|
+
) }), In = ({ threadList: t }) => {
|
|
1374
|
+
var y;
|
|
1375
|
+
const { channel: s, channelConfig: n, thread: r } = oe(), { client: o } = Me(), { typing: l = {} } = ls();
|
|
1376
1376
|
if ((n == null ? void 0 : n.typing_events) === !1)
|
|
1377
1377
|
return null;
|
|
1378
1378
|
const i = t ? [] : Object.values(l).filter(
|
|
1379
|
-
({ parent_id:
|
|
1380
|
-
var
|
|
1381
|
-
return (
|
|
1379
|
+
({ parent_id: b, user: C }) => {
|
|
1380
|
+
var x;
|
|
1381
|
+
return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && !b;
|
|
1382
1382
|
}
|
|
1383
1383
|
), c = t ? Object.values(l).filter(
|
|
1384
|
-
({ parent_id:
|
|
1385
|
-
var
|
|
1386
|
-
return (
|
|
1384
|
+
({ parent_id: b, user: C }) => {
|
|
1385
|
+
var x;
|
|
1386
|
+
return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && b === (r == null ? void 0 : r.id);
|
|
1387
1387
|
}
|
|
1388
|
-
) : [],
|
|
1389
|
-
if (!
|
|
1388
|
+
) : [], m = t ? c : i;
|
|
1389
|
+
if (!m.length)
|
|
1390
1390
|
return null;
|
|
1391
|
-
const u = (
|
|
1391
|
+
const u = (y = m[0]) == null ? void 0 : y.user, h = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (h == null ? void 0 : h.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (h == null ? void 0 : h.image);
|
|
1392
1392
|
return /* @__PURE__ */ d(
|
|
1393
1393
|
"div",
|
|
1394
1394
|
{
|
|
@@ -1416,19 +1416,19 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1416
1416
|
height: "8",
|
|
1417
1417
|
overflow: "visible",
|
|
1418
1418
|
children: [
|
|
1419
|
-
/* @__PURE__ */ e(
|
|
1420
|
-
/* @__PURE__ */ e(
|
|
1421
|
-
/* @__PURE__ */ e(
|
|
1419
|
+
/* @__PURE__ */ e(ye, { cx: "4", index: 0 }),
|
|
1420
|
+
/* @__PURE__ */ e(ye, { cx: "16", index: 1 }),
|
|
1421
|
+
/* @__PURE__ */ e(ye, { cx: "28", index: 2 })
|
|
1422
1422
|
]
|
|
1423
1423
|
}
|
|
1424
1424
|
) })
|
|
1425
1425
|
]
|
|
1426
1426
|
}
|
|
1427
1427
|
);
|
|
1428
|
-
},
|
|
1428
|
+
}, kn = () => null, Mn = ({ className: t, message: s }) => /* @__PURE__ */ d(
|
|
1429
1429
|
"div",
|
|
1430
1430
|
{
|
|
1431
|
-
className:
|
|
1431
|
+
className: L("flex items-center justify-center h-full", t),
|
|
1432
1432
|
children: [
|
|
1433
1433
|
/* @__PURE__ */ d("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1434
1434
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -1468,12 +1468,12 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1468
1468
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1469
1469
|
]
|
|
1470
1470
|
}
|
|
1471
|
-
),
|
|
1472
|
-
/* @__PURE__ */ e(
|
|
1471
|
+
), fe = O.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
|
|
1472
|
+
/* @__PURE__ */ e(Mn, { className: "w-6 h-6" }),
|
|
1473
1473
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1474
1474
|
] }) }));
|
|
1475
|
-
|
|
1476
|
-
const
|
|
1475
|
+
fe.displayName = "LoadingState";
|
|
1476
|
+
const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", rt = "Replies instantly with AI assistant", Tn = ({
|
|
1477
1477
|
onBack: t,
|
|
1478
1478
|
showBackButton: s,
|
|
1479
1479
|
onShowInfo: n,
|
|
@@ -1481,19 +1481,19 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1481
1481
|
showStarButton: o = !1,
|
|
1482
1482
|
dmAgentEnabled: l = !1
|
|
1483
1483
|
}) => {
|
|
1484
|
-
var v, a,
|
|
1485
|
-
const { channel: i } =
|
|
1486
|
-
(
|
|
1484
|
+
var v, a, y, b, C;
|
|
1485
|
+
const { channel: i } = oe(), c = O.useMemo(() => Object.values(i.state.members || {}).find(
|
|
1486
|
+
(I) => {
|
|
1487
1487
|
var w;
|
|
1488
|
-
return ((w =
|
|
1488
|
+
return ((w = I.user) == null ? void 0 : w.id) && I.user.id !== i._client.userID;
|
|
1489
1489
|
}
|
|
1490
|
-
), [i._client.userID, i.state.members]),
|
|
1490
|
+
), [i._client.userID, i.state.members]), m = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (y = c == null ? void 0 : c.user) == null ? void 0 : y.image, h = pt(i), f = async () => {
|
|
1491
1491
|
try {
|
|
1492
|
-
|
|
1493
|
-
} catch (
|
|
1492
|
+
h ? await i.unpin() : await i.pin();
|
|
1493
|
+
} catch (x) {
|
|
1494
1494
|
console.error(
|
|
1495
1495
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1496
|
-
|
|
1496
|
+
x
|
|
1497
1497
|
);
|
|
1498
1498
|
}
|
|
1499
1499
|
};
|
|
@@ -1502,22 +1502,22 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1502
1502
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1503
1503
|
"button",
|
|
1504
1504
|
{
|
|
1505
|
-
className:
|
|
1505
|
+
className: le,
|
|
1506
1506
|
onClick: t || (() => {
|
|
1507
1507
|
}),
|
|
1508
1508
|
type: "button",
|
|
1509
1509
|
"aria-label": "Back to conversations",
|
|
1510
|
-
children: /* @__PURE__ */ e(
|
|
1510
|
+
children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
|
|
1511
1511
|
}
|
|
1512
1512
|
) }),
|
|
1513
1513
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1514
1514
|
/* @__PURE__ */ e(
|
|
1515
1515
|
ne,
|
|
1516
1516
|
{
|
|
1517
|
-
id: ((
|
|
1518
|
-
name:
|
|
1517
|
+
id: ((b = c == null ? void 0 : c.user) == null ? void 0 : b.id) || i.id || "unknown",
|
|
1518
|
+
name: m,
|
|
1519
1519
|
image: u,
|
|
1520
|
-
starred: o &&
|
|
1520
|
+
starred: o && h,
|
|
1521
1521
|
dmAgentEnabled: l,
|
|
1522
1522
|
size: 40
|
|
1523
1523
|
}
|
|
@@ -1528,34 +1528,34 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1528
1528
|
type: "button",
|
|
1529
1529
|
onClick: n,
|
|
1530
1530
|
className: "flex items-center gap-0.5 rounded-full bg-black/[0.05] px-3 py-1 text-xs font-medium text-black/90 hover:bg-black/[0.08] transition-colors",
|
|
1531
|
-
"aria-label": `View info for ${
|
|
1531
|
+
"aria-label": `View info for ${m}`,
|
|
1532
1532
|
children: [
|
|
1533
|
-
|
|
1534
|
-
/* @__PURE__ */ e(
|
|
1533
|
+
m,
|
|
1534
|
+
/* @__PURE__ */ e(Ke, { className: "size-3 shrink-0" })
|
|
1535
1535
|
]
|
|
1536
1536
|
}
|
|
1537
1537
|
),
|
|
1538
1538
|
l && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
1539
|
-
/* @__PURE__ */ e(
|
|
1540
|
-
/* @__PURE__ */ e("span", { children:
|
|
1539
|
+
/* @__PURE__ */ e(Se, { className: "size-3 shrink-0 text-black/55" }),
|
|
1540
|
+
/* @__PURE__ */ e("span", { children: rt })
|
|
1541
1541
|
] })
|
|
1542
1542
|
] }),
|
|
1543
1543
|
/* @__PURE__ */ d("div", { className: "flex justify-end items-center gap-2", children: [
|
|
1544
1544
|
o && /* @__PURE__ */ e(
|
|
1545
1545
|
"button",
|
|
1546
1546
|
{
|
|
1547
|
-
className:
|
|
1547
|
+
className: le,
|
|
1548
1548
|
onClick: f,
|
|
1549
1549
|
type: "button",
|
|
1550
|
-
"aria-label":
|
|
1550
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1551
1551
|
children: /* @__PURE__ */ e(
|
|
1552
|
-
|
|
1552
|
+
Ee,
|
|
1553
1553
|
{
|
|
1554
|
-
className:
|
|
1555
|
-
"text-yellow-600":
|
|
1556
|
-
"text-black/90": !
|
|
1554
|
+
className: L("size-5", {
|
|
1555
|
+
"text-yellow-600": h,
|
|
1556
|
+
"text-black/90": !h
|
|
1557
1557
|
}),
|
|
1558
|
-
weight:
|
|
1558
|
+
weight: h ? "duotone" : "regular"
|
|
1559
1559
|
}
|
|
1560
1560
|
)
|
|
1561
1561
|
}
|
|
@@ -1563,11 +1563,11 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1563
1563
|
/* @__PURE__ */ e(
|
|
1564
1564
|
"button",
|
|
1565
1565
|
{
|
|
1566
|
-
className:
|
|
1566
|
+
className: le,
|
|
1567
1567
|
onClick: n,
|
|
1568
1568
|
type: "button",
|
|
1569
1569
|
"aria-label": "Show info",
|
|
1570
|
-
children: /* @__PURE__ */ e(
|
|
1570
|
+
children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
|
|
1571
1571
|
}
|
|
1572
1572
|
)
|
|
1573
1573
|
] })
|
|
@@ -1579,18 +1579,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1579
1579
|
{
|
|
1580
1580
|
type: "button",
|
|
1581
1581
|
onClick: t,
|
|
1582
|
-
className:
|
|
1582
|
+
className: le,
|
|
1583
1583
|
"aria-label": "Back to conversations",
|
|
1584
|
-
children: /* @__PURE__ */ e(
|
|
1584
|
+
children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
|
|
1585
1585
|
}
|
|
1586
1586
|
),
|
|
1587
1587
|
/* @__PURE__ */ e(
|
|
1588
1588
|
ne,
|
|
1589
1589
|
{
|
|
1590
|
-
id: ((
|
|
1591
|
-
name:
|
|
1590
|
+
id: ((C = c == null ? void 0 : c.user) == null ? void 0 : C.id) || i.id || "unknown",
|
|
1591
|
+
name: m,
|
|
1592
1592
|
image: u,
|
|
1593
|
-
starred: o &&
|
|
1593
|
+
starred: o && h,
|
|
1594
1594
|
dmAgentEnabled: l,
|
|
1595
1595
|
size: 40
|
|
1596
1596
|
}
|
|
@@ -1602,16 +1602,16 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1602
1602
|
type: "button",
|
|
1603
1603
|
onClick: n,
|
|
1604
1604
|
className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
|
|
1605
|
-
"aria-label": `View info for ${
|
|
1605
|
+
"aria-label": `View info for ${m}`,
|
|
1606
1606
|
children: [
|
|
1607
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
1608
|
-
/* @__PURE__ */ e(
|
|
1607
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: m }),
|
|
1608
|
+
/* @__PURE__ */ e(Ke, { className: "size-4 shrink-0" })
|
|
1609
1609
|
]
|
|
1610
1610
|
}
|
|
1611
|
-
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children:
|
|
1611
|
+
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: m }),
|
|
1612
1612
|
l && /* @__PURE__ */ d("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
1613
|
-
/* @__PURE__ */ e(
|
|
1614
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
1613
|
+
/* @__PURE__ */ e(Se, { className: "size-3 shrink-0 text-black/55" }),
|
|
1614
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: rt })
|
|
1615
1615
|
] })
|
|
1616
1616
|
] })
|
|
1617
1617
|
] }),
|
|
@@ -1619,18 +1619,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1619
1619
|
o && /* @__PURE__ */ e(
|
|
1620
1620
|
"button",
|
|
1621
1621
|
{
|
|
1622
|
-
className:
|
|
1622
|
+
className: le,
|
|
1623
1623
|
onClick: f,
|
|
1624
1624
|
type: "button",
|
|
1625
|
-
"aria-label":
|
|
1625
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1626
1626
|
children: /* @__PURE__ */ e(
|
|
1627
|
-
|
|
1627
|
+
Ee,
|
|
1628
1628
|
{
|
|
1629
|
-
className:
|
|
1630
|
-
"text-yellow-600":
|
|
1631
|
-
"text-black/90": !
|
|
1629
|
+
className: L("size-5", {
|
|
1630
|
+
"text-yellow-600": h,
|
|
1631
|
+
"text-black/90": !h
|
|
1632
1632
|
}),
|
|
1633
|
-
weight:
|
|
1633
|
+
weight: h ? "duotone" : "regular"
|
|
1634
1634
|
}
|
|
1635
1635
|
)
|
|
1636
1636
|
}
|
|
@@ -1638,17 +1638,17 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1638
1638
|
r && n && /* @__PURE__ */ e(
|
|
1639
1639
|
"button",
|
|
1640
1640
|
{
|
|
1641
|
-
className:
|
|
1641
|
+
className: le,
|
|
1642
1642
|
onClick: n,
|
|
1643
1643
|
type: "button",
|
|
1644
1644
|
"aria-label": "Show info",
|
|
1645
|
-
children: /* @__PURE__ */ e(
|
|
1645
|
+
children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
|
|
1646
1646
|
}
|
|
1647
1647
|
)
|
|
1648
1648
|
] })
|
|
1649
1649
|
] })
|
|
1650
1650
|
] });
|
|
1651
|
-
},
|
|
1651
|
+
}, Dn = ({
|
|
1652
1652
|
onBack: t,
|
|
1653
1653
|
showBackButton: s,
|
|
1654
1654
|
renderMessageInputActions: n,
|
|
@@ -1657,94 +1657,94 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1657
1657
|
onBlockParticipant: l,
|
|
1658
1658
|
showDeleteConversation: i = !0,
|
|
1659
1659
|
onDeleteConversationClick: c,
|
|
1660
|
-
onBlockParticipantClick:
|
|
1660
|
+
onBlockParticipantClick: m,
|
|
1661
1661
|
onReportParticipantClick: u,
|
|
1662
|
-
showStarButton:
|
|
1662
|
+
showStarButton: h = !1,
|
|
1663
1663
|
chatbotVotingEnabled: f = !1,
|
|
1664
1664
|
renderChannelBanner: v,
|
|
1665
1665
|
customProfileContent: a,
|
|
1666
|
-
customChannelActions:
|
|
1667
|
-
renderMessage:
|
|
1668
|
-
dmAgentEnabled:
|
|
1666
|
+
customChannelActions: y,
|
|
1667
|
+
renderMessage: b,
|
|
1668
|
+
dmAgentEnabled: C = !1
|
|
1669
1669
|
}) => {
|
|
1670
|
-
var
|
|
1671
|
-
const { channel:
|
|
1672
|
-
(
|
|
1673
|
-
var
|
|
1674
|
-
return ((
|
|
1670
|
+
var F, H;
|
|
1671
|
+
const { channel: x } = oe(), I = J(null), w = O.useMemo(() => Object.values(x.state.members || {}).find(
|
|
1672
|
+
(B) => {
|
|
1673
|
+
var S;
|
|
1674
|
+
return ((S = B.user) == null ? void 0 : S.id) && B.user.id !== x._client.userID;
|
|
1675
1675
|
}
|
|
1676
|
-
), [
|
|
1677
|
-
var
|
|
1678
|
-
return ((
|
|
1679
|
-
}), [
|
|
1680
|
-
const
|
|
1681
|
-
if (
|
|
1682
|
-
return String(
|
|
1683
|
-
if (
|
|
1684
|
-
return
|
|
1685
|
-
}, [
|
|
1686
|
-
var
|
|
1687
|
-
(
|
|
1688
|
-
}, []),
|
|
1689
|
-
var
|
|
1690
|
-
(
|
|
1691
|
-
}, []),
|
|
1692
|
-
(
|
|
1693
|
-
const { message:
|
|
1694
|
-
return !
|
|
1676
|
+
), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((B) => {
|
|
1677
|
+
var S;
|
|
1678
|
+
return ((S = B.user) == null ? void 0 : S.id) === x._client.userID;
|
|
1679
|
+
}), [x._client.userID, x.state.members]), P = ((F = E == null ? void 0 : E.user) == null ? void 0 : F.is_account) ?? (E == null ? void 0 : E.is_account), U = ((H = w == null ? void 0 : w.user) == null ? void 0 : H.is_account) ?? (w == null ? void 0 : w.is_account), k = C && P === !1 && U === !0, T = O.useMemo(() => {
|
|
1680
|
+
const D = x.data ?? {};
|
|
1681
|
+
if (D.followerStatus)
|
|
1682
|
+
return String(D.followerStatus);
|
|
1683
|
+
if (D.isFollower !== void 0)
|
|
1684
|
+
return D.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1685
|
+
}, [x.data]), M = G(() => {
|
|
1686
|
+
var D;
|
|
1687
|
+
(D = I.current) == null || D.showModal();
|
|
1688
|
+
}, []), _ = G(() => {
|
|
1689
|
+
var D;
|
|
1690
|
+
(D = I.current) == null || D.close();
|
|
1691
|
+
}, []), N = G(
|
|
1692
|
+
(D) => {
|
|
1693
|
+
const { message: B } = ut("ChannelView"), S = /* @__PURE__ */ e(un, { ...D, chatbotVotingEnabled: f });
|
|
1694
|
+
return !b || !B ? S : b(S, B);
|
|
1695
1695
|
},
|
|
1696
|
-
[f,
|
|
1696
|
+
[f, b]
|
|
1697
1697
|
);
|
|
1698
|
-
return /* @__PURE__ */ d(
|
|
1699
|
-
/* @__PURE__ */ e(
|
|
1698
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
1699
|
+
/* @__PURE__ */ e(ds, { overrides: { Message: N }, children: /* @__PURE__ */ d(us, { children: [
|
|
1700
1700
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1701
|
-
|
|
1701
|
+
Tn,
|
|
1702
1702
|
{
|
|
1703
1703
|
onBack: t,
|
|
1704
1704
|
showBackButton: s,
|
|
1705
|
-
onShowInfo:
|
|
1705
|
+
onShowInfo: M,
|
|
1706
1706
|
canShowInfo: !!w,
|
|
1707
|
-
showStarButton:
|
|
1708
|
-
dmAgentEnabled:
|
|
1707
|
+
showStarButton: h,
|
|
1708
|
+
dmAgentEnabled: k
|
|
1709
1709
|
}
|
|
1710
1710
|
) }),
|
|
1711
1711
|
v == null ? void 0 : v(),
|
|
1712
1712
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1713
|
-
|
|
1713
|
+
ms,
|
|
1714
1714
|
{
|
|
1715
1715
|
hideDeletedMessages: !0,
|
|
1716
1716
|
hideNewMessageSeparator: !1,
|
|
1717
1717
|
messageActions: void 0
|
|
1718
1718
|
}
|
|
1719
1719
|
) }),
|
|
1720
|
-
r == null ? void 0 : r(
|
|
1720
|
+
r == null ? void 0 : r(x),
|
|
1721
1721
|
/* @__PURE__ */ e(
|
|
1722
|
-
|
|
1722
|
+
pn,
|
|
1723
1723
|
{
|
|
1724
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1724
|
+
renderActions: () => n == null ? void 0 : n(x)
|
|
1725
1725
|
}
|
|
1726
1726
|
)
|
|
1727
1727
|
] }) }),
|
|
1728
1728
|
/* @__PURE__ */ e(
|
|
1729
|
-
|
|
1729
|
+
qs,
|
|
1730
1730
|
{
|
|
1731
|
-
dialogRef:
|
|
1732
|
-
onClose:
|
|
1731
|
+
dialogRef: I,
|
|
1732
|
+
onClose: _,
|
|
1733
1733
|
participant: w,
|
|
1734
|
-
channel:
|
|
1735
|
-
followerStatusLabel:
|
|
1734
|
+
channel: x,
|
|
1735
|
+
followerStatusLabel: T,
|
|
1736
1736
|
onLeaveConversation: o,
|
|
1737
1737
|
onBlockParticipant: l,
|
|
1738
1738
|
showDeleteConversation: i,
|
|
1739
1739
|
onDeleteConversationClick: c,
|
|
1740
|
-
onBlockParticipantClick:
|
|
1740
|
+
onBlockParticipantClick: m,
|
|
1741
1741
|
onReportParticipantClick: u,
|
|
1742
1742
|
customProfileContent: a,
|
|
1743
|
-
customChannelActions:
|
|
1743
|
+
customChannelActions: y
|
|
1744
1744
|
}
|
|
1745
1745
|
)
|
|
1746
1746
|
] });
|
|
1747
|
-
},
|
|
1747
|
+
}, yt = O.memo(
|
|
1748
1748
|
({
|
|
1749
1749
|
channel: t,
|
|
1750
1750
|
onBack: s,
|
|
@@ -1754,62 +1754,62 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1754
1754
|
onLeaveConversation: l,
|
|
1755
1755
|
onBlockParticipant: i,
|
|
1756
1756
|
className: c,
|
|
1757
|
-
CustomChannelEmptyState:
|
|
1757
|
+
CustomChannelEmptyState: m = kn,
|
|
1758
1758
|
showDeleteConversation: u = !0,
|
|
1759
|
-
onDeleteConversationClick:
|
|
1759
|
+
onDeleteConversationClick: h,
|
|
1760
1760
|
onBlockParticipantClick: f,
|
|
1761
1761
|
onReportParticipantClick: v,
|
|
1762
1762
|
dmAgentEnabled: a,
|
|
1763
|
-
messageMetadata:
|
|
1764
|
-
onMessageSent:
|
|
1765
|
-
showStarButton:
|
|
1766
|
-
chatbotVotingEnabled:
|
|
1767
|
-
renderChannelBanner:
|
|
1763
|
+
messageMetadata: y,
|
|
1764
|
+
onMessageSent: b,
|
|
1765
|
+
showStarButton: C = !1,
|
|
1766
|
+
chatbotVotingEnabled: x = !1,
|
|
1767
|
+
renderChannelBanner: I,
|
|
1768
1768
|
customProfileContent: w,
|
|
1769
1769
|
customChannelActions: E,
|
|
1770
|
-
renderMessage:
|
|
1771
|
-
sendButton:
|
|
1770
|
+
renderMessage: P,
|
|
1771
|
+
sendButton: U
|
|
1772
1772
|
}) => {
|
|
1773
|
-
const
|
|
1774
|
-
async (
|
|
1775
|
-
var
|
|
1776
|
-
const
|
|
1777
|
-
...
|
|
1778
|
-
...
|
|
1779
|
-
...
|
|
1773
|
+
const k = G(
|
|
1774
|
+
async (T, M, _) => {
|
|
1775
|
+
var S;
|
|
1776
|
+
const N = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, F = a && !N, H = {
|
|
1777
|
+
...M,
|
|
1778
|
+
...F && { silent: !0 },
|
|
1779
|
+
...y && {
|
|
1780
1780
|
metadata: {
|
|
1781
|
-
...
|
|
1782
|
-
...
|
|
1781
|
+
...M.metadata ?? {},
|
|
1782
|
+
...y
|
|
1783
1783
|
}
|
|
1784
1784
|
}
|
|
1785
|
-
},
|
|
1786
|
-
...
|
|
1787
|
-
...
|
|
1788
|
-
},
|
|
1789
|
-
return
|
|
1785
|
+
}, D = {
|
|
1786
|
+
..._,
|
|
1787
|
+
...F && { skip_push: !0 }
|
|
1788
|
+
}, B = await t.sendMessage(H, D);
|
|
1789
|
+
return b == null || b(B), B;
|
|
1790
1790
|
},
|
|
1791
|
-
[t, a,
|
|
1791
|
+
[t, a, y, b]
|
|
1792
1792
|
);
|
|
1793
1793
|
return /* @__PURE__ */ e(
|
|
1794
1794
|
"div",
|
|
1795
1795
|
{
|
|
1796
|
-
className:
|
|
1796
|
+
className: L(
|
|
1797
1797
|
"messaging-channel-view h-full flex flex-col",
|
|
1798
1798
|
c
|
|
1799
1799
|
),
|
|
1800
1800
|
children: /* @__PURE__ */ e(
|
|
1801
|
-
|
|
1801
|
+
cs,
|
|
1802
1802
|
{
|
|
1803
1803
|
channel: t,
|
|
1804
|
-
MessageSystem:
|
|
1805
|
-
EmptyStateIndicator:
|
|
1806
|
-
LoadingIndicator:
|
|
1807
|
-
DateSeparator:
|
|
1808
|
-
TypingIndicator:
|
|
1809
|
-
doSendMessageRequest:
|
|
1810
|
-
...
|
|
1804
|
+
MessageSystem: Sn,
|
|
1805
|
+
EmptyStateIndicator: m,
|
|
1806
|
+
LoadingIndicator: fe,
|
|
1807
|
+
DateSeparator: Xs,
|
|
1808
|
+
TypingIndicator: In,
|
|
1809
|
+
doSendMessageRequest: k,
|
|
1810
|
+
...U ? { SendButton: U } : {},
|
|
1811
1811
|
children: /* @__PURE__ */ e(
|
|
1812
|
-
|
|
1812
|
+
Dn,
|
|
1813
1813
|
{
|
|
1814
1814
|
onBack: s,
|
|
1815
1815
|
showBackButton: n,
|
|
@@ -1817,18 +1817,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1817
1817
|
renderConversationFooter: o,
|
|
1818
1818
|
onLeaveConversation: l,
|
|
1819
1819
|
onBlockParticipant: i,
|
|
1820
|
-
CustomChannelEmptyState:
|
|
1820
|
+
CustomChannelEmptyState: m,
|
|
1821
1821
|
showDeleteConversation: u,
|
|
1822
|
-
onDeleteConversationClick:
|
|
1822
|
+
onDeleteConversationClick: h,
|
|
1823
1823
|
onBlockParticipantClick: f,
|
|
1824
1824
|
onReportParticipantClick: v,
|
|
1825
|
-
showStarButton:
|
|
1825
|
+
showStarButton: C,
|
|
1826
1826
|
dmAgentEnabled: a,
|
|
1827
|
-
chatbotVotingEnabled:
|
|
1828
|
-
renderChannelBanner:
|
|
1827
|
+
chatbotVotingEnabled: x,
|
|
1828
|
+
renderChannelBanner: I,
|
|
1829
1829
|
customProfileContent: w,
|
|
1830
1830
|
customChannelActions: E,
|
|
1831
|
-
renderMessage:
|
|
1831
|
+
renderMessage: P
|
|
1832
1832
|
}
|
|
1833
1833
|
)
|
|
1834
1834
|
}
|
|
@@ -1837,186 +1837,8 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1837
1837
|
);
|
|
1838
1838
|
}
|
|
1839
1839
|
);
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
searchQuery: t,
|
|
1843
|
-
setSearchQuery: s,
|
|
1844
|
-
placeholder: n
|
|
1845
|
-
}) {
|
|
1846
|
-
const r = Q(null);
|
|
1847
|
-
return /* @__PURE__ */ d("div", { className: "relative", children: [
|
|
1848
|
-
/* @__PURE__ */ e(
|
|
1849
|
-
Es,
|
|
1850
|
-
{
|
|
1851
|
-
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1852
|
-
weight: "bold"
|
|
1853
|
-
}
|
|
1854
|
-
),
|
|
1855
|
-
/* @__PURE__ */ e(
|
|
1856
|
-
"input",
|
|
1857
|
-
{
|
|
1858
|
-
ref: r,
|
|
1859
|
-
type: "text",
|
|
1860
|
-
placeholder: n,
|
|
1861
|
-
value: t,
|
|
1862
|
-
onChange: (o) => s(o.target.value),
|
|
1863
|
-
className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
|
|
1864
|
-
}
|
|
1865
|
-
),
|
|
1866
|
-
t && /* @__PURE__ */ e(
|
|
1867
|
-
Et,
|
|
1868
|
-
{
|
|
1869
|
-
label: "Clear search",
|
|
1870
|
-
onClick: () => {
|
|
1871
|
-
var o;
|
|
1872
|
-
s(""), (o = r.current) == null || o.focus();
|
|
1873
|
-
},
|
|
1874
|
-
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1875
|
-
children: /* @__PURE__ */ e(Ye, { className: "h-4 w-4", weight: "bold" })
|
|
1876
|
-
}
|
|
1877
|
-
)
|
|
1878
|
-
] });
|
|
1879
|
-
}
|
|
1880
|
-
const $n = ({
|
|
1881
|
-
participantSource: t,
|
|
1882
|
-
onSelectParticipant: s,
|
|
1883
|
-
onClose: n,
|
|
1884
|
-
existingParticipantIds: r = /* @__PURE__ */ new Set(),
|
|
1885
|
-
participantLabel: o = "participants",
|
|
1886
|
-
searchPlaceholder: l = "Search participants...",
|
|
1887
|
-
className: i
|
|
1888
|
-
}) => {
|
|
1889
|
-
const { debug: c } = De(), [h, u] = M(""), [m, f] = M([]), [v, a] = M(!1), [C, g] = M(null), [y, p] = M(
|
|
1890
|
-
null
|
|
1891
|
-
), S = Q(!1);
|
|
1892
|
-
K(() => {
|
|
1893
|
-
S.current = !1;
|
|
1894
|
-
}, [t]), K(() => {
|
|
1895
|
-
if (t.loading) {
|
|
1896
|
-
c && console.log(
|
|
1897
|
-
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1898
|
-
);
|
|
1899
|
-
return;
|
|
1900
|
-
}
|
|
1901
|
-
if (S.current) return;
|
|
1902
|
-
(async () => {
|
|
1903
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), g(null);
|
|
1904
|
-
try {
|
|
1905
|
-
const b = await t.loadParticipants({
|
|
1906
|
-
search: "",
|
|
1907
|
-
// Load all participants initially
|
|
1908
|
-
limit: 100
|
|
1909
|
-
});
|
|
1910
|
-
f(b.participants), S.current = !0, c && console.log(
|
|
1911
|
-
"[ParticipantPicker] Participants loaded successfully:",
|
|
1912
|
-
b.participants.length
|
|
1913
|
-
);
|
|
1914
|
-
} catch (b) {
|
|
1915
|
-
const k = b instanceof Error ? b.message : "Failed to load participants";
|
|
1916
|
-
g(k), console.error("[ParticipantPicker] Failed to load participants:", b);
|
|
1917
|
-
} finally {
|
|
1918
|
-
a(!1);
|
|
1919
|
-
}
|
|
1920
|
-
})();
|
|
1921
|
-
}, [t, c]);
|
|
1922
|
-
const w = m.filter((N) => !r.has(N.id)).filter((N) => {
|
|
1923
|
-
var k;
|
|
1924
|
-
if (!h) return !0;
|
|
1925
|
-
const b = h.toLowerCase();
|
|
1926
|
-
return N.name.toLowerCase().includes(b) || ((k = N.email) == null ? void 0 : k.toLowerCase().includes(b)) || !1;
|
|
1927
|
-
}), E = U(
|
|
1928
|
-
async (N) => {
|
|
1929
|
-
if (!y) {
|
|
1930
|
-
p(N.id);
|
|
1931
|
-
try {
|
|
1932
|
-
await s(N);
|
|
1933
|
-
} catch (b) {
|
|
1934
|
-
console.error("[ParticipantPicker] Failed to start chat:", b), p(null);
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
},
|
|
1938
|
-
[s, y]
|
|
1939
|
-
), F = (N, b) => {
|
|
1940
|
-
(N.key === "Enter" || N.key === " ") && (N.preventDefault(), E(b));
|
|
1941
|
-
};
|
|
1942
|
-
return /* @__PURE__ */ d("div", { className: A("flex flex-col h-full", i), children: [
|
|
1943
|
-
/* @__PURE__ */ d("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1944
|
-
/* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1945
|
-
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1946
|
-
/* @__PURE__ */ e(kt, { onClick: n })
|
|
1947
|
-
] }),
|
|
1948
|
-
/* @__PURE__ */ d("p", { className: "text-xs text-stone mb-3", children: [
|
|
1949
|
-
"Select a ",
|
|
1950
|
-
o.slice(0, -1),
|
|
1951
|
-
" to start messaging (",
|
|
1952
|
-
w.length,
|
|
1953
|
-
" available)",
|
|
1954
|
-
t.totalCount !== void 0 && ` • ${t.totalCount} ${o} total`
|
|
1955
|
-
] }),
|
|
1956
|
-
/* @__PURE__ */ e(
|
|
1957
|
-
Un,
|
|
1958
|
-
{
|
|
1959
|
-
searchQuery: h,
|
|
1960
|
-
setSearchQuery: u,
|
|
1961
|
-
placeholder: l
|
|
1962
|
-
}
|
|
1963
|
-
)
|
|
1964
|
-
] }),
|
|
1965
|
-
C && /* @__PURE__ */ d("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1966
|
-
"Error loading ",
|
|
1967
|
-
o,
|
|
1968
|
-
": ",
|
|
1969
|
-
C
|
|
1970
|
-
] }),
|
|
1971
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: v && w.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
|
|
1972
|
-
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1973
|
-
/* @__PURE__ */ d("span", { className: "text-sm text-stone", children: [
|
|
1974
|
-
"Loading ",
|
|
1975
|
-
o,
|
|
1976
|
-
"..."
|
|
1977
|
-
] })
|
|
1978
|
-
] }) }) : w.length === 0 ? /* @__PURE__ */ d("div", { className: "p-6 text-center", children: [
|
|
1979
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(at, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1980
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${o} found` : m.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
|
|
1981
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : m.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
|
|
1982
|
-
] }) : /* @__PURE__ */ d("ul", { className: "space-y-0", children: [
|
|
1983
|
-
w.map((N) => {
|
|
1984
|
-
const b = N.name || N.email || N.id, k = N.email && N.name ? N.email : N.phone;
|
|
1985
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1986
|
-
"button",
|
|
1987
|
-
{
|
|
1988
|
-
type: "button",
|
|
1989
|
-
onClick: () => E(N),
|
|
1990
|
-
onKeyDown: (R) => F(R, N),
|
|
1991
|
-
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1992
|
-
children: /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
1993
|
-
/* @__PURE__ */ d("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1994
|
-
/* @__PURE__ */ e(
|
|
1995
|
-
ne,
|
|
1996
|
-
{
|
|
1997
|
-
id: N.id,
|
|
1998
|
-
name: b,
|
|
1999
|
-
image: N.image,
|
|
2000
|
-
size: 40
|
|
2001
|
-
}
|
|
2002
|
-
),
|
|
2003
|
-
/* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
|
|
2004
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: b }),
|
|
2005
|
-
k && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: k })
|
|
2006
|
-
] })
|
|
2007
|
-
] }),
|
|
2008
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === N.id ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(at, { className: "h-5 w-5 text-stone" }) })
|
|
2009
|
-
] })
|
|
2010
|
-
}
|
|
2011
|
-
) }, N.id);
|
|
2012
|
-
}),
|
|
2013
|
-
v && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
|
|
2014
|
-
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
2015
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
2016
|
-
] }) })
|
|
2017
|
-
] }) })
|
|
2018
|
-
] });
|
|
2019
|
-
}, zn = ({ className: t }) => /* @__PURE__ */ d(
|
|
1840
|
+
yt.displayName = "ChannelView";
|
|
1841
|
+
const Rn = ({ className: t }) => /* @__PURE__ */ d(
|
|
2020
1842
|
"svg",
|
|
2021
1843
|
{
|
|
2022
1844
|
width: "140",
|
|
@@ -2150,17 +1972,17 @@ const $n = ({
|
|
|
2150
1972
|
] })
|
|
2151
1973
|
]
|
|
2152
1974
|
}
|
|
2153
|
-
),
|
|
1975
|
+
), Ct = O.memo(
|
|
2154
1976
|
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2155
|
-
/* @__PURE__ */ e(
|
|
1977
|
+
/* @__PURE__ */ e(Rn, {}),
|
|
2156
1978
|
s && !t && /* @__PURE__ */ d("div", { className: "mt-8", children: [
|
|
2157
1979
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2158
1980
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2159
1981
|
] })
|
|
2160
1982
|
] }) })
|
|
2161
1983
|
);
|
|
2162
|
-
|
|
2163
|
-
const
|
|
1984
|
+
Ct.displayName = "EmptyState";
|
|
1985
|
+
const he = O.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ d("div", { className: "text-center max-w-sm", children: [
|
|
2164
1986
|
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2165
1987
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2166
1988
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -2174,333 +1996,264 @@ const Ie = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
2174
1996
|
}
|
|
2175
1997
|
)
|
|
2176
1998
|
] }) }));
|
|
2177
|
-
|
|
2178
|
-
const
|
|
1999
|
+
he.displayName = "ErrorState";
|
|
2000
|
+
const oa = ({
|
|
2179
2001
|
capabilities: t = {},
|
|
2180
2002
|
className: s,
|
|
2181
2003
|
renderMessageInputActions: n,
|
|
2182
2004
|
renderConversationFooter: r,
|
|
2183
2005
|
onChannelSelect: o,
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
customProfileContent: b,
|
|
2006
|
+
initialParticipantFilter: l,
|
|
2007
|
+
initialParticipantData: i,
|
|
2008
|
+
CustomChannelEmptyState: c,
|
|
2009
|
+
showChannelList: m = !0,
|
|
2010
|
+
filters: u,
|
|
2011
|
+
channelRenderFilterFn: h,
|
|
2012
|
+
channelListCustomEmptyStateIndicator: f,
|
|
2013
|
+
onDeleteConversationClick: v,
|
|
2014
|
+
onBlockParticipantClick: a,
|
|
2015
|
+
onReportParticipantClick: y,
|
|
2016
|
+
dmAgentEnabled: b,
|
|
2017
|
+
messageMetadata: C,
|
|
2018
|
+
onMessageSent: x,
|
|
2019
|
+
showStarButton: I = !1,
|
|
2020
|
+
chatbotVotingEnabled: w = !1,
|
|
2021
|
+
renderMessagePreview: E,
|
|
2022
|
+
renderChannelBanner: P,
|
|
2023
|
+
customProfileContent: U,
|
|
2203
2024
|
customChannelActions: k,
|
|
2204
|
-
renderMessage:
|
|
2205
|
-
sendButton:
|
|
2025
|
+
renderMessage: T,
|
|
2026
|
+
sendButton: M
|
|
2206
2027
|
}) => {
|
|
2207
2028
|
const {
|
|
2208
|
-
service:
|
|
2209
|
-
client:
|
|
2210
|
-
isConnected:
|
|
2211
|
-
isLoading:
|
|
2212
|
-
error:
|
|
2213
|
-
refreshConnection:
|
|
2214
|
-
debug:
|
|
2215
|
-
} =
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
} = t, ve = z.useMemo(() => {
|
|
2220
|
-
const D = T == null ? void 0 : T.userID;
|
|
2029
|
+
service: _,
|
|
2030
|
+
client: N,
|
|
2031
|
+
isConnected: F,
|
|
2032
|
+
isLoading: H,
|
|
2033
|
+
error: D,
|
|
2034
|
+
refreshConnection: B,
|
|
2035
|
+
debug: S
|
|
2036
|
+
} = Rs(), [$, V] = A(null), [ee, te] = A(!1), [W, g] = A(!1), [p, R] = A(!1), [j, Y] = A(null), {
|
|
2037
|
+
showDeleteConversation: ae = !0
|
|
2038
|
+
} = t, de = O.useMemo(() => {
|
|
2039
|
+
const z = N == null ? void 0 : N.userID;
|
|
2221
2040
|
return {
|
|
2222
2041
|
...{
|
|
2223
2042
|
type: "messaging",
|
|
2224
2043
|
last_message_at: { $exists: !0 },
|
|
2225
|
-
...
|
|
2226
|
-
members: { $in: [
|
|
2044
|
+
...z && {
|
|
2045
|
+
members: { $in: [z] },
|
|
2227
2046
|
hidden: !1
|
|
2228
2047
|
}
|
|
2229
2048
|
},
|
|
2230
|
-
...
|
|
2049
|
+
...u
|
|
2231
2050
|
};
|
|
2232
|
-
}, [
|
|
2233
|
-
if (!
|
|
2234
|
-
const
|
|
2235
|
-
if (
|
|
2051
|
+
}, [u, N == null ? void 0 : N.userID]), re = J(null), q = G(async () => {
|
|
2052
|
+
if (!N || !F) return;
|
|
2053
|
+
const z = N.userID;
|
|
2054
|
+
if (z)
|
|
2236
2055
|
try {
|
|
2237
|
-
|
|
2238
|
-
const X = await
|
|
2056
|
+
S && console.log("[MessagingShell] Syncing channels for user:", z);
|
|
2057
|
+
const X = await N.queryChannels(
|
|
2239
2058
|
{
|
|
2240
2059
|
type: "messaging",
|
|
2241
|
-
members: { $in: [
|
|
2060
|
+
members: { $in: [z] }
|
|
2242
2061
|
},
|
|
2243
2062
|
{},
|
|
2244
2063
|
{ limit: 100 }
|
|
2245
|
-
)
|
|
2246
|
-
X.
|
|
2247
|
-
|
|
2248
|
-
Object.values(Pe).forEach((Ft) => {
|
|
2249
|
-
var Je;
|
|
2250
|
-
const Ae = (Je = Ft.user) == null ? void 0 : Je.id;
|
|
2251
|
-
Ae && Ae !== D && V.add(Ae);
|
|
2252
|
-
});
|
|
2253
|
-
}), ie((Y) => Y.size === V.size && [...Y].every((Pe) => V.has(Pe)) ? Y : V), J(X.length > 0), _(!0), le.current = D, P && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2254
|
-
channelCount: X.length,
|
|
2255
|
-
memberCount: V.size
|
|
2064
|
+
);
|
|
2065
|
+
te(X.length > 0), g(!0), re.current = z, S && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2066
|
+
channelCount: X.length
|
|
2256
2067
|
});
|
|
2257
2068
|
} catch (X) {
|
|
2258
2069
|
console.error("[MessagingShell] Failed to sync channels:", X);
|
|
2259
2070
|
}
|
|
2260
|
-
}, [
|
|
2261
|
-
|
|
2262
|
-
if (!
|
|
2263
|
-
const
|
|
2264
|
-
|
|
2265
|
-
}, [
|
|
2266
|
-
if (!
|
|
2071
|
+
}, [N, F, S]);
|
|
2072
|
+
Z(() => {
|
|
2073
|
+
if (!N || !F) return;
|
|
2074
|
+
const z = N.userID;
|
|
2075
|
+
z && re.current !== z && q();
|
|
2076
|
+
}, [N, F, q]), Z(() => {
|
|
2077
|
+
if (!l || !N || !F) return;
|
|
2267
2078
|
(async () => {
|
|
2268
|
-
const X =
|
|
2079
|
+
const X = N.userID;
|
|
2269
2080
|
if (X)
|
|
2270
2081
|
try {
|
|
2271
|
-
|
|
2082
|
+
S && console.log(
|
|
2272
2083
|
"[MessagingShell] Loading initial conversation with:",
|
|
2273
|
-
|
|
2084
|
+
l
|
|
2274
2085
|
);
|
|
2275
|
-
const
|
|
2086
|
+
const Q = await N.queryChannels(
|
|
2276
2087
|
{
|
|
2277
2088
|
type: "messaging",
|
|
2278
|
-
members: { $eq: [X,
|
|
2089
|
+
members: { $eq: [X, l] }
|
|
2279
2090
|
},
|
|
2280
2091
|
{},
|
|
2281
2092
|
{ limit: 1 }
|
|
2282
2093
|
);
|
|
2283
|
-
if (
|
|
2284
|
-
|
|
2094
|
+
if (Q.length > 0)
|
|
2095
|
+
V(Q[0]), R(!0), Y(null), o && o(Q[0]), S && console.log(
|
|
2285
2096
|
"[MessagingShell] Initial conversation loaded:",
|
|
2286
|
-
|
|
2097
|
+
Q[0].id
|
|
2287
2098
|
);
|
|
2288
|
-
else if (
|
|
2289
|
-
|
|
2099
|
+
else if (i && _) {
|
|
2100
|
+
S && console.log(
|
|
2290
2101
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2291
|
-
|
|
2102
|
+
i
|
|
2292
2103
|
);
|
|
2293
2104
|
try {
|
|
2294
|
-
const
|
|
2295
|
-
id:
|
|
2296
|
-
name:
|
|
2297
|
-
email:
|
|
2298
|
-
phone:
|
|
2105
|
+
const se = await _.startChannelWithParticipant({
|
|
2106
|
+
id: i.id,
|
|
2107
|
+
name: i.name,
|
|
2108
|
+
email: i.email,
|
|
2109
|
+
phone: i.phone
|
|
2299
2110
|
});
|
|
2300
|
-
|
|
2111
|
+
V(se), R(!0), Y(null), o && o(se), S && console.log(
|
|
2301
2112
|
"[MessagingShell] Channel created and loaded:",
|
|
2302
|
-
|
|
2113
|
+
se.id
|
|
2303
2114
|
);
|
|
2304
|
-
} catch (
|
|
2115
|
+
} catch (se) {
|
|
2305
2116
|
console.error(
|
|
2306
2117
|
"[MessagingShell] Failed to create conversation:",
|
|
2307
|
-
|
|
2308
|
-
),
|
|
2118
|
+
se
|
|
2119
|
+
), Y("Failed to create conversation");
|
|
2309
2120
|
}
|
|
2310
2121
|
} else
|
|
2311
|
-
|
|
2122
|
+
Y(
|
|
2312
2123
|
"No conversation found with this account"
|
|
2313
|
-
),
|
|
2124
|
+
), S && console.log(
|
|
2314
2125
|
"[MessagingShell] No conversation found for:",
|
|
2315
|
-
|
|
2126
|
+
l
|
|
2316
2127
|
);
|
|
2317
|
-
} catch (
|
|
2128
|
+
} catch (Q) {
|
|
2318
2129
|
console.error(
|
|
2319
2130
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2320
|
-
|
|
2321
|
-
),
|
|
2131
|
+
Q
|
|
2132
|
+
), Y("Failed to load conversation");
|
|
2322
2133
|
}
|
|
2323
2134
|
})();
|
|
2324
2135
|
}, [
|
|
2136
|
+
l,
|
|
2325
2137
|
i,
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
P,
|
|
2138
|
+
N,
|
|
2139
|
+
F,
|
|
2140
|
+
_,
|
|
2141
|
+
S,
|
|
2331
2142
|
o
|
|
2332
2143
|
]);
|
|
2333
|
-
const
|
|
2334
|
-
(
|
|
2335
|
-
|
|
2144
|
+
const ie = G(
|
|
2145
|
+
(z) => {
|
|
2146
|
+
V(z), o == null || o(z);
|
|
2336
2147
|
},
|
|
2337
2148
|
[o]
|
|
2338
|
-
),
|
|
2339
|
-
|
|
2340
|
-
}, [
|
|
2341
|
-
async (
|
|
2342
|
-
|
|
2343
|
-
if (L)
|
|
2344
|
-
try {
|
|
2345
|
-
P && console.log(
|
|
2346
|
-
"[MessagingShell] Starting conversation with:",
|
|
2347
|
-
D.id
|
|
2348
|
-
);
|
|
2349
|
-
const V = await L.startChannelWithParticipant({
|
|
2350
|
-
id: D.id,
|
|
2351
|
-
name: D.name,
|
|
2352
|
-
email: D.email,
|
|
2353
|
-
phone: D.phone
|
|
2354
|
-
});
|
|
2355
|
-
try {
|
|
2356
|
-
await V.show();
|
|
2357
|
-
} catch (Y) {
|
|
2358
|
-
console.warn("[MessagingShell] Failed to unhide channel:", Y);
|
|
2359
|
-
}
|
|
2360
|
-
Z(V), H(!1), (X = me.current) == null || X.close(), l == null || l(D);
|
|
2361
|
-
} catch (V) {
|
|
2362
|
-
console.error("[MessagingShell] Failed to start conversation:", V);
|
|
2363
|
-
}
|
|
2149
|
+
), pe = G(() => {
|
|
2150
|
+
p || V(null);
|
|
2151
|
+
}, [p]), ue = G(
|
|
2152
|
+
async (z) => {
|
|
2153
|
+
S && console.log("[MessagingShell] Leaving conversation:", z.id), V(null), R(!1), re.current = null, await q();
|
|
2364
2154
|
},
|
|
2365
|
-
[
|
|
2366
|
-
),
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
}, []), Ce = U(
|
|
2370
|
-
(D) => {
|
|
2371
|
-
D.target === me.current && ce();
|
|
2372
|
-
},
|
|
2373
|
-
[ce]
|
|
2374
|
-
), _e = U(
|
|
2375
|
-
async (D) => {
|
|
2376
|
-
P && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null), te(!1), le.current = null, await se();
|
|
2155
|
+
[q, S]
|
|
2156
|
+
), xe = G(
|
|
2157
|
+
async (z) => {
|
|
2158
|
+
S && console.log("[MessagingShell] Blocking participant:", z), V(null), R(!1), re.current = null, await q();
|
|
2377
2159
|
},
|
|
2378
|
-
[
|
|
2379
|
-
),
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
},
|
|
2383
|
-
[se, P]
|
|
2384
|
-
), de = !!W;
|
|
2385
|
-
return O ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Me, {}) }) : G ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, { message: G, onBack: $ }) }) : !B || !T ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
|
|
2386
|
-
Ie,
|
|
2160
|
+
[q, S]
|
|
2161
|
+
), K = !!$;
|
|
2162
|
+
return H ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : D ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(he, { message: D, onBack: B }) }) : !F || !N ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(
|
|
2163
|
+
he,
|
|
2387
2164
|
{
|
|
2388
2165
|
message: "Not connected to messaging service",
|
|
2389
|
-
onBack:
|
|
2166
|
+
onBack: B
|
|
2390
2167
|
}
|
|
2391
|
-
) }) :
|
|
2168
|
+
) }) : j ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(he, { message: j }) }) : /* @__PURE__ */ e(
|
|
2392
2169
|
"div",
|
|
2393
2170
|
{
|
|
2394
|
-
className:
|
|
2171
|
+
className: L(
|
|
2395
2172
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2396
2173
|
s
|
|
2397
2174
|
),
|
|
2398
|
-
children: [
|
|
2399
|
-
/* @__PURE__ */
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
),
|
|
2426
|
-
/* @__PURE__ */ e(
|
|
2427
|
-
"div",
|
|
2428
|
-
{
|
|
2429
|
-
className: A(
|
|
2430
|
-
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2431
|
-
{
|
|
2432
|
-
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2433
|
-
flex: q || de || i,
|
|
2434
|
-
// Normal mode: hide on mobile when no channel selected
|
|
2435
|
-
"hidden lg:flex": !q && !de && !i
|
|
2436
|
-
}
|
|
2437
|
-
),
|
|
2438
|
-
children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2439
|
-
Mt,
|
|
2440
|
-
{
|
|
2441
|
-
channel: W,
|
|
2442
|
-
onBack: ye,
|
|
2443
|
-
showBackButton: !q,
|
|
2444
|
-
renderMessageInputActions: n,
|
|
2445
|
-
renderConversationFooter: r,
|
|
2446
|
-
renderChannelBanner: N,
|
|
2447
|
-
onLeaveConversation: _e,
|
|
2448
|
-
onBlockParticipant: Ee,
|
|
2449
|
-
CustomChannelEmptyState: h,
|
|
2450
|
-
showDeleteConversation: ge,
|
|
2451
|
-
onDeleteConversationClick: a,
|
|
2452
|
-
onBlockParticipantClick: C,
|
|
2453
|
-
onReportParticipantClick: g,
|
|
2454
|
-
dmAgentEnabled: y,
|
|
2455
|
-
messageMetadata: p,
|
|
2456
|
-
onMessageSent: S,
|
|
2457
|
-
showStarButton: w,
|
|
2458
|
-
chatbotVotingEnabled: E,
|
|
2459
|
-
customProfileContent: b,
|
|
2460
|
-
customChannelActions: k,
|
|
2461
|
-
renderMessage: R,
|
|
2462
|
-
sendButton: I
|
|
2463
|
-
},
|
|
2464
|
-
W.id
|
|
2465
|
-
) }) : i ? (
|
|
2466
|
-
// Show loading while creating/loading direct conversation channel
|
|
2467
|
-
/* @__PURE__ */ e(Me, {})
|
|
2468
|
-
) : /* @__PURE__ */ e(
|
|
2469
|
-
Tt,
|
|
2470
|
-
{
|
|
2471
|
-
hasChannels: ae,
|
|
2472
|
-
channelsLoaded: x
|
|
2473
|
-
}
|
|
2474
|
-
)
|
|
2475
|
-
}
|
|
2476
|
-
)
|
|
2477
|
-
] }),
|
|
2478
|
-
oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2175
|
+
children: /* @__PURE__ */ d("div", { className: "flex h-full min-h-0", children: [
|
|
2176
|
+
/* @__PURE__ */ e(
|
|
2177
|
+
"div",
|
|
2178
|
+
{
|
|
2179
|
+
className: L(
|
|
2180
|
+
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2181
|
+
{
|
|
2182
|
+
"!hidden": m === !1 || p,
|
|
2183
|
+
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2184
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": m !== !1 && !p && K,
|
|
2185
|
+
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2186
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !p && !K
|
|
2187
|
+
}
|
|
2188
|
+
),
|
|
2189
|
+
children: /* @__PURE__ */ e(
|
|
2190
|
+
wt,
|
|
2191
|
+
{
|
|
2192
|
+
onChannelSelect: ie,
|
|
2193
|
+
selectedChannel: $ || void 0,
|
|
2194
|
+
filters: de,
|
|
2195
|
+
channelRenderFilterFn: h,
|
|
2196
|
+
customEmptyStateIndicator: f,
|
|
2197
|
+
renderMessagePreview: E
|
|
2198
|
+
}
|
|
2199
|
+
)
|
|
2200
|
+
}
|
|
2201
|
+
),
|
|
2479
2202
|
/* @__PURE__ */ e(
|
|
2480
|
-
"
|
|
2203
|
+
"div",
|
|
2481
2204
|
{
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2205
|
+
className: L(
|
|
2206
|
+
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2207
|
+
{
|
|
2208
|
+
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2209
|
+
flex: p || K || l,
|
|
2210
|
+
// Normal mode: hide on mobile when no channel selected
|
|
2211
|
+
"hidden lg:flex": !p && !K && !l
|
|
2212
|
+
}
|
|
2213
|
+
),
|
|
2214
|
+
children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2215
|
+
yt,
|
|
2488
2216
|
{
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2217
|
+
channel: $,
|
|
2218
|
+
onBack: pe,
|
|
2219
|
+
showBackButton: !p,
|
|
2220
|
+
renderMessageInputActions: n,
|
|
2221
|
+
renderConversationFooter: r,
|
|
2222
|
+
renderChannelBanner: P,
|
|
2223
|
+
onLeaveConversation: ue,
|
|
2224
|
+
onBlockParticipant: xe,
|
|
2225
|
+
CustomChannelEmptyState: c,
|
|
2226
|
+
showDeleteConversation: ae,
|
|
2227
|
+
onDeleteConversationClick: v,
|
|
2228
|
+
onBlockParticipantClick: a,
|
|
2229
|
+
onReportParticipantClick: y,
|
|
2230
|
+
dmAgentEnabled: b,
|
|
2231
|
+
messageMetadata: C,
|
|
2232
|
+
onMessageSent: x,
|
|
2233
|
+
showStarButton: I,
|
|
2234
|
+
chatbotVotingEnabled: w,
|
|
2235
|
+
customProfileContent: U,
|
|
2236
|
+
customChannelActions: k,
|
|
2237
|
+
renderMessage: T,
|
|
2238
|
+
sendButton: M
|
|
2495
2239
|
},
|
|
2496
|
-
|
|
2497
|
-
) })
|
|
2240
|
+
$.id
|
|
2241
|
+
) }) : l ? (
|
|
2242
|
+
// Show loading while creating/loading direct conversation channel
|
|
2243
|
+
/* @__PURE__ */ e(fe, {})
|
|
2244
|
+
) : /* @__PURE__ */ e(
|
|
2245
|
+
Ct,
|
|
2246
|
+
{
|
|
2247
|
+
hasChannels: ee,
|
|
2248
|
+
channelsLoaded: W
|
|
2249
|
+
}
|
|
2250
|
+
)
|
|
2498
2251
|
}
|
|
2499
2252
|
)
|
|
2500
|
-
]
|
|
2253
|
+
] })
|
|
2501
2254
|
}
|
|
2502
2255
|
);
|
|
2503
|
-
},
|
|
2256
|
+
}, Ln = ({
|
|
2504
2257
|
question: t,
|
|
2505
2258
|
onClick: s,
|
|
2506
2259
|
loading: n = !1,
|
|
@@ -2512,7 +2265,7 @@ const ga = ({
|
|
|
2512
2265
|
onClick: s,
|
|
2513
2266
|
disabled: n,
|
|
2514
2267
|
style: { backgroundColor: "#E6E5E3" },
|
|
2515
|
-
className:
|
|
2268
|
+
className: L(
|
|
2516
2269
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2517
2270
|
{
|
|
2518
2271
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -2522,7 +2275,7 @@ const ga = ({
|
|
|
2522
2275
|
),
|
|
2523
2276
|
children: t
|
|
2524
2277
|
}
|
|
2525
|
-
),
|
|
2278
|
+
), la = ({
|
|
2526
2279
|
faqs: t,
|
|
2527
2280
|
onFaqClick: s,
|
|
2528
2281
|
loadingFaqId: n,
|
|
@@ -2531,7 +2284,7 @@ const ga = ({
|
|
|
2531
2284
|
avatarImage: l,
|
|
2532
2285
|
avatarName: i
|
|
2533
2286
|
}) => {
|
|
2534
|
-
const c = t.filter((
|
|
2287
|
+
const c = t.filter((m) => m.enabled).sort((m, u) => (m.order ?? 0) - (u.order ?? 0));
|
|
2535
2288
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ d("div", { className: "flex gap-3 items-end", children: [
|
|
2536
2289
|
(l || i) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2537
2290
|
ne,
|
|
@@ -2550,20 +2303,20 @@ const ga = ({
|
|
|
2550
2303
|
style: { backgroundColor: "#F1F0EE" },
|
|
2551
2304
|
children: [
|
|
2552
2305
|
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
2553
|
-
c.map((
|
|
2554
|
-
|
|
2306
|
+
c.map((m) => /* @__PURE__ */ e(
|
|
2307
|
+
Ln,
|
|
2555
2308
|
{
|
|
2556
|
-
question:
|
|
2557
|
-
onClick: () => s(
|
|
2558
|
-
loading: n ===
|
|
2309
|
+
question: m.question,
|
|
2310
|
+
onClick: () => s(m.id),
|
|
2311
|
+
loading: n === m.id
|
|
2559
2312
|
},
|
|
2560
|
-
|
|
2313
|
+
m.id
|
|
2561
2314
|
))
|
|
2562
2315
|
]
|
|
2563
2316
|
}
|
|
2564
2317
|
)
|
|
2565
2318
|
] }) });
|
|
2566
|
-
},
|
|
2319
|
+
}, An = [
|
|
2567
2320
|
[/pdf/, "pdf"],
|
|
2568
2321
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
2569
2322
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -2573,42 +2326,42 @@ const ga = ({
|
|
|
2573
2326
|
[/plain|rtf/, "text"],
|
|
2574
2327
|
[/markdown/, "markdown"]
|
|
2575
2328
|
];
|
|
2576
|
-
function
|
|
2329
|
+
function be(t) {
|
|
2577
2330
|
return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
|
|
2578
2331
|
}
|
|
2579
|
-
function
|
|
2580
|
-
const s =
|
|
2332
|
+
function Fn(t) {
|
|
2333
|
+
const s = An.find(
|
|
2581
2334
|
([n]) => n.test(t)
|
|
2582
2335
|
);
|
|
2583
2336
|
return s ? s[1] : "generic";
|
|
2584
2337
|
}
|
|
2585
|
-
const
|
|
2586
|
-
video:
|
|
2587
|
-
audio:
|
|
2588
|
-
image:
|
|
2589
|
-
document:
|
|
2590
|
-
},
|
|
2591
|
-
pdf:
|
|
2592
|
-
doc:
|
|
2593
|
-
xls:
|
|
2594
|
-
csv:
|
|
2595
|
-
ppt:
|
|
2596
|
-
zip:
|
|
2597
|
-
text:
|
|
2598
|
-
markdown:
|
|
2599
|
-
generic:
|
|
2338
|
+
const On = {
|
|
2339
|
+
video: ws,
|
|
2340
|
+
audio: vs,
|
|
2341
|
+
image: xs,
|
|
2342
|
+
document: ht
|
|
2343
|
+
}, Pn = {
|
|
2344
|
+
pdf: ks,
|
|
2345
|
+
doc: Is,
|
|
2346
|
+
xls: Ss,
|
|
2347
|
+
csv: Es,
|
|
2348
|
+
ppt: Cs,
|
|
2349
|
+
zip: ys,
|
|
2350
|
+
text: _s,
|
|
2351
|
+
markdown: Ns,
|
|
2352
|
+
generic: ht
|
|
2600
2353
|
};
|
|
2601
|
-
function
|
|
2602
|
-
const s =
|
|
2603
|
-
return s !== "document" ?
|
|
2354
|
+
function Un(t) {
|
|
2355
|
+
const s = be(t);
|
|
2356
|
+
return s !== "document" ? On[s] : Pn[Fn(t)];
|
|
2604
2357
|
}
|
|
2605
|
-
function
|
|
2606
|
-
return
|
|
2358
|
+
function ge(t, s) {
|
|
2359
|
+
return O.createElement(Un(t), s);
|
|
2607
2360
|
}
|
|
2608
|
-
const
|
|
2361
|
+
const Bn = (t) => {
|
|
2609
2362
|
var s, n;
|
|
2610
2363
|
return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
|
|
2611
|
-
},
|
|
2364
|
+
}, zn = ({
|
|
2612
2365
|
source: t,
|
|
2613
2366
|
mimeType: s,
|
|
2614
2367
|
poster: n,
|
|
@@ -2617,81 +2370,81 @@ const Wn = (t) => {
|
|
|
2617
2370
|
loop: l = !1,
|
|
2618
2371
|
controls: i = !0,
|
|
2619
2372
|
showProgress: c = !1,
|
|
2620
|
-
muted:
|
|
2373
|
+
muted: m = !1,
|
|
2621
2374
|
onContainerClick: u
|
|
2622
2375
|
}) => {
|
|
2623
|
-
const
|
|
2624
|
-
|
|
2625
|
-
}, []),
|
|
2626
|
-
const
|
|
2627
|
-
if (!
|
|
2628
|
-
const
|
|
2376
|
+
const h = be(s), f = J(null), v = J(null), a = J(null), y = J(o), [b, C] = A(r), [x, I] = A(0), [w, E] = A(!1), [P, U] = A(!1), [k, T] = A(!1), [M, _] = A(!1), [N, F] = A(!0), [H, D] = A(null), B = G(() => {
|
|
2377
|
+
T(!1), C(!0);
|
|
2378
|
+
}, []), S = G((g) => {
|
|
2379
|
+
const p = v.current;
|
|
2380
|
+
if (!p) return 0;
|
|
2381
|
+
const R = p.getBoundingClientRect();
|
|
2629
2382
|
return Math.max(
|
|
2630
2383
|
0,
|
|
2631
|
-
Math.min(1, (
|
|
2384
|
+
Math.min(1, (Bn(g) - R.left) / R.width)
|
|
2632
2385
|
);
|
|
2633
|
-
}, []),
|
|
2634
|
-
const
|
|
2635
|
-
|
|
2636
|
-
}, []),
|
|
2637
|
-
|
|
2638
|
-
const
|
|
2639
|
-
|
|
2386
|
+
}, []), $ = G((g) => {
|
|
2387
|
+
const p = f.current;
|
|
2388
|
+
p && p.duration && (p.currentTime = g * p.duration);
|
|
2389
|
+
}, []), V = (g) => {
|
|
2390
|
+
g.stopPropagation(), E(!0);
|
|
2391
|
+
const p = S(g);
|
|
2392
|
+
I(p), $(p);
|
|
2640
2393
|
};
|
|
2641
|
-
|
|
2642
|
-
o !== void 0 && o !==
|
|
2643
|
-
}, [o]),
|
|
2644
|
-
if (!
|
|
2394
|
+
Z(() => {
|
|
2395
|
+
o !== void 0 && o !== y.current && (y.current = o, C(o));
|
|
2396
|
+
}, [o]), Z(() => {
|
|
2397
|
+
if (!b) {
|
|
2645
2398
|
a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
|
|
2646
2399
|
return;
|
|
2647
2400
|
}
|
|
2648
|
-
const
|
|
2649
|
-
const
|
|
2650
|
-
|
|
2401
|
+
const g = () => {
|
|
2402
|
+
const p = f.current;
|
|
2403
|
+
p && p.duration && !w && I(p.currentTime / p.duration), a.current = requestAnimationFrame(g);
|
|
2651
2404
|
};
|
|
2652
|
-
return a.current = requestAnimationFrame(
|
|
2405
|
+
return a.current = requestAnimationFrame(g), () => {
|
|
2653
2406
|
a.current !== null && cancelAnimationFrame(a.current);
|
|
2654
2407
|
};
|
|
2655
|
-
}, [
|
|
2656
|
-
const
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
}) :
|
|
2660
|
-
}, [
|
|
2408
|
+
}, [b, w]), Z(() => {
|
|
2409
|
+
const g = f.current;
|
|
2410
|
+
g && (b ? g.play().catch((p) => {
|
|
2411
|
+
C(!1), T(!0);
|
|
2412
|
+
}) : g.pause());
|
|
2413
|
+
}, [b]), Z(() => {
|
|
2661
2414
|
if (!w) return;
|
|
2662
|
-
const
|
|
2663
|
-
E(!1),
|
|
2415
|
+
const g = (R) => I(S(R)), p = (R) => {
|
|
2416
|
+
E(!1), $(S(R));
|
|
2664
2417
|
};
|
|
2665
|
-
return window.addEventListener("mousemove",
|
|
2666
|
-
window.removeEventListener("mousemove",
|
|
2418
|
+
return window.addEventListener("mousemove", g), window.addEventListener("mouseup", p), window.addEventListener("touchmove", g, { passive: !0 }), window.addEventListener("touchend", p), () => {
|
|
2419
|
+
window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", p), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", p);
|
|
2667
2420
|
};
|
|
2668
|
-
}, [w,
|
|
2669
|
-
const
|
|
2421
|
+
}, [w, S, $]);
|
|
2422
|
+
const ee = H ? { aspectRatio: String(H) } : void 0, te = H ? "" : " aspect-video", W = Math.round(x * 100);
|
|
2670
2423
|
return /* @__PURE__ */ d(
|
|
2671
2424
|
"div",
|
|
2672
2425
|
{
|
|
2673
2426
|
role: "button",
|
|
2674
2427
|
tabIndex: 0,
|
|
2675
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
2676
|
-
style:
|
|
2677
|
-
onClick: (
|
|
2428
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${te}`,
|
|
2429
|
+
style: ee,
|
|
2430
|
+
onClick: (g) => {
|
|
2678
2431
|
if (u) {
|
|
2679
|
-
u(
|
|
2432
|
+
u(g);
|
|
2680
2433
|
return;
|
|
2681
2434
|
}
|
|
2682
|
-
|
|
2435
|
+
k || i && C((p) => !p);
|
|
2683
2436
|
},
|
|
2684
|
-
onKeyDown: (
|
|
2685
|
-
if (!(
|
|
2686
|
-
if (
|
|
2687
|
-
u(
|
|
2437
|
+
onKeyDown: (g) => {
|
|
2438
|
+
if (!(g.key !== "Enter" && g.key !== " ")) {
|
|
2439
|
+
if (g.preventDefault(), u) {
|
|
2440
|
+
u(g);
|
|
2688
2441
|
return;
|
|
2689
2442
|
}
|
|
2690
|
-
|
|
2443
|
+
k || i && C((p) => !p);
|
|
2691
2444
|
}
|
|
2692
2445
|
},
|
|
2693
2446
|
children: [
|
|
2694
|
-
n && (
|
|
2447
|
+
n && (h === "audio" || N) && /* @__PURE__ */ e(
|
|
2695
2448
|
"img",
|
|
2696
2449
|
{
|
|
2697
2450
|
src: n,
|
|
@@ -2699,26 +2452,26 @@ const Wn = (t) => {
|
|
|
2699
2452
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
2700
2453
|
}
|
|
2701
2454
|
),
|
|
2702
|
-
!n && (
|
|
2455
|
+
!n && (h === "audio" || N) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: ge(s, {
|
|
2703
2456
|
className: "size-12 text-black/20",
|
|
2704
2457
|
weight: "regular"
|
|
2705
2458
|
}) }),
|
|
2706
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0", children:
|
|
2459
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0", children: h === "audio" ? /* @__PURE__ */ e(
|
|
2707
2460
|
"audio",
|
|
2708
2461
|
{
|
|
2709
2462
|
ref: f,
|
|
2710
2463
|
src: t,
|
|
2711
2464
|
loop: l,
|
|
2712
|
-
muted:
|
|
2465
|
+
muted: m,
|
|
2713
2466
|
style: { width: "100%", height: "100%" },
|
|
2714
|
-
onLoadStart: () =>
|
|
2467
|
+
onLoadStart: () => _(!0),
|
|
2715
2468
|
onCanPlay: () => {
|
|
2716
|
-
|
|
2469
|
+
_(!1), F(!1);
|
|
2717
2470
|
},
|
|
2718
|
-
onWaiting: () =>
|
|
2719
|
-
onPlay: () =>
|
|
2471
|
+
onWaiting: () => _(!0),
|
|
2472
|
+
onPlay: () => T(!1),
|
|
2720
2473
|
onEnded: () => {
|
|
2721
|
-
l || (
|
|
2474
|
+
l || (C(!1), I(0));
|
|
2722
2475
|
},
|
|
2723
2476
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2724
2477
|
}
|
|
@@ -2728,46 +2481,46 @@ const Wn = (t) => {
|
|
|
2728
2481
|
ref: f,
|
|
2729
2482
|
src: t,
|
|
2730
2483
|
loop: l,
|
|
2731
|
-
muted:
|
|
2484
|
+
muted: m,
|
|
2732
2485
|
playsInline: !0,
|
|
2733
2486
|
style: { width: "100%", height: "100%" },
|
|
2734
|
-
onLoadStart: () =>
|
|
2487
|
+
onLoadStart: () => _(!0),
|
|
2735
2488
|
onCanPlay: () => {
|
|
2736
|
-
|
|
2489
|
+
_(!1), F(!1);
|
|
2737
2490
|
},
|
|
2738
|
-
onWaiting: () =>
|
|
2739
|
-
onPlay: () =>
|
|
2491
|
+
onWaiting: () => _(!0),
|
|
2492
|
+
onPlay: () => T(!1),
|
|
2740
2493
|
onLoadedMetadata: () => {
|
|
2741
|
-
const
|
|
2742
|
-
|
|
2494
|
+
const g = f.current;
|
|
2495
|
+
g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight && D(g.videoWidth / g.videoHeight);
|
|
2743
2496
|
},
|
|
2744
2497
|
onEnded: () => {
|
|
2745
|
-
l || (
|
|
2498
|
+
l || (C(!1), I(0));
|
|
2746
2499
|
},
|
|
2747
2500
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2748
2501
|
}
|
|
2749
2502
|
) }),
|
|
2750
|
-
|
|
2751
|
-
|
|
2503
|
+
M && !k && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
2504
|
+
ft,
|
|
2752
2505
|
{
|
|
2753
2506
|
className: "size-8 animate-spin text-white/80",
|
|
2754
2507
|
weight: "bold"
|
|
2755
2508
|
}
|
|
2756
2509
|
) }),
|
|
2757
|
-
|
|
2510
|
+
k && !i && /* @__PURE__ */ e(
|
|
2758
2511
|
"div",
|
|
2759
2512
|
{
|
|
2760
2513
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
2761
2514
|
role: "button",
|
|
2762
2515
|
tabIndex: 0,
|
|
2763
2516
|
"aria-label": "Play preview",
|
|
2764
|
-
onClick: (
|
|
2765
|
-
|
|
2517
|
+
onClick: (g) => {
|
|
2518
|
+
g.stopPropagation(), B();
|
|
2766
2519
|
},
|
|
2767
|
-
onKeyDown: (
|
|
2768
|
-
|
|
2520
|
+
onKeyDown: (g) => {
|
|
2521
|
+
g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), B());
|
|
2769
2522
|
},
|
|
2770
|
-
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(
|
|
2523
|
+
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
2771
2524
|
}
|
|
2772
2525
|
),
|
|
2773
2526
|
c && !i && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ e(
|
|
@@ -2775,23 +2528,23 @@ const Wn = (t) => {
|
|
|
2775
2528
|
{
|
|
2776
2529
|
role: "slider",
|
|
2777
2530
|
"aria-label": "Playback position",
|
|
2778
|
-
"aria-valuenow":
|
|
2531
|
+
"aria-valuenow": W,
|
|
2779
2532
|
"aria-valuemin": 0,
|
|
2780
2533
|
"aria-valuemax": 100,
|
|
2781
2534
|
tabIndex: 0,
|
|
2782
2535
|
ref: v,
|
|
2783
2536
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2784
|
-
onMouseDown:
|
|
2785
|
-
onTouchStart:
|
|
2786
|
-
onClick: (
|
|
2787
|
-
onKeyDown: (
|
|
2788
|
-
|
|
2537
|
+
onMouseDown: V,
|
|
2538
|
+
onTouchStart: V,
|
|
2539
|
+
onClick: (g) => g.stopPropagation(),
|
|
2540
|
+
onKeyDown: (g) => {
|
|
2541
|
+
g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
|
|
2789
2542
|
},
|
|
2790
2543
|
children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
|
|
2791
2544
|
"div",
|
|
2792
2545
|
{
|
|
2793
2546
|
className: "h-full rounded-full bg-white",
|
|
2794
|
-
style: { width: `${
|
|
2547
|
+
style: { width: `${W}%` }
|
|
2795
2548
|
}
|
|
2796
2549
|
) })
|
|
2797
2550
|
}
|
|
@@ -2801,12 +2554,12 @@ const Wn = (t) => {
|
|
|
2801
2554
|
"button",
|
|
2802
2555
|
{
|
|
2803
2556
|
type: "button",
|
|
2804
|
-
onClick: (
|
|
2805
|
-
|
|
2557
|
+
onClick: (g) => {
|
|
2558
|
+
g.stopPropagation(), C((p) => !p);
|
|
2806
2559
|
},
|
|
2807
2560
|
className: "shrink-0 text-white",
|
|
2808
|
-
"aria-label":
|
|
2809
|
-
children:
|
|
2561
|
+
"aria-label": b ? "Pause" : "Play",
|
|
2562
|
+
children: b ? /* @__PURE__ */ e(Ms, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(et, { className: "size-5 translate-x-px", weight: "fill" })
|
|
2810
2563
|
}
|
|
2811
2564
|
),
|
|
2812
2565
|
/* @__PURE__ */ d(
|
|
@@ -2814,30 +2567,30 @@ const Wn = (t) => {
|
|
|
2814
2567
|
{
|
|
2815
2568
|
role: "slider",
|
|
2816
2569
|
"aria-label": "Playback position",
|
|
2817
|
-
"aria-valuenow":
|
|
2570
|
+
"aria-valuenow": W,
|
|
2818
2571
|
"aria-valuemin": 0,
|
|
2819
2572
|
"aria-valuemax": 100,
|
|
2820
2573
|
tabIndex: 0,
|
|
2821
2574
|
ref: v,
|
|
2822
2575
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2823
|
-
onMouseDown:
|
|
2824
|
-
onTouchStart:
|
|
2825
|
-
onClick: (
|
|
2826
|
-
onMouseEnter: () =>
|
|
2827
|
-
onMouseLeave: () =>
|
|
2828
|
-
onKeyDown: (
|
|
2829
|
-
|
|
2576
|
+
onMouseDown: V,
|
|
2577
|
+
onTouchStart: V,
|
|
2578
|
+
onClick: (g) => g.stopPropagation(),
|
|
2579
|
+
onMouseEnter: () => U(!0),
|
|
2580
|
+
onMouseLeave: () => U(!1),
|
|
2581
|
+
onKeyDown: (g) => {
|
|
2582
|
+
g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
|
|
2830
2583
|
},
|
|
2831
2584
|
children: [
|
|
2832
2585
|
/* @__PURE__ */ e(
|
|
2833
2586
|
"div",
|
|
2834
2587
|
{
|
|
2835
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
2588
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${P || w ? "h-1.5" : "h-1"}`,
|
|
2836
2589
|
children: /* @__PURE__ */ e(
|
|
2837
2590
|
"div",
|
|
2838
2591
|
{
|
|
2839
2592
|
className: "h-full rounded-full bg-white",
|
|
2840
|
-
style: { width: `${
|
|
2593
|
+
style: { width: `${W}%` }
|
|
2841
2594
|
}
|
|
2842
2595
|
)
|
|
2843
2596
|
}
|
|
@@ -2845,8 +2598,8 @@ const Wn = (t) => {
|
|
|
2845
2598
|
/* @__PURE__ */ e(
|
|
2846
2599
|
"div",
|
|
2847
2600
|
{
|
|
2848
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
2849
|
-
style: { left: `${
|
|
2601
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
2602
|
+
style: { left: `${W}%` }
|
|
2850
2603
|
}
|
|
2851
2604
|
)
|
|
2852
2605
|
]
|
|
@@ -2856,7 +2609,7 @@ const Wn = (t) => {
|
|
|
2856
2609
|
]
|
|
2857
2610
|
}
|
|
2858
2611
|
);
|
|
2859
|
-
},
|
|
2612
|
+
}, it = (t) => t === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", $n = (t) => t === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Et = ({
|
|
2860
2613
|
mimeType: t,
|
|
2861
2614
|
sourceUrl: s,
|
|
2862
2615
|
thumbnailUrl: n,
|
|
@@ -2865,9 +2618,9 @@ const Wn = (t) => {
|
|
|
2865
2618
|
mediaPlayerProps: l,
|
|
2866
2619
|
containedImage: i = !1
|
|
2867
2620
|
}) => {
|
|
2868
|
-
const c =
|
|
2621
|
+
const c = be(t), [m, u] = A(!1);
|
|
2869
2622
|
return s && (c === "video" || c === "audio") ? /* @__PURE__ */ e(
|
|
2870
|
-
|
|
2623
|
+
zn,
|
|
2871
2624
|
{
|
|
2872
2625
|
source: s,
|
|
2873
2626
|
mimeType: t,
|
|
@@ -2880,7 +2633,7 @@ const Wn = (t) => {
|
|
|
2880
2633
|
{
|
|
2881
2634
|
src: s,
|
|
2882
2635
|
alt: r ?? "",
|
|
2883
|
-
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${
|
|
2636
|
+
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
|
|
2884
2637
|
draggable: !1,
|
|
2885
2638
|
onLoad: () => u(!0)
|
|
2886
2639
|
}
|
|
@@ -2897,7 +2650,7 @@ const Wn = (t) => {
|
|
|
2897
2650
|
{
|
|
2898
2651
|
src: n,
|
|
2899
2652
|
alt: r ?? "",
|
|
2900
|
-
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${
|
|
2653
|
+
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
|
|
2901
2654
|
draggable: !1,
|
|
2902
2655
|
onLoad: () => u(!0)
|
|
2903
2656
|
}
|
|
@@ -2913,12 +2666,12 @@ const Wn = (t) => {
|
|
|
2913
2666
|
"div",
|
|
2914
2667
|
{
|
|
2915
2668
|
className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
2916
|
-
children:
|
|
2917
|
-
className:
|
|
2669
|
+
children: ge(t, {
|
|
2670
|
+
className: it(o),
|
|
2918
2671
|
weight: "regular"
|
|
2919
2672
|
})
|
|
2920
2673
|
}
|
|
2921
|
-
) : n ? /* @__PURE__ */ e("div", { className: `relative ${
|
|
2674
|
+
) : n ? /* @__PURE__ */ e("div", { className: `relative ${$n(o)}`, children: /* @__PURE__ */ e(
|
|
2922
2675
|
"img",
|
|
2923
2676
|
{
|
|
2924
2677
|
src: n,
|
|
@@ -2930,13 +2683,13 @@ const Wn = (t) => {
|
|
|
2930
2683
|
"div",
|
|
2931
2684
|
{
|
|
2932
2685
|
className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
2933
|
-
children:
|
|
2934
|
-
className:
|
|
2686
|
+
children: ge(t, {
|
|
2687
|
+
className: it(o),
|
|
2935
2688
|
weight: "regular"
|
|
2936
2689
|
})
|
|
2937
2690
|
}
|
|
2938
2691
|
);
|
|
2939
|
-
},
|
|
2692
|
+
}, St = ({
|
|
2940
2693
|
variant: t,
|
|
2941
2694
|
thumbnail: s,
|
|
2942
2695
|
title: n,
|
|
@@ -2945,40 +2698,40 @@ const Wn = (t) => {
|
|
|
2945
2698
|
detail: l,
|
|
2946
2699
|
statusBadge: i,
|
|
2947
2700
|
action: c,
|
|
2948
|
-
topLeft:
|
|
2701
|
+
topLeft: m,
|
|
2949
2702
|
topRight: u,
|
|
2950
|
-
rootRef:
|
|
2703
|
+
rootRef: h,
|
|
2951
2704
|
"data-testid": f
|
|
2952
2705
|
}) => {
|
|
2953
|
-
const v = t === "dark", a = v ? n ?? r : n ?? "",
|
|
2706
|
+
const v = t === "dark", a = v ? n ?? r : n ?? "", y = v && !n;
|
|
2954
2707
|
return /* @__PURE__ */ d(
|
|
2955
2708
|
"div",
|
|
2956
2709
|
{
|
|
2957
|
-
ref:
|
|
2710
|
+
ref: h,
|
|
2958
2711
|
"data-testid": f,
|
|
2959
|
-
className:
|
|
2712
|
+
className: L(
|
|
2960
2713
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
2961
2714
|
v ? "bg-[#121110]" : "bg-white"
|
|
2962
2715
|
),
|
|
2963
2716
|
children: [
|
|
2964
|
-
|
|
2717
|
+
m ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: m }) : null,
|
|
2965
2718
|
u ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute right-3 top-3 z-50", children: u }) : null,
|
|
2966
2719
|
s,
|
|
2967
2720
|
/* @__PURE__ */ d("div", { className: "px-4 pb-3 pt-3", children: [
|
|
2968
2721
|
a.trim() !== "" && /* @__PURE__ */ e(
|
|
2969
2722
|
"p",
|
|
2970
2723
|
{
|
|
2971
|
-
className:
|
|
2724
|
+
className: L("mb-0.5 truncate text-base font-medium", {
|
|
2972
2725
|
"text-black": !v,
|
|
2973
|
-
"text-white/30": v &&
|
|
2974
|
-
"text-white": v && !
|
|
2726
|
+
"text-white/30": v && y,
|
|
2727
|
+
"text-white": v && !y
|
|
2975
2728
|
}),
|
|
2976
2729
|
children: a
|
|
2977
2730
|
}
|
|
2978
2731
|
),
|
|
2979
2732
|
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
2980
|
-
|
|
2981
|
-
className:
|
|
2733
|
+
ge(o, {
|
|
2734
|
+
className: L(
|
|
2982
2735
|
"size-5 shrink-0",
|
|
2983
2736
|
v ? "text-white/55" : "text-black/55"
|
|
2984
2737
|
),
|
|
@@ -2987,7 +2740,7 @@ const Wn = (t) => {
|
|
|
2987
2740
|
l != null && l !== "" && /* @__PURE__ */ e(
|
|
2988
2741
|
"span",
|
|
2989
2742
|
{
|
|
2990
|
-
className:
|
|
2743
|
+
className: L(
|
|
2991
2744
|
"text-xs font-medium",
|
|
2992
2745
|
v ? "text-white/55" : "text-black/55"
|
|
2993
2746
|
),
|
|
@@ -3002,29 +2755,29 @@ const Wn = (t) => {
|
|
|
3002
2755
|
}
|
|
3003
2756
|
);
|
|
3004
2757
|
};
|
|
3005
|
-
function
|
|
2758
|
+
function It(t) {
|
|
3006
2759
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
3007
2760
|
}
|
|
3008
|
-
function
|
|
2761
|
+
function Re(t) {
|
|
3009
2762
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${t ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
3010
2763
|
}
|
|
3011
|
-
function
|
|
2764
|
+
function jn(t) {
|
|
3012
2765
|
return t ? "bg-white/10" : "bg-black/5";
|
|
3013
2766
|
}
|
|
3014
|
-
function
|
|
2767
|
+
function Gn(t) {
|
|
3015
2768
|
return t ? "text-white" : "text-black";
|
|
3016
2769
|
}
|
|
3017
|
-
function
|
|
2770
|
+
function Vn(t) {
|
|
3018
2771
|
return t ? "text-white/55" : "text-black/55";
|
|
3019
2772
|
}
|
|
3020
|
-
function
|
|
2773
|
+
function Hn(t) {
|
|
3021
2774
|
return t ? "text-white/40" : "text-black/40";
|
|
3022
2775
|
}
|
|
3023
|
-
function
|
|
2776
|
+
function Yn(t) {
|
|
3024
2777
|
return t ? "text-white/20" : "text-black/20";
|
|
3025
2778
|
}
|
|
3026
|
-
const
|
|
3027
|
-
const { title: n, text: r, image_url: o, og_scrape_url: l, title_link: i } = t, c = l ?? i,
|
|
2779
|
+
const Le = ({ attachment: t, isMyMessage: s }) => {
|
|
2780
|
+
const { title: n, text: r, image_url: o, og_scrape_url: l, title_link: i } = t, c = l ?? i, m = typeof c == "string" && c.trim() !== "" ? c : void 0, u = /* @__PURE__ */ d(O.Fragment, { children: [
|
|
3028
2781
|
/* @__PURE__ */ e("div", { className: "p-2", children: o ? /* @__PURE__ */ e(
|
|
3029
2782
|
"img",
|
|
3030
2783
|
{
|
|
@@ -3035,25 +2788,25 @@ const Xe = ({ attachment: t, isMyMessage: s }) => {
|
|
|
3035
2788
|
) : /* @__PURE__ */ e(
|
|
3036
2789
|
"div",
|
|
3037
2790
|
{
|
|
3038
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
3039
|
-
children: /* @__PURE__ */ e(
|
|
2791
|
+
className: `aspect-video w-full rounded-[20px] ${jn(s)} flex items-center justify-center`,
|
|
2792
|
+
children: /* @__PURE__ */ e(Ts, { className: `size-12 ${Yn(s)}` })
|
|
3040
2793
|
}
|
|
3041
2794
|
) }),
|
|
3042
2795
|
/* @__PURE__ */ d("div", { className: "px-3 pb-3", children: [
|
|
3043
|
-
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
3044
|
-
r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${
|
|
3045
|
-
|
|
2796
|
+
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${Gn(s)}`, children: n }),
|
|
2797
|
+
r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${Vn(s)}`, children: r }),
|
|
2798
|
+
m && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Hn(s)}`, children: m })
|
|
3046
2799
|
] })
|
|
3047
2800
|
] });
|
|
3048
|
-
return
|
|
2801
|
+
return m ? /* @__PURE__ */ e("a", { href: m, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ e("div", { className: "block", children: u });
|
|
3049
2802
|
};
|
|
3050
|
-
function
|
|
2803
|
+
function Ae(t) {
|
|
3051
2804
|
var s;
|
|
3052
2805
|
return (s = t.attachments) == null ? void 0 : s.find(
|
|
3053
2806
|
(n) => n.type === "link" || !!n.og_scrape_url && !n.asset_url
|
|
3054
2807
|
);
|
|
3055
2808
|
}
|
|
3056
|
-
async function
|
|
2809
|
+
async function Wn(t, s) {
|
|
3057
2810
|
let n;
|
|
3058
2811
|
try {
|
|
3059
2812
|
n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
|
|
@@ -3065,11 +2818,11 @@ async function ta(t, s) {
|
|
|
3065
2818
|
const o = await r.blob(), l = URL.createObjectURL(o), i = document.createElement("a");
|
|
3066
2819
|
i.href = l, i.download = n, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(l);
|
|
3067
2820
|
}
|
|
3068
|
-
const
|
|
2821
|
+
const qn = ({
|
|
3069
2822
|
url: t,
|
|
3070
2823
|
filename: s
|
|
3071
2824
|
}) => {
|
|
3072
|
-
const [n, r] =
|
|
2825
|
+
const [n, r] = A(!1);
|
|
3073
2826
|
return /* @__PURE__ */ e(
|
|
3074
2827
|
"button",
|
|
3075
2828
|
{
|
|
@@ -3077,7 +2830,7 @@ const sa = ({
|
|
|
3077
2830
|
onClick: (l) => {
|
|
3078
2831
|
l.stopPropagation();
|
|
3079
2832
|
const i = window.open("", "_blank", "noopener,noreferrer");
|
|
3080
|
-
r(!0),
|
|
2833
|
+
r(!0), Wn(t, s).then(() => {
|
|
3081
2834
|
i == null || i.close();
|
|
3082
2835
|
}).catch(() => {
|
|
3083
2836
|
i && (i.location.href = t);
|
|
@@ -3085,44 +2838,44 @@ const sa = ({
|
|
|
3085
2838
|
},
|
|
3086
2839
|
disabled: n,
|
|
3087
2840
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
3088
|
-
children: n ? /* @__PURE__ */ e(
|
|
3089
|
-
/* @__PURE__ */ e(
|
|
2841
|
+
children: n ? /* @__PURE__ */ e(ft, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(O.Fragment, { children: [
|
|
2842
|
+
/* @__PURE__ */ e(Ds, { className: "size-4 text-white", weight: "bold" }),
|
|
3090
2843
|
"Download"
|
|
3091
2844
|
] })
|
|
3092
2845
|
}
|
|
3093
2846
|
);
|
|
3094
2847
|
};
|
|
3095
|
-
function
|
|
3096
|
-
var f, v, a,
|
|
2848
|
+
function Fe(t) {
|
|
2849
|
+
var f, v, a, y;
|
|
3097
2850
|
const s = (f = t.attachments) == null ? void 0 : f.find(
|
|
3098
|
-
(
|
|
2851
|
+
(b) => b.type === "video" && b.asset_url
|
|
3099
2852
|
), n = (v = t.attachments) == null ? void 0 : v.find(
|
|
3100
|
-
(
|
|
2853
|
+
(b) => b.type === "image" && b.image_url
|
|
3101
2854
|
), r = (a = t.attachments) == null ? void 0 : a.find(
|
|
3102
|
-
(
|
|
3103
|
-
), o = (
|
|
3104
|
-
(
|
|
2855
|
+
(b) => b.type === "audio" && b.asset_url
|
|
2856
|
+
), o = (y = t.attachments) == null ? void 0 : y.find(
|
|
2857
|
+
(b) => b.type === "file" && b.asset_url
|
|
3105
2858
|
), l = s ?? n ?? r ?? o, i = (s == null ? void 0 : s.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (r == null ? void 0 : r.asset_url) ?? (o == null ? void 0 : o.asset_url);
|
|
3106
2859
|
if (!i) return null;
|
|
3107
|
-
const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"),
|
|
2860
|
+
const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), m = l == null ? void 0 : l.title, u = l == null ? void 0 : l.file_size, h = s == null ? void 0 : s.thumb_url;
|
|
3108
2861
|
return {
|
|
3109
2862
|
resolvedUrl: i,
|
|
3110
2863
|
resolvedType: c,
|
|
3111
|
-
title:
|
|
2864
|
+
title: m,
|
|
3112
2865
|
fileSize: u,
|
|
3113
|
-
thumbnailUrl:
|
|
2866
|
+
thumbnailUrl: h
|
|
3114
2867
|
};
|
|
3115
2868
|
}
|
|
3116
|
-
const
|
|
2869
|
+
const kt = ({
|
|
3117
2870
|
resolvedUrl: t,
|
|
3118
2871
|
resolvedType: s,
|
|
3119
2872
|
title: n,
|
|
3120
2873
|
fileSize: r,
|
|
3121
2874
|
thumbnailUrl: o
|
|
3122
2875
|
}) => {
|
|
3123
|
-
const l = r !== void 0 ?
|
|
2876
|
+
const l = r !== void 0 ? It(r) : void 0;
|
|
3124
2877
|
return /* @__PURE__ */ e(
|
|
3125
|
-
|
|
2878
|
+
St,
|
|
3126
2879
|
{
|
|
3127
2880
|
variant: "dark",
|
|
3128
2881
|
title: n,
|
|
@@ -3130,7 +2883,7 @@ const Pt = ({
|
|
|
3130
2883
|
mimeType: s,
|
|
3131
2884
|
detail: l,
|
|
3132
2885
|
thumbnail: /* @__PURE__ */ e(
|
|
3133
|
-
|
|
2886
|
+
Et,
|
|
3134
2887
|
{
|
|
3135
2888
|
mimeType: s,
|
|
3136
2889
|
sourceUrl: t,
|
|
@@ -3141,23 +2894,23 @@ const Pt = ({
|
|
|
3141
2894
|
)
|
|
3142
2895
|
}
|
|
3143
2896
|
);
|
|
3144
|
-
},
|
|
2897
|
+
}, Mt = ({
|
|
3145
2898
|
resolvedUrl: t,
|
|
3146
2899
|
resolvedType: s,
|
|
3147
2900
|
title: n,
|
|
3148
2901
|
fileSize: r,
|
|
3149
2902
|
thumbnailUrl: o
|
|
3150
2903
|
}) => {
|
|
3151
|
-
const l =
|
|
2904
|
+
const l = be(s), i = r !== void 0 ? It(r) : void 0;
|
|
3152
2905
|
return /* @__PURE__ */ e(
|
|
3153
|
-
|
|
2906
|
+
St,
|
|
3154
2907
|
{
|
|
3155
2908
|
variant: "light",
|
|
3156
2909
|
title: n,
|
|
3157
2910
|
mimeType: s,
|
|
3158
2911
|
detail: i,
|
|
3159
2912
|
thumbnail: /* @__PURE__ */ e(
|
|
3160
|
-
|
|
2913
|
+
Et,
|
|
3161
2914
|
{
|
|
3162
2915
|
mimeType: s,
|
|
3163
2916
|
sourceUrl: t,
|
|
@@ -3167,14 +2920,14 @@ const Pt = ({
|
|
|
3167
2920
|
containedImage: l === "image" || l === "document"
|
|
3168
2921
|
}
|
|
3169
2922
|
),
|
|
3170
|
-
action: /* @__PURE__ */ e(
|
|
2923
|
+
action: /* @__PURE__ */ e(qn, { url: t, filename: n })
|
|
3171
2924
|
}
|
|
3172
2925
|
);
|
|
3173
|
-
},
|
|
2926
|
+
}, Xn = ({
|
|
3174
2927
|
message: t,
|
|
3175
2928
|
isMyMessage: s = !1
|
|
3176
2929
|
}) => {
|
|
3177
|
-
const n =
|
|
2930
|
+
const n = Ae(t), r = Fe(t);
|
|
3178
2931
|
return !n && !r ? null : /* @__PURE__ */ d("div", { className: s ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
|
|
3179
2932
|
!s && t.user && /* @__PURE__ */ e(
|
|
3180
2933
|
ne,
|
|
@@ -3195,95 +2948,53 @@ const Pt = ({
|
|
|
3195
2948
|
{
|
|
3196
2949
|
className: "str-chat__message-bubble",
|
|
3197
2950
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
3198
|
-
children: n ? /* @__PURE__ */ e("div", { className:
|
|
2951
|
+
children: n ? /* @__PURE__ */ e("div", { className: Re(s), children: /* @__PURE__ */ e(Le, { attachment: n, isMyMessage: s }) }) : s ? /* @__PURE__ */ e(kt, { ...r }) : /* @__PURE__ */ e(Mt, { ...r })
|
|
3199
2952
|
}
|
|
3200
2953
|
) })
|
|
3201
2954
|
}
|
|
3202
2955
|
)
|
|
3203
2956
|
] });
|
|
3204
|
-
},
|
|
2957
|
+
}, Zn = ({
|
|
3205
2958
|
message: t
|
|
3206
2959
|
}) => {
|
|
3207
|
-
const s =
|
|
2960
|
+
const s = Ae(t);
|
|
3208
2961
|
if (s)
|
|
3209
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3210
|
-
const n =
|
|
3211
|
-
return n ? /* @__PURE__ */ e(
|
|
3212
|
-
},
|
|
2962
|
+
return /* @__PURE__ */ e("div", { className: Re(!0), children: /* @__PURE__ */ e(Le, { attachment: s, isMyMessage: !0 }) });
|
|
2963
|
+
const n = Fe(t);
|
|
2964
|
+
return n ? /* @__PURE__ */ e(kt, { ...n }) : null;
|
|
2965
|
+
}, Jn = ({
|
|
3213
2966
|
message: t
|
|
3214
2967
|
}) => {
|
|
3215
|
-
const s =
|
|
2968
|
+
const s = Ae(t);
|
|
3216
2969
|
if (s)
|
|
3217
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3218
|
-
const n =
|
|
3219
|
-
return n ? /* @__PURE__ */ e(
|
|
3220
|
-
},
|
|
3221
|
-
Creator:
|
|
3222
|
-
Visitor:
|
|
3223
|
-
})
|
|
3224
|
-
const { initialSearch: n = "", pageSize: r = 20 } = s, [o, l] = M([]), [i, c] = M(!1), [h, u] = M(null), [m, f] = M(n), [v, a] = M(!0), [C, g] = M(), y = U(async (E = !1, F) => {
|
|
3225
|
-
if (i) return;
|
|
3226
|
-
const N = F !== void 0 ? F : m;
|
|
3227
|
-
c(!0), u(null);
|
|
3228
|
-
try {
|
|
3229
|
-
const b = await t.loadParticipants({
|
|
3230
|
-
search: N || void 0,
|
|
3231
|
-
limit: r,
|
|
3232
|
-
cursor: E ? void 0 : C
|
|
3233
|
-
});
|
|
3234
|
-
l(
|
|
3235
|
-
(k) => E ? b.participants : [...k, ...b.participants]
|
|
3236
|
-
), a(b.hasMore), g(b.nextCursor);
|
|
3237
|
-
} catch (b) {
|
|
3238
|
-
const k = b instanceof Error ? b.message : "Failed to load participants";
|
|
3239
|
-
u(k), console.error("[useParticipants] Load error:", b);
|
|
3240
|
-
} finally {
|
|
3241
|
-
c(!1);
|
|
3242
|
-
}
|
|
3243
|
-
}, [t, m, C, r, i]), p = U(() => {
|
|
3244
|
-
v && !i && y(!1);
|
|
3245
|
-
}, [v, i, y]), S = U((E) => {
|
|
3246
|
-
f(E), g(void 0), y(!0, E);
|
|
3247
|
-
}, [y]), w = U(() => {
|
|
3248
|
-
g(void 0), y(!0);
|
|
3249
|
-
}, [y]);
|
|
3250
|
-
return K(() => {
|
|
3251
|
-
y(!0);
|
|
3252
|
-
}, [t.loadParticipants]), {
|
|
3253
|
-
participants: o,
|
|
3254
|
-
loading: i,
|
|
3255
|
-
error: h,
|
|
3256
|
-
searchQuery: m,
|
|
3257
|
-
hasMore: v,
|
|
3258
|
-
totalCount: t.totalCount,
|
|
3259
|
-
loadMore: p,
|
|
3260
|
-
search: S,
|
|
3261
|
-
refresh: w
|
|
3262
|
-
};
|
|
3263
|
-
};
|
|
2970
|
+
return /* @__PURE__ */ e("div", { className: Re(!1), children: /* @__PURE__ */ e(Le, { attachment: s, isMyMessage: !1 }) });
|
|
2971
|
+
const n = Fe(t);
|
|
2972
|
+
return n ? /* @__PURE__ */ e(Mt, { ...n }) : null;
|
|
2973
|
+
}, ca = Object.assign(Xn, {
|
|
2974
|
+
Creator: Zn,
|
|
2975
|
+
Visitor: Jn
|
|
2976
|
+
});
|
|
3264
2977
|
export {
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
ke as b,
|
|
2978
|
+
St as A,
|
|
2979
|
+
kn as C,
|
|
2980
|
+
la as F,
|
|
2981
|
+
nt as L,
|
|
2982
|
+
ca as M,
|
|
2983
|
+
Et as a,
|
|
2984
|
+
me as b,
|
|
3273
2985
|
ne as c,
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
un as u
|
|
2986
|
+
wt as d,
|
|
2987
|
+
yt as e,
|
|
2988
|
+
ia as f,
|
|
2989
|
+
Ln as g,
|
|
2990
|
+
ln as h,
|
|
2991
|
+
ra as i,
|
|
2992
|
+
oa as j,
|
|
2993
|
+
Ps as k,
|
|
2994
|
+
Fe as l,
|
|
2995
|
+
Js as m,
|
|
2996
|
+
Rs as n,
|
|
2997
|
+
Ae as r,
|
|
2998
|
+
an as u
|
|
3288
2999
|
};
|
|
3289
|
-
//# sourceMappingURL=index-
|
|
3000
|
+
//# sourceMappingURL=index-j4j9UfK1.js.map
|