@telia-ace/widget-conversation 1.1.5 → 1.1.6

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