@2uinc/frontend-component-xpert-chatbot 1.13.9-beta.1 → 1.13.9-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10381,7 +10381,7 @@ _n.defaultProps = {
10381
10381
  text: null,
10382
10382
  userTrackingName: "clicked"
10383
10383
  };
10384
- const Fn = ({
10384
+ const Kh = "Sure, I can get you to someone who can help.", Fn = ({
10385
10385
  index: e,
10386
10386
  message: t,
10387
10387
  isNormalSize: n,
@@ -10399,23 +10399,20 @@ const Fn = ({
10399
10399
  "data-testid": "message-container",
10400
10400
  className: "xpert-chatbot-popup__bubble--assistant",
10401
10401
  role: "status",
10402
- "aria-label": "Xpert responded with a message",
10402
+ "aria-label": `The bot said ${t.liveAgent ? Kh : t.content}`,
10403
10403
  style: { maxWidth: n ? "85%" : "67%" },
10404
- children: t.liveAgent ? /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
10405
- /* @__PURE__ */ I.jsx("div", { "aria-label": "Sure, I can get you to someone who can help. Please click chat with us button to start a live chat.", children: "Sure, I can get you to someone who can help." }),
10406
- /* @__PURE__ */ I.jsx("div", { children: /* @__PURE__ */ I.jsx(
10407
- _n,
10408
- {
10409
- submitEvent: a,
10410
- setLiveChatOpen: l,
10411
- isTestUser: s,
10412
- enableLiveChatMessage: !1,
10413
- buttonClassName: "xpert-chatbot-popup__bubble--assistant-live-chat",
10414
- text: "Chat with us",
10415
- userTrackingName: "assistant.response.clicked"
10416
- }
10417
- ) })
10418
- ] }) : /* @__PURE__ */ I.jsx("div", { "aria-label": t.content, children: /* @__PURE__ */ I.jsx(
10404
+ children: t.liveAgent ? /* @__PURE__ */ I.jsx(I.Fragment, { children: /* @__PURE__ */ I.jsx("div", { children: /* @__PURE__ */ I.jsx(
10405
+ _n,
10406
+ {
10407
+ submitEvent: a,
10408
+ setLiveChatOpen: l,
10409
+ isTestUser: s,
10410
+ enableLiveChatMessage: !1,
10411
+ buttonClassName: "xpert-chatbot-popup__bubble--assistant-live-chat",
10412
+ text: "Chat with us",
10413
+ userTrackingName: "assistant.response.clicked"
10414
+ }
10415
+ ) }) }) : /* @__PURE__ */ I.jsx("div", { children: /* @__PURE__ */ I.jsx(
10419
10416
  Ga,
10420
10417
  {
10421
10418
  components: {
@@ -10464,7 +10461,7 @@ Fn.defaultProps = {
10464
10461
  isTestUser: !1
10465
10462
  };
10466
10463
  Fn.displayName = "AssistantMessageBubble";
10467
- const Kh = Fn, Ka = () => {
10464
+ const Xh = Fn, Ka = () => {
10468
10465
  const { disclaimer: e } = _e(Fe), t = We(null);
10469
10466
  return be(() => {
10470
10467
  var n;
@@ -10497,7 +10494,7 @@ const Kh = Fn, Ka = () => {
10497
10494
  );
10498
10495
  };
10499
10496
  Ka.displayName = "ConversationScreenDisclaimer";
10500
- const Xh = Ka, Xr = ({ loading: e, onPromptClick: t }) => {
10497
+ const Jh = Ka, Xr = ({ loading: e, onPromptClick: t }) => {
10501
10498
  var i;
10502
10499
  const { primaryColor: n, conversationScreen: r } = _e(Fe);
10503
10500
  return /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
@@ -10528,15 +10525,17 @@ Xr.propTypes = {
10528
10525
  onPromptClick: N.func.isRequired
10529
10526
  };
10530
10527
  Xr.displayName = "PromptList";
10531
- const Jh = Xr, Jr = ({ message: e, isNormalSize: t }) => /* @__PURE__ */ I.jsx(
10528
+ const eg = Xr, Jr = ({ message: e, isNormalSize: t }) => /* @__PURE__ */ I.jsx(
10532
10529
  "div",
10533
10530
  {
10531
+ tabIndex: 0,
10534
10532
  role: "status",
10535
- "aria-label": "General message",
10533
+ "aria-label": "message-container",
10536
10534
  className: "xpert-chatbot-popup__bubble--group",
10537
10535
  children: /* @__PURE__ */ I.jsx("div", { className: "xpert-chatbot-popup__bubble--group-inner", children: /* @__PURE__ */ I.jsx(
10538
10536
  "div",
10539
10537
  {
10538
+ id: "message-container",
10540
10539
  "data-testid": "message-container",
10541
10540
  className: "xpert-chatbot-popup__bubble--assistant",
10542
10541
  style: { maxWidth: t ? "85%" : "67%" },
@@ -10550,14 +10549,14 @@ Jr.propTypes = {
10550
10549
  isNormalSize: N.bool.isRequired
10551
10550
  };
10552
10551
  Jr.displayName = "SystemMessageBubble";
10553
- const eg = Jr, ei = ({ content: e, isNormalSize: t }) => {
10552
+ const tg = Jr, ei = ({ content: e, isNormalSize: t }) => {
10554
10553
  var i;
10555
10554
  const { primaryColor: n, conversationScreen: r } = _e(Fe);
10556
10555
  return /* @__PURE__ */ I.jsx(
10557
10556
  "div",
10558
10557
  {
10559
10558
  tabIndex: 0,
10560
- "aria-label": "Your message was",
10559
+ "aria-label": `You said ${e}`,
10561
10560
  role: "log",
10562
10561
  className: "xpert-chatbot-popup__bubble--user",
10563
10562
  style: {
@@ -10574,7 +10573,7 @@ ei.propTypes = {
10574
10573
  isNormalSize: N.bool.isRequired
10575
10574
  };
10576
10575
  ei.displayName = "UserMessageBubble";
10577
- const tg = ei, Pn = ({
10576
+ const ng = ei, Pn = ({
10578
10577
  messages: e,
10579
10578
  loading: t,
10580
10579
  isNormalSize: n,
@@ -10593,22 +10592,23 @@ const tg = ei, Pn = ({
10593
10592
  block: "start"
10594
10593
  });
10595
10594
  }, [e.length]), /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
10596
- /* @__PURE__ */ I.jsx(Xh, {}),
10597
- (c == null ? void 0 : c.length) > 0 && /* @__PURE__ */ I.jsx(Jh, { loading: t, onPromptClick: i }),
10595
+ /* @__PURE__ */ I.jsx(Jh, {}),
10596
+ (c == null ? void 0 : c.length) > 0 && /* @__PURE__ */ I.jsx(eg, { loading: t, onPromptClick: i }),
10598
10597
  /* @__PURE__ */ I.jsxs(
10599
10598
  "div",
10600
10599
  {
10601
- id: "chat-region",
10600
+ id: "chat-content",
10601
+ tabIndex: 0,
10602
10602
  "aria-live": "polite",
10603
10603
  role: "region",
10604
10604
  "aria-relevant": "additions",
10605
10605
  "aria-atomic": "false",
10606
- "aria-label": "Chat region",
10606
+ "aria-label": "Chat content",
10607
10607
  "aria-busy": t,
10608
10608
  style: { display: "flex", flexDirection: "column" },
10609
10609
  children: [
10610
10610
  p && /* @__PURE__ */ I.jsx(
10611
- eg,
10611
+ tg,
10612
10612
  {
10613
10613
  message: p,
10614
10614
  isNormalSize: n
@@ -10616,7 +10616,7 @@ const tg = ei, Pn = ({
10616
10616
  ),
10617
10617
  e.map(
10618
10618
  (f, v) => f.role === "assistant" ? /* @__PURE__ */ I.jsx(
10619
- Kh,
10619
+ Xh,
10620
10620
  {
10621
10621
  index: v,
10622
10622
  message: f,
@@ -10630,7 +10630,7 @@ const tg = ei, Pn = ({
10630
10630
  },
10631
10631
  `${f.role}-${v}`
10632
10632
  ) : /* @__PURE__ */ I.jsx(
10633
- tg,
10633
+ ng,
10634
10634
  {
10635
10635
  content: f.content,
10636
10636
  isNormalSize: n
@@ -10668,7 +10668,7 @@ Pn.defaultProps = {
10668
10668
  isTestUser: !1
10669
10669
  };
10670
10670
  Pn.displayName = "ConversationsMessages";
10671
- const ng = Pn;
10671
+ const rg = Pn;
10672
10672
  function Xa({ disableScroll: e }) {
10673
10673
  const t = We(null);
10674
10674
  return be(() => {
@@ -10696,7 +10696,7 @@ function Xa({ disableScroll: e }) {
10696
10696
  Xa.propTypes = {
10697
10697
  disableScroll: N.bool
10698
10698
  };
10699
- const rg = () => {
10699
+ const ig = () => {
10700
10700
  const e = We(null);
10701
10701
  return be(() => {
10702
10702
  var t;
@@ -10759,7 +10759,7 @@ const rg = () => {
10759
10759
  ]
10760
10760
  }
10761
10761
  );
10762
- }, lr = rg;
10762
+ }, lr = ig;
10763
10763
  function Ja({
10764
10764
  children: e,
10765
10765
  cookieName: t,
@@ -10850,7 +10850,7 @@ Ja.propTypes = {
10850
10850
  showMessage: N.bool,
10851
10851
  style: N.shape()
10852
10852
  };
10853
- function ig(e, t, n) {
10853
+ function og(e, t, n) {
10854
10854
  const r = vt(
10855
10855
  (i) => {
10856
10856
  const { data: o } = i || {}, { chatState: a, show: l, type: s } = o || {};
@@ -10880,7 +10880,7 @@ function ig(e, t, n) {
10880
10880
  };
10881
10881
  }, [e, t]);
10882
10882
  }
10883
- function og(e) {
10883
+ function ag(e) {
10884
10884
  const [t, n] = ye(null);
10885
10885
  return be(() => {
10886
10886
  try {
@@ -10910,7 +10910,7 @@ function og(e) {
10910
10910
  `Chatbot - Optimizely experimentVariation: ${t}`
10911
10911
  ), t;
10912
10912
  }
10913
- function ag(e) {
10913
+ function lg(e) {
10914
10914
  be(() => {
10915
10915
  e();
10916
10916
  const t = () => document.visibilityState === "visible" && e();
@@ -10919,21 +10919,21 @@ function ag(e) {
10919
10919
  };
10920
10920
  }, [e]);
10921
10921
  }
10922
- function lg(e, t) {
10922
+ function sg(e, t) {
10923
10923
  if (!(e instanceof Date && t instanceof Date))
10924
10924
  throw new Error(
10925
10925
  `Both start and end must be valid Date objects: start=${e} end=${t}`
10926
10926
  );
10927
10927
  return (t.getTime() - e.getTime()) / 1e3;
10928
10928
  }
10929
- function sg(e) {
10929
+ function ug(e) {
10930
10930
  const t = /\[(.+)\]\(([^ ]+)( "(.+)")?\)/gm, n = e.match(t);
10931
10931
  return (n == null ? void 0 : n.length) || 0;
10932
10932
  }
10933
- function ug(e) {
10933
+ function cg(e) {
10934
10934
  return new TextEncoder().encode(e).length;
10935
10935
  }
10936
- const cg = 991, pg = [];
10936
+ const pg = 991, fg = [];
10937
10937
  function ti({ submitEventExternal: e }) {
10938
10938
  var at, mt;
10939
10939
  const {
@@ -10944,8 +10944,8 @@ function ti({ submitEventExternal: e }) {
10944
10944
  userTracking: o,
10945
10945
  webExperimentation: a,
10946
10946
  xpertKey: l
10947
- } = _e(Fe), s = rt(cg), [, u] = ye(!1), [, c] = ye(!1), [p, m] = ye(pg), [f, v] = ye(!1), [b, k] = ye(!1), [M, z] = ye(!1), [E, _] = ye(""), [U, x] = ye(!1), [L, $] = ye(!0), [W, X] = ye(!1), [A, w] = ye(!1), [j, O] = ye(!1), F = We(null), B = We(null), V = We(null), q = Le.get(`${l}-test`) === "1";
10948
- ig(
10947
+ } = _e(Fe), s = rt(pg), [, u] = ye(!1), [, c] = ye(!1), [p, m] = ye(fg), [f, v] = ye(!1), [b, k] = ye(!1), [M, z] = ye(!1), [E, _] = ye(""), [U, x] = ye(!1), [L, $] = ye(!0), [W, X] = ye(!1), [A, w] = ye(!1), [j, O] = ye(!1), F = We(null), B = We(null), V = We(null), q = Le.get(`${l}-test`) === "1";
10948
+ og(
10949
10949
  n.liveChat.enabled,
10950
10950
  M,
10951
10951
  z
@@ -10997,7 +10997,7 @@ function ti({ submitEventExternal: e }) {
10997
10997
  v(!1);
10998
10998
  }
10999
10999
  }, [l, t.endpoint]);
11000
- ag(g), be(() => {
11000
+ lg(g), be(() => {
11001
11001
  let R, ee;
11002
11002
  return o.enabled && (R = setInterval(() => {
11003
11003
  var le;
@@ -11028,7 +11028,7 @@ function ti({ submitEventExternal: e }) {
11028
11028
  isTestUser: q
11029
11029
  }
11030
11030
  });
11031
- }, Me = og(
11031
+ }, Me = ag(
11032
11032
  a.experimentName
11033
11033
  );
11034
11034
  if (a.enabled && !a.experimentName && !q)
@@ -11045,7 +11045,7 @@ function ti({ submitEventExternal: e }) {
11045
11045
  payload: {
11046
11046
  category: "2u",
11047
11047
  label: "xpert-chatbot",
11048
- linkCount: sg(R),
11048
+ linkCount: ug(R),
11049
11049
  apiResponseMessage: R,
11050
11050
  isTestUser: q,
11051
11051
  conversationHistoryId: ee
@@ -11132,11 +11132,11 @@ function ti({ submitEventExternal: e }) {
11132
11132
  ge(D, le);
11133
11133
  const Y = /* @__PURE__ */ new Date();
11134
11134
  De({
11135
- conversationByteSize: ug(JSON.stringify(Qe)),
11135
+ conversationByteSize: cg(JSON.stringify(Qe)),
11136
11136
  conversationSize: p.length + 2,
11137
11137
  userInputMessage: R,
11138
11138
  apiResponseMessage: D,
11139
- elapsedSeconds: lg(ee, Y)
11139
+ elapsedSeconds: sg(ee, Y)
11140
11140
  }), m((J) => [
11141
11141
  ...J,
11142
11142
  {
@@ -11292,7 +11292,7 @@ function ti({ submitEventExternal: e }) {
11292
11292
  },
11293
11293
  children: [
11294
11294
  /* @__PURE__ */ I.jsx(
11295
- ng,
11295
+ rg,
11296
11296
  {
11297
11297
  messages: p,
11298
11298
  loading: f,
@@ -11360,7 +11360,7 @@ el.propTypes = {
11360
11360
  configurations: N.object,
11361
11361
  xpertKey: N.string
11362
11362
  };
11363
- function fg({ configurations: e = {}, key: t, submitEventExternal: n, xpertKey: r }) {
11363
+ function dg({ configurations: e = {}, key: t, submitEventExternal: n, xpertKey: r }) {
11364
11364
  return /* @__PURE__ */ I.jsx(
11365
11365
  el,
11366
11366
  {
@@ -11371,14 +11371,14 @@ function fg({ configurations: e = {}, key: t, submitEventExternal: n, xpertKey:
11371
11371
  t
11372
11372
  );
11373
11373
  }
11374
- fg.propTypes = {
11374
+ dg.propTypes = {
11375
11375
  configurations: N.object,
11376
11376
  key: N.string,
11377
11377
  submitEventExternal: N.func,
11378
11378
  xpertKey: N.string.isRequired
11379
11379
  };
11380
11380
  export {
11381
- fg as Chatbot,
11381
+ dg as Chatbot,
11382
11382
  is as EDXConfig,
11383
11383
  os as EmersonSpeechConfig,
11384
11384
  as as GetSmarterConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2uinc/frontend-component-xpert-chatbot",
3
- "version": "1.13.9-beta.1",
3
+ "version": "1.13.9-beta.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/2uinc/frontend-component-xpert-chatbot.git"