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

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": "The bot said",
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,12 +10525,12 @@ 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
  {
10534
10531
  tabIndex: 0,
10535
10532
  role: "status",
10536
- "aria-label": "message-container",
10533
+ "aria-labelledby": "message-container",
10537
10534
  className: "xpert-chatbot-popup__bubble--group",
10538
10535
  children: /* @__PURE__ */ I.jsx("div", { className: "xpert-chatbot-popup__bubble--group-inner", children: /* @__PURE__ */ I.jsx(
10539
10536
  "div",
@@ -10552,14 +10549,14 @@ Jr.propTypes = {
10552
10549
  isNormalSize: N.bool.isRequired
10553
10550
  };
10554
10551
  Jr.displayName = "SystemMessageBubble";
10555
- const eg = Jr, ei = ({ content: e, isNormalSize: t }) => {
10552
+ const tg = Jr, ei = ({ content: e, isNormalSize: t }) => {
10556
10553
  var i;
10557
10554
  const { primaryColor: n, conversationScreen: r } = _e(Fe);
10558
10555
  return /* @__PURE__ */ I.jsx(
10559
10556
  "div",
10560
10557
  {
10561
10558
  tabIndex: 0,
10562
- "aria-label": "You said",
10559
+ "aria-label": `You said ${e}`,
10563
10560
  role: "log",
10564
10561
  className: "xpert-chatbot-popup__bubble--user",
10565
10562
  style: {
@@ -10576,7 +10573,7 @@ ei.propTypes = {
10576
10573
  isNormalSize: N.bool.isRequired
10577
10574
  };
10578
10575
  ei.displayName = "UserMessageBubble";
10579
- const tg = ei, Pn = ({
10576
+ const ng = ei, Pn = ({
10580
10577
  messages: e,
10581
10578
  loading: t,
10582
10579
  isNormalSize: n,
@@ -10595,8 +10592,8 @@ const tg = ei, Pn = ({
10595
10592
  block: "start"
10596
10593
  });
10597
10594
  }, [e.length]), /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
10598
- /* @__PURE__ */ I.jsx(Xh, {}),
10599
- (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 }),
10600
10597
  /* @__PURE__ */ I.jsxs(
10601
10598
  "div",
10602
10599
  {
@@ -10611,7 +10608,7 @@ const tg = ei, Pn = ({
10611
10608
  style: { display: "flex", flexDirection: "column" },
10612
10609
  children: [
10613
10610
  p && /* @__PURE__ */ I.jsx(
10614
- eg,
10611
+ tg,
10615
10612
  {
10616
10613
  message: p,
10617
10614
  isNormalSize: n
@@ -10619,7 +10616,7 @@ const tg = ei, Pn = ({
10619
10616
  ),
10620
10617
  e.map(
10621
10618
  (f, v) => f.role === "assistant" ? /* @__PURE__ */ I.jsx(
10622
- Kh,
10619
+ Xh,
10623
10620
  {
10624
10621
  index: v,
10625
10622
  message: f,
@@ -10633,7 +10630,7 @@ const tg = ei, Pn = ({
10633
10630
  },
10634
10631
  `${f.role}-${v}`
10635
10632
  ) : /* @__PURE__ */ I.jsx(
10636
- tg,
10633
+ ng,
10637
10634
  {
10638
10635
  content: f.content,
10639
10636
  isNormalSize: n
@@ -10671,7 +10668,7 @@ Pn.defaultProps = {
10671
10668
  isTestUser: !1
10672
10669
  };
10673
10670
  Pn.displayName = "ConversationsMessages";
10674
- const ng = Pn;
10671
+ const rg = Pn;
10675
10672
  function Xa({ disableScroll: e }) {
10676
10673
  const t = We(null);
10677
10674
  return be(() => {
@@ -10699,7 +10696,7 @@ function Xa({ disableScroll: e }) {
10699
10696
  Xa.propTypes = {
10700
10697
  disableScroll: N.bool
10701
10698
  };
10702
- const rg = () => {
10699
+ const ig = () => {
10703
10700
  const e = We(null);
10704
10701
  return be(() => {
10705
10702
  var t;
@@ -10762,7 +10759,7 @@ const rg = () => {
10762
10759
  ]
10763
10760
  }
10764
10761
  );
10765
- }, lr = rg;
10762
+ }, lr = ig;
10766
10763
  function Ja({
10767
10764
  children: e,
10768
10765
  cookieName: t,
@@ -10853,7 +10850,7 @@ Ja.propTypes = {
10853
10850
  showMessage: N.bool,
10854
10851
  style: N.shape()
10855
10852
  };
10856
- function ig(e, t, n) {
10853
+ function og(e, t, n) {
10857
10854
  const r = vt(
10858
10855
  (i) => {
10859
10856
  const { data: o } = i || {}, { chatState: a, show: l, type: s } = o || {};
@@ -10883,7 +10880,7 @@ function ig(e, t, n) {
10883
10880
  };
10884
10881
  }, [e, t]);
10885
10882
  }
10886
- function og(e) {
10883
+ function ag(e) {
10887
10884
  const [t, n] = ye(null);
10888
10885
  return be(() => {
10889
10886
  try {
@@ -10913,7 +10910,7 @@ function og(e) {
10913
10910
  `Chatbot - Optimizely experimentVariation: ${t}`
10914
10911
  ), t;
10915
10912
  }
10916
- function ag(e) {
10913
+ function lg(e) {
10917
10914
  be(() => {
10918
10915
  e();
10919
10916
  const t = () => document.visibilityState === "visible" && e();
@@ -10922,21 +10919,21 @@ function ag(e) {
10922
10919
  };
10923
10920
  }, [e]);
10924
10921
  }
10925
- function lg(e, t) {
10922
+ function sg(e, t) {
10926
10923
  if (!(e instanceof Date && t instanceof Date))
10927
10924
  throw new Error(
10928
10925
  `Both start and end must be valid Date objects: start=${e} end=${t}`
10929
10926
  );
10930
10927
  return (t.getTime() - e.getTime()) / 1e3;
10931
10928
  }
10932
- function sg(e) {
10929
+ function ug(e) {
10933
10930
  const t = /\[(.+)\]\(([^ ]+)( "(.+)")?\)/gm, n = e.match(t);
10934
10931
  return (n == null ? void 0 : n.length) || 0;
10935
10932
  }
10936
- function ug(e) {
10933
+ function cg(e) {
10937
10934
  return new TextEncoder().encode(e).length;
10938
10935
  }
10939
- const cg = 991, pg = [];
10936
+ const pg = 991, fg = [];
10940
10937
  function ti({ submitEventExternal: e }) {
10941
10938
  var at, mt;
10942
10939
  const {
@@ -10947,8 +10944,8 @@ function ti({ submitEventExternal: e }) {
10947
10944
  userTracking: o,
10948
10945
  webExperimentation: a,
10949
10946
  xpertKey: l
10950
- } = _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";
10951
- 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(
10952
10949
  n.liveChat.enabled,
10953
10950
  M,
10954
10951
  z
@@ -11000,7 +10997,7 @@ function ti({ submitEventExternal: e }) {
11000
10997
  v(!1);
11001
10998
  }
11002
10999
  }, [l, t.endpoint]);
11003
- ag(g), be(() => {
11000
+ lg(g), be(() => {
11004
11001
  let R, ee;
11005
11002
  return o.enabled && (R = setInterval(() => {
11006
11003
  var le;
@@ -11031,7 +11028,7 @@ function ti({ submitEventExternal: e }) {
11031
11028
  isTestUser: q
11032
11029
  }
11033
11030
  });
11034
- }, Me = og(
11031
+ }, Me = ag(
11035
11032
  a.experimentName
11036
11033
  );
11037
11034
  if (a.enabled && !a.experimentName && !q)
@@ -11048,7 +11045,7 @@ function ti({ submitEventExternal: e }) {
11048
11045
  payload: {
11049
11046
  category: "2u",
11050
11047
  label: "xpert-chatbot",
11051
- linkCount: sg(R),
11048
+ linkCount: ug(R),
11052
11049
  apiResponseMessage: R,
11053
11050
  isTestUser: q,
11054
11051
  conversationHistoryId: ee
@@ -11135,11 +11132,11 @@ function ti({ submitEventExternal: e }) {
11135
11132
  ge(D, le);
11136
11133
  const Y = /* @__PURE__ */ new Date();
11137
11134
  De({
11138
- conversationByteSize: ug(JSON.stringify(Qe)),
11135
+ conversationByteSize: cg(JSON.stringify(Qe)),
11139
11136
  conversationSize: p.length + 2,
11140
11137
  userInputMessage: R,
11141
11138
  apiResponseMessage: D,
11142
- elapsedSeconds: lg(ee, Y)
11139
+ elapsedSeconds: sg(ee, Y)
11143
11140
  }), m((J) => [
11144
11141
  ...J,
11145
11142
  {
@@ -11295,7 +11292,7 @@ function ti({ submitEventExternal: e }) {
11295
11292
  },
11296
11293
  children: [
11297
11294
  /* @__PURE__ */ I.jsx(
11298
- ng,
11295
+ rg,
11299
11296
  {
11300
11297
  messages: p,
11301
11298
  loading: f,
@@ -11363,7 +11360,7 @@ el.propTypes = {
11363
11360
  configurations: N.object,
11364
11361
  xpertKey: N.string
11365
11362
  };
11366
- function fg({ configurations: e = {}, key: t, submitEventExternal: n, xpertKey: r }) {
11363
+ function dg({ configurations: e = {}, key: t, submitEventExternal: n, xpertKey: r }) {
11367
11364
  return /* @__PURE__ */ I.jsx(
11368
11365
  el,
11369
11366
  {
@@ -11374,14 +11371,14 @@ function fg({ configurations: e = {}, key: t, submitEventExternal: n, xpertKey:
11374
11371
  t
11375
11372
  );
11376
11373
  }
11377
- fg.propTypes = {
11374
+ dg.propTypes = {
11378
11375
  configurations: N.object,
11379
11376
  key: N.string,
11380
11377
  submitEventExternal: N.func,
11381
11378
  xpertKey: N.string.isRequired
11382
11379
  };
11383
11380
  export {
11384
- fg as Chatbot,
11381
+ dg as Chatbot,
11385
11382
  is as EDXConfig,
11386
11383
  os as EmersonSpeechConfig,
11387
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.2",
3
+ "version": "1.13.9-beta.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/2uinc/frontend-component-xpert-chatbot.git"