@sendbird/ai-agent-messenger-react 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/B0k-GApQ.cjs +1 -0
- package/dist/cjs/B3amOKMy.cjs +1 -0
- package/dist/cjs/B9NJk4MI.cjs +1 -0
- package/dist/cjs/BCFOnu0u.cjs +1 -0
- package/dist/cjs/BKtl4FE5.cjs +1 -0
- package/dist/cjs/BN09c8-A.cjs +1 -0
- package/dist/cjs/Bb0r6Nhu.cjs +1 -0
- package/dist/cjs/BfJ7Izyu.cjs +207 -0
- package/dist/cjs/BmdfYY9c.cjs +1 -0
- package/dist/cjs/BsgzT_SF.cjs +1 -0
- package/dist/cjs/C-xAG8K6.cjs +1 -0
- package/dist/cjs/C7tppvZu.cjs +1 -0
- package/dist/cjs/CEjis_lK.cjs +1 -0
- package/dist/cjs/CKPzhVy2.cjs +1 -0
- package/dist/cjs/CXa-CGHE.cjs +1 -0
- package/dist/cjs/Ce1MzjFq.cjs +1 -0
- package/dist/cjs/Cf3-irI8.cjs +1 -0
- package/dist/cjs/CmWLVNPR.cjs +1 -0
- package/dist/cjs/CtHfgPDp.cjs +1 -0
- package/dist/cjs/D00MOxhE.cjs +1 -0
- package/dist/cjs/D1kINslt.cjs +1 -0
- package/dist/cjs/D3l33ZWe.cjs +1 -0
- package/dist/cjs/D97ZpKUC.cjs +1 -0
- package/dist/cjs/DFIibgIj.cjs +1 -0
- package/dist/cjs/DKjB_ZFo.cjs +1 -0
- package/dist/cjs/DNmdC4-j.cjs +1 -0
- package/dist/cjs/DcDTXo8_.cjs +1 -0
- package/dist/cjs/DlvEEpWX.cjs +1 -0
- package/dist/cjs/DqpDy_26.cjs +1 -0
- package/dist/cjs/Dr0IKtV9.cjs +1 -0
- package/dist/cjs/JA0x62Fd.cjs +1 -0
- package/dist/cjs/_YfLwFkX.cjs +1 -0
- package/dist/cjs/c6TZaE94.cjs +1 -0
- package/dist/cjs/eJXfXI1_.cjs +1 -0
- package/dist/cjs/kp5wcW4s.cjs +1 -0
- package/dist/cjs/nmePqxlD.cjs +1 -0
- package/dist/cjs/ohTjxqcW.cjs +1 -0
- package/dist/cjs/wf-LdaaN.cjs +1 -0
- package/dist/cjs/ygZY2D-5.cjs +1 -0
- package/dist/cjs/zbLY6xl_.cjs +1 -0
- package/dist/es/{BXYgriG3.js → C5iCey_D.js} +790 -798
- package/dist/es/CDvzufwm.js +32 -0
- package/dist/es/{C58hkclZ.js → CSENM0Ja.js} +1 -1
- package/dist/es/Ch_6OPTz.js +298 -0
- package/dist/es/{Do6SFGnr.js → Cj-eLEq_.js} +1 -1
- package/dist/es/{BLb52EXE.js → DnQv_mT2.js} +1 -1
- package/dist/es/{BLgWjiCI.js → O53SSRM8.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/7sOpksia.cjs +0 -1
- package/dist/cjs/8n-lNFQi.cjs +0 -1
- package/dist/cjs/B3UTkiZj.cjs +0 -1
- package/dist/cjs/BA7eP_0y.cjs +0 -1
- package/dist/cjs/BAVQt3SD.cjs +0 -1
- package/dist/cjs/BCgKHuFY.cjs +0 -1
- package/dist/cjs/BE_UkM2D.cjs +0 -1
- package/dist/cjs/BIQTp46D.cjs +0 -1
- package/dist/cjs/BdOKSPN6.cjs +0 -1
- package/dist/cjs/Bgi113yh.cjs +0 -1
- package/dist/cjs/Bj4NR2YK.cjs +0 -1
- package/dist/cjs/BlL9mJ1G.cjs +0 -1
- package/dist/cjs/BqEtwmXd.cjs +0 -1
- package/dist/cjs/Bt7i9B_X.cjs +0 -1
- package/dist/cjs/CCMVMvEA.cjs +0 -1
- package/dist/cjs/CCeC8Z_c.cjs +0 -1
- package/dist/cjs/CI0UG_vg.cjs +0 -1
- package/dist/cjs/CYWHwsSv.cjs +0 -1
- package/dist/cjs/CYokBh9g.cjs +0 -1
- package/dist/cjs/CbUzmxPM.cjs +0 -1
- package/dist/cjs/Ck7-iOpx.cjs +0 -1
- package/dist/cjs/CsHNpYuX.cjs +0 -1
- package/dist/cjs/CtPGsbRN.cjs +0 -1
- package/dist/cjs/D-9eFzYR.cjs +0 -1
- package/dist/cjs/D2OIGiV4.cjs +0 -1
- package/dist/cjs/D4zXKBh-.cjs +0 -1
- package/dist/cjs/D6IK2BmB.cjs +0 -1
- package/dist/cjs/DDP53huc.cjs +0 -1
- package/dist/cjs/DRna04x8.cjs +0 -1
- package/dist/cjs/DkhICmYA.cjs +0 -1
- package/dist/cjs/DxL6Qc1e.cjs +0 -1
- package/dist/cjs/Sq3g8f6p.cjs +0 -207
- package/dist/cjs/VJQajGKm.cjs +0 -1
- package/dist/cjs/VvpIczL4.cjs +0 -1
- package/dist/cjs/WCwJJYUZ.cjs +0 -1
- package/dist/cjs/dDuc9YHc.cjs +0 -1
- package/dist/cjs/dtQmhQL-.cjs +0 -1
- package/dist/cjs/na-hjKnS.cjs +0 -1
- package/dist/cjs/o1iiHxMe.cjs +0 -1
- package/dist/cjs/u4HvlMWl.cjs +0 -1
- package/dist/es/CSmSKViW.js +0 -22
- package/dist/es/DH2PekOm.js +0 -18
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { createContext as Te, useContext as
|
|
3
|
-
import wr, { SendbirdProduct as kr, DeviceOsPlatform as
|
|
4
|
-
import u, { css as $, ThemeProvider as Or, useTheme as
|
|
5
|
-
import { format as
|
|
2
|
+
import { createContext as Te, useContext as re, useEffect as D, useState as S, useId as bn, useRef as F, useCallback as U, useLayoutEffect as ce, forwardRef as Re, useImperativeHandle as vr, lazy as w, Suspense as Oe, useMemo as ve, Component as _r, Fragment as Bt, useReducer as Sr, Children as Tr } from "react";
|
|
3
|
+
import wr, { SendbirdProduct as kr, DeviceOsPlatform as Ft, SendbirdPlatform as Ar, ConnectionHandler as Qe, SendbirdError as Ir, SessionHandler as $r, LogLevel as xn, ConnectionState as Mr } from "@sendbird/chat";
|
|
4
|
+
import u, { css as $, ThemeProvider as Or, useTheme as Et, createGlobalStyle as Lr, StyleSheetManager as Rr, keyframes as En } from "styled-components";
|
|
5
|
+
import { format as Cn, isSameMinute as Ut, isSameDay as Dr } from "date-fns";
|
|
6
6
|
import { enUS as Nr } from "date-fns/locale/en-US";
|
|
7
7
|
import { AIAgentModule as Pr, ConversationStatus as W, ConversationType as Br } from "@sendbird/chat/aiAgent";
|
|
8
|
-
import { useGroupChannelMessages as Fr, useGroupChannelHandler as
|
|
9
|
-
import { GroupChannelModule as Hr, GroupChannelListOrder as
|
|
8
|
+
import { useGroupChannelMessages as Fr, useGroupChannelHandler as yn, useForceUpdate as Ur } from "@sendbird/uikit-tools";
|
|
9
|
+
import { GroupChannelModule as Hr, GroupChannelListOrder as vn, GroupChannelHandler as zr } from "@sendbird/chat/groupChannel";
|
|
10
10
|
import { renderer as Vr, parser as Wr, MessageProvider as Gr } from "@sendbird/react-uikit-message-template-view";
|
|
11
11
|
import { createMessageTemplate as jr } from "@sendbird/uikit-message-template";
|
|
12
|
-
import
|
|
12
|
+
import _n from "dompurify";
|
|
13
13
|
import { MessageMetaArray as Kr, SendingStatus as Zr } from "@sendbird/chat/message";
|
|
14
14
|
import { isSameDay as Yr } from "date-fns/isSameDay";
|
|
15
15
|
import { createPortal as qr } from "react-dom";
|
|
16
16
|
import Jr from "@emotion/is-prop-valid";
|
|
17
17
|
const j = (e, t) => {
|
|
18
18
|
const n = Te(null), o = ({ children: s, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof s == "function" ? s(l) : s), i = ({ children: s }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof s == "function" ? s(l) : s : null), a = () => {
|
|
19
|
-
const s =
|
|
19
|
+
const s = re(n);
|
|
20
20
|
if (!s)
|
|
21
21
|
throw new Error(`use${e}Context must be used within a ${e}Provider`);
|
|
22
22
|
return s;
|
|
@@ -33,7 +33,7 @@ function we(e) {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
function n({ children: a }) {
|
|
36
|
-
const [s, l] =
|
|
36
|
+
const [s, l] = S(() => e.template), [c, d] = S(e.components), m = {
|
|
37
37
|
Template: s,
|
|
38
38
|
updateTemplate: (g) => l(() => g),
|
|
39
39
|
components: c,
|
|
@@ -42,7 +42,7 @@ function we(e) {
|
|
|
42
42
|
return /* @__PURE__ */ r.createElement(t.Provider, { value: m }, a);
|
|
43
43
|
}
|
|
44
44
|
function o({ template: a, children: s }) {
|
|
45
|
-
const { updateTemplate: l } =
|
|
45
|
+
const { updateTemplate: l } = re(t);
|
|
46
46
|
return D(() => {
|
|
47
47
|
a && l(a);
|
|
48
48
|
}, [a]), /* @__PURE__ */ r.createElement(r.Fragment, null, s);
|
|
@@ -50,11 +50,11 @@ function we(e) {
|
|
|
50
50
|
function i({ children: a }) {
|
|
51
51
|
return /* @__PURE__ */ r.createElement(n, null, a);
|
|
52
52
|
}
|
|
53
|
-
return i.defaults = e, i.useContext = () =>
|
|
53
|
+
return i.defaults = e, i.useContext = () => re(t), i.Context = t, i.Template = o, Object.keys(e.components).forEach((a) => {
|
|
54
54
|
i[a] = function({
|
|
55
55
|
component: l
|
|
56
56
|
}) {
|
|
57
|
-
const { updateComponent: c } =
|
|
57
|
+
const { updateComponent: c } = re(t);
|
|
58
58
|
return D(() => {
|
|
59
59
|
l && c(a, l);
|
|
60
60
|
}, [l]), null;
|
|
@@ -72,15 +72,15 @@ function Qr() {
|
|
|
72
72
|
const e = /iPad|iPhone|iPod/.test(navigator.userAgent), t = /Android/.test(navigator.userAgent);
|
|
73
73
|
return e || t;
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const Ht = (e) => {
|
|
76
76
|
try {
|
|
77
77
|
return JSON.parse(e === "" ? "{}" : e);
|
|
78
78
|
} catch {
|
|
79
79
|
return {};
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, et = {
|
|
82
82
|
isStreaming(e) {
|
|
83
|
-
const t =
|
|
83
|
+
const t = Ht(e.data);
|
|
84
84
|
return typeof t == "object" && !!t.stream;
|
|
85
85
|
},
|
|
86
86
|
isWelcomeMessage(e, t) {
|
|
@@ -88,7 +88,7 @@ const zt = (e) => {
|
|
|
88
88
|
if (((n = e.extendedMessagePayload) == null ? void 0 : n.bot_message_type) === "welcome")
|
|
89
89
|
return !0;
|
|
90
90
|
if ((e.isUserMessage() || e.isFileMessage()) && e.sender.userId === t) {
|
|
91
|
-
const o =
|
|
91
|
+
const o = Ht(e.data);
|
|
92
92
|
return !(o != null && o.respond_mesg_id) && !(o != null && o.stream);
|
|
93
93
|
}
|
|
94
94
|
return !1;
|
|
@@ -98,7 +98,7 @@ const zt = (e) => {
|
|
|
98
98
|
return ((t = e.extendedMessagePayload) == null ? void 0 : t.bot_message_type) === "generated";
|
|
99
99
|
},
|
|
100
100
|
checkExtendedFieldPresence(e) {
|
|
101
|
-
const t = e.extendedMessagePayload || {}, n = (s) => s.some((l) => typeof t[l] < "u"), o = n(
|
|
101
|
+
const t = e.extendedMessagePayload || {}, n = (s) => s.some((l) => typeof t[l] < "u"), o = n(at.ui), i = n(at.trail), a = n(at.marking);
|
|
102
102
|
return { ui: o, trail: i, marking: a };
|
|
103
103
|
},
|
|
104
104
|
shouldScrollToBottom(e, t, n = !1) {
|
|
@@ -110,12 +110,12 @@ const zt = (e) => {
|
|
|
110
110
|
}
|
|
111
111
|
return !0;
|
|
112
112
|
}
|
|
113
|
-
},
|
|
113
|
+
}, at = {
|
|
114
114
|
ui: ["suggested_replies", "cta_button", "message_template", "csat"],
|
|
115
115
|
trail: ["groundedness", "manual", "function_calls"],
|
|
116
116
|
marking: ["is_hallucination", "is_moderated", "flagged_types"]
|
|
117
117
|
};
|
|
118
|
-
class
|
|
118
|
+
class Sn {
|
|
119
119
|
constructor(t) {
|
|
120
120
|
this.logger = t, this.subscribers = {};
|
|
121
121
|
}
|
|
@@ -142,9 +142,9 @@ const eo = () => {
|
|
|
142
142
|
return { promise: new Promise((o, i) => {
|
|
143
143
|
e = o, t = i;
|
|
144
144
|
}), resolve: e, reject: t };
|
|
145
|
-
}, to = "1.2.
|
|
146
|
-
var
|
|
147
|
-
class
|
|
145
|
+
}, to = "1.2.3", Ie = "sb-agent", no = to;
|
|
146
|
+
var Tn = /* @__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))(Tn || {});
|
|
147
|
+
class wn {
|
|
148
148
|
constructor(t) {
|
|
149
149
|
this.level = t;
|
|
150
150
|
}
|
|
@@ -164,7 +164,7 @@ class kn {
|
|
|
164
164
|
this.level <= 4 && console.error(`[${Ie}/error]`, ...t);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function zt(e, t, n) {
|
|
168
168
|
const o = wr.init({
|
|
169
169
|
appId: e,
|
|
170
170
|
modules: [new Hr(), new Pr()],
|
|
@@ -179,7 +179,7 @@ function Vt(e, t, n) {
|
|
|
179
179
|
}
|
|
180
180
|
const {
|
|
181
181
|
Provider: ro,
|
|
182
|
-
useContext:
|
|
182
|
+
useContext: tt
|
|
183
183
|
} = j("AIAgent");
|
|
184
184
|
function oo({
|
|
185
185
|
appId: e,
|
|
@@ -194,11 +194,11 @@ function oo({
|
|
|
194
194
|
dispatcher: d,
|
|
195
195
|
extensions: m = {
|
|
196
196
|
platform: Ar.JS,
|
|
197
|
-
deviceOSPlatform: Qr() ?
|
|
197
|
+
deviceOSPlatform: Qr() ? Ft.MOBILE_WEB : Ft.WEB
|
|
198
198
|
}
|
|
199
199
|
}) {
|
|
200
|
-
const [g, p] =
|
|
201
|
-
const x = c ?? new
|
|
200
|
+
const [g, p] = S(() => {
|
|
201
|
+
const x = c ?? new wn(Tn.WARN), f = d ?? new Sn(x);
|
|
202
202
|
return {
|
|
203
203
|
appId: e,
|
|
204
204
|
aiAgentId: t,
|
|
@@ -207,13 +207,13 @@ function oo({
|
|
|
207
207
|
context: i,
|
|
208
208
|
logger: x,
|
|
209
209
|
dispatcher: f,
|
|
210
|
-
chatSDK: a ??
|
|
210
|
+
chatSDK: a ?? zt(e, m, s)
|
|
211
211
|
};
|
|
212
212
|
});
|
|
213
213
|
return D(() => {
|
|
214
214
|
p((x) => {
|
|
215
215
|
let f = x.logger, E = x.dispatcher, b = x.chatSDK;
|
|
216
|
-
return c && c !== x.logger && (f = c), d && d !== x.dispatcher && (E = d), a && a !== x.chatSDK ? b = a : !a && x.chatSDK.appId !== e && (b =
|
|
216
|
+
return c && c !== x.logger && (f = c), d && d !== x.dispatcher && (E = d), a && a !== x.chatSDK ? b = a : !a && x.chatSDK.appId !== e && (b = zt(e, m, { newInstance: !0, ...s })), {
|
|
217
217
|
...x,
|
|
218
218
|
appId: e,
|
|
219
219
|
aiAgentId: t,
|
|
@@ -261,7 +261,7 @@ function uo({
|
|
|
261
261
|
onAfterSendMessage: l = mt
|
|
262
262
|
}) {
|
|
263
263
|
var b;
|
|
264
|
-
const { chatSDK: c, logger: d, dispatcher: m } =
|
|
264
|
+
const { chatSDK: c, logger: d, dispatcher: m } = tt(), { channel: g, channelFetchError: p, fetchChannel: x } = mo(t), f = io(c, g, {
|
|
265
265
|
shouldCountNewMessages: () => !1,
|
|
266
266
|
onChannelDeleted: n,
|
|
267
267
|
onMessagesReceived: (C) => o == null ? void 0 : o(C),
|
|
@@ -310,14 +310,14 @@ function uo({
|
|
|
310
310
|
return /* @__PURE__ */ r.createElement(co, { value: E }, e);
|
|
311
311
|
}
|
|
312
312
|
function mo(e) {
|
|
313
|
-
const { chatSDK: t, logger: n } =
|
|
313
|
+
const { chatSDK: t, logger: n } = tt(), [o, i] = S(void 0), [a, s] = S(void 0);
|
|
314
314
|
async function l() {
|
|
315
315
|
if (n.debug("conversation.fetchChannel: start"), i(void 0), s(void 0), e)
|
|
316
316
|
try {
|
|
317
317
|
n.debug("conversation.fetchChannel: get channel", e);
|
|
318
318
|
const c = await t.groupChannel.getChannel(e);
|
|
319
319
|
i(c);
|
|
320
|
-
const d = new
|
|
320
|
+
const d = new Qe({ onReconnectSucceeded: () => c.refresh() });
|
|
321
321
|
t.addConnectionHandler("sba-refresh", d), n.debug("conversation.fetchChannel: fetched channel", c);
|
|
322
322
|
} catch (c) {
|
|
323
323
|
c instanceof Ir && s(c), n.error("conversation.fetchChannel: error", c);
|
|
@@ -339,7 +339,7 @@ class ho {
|
|
|
339
339
|
*/
|
|
340
340
|
constructor(t, { filter: n, limit: o = 20 }) {
|
|
341
341
|
var i, a, s, l, c;
|
|
342
|
-
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order =
|
|
342
|
+
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order = vn.LATEST_LAST_MESSAGE, this.filter = n, this._sdk = t, this._pinnedChannels = [], this._channels = [], this._limit = o, this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
|
|
343
343
|
aiAgentChannelFilter: (i = this.filter) == null ? void 0 : i.aiAgentChannelFilter,
|
|
344
344
|
aiAgentConversationStatusFilter: (a = this.filter) == null ? void 0 : a.aiAgentConversationStatusFilter,
|
|
345
345
|
aiAgentIds: (s = this.filter) == null ? void 0 : s.aiAgentIds,
|
|
@@ -353,7 +353,7 @@ class ho {
|
|
|
353
353
|
onChannelDeleted: (d) => {
|
|
354
354
|
this._removeChannelsFromView([d]);
|
|
355
355
|
}
|
|
356
|
-
}), this._connectionHandler = new
|
|
356
|
+
}), this._connectionHandler = new Qe({
|
|
357
357
|
onReconnectSucceeded: () => {
|
|
358
358
|
this._isDefaultChangelogSyncTimestampUpdated && this._syncChannelChangelogs();
|
|
359
359
|
}
|
|
@@ -512,7 +512,7 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
512
512
|
const o = gt(e, t);
|
|
513
513
|
let i = 0, a = e.length - 1, s = Math.floor((i + a) / 2);
|
|
514
514
|
for (; i < a; ) {
|
|
515
|
-
const c =
|
|
515
|
+
const c = Vt(e[s], t, n);
|
|
516
516
|
if (c > 0)
|
|
517
517
|
a = s, s = Math.floor((i + a) / 2);
|
|
518
518
|
else if (c < 0)
|
|
@@ -520,12 +520,12 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
520
520
|
else
|
|
521
521
|
return { place: s, oldPosition: o };
|
|
522
522
|
}
|
|
523
|
-
return { place:
|
|
523
|
+
return { place: Vt(e[s], t, n) >= 0 ? s : s + 1, oldPosition: o };
|
|
524
524
|
}
|
|
525
525
|
return { place: e.length, oldPosition: -1 };
|
|
526
|
-
},
|
|
526
|
+
}, Vt = (e, t, n) => {
|
|
527
527
|
switch (n) {
|
|
528
|
-
case
|
|
528
|
+
case vn.LATEST_LAST_MESSAGE:
|
|
529
529
|
if (e.lastMessage && t.lastMessage) {
|
|
530
530
|
const o = t.lastMessage.createdAt - e.lastMessage.createdAt;
|
|
531
531
|
return o === 0 ? t.createdAt - e.createdAt : o;
|
|
@@ -535,8 +535,8 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
535
535
|
}
|
|
536
536
|
};
|
|
537
537
|
function po(e, t) {
|
|
538
|
-
var f, E, b, C, v, T,
|
|
539
|
-
const n =
|
|
538
|
+
var f, E, b, C, v, T, _, K;
|
|
539
|
+
const n = bn(), [o, i] = S(!1), [a, s] = S(null), [l, c] = S([]), [d, m] = S(null), g = F(!1), p = U(async () => {
|
|
540
540
|
if (!g.current && e.currentUser) {
|
|
541
541
|
g.current = !0, i(!1), s(null), c([]);
|
|
542
542
|
try {
|
|
@@ -565,7 +565,7 @@ function po(e, t) {
|
|
|
565
565
|
(b = (E = t.filter) == null ? void 0 : E.aiAgentConversationStatusFilter) == null ? void 0 : b.join(),
|
|
566
566
|
(v = (C = t.filter) == null ? void 0 : C.aiAgentIds) == null ? void 0 : v.join(),
|
|
567
567
|
(T = t.filter) == null ? void 0 : T.deskChannelFilter,
|
|
568
|
-
(
|
|
568
|
+
(K = (_ = t.filter) == null ? void 0 : _.pinnedChannelUrls) == null ? void 0 : K.join(),
|
|
569
569
|
t.limit
|
|
570
570
|
]), x = U(async () => {
|
|
571
571
|
if (d)
|
|
@@ -575,7 +575,7 @@ function po(e, t) {
|
|
|
575
575
|
s(L);
|
|
576
576
|
}
|
|
577
577
|
}, [d]);
|
|
578
|
-
return D(() => (e.addConnectionHandler(n, new
|
|
578
|
+
return D(() => (e.addConnectionHandler(n, new Qe({ onConnected: () => p() })), () => e.removeConnectionHandler(n)), [e, n, p]), D(() => {
|
|
579
579
|
p();
|
|
580
580
|
}, [p]), D(() => () => {
|
|
581
581
|
g.current = !1, d == null || d.dispose();
|
|
@@ -590,7 +590,7 @@ const {
|
|
|
590
590
|
Provider: fo
|
|
591
591
|
} = j("AIAgentConversationList");
|
|
592
592
|
function bo({ conversationListFilter: e, children: t }) {
|
|
593
|
-
const { chatSDK: n, aiAgentId: o } =
|
|
593
|
+
const { chatSDK: n, aiAgentId: o } = tt(), i = po(n, {
|
|
594
594
|
filter: {
|
|
595
595
|
aiAgentIds: [o],
|
|
596
596
|
aiAgentConversationStatusFilter: [W.CLOSED],
|
|
@@ -611,11 +611,11 @@ const pt = {
|
|
|
611
611
|
WHITE: "#ffffff",
|
|
612
612
|
BLACK: "#000000"
|
|
613
613
|
};
|
|
614
|
-
function
|
|
614
|
+
function kn(e) {
|
|
615
615
|
return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
|
|
616
616
|
}
|
|
617
617
|
function xo(e) {
|
|
618
|
-
const t =
|
|
618
|
+
const t = kn(e);
|
|
619
619
|
return [
|
|
620
620
|
parseInt(t.slice(1, 3), 16),
|
|
621
621
|
// r
|
|
@@ -647,21 +647,21 @@ function yo(e, t, n) {
|
|
|
647
647
|
}
|
|
648
648
|
return [Math.round(o * 255), Math.round(i * 255), Math.round(a * 255)];
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function He(e, t, n) {
|
|
651
651
|
const [o, i, a] = xo(e), [s, l, c] = Co(o, i, a), d = Math.max(0, Math.min(1, c * t)), m = Math.max(0, Math.min(1, l * n)), [g, p, x] = yo(s, m, d);
|
|
652
652
|
return Eo([Math.round(g), Math.round(p), Math.round(x)]);
|
|
653
653
|
}
|
|
654
654
|
function vo(e, t = "light") {
|
|
655
655
|
return {
|
|
656
|
-
extraDark:
|
|
657
|
-
dark:
|
|
656
|
+
extraDark: He(e, 0.6, 1.2),
|
|
657
|
+
dark: He(e, 0.85, 1.1),
|
|
658
658
|
main: e,
|
|
659
|
-
light:
|
|
660
|
-
extraLight:
|
|
659
|
+
light: He(e, t === "dark" ? 1.1 : 1.5, t === "dark" ? 0.95 : 0.9),
|
|
660
|
+
extraLight: He(e, t === "dark" ? 1.2 : 1.75, t === "dark" ? 0.9 : 0.8)
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
663
|
function ft(e) {
|
|
664
|
-
const t =
|
|
664
|
+
const t = kn(e), n = 149, o = +`0x${t[1]}${t[2]}`, i = +`0x${t[3]}${t[4]}`, a = +`0x${t[5]}${t[6]}`;
|
|
665
665
|
return o * 0.299 + i * 0.587 + a * 0.114 > n ? pt.BLACK : pt.WHITE;
|
|
666
666
|
}
|
|
667
667
|
function _o(e, t, n, o, i) {
|
|
@@ -719,7 +719,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
719
719
|
csat: {
|
|
720
720
|
background: e.background400
|
|
721
721
|
}
|
|
722
|
-
}),
|
|
722
|
+
}), ze = {
|
|
723
723
|
primary: {
|
|
724
724
|
extraDark: "#491389",
|
|
725
725
|
dark: "#6211c8",
|
|
@@ -772,7 +772,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
772
772
|
dark: "rgba(0, 0, 0, 0.55)",
|
|
773
773
|
light: "rgba(22, 22, 22, 0.32)"
|
|
774
774
|
}
|
|
775
|
-
},
|
|
775
|
+
}, lt = {
|
|
776
776
|
h1: { fontSize: 18, fontWeight: 700 },
|
|
777
777
|
h2: { fontSize: 16, fontWeight: 700 },
|
|
778
778
|
subtitle1: { fontSize: 16, fontWeight: 500 },
|
|
@@ -786,7 +786,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
786
786
|
caption3: { fontSize: 11, fontWeight: 700 },
|
|
787
787
|
caption4: { fontSize: 11, fontWeight: 400 }
|
|
788
788
|
};
|
|
789
|
-
function
|
|
789
|
+
function Wt(e) {
|
|
790
790
|
const t = To(e), { colors: n, aiAgentColorVariables: o } = wo(e, t), i = Ao(e);
|
|
791
791
|
return {
|
|
792
792
|
selectedTheme: e.selectedTheme,
|
|
@@ -797,9 +797,9 @@ function Gt(e) {
|
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
799
|
function To({ selectedTheme: e, palette: t, primary: n }) {
|
|
800
|
-
const o = t != null && t.primary ? t.primary : n ? n ===
|
|
800
|
+
const o = t != null && t.primary ? t.primary : n ? n === ze.primary.main ? ze.primary : vo(n, e) : ze.primary;
|
|
801
801
|
return {
|
|
802
|
-
...
|
|
802
|
+
...ze,
|
|
803
803
|
primary: o,
|
|
804
804
|
...t
|
|
805
805
|
};
|
|
@@ -831,23 +831,23 @@ function ko(e, t, n) {
|
|
|
831
831
|
}
|
|
832
832
|
function Ao({ typography: e }) {
|
|
833
833
|
if (!e)
|
|
834
|
-
return
|
|
835
|
-
const t = { ...
|
|
834
|
+
return lt;
|
|
835
|
+
const t = { ...lt };
|
|
836
836
|
return Object.keys(e).forEach((n) => {
|
|
837
837
|
const o = e[n];
|
|
838
838
|
if (o && typeof o == "object") {
|
|
839
|
-
const i =
|
|
839
|
+
const i = lt[n], a = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
|
|
840
840
|
t[n] = ko(i, o, a);
|
|
841
841
|
}
|
|
842
842
|
}), t;
|
|
843
843
|
}
|
|
844
844
|
const {
|
|
845
845
|
Provider: Io,
|
|
846
|
-
useContext:
|
|
846
|
+
useContext: An
|
|
847
847
|
} = j("AIAgentTheme");
|
|
848
848
|
function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }) {
|
|
849
|
-
const [a, s] =
|
|
850
|
-
() =>
|
|
849
|
+
const [a, s] = S(
|
|
850
|
+
() => Wt({
|
|
851
851
|
selectedTheme: (o == null ? void 0 : o.theme) ?? "light",
|
|
852
852
|
palette: t,
|
|
853
853
|
typography: n,
|
|
@@ -863,7 +863,7 @@ function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }
|
|
|
863
863
|
botMessageBackgroundContrast: void 0
|
|
864
864
|
};
|
|
865
865
|
!p.primary && (g != null && g.primaryColor) && (p.primary = g.primaryColor, p.primaryContrast = g.primaryContrastColor), !p.botMessageBackground && (g != null && g.botMessageBackgroundColor) && (p.botMessageBackground = g.botMessageBackgroundColor, p.botMessageBackgroundContrast = g.botMessageBackgroundContrastColor);
|
|
866
|
-
const x =
|
|
866
|
+
const x = Wt({ selectedTheme: m, palette: t, typography: n, ...p });
|
|
867
867
|
s(x), e == null || e.info("theme.update:", m);
|
|
868
868
|
},
|
|
869
869
|
[o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor, t, n, e]
|
|
@@ -872,14 +872,14 @@ function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }
|
|
|
872
872
|
(o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(a.selectedTheme);
|
|
873
873
|
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(Io, { value: { theme: a, updateTheme: l } }, i);
|
|
874
874
|
}
|
|
875
|
-
const
|
|
875
|
+
const In = (e) => {
|
|
876
876
|
try {
|
|
877
877
|
const t = JSON.parse(e);
|
|
878
878
|
return typeof t == "string" ? JSON.stringify(t).slice(1, -1) : e.trim();
|
|
879
879
|
} catch {
|
|
880
880
|
return JSON.stringify(e).slice(1, -1);
|
|
881
881
|
}
|
|
882
|
-
},
|
|
882
|
+
}, De = (e) => JSON.parse(e), nt = (e) => JSON.parse(e);
|
|
883
883
|
function Mo(e, t) {
|
|
884
884
|
const [n, o] = t.split(",").map((i) => i.trim());
|
|
885
885
|
return e === "dark" && o || n;
|
|
@@ -894,7 +894,7 @@ function Oo(e) {
|
|
|
894
894
|
}
|
|
895
895
|
return n(e), t;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Ct({
|
|
898
898
|
template: e,
|
|
899
899
|
variables: t,
|
|
900
900
|
variableKeyPattern: n,
|
|
@@ -904,7 +904,7 @@ function yt({
|
|
|
904
904
|
if (!o && !["number", "boolean", "string"].includes(typeof s))
|
|
905
905
|
throw new Error("If transformer is not provided, value must be a {string, number, or boolean}");
|
|
906
906
|
const l = o ? o(s) : String(s), c = n(a);
|
|
907
|
-
return i.replace(c,
|
|
907
|
+
return i.replace(c, In(l));
|
|
908
908
|
}, e);
|
|
909
909
|
}
|
|
910
910
|
async function Lo({
|
|
@@ -918,7 +918,7 @@ async function Lo({
|
|
|
918
918
|
const l = await o(s);
|
|
919
919
|
return { regex: n(a), transformedValue: l };
|
|
920
920
|
})
|
|
921
|
-
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s,
|
|
921
|
+
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s, In(l)), e);
|
|
922
922
|
}
|
|
923
923
|
const Ro = (e) => ({
|
|
924
924
|
setTemplate: (t, n) => e.onSetTemplate(t, n),
|
|
@@ -928,7 +928,7 @@ const Ro = (e) => ({
|
|
|
928
928
|
clear: () => e.onClear()
|
|
929
929
|
}), {
|
|
930
930
|
Provider: Do,
|
|
931
|
-
useContext:
|
|
931
|
+
useContext: $n
|
|
932
932
|
} = j("MessageCacheTemplate");
|
|
933
933
|
function No({ logger: e, storage: t, children: n }) {
|
|
934
934
|
const o = U(
|
|
@@ -945,7 +945,7 @@ function No({ logger: e, storage: t, children: n }) {
|
|
|
945
945
|
try {
|
|
946
946
|
const { templates: l, token: c } = await s.aiAgent.getMessageTemplates({ limit: 20 });
|
|
947
947
|
for (const { template: d } of l) {
|
|
948
|
-
const { key: m } =
|
|
948
|
+
const { key: m } = De(d);
|
|
949
949
|
t.setTemplate(m, d);
|
|
950
950
|
}
|
|
951
951
|
t.setCachedToken(c);
|
|
@@ -975,10 +975,10 @@ function Po(e) {
|
|
|
975
975
|
}
|
|
976
976
|
const {
|
|
977
977
|
Provider: Bo,
|
|
978
|
-
useContext:
|
|
978
|
+
useContext: Mn
|
|
979
979
|
} = j("MessageTemplateFetching");
|
|
980
980
|
function Fo({ children: e, internalVariables: t }) {
|
|
981
|
-
const n = F({}), o = F({}), [i, a] =
|
|
981
|
+
const n = F({}), o = F({}), [i, a] = S({}), s = U((d, m) => {
|
|
982
982
|
a((g) => ({
|
|
983
983
|
...g,
|
|
984
984
|
[d]: { fetching: !1, error: !1, ...g[d], ...m }
|
|
@@ -1023,27 +1023,27 @@ function Fo({ children: e, internalVariables: t }) {
|
|
|
1023
1023
|
};
|
|
1024
1024
|
return /* @__PURE__ */ r.createElement(Bo, { value: c }, e);
|
|
1025
1025
|
}
|
|
1026
|
-
const
|
|
1026
|
+
const rt = {
|
|
1027
1027
|
VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
|
|
1028
1028
|
VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
|
|
1029
1029
|
};
|
|
1030
|
-
function
|
|
1030
|
+
function de({ uiTemplateString: e, variables: t = {} }) {
|
|
1031
1031
|
const n = Oo(t);
|
|
1032
|
-
return
|
|
1032
|
+
return Ct({
|
|
1033
1033
|
template: e,
|
|
1034
1034
|
variables: n,
|
|
1035
|
-
variableKeyPattern: (o) =>
|
|
1035
|
+
variableKeyPattern: (o) => rt.VARIABLE(o)
|
|
1036
1036
|
});
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function ue({
|
|
1039
1039
|
theme: e,
|
|
1040
1040
|
uiTemplateString: t,
|
|
1041
1041
|
colorVariables: n = {}
|
|
1042
1042
|
}) {
|
|
1043
|
-
return
|
|
1043
|
+
return Ct({
|
|
1044
1044
|
template: t,
|
|
1045
1045
|
variables: n,
|
|
1046
|
-
variableKeyPattern: (o) =>
|
|
1046
|
+
variableKeyPattern: (o) => rt.VARIABLE(o),
|
|
1047
1047
|
variableValueTransformer: (o) => Mo(e, o)
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
@@ -1056,29 +1056,29 @@ function Uo({
|
|
|
1056
1056
|
onRequestTemplate: a
|
|
1057
1057
|
}) {
|
|
1058
1058
|
const l = Object.values(n).flat().map((d) => d.key);
|
|
1059
|
-
return [...new Set(l)].some((d) => !a(d)) ? null :
|
|
1059
|
+
return [...new Set(l)].some((d) => !a(d)) ? null : Ct({
|
|
1060
1060
|
template: t,
|
|
1061
1061
|
variables: n,
|
|
1062
|
-
variableKeyPattern: (d) =>
|
|
1062
|
+
variableKeyPattern: (d) => rt.VIEW_VARIABLE(d),
|
|
1063
1063
|
variableValueTransformer: (d) => {
|
|
1064
1064
|
const m = d.map(({ key: g, variables: p }) => {
|
|
1065
|
-
const x = a(g), { ui_template: f, color_variables: E } =
|
|
1065
|
+
const x = a(g), { ui_template: f, color_variables: E } = De(x);
|
|
1066
1066
|
let b = JSON.stringify(f);
|
|
1067
|
-
return b =
|
|
1067
|
+
return b = de({
|
|
1068
1068
|
uiTemplateString: b,
|
|
1069
1069
|
variables: i
|
|
1070
|
-
}), b =
|
|
1070
|
+
}), b = ue({
|
|
1071
1071
|
theme: e,
|
|
1072
1072
|
uiTemplateString: b,
|
|
1073
1073
|
colorVariables: E
|
|
1074
|
-
}), b =
|
|
1074
|
+
}), b = ue({
|
|
1075
1075
|
theme: e,
|
|
1076
1076
|
uiTemplateString: b,
|
|
1077
1077
|
colorVariables: o
|
|
1078
|
-
}), b =
|
|
1078
|
+
}), b = de({
|
|
1079
1079
|
uiTemplateString: b,
|
|
1080
1080
|
variables: p
|
|
1081
|
-
}),
|
|
1081
|
+
}), nt(b);
|
|
1082
1082
|
});
|
|
1083
1083
|
return JSON.stringify(m);
|
|
1084
1084
|
}
|
|
@@ -1095,26 +1095,26 @@ async function Ho({
|
|
|
1095
1095
|
return Lo({
|
|
1096
1096
|
template: t,
|
|
1097
1097
|
variables: n,
|
|
1098
|
-
variableKeyPattern: (s) =>
|
|
1098
|
+
variableKeyPattern: (s) => rt.VIEW_VARIABLE(s),
|
|
1099
1099
|
variableValueTransformer: async (s) => {
|
|
1100
1100
|
const l = s.map(async ({ key: d, variables: m }) => {
|
|
1101
|
-
const g = await a(d), { ui_template: p, color_variables: x } =
|
|
1101
|
+
const g = await a(d), { ui_template: p, color_variables: x } = De(g);
|
|
1102
1102
|
let f = JSON.stringify(p);
|
|
1103
|
-
return f =
|
|
1103
|
+
return f = de({
|
|
1104
1104
|
uiTemplateString: f,
|
|
1105
1105
|
variables: i
|
|
1106
|
-
}), f =
|
|
1106
|
+
}), f = ue({
|
|
1107
1107
|
theme: e,
|
|
1108
1108
|
uiTemplateString: f,
|
|
1109
1109
|
colorVariables: x
|
|
1110
|
-
}), f =
|
|
1110
|
+
}), f = ue({
|
|
1111
1111
|
theme: e,
|
|
1112
1112
|
uiTemplateString: f,
|
|
1113
1113
|
colorVariables: o
|
|
1114
|
-
}), f =
|
|
1114
|
+
}), f = de({
|
|
1115
1115
|
uiTemplateString: f,
|
|
1116
1116
|
variables: m
|
|
1117
|
-
}),
|
|
1117
|
+
}), nt(f);
|
|
1118
1118
|
}), c = await Promise.all(l);
|
|
1119
1119
|
return JSON.stringify(c);
|
|
1120
1120
|
}
|
|
@@ -1126,7 +1126,7 @@ const zo = ({
|
|
|
1126
1126
|
internalVariables: n,
|
|
1127
1127
|
...o
|
|
1128
1128
|
}) => {
|
|
1129
|
-
const { ui_template: i, color_variables: a } =
|
|
1129
|
+
const { ui_template: i, color_variables: a } = De(e);
|
|
1130
1130
|
let s = JSON.stringify(i);
|
|
1131
1131
|
if (Object.keys(o.viewVariables ?? {}).length > 0) {
|
|
1132
1132
|
const c = Uo({
|
|
@@ -1138,24 +1138,24 @@ const zo = ({
|
|
|
1138
1138
|
if (c === null) return null;
|
|
1139
1139
|
s = c;
|
|
1140
1140
|
}
|
|
1141
|
-
return s =
|
|
1141
|
+
return s = de({ ...o, uiTemplateString: s, variables: n }), s = ue({ ...o, uiTemplateString: s, colorVariables: a }), s = ue({ ...o, uiTemplateString: s, colorVariables: t }), s = de({ ...o, uiTemplateString: s }), nt(s);
|
|
1142
1142
|
}, Vo = async ({
|
|
1143
1143
|
rawTemplate: e,
|
|
1144
1144
|
aiAgentColorVariables: t,
|
|
1145
1145
|
internalVariables: n,
|
|
1146
1146
|
...o
|
|
1147
1147
|
}) => {
|
|
1148
|
-
const { ui_template: i, color_variables: a } =
|
|
1148
|
+
const { ui_template: i, color_variables: a } = De(e);
|
|
1149
1149
|
let s = JSON.stringify(i);
|
|
1150
1150
|
return Object.keys(o.viewVariables ?? {}).length > 0 && (s = await Ho({
|
|
1151
1151
|
...o,
|
|
1152
1152
|
uiTemplateString: s,
|
|
1153
1153
|
aiAgentColorVariables: t,
|
|
1154
1154
|
internalVariables: n
|
|
1155
|
-
})), s =
|
|
1155
|
+
})), s = de({ ...o, uiTemplateString: s, variables: n }), s = ue({ ...o, uiTemplateString: s, colorVariables: a }), s = ue({ ...o, uiTemplateString: s, colorVariables: t }), s = de({ ...o, uiTemplateString: s }), nt(s);
|
|
1156
1156
|
}, Wo = (e) => {
|
|
1157
|
-
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } =
|
|
1158
|
-
return
|
|
1157
|
+
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = Mn();
|
|
1158
|
+
return S(() => {
|
|
1159
1159
|
const o = e.onGetCachedTemplate(e.templateKey);
|
|
1160
1160
|
return o ? zo({
|
|
1161
1161
|
...e,
|
|
@@ -1168,7 +1168,7 @@ const zo = ({
|
|
|
1168
1168
|
}, Go = (e) => {
|
|
1169
1169
|
const [t] = Wo(e);
|
|
1170
1170
|
if (t) return t;
|
|
1171
|
-
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } =
|
|
1171
|
+
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } = Mn();
|
|
1172
1172
|
return a(e.templateKey, async () => {
|
|
1173
1173
|
const l = await i({ ...e, suspense: !0 });
|
|
1174
1174
|
return await Vo({
|
|
@@ -1178,8 +1178,8 @@ const zo = ({
|
|
|
1178
1178
|
internalVariables: o
|
|
1179
1179
|
});
|
|
1180
1180
|
}).value;
|
|
1181
|
-
}, jo = '@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}',
|
|
1182
|
-
|
|
1181
|
+
}, jo = '@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}', Ne = "en", Ko = /* @__PURE__ */ new Set([
|
|
1182
|
+
Ne,
|
|
1183
1183
|
"ko",
|
|
1184
1184
|
"es",
|
|
1185
1185
|
"pt",
|
|
@@ -1252,19 +1252,19 @@ const zo = ({
|
|
|
1252
1252
|
CONVERSATION_LIST__NO_CONVERSATIONS: "No conversations yet",
|
|
1253
1253
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: "MM/dd/yyyy",
|
|
1254
1254
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma"
|
|
1255
|
-
},
|
|
1255
|
+
}, yt = { language: "en", dateLocale: Yo, stringSet: qo }, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1256
1256
|
__proto__: null,
|
|
1257
|
-
default:
|
|
1258
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1257
|
+
default: yt
|
|
1258
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = /* @__PURE__ */ new Map([[Ne, yt]]);
|
|
1259
1259
|
async function Xo(e) {
|
|
1260
|
-
if (
|
|
1261
|
-
return
|
|
1262
|
-
const t = Ko.has(e) ? e :
|
|
1260
|
+
if (Ye.has(e))
|
|
1261
|
+
return Ye.get(e);
|
|
1262
|
+
const t = Ko.has(e) ? e : Ne;
|
|
1263
1263
|
try {
|
|
1264
1264
|
const { default: n } = await Zo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DvjrAXLD.js"), "./languages/en.ts": () => Promise.resolve().then(() => Jo), "./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);
|
|
1265
|
-
return
|
|
1265
|
+
return Ye.set(e, n), n;
|
|
1266
1266
|
} catch {
|
|
1267
|
-
return
|
|
1267
|
+
return yt;
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
const {
|
|
@@ -1273,7 +1273,7 @@ const {
|
|
|
1273
1273
|
} = j("Localization");
|
|
1274
1274
|
function ei(e) {
|
|
1275
1275
|
var t;
|
|
1276
|
-
return ((t = e.split("-")) == null ? void 0 : t[0]) ??
|
|
1276
|
+
return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Ne;
|
|
1277
1277
|
}
|
|
1278
1278
|
function ti({
|
|
1279
1279
|
language: e = navigator.language,
|
|
@@ -1281,7 +1281,7 @@ function ti({
|
|
|
1281
1281
|
stringSet: n,
|
|
1282
1282
|
children: o
|
|
1283
1283
|
}) {
|
|
1284
|
-
const [i, a] =
|
|
1284
|
+
const [i, a] = S(Ye.get(Ne));
|
|
1285
1285
|
return D(() => {
|
|
1286
1286
|
const s = ei(e);
|
|
1287
1287
|
i.language !== s && (t == null || t.debug("localization.useEffect: update language", `${i.language} -> ${s}`), Xo(s).then(a));
|
|
@@ -1292,20 +1292,20 @@ function ti({
|
|
|
1292
1292
|
language: i.language,
|
|
1293
1293
|
stringSet: { ...i.stringSet, ...n },
|
|
1294
1294
|
dateLocale: i.dateLocale,
|
|
1295
|
-
format: (s, l, c) =>
|
|
1295
|
+
format: (s, l, c) => Cn(s, l, { locale: i.dateLocale, ...c })
|
|
1296
1296
|
}
|
|
1297
1297
|
},
|
|
1298
1298
|
o
|
|
1299
1299
|
);
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1301
|
+
const qe = "data-sb-agent-theme", Gt = (e) => (t, ...n) => {
|
|
1302
1302
|
let o = "";
|
|
1303
1303
|
return t.forEach((i, a) => {
|
|
1304
1304
|
o += i + (n[a] ?? "");
|
|
1305
|
-
}), `[${
|
|
1305
|
+
}), `[${qe}='${e}'] & { ${o} }`;
|
|
1306
1306
|
}, N = {
|
|
1307
|
-
light:
|
|
1308
|
-
dark:
|
|
1307
|
+
light: Gt("light"),
|
|
1308
|
+
dark: Gt("dark")
|
|
1309
1309
|
}, ni = $(({ theme: e }) => {
|
|
1310
1310
|
const { palette: t } = e;
|
|
1311
1311
|
return `
|
|
@@ -1358,7 +1358,7 @@ const Ye = "data-sb-agent-theme", jt = (e) => (t, ...n) => {
|
|
|
1358
1358
|
--sendbird-overlay-light: ${t.overlay.light};
|
|
1359
1359
|
}
|
|
1360
1360
|
`;
|
|
1361
|
-
}), ri = $`[${
|
|
1361
|
+
}), ri = $`[${qe}='light'] &{--sb-text-high-emphasis:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled:var(--sendbird-onlight-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-ondark-text-disabled);--sb-bg-50-600:var(--sendbird-background-50);--sb-bg-100-500:var(--sendbird-background-100);--sb-bg-200-400:var(--sendbird-background-200);--sb-primary:var(--sendbird-primary-main);--sb-secondary:var(--sendbird-secondary-main);--sb-error:var(--sendbird-error-main);--sb-information:var(--sendbird-information-light);}[${qe}='dark'] &{--sb-text-high-emphasis:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled:var(--sendbird-ondark-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-onlight-text-disabled);--sb-bg-50-600:var(--sendbird-background-600);--sb-bg-100-500:var(--sendbird-background-500);--sb-bg-200-400:var(--sendbird-background-400);--sb-primary:var(--sendbird-primary-light);--sb-secondary:var(--sendbird-secondary-light);--sb-error:var(--sendbird-error-light);--sb-information:var(--sendbird-information-light);}`, h = {
|
|
1362
1362
|
color: {
|
|
1363
1363
|
primary: {
|
|
1364
1364
|
dark: "var(--sendbird-primary-dark)",
|
|
@@ -1416,18 +1416,18 @@ function si(e) {
|
|
|
1416
1416
|
);
|
|
1417
1417
|
}
|
|
1418
1418
|
function ai({ rootElement: e = document.body, children: t }) {
|
|
1419
|
-
const { theme: n, updateTheme: o } =
|
|
1420
|
-
return
|
|
1421
|
-
e.setAttribute(
|
|
1419
|
+
const { theme: n, updateTheme: o } = An();
|
|
1420
|
+
return ce(() => {
|
|
1421
|
+
e.setAttribute(qe, n.selectedTheme);
|
|
1422
1422
|
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(Or, { theme: n }, /* @__PURE__ */ r.createElement(oi, { value: { theme: n, updateTheme: o } }, t));
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function fe(e, t) {
|
|
1425
1425
|
const n = e.getRootNode({ composed: t });
|
|
1426
1426
|
return n instanceof ShadowRoot || n instanceof Document ? n : document;
|
|
1427
1427
|
}
|
|
1428
1428
|
const li = (e, t) => {
|
|
1429
1429
|
D(() => {
|
|
1430
|
-
const n =
|
|
1430
|
+
const n = fe(t) instanceof ShadowRoot, o = fe(t, !0);
|
|
1431
1431
|
if (!(n ? t : o).querySelector(`link[href*='${e}']`)) {
|
|
1432
1432
|
const a = o.createElement("link");
|
|
1433
1433
|
a.rel = "stylesheet", a.href = e, (n ? t : o.head).appendChild(a);
|
|
@@ -1435,49 +1435,49 @@ const li = (e, t) => {
|
|
|
1435
1435
|
}, [e, t]);
|
|
1436
1436
|
}, ci = (e, t = document.body) => {
|
|
1437
1437
|
D(() => {
|
|
1438
|
-
const n =
|
|
1438
|
+
const n = fe(t), i = n instanceof ShadowRoot ? t : n.head;
|
|
1439
1439
|
if (!i) return;
|
|
1440
1440
|
const a = `sba-${btoa(e).slice(0, 10)}`;
|
|
1441
1441
|
let s = i.querySelector(`style#${a}`);
|
|
1442
1442
|
s ? s.textContent !== e && (s.textContent = e) : (s = i.ownerDocument.createElement("style"), s.id = a, s.textContent = e, i.appendChild(s));
|
|
1443
1443
|
}, [e, t]);
|
|
1444
|
-
},
|
|
1445
|
-
ENTRY: `${
|
|
1446
|
-
MODAL_ROOT: `${
|
|
1447
|
-
WINDOW: `${
|
|
1448
|
-
LAUNCHER: `${
|
|
1449
|
-
},
|
|
1450
|
-
MODAL:
|
|
1444
|
+
}, vt = /iPad|iPhone|iPod/.test(navigator.userAgent), di = /Android/.test(navigator.userAgent), Pe = (e) => vt || di, Q = "sb-agent", oe = {
|
|
1445
|
+
ENTRY: `${Q}-entry`,
|
|
1446
|
+
MODAL_ROOT: `${Q}-modal-root`,
|
|
1447
|
+
WINDOW: `${Q}-window`,
|
|
1448
|
+
LAUNCHER: `${Q}-launcher`
|
|
1449
|
+
}, Ve = 2147483647, be = {
|
|
1450
|
+
MODAL: Ve - 1,
|
|
1451
1451
|
// FIXME: need to cover the case where the tooltip is on the top of the modal
|
|
1452
|
-
TOOLTIP:
|
|
1453
|
-
WINDOW:
|
|
1454
|
-
LAUNCHER:
|
|
1452
|
+
TOOLTIP: Ve - 2,
|
|
1453
|
+
WINDOW: Ve - 3,
|
|
1454
|
+
LAUNCHER: Ve - 4
|
|
1455
|
+
}, On = {
|
|
1456
|
+
SESSION: `@${Q}-session`,
|
|
1457
|
+
USER_DATA: `@${Q}-udata`
|
|
1455
1458
|
}, Ln = {
|
|
1456
|
-
SESSION: `@${X}-session`,
|
|
1457
|
-
USER_DATA: `@${X}-udata`
|
|
1458
|
-
}, Rn = {
|
|
1459
1459
|
DEFAULT_PRIMARY: "#742ddd",
|
|
1460
1460
|
WHITE: "#ffffff"
|
|
1461
|
-
},
|
|
1461
|
+
}, Rn = 36, ui = 100, mi = 25 * 1024 * 1024, Dn = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], _t = "noopener noreferrer nofollow", We = {}, te = {
|
|
1462
1462
|
getItem: (e) => {
|
|
1463
1463
|
try {
|
|
1464
1464
|
return localStorage.getItem(e);
|
|
1465
1465
|
} catch {
|
|
1466
|
-
return
|
|
1466
|
+
return We[e] ?? null;
|
|
1467
1467
|
}
|
|
1468
1468
|
},
|
|
1469
1469
|
setItem: (e, t) => {
|
|
1470
1470
|
try {
|
|
1471
1471
|
localStorage.setItem(e, t);
|
|
1472
1472
|
} catch {
|
|
1473
|
-
|
|
1473
|
+
We[e] = t;
|
|
1474
1474
|
}
|
|
1475
1475
|
},
|
|
1476
1476
|
deleteItem: (e) => {
|
|
1477
1477
|
try {
|
|
1478
1478
|
localStorage.removeItem(e);
|
|
1479
1479
|
} catch {
|
|
1480
|
-
delete
|
|
1480
|
+
delete We[e];
|
|
1481
1481
|
}
|
|
1482
1482
|
},
|
|
1483
1483
|
getKeys: (e) => {
|
|
@@ -1489,16 +1489,16 @@ const li = (e, t) => {
|
|
|
1489
1489
|
}
|
|
1490
1490
|
return t;
|
|
1491
1491
|
} catch {
|
|
1492
|
-
return Object.keys(
|
|
1492
|
+
return Object.keys(We).filter((t) => t.startsWith(e));
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
};
|
|
1496
|
-
function
|
|
1496
|
+
function Nn(e) {
|
|
1497
1497
|
const { keyGenerator: t, keyParamsValidator: n } = e;
|
|
1498
1498
|
function o(s) {
|
|
1499
1499
|
try {
|
|
1500
1500
|
n && n(s);
|
|
1501
|
-
const l = t(s), c =
|
|
1501
|
+
const l = t(s), c = te.getItem(l);
|
|
1502
1502
|
return c ? JSON.parse(c) : null;
|
|
1503
1503
|
} catch {
|
|
1504
1504
|
return null;
|
|
@@ -1508,7 +1508,7 @@ function Pn(e) {
|
|
|
1508
1508
|
try {
|
|
1509
1509
|
n && n(s);
|
|
1510
1510
|
const c = t(s), d = JSON.stringify(l);
|
|
1511
|
-
|
|
1511
|
+
te.setItem(c, d);
|
|
1512
1512
|
} catch {
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
@@ -1516,16 +1516,16 @@ function Pn(e) {
|
|
|
1516
1516
|
try {
|
|
1517
1517
|
n && n(s);
|
|
1518
1518
|
const l = t(s);
|
|
1519
|
-
|
|
1519
|
+
te.deleteItem(l);
|
|
1520
1520
|
} catch {
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
1523
|
return { get: o, set: i, clear: a };
|
|
1524
1524
|
}
|
|
1525
|
-
const
|
|
1525
|
+
const $e = Nn({
|
|
1526
1526
|
keyGenerator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1527
1527
|
const o = hi(`${e}/${t}/${n}`);
|
|
1528
|
-
return `${
|
|
1528
|
+
return `${On.USER_DATA}/${o}`;
|
|
1529
1529
|
},
|
|
1530
1530
|
keyParamsValidator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1531
1531
|
if (!e || !t || !n)
|
|
@@ -1538,11 +1538,11 @@ function hi(e) {
|
|
|
1538
1538
|
t = (t << 5) - t + e.charCodeAt(n), t |= 0;
|
|
1539
1539
|
return t.toString(16);
|
|
1540
1540
|
}
|
|
1541
|
-
const
|
|
1542
|
-
keyGenerator: ({ appId: e, aiAgentId: t }) => `${
|
|
1541
|
+
const Ge = Nn({
|
|
1542
|
+
keyGenerator: ({ appId: e, aiAgentId: t }) => `${On.SESSION}/${e}/${t}`
|
|
1543
1543
|
}), {
|
|
1544
1544
|
Provider: gi,
|
|
1545
|
-
Consumer:
|
|
1545
|
+
Consumer: Pn,
|
|
1546
1546
|
useContext: P
|
|
1547
1547
|
} = j("Agent");
|
|
1548
1548
|
function pi({
|
|
@@ -1553,7 +1553,7 @@ function pi({
|
|
|
1553
1553
|
enableAutoDisconnectInLauncher: i = !0,
|
|
1554
1554
|
...a
|
|
1555
1555
|
}) {
|
|
1556
|
-
const s =
|
|
1556
|
+
const s = tt(), [l, c] = S(!1), [d, m] = S(!1), g = {
|
|
1557
1557
|
opened: (t == null ? void 0 : t.opened) ?? l,
|
|
1558
1558
|
setOpened: (t == null ? void 0 : t.setOpened) ?? c,
|
|
1559
1559
|
expanded: (t == null ? void 0 : t.expanded) ?? d,
|
|
@@ -1575,7 +1575,7 @@ function pi({
|
|
|
1575
1575
|
);
|
|
1576
1576
|
}
|
|
1577
1577
|
function fi() {
|
|
1578
|
-
const { chatSDK: e, logger: t } = P(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } =
|
|
1578
|
+
const { chatSDK: e, logger: t } = P(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } = $n(), a = U(
|
|
1579
1579
|
async (l, c, d) => {
|
|
1580
1580
|
if (t.debug("authManager.authenticate: session:", l.userId), c) {
|
|
1581
1581
|
const m = new $r({
|
|
@@ -1608,10 +1608,10 @@ function bi(e, t) {
|
|
|
1608
1608
|
const xi = 24 * 60 * 60 * 1e3, {
|
|
1609
1609
|
Provider: Ei,
|
|
1610
1610
|
useContext: z
|
|
1611
|
-
} = j("MessengerSession"), Ci =
|
|
1612
|
-
const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: m, context: g, handlers: p } = P(), { updateTheme: x } =
|
|
1611
|
+
} = j("MessengerSession"), Ci = Re(function({ userSessionInfo: e, children: t }, n) {
|
|
1612
|
+
const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: m, context: g, handlers: p } = P(), { updateTheme: x } = An(), { authenticate: f, deauthenticate: E } = fi(), [b, C] = S(
|
|
1613
1613
|
void 0
|
|
1614
|
-
), [v, T] =
|
|
1614
|
+
), [v, T] = S(void 0), [_, K] = S(null), [L, se] = S(null), [xe, y] = S(null), B = s == null ? void 0 : s.forceCreateChannel;
|
|
1615
1615
|
function Ee() {
|
|
1616
1616
|
if (e && e.userId) {
|
|
1617
1617
|
c.debug("messengerSession.initialize: manual session info detected");
|
|
@@ -1620,33 +1620,33 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1620
1620
|
`messengerSession.initialize: missing required keys in userSessionInfo: ${I.join(", ")}`
|
|
1621
1621
|
), e;
|
|
1622
1622
|
}
|
|
1623
|
-
const A =
|
|
1624
|
-
return A ? A.expireAt - xi <= Date.now() ? (c.debug("messengerSession.initialize: auto session expired, clear cache"),
|
|
1623
|
+
const A = Ge.get({ appId: o, aiAgentId: i });
|
|
1624
|
+
return A ? A.expireAt - xi <= Date.now() ? (c.debug("messengerSession.initialize: auto session expired, clear cache"), Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: A.userId }), null) : (c.debug("messengerSession.initialize: auto session info detected"), A) : null;
|
|
1625
1625
|
}
|
|
1626
1626
|
const J = U(
|
|
1627
1627
|
(A, I) => {
|
|
1628
|
-
|
|
1628
|
+
$e.set({ appId: o, aiAgentId: i, userId: A }, { knownActiveChannelUrl: I });
|
|
1629
1629
|
},
|
|
1630
1630
|
[o, i]
|
|
1631
1631
|
), Ae = U(
|
|
1632
1632
|
(A) => {
|
|
1633
|
-
const I =
|
|
1633
|
+
const I = $e.get({ appId: o, aiAgentId: i, userId: A });
|
|
1634
1634
|
return I == null ? void 0 : I.knownActiveChannelUrl;
|
|
1635
1635
|
},
|
|
1636
1636
|
[o, i]
|
|
1637
|
-
),
|
|
1638
|
-
if (
|
|
1637
|
+
), it = U(async () => {
|
|
1638
|
+
if (_) {
|
|
1639
1639
|
c.debug("messengerSession.refreshActiveChannel: try to refresh active channel"), C(void 0);
|
|
1640
1640
|
const A = await a.aiAgent.requestMessengerSettings({
|
|
1641
1641
|
aiAgentId: i,
|
|
1642
|
-
userId:
|
|
1642
|
+
userId: _.userId,
|
|
1643
1643
|
language: d,
|
|
1644
1644
|
country: m,
|
|
1645
1645
|
context: g,
|
|
1646
1646
|
forceCreateChannel: B,
|
|
1647
|
-
knownActiveChannelUrl: Ae(
|
|
1647
|
+
knownActiveChannelUrl: Ae(_.userId)
|
|
1648
1648
|
});
|
|
1649
|
-
return J(
|
|
1649
|
+
return J(_.userId, A.active_channel.channel_url), C({ url: A.active_channel.channel_url, status: W.OPEN }), c.info(
|
|
1650
1650
|
"messengerSession.refreshActiveChannel: refreshed active channel",
|
|
1651
1651
|
A.active_channel.channel_url
|
|
1652
1652
|
), A.active_channel.channel_url;
|
|
@@ -1656,30 +1656,30 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1656
1656
|
a,
|
|
1657
1657
|
o,
|
|
1658
1658
|
i,
|
|
1659
|
-
|
|
1659
|
+
_ == null ? void 0 : _.userId,
|
|
1660
1660
|
d,
|
|
1661
1661
|
m,
|
|
1662
1662
|
g,
|
|
1663
1663
|
B,
|
|
1664
1664
|
Ae,
|
|
1665
1665
|
J
|
|
1666
|
-
]),
|
|
1666
|
+
]), st = U(
|
|
1667
1667
|
async (A) => {
|
|
1668
|
-
if (!(
|
|
1668
|
+
if (!(_ != null && _.userId))
|
|
1669
1669
|
throw new Error("Current user is not authenticated. Please authenticate first.");
|
|
1670
1670
|
const M = (await a.aiAgent.requestMessengerSettings({
|
|
1671
1671
|
...A,
|
|
1672
|
-
userId:
|
|
1672
|
+
userId: _.userId,
|
|
1673
1673
|
knownActiveChannelUrl: void 0
|
|
1674
1674
|
})).active_channel.channel_url;
|
|
1675
|
-
return
|
|
1676
|
-
{ userId:
|
|
1675
|
+
return $e.set(
|
|
1676
|
+
{ userId: _.userId, appId: o, aiAgentId: A.aiAgentId },
|
|
1677
1677
|
{ knownActiveChannelUrl: M }
|
|
1678
1678
|
), M;
|
|
1679
1679
|
},
|
|
1680
|
-
[
|
|
1680
|
+
[_ == null ? void 0 : _.userId]
|
|
1681
1681
|
);
|
|
1682
|
-
return
|
|
1682
|
+
return yn(a, {
|
|
1683
1683
|
onChannelChanged: (A) => {
|
|
1684
1684
|
var I;
|
|
1685
1685
|
A.isGroupChannel() && A.url === (b == null ? void 0 : b.url) && (c.info("messengerSession.channelChanged: channel.conversation", A.conversation), C({ url: A.url, status: ((I = A.conversation) == null ? void 0 : I.status) ?? W.OPEN }));
|
|
@@ -1688,8 +1688,8 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1688
1688
|
var H, Ce;
|
|
1689
1689
|
if (A.conversation && A.conversation.type === Br.PROACTIVE && I.userId === ((H = a.currentUser) == null ? void 0 : H.userId)) {
|
|
1690
1690
|
c.info("messengerSession.onUserJoined: proactive channel joined", A.url);
|
|
1691
|
-
const
|
|
1692
|
-
C({ url: A.url, status:
|
|
1691
|
+
const ae = ((Ce = A.conversation) == null ? void 0 : Ce.status) ?? W.OPEN;
|
|
1692
|
+
C({ url: A.url, status: ae }), l.setOpened(!0), yi({
|
|
1693
1693
|
sound: document.hidden || !l.opened
|
|
1694
1694
|
});
|
|
1695
1695
|
}
|
|
@@ -1700,6 +1700,10 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1700
1700
|
return await a.groupChannel.getChannel(b.url);
|
|
1701
1701
|
};
|
|
1702
1702
|
return {
|
|
1703
|
+
chatSDK: a,
|
|
1704
|
+
deauthenticate: async () => {
|
|
1705
|
+
c.debug("messengerSession.deauthenticate: start"), await E(), C(void 0), K(null), se(null), y(null), _ && (Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: _.userId }), c.debug("messengerSession.deauthenticate: cleared user session cache")), c.debug("messengerSession.deauthenticate: completed");
|
|
1706
|
+
},
|
|
1703
1707
|
updateContext: async (I) => {
|
|
1704
1708
|
const H = await (await A()).updateContext(i, I);
|
|
1705
1709
|
return { ...H, context: H.context ?? {} };
|
|
@@ -1713,7 +1717,7 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1713
1717
|
return { ...M, context: M.context ?? {} };
|
|
1714
1718
|
}
|
|
1715
1719
|
};
|
|
1716
|
-
}, [b, a, i]), D(() => {
|
|
1720
|
+
}, [b, E, a, o, _, i]), D(() => {
|
|
1717
1721
|
async function A() {
|
|
1718
1722
|
c.debug("messengerSession.initialize: start");
|
|
1719
1723
|
const I = Ee(), M = await a.aiAgent.requestMessengerSettings({
|
|
@@ -1728,8 +1732,8 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1728
1732
|
c.debug("messengerSession.initialize: messenger settings response", M);
|
|
1729
1733
|
let H = null;
|
|
1730
1734
|
if (M.auto_created_user) {
|
|
1731
|
-
const { user_id:
|
|
1732
|
-
|
|
1735
|
+
const { user_id: Z, session_token: X, expire_at: ee } = M.auto_created_user;
|
|
1736
|
+
Ge.set({ appId: o, aiAgentId: i }, { userId: Z, authToken: X, expireAt: ee }), H = { userId: Z, authToken: X };
|
|
1733
1737
|
} else
|
|
1734
1738
|
H = {
|
|
1735
1739
|
userId: (I == null ? void 0 : I.userId) ?? "",
|
|
@@ -1737,16 +1741,16 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1737
1741
|
};
|
|
1738
1742
|
J(H.userId, M.active_channel.channel_url);
|
|
1739
1743
|
function Ce() {
|
|
1740
|
-
const
|
|
1741
|
-
x(
|
|
1742
|
-
const G = M.appearance.themes[
|
|
1744
|
+
const Z = M.appearance.selected_theme;
|
|
1745
|
+
x(Z, (ee) => {
|
|
1746
|
+
const G = M.appearance.themes[ee];
|
|
1743
1747
|
return {
|
|
1744
1748
|
primaryColor: G.primary_color,
|
|
1745
1749
|
botMessageBackgroundColor: G.bot_message_bg_color,
|
|
1746
1750
|
primaryContrastColor: G.primary_contrast_color,
|
|
1747
1751
|
botMessageBackgroundContrastColor: G.bot_message_bg_contrast_color
|
|
1748
1752
|
};
|
|
1749
|
-
}), T(void 0),
|
|
1753
|
+
}), T(void 0), K(H), se({
|
|
1750
1754
|
userId: M.bot.bot_userid,
|
|
1751
1755
|
profileUrl: M.bot.bot_profile_url,
|
|
1752
1756
|
nickname: M.bot.bot_nickname,
|
|
@@ -1757,17 +1761,17 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1757
1761
|
}), y({
|
|
1758
1762
|
type: M.launcher.image_type || "default_icon",
|
|
1759
1763
|
imageUrl: M.launcher.image_url
|
|
1760
|
-
}), M.launcher.auto_open && !
|
|
1764
|
+
}), M.launcher.auto_open && !Pe() && setTimeout(() => l.setOpened(!0), 500);
|
|
1761
1765
|
}
|
|
1762
|
-
function
|
|
1766
|
+
function ae() {
|
|
1763
1767
|
C({ url: M.active_channel.channel_url, status: W.OPEN });
|
|
1764
1768
|
}
|
|
1765
1769
|
try {
|
|
1766
1770
|
Ce();
|
|
1767
|
-
const
|
|
1768
|
-
await f(H, e == null ? void 0 : e.sessionHandler,
|
|
1769
|
-
} catch (
|
|
1770
|
-
|
|
1771
|
+
const Z = (X) => K((ee) => ee ? { ...ee, authToken: X } : null);
|
|
1772
|
+
await f(H, e == null ? void 0 : e.sessionHandler, Z), ae();
|
|
1773
|
+
} catch (Z) {
|
|
1774
|
+
Z instanceof Error && (c.error("messengerSession.initialize: failed to connect", Z), T(Z));
|
|
1771
1775
|
}
|
|
1772
1776
|
}
|
|
1773
1777
|
A().catch((I) => {
|
|
@@ -1775,14 +1779,14 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1775
1779
|
});
|
|
1776
1780
|
}, [a, o, i, e == null ? void 0 : e.userId, e == null ? void 0 : e.authToken]), D(() => {
|
|
1777
1781
|
p != null && p.onRegisterDeauthenticateHandler && (c.debug("messengerSession: registering deauthenticate handler"), p.onRegisterDeauthenticateHandler(E));
|
|
1778
|
-
}, [p == null ? void 0 : p.onRegisterDeauthenticateHandler, E]), !
|
|
1782
|
+
}, [p == null ? void 0 : p.onRegisterDeauthenticateHandler, E]), !_ || !L || !xe ? null : /* @__PURE__ */ r.createElement(
|
|
1779
1783
|
Ei,
|
|
1780
1784
|
{
|
|
1781
1785
|
value: {
|
|
1782
|
-
userSession:
|
|
1786
|
+
userSession: _,
|
|
1783
1787
|
activeChannel: b,
|
|
1784
|
-
refreshActiveChannel:
|
|
1785
|
-
createConversation:
|
|
1788
|
+
refreshActiveChannel: it,
|
|
1789
|
+
createConversation: st,
|
|
1786
1790
|
connectionError: v,
|
|
1787
1791
|
aiAgentInfo: { ...L, ...s == null ? void 0 : s.bot },
|
|
1788
1792
|
launcherInfo: { ...xe, ...s == null ? void 0 : s.launcher }
|
|
@@ -1799,7 +1803,7 @@ function yi({ sound: e }) {
|
|
|
1799
1803
|
new Audio(i.default).play();
|
|
1800
1804
|
});
|
|
1801
1805
|
}
|
|
1802
|
-
const
|
|
1806
|
+
const Y = (e) => {
|
|
1803
1807
|
const t = e;
|
|
1804
1808
|
return typeof t == "number" ? `${t}px` : t;
|
|
1805
1809
|
}, k = ({
|
|
@@ -1808,17 +1812,17 @@ const Z = (e) => {
|
|
|
1808
1812
|
color: n,
|
|
1809
1813
|
className: o,
|
|
1810
1814
|
...i
|
|
1811
|
-
}) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }),
|
|
1812
|
-
let n =
|
|
1813
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1815
|
+
}) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }), jt = /* @__PURE__ */ new WeakMap(), vi = (e, t) => {
|
|
1816
|
+
let n = jt.get(t);
|
|
1817
|
+
n || (n = /* @__PURE__ */ new Map(), jt.set(t, n));
|
|
1814
1818
|
const o = n.get(e);
|
|
1815
1819
|
if (o) return o;
|
|
1816
|
-
const i = t[e] ?? t.body1, a = $`font-size:${
|
|
1820
|
+
const i = t[e] ?? t.body1, a = $`font-size:${Y(i.fontSize)};font-weight:${i.fontWeight};${i.fontFamily ? `font-family: ${i.fontFamily};` : ""}
|
|
1817
1821
|
${i.lineHeight ? `line-height: ${i.lineHeight};` : "line-height: 100%;"}
|
|
1818
1822
|
`;
|
|
1819
1823
|
return n.set(e, a), a;
|
|
1820
|
-
}, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => vi(e, t.typography)}color:${({ $color: e }) => e};`,
|
|
1821
|
-
function
|
|
1824
|
+
}, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => vi(e, t.typography)}color:${({ $color: e }) => e};`, Be = 244, Bn = 640, Je = 26, Fn = 4, ie = 12, ke = 2, Si = 16, me = `${Q}-incoming-msg`, Ti = `${Q}-marked-text`;
|
|
1825
|
+
function St(e) {
|
|
1822
1826
|
switch (e) {
|
|
1823
1827
|
case "top":
|
|
1824
1828
|
case "middle":
|
|
@@ -1827,7 +1831,7 @@ function Tt(e) {
|
|
|
1827
1831
|
return Si;
|
|
1828
1832
|
}
|
|
1829
1833
|
}
|
|
1830
|
-
function
|
|
1834
|
+
function Tt(e, t) {
|
|
1831
1835
|
if (t) {
|
|
1832
1836
|
const [, n] = t.split("/");
|
|
1833
1837
|
if (n)
|
|
@@ -1840,7 +1844,7 @@ function wt(e, t) {
|
|
|
1840
1844
|
}
|
|
1841
1845
|
return "FILE";
|
|
1842
1846
|
}
|
|
1843
|
-
function
|
|
1847
|
+
function Un(e) {
|
|
1844
1848
|
return e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0;
|
|
1845
1849
|
}
|
|
1846
1850
|
const wi = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), ki = {
|
|
@@ -1887,26 +1891,26 @@ const wi = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"])
|
|
|
1887
1891
|
$size: t,
|
|
1888
1892
|
$color: o ?? h.color.primary.main
|
|
1889
1893
|
},
|
|
1890
|
-
/* @__PURE__ */ r.createElement(
|
|
1894
|
+
/* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(i, null))
|
|
1891
1895
|
);
|
|
1892
|
-
}, Ai = $`[dir='rtl'] &{transform:scaleX(-1);}`, Ii = u.div`width:${({ $size: e }) =>
|
|
1893
|
-
function
|
|
1896
|
+
}, Ai = $`[dir='rtl'] &{transform:scaleX(-1);}`, Ii = u.div`width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(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 && Ai};`;
|
|
1897
|
+
function wt({
|
|
1894
1898
|
name: e,
|
|
1895
1899
|
type: t = "FILE",
|
|
1896
1900
|
iconColor: n,
|
|
1897
1901
|
iconBackgroundColor: o,
|
|
1898
1902
|
onClick: i
|
|
1899
1903
|
}) {
|
|
1900
|
-
const { colors: a } =
|
|
1904
|
+
const { colors: a } = Et();
|
|
1901
1905
|
return /* @__PURE__ */ r.createElement($i, { onClick: i, $clickable: !!i }, /* @__PURE__ */ r.createElement(Oi, { $bgColor: o ?? a.base.primary }, /* @__PURE__ */ r.createElement(O, { type: "file-document", size: 24, color: n ?? a.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Li, null, /* @__PURE__ */ r.createElement(Ri, { variant: "button", color: h.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(k, { color: h.themedColor.textMidEmphasis, variant: "caption3" }, t)));
|
|
1902
1906
|
}
|
|
1903
|
-
const $i = u.div`border-radius:12px;gap:8px;width:${
|
|
1907
|
+
const $i = u.div`border-radius:12px;gap:8px;width:${Be}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};${({ $clickable: e }) => e && Mi}`, Mi = $`cursor:pointer;&:hover{background-color:${h.themedColor.bg_100_500};}`, Oi = u.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Li = u.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ri = u(k)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
|
|
1904
1908
|
function Di({ file: e, children: t, onClickFile: n }) {
|
|
1905
1909
|
return /* @__PURE__ */ r.createElement(Ni, null, /* @__PURE__ */ r.createElement(
|
|
1906
|
-
|
|
1910
|
+
wt,
|
|
1907
1911
|
{
|
|
1908
1912
|
name: e.name,
|
|
1909
|
-
type:
|
|
1913
|
+
type: Tt(e.name, e.type),
|
|
1910
1914
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
1911
1915
|
}
|
|
1912
1916
|
), t);
|
|
@@ -1916,25 +1920,28 @@ function Pi({ file: e, onClickMedia: t, children: n }) {
|
|
|
1916
1920
|
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Ui, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Hi, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
|
|
1917
1921
|
if (o) {
|
|
1918
1922
|
const i = {
|
|
1919
|
-
id: `${
|
|
1923
|
+
id: `${me}-media-body`,
|
|
1920
1924
|
onClick: () => t == null ? void 0 : t(e)
|
|
1921
1925
|
};
|
|
1922
1926
|
return /* @__PURE__ */ r.createElement(Bi, null, /* @__PURE__ */ r.createElement(Fi, { ...i }, o()), n);
|
|
1923
1927
|
}
|
|
1924
1928
|
return null;
|
|
1925
1929
|
}
|
|
1926
|
-
const Bi = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${ke}px;`, Fi = u.div`width:${
|
|
1930
|
+
const Bi = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${ke}px;`, Fi = u.div`width:${Be}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${N.light`
|
|
1927
1931
|
background-color: ${h.color.background100};
|
|
1928
1932
|
`}
|
|
1929
1933
|
${N.dark`
|
|
1930
1934
|
background-color: ${h.color.background400};
|
|
1931
1935
|
`}
|
|
1932
1936
|
`, Ui = u.img`width:100%;height:100%;object-fit:cover;`, Hi = u.video`width:100%;height:100%;object-fit:cover;`, zi = "✱";
|
|
1933
|
-
function
|
|
1937
|
+
function Hn(e) {
|
|
1934
1938
|
const t = new RegExp(`${zi}+`, "g");
|
|
1935
1939
|
return e.replace(t, (n) => `<span id=${Ti} aria-label="masked-text">${n}</span>`);
|
|
1936
1940
|
}
|
|
1937
1941
|
function Vi(e) {
|
|
1942
|
+
return e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>");
|
|
1943
|
+
}
|
|
1944
|
+
function Wi(e) {
|
|
1938
1945
|
const t = /```(\w+)?\n([\s\S]*?)```/g, n = [];
|
|
1939
1946
|
let o = 0;
|
|
1940
1947
|
return e.replace(t, (i, ...a) => {
|
|
@@ -1950,94 +1957,97 @@ function Vi(e) {
|
|
|
1950
1957
|
}), o < e.length && n.push({
|
|
1951
1958
|
type: "text",
|
|
1952
1959
|
value: e.slice(o).trim()
|
|
1953
|
-
}), n.map((i) => i.type !== "text" ? i : { ...i, value:
|
|
1960
|
+
}), n.map((i) => i.type !== "text" ? i : { ...i, value: Hn(i.value) });
|
|
1954
1961
|
}
|
|
1955
|
-
const
|
|
1956
|
-
function
|
|
1962
|
+
const Gi = w(async () => ({ default: (await import("./CDvzufwm.js")).MarkdownText })), ji = w(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
|
|
1963
|
+
function Kt(e) {
|
|
1957
1964
|
var i, a;
|
|
1958
|
-
const t = e.maxBodyWidth ??
|
|
1959
|
-
id: `${
|
|
1965
|
+
const t = e.maxBodyWidth ?? Be, n = ve(() => Wi(e.message), [e.message]), o = {
|
|
1966
|
+
id: `${me}-text-body`,
|
|
1960
1967
|
$maxWidth: t,
|
|
1961
1968
|
$color: (i = e.customStyle) == null ? void 0 : i.bubbleContentColor,
|
|
1962
1969
|
$bgColor: (a = e.customStyle) == null ? void 0 : a.bubbleBackgroundColor
|
|
1963
1970
|
};
|
|
1964
|
-
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(
|
|
1971
|
+
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Zt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Zt, { ...o }, n.map((s, l) => s.type === "text" ? /* @__PURE__ */ r.createElement(Yt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(Oe, { fallback: s.value }, /* @__PURE__ */ r.createElement(Gi, { onClickImage: (c) => {
|
|
1972
|
+
var d;
|
|
1973
|
+
return (d = e.onClickMedia) == null ? void 0 : d.call(e, { url: c, type: "image/*" });
|
|
1974
|
+
} }, s.value))) : s.type === "code" ? /* @__PURE__ */ r.createElement(Oe, { key: l, fallback: /* @__PURE__ */ r.createElement(Yt, { variant: "body3" }, s.value) }, /* @__PURE__ */ r.createElement(ji, { code: s.value, language: s.language })) : null), e.children);
|
|
1965
1975
|
}
|
|
1966
|
-
const
|
|
1976
|
+
const Zt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => $`
|
|
1967
1977
|
color: ${t || e.colors.messageIncoming.text};
|
|
1968
1978
|
background-color: ${n || e.colors.messageIncoming.background};
|
|
1969
1979
|
`}
|
|
1970
1980
|
padding: 12px 0;
|
|
1971
1981
|
transition: max-width 0.3s;
|
|
1972
1982
|
overflow-wrap: break-word;
|
|
1973
|
-
`,
|
|
1974
|
-
function
|
|
1975
|
-
const { stringSet: t } = R(), n =
|
|
1983
|
+
`, Yt = u(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
1984
|
+
function Ki(e) {
|
|
1985
|
+
const { stringSet: t } = R(), n = Un(e) ? /* @__PURE__ */ r.createElement(Kt, { ...e }) : null;
|
|
1976
1986
|
if (e.messageType === "user")
|
|
1977
1987
|
return n;
|
|
1978
1988
|
if (e.messageType === "file") {
|
|
1979
1989
|
const o = e.file;
|
|
1980
1990
|
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Pi, { ...e }, n) : /* @__PURE__ */ r.createElement(Di, { ...e }, n);
|
|
1981
1991
|
}
|
|
1982
|
-
return /* @__PURE__ */ r.createElement(
|
|
1992
|
+
return /* @__PURE__ */ r.createElement(Kt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
1983
1993
|
}
|
|
1984
|
-
const
|
|
1985
|
-
function
|
|
1986
|
-
return /* @__PURE__ */ r.createElement(
|
|
1994
|
+
const kt = (e) => /* @__PURE__ */ r.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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" }));
|
|
1995
|
+
function At({ id: e, src: t, size: n = 56, onClick: o, style: i }) {
|
|
1996
|
+
return /* @__PURE__ */ r.createElement(Zi, { id: e, tabIndex: 0, onClick: o, $size: Y(n), style: i }, t ? /* @__PURE__ */ r.createElement(Yi, { src: t }) : /* @__PURE__ */ r.createElement(O, { type: "user", size: n }));
|
|
1987
1997
|
}
|
|
1988
|
-
const
|
|
1989
|
-
function
|
|
1990
|
-
const n = `${
|
|
1991
|
-
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(
|
|
1998
|
+
const Zi = u.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${h.themedColor.bg_100_500};&:focus{outline:none;}`, Yi = u.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
|
|
1999
|
+
function qi({ sender: e, isBotMessage: t }) {
|
|
2000
|
+
const n = `${me}-sender-avatar`;
|
|
2001
|
+
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Ji, { id: n }, /* @__PURE__ */ r.createElement(kt, null)) : /* @__PURE__ */ r.createElement(At, { id: n, size: Je, src: e.profileUrl });
|
|
1992
2002
|
}
|
|
1993
|
-
const
|
|
1994
|
-
function
|
|
1995
|
-
return /* @__PURE__ */ r.createElement(
|
|
2003
|
+
const Ji = u.div`flex-shrink:0;width:${Je}px;height:${Je}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};}}`;
|
|
2004
|
+
function Xi({ sender: e }) {
|
|
2005
|
+
return /* @__PURE__ */ r.createElement(Qi, { id: `${me}-sender-name`, variant: "caption1", color: h.themedColor.textMidEmphasis }, e.nickname);
|
|
1996
2006
|
}
|
|
1997
|
-
const
|
|
1998
|
-
function
|
|
2007
|
+
const Qi = u(k)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
|
|
2008
|
+
function es({ createdAt: e }) {
|
|
1999
2009
|
const { stringSet: t, format: n } = R();
|
|
2000
|
-
return e ? /* @__PURE__ */ r.createElement(k, { id: `${
|
|
2010
|
+
return e ? /* @__PURE__ */ r.createElement(k, { id: `${me}-sent-time`, variant: "caption4", color: h.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2001
2011
|
}
|
|
2002
|
-
function
|
|
2003
|
-
return /* @__PURE__ */ r.createElement(
|
|
2012
|
+
function ts({ customStyle: e }) {
|
|
2013
|
+
return /* @__PURE__ */ r.createElement(ns, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(rs, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
|
|
2004
2014
|
}
|
|
2005
|
-
const
|
|
2006
|
-
function
|
|
2015
|
+
const ns = u.div`align-items:center;border-radius:12px;display:flex;gap:6px;justify-content:center;padding:16px 12px;background-color:${({ theme: e, $bgColor: t }) => t || e.colors.messageIncoming.background};`, rs = u.span`animation:blink 1.4s infinite;animation-fill-mode:both;border-radius:50%;height:8px;width:8px;background:${({ theme: e, $color: t }) => t || 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;}`;
|
|
2016
|
+
function Le() {
|
|
2007
2017
|
}
|
|
2008
|
-
async function
|
|
2018
|
+
async function zn(e) {
|
|
2009
2019
|
let t = e;
|
|
2010
2020
|
t && (!t.startsWith("http://") && !t.startsWith("https://") && (t = "https://" + t), window.open(t, "_blank", "noopener,noreferrer"));
|
|
2011
2021
|
}
|
|
2012
|
-
function
|
|
2022
|
+
function Vn(e) {
|
|
2013
2023
|
return !e || !e.conversation ? !1 : e.conversation.status === W.CLOSED;
|
|
2014
2024
|
}
|
|
2015
|
-
function
|
|
2025
|
+
function Wn(e) {
|
|
2016
2026
|
return !e || !e.conversation ? !1 : e.conversation.status === W.OPEN;
|
|
2017
2027
|
}
|
|
2018
|
-
function
|
|
2028
|
+
function Gn(e) {
|
|
2019
2029
|
var n;
|
|
2020
2030
|
const t = (n = e == null ? void 0 : e.conversation) == null ? void 0 : n.handoff;
|
|
2021
2031
|
return !!(t != null && t.timestamp);
|
|
2022
2032
|
}
|
|
2023
|
-
function
|
|
2024
|
-
return
|
|
2033
|
+
function os(e) {
|
|
2034
|
+
return Wn(e) && !Gn(e);
|
|
2025
2035
|
}
|
|
2026
|
-
function
|
|
2036
|
+
function is({
|
|
2027
2037
|
extendedMessagePayload: e,
|
|
2028
|
-
onClickCTA: t = ({ url: n }) =>
|
|
2038
|
+
onClickCTA: t = ({ url: n }) => zn(n)
|
|
2029
2039
|
}) {
|
|
2030
2040
|
const n = e == null ? void 0 : e.cta_button;
|
|
2031
|
-
return n ? /* @__PURE__ */ r.createElement(
|
|
2041
|
+
return n ? /* @__PURE__ */ r.createElement(ss, { id: `${me}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(as, { variant: "button" }, n.label)) : null;
|
|
2032
2042
|
}
|
|
2033
|
-
const
|
|
2043
|
+
const ss = u.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${h.themedColor.textHighEmphasis};background-color:${h.color.background50};${N.dark`
|
|
2034
2044
|
background-color: ${h.color.ondark.textDisabled};
|
|
2035
2045
|
`}
|
|
2036
|
-
`,
|
|
2037
|
-
function
|
|
2046
|
+
`, as = u(k)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
|
|
2047
|
+
function ls(e) {
|
|
2038
2048
|
return /* @__PURE__ */ r.createElement(r.Fragment, null);
|
|
2039
2049
|
}
|
|
2040
|
-
class
|
|
2050
|
+
class cs extends _r {
|
|
2041
2051
|
constructor(t) {
|
|
2042
2052
|
super(t), this.state = {
|
|
2043
2053
|
hasError: !1
|
|
@@ -2047,32 +2057,32 @@ class ls extends _r {
|
|
|
2047
2057
|
return { hasError: !0 };
|
|
2048
2058
|
}
|
|
2049
2059
|
render() {
|
|
2050
|
-
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(
|
|
2060
|
+
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(Oe, { fallback: this.props.loadingFallback }, this.props.children);
|
|
2051
2061
|
}
|
|
2052
2062
|
}
|
|
2053
|
-
const
|
|
2063
|
+
const ds = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: us } = jr({
|
|
2054
2064
|
parser: Wr,
|
|
2055
2065
|
renderer: Vr,
|
|
2056
2066
|
Container: (e) => /* @__PURE__ */ r.createElement("div", { ...e })
|
|
2057
2067
|
});
|
|
2058
|
-
function
|
|
2068
|
+
function ms(e) {
|
|
2059
2069
|
return /* @__PURE__ */ r.createElement(
|
|
2060
|
-
|
|
2070
|
+
cs,
|
|
2061
2071
|
{
|
|
2062
2072
|
errorFallback: e.messageTemplateErrorFallback,
|
|
2063
2073
|
loadingFallback: e.messageTemplateLoadingFallback
|
|
2064
2074
|
},
|
|
2065
|
-
/* @__PURE__ */ r.createElement(
|
|
2075
|
+
/* @__PURE__ */ r.createElement(hs, { ...e })
|
|
2066
2076
|
);
|
|
2067
2077
|
}
|
|
2068
|
-
const
|
|
2078
|
+
const hs = ({
|
|
2069
2079
|
extendedMessagePayload: e,
|
|
2070
2080
|
onGetCachedMessageTemplate: t = () => null,
|
|
2071
2081
|
onRequestMessageTemplate: n,
|
|
2072
|
-
onHandleTemplateInternalAction: o =
|
|
2082
|
+
onHandleTemplateInternalAction: o = Le
|
|
2073
2083
|
}) => {
|
|
2074
2084
|
const i = e == null ? void 0 : e.message_template;
|
|
2075
|
-
if (!
|
|
2085
|
+
if (!ds.has((i == null ? void 0 : i.type) ?? "default")) throw new Error("Unsupported template type");
|
|
2076
2086
|
if (!n) throw new Error("onRequestMessageTemplate is required");
|
|
2077
2087
|
const { theme: s } = ii(), l = Go({
|
|
2078
2088
|
onRequestTemplate: n,
|
|
@@ -2083,24 +2093,24 @@ const ms = ({
|
|
|
2083
2093
|
viewVariables: i == null ? void 0 : i.view_variables,
|
|
2084
2094
|
aiAgentColorVariables: s.aiAgentColorVariables
|
|
2085
2095
|
});
|
|
2086
|
-
return /* @__PURE__ */ r.createElement(
|
|
2096
|
+
return /* @__PURE__ */ r.createElement(gs, { id: `${me}-ext-message-template` }, /* @__PURE__ */ r.createElement(
|
|
2087
2097
|
Gr,
|
|
2088
2098
|
{
|
|
2089
2099
|
handleInternalAction: (c, d) => {
|
|
2090
2100
|
c.stopPropagation(), o == null || o(d);
|
|
2091
2101
|
}
|
|
2092
2102
|
},
|
|
2093
|
-
/* @__PURE__ */ r.createElement(
|
|
2103
|
+
/* @__PURE__ */ r.createElement(us, { templateItems: l.body.items, templateVersion: l.version })
|
|
2094
2104
|
));
|
|
2095
|
-
},
|
|
2096
|
-
function
|
|
2105
|
+
}, gs = u.div`box-sizing:border-box;overflow:hidden;width:100%;`;
|
|
2106
|
+
function ps({
|
|
2097
2107
|
extendedMessagePayload: e,
|
|
2098
2108
|
onClickSuggestedReply: t,
|
|
2099
2109
|
suggestedRepliesDirection: n = "vertical"
|
|
2100
2110
|
}) {
|
|
2101
|
-
const [o, i] =
|
|
2102
|
-
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(
|
|
2103
|
-
|
|
2111
|
+
const [o, i] = S(!1), a = (e == null ? void 0 : e.suggested_replies) ?? [];
|
|
2112
|
+
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(fs, { id: `${me}-ext-suggested-replies`, $type: n }, a.map((s, l) => /* @__PURE__ */ r.createElement(
|
|
2113
|
+
bs,
|
|
2104
2114
|
{
|
|
2105
2115
|
key: l,
|
|
2106
2116
|
$type: n,
|
|
@@ -2112,38 +2122,38 @@ function gs({
|
|
|
2112
2122
|
s
|
|
2113
2123
|
)));
|
|
2114
2124
|
}
|
|
2115
|
-
const
|
|
2116
|
-
${e === "vertical" ?
|
|
2125
|
+
const fs = u.div`margin:16px 0;padding:0 ${ie}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? xs : Es};`, bs = u(k)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:20px / clamp(20px,5%,100px);cursor:pointer;word-break:break-word;color:${h.color.primary.main};border:1px solid ${h.color.primary.main};background-color:${h.themedColor.bg_50_600};&:hover{background-color:${h.themedColor.bg_100_500};}${({ $type: e, theme: t }) => $`
|
|
2126
|
+
${e === "vertical" ? Cs : ys};
|
|
2117
2127
|
&:active {
|
|
2118
2128
|
background-color: ${t.colors.base.primary};
|
|
2119
2129
|
color: ${t.colors.base.primaryContrastContent};
|
|
2120
2130
|
}
|
|
2121
2131
|
`}
|
|
2122
|
-
`,
|
|
2123
|
-
function
|
|
2132
|
+
`, xs = $`flex-direction:column;align-items:flex-end;`, Es = $`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Cs = $`max-width:calc(100% - 70px);white-space:pre-wrap;`, ys = $`white-space:nowrap;`;
|
|
2133
|
+
function It(e) {
|
|
2124
2134
|
return e();
|
|
2125
2135
|
}
|
|
2126
2136
|
const _e = we({
|
|
2127
|
-
template:
|
|
2137
|
+
template: vs,
|
|
2128
2138
|
components: {
|
|
2129
|
-
SenderName:
|
|
2130
|
-
SenderAvatar:
|
|
2131
|
-
SentTime:
|
|
2132
|
-
MessageBody:
|
|
2133
|
-
TypingIndicator:
|
|
2134
|
-
SuggestedReplies:
|
|
2135
|
-
MessageTemplate:
|
|
2136
|
-
CTAButton:
|
|
2137
|
-
MessageLogs:
|
|
2139
|
+
SenderName: Xi,
|
|
2140
|
+
SenderAvatar: qi,
|
|
2141
|
+
SentTime: es,
|
|
2142
|
+
MessageBody: Ki,
|
|
2143
|
+
TypingIndicator: ts,
|
|
2144
|
+
SuggestedReplies: ps,
|
|
2145
|
+
MessageTemplate: ms,
|
|
2146
|
+
CTAButton: is,
|
|
2147
|
+
MessageLogs: ls
|
|
2138
2148
|
}
|
|
2139
2149
|
});
|
|
2140
|
-
function
|
|
2141
|
-
return /* @__PURE__ */ r.createElement(
|
|
2150
|
+
function vs(e) {
|
|
2151
|
+
return /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !1 });
|
|
2142
2152
|
}
|
|
2143
|
-
function
|
|
2153
|
+
function jn(e) {
|
|
2144
2154
|
var g, p, x, f;
|
|
2145
|
-
const { components: t } = _e.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((g = e.extendedMessagePayload) != null && g.message_template), a = !!((p = e.extendedMessagePayload) != null && p.cta_button), s = !!e.createdAt, l =
|
|
2146
|
-
return /* @__PURE__ */ r.createElement(
|
|
2155
|
+
const { components: t } = _e.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((g = e.extendedMessagePayload) != null && g.message_template), a = !!((p = e.extendedMessagePayload) != null && p.cta_button), s = !!e.createdAt, l = It(() => e.messageType === "user" ? e.message.length > 0 : !0), c = e.groupType === "top" || e.groupType === "single", d = e.groupType === "bottom" || e.groupType === "single", m = o ? 0 : Je;
|
|
2156
|
+
return /* @__PURE__ */ r.createElement(_s, { $marginBottom: n ? 0 : St(e.groupType) }, c && /* @__PURE__ */ r.createElement(Ss, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Bt, null, /* @__PURE__ */ r.createElement(ct, { $extraStartPadding: m }, n && /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }), /* @__PURE__ */ r.createElement(t.MessageBody, { ...e }, a && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...e })))), i && /* @__PURE__ */ r.createElement(qt, { $startPadding: 0, $endPadding: 0, style: { marginTop: l ? ke : 0 } }, /* @__PURE__ */ r.createElement(
|
|
2147
2157
|
t.MessageTemplate,
|
|
2148
2158
|
{
|
|
2149
2159
|
...e,
|
|
@@ -2157,71 +2167,74 @@ function Kn(e) {
|
|
|
2157
2167
|
)),
|
|
2158
2168
|
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(ct, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
|
|
2159
2169
|
}
|
|
2160
|
-
))), d && s && /* @__PURE__ */ r.createElement(
|
|
2170
|
+
))), d && s && /* @__PURE__ */ r.createElement(Ts, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Bt, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(qt, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
|
|
2161
2171
|
}
|
|
2162
|
-
const
|
|
2163
|
-
`,
|
|
2172
|
+
const _s = u.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2173
|
+
`, ot = u.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
|
|
2164
2174
|
padding-inline: ${e + n}px ${t}px;
|
|
2165
2175
|
`}
|
|
2166
|
-
`,
|
|
2176
|
+
`, Ss = u(ot)`display:flex;flex-direction:row;align-items:center;gap:8px;`, ct = u(ot)`display:flex;`, Ts = u(ot)`margin-top:${Fn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, qt = u(ot)`display:flex;flex-direction:column;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
|
|
2167
2177
|
padding-inline: ${e + n}px ${t}px;
|
|
2168
2178
|
`}
|
|
2169
2179
|
`;
|
|
2170
|
-
function
|
|
2171
|
-
return /* @__PURE__ */ r.createElement(
|
|
2172
|
-
|
|
2180
|
+
function ws({ file: e, children: t, onClickFile: n }) {
|
|
2181
|
+
return /* @__PURE__ */ r.createElement(ks, null, /* @__PURE__ */ r.createElement(
|
|
2182
|
+
wt,
|
|
2173
2183
|
{
|
|
2174
2184
|
name: e.name,
|
|
2175
|
-
type:
|
|
2185
|
+
type: Tt(e.name, e.type),
|
|
2176
2186
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
2177
2187
|
}
|
|
2178
2188
|
), t);
|
|
2179
2189
|
}
|
|
2180
|
-
const
|
|
2181
|
-
function
|
|
2182
|
-
const { aspectRatio: i, localFile: a } = t, [s] =
|
|
2190
|
+
const ks = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Kn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(As, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(O, { type: "spinner", size: n })), As = u.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
|
|
2191
|
+
function Is({ file: e, metadata: t, onClickMedia: n, children: o }) {
|
|
2192
|
+
const { aspectRatio: i, localFile: a } = t, [s] = S(() => a instanceof File ? URL.createObjectURL(a) : e.url), [l, c] = S(!1), d = {
|
|
2183
2193
|
onClick: () => n == null ? void 0 : n(e),
|
|
2184
2194
|
$ratio: i
|
|
2185
2195
|
};
|
|
2186
|
-
return /* @__PURE__ */ r.createElement(
|
|
2196
|
+
return /* @__PURE__ */ r.createElement($s, null, /* @__PURE__ */ r.createElement(Ms, { ...d }, !l && /* @__PURE__ */ r.createElement(Kn, { size: 26 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement(Os, { $loaded: l, src: s, alt: "image-message", onLoad: () => c(!0) })), o);
|
|
2187
2197
|
}
|
|
2188
|
-
const
|
|
2198
|
+
const $s = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Ms = u.div`width:${Be}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;${N.light`
|
|
2189
2199
|
background-color: ${h.color.background100};
|
|
2190
2200
|
`}
|
|
2191
2201
|
${N.dark`
|
|
2192
2202
|
background-color: ${h.color.background400};
|
|
2193
2203
|
`}
|
|
2194
|
-
`,
|
|
2195
|
-
function
|
|
2204
|
+
`, Os = u.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;`;
|
|
2205
|
+
function Jt(e) {
|
|
2196
2206
|
var n, o;
|
|
2197
|
-
const t = ve(() =>
|
|
2207
|
+
const t = ve(() => {
|
|
2208
|
+
const i = Vi(Hn(e.message));
|
|
2209
|
+
return _n.sanitize(i);
|
|
2210
|
+
}, [e.message]);
|
|
2198
2211
|
return /* @__PURE__ */ r.createElement(
|
|
2199
|
-
|
|
2212
|
+
Ls,
|
|
2200
2213
|
{
|
|
2201
|
-
$maxWidth: e.maxBodyWidth ??
|
|
2214
|
+
$maxWidth: e.maxBodyWidth ?? Be,
|
|
2202
2215
|
$color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
|
|
2203
2216
|
$bgColor: (o = e.customStyle) == null ? void 0 : o.bubbleBackgroundColor
|
|
2204
2217
|
},
|
|
2205
|
-
/* @__PURE__ */ r.createElement(
|
|
2218
|
+
/* @__PURE__ */ r.createElement(Rs, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
|
|
2206
2219
|
);
|
|
2207
2220
|
}
|
|
2208
|
-
const
|
|
2221
|
+
const Ls = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => $`
|
|
2209
2222
|
color: ${t || e.colors.messageOutgoing.text};
|
|
2210
2223
|
background-color: ${n || e.colors.messageOutgoing.background};
|
|
2211
2224
|
`}
|
|
2212
2225
|
padding: 12px 0;
|
|
2213
2226
|
transition: max-width 0.3s;
|
|
2214
2227
|
overflow-wrap: break-word;
|
|
2215
|
-
`,
|
|
2216
|
-
function
|
|
2217
|
-
const { stringSet: t } = R(), n =
|
|
2218
|
-
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(
|
|
2228
|
+
`, Rs = u(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
2229
|
+
function Ds(e) {
|
|
2230
|
+
const { stringSet: t } = R(), n = Un(e) ? /* @__PURE__ */ r.createElement(Jt, { ...e }) : null;
|
|
2231
|
+
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Is, { ...e }, n) : /* @__PURE__ */ r.createElement(ws, { ...e }, n) : /* @__PURE__ */ r.createElement(Jt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
2219
2232
|
}
|
|
2220
|
-
function
|
|
2221
|
-
const t =
|
|
2233
|
+
function Ns({ sendingStatus: e }) {
|
|
2234
|
+
const t = Et();
|
|
2222
2235
|
switch (e) {
|
|
2223
2236
|
case "pending":
|
|
2224
|
-
return /* @__PURE__ */ r.createElement(
|
|
2237
|
+
return /* @__PURE__ */ r.createElement(Ps, { size: 16 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
|
|
2225
2238
|
case "failed":
|
|
2226
2239
|
return /* @__PURE__ */ r.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ r.createElement(O, { type: "error", color: h.themedColor.error, size: 16 }));
|
|
2227
2240
|
case "scheduled":
|
|
@@ -2231,41 +2244,41 @@ function Ds({ sendingStatus: e }) {
|
|
|
2231
2244
|
return /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(O, { type: "chevron-down" }));
|
|
2232
2245
|
}
|
|
2233
2246
|
}
|
|
2234
|
-
const
|
|
2235
|
-
function
|
|
2247
|
+
const Ps = u(Kn)`margin-bottom:2px;width:16px;height:16px;`;
|
|
2248
|
+
function Bs({ createdAt: e }) {
|
|
2236
2249
|
const { stringSet: t, format: n } = R();
|
|
2237
2250
|
return e ? /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2238
2251
|
}
|
|
2239
|
-
const
|
|
2240
|
-
template:
|
|
2252
|
+
const $t = we({
|
|
2253
|
+
template: Fs,
|
|
2241
2254
|
components: {
|
|
2242
|
-
SendingStatus:
|
|
2243
|
-
SentTime:
|
|
2244
|
-
MessageBody:
|
|
2255
|
+
SendingStatus: Ns,
|
|
2256
|
+
SentTime: Bs,
|
|
2257
|
+
MessageBody: Ds
|
|
2245
2258
|
}
|
|
2246
2259
|
});
|
|
2247
|
-
function
|
|
2248
|
-
const { components: t } =
|
|
2249
|
-
return /* @__PURE__ */ r.createElement(
|
|
2260
|
+
function Fs(e) {
|
|
2261
|
+
const { components: t } = $t.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
|
|
2262
|
+
return /* @__PURE__ */ r.createElement(Us, { $marginBottom: St(e.groupType) }, /* @__PURE__ */ r.createElement(Hs, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(zs, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
|
|
2250
2263
|
}
|
|
2251
|
-
const
|
|
2252
|
-
`,
|
|
2253
|
-
`,
|
|
2254
|
-
function
|
|
2255
|
-
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(
|
|
2264
|
+
const Us = u.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2265
|
+
`, Zn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = ie, $endPadding: t = ie, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
|
|
2266
|
+
`, Hs = u(Zn)``, zs = u(Zn)`margin-top:${Fn}px;`;
|
|
2267
|
+
function Vs(e) {
|
|
2268
|
+
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Ws, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, Gs(_n.sanitize(e.message))));
|
|
2256
2269
|
}
|
|
2257
|
-
const
|
|
2270
|
+
const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Gs = (e) => {
|
|
2258
2271
|
const t = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, n = [];
|
|
2259
2272
|
let o = 0;
|
|
2260
2273
|
return e.replace(t, (i, a, s, l) => (n.push(e.slice(o, l)), n.push(
|
|
2261
|
-
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel:
|
|
2274
|
+
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel: _t }, a)
|
|
2262
2275
|
), o = l + i.length, i)), n.push(e.slice(o)), n;
|
|
2263
|
-
},
|
|
2276
|
+
}, js = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
|
|
2264
2277
|
const { stringSet: i } = R();
|
|
2265
2278
|
return D(() => {
|
|
2266
2279
|
typeof n > "u" && typeof t == "boolean" && (o == null || o(t));
|
|
2267
|
-
}, [n, t]), /* @__PURE__ */ r.createElement(
|
|
2268
|
-
|
|
2280
|
+
}, [n, t]), /* @__PURE__ */ r.createElement(Ks, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, i.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
|
|
2281
|
+
Xt,
|
|
2269
2282
|
{
|
|
2270
2283
|
checked: n === !0,
|
|
2271
2284
|
label: i.CSAT_CRE_SOLVED,
|
|
@@ -2273,7 +2286,7 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2273
2286
|
onClick: () => o == null ? void 0 : o(!0)
|
|
2274
2287
|
}
|
|
2275
2288
|
), /* @__PURE__ */ r.createElement(
|
|
2276
|
-
|
|
2289
|
+
Xt,
|
|
2277
2290
|
{
|
|
2278
2291
|
checked: n === !1,
|
|
2279
2292
|
label: i.CSAT_CRE_NOT_SOLVED,
|
|
@@ -2281,17 +2294,17 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2281
2294
|
onClick: () => o == null ? void 0 : o(!1)
|
|
2282
2295
|
}
|
|
2283
2296
|
)));
|
|
2284
|
-
},
|
|
2297
|
+
}, Xt = ({ onClick: e, checked: t, label: n, disabled: o }) => {
|
|
2285
2298
|
const i = t ? h.color.primary.main : o ? h.themedColor.textDisabled : h.themedColor.textLowEmphasis, a = t ? h.themedColor.textHighEmphasis : o ? h.themedColor.textLowEmphasis : h.themedColor.textHighEmphasis;
|
|
2286
|
-
return /* @__PURE__ */ r.createElement(
|
|
2287
|
-
}, js = u.div`display:flex;flex-direction:column;gap:8px;`, Ks = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, Zs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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__ */ r.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 })), Ys = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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__ */ r.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__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ r.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ r.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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" })), Js = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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__ */ r.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" })), Xs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), Qs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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" })), ea = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), ta = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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" })), na = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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" })), ra = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.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__ */ r.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ r.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__ */ r.createElement("mask", { id: "mask0_159_173224", style: {
|
|
2299
|
+
return /* @__PURE__ */ r.createElement(Zs, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(O, { size: 24, type: t ? "radio-on" : "radio-off", color: i }), /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: a }, n));
|
|
2300
|
+
}, Ks = u.div`display:flex;flex-direction:column;gap:8px;`, Zs = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, Ys = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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__ */ r.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 })), qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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__ */ r.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__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ r.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ r.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), Js = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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" })), Xs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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__ */ r.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" })), Qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), ea = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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" })), ta = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), na = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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" })), ra = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.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__ */ r.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__ */ r.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" })), oa = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.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__ */ r.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ r.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__ */ r.createElement("mask", { id: "mask0_159_173224", style: {
|
|
2288
2301
|
maskType: "alpha"
|
|
2289
|
-
}, maskUnits: "userSpaceOnUse", x: 12, y: 22, width: 16, height: 9 }, /* @__PURE__ */ r.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__ */ r.createElement("g", { mask: "url(#mask0_159_173224)" }, /* @__PURE__ */ r.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__ */ r.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__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ r.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })))),
|
|
2302
|
+
}, maskUnits: "userSpaceOnUse", x: 12, y: 22, width: 16, height: 9 }, /* @__PURE__ */ r.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__ */ r.createElement("g", { mask: "url(#mask0_159_173224)" }, /* @__PURE__ */ r.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__ */ r.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__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ r.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })))), ia = [
|
|
2290
2303
|
{
|
|
2291
2304
|
value: 1,
|
|
2292
2305
|
Icon: {
|
|
2293
|
-
Active:
|
|
2294
|
-
Inactive:
|
|
2306
|
+
Active: qs,
|
|
2307
|
+
Inactive: Ys
|
|
2295
2308
|
},
|
|
2296
2309
|
isActive: (e) => e <= 1,
|
|
2297
2310
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_1
|
|
@@ -2299,8 +2312,8 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2299
2312
|
{
|
|
2300
2313
|
value: 2,
|
|
2301
2314
|
Icon: {
|
|
2302
|
-
Active:
|
|
2303
|
-
Inactive:
|
|
2315
|
+
Active: Xs,
|
|
2316
|
+
Inactive: Js
|
|
2304
2317
|
},
|
|
2305
2318
|
isActive: (e) => e === 2,
|
|
2306
2319
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_2
|
|
@@ -2308,8 +2321,8 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2308
2321
|
{
|
|
2309
2322
|
value: 3,
|
|
2310
2323
|
Icon: {
|
|
2311
|
-
Active:
|
|
2312
|
-
Inactive:
|
|
2324
|
+
Active: ea,
|
|
2325
|
+
Inactive: Qs
|
|
2313
2326
|
},
|
|
2314
2327
|
isActive: (e) => e === 3,
|
|
2315
2328
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_3
|
|
@@ -2317,8 +2330,8 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2317
2330
|
{
|
|
2318
2331
|
value: 4,
|
|
2319
2332
|
Icon: {
|
|
2320
|
-
Active:
|
|
2321
|
-
Inactive:
|
|
2333
|
+
Active: na,
|
|
2334
|
+
Inactive: ta
|
|
2322
2335
|
},
|
|
2323
2336
|
isActive: (e) => e === 4,
|
|
2324
2337
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_4
|
|
@@ -2326,13 +2339,13 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2326
2339
|
{
|
|
2327
2340
|
value: 5,
|
|
2328
2341
|
Icon: {
|
|
2329
|
-
Active:
|
|
2330
|
-
Inactive:
|
|
2342
|
+
Active: oa,
|
|
2343
|
+
Inactive: ra
|
|
2331
2344
|
},
|
|
2332
2345
|
isActive: (e) => 5 <= e,
|
|
2333
2346
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_5
|
|
2334
2347
|
}
|
|
2335
|
-
],
|
|
2348
|
+
], sa = () => ia, Yn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(bt, null, t, /* @__PURE__ */ r.createElement(ca, { $position: n }, /* @__PURE__ */ r.createElement(da, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(aa, { $position: n }))), aa = ({ $position: e }) => /* @__PURE__ */ r.createElement(
|
|
2336
2349
|
"svg",
|
|
2337
2350
|
{
|
|
2338
2351
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -2343,13 +2356,13 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2343
2356
|
fill: "none"
|
|
2344
2357
|
},
|
|
2345
2358
|
/* @__PURE__ */ r.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill: h.themedColor.textHighEmphasis })
|
|
2346
|
-
),
|
|
2359
|
+
), la = {
|
|
2347
2360
|
top: $`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
2348
2361
|
bottom: $`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
2349
|
-
}, bt = u.div`position:relative;`,
|
|
2350
|
-
const { stringSet: o } = R(), i =
|
|
2351
|
-
return /* @__PURE__ */ r.createElement(
|
|
2352
|
-
|
|
2362
|
+
}, bt = u.div`position:relative;`, ca = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${be.TOOLTIP};${({ $position: e }) => la[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${bt}:hover &,${bt}:focus-within &{opacity:1;}`, da = u(k)`padding:6px 8px;background:${h.themedColor.textHighEmphasis};color:${h.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, ua = ({ submitted: e, value: t, onChange: n }) => {
|
|
2363
|
+
const { stringSet: o } = R(), i = sa(), a = typeof t == "number";
|
|
2364
|
+
return /* @__PURE__ */ r.createElement(ma, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(ha, null, i.map((s) => /* @__PURE__ */ r.createElement(Yn, { disabled: e, key: s.value, label: s.getTooltip(o) }, /* @__PURE__ */ r.createElement(
|
|
2365
|
+
ga,
|
|
2353
2366
|
{
|
|
2354
2367
|
disabled: e,
|
|
2355
2368
|
onClick: () => n(s.value),
|
|
@@ -2357,16 +2370,16 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2357
2370
|
},
|
|
2358
2371
|
a ? s.isActive(t) ? /* @__PURE__ */ r.createElement(s.Icon.Active, null) : /* @__PURE__ */ r.createElement(s.Icon.Inactive, null) : /* @__PURE__ */ r.createElement(s.Icon.Active, null)
|
|
2359
2372
|
)))));
|
|
2360
|
-
},
|
|
2373
|
+
}, ma = u.div`display:flex;flex-direction:column;gap:8px;`, ha = u.div`display:flex;justify-content:space-between;width:100%;max-width:320px;`, ga = u.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:${h.color.background200};${N.dark`
|
|
2361
2374
|
background-color: ${h.color.background500};
|
|
2362
2375
|
`}
|
|
2363
2376
|
}
|
|
2364
2377
|
|
|
2365
|
-
${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" &&
|
|
2366
|
-
`,
|
|
2378
|
+
${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" && pa};
|
|
2379
|
+
`, pa = $`[fill]{fill:white;fill-opacity:0.12;}[stroke]{stroke:white;stroke-opacity:0.12;}`, fa = ({ submitted: e, value: t = "", onChange: n }) => {
|
|
2367
2380
|
const { stringSet: o } = R();
|
|
2368
2381
|
return e && !t ? null : /* @__PURE__ */ r.createElement(
|
|
2369
|
-
|
|
2382
|
+
ba,
|
|
2370
2383
|
{
|
|
2371
2384
|
disabled: e,
|
|
2372
2385
|
maxLength: 255,
|
|
@@ -2375,7 +2388,7 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2375
2388
|
placeholder: o.CSAT_REASON_PLACEHOLDER
|
|
2376
2389
|
}
|
|
2377
2390
|
);
|
|
2378
|
-
},
|
|
2391
|
+
}, ba = u.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:${h.themedColor.textHighEmphasis};&::placeholder{color:${h.themedColor.textLowEmphasis};}background-color:${h.color.background50};${N.dark`
|
|
2379
2392
|
background-color: ${h.themedColor.textDisabled};
|
|
2380
2393
|
`}
|
|
2381
2394
|
|
|
@@ -2388,82 +2401,82 @@ const Vs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2388
2401
|
background-color: ${h.themedColor.textDisabled};
|
|
2389
2402
|
`}
|
|
2390
2403
|
}
|
|
2391
|
-
`,
|
|
2404
|
+
`, xa = ({ submitted: e }) => {
|
|
2392
2405
|
const { stringSet: t } = R();
|
|
2393
2406
|
return e ? /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, t.CSAT_TITLE_UNSUBMITTED);
|
|
2394
2407
|
};
|
|
2395
|
-
var
|
|
2396
|
-
const
|
|
2408
|
+
var ne = /* @__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.HELPDESK_CSAT_5 = "HELPDESK_CSAT_5", e))(ne || {});
|
|
2409
|
+
const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
2397
2410
|
type: e,
|
|
2398
2411
|
renderSubmitButton: t,
|
|
2399
2412
|
initialCsat: n,
|
|
2400
2413
|
initialCsatReason: o,
|
|
2401
2414
|
initialIsResolved: i
|
|
2402
2415
|
}) => {
|
|
2403
|
-
const [a, s] =
|
|
2416
|
+
const [a, s] = Ea({
|
|
2404
2417
|
csatType: e,
|
|
2405
2418
|
csat: n,
|
|
2406
2419
|
csatReason: o,
|
|
2407
2420
|
isResolved: i
|
|
2408
|
-
}), l = typeof n == "number" ? "submitted" : (e ===
|
|
2409
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
2410
|
-
|
|
2421
|
+
}), l = typeof n == "number" ? "submitted" : (e === ne.AI_AGENT_CSAT_5 || e === ne.HELPDESK_CSAT_5) && typeof a.csat == "number" || e === ne.AI_AGENT_CSAT_5_WITH_CRE && typeof a.csat == "number" && typeof a.isResolved == "boolean" ? "submittable" : "unsubmittable", c = { state: l, submitted: l === "submitted" };
|
|
2422
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ca, null, /* @__PURE__ */ r.createElement(xa, { ...c }), e === ne.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
|
|
2423
|
+
js,
|
|
2411
2424
|
{
|
|
2412
2425
|
...c,
|
|
2413
2426
|
defaultValue: i,
|
|
2414
2427
|
value: a.isResolved,
|
|
2415
2428
|
onChange: (d) => s({ isResolved: d })
|
|
2416
2429
|
}
|
|
2417
|
-
), /* @__PURE__ */ r.createElement(
|
|
2418
|
-
|
|
2430
|
+
), /* @__PURE__ */ r.createElement(ua, { ...c, value: a.csat, onChange: (d) => s({ csat: d }) }), a.csat && /* @__PURE__ */ r.createElement(
|
|
2431
|
+
fa,
|
|
2419
2432
|
{
|
|
2420
2433
|
...c,
|
|
2421
2434
|
value: a.csatReason,
|
|
2422
2435
|
onChange: (d) => s({ csatReason: d })
|
|
2423
2436
|
}
|
|
2424
2437
|
)), l !== "submitted" && t({ state: l, params: a }));
|
|
2425
|
-
},
|
|
2438
|
+
}, Ca = u.div`display:flex;flex-direction:column;gap:12px;`, ya = () => {
|
|
2426
2439
|
const { stringSet: e } = R();
|
|
2427
2440
|
return /* @__PURE__ */ r.createElement(k, { variant: "body2", color: h.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
|
|
2428
|
-
},
|
|
2441
|
+
}, va = (e) => {
|
|
2429
2442
|
if (e.messageType !== "admin.csat")
|
|
2430
2443
|
throw new Error("Invalid message type");
|
|
2431
2444
|
const t = Ur(), { stringSet: n } = R(), { extendedMessagePayload: o, csat: i, csatReason: a, csatExpireAt: s, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: m } = (o == null ? void 0 : o.csat) ?? {};
|
|
2432
|
-
if (!d || !m || !
|
|
2433
|
-
const g = m ===
|
|
2434
|
-
x.csat && !
|
|
2445
|
+
if (!d || !m || !ne[m]) return null;
|
|
2446
|
+
const g = m === ne.AI_AGENT_CSAT_5 || m === ne.AI_AGENT_CSAT_5_WITH_CRE || m === ne.HELPDESK_CSAT_5 ? dt : () => null, p = (x) => {
|
|
2447
|
+
x.csat && !Qt(s) ? c({
|
|
2435
2448
|
csatType: x.csatType,
|
|
2436
2449
|
csat: x.csat,
|
|
2437
2450
|
csatReason: x.csatReason,
|
|
2438
2451
|
isResolved: x.isResolved
|
|
2439
2452
|
}) : t();
|
|
2440
2453
|
};
|
|
2441
|
-
return /* @__PURE__ */ r.createElement(
|
|
2454
|
+
return /* @__PURE__ */ r.createElement(_a, null, !i && Qt(s) ? /* @__PURE__ */ r.createElement(ya, null) : /* @__PURE__ */ r.createElement(
|
|
2442
2455
|
g,
|
|
2443
2456
|
{
|
|
2444
2457
|
type: m,
|
|
2445
2458
|
initialCsat: i,
|
|
2446
2459
|
initialCsatReason: a,
|
|
2447
2460
|
initialIsResolved: l,
|
|
2448
|
-
renderSubmitButton: ({ state: x, params: f }) => /* @__PURE__ */ r.createElement(
|
|
2461
|
+
renderSubmitButton: ({ state: x, params: f }) => /* @__PURE__ */ r.createElement(Sa, { disabled: x !== "submittable", onClick: () => p(f) }, /* @__PURE__ */ r.createElement(k, { variant: "button" }, n.CSAT_SUBMIT_LABEL))
|
|
2449
2462
|
}
|
|
2450
2463
|
));
|
|
2451
|
-
},
|
|
2452
|
-
function
|
|
2464
|
+
}, _a = u.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, Sa = u.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:${h.color.primary.dark};}&:disabled{color:${h.color.ondark.textLowEmphasis};background-color:${h.themedColor.textDisabled};cursor:not-allowed;}`;
|
|
2465
|
+
function Qt(e) {
|
|
2453
2466
|
return !!e && e < Date.now();
|
|
2454
2467
|
}
|
|
2455
|
-
const
|
|
2456
|
-
template:
|
|
2468
|
+
const Mt = we({
|
|
2469
|
+
template: Ta,
|
|
2457
2470
|
components: {
|
|
2458
|
-
AdminMessage:
|
|
2459
|
-
CSATMessage:
|
|
2471
|
+
AdminMessage: Vs,
|
|
2472
|
+
CSATMessage: va
|
|
2460
2473
|
}
|
|
2461
2474
|
});
|
|
2462
|
-
function
|
|
2463
|
-
const { components: t } =
|
|
2464
|
-
return /* @__PURE__ */ r.createElement(
|
|
2475
|
+
function Ta(e) {
|
|
2476
|
+
const { components: t } = Mt.useContext(), n = It(() => e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null);
|
|
2477
|
+
return /* @__PURE__ */ r.createElement(wa, { $marginBottom: St(e.groupType) }, n);
|
|
2465
2478
|
}
|
|
2466
|
-
const
|
|
2479
|
+
const wa = u.div`padding-inline:${ie}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, en = {
|
|
2467
2480
|
file: "attach",
|
|
2468
2481
|
snippet: "snippet",
|
|
2469
2482
|
site: "website",
|
|
@@ -2473,7 +2486,7 @@ const Ta = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2473
2486
|
sb_zendesk: "zendesk",
|
|
2474
2487
|
sb_desk: "snippet"
|
|
2475
2488
|
// TODO: request icon
|
|
2476
|
-
},
|
|
2489
|
+
}, ka = ({
|
|
2477
2490
|
actionbook: e,
|
|
2478
2491
|
functionCalls: t,
|
|
2479
2492
|
groundedness: n,
|
|
@@ -2491,10 +2504,10 @@ const Ta = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2491
2504
|
// Note: This component is used with the dashboard, so cssVars should not be used.
|
|
2492
2505
|
iconColor: p = "#000000",
|
|
2493
2506
|
textColor: x = "#000000",
|
|
2494
|
-
highlightColor: f =
|
|
2507
|
+
highlightColor: f = Ln.DEFAULT_PRIMARY
|
|
2495
2508
|
} = g;
|
|
2496
|
-
return /* @__PURE__ */ r.createElement(
|
|
2497
|
-
|
|
2509
|
+
return /* @__PURE__ */ r.createElement(tn, null, e && /* @__PURE__ */ r.createElement(tn, null, /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "actionbook", color: p })), /* @__PURE__ */ r.createElement(
|
|
2510
|
+
je,
|
|
2498
2511
|
{
|
|
2499
2512
|
$clickable: !!i,
|
|
2500
2513
|
$highlightColor: f,
|
|
@@ -2503,8 +2516,8 @@ const Ta = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2503
2516
|
onClick: () => i == null ? void 0 : i(e)
|
|
2504
2517
|
},
|
|
2505
2518
|
e.name
|
|
2506
|
-
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(
|
|
2507
|
-
|
|
2519
|
+
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "function", color: p })), /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(
|
|
2520
|
+
je,
|
|
2508
2521
|
{
|
|
2509
2522
|
$clickable: !!i,
|
|
2510
2523
|
$highlightColor: f,
|
|
@@ -2513,11 +2526,11 @@ const Ta = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2513
2526
|
onClick: () => a == null ? void 0 : a(E)
|
|
2514
2527
|
},
|
|
2515
2528
|
E.name
|
|
2516
|
-
), /* @__PURE__ */ r.createElement(
|
|
2517
|
-
default: /* @__PURE__ */ r.createElement(O, { size: 16, type:
|
|
2529
|
+
), /* @__PURE__ */ r.createElement(Ia, { role: "button", onClick: () => s == null ? void 0 : s(E) }, /* @__PURE__ */ r.createElement(k, { variant: "body2", color: f }, "View details"), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: f }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.id }, /* @__PURE__ */ r.createElement(Ke, null, m({
|
|
2530
|
+
default: /* @__PURE__ */ r.createElement(O, { size: 16, type: en[E.source_type] ?? en.snippet, color: p }),
|
|
2518
2531
|
sourceType: E.source_type
|
|
2519
2532
|
})), /* @__PURE__ */ r.createElement(
|
|
2520
|
-
|
|
2533
|
+
je,
|
|
2521
2534
|
{
|
|
2522
2535
|
$clickable: !!l,
|
|
2523
2536
|
$highlightColor: f,
|
|
@@ -2526,8 +2539,8 @@ const Ta = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2526
2539
|
onClick: () => l == null ? void 0 : l(E)
|
|
2527
2540
|
},
|
|
2528
2541
|
E.preview_title
|
|
2529
|
-
))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(
|
|
2530
|
-
|
|
2542
|
+
))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "template", color: p })), /* @__PURE__ */ r.createElement(
|
|
2543
|
+
je,
|
|
2531
2544
|
{
|
|
2532
2545
|
$clickable: !!c,
|
|
2533
2546
|
$highlightColor: f,
|
|
@@ -2537,35 +2550,35 @@ const Ta = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2537
2550
|
},
|
|
2538
2551
|
E.name
|
|
2539
2552
|
))), d);
|
|
2540
|
-
},
|
|
2553
|
+
}, Aa = u(k)`font-weight:400;`, je = u(Aa)`${({ $clickable: e, $highlightColor: t }) => e && $`
|
|
2541
2554
|
cursor: pointer;
|
|
2542
2555
|
text-decoration: underline;
|
|
2543
2556
|
&:hover {
|
|
2544
2557
|
color: ${t};
|
|
2545
2558
|
}
|
|
2546
2559
|
`}
|
|
2547
|
-
`,
|
|
2548
|
-
function
|
|
2560
|
+
`, Ke = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Xe = u.div`display:flex;gap:8px;align-items:center;`, Ia = u(Xe)`cursor:pointer;gap:4px;`, ut = u(Xe)`flex-direction:row;align-items:center;`, tn = u.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, qn = Te(null);
|
|
2561
|
+
function $a({ testerType: e, children: t }) {
|
|
2549
2562
|
return /* @__PURE__ */ r.createElement(
|
|
2550
|
-
|
|
2563
|
+
qn.Provider,
|
|
2551
2564
|
{
|
|
2552
2565
|
value: { testerType: e, isActionbookTester: e === "actionbook" }
|
|
2553
2566
|
},
|
|
2554
|
-
e && /* @__PURE__ */ r.createElement(
|
|
2567
|
+
e && /* @__PURE__ */ r.createElement(Ma, null),
|
|
2555
2568
|
t
|
|
2556
2569
|
);
|
|
2557
2570
|
}
|
|
2558
|
-
const
|
|
2559
|
-
const e =
|
|
2571
|
+
const Fe = () => {
|
|
2572
|
+
const e = re(qn);
|
|
2560
2573
|
if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");
|
|
2561
2574
|
return e;
|
|
2562
|
-
},
|
|
2563
|
-
const { isActionbookTester: e } =
|
|
2564
|
-
return /* @__PURE__ */ r.createElement(_e.Template, { template: e ?
|
|
2565
|
-
},
|
|
2575
|
+
}, Ma = () => {
|
|
2576
|
+
const { isActionbookTester: e } = Fe();
|
|
2577
|
+
return /* @__PURE__ */ r.createElement(_e.Template, { template: e ? Oa : void 0 }, /* @__PURE__ */ r.createElement(_e.MessageLogs, { component: La }));
|
|
2578
|
+
}, Oa = (e) => /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !0, maxBodyWidth: Bn }), La = ({ extendedMessagePayload: e = {} }) => {
|
|
2566
2579
|
const { handlers: t } = P(), { manual: n, groundedness: o, function_calls: i, agent_message_templates: a, is_thinking: s } = e;
|
|
2567
|
-
return s || !n && !(o != null && o.length) && !(i != null && i.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(
|
|
2568
|
-
|
|
2580
|
+
return s || !n && !(o != null && o.length) && !(i != null && i.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(Ra, null, /* @__PURE__ */ r.createElement(Da, { width: 4 }), /* @__PURE__ */ r.createElement(
|
|
2581
|
+
ka,
|
|
2569
2582
|
{
|
|
2570
2583
|
actionbook: n,
|
|
2571
2584
|
functionCalls: i,
|
|
@@ -2577,10 +2590,10 @@ const Be = () => {
|
|
|
2577
2590
|
textColor: h.themedColor.textHighEmphasis,
|
|
2578
2591
|
barColor: h.themedColor.textDisabled
|
|
2579
2592
|
},
|
|
2580
|
-
bottomContent: /* @__PURE__ */ r.createElement(
|
|
2593
|
+
bottomContent: /* @__PURE__ */ r.createElement(Na, { variant: "caption2", color: h.themedColor.textLowEmphasis }, "Only visible in the tester")
|
|
2581
2594
|
}
|
|
2582
2595
|
));
|
|
2583
|
-
},
|
|
2596
|
+
}, Ra = u.div`display:flex;gap:16px;margin:16px ${ie}px 0;align-self:stretch;`, Da = u.div`width:${({ width: e }) => e}px;background-color:${h.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Na = u(k)`margin-top:5px;`, Pa = ({ publishSynchronous: e = !1 }) => {
|
|
2584
2597
|
const t = /* @__PURE__ */ new Set();
|
|
2585
2598
|
return {
|
|
2586
2599
|
publish: (n) => {
|
|
@@ -2591,19 +2604,19 @@ const Be = () => {
|
|
|
2591
2604
|
subscribe: (n) => (t.add(n), () => t.delete(n))
|
|
2592
2605
|
};
|
|
2593
2606
|
};
|
|
2594
|
-
function
|
|
2595
|
-
const n = F(null), o = F(0), i = F(0), [a] =
|
|
2596
|
-
return
|
|
2607
|
+
function Ba(e, t = []) {
|
|
2608
|
+
const n = F(null), o = F(0), i = F(0), [a] = S(() => Pa({ publishSynchronous: !0 })), [s, l] = S(!0);
|
|
2609
|
+
return ce(() => {
|
|
2597
2610
|
o.current = 0, i.current = 0, l(!0), n.current && (n.current.scrollTop = n.current.scrollHeight);
|
|
2598
|
-
}, t),
|
|
2611
|
+
}, t), ce(() => a.subscribe(({ type: c, data: d }) => {
|
|
2599
2612
|
const { resolve: m, animated: g } = d ?? {};
|
|
2600
2613
|
if (!n.current) return m == null ? void 0 : m();
|
|
2601
2614
|
if (c === "scrollToBottom" && (n.current.scroll ? n.current.scroll({
|
|
2602
2615
|
top: n.current.scrollHeight,
|
|
2603
|
-
behavior:
|
|
2616
|
+
behavior: nn(e, g)
|
|
2604
2617
|
}) : n.current.scrollTop = n.current.scrollHeight, i.current = 0, l(!0), m == null || m()), c === "scroll") {
|
|
2605
2618
|
const p = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight: f, clientHeight: E } = n.current;
|
|
2606
|
-
n.current.scroll ? n.current.scroll({ top: p, behavior:
|
|
2619
|
+
n.current.scroll ? n.current.scroll({ top: p, behavior: nn(e, g) }) : typeof p == "number" && (n.current.scrollTop = p), i.current = Math.max(0, f - x - E), l(i.current === 0), m == null || m();
|
|
2607
2620
|
}
|
|
2608
2621
|
}), [e]), {
|
|
2609
2622
|
scrollRef: n,
|
|
@@ -2614,10 +2627,10 @@ function Pa(e, t = []) {
|
|
|
2614
2627
|
scrollPositionRef: o
|
|
2615
2628
|
};
|
|
2616
2629
|
}
|
|
2617
|
-
function
|
|
2630
|
+
function nn(e, t) {
|
|
2618
2631
|
return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
|
|
2619
2632
|
}
|
|
2620
|
-
function
|
|
2633
|
+
function Fa(e) {
|
|
2621
2634
|
return new Promise((t) => {
|
|
2622
2635
|
const n = new Image();
|
|
2623
2636
|
n.onload = function() {
|
|
@@ -2626,23 +2639,23 @@ function Ba(e) {
|
|
|
2626
2639
|
}, n.src = URL.createObjectURL(e);
|
|
2627
2640
|
});
|
|
2628
2641
|
}
|
|
2629
|
-
async function
|
|
2642
|
+
async function Ua(e) {
|
|
2630
2643
|
if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
|
|
2631
|
-
const { width: t, height: n } = await
|
|
2644
|
+
const { width: t, height: n } = await Fa(e.file);
|
|
2632
2645
|
return new Kr({
|
|
2633
|
-
key:
|
|
2646
|
+
key: Jn,
|
|
2634
2647
|
value: [t, n]
|
|
2635
2648
|
});
|
|
2636
2649
|
}
|
|
2637
2650
|
}
|
|
2638
|
-
const
|
|
2651
|
+
const Jn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
2639
2652
|
const { agentPreviewConfigs: t, handlers: n } = P(), o = F(t == null ? void 0 : t.agentAttributes);
|
|
2640
2653
|
return o.current = t == null ? void 0 : t.agentAttributes, {
|
|
2641
2654
|
onBeforeSendMessage: async (i) => {
|
|
2642
|
-
const a = await
|
|
2655
|
+
const a = await Ua(i), s = {
|
|
2643
2656
|
...i,
|
|
2644
2657
|
metaArrays: a ? [a] : void 0
|
|
2645
|
-
}, l =
|
|
2658
|
+
}, l = za(o.current);
|
|
2646
2659
|
return l ? { ...s, data: JSON.stringify(l) } : s;
|
|
2647
2660
|
},
|
|
2648
2661
|
onAfterSendMessage: (i) => {
|
|
@@ -2650,26 +2663,26 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ua = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2650
2663
|
e(), (a = n == null ? void 0 : n.onMessageSend) == null || a.call(n, i.message);
|
|
2651
2664
|
}
|
|
2652
2665
|
};
|
|
2653
|
-
},
|
|
2666
|
+
}, za = (e) => {
|
|
2654
2667
|
if (!e) return null;
|
|
2655
2668
|
const t = {};
|
|
2656
2669
|
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;
|
|
2657
2670
|
}, {
|
|
2658
|
-
Provider:
|
|
2671
|
+
Provider: Va,
|
|
2659
2672
|
useContext: q
|
|
2660
|
-
} = j("Conversation"),
|
|
2673
|
+
} = j("Conversation"), Wa = ({
|
|
2661
2674
|
closedChannelUrl: e,
|
|
2662
2675
|
onClearClosedChannelUrl: t,
|
|
2663
2676
|
onNavigateToConversationList: n,
|
|
2664
2677
|
children: o
|
|
2665
2678
|
}) => {
|
|
2666
|
-
const { aiAgentInfo: i, activeChannel: a, refreshActiveChannel: s } = z(), { testerType: l } =
|
|
2679
|
+
const { aiAgentInfo: i, activeChannel: a, refreshActiveChannel: s } = z(), { testerType: l } = Fe(), c = Ba("smooth"), { onBeforeSendMessage: d, onAfterSendMessage: m } = Ha({
|
|
2667
2680
|
onScrollAfterSendMessage: () => {
|
|
2668
2681
|
c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !1 } });
|
|
2669
2682
|
}
|
|
2670
2683
|
}), g = (x) => {
|
|
2671
2684
|
const f = x[x.length - 1];
|
|
2672
|
-
f &&
|
|
2685
|
+
f && et.shouldScrollToBottom(f, i.userId, !!l) && setTimeout(() => c.scrollPubSub.publish({ type: "scrollToBottom" }), 25);
|
|
2673
2686
|
}, p = U(async () => {
|
|
2674
2687
|
await s(), e && (t == null || t());
|
|
2675
2688
|
}, [s, e, t]);
|
|
@@ -2685,20 +2698,20 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ua = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2685
2698
|
onConversationClosedViaDispatcher: p
|
|
2686
2699
|
},
|
|
2687
2700
|
(x) => /* @__PURE__ */ r.createElement(
|
|
2688
|
-
|
|
2701
|
+
Va,
|
|
2689
2702
|
{
|
|
2690
2703
|
value: { ...x, scrollSource: c, goToActiveConversation: p, onNavigateToConversationList: n }
|
|
2691
2704
|
},
|
|
2692
2705
|
o
|
|
2693
2706
|
)
|
|
2694
2707
|
);
|
|
2695
|
-
},
|
|
2696
|
-
onDrop:
|
|
2697
|
-
subscribe: () =>
|
|
2708
|
+
}, Ot = Te({
|
|
2709
|
+
onDrop: Le,
|
|
2710
|
+
subscribe: () => Le
|
|
2698
2711
|
}), xt = ({ children: e }) => {
|
|
2699
2712
|
const t = F(/* @__PURE__ */ new Set());
|
|
2700
2713
|
return /* @__PURE__ */ r.createElement(
|
|
2701
|
-
|
|
2714
|
+
Ot.Provider,
|
|
2702
2715
|
{
|
|
2703
2716
|
value: {
|
|
2704
2717
|
onDrop: (n) => {
|
|
@@ -2713,129 +2726,108 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ua = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2713
2726
|
},
|
|
2714
2727
|
e
|
|
2715
2728
|
);
|
|
2716
|
-
},
|
|
2717
|
-
const { subscribe: t } =
|
|
2729
|
+
}, Ga = ({ onDropFiles: e }) => {
|
|
2730
|
+
const { subscribe: t } = re(Ot);
|
|
2718
2731
|
D(() => t(e), [e]);
|
|
2719
2732
|
};
|
|
2720
2733
|
xt.Consumer = ({ children: e }) => {
|
|
2721
|
-
const { onDrop: t } =
|
|
2734
|
+
const { onDrop: t } = re(Ot);
|
|
2722
2735
|
return e({ onDrop: t, onDragOver: (i) => i.preventDefault() });
|
|
2723
2736
|
};
|
|
2724
|
-
const
|
|
2725
|
-
loading: w(() => import("./
|
|
2726
|
-
error: w(() => import("./
|
|
2727
|
-
noChannels: w(() => import("./
|
|
2728
|
-
noMessages: w(() => import("./
|
|
2737
|
+
const Jd = ({ iconSize: e = 64, icon: t, className: n, label: o, children: i }) => /* @__PURE__ */ r.createElement(Ka, { className: n }, /* @__PURE__ */ r.createElement(O, { type: t, size: e, color: h.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.themedColor.textMidEmphasis }, o), i), ja = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Ka = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, Za = {
|
|
2738
|
+
loading: w(() => import("./CSENM0Ja.js")),
|
|
2739
|
+
error: w(() => import("./Cj-eLEq_.js")),
|
|
2740
|
+
noChannels: w(() => import("./DnQv_mT2.js")),
|
|
2741
|
+
noMessages: w(() => import("./O53SSRM8.js"))
|
|
2729
2742
|
}, Se = ({ className: e, type: t = "loading", ...n }) => {
|
|
2730
|
-
const o =
|
|
2731
|
-
return /* @__PURE__ */ r.createElement(
|
|
2743
|
+
const o = Za[t];
|
|
2744
|
+
return /* @__PURE__ */ r.createElement(ja, { className: e }, /* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
|
|
2732
2745
|
};
|
|
2733
|
-
function
|
|
2746
|
+
function Ya(e) {
|
|
2734
2747
|
return "sendingStatus" in e ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId);
|
|
2735
2748
|
}
|
|
2736
|
-
const
|
|
2749
|
+
const qa = (e, t, n, o = !0) => {
|
|
2737
2750
|
if (!o || !e.isUserMessage() && !e.isFileMessage())
|
|
2738
2751
|
return "single";
|
|
2739
2752
|
const i = () => {
|
|
2740
2753
|
if (!t || !t.isUserMessage() && !t.isFileMessage()) return !1;
|
|
2741
|
-
const c = t.sender.userId === e.sender.userId, d =
|
|
2754
|
+
const c = t.sender.userId === e.sender.userId, d = Ut(t.createdAt, e.createdAt);
|
|
2742
2755
|
return c && d;
|
|
2743
2756
|
}, a = () => {
|
|
2744
2757
|
if (!n || !n.isUserMessage() && !n.isFileMessage()) return !1;
|
|
2745
|
-
const c = n.sender.userId === e.sender.userId, d =
|
|
2758
|
+
const c = n.sender.userId === e.sender.userId, d = Ut(n.createdAt, e.createdAt);
|
|
2746
2759
|
return c && d;
|
|
2747
2760
|
}, s = i(), l = a();
|
|
2748
2761
|
return s && l ? "middle" : s ? "bottom" : l ? "top" : "single";
|
|
2749
2762
|
};
|
|
2750
|
-
function
|
|
2751
|
-
return e.filter((n) =>
|
|
2763
|
+
function Ja(e, t) {
|
|
2764
|
+
return e.filter((n) => et.isWelcomeMessage(n, t));
|
|
2752
2765
|
}
|
|
2753
|
-
function
|
|
2754
|
-
return
|
|
2766
|
+
function Xn(e, t) {
|
|
2767
|
+
return Xa(e) === t;
|
|
2755
2768
|
}
|
|
2756
|
-
function
|
|
2769
|
+
function Xa(e) {
|
|
2757
2770
|
var t;
|
|
2758
2771
|
if (e)
|
|
2759
2772
|
return e.isUserMessage() || e.isFileMessage() || e.isMultipleFilesMessage() ? e.sender.userId : ((t = e == null ? void 0 : e.sender) == null ? void 0 : t.userId) ?? void 0;
|
|
2760
2773
|
}
|
|
2761
|
-
function
|
|
2774
|
+
function Qa(e) {
|
|
2762
2775
|
return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
|
|
2763
2776
|
}
|
|
2764
|
-
const
|
|
2777
|
+
const rn = (e) => !!e && "sender" in e, Qn = (e) => e.startsWith("image/"), er = (e) => e.startsWith("video/"), on = (e) => Qn(e) || er(e), Ze = {
|
|
2765
2778
|
isAdmin: (e) => e.isAdminMessage(),
|
|
2766
2779
|
isCSAT: (e) => {
|
|
2767
2780
|
var t;
|
|
2768
2781
|
return e.isAdminMessage() && !!((t = e.extendedMessagePayload) != null && t.csat);
|
|
2769
2782
|
},
|
|
2770
|
-
isIncoming: (e, t) =>
|
|
2771
|
-
isOutgoing: (e, t) =>
|
|
2772
|
-
},
|
|
2783
|
+
isIncoming: (e, t) => rn(e) && e.sender.userId !== t,
|
|
2784
|
+
isOutgoing: (e, t) => rn(e) && (e.sender.userId === t || e.sendingStatus === Zr.PENDING)
|
|
2785
|
+
}, tr = ({ rootElementId: e, visible: t, onClose: n, children: o }) => {
|
|
2773
2786
|
if (!t) return null;
|
|
2774
|
-
const { rootElement: i } = P(), a =
|
|
2787
|
+
const { rootElement: i } = P(), a = fe(i), s = fe(i, !0);
|
|
2775
2788
|
return qr(
|
|
2776
|
-
/* @__PURE__ */ r.createElement(
|
|
2777
|
-
a.getElementById(e) ?? a.getElementById(
|
|
2789
|
+
/* @__PURE__ */ r.createElement(el, { onClick: n }, /* @__PURE__ */ r.createElement(tl, { onClick: (l) => l.stopPropagation() }, o)),
|
|
2790
|
+
a.getElementById(e) ?? a.getElementById(oe.MODAL_ROOT) ?? s.body
|
|
2778
2791
|
);
|
|
2779
|
-
},
|
|
2780
|
-
function
|
|
2792
|
+
}, el = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${h.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${be.MODAL};`, tl = u.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:${be.MODAL};`, nl = u.div`flex-shrink:0;width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(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;}`, rl = u(kt)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
|
|
2793
|
+
function nr({ size: e }) {
|
|
2781
2794
|
const { aiAgentInfo: t } = z();
|
|
2782
|
-
return t.profileUrl ? /* @__PURE__ */ r.createElement(
|
|
2795
|
+
return t.profileUrl ? /* @__PURE__ */ r.createElement(At, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(nl, { $size: e }, /* @__PURE__ */ r.createElement(rl, null));
|
|
2783
2796
|
}
|
|
2784
|
-
const
|
|
2785
|
-
const {
|
|
2797
|
+
const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, il = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, sl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, al = u.div`margin-inline-end:8px;`, ll = u.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);}`, cl = u.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;}`, dl = u.div`display:flex;width:160px;justify-content:flex-end;`, ul = u.div`inset-inline-end:0;display:flex;flex-direction:row;`, rr = u.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, ml = u(rr)`border-inline-start:1px solid ${h.themedColor.textDisabled};`, hl = u.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, gl = u.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, pl = u.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, fl = u.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, bl = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
|
|
2798
|
+
const { type: i, url: a, name: s = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: m } = z();
|
|
2786
2799
|
return /* @__PURE__ */ r.createElement(
|
|
2787
|
-
|
|
2800
|
+
El,
|
|
2788
2801
|
{
|
|
2789
|
-
profileUrl:
|
|
2790
|
-
nickname:
|
|
2802
|
+
profileUrl: l ?? "",
|
|
2803
|
+
nickname: c ?? "",
|
|
2791
2804
|
type: i,
|
|
2792
2805
|
url: a,
|
|
2793
2806
|
name: s,
|
|
2794
|
-
onClose:
|
|
2795
|
-
isBotMessage:
|
|
2796
|
-
|
|
2797
|
-
disableDelete: l != null && l.replyCount ? l.replyCount > 0 : !1,
|
|
2798
|
-
onDownloadClick: n
|
|
2807
|
+
onClose: n,
|
|
2808
|
+
isBotMessage: d === m.userId,
|
|
2809
|
+
onDownloadClick: o
|
|
2799
2810
|
}
|
|
2800
2811
|
);
|
|
2801
|
-
},
|
|
2812
|
+
}, xl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(nr, { size: 32 }) : /* @__PURE__ */ r.createElement(At, { size: 32, src: e }), El = ({
|
|
2802
2813
|
profileUrl: e,
|
|
2803
2814
|
isBotMessage: t,
|
|
2804
2815
|
nickname: n,
|
|
2805
2816
|
name: o,
|
|
2806
2817
|
type: i,
|
|
2807
2818
|
url: a,
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
onDelete: c,
|
|
2811
|
-
disableDelete: d,
|
|
2812
|
-
onDownloadClick: m
|
|
2819
|
+
onClose: s,
|
|
2820
|
+
onDownloadClick: l
|
|
2813
2821
|
}) => {
|
|
2814
|
-
const { stringSet:
|
|
2815
|
-
return /* @__PURE__ */ r.createElement(
|
|
2816
|
-
Et,
|
|
2817
|
-
{
|
|
2818
|
-
disabled: d,
|
|
2819
|
-
onClick: () => {
|
|
2820
|
-
d || c();
|
|
2821
|
-
}
|
|
2822
|
-
},
|
|
2823
|
-
/* @__PURE__ */ r.createElement(
|
|
2824
|
-
O,
|
|
2825
|
-
{
|
|
2826
|
-
type: "delete",
|
|
2827
|
-
color: d ? "gray" : h.themedColor.textHighEmphasis,
|
|
2828
|
-
size: 24
|
|
2829
|
-
}
|
|
2830
|
-
)
|
|
2831
|
-
)), /* @__PURE__ */ r.createElement(ul, { onClick: l }, /* @__PURE__ */ r.createElement(O, { type: "close", color: h.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(ml, { onClick: (p) => p.currentTarget === p.target && l() }, tr(i) && /* @__PURE__ */ r.createElement(hl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), er(i) && /* @__PURE__ */ r.createElement(gl, { src: a, alt: o }), !sn(i) && /* @__PURE__ */ r.createElement(pl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, g.FILE_VIEWER__UNSUPPORT)))));
|
|
2822
|
+
const { stringSet: c } = R();
|
|
2823
|
+
return /* @__PURE__ */ r.createElement(tr, { onClose: s, visible: !0, rootElementId: oe.MODAL_ROOT }, /* @__PURE__ */ r.createElement(ol, null, /* @__PURE__ */ r.createElement(il, null, /* @__PURE__ */ r.createElement(sl, null, /* @__PURE__ */ r.createElement(al, null, /* @__PURE__ */ r.createElement(xl, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(ll, null, /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(cl, null, /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(dl, null, on(i) && /* @__PURE__ */ r.createElement(ul, null, /* @__PURE__ */ r.createElement(rr, { as: "a", href: a, target: "_blank", rel: _t, onClick: l }, /* @__PURE__ */ r.createElement(O, { type: "download", color: h.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(ml, { onClick: s }, /* @__PURE__ */ r.createElement(O, { type: "close", color: h.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(hl, { onClick: (d) => d.currentTarget === d.target && s() }, er(i) && /* @__PURE__ */ r.createElement(gl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), Qn(i) && /* @__PURE__ */ r.createElement(pl, { src: a, alt: o }), !on(i) && /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
|
|
2832
2824
|
}, or = ({
|
|
2833
2825
|
className: e,
|
|
2834
2826
|
locale: t,
|
|
2835
2827
|
date: n = Date.now(),
|
|
2836
2828
|
formatString: o = "MMMM dd, yyyy",
|
|
2837
2829
|
style: i
|
|
2838
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
2830
|
+
}) => /* @__PURE__ */ r.createElement(Cl, { style: i, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), Cl = u.div`display:flex;justify-content:center;align-items:center;`, yl = Re(function(t, n) {
|
|
2839
2831
|
const {
|
|
2840
2832
|
messages: o,
|
|
2841
2833
|
renderMessage: i,
|
|
@@ -2845,30 +2837,30 @@ const rl = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2845
2837
|
onLoadPrev: c,
|
|
2846
2838
|
onLoadNext: d,
|
|
2847
2839
|
loadThreshold: m = 0.05,
|
|
2848
|
-
onScrollPosition: g =
|
|
2840
|
+
onScrollPosition: g = Le,
|
|
2849
2841
|
depsForResetScrollPositionToBottom: p,
|
|
2850
2842
|
scrollPositionRef: x,
|
|
2851
2843
|
scrollDistanceFromBottomRef: f,
|
|
2852
2844
|
stackDirection: E = "top"
|
|
2853
|
-
} = t, b = n && "current" in n ? n : { current: null }, C = F(!1), v = F(void 0), T = F(0),
|
|
2854
|
-
|
|
2845
|
+
} = t, b = n && "current" in n ? n : { current: null }, C = F(!1), v = F(void 0), T = F(0), _ = F(0), K = F(0), L = x ?? _, se = f ?? K;
|
|
2846
|
+
ce(() => {
|
|
2855
2847
|
b.current && (b.current.scrollTop = b.current.scrollHeight);
|
|
2856
|
-
}, p),
|
|
2848
|
+
}, p), ce(() => {
|
|
2857
2849
|
b.current && (v.current === "top" && (b.current.scrollTop = b.current.scrollHeight - L.current), v.current === "bottom" && (b.current.scrollTop = T.current), v.current = void 0);
|
|
2858
2850
|
}, [b.current, o.length]);
|
|
2859
2851
|
const xe = async () => {
|
|
2860
2852
|
if (!b.current) return;
|
|
2861
2853
|
const y = b.current;
|
|
2862
|
-
if (g(
|
|
2854
|
+
if (g(vl(y)), L.current = y.scrollHeight - y.scrollTop, se.current = L.current - y.clientHeight, T.current = y.scrollTop, C.current) return;
|
|
2863
2855
|
const B = y.clientHeight * Math.min(Math.max(0, m), 1);
|
|
2864
2856
|
y.scrollTop <= B ? (C.current = !0, v.current = "top", await c(), C.current = !1) : y.scrollHeight - y.scrollTop - y.clientHeight <= B ? (C.current = !0, v.current = "bottom", await d(), C.current = !1) : v.current = void 0;
|
|
2865
2857
|
};
|
|
2866
|
-
return /* @__PURE__ */ r.createElement(
|
|
2867
|
-
}),
|
|
2868
|
-
function
|
|
2869
|
-
return e.scrollTop <=
|
|
2858
|
+
return /* @__PURE__ */ r.createElement(_l, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Sl, { id: "infinite-list-inner", ref: b, onScroll: xe }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((y, B) => i({ message: y, index: B })), s), /* @__PURE__ */ r.createElement(Tl, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(wl, { id: "infinite-list-overlay" }, l)));
|
|
2859
|
+
}), sn = 50;
|
|
2860
|
+
function vl(e) {
|
|
2861
|
+
return e.scrollTop <= sn ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= sn ? "bottom" : "middle";
|
|
2870
2862
|
}
|
|
2871
|
-
const
|
|
2863
|
+
const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${h.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Tl = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, wl = u.div`pointer-events:auto;`, kl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Al, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(O, { size: 24, type: "chevron-down", color: h.color.primary.main })), Al = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);${N.light`
|
|
2872
2864
|
background-color: ${h.color.background50};
|
|
2873
2865
|
&:hover {
|
|
2874
2866
|
background-color: ${h.color.background100};
|
|
@@ -2891,8 +2883,8 @@ const vl = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, _l = u
|
|
|
2891
2883
|
outline: none;
|
|
2892
2884
|
}
|
|
2893
2885
|
`, ir = () => {
|
|
2894
|
-
const { chatSDK: e } = P(), { channelSource: t } = q(), [n, o] =
|
|
2895
|
-
return
|
|
2886
|
+
const { chatSDK: e } = P(), { channelSource: t } = q(), [n, o] = S([]);
|
|
2887
|
+
return yn(e, {
|
|
2896
2888
|
onTypingStatusUpdated(i) {
|
|
2897
2889
|
var a;
|
|
2898
2890
|
if (i.url === ((a = t.channel) == null ? void 0 : a.url)) {
|
|
@@ -2901,13 +2893,13 @@ const vl = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, _l = u
|
|
|
2901
2893
|
}
|
|
2902
2894
|
}
|
|
2903
2895
|
}), n;
|
|
2904
|
-
},
|
|
2905
|
-
const { agentPreviewConfigs: e = {}, aiAgentId: t } = P(), { aiAgentInfo: n } = z(), { stringSet: o, dateLocale: i } = R(), { messageSource: a } = q(), { Template: s } = _e.useContext(), l = e.welcomeMessages ?? [], c = a.messages, d =
|
|
2896
|
+
}, Il = () => {
|
|
2897
|
+
const { agentPreviewConfigs: e = {}, aiAgentId: t } = P(), { aiAgentInfo: n } = z(), { stringSet: o, dateLocale: i } = R(), { messageSource: a } = q(), { Template: s } = _e.useContext(), l = e.welcomeMessages ?? [], c = a.messages, d = Ja(c, t), m = c[d.length + 1], g = d[0] ?? m;
|
|
2906
2898
|
return {
|
|
2907
2899
|
/**
|
|
2908
2900
|
* Returns a list of messages filtered according to business requirements.
|
|
2909
2901
|
*/
|
|
2910
|
-
filteredMessages: c.filter((p) =>
|
|
2902
|
+
filteredMessages: c.filter((p) => Qa(p) ? !1 : l.length > 0 ? !et.isWelcomeMessage(p, t) : !0),
|
|
2911
2903
|
/**
|
|
2912
2904
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
2913
2905
|
*/
|
|
@@ -2944,37 +2936,37 @@ const vl = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, _l = u
|
|
|
2944
2936
|
);
|
|
2945
2937
|
}))
|
|
2946
2938
|
};
|
|
2947
|
-
},
|
|
2948
|
-
function
|
|
2939
|
+
}, $l = (e) => u(e).withConfig({ shouldForwardProp: Jr });
|
|
2940
|
+
function Ml(e) {
|
|
2949
2941
|
var o;
|
|
2950
2942
|
const t = "remove_powered_by", n = (o = e == null ? void 0 : e.appInfo) == null ? void 0 : o.applicationAttributes;
|
|
2951
2943
|
return Array.isArray(n) && n.includes(t);
|
|
2952
2944
|
}
|
|
2953
|
-
const
|
|
2954
|
-
const { stringSet: t } = R(), { chatSDK: n } = P(), { isActionbookTester: o } =
|
|
2955
|
-
return
|
|
2956
|
-
|
|
2945
|
+
const Ol = ({ style: e }) => {
|
|
2946
|
+
const { stringSet: t } = R(), { chatSDK: n } = P(), { isActionbookTester: o } = Fe();
|
|
2947
|
+
return Ml(n) || o ? null : /* @__PURE__ */ r.createElement(Ll, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
|
|
2948
|
+
Rl,
|
|
2957
2949
|
{
|
|
2958
2950
|
variant: "caption2",
|
|
2959
2951
|
as: "a",
|
|
2960
2952
|
href: "https://sendbird.com?utm_medium=product&utm_source=aiagent&utm_campaign=fy26-glbl-ai-agent-poweredby",
|
|
2961
2953
|
"aria-label": "Learn more about Sendbird",
|
|
2962
|
-
rel:
|
|
2954
|
+
rel: _t,
|
|
2963
2955
|
target: "_blank"
|
|
2964
2956
|
},
|
|
2965
2957
|
"Sendbird"
|
|
2966
2958
|
));
|
|
2967
|
-
},
|
|
2959
|
+
}, Ll = u(k)`color:${h.themedColor.textLowEmphasis};text-align:center;`, Rl = $l(k)`
|
|
2968
2960
|
color: ${h.themedColor.textLowEmphasis};
|
|
2969
2961
|
cursor: pointer;
|
|
2970
2962
|
text-decoration: none;
|
|
2971
|
-
`,
|
|
2963
|
+
`, Dl = () => {
|
|
2972
2964
|
var c;
|
|
2973
|
-
const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = q(), a =
|
|
2974
|
-
return
|
|
2965
|
+
const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = q(), a = Vn(n.channel), l = t && ((c = n.channel) == null ? void 0 : c.url) === (t == null ? void 0 : t.url) && a;
|
|
2966
|
+
return ce(() => {
|
|
2975
2967
|
l && i.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
2976
|
-
}, [l]), l ? /* @__PURE__ */ r.createElement(
|
|
2977
|
-
|
|
2968
|
+
}, [l]), l ? /* @__PURE__ */ r.createElement(Nl, null, /* @__PURE__ */ r.createElement(
|
|
2969
|
+
Pl,
|
|
2978
2970
|
{
|
|
2979
2971
|
variant: "button",
|
|
2980
2972
|
role: "button",
|
|
@@ -2983,17 +2975,17 @@ const Ml = ({ style: e }) => {
|
|
|
2983
2975
|
},
|
|
2984
2976
|
e.START_NEW_CONVERSATION
|
|
2985
2977
|
)) : null;
|
|
2986
|
-
},
|
|
2987
|
-
const { Template: e } =
|
|
2988
|
-
const y =
|
|
2978
|
+
}, Nl = u.div`display:flex;justify-content:center;margin:16px 0;`, Pl = u(k)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${h.themedColor.textDisabled};cursor:pointer;user-select:none;`, Bl = !0, Fl = () => {
|
|
2979
|
+
const { Template: e } = $t.useContext(), { Template: t } = _e.useContext(), { Template: n } = Mt.useContext(), [o, i] = S(null), { userSession: a, aiAgentInfo: s } = z(), { agentPreviewConfigs: l, chatSDK: c, state: d } = P(), { stringSet: m, dateLocale: g } = R(), { conversation: p, channelSource: x, messageSource: f, scrollSource: E } = q(), { isActionbookTester: b } = Fe(), { filteredMessages: C, shouldShowOriginalDate: v, renderAgentPreviewWelcomeMessages: T } = Il(), { storage: _ } = $n(), K = ir(), L = It(() => {
|
|
2980
|
+
const y = K[0];
|
|
2989
2981
|
if (!y) return null;
|
|
2990
2982
|
const B = y.userId === s.userId;
|
|
2991
2983
|
return { user: B ? s : y, isBot: B };
|
|
2992
2984
|
});
|
|
2993
2985
|
D(() => {
|
|
2994
|
-
|
|
2995
|
-
}, [!!L, E]);
|
|
2996
|
-
const
|
|
2986
|
+
L && E.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
2987
|
+
}, [!!L, E.scrollPubSub.publish]);
|
|
2988
|
+
const se = (y, B = !1) => {
|
|
2997
2989
|
var Ee;
|
|
2998
2990
|
return B ? s : ((Ee = x.channel) == null ? void 0 : Ee.members.find((J) => J.userId === y.sender.userId)) ?? y.sender;
|
|
2999
2991
|
}, xe = () => {
|
|
@@ -3004,7 +2996,7 @@ const Ml = ({ style: e }) => {
|
|
|
3004
2996
|
return y ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, y) : /* @__PURE__ */ r.createElement(Se, { type: "noMessages", label: m.PLACE_HOLDER__NO_MESSAGES });
|
|
3005
2997
|
}
|
|
3006
2998
|
return /* @__PURE__ */ r.createElement(
|
|
3007
|
-
|
|
2999
|
+
yl,
|
|
3008
3000
|
{
|
|
3009
3001
|
ref: E.scrollRef,
|
|
3010
3002
|
scrollPositionRef: E.scrollPositionRef,
|
|
@@ -3015,7 +3007,7 @@ const Ml = ({ style: e }) => {
|
|
|
3015
3007
|
onLoadPrev: f.loadPrevious,
|
|
3016
3008
|
onLoadNext: f.loadNext,
|
|
3017
3009
|
depsForResetScrollPositionToBottom: [f.initialized, f.messages.length !== 0],
|
|
3018
|
-
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
3010
|
+
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ol, { style: { marginTop: 16 } }), T()),
|
|
3019
3011
|
messageBottomArea: /* @__PURE__ */ r.createElement(r.Fragment, null, L && /* @__PURE__ */ r.createElement(
|
|
3020
3012
|
t,
|
|
3021
3013
|
{
|
|
@@ -3026,13 +3018,13 @@ const Ml = ({ style: e }) => {
|
|
|
3026
3018
|
groupType: "single",
|
|
3027
3019
|
message: ""
|
|
3028
3020
|
}
|
|
3029
|
-
), /* @__PURE__ */ r.createElement(
|
|
3030
|
-
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !E.isScrollBottomReached && /* @__PURE__ */ r.createElement(
|
|
3021
|
+
), /* @__PURE__ */ r.createElement(Dl, null)),
|
|
3022
|
+
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !E.isScrollBottomReached && /* @__PURE__ */ r.createElement(Hl, { onClick: () => E.scrollPubSub.publish({ type: "scrollToBottom" }) })),
|
|
3031
3023
|
renderMessage: ({ message: y, index: B }) => {
|
|
3032
|
-
const Ee =
|
|
3033
|
-
y.isFileMessage() && i(y);
|
|
3024
|
+
const Ee = Ya(y), J = C[B - 1], Ae = C[B + 1], it = C[C.length - 1], st = y === it, A = qa(y, J, Ae, Bl), I = !Yr((J == null ? void 0 : J.createdAt) ?? 0, y.createdAt) && v(B) && !b, M = (X) => {
|
|
3025
|
+
(y.isFileMessage() || y.isUserMessage()) && i({ file: X, sender: se(y, y.sender.userId === s.userId) });
|
|
3034
3026
|
}, H = () => {
|
|
3035
|
-
y.isFileMessage() &&
|
|
3027
|
+
y.isFileMessage() && zn(y.url);
|
|
3036
3028
|
}, Ce = I ? /* @__PURE__ */ r.createElement(
|
|
3037
3029
|
or,
|
|
3038
3030
|
{
|
|
@@ -3041,128 +3033,128 @@ const Ml = ({ style: e }) => {
|
|
|
3041
3033
|
locale: g,
|
|
3042
3034
|
formatString: m.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
3043
3035
|
}
|
|
3044
|
-
) : null,
|
|
3045
|
-
maxBodyWidth: d.expanded ?
|
|
3036
|
+
) : null, ae = {
|
|
3037
|
+
maxBodyWidth: d.expanded ? Bn : void 0,
|
|
3046
3038
|
extendedMessagePayload: y.extendedMessagePayload,
|
|
3047
3039
|
createdAt: y.createdAt,
|
|
3048
3040
|
groupType: A,
|
|
3049
3041
|
onClickMedia: M,
|
|
3050
3042
|
onClickFile: H
|
|
3051
|
-
},
|
|
3052
|
-
var
|
|
3053
|
-
if (
|
|
3054
|
-
return
|
|
3043
|
+
}, Z = (() => {
|
|
3044
|
+
var X, ee;
|
|
3045
|
+
if (Ze.isAdmin(y))
|
|
3046
|
+
return Ze.isCSAT(y) ? p ? /* @__PURE__ */ r.createElement(
|
|
3055
3047
|
n,
|
|
3056
3048
|
{
|
|
3057
|
-
...
|
|
3049
|
+
...ae,
|
|
3058
3050
|
...p,
|
|
3059
|
-
isResolvedWhenDeterminedByUser:
|
|
3051
|
+
isResolvedWhenDeterminedByUser: zl(p),
|
|
3060
3052
|
messageType: "admin.csat",
|
|
3061
|
-
onSubmitCSAT: ({ csat: G, csatType:
|
|
3062
|
-
var
|
|
3063
|
-
G && ((
|
|
3053
|
+
onSubmitCSAT: ({ csat: G, csatType: he, csatReason: V, isResolved: le }) => {
|
|
3054
|
+
var ge;
|
|
3055
|
+
G && ((ge = x.channel) == null || ge.submitCSAT({ csat: G, csatType: he, csatReason: V, isResolved: le }));
|
|
3064
3056
|
}
|
|
3065
3057
|
}
|
|
3066
|
-
) : null : /* @__PURE__ */ r.createElement(n, { ...
|
|
3067
|
-
if (
|
|
3058
|
+
) : null : /* @__PURE__ */ r.createElement(n, { ...ae, messageType: "admin", message: y.message });
|
|
3059
|
+
if (Ze.isOutgoing(y, a.userId)) {
|
|
3068
3060
|
const G = {
|
|
3069
|
-
...
|
|
3061
|
+
...ae,
|
|
3070
3062
|
message: y.message,
|
|
3071
|
-
sender:
|
|
3063
|
+
sender: se(y),
|
|
3072
3064
|
sendingStatus: y.sendingStatus
|
|
3073
3065
|
};
|
|
3074
3066
|
if (y.isUserMessage())
|
|
3075
3067
|
return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...G });
|
|
3076
3068
|
if (y.isFileMessage()) {
|
|
3077
|
-
const [
|
|
3069
|
+
const [he, V] = ((X = y.metaArrays.find((le) => le.key === Jn)) == null ? void 0 : X.value) ?? [];
|
|
3078
3070
|
return /* @__PURE__ */ r.createElement(
|
|
3079
3071
|
e,
|
|
3080
3072
|
{
|
|
3081
3073
|
messageType: "file",
|
|
3082
3074
|
file: y,
|
|
3083
3075
|
metadata: {
|
|
3084
|
-
aspectRatio:
|
|
3085
|
-
localFile: (
|
|
3076
|
+
aspectRatio: he && V ? `${he}/${V}` : "1/1",
|
|
3077
|
+
localFile: (ee = y.messageParams) == null ? void 0 : ee.file
|
|
3086
3078
|
},
|
|
3087
3079
|
...G
|
|
3088
3080
|
}
|
|
3089
3081
|
);
|
|
3090
3082
|
}
|
|
3091
3083
|
}
|
|
3092
|
-
if (
|
|
3093
|
-
const G = y.sender.userId === s.userId,
|
|
3094
|
-
...
|
|
3095
|
-
sender:
|
|
3084
|
+
if (Ze.isIncoming(y, a.userId)) {
|
|
3085
|
+
const G = y.sender.userId === s.userId, he = {
|
|
3086
|
+
...ae,
|
|
3087
|
+
sender: se(y, G),
|
|
3096
3088
|
message: y.message,
|
|
3097
|
-
suggestedRepliesVisible:
|
|
3089
|
+
suggestedRepliesVisible: st,
|
|
3098
3090
|
suggestedRepliesDirection: l == null ? void 0 : l.suggestedRepliesDirection,
|
|
3099
3091
|
isBotMessage: G,
|
|
3100
3092
|
onClickSuggestedReply: async ({ reply: V }) => {
|
|
3101
3093
|
f.sendUserMessage({ message: V });
|
|
3102
3094
|
},
|
|
3103
3095
|
onRequestMessageTemplate: async (V) => {
|
|
3104
|
-
const { template:
|
|
3105
|
-
return
|
|
3096
|
+
const { template: le } = await c.aiAgent.getMessageTemplate(V);
|
|
3097
|
+
return _.setTemplate(V, le), le;
|
|
3106
3098
|
},
|
|
3107
|
-
onGetCachedMessageTemplate: (V) =>
|
|
3099
|
+
onGetCachedMessageTemplate: (V) => _.getTemplate(V),
|
|
3108
3100
|
onHandleTemplateInternalAction: (V) => {
|
|
3109
3101
|
if (V.type === "internal" && V.internalData) {
|
|
3110
|
-
const { method:
|
|
3111
|
-
|
|
3102
|
+
const { method: le, payload: ge } = V.internalData;
|
|
3103
|
+
le === "message.send" && (ge != null && ge.message) && f.sendUserMessage({ message: ge.message });
|
|
3112
3104
|
}
|
|
3113
3105
|
}
|
|
3114
3106
|
};
|
|
3115
3107
|
if (y.isUserMessage())
|
|
3116
|
-
return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...
|
|
3108
|
+
return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...he });
|
|
3117
3109
|
if (y.isFileMessage())
|
|
3118
|
-
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: y, ...
|
|
3110
|
+
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: y, ...he });
|
|
3119
3111
|
}
|
|
3120
3112
|
})();
|
|
3121
|
-
return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${
|
|
3113
|
+
return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${Q}-message-item` }, Ce, Z);
|
|
3122
3114
|
}
|
|
3123
3115
|
}
|
|
3124
3116
|
);
|
|
3125
3117
|
};
|
|
3126
|
-
return /* @__PURE__ */ r.createElement(
|
|
3127
|
-
},
|
|
3128
|
-
function
|
|
3118
|
+
return /* @__PURE__ */ r.createElement(Ul, { id: `${Q}-message-list` }, xe(), o && /* @__PURE__ */ r.createElement(bl, { onClose: () => i(null), sender: o.sender, file: o.file }));
|
|
3119
|
+
}, Ul = u.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Hl = u(kl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
|
|
3120
|
+
function zl(e) {
|
|
3129
3121
|
var t;
|
|
3130
3122
|
if (((t = e == null ? void 0 : e.resolution) == null ? void 0 : t.determinedBy) === "user")
|
|
3131
3123
|
return e.resolution.isResolved;
|
|
3132
3124
|
}
|
|
3133
|
-
const
|
|
3125
|
+
const Vl = () => {
|
|
3134
3126
|
const { stringSet: e } = R(), { connectionError: t } = z(), { channelSource: n } = q(), o = t || n.error;
|
|
3135
3127
|
if (o) {
|
|
3136
3128
|
const i = t ? void 0 : { label: e.RETRY, onClick: () => n.refetch() };
|
|
3137
3129
|
return /* @__PURE__ */ r.createElement(Se, { type: "error", label: o.message, action: i });
|
|
3138
3130
|
}
|
|
3139
|
-
return n.channel ? /* @__PURE__ */ r.createElement(
|
|
3131
|
+
return n.channel ? /* @__PURE__ */ r.createElement(Fl, null) : /* @__PURE__ */ r.createElement(Se, { type: "loading" });
|
|
3140
3132
|
}, sr = () => {
|
|
3141
|
-
const { stringSet: e } = R(), { activeChannel: t } = z(), [n] =
|
|
3133
|
+
const { stringSet: e } = R(), { activeChannel: t } = z(), [n] = S(() => (t == null ? void 0 : t.status) === W.OPEN);
|
|
3142
3134
|
return n ? e.RETURN_TO_CONVERSATION : e.START_NEW_CONVERSATION;
|
|
3143
|
-
},
|
|
3135
|
+
}, Wl = () => {
|
|
3144
3136
|
const { stringSet: e } = R(), { goToActiveConversation: t } = q(), n = sr();
|
|
3145
|
-
return /* @__PURE__ */ r.createElement(
|
|
3146
|
-
},
|
|
3137
|
+
return /* @__PURE__ */ r.createElement(Gl, null, /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.themedColor.textMidEmphasis }, e.CONVERSATION_CLOSED_FOOTER_LABEL), /* @__PURE__ */ r.createElement(jl, { onClick: t }, /* @__PURE__ */ r.createElement(k, { variant: "button", color: h.themedColor.textHighEmphasis }, n)));
|
|
3138
|
+
}, Gl = u.div`display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 0;gap:14px;${N.light`
|
|
3147
3139
|
background-color: ${h.color.background100};
|
|
3148
3140
|
`}
|
|
3149
3141
|
${N.dark`
|
|
3150
3142
|
background-color: ${h.color.background500};
|
|
3151
3143
|
`}
|
|
3152
|
-
`,
|
|
3144
|
+
`, jl = u.button`all:unset;padding:10px 20px;border-radius:6px;border:1px solid ${h.themedColor.textDisabled};cursor:pointer;${N.light`
|
|
3153
3145
|
background-color: ${h.color.background50};
|
|
3154
3146
|
`}
|
|
3155
3147
|
${N.dark`
|
|
3156
3148
|
background-color: ${h.color.background700};
|
|
3157
3149
|
`}
|
|
3158
|
-
`, ar = Te(void 0),
|
|
3159
|
-
const { stringSet: t } = R(), { aiAgentInfo: n } = z(), { channelSource: o } = q(), [i, a] =
|
|
3150
|
+
`, ar = Te(void 0), Kl = ({ children: e }) => {
|
|
3151
|
+
const { stringSet: t } = R(), { aiAgentInfo: n } = z(), { channelSource: o } = q(), [i, a] = S([]), [s, l] = S({
|
|
3160
3152
|
visible: !1,
|
|
3161
3153
|
title: "",
|
|
3162
3154
|
buttonText: t.BUTTON__OK
|
|
3163
|
-
}), c = (n == null ? void 0 : n.replyToFile) ||
|
|
3155
|
+
}), c = (n == null ? void 0 : n.replyToFile) || Gn(o.channel), d = (p) => {
|
|
3164
3156
|
if (!c) return;
|
|
3165
|
-
const x = p.filter((f) =>
|
|
3157
|
+
const x = p.filter((f) => Dn.includes(f.type));
|
|
3166
3158
|
if (x.length !== 0) {
|
|
3167
3159
|
if (x.some((f) => f.size > mi)) {
|
|
3168
3160
|
l((f) => ({
|
|
@@ -3209,27 +3201,27 @@ const zl = () => {
|
|
|
3209
3201
|
}
|
|
3210
3202
|
},
|
|
3211
3203
|
e,
|
|
3212
|
-
/* @__PURE__ */ r.createElement(
|
|
3204
|
+
/* @__PURE__ */ r.createElement(Zl, { ...s, onClose: () => l((p) => ({ ...p, visible: !1, title: "" })) })
|
|
3213
3205
|
);
|
|
3214
|
-
},
|
|
3215
|
-
const e =
|
|
3206
|
+
}, Lt = () => {
|
|
3207
|
+
const e = re(ar);
|
|
3216
3208
|
if (!e)
|
|
3217
3209
|
throw new Error("useFileUpload must be used within FileUploadProvider");
|
|
3218
3210
|
return e;
|
|
3219
|
-
},
|
|
3211
|
+
}, Zl = ({
|
|
3220
3212
|
title: e,
|
|
3221
3213
|
buttonText: t,
|
|
3222
3214
|
visible: n,
|
|
3223
3215
|
onClose: o
|
|
3224
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
3225
|
-
function
|
|
3216
|
+
}) => /* @__PURE__ */ r.createElement(tr, { rootElementId: oe.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(Yl, null, /* @__PURE__ */ r.createElement(Jl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(ql, null, /* @__PURE__ */ r.createElement(Xl, { onClick: o }, /* @__PURE__ */ r.createElement(k, { variant: "button", color: h.themedColor.textHighEmphasisInverse }, t))))), Yl = u.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};`, ql = u.div`display:flex;flex-direction:row;justify-content:flex-end;`, Jl = u.div`margin-bottom:16px;`, Xl = u.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${h.themedColor.error};border:1px solid ${h.themedColor.error};padding:10px 16px;&:hover{background-color:${h.color.error.dark};border-color:${h.color.error.dark};}&:active{background-color:${h.color.error.extraDark};}`;
|
|
3217
|
+
function Ql({ blurred: e, elementRef: t, document: n = window.document }) {
|
|
3226
3218
|
const o = F(!1);
|
|
3227
|
-
e && t.current && n.activeElement === t.current && (o.current = !0),
|
|
3219
|
+
e && t.current && n.activeElement === t.current && (o.current = !0), ce(() => {
|
|
3228
3220
|
var i;
|
|
3229
3221
|
!e && o.current && ((i = t.current) == null || i.focus(), o.current = !1);
|
|
3230
3222
|
}, [e]);
|
|
3231
3223
|
}
|
|
3232
|
-
const
|
|
3224
|
+
const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, tc = u.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;}`, nc = u.div`display:flex;align-items:center;justify-content:center;position:absolute;inset-inline-end:-8px;inset-block-start:-8px;cursor:pointer;border-radius:50%;${N.light`
|
|
3233
3225
|
background-color: ${h.color.background50};
|
|
3234
3226
|
`}
|
|
3235
3227
|
${N.dark`
|
|
@@ -3248,19 +3240,19 @@ const Ql = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3248
3240
|
circle {
|
|
3249
3241
|
stroke: ${h.themedColor.bg_50_600};
|
|
3250
3242
|
}
|
|
3251
|
-
`,
|
|
3252
|
-
const e =
|
|
3253
|
-
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(
|
|
3254
|
-
},
|
|
3255
|
-
const { stringSet: n } = R(), { aiAgentInfo: o } = z(), i =
|
|
3243
|
+
`, rc = () => {
|
|
3244
|
+
const e = Pe(), [t, n] = S(), { files: o, removeFile: i, isFileUploadEnabled: a } = Lt();
|
|
3245
|
+
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(ec, null, o.map(({ preview: { type: s, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(tc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(nc, { title: "Remove file", onClick: () => i(d) }, /* @__PURE__ */ r.createElement(O, { type: "close-filled", color: h.themedColor.textMidEmphasis })), s.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(wt, { name: l, type: Tt(l, s) }))));
|
|
3246
|
+
}, oc = ({ channel: e, messages: t }) => {
|
|
3247
|
+
const { stringSet: n } = R(), { aiAgentInfo: o } = z(), i = ic(), a = sc({
|
|
3256
3248
|
lastMessage: t[t.length - 1],
|
|
3257
3249
|
aiAgentUserId: o.userId
|
|
3258
3250
|
});
|
|
3259
|
-
return !e || !i ||
|
|
3260
|
-
},
|
|
3261
|
-
const e =
|
|
3251
|
+
return !e || !i || Vn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : a ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, n.MESSAGE_INPUT__PLACE_HOLDER];
|
|
3252
|
+
}, ic = () => {
|
|
3253
|
+
const e = bn(), { chatSDK: t } = P(), [n, o] = S(!0);
|
|
3262
3254
|
return D(() => {
|
|
3263
|
-
const i = new
|
|
3255
|
+
const i = new Qe({
|
|
3264
3256
|
onDisconnected: () => o(!1),
|
|
3265
3257
|
onConnected: () => o(!0),
|
|
3266
3258
|
onReconnectSucceeded: () => o(!0)
|
|
@@ -3269,23 +3261,23 @@ const Ql = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3269
3261
|
t.removeConnectionHandler(e);
|
|
3270
3262
|
};
|
|
3271
3263
|
}, [t]), n;
|
|
3272
|
-
},
|
|
3264
|
+
}, sc = ({
|
|
3273
3265
|
lastMessage: e,
|
|
3274
3266
|
aiAgentUserId: t
|
|
3275
3267
|
}) => {
|
|
3276
|
-
const [n, o] =
|
|
3268
|
+
const [n, o] = S(!1), i = ir();
|
|
3277
3269
|
return D(() => {
|
|
3278
3270
|
if (!e) return;
|
|
3279
|
-
const a = i.some((l) => l.userId === t), s =
|
|
3271
|
+
const a = i.some((l) => l.userId === t), s = Xn(e, t) && et.isStreaming(e);
|
|
3280
3272
|
o(!!(s || a));
|
|
3281
3273
|
}, [i, e, t]), n;
|
|
3282
3274
|
}, lr = {
|
|
3283
3275
|
textArea: $`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
|
|
3284
3276
|
attachIcon: $`margin-bottom:4px;`
|
|
3285
|
-
}, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`,
|
|
3286
|
-
const t = F(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } =
|
|
3277
|
+
}, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, ac = u(cr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${h.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${h.themedColor.bg_200_400};}}${vt && lr.attachIcon};`, lc = u.input`display:none;`, an = u.div`width:100%;position:relative;background-color:${h.themedColor.bg_100_500};border-radius:20px;`, ln = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, cn = u.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:${h.themedColor.textHighEmphasis};resize:none;width:100%;height:${Rn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${vt && lr.textArea};&::placeholder{color:${h.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${h.themedColor.textDisabled};}}`, dn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, un = ({ disabled: e }) => {
|
|
3278
|
+
const t = F(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } = Lt();
|
|
3287
3279
|
return !a || i.length > 0 ? null : /* @__PURE__ */ r.createElement(
|
|
3288
|
-
|
|
3280
|
+
ac,
|
|
3289
3281
|
{
|
|
3290
3282
|
disabled: e,
|
|
3291
3283
|
onClick: () => {
|
|
@@ -3302,7 +3294,7 @@ const Ql = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3302
3294
|
}
|
|
3303
3295
|
),
|
|
3304
3296
|
/* @__PURE__ */ r.createElement(
|
|
3305
|
-
|
|
3297
|
+
lc,
|
|
3306
3298
|
{
|
|
3307
3299
|
type: "file",
|
|
3308
3300
|
ref: t,
|
|
@@ -3310,43 +3302,43 @@ const Ql = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3310
3302
|
const l = s.currentTarget.files;
|
|
3311
3303
|
l && n(Array.from(l)), s.target.value = "";
|
|
3312
3304
|
},
|
|
3313
|
-
accept:
|
|
3305
|
+
accept: Dn.join(",")
|
|
3314
3306
|
}
|
|
3315
3307
|
)
|
|
3316
3308
|
);
|
|
3317
|
-
},
|
|
3318
|
-
const e = F(null), [t, n] =
|
|
3309
|
+
}, cc = () => {
|
|
3310
|
+
const e = F(null), [t, n] = S(""), { rootElement: o } = P(), { channelSource: i, messageSource: a } = q(), [s, l] = oc({
|
|
3319
3311
|
channel: i.channel,
|
|
3320
3312
|
messages: a.messages
|
|
3321
|
-
}), { files: c, addFiles: d, clearFiles: m } =
|
|
3322
|
-
|
|
3313
|
+
}), { files: c, addFiles: d, clearFiles: m } = Lt();
|
|
3314
|
+
Ga({ onDropFiles: d }), Ql({ blurred: s, elementRef: e, document: fe(o) });
|
|
3323
3315
|
const g = t.trim().length > 0, p = c.length > 0, x = !s && (g || p), f = () => {
|
|
3324
3316
|
e.current && (e.current.value = "", e.current.style.height = ""), m(), n("");
|
|
3325
3317
|
}, E = async () => {
|
|
3326
|
-
const T = t.trim(),
|
|
3318
|
+
const T = t.trim(), _ = { message: T };
|
|
3327
3319
|
if (!(!T && !c.length)) {
|
|
3328
3320
|
if (c.length > 0) {
|
|
3329
|
-
const
|
|
3321
|
+
const K = c[0].file, L = { ..._, file: K };
|
|
3330
3322
|
a.sendFileMessage(L), f();
|
|
3331
3323
|
return;
|
|
3332
3324
|
}
|
|
3333
|
-
a.sendUserMessage(
|
|
3325
|
+
a.sendUserMessage(_), f();
|
|
3334
3326
|
}
|
|
3335
3327
|
}, b = (T) => {
|
|
3336
|
-
const
|
|
3337
|
-
|
|
3328
|
+
const _ = Array.from(T.clipboardData.files);
|
|
3329
|
+
_.length > 0 && (T.preventDefault(), d(_));
|
|
3338
3330
|
}, C = (T) => {
|
|
3339
3331
|
T.key !== "Enter" || T.nativeEvent.isComposing || T.shiftKey || (T.preventDefault(), E());
|
|
3340
3332
|
}, v = (T) => {
|
|
3341
3333
|
if (e.current) {
|
|
3342
3334
|
e.current.style.height = "";
|
|
3343
|
-
const
|
|
3344
|
-
|
|
3335
|
+
const _ = Math.min(ui, e.current.scrollHeight);
|
|
3336
|
+
Rn < _ && (e.current.style.height = `${_}px`);
|
|
3345
3337
|
}
|
|
3346
3338
|
n(T.target.value);
|
|
3347
3339
|
};
|
|
3348
|
-
return s ? /* @__PURE__ */ r.createElement(
|
|
3349
|
-
|
|
3340
|
+
return s ? /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(ln, null, /* @__PURE__ */ r.createElement(cn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(un, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(rc, null), /* @__PURE__ */ r.createElement(ln, null, /* @__PURE__ */ r.createElement(
|
|
3341
|
+
cn,
|
|
3350
3342
|
{
|
|
3351
3343
|
ref: e,
|
|
3352
3344
|
role: "textbox",
|
|
@@ -3357,24 +3349,24 @@ const Ql = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3357
3349
|
onChange: v,
|
|
3358
3350
|
onPaste: b
|
|
3359
3351
|
}
|
|
3360
|
-
), /* @__PURE__ */ r.createElement(
|
|
3361
|
-
},
|
|
3352
|
+
), /* @__PURE__ */ r.createElement(un, null))), x && /* @__PURE__ */ r.createElement(cr, { onClick: () => E() }, /* @__PURE__ */ r.createElement(O, { type: "send", color: h.color.primary.main, size: 20 })));
|
|
3353
|
+
}, dc = u.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:${h.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${N.light`
|
|
3362
3354
|
color: ${h.color.information.light};
|
|
3363
3355
|
`};
|
|
3364
3356
|
${N.dark`
|
|
3365
3357
|
color: ${h.color.information.main};
|
|
3366
3358
|
`};
|
|
3367
3359
|
}
|
|
3368
|
-
`,
|
|
3360
|
+
`, uc = w(() => import("./CDvzufwm.js").then((e) => ({ default: e.MarkdownText }))), mc = () => {
|
|
3369
3361
|
const { aiAgentInfo: e } = z(), { messageSource: t } = q(), { userSession: n } = z();
|
|
3370
|
-
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) =>
|
|
3371
|
-
},
|
|
3362
|
+
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) => Xn(i, n.userId))) ? null : /* @__PURE__ */ r.createElement(dc, null, /* @__PURE__ */ r.createElement(uc, null, e.specialNotice));
|
|
3363
|
+
}, hc = () => /* @__PURE__ */ r.createElement(gc, null, /* @__PURE__ */ r.createElement(mc, null), /* @__PURE__ */ r.createElement(Kl, null, /* @__PURE__ */ r.createElement(cc, null))), gc = u.div`z-index:0;border:none;width:100%;`, pc = () => {
|
|
3372
3364
|
var a, s, l;
|
|
3373
3365
|
const { activeChannel: e } = z(), { channelSource: t } = q(), n = ((s = (a = t.channel) == null ? void 0 : a.conversation) == null ? void 0 : s.status) === W.CLOSED;
|
|
3374
|
-
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(
|
|
3375
|
-
},
|
|
3366
|
+
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Wl, null) : /* @__PURE__ */ r.createElement(hc, null);
|
|
3367
|
+
}, fc = () => {
|
|
3376
3368
|
var v;
|
|
3377
|
-
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = P(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = q(), m = c.channel, p =
|
|
3369
|
+
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = P(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = q(), m = c.channel, p = Pe() ? 24 : 16, x = () => {
|
|
3378
3370
|
e.setOpened(!1);
|
|
3379
3371
|
}, f = async () => {
|
|
3380
3372
|
try {
|
|
@@ -3386,104 +3378,104 @@ const Ql = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3386
3378
|
}, E = async () => {
|
|
3387
3379
|
m && await i.send(ao.CloseConversation({ channelUrl: m.url }));
|
|
3388
3380
|
}, b = l && (m == null ? void 0 : m.url) === l.url, C = s.showHandoffButton && !!((v = m == null ? void 0 : m.conversation) != null && v.handoff) && b;
|
|
3389
|
-
return /* @__PURE__ */ r.createElement(
|
|
3390
|
-
|
|
3381
|
+
return /* @__PURE__ */ r.createElement(yc, null, /* @__PURE__ */ r.createElement(vc, null, d && /* @__PURE__ */ r.createElement(Ue, { onClick: () => d() }, /* @__PURE__ */ r.createElement(O, { type: "menu", size: 24, color: h.themedColor.textHighEmphasis })), b && /* @__PURE__ */ r.createElement(nr, { size: 34 }), /* @__PURE__ */ r.createElement(Sc, { variant: "h2", color: h.themedColor.textHighEmphasis }, s.nickname || (m == null ? void 0 : m.name))), /* @__PURE__ */ r.createElement(_c, null, C && /* @__PURE__ */ r.createElement(
|
|
3382
|
+
Cc,
|
|
3391
3383
|
{
|
|
3392
3384
|
tooltipLabel: a.HEADER_BUTTON__AGENT_HANDOFF,
|
|
3393
|
-
disabled: !
|
|
3385
|
+
disabled: !os(m),
|
|
3394
3386
|
size: p,
|
|
3395
3387
|
onClick: f
|
|
3396
3388
|
}
|
|
3397
3389
|
), n && /* @__PURE__ */ r.createElement(
|
|
3398
|
-
|
|
3390
|
+
Ec,
|
|
3399
3391
|
{
|
|
3400
|
-
disabled: !
|
|
3392
|
+
disabled: !Wn(m),
|
|
3401
3393
|
size: p,
|
|
3402
3394
|
onClick: E
|
|
3403
3395
|
}
|
|
3404
|
-
), o && /* @__PURE__ */ r.createElement(
|
|
3405
|
-
},
|
|
3396
|
+
), o && /* @__PURE__ */ r.createElement(bc, { size: p }), /* @__PURE__ */ r.createElement(xc, { size: p, onClick: x })));
|
|
3397
|
+
}, bc = ({ size: e, disabled: t }) => {
|
|
3406
3398
|
const { state: n } = P();
|
|
3407
|
-
return /* @__PURE__ */ r.createElement(
|
|
3408
|
-
},
|
|
3399
|
+
return /* @__PURE__ */ r.createElement(Ue, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement(O, { type: n.expanded ? "collapse" : "expand", size: e, color: h.themedColor.textHighEmphasis }));
|
|
3400
|
+
}, xc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(O, { type: "close", size: e, color: h.themedColor.textHighEmphasis })), Ec = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
|
|
3409
3401
|
O,
|
|
3410
3402
|
{
|
|
3411
3403
|
type: "refresh",
|
|
3412
3404
|
size: e,
|
|
3413
3405
|
color: t ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
|
|
3414
3406
|
}
|
|
3415
|
-
)),
|
|
3407
|
+
)), Cc = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(Yn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(Ue, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
|
|
3416
3408
|
O,
|
|
3417
3409
|
{
|
|
3418
3410
|
type: "agent",
|
|
3419
3411
|
size: e,
|
|
3420
3412
|
color: n ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
|
|
3421
3413
|
}
|
|
3422
|
-
))),
|
|
3423
|
-
const { isActionbookTester: e } =
|
|
3424
|
-
return e ? null : /* @__PURE__ */ r.createElement(
|
|
3425
|
-
},
|
|
3414
|
+
))), yc = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, vc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, _c = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Sc = u(k)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Ue = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Tc = () => {
|
|
3415
|
+
const { isActionbookTester: e } = Fe();
|
|
3416
|
+
return e ? null : /* @__PURE__ */ r.createElement(fc, null);
|
|
3417
|
+
}, mn = ({
|
|
3426
3418
|
children: e,
|
|
3427
3419
|
onNavigateToConversationList: t,
|
|
3428
3420
|
closedChannelUrl: n,
|
|
3429
3421
|
onClearClosedChannelUrl: o
|
|
3430
3422
|
}) => {
|
|
3431
|
-
const { Template: i } =
|
|
3423
|
+
const { Template: i } = Rt.useContext();
|
|
3432
3424
|
return /* @__PURE__ */ r.createElement(
|
|
3433
|
-
|
|
3425
|
+
Wa,
|
|
3434
3426
|
{
|
|
3435
3427
|
onNavigateToConversationList: t,
|
|
3436
3428
|
closedChannelUrl: n,
|
|
3437
3429
|
onClearClosedChannelUrl: o
|
|
3438
3430
|
},
|
|
3439
|
-
/* @__PURE__ */ r.createElement(xt, null, /* @__PURE__ */ r.createElement(xt.Consumer, null, (a) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
3431
|
+
/* @__PURE__ */ r.createElement(xt, null, /* @__PURE__ */ r.createElement(xt.Consumer, null, (a) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(kc, { ...a }, /* @__PURE__ */ r.createElement(i, null)), e)))
|
|
3440
3432
|
);
|
|
3441
|
-
},
|
|
3442
|
-
template:
|
|
3433
|
+
}, Rt = we({
|
|
3434
|
+
template: wc,
|
|
3443
3435
|
components: {
|
|
3444
|
-
Header:
|
|
3445
|
-
Body:
|
|
3446
|
-
Footer:
|
|
3436
|
+
Header: Tc,
|
|
3437
|
+
Body: Vl,
|
|
3438
|
+
Footer: pc
|
|
3447
3439
|
}
|
|
3448
3440
|
});
|
|
3449
|
-
function
|
|
3450
|
-
const { components: e } =
|
|
3441
|
+
function wc() {
|
|
3442
|
+
const { components: e } = Rt.useContext();
|
|
3451
3443
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Header, null), /* @__PURE__ */ r.createElement(e.Body, null), /* @__PURE__ */ r.createElement(e.Footer, null));
|
|
3452
3444
|
}
|
|
3453
|
-
const
|
|
3454
|
-
Provider:
|
|
3445
|
+
const kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
|
|
3446
|
+
Provider: Ac,
|
|
3455
3447
|
useContext: dr
|
|
3456
3448
|
} = j("ConversationList");
|
|
3457
|
-
function
|
|
3449
|
+
function Ic({
|
|
3458
3450
|
conversationListFilter: e,
|
|
3459
|
-
onOpenConversationView: t =
|
|
3451
|
+
onOpenConversationView: t = Le,
|
|
3460
3452
|
children: n
|
|
3461
3453
|
}) {
|
|
3462
|
-
return /* @__PURE__ */ r.createElement(bo, { conversationListFilter: e }, (o) => /* @__PURE__ */ r.createElement(
|
|
3454
|
+
return /* @__PURE__ */ r.createElement(bo, { conversationListFilter: e }, (o) => /* @__PURE__ */ r.createElement(Ac, { value: { ...o, onOpenConversationView: t } }, n));
|
|
3463
3455
|
}
|
|
3464
3456
|
const ur = we({
|
|
3465
|
-
template:
|
|
3457
|
+
template: $c,
|
|
3466
3458
|
// Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
|
|
3467
3459
|
components: {}
|
|
3468
3460
|
});
|
|
3469
|
-
function
|
|
3461
|
+
function $c({
|
|
3470
3462
|
title: e = "",
|
|
3471
3463
|
lastMessageTimestamp: t = Date.now(),
|
|
3472
3464
|
onClick: n
|
|
3473
3465
|
}) {
|
|
3474
3466
|
const { stringSet: o, format: i } = R();
|
|
3475
|
-
return /* @__PURE__ */ r.createElement(
|
|
3467
|
+
return /* @__PURE__ */ r.createElement(Mc, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(Lc, null, /* @__PURE__ */ r.createElement(Rc, null, /* @__PURE__ */ r.createElement(k, { variant: "subtitle1", color: h.themedColor.textHighEmphasis }, i(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE)), /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textLowEmphasis }, i(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION))), /* @__PURE__ */ r.createElement(k, { variant: "body3", color: h.themedColor.textMidEmphasis }, e || o.CONVERSATION_LIST__TOPICS_FALLBACK)), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: h.themedColor.textHighEmphasis }), /* @__PURE__ */ r.createElement(Oc, null));
|
|
3476
3468
|
}
|
|
3477
|
-
const
|
|
3469
|
+
const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:relative;width:100%;padding:14px 16px;box-sizing:border-box;gap:4px;cursor:pointer;`, Oc = u.div`position:absolute;bottom:0;height:1px;width:calc(100% - 32px);background-color:${h.themedColor.textDisabled};`, Lc = u.div`gap:4px;display:flex;flex-direction:column;flex:1;`, Rc = u.div`display:flex;justify-content:flex-start;align-items:center;gap:6px;`, Dc = ({ items: e, renderItem: t, onEndReached: n }) => {
|
|
3478
3470
|
const o = (i) => {
|
|
3479
3471
|
const a = i.target;
|
|
3480
3472
|
a.scrollHeight - a.scrollTop === a.clientHeight && (n == null || n());
|
|
3481
3473
|
};
|
|
3482
|
-
return /* @__PURE__ */ r.createElement(
|
|
3483
|
-
},
|
|
3474
|
+
return /* @__PURE__ */ r.createElement(Nc, { onScroll: (i) => o(i) }, e.map((i, a) => t(i, a)));
|
|
3475
|
+
}, Nc = u.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`, Pc = () => {
|
|
3484
3476
|
const { stringSet: e } = R(), { listSource: t, onOpenConversationView: n } = dr(), { Template: o } = ur.useContext();
|
|
3485
3477
|
return t.initialized ? t.channels.length === 0 ? /* @__PURE__ */ r.createElement(Se, { type: "noChannels", label: e.CONVERSATION_LIST__NO_CONVERSATIONS }) : /* @__PURE__ */ r.createElement(
|
|
3486
|
-
|
|
3478
|
+
Dc,
|
|
3487
3479
|
{
|
|
3488
3480
|
items: t.channels,
|
|
3489
3481
|
renderItem: (i) => {
|
|
@@ -3505,10 +3497,10 @@ const $c = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3505
3497
|
}
|
|
3506
3498
|
}
|
|
3507
3499
|
) : /* @__PURE__ */ r.createElement(Se, { type: "loading" });
|
|
3508
|
-
},
|
|
3500
|
+
}, Bc = () => {
|
|
3509
3501
|
const { refreshActiveChannel: e } = z(), { onOpenConversationView: t } = dr(), n = sr();
|
|
3510
3502
|
return /* @__PURE__ */ r.createElement(
|
|
3511
|
-
|
|
3503
|
+
Fc,
|
|
3512
3504
|
{
|
|
3513
3505
|
role: "button",
|
|
3514
3506
|
onClick: async () => {
|
|
@@ -3516,43 +3508,43 @@ const $c = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3516
3508
|
t(o, W.OPEN);
|
|
3517
3509
|
}
|
|
3518
3510
|
},
|
|
3519
|
-
/* @__PURE__ */ r.createElement(
|
|
3511
|
+
/* @__PURE__ */ r.createElement(Uc, { variant: "h1" }, n)
|
|
3520
3512
|
);
|
|
3521
|
-
},
|
|
3513
|
+
}, Fc = u.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, Uc = u(k)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, Hc = () => {
|
|
3522
3514
|
const { stringSet: e } = R();
|
|
3523
|
-
return /* @__PURE__ */ r.createElement(
|
|
3524
|
-
},
|
|
3525
|
-
const { Template: o } =
|
|
3515
|
+
return /* @__PURE__ */ r.createElement(zc, null, /* @__PURE__ */ r.createElement(Vc, { variant: "h2", color: h.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Wc, null));
|
|
3516
|
+
}, zc = u.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};`, Vc = u(k)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Wc = u.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${h.themedColor.textDisabled};`, Gc = ({ conversationListFilter: e, children: t, onOpenConversationView: n }) => {
|
|
3517
|
+
const { Template: o } = Dt.useContext();
|
|
3526
3518
|
return /* @__PURE__ */ r.createElement(
|
|
3527
|
-
|
|
3519
|
+
Ic,
|
|
3528
3520
|
{
|
|
3529
3521
|
conversationListFilter: e,
|
|
3530
3522
|
onOpenConversationView: n
|
|
3531
3523
|
},
|
|
3532
|
-
/* @__PURE__ */ r.createElement(
|
|
3524
|
+
/* @__PURE__ */ r.createElement(Kc, null, /* @__PURE__ */ r.createElement(o, null)),
|
|
3533
3525
|
t
|
|
3534
3526
|
);
|
|
3535
|
-
},
|
|
3536
|
-
template:
|
|
3527
|
+
}, Dt = we({
|
|
3528
|
+
template: jc,
|
|
3537
3529
|
components: {
|
|
3538
|
-
Header:
|
|
3539
|
-
Body:
|
|
3540
|
-
Footer:
|
|
3530
|
+
Header: Hc,
|
|
3531
|
+
Body: Pc,
|
|
3532
|
+
Footer: Bc
|
|
3541
3533
|
}
|
|
3542
3534
|
});
|
|
3543
|
-
function
|
|
3544
|
-
const { components: e } =
|
|
3535
|
+
function jc() {
|
|
3536
|
+
const { components: e } = Dt.useContext();
|
|
3545
3537
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Header, null), /* @__PURE__ */ r.createElement(e.Body, null), /* @__PURE__ */ r.createElement(e.Footer, null));
|
|
3546
3538
|
}
|
|
3547
|
-
const
|
|
3548
|
-
|
|
3539
|
+
const Kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Zc = $`:where(#${oe.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, Yc = [Zc, ni, ri], qc = (e, ...t) => Lr(e, ...Yc, ...t), Jc = qc``, Xc = Xr(
|
|
3540
|
+
Rt,
|
|
3549
3541
|
_e,
|
|
3542
|
+
$t,
|
|
3550
3543
|
Mt,
|
|
3551
|
-
|
|
3552
|
-
Nt,
|
|
3544
|
+
Dt,
|
|
3553
3545
|
ur
|
|
3554
3546
|
);
|
|
3555
|
-
function
|
|
3547
|
+
function Qc({
|
|
3556
3548
|
appearance: e,
|
|
3557
3549
|
rootElement: t,
|
|
3558
3550
|
logger: n,
|
|
@@ -3562,9 +3554,9 @@ function Xc({
|
|
|
3562
3554
|
messageTemplate: s,
|
|
3563
3555
|
theme: l
|
|
3564
3556
|
}) {
|
|
3565
|
-
return ci(jo, t), /* @__PURE__ */ r.createElement(Rr, { target: t }, /* @__PURE__ */ r.createElement(si, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(Fo, { internalVariables: s == null ? void 0 : s.__internalVariables }, /* @__PURE__ */ r.createElement(ti, { stringSet: i, logger: n, language: o }, /* @__PURE__ */ r.createElement(
|
|
3557
|
+
return ci(jo, t), /* @__PURE__ */ r.createElement(Rr, { target: t }, /* @__PURE__ */ r.createElement(si, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(Fo, { internalVariables: s == null ? void 0 : s.__internalVariables }, /* @__PURE__ */ r.createElement(ti, { stringSet: i, logger: n, language: o }, /* @__PURE__ */ r.createElement(Xc, null, a, /* @__PURE__ */ r.createElement(Jc, null))))));
|
|
3566
3558
|
}
|
|
3567
|
-
const
|
|
3559
|
+
const hn = {
|
|
3568
3560
|
key_payment_plan_container: {
|
|
3569
3561
|
color_variables: {},
|
|
3570
3562
|
created_at: 1232,
|
|
@@ -3749,17 +3741,17 @@ const gn = {
|
|
|
3749
3741
|
}
|
|
3750
3742
|
}
|
|
3751
3743
|
}
|
|
3752
|
-
}, mr =
|
|
3744
|
+
}, mr = Re(function({
|
|
3753
3745
|
rootElement: t = document.body,
|
|
3754
|
-
logLevel: n =
|
|
3746
|
+
logLevel: n = xn.WARN,
|
|
3755
3747
|
language: o = navigator.language,
|
|
3756
3748
|
userSessionInfo: i,
|
|
3757
3749
|
children: a,
|
|
3758
3750
|
...s
|
|
3759
3751
|
}, l) {
|
|
3760
3752
|
var c;
|
|
3761
|
-
return ye.level !== n && (ye.level = n), li("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id:
|
|
3762
|
-
|
|
3753
|
+
return ye.level !== n && (ye.level = n), li("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: oe.ENTRY, style: { width: "fit-content", height: "fit-content", ...s.entryStyle } }, /* @__PURE__ */ r.createElement(No, { logger: ye, storage: td }, /* @__PURE__ */ r.createElement(
|
|
3754
|
+
Qc,
|
|
3763
3755
|
{
|
|
3764
3756
|
logger: ye,
|
|
3765
3757
|
rootElement: t,
|
|
@@ -3778,39 +3770,39 @@ const gn = {
|
|
|
3778
3770
|
countryCode: s.countryCode,
|
|
3779
3771
|
context: s.context,
|
|
3780
3772
|
logger: ye,
|
|
3781
|
-
dispatcher:
|
|
3773
|
+
dispatcher: ed,
|
|
3782
3774
|
chatParams: { customApiHost: s.customApiHost, customWebSocketHost: s.customWebSocketHost }
|
|
3783
3775
|
},
|
|
3784
|
-
/* @__PURE__ */ r.createElement(pi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(Ci, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement(
|
|
3776
|
+
/* @__PURE__ */ r.createElement(pi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(Ci, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement($a, { ...s._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id: oe.MODAL_ROOT }))))
|
|
3785
3777
|
)
|
|
3786
3778
|
)));
|
|
3787
|
-
}), ye = new
|
|
3779
|
+
}), ye = new wn(xn.WARN), ed = new Sn(ye), Nt = "@sba/message-template", gn = (e) => `${Nt}/templates/${e}`, pn = () => `${Nt}/token`, td = Ro({
|
|
3788
3780
|
onSetTemplate: (e, t) => {
|
|
3789
|
-
|
|
3781
|
+
hn[e] || te.setItem(gn(e), t);
|
|
3790
3782
|
},
|
|
3791
3783
|
onGetTemplate: (e) => {
|
|
3792
|
-
const t =
|
|
3793
|
-
return t ? JSON.stringify(t) :
|
|
3784
|
+
const t = hn[e];
|
|
3785
|
+
return t ? JSON.stringify(t) : te.getItem(gn(e));
|
|
3794
3786
|
},
|
|
3795
3787
|
onSetCachedToken(e) {
|
|
3796
|
-
|
|
3788
|
+
te.setItem(pn(), e);
|
|
3797
3789
|
},
|
|
3798
3790
|
onGetCachedToken() {
|
|
3799
|
-
return
|
|
3791
|
+
return te.getItem(pn());
|
|
3800
3792
|
},
|
|
3801
3793
|
onClear: () => {
|
|
3802
|
-
|
|
3794
|
+
te.getKeys(Nt).forEach(te.deleteItem);
|
|
3803
3795
|
}
|
|
3804
3796
|
}), hr = ({ children: e, isOpened: t }) => {
|
|
3805
|
-
const { dir: n, rootElement: o } = P(), i =
|
|
3797
|
+
const { dir: n, rootElement: o } = P(), i = fe(o, !0);
|
|
3806
3798
|
return D(() => {
|
|
3807
3799
|
const a = "sb-agent-block-scroll";
|
|
3808
3800
|
return t ? i.body.classList.add(a) : i.body.classList.remove(a), () => {
|
|
3809
3801
|
i.body.classList.remove(a);
|
|
3810
3802
|
};
|
|
3811
|
-
}, [i, t]), /* @__PURE__ */ r.createElement(
|
|
3812
|
-
},
|
|
3813
|
-
function
|
|
3803
|
+
}, [i, t]), /* @__PURE__ */ r.createElement(nd, { dir: n, $visible: t }, e);
|
|
3804
|
+
}, nd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${be.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, rd = 48, od = 2 / 3;
|
|
3805
|
+
function id({
|
|
3814
3806
|
className: e,
|
|
3815
3807
|
isOpened: t,
|
|
3816
3808
|
onClick: n,
|
|
@@ -3819,14 +3811,14 @@ function od({
|
|
|
3819
3811
|
dir: a,
|
|
3820
3812
|
animated: s = !0,
|
|
3821
3813
|
backgroundColor: l,
|
|
3822
|
-
size: c =
|
|
3814
|
+
size: c = rd
|
|
3823
3815
|
}) {
|
|
3824
|
-
const d = ft(l), m = Math.round(c *
|
|
3816
|
+
const d = ft(l), m = Math.round(c * od);
|
|
3825
3817
|
return /* @__PURE__ */ r.createElement(
|
|
3826
|
-
|
|
3818
|
+
ld,
|
|
3827
3819
|
{
|
|
3828
3820
|
dir: a,
|
|
3829
|
-
id:
|
|
3821
|
+
id: oe.LAUNCHER,
|
|
3830
3822
|
className: e,
|
|
3831
3823
|
"aria-label": "Sendbird AIAgent Launcher",
|
|
3832
3824
|
onClick: n,
|
|
@@ -3834,11 +3826,11 @@ function od({
|
|
|
3834
3826
|
$backgroundColor: l,
|
|
3835
3827
|
$size: c
|
|
3836
3828
|
},
|
|
3837
|
-
/* @__PURE__ */ r.createElement(
|
|
3838
|
-
/* @__PURE__ */ r.createElement(
|
|
3829
|
+
/* @__PURE__ */ r.createElement(cd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(fn.Open, { url: i, isDefaultIcon: o === "default_icon" })),
|
|
3830
|
+
/* @__PURE__ */ r.createElement(dd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(fn.Close, { size: m }))
|
|
3839
3831
|
);
|
|
3840
3832
|
}
|
|
3841
|
-
const
|
|
3833
|
+
const sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, ad = $`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:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;filter:${({ $fillColor: e }) => e === Ln.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, gr = $`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => $`
|
|
3842
3834
|
path {
|
|
3843
3835
|
fill: ${e};
|
|
3844
3836
|
}
|
|
@@ -3847,14 +3839,14 @@ const id = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
3847
3839
|
}
|
|
3848
3840
|
`}
|
|
3849
3841
|
}
|
|
3850
|
-
`,
|
|
3851
|
-
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(
|
|
3842
|
+
`, ld = u.button`position:relative;padding:0;width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;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 && sd}`, pr = u.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;`, cd = u(pr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${ad}${gr}`, dd = u(pr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${gr}`, fn = {
|
|
3843
|
+
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(kt, null),
|
|
3852
3844
|
Close: ({ size: e }) => /* @__PURE__ */ r.createElement(O, { size: e, type: "chevron-down" })
|
|
3853
3845
|
};
|
|
3854
3846
|
function fr({ className: e, size: t }) {
|
|
3855
|
-
const { colors: n } =
|
|
3856
|
-
return
|
|
3857
|
-
|
|
3847
|
+
const { colors: n } = Et(), { dir: o, state: i } = P(), { launcherInfo: a } = z();
|
|
3848
|
+
return md(), /* @__PURE__ */ r.createElement(
|
|
3849
|
+
id,
|
|
3858
3850
|
{
|
|
3859
3851
|
dir: o,
|
|
3860
3852
|
className: e,
|
|
@@ -3867,8 +3859,8 @@ function fr({ className: e, size: t }) {
|
|
|
3867
3859
|
}
|
|
3868
3860
|
);
|
|
3869
3861
|
}
|
|
3870
|
-
const
|
|
3871
|
-
function
|
|
3862
|
+
const ud = 1e3 * 60;
|
|
3863
|
+
function md() {
|
|
3872
3864
|
const { chatSDK: e, state: t, logger: n, enableAutoDisconnectInLauncher: o } = P(), i = F(null);
|
|
3873
3865
|
D(() => {
|
|
3874
3866
|
if (!o) return;
|
|
@@ -3881,32 +3873,32 @@ function ud() {
|
|
|
3881
3873
|
function l() {
|
|
3882
3874
|
a(), i.current = setTimeout(async () => {
|
|
3883
3875
|
await e.disconnectWebSocket(), n.debug("useSDKInactivityTimeout: disconnected");
|
|
3884
|
-
},
|
|
3876
|
+
}, ud);
|
|
3885
3877
|
}
|
|
3886
3878
|
t.opened ? s() : (l(), n.debug("useSDKInactivityTimeout: schedule disconnect"));
|
|
3887
3879
|
}, [o, e, t.opened]);
|
|
3888
3880
|
}
|
|
3889
3881
|
const br = Te(null);
|
|
3890
|
-
function
|
|
3891
|
-
const e =
|
|
3882
|
+
function hd() {
|
|
3883
|
+
const e = re(br);
|
|
3892
3884
|
if (!e)
|
|
3893
3885
|
throw new Error("useNavigator() must be used within <Navigator />");
|
|
3894
3886
|
return e;
|
|
3895
3887
|
}
|
|
3896
3888
|
function xr({ children: e }) {
|
|
3897
|
-
const t =
|
|
3889
|
+
const t = hd();
|
|
3898
3890
|
return typeof e == "function" ? e(t) : /* @__PURE__ */ r.createElement(r.Fragment, null, e);
|
|
3899
3891
|
}
|
|
3900
|
-
const
|
|
3892
|
+
const gd = En`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, pd = En`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, fd = $`animation-name:${gd};animation-duration:0.3s;animation-fill-mode:forwards;`, bd = $``, xd = $`animation-name:${pd};animation-duration:0.3s;animation-fill-mode:forwards;`, Ed = $`visibility:hidden;`, Cd = u.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
|
|
3901
3893
|
switch (e) {
|
|
3902
3894
|
case "entering":
|
|
3903
|
-
return pd;
|
|
3904
|
-
case "entered":
|
|
3905
3895
|
return fd;
|
|
3906
|
-
case "
|
|
3896
|
+
case "entered":
|
|
3907
3897
|
return bd;
|
|
3908
|
-
case "
|
|
3898
|
+
case "exiting":
|
|
3909
3899
|
return xd;
|
|
3900
|
+
case "exited":
|
|
3901
|
+
return Ed;
|
|
3910
3902
|
default:
|
|
3911
3903
|
return "";
|
|
3912
3904
|
}
|
|
@@ -3914,7 +3906,7 @@ const hd = Cn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
|
|
|
3914
3906
|
z-index: 999;
|
|
3915
3907
|
` : $`z-index:1;pointer-events:none;`}
|
|
3916
3908
|
`;
|
|
3917
|
-
function
|
|
3909
|
+
function Me({ initialId: e, children: t }) {
|
|
3918
3910
|
const n = U((b, C) => {
|
|
3919
3911
|
c((v) => [...v, b]), m((v) => ({ ...v, [b]: !0 })), C != null && C.reset && f((v) => ({
|
|
3920
3912
|
...v,
|
|
@@ -3952,55 +3944,55 @@ function $e({ initialId: e, children: t }) {
|
|
|
3952
3944
|
), [t]), s = ve(() => {
|
|
3953
3945
|
const b = {};
|
|
3954
3946
|
return a.forEach((C) => {
|
|
3955
|
-
const { id: v, lazy: T, children:
|
|
3956
|
-
b[v] = { lazy: T, element: typeof
|
|
3947
|
+
const { id: v, lazy: T, children: _ } = C.props;
|
|
3948
|
+
b[v] = { lazy: T, element: typeof _ == "function" ? _(i) : _ };
|
|
3957
3949
|
}), b;
|
|
3958
|
-
}, [a]), [l, c] =
|
|
3950
|
+
}, [a]), [l, c] = S([e]), [d, m] = S(() => {
|
|
3959
3951
|
const b = {};
|
|
3960
3952
|
return Object.entries(s).forEach(([C, { lazy: v }]) => {
|
|
3961
3953
|
v === !1 && (b[C] = !0);
|
|
3962
3954
|
}), b[e] = !0, b;
|
|
3963
|
-
}), [g, p] =
|
|
3955
|
+
}), [g, p] = S(() => {
|
|
3964
3956
|
const b = {};
|
|
3965
3957
|
return Object.keys(s).forEach((C) => {
|
|
3966
3958
|
C === e ? b[C] = "entered" : b[C] = "exited";
|
|
3967
3959
|
}), b;
|
|
3968
|
-
}), [x, f] =
|
|
3969
|
-
return /* @__PURE__ */ r.createElement(br.Provider, { value: i }, /* @__PURE__ */ r.createElement(
|
|
3970
|
-
var
|
|
3960
|
+
}), [x, f] = S({}), E = l[l.length - 1];
|
|
3961
|
+
return /* @__PURE__ */ r.createElement(br.Provider, { value: i }, /* @__PURE__ */ r.createElement(yd, null, Object.keys(s).map((b) => {
|
|
3962
|
+
var _;
|
|
3971
3963
|
if (!d[b]) return null;
|
|
3972
3964
|
const C = g[b] || "exited", v = b === E, T = `${b}-${x[b] || 0}`;
|
|
3973
|
-
return /* @__PURE__ */ r.createElement(
|
|
3965
|
+
return /* @__PURE__ */ r.createElement(Cd, { key: T, $transitionState: C, $active: v }, (_ = s[b]) == null ? void 0 : _.element);
|
|
3974
3966
|
})));
|
|
3975
3967
|
}
|
|
3976
|
-
const
|
|
3977
|
-
|
|
3978
|
-
const
|
|
3968
|
+
const yd = u.div`position:relative;width:100%;height:100%;`;
|
|
3969
|
+
Me.Screen = xr;
|
|
3970
|
+
const pe = {
|
|
3979
3971
|
activeConv: "active-conv",
|
|
3980
3972
|
closedConv: "closed-conv",
|
|
3981
3973
|
convList: "conv-list"
|
|
3982
|
-
}, Er = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(
|
|
3983
|
-
|
|
3974
|
+
}, Er = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(Me, { initialId: pe.activeConv }, /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.activeConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(mn, { onNavigateToConversationList: () => n.navigate(pe.convList, { reset: !0 }) })), /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.closedConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3975
|
+
mn,
|
|
3984
3976
|
{
|
|
3985
3977
|
onNavigateToConversationList: () => n.pop(),
|
|
3986
3978
|
closedChannelUrl: t,
|
|
3987
3979
|
onClearClosedChannelUrl: () => e(void 0)
|
|
3988
3980
|
}
|
|
3989
|
-
)), /* @__PURE__ */ r.createElement(
|
|
3990
|
-
|
|
3981
|
+
)), /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.convList, lazy: !0 }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3982
|
+
Gc,
|
|
3991
3983
|
{
|
|
3992
3984
|
onOpenConversationView: (o, i) => {
|
|
3993
|
-
i === "closed" ? (e(o), n.navigate(
|
|
3985
|
+
i === "closed" ? (e(o), n.navigate(pe.closedConv, { reset: !0 })) : n.navigate(pe.activeConv);
|
|
3994
3986
|
}
|
|
3995
3987
|
}
|
|
3996
3988
|
)));
|
|
3997
|
-
function
|
|
3989
|
+
function vd({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
|
|
3998
3990
|
const { dir: i } = P();
|
|
3999
|
-
return /* @__PURE__ */ r.createElement(
|
|
3991
|
+
return /* @__PURE__ */ r.createElement(_d, null, /* @__PURE__ */ r.createElement(Sd, { dir: i, id: oe.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
|
|
4000
3992
|
}
|
|
4001
|
-
const
|
|
4002
|
-
const o =
|
|
4003
|
-
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(
|
|
3993
|
+
const _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Sd = u.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 && wd};${({ $isExpanded: e }) => e && Td};`, Td = $`width:743px;height:723px;`, wd = $`z-index:${be.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;`, Xd = Re(function({ children: e, ...t }, n) {
|
|
3994
|
+
const o = Pe(), [i, a] = S(), s = o ? hr : vd;
|
|
3995
|
+
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(s, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(fr, null) }, /* @__PURE__ */ r.createElement(
|
|
4004
3996
|
Er,
|
|
4005
3997
|
{
|
|
4006
3998
|
closedChannelUrl: i,
|
|
@@ -4008,42 +4000,42 @@ const vd = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end
|
|
|
4008
4000
|
}
|
|
4009
4001
|
)), e)));
|
|
4010
4002
|
}), {
|
|
4011
|
-
Provider:
|
|
4012
|
-
useContext:
|
|
4003
|
+
Provider: kd,
|
|
4004
|
+
useContext: Pt
|
|
4013
4005
|
} = j("FixedMessengerStyle");
|
|
4014
4006
|
function Cr(e, t, n, o = 0) {
|
|
4015
4007
|
const { top: i, bottom: a, start: s, end: l } = n;
|
|
4016
4008
|
let c = "", d = "";
|
|
4017
4009
|
switch (e) {
|
|
4018
4010
|
case "start":
|
|
4019
|
-
d = `inset-inline-start: ${
|
|
4011
|
+
d = `inset-inline-start: ${Y(s)}`;
|
|
4020
4012
|
break;
|
|
4021
4013
|
case "end":
|
|
4022
|
-
d = `inset-inline-end: ${
|
|
4014
|
+
d = `inset-inline-end: ${Y(l)}`;
|
|
4023
4015
|
break;
|
|
4024
4016
|
}
|
|
4025
4017
|
switch (t) {
|
|
4026
4018
|
case "top":
|
|
4027
|
-
c = `top: calc(${
|
|
4019
|
+
c = `top: calc(${Y(i)} + ${o}px)`;
|
|
4028
4020
|
break;
|
|
4029
4021
|
case "bottom":
|
|
4030
|
-
c = `bottom: calc(${
|
|
4022
|
+
c = `bottom: calc(${Y(a)} + ${o}px)`;
|
|
4031
4023
|
break;
|
|
4032
4024
|
}
|
|
4033
4025
|
return $`${c};${d};`;
|
|
4034
4026
|
}
|
|
4035
|
-
function
|
|
4036
|
-
const { horizontal: t, vertical: n, margin: o, launcherSize: i } =
|
|
4037
|
-
return /* @__PURE__ */ r.createElement(
|
|
4027
|
+
function Ad(e) {
|
|
4028
|
+
const { horizontal: t, vertical: n, margin: o, launcherSize: i } = Pt();
|
|
4029
|
+
return /* @__PURE__ */ r.createElement(Id, { ...e, size: i, $horizontal: t, $vertical: n, $margin: o });
|
|
4038
4030
|
}
|
|
4039
|
-
const
|
|
4040
|
-
function
|
|
4041
|
-
const { dir: o } = P(), { horizontal: i, vertical: a, margin: s, launcherSize: l } =
|
|
4031
|
+
const Id = u(fr)`position:fixed;z-index:${be.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => Cr(e, t, n)};`;
|
|
4032
|
+
function $d({ isExpanded: e, isOpened: t, children: n }) {
|
|
4033
|
+
const { dir: o } = P(), { horizontal: i, vertical: a, margin: s, launcherSize: l } = Pt();
|
|
4042
4034
|
return /* @__PURE__ */ r.createElement(
|
|
4043
|
-
|
|
4035
|
+
Md,
|
|
4044
4036
|
{
|
|
4045
4037
|
dir: o,
|
|
4046
|
-
id:
|
|
4038
|
+
id: oe.WINDOW,
|
|
4047
4039
|
$isExpanded: e,
|
|
4048
4040
|
$isOpened: t,
|
|
4049
4041
|
$horizontal: i,
|
|
@@ -4054,21 +4046,21 @@ function Id({ isExpanded: e, isOpened: t, children: n }) {
|
|
|
4054
4046
|
n
|
|
4055
4047
|
);
|
|
4056
4048
|
}
|
|
4057
|
-
const
|
|
4049
|
+
const Md = u.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;position:fixed;${({ $horizontal: e, $vertical: t, $margin: n, $launcherSize: o }) => Cr(e, t, n, o + 12)};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:${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "left" : "right"} ${t}`};
|
|
4058
4050
|
[dir='rtl'] &:not([dir='ltr']),
|
|
4059
4051
|
&[dir='rtl'] {
|
|
4060
4052
|
transform-origin: ${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "right" : "left"} ${t}`};
|
|
4061
4053
|
}
|
|
4062
4054
|
|
|
4063
|
-
${({ $isOpened: e }) => e &&
|
|
4064
|
-
${({ $isExpanded: e }) => e &&
|
|
4065
|
-
`,
|
|
4066
|
-
const [o, i] =
|
|
4055
|
+
${({ $isOpened: e }) => e && Ld};
|
|
4056
|
+
${({ $isExpanded: e }) => e && Od};
|
|
4057
|
+
`, Od = $`width:743px;height:723px;`, Ld = $`z-index:${be.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;`, yr = { top: 24, bottom: 24, start: 24, end: 24 }, Rd = Re(function({ children: e, ...t }, n) {
|
|
4058
|
+
const [o, i] = S(), [a, s] = S("end-bottom"), [l, c] = S(yr), [d, m] = S(48), g = Pe(), p = g ? hr : $d, { horizontal: x, vertical: f } = ve(() => {
|
|
4067
4059
|
const [E, b] = a.split("-");
|
|
4068
4060
|
return { horizontal: E === "start" ? "start" : "end", vertical: b === "top" ? "top" : "bottom" };
|
|
4069
4061
|
}, [a]);
|
|
4070
|
-
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !g, ref: n, ...t }, /* @__PURE__ */ r.createElement(
|
|
4071
|
-
|
|
4062
|
+
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !g, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: E }) => /* @__PURE__ */ r.createElement(
|
|
4063
|
+
kd,
|
|
4072
4064
|
{
|
|
4073
4065
|
value: { horizontal: x, vertical: f, margin: l, launcherSize: d, setPosition: s, setMargin: c, setLauncherSize: m }
|
|
4074
4066
|
},
|
|
@@ -4079,13 +4071,13 @@ const $d = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4079
4071
|
setClosedChannelUrl: i
|
|
4080
4072
|
}
|
|
4081
4073
|
)),
|
|
4082
|
-
/* @__PURE__ */ r.createElement(
|
|
4074
|
+
/* @__PURE__ */ r.createElement(Ad, null),
|
|
4083
4075
|
e
|
|
4084
4076
|
)));
|
|
4085
|
-
}),
|
|
4077
|
+
}), Dd = (e) => {
|
|
4086
4078
|
var i, a, s, l;
|
|
4087
|
-
const { setPosition: t, setMargin: n, setLauncherSize: o } =
|
|
4088
|
-
return
|
|
4079
|
+
const { setPosition: t, setMargin: n, setLauncherSize: o } = Pt();
|
|
4080
|
+
return ce(() => {
|
|
4089
4081
|
e.position && t(e.position), e.margin && n({ ...yr, ...e.margin }), e.launcherSize && o(e.launcherSize);
|
|
4090
4082
|
}, [
|
|
4091
4083
|
e.position,
|
|
@@ -4095,35 +4087,35 @@ const $d = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4095
4087
|
(l = e.margin) == null ? void 0 : l.end,
|
|
4096
4088
|
e.launcherSize
|
|
4097
4089
|
]), null;
|
|
4098
|
-
},
|
|
4099
|
-
Style:
|
|
4090
|
+
}, Qd = Object.assign(Rd, {
|
|
4091
|
+
Style: Dd
|
|
4100
4092
|
});
|
|
4101
4093
|
export {
|
|
4102
|
-
|
|
4094
|
+
_t as A,
|
|
4103
4095
|
ao as C,
|
|
4104
|
-
|
|
4105
|
-
|
|
4096
|
+
Xd as D,
|
|
4097
|
+
Qd as F,
|
|
4106
4098
|
O as I,
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4099
|
+
Kn as L,
|
|
4100
|
+
ka as M,
|
|
4101
|
+
$t as O,
|
|
4102
|
+
Jd as P,
|
|
4103
|
+
Mt as S,
|
|
4112
4104
|
k as a,
|
|
4113
4105
|
mr as b,
|
|
4114
4106
|
h as c,
|
|
4115
|
-
|
|
4107
|
+
Qc as d,
|
|
4116
4108
|
z as e,
|
|
4117
4109
|
R as f,
|
|
4118
|
-
|
|
4110
|
+
id as g,
|
|
4119
4111
|
_e as h,
|
|
4120
|
-
|
|
4112
|
+
ne as i,
|
|
4121
4113
|
ur as j,
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4114
|
+
mn as k,
|
|
4115
|
+
Rt as l,
|
|
4116
|
+
ed as m,
|
|
4117
|
+
Gc as n,
|
|
4118
|
+
Dt as o,
|
|
4119
|
+
Tn as p,
|
|
4128
4120
|
P as u
|
|
4129
4121
|
};
|