@telia-ace/widget-conversation 1.1.7-rc.0 → 1.1.7-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,70 +1,71 @@
1
1
  import { jsx as n, jsxs as u, Fragment as N } from "react/jsx-runtime";
2
2
  import i from "@emotion/styled";
3
- import { Input as oe, borderTabStyle as f, Button as I, SymbolBadge as k, useIsTabbing as se, useDispatch as Y, useProperties as C, useScroll as ae, useContainer as T, Typography as X, invertedHoverButton as $e, Html as G, List as ie, buttonCss as B, ItemList as K, itemList as E, Link as ve, useComponent as xe, genericHtml as ke, headingElement as J, usePrevious as we, list as Ce, WidgetOverlayOutlet as le, ConversationContext as Se } from "@telia-ace/widget-ui";
4
- import { appendClassNames as A, htmlParentContains as ze } from "@telia-ace/widget-utilities";
5
- import { css as b, keyframes as Le } from "@emotion/react";
6
- import Ne, { useState as P, useEffect as Q, forwardRef as Z, useContext as Me, Suspense as Ie, useRef as ce, useMemo as He, useCallback as de } from "react";
3
+ import { Input as se, borderTabStyle as f, Button as I, SymbolBadge as k, useIsTabbing as ae, useDispatch as X, useProperties as C, useScroll as ie, useContainer as T, Typography as G, invertedHoverButton as ve, Html as J, List as le, buttonCss as K, ItemList as E, itemList as j, Link as xe, useComponent as ke, genericHtml as we, headingElement as Q, usePrevious as Ce, list as Se, WidgetOverlayOutlet as ce, ConversationContext as ze } from "@telia-ace/widget-ui";
4
+ import { appendClassNames as A, htmlParentContains as Le } from "@telia-ace/widget-utilities";
5
+ import { css as b, keyframes as Ne } from "@emotion/react";
6
+ import Me, { useState as W, useEffect as Z, forwardRef as ee, useContext as Ie, Suspense as Ae, useRef as de, useMemo as He, useCallback as me } from "react";
7
7
  import { FormComponent as Te } from "@telia-ace/widget-forms";
8
- import { ConversationMessageListItemType as w, ConversationMessageType as W } from "./index.mjs";
8
+ import { ConversationMessageListItemType as w, ConversationMessageType as q } from "./index.mjs";
9
9
  import "@telia-ace/widget-core";
10
10
  import "@telia-ace/widget-services";
11
11
  import "@telia-ace/widget-plugins";
12
- const Ae = ({ className: t }) => {
13
- const [e, r] = P(""), [o, s] = P(0), [a, m] = P(0), d = se(), c = Y(), {
14
- inputPlaceholder: p = "Type your message",
12
+ const Oe = ({ className: t }) => {
13
+ const [e, o] = W(""), [s, a] = W(0), [r, m] = W(0), c = ae(), d = X(), {
14
+ inputPlaceholder: y = "Type your message",
15
15
  inputHidden: x = !1,
16
16
  inputDisabled: l = !1,
17
17
  sendButtonLabel: h = "Send message",
18
18
  inputMultiline: v = !0,
19
19
  secondaryAction: $
20
- } = C(), [z, y] = ae(!0), O = T();
21
- Q(() => {
22
- if (y.current) {
23
- const { lineHeight: g, maxHeight: L } = getComputedStyle(y.current);
20
+ } = C(), [z, p] = ie(!0), O = T();
21
+ Z(() => {
22
+ if (p.current) {
23
+ const { lineHeight: g, maxHeight: L } = getComputedStyle(p.current);
24
24
  if (g && g.indexOf("px") > -1) {
25
- const H = g.split("px"), ye = parseInt(H[0], 10);
26
- s(ye);
27
- const be = L.split("px");
28
- m(parseInt(be[0], 10));
25
+ const H = g.split("px"), be = parseInt(H[0], 10);
26
+ a(be);
27
+ const $e = L.split("px");
28
+ m(parseInt($e[0], 10));
29
29
  }
30
30
  }
31
- }, [y.current]);
31
+ }, [p.current]);
32
32
  const D = (g) => {
33
- !g.shiftKey || !v ? (g.preventDefault(), e && e.length > 0 && (c("user-submit", { text: e }), r(""), j(""))) : e.length < 1 && g.preventDefault();
34
- }, fe = (g) => {
33
+ !g.shiftKey || !v ? (g.preventDefault(), e && e.length > 0 && (d("user-submit", { text: e }), o(""), P(""))) : e.length < 1 && g.preventDefault();
34
+ }, ye = (g) => {
35
35
  if (!$)
36
36
  return;
37
- g.preventDefault(), c("action", {
37
+ g.preventDefault(), d("action", {
38
38
  actionKey: $.action,
39
39
  ...$
40
40
  });
41
41
  const { events: L } = O.get("$widget");
42
42
  L.dispatch("tracking:secondary-clicked", {});
43
43
  }, pe = (g) => {
44
- if (v && y.current) {
45
- const L = y.current.scrollHeight;
46
- if (L > o) {
47
- y.current.style.height = "auto";
44
+ if (v && p.current) {
45
+ const L = p.current.scrollHeight;
46
+ if (L > s) {
47
+ p.current.style.height = "auto";
48
48
  let H = L;
49
- g.length < 1 && (H = o), y.current.style.height = `${H}px`, H >= a ? y.current.style.overflowY = "scroll" : y.current.style.overflowY = "hidden";
49
+ g.length < 1 && (H = s), p.current.style.height = `${H}px`, H >= r ? p.current.style.overflowY = "scroll" : p.current.style.overflowY = "hidden";
50
50
  }
51
51
  }
52
- }, j = (g) => {
53
- pe(g), r(g), g && g.length > 0 && c("user-typing", { textLength: g.length });
52
+ }, P = (g) => {
53
+ pe(g), o(g), g && g.length > 0 && d("user-typing", { textLength: g.length });
54
54
  };
55
55
  return x ? null : /* @__PURE__ */ u(
56
- Ke,
56
+ Ee,
57
57
  {
58
58
  grow: v,
59
59
  className: A("humany-conversation-input", t),
60
60
  scrollableCss: z,
61
- isTabbing: d,
61
+ isTabbing: c,
62
62
  children: [
63
63
  $ && /* @__PURE__ */ n(
64
- Be,
64
+ Ke,
65
65
  {
66
+ className: "humany-secondary-button",
66
67
  disabled: l,
67
- onClick: fe,
68
+ onClick: ye,
68
69
  title: $.label,
69
70
  "aria-label": $.label,
70
71
  children: /* @__PURE__ */ n(
@@ -77,38 +78,39 @@ const Ae = ({ className: t }) => {
77
78
  }
78
79
  ),
79
80
  v ? /* @__PURE__ */ n(
80
- Oe,
81
+ Re,
81
82
  {
82
83
  value: e,
83
- onChange: j,
84
+ onChange: P,
84
85
  onEnter: D,
85
86
  disabled: l,
86
- "aria-label": p,
87
- placeholder: p,
87
+ "aria-label": y,
88
+ placeholder: y,
88
89
  type: "textarea",
89
90
  rows: 1,
90
- ref: y
91
+ ref: p
91
92
  }
92
93
  ) : /* @__PURE__ */ n(
93
- Re,
94
+ Be,
94
95
  {
95
96
  value: e,
96
- onChange: j,
97
+ onChange: P,
97
98
  onEnter: D,
98
99
  disabled: l,
99
- "aria-label": p,
100
- placeholder: p
100
+ "aria-label": y,
101
+ placeholder: y
101
102
  }
102
103
  ),
103
104
  /* @__PURE__ */ n(
104
- me,
105
+ ue,
105
106
  {
107
+ className: "humany-send-button",
106
108
  disabled: !1,
107
109
  onClick: D,
108
110
  title: h,
109
111
  "aria-label": h,
110
112
  children: /* @__PURE__ */ n(
111
- Ee,
113
+ je,
112
114
  {
113
115
  size: 22,
114
116
  symbol: { type: "Svg", content: "send" },
@@ -120,7 +122,7 @@ const Ae = ({ className: t }) => {
120
122
  ]
121
123
  }
122
124
  );
123
- }, Oe = i(oe)`
125
+ }, Re = i(se)`
124
126
  resize: none;
125
127
  flex: 1;
126
128
  flex-shrink: 1;
@@ -144,7 +146,7 @@ const Ae = ({ className: t }) => {
144
146
  ${f};
145
147
  outline-offset: 12px;
146
148
  }
147
- `, Re = i(oe)`
149
+ `, Be = i(se)`
148
150
  flex: 1;
149
151
  border: none;
150
152
  background-color: transparent;
@@ -170,7 +172,7 @@ const Ae = ({ className: t }) => {
170
172
  }};
171
173
  font-style: italic;
172
174
  }
173
- `, me = i(I)`
175
+ `, ue = i(I)`
174
176
  flex: 0 0 50px;
175
177
  align-self: stretch;
176
178
  background-color: transparent;
@@ -182,13 +184,13 @@ const Ae = ({ className: t }) => {
182
184
  &:focus-visible {
183
185
  ${f};
184
186
  }
185
- `, Be = i(me)`
187
+ `, Ke = i(ue)`
186
188
  border-right: ${(t) => t.theme.border};
187
189
  margin: ${(t) => {
188
190
  var e;
189
191
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
190
192
  }} 0;
191
- `, Ke = i.div`
193
+ `, Ee = i.div`
192
194
  ${(t) => t.grow ? b`
193
195
  min-height: 50px;
194
196
  max-height: 150px;
@@ -207,7 +209,7 @@ const Ae = ({ className: t }) => {
207
209
  textarea {
208
210
  ${(t) => !!t.scrollableCss && t.scrollableCss}
209
211
  }
210
- `, Ee = i(
212
+ `, je = i(
211
213
  ({
212
214
  hasContent: t,
213
215
  ...e
@@ -271,7 +273,7 @@ const Ae = ({ className: t }) => {
271
273
  }};
272
274
  }
273
275
  }
274
- `, je = Le`
276
+ `, Pe = Ne`
275
277
  0% {
276
278
  opacity: 0;
277
279
  }
@@ -281,7 +283,7 @@ const Ae = ({ className: t }) => {
281
283
  100% {
282
284
  opacity: 0;
283
285
  }
284
- `, Pe = i.div`
286
+ `, We = i.div`
285
287
  display: flex;
286
288
  justify-content: center;
287
289
  > div {
@@ -293,7 +295,7 @@ const Ae = ({ className: t }) => {
293
295
  var e;
294
296
  return (e = t.theme.colors) == null ? void 0 : e.text;
295
297
  }};
296
- animation: ${je} 1s infinite;
298
+ animation: ${Pe} 1s infinite;
297
299
  }
298
300
  > div:nth-of-type(2) {
299
301
  animation-delay: 100ms;
@@ -301,29 +303,29 @@ const Ae = ({ className: t }) => {
301
303
  > div:nth-of-type(3) {
302
304
  animation-delay: 200ms;
303
305
  }
304
- `, V = i.div`
306
+ `, _ = i.div`
305
307
  grid-area: content;
306
308
  max-width: 100%;
307
309
  overflow: hidden;
308
- `, We = i(X)`
310
+ `, qe = i(G)`
309
311
  font-size: ${(t) => {
310
312
  var e;
311
313
  return (e = t.theme.fonts) == null ? void 0 : e.normal;
312
314
  }};
313
315
  font-weight: normal;
314
316
  margin: 0;
315
- `, _ = i.div`
317
+ `, F = i.div`
316
318
  display: flex;
317
319
  ${(t) => t.left && "justify-content: start;"};
318
320
  ${(t) => t.center && "justify-content: center;"};
319
321
  ${(t) => t.right && "justify-content: end;"};
320
- `, F = i.div`
322
+ `, Y = i.div`
321
323
  ${(t) => {
322
324
  var e;
323
325
  return t.padded && `padding: ${(e = t.theme.sizes) == null ? void 0 : e.medium};`;
324
326
  }}
325
- ${(t) => !t.user && t.stacked && qe(t.stacked, t.theme)}
326
- ${(t) => t.user && t.stacked && Ue(t.stacked, t.theme)}
327
+ ${(t) => !t.user && t.stacked && Ue(t.stacked, t.theme)}
328
+ ${(t) => t.user && t.stacked && Ve(t.stacked, t.theme)}
327
329
 
328
330
  display: inline-block;
329
331
  margin-top: ${(t) => {
@@ -339,15 +341,15 @@ const Ae = ({ className: t }) => {
339
341
  }
340
342
  max-width: 100%;
341
343
  ${(t) => t.fullWidth && "width: 100%;"}
342
- `, qe = (t, e) => {
343
- var o, s;
344
- const r = b`
345
- background-color: ${(o = e.colors) == null ? void 0 : o.accent};
346
- color: ${(s = e.colors) == null ? void 0 : s.text};
344
+ `, Ue = (t, e) => {
345
+ var s, a;
346
+ const o = b`
347
+ background-color: ${(s = e.colors) == null ? void 0 : s.accent};
348
+ color: ${(a = e.colors) == null ? void 0 : a.text};
347
349
  ${e.border && `border: ${e.border};`};
348
350
  `;
349
351
  return e.borderRadius ? b`
350
- ${r}
352
+ ${o}
351
353
 
352
354
  border-top-right-radius: ${e.borderRadius};
353
355
  border-bottom-right-radius: ${e.borderRadius};
@@ -359,15 +361,15 @@ const Ae = ({ className: t }) => {
359
361
  ${t === "last" && `
360
362
  border-bottom-left-radius: ${e.borderRadius};
361
363
  `}
362
- ` : r;
363
- }, Ue = (t, e) => {
364
- var o, s;
365
- const r = b`
366
- background-color: ${(o = e.colors) == null ? void 0 : o.primary};
367
- color: ${(s = e.colors) == null ? void 0 : s.accent};
364
+ ` : o;
365
+ }, Ve = (t, e) => {
366
+ var s, a;
367
+ const o = b`
368
+ background-color: ${(s = e.colors) == null ? void 0 : s.primary};
369
+ color: ${(a = e.colors) == null ? void 0 : a.accent};
368
370
  `;
369
371
  return e.borderRadius ? b`
370
- ${r}
372
+ ${o}
371
373
 
372
374
  border-top-left-radius: ${e.borderRadius};
373
375
  border-bottom-left-radius: ${e.borderRadius};
@@ -379,7 +381,7 @@ const Ae = ({ className: t }) => {
379
381
  ${t === "last" && `
380
382
  border-bottom-right-radius: ${e.borderRadius};
381
383
  `}
382
- ` : r;
384
+ ` : o;
383
385
  }, R = i.div`
384
386
  margin-bottom: ${(t) => {
385
387
  var e;
@@ -389,19 +391,19 @@ const Ae = ({ className: t }) => {
389
391
  margin-bottom: 0;
390
392
  }
391
393
  `, S = (t) => {
392
- var e, r;
394
+ var e, o;
393
395
  return b`
394
396
  margin: ${(e = t.theme.sizes) == null ? void 0 : e.medium} 0;
395
- padding: 0 ${(r = t.theme.sizes) == null ? void 0 : r.medium};
397
+ padding: 0 ${(o = t.theme.sizes) == null ? void 0 : o.medium};
396
398
  `;
397
- }, Ve = i(Te)`
399
+ }, _e = i(Te)`
398
400
  & button.humany-form-component-button {
399
401
  ${(t) => {
400
- var e, r, o, s;
401
- return ((e = t.theme.colors) == null ? void 0 : e.primary) && ((r = t.theme.colors) == null ? void 0 : r.accent) && $e({
402
+ var e, o, s, a;
403
+ return ((e = t.theme.colors) == null ? void 0 : e.primary) && ((o = t.theme.colors) == null ? void 0 : o.accent) && ve({
402
404
  active: !1,
403
- primaryColor: (o = t.theme.colors) == null ? void 0 : o.primary,
404
- secondaryColor: (s = t.theme.colors) == null ? void 0 : s.accent,
405
+ primaryColor: (s = t.theme.colors) == null ? void 0 : s.primary,
406
+ secondaryColor: (a = t.theme.colors) == null ? void 0 : a.accent,
405
407
  theme: t.theme
406
408
  });
407
409
  }};
@@ -422,7 +424,7 @@ const Ae = ({ className: t }) => {
422
424
  }};
423
425
  }
424
426
  }
425
- `, _e = i(G)`
427
+ `, Fe = i(J)`
426
428
  white-space: pre-wrap;
427
429
  a {
428
430
  color: ${(t) => t.theme.colors.link};
@@ -433,7 +435,7 @@ const Ae = ({ className: t }) => {
433
435
  }};
434
436
  }
435
437
  }
436
- `, Fe = i(ie)`
438
+ `, Ye = i(le)`
437
439
  padding: 0;
438
440
  list-style: none;
439
441
  margin: 0 -${(t) => {
@@ -446,8 +448,8 @@ const Ae = ({ className: t }) => {
446
448
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
447
449
  }};
448
450
  }
449
- `, Ye = i.button`
450
- ${(t) => B(t)};
451
+ `, Xe = i.button`
452
+ ${(t) => K(t)};
451
453
  display: block;
452
454
  background-color: ${(t) => {
453
455
  var e;
@@ -459,20 +461,20 @@ const Ae = ({ className: t }) => {
459
461
  ${f}
460
462
  background-color: transparent;
461
463
  }
462
- `, te = Z(
463
- ({ boxed: t, className: e, agentData: r }, o) => /* @__PURE__ */ n(V, { ref: o, children: /* @__PURE__ */ n(_, { left: t, center: !t, children: /* @__PURE__ */ n(
464
- F,
464
+ `, ne = ee(
465
+ ({ boxed: t, className: e, agentData: o }, s) => /* @__PURE__ */ n(_, { ref: s, children: /* @__PURE__ */ n(F, { left: t, center: !t, children: /* @__PURE__ */ n(
466
+ Y,
465
467
  {
466
468
  padded: !!t,
467
469
  stacked: t ? "first" : void 0,
468
- children: /* @__PURE__ */ u(Pe, { children: [
470
+ children: /* @__PURE__ */ u(We, { children: [
469
471
  /* @__PURE__ */ n("div", {}),
470
472
  /* @__PURE__ */ n("div", {}),
471
473
  /* @__PURE__ */ n("div", {})
472
474
  ] })
473
475
  }
474
476
  ) }) })
475
- ), ue = Ne.createContext(null), Xe = i.p`
477
+ ), he = Me.createContext(null), Ge = i.p`
476
478
  && {
477
479
  font-size: ${(t) => {
478
480
  var e;
@@ -487,53 +489,53 @@ const Ae = ({ className: t }) => {
487
489
  var e;
488
490
  return (e = t.theme.colors) == null ? void 0 : e.text;
489
491
  }};
490
- `, ne = (t, e) => new Date(t).toLocaleTimeString(e || [], {
492
+ `, re = (t, e) => new Date(t).toLocaleTimeString(e || [], {
491
493
  hour: "numeric",
492
494
  minute: "2-digit"
493
495
  }), M = ({
494
496
  className: t,
495
497
  name: e,
496
- timestamp: r,
497
- ariaHidden: o = !1
498
+ timestamp: o,
499
+ ariaHidden: s = !1
498
500
  }) => {
499
- const s = Me(ue);
500
- if (!e && !r)
501
+ const a = Ie(he);
502
+ if (!e && !o)
501
503
  return null;
502
- let a = "";
503
- return e ? r ? a = `${e}: ${ne(r, s)}` : a = e : r && (a = ne(r, s)), /* @__PURE__ */ n(Xe, { "aria-hidden": o, children: a });
504
- }, he = ({
504
+ let r = "";
505
+ return e ? o ? r = `${e}: ${re(o, a)}` : r = e : o && (r = re(o, a)), /* @__PURE__ */ n(Ge, { "aria-hidden": s, children: r });
506
+ }, ge = ({
505
507
  className: t,
506
508
  children: e,
507
- sender: r,
508
- timestamp: o
509
+ sender: o,
510
+ timestamp: s
509
511
  }) => {
510
- const { avatar: s, name: a } = r, { avatarSize: m } = C();
512
+ const { avatar: a, name: r } = o, { avatarSize: m } = C();
511
513
  return /* @__PURE__ */ u(
512
- Ge,
514
+ Je,
513
515
  {
514
- hasAvatar: !!s,
516
+ hasAvatar: !!a,
515
517
  className: A(
516
518
  t,
517
519
  "humany-conversation-agent-message"
518
520
  ),
519
521
  children: [
520
- s && /* @__PURE__ */ n(De, { avatarSize: m, children: typeof s == "string" ? (
522
+ a && /* @__PURE__ */ n(De, { className: "humany-agent-avatar", avatarSize: m, children: typeof a == "string" ? (
521
523
  // eslint-disable-next-line jsx-a11y/alt-text
522
- /* @__PURE__ */ n("img", { src: s })
523
- ) : /* @__PURE__ */ n(k, { symbol: s }) }),
524
+ /* @__PURE__ */ n("img", { src: a })
525
+ ) : /* @__PURE__ */ n(k, { symbol: a }) }),
524
526
  e,
525
527
  /* @__PURE__ */ n(
526
528
  M,
527
529
  {
528
- name: a,
529
- timestamp: o,
530
+ name: r,
531
+ timestamp: s,
530
532
  ariaHidden: !0
531
533
  }
532
534
  )
533
535
  ]
534
536
  }
535
537
  );
536
- }, Ge = i.div`
538
+ }, Je = i.div`
537
539
  display: grid;
538
540
  margin-right: 10%;
539
541
  width: 90%;
@@ -550,33 +552,33 @@ const Ae = ({ className: t }) => {
550
552
  'content'
551
553
  'info';
552
554
  `};
553
- `, Je = Z(
554
- ({ className: t, children: e, timestamp: r, discrete: o, fullWidth: s }, a) => /* @__PURE__ */ n(
555
- Qe,
555
+ `, Qe = ee(
556
+ ({ className: t, children: e, timestamp: o, discrete: s, fullWidth: a }, r) => /* @__PURE__ */ n(
557
+ Ze,
556
558
  {
557
- ref: a,
559
+ ref: r,
558
560
  className: A(
559
561
  t,
560
562
  "humany-conversation-system-message"
561
563
  ),
562
- fullWidth: s,
563
- children: o ? /* @__PURE__ */ u(Ze, { className: "humany-conversation-discrete-message", children: [
564
+ fullWidth: a,
565
+ children: s ? /* @__PURE__ */ u(et, { className: "humany-conversation-discrete-message", children: [
564
566
  e,
565
- /* @__PURE__ */ n(M, { timestamp: r })
567
+ /* @__PURE__ */ n(M, { timestamp: o })
566
568
  ] }) : /* @__PURE__ */ u(N, { children: [
567
569
  e,
568
- /* @__PURE__ */ n(M, { timestamp: r })
570
+ /* @__PURE__ */ n(M, { timestamp: o })
569
571
  ] })
570
572
  }
571
573
  )
572
- ), Qe = i.div`
574
+ ), Ze = i.div`
573
575
  ${(t) => t.fullWidth && "width: 100%"};
574
576
  padding: 0 ${(t) => {
575
577
  var e;
576
578
  return (e = t.theme.sizes) == null ? void 0 : e.large;
577
579
  }};
578
580
  overflow: auto;
579
- `, Ze = i.div`
581
+ `, et = i.div`
580
582
  text-align: center;
581
583
  word-wrap: break-word;
582
584
  font-size: ${(t) => {
@@ -590,10 +592,10 @@ const Ae = ({ className: t }) => {
590
592
  > p {
591
593
  margin: 0;
592
594
  }
593
- `, et = ({ className: t, children: e, timestamp: r }) => {
594
- const { userLabel: o = "" } = C();
595
+ `, tt = ({ className: t, children: e, timestamp: o }) => {
596
+ const { userLabel: s = "" } = C();
595
597
  return /* @__PURE__ */ u(
596
- tt,
598
+ nt,
597
599
  {
598
600
  className: A(
599
601
  t,
@@ -604,68 +606,68 @@ const Ae = ({ className: t }) => {
604
606
  /* @__PURE__ */ n(
605
607
  M,
606
608
  {
607
- name: o,
608
- timestamp: r,
609
+ name: s,
610
+ timestamp: o,
609
611
  ariaHidden: !0
610
612
  }
611
613
  )
612
614
  ]
613
615
  }
614
616
  );
615
- }, tt = i.div`
617
+ }, nt = i.div`
616
618
  margin-left: 10%;
617
619
  width: 90%;
618
620
  display: flex;
619
621
  flex-direction: column;
620
622
  align-items: flex-end;
621
- `, ee = (t) => Array.isArray(t) ? t : Object.keys(t).map((e) => ({
623
+ `, te = (t) => Array.isArray(t) ? t : Object.keys(t).map((e) => ({
622
624
  label: t[e],
623
625
  actionKey: e
624
- })), nt = ({ header: t, actions: e, dispatch: r }) => {
625
- const o = T(), { events: s } = o.get("$widget");
626
+ })), rt = ({ header: t, actions: e, dispatch: o }) => {
627
+ const s = T(), { events: a } = s.get("$widget");
626
628
  return /* @__PURE__ */ n(
627
- rt,
629
+ ot,
628
630
  {
629
631
  className: "humany-conversation-button-list",
630
632
  header: t,
631
- items: ee(e),
632
- renderItem: (a) => {
633
- var d;
634
- const m = !!((d = a == null ? void 0 : a.data) != null && d.href);
633
+ items: te(e),
634
+ renderItem: (r) => {
635
+ var c;
636
+ const m = !!((c = r == null ? void 0 : r.data) != null && c.href);
635
637
  return /* @__PURE__ */ n("li", { children: m ? /* @__PURE__ */ u(
636
- ot,
638
+ st,
637
639
  {
638
640
  onClick: () => {
639
- r("action", a), s.dispatch("tracking:button-list-item-clicked", a);
641
+ o("action", r), a.dispatch("tracking:button-list-item-clicked", r);
640
642
  },
641
- href: a.data.href,
642
- target: a.data.target,
643
- "aria-label": a.label,
644
- title: a.label,
643
+ href: r.data.href,
644
+ target: r.data.target,
645
+ "aria-label": r.label,
646
+ title: r.label,
645
647
  children: [
646
- /* @__PURE__ */ n(k, { symbol: a.symbol }),
647
- a.label
648
+ /* @__PURE__ */ n(k, { symbol: r.symbol }),
649
+ r.label
648
650
  ]
649
651
  }
650
652
  ) : /* @__PURE__ */ u(
651
- st,
653
+ at,
652
654
  {
653
655
  onClick: () => {
654
- r("action", a), s.dispatch("tracking:button-list-item-clicked", a);
656
+ o("action", r), a.dispatch("tracking:button-list-item-clicked", r);
655
657
  },
656
- "aria-label": a.label,
657
- title: a.label,
658
+ "aria-label": r.label,
659
+ title: r.label,
658
660
  children: [
659
- /* @__PURE__ */ n(k, { symbol: a.symbol }),
660
- a.label
661
+ /* @__PURE__ */ n(k, { symbol: r.symbol }),
662
+ r.label
661
663
  ]
662
664
  }
663
- ) }, a.actionKey);
665
+ ) }, r.actionKey);
664
666
  }
665
667
  }
666
668
  );
667
- }, rt = i(K)`
668
- ${E}
669
+ }, ot = i(E)`
670
+ ${j}
669
671
  > ul {
670
672
  display: flex;
671
673
  flex-wrap: wrap;
@@ -678,8 +680,8 @@ const Ae = ({ className: t }) => {
678
680
  }
679
681
  }
680
682
  ${S}
681
- `, ot = i(ve)`
682
- ${B};
683
+ `, st = i(xe)`
684
+ ${K};
683
685
 
684
686
  display: block;
685
687
  padding: ${(t) => {
@@ -706,8 +708,8 @@ const Ae = ({ className: t }) => {
706
708
  return (e = t.theme.sizes) == null ? void 0 : e.small;
707
709
  }};
708
710
  }
709
- `, st = i(I)`
710
- ${B};
711
+ `, at = i(I)`
712
+ ${K};
711
713
 
712
714
  display: block;
713
715
  padding: ${(t) => {
@@ -734,13 +736,13 @@ const Ae = ({ className: t }) => {
734
736
  return (e = t.theme.sizes) == null ? void 0 : e.small;
735
737
  }};
736
738
  }
737
- `, at = ({ type: t, content: e = {} }) => {
738
- const r = xe(t);
739
- return !r || !t ? null : /* @__PURE__ */ n(Ie, { fallback: null, children: /* @__PURE__ */ n(r, { ...e }) });
740
- }, it = ({ body: t }) => /* @__PURE__ */ n(lt, { html: t }), lt = i(G)`
741
- ${ke}
739
+ `, it = ({ type: t, content: e = {} }) => {
740
+ const o = ke(t);
741
+ return !o || !t ? null : /* @__PURE__ */ n(Ae, { fallback: null, children: /* @__PURE__ */ n(o, { ...e }) });
742
+ }, lt = ({ body: t }) => /* @__PURE__ */ n(ct, { className: "humany-html", html: t }), ct = i(J)`
743
+ ${we}
742
744
  color: inherit;
743
- white-space: pre-wrap;
745
+ white-space: normal;
744
746
  ${S}
745
747
  a {
746
748
  color: ${(t) => t.theme.colors.link};
@@ -748,22 +750,25 @@ const Ae = ({ className: t }) => {
748
750
  ${f};
749
751
  }
750
752
  }
751
- `, ct = ({ header: t, actions: e, dispatch: r }) => /* @__PURE__ */ n(
752
- dt,
753
+ p {
754
+ word-break: auto-phrase;
755
+ }
756
+ `, dt = ({ header: t, actions: e, dispatch: o }) => /* @__PURE__ */ n(
757
+ mt,
753
758
  {
754
759
  className: "humany-conversation-item-list",
755
760
  header: t,
756
- items: ee(e),
757
- renderItem: (o) => {
758
- var s;
759
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(mt, { children: [
760
- ((s = o.symbol) == null ? void 0 : s.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
761
+ items: te(e),
762
+ renderItem: (s) => {
763
+ var a;
764
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(ut, { children: [
765
+ ((a = s.symbol) == null ? void 0 : a.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
761
766
  k,
762
767
  {
763
768
  size: 22,
764
769
  symbol: {
765
- type: o.symbol.type,
766
- content: o.symbol.content
770
+ type: s.symbol.type,
771
+ content: s.symbol.content
767
772
  }
768
773
  }
769
774
  ) }),
@@ -772,20 +777,20 @@ const Ae = ({ className: t }) => {
772
777
  I,
773
778
  {
774
779
  onClick: () => {
775
- r("action", o);
780
+ o("action", s);
776
781
  },
777
- "aria-label": o.label,
778
- title: o.label,
779
- children: o.label
782
+ "aria-label": s.label,
783
+ title: s.label,
784
+ children: s.label
780
785
  }
781
786
  ),
782
- o.description && /* @__PURE__ */ n("p", { children: o.description })
787
+ s.description && /* @__PURE__ */ n("p", { children: s.description })
783
788
  ] })
784
- ] }) }, o.actionKey);
789
+ ] }) }, s.actionKey);
785
790
  }
786
791
  }
787
- ), dt = i(K)`
788
- ${E}
792
+ ), mt = i(E)`
793
+ ${j}
789
794
 
790
795
  > .humany-paragraph {
791
796
  ${S}
@@ -796,7 +801,7 @@ const Ae = ({ className: t }) => {
796
801
  }
797
802
  }
798
803
 
799
- ${(t) => J(t)(
804
+ ${(t) => Q(t)(
800
805
  "h1",
801
806
  b`
802
807
  white-space: normal;
@@ -822,7 +827,7 @@ const Ae = ({ className: t }) => {
822
827
  border-bottom: none;
823
828
  }
824
829
  }
825
- `, mt = i.div`
830
+ `, ut = i.div`
826
831
  display: flex;
827
832
  gap: ${(t) => {
828
833
  var e;
@@ -871,15 +876,15 @@ const Ae = ({ className: t }) => {
871
876
  }
872
877
  }
873
878
  }
874
- `, ut = ({ header: t, actions: e, dispatch: r }) => {
875
- const o = we(e), s = ce(), a = se(), m = T(), { events: d } = m.get("$widget");
876
- return Q(() => {
877
- if (o && Array.isArray(e) && Array.isArray(o) && o.length < e.length && s.current) {
878
- const c = s.current.querySelectorAll(
879
+ `, ht = ({ header: t, actions: e, dispatch: o }) => {
880
+ const s = Ce(e), a = de(), r = ae(), m = T(), { events: c } = m.get("$widget");
881
+ return Z(() => {
882
+ if (s && Array.isArray(e) && Array.isArray(s) && s.length < e.length && a.current) {
883
+ const d = a.current.querySelectorAll(
879
884
  ".humany-conversation-link-list > ul > li"
880
- ), p = c[o.length];
881
- if (c.length === e.length && o.length) {
882
- const x = c[o.length - 1];
885
+ ), y = d[s.length];
886
+ if (d.length === e.length && s.length) {
887
+ const x = d[s.length - 1];
883
888
  if (x) {
884
889
  const l = x.querySelector(
885
890
  ".humany-button"
@@ -887,16 +892,16 @@ const Ae = ({ className: t }) => {
887
892
  l && l.focus();
888
893
  }
889
894
  } else
890
- p && new MutationObserver((l, h) => {
895
+ y && new MutationObserver((l, h) => {
891
896
  l.forEach((v) => {
892
897
  if (v.addedNodes) {
893
898
  const $ = Array.from(
894
899
  v.addedNodes
895
900
  ).find((z) => z.tagName === "BUTTON");
896
- $ && ze(s.current, document.activeElement) && (a && $.focus(), h.disconnect());
901
+ $ && Le(a.current, document.activeElement) && (r && $.focus(), h.disconnect());
897
902
  }
898
903
  });
899
- }).observe(p, {
904
+ }).observe(y, {
900
905
  attributes: !1,
901
906
  characterData: !1,
902
907
  childList: !0,
@@ -906,24 +911,24 @@ const Ae = ({ className: t }) => {
906
911
  });
907
912
  }
908
913
  }), /* @__PURE__ */ n(
909
- ht,
914
+ gt,
910
915
  {
911
- ref: s,
916
+ ref: a,
912
917
  className: "humany-conversation-link-list",
913
918
  header: t,
914
- items: ee(e),
915
- renderItem: (c) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(
916
- gt,
919
+ items: te(e),
920
+ renderItem: (d) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(
921
+ ft,
917
922
  {
918
- help: c.actionKey === "help",
923
+ help: d.actionKey === "help",
919
924
  onClick: () => {
920
- r("action", c), d.dispatch("tracking:link-list-item-clicked", c);
925
+ o("action", d), c.dispatch("tracking:link-list-item-clicked", d);
921
926
  },
922
- "aria-label": c.label,
923
- title: c.label,
927
+ "aria-label": d.label,
928
+ title: d.label,
924
929
  children: [
925
- c.label,
926
- c.actionKey === "help" && /* @__PURE__ */ n(
930
+ d.label,
931
+ d.actionKey === "help" && /* @__PURE__ */ n(
927
932
  k,
928
933
  {
929
934
  size: 14,
@@ -935,14 +940,14 @@ const Ae = ({ className: t }) => {
935
940
  )
936
941
  ]
937
942
  }
938
- ) }, c.actionKey)
943
+ ) }, d.actionKey)
939
944
  }
940
945
  );
941
- }, ht = i(K)`
942
- ${E}
946
+ }, gt = i(E)`
947
+ ${j}
943
948
  ${S}
944
949
 
945
- ${(t) => J(t)(
950
+ ${(t) => Q(t)(
946
951
  "h1",
947
952
  b`
948
953
  white-space: normal;
@@ -960,7 +965,7 @@ const Ae = ({ className: t }) => {
960
965
  margin: 0;
961
966
  }
962
967
  }
963
- `, gt = i(I)`
968
+ `, ft = i(I)`
964
969
  display: block;
965
970
  text-align: left;
966
971
  font-weight: 300;
@@ -973,14 +978,14 @@ const Ae = ({ className: t }) => {
973
978
  overflow: hidden;
974
979
 
975
980
  ${(t) => {
976
- var e, r;
981
+ var e, o;
977
982
  return t.help && b`
978
983
  color: ${(e = t.theme.colors) == null ? void 0 : e.text};
979
984
  text-decoration: underline;
980
985
 
981
986
  i,
982
987
  svg {
983
- margin-left: ${(r = t.theme.sizes) == null ? void 0 : r.small};
988
+ margin-left: ${(o = t.theme.sizes) == null ? void 0 : o.small};
984
989
  }
985
990
  `;
986
991
  }}
@@ -995,18 +1000,18 @@ const Ae = ({ className: t }) => {
995
1000
  text-decoration: underline;
996
1001
  }
997
1002
  }
998
- `, ft = () => /* @__PURE__ */ n(pt, { className: "humany-conversation-separator" }), pt = i.div`
1003
+ `, yt = () => /* @__PURE__ */ n(pt, { className: "humany-conversation-separator" }), pt = i.div`
999
1004
  ${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
1000
1005
  width: 100%;
1001
- `, yt = ({ text: t }) => /* @__PURE__ */ n(bt, { className: "humany-conversation-text", variant: "span", children: t }), bt = i(X)`
1006
+ `, bt = ({ text: t }) => /* @__PURE__ */ n($t, { className: "humany-conversation-text", variant: "span", children: t }), $t = i(G)`
1002
1007
  ${S}
1003
- `, $t = ({
1008
+ `, vt = ({
1004
1009
  header: t = "Video call",
1005
1010
  acceptLabel: e = "Accept",
1006
- declineLabel: r = "Decline",
1007
- dispatch: o
1011
+ declineLabel: o = "Decline",
1012
+ dispatch: s
1008
1013
  }) => {
1009
- const s = He(() => [
1014
+ const a = He(() => [
1010
1015
  {
1011
1016
  label: e,
1012
1017
  actionKey: "accept-video-call",
@@ -1016,39 +1021,39 @@ const Ae = ({ className: t }) => {
1016
1021
  }
1017
1022
  },
1018
1023
  {
1019
- label: r,
1024
+ label: o,
1020
1025
  actionKey: "decline-video-call",
1021
1026
  symbol: {
1022
1027
  type: "Svg",
1023
1028
  content: "close"
1024
1029
  }
1025
1030
  }
1026
- ], [e, r]);
1031
+ ], [e, o]);
1027
1032
  return /* @__PURE__ */ n(
1028
- vt,
1033
+ xt,
1029
1034
  {
1030
1035
  className: "humany-conversation-video-request",
1031
1036
  header: t,
1032
- items: s,
1033
- renderItem: (a) => {
1034
- const m = a.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
1037
+ items: a,
1038
+ renderItem: (r) => {
1039
+ const m = r.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
1035
1040
  return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1036
- xt,
1041
+ kt,
1037
1042
  {
1038
1043
  onClick: () => {
1039
- o("action", a);
1044
+ s("action", r);
1040
1045
  },
1041
- "aria-label": a.label,
1042
- title: a.label,
1046
+ "aria-label": r.label,
1047
+ title: r.label,
1043
1048
  bgColor: m,
1044
- children: /* @__PURE__ */ n(k, { symbol: a.symbol, size: 25 })
1049
+ children: /* @__PURE__ */ n(k, { symbol: r.symbol, size: 25 })
1045
1050
  }
1046
- ) }, a.actionKey);
1051
+ ) }, r.actionKey);
1047
1052
  }
1048
1053
  }
1049
1054
  );
1050
- }, vt = i(K)`
1051
- ${(t) => E(t)}
1055
+ }, xt = i(E)`
1056
+ ${(t) => j(t)}
1052
1057
  > ul {
1053
1058
  display: flex;
1054
1059
  flex-wrap: wrap;
@@ -1061,8 +1066,8 @@ const Ae = ({ className: t }) => {
1061
1066
  }
1062
1067
  }
1063
1068
  ${(t) => S(t)}
1064
- `, xt = i(I)`
1065
- ${B};
1069
+ `, kt = i(I)`
1070
+ ${K};
1066
1071
 
1067
1072
  background-color: ${(t) => t.bgColor};
1068
1073
  display: flex;
@@ -1101,78 +1106,91 @@ const Ae = ({ className: t }) => {
1101
1106
  stroke: #fff;
1102
1107
  }
1103
1108
  }
1104
- `, kt = ([t, e]) => ({ type: t, content: e }), wt = ({ items: t, dispatch: e }) => /* @__PURE__ */ n(
1105
- Ct,
1106
- {
1107
- role: "none",
1108
- className: "humany-message-list",
1109
- items: t.map(kt),
1110
- renderLi: !0,
1111
- renderItem: (r) => {
1112
- switch (r.type) {
1113
- case w.Text:
1114
- return /* @__PURE__ */ n(yt, { text: r.content });
1115
- case w.HTML:
1116
- return /* @__PURE__ */ n(it, { ...r.content });
1117
- case w.Separator:
1118
- return /* @__PURE__ */ n(ft, { ...r.content });
1119
- case w.ItemList:
1120
- return /* @__PURE__ */ n(ct, { ...r.content, dispatch: e });
1121
- case w.LinkList:
1122
- return /* @__PURE__ */ n(ut, { ...r.content, dispatch: e });
1123
- case w.ButtonList:
1124
- return /* @__PURE__ */ n(nt, { ...r.content, dispatch: e });
1125
- case w.VideoRequest:
1126
- return /* @__PURE__ */ n($t, { ...r.content, dispatch: e });
1127
- default:
1128
- return /* @__PURE__ */ n(at, { type: r.type, content: r.content });
1109
+ `, B = ([t, e]) => ({ type: t, content: e }), wt = ({ items: t, dispatch: e }) => {
1110
+ const o = t.map(B).filter((r) => r.type.includes("ace-knowledge")).map((r) => "humany-" + r.type.toString());
1111
+ return !!t.map(B).filter((r) => {
1112
+ const m = r == null ? void 0 : r.content, c = m == null ? void 0 : m.actions;
1113
+ return !!(c != null && c.filter((d) => d.actionKey === "contact").length);
1114
+ }).length && o.push("humany-secondary-action-list"), !!t.map(B).filter((r) => {
1115
+ var c;
1116
+ const m = r == null ? void 0 : r.content;
1117
+ return !!((c = m == null ? void 0 : m.tags) != null && c.includes("category"));
1118
+ }).length && o.push("humany-category-list"), /* @__PURE__ */ n(
1119
+ Ct,
1120
+ {
1121
+ role: "none",
1122
+ className: A(
1123
+ "humany-message-list",
1124
+ o.join(" ")
1125
+ ),
1126
+ items: t.map(B),
1127
+ renderLi: !0,
1128
+ renderItem: (r) => {
1129
+ switch (r.type) {
1130
+ case w.Text:
1131
+ return /* @__PURE__ */ n(bt, { text: r.content });
1132
+ case w.HTML:
1133
+ return /* @__PURE__ */ n(lt, { ...r.content });
1134
+ case w.Separator:
1135
+ return /* @__PURE__ */ n(yt, { ...r.content });
1136
+ case w.ItemList:
1137
+ return /* @__PURE__ */ n(dt, { ...r.content, dispatch: e });
1138
+ case w.LinkList:
1139
+ return /* @__PURE__ */ n(ht, { ...r.content, dispatch: e });
1140
+ case w.ButtonList:
1141
+ return /* @__PURE__ */ n(rt, { ...r.content, dispatch: e });
1142
+ case w.VideoRequest:
1143
+ return /* @__PURE__ */ n(vt, { ...r.content, dispatch: e });
1144
+ default:
1145
+ return /* @__PURE__ */ n(it, { type: r.type, content: r.content });
1146
+ }
1129
1147
  }
1130
1148
  }
1131
- }
1132
- ), Ct = i(ie)`
1133
- ${Ce}
1149
+ );
1150
+ }, Ct = i(le)`
1151
+ ${Se}
1134
1152
 
1135
1153
  > li {
1136
1154
  margin: 0;
1137
1155
  }
1138
- `, St = Z(
1139
- ({ className: t, timestamp: e, sender: r, type: o, content: s }, a) => {
1140
- const m = de(
1156
+ `, St = ee(
1157
+ ({ className: t, timestamp: e, sender: o, type: s, content: a }, r) => {
1158
+ const m = me(
1141
1159
  (l) => {
1142
1160
  let h = "first";
1143
- return s.length > 1 && (h = l === 0 ? "first" : l + 1 === s.length ? "last" : "middle"), h;
1161
+ return a.length > 1 && (h = l === 0 ? "first" : l + 1 === a.length ? "last" : "middle"), h;
1144
1162
  },
1145
- [s]
1146
- ), { userLabel: d = "" } = C(), c = () => /* @__PURE__ */ n(N, { children: s.map((l) => {
1147
- const { key: h, body: v, title: $, form: z, actions: y } = l, O = !!v && !$ && !z && !y;
1163
+ [a]
1164
+ ), { userLabel: c = "" } = C(), d = () => /* @__PURE__ */ n(N, { children: a.map((l) => {
1165
+ const { key: h, body: v, title: $, form: z, actions: p } = l, O = !!v && !$ && !z && !p;
1148
1166
  return /* @__PURE__ */ n(
1149
- Je,
1167
+ Qe,
1150
1168
  {
1151
1169
  className: t,
1152
1170
  discrete: O,
1153
- ref: a,
1171
+ ref: r,
1154
1172
  timestamp: e,
1155
- fullWidth: !!z || !!y,
1156
- children: O && v ? /* @__PURE__ */ n(G, { html: v }) : /* @__PURE__ */ n(q, { isSystem: !0, content: l })
1173
+ fullWidth: !!z || !!p,
1174
+ children: O && v ? /* @__PURE__ */ n(J, { html: v }) : /* @__PURE__ */ n(U, { isSystem: !0, content: l })
1157
1175
  },
1158
1176
  h
1159
1177
  );
1160
- }) }), p = () => /* @__PURE__ */ u(N, { children: [
1161
- /* @__PURE__ */ n(re, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: r == null ? void 0 : r.name, timestamp: e }) }),
1178
+ }) }), y = () => /* @__PURE__ */ u(N, { children: [
1179
+ /* @__PURE__ */ n(oe, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: o == null ? void 0 : o.name, timestamp: e }) }),
1162
1180
  /* @__PURE__ */ n(
1163
- he,
1181
+ ge,
1164
1182
  {
1165
- sender: r,
1183
+ sender: o,
1166
1184
  timestamp: e,
1167
1185
  className: t,
1168
- children: /* @__PURE__ */ n(V, { className: "humany-message-content-bundle", children: s.map((l, h) => /* @__PURE__ */ n(
1169
- _,
1186
+ children: /* @__PURE__ */ n(_, { className: "humany-message-content-bundle", children: a.map((l, h) => /* @__PURE__ */ n(
1187
+ F,
1170
1188
  {
1171
1189
  className: "humany-message-container",
1172
1190
  left: !0,
1173
- ref: a,
1191
+ ref: r,
1174
1192
  children: /* @__PURE__ */ n(
1175
- q,
1193
+ U,
1176
1194
  {
1177
1195
  content: l,
1178
1196
  stacked: m(h)
@@ -1184,15 +1202,15 @@ const Ae = ({ className: t }) => {
1184
1202
  }
1185
1203
  )
1186
1204
  ] }), x = () => /* @__PURE__ */ u(N, { children: [
1187
- /* @__PURE__ */ n(re, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: d, timestamp: e }) }),
1188
- /* @__PURE__ */ n(et, { timestamp: e, className: t, children: /* @__PURE__ */ n(V, { className: "humany-message-content-bundle", children: s.map((l, h) => /* @__PURE__ */ n(
1189
- _,
1205
+ /* @__PURE__ */ n(oe, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: c, timestamp: e }) }),
1206
+ /* @__PURE__ */ n(tt, { timestamp: e, className: t, children: /* @__PURE__ */ n(_, { className: "humany-message-content-bundle", children: a.map((l, h) => /* @__PURE__ */ n(
1207
+ F,
1190
1208
  {
1191
1209
  className: "humany-message-container",
1192
1210
  right: !0,
1193
- ref: a,
1211
+ ref: r,
1194
1212
  children: /* @__PURE__ */ n(
1195
- q,
1213
+ U,
1196
1214
  {
1197
1215
  isUser: !0,
1198
1216
  content: l,
@@ -1203,65 +1221,65 @@ const Ae = ({ className: t }) => {
1203
1221
  l.key
1204
1222
  )) }) })
1205
1223
  ] });
1206
- switch (o) {
1207
- case W.System:
1208
- return c();
1209
- case W.Agent:
1210
- return p();
1211
- case W.User:
1224
+ switch (s) {
1225
+ case q.System:
1226
+ return d();
1227
+ case q.Agent:
1228
+ return y();
1229
+ case q.User:
1212
1230
  return x();
1213
1231
  default:
1214
1232
  return null;
1215
1233
  }
1216
1234
  }
1217
- ), q = ({
1235
+ ), U = ({
1218
1236
  content: t,
1219
1237
  isUser: e,
1220
- isSystem: r,
1221
- stacked: o
1238
+ isSystem: o,
1239
+ stacked: s
1222
1240
  }) => {
1223
- const s = Y(), { title: a, body: m, actions: d, form: c, items: p } = t;
1224
- return p ? /* @__PURE__ */ n(
1225
- F,
1241
+ const a = X(), { title: r, body: m, actions: c, form: d, items: y } = t;
1242
+ return y ? /* @__PURE__ */ n(
1243
+ Y,
1226
1244
  {
1227
1245
  className: "humany-message-content",
1228
1246
  user: !!e,
1229
- stacked: o,
1230
- children: /* @__PURE__ */ n(wt, { items: p, dispatch: s })
1247
+ stacked: s,
1248
+ children: /* @__PURE__ */ n(wt, { items: y, dispatch: a })
1231
1249
  }
1232
1250
  ) : /* @__PURE__ */ u(
1233
- F,
1251
+ Y,
1234
1252
  {
1235
1253
  className: "humany-message-content",
1236
- padded: !r,
1254
+ padded: !o,
1237
1255
  user: !!e,
1238
- stacked: o,
1239
- fullWidth: !!c || !!d,
1256
+ stacked: s,
1257
+ fullWidth: !!d || !!c,
1240
1258
  children: [
1241
- a && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(We, { variant: "h2", children: a }) }),
1242
- m && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(_e, { html: m }) }),
1243
- c && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1244
- Ve,
1259
+ r && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(qe, { variant: "h2", children: r }) }),
1260
+ m && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(Fe, { html: m }) }),
1261
+ d && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1262
+ _e,
1245
1263
  {
1246
- ...c,
1264
+ ...d,
1247
1265
  onChange: (l, h) => {
1248
- s("form", {
1266
+ a("form", {
1249
1267
  data: h,
1250
- formKey: c.schema.id,
1268
+ formKey: d.schema.id,
1251
1269
  actionKey: l
1252
1270
  });
1253
1271
  }
1254
1272
  }
1255
1273
  ) }),
1256
- d && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1257
- Fe,
1274
+ c && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1275
+ Ye,
1258
1276
  {
1259
- items: Object.keys(d).map((l) => ({ label: d[l], actionKey: l })),
1277
+ items: Object.keys(c).map((l) => ({ label: c[l], actionKey: l })),
1260
1278
  renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1261
- Ye,
1279
+ Xe,
1262
1280
  {
1263
1281
  onClick: () => {
1264
- s("action", l.actionKey);
1282
+ a("action", l.actionKey);
1265
1283
  },
1266
1284
  children: l.label
1267
1285
  }
@@ -1271,7 +1289,7 @@ const Ae = ({ className: t }) => {
1271
1289
  ]
1272
1290
  }
1273
1291
  );
1274
- }, re = i.div`
1292
+ }, oe = i.div`
1275
1293
  position: absolute !important;
1276
1294
  height: 1px;
1277
1295
  width: 1px;
@@ -1281,23 +1299,23 @@ const Ae = ({ className: t }) => {
1281
1299
  left: -10000000px;
1282
1300
  top: auto;
1283
1301
  `, zt = () => {
1284
- const { skipToLatestMessageLabel: t = "Skip to latest message" } = C(), e = T(), r = () => {
1285
- const o = e.get("widgetDOMElement");
1286
- if (o) {
1287
- const s = o.querySelectorAll(
1302
+ const { skipToLatestMessageLabel: t = "Skip to latest message" } = C(), e = T(), o = () => {
1303
+ const s = e.get("widgetDOMElement");
1304
+ if (s) {
1305
+ const a = s.querySelectorAll(
1288
1306
  ".humany-conversation-entry"
1289
1307
  );
1290
- s.length && s[s.length - 1].focus();
1308
+ a.length && a[a.length - 1].focus();
1291
1309
  }
1292
1310
  };
1293
1311
  return /* @__PURE__ */ n(
1294
1312
  Lt,
1295
1313
  {
1296
1314
  className: "humany-skip-to-latest-message",
1297
- onKeyDown: (o) => {
1298
- (o.key === "Enter" || o.keyCode === 13) && r();
1315
+ onKeyDown: (s) => {
1316
+ (s.key === "Enter" || s.keyCode === 13) && o();
1299
1317
  },
1300
- onClick: r,
1318
+ onClick: o,
1301
1319
  children: t
1302
1320
  }
1303
1321
  );
@@ -1321,50 +1339,50 @@ const Ae = ({ className: t }) => {
1321
1339
  transform: translateX(-50%);
1322
1340
  ${f};
1323
1341
  }
1324
- `, ge = () => {
1325
- const t = de((d) => {
1326
- d && setTimeout(() => {
1327
- d.scrollIntoView({
1342
+ `, fe = () => {
1343
+ const t = me((c) => {
1344
+ c && setTimeout(() => {
1345
+ c.scrollIntoView({
1328
1346
  block: "start",
1329
1347
  behavior: "smooth"
1330
1348
  });
1331
1349
  }, 250);
1332
- }, []), [e, r] = ae(!0), {
1333
- messages: o,
1334
- loading: s,
1335
- typingActors: a = []
1336
- } = C(), m = () => a && a.length ? a.map((d, c) => /* @__PURE__ */ n(
1337
- U,
1350
+ }, []), [e, o] = ie(!0), {
1351
+ messages: s,
1352
+ loading: a,
1353
+ typingActors: r = []
1354
+ } = C(), m = () => r && r.length ? r.map((c, d) => /* @__PURE__ */ n(
1355
+ V,
1338
1356
  {
1339
- id: `typing_${d.name}`,
1340
- children: /* @__PURE__ */ n(he, { timestamp: Date.now(), sender: d, children: /* @__PURE__ */ n(
1341
- te,
1357
+ id: `typing_${c.name}`,
1358
+ children: /* @__PURE__ */ n(ge, { timestamp: Date.now(), sender: c, children: /* @__PURE__ */ n(
1359
+ ne,
1342
1360
  {
1343
1361
  boxed: !0,
1344
1362
  ref: t
1345
1363
  }
1346
1364
  ) })
1347
1365
  },
1348
- `typing_${d.name}`
1366
+ `typing_${c.name}`
1349
1367
  )) : null;
1350
1368
  return /* @__PURE__ */ u(N, { children: [
1351
- /* @__PURE__ */ u(Nt, { tabIndex: 0, scrollableCss: e, ref: r, children: [
1352
- o && o.length ? o.map((d, c) => {
1353
- const { type: p, timestamp: x, sender: l, content: h } = d;
1369
+ /* @__PURE__ */ u(Nt, { tabIndex: 0, scrollableCss: e, ref: o, children: [
1370
+ s && s.length ? s.map((c, d) => {
1371
+ const { type: y, timestamp: x, sender: l, content: h } = c;
1354
1372
  return /* @__PURE__ */ n(
1355
- U,
1373
+ V,
1356
1374
  {
1357
1375
  className: "humany-conversation-entry",
1358
1376
  tabIndex: -1,
1359
- children: /* @__PURE__ */ n(St, { ...d, ref: t })
1377
+ children: /* @__PURE__ */ n(St, { ...c, ref: t })
1360
1378
  },
1361
- `${p}_${l == null ? void 0 : l.name}_${x}_${h[0].key}`
1379
+ `${y}_${l == null ? void 0 : l.name}_${x}_${h[0].key}`
1362
1380
  );
1363
1381
  }) : null,
1364
1382
  m(),
1365
- s && /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(te, { ref: t }) })
1383
+ a && /* @__PURE__ */ n(V, { children: /* @__PURE__ */ n(ne, { ref: t }) })
1366
1384
  ] }),
1367
- /* @__PURE__ */ n(Ae, {}),
1385
+ /* @__PURE__ */ n(Oe, {}),
1368
1386
  /* @__PURE__ */ n(zt, {})
1369
1387
  ] });
1370
1388
  }, Nt = i.div`
@@ -1380,7 +1398,7 @@ const Ae = ({ className: t }) => {
1380
1398
  &:focus-visible {
1381
1399
  ${(t) => f(t)};
1382
1400
  }
1383
- `, U = i.div`
1401
+ `, V = i.div`
1384
1402
  margin: 0;
1385
1403
  margin-bottom: ${(t) => {
1386
1404
  var e;
@@ -1420,18 +1438,18 @@ const Ae = ({ className: t }) => {
1420
1438
  return (e = t.theme.sizes) == null ? void 0 : e.small;
1421
1439
  }};
1422
1440
  }
1423
- ${(t) => J(t)(
1441
+ ${(t) => Q(t)(
1424
1442
  "h1",
1425
1443
  b`
1426
1444
  font-weight: normal;
1427
1445
  `
1428
1446
  )}
1429
1447
  `, Mt = ({ dispatch: t }) => {
1430
- const e = ce(null);
1431
- return Q(() => {
1448
+ const e = de(null);
1449
+ return Z(() => {
1432
1450
  e.current && e.current.parentNode && t("overlay-mounted", e.current);
1433
1451
  }, [e]), /* @__PURE__ */ n(
1434
- le,
1452
+ ce,
1435
1453
  {
1436
1454
  portalId: "humany-conversation-overlay-portal",
1437
1455
  className: "humany-conversation-overlay-outlet",
@@ -1441,20 +1459,20 @@ const Ae = ({ className: t }) => {
1441
1459
  }, It = ({
1442
1460
  dispatch: t,
1443
1461
  header: e,
1444
- buttonLabel: r
1462
+ buttonLabel: o
1445
1463
  }) => /* @__PURE__ */ u(
1446
- Ht,
1464
+ At,
1447
1465
  {
1448
1466
  portalId: "humany-conversation-portal",
1449
1467
  className: "humany-conversation-outlet",
1450
1468
  children: [
1451
- /* @__PURE__ */ u(Tt, { className: "humany-conversation-outlet-head", children: [
1469
+ /* @__PURE__ */ u(Ht, { className: "humany-conversation-outlet-head", children: [
1452
1470
  /* @__PURE__ */ n(
1453
1471
  Ot,
1454
1472
  {
1455
1473
  className: "humany-conversation-outlet-head-button",
1456
- "aria-label": r,
1457
- title: r,
1474
+ "aria-label": o,
1475
+ title: o,
1458
1476
  onClick: () => t("hide-overlay-conversation"),
1459
1477
  children: /* @__PURE__ */ n(
1460
1478
  k,
@@ -1469,7 +1487,7 @@ const Ae = ({ className: t }) => {
1469
1487
  }
1470
1488
  ),
1471
1489
  e && /* @__PURE__ */ n(
1472
- At,
1490
+ Tt,
1473
1491
  {
1474
1492
  className: "humany-conversation-outlet-header",
1475
1493
  variant: "h1",
@@ -1477,10 +1495,10 @@ const Ae = ({ className: t }) => {
1477
1495
  }
1478
1496
  )
1479
1497
  ] }),
1480
- /* @__PURE__ */ n(ge, {})
1498
+ /* @__PURE__ */ n(fe, {})
1481
1499
  ]
1482
1500
  }
1483
- ), Ht = i(le)`
1501
+ ), At = i(ce)`
1484
1502
  z-index: 11;
1485
1503
  top: auto;
1486
1504
  height: 65%;
@@ -1495,7 +1513,7 @@ const Ae = ({ className: t }) => {
1495
1513
  var e;
1496
1514
  return (e = t.theme.sizes) == null ? void 0 : e.large;
1497
1515
  }};
1498
- `, Tt = i.div`
1516
+ `, Ht = i.div`
1499
1517
  display: flex;
1500
1518
  flex-direction: column;
1501
1519
  justify-content: center;
@@ -1509,7 +1527,7 @@ const Ae = ({ className: t }) => {
1509
1527
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
1510
1528
  }};
1511
1529
  ${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
1512
- `, At = i(X)`
1530
+ `, Tt = i(G)`
1513
1531
  font-size: ${(t) => {
1514
1532
  var e;
1515
1533
  return (e = t.theme.fonts) == null ? void 0 : e.medium;
@@ -1544,16 +1562,16 @@ const Ae = ({ className: t }) => {
1544
1562
  }
1545
1563
  `, Ft = ({ className: t, ...e }) => {
1546
1564
  const {
1547
- overlay: r,
1548
- overlayConversationHeader: o,
1549
- overlayConversationCloseLabel: s,
1550
- conversationControllerId: a
1551
- } = C(), m = Y(), c = T().get("$settings");
1565
+ overlay: o,
1566
+ overlayConversationHeader: s,
1567
+ overlayConversationCloseLabel: a,
1568
+ conversationControllerId: r
1569
+ } = C(), m = X(), d = T().get("$settings");
1552
1570
  return /* @__PURE__ */ n(
1553
- Se.Provider,
1571
+ ze.Provider,
1554
1572
  {
1555
- value: a ? { id: a } : null,
1556
- children: /* @__PURE__ */ u(ue.Provider, { value: c == null ? void 0 : c.language, children: [
1573
+ value: r ? { id: r } : null,
1574
+ children: /* @__PURE__ */ u(he.Provider, { value: d == null ? void 0 : d.language, children: [
1557
1575
  /* @__PURE__ */ n(
1558
1576
  Rt,
1559
1577
  {
@@ -1563,17 +1581,17 @@ const Ae = ({ className: t }) => {
1563
1581
  t,
1564
1582
  "humany-conversation-component"
1565
1583
  ),
1566
- children: /* @__PURE__ */ n(ge, {})
1584
+ children: /* @__PURE__ */ n(fe, {})
1567
1585
  }
1568
1586
  ),
1569
- r && /* @__PURE__ */ u(N, { children: [
1587
+ o && /* @__PURE__ */ u(N, { children: [
1570
1588
  /* @__PURE__ */ n(Mt, { dispatch: m }),
1571
- r.conversation && /* @__PURE__ */ n(
1589
+ o.conversation && /* @__PURE__ */ n(
1572
1590
  It,
1573
1591
  {
1574
1592
  dispatch: m,
1575
- header: o,
1576
- buttonLabel: s
1593
+ header: s,
1594
+ buttonLabel: a
1577
1595
  }
1578
1596
  )
1579
1597
  ] })