@sendbird/ai-agent-messenger-react 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,27 @@
1
1
  import * as r from "react";
2
- import { createContext as ve, useContext as X, useEffect as L, useState as _, useId as bn, useRef as N, useCallback as R, useMemo as ae, forwardRef as ye, useImperativeHandle as Er, useLayoutEffect as le, lazy as T, Suspense as ke, Component as xr, Fragment as Ut, useReducer as Cr, Children as vr } from "react";
3
- import yr, { SendbirdProduct as _r, DeviceOsPlatform as Ht, SendbirdPlatform as Sr, ConnectionHandler as Je, SendbirdError as Tr, SessionHandler as wr, LogLevel as En, ConnectionState as Ar } from "@sendbird/chat";
4
- import u, { css as I, ThemeProvider as kr, useTheme as xt, createGlobalStyle as Ir, StyleSheetManager as $r, keyframes as xn } from "styled-components";
5
- import { format as Cn, isSameMinute as zt, isSameDay as Mr } from "date-fns";
6
- import { enUS as Or } from "date-fns/locale/en-US";
7
- import { AIAgentModule as Lr, ConversationStatus as W, ConversationType as Rr } from "@sendbird/chat/aiAgent";
8
- import { useGroupChannelMessages as Dr, useGroupChannelHandler as Xe, useForceUpdate as Nr } from "@sendbird/uikit-tools";
9
- import { GroupChannelModule as Pr, GroupChannelListOrder as vn, GroupChannelHandler as Br } from "@sendbird/chat/groupChannel";
10
- import { renderer as Fr, parser as Ur, MessageProvider as Hr } from "@sendbird/react-uikit-message-template-view";
11
- import { createMessageTemplate as zr } from "@sendbird/uikit-message-template";
2
+ import { createContext as ve, useContext as Q, useEffect as L, useState as _, useId as bn, useRef as N, useCallback as R, useMemo as ae, forwardRef as ye, useImperativeHandle as Er, useLayoutEffect as le, lazy as T, Suspense as ke, Component as xr, Fragment as Ut, useReducer as Cr, Children as vr } from "react";
3
+ import yr, { SendbirdChatOptions as _r, SendbirdProduct as Sr, DeviceOsPlatform as Ht, SendbirdPlatform as Tr, ConnectionHandler as Je, SendbirdError as wr, SessionHandler as Ar, LogLevel as En, ConnectionState as kr } from "@sendbird/chat";
4
+ import u, { css as I, ThemeProvider as Ir, useTheme as xt, createGlobalStyle as $r, StyleSheetManager as Mr, keyframes as xn } from "styled-components";
5
+ import { format as Cn, isSameMinute as zt, isSameDay as Or } from "date-fns";
6
+ import { enUS as Lr } from "date-fns/locale/en-US";
7
+ import { AIAgentModule as Rr, ConversationStatus as W, ConversationType as Dr } from "@sendbird/chat/aiAgent";
8
+ import { useGroupChannelMessages as Nr, useGroupChannelHandler as Xe, useForceUpdate as Pr } from "@sendbird/uikit-tools";
9
+ import { GroupChannelModule as Br, GroupChannelListOrder as vn, GroupChannelHandler as Fr } from "@sendbird/chat/groupChannel";
10
+ import { renderer as Ur, parser as Hr, MessageProvider as zr } from "@sendbird/react-uikit-message-template-view";
11
+ import { createMessageTemplate as Vr } from "@sendbird/uikit-message-template";
12
12
  import yn from "dompurify";
13
- import { SendingStatus as dt, MessageMetaArray as Vr } from "@sendbird/chat/message";
14
- import { isSameDay as Wr } from "date-fns/isSameDay";
15
- import { createPortal as Gr } from "react-dom";
16
- import jr from "@emotion/is-prop-valid";
13
+ import { SendingStatus as dt, MessageMetaArray as Wr } from "@sendbird/chat/message";
14
+ import { isSameDay as Gr } from "date-fns/isSameDay";
15
+ import { createPortal as jr } from "react-dom";
16
+ import Kr from "@emotion/is-prop-valid";
17
17
  const G = (e, t) => {
18
- const n = ve(null), o = ({ children: i, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof i == "function" ? i(l) : i), s = ({ children: i }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof i == "function" ? i(l) : i : null), a = () => {
19
- const i = X(n);
20
- if (!i)
18
+ const n = ve(null), o = ({ children: a, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof a == "function" ? a(l) : a), s = ({ children: a }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof a == "function" ? a(l) : a : null), i = () => {
19
+ const a = Q(n);
20
+ if (!a)
21
21
  throw new Error(`use${e}Context must be used within a ${e}Provider`);
22
- return i;
22
+ return a;
23
23
  };
24
- return n.displayName = `${e}Context`, o.displayName = `${e}Provider`, s.displayName = `${e}Consumer`, a.displayName = `use${e}Context`, { Context: n, Provider: o, Consumer: s, useContext: a };
24
+ return n.displayName = `${e}Context`, o.displayName = `${e}Provider`, s.displayName = `${e}Consumer`, i.displayName = `use${e}Context`, { Context: n, Provider: o, Consumer: s, useContext: i };
25
25
  };
26
26
  function _e(e) {
27
27
  const t = ve({
@@ -32,47 +32,47 @@ function _e(e) {
32
32
  updateComponent: () => {
33
33
  }
34
34
  });
35
- function n({ children: a }) {
36
- const [i, l] = _(() => e.template), [c, d] = _(e.components), g = {
37
- Template: i,
38
- updateTemplate: (h) => l(() => h),
35
+ function n({ children: i }) {
36
+ const [a, l] = _(() => e.template), [c, d] = _(e.components), h = {
37
+ Template: a,
38
+ updateTemplate: (m) => l(() => m),
39
39
  components: c,
40
- updateComponent: (h, f) => d((x) => ({ ...x, [h]: f }))
40
+ updateComponent: (m, f) => d((x) => ({ ...x, [m]: f }))
41
41
  };
42
- return /* @__PURE__ */ r.createElement(t.Provider, { value: g }, a);
42
+ return /* @__PURE__ */ r.createElement(t.Provider, { value: h }, i);
43
43
  }
44
- function o({ template: a, children: i }) {
45
- const { updateTemplate: l } = X(t);
44
+ function o({ template: i, children: a }) {
45
+ const { updateTemplate: l } = Q(t);
46
46
  return L(() => {
47
- a && l(a);
48
- }, [a]), /* @__PURE__ */ r.createElement(r.Fragment, null, i);
47
+ i && l(i);
48
+ }, [i]), /* @__PURE__ */ r.createElement(r.Fragment, null, a);
49
49
  }
50
- function s({ children: a }) {
51
- return /* @__PURE__ */ r.createElement(n, null, a);
50
+ function s({ children: i }) {
51
+ return /* @__PURE__ */ r.createElement(n, null, i);
52
52
  }
53
- return s.defaults = e, s.useContext = () => X(t), s.Context = t, s.Template = o, Object.keys(e.components).forEach((a) => {
54
- s[a] = function({
53
+ return s.defaults = e, s.useContext = () => Q(t), s.Context = t, s.Template = o, Object.keys(e.components).forEach((i) => {
54
+ s[i] = function({
55
55
  component: l
56
56
  }) {
57
- const { updateComponent: c } = X(t);
57
+ const { updateComponent: c } = Q(t);
58
58
  return L(() => {
59
- l && c(a, l);
59
+ l && c(i, l);
60
60
  }, [l]), null;
61
61
  };
62
62
  }), s;
63
63
  }
64
- function Kr(...e) {
64
+ function Zr(...e) {
65
65
  return function({ children: n }) {
66
66
  return e.reduce((o, s) => /* @__PURE__ */ r.createElement(s, null, o), n);
67
67
  };
68
68
  }
69
69
  function ut() {
70
70
  }
71
- function Zr() {
71
+ function Yr() {
72
72
  const e = /iPad|iPhone|iPod/.test(navigator.userAgent), t = /Android/.test(navigator.userAgent);
73
73
  return e || t;
74
74
  }
75
- function Yr(e) {
75
+ function qr(e) {
76
76
  let t = 0;
77
77
  for (let n = 0; n < e.length; n++)
78
78
  t = (t << 5) - t + e.charCodeAt(n), t |= 0;
@@ -104,15 +104,15 @@ const Vt = (e) => {
104
104
  return ((t = e.extendedMessagePayload) == null ? void 0 : t.bot_message_type) === "generated";
105
105
  },
106
106
  checkExtendedFieldPresence(e) {
107
- const t = e.extendedMessagePayload || {}, n = (i) => i.some((l) => typeof t[l] < "u"), o = n(ot.ui), s = n(ot.trail), a = n(ot.marking);
108
- return { ui: o, trail: s, marking: a };
107
+ const t = e.extendedMessagePayload || {}, n = (a) => a.some((l) => typeof t[l] < "u"), o = n(ot.ui), s = n(ot.trail), i = n(ot.marking);
108
+ return { ui: o, trail: s, marking: i };
109
109
  },
110
110
  shouldScrollToBottom(e, t, n = !1) {
111
111
  if ((e.isUserMessage() || e.isFileMessage() || e.isMultipleFilesMessage()) && e.sender.userId === t) {
112
112
  if (this.isGeneratedMessage(e) && this.isStreaming(e))
113
113
  return !0;
114
- const { ui: a, trail: i, marking: l } = this.checkExtendedFieldPresence(e);
115
- return a ? !(!n && l) : !!(n && (i || l));
114
+ const { ui: i, trail: a, marking: l } = this.checkExtendedFieldPresence(e);
115
+ return i ? !(!n && l) : !!(n && (a || l));
116
116
  }
117
117
  return !0;
118
118
  }
@@ -120,20 +120,20 @@ const Vt = (e) => {
120
120
  ui: ["suggested_replies", "cta_button", "message_template", "csat"],
121
121
  trail: ["groundedness", "manual", "function_calls"],
122
122
  marking: ["is_hallucination", "is_moderated", "flagged_types"]
123
- }, qr = "1.3.0", Ee = "sb-agent", Jr = qr, st = `@${Ee}`, Wt = ({ appId: e, aiAgentId: t, storage: n }) => {
123
+ }, Jr = "1.3.2", Ee = "sb-agent", Xr = Jr, st = `@${Ee}`, Wt = ({ appId: e, aiAgentId: t, storage: n }) => {
124
124
  const o = {
125
125
  templateBase: `${st}-template`,
126
126
  template: (s) => `${o.templateBase}/templates/${s}`,
127
127
  templateToken: () => `${o.templateBase}-template/message-template/tokens`,
128
128
  messengerSession: (s) => {
129
- const a = Yr(`${e}/${t}/${s}`);
130
- return `${st}-udata/${a}`;
129
+ const i = qr(`${e}/${t}/${s}`);
130
+ return `${st}-udata/${i}`;
131
131
  },
132
132
  anonUserSession: () => `${st}-session/${e}/${t}`
133
133
  };
134
134
  return {
135
135
  template: {
136
- set: (s, a) => n.set(o.template(s), a),
136
+ set: (s, i) => n.set(o.template(s), i),
137
137
  get: (s) => n.get(o.template(s)),
138
138
  setCachedToken: (s) => n.set(o.templateToken(), s),
139
139
  getCachedToken: () => n.get(o.templateToken()),
@@ -144,16 +144,16 @@ const Vt = (e) => {
144
144
  messenger: {
145
145
  getSettings: (s) => {
146
146
  try {
147
- const a = n.get(o.messengerSession(s));
148
- return a ? JSON.parse(a) : null;
147
+ const i = n.get(o.messengerSession(s));
148
+ return i ? JSON.parse(i) : null;
149
149
  } catch {
150
150
  return null;
151
151
  }
152
152
  },
153
- setSettings: (s, a) => {
153
+ setSettings: (s, i) => {
154
154
  try {
155
- const i = JSON.stringify(a);
156
- n.set(o.messengerSession(s), i);
155
+ const a = JSON.stringify(i);
156
+ n.set(o.messengerSession(s), a);
157
157
  } catch {
158
158
  return;
159
159
  }
@@ -168,8 +168,8 @@ const Vt = (e) => {
168
168
  },
169
169
  setAnonUser: (s) => {
170
170
  try {
171
- const a = JSON.stringify(s);
172
- n.set(o.anonUserSession(), a);
171
+ const i = JSON.stringify(s);
172
+ n.set(o.anonUserSession(), i);
173
173
  } catch {
174
174
  return;
175
175
  }
@@ -189,12 +189,12 @@ class _n {
189
189
  this.logger = t, this.subscribers = {};
190
190
  }
191
191
  async send(t) {
192
- const n = Xr(), o = this.subscribers[t.type];
192
+ const n = Qr(), o = this.subscribers[t.type];
193
193
  if (o) {
194
194
  this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`, t.payload);
195
- const s = o.map((a) => a(t.payload));
196
- await Promise.all(s).catch((a) => {
197
- this.logger.error(`messenger.dispatcher: error in callback for command: ${t.type}`, a);
195
+ const s = o.map((i) => i(t.payload));
196
+ await Promise.all(s).catch((i) => {
197
+ this.logger.error(`messenger.dispatcher: error in callback for command: ${t.type}`, i);
198
198
  });
199
199
  }
200
200
  return n.resolve(), n.promise;
@@ -206,7 +206,7 @@ class _n {
206
206
  this.subscribers[t] && (this.subscribers[t] = this.subscribers[t].filter((o) => o !== n));
207
207
  }
208
208
  }
209
- const Xr = () => {
209
+ const Qr = () => {
210
210
  let e = ut, t = ut;
211
211
  return { promise: new Promise((o, s) => {
212
212
  e = o, t = s;
@@ -236,76 +236,80 @@ class Tn {
236
236
  function Gt(e, t, n) {
237
237
  const o = yr.init({
238
238
  appId: e,
239
- modules: [new Pr(), new Lr()],
239
+ modules: [new Br(), new Rr()],
240
240
  localCacheEnabled: !0,
241
+ options: new _r({ typingIndicatorInvalidateTime: 3e4 }),
241
242
  ...n
242
243
  });
243
244
  return o.addSendbirdExtensions(
244
- [{ version: Jr, product: _r.AI_AGENT, platform: t.platform }],
245
+ [{ version: Xr, product: Sr.AI_AGENT, platform: t.platform }],
245
246
  { platform: t.deviceOSPlatform, version: t.deviceOSVersion },
246
247
  t.customData
247
248
  ) || console.warn("Invalid Sendbird Extensions", t), o;
248
249
  }
249
250
  const {
250
- Provider: Qr,
251
+ Provider: eo,
251
252
  useContext: ue
252
253
  } = G("AIAgent");
253
- function eo({
254
+ function to({
254
255
  appId: e,
255
256
  aiAgentId: t,
256
257
  keyValueStorage: n,
257
258
  language: o,
258
259
  countryCode: s,
259
- context: a,
260
- chatSDK: i,
261
- chatParams: l,
262
- children: c,
263
- logger: d,
264
- dispatcher: g,
265
- extensions: h = {
266
- platform: Sr.JS,
267
- deviceOSPlatform: Zr() ? Ht.MOBILE_WEB : Ht.WEB
260
+ context: i,
261
+ queryParams: a,
262
+ chatSDK: l,
263
+ chatParams: c,
264
+ children: d,
265
+ logger: h,
266
+ dispatcher: m,
267
+ extensions: f = {
268
+ platform: Tr.JS,
269
+ deviceOSPlatform: Yr() ? Ht.MOBILE_WEB : Ht.WEB
268
270
  }
269
271
  }) {
270
- const [f, x] = _(() => {
271
- const b = d ?? new Tn(Sn.WARN), E = g ?? new _n(b);
272
+ const [x, E] = _(() => {
273
+ const b = h ?? new Tn(Sn.WARN), g = m ?? new _n(b);
272
274
  return {
273
275
  appId: e,
274
276
  aiAgentId: t,
275
277
  language: o,
276
278
  countryCode: s,
277
- context: a,
279
+ context: i,
280
+ queryParams: a,
278
281
  keyValueStorage: n,
279
282
  logger: b,
280
- dispatcher: E,
281
- chatSDK: i ?? Gt(e, h, l),
283
+ dispatcher: g,
284
+ chatSDK: l ?? Gt(e, f, c),
282
285
  cache: Wt({ appId: e, aiAgentId: t, storage: n })
283
286
  };
284
287
  });
285
288
  return L(() => {
286
- x((b) => {
287
- let E = b.logger, m = b.dispatcher, C = b.chatSDK;
288
- return d && d !== b.logger && (E = d), g && g !== b.dispatcher && (m = g), i && i !== b.chatSDK ? C = i : !i && b.chatSDK.appId !== e && (C = Gt(e, h, { newInstance: !0, ...l })), {
289
+ E((b) => {
290
+ let g = b.logger, C = b.dispatcher, v = b.chatSDK;
291
+ return h && h !== b.logger && (g = h), m && m !== b.dispatcher && (C = m), l && l !== b.chatSDK ? v = l : !l && b.chatSDK.appId !== e && (v = Gt(e, f, { newInstance: !0, ...c })), {
289
292
  ...b,
290
293
  appId: e,
291
294
  aiAgentId: t,
292
295
  keyValueStorage: n,
293
296
  language: o,
294
297
  countryCode: s,
295
- context: a,
296
- logger: E,
297
- dispatcher: m,
298
- chatSDK: C,
298
+ context: i,
299
+ queryParams: a,
300
+ logger: g,
301
+ dispatcher: C,
302
+ chatSDK: v,
299
303
  cache: Wt({ appId: e, aiAgentId: t, storage: n })
300
304
  };
301
305
  });
302
- }, [e, t, o, s, a, d, g, i]), L(() => () => {
303
- f.chatSDK.disconnectWebSocket();
304
- }, [f.chatSDK]), /* @__PURE__ */ r.createElement(Qr, { value: f }, c);
306
+ }, [e, t, o, s, i, h, m, l]), L(() => () => {
307
+ x.chatSDK.disconnectWebSocket();
308
+ }, [x.chatSDK]), /* @__PURE__ */ r.createElement(eo, { value: x }, d);
305
309
  }
306
- const to = (e, t, n) => Dr(e, t, { ...n, strictStreamingOrder: !0 });
310
+ const no = (e, t, n) => Nr(e, t, { ...n, strictStreamingOrder: !0 });
307
311
  var mt = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))(mt || {});
308
- class no {
312
+ class ro {
309
313
  constructor(t = {}) {
310
314
  this.payload = t;
311
315
  }
@@ -313,29 +317,29 @@ class no {
313
317
  return JSON.stringify({ type: this.type, payload: this.payload });
314
318
  }
315
319
  }
316
- const ro = {
317
- CloseConversation: (e) => new oo(e)
320
+ const oo = {
321
+ CloseConversation: (e) => new so(e)
318
322
  };
319
- class oo extends no {
323
+ class so extends ro {
320
324
  constructor() {
321
325
  super(...arguments), this.type = "conv.close";
322
326
  }
323
327
  }
324
328
  const {
325
- Provider: so
329
+ Provider: io
326
330
  } = G("AIAgentConversation");
327
- function io({
331
+ function ao({
328
332
  children: e,
329
333
  channelUrl: t,
330
334
  onChannelDeleted: n,
331
335
  onMessagesReceived: o,
332
336
  onMessagesUpdated: s,
333
- onConversationClosedViaDispatcher: a,
334
- onBeforeSendMessage: i,
337
+ onConversationClosedViaDispatcher: i,
338
+ onBeforeSendMessage: a,
335
339
  onAfterSendMessage: l = ut
336
340
  }) {
337
- var m;
338
- const { chatSDK: c, logger: d, dispatcher: g } = ue(), { channel: h, channelFetchError: f, fetchChannel: x } = ao(t), b = to(c, h, {
341
+ var g;
342
+ const { chatSDK: c, logger: d, dispatcher: h } = ue(), { channel: m, channelFetchError: f, fetchChannel: x } = lo(t), E = no(c, m, {
339
343
  shouldCountNewMessages: () => !1,
340
344
  onChannelDeleted: n,
341
345
  onMessagesReceived: (C) => o == null ? void 0 : o(C),
@@ -345,48 +349,48 @@ function io({
345
349
  L(() => {
346
350
  const C = async (v) => {
347
351
  const S = typeof (v == null ? void 0 : v.channelUrl) == "string";
348
- h && S && v.channelUrl !== h.url || (d.debug("conversation.dispatcher: try to close conversation", h), h != null && h.conversation && h.conversation.status === W.OPEN && (await h.closeConversation(), a == null || a()));
352
+ m && S && v.channelUrl !== m.url || (d.debug("conversation.dispatcher: try to close conversation", m), m != null && m.conversation && m.conversation.status === W.OPEN && (await m.closeConversation(), i == null || i()));
349
353
  };
350
- return g.subscribe(mt.ConversationClose, C), () => {
351
- g.unsubscribe(mt.ConversationClose, C);
354
+ return h.subscribe(mt.ConversationClose, C), () => {
355
+ h.unsubscribe(mt.ConversationClose, C);
352
356
  };
353
- }, [g, (m = h == null ? void 0 : h.conversation) == null ? void 0 : m.status, a]);
354
- const E = {
355
- conversation: (h == null ? void 0 : h.conversation) ?? void 0,
357
+ }, [h, (g = m == null ? void 0 : m.conversation) == null ? void 0 : g.status, i]);
358
+ const b = {
359
+ conversation: (m == null ? void 0 : m.conversation) ?? void 0,
356
360
  channelSource: {
357
- channel: h,
361
+ channel: m,
358
362
  error: f,
359
363
  refetch: () => x()
360
364
  },
361
365
  messageSource: {
362
- messages: b.messages,
363
- initialized: b.initialized,
364
- loadPrevious: () => b.loadPrevious(),
365
- loadNext: () => b.loadNext(),
366
+ messages: E.messages,
367
+ initialized: E.initialized,
368
+ loadPrevious: () => E.loadPrevious(),
369
+ loadNext: () => E.loadNext(),
366
370
  sendUserMessage: async (C) => {
367
371
  var S;
368
- if (((S = h == null ? void 0 : h.conversation) == null ? void 0 : S.status) === W.CLOSED)
372
+ if (((S = m == null ? void 0 : m.conversation) == null ? void 0 : S.status) === W.CLOSED)
369
373
  throw new Error("Conversation is closed");
370
- i && (C = await i(C));
371
- const v = await b.sendUserMessage(C, l);
374
+ a && (C = await a(C));
375
+ const v = await E.sendUserMessage(C, l);
372
376
  return l == null || l(v), v;
373
377
  },
374
378
  sendFileMessage: async (C) => {
375
379
  var S;
376
- if (((S = h == null ? void 0 : h.conversation) == null ? void 0 : S.status) === W.CLOSED)
380
+ if (((S = m == null ? void 0 : m.conversation) == null ? void 0 : S.status) === W.CLOSED)
377
381
  throw new Error("Conversation is closed");
378
- i && (C = await i(C));
379
- const v = await b.sendFileMessage(C, l);
382
+ a && (C = await a(C));
383
+ const v = await E.sendFileMessage(C, l);
380
384
  return l == null || l(v), v;
381
385
  }
382
386
  }
383
387
  };
384
- return /* @__PURE__ */ r.createElement(so, { value: E }, e);
388
+ return /* @__PURE__ */ r.createElement(io, { value: b }, e);
385
389
  }
386
- function ao(e) {
387
- const { chatSDK: t, logger: n } = ue(), [o, s] = _(void 0), [a, i] = _(void 0);
390
+ function lo(e) {
391
+ const { chatSDK: t, logger: n } = ue(), [o, s] = _(void 0), [i, a] = _(void 0);
388
392
  async function l() {
389
- if (n.debug("conversation.fetchChannel: start"), s(void 0), i(void 0), e)
393
+ if (n.debug("conversation.fetchChannel: start"), s(void 0), a(void 0), e)
390
394
  try {
391
395
  n.debug("conversation.fetchChannel: get channel", e);
392
396
  const c = await t.groupChannel.getChannel(e);
@@ -394,33 +398,33 @@ function ao(e) {
394
398
  const d = new Je({ onReconnectSucceeded: () => c.refresh() });
395
399
  t.addConnectionHandler(`sba-refresh-${e}`, d), n.debug("conversation.fetchChannel: fetched channel", c);
396
400
  } catch (c) {
397
- c instanceof Tr && i(c), n.error("conversation.fetchChannel: error", c);
401
+ c instanceof wr && a(c), n.error("conversation.fetchChannel: error", c);
398
402
  }
399
403
  }
400
404
  return L(() => {
401
405
  l();
402
406
  }, [e, t]), {
403
407
  channel: o,
404
- channelFetchError: a,
408
+ channelFetchError: i,
405
409
  fetchChannel: l
406
410
  };
407
411
  }
408
- class lo {
412
+ class co {
409
413
  /**
410
414
  * Creates a new ConversationListCollection instance.
411
415
  * @param sdk - The Sendbird Chat SDK instance
412
416
  * @param params - Configuration parameters for the collection
413
417
  */
414
418
  constructor(t, { filter: n, limit: o = 20 }) {
415
- var s, a, i, l, c;
419
+ var s, i, a, l, c;
416
420
  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({
417
421
  aiAgentChannelFilter: (s = this.filter) == null ? void 0 : s.aiAgentChannelFilter,
418
- aiAgentConversationStatusFilter: (a = this.filter) == null ? void 0 : a.aiAgentConversationStatusFilter,
419
- aiAgentIds: (i = this.filter) == null ? void 0 : i.aiAgentIds,
422
+ aiAgentConversationStatusFilter: (i = this.filter) == null ? void 0 : i.aiAgentConversationStatusFilter,
423
+ aiAgentIds: (a = this.filter) == null ? void 0 : a.aiAgentIds,
420
424
  deskChannelFilter: (l = this.filter) == null ? void 0 : l.deskChannelFilter,
421
425
  pinnedChannelUrls: (c = this.filter) == null ? void 0 : c.pinnedChannelUrls,
422
426
  limit: this._limit
423
- }), this._token = "", this._timestamp = Number.MAX_SAFE_INTEGER, this._isSyncing = !1, this._channelHandler = new Br({
427
+ }), this._token = "", this._timestamp = Number.MAX_SAFE_INTEGER, this._isSyncing = !1, this._channelHandler = new Fr({
424
428
  onChannelChanged: (d) => {
425
429
  d.isGroupChannel() && (this._query.belongsTo(d) ? this._addChannelsToView([d], !1) : this._removeChannelsFromView([d.url]));
426
430
  },
@@ -444,10 +448,10 @@ class lo {
444
448
  * @param channels - Array of channels to analyze
445
449
  */
446
450
  _setDefaultChangelogsSyncTimestamp(t) {
447
- var a, i;
448
- const n = new Set(((a = this.filter) == null ? void 0 : a.pinnedChannelUrls) ?? []), o = t.find((l) => !n.has(l.url));
451
+ var i, a;
452
+ const n = new Set(((i = this.filter) == null ? void 0 : i.pinnedChannelUrls) ?? []), o = t.find((l) => !n.has(l.url));
449
453
  let s;
450
- o ? s = ((i = o.lastMessage) == null ? void 0 : i.createdAt) ?? o.createdAt : s = this._query.lastResponseAt, this._timestamp > s && (this._timestamp = s);
454
+ o ? s = ((a = o.lastMessage) == null ? void 0 : a.createdAt) ?? o.createdAt : s = this._query.lastResponseAt, this._timestamp > s && (this._timestamp = s);
451
455
  }
452
456
  /**
453
457
  * Synchronizes channel changelogs to keep the collection up-to-date.
@@ -474,20 +478,20 @@ class lo {
474
478
  */
475
479
  _upsertPinnedChannelsToArray(t) {
476
480
  var l;
477
- const n = ((l = this.filter) == null ? void 0 : l.pinnedChannelUrls) ?? [], o = new Map(n.map((c, d) => [c, d])), s = [], a = [], i = [];
481
+ const n = ((l = this.filter) == null ? void 0 : l.pinnedChannelUrls) ?? [], o = new Map(n.map((c, d) => [c, d])), s = [], i = [], a = [];
478
482
  for (const c of t) {
479
483
  if (!this._query.belongsTo(c)) {
480
- i.push(c.url);
484
+ a.push(c.url);
481
485
  continue;
482
486
  }
483
487
  const d = o.get(c.url);
484
488
  if (d === void 0) continue;
485
- const g = gt(this._pinnedChannels, c);
486
- g >= 0 ? (this._pinnedChannels.splice(g, 1), a.push(c)) : s.push(c);
487
- const f = this._pinnedChannels.findIndex((b) => (o.get(b.url) ?? 1 / 0) > d), x = f === -1 ? this._pinnedChannels.length : f;
489
+ const h = gt(this._pinnedChannels, c);
490
+ h >= 0 ? (this._pinnedChannels.splice(h, 1), i.push(c)) : s.push(c);
491
+ const f = this._pinnedChannels.findIndex((E) => (o.get(E.url) ?? 1 / 0) > d), x = f === -1 ? this._pinnedChannels.length : f;
488
492
  this._pinnedChannels.splice(x, 0, c);
489
493
  }
490
- return { addedChannels: s, updatedChannels: a, unmatchedChannelUrls: i };
494
+ return { addedChannels: s, updatedChannels: i, unmatchedChannelUrls: a };
491
495
  }
492
496
  /**
493
497
  * Upserts regular (non-pinned) channels with time-based sorting.
@@ -496,18 +500,18 @@ class lo {
496
500
  * @returns Object containing added, updated channels and unmatched URLs
497
501
  */
498
502
  _upsertRegularChannelsToArray(t, n = !1) {
499
- const o = [], s = [], a = [];
500
- for (const i of t) {
501
- if (!this._query.belongsTo(i)) {
502
- o.push(i.url);
503
+ const o = [], s = [], i = [];
504
+ for (const a of t) {
505
+ if (!this._query.belongsTo(a)) {
506
+ o.push(a.url);
503
507
  continue;
504
508
  }
505
- const l = gt(this._channels, i), c = l < 0;
509
+ const l = gt(this._channels, a), c = l < 0;
506
510
  !c && this._channels.splice(l, 1);
507
- const g = co(this._channels, i, this._order).place, h = g === this._channels.length;
508
- c ? h ? (n || !this.hasMore) && (this._channels.push(i), s.push(i)) : (this._channels.splice(g, 0, i), s.push(i)) : (this._channels.splice(g, 0, i), a.push(i));
511
+ const h = uo(this._channels, a, this._order).place, m = h === this._channels.length;
512
+ c ? m ? (n || !this.hasMore) && (this._channels.push(a), s.push(a)) : (this._channels.splice(h, 0, a), s.push(a)) : (this._channels.splice(h, 0, a), i.push(a));
509
513
  }
510
- return { addedChannels: s, updatedChannels: a, unmatchedChannelUrls: o };
514
+ return { addedChannels: s, updatedChannels: i, unmatchedChannelUrls: o };
511
515
  }
512
516
  /**
513
517
  * Adds or updates channels in the collection, separating pinned and non-pinned channels.
@@ -515,19 +519,19 @@ class lo {
515
519
  * @param forceAppend - Whether to force append channels at the end
516
520
  */
517
521
  _addChannelsToView(t, n = !1) {
518
- var h, f, x, b, E;
519
- const o = new Set(((h = this.filter) == null ? void 0 : h.pinnedChannelUrls) ?? []), s = [], a = [];
520
- for (const m of t)
521
- o.has(m.url) ? s.push(m) : a.push(m);
522
- const i = this._upsertPinnedChannelsToArray(s), l = this._upsertRegularChannelsToArray(a, n), c = i.addedChannels.concat(l.addedChannels), d = i.updatedChannels.concat(l.updatedChannels), g = i.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);
523
- c.length > 0 && ((x = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsAdded) == null || x.call(f, {}, c)), d.length > 0 && ((E = (b = this._collectionEventHandler) == null ? void 0 : b.onChannelsUpdated) == null || E.call(b, {}, d)), g.length > 0 && this._removeChannelsFromView(g);
522
+ var m, f, x, E, b;
523
+ const o = new Set(((m = this.filter) == null ? void 0 : m.pinnedChannelUrls) ?? []), s = [], i = [];
524
+ for (const g of t)
525
+ o.has(g.url) ? s.push(g) : i.push(g);
526
+ const a = this._upsertPinnedChannelsToArray(s), l = this._upsertRegularChannelsToArray(i, n), c = a.addedChannels.concat(l.addedChannels), d = a.updatedChannels.concat(l.updatedChannels), h = a.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);
527
+ c.length > 0 && ((x = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsAdded) == null || x.call(f, {}, c)), d.length > 0 && ((b = (E = this._collectionEventHandler) == null ? void 0 : E.onChannelsUpdated) == null || b.call(E, {}, d)), h.length > 0 && this._removeChannelsFromView(h);
524
528
  }
525
529
  /**
526
530
  * Removes channels from the collection by their URLs.
527
531
  * @param channelUrls - Array of channel URLs to remove
528
532
  */
529
533
  _removeChannelsFromView(t) {
530
- var s, a, i;
534
+ var s, i, a;
531
535
  const n = new Set(((s = this.filter) == null ? void 0 : s.pinnedChannelUrls) ?? []), o = [];
532
536
  for (const l of t)
533
537
  if (n.has(l)) {
@@ -537,7 +541,7 @@ class lo {
537
541
  const c = this._channels.findIndex((d) => d.url === l);
538
542
  c >= 0 && (o.push(l), this._channels.splice(c, 1));
539
543
  }
540
- o.length > 0 && ((i = (a = this._collectionEventHandler) == null ? void 0 : a.onChannelsDeleted) == null || i.call(a, {}, o));
544
+ o.length > 0 && ((a = (i = this._collectionEventHandler) == null ? void 0 : i.onChannelsDeleted) == null || a.call(i, {}, o));
541
545
  }
542
546
  /**
543
547
  * Gets all channels in the collection.
@@ -581,20 +585,20 @@ class lo {
581
585
  this._isDisposed || (this._isDisposed = !0, this._collectionEventHandler = void 0, this._sdk.removeConnectionHandler(this._handlerId), this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId), this._pinnedChannels.length = 0, this._channels.length = 0);
582
586
  }
583
587
  }
584
- const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), co = (e, t, n) => {
588
+ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), uo = (e, t, n) => {
585
589
  if (e.length > 0) {
586
590
  const o = gt(e, t);
587
- let s = 0, a = e.length - 1, i = Math.floor((s + a) / 2);
588
- for (; s < a; ) {
589
- const c = jt(e[i], t, n);
591
+ let s = 0, i = e.length - 1, a = Math.floor((s + i) / 2);
592
+ for (; s < i; ) {
593
+ const c = jt(e[a], t, n);
590
594
  if (c > 0)
591
- a = i, i = Math.floor((s + a) / 2);
595
+ i = a, a = Math.floor((s + i) / 2);
592
596
  else if (c < 0)
593
- s = i + 1, i = Math.floor((s + a) / 2);
597
+ s = a + 1, a = Math.floor((s + i) / 2);
594
598
  else
595
- return { place: i, oldPosition: o };
599
+ return { place: a, oldPosition: o };
596
600
  }
597
- return { place: jt(e[i], t, n) >= 0 ? i : i + 1, oldPosition: o };
601
+ return { place: jt(e[a], t, n) >= 0 ? a : a + 1, oldPosition: o };
598
602
  }
599
603
  return { place: e.length, oldPosition: -1 };
600
604
  }, jt = (e, t, n) => {
@@ -608,14 +612,14 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), co = (e, t, n) => {
608
612
  return 0;
609
613
  }
610
614
  };
611
- function uo(e, t) {
612
- var b, E, m, C, v, S, k, F;
613
- const n = bn(), [o, s] = _(!1), [a, i] = _(null), [l, c] = _([]), [d, g] = _(null), h = N(!1), f = R(async () => {
614
- if (!h.current && e.currentUser) {
615
- h.current = !0, s(!1), i(null), c([]);
615
+ function mo(e, t) {
616
+ var E, b, g, C, v, S, k, F;
617
+ const n = bn(), [o, s] = _(!1), [i, a] = _(null), [l, c] = _([]), [d, h] = _(null), m = N(!1), f = R(async () => {
618
+ if (!m.current && e.currentUser) {
619
+ m.current = !0, s(!1), a(null), c([]);
616
620
  try {
617
621
  d == null || d.dispose();
618
- const $ = new lo(e, t);
622
+ const $ = new co(e, t);
619
623
  $.setConversationListCollectionHandler({
620
624
  onChannelsAdded: () => {
621
625
  c($.channels);
@@ -626,17 +630,17 @@ function uo(e, t) {
626
630
  onChannelsDeleted: () => {
627
631
  c($.channels);
628
632
  }
629
- }), await $.loadMore(), g($), i(null);
633
+ }), await $.loadMore(), h($), a(null);
630
634
  } catch ($) {
631
- g(null), i($);
635
+ h(null), a($);
632
636
  } finally {
633
- s(!0), h.current = !1;
637
+ s(!0), m.current = !1;
634
638
  }
635
639
  }
636
640
  }, [
637
641
  e,
638
- (b = t.filter) == null ? void 0 : b.aiAgentChannelFilter,
639
- (m = (E = t.filter) == null ? void 0 : E.aiAgentConversationStatusFilter) == null ? void 0 : m.join(),
642
+ (E = t.filter) == null ? void 0 : E.aiAgentChannelFilter,
643
+ (g = (b = t.filter) == null ? void 0 : b.aiAgentConversationStatusFilter) == null ? void 0 : g.join(),
640
644
  (v = (C = t.filter) == null ? void 0 : C.aiAgentIds) == null ? void 0 : v.join(),
641
645
  (S = t.filter) == null ? void 0 : S.deskChannelFilter,
642
646
  (F = (k = t.filter) == null ? void 0 : k.pinnedChannelUrls) == null ? void 0 : F.join(),
@@ -646,39 +650,42 @@ function uo(e, t) {
646
650
  try {
647
651
  await d.loadMore();
648
652
  } catch ($) {
649
- i($);
653
+ a($);
650
654
  }
651
655
  }, [d]);
652
656
  return L(() => (e.addConnectionHandler(n, new Je({ onConnected: () => f() })), () => e.removeConnectionHandler(n)), [e, n, f]), L(() => {
653
657
  f();
654
658
  }, [f]), L(() => () => {
655
- h.current = !1, d == null || d.dispose();
659
+ m.current = !1, d == null || d.dispose();
656
660
  }, [d]), {
657
661
  initialized: o,
658
- error: a,
662
+ error: i,
659
663
  channels: l,
660
664
  loadMore: x
661
665
  };
662
666
  }
663
667
  const {
664
- Provider: mo
668
+ Provider: go
665
669
  } = G("AIAgentConversationList");
666
- function go({ conversationListFilter: e, children: t }) {
667
- const { chatSDK: n, aiAgentId: o } = ue(), s = uo(n, {
668
- filter: {
669
- aiAgentIds: [o],
670
- aiAgentConversationStatusFilter: [W.CLOSED],
671
- ...e
672
- }
673
- }), a = {
670
+ function ho({
671
+ conversationListLimit: e,
672
+ conversationListFilter: t,
673
+ children: n
674
+ }) {
675
+ var m, f;
676
+ const { chatSDK: o, aiAgentId: s, queryParams: i } = ue(), a = { aiAgentIds: [s], aiAgentConversationStatusFilter: [W.CLOSED] }, l = e ?? ((m = i == null ? void 0 : i.conversationListParams) == null ? void 0 : m.limit), c = {
677
+ ...a,
678
+ ...(f = i == null ? void 0 : i.conversationListParams) == null ? void 0 : f.filter,
679
+ ...t
680
+ }, d = mo(o, { limit: l, filter: c }), h = {
674
681
  listSource: {
675
- initialized: s.initialized,
676
- error: s.error ?? void 0,
677
- channels: s.channels,
678
- loadMore: () => s.loadMore()
682
+ initialized: d.initialized,
683
+ error: d.error ?? void 0,
684
+ channels: d.channels,
685
+ loadMore: () => d.loadMore()
679
686
  }
680
687
  };
681
- return /* @__PURE__ */ r.createElement(mo, { value: a }, t);
688
+ return /* @__PURE__ */ r.createElement(go, { value: h }, n);
682
689
  }
683
690
  const ht = {
684
691
  DEFAULT_BOT_MSG_BG: "#eeeeee",
@@ -688,7 +695,7 @@ const ht = {
688
695
  function wn(e) {
689
696
  return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
690
697
  }
691
- function ho(e) {
698
+ function po(e) {
692
699
  const t = wn(e);
693
700
  return [
694
701
  parseInt(t.slice(1, 3), 16),
@@ -699,33 +706,33 @@ function ho(e) {
699
706
  // b
700
707
  ];
701
708
  }
702
- function po(e) {
709
+ function fo(e) {
703
710
  return `#${e.map((t) => t.toString(16).padStart(2, "0")).join("")}`;
704
711
  }
705
- function fo(e, t, n) {
712
+ function bo(e, t, n) {
706
713
  e /= 255, t /= 255, n /= 255;
707
- const o = Math.max(e, t, n), s = Math.min(e, t, n), a = o - s;
708
- let i = 0, l = 0;
714
+ const o = Math.max(e, t, n), s = Math.min(e, t, n), i = o - s;
715
+ let a = 0, l = 0;
709
716
  const c = (o + s) / 2;
710
- return o !== s && (l = c > 0.5 ? a / (2 - o - s) : a / (o + s)), o === e ? i = (t - n) / a + (t < n ? 6 : 0) : o === t ? i = (n - e) / a + 2 : o === n && (i = (e - t) / a + 4), i /= 6, [i, l, c];
717
+ return o !== s && (l = c > 0.5 ? i / (2 - o - s) : i / (o + s)), o === e ? a = (t - n) / i + (t < n ? 6 : 0) : o === t ? a = (n - e) / i + 2 : o === n && (a = (e - t) / i + 4), a /= 6, [a, l, c];
711
718
  }
712
- function bo(e, t, n) {
713
- let o, s, a;
719
+ function Eo(e, t, n) {
720
+ let o, s, i;
714
721
  if (t === 0)
715
- o = s = a = n;
722
+ o = s = i = n;
716
723
  else {
717
- const i = function(g, h, f) {
718
- return f < 0 && (f += 1), f > 1 && (f -= 1), f < 0.16666666666666666 ? g + (h - g) * 6 * f : f < 0.5 ? h : f < 0.6666666666666666 ? g + (h - g) * (0.6666666666666666 - f) * 6 : g;
724
+ const a = function(h, m, f) {
725
+ return f < 0 && (f += 1), f > 1 && (f -= 1), f < 0.16666666666666666 ? h + (m - h) * 6 * f : f < 0.5 ? m : f < 0.6666666666666666 ? h + (m - h) * (0.6666666666666666 - f) * 6 : h;
719
726
  }, l = n < 0.5 ? n * (1 + t) : n + t - n * t, c = 2 * n - l;
720
- o = i(c, l, e + 1 / 3), s = i(c, l, e), a = i(c, l, e - 1 / 3);
727
+ o = a(c, l, e + 1 / 3), s = a(c, l, e), i = a(c, l, e - 1 / 3);
721
728
  }
722
- return [Math.round(o * 255), Math.round(s * 255), Math.round(a * 255)];
729
+ return [Math.round(o * 255), Math.round(s * 255), Math.round(i * 255)];
723
730
  }
724
731
  function Be(e, t, n) {
725
- const [o, s, a] = ho(e), [i, l, c] = fo(o, s, a), d = Math.max(0, Math.min(1, c * t)), g = Math.max(0, Math.min(1, l * n)), [h, f, x] = bo(i, g, d);
726
- return po([Math.round(h), Math.round(f), Math.round(x)]);
732
+ const [o, s, i] = po(e), [a, l, c] = bo(o, s, i), d = Math.max(0, Math.min(1, c * t)), h = Math.max(0, Math.min(1, l * n)), [m, f, x] = Eo(a, h, d);
733
+ return fo([Math.round(m), Math.round(f), Math.round(x)]);
727
734
  }
728
- function Eo(e, t = "light") {
735
+ function xo(e, t = "light") {
729
736
  return {
730
737
  extraDark: Be(e, 0.6, 1.2),
731
738
  dark: Be(e, 0.85, 1.1),
@@ -735,10 +742,10 @@ function Eo(e, t = "light") {
735
742
  };
736
743
  }
737
744
  function pt(e) {
738
- const t = wn(e), n = 149, o = +`0x${t[1]}${t[2]}`, s = +`0x${t[3]}${t[4]}`, a = +`0x${t[5]}${t[6]}`;
739
- return o * 0.299 + s * 0.587 + a * 0.114 > n ? ht.BLACK : ht.WHITE;
745
+ const t = wn(e), n = 149, o = +`0x${t[1]}${t[2]}`, s = +`0x${t[3]}${t[4]}`, i = +`0x${t[5]}${t[6]}`;
746
+ return o * 0.299 + s * 0.587 + i * 0.114 > n ? ht.BLACK : ht.WHITE;
740
747
  }
741
- function xo(e, t, n, o, s) {
748
+ function Co(e, t, n, o, s) {
742
749
  return {
743
750
  base: {
744
751
  primary: t,
@@ -767,7 +774,7 @@ function xo(e, t, n, o, s) {
767
774
  }
768
775
  };
769
776
  }
770
- const Co = (e, t, n, o, s) => ({
777
+ const vo = (e, t, n, o, s) => ({
771
778
  base: {
772
779
  primary: t,
773
780
  primaryContrastContent: n,
@@ -861,7 +868,7 @@ const Co = (e, t, n, o, s) => ({
861
868
  caption4: { fontSize: 11, fontWeight: 400 }
862
869
  };
863
870
  function Kt(e) {
864
- const t = vo(e), { colors: n, aiAgentColorVariables: o } = yo(e, t), s = So(e);
871
+ const t = yo(e), { colors: n, aiAgentColorVariables: o } = _o(e, t), s = To(e);
865
872
  return {
866
873
  selectedTheme: e.selectedTheme,
867
874
  palette: t,
@@ -870,57 +877,57 @@ function Kt(e) {
870
877
  typography: s
871
878
  };
872
879
  }
873
- function vo({ selectedTheme: e, palette: t, primary: n }) {
874
- const o = t != null && t.primary ? t.primary : n ? n === Fe.primary.main ? Fe.primary : Eo(n, e) : Fe.primary;
880
+ function yo({ selectedTheme: e, palette: t, primary: n }) {
881
+ const o = t != null && t.primary ? t.primary : n ? n === Fe.primary.main ? Fe.primary : xo(n, e) : Fe.primary;
875
882
  return {
876
883
  ...Fe,
877
884
  primary: o,
878
885
  ...t
879
886
  };
880
887
  }
881
- function yo({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, s) {
882
- const a = s.primary.main, i = t ?? pt(a), l = n ?? ht.DEFAULT_BOT_MSG_BG, c = o ?? pt(l);
888
+ function _o({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, s) {
889
+ const i = s.primary.main, a = t ?? pt(i), l = n ?? ht.DEFAULT_BOT_MSG_BG, c = o ?? pt(l);
883
890
  return {
884
- colors: (e === "light" ? xo : Co)(
891
+ colors: (e === "light" ? Co : vo)(
885
892
  s,
886
- a,
887
893
  i,
894
+ a,
888
895
  l,
889
896
  c
890
897
  ),
891
898
  aiAgentColorVariables: {
892
- primary_color: a,
899
+ primary_color: i,
893
900
  bot_message_bg_color: l,
894
- primary_contrast_color: i,
901
+ primary_contrast_color: a,
895
902
  bot_message_bg_contrast_color: c
896
903
  }
897
904
  };
898
905
  }
899
- function _o(e, t, n) {
906
+ function So(e, t, n) {
900
907
  const o = { ...e };
901
908
  return n.forEach((s) => {
902
- const a = t[s];
903
- a != null && (o[s] = a);
909
+ const i = t[s];
910
+ i != null && (o[s] = i);
904
911
  }), o;
905
912
  }
906
- function So({ typography: e }) {
913
+ function To({ typography: e }) {
907
914
  if (!e)
908
915
  return it;
909
916
  const t = { ...it };
910
917
  return Object.keys(e).forEach((n) => {
911
918
  const o = e[n];
912
919
  if (o && typeof o == "object") {
913
- const s = it[n], a = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
914
- t[n] = _o(s, o, a);
920
+ const s = it[n], i = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
921
+ t[n] = So(s, o, i);
915
922
  }
916
923
  }), t;
917
924
  }
918
925
  const {
919
- Provider: To,
926
+ Provider: wo,
920
927
  useContext: Ct
921
928
  } = G("AIAgentTheme");
922
- function wo({ logger: e, palette: t, typography: n, appearance: o, children: s }) {
923
- const [a, i] = _(
929
+ function Ao({ logger: e, palette: t, typography: n, appearance: o, children: s }) {
930
+ const [i, a] = _(
924
931
  () => Kt({
925
932
  selectedTheme: (o == null ? void 0 : o.theme) ?? "light",
926
933
  palette: t,
@@ -930,29 +937,29 @@ function wo({ logger: e, palette: t, typography: n, appearance: o, children: s }
930
937
  })
931
938
  ), l = R(
932
939
  (c, d) => {
933
- const g = (o == null ? void 0 : o.theme) ?? c, h = d == null ? void 0 : d(g), f = {
940
+ const h = (o == null ? void 0 : o.theme) ?? c, m = d == null ? void 0 : d(h), f = {
934
941
  primary: o == null ? void 0 : o.primaryColor,
935
942
  primaryContrast: void 0,
936
943
  botMessageBackground: o == null ? void 0 : o.botMessageBackgroundColor,
937
944
  botMessageBackgroundContrast: void 0
938
945
  };
939
- !f.primary && (h != null && h.primaryColor) && (f.primary = h.primaryColor, f.primaryContrast = h.primaryContrastColor), !f.botMessageBackground && (h != null && h.botMessageBackgroundColor) && (f.botMessageBackground = h.botMessageBackgroundColor, f.botMessageBackgroundContrast = h.botMessageBackgroundContrastColor);
940
- const x = Kt({ selectedTheme: g, palette: t, typography: n, ...f });
941
- i(x), e == null || e.info("theme.update:", g);
946
+ !f.primary && (m != null && m.primaryColor) && (f.primary = m.primaryColor, f.primaryContrast = m.primaryContrastColor), !f.botMessageBackground && (m != null && m.botMessageBackgroundColor) && (f.botMessageBackground = m.botMessageBackgroundColor, f.botMessageBackgroundContrast = m.botMessageBackgroundContrastColor);
947
+ const x = Kt({ selectedTheme: h, palette: t, typography: n, ...f });
948
+ a(x), e == null || e.info("theme.update:", h);
942
949
  },
943
950
  [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor, t, n, e]
944
951
  );
945
952
  return L(() => {
946
- (o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(a.selectedTheme);
947
- }, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(To, { value: { theme: a, updateTheme: l } }, s);
953
+ (o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(i.selectedTheme);
954
+ }, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(wo, { value: { theme: i, updateTheme: l } }, s);
948
955
  }
949
- function Ao() {
956
+ function ko() {
950
957
  const { chatSDK: e, logger: t } = ue(), n = R(
951
- async (s, a, i) => {
952
- if (t.debug("useChatConnection.connect: start, session", s.userId), a) {
953
- const l = new wr({
954
- ...a,
955
- onSessionTokenRequired: ko(a.onSessionTokenRequired, i)
958
+ async (s, i, a) => {
959
+ if (t.debug("useChatConnection.connect: start, session", s.userId), i) {
960
+ const l = new Ar({
961
+ ...i,
962
+ onSessionTokenRequired: Io(i.onSessionTokenRequired, a)
956
963
  });
957
964
  e.setSessionHandler(l);
958
965
  }
@@ -964,36 +971,36 @@ function Ao() {
964
971
  }, [e, t]);
965
972
  return { connect: n, disconnect: o };
966
973
  }
967
- function ko(e, t) {
974
+ function Io(e, t) {
968
975
  if (e)
969
976
  return async (n, o) => {
970
- new Promise((s, a) => e == null ? void 0 : e(s, a)).then((s) => {
977
+ new Promise((s, i) => e == null ? void 0 : e(s, i)).then((s) => {
971
978
  s && (t == null || t(s)), n(s);
972
979
  }).catch((s) => {
973
980
  o(s);
974
981
  });
975
982
  };
976
983
  }
977
- class Io {
984
+ class $o {
978
985
  constructor({ userId: t, authToken: n, sessionHandler: o }) {
979
986
  this.userId = t, this.authToken = n, this.sessionHandler = o;
980
987
  }
981
988
  }
982
989
  class Zt {
983
990
  }
984
- const $o = 24 * 60 * 60 * 1e3, Mo = (e) => {
991
+ const Mo = 24 * 60 * 60 * 1e3, Oo = (e) => {
985
992
  const { logger: t, cache: n } = ue(), o = () => {
986
- const a = n.messenger.getAnonUser();
987
- return a ? a.expireAt - $o <= Date.now() ? (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session expired, clear cache"), n.messenger.clear(a.userId), null) : (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session info detected"), a) : null;
993
+ const i = n.messenger.getAnonUser();
994
+ return i ? i.expireAt - Mo <= Date.now() ? (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session expired, clear cache"), n.messenger.clear(i.userId), null) : (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session info detected"), i) : null;
988
995
  }, s = () => {
989
996
  if (!e || e instanceof Zt)
990
997
  throw new Error("userSessionInfo must be an instance of ManualSessionInfo");
991
- const a = ["authToken", "sessionHandler"].filter((i) => !(i in e));
992
- return a.length > 0 && t.error(
993
- `useUserSessionCandidate.getManualSessionInfo: missing required keys in userSessionInfo: ${a.join(", ")}`
998
+ const i = ["authToken", "sessionHandler"].filter((a) => !(a in e));
999
+ return i.length > 0 && t.error(
1000
+ `useUserSessionCandidate.getManualSessionInfo: missing required keys in userSessionInfo: ${i.join(", ")}`
994
1001
  ), t.debug("useUserSessionCandidate.getManualSessionInfo: manual session info detected"), e;
995
1002
  };
996
- return ae(() => e instanceof Io ? s() : e instanceof Zt ? o() : e && typeof e == "object" ? (t.warn("Please use ManualSessionInfo instead of the old userSessionInfo format."), s()) : e === void 0 ? (t.warn("Please use AnonymousSessionInfo instead of undefined userSessionInfo."), o()) : null, [
1003
+ return ae(() => e instanceof $o ? s() : e instanceof Zt ? o() : e && typeof e == "object" ? (t.warn("Please use ManualSessionInfo instead of the old userSessionInfo format."), s()) : e === void 0 ? (t.warn("Please use AnonymousSessionInfo instead of undefined userSessionInfo."), o()) : null, [
997
1004
  t,
998
1005
  e == null ? void 0 : e.userId,
999
1006
  e == null ? void 0 : e.authToken,
@@ -1002,52 +1009,52 @@ const $o = 24 * 60 * 60 * 1e3, Mo = (e) => {
1002
1009
  n.messenger.clear
1003
1010
  ]);
1004
1011
  };
1005
- function Oo({
1012
+ function Lo({
1006
1013
  userSessionInfo: e,
1007
1014
  onPreAuth: t,
1008
1015
  onPostAuth: n,
1009
1016
  onErrorAuth: o,
1010
1017
  onAuthTokenRefreshed: s,
1011
- onPostDeauth: a,
1012
- forceCreateChannel: i
1018
+ onPostDeauth: i,
1019
+ forceCreateChannel: a
1013
1020
  }) {
1014
- const { aiAgentId: l, chatSDK: c, language: d, context: g, countryCode: h, logger: f, cache: x } = ue(), { connect: b, disconnect: E } = Ao(), m = Mo(e), C = R(async () => {
1021
+ const { aiAgentId: l, chatSDK: c, language: d, context: h, countryCode: m, logger: f, cache: x } = ue(), { connect: E, disconnect: b } = ko(), g = Oo(e), C = R(async () => {
1015
1022
  var $;
1016
1023
  f.debug("useAuthentication.authenticate: start");
1017
- const S = (m == null ? void 0 : m.userId) && (($ = x.messenger.getSettings(m.userId)) == null ? void 0 : $.knownActiveChannelUrl), k = await c.aiAgent.requestMessengerSettings({
1024
+ const S = (g == null ? void 0 : g.userId) && (($ = x.messenger.getSettings(g.userId)) == null ? void 0 : $.knownActiveChannelUrl), k = await c.aiAgent.requestMessengerSettings({
1018
1025
  aiAgentId: l,
1019
- userId: m == null ? void 0 : m.userId,
1026
+ userId: g == null ? void 0 : g.userId,
1020
1027
  language: d,
1021
- country: h,
1022
- context: g,
1023
- forceCreateChannel: i,
1028
+ country: m,
1029
+ context: h,
1030
+ forceCreateChannel: a,
1024
1031
  knownActiveChannelUrl: S
1025
1032
  });
1026
1033
  f.debug("useAuthentication.authenticate: messenger settings response", k);
1027
1034
  let F = null;
1028
1035
  if (k.auto_created_user) {
1029
- const { user_id: V, session_token: ne, expire_at: y } = k.auto_created_user;
1030
- x.messenger.setAnonUser({ userId: V, authToken: ne, expireAt: y }), F = { userId: V, authToken: ne };
1036
+ const { user_id: V, session_token: re, expire_at: y } = k.auto_created_user;
1037
+ x.messenger.setAnonUser({ userId: V, authToken: re, expireAt: y }), F = { userId: V, authToken: re };
1031
1038
  } else
1032
1039
  F = {
1033
- userId: (m == null ? void 0 : m.userId) ?? "",
1034
- authToken: (m == null ? void 0 : m.authToken) ?? ""
1040
+ userId: (g == null ? void 0 : g.userId) ?? "",
1041
+ authToken: (g == null ? void 0 : g.authToken) ?? ""
1035
1042
  };
1036
1043
  x.messenger.setSettings(F.userId, {
1037
1044
  knownActiveChannelUrl: k.active_channel.channel_url
1038
1045
  });
1039
1046
  try {
1040
- await t(k, F), await b(F, m == null ? void 0 : m.sessionHandler, s), await n(k, F);
1047
+ await t(k, F), await E(F, g == null ? void 0 : g.sessionHandler, s), await n(k, F);
1041
1048
  } catch (V) {
1042
1049
  V instanceof Error && (o(V), f.error("useAuthentication.authenticate: failed to connect", V));
1043
1050
  }
1044
1051
  return k;
1045
1052
  }, [
1046
1053
  c,
1047
- b,
1048
- m == null ? void 0 : m.userId,
1049
- m == null ? void 0 : m.sessionHandler,
1050
- m == null ? void 0 : m.authToken,
1054
+ E,
1055
+ g == null ? void 0 : g.userId,
1056
+ g == null ? void 0 : g.sessionHandler,
1057
+ g == null ? void 0 : g.authToken,
1051
1058
  x.messenger.setAnonUser,
1052
1059
  x.messenger.getSettings,
1053
1060
  x.messenger.setSettings,
@@ -1056,12 +1063,12 @@ function Oo({
1056
1063
  o,
1057
1064
  s
1058
1065
  ]), v = R(async () => {
1059
- f.debug("useAuthentication.deauthenticate: start"), await E(), a(), f.debug("useAuthentication.deauthenticate: completed");
1060
- }, [E, f, a]);
1066
+ f.debug("useAuthentication.deauthenticate: start"), await b(), i(), f.debug("useAuthentication.deauthenticate: completed");
1067
+ }, [b, f, i]);
1061
1068
  return {
1062
1069
  authenticate: C,
1063
1070
  deauthenticate: v,
1064
- userSessionCandidate: m
1071
+ userSessionCandidate: g
1065
1072
  };
1066
1073
  }
1067
1074
  const An = (e) => {
@@ -1072,16 +1079,16 @@ const An = (e) => {
1072
1079
  return JSON.stringify(e).slice(1, -1);
1073
1080
  }
1074
1081
  }, $e = (e) => JSON.parse(e), Qe = (e) => JSON.parse(e);
1075
- function Lo(e, t) {
1082
+ function Ro(e, t) {
1076
1083
  const [n, o] = t.split(",").map((s) => s.trim());
1077
1084
  return e === "dark" && o || n;
1078
1085
  }
1079
- function Ro(e) {
1086
+ function Do(e) {
1080
1087
  const t = {};
1081
1088
  function n(o, s = "") {
1082
- for (const [a, i] of Object.entries(o)) {
1083
- const l = s ? `${s}.${a}` : a;
1084
- i && typeof i == "object" && !Array.isArray(i) ? n(i, l) : t[l] = i;
1089
+ for (const [i, a] of Object.entries(o)) {
1090
+ const l = s ? `${s}.${i}` : i;
1091
+ a && typeof a == "object" && !Array.isArray(a) ? n(a, l) : t[l] = a;
1085
1092
  }
1086
1093
  }
1087
1094
  return n(e), t;
@@ -1092,43 +1099,43 @@ function vt({
1092
1099
  variableKeyPattern: n,
1093
1100
  variableValueTransformer: o
1094
1101
  }) {
1095
- return Object.entries(t).reduce((s, [a, i]) => {
1096
- if (!o && !["number", "boolean", "string"].includes(typeof i))
1097
- throw new Error(`If transformer is not provided, value(${a}:${i}) must be a {string, number, or boolean}`);
1098
- const l = o ? o(i) : String(i), c = n(a);
1102
+ return Object.entries(t).reduce((s, [i, a]) => {
1103
+ if (!o && !["number", "boolean", "string"].includes(typeof a))
1104
+ throw new Error(`If transformer is not provided, value(${i}:${a}) must be a {string, number, or boolean}`);
1105
+ const l = o ? o(a) : String(a), c = n(i);
1099
1106
  return s.replace(c, An(l));
1100
1107
  }, e);
1101
1108
  }
1102
- async function Do({
1109
+ async function No({
1103
1110
  template: e,
1104
1111
  variables: t,
1105
1112
  variableKeyPattern: n,
1106
1113
  variableValueTransformer: o
1107
1114
  }) {
1108
1115
  return (await Promise.all(
1109
- Object.entries(t).map(async ([a, i]) => {
1110
- const l = await o(i);
1111
- return { regex: n(a), transformedValue: l };
1116
+ Object.entries(t).map(async ([i, a]) => {
1117
+ const l = await o(a);
1118
+ return { regex: n(i), transformedValue: l };
1112
1119
  })
1113
- )).reduce((a, { regex: i, transformedValue: l }) => a.replace(i, An(l)), e);
1120
+ )).reduce((i, { regex: a, transformedValue: l }) => i.replace(a, An(l)), e);
1114
1121
  }
1115
- const No = () => {
1122
+ const Po = () => {
1116
1123
  const { chatSDK: e, logger: t, cache: n } = ue(), o = R(() => {
1117
1124
  var l, c;
1118
- const a = (c = (l = e.appInfo) == null ? void 0 : l.aiAgentInfo) == null ? void 0 : c.templateListToken;
1119
- if (!a) return !1;
1120
- const i = n.template.getCachedToken();
1121
- return i ? a !== i : !0;
1125
+ const i = (c = (l = e.appInfo) == null ? void 0 : l.aiAgentInfo) == null ? void 0 : c.templateListToken;
1126
+ if (!i) return !1;
1127
+ const a = n.template.getCachedToken();
1128
+ return a ? i !== a : !0;
1122
1129
  }, [e, n.template.getCachedToken]), s = R(async () => {
1123
1130
  try {
1124
- const { templates: a, token: i } = await e.aiAgent.getMessageTemplates({ limit: 20 });
1125
- for (const { template: l } of a) {
1131
+ const { templates: i, token: a } = await e.aiAgent.getMessageTemplates({ limit: 20 });
1132
+ for (const { template: l } of i) {
1126
1133
  const { key: c } = $e(l);
1127
1134
  n.template.set(c, l);
1128
1135
  }
1129
- n.template.setCachedToken(i);
1130
- } catch (a) {
1131
- t == null || t.error("messageTemplateContext.syncCachedTemplates: error:", a);
1136
+ n.template.setCachedToken(a);
1137
+ } catch (i) {
1138
+ t == null || t.error("messageTemplateContext.syncCachedTemplates: error:", i);
1132
1139
  }
1133
1140
  }, [e, t, n.template.set, n.template.setCachedToken]);
1134
1141
  return {
@@ -1137,21 +1144,21 @@ const No = () => {
1137
1144
  };
1138
1145
  };
1139
1146
  var je = /* @__PURE__ */ ((e) => (e.OFF = "off", e.ALWAYS = "always", e.HANDED_OFF_ONLY = "handed_off_only", e))(je || {});
1140
- const Po = {
1147
+ const Bo = {
1141
1148
  off: "off",
1142
1149
  always: "always",
1143
1150
  handed_off_only: "handed_off_only"
1144
1151
  /* HANDED_OFF_ONLY */
1145
1152
  }, {
1146
- Provider: Bo
1147
- } = G("AIAgentMessengerSession"), Fo = ye(
1153
+ Provider: Fo
1154
+ } = G("AIAgentMessengerSession"), Uo = ye(
1148
1155
  function({ userSessionInfo: e, forceCreateChannel: t, children: n }, o) {
1149
- const { appId: s, aiAgentId: a, chatSDK: i, language: l, countryCode: c, context: d, cache: g, logger: h } = ue(), { updateTheme: f } = Ct(), [x, b] = _(void 0), [E, m] = _(
1156
+ const { appId: s, aiAgentId: i, chatSDK: a, language: l, countryCode: c, context: d, cache: h, logger: m } = ue(), { updateTheme: f } = Ct(), [x, E] = _(void 0), [b, g] = _(
1150
1157
  void 0
1151
- ), [C, v] = _(null), [S, k] = _(null), [F, $] = _(null), [V, ne] = _(
1158
+ ), [C, v] = _(null), [S, k] = _(null), [F, $] = _(null), [V, re] = _(
1152
1159
  "handed_off_only"
1153
1160
  /* HANDED_OFF_ONLY */
1154
- ), { shouldSyncCachedTemplate: y, syncCachedTemplates: H } = No(), { authenticate: re, deauthenticate: Y } = Oo({
1161
+ ), { shouldSyncCachedTemplate: y, syncCachedTemplates: H } = Po(), { authenticate: oe, deauthenticate: Y } = Lo({
1155
1162
  userSessionInfo: e,
1156
1163
  forceCreateChannel: t,
1157
1164
  onPreAuth: R((A, D) => {
@@ -1164,7 +1171,7 @@ const Po = {
1164
1171
  primaryContrastColor: be.primary_contrast_color,
1165
1172
  botMessageBackgroundContrastColor: be.bot_message_bg_contrast_color
1166
1173
  };
1167
- }), b(void 0), v(D), k({
1174
+ }), E(void 0), v(D), k({
1168
1175
  userId: A.bot.bot_userid,
1169
1176
  profileUrl: A.bot.bot_profile_url,
1170
1177
  nickname: A.bot.bot_nickname,
@@ -1175,113 +1182,113 @@ const Po = {
1175
1182
  }), $({
1176
1183
  type: A.launcher.image_type || "default_icon",
1177
1184
  imageUrl: A.launcher.image_url
1178
- }), ne(
1179
- Po[A.active_channel.attachment_mode] ?? "handed_off_only"
1185
+ }), re(
1186
+ Bo[A.active_channel.attachment_mode] ?? "handed_off_only"
1180
1187
  /* HANDED_OFF_ONLY */
1181
1188
  );
1182
1189
  }, []),
1183
1190
  onPostAuth: R(
1184
1191
  async (A) => {
1185
- y() && await H(), m({ url: A.active_channel.channel_url, status: W.OPEN });
1192
+ y() && await H(), g({ url: A.active_channel.channel_url, status: W.OPEN });
1186
1193
  },
1187
1194
  [y, H]
1188
1195
  ),
1189
1196
  onErrorAuth: R((A) => {
1190
- b(A);
1197
+ E(A);
1191
1198
  }, []),
1192
1199
  onAuthTokenRefreshed: R((A) => {
1193
1200
  v((D) => D ? { ...D, authToken: A } : null);
1194
1201
  }, []),
1195
1202
  onPostDeauth: R(() => {
1196
- g.template.clear(), C != null && C.userId && g.messenger.clear(C.userId), m(void 0), v(null), k(null), $(null);
1197
- }, [g.template.clear, C])
1203
+ h.template.clear(), C != null && C.userId && h.messenger.clear(C.userId), g(void 0), v(null), k(null), $(null);
1204
+ }, [h.template.clear, C])
1198
1205
  }), nt = R(async () => {
1199
1206
  var A;
1200
1207
  if (C) {
1201
- h.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"), m(void 0);
1202
- const D = await i.aiAgent.requestMessengerSettings({
1203
- aiAgentId: a,
1208
+ m.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"), g(void 0);
1209
+ const D = await a.aiAgent.requestMessengerSettings({
1210
+ aiAgentId: i,
1204
1211
  userId: C.userId,
1205
1212
  language: l,
1206
1213
  country: c,
1207
1214
  context: d,
1208
1215
  forceCreateChannel: t,
1209
- knownActiveChannelUrl: (A = g.messenger.getSettings(C.userId)) == null ? void 0 : A.knownActiveChannelUrl
1216
+ knownActiveChannelUrl: (A = h.messenger.getSettings(C.userId)) == null ? void 0 : A.knownActiveChannelUrl
1210
1217
  });
1211
- return g.messenger.setSettings(C.userId, {
1218
+ return h.messenger.setSettings(C.userId, {
1212
1219
  knownActiveChannelUrl: D.active_channel.channel_url
1213
- }), m({ url: D.active_channel.channel_url, status: W.OPEN }), h.info(
1220
+ }), g({ url: D.active_channel.channel_url, status: W.OPEN }), m.info(
1214
1221
  "agentMessengerSession.refreshActiveChannel: refreshed active channel",
1215
1222
  D.active_channel.channel_url
1216
1223
  ), D.active_channel.channel_url;
1217
1224
  } else
1218
- throw h.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"), new Error("userSession is not ready");
1225
+ throw m.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"), new Error("userSession is not ready");
1219
1226
  }, [
1220
- i,
1221
- s,
1222
1227
  a,
1228
+ s,
1229
+ i,
1223
1230
  C == null ? void 0 : C.userId,
1224
1231
  l,
1225
1232
  c,
1226
1233
  d,
1227
1234
  t,
1228
- g.messenger.getSettings,
1229
- g.messenger.setSettings
1235
+ h.messenger.getSettings,
1236
+ h.messenger.setSettings
1230
1237
  ]), rt = R(
1231
1238
  async (A) => {
1232
1239
  if (!(C != null && C.userId))
1233
1240
  throw new Error("Current user is not authenticated. Please authenticate first.");
1234
- const K = (await i.aiAgent.requestMessengerSettings({
1241
+ const K = (await a.aiAgent.requestMessengerSettings({
1235
1242
  ...A,
1236
1243
  userId: C.userId,
1237
1244
  knownActiveChannelUrl: void 0
1238
1245
  })).active_channel.channel_url;
1239
- return g.messenger.setSettings(C.userId, { knownActiveChannelUrl: K }), K;
1246
+ return h.messenger.setSettings(C.userId, { knownActiveChannelUrl: K }), K;
1240
1247
  },
1241
1248
  [C == null ? void 0 : C.userId]
1242
1249
  );
1243
- return Xe(i, {
1250
+ return Xe(a, {
1244
1251
  onChannelChanged: (A) => {
1245
1252
  var D;
1246
- A.isGroupChannel() && A.url === (E == null ? void 0 : E.url) && (h.info("agentMessengerSession.channelChanged: channel.conversation", A.conversation), m({ url: A.url, status: ((D = A.conversation) == null ? void 0 : D.status) ?? W.OPEN }));
1253
+ A.isGroupChannel() && A.url === (b == null ? void 0 : b.url) && (m.info("agentMessengerSession.channelChanged: channel.conversation", A.conversation), g({ url: A.url, status: ((D = A.conversation) == null ? void 0 : D.status) ?? W.OPEN }));
1247
1254
  }
1248
1255
  }), Er(o, () => {
1249
1256
  const A = async () => {
1250
- if (!E) throw new Error("No active conversation. Please start a conversation first.");
1251
- return await i.groupChannel.getChannel(E.url);
1257
+ if (!b) throw new Error("No active conversation. Please start a conversation first.");
1258
+ return await a.groupChannel.getChannel(b.url);
1252
1259
  };
1253
1260
  return {
1254
- activeChannel: E,
1255
- chatSDK: i,
1256
- authenticate: re,
1261
+ activeChannel: b,
1262
+ chatSDK: a,
1263
+ authenticate: oe,
1257
1264
  deauthenticate: Y,
1258
1265
  updateContext: async (D) => {
1259
- const q = await (await A()).updateContext(a, D);
1266
+ const q = await (await A()).updateContext(i, D);
1260
1267
  return { ...q, context: q.context ?? {} };
1261
1268
  },
1262
1269
  patchContext: async (D) => {
1263
- const q = await (await A()).patchContext(a, D);
1270
+ const q = await (await A()).patchContext(i, D);
1264
1271
  return { ...q, context: q.context ?? {} };
1265
1272
  },
1266
1273
  getContextObject: async () => {
1267
- const K = await (await A()).getContextObject(a);
1274
+ const K = await (await A()).getContextObject(i);
1268
1275
  return { ...K, context: K.context ?? {} };
1269
1276
  }
1270
1277
  };
1271
- }, [re, Y, E, i, a, h]), /* @__PURE__ */ r.createElement(
1272
- Bo,
1278
+ }, [oe, Y, b, a, i, m]), /* @__PURE__ */ r.createElement(
1279
+ Fo,
1273
1280
  {
1274
1281
  value: {
1275
1282
  userSessionInfo: e,
1276
1283
  userSession: C,
1277
- activeChannel: E,
1278
- setActiveChannel: m,
1284
+ activeChannel: b,
1285
+ setActiveChannel: g,
1279
1286
  refreshActiveChannel: nt,
1280
1287
  createConversation: rt,
1281
1288
  connectionError: x,
1282
1289
  aiAgentInfo: S,
1283
1290
  launcherInfo: F,
1284
- authenticate: re,
1291
+ authenticate: oe,
1285
1292
  deauthenticate: Y,
1286
1293
  attachmentMode: V
1287
1294
  }
@@ -1290,7 +1297,7 @@ const Po = {
1290
1297
  );
1291
1298
  }
1292
1299
  );
1293
- function Uo(e) {
1300
+ function Ho(e) {
1294
1301
  let t = "pending", n = e.then((o) => {
1295
1302
  t = "resolved", n = o;
1296
1303
  }).catch((o) => {
@@ -1305,61 +1312,61 @@ function Uo(e) {
1305
1312
  };
1306
1313
  }
1307
1314
  const {
1308
- Provider: Ho,
1315
+ Provider: zo,
1309
1316
  useContext: kn
1310
1317
  } = G("MessageTemplateFetching");
1311
- function zo({ children: e, internalVariables: t }) {
1312
- const n = N({}), o = N({}), [s, a] = _({}), i = R((d, g) => {
1313
- a((h) => ({
1314
- ...h,
1315
- [d]: { fetching: !1, error: !1, ...h[d], ...g }
1318
+ function Vo({ children: e, internalVariables: t }) {
1319
+ const n = N({}), o = N({}), [s, i] = _({}), a = R((d, h) => {
1320
+ i((m) => ({
1321
+ ...m,
1322
+ [d]: { fetching: !1, error: !1, ...m[d], ...h }
1316
1323
  }));
1317
1324
  }, []), l = R(
1318
1325
  async ({
1319
1326
  onRequestTemplate: d,
1320
- onGetCachedTemplate: g,
1321
- templateKey: h,
1327
+ onGetCachedTemplate: h,
1328
+ templateKey: m,
1322
1329
  suspense: f = !1
1323
1330
  }) => {
1324
- const x = g(h);
1331
+ const x = h(m);
1325
1332
  if (x) return x;
1326
- const b = o.current[h];
1327
- if (b) return b;
1328
- f || i(h, { fetching: !0 });
1329
- const E = d(h).catch((m) => {
1330
- throw f || i(h, { error: !0 }), m;
1333
+ const E = o.current[m];
1334
+ if (E) return E;
1335
+ f || a(m, { fetching: !0 });
1336
+ const b = d(m).catch((g) => {
1337
+ throw f || a(m, { error: !0 }), g;
1331
1338
  }).finally(() => {
1332
- f || i(h, { fetching: !1 }), delete o.current[h];
1339
+ f || a(m, { fetching: !1 }), delete o.current[m];
1333
1340
  });
1334
- return o.current[h] = E, E;
1341
+ return o.current[m] = b, b;
1335
1342
  },
1336
- [i]
1343
+ [a]
1337
1344
  ), c = {
1338
1345
  internalVariables: t,
1339
1346
  fetchTemplate: l,
1340
- suspend: (d, g) => {
1347
+ suspend: (d, h) => {
1341
1348
  if (n.current[d])
1342
1349
  return n.current[d];
1343
- const h = Uo(g());
1344
- return n.current[d] = h, h;
1350
+ const m = Ho(h());
1351
+ return n.current[d] = m, m;
1345
1352
  },
1346
1353
  getIsFetching: (d) => {
1347
- var g;
1348
- return ((g = s[d]) == null ? void 0 : g.fetching) ?? !1;
1354
+ var h;
1355
+ return ((h = s[d]) == null ? void 0 : h.fetching) ?? !1;
1349
1356
  },
1350
1357
  getHasError: (d) => {
1351
- var g;
1352
- return ((g = s[d]) == null ? void 0 : g.error) ?? !1;
1358
+ var h;
1359
+ return ((h = s[d]) == null ? void 0 : h.error) ?? !1;
1353
1360
  }
1354
1361
  };
1355
- return /* @__PURE__ */ r.createElement(Ho, { value: c }, e);
1362
+ return /* @__PURE__ */ r.createElement(zo, { value: c }, e);
1356
1363
  }
1357
1364
  const et = {
1358
1365
  VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
1359
1366
  VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
1360
1367
  };
1361
1368
  function ce({ uiTemplateString: e, variables: t = {} }) {
1362
- const n = Ro(t);
1369
+ const n = Do(t);
1363
1370
  return vt({
1364
1371
  template: e,
1365
1372
  variables: n,
@@ -1375,120 +1382,120 @@ function de({
1375
1382
  template: t,
1376
1383
  variables: n,
1377
1384
  variableKeyPattern: (o) => et.VARIABLE(o),
1378
- variableValueTransformer: (o) => Lo(e, o)
1385
+ variableValueTransformer: (o) => Ro(e, o)
1379
1386
  });
1380
1387
  }
1381
- function Vo({
1388
+ function Wo({
1382
1389
  theme: e,
1383
1390
  uiTemplateString: t,
1384
1391
  viewVariables: n = {},
1385
1392
  aiAgentColorVariables: o,
1386
1393
  internalVariables: s,
1387
- onRequestTemplate: a
1394
+ onRequestTemplate: i
1388
1395
  }) {
1389
1396
  const l = Object.values(n).flat().map((d) => d.key);
1390
- return [...new Set(l)].some((d) => !a(d)) ? null : vt({
1397
+ return [...new Set(l)].some((d) => !i(d)) ? null : vt({
1391
1398
  template: t,
1392
1399
  variables: n,
1393
1400
  variableKeyPattern: (d) => et.VIEW_VARIABLE(d),
1394
1401
  variableValueTransformer: (d) => {
1395
- const g = d.map(({ key: h, variables: f }) => {
1396
- const x = a(h), { ui_template: b, color_variables: E } = $e(x);
1397
- let m = JSON.stringify(b);
1398
- return m = ce({
1399
- uiTemplateString: m,
1402
+ const h = d.map(({ key: m, variables: f }) => {
1403
+ const x = i(m), { ui_template: E, color_variables: b } = $e(x);
1404
+ let g = JSON.stringify(E);
1405
+ return g = ce({
1406
+ uiTemplateString: g,
1400
1407
  variables: s
1401
- }), m = de({
1408
+ }), g = de({
1402
1409
  theme: e,
1403
- uiTemplateString: m,
1404
- colorVariables: E
1405
- }), m = de({
1410
+ uiTemplateString: g,
1411
+ colorVariables: b
1412
+ }), g = de({
1406
1413
  theme: e,
1407
- uiTemplateString: m,
1414
+ uiTemplateString: g,
1408
1415
  colorVariables: o
1409
- }), m = ce({
1410
- uiTemplateString: m,
1416
+ }), g = ce({
1417
+ uiTemplateString: g,
1411
1418
  variables: f
1412
- }), Qe(m);
1419
+ }), Qe(g);
1413
1420
  });
1414
- return JSON.stringify(g);
1421
+ return JSON.stringify(h);
1415
1422
  }
1416
1423
  });
1417
1424
  }
1418
- async function Wo({
1425
+ async function Go({
1419
1426
  theme: e,
1420
1427
  uiTemplateString: t,
1421
1428
  viewVariables: n = {},
1422
1429
  aiAgentColorVariables: o,
1423
1430
  internalVariables: s,
1424
- onRequestTemplate: a
1431
+ onRequestTemplate: i
1425
1432
  }) {
1426
- return Do({
1433
+ return No({
1427
1434
  template: t,
1428
1435
  variables: n,
1429
- variableKeyPattern: (i) => et.VIEW_VARIABLE(i),
1430
- variableValueTransformer: async (i) => {
1431
- const l = i.map(async ({ key: d, variables: g }) => {
1432
- const h = await a(d), { ui_template: f, color_variables: x } = $e(h);
1433
- let b = JSON.stringify(f);
1434
- return b = ce({
1435
- uiTemplateString: b,
1436
+ variableKeyPattern: (a) => et.VIEW_VARIABLE(a),
1437
+ variableValueTransformer: async (a) => {
1438
+ const l = a.map(async ({ key: d, variables: h }) => {
1439
+ const m = await i(d), { ui_template: f, color_variables: x } = $e(m);
1440
+ let E = JSON.stringify(f);
1441
+ return E = ce({
1442
+ uiTemplateString: E,
1436
1443
  variables: s
1437
- }), b = de({
1444
+ }), E = de({
1438
1445
  theme: e,
1439
- uiTemplateString: b,
1446
+ uiTemplateString: E,
1440
1447
  colorVariables: x
1441
- }), b = de({
1448
+ }), E = de({
1442
1449
  theme: e,
1443
- uiTemplateString: b,
1450
+ uiTemplateString: E,
1444
1451
  colorVariables: o
1445
- }), b = ce({
1446
- uiTemplateString: b,
1447
- variables: g
1448
- }), Qe(b);
1452
+ }), E = ce({
1453
+ uiTemplateString: E,
1454
+ variables: h
1455
+ }), Qe(E);
1449
1456
  }), c = await Promise.all(l);
1450
1457
  return JSON.stringify(c);
1451
1458
  }
1452
1459
  });
1453
1460
  }
1454
- const Go = ({
1461
+ const jo = ({
1455
1462
  rawTemplate: e,
1456
1463
  aiAgentColorVariables: t,
1457
1464
  internalVariables: n,
1458
1465
  ...o
1459
1466
  }) => {
1460
- const { ui_template: s, color_variables: a } = $e(e);
1461
- let i = JSON.stringify(s);
1467
+ const { ui_template: s, color_variables: i } = $e(e);
1468
+ let a = JSON.stringify(s);
1462
1469
  if (Object.keys(o.viewVariables ?? {}).length > 0) {
1463
- const c = Vo({
1470
+ const c = Wo({
1464
1471
  ...o,
1465
- uiTemplateString: i,
1472
+ uiTemplateString: a,
1466
1473
  aiAgentColorVariables: t,
1467
1474
  internalVariables: n
1468
1475
  });
1469
1476
  if (c === null) return null;
1470
- i = c;
1477
+ a = c;
1471
1478
  }
1472
- return i = ce({ ...o, uiTemplateString: i, variables: n }), i = de({ ...o, uiTemplateString: i, colorVariables: a }), i = de({ ...o, uiTemplateString: i, colorVariables: t }), i = ce({ ...o, uiTemplateString: i }), Qe(i);
1473
- }, jo = async ({
1479
+ return a = ce({ ...o, uiTemplateString: a, variables: n }), a = de({ ...o, uiTemplateString: a, colorVariables: i }), a = de({ ...o, uiTemplateString: a, colorVariables: t }), a = ce({ ...o, uiTemplateString: a }), Qe(a);
1480
+ }, Ko = async ({
1474
1481
  rawTemplate: e,
1475
1482
  aiAgentColorVariables: t,
1476
1483
  internalVariables: n,
1477
1484
  ...o
1478
1485
  }) => {
1479
- const { ui_template: s, color_variables: a } = $e(e);
1480
- let i = JSON.stringify(s);
1481
- return Object.keys(o.viewVariables ?? {}).length > 0 && (i = await Wo({
1486
+ const { ui_template: s, color_variables: i } = $e(e);
1487
+ let a = JSON.stringify(s);
1488
+ return Object.keys(o.viewVariables ?? {}).length > 0 && (a = await Go({
1482
1489
  ...o,
1483
- uiTemplateString: i,
1490
+ uiTemplateString: a,
1484
1491
  aiAgentColorVariables: t,
1485
1492
  internalVariables: n
1486
- })), i = ce({ ...o, uiTemplateString: i, variables: n }), i = de({ ...o, uiTemplateString: i, colorVariables: a }), i = de({ ...o, uiTemplateString: i, colorVariables: t }), i = ce({ ...o, uiTemplateString: i }), Qe(i);
1487
- }, Ko = (e) => {
1493
+ })), a = ce({ ...o, uiTemplateString: a, variables: n }), a = de({ ...o, uiTemplateString: a, colorVariables: i }), a = de({ ...o, uiTemplateString: a, colorVariables: t }), a = ce({ ...o, uiTemplateString: a }), Qe(a);
1494
+ }, Zo = (e) => {
1488
1495
  const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = kn();
1489
1496
  return _(() => {
1490
1497
  const o = e.onGetCachedTemplate(e.templateKey);
1491
- return o ? Go({
1498
+ return o ? jo({
1492
1499
  ...e,
1493
1500
  rawTemplate: o,
1494
1501
  aiAgentColorVariables: t,
@@ -1496,20 +1503,20 @@ const Go = ({
1496
1503
  onRequestTemplate: e.onGetCachedTemplate
1497
1504
  }) : null;
1498
1505
  });
1499
- }, Zo = (e) => {
1500
- const [t] = Ko(e);
1506
+ }, Yo = (e) => {
1507
+ const [t] = Zo(e);
1501
1508
  if (t) return t;
1502
- const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: s, suspend: a } = kn();
1503
- return a(e.templateKey, async () => {
1509
+ const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: s, suspend: i } = kn();
1510
+ return i(e.templateKey, async () => {
1504
1511
  const l = await s({ ...e, suspense: !0 });
1505
- return await jo({
1512
+ return await Ko({
1506
1513
  ...e,
1507
1514
  rawTemplate: l,
1508
1515
  aiAgentColorVariables: n,
1509
1516
  internalVariables: o
1510
1517
  });
1511
1518
  }).value;
1512
- }, Yo = '@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}', Me = "en", qo = /* @__PURE__ */ new Set([
1519
+ }, qo = '@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}', Me = "en", Jo = /* @__PURE__ */ new Set([
1513
1520
  Me,
1514
1521
  "ko",
1515
1522
  "es",
@@ -1520,11 +1527,11 @@ const Go = ({
1520
1527
  "de",
1521
1528
  "tr",
1522
1529
  "ja"
1523
- ]), Jo = (e, t, n) => {
1530
+ ]), Xo = (e, t, n) => {
1524
1531
  const o = e[t];
1525
- return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((s, a) => {
1532
+ return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((s, i) => {
1526
1533
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
1527
- a.bind(
1534
+ i.bind(
1528
1535
  null,
1529
1536
  new Error(
1530
1537
  "Unknown variable dynamic import: " + t + (t.split("/").length !== n ? ". Note that variables only represent file names one level deep." : "")
@@ -1532,7 +1539,7 @@ const Go = ({
1532
1539
  )
1533
1540
  );
1534
1541
  });
1535
- }, Xo = Or, Qo = {
1542
+ }, Qo = Lr, es = {
1536
1543
  // Channel - Common
1537
1544
  CHANNEL_FROZEN: "Channel frozen",
1538
1545
  PLACE_HOLDER__WRONG: "Something went wrong",
@@ -1585,47 +1592,47 @@ const Go = ({
1585
1592
  DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma",
1586
1593
  // Citation
1587
1594
  CITATION_SOURCE_TITLE: "Source"
1588
- }, yt = { language: "en", dateLocale: Xo, stringSet: Qo }, es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1595
+ }, yt = { language: "en", dateLocale: Qo, stringSet: es }, ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1589
1596
  __proto__: null,
1590
1597
  default: yt
1591
1598
  }, Symbol.toStringTag, { value: "Module" })), Ke = /* @__PURE__ */ new Map([[Me, yt]]);
1592
- async function ts(e) {
1599
+ async function ns(e) {
1593
1600
  if (Ke.has(e))
1594
1601
  return Ke.get(e);
1595
- const t = qo.has(e) ? e : Me;
1602
+ const t = Jo.has(e) ? e : Me;
1596
1603
  try {
1597
- const { default: n } = await Jo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./BAebVbLs.js"), "./languages/en.ts": () => Promise.resolve().then(() => es), "./languages/es.ts": () => import("./BKSUGIyL.js"), "./languages/fr.ts": () => import("./B1s75De5.js"), "./languages/hi.ts": () => import("./D0QwWNMF.js"), "./languages/it.ts": () => import("./CA1gVgSD.js"), "./languages/ja.ts": () => import("./DcqbdvlW.js"), "./languages/ko.ts": () => import("./Dxrtj2R8.js"), "./languages/pt.ts": () => import("./EylKxx4d.js"), "./languages/tr.ts": () => import("./DYR8UT_l.js") }), `./languages/${t}.ts`, 3);
1604
+ const { default: n } = await Xo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./BAebVbLs.js"), "./languages/en.ts": () => Promise.resolve().then(() => ts), "./languages/es.ts": () => import("./BKSUGIyL.js"), "./languages/fr.ts": () => import("./B1s75De5.js"), "./languages/hi.ts": () => import("./D0QwWNMF.js"), "./languages/it.ts": () => import("./CA1gVgSD.js"), "./languages/ja.ts": () => import("./DcqbdvlW.js"), "./languages/ko.ts": () => import("./Dxrtj2R8.js"), "./languages/pt.ts": () => import("./EylKxx4d.js"), "./languages/tr.ts": () => import("./DYR8UT_l.js") }), `./languages/${t}.ts`, 3);
1598
1605
  return Ke.set(e, n), n;
1599
1606
  } catch {
1600
1607
  return yt;
1601
1608
  }
1602
1609
  }
1603
1610
  const {
1604
- Provider: ns,
1611
+ Provider: rs,
1605
1612
  useContext: O
1606
1613
  } = G("Localization");
1607
- function rs(e) {
1614
+ function os(e) {
1608
1615
  var t;
1609
1616
  return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Me;
1610
1617
  }
1611
- function os({
1618
+ function ss({
1612
1619
  language: e = navigator.language,
1613
1620
  logger: t,
1614
1621
  stringSet: n,
1615
1622
  children: o
1616
1623
  }) {
1617
- const [s, a] = _(Ke.get(Me));
1624
+ const [s, i] = _(Ke.get(Me));
1618
1625
  return L(() => {
1619
- const i = rs(e);
1620
- s.language !== i && (t == null || t.debug("localization.useEffect: update language", `${s.language} -> ${i}`), ts(i).then(a));
1626
+ const a = os(e);
1627
+ s.language !== a && (t == null || t.debug("localization.useEffect: update language", `${s.language} -> ${a}`), ns(a).then(i));
1621
1628
  }, [e]), /* @__PURE__ */ r.createElement(
1622
- ns,
1629
+ rs,
1623
1630
  {
1624
1631
  value: {
1625
1632
  language: s.language,
1626
1633
  stringSet: { ...s.stringSet, ...n },
1627
1634
  dateLocale: s.dateLocale,
1628
- format: (i, l, c) => Cn(i, l, { locale: s.dateLocale, ...c })
1635
+ format: (a, l, c) => Cn(a, l, { locale: s.dateLocale, ...c })
1629
1636
  }
1630
1637
  },
1631
1638
  o
@@ -1633,13 +1640,13 @@ function os({
1633
1640
  }
1634
1641
  const Ze = "data-sb-agent-theme", Yt = (e) => (t, ...n) => {
1635
1642
  let o = "";
1636
- return t.forEach((s, a) => {
1637
- o += s + (n[a] ?? "");
1643
+ return t.forEach((s, i) => {
1644
+ o += s + (n[i] ?? "");
1638
1645
  }), `[${Ze}='${e}'] & { ${o} }`;
1639
1646
  }, P = {
1640
1647
  light: Yt("light"),
1641
1648
  dark: Yt("dark")
1642
- }, ss = I(({ theme: e }) => {
1649
+ }, is = I(({ theme: e }) => {
1643
1650
  const { palette: t } = e;
1644
1651
  return `
1645
1652
  :root,
@@ -1691,7 +1698,7 @@ const Ze = "data-sb-agent-theme", Yt = (e) => (t, ...n) => {
1691
1698
  --sendbird-overlay-light: ${t.overlay.light};
1692
1699
  }
1693
1700
  `;
1694
- }), is = I`[${Ze}='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);}[${Ze}='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);}`, p = {
1701
+ }), as = I`[${Ze}='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);}[${Ze}='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);}`, p = {
1695
1702
  color: {
1696
1703
  primary: {
1697
1704
  dark: "var(--sendbird-primary-dark)",
@@ -1732,74 +1739,74 @@ const Ze = "data-sb-agent-theme", Yt = (e) => (t, ...n) => {
1732
1739
  error: "var(--sb-error)"
1733
1740
  }
1734
1741
  }, {
1735
- Provider: as,
1736
- useContext: ls
1742
+ Provider: ls,
1743
+ useContext: cs
1737
1744
  } = G("MessengerTheme");
1738
- function cs(e) {
1745
+ function ds(e) {
1739
1746
  const { theme: t, appearance: n, logger: o } = e;
1740
1747
  return /* @__PURE__ */ r.createElement(
1741
- wo,
1748
+ Ao,
1742
1749
  {
1743
1750
  appearance: n,
1744
1751
  palette: t == null ? void 0 : t.palette,
1745
1752
  typography: t == null ? void 0 : t.typography,
1746
1753
  logger: o
1747
1754
  },
1748
- /* @__PURE__ */ r.createElement(ds, { ...e })
1755
+ /* @__PURE__ */ r.createElement(us, { ...e })
1749
1756
  );
1750
1757
  }
1751
- function ds({ rootElement: e = document.body, children: t }) {
1758
+ function us({ rootElement: e = document.body, children: t }) {
1752
1759
  const { theme: n, updateTheme: o } = Ct();
1753
1760
  return le(() => {
1754
1761
  e.setAttribute(Ze, n.selectedTheme);
1755
- }, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(kr, { theme: n }, /* @__PURE__ */ r.createElement(as, { value: { theme: n, updateTheme: o } }, t));
1762
+ }, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(Ir, { theme: n }, /* @__PURE__ */ r.createElement(ls, { value: { theme: n, updateTheme: o } }, t));
1756
1763
  }
1757
1764
  function pe(e, t) {
1758
1765
  const n = e.getRootNode({ composed: t });
1759
1766
  return n instanceof ShadowRoot || n instanceof Document ? n : document;
1760
1767
  }
1761
- const us = (e, t) => {
1768
+ const ms = (e, t) => {
1762
1769
  L(() => {
1763
1770
  const n = pe(t) instanceof ShadowRoot, o = pe(t, !0);
1764
1771
  if (!(n ? t : o).querySelector(`link[href*='${e}']`)) {
1765
- const a = o.createElement("link");
1766
- a.rel = "stylesheet", a.href = e, (n ? t : o.head).appendChild(a);
1772
+ const i = o.createElement("link");
1773
+ i.rel = "stylesheet", i.href = e, (n ? t : o.head).appendChild(i);
1767
1774
  }
1768
1775
  }, [e, t]);
1769
- }, ms = (e, t = document.body) => {
1776
+ }, gs = (e, t = document.body) => {
1770
1777
  L(() => {
1771
1778
  const n = pe(t), s = n instanceof ShadowRoot ? t : n.head;
1772
1779
  if (!s) return;
1773
- const a = `sba-${btoa(e).slice(0, 10)}`;
1774
- let i = s.querySelector(`style#${a}`);
1775
- i ? i.textContent !== e && (i.textContent = e) : (i = s.ownerDocument.createElement("style"), i.id = a, i.textContent = e, s.appendChild(i));
1780
+ const i = `sba-${btoa(e).slice(0, 10)}`;
1781
+ let a = s.querySelector(`style#${i}`);
1782
+ a ? a.textContent !== e && (a.textContent = e) : (a = s.ownerDocument.createElement("style"), a.id = i, a.textContent = e, s.appendChild(a));
1776
1783
  }, [e, t]);
1777
- }, _t = /iPad|iPhone|iPod/.test(navigator.userAgent), gs = /Android/.test(navigator.userAgent), Oe = (e) => _t || gs, {
1778
- Provider: hs,
1784
+ }, _t = /iPad|iPhone|iPod/.test(navigator.userAgent), hs = /Android/.test(navigator.userAgent), Oe = (e) => _t || hs, {
1785
+ Provider: ps,
1779
1786
  Consumer: In,
1780
1787
  useContext: B
1781
1788
  } = G("Messenger");
1782
- function ps({
1789
+ function fs({
1783
1790
  children: e,
1784
1791
  state: t,
1785
1792
  enableCloseConversationButton: n = !1,
1786
1793
  enableExpandButton: o = !0,
1787
1794
  enableAutoDisconnectInLauncher: s = !0,
1788
- ...a
1795
+ ...i
1789
1796
  }) {
1790
- const [i, l] = _(!1), [c, d] = _(!1), g = {
1791
- opened: (t == null ? void 0 : t.opened) ?? i,
1797
+ const [a, l] = _(!1), [c, d] = _(!1), h = {
1798
+ opened: (t == null ? void 0 : t.opened) ?? a,
1792
1799
  setOpened: (t == null ? void 0 : t.setOpened) ?? l,
1793
1800
  expanded: (t == null ? void 0 : t.expanded) ?? c,
1794
1801
  setExpanded: (t == null ? void 0 : t.setExpanded) ?? d
1795
1802
  };
1796
- return /* @__PURE__ */ r.createElement(eo, { ...a }, (h) => /* @__PURE__ */ r.createElement(
1797
- hs,
1803
+ return /* @__PURE__ */ r.createElement(to, { ...i }, (m) => /* @__PURE__ */ r.createElement(
1804
+ ps,
1798
1805
  {
1799
1806
  value: {
1800
- ...a,
1801
- ...h,
1802
- state: g,
1807
+ ...i,
1808
+ ...m,
1809
+ state: h,
1803
1810
  enableCloseConversationButton: n,
1804
1811
  enableExpandButton: o,
1805
1812
  enableAutoDisconnectInLauncher: s
@@ -1809,41 +1816,41 @@ function ps({
1809
1816
  ));
1810
1817
  }
1811
1818
  const {
1812
- Provider: fs,
1819
+ Provider: bs,
1813
1820
  useContext: U
1814
- } = G("MessengerSession"), bs = ye(function({ children: e, ...t }, n) {
1815
- return /* @__PURE__ */ r.createElement(Fo, { ref: n, ...t }, (o) => /* @__PURE__ */ r.createElement(Es, { ...o }, e));
1816
- }), Es = ({ children: e, ...t }) => {
1817
- const { chatSDK: n, logger: o, appId: s, aiAgentId: a, agentPreviewConfigs: i, state: l } = B(), { userSessionInfo: c, authenticate: d, setActiveChannel: g, userSession: h, aiAgentInfo: f, launcherInfo: x } = t;
1821
+ } = G("MessengerSession"), Es = ye(function({ children: e, ...t }, n) {
1822
+ return /* @__PURE__ */ r.createElement(Uo, { ref: n, ...t }, (o) => /* @__PURE__ */ r.createElement(xs, { ...o }, e));
1823
+ }), xs = ({ children: e, ...t }) => {
1824
+ const { chatSDK: n, logger: o, appId: s, aiAgentId: i, agentPreviewConfigs: a, state: l } = B(), { userSessionInfo: c, authenticate: d, setActiveChannel: h, userSession: m, aiAgentInfo: f, launcherInfo: x } = t;
1818
1825
  return Xe(n, {
1819
- async onUserJoined(b, E) {
1826
+ async onUserJoined(E, b) {
1820
1827
  var C, v;
1821
- if (b.conversation && b.conversation.type === Rr.PROACTIVE && E.userId === ((C = n.currentUser) == null ? void 0 : C.userId)) {
1822
- o.info("messengerSession.onUserJoined: proactive channel joined", b.url);
1823
- const S = ((v = b.conversation) == null ? void 0 : v.status) ?? W.OPEN;
1824
- g({ url: b.url, status: S }), l.setOpened(!0), xs({ sound: document.hidden || !l.opened });
1828
+ if (E.conversation && E.conversation.type === Dr.PROACTIVE && b.userId === ((C = n.currentUser) == null ? void 0 : C.userId)) {
1829
+ o.info("messengerSession.onUserJoined: proactive channel joined", E.url);
1830
+ const S = ((v = E.conversation) == null ? void 0 : v.status) ?? W.OPEN;
1831
+ h({ url: E.url, status: S }), l.setOpened(!0), Cs({ sound: document.hidden || !l.opened });
1825
1832
  }
1826
1833
  }
1827
1834
  }), L(() => {
1828
- d().then(({ launcher: b }) => {
1829
- b.auto_open && !Oe() && setTimeout(() => l.setOpened(!0), 500);
1830
- }).catch((b) => {
1831
- o.error("messengerSession: failed to initialize", b);
1835
+ d().then(({ launcher: E }) => {
1836
+ E.auto_open && !Oe() && setTimeout(() => l.setOpened(!0), 500);
1837
+ }).catch((E) => {
1838
+ o.error("messengerSession: failed to initialize", E);
1832
1839
  });
1833
- }, [n, s, a, c == null ? void 0 : c.userId, c == null ? void 0 : c.authToken]), !h || !f || !x ? null : /* @__PURE__ */ r.createElement(
1834
- fs,
1840
+ }, [n, s, i, c == null ? void 0 : c.userId, c == null ? void 0 : c.authToken]), !m || !f || !x ? null : /* @__PURE__ */ r.createElement(
1841
+ bs,
1835
1842
  {
1836
1843
  value: {
1837
1844
  ...t,
1838
- userSession: h,
1839
- aiAgentInfo: { ...f, ...i == null ? void 0 : i.bot },
1840
- launcherInfo: { ...x, ...i == null ? void 0 : i.launcher }
1845
+ userSession: m,
1846
+ aiAgentInfo: { ...f, ...a == null ? void 0 : a.bot },
1847
+ launcherInfo: { ...x, ...a == null ? void 0 : a.launcher }
1841
1848
  }
1842
1849
  },
1843
1850
  e
1844
1851
  );
1845
1852
  };
1846
- function xs({ sound: e }) {
1853
+ function Cs({ sound: e }) {
1847
1854
  const t = "🔔You have received a new message", n = document.title, o = setInterval(() => {
1848
1855
  document.title = document.title === t ? n : t;
1849
1856
  }, 750);
@@ -1860,20 +1867,20 @@ const j = (e) => {
1860
1867
  color: n,
1861
1868
  className: o,
1862
1869
  ...s
1863
- }) => /* @__PURE__ */ r.createElement(vs, { as: e, $variant: t, className: o, $color: n, ...s }), qt = /* @__PURE__ */ new WeakMap(), Cs = (e, t) => {
1870
+ }) => /* @__PURE__ */ r.createElement(ys, { as: e, $variant: t, className: o, $color: n, ...s }), qt = /* @__PURE__ */ new WeakMap(), vs = (e, t) => {
1864
1871
  let n = qt.get(t);
1865
1872
  n || (n = /* @__PURE__ */ new Map(), qt.set(t, n));
1866
1873
  const o = n.get(e);
1867
1874
  if (o) return o;
1868
- const s = t[e] ?? t.body1, a = I`font-size:${j(s.fontSize)};font-weight:${s.fontWeight};${s.fontFamily ? `font-family: ${s.fontFamily};` : ""}
1875
+ const s = t[e] ?? t.body1, i = I`font-size:${j(s.fontSize)};font-weight:${s.fontWeight};${s.fontFamily ? `font-family: ${s.fontFamily};` : ""}
1869
1876
  ${s.lineHeight ? `line-height: ${s.lineHeight};` : "line-height: 100%;"}
1870
1877
  `;
1871
- return n.set(e, a), a;
1872
- }, vs = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => Cs(e, t.typography)}color:${({ $color: e }) => e};`, ie = "sb-agent", Q = {
1873
- ENTRY: `${ie}-entry`,
1874
- MODAL_ROOT: `${ie}-modal-root`,
1875
- WINDOW: `${ie}-window`,
1876
- LAUNCHER: `${ie}-launcher`
1878
+ return n.set(e, i), i;
1879
+ }, ys = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => vs(e, t.typography)}color:${({ $color: e }) => e};`, J = "sb-agent", ee = {
1880
+ ENTRY: `${J}-entry`,
1881
+ MODAL_ROOT: `${J}-modal-root`,
1882
+ WINDOW: `${J}-window`,
1883
+ LAUNCHER: `${J}-launcher`
1877
1884
  }, Ue = 2147483647, fe = {
1878
1885
  MODAL: Ue - 1,
1879
1886
  // FIXME: need to cover the case where the tooltip is on the top of the modal
@@ -1883,14 +1890,14 @@ const j = (e) => {
1883
1890
  }, $n = {
1884
1891
  DEFAULT_PRIMARY: "#742ddd",
1885
1892
  WHITE: "#ffffff"
1886
- }, Mn = 36, ys = 100, _s = 25 * 1024 * 1024, On = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], St = "noopener noreferrer nofollow", Le = 244, Ln = 640, Ye = 26, Rn = 4, ee = 12, Te = 2, Ss = 16, te = `${ie}-incoming-msg`, Ts = `${ie}-marked-text`;
1893
+ }, Mn = 36, _s = 100, Ss = 25 * 1024 * 1024, On = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], St = "noopener noreferrer nofollow", Le = 244, Ln = 640, Ye = 26, Rn = 4, te = 12, Te = 2, Ts = 16, ne = `${J}-incoming-msg`, ws = `${J}-marked-text`;
1887
1894
  function Tt(e) {
1888
1895
  switch (e) {
1889
1896
  case "top":
1890
1897
  case "middle":
1891
1898
  return Te;
1892
1899
  default:
1893
- return Ss;
1900
+ return Ts;
1894
1901
  }
1895
1902
  }
1896
1903
  function wt(e, t) {
@@ -1909,7 +1916,7 @@ function wt(e, t) {
1909
1916
  function Dn(e) {
1910
1917
  return e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0;
1911
1918
  }
1912
- const ws = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), As = {
1919
+ const As = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), ks = {
1913
1920
  spinner: T(() => import("./BcUGcaq2.js")),
1914
1921
  chat: T(() => import("./DcFCGVBm.js")),
1915
1922
  message: T(() => import("./DsGXnanX.js")),
@@ -1945,18 +1952,18 @@ const ws = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"])
1945
1952
  template: T(() => import("./awO7aBCv.js")),
1946
1953
  source: T(() => import("./_EVMCh6Y.js"))
1947
1954
  }, M = ({ type: e, size: t = 24, className: n, color: o }) => {
1948
- const s = As[e];
1955
+ const s = ks[e];
1949
1956
  return /* @__PURE__ */ r.createElement(
1950
- Is,
1957
+ $s,
1951
1958
  {
1952
1959
  className: n,
1953
- $rtlFlip: ws.has(e),
1960
+ $rtlFlip: As.has(e),
1954
1961
  $size: t,
1955
1962
  $color: o ?? p.color.primary.main
1956
1963
  },
1957
1964
  /* @__PURE__ */ r.createElement(ke, { fallback: null }, /* @__PURE__ */ r.createElement(s, null))
1958
1965
  );
1959
- }, ks = I`[dir='rtl'] &{transform:scaleX(-1);}`, Is = u.div`width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(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 && ks};`;
1966
+ }, Is = I`[dir='rtl'] &{transform:scaleX(-1);}`, $s = u.div`width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(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 && Is};`;
1960
1967
  function At({
1961
1968
  name: e,
1962
1969
  type: t = "FILE",
@@ -1964,12 +1971,12 @@ function At({
1964
1971
  iconBackgroundColor: o,
1965
1972
  onClick: s
1966
1973
  }) {
1967
- const { colors: a } = xt();
1968
- return /* @__PURE__ */ r.createElement($s, { onClick: s, $clickable: !!s }, /* @__PURE__ */ r.createElement(Os, { $bgColor: o ?? a.base.primary }, /* @__PURE__ */ r.createElement(M, { type: "file-document", size: 24, color: n ?? a.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Ls, null, /* @__PURE__ */ r.createElement(Rs, { variant: "button", color: p.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(w, { color: p.themedColor.textMidEmphasis, variant: "caption3" }, t)));
1974
+ const { colors: i } = xt();
1975
+ return /* @__PURE__ */ r.createElement(Ms, { onClick: s, $clickable: !!s }, /* @__PURE__ */ r.createElement(Ls, { $bgColor: o ?? i.base.primary }, /* @__PURE__ */ r.createElement(M, { type: "file-document", size: 24, color: n ?? i.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Rs, null, /* @__PURE__ */ r.createElement(Ds, { variant: "button", color: p.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(w, { color: p.themedColor.textMidEmphasis, variant: "caption3" }, t)));
1969
1976
  }
1970
- const $s = u.div`border-radius:12px;gap:8px;width:${Le}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${p.themedColor.textDisabled};background-color:${p.themedColor.bg_50_600};${({ $clickable: e }) => e && Ms}`, Ms = I`cursor:pointer;&:hover{background-color:${p.themedColor.bg_100_500};}`, Os = u.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Ls = u.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Rs = u(w)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
1971
- function Ds({ file: e, children: t, onClickFile: n }) {
1972
- return /* @__PURE__ */ r.createElement(Ns, null, /* @__PURE__ */ r.createElement(
1977
+ const Ms = u.div`border-radius:12px;gap:8px;width:${Le}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${p.themedColor.textDisabled};background-color:${p.themedColor.bg_50_600};${({ $clickable: e }) => e && Os}`, Os = I`cursor:pointer;&:hover{background-color:${p.themedColor.bg_100_500};}`, Ls = u.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Rs = u.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ds = u(w)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
1978
+ function Ns({ file: e, children: t, onClickFile: n }) {
1979
+ return /* @__PURE__ */ r.createElement(Ps, null, /* @__PURE__ */ r.createElement(
1973
1980
  At,
1974
1981
  {
1975
1982
  name: e.name,
@@ -1978,63 +1985,63 @@ function Ds({ file: e, children: t, onClickFile: n }) {
1978
1985
  }
1979
1986
  ), t);
1980
1987
  }
1981
- const Ns = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`;
1982
- function Ps({ file: e, onClickMedia: t, children: n }) {
1983
- const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Us, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Hs, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
1988
+ const Ps = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`;
1989
+ function Bs({ file: e, onClickMedia: t, children: n }) {
1990
+ const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Hs, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(zs, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
1984
1991
  if (o) {
1985
1992
  const s = {
1986
- id: `${te}-media-body`,
1993
+ id: `${ne}-media-body`,
1987
1994
  onClick: () => t == null ? void 0 : t(e)
1988
1995
  };
1989
- return /* @__PURE__ */ r.createElement(Bs, null, /* @__PURE__ */ r.createElement(Fs, { ...s }, o()), n);
1996
+ return /* @__PURE__ */ r.createElement(Fs, null, /* @__PURE__ */ r.createElement(Us, { ...s }, o()), n);
1990
1997
  }
1991
1998
  return null;
1992
1999
  }
1993
- const Bs = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`, Fs = u.div`width:${Le}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${P.light`
2000
+ const Fs = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`, Us = u.div`width:${Le}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${P.light`
1994
2001
  background-color: ${p.color.background100};
1995
2002
  `}
1996
2003
  ${P.dark`
1997
2004
  background-color: ${p.color.background400};
1998
2005
  `}
1999
- `, Us = u.img`width:100%;height:100%;object-fit:cover;`, Hs = u.video`width:100%;height:100%;object-fit:cover;`, zs = "✱";
2006
+ `, Hs = u.img`width:100%;height:100%;object-fit:cover;`, zs = u.video`width:100%;height:100%;object-fit:cover;`, Vs = "✱";
2000
2007
  function Nn(e) {
2001
- const t = new RegExp(`${zs}+`, "g");
2002
- return e.replace(t, (n) => `<span id=${Ts} aria-label="masked-text">${n}</span>`);
2008
+ const t = new RegExp(`${Vs}+`, "g");
2009
+ return e.replace(t, (n) => `<span id=${ws} aria-label="masked-text">${n}</span>`);
2003
2010
  }
2004
- function Vs(e) {
2011
+ function Ws(e) {
2005
2012
  return e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>");
2006
2013
  }
2007
- function Ws(e) {
2014
+ function Gs(e) {
2008
2015
  const t = /```(\w+)?\n([\s\S]*?)```/g, n = [];
2009
2016
  let o = 0;
2010
- return e.replace(t, (s, ...a) => {
2011
- const [i, l, c] = a;
2017
+ return e.replace(t, (s, ...i) => {
2018
+ const [a, l, c] = i;
2012
2019
  return o < c && n.push({
2013
2020
  type: "text",
2014
2021
  value: e.slice(o, c).trim()
2015
2022
  }), n.push({
2016
2023
  type: "code",
2017
2024
  value: l.trim(),
2018
- language: i ? i.trim() : "plaintext"
2025
+ language: a ? a.trim() : "plaintext"
2019
2026
  }), o = c + s.length, s;
2020
2027
  }), o < e.length && n.push({
2021
2028
  type: "text",
2022
2029
  value: e.slice(o).trim()
2023
2030
  }), n.map((s) => s.type !== "text" ? s : { ...s, value: Nn(s.value) });
2024
2031
  }
2025
- const Gs = T(async () => ({ default: (await import("./4nxZMIz3.js")).MarkdownText })), js = T(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2032
+ const js = T(async () => ({ default: (await import("./D5uRw0Em.js")).MarkdownText })), Ks = T(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2026
2033
  function Jt(e) {
2027
- var s, a;
2028
- const t = e.maxBodyWidth ?? Le, n = ae(() => Ws(e.message), [e.message]), o = {
2029
- id: `${te}-text-body`,
2034
+ var s, i;
2035
+ const t = e.maxBodyWidth ?? Le, n = ae(() => Gs(e.message), [e.message]), o = {
2036
+ id: `${ne}-text-body`,
2030
2037
  $maxWidth: t,
2031
2038
  $color: (s = e.customStyle) == null ? void 0 : s.bubbleContentColor,
2032
- $bgColor: (a = e.customStyle) == null ? void 0 : a.bubbleBackgroundColor
2039
+ $bgColor: (i = e.customStyle) == null ? void 0 : i.bubbleBackgroundColor
2033
2040
  };
2034
- return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Xt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Xt, { ...o }, n.map((i, l) => i.type === "text" ? /* @__PURE__ */ r.createElement(Qt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(ke, { fallback: i.value }, /* @__PURE__ */ r.createElement(Gs, { onClickImage: (c) => {
2041
+ return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Xt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Xt, { ...o }, n.map((a, l) => a.type === "text" ? /* @__PURE__ */ r.createElement(Qt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(ke, { fallback: a.value }, /* @__PURE__ */ r.createElement(js, { onClickImage: (c) => {
2035
2042
  var d;
2036
2043
  return (d = e.onClickMedia) == null ? void 0 : d.call(e, { url: c, type: "image/*" });
2037
- } }, i.value))) : i.type === "code" ? /* @__PURE__ */ r.createElement(ke, { key: l, fallback: /* @__PURE__ */ r.createElement(Qt, { variant: "body3" }, i.value) }, /* @__PURE__ */ r.createElement(js, { code: i.value, language: i.language })) : null), e.children);
2044
+ } }, a.value))) : a.type === "code" ? /* @__PURE__ */ r.createElement(ke, { key: l, fallback: /* @__PURE__ */ r.createElement(Qt, { variant: "body3" }, a.value) }, /* @__PURE__ */ r.createElement(Ks, { code: a.value, language: a.language })) : null), e.children);
2038
2045
  }
2039
2046
  const Xt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
2040
2047
  color: ${t || e.colors.messageIncoming.text};
@@ -2044,38 +2051,38 @@ const Xt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:
2044
2051
  transition: max-width 0.3s;
2045
2052
  overflow-wrap: break-word;
2046
2053
  `, Qt = u(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
2047
- function Ks(e) {
2054
+ function Zs(e) {
2048
2055
  const { stringSet: t } = O(), n = Dn(e) ? /* @__PURE__ */ r.createElement(Jt, { ...e }) : null;
2049
2056
  if (e.messageType === "user")
2050
2057
  return n;
2051
2058
  if (e.messageType === "file") {
2052
2059
  const o = e.file;
2053
- return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Ps, { ...e }, n) : /* @__PURE__ */ r.createElement(Ds, { ...e }, n);
2060
+ return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Bs, { ...e }, n) : /* @__PURE__ */ r.createElement(Ns, { ...e }, n);
2054
2061
  }
2055
2062
  return /* @__PURE__ */ r.createElement(Jt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
2056
2063
  }
2057
2064
  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" }));
2058
2065
  function It({ id: e, src: t, size: n = 56, onClick: o, style: s }) {
2059
- return /* @__PURE__ */ r.createElement(Zs, { id: e, tabIndex: 0, onClick: o, $size: j(n), style: s }, t ? /* @__PURE__ */ r.createElement(Ys, { src: t }) : /* @__PURE__ */ r.createElement(M, { type: "user", size: n }));
2066
+ return /* @__PURE__ */ r.createElement(Ys, { id: e, tabIndex: 0, onClick: o, $size: j(n), style: s }, t ? /* @__PURE__ */ r.createElement(qs, { src: t }) : /* @__PURE__ */ r.createElement(M, { type: "user", size: n }));
2060
2067
  }
2061
- const Zs = 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:${p.themedColor.bg_100_500};&:focus{outline:none;}`, Ys = u.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
2062
- function qs({ sender: e, isBotMessage: t }) {
2063
- const n = `${te}-sender-avatar`;
2064
- return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Js, { id: n }, /* @__PURE__ */ r.createElement(kt, null)) : /* @__PURE__ */ r.createElement(It, { id: n, size: Ye, src: e.profileUrl });
2068
+ const Ys = 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:${p.themedColor.bg_100_500};&:focus{outline:none;}`, qs = u.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
2069
+ function Js({ sender: e, isBotMessage: t }) {
2070
+ const n = `${ne}-sender-avatar`;
2071
+ return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Xs, { id: n }, /* @__PURE__ */ r.createElement(kt, null)) : /* @__PURE__ */ r.createElement(It, { id: n, size: Ye, src: e.profileUrl });
2065
2072
  }
2066
- const Js = u.div`flex-shrink:0;width:${Ye}px;height:${Ye}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};}}`;
2067
- function Xs({ sender: e }) {
2068
- return /* @__PURE__ */ r.createElement(Qs, { id: `${te}-sender-name`, variant: "caption1", color: p.themedColor.textMidEmphasis }, e.nickname);
2073
+ const Xs = u.div`flex-shrink:0;width:${Ye}px;height:${Ye}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};}}`;
2074
+ function Qs({ sender: e }) {
2075
+ return /* @__PURE__ */ r.createElement(ei, { id: `${ne}-sender-name`, variant: "caption1", color: p.themedColor.textMidEmphasis }, e.nickname);
2069
2076
  }
2070
- const Qs = u(w)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
2071
- function ei({ createdAt: e }) {
2077
+ const ei = u(w)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
2078
+ function ti({ createdAt: e }) {
2072
2079
  const { stringSet: t, format: n } = O();
2073
- return e ? /* @__PURE__ */ r.createElement(w, { id: `${te}-sent-time`, variant: "caption4", color: p.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
2080
+ return e ? /* @__PURE__ */ r.createElement(w, { id: `${ne}-sent-time`, variant: "caption4", color: p.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
2074
2081
  }
2075
- function ti({ customStyle: e }) {
2076
- return /* @__PURE__ */ r.createElement(ni, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(ri, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
2082
+ function ni({ customStyle: e }) {
2083
+ return /* @__PURE__ */ r.createElement(ri, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(oi, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
2077
2084
  }
2078
- const ni = 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};`, ri = 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;}`;
2085
+ const ri = 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};`, oi = 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;}`;
2079
2086
  function Ie() {
2080
2087
  }
2081
2088
  async function $t(e) {
@@ -2093,41 +2100,41 @@ function Fn(e) {
2093
2100
  const t = (n = e == null ? void 0 : e.conversation) == null ? void 0 : n.handoff;
2094
2101
  return !!(t != null && t.timestamp);
2095
2102
  }
2096
- function oi(e) {
2103
+ function si(e) {
2097
2104
  return Bn(e) && !Fn(e);
2098
2105
  }
2099
- function si({
2106
+ function ii({
2100
2107
  extendedMessagePayload: e,
2101
2108
  onClickCTA: t = ({ url: n }) => $t(n)
2102
2109
  }) {
2103
2110
  const n = e == null ? void 0 : e.cta_button;
2104
- return n ? /* @__PURE__ */ r.createElement(ii, { id: `${te}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(ai, { variant: "button" }, n.label)) : null;
2111
+ return n ? /* @__PURE__ */ r.createElement(ai, { id: `${ne}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(li, { variant: "button" }, n.label)) : null;
2105
2112
  }
2106
- const ii = u.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${p.themedColor.textHighEmphasis};background-color:${p.color.background50};${P.dark`
2113
+ const ai = u.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${p.themedColor.textHighEmphasis};background-color:${p.color.background50};${P.dark`
2107
2114
  background-color: ${p.color.ondark.textDisabled};
2108
2115
  `}
2109
- `, ai = u(w)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
2110
- function li({
2116
+ `, li = u(w)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
2117
+ function ci({
2111
2118
  extendedMessagePayload: e,
2112
2119
  onClickCitation: t = (n) => $t(n.link)
2113
2120
  }) {
2114
2121
  const { stringSet: n } = O(), { theme: o } = Ct(), s = e == null ? void 0 : e.citations;
2115
- return !s || s.length === 0 ? null : /* @__PURE__ */ r.createElement(ci, { id: `${te}-ext-citation` }, /* @__PURE__ */ r.createElement(di, { variant: "caption1", color: o.colors.messageIncoming.text }, n.CITATION_SOURCE_TITLE), /* @__PURE__ */ r.createElement(ui, null, s.map((a, i) => /* @__PURE__ */ r.createElement(
2116
- gi,
2122
+ return !s || s.length === 0 ? null : /* @__PURE__ */ r.createElement(di, { id: `${ne}-ext-citation` }, /* @__PURE__ */ r.createElement(ui, { variant: "caption1", color: o.colors.messageIncoming.text }, n.CITATION_SOURCE_TITLE), /* @__PURE__ */ r.createElement(mi, null, s.map((i, a) => /* @__PURE__ */ r.createElement(
2123
+ hi,
2117
2124
  {
2118
- key: `${a.embedding_id}-${i}`,
2125
+ key: `${i.embedding_id}-${a}`,
2119
2126
  role: "button",
2120
- onClick: () => t(a)
2127
+ onClick: () => t(i)
2121
2128
  },
2122
2129
  /* @__PURE__ */ r.createElement(M, { type: "source", size: 16, color: o.colors.messageIncoming.text }),
2123
- /* @__PURE__ */ r.createElement(mi, { variant: "body3", color: o.colors.messageIncoming.text }, a.title)
2130
+ /* @__PURE__ */ r.createElement(gi, { variant: "body3", color: o.colors.messageIncoming.text }, i.title)
2124
2131
  ))));
2125
2132
  }
2126
- const ci = u.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;padding:8px 12px 6px;`, di = u(w)`opacity:0.5;`, ui = u.div`display:flex;flex-direction:column;gap:8px;`, mi = u(w)`text-decoration:underline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, gi = u.div`display:flex;align-items:center;gap:4px;cursor:pointer;&:hover{opacity:0.5;}`;
2127
- function hi(e) {
2133
+ const di = u.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;padding:8px 12px 6px;`, ui = u(w)`opacity:0.5;`, mi = u.div`display:flex;flex-direction:column;gap:8px;`, gi = u(w)`text-decoration:underline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, hi = u.div`display:flex;align-items:center;gap:4px;cursor:pointer;&:hover{opacity:0.5;}`;
2134
+ function pi(e) {
2128
2135
  return /* @__PURE__ */ r.createElement(r.Fragment, null);
2129
2136
  }
2130
- class pi extends xr {
2137
+ class fi extends xr {
2131
2138
  constructor(t) {
2132
2139
  super(t), this.state = {
2133
2140
  hasError: !1
@@ -2140,126 +2147,126 @@ class pi extends xr {
2140
2147
  return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(ke, { fallback: this.props.loadingFallback }, this.props.children);
2141
2148
  }
2142
2149
  }
2143
- const fi = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: bi } = zr({
2144
- parser: Ur,
2145
- renderer: Fr,
2150
+ const bi = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: Ei } = Vr({
2151
+ parser: Hr,
2152
+ renderer: Ur,
2146
2153
  Container: (e) => /* @__PURE__ */ r.createElement("div", { ...e })
2147
2154
  });
2148
- function Ei(e) {
2155
+ function xi(e) {
2149
2156
  return /* @__PURE__ */ r.createElement(
2150
- pi,
2157
+ fi,
2151
2158
  {
2152
2159
  errorFallback: e.messageTemplateErrorFallback,
2153
2160
  loadingFallback: e.messageTemplateLoadingFallback
2154
2161
  },
2155
- /* @__PURE__ */ r.createElement(xi, { ...e })
2162
+ /* @__PURE__ */ r.createElement(Ci, { ...e })
2156
2163
  );
2157
2164
  }
2158
- const xi = ({
2165
+ const Ci = ({
2159
2166
  extendedMessagePayload: e,
2160
2167
  onGetCachedMessageTemplate: t = () => null,
2161
2168
  onRequestMessageTemplate: n,
2162
2169
  onHandleTemplateInternalAction: o = Ie
2163
2170
  }) => {
2164
2171
  const s = e == null ? void 0 : e.message_template;
2165
- if (!fi.has((s == null ? void 0 : s.type) ?? "default")) throw new Error("Unsupported template type");
2172
+ if (!bi.has((s == null ? void 0 : s.type) ?? "default")) throw new Error("Unsupported template type");
2166
2173
  if (!n) throw new Error("onRequestMessageTemplate is required");
2167
- const { theme: i } = ls(), l = Zo({
2174
+ const { theme: a } = cs(), l = Yo({
2168
2175
  onRequestTemplate: n,
2169
2176
  onGetCachedTemplate: t,
2170
- theme: i.selectedTheme,
2177
+ theme: a.selectedTheme,
2171
2178
  templateKey: (s == null ? void 0 : s.key) ?? "invalid",
2172
2179
  variables: s == null ? void 0 : s.variables,
2173
2180
  viewVariables: s == null ? void 0 : s.view_variables,
2174
- aiAgentColorVariables: i.aiAgentColorVariables
2181
+ aiAgentColorVariables: a.aiAgentColorVariables
2175
2182
  });
2176
- return /* @__PURE__ */ r.createElement(Ci, { id: `${te}-ext-message-template` }, /* @__PURE__ */ r.createElement(
2177
- Hr,
2183
+ return /* @__PURE__ */ r.createElement(vi, { id: `${ne}-ext-message-template` }, /* @__PURE__ */ r.createElement(
2184
+ zr,
2178
2185
  {
2179
2186
  handleInternalAction: (c, d) => {
2180
2187
  c.stopPropagation(), o == null || o(d);
2181
2188
  }
2182
2189
  },
2183
- /* @__PURE__ */ r.createElement(bi, { templateItems: l.body.items, templateVersion: l.version })
2190
+ /* @__PURE__ */ r.createElement(Ei, { templateItems: l.body.items, templateVersion: l.version })
2184
2191
  ));
2185
- }, Ci = u.div`box-sizing:border-box;overflow:hidden;width:100%;`;
2186
- function vi({
2192
+ }, vi = u.div`box-sizing:border-box;overflow:hidden;width:100%;`;
2193
+ function yi({
2187
2194
  extendedMessagePayload: e,
2188
2195
  onClickSuggestedReply: t,
2189
2196
  suggestedRepliesDirection: n = "vertical"
2190
2197
  }) {
2191
- const [o, s] = _(!1), a = (e == null ? void 0 : e.suggested_replies) ?? [];
2192
- return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(yi, { id: `${te}-ext-suggested-replies`, $type: n }, a.map((i, l) => /* @__PURE__ */ r.createElement(
2193
- _i,
2198
+ const [o, s] = _(!1), i = (e == null ? void 0 : e.suggested_replies) ?? [];
2199
+ return i.length === 0 || o ? null : /* @__PURE__ */ r.createElement(_i, { id: `${ne}-ext-suggested-replies`, $type: n }, i.map((a, l) => /* @__PURE__ */ r.createElement(
2200
+ Si,
2194
2201
  {
2195
2202
  key: l,
2196
2203
  $type: n,
2197
2204
  variant: "body3",
2198
2205
  onClick: () => {
2199
- t && (t == null || t({ reply: i }), s(!0));
2206
+ t && (t == null || t({ reply: a }), s(!0));
2200
2207
  }
2201
2208
  },
2202
- i
2209
+ a
2203
2210
  )));
2204
2211
  }
2205
- const yi = u.div`margin:16px 0;padding:0 ${ee}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? Si : Ti};`, _i = u(w)`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:${p.color.primary.main};border:1px solid ${p.color.primary.main};background-color:${p.themedColor.bg_50_600};&:hover{background-color:${p.themedColor.bg_100_500};}${({ $type: e, theme: t }) => I`
2206
- ${e === "vertical" ? wi : Ai};
2212
+ const _i = u.div`margin:16px 0;padding:0 ${te}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? Ti : wi};`, Si = u(w)`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:${p.color.primary.main};border:1px solid ${p.color.primary.main};background-color:${p.themedColor.bg_50_600};&:hover{background-color:${p.themedColor.bg_100_500};}${({ $type: e, theme: t }) => I`
2213
+ ${e === "vertical" ? Ai : ki};
2207
2214
  &:active {
2208
2215
  background-color: ${t.colors.base.primary};
2209
2216
  color: ${t.colors.base.primaryContrastContent};
2210
2217
  }
2211
2218
  `}
2212
- `, Si = I`flex-direction:column;align-items:flex-end;`, Ti = I`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, wi = I`max-width:calc(100% - 70px);white-space:pre-wrap;`, Ai = I`white-space:nowrap;`;
2219
+ `, Ti = I`flex-direction:column;align-items:flex-end;`, wi = I`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Ai = I`max-width:calc(100% - 70px);white-space:pre-wrap;`, ki = I`white-space:nowrap;`;
2213
2220
  function Mt(e) {
2214
2221
  return e();
2215
2222
  }
2216
2223
  const xe = _e({
2217
- template: ki,
2224
+ template: Ii,
2218
2225
  components: {
2219
- SenderName: Xs,
2220
- SenderAvatar: qs,
2221
- SentTime: ei,
2222
- MessageBody: Ks,
2223
- TypingIndicator: ti,
2224
- SuggestedReplies: vi,
2225
- MessageTemplate: Ei,
2226
- CTAButton: si,
2227
- Citation: li,
2228
- MessageLogs: hi
2226
+ SenderName: Qs,
2227
+ SenderAvatar: Js,
2228
+ SentTime: ti,
2229
+ MessageBody: Zs,
2230
+ TypingIndicator: ni,
2231
+ SuggestedReplies: yi,
2232
+ MessageTemplate: xi,
2233
+ CTAButton: ii,
2234
+ Citation: ci,
2235
+ MessageLogs: pi
2229
2236
  }
2230
2237
  });
2231
- function ki(e) {
2238
+ function Ii(e) {
2232
2239
  return /* @__PURE__ */ r.createElement(Un, { ...e, testerMode: !1 });
2233
2240
  }
2234
2241
  function Un(e) {
2235
- var f, x, b, E, m;
2236
- const { components: t } = xe.useContext(), n = !!e.isTyping, o = e.testerMode, s = !!((f = e.extendedMessagePayload) != null && f.message_template), a = !!((x = e.extendedMessagePayload) != null && x.cta_button), i = !!((b = e.extendedMessagePayload) != null && b.citations) && e.extendedMessagePayload.citations.length > 0, l = !!e.createdAt, c = Mt(() => e.messageType === "user" ? e.message.length > 0 : !0), d = e.groupType === "top" || e.groupType === "single", g = e.groupType === "bottom" || e.groupType === "single", h = o ? 0 : Ye;
2237
- return /* @__PURE__ */ r.createElement(Ii, { $marginBottom: n ? 0 : Tt(e.groupType) }, d && /* @__PURE__ */ r.createElement($i, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Ut, null, /* @__PURE__ */ r.createElement(at, { $extraStartPadding: h }, 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(t.Citation, { ...e }))), s && /* @__PURE__ */ r.createElement(en, { $startPadding: 0, $endPadding: 0, style: { marginTop: c ? Te : 0 } }, /* @__PURE__ */ r.createElement(
2242
+ var f, x, E, b, g;
2243
+ const { components: t } = xe.useContext(), n = !!e.isTyping, o = e.testerMode, s = !!((f = e.extendedMessagePayload) != null && f.message_template), i = !!((x = e.extendedMessagePayload) != null && x.cta_button), a = !!((E = e.extendedMessagePayload) != null && E.citations) && e.extendedMessagePayload.citations.length > 0, l = !!e.createdAt, c = Mt(() => e.messageType === "user" ? e.message.length > 0 : !0), d = e.groupType === "top" || e.groupType === "single", h = e.groupType === "bottom" || e.groupType === "single", m = o ? 0 : Ye;
2244
+ return /* @__PURE__ */ r.createElement($i, { $marginBottom: n ? 0 : Tt(e.groupType) }, d && /* @__PURE__ */ r.createElement(Mi, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Ut, null, /* @__PURE__ */ r.createElement(at, { $extraStartPadding: m }, n && /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }), /* @__PURE__ */ r.createElement(t.MessageBody, { ...e }, i && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...e })), a && /* @__PURE__ */ r.createElement(t.Citation, { ...e }))), s && /* @__PURE__ */ r.createElement(en, { $startPadding: 0, $endPadding: 0, style: { marginTop: c ? Te : 0 } }, /* @__PURE__ */ r.createElement(
2238
2245
  t.MessageTemplate,
2239
2246
  {
2240
2247
  ...e,
2241
- messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(at, { $extraStartPadding: h }, /* @__PURE__ */ r.createElement(
2248
+ messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(at, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(
2242
2249
  t.MessageBody,
2243
2250
  {
2244
2251
  ...e,
2245
2252
  messageType: "user",
2246
- message: ((m = (E = e.extendedMessagePayload) == null ? void 0 : E.message_template) == null ? void 0 : m.fallback_message) ?? "Cannot read this template."
2253
+ message: ((g = (b = e.extendedMessagePayload) == null ? void 0 : b.message_template) == null ? void 0 : g.fallback_message) ?? "Cannot read this template."
2247
2254
  }
2248
2255
  )),
2249
- messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(at, { $extraStartPadding: h }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
2256
+ messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(at, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
2250
2257
  }
2251
- ))), g && l && /* @__PURE__ */ r.createElement(Mi, { $extraStartPadding: h + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Ut, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(en, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
2258
+ ))), h && l && /* @__PURE__ */ r.createElement(Oi, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Ut, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(en, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
2252
2259
  }
2253
- const Ii = u.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
2254
- `, tt = u.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = ee, $endPadding: t = ee, $extraStartPadding: n = 0 }) => `
2260
+ const $i = u.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
2261
+ `, tt = u.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = te, $endPadding: t = te, $extraStartPadding: n = 0 }) => `
2255
2262
  padding-inline: ${e + n}px ${t}px;
2256
2263
  `}
2257
- `, $i = u(tt)`display:flex;flex-direction:row;align-items:center;gap:8px;`, at = u(tt)`display:flex;`, Mi = u(tt)`margin-top:${Rn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, en = u(tt)`display:flex;flex-direction:column;${({ $startPadding: e = ee, $endPadding: t = ee, $extraStartPadding: n = 0 }) => `
2264
+ `, Mi = u(tt)`display:flex;flex-direction:row;align-items:center;gap:8px;`, at = u(tt)`display:flex;`, Oi = u(tt)`margin-top:${Rn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, en = u(tt)`display:flex;flex-direction:column;${({ $startPadding: e = te, $endPadding: t = te, $extraStartPadding: n = 0 }) => `
2258
2265
  padding-inline: ${e + n}px ${t}px;
2259
2266
  `}
2260
2267
  `;
2261
- function Oi({ file: e, children: t, onClickFile: n }) {
2262
- return /* @__PURE__ */ r.createElement(Li, null, /* @__PURE__ */ r.createElement(
2268
+ function Li({ file: e, children: t, onClickFile: n }) {
2269
+ return /* @__PURE__ */ r.createElement(Ri, null, /* @__PURE__ */ r.createElement(
2263
2270
  At,
2264
2271
  {
2265
2272
  name: e.name,
@@ -2268,54 +2275,54 @@ function Oi({ file: e, children: t, onClickFile: n }) {
2268
2275
  }
2269
2276
  ), t);
2270
2277
  }
2271
- const Li = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, Hn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(Ri, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(M, { type: "spinner", size: n })), Ri = u.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
2272
- function Di({ file: e, metadata: t, onClickMedia: n, children: o }) {
2273
- const { aspectRatio: s, localFile: a } = t, [i] = _(() => a instanceof File ? URL.createObjectURL(a) : e.url), [l, c] = _(!1), d = {
2278
+ const Ri = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, Hn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(Di, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(M, { type: "spinner", size: n })), Di = u.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
2279
+ function Ni({ file: e, metadata: t, onClickMedia: n, children: o }) {
2280
+ const { aspectRatio: s, localFile: i } = t, [a] = _(() => i instanceof File ? URL.createObjectURL(i) : e.url), [l, c] = _(!1), d = {
2274
2281
  onClick: () => n == null ? void 0 : n(e),
2275
2282
  $ratio: s
2276
2283
  };
2277
- return /* @__PURE__ */ r.createElement(Ni, null, /* @__PURE__ */ r.createElement(Pi, { ...d }, !l && /* @__PURE__ */ r.createElement(Hn, { size: 26 }, /* @__PURE__ */ r.createElement(M, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement(Bi, { $loaded: l, src: i, alt: "image-message", onLoad: () => c(!0) })), o);
2284
+ return /* @__PURE__ */ r.createElement(Pi, null, /* @__PURE__ */ r.createElement(Bi, { ...d }, !l && /* @__PURE__ */ r.createElement(Hn, { size: 26 }, /* @__PURE__ */ r.createElement(M, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement(Fi, { $loaded: l, src: a, alt: "image-message", onLoad: () => c(!0) })), o);
2278
2285
  }
2279
- const Ni = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, Pi = u.div`width:${Le}px;border-radius:12px;overflow:hidden;cursor:pointer;height:auto;aspect-ratio:${(e) => e.$ratio};position:relative;display:flex;align-items:center;justify-content:center;${P.light`
2286
+ const Pi = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, Bi = u.div`width:${Le}px;border-radius:12px;overflow:hidden;cursor:pointer;height:auto;aspect-ratio:${(e) => e.$ratio};position:relative;display:flex;align-items:center;justify-content:center;${P.light`
2280
2287
  background-color: ${p.color.background100};
2281
2288
  `}
2282
2289
  ${P.dark`
2283
2290
  background-color: ${p.color.background400};
2284
2291
  `}
2285
- `, Bi = 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;`;
2292
+ `, Fi = 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;`;
2286
2293
  function tn(e) {
2287
2294
  var n, o;
2288
2295
  const t = ae(() => {
2289
- const s = Vs(Nn(e.message));
2296
+ const s = Ws(Nn(e.message));
2290
2297
  return yn.sanitize(s);
2291
2298
  }, [e.message]);
2292
2299
  return /* @__PURE__ */ r.createElement(
2293
- Fi,
2300
+ Ui,
2294
2301
  {
2295
2302
  $maxWidth: e.maxBodyWidth ?? Le,
2296
2303
  $color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
2297
2304
  $bgColor: (o = e.customStyle) == null ? void 0 : o.bubbleBackgroundColor
2298
2305
  },
2299
- /* @__PURE__ */ r.createElement(Ui, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
2306
+ /* @__PURE__ */ r.createElement(Hi, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
2300
2307
  );
2301
2308
  }
2302
- const Fi = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
2309
+ const Ui = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
2303
2310
  color: ${t || e.colors.messageOutgoing.text};
2304
2311
  background-color: ${n || e.colors.messageOutgoing.background};
2305
2312
  `}
2306
2313
  padding: 12px 0;
2307
2314
  transition: max-width 0.3s;
2308
2315
  overflow-wrap: break-word;
2309
- `, Ui = u(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
2310
- function Hi(e) {
2316
+ `, Hi = u(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
2317
+ function zi(e) {
2311
2318
  const { stringSet: t } = O(), n = Dn(e) ? /* @__PURE__ */ r.createElement(tn, { ...e }) : null;
2312
- return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Di, { ...e }, n) : /* @__PURE__ */ r.createElement(Oi, { ...e }, n) : /* @__PURE__ */ r.createElement(tn, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
2319
+ return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Ni, { ...e }, n) : /* @__PURE__ */ r.createElement(Li, { ...e }, n) : /* @__PURE__ */ r.createElement(tn, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
2313
2320
  }
2314
- function zi({ sendingStatus: e }) {
2321
+ function Vi({ sendingStatus: e }) {
2315
2322
  const t = xt();
2316
2323
  switch (e) {
2317
2324
  case "pending":
2318
- return /* @__PURE__ */ r.createElement(Vi, { size: 16 }, /* @__PURE__ */ r.createElement(M, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
2325
+ return /* @__PURE__ */ r.createElement(Wi, { size: 16 }, /* @__PURE__ */ r.createElement(M, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
2319
2326
  case "failed":
2320
2327
  return /* @__PURE__ */ r.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ r.createElement(M, { type: "error", color: p.themedColor.error, size: 16 }));
2321
2328
  case "scheduled":
@@ -2325,40 +2332,40 @@ function zi({ sendingStatus: e }) {
2325
2332
  return /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(M, { type: "chevron-down" }));
2326
2333
  }
2327
2334
  }
2328
- const Vi = u(Hn)`margin-bottom:2px;width:16px;height:16px;`;
2329
- function Wi({ createdAt: e }) {
2335
+ const Wi = u(Hn)`margin-bottom:2px;width:16px;height:16px;`;
2336
+ function Gi({ createdAt: e }) {
2330
2337
  const { stringSet: t, format: n } = O();
2331
2338
  return e ? /* @__PURE__ */ r.createElement(w, { variant: "caption4", color: p.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
2332
2339
  }
2333
2340
  const Ot = _e({
2334
- template: Gi,
2341
+ template: ji,
2335
2342
  components: {
2336
- SendingStatus: zi,
2337
- SentTime: Wi,
2338
- MessageBody: Hi
2343
+ SendingStatus: Vi,
2344
+ SentTime: Gi,
2345
+ MessageBody: zi
2339
2346
  }
2340
2347
  });
2341
- function Gi(e) {
2348
+ function ji(e) {
2342
2349
  const { components: t } = Ot.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
2343
- return /* @__PURE__ */ r.createElement(ji, { $marginBottom: Tt(e.groupType) }, /* @__PURE__ */ r.createElement(Ki, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(Zi, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
2350
+ return /* @__PURE__ */ r.createElement(Ki, { $marginBottom: Tt(e.groupType) }, /* @__PURE__ */ r.createElement(Zi, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(Yi, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
2344
2351
  }
2345
- const ji = u.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
2346
- `, zn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = ee, $endPadding: t = ee, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
2347
- `, Ki = u(zn)``, Zi = u(zn)`margin-top:${Rn}px;`;
2348
- function Yi(e) {
2349
- return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(qi, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, Ji(yn.sanitize(e.message))));
2352
+ const Ki = u.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
2353
+ `, zn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = te, $endPadding: t = te, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
2354
+ `, Zi = u(zn)``, Yi = u(zn)`margin-top:${Rn}px;`;
2355
+ function qi(e) {
2356
+ return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Ji, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, Xi(yn.sanitize(e.message))));
2350
2357
  }
2351
- const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Ji = (e) => {
2358
+ const Ji = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Xi = (e) => {
2352
2359
  const t = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, n = [];
2353
2360
  let o = 0;
2354
- return e.replace(t, (s, a, i, l) => (n.push(e.slice(o, l)), n.push(
2355
- /* @__PURE__ */ r.createElement("a", { key: i, href: i, target: "_blank", rel: St }, a)
2361
+ return e.replace(t, (s, i, a, l) => (n.push(e.slice(o, l)), n.push(
2362
+ /* @__PURE__ */ r.createElement("a", { key: a, href: a, target: "_blank", rel: St }, i)
2356
2363
  ), o = l + s.length, s)), n.push(e.slice(o)), n;
2357
- }, Xi = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
2364
+ }, Qi = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
2358
2365
  const { stringSet: s } = O();
2359
2366
  return L(() => {
2360
2367
  typeof n > "u" && typeof t == "boolean" && (o == null || o(t));
2361
- }, [n, t]), /* @__PURE__ */ r.createElement(Qi, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, s.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
2368
+ }, [n, t]), /* @__PURE__ */ r.createElement(ea, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, s.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
2362
2369
  nn,
2363
2370
  {
2364
2371
  checked: n === !0,
@@ -2376,16 +2383,16 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
2376
2383
  }
2377
2384
  )));
2378
2385
  }, nn = ({ onClick: e, checked: t, label: n, disabled: o }) => {
2379
- const s = t ? p.color.primary.main : o ? p.themedColor.textDisabled : p.themedColor.textLowEmphasis, a = t ? p.themedColor.textHighEmphasis : o ? p.themedColor.textLowEmphasis : p.themedColor.textHighEmphasis;
2380
- return /* @__PURE__ */ r.createElement(ea, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(M, { size: 24, type: t ? "radio-on" : "radio-off", color: s }), /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: a }, n));
2381
- }, Qi = u.div`display:flex;flex-direction:column;gap:8px;`, ea = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, ta = (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 })), 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: "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" })))), 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.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" })), 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("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" })), sa = (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" })), ia = (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" })), aa = (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" })), la = (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" })), ca = (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" })), da = (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: {
2386
+ const s = t ? p.color.primary.main : o ? p.themedColor.textDisabled : p.themedColor.textLowEmphasis, i = t ? p.themedColor.textHighEmphasis : o ? p.themedColor.textLowEmphasis : p.themedColor.textHighEmphasis;
2387
+ return /* @__PURE__ */ r.createElement(ta, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(M, { size: 24, type: t ? "radio-on" : "radio-off", color: s }), /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: i }, n));
2388
+ }, ea = u.div`display:flex;flex-direction:column;gap:8px;`, ta = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, na = (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 })), 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: "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" })))), oa = (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" })), sa = (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" })), ia = (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" })), aa = (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" })), la = (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" })), ca = (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" })), da = (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" })), ua = (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: {
2382
2389
  maskType: "alpha"
2383
- }, 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)" })))), ua = [
2390
+ }, 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)" })))), ma = [
2384
2391
  {
2385
2392
  value: 1,
2386
2393
  Icon: {
2387
- Active: na,
2388
- Inactive: ta
2394
+ Active: ra,
2395
+ Inactive: na
2389
2396
  },
2390
2397
  isActive: (e) => e <= 1,
2391
2398
  getTooltip: (e) => e.CSAT5_RATING_SCORE_1
@@ -2393,8 +2400,8 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
2393
2400
  {
2394
2401
  value: 2,
2395
2402
  Icon: {
2396
- Active: oa,
2397
- Inactive: ra
2403
+ Active: sa,
2404
+ Inactive: oa
2398
2405
  },
2399
2406
  isActive: (e) => e === 2,
2400
2407
  getTooltip: (e) => e.CSAT5_RATING_SCORE_2
@@ -2402,8 +2409,8 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
2402
2409
  {
2403
2410
  value: 3,
2404
2411
  Icon: {
2405
- Active: ia,
2406
- Inactive: sa
2412
+ Active: aa,
2413
+ Inactive: ia
2407
2414
  },
2408
2415
  isActive: (e) => e === 3,
2409
2416
  getTooltip: (e) => e.CSAT5_RATING_SCORE_3
@@ -2411,8 +2418,8 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
2411
2418
  {
2412
2419
  value: 4,
2413
2420
  Icon: {
2414
- Active: la,
2415
- Inactive: aa
2421
+ Active: ca,
2422
+ Inactive: la
2416
2423
  },
2417
2424
  isActive: (e) => e === 4,
2418
2425
  getTooltip: (e) => e.CSAT5_RATING_SCORE_4
@@ -2420,13 +2427,13 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
2420
2427
  {
2421
2428
  value: 5,
2422
2429
  Icon: {
2423
- Active: da,
2424
- Inactive: ca
2430
+ Active: ua,
2431
+ Inactive: da
2425
2432
  },
2426
2433
  isActive: (e) => 5 <= e,
2427
2434
  getTooltip: (e) => e.CSAT5_RATING_SCORE_5
2428
2435
  }
2429
- ], ma = () => ua, Vn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(ft, null, t, /* @__PURE__ */ r.createElement(pa, { $position: n }, /* @__PURE__ */ r.createElement(fa, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(ga, { $position: n }))), ga = ({ $position: e }) => /* @__PURE__ */ r.createElement(
2436
+ ], ga = () => ma, Vn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(ft, null, t, /* @__PURE__ */ r.createElement(fa, { $position: n }, /* @__PURE__ */ r.createElement(ba, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(ha, { $position: n }))), ha = ({ $position: e }) => /* @__PURE__ */ r.createElement(
2430
2437
  "svg",
2431
2438
  {
2432
2439
  style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
@@ -2437,30 +2444,30 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
2437
2444
  fill: "none"
2438
2445
  },
2439
2446
  /* @__PURE__ */ r.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill: p.themedColor.textHighEmphasis })
2440
- ), ha = {
2447
+ ), pa = {
2441
2448
  top: I`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
2442
2449
  bottom: I`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
2443
- }, ft = u.div`position:relative;`, pa = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${fe.TOOLTIP};${({ $position: e }) => ha[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${ft}:hover &,${ft}:focus-within &{opacity:1;}`, fa = u(w)`padding:6px 8px;background:${p.themedColor.textHighEmphasis};color:${p.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, ba = ({ submitted: e, value: t, onChange: n }) => {
2444
- const { stringSet: o } = O(), s = ma(), a = typeof t == "number";
2445
- return /* @__PURE__ */ r.createElement(Ea, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(xa, null, s.map((i) => /* @__PURE__ */ r.createElement(Vn, { disabled: e, key: i.value, label: i.getTooltip(o) }, /* @__PURE__ */ r.createElement(
2446
- Ca,
2450
+ }, ft = u.div`position:relative;`, fa = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${fe.TOOLTIP};${({ $position: e }) => pa[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${ft}:hover &,${ft}:focus-within &{opacity:1;}`, ba = u(w)`padding:6px 8px;background:${p.themedColor.textHighEmphasis};color:${p.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, Ea = ({ submitted: e, value: t, onChange: n }) => {
2451
+ const { stringSet: o } = O(), s = ga(), i = typeof t == "number";
2452
+ return /* @__PURE__ */ r.createElement(xa, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(Ca, null, s.map((a) => /* @__PURE__ */ r.createElement(Vn, { disabled: e, key: a.value, label: a.getTooltip(o) }, /* @__PURE__ */ r.createElement(
2453
+ va,
2447
2454
  {
2448
2455
  disabled: e,
2449
- onClick: () => n(i.value),
2450
- $inactive: a && !i.isActive(t)
2456
+ onClick: () => n(a.value),
2457
+ $inactive: i && !a.isActive(t)
2451
2458
  },
2452
- a ? i.isActive(t) ? /* @__PURE__ */ r.createElement(i.Icon.Active, null) : /* @__PURE__ */ r.createElement(i.Icon.Inactive, null) : /* @__PURE__ */ r.createElement(i.Icon.Active, null)
2459
+ i ? a.isActive(t) ? /* @__PURE__ */ r.createElement(a.Icon.Active, null) : /* @__PURE__ */ r.createElement(a.Icon.Inactive, null) : /* @__PURE__ */ r.createElement(a.Icon.Active, null)
2453
2460
  )))));
2454
- }, Ea = u.div`display:flex;flex-direction:column;gap:8px;`, xa = u.div`display:flex;justify-content:space-between;width:100%;max-width:320px;`, Ca = 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:${p.color.background200};${P.dark`
2461
+ }, xa = u.div`display:flex;flex-direction:column;gap:8px;`, Ca = u.div`display:flex;justify-content:space-between;width:100%;max-width:320px;`, va = 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:${p.color.background200};${P.dark`
2455
2462
  background-color: ${p.color.background500};
2456
2463
  `}
2457
2464
  }
2458
2465
 
2459
- ${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" && va};
2460
- `, va = I`[fill]{fill:white;fill-opacity:0.12;}[stroke]{stroke:white;stroke-opacity:0.12;}`, ya = ({ submitted: e, value: t = "", onChange: n }) => {
2466
+ ${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" && ya};
2467
+ `, ya = I`[fill]{fill:white;fill-opacity:0.12;}[stroke]{stroke:white;stroke-opacity:0.12;}`, _a = ({ submitted: e, value: t = "", onChange: n }) => {
2461
2468
  const { stringSet: o } = O();
2462
2469
  return e && !t ? null : /* @__PURE__ */ r.createElement(
2463
- _a,
2470
+ Sa,
2464
2471
  {
2465
2472
  disabled: e,
2466
2473
  maxLength: 255,
@@ -2469,7 +2476,7 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
2469
2476
  placeholder: o.CSAT_REASON_PLACEHOLDER
2470
2477
  }
2471
2478
  );
2472
- }, _a = 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:${p.themedColor.textHighEmphasis};&::placeholder{color:${p.themedColor.textLowEmphasis};}background-color:${p.color.background50};${P.dark`
2479
+ }, Sa = 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:${p.themedColor.textHighEmphasis};&::placeholder{color:${p.themedColor.textLowEmphasis};}background-color:${p.color.background50};${P.dark`
2473
2480
  background-color: ${p.themedColor.textDisabled};
2474
2481
  `}
2475
2482
 
@@ -2482,82 +2489,82 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
2482
2489
  background-color: ${p.themedColor.textDisabled};
2483
2490
  `}
2484
2491
  }
2485
- `, Sa = ({ submitted: e }) => {
2492
+ `, Ta = ({ submitted: e }) => {
2486
2493
  const { stringSet: t } = O();
2487
2494
  return e ? /* @__PURE__ */ r.createElement(w, { variant: "h2", color: p.themedColor.textHighEmphasis }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ r.createElement(w, { variant: "h2", color: p.themedColor.textHighEmphasis }, t.CSAT_TITLE_UNSUBMITTED);
2488
2495
  };
2489
- var J = /* @__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))(J || {});
2490
- const Ta = (e) => Cr((t, n) => ({ ...t, ...n }), e), lt = ({
2496
+ var X = /* @__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))(X || {});
2497
+ const wa = (e) => Cr((t, n) => ({ ...t, ...n }), e), lt = ({
2491
2498
  type: e,
2492
2499
  renderSubmitButton: t,
2493
2500
  initialCsat: n,
2494
2501
  initialCsatReason: o,
2495
2502
  initialIsResolved: s
2496
2503
  }) => {
2497
- const [a, i] = Ta({
2504
+ const [i, a] = wa({
2498
2505
  csatType: e,
2499
2506
  csat: n,
2500
2507
  csatReason: o,
2501
2508
  isResolved: s
2502
- }), l = typeof n == "number" ? "submitted" : (e === J.AI_AGENT_CSAT_5 || e === J.HELPDESK_CSAT_5) && typeof a.csat == "number" || e === J.AI_AGENT_CSAT_5_WITH_CRE && typeof a.csat == "number" && typeof a.isResolved == "boolean" ? "submittable" : "unsubmittable", c = { state: l, submitted: l === "submitted" };
2503
- return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(wa, null, /* @__PURE__ */ r.createElement(Sa, { ...c }), e === J.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
2504
- Xi,
2509
+ }), l = typeof n == "number" ? "submitted" : (e === X.AI_AGENT_CSAT_5 || e === X.HELPDESK_CSAT_5) && typeof i.csat == "number" || e === X.AI_AGENT_CSAT_5_WITH_CRE && typeof i.csat == "number" && typeof i.isResolved == "boolean" ? "submittable" : "unsubmittable", c = { state: l, submitted: l === "submitted" };
2510
+ return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Aa, null, /* @__PURE__ */ r.createElement(Ta, { ...c }), e === X.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
2511
+ Qi,
2505
2512
  {
2506
2513
  ...c,
2507
2514
  defaultValue: s,
2508
- value: a.isResolved,
2509
- onChange: (d) => i({ isResolved: d })
2515
+ value: i.isResolved,
2516
+ onChange: (d) => a({ isResolved: d })
2510
2517
  }
2511
- ), /* @__PURE__ */ r.createElement(ba, { ...c, value: a.csat, onChange: (d) => i({ csat: d }) }), a.csat && /* @__PURE__ */ r.createElement(
2512
- ya,
2518
+ ), /* @__PURE__ */ r.createElement(Ea, { ...c, value: i.csat, onChange: (d) => a({ csat: d }) }), i.csat && /* @__PURE__ */ r.createElement(
2519
+ _a,
2513
2520
  {
2514
2521
  ...c,
2515
- value: a.csatReason,
2516
- onChange: (d) => i({ csatReason: d })
2522
+ value: i.csatReason,
2523
+ onChange: (d) => a({ csatReason: d })
2517
2524
  }
2518
- )), l !== "submitted" && t({ state: l, params: a }));
2519
- }, wa = u.div`display:flex;flex-direction:column;gap:12px;`, Aa = () => {
2525
+ )), l !== "submitted" && t({ state: l, params: i }));
2526
+ }, Aa = u.div`display:flex;flex-direction:column;gap:12px;`, ka = () => {
2520
2527
  const { stringSet: e } = O();
2521
2528
  return /* @__PURE__ */ r.createElement(w, { variant: "body2", color: p.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
2522
- }, ka = (e) => {
2529
+ }, Ia = (e) => {
2523
2530
  if (e.messageType !== "admin.csat")
2524
2531
  throw new Error("Invalid message type");
2525
- const t = Nr(), { stringSet: n } = O(), { extendedMessagePayload: o, csat: s, csatReason: a, csatExpireAt: i, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: g } = (o == null ? void 0 : o.csat) ?? {};
2526
- if (!d || !g || !J[g]) return null;
2527
- const h = g === J.AI_AGENT_CSAT_5 || g === J.AI_AGENT_CSAT_5_WITH_CRE || g === J.HELPDESK_CSAT_5 ? lt : () => null, f = (x) => {
2528
- x.csat && !rn(i) ? c({
2532
+ const t = Pr(), { stringSet: n } = O(), { extendedMessagePayload: o, csat: s, csatReason: i, csatExpireAt: a, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: h } = (o == null ? void 0 : o.csat) ?? {};
2533
+ if (!d || !h || !X[h]) return null;
2534
+ const m = h === X.AI_AGENT_CSAT_5 || h === X.AI_AGENT_CSAT_5_WITH_CRE || h === X.HELPDESK_CSAT_5 ? lt : () => null, f = (x) => {
2535
+ x.csat && !rn(a) ? c({
2529
2536
  csatType: x.csatType,
2530
2537
  csat: x.csat,
2531
2538
  csatReason: x.csatReason,
2532
2539
  isResolved: x.isResolved
2533
2540
  }) : t();
2534
2541
  };
2535
- return /* @__PURE__ */ r.createElement(Ia, null, !s && rn(i) ? /* @__PURE__ */ r.createElement(Aa, null) : /* @__PURE__ */ r.createElement(
2536
- h,
2542
+ return /* @__PURE__ */ r.createElement($a, null, !s && rn(a) ? /* @__PURE__ */ r.createElement(ka, null) : /* @__PURE__ */ r.createElement(
2543
+ m,
2537
2544
  {
2538
- type: g,
2545
+ type: h,
2539
2546
  initialCsat: s,
2540
- initialCsatReason: a,
2547
+ initialCsatReason: i,
2541
2548
  initialIsResolved: l,
2542
- renderSubmitButton: ({ state: x, params: b }) => /* @__PURE__ */ r.createElement($a, { disabled: x !== "submittable", onClick: () => f(b) }, /* @__PURE__ */ r.createElement(w, { variant: "button" }, n.CSAT_SUBMIT_LABEL))
2549
+ renderSubmitButton: ({ state: x, params: E }) => /* @__PURE__ */ r.createElement(Ma, { disabled: x !== "submittable", onClick: () => f(E) }, /* @__PURE__ */ r.createElement(w, { variant: "button" }, n.CSAT_SUBMIT_LABEL))
2543
2550
  }
2544
2551
  ));
2545
- }, Ia = u.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, $a = 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:${p.color.primary.dark};}&:disabled{color:${p.color.ondark.textLowEmphasis};background-color:${p.themedColor.textDisabled};cursor:not-allowed;}`;
2552
+ }, $a = u.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, Ma = 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:${p.color.primary.dark};}&:disabled{color:${p.color.ondark.textLowEmphasis};background-color:${p.themedColor.textDisabled};cursor:not-allowed;}`;
2546
2553
  function rn(e) {
2547
2554
  return !!e && e < Date.now();
2548
2555
  }
2549
2556
  const Lt = _e({
2550
- template: Ma,
2557
+ template: Oa,
2551
2558
  components: {
2552
- AdminMessage: Yi,
2553
- CSATMessage: ka
2559
+ AdminMessage: qi,
2560
+ CSATMessage: Ia
2554
2561
  }
2555
2562
  });
2556
- function Ma(e) {
2563
+ function Oa(e) {
2557
2564
  const { components: t } = Lt.useContext(), n = Mt(() => e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null);
2558
- return /* @__PURE__ */ r.createElement(Oa, { $marginBottom: Tt(e.groupType) }, n);
2565
+ return /* @__PURE__ */ r.createElement(La, { $marginBottom: Tt(e.groupType) }, n);
2559
2566
  }
2560
- const Oa = u.div`padding-inline:${ee}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, on = {
2567
+ const La = u.div`padding-inline:${te}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, on = {
2561
2568
  file: "attach",
2562
2569
  snippet: "snippet",
2563
2570
  site: "website",
@@ -2567,143 +2574,143 @@ const Oa = u.div`padding-inline:${ee}px;margin-bottom:${({ $marginBottom: e }) =
2567
2574
  sb_zendesk: "zendesk",
2568
2575
  sb_desk: "snippet"
2569
2576
  // TODO: request icon
2570
- }, La = ({
2577
+ }, Ra = ({
2571
2578
  actionbook: e,
2572
2579
  functionCalls: t,
2573
2580
  groundedness: n,
2574
2581
  agentMessageTemplates: o,
2575
2582
  onClickActionbook: s,
2576
- onClickFunctionCall: a,
2577
- onClickFunctionCallDetail: i,
2583
+ onClickFunctionCall: i,
2584
+ onClickFunctionCallDetail: a,
2578
2585
  onClickGroundedness: l,
2579
2586
  onClickAgentMessageTemplate: c,
2580
2587
  bottomContent: d,
2581
- renderCustomGroundednessIcon: g = (f) => f.default,
2582
- style: h = {}
2588
+ renderCustomGroundednessIcon: h = (f) => f.default,
2589
+ style: m = {}
2583
2590
  }) => {
2584
2591
  const {
2585
2592
  // Note: This component is used with the dashboard, so cssVars should not be used.
2586
2593
  iconColor: f = "#000000",
2587
2594
  textColor: x = "#000000",
2588
- highlightColor: b = $n.DEFAULT_PRIMARY
2589
- } = h;
2595
+ highlightColor: E = $n.DEFAULT_PRIMARY
2596
+ } = m;
2590
2597
  return /* @__PURE__ */ r.createElement(sn, null, e && /* @__PURE__ */ r.createElement(sn, null, /* @__PURE__ */ r.createElement(qe, null, /* @__PURE__ */ r.createElement(ze, null, /* @__PURE__ */ r.createElement(M, { size: 16, type: "actionbook", color: f })), /* @__PURE__ */ r.createElement(
2591
2598
  He,
2592
2599
  {
2593
2600
  $clickable: !!s,
2594
- $highlightColor: b,
2601
+ $highlightColor: E,
2595
2602
  variant: "body2",
2596
2603
  color: x,
2597
2604
  onClick: () => s == null ? void 0 : s(e)
2598
2605
  },
2599
2606
  e.name
2600
- ))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(ct, { key: E.key }, /* @__PURE__ */ r.createElement(ze, null, /* @__PURE__ */ r.createElement(M, { size: 16, type: "function", color: f })), /* @__PURE__ */ r.createElement(qe, null, /* @__PURE__ */ r.createElement(
2607
+ ))), t == null ? void 0 : t.map((b) => /* @__PURE__ */ r.createElement(ct, { key: b.key }, /* @__PURE__ */ r.createElement(ze, null, /* @__PURE__ */ r.createElement(M, { size: 16, type: "function", color: f })), /* @__PURE__ */ r.createElement(qe, null, /* @__PURE__ */ r.createElement(
2601
2608
  He,
2602
2609
  {
2603
- $clickable: !!a,
2604
- $highlightColor: b,
2610
+ $clickable: !!i,
2611
+ $highlightColor: E,
2605
2612
  variant: "body2",
2606
2613
  color: x,
2607
- onClick: () => a == null ? void 0 : a(E)
2614
+ onClick: () => i == null ? void 0 : i(b)
2608
2615
  },
2609
- E.name
2610
- ), i && /* @__PURE__ */ r.createElement(Da, { role: "button", onClick: () => i == null ? void 0 : i(E) }, /* @__PURE__ */ r.createElement(w, { variant: "body2", color: b }, "View details"), /* @__PURE__ */ r.createElement(M, { type: "chevron-right", size: 16, color: b }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ r.createElement(ct, { key: E.id }, /* @__PURE__ */ r.createElement(ze, null, g({
2611
- default: /* @__PURE__ */ r.createElement(M, { size: 16, type: on[E.source_type] ?? on.snippet, color: f }),
2612
- sourceType: E.source_type
2616
+ b.name
2617
+ ), a && /* @__PURE__ */ r.createElement(Na, { role: "button", onClick: () => a == null ? void 0 : a(b) }, /* @__PURE__ */ r.createElement(w, { variant: "body2", color: E }, "View details"), /* @__PURE__ */ r.createElement(M, { type: "chevron-right", size: 16, color: E }))))), n == null ? void 0 : n.map((b) => /* @__PURE__ */ r.createElement(ct, { key: b.id }, /* @__PURE__ */ r.createElement(ze, null, h({
2618
+ default: /* @__PURE__ */ r.createElement(M, { size: 16, type: on[b.source_type] ?? on.snippet, color: f }),
2619
+ sourceType: b.source_type
2613
2620
  })), /* @__PURE__ */ r.createElement(
2614
2621
  He,
2615
2622
  {
2616
2623
  $clickable: !!l,
2617
- $highlightColor: b,
2624
+ $highlightColor: E,
2618
2625
  variant: "body2",
2619
2626
  color: x,
2620
- onClick: () => l == null ? void 0 : l(E)
2627
+ onClick: () => l == null ? void 0 : l(b)
2621
2628
  },
2622
- E.preview_title
2623
- ))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(ct, { key: E.key }, /* @__PURE__ */ r.createElement(ze, null, /* @__PURE__ */ r.createElement(M, { size: 16, type: "template", color: f })), /* @__PURE__ */ r.createElement(
2629
+ b.preview_title
2630
+ ))), o == null ? void 0 : o.map((b) => /* @__PURE__ */ r.createElement(ct, { key: b.key }, /* @__PURE__ */ r.createElement(ze, null, /* @__PURE__ */ r.createElement(M, { size: 16, type: "template", color: f })), /* @__PURE__ */ r.createElement(
2624
2631
  He,
2625
2632
  {
2626
2633
  $clickable: !!c,
2627
- $highlightColor: b,
2634
+ $highlightColor: E,
2628
2635
  variant: "body2",
2629
2636
  color: x,
2630
- onClick: () => c == null ? void 0 : c(E)
2637
+ onClick: () => c == null ? void 0 : c(b)
2631
2638
  },
2632
- E.name
2639
+ b.name
2633
2640
  ))), d);
2634
- }, Ra = u(w)`font-weight:400;`, He = u(Ra)`${({ $clickable: e, $highlightColor: t }) => e && I`
2641
+ }, Da = u(w)`font-weight:400;`, He = u(Da)`${({ $clickable: e, $highlightColor: t }) => e && I`
2635
2642
  cursor: pointer;
2636
2643
  text-decoration: underline;
2637
2644
  &:hover {
2638
2645
  color: ${t};
2639
2646
  }
2640
2647
  `}
2641
- `, ze = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, qe = u.div`display:flex;gap:8px;align-items:center;`, Da = u(qe)`cursor:pointer;gap:4px;`, ct = u(qe)`flex-direction:row;align-items:center;`, sn = u.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Wn = ve(null);
2642
- function Na({ testerType: e, children: t }) {
2648
+ `, ze = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, qe = u.div`display:flex;gap:8px;align-items:center;`, Na = u(qe)`cursor:pointer;gap:4px;`, ct = u(qe)`flex-direction:row;align-items:center;`, sn = u.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Wn = ve(null);
2649
+ function Pa({ testerType: e, children: t }) {
2643
2650
  return /* @__PURE__ */ r.createElement(
2644
2651
  Wn.Provider,
2645
2652
  {
2646
2653
  value: { testerType: e, isActionbookTester: e === "actionbook" }
2647
2654
  },
2648
- e && /* @__PURE__ */ r.createElement(Pa, null),
2655
+ e && /* @__PURE__ */ r.createElement(Ba, null),
2649
2656
  t
2650
2657
  );
2651
2658
  }
2652
2659
  const Re = () => {
2653
- const e = X(Wn);
2660
+ const e = Q(Wn);
2654
2661
  if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");
2655
2662
  return e;
2656
- }, Pa = () => {
2663
+ }, Ba = () => {
2657
2664
  const { isActionbookTester: e } = Re();
2658
- return /* @__PURE__ */ r.createElement(xe.Template, { template: e ? Ba : void 0 }, /* @__PURE__ */ r.createElement(xe.MessageLogs, { component: Fa }));
2659
- }, Ba = (e) => /* @__PURE__ */ r.createElement(Un, { ...e, testerMode: !0, maxBodyWidth: Ln }), Fa = ({ extendedMessagePayload: e = {} }) => {
2660
- const { handlers: t } = B(), { manual: n, groundedness: o, function_calls: s, agent_message_templates: a, is_thinking: i } = e;
2661
- return i || !n && !(o != null && o.length) && !(s != null && s.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(Ua, null, /* @__PURE__ */ r.createElement(Ha, { width: 4 }), /* @__PURE__ */ r.createElement(
2662
- La,
2665
+ return /* @__PURE__ */ r.createElement(xe.Template, { template: e ? Fa : void 0 }, /* @__PURE__ */ r.createElement(xe.MessageLogs, { component: Ua }));
2666
+ }, Fa = (e) => /* @__PURE__ */ r.createElement(Un, { ...e, testerMode: !0, maxBodyWidth: Ln }), Ua = ({ extendedMessagePayload: e = {} }) => {
2667
+ const { handlers: t } = B(), { manual: n, groundedness: o, function_calls: s, agent_message_templates: i, is_thinking: a } = e;
2668
+ return a || !n && !(o != null && o.length) && !(s != null && s.length) && !(i != null && i.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(Ha, null, /* @__PURE__ */ r.createElement(za, { width: 4 }), /* @__PURE__ */ r.createElement(
2669
+ Ra,
2663
2670
  {
2664
2671
  actionbook: n,
2665
2672
  functionCalls: s,
2666
2673
  groundedness: o,
2667
- agentMessageTemplates: a,
2674
+ agentMessageTemplates: i,
2668
2675
  onClickFunctionCallDetail: t == null ? void 0 : t.onFunctionCallDetailClick,
2669
2676
  style: {
2670
2677
  iconColor: p.themedColor.textHighEmphasis,
2671
2678
  textColor: p.themedColor.textHighEmphasis,
2672
2679
  barColor: p.themedColor.textDisabled
2673
2680
  },
2674
- bottomContent: /* @__PURE__ */ r.createElement(za, { variant: "caption2", color: p.themedColor.textLowEmphasis }, "Only visible in the tester")
2681
+ bottomContent: /* @__PURE__ */ r.createElement(Va, { variant: "caption2", color: p.themedColor.textLowEmphasis }, "Only visible in the tester")
2675
2682
  }
2676
2683
  ));
2677
- }, Ua = u.div`display:flex;gap:16px;margin:16px ${ee}px 0;align-self:stretch;`, Ha = u.div`width:${({ width: e }) => e}px;background-color:${p.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, za = u(w)`margin-top:5px;`;
2678
- function Va(e) {
2684
+ }, Ha = u.div`display:flex;gap:16px;margin:16px ${te}px 0;align-self:stretch;`, za = u.div`width:${({ width: e }) => e}px;background-color:${p.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Va = u(w)`margin-top:5px;`;
2685
+ function Wa(e) {
2679
2686
  return "sendingStatus" in e ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId);
2680
2687
  }
2681
- const Wa = (e, t, n, o = !0) => {
2688
+ const Ga = (e, t, n, o = !0) => {
2682
2689
  if (!o || !e.isUserMessage() && !e.isFileMessage())
2683
2690
  return "single";
2684
2691
  const s = () => {
2685
2692
  if (!t || !t.isUserMessage() && !t.isFileMessage()) return !1;
2686
2693
  const c = t.sender.userId === e.sender.userId, d = zt(t.createdAt, e.createdAt);
2687
2694
  return c && d;
2688
- }, a = () => {
2695
+ }, i = () => {
2689
2696
  if (!n || !n.isUserMessage() && !n.isFileMessage()) return !1;
2690
2697
  const c = n.sender.userId === e.sender.userId, d = zt(n.createdAt, e.createdAt);
2691
2698
  return c && d;
2692
- }, i = s(), l = a();
2693
- return i && l ? "middle" : i ? "bottom" : l ? "top" : "single";
2699
+ }, a = s(), l = i();
2700
+ return a && l ? "middle" : a ? "bottom" : l ? "top" : "single";
2694
2701
  };
2695
- function Ga(e, t) {
2702
+ function ja(e, t) {
2696
2703
  return e.filter((n) => Se.isWelcomeMessage(n, t));
2697
2704
  }
2698
2705
  function Gn(e, t) {
2699
- return ja(e) === t;
2706
+ return Ka(e) === t;
2700
2707
  }
2701
- function ja(e) {
2708
+ function Ka(e) {
2702
2709
  var t;
2703
2710
  if (e)
2704
2711
  return e.isUserMessage() || e.isFileMessage() || e.isMultipleFilesMessage() ? e.sender.userId : ((t = e == null ? void 0 : e.sender) == null ? void 0 : t.userId) ?? void 0;
2705
2712
  }
2706
- function Ka(e) {
2713
+ function Za(e) {
2707
2714
  return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
2708
2715
  }
2709
2716
  const bt = (e) => !!e && "sender" in e, jn = (e) => e.startsWith("image/"), Kn = (e) => e.startsWith("video/"), an = (e) => jn(e) || Kn(e), Ve = {
@@ -2714,16 +2721,16 @@ const bt = (e) => !!e && "sender" in e, jn = (e) => e.startsWith("image/"), Kn =
2714
2721
  },
2715
2722
  isIncoming: (e, t) => bt(e) && e.sender.userId !== t,
2716
2723
  isOutgoing: (e, t) => bt(e) && (e.sender.userId === t || e.sendingStatus === dt.PENDING)
2717
- }, Za = (e) => {
2718
- const { chatSDK: t, handlers: n } = B(), { aiAgentInfo: o } = U(), s = N(/* @__PURE__ */ new Set()), a = (i, l) => {
2724
+ }, Ya = (e) => {
2725
+ const { chatSDK: t, handlers: n } = B(), { aiAgentInfo: o } = U(), s = N(/* @__PURE__ */ new Set()), i = (a, l) => {
2719
2726
  var c;
2720
- i.url === e && bt(l) && l.sender.userId === o.userId && !Se.isStreaming(l) && !s.current.has(l.messageId) && ((c = n == null ? void 0 : n.onCustomEvent) == null || c.call(n, { type: "bot-message-received", data: { message: l } }), s.current.add(l.messageId));
2727
+ a.url === e && bt(l) && l.sender.userId === o.userId && !Se.isStreaming(l) && !s.current.has(l.messageId) && ((c = n == null ? void 0 : n.onCustomEvent) == null || c.call(n, { type: "bot-message-received", data: { message: l } }), s.current.add(l.messageId));
2721
2728
  };
2722
2729
  Xe(t, {
2723
- onMessageUpdated: a,
2724
- onMessageReceived: a
2730
+ onMessageUpdated: i,
2731
+ onMessageReceived: i
2725
2732
  });
2726
- }, Ya = ({ publishSynchronous: e = !1 }) => {
2733
+ }, qa = ({ publishSynchronous: e = !1 }) => {
2727
2734
  const t = /* @__PURE__ */ new Set();
2728
2735
  return {
2729
2736
  publish: (n) => {
@@ -2734,24 +2741,24 @@ const bt = (e) => !!e && "sender" in e, jn = (e) => e.startsWith("image/"), Kn =
2734
2741
  subscribe: (n) => (t.add(n), () => t.delete(n))
2735
2742
  };
2736
2743
  };
2737
- function qa(e, t = []) {
2738
- const n = N(null), o = N(0), s = N(0), [a] = _(() => Ya({ publishSynchronous: !0 })), [i, l] = _(!0);
2744
+ function Ja(e, t = []) {
2745
+ const n = N(null), o = N(0), s = N(0), [i] = _(() => qa({ publishSynchronous: !0 })), [a, l] = _(!0);
2739
2746
  return le(() => {
2740
2747
  o.current = 0, s.current = 0, l(!0), n.current && (n.current.scrollTop = n.current.scrollHeight);
2741
- }, t), le(() => a.subscribe(({ type: c, data: d }) => {
2742
- const { resolve: g, animated: h } = d ?? {};
2743
- if (!n.current) return g == null ? void 0 : g();
2748
+ }, t), le(() => i.subscribe(({ type: c, data: d }) => {
2749
+ const { resolve: h, animated: m } = d ?? {};
2750
+ if (!n.current) return h == null ? void 0 : h();
2744
2751
  if (c === "scrollToBottom" && (n.current.scroll ? n.current.scroll({
2745
2752
  top: n.current.scrollHeight,
2746
- behavior: ln(e, h)
2747
- }) : n.current.scrollTop = n.current.scrollHeight, s.current = 0, l(!0), g == null || g()), c === "scroll") {
2748
- const f = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight: b, clientHeight: E } = n.current;
2749
- n.current.scroll ? n.current.scroll({ top: f, behavior: ln(e, h) }) : typeof f == "number" && (n.current.scrollTop = f), s.current = Math.max(0, b - x - E), l(s.current === 0), g == null || g();
2753
+ behavior: ln(e, m)
2754
+ }) : n.current.scrollTop = n.current.scrollHeight, s.current = 0, l(!0), h == null || h()), c === "scroll") {
2755
+ const f = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight: E, clientHeight: b } = n.current;
2756
+ n.current.scroll ? n.current.scroll({ top: f, behavior: ln(e, m) }) : typeof f == "number" && (n.current.scrollTop = f), s.current = Math.max(0, E - x - b), l(s.current === 0), h == null || h();
2750
2757
  }
2751
2758
  }), [e]), {
2752
2759
  scrollRef: n,
2753
- scrollPubSub: a,
2754
- isScrollBottomReached: i,
2760
+ scrollPubSub: i,
2761
+ isScrollBottomReached: a,
2755
2762
  setIsScrollBottomReached: l,
2756
2763
  scrollDistanceFromBottomRef: s,
2757
2764
  scrollPositionRef: o
@@ -2760,7 +2767,7 @@ function qa(e, t = []) {
2760
2767
  function ln(e, t) {
2761
2768
  return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
2762
2769
  }
2763
- function Ja(e) {
2770
+ function Xa(e) {
2764
2771
  return new Promise((t) => {
2765
2772
  const n = new Image();
2766
2773
  n.onload = function() {
@@ -2769,71 +2776,71 @@ function Ja(e) {
2769
2776
  }, n.src = URL.createObjectURL(e);
2770
2777
  });
2771
2778
  }
2772
- async function Xa(e) {
2779
+ async function Qa(e) {
2773
2780
  if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
2774
- const { width: t, height: n } = await Ja(e.file);
2775
- return new Vr({
2781
+ const { width: t, height: n } = await Xa(e.file);
2782
+ return new Wr({
2776
2783
  key: Zn,
2777
2784
  value: [t, n]
2778
2785
  });
2779
2786
  }
2780
2787
  }
2781
- const Zn = "KEY_IMG_ASPECT_RATIO", Qa = ({ onScrollAfterSendMessage: e }) => {
2788
+ const Zn = "KEY_IMG_ASPECT_RATIO", el = ({ onScrollAfterSendMessage: e }) => {
2782
2789
  const { agentPreviewConfigs: t, handlers: n } = B(), o = N(t == null ? void 0 : t.agentAttributes);
2783
2790
  return o.current = t == null ? void 0 : t.agentAttributes, {
2784
2791
  onBeforeSendMessage: async (s) => {
2785
- const a = await Xa(s), i = {
2792
+ const i = await Qa(s), a = {
2786
2793
  ...s,
2787
- metaArrays: a ? [a] : void 0
2788
- }, l = el(o.current);
2789
- return l ? { ...i, data: JSON.stringify(l) } : i;
2794
+ metaArrays: i ? [i] : void 0
2795
+ }, l = tl(o.current);
2796
+ return l ? { ...a, data: JSON.stringify(l) } : a;
2790
2797
  },
2791
2798
  onAfterSendMessage: (s) => {
2792
- var a, i, l;
2793
- e(), (a = n == null ? void 0 : n.onMessageSend) == null || a.call(n, s.message), s.sendingStatus === dt.SUCCEEDED ? (i = n == null ? void 0 : n.onCustomEvent) == null || i.call(n, { type: "message-sent-succeeded", data: { message: s } }) : s.sendingStatus === dt.PENDING && ((l = n == null ? void 0 : n.onCustomEvent) == null || l.call(n, { type: "message-sent-pending", data: { message: s } }));
2799
+ var i, a, l;
2800
+ e(), (i = n == null ? void 0 : n.onMessageSend) == null || i.call(n, s.message), s.sendingStatus === dt.SUCCEEDED ? (a = n == null ? void 0 : n.onCustomEvent) == null || a.call(n, { type: "message-sent-succeeded", data: { message: s } }) : s.sendingStatus === dt.PENDING && ((l = n == null ? void 0 : n.onCustomEvent) == null || l.call(n, { type: "message-sent-pending", data: { message: s } }));
2794
2801
  }
2795
2802
  };
2796
- }, el = (e) => {
2803
+ }, tl = (e) => {
2797
2804
  if (!e) return null;
2798
2805
  const t = {};
2799
2806
  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;
2800
2807
  }, {
2801
- Provider: tl,
2802
- Context: ou,
2808
+ Provider: nl,
2809
+ Context: su,
2803
2810
  useContext: Z
2804
- } = G("Conversation"), nl = ({
2811
+ } = G("Conversation"), rl = ({
2805
2812
  closedChannelUrl: e,
2806
2813
  onClearClosedChannelUrl: t,
2807
2814
  onNavigateToConversationList: n,
2808
2815
  children: o
2809
2816
  }) => {
2810
- const { aiAgentInfo: s, activeChannel: a, refreshActiveChannel: i } = U(), { testerType: l } = Re(), c = qa("smooth"), { onBeforeSendMessage: d, onAfterSendMessage: g } = Qa({
2817
+ const { aiAgentInfo: s, activeChannel: i, refreshActiveChannel: a } = U(), { testerType: l } = Re(), c = Ja("smooth"), { onBeforeSendMessage: d, onAfterSendMessage: h } = el({
2811
2818
  onScrollAfterSendMessage: () => {
2812
2819
  c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !1 } });
2813
2820
  }
2814
- }), h = e || (a == null ? void 0 : a.url);
2815
- Za(h);
2816
- const f = (b) => {
2817
- const E = b[b.length - 1];
2818
- E && Se.shouldScrollToBottom(E, s.userId, !!l) && setTimeout(() => c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } }), 100);
2821
+ }), m = e || (i == null ? void 0 : i.url);
2822
+ Ya(m);
2823
+ const f = (E) => {
2824
+ const b = E[E.length - 1];
2825
+ b && Se.shouldScrollToBottom(b, s.userId, !!l) && setTimeout(() => c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } }), 100);
2819
2826
  }, x = R(async () => {
2820
- await i(), e && (t == null || t());
2821
- }, [i, e, t]);
2827
+ await a(), e && (t == null || t());
2828
+ }, [a, e, t]);
2822
2829
  return /* @__PURE__ */ r.createElement(
2823
- io,
2830
+ ao,
2824
2831
  {
2825
- channelUrl: h,
2832
+ channelUrl: m,
2826
2833
  onBeforeSendMessage: d,
2827
- onAfterSendMessage: g,
2834
+ onAfterSendMessage: h,
2828
2835
  onMessagesUpdated: f,
2829
2836
  onMessagesReceived: f,
2830
2837
  onChannelDeleted: x,
2831
2838
  onConversationClosedViaDispatcher: x
2832
2839
  },
2833
- (b) => /* @__PURE__ */ r.createElement(
2834
- tl,
2840
+ (E) => /* @__PURE__ */ r.createElement(
2841
+ nl,
2835
2842
  {
2836
- value: { ...b, scrollSource: c, goToActiveConversation: x, onNavigateToConversationList: n }
2843
+ value: { ...E, scrollSource: c, goToActiveConversation: x, onNavigateToConversationList: n }
2837
2844
  },
2838
2845
  o
2839
2846
  )
@@ -2851,7 +2858,7 @@ const Zn = "KEY_IMG_ASPECT_RATIO", Qa = ({ onScrollAfterSendMessage: e }) => {
2851
2858
  var o;
2852
2859
  if (n.preventDefault(), (o = n.dataTransfer) != null && o.files) {
2853
2860
  const s = Array.from(n.dataTransfer.files);
2854
- s.length > 0 && t.current.forEach((a) => a(s));
2861
+ s.length > 0 && t.current.forEach((i) => i(s));
2855
2862
  }
2856
2863
  },
2857
2864
  subscribe: (n) => (t.current.add(n), () => t.current.delete(n))
@@ -2859,101 +2866,101 @@ const Zn = "KEY_IMG_ASPECT_RATIO", Qa = ({ onScrollAfterSendMessage: e }) => {
2859
2866
  },
2860
2867
  e
2861
2868
  );
2862
- }, rl = ({ onDropFiles: e }) => {
2863
- const { subscribe: t } = X(Rt);
2869
+ }, ol = ({ onDropFiles: e }) => {
2870
+ const { subscribe: t } = Q(Rt);
2864
2871
  L(() => t(e), [e]);
2865
2872
  };
2866
2873
  Et.Consumer = ({ children: e }) => {
2867
- const { onDrop: t } = X(Rt);
2874
+ const { onDrop: t } = Q(Rt);
2868
2875
  return e({ onDrop: t, onDragOver: (s) => s.preventDefault() });
2869
2876
  };
2870
- const su = ({ iconSize: e = 64, icon: t, className: n, label: o, children: s }) => /* @__PURE__ */ r.createElement(sl, { className: n }, /* @__PURE__ */ r.createElement(M, { type: t, size: e, color: p.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.themedColor.textMidEmphasis }, o), s), ol = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, sl = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, il = {
2871
- loading: T(() => import("./CorQ5vL_.js")),
2872
- error: T(() => import("./ccfzGnJU.js")),
2873
- noChannels: T(() => import("./DFlRbX2F.js")),
2874
- noMessages: T(() => import("./DNKomW8O.js"))
2877
+ const iu = ({ iconSize: e = 64, icon: t, className: n, label: o, children: s }) => /* @__PURE__ */ r.createElement(il, { className: n }, /* @__PURE__ */ r.createElement(M, { type: t, size: e, color: p.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.themedColor.textMidEmphasis }, o), s), sl = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, il = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, al = {
2878
+ loading: T(() => import("./DhUBPQ6o.js")),
2879
+ error: T(() => import("./CVCUjr3Q.js")),
2880
+ noChannels: T(() => import("./kE3eGJ-O.js")),
2881
+ noMessages: T(() => import("./jtdZ66dz.js"))
2875
2882
  }, Ce = ({ className: e, type: t = "loading", ...n }) => {
2876
- const o = il[t];
2877
- return /* @__PURE__ */ r.createElement(ol, { className: e }, /* @__PURE__ */ r.createElement(ke, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
2883
+ const o = al[t];
2884
+ return /* @__PURE__ */ r.createElement(sl, { className: e }, /* @__PURE__ */ r.createElement(ke, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
2878
2885
  }, Yn = ({ rootElementId: e, visible: t, onClose: n, children: o }) => {
2879
2886
  if (!t) return null;
2880
- const { rootElement: s } = B(), a = pe(s), i = pe(s, !0);
2881
- return Gr(
2882
- /* @__PURE__ */ r.createElement(al, { onClick: n }, /* @__PURE__ */ r.createElement(ll, { onClick: (l) => l.stopPropagation() }, o)),
2883
- a.getElementById(e) ?? a.getElementById(Q.MODAL_ROOT) ?? i.body
2887
+ const { rootElement: s } = B(), i = pe(s), a = pe(s, !0);
2888
+ return jr(
2889
+ /* @__PURE__ */ r.createElement(ll, { onClick: n }, /* @__PURE__ */ r.createElement(cl, { onClick: (l) => l.stopPropagation() }, o)),
2890
+ i.getElementById(e) ?? i.getElementById(ee.MODAL_ROOT) ?? a.body
2884
2891
  );
2885
- }, al = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${p.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${fe.MODAL};`, ll = 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:${fe.MODAL};`, cl = u.div`flex-shrink:0;width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(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;}`, dl = u(kt)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
2892
+ }, ll = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${p.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${fe.MODAL};`, cl = 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:${fe.MODAL};`, dl = u.div`flex-shrink:0;width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(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;}`, ul = u(kt)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
2886
2893
  function qn({ size: e }) {
2887
2894
  const { aiAgentInfo: t } = U();
2888
- return t.profileUrl ? /* @__PURE__ */ r.createElement(It, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(cl, { $size: e }, /* @__PURE__ */ r.createElement(dl, null));
2895
+ return t.profileUrl ? /* @__PURE__ */ r.createElement(It, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(dl, { $size: e }, /* @__PURE__ */ r.createElement(ul, null));
2889
2896
  }
2890
- const ul = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, ml = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${p.themedColor.textDisabled};background-color:${p.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, gl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, hl = u.div`margin-inline-end:8px;`, pl = 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);}`, fl = 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;}`, bl = u.div`display:flex;width:160px;justify-content:flex-end;`, El = u.div`inset-inline-end:0;display:flex;flex-direction:row;`, Jn = u.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, xl = u(Jn)`border-inline-start:1px solid ${p.themedColor.textDisabled};`, Cl = u.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, vl = u.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, yl = u.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, _l = u.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, Sl = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
2891
- const { type: s, url: a, name: i = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: g } = U();
2897
+ const ml = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, gl = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${p.themedColor.textDisabled};background-color:${p.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, hl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, pl = u.div`margin-inline-end:8px;`, fl = 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);}`, bl = 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;}`, El = u.div`display:flex;width:160px;justify-content:flex-end;`, xl = u.div`inset-inline-end:0;display:flex;flex-direction:row;`, Jn = u.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, Cl = u(Jn)`border-inline-start:1px solid ${p.themedColor.textDisabled};`, vl = u.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, yl = u.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, _l = u.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, Sl = u.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, Tl = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
2898
+ const { type: s, url: i, name: a = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: h } = U();
2892
2899
  return /* @__PURE__ */ r.createElement(
2893
- wl,
2900
+ Al,
2894
2901
  {
2895
2902
  profileUrl: l ?? "",
2896
2903
  nickname: c ?? "",
2897
2904
  type: s,
2898
- url: a,
2899
- name: i,
2905
+ url: i,
2906
+ name: a,
2900
2907
  onClose: n,
2901
- isBotMessage: d === g.userId,
2908
+ isBotMessage: d === h.userId,
2902
2909
  onDownloadClick: o
2903
2910
  }
2904
2911
  );
2905
- }, Tl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(qn, { size: 32 }) : /* @__PURE__ */ r.createElement(It, { size: 32, src: e }), wl = ({
2912
+ }, wl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(qn, { size: 32 }) : /* @__PURE__ */ r.createElement(It, { size: 32, src: e }), Al = ({
2906
2913
  profileUrl: e,
2907
2914
  isBotMessage: t,
2908
2915
  nickname: n,
2909
2916
  name: o,
2910
2917
  type: s,
2911
- url: a,
2912
- onClose: i,
2918
+ url: i,
2919
+ onClose: a,
2913
2920
  onDownloadClick: l
2914
2921
  }) => {
2915
2922
  const { stringSet: c } = O();
2916
- return /* @__PURE__ */ r.createElement(Yn, { onClose: i, visible: !0, rootElementId: Q.MODAL_ROOT }, /* @__PURE__ */ r.createElement(ul, null, /* @__PURE__ */ r.createElement(ml, null, /* @__PURE__ */ r.createElement(gl, null, /* @__PURE__ */ r.createElement(hl, null, /* @__PURE__ */ r.createElement(Tl, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(pl, null, /* @__PURE__ */ r.createElement(w, { variant: "h2", color: p.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(bl, null, an(s) && /* @__PURE__ */ r.createElement(El, null, /* @__PURE__ */ r.createElement(Jn, { as: "a", href: a, target: "_blank", rel: St, onClick: l }, /* @__PURE__ */ r.createElement(M, { type: "download", color: p.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(xl, { onClick: i }, /* @__PURE__ */ r.createElement(M, { type: "close", color: p.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(Cl, { onClick: (d) => d.currentTarget === d.target && i() }, Kn(s) && /* @__PURE__ */ r.createElement(vl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: s })), jn(s) && /* @__PURE__ */ r.createElement(yl, { src: a, alt: o }), !an(s) && /* @__PURE__ */ r.createElement(_l, null, /* @__PURE__ */ r.createElement(w, { variant: "h1", color: p.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
2923
+ return /* @__PURE__ */ r.createElement(Yn, { onClose: a, visible: !0, rootElementId: ee.MODAL_ROOT }, /* @__PURE__ */ r.createElement(ml, null, /* @__PURE__ */ r.createElement(gl, null, /* @__PURE__ */ r.createElement(hl, null, /* @__PURE__ */ r.createElement(pl, null, /* @__PURE__ */ r.createElement(wl, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(w, { variant: "h2", color: p.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(bl, null, /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(El, null, an(s) && /* @__PURE__ */ r.createElement(xl, null, /* @__PURE__ */ r.createElement(Jn, { as: "a", href: i, target: "_blank", rel: St, onClick: l }, /* @__PURE__ */ r.createElement(M, { type: "download", color: p.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(Cl, { onClick: a }, /* @__PURE__ */ r.createElement(M, { type: "close", color: p.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(vl, { onClick: (d) => d.currentTarget === d.target && a() }, Kn(s) && /* @__PURE__ */ r.createElement(yl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: i, type: s })), jn(s) && /* @__PURE__ */ r.createElement(_l, { src: i, alt: o }), !an(s) && /* @__PURE__ */ r.createElement(Sl, null, /* @__PURE__ */ r.createElement(w, { variant: "h1", color: p.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
2917
2924
  }, Xn = ({
2918
2925
  className: e,
2919
2926
  locale: t,
2920
2927
  date: n = Date.now(),
2921
2928
  formatString: o = "MMMM dd, yyyy",
2922
2929
  style: s
2923
- }) => /* @__PURE__ */ r.createElement(Al, { style: s, className: e }, /* @__PURE__ */ r.createElement(w, { variant: "caption4", color: p.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), Al = u.div`display:flex;justify-content:center;align-items:center;`, kl = ye(function(t, n) {
2930
+ }) => /* @__PURE__ */ r.createElement(kl, { id: `${J}-date-separator`, style: s, className: e }, /* @__PURE__ */ r.createElement(w, { variant: "caption4", color: p.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), kl = u.div`display:flex;justify-content:center;align-items:center;`, Il = ye(function(t, n) {
2924
2931
  const {
2925
2932
  messages: o,
2926
2933
  renderMessage: s,
2927
- messageTopArea: a,
2928
- messageBottomArea: i,
2934
+ messageTopArea: i,
2935
+ messageBottomArea: a,
2929
2936
  overlayArea: l,
2930
2937
  onLoadPrev: c,
2931
2938
  onLoadNext: d,
2932
- loadThreshold: g = 0.05,
2933
- onScrollPosition: h = Ie,
2939
+ loadThreshold: h = 0.05,
2940
+ onScrollPosition: m = Ie,
2934
2941
  depsForResetScrollPositionToBottom: f,
2935
2942
  scrollPositionRef: x,
2936
- scrollDistanceFromBottomRef: b,
2937
- stackDirection: E = "top"
2938
- } = t, m = n && "current" in n ? n : { current: null }, C = N(!1), v = N(void 0), S = N(0), k = N(0), F = N(0), $ = x ?? k, V = b ?? F;
2943
+ scrollDistanceFromBottomRef: E,
2944
+ stackDirection: b = "top"
2945
+ } = t, g = n && "current" in n ? n : { current: null }, C = N(!1), v = N(void 0), S = N(0), k = N(0), F = N(0), $ = x ?? k, V = E ?? F;
2939
2946
  le(() => {
2940
- m.current && (m.current.scrollTop = m.current.scrollHeight);
2947
+ g.current && (g.current.scrollTop = g.current.scrollHeight);
2941
2948
  }, f), le(() => {
2942
- m.current && (v.current === "top" && (m.current.scrollTop = m.current.scrollHeight - $.current), v.current === "bottom" && (m.current.scrollTop = S.current), v.current = void 0);
2943
- }, [m.current, o.length]);
2944
- const ne = async () => {
2945
- if (!m.current) return;
2946
- const y = m.current;
2947
- if (h(Il(y)), $.current = y.scrollHeight - y.scrollTop, V.current = $.current - y.clientHeight, S.current = y.scrollTop, C.current) return;
2948
- const H = y.clientHeight * Math.min(Math.max(0, g), 1);
2949
+ g.current && (v.current === "top" && (g.current.scrollTop = g.current.scrollHeight - $.current), v.current === "bottom" && (g.current.scrollTop = S.current), v.current = void 0);
2950
+ }, [g.current, o.length]);
2951
+ const re = async () => {
2952
+ if (!g.current) return;
2953
+ const y = g.current;
2954
+ if (m($l(y)), $.current = y.scrollHeight - y.scrollTop, V.current = $.current - y.clientHeight, S.current = y.scrollTop, C.current) return;
2955
+ const H = y.clientHeight * Math.min(Math.max(0, h), 1);
2949
2956
  y.scrollTop <= H ? (C.current = !0, v.current = "top", await c(), C.current = !1) : y.scrollHeight - y.scrollTop - y.clientHeight <= H ? (C.current = !0, v.current = "bottom", await d(), C.current = !1) : v.current = void 0;
2950
2957
  };
2951
- return /* @__PURE__ */ r.createElement($l, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Ml, { id: "infinite-list-inner", ref: m, onScroll: ne }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((y, H) => s({ message: y, index: H })), i), /* @__PURE__ */ r.createElement(Ol, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(Ll, { id: "infinite-list-overlay" }, l)));
2958
+ return /* @__PURE__ */ r.createElement(Ml, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Ol, { id: "infinite-list-inner", ref: g, onScroll: re }, b === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), i, o.map((y, H) => s({ message: y, index: H })), a), /* @__PURE__ */ r.createElement(Ll, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(Rl, { id: "infinite-list-overlay" }, l)));
2952
2959
  }), cn = 50;
2953
- function Il(e) {
2960
+ function $l(e) {
2954
2961
  return e.scrollTop <= cn ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= cn ? "bottom" : "middle";
2955
2962
  }
2956
- const $l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Ml = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${p.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Ol = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, Ll = u.div`pointer-events:auto;`, Rl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Dl, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(M, { size: 24, type: "chevron-down", color: p.color.primary.main })), Dl = 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);${P.light`
2963
+ const Ml = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Ol = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${p.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Ll = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, Rl = u.div`pointer-events:auto;`, Dl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Nl, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(M, { size: 24, type: "chevron-down", color: p.color.primary.main })), Nl = 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);${P.light`
2957
2964
  background-color: ${p.color.background50};
2958
2965
  &:hover {
2959
2966
  background-color: ${p.color.background100};
@@ -2979,24 +2986,24 @@ const $l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Ml = u
2979
2986
  const { chatSDK: e } = B(), { channelSource: t } = Z(), [n, o] = _([]);
2980
2987
  return Xe(e, {
2981
2988
  onTypingStatusUpdated(s) {
2982
- var a;
2983
- if (s.url === ((a = t.channel) == null ? void 0 : a.url)) {
2984
- const i = s.getTypingUsers();
2985
- o(i);
2989
+ var i;
2990
+ if (s.url === ((i = t.channel) == null ? void 0 : i.url)) {
2991
+ const a = s.getTypingUsers();
2992
+ o(a);
2986
2993
  }
2987
2994
  }
2988
2995
  }), n;
2989
- }, Nl = () => {
2990
- const { agentPreviewConfigs: e = {}, aiAgentId: t } = B(), { aiAgentInfo: n } = U(), { stringSet: o, dateLocale: s } = O(), { messageSource: a } = Z(), { Template: i } = xe.useContext(), l = e.welcomeMessages ?? [], c = a.messages, d = Ga(c, t), g = c[d.length + 1], h = d[0] ?? g;
2996
+ }, Pl = () => {
2997
+ const { agentPreviewConfigs: e = {}, aiAgentId: t } = B(), { aiAgentInfo: n } = U(), { stringSet: o, dateLocale: s } = O(), { messageSource: i } = Z(), { Template: a } = xe.useContext(), l = e.welcomeMessages ?? [], c = i.messages, d = ja(c, t), h = c[d.length + 1], m = d[0] ?? h;
2991
2998
  return {
2992
2999
  /**
2993
3000
  * Returns a list of messages filtered according to business requirements.
2994
3001
  */
2995
- filteredMessages: c.filter((f) => Ka(f) ? !1 : l.length > 0 ? !Se.isWelcomeMessage(f, t) : !0),
3002
+ filteredMessages: c.filter((f) => Za(f) ? !1 : l.length > 0 ? !Se.isWelcomeMessage(f, t) : !0),
2996
3003
  /**
2997
3004
  * Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
2998
3005
  */
2999
- shouldShowOriginalDate: (f) => f > 0 || l.length === 0 ? !0 : g && !Mr(g.createdAt, (h == null ? void 0 : h.createdAt) ?? 0),
3006
+ shouldShowOriginalDate: (f) => f > 0 || l.length === 0 ? !0 : h && !Or(h.createdAt, (m == null ? void 0 : m.createdAt) ?? 0),
3000
3007
  /**
3001
3008
  * Renders the list of welcome messages from Bot Studio.
3002
3009
  */
@@ -3004,41 +3011,41 @@ const $l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Ml = u
3004
3011
  Xn,
3005
3012
  {
3006
3013
  style: { margin: "16px 0" },
3007
- date: h == null ? void 0 : h.createdAt,
3014
+ date: m == null ? void 0 : m.createdAt,
3008
3015
  locale: s,
3009
3016
  formatString: o.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
3010
3017
  }
3011
3018
  ), l.map((f, x) => {
3012
- const b = x === l.length - 1, E = d.length !== c.length, m = l.length === 1 ? "single" : x === 0 ? "top" : b || E ? "bottom" : "middle";
3019
+ const E = x === l.length - 1, b = d.length !== c.length, g = l.length === 1 ? "single" : x === 0 ? "top" : E || b ? "bottom" : "middle";
3013
3020
  return /* @__PURE__ */ r.createElement(
3014
- i,
3021
+ a,
3015
3022
  {
3016
3023
  messageType: "user",
3017
3024
  message: f.message,
3018
3025
  sender: n,
3019
- groupType: m,
3020
- createdAt: (h == null ? void 0 : h.createdAt) ?? Date.now(),
3026
+ groupType: g,
3027
+ createdAt: (m == null ? void 0 : m.createdAt) ?? Date.now(),
3021
3028
  extendedMessagePayload: { suggested_replies: f.suggestedReplies },
3022
3029
  suggestedRepliesDirection: e.suggestedRepliesDirection,
3023
- suggestedRepliesVisible: b && !E,
3030
+ suggestedRepliesVisible: E && !b,
3024
3031
  isBotMessage: !0,
3025
3032
  onClickSuggestedReply: async ({ reply: C }) => {
3026
- a.sendUserMessage({ message: C });
3033
+ i.sendUserMessage({ message: C });
3027
3034
  }
3028
3035
  }
3029
3036
  );
3030
3037
  }))
3031
3038
  };
3032
- }, Pl = (e) => u(e).withConfig({ shouldForwardProp: jr });
3033
- function Bl(e) {
3039
+ }, Bl = (e) => u(e).withConfig({ shouldForwardProp: Kr });
3040
+ function Fl(e) {
3034
3041
  var o;
3035
3042
  const t = "remove_powered_by", n = (o = e == null ? void 0 : e.appInfo) == null ? void 0 : o.applicationAttributes;
3036
3043
  return Array.isArray(n) && n.includes(t);
3037
3044
  }
3038
- const Fl = ({ style: e }) => {
3045
+ const Ul = ({ style: e }) => {
3039
3046
  const { stringSet: t } = O(), { chatSDK: n } = B(), { isActionbookTester: o } = Re();
3040
- return Bl(n) || o ? null : /* @__PURE__ */ r.createElement(Ul, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
3041
- Hl,
3047
+ return Fl(n) || o ? null : /* @__PURE__ */ r.createElement(Hl, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
3048
+ zl,
3042
3049
  {
3043
3050
  variant: "caption2",
3044
3051
  as: "a",
@@ -3049,17 +3056,17 @@ const Fl = ({ style: e }) => {
3049
3056
  },
3050
3057
  "Sendbird"
3051
3058
  ));
3052
- }, Ul = u(w)`color:${p.themedColor.textLowEmphasis};text-align:center;`, Hl = Pl(w)`
3059
+ }, Hl = u(w)`color:${p.themedColor.textLowEmphasis};text-align:center;`, zl = Bl(w)`
3053
3060
  color: ${p.themedColor.textLowEmphasis};
3054
3061
  cursor: pointer;
3055
3062
  text-decoration: none;
3056
- `, zl = () => {
3063
+ `, Vl = () => {
3057
3064
  var c;
3058
- const { stringSet: e } = O(), { activeChannel: t } = U(), { channelSource: n, goToActiveConversation: o, scrollSource: s } = Z(), a = Pn(n.channel), l = t && ((c = n.channel) == null ? void 0 : c.url) === (t == null ? void 0 : t.url) && a;
3065
+ const { stringSet: e } = O(), { activeChannel: t } = U(), { channelSource: n, goToActiveConversation: o, scrollSource: s } = Z(), i = Pn(n.channel), l = t && ((c = n.channel) == null ? void 0 : c.url) === (t == null ? void 0 : t.url) && i;
3059
3066
  return le(() => {
3060
3067
  l && s.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
3061
- }, [l]), l ? /* @__PURE__ */ r.createElement(Vl, null, /* @__PURE__ */ r.createElement(
3062
- Wl,
3068
+ }, [l]), l ? /* @__PURE__ */ r.createElement(Wl, null, /* @__PURE__ */ r.createElement(
3069
+ Gl,
3063
3070
  {
3064
3071
  variant: "button",
3065
3072
  role: "button",
@@ -3068,39 +3075,39 @@ const Fl = ({ style: e }) => {
3068
3075
  },
3069
3076
  e.START_NEW_CONVERSATION
3070
3077
  )) : null;
3071
- }, Vl = u.div`display:flex;justify-content:center;margin:16px 0;`, Wl = u(w)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${p.themedColor.textDisabled};cursor:pointer;user-select:none;`, Gl = !0, jl = () => {
3072
- const { Template: e } = Ot.useContext(), { Template: t } = xe.useContext(), { Template: n } = Lt.useContext(), [o, s] = _(null), { userSession: a, aiAgentInfo: i } = U(), { cache: l, agentPreviewConfigs: c, chatSDK: d, state: g } = B(), { stringSet: h, dateLocale: f } = O(), { conversation: x, channelSource: b, messageSource: E, scrollSource: m } = Z(), { isActionbookTester: C } = Re(), { filteredMessages: v, shouldShowOriginalDate: S, renderAgentPreviewWelcomeMessages: k } = Nl(), F = Qn(), $ = Mt(() => {
3078
+ }, Wl = u.div`display:flex;justify-content:center;margin:16px 0;`, Gl = u(w)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${p.themedColor.textDisabled};cursor:pointer;user-select:none;`, jl = !0, Kl = () => {
3079
+ const { Template: e } = Ot.useContext(), { Template: t } = xe.useContext(), { Template: n } = Lt.useContext(), [o, s] = _(null), { userSession: i, aiAgentInfo: a } = U(), { cache: l, agentPreviewConfigs: c, chatSDK: d, state: h } = B(), { stringSet: m, dateLocale: f } = O(), { conversation: x, channelSource: E, messageSource: b, scrollSource: g } = Z(), { isActionbookTester: C } = Re(), { filteredMessages: v, shouldShowOriginalDate: S, renderAgentPreviewWelcomeMessages: k } = Pl(), F = Qn(), $ = Mt(() => {
3073
3080
  const y = F[0];
3074
3081
  if (!y) return null;
3075
- const H = y.userId === i.userId;
3076
- return { user: H ? i : y, isBot: H };
3082
+ const H = y.userId === a.userId;
3083
+ return { user: H ? a : y, isBot: H };
3077
3084
  });
3078
3085
  L(() => {
3079
- $ && m.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
3080
- }, [!!$, m.scrollPubSub.publish]);
3086
+ $ && g.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
3087
+ }, [!!$, g.scrollPubSub.publish]);
3081
3088
  const V = (y, H = !1) => {
3082
- var re;
3083
- return H ? i : ((re = b.channel) == null ? void 0 : re.members.find((Y) => Y.userId === y.sender.userId)) ?? y.sender;
3084
- }, ne = () => {
3085
- if (!E.initialized)
3089
+ var oe;
3090
+ return H ? a : ((oe = E.channel) == null ? void 0 : oe.members.find((Y) => Y.userId === y.sender.userId)) ?? y.sender;
3091
+ }, re = () => {
3092
+ if (!b.initialized)
3086
3093
  return /* @__PURE__ */ r.createElement(Ce, { type: "loading" });
3087
- if (E.messages.length === 0) {
3094
+ if (b.messages.length === 0) {
3088
3095
  const y = k();
3089
- return y ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, y) : /* @__PURE__ */ r.createElement(Ce, { type: "noMessages", label: h.PLACE_HOLDER__NO_MESSAGES });
3096
+ return y ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, y) : /* @__PURE__ */ r.createElement(Ce, { type: "noMessages", label: m.PLACE_HOLDER__NO_MESSAGES });
3090
3097
  }
3091
3098
  return /* @__PURE__ */ r.createElement(
3092
- kl,
3099
+ Il,
3093
3100
  {
3094
- ref: m.scrollRef,
3095
- scrollPositionRef: m.scrollPositionRef,
3096
- scrollDistanceFromBottomRef: m.scrollDistanceFromBottomRef,
3097
- onScrollPosition: (y) => m.setIsScrollBottomReached(y === "bottom"),
3101
+ ref: g.scrollRef,
3102
+ scrollPositionRef: g.scrollPositionRef,
3103
+ scrollDistanceFromBottomRef: g.scrollDistanceFromBottomRef,
3104
+ onScrollPosition: (y) => g.setIsScrollBottomReached(y === "bottom"),
3098
3105
  stackDirection: c == null ? void 0 : c.messageStackDirection,
3099
3106
  messages: v,
3100
- onLoadPrev: E.loadPrevious,
3101
- onLoadNext: E.loadNext,
3102
- depsForResetScrollPositionToBottom: [E.initialized, E.messages.length !== 0],
3103
- messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Fl, { style: { marginTop: 16 } }), k()),
3107
+ onLoadPrev: b.loadPrevious,
3108
+ onLoadNext: b.loadNext,
3109
+ depsForResetScrollPositionToBottom: [b.initialized, b.messages.length !== 0],
3110
+ messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ul, { style: { marginTop: 16 } }), k()),
3104
3111
  messageBottomArea: /* @__PURE__ */ r.createElement(r.Fragment, null, $ && /* @__PURE__ */ r.createElement(
3105
3112
  t,
3106
3113
  {
@@ -3111,11 +3118,11 @@ const Fl = ({ style: e }) => {
3111
3118
  groupType: "single",
3112
3119
  message: ""
3113
3120
  }
3114
- ), /* @__PURE__ */ r.createElement(zl, null)),
3115
- overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !m.isScrollBottomReached && /* @__PURE__ */ r.createElement(Zl, { onClick: () => m.scrollPubSub.publish({ type: "scrollToBottom" }) })),
3121
+ ), /* @__PURE__ */ r.createElement(Vl, null)),
3122
+ overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !g.isScrollBottomReached && /* @__PURE__ */ r.createElement(Yl, { onClick: () => g.scrollPubSub.publish({ type: "scrollToBottom" }) })),
3116
3123
  renderMessage: ({ message: y, index: H }) => {
3117
- const re = Va(y), Y = v[H - 1], nt = v[H + 1], rt = v[v.length - 1], A = y === rt, D = Wa(y, Y, nt, Gl), K = !Wr((Y == null ? void 0 : Y.createdAt) ?? 0, y.createdAt) && S(H) && !C, q = (Pe) => {
3118
- (y.isFileMessage() || y.isUserMessage()) && s({ file: Pe, sender: V(y, y.sender.userId === i.userId) });
3124
+ const oe = Wa(y), Y = v[H - 1], nt = v[H + 1], rt = v[v.length - 1], A = y === rt, D = Ga(y, Y, nt, jl), K = !Gr((Y == null ? void 0 : Y.createdAt) ?? 0, y.createdAt) && S(H) && !C, q = (Pe) => {
3125
+ (y.isFileMessage() || y.isUserMessage()) && s({ file: Pe, sender: V(y, y.sender.userId === a.userId) });
3119
3126
  }, be = () => {
3120
3127
  y.isFileMessage() && $t(y.url);
3121
3128
  }, fr = K ? /* @__PURE__ */ r.createElement(
@@ -3124,10 +3131,10 @@ const Fl = ({ style: e }) => {
3124
3131
  style: { margin: "16px 0" },
3125
3132
  date: y.createdAt,
3126
3133
  locale: f,
3127
- formatString: h.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
3134
+ formatString: m.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
3128
3135
  }
3129
3136
  ) : null, Ne = {
3130
- maxBodyWidth: g.expanded ? Ln : void 0,
3137
+ maxBodyWidth: h.expanded ? Ln : void 0,
3131
3138
  extendedMessagePayload: y.extendedMessagePayload,
3132
3139
  createdAt: y.createdAt,
3133
3140
  groupType: D,
@@ -3141,25 +3148,25 @@ const Fl = ({ style: e }) => {
3141
3148
  {
3142
3149
  ...Ne,
3143
3150
  ...x,
3144
- isResolvedWhenDeterminedByUser: Yl(x),
3151
+ isResolvedWhenDeterminedByUser: ql(x),
3145
3152
  messageType: "admin.csat",
3146
- onSubmitCSAT: ({ csat: oe, csatType: me, csatReason: z, isResolved: se }) => {
3153
+ onSubmitCSAT: ({ csat: se, csatType: me, csatReason: z, isResolved: ie }) => {
3147
3154
  var ge;
3148
- oe && ((ge = b.channel) == null || ge.submitCSAT({ csat: oe, csatType: me, csatReason: z, isResolved: se }));
3155
+ se && ((ge = E.channel) == null || ge.submitCSAT({ csat: se, csatType: me, csatReason: z, isResolved: ie }));
3149
3156
  }
3150
3157
  }
3151
3158
  ) : null : /* @__PURE__ */ r.createElement(n, { ...Ne, messageType: "admin", message: y.message });
3152
- if (Ve.isOutgoing(y, a.userId)) {
3153
- const oe = {
3159
+ if (Ve.isOutgoing(y, i.userId)) {
3160
+ const se = {
3154
3161
  ...Ne,
3155
3162
  message: y.message,
3156
3163
  sender: V(y),
3157
3164
  sendingStatus: y.sendingStatus
3158
3165
  };
3159
3166
  if (y.isUserMessage())
3160
- return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...oe });
3167
+ return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...se });
3161
3168
  if (y.isFileMessage()) {
3162
- const [me, z] = ((Pe = y.metaArrays.find((se) => se.key === Zn)) == null ? void 0 : Pe.value) ?? [];
3169
+ const [me, z] = ((Pe = y.metaArrays.find((ie) => ie.key === Zn)) == null ? void 0 : Pe.value) ?? [];
3163
3170
  return /* @__PURE__ */ r.createElement(
3164
3171
  e,
3165
3172
  {
@@ -3169,32 +3176,32 @@ const Fl = ({ style: e }) => {
3169
3176
  aspectRatio: me && z ? `${me}/${z}` : "1/1",
3170
3177
  localFile: (Ft = y.messageParams) == null ? void 0 : Ft.file
3171
3178
  },
3172
- ...oe
3179
+ ...se
3173
3180
  }
3174
3181
  );
3175
3182
  }
3176
3183
  }
3177
- if (Ve.isIncoming(y, a.userId)) {
3178
- const oe = y.sender.userId === i.userId, me = {
3184
+ if (Ve.isIncoming(y, i.userId)) {
3185
+ const se = y.sender.userId === a.userId, me = {
3179
3186
  ...Ne,
3180
- sender: V(y, oe),
3187
+ sender: V(y, se),
3181
3188
  message: y.message,
3182
3189
  suggestedRepliesVisible: A,
3183
3190
  suggestedRepliesDirection: c == null ? void 0 : c.suggestedRepliesDirection,
3184
- isBotMessage: oe,
3191
+ isBotMessage: se,
3185
3192
  isStreaming: Se.isStreaming(y),
3186
3193
  onClickSuggestedReply: async ({ reply: z }) => {
3187
- E.sendUserMessage({ message: z });
3194
+ b.sendUserMessage({ message: z });
3188
3195
  },
3189
3196
  onRequestMessageTemplate: async (z) => {
3190
- const { template: se } = await d.aiAgent.getMessageTemplate(z);
3191
- return l.template.set(z, se), se;
3197
+ const { template: ie } = await d.aiAgent.getMessageTemplate(z);
3198
+ return l.template.set(z, ie), ie;
3192
3199
  },
3193
3200
  onGetCachedMessageTemplate: (z) => l.template.get(z),
3194
3201
  onHandleTemplateInternalAction: (z) => {
3195
3202
  if (z.type === "internal" && z.internalData) {
3196
- const { method: se, payload: ge } = z.internalData;
3197
- se === "message.send" && (ge != null && ge.message) && E.sendUserMessage({ message: ge.message });
3203
+ const { method: ie, payload: ge } = z.internalData;
3204
+ ie === "message.send" && (ge != null && ge.message) && b.sendUserMessage({ message: ge.message });
3198
3205
  }
3199
3206
  }
3200
3207
  };
@@ -3204,45 +3211,45 @@ const Fl = ({ style: e }) => {
3204
3211
  return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: y, ...me });
3205
3212
  }
3206
3213
  })();
3207
- return /* @__PURE__ */ r.createElement("div", { key: re, id: `${ie}-message-item` }, fr, br);
3214
+ return /* @__PURE__ */ r.createElement("div", { key: oe, id: `${J}-message-item` }, fr, br);
3208
3215
  }
3209
3216
  }
3210
3217
  );
3211
3218
  };
3212
- return /* @__PURE__ */ r.createElement(Kl, { id: `${ie}-message-list` }, ne(), o && /* @__PURE__ */ r.createElement(Sl, { onClose: () => s(null), sender: o.sender, file: o.file }));
3213
- }, Kl = u.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Zl = u(Rl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
3214
- function Yl(e) {
3219
+ return /* @__PURE__ */ r.createElement(Zl, { id: `${J}-message-list` }, re(), o && /* @__PURE__ */ r.createElement(Tl, { onClose: () => s(null), sender: o.sender, file: o.file }));
3220
+ }, Zl = u.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Yl = u(Dl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
3221
+ function ql(e) {
3215
3222
  var t;
3216
3223
  if (((t = e == null ? void 0 : e.resolution) == null ? void 0 : t.determinedBy) === "user")
3217
3224
  return e.resolution.isResolved;
3218
3225
  }
3219
- const ql = () => {
3226
+ const Jl = () => {
3220
3227
  const { stringSet: e } = O(), { connectionError: t } = U(), { channelSource: n } = Z(), o = t || n.error;
3221
3228
  if (o) {
3222
3229
  const s = t ? void 0 : { label: e.RETRY, onClick: () => n.refetch() };
3223
3230
  return /* @__PURE__ */ r.createElement(Ce, { type: "error", label: o.message, action: s });
3224
3231
  }
3225
- return n.channel ? /* @__PURE__ */ r.createElement(jl, null) : /* @__PURE__ */ r.createElement(Ce, { type: "loading" });
3232
+ return n.channel ? /* @__PURE__ */ r.createElement(Kl, null) : /* @__PURE__ */ r.createElement(Ce, { type: "loading" });
3226
3233
  }, er = () => {
3227
3234
  const { stringSet: e } = O(), { activeChannel: t } = U(), [n] = _(() => (t == null ? void 0 : t.status) === W.OPEN);
3228
3235
  return n ? e.RETURN_TO_CONVERSATION : e.START_NEW_CONVERSATION;
3229
- }, Jl = () => {
3236
+ }, Xl = () => {
3230
3237
  const { stringSet: e } = O(), { goToActiveConversation: t } = Z(), n = er();
3231
- return /* @__PURE__ */ r.createElement(Xl, null, /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.themedColor.textMidEmphasis }, e.CONVERSATION_CLOSED_FOOTER_LABEL), /* @__PURE__ */ r.createElement(Ql, { onClick: t }, /* @__PURE__ */ r.createElement(w, { variant: "button", color: p.themedColor.textHighEmphasis }, n)));
3232
- }, Xl = u.div`display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 0;gap:14px;${P.light`
3238
+ return /* @__PURE__ */ r.createElement(Ql, null, /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.themedColor.textMidEmphasis }, e.CONVERSATION_CLOSED_FOOTER_LABEL), /* @__PURE__ */ r.createElement(ec, { onClick: t }, /* @__PURE__ */ r.createElement(w, { variant: "button", color: p.themedColor.textHighEmphasis }, n)));
3239
+ }, Ql = u.div`display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 0;gap:14px;${P.light`
3233
3240
  background-color: ${p.color.background100};
3234
3241
  `}
3235
3242
  ${P.dark`
3236
3243
  background-color: ${p.color.background500};
3237
3244
  `}
3238
- `, Ql = u.button`all:unset;padding:10px 20px;border-radius:6px;border:1px solid ${p.themedColor.textDisabled};cursor:pointer;${P.light`
3245
+ `, ec = u.button`all:unset;padding:10px 20px;border-radius:6px;border:1px solid ${p.themedColor.textDisabled};cursor:pointer;${P.light`
3239
3246
  background-color: ${p.color.background50};
3240
3247
  `}
3241
3248
  ${P.dark`
3242
3249
  background-color: ${p.color.background700};
3243
3250
  `}
3244
- `, tr = ve(void 0), ec = ({ children: e }) => {
3245
- const { stringSet: t } = O(), { attachmentMode: n } = U(), { channelSource: o } = Z(), [s, a] = _([]), [i, l] = _({
3251
+ `, tr = ve(void 0), tc = ({ children: e }) => {
3252
+ const { stringSet: t } = O(), { attachmentMode: n } = U(), { channelSource: o } = Z(), [s, i] = _([]), [a, l] = _({
3246
3253
  visible: !1,
3247
3254
  title: "",
3248
3255
  buttonText: t.BUTTON__OK
@@ -3257,80 +3264,80 @@ const ql = () => {
3257
3264
  default:
3258
3265
  return c;
3259
3266
  }
3260
- }, [n, c]), g = (x) => {
3267
+ }, [n, c]), h = (x) => {
3261
3268
  if (!d) return;
3262
- const b = x.filter((E) => On.includes(E.type));
3263
- if (b.length !== 0) {
3264
- if (b.some((E) => E.size > _s)) {
3265
- l((E) => ({
3266
- ...E,
3269
+ const E = x.filter((b) => On.includes(b.type));
3270
+ if (E.length !== 0) {
3271
+ if (E.some((b) => b.size > Ss)) {
3272
+ l((b) => ({
3273
+ ...b,
3267
3274
  visible: !0,
3268
3275
  title: t.FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT.replace("%d", "25")
3269
3276
  }));
3270
3277
  return;
3271
3278
  }
3272
- if (b.length > 1 || b.length > 0 && s.length > 0) {
3273
- l((E) => ({
3274
- ...E,
3279
+ if (E.length > 1 || E.length > 0 && s.length > 0) {
3280
+ l((b) => ({
3281
+ ...b,
3275
3282
  visible: !0,
3276
3283
  title: t.FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT
3277
3284
  }));
3278
3285
  return;
3279
3286
  }
3280
- a((E) => [
3281
- ...E,
3282
- ...b.map((m) => ({
3283
- file: m,
3284
- preview: { url: URL.createObjectURL(m), type: m.type, name: m.name }
3287
+ i((b) => [
3288
+ ...b,
3289
+ ...E.map((g) => ({
3290
+ file: g,
3291
+ preview: { url: URL.createObjectURL(g), type: g.type, name: g.name }
3285
3292
  }))
3286
3293
  ]);
3287
3294
  }
3288
- }, h = (x) => {
3289
- a((b) => {
3290
- var m;
3291
- const E = (m = b[x]) == null ? void 0 : m.preview;
3292
- return E && URL.revokeObjectURL(E.url), b.filter((C, v) => v !== x);
3295
+ }, m = (x) => {
3296
+ i((E) => {
3297
+ var g;
3298
+ const b = (g = E[x]) == null ? void 0 : g.preview;
3299
+ return b && URL.revokeObjectURL(b.url), E.filter((C, v) => v !== x);
3293
3300
  });
3294
3301
  }, f = () => {
3295
- a((x) => (x.forEach((b) => URL.revokeObjectURL(b.preview.url)), []));
3302
+ i((x) => (x.forEach((E) => URL.revokeObjectURL(E.preview.url)), []));
3296
3303
  };
3297
3304
  return /* @__PURE__ */ r.createElement(
3298
3305
  tr.Provider,
3299
3306
  {
3300
3307
  value: {
3301
3308
  files: s,
3302
- addFiles: g,
3303
- removeFile: h,
3309
+ addFiles: h,
3310
+ removeFile: m,
3304
3311
  clearFiles: f,
3305
3312
  isFileUploadEnabled: d
3306
3313
  }
3307
3314
  },
3308
3315
  e,
3309
- /* @__PURE__ */ r.createElement(tc, { ...i, onClose: () => l((x) => ({ ...x, visible: !1, title: "" })) })
3316
+ /* @__PURE__ */ r.createElement(nc, { ...a, onClose: () => l((x) => ({ ...x, visible: !1, title: "" })) })
3310
3317
  );
3311
3318
  }, Dt = () => {
3312
- const e = X(tr);
3319
+ const e = Q(tr);
3313
3320
  if (!e)
3314
3321
  throw new Error("useFileUpload must be used within FileUploadProvider");
3315
3322
  return e;
3316
- }, tc = ({
3323
+ }, nc = ({
3317
3324
  title: e,
3318
3325
  buttonText: t,
3319
3326
  visible: n,
3320
3327
  onClose: o
3321
- }) => /* @__PURE__ */ r.createElement(Yn, { rootElementId: Q.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(nc, null, /* @__PURE__ */ r.createElement(oc, null, /* @__PURE__ */ r.createElement(w, { variant: "h1", color: p.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(rc, null, /* @__PURE__ */ r.createElement(sc, { onClick: o }, /* @__PURE__ */ r.createElement(w, { variant: "button", color: p.themedColor.textHighEmphasisInverse }, t))))), nc = 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};`, rc = u.div`display:flex;flex-direction:row;justify-content:flex-end;`, oc = u.div`margin-bottom:16px;`, sc = u.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${p.themedColor.error};border:1px solid ${p.themedColor.error};padding:10px 16px;&:hover{background-color:${p.color.error.dark};border-color:${p.color.error.dark};}&:active{background-color:${p.color.error.extraDark};}`;
3322
- function ic({ blurred: e, elementRef: t, document: n = window.document }) {
3328
+ }) => /* @__PURE__ */ r.createElement(Yn, { rootElementId: ee.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(rc, null, /* @__PURE__ */ r.createElement(sc, null, /* @__PURE__ */ r.createElement(w, { variant: "h1", color: p.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(oc, null, /* @__PURE__ */ r.createElement(ic, { onClick: o }, /* @__PURE__ */ r.createElement(w, { variant: "button", color: p.themedColor.textHighEmphasisInverse }, t))))), rc = 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};`, oc = u.div`display:flex;flex-direction:row;justify-content:flex-end;`, sc = u.div`margin-bottom:16px;`, ic = u.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${p.themedColor.error};border:1px solid ${p.themedColor.error};padding:10px 16px;&:hover{background-color:${p.color.error.dark};border-color:${p.color.error.dark};}&:active{background-color:${p.color.error.extraDark};}`;
3329
+ function ac({ blurred: e, elementRef: t, document: n = window.document }) {
3323
3330
  const o = N(!1);
3324
3331
  e && t.current && n.activeElement === t.current && (o.current = !0), le(() => {
3325
3332
  var s;
3326
3333
  !e && o.current && ((s = t.current) == null || s.focus(), o.current = !1);
3327
3334
  }, [e]);
3328
3335
  }
3329
- const ac = (e, t) => {
3336
+ const lc = (e, t) => {
3330
3337
  L(() => {
3331
3338
  t ? e == null || e.startTyping() : e == null || e.endTyping();
3332
3339
  }, [e, t]);
3333
- }, lc = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, cc = 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;}`, dc = 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%;${P.light`
3340
+ }, cc = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, dc = 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;}`, uc = 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%;${P.light`
3334
3341
  background-color: ${p.color.background50};
3335
3342
  `}
3336
3343
  ${P.dark`
@@ -3349,16 +3356,16 @@ const ac = (e, t) => {
3349
3356
  circle {
3350
3357
  stroke: ${p.themedColor.bg_50_600};
3351
3358
  }
3352
- `, uc = () => {
3353
- const e = Oe(), [t, n] = _(), { files: o, removeFile: s, isFileUploadEnabled: a } = Dt();
3354
- return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(lc, null, o.map(({ preview: { type: i, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(cc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(dc, { title: "Remove file", onClick: () => s(d) }, /* @__PURE__ */ r.createElement(M, { type: "close-filled", color: p.themedColor.textMidEmphasis })), i.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(At, { name: l, type: wt(l, i) }))));
3355
- }, mc = ({ channel: e, messages: t }) => {
3356
- const { stringSet: n } = O(), { aiAgentInfo: o } = U(), s = gc(), a = hc({
3359
+ `, mc = () => {
3360
+ const e = Oe(), [t, n] = _(), { files: o, removeFile: s, isFileUploadEnabled: i } = Dt();
3361
+ return !i || o.length === 0 ? null : /* @__PURE__ */ r.createElement(cc, null, o.map(({ preview: { type: a, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(dc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(uc, { title: "Remove file", onClick: () => s(d) }, /* @__PURE__ */ r.createElement(M, { type: "close-filled", color: p.themedColor.textMidEmphasis })), a.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(At, { name: l, type: wt(l, a) }))));
3362
+ }, gc = ({ channel: e, messages: t }) => {
3363
+ const { stringSet: n } = O(), { aiAgentInfo: o } = U(), s = hc(), i = pc({
3357
3364
  lastMessage: t[t.length - 1],
3358
3365
  aiAgentUserId: o.userId
3359
3366
  });
3360
- return !e || !s || Pn(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];
3361
- }, gc = () => {
3367
+ return !e || !s || Pn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : i ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, n.MESSAGE_INPUT__PLACE_HOLDER];
3368
+ }, hc = () => {
3362
3369
  const e = bn(), { chatSDK: t } = B(), [n, o] = _(!0);
3363
3370
  return L(() => {
3364
3371
  const s = new Je({
@@ -3370,28 +3377,28 @@ const ac = (e, t) => {
3370
3377
  t.removeConnectionHandler(e);
3371
3378
  };
3372
3379
  }, [t]), n;
3373
- }, hc = ({
3380
+ }, pc = ({
3374
3381
  lastMessage: e,
3375
3382
  aiAgentUserId: t
3376
3383
  }) => {
3377
3384
  const [n, o] = _(!1), s = Qn();
3378
3385
  return L(() => {
3379
3386
  if (!e) return;
3380
- const a = s.some((l) => l.userId === t), i = Gn(e, t) && Se.isStreaming(e);
3381
- o(!!(i || a));
3387
+ const i = s.some((l) => l.userId === t), a = Gn(e, t) && Se.isStreaming(e);
3388
+ o(!!(a || i));
3382
3389
  }, [s, e, t]), n;
3383
3390
  }, nr = {
3384
3391
  textArea: I`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
3385
3392
  attachIcon: I`margin-bottom:4px;`
3386
- }, rr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, pc = u(rr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${p.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${p.themedColor.bg_200_400};}}${_t && nr.attachIcon};`, fc = u.input`display:none;`, dn = u.div`width:100%;position:relative;background-color:${p.themedColor.bg_100_500};border-radius:20px;`, un = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, mn = 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:${p.themedColor.textHighEmphasis};resize:none;width:100%;height:${Mn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${_t && nr.textArea};&::placeholder{color:${p.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${p.themedColor.textDisabled};}}`, gn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, hn = ({ disabled: e }) => {
3387
- const t = N(null), { addFiles: n, clearFiles: o, files: s, isFileUploadEnabled: a } = Dt();
3388
- return !a || s.length > 0 ? null : /* @__PURE__ */ r.createElement(
3389
- pc,
3393
+ }, rr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, fc = u(rr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${p.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${p.themedColor.bg_200_400};}}${_t && nr.attachIcon};`, bc = u.input`display:none;`, dn = u.div`width:100%;position:relative;background-color:${p.themedColor.bg_100_500};border-radius:20px;`, un = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, mn = 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:${p.themedColor.textHighEmphasis};resize:none;width:100%;height:${Mn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${_t && nr.textArea};&::placeholder{color:${p.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${p.themedColor.textDisabled};}}`, gn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, hn = ({ disabled: e }) => {
3394
+ const t = N(null), { addFiles: n, clearFiles: o, files: s, isFileUploadEnabled: i } = Dt();
3395
+ return !i || s.length > 0 ? null : /* @__PURE__ */ r.createElement(
3396
+ fc,
3390
3397
  {
3391
3398
  disabled: e,
3392
3399
  onClick: () => {
3393
- var i;
3394
- o(), (i = t.current) == null || i.click();
3400
+ var a;
3401
+ o(), (a = t.current) == null || a.click();
3395
3402
  }
3396
3403
  },
3397
3404
  /* @__PURE__ */ r.createElement(
@@ -3403,50 +3410,50 @@ const ac = (e, t) => {
3403
3410
  }
3404
3411
  ),
3405
3412
  /* @__PURE__ */ r.createElement(
3406
- fc,
3413
+ bc,
3407
3414
  {
3408
3415
  type: "file",
3409
3416
  ref: t,
3410
- onChange: (i) => {
3411
- const l = i.currentTarget.files;
3412
- l && n(Array.from(l)), i.target.value = "";
3417
+ onChange: (a) => {
3418
+ const l = a.currentTarget.files;
3419
+ l && n(Array.from(l)), a.target.value = "";
3413
3420
  },
3414
3421
  accept: On.join(",")
3415
3422
  }
3416
3423
  )
3417
3424
  );
3418
- }, bc = () => {
3419
- const e = N(null), [t, n] = _(""), { rootElement: o } = B(), { channelSource: s, messageSource: a } = Z(), [i, l] = mc({
3425
+ }, Ec = () => {
3426
+ const e = N(null), [t, n] = _(""), { rootElement: o } = B(), { channelSource: s, messageSource: i } = Z(), [a, l] = gc({
3420
3427
  channel: s.channel,
3421
- messages: a.messages
3422
- }), { files: c, addFiles: d, clearFiles: g } = Dt();
3423
- rl({ onDropFiles: d }), ic({ blurred: i, elementRef: e, document: pe(o) }), ac(s.channel, t);
3424
- const h = t.trim().length > 0, f = c.length > 0, x = !i && (h || f), b = () => {
3425
- e.current && (e.current.value = "", e.current.style.height = ""), g(), n("");
3426
- }, E = async () => {
3428
+ messages: i.messages
3429
+ }), { files: c, addFiles: d, clearFiles: h } = Dt();
3430
+ ol({ onDropFiles: d }), ac({ blurred: a, elementRef: e, document: pe(o) }), lc(s.channel, t);
3431
+ const m = t.trim().length > 0, f = c.length > 0, x = !a && (m || f), E = () => {
3432
+ e.current && (e.current.value = "", e.current.style.height = ""), h(), n("");
3433
+ }, b = async () => {
3427
3434
  const S = t.trim(), k = { message: S };
3428
3435
  if (!(!S && !c.length)) {
3429
3436
  if (c.length > 0) {
3430
3437
  const F = c[0].file, $ = { ...k, file: F };
3431
- a.sendFileMessage($), b();
3438
+ i.sendFileMessage($), E();
3432
3439
  return;
3433
3440
  }
3434
- a.sendUserMessage(k), b();
3441
+ i.sendUserMessage(k), E();
3435
3442
  }
3436
- }, m = (S) => {
3443
+ }, g = (S) => {
3437
3444
  const k = Array.from(S.clipboardData.files);
3438
3445
  k.length > 0 && (S.preventDefault(), d(k));
3439
3446
  }, C = (S) => {
3440
- S.key !== "Enter" || S.nativeEvent.isComposing || S.shiftKey || (S.preventDefault(), E());
3447
+ S.key !== "Enter" || S.nativeEvent.isComposing || S.shiftKey || (S.preventDefault(), b());
3441
3448
  }, v = (S) => {
3442
3449
  if (e.current) {
3443
3450
  e.current.style.height = "";
3444
- const k = Math.min(ys, e.current.scrollHeight);
3451
+ const k = Math.min(_s, e.current.scrollHeight);
3445
3452
  Mn < k && (e.current.style.height = `${k}px`);
3446
3453
  }
3447
3454
  n(S.target.value);
3448
3455
  };
3449
- return i ? /* @__PURE__ */ r.createElement(gn, null, /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(un, null, /* @__PURE__ */ r.createElement(mn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(hn, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(gn, null, /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(uc, null), /* @__PURE__ */ r.createElement(un, null, /* @__PURE__ */ r.createElement(
3456
+ return a ? /* @__PURE__ */ r.createElement(gn, null, /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(un, null, /* @__PURE__ */ r.createElement(mn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(hn, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(gn, null, /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(mc, null), /* @__PURE__ */ r.createElement(un, null, /* @__PURE__ */ r.createElement(
3450
3457
  mn,
3451
3458
  {
3452
3459
  ref: e,
@@ -3456,73 +3463,73 @@ const ac = (e, t) => {
3456
3463
  maxLength: 5e3,
3457
3464
  onKeyDown: C,
3458
3465
  onChange: v,
3459
- onPaste: m
3466
+ onPaste: g
3460
3467
  }
3461
- ), /* @__PURE__ */ r.createElement(hn, null))), x && /* @__PURE__ */ r.createElement(rr, { onClick: () => E() }, /* @__PURE__ */ r.createElement(M, { type: "send", color: p.color.primary.main, size: 20 })));
3462
- }, Ec = 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:${p.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${P.light`
3468
+ ), /* @__PURE__ */ r.createElement(hn, null))), x && /* @__PURE__ */ r.createElement(rr, { onClick: () => b() }, /* @__PURE__ */ r.createElement(M, { type: "send", color: p.color.primary.main, size: 20 })));
3469
+ }, xc = 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:${p.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${P.light`
3463
3470
  color: ${p.color.information.light};
3464
3471
  `};
3465
3472
  ${P.dark`
3466
3473
  color: ${p.color.information.main};
3467
3474
  `};
3468
3475
  }
3469
- `, xc = T(() => import("./4nxZMIz3.js").then((e) => ({ default: e.MarkdownText }))), Cc = () => {
3476
+ `, Cc = T(() => import("./D5uRw0Em.js").then((e) => ({ default: e.MarkdownText }))), vc = () => {
3470
3477
  const { aiAgentInfo: e } = U(), { messageSource: t } = Z(), { userSession: n } = U();
3471
- return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((s) => Gn(s, n.userId))) ? null : /* @__PURE__ */ r.createElement(Ec, null, /* @__PURE__ */ r.createElement(xc, null, e.specialNotice));
3472
- }, vc = () => /* @__PURE__ */ r.createElement(yc, null, /* @__PURE__ */ r.createElement(Cc, null), /* @__PURE__ */ r.createElement(ec, null, /* @__PURE__ */ r.createElement(bc, null))), yc = u.div`z-index:0;border:none;width:100%;`, _c = () => {
3473
- var a, i, l;
3474
- const { activeChannel: e } = U(), { channelSource: t } = Z(), n = ((i = (a = t.channel) == null ? void 0 : a.conversation) == null ? void 0 : i.status) === W.CLOSED;
3475
- return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Jl, null) : /* @__PURE__ */ r.createElement(vc, null);
3476
- }, Sc = () => {
3478
+ return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((s) => Gn(s, n.userId))) ? null : /* @__PURE__ */ r.createElement(xc, null, /* @__PURE__ */ r.createElement(Cc, null, e.specialNotice));
3479
+ }, yc = () => /* @__PURE__ */ r.createElement(_c, null, /* @__PURE__ */ r.createElement(vc, null), /* @__PURE__ */ r.createElement(tc, null, /* @__PURE__ */ r.createElement(Ec, null))), _c = u.div`z-index:0;border:none;width:100%;`, Sc = () => {
3480
+ var i, a, l;
3481
+ const { activeChannel: e } = U(), { channelSource: t } = Z(), n = ((a = (i = t.channel) == null ? void 0 : i.conversation) == null ? void 0 : a.status) === W.CLOSED;
3482
+ return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Xl, null) : /* @__PURE__ */ r.createElement(yc, null);
3483
+ }, Tc = () => {
3477
3484
  var v;
3478
- const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: s } = B(), { stringSet: a } = O(), { aiAgentInfo: i, activeChannel: l } = U(), { channelSource: c, onNavigateToConversationList: d } = Z(), g = c.channel, f = Oe() ? 24 : 16, x = () => {
3485
+ const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: s } = B(), { stringSet: i } = O(), { aiAgentInfo: a, activeChannel: l } = U(), { channelSource: c, onNavigateToConversationList: d } = Z(), h = c.channel, f = Oe() ? 24 : 16, x = () => {
3479
3486
  e.setOpened(!1);
3480
- }, b = async () => {
3487
+ }, E = async () => {
3481
3488
  try {
3482
- const S = await (g == null ? void 0 : g.markConversationAsHandoff());
3489
+ const S = await (h == null ? void 0 : h.markConversationAsHandoff());
3483
3490
  t.info("conversation.handleAgentHandoff: success", S);
3484
3491
  } catch (S) {
3485
3492
  t.error("conversation.handleAgentHandoff: error", S);
3486
3493
  }
3487
- }, E = async () => {
3488
- g && await s.send(ro.CloseConversation({ channelUrl: g.url }));
3489
- }, m = l && (g == null ? void 0 : g.url) === l.url, C = i.showHandoffButton && !!((v = g == null ? void 0 : g.conversation) != null && v.handoff) && m;
3490
- return /* @__PURE__ */ r.createElement(Ic, null, /* @__PURE__ */ r.createElement($c, null, d && /* @__PURE__ */ r.createElement(De, { onClick: () => d() }, /* @__PURE__ */ r.createElement(M, { type: "menu", size: 24, color: p.themedColor.textHighEmphasis })), m && /* @__PURE__ */ r.createElement(qn, { size: 34 }), /* @__PURE__ */ r.createElement(Oc, { variant: "h2", color: p.themedColor.textHighEmphasis }, i.nickname || (g == null ? void 0 : g.name))), /* @__PURE__ */ r.createElement(Mc, null, C && /* @__PURE__ */ r.createElement(
3491
- kc,
3494
+ }, b = async () => {
3495
+ h && await s.send(oo.CloseConversation({ channelUrl: h.url }));
3496
+ }, g = l && (h == null ? void 0 : h.url) === l.url, C = a.showHandoffButton && !!((v = h == null ? void 0 : h.conversation) != null && v.handoff) && g;
3497
+ return /* @__PURE__ */ r.createElement($c, null, /* @__PURE__ */ r.createElement(Mc, null, d && /* @__PURE__ */ r.createElement(De, { onClick: () => d() }, /* @__PURE__ */ r.createElement(M, { type: "menu", size: 24, color: p.themedColor.textHighEmphasis })), g && /* @__PURE__ */ r.createElement(qn, { size: 34 }), /* @__PURE__ */ r.createElement(Lc, { variant: "h2", color: p.themedColor.textHighEmphasis }, a.nickname || (h == null ? void 0 : h.name))), /* @__PURE__ */ r.createElement(Oc, null, C && /* @__PURE__ */ r.createElement(
3498
+ Ic,
3492
3499
  {
3493
- tooltipLabel: a.HEADER_BUTTON__AGENT_HANDOFF,
3494
- disabled: !oi(g),
3500
+ tooltipLabel: i.HEADER_BUTTON__AGENT_HANDOFF,
3501
+ disabled: !si(h),
3495
3502
  size: f,
3496
- onClick: b
3503
+ onClick: E
3497
3504
  }
3498
3505
  ), n && /* @__PURE__ */ r.createElement(
3499
- Ac,
3506
+ kc,
3500
3507
  {
3501
- disabled: !Bn(g),
3508
+ disabled: !Bn(h),
3502
3509
  size: f,
3503
- onClick: E
3510
+ onClick: b
3504
3511
  }
3505
- ), o && /* @__PURE__ */ r.createElement(Tc, { size: f }), /* @__PURE__ */ r.createElement(wc, { size: f, onClick: x })));
3506
- }, Tc = ({ size: e, disabled: t }) => {
3512
+ ), o && /* @__PURE__ */ r.createElement(wc, { size: f }), /* @__PURE__ */ r.createElement(Ac, { size: f, onClick: x })));
3513
+ }, wc = ({ size: e, disabled: t }) => {
3507
3514
  const { state: n } = B();
3508
3515
  return /* @__PURE__ */ r.createElement(De, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement(M, { type: n.expanded ? "collapse" : "expand", size: e, color: p.themedColor.textHighEmphasis }));
3509
- }, wc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(De, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(M, { type: "close", size: e, color: p.themedColor.textHighEmphasis })), Ac = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(De, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
3516
+ }, Ac = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(De, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(M, { type: "close", size: e, color: p.themedColor.textHighEmphasis })), kc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(De, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
3510
3517
  M,
3511
3518
  {
3512
3519
  type: "refresh",
3513
3520
  size: e,
3514
3521
  color: t ? p.themedColor.textDisabled : p.themedColor.textHighEmphasis
3515
3522
  }
3516
- )), kc = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(Vn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(De, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
3523
+ )), Ic = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(Vn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(De, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
3517
3524
  M,
3518
3525
  {
3519
3526
  type: "agent",
3520
3527
  size: e,
3521
3528
  color: n ? p.themedColor.textDisabled : p.themedColor.textHighEmphasis
3522
3529
  }
3523
- ))), Ic = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${p.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, $c = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, Mc = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Oc = u(w)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, De = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Lc = () => {
3530
+ ))), $c = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${p.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Mc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, Oc = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Lc = u(w)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, De = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Rc = () => {
3524
3531
  const { isActionbookTester: e } = Re();
3525
- return e ? null : /* @__PURE__ */ r.createElement(Sc, null);
3532
+ return e ? null : /* @__PURE__ */ r.createElement(Tc, null);
3526
3533
  }, pn = ({
3527
3534
  children: e,
3528
3535
  onNavigateToConversationList: t,
@@ -3531,71 +3538,79 @@ const ac = (e, t) => {
3531
3538
  }) => {
3532
3539
  const { Template: s } = Nt.useContext();
3533
3540
  return /* @__PURE__ */ r.createElement(
3534
- nl,
3541
+ rl,
3535
3542
  {
3536
3543
  onNavigateToConversationList: t,
3537
3544
  closedChannelUrl: n,
3538
3545
  onClearClosedChannelUrl: o
3539
3546
  },
3540
- /* @__PURE__ */ r.createElement(Et, null, /* @__PURE__ */ r.createElement(Et.Consumer, null, (a) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Dc, { ...a }, /* @__PURE__ */ r.createElement(s, null)), e)))
3547
+ /* @__PURE__ */ r.createElement(Et, null, /* @__PURE__ */ r.createElement(Et.Consumer, null, (i) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Nc, { ...i }, /* @__PURE__ */ r.createElement(s, null)), e)))
3541
3548
  );
3542
3549
  }, Nt = _e({
3543
- template: Rc,
3550
+ template: Dc,
3544
3551
  components: {
3545
- Header: Lc,
3546
- Body: ql,
3547
- Footer: _c
3552
+ Header: Rc,
3553
+ Body: Jl,
3554
+ Footer: Sc
3548
3555
  }
3549
3556
  });
3550
- function Rc() {
3557
+ function Dc() {
3551
3558
  const { components: e } = Nt.useContext();
3552
3559
  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));
3553
3560
  }
3554
- const Dc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
3555
- Provider: Nc,
3556
- Context: iu,
3561
+ const Nc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
3562
+ Provider: Pc,
3563
+ Context: au,
3557
3564
  useContext: or
3558
3565
  } = G("ConversationList");
3559
- function Pc({
3560
- conversationListFilter: e,
3561
- onOpenConversationView: t = Ie,
3562
- children: n
3566
+ function Bc({
3567
+ conversationListLimit: e,
3568
+ conversationListFilter: t,
3569
+ onOpenConversationView: n = Ie,
3570
+ children: o
3563
3571
  }) {
3564
- return /* @__PURE__ */ r.createElement(go, { conversationListFilter: e }, (o) => /* @__PURE__ */ r.createElement(Nc, { value: { ...o, onOpenConversationView: t } }, n));
3572
+ return /* @__PURE__ */ r.createElement(
3573
+ ho,
3574
+ {
3575
+ conversationListLimit: e,
3576
+ conversationListFilter: t
3577
+ },
3578
+ (s) => /* @__PURE__ */ r.createElement(Pc, { value: { ...s, onOpenConversationView: n } }, o)
3579
+ );
3565
3580
  }
3566
3581
  const sr = _e({
3567
- template: Bc,
3582
+ template: Fc,
3568
3583
  // Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
3569
3584
  components: {}
3570
3585
  });
3571
- function Bc({
3586
+ function Fc({
3572
3587
  title: e = "",
3573
3588
  lastMessageTimestamp: t = Date.now(),
3574
3589
  onClick: n
3575
3590
  }) {
3576
3591
  const { stringSet: o, format: s } = O();
3577
- return /* @__PURE__ */ r.createElement(Fc, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(Hc, null, /* @__PURE__ */ r.createElement(zc, null, /* @__PURE__ */ r.createElement(w, { variant: "subtitle1", color: p.themedColor.textHighEmphasis }, s(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE)), /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textLowEmphasis }, s(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION))), /* @__PURE__ */ r.createElement(w, { variant: "body3", color: p.themedColor.textMidEmphasis }, e || o.CONVERSATION_LIST__TOPICS_FALLBACK)), /* @__PURE__ */ r.createElement(M, { type: "chevron-right", size: 16, color: p.themedColor.textHighEmphasis }), /* @__PURE__ */ r.createElement(Uc, null));
3592
+ return /* @__PURE__ */ r.createElement(Uc, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(zc, null, /* @__PURE__ */ r.createElement(Vc, null, /* @__PURE__ */ r.createElement(w, { variant: "subtitle1", color: p.themedColor.textHighEmphasis }, s(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE)), /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textLowEmphasis }, s(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION))), /* @__PURE__ */ r.createElement(w, { variant: "body3", color: p.themedColor.textMidEmphasis }, e || o.CONVERSATION_LIST__TOPICS_FALLBACK)), /* @__PURE__ */ r.createElement(M, { type: "chevron-right", size: 16, color: p.themedColor.textHighEmphasis }), /* @__PURE__ */ r.createElement(Hc, null));
3578
3593
  }
3579
- const Fc = 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;`, Uc = u.div`position:absolute;bottom:0;height:1px;width:calc(100% - 32px);background-color:${p.themedColor.textDisabled};`, Hc = u.div`gap:4px;display:flex;flex-direction:column;flex:1;`, zc = u.div`display:flex;justify-content:flex-start;align-items:center;gap:6px;`, Vc = ({ items: e, renderItem: t, onEndReached: n }) => {
3594
+ const Uc = 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;`, Hc = u.div`position:absolute;bottom:0;height:1px;width:calc(100% - 32px);background-color:${p.themedColor.textDisabled};`, zc = u.div`gap:4px;display:flex;flex-direction:column;flex:1;`, Vc = u.div`display:flex;justify-content:flex-start;align-items:center;gap:6px;`, Wc = ({ items: e, renderItem: t, onEndReached: n }) => {
3580
3595
  const o = (s) => {
3581
- const a = s.target;
3582
- a.scrollHeight - a.scrollTop === a.clientHeight && (n == null || n());
3596
+ const i = s.target;
3597
+ i.scrollHeight - i.scrollTop === i.clientHeight && (n == null || n());
3583
3598
  };
3584
- return /* @__PURE__ */ r.createElement(Wc, { onScroll: (s) => o(s) }, e.map((s, a) => t(s, a)));
3585
- }, Wc = u.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`, Gc = () => {
3599
+ return /* @__PURE__ */ r.createElement(Gc, { onScroll: (s) => o(s) }, e.map((s, i) => t(s, i)));
3600
+ }, Gc = u.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`, jc = () => {
3586
3601
  const { stringSet: e } = O(), { listSource: t, onOpenConversationView: n } = or(), { Template: o } = sr.useContext();
3587
3602
  return t.initialized ? t.channels.length === 0 ? /* @__PURE__ */ r.createElement(Ce, { type: "noChannels", label: e.CONVERSATION_LIST__NO_CONVERSATIONS }) : /* @__PURE__ */ r.createElement(
3588
- Vc,
3603
+ Wc,
3589
3604
  {
3590
3605
  items: t.channels,
3591
3606
  renderItem: (s) => {
3592
- var a, i, l;
3607
+ var i, a, l;
3593
3608
  return /* @__PURE__ */ r.createElement(
3594
3609
  o,
3595
3610
  {
3596
3611
  key: s.url,
3597
3612
  channelUrl: s.url,
3598
- title: (i = (a = s.conversation) == null ? void 0 : a.topics) == null ? void 0 : i.join(", "),
3613
+ title: (a = (i = s.conversation) == null ? void 0 : i.topics) == null ? void 0 : a.join(", "),
3599
3614
  lastMessageTimestamp: (l = s.lastMessage) == null ? void 0 : l.createdAt,
3600
3615
  onClick: () => n(s.url, W.CLOSED),
3601
3616
  channel: s
@@ -3607,10 +3622,10 @@ const Fc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
3607
3622
  }
3608
3623
  }
3609
3624
  ) : /* @__PURE__ */ r.createElement(Ce, { type: "loading" });
3610
- }, jc = () => {
3625
+ }, Kc = () => {
3611
3626
  const { refreshActiveChannel: e } = U(), { onOpenConversationView: t } = or(), n = er();
3612
3627
  return /* @__PURE__ */ r.createElement(
3613
- Kc,
3628
+ Zc,
3614
3629
  {
3615
3630
  role: "button",
3616
3631
  onClick: async () => {
@@ -3618,35 +3633,41 @@ const Fc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
3618
3633
  t(o, W.OPEN);
3619
3634
  }
3620
3635
  },
3621
- /* @__PURE__ */ r.createElement(Zc, { variant: "h1" }, n)
3636
+ /* @__PURE__ */ r.createElement(Yc, { variant: "h1" }, n)
3622
3637
  );
3623
- }, Kc = u.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, Zc = u(w)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, Yc = () => {
3638
+ }, Zc = u.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, Yc = u(w)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, qc = () => {
3624
3639
  const { stringSet: e } = O();
3625
- return /* @__PURE__ */ r.createElement(qc, null, /* @__PURE__ */ r.createElement(Jc, { variant: "h2", color: p.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Xc, null));
3626
- }, qc = 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};`, Jc = u(w)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Xc = u.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${p.themedColor.textDisabled};`, Qc = ({ conversationListFilter: e, children: t, onOpenConversationView: n }) => {
3627
- const { Template: o } = Pt.useContext();
3640
+ return /* @__PURE__ */ r.createElement(Jc, null, /* @__PURE__ */ r.createElement(Xc, { variant: "h2", color: p.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Qc, null));
3641
+ }, Jc = 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};`, Xc = u(w)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Qc = u.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${p.themedColor.textDisabled};`, ed = ({
3642
+ conversationListLimit: e,
3643
+ conversationListFilter: t,
3644
+ children: n,
3645
+ onOpenConversationView: o
3646
+ }) => {
3647
+ const { Template: s } = Pt.useContext();
3628
3648
  return /* @__PURE__ */ r.createElement(
3629
- Pc,
3649
+ Bc,
3630
3650
  {
3631
- conversationListFilter: e,
3632
- onOpenConversationView: n
3651
+ conversationListLimit: e,
3652
+ conversationListFilter: t,
3653
+ onOpenConversationView: o
3633
3654
  },
3634
- /* @__PURE__ */ r.createElement(td, null, /* @__PURE__ */ r.createElement(o, null)),
3635
- t
3655
+ /* @__PURE__ */ r.createElement(nd, null, /* @__PURE__ */ r.createElement(s, null)),
3656
+ n
3636
3657
  );
3637
3658
  }, Pt = _e({
3638
- template: ed,
3659
+ template: td,
3639
3660
  components: {
3640
- Header: Yc,
3641
- Body: Gc,
3642
- Footer: jc
3661
+ Header: qc,
3662
+ Body: jc,
3663
+ Footer: Kc
3643
3664
  }
3644
3665
  });
3645
- function ed() {
3666
+ function td() {
3646
3667
  const { components: e } = Pt.useContext();
3647
3668
  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));
3648
3669
  }
3649
- const td = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, nd = I`:where(#${Q.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, rd = [nd, ss, is], od = (e, ...t) => Ir(e, ...rd, ...t), sd = od``, id = Kr(
3670
+ const nd = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, rd = I`:where(#${ee.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, od = [rd, is, as], sd = (e, ...t) => $r(e, ...od, ...t), id = sd``, ad = Zr(
3650
3671
  Nt,
3651
3672
  xe,
3652
3673
  Ot,
@@ -3654,17 +3675,17 @@ const td = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:
3654
3675
  Pt,
3655
3676
  sr
3656
3677
  );
3657
- function ad({
3678
+ function ld({
3658
3679
  appearance: e,
3659
3680
  rootElement: t,
3660
3681
  logger: n,
3661
3682
  language: o,
3662
3683
  stringSet: s,
3663
- children: a,
3664
- messageTemplate: i,
3684
+ children: i,
3685
+ messageTemplate: a,
3665
3686
  theme: l
3666
3687
  }) {
3667
- return ms(Yo, t), /* @__PURE__ */ r.createElement($r, { target: t }, /* @__PURE__ */ r.createElement(cs, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(zo, { internalVariables: i == null ? void 0 : i.__internalVariables }, /* @__PURE__ */ r.createElement(os, { stringSet: s, logger: n, language: o }, /* @__PURE__ */ r.createElement(id, null, a, /* @__PURE__ */ r.createElement(sd, null))))));
3688
+ return gs(qo, t), /* @__PURE__ */ r.createElement(Mr, { target: t }, /* @__PURE__ */ r.createElement(ds, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(Vo, { internalVariables: a == null ? void 0 : a.__internalVariables }, /* @__PURE__ */ r.createElement(ss, { stringSet: s, logger: n, language: o }, /* @__PURE__ */ r.createElement(ad, null, i, /* @__PURE__ */ r.createElement(id, null))))));
3668
3689
  }
3669
3690
  const We = {}, Ge = {
3670
3691
  getItem: (e) => {
@@ -3705,23 +3726,23 @@ const We = {}, Ge = {
3705
3726
  logLevel: n = En.WARN,
3706
3727
  language: o = navigator.language,
3707
3728
  userSessionInfo: s,
3708
- children: a,
3709
- ...i
3729
+ children: i,
3730
+ ...a
3710
3731
  }, l) {
3711
3732
  var c, d;
3712
- return we.level !== n && (we.level = n), us("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: Q.ENTRY, style: { width: "fit-content", height: "fit-content", ...i.entryStyle } }, /* @__PURE__ */ r.createElement(
3713
- ad,
3733
+ return we.level !== n && (we.level = n), ms("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: ee.ENTRY, style: { width: "fit-content", height: "fit-content", ...a.entryStyle } }, /* @__PURE__ */ r.createElement(
3734
+ ld,
3714
3735
  {
3715
3736
  logger: we,
3716
3737
  rootElement: t,
3717
- appearance: (c = i.agentPreviewConfigs) == null ? void 0 : c.appearance,
3718
- stringSet: i.stringSet,
3738
+ appearance: (c = a.agentPreviewConfigs) == null ? void 0 : c.appearance,
3739
+ stringSet: a.stringSet,
3719
3740
  language: o,
3720
- messageTemplate: i.messageTemplate,
3721
- theme: i.theme
3741
+ messageTemplate: a.messageTemplate,
3742
+ theme: a.theme
3722
3743
  },
3723
3744
  /* @__PURE__ */ r.createElement(
3724
- ps,
3745
+ fs,
3725
3746
  {
3726
3747
  rootElement: t,
3727
3748
  keyValueStorage: {
@@ -3732,59 +3753,59 @@ const We = {}, Ge = {
3732
3753
  },
3733
3754
  language: o,
3734
3755
  logger: we,
3735
- dispatcher: ld,
3736
- chatParams: { customApiHost: i.customApiHost, customWebSocketHost: i.customWebSocketHost },
3737
- ...i
3756
+ dispatcher: cd,
3757
+ chatParams: { customApiHost: a.customApiHost, customWebSocketHost: a.customWebSocketHost },
3758
+ ...a
3738
3759
  },
3739
3760
  /* @__PURE__ */ r.createElement(
3740
- bs,
3761
+ Es,
3741
3762
  {
3742
3763
  ref: l,
3743
3764
  userSessionInfo: s,
3744
- forceCreateChannel: (d = i.agentPreviewConfigs) == null ? void 0 : d.forceCreateChannel
3765
+ forceCreateChannel: (d = a.agentPreviewConfigs) == null ? void 0 : d.forceCreateChannel
3745
3766
  },
3746
- /* @__PURE__ */ r.createElement(Na, { ...i._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id: Q.MODAL_ROOT }))
3767
+ /* @__PURE__ */ r.createElement(Pa, { ...a._UNSAFE_INTERNAL_dashboardTester }, i, /* @__PURE__ */ r.createElement("div", { id: ee.MODAL_ROOT }))
3747
3768
  )
3748
3769
  )
3749
3770
  ));
3750
- }), we = new Tn(En.WARN), ld = new _n(we), ar = ({ children: e, isOpened: t }) => {
3771
+ }), we = new Tn(En.WARN), cd = new _n(we), ar = ({ children: e, isOpened: t }) => {
3751
3772
  const { dir: n, rootElement: o } = B(), s = pe(o, !0);
3752
3773
  return L(() => {
3753
- const a = "sb-agent-block-scroll";
3754
- return t ? s.body.classList.add(a) : s.body.classList.remove(a), () => {
3755
- s.body.classList.remove(a);
3774
+ const i = "sb-agent-block-scroll";
3775
+ return t ? s.body.classList.add(i) : s.body.classList.remove(i), () => {
3776
+ s.body.classList.remove(i);
3756
3777
  };
3757
- }, [s, t]), /* @__PURE__ */ r.createElement(cd, { dir: n, $visible: t }, e);
3758
- }, cd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${fe.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, dd = 48, ud = 2 / 3;
3759
- function md({
3778
+ }, [s, t]), /* @__PURE__ */ r.createElement(dd, { dir: n, $visible: t }, e);
3779
+ }, dd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${fe.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, ud = 48, md = 2 / 3;
3780
+ function gd({
3760
3781
  className: e,
3761
3782
  isOpened: t,
3762
3783
  onClick: n,
3763
3784
  type: o,
3764
3785
  imageUrl: s,
3765
- dir: a,
3766
- animated: i = !0,
3786
+ dir: i,
3787
+ animated: a = !0,
3767
3788
  backgroundColor: l,
3768
- size: c = dd
3789
+ size: c = ud
3769
3790
  }) {
3770
- const d = pt(l), g = Math.round(c * ud);
3791
+ const d = pt(l), h = Math.round(c * md);
3771
3792
  return /* @__PURE__ */ r.createElement(
3772
- pd,
3793
+ fd,
3773
3794
  {
3774
- dir: a,
3775
- id: Q.LAUNCHER,
3795
+ dir: i,
3796
+ id: ee.LAUNCHER,
3776
3797
  className: e,
3777
3798
  "aria-label": "Sendbird AIAgent Launcher",
3778
3799
  onClick: n,
3779
- $animated: i,
3800
+ $animated: a,
3780
3801
  $backgroundColor: l,
3781
3802
  $size: c
3782
3803
  },
3783
- /* @__PURE__ */ r.createElement(fd, { $isOpened: t, $animated: i, $fillColor: d, $iconSize: g }, /* @__PURE__ */ r.createElement(fn.Open, { url: s, isDefaultIcon: o === "default_icon" })),
3784
- /* @__PURE__ */ r.createElement(bd, { $isOpened: t, $animated: i, $fillColor: d, $iconSize: g }, /* @__PURE__ */ r.createElement(fn.Close, { size: g }))
3804
+ /* @__PURE__ */ r.createElement(bd, { $isOpened: t, $animated: a, $fillColor: d, $iconSize: h }, /* @__PURE__ */ r.createElement(fn.Open, { url: s, isDefaultIcon: o === "default_icon" })),
3805
+ /* @__PURE__ */ r.createElement(Ed, { $isOpened: t, $animated: a, $fillColor: d, $iconSize: h }, /* @__PURE__ */ r.createElement(fn.Close, { size: h }))
3785
3806
  );
3786
3807
  }
3787
- const gd = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, hd = I`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 === $n.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, lr = I`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => I`
3808
+ const hd = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, pd = I`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 === $n.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, lr = I`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => I`
3788
3809
  path {
3789
3810
  fill: ${e};
3790
3811
  }
@@ -3793,66 +3814,66 @@ const gd = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
3793
3814
  }
3794
3815
  `}
3795
3816
  }
3796
- `, pd = 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 && gd}`, cr = 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;`, fd = u(cr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${hd}${lr}`, bd = u(cr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${lr}`, fn = {
3817
+ `, fd = 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 && hd}`, cr = 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;`, bd = u(cr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${pd}${lr}`, Ed = u(cr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${lr}`, fn = {
3797
3818
  Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(kt, null),
3798
3819
  Close: ({ size: e }) => /* @__PURE__ */ r.createElement(M, { size: e, type: "chevron-down" })
3799
3820
  };
3800
3821
  function dr({ className: e, size: t }) {
3801
- const { colors: n } = xt(), { dir: o, state: s } = B(), { launcherInfo: a } = U();
3802
- return xd(), /* @__PURE__ */ r.createElement(
3803
- md,
3822
+ const { colors: n } = xt(), { dir: o, state: s } = B(), { launcherInfo: i } = U();
3823
+ return Cd(), /* @__PURE__ */ r.createElement(
3824
+ gd,
3804
3825
  {
3805
3826
  dir: o,
3806
3827
  className: e,
3807
3828
  isOpened: s.opened,
3808
3829
  onClick: () => s.setOpened(!s.opened),
3809
- type: a.type,
3810
- imageUrl: a.imageUrl,
3830
+ type: i.type,
3831
+ imageUrl: i.imageUrl,
3811
3832
  backgroundColor: n.base.primary,
3812
3833
  size: t
3813
3834
  }
3814
3835
  );
3815
3836
  }
3816
- const Ed = 1e3 * 60;
3817
- function xd() {
3837
+ const xd = 1e3 * 60;
3838
+ function Cd() {
3818
3839
  const { chatSDK: e, state: t, logger: n, enableAutoDisconnectInLauncher: o } = B(), s = N(null);
3819
3840
  L(() => {
3820
3841
  if (!o) return;
3821
- function a() {
3842
+ function i() {
3822
3843
  s.current && (clearTimeout(s.current), s.current = null);
3823
3844
  }
3824
- function i() {
3825
- e.connectionState === Ar.CLOSED && (e.reconnect(), n.debug("useSDKInactivityTimeout: reconnected")), a(), n.debug("useSDKInactivityTimeout: clear disconnect schedule");
3845
+ function a() {
3846
+ e.connectionState === kr.CLOSED && (e.reconnect(), n.debug("useSDKInactivityTimeout: reconnected")), i(), n.debug("useSDKInactivityTimeout: clear disconnect schedule");
3826
3847
  }
3827
3848
  function l() {
3828
- a(), s.current = setTimeout(async () => {
3849
+ i(), s.current = setTimeout(async () => {
3829
3850
  await e.disconnectWebSocket(), n.debug("useSDKInactivityTimeout: disconnected");
3830
- }, Ed);
3851
+ }, xd);
3831
3852
  }
3832
- t.opened ? i() : (l(), n.debug("useSDKInactivityTimeout: schedule disconnect"));
3853
+ t.opened ? a() : (l(), n.debug("useSDKInactivityTimeout: schedule disconnect"));
3833
3854
  }, [o, e, t.opened]);
3834
3855
  }
3835
3856
  const ur = ve(null);
3836
- function Cd() {
3837
- const e = X(ur);
3857
+ function vd() {
3858
+ const e = Q(ur);
3838
3859
  if (!e)
3839
3860
  throw new Error("useNavigator() must be used within <Navigator />");
3840
3861
  return e;
3841
3862
  }
3842
3863
  function mr({ children: e }) {
3843
- const t = Cd();
3864
+ const t = vd();
3844
3865
  return typeof e == "function" ? e(t) : /* @__PURE__ */ r.createElement(r.Fragment, null, e);
3845
3866
  }
3846
- const vd = xn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, yd = xn`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, _d = I`animation-name:${vd};animation-duration:0.3s;animation-fill-mode:forwards;`, Sd = I``, Td = I`animation-name:${yd};animation-duration:0.3s;animation-fill-mode:forwards;`, wd = I`visibility:hidden;`, Ad = u.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
3867
+ const yd = xn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, _d = xn`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, Sd = I`animation-name:${yd};animation-duration:0.3s;animation-fill-mode:forwards;`, Td = I``, wd = I`animation-name:${_d};animation-duration:0.3s;animation-fill-mode:forwards;`, Ad = I`visibility:hidden;`, kd = u.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
3847
3868
  switch (e) {
3848
3869
  case "entering":
3849
- return _d;
3850
- case "entered":
3851
3870
  return Sd;
3852
- case "exiting":
3871
+ case "entered":
3853
3872
  return Td;
3854
- case "exited":
3873
+ case "exiting":
3855
3874
  return wd;
3875
+ case "exited":
3876
+ return Ad;
3856
3877
  default:
3857
3878
  return "";
3858
3879
  }
@@ -3861,23 +3882,23 @@ const vd = xn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
3861
3882
  ` : I`z-index:1;pointer-events:none;`}
3862
3883
  `;
3863
3884
  function Ae({ initialId: e, children: t }) {
3864
- const n = R((m, C) => {
3865
- c((v) => [...v, m]), g((v) => ({ ...v, [m]: !0 })), C != null && C.reset && b((v) => ({
3885
+ const n = R((g, C) => {
3886
+ c((v) => [...v, g]), h((v) => ({ ...v, [g]: !0 })), C != null && C.reset && E((v) => ({
3866
3887
  ...v,
3867
- [m]: (v[m] || 0) + 1
3888
+ [g]: (v[g] || 0) + 1
3868
3889
  })), f((v) => ({
3869
3890
  ...v,
3870
- [m]: "entering"
3891
+ [g]: "entering"
3871
3892
  })), setTimeout(() => {
3872
3893
  f((v) => ({
3873
3894
  ...v,
3874
- [m]: "entered"
3895
+ [g]: "entered"
3875
3896
  }));
3876
3897
  }, 300);
3877
3898
  }, []), o = R(() => {
3878
- c((m) => {
3879
- if (m.length <= 1) return m;
3880
- const C = m[m.length - 1];
3899
+ c((g) => {
3900
+ if (g.length <= 1) return g;
3901
+ const C = g[g.length - 1];
3881
3902
  return f((v) => ({
3882
3903
  ...v,
3883
3904
  [C]: "exiting"
@@ -3886,40 +3907,40 @@ function Ae({ initialId: e, children: t }) {
3886
3907
  ...v,
3887
3908
  [C]: "exited"
3888
3909
  })), c((v) => v.slice(0, -1));
3889
- }, 300), m;
3910
+ }, 300), g;
3890
3911
  });
3891
3912
  }, []), s = ae(() => ({
3892
3913
  navigation: {
3893
3914
  navigate: n,
3894
3915
  pop: o
3895
3916
  }
3896
- }), [n, o]), a = ae(() => vr.toArray(t).filter(
3897
- (m) => m.type === mr
3898
- ), [t]), i = ae(() => {
3899
- const m = {};
3900
- return a.forEach((C) => {
3917
+ }), [n, o]), i = ae(() => vr.toArray(t).filter(
3918
+ (g) => g.type === mr
3919
+ ), [t]), a = ae(() => {
3920
+ const g = {};
3921
+ return i.forEach((C) => {
3901
3922
  const { id: v, lazy: S, children: k } = C.props;
3902
- m[v] = { lazy: S, element: typeof k == "function" ? k(s) : k };
3903
- }), m;
3904
- }, [a]), [l, c] = _([e]), [d, g] = _(() => {
3905
- const m = {};
3906
- return Object.entries(i).forEach(([C, { lazy: v }]) => {
3907
- v === !1 && (m[C] = !0);
3908
- }), m[e] = !0, m;
3909
- }), [h, f] = _(() => {
3910
- const m = {};
3911
- return Object.keys(i).forEach((C) => {
3912
- C === e ? m[C] = "entered" : m[C] = "exited";
3913
- }), m;
3914
- }), [x, b] = _({}), E = l[l.length - 1];
3915
- return /* @__PURE__ */ r.createElement(ur.Provider, { value: s }, /* @__PURE__ */ r.createElement(kd, null, Object.keys(i).map((m) => {
3923
+ g[v] = { lazy: S, element: typeof k == "function" ? k(s) : k };
3924
+ }), g;
3925
+ }, [i]), [l, c] = _([e]), [d, h] = _(() => {
3926
+ const g = {};
3927
+ return Object.entries(a).forEach(([C, { lazy: v }]) => {
3928
+ v === !1 && (g[C] = !0);
3929
+ }), g[e] = !0, g;
3930
+ }), [m, f] = _(() => {
3931
+ const g = {};
3932
+ return Object.keys(a).forEach((C) => {
3933
+ C === e ? g[C] = "entered" : g[C] = "exited";
3934
+ }), g;
3935
+ }), [x, E] = _({}), b = l[l.length - 1];
3936
+ return /* @__PURE__ */ r.createElement(ur.Provider, { value: s }, /* @__PURE__ */ r.createElement(Id, null, Object.keys(a).map((g) => {
3916
3937
  var k;
3917
- if (!d[m]) return null;
3918
- const C = h[m] || "exited", v = m === E, S = `${m}-${x[m] || 0}`;
3919
- return /* @__PURE__ */ r.createElement(Ad, { key: S, $transitionState: C, $active: v }, (k = i[m]) == null ? void 0 : k.element);
3938
+ if (!d[g]) return null;
3939
+ const C = m[g] || "exited", v = g === b, S = `${g}-${x[g] || 0}`;
3940
+ return /* @__PURE__ */ r.createElement(kd, { key: S, $transitionState: C, $active: v }, (k = a[g]) == null ? void 0 : k.element);
3920
3941
  })));
3921
3942
  }
3922
- const kd = u.div`position:relative;width:100%;height:100%;`;
3943
+ const Id = u.div`position:relative;width:100%;height:100%;`;
3923
3944
  Ae.Screen = mr;
3924
3945
  const he = {
3925
3946
  activeConv: "active-conv",
@@ -3933,36 +3954,36 @@ const he = {
3933
3954
  onClearClosedChannelUrl: () => e(void 0)
3934
3955
  }
3935
3956
  )), /* @__PURE__ */ r.createElement(Ae.Screen, { id: he.convList, lazy: !0 }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
3936
- Qc,
3957
+ ed,
3937
3958
  {
3938
3959
  onOpenConversationView: (o, s) => {
3939
3960
  s === "closed" ? (e(o), n.navigate(he.closedConv, { reset: !0 })) : n.navigate(he.activeConv);
3940
3961
  }
3941
3962
  }
3942
3963
  )));
3943
- function Id({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
3964
+ function $d({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
3944
3965
  const { dir: s } = B();
3945
- return /* @__PURE__ */ r.createElement($d, null, /* @__PURE__ */ r.createElement(Md, { dir: s, id: Q.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
3966
+ return /* @__PURE__ */ r.createElement(Md, null, /* @__PURE__ */ r.createElement(Od, { dir: s, id: ee.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
3946
3967
  }
3947
- const $d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Md = 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 && Ld};${({ $isExpanded: e }) => e && Od};`, Od = I`width:743px;height:723px;`, Ld = I`z-index:${fe.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;`, au = ye(function({ children: e, ...t }, n) {
3948
- const o = Oe(), [s, a] = _(), i = o ? ar : Id;
3949
- return /* @__PURE__ */ r.createElement(ir, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(In, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(i, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(dr, null) }, /* @__PURE__ */ r.createElement(
3968
+ const Md = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Od = 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 && Rd};${({ $isExpanded: e }) => e && Ld};`, Ld = I`width:743px;height:723px;`, Rd = I`z-index:${fe.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;`, lu = ye(function({ children: e, ...t }, n) {
3969
+ const o = Oe(), [s, i] = _(), a = o ? ar : $d;
3970
+ return /* @__PURE__ */ r.createElement(ir, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(In, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(a, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(dr, null) }, /* @__PURE__ */ r.createElement(
3950
3971
  gr,
3951
3972
  {
3952
3973
  closedChannelUrl: s,
3953
- setClosedChannelUrl: a
3974
+ setClosedChannelUrl: i
3954
3975
  }
3955
3976
  )), e)));
3956
3977
  }), {
3957
- Provider: Rd,
3978
+ Provider: Dd,
3958
3979
  useContext: Bt
3959
3980
  } = G("FixedMessengerStyle");
3960
3981
  function hr(e, t, n, o = 0) {
3961
- const { top: s, bottom: a, start: i, end: l } = n;
3982
+ const { top: s, bottom: i, start: a, end: l } = n;
3962
3983
  let c = "", d = "";
3963
3984
  switch (e) {
3964
3985
  case "start":
3965
- d = `inset-inline-start: ${j(i)}`;
3986
+ d = `inset-inline-start: ${j(a)}`;
3966
3987
  break;
3967
3988
  case "end":
3968
3989
  d = `inset-inline-end: ${j(l)}`;
@@ -3973,111 +3994,111 @@ function hr(e, t, n, o = 0) {
3973
3994
  c = `top: calc(${j(s)} + ${o}px)`;
3974
3995
  break;
3975
3996
  case "bottom":
3976
- c = `bottom: calc(${j(a)} + ${o}px)`;
3997
+ c = `bottom: calc(${j(i)} + ${o}px)`;
3977
3998
  break;
3978
3999
  }
3979
4000
  return I`${c};${d};`;
3980
4001
  }
3981
- function Dd(e) {
4002
+ function Nd(e) {
3982
4003
  const { horizontal: t, vertical: n, margin: o, launcherSize: s } = Bt();
3983
- return /* @__PURE__ */ r.createElement(Nd, { ...e, size: s, $horizontal: t, $vertical: n, $margin: o });
4004
+ return /* @__PURE__ */ r.createElement(Pd, { ...e, size: s, $horizontal: t, $vertical: n, $margin: o });
3984
4005
  }
3985
- const Nd = u(dr)`position:fixed;z-index:${fe.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => hr(e, t, n)};`;
3986
- function Pd({ isExpanded: e, isOpened: t, children: n }) {
3987
- const { dir: o } = B(), { horizontal: s, vertical: a, margin: i, launcherSize: l } = Bt();
4006
+ const Pd = u(dr)`position:fixed;z-index:${fe.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => hr(e, t, n)};`;
4007
+ function Bd({ isExpanded: e, isOpened: t, children: n }) {
4008
+ const { dir: o } = B(), { horizontal: s, vertical: i, margin: a, launcherSize: l } = Bt();
3988
4009
  return /* @__PURE__ */ r.createElement(
3989
- Bd,
4010
+ Fd,
3990
4011
  {
3991
4012
  dir: o,
3992
- id: Q.WINDOW,
4013
+ id: ee.WINDOW,
3993
4014
  $isExpanded: e,
3994
4015
  $isOpened: t,
3995
4016
  $horizontal: s,
3996
- $vertical: a,
3997
- $margin: i,
4017
+ $vertical: i,
4018
+ $margin: a,
3998
4019
  $launcherSize: l
3999
4020
  },
4000
4021
  n
4001
4022
  );
4002
4023
  }
4003
- const Bd = 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 }) => hr(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}`};
4024
+ const Fd = 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 }) => hr(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}`};
4004
4025
  [dir='rtl'] &:not([dir='ltr']),
4005
4026
  &[dir='rtl'] {
4006
4027
  transform-origin: ${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "right" : "left"} ${t}`};
4007
4028
  }
4008
4029
 
4009
- ${({ $isOpened: e }) => e && Ud};
4010
- ${({ $isExpanded: e }) => e && Fd};
4011
- `, Fd = I`width:743px;height:723px;`, Ud = I`z-index:${fe.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;`, pr = { top: 24, bottom: 24, start: 24, end: 24 }, Hd = ye(function({ children: e, ...t }, n) {
4012
- const [o, s] = _(), [a, i] = _("end-bottom"), [l, c] = _(pr), [d, g] = _(48), h = Oe(), f = h ? ar : Pd, { horizontal: x, vertical: b } = ae(() => {
4013
- const [E, m] = a.split("-");
4014
- return { horizontal: E === "start" ? "start" : "end", vertical: m === "top" ? "top" : "bottom" };
4015
- }, [a]);
4016
- return /* @__PURE__ */ r.createElement(ir, { enableExpandButton: !h, ref: n, ...t }, /* @__PURE__ */ r.createElement(In, null, ({ state: E }) => /* @__PURE__ */ r.createElement(
4017
- Rd,
4030
+ ${({ $isOpened: e }) => e && Hd};
4031
+ ${({ $isExpanded: e }) => e && Ud};
4032
+ `, Ud = I`width:743px;height:723px;`, Hd = I`z-index:${fe.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;`, pr = { top: 24, bottom: 24, start: 24, end: 24 }, zd = ye(function({ children: e, ...t }, n) {
4033
+ const [o, s] = _(), [i, a] = _("end-bottom"), [l, c] = _(pr), [d, h] = _(48), m = Oe(), f = m ? ar : Bd, { horizontal: x, vertical: E } = ae(() => {
4034
+ const [b, g] = i.split("-");
4035
+ return { horizontal: b === "start" ? "start" : "end", vertical: g === "top" ? "top" : "bottom" };
4036
+ }, [i]);
4037
+ return /* @__PURE__ */ r.createElement(ir, { enableExpandButton: !m, ref: n, ...t }, /* @__PURE__ */ r.createElement(In, null, ({ state: b }) => /* @__PURE__ */ r.createElement(
4038
+ Dd,
4018
4039
  {
4019
- value: { horizontal: x, vertical: b, margin: l, launcherSize: d, setPosition: i, setMargin: c, setLauncherSize: g }
4040
+ value: { horizontal: x, vertical: E, margin: l, launcherSize: d, setPosition: a, setMargin: c, setLauncherSize: h }
4020
4041
  },
4021
- /* @__PURE__ */ r.createElement(f, { isExpanded: E.expanded, isOpened: E.opened }, /* @__PURE__ */ r.createElement(
4042
+ /* @__PURE__ */ r.createElement(f, { isExpanded: b.expanded, isOpened: b.opened }, /* @__PURE__ */ r.createElement(
4022
4043
  gr,
4023
4044
  {
4024
4045
  closedChannelUrl: o,
4025
4046
  setClosedChannelUrl: s
4026
4047
  }
4027
4048
  )),
4028
- /* @__PURE__ */ r.createElement(Dd, null),
4049
+ /* @__PURE__ */ r.createElement(Nd, null),
4029
4050
  e
4030
4051
  )));
4031
- }), zd = (e) => {
4032
- var s, a, i, l;
4052
+ }), Vd = (e) => {
4053
+ var s, i, a, l;
4033
4054
  const { setPosition: t, setMargin: n, setLauncherSize: o } = Bt();
4034
4055
  return le(() => {
4035
4056
  e.position && t(e.position), e.margin && n({ ...pr, ...e.margin }), e.launcherSize && o(e.launcherSize);
4036
4057
  }, [
4037
4058
  e.position,
4038
4059
  (s = e.margin) == null ? void 0 : s.top,
4039
- (a = e.margin) == null ? void 0 : a.bottom,
4040
- (i = e.margin) == null ? void 0 : i.start,
4060
+ (i = e.margin) == null ? void 0 : i.bottom,
4061
+ (a = e.margin) == null ? void 0 : a.start,
4041
4062
  (l = e.margin) == null ? void 0 : l.end,
4042
4063
  e.launcherSize
4043
4064
  ]), null;
4044
- }, lu = Object.assign(Hd, {
4045
- Style: zd
4065
+ }, cu = Object.assign(zd, {
4066
+ Style: Vd
4046
4067
  });
4047
4068
  export {
4048
4069
  St as A,
4049
- ro as C,
4050
- au as D,
4051
- lu as F,
4070
+ oo as C,
4071
+ lu as D,
4072
+ cu as F,
4052
4073
  M as I,
4053
4074
  Hn as L,
4054
- La as M,
4075
+ Ra as M,
4055
4076
  Ot as O,
4056
- su as P,
4077
+ iu as P,
4057
4078
  Lt as S,
4058
4079
  w as a,
4059
4080
  ir as b,
4060
4081
  p as c,
4061
- ad as d,
4082
+ ld as d,
4062
4083
  U as e,
4063
4084
  O as f,
4064
- md as g,
4085
+ gd as g,
4065
4086
  xe as h,
4066
- J as i,
4087
+ X as i,
4067
4088
  sr as j,
4068
4089
  pn as k,
4069
4090
  Nt as l,
4070
- ld as m,
4071
- ou as n,
4072
- nl as o,
4091
+ cd as m,
4092
+ su as n,
4093
+ rl as o,
4073
4094
  Z as p,
4074
- Qc as q,
4095
+ ed as q,
4075
4096
  Pt as r,
4076
- iu as s,
4077
- Pc as t,
4097
+ au as s,
4098
+ Bc as t,
4078
4099
  B as u,
4079
4100
  or as v,
4080
4101
  Sn as w,
4081
- Io as x,
4102
+ $o as x,
4082
4103
  Zt as y
4083
4104
  };