@sendbird/ai-agent-messenger-react 1.10.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,7 @@ function ve(e) {
40
40
  Template: a,
41
41
  updateTemplate: (p) => l(() => p),
42
42
  components: c,
43
- updateComponent: (p, x) => d((y) => ({ ...y, [p]: x }))
43
+ updateComponent: (p, E) => d((y) => ({ ...y, [p]: E }))
44
44
  };
45
45
  return /* @__PURE__ */ o.createElement(t.Provider, { value: h }, i);
46
46
  }
@@ -146,7 +146,7 @@ function jo(e, t, n) {
146
146
  const r = /* @__PURE__ */ new Date(), s = new Date(((a = e.lastMessage) == null ? void 0 : a.createdAt) || e.createdAt), i = _o(r, s);
147
147
  return i < 1 ? n.justNow : i < 60 ? n.minutesAgo(i) : Co(s) ? n.hoursAgo(So(r, s)) : t(s, n.dateShortFormat);
148
148
  }
149
- const qo = "1.10.0", Be = "sb-agent", Ko = qo, sr = "KEY_IMG_ASPECT_RATIO", Zo = "*/*", P = {
149
+ const qo = "1.10.1", Be = "sb-agent", Ko = qo, sr = "KEY_IMG_ASPECT_RATIO", Zo = "*/*", P = {
150
150
  BODY_MAX_WIDTH: 244,
151
151
  WIDE_BODY_MAX_WIDTH: 640,
152
152
  AVATAR_SIZE: 26,
@@ -468,26 +468,26 @@ function cs({
468
468
  chatSDK: d,
469
469
  chatParams: h,
470
470
  children: p,
471
- logger: x,
471
+ logger: E,
472
472
  dispatcher: y,
473
- extensions: E = {
473
+ extensions: x = {
474
474
  platform: po.JS,
475
475
  deviceOSPlatform: rs() ? fn.MOBILE_WEB : fn.WEB
476
476
  }
477
477
  }) {
478
478
  const [b, f] = S(() => {
479
- const u = x ?? new ur(dr.WARN), v = y ?? new cr(u);
479
+ const u = E ?? new ur(dr.WARN), v = y ?? new cr(u);
480
480
  return {
481
481
  logger: u,
482
482
  dispatcher: v,
483
- chatSDK: d ?? _n(e, E, h),
483
+ chatSDK: d ?? _n(e, x, h),
484
484
  cache: yn({ appId: e, aiAgentId: t, storage: n })
485
485
  };
486
486
  });
487
487
  return F(() => {
488
488
  f((u) => {
489
489
  let v = u.logger, _ = u.dispatcher, I = u.chatSDK;
490
- return x && x !== u.logger && (v = x), y && y !== u.dispatcher && (_ = y), d && d !== u.chatSDK ? I = d : !d && u.chatSDK.appId !== e && (I = _n(e, E, { newInstance: !0, ...h })), {
490
+ return E && E !== u.logger && (v = E), y && y !== u.dispatcher && (_ = y), d && d !== u.chatSDK ? I = d : !d && u.chatSDK.appId !== e && (I = _n(e, x, { newInstance: !0, ...h })), {
491
491
  ...u,
492
492
  logger: v,
493
493
  dispatcher: _,
@@ -495,7 +495,7 @@ function cs({
495
495
  cache: yn({ appId: e, aiAgentId: t, storage: n })
496
496
  };
497
497
  });
498
- }, [e, t, x, y, d, n]), F(() => () => {
498
+ }, [e, t, E, y, d, n]), F(() => () => {
499
499
  b.chatSDK.disconnectWebSocket();
500
500
  }, [b.chatSDK]), is(b.chatSDK), /* @__PURE__ */ o.createElement(
501
501
  ls,
@@ -570,16 +570,16 @@ function bs(e, t, n) {
570
570
  if (t === 0)
571
571
  r = s = i = n;
572
572
  else {
573
- const a = function(h, p, x) {
574
- return x < 0 && (x += 1), x > 1 && (x -= 1), x < 0.16666666666666666 ? h + (p - h) * 6 * x : x < 0.5 ? p : x < 0.6666666666666666 ? h + (p - h) * (0.6666666666666666 - x) * 6 : h;
573
+ const a = function(h, p, E) {
574
+ return E < 0 && (E += 1), E > 1 && (E -= 1), E < 0.16666666666666666 ? h + (p - h) * 6 * E : E < 0.5 ? p : E < 0.6666666666666666 ? h + (p - h) * (0.6666666666666666 - E) * 6 : h;
575
575
  }, l = n < 0.5 ? n * (1 + t) : n + t - n * t, c = 2 * n - l;
576
576
  r = a(c, l, e + 1 / 3), s = a(c, l, e), i = a(c, l, e - 1 / 3);
577
577
  }
578
578
  return [Math.round(r * 255), Math.round(s * 255), Math.round(i * 255)];
579
579
  }
580
580
  function ot(e, t, n) {
581
- const [r, s, i] = hs(e), [a, l, c] = fs(r, s, i), d = Math.max(0, Math.min(1, c * t)), h = Math.max(0, Math.min(1, l * n)), [p, x, y] = bs(a, h, d);
582
- return ps([Math.round(p), Math.round(x), Math.round(y)]);
581
+ const [r, s, i] = hs(e), [a, l, c] = fs(r, s, i), d = Math.max(0, Math.min(1, c * t)), h = Math.max(0, Math.min(1, l * n)), [p, E, y] = bs(a, h, d);
582
+ return ps([Math.round(p), Math.round(E), Math.round(y)]);
583
583
  }
584
584
  function Es(e, t = "light") {
585
585
  return {
@@ -789,15 +789,15 @@ function As({ logger: e, palette: t, typography: n, appearance: r, children: s }
789
789
  ), c = O(
790
790
  (d, h) => {
791
791
  h && (i.current = h);
792
- const p = (r == null ? void 0 : r.theme) ?? d, x = i.current ? i.current.themes[p] : null, y = {
792
+ const p = (r == null ? void 0 : r.theme) ?? d, E = i.current ? i.current.themes[p] : null, y = {
793
793
  primary: r == null ? void 0 : r.primaryColor,
794
794
  primaryContrast: void 0,
795
795
  botMessageBackground: r == null ? void 0 : r.botMessageBackgroundColor,
796
796
  botMessageBackgroundContrast: void 0
797
797
  };
798
- !y.primary && (x != null && x.primary_color) && (y.primary = x.primary_color, y.primaryContrast = x.primary_contrast_color), !y.botMessageBackground && (x != null && x.bot_message_bg_color) && (y.botMessageBackground = x.bot_message_bg_color, y.botMessageBackgroundContrast = x.bot_message_bg_contrast_color);
799
- const E = Cn({ selectedTheme: p, palette: t, typography: n, ...y });
800
- l(E), e == null || e.info("theme.update:", p);
798
+ !y.primary && (E != null && E.primary_color) && (y.primary = E.primary_color, y.primaryContrast = E.primary_contrast_color), !y.botMessageBackground && (E != null && E.bot_message_bg_color) && (y.botMessageBackground = E.bot_message_bg_color, y.botMessageBackgroundContrast = E.bot_message_bg_contrast_color);
799
+ const x = Cn({ selectedTheme: p, palette: t, typography: n, ...y });
800
+ l(x), e == null || e.info("theme.update:", p);
801
801
  },
802
802
  [r == null ? void 0 : r.theme, r == null ? void 0 : r.primaryColor, r == null ? void 0 : r.botMessageBackgroundColor, t, n, e]
803
803
  );
@@ -977,11 +977,11 @@ function Ns({
977
977
  onPostDeauth: a,
978
978
  forceCreateChannel: l
979
979
  }) {
980
- const { aiAgentId: c, language: d, context: h, countryCode: p, logger: x, cache: y } = K(), { connect: E, disconnect: b } = Is(), { type: f, userSessionCandidate: u } = Rs(e), v = gr(), _ = O(async () => {
980
+ const { aiAgentId: c, language: d, context: h, countryCode: p, logger: E, cache: y } = K(), { connect: x, disconnect: b } = Is(), { type: f, userSessionCandidate: u } = Rs(e), v = gr(), _ = O(async () => {
981
981
  var B;
982
- x.debug("useAuthentication.authenticate: start");
982
+ E.debug("useAuthentication.authenticate: start");
983
983
  const C = u != null && u.userId ? y.messenger.getSettings(u.userId) : null;
984
- C != null && C.bot && (t(C), x.debug("useAuthentication.authenticate: cached messenger settings", C));
984
+ C != null && C.bot && (t(C), E.debug("useAuthentication.authenticate: cached messenger settings", C));
985
985
  const w = await v({
986
986
  aiAgentId: c,
987
987
  userId: u == null ? void 0 : u.userId,
@@ -991,11 +991,11 @@ function Ns({
991
991
  forceCreateChannel: l,
992
992
  knownActiveChannelUrl: (B = C == null ? void 0 : C.active_channel) == null ? void 0 : B.channel_url
993
993
  });
994
- x.debug("useAuthentication.authenticate: messenger settings response", w);
994
+ E.debug("useAuthentication.authenticate: messenger settings response", w);
995
995
  let M = null;
996
996
  if (w.auto_created_user)
997
997
  if (f === "manual")
998
- x.warn("Received auto created user info but current session is manual. Ignoring auto created user info."), M = { userId: u.userId, authToken: u.authToken };
998
+ E.warn("Received auto created user info but current session is manual. Ignoring auto created user info."), M = { userId: u.userId, authToken: u.authToken };
999
999
  else {
1000
1000
  const { user_id: te, session_token: ne, expire_at: le } = w.auto_created_user;
1001
1001
  y.messenger.setAnonUser({ userId: te, authToken: ne, expireAt: le }), M = { userId: te, authToken: ne };
@@ -1007,14 +1007,14 @@ function Ns({
1007
1007
  };
1008
1008
  y.messenger.setSettings(M.userId, w), t(w);
1009
1009
  try {
1010
- await n(w, M), await E(M, u == null ? void 0 : u.sessionHandler, i), await r(w, M);
1010
+ await n(w, M), await x(M, u == null ? void 0 : u.sessionHandler, i), await r(w, M);
1011
1011
  } catch (te) {
1012
- throw te instanceof Error && (s(te), x.error("useAuthentication.authenticate: failed to connect", te)), te;
1012
+ throw te instanceof Error && (s(te), E.error("useAuthentication.authenticate: failed to connect", te)), te;
1013
1013
  }
1014
1014
  return w;
1015
1015
  }, [
1016
1016
  v,
1017
- E,
1017
+ x,
1018
1018
  f,
1019
1019
  u == null ? void 0 : u.userId,
1020
1020
  u == null ? void 0 : u.sessionHandler,
@@ -1033,8 +1033,8 @@ function Ns({
1033
1033
  s,
1034
1034
  i
1035
1035
  ]), I = O(async () => {
1036
- x.debug("useAuthentication.deauthenticate: start"), await b(), a(), x.debug("useAuthentication.deauthenticate: completed");
1037
- }, [b, x, a]);
1036
+ E.debug("useAuthentication.deauthenticate: start"), await b(), a(), E.debug("useAuthentication.deauthenticate: completed");
1037
+ }, [b, E, a]);
1038
1038
  return {
1039
1039
  authenticate: _,
1040
1040
  deauthenticate: I,
@@ -1117,7 +1117,7 @@ const Us = () => {
1117
1117
  useContext: vt
1118
1118
  } = J("AIAgentMessengerSession"), Vs = Ge(
1119
1119
  function({ userSessionInfo: e, forceCreateChannel: t, children: n }, r) {
1120
- const { appId: s, aiAgentId: i, chatSDK: a, language: l, countryCode: c, context: d, cache: h, logger: p } = K(), { updateTheme: x } = Kt(), [y, E] = S(void 0), [b, f] = S(
1120
+ const { appId: s, aiAgentId: i, chatSDK: a, language: l, countryCode: c, context: d, cache: h, logger: p } = K(), { updateTheme: E } = Kt(), [y, x] = S(void 0), [b, f] = S(
1121
1121
  void 0
1122
1122
  ), [u, v] = S(null), [_, I] = S(null), [C, w] = S(null), [M, B] = S(null), { updateBaseAttachmentRules: te, createAttachmentRules: ne } = ks(), { shouldSyncCachedTemplate: le, syncCachedTemplates: _e } = Us(), Ce = gr(), { authenticate: $e, deauthenticate: q } = Ns({
1123
1123
  userSessionInfo: e,
@@ -1125,7 +1125,7 @@ const Us = () => {
1125
1125
  onUpdateMessengerSettings: O(
1126
1126
  (U) => {
1127
1127
  const { appearance: T, bot: D, launcher: G } = U;
1128
- x(T.selected_theme, T), w({
1128
+ E(T.selected_theme, T), w({
1129
1129
  userId: D.bot_userid,
1130
1130
  profileUrl: D.bot_profile_url,
1131
1131
  nickname: D.bot_nickname,
@@ -1141,10 +1141,10 @@ const Us = () => {
1141
1141
  imageUrl: G.image_url
1142
1142
  }), te(U);
1143
1143
  },
1144
- [x]
1144
+ [E]
1145
1145
  ),
1146
1146
  onPreAuth: O((U, T) => {
1147
- E(void 0), I(T);
1147
+ x(void 0), I(T);
1148
1148
  }, []),
1149
1149
  onPostAuth: O(
1150
1150
  async (U) => {
@@ -1153,7 +1153,7 @@ const Us = () => {
1153
1153
  [a, le, _e]
1154
1154
  ),
1155
1155
  onErrorAuth: O((U) => {
1156
- E(U);
1156
+ x(U);
1157
1157
  }, []),
1158
1158
  onAuthTokenRefreshed: O((U) => {
1159
1159
  I((T) => T ? { ...T, authToken: U } : null);
@@ -1334,10 +1334,10 @@ const Us = () => {
1334
1334
  return F(() => {
1335
1335
  const c = () => {
1336
1336
  a.current && (clearTimeout(a.current), a.current = null), i(!1);
1337
- }, d = (x) => {
1337
+ }, d = (E) => {
1338
1338
  a.current && clearTimeout(a.current), i(!0), a.current = setTimeout(() => {
1339
1339
  i(!1), a.current = null;
1340
- }, x);
1340
+ }, E);
1341
1341
  }, h = Date.now() - l, p = Ks - h;
1342
1342
  return n || p <= 0 ? c() : d(p), () => {
1343
1343
  a.current && clearTimeout(a.current);
@@ -1359,34 +1359,34 @@ function Xs({
1359
1359
  sortComparator: d
1360
1360
  }) {
1361
1361
  var I;
1362
- const h = () => c && (E == null ? void 0 : E.markAsRead()), { chatSDK: p, logger: x, dispatcher: y } = K(), { channel: E, channelFetchError: b, fetchChannel: f } = Js(t), u = ds(p, E, {
1362
+ const h = () => c && (x == null ? void 0 : x.markAsRead()), { chatSDK: p, logger: E, dispatcher: y } = K(), { channel: x, channelFetchError: b, fetchChannel: f } = Js(t), u = ds(p, x, {
1363
1363
  shouldCountNewMessages: () => !1,
1364
1364
  onChannelDeleted: n,
1365
1365
  onMessagesReceived: (C) => r == null ? void 0 : r(C),
1366
1366
  onMessagesUpdated: (C) => s == null ? void 0 : s(C),
1367
- logger: x,
1367
+ logger: E,
1368
1368
  markAsRead: h,
1369
1369
  sortComparator: d
1370
- }), v = Ws({ channel: E, messages: u.messages });
1370
+ }), v = Ws({ channel: x, messages: u.messages });
1371
1371
  F(() => {
1372
1372
  h();
1373
1373
  }, [c]), F(() => {
1374
1374
  const C = async (w) => {
1375
1375
  const M = typeof (w == null ? void 0 : w.channelUrl) == "string";
1376
- E && M && w.channelUrl !== E.url || (x.debug("conversation.dispatcher: try to close conversation", E), E != null && E.conversation && E.conversation.status === X.OPEN && (await E.closeConversation(), i == null || i()));
1376
+ x && M && w.channelUrl !== x.url || (E.debug("conversation.dispatcher: try to close conversation", x), x != null && x.conversation && x.conversation.status === X.OPEN && (await x.closeConversation(), i == null || i()));
1377
1377
  };
1378
1378
  return y.subscribe(Dt.ConversationClose, C), () => {
1379
1379
  y.unsubscribe(Dt.ConversationClose, C);
1380
1380
  };
1381
- }, [y, (I = E == null ? void 0 : E.conversation) == null ? void 0 : I.status, i]);
1381
+ }, [y, (I = x == null ? void 0 : x.conversation) == null ? void 0 : I.status, i]);
1382
1382
  const _ = {
1383
- conversation: (E == null ? void 0 : E.conversation) ?? void 0,
1383
+ conversation: (x == null ? void 0 : x.conversation) ?? void 0,
1384
1384
  channelSource: {
1385
- channel: E,
1385
+ channel: x,
1386
1386
  error: b,
1387
1387
  refetch: () => f(),
1388
1388
  closeConversation: async () => {
1389
- we(E) || await (E == null ? void 0 : E.closeConversation());
1389
+ we(x) || await (x == null ? void 0 : x.closeConversation());
1390
1390
  }
1391
1391
  },
1392
1392
  messageSource: {
@@ -1398,7 +1398,7 @@ function Xs({
1398
1398
  resendMessage: (C) => u.resendMessage(C),
1399
1399
  sendUserMessage: async (C) => {
1400
1400
  var M;
1401
- if (((M = E == null ? void 0 : E.conversation) == null ? void 0 : M.status) === X.CLOSED)
1401
+ if (((M = x == null ? void 0 : x.conversation) == null ? void 0 : M.status) === X.CLOSED)
1402
1402
  throw new Error("Conversation is closed");
1403
1403
  a && (C = await a(C));
1404
1404
  const w = await u.sendUserMessage(C, l);
@@ -1406,7 +1406,7 @@ function Xs({
1406
1406
  },
1407
1407
  sendFileMessage: async (C) => {
1408
1408
  var M;
1409
- if (((M = E == null ? void 0 : E.conversation) == null ? void 0 : M.status) === X.CLOSED)
1409
+ if (((M = x == null ? void 0 : x.conversation) == null ? void 0 : M.status) === X.CLOSED)
1410
1410
  throw new Error("Conversation is closed");
1411
1411
  a && (C = await a(C));
1412
1412
  const w = await u.sendFileMessage(C, l);
@@ -1559,7 +1559,7 @@ class ei {
1559
1559
  if (d === void 0) continue;
1560
1560
  const h = Nt(this._pinnedChannels, c);
1561
1561
  h >= 0 ? (this._pinnedChannels.splice(h, 1), i.push(c)) : s.push(c);
1562
- const x = this._pinnedChannels.findIndex((E) => (r.get(E.url) ?? 1 / 0) > d), y = x === -1 ? this._pinnedChannels.length : x;
1562
+ const E = this._pinnedChannels.findIndex((x) => (r.get(x.url) ?? 1 / 0) > d), y = E === -1 ? this._pinnedChannels.length : E;
1563
1563
  this._pinnedChannels.splice(y, 0, c);
1564
1564
  }
1565
1565
  return { addedChannels: s, updatedChannels: i, unmatchedChannelUrls: a };
@@ -1590,12 +1590,12 @@ class ei {
1590
1590
  * @param forceAppend - Whether to force append channels at the end
1591
1591
  */
1592
1592
  _addChannelsToView(t, n = !1) {
1593
- var p, x, y, E, b;
1593
+ var p, E, y, x, b;
1594
1594
  const r = new Set(((p = this.filter) == null ? void 0 : p.pinnedChannelUrls) ?? []), s = [], i = [];
1595
1595
  for (const f of t)
1596
1596
  r.has(f.url) ? s.push(f) : i.push(f);
1597
1597
  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);
1598
- c.length > 0 && ((y = (x = this._collectionEventHandler) == null ? void 0 : x.onChannelsAdded) == null || y.call(x, {}, c)), d.length > 0 && ((b = (E = this._collectionEventHandler) == null ? void 0 : E.onChannelsUpdated) == null || b.call(E, {}, d)), h.length > 0 && this._removeChannelsFromView(h);
1598
+ c.length > 0 && ((y = (E = this._collectionEventHandler) == null ? void 0 : E.onChannelsAdded) == null || y.call(E, {}, c)), d.length > 0 && ((b = (x = this._collectionEventHandler) == null ? void 0 : x.onChannelsUpdated) == null || b.call(x, {}, d)), h.length > 0 && this._removeChannelsFromView(h);
1599
1599
  }
1600
1600
  /**
1601
1601
  * Removes channels from the collection by their URLs.
@@ -1684,8 +1684,8 @@ const Nt = (e, t) => e.findIndex((n) => n.isIdentical(t)), ti = (e, t, n) => {
1684
1684
  }
1685
1685
  };
1686
1686
  function ni(e, t) {
1687
- var E, b, f, u, v, _, I, C, w, M;
1688
- const n = Wt(), [r, s] = S(!1), [i, a] = S(null), [l, c] = S([]), [d, h] = S(null), p = H(!1), x = O(async () => {
1687
+ var x, b, f, u, v, _, I, C, w, M;
1688
+ const n = Wt(), [r, s] = S(!1), [i, a] = S(null), [l, c] = S([]), [d, h] = S(null), p = H(!1), E = O(async () => {
1689
1689
  if (!p.current && e.currentUser) {
1690
1690
  p.current = !0, s(!1), a(null), c([]);
1691
1691
  try {
@@ -1711,7 +1711,7 @@ function ni(e, t) {
1711
1711
  }, [
1712
1712
  e,
1713
1713
  e.currentUser,
1714
- (E = t.filter) == null ? void 0 : E.aiAgentChannelFilter,
1714
+ (x = t.filter) == null ? void 0 : x.aiAgentChannelFilter,
1715
1715
  (f = (b = t.filter) == null ? void 0 : b.aiAgentConversationStatusFilter) == null ? void 0 : f.join(),
1716
1716
  (v = (u = t.filter) == null ? void 0 : u.aiAgentIds) == null ? void 0 : v.join(),
1717
1717
  (_ = t.filter) == null ? void 0 : _.deskChannelFilter,
@@ -1727,9 +1727,9 @@ function ni(e, t) {
1727
1727
  a(B);
1728
1728
  }
1729
1729
  }, [d]);
1730
- return F(() => (e.addConnectionHandler(n, new ft({ onConnected: () => x() })), () => e.removeConnectionHandler(n)), [e, n, x]), F(() => {
1731
- x();
1732
- }, [x]), F(() => () => {
1730
+ return F(() => (e.addConnectionHandler(n, new ft({ onConnected: () => E() })), () => e.removeConnectionHandler(n)), [e, n, E]), F(() => {
1731
+ E();
1732
+ }, [E]), F(() => () => {
1733
1733
  p.current = !1, d == null || d.dispose();
1734
1734
  }, [d]), {
1735
1735
  initialized: r,
@@ -1746,13 +1746,13 @@ function oi({
1746
1746
  conversationListFilter: t,
1747
1747
  children: n
1748
1748
  }) {
1749
- var p, x;
1749
+ var p, E;
1750
1750
  const { chatSDK: r, aiAgentId: s, queryParams: i } = K(), a = {
1751
1751
  aiAgentIds: [s],
1752
1752
  aiAgentConversationStatusFilter: [X.CLOSED, X.OPEN]
1753
1753
  }, l = e ?? ((p = i == null ? void 0 : i.conversationListParams) == null ? void 0 : p.limit), c = {
1754
1754
  ...a,
1755
- ...(x = i == null ? void 0 : i.conversationListParams) == null ? void 0 : x.filter,
1755
+ ...(E = i == null ? void 0 : i.conversationListParams) == null ? void 0 : E.filter,
1756
1756
  ...t
1757
1757
  }, d = ni(r, { limit: l, filter: c }), h = {
1758
1758
  listSource: {
@@ -1793,17 +1793,17 @@ function ai({ children: e, internalVariables: t }) {
1793
1793
  onRequestTemplate: d,
1794
1794
  onGetCachedTemplate: h,
1795
1795
  templateKey: p,
1796
- suspense: x = !1
1796
+ suspense: E = !1
1797
1797
  }) => {
1798
1798
  const y = h(p);
1799
1799
  if (y) return y;
1800
- const E = r.current[p];
1801
- if (E) return E;
1802
- x || a(p, { fetching: !0 });
1800
+ const x = r.current[p];
1801
+ if (x) return x;
1802
+ E || a(p, { fetching: !0 });
1803
1803
  const b = d(p).catch((f) => {
1804
- throw x || a(p, { error: !0 }), f;
1804
+ throw E || a(p, { error: !0 }), f;
1805
1805
  }).finally(() => {
1806
- x || a(p, { fetching: !1 }), delete r.current[p];
1806
+ E || a(p, { fetching: !1 }), delete r.current[p];
1807
1807
  });
1808
1808
  return r.current[p] = b, b;
1809
1809
  },
@@ -1866,9 +1866,9 @@ function li({
1866
1866
  variables: n,
1867
1867
  variableKeyPattern: (d) => yt.VIEW_VARIABLE(d),
1868
1868
  variableValueTransformer: (d) => {
1869
- const h = d.map(({ key: p, variables: x }) => {
1870
- const y = i(p), { ui_template: E, color_variables: b } = Xe(y);
1871
- let f = JSON.stringify(E);
1869
+ const h = d.map(({ key: p, variables: E }) => {
1870
+ const y = i(p), { ui_template: x, color_variables: b } = Xe(y);
1871
+ let f = JSON.stringify(x);
1872
1872
  return f = ke({
1873
1873
  uiTemplateString: f,
1874
1874
  variables: s
@@ -1882,7 +1882,7 @@ function li({
1882
1882
  colorVariables: r
1883
1883
  }), f = ke({
1884
1884
  uiTemplateString: f,
1885
- variables: x
1885
+ variables: E
1886
1886
  }), xt(f);
1887
1887
  });
1888
1888
  return JSON.stringify(h);
@@ -1903,23 +1903,23 @@ async function ci({
1903
1903
  variableKeyPattern: (a) => yt.VIEW_VARIABLE(a),
1904
1904
  variableValueTransformer: async (a) => {
1905
1905
  const l = a.map(async ({ key: d, variables: h }) => {
1906
- const p = await i(d), { ui_template: x, color_variables: y } = Xe(p);
1907
- let E = JSON.stringify(x);
1908
- return E = ke({
1909
- uiTemplateString: E,
1906
+ const p = await i(d), { ui_template: E, color_variables: y } = Xe(p);
1907
+ let x = JSON.stringify(E);
1908
+ return x = ke({
1909
+ uiTemplateString: x,
1910
1910
  variables: s
1911
- }), E = Ie({
1911
+ }), x = Ie({
1912
1912
  theme: e,
1913
- uiTemplateString: E,
1913
+ uiTemplateString: x,
1914
1914
  colorVariables: y
1915
- }), E = Ie({
1915
+ }), x = Ie({
1916
1916
  theme: e,
1917
- uiTemplateString: E,
1917
+ uiTemplateString: x,
1918
1918
  colorVariables: r
1919
- }), E = ke({
1920
- uiTemplateString: E,
1919
+ }), x = ke({
1920
+ uiTemplateString: x,
1921
1921
  variables: h
1922
- }), xt(E);
1922
+ }), xt(x);
1923
1923
  }), c = await Promise.all(l);
1924
1924
  return JSON.stringify(c);
1925
1925
  }
@@ -2238,10 +2238,10 @@ const Si = /* @__PURE__ */ new Set(["free_text", "single_choice"]), Ti = ({ csat
2238
2238
  var b;
2239
2239
  const y = i.csat;
2240
2240
  if (typeof y != "number") return;
2241
- const E = (b = e.follow_up) == null ? void 0 : b.find(
2241
+ const x = (b = e.follow_up) == null ? void 0 : b.find(
2242
2242
  (f) => f.scores.includes(y)
2243
2243
  );
2244
- if (Si.has(E == null ? void 0 : E.response_type)) return E;
2244
+ if (Si.has(x == null ? void 0 : x.response_type)) return x;
2245
2245
  }, [i.csat, e.follow_up]), h = (() => {
2246
2246
  var y;
2247
2247
  if (typeof n == "number")
@@ -2249,8 +2249,8 @@ const Si = /* @__PURE__ */ new Set(["free_text", "single_choice"]), Ti = ({ csat
2249
2249
  if ((t === he.AI_AGENT_CSAT_5 || t === he.HELPDESK_CSAT_5) && typeof i.csat == "number")
2250
2250
  return "submittable";
2251
2251
  if (t === he.AI_AGENT_CSAT_5_WITH_CRE) {
2252
- const E = typeof i.csat == "number", b = !((y = e.cre) != null && y.required) || typeof i.isResolved == "boolean";
2253
- if (E && b) return "submittable";
2252
+ const x = typeof i.csat == "number", b = !((y = e.cre) != null && y.required) || typeof i.isResolved == "boolean";
2253
+ if (x && b) return "submittable";
2254
2254
  }
2255
2255
  return "unsubmittable";
2256
2256
  })(), p = O(() => typeof i.csat > "u" ? !1 : d != null && d.required && !i.csatReason ? (c({ followUpItem: !0 }), !1) : !0, [i, d, c]);
@@ -2283,8 +2283,8 @@ const Si = /* @__PURE__ */ new Set(["free_text", "single_choice"]), Ti = ({ csat
2283
2283
  return;
2284
2284
  const d = (h) => {
2285
2285
  i.current === 0 && (i.current = h, a.current = h);
2286
- const p = h - i.current, x = h - a.current, { speed: y, chunkSize: E } = Ai(x), b = y * E;
2287
- p >= b && (r((f) => Math.min(f + E, e.length)), i.current = h), s.current = requestAnimationFrame(d);
2286
+ const p = h - i.current, E = h - a.current, { speed: y, chunkSize: x } = Ai(E), b = y * x;
2287
+ p >= b && (r((f) => Math.min(f + x, e.length)), i.current = h), s.current = requestAnimationFrame(d);
2288
2288
  };
2289
2289
  return s.current = requestAnimationFrame(d), () => {
2290
2290
  s.current && cancelAnimationFrame(s.current);
@@ -2496,7 +2496,7 @@ async function Ni(e) {
2496
2496
  if (t) return t;
2497
2497
  try {
2498
2498
  if (Oi.has(e)) {
2499
- const { default: n } = await Li(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./ClcACcky.js"), "./languages/en.ts": () => Promise.resolve().then(() => Ri), "./languages/es.ts": () => import("./CQNYwMPf.js"), "./languages/fr.ts": () => import("./BE3kaJsn.js"), "./languages/hi.ts": () => import("./P9jkDnGQ.js"), "./languages/it.ts": () => import("./BWGTA9Vo.js"), "./languages/ja.ts": () => import("./CVL0bi-q.js"), "./languages/ko.ts": () => import("./DgyCf-ms.js"), "./languages/pt.ts": () => import("./D2yx2nDf.js"), "./languages/tr.ts": () => import("./BjyxgC_T.js") }), `./languages/${e}.ts`, 3);
2499
+ const { default: n } = await Li(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./EVDICC4l.js"), "./languages/en.ts": () => Promise.resolve().then(() => Ri), "./languages/es.ts": () => import("./DSU-pnsD.js"), "./languages/fr.ts": () => import("./BoN56E9Z.js"), "./languages/hi.ts": () => import("./CLrwPiXs.js"), "./languages/it.ts": () => import("./DHkIHpWw.js"), "./languages/ja.ts": () => import("./DBhp3fXl.js"), "./languages/ko.ts": () => import("./Brug4qqu.js"), "./languages/pt.ts": () => import("./smGeKrd1.js"), "./languages/tr.ts": () => import("./-31n4Imz.js") }), `./languages/${e}.ts`, 3);
2500
2500
  return Ft.set(e, n), n;
2501
2501
  }
2502
2502
  return mt;
@@ -2873,7 +2873,7 @@ const ba = g.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
2873
2873
  `, xa = g.img`width:100%;height:100%;object-fit:cover;`, va = g.video`width:100%;height:100%;object-fit:cover;`, ya = "✱", _r = (e) => {
2874
2874
  const t = new RegExp(`(\`+)([^\`]+?)\\1|(${ya}+)`, "g");
2875
2875
  return e.replace(t, (n, r, s, i) => r ? n : i ? `<span id=${pa} aria-label="masked-text">${i}</span>` : n);
2876
- }, _a = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ca = L(async () => ({ default: (await import("./BiR7LQjJ.js")).MarkdownText })), Sa = L(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2876
+ }, _a = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ca = L(async () => ({ default: (await import("./COct2xck.js")).MarkdownText })), Sa = L(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2877
2877
  function On(e) {
2878
2878
  var s, i;
2879
2879
  const t = e.maxBodyWidth ?? P.BODY_MAX_WIDTH, n = re(() => Jo(e.message, _r), [e.message]), r = {
@@ -2982,34 +2982,34 @@ const Ua = g.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;pa
2982
2982
  Ee(() => {
2983
2983
  e ? (d(r), p(s)) : (d(void 0), p(""));
2984
2984
  }, [e, r, s]);
2985
- const x = () => {
2985
+ const E = () => {
2986
2986
  c && (i({ rating: c, comment: h.trim() || void 0 }), t());
2987
2987
  }, y = () => {
2988
2988
  t();
2989
2989
  };
2990
- return e ? /* @__PURE__ */ o.createElement(Ct, { rootElementId: ie.WINDOW, visible: e, onClose: y }, /* @__PURE__ */ o.createElement(Qa, null, /* @__PURE__ */ o.createElement(el, null, /* @__PURE__ */ o.createElement(k, { variant: "h2", color: m.themedColor.textHighEmphasis }, l.FEEDBACK_TITLE)), /* @__PURE__ */ o.createElement(tl, null, /* @__PURE__ */ o.createElement(nl, null, ["good", "bad"].map((E) => {
2991
- const b = c === E, f = E === "good" ? l.FEEDBACK_GOOD : l.FEEDBACK_BAD;
2990
+ return e ? /* @__PURE__ */ o.createElement(Ct, { rootElementId: ie.WINDOW, visible: e, onClose: y }, /* @__PURE__ */ o.createElement(Qa, null, /* @__PURE__ */ o.createElement(el, null, /* @__PURE__ */ o.createElement(k, { variant: "h2", color: m.themedColor.textHighEmphasis }, l.FEEDBACK_TITLE)), /* @__PURE__ */ o.createElement(tl, null, /* @__PURE__ */ o.createElement(nl, null, ["good", "bad"].map((x) => {
2991
+ const b = c === x, f = x === "good" ? l.FEEDBACK_GOOD : l.FEEDBACK_BAD;
2992
2992
  return /* @__PURE__ */ o.createElement(
2993
2993
  rl,
2994
2994
  {
2995
- key: E,
2995
+ key: x,
2996
2996
  $selected: b,
2997
- $rating: E,
2998
- onClick: () => d(E)
2997
+ $rating: x,
2998
+ onClick: () => d(x)
2999
2999
  },
3000
3000
  /* @__PURE__ */ o.createElement(
3001
3001
  N,
3002
3002
  {
3003
- type: b ? Pt(E) : E,
3003
+ type: b ? Pt(x) : x,
3004
3004
  size: 24,
3005
- color: b ? Rn[E] : m.themedColor.textLowEmphasis
3005
+ color: b ? Rn[x] : m.themedColor.textLowEmphasis
3006
3006
  }
3007
3007
  ),
3008
3008
  /* @__PURE__ */ o.createElement(
3009
3009
  k,
3010
3010
  {
3011
3011
  variant: "caption1",
3012
- color: b ? Rn[E] : m.themedColor.textLowEmphasis
3012
+ color: b ? Rn[x] : m.themedColor.textLowEmphasis
3013
3013
  },
3014
3014
  f
3015
3015
  )
@@ -3019,10 +3019,10 @@ const Ua = g.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;pa
3019
3019
  {
3020
3020
  placeholder: l.FEEDBACK_COMMENT_PLACEHOLDER,
3021
3021
  value: h,
3022
- onChange: (E) => p(E.target.value),
3022
+ onChange: (x) => p(x.target.value),
3023
3023
  maxLength: 100
3024
3024
  }
3025
- ))), /* @__PURE__ */ o.createElement(il, null, /* @__PURE__ */ o.createElement(al, { onClick: y }, /* @__PURE__ */ o.createElement(k, { variant: "button", color: m.themedColor.textHighEmphasis }, l.FEEDBACK_CANCEL)), /* @__PURE__ */ o.createElement(ll, { onClick: x, disabled: !c }, /* @__PURE__ */ o.createElement(k, { variant: "button" }, n ? l.FEEDBACK_SAVE : l.FEEDBACK_SUBMIT))))) : null;
3025
+ ))), /* @__PURE__ */ o.createElement(il, null, /* @__PURE__ */ o.createElement(al, { onClick: y }, /* @__PURE__ */ o.createElement(k, { variant: "button", color: m.themedColor.textHighEmphasis }, l.FEEDBACK_CANCEL)), /* @__PURE__ */ o.createElement(ll, { onClick: E, disabled: !c }, /* @__PURE__ */ o.createElement(k, { variant: "button" }, n ? l.FEEDBACK_SAVE : l.FEEDBACK_SUBMIT))))) : null;
3026
3026
  }, Qa = g.div`width:280px;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};border-radius:12px;overflow:hidden;`, el = g.div`padding:24px;`, tl = g.div`padding-inline:24px;display:flex;flex-direction:column;gap:24px;`, nl = g.div`display:flex;gap:4px;`, rl = g.button`width:114px;height:64px;border-radius:12px;border:1px solid ${m.themedColor.textDisabled};box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;gap:0;transition:background-color 0.2s;background-color:${({ $selected: e }) => e ? m.color.background100 : "transparent"};${({ $selected: e }) => R.dark`
3027
3027
  background-color: ${e ? m.color.background600 : "transparent"};
3028
3028
  `}
@@ -3047,7 +3047,7 @@ function cl({
3047
3047
  extendedMessagePayload: i,
3048
3048
  onFeedbackUpdate: a
3049
3049
  }) {
3050
- const { stringSet: l } = z(), [c, d] = S(!1), [h, p] = S(!1), [x, y] = S(void 0), [E, b] = S(""), f = i == null ? void 0 : i.feedback, u = (f == null ? void 0 : f.rating) ?? "none";
3050
+ const { stringSet: l } = z(), [c, d] = S(!1), [h, p] = S(!1), [E, y] = S(void 0), [x, b] = S(""), f = i == null ? void 0 : i.feedback, u = (f == null ? void 0 : f.rating) ?? "none";
3051
3051
  if (u !== "none" ? !1 : !!(n || !e || !r || (i == null ? void 0 : i.bot_message_type) !== "generated" || t)) return null;
3052
3052
  const _ = (M) => {
3053
3053
  u === "none" ? (y(M), b(""), d(!0)) : p(!0);
@@ -3083,8 +3083,8 @@ function cl({
3083
3083
  visible: c,
3084
3084
  onClose: () => d(!1),
3085
3085
  isEdit: u !== "none",
3086
- initialRating: x,
3087
- initialComment: E,
3086
+ initialRating: E,
3087
+ initialComment: x,
3088
3088
  onSubmit: w,
3089
3089
  isCommentEnabled: s
3090
3090
  }
@@ -3160,7 +3160,7 @@ const Bn = g.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3160
3160
  max: l
3161
3161
  }) => {
3162
3162
  const c = (h) => {
3163
- const x = h.target.value.replace(/[^0-9.-]/g, ""), y = x.split("."), b = y.length > 1 ? y[0] + "." + y.slice(1).join("").replace(/\./g, "") : x;
3163
+ const E = h.target.value.replace(/[^0-9.-]/g, ""), y = E.split("."), b = y.length > 1 ? y[0] + "." + y.slice(1).join("").replace(/\./g, "") : E;
3164
3164
  if (h.target.value = b, b === "" || b === "-")
3165
3165
  t == null || t(null);
3166
3166
  else {
@@ -3309,8 +3309,8 @@ const Bn = g.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3309
3309
  const h = {
3310
3310
  value: e,
3311
3311
  onChange: (p) => {
3312
- const x = p.target.value;
3313
- c && x.length > c || t == null || t(x);
3312
+ const E = p.target.value;
3313
+ c && E.length > c || t == null || t(E);
3314
3314
  },
3315
3315
  placeholder: n,
3316
3316
  className: a,
@@ -3381,7 +3381,7 @@ const Bn = g.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3381
3381
  var u;
3382
3382
  return (u = e.onCancelForm) == null ? void 0 : u.call(e, { key: t.key });
3383
3383
  }
3384
- }), x = l === "submitted", y = async () => {
3384
+ }), E = l === "submitted", y = async () => {
3385
3385
  s((u) => ({ ...u, submitting: !0 }));
3386
3386
  try {
3387
3387
  await d();
@@ -3393,7 +3393,7 @@ const Bn = g.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3393
3393
  } finally {
3394
3394
  s((u) => ({ ...u, submitting: !1 }));
3395
3395
  }
3396
- }, E = async () => {
3396
+ }, x = async () => {
3397
3397
  s((u) => ({ ...u, canceling: !0 }));
3398
3398
  try {
3399
3399
  await h();
@@ -3415,9 +3415,9 @@ const Bn = g.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3415
3415
  value: u.value || "",
3416
3416
  placeholder: u.placeholder,
3417
3417
  onChange: (v) => p(u.key, v),
3418
- disabled: x,
3418
+ disabled: E,
3419
3419
  error: !!u.error,
3420
- submitted: x,
3420
+ submitted: E,
3421
3421
  variant: u.layout === "multiline" ? "multi-line" : "single-line",
3422
3422
  maxLength: u.maxLength
3423
3423
  }
@@ -3427,9 +3427,9 @@ const Bn = g.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3427
3427
  value: u.value || null,
3428
3428
  placeholder: u.placeholder,
3429
3429
  onChange: (v) => p(u.key, v),
3430
- disabled: x,
3430
+ disabled: E,
3431
3431
  error: !!u.error,
3432
- submitted: x,
3432
+ submitted: E,
3433
3433
  max: u.max
3434
3434
  }
3435
3435
  ), u.type === "single-select" && /* @__PURE__ */ o.createElement(
@@ -3438,7 +3438,7 @@ const Bn = g.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3438
3438
  options: u.options.map((v) => ({ label: v, value: v })),
3439
3439
  value: u.value || "",
3440
3440
  onChange: (v) => p(u.key, v),
3441
- submitted: x
3441
+ submitted: E
3442
3442
  }
3443
3443
  ), u.type === "multi-select" && /* @__PURE__ */ o.createElement(
3444
3444
  Z.MultiSelect,
@@ -3446,28 +3446,28 @@ const Bn = g.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3446
3446
  options: u.options.map((v) => ({ label: v, value: v })),
3447
3447
  value: u.value || [],
3448
3448
  onChange: (v) => p(u.key, v),
3449
- submitted: x,
3449
+ submitted: E,
3450
3450
  maxSelect: u.maxSelect
3451
3451
  }
3452
3452
  ), u.error && /* @__PURE__ */ o.createElement(Z.ErrorLabel, { style: { marginTop: "4px" } }, u.error)))), /* @__PURE__ */ o.createElement(Z.Separator, null), /* @__PURE__ */ o.createElement(ec, null, /* @__PURE__ */ o.createElement(
3453
3453
  Z.Button,
3454
3454
  {
3455
- variant: x ? "clear" : "primary",
3455
+ variant: E ? "clear" : "primary",
3456
3456
  onClick: y,
3457
- disabled: x || r.canceling,
3457
+ disabled: E || r.canceling,
3458
3458
  loading: r.submitting
3459
3459
  },
3460
- x ? n.SUBMITTED : n.BUTTON__SUBMIT
3460
+ E ? n.SUBMITTED : n.BUTTON__SUBMIT
3461
3461
  ), l !== "submitted" && /* @__PURE__ */ o.createElement(
3462
3462
  Z.Button,
3463
3463
  {
3464
3464
  variant: "secondary",
3465
- onClick: E,
3465
+ onClick: x,
3466
3466
  disabled: r.submitting,
3467
3467
  loading: r.canceling
3468
3468
  },
3469
3469
  n.BUTTON__CANCEL
3470
- ))), /* @__PURE__ */ o.createElement(tn, { ...i, onClose: () => a({ visible: !1, title: "" }) })) : /* @__PURE__ */ o.createElement(Un, { $maxWidth: e.maxBodyWidth ?? P.BODY_MAX_WIDTH }, /* @__PURE__ */ o.createElement(k, { variant: "body3" }, b.reason), b.cancelable && /* @__PURE__ */ o.createElement(Z.Button, { variant: "primary", onClick: E, loading: r.canceling }, n.BUTTON__CANCEL));
3470
+ ))), /* @__PURE__ */ o.createElement(tn, { ...i, onClose: () => a({ visible: !1, title: "" }) })) : /* @__PURE__ */ o.createElement(Un, { $maxWidth: e.maxBodyWidth ?? P.BODY_MAX_WIDTH }, /* @__PURE__ */ o.createElement(k, { variant: "body3" }, b.reason), b.cancelable && /* @__PURE__ */ o.createElement(Z.Button, { variant: "primary", onClick: x, loading: r.canceling }, n.BUTTON__CANCEL));
3471
3471
  }, Un = g.div`display:flex;flex-direction:column;gap:12px;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e }) => $`
3472
3472
  color: ${e.colors.messageIncoming.text};
3473
3473
  background-color: ${e.colors.messageIncoming.background};
@@ -3574,12 +3574,12 @@ function $r(e) {
3574
3574
  ...e,
3575
3575
  message: n,
3576
3576
  extendedMessagePayload: r ? {} : e.extendedMessagePayload
3577
- }, i = !!s.isTyping, a = s.testerMode, l = !!((b = s.extendedMessagePayload) != null && b.form) && !((f = s.extendedMessagePayload) != null && f.form.canceled_at), c = !!((u = s.extendedMessagePayload) != null && u.message_template), d = !!((v = s.extendedMessagePayload) != null && v.cta_button), h = !!((_ = s.extendedMessagePayload) != null && _.citations) && s.extendedMessagePayload.citations.length > 0, p = !!s.createdAt, x = s.groupType === "top" || s.groupType === "single", y = s.groupType === "bottom" || s.groupType === "single", E = a ? 0 : P.AVATAR_SIZE;
3578
- return /* @__PURE__ */ o.createElement(pc, { $marginBottom: i ? 0 : qt(s.groupType) }, x && /* @__PURE__ */ o.createElement(fc, null, !a && /* @__PURE__ */ o.createElement(t.SenderAvatar, { ...s }), /* @__PURE__ */ o.createElement(t.SenderName, { ...s })), /* @__PURE__ */ o.createElement(Ec, null, /* @__PURE__ */ o.createElement(It, { $extraStartPadding: E }, i ? /* @__PURE__ */ o.createElement(t.TypingIndicator, { ...s }) : /* @__PURE__ */ o.createElement(t.MessageBody, { ...s }, d && /* @__PURE__ */ o.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ o.createElement(t.CTAButton, { ...s })), h && /* @__PURE__ */ o.createElement(t.Citation, { ...s }))), c && /* @__PURE__ */ o.createElement(Hn, { $startPadding: 0, $endPadding: 0 }, /* @__PURE__ */ o.createElement(
3577
+ }, i = !!s.isTyping, a = s.testerMode, l = !!((b = s.extendedMessagePayload) != null && b.form) && !((f = s.extendedMessagePayload) != null && f.form.canceled_at), c = !!((u = s.extendedMessagePayload) != null && u.message_template), d = !!((v = s.extendedMessagePayload) != null && v.cta_button), h = !!((_ = s.extendedMessagePayload) != null && _.citations) && s.extendedMessagePayload.citations.length > 0, p = !!s.createdAt, E = s.groupType === "top" || s.groupType === "single", y = s.groupType === "bottom" || s.groupType === "single", x = a ? 0 : P.AVATAR_SIZE;
3578
+ return /* @__PURE__ */ o.createElement(pc, { $marginBottom: i ? 0 : qt(s.groupType) }, E && /* @__PURE__ */ o.createElement(fc, null, !a && /* @__PURE__ */ o.createElement(t.SenderAvatar, { ...s }), /* @__PURE__ */ o.createElement(t.SenderName, { ...s })), /* @__PURE__ */ o.createElement(Ec, null, /* @__PURE__ */ o.createElement(It, { $extraStartPadding: x }, i ? /* @__PURE__ */ o.createElement(t.TypingIndicator, { ...s }) : /* @__PURE__ */ o.createElement(t.MessageBody, { ...s }, d && /* @__PURE__ */ o.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ o.createElement(t.CTAButton, { ...s })), h && /* @__PURE__ */ o.createElement(t.Citation, { ...s }))), c && /* @__PURE__ */ o.createElement(Hn, { $startPadding: 0, $endPadding: 0 }, /* @__PURE__ */ o.createElement(
3579
3579
  t.MessageTemplate,
3580
3580
  {
3581
3581
  ...s,
3582
- messageTemplateErrorFallback: s.messageTemplateErrorFallback ?? /* @__PURE__ */ o.createElement(It, { $extraStartPadding: E }, /* @__PURE__ */ o.createElement(
3582
+ messageTemplateErrorFallback: s.messageTemplateErrorFallback ?? /* @__PURE__ */ o.createElement(It, { $extraStartPadding: x }, /* @__PURE__ */ o.createElement(
3583
3583
  t.MessageBody,
3584
3584
  {
3585
3585
  ...s,
@@ -3587,9 +3587,9 @@ function $r(e) {
3587
3587
  message: ((C = (I = s.extendedMessagePayload) == null ? void 0 : I.message_template) == null ? void 0 : C.fallback_message) ?? "Cannot read this template."
3588
3588
  }
3589
3589
  )),
3590
- messageTemplateLoadingFallback: s.messageTemplateLoadingFallback ?? /* @__PURE__ */ o.createElement(It, { $extraStartPadding: E }, /* @__PURE__ */ o.createElement(t.TypingIndicator, { ...s }))
3590
+ messageTemplateLoadingFallback: s.messageTemplateLoadingFallback ?? /* @__PURE__ */ o.createElement(It, { $extraStartPadding: x }, /* @__PURE__ */ o.createElement(t.TypingIndicator, { ...s }))
3591
3591
  }
3592
- )), l && /* @__PURE__ */ o.createElement(Hn, { $extraStartPadding: E }, /* @__PURE__ */ o.createElement(t.Form, { ...s }))), y && p && /* @__PURE__ */ o.createElement(bc, { $extraStartPadding: E + 8 }, /* @__PURE__ */ o.createElement(t.SentTime, { ...s })), /* @__PURE__ */ o.createElement(Qn, null, !i && /* @__PURE__ */ o.createElement(Je, { $extraStartPadding: E + 8 }, /* @__PURE__ */ o.createElement(t.Feedback, { ...s })), s.suggestedRepliesVisible && /* @__PURE__ */ o.createElement(t.SuggestedReplies, { ...s }), /* @__PURE__ */ o.createElement(t.MessageLogs, { ...s })));
3592
+ )), l && /* @__PURE__ */ o.createElement(Hn, { $extraStartPadding: x }, /* @__PURE__ */ o.createElement(t.Form, { ...s }))), y && p && /* @__PURE__ */ o.createElement(bc, { $extraStartPadding: x + 8 }, /* @__PURE__ */ o.createElement(t.SentTime, { ...s })), /* @__PURE__ */ o.createElement(Qn, null, !i && /* @__PURE__ */ o.createElement(Je, { $extraStartPadding: x + 8 }, /* @__PURE__ */ o.createElement(t.Feedback, { ...s })), s.suggestedRepliesVisible && /* @__PURE__ */ o.createElement(t.SuggestedReplies, { ...s }), /* @__PURE__ */ o.createElement(t.MessageLogs, { ...s })));
3593
3593
  }
3594
3594
  const pc = g.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
3595
3595
  `, Je = g.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = P.HORIZONTAL_PADDING, $endPadding: t = P.HORIZONTAL_PADDING, $extraStartPadding: n = 0 }) => `
@@ -3720,7 +3720,7 @@ const Bc = g.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
3720
3720
  break;
3721
3721
  }
3722
3722
  const l = a.reduce(
3723
- (p, x) => x.match.index < p.match.index ? x : p
3723
+ (p, E) => E.match.index < p.match.index ? E : p
3724
3724
  ), { match: c, type: d } = l, h = c.index;
3725
3725
  h > 0 && t.push(n.slice(0, h)), d === "link" ? t.push(
3726
3726
  /* @__PURE__ */ o.createElement("a", { key: r++, href: c[2], target: "_blank", rel: Jt }, c[1])
@@ -3967,7 +3967,7 @@ const Bc = g.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
3967
3967
  initialCsatReason: s,
3968
3968
  initialIsResolved: i
3969
3969
  }) => {
3970
- const { params: a, setParams: l, error: c, setError: d, followUpItem: h, state: p, validateParams: x, itemProps: y } = Ti({
3970
+ const { params: a, setParams: l, error: c, setError: d, followUpItem: h, state: p, validateParams: E, itemProps: y } = Ti({
3971
3971
  csatPayload: e,
3972
3972
  type: t,
3973
3973
  initialCsat: r,
@@ -3980,20 +3980,20 @@ const Bc = g.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
3980
3980
  ...y,
3981
3981
  defaultValue: i,
3982
3982
  value: a.isResolved,
3983
- onChange: (E) => l({ isResolved: E })
3983
+ onChange: (x) => l({ isResolved: x })
3984
3984
  }
3985
- ), /* @__PURE__ */ o.createElement(Xc, { ...y, value: a.csat, onChange: (E) => l({ csat: E }) }), h && /* @__PURE__ */ o.createElement(
3985
+ ), /* @__PURE__ */ o.createElement(Xc, { ...y, value: a.csat, onChange: (x) => l({ csat: x }) }), h && /* @__PURE__ */ o.createElement(
3986
3986
  Gc,
3987
3987
  {
3988
3988
  ...y,
3989
3989
  followUpItem: h,
3990
3990
  value: a.csatReason,
3991
- onChange: (E) => {
3992
- l({ csatReason: E }), d({ followUpItem: !1 });
3991
+ onChange: (x) => {
3992
+ l({ csatReason: x }), d({ followUpItem: !1 });
3993
3993
  },
3994
3994
  hasError: c.followUpItem
3995
3995
  }
3996
- )), p !== "unsubmittable" && /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Z.Separator, null), n({ state: p, params: a, validateParams: x })));
3996
+ )), p !== "unsubmittable" && /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Z.Separator, null), n({ state: p, params: a, validateParams: E })));
3997
3997
  }, sd = g.div`display:flex;flex-direction:column;gap:12px;`, id = (e) => {
3998
3998
  const { stringSet: t } = z();
3999
3999
  return Wo(e, {
@@ -4027,13 +4027,13 @@ const Bc = g.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
4027
4027
  initialCsat: r,
4028
4028
  initialCsatReason: s,
4029
4029
  initialIsResolved: a,
4030
- renderSubmitButton: ({ state: h, params: p, validateParams: x }) => /* @__PURE__ */ o.createElement(
4030
+ renderSubmitButton: ({ state: h, params: p, validateParams: E }) => /* @__PURE__ */ o.createElement(
4031
4031
  dd,
4032
4032
  {
4033
4033
  $state: h,
4034
4034
  disabled: h === "submitted",
4035
4035
  onClick: () => {
4036
- !xn(i) && x() ? n({
4036
+ !xn(i) && E() ? n({
4037
4037
  csatType: p.csatType,
4038
4038
  csat: p.csat,
4039
4039
  csatReason: p.csatReason,
@@ -4079,56 +4079,56 @@ const md = g.div`padding-inline:${P.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
4079
4079
  onClickGroundedness: l,
4080
4080
  onClickAgentMessageTemplate: c,
4081
4081
  bottomContent: d,
4082
- renderCustomGroundednessIcon: h = (x) => x.default,
4082
+ renderCustomGroundednessIcon: h = (E) => E.default,
4083
4083
  style: p = {}
4084
4084
  }) => {
4085
4085
  const {
4086
4086
  // Note: This component is used with the dashboard, so cssVars should not be used.
4087
- iconColor: x = "#000000",
4087
+ iconColor: E = "#000000",
4088
4088
  textColor: y = "#000000",
4089
- highlightColor: E = Ye.DEFAULT_PRIMARY
4089
+ highlightColor: x = Ye.DEFAULT_PRIMARY
4090
4090
  } = p;
4091
- return /* @__PURE__ */ o.createElement(Wn, null, e && /* @__PURE__ */ o.createElement(Wn, null, /* @__PURE__ */ o.createElement(pt, null, /* @__PURE__ */ o.createElement(lt, null, /* @__PURE__ */ o.createElement(N, { size: 16, type: "actionbook", color: x })), /* @__PURE__ */ o.createElement(
4091
+ return /* @__PURE__ */ o.createElement(Wn, null, e && /* @__PURE__ */ o.createElement(Wn, null, /* @__PURE__ */ o.createElement(pt, null, /* @__PURE__ */ o.createElement(lt, null, /* @__PURE__ */ o.createElement(N, { size: 16, type: "actionbook", color: E })), /* @__PURE__ */ o.createElement(
4092
4092
  at,
4093
4093
  {
4094
4094
  $clickable: !!s,
4095
- $highlightColor: E,
4095
+ $highlightColor: x,
4096
4096
  variant: "body2",
4097
4097
  color: y,
4098
4098
  onClick: () => s == null ? void 0 : s(e),
4099
4099
  maxTextLines: 1
4100
4100
  },
4101
4101
  e.name
4102
- ))), t == null ? void 0 : t.map((b) => /* @__PURE__ */ o.createElement(Mt, { key: b.key }, /* @__PURE__ */ o.createElement(lt, null, /* @__PURE__ */ o.createElement(N, { size: 16, type: "function", color: x })), /* @__PURE__ */ o.createElement(pt, null, /* @__PURE__ */ o.createElement(
4102
+ ))), t == null ? void 0 : t.map((b) => /* @__PURE__ */ o.createElement(Mt, { key: b.key }, /* @__PURE__ */ o.createElement(lt, null, /* @__PURE__ */ o.createElement(N, { size: 16, type: "function", color: E })), /* @__PURE__ */ o.createElement(pt, null, /* @__PURE__ */ o.createElement(
4103
4103
  at,
4104
4104
  {
4105
4105
  $clickable: !!i,
4106
- $highlightColor: E,
4106
+ $highlightColor: x,
4107
4107
  variant: "body2",
4108
4108
  color: y,
4109
4109
  onClick: () => i == null ? void 0 : i(b),
4110
4110
  maxTextLines: 1
4111
4111
  },
4112
4112
  b.name
4113
- ), a && /* @__PURE__ */ o.createElement(pd, { role: "button", onClick: () => a == null ? void 0 : a(b) }, /* @__PURE__ */ o.createElement(k, { variant: "body2", color: E }, "View details"), /* @__PURE__ */ o.createElement(N, { type: "chevron-right", size: 16, color: E }))))), n == null ? void 0 : n.map((b) => /* @__PURE__ */ o.createElement(Mt, { key: b.id }, /* @__PURE__ */ o.createElement(lt, null, h({
4114
- default: /* @__PURE__ */ o.createElement(N, { size: 16, type: zn[b.source_type] ?? zn.snippet, color: x }),
4113
+ ), a && /* @__PURE__ */ o.createElement(pd, { role: "button", onClick: () => a == null ? void 0 : a(b) }, /* @__PURE__ */ o.createElement(k, { variant: "body2", color: x }, "View details"), /* @__PURE__ */ o.createElement(N, { type: "chevron-right", size: 16, color: x }))))), n == null ? void 0 : n.map((b) => /* @__PURE__ */ o.createElement(Mt, { key: b.id }, /* @__PURE__ */ o.createElement(lt, null, h({
4114
+ default: /* @__PURE__ */ o.createElement(N, { size: 16, type: zn[b.source_type] ?? zn.snippet, color: E }),
4115
4115
  sourceType: b.source_type
4116
4116
  })), /* @__PURE__ */ o.createElement(
4117
4117
  at,
4118
4118
  {
4119
4119
  $clickable: !!l,
4120
- $highlightColor: E,
4120
+ $highlightColor: x,
4121
4121
  variant: "body2",
4122
4122
  color: y,
4123
4123
  onClick: () => l == null ? void 0 : l(b),
4124
4124
  maxTextLines: 1
4125
4125
  },
4126
4126
  b.preview_title
4127
- ))), r == null ? void 0 : r.map((b) => /* @__PURE__ */ o.createElement(Mt, { key: b.key }, /* @__PURE__ */ o.createElement(lt, null, /* @__PURE__ */ o.createElement(N, { size: 16, type: "template", color: x })), /* @__PURE__ */ o.createElement(
4127
+ ))), r == null ? void 0 : r.map((b) => /* @__PURE__ */ o.createElement(Mt, { key: b.key }, /* @__PURE__ */ o.createElement(lt, null, /* @__PURE__ */ o.createElement(N, { size: 16, type: "template", color: E })), /* @__PURE__ */ o.createElement(
4128
4128
  at,
4129
4129
  {
4130
4130
  $clickable: !!c,
4131
- $highlightColor: E,
4131
+ $highlightColor: x,
4132
4132
  variant: "body2",
4133
4133
  color: y,
4134
4134
  onClick: () => c == null ? void 0 : c(b),
@@ -4202,7 +4202,7 @@ const Le = () => {
4202
4202
  } = J("MessengerSession"), Rd = Ge(function({ children: e, ...t }, n) {
4203
4203
  return /* @__PURE__ */ o.createElement(Vs, { ref: n, ...t }, (r) => /* @__PURE__ */ o.createElement(Nd, { ...r }, e));
4204
4204
  }), Nd = ({ children: e, ...t }) => {
4205
- const { chatSDK: n, logger: r, appId: s, aiAgentId: i, agentPreviewConfigs: a, state: l, handlers: c } = j(), { userSessionInfo: d, authenticate: h, setActiveChannel: p, userSession: x, aiAgentInfo: y, launcherInfo: E } = t, b = H(null);
4205
+ const { chatSDK: n, logger: r, appId: s, aiAgentId: i, agentPreviewConfigs: a, state: l, handlers: c } = j(), { userSessionInfo: d, authenticate: h, setActiveChannel: p, userSession: E, aiAgentInfo: y, launcherInfo: x } = t, b = H(null);
4206
4206
  return Et(n, {
4207
4207
  async onUserJoined(f, u) {
4208
4208
  var _, I, C;
@@ -4219,14 +4219,14 @@ const Le = () => {
4219
4219
  var u;
4220
4220
  r.error("messengerSession: failed to initialize", f), (u = c == null ? void 0 : c.onInitializeFailed) == null || u.call(c, f);
4221
4221
  });
4222
- }, [n, s, i, d == null ? void 0 : d.userId]), !x || !y || !E ? null : /* @__PURE__ */ o.createElement(
4222
+ }, [n, s, i, d == null ? void 0 : d.userId]), !E || !y || !x ? null : /* @__PURE__ */ o.createElement(
4223
4223
  Dd,
4224
4224
  {
4225
4225
  value: {
4226
4226
  ...t,
4227
- userSession: x,
4227
+ userSession: E,
4228
4228
  aiAgentInfo: { ...y, ...a == null ? void 0 : a.bot },
4229
- launcherInfo: { ...E, ...a == null ? void 0 : a.launcher },
4229
+ launcherInfo: { ...x, ...a == null ? void 0 : a.launcher },
4230
4230
  registerOnJoinedProactiveConversation: (f) => b.current = f
4231
4231
  }
4232
4232
  },
@@ -4313,12 +4313,12 @@ const Hd = ({ onScrollAfterSendMessage: e }) => {
4313
4313
  shouldUpdate: !1
4314
4314
  };
4315
4315
  function Gd({ scrollMode: e, children: t }) {
4316
- const n = H(null), r = H(null), s = H(Gn), i = H(!1), a = H(null), [l, c] = S(0), [d, h] = S(0), [p, x] = S(!1), [y, E] = S(!1), [b, f] = S(!1), u = re(
4316
+ const n = H(null), r = H(null), s = H(Gn), i = H(!1), a = H(null), [l, c] = S(0), [d, h] = S(0), [p, E] = S(!1), [y, x] = S(!1), [b, f] = S(!1), u = re(
4317
4317
  () => p ? "auto" : e,
4318
4318
  [p, e]
4319
4319
  ), v = O((T) => {
4320
4320
  a.current && clearTimeout(a.current), a.current = setTimeout(() => {
4321
- E(!1);
4321
+ x(!1);
4322
4322
  }, T);
4323
4323
  }, []), _ = () => {
4324
4324
  s.current.contentSnapshotHeight = s.current.contentHeight, s.current.shouldUpdate = !0, s.current.shouldRecalc = !0;
@@ -4392,7 +4392,7 @@ function Gd({ scrollMode: e, children: t }) {
4392
4392
  const { scrollHeight: D, scrollTop: G, clientHeight: de } = T.currentTarget, ue = Math.max(0, D - G - de);
4393
4393
  h(ue);
4394
4394
  }, _e = O(() => {
4395
- u === "fixed" && (E(!0), _());
4395
+ u === "fixed" && (x(!0), _());
4396
4396
  }, [u]), Ce = O(() => {
4397
4397
  u === "fixed" ? setTimeout(() => ne(), 300) : B();
4398
4398
  }, [u, ne]), $e = O(
@@ -4401,7 +4401,7 @@ function Gd({ scrollMode: e, children: t }) {
4401
4401
  },
4402
4402
  [u]
4403
4403
  ), q = O((T) => {
4404
- x(T);
4404
+ E(T);
4405
4405
  }, []), A = O(
4406
4406
  (T) => {
4407
4407
  f(T), u === "auto" && T && B(!0);
@@ -4453,13 +4453,13 @@ const {
4453
4453
  children: s
4454
4454
  }) => {
4455
4455
  var v;
4456
- const { config: i } = K(), { activeChannel: a, refreshActiveChannel: l, aiAgentInfo: c } = Q(), { testerType: d } = Le(), h = Wd(), p = ((v = i == null ? void 0 : i.conversation) == null ? void 0 : v.scrollMode) ?? "auto", { onBeforeSendMessage: x, onAfterSendMessage: y } = Hd({
4456
+ const { config: i } = K(), { activeChannel: a, refreshActiveChannel: l, aiAgentInfo: c } = Q(), { testerType: d } = Le(), h = Wd(), p = ((v = i == null ? void 0 : i.conversation) == null ? void 0 : v.scrollMode) ?? "auto", { onBeforeSendMessage: E, onAfterSendMessage: y } = Hd({
4457
4457
  onScrollAfterSendMessage: () => {
4458
4458
  h.actions.onAfterMessageSend();
4459
4459
  }
4460
- }), E = e || (a == null ? void 0 : a.url), b = O(
4461
- (_) => (h.actions.onBeforeMessageSend(), x(_)),
4462
- [h.actions, x]
4460
+ }), x = e || (a == null ? void 0 : a.url), b = O(
4461
+ (_) => (h.actions.onBeforeMessageSend(), E(_)),
4462
+ [h.actions, E]
4463
4463
  ), f = O(
4464
4464
  (_) => {
4465
4465
  const I = _.some((C) => be.isStreaming(C));
@@ -4475,7 +4475,7 @@ const {
4475
4475
  return /* @__PURE__ */ o.createElement(
4476
4476
  Xs,
4477
4477
  {
4478
- channelUrl: E,
4478
+ channelUrl: x,
4479
4479
  onBeforeSendMessage: b,
4480
4480
  onAfterSendMessage: y,
4481
4481
  onMessagesUpdated: f,
@@ -4685,9 +4685,9 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4685
4685
  onLoadNext: d,
4686
4686
  loadThreshold: h = 0.05,
4687
4687
  onScroll: p = xe,
4688
- depsForResetScrollPositionToBottom: x,
4688
+ depsForResetScrollPositionToBottom: E,
4689
4689
  stackDirection: y = "top",
4690
- bottomSpacerHeight: E = 0
4690
+ bottomSpacerHeight: x = 0
4691
4691
  } = t, b = H(null), f = O(
4692
4692
  (w) => {
4693
4693
  b.current = w, n && (typeof n == "function" ? n(w) : n.current = w);
@@ -4696,7 +4696,7 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4696
4696
  ), u = H(!1), v = H(void 0), _ = H(0), I = H(0);
4697
4697
  Ee(() => {
4698
4698
  b.current && (b.current.scrollTop = b.current.scrollHeight);
4699
- }, x), Ee(() => {
4699
+ }, E), Ee(() => {
4700
4700
  b.current && (v.current === "top" && (b.current.scrollTop = b.current.scrollHeight - I.current), v.current === "bottom" && (b.current.scrollTop = _.current), v.current = void 0);
4701
4701
  }, [b.current, r.length]);
4702
4702
  const C = async (w) => {
@@ -4706,7 +4706,7 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4706
4706
  const B = M.clientHeight * Math.min(Math.max(0, h), 1);
4707
4707
  M.scrollTop <= B ? (u.current = !0, v.current = "top", await c(), u.current = !1) : M.scrollHeight - M.scrollTop - M.clientHeight <= B ? (u.current = !0, v.current = "bottom", await d(), u.current = !1) : v.current = void 0;
4708
4708
  };
4709
- return /* @__PURE__ */ o.createElement(ju, { id: "infinite-list-container" }, /* @__PURE__ */ o.createElement(qu, { id: "infinite-list-inner", ref: f, onScroll: C }, y === "bottom" && /* @__PURE__ */ o.createElement("div", { style: { flexGrow: 1 } }), i, r.map((w, M) => s({ message: w, index: M })), a, E > 0 && /* @__PURE__ */ o.createElement("div", { style: { minHeight: E } })), /* @__PURE__ */ o.createElement(Ku, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ o.createElement(Zu, { id: "infinite-list-overlay" }, l)));
4709
+ return /* @__PURE__ */ o.createElement(ju, { id: "infinite-list-container" }, /* @__PURE__ */ o.createElement(qu, { id: "infinite-list-inner", ref: f, onScroll: C }, y === "bottom" && /* @__PURE__ */ o.createElement("div", { style: { flexGrow: 1 } }), i, r.map((w, M) => s({ message: w, index: M })), a, x > 0 && /* @__PURE__ */ o.createElement("div", { style: { minHeight: x } })), /* @__PURE__ */ o.createElement(Ku, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ o.createElement(Zu, { id: "infinite-list-overlay" }, l)));
4710
4710
  }), ju = g.div`display:flex;position:relative;flex:1;overflow:hidden;`, qu = g.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:${m.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Ku = g.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, Zu = g.div`pointer-events:auto;`, Yu = ({ className: e, onClick: t }) => /* @__PURE__ */ o.createElement(Xu, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ o.createElement(N, { size: 24, type: "chevron-down", color: m.color.primary.main })), Xu = g.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);${R.light`
4711
4711
  background-color: ${m.color.background50};
4712
4712
  &:hover {
@@ -4735,11 +4735,11 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4735
4735
  /**
4736
4736
  * Returns a list of messages filtered according to business requirements.
4737
4737
  */
4738
- filteredMessages: c.filter((x) => Tu(x) ? !1 : l.length > 0 ? !be.isWelcomeMessage(x, t) : !0),
4738
+ filteredMessages: c.filter((E) => Tu(E) ? !1 : l.length > 0 ? !be.isWelcomeMessage(E, t) : !0),
4739
4739
  /**
4740
4740
  * Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
4741
4741
  */
4742
- shouldShowOriginalDate: (x) => x > 0 || l.length === 0 ? !0 : h && !To(h.createdAt, (p == null ? void 0 : p.createdAt) ?? 0),
4742
+ shouldShowOriginalDate: (E) => E > 0 || l.length === 0 ? !0 : h && !To(h.createdAt, (p == null ? void 0 : p.createdAt) ?? 0),
4743
4743
  /**
4744
4744
  * Renders the list of welcome messages from Bot Studio.
4745
4745
  */
@@ -4751,19 +4751,19 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4751
4751
  locale: s,
4752
4752
  formatString: r.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
4753
4753
  }
4754
- ), l.map((x, y) => {
4755
- const E = y === l.length - 1, b = d.length !== c.length, f = l.length === 1 ? "single" : y === 0 ? "top" : E || b ? "bottom" : "middle";
4754
+ ), l.map((E, y) => {
4755
+ const x = y === l.length - 1, b = d.length !== c.length, f = l.length === 1 ? "single" : y === 0 ? "top" : x || b ? "bottom" : "middle";
4756
4756
  return /* @__PURE__ */ o.createElement(
4757
4757
  a,
4758
4758
  {
4759
4759
  messageType: "user",
4760
- message: x.message,
4760
+ message: E.message,
4761
4761
  sender: n,
4762
4762
  groupType: f,
4763
4763
  createdAt: (p == null ? void 0 : p.createdAt) ?? Date.now(),
4764
- extendedMessagePayload: { suggested_replies: x.suggestedReplies },
4764
+ extendedMessagePayload: { suggested_replies: E.suggestedReplies },
4765
4765
  suggestedRepliesDirection: e.suggestedRepliesDirection,
4766
- suggestedRepliesVisible: E && !b,
4766
+ suggestedRepliesVisible: x && !b,
4767
4767
  isBotMessage: !0,
4768
4768
  onClickSuggestedReply: async ({ reply: u }) => {
4769
4769
  i.sendUserMessage({ message: u });
@@ -4812,7 +4812,7 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4812
4812
  e.TALK_TO_AGENT
4813
4813
  ));
4814
4814
  }, om = g.div`display:flex;justify-content:center;margin-bottom:16px;`, sm = g(k)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${m.themedColor.textDisabled};cursor:pointer;user-select:none;`, im = () => {
4815
- const { Template: e } = on.useContext(), { Template: t } = Ve.useContext(), { Template: n } = sn.useContext(), [r, s] = S(null), [i, a] = S(null), { userSession: l, aiAgentInfo: c } = Q(), { cache: d, agentPreviewConfigs: h, chatSDK: p, state: x } = j(), { config: y } = K(), { stringSet: E, dateLocale: b } = z(), {
4815
+ const { Template: e } = on.useContext(), { Template: t } = Ve.useContext(), { Template: n } = sn.useContext(), [r, s] = S(null), [i, a] = S(null), { userSession: l, aiAgentInfo: c } = Q(), { cache: d, agentPreviewConfigs: h, chatSDK: p, state: E } = j(), { config: y } = K(), { stringSet: x, dateLocale: b } = z(), {
4816
4816
  conversation: f,
4817
4817
  channelSource: u,
4818
4818
  messageSource: v,
@@ -4843,7 +4843,7 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4843
4843
  return /* @__PURE__ */ o.createElement(ze, { type: "loading" });
4844
4844
  if (v.messages.length === 0) {
4845
4845
  const A = B();
4846
- return A ? /* @__PURE__ */ o.createElement("div", { style: { width: "100%" } }, A) : /* @__PURE__ */ o.createElement(ze, { type: "noMessages", label: E.PLACE_HOLDER__NO_MESSAGES });
4846
+ return A ? /* @__PURE__ */ o.createElement("div", { style: { width: "100%" } }, A) : /* @__PURE__ */ o.createElement(ze, { type: "noMessages", label: x.PLACE_HOLDER__NO_MESSAGES });
4847
4847
  }
4848
4848
  return /* @__PURE__ */ o.createElement(
4849
4849
  Gu,
@@ -4880,10 +4880,10 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4880
4880
  style: { margin: "16px 0" },
4881
4881
  date: A.createdAt,
4882
4882
  locale: b,
4883
- formatString: E.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
4883
+ formatString: x.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
4884
4884
  }
4885
4885
  ) : null, nt = {
4886
- maxBodyWidth: x.expanded ? P.WIDE_BODY_MAX_WIDTH : void 0,
4886
+ maxBodyWidth: E.expanded ? P.WIDE_BODY_MAX_WIDTH : void 0,
4887
4887
  extendedMessagePayload: A.extendedMessagePayload,
4888
4888
  createdAt: A.createdAt,
4889
4889
  groupType: Se,
@@ -5003,7 +5003,7 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
5003
5003
  v.resendMessage(i), a(null);
5004
5004
  }
5005
5005
  },
5006
- E.FAILED_MESSAGE_RESEND
5006
+ x.FAILED_MESSAGE_RESEND
5007
5007
  ), /* @__PURE__ */ o.createElement(
5008
5008
  Pe.ActionItem,
5009
5009
  {
@@ -5012,7 +5012,7 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
5012
5012
  v.deleteMessage(i), a(null);
5013
5013
  }
5014
5014
  },
5015
- E.FAILED_MESSAGE_REMOVE
5015
+ x.FAILED_MESSAGE_REMOVE
5016
5016
  )));
5017
5017
  }, am = g.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, lm = g(Yu)`position:absolute;bottom:20px;inset-inline-end:20px;`, cm = () => {
5018
5018
  const { stringSet: e } = z(), { connectionError: t } = Q(), { channelSource: n } = ee(), r = t || n.error;
@@ -5049,7 +5049,7 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
5049
5049
  }), h = d.isEnabled(), p = (f) => {
5050
5050
  const u = d.getUploadSizeLimit(f.type);
5051
5051
  return f.size > u;
5052
- }, x = (f) => {
5052
+ }, E = (f) => {
5053
5053
  if (!h) return;
5054
5054
  const u = f.filter((I) => d.isSupportedMimeType(I.type));
5055
5055
  if (u.length === 0) return;
@@ -5082,7 +5082,7 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
5082
5082
  const v = (_ = u[f]) == null ? void 0 : _.preview;
5083
5083
  return v && URL.revokeObjectURL(v.url), u.filter((I, C) => C !== f);
5084
5084
  });
5085
- }, E = () => {
5085
+ }, x = () => {
5086
5086
  a((f) => (f.forEach((u) => URL.revokeObjectURL(u.preview.url)), []));
5087
5087
  };
5088
5088
  return /* @__PURE__ */ o.createElement(
@@ -5090,9 +5090,9 @@ const wu = g.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
5090
5090
  {
5091
5091
  value: {
5092
5092
  files: i,
5093
- addFiles: x,
5093
+ addFiles: E,
5094
5094
  removeFile: y,
5095
- clearFiles: E,
5095
+ clearFiles: x,
5096
5096
  isFileUploadEnabled: h,
5097
5097
  acceptableMimeTypes: d.supportedMimeTypes
5098
5098
  }
@@ -5185,7 +5185,7 @@ const hm = (e, t) => {
5185
5185
  )
5186
5186
  );
5187
5187
  }, ym = () => {
5188
- const e = H(null), [t, n] = S(""), { stringSet: r } = z(), { rootElement: s } = j(), { channelSource: i, messageSource: a, state: l } = ee(), { files: c, addFiles: d, clearFiles: h } = un(), p = l.input.disabled, x = (() => {
5188
+ const e = H(null), [t, n] = S(""), { stringSet: r } = z(), { rootElement: s } = j(), { channelSource: i, messageSource: a, state: l } = ee(), { files: c, addFiles: d, clearFiles: h } = un(), p = l.input.disabled, E = (() => {
5189
5189
  if (!p) return r.MESSAGE_INPUT__PLACE_HOLDER;
5190
5190
  switch (l.input.disabledBy) {
5191
5191
  case "form_active":
@@ -5203,7 +5203,7 @@ const hm = (e, t) => {
5203
5203
  }
5204
5204
  })();
5205
5205
  pu({ onDropFiles: d }), gm({ blurred: p, elementRef: e, document: Me(s) }), hm(i.channel, t);
5206
- const y = t.trim().length > 0, E = c.length > 0, b = !p && (y || E), f = () => {
5206
+ const y = t.trim().length > 0, x = c.length > 0, b = !p && (y || x), f = () => {
5207
5207
  e.current && (e.current.value = "", e.current.style.height = ""), h(), n("");
5208
5208
  }, u = async () => {
5209
5209
  const C = t.trim(), w = { message: C };
@@ -5228,13 +5228,13 @@ const hm = (e, t) => {
5228
5228
  }
5229
5229
  n(C.target.value);
5230
5230
  };
5231
- return p ? /* @__PURE__ */ o.createElement(Yn, null, /* @__PURE__ */ o.createElement(qn, null, /* @__PURE__ */ o.createElement(Kn, null, /* @__PURE__ */ o.createElement(Zn, { disabled: !0, placeholder: x }), /* @__PURE__ */ o.createElement(Xn, { disabled: !0 })))) : /* @__PURE__ */ o.createElement(Yn, null, /* @__PURE__ */ o.createElement(qn, null, /* @__PURE__ */ o.createElement(Em, null), /* @__PURE__ */ o.createElement(Kn, null, /* @__PURE__ */ o.createElement(
5231
+ return p ? /* @__PURE__ */ o.createElement(Yn, null, /* @__PURE__ */ o.createElement(qn, null, /* @__PURE__ */ o.createElement(Kn, null, /* @__PURE__ */ o.createElement(Zn, { disabled: !0, placeholder: E }), /* @__PURE__ */ o.createElement(Xn, { disabled: !0 })))) : /* @__PURE__ */ o.createElement(Yn, null, /* @__PURE__ */ o.createElement(qn, null, /* @__PURE__ */ o.createElement(Em, null), /* @__PURE__ */ o.createElement(Kn, null, /* @__PURE__ */ o.createElement(
5232
5232
  Zn,
5233
5233
  {
5234
5234
  ref: e,
5235
5235
  role: "textbox",
5236
5236
  "aria-label": "Text Input",
5237
- placeholder: x,
5237
+ placeholder: E,
5238
5238
  maxLength: 5e3,
5239
5239
  onKeyDown: _,
5240
5240
  onChange: I,
@@ -5248,7 +5248,7 @@ const hm = (e, t) => {
5248
5248
  color: ${m.color.information.main};
5249
5249
  `};
5250
5250
  }
5251
- `, Cm = L(() => import("./BiR7LQjJ.js").then((e) => ({ default: e.MarkdownText }))), Sm = () => {
5251
+ `, Cm = L(() => import("./COct2xck.js").then((e) => ({ default: e.MarkdownText }))), Sm = () => {
5252
5252
  const { aiAgentInfo: e, userSession: t } = Q(), { messageSource: n, channelSource: r } = ee(), [s, i] = S(null), a = Yt("special-notice", r.channel), l = O(() => r.channel ? a ? n.messages.some((c) => He(c, (t == null ? void 0 : t.userId) ?? "")) : !0 : null, [r.channel, a, n.messages, t == null ? void 0 : t.userId]);
5253
5253
  return F(() => {
5254
5254
  s || i(l());
@@ -5727,16 +5727,16 @@ function ut({ initialId: e, children: t }) {
5727
5727
  return Object.entries(d).forEach(([u, { lazy: v }]) => {
5728
5728
  v === !1 && (f[u] = !0);
5729
5729
  }), f[e] = !0, f;
5730
- }), [x, y] = S(() => {
5730
+ }), [E, y] = S(() => {
5731
5731
  const f = {};
5732
5732
  return Object.keys(d).forEach((u) => {
5733
5733
  u === e ? f[u] = "entered" : f[u] = "exited";
5734
5734
  }), f;
5735
- }), [E, b] = S({});
5735
+ }), [x, b] = S({});
5736
5736
  return /* @__PURE__ */ o.createElement(Zr.Provider, { value: l }, /* @__PURE__ */ o.createElement(Mg, null, Object.keys(d).map((f) => {
5737
5737
  var I;
5738
5738
  if (!h[f]) return null;
5739
- const u = x[f] || "exited", v = f === s, _ = `${f}-${E[f] || 0}`;
5739
+ const u = E[f] || "exited", v = f === s, _ = `${f}-${x[f] || 0}`;
5740
5740
  return /* @__PURE__ */ o.createElement($g, { key: _, $transitionState: u, $active: v }, (I = d[f]) == null ? void 0 : I.element);
5741
5741
  })));
5742
5742
  }
@@ -5785,14 +5785,14 @@ function Lg({ isExpanded: e, isOpened: t, children: n, launcher: r }) {
5785
5785
  const { dir: s } = j();
5786
5786
  return /* @__PURE__ */ o.createElement(Dg, null, /* @__PURE__ */ o.createElement(Rg, { dir: s, id: ie.WINDOW, $isExpanded: e, $isOpened: t }, n), r);
5787
5787
  }
5788
- const Dg = g.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Rg = g.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 && Bg};${({ $isExpanded: e }) => e && Ng};`, Ng = $`width:743px;height:723px;`, Bg = $`z-index:${Oe.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;`, mh = Ge(function({ children: e, ...t }, n) {
5789
- const r = Qe(), [s, i] = S(), a = r ? Gr : Lg;
5790
- return /* @__PURE__ */ o.createElement(Wr, { enableExpandButton: !r, ref: n, ...t }, /* @__PURE__ */ o.createElement(vr, null, ({ state: l }) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(a, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ o.createElement(Kr, null) }, /* @__PURE__ */ o.createElement(
5788
+ const Dg = g.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Rg = g.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 && Bg};${({ $isExpanded: e }) => e && Ng};`, Ng = $`width:743px;height:723px;`, Bg = $`z-index:${Oe.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;`, mh = Ge(function({ children: e, initialChannelUrl: t, ...n }, r) {
5789
+ const s = Qe(), [i, a] = S(t), l = s ? Gr : Lg;
5790
+ return /* @__PURE__ */ o.createElement(Wr, { enableExpandButton: !s, ref: r, ...n }, /* @__PURE__ */ o.createElement(vr, null, ({ state: c }) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(l, { isExpanded: c.expanded, isOpened: c.opened, launcher: /* @__PURE__ */ o.createElement(Kr, null) }, /* @__PURE__ */ o.createElement(
5791
5791
  Jr,
5792
5792
  {
5793
- entryPoint: t.entryPoint,
5794
- selectedChannelUrl: s,
5795
- setSelectedChannelUrl: i
5793
+ entryPoint: n.entryPoint,
5794
+ selectedChannelUrl: i,
5795
+ setSelectedChannelUrl: a
5796
5796
  }
5797
5797
  )), e)));
5798
5798
  }), {
@@ -5850,22 +5850,22 @@ const Vg = g.div`background:${({ theme: e }) => e.colors.base.background};displa
5850
5850
 
5851
5851
  ${({ $isOpened: e }) => e && Wg};
5852
5852
  ${({ $isExpanded: e }) => e && zg};
5853
- `, zg = $`width:743px;height:723px;`, Wg = $`z-index:${Oe.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;`, eo = { top: 24, bottom: 24, start: 24, end: 24 }, Gg = Ge(function({ children: e, ...t }, n) {
5854
- const [r, s] = S(), [i, a] = S("end-bottom"), [l, c] = S(eo), [d, h] = S(48), p = Qe(), x = p ? Gr : Hg, { horizontal: y, vertical: E } = re(() => {
5855
- const [b, f] = i.split("-");
5856
- return { horizontal: b === "start" ? "start" : "end", vertical: f === "top" ? "top" : "bottom" };
5857
- }, [i]);
5858
- return /* @__PURE__ */ o.createElement(Wr, { enableExpandButton: !p, ref: n, ...t }, /* @__PURE__ */ o.createElement(vr, null, ({ state: b }) => /* @__PURE__ */ o.createElement(
5853
+ `, zg = $`width:743px;height:723px;`, Wg = $`z-index:${Oe.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;`, eo = { top: 24, bottom: 24, start: 24, end: 24 }, Gg = Ge(function({ children: e, initialChannelUrl: t, ...n }, r) {
5854
+ const [s, i] = S(t), [a, l] = S("end-bottom"), [c, d] = S(eo), [h, p] = S(48), E = Qe(), y = E ? Gr : Hg, { horizontal: x, vertical: b } = re(() => {
5855
+ const [f, u] = a.split("-");
5856
+ return { horizontal: f === "start" ? "start" : "end", vertical: u === "top" ? "top" : "bottom" };
5857
+ }, [a]);
5858
+ return /* @__PURE__ */ o.createElement(Wr, { enableExpandButton: !E, ref: r, ...n }, /* @__PURE__ */ o.createElement(vr, null, ({ state: f }) => /* @__PURE__ */ o.createElement(
5859
5859
  Fg,
5860
5860
  {
5861
- value: { horizontal: y, vertical: E, margin: l, launcherSize: d, setPosition: a, setMargin: c, setLauncherSize: h }
5861
+ value: { horizontal: x, vertical: b, margin: c, launcherSize: h, setPosition: l, setMargin: d, setLauncherSize: p }
5862
5862
  },
5863
- /* @__PURE__ */ o.createElement(x, { isExpanded: b.expanded, isOpened: b.opened }, /* @__PURE__ */ o.createElement(
5863
+ /* @__PURE__ */ o.createElement(y, { isExpanded: f.expanded, isOpened: f.opened }, /* @__PURE__ */ o.createElement(
5864
5864
  Jr,
5865
5865
  {
5866
- entryPoint: t.entryPoint,
5867
- selectedChannelUrl: r,
5868
- setSelectedChannelUrl: s
5866
+ entryPoint: n.entryPoint,
5867
+ selectedChannelUrl: s,
5868
+ setSelectedChannelUrl: i
5869
5869
  }
5870
5870
  )),
5871
5871
  /* @__PURE__ */ o.createElement(Pg, null),