@sendbird/ai-agent-messenger-react 1.21.1 → 1.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +242 -236
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var ns = Object.defineProperty;
|
|
2
2
|
var rs = (e, t, n) => t in e ? ns(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var b = (e, t, n) => rs(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import os, { ConnectionHandler as
|
|
4
|
+
import os, { ConnectionHandler as vn, SendbirdError as ot, SendbirdChatOptions as ss, SendbirdProduct as is, SessionHandler as as, ConnectionState as Pr, LogLevel as Br, SendbirdPlatform as ls, DeviceOsPlatform as Kn } from "@sendbird/chat";
|
|
5
5
|
import * as s from "react";
|
|
6
6
|
import { createContext as Je, useContext as Ae, useLayoutEffect as re, useState as S, useRef as F, useEffect as V, useCallback as z, forwardRef as Qe, useImperativeHandle as cs, useId as ds, useMemo as ce, useReducer as us, PureComponent as ms, Suspense as hs, lazy as N, Fragment as Ur, Children as gs } from "react";
|
|
7
7
|
import m, { css as O, ThemeProvider as ps, useTheme as lt, createGlobalStyle as fs, StyleSheetManager as Es, keyframes as Hr } from "styled-components";
|
|
8
|
-
import { isSameMinute as jn, differenceInMinutes as _s, isToday as bs, differenceInHours as Cs, format as xs, isSameDay as
|
|
9
|
-
import { enUS as
|
|
8
|
+
import { isSameMinute as jn, differenceInMinutes as _s, isToday as bs, differenceInHours as Cs, format as xs, isSameDay as vs } from "date-fns";
|
|
9
|
+
import { enUS as ys } from "date-fns/locale/en-US";
|
|
10
10
|
import { ConversationStatus as ge, AIAgentModule as Ss, ConversationType as As, AIAgentMessageFeedbackRating as qn } from "@sendbird/chat/aiAgent";
|
|
11
11
|
import { SendingStatus as Xe, ReplyType as Ts, MessageMetaArray as Is } from "@sendbird/chat/message";
|
|
12
12
|
import { GroupChannelListOrder as Vr, GroupChannelHandler as zr, GroupChannelModule as ws } from "@sendbird/chat/groupChannel";
|
|
@@ -49,7 +49,7 @@ const qe = "sb-agent", Kr = "KEY_IMG_ASPECT_RATIO", cn = "*/*", W = {
|
|
|
49
49
|
},
|
|
50
50
|
isIncoming: (e, t) => be(e) && e.sender.userId !== t,
|
|
51
51
|
isOutgoing: (e, t) => be(e) && (e.sender.userId === t || e.sendingStatus === Xe.PENDING)
|
|
52
|
-
}, Re = (e) => e.startsWith("image/"), jr = (e) => e.startsWith("video/"),
|
|
52
|
+
}, Re = (e) => e.startsWith("image/"), jr = (e) => e.startsWith("video/"), yn = (e, t) => {
|
|
53
53
|
if (e && !e.startsWith(".")) {
|
|
54
54
|
const n = e.split(".").pop();
|
|
55
55
|
if (n && n !== e)
|
|
@@ -265,7 +265,7 @@ class Xr {
|
|
|
265
265
|
onChannelDeleted: (p) => {
|
|
266
266
|
this._removeChannelsFromView([p]);
|
|
267
267
|
}
|
|
268
|
-
}), this._connectionHandler = new
|
|
268
|
+
}), this._connectionHandler = new vn({
|
|
269
269
|
onReconnectSucceeded: () => {
|
|
270
270
|
this._isDefaultChangelogSyncTimestampUpdated && this._syncChannelChangelogs();
|
|
271
271
|
}
|
|
@@ -860,7 +860,7 @@ class hi {
|
|
|
860
860
|
var i, a;
|
|
861
861
|
o.isGroupChannel() && o.url === ((i = this._session) == null ? void 0 : i.activeChannel.url) && ((a = this._handleActiveChannelChangedThrottled) == null || a.call(this, o));
|
|
862
862
|
}
|
|
863
|
-
}), r = new
|
|
863
|
+
}), r = new vn({
|
|
864
864
|
onReconnectSucceeded: async () => {
|
|
865
865
|
await this._syncActiveChannelOnReconnect();
|
|
866
866
|
}
|
|
@@ -1050,13 +1050,13 @@ function xi(e, t, n, r) {
|
|
|
1050
1050
|
t.customData
|
|
1051
1051
|
) || console.warn("Invalid Sendbird Extensions", t), o;
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function vi(e) {
|
|
1054
1054
|
const t = (n) => {
|
|
1055
1055
|
throw new Error(`Please initialize chat sdk with ${n}`);
|
|
1056
1056
|
};
|
|
1057
1057
|
typeof e.groupChannel != "object" && t("GroupChannelModule"), typeof e.aiAgent != "object" && t("AIAgentModule");
|
|
1058
1058
|
}
|
|
1059
|
-
const
|
|
1059
|
+
const yi = [400300, 400301, 400302, 400310];
|
|
1060
1060
|
class In {
|
|
1061
1061
|
constructor(t, n, r) {
|
|
1062
1062
|
b(this, "chatSDK");
|
|
@@ -1134,7 +1134,7 @@ class In {
|
|
|
1134
1134
|
/**
|
|
1135
1135
|
* Checks if the error is a cache restricted error that requires clearing cached data.
|
|
1136
1136
|
*/
|
|
1137
|
-
b(this, "_isCacheRestrictedError", (t) =>
|
|
1137
|
+
b(this, "_isCacheRestrictedError", (t) => yi.some((n) => t.code === n));
|
|
1138
1138
|
/**
|
|
1139
1139
|
* Syncs message templates if the cached token differs from the server token.
|
|
1140
1140
|
*/
|
|
@@ -1161,25 +1161,25 @@ class In {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
static init(t) {
|
|
1163
1163
|
let n;
|
|
1164
|
-
return t.chatSDK ? (
|
|
1164
|
+
return t.chatSDK ? (vi(t.chatSDK), n = t.chatSDK) : n = xi(t.appId, t.extensions, t.messengerVersion, t.chatParams), new In(n, t.logger, t.cache);
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
|
-
const
|
|
1167
|
+
const vt = /* @__PURE__ */ new Map(), no = {
|
|
1168
1168
|
set: (e, t) => {
|
|
1169
|
-
|
|
1169
|
+
vt.set(e, t);
|
|
1170
1170
|
},
|
|
1171
1171
|
get: (e) => {
|
|
1172
|
-
if (
|
|
1172
|
+
if (vt.size === 0)
|
|
1173
1173
|
throw new Error(
|
|
1174
1174
|
"AIAgent platform not configured. Ensure you are using the correct package (@sendbird/ai-agent-messenger-react or @sendbird/ai-agent-messenger-react-native)."
|
|
1175
1175
|
);
|
|
1176
1176
|
if (e) {
|
|
1177
|
-
const n =
|
|
1177
|
+
const n = vt.get(e);
|
|
1178
1178
|
if (!n)
|
|
1179
1179
|
throw new Error(`AIAgent platform "${e}" is not configured.`);
|
|
1180
1180
|
return { platform: e, ...n };
|
|
1181
1181
|
}
|
|
1182
|
-
const t =
|
|
1182
|
+
const t = vt.entries().next().value;
|
|
1183
1183
|
return { platform: t[0], ...t[1] };
|
|
1184
1184
|
}
|
|
1185
1185
|
}, Si = (e) => Object.fromEntries(Object.entries(e).filter(([, t]) => t !== void 0));
|
|
@@ -1555,7 +1555,7 @@ class Lt extends hi {
|
|
|
1555
1555
|
onDeskTokenRefreshRequired: async ({ reason: E }) => {
|
|
1556
1556
|
var h;
|
|
1557
1557
|
if (E === so.ERR_SESSION_KEY_EXPIRED) {
|
|
1558
|
-
await new Promise((
|
|
1558
|
+
await new Promise((v) => setTimeout(v, 2e3));
|
|
1559
1559
|
const _ = (h = this._session) == null ? void 0 : h.userSession.authToken;
|
|
1560
1560
|
return _ ? await this._deskClient.refreshDeskAuthToken(_) : !1;
|
|
1561
1561
|
}
|
|
@@ -1678,21 +1678,24 @@ class Lt extends hi {
|
|
|
1678
1678
|
* @description Refreshes and returns the current active channel from the server.
|
|
1679
1679
|
*/
|
|
1680
1680
|
b(this, "refreshActiveChannel", async (n) => {
|
|
1681
|
-
var
|
|
1681
|
+
var l, c, d;
|
|
1682
1682
|
Ue(this._session);
|
|
1683
|
-
const r = (n == null ? void 0 : n.useKnownActiveChannelUrl) ?? !0;
|
|
1684
|
-
this._logger.debug("AIAgent.refreshActiveChannel: start", { useKnownActiveChannelUrl:
|
|
1685
|
-
const
|
|
1683
|
+
const r = this._session, o = (n == null ? void 0 : n.useKnownActiveChannelUrl) ?? !0;
|
|
1684
|
+
this._logger.debug("AIAgent.refreshActiveChannel: start", { useKnownActiveChannelUrl: o });
|
|
1685
|
+
const i = await this._chatClient.requestMessengerSettings({
|
|
1686
1686
|
aiAgentId: this.aiAgentId,
|
|
1687
|
-
userId:
|
|
1687
|
+
userId: r.userSession.userId,
|
|
1688
1688
|
language: this.language,
|
|
1689
1689
|
country: this.countryCode,
|
|
1690
1690
|
context: this.context,
|
|
1691
|
-
knownActiveChannelUrl:
|
|
1691
|
+
knownActiveChannelUrl: o ? (c = (l = this._cache.messenger.getSettings(r.userSession.userId)) == null ? void 0 : l.active_channel) == null ? void 0 : c.channel_url : void 0,
|
|
1692
1692
|
forceCreateChannel: this._forceCreateChannel,
|
|
1693
1693
|
agentVersion: this._agentVersion
|
|
1694
|
-
})
|
|
1695
|
-
|
|
1694
|
+
});
|
|
1695
|
+
if (this._session !== r)
|
|
1696
|
+
return this._logger.debug("AIAgent.refreshActiveChannel: session changed during refresh, discarding stale result"), ((d = this._session) == null ? void 0 : d.activeChannel.url) ?? i.active_channel.channel_url;
|
|
1697
|
+
const a = i.active_channel.channel_url;
|
|
1698
|
+
return this._cache.messenger.setSettings(this._session.userSession.userId, i), this._session._updateActiveChannel({ url: a, status: "open" }), this._logger.debug("AIAgent.refreshActiveChannel: end", a), a;
|
|
1696
1699
|
});
|
|
1697
1700
|
/**
|
|
1698
1701
|
* @internal
|
|
@@ -1901,14 +1904,14 @@ function Li(e, t, n) {
|
|
|
1901
1904
|
const Oi = (e) => {
|
|
1902
1905
|
const t = e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
|
|
1903
1906
|
return t ? [Number(t[1]), Number(t[2]), Number(t[3])] : null;
|
|
1904
|
-
},
|
|
1905
|
-
const n =
|
|
1907
|
+
}, yt = (e) => Math.max(0, Math.min(255, e)).toString(16).padStart(2, "0"), nr = (e, t) => {
|
|
1908
|
+
const n = yt(Math.round(t * 255));
|
|
1906
1909
|
if (e.startsWith("#")) {
|
|
1907
1910
|
const o = e.slice(1);
|
|
1908
1911
|
return o.length === 3 || o.length === 4 ? `#${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}${n}` : `#${o.slice(0, 6)}${n}`;
|
|
1909
1912
|
}
|
|
1910
1913
|
const r = Oi(e);
|
|
1911
|
-
return r ? `#${
|
|
1914
|
+
return r ? `#${yt(r[0])}${yt(r[1])}${yt(r[2])}${n}` : e;
|
|
1912
1915
|
}, io = oe("AIAgent"), Ri = io.Provider, Ee = io.useContext;
|
|
1913
1916
|
function Di(e) {
|
|
1914
1917
|
const t = Ni(e);
|
|
@@ -2305,7 +2308,7 @@ const en = 25 * 1024 * 1024, or = 1, sr = /* @__PURE__ */ new Set(["image/png",
|
|
|
2305
2308
|
useContext: ht
|
|
2306
2309
|
} = oe("AIAgentMessengerSession"), ta = Qe(
|
|
2307
2310
|
function({ userSessionInfo: e, children: t }, n) {
|
|
2308
|
-
const { _aiAgentSDK: r, chatSDK: o, aiAgentId: i, logger: a } = Ee(), { updateTheme: l } = kn(), [c, d] = S(void 0), [u, p] = S(void 0), [f, x] = S(null), [C, E] = S(null), [h, _] = S(null), [
|
|
2311
|
+
const { _aiAgentSDK: r, chatSDK: o, aiAgentId: i, logger: a } = Ee(), { updateTheme: l } = kn(), [c, d] = S(void 0), [u, p] = S(void 0), [f, x] = S(null), [C, E] = S(null), [h, _] = S(null), [v, I] = S(null), { updateBaseAttachmentRules: A, createAttachmentRules: $ } = Qi();
|
|
2309
2312
|
V(() => {
|
|
2310
2313
|
const T = r.onMessengerSettingsUpdated(({ settings: j }) => {
|
|
2311
2314
|
const { appearance: J, bot: q, launcher: ke } = j;
|
|
@@ -2343,13 +2346,16 @@ const en = 25 * 1024 * 1024, or = 1, sr = /* @__PURE__ */ new Set(["image/png",
|
|
|
2343
2346
|
} catch (T) {
|
|
2344
2347
|
throw d(T), T;
|
|
2345
2348
|
}
|
|
2346
|
-
}, [r, e]),
|
|
2349
|
+
}, [r, e]), y = z(async () => {
|
|
2347
2350
|
await r.deauthenticate(), x(null), p(void 0), E(null), _(null), I(null);
|
|
2348
2351
|
}, [r]), L = z(async () => {
|
|
2349
|
-
if (!r.session)
|
|
2352
|
+
if (!r.session) {
|
|
2353
|
+
if (C)
|
|
2354
|
+
return a.debug("agentMessengerSession.refreshActiveChannel: stale call after deauthenticate, skipping"), "";
|
|
2350
2355
|
throw a.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"), new Error("userSession is not ready");
|
|
2351
|
-
|
|
2352
|
-
|
|
2356
|
+
}
|
|
2357
|
+
return r.session.userSession.userId !== (C == null ? void 0 : C.userId) ? (a.debug("agentMessengerSession.refreshActiveChannel: stale call from previous session, skipping"), r.session.activeChannel.url) : (p(void 0), await r.refreshActiveChannel());
|
|
2358
|
+
}, [r, a, C]), B = z(
|
|
2353
2359
|
async (T) => {
|
|
2354
2360
|
if (!r.session)
|
|
2355
2361
|
throw new Error("Current user is not authenticated. Please authenticate first.");
|
|
@@ -2373,7 +2379,7 @@ const en = 25 * 1024 * 1024, or = 1, sr = /* @__PURE__ */ new Set(["image/png",
|
|
|
2373
2379
|
activeChannel: u,
|
|
2374
2380
|
chatSDK: o,
|
|
2375
2381
|
authenticate: w,
|
|
2376
|
-
deauthenticate:
|
|
2382
|
+
deauthenticate: y,
|
|
2377
2383
|
updateContext: async (...H) => {
|
|
2378
2384
|
const P = ar(...H);
|
|
2379
2385
|
if (P.type === "active") {
|
|
@@ -2405,7 +2411,7 @@ const en = 25 * 1024 * 1024, or = 1, sr = /* @__PURE__ */ new Set(["image/png",
|
|
|
2405
2411
|
return nt(P);
|
|
2406
2412
|
}
|
|
2407
2413
|
};
|
|
2408
|
-
}, [w,
|
|
2414
|
+
}, [w, y, u, o, i, a]), /* @__PURE__ */ s.createElement(
|
|
2409
2415
|
ea,
|
|
2410
2416
|
{
|
|
2411
2417
|
value: {
|
|
@@ -2419,9 +2425,9 @@ const en = 25 * 1024 * 1024, or = 1, sr = /* @__PURE__ */ new Set(["image/png",
|
|
|
2419
2425
|
searchConversation: R,
|
|
2420
2426
|
connectionError: c,
|
|
2421
2427
|
aiAgentInfo: h,
|
|
2422
|
-
launcherInfo:
|
|
2428
|
+
launcherInfo: v,
|
|
2423
2429
|
authenticate: w,
|
|
2424
|
-
deauthenticate:
|
|
2430
|
+
deauthenticate: y,
|
|
2425
2431
|
createAttachmentRules: $,
|
|
2426
2432
|
statsTrackers: r.statsTrackers
|
|
2427
2433
|
}
|
|
@@ -2434,7 +2440,7 @@ const en = 25 * 1024 * 1024, or = 1, sr = /* @__PURE__ */ new Set(["image/png",
|
|
|
2434
2440
|
re(() => {
|
|
2435
2441
|
r.current = t;
|
|
2436
2442
|
}), V(() => {
|
|
2437
|
-
const o = new
|
|
2443
|
+
const o = new vn({
|
|
2438
2444
|
onDisconnected: (i) => {
|
|
2439
2445
|
var a, l;
|
|
2440
2446
|
return (l = (a = r.current).onDisconnected) == null ? void 0 : l.call(a, i);
|
|
@@ -2475,7 +2481,7 @@ function na(e) {
|
|
|
2475
2481
|
h.isAIAgent && !h.conversation && (x(!0), o.initConversationIfNeeded(h).finally(() => x(!1)));
|
|
2476
2482
|
}
|
|
2477
2483
|
async function E() {
|
|
2478
|
-
var h, _,
|
|
2484
|
+
var h, _, v;
|
|
2479
2485
|
if (!i) {
|
|
2480
2486
|
n.debug("useChannel.getChannel: no sdk user, skip fetching channel");
|
|
2481
2487
|
return;
|
|
@@ -2488,7 +2494,7 @@ function na(e) {
|
|
|
2488
2494
|
C(I), d(I), a.initialRender.onGetChannelComplete((h = I.conversation) == null ? void 0 : h.id), I.url === ((_ = o.session) == null ? void 0 : _.activeChannel.url) && o.session._updateActiveChannel({
|
|
2489
2495
|
url: I.url,
|
|
2490
2496
|
status: pe(I) ? "closed" : "open",
|
|
2491
|
-
conversationStatus: (
|
|
2497
|
+
conversationStatus: (v = I.conversation) == null ? void 0 : v.status
|
|
2492
2498
|
}), n.debug("useChannel.getChannel: fetched channel", I);
|
|
2493
2499
|
} catch (I) {
|
|
2494
2500
|
a.initialRender.onGetChannelError(I), I instanceof ot && p(I), n.error("useChannel.getChannel: error", I);
|
|
@@ -2644,7 +2650,7 @@ function ma({
|
|
|
2644
2650
|
sortComparator: p
|
|
2645
2651
|
}) {
|
|
2646
2652
|
var R;
|
|
2647
|
-
const f = () => d && (h == null ? void 0 : h.markAsRead()), { chatSDK: x, logger: C, dispatcher: E } = Ee(), { channel: h, channelFetchError: _, getChannel:
|
|
2653
|
+
const f = () => d && (h == null ? void 0 : h.markAsRead()), { chatSDK: x, logger: C, dispatcher: E } = Ee(), { channel: h, channelFetchError: _, getChannel: v, isInitializingConversation: I } = na(t), { statsTrackers: A } = ht();
|
|
2648
2654
|
V(() => {
|
|
2649
2655
|
if (t)
|
|
2650
2656
|
return A.initialRender.setChannelUrl(t), () => {
|
|
@@ -2662,7 +2668,7 @@ function ma({
|
|
|
2662
2668
|
logger: C,
|
|
2663
2669
|
markAsRead: f,
|
|
2664
2670
|
sortComparator: p
|
|
2665
|
-
}), w = da(),
|
|
2671
|
+
}), w = da(), y = ca({
|
|
2666
2672
|
channel: h,
|
|
2667
2673
|
messages: $.messages,
|
|
2668
2674
|
isStreamAnimating: w.isAnimating,
|
|
@@ -2688,7 +2694,7 @@ function ma({
|
|
|
2688
2694
|
channelSource: {
|
|
2689
2695
|
channel: h,
|
|
2690
2696
|
error: _,
|
|
2691
|
-
refetch: () =>
|
|
2697
|
+
refetch: () => v(),
|
|
2692
2698
|
closeConversation: async () => {
|
|
2693
2699
|
pe(h) || await (h == null ? void 0 : h.closeConversation());
|
|
2694
2700
|
}
|
|
@@ -2729,32 +2735,32 @@ function ma({
|
|
|
2729
2735
|
},
|
|
2730
2736
|
state: {
|
|
2731
2737
|
streamAnimation: w,
|
|
2732
|
-
input:
|
|
2738
|
+
input: y
|
|
2733
2739
|
}
|
|
2734
2740
|
};
|
|
2735
2741
|
return /* @__PURE__ */ s.createElement(ua, { value: B }, e);
|
|
2736
2742
|
}
|
|
2737
2743
|
function ha(e, t) {
|
|
2738
|
-
var x, C, E, h, _,
|
|
2744
|
+
var x, C, E, h, _, v, I, A, $, w;
|
|
2739
2745
|
const [n, r] = S(!1), [o, i] = S(null), [a, l] = S([]), [c, d] = S(null), u = F(!1), p = z(async () => {
|
|
2740
2746
|
if (!u.current && e.currentUser) {
|
|
2741
2747
|
u.current = !0, r(!1), i(null), l([]);
|
|
2742
2748
|
try {
|
|
2743
2749
|
c == null || c.dispose();
|
|
2744
|
-
const
|
|
2745
|
-
|
|
2750
|
+
const y = new Xr(e, t);
|
|
2751
|
+
y.setConversationListCollectionHandler({
|
|
2746
2752
|
onChannelsAdded: () => {
|
|
2747
|
-
l(
|
|
2753
|
+
l(y.channels);
|
|
2748
2754
|
},
|
|
2749
2755
|
onChannelsUpdated: () => {
|
|
2750
|
-
l(
|
|
2756
|
+
l(y.channels);
|
|
2751
2757
|
},
|
|
2752
2758
|
onChannelsDeleted: () => {
|
|
2753
|
-
l(
|
|
2759
|
+
l(y.channels);
|
|
2754
2760
|
}
|
|
2755
|
-
}), await
|
|
2756
|
-
} catch (
|
|
2757
|
-
d(null), i(
|
|
2761
|
+
}), await y.loadMore(), d(y), i(null);
|
|
2762
|
+
} catch (y) {
|
|
2763
|
+
d(null), i(y);
|
|
2758
2764
|
} finally {
|
|
2759
2765
|
r(!0), u.current = !1;
|
|
2760
2766
|
}
|
|
@@ -2765,7 +2771,7 @@ function ha(e, t) {
|
|
|
2765
2771
|
(x = t.filter) == null ? void 0 : x.aiAgentChannelFilter,
|
|
2766
2772
|
(E = (C = t.filter) == null ? void 0 : C.aiAgentConversationStatusFilter) == null ? void 0 : E.join(),
|
|
2767
2773
|
(_ = (h = t.filter) == null ? void 0 : h.aiAgentIds) == null ? void 0 : _.join(),
|
|
2768
|
-
(
|
|
2774
|
+
(v = t.filter) == null ? void 0 : v.deskChannelFilter,
|
|
2769
2775
|
(A = (I = t.filter) == null ? void 0 : I.pinnedChannelUrls) == null ? void 0 : A.join(),
|
|
2770
2776
|
($ = t.filter) == null ? void 0 : $.copilotConversationOnly,
|
|
2771
2777
|
(w = t.filter) == null ? void 0 : w.copilotSupportChannelUrl,
|
|
@@ -2774,8 +2780,8 @@ function ha(e, t) {
|
|
|
2774
2780
|
if (c)
|
|
2775
2781
|
try {
|
|
2776
2782
|
await c.loadMore();
|
|
2777
|
-
} catch (
|
|
2778
|
-
i(
|
|
2783
|
+
} catch (y) {
|
|
2784
|
+
i(y);
|
|
2779
2785
|
}
|
|
2780
2786
|
}, [c]);
|
|
2781
2787
|
return $n(e, {
|
|
@@ -2997,7 +3003,7 @@ const xa = ({
|
|
|
2997
3003
|
a = c;
|
|
2998
3004
|
}
|
|
2999
3005
|
return a = Fe({ ...r, uiTemplateString: a, variables: n }), a = Pe({ ...r, uiTemplateString: a, colorVariables: i }), a = Pe({ ...r, uiTemplateString: a, colorVariables: t }), a = Fe({ ...r, uiTemplateString: a }), Ut(a);
|
|
3000
|
-
},
|
|
3006
|
+
}, va = async ({
|
|
3001
3007
|
rawTemplate: e,
|
|
3002
3008
|
aiAgentColorVariables: t,
|
|
3003
3009
|
internalVariables: n,
|
|
@@ -3011,7 +3017,7 @@ const xa = ({
|
|
|
3011
3017
|
aiAgentColorVariables: t,
|
|
3012
3018
|
internalVariables: n
|
|
3013
3019
|
})), a = Fe({ ...r, uiTemplateString: a, variables: n }), a = Pe({ ...r, uiTemplateString: a, colorVariables: i }), a = Pe({ ...r, uiTemplateString: a, colorVariables: t }), a = Fe({ ...r, uiTemplateString: a }), Ut(a);
|
|
3014
|
-
},
|
|
3020
|
+
}, ya = (e) => {
|
|
3015
3021
|
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = co();
|
|
3016
3022
|
return S(() => {
|
|
3017
3023
|
const r = e.onGetCachedTemplate(e.templateKey);
|
|
@@ -3024,12 +3030,12 @@ const xa = ({
|
|
|
3024
3030
|
}) : null;
|
|
3025
3031
|
});
|
|
3026
3032
|
}, Sa = (e) => {
|
|
3027
|
-
const [t] =
|
|
3033
|
+
const [t] = ya(e);
|
|
3028
3034
|
if (t) return t;
|
|
3029
3035
|
const { aiAgentColorVariables: n = {} } = e, { internalVariables: r, fetchTemplate: o, suspend: i } = co();
|
|
3030
3036
|
return i(e.templateKey, async () => {
|
|
3031
3037
|
const l = await o({ ...e, suspense: !0 });
|
|
3032
|
-
return await
|
|
3038
|
+
return await va({
|
|
3033
3039
|
...e,
|
|
3034
3040
|
rawTemplate: l,
|
|
3035
3041
|
aiAgentColorVariables: n,
|
|
@@ -3191,15 +3197,15 @@ const Ra = (e, t = {}) => {
|
|
|
3191
3197
|
const E = {};
|
|
3192
3198
|
let h = !1;
|
|
3193
3199
|
e.fields.forEach((_) => {
|
|
3194
|
-
const
|
|
3195
|
-
JSON.stringify(l[_.key]) !== JSON.stringify(
|
|
3200
|
+
const v = lr(_);
|
|
3201
|
+
JSON.stringify(l[_.key]) !== JSON.stringify(v) && (h = !0), E[_.key] = v;
|
|
3196
3202
|
}), h && c(E);
|
|
3197
3203
|
}
|
|
3198
3204
|
}, [d]);
|
|
3199
3205
|
const u = (E, h) => {
|
|
3200
3206
|
c((_) => ({ ..._, [E]: h })), a((_) => ({ ..._, [E]: void 0 }));
|
|
3201
3207
|
}, p = e.fields.map((E) => {
|
|
3202
|
-
var
|
|
3208
|
+
var v, I, A;
|
|
3203
3209
|
const h = l[E.key] ?? null, _ = {
|
|
3204
3210
|
key: E.key,
|
|
3205
3211
|
label: E.label,
|
|
@@ -3212,7 +3218,7 @@ const Ra = (e, t = {}) => {
|
|
|
3212
3218
|
layout: E.layout,
|
|
3213
3219
|
value: h,
|
|
3214
3220
|
...E.placeholder && { placeholder: E.placeholder },
|
|
3215
|
-
...((
|
|
3221
|
+
...((v = E.rules) == null ? void 0 : v.max_length) && { maxLength: E.rules.max_length }
|
|
3216
3222
|
} : E.type === "number" ? {
|
|
3217
3223
|
..._,
|
|
3218
3224
|
type: "number",
|
|
@@ -3244,13 +3250,13 @@ const Ra = (e, t = {}) => {
|
|
|
3244
3250
|
const E = {};
|
|
3245
3251
|
let h = !1;
|
|
3246
3252
|
for (const _ of e.fields) {
|
|
3247
|
-
const
|
|
3253
|
+
const v = l[_.key] ?? null, I = Oa(_, v, n);
|
|
3248
3254
|
I.isValid || (E[_.key] = I.error, h = !0);
|
|
3249
3255
|
}
|
|
3250
3256
|
if (a(E), !h && r) {
|
|
3251
3257
|
const _ = {};
|
|
3252
|
-
e.fields.forEach((
|
|
3253
|
-
_[
|
|
3258
|
+
e.fields.forEach((v) => {
|
|
3259
|
+
_[v.key] = l[v.key] ?? null;
|
|
3254
3260
|
}), await r(_);
|
|
3255
3261
|
}
|
|
3256
3262
|
},
|
|
@@ -3351,25 +3357,25 @@ const Fa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), Pa = ({ csat
|
|
|
3351
3357
|
if (!f.initialEnabled) return;
|
|
3352
3358
|
let h = dr(t.length);
|
|
3353
3359
|
d.lastUpdate = 0, d.startTime = 0, d.lastProgressCall = 0;
|
|
3354
|
-
const _ = (
|
|
3360
|
+
const _ = (v) => {
|
|
3355
3361
|
var R;
|
|
3356
|
-
d.lastUpdate === 0 && (d.lastUpdate =
|
|
3357
|
-
const I = f.textLength, A =
|
|
3358
|
-
A >= L && h < I && (h = Math.min(h +
|
|
3362
|
+
d.lastUpdate === 0 && (d.lastUpdate = v, d.startTime = v, d.lastProgressCall = v);
|
|
3363
|
+
const I = f.textLength, A = v - d.lastUpdate, $ = v - d.startTime, { speed: w, chunkSize: y } = Ha($), L = w * y;
|
|
3364
|
+
A >= L && h < I && (h = Math.min(h + y, I), l(h), d.lastUpdate = v), v - d.lastProgressCall >= Ba && (d.lastProgressCall = v, (R = u.onProgress) == null || R.call(u)), (h < I || f.enabled) && (c.current = requestAnimationFrame(_));
|
|
3359
3365
|
};
|
|
3360
3366
|
return c.current = requestAnimationFrame(_), () => {
|
|
3361
|
-
var
|
|
3362
|
-
c.current && cancelAnimationFrame(c.current), p.startCalled && !p.completeCalled && (p.completeCalled = !0, (
|
|
3367
|
+
var v;
|
|
3368
|
+
c.current && cancelAnimationFrame(c.current), p.startCalled && !p.completeCalled && (p.completeCalled = !0, (v = u.onComplete) == null || v.call(u));
|
|
3363
3369
|
};
|
|
3364
3370
|
}, []), V(() => {
|
|
3365
3371
|
var I;
|
|
3366
|
-
const h = f.initialEnabled && p.startCalled, _ = !n,
|
|
3367
|
-
h && _ &&
|
|
3372
|
+
const h = f.initialEnabled && p.startCalled, _ = !n, v = a >= t.length && t.length > 0;
|
|
3373
|
+
h && _ && v && !p.completeCalled && (p.completeCalled = !0, (I = u.onComplete) == null || I.call(u));
|
|
3368
3374
|
}, [n, a, t.length]), {
|
|
3369
3375
|
streamText: f.initialEnabled ? t.slice(0, a) : t,
|
|
3370
3376
|
isAnimating: E
|
|
3371
3377
|
};
|
|
3372
|
-
}, za = "1.21.
|
|
3378
|
+
}, za = "1.21.2", me = "sb-agent", fe = {
|
|
3373
3379
|
ENTRY: `${me}-entry`,
|
|
3374
3380
|
MODAL_ROOT: `${me}-modal-root`,
|
|
3375
3381
|
WINDOW: `${me}-window`,
|
|
@@ -3501,7 +3507,7 @@ const qa = '@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,7
|
|
|
3501
3507
|
}, gn = {
|
|
3502
3508
|
language: "en",
|
|
3503
3509
|
strings: Ya,
|
|
3504
|
-
dateLocale:
|
|
3510
|
+
dateLocale: ys
|
|
3505
3511
|
}, Xa = (e) => ({
|
|
3506
3512
|
// Message Input
|
|
3507
3513
|
MESSAGE_INPUT__PLACE_HOLDER: e.conversation.input_placeholder,
|
|
@@ -3920,22 +3926,22 @@ const pl = (e, t = 5e3) => {
|
|
|
3920
3926
|
const a = () => {
|
|
3921
3927
|
o == null || o(), i();
|
|
3922
3928
|
};
|
|
3923
|
-
return /* @__PURE__ */ s.createElement(zt, { rootElementId: fe.WINDOW, visible: e, onClose: i }, /* @__PURE__ */ s.createElement(xl, null, /* @__PURE__ */ s.createElement(
|
|
3924
|
-
}, xl = m.div`width:360px;height:auto;padding-block:24px 12px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`,
|
|
3929
|
+
return /* @__PURE__ */ s.createElement(zt, { rootElementId: fe.WINDOW, visible: e, onClose: i }, /* @__PURE__ */ s.createElement(xl, null, /* @__PURE__ */ s.createElement(vl, null, t && /* @__PURE__ */ s.createElement(k, { variant: "h1", color: g.themedColor.textHighEmphasis }, t), n && /* @__PURE__ */ s.createElement(yl, null, /* @__PURE__ */ s.createElement(k, { variant: "subtitle2", color: g.themedColor.textHighEmphasis }, n))), /* @__PURE__ */ s.createElement(Sl, null, /* @__PURE__ */ s.createElement(Al, { onClick: a }, /* @__PURE__ */ s.createElement(k, { variant: "button", color: g.themedColor.primary }, r)))));
|
|
3930
|
+
}, xl = m.div`width:360px;height:auto;padding-block:24px 12px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, vl = m.div`margin-bottom:16px;`, yl = m.div`margin-top:8px;`, Sl = m.div`display:flex;flex-direction:row;justify-content:flex-end;`, Al = m.button`all:unset;display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:transparent;padding:10px 16px;`, {
|
|
3925
3931
|
Provider: Tl,
|
|
3926
3932
|
useContext: de
|
|
3927
3933
|
} = oe("MessengerSession"), Il = Qe(function({ children: e, ...t }, n) {
|
|
3928
3934
|
return /* @__PURE__ */ s.createElement(ta, { ref: n, ...t }, (r) => /* @__PURE__ */ s.createElement(wl, { ...r }, e));
|
|
3929
3935
|
}), wl = ({ children: e, ...t }) => {
|
|
3930
|
-
const { chatSDK: n, logger: r, appId: o, aiAgentId: i, agentPreviewConfigs: a, state: l, handlers: c, dispatcher: d, _aiAgentSDK: u } = Q(), { userSessionInfo: p, authenticate: f, userSession: x, aiAgentInfo: C, launcherInfo: E } = t, [h, _] = S(!1),
|
|
3936
|
+
const { chatSDK: n, logger: r, appId: o, aiAgentId: i, agentPreviewConfigs: a, state: l, handlers: c, dispatcher: d, _aiAgentSDK: u } = Q(), { userSessionInfo: p, authenticate: f, userSession: x, aiAgentInfo: C, launcherInfo: E } = t, [h, _] = S(!1), v = F(null);
|
|
3931
3937
|
ct(n, {
|
|
3932
3938
|
async onUserJoined(A, $) {
|
|
3933
|
-
var
|
|
3934
|
-
A.conversation && A.conversation.type === As.PROACTIVE && $.userId === ((
|
|
3939
|
+
var y, L, B, R;
|
|
3940
|
+
A.conversation && A.conversation.type === As.PROACTIVE && $.userId === ((y = n.currentUser) == null ? void 0 : y.userId) && (r.info("messengerSession.onUserJoined: proactive channel joined", A.url), (B = u.session) == null || B._updateActiveChannel({
|
|
3935
3941
|
url: A.url,
|
|
3936
3942
|
status: "open",
|
|
3937
3943
|
conversationStatus: (L = A.conversation) == null ? void 0 : L.status
|
|
3938
|
-
}), l.setOpened(!0), kl({ sound: document.hidden || !l.opened }), (R =
|
|
3944
|
+
}), l.setOpened(!0), kl({ sound: document.hidden || !l.opened }), (R = v.current) == null || R.call(v, { channel: A }));
|
|
3939
3945
|
}
|
|
3940
3946
|
}), V(() => {
|
|
3941
3947
|
f().then(({ launcher: A }) => {
|
|
@@ -3959,7 +3965,7 @@ const pl = (e, t = 5e3) => {
|
|
|
3959
3965
|
userSession: x,
|
|
3960
3966
|
aiAgentInfo: { ...C, ...a == null ? void 0 : a.bot },
|
|
3961
3967
|
launcherInfo: { ...E, ...a == null ? void 0 : a.launcher },
|
|
3962
|
-
registerOnJoinedProactiveConversation: (A) =>
|
|
3968
|
+
registerOnJoinedProactiveConversation: (A) => v.current = A
|
|
3963
3969
|
}
|
|
3964
3970
|
},
|
|
3965
3971
|
e,
|
|
@@ -4098,7 +4104,7 @@ const Ye = 50, rn = Ye - 40, {
|
|
|
4098
4104
|
shouldUpdate: !1
|
|
4099
4105
|
}, on = (e) => Math.max(0, e.scrollHeight - e.scrollTop - e.clientHeight);
|
|
4100
4106
|
function Bl({ scrollMode: e, messageStackDirection: t, children: n }) {
|
|
4101
|
-
const r = F(null), o = F(null), i = F(0), a = F(0), l = F(!1), c = F(!1), d = F(null), u = F(fr), p = F(!1), f = F(null), [x, C] = S(0), [E, h] = S(0), [_,
|
|
4107
|
+
const r = F(null), o = F(null), i = F(0), a = F(0), l = F(!1), c = F(!1), d = F(null), u = F(fr), p = F(!1), f = F(null), [x, C] = S(0), [E, h] = S(0), [_, v] = S(!1), [I, A] = S(!1), [$, w] = S(!0), y = (D) => {
|
|
4102
4108
|
const K = on(D);
|
|
4103
4109
|
return i.current = K, h(K), K;
|
|
4104
4110
|
}, L = () => {
|
|
@@ -4145,7 +4151,7 @@ function Bl({ scrollMode: e, messageStackDirection: t, children: n }) {
|
|
|
4145
4151
|
const D = r.current;
|
|
4146
4152
|
if (!D || B !== "fixed") return;
|
|
4147
4153
|
const K = H(D);
|
|
4148
|
-
u.current.contentHeight = (K == null ? void 0 : K.lastMessageBottom) ?? D.scrollHeight, !p.current && u.current.contentSnapshotHeight > 0 && R(), c.current ? i.current = on(D) :
|
|
4154
|
+
u.current.contentHeight = (K == null ? void 0 : K.lastMessageBottom) ?? D.scrollHeight, !p.current && u.current.contentSnapshotHeight > 0 && R(), c.current ? i.current = on(D) : y(D), T();
|
|
4149
4155
|
}, [B, H]), j = z(() => {
|
|
4150
4156
|
o.current && (o.current.disconnect(), o.current = null), L(), u.current = fr, C(0), h(0), w(!0), i.current = 0, l.current = !1, a.current = 0, c.current = !1;
|
|
4151
4157
|
}, []), J = z((D = !0) => {
|
|
@@ -4164,15 +4170,15 @@ function Bl({ scrollMode: e, messageStackDirection: t, children: n }) {
|
|
|
4164
4170
|
return;
|
|
4165
4171
|
}
|
|
4166
4172
|
if (l.current) {
|
|
4167
|
-
c.current = !1,
|
|
4173
|
+
c.current = !1, y(X), w(!0);
|
|
4168
4174
|
return;
|
|
4169
4175
|
}
|
|
4170
4176
|
const ne = () => {
|
|
4171
4177
|
if (r.current !== X) {
|
|
4172
|
-
c.current = !1, r.current &&
|
|
4178
|
+
c.current = !1, r.current && y(r.current), w(!0);
|
|
4173
4179
|
return;
|
|
4174
4180
|
}
|
|
4175
|
-
c.current = !1,
|
|
4181
|
+
c.current = !1, y(X), w(!0);
|
|
4176
4182
|
};
|
|
4177
4183
|
if (D && !d.current) {
|
|
4178
4184
|
const le = setTimeout(ne, 500);
|
|
@@ -4212,12 +4218,12 @@ function Bl({ scrollMode: e, messageStackDirection: t, children: n }) {
|
|
|
4212
4218
|
}, [H]), bt = (D, K, X) => {
|
|
4213
4219
|
const ne = on(D);
|
|
4214
4220
|
if (X && ne > Ye) {
|
|
4215
|
-
c.current = !1, l.current = !0, L(),
|
|
4221
|
+
c.current = !1, l.current = !0, L(), y(D), w(!0), a.current = K;
|
|
4216
4222
|
return;
|
|
4217
4223
|
}
|
|
4218
4224
|
i.current = ne;
|
|
4219
4225
|
}, M = (D, K, X) => {
|
|
4220
|
-
const le =
|
|
4226
|
+
const le = y(D) <= Ye;
|
|
4221
4227
|
K && !le && (l.current = !0, L()), X && le && (l.current = !1);
|
|
4222
4228
|
}, Be = (D) => {
|
|
4223
4229
|
const { scrollTop: K } = D.currentTarget, X = a.current;
|
|
@@ -4232,7 +4238,7 @@ function Bl({ scrollMode: e, messageStackDirection: t, children: n }) {
|
|
|
4232
4238
|
},
|
|
4233
4239
|
[B, J]
|
|
4234
4240
|
), qt = z((D) => {
|
|
4235
|
-
|
|
4241
|
+
v(D), D && (C(0), o.current && (o.current.disconnect(), o.current = null));
|
|
4236
4242
|
}, []), Yt = z(
|
|
4237
4243
|
(D) => {
|
|
4238
4244
|
B === "auto" && D && !l.current && J();
|
|
@@ -4462,7 +4468,7 @@ const rc = (e) => En ? Array.from(En.segment(e), (t) => t.segment) : [...e], oc
|
|
|
4462
4468
|
return Er(t);
|
|
4463
4469
|
const o = t.slice(0, n), i = t.slice(n);
|
|
4464
4470
|
return Er(o, i);
|
|
4465
|
-
},
|
|
4471
|
+
}, vo = ({ children: e, ...t }) => {
|
|
4466
4472
|
const { start: n, end: r } = ce(() => sc(e), [e]);
|
|
4467
4473
|
return r ? /* @__PURE__ */ s.createElement(ic, null, /* @__PURE__ */ s.createElement(ac, { ...t }, n), /* @__PURE__ */ s.createElement(lc, { ...t }, r)) : /* @__PURE__ */ s.createElement(k, { ...t }, n);
|
|
4468
4474
|
}, ic = m.span`display:flex;width:100%;min-width:0;overflow:hidden;direction:inherit;`, ac = m(k)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1;min-width:0;`, lc = m(k)`flex-shrink:0;white-space:nowrap;`, Dn = ({
|
|
@@ -4473,14 +4479,14 @@ const rc = (e) => En ? Array.from(En.segment(e), (t) => t.segment) : [...e], oc
|
|
|
4473
4479
|
onClick: o
|
|
4474
4480
|
}) => {
|
|
4475
4481
|
const { colors: i } = lt();
|
|
4476
|
-
return /* @__PURE__ */ s.createElement(cc, { onClick: o, $clickable: !!o }, /* @__PURE__ */ s.createElement(uc, { $bgColor: r ?? i.base.primary }, /* @__PURE__ */ s.createElement(G, { type: "file-document", size: 24, color: n ?? i.base.primaryContrastContent })), /* @__PURE__ */ s.createElement(mc, null, /* @__PURE__ */ s.createElement(
|
|
4482
|
+
return /* @__PURE__ */ s.createElement(cc, { onClick: o, $clickable: !!o }, /* @__PURE__ */ s.createElement(uc, { $bgColor: r ?? i.base.primary }, /* @__PURE__ */ s.createElement(G, { type: "file-document", size: 24, color: n ?? i.base.primaryContrastContent })), /* @__PURE__ */ s.createElement(mc, null, /* @__PURE__ */ s.createElement(vo, { variant: "button", color: g.themedColor.textHighEmphasis }, e), /* @__PURE__ */ s.createElement(k, { color: g.themedColor.textMidEmphasis, variant: "caption3" }, t)));
|
|
4477
4483
|
}, cc = m.div`border-radius:12px;gap:8px;width:${W.BODY_MAX_WIDTH}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${g.themedColor.textDisabled};background-color:${g.themedColor.bg_50_600};${({ $clickable: e }) => e && dc}`, dc = O`cursor:pointer;&:hover{background-color:${g.themedColor.bg_100_500};}`, uc = m.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, mc = m.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`;
|
|
4478
4484
|
function hc({ file: e, children: t, onClickFile: n }) {
|
|
4479
4485
|
return /* @__PURE__ */ s.createElement(gc, null, /* @__PURE__ */ s.createElement(
|
|
4480
4486
|
Dn,
|
|
4481
4487
|
{
|
|
4482
4488
|
name: e.name,
|
|
4483
|
-
type:
|
|
4489
|
+
type: yn(e.name, e.type),
|
|
4484
4490
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
4485
4491
|
}
|
|
4486
4492
|
), t);
|
|
@@ -4513,20 +4519,20 @@ const Ec = m.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
|
|
|
4513
4519
|
${U.dark`
|
|
4514
4520
|
background-color: ${g.color.background400};
|
|
4515
4521
|
`}
|
|
4516
|
-
`, bc = m.img`width:100%;height:100%;object-fit:cover;`, Cc = m.video`width:100%;height:100%;object-fit:cover;`, pt = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ s.createElement(xc, { className: e, $size: n }, t ?? /* @__PURE__ */ s.createElement(G, { type: "spinner", size: n })), xc = m.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => _e(e)};height:${({ $size: e }) => _e(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`, Pt = 3, Gt = 6,
|
|
4522
|
+
`, bc = m.img`width:100%;height:100%;object-fit:cover;`, Cc = m.video`width:100%;height:100%;object-fit:cover;`, pt = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ s.createElement(xc, { className: e, $size: n }, t ?? /* @__PURE__ */ s.createElement(G, { type: "spinner", size: n })), xc = m.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => _e(e)};height:${({ $size: e }) => _e(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`, Pt = 3, Gt = 6, vc = Gt / Pt, yc = Pt, Sc = Gt, Ac = (e) => {
|
|
4517
4523
|
const t = e % Pt;
|
|
4518
4524
|
return {
|
|
4519
4525
|
gridColumns: t > 0 ? Gt : Pt,
|
|
4520
4526
|
wideBottomCount: t
|
|
4521
4527
|
};
|
|
4522
|
-
},
|
|
4528
|
+
}, yo = ({ images: e, isPending: t = !1, onClickImage: n }) => {
|
|
4523
4529
|
const r = e.length;
|
|
4524
4530
|
if (r === 0) return null;
|
|
4525
4531
|
const { gridColumns: o, wideBottomCount: i = 0 } = Ac(r);
|
|
4526
4532
|
return /* @__PURE__ */ s.createElement(Ic, { $width: W.BODY_MAX_WIDTH, $columns: o }, e.map((a, l) => {
|
|
4527
4533
|
const c = i > 0 && l >= r - i;
|
|
4528
4534
|
let d = 1;
|
|
4529
|
-
return o === Gt && (c ? d = i === 1 ? Sc :
|
|
4535
|
+
return o === Gt && (c ? d = i === 1 ? Sc : yc : d = vc), /* @__PURE__ */ s.createElement(
|
|
4530
4536
|
wc,
|
|
4531
4537
|
{
|
|
4532
4538
|
key: a.url,
|
|
@@ -4576,7 +4582,7 @@ const Ec = m.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
|
|
|
4576
4582
|
const a = e[i];
|
|
4577
4583
|
a && (r ? r({ files: e, index: i }) : n && n({ url: a.url, type: a.type || "image/*" }));
|
|
4578
4584
|
};
|
|
4579
|
-
return /* @__PURE__ */ s.createElement(Rc, null, /* @__PURE__ */ s.createElement(
|
|
4585
|
+
return /* @__PURE__ */ s.createElement(Rc, null, /* @__PURE__ */ s.createElement(yo, { images: e, onClickImage: o }), t);
|
|
4580
4586
|
}, Rc = m.div`display:flex;flex-direction:column;align-items:flex-start;gap:${W.GAP_GROUPED}px;`, Dc = "✱", Ao = (e) => {
|
|
4581
4587
|
const t = new RegExp(`(\`+)([^\`]+?)\\1|(${Dc}+)`, "g");
|
|
4582
4588
|
return e.replace(t, (n, r, o, i) => r ? n : i ? `<span id=${pc} aria-label="masked-text">${i}</span>` : n);
|
|
@@ -4709,14 +4715,14 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
4709
4715
|
)
|
|
4710
4716
|
);
|
|
4711
4717
|
})), a && /* @__PURE__ */ s.createElement(xd, null, /* @__PURE__ */ s.createElement(k, { variant: "caption3", color: g.themedColor.textHighEmphasis }, l.FEEDBACK_COMMENT_LABEL), /* @__PURE__ */ s.createElement(
|
|
4712
|
-
|
|
4718
|
+
vd,
|
|
4713
4719
|
{
|
|
4714
4720
|
placeholder: l.FEEDBACK_COMMENT_PLACEHOLDER,
|
|
4715
4721
|
value: u,
|
|
4716
4722
|
onChange: (C) => p(C.target.value),
|
|
4717
4723
|
maxLength: 100
|
|
4718
4724
|
}
|
|
4719
|
-
))), /* @__PURE__ */ s.createElement(
|
|
4725
|
+
))), /* @__PURE__ */ s.createElement(yd, null, /* @__PURE__ */ s.createElement(Sd, { onClick: x }, /* @__PURE__ */ s.createElement(k, { variant: "button", color: g.themedColor.textHighEmphasis }, l.FEEDBACK_CANCEL)), /* @__PURE__ */ s.createElement(Ad, { onClick: f, disabled: !c }, /* @__PURE__ */ s.createElement(k, { variant: "button" }, n ? l.FEEDBACK_SAVE : l.FEEDBACK_SUBMIT))))) : null;
|
|
4720
4726
|
}, fd = m.div`width:280px;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};border-radius:12px;overflow:hidden;`, Ed = m.div`padding:24px;`, _d = m.div`padding-inline:24px;display:flex;flex-direction:column;gap:24px;`, bd = m.div`display:flex;gap:4px;`, Cd = m.button`width:114px;height:64px;border-radius:12px;border:1px solid ${g.themedColor.textDisabled};box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;gap:0;transition:background-color 0.2s;background-color:${({ $selected: e }) => e ? g.color.background100 : "transparent"};${({ $selected: e }) => U.dark`
|
|
4721
4727
|
background-color: ${e ? g.color.background600 : "transparent"};
|
|
4722
4728
|
`}
|
|
@@ -4728,7 +4734,7 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
4728
4734
|
&:active {
|
|
4729
4735
|
opacity: 0.6;
|
|
4730
4736
|
}
|
|
4731
|
-
`, xd = m.div`display:flex;flex-direction:column;gap:6px;`,
|
|
4737
|
+
`, xd = m.div`display:flex;flex-direction:column;gap:6px;`, vd = m.textarea`font-family:inherit;font-size:12px;line-height:16px;border:1px solid ${g.themedColor.textDisabled};border-radius:4px;padding:6px 12px;color:${g.themedColor.textHighEmphasis};background-color:${g.themedColor.textLowEmphasisInverse};resize:none;field-sizing:content;min-height:28px;max-height:118px;overflow-y:auto;&::placeholder{color:${g.themedColor.textLowEmphasis};}&:focus{outline:none;}`, yd = m.div`padding-inline:24px;padding-block:16px;display:flex;justify-content:flex-end;gap:4px;`, wo = m.button`width:86px;height:40px;border-radius:20px;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s;`, Sd = m(wo)`${Io}`, Ad = m(wo)`cursor:${({ disabled: e }) => e ? "not-allowed" : "pointer"};opacity:${({ disabled: e }) => e ? 0.4 : 1};&:hover:not(:disabled){opacity:0.8;}&:active:not(:disabled){opacity:0.6;}background-color:${({ theme: e }) => e.colors.base.primary};span{color:${({ theme: e }) => e.colors.base.primaryContrastContent};}`, vr = {
|
|
4732
4738
|
good: g.themedColor.secondary,
|
|
4733
4739
|
bad: g.themedColor.error
|
|
4734
4740
|
}, Td = ({
|
|
@@ -4742,31 +4748,31 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
4742
4748
|
}) => {
|
|
4743
4749
|
const { stringSet: l } = Z(), [c, d] = S(!1), [u, p] = S(!1), [f, x] = S(void 0), [C, E] = S(""), h = i == null ? void 0 : i.feedback, _ = (h == null ? void 0 : h.rating) ?? "none";
|
|
4744
4750
|
if (_ !== "none" ? !1 : !!(n || !e || !r || (i == null ? void 0 : i.bot_message_type) !== "generated" || t)) return null;
|
|
4745
|
-
const I = (
|
|
4746
|
-
_ === "none" ? (x(
|
|
4751
|
+
const I = (y) => {
|
|
4752
|
+
_ === "none" ? (x(y), E(""), d(!0)) : p(!0);
|
|
4747
4753
|
}, A = () => {
|
|
4748
4754
|
a == null || a(null), p(!1);
|
|
4749
4755
|
}, $ = () => {
|
|
4750
4756
|
p(!1), x(h == null ? void 0 : h.rating), E((h == null ? void 0 : h.comment) ?? ""), d(!0);
|
|
4751
|
-
}, w = (
|
|
4752
|
-
a == null || a(
|
|
4757
|
+
}, w = (y) => {
|
|
4758
|
+
a == null || a(y);
|
|
4753
4759
|
};
|
|
4754
|
-
return t && _ !== "none" ? /* @__PURE__ */ s.createElement(
|
|
4755
|
-
const L = _ ===
|
|
4760
|
+
return t && _ !== "none" ? /* @__PURE__ */ s.createElement(yr, { $horizontal: !0 }, /* @__PURE__ */ s.createElement(Id, null, /* @__PURE__ */ s.createElement(G, { type: _n(_), size: 12, color: vr[_] })), (h == null ? void 0 : h.comment) && /* @__PURE__ */ s.createElement(Sr, { variant: "caption2", style: { lineHeight: "16px" } }, h.comment)) : /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(yr, null, /* @__PURE__ */ s.createElement(wd, null, ["good", "bad"].map((y) => {
|
|
4761
|
+
const L = _ === y;
|
|
4756
4762
|
return /* @__PURE__ */ s.createElement(
|
|
4757
4763
|
kd,
|
|
4758
4764
|
{
|
|
4759
|
-
key:
|
|
4765
|
+
key: y,
|
|
4760
4766
|
$selected: L,
|
|
4761
|
-
$rating:
|
|
4762
|
-
onClick: () => I(
|
|
4767
|
+
$rating: y,
|
|
4768
|
+
onClick: () => I(y)
|
|
4763
4769
|
},
|
|
4764
4770
|
/* @__PURE__ */ s.createElement(
|
|
4765
4771
|
G,
|
|
4766
4772
|
{
|
|
4767
|
-
type: L ? _n(
|
|
4773
|
+
type: L ? _n(y) : y,
|
|
4768
4774
|
size: 14,
|
|
4769
|
-
color: L ?
|
|
4775
|
+
color: L ? vr[y] : g.themedColor.textMidEmphasis
|
|
4770
4776
|
}
|
|
4771
4777
|
)
|
|
4772
4778
|
);
|
|
@@ -4782,7 +4788,7 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
4782
4788
|
isCommentEnabled: o
|
|
4783
4789
|
}
|
|
4784
4790
|
));
|
|
4785
|
-
},
|
|
4791
|
+
}, yr = m.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row" : "column"};align-items:${({ $horizontal: e }) => e ? "flex-start" : "stretch"};gap:4px;margin-top:8px;word-break:break-word;max-width:${W.BODY_MAX_WIDTH}px;`, Id = m.div`padding:2px;flex-shrink:0;display:flex;align-items:center;`, wd = m.div`display:flex;gap:2px;`, kd = m.button`width:38px;height:20px;border-radius:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:opacity 0.2s;border:1px solid ${g.color.background200};background-color:${({ $selected: e }) => e ? g.color.background100 : "transparent"};${({ $selected: e }) => U.dark`
|
|
4786
4792
|
border: 1px solid ${g.color.background400};
|
|
4787
4793
|
background-color: ${e ? g.color.background500 : "transparent"};
|
|
4788
4794
|
`}
|
|
@@ -5061,8 +5067,8 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
5061
5067
|
maxSelect: n.FORM_VALIDATION_MAX_SELECT
|
|
5062
5068
|
},
|
|
5063
5069
|
onSubmit: (_) => {
|
|
5064
|
-
var
|
|
5065
|
-
return (
|
|
5070
|
+
var v;
|
|
5071
|
+
return (v = e.onSubmitForm) == null ? void 0 : v.call(e, { key: t.key, data: _ });
|
|
5066
5072
|
},
|
|
5067
5073
|
onCancel: () => {
|
|
5068
5074
|
var _;
|
|
@@ -5093,15 +5099,15 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
5093
5099
|
o((_) => ({ ..._, canceling: !1 }));
|
|
5094
5100
|
}
|
|
5095
5101
|
}, E = ce(() => {
|
|
5096
|
-
const _ = () => t.version > au,
|
|
5097
|
-
return _() ||
|
|
5102
|
+
const _ = () => t.version > au, v = () => t.fields.some((I) => !lu.has(I.type));
|
|
5103
|
+
return _() || v() ? { visible: !1, cancelable: !0, reason: n.FORM_NOT_SUPPORTED } : l === "draft" && (e.isHandedOff || e.isConversationClosed) ? { visible: !1, cancelable: !1, reason: n.FORM_UNAVAILABLE } : { visible: !0, cancelable: !0, reason: "" };
|
|
5098
5104
|
}, [t.version, t.fields, l, e.isHandedOff, e.isConversationClosed]);
|
|
5099
5105
|
return l === "canceled" ? null : E.visible ? /* @__PURE__ */ s.createElement(Ur, null, /* @__PURE__ */ s.createElement(Tr, { $maxWidth: e.maxBodyWidth ?? W.BODY_MAX_WIDTH }, /* @__PURE__ */ s.createElement(te.Title, null, t.title), /* @__PURE__ */ s.createElement(du, null, c.map((_) => /* @__PURE__ */ s.createElement(uu, { key: _.key }, /* @__PURE__ */ s.createElement(te.Label, { style: { marginBottom: "6px" }, required: _.required }, _.label), _.type === "text" && /* @__PURE__ */ s.createElement(
|
|
5100
5106
|
te.TextInput,
|
|
5101
5107
|
{
|
|
5102
5108
|
value: _.value || "",
|
|
5103
5109
|
placeholder: _.placeholder,
|
|
5104
|
-
onChange: (
|
|
5110
|
+
onChange: (v) => p(_.key, v),
|
|
5105
5111
|
disabled: f,
|
|
5106
5112
|
error: !!_.error,
|
|
5107
5113
|
submitted: f,
|
|
@@ -5113,7 +5119,7 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
5113
5119
|
{
|
|
5114
5120
|
value: _.value || null,
|
|
5115
5121
|
placeholder: _.placeholder,
|
|
5116
|
-
onChange: (
|
|
5122
|
+
onChange: (v) => p(_.key, v),
|
|
5117
5123
|
disabled: f,
|
|
5118
5124
|
error: !!_.error,
|
|
5119
5125
|
submitted: f,
|
|
@@ -5122,17 +5128,17 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
5122
5128
|
), _.type === "single-select" && /* @__PURE__ */ s.createElement(
|
|
5123
5129
|
te.SingleSelect,
|
|
5124
5130
|
{
|
|
5125
|
-
options: _.options.map((
|
|
5131
|
+
options: _.options.map((v) => ({ label: v, value: v })),
|
|
5126
5132
|
value: _.value || "",
|
|
5127
|
-
onChange: (
|
|
5133
|
+
onChange: (v) => p(_.key, v),
|
|
5128
5134
|
submitted: f
|
|
5129
5135
|
}
|
|
5130
5136
|
), _.type === "multi-select" && /* @__PURE__ */ s.createElement(
|
|
5131
5137
|
te.MultiSelect,
|
|
5132
5138
|
{
|
|
5133
|
-
options: _.options.map((
|
|
5139
|
+
options: _.options.map((v) => ({ label: v, value: v })),
|
|
5134
5140
|
value: _.value || [],
|
|
5135
|
-
onChange: (
|
|
5141
|
+
onChange: (v) => p(_.key, v),
|
|
5136
5142
|
submitted: f,
|
|
5137
5143
|
maxSelect: _.maxSelect
|
|
5138
5144
|
}
|
|
@@ -5220,14 +5226,14 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
5220
5226
|
},
|
|
5221
5227
|
a
|
|
5222
5228
|
)));
|
|
5223
|
-
}, Cu = m.div`margin:16px 0;padding:0 ${W.HORIZONTAL_PADDING}px;position:relative;display:flex;align-self:stretch;gap:8px;${({ $type: e }) => e === "vertical" ?
|
|
5229
|
+
}, Cu = m.div`margin:16px 0;padding:0 ${W.HORIZONTAL_PADDING}px;position:relative;display:flex;align-self:stretch;gap:8px;${({ $type: e }) => e === "vertical" ? vu : yu};`, xu = m(k)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:20px / clamp(20px,5%,100px);cursor:pointer;word-break:break-word;color:${g.color.primary.main};border:1px solid ${g.color.primary.main};background-color:${g.themedColor.bg_50_600};&:hover{background-color:${g.themedColor.bg_100_500};}${({ $type: e, theme: t }) => O`
|
|
5224
5230
|
${e === "vertical" ? Su : Au};
|
|
5225
5231
|
&:active {
|
|
5226
5232
|
background-color: ${t.colors.base.primary};
|
|
5227
5233
|
color: ${t.colors.base.primaryContrastContent};
|
|
5228
5234
|
}
|
|
5229
5235
|
`}
|
|
5230
|
-
`,
|
|
5236
|
+
`, vu = O`flex-direction:column;align-items:flex-end;`, yu = O`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Su = O`max-width:calc(100% - 70px);white-space:pre-wrap;`, Au = O`white-space:nowrap;`, Tu = (e) => {
|
|
5231
5237
|
const { components: t } = ze.useContext(), { stringSet: n } = Z(), r = qr(e) ? /* @__PURE__ */ s.createElement(t.TextMessageBody, { ...e }) : null;
|
|
5232
5238
|
if (e.messageType === "user")
|
|
5233
5239
|
return r;
|
|
@@ -5258,7 +5264,7 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
5258
5264
|
MessageLogs: hu
|
|
5259
5265
|
}
|
|
5260
5266
|
}), Ro = (e) => {
|
|
5261
|
-
var h, _,
|
|
5267
|
+
var h, _, v, I, A, $, w;
|
|
5262
5268
|
const { components: t } = ze.useContext(), { streamText: n, isAnimating: r } = Va({
|
|
5263
5269
|
text: e.message,
|
|
5264
5270
|
enabled: e.isStreaming,
|
|
@@ -5269,7 +5275,7 @@ const Uc = m.div`border-radius:50%;display:inline-block;overflow:hidden;position
|
|
|
5269
5275
|
...e,
|
|
5270
5276
|
message: n,
|
|
5271
5277
|
extendedMessagePayload: r ? {} : e.extendedMessagePayload
|
|
5272
|
-
}, i = !!o.isTyping, a = o.testerMode, l = !!o.isSenderAvatarVisible, c = !!((h = o.extendedMessagePayload) != null && h.form) && !((_ = o.extendedMessagePayload) != null && _.form.canceled_at), d = !!((
|
|
5278
|
+
}, i = !!o.isTyping, a = o.testerMode, l = !!o.isSenderAvatarVisible, c = !!((h = o.extendedMessagePayload) != null && h.form) && !((_ = o.extendedMessagePayload) != null && _.form.canceled_at), d = !!((v = o.extendedMessagePayload) != null && v.message_template), u = !!((I = o.extendedMessagePayload) != null && I.cta_button), p = !!((A = o.extendedMessagePayload) != null && A.citations) && o.extendedMessagePayload.citations.length > 0, f = !!o.createdAt, x = o.groupType === "top" || o.groupType === "single", C = o.groupType === "bottom" || o.groupType === "single", E = a || !l ? 0 : W.AVATAR_SIZE;
|
|
5273
5279
|
return /* @__PURE__ */ s.createElement(wu, { $marginBottom: i ? 0 : Sn(o.groupType) }, x && /* @__PURE__ */ s.createElement(ku, null, !a && l && /* @__PURE__ */ s.createElement(t.SenderAvatar, { ...o }), /* @__PURE__ */ s.createElement(t.SenderName, { ...o })), /* @__PURE__ */ s.createElement(Mu, null, /* @__PURE__ */ s.createElement(sn, { $extraStartPadding: E }, i ? /* @__PURE__ */ s.createElement(t.TypingIndicator, { ...o }) : /* @__PURE__ */ s.createElement(t.MessageBody, { ...o }, u && /* @__PURE__ */ s.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ s.createElement(t.CTAButton, { ...o })), p && /* @__PURE__ */ s.createElement(t.Citation, { ...o }))), d && /* @__PURE__ */ s.createElement(Ir, { $startPadding: 0, $endPadding: 0 }, /* @__PURE__ */ s.createElement(
|
|
5274
5280
|
t.MessageTemplate,
|
|
5275
5281
|
{
|
|
@@ -5298,7 +5304,7 @@ function Lu({ file: e, children: t, onClickFile: n, sendingStatus: r }) {
|
|
|
5298
5304
|
if (!(!n || r === "failed"))
|
|
5299
5305
|
return () => n == null ? void 0 : n(e);
|
|
5300
5306
|
})();
|
|
5301
|
-
return /* @__PURE__ */ s.createElement(Ou, null, /* @__PURE__ */ s.createElement(Dn, { name: e.name, type:
|
|
5307
|
+
return /* @__PURE__ */ s.createElement(Ou, null, /* @__PURE__ */ s.createElement(Dn, { name: e.name, type: yn(e.name, e.type), onClick: o }), t);
|
|
5302
5308
|
}
|
|
5303
5309
|
const Ou = m.div`display:flex;flex-direction:column;align-items:flex-end;gap:${W.GAP_GROUPED}px;`;
|
|
5304
5310
|
function Ru({
|
|
@@ -5345,7 +5351,7 @@ const Du = m.div`display:flex;flex-direction:column;align-items:flex-end;gap:${W
|
|
|
5345
5351
|
const p = a[u];
|
|
5346
5352
|
p && (o ? o({ files: a, index: u }) : r && r({ url: p.url, type: p.type || "image/*" }));
|
|
5347
5353
|
};
|
|
5348
|
-
return /* @__PURE__ */ s.createElement(Bu, null, /* @__PURE__ */ s.createElement(
|
|
5354
|
+
return /* @__PURE__ */ s.createElement(Bu, null, /* @__PURE__ */ s.createElement(yo, { images: a, isPending: l, onClickImage: d }), i);
|
|
5349
5355
|
}, Bu = m.div`display:flex;flex-direction:column;align-items:flex-end;gap:${W.GAP_GROUPED}px;`;
|
|
5350
5356
|
function Uu(e) {
|
|
5351
5357
|
var n, r;
|
|
@@ -5727,10 +5733,10 @@ const Hu = m.div`display:flex;flex-direction:column;border-radius:12px;overflow:
|
|
|
5727
5733
|
submit_label: t.CSAT_SUBMIT_LABEL,
|
|
5728
5734
|
submitted_label: t.CSAT_TITLE_SUBMITTED
|
|
5729
5735
|
});
|
|
5730
|
-
},
|
|
5736
|
+
}, vm = () => {
|
|
5731
5737
|
const { stringSet: e } = Z();
|
|
5732
5738
|
return /* @__PURE__ */ s.createElement(k, { variant: "body2", color: g.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
|
|
5733
|
-
},
|
|
5739
|
+
}, ym = ({ onMount: e, children: t }) => (V(() => {
|
|
5734
5740
|
e && Nt(e);
|
|
5735
5741
|
}, []), /* @__PURE__ */ s.createElement(s.Fragment, null, t)), Sm = (e) => {
|
|
5736
5742
|
if (e.messageType !== "admin.csat")
|
|
@@ -5738,7 +5744,7 @@ const Hu = m.div`display:flex;flex-direction:column;border-radius:12px;overflow:
|
|
|
5738
5744
|
const { extendedMessagePayload: t, onSubmitCSAT: n, onScrollToBottom: r } = e, { csat: o, csatReason: i, csatExpireAt: a, isResolvedWhenDeterminedByUser: l } = e, c = Gr(), d = xm(t == null ? void 0 : t.csat), u = F(!1);
|
|
5739
5745
|
if (!d || !d.visibility || !Se[d.type]) return null;
|
|
5740
5746
|
const p = d.type === Se.AI_AGENT_CSAT_5 || d.type === Se.AI_AGENT_CSAT_5_WITH_CRE || d.type === Se.HELPDESK_CSAT_5 ? an : () => null;
|
|
5741
|
-
return /* @__PURE__ */ s.createElement(Am, null, !o && Qn(a) ? /* @__PURE__ */ s.createElement(
|
|
5747
|
+
return /* @__PURE__ */ s.createElement(Am, null, !o && Qn(a) ? /* @__PURE__ */ s.createElement(vm, null) : /* @__PURE__ */ s.createElement(
|
|
5742
5748
|
p,
|
|
5743
5749
|
{
|
|
5744
5750
|
csatPayload: d,
|
|
@@ -5746,7 +5752,7 @@ const Hu = m.div`display:flex;flex-direction:column;border-radius:12px;overflow:
|
|
|
5746
5752
|
initialCsat: o,
|
|
5747
5753
|
initialCsatReason: i,
|
|
5748
5754
|
initialIsResolved: l,
|
|
5749
|
-
renderSubmitButton: ({ state: f, params: x, validateParams: C }) => /* @__PURE__ */ s.createElement(
|
|
5755
|
+
renderSubmitButton: ({ state: f, params: x, validateParams: C }) => /* @__PURE__ */ s.createElement(ym, { onMount: r }, /* @__PURE__ */ s.createElement(
|
|
5750
5756
|
Tm,
|
|
5751
5757
|
{
|
|
5752
5758
|
$state: f,
|
|
@@ -5912,11 +5918,11 @@ const et = () => {
|
|
|
5912
5918
|
onLoadNext: E,
|
|
5913
5919
|
loadThreshold: h = 0.05,
|
|
5914
5920
|
onScroll: _ = Te,
|
|
5915
|
-
depsForResetScrollPositionToBottom:
|
|
5921
|
+
depsForResetScrollPositionToBottom: v,
|
|
5916
5922
|
stackDirection: I = "top",
|
|
5917
5923
|
bottomSpacerHeight: A = 0,
|
|
5918
5924
|
ariaLabel: $
|
|
5919
|
-
} = t, w = F(null),
|
|
5925
|
+
} = t, w = F(null), y = z(
|
|
5920
5926
|
(P) => {
|
|
5921
5927
|
w.current = P, n && (typeof n == "function" ? n(P) : n.current = P);
|
|
5922
5928
|
},
|
|
@@ -5924,7 +5930,7 @@ const et = () => {
|
|
|
5924
5930
|
), L = F(!1), B = F(void 0), R = F(0), T = F(0);
|
|
5925
5931
|
re(() => {
|
|
5926
5932
|
w.current && (w.current.scrollTop = w.current.scrollHeight);
|
|
5927
|
-
},
|
|
5933
|
+
}, v), re(() => {
|
|
5928
5934
|
w.current && (B.current === "top" && (w.current.scrollTop = w.current.scrollHeight - T.current), B.current === "bottom" && (w.current.scrollTop = R.current), B.current = void 0);
|
|
5929
5935
|
}, [w.current, r.length]);
|
|
5930
5936
|
const H = async (P) => {
|
|
@@ -5938,7 +5944,7 @@ const et = () => {
|
|
|
5938
5944
|
Hm,
|
|
5939
5945
|
{
|
|
5940
5946
|
id: "infinite-list-inner",
|
|
5941
|
-
ref:
|
|
5947
|
+
ref: y,
|
|
5942
5948
|
onScroll: H,
|
|
5943
5949
|
role: "list",
|
|
5944
5950
|
"aria-label": $
|
|
@@ -5968,22 +5974,22 @@ const we = ({
|
|
|
5968
5974
|
return /* @__PURE__ */ s.createElement(jm, { as: e, disabled: o, ...i }, /* @__PURE__ */ s.createElement(G, { type: t, size: n, color: r ?? a }));
|
|
5969
5975
|
}, jm = m.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, qm = ({ files: e, initialIndex: t = 0, onClose: n, visible: r }) => {
|
|
5970
5976
|
var $, w;
|
|
5971
|
-
const [o, i] = S(t), [a, l] = S(!1), { stringSet: c, format: d } = Z(), { config: u } = Q(), p = e.length, f = e[o], x = ((w = ($ = u == null ? void 0 : u.conversation) == null ? void 0 : $.fileViewer) == null ? void 0 : w.downloadEnabled) !== !1, C = p > 1, E = (f == null ? void 0 : f.type) || "", h = Re(E), _ = jr(E),
|
|
5977
|
+
const [o, i] = S(t), [a, l] = S(!1), { stringSet: c, format: d } = Z(), { config: u } = Q(), p = e.length, f = e[o], x = ((w = ($ = u == null ? void 0 : u.conversation) == null ? void 0 : $.fileViewer) == null ? void 0 : w.downloadEnabled) !== !1, C = p > 1, E = (f == null ? void 0 : f.type) || "", h = Re(E), _ = jr(E), v = !Gm(E);
|
|
5972
5978
|
V(() => {
|
|
5973
5979
|
r && (i(t), l(!1));
|
|
5974
5980
|
}, [r, t]);
|
|
5975
5981
|
const I = z(() => {
|
|
5976
|
-
o > 0 && (i((
|
|
5982
|
+
o > 0 && (i((y) => y - 1), l(!1));
|
|
5977
5983
|
}, [o]), A = z(() => {
|
|
5978
|
-
o < p - 1 && (i((
|
|
5984
|
+
o < p - 1 && (i((y) => y + 1), l(!1));
|
|
5979
5985
|
}, [o, p]);
|
|
5980
5986
|
return V(() => {
|
|
5981
5987
|
if (!r) return;
|
|
5982
|
-
const
|
|
5988
|
+
const y = (L) => {
|
|
5983
5989
|
L.key === "ArrowLeft" ? I() : L.key === "ArrowRight" ? A() : L.key === "Escape" && n();
|
|
5984
5990
|
};
|
|
5985
|
-
return window.addEventListener("keydown",
|
|
5986
|
-
}, [r, I, A, n]), !r || !f ? null : /* @__PURE__ */ s.createElement(zt, { onClose: n, visible: r, rootElementId: fe.MODAL_ROOT }, /* @__PURE__ */ s.createElement(Ym, null, /* @__PURE__ */ s.createElement(Xm, null, /* @__PURE__ */ s.createElement(Zm, null, /* @__PURE__ */ s.createElement(Jm, null, /* @__PURE__ */ s.createElement(k, { variant: "button", maxTextLines: 1, color: g.themedColor.textHighEmphasis }, f.name || c.IMAGE_VIEWER__DEFAULT_TITLE), f.timestamp && /* @__PURE__ */ s.createElement(k, { variant: "caption2", color: g.themedColor.textMidEmphasis }, d(new Date(f.timestamp), "h:mm a")))), /* @__PURE__ */ s.createElement(Qm, { type: "close", size: 24, "aria-label": c.A11Y_IMAGE_VIEWER_CLOSE, onClick: n })), /* @__PURE__ */ s.createElement(eh, { onClick: (
|
|
5991
|
+
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
5992
|
+
}, [r, I, A, n]), !r || !f ? null : /* @__PURE__ */ s.createElement(zt, { onClose: n, visible: r, rootElementId: fe.MODAL_ROOT }, /* @__PURE__ */ s.createElement(Ym, null, /* @__PURE__ */ s.createElement(Xm, null, /* @__PURE__ */ s.createElement(Zm, null, /* @__PURE__ */ s.createElement(Jm, null, /* @__PURE__ */ s.createElement(k, { variant: "button", maxTextLines: 1, color: g.themedColor.textHighEmphasis }, f.name || c.IMAGE_VIEWER__DEFAULT_TITLE), f.timestamp && /* @__PURE__ */ s.createElement(k, { variant: "caption2", color: g.themedColor.textMidEmphasis }, d(new Date(f.timestamp), "h:mm a")))), /* @__PURE__ */ s.createElement(Qm, { type: "close", size: 24, "aria-label": c.A11Y_IMAGE_VIEWER_CLOSE, onClick: n })), /* @__PURE__ */ s.createElement(eh, { onClick: (y) => y.currentTarget === y.target && n() }, C && /* @__PURE__ */ s.createElement(
|
|
5987
5993
|
$r,
|
|
5988
5994
|
{
|
|
5989
5995
|
$position: "left",
|
|
@@ -6002,7 +6008,7 @@ const we = ({
|
|
|
6002
6008
|
$loaded: a,
|
|
6003
6009
|
onLoad: () => l(!0)
|
|
6004
6010
|
}
|
|
6005
|
-
)), _ && /* @__PURE__ */ s.createElement(oh, { controls: !0 }, /* @__PURE__ */ s.createElement("source", { src: f.url, type: E })),
|
|
6011
|
+
)), _ && /* @__PURE__ */ s.createElement(oh, { controls: !0 }, /* @__PURE__ */ s.createElement("source", { src: f.url, type: E })), v && /* @__PURE__ */ s.createElement(sh, null, /* @__PURE__ */ s.createElement(k, { variant: "h1", color: g.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT))), C && /* @__PURE__ */ s.createElement(
|
|
6006
6012
|
$r,
|
|
6007
6013
|
{
|
|
6008
6014
|
$position: "right",
|
|
@@ -6012,7 +6018,7 @@ const we = ({
|
|
|
6012
6018
|
"aria-label": c.A11Y_IMAGE_VIEWER_NEXT,
|
|
6013
6019
|
disabled: o === p - 1
|
|
6014
6020
|
}
|
|
6015
|
-
)), /* @__PURE__ */ s.createElement(ih, null, /* @__PURE__ */ s.createElement(ah, null), C && /* @__PURE__ */ s.createElement(k, { variant: "body3", color: g.themedColor.textHighEmphasis }, o + 1, "/", p), /* @__PURE__ */ s.createElement(lh, null, x && !
|
|
6021
|
+
)), /* @__PURE__ */ s.createElement(ih, null, /* @__PURE__ */ s.createElement(ah, null), C && /* @__PURE__ */ s.createElement(k, { variant: "body3", color: g.themedColor.textHighEmphasis }, o + 1, "/", p), /* @__PURE__ */ s.createElement(lh, null, x && !v && /* @__PURE__ */ s.createElement(
|
|
6016
6022
|
we,
|
|
6017
6023
|
{
|
|
6018
6024
|
as: "a",
|
|
@@ -6069,10 +6075,10 @@ function xh({ enabled: e }) {
|
|
|
6069
6075
|
};
|
|
6070
6076
|
}, [n.scrollToBottom, e]);
|
|
6071
6077
|
}
|
|
6072
|
-
const
|
|
6078
|
+
const vh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
6073
6079
|
const { format: r, stringSet: o } = Z();
|
|
6074
|
-
return /* @__PURE__ */ s.createElement(
|
|
6075
|
-
},
|
|
6080
|
+
return /* @__PURE__ */ s.createElement(yh, { id: `${me}-date-separator`, style: n, className: e }, /* @__PURE__ */ s.createElement(k, { variant: "caption4", color: g.themedColor.textMidEmphasis }, r(t, o.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR)));
|
|
6081
|
+
}, yh = m.div`display:flex;justify-content:center;align-items:center;text-align:center;word-break:break-word;`, Sh = ({
|
|
6076
6082
|
className: e,
|
|
6077
6083
|
style: t,
|
|
6078
6084
|
onClick: n,
|
|
@@ -6102,7 +6108,7 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6102
6108
|
`, Th = () => null, Un = Ce({
|
|
6103
6109
|
template: Th,
|
|
6104
6110
|
components: {
|
|
6105
|
-
DateSeparator:
|
|
6111
|
+
DateSeparator: vh,
|
|
6106
6112
|
ScrollToBottomButton: Sh
|
|
6107
6113
|
}
|
|
6108
6114
|
}), Ih = () => {
|
|
@@ -6115,7 +6121,7 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6115
6121
|
/**
|
|
6116
6122
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
6117
6123
|
*/
|
|
6118
|
-
shouldShowOriginalDate: (p) => p > 0 || a.length === 0 ? !0 : d && !
|
|
6124
|
+
shouldShowOriginalDate: (p) => p > 0 || a.length === 0 ? !0 : d && !vs(d.createdAt, (u == null ? void 0 : u.createdAt) ?? 0),
|
|
6119
6125
|
/**
|
|
6120
6126
|
* Renders the list of welcome messages from Bot Studio.
|
|
6121
6127
|
*/
|
|
@@ -6191,11 +6197,11 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6191
6197
|
channelSource: C,
|
|
6192
6198
|
messageSource: E,
|
|
6193
6199
|
scrollSource: h,
|
|
6194
|
-
state: { input: _, streamAnimation:
|
|
6195
|
-
} = ae(), { isActionbookTester: I } = et(), { filteredMessages: A, shouldShowOriginalDate: $, renderAgentPreviewWelcomeMessages: w } = Ih(),
|
|
6200
|
+
state: { input: _, streamAnimation: v }
|
|
6201
|
+
} = ae(), { isActionbookTester: I } = et(), { filteredMessages: A, shouldShowOriginalDate: $, renderAgentPreviewWelcomeMessages: w } = Ih(), y = Na(C.channel), [L, B] = S(null), [R, T] = S(null);
|
|
6196
6202
|
V(() => {
|
|
6197
|
-
h.actions.onTypingIndicatorUpdate(!!
|
|
6198
|
-
}, [!!
|
|
6203
|
+
h.actions.onTypingIndicatorUpdate(!!y);
|
|
6204
|
+
}, [!!y, h.actions.onTypingIndicatorUpdate]), wh(), xh({
|
|
6199
6205
|
enabled: E.initialized && E.messages.length > 0
|
|
6200
6206
|
});
|
|
6201
6207
|
const H = (M, Be = !1) => {
|
|
@@ -6256,7 +6262,7 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6256
6262
|
if (M.isUserMessage())
|
|
6257
6263
|
return /* @__PURE__ */ s.createElement(e, { messageType: "user", ...xe });
|
|
6258
6264
|
if (M.isFileMessage()) {
|
|
6259
|
-
const [Y, ie] = ((se = M.metaArrays.find((
|
|
6265
|
+
const [Y, ie] = ((se = M.metaArrays.find((ve) => ve.key === Kr)) == null ? void 0 : se.value) ?? [];
|
|
6260
6266
|
return /* @__PURE__ */ s.createElement(
|
|
6261
6267
|
e,
|
|
6262
6268
|
{
|
|
@@ -6307,8 +6313,8 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6307
6313
|
onGetCachedMessageTemplate: (Y) => a.template.get(Y),
|
|
6308
6314
|
onHandleTemplateInternalAction: (Y) => {
|
|
6309
6315
|
if (Y.type === "internal" && Y.internalData) {
|
|
6310
|
-
const { method: ie, payload:
|
|
6311
|
-
ie === "message.send" && (
|
|
6316
|
+
const { method: ie, payload: ve } = Y.internalData;
|
|
6317
|
+
ie === "message.send" && (ve != null && ve.message) && E.sendUserMessage({ message: ve.message });
|
|
6312
6318
|
}
|
|
6313
6319
|
},
|
|
6314
6320
|
onFeedbackUpdate: (Y) => {
|
|
@@ -6318,8 +6324,8 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6318
6324
|
};
|
|
6319
6325
|
if (!Y)
|
|
6320
6326
|
return c.aiAgent.deleteMessageFeedback(ie);
|
|
6321
|
-
const
|
|
6322
|
-
return De.hasFeedback(M) ? c.aiAgent.updateMessageFeedback(
|
|
6327
|
+
const ve = { ...ie, rating: gd(Y.rating), comment: Y.comment };
|
|
6328
|
+
return De.hasFeedback(M) ? c.aiAgent.updateMessageFeedback(ve) : c.aiAgent.createMessageFeedback(ve);
|
|
6323
6329
|
},
|
|
6324
6330
|
onSubmitForm: ({ key: Y, data: ie }) => c.aiAgent.submitForm({
|
|
6325
6331
|
messageId: M.messageId,
|
|
@@ -6333,13 +6339,13 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6333
6339
|
formKey: Y
|
|
6334
6340
|
}),
|
|
6335
6341
|
onStreamAnimationStart: () => {
|
|
6336
|
-
|
|
6342
|
+
v.start(M.messageId);
|
|
6337
6343
|
},
|
|
6338
6344
|
onStreamAnimationProgress: () => {
|
|
6339
6345
|
h.actions.onStreamingUpdate(!0);
|
|
6340
6346
|
},
|
|
6341
6347
|
onStreamAnimationComplete: () => {
|
|
6342
|
-
|
|
6348
|
+
v.stop(M.messageId), h.actions.onStreamingUpdate(!1);
|
|
6343
6349
|
}
|
|
6344
6350
|
};
|
|
6345
6351
|
if (M.isUserMessage())
|
|
@@ -6368,7 +6374,7 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6368
6374
|
bottomSpacerHeight: h.state.bottomSpace,
|
|
6369
6375
|
ariaLabel: o.A11Y_MESSAGE_LIST,
|
|
6370
6376
|
loading: !E.initialized || !C.channel,
|
|
6371
|
-
empty: A.length === 0 && !
|
|
6377
|
+
empty: A.length === 0 && !y,
|
|
6372
6378
|
error: !!(f || C.error),
|
|
6373
6379
|
LoadingComponent: /* @__PURE__ */ s.createElement(it, { type: "loading" }),
|
|
6374
6380
|
EmptyComponent: (() => {
|
|
@@ -6387,7 +6393,7 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6387
6393
|
}
|
|
6388
6394
|
),
|
|
6389
6395
|
messageTopArea: /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement($h, { style: { marginTop: 16 } }), w()),
|
|
6390
|
-
messageBottomArea: /* @__PURE__ */ s.createElement(s.Fragment, null,
|
|
6396
|
+
messageBottomArea: /* @__PURE__ */ s.createElement(s.Fragment, null, y && /* @__PURE__ */ s.createElement(
|
|
6391
6397
|
"div",
|
|
6392
6398
|
{
|
|
6393
6399
|
id: `${me}-message-item`,
|
|
@@ -6398,9 +6404,9 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6398
6404
|
t,
|
|
6399
6405
|
{
|
|
6400
6406
|
isTyping: !0,
|
|
6401
|
-
isBotMessage:
|
|
6402
|
-
sender:
|
|
6403
|
-
thinkingMessage:
|
|
6407
|
+
isBotMessage: y.isBot,
|
|
6408
|
+
sender: y.user,
|
|
6409
|
+
thinkingMessage: y.thinkingMessage,
|
|
6404
6410
|
messageType: "user",
|
|
6405
6411
|
groupType: "single",
|
|
6406
6412
|
message: "",
|
|
@@ -6415,7 +6421,7 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6415
6421
|
ariaLabel: o.A11Y_SCROLL_TO_NEW_MESSAGES,
|
|
6416
6422
|
onClick: () => h.actions.scrollToBottom()
|
|
6417
6423
|
}
|
|
6418
|
-
), h.state.isAwayFromBottom && E.newMessages.length === 0 && !
|
|
6424
|
+
), h.state.isAwayFromBottom && E.newMessages.length === 0 && !y && /* @__PURE__ */ s.createElement(
|
|
6419
6425
|
r.ScrollToBottomButton,
|
|
6420
6426
|
{
|
|
6421
6427
|
ariaLabel: o.A11Y_SCROLL_TO_BOTTOM,
|
|
@@ -6487,44 +6493,44 @@ const yh = ({ className: e, date: t = Date.now(), style: n }) => {
|
|
|
6487
6493
|
}), d = n({
|
|
6488
6494
|
channel: o.channel,
|
|
6489
6495
|
uploadSizeLimit: (w = t.appInfo) == null ? void 0 : w.uploadSizeLimit
|
|
6490
|
-
}), u = d.isEnabled(), p = d.maxAttachmentCount, f = (
|
|
6491
|
-
c({ visible: !0, title:
|
|
6496
|
+
}), u = d.isEnabled(), p = d.maxAttachmentCount, f = (y) => {
|
|
6497
|
+
c({ visible: !0, title: y });
|
|
6492
6498
|
}, x = () => {
|
|
6493
6499
|
f(r.FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT.replace("%d", p.toString()));
|
|
6494
|
-
}, C = (
|
|
6495
|
-
f(r.FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT.replace("%d",
|
|
6496
|
-
}, E = (
|
|
6500
|
+
}, C = (y) => {
|
|
6501
|
+
f(r.FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT.replace("%d", y.toString()));
|
|
6502
|
+
}, E = (y) => {
|
|
6497
6503
|
f(
|
|
6498
|
-
r.FILE_UPLOAD_NOTIFICATION__FILES_EXCLUDED_BY_VALIDATION.replace("%d",
|
|
6504
|
+
r.FILE_UPLOAD_NOTIFICATION__FILES_EXCLUDED_BY_VALIDATION.replace("%d", y.toString())
|
|
6499
6505
|
);
|
|
6500
|
-
}, h = (
|
|
6506
|
+
}, h = (y) => y.map((L) => ({
|
|
6501
6507
|
file: L,
|
|
6502
6508
|
preview: { url: URL.createObjectURL(L), type: L.type, name: L.name }
|
|
6503
|
-
})), _ = (
|
|
6504
|
-
a((L) => [...L, ...h(
|
|
6505
|
-
},
|
|
6506
|
-
a((L) => (L.forEach((B) => URL.revokeObjectURL(B.preview.url)), h(
|
|
6507
|
-
}, I = (
|
|
6508
|
-
if (!u ||
|
|
6509
|
+
})), _ = (y) => {
|
|
6510
|
+
a((L) => [...L, ...h(y)]);
|
|
6511
|
+
}, v = (y) => {
|
|
6512
|
+
a((L) => (L.forEach((B) => URL.revokeObjectURL(B.preview.url)), h(y)));
|
|
6513
|
+
}, I = (y) => {
|
|
6514
|
+
if (!u || y.length === 0) return;
|
|
6509
6515
|
if (p - i.length === 0) {
|
|
6510
6516
|
x();
|
|
6511
6517
|
return;
|
|
6512
6518
|
}
|
|
6513
|
-
if (i.length +
|
|
6519
|
+
if (i.length + y.length > p) {
|
|
6514
6520
|
x();
|
|
6515
6521
|
return;
|
|
6516
6522
|
}
|
|
6517
|
-
const B = Vh(
|
|
6523
|
+
const B = Vh(y), { passed: R, failedBySize: T, failedByType: H } = zh(B, d), P = T.length + H.length, j = B.length === 1 ? T[0] : void 0;
|
|
6518
6524
|
if (j ? C(d.getUploadSizeLimitInMB(j.type)) : P > 0 && E(P), R.length === 0) return;
|
|
6519
|
-
i.length > 0 && i.every((q) => Re(q.file.type)) && R.every((q) => Re(q.type)) ? _(R) :
|
|
6520
|
-
}, A = (
|
|
6525
|
+
i.length > 0 && i.every((q) => Re(q.file.type)) && R.every((q) => Re(q.type)) ? _(R) : v(R);
|
|
6526
|
+
}, A = (y) => {
|
|
6521
6527
|
a((L) => {
|
|
6522
6528
|
var R;
|
|
6523
|
-
const B = (R = L[
|
|
6524
|
-
return B && URL.revokeObjectURL(B.url), L.filter((T, H) => H !==
|
|
6529
|
+
const B = (R = L[y]) == null ? void 0 : R.preview;
|
|
6530
|
+
return B && URL.revokeObjectURL(B.url), L.filter((T, H) => H !== y);
|
|
6525
6531
|
});
|
|
6526
6532
|
}, $ = () => {
|
|
6527
|
-
a((
|
|
6533
|
+
a((y) => (y.forEach((L) => URL.revokeObjectURL(L.preview.url)), []));
|
|
6528
6534
|
};
|
|
6529
6535
|
return /* @__PURE__ */ s.createElement(
|
|
6530
6536
|
Po.Provider,
|
|
@@ -6581,14 +6587,14 @@ const Kh = (e, t) => {
|
|
|
6581
6587
|
}
|
|
6582
6588
|
`, Xh = () => {
|
|
6583
6589
|
const e = gt(), [t, n] = S(), { files: r, removeFile: o, isFileUploadEnabled: i } = Hn();
|
|
6584
|
-
return !i || r.length === 0 ? null : /* @__PURE__ */ s.createElement(jh, null, r.map(({ preview: { type: a, name: l, url: c } }, d) => /* @__PURE__ */ s.createElement(qh, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ s.createElement(Yh, { title: "Remove file", onClick: () => o(d) }, /* @__PURE__ */ s.createElement(G, { type: "close-filled", color: g.themedColor.textMidEmphasis })), a.startsWith("image/") ? /* @__PURE__ */ s.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ s.createElement(Dn, { name: l, type:
|
|
6590
|
+
return !i || r.length === 0 ? null : /* @__PURE__ */ s.createElement(jh, null, r.map(({ preview: { type: a, name: l, url: c } }, d) => /* @__PURE__ */ s.createElement(qh, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ s.createElement(Yh, { title: "Remove file", onClick: () => o(d) }, /* @__PURE__ */ s.createElement(G, { type: "close-filled", color: g.themedColor.textMidEmphasis })), a.startsWith("image/") ? /* @__PURE__ */ s.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ s.createElement(Dn, { name: l, type: yn(l, a) }))));
|
|
6585
6591
|
}, Zh = {
|
|
6586
6592
|
textArea: O`min-height:40px;height:40px;font-size:16px;line-height:24px;`
|
|
6587
6593
|
}, Bo = m.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, Mr = m.div`width:100%;position:relative;background-color:${g.themedColor.bg_100_500};border-radius:20px;`, Lr = m.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, Or = m.textarea`all:unset;display:block;flex:1;min-width:0;padding-top:8px;padding-bottom:8px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;font-size:14px;line-height:20px;color:${g.themedColor.textHighEmphasis};resize:none;width:100%;height:${ho}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${Eo && Zh.textArea};&::placeholder{color:${g.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${g.themedColor.textDisabled};}}`, Jh = m.input`display:none;`;
|
|
6588
6594
|
m.div`display:flex;align-items:center;gap:24px;`;
|
|
6589
6595
|
const Qh = m(Bo)`flex-shrink:0;border-radius:8px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{background-color:${g.themedColor.bg_100_500};path{fill:${g.themedColor.textHighEmphasis};}}&:active{background-color:${g.themedColor.bg_200_400};}}`, Rr = m.div`padding:10px 16px 10px 12px;position:relative;display:flex;align-items:center;gap:8px;`, Dr = (e) => e.startsWith("image/"), Nr = ({ disabled: e }) => {
|
|
6590
|
-
var $, w,
|
|
6591
|
-
const { stringSet: t } = Z(), { config: n } = Q(), r = F(null), o = F(null), [i, a] = S(!1), { addFiles: l, isFileUploadEnabled: c, acceptableMimeTypes: d, showFileUploadAlert: u } = Hn(), p = d.includes(cn), f = p ? ["image/*"] : d.filter(Dr), x = p ? [cn] : d.filter((R) => !Dr(R)), C = !!((
|
|
6596
|
+
var $, w, y, L, B;
|
|
6597
|
+
const { stringSet: t } = Z(), { config: n } = Q(), r = F(null), o = F(null), [i, a] = S(!1), { addFiles: l, isFileUploadEnabled: c, acceptableMimeTypes: d, showFileUploadAlert: u } = Hn(), p = d.includes(cn), f = p ? ["image/*"] : d.filter(Dr), x = p ? [cn] : d.filter((R) => !Dr(R)), C = !!((y = (w = ($ = n == null ? void 0 : n.conversation) == null ? void 0 : $.input) == null ? void 0 : w.gallery) != null && y.photoEnabled), E = !!((B = (L = n == null ? void 0 : n.conversation) == null ? void 0 : L.input) != null && B.fileEnabled), h = () => p || f.length > 0, _ = () => p || x.length > 0, v = (R) => {
|
|
6592
6598
|
const T = R.currentTarget.files;
|
|
6593
6599
|
T && l(Array.from(T)), R.target.value = "";
|
|
6594
6600
|
}, I = () => {
|
|
@@ -6636,7 +6642,7 @@ const Qh = m(Bo)`flex-shrink:0;border-radius:8px;&:disabled{cursor:not-allowed;}
|
|
|
6636
6642
|
type: "file",
|
|
6637
6643
|
ref: R.inputRef,
|
|
6638
6644
|
multiple: R.type === "image",
|
|
6639
|
-
onChange:
|
|
6645
|
+
onChange: v,
|
|
6640
6646
|
accept: R.accept
|
|
6641
6647
|
}
|
|
6642
6648
|
)), /* @__PURE__ */ s.createElement(Ne, { visible: i, onClose: () => a(!1) }, A.map((R) => /* @__PURE__ */ s.createElement(Ne.ActionItem, { key: R.type, onClick: R.onSelect, icon: R.icon }, R.label)))) : null;
|
|
@@ -6672,10 +6678,10 @@ const Qh = m(Bo)`flex-shrink:0;border-radius:8px;&:disabled{cursor:not-allowed;}
|
|
|
6672
6678
|
if (w.length === 1)
|
|
6673
6679
|
await a.sendFileMessage({ message: $, file: w[0].file });
|
|
6674
6680
|
else {
|
|
6675
|
-
const
|
|
6676
|
-
await a.sendMultipleFilesMessage({ message: $, fileInfoList:
|
|
6681
|
+
const y = w.map(({ file: L }) => ({ file: L }));
|
|
6682
|
+
await a.sendMultipleFilesMessage({ message: $, fileInfoList: y });
|
|
6677
6683
|
}
|
|
6678
|
-
},
|
|
6684
|
+
}, v = ($) => {
|
|
6679
6685
|
const w = Array.from($.clipboardData.files);
|
|
6680
6686
|
w.length > 0 && ($.preventDefault(), d(w));
|
|
6681
6687
|
}, I = ($) => {
|
|
@@ -6698,7 +6704,7 @@ const Qh = m(Bo)`flex-shrink:0;border-radius:8px;&:disabled{cursor:not-allowed;}
|
|
|
6698
6704
|
maxLength: 5e3,
|
|
6699
6705
|
onKeyDown: I,
|
|
6700
6706
|
onChange: A,
|
|
6701
|
-
onPaste:
|
|
6707
|
+
onPaste: v
|
|
6702
6708
|
}
|
|
6703
6709
|
))), E && /* @__PURE__ */ s.createElement(Bo, { onClick: () => _() }, /* @__PURE__ */ s.createElement(G, { type: "send", color: g.color.primary.main, size: 20 })));
|
|
6704
6710
|
}, tg = m.div`padding:8px 16px;text-align:center;word-break:break-word;white-space:pre-wrap;line-height:1.43;letter-spacing:-0.2px;font-size:14px;font-weight:400;color:${g.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${U.light`
|
|
@@ -6745,7 +6751,7 @@ const Qh = m(Bo)`flex-shrink:0;border-radius:8px;&:disabled{cursor:not-allowed;}
|
|
|
6745
6751
|
onClick: () => e.setExpanded(!e.expanded)
|
|
6746
6752
|
}
|
|
6747
6753
|
) : null;
|
|
6748
|
-
}, _g = ({ label: e, children: t, position: n = "top", disabled: r }) => r ? t : /* @__PURE__ */ s.createElement(Cn, null, t, /* @__PURE__ */ s.createElement(xg, { $position: n }, /* @__PURE__ */ s.createElement(
|
|
6754
|
+
}, _g = ({ label: e, children: t, position: n = "top", disabled: r }) => r ? t : /* @__PURE__ */ s.createElement(Cn, null, t, /* @__PURE__ */ s.createElement(xg, { $position: n }, /* @__PURE__ */ s.createElement(vg, { variant: "caption1" }, e), /* @__PURE__ */ s.createElement(bg, { $position: n }))), bg = ({ $position: e }) => /* @__PURE__ */ s.createElement(
|
|
6749
6755
|
"svg",
|
|
6750
6756
|
{
|
|
6751
6757
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -6759,7 +6765,7 @@ const Qh = m(Bo)`flex-shrink:0;border-radius:8px;&:disabled{cursor:not-allowed;}
|
|
|
6759
6765
|
), Cg = {
|
|
6760
6766
|
top: O`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
6761
6767
|
bottom: O`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
6762
|
-
}, Cn = m.div`position:relative;`, xg = m.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${Ge.TOOLTIP};${({ $position: e }) => Cg[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${Cn}:hover &,${Cn}:focus-within &{opacity:1;}`,
|
|
6768
|
+
}, Cn = m.div`position:relative;`, xg = m.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${Ge.TOOLTIP};${({ $position: e }) => Cg[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${Cn}:hover &,${Cn}:focus-within &{opacity:1;}`, vg = m(k)`padding:6px 8px;background:${g.themedColor.textHighEmphasis};color:${g.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, yg = () => {
|
|
6763
6769
|
const { logger: e } = Q(), { stringSet: t } = Z(), { channelSource: n } = ae(), r = n.channel, o = Et(), i = Mn("handoff-button", r), a = !An(r) || He(r), l = async () => {
|
|
6764
6770
|
try {
|
|
6765
6771
|
const c = await (r == null ? void 0 : r.markConversationAsHandoff());
|
|
@@ -6815,7 +6821,7 @@ const Qh = m(Bo)`flex-shrink:0;border-radius:8px;&:disabled{cursor:not-allowed;}
|
|
|
6815
6821
|
EndArea: Lg,
|
|
6816
6822
|
MenuButton: Sg,
|
|
6817
6823
|
Title: Tg,
|
|
6818
|
-
HandoffButton:
|
|
6824
|
+
HandoffButton: yg,
|
|
6819
6825
|
ConversationCloseButton: fg,
|
|
6820
6826
|
ExpandButton: Eg,
|
|
6821
6827
|
CloseButton: pg
|
|
@@ -6884,7 +6890,7 @@ const Ug = ({ channel: e }) => /* @__PURE__ */ s.createElement(Ho, { channel: e
|
|
|
6884
6890
|
hoursAgo: r.DATE_FORMAT__HOURS_AGO,
|
|
6885
6891
|
dateShortFormat: r.DATE_FORMAT__DATE_SHORT
|
|
6886
6892
|
}), l = t.unreadMessageCount;
|
|
6887
|
-
return /* @__PURE__ */ s.createElement(Vg, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ s.createElement(zg, null, /* @__PURE__ */ s.createElement(Ug, { ...e })), /* @__PURE__ */ s.createElement(Gg, null, /* @__PURE__ */ s.createElement(Wg, null, (c = t.lastMessage) != null && c.isFileMessage() && (!t.lastMessage.message || t.lastMessage.name === t.lastMessage.message) ? /* @__PURE__ */ s.createElement(
|
|
6893
|
+
return /* @__PURE__ */ s.createElement(Vg, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ s.createElement(zg, null, /* @__PURE__ */ s.createElement(Ug, { ...e })), /* @__PURE__ */ s.createElement(Gg, null, /* @__PURE__ */ s.createElement(Wg, null, (c = t.lastMessage) != null && c.isFileMessage() && (!t.lastMessage.message || t.lastMessage.name === t.lastMessage.message) ? /* @__PURE__ */ s.createElement(vo, { variant: "subtitle1", color: g.themedColor.textHighEmphasis }, i) : /* @__PURE__ */ s.createElement(k, { variant: "subtitle1", color: g.themedColor.textHighEmphasis, maxTextLines: 1 }, i), /* @__PURE__ */ s.createElement(Kg, null, pe(t) && /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(k, { variant: "caption1", color: g.themedColor.textMidEmphasis, maxTextLines: 1 }, r.CONVERSATION_LIST__ENDED), /* @__PURE__ */ s.createElement(jg, null)), /* @__PURE__ */ s.createElement(k, { variant: "caption2", color: g.themedColor.textLowEmphasis, maxTextLines: 1 }, a))), l > 0 && /* @__PURE__ */ s.createElement(qg, { $count: l }, /* @__PURE__ */ s.createElement(k, { variant: "caption3", color: g.themedColor.textHighEmphasisInverse }, l <= xn ? l : `${xn}+`))));
|
|
6888
6894
|
}, zo = Ce({
|
|
6889
6895
|
template: Hg,
|
|
6890
6896
|
// Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
|
|
@@ -7102,8 +7108,8 @@ const Go = Qe(function({
|
|
|
7102
7108
|
o.body.classList.remove(i);
|
|
7103
7109
|
};
|
|
7104
7110
|
}, [o, t]), /* @__PURE__ */ s.createElement(Cp, { dir: n, $visible: t }, e);
|
|
7105
|
-
}, Cp = m.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${Ge.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, xp = 48,
|
|
7106
|
-
function
|
|
7111
|
+
}, Cp = m.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${Ge.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, xp = 48, vp = 2 / 3;
|
|
7112
|
+
function yp({
|
|
7107
7113
|
className: e,
|
|
7108
7114
|
isOpened: t,
|
|
7109
7115
|
onClick: n,
|
|
@@ -7114,7 +7120,7 @@ function vp({
|
|
|
7114
7120
|
backgroundColor: l,
|
|
7115
7121
|
size: c = xp
|
|
7116
7122
|
}) {
|
|
7117
|
-
const d = hn(l), u = Math.round(c *
|
|
7123
|
+
const d = hn(l), u = Math.round(c * vp);
|
|
7118
7124
|
return /* @__PURE__ */ s.createElement(
|
|
7119
7125
|
Tp,
|
|
7120
7126
|
{
|
|
@@ -7150,7 +7156,7 @@ function Yo({ className: e, size: t }) {
|
|
|
7150
7156
|
return re(() => {
|
|
7151
7157
|
a.initialRender.setPresentMethod("launcher_toggle");
|
|
7152
7158
|
}, [a]), $p(), /* @__PURE__ */ s.createElement(
|
|
7153
|
-
|
|
7159
|
+
yp,
|
|
7154
7160
|
{
|
|
7155
7161
|
dir: r,
|
|
7156
7162
|
className: e,
|
|
@@ -7212,15 +7218,15 @@ const Mp = Hr`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
|
|
|
7212
7218
|
`;
|
|
7213
7219
|
function $t({ initialId: e, children: t }) {
|
|
7214
7220
|
const [n, r] = S([e]), o = n[n.length - 1], i = z((h, _) => {
|
|
7215
|
-
r((
|
|
7216
|
-
...
|
|
7217
|
-
[h]: (
|
|
7218
|
-
})), x((
|
|
7219
|
-
...
|
|
7221
|
+
r((v) => [...v, h]), p((v) => ({ ...v, [h]: !0 })), _ != null && _.reset && E((v) => ({
|
|
7222
|
+
...v,
|
|
7223
|
+
[h]: (v[h] || 0) + 1
|
|
7224
|
+
})), x((v) => ({
|
|
7225
|
+
...v,
|
|
7220
7226
|
[h]: "entering"
|
|
7221
7227
|
})), setTimeout(() => {
|
|
7222
|
-
x((
|
|
7223
|
-
...
|
|
7228
|
+
x((v) => ({
|
|
7229
|
+
...v,
|
|
7224
7230
|
[h]: "entered"
|
|
7225
7231
|
}));
|
|
7226
7232
|
}, 300);
|
|
@@ -7228,14 +7234,14 @@ function $t({ initialId: e, children: t }) {
|
|
|
7228
7234
|
r((h) => {
|
|
7229
7235
|
if (h.length <= 1) return h;
|
|
7230
7236
|
const _ = h[h.length - 1];
|
|
7231
|
-
return x((
|
|
7232
|
-
...
|
|
7237
|
+
return x((v) => ({
|
|
7238
|
+
...v,
|
|
7233
7239
|
[_]: "exiting"
|
|
7234
7240
|
})), setTimeout(() => {
|
|
7235
|
-
x((
|
|
7236
|
-
...
|
|
7241
|
+
x((v) => ({
|
|
7242
|
+
...v,
|
|
7237
7243
|
[_]: "exited"
|
|
7238
|
-
})), r((
|
|
7244
|
+
})), r((v) => v.slice(0, -1));
|
|
7239
7245
|
}, 300), h;
|
|
7240
7246
|
});
|
|
7241
7247
|
}, []), l = ce(() => ({
|
|
@@ -7249,13 +7255,13 @@ function $t({ initialId: e, children: t }) {
|
|
|
7249
7255
|
), [t]), d = ce(() => {
|
|
7250
7256
|
const h = {};
|
|
7251
7257
|
return c.forEach((_) => {
|
|
7252
|
-
const { id:
|
|
7253
|
-
h[
|
|
7258
|
+
const { id: v, lazy: I, children: A } = _.props;
|
|
7259
|
+
h[v] = { lazy: I, element: typeof A == "function" ? A(l) : A };
|
|
7254
7260
|
}), h;
|
|
7255
7261
|
}, [c, l]), [u, p] = S(() => {
|
|
7256
7262
|
const h = {};
|
|
7257
|
-
return Object.entries(d).forEach(([_, { lazy:
|
|
7258
|
-
|
|
7263
|
+
return Object.entries(d).forEach(([_, { lazy: v }]) => {
|
|
7264
|
+
v === !1 && (h[_] = !0);
|
|
7259
7265
|
}), h[e] = !0, h;
|
|
7260
7266
|
}), [f, x] = S(() => {
|
|
7261
7267
|
const h = {};
|
|
@@ -7266,42 +7272,42 @@ function $t({ initialId: e, children: t }) {
|
|
|
7266
7272
|
return /* @__PURE__ */ s.createElement(Xo.Provider, { value: l }, /* @__PURE__ */ s.createElement(Pp, null, Object.keys(d).map((h) => {
|
|
7267
7273
|
var A;
|
|
7268
7274
|
if (!u[h]) return null;
|
|
7269
|
-
const _ = f[h] || "exited",
|
|
7270
|
-
return /* @__PURE__ */ s.createElement(Fp, { key: I, $transitionState: _, $active:
|
|
7275
|
+
const _ = f[h] || "exited", v = h === o, I = `${h}-${C[h] || 0}`;
|
|
7276
|
+
return /* @__PURE__ */ s.createElement(Fp, { key: I, $transitionState: _, $active: v }, (A = d[h]) == null ? void 0 : A.element);
|
|
7271
7277
|
})));
|
|
7272
7278
|
}
|
|
7273
7279
|
const Pp = m.div`position:relative;width:100%;height:100%;`;
|
|
7274
7280
|
$t.Screen = Jo;
|
|
7275
|
-
const
|
|
7281
|
+
const ye = {
|
|
7276
7282
|
conv: "conv",
|
|
7277
7283
|
convList: "conv-list"
|
|
7278
7284
|
}, Qo = ({ isOpened: e, entryPoint: t, selectedChannelUrl: n, setSelectedChannelUrl: r }) => {
|
|
7279
7285
|
const { conversationChildren: o, conversationListChildren: i } = Gn(), a = (() => {
|
|
7280
7286
|
switch (t) {
|
|
7281
7287
|
case "Conversation":
|
|
7282
|
-
return
|
|
7288
|
+
return ye.conv;
|
|
7283
7289
|
case "ConversationList":
|
|
7284
|
-
return
|
|
7290
|
+
return ye.convList;
|
|
7285
7291
|
default:
|
|
7286
|
-
return
|
|
7292
|
+
return ye.conv;
|
|
7287
7293
|
}
|
|
7288
7294
|
})(), l = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(Bp, { onOpenConversationView: r }));
|
|
7289
|
-
return /* @__PURE__ */ s.createElement($t, { initialId: a }, /* @__PURE__ */ s.createElement($t.Screen, { id:
|
|
7295
|
+
return /* @__PURE__ */ s.createElement($t, { initialId: a }, /* @__PURE__ */ s.createElement($t.Screen, { id: ye.conv }, ({ navigation: c, activeScreenId: d }) => /* @__PURE__ */ s.createElement(
|
|
7290
7296
|
Dg,
|
|
7291
7297
|
{
|
|
7292
7298
|
key: n,
|
|
7293
7299
|
channelUrl: n,
|
|
7294
7300
|
onClearChannelUrl: () => r(void 0),
|
|
7295
|
-
onNavigateToConversationList: () => c.navigate(
|
|
7296
|
-
shouldMarkAsRead: e && d ===
|
|
7301
|
+
onNavigateToConversationList: () => c.navigate(ye.convList),
|
|
7302
|
+
shouldMarkAsRead: e && d === ye.conv
|
|
7297
7303
|
},
|
|
7298
7304
|
l,
|
|
7299
7305
|
o
|
|
7300
|
-
)), /* @__PURE__ */ s.createElement($t.Screen, { id:
|
|
7306
|
+
)), /* @__PURE__ */ s.createElement($t.Screen, { id: ye.convList, lazy: !0 }, ({ navigation: c }) => /* @__PURE__ */ s.createElement(
|
|
7301
7307
|
cp,
|
|
7302
7308
|
{
|
|
7303
7309
|
onOpenConversationView: (d) => {
|
|
7304
|
-
r(d), c.navigate(
|
|
7310
|
+
r(d), c.navigate(ye.conv);
|
|
7305
7311
|
}
|
|
7306
7312
|
},
|
|
7307
7313
|
l,
|
|
@@ -7310,14 +7316,14 @@ const ve = {
|
|
|
7310
7316
|
}, Bp = ({ onOpenConversationView: e }) => {
|
|
7311
7317
|
const { registerOnJoinedProactiveConversation: t } = de(), { navigation: n } = Zo();
|
|
7312
7318
|
return t(({ channel: r }) => {
|
|
7313
|
-
e(r.url), n.navigate(
|
|
7319
|
+
e(r.url), n.navigate(ye.conv);
|
|
7314
7320
|
}), null;
|
|
7315
7321
|
};
|
|
7316
7322
|
function Up({ isExpanded: e, isOpened: t, children: n, launcher: r }) {
|
|
7317
7323
|
const { dir: o } = Q();
|
|
7318
7324
|
return /* @__PURE__ */ s.createElement(Hp, null, /* @__PURE__ */ s.createElement(Vp, { dir: o, id: fe.WINDOW, $isExpanded: e, $isOpened: t }, n), r);
|
|
7319
7325
|
}
|
|
7320
|
-
const Hp = m.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Vp = m.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && Gp};${({ $isExpanded: e }) => e && zp};`, zp = O`width:743px;height:723px;`, Gp = O`z-index:${Ge.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`,
|
|
7326
|
+
const Hp = m.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Vp = m.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && Gp};${({ $isExpanded: e }) => e && zp};`, zp = O`width:743px;height:723px;`, Gp = O`z-index:${Ge.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, vf = Qe(function({ children: e, initialChannelUrl: t, ...n }, r) {
|
|
7321
7327
|
const o = gt(), [i, a] = S(t), l = o ? Ko : Up;
|
|
7322
7328
|
return /* @__PURE__ */ s.createElement(Go, { enableExpandButton: !o, ref: r, ...n }, /* @__PURE__ */ s.createElement(fo, null, ({ state: c }) => /* @__PURE__ */ s.createElement(Wo, null, /* @__PURE__ */ s.createElement(l, { isExpanded: c.expanded, isOpened: c.opened, launcher: /* @__PURE__ */ s.createElement(Yo, null) }, /* @__PURE__ */ s.createElement(
|
|
7323
7329
|
Qo,
|
|
@@ -7422,7 +7428,7 @@ const Yp = m.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
7422
7428
|
}, tf = ({ children: e }) => {
|
|
7423
7429
|
const { setConversationListChildren: t } = Gn();
|
|
7424
7430
|
return re(() => (t(e), () => t(null)), [e]), null;
|
|
7425
|
-
},
|
|
7431
|
+
}, yf = Object.assign(Jp, {
|
|
7426
7432
|
Style: Qp,
|
|
7427
7433
|
ConversationChildren: ef,
|
|
7428
7434
|
ConversationListChildren: tf
|
|
@@ -7464,12 +7470,12 @@ export {
|
|
|
7464
7470
|
_t as ConversationListHeaderLayout,
|
|
7465
7471
|
zo as ConversationListItemLayout,
|
|
7466
7472
|
zn as ConversationListLayout,
|
|
7467
|
-
|
|
7473
|
+
vf as DefaultMessenger,
|
|
7468
7474
|
oo as DeskTicketPriority,
|
|
7469
7475
|
ro as DeskTicketStatus,
|
|
7470
|
-
|
|
7476
|
+
yf as FixedMessenger,
|
|
7471
7477
|
ze as IncomingMessageLayout,
|
|
7472
|
-
|
|
7478
|
+
yp as LauncherBase,
|
|
7473
7479
|
Jr as LogLevel,
|
|
7474
7480
|
ei as ManualSessionInfo,
|
|
7475
7481
|
Un as MessageListUILayout,
|