@linktr.ee/messaging-react 1.25.1 → 1.26.1-rc-1776055454
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/Preview-DqAv16NS.js +87 -0
- package/dist/Preview-DqAv16NS.js.map +1 -0
- package/dist/dash.all.min-Duv4lvGS.js +18858 -0
- package/dist/dash.all.min-Duv4lvGS.js.map +1 -0
- package/dist/hls-Bogc7CBn.js +21710 -0
- package/dist/hls-Bogc7CBn.js.map +1 -0
- package/dist/index-Da-xN4Yq.js +16142 -0
- package/dist/index-Da-xN4Yq.js.map +1 -0
- package/dist/index-Dj9rqWcU.js +69 -0
- package/dist/index-Dj9rqWcU.js.map +1 -0
- package/dist/index.d.ts +85 -9
- package/dist/index.js +1745 -1156
- package/dist/index.js.map +1 -1
- package/dist/mixin-B6jYfIcp.js +808 -0
- package/dist/mixin-B6jYfIcp.js.map +1 -0
- package/dist/react-BxlQMOfz.js +419 -0
- package/dist/react-BxlQMOfz.js.map +1 -0
- package/dist/react-COAP-MIW.js +377 -0
- package/dist/react-COAP-MIW.js.map +1 -0
- package/dist/react-Cn4WlMcl.js +3108 -0
- package/dist/react-Cn4WlMcl.js.map +1 -0
- package/dist/react-CwTJArKY.js +459 -0
- package/dist/react-CwTJArKY.js.map +1 -0
- package/dist/react-DkfS_atT.js +373 -0
- package/dist/react-DkfS_atT.js.map +1 -0
- package/dist/react-Pea5fum1.js +286 -0
- package/dist/react-Pea5fum1.js.map +1 -0
- package/dist/react-RiBbsUDd.js +534 -0
- package/dist/react-RiBbsUDd.js.map +1 -0
- package/dist/react-dS1WBxxz.js +238 -0
- package/dist/react-dS1WBxxz.js.map +1 -0
- package/package.json +2 -1
- package/src/components/ChannelList/index.test.tsx +18 -0
- package/src/components/ChannelList/index.tsx +2 -0
- package/src/components/ChannelView.test.tsx +50 -1
- package/src/components/ChannelView.tsx +13 -3
- package/src/components/CustomMessage/CustomMessage.stories.tsx +61 -2
- package/src/components/CustomMessage/MessageTag.tsx +5 -0
- package/src/components/CustomMessage/index.tsx +46 -4
- package/src/components/LockedAttachmentCard/LockedAttachmentCard.stories.tsx +351 -0
- package/src/components/LockedAttachmentCard/index.tsx +378 -0
- package/src/components/LockedAttachmentCard/mimeType.test.ts +97 -0
- package/src/components/LockedAttachmentCard/mimeType.ts +35 -0
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/index.ts +4 -0
- package/src/stream-custom-data.ts +10 -3
- package/src/types.ts +41 -0
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx 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 t, jsxs as i, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
+
import F from "classnames";
|
|
3
|
+
import L, { createContext as Nt, useContext as Ct, useCallback as U, useState as k, useRef as W, useEffect as V, useMemo as ze, lazy as ae, Suspense as _t } from "react";
|
|
4
|
+
import { StreamChatService as Et } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as It, ChannelList as St, DateSeparator as kt, useChannelStateContext as Te, useChatContext as rt, areMessageUIPropsEqual as Mt, useMessageReminder as Pt, useComponentContext as Tt, Attachment as Rt, EditMessageModal as Dt, MessageBlocked as At, MessageBouncePrompt as Lt, MessageDeleted as Ot, MessageIsThreadReplyInChannelButtonIndicator as Ut, MessageRepliesCountButton as Ft, ReminderNotification as $t, StreamedMessageText as zt, messageHasAttachments as jt, messageHasReactions as Bt, isDateSeparatorMessage as Ht, isMessageBlocked as Gt, isMessageBounced as Vt, MessageBounceModal as Yt, MessageText as qe, Poll as Wt, MessageErrorIcon as qt, useMessageContext as lt, useMessageComposer as Xt, useStateStore as Zt, MessageInput as Kt, useMessageInputContext as Jt, useMessageComposerHasSendableData as Qt, SimpleAttachmentSelector as es, QuotedMessagePreview as ts, AttachmentPreviewList as ss, TextareaComposer as ns, MessageTimestamp as Ue, Channel as as, WithComponents as rs, Window as ls, MessageList as os } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as je, GiftIcon as is, XIcon as Ve, SpinnerGapIcon as ke, SignOutIcon as cs, ProhibitInsetIcon as Xe, FlagIcon as ds, LockSimpleOpenIcon as us, LockSimpleIcon as ms, CheckCircleIcon as hs, DownloadSimpleIcon as fs, FileIcon as ot, ImageIcon as gs, SpeakerHighIcon as bs, VideoCameraIcon as xs, FileMdIcon as ys, FileTextIcon as ps, FileZipIcon as vs, FilePptIcon as ws, FileCsvIcon as Ns, FileXlsIcon as Cs, FileDocIcon as _s, FilePdfIcon as Es, CircleNotchIcon as Is, PauseIcon as Ss, PlayIcon as ks, ArrowUpIcon as Ms, SparkleIcon as Ps, ProhibitIcon as Ts, ArrowLeftIcon as Ze, DotsThreeIcon as Ke, MagnifyingGlassIcon as Rs, ChatCircleDotsIcon as Je } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as Qe } from "stream-chat";
|
|
8
|
+
const it = Nt({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,104 +15,104 @@ const ze = it({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
19
|
-
children:
|
|
18
|
+
}), Re = () => Ct(it), ta = ({
|
|
19
|
+
children: e,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
22
|
+
apiKey: r,
|
|
23
23
|
capabilities: l = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: c = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const a =
|
|
27
|
-
(
|
|
28
|
-
|
|
26
|
+
const a = U(
|
|
27
|
+
(h, ...g) => {
|
|
28
|
+
c && console.log(`🔥 [MessagingProvider] ${h}`, ...g);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[c]
|
|
31
31
|
);
|
|
32
32
|
a("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (
|
|
34
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [
|
|
38
|
+
const [d, b] = k(null), [f, x] = k(null), [m, y] = k(!1), [u, _] = k(!1), [o, N] = k(null), P = W(!1), C = W({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey:
|
|
40
|
+
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
43
|
+
}), S = W(0);
|
|
44
|
+
S.current++, a("📊 RENDER INFO", {
|
|
45
|
+
renderCount: S.current,
|
|
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: C.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: C.current.apiKey !== r,
|
|
50
|
+
serviceConfigChanged: C.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: C.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), C.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey:
|
|
55
|
+
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const
|
|
58
|
+
}, V(() => {
|
|
59
|
+
const h = S.current;
|
|
60
60
|
if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
-
renderCount:
|
|
62
|
-
apiKey: !!
|
|
61
|
+
renderCount: h,
|
|
62
|
+
apiKey: !!r,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
|
-
apiKey: (
|
|
65
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: C.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: C.current.apiKey === r
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
70
|
+
}), !r || !n) {
|
|
71
71
|
a("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: h,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
a("🚀 CREATING NEW SERVICE", {
|
|
78
|
-
renderCount:
|
|
79
|
-
apiKey: (
|
|
80
|
-
serviceConfigChanged:
|
|
78
|
+
renderCount: h,
|
|
79
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
|
+
serviceConfigChanged: C.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const g = new Et({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
85
|
-
debug:
|
|
84
|
+
apiKey: r,
|
|
85
|
+
debug: c
|
|
86
86
|
});
|
|
87
|
-
return g
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
return b(g), a("✅ SERVICE SET", {
|
|
88
|
+
renderCount: h,
|
|
89
|
+
serviceInstance: !!g
|
|
90
90
|
}), () => {
|
|
91
91
|
a("🧹 SERVICE CLEANUP", {
|
|
92
|
-
renderCount:
|
|
92
|
+
renderCount: h,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), g.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
96
|
+
}, [r, n, c, a]);
|
|
97
|
+
const M = W(null);
|
|
98
|
+
V(() => {
|
|
99
|
+
var g, I;
|
|
100
100
|
if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
|
-
hasService: !!
|
|
101
|
+
hasService: !!d,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
106
|
-
dependencies: { service: !!
|
|
107
|
-
}), !
|
|
104
|
+
isConnecting: P.current,
|
|
105
|
+
isConnected: m,
|
|
106
|
+
dependencies: { service: !!d, userId: s == null ? void 0 : s.id }
|
|
107
|
+
}), !d || !s) {
|
|
108
108
|
a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (P.current) {
|
|
112
112
|
a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((g = M.current) == null ? void 0 : g.serviceId) === d && ((I = M.current) == null ? void 0 : I.userId) === s.id) {
|
|
116
116
|
a(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,152 +120,152 @@ const ze = it({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
a("🚀 STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
a("🚀 STARTING USER CONNECTION", { userId: s.id }), P.current = !0, _(!0), N(null);
|
|
124
124
|
try {
|
|
125
125
|
a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const v = await d.connectUser(s);
|
|
127
|
+
x(v), y(!0), M.current = { serviceId: d, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: v.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (v) {
|
|
132
|
+
const w = v instanceof Error ? v.message : "Connection failed";
|
|
133
|
+
N(w), a("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: w
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
_(!1), P.current = !1, a("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: m
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [
|
|
145
|
-
hasService: !!
|
|
146
|
-
isConnected:
|
|
144
|
+
}, [d, s, a, m]), V(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
|
+
hasService: !!d,
|
|
146
|
+
isConnected: m
|
|
147
147
|
}), () => {
|
|
148
|
-
|
|
148
|
+
d && m ? (a(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
152
|
-
hasService: !!
|
|
153
|
-
isConnected:
|
|
151
|
+
), M.current = null, d.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
|
+
hasService: !!d,
|
|
153
|
+
isConnected: m
|
|
154
154
|
});
|
|
155
|
-
}), [
|
|
156
|
-
const
|
|
155
|
+
}), [d, m, a]);
|
|
156
|
+
const R = U(async () => {
|
|
157
157
|
if (a("🔄 REFRESH CONNECTION CALLED", {
|
|
158
|
-
hasService: !!
|
|
158
|
+
hasService: !!d,
|
|
159
159
|
hasUser: !!s
|
|
160
|
-
}), !
|
|
160
|
+
}), !d || !s) {
|
|
161
161
|
a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), _(!0);
|
|
165
165
|
try {
|
|
166
|
-
a("🔌 DISCONNECTING FOR REFRESH"), await
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
} catch (
|
|
170
|
-
const
|
|
171
|
-
|
|
166
|
+
a("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
|
|
167
|
+
const h = await d.connectUser(s);
|
|
168
|
+
x(h), y(!0), N(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (h) {
|
|
170
|
+
const g = h instanceof Error ? h.message : "Refresh failed";
|
|
171
|
+
N(g), a("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: g
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
_(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [
|
|
179
|
-
hasService: !!
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
182
|
-
isLoading:
|
|
183
|
-
hasError: !!
|
|
178
|
+
}, [d, s, a]), p = L.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
|
+
hasService: !!d,
|
|
180
|
+
hasClient: !!f,
|
|
181
|
+
isConnected: m,
|
|
182
|
+
isLoading: u,
|
|
183
|
+
hasError: !!o,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
|
-
service:
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
189
|
-
isLoading:
|
|
190
|
-
error:
|
|
186
|
+
service: d,
|
|
187
|
+
client: f,
|
|
188
|
+
isConnected: m,
|
|
189
|
+
isLoading: u,
|
|
190
|
+
error: o,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
193
|
-
debug:
|
|
192
|
+
refreshConnection: R,
|
|
193
|
+
debug: c
|
|
194
194
|
}), [
|
|
195
|
-
c,
|
|
196
|
-
h,
|
|
197
|
-
x,
|
|
198
|
-
r,
|
|
199
|
-
_,
|
|
200
|
-
l,
|
|
201
|
-
L,
|
|
202
195
|
d,
|
|
196
|
+
f,
|
|
197
|
+
m,
|
|
198
|
+
u,
|
|
199
|
+
o,
|
|
200
|
+
l,
|
|
201
|
+
R,
|
|
202
|
+
c,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
205
205
|
return a("🔄 RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
-
|
|
206
|
+
renderCount: S.current,
|
|
207
|
+
willRenderChat: !!(f && m),
|
|
208
|
+
contextValueReady: !!p
|
|
209
|
+
}), /* @__PURE__ */ t(it.Provider, { value: p, children: f && m ? /* @__PURE__ */ t(
|
|
210
|
+
It,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: f,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
|
-
children:
|
|
216
|
+
children: e
|
|
217
217
|
}
|
|
218
|
-
) :
|
|
219
|
-
},
|
|
218
|
+
) : e });
|
|
219
|
+
}, Ds = () => Re(), ct = L.createContext({
|
|
220
220
|
selectedChannel: void 0,
|
|
221
221
|
onChannelSelect: () => {
|
|
222
222
|
},
|
|
223
223
|
debug: !1,
|
|
224
224
|
renderMessagePreview: void 0
|
|
225
|
-
}),
|
|
226
|
-
var
|
|
227
|
-
const [s, n] =
|
|
228
|
-
!!((l = (
|
|
225
|
+
}), As = ct.Provider, Ls = () => L.useContext(ct), dt = (e) => {
|
|
226
|
+
var r, l;
|
|
227
|
+
const [s, n] = k(
|
|
228
|
+
!!((l = (r = e == null ? void 0 : e.state) == null ? void 0 : r.membership) != null && l.pinned_at)
|
|
229
229
|
);
|
|
230
|
-
return
|
|
230
|
+
return V(() => {
|
|
231
231
|
var a;
|
|
232
|
-
if (!
|
|
232
|
+
if (!e) {
|
|
233
233
|
n(!1);
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
n(!!((a =
|
|
237
|
-
const
|
|
238
|
-
var
|
|
236
|
+
n(!!((a = e.state.membership) != null && a.pinned_at));
|
|
237
|
+
const c = (d) => {
|
|
238
|
+
var b;
|
|
239
239
|
n(
|
|
240
|
-
|
|
240
|
+
d != null && d.member ? !!d.member.pinned_at : !!((b = e.state.membership) != null && b.pinned_at)
|
|
241
241
|
);
|
|
242
242
|
};
|
|
243
|
-
return
|
|
244
|
-
|
|
243
|
+
return e.on("member.updated", c), () => {
|
|
244
|
+
e.off("member.updated", c);
|
|
245
245
|
};
|
|
246
|
-
}, [
|
|
247
|
-
},
|
|
246
|
+
}, [e]), s;
|
|
247
|
+
}, Os = (e, s) => {
|
|
248
248
|
const n = new Date(
|
|
249
|
-
Date.UTC(
|
|
249
|
+
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
250
250
|
), l = new Date(
|
|
251
251
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
252
252
|
).getTime() - n.getTime();
|
|
253
253
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
254
|
-
},
|
|
254
|
+
}, Us = (e) => {
|
|
255
255
|
const s = /* @__PURE__ */ new Date();
|
|
256
|
-
if (Math.floor((s.getTime() -
|
|
256
|
+
if (Math.floor((s.getTime() - e.getTime()) / 1e3) < 60)
|
|
257
257
|
return "Just now";
|
|
258
|
-
const
|
|
259
|
-
return
|
|
258
|
+
const r = Os(e, s);
|
|
259
|
+
return r === 0 ? e.toLocaleTimeString([], {
|
|
260
260
|
hour: "numeric",
|
|
261
261
|
minute: "2-digit",
|
|
262
262
|
hour12: !0
|
|
263
|
-
}) :
|
|
263
|
+
}) : r === 1 ? "Yesterday" : r < 7 ? `${r}d` : r < 28 ? `${Math.floor(r / 7)}w` : e.toLocaleDateString("en-US", {
|
|
264
264
|
month: "numeric",
|
|
265
265
|
day: "numeric",
|
|
266
266
|
year: "2-digit"
|
|
267
267
|
});
|
|
268
|
-
},
|
|
268
|
+
}, et = [
|
|
269
269
|
"🍎",
|
|
270
270
|
// Apple
|
|
271
271
|
"🍌",
|
|
@@ -293,61 +293,61 @@ const ze = it({
|
|
|
293
293
|
"🍈"
|
|
294
294
|
// Melon
|
|
295
295
|
];
|
|
296
|
-
function
|
|
296
|
+
function Fs(e) {
|
|
297
297
|
let s = 0;
|
|
298
|
-
for (let n = 0; n <
|
|
299
|
-
const
|
|
300
|
-
s = (s << 5) - s +
|
|
298
|
+
for (let n = 0; n < e.length; n++) {
|
|
299
|
+
const r = e.charCodeAt(n);
|
|
300
|
+
s = (s << 5) - s + r, s = s & s;
|
|
301
301
|
}
|
|
302
302
|
return Math.abs(s);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
const n =
|
|
306
|
-
return
|
|
304
|
+
function $s(e) {
|
|
305
|
+
const n = Fs(e) % et.length;
|
|
306
|
+
return et[n];
|
|
307
307
|
}
|
|
308
|
-
const
|
|
309
|
-
id:
|
|
308
|
+
const me = ({
|
|
309
|
+
id: e,
|
|
310
310
|
image: s,
|
|
311
311
|
size: n = 40,
|
|
312
|
-
className:
|
|
312
|
+
className: r,
|
|
313
313
|
starred: l = !1,
|
|
314
|
-
shape:
|
|
314
|
+
shape: c = "squircle"
|
|
315
315
|
}) => {
|
|
316
|
-
const a =
|
|
316
|
+
const a = $s(e), b = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", f = c === "circle" ? { borderRadius: "50%" } : {
|
|
317
317
|
borderRadius: "33%",
|
|
318
318
|
"corner-shape": "superellipse(1.3)"
|
|
319
319
|
};
|
|
320
320
|
return /* @__PURE__ */ i(
|
|
321
321
|
"div",
|
|
322
322
|
{
|
|
323
|
-
className:
|
|
323
|
+
className: F("relative flex-shrink-0", r),
|
|
324
324
|
style: {
|
|
325
325
|
width: `${n}px`,
|
|
326
326
|
height: `${n}px`
|
|
327
327
|
},
|
|
328
328
|
children: [
|
|
329
|
-
l && /* @__PURE__ */
|
|
329
|
+
l && /* @__PURE__ */ t(
|
|
330
330
|
"div",
|
|
331
331
|
{
|
|
332
332
|
"aria-hidden": "true",
|
|
333
333
|
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)]",
|
|
334
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ t(je, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
335
335
|
}
|
|
336
336
|
),
|
|
337
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ t("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ t(
|
|
338
338
|
"img",
|
|
339
339
|
{
|
|
340
340
|
src: s,
|
|
341
341
|
alt: "",
|
|
342
342
|
className: "aspect-square h-full w-full object-cover"
|
|
343
343
|
}
|
|
344
|
-
) : /* @__PURE__ */
|
|
344
|
+
) : /* @__PURE__ */ t(
|
|
345
345
|
"div",
|
|
346
346
|
{
|
|
347
347
|
"aria-hidden": "true",
|
|
348
|
-
className:
|
|
348
|
+
className: F(
|
|
349
349
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
350
|
-
|
|
350
|
+
b
|
|
351
351
|
),
|
|
352
352
|
children: a
|
|
353
353
|
}
|
|
@@ -355,15 +355,15 @@ const se = ({
|
|
|
355
355
|
]
|
|
356
356
|
}
|
|
357
357
|
);
|
|
358
|
-
},
|
|
358
|
+
}, zs = ({ size: e = 15 }) => /* @__PURE__ */ t(
|
|
359
359
|
"svg",
|
|
360
360
|
{
|
|
361
|
-
width:
|
|
362
|
-
height:
|
|
361
|
+
width: e,
|
|
362
|
+
height: e,
|
|
363
363
|
viewBox: "0 0 15 15",
|
|
364
364
|
fill: "none",
|
|
365
365
|
"aria-hidden": "true",
|
|
366
|
-
children: /* @__PURE__ */
|
|
366
|
+
children: /* @__PURE__ */ t(
|
|
367
367
|
"path",
|
|
368
368
|
{
|
|
369
369
|
d: "M12.003 9a.985.985 0 0 1-.652.934l-3.223 1.191-1.188 3.226a.995.995 0 0 1-1.867 0l-1.195-3.226L.65 9.937a.995.995 0 0 1 0-1.867l3.227-1.195 1.187-3.226a.995.995 0 0 1 1.868 0l1.195 3.226 3.226 1.187a.99.99 0 0 1 .649.938m3-5.83a.52.52 0 0 1-.344.492l-1.702.63-.627 1.703a.525.525 0 0 1-.986 0l-.63-1.704-1.704-.627a.525.525 0 0 1 0-.986l1.703-.63.627-1.704a.526.526 0 0 1 .986 0l.631 1.703 1.704.627a.52.52 0 0 1 .342.495",
|
|
@@ -372,90 +372,93 @@ const se = ({
|
|
|
372
372
|
}
|
|
373
373
|
)
|
|
374
374
|
}
|
|
375
|
-
),
|
|
375
|
+
), js = (e) => {
|
|
376
|
+
var s;
|
|
377
|
+
return ((s = e.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
378
|
+
}, Bs = (e) => {
|
|
376
379
|
var s;
|
|
377
|
-
return ((s =
|
|
378
|
-
},
|
|
380
|
+
return ((s = e.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
381
|
+
}, Ye = (e) => {
|
|
379
382
|
var s;
|
|
380
|
-
return ((s =
|
|
381
|
-
},
|
|
383
|
+
return ((s = e.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
384
|
+
}, Hs = (e) => {
|
|
382
385
|
var s;
|
|
383
|
-
return ((s =
|
|
384
|
-
},
|
|
386
|
+
return ((s = e.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
387
|
+
}, ut = (e) => js(e) || Bs(e), Gs = (e) => {
|
|
385
388
|
var s;
|
|
386
|
-
return
|
|
387
|
-
},
|
|
388
|
-
message:
|
|
389
|
+
return ut(e) && !((s = e.text) != null && s.trim());
|
|
390
|
+
}, Fe = ({
|
|
391
|
+
message: e,
|
|
389
392
|
standalone: s = !1,
|
|
390
393
|
isMyMessage: n = !1,
|
|
391
|
-
hasAttachment:
|
|
394
|
+
hasAttachment: r = !1
|
|
392
395
|
}) => {
|
|
393
|
-
var
|
|
394
|
-
const l =
|
|
395
|
-
if (!l && !
|
|
396
|
+
var m;
|
|
397
|
+
const l = ut(e), c = Ye(e);
|
|
398
|
+
if (!l && !c)
|
|
396
399
|
return null;
|
|
397
400
|
if (l) {
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
400
|
-
const
|
|
401
|
-
return /* @__PURE__ */ i("div", { className:
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
/* @__PURE__ */
|
|
401
|
+
const y = (m = e.metadata) == null ? void 0 : m.amount_text;
|
|
402
|
+
if (!y) return null;
|
|
403
|
+
const u = s ? "message-tip-standalone" : "message-tag message-tag--tip", _ = s ? `${y} tip` : `Delivered with ${y} tip`;
|
|
404
|
+
return /* @__PURE__ */ i("div", { className: u, children: [
|
|
405
|
+
/* @__PURE__ */ t(is, { size: s ? 14 : 12 }),
|
|
406
|
+
/* @__PURE__ */ t("span", { children: _ })
|
|
404
407
|
] });
|
|
405
408
|
}
|
|
406
|
-
const a = n &&
|
|
409
|
+
const a = n && r, d = a ? "Sent with AI" : "Sent with DM Agent", b = [
|
|
407
410
|
"message-chatbot-indicator",
|
|
408
411
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
409
412
|
a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
410
|
-
].join(" "),
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
] }) : /* @__PURE__ */ i(
|
|
415
|
-
|
|
416
|
-
|
|
413
|
+
].join(" "), f = /* @__PURE__ */ t("span", { className: "message-chatbot-indicator__label", children: d }), x = /* @__PURE__ */ t("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ t(zs, { size: a ? 12 : 15 }) });
|
|
414
|
+
return /* @__PURE__ */ t("div", { className: b, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(oe, { children: [
|
|
415
|
+
f,
|
|
416
|
+
x
|
|
417
|
+
] }) : /* @__PURE__ */ i(oe, { children: [
|
|
418
|
+
x,
|
|
419
|
+
f
|
|
417
420
|
] }) });
|
|
418
|
-
},
|
|
419
|
-
({ channel:
|
|
420
|
-
var
|
|
421
|
-
const { selectedChannel: n, onChannelSelect:
|
|
422
|
-
|
|
423
|
-
},
|
|
424
|
-
const
|
|
425
|
-
!
|
|
426
|
-
},
|
|
427
|
-
(
|
|
428
|
-
var
|
|
429
|
-
return ((
|
|
421
|
+
}, mt = L.memo(
|
|
422
|
+
({ channel: e, unread: s }) => {
|
|
423
|
+
var R, p, h, g;
|
|
424
|
+
const { selectedChannel: n, onChannelSelect: r, debug: l, renderMessagePreview: c } = Ls(), a = (n == null ? void 0 : n.id) === (e == null ? void 0 : e.id), d = () => {
|
|
425
|
+
e && r(e);
|
|
426
|
+
}, b = (I) => {
|
|
427
|
+
const v = I.key === "Enter" || I.key === " ", w = I.repeat;
|
|
428
|
+
!v || w || (I.preventDefault(), d());
|
|
429
|
+
}, x = Object.values(((R = e == null ? void 0 : e.state) == null ? void 0 : R.members) || {}).find(
|
|
430
|
+
(I) => {
|
|
431
|
+
var v, w;
|
|
432
|
+
return ((v = I.user) == null ? void 0 : v.id) && I.user.id !== ((w = e == null ? void 0 : e._client) == null ? void 0 : w.userID);
|
|
430
433
|
}
|
|
431
|
-
),
|
|
432
|
-
var
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
for (let
|
|
436
|
-
if (
|
|
434
|
+
), m = ((p = x == null ? void 0 : x.user) == null ? void 0 : p.name) || "Conversation", y = (h = x == null ? void 0 : x.user) == null ? void 0 : h.image, u = (() => {
|
|
435
|
+
var v;
|
|
436
|
+
const I = (v = e == null ? void 0 : e.state) == null ? void 0 : v.messages;
|
|
437
|
+
if (I != null && I.length) {
|
|
438
|
+
for (let w = I.length - 1; w >= 0; w--)
|
|
439
|
+
if (I[w].type !== "system") return I[w];
|
|
437
440
|
}
|
|
438
|
-
})(),
|
|
439
|
-
var
|
|
440
|
-
if (
|
|
441
|
-
if (((
|
|
442
|
-
const
|
|
443
|
-
return
|
|
444
|
-
})(),
|
|
441
|
+
})(), o = (() => {
|
|
442
|
+
var w, A;
|
|
443
|
+
if (u != null && u.text) return u.text;
|
|
444
|
+
if (((w = u == null ? void 0 : u.metadata) == null ? void 0 : w.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
445
|
+
const v = (A = u == null ? void 0 : u.attachments) == null ? void 0 : A[0];
|
|
446
|
+
return v ? v.og_scrape_url ? v.og_scrape_url : v.type === "image" ? "📷 Sent an image" : v.type === "video" ? "🎥 Sent a video" : v.type === "audio" ? "🎵 Sent audio" : v.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
447
|
+
})(), N = u != null && u.created_at ? Us(new Date(u.created_at)) : "", P = u ? Ye(u) : !1, C = c ? c(u, o) : `${P ? "✨ " : ""}${o}`, S = dt(e), M = s ?? 0;
|
|
445
448
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
446
|
-
channelId:
|
|
449
|
+
channelId: e == null ? void 0 : e.id,
|
|
447
450
|
isSelected: a,
|
|
448
|
-
participantName:
|
|
449
|
-
unreadCount:
|
|
450
|
-
hasTimestamp: !!
|
|
451
|
-
}), /* @__PURE__ */
|
|
451
|
+
participantName: m,
|
|
452
|
+
unreadCount: M,
|
|
453
|
+
hasTimestamp: !!N
|
|
454
|
+
}), /* @__PURE__ */ t(
|
|
452
455
|
"div",
|
|
453
456
|
{
|
|
454
457
|
role: "button",
|
|
455
458
|
tabIndex: 0,
|
|
456
|
-
onClick:
|
|
457
|
-
onKeyDown:
|
|
458
|
-
className:
|
|
459
|
+
onClick: d,
|
|
460
|
+
onKeyDown: b,
|
|
461
|
+
className: F(
|
|
459
462
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
460
463
|
{
|
|
461
464
|
"bg-primary-alt/10 border-l-4 border-l-primary": a,
|
|
@@ -463,14 +466,14 @@ const se = ({
|
|
|
463
466
|
}
|
|
464
467
|
),
|
|
465
468
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
|
|
469
|
+
/* @__PURE__ */ t(
|
|
470
|
+
me,
|
|
468
471
|
{
|
|
469
|
-
id: ((
|
|
470
|
-
name:
|
|
471
|
-
image:
|
|
472
|
+
id: ((g = x == null ? void 0 : x.user) == null ? void 0 : g.id) || e.id || "unknown",
|
|
473
|
+
name: m,
|
|
474
|
+
image: y,
|
|
472
475
|
size: 44,
|
|
473
|
-
starred:
|
|
476
|
+
starred: S,
|
|
474
477
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
475
478
|
}
|
|
476
479
|
),
|
|
@@ -479,21 +482,21 @@ const se = ({
|
|
|
479
482
|
/* @__PURE__ */ i(
|
|
480
483
|
"h3",
|
|
481
484
|
{
|
|
482
|
-
className:
|
|
485
|
+
className: F(
|
|
483
486
|
"text-sm font-medium truncate",
|
|
484
487
|
a ? "text-primary" : "text-charcoal"
|
|
485
488
|
),
|
|
486
489
|
children: [
|
|
487
|
-
|
|
488
|
-
|
|
490
|
+
S && /* @__PURE__ */ t("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
491
|
+
m
|
|
489
492
|
]
|
|
490
493
|
}
|
|
491
494
|
),
|
|
492
|
-
|
|
495
|
+
N && /* @__PURE__ */ t("span", { className: "text-xs text-stone flex-shrink-0", children: N })
|
|
493
496
|
] }),
|
|
494
497
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
|
|
498
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: C }),
|
|
499
|
+
M > 0 && /* @__PURE__ */ t("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: M > 99 ? "99+" : M })
|
|
497
500
|
] })
|
|
498
501
|
] })
|
|
499
502
|
] })
|
|
@@ -501,225 +504,227 @@ const se = ({
|
|
|
501
504
|
);
|
|
502
505
|
}
|
|
503
506
|
);
|
|
504
|
-
|
|
505
|
-
const
|
|
507
|
+
mt.displayName = "CustomChannelPreview";
|
|
508
|
+
const Vs = { last_message_at: -1 }, ht = L.memo(
|
|
506
509
|
({
|
|
507
|
-
onChannelSelect:
|
|
510
|
+
onChannelSelect: e,
|
|
508
511
|
selectedChannel: s,
|
|
509
512
|
filters: n,
|
|
510
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
513
|
+
allowNewMessagesFromUnfilteredChannels: r = !1,
|
|
511
514
|
onMessageNew: l,
|
|
512
|
-
onAddedToChannel:
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
onAddedToChannel: c,
|
|
516
|
+
channelRenderFilterFn: a,
|
|
517
|
+
sort: d = Vs,
|
|
518
|
+
className: b,
|
|
519
|
+
customEmptyStateIndicator: f,
|
|
520
|
+
renderMessagePreview: x
|
|
517
521
|
}) => {
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
const { debug:
|
|
521
|
-
|
|
522
|
-
renderCount:
|
|
522
|
+
const m = L.useRef(0);
|
|
523
|
+
m.current++;
|
|
524
|
+
const { debug: y = !1 } = Re();
|
|
525
|
+
y && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
526
|
+
renderCount: m.current,
|
|
523
527
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
524
528
|
filters: n
|
|
525
529
|
});
|
|
526
|
-
const
|
|
530
|
+
const u = L.useMemo(
|
|
527
531
|
() => ({
|
|
528
532
|
selectedChannel: s,
|
|
529
|
-
onChannelSelect:
|
|
530
|
-
debug:
|
|
531
|
-
renderMessagePreview:
|
|
533
|
+
onChannelSelect: e,
|
|
534
|
+
debug: y,
|
|
535
|
+
renderMessagePreview: x
|
|
532
536
|
}),
|
|
533
|
-
[s,
|
|
537
|
+
[s, e, y, x]
|
|
534
538
|
);
|
|
535
|
-
return /* @__PURE__ */
|
|
539
|
+
return /* @__PURE__ */ t(
|
|
536
540
|
"div",
|
|
537
541
|
{
|
|
538
|
-
className:
|
|
542
|
+
className: F(
|
|
539
543
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
540
|
-
|
|
544
|
+
b
|
|
541
545
|
),
|
|
542
|
-
children: /* @__PURE__ */
|
|
543
|
-
|
|
546
|
+
children: /* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ t(As, { value: u, children: /* @__PURE__ */ t(
|
|
547
|
+
St,
|
|
544
548
|
{
|
|
545
549
|
filters: n,
|
|
546
|
-
sort:
|
|
550
|
+
sort: d,
|
|
547
551
|
options: { limit: 30 },
|
|
548
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
552
|
+
allowNewMessagesFromUnfilteredChannels: r,
|
|
549
553
|
onMessageNew: l,
|
|
550
|
-
onAddedToChannel:
|
|
551
|
-
|
|
552
|
-
|
|
554
|
+
onAddedToChannel: c,
|
|
555
|
+
channelRenderFilterFn: a,
|
|
556
|
+
Preview: mt,
|
|
557
|
+
EmptyStateIndicator: f
|
|
553
558
|
},
|
|
554
|
-
`${JSON.stringify(n)}:${JSON.stringify(
|
|
559
|
+
`${JSON.stringify(n)}:${JSON.stringify(d)}`
|
|
555
560
|
) }) })
|
|
556
561
|
}
|
|
557
562
|
);
|
|
558
563
|
}
|
|
559
564
|
);
|
|
560
|
-
|
|
561
|
-
const
|
|
562
|
-
variant:
|
|
565
|
+
ht.displayName = "ChannelList";
|
|
566
|
+
const Se = ({
|
|
567
|
+
variant: e = "default",
|
|
563
568
|
className: s,
|
|
564
569
|
children: n,
|
|
565
|
-
...
|
|
566
|
-
}) => /* @__PURE__ */
|
|
570
|
+
...r
|
|
571
|
+
}) => /* @__PURE__ */ t(
|
|
567
572
|
"button",
|
|
568
573
|
{
|
|
569
574
|
type: "button",
|
|
570
|
-
className:
|
|
575
|
+
className: F(
|
|
571
576
|
"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",
|
|
572
|
-
|
|
577
|
+
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
573
578
|
s
|
|
574
579
|
),
|
|
575
|
-
...
|
|
580
|
+
...r,
|
|
576
581
|
children: n
|
|
577
582
|
}
|
|
578
583
|
);
|
|
579
|
-
function
|
|
584
|
+
function ft({ label: e, className: s, children: n, ...r }) {
|
|
580
585
|
return /* @__PURE__ */ i(
|
|
581
586
|
"button",
|
|
582
587
|
{
|
|
583
588
|
type: "button",
|
|
584
|
-
className:
|
|
589
|
+
className: F(
|
|
585
590
|
"rounded-full p-2 transition-colors focus-ring",
|
|
586
591
|
{
|
|
587
|
-
"cursor-not-allowed opacity-50":
|
|
588
|
-
"hover:bg-sand": !
|
|
592
|
+
"cursor-not-allowed opacity-50": r.disabled,
|
|
593
|
+
"hover:bg-sand": !r.disabled
|
|
589
594
|
},
|
|
590
595
|
s
|
|
591
596
|
),
|
|
592
|
-
...
|
|
597
|
+
...r,
|
|
593
598
|
children: [
|
|
594
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: e }),
|
|
595
600
|
n
|
|
596
601
|
]
|
|
597
602
|
}
|
|
598
603
|
);
|
|
599
604
|
}
|
|
600
|
-
function
|
|
601
|
-
return /* @__PURE__ */
|
|
605
|
+
function gt({ onClick: e }) {
|
|
606
|
+
return /* @__PURE__ */ t(ft, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ t(Ve, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
602
607
|
}
|
|
603
|
-
const
|
|
604
|
-
dialogRef:
|
|
608
|
+
const Ys = ({
|
|
609
|
+
dialogRef: e,
|
|
605
610
|
onClose: s,
|
|
606
611
|
participant: n,
|
|
607
|
-
channel:
|
|
612
|
+
channel: r,
|
|
608
613
|
followerStatusLabel: l,
|
|
609
|
-
onLeaveConversation:
|
|
614
|
+
onLeaveConversation: c,
|
|
610
615
|
onBlockParticipant: a,
|
|
611
|
-
showDeleteConversation:
|
|
612
|
-
onDeleteConversationClick:
|
|
613
|
-
onBlockParticipantClick:
|
|
614
|
-
onReportParticipantClick:
|
|
615
|
-
customProfileContent:
|
|
616
|
-
customChannelActions:
|
|
616
|
+
showDeleteConversation: d = !0,
|
|
617
|
+
onDeleteConversationClick: b,
|
|
618
|
+
onBlockParticipantClick: f,
|
|
619
|
+
onReportParticipantClick: x,
|
|
620
|
+
customProfileContent: m,
|
|
621
|
+
customChannelActions: y
|
|
617
622
|
}) => {
|
|
618
|
-
var
|
|
619
|
-
const { service:
|
|
620
|
-
var
|
|
621
|
-
if (!(!
|
|
623
|
+
var D, z, Y, ie, E, O, q;
|
|
624
|
+
const { service: u, debug: _ } = Re(), [o, N] = k(!1), [P, C] = k(!1), [S, M] = k(!1), R = U(async () => {
|
|
625
|
+
var j;
|
|
626
|
+
if (!(!u || !((j = n == null ? void 0 : n.user) != null && j.id)))
|
|
622
627
|
try {
|
|
623
|
-
const
|
|
624
|
-
(
|
|
625
|
-
var
|
|
626
|
-
return
|
|
628
|
+
const ee = (await u.getBlockedUsers()).some(
|
|
629
|
+
(re) => {
|
|
630
|
+
var K;
|
|
631
|
+
return re.blocked_user_id === ((K = n == null ? void 0 : n.user) == null ? void 0 : K.id);
|
|
627
632
|
}
|
|
628
633
|
);
|
|
629
|
-
|
|
630
|
-
} catch (
|
|
634
|
+
N(ee);
|
|
635
|
+
} catch (B) {
|
|
631
636
|
console.error(
|
|
632
637
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
633
|
-
|
|
638
|
+
B
|
|
634
639
|
);
|
|
635
640
|
}
|
|
636
|
-
}, [
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}, [
|
|
640
|
-
const
|
|
641
|
-
var
|
|
642
|
-
if (!
|
|
643
|
-
|
|
641
|
+
}, [u, (D = n == null ? void 0 : n.user) == null ? void 0 : D.id]);
|
|
642
|
+
V(() => {
|
|
643
|
+
R();
|
|
644
|
+
}, [R]);
|
|
645
|
+
const p = async () => {
|
|
646
|
+
var j;
|
|
647
|
+
if (!P) {
|
|
648
|
+
b == null || b(), _ && console.log("[ChannelInfoDialog] Leave conversation", r.cid), C(!0);
|
|
644
649
|
try {
|
|
645
|
-
const
|
|
646
|
-
await
|
|
647
|
-
} catch (
|
|
648
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
650
|
+
const B = ((j = r._client) == null ? void 0 : j.userID) ?? null;
|
|
651
|
+
await r.hide(B, !1), c && await c(r), s();
|
|
652
|
+
} catch (B) {
|
|
653
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", B);
|
|
649
654
|
} finally {
|
|
650
|
-
|
|
655
|
+
C(!1);
|
|
651
656
|
}
|
|
652
657
|
}
|
|
653
|
-
},
|
|
654
|
-
var
|
|
655
|
-
if (!(
|
|
656
|
-
|
|
658
|
+
}, h = async () => {
|
|
659
|
+
var j, B, ee;
|
|
660
|
+
if (!(S || !u)) {
|
|
661
|
+
f == null || f(), _ && console.log("[ChannelInfoDialog] Block member", (j = n == null ? void 0 : n.user) == null ? void 0 : j.id), M(!0);
|
|
657
662
|
try {
|
|
658
|
-
await
|
|
659
|
-
} catch (
|
|
660
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
663
|
+
await u.blockUser((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), a && await a((ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id), s();
|
|
664
|
+
} catch (re) {
|
|
665
|
+
console.error("[ChannelInfoDialog] Failed to block member", re);
|
|
661
666
|
} finally {
|
|
662
|
-
|
|
667
|
+
M(!1);
|
|
663
668
|
}
|
|
664
669
|
}
|
|
665
|
-
},
|
|
666
|
-
var
|
|
667
|
-
if (!(
|
|
668
|
-
|
|
670
|
+
}, g = async () => {
|
|
671
|
+
var j, B, ee;
|
|
672
|
+
if (!(S || !u)) {
|
|
673
|
+
f == null || f(), _ && console.log("[ChannelInfoDialog] Unblock member", (j = n == null ? void 0 : n.user) == null ? void 0 : j.id), M(!0);
|
|
669
674
|
try {
|
|
670
|
-
await
|
|
671
|
-
} catch (
|
|
672
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
675
|
+
await u.unBlockUser((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), a && await a((ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id), s();
|
|
676
|
+
} catch (re) {
|
|
677
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", re);
|
|
673
678
|
} finally {
|
|
674
|
-
|
|
679
|
+
M(!1);
|
|
675
680
|
}
|
|
676
681
|
}
|
|
677
|
-
},
|
|
678
|
-
|
|
682
|
+
}, I = () => {
|
|
683
|
+
x == null || x(), s(), window.open(
|
|
679
684
|
"https://linktr.ee/s/about/trust-center/report",
|
|
680
685
|
"_blank",
|
|
681
686
|
"noopener,noreferrer"
|
|
682
687
|
);
|
|
683
688
|
};
|
|
684
689
|
if (!n) return null;
|
|
685
|
-
const
|
|
690
|
+
const v = ((z = n.user) == null ? void 0 : z.name) || ((Y = n.user) == null ? void 0 : Y.id) || "Unknown member", w = (ie = n.user) == null ? void 0 : ie.image, A = (E = n.user) == null ? void 0 : E.email, G = (O = n.user) == null ? void 0 : O.username, $ = A || (G ? `linktr.ee/${G}` : void 0), Z = ((q = n.user) == null ? void 0 : q.id) || "unknown";
|
|
686
691
|
return (
|
|
687
692
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
688
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ t(
|
|
689
694
|
"dialog",
|
|
690
695
|
{
|
|
691
|
-
ref:
|
|
696
|
+
ref: e,
|
|
692
697
|
className: "mes-dialog group",
|
|
693
698
|
onClose: s,
|
|
694
|
-
onClick: (
|
|
695
|
-
|
|
699
|
+
onClick: (j) => {
|
|
700
|
+
j.target === e.current && s();
|
|
696
701
|
},
|
|
697
702
|
children: /* @__PURE__ */ i("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: [
|
|
698
703
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
699
|
-
/* @__PURE__ */
|
|
700
|
-
/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ t("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
705
|
+
/* @__PURE__ */ t(gt, { onClick: s })
|
|
701
706
|
] }),
|
|
702
707
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
703
|
-
/* @__PURE__ */
|
|
708
|
+
/* @__PURE__ */ t(
|
|
704
709
|
"div",
|
|
705
710
|
{
|
|
706
711
|
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
707
712
|
style: { backgroundColor: "#FBFAF9" },
|
|
708
713
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
|
|
714
|
+
/* @__PURE__ */ t(
|
|
715
|
+
me,
|
|
711
716
|
{
|
|
712
|
-
id:
|
|
713
|
-
name:
|
|
714
|
-
image:
|
|
717
|
+
id: Z,
|
|
718
|
+
name: v,
|
|
719
|
+
image: w,
|
|
715
720
|
size: 88,
|
|
716
721
|
shape: "circle"
|
|
717
722
|
}
|
|
718
723
|
),
|
|
719
724
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
|
|
722
|
-
l && !
|
|
725
|
+
/* @__PURE__ */ t("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
|
|
726
|
+
$ && /* @__PURE__ */ t("p", { className: "truncate text-sm text-[#00000055]", children: $ }),
|
|
727
|
+
l && !m && /* @__PURE__ */ t(
|
|
723
728
|
"span",
|
|
724
729
|
{
|
|
725
730
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -733,90 +738,635 @@ const hs = ({
|
|
|
733
738
|
children: l
|
|
734
739
|
}
|
|
735
740
|
),
|
|
736
|
-
|
|
741
|
+
m
|
|
737
742
|
] })
|
|
738
743
|
] })
|
|
739
744
|
}
|
|
740
745
|
),
|
|
741
746
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
742
|
-
|
|
743
|
-
|
|
747
|
+
d && /* @__PURE__ */ t("li", { children: /* @__PURE__ */ i(
|
|
748
|
+
Se,
|
|
744
749
|
{
|
|
745
|
-
onClick:
|
|
746
|
-
disabled:
|
|
747
|
-
"aria-busy":
|
|
750
|
+
onClick: p,
|
|
751
|
+
disabled: P,
|
|
752
|
+
"aria-busy": P,
|
|
748
753
|
children: [
|
|
749
|
-
|
|
750
|
-
/* @__PURE__ */
|
|
754
|
+
P ? /* @__PURE__ */ t(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ t(cs, { className: "h-5 w-5" }),
|
|
755
|
+
/* @__PURE__ */ t("span", { children: "Delete Conversation" })
|
|
751
756
|
]
|
|
752
757
|
}
|
|
753
758
|
) }),
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
-
|
|
759
|
+
/* @__PURE__ */ t("li", { children: o ? /* @__PURE__ */ i(
|
|
760
|
+
Se,
|
|
756
761
|
{
|
|
757
|
-
onClick:
|
|
758
|
-
disabled:
|
|
759
|
-
"aria-busy":
|
|
762
|
+
onClick: g,
|
|
763
|
+
disabled: S,
|
|
764
|
+
"aria-busy": S,
|
|
760
765
|
children: [
|
|
761
|
-
|
|
762
|
-
/* @__PURE__ */
|
|
766
|
+
S ? /* @__PURE__ */ t(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ t(Xe, { className: "h-5 w-5" }),
|
|
767
|
+
/* @__PURE__ */ t("span", { children: "Unblock" })
|
|
763
768
|
]
|
|
764
769
|
}
|
|
765
770
|
) : /* @__PURE__ */ i(
|
|
766
|
-
|
|
771
|
+
Se,
|
|
767
772
|
{
|
|
768
|
-
onClick:
|
|
769
|
-
disabled:
|
|
770
|
-
"aria-busy":
|
|
773
|
+
onClick: h,
|
|
774
|
+
disabled: S,
|
|
775
|
+
"aria-busy": S,
|
|
771
776
|
children: [
|
|
772
|
-
|
|
773
|
-
/* @__PURE__ */
|
|
777
|
+
S ? /* @__PURE__ */ t(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ t(Xe, { className: "h-5 w-5" }),
|
|
778
|
+
/* @__PURE__ */ t("span", { children: "Block" })
|
|
774
779
|
]
|
|
775
780
|
}
|
|
776
781
|
) }),
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ i(Se, { variant: "danger", onClick: I, children: [
|
|
783
|
+
/* @__PURE__ */ t(ds, { className: "h-5 w-5" }),
|
|
784
|
+
/* @__PURE__ */ t("span", { children: "Report" })
|
|
780
785
|
] }) }),
|
|
781
|
-
|
|
786
|
+
y
|
|
782
787
|
] })
|
|
783
788
|
] })
|
|
784
789
|
] })
|
|
785
790
|
}
|
|
786
791
|
)
|
|
787
792
|
);
|
|
788
|
-
},
|
|
789
|
-
function
|
|
790
|
-
return
|
|
793
|
+
}, Ws = (e) => /* @__PURE__ */ t(kt, { ...e, position: "center" }), Be = "vote_up", He = "vote_down";
|
|
794
|
+
function qs(e) {
|
|
795
|
+
return e != null && e.length ? e.some((s) => s.type === He) ? "down" : e.some((s) => s.type === Be) ? "up" : null : null;
|
|
791
796
|
}
|
|
792
|
-
function
|
|
793
|
-
const { channel: s } = Te(), { client: n } =
|
|
794
|
-
() =>
|
|
795
|
-
[
|
|
796
|
-
), l =
|
|
797
|
+
function Xs(e) {
|
|
798
|
+
const { channel: s } = Te(), { client: n } = rt("useMessageVote"), r = ze(
|
|
799
|
+
() => qs(e.own_reactions),
|
|
800
|
+
[e.own_reactions]
|
|
801
|
+
), l = U(async () => {
|
|
797
802
|
if (n != null && n.userID)
|
|
798
803
|
try {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
{ type:
|
|
804
|
+
r === "up" ? await s.deleteReaction(e.id, Be) : await s.sendReaction(
|
|
805
|
+
e.id,
|
|
806
|
+
{ type: Be },
|
|
802
807
|
{ enforce_unique: !0, skip_push: !0 }
|
|
803
808
|
);
|
|
804
809
|
} catch {
|
|
805
810
|
}
|
|
806
|
-
}, [s, n == null ? void 0 : n.userID,
|
|
811
|
+
}, [s, n == null ? void 0 : n.userID, e.id, r]), c = U(async () => {
|
|
807
812
|
if (n != null && n.userID)
|
|
808
813
|
try {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
{ type:
|
|
814
|
+
r === "down" ? await s.deleteReaction(e.id, He) : await s.sendReaction(
|
|
815
|
+
e.id,
|
|
816
|
+
{ type: He },
|
|
812
817
|
{ enforce_unique: !0, skip_push: !0 }
|
|
813
818
|
);
|
|
814
819
|
} catch {
|
|
815
820
|
}
|
|
816
|
-
}, [s, n == null ? void 0 : n.userID,
|
|
817
|
-
return { selected:
|
|
821
|
+
}, [s, n == null ? void 0 : n.userID, e.id, r]);
|
|
822
|
+
return { selected: r, voteUp: l, voteDown: c };
|
|
823
|
+
}
|
|
824
|
+
const bt = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, tt = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i, st = /\.(m3u8)($|\?)/i, Zs = /\.(mpd)($|\?)/i, Ks = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/, Js = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//, Qs = /vimeo\.com\/(?!progressive_redirect).+/, en = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/, tn = /open\.spotify\.com\/(\w+)\/(\w+)/i, sn = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/, nn = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/, pe = (e, s) => {
|
|
825
|
+
if (Array.isArray(e)) {
|
|
826
|
+
for (const n of e)
|
|
827
|
+
if (typeof n == "string" && pe(n, s) || pe(n.src, s))
|
|
828
|
+
return !0;
|
|
829
|
+
return !1;
|
|
830
|
+
}
|
|
831
|
+
return s(e);
|
|
832
|
+
}, ne = {
|
|
833
|
+
html: (e) => pe(e, (s) => bt.test(s) || tt.test(s)),
|
|
834
|
+
hls: (e) => pe(e, (s) => st.test(s)),
|
|
835
|
+
dash: (e) => pe(e, (s) => Zs.test(s)),
|
|
836
|
+
mux: (e) => Ks.test(e),
|
|
837
|
+
youtube: (e) => Js.test(e),
|
|
838
|
+
vimeo: (e) => Qs.test(e) && !tt.test(e) && !st.test(e),
|
|
839
|
+
wistia: (e) => en.test(e),
|
|
840
|
+
spotify: (e) => tn.test(e),
|
|
841
|
+
twitch: (e) => sn.test(e),
|
|
842
|
+
tiktok: (e) => nn.test(e)
|
|
843
|
+
}, an = L.forwardRef((e, s) => {
|
|
844
|
+
const n = bt.test(`${e.src}`) ? "audio" : "video";
|
|
845
|
+
return /* @__PURE__ */ L.createElement(n, { ...e, ref: s }, e.children);
|
|
846
|
+
});
|
|
847
|
+
var rn = an;
|
|
848
|
+
const ln = [
|
|
849
|
+
{
|
|
850
|
+
key: "hls",
|
|
851
|
+
name: "hls.js",
|
|
852
|
+
canPlay: ne.hls,
|
|
853
|
+
canEnablePIP: () => !0,
|
|
854
|
+
player: ae(
|
|
855
|
+
() => import(
|
|
856
|
+
/* webpackChunkName: 'reactPlayerHls' */
|
|
857
|
+
"./react-Pea5fum1.js"
|
|
858
|
+
)
|
|
859
|
+
)
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
key: "dash",
|
|
863
|
+
name: "dash.js",
|
|
864
|
+
canPlay: ne.dash,
|
|
865
|
+
canEnablePIP: () => !0,
|
|
866
|
+
player: ae(
|
|
867
|
+
() => import(
|
|
868
|
+
/* webpackChunkName: 'reactPlayerDash' */
|
|
869
|
+
"./react-dS1WBxxz.js"
|
|
870
|
+
)
|
|
871
|
+
)
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
key: "mux",
|
|
875
|
+
name: "Mux",
|
|
876
|
+
canPlay: ne.mux,
|
|
877
|
+
canEnablePIP: () => !0,
|
|
878
|
+
player: ae(
|
|
879
|
+
() => import(
|
|
880
|
+
/* webpackChunkName: 'reactPlayerMux' */
|
|
881
|
+
"./index-Da-xN4Yq.js"
|
|
882
|
+
)
|
|
883
|
+
)
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
key: "youtube",
|
|
887
|
+
name: "YouTube",
|
|
888
|
+
canPlay: ne.youtube,
|
|
889
|
+
player: ae(
|
|
890
|
+
() => import(
|
|
891
|
+
/* webpackChunkName: 'reactPlayerYouTube' */
|
|
892
|
+
"./react-RiBbsUDd.js"
|
|
893
|
+
)
|
|
894
|
+
)
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
key: "vimeo",
|
|
898
|
+
name: "Vimeo",
|
|
899
|
+
canPlay: ne.vimeo,
|
|
900
|
+
player: ae(
|
|
901
|
+
() => import(
|
|
902
|
+
/* webpackChunkName: 'reactPlayerVimeo' */
|
|
903
|
+
"./react-Cn4WlMcl.js"
|
|
904
|
+
)
|
|
905
|
+
)
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
key: "wistia",
|
|
909
|
+
name: "Wistia",
|
|
910
|
+
canPlay: ne.wistia,
|
|
911
|
+
canEnablePIP: () => !0,
|
|
912
|
+
player: ae(
|
|
913
|
+
() => import(
|
|
914
|
+
/* webpackChunkName: 'reactPlayerWistia' */
|
|
915
|
+
"./react-CwTJArKY.js"
|
|
916
|
+
)
|
|
917
|
+
)
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
key: "spotify",
|
|
921
|
+
name: "Spotify",
|
|
922
|
+
canPlay: ne.spotify,
|
|
923
|
+
canEnablePIP: () => !1,
|
|
924
|
+
player: ae(
|
|
925
|
+
() => import(
|
|
926
|
+
/* webpackChunkName: 'reactPlayerSpotify' */
|
|
927
|
+
"./react-COAP-MIW.js"
|
|
928
|
+
)
|
|
929
|
+
)
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
key: "twitch",
|
|
933
|
+
name: "Twitch",
|
|
934
|
+
canPlay: ne.twitch,
|
|
935
|
+
canEnablePIP: () => !1,
|
|
936
|
+
player: ae(
|
|
937
|
+
() => import(
|
|
938
|
+
/* webpackChunkName: 'reactPlayerTwitch' */
|
|
939
|
+
"./react-BxlQMOfz.js"
|
|
940
|
+
)
|
|
941
|
+
)
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
key: "tiktok",
|
|
945
|
+
name: "TikTok",
|
|
946
|
+
canPlay: ne.tiktok,
|
|
947
|
+
canEnablePIP: () => !1,
|
|
948
|
+
player: ae(
|
|
949
|
+
() => import(
|
|
950
|
+
/* webpackChunkName: 'reactPlayerTiktok' */
|
|
951
|
+
"./react-DkfS_atT.js"
|
|
952
|
+
)
|
|
953
|
+
)
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
key: "html",
|
|
957
|
+
name: "html",
|
|
958
|
+
canPlay: ne.html,
|
|
959
|
+
canEnablePIP: () => !0,
|
|
960
|
+
player: rn
|
|
961
|
+
}
|
|
962
|
+
];
|
|
963
|
+
var Ge = ln;
|
|
964
|
+
const on = {
|
|
965
|
+
// Falsy values don't need to be defined
|
|
966
|
+
//
|
|
967
|
+
// native video attrs
|
|
968
|
+
// src: undefined,
|
|
969
|
+
// preload: undefined,
|
|
970
|
+
// crossOrigin: undefined,
|
|
971
|
+
// autoPlay: false,
|
|
972
|
+
// muted: false,
|
|
973
|
+
// loop: false,
|
|
974
|
+
// controls: false,
|
|
975
|
+
// playsInline: false,
|
|
976
|
+
// disableRemotePlayback: false,
|
|
977
|
+
width: "320px",
|
|
978
|
+
height: "180px",
|
|
979
|
+
// native video props
|
|
980
|
+
volume: 1,
|
|
981
|
+
playbackRate: 1,
|
|
982
|
+
// custom props
|
|
983
|
+
// playing: undefined,
|
|
984
|
+
// pip: false,
|
|
985
|
+
// light: false,
|
|
986
|
+
// fallback: null,
|
|
987
|
+
previewTabIndex: 0,
|
|
988
|
+
previewAriaLabel: "",
|
|
989
|
+
oEmbedUrl: "https://noembed.com/embed?url={url}"
|
|
990
|
+
}, xt = L.forwardRef((e, s) => {
|
|
991
|
+
const { playing: n, pip: r } = e, l = e.activePlayer, c = W(null), a = W(!0);
|
|
992
|
+
V(() => {
|
|
993
|
+
var m, y;
|
|
994
|
+
c.current && (c.current.paused && n === !0 && c.current.play(), !c.current.paused && n === !1 && c.current.pause(), c.current.playbackRate = (m = e.playbackRate) != null ? m : 1, c.current.volume = (y = e.volume) != null ? y : 1);
|
|
995
|
+
}), V(() => {
|
|
996
|
+
var m, y, u, _, o;
|
|
997
|
+
if (!(!c.current || !globalThis.document)) {
|
|
998
|
+
if (r && !document.pictureInPictureElement)
|
|
999
|
+
try {
|
|
1000
|
+
(y = (m = c.current).requestPictureInPicture) == null || y.call(m);
|
|
1001
|
+
} catch {
|
|
1002
|
+
}
|
|
1003
|
+
if (!r && document.pictureInPictureElement)
|
|
1004
|
+
try {
|
|
1005
|
+
(_ = (u = c.current).exitPictureInPicture) == null || _.call(u), (o = document.exitPictureInPicture) == null || o.call(document);
|
|
1006
|
+
} catch {
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}, [r]);
|
|
1010
|
+
const d = (m) => {
|
|
1011
|
+
var y, u;
|
|
1012
|
+
a.current = !0, (y = e.onReady) == null || y.call(e), (u = e.onLoadStart) == null || u.call(e, m);
|
|
1013
|
+
}, b = (m) => {
|
|
1014
|
+
var y, u;
|
|
1015
|
+
a.current && (a.current = !1, (y = e.onStart) == null || y.call(e, m)), (u = e.onPlay) == null || u.call(e, m);
|
|
1016
|
+
};
|
|
1017
|
+
if (!l)
|
|
1018
|
+
return null;
|
|
1019
|
+
const f = {}, x = ["onReady", "onStart"];
|
|
1020
|
+
for (const m in e)
|
|
1021
|
+
m.startsWith("on") && !x.includes(m) && (f[m] = e[m]);
|
|
1022
|
+
return /* @__PURE__ */ L.createElement(
|
|
1023
|
+
l,
|
|
1024
|
+
{
|
|
1025
|
+
...f,
|
|
1026
|
+
style: e.style,
|
|
1027
|
+
className: e.className,
|
|
1028
|
+
slot: e.slot,
|
|
1029
|
+
ref: U(
|
|
1030
|
+
(m) => {
|
|
1031
|
+
c.current = m, typeof s == "function" ? s(m) : s !== null && (s.current = m);
|
|
1032
|
+
},
|
|
1033
|
+
[s]
|
|
1034
|
+
),
|
|
1035
|
+
src: e.src,
|
|
1036
|
+
crossOrigin: e.crossOrigin,
|
|
1037
|
+
preload: e.preload,
|
|
1038
|
+
controls: e.controls,
|
|
1039
|
+
muted: e.muted,
|
|
1040
|
+
autoPlay: e.autoPlay,
|
|
1041
|
+
loop: e.loop,
|
|
1042
|
+
playsInline: e.playsInline,
|
|
1043
|
+
disableRemotePlayback: e.disableRemotePlayback,
|
|
1044
|
+
config: e.config,
|
|
1045
|
+
onLoadStart: d,
|
|
1046
|
+
onPlay: b
|
|
1047
|
+
},
|
|
1048
|
+
e.children
|
|
1049
|
+
);
|
|
1050
|
+
});
|
|
1051
|
+
xt.displayName = "Player";
|
|
1052
|
+
var cn = xt;
|
|
1053
|
+
const dn = ae(() => import(
|
|
1054
|
+
/* webpackChunkName: 'reactPlayerPreview' */
|
|
1055
|
+
"./Preview-DqAv16NS.js"
|
|
1056
|
+
)), ye = [], un = (e, s) => {
|
|
1057
|
+
const n = (l) => {
|
|
1058
|
+
for (const c of [...ye, ...e])
|
|
1059
|
+
if (l && c.canPlay(l))
|
|
1060
|
+
return c;
|
|
1061
|
+
return s || null;
|
|
1062
|
+
}, r = L.forwardRef((l, c) => {
|
|
1063
|
+
const a = { ...on, ...l }, { src: d, slot: b, className: f, style: x, width: m, height: y, fallback: u, wrapper: _ } = a, [o, N] = k(!!a.light);
|
|
1064
|
+
V(() => {
|
|
1065
|
+
a.light ? N(!0) : N(!1);
|
|
1066
|
+
}, [a.light]);
|
|
1067
|
+
const P = (p) => {
|
|
1068
|
+
var h;
|
|
1069
|
+
N(!1), (h = a.onClickPreview) == null || h.call(a, p);
|
|
1070
|
+
}, C = (p) => {
|
|
1071
|
+
if (!p) return null;
|
|
1072
|
+
const { light: h, playIcon: g, previewTabIndex: I, oEmbedUrl: v, previewAriaLabel: w } = a;
|
|
1073
|
+
return /* @__PURE__ */ L.createElement(
|
|
1074
|
+
dn,
|
|
1075
|
+
{
|
|
1076
|
+
src: p,
|
|
1077
|
+
light: h,
|
|
1078
|
+
playIcon: g,
|
|
1079
|
+
previewTabIndex: I,
|
|
1080
|
+
previewAriaLabel: w,
|
|
1081
|
+
oEmbedUrl: v,
|
|
1082
|
+
onClickPreview: P
|
|
1083
|
+
}
|
|
1084
|
+
);
|
|
1085
|
+
}, S = (p) => {
|
|
1086
|
+
var h, g;
|
|
1087
|
+
const I = n(p);
|
|
1088
|
+
if (!I) return null;
|
|
1089
|
+
const { style: v, width: w, height: A, wrapper: G } = a, $ = (h = a.config) == null ? void 0 : h[I.key];
|
|
1090
|
+
return /* @__PURE__ */ L.createElement(
|
|
1091
|
+
cn,
|
|
1092
|
+
{
|
|
1093
|
+
...a,
|
|
1094
|
+
ref: c,
|
|
1095
|
+
activePlayer: (g = I.player) != null ? g : I,
|
|
1096
|
+
slot: G ? void 0 : b,
|
|
1097
|
+
className: G ? void 0 : f,
|
|
1098
|
+
style: G ? { display: "block", width: "100%", height: "100%" } : { display: "block", width: w, height: A, ...v },
|
|
1099
|
+
config: $
|
|
1100
|
+
}
|
|
1101
|
+
);
|
|
1102
|
+
}, M = _ ?? nt, R = u === !1 ? nt : _t;
|
|
1103
|
+
return /* @__PURE__ */ L.createElement(M, { slot: b, className: f, style: { width: m, height: y, ...x } }, /* @__PURE__ */ L.createElement(R, { fallback: u }, o ? C(d) : S(d)));
|
|
1104
|
+
});
|
|
1105
|
+
return r.displayName = "ReactPlayer", r.addCustomPlayer = (l) => {
|
|
1106
|
+
ye.push(l);
|
|
1107
|
+
}, r.removeCustomPlayers = () => {
|
|
1108
|
+
ye.length = 0;
|
|
1109
|
+
}, r.canPlay = (l) => {
|
|
1110
|
+
if (l) {
|
|
1111
|
+
for (const c of [...ye, ...e])
|
|
1112
|
+
if (c.canPlay(l))
|
|
1113
|
+
return !0;
|
|
1114
|
+
}
|
|
1115
|
+
return !1;
|
|
1116
|
+
}, r.canEnablePIP = (l) => {
|
|
1117
|
+
var c;
|
|
1118
|
+
if (l) {
|
|
1119
|
+
for (const a of [...ye, ...e])
|
|
1120
|
+
if (a.canPlay(l) && ((c = a.canEnablePIP) != null && c.call(a)))
|
|
1121
|
+
return !0;
|
|
1122
|
+
}
|
|
1123
|
+
return !1;
|
|
1124
|
+
}, r;
|
|
1125
|
+
}, nt = ({ children: e }) => e, mn = Ge[Ge.length - 1];
|
|
1126
|
+
var hn = un(Ge, mn);
|
|
1127
|
+
const fn = [
|
|
1128
|
+
[/pdf/, "pdf"],
|
|
1129
|
+
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
1130
|
+
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
1131
|
+
[/csv/, "csv"],
|
|
1132
|
+
[/presentationml|ms-powerpoint|\.ppt/, "ppt"],
|
|
1133
|
+
[/zip|x-rar|x-7z|x-tar|x-gzip/, "zip"],
|
|
1134
|
+
[/plain|rtf/, "text"],
|
|
1135
|
+
[/markdown/, "markdown"]
|
|
1136
|
+
];
|
|
1137
|
+
function yt(e) {
|
|
1138
|
+
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
1139
|
+
}
|
|
1140
|
+
function gn(e) {
|
|
1141
|
+
const s = fn.find(([n]) => n.test(e));
|
|
1142
|
+
return s ? s[1] : "generic";
|
|
818
1143
|
}
|
|
819
|
-
const
|
|
1144
|
+
const bn = {
|
|
1145
|
+
video: xs,
|
|
1146
|
+
audio: bs,
|
|
1147
|
+
image: gs,
|
|
1148
|
+
document: ot
|
|
1149
|
+
}, xn = {
|
|
1150
|
+
pdf: Es,
|
|
1151
|
+
doc: _s,
|
|
1152
|
+
xls: Cs,
|
|
1153
|
+
csv: Ns,
|
|
1154
|
+
ppt: ws,
|
|
1155
|
+
zip: vs,
|
|
1156
|
+
text: ps,
|
|
1157
|
+
markdown: ys,
|
|
1158
|
+
generic: ot
|
|
1159
|
+
};
|
|
1160
|
+
function yn(e) {
|
|
1161
|
+
const s = yt(e);
|
|
1162
|
+
return s !== "document" ? bn[s] : xn[gn(e)];
|
|
1163
|
+
}
|
|
1164
|
+
const pn = ({
|
|
1165
|
+
title: e,
|
|
1166
|
+
amountText: s,
|
|
1167
|
+
thumbnail: n,
|
|
1168
|
+
source: r,
|
|
1169
|
+
mimeType: l,
|
|
1170
|
+
detail: c,
|
|
1171
|
+
onUnlock: a,
|
|
1172
|
+
onDownload: d,
|
|
1173
|
+
loading: b = !1,
|
|
1174
|
+
isPurchased: f = !1
|
|
1175
|
+
}) => {
|
|
1176
|
+
const x = r === void 0, m = f ? us : ms, y = yt(l), u = yn(l), [_, o] = k(!1), [N, P] = k(0), [C, S] = k(!1), [M, R] = k(!1), [p, h] = k(!1), [g, I] = k(null), [v, w] = k(!1), A = W(null), G = W(null), $ = W(null), Z = U(() => {
|
|
1177
|
+
const E = A.current;
|
|
1178
|
+
E && E.duration && !C && P(E.currentTime / E.duration), $.current = requestAnimationFrame(Z);
|
|
1179
|
+
}, [C]);
|
|
1180
|
+
V(() => (_ ? $.current = requestAnimationFrame(Z) : $.current !== null && cancelAnimationFrame($.current), () => {
|
|
1181
|
+
$.current !== null && cancelAnimationFrame($.current);
|
|
1182
|
+
}), [_, Z]), V(() => {
|
|
1183
|
+
const E = A.current;
|
|
1184
|
+
E && (_ ? E.play().catch(() => {
|
|
1185
|
+
}) : E.pause());
|
|
1186
|
+
}, [_]);
|
|
1187
|
+
const D = (E) => {
|
|
1188
|
+
const O = G.current;
|
|
1189
|
+
if (!O) return 0;
|
|
1190
|
+
const q = O.getBoundingClientRect();
|
|
1191
|
+
return Math.max(0, Math.min(1, (E.clientX - q.left) / q.width));
|
|
1192
|
+
}, z = (E) => {
|
|
1193
|
+
const O = A.current;
|
|
1194
|
+
O && O.duration && (O.currentTime = E * O.duration);
|
|
1195
|
+
}, Y = (E) => {
|
|
1196
|
+
E.stopPropagation(), S(!0);
|
|
1197
|
+
const O = D(E);
|
|
1198
|
+
P(O), z(O);
|
|
1199
|
+
};
|
|
1200
|
+
V(() => {
|
|
1201
|
+
if (!C) return;
|
|
1202
|
+
const E = (q) => P(D(q)), O = (q) => {
|
|
1203
|
+
S(!1), z(D(q));
|
|
1204
|
+
};
|
|
1205
|
+
return window.addEventListener("mousemove", E), window.addEventListener("mouseup", O), () => {
|
|
1206
|
+
window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", O);
|
|
1207
|
+
};
|
|
1208
|
+
}, [C]);
|
|
1209
|
+
const ie = /* @__PURE__ */ i(
|
|
1210
|
+
"div",
|
|
1211
|
+
{
|
|
1212
|
+
role: "button",
|
|
1213
|
+
tabIndex: 0,
|
|
1214
|
+
className: `relative cursor-pointer overflow-hidden ${y === "audio" && !n ? "bg-black/5" : "bg-black"}${n ? "" : " aspect-video"}`,
|
|
1215
|
+
style: !n && g ? { aspectRatio: String(g) } : void 0,
|
|
1216
|
+
onClick: () => o((E) => !E),
|
|
1217
|
+
onKeyDown: (E) => {
|
|
1218
|
+
(E.key === "Enter" || E.key === " ") && o((O) => !O);
|
|
1219
|
+
},
|
|
1220
|
+
children: [
|
|
1221
|
+
n && /* @__PURE__ */ t("img", { src: n, alt: "", className: "block w-full" }),
|
|
1222
|
+
!n && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ t(u, { className: "size-12 text-black/20", weight: "regular" }) }),
|
|
1223
|
+
/* @__PURE__ */ t("div", { className: "absolute inset-0", children: /* @__PURE__ */ t(
|
|
1224
|
+
hn,
|
|
1225
|
+
{
|
|
1226
|
+
ref: A,
|
|
1227
|
+
src: r,
|
|
1228
|
+
poster: n,
|
|
1229
|
+
width: "100%",
|
|
1230
|
+
height: "100%",
|
|
1231
|
+
onLoadStart: () => w(!0),
|
|
1232
|
+
onCanPlay: () => w(!1),
|
|
1233
|
+
onWaiting: () => w(!0),
|
|
1234
|
+
onLoadedMetadata: () => {
|
|
1235
|
+
const E = A.current;
|
|
1236
|
+
E && E.videoWidth && E.videoHeight && I(E.videoWidth / E.videoHeight);
|
|
1237
|
+
},
|
|
1238
|
+
onEnded: () => {
|
|
1239
|
+
o(!1), P(0);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
) }),
|
|
1243
|
+
v && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ t(Is, { className: "size-8 animate-spin text-white/80", weight: "bold" }) }),
|
|
1244
|
+
/* @__PURE__ */ i("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6", children: [
|
|
1245
|
+
/* @__PURE__ */ t(
|
|
1246
|
+
"button",
|
|
1247
|
+
{
|
|
1248
|
+
type: "button",
|
|
1249
|
+
onClick: (E) => {
|
|
1250
|
+
E.stopPropagation(), o((O) => !O);
|
|
1251
|
+
},
|
|
1252
|
+
className: "shrink-0 text-white",
|
|
1253
|
+
"aria-label": _ ? "Pause" : "Play",
|
|
1254
|
+
children: _ ? /* @__PURE__ */ t(Ss, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ t(ks, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1255
|
+
}
|
|
1256
|
+
),
|
|
1257
|
+
/* @__PURE__ */ i(
|
|
1258
|
+
"div",
|
|
1259
|
+
{
|
|
1260
|
+
role: "slider",
|
|
1261
|
+
"aria-label": "Playback position",
|
|
1262
|
+
"aria-valuenow": Math.round(N * 100),
|
|
1263
|
+
"aria-valuemin": 0,
|
|
1264
|
+
"aria-valuemax": 100,
|
|
1265
|
+
tabIndex: 0,
|
|
1266
|
+
ref: G,
|
|
1267
|
+
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1268
|
+
onMouseDown: Y,
|
|
1269
|
+
onClick: (E) => E.stopPropagation(),
|
|
1270
|
+
onMouseEnter: () => R(!0),
|
|
1271
|
+
onMouseLeave: () => R(!1),
|
|
1272
|
+
onKeyDown: (E) => {
|
|
1273
|
+
E.key === "ArrowRight" && z(Math.min(1, N + 0.05)), E.key === "ArrowLeft" && z(Math.max(0, N - 0.05));
|
|
1274
|
+
},
|
|
1275
|
+
children: [
|
|
1276
|
+
/* @__PURE__ */ t("div", { className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${M || C ? "h-1.5" : "h-1"}`, children: /* @__PURE__ */ t("div", { className: "h-full rounded-full bg-white", style: { width: `${N * 100}%` } }) }),
|
|
1277
|
+
/* @__PURE__ */ t(
|
|
1278
|
+
"div",
|
|
1279
|
+
{
|
|
1280
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${M || C ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1281
|
+
style: { left: `${N * 100}%` }
|
|
1282
|
+
}
|
|
1283
|
+
)
|
|
1284
|
+
]
|
|
1285
|
+
}
|
|
1286
|
+
)
|
|
1287
|
+
] })
|
|
1288
|
+
]
|
|
1289
|
+
}
|
|
1290
|
+
);
|
|
1291
|
+
return /* @__PURE__ */ i("div", { className: "w-[280px] overflow-hidden rounded-3xl bg-white shadow-[0px_0px_0px_1px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04),0px_8px_32px_0px_rgba(0,0,0,0.1)]", children: [
|
|
1292
|
+
y === "image" || y === "document" ? /* @__PURE__ */ i("div", { className: `relative overflow-hidden bg-black/5${!n && (x || y === "document") ? " aspect-video" : ""}`, children: [
|
|
1293
|
+
n && /* @__PURE__ */ t(
|
|
1294
|
+
"img",
|
|
1295
|
+
{
|
|
1296
|
+
src: n,
|
|
1297
|
+
alt: "",
|
|
1298
|
+
className: "block w-full"
|
|
1299
|
+
}
|
|
1300
|
+
),
|
|
1301
|
+
!n && !x && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ t(u, { className: "size-12 text-black/20", weight: "regular" }) }),
|
|
1302
|
+
!n && !x && y === "image" && /* @__PURE__ */ t(
|
|
1303
|
+
"img",
|
|
1304
|
+
{
|
|
1305
|
+
src: r,
|
|
1306
|
+
alt: e,
|
|
1307
|
+
className: "relative block w-full"
|
|
1308
|
+
}
|
|
1309
|
+
),
|
|
1310
|
+
x ? /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30", children: /* @__PURE__ */ t("div", { className: "flex size-12 items-center justify-center rounded-full bg-black/60", children: /* @__PURE__ */ t(m, { className: "size-6 text-white", weight: "regular" }) }) }) : n && y === "image" && /* @__PURE__ */ t(
|
|
1311
|
+
"img",
|
|
1312
|
+
{
|
|
1313
|
+
src: r,
|
|
1314
|
+
alt: e,
|
|
1315
|
+
className: `absolute inset-0 h-full w-full object-cover transition-opacity duration-300 ${p ? "opacity-100" : "opacity-0"}`,
|
|
1316
|
+
onLoad: () => h(!0)
|
|
1317
|
+
}
|
|
1318
|
+
)
|
|
1319
|
+
] }) : x ? /* @__PURE__ */ i("div", { className: `relative overflow-hidden bg-black/5${n ? "" : " aspect-video"}`, children: [
|
|
1320
|
+
n && /* @__PURE__ */ t("img", { src: n, alt: "", className: "block w-full" }),
|
|
1321
|
+
/* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30", children: /* @__PURE__ */ t("div", { className: "flex size-12 items-center justify-center rounded-full bg-black/60", children: /* @__PURE__ */ t(m, { className: "size-6 text-white", weight: "regular" }) }) })
|
|
1322
|
+
] }) : ie,
|
|
1323
|
+
/* @__PURE__ */ i("div", { className: "px-4 pb-3 pt-3", children: [
|
|
1324
|
+
/* @__PURE__ */ t("p", { className: "mb-1.5 truncate text-base font-medium text-black", children: e }),
|
|
1325
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
1326
|
+
/* @__PURE__ */ t(u, { className: "size-5 shrink-0 text-black/55", weight: "regular" }),
|
|
1327
|
+
c && /* @__PURE__ */ t("span", { className: "text-xs font-medium text-black/55", children: c }),
|
|
1328
|
+
f || r ? /* @__PURE__ */ i(oe, { children: [
|
|
1329
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-medium text-black/55", children: "•" }),
|
|
1330
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-medium text-[#008236]", children: "Purchased" }),
|
|
1331
|
+
/* @__PURE__ */ t(hs, { className: "size-4 text-[#008236]", weight: "bold" })
|
|
1332
|
+
] }) : s && /* @__PURE__ */ i(oe, { children: [
|
|
1333
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-medium text-black/55", children: "•" }),
|
|
1334
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-medium text-black/55", children: s })
|
|
1335
|
+
] })
|
|
1336
|
+
] }),
|
|
1337
|
+
x ? (a || b) && /* @__PURE__ */ t(
|
|
1338
|
+
"button",
|
|
1339
|
+
{
|
|
1340
|
+
type: "button",
|
|
1341
|
+
onClick: a,
|
|
1342
|
+
disabled: b,
|
|
1343
|
+
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 disabled:opacity-70",
|
|
1344
|
+
children: b ? /* @__PURE__ */ i("span", { className: "flex items-center gap-1", children: [
|
|
1345
|
+
/* @__PURE__ */ t("span", { className: "size-1 rounded-full bg-white animate-bounce [animation-delay:-0.3s]" }),
|
|
1346
|
+
/* @__PURE__ */ t("span", { className: "size-1 rounded-full bg-white animate-bounce [animation-delay:-0.15s]" }),
|
|
1347
|
+
/* @__PURE__ */ t("span", { className: "size-1 rounded-full bg-white animate-bounce" })
|
|
1348
|
+
] }) : /* @__PURE__ */ i(oe, { children: [
|
|
1349
|
+
/* @__PURE__ */ t(m, { className: "size-4", weight: "fill" }),
|
|
1350
|
+
f ? "Open" : "Unlock"
|
|
1351
|
+
] })
|
|
1352
|
+
}
|
|
1353
|
+
) : d && r && /* @__PURE__ */ i(
|
|
1354
|
+
"a",
|
|
1355
|
+
{
|
|
1356
|
+
href: `${r}${r.includes("?") ? "&" : "?"}d=true`,
|
|
1357
|
+
target: "_blank",
|
|
1358
|
+
rel: "noopener noreferrer",
|
|
1359
|
+
onClick: d,
|
|
1360
|
+
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",
|
|
1361
|
+
children: [
|
|
1362
|
+
/* @__PURE__ */ t(fs, { className: "size-4", weight: "bold" }),
|
|
1363
|
+
"Download"
|
|
1364
|
+
]
|
|
1365
|
+
}
|
|
1366
|
+
)
|
|
1367
|
+
] })
|
|
1368
|
+
] });
|
|
1369
|
+
}, vn = ({ filled: e }) => /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t(
|
|
820
1370
|
"path",
|
|
821
1371
|
{
|
|
822
1372
|
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",
|
|
@@ -824,9 +1374,9 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
824
1374
|
strokeWidth: "1.33",
|
|
825
1375
|
strokeLinecap: "round",
|
|
826
1376
|
strokeLinejoin: "round",
|
|
827
|
-
fill:
|
|
1377
|
+
fill: e ? "currentColor" : "none"
|
|
828
1378
|
}
|
|
829
|
-
) }),
|
|
1379
|
+
) }), wn = ({ filled: e }) => /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t(
|
|
830
1380
|
"path",
|
|
831
1381
|
{
|
|
832
1382
|
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",
|
|
@@ -834,216 +1384,243 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
834
1384
|
strokeWidth: "1.33",
|
|
835
1385
|
strokeLinecap: "round",
|
|
836
1386
|
strokeLinejoin: "round",
|
|
837
|
-
fill:
|
|
1387
|
+
fill: e ? "currentColor" : "none"
|
|
838
1388
|
}
|
|
839
|
-
) }),
|
|
840
|
-
selected:
|
|
1389
|
+
) }), Nn = ({
|
|
1390
|
+
selected: e,
|
|
841
1391
|
onVoteUp: s,
|
|
842
1392
|
onVoteDown: n
|
|
843
1393
|
}) => /* @__PURE__ */ i("div", { className: "message-vote-buttons", children: [
|
|
844
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ t(
|
|
845
1395
|
"button",
|
|
846
1396
|
{
|
|
847
1397
|
type: "button",
|
|
848
|
-
className: `message-vote-button${
|
|
1398
|
+
className: `message-vote-button${e === "up" ? " message-vote-button--selected" : ""} focus-ring`,
|
|
849
1399
|
onClick: s,
|
|
850
1400
|
"aria-label": "Helpful",
|
|
851
|
-
"aria-pressed":
|
|
852
|
-
children: /* @__PURE__ */
|
|
1401
|
+
"aria-pressed": e === "up",
|
|
1402
|
+
children: /* @__PURE__ */ t(vn, { filled: e === "up" })
|
|
853
1403
|
}
|
|
854
1404
|
),
|
|
855
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ t(
|
|
856
1406
|
"button",
|
|
857
1407
|
{
|
|
858
1408
|
type: "button",
|
|
859
|
-
className: `message-vote-button${
|
|
1409
|
+
className: `message-vote-button${e === "down" ? " message-vote-button--selected" : ""} focus-ring`,
|
|
860
1410
|
onClick: n,
|
|
861
1411
|
"aria-label": "Not helpful",
|
|
862
|
-
"aria-pressed":
|
|
863
|
-
children: /* @__PURE__ */
|
|
1412
|
+
"aria-pressed": e === "down",
|
|
1413
|
+
children: /* @__PURE__ */ t(wn, { filled: e === "down" })
|
|
864
1414
|
}
|
|
865
1415
|
)
|
|
866
|
-
] }),
|
|
867
|
-
var
|
|
1416
|
+
] }), Cn = (e) => {
|
|
1417
|
+
var Ne, Ce, de, _e, Ee, Ie, ue, T;
|
|
868
1418
|
const {
|
|
869
1419
|
additionalMessageInputProps: s,
|
|
870
1420
|
chatbotVotingEnabled: n,
|
|
871
|
-
|
|
872
|
-
|
|
1421
|
+
onAttachmentUnlock: r,
|
|
1422
|
+
onAttachmentDownload: l,
|
|
1423
|
+
editing: c,
|
|
1424
|
+
endOfGroup: a,
|
|
873
1425
|
firstOfGroup: d,
|
|
874
|
-
groupedByUser:
|
|
875
|
-
handleAction:
|
|
876
|
-
handleOpenThread:
|
|
877
|
-
handleRetry:
|
|
878
|
-
highlighted:
|
|
879
|
-
isMessageAIGenerated:
|
|
880
|
-
isMyMessage:
|
|
881
|
-
message:
|
|
882
|
-
renderText:
|
|
883
|
-
threadList:
|
|
884
|
-
} =
|
|
885
|
-
Attachment:
|
|
886
|
-
EditMessageModal:
|
|
887
|
-
MessageBlocked:
|
|
888
|
-
MessageBouncePrompt:
|
|
889
|
-
MessageDeleted:
|
|
890
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
891
|
-
MessageRepliesCountButton:
|
|
892
|
-
ReminderNotification:
|
|
893
|
-
StreamedMessageText:
|
|
894
|
-
PinIndicator:
|
|
895
|
-
} =
|
|
896
|
-
() =>
|
|
897
|
-
[
|
|
898
|
-
),
|
|
899
|
-
() => !
|
|
900
|
-
[
|
|
1426
|
+
groupedByUser: b,
|
|
1427
|
+
handleAction: f,
|
|
1428
|
+
handleOpenThread: x,
|
|
1429
|
+
handleRetry: m,
|
|
1430
|
+
highlighted: y,
|
|
1431
|
+
isMessageAIGenerated: u,
|
|
1432
|
+
isMyMessage: _,
|
|
1433
|
+
message: o,
|
|
1434
|
+
renderText: N,
|
|
1435
|
+
threadList: P
|
|
1436
|
+
} = e, { client: C } = rt("CustomMessage"), { channel: S } = Te("CustomMessage"), [M, R] = k(!1), [p, h] = k(!1), [g, I] = k(void 0), v = Pt(o.id), { selected: w, voteUp: A, voteDown: G } = Xs(o), {
|
|
1437
|
+
Attachment: $ = Rt,
|
|
1438
|
+
EditMessageModal: Z = Dt,
|
|
1439
|
+
MessageBlocked: D = At,
|
|
1440
|
+
MessageBouncePrompt: z = Lt,
|
|
1441
|
+
MessageDeleted: Y = Ot,
|
|
1442
|
+
MessageIsThreadReplyInChannelButtonIndicator: ie = Ut,
|
|
1443
|
+
MessageRepliesCountButton: E = Ft,
|
|
1444
|
+
ReminderNotification: O = $t,
|
|
1445
|
+
StreamedMessageText: q = zt,
|
|
1446
|
+
PinIndicator: j
|
|
1447
|
+
} = Tt("CustomMessage"), B = jt(o), ee = Bt(o), re = ze(
|
|
1448
|
+
() => u == null ? void 0 : u(o),
|
|
1449
|
+
[u, o]
|
|
1450
|
+
), K = ze(
|
|
1451
|
+
() => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
|
|
1452
|
+
[o]
|
|
901
1453
|
);
|
|
902
|
-
if (
|
|
1454
|
+
if (Ht(o))
|
|
903
1455
|
return null;
|
|
904
|
-
if (
|
|
905
|
-
return /* @__PURE__ */
|
|
906
|
-
if (
|
|
907
|
-
return /* @__PURE__ */
|
|
908
|
-
const
|
|
909
|
-
let
|
|
910
|
-
|
|
911
|
-
const
|
|
1456
|
+
if (o.deleted_at || o.type === "deleted")
|
|
1457
|
+
return /* @__PURE__ */ t(Y, { message: o });
|
|
1458
|
+
if (Gt(o))
|
|
1459
|
+
return /* @__PURE__ */ t(D, {});
|
|
1460
|
+
const De = !P && !!o.reply_count, te = !P && o.show_in_channel && o.parent_id, ce = o.status === "failed" && ((Ne = o.error) == null ? void 0 : Ne.status) !== 403, be = Vt(o);
|
|
1461
|
+
let J;
|
|
1462
|
+
ce ? J = () => m(o) : be && (J = () => R(!0));
|
|
1463
|
+
const le = _(), ve = F(
|
|
912
1464
|
"str-chat__message str-chat__message-simple",
|
|
913
|
-
`str-chat__message--${
|
|
914
|
-
`str-chat__message--${
|
|
915
|
-
|
|
916
|
-
|
|
1465
|
+
`str-chat__message--${o.type}`,
|
|
1466
|
+
`str-chat__message--${o.status}`,
|
|
1467
|
+
le ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1468
|
+
o.text ? "str-chat__message--has-text" : "has-no-text",
|
|
917
1469
|
{
|
|
918
|
-
"str-chat__message--has-attachment":
|
|
919
|
-
"str-chat__message--highlighted":
|
|
920
|
-
"str-chat__message--pinned pinned-message":
|
|
921
|
-
"str-chat__message--with-reactions":
|
|
922
|
-
"str-chat__message-send-can-be-retried": (
|
|
923
|
-
"str-chat__message-with-thread-link":
|
|
924
|
-
"str-chat__virtual-message__wrapper--end":
|
|
1470
|
+
"str-chat__message--has-attachment": B,
|
|
1471
|
+
"str-chat__message--highlighted": y,
|
|
1472
|
+
"str-chat__message--pinned pinned-message": o.pinned,
|
|
1473
|
+
"str-chat__message--with-reactions": ee,
|
|
1474
|
+
"str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((Ce = o == null ? void 0 : o.error) == null ? void 0 : Ce.status) !== 403,
|
|
1475
|
+
"str-chat__message-with-thread-link": De || te,
|
|
1476
|
+
"str-chat__virtual-message__wrapper--end": a,
|
|
925
1477
|
"str-chat__virtual-message__wrapper--first": d,
|
|
926
|
-
"str-chat__virtual-message__wrapper--group":
|
|
1478
|
+
"str-chat__virtual-message__wrapper--group": b
|
|
927
1479
|
}
|
|
928
|
-
),
|
|
929
|
-
return /* @__PURE__ */ i(
|
|
930
|
-
|
|
931
|
-
|
|
1480
|
+
), xe = o.poll_id && C.polls.fromState(o.poll_id), Ae = Gs(o), he = Ye(o), fe = Hs(o), se = !!(K != null && K.length && !o.quoted_message), we = he && le && se;
|
|
1481
|
+
return /* @__PURE__ */ i(oe, { children: [
|
|
1482
|
+
c && /* @__PURE__ */ t(
|
|
1483
|
+
Z,
|
|
932
1484
|
{
|
|
933
1485
|
additionalMessageInputProps: s
|
|
934
1486
|
}
|
|
935
1487
|
),
|
|
936
|
-
M && /* @__PURE__ */
|
|
937
|
-
|
|
1488
|
+
M && /* @__PURE__ */ t(
|
|
1489
|
+
Yt,
|
|
938
1490
|
{
|
|
939
|
-
MessageBouncePrompt:
|
|
940
|
-
onClose: () =>
|
|
1491
|
+
MessageBouncePrompt: z,
|
|
1492
|
+
onClose: () => R(!1),
|
|
941
1493
|
open: M
|
|
942
1494
|
}
|
|
943
1495
|
),
|
|
944
|
-
/* @__PURE__ */ i("div", { className:
|
|
945
|
-
|
|
946
|
-
!!
|
|
947
|
-
|
|
948
|
-
|
|
1496
|
+
/* @__PURE__ */ i("div", { className: ve, children: [
|
|
1497
|
+
j && /* @__PURE__ */ t(j, {}),
|
|
1498
|
+
!!v && /* @__PURE__ */ t(O, { reminder: v }),
|
|
1499
|
+
o.user && /* @__PURE__ */ t(
|
|
1500
|
+
me,
|
|
949
1501
|
{
|
|
950
1502
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
951
|
-
id:
|
|
952
|
-
image:
|
|
953
|
-
name:
|
|
1503
|
+
id: o.user.id,
|
|
1504
|
+
image: o.user.image,
|
|
1505
|
+
name: o.user.name || o.user.id
|
|
954
1506
|
}
|
|
955
1507
|
),
|
|
956
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ t(
|
|
957
1509
|
"div",
|
|
958
1510
|
{
|
|
959
|
-
className:
|
|
960
|
-
"str-chat__simple-message--error-failed":
|
|
1511
|
+
className: F("str-chat__message-inner", {
|
|
1512
|
+
"str-chat__simple-message--error-failed": ce || be
|
|
961
1513
|
}),
|
|
962
1514
|
"data-testid": "message-inner",
|
|
963
|
-
onClick:
|
|
964
|
-
onKeyDown:
|
|
965
|
-
role:
|
|
966
|
-
tabIndex:
|
|
1515
|
+
onClick: J,
|
|
1516
|
+
onKeyDown: J,
|
|
1517
|
+
role: J ? "button" : void 0,
|
|
1518
|
+
tabIndex: J ? 0 : void 0,
|
|
967
1519
|
style: {
|
|
968
1520
|
// Force margins to 0 to prevent hover layout shift
|
|
969
1521
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
970
1522
|
marginInlineEnd: 0,
|
|
971
1523
|
marginInlineStart: 0
|
|
972
1524
|
},
|
|
973
|
-
children:
|
|
1525
|
+
children: fe ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
1526
|
+
/* @__PURE__ */ t(
|
|
1527
|
+
pn,
|
|
1528
|
+
{
|
|
1529
|
+
title: ((de = o.metadata) == null ? void 0 : de.attachment_title) ?? "",
|
|
1530
|
+
mimeType: ((_e = o.metadata) == null ? void 0 : _e.attachment_mime_type) ?? "application/octet-stream",
|
|
1531
|
+
thumbnail: (Ee = o.metadata) == null ? void 0 : Ee.attachment_thumbnail,
|
|
1532
|
+
amountText: (Ie = o.metadata) == null ? void 0 : Ie.amount_text,
|
|
1533
|
+
detail: (ue = o.metadata) == null ? void 0 : ue.attachment_detail,
|
|
1534
|
+
source: g,
|
|
1535
|
+
isPurchased: ((T = o.metadata) == null ? void 0 : T.payment_status) === "paid",
|
|
1536
|
+
loading: p,
|
|
1537
|
+
onUnlock: r ? async () => {
|
|
1538
|
+
h(!0);
|
|
1539
|
+
try {
|
|
1540
|
+
I(await r(o, S));
|
|
1541
|
+
} catch {
|
|
1542
|
+
} finally {
|
|
1543
|
+
h(!1);
|
|
1544
|
+
}
|
|
1545
|
+
} : void 0,
|
|
1546
|
+
onDownload: g && l ? () => l(o, S) : void 0
|
|
1547
|
+
}
|
|
1548
|
+
),
|
|
1549
|
+
o.text && /* @__PURE__ */ t("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ t("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ t(qe, { message: o, renderText: N }) }) })
|
|
1550
|
+
] }) : Ae ? (
|
|
974
1551
|
/* Tip-only messages render as a standalone bubble */
|
|
975
|
-
/* @__PURE__ */
|
|
1552
|
+
/* @__PURE__ */ t(Fe, { message: o, standalone: !0 })
|
|
976
1553
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
977
1554
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
978
|
-
|
|
979
|
-
|
|
1555
|
+
he && !we && /* @__PURE__ */ t(
|
|
1556
|
+
Fe,
|
|
980
1557
|
{
|
|
981
|
-
message:
|
|
982
|
-
hasAttachment:
|
|
983
|
-
isMyMessage:
|
|
1558
|
+
message: o,
|
|
1559
|
+
hasAttachment: se,
|
|
1560
|
+
isMyMessage: le
|
|
984
1561
|
}
|
|
985
1562
|
),
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1563
|
+
xe && /* @__PURE__ */ t(Wt, { poll: xe }),
|
|
1564
|
+
K != null && K.length && !o.quoted_message ? /* @__PURE__ */ t(
|
|
1565
|
+
$,
|
|
989
1566
|
{
|
|
990
|
-
actionHandler:
|
|
991
|
-
attachments:
|
|
1567
|
+
actionHandler: f,
|
|
1568
|
+
attachments: K
|
|
992
1569
|
}
|
|
993
1570
|
) : null,
|
|
994
|
-
|
|
995
|
-
|
|
1571
|
+
re ? /* @__PURE__ */ t(
|
|
1572
|
+
q,
|
|
996
1573
|
{
|
|
997
|
-
message:
|
|
998
|
-
renderText:
|
|
1574
|
+
message: o,
|
|
1575
|
+
renderText: N
|
|
999
1576
|
}
|
|
1000
|
-
) : /* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1577
|
+
) : /* @__PURE__ */ t(qe, { message: o, renderText: N }),
|
|
1578
|
+
/* @__PURE__ */ t(qt, {})
|
|
1002
1579
|
] }),
|
|
1003
|
-
(!
|
|
1004
|
-
|
|
1580
|
+
(!he || we) && /* @__PURE__ */ t(
|
|
1581
|
+
Fe,
|
|
1005
1582
|
{
|
|
1006
|
-
message:
|
|
1007
|
-
hasAttachment:
|
|
1008
|
-
isMyMessage:
|
|
1583
|
+
message: o,
|
|
1584
|
+
hasAttachment: se,
|
|
1585
|
+
isMyMessage: le
|
|
1009
1586
|
}
|
|
1010
1587
|
),
|
|
1011
|
-
n &&
|
|
1012
|
-
|
|
1588
|
+
n && he && /* @__PURE__ */ t(
|
|
1589
|
+
Nn,
|
|
1013
1590
|
{
|
|
1014
|
-
selected:
|
|
1015
|
-
onVoteUp:
|
|
1016
|
-
onVoteDown:
|
|
1591
|
+
selected: w,
|
|
1592
|
+
onVoteUp: A,
|
|
1593
|
+
onVoteDown: G
|
|
1017
1594
|
}
|
|
1018
1595
|
)
|
|
1019
1596
|
] })
|
|
1020
1597
|
}
|
|
1021
1598
|
),
|
|
1022
|
-
|
|
1023
|
-
|
|
1599
|
+
De && /* @__PURE__ */ t(
|
|
1600
|
+
E,
|
|
1024
1601
|
{
|
|
1025
|
-
onClick:
|
|
1026
|
-
reply_count:
|
|
1602
|
+
onClick: x,
|
|
1603
|
+
reply_count: o.reply_count
|
|
1027
1604
|
}
|
|
1028
1605
|
),
|
|
1029
|
-
|
|
1030
|
-
] },
|
|
1606
|
+
te && /* @__PURE__ */ t(ie, {})
|
|
1607
|
+
] }, o.id)
|
|
1031
1608
|
] });
|
|
1032
|
-
},
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
),
|
|
1036
|
-
const s =
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
},
|
|
1039
|
-
linkPreviews: Array.from(
|
|
1040
|
-
(s) =>
|
|
1609
|
+
}, _n = L.memo(
|
|
1610
|
+
Cn,
|
|
1611
|
+
(e, s) => e.chatbotVotingEnabled !== s.chatbotVotingEnabled || e.onAttachmentUnlock !== s.onAttachmentUnlock || e.onAttachmentDownload !== s.onAttachmentDownload ? !1 : Mt(e, s)
|
|
1612
|
+
), En = (e) => {
|
|
1613
|
+
const s = lt("CustomMessage");
|
|
1614
|
+
return /* @__PURE__ */ t(_n, { ...s, ...e });
|
|
1615
|
+
}, In = (e) => ({
|
|
1616
|
+
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1617
|
+
(s) => Qe.previewIsLoaded(s) || Qe.previewIsLoading(s)
|
|
1041
1618
|
)
|
|
1042
|
-
}),
|
|
1043
|
-
link:
|
|
1619
|
+
}), Sn = ({
|
|
1620
|
+
link: e,
|
|
1044
1621
|
onDismiss: s
|
|
1045
1622
|
}) => {
|
|
1046
|
-
const { og_scrape_url: n, title:
|
|
1623
|
+
const { og_scrape_url: n, title: r, image_url: l } = e;
|
|
1047
1624
|
return /* @__PURE__ */ i(
|
|
1048
1625
|
"a",
|
|
1049
1626
|
{
|
|
@@ -1052,15 +1629,15 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1052
1629
|
rel: "noopener noreferrer",
|
|
1053
1630
|
className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
|
|
1054
1631
|
children: [
|
|
1055
|
-
l && /* @__PURE__ */
|
|
1632
|
+
l && /* @__PURE__ */ t(
|
|
1056
1633
|
"img",
|
|
1057
1634
|
{
|
|
1058
1635
|
src: l,
|
|
1059
|
-
alt:
|
|
1636
|
+
alt: r || "",
|
|
1060
1637
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
1061
1638
|
}
|
|
1062
1639
|
),
|
|
1063
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ t(
|
|
1064
1641
|
"button",
|
|
1065
1642
|
{
|
|
1066
1643
|
type: "button",
|
|
@@ -1069,123 +1646,123 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1069
1646
|
},
|
|
1070
1647
|
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",
|
|
1071
1648
|
"aria-label": "Close link preview",
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1649
|
+
children: /* @__PURE__ */ t(Ve, { className: "size-4 text-black/90" })
|
|
1073
1650
|
}
|
|
1074
1651
|
),
|
|
1075
1652
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
1076
|
-
|
|
1077
|
-
/* @__PURE__ */
|
|
1653
|
+
r && /* @__PURE__ */ t("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
|
|
1654
|
+
/* @__PURE__ */ t("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1078
1655
|
] })
|
|
1079
1656
|
]
|
|
1080
1657
|
}
|
|
1081
1658
|
);
|
|
1082
|
-
},
|
|
1083
|
-
const { linkPreviewsManager:
|
|
1084
|
-
|
|
1085
|
-
|
|
1659
|
+
}, kn = () => {
|
|
1660
|
+
const { linkPreviewsManager: e } = Xt(), { linkPreviews: s } = Zt(
|
|
1661
|
+
e.state,
|
|
1662
|
+
In
|
|
1086
1663
|
), n = (l) => {
|
|
1087
|
-
|
|
1664
|
+
e.dismissPreview(l);
|
|
1088
1665
|
};
|
|
1089
|
-
return s.length > 0 ? /* @__PURE__ */
|
|
1090
|
-
|
|
1666
|
+
return s.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ t(
|
|
1667
|
+
Sn,
|
|
1091
1668
|
{
|
|
1092
1669
|
link: l,
|
|
1093
1670
|
onDismiss: n
|
|
1094
1671
|
},
|
|
1095
1672
|
l.og_scrape_url
|
|
1096
1673
|
)) }) : null;
|
|
1097
|
-
},
|
|
1098
|
-
const { handleSubmit:
|
|
1099
|
-
return /* @__PURE__ */ i(
|
|
1100
|
-
/* @__PURE__ */
|
|
1674
|
+
}, Mn = () => {
|
|
1675
|
+
const { handleSubmit: e } = Jt(), s = Qt();
|
|
1676
|
+
return /* @__PURE__ */ i(oe, { children: [
|
|
1677
|
+
/* @__PURE__ */ t("div", { className: "left-container", children: /* @__PURE__ */ t(es, {}) }),
|
|
1101
1678
|
/* @__PURE__ */ i("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: [
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1679
|
+
/* @__PURE__ */ t(ts, {}),
|
|
1680
|
+
/* @__PURE__ */ t(kn, {}),
|
|
1681
|
+
/* @__PURE__ */ t(ss, {}),
|
|
1105
1682
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
|
|
1683
|
+
/* @__PURE__ */ t("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ t(
|
|
1684
|
+
ns,
|
|
1108
1685
|
{
|
|
1109
1686
|
className: "w-full resize-none outline-none leading-6",
|
|
1110
1687
|
autoFocus: !0,
|
|
1111
1688
|
maxRows: 4
|
|
1112
1689
|
}
|
|
1113
1690
|
) }),
|
|
1114
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ t(
|
|
1115
1692
|
"button",
|
|
1116
1693
|
{
|
|
1117
1694
|
"aria-label": "Send",
|
|
1118
1695
|
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
|
|
1119
1696
|
"data-testid": "send-button",
|
|
1120
1697
|
disabled: !s,
|
|
1121
|
-
onClick:
|
|
1698
|
+
onClick: e,
|
|
1122
1699
|
type: "button",
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1700
|
+
children: /* @__PURE__ */ t(Ms, { className: "size-4" })
|
|
1124
1701
|
}
|
|
1125
1702
|
)
|
|
1126
1703
|
] })
|
|
1127
1704
|
] })
|
|
1128
1705
|
] });
|
|
1129
|
-
},
|
|
1130
|
-
renderActions:
|
|
1706
|
+
}, Pn = ({
|
|
1707
|
+
renderActions: e
|
|
1131
1708
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
1132
|
-
|
|
1133
|
-
/* @__PURE__ */
|
|
1134
|
-
] }),
|
|
1709
|
+
e && (e == null ? void 0 : e()),
|
|
1710
|
+
/* @__PURE__ */ t(Kt, { Input: Mn })
|
|
1711
|
+
] }), Tn = [
|
|
1135
1712
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1136
1713
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1137
|
-
],
|
|
1714
|
+
], Rn = {
|
|
1138
1715
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1139
1716
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1140
|
-
},
|
|
1717
|
+
}, Dn = [
|
|
1141
1718
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1142
|
-
],
|
|
1719
|
+
], An = {
|
|
1143
1720
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1144
|
-
},
|
|
1145
|
-
var
|
|
1146
|
-
const s = (
|
|
1147
|
-
if (
|
|
1721
|
+
}, $e = "age safety guidelines.", Ln = "https://linktr.ee/s/about/contact", at = (e) => Tn.includes(e), On = (e) => Dn.includes(e), Un = (e) => {
|
|
1722
|
+
var r;
|
|
1723
|
+
const s = (r = e.metadata) == null ? void 0 : r.custom_type;
|
|
1724
|
+
if (at(s))
|
|
1148
1725
|
return {
|
|
1149
1726
|
kind: "dm-agent",
|
|
1150
1727
|
type: s
|
|
1151
1728
|
};
|
|
1152
|
-
if (
|
|
1729
|
+
if (On(s))
|
|
1153
1730
|
return {
|
|
1154
1731
|
kind: "age-safety",
|
|
1155
1732
|
type: s
|
|
1156
1733
|
};
|
|
1157
|
-
const n =
|
|
1158
|
-
if (
|
|
1734
|
+
const n = e.dm_agent_system_type;
|
|
1735
|
+
if (at(n))
|
|
1159
1736
|
return {
|
|
1160
1737
|
kind: "dm-agent",
|
|
1161
1738
|
type: n
|
|
1162
1739
|
};
|
|
1163
|
-
},
|
|
1164
|
-
const s =
|
|
1740
|
+
}, Fn = (e) => {
|
|
1741
|
+
const s = e.indexOf($e);
|
|
1165
1742
|
if (s === -1)
|
|
1166
|
-
return
|
|
1167
|
-
const n = s +
|
|
1168
|
-
return /* @__PURE__ */ i(
|
|
1169
|
-
|
|
1170
|
-
/* @__PURE__ */
|
|
1743
|
+
return e;
|
|
1744
|
+
const n = s + $e.length;
|
|
1745
|
+
return /* @__PURE__ */ i(oe, { children: [
|
|
1746
|
+
e.slice(0, s),
|
|
1747
|
+
/* @__PURE__ */ t(
|
|
1171
1748
|
"a",
|
|
1172
1749
|
{
|
|
1173
|
-
href:
|
|
1750
|
+
href: Ln,
|
|
1174
1751
|
target: "_blank",
|
|
1175
1752
|
rel: "noopener noreferrer",
|
|
1176
1753
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1177
|
-
children:
|
|
1754
|
+
children: $e
|
|
1178
1755
|
}
|
|
1179
1756
|
),
|
|
1180
|
-
|
|
1757
|
+
e.slice(n)
|
|
1181
1758
|
] });
|
|
1182
|
-
},
|
|
1183
|
-
var
|
|
1184
|
-
const s =
|
|
1185
|
-
|
|
1759
|
+
}, $n = (e) => {
|
|
1760
|
+
var r, l;
|
|
1761
|
+
const s = e.message.hide_date === !0, n = Un(
|
|
1762
|
+
e.message
|
|
1186
1763
|
);
|
|
1187
1764
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1188
|
-
const
|
|
1765
|
+
const c = ((r = e.message.text) == null ? void 0 : r.trim()) || Rn[n.type];
|
|
1189
1766
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1190
1767
|
/* @__PURE__ */ i(
|
|
1191
1768
|
"div",
|
|
@@ -1194,8 +1771,8 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1194
1771
|
"data-testid": "dm-agent-system-message",
|
|
1195
1772
|
"data-dm-agent-system-type": n.type,
|
|
1196
1773
|
children: [
|
|
1197
|
-
/* @__PURE__ */
|
|
1198
|
-
|
|
1774
|
+
/* @__PURE__ */ t(
|
|
1775
|
+
Ps,
|
|
1199
1776
|
{
|
|
1200
1777
|
size: 16,
|
|
1201
1778
|
weight: "regular",
|
|
@@ -1203,15 +1780,15 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1203
1780
|
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1204
1781
|
}
|
|
1205
1782
|
),
|
|
1206
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ t("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: c })
|
|
1207
1784
|
]
|
|
1208
1785
|
}
|
|
1209
1786
|
),
|
|
1210
|
-
!s && /* @__PURE__ */
|
|
1787
|
+
!s && /* @__PURE__ */ t(Ue, { message: e.message })
|
|
1211
1788
|
] });
|
|
1212
1789
|
}
|
|
1213
1790
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1214
|
-
const
|
|
1791
|
+
const c = ((l = e.message.text) == null ? void 0 : l.trim()) || An[n.type];
|
|
1215
1792
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1216
1793
|
/* @__PURE__ */ i(
|
|
1217
1794
|
"div",
|
|
@@ -1220,8 +1797,8 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1220
1797
|
"data-testid": "age-safety-system-message",
|
|
1221
1798
|
"data-age-safety-system-type": n.type,
|
|
1222
1799
|
children: [
|
|
1223
|
-
/* @__PURE__ */
|
|
1224
|
-
|
|
1800
|
+
/* @__PURE__ */ t(
|
|
1801
|
+
Ts,
|
|
1225
1802
|
{
|
|
1226
1803
|
size: 24,
|
|
1227
1804
|
weight: "duotone",
|
|
@@ -1230,28 +1807,28 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1230
1807
|
"data-testid": "age-safety-system-message-icon"
|
|
1231
1808
|
}
|
|
1232
1809
|
),
|
|
1233
|
-
/* @__PURE__ */
|
|
1810
|
+
/* @__PURE__ */ t("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ t("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: Fn(c) }) })
|
|
1234
1811
|
]
|
|
1235
1812
|
}
|
|
1236
1813
|
),
|
|
1237
|
-
!s && /* @__PURE__ */
|
|
1814
|
+
!s && /* @__PURE__ */ t(Ue, { message: e.message })
|
|
1238
1815
|
] });
|
|
1239
1816
|
}
|
|
1240
1817
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1241
1818
|
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
/* @__PURE__ */
|
|
1819
|
+
/* @__PURE__ */ t("div", { className: "str-chat__message--system__line" }),
|
|
1820
|
+
/* @__PURE__ */ t("p", { children: e.message.text }),
|
|
1821
|
+
/* @__PURE__ */ t("div", { className: "str-chat__message--system__line" })
|
|
1245
1822
|
] }),
|
|
1246
|
-
!s && /* @__PURE__ */
|
|
1823
|
+
!s && /* @__PURE__ */ t(Ue, { message: e.message })
|
|
1247
1824
|
] });
|
|
1248
|
-
},
|
|
1825
|
+
}, zn = () => null, jn = ({ className: e, message: s }) => /* @__PURE__ */ i(
|
|
1249
1826
|
"div",
|
|
1250
1827
|
{
|
|
1251
|
-
className:
|
|
1828
|
+
className: F("flex items-center justify-center h-full", e),
|
|
1252
1829
|
children: [
|
|
1253
1830
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1254
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ t("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ t(
|
|
1255
1832
|
"animateTransform",
|
|
1256
1833
|
{
|
|
1257
1834
|
attributeName: "transform",
|
|
@@ -1262,7 +1839,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1262
1839
|
begin: "0.1"
|
|
1263
1840
|
}
|
|
1264
1841
|
) }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ t("circle", { cx: "30", cy: "50", r: "6", children: /* @__PURE__ */ t(
|
|
1266
1843
|
"animateTransform",
|
|
1267
1844
|
{
|
|
1268
1845
|
attributeName: "transform",
|
|
@@ -1273,7 +1850,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1273
1850
|
begin: "0.2"
|
|
1274
1851
|
}
|
|
1275
1852
|
) }),
|
|
1276
|
-
/* @__PURE__ */
|
|
1853
|
+
/* @__PURE__ */ t("circle", { cx: "54", cy: "50", r: "6", children: /* @__PURE__ */ t(
|
|
1277
1854
|
"animateTransform",
|
|
1278
1855
|
{
|
|
1279
1856
|
attributeName: "transform",
|
|
@@ -1285,227 +1862,231 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1285
1862
|
}
|
|
1286
1863
|
) })
|
|
1287
1864
|
] }),
|
|
1288
|
-
s && /* @__PURE__ */
|
|
1865
|
+
s && /* @__PURE__ */ t("span", { className: "text-stone", children: s })
|
|
1289
1866
|
]
|
|
1290
1867
|
}
|
|
1291
|
-
),
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
/* @__PURE__ */
|
|
1868
|
+
), Pe = L.memo(() => /* @__PURE__ */ t("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1869
|
+
/* @__PURE__ */ t(jn, { className: "w-6 h-6" }),
|
|
1870
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1294
1871
|
] }) }));
|
|
1295
|
-
|
|
1296
|
-
const
|
|
1297
|
-
onBack:
|
|
1872
|
+
Pe.displayName = "LoadingState";
|
|
1873
|
+
const ge = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Bn = ({
|
|
1874
|
+
onBack: e,
|
|
1298
1875
|
showBackButton: s,
|
|
1299
1876
|
onShowInfo: n,
|
|
1300
|
-
canShowInfo:
|
|
1877
|
+
canShowInfo: r,
|
|
1301
1878
|
showStarButton: l = !1
|
|
1302
1879
|
}) => {
|
|
1303
|
-
var
|
|
1304
|
-
const { channel:
|
|
1305
|
-
(
|
|
1306
|
-
var
|
|
1307
|
-
return ((
|
|
1880
|
+
var m, y, u, _, o;
|
|
1881
|
+
const { channel: c } = Te(), a = L.useMemo(() => Object.values(c.state.members || {}).find(
|
|
1882
|
+
(P) => {
|
|
1883
|
+
var C;
|
|
1884
|
+
return ((C = P.user) == null ? void 0 : C.id) && P.user.id !== c._client.userID;
|
|
1308
1885
|
}
|
|
1309
|
-
), [
|
|
1886
|
+
), [c._client.userID, c.state.members]), d = ((m = a == null ? void 0 : a.user) == null ? void 0 : m.name) || ((y = a == null ? void 0 : a.user) == null ? void 0 : y.id) || "Unknown member", b = (u = a == null ? void 0 : a.user) == null ? void 0 : u.image, f = dt(c), x = async () => {
|
|
1310
1887
|
try {
|
|
1311
|
-
|
|
1312
|
-
} catch (
|
|
1888
|
+
f ? await c.unpin() : await c.pin();
|
|
1889
|
+
} catch (N) {
|
|
1313
1890
|
console.error(
|
|
1314
1891
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1315
|
-
|
|
1892
|
+
N
|
|
1316
1893
|
);
|
|
1317
1894
|
}
|
|
1318
1895
|
};
|
|
1319
1896
|
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
1320
1897
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden", children: [
|
|
1321
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ t(
|
|
1322
1899
|
"button",
|
|
1323
1900
|
{
|
|
1324
|
-
className:
|
|
1325
|
-
onClick:
|
|
1901
|
+
className: ge,
|
|
1902
|
+
onClick: e || (() => {
|
|
1326
1903
|
}),
|
|
1327
1904
|
type: "button",
|
|
1328
1905
|
"aria-label": "Back to conversations",
|
|
1329
|
-
children: /* @__PURE__ */
|
|
1906
|
+
children: /* @__PURE__ */ t(Ze, { className: "size-5 text-black/90" })
|
|
1330
1907
|
}
|
|
1331
1908
|
) }),
|
|
1332
1909
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
|
|
1910
|
+
/* @__PURE__ */ t(
|
|
1911
|
+
me,
|
|
1335
1912
|
{
|
|
1336
|
-
id: ((
|
|
1337
|
-
name:
|
|
1338
|
-
image:
|
|
1339
|
-
starred:
|
|
1913
|
+
id: ((_ = a == null ? void 0 : a.user) == null ? void 0 : _.id) || c.id || "unknown",
|
|
1914
|
+
name: d,
|
|
1915
|
+
image: b,
|
|
1916
|
+
starred: l && f,
|
|
1340
1917
|
size: 40
|
|
1341
1918
|
}
|
|
1342
1919
|
),
|
|
1343
|
-
/* @__PURE__ */
|
|
1920
|
+
/* @__PURE__ */ t("h1", { className: "text-xs font-medium text-black/90", children: d })
|
|
1344
1921
|
] }),
|
|
1345
1922
|
/* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
|
|
1346
|
-
l && /* @__PURE__ */
|
|
1923
|
+
l && /* @__PURE__ */ t(
|
|
1347
1924
|
"button",
|
|
1348
1925
|
{
|
|
1349
|
-
className:
|
|
1350
|
-
onClick:
|
|
1926
|
+
className: ge,
|
|
1927
|
+
onClick: x,
|
|
1351
1928
|
type: "button",
|
|
1352
|
-
"aria-label":
|
|
1353
|
-
children: /* @__PURE__ */
|
|
1354
|
-
|
|
1929
|
+
"aria-label": f ? "Unstar conversation" : "Star conversation",
|
|
1930
|
+
children: /* @__PURE__ */ t(
|
|
1931
|
+
je,
|
|
1355
1932
|
{
|
|
1356
|
-
className:
|
|
1357
|
-
"text-yellow-600":
|
|
1358
|
-
"text-black/90": !
|
|
1933
|
+
className: F("size-5", {
|
|
1934
|
+
"text-yellow-600": f,
|
|
1935
|
+
"text-black/90": !f
|
|
1359
1936
|
}),
|
|
1360
|
-
weight:
|
|
1937
|
+
weight: f ? "duotone" : "regular"
|
|
1361
1938
|
}
|
|
1362
1939
|
)
|
|
1363
1940
|
}
|
|
1364
1941
|
),
|
|
1365
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ t(
|
|
1366
1943
|
"button",
|
|
1367
1944
|
{
|
|
1368
|
-
className:
|
|
1945
|
+
className: ge,
|
|
1369
1946
|
onClick: n,
|
|
1370
1947
|
type: "button",
|
|
1371
1948
|
"aria-label": "Show info",
|
|
1372
|
-
children: /* @__PURE__ */
|
|
1949
|
+
children: /* @__PURE__ */ t(Ke, { className: "size-5 text-black/90" })
|
|
1373
1950
|
}
|
|
1374
1951
|
)
|
|
1375
1952
|
] })
|
|
1376
1953
|
] }),
|
|
1377
1954
|
/* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
1378
1955
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1379
|
-
s &&
|
|
1956
|
+
s && e && /* @__PURE__ */ t(
|
|
1380
1957
|
"button",
|
|
1381
1958
|
{
|
|
1382
1959
|
type: "button",
|
|
1383
|
-
onClick:
|
|
1384
|
-
className:
|
|
1960
|
+
onClick: e,
|
|
1961
|
+
className: ge,
|
|
1385
1962
|
"aria-label": "Back to conversations",
|
|
1386
|
-
children: /* @__PURE__ */
|
|
1963
|
+
children: /* @__PURE__ */ t(Ze, { className: "size-5 text-black/90" })
|
|
1387
1964
|
}
|
|
1388
1965
|
),
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
|
|
1966
|
+
/* @__PURE__ */ t(
|
|
1967
|
+
me,
|
|
1391
1968
|
{
|
|
1392
|
-
id: ((
|
|
1393
|
-
name:
|
|
1394
|
-
image:
|
|
1395
|
-
starred:
|
|
1969
|
+
id: ((o = a == null ? void 0 : a.user) == null ? void 0 : o.id) || c.id || "unknown",
|
|
1970
|
+
name: d,
|
|
1971
|
+
image: b,
|
|
1972
|
+
starred: l && f,
|
|
1396
1973
|
size: 40
|
|
1397
1974
|
}
|
|
1398
1975
|
),
|
|
1399
|
-
/* @__PURE__ */
|
|
1976
|
+
/* @__PURE__ */ t("div", { className: "min-w-0", children: /* @__PURE__ */ t("h1", { className: "font-medium text-black/90 truncate", children: d }) })
|
|
1400
1977
|
] }),
|
|
1401
1978
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1402
|
-
l && /* @__PURE__ */
|
|
1979
|
+
l && /* @__PURE__ */ t(
|
|
1403
1980
|
"button",
|
|
1404
1981
|
{
|
|
1405
|
-
className:
|
|
1406
|
-
onClick:
|
|
1982
|
+
className: ge,
|
|
1983
|
+
onClick: x,
|
|
1407
1984
|
type: "button",
|
|
1408
|
-
"aria-label":
|
|
1409
|
-
children: /* @__PURE__ */
|
|
1410
|
-
|
|
1985
|
+
"aria-label": f ? "Unstar conversation" : "Star conversation",
|
|
1986
|
+
children: /* @__PURE__ */ t(
|
|
1987
|
+
je,
|
|
1411
1988
|
{
|
|
1412
|
-
className:
|
|
1413
|
-
"text-yellow-600":
|
|
1414
|
-
"text-black/90": !
|
|
1989
|
+
className: F("size-5", {
|
|
1990
|
+
"text-yellow-600": f,
|
|
1991
|
+
"text-black/90": !f
|
|
1415
1992
|
}),
|
|
1416
|
-
weight:
|
|
1993
|
+
weight: f ? "duotone" : "regular"
|
|
1417
1994
|
}
|
|
1418
1995
|
)
|
|
1419
1996
|
}
|
|
1420
1997
|
),
|
|
1421
|
-
|
|
1998
|
+
r && n && /* @__PURE__ */ t(
|
|
1422
1999
|
"button",
|
|
1423
2000
|
{
|
|
1424
|
-
className:
|
|
2001
|
+
className: ge,
|
|
1425
2002
|
onClick: n,
|
|
1426
2003
|
type: "button",
|
|
1427
2004
|
"aria-label": "Show info",
|
|
1428
|
-
children: /* @__PURE__ */
|
|
2005
|
+
children: /* @__PURE__ */ t(Ke, { className: "size-5 text-black/90" })
|
|
1429
2006
|
}
|
|
1430
2007
|
)
|
|
1431
2008
|
] })
|
|
1432
2009
|
] })
|
|
1433
2010
|
] });
|
|
1434
|
-
},
|
|
1435
|
-
onBack:
|
|
2011
|
+
}, Hn = ({
|
|
2012
|
+
onBack: e,
|
|
1436
2013
|
showBackButton: s,
|
|
1437
2014
|
renderMessageInputActions: n,
|
|
1438
|
-
renderConversationFooter:
|
|
2015
|
+
renderConversationFooter: r,
|
|
1439
2016
|
onLeaveConversation: l,
|
|
1440
|
-
onBlockParticipant:
|
|
2017
|
+
onBlockParticipant: c,
|
|
1441
2018
|
showDeleteConversation: a = !0,
|
|
1442
|
-
onDeleteConversationClick:
|
|
1443
|
-
onBlockParticipantClick:
|
|
1444
|
-
onReportParticipantClick:
|
|
1445
|
-
showStarButton:
|
|
1446
|
-
chatbotVotingEnabled:
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
2019
|
+
onDeleteConversationClick: d,
|
|
2020
|
+
onBlockParticipantClick: b,
|
|
2021
|
+
onReportParticipantClick: f,
|
|
2022
|
+
showStarButton: x = !1,
|
|
2023
|
+
chatbotVotingEnabled: m = !1,
|
|
2024
|
+
onAttachmentUnlock: y,
|
|
2025
|
+
onAttachmentDownload: u,
|
|
2026
|
+
renderChannelBanner: _,
|
|
2027
|
+
customProfileContent: o,
|
|
2028
|
+
customChannelActions: N,
|
|
2029
|
+
renderMessage: P
|
|
1451
2030
|
}) => {
|
|
1452
|
-
const { channel: C } = Te(),
|
|
1453
|
-
(
|
|
1454
|
-
var
|
|
1455
|
-
return ((
|
|
2031
|
+
const { channel: C } = Te(), S = W(null), M = L.useMemo(() => Object.values(C.state.members || {}).find(
|
|
2032
|
+
(I) => {
|
|
2033
|
+
var v;
|
|
2034
|
+
return ((v = I.user) == null ? void 0 : v.id) && I.user.id !== C._client.userID;
|
|
1456
2035
|
}
|
|
1457
|
-
), [C._client.userID, C.state.members]),
|
|
1458
|
-
const
|
|
1459
|
-
if (
|
|
1460
|
-
return String(
|
|
1461
|
-
if (
|
|
1462
|
-
return
|
|
1463
|
-
}, [C.data]),
|
|
1464
|
-
var
|
|
1465
|
-
(
|
|
1466
|
-
}, []),
|
|
1467
|
-
var
|
|
1468
|
-
(
|
|
2036
|
+
), [C._client.userID, C.state.members]), R = L.useMemo(() => {
|
|
2037
|
+
const g = C.data ?? {};
|
|
2038
|
+
if (g.followerStatus)
|
|
2039
|
+
return String(g.followerStatus);
|
|
2040
|
+
if (g.isFollower !== void 0)
|
|
2041
|
+
return g.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
2042
|
+
}, [C.data]), p = U(() => {
|
|
2043
|
+
var g;
|
|
2044
|
+
(g = S.current) == null || g.showModal();
|
|
2045
|
+
}, []), h = U(() => {
|
|
2046
|
+
var g;
|
|
2047
|
+
(g = S.current) == null || g.close();
|
|
1469
2048
|
}, []);
|
|
1470
|
-
return /* @__PURE__ */ i(
|
|
1471
|
-
/* @__PURE__ */
|
|
1472
|
-
|
|
2049
|
+
return /* @__PURE__ */ i(oe, { children: [
|
|
2050
|
+
/* @__PURE__ */ t(
|
|
2051
|
+
rs,
|
|
1473
2052
|
{
|
|
1474
2053
|
overrides: {
|
|
1475
|
-
Message: (
|
|
1476
|
-
const { message:
|
|
1477
|
-
|
|
2054
|
+
Message: (g) => {
|
|
2055
|
+
const { message: I } = lt("ChannelView"), v = /* @__PURE__ */ t(
|
|
2056
|
+
En,
|
|
1478
2057
|
{
|
|
1479
|
-
...
|
|
1480
|
-
chatbotVotingEnabled:
|
|
2058
|
+
...g,
|
|
2059
|
+
chatbotVotingEnabled: m,
|
|
2060
|
+
onAttachmentUnlock: y,
|
|
2061
|
+
onAttachmentDownload: u
|
|
1481
2062
|
}
|
|
1482
2063
|
);
|
|
1483
|
-
return !
|
|
2064
|
+
return !P || !I ? v : P(v, I);
|
|
1484
2065
|
}
|
|
1485
2066
|
},
|
|
1486
|
-
children: /* @__PURE__ */ i(
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
|
|
2067
|
+
children: /* @__PURE__ */ i(ls, { children: [
|
|
2068
|
+
/* @__PURE__ */ t("div", { className: "p-4", children: /* @__PURE__ */ t(
|
|
2069
|
+
Bn,
|
|
1489
2070
|
{
|
|
1490
|
-
onBack:
|
|
2071
|
+
onBack: e,
|
|
1491
2072
|
showBackButton: s,
|
|
1492
|
-
onShowInfo:
|
|
1493
|
-
canShowInfo: !!
|
|
1494
|
-
showStarButton:
|
|
2073
|
+
onShowInfo: p,
|
|
2074
|
+
canShowInfo: !!M,
|
|
2075
|
+
showStarButton: x
|
|
1495
2076
|
}
|
|
1496
2077
|
) }),
|
|
1497
|
-
|
|
1498
|
-
/* @__PURE__ */
|
|
1499
|
-
|
|
2078
|
+
_ == null ? void 0 : _(),
|
|
2079
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ t(
|
|
2080
|
+
os,
|
|
1500
2081
|
{
|
|
1501
2082
|
hideDeletedMessages: !0,
|
|
1502
2083
|
hideNewMessageSeparator: !1,
|
|
1503
2084
|
messageActions: void 0
|
|
1504
2085
|
}
|
|
1505
2086
|
) }),
|
|
1506
|
-
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
|
|
2087
|
+
r == null ? void 0 : r(C),
|
|
2088
|
+
/* @__PURE__ */ t(
|
|
2089
|
+
Pn,
|
|
1509
2090
|
{
|
|
1510
2091
|
renderActions: () => n == null ? void 0 : n(C)
|
|
1511
2092
|
}
|
|
@@ -1513,106 +2094,110 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1513
2094
|
] })
|
|
1514
2095
|
}
|
|
1515
2096
|
),
|
|
1516
|
-
/* @__PURE__ */
|
|
1517
|
-
|
|
2097
|
+
/* @__PURE__ */ t(
|
|
2098
|
+
Ys,
|
|
1518
2099
|
{
|
|
1519
|
-
dialogRef:
|
|
1520
|
-
onClose:
|
|
1521
|
-
participant:
|
|
2100
|
+
dialogRef: S,
|
|
2101
|
+
onClose: h,
|
|
2102
|
+
participant: M,
|
|
1522
2103
|
channel: C,
|
|
1523
|
-
followerStatusLabel:
|
|
2104
|
+
followerStatusLabel: R,
|
|
1524
2105
|
onLeaveConversation: l,
|
|
1525
|
-
onBlockParticipant:
|
|
2106
|
+
onBlockParticipant: c,
|
|
1526
2107
|
showDeleteConversation: a,
|
|
1527
|
-
onDeleteConversationClick:
|
|
1528
|
-
onBlockParticipantClick:
|
|
1529
|
-
onReportParticipantClick:
|
|
1530
|
-
customProfileContent:
|
|
1531
|
-
customChannelActions:
|
|
2108
|
+
onDeleteConversationClick: d,
|
|
2109
|
+
onBlockParticipantClick: b,
|
|
2110
|
+
onReportParticipantClick: f,
|
|
2111
|
+
customProfileContent: o,
|
|
2112
|
+
customChannelActions: N
|
|
1532
2113
|
}
|
|
1533
2114
|
)
|
|
1534
2115
|
] });
|
|
1535
|
-
},
|
|
2116
|
+
}, pt = L.memo(
|
|
1536
2117
|
({
|
|
1537
|
-
channel:
|
|
2118
|
+
channel: e,
|
|
1538
2119
|
onBack: s,
|
|
1539
2120
|
showBackButton: n = !1,
|
|
1540
|
-
renderMessageInputActions:
|
|
2121
|
+
renderMessageInputActions: r,
|
|
1541
2122
|
renderConversationFooter: l,
|
|
1542
|
-
onLeaveConversation:
|
|
2123
|
+
onLeaveConversation: c,
|
|
1543
2124
|
onBlockParticipant: a,
|
|
1544
|
-
className:
|
|
1545
|
-
CustomChannelEmptyState:
|
|
1546
|
-
showDeleteConversation:
|
|
1547
|
-
onDeleteConversationClick:
|
|
1548
|
-
onBlockParticipantClick:
|
|
1549
|
-
onReportParticipantClick:
|
|
1550
|
-
dmAgentEnabled:
|
|
1551
|
-
messageMetadata:
|
|
1552
|
-
onMessageSent:
|
|
1553
|
-
showStarButton:
|
|
1554
|
-
chatbotVotingEnabled:
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
2125
|
+
className: d,
|
|
2126
|
+
CustomChannelEmptyState: b = zn,
|
|
2127
|
+
showDeleteConversation: f = !0,
|
|
2128
|
+
onDeleteConversationClick: x,
|
|
2129
|
+
onBlockParticipantClick: m,
|
|
2130
|
+
onReportParticipantClick: y,
|
|
2131
|
+
dmAgentEnabled: u,
|
|
2132
|
+
messageMetadata: _,
|
|
2133
|
+
onMessageSent: o,
|
|
2134
|
+
showStarButton: N = !1,
|
|
2135
|
+
chatbotVotingEnabled: P = !1,
|
|
2136
|
+
onAttachmentUnlock: C,
|
|
2137
|
+
onAttachmentDownload: S,
|
|
2138
|
+
renderChannelBanner: M,
|
|
2139
|
+
customProfileContent: R,
|
|
2140
|
+
customChannelActions: p,
|
|
2141
|
+
renderMessage: h
|
|
1559
2142
|
}) => {
|
|
1560
|
-
const
|
|
1561
|
-
async (
|
|
1562
|
-
var
|
|
1563
|
-
const
|
|
1564
|
-
...
|
|
1565
|
-
...
|
|
1566
|
-
...
|
|
2143
|
+
const g = U(
|
|
2144
|
+
async (I, v, w) => {
|
|
2145
|
+
var z;
|
|
2146
|
+
const A = ((z = e.data) == null ? void 0 : z.chatbot_paused) === !0, G = u && !A, $ = {
|
|
2147
|
+
...v,
|
|
2148
|
+
...G && { silent: !0 },
|
|
2149
|
+
..._ && {
|
|
1567
2150
|
metadata: {
|
|
1568
|
-
...
|
|
1569
|
-
...
|
|
2151
|
+
...v.metadata ?? {},
|
|
2152
|
+
..._
|
|
1570
2153
|
}
|
|
1571
2154
|
}
|
|
1572
2155
|
}, Z = {
|
|
1573
|
-
...
|
|
1574
|
-
...
|
|
1575
|
-
},
|
|
1576
|
-
return
|
|
2156
|
+
...w,
|
|
2157
|
+
...G && { skip_push: !0 }
|
|
2158
|
+
}, D = await e.sendMessage($, Z);
|
|
2159
|
+
return o == null || o(D), D;
|
|
1577
2160
|
},
|
|
1578
|
-
[
|
|
2161
|
+
[e, u, _, o]
|
|
1579
2162
|
);
|
|
1580
|
-
return /* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ t(
|
|
1581
2164
|
"div",
|
|
1582
2165
|
{
|
|
1583
|
-
className:
|
|
2166
|
+
className: F(
|
|
1584
2167
|
"messaging-channel-view h-full flex flex-col",
|
|
1585
|
-
|
|
2168
|
+
d
|
|
1586
2169
|
),
|
|
1587
|
-
children: /* @__PURE__ */
|
|
1588
|
-
|
|
2170
|
+
children: /* @__PURE__ */ t(
|
|
2171
|
+
as,
|
|
1589
2172
|
{
|
|
1590
|
-
channel:
|
|
1591
|
-
MessageSystem:
|
|
1592
|
-
EmptyStateIndicator:
|
|
1593
|
-
LoadingIndicator:
|
|
1594
|
-
DateSeparator:
|
|
1595
|
-
doSendMessageRequest:
|
|
1596
|
-
children: /* @__PURE__ */
|
|
1597
|
-
|
|
2173
|
+
channel: e,
|
|
2174
|
+
MessageSystem: $n,
|
|
2175
|
+
EmptyStateIndicator: b,
|
|
2176
|
+
LoadingIndicator: Pe,
|
|
2177
|
+
DateSeparator: Ws,
|
|
2178
|
+
doSendMessageRequest: g,
|
|
2179
|
+
children: /* @__PURE__ */ t(
|
|
2180
|
+
Hn,
|
|
1598
2181
|
{
|
|
1599
2182
|
onBack: s,
|
|
1600
2183
|
showBackButton: n,
|
|
1601
|
-
renderMessageInputActions:
|
|
2184
|
+
renderMessageInputActions: r,
|
|
1602
2185
|
renderConversationFooter: l,
|
|
1603
|
-
onLeaveConversation:
|
|
2186
|
+
onLeaveConversation: c,
|
|
1604
2187
|
onBlockParticipant: a,
|
|
1605
|
-
CustomChannelEmptyState:
|
|
1606
|
-
showDeleteConversation:
|
|
1607
|
-
onDeleteConversationClick:
|
|
1608
|
-
onBlockParticipantClick:
|
|
1609
|
-
onReportParticipantClick:
|
|
1610
|
-
showStarButton:
|
|
1611
|
-
chatbotVotingEnabled:
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
2188
|
+
CustomChannelEmptyState: b,
|
|
2189
|
+
showDeleteConversation: f,
|
|
2190
|
+
onDeleteConversationClick: x,
|
|
2191
|
+
onBlockParticipantClick: m,
|
|
2192
|
+
onReportParticipantClick: y,
|
|
2193
|
+
showStarButton: N,
|
|
2194
|
+
chatbotVotingEnabled: P,
|
|
2195
|
+
onAttachmentUnlock: C,
|
|
2196
|
+
onAttachmentDownload: S,
|
|
2197
|
+
renderChannelBanner: M,
|
|
2198
|
+
customProfileContent: R,
|
|
2199
|
+
customChannelActions: p,
|
|
2200
|
+
renderMessage: h
|
|
1616
2201
|
}
|
|
1617
2202
|
)
|
|
1618
2203
|
}
|
|
@@ -1621,184 +2206,184 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1621
2206
|
);
|
|
1622
2207
|
}
|
|
1623
2208
|
);
|
|
1624
|
-
|
|
1625
|
-
function
|
|
1626
|
-
searchQuery:
|
|
2209
|
+
pt.displayName = "ChannelView";
|
|
2210
|
+
function Gn({
|
|
2211
|
+
searchQuery: e,
|
|
1627
2212
|
setSearchQuery: s,
|
|
1628
2213
|
placeholder: n
|
|
1629
2214
|
}) {
|
|
1630
|
-
const
|
|
2215
|
+
const r = W(null);
|
|
1631
2216
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
|
|
2217
|
+
/* @__PURE__ */ t(
|
|
2218
|
+
Rs,
|
|
1634
2219
|
{
|
|
1635
2220
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1636
2221
|
weight: "bold"
|
|
1637
2222
|
}
|
|
1638
2223
|
),
|
|
1639
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ t(
|
|
1640
2225
|
"input",
|
|
1641
2226
|
{
|
|
1642
|
-
ref:
|
|
2227
|
+
ref: r,
|
|
1643
2228
|
type: "text",
|
|
1644
2229
|
placeholder: n,
|
|
1645
|
-
value:
|
|
2230
|
+
value: e,
|
|
1646
2231
|
onChange: (l) => s(l.target.value),
|
|
1647
2232
|
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"
|
|
1648
2233
|
}
|
|
1649
2234
|
),
|
|
1650
|
-
|
|
1651
|
-
|
|
2235
|
+
e && /* @__PURE__ */ t(
|
|
2236
|
+
ft,
|
|
1652
2237
|
{
|
|
1653
2238
|
label: "Clear search",
|
|
1654
2239
|
onClick: () => {
|
|
1655
2240
|
var l;
|
|
1656
|
-
s(""), (l =
|
|
2241
|
+
s(""), (l = r.current) == null || l.focus();
|
|
1657
2242
|
},
|
|
1658
2243
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1659
|
-
children: /* @__PURE__ */
|
|
2244
|
+
children: /* @__PURE__ */ t(Ve, { className: "h-4 w-4", weight: "bold" })
|
|
1660
2245
|
}
|
|
1661
2246
|
)
|
|
1662
2247
|
] });
|
|
1663
2248
|
}
|
|
1664
|
-
const
|
|
1665
|
-
participantSource:
|
|
2249
|
+
const Vn = ({
|
|
2250
|
+
participantSource: e,
|
|
1666
2251
|
onSelectParticipant: s,
|
|
1667
2252
|
onClose: n,
|
|
1668
|
-
existingParticipantIds:
|
|
2253
|
+
existingParticipantIds: r = /* @__PURE__ */ new Set(),
|
|
1669
2254
|
participantLabel: l = "participants",
|
|
1670
|
-
searchPlaceholder:
|
|
2255
|
+
searchPlaceholder: c = "Search participants...",
|
|
1671
2256
|
className: a
|
|
1672
2257
|
}) => {
|
|
1673
|
-
const { debug:
|
|
2258
|
+
const { debug: d } = Re(), [b, f] = k(""), [x, m] = k([]), [y, u] = k(!1), [_, o] = k(null), [N, P] = k(
|
|
1674
2259
|
null
|
|
1675
|
-
),
|
|
1676
|
-
|
|
1677
|
-
if (
|
|
1678
|
-
|
|
2260
|
+
), C = W(!1);
|
|
2261
|
+
V(() => {
|
|
2262
|
+
if (e.loading) {
|
|
2263
|
+
d && console.log(
|
|
1679
2264
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1680
2265
|
);
|
|
1681
2266
|
return;
|
|
1682
2267
|
}
|
|
1683
|
-
if (
|
|
2268
|
+
if (C.current) return;
|
|
1684
2269
|
(async () => {
|
|
1685
|
-
|
|
2270
|
+
d && console.log("[ParticipantPicker] Loading initial participants..."), u(!0), o(null);
|
|
1686
2271
|
try {
|
|
1687
|
-
const
|
|
2272
|
+
const h = await e.loadParticipants({
|
|
1688
2273
|
search: "",
|
|
1689
2274
|
// Load all participants initially
|
|
1690
2275
|
limit: 100
|
|
1691
2276
|
});
|
|
1692
|
-
|
|
2277
|
+
m(h.participants), C.current = !0, d && console.log(
|
|
1693
2278
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1694
|
-
|
|
2279
|
+
h.participants.length
|
|
1695
2280
|
);
|
|
1696
|
-
} catch (
|
|
1697
|
-
const
|
|
1698
|
-
|
|
2281
|
+
} catch (h) {
|
|
2282
|
+
const g = h instanceof Error ? h.message : "Failed to load participants";
|
|
2283
|
+
o(g), console.error("[ParticipantPicker] Failed to load participants:", h);
|
|
1699
2284
|
} finally {
|
|
1700
|
-
|
|
2285
|
+
u(!1);
|
|
1701
2286
|
}
|
|
1702
2287
|
})();
|
|
1703
|
-
}, [
|
|
1704
|
-
const
|
|
1705
|
-
var
|
|
1706
|
-
if (!
|
|
1707
|
-
const
|
|
1708
|
-
return
|
|
1709
|
-
}),
|
|
1710
|
-
async (
|
|
1711
|
-
if (!
|
|
1712
|
-
|
|
2288
|
+
}, [e.loading, d]);
|
|
2289
|
+
const S = x.filter((p) => !r.has(p.id)).filter((p) => {
|
|
2290
|
+
var g;
|
|
2291
|
+
if (!b) return !0;
|
|
2292
|
+
const h = b.toLowerCase();
|
|
2293
|
+
return p.name.toLowerCase().includes(h) || ((g = p.email) == null ? void 0 : g.toLowerCase().includes(h)) || !1;
|
|
2294
|
+
}), M = U(
|
|
2295
|
+
async (p) => {
|
|
2296
|
+
if (!N) {
|
|
2297
|
+
P(p.id);
|
|
1713
2298
|
try {
|
|
1714
|
-
await s(
|
|
1715
|
-
} catch (
|
|
1716
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
2299
|
+
await s(p);
|
|
2300
|
+
} catch (h) {
|
|
2301
|
+
console.error("[ParticipantPicker] Failed to start chat:", h), P(null);
|
|
1717
2302
|
}
|
|
1718
2303
|
}
|
|
1719
2304
|
},
|
|
1720
|
-
[s,
|
|
1721
|
-
),
|
|
1722
|
-
(
|
|
2305
|
+
[s, N]
|
|
2306
|
+
), R = (p, h) => {
|
|
2307
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), M(h));
|
|
1723
2308
|
};
|
|
1724
|
-
return /* @__PURE__ */ i("div", { className:
|
|
2309
|
+
return /* @__PURE__ */ i("div", { className: F("flex flex-col h-full", a), children: [
|
|
1725
2310
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1726
2311
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1727
|
-
/* @__PURE__ */
|
|
1728
|
-
/* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ t("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
2313
|
+
/* @__PURE__ */ t(gt, { onClick: n })
|
|
1729
2314
|
] }),
|
|
1730
2315
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1731
2316
|
"Select a ",
|
|
1732
2317
|
l.slice(0, -1),
|
|
1733
2318
|
" to start messaging (",
|
|
1734
|
-
|
|
2319
|
+
S.length,
|
|
1735
2320
|
" available)",
|
|
1736
|
-
|
|
2321
|
+
e.totalCount !== void 0 && ` • ${e.totalCount} ${l} total`
|
|
1737
2322
|
] }),
|
|
1738
|
-
/* @__PURE__ */
|
|
1739
|
-
|
|
2323
|
+
/* @__PURE__ */ t(
|
|
2324
|
+
Gn,
|
|
1740
2325
|
{
|
|
1741
|
-
searchQuery:
|
|
1742
|
-
setSearchQuery:
|
|
1743
|
-
placeholder:
|
|
2326
|
+
searchQuery: b,
|
|
2327
|
+
setSearchQuery: f,
|
|
2328
|
+
placeholder: c
|
|
1744
2329
|
}
|
|
1745
2330
|
)
|
|
1746
2331
|
] }),
|
|
1747
|
-
|
|
2332
|
+
_ && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1748
2333
|
"Error loading ",
|
|
1749
2334
|
l,
|
|
1750
2335
|
": ",
|
|
1751
|
-
|
|
2336
|
+
_
|
|
1752
2337
|
] }),
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
2338
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-auto", children: y && S.length === 0 ? /* @__PURE__ */ t("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
2339
|
+
/* @__PURE__ */ t("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1755
2340
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1756
2341
|
"Loading ",
|
|
1757
2342
|
l,
|
|
1758
2343
|
"..."
|
|
1759
2344
|
] })
|
|
1760
|
-
] }) }) :
|
|
1761
|
-
/* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
2345
|
+
] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
2346
|
+
/* @__PURE__ */ t("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ t(Je, { className: "h-8 w-8 text-charcoal" }) }),
|
|
2347
|
+
/* @__PURE__ */ t("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${l} found` : x.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
2348
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : x.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1764
2349
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1765
|
-
|
|
1766
|
-
const
|
|
1767
|
-
return /* @__PURE__ */
|
|
2350
|
+
S.map((p) => {
|
|
2351
|
+
const h = p.name || p.email || p.id, g = p.email && p.name ? p.email : p.phone;
|
|
2352
|
+
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1768
2353
|
"button",
|
|
1769
2354
|
{
|
|
1770
2355
|
type: "button",
|
|
1771
|
-
onClick: () =>
|
|
1772
|
-
onKeyDown: (
|
|
2356
|
+
onClick: () => M(p),
|
|
2357
|
+
onKeyDown: (I) => R(I, p),
|
|
1773
2358
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1774
2359
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1775
2360
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1776
|
-
/* @__PURE__ */
|
|
1777
|
-
|
|
2361
|
+
/* @__PURE__ */ t(
|
|
2362
|
+
me,
|
|
1778
2363
|
{
|
|
1779
|
-
id:
|
|
1780
|
-
name:
|
|
1781
|
-
image:
|
|
2364
|
+
id: p.id,
|
|
2365
|
+
name: h,
|
|
2366
|
+
image: p.image,
|
|
1782
2367
|
size: 40
|
|
1783
2368
|
}
|
|
1784
2369
|
),
|
|
1785
2370
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
|
|
2371
|
+
/* @__PURE__ */ t("h4", { className: "text-sm font-medium text-charcoal truncate", children: h }),
|
|
2372
|
+
g && /* @__PURE__ */ t("p", { className: "text-xs text-stone truncate", children: g })
|
|
1788
2373
|
] })
|
|
1789
2374
|
] }),
|
|
1790
|
-
/* @__PURE__ */
|
|
2375
|
+
/* @__PURE__ */ t("div", { className: "flex-shrink-0", children: N === p.id ? /* @__PURE__ */ t(ke, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ t(Je, { className: "h-5 w-5 text-stone" }) })
|
|
1791
2376
|
] })
|
|
1792
2377
|
}
|
|
1793
|
-
) },
|
|
2378
|
+
) }, p.id);
|
|
1794
2379
|
}),
|
|
1795
|
-
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
/* @__PURE__ */
|
|
2380
|
+
y && /* @__PURE__ */ t("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
2381
|
+
/* @__PURE__ */ t("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
2382
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1798
2383
|
] }) })
|
|
1799
2384
|
] }) })
|
|
1800
2385
|
] });
|
|
1801
|
-
},
|
|
2386
|
+
}, Yn = ({ className: e }) => /* @__PURE__ */ i(
|
|
1802
2387
|
"svg",
|
|
1803
2388
|
{
|
|
1804
2389
|
width: "140",
|
|
@@ -1806,31 +2391,31 @@ const js = ({
|
|
|
1806
2391
|
viewBox: "44 -2 144 126",
|
|
1807
2392
|
fill: "none",
|
|
1808
2393
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1809
|
-
className:
|
|
2394
|
+
className: e,
|
|
1810
2395
|
children: [
|
|
1811
2396
|
/* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
1812
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ t(
|
|
1813
2398
|
"path",
|
|
1814
2399
|
{
|
|
1815
2400
|
d: "M123.68 82.1932C123.383 103.675 105.839 121 84.2417 121C77.4724 121 71.0986 119.297 65.5327 116.299L52.5873 119.687L53.8036 106.673C48.1776 99.8701 44.7994 91.1453 44.7994 81.6356C44.7994 59.8965 62.4554 42.2754 84.2374 42.2754C89.1328 42.2754 93.8175 43.1633 98.1413 44.789",
|
|
1816
2401
|
fill: "#D7D4CE"
|
|
1817
2402
|
}
|
|
1818
2403
|
),
|
|
1819
|
-
/* @__PURE__ */
|
|
2404
|
+
/* @__PURE__ */ t(
|
|
1820
2405
|
"path",
|
|
1821
2406
|
{
|
|
1822
2407
|
d: "M84.2458 86.0364C82.2851 86.0364 80.6957 84.4501 80.6957 82.4933C80.6957 80.5365 82.2851 78.9502 84.2458 78.9502C86.2065 78.9502 87.7959 80.5365 87.7959 82.4933C87.7959 84.4501 86.2065 86.0364 84.2458 86.0364Z",
|
|
1823
2408
|
fill: "white"
|
|
1824
2409
|
}
|
|
1825
2410
|
),
|
|
1826
|
-
/* @__PURE__ */
|
|
2411
|
+
/* @__PURE__ */ t(
|
|
1827
2412
|
"path",
|
|
1828
2413
|
{
|
|
1829
2414
|
d: "M68.3044 86.0364C66.3437 86.0364 64.7543 84.4501 64.7543 82.4933C64.7543 80.5365 66.3437 78.9502 68.3044 78.9502C70.2651 78.9502 71.8545 80.5365 71.8545 82.4933C71.8545 84.4501 70.2651 86.0364 68.3044 86.0364Z",
|
|
1830
2415
|
fill: "white"
|
|
1831
2416
|
}
|
|
1832
2417
|
),
|
|
1833
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ t(
|
|
1834
2419
|
"path",
|
|
1835
2420
|
{
|
|
1836
2421
|
d: "M100.183 86.0364C98.2226 86.0364 96.6332 84.4501 96.6332 82.4933C96.6332 80.5365 98.2226 78.9502 100.183 78.9502C102.144 78.9502 103.733 80.5365 103.733 82.4933C103.733 84.4501 102.144 86.0364 100.183 86.0364Z",
|
|
@@ -1838,14 +2423,14 @@ const js = ({
|
|
|
1838
2423
|
}
|
|
1839
2424
|
),
|
|
1840
2425
|
/* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
|
|
1841
|
-
/* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ t(
|
|
1842
2427
|
"path",
|
|
1843
2428
|
{
|
|
1844
2429
|
d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
|
|
1845
2430
|
fill: "white"
|
|
1846
2431
|
}
|
|
1847
2432
|
),
|
|
1848
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ t(
|
|
1849
2434
|
"path",
|
|
1850
2435
|
{
|
|
1851
2436
|
d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
|
|
@@ -1855,21 +2440,21 @@ const js = ({
|
|
|
1855
2440
|
}
|
|
1856
2441
|
)
|
|
1857
2442
|
] }),
|
|
1858
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ t(
|
|
1859
2444
|
"path",
|
|
1860
2445
|
{
|
|
1861
2446
|
d: "M139.502 45.5431C137.541 45.5431 135.952 43.9568 135.952 42C135.952 40.0432 137.541 38.4569 139.502 38.4569C141.462 38.4569 143.052 40.0432 143.052 42C143.052 43.9568 141.462 45.5431 139.502 45.5431Z",
|
|
1862
2447
|
fill: "#D7D4CE"
|
|
1863
2448
|
}
|
|
1864
2449
|
),
|
|
1865
|
-
/* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ t(
|
|
1866
2451
|
"path",
|
|
1867
2452
|
{
|
|
1868
2453
|
d: "M123.561 45.5431C121.601 45.5431 120.011 43.9568 120.011 42C120.011 40.0432 121.601 38.4569 123.561 38.4569C125.522 38.4569 127.111 40.0432 127.111 42C127.111 43.9568 125.522 45.5431 123.561 45.5431Z",
|
|
1869
2454
|
fill: "#D7D4CE"
|
|
1870
2455
|
}
|
|
1871
2456
|
),
|
|
1872
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ t(
|
|
1873
2458
|
"path",
|
|
1874
2459
|
{
|
|
1875
2460
|
d: "M155.439 45.5431C153.478 45.5431 151.889 43.9568 151.889 42C151.889 40.0432 153.478 38.4569 155.439 38.4569C157.4 38.4569 158.989 40.0432 158.989 42C158.989 43.9568 157.4 45.5431 155.439 45.5431Z",
|
|
@@ -1889,8 +2474,8 @@ const js = ({
|
|
|
1889
2474
|
filterUnits: "userSpaceOnUse",
|
|
1890
2475
|
colorInterpolationFilters: "sRGB",
|
|
1891
2476
|
children: [
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
2477
|
+
/* @__PURE__ */ t("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
2478
|
+
/* @__PURE__ */ t(
|
|
1894
2479
|
"feColorMatrix",
|
|
1895
2480
|
{
|
|
1896
2481
|
in: "SourceAlpha",
|
|
@@ -1899,16 +2484,16 @@ const js = ({
|
|
|
1899
2484
|
result: "hardAlpha"
|
|
1900
2485
|
}
|
|
1901
2486
|
),
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ t("feOffset", { dx: "4", dy: "4" }),
|
|
2488
|
+
/* @__PURE__ */ t("feComposite", { in2: "hardAlpha", operator: "out" }),
|
|
2489
|
+
/* @__PURE__ */ t(
|
|
1905
2490
|
"feColorMatrix",
|
|
1906
2491
|
{
|
|
1907
2492
|
type: "matrix",
|
|
1908
2493
|
values: "0 0 0 0 0.8428 0 0 0 0 0.830064 0 0 0 0 0.8095 0 0 0 1 0"
|
|
1909
2494
|
}
|
|
1910
2495
|
),
|
|
1911
|
-
/* @__PURE__ */
|
|
2496
|
+
/* @__PURE__ */ t(
|
|
1912
2497
|
"feBlend",
|
|
1913
2498
|
{
|
|
1914
2499
|
mode: "normal",
|
|
@@ -1916,7 +2501,7 @@ const js = ({
|
|
|
1916
2501
|
result: "effect1_dropShadow"
|
|
1917
2502
|
}
|
|
1918
2503
|
),
|
|
1919
|
-
/* @__PURE__ */
|
|
2504
|
+
/* @__PURE__ */ t(
|
|
1920
2505
|
"feBlend",
|
|
1921
2506
|
{
|
|
1922
2507
|
mode: "normal",
|
|
@@ -1928,25 +2513,25 @@ const js = ({
|
|
|
1928
2513
|
]
|
|
1929
2514
|
}
|
|
1930
2515
|
),
|
|
1931
|
-
/* @__PURE__ */
|
|
2516
|
+
/* @__PURE__ */ t("clipPath", { id: "clip0_empty_state", children: /* @__PURE__ */ t("rect", { width: "233", height: "233", fill: "white" }) })
|
|
1932
2517
|
] })
|
|
1933
2518
|
]
|
|
1934
2519
|
}
|
|
1935
|
-
),
|
|
1936
|
-
({ hasChannels:
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
s && !
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
2520
|
+
), vt = L.memo(
|
|
2521
|
+
({ hasChannels: e, channelsLoaded: s }) => /* @__PURE__ */ t("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2522
|
+
/* @__PURE__ */ t(Yn, {}),
|
|
2523
|
+
s && !e && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
2524
|
+
/* @__PURE__ */ t("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2525
|
+
/* @__PURE__ */ t("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1941
2526
|
] })
|
|
1942
2527
|
] }) })
|
|
1943
2528
|
);
|
|
1944
|
-
|
|
1945
|
-
const
|
|
1946
|
-
/* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
s && /* @__PURE__ */
|
|
2529
|
+
vt.displayName = "EmptyState";
|
|
2530
|
+
const Me = L.memo(({ message: e, onBack: s }) => /* @__PURE__ */ t("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
|
|
2531
|
+
/* @__PURE__ */ t("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ t("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2532
|
+
/* @__PURE__ */ t("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2533
|
+
/* @__PURE__ */ t("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
2534
|
+
s && /* @__PURE__ */ t(
|
|
1950
2535
|
"button",
|
|
1951
2536
|
{
|
|
1952
2537
|
type: "button",
|
|
@@ -1956,135 +2541,136 @@ const Ce = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1956
2541
|
}
|
|
1957
2542
|
)
|
|
1958
2543
|
] }) }));
|
|
1959
|
-
|
|
1960
|
-
const
|
|
1961
|
-
capabilities:
|
|
2544
|
+
Me.displayName = "ErrorState";
|
|
2545
|
+
const sa = ({
|
|
2546
|
+
capabilities: e = {},
|
|
1962
2547
|
className: s,
|
|
1963
2548
|
renderMessageInputActions: n,
|
|
1964
|
-
renderConversationFooter:
|
|
2549
|
+
renderConversationFooter: r,
|
|
1965
2550
|
onChannelSelect: l,
|
|
1966
|
-
onParticipantSelect:
|
|
2551
|
+
onParticipantSelect: c,
|
|
1967
2552
|
initialParticipantFilter: a,
|
|
1968
|
-
initialParticipantData:
|
|
1969
|
-
CustomChannelEmptyState:
|
|
1970
|
-
showChannelList:
|
|
1971
|
-
filters:
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2553
|
+
initialParticipantData: d,
|
|
2554
|
+
CustomChannelEmptyState: b,
|
|
2555
|
+
showChannelList: f = !0,
|
|
2556
|
+
filters: x,
|
|
2557
|
+
channelRenderFilterFn: m,
|
|
2558
|
+
channelListCustomEmptyStateIndicator: y,
|
|
2559
|
+
onDeleteConversationClick: u,
|
|
2560
|
+
onBlockParticipantClick: _,
|
|
2561
|
+
onReportParticipantClick: o,
|
|
2562
|
+
dmAgentEnabled: N,
|
|
2563
|
+
messageMetadata: P,
|
|
2564
|
+
onMessageSent: C,
|
|
2565
|
+
showStarButton: S = !1,
|
|
2566
|
+
chatbotVotingEnabled: M = !1,
|
|
2567
|
+
renderMessagePreview: R,
|
|
2568
|
+
renderChannelBanner: p,
|
|
2569
|
+
customProfileContent: h,
|
|
2570
|
+
customChannelActions: g,
|
|
2571
|
+
renderMessage: I
|
|
1986
2572
|
}) => {
|
|
1987
2573
|
const {
|
|
1988
2574
|
service: v,
|
|
1989
|
-
client:
|
|
1990
|
-
isConnected:
|
|
1991
|
-
isLoading:
|
|
1992
|
-
error:
|
|
1993
|
-
refreshConnection:
|
|
2575
|
+
client: w,
|
|
2576
|
+
isConnected: A,
|
|
2577
|
+
isLoading: G,
|
|
2578
|
+
error: $,
|
|
2579
|
+
refreshConnection: Z,
|
|
1994
2580
|
debug: D
|
|
1995
|
-
} =
|
|
1996
|
-
participantSource:
|
|
1997
|
-
participantLabel:
|
|
1998
|
-
showDeleteConversation:
|
|
1999
|
-
} =
|
|
2000
|
-
const
|
|
2581
|
+
} = Ds(), [z, Y] = k(null), [ie, E] = k(!1), [O, q] = k(!1), [j, B] = k(!1), [ee, re] = k(/* @__PURE__ */ new Set()), [K, De] = k(0), [te, ce] = k(!1), [be, J] = k(null), le = W(null), {
|
|
2582
|
+
participantSource: ve,
|
|
2583
|
+
participantLabel: xe = "participants",
|
|
2584
|
+
showDeleteConversation: Ae = !0
|
|
2585
|
+
} = e, he = L.useMemo(() => {
|
|
2586
|
+
const T = w == null ? void 0 : w.userID;
|
|
2001
2587
|
return {
|
|
2002
2588
|
...{
|
|
2003
2589
|
type: "messaging",
|
|
2004
2590
|
last_message_at: { $exists: !0 },
|
|
2005
|
-
...
|
|
2006
|
-
members: { $in: [
|
|
2591
|
+
...T && {
|
|
2592
|
+
members: { $in: [T] },
|
|
2007
2593
|
hidden: !1
|
|
2008
2594
|
}
|
|
2009
2595
|
},
|
|
2010
|
-
...
|
|
2596
|
+
...x
|
|
2011
2597
|
};
|
|
2012
|
-
}, [
|
|
2013
|
-
if (!
|
|
2014
|
-
const
|
|
2015
|
-
if (
|
|
2598
|
+
}, [x, w == null ? void 0 : w.userID]), fe = W(null), se = U(async () => {
|
|
2599
|
+
if (!w || !A) return;
|
|
2600
|
+
const T = w.userID;
|
|
2601
|
+
if (T)
|
|
2016
2602
|
try {
|
|
2017
|
-
D && console.log("[MessagingShell] Syncing channels for user:",
|
|
2018
|
-
const
|
|
2603
|
+
D && console.log("[MessagingShell] Syncing channels for user:", T);
|
|
2604
|
+
const Q = await w.queryChannels(
|
|
2019
2605
|
{
|
|
2020
2606
|
type: "messaging",
|
|
2021
|
-
members: { $in: [
|
|
2607
|
+
members: { $in: [T] }
|
|
2022
2608
|
},
|
|
2023
2609
|
{},
|
|
2024
2610
|
{ limit: 100 }
|
|
2025
|
-
),
|
|
2026
|
-
|
|
2027
|
-
const
|
|
2028
|
-
Object.values(
|
|
2029
|
-
var
|
|
2030
|
-
const
|
|
2031
|
-
|
|
2611
|
+
), H = /* @__PURE__ */ new Set();
|
|
2612
|
+
Q.forEach((X) => {
|
|
2613
|
+
const Le = X.state.members;
|
|
2614
|
+
Object.values(Le).forEach((wt) => {
|
|
2615
|
+
var We;
|
|
2616
|
+
const Oe = (We = wt.user) == null ? void 0 : We.id;
|
|
2617
|
+
Oe && Oe !== T && H.add(Oe);
|
|
2032
2618
|
});
|
|
2033
|
-
}),
|
|
2034
|
-
channelCount:
|
|
2035
|
-
memberCount:
|
|
2619
|
+
}), re((X) => X.size === H.size && [...X].every((Le) => H.has(Le)) ? X : H), E(Q.length > 0), q(!0), fe.current = T, D && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2620
|
+
channelCount: Q.length,
|
|
2621
|
+
memberCount: H.size
|
|
2036
2622
|
});
|
|
2037
|
-
} catch (
|
|
2038
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
2623
|
+
} catch (Q) {
|
|
2624
|
+
console.error("[MessagingShell] Failed to sync channels:", Q);
|
|
2039
2625
|
}
|
|
2040
|
-
}, [
|
|
2041
|
-
|
|
2042
|
-
if (!
|
|
2043
|
-
const
|
|
2044
|
-
|
|
2045
|
-
}, [
|
|
2046
|
-
if (!a || !
|
|
2626
|
+
}, [w, A, D]);
|
|
2627
|
+
V(() => {
|
|
2628
|
+
if (!w || !A) return;
|
|
2629
|
+
const T = w.userID;
|
|
2630
|
+
T && fe.current !== T && se();
|
|
2631
|
+
}, [w, A, se]), V(() => {
|
|
2632
|
+
if (!a || !w || !A) return;
|
|
2047
2633
|
(async () => {
|
|
2048
|
-
const
|
|
2049
|
-
if (
|
|
2634
|
+
const Q = w.userID;
|
|
2635
|
+
if (Q)
|
|
2050
2636
|
try {
|
|
2051
2637
|
D && console.log(
|
|
2052
2638
|
"[MessagingShell] Loading initial conversation with:",
|
|
2053
2639
|
a
|
|
2054
2640
|
);
|
|
2055
|
-
const
|
|
2641
|
+
const H = await w.queryChannels(
|
|
2056
2642
|
{
|
|
2057
2643
|
type: "messaging",
|
|
2058
|
-
members: { $eq: [
|
|
2644
|
+
members: { $eq: [Q, a] }
|
|
2059
2645
|
},
|
|
2060
2646
|
{},
|
|
2061
2647
|
{ limit: 1 }
|
|
2062
2648
|
);
|
|
2063
|
-
if (
|
|
2064
|
-
|
|
2649
|
+
if (H.length > 0)
|
|
2650
|
+
Y(H[0]), ce(!0), J(null), l && l(H[0]), D && console.log(
|
|
2065
2651
|
"[MessagingShell] Initial conversation loaded:",
|
|
2066
|
-
|
|
2652
|
+
H[0].id
|
|
2067
2653
|
);
|
|
2068
|
-
else if (
|
|
2654
|
+
else if (d && v) {
|
|
2069
2655
|
D && console.log(
|
|
2070
2656
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2071
|
-
|
|
2657
|
+
d
|
|
2072
2658
|
);
|
|
2073
2659
|
try {
|
|
2074
|
-
const
|
|
2075
|
-
id:
|
|
2076
|
-
name:
|
|
2077
|
-
email:
|
|
2078
|
-
phone:
|
|
2660
|
+
const X = await v.startChannelWithParticipant({
|
|
2661
|
+
id: d.id,
|
|
2662
|
+
name: d.name,
|
|
2663
|
+
email: d.email,
|
|
2664
|
+
phone: d.phone
|
|
2079
2665
|
});
|
|
2080
|
-
|
|
2666
|
+
Y(X), ce(!0), J(null), l && l(X), D && console.log(
|
|
2081
2667
|
"[MessagingShell] Channel created and loaded:",
|
|
2082
|
-
|
|
2668
|
+
X.id
|
|
2083
2669
|
);
|
|
2084
|
-
} catch (
|
|
2670
|
+
} catch (X) {
|
|
2085
2671
|
console.error(
|
|
2086
2672
|
"[MessagingShell] Failed to create conversation:",
|
|
2087
|
-
|
|
2673
|
+
X
|
|
2088
2674
|
), J("Failed to create conversation");
|
|
2089
2675
|
}
|
|
2090
2676
|
} else
|
|
@@ -2094,229 +2680,230 @@ const Qs = ({
|
|
|
2094
2680
|
"[MessagingShell] No conversation found for:",
|
|
2095
2681
|
a
|
|
2096
2682
|
);
|
|
2097
|
-
} catch (
|
|
2683
|
+
} catch (H) {
|
|
2098
2684
|
console.error(
|
|
2099
2685
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2100
|
-
|
|
2686
|
+
H
|
|
2101
2687
|
), J("Failed to load conversation");
|
|
2102
2688
|
}
|
|
2103
2689
|
})();
|
|
2104
2690
|
}, [
|
|
2105
2691
|
a,
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2692
|
+
d,
|
|
2693
|
+
w,
|
|
2694
|
+
A,
|
|
2109
2695
|
v,
|
|
2110
2696
|
D,
|
|
2111
2697
|
l
|
|
2112
2698
|
]);
|
|
2113
|
-
const
|
|
2114
|
-
(
|
|
2115
|
-
|
|
2699
|
+
const we = U(
|
|
2700
|
+
(T) => {
|
|
2701
|
+
Y(T), l == null || l(T);
|
|
2116
2702
|
},
|
|
2117
2703
|
[l]
|
|
2118
|
-
),
|
|
2119
|
-
|
|
2120
|
-
}, [
|
|
2121
|
-
async (
|
|
2122
|
-
var
|
|
2704
|
+
), Ne = U(() => {
|
|
2705
|
+
te || Y(null);
|
|
2706
|
+
}, [te]), Ce = U(
|
|
2707
|
+
async (T) => {
|
|
2708
|
+
var Q;
|
|
2123
2709
|
if (v)
|
|
2124
2710
|
try {
|
|
2125
2711
|
D && console.log(
|
|
2126
2712
|
"[MessagingShell] Starting conversation with:",
|
|
2127
|
-
|
|
2713
|
+
T.id
|
|
2128
2714
|
);
|
|
2129
|
-
const
|
|
2130
|
-
id:
|
|
2131
|
-
name:
|
|
2132
|
-
email:
|
|
2133
|
-
phone:
|
|
2715
|
+
const H = await v.startChannelWithParticipant({
|
|
2716
|
+
id: T.id,
|
|
2717
|
+
name: T.name,
|
|
2718
|
+
email: T.email,
|
|
2719
|
+
phone: T.phone
|
|
2134
2720
|
});
|
|
2135
2721
|
try {
|
|
2136
|
-
await
|
|
2137
|
-
} catch (
|
|
2138
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
2722
|
+
await H.show();
|
|
2723
|
+
} catch (X) {
|
|
2724
|
+
console.warn("[MessagingShell] Failed to unhide channel:", X);
|
|
2139
2725
|
}
|
|
2140
|
-
|
|
2141
|
-
} catch (
|
|
2142
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
2726
|
+
Y(H), B(!1), (Q = le.current) == null || Q.close(), c == null || c(T);
|
|
2727
|
+
} catch (H) {
|
|
2728
|
+
console.error("[MessagingShell] Failed to start conversation:", H);
|
|
2143
2729
|
}
|
|
2144
2730
|
},
|
|
2145
|
-
[v,
|
|
2146
|
-
),
|
|
2147
|
-
var
|
|
2148
|
-
|
|
2149
|
-
}, []),
|
|
2150
|
-
(
|
|
2151
|
-
|
|
2731
|
+
[v, c, D]
|
|
2732
|
+
), de = U(() => {
|
|
2733
|
+
var T;
|
|
2734
|
+
B(!1), (T = le.current) == null || T.close();
|
|
2735
|
+
}, []), _e = U(
|
|
2736
|
+
(T) => {
|
|
2737
|
+
T.target === le.current && de();
|
|
2152
2738
|
},
|
|
2153
|
-
[
|
|
2154
|
-
),
|
|
2155
|
-
async (
|
|
2156
|
-
D && console.log("[MessagingShell] Leaving conversation:",
|
|
2739
|
+
[de]
|
|
2740
|
+
), Ee = U(
|
|
2741
|
+
async (T) => {
|
|
2742
|
+
D && console.log("[MessagingShell] Leaving conversation:", T.id), Y(null), ce(!1), fe.current = null, await se();
|
|
2157
2743
|
},
|
|
2158
|
-
[
|
|
2159
|
-
),
|
|
2160
|
-
async (
|
|
2161
|
-
D && console.log("[MessagingShell] Blocking participant:",
|
|
2744
|
+
[se, D]
|
|
2745
|
+
), Ie = U(
|
|
2746
|
+
async (T) => {
|
|
2747
|
+
D && console.log("[MessagingShell] Blocking participant:", T), Y(null), ce(!1), fe.current = null, await se();
|
|
2162
2748
|
},
|
|
2163
|
-
[
|
|
2164
|
-
),
|
|
2165
|
-
return
|
|
2166
|
-
|
|
2749
|
+
[se, D]
|
|
2750
|
+
), ue = !!z;
|
|
2751
|
+
return G ? /* @__PURE__ */ t("div", { className: F("h-full", s), children: /* @__PURE__ */ t(Pe, {}) }) : $ ? /* @__PURE__ */ t("div", { className: F("h-full", s), children: /* @__PURE__ */ t(Me, { message: $, onBack: Z }) }) : !A || !w ? /* @__PURE__ */ t("div", { className: F("h-full", s), children: /* @__PURE__ */ t(
|
|
2752
|
+
Me,
|
|
2167
2753
|
{
|
|
2168
2754
|
message: "Not connected to messaging service",
|
|
2169
|
-
onBack:
|
|
2755
|
+
onBack: Z
|
|
2170
2756
|
}
|
|
2171
|
-
) }) :
|
|
2757
|
+
) }) : be ? /* @__PURE__ */ t("div", { className: F("h-full", s), children: /* @__PURE__ */ t(Me, { message: be }) }) : /* @__PURE__ */ i(
|
|
2172
2758
|
"div",
|
|
2173
2759
|
{
|
|
2174
|
-
className:
|
|
2760
|
+
className: F(
|
|
2175
2761
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2176
2762
|
s
|
|
2177
2763
|
),
|
|
2178
2764
|
children: [
|
|
2179
2765
|
/* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
|
|
2180
|
-
/* @__PURE__ */
|
|
2766
|
+
/* @__PURE__ */ t(
|
|
2181
2767
|
"div",
|
|
2182
2768
|
{
|
|
2183
|
-
className:
|
|
2769
|
+
className: F(
|
|
2184
2770
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2185
2771
|
{
|
|
2186
|
-
"!hidden":
|
|
2772
|
+
"!hidden": f === !1 || te,
|
|
2187
2773
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2188
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
2774
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !te && ue,
|
|
2189
2775
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2190
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
2776
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !te && !ue
|
|
2191
2777
|
}
|
|
2192
2778
|
),
|
|
2193
|
-
children: /* @__PURE__ */
|
|
2194
|
-
|
|
2779
|
+
children: /* @__PURE__ */ t(
|
|
2780
|
+
ht,
|
|
2195
2781
|
{
|
|
2196
|
-
onChannelSelect:
|
|
2197
|
-
selectedChannel:
|
|
2198
|
-
filters:
|
|
2199
|
-
|
|
2200
|
-
|
|
2782
|
+
onChannelSelect: we,
|
|
2783
|
+
selectedChannel: z || void 0,
|
|
2784
|
+
filters: he,
|
|
2785
|
+
channelRenderFilterFn: m,
|
|
2786
|
+
customEmptyStateIndicator: y,
|
|
2787
|
+
renderMessagePreview: R
|
|
2201
2788
|
}
|
|
2202
2789
|
)
|
|
2203
2790
|
}
|
|
2204
2791
|
),
|
|
2205
|
-
/* @__PURE__ */
|
|
2792
|
+
/* @__PURE__ */ t(
|
|
2206
2793
|
"div",
|
|
2207
2794
|
{
|
|
2208
|
-
className:
|
|
2795
|
+
className: F(
|
|
2209
2796
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2210
2797
|
{
|
|
2211
2798
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2212
|
-
flex:
|
|
2799
|
+
flex: te || ue || a,
|
|
2213
2800
|
// Normal mode: hide on mobile when no channel selected
|
|
2214
|
-
"hidden lg:flex": !
|
|
2801
|
+
"hidden lg:flex": !te && !ue && !a
|
|
2215
2802
|
}
|
|
2216
2803
|
),
|
|
2217
|
-
children:
|
|
2218
|
-
|
|
2804
|
+
children: z ? /* @__PURE__ */ t("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ t(
|
|
2805
|
+
pt,
|
|
2219
2806
|
{
|
|
2220
|
-
channel:
|
|
2221
|
-
onBack:
|
|
2222
|
-
showBackButton: !
|
|
2807
|
+
channel: z,
|
|
2808
|
+
onBack: Ne,
|
|
2809
|
+
showBackButton: !te,
|
|
2223
2810
|
renderMessageInputActions: n,
|
|
2224
|
-
renderConversationFooter:
|
|
2225
|
-
renderChannelBanner:
|
|
2226
|
-
onLeaveConversation:
|
|
2227
|
-
onBlockParticipant:
|
|
2228
|
-
CustomChannelEmptyState:
|
|
2229
|
-
showDeleteConversation:
|
|
2230
|
-
onDeleteConversationClick:
|
|
2231
|
-
onBlockParticipantClick:
|
|
2232
|
-
onReportParticipantClick:
|
|
2233
|
-
dmAgentEnabled:
|
|
2234
|
-
messageMetadata:
|
|
2235
|
-
onMessageSent:
|
|
2236
|
-
showStarButton:
|
|
2237
|
-
chatbotVotingEnabled:
|
|
2238
|
-
customProfileContent:
|
|
2239
|
-
customChannelActions:
|
|
2240
|
-
renderMessage:
|
|
2811
|
+
renderConversationFooter: r,
|
|
2812
|
+
renderChannelBanner: p,
|
|
2813
|
+
onLeaveConversation: Ee,
|
|
2814
|
+
onBlockParticipant: Ie,
|
|
2815
|
+
CustomChannelEmptyState: b,
|
|
2816
|
+
showDeleteConversation: Ae,
|
|
2817
|
+
onDeleteConversationClick: u,
|
|
2818
|
+
onBlockParticipantClick: _,
|
|
2819
|
+
onReportParticipantClick: o,
|
|
2820
|
+
dmAgentEnabled: N,
|
|
2821
|
+
messageMetadata: P,
|
|
2822
|
+
onMessageSent: C,
|
|
2823
|
+
showStarButton: S,
|
|
2824
|
+
chatbotVotingEnabled: M,
|
|
2825
|
+
customProfileContent: h,
|
|
2826
|
+
customChannelActions: g,
|
|
2827
|
+
renderMessage: I
|
|
2241
2828
|
},
|
|
2242
|
-
|
|
2829
|
+
z.id
|
|
2243
2830
|
) }) : a ? (
|
|
2244
2831
|
// Show loading while creating/loading direct conversation channel
|
|
2245
|
-
/* @__PURE__ */
|
|
2246
|
-
) : /* @__PURE__ */
|
|
2247
|
-
|
|
2832
|
+
/* @__PURE__ */ t(Pe, {})
|
|
2833
|
+
) : /* @__PURE__ */ t(
|
|
2834
|
+
vt,
|
|
2248
2835
|
{
|
|
2249
|
-
hasChannels:
|
|
2250
|
-
channelsLoaded:
|
|
2836
|
+
hasChannels: ie,
|
|
2837
|
+
channelsLoaded: O
|
|
2251
2838
|
}
|
|
2252
2839
|
)
|
|
2253
2840
|
}
|
|
2254
2841
|
)
|
|
2255
2842
|
] }),
|
|
2256
|
-
|
|
2257
|
-
/* @__PURE__ */
|
|
2843
|
+
ve && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2844
|
+
/* @__PURE__ */ t(
|
|
2258
2845
|
"dialog",
|
|
2259
2846
|
{
|
|
2260
|
-
ref:
|
|
2847
|
+
ref: le,
|
|
2261
2848
|
className: "mes-dialog",
|
|
2262
|
-
onClick:
|
|
2263
|
-
onClose:
|
|
2264
|
-
children: /* @__PURE__ */
|
|
2265
|
-
|
|
2849
|
+
onClick: _e,
|
|
2850
|
+
onClose: de,
|
|
2851
|
+
children: /* @__PURE__ */ t("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ t(
|
|
2852
|
+
Vn,
|
|
2266
2853
|
{
|
|
2267
|
-
participantSource:
|
|
2268
|
-
onSelectParticipant:
|
|
2269
|
-
onClose:
|
|
2270
|
-
existingParticipantIds:
|
|
2271
|
-
participantLabel:
|
|
2272
|
-
searchPlaceholder: `Search ${
|
|
2854
|
+
participantSource: ve,
|
|
2855
|
+
onSelectParticipant: Ce,
|
|
2856
|
+
onClose: de,
|
|
2857
|
+
existingParticipantIds: ee,
|
|
2858
|
+
participantLabel: xe,
|
|
2859
|
+
searchPlaceholder: `Search ${xe}...`
|
|
2273
2860
|
},
|
|
2274
|
-
|
|
2861
|
+
K
|
|
2275
2862
|
) })
|
|
2276
2863
|
}
|
|
2277
2864
|
)
|
|
2278
2865
|
]
|
|
2279
2866
|
}
|
|
2280
2867
|
);
|
|
2281
|
-
},
|
|
2282
|
-
question:
|
|
2868
|
+
}, Wn = ({
|
|
2869
|
+
question: e,
|
|
2283
2870
|
onClick: s,
|
|
2284
2871
|
loading: n = !1,
|
|
2285
|
-
className:
|
|
2286
|
-
}) => /* @__PURE__ */
|
|
2872
|
+
className: r
|
|
2873
|
+
}) => /* @__PURE__ */ t(
|
|
2287
2874
|
"button",
|
|
2288
2875
|
{
|
|
2289
2876
|
type: "button",
|
|
2290
2877
|
onClick: s,
|
|
2291
2878
|
disabled: n,
|
|
2292
2879
|
style: { backgroundColor: "#E6E5E3" },
|
|
2293
|
-
className:
|
|
2880
|
+
className: F(
|
|
2294
2881
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2295
2882
|
{
|
|
2296
2883
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2297
2884
|
"opacity-50 cursor-not-allowed": n
|
|
2298
2885
|
},
|
|
2299
|
-
|
|
2886
|
+
r
|
|
2300
2887
|
),
|
|
2301
|
-
children:
|
|
2888
|
+
children: e
|
|
2302
2889
|
}
|
|
2303
|
-
),
|
|
2304
|
-
faqs:
|
|
2890
|
+
), na = ({
|
|
2891
|
+
faqs: e,
|
|
2305
2892
|
onFaqClick: s,
|
|
2306
2893
|
loadingFaqId: n,
|
|
2307
|
-
headerText:
|
|
2894
|
+
headerText: r,
|
|
2308
2895
|
className: l,
|
|
2309
|
-
avatarImage:
|
|
2896
|
+
avatarImage: c,
|
|
2310
2897
|
avatarName: a
|
|
2311
2898
|
}) => {
|
|
2312
|
-
const
|
|
2313
|
-
return
|
|
2314
|
-
(
|
|
2315
|
-
|
|
2899
|
+
const d = e.filter((b) => b.enabled).sort((b, f) => (b.order ?? 0) - (f.order ?? 0));
|
|
2900
|
+
return d.length === 0 ? null : /* @__PURE__ */ t("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2901
|
+
(c || a) && /* @__PURE__ */ t("div", { className: "flex-none", children: /* @__PURE__ */ t(
|
|
2902
|
+
me,
|
|
2316
2903
|
{
|
|
2317
2904
|
id: a || "account",
|
|
2318
2905
|
name: a || "Account",
|
|
2319
|
-
image:
|
|
2906
|
+
image: c,
|
|
2320
2907
|
size: 24,
|
|
2321
2908
|
shape: "circle"
|
|
2322
2909
|
}
|
|
@@ -2327,76 +2914,78 @@ const Qs = ({
|
|
|
2327
2914
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2328
2915
|
style: { backgroundColor: "#F1F0EE" },
|
|
2329
2916
|
children: [
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2917
|
+
r && /* @__PURE__ */ t("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
2918
|
+
d.map((b) => /* @__PURE__ */ t(
|
|
2919
|
+
Wn,
|
|
2333
2920
|
{
|
|
2334
|
-
question:
|
|
2335
|
-
onClick: () => s(
|
|
2336
|
-
loading: n ===
|
|
2921
|
+
question: b.question,
|
|
2922
|
+
onClick: () => s(b.id),
|
|
2923
|
+
loading: n === b.id
|
|
2337
2924
|
},
|
|
2338
|
-
|
|
2925
|
+
b.id
|
|
2339
2926
|
))
|
|
2340
2927
|
]
|
|
2341
2928
|
}
|
|
2342
2929
|
)
|
|
2343
2930
|
] }) });
|
|
2344
|
-
},
|
|
2345
|
-
const { initialSearch: n = "", pageSize:
|
|
2931
|
+
}, aa = (e, s = {}) => {
|
|
2932
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, c] = k([]), [a, d] = k(!1), [b, f] = k(null), [x, m] = k(n), [y, u] = k(!0), [_, o] = k(), N = U(async (M = !1, R) => {
|
|
2346
2933
|
if (a) return;
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2934
|
+
const p = R !== void 0 ? R : x;
|
|
2935
|
+
d(!0), f(null);
|
|
2349
2936
|
try {
|
|
2350
|
-
const
|
|
2351
|
-
search:
|
|
2352
|
-
limit:
|
|
2353
|
-
cursor:
|
|
2937
|
+
const h = await e.loadParticipants({
|
|
2938
|
+
search: p || void 0,
|
|
2939
|
+
limit: r,
|
|
2940
|
+
cursor: M ? void 0 : _
|
|
2354
2941
|
});
|
|
2355
|
-
|
|
2356
|
-
(
|
|
2357
|
-
),
|
|
2358
|
-
} catch (
|
|
2359
|
-
const
|
|
2360
|
-
|
|
2942
|
+
c(
|
|
2943
|
+
(g) => M ? h.participants : [...g, ...h.participants]
|
|
2944
|
+
), u(h.hasMore), o(h.nextCursor);
|
|
2945
|
+
} catch (h) {
|
|
2946
|
+
const g = h instanceof Error ? h.message : "Failed to load participants";
|
|
2947
|
+
f(g), console.error("[useParticipants] Load error:", h);
|
|
2361
2948
|
} finally {
|
|
2362
|
-
|
|
2949
|
+
d(!1);
|
|
2363
2950
|
}
|
|
2364
|
-
}, [
|
|
2365
|
-
|
|
2366
|
-
}, [
|
|
2367
|
-
|
|
2368
|
-
}, [
|
|
2369
|
-
|
|
2370
|
-
}, [
|
|
2371
|
-
return
|
|
2372
|
-
|
|
2373
|
-
}, [
|
|
2951
|
+
}, [e, x, _, r, a]), P = U(() => {
|
|
2952
|
+
y && !a && N(!1);
|
|
2953
|
+
}, [y, a, N]), C = U((M) => {
|
|
2954
|
+
m(M), o(void 0), N(!0, M);
|
|
2955
|
+
}, [N]), S = U(() => {
|
|
2956
|
+
o(void 0), N(!0);
|
|
2957
|
+
}, [N]);
|
|
2958
|
+
return V(() => {
|
|
2959
|
+
N(!0);
|
|
2960
|
+
}, [e.loadParticipants]), {
|
|
2374
2961
|
participants: l,
|
|
2375
2962
|
loading: a,
|
|
2376
|
-
error:
|
|
2377
|
-
searchQuery:
|
|
2378
|
-
hasMore:
|
|
2379
|
-
totalCount:
|
|
2380
|
-
loadMore:
|
|
2381
|
-
search:
|
|
2382
|
-
refresh:
|
|
2963
|
+
error: b,
|
|
2964
|
+
searchQuery: x,
|
|
2965
|
+
hasMore: y,
|
|
2966
|
+
totalCount: e.totalCount,
|
|
2967
|
+
loadMore: P,
|
|
2968
|
+
search: C,
|
|
2969
|
+
refresh: S
|
|
2383
2970
|
};
|
|
2384
2971
|
};
|
|
2385
2972
|
export {
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2973
|
+
Se as ActionButton,
|
|
2974
|
+
me as Avatar,
|
|
2975
|
+
zn as ChannelEmptyState,
|
|
2976
|
+
ht as ChannelList,
|
|
2977
|
+
pt as ChannelView,
|
|
2978
|
+
na as FaqList,
|
|
2979
|
+
Wn as FaqListItem,
|
|
2980
|
+
pn as LockedAttachmentCard,
|
|
2981
|
+
Nn as MessageVoteButtons,
|
|
2982
|
+
ta as MessagingProvider,
|
|
2983
|
+
sa as MessagingShell,
|
|
2984
|
+
Vn as ParticipantPicker,
|
|
2985
|
+
Us as formatRelativeTime,
|
|
2986
|
+
Hs as isAttachmentMessage,
|
|
2987
|
+
Xs as useMessageVote,
|
|
2988
|
+
Ds as useMessaging,
|
|
2989
|
+
aa as useParticipants
|
|
2401
2990
|
};
|
|
2402
2991
|
//# sourceMappingURL=index.js.map
|