@linktr.ee/messaging-react 4.4.6-rc-1788235358 → 4.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +175 -178
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/CustomMessage/StreamAttachmentMessage.stories.tsx +14 -0
- package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +27 -0
- package/src/components/CustomMessage/StreamAttachmentMessage.tsx +9 -1
- package/src/components/MessageAttachment/MessageAttachment.behavior.test.tsx +4 -8
- package/src/components/MessageAttachment/Video/index.tsx +6 -17
package/dist/index.js
CHANGED
|
@@ -2188,7 +2188,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2188
2188
|
"aria-hidden": !0
|
|
2189
2189
|
})
|
|
2190
2190
|
})
|
|
2191
|
-
}), qr = (
|
|
2191
|
+
}), qr = ({ item: e, index: t, showPlayBadge: n = !0, imgRef: r, onLoad: i }) => /* @__PURE__ */ W("div", {
|
|
2192
2192
|
className: "absolute inset-0 size-full bg-[#0d0d0d]",
|
|
2193
2193
|
children: [e.poster ? /* @__PURE__ */ U("img", {
|
|
2194
2194
|
ref: r,
|
|
@@ -2199,13 +2199,6 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2199
2199
|
decoding: "async",
|
|
2200
2200
|
onLoad: i,
|
|
2201
2201
|
className: "absolute inset-0 size-full object-cover"
|
|
2202
|
-
}) : e.src ? /* @__PURE__ */ U("video", {
|
|
2203
|
-
src: qr(e.src),
|
|
2204
|
-
muted: !0,
|
|
2205
|
-
playsInline: !0,
|
|
2206
|
-
preload: "metadata",
|
|
2207
|
-
"aria-label": `Video ${t + 1} thumbnail`,
|
|
2208
|
-
className: "absolute inset-0 size-full object-cover"
|
|
2209
2202
|
}) : /* @__PURE__ */ U("div", {
|
|
2210
2203
|
className: "absolute inset-0 flex items-center justify-center",
|
|
2211
2204
|
children: /* @__PURE__ */ U(Ke, {
|
|
@@ -2214,17 +2207,17 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2214
2207
|
"aria-hidden": !0
|
|
2215
2208
|
})
|
|
2216
2209
|
}), n ? /* @__PURE__ */ U(Kr, {}) : null]
|
|
2217
|
-
}),
|
|
2210
|
+
}), Jr = ({ item: e, index: t, totalCount: n, isOverflowTile: r, imgRef: i, onLoad: a }) => ({
|
|
2218
2211
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2219
2212
|
cursorClassName: "cursor-pointer",
|
|
2220
|
-
content: /* @__PURE__ */ U(
|
|
2213
|
+
content: /* @__PURE__ */ U(qr, {
|
|
2221
2214
|
item: e,
|
|
2222
2215
|
index: t,
|
|
2223
2216
|
showPlayBadge: !r,
|
|
2224
2217
|
imgRef: i,
|
|
2225
2218
|
onLoad: a
|
|
2226
2219
|
})
|
|
2227
|
-
}),
|
|
2220
|
+
}), Yr = ({ src: e, poster: t, mimeType: n, preload: r, naturalAspectRatio: i, items: a }) => a && a.length > 0 ? r ? a.map((e) => ({
|
|
2228
2221
|
...e,
|
|
2229
2222
|
preload: e.preload ?? r
|
|
2230
2223
|
})) : a : e ? [{
|
|
@@ -2233,13 +2226,13 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2233
2226
|
mimeType: n,
|
|
2234
2227
|
preload: r,
|
|
2235
2228
|
naturalAspectRatio: i
|
|
2236
|
-
}] : [],
|
|
2229
|
+
}] : [], Xr = (e, t) => e.map((n, r) => ({
|
|
2237
2230
|
src: n.src,
|
|
2238
2231
|
poster: n.poster,
|
|
2239
2232
|
mimeType: n.mimeType,
|
|
2240
2233
|
preload: n.preload,
|
|
2241
2234
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
2242
|
-
})),
|
|
2235
|
+
})), Zr = ({ src: e, poster: t, mimeType: n, filename: r, preload: i, onClick: a, onDismiss: o }) => {
|
|
2243
2236
|
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Dr(a);
|
|
2244
2237
|
return /* @__PURE__ */ W("div", {
|
|
2245
2238
|
className: "relative w-fit",
|
|
@@ -2249,7 +2242,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2249
2242
|
onClick: () => l(0),
|
|
2250
2243
|
"aria-label": "Play video",
|
|
2251
2244
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2252
|
-
children: /* @__PURE__ */ U(
|
|
2245
|
+
children: /* @__PURE__ */ U(qr, {
|
|
2253
2246
|
item: {
|
|
2254
2247
|
src: e,
|
|
2255
2248
|
poster: t,
|
|
@@ -2264,7 +2257,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2264
2257
|
}) : null,
|
|
2265
2258
|
/* @__PURE__ */ U(Hr, {
|
|
2266
2259
|
open: s,
|
|
2267
|
-
items:
|
|
2260
|
+
items: Xr([{
|
|
2268
2261
|
src: e,
|
|
2269
2262
|
poster: t,
|
|
2270
2263
|
mimeType: n,
|
|
@@ -2275,8 +2268,8 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2275
2268
|
})
|
|
2276
2269
|
]
|
|
2277
2270
|
});
|
|
2278
|
-
},
|
|
2279
|
-
let d =
|
|
2271
|
+
}, Qr = ({ state: e, src: t, poster: n, mimeType: r, filename: i, items: a, text: o, groupPosition: s, preload: c, naturalAspectRatio: l, onClick: u }) => {
|
|
2272
|
+
let d = Yr({
|
|
2280
2273
|
src: t,
|
|
2281
2274
|
poster: n,
|
|
2282
2275
|
mimeType: r,
|
|
@@ -2289,7 +2282,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2289
2282
|
fallbackRatio: Ur
|
|
2290
2283
|
});
|
|
2291
2284
|
if (d.length === 0) return null;
|
|
2292
|
-
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) =>
|
|
2285
|
+
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) => Jr({
|
|
2293
2286
|
item: e,
|
|
2294
2287
|
index: t,
|
|
2295
2288
|
totalCount: d.length,
|
|
@@ -2315,7 +2308,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2315
2308
|
})
|
|
2316
2309
|
}), /* @__PURE__ */ U(Hr, {
|
|
2317
2310
|
open: p,
|
|
2318
|
-
items:
|
|
2311
|
+
items: Xr(d, i),
|
|
2319
2312
|
initialIndex: m,
|
|
2320
2313
|
onClose: g
|
|
2321
2314
|
})]
|
|
@@ -2323,12 +2316,12 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2323
2316
|
}, Q = {
|
|
2324
2317
|
Image: Pr,
|
|
2325
2318
|
Video: {
|
|
2326
|
-
Composer: (e) => /* @__PURE__ */ U(
|
|
2327
|
-
Sent: (e) => /* @__PURE__ */ U(
|
|
2319
|
+
Composer: (e) => /* @__PURE__ */ U(Zr, { ...e }),
|
|
2320
|
+
Sent: (e) => /* @__PURE__ */ U(Qr, {
|
|
2328
2321
|
...e,
|
|
2329
2322
|
state: "sent"
|
|
2330
2323
|
}),
|
|
2331
|
-
Received: (e) => /* @__PURE__ */ U(
|
|
2324
|
+
Received: (e) => /* @__PURE__ */ U(Qr, {
|
|
2332
2325
|
...e,
|
|
2333
2326
|
state: "received"
|
|
2334
2327
|
})
|
|
@@ -2342,22 +2335,22 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2342
2335
|
function $(e) {
|
|
2343
2336
|
return e?.trim() || void 0;
|
|
2344
2337
|
}
|
|
2345
|
-
function
|
|
2338
|
+
function $r(e) {
|
|
2346
2339
|
let { original_width: t, original_height: n } = e;
|
|
2347
2340
|
if (typeof t == "number" && typeof n == "number" && !(!Number.isFinite(t) || !Number.isFinite(n)) && !(t <= 0 || n <= 0)) return t / n;
|
|
2348
2341
|
}
|
|
2349
|
-
function
|
|
2342
|
+
function ei(e) {
|
|
2350
2343
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
2351
2344
|
}
|
|
2352
|
-
function
|
|
2345
|
+
function ti(e, t) {
|
|
2353
2346
|
if (!e?.trim() || !t?.trim()) return !1;
|
|
2354
|
-
let n =
|
|
2347
|
+
let n = ei(e), r = ei(t);
|
|
2355
2348
|
if (n === r) return !0;
|
|
2356
2349
|
if (!n.includes(r)) return !1;
|
|
2357
2350
|
let i = n.split(r).join("");
|
|
2358
2351
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(i);
|
|
2359
2352
|
}
|
|
2360
|
-
function
|
|
2353
|
+
function ni(e) {
|
|
2361
2354
|
let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.mime_type), i = $(e.asset_url), o = n && Tn(r, i) ? void 0 : i;
|
|
2362
2355
|
return {
|
|
2363
2356
|
title: $(e.title),
|
|
@@ -2371,10 +2364,10 @@ function ri(e) {
|
|
|
2371
2364
|
status: "ready"
|
|
2372
2365
|
};
|
|
2373
2366
|
}
|
|
2374
|
-
function
|
|
2367
|
+
function ri(e) {
|
|
2375
2368
|
return kt(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
|
|
2376
2369
|
}
|
|
2377
|
-
function
|
|
2370
|
+
function ii(e) {
|
|
2378
2371
|
if (!e?.length) return [];
|
|
2379
2372
|
let t = [], n = (e, n) => {
|
|
2380
2373
|
let r = t[t.length - 1];
|
|
@@ -2403,21 +2396,21 @@ function ai(e) {
|
|
|
2403
2396
|
r(t);
|
|
2404
2397
|
continue;
|
|
2405
2398
|
}
|
|
2406
|
-
let e =
|
|
2399
|
+
let e = ri(t);
|
|
2407
2400
|
e && n(e, t);
|
|
2408
2401
|
}
|
|
2409
2402
|
return t;
|
|
2410
2403
|
}
|
|
2411
|
-
function
|
|
2404
|
+
function ai(e) {
|
|
2412
2405
|
return e.filter((e) => e.type === "media").length;
|
|
2413
2406
|
}
|
|
2414
|
-
function
|
|
2407
|
+
function oi(e, t, n) {
|
|
2415
2408
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
2416
2409
|
}
|
|
2417
|
-
function
|
|
2410
|
+
function si(e) {
|
|
2418
2411
|
return $(e.image_url) ?? $(e.asset_url) ?? "";
|
|
2419
2412
|
}
|
|
2420
|
-
function
|
|
2413
|
+
function ci(e) {
|
|
2421
2414
|
switch (e) {
|
|
2422
2415
|
case "image": return Q.Image;
|
|
2423
2416
|
case "video": return Q.Video;
|
|
@@ -2426,17 +2419,17 @@ function li(e) {
|
|
|
2426
2419
|
default: return Q.File;
|
|
2427
2420
|
}
|
|
2428
2421
|
}
|
|
2429
|
-
function
|
|
2422
|
+
function li(e, t) {
|
|
2430
2423
|
switch (e) {
|
|
2431
2424
|
case "image": return {
|
|
2432
|
-
src:
|
|
2425
|
+
src: si(t),
|
|
2433
2426
|
alt: $(t.title)
|
|
2434
2427
|
};
|
|
2435
2428
|
case "video": return {
|
|
2436
2429
|
src: $(t.asset_url) ?? "",
|
|
2437
2430
|
poster: a(t.thumb_url),
|
|
2438
2431
|
mimeType: $(t.mime_type),
|
|
2439
|
-
naturalAspectRatio:
|
|
2432
|
+
naturalAspectRatio: $r(t)
|
|
2440
2433
|
};
|
|
2441
2434
|
case "audio": return {
|
|
2442
2435
|
src: $(t.asset_url) ?? "",
|
|
@@ -2456,30 +2449,30 @@ function ui(e, t) {
|
|
|
2456
2449
|
};
|
|
2457
2450
|
}
|
|
2458
2451
|
}
|
|
2459
|
-
function
|
|
2460
|
-
if (t.length > 1) return { items: t.map((t) =>
|
|
2452
|
+
function ui(e, t) {
|
|
2453
|
+
if (t.length > 1) return { items: t.map((t) => li(e, t)) };
|
|
2461
2454
|
let n = t[0];
|
|
2462
|
-
return n ?
|
|
2455
|
+
return n ? li(e, n) : {};
|
|
2463
2456
|
}
|
|
2464
|
-
function
|
|
2465
|
-
let r =
|
|
2466
|
-
...
|
|
2457
|
+
function di({ groupPosition: e, isMyMessage: t, segment: n }) {
|
|
2458
|
+
let r = ci(n.kind), i = {
|
|
2459
|
+
...ui(n.kind, n.attachments),
|
|
2467
2460
|
groupPosition: e
|
|
2468
2461
|
};
|
|
2469
2462
|
return U(t ? r.Sent : r.Received, { ...i });
|
|
2470
2463
|
}
|
|
2471
|
-
var
|
|
2472
|
-
let i =
|
|
2464
|
+
var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
2465
|
+
let i = ii(n.attachments);
|
|
2473
2466
|
if (i.length === 0) return null;
|
|
2474
|
-
let a =
|
|
2467
|
+
let a = ai(i), o = n.text?.trim(), s = i.find((e) => e.type === "link"), c = s?.type === "link" ? ni(s.attachments[0] ?? {}).url : void 0, l = o && ti(o, c) ? void 0 : o, u = 0, d = [], f = l ? "middle" : e, p = e === "single" || e === "end", m = (e, n, r) => {
|
|
2475
2468
|
let i = t ? zn.Sent : zn.Received;
|
|
2476
2469
|
d.push(/* @__PURE__ */ U(i, {
|
|
2477
|
-
...
|
|
2470
|
+
...ni(e),
|
|
2478
2471
|
groupPosition: r ? f : "middle"
|
|
2479
2472
|
}, n));
|
|
2480
2473
|
}, h = (n, r) => {
|
|
2481
|
-
let i =
|
|
2482
|
-
u += 1, d.push(/* @__PURE__ */ U(
|
|
2474
|
+
let i = oi(u, a, e);
|
|
2475
|
+
u += 1, d.push(/* @__PURE__ */ U(di, {
|
|
2483
2476
|
groupPosition: i,
|
|
2484
2477
|
isMyMessage: t,
|
|
2485
2478
|
segment: n
|
|
@@ -2506,7 +2499,11 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2506
2499
|
overflow: "visible",
|
|
2507
2500
|
padding: 0
|
|
2508
2501
|
},
|
|
2509
|
-
children: [
|
|
2502
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2503
|
+
"data-testid": "message-attachment-rows",
|
|
2504
|
+
className: J("flex flex-col gap-[4px]", t ? "items-end" : "items-start"),
|
|
2505
|
+
children: d
|
|
2506
|
+
}), !l && /* @__PURE__ */ U(M, {})]
|
|
2510
2507
|
}), l ? /* @__PURE__ */ W("div", {
|
|
2511
2508
|
"data-testid": "message-caption-bubble",
|
|
2512
2509
|
className: J("str-chat__message-bubble", { "relative isolate": p }),
|
|
@@ -2520,13 +2517,13 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2520
2517
|
]
|
|
2521
2518
|
}) : null]
|
|
2522
2519
|
});
|
|
2523
|
-
},
|
|
2520
|
+
}, pi = o.memo((e) => {
|
|
2524
2521
|
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: m, renderText: g, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound: x } = e, { client: S } = he("CustomMessage"), { channel: C } = me("CustomMessage"), { isUnlocking: w, onUnlockClick: T, onFetchSource: D, onDownloadClick: N } = Nt("LockedAttachment"), [F, L] = h(!1), z = be(m.id), { Attachment: te = b, EditMessageModal: ie = E, MessageActions: B, MessageBlocked: ae = O, MessageBouncePrompt: oe = A, MessageDeleted: fe = j, MessageIsThreadReplyInChannelButtonIndicator: pe = P, MessageRepliesCountButton: _e = I, ReminderNotification: ve = ne, StreamedMessageText: V = re, PinIndicator: ye } = ge("CustomMessage"), xe = ue(m), Se = de(m), G = p(() => d?.(m), [d, m]), K = p(() => {
|
|
2525
2522
|
let e = m.attachments ?? [], t = m.shared_location ? [m.shared_location, ...e] : e;
|
|
2526
2523
|
if (!Bt(m)) return t;
|
|
2527
2524
|
let n = t.filter((e) => !("type" in e) || !kt(e));
|
|
2528
2525
|
return n.length === t.length ? t : n;
|
|
2529
|
-
}, [m]), Ce = p(() =>
|
|
2526
|
+
}, [m]), Ce = p(() => ii(K), [K]), q = p(() => {
|
|
2530
2527
|
let e = Ot({
|
|
2531
2528
|
message: m,
|
|
2532
2529
|
viewerLanguage: v
|
|
@@ -2650,7 +2647,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2650
2647
|
!X && B && /* @__PURE__ */ U(B, {})
|
|
2651
2648
|
]
|
|
2652
2649
|
}), m.text && Ue]
|
|
2653
|
-
}) : Be ? /* @__PURE__ */ U(
|
|
2650
|
+
}) : Be ? /* @__PURE__ */ U(fi, {
|
|
2654
2651
|
groupPosition: De,
|
|
2655
2652
|
isMyMessage: X,
|
|
2656
2653
|
message: {
|
|
@@ -2704,14 +2701,14 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2704
2701
|
]
|
|
2705
2702
|
}, m.id)
|
|
2706
2703
|
] });
|
|
2707
|
-
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)),
|
|
2704
|
+
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)), mi = (e) => {
|
|
2708
2705
|
let t = V("CustomMessage"), n = u(Yt), r = t.message.metadata?.outbound_id, i = typeof r == "string" ? n?.[r] : void 0;
|
|
2709
|
-
return /* @__PURE__ */ U(
|
|
2706
|
+
return /* @__PURE__ */ U(pi, {
|
|
2710
2707
|
...t,
|
|
2711
2708
|
...e,
|
|
2712
2709
|
resolvedOutbound: i
|
|
2713
2710
|
});
|
|
2714
|
-
},
|
|
2711
|
+
}, hi = () => {
|
|
2715
2712
|
let { handleDelete: e, message: t } = V("CustomMessageActions");
|
|
2716
2713
|
return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */ U(Ye, {
|
|
2717
2714
|
onClick: e,
|
|
@@ -2724,7 +2721,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2724
2721
|
"aria-hidden": !0
|
|
2725
2722
|
})
|
|
2726
2723
|
});
|
|
2727
|
-
},
|
|
2724
|
+
}, gi = () => {
|
|
2728
2725
|
let { handleFlag: e } = V("CustomMessageActions");
|
|
2729
2726
|
return /* @__PURE__ */ U(Ye, {
|
|
2730
2727
|
onClick: e,
|
|
@@ -2737,19 +2734,19 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2737
2734
|
"aria-hidden": !0
|
|
2738
2735
|
})
|
|
2739
2736
|
});
|
|
2740
|
-
},
|
|
2737
|
+
}, _i = () => {
|
|
2741
2738
|
let { message: e } = V("CustomMessageActions");
|
|
2742
2739
|
return e.metadata?.custom_type === G.ATTACHMENT ? /* @__PURE__ */ U(Xe, { messageActionSet: [{
|
|
2743
|
-
Component:
|
|
2740
|
+
Component: hi,
|
|
2744
2741
|
placement: "quick",
|
|
2745
2742
|
type: "delete"
|
|
2746
2743
|
}, {
|
|
2747
|
-
Component:
|
|
2744
|
+
Component: gi,
|
|
2748
2745
|
placement: "quick",
|
|
2749
2746
|
type: "flag"
|
|
2750
2747
|
}] }) : null;
|
|
2751
|
-
},
|
|
2752
|
-
let { linkPreviewsManager: e } = _e(), { linkPreviews: t } = xe(e.state,
|
|
2748
|
+
}, vi = (e) => ({ linkPreviews: Array.from(e.previews.values()).filter((e) => _.previewIsLoaded(e) || _.previewIsLoading(e)) }), yi = () => {
|
|
2749
|
+
let { linkPreviewsManager: e } = _e(), { linkPreviews: t } = xe(e.state, vi), n = (t) => {
|
|
2753
2750
|
e.dismissPreview(t);
|
|
2754
2751
|
};
|
|
2755
2752
|
return t.length > 0 ? /* @__PURE__ */ U("div", {
|
|
@@ -2767,7 +2764,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2767
2764
|
}, e.og_scrape_url);
|
|
2768
2765
|
})
|
|
2769
2766
|
}) : null;
|
|
2770
|
-
},
|
|
2767
|
+
}, bi = o.createContext(!1), xi = 200, Si = () => u(bi), Ci = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ U("button", {
|
|
2771
2768
|
...n,
|
|
2772
2769
|
type: "button",
|
|
2773
2770
|
"aria-label": "Send",
|
|
@@ -2778,8 +2775,8 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2778
2775
|
weight: "bold",
|
|
2779
2776
|
className: "size-4"
|
|
2780
2777
|
})
|
|
2781
|
-
}),
|
|
2782
|
-
let e = u(
|
|
2778
|
+
}), wi = () => {
|
|
2779
|
+
let e = u(bi), { handleSubmit: t } = ye(), n = ve(), r = e || !n, { SendButton: i = Ci, AttachmentPreviewList: a = x } = ge("CustomMessageInput"), s = o.useRef(null);
|
|
2783
2780
|
return o.useEffect(() => {
|
|
2784
2781
|
let e = s.current;
|
|
2785
2782
|
if (!e || typeof ResizeObserver > "u") return;
|
|
@@ -2804,7 +2801,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2804
2801
|
className: "messaging-composer-previews empty:hidden flex flex-col gap-2 px-2 pt-2",
|
|
2805
2802
|
children: [
|
|
2806
2803
|
/* @__PURE__ */ U(te, {}),
|
|
2807
|
-
/* @__PURE__ */ U(
|
|
2804
|
+
/* @__PURE__ */ U(yi, {}),
|
|
2808
2805
|
/* @__PURE__ */ U(a, {})
|
|
2809
2806
|
]
|
|
2810
2807
|
}), /* @__PURE__ */ W("div", {
|
|
@@ -2833,7 +2830,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2833
2830
|
})]
|
|
2834
2831
|
})]
|
|
2835
2832
|
});
|
|
2836
|
-
},
|
|
2833
|
+
}, Ti = () => /* @__PURE__ */ W("div", {
|
|
2837
2834
|
className: "messaging-composer-backdrop",
|
|
2838
2835
|
"aria-hidden": "true",
|
|
2839
2836
|
children: [
|
|
@@ -2844,7 +2841,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2844
2841
|
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-blur" }),
|
|
2845
2842
|
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-gradient" })
|
|
2846
2843
|
]
|
|
2847
|
-
}),
|
|
2844
|
+
}), Ei = ({ renderActions: e, renderHeader: t, renderFooter: n, disabled: r = !1, disabledReason: i, composerInput: a }) => {
|
|
2848
2845
|
let { channel: s } = me(), c = s?.data?.frozen === !0, l = !!a, u = o.useRef(null);
|
|
2849
2846
|
return o.useEffect(() => {
|
|
2850
2847
|
if (!l) return;
|
|
@@ -2853,7 +2850,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2853
2850
|
let n = e.offsetHeight, r = () => {
|
|
2854
2851
|
let r = e.offsetHeight, i = r > n;
|
|
2855
2852
|
n = r;
|
|
2856
|
-
let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight <
|
|
2853
|
+
let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight < xi : !1;
|
|
2857
2854
|
t.style.setProperty("--messaging-composer-height", `${r}px`), i && o && a && (a.scrollTop = a.scrollHeight);
|
|
2858
2855
|
};
|
|
2859
2856
|
if (r(), typeof ResizeObserver > "u") return;
|
|
@@ -2865,7 +2862,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2865
2862
|
ref: u,
|
|
2866
2863
|
"data-testid": "composer-chrome",
|
|
2867
2864
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2868
|
-
children: [/* @__PURE__ */ U(
|
|
2865
|
+
children: [/* @__PURE__ */ U(Ti, {}), /* @__PURE__ */ W("div", {
|
|
2869
2866
|
className: "relative z-10 flex flex-col",
|
|
2870
2867
|
children: [
|
|
2871
2868
|
t?.(),
|
|
@@ -2895,7 +2892,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2895
2892
|
ref: u,
|
|
2896
2893
|
"data-testid": "composer-chrome",
|
|
2897
2894
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2898
|
-
children: [/* @__PURE__ */ U(
|
|
2895
|
+
children: [/* @__PURE__ */ U(Ti, {}), /* @__PURE__ */ W("div", {
|
|
2899
2896
|
className: "relative z-10 flex min-h-0 flex-col",
|
|
2900
2897
|
children: [t?.(), /* @__PURE__ */ W("div", {
|
|
2901
2898
|
className: "flex min-h-0 flex-col gap-4 p-3 pb-5 md:p-5",
|
|
@@ -2907,9 +2904,9 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2907
2904
|
children: [e && /* @__PURE__ */ U("div", {
|
|
2908
2905
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2909
2906
|
children: e()
|
|
2910
|
-
}), /* @__PURE__ */ U(
|
|
2907
|
+
}), /* @__PURE__ */ U(bi.Provider, {
|
|
2911
2908
|
value: c,
|
|
2912
|
-
children: /* @__PURE__ */ U(N, { Input: a ??
|
|
2909
|
+
children: /* @__PURE__ */ U(N, { Input: a ?? wi })
|
|
2913
2910
|
})]
|
|
2914
2911
|
}), n?.()]
|
|
2915
2912
|
})]
|
|
@@ -2926,18 +2923,18 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2926
2923
|
children: [e && /* @__PURE__ */ U("div", {
|
|
2927
2924
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2928
2925
|
children: e()
|
|
2929
|
-
}), /* @__PURE__ */ U(
|
|
2926
|
+
}), /* @__PURE__ */ U(bi.Provider, {
|
|
2930
2927
|
value: c,
|
|
2931
|
-
children: /* @__PURE__ */ U(N, { Input:
|
|
2928
|
+
children: /* @__PURE__ */ U(N, { Input: wi })
|
|
2932
2929
|
})]
|
|
2933
2930
|
}),
|
|
2934
2931
|
n?.()
|
|
2935
2932
|
]
|
|
2936
2933
|
});
|
|
2937
|
-
},
|
|
2934
|
+
}, Di = {
|
|
2938
2935
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
2939
2936
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
2940
|
-
},
|
|
2937
|
+
}, Oi = ["SYSTEM_AGE_SAFETY_BLOCKED"], ki = { SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines." }, Ai = "age safety guidelines.", ji = "https://linktr.ee/s/about/contact", Mi = (e) => Oi.includes(e), Ni = (e) => Mi(e.metadata?.custom_type), Pi = (e) => {
|
|
2941
2938
|
let t = e.metadata?.custom_type;
|
|
2942
2939
|
if (q(t)) return {
|
|
2943
2940
|
kind: "dm-agent",
|
|
@@ -2952,25 +2949,25 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2952
2949
|
kind: "dm-agent",
|
|
2953
2950
|
type: n
|
|
2954
2951
|
};
|
|
2955
|
-
},
|
|
2956
|
-
let t = e.indexOf(
|
|
2952
|
+
}, Fi = (e) => {
|
|
2953
|
+
let t = e.indexOf(Ai);
|
|
2957
2954
|
if (t === -1) return e;
|
|
2958
2955
|
let n = t + 22;
|
|
2959
2956
|
return /* @__PURE__ */ W(H, { children: [
|
|
2960
2957
|
e.slice(0, t),
|
|
2961
2958
|
/* @__PURE__ */ U("a", {
|
|
2962
|
-
href:
|
|
2959
|
+
href: ji,
|
|
2963
2960
|
target: "_blank",
|
|
2964
2961
|
rel: "noopener noreferrer",
|
|
2965
2962
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
2966
|
-
children:
|
|
2963
|
+
children: Ai
|
|
2967
2964
|
}),
|
|
2968
2965
|
e.slice(n)
|
|
2969
2966
|
] });
|
|
2970
|
-
},
|
|
2971
|
-
let t = !
|
|
2967
|
+
}, Ii = (e) => {
|
|
2968
|
+
let t = !Ni(e.message), n = Pi(e.message);
|
|
2972
2969
|
if (n?.kind === "dm-agent") {
|
|
2973
|
-
let r = e.message.text?.trim() ||
|
|
2970
|
+
let r = e.message.text?.trim() || Di[n.type];
|
|
2974
2971
|
return /* @__PURE__ */ W("div", {
|
|
2975
2972
|
className: "str-chat__message--system",
|
|
2976
2973
|
"data-testid": "message-system",
|
|
@@ -2991,7 +2988,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2991
2988
|
});
|
|
2992
2989
|
}
|
|
2993
2990
|
if (n?.kind === "age-safety") {
|
|
2994
|
-
let r = e.message.text?.trim() ||
|
|
2991
|
+
let r = e.message.text?.trim() || ki[n.type];
|
|
2995
2992
|
return /* @__PURE__ */ W("div", {
|
|
2996
2993
|
className: "str-chat__message--system",
|
|
2997
2994
|
"data-testid": "message-system",
|
|
@@ -3009,7 +3006,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3009
3006
|
className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]",
|
|
3010
3007
|
children: /* @__PURE__ */ U("p", {
|
|
3011
3008
|
className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
3012
|
-
children:
|
|
3009
|
+
children: Fi(r)
|
|
3013
3010
|
})
|
|
3014
3011
|
})]
|
|
3015
3012
|
}), !t && /* @__PURE__ */ U(z, { message: e.message })]
|
|
@@ -3027,7 +3024,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3027
3024
|
]
|
|
3028
3025
|
}), !t && /* @__PURE__ */ U(z, { message: e.message })]
|
|
3029
3026
|
});
|
|
3030
|
-
},
|
|
3027
|
+
}, Li = c(!1), Ri = ({ cx: e, index: t }) => /* @__PURE__ */ U("circle", {
|
|
3031
3028
|
cx: e,
|
|
3032
3029
|
cy: "6.15",
|
|
3033
3030
|
r: "3.9",
|
|
@@ -3040,15 +3037,15 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3040
3037
|
begin: `${120 * t}ms`,
|
|
3041
3038
|
repeatCount: "indefinite"
|
|
3042
3039
|
})
|
|
3043
|
-
}),
|
|
3040
|
+
}), zi = /* @__PURE__ */ new Set([
|
|
3044
3041
|
y.Thinking,
|
|
3045
3042
|
y.Generating,
|
|
3046
3043
|
y.ExternalSources
|
|
3047
|
-
]),
|
|
3048
|
-
let { channel: t, channelConfig: n, thread: r } = me(), { client: i } = he(), { typing: a = {} } = Se(), { aiState: o } = fe(t), s = u(
|
|
3049
|
-
if (!e && s &&
|
|
3050
|
-
let e =
|
|
3051
|
-
return /* @__PURE__ */ U(
|
|
3044
|
+
]), Bi = ({ threadList: e }) => {
|
|
3045
|
+
let { channel: t, channelConfig: n, thread: r } = me(), { client: i } = he(), { typing: a = {} } = Se(), { aiState: o } = fe(t), s = u(Li);
|
|
3046
|
+
if (!e && s && zi.has(o)) {
|
|
3047
|
+
let e = Hi(t, i.user?.id);
|
|
3048
|
+
return /* @__PURE__ */ U(Vi, {
|
|
3052
3049
|
avatarId: e?.id ?? "ai-agent",
|
|
3053
3050
|
avatarName: e?.name ?? e?.id ?? "Agent",
|
|
3054
3051
|
avatarImage: e?.image,
|
|
@@ -3059,13 +3056,13 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3059
3056
|
let c = e ? [] : Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && !e), l = e ? Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && e === r?.id) : [], d = e ? l : c;
|
|
3060
3057
|
if (!d.length) return null;
|
|
3061
3058
|
let f = d[0]?.user, p = f?.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
3062
|
-
return /* @__PURE__ */ U(
|
|
3059
|
+
return /* @__PURE__ */ U(Vi, {
|
|
3063
3060
|
avatarId: f?.id ?? p?.id ?? "typing-user",
|
|
3064
3061
|
avatarName: f?.name ?? p?.name ?? f?.id ?? "Typing user",
|
|
3065
3062
|
avatarImage: f?.image ?? p?.image,
|
|
3066
3063
|
testId: "typing-indicator"
|
|
3067
3064
|
});
|
|
3068
|
-
},
|
|
3065
|
+
}, Vi = ({ avatarId: e, avatarName: t, avatarImage: n, testId: r }) => /* @__PURE__ */ U("div", {
|
|
3069
3066
|
className: "str-chat__li str-chat__li--single str-chat__typing-indicator !static",
|
|
3070
3067
|
"data-testid": r,
|
|
3071
3068
|
style: { marginBottom: "var(--messaging-channel-input-spacer-height, 80px)" },
|
|
@@ -3096,15 +3093,15 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3096
3093
|
height: "13",
|
|
3097
3094
|
overflow: "visible",
|
|
3098
3095
|
children: [
|
|
3099
|
-
/* @__PURE__ */ U(
|
|
3096
|
+
/* @__PURE__ */ U(Ri, {
|
|
3100
3097
|
cx: "4",
|
|
3101
3098
|
index: 0
|
|
3102
3099
|
}),
|
|
3103
|
-
/* @__PURE__ */ U(
|
|
3100
|
+
/* @__PURE__ */ U(Ri, {
|
|
3104
3101
|
cx: "16",
|
|
3105
3102
|
index: 1
|
|
3106
3103
|
}),
|
|
3107
|
-
/* @__PURE__ */ U(
|
|
3104
|
+
/* @__PURE__ */ U(Ri, {
|
|
3108
3105
|
cx: "28",
|
|
3109
3106
|
index: 2
|
|
3110
3107
|
})
|
|
@@ -3117,7 +3114,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3117
3114
|
})]
|
|
3118
3115
|
})
|
|
3119
3116
|
});
|
|
3120
|
-
function
|
|
3117
|
+
function Hi(e, t) {
|
|
3121
3118
|
let n = e?.state?.members ?? {};
|
|
3122
3119
|
for (let e of Object.values(n)) {
|
|
3123
3120
|
let n = e?.user;
|
|
@@ -3126,7 +3123,7 @@ function Ui(e, t) {
|
|
|
3126
3123
|
}
|
|
3127
3124
|
//#endregion
|
|
3128
3125
|
//#region src/components/MessagingShell/ChannelEmptyState.tsx
|
|
3129
|
-
var
|
|
3126
|
+
var Ui = () => null, Wi = ({ className: e, message: t }) => /* @__PURE__ */ W("div", {
|
|
3130
3127
|
className: J("flex items-center justify-center h-full", e),
|
|
3131
3128
|
children: [/* @__PURE__ */ W("svg", {
|
|
3132
3129
|
viewBox: "0 0 100 100",
|
|
@@ -3177,20 +3174,20 @@ var Wi = () => null, Gi = ({ className: e, message: t }) => /* @__PURE__ */ W("d
|
|
|
3177
3174
|
className: "text-stone",
|
|
3178
3175
|
children: t
|
|
3179
3176
|
})]
|
|
3180
|
-
}),
|
|
3177
|
+
}), Gi = o.memo(() => /* @__PURE__ */ U("div", {
|
|
3181
3178
|
className: "messaging-loading-state flex items-center justify-center h-full",
|
|
3182
3179
|
children: /* @__PURE__ */ W("div", {
|
|
3183
3180
|
className: "flex items-center",
|
|
3184
|
-
children: [/* @__PURE__ */ U(
|
|
3181
|
+
children: [/* @__PURE__ */ U(Wi, { className: "w-6 h-6" }), /* @__PURE__ */ U("span", {
|
|
3185
3182
|
className: "text-sm text-stone",
|
|
3186
3183
|
children: "Loading messages"
|
|
3187
3184
|
})]
|
|
3188
3185
|
})
|
|
3189
3186
|
}));
|
|
3190
|
-
|
|
3187
|
+
Gi.displayName = "LoadingState";
|
|
3191
3188
|
//#endregion
|
|
3192
3189
|
//#region src/components/ChannelView.tsx
|
|
3193
|
-
var
|
|
3190
|
+
var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMessageInputFooter: r, renderConversationFooter: i, onLeaveConversation: a, onBlockParticipant: s, showDeleteConversation: c = !0, onDeleteConversationClick: u, onBlockParticipantClick: f, onReportParticipantClick: p, showBlockParticipant: h = !0, showReportParticipant: g = !0, composerDisabled: _ = !1, composerDisabledReason: v, showStarButton: y = !1, renderChannelBanner: b, customChannelActions: x, renderChannelActions: S, renderMessage: C, viewerLanguage: w, showChannelInfo: T = !0, onParticipantNameClick: E, onOutboundClick: D, resolveOutbound: O, composerInput: k }) => {
|
|
3194
3191
|
let { channel: A, messages: j } = me(), M = m(D);
|
|
3195
3192
|
d(() => {
|
|
3196
3193
|
M.current = D;
|
|
@@ -3215,7 +3212,7 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3215
3212
|
renderChannelActions: S,
|
|
3216
3213
|
onParticipantNameClick: E
|
|
3217
3214
|
}), ee = l((e) => {
|
|
3218
|
-
let { message: t } = V("ChannelView"), n = /* @__PURE__ */ U(
|
|
3215
|
+
let { message: t } = V("ChannelView"), n = /* @__PURE__ */ U(mi, {
|
|
3219
3216
|
...e,
|
|
3220
3217
|
viewerLanguage: w,
|
|
3221
3218
|
onOutboundClick: P
|
|
@@ -3231,7 +3228,7 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3231
3228
|
children: /* @__PURE__ */ U(ae, {
|
|
3232
3229
|
overrides: {
|
|
3233
3230
|
Message: ee,
|
|
3234
|
-
MessageActions:
|
|
3231
|
+
MessageActions: _i,
|
|
3235
3232
|
UnreadMessagesNotification: () => null,
|
|
3236
3233
|
UnreadMessagesSeparator: () => null
|
|
3237
3234
|
},
|
|
@@ -3253,7 +3250,7 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3253
3250
|
hideDeletedMessages: !0,
|
|
3254
3251
|
hideNewMessageSeparator: !1
|
|
3255
3252
|
})]
|
|
3256
|
-
}, "lt-channel-message-list"), /* @__PURE__ */ U(
|
|
3253
|
+
}, "lt-channel-message-list"), /* @__PURE__ */ U(Ei, {
|
|
3257
3254
|
...n && { renderActions: () => n?.(A) },
|
|
3258
3255
|
...i && { renderHeader: () => i(A) },
|
|
3259
3256
|
renderFooter: () => r?.(A),
|
|
@@ -3280,7 +3277,7 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3280
3277
|
})]
|
|
3281
3278
|
}, "lt-channel-message-list"),
|
|
3282
3279
|
i ? /* @__PURE__ */ U(o.Fragment, { children: i(A) }, "lt-channel-conversation-footer") : null,
|
|
3283
|
-
/* @__PURE__ */ U(
|
|
3280
|
+
/* @__PURE__ */ U(Ei, {
|
|
3284
3281
|
...n && { renderActions: () => n?.(A) },
|
|
3285
3282
|
renderFooter: () => r?.(A),
|
|
3286
3283
|
disabled: _,
|
|
@@ -3290,7 +3287,7 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3290
3287
|
] }) })
|
|
3291
3288
|
})
|
|
3292
3289
|
});
|
|
3293
|
-
},
|
|
3290
|
+
}, qi = o.memo(({ channel: e, onBack: t, showBackButton: n = !1, renderMessageInputActions: r, renderMessageInputFooter: i, renderConversationFooter: a, onLeaveConversation: o, onBlockParticipant: s, className: c, CustomChannelEmptyState: u = Ui, showDeleteConversation: f = !0, onDeleteConversationClick: p, onBlockParticipantClick: h, onReportParticipantClick: g, showBlockParticipant: _ = !0, showReportParticipant: v = !0, composerDisabled: y = !1, composerDisabledReason: b, dmAgentEnabled: x, messageMetadata: C, onMessageSent: w, showStarButton: T = !1, renderChannelBanner: E, customChannelActions: D, renderChannelActions: O, renderMessage: k, onMessageLinkClick: A, sendButton: j, attachmentPreviewList: M, viewerLanguage: N, showChannelInfo: P = !0, onParticipantNameClick: F, onOutboundClick: I, resolveOutbound: L, composerInput: R }) => {
|
|
3294
3291
|
let z = l(async (t, n, r) => {
|
|
3295
3292
|
let i = e.data?.chatbot_paused === !0, a = x && !i, o = {
|
|
3296
3293
|
...n,
|
|
@@ -3328,19 +3325,19 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3328
3325
|
"data-testid": "channel-view",
|
|
3329
3326
|
className: J("messaging-channel-view h-full flex flex-col", c),
|
|
3330
3327
|
style: te,
|
|
3331
|
-
children: /* @__PURE__ */ U(
|
|
3328
|
+
children: /* @__PURE__ */ U(Li.Provider, {
|
|
3332
3329
|
value: x ?? !1,
|
|
3333
3330
|
children: /* @__PURE__ */ U(S, {
|
|
3334
3331
|
channel: e,
|
|
3335
|
-
MessageSystem:
|
|
3332
|
+
MessageSystem: Ii,
|
|
3336
3333
|
EmptyStateIndicator: u,
|
|
3337
|
-
LoadingIndicator:
|
|
3334
|
+
LoadingIndicator: Gi,
|
|
3338
3335
|
DateSeparator: Et,
|
|
3339
|
-
TypingIndicator:
|
|
3336
|
+
TypingIndicator: Bi,
|
|
3340
3337
|
doSendMessageRequest: z,
|
|
3341
3338
|
...j ? { SendButton: j } : {},
|
|
3342
3339
|
...M ? { AttachmentPreviewList: M } : {},
|
|
3343
|
-
children: /* @__PURE__ */ U(
|
|
3340
|
+
children: /* @__PURE__ */ U(Ki, {
|
|
3344
3341
|
onBack: t,
|
|
3345
3342
|
showBackButton: n,
|
|
3346
3343
|
renderMessageInputActions: r,
|
|
@@ -3373,10 +3370,10 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3373
3370
|
})
|
|
3374
3371
|
});
|
|
3375
3372
|
});
|
|
3376
|
-
|
|
3373
|
+
qi.displayName = "ChannelView";
|
|
3377
3374
|
//#endregion
|
|
3378
3375
|
//#region src/components/MessagingShell/ErrorState.tsx
|
|
3379
|
-
var
|
|
3376
|
+
var Ji = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ U("div", {
|
|
3380
3377
|
className: "messaging-error-state flex items-center justify-center h-full p-8",
|
|
3381
3378
|
children: /* @__PURE__ */ W("div", {
|
|
3382
3379
|
className: "text-center max-w-sm",
|
|
@@ -3405,10 +3402,10 @@ var Yi = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ U("div", {
|
|
|
3405
3402
|
]
|
|
3406
3403
|
})
|
|
3407
3404
|
}));
|
|
3408
|
-
|
|
3405
|
+
Ji.displayName = "ErrorState";
|
|
3409
3406
|
//#endregion
|
|
3410
3407
|
//#region src/components/MessagingShell/index.tsx
|
|
3411
|
-
var
|
|
3408
|
+
var Yi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversationFooter: n, onChannelSelect: r, onExitConversation: i, initialParticipantFilter: a, initialParticipantData: o, CustomChannelEmptyState: s, onBlockParticipantClick: c, onReportParticipantClick: u, dmAgentEnabled: f, onMessageSent: p, viewerLanguage: g, renderChannelBanner: _, customChannelActions: v, renderChannelActions: y, onParticipantNameClick: b, onOutboundClick: x, resolveOutbound: S, renderMessage: C, onMessageLinkClick: w, showChannelInfo: T, composerInput: E, attachmentPreviewList: D }) => {
|
|
3412
3409
|
let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } = at(), [F, I] = h(null), [L, R] = h(null), [z, ee] = h(!1), { showDeleteConversation: te = !0 } = e, ne = m(o);
|
|
3413
3410
|
ne.current = o;
|
|
3414
3411
|
let re = m(r);
|
|
@@ -3468,17 +3465,17 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3468
3465
|
let oe = l(() => {
|
|
3469
3466
|
I(null), ee(!0), ae.current?.();
|
|
3470
3467
|
}, []);
|
|
3471
|
-
return A ? /* @__PURE__ */ U(
|
|
3468
|
+
return A ? /* @__PURE__ */ U(Gi, {}) : j ? /* @__PURE__ */ U(Ji, {
|
|
3472
3469
|
message: j,
|
|
3473
3470
|
onBack: M
|
|
3474
|
-
}) : !k || !O ? /* @__PURE__ */ U(
|
|
3471
|
+
}) : !k || !O ? /* @__PURE__ */ U(Ji, {
|
|
3475
3472
|
message: "Not connected to messaging service",
|
|
3476
3473
|
onBack: M
|
|
3477
|
-
}) : L ? /* @__PURE__ */ U(
|
|
3474
|
+
}) : L ? /* @__PURE__ */ U(Ji, { message: L }) : z && !F ? /* @__PURE__ */ U(Ji, { message: "Conversation ended" }) : F ? /* @__PURE__ */ U("div", {
|
|
3478
3475
|
className: "messaging-shell h-full bg-background-primary overflow-hidden",
|
|
3479
3476
|
children: /* @__PURE__ */ U("div", {
|
|
3480
3477
|
className: "flex h-full min-h-0 flex-col",
|
|
3481
|
-
children: /* @__PURE__ */ U(
|
|
3478
|
+
children: /* @__PURE__ */ U(qi, {
|
|
3482
3479
|
channel: F,
|
|
3483
3480
|
renderMessageInputActions: t,
|
|
3484
3481
|
renderConversationFooter: n,
|
|
@@ -3504,30 +3501,30 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3504
3501
|
attachmentPreviewList: D
|
|
3505
3502
|
}, F.id)
|
|
3506
3503
|
})
|
|
3507
|
-
}) : /* @__PURE__ */ U(
|
|
3504
|
+
}) : /* @__PURE__ */ U(Gi, {});
|
|
3508
3505
|
};
|
|
3509
3506
|
//#endregion
|
|
3510
3507
|
//#region src/hooks/useRestorePendingMessages.ts
|
|
3511
|
-
function
|
|
3508
|
+
function Xi(e) {
|
|
3512
3509
|
let t = e.state.pending_messages;
|
|
3513
3510
|
if (t?.length) for (let n of t) e.state.addMessageSorted(n.message);
|
|
3514
3511
|
}
|
|
3515
3512
|
//#endregion
|
|
3516
3513
|
//#region src/components/ChannelList/ChannelListContext.tsx
|
|
3517
|
-
var
|
|
3514
|
+
var Zi = o.createContext({
|
|
3518
3515
|
selectedChannel: void 0,
|
|
3519
3516
|
onChannelSelect: () => {},
|
|
3520
3517
|
debug: !1,
|
|
3521
3518
|
renderMessagePreview: void 0,
|
|
3522
3519
|
channelPreview: void 0,
|
|
3523
3520
|
viewerLanguage: void 0
|
|
3524
|
-
}),
|
|
3521
|
+
}), Qi = Zi.Provider, $i = () => o.useContext(Zi), ea = (e, t) => {
|
|
3525
3522
|
let n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), r = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
|
|
3526
3523
|
return Math.floor((r - n) / 864e5);
|
|
3527
|
-
},
|
|
3524
|
+
}, ta = (e) => {
|
|
3528
3525
|
let t = /* @__PURE__ */ new Date();
|
|
3529
3526
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60) return "Just now";
|
|
3530
|
-
let n =
|
|
3527
|
+
let n = ea(e, t);
|
|
3531
3528
|
return n === 0 ? e.toLocaleTimeString([], {
|
|
3532
3529
|
hour: "numeric",
|
|
3533
3530
|
minute: "2-digit",
|
|
@@ -3540,8 +3537,8 @@ var Qi = o.createContext({
|
|
|
3540
3537
|
day: "numeric",
|
|
3541
3538
|
year: "numeric"
|
|
3542
3539
|
});
|
|
3543
|
-
},
|
|
3544
|
-
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } =
|
|
3540
|
+
}, na = o.memo((e) => {
|
|
3541
|
+
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } = $i(), { client: l } = he(), u = r?.id === t?.id, d = ot(t);
|
|
3545
3542
|
if (o) return /* @__PURE__ */ U(o, {
|
|
3546
3543
|
...e,
|
|
3547
3544
|
active: u,
|
|
@@ -3573,7 +3570,7 @@ var Qi = o.createContext({
|
|
|
3573
3570
|
if (e) return e;
|
|
3574
3571
|
let r = _?.attachments?.[0];
|
|
3575
3572
|
return r ? r.og_scrape_url ? r.og_scrape_url : r.type === "image" ? "📷 Sent an image" : r.type === "video" ? "🎥 Sent a video" : r.type === "audio" ? "🎵 Sent audio" : r.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
3576
|
-
})(), y = _?.created_at ?
|
|
3573
|
+
})(), y = _?.created_at ? ta(new Date(_.created_at)) : "", b = _ ? Bt(_) : !1, x = s ? s(_, v) : `${b ? "✨ " : ""}${v}`, S = n ?? 0;
|
|
3577
3574
|
return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
3578
3575
|
channelId: t?.id,
|
|
3579
3576
|
isSelected: u,
|
|
@@ -3628,14 +3625,14 @@ var Qi = o.createContext({
|
|
|
3628
3625
|
})
|
|
3629
3626
|
});
|
|
3630
3627
|
});
|
|
3631
|
-
|
|
3628
|
+
na.displayName = "CustomChannelPreview";
|
|
3632
3629
|
//#endregion
|
|
3633
3630
|
//#region src/components/ChannelList/index.tsx
|
|
3634
|
-
var
|
|
3631
|
+
var ra = { last_message_at: -1 }, ia = o.memo(({ onChannelSelect: e, selectedChannel: t, filters: n, allowNewMessagesFromUnfilteredChannels: r = !1, channelRenderFilterFn: i, sort: a = ra, className: s, customEmptyStateIndicator: c, channelListPaginator: l = D, channelPreview: u, renderMessagePreview: d, viewerLanguage: f, lockChannelOrder: p, onMessageNewHandler: m, onMessageNew: h, onChannelVisible: g, onAddedToChannel: _, onChannelUpdated: v }) => {
|
|
3635
3632
|
let y = o.useRef(0);
|
|
3636
3633
|
y.current++;
|
|
3637
3634
|
let { debug: b = !1 } = rt(), x = o.useCallback((e) => {
|
|
3638
|
-
for (let t of e)
|
|
3635
|
+
for (let t of e) Xi(t);
|
|
3639
3636
|
return i ? i(e) : e;
|
|
3640
3637
|
}, [i]);
|
|
3641
3638
|
b && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
@@ -3662,7 +3659,7 @@ var ia = { last_message_at: -1 }, aa = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3662
3659
|
className: J("messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden", s),
|
|
3663
3660
|
children: /* @__PURE__ */ U("div", {
|
|
3664
3661
|
className: "flex-1 overflow-hidden min-w-0",
|
|
3665
|
-
children: /* @__PURE__ */ U(
|
|
3662
|
+
children: /* @__PURE__ */ U(Qi, {
|
|
3666
3663
|
value: S,
|
|
3667
3664
|
children: /* @__PURE__ */ U(C, {
|
|
3668
3665
|
filters: n,
|
|
@@ -3677,20 +3674,20 @@ var ia = { last_message_at: -1 }, aa = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3677
3674
|
onAddedToChannel: _,
|
|
3678
3675
|
onChannelUpdated: v,
|
|
3679
3676
|
Paginator: l,
|
|
3680
|
-
Preview:
|
|
3677
|
+
Preview: na,
|
|
3681
3678
|
EmptyStateIndicator: c
|
|
3682
3679
|
}, `${JSON.stringify(n)}:${JSON.stringify(a)}`)
|
|
3683
3680
|
})
|
|
3684
3681
|
})
|
|
3685
3682
|
});
|
|
3686
3683
|
});
|
|
3687
|
-
|
|
3684
|
+
ia.displayName = "ChannelList";
|
|
3688
3685
|
//#endregion
|
|
3689
3686
|
//#region src/components/RichCard/RichCardBody.tsx
|
|
3690
|
-
var
|
|
3687
|
+
var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa = "text-[14px] leading-5 tracking-[0.02em]", sa = () => /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("br", {}), /* @__PURE__ */ U("span", {
|
|
3691
3688
|
"aria-hidden": !0,
|
|
3692
3689
|
className: "block h-1.5"
|
|
3693
|
-
})] }),
|
|
3690
|
+
})] }), ca = (e) => e.split(/\r?\n/).map((e, t, n) => /* @__PURE__ */ W(o.Fragment, { children: [e, t < n.length - 1 ? /* @__PURE__ */ U(sa, {}) : null] }, t)), la = ({ surface: e, actions: t, layout: n }) => {
|
|
3694
3691
|
if (t == null || t.length === 0) return null;
|
|
3695
3692
|
let r = n === "stacked";
|
|
3696
3693
|
return /* @__PURE__ */ U("div", {
|
|
@@ -3702,7 +3699,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3702
3699
|
standalone: !0
|
|
3703
3700
|
}, `${t.label}-${n}`))
|
|
3704
3701
|
});
|
|
3705
|
-
},
|
|
3702
|
+
}, ua = ({ ctaSurface: e, chinTextColor: t, title: n, subtitle: r, subtitleLines: i = 3, appIcon: a, actions: o }) => {
|
|
3706
3703
|
let s = n != null && n.trim() !== "", c = r != null && r.trim() !== "", l = o != null && o.length > 0;
|
|
3707
3704
|
if (!s && !c && !l) return null;
|
|
3708
3705
|
let u = { color: t }, d = i > 1 ? {
|
|
@@ -3719,14 +3716,14 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3719
3716
|
className: "shrink-0",
|
|
3720
3717
|
children: a
|
|
3721
3718
|
}) : null, /* @__PURE__ */ U("p", {
|
|
3722
|
-
className: J("min-w-0",
|
|
3719
|
+
className: J("min-w-0", aa),
|
|
3723
3720
|
style: u,
|
|
3724
3721
|
children: n
|
|
3725
3722
|
})]
|
|
3726
3723
|
}), c && /* @__PURE__ */ U("p", {
|
|
3727
|
-
className: J(
|
|
3724
|
+
className: J(oa, i <= 1 && "truncate"),
|
|
3728
3725
|
style: d,
|
|
3729
|
-
children: i > 1 ?
|
|
3726
|
+
children: i > 1 ? ca(r ?? "") : r
|
|
3730
3727
|
})]
|
|
3731
3728
|
});
|
|
3732
3729
|
return /* @__PURE__ */ U("div", {
|
|
@@ -3734,21 +3731,21 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3734
3731
|
children: f ? /* @__PURE__ */ W("div", {
|
|
3735
3732
|
"data-testid": "rich-card-chin-row",
|
|
3736
3733
|
className: "flex items-center justify-between gap-3",
|
|
3737
|
-
children: [p, /* @__PURE__ */ U(
|
|
3734
|
+
children: [p, /* @__PURE__ */ U(la, {
|
|
3738
3735
|
surface: e,
|
|
3739
3736
|
actions: o,
|
|
3740
3737
|
layout: "row"
|
|
3741
3738
|
})]
|
|
3742
|
-
}) : /* @__PURE__ */ W(H, { children: [p, /* @__PURE__ */ U(
|
|
3739
|
+
}) : /* @__PURE__ */ W(H, { children: [p, /* @__PURE__ */ U(la, {
|
|
3743
3740
|
surface: e,
|
|
3744
3741
|
actions: o,
|
|
3745
3742
|
layout: "stacked"
|
|
3746
3743
|
})] })
|
|
3747
3744
|
});
|
|
3748
|
-
},
|
|
3745
|
+
}, da = {
|
|
3749
3746
|
dark: "bg-white/[0.06]",
|
|
3750
3747
|
light: "bg-black/[0.04]"
|
|
3751
|
-
},
|
|
3748
|
+
}, fa = {
|
|
3752
3749
|
1: [0],
|
|
3753
3750
|
2: [-10, 10],
|
|
3754
3751
|
3: [
|
|
@@ -3756,7 +3753,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3756
3753
|
0,
|
|
3757
3754
|
13
|
|
3758
3755
|
]
|
|
3759
|
-
},
|
|
3756
|
+
}, pa = {
|
|
3760
3757
|
1: [0],
|
|
3761
3758
|
2: [-26, 26],
|
|
3762
3759
|
3: [
|
|
@@ -3764,7 +3761,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3764
3761
|
0,
|
|
3765
3762
|
40
|
|
3766
3763
|
]
|
|
3767
|
-
},
|
|
3764
|
+
}, ma = {
|
|
3768
3765
|
1: [0],
|
|
3769
3766
|
2: [0, 1],
|
|
3770
3767
|
3: [
|
|
@@ -3772,7 +3769,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3772
3769
|
3,
|
|
3773
3770
|
2
|
|
3774
3771
|
]
|
|
3775
|
-
},
|
|
3772
|
+
}, ha = {
|
|
3776
3773
|
1: [1],
|
|
3777
3774
|
2: [1, 1],
|
|
3778
3775
|
3: [
|
|
@@ -3780,15 +3777,15 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3780
3777
|
1.08,
|
|
3781
3778
|
1
|
|
3782
3779
|
]
|
|
3783
|
-
},
|
|
3780
|
+
}, ga = ({ variant: e, images: t }) => {
|
|
3784
3781
|
let [n, r] = o.useState({}), i = t.join("\n"), [s, c] = o.useState(i);
|
|
3785
3782
|
i !== s && (c(i), r({}));
|
|
3786
3783
|
let l = t.slice(0, 3).map((e, t) => ({
|
|
3787
3784
|
src: e,
|
|
3788
3785
|
index: t
|
|
3789
|
-
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d =
|
|
3786
|
+
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d = fa[u], f = pa[u], p = ma[u], m = ha[u];
|
|
3790
3787
|
return /* @__PURE__ */ U("div", {
|
|
3791
|
-
className: J("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden",
|
|
3788
|
+
className: J("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden", da[e]),
|
|
3792
3789
|
children: l.map(({ src: e, index: t }, n) => /* @__PURE__ */ U("img", {
|
|
3793
3790
|
src: a(e) ?? e,
|
|
3794
3791
|
alt: "",
|
|
@@ -3806,9 +3803,9 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3806
3803
|
}
|
|
3807
3804
|
}, `${e}-${t}`))
|
|
3808
3805
|
});
|
|
3809
|
-
},
|
|
3810
|
-
className:
|
|
3811
|
-
children: t === "fan" ? /* @__PURE__ */ U(
|
|
3806
|
+
}, _a = "flex h-[180px] w-full shrink-0 flex-col overflow-hidden", va = ({ variant: e, presentation: t, images: n, title: r, heroUrl: i, onHeroError: a }) => /* @__PURE__ */ U("div", {
|
|
3807
|
+
className: _a,
|
|
3808
|
+
children: t === "fan" ? /* @__PURE__ */ U(ga, {
|
|
3812
3809
|
variant: e,
|
|
3813
3810
|
images: n
|
|
3814
3811
|
}) : /* @__PURE__ */ U(On, {
|
|
@@ -3818,7 +3815,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3818
3815
|
mimeType: "image/*",
|
|
3819
3816
|
onImageError: a
|
|
3820
3817
|
})
|
|
3821
|
-
}),
|
|
3818
|
+
}), ya = ({ variant: e, title: t, subtitle: n, subtitleLines: r, images: i = [], imagePresentation: a, actions: o, appIcon: s, accentColor: c, groupPosition: l = "single" }) => {
|
|
3822
3819
|
let u = Te({
|
|
3823
3820
|
imagePresentation: a,
|
|
3824
3821
|
images: i
|
|
@@ -3836,14 +3833,14 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3836
3833
|
variant: e,
|
|
3837
3834
|
accentHex: p.accentHex,
|
|
3838
3835
|
"data-testid": "rich-card",
|
|
3839
|
-
children: [d && /* @__PURE__ */ U(
|
|
3836
|
+
children: [d && /* @__PURE__ */ U(va, {
|
|
3840
3837
|
variant: e,
|
|
3841
3838
|
presentation: u,
|
|
3842
3839
|
images: i,
|
|
3843
3840
|
title: t,
|
|
3844
3841
|
heroUrl: f ? p.thumbnailUrl : void 0,
|
|
3845
3842
|
onHeroError: p.onImageError
|
|
3846
|
-
}), /* @__PURE__ */ U(
|
|
3843
|
+
}), /* @__PURE__ */ U(ua, {
|
|
3847
3844
|
ctaSurface: p.surface,
|
|
3848
3845
|
chinTextColor: p.chinTextColor,
|
|
3849
3846
|
title: t,
|
|
@@ -3854,19 +3851,19 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3854
3851
|
})]
|
|
3855
3852
|
})
|
|
3856
3853
|
});
|
|
3857
|
-
},
|
|
3858
|
-
Sent: (e) => /* @__PURE__ */ U(
|
|
3854
|
+
}, ba = {
|
|
3855
|
+
Sent: (e) => /* @__PURE__ */ U(ya, {
|
|
3859
3856
|
...e,
|
|
3860
3857
|
variant: "dark"
|
|
3861
3858
|
}),
|
|
3862
|
-
Received: (e) => /* @__PURE__ */ U(
|
|
3859
|
+
Received: (e) => /* @__PURE__ */ U(ya, {
|
|
3863
3860
|
...e,
|
|
3864
3861
|
variant: "light"
|
|
3865
3862
|
})
|
|
3866
|
-
},
|
|
3863
|
+
}, xa = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", Sa = {
|
|
3867
3864
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3868
3865
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
3869
|
-
},
|
|
3866
|
+
}, Ca = ({ variant: e }) => /* @__PURE__ */ U("span", {
|
|
3870
3867
|
"aria-hidden": "true",
|
|
3871
3868
|
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
3872
3869
|
style: {
|
|
@@ -3874,11 +3871,11 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3874
3871
|
insetInlineStart: e === "received" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
3875
3872
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
3876
3873
|
transformOrigin: "center",
|
|
3877
|
-
backgroundColor:
|
|
3878
|
-
WebkitMask:
|
|
3879
|
-
mask:
|
|
3874
|
+
backgroundColor: Sa[e],
|
|
3875
|
+
WebkitMask: xa,
|
|
3876
|
+
mask: xa
|
|
3880
3877
|
}
|
|
3881
|
-
}),
|
|
3878
|
+
}), wa = {
|
|
3882
3879
|
sent: {
|
|
3883
3880
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3884
3881
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -3887,11 +3884,11 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3887
3884
|
backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
|
|
3888
3885
|
color: "var(--str-chat__message-bubble-color, #000000)"
|
|
3889
3886
|
}
|
|
3890
|
-
},
|
|
3887
|
+
}, Ta = ({ variant: e, text: t, tail: n = !0, header: r, className: i }) => /* @__PURE__ */ W("div", {
|
|
3891
3888
|
"data-dd-privacy": "mask",
|
|
3892
3889
|
className: J("relative px-4 py-3", "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]", i),
|
|
3893
3890
|
style: {
|
|
3894
|
-
...
|
|
3891
|
+
...wa[e],
|
|
3895
3892
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
3896
3893
|
isolation: "isolate"
|
|
3897
3894
|
},
|
|
@@ -3905,23 +3902,23 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3905
3902
|
className: "m-0 whitespace-pre-wrap break-words hyphens-manual",
|
|
3906
3903
|
children: t
|
|
3907
3904
|
}),
|
|
3908
|
-
n && /* @__PURE__ */ U(
|
|
3905
|
+
n && /* @__PURE__ */ U(Ca, { variant: e })
|
|
3909
3906
|
]
|
|
3910
|
-
}),
|
|
3911
|
-
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ U(
|
|
3907
|
+
}), Ea = {
|
|
3908
|
+
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ U(Ta, {
|
|
3912
3909
|
variant: "sent",
|
|
3913
3910
|
text: e,
|
|
3914
3911
|
tail: t,
|
|
3915
3912
|
className: n
|
|
3916
3913
|
}),
|
|
3917
|
-
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ U(
|
|
3914
|
+
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ U(Ta, {
|
|
3918
3915
|
variant: "received",
|
|
3919
3916
|
text: e,
|
|
3920
3917
|
tail: t,
|
|
3921
3918
|
header: n,
|
|
3922
3919
|
className: r
|
|
3923
3920
|
})
|
|
3924
|
-
},
|
|
3921
|
+
}, Da = ({ question: e, onClick: t, loading: n = !1, className: r }) => /* @__PURE__ */ U("button", {
|
|
3925
3922
|
type: "button",
|
|
3926
3923
|
onClick: t,
|
|
3927
3924
|
disabled: n,
|
|
@@ -3931,7 +3928,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3931
3928
|
"opacity-50 cursor-not-allowed": n
|
|
3932
3929
|
}, r),
|
|
3933
3930
|
children: e
|
|
3934
|
-
}),
|
|
3931
|
+
}), Oa = ({ faqs: e, onFaqClick: t, loadingFaqId: n, headerText: r, className: i, avatarImage: a, avatarName: o }) => {
|
|
3935
3932
|
let s = Ee(e);
|
|
3936
3933
|
return s.length === 0 ? null : /* @__PURE__ */ U("div", {
|
|
3937
3934
|
className: i,
|
|
@@ -3953,7 +3950,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3953
3950
|
"data-testid": "faq-list-header",
|
|
3954
3951
|
className: "text-md text-charcoal mb-4",
|
|
3955
3952
|
children: r
|
|
3956
|
-
}), s.map((e) => /* @__PURE__ */ U(
|
|
3953
|
+
}), s.map((e) => /* @__PURE__ */ U(Da, {
|
|
3957
3954
|
question: e.question,
|
|
3958
3955
|
onClick: () => t(e.id),
|
|
3959
3956
|
loading: n === e.id
|
|
@@ -3963,6 +3960,6 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3963
3960
|
});
|
|
3964
3961
|
};
|
|
3965
3962
|
//#endregion
|
|
3966
|
-
export { bt as ActionButton, _t as Avatar,
|
|
3963
|
+
export { bt as ActionButton, _t as Avatar, Ui as ChannelEmptyState, ia as ChannelList, qi as ChannelView, Mt as CustomMessageProvider, Oa as FaqList, Da as FaqListItem, zn as LinkAttachment, Lt as LockedAttachment, Q as MessageAttachment, Ea as MessageBubble, et as MessagingLoggerProvider, it as MessagingProvider, Yi as MessagingShell, ba as RichCard, tn as TipMessage, nr as buildCompactMetaLabel, $n as formatFileSize, ta as formatRelativeTime, tr as getFileExtensionLabel, Ot as getMessageDisplayText, kt as isLinkAttachment, en as isTipMessage, lt as isUuidLike, Jn as messageAttachmentGroupPositionFromStream, Dt as normalizeLanguageCode, a as optimizeMessagingAttachmentUrl, st as resolveConversationParticipant, dt as resolveParticipantDisplayName, Si as useComposerLocked, Nt as useCustomMessage, at as useMessaging, tt as useMessagingLogger };
|
|
3967
3964
|
|
|
3968
3965
|
//# sourceMappingURL=index.js.map
|