@sendbird/ai-agent-messenger-react 1.0.0 → 1.0.1
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/README.md +1 -1
- package/dist/cjs/{CxYRI5sv.cjs → BdjvmLrW.cjs} +1 -1
- package/dist/cjs/{Co3cu15V.cjs → Bjcpvx3H.cjs} +1 -1
- package/dist/cjs/{CIgdwS62.cjs → BvDZ14RA.cjs} +1 -1
- package/dist/cjs/{Coz01rE5.cjs → Bxg3i-bT.cjs} +1 -1
- package/dist/cjs/{CyJk4evk.cjs → Chlmg34O.cjs} +1 -1
- package/dist/cjs/DIiuihu-.cjs +140 -0
- package/dist/es/{DnKaqbmp.js → BadiWqxO.js} +1 -1
- package/dist/es/{DiXu6nm5.js → Cc9Mb_d1.js} +1 -1
- package/dist/es/{BuKsDakz.js → Cz-8n_J0.js} +1652 -1493
- package/dist/es/{DAMSBm7t.js → NuQQJV2A.js} +1 -1
- package/dist/es/{BLrqIqwk.js → ZtOVM8hp.js} +1 -1
- package/dist/es/{DfJKEre2.js → eeqIVbCW.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1 -1
- package/package.json +7 -7
- package/dist/cjs/jey3pckv.cjs +0 -140
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import * as n from "react";
|
|
2
|
-
import { createContext as _e, useContext as
|
|
3
|
-
import
|
|
4
|
-
import c, { css as k, ThemeProvider as
|
|
5
|
-
import { format as
|
|
6
|
-
import { enUS as
|
|
7
|
-
import { AIAgentModule as
|
|
8
|
-
import { renderer as
|
|
9
|
-
import { createMessageTemplate as
|
|
10
|
-
import { useGroupChannelMessages as
|
|
2
|
+
import { createContext as _e, useContext as te, useEffect as N, useState as y, useId as an, useRef as D, useCallback as F, Suspense as Ie, lazy as _, useMemo as ve, Component as ar, Fragment as At, useReducer as ir, useLayoutEffect as ye, forwardRef as sr, Children as lr } from "react";
|
|
3
|
+
import cr, { SendbirdProduct as dr, DeviceOsPlatform as It, SendbirdPlatform as ur, ConnectionHandler as ct, SendbirdError as mr, SessionHandler as pr, LogLevel as sn, ConnectionState as gr } from "@sendbird/chat";
|
|
4
|
+
import c, { css as k, ThemeProvider as hr, createGlobalStyle as fr, useTheme as dt, StyleSheetManager as br, keyframes as ln } from "styled-components";
|
|
5
|
+
import { format as We, isSameMinute as $t, isSameDay as Er } from "date-fns";
|
|
6
|
+
import { enUS as xr } from "date-fns/locale/en-US";
|
|
7
|
+
import { AIAgentModule as vr, ConversationStatus as z, ConversationListOrder as yr, ConversationType as Cr } from "@sendbird/chat/aiAgent";
|
|
8
|
+
import { renderer as _r, parser as Tr, MessageProvider as Sr } from "@sendbird/react-uikit-message-template-view";
|
|
9
|
+
import { createMessageTemplate as wr } from "@sendbird/uikit-message-template";
|
|
10
|
+
import { useGroupChannelMessages as kr, useForceUpdate as Ar, useGroupChannelHandler as cn } from "@sendbird/uikit-tools";
|
|
11
11
|
import dn from "dompurify";
|
|
12
|
-
import { GroupChannelModule as
|
|
13
|
-
import { MessageMetaArray as
|
|
14
|
-
import { isSameDay as
|
|
15
|
-
import { createPortal as
|
|
16
|
-
import
|
|
17
|
-
const
|
|
18
|
-
const r = _e(null), o = () => {
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
12
|
+
import { GroupChannelModule as Ir } from "@sendbird/chat/groupChannel";
|
|
13
|
+
import { MessageMetaArray as $r, SendingStatus as Mr } from "@sendbird/chat/message";
|
|
14
|
+
import { isSameDay as Or } from "date-fns/isSameDay";
|
|
15
|
+
import { createPortal as Rr } from "react-dom";
|
|
16
|
+
import Lr from "@emotion/is-prop-valid";
|
|
17
|
+
const j = (e, t) => {
|
|
18
|
+
const r = _e(null), o = ({ children: i, value: l }) => /* @__PURE__ */ n.createElement(r.Provider, { value: l }, typeof i == "function" ? i(l) : i), a = ({ children: i }) => /* @__PURE__ */ n.createElement(r.Consumer, null, (l) => l ? typeof i == "function" ? i(l) : i : null), s = () => {
|
|
19
|
+
const i = te(r);
|
|
20
|
+
if (!i)
|
|
21
21
|
throw new Error(`use${e}Context must be used within a ${e}Provider`);
|
|
22
|
-
return
|
|
22
|
+
return i;
|
|
23
23
|
};
|
|
24
|
-
return r.displayName = `${e}Context`, o.displayName = `use${e}Context`,
|
|
24
|
+
return r.displayName = `${e}Context`, o.displayName = `${e}Provider`, a.displayName = `${e}Consumer`, s.displayName = `use${e}Context`, { Context: r, Provider: o, Consumer: a, useContext: s };
|
|
25
25
|
};
|
|
26
|
-
function
|
|
26
|
+
function ut(e) {
|
|
27
27
|
const t = _e({
|
|
28
28
|
Template: e.template,
|
|
29
29
|
updateTemplate: () => {
|
|
@@ -33,54 +33,51 @@ function it(e) {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
function r({ children: s }) {
|
|
36
|
-
const [i, l] =
|
|
36
|
+
const [i, l] = y(() => e.template), [u, p] = y(e.components), m = {
|
|
37
37
|
Template: i,
|
|
38
|
-
updateTemplate: (
|
|
38
|
+
updateTemplate: (h) => l(() => h),
|
|
39
39
|
components: u,
|
|
40
|
-
updateComponent: (
|
|
40
|
+
updateComponent: (h, g) => p((b) => ({ ...b, [h]: g }))
|
|
41
41
|
};
|
|
42
|
-
return /* @__PURE__ */ n.createElement(t.Provider, { value:
|
|
42
|
+
return /* @__PURE__ */ n.createElement(t.Provider, { value: m }, s);
|
|
43
43
|
}
|
|
44
44
|
function o({ template: s, children: i }) {
|
|
45
|
-
const { updateTemplate: l } =
|
|
46
|
-
return
|
|
45
|
+
const { updateTemplate: l } = te(t);
|
|
46
|
+
return N(() => {
|
|
47
47
|
s && l(s);
|
|
48
48
|
}, [s]), /* @__PURE__ */ n.createElement(n.Fragment, null, i);
|
|
49
49
|
}
|
|
50
50
|
function a({ children: s }) {
|
|
51
51
|
return /* @__PURE__ */ n.createElement(r, null, s);
|
|
52
52
|
}
|
|
53
|
-
return a.defaults = e, a.useContext = () =>
|
|
53
|
+
return a.defaults = e, a.useContext = () => te(t), a.Context = t, a.Template = o, Object.keys(e.components).forEach((s) => {
|
|
54
54
|
a[s] = function({
|
|
55
55
|
component: l
|
|
56
56
|
}) {
|
|
57
|
-
const { updateComponent: u } =
|
|
58
|
-
return
|
|
57
|
+
const { updateComponent: u } = te(t);
|
|
58
|
+
return N(() => {
|
|
59
59
|
l && u(s, l);
|
|
60
60
|
}, [l]), null;
|
|
61
61
|
};
|
|
62
62
|
}), a;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Nr(...e) {
|
|
65
65
|
return function({ children: r }) {
|
|
66
66
|
return e.reduce((o, a) => /* @__PURE__ */ n.createElement(a, null, o), r);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function at() {
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Br() {
|
|
72
72
|
const e = /iPad|iPhone|iPod/.test(navigator.userAgent), t = /Android/.test(navigator.userAgent);
|
|
73
73
|
return e || t;
|
|
74
74
|
}
|
|
75
|
-
function Or(e) {
|
|
76
|
-
return JSON.parse(e);
|
|
77
|
-
}
|
|
78
75
|
class un {
|
|
79
76
|
constructor(t) {
|
|
80
77
|
this.logger = t, this.subscribers = {};
|
|
81
78
|
}
|
|
82
79
|
async send(t) {
|
|
83
|
-
const r =
|
|
80
|
+
const r = Dr(), o = this.subscribers[t.type];
|
|
84
81
|
if (o) {
|
|
85
82
|
this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`, t.payload);
|
|
86
83
|
const a = o.map((s) => s(t.payload));
|
|
@@ -97,12 +94,12 @@ class un {
|
|
|
97
94
|
this.subscribers[t] && (this.subscribers[t] = this.subscribers[t].filter((o) => o !== r));
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
|
-
const
|
|
101
|
-
let e =
|
|
97
|
+
const Dr = () => {
|
|
98
|
+
let e = at, t = at;
|
|
102
99
|
return { promise: new Promise((o, a) => {
|
|
103
100
|
e = o, t = a;
|
|
104
101
|
}), resolve: e, reject: t };
|
|
105
|
-
},
|
|
102
|
+
}, Pr = "1.0.1", ke = "sb-agent", Fr = Pr;
|
|
106
103
|
var mn = /* @__PURE__ */ ((e) => (e[e.VERBOSE = 0] = "VERBOSE", e[e.DEBUG = 1] = "DEBUG", e[e.INFO = 2] = "INFO", e[e.WARN = 3] = "WARN", e[e.ERROR = 4] = "ERROR", e[e.NONE = 5] = "NONE", e))(mn || {});
|
|
107
104
|
class pn {
|
|
108
105
|
constructor(t) {
|
|
@@ -125,20 +122,23 @@ class pn {
|
|
|
125
122
|
}
|
|
126
123
|
}
|
|
127
124
|
function Mt(e, t, r) {
|
|
128
|
-
const o =
|
|
125
|
+
const o = cr.init({
|
|
129
126
|
appId: e,
|
|
130
|
-
modules: [new
|
|
127
|
+
modules: [new Ir(), new vr()],
|
|
131
128
|
localCacheEnabled: !0,
|
|
132
129
|
...r
|
|
133
130
|
});
|
|
134
131
|
return o.addSendbirdExtensions(
|
|
135
|
-
[{ version:
|
|
132
|
+
[{ version: Fr, product: dr.AI_AGENT, platform: t.platform }],
|
|
136
133
|
{ platform: t.deviceOSPlatform, version: t.deviceOSVersion },
|
|
137
134
|
t.customData
|
|
138
135
|
) || console.warn("Invalid Sendbird Extensions", t), o;
|
|
139
136
|
}
|
|
140
|
-
const
|
|
141
|
-
|
|
137
|
+
const {
|
|
138
|
+
Provider: Ur,
|
|
139
|
+
useContext: Ze
|
|
140
|
+
} = j("AIAgent");
|
|
141
|
+
function Vr({
|
|
142
142
|
appId: e,
|
|
143
143
|
aiAgentId: t,
|
|
144
144
|
language: r,
|
|
@@ -148,57 +148,247 @@ function Pr({
|
|
|
148
148
|
chatParams: i,
|
|
149
149
|
dispatcher: l,
|
|
150
150
|
logger: u,
|
|
151
|
-
children:
|
|
152
|
-
extensions:
|
|
153
|
-
platform:
|
|
154
|
-
deviceOSPlatform:
|
|
151
|
+
children: p,
|
|
152
|
+
extensions: m = {
|
|
153
|
+
platform: ur.JS,
|
|
154
|
+
deviceOSPlatform: Br() ? It.MOBILE_WEB : It.WEB
|
|
155
155
|
}
|
|
156
156
|
}) {
|
|
157
|
-
const [
|
|
158
|
-
const
|
|
157
|
+
const [h, g] = y(() => {
|
|
158
|
+
const b = u ?? new pn(mn.WARN), E = l ?? new un(b);
|
|
159
159
|
return {
|
|
160
160
|
appId: e,
|
|
161
161
|
aiAgentId: t,
|
|
162
162
|
language: r,
|
|
163
163
|
countryCode: o,
|
|
164
164
|
context: a,
|
|
165
|
-
chatSDK: s ?? Mt(e,
|
|
166
|
-
logger:
|
|
165
|
+
chatSDK: s ?? Mt(e, m, i),
|
|
166
|
+
logger: b,
|
|
167
167
|
dispatcher: E
|
|
168
168
|
};
|
|
169
169
|
});
|
|
170
|
-
return (r !==
|
|
171
|
-
...
|
|
170
|
+
return (r !== h.language || o !== h.countryCode) && g((b) => ({ ...b, language: r, countryCode: o, context: a })), s && s !== h.chatSDK ? g((b) => ({ ...b, aiAgentId: t, chatSDK: s })) : !s && h.chatSDK.appId !== e && g((b) => ({
|
|
171
|
+
...b,
|
|
172
172
|
aiAgentId: t,
|
|
173
|
-
chatSDK: Mt(e,
|
|
174
|
-
})),
|
|
175
|
-
|
|
176
|
-
}, [
|
|
173
|
+
chatSDK: Mt(e, m, { newInstance: !0, ...i })
|
|
174
|
+
})), N(() => () => {
|
|
175
|
+
h.chatSDK.disconnectWebSocket();
|
|
176
|
+
}, [h.chatSDK]), /* @__PURE__ */ n.createElement(Ur, { value: h }, p);
|
|
177
|
+
}
|
|
178
|
+
const Hr = (e, t, r) => kr(e, t, { ...r, strictStreamingOrder: !0 });
|
|
179
|
+
var it = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))(it || {});
|
|
180
|
+
class zr {
|
|
181
|
+
constructor(t = {}) {
|
|
182
|
+
this.payload = t;
|
|
183
|
+
}
|
|
184
|
+
toJSON() {
|
|
185
|
+
return JSON.stringify({ type: this.type, payload: this.payload });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
class Wr extends zr {
|
|
189
|
+
constructor() {
|
|
190
|
+
super(...arguments), this.type = "conv.close";
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const Gr = {
|
|
194
|
+
CloseConversation: () => new Wr()
|
|
195
|
+
}, {
|
|
196
|
+
Provider: jr
|
|
197
|
+
} = j("AIAgentConversation");
|
|
198
|
+
function Kr({
|
|
199
|
+
children: e,
|
|
200
|
+
channelUrl: t,
|
|
201
|
+
onChannelDeleted: r,
|
|
202
|
+
onMessagesUpdated: o,
|
|
203
|
+
onConversationClosedViaDispatcher: a,
|
|
204
|
+
onBeforeSendMessage: s,
|
|
205
|
+
onAfterSendMessage: i = at
|
|
206
|
+
}) {
|
|
207
|
+
var x;
|
|
208
|
+
const { chatSDK: l, logger: u, dispatcher: p } = Ze(), { channel: m, channelFetchError: h, fetchChannel: g } = Zr(t), b = Hr(l, m, {
|
|
209
|
+
shouldCountNewMessages: () => !1,
|
|
210
|
+
onChannelDeleted: r,
|
|
211
|
+
onMessagesReceived: o,
|
|
212
|
+
onMessagesUpdated: o,
|
|
213
|
+
logger: u
|
|
214
|
+
});
|
|
215
|
+
N(() => {
|
|
216
|
+
const f = async () => {
|
|
217
|
+
u.debug("conversation.dispatcher: try to close conversation", m), m != null && m.conversation && m.conversation.status === z.OPEN && (await m.closeConversation(), a == null || a());
|
|
218
|
+
};
|
|
219
|
+
return p.subscribe(it.ConversationClose, f), () => {
|
|
220
|
+
p.unsubscribe(it.ConversationClose, f);
|
|
221
|
+
};
|
|
222
|
+
}, [p, (x = m == null ? void 0 : m.conversation) == null ? void 0 : x.status, a]);
|
|
223
|
+
const E = {
|
|
224
|
+
conversation: (m == null ? void 0 : m.conversation) ?? void 0,
|
|
225
|
+
channelSource: {
|
|
226
|
+
channel: m,
|
|
227
|
+
error: h,
|
|
228
|
+
refetch: () => g()
|
|
229
|
+
},
|
|
230
|
+
messageSource: {
|
|
231
|
+
messages: b.messages,
|
|
232
|
+
initialized: b.initialized,
|
|
233
|
+
loadPrevious: () => b.loadPrevious(),
|
|
234
|
+
loadNext: () => b.loadNext(),
|
|
235
|
+
sendUserMessage: async (f) => {
|
|
236
|
+
s && (f = await s(f));
|
|
237
|
+
const T = await b.sendUserMessage(f, i);
|
|
238
|
+
return i == null || i(T), T;
|
|
239
|
+
},
|
|
240
|
+
sendFileMessage: async (f) => {
|
|
241
|
+
s && (f = await s(f));
|
|
242
|
+
const T = await b.sendFileMessage(f, i);
|
|
243
|
+
return i == null || i(T), T;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
return /* @__PURE__ */ n.createElement(jr, { value: E }, e);
|
|
248
|
+
}
|
|
249
|
+
function Zr(e) {
|
|
250
|
+
const { chatSDK: t, logger: r } = Ze(), [o, a] = y(void 0), [s, i] = y(void 0);
|
|
251
|
+
async function l() {
|
|
252
|
+
if (r.debug("conversation.fetchChannel: start"), a(void 0), i(void 0), e)
|
|
253
|
+
try {
|
|
254
|
+
r.debug("conversation.fetchChannel: get channel", e);
|
|
255
|
+
const u = await t.groupChannel.getChannel(e);
|
|
256
|
+
a(u);
|
|
257
|
+
const p = new ct({ onReconnectSucceeded: () => u.refresh() });
|
|
258
|
+
t.addConnectionHandler("sba-refresh", p), r.debug("conversation.fetchChannel: fetched channel", u);
|
|
259
|
+
} catch (u) {
|
|
260
|
+
u instanceof mr && i(u), r.error("conversation.fetchChannel: error", u);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return N(() => {
|
|
264
|
+
l();
|
|
265
|
+
}, [e, t]), {
|
|
266
|
+
channel: o,
|
|
267
|
+
channelFetchError: s,
|
|
268
|
+
fetchChannel: l
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
const Yr = (e, t) => {
|
|
272
|
+
const r = an(), [o, a] = y(!1), [s, i] = y(null), [l, u] = y([]), [p, m] = y(null), h = D(!1), g = F(async () => {
|
|
273
|
+
if (!h.current && e.currentUser) {
|
|
274
|
+
h.current = !0, a(!1), i(null), u([]);
|
|
275
|
+
try {
|
|
276
|
+
const E = e.aiAgent.createConversationListQuery(t), x = await E.next();
|
|
277
|
+
u(x), m(E), i(null);
|
|
278
|
+
} catch (E) {
|
|
279
|
+
m(null), i(E);
|
|
280
|
+
} finally {
|
|
281
|
+
a(!0), h.current = !1;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}, [e, t.aiAgentId, t.status, t.limit, t.order, t.reverse]), b = F(async () => {
|
|
285
|
+
p && p.next().then((E) => {
|
|
286
|
+
u((x) => [...x, ...E]);
|
|
287
|
+
}).catch(() => {
|
|
288
|
+
});
|
|
289
|
+
}, [p]);
|
|
290
|
+
return N(() => (e.addConnectionHandler(r, new ct({ onConnected: () => g() })), () => e.removeConnectionHandler(r)), [e, r, g]), N(() => {
|
|
291
|
+
g();
|
|
292
|
+
}, [g]), {
|
|
293
|
+
initialized: o,
|
|
294
|
+
error: s,
|
|
295
|
+
conversations: l,
|
|
296
|
+
loadMore: b
|
|
297
|
+
};
|
|
298
|
+
}, {
|
|
299
|
+
Provider: qr
|
|
300
|
+
} = j("AIAgentConversationList");
|
|
301
|
+
function Jr({ children: e }) {
|
|
302
|
+
const { chatSDK: t, aiAgentId: r } = Ze(), o = Yr(t, {
|
|
303
|
+
aiAgentId: r,
|
|
304
|
+
status: z.CLOSED,
|
|
305
|
+
order: yr.UPDATED_AT,
|
|
306
|
+
reverse: !0
|
|
307
|
+
}), a = {
|
|
308
|
+
listSource: {
|
|
309
|
+
initialized: o.initialized,
|
|
310
|
+
error: o.error ?? void 0,
|
|
311
|
+
conversations: o.conversations,
|
|
312
|
+
loadMore: () => o.loadMore()
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
return /* @__PURE__ */ n.createElement(qr, { value: a }, e);
|
|
316
|
+
}
|
|
317
|
+
const gn = (e) => {
|
|
318
|
+
try {
|
|
319
|
+
const t = JSON.parse(e);
|
|
320
|
+
return typeof t == "string" ? JSON.stringify(t).slice(1, -1) : e.trim();
|
|
321
|
+
} catch {
|
|
322
|
+
return JSON.stringify(e).slice(1, -1);
|
|
323
|
+
}
|
|
324
|
+
}, Oe = (e) => JSON.parse(e), Ye = (e) => JSON.parse(e);
|
|
325
|
+
function Xr(e, t) {
|
|
326
|
+
const [r, o] = t.split(",").map((a) => a.trim());
|
|
327
|
+
return e === "dark" && o || r;
|
|
328
|
+
}
|
|
329
|
+
function Qr(e) {
|
|
330
|
+
const t = {};
|
|
331
|
+
function r(o, a = "") {
|
|
332
|
+
for (const [s, i] of Object.entries(o)) {
|
|
333
|
+
const l = a ? `${a}.${s}` : s;
|
|
334
|
+
i && typeof i == "object" && !Array.isArray(i) ? r(i, l) : t[l] = i;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return r(e), t;
|
|
338
|
+
}
|
|
339
|
+
function mt({
|
|
340
|
+
template: e,
|
|
341
|
+
variables: t,
|
|
342
|
+
variableKeyPattern: r,
|
|
343
|
+
variableValueTransformer: o
|
|
344
|
+
}) {
|
|
345
|
+
return Object.entries(t).reduce((a, [s, i]) => {
|
|
346
|
+
if (!o && !["number", "boolean", "string"].includes(typeof i))
|
|
347
|
+
throw new Error("If transformer is not provided, value must be a {string, number, or boolean}");
|
|
348
|
+
const l = o ? o(i) : String(i), u = r(s);
|
|
349
|
+
return a.replace(u, gn(l));
|
|
350
|
+
}, e);
|
|
351
|
+
}
|
|
352
|
+
async function eo({
|
|
353
|
+
template: e,
|
|
354
|
+
variables: t,
|
|
355
|
+
variableKeyPattern: r,
|
|
356
|
+
variableValueTransformer: o
|
|
357
|
+
}) {
|
|
358
|
+
return (await Promise.all(
|
|
359
|
+
Object.entries(t).map(async ([s, i]) => {
|
|
360
|
+
const l = await o(i);
|
|
361
|
+
return { regex: r(s), transformedValue: l };
|
|
362
|
+
})
|
|
363
|
+
)).reduce((s, { regex: i, transformedValue: l }) => s.replace(i, gn(l)), e);
|
|
177
364
|
}
|
|
178
|
-
const
|
|
365
|
+
const to = (e) => ({
|
|
179
366
|
setTemplate: (t, r) => e.onSetTemplate(t, r),
|
|
180
367
|
getTemplate: (t) => e.onGetTemplate(t),
|
|
181
368
|
setCachedToken: (t) => e.onSetCachedToken(t),
|
|
182
369
|
getCachedToken: () => e.onGetCachedToken(),
|
|
183
370
|
clear: () => e.onClear()
|
|
184
|
-
}),
|
|
185
|
-
|
|
186
|
-
|
|
371
|
+
}), {
|
|
372
|
+
Provider: no,
|
|
373
|
+
useContext: hn
|
|
374
|
+
} = j("MessageCacheTemplate");
|
|
375
|
+
function ro({ logger: e, storage: t, children: r }) {
|
|
376
|
+
const o = F(
|
|
187
377
|
(i) => {
|
|
188
|
-
var
|
|
189
|
-
const l = (
|
|
378
|
+
var p, m;
|
|
379
|
+
const l = (m = (p = i.appInfo) == null ? void 0 : p.aiAgentInfo) == null ? void 0 : m.templateListToken;
|
|
190
380
|
if (!l) return !1;
|
|
191
381
|
const u = t.getCachedToken();
|
|
192
382
|
return u ? l !== u : !0;
|
|
193
383
|
},
|
|
194
384
|
[t]
|
|
195
|
-
), a =
|
|
385
|
+
), a = F(
|
|
196
386
|
async (i) => {
|
|
197
387
|
try {
|
|
198
388
|
const { templates: l, token: u } = await i.aiAgent.getMessageTemplates({ limit: 20 });
|
|
199
|
-
for (const { template:
|
|
200
|
-
const { key:
|
|
201
|
-
t.setTemplate(
|
|
389
|
+
for (const { template: p } of l) {
|
|
390
|
+
const { key: m } = Oe(p);
|
|
391
|
+
t.setTemplate(m, p);
|
|
202
392
|
}
|
|
203
393
|
t.setCachedToken(u);
|
|
204
394
|
} catch (l) {
|
|
@@ -206,87 +396,255 @@ function Vr({ logger: e, storage: t, children: r }) {
|
|
|
206
396
|
}
|
|
207
397
|
},
|
|
208
398
|
[t, e]
|
|
209
|
-
), s =
|
|
399
|
+
), s = F(() => {
|
|
210
400
|
t.clear();
|
|
211
401
|
}, [t]);
|
|
212
|
-
return /* @__PURE__ */ n.createElement(
|
|
213
|
-
Ur.Provider,
|
|
214
|
-
{
|
|
215
|
-
value: {
|
|
216
|
-
shouldSyncCachedTemplate: o,
|
|
217
|
-
syncCachedTemplates: a,
|
|
218
|
-
clearCachedTemplates: s,
|
|
219
|
-
storage: t
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
r
|
|
223
|
-
);
|
|
402
|
+
return /* @__PURE__ */ n.createElement(no, { value: { shouldSyncCachedTemplate: o, syncCachedTemplates: a, clearCachedTemplates: s, storage: t } }, r);
|
|
224
403
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
p((E) => [...E, ...f]);
|
|
238
|
-
}).catch(() => {
|
|
239
|
-
});
|
|
240
|
-
}, [u]);
|
|
241
|
-
return P(() => {
|
|
242
|
-
o.current ? m(r()) : o.current = !0;
|
|
243
|
-
}, [e, t.status, t.aiAgentId, t.limit]), {
|
|
244
|
-
initialized: a,
|
|
245
|
-
error: i,
|
|
246
|
-
conversations: g,
|
|
247
|
-
loadMore: h
|
|
404
|
+
function oo(e) {
|
|
405
|
+
let t = "pending", r = e.then((o) => {
|
|
406
|
+
t = "resolved", r = o;
|
|
407
|
+
}).catch((o) => {
|
|
408
|
+
t = "rejected", r = o;
|
|
409
|
+
});
|
|
410
|
+
return {
|
|
411
|
+
get value() {
|
|
412
|
+
if (t === "resolved")
|
|
413
|
+
return r;
|
|
414
|
+
throw r;
|
|
415
|
+
}
|
|
248
416
|
};
|
|
417
|
+
}
|
|
418
|
+
const {
|
|
419
|
+
Provider: ao,
|
|
420
|
+
useContext: fn
|
|
421
|
+
} = j("MessageTemplateFetching");
|
|
422
|
+
function io({ children: e, internalVariables: t }) {
|
|
423
|
+
const r = D({}), o = D({}), [a, s] = y({}), i = F((p, m) => {
|
|
424
|
+
s((h) => ({
|
|
425
|
+
...h,
|
|
426
|
+
[p]: { fetching: !1, error: !1, ...h[p], ...m }
|
|
427
|
+
}));
|
|
428
|
+
}, []), l = F(
|
|
429
|
+
async ({
|
|
430
|
+
onRequestTemplate: p,
|
|
431
|
+
onGetCachedTemplate: m,
|
|
432
|
+
templateKey: h,
|
|
433
|
+
suspense: g = !1
|
|
434
|
+
}) => {
|
|
435
|
+
const b = m(h);
|
|
436
|
+
if (b) return b;
|
|
437
|
+
const E = o.current[h];
|
|
438
|
+
if (E) return E;
|
|
439
|
+
g || i(h, { fetching: !0 });
|
|
440
|
+
const x = p(h).catch((f) => {
|
|
441
|
+
throw g || i(h, { error: !0 }), f;
|
|
442
|
+
}).finally(() => {
|
|
443
|
+
g || i(h, { fetching: !1 }), delete o.current[h];
|
|
444
|
+
});
|
|
445
|
+
return o.current[h] = x, x;
|
|
446
|
+
},
|
|
447
|
+
[i]
|
|
448
|
+
), u = {
|
|
449
|
+
internalVariables: t,
|
|
450
|
+
fetchTemplate: l,
|
|
451
|
+
suspend: (p, m) => {
|
|
452
|
+
if (r.current[p])
|
|
453
|
+
return r.current[p];
|
|
454
|
+
const h = oo(m());
|
|
455
|
+
return r.current[p] = h, h;
|
|
456
|
+
},
|
|
457
|
+
getIsFetching: (p) => {
|
|
458
|
+
var m;
|
|
459
|
+
return ((m = a[p]) == null ? void 0 : m.fetching) ?? !1;
|
|
460
|
+
},
|
|
461
|
+
getHasError: (p) => {
|
|
462
|
+
var m;
|
|
463
|
+
return ((m = a[p]) == null ? void 0 : m.error) ?? !1;
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
return /* @__PURE__ */ n.createElement(ao, { value: u }, e);
|
|
467
|
+
}
|
|
468
|
+
const qe = {
|
|
469
|
+
VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
|
|
470
|
+
VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
|
|
249
471
|
};
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
472
|
+
function oe({ uiTemplateString: e, variables: t = {} }) {
|
|
473
|
+
const r = Qr(t);
|
|
474
|
+
return mt({
|
|
475
|
+
template: e,
|
|
476
|
+
variables: r,
|
|
477
|
+
variableKeyPattern: (o) => qe.VARIABLE(o)
|
|
478
|
+
});
|
|
258
479
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
480
|
+
function ae({
|
|
481
|
+
theme: e,
|
|
482
|
+
uiTemplateString: t,
|
|
483
|
+
colorVariables: r = {}
|
|
484
|
+
}) {
|
|
485
|
+
return mt({
|
|
486
|
+
template: t,
|
|
487
|
+
variables: r,
|
|
488
|
+
variableKeyPattern: (o) => qe.VARIABLE(o),
|
|
489
|
+
variableValueTransformer: (o) => Xr(e, o)
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function so({
|
|
493
|
+
theme: e,
|
|
494
|
+
uiTemplateString: t,
|
|
495
|
+
viewVariables: r = {},
|
|
496
|
+
aiAgentColorVariables: o,
|
|
497
|
+
internalVariables: a,
|
|
498
|
+
onRequestTemplate: s
|
|
499
|
+
}) {
|
|
500
|
+
const l = Object.values(r).flat().map((p) => p.key);
|
|
501
|
+
return [...new Set(l)].some((p) => !s(p)) ? null : mt({
|
|
502
|
+
template: t,
|
|
503
|
+
variables: r,
|
|
504
|
+
variableKeyPattern: (p) => qe.VIEW_VARIABLE(p),
|
|
505
|
+
variableValueTransformer: (p) => {
|
|
506
|
+
const m = p.map(({ key: h, variables: g }) => {
|
|
507
|
+
const b = s(h), { ui_template: E, color_variables: x } = Oe(b);
|
|
508
|
+
let f = JSON.stringify(E);
|
|
509
|
+
return f = oe({
|
|
510
|
+
uiTemplateString: f,
|
|
511
|
+
variables: a
|
|
512
|
+
}), f = ae({
|
|
513
|
+
theme: e,
|
|
514
|
+
uiTemplateString: f,
|
|
515
|
+
colorVariables: x
|
|
516
|
+
}), f = ae({
|
|
517
|
+
theme: e,
|
|
518
|
+
uiTemplateString: f,
|
|
519
|
+
colorVariables: o
|
|
520
|
+
}), f = oe({
|
|
521
|
+
uiTemplateString: f,
|
|
522
|
+
variables: g
|
|
523
|
+
}), Ye(f);
|
|
524
|
+
});
|
|
525
|
+
return JSON.stringify(m);
|
|
526
|
+
}
|
|
527
|
+
});
|
|
263
528
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
|
|
529
|
+
async function lo({
|
|
530
|
+
theme: e,
|
|
531
|
+
uiTemplateString: t,
|
|
532
|
+
viewVariables: r = {},
|
|
533
|
+
aiAgentColorVariables: o,
|
|
534
|
+
internalVariables: a,
|
|
535
|
+
onRequestTemplate: s
|
|
536
|
+
}) {
|
|
537
|
+
return eo({
|
|
538
|
+
template: t,
|
|
539
|
+
variables: r,
|
|
540
|
+
variableKeyPattern: (i) => qe.VIEW_VARIABLE(i),
|
|
541
|
+
variableValueTransformer: async (i) => {
|
|
542
|
+
const l = i.map(async ({ key: p, variables: m }) => {
|
|
543
|
+
const h = await s(p), { ui_template: g, color_variables: b } = Oe(h);
|
|
544
|
+
let E = JSON.stringify(g);
|
|
545
|
+
return E = oe({
|
|
546
|
+
uiTemplateString: E,
|
|
547
|
+
variables: a
|
|
548
|
+
}), E = ae({
|
|
549
|
+
theme: e,
|
|
550
|
+
uiTemplateString: E,
|
|
551
|
+
colorVariables: b
|
|
552
|
+
}), E = ae({
|
|
553
|
+
theme: e,
|
|
554
|
+
uiTemplateString: E,
|
|
555
|
+
colorVariables: o
|
|
556
|
+
}), E = oe({
|
|
557
|
+
uiTemplateString: E,
|
|
558
|
+
variables: m
|
|
559
|
+
}), Ye(E);
|
|
560
|
+
}), u = await Promise.all(l);
|
|
561
|
+
return JSON.stringify(u);
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
const co = ({
|
|
566
|
+
rawTemplate: e,
|
|
567
|
+
aiAgentColorVariables: t,
|
|
568
|
+
internalVariables: r,
|
|
569
|
+
...o
|
|
570
|
+
}) => {
|
|
571
|
+
const { ui_template: a, color_variables: s } = Oe(e);
|
|
572
|
+
let i = JSON.stringify(a);
|
|
573
|
+
if (Object.keys(o.viewVariables ?? {}).length > 0) {
|
|
574
|
+
const u = so({
|
|
575
|
+
...o,
|
|
576
|
+
uiTemplateString: i,
|
|
577
|
+
aiAgentColorVariables: t,
|
|
578
|
+
internalVariables: r
|
|
579
|
+
});
|
|
580
|
+
if (u === null) return null;
|
|
581
|
+
i = u;
|
|
582
|
+
}
|
|
583
|
+
return i = oe({ ...o, uiTemplateString: i, variables: r }), i = ae({ ...o, uiTemplateString: i, colorVariables: s }), i = ae({ ...o, uiTemplateString: i, colorVariables: t }), i = oe({ ...o, uiTemplateString: i }), Ye(i);
|
|
584
|
+
}, uo = async ({
|
|
585
|
+
rawTemplate: e,
|
|
586
|
+
aiAgentColorVariables: t,
|
|
587
|
+
internalVariables: r,
|
|
588
|
+
...o
|
|
589
|
+
}) => {
|
|
590
|
+
const { ui_template: a, color_variables: s } = Oe(e);
|
|
591
|
+
let i = JSON.stringify(a);
|
|
592
|
+
return Object.keys(o.viewVariables ?? {}).length > 0 && (i = await lo({
|
|
593
|
+
...o,
|
|
594
|
+
uiTemplateString: i,
|
|
595
|
+
aiAgentColorVariables: t,
|
|
596
|
+
internalVariables: r
|
|
597
|
+
})), i = oe({ ...o, uiTemplateString: i, variables: r }), i = ae({ ...o, uiTemplateString: i, colorVariables: s }), i = ae({ ...o, uiTemplateString: i, colorVariables: t }), i = oe({ ...o, uiTemplateString: i }), Ye(i);
|
|
598
|
+
}, mo = (e) => {
|
|
599
|
+
const { aiAgentColorVariables: t = {} } = e, { internalVariables: r } = fn();
|
|
600
|
+
return y(() => {
|
|
601
|
+
const o = e.onGetCachedTemplate(e.templateKey);
|
|
602
|
+
return o ? co({
|
|
603
|
+
...e,
|
|
604
|
+
rawTemplate: o,
|
|
605
|
+
aiAgentColorVariables: t,
|
|
606
|
+
internalVariables: r,
|
|
607
|
+
onRequestTemplate: e.onGetCachedTemplate
|
|
608
|
+
}) : null;
|
|
609
|
+
});
|
|
610
|
+
}, po = (e) => {
|
|
611
|
+
const [t] = mo(e);
|
|
612
|
+
if (t) return t;
|
|
613
|
+
const { aiAgentColorVariables: r = {} } = e, { internalVariables: o, fetchTemplate: a, suspend: s } = fn();
|
|
614
|
+
return s(e.templateKey, async () => {
|
|
615
|
+
const l = await a({ ...e, suspense: !0 });
|
|
616
|
+
return await uo({
|
|
617
|
+
...e,
|
|
618
|
+
rawTemplate: l,
|
|
619
|
+
aiAgentColorVariables: r,
|
|
620
|
+
internalVariables: o
|
|
621
|
+
});
|
|
622
|
+
}).value;
|
|
623
|
+
}, go = '@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}', Y = "sb-agent", ne = {
|
|
624
|
+
ENTRY: `${Y}-entry`,
|
|
625
|
+
MODAL_ROOT: `${Y}-modal-root`,
|
|
626
|
+
WINDOW: `${Y}-window`,
|
|
627
|
+
LAUNCHER: `${Y}-launcher`
|
|
628
|
+
}, De = 2147483647, ge = {
|
|
629
|
+
MODAL: De - 1,
|
|
273
630
|
// FIXME: need to cover the case where the tooltip is on the top of the modal
|
|
274
|
-
TOOLTIP:
|
|
275
|
-
WINDOW:
|
|
276
|
-
LAUNCHER:
|
|
277
|
-
},
|
|
278
|
-
SESSION: `@${
|
|
279
|
-
|
|
631
|
+
TOOLTIP: De - 2,
|
|
632
|
+
WINDOW: De - 3,
|
|
633
|
+
LAUNCHER: De - 4
|
|
634
|
+
}, bn = {
|
|
635
|
+
SESSION: `@${Y}-session`,
|
|
636
|
+
USER_DATA: `@${Y}-udata`
|
|
637
|
+
}, de = {
|
|
280
638
|
DEFAULT_PRIMARY: "#742ddd",
|
|
281
639
|
DEFAULT_BOT_MSG_BG: "#eeeeee",
|
|
282
640
|
WHITE: "#ffffff",
|
|
283
641
|
BLACK: "#000000"
|
|
284
|
-
},
|
|
285
|
-
function
|
|
642
|
+
}, En = 36, ho = 100, fo = 25 * 1024 * 1024, xn = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], pt = "noopener noreferrer nofollow";
|
|
643
|
+
function vn(e) {
|
|
286
644
|
return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
|
|
287
645
|
}
|
|
288
|
-
function
|
|
289
|
-
const t =
|
|
646
|
+
function bo(e) {
|
|
647
|
+
const t = vn(e);
|
|
290
648
|
return [
|
|
291
649
|
parseInt(t.slice(1, 3), 16),
|
|
292
650
|
// r
|
|
@@ -296,54 +654,54 @@ function qr(e) {
|
|
|
296
654
|
// b
|
|
297
655
|
];
|
|
298
656
|
}
|
|
299
|
-
function
|
|
657
|
+
function Eo(e) {
|
|
300
658
|
return `#${e.map((t) => t.toString(16).padStart(2, "0")).join("")}`;
|
|
301
659
|
}
|
|
302
|
-
function
|
|
660
|
+
function xo(e, t, r) {
|
|
303
661
|
e /= 255, t /= 255, r /= 255;
|
|
304
662
|
const o = Math.max(e, t, r), a = Math.min(e, t, r), s = o - a;
|
|
305
663
|
let i = 0, l = 0;
|
|
306
664
|
const u = (o + a) / 2;
|
|
307
665
|
return o !== a && (l = u > 0.5 ? s / (2 - o - a) : s / (o + a)), o === e ? i = (t - r) / s + (t < r ? 6 : 0) : o === t ? i = (r - e) / s + 2 : o === r && (i = (e - t) / s + 4), i /= 6, [i, l, u];
|
|
308
666
|
}
|
|
309
|
-
function
|
|
667
|
+
function vo(e, t, r) {
|
|
310
668
|
let o, a, s;
|
|
311
669
|
if (t === 0)
|
|
312
670
|
o = a = s = r;
|
|
313
671
|
else {
|
|
314
|
-
const i = function(
|
|
315
|
-
return
|
|
672
|
+
const i = function(m, h, g) {
|
|
673
|
+
return g < 0 && (g += 1), g > 1 && (g -= 1), g < 0.16666666666666666 ? m + (h - m) * 6 * g : g < 0.5 ? h : g < 0.6666666666666666 ? m + (h - m) * (0.6666666666666666 - g) * 6 : m;
|
|
316
674
|
}, l = r < 0.5 ? r * (1 + t) : r + t - r * t, u = 2 * r - l;
|
|
317
675
|
o = i(u, l, e + 1 / 3), a = i(u, l, e), s = i(u, l, e - 1 / 3);
|
|
318
676
|
}
|
|
319
677
|
return [Math.round(o * 255), Math.round(a * 255), Math.round(s * 255)];
|
|
320
678
|
}
|
|
321
|
-
function
|
|
322
|
-
const [o, a, s] =
|
|
323
|
-
return
|
|
679
|
+
function Pe(e, t, r) {
|
|
680
|
+
const [o, a, s] = bo(e), [i, l, u] = xo(o, a, s), p = Math.max(0, Math.min(1, u * t)), m = Math.max(0, Math.min(1, l * r)), [h, g, b] = vo(i, m, p);
|
|
681
|
+
return Eo([Math.round(h), Math.round(g), Math.round(b)]);
|
|
324
682
|
}
|
|
325
|
-
function
|
|
326
|
-
return e ===
|
|
327
|
-
extraDark:
|
|
328
|
-
dark:
|
|
683
|
+
function yo(e, t = "light") {
|
|
684
|
+
return e === de.DEFAULT_PRIMARY ? { extraDark: "#491389", dark: "#6211c8", main: "#742ddd", light: "#c2a9fa", extraLight: "#dbd1ff" } : {
|
|
685
|
+
extraDark: Pe(e, 0.6, 1.2),
|
|
686
|
+
dark: Pe(e, 0.85, 1.1),
|
|
329
687
|
main: e,
|
|
330
|
-
light:
|
|
331
|
-
extraLight:
|
|
688
|
+
light: Pe(e, t === "dark" ? 1.1 : 1.5, t === "dark" ? 0.95 : 0.9),
|
|
689
|
+
extraLight: Pe(e, t === "dark" ? 1.2 : 1.75, t === "dark" ? 0.9 : 0.8)
|
|
332
690
|
};
|
|
333
691
|
}
|
|
334
|
-
function
|
|
335
|
-
const t =
|
|
336
|
-
return o * 0.299 + a * 0.587 + s * 0.114 > r ?
|
|
692
|
+
function Ge(e) {
|
|
693
|
+
const t = vn(e), r = 149, o = +`0x${t[1]}${t[2]}`, a = +`0x${t[3]}${t[4]}`, s = +`0x${t[5]}${t[6]}`;
|
|
694
|
+
return o * 0.299 + a * 0.587 + s * 0.114 > r ? de.BLACK : de.WHITE;
|
|
337
695
|
}
|
|
338
|
-
const
|
|
696
|
+
const $e = "data-sb-agent-theme", Ot = (e) => (t, ...r) => {
|
|
339
697
|
let o = "";
|
|
340
698
|
return t.forEach((a, s) => {
|
|
341
699
|
o += a + (r[s] ?? "");
|
|
342
|
-
}), `[${
|
|
343
|
-
},
|
|
344
|
-
light:
|
|
345
|
-
dark:
|
|
346
|
-
},
|
|
700
|
+
}), `[${$e}='${e}'] & { ${o} }`;
|
|
701
|
+
}, U = {
|
|
702
|
+
light: Ot("light"),
|
|
703
|
+
dark: Ot("dark")
|
|
704
|
+
}, Co = k`:root,:host{--sendbird-primary-extra-dark:${(e) => e.theme.palette.primary.extraDark};--sendbird-primary-dark:${(e) => e.theme.palette.primary.dark};--sendbird-primary-main:${(e) => e.theme.palette.primary.main};--sendbird-primary-light:${(e) => e.theme.palette.primary.light};--sendbird-primary-extra-light:${(e) => e.theme.palette.primary.extraLight};--sendbird-secondary-extra-dark:#066858;--sendbird-secondary-dark:#027d69;--sendbird-secondary-main:#259c72;--sendbird-secondary-light:#69c085;--sendbird-secondary-extra-light:#a8e2ab;--sendbird-information-extra-dark:#241389;--sendbird-information-dark:#362ca9;--sendbird-information-main:#4a48cd;--sendbird-information-light:#a9bbfa;--sendbird-information-extra-light:#d1dbff;--sendbird-highlight-100:#fff2b6;--sendbird-error-extra-dark:#9d091e;--sendbird-error-dark:#bf0711;--sendbird-error-main:#de360b;--sendbird-error-light:#f66161;--sendbird-error-extra-light:#fdaaaa;--sendbird-background-700:#000000;--sendbird-background-600:#161616;--sendbird-background-500:#2c2c2c;--sendbird-background-400:#393939;--sendbird-background-300:#bdbdbd;--sendbird-background-200:#e0e0e0;--sendbird-background-100:#eeeeee;--sendbird-background-50:#ffffff;--sendbird-onlight-01:rgba(0,0,0,0.88);--sendbird-onlight-02:rgba(0,0,0,0.5);--sendbird-onlight-03:rgba(0,0,0,0.38);--sendbird-onlight-04:rgba(0,0,0,0.12);--sendbird-ondark-01:rgba(255,255,255,0.88);--sendbird-ondark-02:rgba(255,255,255,0.5);--sendbird-ondark-03:rgba(255,255,255,0.38);--sendbird-ondark-04:rgba(255,255,255,0.12);--sendbird-overlay-01:rgba(0,0,0,0.55);--sendbird-overlay-02:rgba(0,0,0,0.32);--sendbird-shadow-01:0 1px 5px 0 rgba(33,34,66,0.04),0 0 3px 0 rgba(0,0,0,0.08),0 2px 1px 0 rgba(0,0,0,0.12);--sendbird-shadow-02:0 3px 5px -3px rgba(33,34,66,0.04),0 3px 14px 2px rgba(0,0,0,0.08),0 8px 10px 1px rgba(0,0,0,0.12);--sendbird-shadow-03:0 6px 10px -5px rgba(0,0,0,0.04),0 6px 30px 5px rgba(0,0,0,0.08),0 16px 24px 2px rgba(0,0,0,0.12);--sendbird-shadow-04:0 9px 15px -7px rgba(0,0,0,0.04),0 9px 46px 8px rgba(0,0,0,0.08),0 24px 38px 3px rgba(0,0,0,0.12);--sendbird-shadow-05:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);--sendbird-shadow-message-input:0 1px 5px 0 rgba(33,34,66,0.12),0 0 1px 0 rgba(33,34,66,0.16),0 2px 1px 0 rgba(33,34,66,0.08),0 1px 5px 0 rgba(0,0,0,0.12);}`, _o = k`[${$e}='light'] &{--sb-on-bg-1:var(--sendbird-onlight-01);--sb-on-bg-2:var(--sendbird-onlight-02);--sb-on-bg-3:var(--sendbird-onlight-03);--sb-on-bg-4:var(--sendbird-onlight-04);--sb-bg-1:var(--sendbird-background-50);--sb-bg-2:var(--sendbird-background-100);--sb-bg-3:var(--sendbird-background-200);--sb-on-content-1:var(--sendbird-ondark-01);--sb-on-content-2:var(--sendbird-ondark-02);--sb-on-content-inverse-1:var(--sendbird-onlight-01);--sb-on-content-inverse-2:var(--sendbird-onlight-02);--sb-primary:var(--sendbird-primary-main);--sb-secondary:var(--sendbird-secondary-main);--sb-error:var(--sendbird-error-main);--sb-information:var(--sendbird-information-light);}[${$e}='dark'] &{--sb-on-bg-1:var(--sendbird-ondark-01);--sb-on-bg-2:var(--sendbird-ondark-02);--sb-on-bg-3:var(--sendbird-ondark-03);--sb-on-bg-4:var(--sendbird-ondark-04);--sb-bg-1:var(--sendbird-background-600);--sb-bg-2:var(--sendbird-background-500);--sb-bg-3:var(--sendbird-background-400);--sb-on-content-1:var(--sendbird-onlight-01);--sb-on-content-2:var(--sendbird-onlight-02);--sb-on-content-inverse-1:var(--sendbird-ondark-01);--sb-on-content-inverse-2:var(--sendbird-ondark-02);--sb-primary:var(--sendbird-primary-light);--sb-secondary:var(--sendbird-secondary-light);--sb-error:var(--sendbird-error-light);--sb-information:var(--sendbird-information-light);}`, d = {
|
|
347
705
|
color: {
|
|
348
706
|
primary: {
|
|
349
707
|
dark: "var(--sendbird-primary-dark)",
|
|
@@ -393,23 +751,23 @@ const Ie = "data-sb-agent-theme", $t = (e) => (t, ...r) => {
|
|
|
393
751
|
error: "var(--sb-error)"
|
|
394
752
|
}
|
|
395
753
|
};
|
|
396
|
-
function
|
|
754
|
+
function Rt(e = "light", t) {
|
|
397
755
|
const r = {
|
|
398
|
-
primary: (t == null ? void 0 : t.primary) ||
|
|
399
|
-
botMessageBackground: (t == null ? void 0 : t.botMessageBackground) ||
|
|
756
|
+
primary: (t == null ? void 0 : t.primary) || de.DEFAULT_PRIMARY,
|
|
757
|
+
botMessageBackground: (t == null ? void 0 : t.botMessageBackground) || de.DEFAULT_BOT_MSG_BG,
|
|
400
758
|
primaryContrast: t == null ? void 0 : t.primaryContrast,
|
|
401
759
|
botMessageBackgroundContrast: t == null ? void 0 : t.botMessageBackgroundContrast
|
|
402
|
-
}, { contrastColors: o, aiAgentColorVariables: a } =
|
|
760
|
+
}, { contrastColors: o, aiAgentColorVariables: a } = wo(r), i = (e === "light" ? To : So)(r, o);
|
|
403
761
|
return {
|
|
404
762
|
selected: e,
|
|
405
763
|
palette: {
|
|
406
|
-
primary:
|
|
764
|
+
primary: yo(r.primary)
|
|
407
765
|
},
|
|
408
766
|
colors: i,
|
|
409
767
|
aiAgentColorVariables: a
|
|
410
768
|
};
|
|
411
769
|
}
|
|
412
|
-
const
|
|
770
|
+
const To = (e, t) => ({
|
|
413
771
|
base: {
|
|
414
772
|
primary: e.primary,
|
|
415
773
|
primaryContrastContent: t.primary,
|
|
@@ -435,7 +793,7 @@ const ro = (e, t) => ({
|
|
|
435
793
|
csat: {
|
|
436
794
|
background: d.color.background100
|
|
437
795
|
}
|
|
438
|
-
}),
|
|
796
|
+
}), So = (e, t) => ({
|
|
439
797
|
base: {
|
|
440
798
|
primary: e.primary,
|
|
441
799
|
primaryContrastContent: t.primary,
|
|
@@ -462,10 +820,10 @@ const ro = (e, t) => ({
|
|
|
462
820
|
background: d.color.background400
|
|
463
821
|
}
|
|
464
822
|
});
|
|
465
|
-
function
|
|
823
|
+
function wo(e) {
|
|
466
824
|
const t = {
|
|
467
|
-
primary: e.primaryContrast ??
|
|
468
|
-
botMessageBackground: e.botMessageBackgroundContrast ??
|
|
825
|
+
primary: e.primaryContrast ?? Ge(e.primary),
|
|
826
|
+
botMessageBackground: e.botMessageBackgroundContrast ?? Ge(e.botMessageBackground)
|
|
469
827
|
};
|
|
470
828
|
return {
|
|
471
829
|
contrastColors: t,
|
|
@@ -477,34 +835,37 @@ function ao(e) {
|
|
|
477
835
|
}
|
|
478
836
|
};
|
|
479
837
|
}
|
|
480
|
-
const
|
|
481
|
-
|
|
838
|
+
const {
|
|
839
|
+
Provider: ko,
|
|
840
|
+
useContext: yn
|
|
841
|
+
} = j("AgentTheme");
|
|
842
|
+
function Ao({
|
|
482
843
|
appearance: e,
|
|
483
844
|
rootElement: t = document.body,
|
|
484
845
|
logger: r,
|
|
485
846
|
children: o
|
|
486
847
|
}) {
|
|
487
|
-
const a = e == null ? void 0 : e.theme, s = e == null ? void 0 : e.primaryColor, i = e == null ? void 0 : e.botMessageBackgroundColor, [l, u] =
|
|
848
|
+
const a = e == null ? void 0 : e.theme, s = e == null ? void 0 : e.primaryColor, i = e == null ? void 0 : e.botMessageBackgroundColor, [l, u] = y(() => (t.setAttribute($e, a ?? "light"), Rt(a, {
|
|
488
849
|
primary: s,
|
|
489
850
|
botMessageBackground: i
|
|
490
|
-
}))),
|
|
491
|
-
(
|
|
492
|
-
const
|
|
493
|
-
primary: s ?? (
|
|
494
|
-
botMessageBackground: i ?? (
|
|
495
|
-
primaryContrast:
|
|
496
|
-
botMessageBackgroundContrast:
|
|
851
|
+
}))), p = F(
|
|
852
|
+
(m, h) => {
|
|
853
|
+
const g = h == null ? void 0 : h(a), b = a ?? m, E = {
|
|
854
|
+
primary: s ?? (g == null ? void 0 : g.primary),
|
|
855
|
+
botMessageBackground: i ?? (g == null ? void 0 : g.botMessageBackground),
|
|
856
|
+
primaryContrast: g == null ? void 0 : g.primaryContrast,
|
|
857
|
+
botMessageBackgroundContrast: g == null ? void 0 : g.botMessageBackgroundContrast
|
|
497
858
|
};
|
|
498
|
-
s && delete E.primaryContrast, i && delete E.botMessageBackgroundContrast, t.setAttribute(
|
|
859
|
+
s && delete E.primaryContrast, i && delete E.botMessageBackgroundContrast, t.setAttribute($e, b), u(Rt(b, E)), r == null || r.info("theme.update:", b, E);
|
|
499
860
|
},
|
|
500
861
|
[t, a, s, i]
|
|
501
862
|
);
|
|
502
|
-
return
|
|
503
|
-
(a || s || i) &&
|
|
504
|
-
}, [a, s, i]), /* @__PURE__ */ n.createElement(
|
|
863
|
+
return N(() => {
|
|
864
|
+
(a || s || i) && p(l.selected);
|
|
865
|
+
}, [a, s, i]), /* @__PURE__ */ n.createElement(hr, { theme: l }, /* @__PURE__ */ n.createElement(ko, { value: { theme: l, updateTheme: p } }, o));
|
|
505
866
|
}
|
|
506
|
-
const
|
|
507
|
-
|
|
867
|
+
const Re = "en", Io = /* @__PURE__ */ new Set([
|
|
868
|
+
Re,
|
|
508
869
|
"ko",
|
|
509
870
|
"es",
|
|
510
871
|
"pt",
|
|
@@ -514,7 +875,7 @@ const $e = "en", lo = /* @__PURE__ */ new Set([
|
|
|
514
875
|
"de",
|
|
515
876
|
"tr",
|
|
516
877
|
"ja"
|
|
517
|
-
]),
|
|
878
|
+
]), $o = (e, t, r) => {
|
|
518
879
|
const o = e[t];
|
|
519
880
|
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((a, s) => {
|
|
520
881
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
@@ -526,7 +887,7 @@ const $e = "en", lo = /* @__PURE__ */ new Set([
|
|
|
526
887
|
)
|
|
527
888
|
);
|
|
528
889
|
});
|
|
529
|
-
},
|
|
890
|
+
}, Mo = xr, Oo = {
|
|
530
891
|
// Channel - Common
|
|
531
892
|
CHANNEL_FROZEN: "Channel frozen",
|
|
532
893
|
PLACE_HOLDER__WRONG: "Something went wrong",
|
|
@@ -577,153 +938,83 @@ const $e = "en", lo = /* @__PURE__ */ new Set([
|
|
|
577
938
|
CONVERSATION_LIST__NO_CONVERSATIONS: "No conversations yet",
|
|
578
939
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: "MM/dd/yyyy",
|
|
579
940
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma"
|
|
580
|
-
},
|
|
941
|
+
}, gt = { language: "en", dateLocale: Mo, stringSet: Oo }, Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
581
942
|
__proto__: null,
|
|
582
|
-
default:
|
|
583
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
584
|
-
async function
|
|
585
|
-
if (
|
|
586
|
-
return
|
|
587
|
-
const t =
|
|
943
|
+
default: gt
|
|
944
|
+
}, Symbol.toStringTag, { value: "Module" })), ze = /* @__PURE__ */ new Map([[Re, gt]]);
|
|
945
|
+
async function Lo(e) {
|
|
946
|
+
if (ze.has(e))
|
|
947
|
+
return ze.get(e);
|
|
948
|
+
const t = Io.has(e) ? e : Re;
|
|
588
949
|
try {
|
|
589
|
-
const { default: r } = await
|
|
590
|
-
return
|
|
950
|
+
const { default: r } = await $o(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DvjrAXLD.js"), "./languages/en.ts": () => Promise.resolve().then(() => Ro), "./languages/es.ts": () => import("./zI14HLvP.js"), "./languages/fr.ts": () => import("./B9V0T5ZP.js"), "./languages/hi.ts": () => import("./YRQ0vk5Q.js"), "./languages/it.ts": () => import("./BQWJPfGp.js"), "./languages/ja.ts": () => import("./sl-YrKkN.js"), "./languages/ko.ts": () => import("./B8c_rqvH.js"), "./languages/pt.ts": () => import("./BSz49qaD.js"), "./languages/tr.ts": () => import("./D_eZyIAR.js") }), `./languages/${t}.ts`, 3);
|
|
951
|
+
return ze.set(e, r), r;
|
|
591
952
|
} catch {
|
|
592
|
-
return
|
|
953
|
+
return gt;
|
|
593
954
|
}
|
|
594
955
|
}
|
|
595
|
-
const
|
|
596
|
-
|
|
956
|
+
const {
|
|
957
|
+
Provider: No,
|
|
958
|
+
useContext: M
|
|
959
|
+
} = j("Localization");
|
|
960
|
+
function Bo(e) {
|
|
597
961
|
var t;
|
|
598
|
-
return ((t = e.split("-")) == null ? void 0 : t[0]) ??
|
|
962
|
+
return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Re;
|
|
599
963
|
}
|
|
600
|
-
function
|
|
964
|
+
function Do({
|
|
601
965
|
language: e = navigator.language,
|
|
602
966
|
logger: t,
|
|
603
967
|
stringSet: r,
|
|
604
968
|
children: o
|
|
605
969
|
}) {
|
|
606
|
-
const [a, s] =
|
|
607
|
-
return
|
|
608
|
-
const i =
|
|
609
|
-
a.language !== i && (t == null || t.debug("localization.useEffect: update language", `${a.language} -> ${i}`),
|
|
970
|
+
const [a, s] = y(ze.get(Re));
|
|
971
|
+
return N(() => {
|
|
972
|
+
const i = Bo(e);
|
|
973
|
+
a.language !== i && (t == null || t.debug("localization.useEffect: update language", `${a.language} -> ${i}`), Lo(i).then(s));
|
|
610
974
|
}, [e]), /* @__PURE__ */ n.createElement(
|
|
611
|
-
|
|
975
|
+
No,
|
|
612
976
|
{
|
|
613
977
|
value: {
|
|
614
978
|
language: a.language,
|
|
615
979
|
stringSet: { ...a.stringSet, ...r },
|
|
616
980
|
dateLocale: a.dateLocale,
|
|
617
|
-
format: (i, l, u) =>
|
|
981
|
+
format: (i, l, u) => We(i, l, { locale: a.dateLocale, ...u })
|
|
618
982
|
}
|
|
619
983
|
},
|
|
620
984
|
o
|
|
621
985
|
);
|
|
622
986
|
}
|
|
623
|
-
|
|
624
|
-
function pe(e, t) {
|
|
987
|
+
function ue(e, t) {
|
|
625
988
|
const r = e.getRootNode({ composed: t });
|
|
626
989
|
return r instanceof ShadowRoot || r instanceof Document ? r : document;
|
|
627
990
|
}
|
|
628
|
-
const
|
|
629
|
-
|
|
630
|
-
const r =
|
|
991
|
+
const Po = (e, t) => {
|
|
992
|
+
N(() => {
|
|
993
|
+
const r = ue(t) instanceof ShadowRoot, o = ue(t, !0);
|
|
631
994
|
if (!(r ? t : o).querySelector(`link[href*='${e}']`)) {
|
|
632
995
|
const s = o.createElement("link");
|
|
633
996
|
s.rel = "stylesheet", s.href = e, (r ? t : o.head).appendChild(s);
|
|
634
997
|
}
|
|
635
998
|
}, [e, t]);
|
|
636
|
-
},
|
|
637
|
-
|
|
638
|
-
const r =
|
|
999
|
+
}, Fo = (e, t = document.body) => {
|
|
1000
|
+
N(() => {
|
|
1001
|
+
const r = ue(t), a = r instanceof ShadowRoot ? t : r.head;
|
|
639
1002
|
if (!a) return;
|
|
640
1003
|
const s = `sba-${btoa(e).slice(0, 10)}`;
|
|
641
1004
|
let i = a.querySelector(`style#${s}`);
|
|
642
1005
|
i ? i.textContent !== e && (i.textContent = e) : (i = a.ownerDocument.createElement("style"), i.id = s, i.textContent = e, a.appendChild(i));
|
|
643
1006
|
}, [e, t]);
|
|
644
|
-
}, [
|
|
645
|
-
function
|
|
646
|
-
children: e,
|
|
647
|
-
rootElement: t,
|
|
648
|
-
internalVariables: r
|
|
649
|
-
}) {
|
|
650
|
-
vo(Eo, t);
|
|
651
|
-
const o = F({}), a = F({}), [s, i] = C({}), l = W((m, g) => {
|
|
652
|
-
i((p) => ({
|
|
653
|
-
...p,
|
|
654
|
-
[m]: { fetching: !1, error: !1, ...p[m], ...g }
|
|
655
|
-
}));
|
|
656
|
-
}, []), u = W(
|
|
657
|
-
async ({
|
|
658
|
-
onRequestTemplate: m,
|
|
659
|
-
onGetCachedTemplate: g,
|
|
660
|
-
templateKey: p,
|
|
661
|
-
suspense: h = !1
|
|
662
|
-
}) => {
|
|
663
|
-
const f = g(p);
|
|
664
|
-
if (f) return f;
|
|
665
|
-
const E = a.current[p];
|
|
666
|
-
if (E) return E;
|
|
667
|
-
h || l(p, { fetching: !0 });
|
|
668
|
-
const x = m(p).catch((b) => {
|
|
669
|
-
throw h || l(p, { error: !0 }), b;
|
|
670
|
-
}).finally(() => {
|
|
671
|
-
h || l(p, { fetching: !1 }), delete a.current[p];
|
|
672
|
-
});
|
|
673
|
-
return a.current[p] = x, x;
|
|
674
|
-
},
|
|
675
|
-
[l]
|
|
676
|
-
);
|
|
677
|
-
return /* @__PURE__ */ n.createElement(
|
|
678
|
-
yo.Provider,
|
|
679
|
-
{
|
|
680
|
-
value: {
|
|
681
|
-
internalVariables: r,
|
|
682
|
-
fetchTemplate: u,
|
|
683
|
-
suspend: (m, g) => {
|
|
684
|
-
if (o.current[m])
|
|
685
|
-
return o.current[m];
|
|
686
|
-
const p = _o(g());
|
|
687
|
-
return o.current[m] = p, p;
|
|
688
|
-
},
|
|
689
|
-
getIsFetching: (m) => {
|
|
690
|
-
var g;
|
|
691
|
-
return ((g = s[m]) == null ? void 0 : g.fetching) ?? !1;
|
|
692
|
-
},
|
|
693
|
-
getHasError: (m) => {
|
|
694
|
-
var g;
|
|
695
|
-
return ((g = s[m]) == null ? void 0 : g.error) ?? !1;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
},
|
|
699
|
-
e
|
|
700
|
-
);
|
|
701
|
-
}
|
|
702
|
-
function _o(e) {
|
|
703
|
-
let t = "pending", r = e.then((o) => {
|
|
704
|
-
t = "resolved", r = o;
|
|
705
|
-
}).catch((o) => {
|
|
706
|
-
t = "rejected", r = o;
|
|
707
|
-
});
|
|
708
|
-
return {
|
|
709
|
-
get value() {
|
|
710
|
-
if (t === "resolved")
|
|
711
|
-
return r;
|
|
712
|
-
throw r;
|
|
713
|
-
}
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
const To = k`#${Q.ENTRY}{*:not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}}`, So = [To, to, no], ko = (e, ...t) => ur(e, ...So, ...t), Oe = 244, xn = 640, Me = 26, vn = 4, Z = 12, Ke = 2, wo = 16, ie = `${J}-incoming-msg`, Ao = `${J}-marked-text`;
|
|
717
|
-
function dt(e) {
|
|
1007
|
+
}, Uo = k`#${ne.ENTRY}{*:not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}}`, Vo = [Uo, Co, _o], Ho = (e, ...t) => fr(e, ...Vo, ...t), Le = 244, Cn = 640, Me = 26, _n = 4, q = 12, Te = 2, zo = 16, ie = `${Y}-incoming-msg`, Wo = `${Y}-marked-text`;
|
|
1008
|
+
function ht(e) {
|
|
718
1009
|
switch (e) {
|
|
719
1010
|
case "top":
|
|
720
1011
|
case "middle":
|
|
721
|
-
return
|
|
1012
|
+
return Te;
|
|
722
1013
|
default:
|
|
723
|
-
return
|
|
1014
|
+
return zo;
|
|
724
1015
|
}
|
|
725
1016
|
}
|
|
726
|
-
function
|
|
1017
|
+
function ft(e, t) {
|
|
727
1018
|
if (t) {
|
|
728
1019
|
const [, r] = t.split("/");
|
|
729
1020
|
if (r)
|
|
@@ -736,10 +1027,13 @@ function ut(e, t) {
|
|
|
736
1027
|
}
|
|
737
1028
|
return "FILE";
|
|
738
1029
|
}
|
|
739
|
-
|
|
1030
|
+
function Tn(e) {
|
|
1031
|
+
return e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0;
|
|
1032
|
+
}
|
|
1033
|
+
const me = (e) => {
|
|
740
1034
|
const t = e;
|
|
741
1035
|
return typeof t == "number" ? `${t}px` : t;
|
|
742
|
-
},
|
|
1036
|
+
}, Go = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), jo = {
|
|
743
1037
|
spinner: _(() => import("./BcUGcaq2.js")),
|
|
744
1038
|
chat: _(() => import("./DcFCGVBm.js")),
|
|
745
1039
|
message: _(() => import("./DsGXnanX.js")),
|
|
@@ -773,19 +1067,19 @@ const ge = (e) => {
|
|
|
773
1067
|
website: _(() => import("./BgGVGNdg.js")),
|
|
774
1068
|
snippet: _(() => import("./BFcXPuf5.js")),
|
|
775
1069
|
template: _(() => import("./awO7aBCv.js"))
|
|
776
|
-
},
|
|
777
|
-
const a =
|
|
1070
|
+
}, $ = ({ type: e, size: t = 24, className: r, color: o }) => {
|
|
1071
|
+
const a = jo[e];
|
|
778
1072
|
return /* @__PURE__ */ n.createElement(
|
|
779
|
-
|
|
1073
|
+
Zo,
|
|
780
1074
|
{
|
|
781
1075
|
className: r,
|
|
782
|
-
$rtlFlip:
|
|
1076
|
+
$rtlFlip: Go.has(e),
|
|
783
1077
|
$size: t,
|
|
784
1078
|
$color: o ?? d.color.primary.main
|
|
785
1079
|
},
|
|
786
|
-
/* @__PURE__ */ n.createElement(
|
|
1080
|
+
/* @__PURE__ */ n.createElement(Ie, { fallback: null }, /* @__PURE__ */ n.createElement(a, null))
|
|
787
1081
|
);
|
|
788
|
-
},
|
|
1082
|
+
}, Ko = k`[dir='rtl'] &{transform:scaleX(-1);}`, Zo = c.div`width:${({ $size: e }) => me(e)};height:${({ $size: e }) => me(e)};display:inline-block;&:focus{outline:none;}svg{display:block;}[class*='fill']{fill:${({ $color: e }) => e};}[class*='stroke']{stroke:${({ $color: e }) => e};stroke-width:2px;stroke-linejoin:round;}${({ $rtlFlip: e }) => e && Ko};`, S = ({ as: e, variant: t, color: r, className: o, ...a }) => /* @__PURE__ */ n.createElement(qo, { as: e, $variant: t, className: o, $color: r, ...a }), Lt = {
|
|
789
1083
|
h1: { fs: "18px", fw: 700 },
|
|
790
1084
|
h2: { fs: "16px", fw: 700 },
|
|
791
1085
|
subtitle1: { fs: "16px", fw: 500 },
|
|
@@ -798,32 +1092,46 @@ const ge = (e) => {
|
|
|
798
1092
|
caption2: { fs: "12px", fw: 400 },
|
|
799
1093
|
caption3: { fs: "11px", fw: 700 },
|
|
800
1094
|
caption4: { fs: "11px", fw: 400 }
|
|
801
|
-
},
|
|
802
|
-
function
|
|
803
|
-
if (!e || !
|
|
804
|
-
if (
|
|
805
|
-
const { fs: t, fw: r } =
|
|
806
|
-
return
|
|
807
|
-
}
|
|
808
|
-
const
|
|
809
|
-
function
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
1095
|
+
}, et = /* @__PURE__ */ new Map();
|
|
1096
|
+
function Yo(e) {
|
|
1097
|
+
if (!e || !Lt[e]) return "";
|
|
1098
|
+
if (et.has(e)) return et.get(e);
|
|
1099
|
+
const { fs: t, fw: r } = Lt[e], o = k`font-size:${t};font-weight:${r};`;
|
|
1100
|
+
return et.set(e, o), o;
|
|
1101
|
+
}
|
|
1102
|
+
const qo = c.span`font-stretch:normal;font-style:normal;letter-spacing:normal;line-height:100%;${({ $variant: e }) => Yo(e)}color:${({ $color: e }) => e};`;
|
|
1103
|
+
function bt({
|
|
1104
|
+
name: e,
|
|
1105
|
+
type: t = "FILE",
|
|
1106
|
+
iconColor: r,
|
|
1107
|
+
iconBackgroundColor: o,
|
|
1108
|
+
onClick: a
|
|
1109
|
+
}) {
|
|
1110
|
+
const { colors: s } = dt();
|
|
1111
|
+
return /* @__PURE__ */ n.createElement(Jo, { onClick: a, $clickable: !!a }, /* @__PURE__ */ n.createElement(Qo, { $bgColor: o ?? s.base.primary }, /* @__PURE__ */ n.createElement($, { type: "file-document", size: 24, color: r ?? s.base.primaryContrastContent })), /* @__PURE__ */ n.createElement(ea, null, /* @__PURE__ */ n.createElement(ta, { variant: "button", color: d.themedColor.onbackground1 }, e), /* @__PURE__ */ n.createElement(S, { color: d.themedColor.onbackground2, variant: "caption3" }, t)));
|
|
1112
|
+
}
|
|
1113
|
+
const Jo = c.div`border-radius:12px;gap:8px;width:${Le}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${d.themedColor.onbackground4};background-color:${d.themedColor.background1};${({ $clickable: e }) => e && Xo}`, Xo = k`cursor:pointer;&:hover{background-color:${d.themedColor.background2};}`, Qo = c.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, ea = c.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, ta = c(S)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
|
|
1114
|
+
function na({ file: e, children: t, onClickFile: r }) {
|
|
1115
|
+
return /* @__PURE__ */ n.createElement(ra, null, /* @__PURE__ */ n.createElement(
|
|
1116
|
+
bt,
|
|
1117
|
+
{
|
|
1118
|
+
name: e.name,
|
|
1119
|
+
type: ft(e.name, e.type),
|
|
1120
|
+
onClick: r && (() => r == null ? void 0 : r(e))
|
|
1121
|
+
}
|
|
1122
|
+
), t);
|
|
1123
|
+
}
|
|
1124
|
+
const ra = c.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`;
|
|
1125
|
+
function oa({ file: e, onClickMedia: t, children: r }) {
|
|
1126
|
+
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ n.createElement(sa, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ n.createElement(la, { controls: !0 }, /* @__PURE__ */ n.createElement("source", { src: e.url }), /* @__PURE__ */ n.createElement("track", { kind: "captions" })) : null;
|
|
1127
|
+
return o ? /* @__PURE__ */ n.createElement(aa, null, /* @__PURE__ */ n.createElement(ia, { id: `${ie}-media-body`, onClick: () => t == null ? void 0 : t(e) }, o()), r) : null;
|
|
1128
|
+
}
|
|
1129
|
+
const aa = c.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`, ia = c.div`width:${Le}px;height:160px;background-color:${({ theme: e }) => e.colors.messageIncoming.background};border-radius:12px;overflow:hidden;cursor:pointer;`, sa = c.img`width:100%;height:100%;object-fit:cover;`, la = c.video`width:100%;height:100%;object-fit:cover;`, ca = "✱";
|
|
1130
|
+
function Sn(e) {
|
|
1131
|
+
const t = new RegExp(`${ca}+`, "g");
|
|
1132
|
+
return e.replace(t, (r) => `<span id=${Wo} aria-label="marked-text">${r}</span>`);
|
|
1133
|
+
}
|
|
1134
|
+
function da(e) {
|
|
827
1135
|
const t = /```(\w+)?\n([\s\S]*?)```/g, r = [];
|
|
828
1136
|
let o = 0;
|
|
829
1137
|
return e.replace(t, (a, ...s) => {
|
|
@@ -839,292 +1147,88 @@ function Go(e) {
|
|
|
839
1147
|
}), o < e.length && r.push({
|
|
840
1148
|
type: "text",
|
|
841
1149
|
value: e.slice(o).trim()
|
|
842
|
-
}), r.map((a) => a.type !== "text" ? a : { ...a, value:
|
|
1150
|
+
}), r.map((a) => a.type !== "text" ? a : { ...a, value: Sn(a.value) });
|
|
843
1151
|
}
|
|
844
|
-
const
|
|
845
|
-
function
|
|
846
|
-
const t = e.maxBodyWidth ??
|
|
1152
|
+
const ua = _(async () => ({ default: (await import("./Cc9Mb_d1.js")).MarkdownText })), ma = _(async () => ({ default: (await import("./DH2PekOm.js")).CodeBlock }));
|
|
1153
|
+
function Nt(e) {
|
|
1154
|
+
const t = e.maxBodyWidth ?? Le, r = ve(() => da(e.message), [e.message]), o = {
|
|
847
1155
|
id: `${ie}-text-body`,
|
|
848
1156
|
$maxWidth: t
|
|
849
1157
|
};
|
|
850
|
-
return r.length === 0 ? e.children ? /* @__PURE__ */ n.createElement(
|
|
1158
|
+
return r.length === 0 ? e.children ? /* @__PURE__ */ n.createElement(Bt, { ...o }, e.children) : null : /* @__PURE__ */ n.createElement(Bt, { ...o }, r.map((a, s) => a.type === "text" ? /* @__PURE__ */ n.createElement(Dt, { key: s, variant: "body3" }, /* @__PURE__ */ n.createElement(Ie, { fallback: a.value }, /* @__PURE__ */ n.createElement(ua, null, a.value))) : a.type === "code" ? /* @__PURE__ */ n.createElement(Ie, { key: s, fallback: /* @__PURE__ */ n.createElement(Dt, { variant: "body3" }, a.value) }, /* @__PURE__ */ n.createElement(ma, { code: a.value, language: a.language })) : null), e.children);
|
|
851
1159
|
}
|
|
852
|
-
const
|
|
1160
|
+
const Bt = c.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e }) => k`
|
|
853
1161
|
color: ${e.colors.messageIncoming.text};
|
|
854
1162
|
background-color: ${e.colors.messageIncoming.background};
|
|
855
1163
|
`}
|
|
856
1164
|
padding: 12px 0;
|
|
857
1165
|
transition: max-width 0.3s;
|
|
858
1166
|
overflow-wrap: break-word;
|
|
859
|
-
`,
|
|
860
|
-
function
|
|
861
|
-
const { stringSet: t } = M();
|
|
1167
|
+
`, Dt = c(S)`align-items:flex-start;line-height:18px;white-space:pre-wrap;padding:0 12px;`;
|
|
1168
|
+
function pa(e) {
|
|
1169
|
+
const { stringSet: t } = M(), r = Tn(e) ? /* @__PURE__ */ n.createElement(Nt, { ...e }) : null;
|
|
862
1170
|
if (e.messageType === "user")
|
|
863
|
-
return
|
|
1171
|
+
return r;
|
|
864
1172
|
if (e.messageType === "file") {
|
|
865
|
-
const
|
|
866
|
-
return
|
|
1173
|
+
const o = e.file;
|
|
1174
|
+
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ n.createElement(oa, { ...e }, r) : /* @__PURE__ */ n.createElement(na, { ...e }, r);
|
|
867
1175
|
}
|
|
868
|
-
return /* @__PURE__ */ n.createElement(
|
|
1176
|
+
return /* @__PURE__ */ n.createElement(Nt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
869
1177
|
}
|
|
870
|
-
const
|
|
871
|
-
function
|
|
872
|
-
return /* @__PURE__ */ n.createElement(
|
|
1178
|
+
const Et = (e) => /* @__PURE__ */ n.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.0008 0.973633C10.6172 0.973633 9.49558 2.09527 9.49558 3.47888C9.49558 4.50705 10.115 5.39055 11.0009 5.77664V7.47887H13.0009V5.77653C13.8868 5.3904 14.5061 4.50696 14.5061 3.47888C14.5061 2.09527 13.3844 0.973633 12.0008 0.973633ZM0.250977 16.5788L0.250977 10.5789H2.25098L2.25098 16.5788H0.250977ZM21.7511 10.5789V16.5788H23.7511V10.5789H21.7511ZM18.251 7.47888H3.25097V18.9789C3.25097 20.3596 4.37026 21.4789 5.75097 21.4789H18.251C19.6317 21.4789 20.751 20.3596 20.751 18.9789V9.97887C20.751 8.59816 19.6317 7.47888 18.251 7.47888ZM9.78434 11.9539V15.2038C9.78434 15.7561 9.33663 16.2038 8.78434 16.2038C8.23206 16.2038 7.78434 15.7561 7.78434 15.2038V11.9539C7.78434 11.4016 8.23206 10.9539 8.78434 10.9539C9.33663 10.9539 9.78434 11.4016 9.78434 11.9539ZM16.2677 11.9539V15.2038C16.2677 15.7561 15.82 16.2038 15.2677 16.2038C14.7154 16.2038 14.2677 15.7561 14.2677 15.2038V11.9539C14.2677 11.4016 14.7154 10.9539 15.2677 10.9539C15.82 10.9539 16.2677 11.4016 16.2677 11.9539Z", fill: "#0D0D0D" }));
|
|
1179
|
+
function xt({ id: e, src: t, size: r = 56, onClick: o, style: a }) {
|
|
1180
|
+
return /* @__PURE__ */ n.createElement(ga, { id: e, tabIndex: 0, onClick: o, $size: me(r), style: a }, t ? /* @__PURE__ */ n.createElement(ha, { src: t }) : /* @__PURE__ */ n.createElement($, { type: "user", size: r }));
|
|
873
1181
|
}
|
|
874
|
-
const
|
|
875
|
-
function
|
|
1182
|
+
const ga = c.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${d.themedColor.background2};&:focus{outline:none;}`, ha = c.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
|
|
1183
|
+
function fa({ sender: e, isBotMessage: t }) {
|
|
876
1184
|
const r = `${ie}-sender-avatar`;
|
|
877
|
-
return !e.profileUrl && t ? /* @__PURE__ */ n.createElement(
|
|
1185
|
+
return !e.profileUrl && t ? /* @__PURE__ */ n.createElement(ba, { id: r }, /* @__PURE__ */ n.createElement(Et, null)) : /* @__PURE__ */ n.createElement(xt, { id: r, size: Me, src: e.profileUrl });
|
|
878
1186
|
}
|
|
879
|
-
const
|
|
880
|
-
function
|
|
881
|
-
return /* @__PURE__ */ n.createElement(
|
|
1187
|
+
const ba = c.div`flex-shrink:0;width:${Me}px;height:${Me}px;box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:${({ theme: e }) => e.colors.base.primary};path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}}`;
|
|
1188
|
+
function Ea({ sender: e }) {
|
|
1189
|
+
return /* @__PURE__ */ n.createElement(xa, { id: `${ie}-sender-name`, variant: "caption1", color: d.themedColor.textMidEmphasis }, e.nickname);
|
|
882
1190
|
}
|
|
883
|
-
const
|
|
884
|
-
function
|
|
1191
|
+
const xa = c(S)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
|
|
1192
|
+
function va({ createdAt: e }) {
|
|
885
1193
|
const { stringSet: t, format: r } = M();
|
|
886
|
-
return /* @__PURE__ */ n.createElement(
|
|
887
|
-
}
|
|
888
|
-
function ze() {
|
|
889
|
-
}
|
|
890
|
-
async function na(e) {
|
|
891
|
-
let t = e;
|
|
892
|
-
t && (!t.startsWith("http://") && !t.startsWith("https://") && (t = "https://" + t), window.open(t, "_blank", "noopener,noreferrer"));
|
|
893
|
-
}
|
|
894
|
-
function Dt(e) {
|
|
895
|
-
try {
|
|
896
|
-
return JSON.parse(e === "" ? "{}" : e);
|
|
897
|
-
} catch {
|
|
898
|
-
return {};
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
function Cn(e) {
|
|
902
|
-
return !e || !e.conversation ? !1 : e.conversation.status === j.CLOSED;
|
|
1194
|
+
return /* @__PURE__ */ n.createElement(S, { id: `${ie}-sent-time`, variant: "caption4", color: d.themedColor.textLowEmphasis }, r(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP));
|
|
903
1195
|
}
|
|
904
|
-
function
|
|
905
|
-
return !e || !e.conversation ? !1 : e.conversation.status === j.OPEN;
|
|
1196
|
+
function je() {
|
|
906
1197
|
}
|
|
907
|
-
function
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
return ht(e) && !r;
|
|
911
|
-
}
|
|
912
|
-
function oa({
|
|
913
|
-
extendedMessagePayload: e,
|
|
914
|
-
onClickCTA: t = ({ url: r }) => na(r)
|
|
915
|
-
}) {
|
|
916
|
-
const r = e == null ? void 0 : e.cta_button;
|
|
917
|
-
return r ? /* @__PURE__ */ n.createElement(aa, { id: `${ie}-ext-cta-button`, role: "button", onClick: () => t(r) }, /* @__PURE__ */ n.createElement(sa, { variant: "button" }, r.label)) : null;
|
|
918
|
-
}
|
|
919
|
-
const aa = c.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;background-color:${d.color.primary.main};color:${({ theme: e }) => e.colors.base.primaryContrastContent};&:hover{background-color:${d.color.primary.dark};}`, sa = c(T)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
|
|
920
|
-
function ia(e) {
|
|
921
|
-
return /* @__PURE__ */ n.createElement(n.Fragment, null);
|
|
1198
|
+
async function wn(e) {
|
|
1199
|
+
let t = e;
|
|
1200
|
+
t && (!t.startsWith("http://") && !t.startsWith("https://") && (t = "https://" + t), window.open(t, "_blank", "noopener,noreferrer"));
|
|
922
1201
|
}
|
|
923
|
-
|
|
1202
|
+
function Pt(e) {
|
|
924
1203
|
try {
|
|
925
|
-
|
|
926
|
-
return typeof t == "string" ? JSON.stringify(t).slice(1, -1) : e.trim();
|
|
1204
|
+
return JSON.parse(e === "" ? "{}" : e);
|
|
927
1205
|
} catch {
|
|
928
|
-
return
|
|
929
|
-
}
|
|
930
|
-
}, Ze = (e) => JSON.parse(e), Ye = (e) => JSON.parse(e);
|
|
931
|
-
function la(e, t) {
|
|
932
|
-
const [r, o] = t.split(",").map((a) => a.trim());
|
|
933
|
-
return e === "dark" && o || r;
|
|
934
|
-
}
|
|
935
|
-
function ca(e) {
|
|
936
|
-
const t = {};
|
|
937
|
-
function r(o, a = "") {
|
|
938
|
-
for (const [s, i] of Object.entries(o)) {
|
|
939
|
-
const l = a ? `${a}.${s}` : s;
|
|
940
|
-
i && typeof i == "object" && !Array.isArray(i) ? r(i, l) : t[l] = i;
|
|
941
|
-
}
|
|
1206
|
+
return {};
|
|
942
1207
|
}
|
|
943
|
-
return r(e), t;
|
|
944
|
-
}
|
|
945
|
-
function ft({
|
|
946
|
-
template: e,
|
|
947
|
-
variables: t,
|
|
948
|
-
variableKeyPattern: r,
|
|
949
|
-
variableValueTransformer: o
|
|
950
|
-
}) {
|
|
951
|
-
return Object.entries(t).reduce((a, [s, i]) => {
|
|
952
|
-
if (!o && !["number", "boolean", "string"].includes(typeof i))
|
|
953
|
-
throw new Error("If transformer is not provided, value must be a {string, number, or boolean}");
|
|
954
|
-
const l = o ? o(i) : String(i), u = r(s);
|
|
955
|
-
return a.replace(u, _n(l));
|
|
956
|
-
}, e);
|
|
957
1208
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
variables: t,
|
|
961
|
-
variableKeyPattern: r,
|
|
962
|
-
variableValueTransformer: o
|
|
963
|
-
}) {
|
|
964
|
-
return (await Promise.all(
|
|
965
|
-
Object.entries(t).map(async ([s, i]) => {
|
|
966
|
-
const l = await o(i);
|
|
967
|
-
return { regex: r(s), transformedValue: l };
|
|
968
|
-
})
|
|
969
|
-
)).reduce((s, { regex: i, transformedValue: l }) => s.replace(i, _n(l)), e);
|
|
1209
|
+
function kn(e) {
|
|
1210
|
+
return !e || !e.conversation ? !1 : e.conversation.status === z.CLOSED;
|
|
970
1211
|
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
|
|
974
|
-
};
|
|
975
|
-
function ae({ uiTemplateString: e, variables: t = {} }) {
|
|
976
|
-
const r = ca(t);
|
|
977
|
-
return ft({
|
|
978
|
-
template: e,
|
|
979
|
-
variables: r,
|
|
980
|
-
variableKeyPattern: (o) => qe.VARIABLE(o)
|
|
981
|
-
});
|
|
1212
|
+
function An(e) {
|
|
1213
|
+
return !e || !e.conversation ? !1 : e.conversation.status === z.OPEN;
|
|
982
1214
|
}
|
|
983
|
-
function
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
}) {
|
|
988
|
-
return ft({
|
|
989
|
-
template: t,
|
|
990
|
-
variables: r,
|
|
991
|
-
variableKeyPattern: (o) => qe.VARIABLE(o),
|
|
992
|
-
variableValueTransformer: (o) => la(e, o)
|
|
993
|
-
});
|
|
1215
|
+
function ya(e) {
|
|
1216
|
+
var o;
|
|
1217
|
+
const t = (o = e == null ? void 0 : e.conversation) == null ? void 0 : o.handoff, r = !!(t != null && t.timestamp);
|
|
1218
|
+
return An(e) && !r;
|
|
994
1219
|
}
|
|
995
|
-
function
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
viewVariables: r = {},
|
|
999
|
-
aiAgentColorVariables: o,
|
|
1000
|
-
internalVariables: a,
|
|
1001
|
-
onRequestTemplate: s
|
|
1220
|
+
function Ca({
|
|
1221
|
+
extendedMessagePayload: e,
|
|
1222
|
+
onClickCTA: t = ({ url: r }) => wn(r)
|
|
1002
1223
|
}) {
|
|
1003
|
-
const
|
|
1004
|
-
return
|
|
1005
|
-
template: t,
|
|
1006
|
-
variables: r,
|
|
1007
|
-
variableKeyPattern: (m) => qe.VIEW_VARIABLE(m),
|
|
1008
|
-
variableValueTransformer: (m) => {
|
|
1009
|
-
const g = m.map(({ key: p, variables: h }) => {
|
|
1010
|
-
const f = s(p), { ui_template: E, color_variables: x } = Ze(f);
|
|
1011
|
-
let b = JSON.stringify(E);
|
|
1012
|
-
return b = ae({
|
|
1013
|
-
uiTemplateString: b,
|
|
1014
|
-
variables: a
|
|
1015
|
-
}), b = se({
|
|
1016
|
-
theme: e,
|
|
1017
|
-
uiTemplateString: b,
|
|
1018
|
-
colorVariables: x
|
|
1019
|
-
}), b = se({
|
|
1020
|
-
theme: e,
|
|
1021
|
-
uiTemplateString: b,
|
|
1022
|
-
colorVariables: o
|
|
1023
|
-
}), b = ae({
|
|
1024
|
-
uiTemplateString: b,
|
|
1025
|
-
variables: h
|
|
1026
|
-
}), Ye(b);
|
|
1027
|
-
});
|
|
1028
|
-
return JSON.stringify(g);
|
|
1029
|
-
}
|
|
1030
|
-
});
|
|
1224
|
+
const r = e == null ? void 0 : e.cta_button;
|
|
1225
|
+
return r ? /* @__PURE__ */ n.createElement(_a, { id: `${ie}-ext-cta-button`, role: "button", onClick: () => t(r) }, /* @__PURE__ */ n.createElement(Ta, { variant: "button" }, r.label)) : null;
|
|
1031
1226
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
viewVariables: r = {},
|
|
1036
|
-
aiAgentColorVariables: o,
|
|
1037
|
-
internalVariables: a,
|
|
1038
|
-
onRequestTemplate: s
|
|
1039
|
-
}) {
|
|
1040
|
-
return da({
|
|
1041
|
-
template: t,
|
|
1042
|
-
variables: r,
|
|
1043
|
-
variableKeyPattern: (i) => qe.VIEW_VARIABLE(i),
|
|
1044
|
-
variableValueTransformer: async (i) => {
|
|
1045
|
-
const l = i.map(async ({ key: m, variables: g }) => {
|
|
1046
|
-
const p = await s(m), { ui_template: h, color_variables: f } = Ze(p);
|
|
1047
|
-
let E = JSON.stringify(h);
|
|
1048
|
-
return E = ae({
|
|
1049
|
-
uiTemplateString: E,
|
|
1050
|
-
variables: a
|
|
1051
|
-
}), E = se({
|
|
1052
|
-
theme: e,
|
|
1053
|
-
uiTemplateString: E,
|
|
1054
|
-
colorVariables: f
|
|
1055
|
-
}), E = se({
|
|
1056
|
-
theme: e,
|
|
1057
|
-
uiTemplateString: E,
|
|
1058
|
-
colorVariables: o
|
|
1059
|
-
}), E = ae({
|
|
1060
|
-
uiTemplateString: E,
|
|
1061
|
-
variables: g
|
|
1062
|
-
}), Ye(E);
|
|
1063
|
-
}), u = await Promise.all(l);
|
|
1064
|
-
return JSON.stringify(u);
|
|
1065
|
-
}
|
|
1066
|
-
});
|
|
1227
|
+
const _a = c.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;background-color:${d.color.primary.main};color:${({ theme: e }) => e.colors.base.primaryContrastContent};&:hover{background-color:${d.color.primary.dark};}`, Ta = c(S)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
|
|
1228
|
+
function Sa(e) {
|
|
1229
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null);
|
|
1067
1230
|
}
|
|
1068
|
-
|
|
1069
|
-
rawTemplate: e,
|
|
1070
|
-
aiAgentColorVariables: t,
|
|
1071
|
-
internalVariables: r,
|
|
1072
|
-
...o
|
|
1073
|
-
}) => {
|
|
1074
|
-
const { ui_template: a, color_variables: s } = Ze(e);
|
|
1075
|
-
let i = JSON.stringify(a);
|
|
1076
|
-
if (Object.keys(o.viewVariables ?? {}).length > 0) {
|
|
1077
|
-
const u = ua({
|
|
1078
|
-
...o,
|
|
1079
|
-
uiTemplateString: i,
|
|
1080
|
-
aiAgentColorVariables: t,
|
|
1081
|
-
internalVariables: r
|
|
1082
|
-
});
|
|
1083
|
-
if (u === null) return null;
|
|
1084
|
-
i = u;
|
|
1085
|
-
}
|
|
1086
|
-
return i = ae({ ...o, uiTemplateString: i, variables: r }), i = se({ ...o, uiTemplateString: i, colorVariables: s }), i = se({ ...o, uiTemplateString: i, colorVariables: t }), i = ae({ ...o, uiTemplateString: i }), Ye(i);
|
|
1087
|
-
}, ga = async ({
|
|
1088
|
-
rawTemplate: e,
|
|
1089
|
-
aiAgentColorVariables: t,
|
|
1090
|
-
internalVariables: r,
|
|
1091
|
-
...o
|
|
1092
|
-
}) => {
|
|
1093
|
-
const { ui_template: a, color_variables: s } = Ze(e);
|
|
1094
|
-
let i = JSON.stringify(a);
|
|
1095
|
-
return Object.keys(o.viewVariables ?? {}).length > 0 && (i = await ma({
|
|
1096
|
-
...o,
|
|
1097
|
-
uiTemplateString: i,
|
|
1098
|
-
aiAgentColorVariables: t,
|
|
1099
|
-
internalVariables: r
|
|
1100
|
-
})), i = ae({ ...o, uiTemplateString: i, variables: r }), i = se({ ...o, uiTemplateString: i, colorVariables: s }), i = se({ ...o, uiTemplateString: i, colorVariables: t }), i = ae({ ...o, uiTemplateString: i }), Ye(i);
|
|
1101
|
-
}, ha = (e) => {
|
|
1102
|
-
const { aiAgentColorVariables: t } = je().theme, { internalVariables: r } = En();
|
|
1103
|
-
return C(() => {
|
|
1104
|
-
const o = e.onGetCachedTemplate(e.templateKey);
|
|
1105
|
-
return o ? pa({
|
|
1106
|
-
...e,
|
|
1107
|
-
rawTemplate: o,
|
|
1108
|
-
aiAgentColorVariables: t,
|
|
1109
|
-
internalVariables: r,
|
|
1110
|
-
onRequestTemplate: e.onGetCachedTemplate
|
|
1111
|
-
}) : null;
|
|
1112
|
-
});
|
|
1113
|
-
}, fa = (e) => {
|
|
1114
|
-
const [t] = ha(e);
|
|
1115
|
-
if (t) return t;
|
|
1116
|
-
const { aiAgentColorVariables: r } = je().theme, { internalVariables: o, fetchTemplate: a, suspend: s } = En();
|
|
1117
|
-
return s(e.templateKey, async () => {
|
|
1118
|
-
const l = await a({ ...e, suspense: !0 });
|
|
1119
|
-
return await ga({
|
|
1120
|
-
...e,
|
|
1121
|
-
rawTemplate: l,
|
|
1122
|
-
aiAgentColorVariables: r,
|
|
1123
|
-
internalVariables: o
|
|
1124
|
-
});
|
|
1125
|
-
}).value;
|
|
1126
|
-
};
|
|
1127
|
-
class ba extends er {
|
|
1231
|
+
class wa extends ar {
|
|
1128
1232
|
constructor(t) {
|
|
1129
1233
|
super(t), this.state = {
|
|
1130
1234
|
hasError: !1
|
|
@@ -1134,50 +1238,51 @@ class ba extends er {
|
|
|
1134
1238
|
return { hasError: !0 };
|
|
1135
1239
|
}
|
|
1136
1240
|
render() {
|
|
1137
|
-
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ n.createElement(
|
|
1241
|
+
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ n.createElement(Ie, { fallback: this.props.loadingFallback }, this.props.children);
|
|
1138
1242
|
}
|
|
1139
1243
|
}
|
|
1140
|
-
const
|
|
1141
|
-
parser:
|
|
1142
|
-
renderer:
|
|
1244
|
+
const ka = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: Aa } = wr({
|
|
1245
|
+
parser: Tr,
|
|
1246
|
+
renderer: _r,
|
|
1143
1247
|
Container: (e) => /* @__PURE__ */ n.createElement("div", { ...e })
|
|
1144
1248
|
});
|
|
1145
|
-
function
|
|
1249
|
+
function Ia(e) {
|
|
1146
1250
|
return /* @__PURE__ */ n.createElement(
|
|
1147
|
-
|
|
1251
|
+
wa,
|
|
1148
1252
|
{
|
|
1149
1253
|
errorFallback: e.messageTemplateErrorFallback,
|
|
1150
1254
|
loadingFallback: e.messageTemplateLoadingFallback
|
|
1151
1255
|
},
|
|
1152
|
-
/* @__PURE__ */ n.createElement(
|
|
1256
|
+
/* @__PURE__ */ n.createElement($a, { ...e })
|
|
1153
1257
|
);
|
|
1154
1258
|
}
|
|
1155
|
-
const
|
|
1259
|
+
const $a = ({
|
|
1156
1260
|
extendedMessagePayload: e,
|
|
1157
1261
|
onGetCachedMessageTemplate: t = () => null,
|
|
1158
1262
|
onRequestMessageTemplate: r
|
|
1159
1263
|
}) => {
|
|
1160
1264
|
const o = e == null ? void 0 : e.message_template;
|
|
1161
|
-
if (!
|
|
1265
|
+
if (!ka.has((o == null ? void 0 : o.type) ?? "default")) throw new Error("Unsupported template type");
|
|
1162
1266
|
if (!r) throw new Error("onRequestMessageTemplate is required");
|
|
1163
|
-
const { theme: s } =
|
|
1267
|
+
const { theme: s } = yn(), i = po({
|
|
1164
1268
|
onRequestTemplate: r,
|
|
1165
1269
|
onGetCachedTemplate: t,
|
|
1166
1270
|
theme: s.selected,
|
|
1167
1271
|
templateKey: (o == null ? void 0 : o.key) ?? "invalid",
|
|
1168
1272
|
variables: o == null ? void 0 : o.variables,
|
|
1169
|
-
viewVariables: o == null ? void 0 : o.view_variables
|
|
1273
|
+
viewVariables: o == null ? void 0 : o.view_variables,
|
|
1274
|
+
aiAgentColorVariables: s.aiAgentColorVariables
|
|
1170
1275
|
});
|
|
1171
|
-
return /* @__PURE__ */ n.createElement(
|
|
1172
|
-
},
|
|
1173
|
-
function
|
|
1276
|
+
return /* @__PURE__ */ n.createElement(Ma, { id: `${ie}-ext-message-template` }, /* @__PURE__ */ n.createElement(Sr, { message: {} }, /* @__PURE__ */ n.createElement(Aa, { templateItems: i.body.items, templateVersion: i.version })));
|
|
1277
|
+
}, Ma = c.div`box-sizing:border-box;overflow:hidden;width:100%;`;
|
|
1278
|
+
function Oa({
|
|
1174
1279
|
extendedMessagePayload: e,
|
|
1175
1280
|
onClickSuggestedReply: t,
|
|
1176
1281
|
suggestedRepliesDirection: r = "vertical"
|
|
1177
1282
|
}) {
|
|
1178
|
-
const [o, a] =
|
|
1179
|
-
return s.length === 0 || o ? null : /* @__PURE__ */ n.createElement(
|
|
1180
|
-
|
|
1283
|
+
const [o, a] = y(!1), s = (e == null ? void 0 : e.suggested_replies) ?? [];
|
|
1284
|
+
return s.length === 0 || o ? null : /* @__PURE__ */ n.createElement(Ra, { id: `${ie}-ext-suggested-replies`, $type: r }, s.map((i, l) => /* @__PURE__ */ n.createElement(
|
|
1285
|
+
La,
|
|
1181
1286
|
{
|
|
1182
1287
|
key: l,
|
|
1183
1288
|
$type: r,
|
|
@@ -1189,140 +1294,147 @@ function _a({
|
|
|
1189
1294
|
i
|
|
1190
1295
|
)));
|
|
1191
1296
|
}
|
|
1192
|
-
const
|
|
1193
|
-
${e === "vertical" ?
|
|
1297
|
+
const Ra = c.div`margin:16px 0;padding:0 ${q}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? Na : Ba};`, La = c(S)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:100px;cursor:pointer;word-break:break-word;color:${d.color.primary.main};border:1px solid ${d.color.primary.main};background-color:${d.themedColor.background1};&:hover{background-color:${d.themedColor.background2};}${({ $type: e, theme: t }) => k`
|
|
1298
|
+
${e === "vertical" ? Da : Pa};
|
|
1194
1299
|
&:active {
|
|
1195
1300
|
background-color: ${t.colors.base.primary};
|
|
1196
1301
|
color: ${t.colors.base.primaryContrastContent};
|
|
1197
1302
|
}
|
|
1198
1303
|
`}
|
|
1199
|
-
`,
|
|
1200
|
-
function
|
|
1304
|
+
`, Na = k`flex-direction:column;align-items:flex-end;`, Ba = k`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Da = k`max-width:calc(100% - 70px);white-space:pre-wrap;`, Pa = k`white-space:nowrap;`, In = ({ className: e }) => /* @__PURE__ */ n.createElement(Fa, { className: e }, [0, 1, 2].map((t) => /* @__PURE__ */ n.createElement(Ua, { key: t }))), Fa = c.div`align-items:center;border-radius:12px;display:flex;gap:6px;justify-content:center;padding:16px 12px;background-color:${({ theme: e }) => e.colors.messageIncoming.background};`, Ua = c.span`animation:blink 1.4s infinite;animation-fill-mode:both;border-radius:50%;height:8px;width:8px;background:${({ theme: e }) => e.colors.messageIncoming.text};@keyframes blink{0%{opacity:0.12;transform:scale(1);}21.43%{opacity:0.38;transform:scale(1.2);}42.86%{opacity:0.12;transform:scale(1);}100%{opacity:0.12;transform:scale(1);}}&:nth-child(1){animation-delay:0.4s;}&:nth-child(2){animation-delay:0.6s;}&:nth-child(3){animation-delay:0.8s;}`;
|
|
1305
|
+
function $n(e) {
|
|
1201
1306
|
return e();
|
|
1202
1307
|
}
|
|
1203
|
-
const
|
|
1204
|
-
template:
|
|
1308
|
+
const pe = ut({
|
|
1309
|
+
template: Va,
|
|
1205
1310
|
components: {
|
|
1206
|
-
SenderName:
|
|
1207
|
-
SenderAvatar:
|
|
1208
|
-
SentTime:
|
|
1209
|
-
MessageBody:
|
|
1210
|
-
SuggestedReplies:
|
|
1211
|
-
MessageTemplate:
|
|
1212
|
-
CTAButton:
|
|
1213
|
-
MessageLogs:
|
|
1311
|
+
SenderName: Ea,
|
|
1312
|
+
SenderAvatar: fa,
|
|
1313
|
+
SentTime: va,
|
|
1314
|
+
MessageBody: pa,
|
|
1315
|
+
SuggestedReplies: Oa,
|
|
1316
|
+
MessageTemplate: Ia,
|
|
1317
|
+
CTAButton: Ca,
|
|
1318
|
+
MessageLogs: Sa
|
|
1214
1319
|
}
|
|
1215
1320
|
});
|
|
1216
|
-
function
|
|
1217
|
-
return /* @__PURE__ */ n.createElement(
|
|
1321
|
+
function Va(e) {
|
|
1322
|
+
return /* @__PURE__ */ n.createElement(Mn, { ...e, testerMode: !1 });
|
|
1218
1323
|
}
|
|
1219
|
-
function
|
|
1220
|
-
var
|
|
1221
|
-
const { components: t } =
|
|
1222
|
-
return /* @__PURE__ */ n.createElement(
|
|
1324
|
+
function Mn(e) {
|
|
1325
|
+
var p, m, h, g;
|
|
1326
|
+
const { components: t } = pe.useContext(), r = e.testerMode, o = !!((p = e.extendedMessagePayload) != null && p.message_template), a = !!((m = e.extendedMessagePayload) != null && m.cta_button), s = $n(() => e.messageType === "user" ? e.message.length > 0 : !0), i = e.groupType === "top" || e.groupType === "single", l = e.groupType === "bottom" || e.groupType === "single", u = r ? 0 : Me;
|
|
1327
|
+
return /* @__PURE__ */ n.createElement(Ha, { $marginBottom: ht(e.groupType) }, i && /* @__PURE__ */ n.createElement(za, null, !r && /* @__PURE__ */ n.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ n.createElement(t.SenderName, { ...e })), /* @__PURE__ */ n.createElement(At, null, /* @__PURE__ */ n.createElement(tt, { $extraStartPadding: u }, /* @__PURE__ */ n.createElement(t.MessageBody, { ...e }, a && /* @__PURE__ */ n.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ n.createElement(t.CTAButton, { ...e })))), o && /* @__PURE__ */ n.createElement(Ft, { $startPadding: 0, $endPadding: 0, style: { marginTop: s ? Te : 0 } }, /* @__PURE__ */ n.createElement(
|
|
1223
1328
|
t.MessageTemplate,
|
|
1224
1329
|
{
|
|
1225
1330
|
...e,
|
|
1226
|
-
messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ n.createElement(
|
|
1331
|
+
messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ n.createElement(tt, { $extraStartPadding: u }, /* @__PURE__ */ n.createElement(
|
|
1227
1332
|
t.MessageBody,
|
|
1228
1333
|
{
|
|
1229
1334
|
...e,
|
|
1230
1335
|
messageType: "user",
|
|
1231
|
-
message: ((
|
|
1336
|
+
message: ((g = (h = e.extendedMessagePayload) == null ? void 0 : h.message_template) == null ? void 0 : g.fallback_message) ?? "Cannot read this template."
|
|
1232
1337
|
}
|
|
1233
1338
|
)),
|
|
1234
|
-
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ n.createElement(
|
|
1339
|
+
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ n.createElement(tt, { $extraStartPadding: u }, /* @__PURE__ */ n.createElement(In, null))
|
|
1235
1340
|
}
|
|
1236
|
-
))), l && /* @__PURE__ */ n.createElement(
|
|
1341
|
+
))), l && /* @__PURE__ */ n.createElement(Wa, { $extraStartPadding: u + 8 }, /* @__PURE__ */ n.createElement(t.SentTime, { ...e })), /* @__PURE__ */ n.createElement(At, null, e.suggestedRepliesVisible && /* @__PURE__ */ n.createElement(Ft, null, /* @__PURE__ */ n.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ n.createElement(t.MessageLogs, { ...e })));
|
|
1237
1342
|
}
|
|
1238
|
-
const
|
|
1239
|
-
`, Je = c.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e =
|
|
1343
|
+
const Ha = c.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
1344
|
+
`, Je = c.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = q, $endPadding: t = q, $extraStartPadding: r = 0 }) => `
|
|
1240
1345
|
padding-inline: ${e + r}px ${t}px;
|
|
1241
1346
|
`}
|
|
1242
|
-
`,
|
|
1347
|
+
`, za = c(Je)`display:flex;flex-direction:row;align-items:center;gap:8px;`, tt = c(Je)`display:flex;`, Wa = c(Je)`margin-top:${_n}px;display:flex;align-items:flex-start;justify-content:flex-start;`, Ft = c(Je)`display:flex;flex-direction:column;${({ $startPadding: e = q, $endPadding: t = q, $extraStartPadding: r = 0 }) => `
|
|
1243
1348
|
padding-inline: ${e + r}px ${t}px;
|
|
1244
1349
|
`}
|
|
1245
1350
|
`;
|
|
1246
|
-
function
|
|
1247
|
-
return /* @__PURE__ */ n.createElement(
|
|
1351
|
+
function Ga({ file: e, children: t, onClickFile: r }) {
|
|
1352
|
+
return /* @__PURE__ */ n.createElement(ja, null, /* @__PURE__ */ n.createElement(
|
|
1353
|
+
bt,
|
|
1354
|
+
{
|
|
1355
|
+
name: e.name,
|
|
1356
|
+
type: ft(e.name, e.type),
|
|
1357
|
+
onClick: r && (() => r == null ? void 0 : r(e))
|
|
1358
|
+
}
|
|
1359
|
+
), t);
|
|
1248
1360
|
}
|
|
1249
|
-
const
|
|
1250
|
-
function
|
|
1251
|
-
const { aspectRatio: a, localFile: s } = t, [i] =
|
|
1252
|
-
return /* @__PURE__ */ n.createElement(
|
|
1361
|
+
const ja = c.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, On = ({ className: e, children: t, size: r = 26 }) => /* @__PURE__ */ n.createElement(Ka, { className: e, $size: r }, t ?? /* @__PURE__ */ n.createElement($, { type: "spinner", size: r })), Ka = c.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => me(e)};height:${({ $size: e }) => me(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
|
|
1362
|
+
function Za({ file: e, metadata: t, onClickMedia: r, children: o }) {
|
|
1363
|
+
const { aspectRatio: a, localFile: s } = t, [i] = y(() => s instanceof File ? URL.createObjectURL(s) : e.url), [l, u] = y(!1);
|
|
1364
|
+
return /* @__PURE__ */ n.createElement(Ya, null, /* @__PURE__ */ n.createElement(qa, { $ratio: a, onClick: () => r == null ? void 0 : r(e) }, !l && /* @__PURE__ */ n.createElement(On, { size: 26 }, /* @__PURE__ */ n.createElement($, { type: "spinner", color: "onbackground3", size: 26 })), /* @__PURE__ */ n.createElement(Ja, { $loaded: l, src: i, alt: "image-message", onLoad: () => u(!0) })), o);
|
|
1253
1365
|
}
|
|
1254
|
-
const
|
|
1366
|
+
const Ya = c.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, qa = c.div`width:${Le}px;border-radius:12px;overflow:hidden;cursor:pointer;height:auto;aspect-ratio:${(e) => e.$ratio};position:relative;display:flex;align-items:center;justify-content:center;${U.light`
|
|
1255
1367
|
background-color: ${d.color.background100};
|
|
1256
1368
|
`}
|
|
1257
|
-
${
|
|
1369
|
+
${U.dark`
|
|
1258
1370
|
background-color: ${d.color.background400};
|
|
1259
1371
|
`}
|
|
1260
|
-
`,
|
|
1261
|
-
function
|
|
1262
|
-
const t = ve(() => dn.sanitize(
|
|
1263
|
-
return /* @__PURE__ */ n.createElement(
|
|
1372
|
+
`, Ja = c.img`position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0;object-fit:cover;opacity:${(e) => e.$loaded ? 1 : 0};transition:opacity 0.5s ease;`;
|
|
1373
|
+
function Ut(e) {
|
|
1374
|
+
const t = ve(() => dn.sanitize(Sn(e.message)), [e.message]);
|
|
1375
|
+
return /* @__PURE__ */ n.createElement(Xa, { $maxWidth: e.maxBodyWidth ?? Le }, /* @__PURE__ */ n.createElement(Qa, { variant: "body3", dangerouslySetInnerHTML: { __html: t } }));
|
|
1264
1376
|
}
|
|
1265
|
-
const
|
|
1377
|
+
const Xa = c.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e }) => k`
|
|
1266
1378
|
color: ${e.colors.messageOutgoing.text};
|
|
1267
1379
|
background-color: ${e.colors.messageOutgoing.background};
|
|
1268
1380
|
`}
|
|
1269
1381
|
padding: 12px 0;
|
|
1270
1382
|
transition: max-width 0.3s;
|
|
1271
1383
|
overflow-wrap: break-word;
|
|
1272
|
-
`,
|
|
1273
|
-
function
|
|
1274
|
-
const { stringSet: t } = M(), r = e
|
|
1275
|
-
return e.messageType === "user" ? r : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ n.createElement(
|
|
1384
|
+
`, Qa = c(S)`align-items:flex-start;line-height:18px;white-space:pre-wrap;padding:0 12px;`;
|
|
1385
|
+
function ei(e) {
|
|
1386
|
+
const { stringSet: t } = M(), r = Tn(e) ? /* @__PURE__ */ n.createElement(Ut, { ...e }) : null;
|
|
1387
|
+
return e.messageType === "user" ? r : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ n.createElement(Za, { ...e }, r) : /* @__PURE__ */ n.createElement(Ga, { ...e }, r) : /* @__PURE__ */ n.createElement(Ut, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
1276
1388
|
}
|
|
1277
|
-
function
|
|
1278
|
-
const t =
|
|
1389
|
+
function ti({ sendingStatus: e }) {
|
|
1390
|
+
const t = dt();
|
|
1279
1391
|
switch (e) {
|
|
1280
1392
|
case "pending":
|
|
1281
|
-
return /* @__PURE__ */ n.createElement(
|
|
1393
|
+
return /* @__PURE__ */ n.createElement(ni, { size: 16 }, /* @__PURE__ */ n.createElement($, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
|
|
1282
1394
|
case "failed":
|
|
1283
|
-
return /* @__PURE__ */ n.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ n.createElement(
|
|
1395
|
+
return /* @__PURE__ */ n.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ n.createElement($, { type: "error", color: d.themedColor.error, size: 16 }));
|
|
1284
1396
|
case "scheduled":
|
|
1285
1397
|
case "canceled":
|
|
1286
1398
|
return null;
|
|
1287
1399
|
default:
|
|
1288
|
-
return /* @__PURE__ */ n.createElement("div", null, /* @__PURE__ */ n.createElement(
|
|
1400
|
+
return /* @__PURE__ */ n.createElement("div", null, /* @__PURE__ */ n.createElement($, { type: "chevron-down" }));
|
|
1289
1401
|
}
|
|
1290
1402
|
}
|
|
1291
|
-
const
|
|
1292
|
-
function
|
|
1403
|
+
const ni = c(On)`margin-bottom:2px;width:16px;height:16px;`;
|
|
1404
|
+
function ri({ createdAt: e }) {
|
|
1293
1405
|
const { stringSet: t, format: r } = M();
|
|
1294
|
-
return /* @__PURE__ */ n.createElement(
|
|
1406
|
+
return /* @__PURE__ */ n.createElement(S, { variant: "caption4", color: d.themedColor.textLowEmphasis }, r(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP));
|
|
1295
1407
|
}
|
|
1296
|
-
const
|
|
1297
|
-
template:
|
|
1408
|
+
const vt = ut({
|
|
1409
|
+
template: oi,
|
|
1298
1410
|
components: {
|
|
1299
|
-
SendingStatus:
|
|
1300
|
-
SentTime:
|
|
1301
|
-
MessageBody:
|
|
1411
|
+
SendingStatus: ti,
|
|
1412
|
+
SentTime: ri,
|
|
1413
|
+
MessageBody: ei
|
|
1302
1414
|
}
|
|
1303
1415
|
});
|
|
1304
|
-
function
|
|
1305
|
-
const { components: t } =
|
|
1306
|
-
return /* @__PURE__ */ n.createElement(
|
|
1416
|
+
function oi(e) {
|
|
1417
|
+
const { components: t } = vt.useContext(), r = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
|
|
1418
|
+
return /* @__PURE__ */ n.createElement(ai, { $marginBottom: ht(e.groupType) }, /* @__PURE__ */ n.createElement(ii, null, /* @__PURE__ */ n.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ n.createElement(si, { $extraEndPadding: 8 }, r ? /* @__PURE__ */ n.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ n.createElement(t.SendingStatus, { ...e })));
|
|
1307
1419
|
}
|
|
1308
|
-
const
|
|
1309
|
-
`,
|
|
1310
|
-
`,
|
|
1311
|
-
function
|
|
1312
|
-
return e.messageType !== "admin" ? null : /* @__PURE__ */ n.createElement(
|
|
1420
|
+
const ai = c.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
1421
|
+
`, Rn = c.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = q, $endPadding: t = q, $extraEndPadding: r = 0 }) => `padding-inline: ${e}px ${t + r}px;`};
|
|
1422
|
+
`, ii = c(Rn)``, si = c(Rn)`margin-top:${_n}px;`;
|
|
1423
|
+
function li(e) {
|
|
1424
|
+
return e.messageType !== "admin" ? null : /* @__PURE__ */ n.createElement(ci, null, /* @__PURE__ */ n.createElement(S, { variant: "caption2", color: d.themedColor.textMidEmphasis }, di(dn.sanitize(e.message))));
|
|
1313
1425
|
}
|
|
1314
|
-
const
|
|
1426
|
+
const ci = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, di = (e) => {
|
|
1315
1427
|
const t = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, r = [];
|
|
1316
1428
|
let o = 0;
|
|
1317
1429
|
return e.replace(t, (a, s, i, l) => (r.push(e.slice(o, l)), r.push(
|
|
1318
|
-
/* @__PURE__ */ n.createElement("a", { key: i, href: i, target: "_blank", rel:
|
|
1430
|
+
/* @__PURE__ */ n.createElement("a", { key: i, href: i, target: "_blank", rel: pt }, s)
|
|
1319
1431
|
), o = l + a.length, a)), r.push(e.slice(o)), r;
|
|
1320
|
-
},
|
|
1432
|
+
}, ui = ({ submitted: e, defaultValue: t, value: r, onChange: o }) => {
|
|
1321
1433
|
const { stringSet: a } = M();
|
|
1322
|
-
return
|
|
1434
|
+
return N(() => {
|
|
1323
1435
|
typeof r > "u" && typeof t == "boolean" && (o == null || o(t));
|
|
1324
|
-
}, [r, t]), /* @__PURE__ */ n.createElement(
|
|
1325
|
-
|
|
1436
|
+
}, [r, t]), /* @__PURE__ */ n.createElement(mi, null, /* @__PURE__ */ n.createElement(S, { variant: "caption2", color: d.themedColor.textMidEmphasis }, a.CSAT_CRE_TITLE), /* @__PURE__ */ n.createElement("div", null, /* @__PURE__ */ n.createElement(
|
|
1437
|
+
Vt,
|
|
1326
1438
|
{
|
|
1327
1439
|
checked: r === !0,
|
|
1328
1440
|
label: a.CSAT_CRE_SOLVED,
|
|
@@ -1330,7 +1442,7 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1330
1442
|
onClick: () => o == null ? void 0 : o(!0)
|
|
1331
1443
|
}
|
|
1332
1444
|
), /* @__PURE__ */ n.createElement(
|
|
1333
|
-
|
|
1445
|
+
Vt,
|
|
1334
1446
|
{
|
|
1335
1447
|
checked: r === !1,
|
|
1336
1448
|
label: a.CSAT_CRE_NOT_SOLVED,
|
|
@@ -1338,17 +1450,17 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1338
1450
|
onClick: () => o == null ? void 0 : o(!1)
|
|
1339
1451
|
}
|
|
1340
1452
|
)));
|
|
1341
|
-
},
|
|
1453
|
+
}, Vt = ({ onClick: e, checked: t, label: r, disabled: o }) => {
|
|
1342
1454
|
const a = t ? d.color.primary.main : o ? d.themedColor.textDisabled : d.themedColor.textLowEmphasis, s = t ? d.themedColor.textHighEmphasis : o ? d.themedColor.textLowEmphasis : d.themedColor.textHighEmphasis;
|
|
1343
|
-
return /* @__PURE__ */ n.createElement(
|
|
1344
|
-
}, rs = c.div`display:flex;flex-direction:column;gap:8px;`, os = c.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, as = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.08301 20C2.08301 10.1049 10.1046 2.08334 19.9997 2.08334C29.8948 2.08334 37.9163 10.1049 37.9163 20C37.9163 29.8952 29.8948 37.9167 19.9997 37.9167C10.1046 37.9167 2.08301 29.8952 2.08301 20Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5824 29.3328C13.1344 29.7473 13.918 29.636 14.3326 29.084C15.6269 27.3607 17.6835 26.25 19.9997 26.25C22.316 26.25 24.3727 27.3607 25.6668 29.084C26.0815 29.636 26.865 29.7473 27.4172 29.3328C27.9692 28.9182 28.0805 28.1347 27.6658 27.5825C25.9198 25.2577 23.1357 23.75 19.9997 23.75C16.8638 23.75 14.0797 25.2577 12.3336 27.5825C11.919 28.1347 12.0304 28.9182 12.5824 29.3328Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ n.createElement("path", { d: "M28.4449 13.7707C29.1324 13.8328 29.64 14.4406 29.578 15.1281C29.516 15.8153 28.909 16.3221 28.2219 16.2608C28.2219 16.2608 28.0282 16.2502 27.9267 16.2487C27.7224 16.2457 27.4382 16.2509 27.1224 16.2833C26.7864 16.3177 26.4644 16.3782 26.1799 16.4662L26.304 16.86C26.7792 18.3675 25.5094 19.5813 24.2057 19.5813C23.504 19.5813 22.8319 19.2617 22.4295 18.6857C22.0025 18.0745 21.9417 17.241 22.4075 16.5344C22.7505 16.0143 23.2444 15.3831 23.8959 14.8657C24.8355 14.1195 26.0435 13.8809 26.867 13.7963C27.3024 13.7517 28.0149 13.7319 28.4449 13.7707Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ n.createElement("path", { d: "M11.5553 13.7707C10.8677 13.8328 10.3601 14.4406 10.4221 15.1281C10.4842 15.8153 11.0912 16.3221 11.7782 16.2608C11.7782 16.2608 11.972 16.2502 12.0734 16.2487C12.2778 16.2457 12.562 16.2509 12.8778 16.2833C13.2137 16.3177 13.5357 16.3782 13.8203 16.4662L13.6962 16.86C13.2209 18.3675 14.4907 19.5813 15.7944 19.5813C16.4962 19.5813 17.1683 19.2617 17.5707 18.6857C17.9975 18.0745 18.0585 17.241 17.5925 16.5344C17.2497 16.0143 16.7557 15.3831 16.1043 14.8657C15.1646 14.1195 13.9566 13.8809 13.1331 13.7963C12.6978 13.7517 11.9853 13.7319 11.5553 13.7707Z", fill: "black", fillOpacity: 0.12 })), ss = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.08337 19.9999C2.08337 10.1048 10.1049 2.08325 20 2.08325C29.8952 2.08325 37.9167 10.1048 37.9167 19.9999C37.9167 29.8951 29.8952 37.9166 20 37.9166C10.1049 37.9166 2.08337 29.8951 2.08337 19.9999Z", fill: "url(#paint0_linear_159_173206)" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5828 29.3328C13.1348 29.7473 13.9184 29.636 14.3329 29.084C15.6272 27.3607 17.6839 26.25 20 26.25C22.3164 26.25 24.373 27.3607 25.6672 29.084C26.0819 29.636 26.8654 29.7473 27.4175 29.3328C27.9695 28.9182 28.0809 28.1347 27.6662 27.5825C25.9202 25.2577 23.136 23.75 20 23.75C16.8642 23.75 14.0801 25.2577 12.334 27.5825C11.9194 28.1347 12.0308 28.9182 12.5828 29.3328Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { d: "M28.4454 13.7707C29.1329 13.8328 29.6405 14.4406 29.5785 15.1281C29.5165 15.8153 28.9095 16.3221 28.2224 16.2608C28.2224 16.2608 28.0287 16.2502 27.9272 16.2487C27.7229 16.2457 27.4387 16.2509 27.1229 16.2833C26.7869 16.3177 26.4649 16.3782 26.1804 16.4662L26.3045 16.86C26.7797 18.3675 25.5099 19.5813 24.2062 19.5813C23.5045 19.5813 22.8324 19.2617 22.43 18.6857C22.003 18.0745 21.9422 17.241 22.408 16.5344C22.751 16.0143 23.2449 15.3831 23.8964 14.8657C24.836 14.1195 26.044 13.8809 26.8675 13.7963C27.3029 13.7517 28.0154 13.7319 28.4454 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { d: "M11.5549 13.7707C10.8674 13.8328 10.3597 14.4406 10.4218 15.1281C10.4838 15.8153 11.0908 16.3221 11.7779 16.2608C11.7779 16.2608 11.9716 16.2502 12.073 16.2487C12.2774 16.2457 12.5616 16.2509 12.8774 16.2833C13.2134 16.3177 13.5353 16.3782 13.8199 16.4662L13.6958 16.86C13.2205 18.3675 14.4904 19.5813 15.794 19.5813C16.4958 19.5813 17.168 19.2617 17.5703 18.6857C17.9971 18.0745 18.0581 17.241 17.5921 16.5344C17.2493 16.0143 16.7553 15.3831 16.1039 14.8657C15.1643 14.1195 13.9562 13.8809 13.1327 13.7963C12.6974 13.7517 11.9849 13.7319 11.5549 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("defs", null, /* @__PURE__ */ n.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ n.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ n.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), is = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { d: "M15 28.333C16.3927 27.2867 18.124 26.6667 20 26.6667C21.876 26.6667 23.6073 27.2867 25 28.333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("path", { d: "M11.667 13.3511C11.667 13.3511 14.0161 13.139 15.3268 14.18M15.3268 14.18L14.8882 15.5711C14.7153 16.1199 15.1675 16.6667 15.7943 16.6667C16.4531 16.6667 16.8882 16.0723 16.549 15.5579C16.2483 15.102 15.8388 14.5866 15.3268 14.18ZM23.3337 13.3511C23.3337 13.3511 25.6827 13.139 26.9935 14.18M26.9935 14.18L26.555 15.5711C26.382 16.1199 26.8342 16.6667 27.461 16.6667C28.1198 16.6667 28.5548 16.0723 28.2157 15.5579C27.915 15.102 27.5055 14.5866 26.9935 14.18Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), ls = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ n.createElement("path", { d: "M14.249 27.334C15.851 26.13 17.844 25.417 20 25.417c2.156 0 4.149.714 5.751 1.917.553.415.664 1.199.25 1.751-.415.552-1.199.664-1.751.25-1.183-.889-2.652-1.416-4.25-1.416s-3.067.527-4.25 1.416c-.553.414-1.336.302-1.751-.25-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { d: "M23.445 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.125-.394c-.285-.088-.607-.148-.942-.182-.316-.033-.6-.038-.804-.035-.101.002-.242.01-.294.013Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { d: "M11.779 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.124-.394c-.284-.088-.606-.148-.941-.182-.316-.033-.6-.038-.804-.035-.101.002-.243.01-.294.013Z", fill: "#141B34" })), cs = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), ds = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.75 26.667c0-.691.56-1.25 1.25-1.25h10c.69 0 1.25.559 1.25 1.25 0 .691-.56 1.25-1.25 1.25h-10c-.69 0-1.25-.559-1.25-1.25Z", fill: "#141B34" })), us = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { d: "M13.333 25C14.8532 27.024 17.2735 28.3333 19.9997 28.3333C22.7258 28.3333 25.1462 27.024 26.6663 25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), ms = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.583 24.001c.552-.414 1.335-.302 1.75.25 1.294 1.723 3.35 2.834 5.667 2.834s4.373-1.11 5.667-2.834c.415-.552 1.199-.664 1.751-.25.552.415.664 1.199.25 1.751C25.92 28.076 23.136 29.584 20 29.584s-5.92-1.508-7.666-3.832c-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" })), ps = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M19.9997 36.6663C29.2044 36.6663 36.6663 29.2044 36.6663 19.9997C36.6663 10.7949 29.2044 3.33301 19.9997 3.33301C10.7949 3.33301 3.33301 10.7949 3.33301 19.9997C3.33301 29.2044 10.7949 36.6663 19.9997 36.6663Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { d: "M19.9997 30C23.16 30 25.8145 27.867 26.56 24.9832C26.9068 23.6413 26.4033 23.3333 25.0765 23.3333H14.9228C13.5959 23.3333 13.0925 23.6413 13.4393 24.9832C14.1848 27.867 16.8393 30 19.9997 30Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("path", { d: "M11.667 15.8333C11.667 14.4526 12.7863 13.3333 14.167 13.3333C15.5477 13.3333 16.667 14.4526 16.667 15.8333M23.3337 15.8333C23.3337 14.4526 24.453 13.3333 25.8337 13.3333C27.2143 13.3333 28.3337 14.4526 28.3337 15.8333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), gs = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ n.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ n.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ n.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ n.createElement("mask", { id: "mask0_159_173224", style: {
|
|
1455
|
+
return /* @__PURE__ */ n.createElement(pi, { onClick: e, disabled: o }, /* @__PURE__ */ n.createElement($, { size: 24, type: t ? "radio-on" : "radio-off", color: a }), /* @__PURE__ */ n.createElement(S, { variant: "caption2", color: s }, r));
|
|
1456
|
+
}, mi = c.div`display:flex;flex-direction:column;gap:8px;`, pi = c.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, gi = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.08301 20C2.08301 10.1049 10.1046 2.08334 19.9997 2.08334C29.8948 2.08334 37.9163 10.1049 37.9163 20C37.9163 29.8952 29.8948 37.9167 19.9997 37.9167C10.1046 37.9167 2.08301 29.8952 2.08301 20Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5824 29.3328C13.1344 29.7473 13.918 29.636 14.3326 29.084C15.6269 27.3607 17.6835 26.25 19.9997 26.25C22.316 26.25 24.3727 27.3607 25.6668 29.084C26.0815 29.636 26.865 29.7473 27.4172 29.3328C27.9692 28.9182 28.0805 28.1347 27.6658 27.5825C25.9198 25.2577 23.1357 23.75 19.9997 23.75C16.8638 23.75 14.0797 25.2577 12.3336 27.5825C11.919 28.1347 12.0304 28.9182 12.5824 29.3328Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ n.createElement("path", { d: "M28.4449 13.7707C29.1324 13.8328 29.64 14.4406 29.578 15.1281C29.516 15.8153 28.909 16.3221 28.2219 16.2608C28.2219 16.2608 28.0282 16.2502 27.9267 16.2487C27.7224 16.2457 27.4382 16.2509 27.1224 16.2833C26.7864 16.3177 26.4644 16.3782 26.1799 16.4662L26.304 16.86C26.7792 18.3675 25.5094 19.5813 24.2057 19.5813C23.504 19.5813 22.8319 19.2617 22.4295 18.6857C22.0025 18.0745 21.9417 17.241 22.4075 16.5344C22.7505 16.0143 23.2444 15.3831 23.8959 14.8657C24.8355 14.1195 26.0435 13.8809 26.867 13.7963C27.3024 13.7517 28.0149 13.7319 28.4449 13.7707Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ n.createElement("path", { d: "M11.5553 13.7707C10.8677 13.8328 10.3601 14.4406 10.4221 15.1281C10.4842 15.8153 11.0912 16.3221 11.7782 16.2608C11.7782 16.2608 11.972 16.2502 12.0734 16.2487C12.2778 16.2457 12.562 16.2509 12.8778 16.2833C13.2137 16.3177 13.5357 16.3782 13.8203 16.4662L13.6962 16.86C13.2209 18.3675 14.4907 19.5813 15.7944 19.5813C16.4962 19.5813 17.1683 19.2617 17.5707 18.6857C17.9975 18.0745 18.0585 17.241 17.5925 16.5344C17.2497 16.0143 16.7557 15.3831 16.1043 14.8657C15.1646 14.1195 13.9566 13.8809 13.1331 13.7963C12.6978 13.7517 11.9853 13.7319 11.5553 13.7707Z", fill: "black", fillOpacity: 0.12 })), hi = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.08337 19.9999C2.08337 10.1048 10.1049 2.08325 20 2.08325C29.8952 2.08325 37.9167 10.1048 37.9167 19.9999C37.9167 29.8951 29.8952 37.9166 20 37.9166C10.1049 37.9166 2.08337 29.8951 2.08337 19.9999Z", fill: "url(#paint0_linear_159_173206)" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5828 29.3328C13.1348 29.7473 13.9184 29.636 14.3329 29.084C15.6272 27.3607 17.6839 26.25 20 26.25C22.3164 26.25 24.373 27.3607 25.6672 29.084C26.0819 29.636 26.8654 29.7473 27.4175 29.3328C27.9695 28.9182 28.0809 28.1347 27.6662 27.5825C25.9202 25.2577 23.136 23.75 20 23.75C16.8642 23.75 14.0801 25.2577 12.334 27.5825C11.9194 28.1347 12.0308 28.9182 12.5828 29.3328Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { d: "M28.4454 13.7707C29.1329 13.8328 29.6405 14.4406 29.5785 15.1281C29.5165 15.8153 28.9095 16.3221 28.2224 16.2608C28.2224 16.2608 28.0287 16.2502 27.9272 16.2487C27.7229 16.2457 27.4387 16.2509 27.1229 16.2833C26.7869 16.3177 26.4649 16.3782 26.1804 16.4662L26.3045 16.86C26.7797 18.3675 25.5099 19.5813 24.2062 19.5813C23.5045 19.5813 22.8324 19.2617 22.43 18.6857C22.003 18.0745 21.9422 17.241 22.408 16.5344C22.751 16.0143 23.2449 15.3831 23.8964 14.8657C24.836 14.1195 26.044 13.8809 26.8675 13.7963C27.3029 13.7517 28.0154 13.7319 28.4454 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { d: "M11.5549 13.7707C10.8674 13.8328 10.3597 14.4406 10.4218 15.1281C10.4838 15.8153 11.0908 16.3221 11.7779 16.2608C11.7779 16.2608 11.9716 16.2502 12.073 16.2487C12.2774 16.2457 12.5616 16.2509 12.8774 16.2833C13.2134 16.3177 13.5353 16.3782 13.8199 16.4662L13.6958 16.86C13.2205 18.3675 14.4904 19.5813 15.794 19.5813C16.4958 19.5813 17.168 19.2617 17.5703 18.6857C17.9971 18.0745 18.0581 17.241 17.5921 16.5344C17.2493 16.0143 16.7553 15.3831 16.1039 14.8657C15.1643 14.1195 13.9562 13.8809 13.1327 13.7963C12.6974 13.7517 11.9849 13.7319 11.5549 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("defs", null, /* @__PURE__ */ n.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ n.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ n.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), fi = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { d: "M15 28.333C16.3927 27.2867 18.124 26.6667 20 26.6667C21.876 26.6667 23.6073 27.2867 25 28.333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("path", { d: "M11.667 13.3511C11.667 13.3511 14.0161 13.139 15.3268 14.18M15.3268 14.18L14.8882 15.5711C14.7153 16.1199 15.1675 16.6667 15.7943 16.6667C16.4531 16.6667 16.8882 16.0723 16.549 15.5579C16.2483 15.102 15.8388 14.5866 15.3268 14.18ZM23.3337 13.3511C23.3337 13.3511 25.6827 13.139 26.9935 14.18M26.9935 14.18L26.555 15.5711C26.382 16.1199 26.8342 16.6667 27.461 16.6667C28.1198 16.6667 28.5548 16.0723 28.2157 15.5579C27.915 15.102 27.5055 14.5866 26.9935 14.18Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), bi = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ n.createElement("path", { d: "M14.249 27.334C15.851 26.13 17.844 25.417 20 25.417c2.156 0 4.149.714 5.751 1.917.553.415.664 1.199.25 1.751-.415.552-1.199.664-1.751.25-1.183-.889-2.652-1.416-4.25-1.416s-3.067.527-4.25 1.416c-.553.414-1.336.302-1.751-.25-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { d: "M23.445 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.125-.394c-.285-.088-.607-.148-.942-.182-.316-.033-.6-.038-.804-.035-.101.002-.242.01-.294.013Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { d: "M11.779 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.124-.394c-.284-.088-.606-.148-.941-.182-.316-.033-.6-.038-.804-.035-.101.002-.243.01-.294.013Z", fill: "#141B34" })), Ei = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), xi = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.75 26.667c0-.691.56-1.25 1.25-1.25h10c.69 0 1.25.559 1.25 1.25 0 .691-.56 1.25-1.25 1.25h-10c-.69 0-1.25-.559-1.25-1.25Z", fill: "#141B34" })), vi = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { d: "M13.333 25C14.8532 27.024 17.2735 28.3333 19.9997 28.3333C22.7258 28.3333 25.1462 27.024 26.6663 25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), yi = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.583 24.001c.552-.414 1.335-.302 1.75.25 1.294 1.723 3.35 2.834 5.667 2.834s4.373-1.11 5.667-2.834c.415-.552 1.199-.664 1.751-.25.552.415.664 1.199.25 1.751C25.92 28.076 23.136 29.584 20 29.584s-5.92-1.508-7.666-3.832c-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" })), Ci = (e) => /* @__PURE__ */ n.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M19.9997 36.6663C29.2044 36.6663 36.6663 29.2044 36.6663 19.9997C36.6663 10.7949 29.2044 3.33301 19.9997 3.33301C10.7949 3.33301 3.33301 10.7949 3.33301 19.9997C3.33301 29.2044 10.7949 36.6663 19.9997 36.6663Z", fill: "#E0E0E0" }), /* @__PURE__ */ n.createElement("path", { d: "M19.9997 30C23.16 30 25.8145 27.867 26.56 24.9832C26.9068 23.6413 26.4033 23.3333 25.0765 23.3333H14.9228C13.5959 23.3333 13.0925 23.6413 13.4393 24.9832C14.1848 27.867 16.8393 30 19.9997 30Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("path", { d: "M11.667 15.8333C11.667 14.4526 12.7863 13.3333 14.167 13.3333C15.5477 13.3333 16.667 14.4526 16.667 15.8333M23.3337 15.8333C23.3337 14.4526 24.453 13.3333 25.8337 13.3333C27.2143 13.3333 28.3337 14.4526 28.3337 15.8333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), _i = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ n.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ n.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ n.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ n.createElement("mask", { id: "mask0_159_173224", style: {
|
|
1345
1457
|
maskType: "alpha"
|
|
1346
|
-
}, maskUnits: "userSpaceOnUse", x: 12, y: 22, width: 16, height: 9 }, /* @__PURE__ */ n.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ n.createElement("g", { mask: "url(#mask0_159_173224)" }, /* @__PURE__ */ n.createElement("path", { d: "M20 32.998c3.278 0 5.936-1.594 5.936-3.561 0-1.968-2.658-3.562-5.936-3.562-3.278 0-5.936 1.594-5.936 3.562 0 1.967 2.658 3.561 5.936 3.561Z", fill: "#FF493B" }))), /* @__PURE__ */ n.createElement("path", { d: "M11.667 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5M23.333 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5", stroke: "#141B34", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("defs", null, /* @__PURE__ */ n.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ n.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ n.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ n.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })))),
|
|
1458
|
+
}, maskUnits: "userSpaceOnUse", x: 12, y: 22, width: 16, height: 9 }, /* @__PURE__ */ n.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ n.createElement("g", { mask: "url(#mask0_159_173224)" }, /* @__PURE__ */ n.createElement("path", { d: "M20 32.998c3.278 0 5.936-1.594 5.936-3.561 0-1.968-2.658-3.562-5.936-3.562-3.278 0-5.936 1.594-5.936 3.562 0 1.967 2.658 3.561 5.936 3.561Z", fill: "#FF493B" }))), /* @__PURE__ */ n.createElement("path", { d: "M11.667 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5M23.333 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5", stroke: "#141B34", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ n.createElement("defs", null, /* @__PURE__ */ n.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ n.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ n.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ n.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })))), Ti = [
|
|
1347
1459
|
{
|
|
1348
1460
|
value: 1,
|
|
1349
1461
|
Icon: {
|
|
1350
|
-
Active:
|
|
1351
|
-
Inactive:
|
|
1462
|
+
Active: hi,
|
|
1463
|
+
Inactive: gi
|
|
1352
1464
|
},
|
|
1353
1465
|
isActive: (e) => e <= 1,
|
|
1354
1466
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_1
|
|
@@ -1356,8 +1468,8 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1356
1468
|
{
|
|
1357
1469
|
value: 2,
|
|
1358
1470
|
Icon: {
|
|
1359
|
-
Active:
|
|
1360
|
-
Inactive:
|
|
1471
|
+
Active: bi,
|
|
1472
|
+
Inactive: fi
|
|
1361
1473
|
},
|
|
1362
1474
|
isActive: (e) => e === 2,
|
|
1363
1475
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_2
|
|
@@ -1365,8 +1477,8 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1365
1477
|
{
|
|
1366
1478
|
value: 3,
|
|
1367
1479
|
Icon: {
|
|
1368
|
-
Active:
|
|
1369
|
-
Inactive:
|
|
1480
|
+
Active: xi,
|
|
1481
|
+
Inactive: Ei
|
|
1370
1482
|
},
|
|
1371
1483
|
isActive: (e) => e === 3,
|
|
1372
1484
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_3
|
|
@@ -1374,8 +1486,8 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1374
1486
|
{
|
|
1375
1487
|
value: 4,
|
|
1376
1488
|
Icon: {
|
|
1377
|
-
Active:
|
|
1378
|
-
Inactive:
|
|
1489
|
+
Active: yi,
|
|
1490
|
+
Inactive: vi
|
|
1379
1491
|
},
|
|
1380
1492
|
isActive: (e) => e === 4,
|
|
1381
1493
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_4
|
|
@@ -1383,16 +1495,16 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1383
1495
|
{
|
|
1384
1496
|
value: 5,
|
|
1385
1497
|
Icon: {
|
|
1386
|
-
Active:
|
|
1387
|
-
Inactive:
|
|
1498
|
+
Active: _i,
|
|
1499
|
+
Inactive: Ci
|
|
1388
1500
|
},
|
|
1389
1501
|
isActive: (e) => 5 <= e,
|
|
1390
1502
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_5
|
|
1391
1503
|
}
|
|
1392
|
-
],
|
|
1393
|
-
const [a, s] =
|
|
1394
|
-
return o ? t : /* @__PURE__ */ n.createElement("div", { style: { position: "relative" }, onMouseEnter: () => s(!0), onMouseLeave: () => s(!1) }, t, /* @__PURE__ */ n.createElement(
|
|
1395
|
-
},
|
|
1504
|
+
], Si = () => Ti, Ln = ({ label: e, children: t, position: r = "top", disabled: o }) => {
|
|
1505
|
+
const [a, s] = y(!1);
|
|
1506
|
+
return o ? t : /* @__PURE__ */ n.createElement("div", { style: { position: "relative" }, onMouseEnter: () => s(!0), onMouseLeave: () => s(!1) }, t, /* @__PURE__ */ n.createElement(Ai, { $visible: a, $position: r }, /* @__PURE__ */ n.createElement(Ii, { variant: "caption1" }, e), /* @__PURE__ */ n.createElement(wi, { $position: r })));
|
|
1507
|
+
}, wi = ({ $position: e }) => /* @__PURE__ */ n.createElement(
|
|
1396
1508
|
"svg",
|
|
1397
1509
|
{
|
|
1398
1510
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -1403,13 +1515,13 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1403
1515
|
fill: "none"
|
|
1404
1516
|
},
|
|
1405
1517
|
/* @__PURE__ */ n.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill: d.themedColor.oncontent_inverse1 })
|
|
1406
|
-
),
|
|
1518
|
+
), ki = {
|
|
1407
1519
|
top: k`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
1408
1520
|
bottom: k`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
1409
|
-
},
|
|
1410
|
-
const { stringSet: o } = M(), a =
|
|
1411
|
-
return /* @__PURE__ */ n.createElement(
|
|
1412
|
-
|
|
1521
|
+
}, Ai = c.div`display:${({ $visible: e }) => e ? "flex" : "none"};align-items:center;position:absolute;left:50%;z-index:${ge.TOOLTIP};${({ $position: e }) => ki[e]}`, Ii = c(S)`padding:6px 8px;color:${d.themedColor.oncontent1};background:${d.themedColor.oncontent_inverse1};border-radius:4px;font-size:12px;white-space:nowrap;`, $i = ({ submitted: e, value: t, onChange: r }) => {
|
|
1522
|
+
const { stringSet: o } = M(), a = Si(), s = typeof t == "number";
|
|
1523
|
+
return /* @__PURE__ */ n.createElement(Mi, null, /* @__PURE__ */ n.createElement(S, { variant: "caption2", color: d.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ n.createElement(Oi, null, a.map((i) => /* @__PURE__ */ n.createElement(Ln, { disabled: e, key: i.value, label: i.getTooltip(o) }, /* @__PURE__ */ n.createElement(
|
|
1524
|
+
Ri,
|
|
1413
1525
|
{
|
|
1414
1526
|
disabled: e,
|
|
1415
1527
|
onClick: () => r(i.value),
|
|
@@ -1417,16 +1529,16 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1417
1529
|
},
|
|
1418
1530
|
s ? i.isActive(t) ? /* @__PURE__ */ n.createElement(i.Icon.Active, null) : /* @__PURE__ */ n.createElement(i.Icon.Inactive, null) : /* @__PURE__ */ n.createElement(i.Icon.Active, null)
|
|
1419
1531
|
)))));
|
|
1420
|
-
},
|
|
1532
|
+
}, Mi = c.div`display:flex;flex-direction:column;gap:8px;`, Oi = c.div`display:flex;justify-content:space-between;width:100%;max-width:320px;`, Ri = c.button`background-color:transparent;border:none;border-radius:4px;padding:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box;&:enabled:hover{cursor:pointer;background-color:${d.color.background200};${U.dark`
|
|
1421
1533
|
background-color: ${d.color.background500};
|
|
1422
1534
|
`}
|
|
1423
1535
|
}
|
|
1424
1536
|
|
|
1425
|
-
${({ $inactive: e, theme: t }) => e && t.selected === "dark" &&
|
|
1426
|
-
`,
|
|
1537
|
+
${({ $inactive: e, theme: t }) => e && t.selected === "dark" && Li};
|
|
1538
|
+
`, Li = k`[fill]{fill:white;fill-opacity:0.12;}[stroke]{stroke:white;stroke-opacity:0.12;}`, Ni = ({ submitted: e, value: t = "", onChange: r }) => {
|
|
1427
1539
|
const { stringSet: o } = M();
|
|
1428
1540
|
return e && !t ? null : /* @__PURE__ */ n.createElement(
|
|
1429
|
-
|
|
1541
|
+
Bi,
|
|
1430
1542
|
{
|
|
1431
1543
|
disabled: e,
|
|
1432
1544
|
maxLength: 255,
|
|
@@ -1435,7 +1547,7 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1435
1547
|
placeholder: o.CSAT_REASON_PLACEHOLDER
|
|
1436
1548
|
}
|
|
1437
1549
|
);
|
|
1438
|
-
},
|
|
1550
|
+
}, Bi = c.input`box-sizing:border-box;width:100%;border-radius:4px;padding:10px 16px;font-size:14px;font-weight:400;font-style:normal;border:unset;&:focus{outline:none;}color:${d.themedColor.textHighEmphasis};&::placeholder{color:${d.themedColor.onbackground3};}background-color:${d.color.background50};${U.dark`
|
|
1439
1551
|
background-color: ${d.themedColor.textDisabled};
|
|
1440
1552
|
`}
|
|
1441
1553
|
|
|
@@ -1443,88 +1555,88 @@ const es = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
1443
1555
|
cursor: not-allowed;
|
|
1444
1556
|
color: ${d.themedColor.textLowEmphasis};
|
|
1445
1557
|
background-color: ${d.color.background200};
|
|
1446
|
-
${
|
|
1558
|
+
${U.dark`
|
|
1447
1559
|
color: ${d.color.ondark04};
|
|
1448
1560
|
background-color: ${d.themedColor.textDisabled};
|
|
1449
1561
|
`}
|
|
1450
1562
|
}
|
|
1451
|
-
`,
|
|
1563
|
+
`, Di = ({ submitted: e }) => {
|
|
1452
1564
|
const { stringSet: t } = M();
|
|
1453
|
-
return e ? /* @__PURE__ */ n.createElement(
|
|
1565
|
+
return e ? /* @__PURE__ */ n.createElement(S, { variant: "h2", color: d.themedColor.onbackground1 }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ n.createElement(S, { variant: "h2", color: d.themedColor.onbackground1 }, t.CSAT_TITLE_UNSUBMITTED);
|
|
1454
1566
|
};
|
|
1455
|
-
var
|
|
1456
|
-
const
|
|
1567
|
+
var ce = /* @__PURE__ */ ((e) => (e.AI_AGENT_CSAT_5 = "AI_AGENT_CSAT_5", e.AI_AGENT_CSAT_5_WITH_CRE = "AI_AGENT_CSAT_5_WITH_CRE", e))(ce || {});
|
|
1568
|
+
const Pi = (e) => ir((t, r) => ({ ...t, ...r }), e), Ht = ({
|
|
1457
1569
|
type: e,
|
|
1458
1570
|
renderSubmitButton: t,
|
|
1459
1571
|
initialCsat: r,
|
|
1460
1572
|
initialCsatReason: o,
|
|
1461
1573
|
initialIsResolved: a
|
|
1462
1574
|
}) => {
|
|
1463
|
-
const [s, i] =
|
|
1575
|
+
const [s, i] = Pi({
|
|
1464
1576
|
csatType: e,
|
|
1465
1577
|
csat: r,
|
|
1466
1578
|
csatReason: o,
|
|
1467
1579
|
isResolved: a
|
|
1468
|
-
}), l = typeof r == "number" ? "submitted" : e ===
|
|
1469
|
-
return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
1470
|
-
|
|
1580
|
+
}), l = typeof r == "number" ? "submitted" : e === ce.AI_AGENT_CSAT_5 && typeof s.csat == "number" || e === ce.AI_AGENT_CSAT_5_WITH_CRE && typeof s.csat == "number" && typeof s.isResolved == "boolean" ? "submittable" : "unsubmittable", u = { state: l, submitted: l === "submitted" };
|
|
1581
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(Fi, null, /* @__PURE__ */ n.createElement(Di, { ...u }), e === ce.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ n.createElement(
|
|
1582
|
+
ui,
|
|
1471
1583
|
{
|
|
1472
1584
|
...u,
|
|
1473
1585
|
defaultValue: a,
|
|
1474
1586
|
value: s.isResolved,
|
|
1475
|
-
onChange: (
|
|
1587
|
+
onChange: (p) => i({ isResolved: p })
|
|
1476
1588
|
}
|
|
1477
|
-
), /* @__PURE__ */ n.createElement(
|
|
1478
|
-
|
|
1589
|
+
), /* @__PURE__ */ n.createElement($i, { ...u, value: s.csat, onChange: (p) => i({ csat: p }) }), s.csat && /* @__PURE__ */ n.createElement(
|
|
1590
|
+
Ni,
|
|
1479
1591
|
{
|
|
1480
1592
|
...u,
|
|
1481
1593
|
value: s.csatReason,
|
|
1482
|
-
onChange: (
|
|
1594
|
+
onChange: (p) => i({ csatReason: p })
|
|
1483
1595
|
}
|
|
1484
1596
|
)), l !== "submitted" && t({ state: l, params: s }));
|
|
1485
|
-
},
|
|
1597
|
+
}, Fi = c.div`display:flex;flex-direction:column;gap:12px;`, Ui = () => {
|
|
1486
1598
|
const { stringSet: e } = M();
|
|
1487
|
-
return /* @__PURE__ */ n.createElement(
|
|
1488
|
-
},
|
|
1599
|
+
return /* @__PURE__ */ n.createElement(S, { variant: "body2", color: d.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
|
|
1600
|
+
}, Vi = (e) => {
|
|
1489
1601
|
if (e.messageType !== "admin.csat")
|
|
1490
1602
|
throw new Error("Invalid message type");
|
|
1491
|
-
const t =
|
|
1492
|
-
if (!
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1495
|
-
csatType:
|
|
1496
|
-
csat:
|
|
1497
|
-
csatReason:
|
|
1498
|
-
isResolved:
|
|
1603
|
+
const t = Ar(), { stringSet: r } = M(), { extendedMessagePayload: o, csat: a, csatReason: s, csatExpireAt: i, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: u } = e, { visibility: p, type: m } = (o == null ? void 0 : o.csat) ?? {};
|
|
1604
|
+
if (!p || !m || !ce[m]) return null;
|
|
1605
|
+
const h = m === ce.AI_AGENT_CSAT_5 || m === ce.AI_AGENT_CSAT_5_WITH_CRE ? Ht : () => null, g = (b) => {
|
|
1606
|
+
b.csat && !zt(i) ? u({
|
|
1607
|
+
csatType: b.csatType,
|
|
1608
|
+
csat: b.csat,
|
|
1609
|
+
csatReason: b.csatReason,
|
|
1610
|
+
isResolved: b.isResolved
|
|
1499
1611
|
}) : t();
|
|
1500
1612
|
};
|
|
1501
|
-
return /* @__PURE__ */ n.createElement(
|
|
1502
|
-
|
|
1613
|
+
return /* @__PURE__ */ n.createElement(Hi, null, !a && zt(i) ? /* @__PURE__ */ n.createElement(Ui, null) : /* @__PURE__ */ n.createElement(
|
|
1614
|
+
h,
|
|
1503
1615
|
{
|
|
1504
|
-
type:
|
|
1616
|
+
type: m,
|
|
1505
1617
|
initialCsat: a,
|
|
1506
1618
|
initialCsatReason: s,
|
|
1507
1619
|
initialIsResolved: l,
|
|
1508
|
-
renderSubmitButton: ({ state:
|
|
1620
|
+
renderSubmitButton: ({ state: b, params: E }) => /* @__PURE__ */ n.createElement(zi, { disabled: b !== "submittable", onClick: () => g(E) }, /* @__PURE__ */ n.createElement(S, { variant: "button" }, r.CSAT_SUBMIT_LABEL))
|
|
1509
1621
|
}
|
|
1510
1622
|
));
|
|
1511
|
-
},
|
|
1512
|
-
function
|
|
1623
|
+
}, Hi = c.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, zi = c.button`all:unset;background-color:${({ theme: e }) => e.colors.base.primary};color:${({ theme: e }) => e.colors.base.primaryContrastContent};border-radius:6px;padding:10px 20px;display:flex;align-items:center;justify-content:center;cursor:pointer;&:hover{background-color:${d.color.primary.dark};}&:disabled{color:${d.color.ondark03};background-color:${d.themedColor.textDisabled};cursor:not-allowed;}`;
|
|
1624
|
+
function zt(e) {
|
|
1513
1625
|
return !!e && e < Date.now();
|
|
1514
1626
|
}
|
|
1515
|
-
const
|
|
1516
|
-
template:
|
|
1627
|
+
const yt = ut({
|
|
1628
|
+
template: Wi,
|
|
1517
1629
|
components: {
|
|
1518
|
-
AdminMessage:
|
|
1519
|
-
CSATMessage:
|
|
1630
|
+
AdminMessage: li,
|
|
1631
|
+
CSATMessage: Vi
|
|
1520
1632
|
}
|
|
1521
1633
|
});
|
|
1522
|
-
function
|
|
1523
|
-
const { components: t } =
|
|
1524
|
-
return /* @__PURE__ */ n.createElement(
|
|
1634
|
+
function Wi(e) {
|
|
1635
|
+
const { components: t } = yt.useContext(), r = $n(() => e.messageType === "admin" ? /* @__PURE__ */ n.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ n.createElement(t.CSATMessage, { ...e }) : null);
|
|
1636
|
+
return /* @__PURE__ */ n.createElement(Gi, { $marginBottom: ht(e.groupType) }, r);
|
|
1525
1637
|
}
|
|
1526
|
-
const
|
|
1527
|
-
function
|
|
1638
|
+
const Gi = c.div`padding-inline:${q}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, ji = Ho``, Ki = Nr(pe, vt, yt);
|
|
1639
|
+
function Zi({
|
|
1528
1640
|
appearance: e,
|
|
1529
1641
|
rootElement: t,
|
|
1530
1642
|
logger: r,
|
|
@@ -1533,15 +1645,50 @@ function Fs({
|
|
|
1533
1645
|
children: s,
|
|
1534
1646
|
messageTemplate: i
|
|
1535
1647
|
}) {
|
|
1536
|
-
var u,
|
|
1648
|
+
var u, p;
|
|
1649
|
+
Fo(go, t);
|
|
1537
1650
|
const l = ve(() => {
|
|
1538
|
-
const
|
|
1539
|
-
return typeof
|
|
1651
|
+
const m = {}, { carousel_padding_left: h, carousel_padding_right: g } = (i == null ? void 0 : i.__internalVariables) || {}, b = h, E = g;
|
|
1652
|
+
return typeof b == "number" && (m.carousel_padding_left = b), typeof E == "number" && (m.carousel_padding_right = E), Object.keys(m).length > 0 ? m : void 0;
|
|
1540
1653
|
}, [
|
|
1541
1654
|
(u = i == null ? void 0 : i.__internalVariables) == null ? void 0 : u.carousel_padding_left,
|
|
1542
|
-
(
|
|
1655
|
+
(p = i == null ? void 0 : i.__internalVariables) == null ? void 0 : p.carousel_padding_right
|
|
1543
1656
|
]);
|
|
1544
|
-
return /* @__PURE__ */ n.createElement(
|
|
1657
|
+
return /* @__PURE__ */ n.createElement(br, { target: t }, /* @__PURE__ */ n.createElement(Ao, { rootElement: t, logger: r, appearance: e }, /* @__PURE__ */ n.createElement(io, { internalVariables: l }, /* @__PURE__ */ n.createElement(Do, { stringSet: a, logger: r, language: o }, /* @__PURE__ */ n.createElement(Ki, null, s, /* @__PURE__ */ n.createElement(ji, null))))));
|
|
1658
|
+
}
|
|
1659
|
+
const {
|
|
1660
|
+
Provider: Yi,
|
|
1661
|
+
Consumer: Nn,
|
|
1662
|
+
useContext: B
|
|
1663
|
+
} = j("Agent");
|
|
1664
|
+
function qi({
|
|
1665
|
+
children: e,
|
|
1666
|
+
state: t,
|
|
1667
|
+
enableCloseConversationButton: r = !1,
|
|
1668
|
+
enableExpandButton: o = !0,
|
|
1669
|
+
enableAutoDisconnectInLauncher: a = !0,
|
|
1670
|
+
...s
|
|
1671
|
+
}) {
|
|
1672
|
+
const i = Ze(), [l, u] = y(!1), [p, m] = y(!1), h = {
|
|
1673
|
+
opened: (t == null ? void 0 : t.opened) ?? l,
|
|
1674
|
+
setOpened: (t == null ? void 0 : t.setOpened) ?? u,
|
|
1675
|
+
expanded: (t == null ? void 0 : t.expanded) ?? p,
|
|
1676
|
+
setExpanded: (t == null ? void 0 : t.setExpanded) ?? m
|
|
1677
|
+
};
|
|
1678
|
+
return /* @__PURE__ */ n.createElement(
|
|
1679
|
+
Yi,
|
|
1680
|
+
{
|
|
1681
|
+
value: {
|
|
1682
|
+
...s,
|
|
1683
|
+
...i,
|
|
1684
|
+
state: h,
|
|
1685
|
+
enableCloseConversationButton: r,
|
|
1686
|
+
enableExpandButton: o,
|
|
1687
|
+
enableAutoDisconnectInLauncher: a
|
|
1688
|
+
}
|
|
1689
|
+
},
|
|
1690
|
+
e
|
|
1691
|
+
);
|
|
1545
1692
|
}
|
|
1546
1693
|
const Wt = {
|
|
1547
1694
|
key_payment_plan_container: {
|
|
@@ -1728,56 +1875,26 @@ const Wt = {
|
|
|
1728
1875
|
}
|
|
1729
1876
|
}
|
|
1730
1877
|
}
|
|
1731
|
-
},
|
|
1732
|
-
function Us({
|
|
1733
|
-
children: e,
|
|
1734
|
-
state: t,
|
|
1735
|
-
enableCloseConversationButton: r = !1,
|
|
1736
|
-
enableExpandButton: o = !0,
|
|
1737
|
-
enableAutoDisconnectInLauncher: a = !0,
|
|
1738
|
-
...s
|
|
1739
|
-
}) {
|
|
1740
|
-
const i = Dr(), [l, u] = C(!1), [m, g] = C(!1), p = {
|
|
1741
|
-
opened: (t == null ? void 0 : t.opened) ?? l,
|
|
1742
|
-
setOpened: (t == null ? void 0 : t.setOpened) ?? u,
|
|
1743
|
-
expanded: (t == null ? void 0 : t.expanded) ?? m,
|
|
1744
|
-
setExpanded: (t == null ? void 0 : t.setExpanded) ?? g
|
|
1745
|
-
};
|
|
1746
|
-
return /* @__PURE__ */ n.createElement(
|
|
1747
|
-
Mn.Provider,
|
|
1748
|
-
{
|
|
1749
|
-
value: {
|
|
1750
|
-
...s,
|
|
1751
|
-
...i,
|
|
1752
|
-
state: p,
|
|
1753
|
-
enableCloseConversationButton: r,
|
|
1754
|
-
enableExpandButton: o,
|
|
1755
|
-
enableAutoDisconnectInLauncher: a
|
|
1756
|
-
}
|
|
1757
|
-
},
|
|
1758
|
-
e
|
|
1759
|
-
);
|
|
1760
|
-
}
|
|
1761
|
-
const De = {}, q = {
|
|
1878
|
+
}, Fe = {}, ee = {
|
|
1762
1879
|
getItem: (e) => {
|
|
1763
1880
|
try {
|
|
1764
1881
|
return localStorage.getItem(e);
|
|
1765
1882
|
} catch {
|
|
1766
|
-
return
|
|
1883
|
+
return Fe[e] ?? null;
|
|
1767
1884
|
}
|
|
1768
1885
|
},
|
|
1769
1886
|
setItem: (e, t) => {
|
|
1770
1887
|
try {
|
|
1771
1888
|
localStorage.setItem(e, t);
|
|
1772
1889
|
} catch {
|
|
1773
|
-
|
|
1890
|
+
Fe[e] = t;
|
|
1774
1891
|
}
|
|
1775
1892
|
},
|
|
1776
1893
|
deleteItem: (e) => {
|
|
1777
1894
|
try {
|
|
1778
1895
|
localStorage.removeItem(e);
|
|
1779
1896
|
} catch {
|
|
1780
|
-
delete
|
|
1897
|
+
delete Fe[e];
|
|
1781
1898
|
}
|
|
1782
1899
|
},
|
|
1783
1900
|
getKeys: (e) => {
|
|
@@ -1789,37 +1906,65 @@ const De = {}, q = {
|
|
|
1789
1906
|
}
|
|
1790
1907
|
return t;
|
|
1791
1908
|
} catch {
|
|
1792
|
-
return Object.keys(
|
|
1909
|
+
return Object.keys(Fe).filter((t) => t.startsWith(e));
|
|
1793
1910
|
}
|
|
1794
1911
|
}
|
|
1795
|
-
}, xt = /iPad|iPhone|iPod/.test(navigator.userAgent), Vs = /Android/.test(navigator.userAgent), Re = (e) => xt || Vs, vt = (e, t) => `${Kr.SESSION}/${e}/${t}`, tt = {
|
|
1796
|
-
get: Hs,
|
|
1797
|
-
set: Ws,
|
|
1798
|
-
clear: zs
|
|
1799
1912
|
};
|
|
1800
|
-
function
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1913
|
+
function Bn(e) {
|
|
1914
|
+
const { keyGenerator: t, keyParamsValidator: r } = e;
|
|
1915
|
+
function o(i) {
|
|
1916
|
+
try {
|
|
1917
|
+
r && r(i);
|
|
1918
|
+
const l = t(i), u = ee.getItem(l);
|
|
1919
|
+
return u ? JSON.parse(u) : null;
|
|
1920
|
+
} catch {
|
|
1921
|
+
return null;
|
|
1922
|
+
}
|
|
1806
1923
|
}
|
|
1924
|
+
function a(i, l) {
|
|
1925
|
+
try {
|
|
1926
|
+
r && r(i);
|
|
1927
|
+
const u = t(i), p = JSON.stringify(l);
|
|
1928
|
+
ee.setItem(u, p);
|
|
1929
|
+
} catch {
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
function s(i) {
|
|
1933
|
+
try {
|
|
1934
|
+
r && r(i);
|
|
1935
|
+
const l = t(i);
|
|
1936
|
+
ee.deleteItem(l);
|
|
1937
|
+
} catch {
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
return { get: o, set: a, clear: s };
|
|
1807
1941
|
}
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1942
|
+
const Ct = /iPad|iPhone|iPod/.test(navigator.userAgent), Ji = /Android/.test(navigator.userAgent), Ne = (e) => Ct || Ji, nt = Bn({
|
|
1943
|
+
keyGenerator: ({ appId: e, aiAgentId: t, userId: r }) => {
|
|
1944
|
+
const o = Xi(`${e}/${t}/${r}`);
|
|
1945
|
+
return `${bn.USER_DATA}/${o}`;
|
|
1946
|
+
},
|
|
1947
|
+
keyParamsValidator: ({ appId: e, aiAgentId: t, userId: r }) => {
|
|
1948
|
+
if (!e || !t || !r)
|
|
1949
|
+
throw new Error("Invalid parameters for user data cache");
|
|
1950
|
+
}
|
|
1951
|
+
});
|
|
1952
|
+
function Xi(e) {
|
|
1953
|
+
let t = 0;
|
|
1954
|
+
for (let r = 0; r < e.length; r++)
|
|
1955
|
+
t = (t << 5) - t + e.charCodeAt(r), t |= 0;
|
|
1956
|
+
return t.toString(16);
|
|
1957
|
+
}
|
|
1958
|
+
const rt = Bn({
|
|
1959
|
+
keyGenerator: ({ appId: e, aiAgentId: t }) => `${bn.SESSION}/${e}/${t}`
|
|
1960
|
+
});
|
|
1961
|
+
function Qi() {
|
|
1962
|
+
const { chatSDK: e, logger: t } = B(), { shouldSyncCachedTemplate: r, syncCachedTemplates: o, clearCachedTemplates: a } = hn(), s = F(
|
|
1818
1963
|
async (l, u) => {
|
|
1819
|
-
t.debug("authManager.authenticate: session:", l.userId), u && e.setSessionHandler(new
|
|
1964
|
+
t.debug("authManager.authenticate: session:", l.userId), u && e.setSessionHandler(new pr(u)), await e.connect(l.userId, l.authToken), t.debug("authManager.authenticate: user:", e.currentUser), r(e) && await o(e);
|
|
1820
1965
|
},
|
|
1821
1966
|
[e, t, r, o]
|
|
1822
|
-
), i =
|
|
1967
|
+
), i = F(async () => {
|
|
1823
1968
|
t.debug("authManager.deauthenticate: disconnect"), await e.disconnect(), a();
|
|
1824
1969
|
}, [e, t, a]);
|
|
1825
1970
|
return {
|
|
@@ -1827,132 +1972,160 @@ function Gs() {
|
|
|
1827
1972
|
deauthenticate: i
|
|
1828
1973
|
};
|
|
1829
1974
|
}
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1975
|
+
const es = 24 * 60 * 60 * 1e3, {
|
|
1976
|
+
Provider: ts,
|
|
1977
|
+
useContext: P
|
|
1978
|
+
} = j("MessengerSession");
|
|
1979
|
+
function ns({
|
|
1832
1980
|
userSessionInfo: e,
|
|
1833
1981
|
children: t
|
|
1834
1982
|
}) {
|
|
1835
|
-
const { appId: r, aiAgentId: o, chatSDK: a, agentPreviewConfigs: s, state: i, logger: l, language: u, countryCode:
|
|
1983
|
+
const { appId: r, aiAgentId: o, chatSDK: a, agentPreviewConfigs: s, state: i, logger: l, language: u, countryCode: p, context: m, handlers: h } = B(), { updateTheme: g } = yn(), { authenticate: b, deauthenticate: E } = Qi(), [x, f] = y(
|
|
1836
1984
|
void 0
|
|
1837
|
-
), [
|
|
1838
|
-
function
|
|
1985
|
+
), [T, C] = y(void 0), [w, O] = y(null), [J, X] = y(null), [v, Q] = y(null), L = s == null ? void 0 : s.forceCreateChannel;
|
|
1986
|
+
function V() {
|
|
1839
1987
|
if (e) {
|
|
1840
1988
|
l.debug("messengerSession.initialize: manual session info detected");
|
|
1841
|
-
const
|
|
1842
|
-
return
|
|
1843
|
-
`messengerSession.initialize: missing required keys in userSessionInfo: ${
|
|
1989
|
+
const A = ["userId", "authToken", "sessionHandler"].filter((R) => !(R in e));
|
|
1990
|
+
return A.length > 0 && l.error(
|
|
1991
|
+
`messengerSession.initialize: missing required keys in userSessionInfo: ${A.join(", ")}`
|
|
1844
1992
|
), e;
|
|
1845
1993
|
}
|
|
1846
|
-
const
|
|
1847
|
-
return
|
|
1994
|
+
const I = rt.get({ appId: r, aiAgentId: o });
|
|
1995
|
+
return I ? I.expireAt - es <= Date.now() ? (l.debug("messengerSession.initialize: auto session expired, clear cache"), rt.clear({ appId: r, aiAgentId: o }), nt.clear({ appId: r, aiAgentId: o, userId: I.userId }), null) : (l.debug("messengerSession.initialize: auto session info detected"), I) : null;
|
|
1848
1996
|
}
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1997
|
+
const Se = F(
|
|
1998
|
+
(I, A) => {
|
|
1999
|
+
nt.set({ appId: r, aiAgentId: o, userId: I }, { knownActiveChannelUrl: A });
|
|
2000
|
+
},
|
|
2001
|
+
[r, o]
|
|
2002
|
+
), we = F(
|
|
2003
|
+
(I) => {
|
|
2004
|
+
const A = nt.get({ appId: r, aiAgentId: o, userId: I });
|
|
2005
|
+
return A == null ? void 0 : A.knownActiveChannelUrl;
|
|
2006
|
+
},
|
|
2007
|
+
[r, o]
|
|
2008
|
+
), Qe = F(async () => {
|
|
2009
|
+
if (w) {
|
|
2010
|
+
l.debug("messengerSession.refreshActiveChannel: try to refresh active channel"), f(void 0);
|
|
2011
|
+
const I = await a.aiAgent.requestMessengerSettings({
|
|
1853
2012
|
aiAgentId: o,
|
|
1854
|
-
userId:
|
|
2013
|
+
userId: w.userId,
|
|
1855
2014
|
language: u,
|
|
1856
|
-
country:
|
|
1857
|
-
context:
|
|
1858
|
-
forceCreateChannel:
|
|
2015
|
+
country: p,
|
|
2016
|
+
context: m,
|
|
2017
|
+
forceCreateChannel: L,
|
|
2018
|
+
knownActiveChannelUrl: we(w.userId)
|
|
1859
2019
|
});
|
|
1860
|
-
return
|
|
2020
|
+
return Se(w.userId, I.active_channel.channel_url), f({ url: I.active_channel.channel_url, status: z.OPEN }), l.info(
|
|
1861
2021
|
"messengerSession.refreshActiveChannel: refreshed active channel",
|
|
1862
|
-
|
|
1863
|
-
),
|
|
2022
|
+
I.active_channel.channel_url
|
|
2023
|
+
), I.active_channel.channel_url;
|
|
1864
2024
|
} else
|
|
1865
2025
|
throw l.error("messengerSession.refreshActiveChannel: userSession is not ready"), new Error("userSession is not ready");
|
|
1866
|
-
}, [
|
|
2026
|
+
}, [
|
|
2027
|
+
a,
|
|
2028
|
+
r,
|
|
2029
|
+
o,
|
|
2030
|
+
w == null ? void 0 : w.userId,
|
|
2031
|
+
u,
|
|
2032
|
+
p,
|
|
2033
|
+
m,
|
|
2034
|
+
L,
|
|
2035
|
+
we,
|
|
2036
|
+
Se
|
|
2037
|
+
]);
|
|
1867
2038
|
return cn(a, {
|
|
1868
|
-
onChannelChanged: (
|
|
1869
|
-
var
|
|
1870
|
-
|
|
2039
|
+
onChannelChanged: (I) => {
|
|
2040
|
+
var A;
|
|
2041
|
+
I.isGroupChannel() && I.url === (x == null ? void 0 : x.url) && (l.info("messengerSession.channelChanged: channel.conversation", I.conversation), f({ url: I.url, status: ((A = I.conversation) == null ? void 0 : A.status) ?? z.OPEN }));
|
|
1871
2042
|
},
|
|
1872
|
-
async onUserJoined(
|
|
1873
|
-
var
|
|
1874
|
-
if (
|
|
1875
|
-
l.info("messengerSession.onUserJoined: proactive channel joined",
|
|
1876
|
-
const
|
|
1877
|
-
|
|
2043
|
+
async onUserJoined(I, A) {
|
|
2044
|
+
var Z, he;
|
|
2045
|
+
if (I.conversation && I.conversation.type === Cr.PROACTIVE && A.userId === ((Z = a.currentUser) == null ? void 0 : Z.userId)) {
|
|
2046
|
+
l.info("messengerSession.onUserJoined: proactive channel joined", I.url);
|
|
2047
|
+
const re = ((he = I.conversation) == null ? void 0 : he.status) ?? z.OPEN;
|
|
2048
|
+
f({ url: I.url, status: re }), i.setOpened(!0), rs({
|
|
1878
2049
|
sound: document.hidden || !i.opened
|
|
1879
2050
|
});
|
|
1880
2051
|
}
|
|
1881
2052
|
}
|
|
1882
|
-
}),
|
|
1883
|
-
async function
|
|
2053
|
+
}), N(() => {
|
|
2054
|
+
async function I() {
|
|
1884
2055
|
l.debug("messengerSession.initialize: start");
|
|
1885
|
-
const
|
|
2056
|
+
const A = V(), R = await a.aiAgent.requestMessengerSettings({
|
|
1886
2057
|
aiAgentId: o,
|
|
1887
|
-
userId:
|
|
2058
|
+
userId: A == null ? void 0 : A.userId,
|
|
1888
2059
|
language: u,
|
|
1889
|
-
country:
|
|
1890
|
-
context:
|
|
1891
|
-
forceCreateChannel:
|
|
2060
|
+
country: p,
|
|
2061
|
+
context: m,
|
|
2062
|
+
forceCreateChannel: L,
|
|
2063
|
+
knownActiveChannelUrl: we(A == null ? void 0 : A.userId)
|
|
1892
2064
|
});
|
|
1893
|
-
l.debug("messengerSession.initialize: messenger settings response",
|
|
1894
|
-
let
|
|
1895
|
-
if (
|
|
1896
|
-
const { user_id:
|
|
1897
|
-
|
|
2065
|
+
l.debug("messengerSession.initialize: messenger settings response", R);
|
|
2066
|
+
let Z = null;
|
|
2067
|
+
if (R.auto_created_user) {
|
|
2068
|
+
const { user_id: W, session_token: fe, expire_at: be } = R.auto_created_user;
|
|
2069
|
+
rt.set({ appId: r, aiAgentId: o }, { userId: W, authToken: fe, expireAt: be }), Z = { userId: W, authToken: fe };
|
|
1898
2070
|
} else
|
|
1899
|
-
|
|
1900
|
-
userId: (
|
|
1901
|
-
authToken: (
|
|
2071
|
+
Z = {
|
|
2072
|
+
userId: (A == null ? void 0 : A.userId) ?? "",
|
|
2073
|
+
authToken: (A == null ? void 0 : A.authToken) ?? ""
|
|
1902
2074
|
};
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
2075
|
+
Se(Z.userId, R.active_channel.channel_url);
|
|
2076
|
+
function he() {
|
|
2077
|
+
const W = R.appearance.selected_theme;
|
|
2078
|
+
g(W, (be) => {
|
|
2079
|
+
const H = R.appearance.themes[be ?? W];
|
|
1907
2080
|
return {
|
|
1908
|
-
primary:
|
|
1909
|
-
botMessageBackground:
|
|
1910
|
-
primaryContrast:
|
|
1911
|
-
botMessageBackgroundContrast:
|
|
2081
|
+
primary: H.primary_color,
|
|
2082
|
+
botMessageBackground: H.bot_message_bg_color,
|
|
2083
|
+
primaryContrast: H.primary_contrast_color,
|
|
2084
|
+
botMessageBackgroundContrast: H.bot_message_bg_contrast_color
|
|
1912
2085
|
};
|
|
1913
|
-
}),
|
|
1914
|
-
userId:
|
|
1915
|
-
profileUrl:
|
|
1916
|
-
nickname:
|
|
1917
|
-
replyToFile:
|
|
1918
|
-
specialNotice:
|
|
1919
|
-
specialNoticeEnabled:
|
|
1920
|
-
showHandoffButton:
|
|
1921
|
-
}),
|
|
1922
|
-
type:
|
|
1923
|
-
imageUrl:
|
|
1924
|
-
}),
|
|
2086
|
+
}), C(void 0), O(Z), X({
|
|
2087
|
+
userId: R.bot.bot_userid,
|
|
2088
|
+
profileUrl: R.bot.bot_profile_url,
|
|
2089
|
+
nickname: R.bot.bot_nickname,
|
|
2090
|
+
replyToFile: R.bot.reply_to_file,
|
|
2091
|
+
specialNotice: R.bot.special_notice,
|
|
2092
|
+
specialNoticeEnabled: R.bot.is_special_notice_enabled,
|
|
2093
|
+
showHandoffButton: R.bot.show_handoff_button ?? !0
|
|
2094
|
+
}), Q({
|
|
2095
|
+
type: R.launcher.image_type || "default_icon",
|
|
2096
|
+
imageUrl: R.launcher.image_url
|
|
2097
|
+
}), R.launcher.auto_open && !Ne() && setTimeout(() => i.setOpened(!0), 500);
|
|
1925
2098
|
}
|
|
1926
|
-
function
|
|
1927
|
-
|
|
2099
|
+
function re() {
|
|
2100
|
+
f({ url: R.active_channel.channel_url, status: z.OPEN });
|
|
1928
2101
|
}
|
|
1929
2102
|
try {
|
|
1930
|
-
|
|
1931
|
-
} catch (
|
|
1932
|
-
|
|
2103
|
+
he(), await b(Z, e == null ? void 0 : e.sessionHandler), re();
|
|
2104
|
+
} catch (W) {
|
|
2105
|
+
W instanceof Error && (l.error("messengerSession.initialize: failed to connect", W), C(W));
|
|
1933
2106
|
}
|
|
1934
2107
|
}
|
|
1935
|
-
|
|
1936
|
-
l.error("messengerSession: failed to initialize",
|
|
2108
|
+
I().catch((A) => {
|
|
2109
|
+
l.error("messengerSession: failed to initialize", A);
|
|
1937
2110
|
});
|
|
1938
|
-
}, [a, o, e == null ? void 0 : e.userId, e == null ? void 0 : e.authToken]),
|
|
1939
|
-
|
|
1940
|
-
}, [
|
|
1941
|
-
|
|
2111
|
+
}, [a, r, o, e == null ? void 0 : e.userId, e == null ? void 0 : e.authToken]), N(() => {
|
|
2112
|
+
h != null && h.onRegisterDeauthenticateHandler && (l.debug("messengerSession: registering deauthenticate handler"), h.onRegisterDeauthenticateHandler(E));
|
|
2113
|
+
}, [h == null ? void 0 : h.onRegisterDeauthenticateHandler, E]), !w || !J || !v ? null : /* @__PURE__ */ n.createElement(
|
|
2114
|
+
ts,
|
|
1942
2115
|
{
|
|
1943
2116
|
value: {
|
|
1944
|
-
userSession:
|
|
2117
|
+
userSession: w,
|
|
1945
2118
|
activeChannel: x,
|
|
1946
|
-
refreshActiveChannel:
|
|
1947
|
-
connectionError:
|
|
1948
|
-
aiAgentInfo: { ...
|
|
1949
|
-
launcherInfo: { ...
|
|
2119
|
+
refreshActiveChannel: Qe,
|
|
2120
|
+
connectionError: T,
|
|
2121
|
+
aiAgentInfo: { ...J, ...s == null ? void 0 : s.bot },
|
|
2122
|
+
launcherInfo: { ...v, ...s == null ? void 0 : s.launcher }
|
|
1950
2123
|
}
|
|
1951
2124
|
},
|
|
1952
2125
|
t
|
|
1953
2126
|
);
|
|
1954
2127
|
}
|
|
1955
|
-
function
|
|
2128
|
+
function rs({ sound: e }) {
|
|
1956
2129
|
const t = "🔔You have received a new message", r = document.title, o = setInterval(() => {
|
|
1957
2130
|
document.title = document.title === t ? r : t;
|
|
1958
2131
|
}, 750);
|
|
@@ -1960,7 +2133,7 @@ function Ys({ sound: e }) {
|
|
|
1960
2133
|
new Audio(a.default).play();
|
|
1961
2134
|
});
|
|
1962
2135
|
}
|
|
1963
|
-
const
|
|
2136
|
+
const Gt = {
|
|
1964
2137
|
file: "attach",
|
|
1965
2138
|
snippet: "snippet",
|
|
1966
2139
|
site: "website",
|
|
@@ -1970,7 +2143,7 @@ const zt = {
|
|
|
1970
2143
|
sb_zendesk: "zendesk",
|
|
1971
2144
|
sb_desk: "snippet"
|
|
1972
2145
|
// TODO: request icon
|
|
1973
|
-
},
|
|
2146
|
+
}, os = ({
|
|
1974
2147
|
actionbook: e,
|
|
1975
2148
|
functionCalls: t,
|
|
1976
2149
|
groundedness: r,
|
|
@@ -1980,84 +2153,84 @@ const zt = {
|
|
|
1980
2153
|
onClickFunctionCallDetail: i,
|
|
1981
2154
|
onClickGroundedness: l,
|
|
1982
2155
|
onClickAgentMessageTemplate: u,
|
|
1983
|
-
bottomContent:
|
|
1984
|
-
renderCustomGroundednessIcon:
|
|
1985
|
-
style:
|
|
2156
|
+
bottomContent: p,
|
|
2157
|
+
renderCustomGroundednessIcon: m = (g) => g.default,
|
|
2158
|
+
style: h = {}
|
|
1986
2159
|
}) => {
|
|
1987
2160
|
const {
|
|
1988
2161
|
// Note: This component is used with the dashboard, so cssVars should not be used.
|
|
1989
|
-
iconColor:
|
|
1990
|
-
textColor:
|
|
1991
|
-
highlightColor: E =
|
|
1992
|
-
} =
|
|
1993
|
-
return /* @__PURE__ */ n.createElement(
|
|
1994
|
-
|
|
2162
|
+
iconColor: g = "#000000",
|
|
2163
|
+
textColor: b = "#000000",
|
|
2164
|
+
highlightColor: E = de.DEFAULT_PRIMARY
|
|
2165
|
+
} = h;
|
|
2166
|
+
return /* @__PURE__ */ n.createElement(jt, null, e && /* @__PURE__ */ n.createElement(jt, null, /* @__PURE__ */ n.createElement(Ke, null, /* @__PURE__ */ n.createElement(Ve, null, /* @__PURE__ */ n.createElement($, { size: 16, type: "actionbook", color: g })), /* @__PURE__ */ n.createElement(
|
|
2167
|
+
Ue,
|
|
1995
2168
|
{
|
|
1996
2169
|
$clickable: !!a,
|
|
1997
2170
|
$highlightColor: E,
|
|
1998
2171
|
variant: "body2",
|
|
1999
|
-
color:
|
|
2172
|
+
color: b,
|
|
2000
2173
|
onClick: () => a == null ? void 0 : a(e)
|
|
2001
2174
|
},
|
|
2002
2175
|
e.name
|
|
2003
|
-
))), t == null ? void 0 : t.map((x) => /* @__PURE__ */ n.createElement(
|
|
2004
|
-
|
|
2176
|
+
))), t == null ? void 0 : t.map((x) => /* @__PURE__ */ n.createElement(ot, { key: x.key }, /* @__PURE__ */ n.createElement(Ve, null, /* @__PURE__ */ n.createElement($, { size: 16, type: "function", color: g })), /* @__PURE__ */ n.createElement(Ke, null, /* @__PURE__ */ n.createElement(
|
|
2177
|
+
Ue,
|
|
2005
2178
|
{
|
|
2006
2179
|
$clickable: !!a,
|
|
2007
2180
|
$highlightColor: E,
|
|
2008
2181
|
variant: "body2",
|
|
2009
|
-
color:
|
|
2182
|
+
color: b,
|
|
2010
2183
|
onClick: () => s == null ? void 0 : s(x)
|
|
2011
2184
|
},
|
|
2012
2185
|
x.name
|
|
2013
|
-
), /* @__PURE__ */ n.createElement(
|
|
2014
|
-
default: /* @__PURE__ */ n.createElement(
|
|
2186
|
+
), /* @__PURE__ */ n.createElement(is, { role: "button", onClick: () => i == null ? void 0 : i(x) }, /* @__PURE__ */ n.createElement(S, { variant: "body2", color: E }, "View details"), /* @__PURE__ */ n.createElement($, { type: "chevron-right", size: 16, color: E }))))), r == null ? void 0 : r.map((x) => /* @__PURE__ */ n.createElement(ot, { key: x.id }, /* @__PURE__ */ n.createElement(Ve, null, m({
|
|
2187
|
+
default: /* @__PURE__ */ n.createElement($, { size: 16, type: Gt[x.source_type] ?? Gt.snippet, color: g }),
|
|
2015
2188
|
sourceType: x.source_type
|
|
2016
2189
|
})), /* @__PURE__ */ n.createElement(
|
|
2017
|
-
|
|
2190
|
+
Ue,
|
|
2018
2191
|
{
|
|
2019
2192
|
$clickable: !!l,
|
|
2020
2193
|
$highlightColor: E,
|
|
2021
2194
|
variant: "body2",
|
|
2022
|
-
color:
|
|
2195
|
+
color: b,
|
|
2023
2196
|
onClick: () => l == null ? void 0 : l(x)
|
|
2024
2197
|
},
|
|
2025
2198
|
x.preview_title
|
|
2026
|
-
))), o == null ? void 0 : o.map((x) => /* @__PURE__ */ n.createElement(
|
|
2027
|
-
|
|
2199
|
+
))), o == null ? void 0 : o.map((x) => /* @__PURE__ */ n.createElement(ot, { key: x.key }, /* @__PURE__ */ n.createElement(Ve, null, /* @__PURE__ */ n.createElement($, { size: 16, type: "template", color: g })), /* @__PURE__ */ n.createElement(
|
|
2200
|
+
Ue,
|
|
2028
2201
|
{
|
|
2029
2202
|
$clickable: !!u,
|
|
2030
2203
|
$highlightColor: E,
|
|
2031
2204
|
variant: "body2",
|
|
2032
|
-
color:
|
|
2205
|
+
color: b,
|
|
2033
2206
|
onClick: () => u == null ? void 0 : u(x)
|
|
2034
2207
|
},
|
|
2035
2208
|
x.name
|
|
2036
|
-
))),
|
|
2037
|
-
},
|
|
2209
|
+
))), p);
|
|
2210
|
+
}, as = c(S)`font-weight:400;`, Ue = c(as)`${({ $clickable: e, $highlightColor: t }) => e && k`
|
|
2038
2211
|
cursor: pointer;
|
|
2039
2212
|
text-decoration: underline;
|
|
2040
2213
|
&:hover {
|
|
2041
2214
|
color: ${t};
|
|
2042
2215
|
}
|
|
2043
2216
|
`}
|
|
2044
|
-
`,
|
|
2217
|
+
`, Ve = c.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Ke = c.div`display:flex;gap:8px;align-items:center;`, is = c(Ke)`cursor:pointer;gap:4px;`, ot = c(Ke)`flex-direction:row;align-items:center;`, jt = c.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Dn = _e(
|
|
2045
2218
|
null
|
|
2046
2219
|
);
|
|
2047
|
-
function
|
|
2220
|
+
function ss({
|
|
2048
2221
|
isDashboardActionbookTester: e = !1,
|
|
2049
2222
|
children: t
|
|
2050
2223
|
}) {
|
|
2051
|
-
return /* @__PURE__ */ n.createElement(
|
|
2224
|
+
return /* @__PURE__ */ n.createElement(Dn.Provider, { value: { isDashboardActionbookTester: e } }, e && /* @__PURE__ */ n.createElement(ls, null), t);
|
|
2052
2225
|
}
|
|
2053
2226
|
const Xe = () => {
|
|
2054
|
-
const e =
|
|
2227
|
+
const e = te(Dn);
|
|
2055
2228
|
if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardActionbookTesterProvider not found");
|
|
2056
2229
|
return e;
|
|
2057
|
-
},
|
|
2230
|
+
}, ls = () => /* @__PURE__ */ n.createElement(pe.Template, { template: cs }, /* @__PURE__ */ n.createElement(pe.MessageLogs, { component: ds })), cs = (e) => /* @__PURE__ */ n.createElement(Mn, { ...e, testerMode: !0, maxBodyWidth: Cn }), ds = ({ extendedMessagePayload: e = {} }) => {
|
|
2058
2231
|
const { handlers: t } = B(), { manual: r, groundedness: o, function_calls: a, agent_message_templates: s, is_thinking: i } = e;
|
|
2059
|
-
return i || !r && !o && !a && !s ? /* @__PURE__ */ n.createElement(n.Fragment, null) : /* @__PURE__ */ n.createElement(
|
|
2060
|
-
|
|
2232
|
+
return i || !r && !(o != null && o.length) && !(a != null && a.length) && !(s != null && s.length) ? /* @__PURE__ */ n.createElement(n.Fragment, null) : /* @__PURE__ */ n.createElement(us, null, /* @__PURE__ */ n.createElement(ms, { width: 4 }), /* @__PURE__ */ n.createElement(
|
|
2233
|
+
os,
|
|
2061
2234
|
{
|
|
2062
2235
|
actionbook: r,
|
|
2063
2236
|
functionCalls: a,
|
|
@@ -2069,21 +2242,21 @@ const Xe = () => {
|
|
|
2069
2242
|
textColor: d.themedColor.textHighEmphasis,
|
|
2070
2243
|
barColor: d.themedColor.textDisabled
|
|
2071
2244
|
},
|
|
2072
|
-
bottomContent: /* @__PURE__ */ n.createElement(
|
|
2245
|
+
bottomContent: /* @__PURE__ */ n.createElement(ps, { variant: "caption2", color: d.themedColor.textLowEmphasis }, "Only visible in the tester")
|
|
2073
2246
|
}
|
|
2074
2247
|
));
|
|
2075
|
-
},
|
|
2076
|
-
function
|
|
2248
|
+
}, us = c.div`display:flex;gap:16px;margin:16px ${q}px 0;align-self:stretch;`, ms = c.div`width:${({ width: e }) => e}px;background-color:${d.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, ps = c(S)`margin-top:5px;`;
|
|
2249
|
+
function Pn({
|
|
2077
2250
|
rootElement: e = document.body,
|
|
2078
|
-
logLevel: t =
|
|
2251
|
+
logLevel: t = sn.WARN,
|
|
2079
2252
|
language: r = navigator.language,
|
|
2080
2253
|
userSessionInfo: o,
|
|
2081
2254
|
children: a,
|
|
2082
2255
|
...s
|
|
2083
2256
|
}) {
|
|
2084
2257
|
var i;
|
|
2085
|
-
return xe.level !== t && (xe.level = t),
|
|
2086
|
-
|
|
2258
|
+
return xe.level !== t && (xe.level = t), Po("https://fonts.googleapis.com/css2?family=Roboto&display=swap", e), /* @__PURE__ */ n.createElement("div", { id: ne.ENTRY, style: { width: "fit-content", height: "fit-content" } }, /* @__PURE__ */ n.createElement(ro, { logger: xe, storage: hs }, /* @__PURE__ */ n.createElement(
|
|
2259
|
+
Zi,
|
|
2087
2260
|
{
|
|
2088
2261
|
logger: xe,
|
|
2089
2262
|
rootElement: e,
|
|
@@ -2093,7 +2266,7 @@ function Rn({
|
|
|
2093
2266
|
messageTemplate: s.messageTemplate
|
|
2094
2267
|
},
|
|
2095
2268
|
/* @__PURE__ */ n.createElement(
|
|
2096
|
-
|
|
2269
|
+
Vr,
|
|
2097
2270
|
{
|
|
2098
2271
|
appId: s.appId,
|
|
2099
2272
|
aiAgentId: s.aiAgentId,
|
|
@@ -2101,46 +2274,47 @@ function Rn({
|
|
|
2101
2274
|
countryCode: s.countryCode,
|
|
2102
2275
|
context: s.context,
|
|
2103
2276
|
logger: xe,
|
|
2277
|
+
dispatcher: gs,
|
|
2104
2278
|
chatParams: { customApiHost: s.customApiHost, customWebSocketHost: s.customWebSocketHost }
|
|
2105
2279
|
},
|
|
2106
|
-
/* @__PURE__ */ n.createElement(
|
|
2107
|
-
|
|
2280
|
+
/* @__PURE__ */ n.createElement(qi, { rootElement: e, ...s }, /* @__PURE__ */ n.createElement(ns, { userSessionInfo: o }, /* @__PURE__ */ n.createElement(
|
|
2281
|
+
ss,
|
|
2108
2282
|
{
|
|
2109
2283
|
isDashboardActionbookTester: s._UNSAFE_INTERNAL_isActionbookTester
|
|
2110
2284
|
},
|
|
2111
2285
|
a,
|
|
2112
|
-
/* @__PURE__ */ n.createElement("div", { id:
|
|
2286
|
+
/* @__PURE__ */ n.createElement("div", { id: ne.MODAL_ROOT })
|
|
2113
2287
|
)))
|
|
2114
2288
|
)
|
|
2115
2289
|
)));
|
|
2116
2290
|
}
|
|
2117
|
-
const xe = new pn(
|
|
2291
|
+
const xe = new pn(sn.WARN), gs = new un(xe), _t = "@sba/message-template", Kt = (e) => `${_t}/templates/${e}`, Zt = () => `${_t}/token`, hs = to({
|
|
2118
2292
|
onSetTemplate: (e, t) => {
|
|
2119
|
-
Wt[e] ||
|
|
2293
|
+
Wt[e] || ee.setItem(Kt(e), t);
|
|
2120
2294
|
},
|
|
2121
2295
|
onGetTemplate: (e) => {
|
|
2122
2296
|
const t = Wt[e];
|
|
2123
|
-
return t ? JSON.stringify(t) :
|
|
2297
|
+
return t ? JSON.stringify(t) : ee.getItem(Kt(e));
|
|
2124
2298
|
},
|
|
2125
2299
|
onSetCachedToken(e) {
|
|
2126
|
-
|
|
2300
|
+
ee.setItem(Zt(), e);
|
|
2127
2301
|
},
|
|
2128
2302
|
onGetCachedToken() {
|
|
2129
|
-
return
|
|
2303
|
+
return ee.getItem(Zt());
|
|
2130
2304
|
},
|
|
2131
2305
|
onClear: () => {
|
|
2132
|
-
|
|
2306
|
+
ee.getKeys(_t).forEach(ee.deleteItem);
|
|
2133
2307
|
}
|
|
2134
|
-
}),
|
|
2135
|
-
const { dir: r, rootElement: o } = B(), a =
|
|
2136
|
-
return
|
|
2308
|
+
}), Fn = ({ children: e, isOpened: t }) => {
|
|
2309
|
+
const { dir: r, rootElement: o } = B(), a = ue(o, !0);
|
|
2310
|
+
return N(() => {
|
|
2137
2311
|
const s = "sb-agent-block-scroll";
|
|
2138
2312
|
return t ? a.body.classList.add(s) : a.body.classList.remove(s), () => {
|
|
2139
2313
|
a.body.classList.remove(s);
|
|
2140
2314
|
};
|
|
2141
|
-
}, [a, t]), /* @__PURE__ */ n.createElement(
|
|
2142
|
-
},
|
|
2143
|
-
function
|
|
2315
|
+
}, [a, t]), /* @__PURE__ */ n.createElement(fs, { dir: r, $visible: t }, e);
|
|
2316
|
+
}, fs = c.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${ge.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`;
|
|
2317
|
+
function bs({
|
|
2144
2318
|
className: e,
|
|
2145
2319
|
isOpened: t,
|
|
2146
2320
|
onClick: r,
|
|
@@ -2150,23 +2324,23 @@ function li({
|
|
|
2150
2324
|
animated: i = !0,
|
|
2151
2325
|
backgroundColor: l
|
|
2152
2326
|
}) {
|
|
2153
|
-
const u =
|
|
2327
|
+
const u = Ge(l);
|
|
2154
2328
|
return /* @__PURE__ */ n.createElement(
|
|
2155
|
-
|
|
2329
|
+
vs,
|
|
2156
2330
|
{
|
|
2157
2331
|
dir: s,
|
|
2158
|
-
id:
|
|
2332
|
+
id: ne.LAUNCHER,
|
|
2159
2333
|
className: e,
|
|
2160
2334
|
"aria-label": "Sendbird AIAgent Launcher",
|
|
2161
2335
|
onClick: r,
|
|
2162
2336
|
$animated: i,
|
|
2163
2337
|
$backgroundColor: l
|
|
2164
2338
|
},
|
|
2165
|
-
/* @__PURE__ */ n.createElement(
|
|
2166
|
-
/* @__PURE__ */ n.createElement(
|
|
2339
|
+
/* @__PURE__ */ n.createElement(ys, { $isOpened: t, $animated: i, $fillColor: u }, /* @__PURE__ */ n.createElement(Yt.Open, { url: a, isDefaultIcon: o === "default_icon" })),
|
|
2340
|
+
/* @__PURE__ */ n.createElement(Cs, { $isOpened: t, $animated: i, $fillColor: u }, /* @__PURE__ */ n.createElement(Yt.Close, null))
|
|
2167
2341
|
);
|
|
2168
2342
|
}
|
|
2169
|
-
const
|
|
2343
|
+
const Es = k`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, xs = k`img{width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-drag:none;&[data-default-icon='true']{width:32px;height:32px;filter:${({ $fillColor: e }) => e === de.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, Un = k`svg{width:32px;height:32px;${({ $fillColor: e }) => k`
|
|
2170
2344
|
path {
|
|
2171
2345
|
fill: ${e};
|
|
2172
2346
|
}
|
|
@@ -2175,14 +2349,14 @@ const ci = k`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
2175
2349
|
}
|
|
2176
2350
|
`}
|
|
2177
2351
|
}
|
|
2178
|
-
`,
|
|
2179
|
-
Open: (e) => e.url ? /* @__PURE__ */ n.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ n.createElement(
|
|
2180
|
-
Close: () => /* @__PURE__ */ n.createElement(
|
|
2352
|
+
`, vs = c.button`position:relative;padding:0;width:48px;height:48px;background:${({ $backgroundColor: e }) => e};border-radius:50%;transition:all 0.3s cubic-bezier(0.31,-0.105,0.43,1.4);border:none;display:flex;justify-content:center;align-items:center;box-shadow:0 16px 24px 2px rgba(33,33,33,0.12),0 6px 30px 5px rgba(33,33,33,0.08),0 6px 10px -5px rgba(33,33,33,0.04);${({ $animated: e }) => e && Es}`, Vn = c.span`position:absolute;width:100%;height:100%;border-radius:50%;overflow:hidden;transition:transform 0.16s linear,opacity 0.08s linear,scale 0.16s linear;user-select:none;display:flex;justify-content:center;align-items:center;`, ys = c(Vn)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${xs}${Un}`, Cs = c(Vn)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${Un}`, Yt = {
|
|
2353
|
+
Open: (e) => e.url ? /* @__PURE__ */ n.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ n.createElement(Et, null),
|
|
2354
|
+
Close: () => /* @__PURE__ */ n.createElement($, { size: 32, type: "chevron-down" })
|
|
2181
2355
|
};
|
|
2182
|
-
function
|
|
2183
|
-
const { colors: t } =
|
|
2184
|
-
return
|
|
2185
|
-
|
|
2356
|
+
function Hn({ className: e }) {
|
|
2357
|
+
const { colors: t } = dt(), { dir: r, state: o } = B(), { launcherInfo: a } = P();
|
|
2358
|
+
return Ts(), /* @__PURE__ */ n.createElement(
|
|
2359
|
+
bs,
|
|
2186
2360
|
{
|
|
2187
2361
|
dir: r,
|
|
2188
2362
|
className: e,
|
|
@@ -2194,26 +2368,26 @@ function Dn({ className: e }) {
|
|
|
2194
2368
|
}
|
|
2195
2369
|
);
|
|
2196
2370
|
}
|
|
2197
|
-
const
|
|
2198
|
-
function
|
|
2199
|
-
const { chatSDK: e, state: t, logger: r, enableAutoDisconnectInLauncher: o } = B(), a =
|
|
2200
|
-
|
|
2371
|
+
const _s = 1e3 * 60;
|
|
2372
|
+
function Ts() {
|
|
2373
|
+
const { chatSDK: e, state: t, logger: r, enableAutoDisconnectInLauncher: o } = B(), a = D(null);
|
|
2374
|
+
N(() => {
|
|
2201
2375
|
if (!o) return;
|
|
2202
2376
|
function s() {
|
|
2203
2377
|
a.current && (clearTimeout(a.current), a.current = null);
|
|
2204
2378
|
}
|
|
2205
2379
|
function i() {
|
|
2206
|
-
e.connectionState ===
|
|
2380
|
+
e.connectionState === gr.CLOSED && (e.reconnect(), r.debug("useSDKInactivityTimeout: reconnected")), s(), r.debug("useSDKInactivityTimeout: clear disconnect schedule");
|
|
2207
2381
|
}
|
|
2208
2382
|
function l() {
|
|
2209
2383
|
s(), a.current = setTimeout(async () => {
|
|
2210
2384
|
await e.disconnectWebSocket(), r.debug("useSDKInactivityTimeout: disconnected");
|
|
2211
|
-
},
|
|
2385
|
+
}, _s);
|
|
2212
2386
|
}
|
|
2213
2387
|
t.opened ? i() : (l(), r.debug("useSDKInactivityTimeout: schedule disconnect"));
|
|
2214
2388
|
}, [o, e, t.opened]);
|
|
2215
2389
|
}
|
|
2216
|
-
const
|
|
2390
|
+
const Ss = ({ publishSynchronous: e = !1 }) => {
|
|
2217
2391
|
const t = /* @__PURE__ */ new Set();
|
|
2218
2392
|
return {
|
|
2219
2393
|
publish: (r) => {
|
|
@@ -2224,19 +2398,19 @@ const fi = ({ publishSynchronous: e = !1 }) => {
|
|
|
2224
2398
|
subscribe: (r) => (t.add(r), () => t.delete(r))
|
|
2225
2399
|
};
|
|
2226
2400
|
};
|
|
2227
|
-
function
|
|
2228
|
-
const r =
|
|
2401
|
+
function ws(e, t = []) {
|
|
2402
|
+
const r = D(null), o = D(0), a = D(0), [s] = y(() => Ss({ publishSynchronous: !0 })), [i, l] = y(!0);
|
|
2229
2403
|
return ye(() => {
|
|
2230
2404
|
o.current = 0, a.current = 0, l(!0), r.current && (r.current.scrollTop = r.current.scrollHeight);
|
|
2231
|
-
}, t), ye(() => s.subscribe(({ type: u, data:
|
|
2232
|
-
const { resolve:
|
|
2233
|
-
if (!r.current) return
|
|
2405
|
+
}, t), ye(() => s.subscribe(({ type: u, data: p }) => {
|
|
2406
|
+
const { resolve: m, animated: h } = p ?? {};
|
|
2407
|
+
if (!r.current) return m == null ? void 0 : m();
|
|
2234
2408
|
if (u === "scrollToBottom" && (r.current.scroll ? r.current.scroll({
|
|
2235
2409
|
top: r.current.scrollHeight,
|
|
2236
|
-
behavior:
|
|
2237
|
-
}) : r.current.scrollTop = r.current.scrollHeight, a.current = 0, l(!0),
|
|
2238
|
-
const
|
|
2239
|
-
r.current.scroll ? r.current.scroll({ top:
|
|
2410
|
+
behavior: qt(e, h)
|
|
2411
|
+
}) : r.current.scrollTop = r.current.scrollHeight, a.current = 0, l(!0), m == null || m()), u === "scroll") {
|
|
2412
|
+
const g = p == null ? void 0 : p.top, { scrollTop: b, scrollHeight: E, clientHeight: x } = r.current;
|
|
2413
|
+
r.current.scroll ? r.current.scroll({ top: g, behavior: qt(e, h) }) : typeof g == "number" && (r.current.scrollTop = g), a.current = Math.max(0, E - b - x), l(a.current === 0), m == null || m();
|
|
2240
2414
|
}
|
|
2241
2415
|
}), [e]), {
|
|
2242
2416
|
scrollRef: r,
|
|
@@ -2247,10 +2421,10 @@ function bi(e, t = []) {
|
|
|
2247
2421
|
scrollPositionRef: o
|
|
2248
2422
|
};
|
|
2249
2423
|
}
|
|
2250
|
-
function
|
|
2424
|
+
function qt(e, t) {
|
|
2251
2425
|
return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
|
|
2252
2426
|
}
|
|
2253
|
-
function
|
|
2427
|
+
function ks(e) {
|
|
2254
2428
|
return new Promise((t) => {
|
|
2255
2429
|
const r = new Image();
|
|
2256
2430
|
r.onload = function() {
|
|
@@ -2259,95 +2433,73 @@ function Ei(e) {
|
|
|
2259
2433
|
}, r.src = URL.createObjectURL(e);
|
|
2260
2434
|
});
|
|
2261
2435
|
}
|
|
2262
|
-
async function
|
|
2436
|
+
async function As(e) {
|
|
2263
2437
|
if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
|
|
2264
|
-
const { width: t, height: r } = await
|
|
2265
|
-
return new
|
|
2266
|
-
key:
|
|
2438
|
+
const { width: t, height: r } = await ks(e.file);
|
|
2439
|
+
return new $r({
|
|
2440
|
+
key: zn,
|
|
2267
2441
|
value: [t, r]
|
|
2268
2442
|
});
|
|
2269
2443
|
}
|
|
2270
2444
|
}
|
|
2271
|
-
const
|
|
2272
|
-
const { agentPreviewConfigs: t, handlers: r } = B(), o =
|
|
2445
|
+
const zn = "KEY_IMG_ASPECT_RATIO", Is = ({ onScroll: e }) => {
|
|
2446
|
+
const { agentPreviewConfigs: t, handlers: r } = B(), o = D(t == null ? void 0 : t.agentAttributes);
|
|
2273
2447
|
return o.current = t == null ? void 0 : t.agentAttributes, {
|
|
2274
2448
|
onBeforeSendMessage: async (a) => {
|
|
2275
|
-
|
|
2276
|
-
const s = await xi(a), i = {
|
|
2449
|
+
const s = await As(a), i = {
|
|
2277
2450
|
...a,
|
|
2278
2451
|
metaArrays: s ? [s] : void 0
|
|
2279
|
-
}, l = (
|
|
2280
|
-
return
|
|
2452
|
+
}, l = $s(o.current);
|
|
2453
|
+
return l ? { ...i, data: JSON.stringify(l) } : i;
|
|
2281
2454
|
},
|
|
2282
2455
|
onAfterSendMessage: (a) => {
|
|
2283
2456
|
var s;
|
|
2284
2457
|
e(), (s = r == null ? void 0 : r.onMessageSend) == null || s.call(r, a.message);
|
|
2285
2458
|
}
|
|
2286
2459
|
};
|
|
2287
|
-
},
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
});
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
try {
|
|
2308
|
-
a.debug("conversation.fetchChannel: get channel", m);
|
|
2309
|
-
const w = await s.groupChannel.getChannel(m);
|
|
2310
|
-
b(w);
|
|
2311
|
-
const D = new sn({ onReconnectSucceeded: () => w.refresh() });
|
|
2312
|
-
s.addConnectionHandler("sba-refresh", D), a.debug("conversation.fetchChannel: fetched channel", w);
|
|
2313
|
-
} catch (w) {
|
|
2314
|
-
w instanceof on && v(w), a.error("conversation.fetchChannel: error", w);
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
return P(() => {
|
|
2318
|
-
N();
|
|
2319
|
-
}, [m]), P(() => {
|
|
2320
|
-
const w = async () => {
|
|
2321
|
-
a.debug("conversation.dispatcher: try to close conversation", x), x != null && x.conversation && ht(x) && (await x.closeConversation(), await u());
|
|
2322
|
-
};
|
|
2323
|
-
return i.subscribe(rt.ConversationClose, w), () => {
|
|
2324
|
-
i.unsubscribe(rt.ConversationClose, w);
|
|
2325
|
-
};
|
|
2326
|
-
}, [i, x, u]), /* @__PURE__ */ n.createElement(
|
|
2327
|
-
yi.Provider,
|
|
2460
|
+
}, $s = (e) => {
|
|
2461
|
+
if (!e) return null;
|
|
2462
|
+
const t = {};
|
|
2463
|
+
return e.ai && Object.keys(e.ai).length > 0 && (t.ai_attrs = e.ai), e.safeguard && Object.keys(e.safeguard).length > 0 && (t.safeguard_attrs = e.safeguard), typeof e.use_prompt_cache == "boolean" && (t.use_prompt_cache = e.use_prompt_cache), Object.keys(t).length > 0 ? t : null;
|
|
2464
|
+
}, {
|
|
2465
|
+
Provider: Ms,
|
|
2466
|
+
useContext: K
|
|
2467
|
+
} = j("Conversation"), Os = ({
|
|
2468
|
+
closedChannelUrl: e,
|
|
2469
|
+
onClearClosedChannelUrl: t,
|
|
2470
|
+
onNavigateToConversationList: r,
|
|
2471
|
+
children: o
|
|
2472
|
+
}) => {
|
|
2473
|
+
const { activeChannel: a, refreshActiveChannel: s } = P(), i = ws("smooth"), l = () => {
|
|
2474
|
+
setTimeout(() => i.scrollPubSub.publish({ type: "scrollToBottom" }), 25);
|
|
2475
|
+
}, { onBeforeSendMessage: u, onAfterSendMessage: p } = Is({ onScroll: l }), m = F(async () => {
|
|
2476
|
+
await s(), e && (t == null || t());
|
|
2477
|
+
}, [s, e, t]);
|
|
2478
|
+
return /* @__PURE__ */ n.createElement(
|
|
2479
|
+
Kr,
|
|
2328
2480
|
{
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
goToActiveConversation: g,
|
|
2336
|
-
onBeforeSendMessage: f,
|
|
2337
|
-
onAfterSendMessage: E,
|
|
2338
|
-
onNavigateToConversationList: o
|
|
2339
|
-
}
|
|
2481
|
+
channelUrl: e || (a == null ? void 0 : a.url),
|
|
2482
|
+
onBeforeSendMessage: u,
|
|
2483
|
+
onAfterSendMessage: p,
|
|
2484
|
+
onMessagesUpdated: l,
|
|
2485
|
+
onChannelDeleted: m,
|
|
2486
|
+
onConversationClosedViaDispatcher: m
|
|
2340
2487
|
},
|
|
2341
|
-
|
|
2488
|
+
(h) => /* @__PURE__ */ n.createElement(
|
|
2489
|
+
Ms,
|
|
2490
|
+
{
|
|
2491
|
+
value: { ...h, scrollSource: i, goToActiveConversation: m, onNavigateToConversationList: r }
|
|
2492
|
+
},
|
|
2493
|
+
o
|
|
2494
|
+
)
|
|
2342
2495
|
);
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
const t = F(/* @__PURE__ */ new Set());
|
|
2496
|
+
}, Tt = _e({
|
|
2497
|
+
onDrop: je,
|
|
2498
|
+
subscribe: () => je
|
|
2499
|
+
}), st = ({ children: e }) => {
|
|
2500
|
+
const t = D(/* @__PURE__ */ new Set());
|
|
2349
2501
|
return /* @__PURE__ */ n.createElement(
|
|
2350
|
-
|
|
2502
|
+
Tt.Provider,
|
|
2351
2503
|
{
|
|
2352
2504
|
value: {
|
|
2353
2505
|
onDrop: (r) => {
|
|
@@ -2362,25 +2514,25 @@ const Ct = _e({
|
|
|
2362
2514
|
},
|
|
2363
2515
|
e
|
|
2364
2516
|
);
|
|
2365
|
-
},
|
|
2366
|
-
const { subscribe: t } =
|
|
2367
|
-
|
|
2517
|
+
}, Rs = ({ onDropFiles: e }) => {
|
|
2518
|
+
const { subscribe: t } = te(Tt);
|
|
2519
|
+
N(() => t(e), [e]);
|
|
2368
2520
|
};
|
|
2369
|
-
|
|
2370
|
-
const { onDrop: t } =
|
|
2521
|
+
st.Consumer = ({ children: e }) => {
|
|
2522
|
+
const { onDrop: t } = te(Tt);
|
|
2371
2523
|
return e({ onDrop: t, onDragOver: (a) => a.preventDefault() });
|
|
2372
2524
|
};
|
|
2373
|
-
const
|
|
2374
|
-
loading: _(() => import("./
|
|
2375
|
-
error: _(() => import("./
|
|
2376
|
-
noChannels: _(() => import("./
|
|
2377
|
-
noMessages: _(() => import("./
|
|
2525
|
+
const xd = ({ iconSize: e = 64, icon: t, className: r, label: o, children: a }) => /* @__PURE__ */ n.createElement(Ns, { className: r }, /* @__PURE__ */ n.createElement($, { type: t, size: e, color: d.themedColor.onbackground3 }), /* @__PURE__ */ n.createElement(S, { variant: "body1", color: d.themedColor.onbackground2 }, o), a), Ls = c.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Ns = c.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, Bs = {
|
|
2526
|
+
loading: _(() => import("./BadiWqxO.js")),
|
|
2527
|
+
error: _(() => import("./eeqIVbCW.js")),
|
|
2528
|
+
noChannels: _(() => import("./ZtOVM8hp.js")),
|
|
2529
|
+
noMessages: _(() => import("./NuQQJV2A.js"))
|
|
2378
2530
|
}, Ce = ({ className: e, type: t = "loading", ...r }) => {
|
|
2379
|
-
const o =
|
|
2380
|
-
return /* @__PURE__ */ n.createElement(
|
|
2381
|
-
},
|
|
2531
|
+
const o = Bs[t];
|
|
2532
|
+
return /* @__PURE__ */ n.createElement(Ls, { className: e }, /* @__PURE__ */ n.createElement(Ie, { fallback: null }, /* @__PURE__ */ n.createElement(o, { ...r })));
|
|
2533
|
+
}, St = {
|
|
2382
2534
|
isStreaming(e) {
|
|
2383
|
-
const t =
|
|
2535
|
+
const t = Pt(e.data);
|
|
2384
2536
|
return typeof t == "object" ? !!t.stream : !1;
|
|
2385
2537
|
},
|
|
2386
2538
|
isWelcomeMessage(e, t) {
|
|
@@ -2388,81 +2540,81 @@ const dd = ({ iconSize: e = 64, icon: t, className: r, label: o, children: a })
|
|
|
2388
2540
|
if (((r = e.extendedMessagePayload) == null ? void 0 : r.bot_message_type) === "welcome")
|
|
2389
2541
|
return !0;
|
|
2390
2542
|
if ((e.isUserMessage() || e.isFileMessage()) && e.sender.userId === t) {
|
|
2391
|
-
const o =
|
|
2543
|
+
const o = Pt(e.data);
|
|
2392
2544
|
return !(o != null && o.respond_mesg_id) && !(o != null && o.stream);
|
|
2393
2545
|
}
|
|
2394
2546
|
return !1;
|
|
2395
2547
|
}
|
|
2396
2548
|
};
|
|
2397
|
-
function
|
|
2549
|
+
function Ds(e) {
|
|
2398
2550
|
return "sendingStatus" in e ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId);
|
|
2399
2551
|
}
|
|
2400
|
-
const
|
|
2552
|
+
const Ps = (e, t, r, o = !0) => {
|
|
2401
2553
|
if (!o || !e.isUserMessage() && !e.isFileMessage())
|
|
2402
2554
|
return "single";
|
|
2403
2555
|
const a = () => {
|
|
2404
2556
|
if (!t || !t.isUserMessage() && !t.isFileMessage()) return !1;
|
|
2405
|
-
const u = t.sender.userId === e.sender.userId,
|
|
2406
|
-
return u &&
|
|
2557
|
+
const u = t.sender.userId === e.sender.userId, p = $t(t.createdAt, e.createdAt);
|
|
2558
|
+
return u && p;
|
|
2407
2559
|
}, s = () => {
|
|
2408
2560
|
if (!r || !r.isUserMessage() && !r.isFileMessage()) return !1;
|
|
2409
|
-
const u = r.sender.userId === e.sender.userId,
|
|
2410
|
-
return u &&
|
|
2561
|
+
const u = r.sender.userId === e.sender.userId, p = $t(r.createdAt, e.createdAt);
|
|
2562
|
+
return u && p;
|
|
2411
2563
|
}, i = a(), l = s();
|
|
2412
2564
|
return i && l ? "middle" : i ? "bottom" : l ? "top" : "single";
|
|
2413
2565
|
};
|
|
2414
|
-
function
|
|
2415
|
-
return e.filter((r) =>
|
|
2566
|
+
function Fs(e, t) {
|
|
2567
|
+
return e.filter((r) => St.isWelcomeMessage(r, t));
|
|
2416
2568
|
}
|
|
2417
|
-
function
|
|
2418
|
-
return
|
|
2569
|
+
function Wn(e, t) {
|
|
2570
|
+
return Us(e) === t;
|
|
2419
2571
|
}
|
|
2420
|
-
function
|
|
2572
|
+
function Us(e) {
|
|
2421
2573
|
var t;
|
|
2422
2574
|
if (e)
|
|
2423
2575
|
return e.isUserMessage() || e.isFileMessage() || e.isMultipleFilesMessage() ? e.sender.userId : ((t = e == null ? void 0 : e.sender) == null ? void 0 : t.userId) ?? void 0;
|
|
2424
2576
|
}
|
|
2425
|
-
function
|
|
2577
|
+
function Vs(e) {
|
|
2426
2578
|
return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
|
|
2427
2579
|
}
|
|
2428
|
-
const
|
|
2580
|
+
const Jt = (e) => !!e && "sender" in e, Gn = (e) => e.startsWith("image/"), jn = (e) => e.startsWith("video/"), Xt = (e) => Gn(e) || jn(e), He = {
|
|
2429
2581
|
isAdmin: (e) => e.isAdminMessage(),
|
|
2430
2582
|
isCSAT: (e) => {
|
|
2431
2583
|
var t;
|
|
2432
2584
|
return e.isAdminMessage() && !!((t = e.extendedMessagePayload) != null && t.csat);
|
|
2433
2585
|
},
|
|
2434
|
-
isIncoming: (e, t) =>
|
|
2435
|
-
isOutgoing: (e, t) =>
|
|
2436
|
-
},
|
|
2586
|
+
isIncoming: (e, t) => Jt(e) && e.sender.userId !== t,
|
|
2587
|
+
isOutgoing: (e, t) => Jt(e) && (e.sender.userId === t || e.sendingStatus === Mr.PENDING)
|
|
2588
|
+
}, Kn = ({ rootElementId: e, visible: t, onClose: r, children: o }) => {
|
|
2437
2589
|
if (!t) return null;
|
|
2438
|
-
const { rootElement: a } = B(), s =
|
|
2439
|
-
return
|
|
2440
|
-
/* @__PURE__ */ n.createElement(
|
|
2441
|
-
s.getElementById(e) ?? s.getElementById(
|
|
2590
|
+
const { rootElement: a } = B(), s = ue(a), i = ue(a, !0);
|
|
2591
|
+
return Rr(
|
|
2592
|
+
/* @__PURE__ */ n.createElement(Hs, { onClick: r }, /* @__PURE__ */ n.createElement(zs, { onClick: (l) => l.stopPropagation() }, o)),
|
|
2593
|
+
s.getElementById(e) ?? s.getElementById(ne.MODAL_ROOT) ?? i.body
|
|
2442
2594
|
);
|
|
2443
|
-
},
|
|
2444
|
-
function
|
|
2445
|
-
const { aiAgentInfo: t } =
|
|
2446
|
-
return t.profileUrl ? /* @__PURE__ */ n.createElement(
|
|
2595
|
+
}, Hs = c.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${d.color.overlay01};display:flex;justify-content:center;align-items:center;z-index:${ge.MODAL};`, zs = c.div`border-radius:4px;overflow:hidden;box-shadow:0 16px 24px 2px rgba(13,13,13,0.12),0 6px 30px 5px rgba(13,13,13,0.08),0 6px 10px -5px rgba(13,13,13,0.04);z-index:${ge.MODAL};`, Ws = c.div`flex-shrink:0;width:${({ $size: e }) => me(e)};height:${({ $size: e }) => me(e)};background-color:${({ theme: e }) => e.colors.base.primary};box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;}`, Gs = c(Et)`path{fill:${({ theme: e }) => Ge(e.colors.base.primary)};}`;
|
|
2596
|
+
function Zn({ size: e }) {
|
|
2597
|
+
const { aiAgentInfo: t } = P();
|
|
2598
|
+
return t.profileUrl ? /* @__PURE__ */ n.createElement(xt, { size: e, src: t.profileUrl }) : /* @__PURE__ */ n.createElement(Ws, { $size: e }, /* @__PURE__ */ n.createElement(Gs, null));
|
|
2447
2599
|
}
|
|
2448
|
-
const
|
|
2449
|
-
const { sender: o, type: a, url: s, name: i = "", threadInfo: l } = e, { profileUrl: u, nickname:
|
|
2600
|
+
const js = c.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, Ks = c.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${d.themedColor.onbackground4};background-color:${d.themedColor.background1};@media screen and (max-width:768px){position:relative;}`, Zs = c.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, Ys = c.div`margin-inline-end:8px;`, qs = c.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`, Js = c.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`, Xs = c.div`display:flex;width:160px;justify-content:flex-end;`, Qs = c.div`inset-inline-end:0;display:flex;flex-direction:row;`, lt = c.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, el = c(lt)`border-inline-start:1px solid ${d.themedColor.onbackground4};`, tl = c.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, nl = c.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, rl = c.img`max-width:90%;max-height:90%;user-select:none;-webkit-user-drag:none;`, ol = c.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, al = ({ message: e, onClose: t, onDownloadClick: r }) => {
|
|
2601
|
+
const { sender: o, type: a, url: s, name: i = "", threadInfo: l } = e, { profileUrl: u, nickname: p, userId: m } = o, { userSession: h, aiAgentInfo: g } = P();
|
|
2450
2602
|
return /* @__PURE__ */ n.createElement(
|
|
2451
|
-
|
|
2603
|
+
sl,
|
|
2452
2604
|
{
|
|
2453
2605
|
profileUrl: u,
|
|
2454
|
-
nickname:
|
|
2606
|
+
nickname: p,
|
|
2455
2607
|
type: a,
|
|
2456
2608
|
url: s,
|
|
2457
2609
|
name: i,
|
|
2458
2610
|
onClose: t,
|
|
2459
|
-
isBotMessage:
|
|
2460
|
-
isByMe:
|
|
2611
|
+
isBotMessage: m === g.userId,
|
|
2612
|
+
isByMe: h.userId === m,
|
|
2461
2613
|
disableDelete: l != null && l.replyCount ? l.replyCount > 0 : !1,
|
|
2462
2614
|
onDownloadClick: r
|
|
2463
2615
|
}
|
|
2464
2616
|
);
|
|
2465
|
-
},
|
|
2617
|
+
}, il = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ n.createElement(Zn, { size: 32 }) : /* @__PURE__ */ n.createElement(xt, { size: 32, src: e }), sl = ({
|
|
2466
2618
|
profileUrl: e,
|
|
2467
2619
|
isBotMessage: t,
|
|
2468
2620
|
nickname: r,
|
|
@@ -2472,34 +2624,34 @@ const Bi = c.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2472
2624
|
isByMe: i,
|
|
2473
2625
|
onClose: l,
|
|
2474
2626
|
onDelete: u,
|
|
2475
|
-
disableDelete:
|
|
2476
|
-
onDownloadClick:
|
|
2627
|
+
disableDelete: p,
|
|
2628
|
+
onDownloadClick: m
|
|
2477
2629
|
}) => {
|
|
2478
|
-
const { stringSet:
|
|
2479
|
-
return /* @__PURE__ */ n.createElement(
|
|
2480
|
-
|
|
2630
|
+
const { stringSet: h } = M();
|
|
2631
|
+
return /* @__PURE__ */ n.createElement(Kn, { onClose: l, visible: !0, rootElementId: ne.MODAL_ROOT }, /* @__PURE__ */ n.createElement(js, null, /* @__PURE__ */ n.createElement(Ks, null, /* @__PURE__ */ n.createElement(Zs, null, /* @__PURE__ */ n.createElement(Ys, null, /* @__PURE__ */ n.createElement(il, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ n.createElement(qs, null, /* @__PURE__ */ n.createElement(S, { variant: "h2", color: d.themedColor.onbackground1 }, o)), /* @__PURE__ */ n.createElement(Js, null, /* @__PURE__ */ n.createElement(S, { variant: "body1", color: d.color.ondark02 }, r))), /* @__PURE__ */ n.createElement(Xs, null, Xt(a) && /* @__PURE__ */ n.createElement(Qs, null, /* @__PURE__ */ n.createElement(lt, { as: "a", href: s, target: "_blank", rel: pt, onClick: m }, /* @__PURE__ */ n.createElement($, { type: "download", color: d.themedColor.onbackground1, size: 24 })), u && i && /* @__PURE__ */ n.createElement(
|
|
2632
|
+
lt,
|
|
2481
2633
|
{
|
|
2482
|
-
disabled:
|
|
2634
|
+
disabled: p,
|
|
2483
2635
|
onClick: () => {
|
|
2484
|
-
|
|
2636
|
+
p || u();
|
|
2485
2637
|
}
|
|
2486
2638
|
},
|
|
2487
2639
|
/* @__PURE__ */ n.createElement(
|
|
2488
|
-
|
|
2640
|
+
$,
|
|
2489
2641
|
{
|
|
2490
2642
|
type: "delete",
|
|
2491
|
-
color:
|
|
2643
|
+
color: p ? "gray" : d.themedColor.onbackground1,
|
|
2492
2644
|
size: 24
|
|
2493
2645
|
}
|
|
2494
2646
|
)
|
|
2495
|
-
)), /* @__PURE__ */ n.createElement(
|
|
2496
|
-
},
|
|
2647
|
+
)), /* @__PURE__ */ n.createElement(el, { onClick: l }, /* @__PURE__ */ n.createElement($, { type: "close", color: d.themedColor.onbackground1, size: 24 })))), /* @__PURE__ */ n.createElement(tl, { onClick: (g) => g.currentTarget === g.target && l() }, jn(a) && /* @__PURE__ */ n.createElement(nl, { controls: !0 }, /* @__PURE__ */ n.createElement("source", { src: s, type: a })), Gn(a) && /* @__PURE__ */ n.createElement(rl, { src: s, alt: o }), !Xt(a) && /* @__PURE__ */ n.createElement(ol, null, /* @__PURE__ */ n.createElement(S, { variant: "h1", color: d.themedColor.onbackground1 }, h.FILE_VIEWER__UNSUPPORT)))));
|
|
2648
|
+
}, Yn = ({
|
|
2497
2649
|
className: e,
|
|
2498
2650
|
locale: t,
|
|
2499
2651
|
date: r = Date.now(),
|
|
2500
2652
|
formatString: o = "MMMM dd, yyyy",
|
|
2501
2653
|
style: a
|
|
2502
|
-
}) => /* @__PURE__ */ n.createElement(
|
|
2654
|
+
}) => /* @__PURE__ */ n.createElement(ll, { style: a, className: e }, /* @__PURE__ */ n.createElement(S, { variant: "caption4", color: d.themedColor.textMidEmphasis }, We(r, o, { locale: t }))), ll = c.div`display:flex;justify-content:center;align-items:center;`, cl = sr(function(t, r) {
|
|
2503
2655
|
const {
|
|
2504
2656
|
messages: o,
|
|
2505
2657
|
renderMessage: a,
|
|
@@ -2507,32 +2659,32 @@ const Bi = c.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2507
2659
|
messageBottomArea: i,
|
|
2508
2660
|
overlayArea: l,
|
|
2509
2661
|
onLoadPrev: u,
|
|
2510
|
-
onLoadNext:
|
|
2511
|
-
loadThreshold:
|
|
2512
|
-
onScrollPosition:
|
|
2513
|
-
depsForResetScrollPositionToBottom:
|
|
2514
|
-
scrollPositionRef:
|
|
2662
|
+
onLoadNext: p,
|
|
2663
|
+
loadThreshold: m = 0.05,
|
|
2664
|
+
onScrollPosition: h = je,
|
|
2665
|
+
depsForResetScrollPositionToBottom: g,
|
|
2666
|
+
scrollPositionRef: b,
|
|
2515
2667
|
scrollDistanceFromBottomRef: E,
|
|
2516
2668
|
stackDirection: x = "top"
|
|
2517
|
-
} = t,
|
|
2669
|
+
} = t, f = r && "current" in r ? r : { current: null }, T = D(!1), C = D(void 0), w = D(0), O = D(0), J = D(0), X = b ?? O, v = E ?? J;
|
|
2518
2670
|
ye(() => {
|
|
2519
|
-
|
|
2520
|
-
},
|
|
2521
|
-
|
|
2522
|
-
}, [
|
|
2523
|
-
const
|
|
2524
|
-
if (!
|
|
2525
|
-
const
|
|
2526
|
-
if (
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2671
|
+
f.current && (f.current.scrollTop = f.current.scrollHeight);
|
|
2672
|
+
}, g), ye(() => {
|
|
2673
|
+
f.current && (C.current === "top" && (f.current.scrollTop = f.current.scrollHeight - X.current), C.current === "bottom" && (f.current.scrollTop = w.current), C.current = void 0);
|
|
2674
|
+
}, [f.current, o.length]);
|
|
2675
|
+
const Q = async () => {
|
|
2676
|
+
if (!f.current) return;
|
|
2677
|
+
const L = f.current;
|
|
2678
|
+
if (h(dl(L)), X.current = L.scrollHeight - L.scrollTop, v.current = X.current - L.clientHeight, w.current = L.scrollTop, T.current) return;
|
|
2679
|
+
const V = L.clientHeight * Math.min(Math.max(0, m), 1);
|
|
2680
|
+
L.scrollTop <= V ? (T.current = !0, C.current = "top", await u(), T.current = !1) : L.scrollHeight - L.scrollTop - L.clientHeight <= V ? (T.current = !0, C.current = "bottom", await p(), T.current = !1) : C.current = void 0;
|
|
2529
2681
|
};
|
|
2530
|
-
return /* @__PURE__ */ n.createElement(
|
|
2682
|
+
return /* @__PURE__ */ n.createElement(ul, { id: "infinite-list-container" }, /* @__PURE__ */ n.createElement(ml, { id: "infinite-list-inner", ref: f, onScroll: Q }, x === "bottom" && /* @__PURE__ */ n.createElement("div", { style: { flexGrow: 1 } }), s, o.map((L, V) => a({ message: L, index: V })), i), /* @__PURE__ */ n.createElement(pl, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ n.createElement(gl, { id: "infinite-list-overlay" }, l)));
|
|
2531
2683
|
});
|
|
2532
|
-
function
|
|
2684
|
+
function dl(e) {
|
|
2533
2685
|
return e.scrollTop <= 10 ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= 10 ? "bottom" : "middle";
|
|
2534
2686
|
}
|
|
2535
|
-
const
|
|
2687
|
+
const ul = c.div`display:flex;position:relative;flex:1;overflow:hidden;`, ml = c.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${d.themedColor.onbackground3}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, pl = c.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, gl = c.div`pointer-events:auto;`, hl = ({ className: e, onClick: t }) => /* @__PURE__ */ n.createElement(fl, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ n.createElement($, { size: 24, type: "chevron-down", color: d.color.primary.main })), fl = c.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:${d.color.shadow05};${U.light`
|
|
2536
2688
|
background-color: ${d.color.background50};
|
|
2537
2689
|
&:hover {
|
|
2538
2690
|
background-color: ${d.color.background100};
|
|
@@ -2541,7 +2693,7 @@ const tl = c.div`display:flex;position:relative;flex:1;overflow:hidden;`, nl = c
|
|
|
2541
2693
|
background-color: ${d.color.background200};
|
|
2542
2694
|
}
|
|
2543
2695
|
`}
|
|
2544
|
-
${
|
|
2696
|
+
${U.dark`
|
|
2545
2697
|
background-color: ${d.color.background400};
|
|
2546
2698
|
&:hover {
|
|
2547
2699
|
background-color: ${d.color.background500};
|
|
@@ -2554,98 +2706,99 @@ const tl = c.div`display:flex;position:relative;flex:1;overflow:hidden;`, nl = c
|
|
|
2554
2706
|
&:focus {
|
|
2555
2707
|
outline: none;
|
|
2556
2708
|
}
|
|
2557
|
-
`,
|
|
2558
|
-
const { agentPreviewConfigs: e = {}, aiAgentId: t } = B(), { aiAgentInfo: r } =
|
|
2709
|
+
`, bl = () => {
|
|
2710
|
+
const { agentPreviewConfigs: e = {}, aiAgentId: t } = B(), { aiAgentInfo: r } = P(), { stringSet: o, dateLocale: a } = M(), { messageSource: s } = K(), { Template: i } = pe.useContext(), l = e.welcomeMessages ?? [], u = s.messages, p = Fs(u, t), m = u[p.length + 1], h = p[0] ?? m;
|
|
2559
2711
|
return {
|
|
2560
2712
|
/**
|
|
2561
2713
|
* Returns a list of messages filtered according to business requirements.
|
|
2562
2714
|
*/
|
|
2563
|
-
filteredMessages:
|
|
2715
|
+
filteredMessages: u.filter((g) => Vs(g) ? !1 : l.length > 0 ? !St.isWelcomeMessage(g, t) : !0),
|
|
2564
2716
|
/**
|
|
2565
2717
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
2566
2718
|
*/
|
|
2567
|
-
shouldShowOriginalDate: (
|
|
2719
|
+
shouldShowOriginalDate: (g) => g > 0 || l.length === 0 ? !0 : m && !Er(m.createdAt, (h == null ? void 0 : h.createdAt) ?? 0),
|
|
2568
2720
|
/**
|
|
2569
2721
|
* Renders the list of welcome messages from Bot Studio.
|
|
2570
2722
|
*/
|
|
2571
|
-
renderAgentPreviewWelcomeMessages: () =>
|
|
2572
|
-
|
|
2723
|
+
renderAgentPreviewWelcomeMessages: () => l.length === 0 ? null : /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
2724
|
+
Yn,
|
|
2573
2725
|
{
|
|
2574
2726
|
style: { margin: "16px 0" },
|
|
2575
|
-
date:
|
|
2727
|
+
date: h == null ? void 0 : h.createdAt,
|
|
2576
2728
|
locale: a,
|
|
2577
2729
|
formatString: o.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
2578
2730
|
}
|
|
2579
|
-
),
|
|
2580
|
-
const
|
|
2731
|
+
), l.map((g, b) => {
|
|
2732
|
+
const E = b === l.length - 1, x = p.length !== u.length, f = l.length === 1 ? "single" : b === 0 ? "top" : E || x ? "bottom" : "middle";
|
|
2581
2733
|
return /* @__PURE__ */ n.createElement(
|
|
2582
|
-
|
|
2734
|
+
i,
|
|
2583
2735
|
{
|
|
2584
2736
|
messageType: "user",
|
|
2585
|
-
message:
|
|
2737
|
+
message: g.message,
|
|
2586
2738
|
sender: r,
|
|
2587
|
-
groupType:
|
|
2588
|
-
createdAt: (
|
|
2589
|
-
extendedMessagePayload: { suggested_replies:
|
|
2739
|
+
groupType: f,
|
|
2740
|
+
createdAt: (h == null ? void 0 : h.createdAt) ?? Date.now(),
|
|
2741
|
+
extendedMessagePayload: { suggested_replies: g.suggestedReplies },
|
|
2590
2742
|
suggestedRepliesDirection: e.suggestedRepliesDirection,
|
|
2591
|
-
suggestedRepliesVisible:
|
|
2743
|
+
suggestedRepliesVisible: E && !x,
|
|
2592
2744
|
isBotMessage: !0,
|
|
2593
|
-
onClickSuggestedReply: async ({ reply:
|
|
2594
|
-
|
|
2595
|
-
s.sendUserMessage(N, i).then(i);
|
|
2745
|
+
onClickSuggestedReply: async ({ reply: T }) => {
|
|
2746
|
+
s.sendUserMessage({ message: T });
|
|
2596
2747
|
}
|
|
2597
2748
|
}
|
|
2598
2749
|
);
|
|
2599
2750
|
}))
|
|
2600
2751
|
};
|
|
2601
|
-
},
|
|
2602
|
-
const { chatSDK: e } = B(), {
|
|
2752
|
+
}, qn = () => {
|
|
2753
|
+
const { chatSDK: e } = B(), { channelSource: t } = K(), [r, o] = y([]);
|
|
2603
2754
|
return cn(e, {
|
|
2604
2755
|
onTypingStatusUpdated(a) {
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2756
|
+
var s;
|
|
2757
|
+
if (a.url === ((s = t.channel) == null ? void 0 : s.url)) {
|
|
2758
|
+
const i = a.getTypingUsers();
|
|
2759
|
+
o(i);
|
|
2608
2760
|
}
|
|
2609
2761
|
}
|
|
2610
2762
|
}), r;
|
|
2611
2763
|
};
|
|
2612
|
-
function
|
|
2613
|
-
const { isDashboardActionbookTester: e } = Xe(), { aiAgentInfo: t } =
|
|
2614
|
-
return
|
|
2764
|
+
function El() {
|
|
2765
|
+
const { isDashboardActionbookTester: e } = Xe(), { aiAgentInfo: t } = P(), { scrollSource: r } = K(), o = qn(), { components: a } = pe.useContext(), [s] = o, i = !!s, l = e ? 0 : Me, u = (s == null ? void 0 : s.userId) === t.userId;
|
|
2766
|
+
return N(() => {
|
|
2615
2767
|
i && setTimeout(() => r.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } }), 25);
|
|
2616
|
-
}, [i]), i ? /* @__PURE__ */ n.createElement(
|
|
2768
|
+
}, [i]), i ? /* @__PURE__ */ n.createElement(xl, null, /* @__PURE__ */ n.createElement(vl, null, !e && /* @__PURE__ */ n.createElement(a.SenderAvatar, { isBotMessage: u, sender: u ? t : s }), /* @__PURE__ */ n.createElement(a.SenderName, { sender: s })), /* @__PURE__ */ n.createElement(yl, { $startPadding: l }, /* @__PURE__ */ n.createElement(In, null))) : null;
|
|
2617
2769
|
}
|
|
2618
|
-
const
|
|
2619
|
-
`,
|
|
2620
|
-
function
|
|
2770
|
+
const xl = c.div`display:flex;flex-direction:column;padding:0 ${q}px;`, vl = c.div`display:flex;align-items:center;gap:8px;`, yl = c.div`display:flex;padding-inline-start:${({ $startPadding: e }) => `${e}px`};
|
|
2771
|
+
`, Cl = (e) => c(e).withConfig({ shouldForwardProp: Lr });
|
|
2772
|
+
function _l(e) {
|
|
2621
2773
|
var o;
|
|
2622
2774
|
const t = "remove_powered_by", r = (o = e == null ? void 0 : e.appInfo) == null ? void 0 : o.applicationAttributes;
|
|
2623
2775
|
return Array.isArray(r) && r.includes(t);
|
|
2624
2776
|
}
|
|
2625
|
-
const
|
|
2777
|
+
const Tl = ({ style: e }) => {
|
|
2626
2778
|
const { stringSet: t } = M(), { chatSDK: r } = B(), { isDashboardActionbookTester: o } = Xe();
|
|
2627
|
-
return
|
|
2628
|
-
|
|
2779
|
+
return _l(r) || o ? null : /* @__PURE__ */ n.createElement(Sl, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ n.createElement(
|
|
2780
|
+
wl,
|
|
2629
2781
|
{
|
|
2630
2782
|
variant: "caption2",
|
|
2631
2783
|
as: "a",
|
|
2632
2784
|
href: "https://sendbird.com?utm_medium=product&utm_source=aiagent&utm_campaign=fy26-glbl-ai-agent-poweredby",
|
|
2633
2785
|
"aria-label": "Learn more about Sendbird",
|
|
2634
|
-
rel:
|
|
2786
|
+
rel: pt,
|
|
2635
2787
|
target: "_blank"
|
|
2636
2788
|
},
|
|
2637
2789
|
"Sendbird"
|
|
2638
2790
|
));
|
|
2639
|
-
},
|
|
2791
|
+
}, Sl = c(S)`color:${d.themedColor.onbackground3};text-align:center;`, wl = Cl(S)`
|
|
2640
2792
|
color: ${d.themedColor.onbackground3};
|
|
2641
2793
|
cursor: pointer;
|
|
2642
2794
|
text-decoration: none;
|
|
2643
|
-
`,
|
|
2644
|
-
|
|
2795
|
+
`, kl = () => {
|
|
2796
|
+
var u;
|
|
2797
|
+
const { stringSet: e } = M(), { activeChannel: t } = P(), { channelSource: r, goToActiveConversation: o, scrollSource: a } = K(), s = kn(r.channel), l = t && ((u = r.channel) == null ? void 0 : u.url) === (t == null ? void 0 : t.url) && s;
|
|
2645
2798
|
return ye(() => {
|
|
2646
2799
|
l && a.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
2647
|
-
}, [l]), l ? /* @__PURE__ */ n.createElement(
|
|
2648
|
-
|
|
2800
|
+
}, [l]), l ? /* @__PURE__ */ n.createElement(Al, null, /* @__PURE__ */ n.createElement(
|
|
2801
|
+
Il,
|
|
2649
2802
|
{
|
|
2650
2803
|
variant: "button",
|
|
2651
2804
|
role: "button",
|
|
@@ -2654,225 +2807,231 @@ const gl = ({ style: e }) => {
|
|
|
2654
2807
|
},
|
|
2655
2808
|
e.START_NEW_CONVERSATION
|
|
2656
2809
|
)) : null;
|
|
2657
|
-
},
|
|
2658
|
-
const [e, t] =
|
|
2659
|
-
|
|
2810
|
+
}, Al = c.div`display:flex;justify-content:center;margin:16px 0;`, Il = c(S)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${d.themedColor.onbackground4};cursor:pointer;user-select:none;`, $l = !0, Ml = () => {
|
|
2811
|
+
const [e, t] = y(null), { userSession: r, aiAgentInfo: o } = P(), { agentPreviewConfigs: a, chatSDK: s, state: i } = B(), { stringSet: l, dateLocale: u } = M(), { conversation: p, channelSource: m, messageSource: h, scrollSource: g } = K(), { isDashboardActionbookTester: b } = Xe(), { filteredMessages: E, shouldShowOriginalDate: x, renderAgentPreviewWelcomeMessages: f } = bl(), { storage: T } = hn(), { Template: C } = vt.useContext(), { Template: w } = pe.useContext(), { Template: O } = yt.useContext(), J = (v, Q = !1) => {
|
|
2812
|
+
var L;
|
|
2813
|
+
return Q ? o : ((L = m.channel) == null ? void 0 : L.members.find((V) => V.userId === v.sender.userId)) ?? v.sender;
|
|
2814
|
+
}, X = () => {
|
|
2815
|
+
if (!h.initialized)
|
|
2660
2816
|
return /* @__PURE__ */ n.createElement(Ce, { type: "loading" });
|
|
2661
|
-
if (
|
|
2662
|
-
const
|
|
2663
|
-
return
|
|
2817
|
+
if (h.messages.length === 0) {
|
|
2818
|
+
const v = f();
|
|
2819
|
+
return v ? /* @__PURE__ */ n.createElement("div", { style: { width: "100%" } }, v) : /* @__PURE__ */ n.createElement(Ce, { type: "noMessages", label: l.PLACE_HOLDER__NO_MESSAGES });
|
|
2664
2820
|
}
|
|
2665
2821
|
return /* @__PURE__ */ n.createElement(
|
|
2666
|
-
|
|
2822
|
+
cl,
|
|
2667
2823
|
{
|
|
2668
|
-
ref:
|
|
2669
|
-
scrollPositionRef:
|
|
2670
|
-
scrollDistanceFromBottomRef:
|
|
2671
|
-
onScrollPosition: (
|
|
2824
|
+
ref: g.scrollRef,
|
|
2825
|
+
scrollPositionRef: g.scrollPositionRef,
|
|
2826
|
+
scrollDistanceFromBottomRef: g.scrollDistanceFromBottomRef,
|
|
2827
|
+
onScrollPosition: (v) => g.setIsScrollBottomReached(v === "bottom"),
|
|
2672
2828
|
stackDirection: a == null ? void 0 : a.messageStackDirection,
|
|
2673
|
-
messages:
|
|
2674
|
-
onLoadPrev:
|
|
2675
|
-
onLoadNext:
|
|
2676
|
-
depsForResetScrollPositionToBottom: [
|
|
2677
|
-
messageTopArea: /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
2678
|
-
messageBottomArea: /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
2679
|
-
overlayArea: /* @__PURE__ */ n.createElement(n.Fragment, null, !
|
|
2680
|
-
renderMessage: ({ message:
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2683
|
-
},
|
|
2684
|
-
|
|
2829
|
+
messages: E,
|
|
2830
|
+
onLoadPrev: h.loadPrevious,
|
|
2831
|
+
onLoadNext: h.loadNext,
|
|
2832
|
+
depsForResetScrollPositionToBottom: [h.initialized, h.messages.length !== 0],
|
|
2833
|
+
messageTopArea: /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(Tl, { style: { marginTop: 16 } }), f()),
|
|
2834
|
+
messageBottomArea: /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(El, null), /* @__PURE__ */ n.createElement(kl, null)),
|
|
2835
|
+
overlayArea: /* @__PURE__ */ n.createElement(n.Fragment, null, !g.isScrollBottomReached && /* @__PURE__ */ n.createElement(Rl, { onClick: () => g.scrollPubSub.publish({ type: "scrollToBottom" }) })),
|
|
2836
|
+
renderMessage: ({ message: v, index: Q }) => {
|
|
2837
|
+
const L = Ds(v), V = E[Q - 1], Se = E[Q + 1], we = E[E.length - 1], Qe = v === we, I = Ps(v, V, Se, $l), A = !Or((V == null ? void 0 : V.createdAt) ?? 0, v.createdAt) && x(Q) && !b, R = () => {
|
|
2838
|
+
v.isFileMessage() && t(v);
|
|
2839
|
+
}, Z = () => {
|
|
2840
|
+
v.isFileMessage() && wn(v.url);
|
|
2841
|
+
}, he = A ? /* @__PURE__ */ n.createElement(
|
|
2842
|
+
Yn,
|
|
2685
2843
|
{
|
|
2686
2844
|
style: { margin: "16px 0" },
|
|
2687
|
-
date:
|
|
2845
|
+
date: v.createdAt,
|
|
2688
2846
|
locale: u,
|
|
2689
2847
|
formatString: l.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
2690
2848
|
}
|
|
2691
|
-
) : null,
|
|
2692
|
-
maxBodyWidth: i.expanded ?
|
|
2693
|
-
extendedMessagePayload:
|
|
2694
|
-
createdAt:
|
|
2695
|
-
groupType:
|
|
2696
|
-
onClickMedia:
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2849
|
+
) : null, re = {
|
|
2850
|
+
maxBodyWidth: i.expanded ? Cn : void 0,
|
|
2851
|
+
extendedMessagePayload: v.extendedMessagePayload,
|
|
2852
|
+
createdAt: v.createdAt,
|
|
2853
|
+
groupType: I,
|
|
2854
|
+
onClickMedia: R,
|
|
2855
|
+
onClickFile: Z
|
|
2856
|
+
}, W = (() => {
|
|
2857
|
+
var fe, be;
|
|
2858
|
+
if (He.isAdmin(v))
|
|
2859
|
+
return He.isCSAT(v) ? p ? /* @__PURE__ */ n.createElement(
|
|
2860
|
+
O,
|
|
2702
2861
|
{
|
|
2703
|
-
...
|
|
2704
|
-
...
|
|
2705
|
-
isResolvedWhenDeterminedByUser:
|
|
2862
|
+
...re,
|
|
2863
|
+
...p,
|
|
2864
|
+
isResolvedWhenDeterminedByUser: Ll(p),
|
|
2706
2865
|
messageType: "admin.csat",
|
|
2707
|
-
onSubmitCSAT: ({ csat:
|
|
2708
|
-
|
|
2866
|
+
onSubmitCSAT: ({ csat: H, csatType: se, csatReason: G, isResolved: Ee }) => {
|
|
2867
|
+
var kt;
|
|
2868
|
+
H && ((kt = m.channel) == null || kt.submitCSAT({ csat: H, csatType: se, csatReason: G, isResolved: Ee }));
|
|
2709
2869
|
}
|
|
2710
2870
|
}
|
|
2711
|
-
) : null : /* @__PURE__ */ n.createElement(
|
|
2712
|
-
if (
|
|
2713
|
-
const
|
|
2714
|
-
...
|
|
2715
|
-
message:
|
|
2716
|
-
sender:
|
|
2717
|
-
sendingStatus:
|
|
2871
|
+
) : null : /* @__PURE__ */ n.createElement(O, { ...re, messageType: "admin", message: v.message });
|
|
2872
|
+
if (He.isOutgoing(v, r.userId)) {
|
|
2873
|
+
const H = {
|
|
2874
|
+
...re,
|
|
2875
|
+
message: v.message,
|
|
2876
|
+
sender: J(v),
|
|
2877
|
+
sendingStatus: v.sendingStatus
|
|
2718
2878
|
};
|
|
2719
|
-
if (
|
|
2720
|
-
return /* @__PURE__ */ n.createElement(
|
|
2721
|
-
if (
|
|
2722
|
-
const [
|
|
2879
|
+
if (v.isUserMessage())
|
|
2880
|
+
return /* @__PURE__ */ n.createElement(C, { messageType: "user", ...H });
|
|
2881
|
+
if (v.isFileMessage()) {
|
|
2882
|
+
const [se, G] = ((fe = v.metaArrays.find((Ee) => Ee.key === zn)) == null ? void 0 : fe.value) ?? [];
|
|
2723
2883
|
return /* @__PURE__ */ n.createElement(
|
|
2724
|
-
|
|
2884
|
+
C,
|
|
2725
2885
|
{
|
|
2726
2886
|
messageType: "file",
|
|
2727
|
-
file:
|
|
2887
|
+
file: v,
|
|
2728
2888
|
metadata: {
|
|
2729
|
-
aspectRatio:
|
|
2730
|
-
localFile: (
|
|
2889
|
+
aspectRatio: se && G ? `${se}/${G}` : "1/1",
|
|
2890
|
+
localFile: (be = v.messageParams) == null ? void 0 : be.file
|
|
2731
2891
|
},
|
|
2732
|
-
...
|
|
2892
|
+
...H
|
|
2733
2893
|
}
|
|
2734
2894
|
);
|
|
2735
2895
|
}
|
|
2736
2896
|
}
|
|
2737
|
-
if (
|
|
2738
|
-
const
|
|
2739
|
-
...
|
|
2740
|
-
sender:
|
|
2741
|
-
message:
|
|
2742
|
-
suggestedRepliesVisible:
|
|
2897
|
+
if (He.isIncoming(v, r.userId)) {
|
|
2898
|
+
const H = v.sender.userId === o.userId, se = {
|
|
2899
|
+
...re,
|
|
2900
|
+
sender: J(v, H),
|
|
2901
|
+
message: v.message,
|
|
2902
|
+
suggestedRepliesVisible: Qe,
|
|
2743
2903
|
suggestedRepliesDirection: a == null ? void 0 : a.suggestedRepliesDirection,
|
|
2744
|
-
isBotMessage:
|
|
2904
|
+
isBotMessage: H,
|
|
2745
2905
|
onClickSuggestedReply: async ({ reply: G }) => {
|
|
2746
|
-
|
|
2747
|
-
g.sendUserMessage(oe, h).then(h);
|
|
2906
|
+
h.sendUserMessage({ message: G });
|
|
2748
2907
|
},
|
|
2749
2908
|
onRequestMessageTemplate: async (G) => {
|
|
2750
|
-
const { template:
|
|
2751
|
-
return
|
|
2909
|
+
const { template: Ee } = await s.aiAgent.getMessageTemplate(G);
|
|
2910
|
+
return T.setTemplate(G, Ee), Ee;
|
|
2752
2911
|
},
|
|
2753
|
-
onGetCachedMessageTemplate: (G) =>
|
|
2912
|
+
onGetCachedMessageTemplate: (G) => T.getTemplate(G)
|
|
2754
2913
|
};
|
|
2755
|
-
if (
|
|
2756
|
-
return /* @__PURE__ */ n.createElement(
|
|
2757
|
-
if (
|
|
2758
|
-
return /* @__PURE__ */ n.createElement(
|
|
2914
|
+
if (v.isUserMessage())
|
|
2915
|
+
return /* @__PURE__ */ n.createElement(w, { messageType: "user", ...se });
|
|
2916
|
+
if (v.isFileMessage())
|
|
2917
|
+
return /* @__PURE__ */ n.createElement(w, { messageType: "file", file: v, ...se });
|
|
2759
2918
|
}
|
|
2760
2919
|
})();
|
|
2761
|
-
return /* @__PURE__ */ n.createElement("div", { key:
|
|
2920
|
+
return /* @__PURE__ */ n.createElement("div", { key: L, id: `${Y}-message-item` }, he, W);
|
|
2762
2921
|
}
|
|
2763
2922
|
}
|
|
2764
2923
|
);
|
|
2765
2924
|
};
|
|
2766
|
-
return /* @__PURE__ */ n.createElement(
|
|
2767
|
-
},
|
|
2768
|
-
function
|
|
2925
|
+
return /* @__PURE__ */ n.createElement(Ol, { id: `${Y}-message-list` }, X(), e && /* @__PURE__ */ n.createElement(al, { onClose: () => t(null), message: e }));
|
|
2926
|
+
}, Ol = c.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Rl = c(hl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
|
|
2927
|
+
function Ll(e) {
|
|
2769
2928
|
var t;
|
|
2770
2929
|
if (((t = e == null ? void 0 : e.resolution) == null ? void 0 : t.determinedBy) === "user")
|
|
2771
2930
|
return e.resolution.isResolved;
|
|
2772
2931
|
}
|
|
2773
|
-
const
|
|
2774
|
-
const { stringSet: e } = M(), { connectionError: t } =
|
|
2775
|
-
if (
|
|
2776
|
-
const
|
|
2777
|
-
return /* @__PURE__ */ n.createElement(Ce, { type: "error", label:
|
|
2932
|
+
const Nl = () => {
|
|
2933
|
+
const { stringSet: e } = M(), { connectionError: t } = P(), { channelSource: r } = K(), o = t || r.error;
|
|
2934
|
+
if (o) {
|
|
2935
|
+
const a = t ? void 0 : { label: e.RETRY, onClick: () => r.refetch() };
|
|
2936
|
+
return /* @__PURE__ */ n.createElement(Ce, { type: "error", label: o.message, action: a });
|
|
2778
2937
|
}
|
|
2779
|
-
return r ? /* @__PURE__ */ n.createElement(
|
|
2780
|
-
},
|
|
2781
|
-
const { stringSet: e } = M(), { activeChannel: t } =
|
|
2938
|
+
return r.channel ? /* @__PURE__ */ n.createElement(Ml, null) : /* @__PURE__ */ n.createElement(Ce, { type: "loading" });
|
|
2939
|
+
}, Jn = () => {
|
|
2940
|
+
const { stringSet: e } = M(), { activeChannel: t } = P(), [r] = y(() => (t == null ? void 0 : t.status) === z.OPEN);
|
|
2782
2941
|
return r ? e.RETURN_TO_CONVERSATION : e.START_NEW_CONVERSATION;
|
|
2783
|
-
},
|
|
2784
|
-
const { stringSet: e } = M(), { goToActiveConversation: t } = K(), r =
|
|
2785
|
-
return /* @__PURE__ */ n.createElement(
|
|
2786
|
-
},
|
|
2942
|
+
}, Bl = () => {
|
|
2943
|
+
const { stringSet: e } = M(), { goToActiveConversation: t } = K(), r = Jn();
|
|
2944
|
+
return /* @__PURE__ */ n.createElement(Dl, null, /* @__PURE__ */ n.createElement(S, { variant: "body1", color: d.themedColor.textMidEmphasis }, e.CONVERSATION_CLOSED_FOOTER_LABEL), /* @__PURE__ */ n.createElement(Pl, { onClick: t }, /* @__PURE__ */ n.createElement(S, { variant: "button", color: d.themedColor.textHighEmphasis }, r)));
|
|
2945
|
+
}, Dl = c.div`display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 0;gap:14px;${U.light`
|
|
2787
2946
|
background-color: ${d.color.background100};
|
|
2788
2947
|
`}
|
|
2789
|
-
${
|
|
2948
|
+
${U.dark`
|
|
2790
2949
|
background-color: ${d.color.background500};
|
|
2791
2950
|
`}
|
|
2792
|
-
`,
|
|
2951
|
+
`, Pl = c.button`all:unset;padding:10px 20px;border-radius:6px;border:1px solid ${d.themedColor.textDisabled};cursor:pointer;${U.light`
|
|
2793
2952
|
background-color: ${d.color.background50};
|
|
2794
2953
|
`}
|
|
2795
|
-
${
|
|
2954
|
+
${U.dark`
|
|
2796
2955
|
background-color: ${d.color.background700};
|
|
2797
2956
|
`}
|
|
2798
|
-
`,
|
|
2799
|
-
const { stringSet: t } = M(), { aiAgentInfo: r } =
|
|
2957
|
+
`, Xn = _e(void 0), Fl = ({ children: e }) => {
|
|
2958
|
+
const { stringSet: t } = M(), { aiAgentInfo: r } = P(), [o, a] = y([]), [s, i] = y({
|
|
2800
2959
|
visible: !1,
|
|
2801
2960
|
title: "",
|
|
2802
2961
|
buttonText: t.BUTTON__OK
|
|
2803
|
-
}), l = r == null ? void 0 : r.replyToFile, u = (
|
|
2962
|
+
}), l = r == null ? void 0 : r.replyToFile, u = (h) => {
|
|
2804
2963
|
if (!l) return;
|
|
2805
|
-
const
|
|
2806
|
-
if (
|
|
2807
|
-
if (
|
|
2808
|
-
i((
|
|
2809
|
-
...
|
|
2964
|
+
const g = h.filter((b) => xn.includes(b.type));
|
|
2965
|
+
if (g.length !== 0) {
|
|
2966
|
+
if (g.some((b) => b.size > fo)) {
|
|
2967
|
+
i((b) => ({
|
|
2968
|
+
...b,
|
|
2810
2969
|
visible: !0,
|
|
2811
2970
|
title: t.FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT.replace("%d", "25")
|
|
2812
2971
|
}));
|
|
2813
2972
|
return;
|
|
2814
2973
|
}
|
|
2815
|
-
if (
|
|
2816
|
-
i((
|
|
2817
|
-
...
|
|
2974
|
+
if (g.length > 1 || g.length > 0 && o.length > 0) {
|
|
2975
|
+
i((b) => ({
|
|
2976
|
+
...b,
|
|
2818
2977
|
visible: !0,
|
|
2819
2978
|
title: t.FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT
|
|
2820
2979
|
}));
|
|
2821
2980
|
return;
|
|
2822
2981
|
}
|
|
2823
|
-
a((
|
|
2824
|
-
...
|
|
2825
|
-
...
|
|
2982
|
+
a((b) => [
|
|
2983
|
+
...b,
|
|
2984
|
+
...g.map((E) => ({
|
|
2826
2985
|
file: E,
|
|
2827
2986
|
preview: { url: URL.createObjectURL(E), type: E.type, name: E.name }
|
|
2828
2987
|
}))
|
|
2829
2988
|
]);
|
|
2830
2989
|
}
|
|
2831
|
-
},
|
|
2832
|
-
a((
|
|
2990
|
+
}, p = (h) => {
|
|
2991
|
+
a((g) => {
|
|
2833
2992
|
var E;
|
|
2834
|
-
const
|
|
2835
|
-
return
|
|
2993
|
+
const b = (E = g[h]) == null ? void 0 : E.preview;
|
|
2994
|
+
return b && URL.revokeObjectURL(b.url), g.filter((x, f) => f !== h);
|
|
2836
2995
|
});
|
|
2837
|
-
},
|
|
2838
|
-
a((
|
|
2996
|
+
}, m = () => {
|
|
2997
|
+
a((h) => (h.forEach((g) => URL.revokeObjectURL(g.preview.url)), []));
|
|
2839
2998
|
};
|
|
2840
2999
|
return /* @__PURE__ */ n.createElement(
|
|
2841
|
-
|
|
3000
|
+
Xn.Provider,
|
|
2842
3001
|
{
|
|
2843
3002
|
value: {
|
|
2844
3003
|
files: o,
|
|
2845
3004
|
addFiles: u,
|
|
2846
|
-
removeFile:
|
|
2847
|
-
clearFiles:
|
|
3005
|
+
removeFile: p,
|
|
3006
|
+
clearFiles: m,
|
|
2848
3007
|
isFileUploadEnabled: l
|
|
2849
3008
|
}
|
|
2850
3009
|
},
|
|
2851
3010
|
e,
|
|
2852
|
-
/* @__PURE__ */ n.createElement(
|
|
3011
|
+
/* @__PURE__ */ n.createElement(Ul, { ...s, onClose: () => i((h) => ({ ...h, visible: !1, title: "" })) })
|
|
2853
3012
|
);
|
|
2854
|
-
},
|
|
2855
|
-
const e =
|
|
3013
|
+
}, wt = () => {
|
|
3014
|
+
const e = te(Xn);
|
|
2856
3015
|
if (!e)
|
|
2857
3016
|
throw new Error("useFileUpload must be used within FileUploadProvider");
|
|
2858
3017
|
return e;
|
|
2859
|
-
},
|
|
3018
|
+
}, Ul = ({
|
|
2860
3019
|
title: e,
|
|
2861
3020
|
buttonText: t,
|
|
2862
3021
|
visible: r,
|
|
2863
3022
|
onClose: o
|
|
2864
|
-
}) => /* @__PURE__ */ n.createElement(
|
|
2865
|
-
function
|
|
2866
|
-
const o =
|
|
3023
|
+
}) => /* @__PURE__ */ n.createElement(Kn, { rootElementId: ne.WINDOW, visible: r, onClose: o }, /* @__PURE__ */ n.createElement(Vl, null, /* @__PURE__ */ n.createElement(zl, null, /* @__PURE__ */ n.createElement(S, { variant: "h1", color: d.themedColor.onbackground1 }, e)), /* @__PURE__ */ n.createElement(Hl, null, /* @__PURE__ */ n.createElement(Wl, { onClick: o }, /* @__PURE__ */ n.createElement(S, { variant: "button", color: d.themedColor.oncontent1 }, t))))), Vl = c.div`width:100%;height:auto;padding-block:18px 24px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, Hl = c.div`display:flex;flex-direction:row;justify-content:flex-end;`, zl = c.div`margin-bottom:16px;`, Wl = c.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${d.themedColor.error};border:1px solid ${d.themedColor.error};padding:10px 16px;&:hover{background-color:${d.color.error.dark};border-color:${d.color.error.dark};}&:active{background-color:${d.color.error.extraDark};}`;
|
|
3024
|
+
function Gl({ blurred: e, elementRef: t, document: r = window.document }) {
|
|
3025
|
+
const o = D(!1);
|
|
2867
3026
|
e && t.current && r.activeElement === t.current && (o.current = !0), ye(() => {
|
|
2868
3027
|
var a;
|
|
2869
3028
|
!e && o.current && ((a = t.current) == null || a.focus(), o.current = !1);
|
|
2870
3029
|
}, [e]);
|
|
2871
3030
|
}
|
|
2872
|
-
const
|
|
3031
|
+
const jl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, Kl = c.div`display:flex;flex-shrink:0;position:relative;margin-block-start:8px;border-radius:12px;height:64px;img{border-radius:12px;object-fit:cover;width:64px;-webkit-user-drag:none;}`, Zl = c.div`display:flex;align-items:center;justify-content:center;position:absolute;inset-inline-end:-8px;inset-block-start:-8px;cursor:pointer;border-radius:50%;${U.light`
|
|
2873
3032
|
background-color: ${d.color.background50};
|
|
2874
3033
|
`}
|
|
2875
|
-
${
|
|
3034
|
+
${U.dark`
|
|
2876
3035
|
background-color: ${d.color.background500};
|
|
2877
3036
|
`}
|
|
2878
3037
|
path {
|
|
@@ -2888,19 +3047,19 @@ const Bl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2888
3047
|
circle {
|
|
2889
3048
|
stroke: ${d.themedColor.background1};
|
|
2890
3049
|
}
|
|
2891
|
-
`,
|
|
2892
|
-
const e =
|
|
2893
|
-
return !s || o.length === 0 ? null : /* @__PURE__ */ n.createElement(
|
|
2894
|
-
},
|
|
2895
|
-
const { stringSet: r } = M(), { aiAgentInfo: o } =
|
|
3050
|
+
`, Yl = () => {
|
|
3051
|
+
const e = Ne(), [t, r] = y(), { files: o, removeFile: a, isFileUploadEnabled: s } = wt();
|
|
3052
|
+
return !s || o.length === 0 ? null : /* @__PURE__ */ n.createElement(jl, null, o.map(({ preview: { type: i, name: l, url: u } }, p) => /* @__PURE__ */ n.createElement(Kl, { key: u, onMouseOver: () => r(p), onMouseLeave: () => r(void 0) }, (e || t === p) && /* @__PURE__ */ n.createElement(Zl, { title: "Remove file", onClick: () => a(p) }, /* @__PURE__ */ n.createElement($, { type: "close-filled", color: d.themedColor.onbackground2 })), i.startsWith("image/") ? /* @__PURE__ */ n.createElement("img", { alt: "file-image", src: u }) : /* @__PURE__ */ n.createElement(bt, { name: l, type: ft(l, i) }))));
|
|
3053
|
+
}, ql = ({ channel: e, messages: t }) => {
|
|
3054
|
+
const { stringSet: r } = M(), { aiAgentInfo: o } = P(), a = Jl(), s = Xl({
|
|
2896
3055
|
lastMessage: t[t.length - 1],
|
|
2897
3056
|
aiAgentUserId: o.userId
|
|
2898
3057
|
});
|
|
2899
|
-
return !e || !a ||
|
|
2900
|
-
},
|
|
2901
|
-
const e =
|
|
2902
|
-
return
|
|
2903
|
-
const a = new
|
|
3058
|
+
return !e || !a || kn(e) ? [!0, r.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : s ? [!0, r.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, r.MESSAGE_INPUT__PLACE_HOLDER];
|
|
3059
|
+
}, Jl = () => {
|
|
3060
|
+
const e = an(), { chatSDK: t } = B(), [r, o] = y(!0);
|
|
3061
|
+
return N(() => {
|
|
3062
|
+
const a = new ct({
|
|
2904
3063
|
onDisconnected: () => o(!1),
|
|
2905
3064
|
onConnected: () => o(!0),
|
|
2906
3065
|
onReconnectSucceeded: () => o(!0)
|
|
@@ -2909,23 +3068,23 @@ const Bl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2909
3068
|
t.removeConnectionHandler(e);
|
|
2910
3069
|
};
|
|
2911
3070
|
}, [t]), r;
|
|
2912
|
-
},
|
|
3071
|
+
}, Xl = ({
|
|
2913
3072
|
lastMessage: e,
|
|
2914
3073
|
aiAgentUserId: t
|
|
2915
3074
|
}) => {
|
|
2916
|
-
const [r, o] =
|
|
2917
|
-
return
|
|
3075
|
+
const [r, o] = y(!1), a = qn();
|
|
3076
|
+
return N(() => {
|
|
2918
3077
|
if (!e) return;
|
|
2919
|
-
const s = a.some((l) => l.userId === t), i =
|
|
3078
|
+
const s = a.some((l) => l.userId === t), i = Wn(e, t) && St.isStreaming(e);
|
|
2920
3079
|
o(!!(i || s));
|
|
2921
3080
|
}, [a, e, t]), r;
|
|
2922
|
-
},
|
|
3081
|
+
}, Qn = {
|
|
2923
3082
|
textArea: k`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
|
|
2924
3083
|
attachIcon: k`margin-bottom:4px;`
|
|
2925
|
-
},
|
|
2926
|
-
const t =
|
|
3084
|
+
}, er = c.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, Ql = c(er)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${d.themedColor.onbackground1};}}&:active{border-radius:4px;background-color:${d.themedColor.background3};}}${Ct && Qn.attachIcon};`, ec = c.input`display:none;`, Qt = c.div`width:100%;position:relative;background-color:${d.themedColor.background2};border-radius:20px;`, en = c.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, tn = c.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:${d.themedColor.onbackground1};resize:none;width:100%;height:${En}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${Ct && Qn.textArea};&::placeholder{color:${d.themedColor.onbackground3};}&:disabled{cursor:not-allowed;&::placeholder{color:${d.themedColor.onbackground4};}}`, nn = c.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, rn = ({ disabled: e }) => {
|
|
3085
|
+
const t = D(null), { addFiles: r, clearFiles: o, files: a, isFileUploadEnabled: s } = wt();
|
|
2927
3086
|
return !s || a.length > 0 ? null : /* @__PURE__ */ n.createElement(
|
|
2928
|
-
|
|
3087
|
+
Ql,
|
|
2929
3088
|
{
|
|
2930
3089
|
disabled: e,
|
|
2931
3090
|
onClick: () => {
|
|
@@ -2934,7 +3093,7 @@ const Bl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2934
3093
|
}
|
|
2935
3094
|
},
|
|
2936
3095
|
/* @__PURE__ */ n.createElement(
|
|
2937
|
-
|
|
3096
|
+
$,
|
|
2938
3097
|
{
|
|
2939
3098
|
type: "attach",
|
|
2940
3099
|
color: e ? d.themedColor.onbackground4 : d.themedColor.onbackground2,
|
|
@@ -2942,7 +3101,7 @@ const Bl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2942
3101
|
}
|
|
2943
3102
|
),
|
|
2944
3103
|
/* @__PURE__ */ n.createElement(
|
|
2945
|
-
|
|
3104
|
+
ec,
|
|
2946
3105
|
{
|
|
2947
3106
|
type: "file",
|
|
2948
3107
|
ref: t,
|
|
@@ -2950,169 +3109,169 @@ const Bl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2950
3109
|
const l = i.currentTarget.files;
|
|
2951
3110
|
l && r(Array.from(l)), i.target.value = "";
|
|
2952
3111
|
},
|
|
2953
|
-
accept:
|
|
3112
|
+
accept: xn.join(",")
|
|
2954
3113
|
}
|
|
2955
3114
|
)
|
|
2956
3115
|
);
|
|
2957
|
-
},
|
|
2958
|
-
const e =
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
},
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
3116
|
+
}, tc = () => {
|
|
3117
|
+
const e = D(null), [t, r] = y(""), { rootElement: o } = B(), { channelSource: a, messageSource: s } = K(), [i, l] = ql({
|
|
3118
|
+
channel: a.channel,
|
|
3119
|
+
messages: s.messages
|
|
3120
|
+
}), { files: u, addFiles: p, clearFiles: m } = wt();
|
|
3121
|
+
Rs({ onDropFiles: p }), Gl({ blurred: i, elementRef: e, document: ue(o) });
|
|
3122
|
+
const h = t.trim().length > 0, g = u.length > 0, b = !i && (h || g), E = () => {
|
|
3123
|
+
e.current && (e.current.value = "", e.current.style.height = ""), m(), r("");
|
|
3124
|
+
}, x = async () => {
|
|
3125
|
+
const w = t.trim(), O = { message: w };
|
|
3126
|
+
if (!(!w && !u.length)) {
|
|
3127
|
+
if (u.length > 0) {
|
|
3128
|
+
const J = u[0].file, X = { ...O, file: J };
|
|
3129
|
+
s.sendFileMessage(X), E();
|
|
3130
|
+
return;
|
|
3131
|
+
}
|
|
3132
|
+
s.sendUserMessage(O), E();
|
|
2969
3133
|
}
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
},
|
|
2976
|
-
w.key !== "Enter" || w.nativeEvent.isComposing || w.shiftKey || (w.preventDefault(), S());
|
|
2977
|
-
}, N = (w) => {
|
|
3134
|
+
}, f = (w) => {
|
|
3135
|
+
const O = Array.from(w.clipboardData.files);
|
|
3136
|
+
O.length > 0 && (w.preventDefault(), p(O));
|
|
3137
|
+
}, T = (w) => {
|
|
3138
|
+
w.key !== "Enter" || w.nativeEvent.isComposing || w.shiftKey || (w.preventDefault(), x());
|
|
3139
|
+
}, C = (w) => {
|
|
2978
3140
|
if (e.current) {
|
|
2979
3141
|
e.current.style.height = "";
|
|
2980
|
-
const
|
|
2981
|
-
|
|
3142
|
+
const O = Math.min(ho, e.current.scrollHeight);
|
|
3143
|
+
En < O && (e.current.style.height = `${O}px`);
|
|
2982
3144
|
}
|
|
2983
3145
|
r(w.target.value);
|
|
2984
3146
|
};
|
|
2985
|
-
return
|
|
2986
|
-
|
|
3147
|
+
return i ? /* @__PURE__ */ n.createElement(nn, null, /* @__PURE__ */ n.createElement(Qt, null, /* @__PURE__ */ n.createElement(en, null, /* @__PURE__ */ n.createElement(tn, { disabled: !0, placeholder: l }), /* @__PURE__ */ n.createElement(rn, { disabled: !0 })))) : /* @__PURE__ */ n.createElement(nn, null, /* @__PURE__ */ n.createElement(Qt, null, /* @__PURE__ */ n.createElement(Yl, null), /* @__PURE__ */ n.createElement(en, null, /* @__PURE__ */ n.createElement(
|
|
3148
|
+
tn,
|
|
2987
3149
|
{
|
|
2988
3150
|
ref: e,
|
|
2989
3151
|
role: "textbox",
|
|
2990
3152
|
"aria-label": "Text Input",
|
|
2991
|
-
placeholder:
|
|
3153
|
+
placeholder: l,
|
|
2992
3154
|
maxLength: 5e3,
|
|
2993
|
-
onKeyDown:
|
|
2994
|
-
onChange:
|
|
2995
|
-
onPaste:
|
|
3155
|
+
onKeyDown: T,
|
|
3156
|
+
onChange: C,
|
|
3157
|
+
onPaste: f
|
|
2996
3158
|
}
|
|
2997
|
-
), /* @__PURE__ */ n.createElement(
|
|
2998
|
-
},
|
|
3159
|
+
), /* @__PURE__ */ n.createElement(rn, null))), b && /* @__PURE__ */ n.createElement(er, { onClick: () => x() }, /* @__PURE__ */ n.createElement($, { type: "send", color: d.color.primary.main, size: 20 })));
|
|
3160
|
+
}, nc = c.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:${d.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${U.light`
|
|
2999
3161
|
color: ${d.color.information.light};
|
|
3000
3162
|
`};
|
|
3001
|
-
${
|
|
3163
|
+
${U.dark`
|
|
3002
3164
|
color: ${d.color.information.main};
|
|
3003
3165
|
`};
|
|
3004
3166
|
}
|
|
3005
|
-
`,
|
|
3006
|
-
const { aiAgentInfo: e } =
|
|
3007
|
-
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((a) =>
|
|
3008
|
-
},
|
|
3009
|
-
var s;
|
|
3010
|
-
const { activeChannel: e } =
|
|
3011
|
-
return !((t == null ? void 0 :
|
|
3012
|
-
},
|
|
3013
|
-
var
|
|
3014
|
-
const { state: e, logger: t, enableCloseConversationButton: r, enableExpandButton: o, dispatcher: a } = B(), { stringSet: s } = M(), { aiAgentInfo: i, activeChannel: l } =
|
|
3167
|
+
`, rc = _(() => import("./Cc9Mb_d1.js").then((e) => ({ default: e.MarkdownText }))), oc = () => {
|
|
3168
|
+
const { aiAgentInfo: e } = P(), { messageSource: t } = K(), { userSession: r } = P();
|
|
3169
|
+
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((a) => Wn(a, r.userId))) ? null : /* @__PURE__ */ n.createElement(nc, null, /* @__PURE__ */ n.createElement(rc, null, e.specialNotice));
|
|
3170
|
+
}, ac = () => /* @__PURE__ */ n.createElement(ic, null, /* @__PURE__ */ n.createElement(oc, null), /* @__PURE__ */ n.createElement(Fl, null, /* @__PURE__ */ n.createElement(tc, null))), ic = c.div`z-index:0;border:none;width:100%;`, sc = () => {
|
|
3171
|
+
var s, i, l;
|
|
3172
|
+
const { activeChannel: e } = P(), { channelSource: t } = K(), r = ((i = (s = t.channel) == null ? void 0 : s.conversation) == null ? void 0 : i.status) === z.CLOSED;
|
|
3173
|
+
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && r ? /* @__PURE__ */ n.createElement(Bl, null) : /* @__PURE__ */ n.createElement(ac, null);
|
|
3174
|
+
}, lc = () => {
|
|
3175
|
+
var C;
|
|
3176
|
+
const { state: e, logger: t, enableCloseConversationButton: r, enableExpandButton: o, dispatcher: a } = B(), { stringSet: s } = M(), { aiAgentInfo: i, activeChannel: l } = P(), { channelSource: u, onNavigateToConversationList: p } = K(), m = u.channel, g = Ne() ? 24 : 16, b = () => {
|
|
3015
3177
|
e.setOpened(!1);
|
|
3016
|
-
},
|
|
3178
|
+
}, E = async () => {
|
|
3017
3179
|
try {
|
|
3018
|
-
const
|
|
3019
|
-
t.info("conversation.handleAgentHandoff: success",
|
|
3020
|
-
} catch (
|
|
3021
|
-
t.error("conversation.handleAgentHandoff: error",
|
|
3180
|
+
const w = await (m == null ? void 0 : m.markConversationAsHandoff());
|
|
3181
|
+
t.info("conversation.handleAgentHandoff: success", w);
|
|
3182
|
+
} catch (w) {
|
|
3183
|
+
t.error("conversation.handleAgentHandoff: error", w);
|
|
3022
3184
|
}
|
|
3023
|
-
},
|
|
3024
|
-
|
|
3025
|
-
},
|
|
3026
|
-
return /* @__PURE__ */ n.createElement(
|
|
3027
|
-
|
|
3185
|
+
}, x = async () => {
|
|
3186
|
+
m && await a.send(Gr.CloseConversation());
|
|
3187
|
+
}, f = l && (m == null ? void 0 : m.url) === l.url, T = i.showHandoffButton && !!((C = m == null ? void 0 : m.conversation) != null && C.handoff) && f;
|
|
3188
|
+
return /* @__PURE__ */ n.createElement(pc, null, /* @__PURE__ */ n.createElement(gc, null, p && /* @__PURE__ */ n.createElement(Be, { onClick: () => p() }, /* @__PURE__ */ n.createElement($, { type: "menu", size: 24, color: d.themedColor.textHighEmphasis })), f && /* @__PURE__ */ n.createElement(Zn, { size: 34 }), /* @__PURE__ */ n.createElement(fc, { variant: "h2", color: d.themedColor.onbackground1 }, i.nickname || (m == null ? void 0 : m.name))), /* @__PURE__ */ n.createElement(hc, null, T && /* @__PURE__ */ n.createElement(
|
|
3189
|
+
mc,
|
|
3028
3190
|
{
|
|
3029
3191
|
tooltipLabel: s.HEADER_BUTTON__AGENT_HANDOFF,
|
|
3030
|
-
disabled: !
|
|
3031
|
-
size:
|
|
3032
|
-
onClick:
|
|
3192
|
+
disabled: !ya(m),
|
|
3193
|
+
size: g,
|
|
3194
|
+
onClick: E
|
|
3033
3195
|
}
|
|
3034
3196
|
), r && /* @__PURE__ */ n.createElement(
|
|
3035
|
-
|
|
3197
|
+
uc,
|
|
3036
3198
|
{
|
|
3037
|
-
disabled: !
|
|
3038
|
-
size:
|
|
3039
|
-
onClick:
|
|
3199
|
+
disabled: !An(m),
|
|
3200
|
+
size: g,
|
|
3201
|
+
onClick: x
|
|
3040
3202
|
}
|
|
3041
|
-
), o && /* @__PURE__ */ n.createElement(
|
|
3042
|
-
},
|
|
3203
|
+
), o && /* @__PURE__ */ n.createElement(cc, { size: g }), /* @__PURE__ */ n.createElement(dc, { size: g, onClick: b })));
|
|
3204
|
+
}, cc = ({ size: e, disabled: t }) => {
|
|
3043
3205
|
const { state: r } = B();
|
|
3044
|
-
return /* @__PURE__ */ n.createElement(
|
|
3045
|
-
},
|
|
3046
|
-
|
|
3206
|
+
return /* @__PURE__ */ n.createElement(Be, { "aria-label": "expand", onClick: () => r.setExpanded(!r.expanded), disabled: t }, /* @__PURE__ */ n.createElement($, { type: r.expanded ? "collapse" : "expand", size: e, color: d.themedColor.textHighEmphasis }));
|
|
3207
|
+
}, dc = ({ size: e, disabled: t, onClick: r }) => /* @__PURE__ */ n.createElement(Be, { "aria-label": "close messenger", onClick: r, disabled: t }, /* @__PURE__ */ n.createElement($, { type: "close", size: e, color: d.themedColor.textHighEmphasis })), uc = ({ size: e, disabled: t, onClick: r }) => /* @__PURE__ */ n.createElement(Be, { "aria-label": "close conversation", onClick: r, disabled: t }, /* @__PURE__ */ n.createElement(
|
|
3208
|
+
$,
|
|
3047
3209
|
{
|
|
3048
3210
|
type: "refresh",
|
|
3049
3211
|
size: e,
|
|
3050
3212
|
color: t ? d.themedColor.textDisabled : d.themedColor.textHighEmphasis
|
|
3051
3213
|
}
|
|
3052
|
-
)),
|
|
3053
|
-
|
|
3214
|
+
)), mc = ({ size: e, onClick: t, disabled: r, tooltipLabel: o }) => /* @__PURE__ */ n.createElement(Ln, { label: o, position: "bottom", disabled: r }, /* @__PURE__ */ n.createElement(Be, { "aria-label": "agent", onClick: t, disabled: r }, /* @__PURE__ */ n.createElement(
|
|
3215
|
+
$,
|
|
3054
3216
|
{
|
|
3055
3217
|
type: "agent",
|
|
3056
3218
|
size: e,
|
|
3057
3219
|
color: r ? d.themedColor.textDisabled : d.themedColor.textHighEmphasis
|
|
3058
3220
|
}
|
|
3059
|
-
))),
|
|
3221
|
+
))), pc = c.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${d.themedColor.onbackground4};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, gc = c.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, hc = c.div`display:flex;gap:10px;align-items:center;justify-content:center;`, fc = c(S)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Be = c.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, bc = () => {
|
|
3060
3222
|
const { isDashboardActionbookTester: e } = Xe();
|
|
3061
|
-
return e ? null : /* @__PURE__ */ n.createElement(
|
|
3062
|
-
},
|
|
3223
|
+
return e ? null : /* @__PURE__ */ n.createElement(lc, null);
|
|
3224
|
+
}, on = ({
|
|
3063
3225
|
children: e,
|
|
3064
3226
|
onNavigateToConversationList: t,
|
|
3065
3227
|
closedChannelUrl: r,
|
|
3066
3228
|
onClearClosedChannelUrl: o
|
|
3067
3229
|
}) => /* @__PURE__ */ n.createElement(
|
|
3068
|
-
|
|
3230
|
+
Os,
|
|
3069
3231
|
{
|
|
3070
3232
|
onNavigateToConversationList: t,
|
|
3071
3233
|
closedChannelUrl: r,
|
|
3072
3234
|
onClearClosedChannelUrl: o
|
|
3073
3235
|
},
|
|
3074
|
-
/* @__PURE__ */ n.createElement(
|
|
3075
|
-
),
|
|
3076
|
-
|
|
3077
|
-
|
|
3236
|
+
/* @__PURE__ */ n.createElement(st, null, /* @__PURE__ */ n.createElement(st.Consumer, null, (a) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(Ec, { ...a }, /* @__PURE__ */ n.createElement(bc, null), /* @__PURE__ */ n.createElement(Nl, null), /* @__PURE__ */ n.createElement(sc, null)), e)))
|
|
3237
|
+
), Ec = c.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
|
|
3238
|
+
Provider: xc,
|
|
3239
|
+
useContext: tr
|
|
3240
|
+
} = j("ConversationList");
|
|
3241
|
+
function vc({
|
|
3242
|
+
onOpenConversationView: e = je,
|
|
3078
3243
|
children: t
|
|
3079
3244
|
}) {
|
|
3080
|
-
|
|
3081
|
-
aiAgentId: o,
|
|
3082
|
-
status: j.CLOSED,
|
|
3083
|
-
order: br.UPDATED_AT,
|
|
3084
|
-
reverse: !0
|
|
3085
|
-
});
|
|
3086
|
-
return /* @__PURE__ */ n.createElement(cc.Provider, { value: { dataSource: a, onOpenConversationView: e } }, t);
|
|
3245
|
+
return /* @__PURE__ */ n.createElement(Jr, null, (r) => /* @__PURE__ */ n.createElement(xc, { value: { ...r, onOpenConversationView: e } }, t));
|
|
3087
3246
|
}
|
|
3088
|
-
const
|
|
3247
|
+
const yc = ({ onClick: e, conversation: t }) => {
|
|
3089
3248
|
var a;
|
|
3090
3249
|
const { stringSet: r, dateLocale: o } = M();
|
|
3091
|
-
return /* @__PURE__ */ n.createElement(
|
|
3250
|
+
return /* @__PURE__ */ n.createElement(Cc, { role: "button", onClick: () => e == null ? void 0 : e() }, /* @__PURE__ */ n.createElement(Tc, null, /* @__PURE__ */ n.createElement(Sc, null, /* @__PURE__ */ n.createElement(S, { variant: "subtitle1", color: d.themedColor.textHighEmphasis }, We(t.channelInfo.lastMessageTs, r.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE, {
|
|
3092
3251
|
locale: o
|
|
3093
|
-
})), /* @__PURE__ */ n.createElement(
|
|
3252
|
+
})), /* @__PURE__ */ n.createElement(S, { variant: "caption2", color: d.themedColor.textLowEmphasis }, We(
|
|
3094
3253
|
t.channelInfo.lastMessageTs,
|
|
3095
3254
|
r.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION,
|
|
3096
3255
|
{ locale: o }
|
|
3097
|
-
))), /* @__PURE__ */ n.createElement(
|
|
3098
|
-
},
|
|
3256
|
+
))), /* @__PURE__ */ n.createElement(S, { variant: "body3", color: d.themedColor.textMidEmphasis }, ((a = t.topics) == null ? void 0 : a.join(", ")) || r.CONVERSATION_LIST__TOPICS_FALLBACK)), /* @__PURE__ */ n.createElement($, { type: "chevron-right", size: 16, color: d.themedColor.textHighEmphasis }), /* @__PURE__ */ n.createElement(_c, null));
|
|
3257
|
+
}, Cc = c.div`display:flex;flex-direction:row;align-items:center;position:relative;width:100%;padding:14px 16px;box-sizing:border-box;gap:4px;cursor:pointer;`, _c = c.div`position:absolute;bottom:0;height:1px;width:calc(100% - 32px);background-color:${d.themedColor.onbackground4};`, Tc = c.div`gap:4px;display:flex;flex-direction:column;flex:1;`, Sc = c.div`display:flex;justify-content:flex-start;align-items:center;gap:6px;`, wc = ({ items: e, renderItem: t, onEndReached: r }) => {
|
|
3099
3258
|
const o = (a) => {
|
|
3100
3259
|
const s = a.target;
|
|
3101
3260
|
s.scrollHeight - s.scrollTop === s.clientHeight && (r == null || r());
|
|
3102
3261
|
};
|
|
3103
|
-
return /* @__PURE__ */ n.createElement(
|
|
3104
|
-
},
|
|
3105
|
-
const { stringSet: e } = M(), {
|
|
3262
|
+
return /* @__PURE__ */ n.createElement(kc, { onScroll: (a) => o(a) }, e.map((a, s) => t(a, s)));
|
|
3263
|
+
}, kc = c.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`, Ac = () => {
|
|
3264
|
+
const { stringSet: e } = M(), { listSource: t, onOpenConversationView: r } = tr();
|
|
3106
3265
|
return t.initialized ? t.conversations.length === 0 ? /* @__PURE__ */ n.createElement(Ce, { type: "noChannels", label: e.CONVERSATION_LIST__NO_CONVERSATIONS }) : /* @__PURE__ */ n.createElement(
|
|
3107
|
-
|
|
3266
|
+
wc,
|
|
3108
3267
|
{
|
|
3109
3268
|
items: t.conversations,
|
|
3110
3269
|
renderItem: (o, a) => /* @__PURE__ */ n.createElement(
|
|
3111
|
-
|
|
3270
|
+
yc,
|
|
3112
3271
|
{
|
|
3113
3272
|
key: a,
|
|
3114
3273
|
conversation: o,
|
|
3115
|
-
onClick: () => r(o.channelInfo.url,
|
|
3274
|
+
onClick: () => r(o.channelInfo.url, z.CLOSED)
|
|
3116
3275
|
}
|
|
3117
3276
|
),
|
|
3118
3277
|
onEndReached: () => {
|
|
@@ -3120,43 +3279,43 @@ const uc = ({ onClick: e, conversation: t }) => {
|
|
|
3120
3279
|
}
|
|
3121
3280
|
}
|
|
3122
3281
|
) : /* @__PURE__ */ n.createElement(Ce, { type: "loading" });
|
|
3123
|
-
},
|
|
3124
|
-
const { refreshActiveChannel: e } =
|
|
3282
|
+
}, Ic = () => {
|
|
3283
|
+
const { refreshActiveChannel: e } = P(), { onOpenConversationView: t } = tr(), r = Jn();
|
|
3125
3284
|
return /* @__PURE__ */ n.createElement(
|
|
3126
|
-
|
|
3285
|
+
$c,
|
|
3127
3286
|
{
|
|
3128
3287
|
role: "button",
|
|
3129
3288
|
onClick: async () => {
|
|
3130
3289
|
const o = await e();
|
|
3131
|
-
t(o,
|
|
3290
|
+
t(o, z.OPEN);
|
|
3132
3291
|
}
|
|
3133
3292
|
},
|
|
3134
|
-
/* @__PURE__ */ n.createElement(
|
|
3293
|
+
/* @__PURE__ */ n.createElement(Mc, { variant: "h1" }, r)
|
|
3135
3294
|
);
|
|
3136
|
-
},
|
|
3295
|
+
}, $c = c.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, Mc = c(S)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, Oc = () => {
|
|
3137
3296
|
const { stringSet: e } = M();
|
|
3138
|
-
return /* @__PURE__ */ n.createElement(
|
|
3139
|
-
},
|
|
3140
|
-
function
|
|
3141
|
-
const e =
|
|
3297
|
+
return /* @__PURE__ */ n.createElement(Rc, null, /* @__PURE__ */ n.createElement(Lc, { variant: "h2", color: d.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ n.createElement(Nc, null));
|
|
3298
|
+
}, Rc = c.div`display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;flex-shrink:0;height:56px;position:relative;background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Lc = c(S)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Nc = c.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${d.themedColor.onbackground4};`, Bc = ({ children: e, onOpenConversationView: t }) => /* @__PURE__ */ n.createElement(vc, { onOpenConversationView: t }, /* @__PURE__ */ n.createElement(Dc, null, /* @__PURE__ */ n.createElement(Oc, null), /* @__PURE__ */ n.createElement(Ac, null), /* @__PURE__ */ n.createElement(Ic, null)), e), Dc = c.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, nr = _e(null);
|
|
3299
|
+
function Pc() {
|
|
3300
|
+
const e = te(nr);
|
|
3142
3301
|
if (!e)
|
|
3143
3302
|
throw new Error("useNavigator() must be used within <Navigator />");
|
|
3144
3303
|
return e;
|
|
3145
3304
|
}
|
|
3146
|
-
function
|
|
3147
|
-
const t =
|
|
3305
|
+
function rr({ children: e }) {
|
|
3306
|
+
const t = Pc();
|
|
3148
3307
|
return typeof e == "function" ? e(t) : /* @__PURE__ */ n.createElement(n.Fragment, null, e);
|
|
3149
3308
|
}
|
|
3150
|
-
const
|
|
3309
|
+
const Fc = ln`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, Uc = ln`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, Vc = k`animation-name:${Fc};animation-duration:0.3s;animation-fill-mode:forwards;`, Hc = k``, zc = k`animation-name:${Uc};animation-duration:0.3s;animation-fill-mode:forwards;`, Wc = k`visibility:hidden;`, Gc = c.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
|
|
3151
3310
|
switch (e) {
|
|
3152
3311
|
case "entering":
|
|
3153
|
-
return
|
|
3312
|
+
return Vc;
|
|
3154
3313
|
case "entered":
|
|
3155
|
-
return
|
|
3314
|
+
return Hc;
|
|
3156
3315
|
case "exiting":
|
|
3157
|
-
return
|
|
3316
|
+
return zc;
|
|
3158
3317
|
case "exited":
|
|
3159
|
-
return
|
|
3318
|
+
return Wc;
|
|
3160
3319
|
default:
|
|
3161
3320
|
return "";
|
|
3162
3321
|
}
|
|
@@ -3164,141 +3323,141 @@ const Ic = ln`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
|
|
|
3164
3323
|
z-index: 999;
|
|
3165
3324
|
` : k`z-index:1;pointer-events:none;`}
|
|
3166
3325
|
`;
|
|
3167
|
-
function
|
|
3168
|
-
const r =
|
|
3169
|
-
u((
|
|
3170
|
-
...
|
|
3171
|
-
[
|
|
3172
|
-
})),
|
|
3173
|
-
...
|
|
3174
|
-
[
|
|
3326
|
+
function Ae({ initialId: e, children: t }) {
|
|
3327
|
+
const r = F((f, T) => {
|
|
3328
|
+
u((C) => [...C, f]), m((C) => ({ ...C, [f]: !0 })), T != null && T.reset && E((C) => ({
|
|
3329
|
+
...C,
|
|
3330
|
+
[f]: (C[f] || 0) + 1
|
|
3331
|
+
})), g((C) => ({
|
|
3332
|
+
...C,
|
|
3333
|
+
[f]: "entering"
|
|
3175
3334
|
})), setTimeout(() => {
|
|
3176
|
-
|
|
3177
|
-
...
|
|
3178
|
-
[
|
|
3335
|
+
g((C) => ({
|
|
3336
|
+
...C,
|
|
3337
|
+
[f]: "entered"
|
|
3179
3338
|
}));
|
|
3180
3339
|
}, 300);
|
|
3181
|
-
}, []), o =
|
|
3182
|
-
u((
|
|
3183
|
-
if (
|
|
3184
|
-
const
|
|
3185
|
-
return
|
|
3186
|
-
...
|
|
3187
|
-
[
|
|
3340
|
+
}, []), o = F(() => {
|
|
3341
|
+
u((f) => {
|
|
3342
|
+
if (f.length <= 1) return f;
|
|
3343
|
+
const T = f[f.length - 1];
|
|
3344
|
+
return g((C) => ({
|
|
3345
|
+
...C,
|
|
3346
|
+
[T]: "exiting"
|
|
3188
3347
|
})), setTimeout(() => {
|
|
3189
|
-
|
|
3190
|
-
...
|
|
3191
|
-
[
|
|
3192
|
-
})), u((
|
|
3193
|
-
}, 300),
|
|
3348
|
+
g((C) => ({
|
|
3349
|
+
...C,
|
|
3350
|
+
[T]: "exited"
|
|
3351
|
+
})), u((C) => C.slice(0, -1));
|
|
3352
|
+
}, 300), f;
|
|
3194
3353
|
});
|
|
3195
3354
|
}, []), a = ve(() => ({
|
|
3196
3355
|
navigation: {
|
|
3197
3356
|
navigate: r,
|
|
3198
3357
|
pop: o
|
|
3199
3358
|
}
|
|
3200
|
-
}), [r, o]), s = ve(() =>
|
|
3201
|
-
(
|
|
3359
|
+
}), [r, o]), s = ve(() => lr.toArray(t).filter(
|
|
3360
|
+
(f) => f.type === rr
|
|
3202
3361
|
), [t]), i = ve(() => {
|
|
3203
|
-
const
|
|
3204
|
-
return s.forEach((
|
|
3205
|
-
const { id:
|
|
3206
|
-
|
|
3207
|
-
}),
|
|
3208
|
-
}, [s]), [l, u] =
|
|
3209
|
-
const
|
|
3210
|
-
return Object.entries(i).forEach(([
|
|
3211
|
-
|
|
3212
|
-
}),
|
|
3213
|
-
}), [
|
|
3214
|
-
const
|
|
3215
|
-
return Object.keys(i).forEach((
|
|
3216
|
-
|
|
3217
|
-
}),
|
|
3218
|
-
}), [
|
|
3219
|
-
return /* @__PURE__ */ n.createElement(
|
|
3220
|
-
var
|
|
3221
|
-
if (!
|
|
3222
|
-
const
|
|
3223
|
-
return /* @__PURE__ */ n.createElement(
|
|
3362
|
+
const f = {};
|
|
3363
|
+
return s.forEach((T) => {
|
|
3364
|
+
const { id: C, lazy: w, children: O } = T.props;
|
|
3365
|
+
f[C] = { lazy: w, element: typeof O == "function" ? O(a) : O };
|
|
3366
|
+
}), f;
|
|
3367
|
+
}, [s]), [l, u] = y([e]), [p, m] = y(() => {
|
|
3368
|
+
const f = {};
|
|
3369
|
+
return Object.entries(i).forEach(([T, { lazy: C }]) => {
|
|
3370
|
+
C === !1 && (f[T] = !0);
|
|
3371
|
+
}), f[e] = !0, f;
|
|
3372
|
+
}), [h, g] = y(() => {
|
|
3373
|
+
const f = {};
|
|
3374
|
+
return Object.keys(i).forEach((T) => {
|
|
3375
|
+
T === e ? f[T] = "entered" : f[T] = "exited";
|
|
3376
|
+
}), f;
|
|
3377
|
+
}), [b, E] = y({}), x = l[l.length - 1];
|
|
3378
|
+
return /* @__PURE__ */ n.createElement(nr.Provider, { value: a }, /* @__PURE__ */ n.createElement(jc, null, Object.keys(i).map((f) => {
|
|
3379
|
+
var O;
|
|
3380
|
+
if (!p[f]) return null;
|
|
3381
|
+
const T = h[f] || "exited", C = f === x, w = `${f}-${b[f] || 0}`;
|
|
3382
|
+
return /* @__PURE__ */ n.createElement(Gc, { key: w, $transitionState: T, $active: C }, (O = i[f]) == null ? void 0 : O.element);
|
|
3224
3383
|
})));
|
|
3225
3384
|
}
|
|
3226
|
-
const
|
|
3227
|
-
|
|
3228
|
-
const
|
|
3385
|
+
const jc = c.div`position:relative;width:100%;height:100%;`;
|
|
3386
|
+
Ae.Screen = rr;
|
|
3387
|
+
const le = {
|
|
3229
3388
|
activeConv: "active-conv",
|
|
3230
3389
|
closedConv: "closed-conv",
|
|
3231
3390
|
convList: "conv-list"
|
|
3232
|
-
},
|
|
3233
|
-
|
|
3391
|
+
}, or = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ n.createElement(Ae, { initialId: le.activeConv }, /* @__PURE__ */ n.createElement(Ae.Screen, { id: le.activeConv }, ({ navigation: r }) => /* @__PURE__ */ n.createElement(on, { onNavigateToConversationList: () => r.navigate(le.convList, { reset: !0 }) })), /* @__PURE__ */ n.createElement(Ae.Screen, { id: le.closedConv }, ({ navigation: r }) => /* @__PURE__ */ n.createElement(
|
|
3392
|
+
on,
|
|
3234
3393
|
{
|
|
3235
3394
|
onNavigateToConversationList: () => r.pop(),
|
|
3236
3395
|
closedChannelUrl: t,
|
|
3237
3396
|
onClearClosedChannelUrl: () => e(void 0)
|
|
3238
3397
|
}
|
|
3239
|
-
)), /* @__PURE__ */ n.createElement(
|
|
3240
|
-
|
|
3398
|
+
)), /* @__PURE__ */ n.createElement(Ae.Screen, { id: le.convList, lazy: !0 }, ({ navigation: r }) => /* @__PURE__ */ n.createElement(
|
|
3399
|
+
Bc,
|
|
3241
3400
|
{
|
|
3242
3401
|
onOpenConversationView: (o, a) => {
|
|
3243
|
-
a === "closed" ? (e(o), r.navigate(
|
|
3402
|
+
a === "closed" ? (e(o), r.navigate(le.closedConv, { reset: !0 })) : r.navigate(le.activeConv);
|
|
3244
3403
|
}
|
|
3245
3404
|
}
|
|
3246
3405
|
)));
|
|
3247
|
-
function
|
|
3406
|
+
function Kc({ isExpanded: e, isOpened: t, children: r, launcher: o }) {
|
|
3248
3407
|
const { dir: a } = B();
|
|
3249
|
-
return /* @__PURE__ */ n.createElement(
|
|
3408
|
+
return /* @__PURE__ */ n.createElement(Zc, null, /* @__PURE__ */ n.createElement(Yc, { dir: a, id: ne.WINDOW, $isExpanded: e, $isOpened: t }, r), o);
|
|
3250
3409
|
}
|
|
3251
|
-
const
|
|
3252
|
-
const r =
|
|
3253
|
-
return /* @__PURE__ */ n.createElement(
|
|
3254
|
-
|
|
3410
|
+
const Zc = c.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Yc = c.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 && Jc};${({ $isExpanded: e }) => e && qc};`, qc = k`width:743px;height:723px;`, Jc = k`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;`, vd = ({ children: e, ...t }) => {
|
|
3411
|
+
const r = Ne(), [o, a] = y(), s = r ? Fn : Kc;
|
|
3412
|
+
return /* @__PURE__ */ n.createElement(Pn, { enableExpandButton: !r, ...t }, /* @__PURE__ */ n.createElement(Nn, null, ({ state: i }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(s, { isExpanded: i.expanded, isOpened: i.opened, launcher: /* @__PURE__ */ n.createElement(Hn, null) }, /* @__PURE__ */ n.createElement(
|
|
3413
|
+
or,
|
|
3255
3414
|
{
|
|
3256
3415
|
closedChannelUrl: o,
|
|
3257
3416
|
setClosedChannelUrl: a
|
|
3258
3417
|
}
|
|
3259
3418
|
)), e)));
|
|
3260
3419
|
};
|
|
3261
|
-
function
|
|
3262
|
-
return /* @__PURE__ */ n.createElement(
|
|
3420
|
+
function Xc(e) {
|
|
3421
|
+
return /* @__PURE__ */ n.createElement(Qc, { ...e });
|
|
3263
3422
|
}
|
|
3264
|
-
const
|
|
3265
|
-
function
|
|
3423
|
+
const Qc = c(Hn)`position:fixed;z-index:${ge.LAUNCHER};bottom:24px;inset-inline-end:24px;`;
|
|
3424
|
+
function ed({ isExpanded: e, isOpened: t, children: r }) {
|
|
3266
3425
|
const { dir: o } = B();
|
|
3267
|
-
return /* @__PURE__ */ n.createElement(
|
|
3426
|
+
return /* @__PURE__ */ n.createElement(td, { dir: o, id: ne.WINDOW, $isExpanded: e, $isOpened: t }, r);
|
|
3268
3427
|
}
|
|
3269
|
-
const
|
|
3270
|
-
const r =
|
|
3271
|
-
return /* @__PURE__ */ n.createElement(
|
|
3272
|
-
|
|
3428
|
+
const td = c.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;position:fixed;bottom:84px;inset-inline-end:20px;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 && rd};${({ $isExpanded: e }) => e && nd};`, nd = k`width:743px;height:723px;`, rd = k`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;`, yd = ({ children: e, ...t }) => {
|
|
3429
|
+
const r = Ne(), [o, a] = y(), s = r ? Fn : ed;
|
|
3430
|
+
return /* @__PURE__ */ n.createElement(Pn, { enableExpandButton: !r, ...t }, /* @__PURE__ */ n.createElement(Nn, null, ({ state: i }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(s, { isExpanded: i.expanded, isOpened: i.opened }, /* @__PURE__ */ n.createElement(
|
|
3431
|
+
or,
|
|
3273
3432
|
{
|
|
3274
3433
|
closedChannelUrl: o,
|
|
3275
3434
|
setClosedChannelUrl: a
|
|
3276
3435
|
}
|
|
3277
|
-
)), /* @__PURE__ */ n.createElement(
|
|
3436
|
+
)), /* @__PURE__ */ n.createElement(Xc, null), e)));
|
|
3278
3437
|
};
|
|
3279
3438
|
export {
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3439
|
+
pt as A,
|
|
3440
|
+
Gr as C,
|
|
3441
|
+
vd as D,
|
|
3442
|
+
yd as F,
|
|
3443
|
+
$ as I,
|
|
3444
|
+
On as L,
|
|
3445
|
+
os as M,
|
|
3446
|
+
vt as O,
|
|
3447
|
+
xd as P,
|
|
3448
|
+
yt as S,
|
|
3449
|
+
S as a,
|
|
3450
|
+
Pn as b,
|
|
3292
3451
|
d as c,
|
|
3293
|
-
|
|
3294
|
-
|
|
3452
|
+
Zi as d,
|
|
3453
|
+
P as e,
|
|
3295
3454
|
M as f,
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3455
|
+
bs as g,
|
|
3456
|
+
pe as h,
|
|
3457
|
+
ce as i,
|
|
3458
|
+
on as j,
|
|
3459
|
+
Bc as k,
|
|
3301
3460
|
mn as l,
|
|
3302
|
-
|
|
3461
|
+
gs as m,
|
|
3303
3462
|
B as u
|
|
3304
3463
|
};
|