@telia-ace/widget-conversation 1.1.1-rc.2 → 1.1.1-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,102 +1,74 @@
1
- import { jsx as n, jsxs as h, Fragment as B } from "react/jsx-runtime";
2
- import a from "@emotion/styled";
3
- import { css as f, keyframes as fe } from "@emotion/react";
4
- import { u as pe, a as ye, I as ne, B as L, b as y, S as x, c as N, d as oe, e as T, T as q, F as be, i as $e, H as Y, L as re, f as G, g as K, h as j, j as ve, k as J, l as xe, C as k, m as W, W as se, n as we } from "./index-4649598b.mjs";
5
- import { useState as z, useEffect as O, forwardRef as Q, Suspense as ke, useMemo as Ce, useCallback as ae, useRef as Se } from "react";
6
- import "react-dom";
7
- import "react-transition-group";
8
- import { u as ze, a as X } from "./use-dispatch-f89f5e06.mjs";
9
- import "react-router-dom";
10
- const Le = (e, t) => {
11
- const o = ze(), r = pe(), [s, i] = z(void 0), m = ye(), c = e || o.type || "";
12
- return O(() => {
13
- if (c) {
14
- let g;
15
- return (t || r).getAsync("componentResolver").then((p) => {
16
- if (m.current) {
17
- const d = p.getComponent(c);
18
- i(d);
19
- }
20
- g = p.registerResolver(c, (d) => {
21
- m.current && i(d);
22
- });
23
- }), () => {
24
- g && g();
25
- };
26
- }
27
- }, [m, c, t, r]), s;
28
- }, Ie = () => {
29
- const [e, t] = z(!1);
30
- return O(() => {
31
- const o = () => {
32
- t(!1);
33
- }, r = (s) => {
34
- s.keyCode === 9 && t(!0);
35
- };
36
- return window.addEventListener("keydown", r), window.addEventListener("click", o), () => {
37
- window.removeEventListener("keydown", r), window.removeEventListener("click", o);
38
- };
39
- }, []), e;
40
- }, Me = ({ className: e }) => {
41
- const [t, o] = z(""), [r, s] = z(!1), [i, m] = z(0), [c, g] = z(0), p = Ie(), d = X(), {
1
+ import { jsx as n, jsxs as m, Fragment as R } from "react/jsx-runtime";
2
+ import s from "@emotion/styled";
3
+ import { Input as te, Button as z, borderTabStyle as f, SymbolBadge as v, useIsTabbing as fe, useDispatch as q, useProperties as I, useScroll as ne, Typography as Y, invertedHoverButton as pe, Html as G, List as re, buttonCss as K, ItemList as j, itemList as O, Link as ye, useComponent as be, genericHtml as $e, headingElement as J, list as ve, WidgetOverlayOutlet as oe, ConversationContext as xe } from "@telia-ace/widget-ui";
4
+ import { appendClassNames as M } from "@telia-ace/widget-utilities";
5
+ import { css as g, keyframes as we } from "@emotion/react";
6
+ import { useState as T, useEffect as se, forwardRef as Q, Suspense as ke, useMemo as Ce, useCallback as ae, useRef as Se } from "react";
7
+ import { FormComponent as ze } from "@telia-ace/widget-forms";
8
+ import { ConversationMessageListItemType as k, ConversationMessageType as E } from "./index.mjs";
9
+ import "@telia-ace/widget-core";
10
+ import "@telia-ace/widget-services";
11
+ import "@telia-ace/widget-plugins";
12
+ const Le = ({ className: e }) => {
13
+ const [t, o] = T(""), [r, a] = T(!1), [i, u] = T(0), [c, p] = T(0), x = fe(), d = q(), {
42
14
  inputPlaceholder: l = "Type your message",
43
- inputHidden: v = !1,
15
+ inputHidden: $ = !1,
44
16
  inputDisabled: S = !1,
45
- sendButtonLabel: I = "Send message",
17
+ sendButtonLabel: L = "Send message",
46
18
  inputMultiline: w = !0,
47
- secondaryAction: b
48
- } = N(), [de, $] = oe(!0);
49
- O(() => {
50
- if ($.current) {
51
- const { lineHeight: u, maxHeight: H } = getComputedStyle($.current);
52
- if (u && u.indexOf("px") > -1) {
53
- const M = u.split("px"), he = parseInt(M[0], 10);
54
- m(he);
19
+ secondaryAction: y
20
+ } = I(), [de, b] = ne(!0);
21
+ se(() => {
22
+ if (b.current) {
23
+ const { lineHeight: h, maxHeight: H } = getComputedStyle(b.current);
24
+ if (h && h.indexOf("px") > -1) {
25
+ const N = h.split("px"), ue = parseInt(N[0], 10);
26
+ u(ue);
55
27
  const ge = H.split("px");
56
- g(parseInt(ge[0], 10));
28
+ p(parseInt(ge[0], 10));
57
29
  }
58
30
  }
59
- }, [$.current]);
60
- const E = (u) => {
61
- !u.shiftKey || !w ? (u.preventDefault(), t && t.length > 0 && (d("user-submit", { text: t }), o(""), D(""))) : t.length < 1 && u.preventDefault();
62
- }, me = (u) => {
63
- b && (u.preventDefault(), d("action", {
64
- actionKey: b.action,
65
- ...b
31
+ }, [b.current]);
32
+ const D = (h) => {
33
+ !h.shiftKey || !w ? (h.preventDefault(), t && t.length > 0 && (d("user-submit", { text: t }), o(""), W(""))) : t.length < 1 && h.preventDefault();
34
+ }, me = (h) => {
35
+ y && (h.preventDefault(), d("action", {
36
+ actionKey: y.action,
37
+ ...y
66
38
  }));
67
- }, ue = (u) => {
68
- if (w && $.current) {
69
- const H = $.current.scrollHeight;
39
+ }, he = (h) => {
40
+ if (w && b.current) {
41
+ const H = b.current.scrollHeight;
70
42
  if (H > i) {
71
- $.current.style.height = "auto";
72
- let M = H;
73
- u.length < 1 && (M = i), $.current.style.height = `${M}px`, M >= c ? $.current.style.overflowY = "scroll" : $.current.style.overflowY = "hidden";
43
+ b.current.style.height = "auto";
44
+ let N = H;
45
+ h.length < 1 && (N = i), b.current.style.height = `${N}px`, N >= c ? b.current.style.overflowY = "scroll" : b.current.style.overflowY = "hidden";
74
46
  }
75
47
  }
76
- }, D = (u) => {
77
- ue(u), o(u), u && u.length > 0 && d("user-typing", { textLength: u.length });
48
+ }, W = (h) => {
49
+ he(h), o(h), h && h.length > 0 && d("user-typing", { textLength: h.length });
78
50
  };
79
- return v ? null : /* @__PURE__ */ h(
80
- Ae,
51
+ return $ ? null : /* @__PURE__ */ m(
52
+ He,
81
53
  {
82
54
  grow: w,
83
- className: T("humany-conversation-input", e),
55
+ className: M("humany-conversation-input", e),
84
56
  "data-has-focus": r,
85
57
  scrollableCss: de,
86
- isTabbing: p,
58
+ isTabbing: x,
87
59
  children: [
88
- b && /* @__PURE__ */ n(
89
- He,
60
+ y && /* @__PURE__ */ n(
61
+ Me,
90
62
  {
91
63
  disabled: S,
92
64
  onClick: me,
93
- title: b.label,
94
- "aria-label": b.label,
65
+ title: y.label,
66
+ "aria-label": y.label,
95
67
  children: /* @__PURE__ */ n(
96
- x,
68
+ v,
97
69
  {
98
70
  size: 24,
99
- symbol: { type: "Svg", content: b.icon || "browse" }
71
+ symbol: { type: "Svg", content: y.icon || "browse" }
100
72
  }
101
73
  )
102
74
  }
@@ -105,37 +77,37 @@ const Le = (e, t) => {
105
77
  Ne,
106
78
  {
107
79
  value: t,
108
- onChange: D,
109
- onEnter: E,
80
+ onChange: W,
81
+ onEnter: D,
110
82
  disabled: S,
111
83
  "aria-label": l,
112
84
  placeholder: l,
113
- onFocusChange: s,
85
+ onFocusChange: a,
114
86
  type: "textarea",
115
87
  rows: 1,
116
- ref: $
88
+ ref: b
117
89
  }
118
90
  ) : /* @__PURE__ */ n(
119
- Te,
91
+ Ie,
120
92
  {
121
93
  value: t,
122
- onChange: D,
123
- onEnter: E,
94
+ onChange: W,
95
+ onEnter: D,
124
96
  disabled: S,
125
97
  "aria-label": l,
126
98
  placeholder: l,
127
- onFocusChange: s
99
+ onFocusChange: a
128
100
  }
129
101
  ),
130
102
  /* @__PURE__ */ n(
131
103
  ie,
132
104
  {
133
105
  disabled: S,
134
- onClick: E,
135
- title: I,
136
- "aria-label": I,
106
+ onClick: D,
107
+ title: L,
108
+ "aria-label": L,
137
109
  children: /* @__PURE__ */ n(
138
- Re,
110
+ Te,
139
111
  {
140
112
  size: 22,
141
113
  symbol: { type: "Svg", content: "send" },
@@ -147,7 +119,7 @@ const Le = (e, t) => {
147
119
  ]
148
120
  }
149
121
  );
150
- }, Ne = a(ne)`
122
+ }, Ne = s(te)`
151
123
  resize: none;
152
124
  flex: 1;
153
125
  flex-shrink: 1;
@@ -167,7 +139,7 @@ const Le = (e, t) => {
167
139
  border: none;
168
140
  transition: height 200ms linear;
169
141
  outline: none;
170
- `, Te = a(ne)`
142
+ `, Ie = s(te)`
171
143
  flex: 1;
172
144
  border: none;
173
145
  background-color: transparent;
@@ -193,7 +165,7 @@ const Le = (e, t) => {
193
165
  }};
194
166
  font-style: italic;
195
167
  }
196
- `, ie = a(L)`
168
+ `, ie = s(z)`
197
169
  flex: 0 0 50px;
198
170
  align-self: stretch;
199
171
  background-color: transparent;
@@ -203,19 +175,19 @@ const Le = (e, t) => {
203
175
  border: none;
204
176
  color: #a6a6a6;
205
177
  &:focus-visible {
206
- ${y};
178
+ ${f};
207
179
  }
208
- `, He = a(ie)`
180
+ `, Me = s(ie)`
209
181
  border-right: ${(e) => e.theme.border};
210
182
  margin: ${(e) => {
211
183
  var t;
212
184
  return (t = e.theme.sizes) == null ? void 0 : t.normal;
213
185
  }} 0;
214
- `, Ae = a.div`
215
- ${(e) => e.grow ? f`
186
+ `, He = s.div`
187
+ ${(e) => e.grow ? g`
216
188
  min-height: 50px;
217
189
  max-height: 150px;
218
- ` : f`
190
+ ` : g`
219
191
  height: 50px;
220
192
  `}
221
193
  flex: 0 0 auto;
@@ -226,15 +198,15 @@ const Le = (e, t) => {
226
198
  return (t = e.theme.colors) == null ? void 0 : t.accent;
227
199
  }};
228
200
  border-top: ${(e) => e.theme.inputBorder};
229
- ${(e) => e["data-has-focus"] && e.isTabbing && y}
201
+ ${(e) => e["data-has-focus"] && e.isTabbing && f}
230
202
  textarea {
231
203
  ${(e) => !!e.scrollableCss && e.scrollableCss}
232
204
  }
233
- `, Re = a(
205
+ `, Te = s(
234
206
  ({
235
207
  hasContent: e,
236
208
  ...t
237
- }) => /* @__PURE__ */ n(x, { ...t })
209
+ }) => /* @__PURE__ */ n(v, { ...t })
238
210
  )`
239
211
  line,
240
212
  path {
@@ -247,7 +219,7 @@ const Le = (e, t) => {
247
219
  return e.hasContent ? (t = e.theme.colors) == null ? void 0 : t.primary : "#a6a6a6";
248
220
  }};
249
221
  }
250
- `, Be = a.div`
222
+ `, Ae = s.div`
251
223
  width: ${(e) => e.avatarSize || "32px"};
252
224
  height: ${(e) => e.avatarSize || "32px"};
253
225
  border-radius: 50%;
@@ -294,7 +266,7 @@ const Le = (e, t) => {
294
266
  }};
295
267
  }
296
268
  }
297
- `, Ke = fe`
269
+ `, Be = we`
298
270
  0% {
299
271
  opacity: 0;
300
272
  }
@@ -304,7 +276,7 @@ const Le = (e, t) => {
304
276
  100% {
305
277
  opacity: 0;
306
278
  }
307
- `, je = a.div`
279
+ `, Re = s.div`
308
280
  display: flex;
309
281
  justify-content: center;
310
282
  > div {
@@ -316,7 +288,7 @@ const Le = (e, t) => {
316
288
  var t;
317
289
  return (t = e.theme.colors) == null ? void 0 : t.text;
318
290
  }};
319
- animation: ${Ke} 1s infinite;
291
+ animation: ${Be} 1s infinite;
320
292
  }
321
293
  > div:nth-of-type(2) {
322
294
  animation-delay: 100ms;
@@ -324,29 +296,29 @@ const Le = (e, t) => {
324
296
  > div:nth-of-type(3) {
325
297
  animation-delay: 200ms;
326
298
  }
327
- `, U = a.div`
299
+ `, U = s.div`
328
300
  grid-area: content;
329
301
  max-width: 100%;
330
302
  overflow: hidden;
331
- `, Oe = a(q)`
303
+ `, Ke = s(Y)`
332
304
  font-size: ${(e) => {
333
305
  var t;
334
306
  return (t = e.theme.fonts) == null ? void 0 : t.normal;
335
307
  }};
336
308
  font-weight: normal;
337
309
  margin: 0;
338
- `, _ = a.div`
310
+ `, _ = s.div`
339
311
  display: flex;
340
312
  ${(e) => e.left && "justify-content: start;"};
341
313
  ${(e) => e.center && "justify-content: center;"};
342
314
  ${(e) => e.right && "justify-content: end;"};
343
- `, V = a.div`
315
+ `, V = s.div`
344
316
  ${(e) => {
345
317
  var t;
346
318
  return e.padded && `padding: ${(t = e.theme.sizes) == null ? void 0 : t.medium};`;
347
319
  }}
348
- ${(e) => !e.user && e.stacked && Ee(e.stacked, e.theme)}
349
- ${(e) => e.user && e.stacked && De(e.stacked, e.theme)}
320
+ ${(e) => !e.user && e.stacked && je(e.stacked, e.theme)}
321
+ ${(e) => e.user && e.stacked && Oe(e.stacked, e.theme)}
350
322
 
351
323
  display: inline-block;
352
324
  margin-top: ${(e) => {
@@ -362,14 +334,14 @@ const Le = (e, t) => {
362
334
  }
363
335
  max-width: 100%;
364
336
  ${(e) => e.fullWidth && "width: 100%;"}
365
- `, Ee = (e, t) => {
366
- var r, s;
367
- const o = f`
337
+ `, je = (e, t) => {
338
+ var r, a;
339
+ const o = g`
368
340
  background-color: ${(r = t.colors) == null ? void 0 : r.accent};
369
- color: ${(s = t.colors) == null ? void 0 : s.text};
341
+ color: ${(a = t.colors) == null ? void 0 : a.text};
370
342
  ${t.border && `border: ${t.border};`};
371
343
  `;
372
- return t.borderRadius ? f`
344
+ return t.borderRadius ? g`
373
345
  ${o}
374
346
 
375
347
  border-top-right-radius: ${t.borderRadius};
@@ -383,13 +355,13 @@ const Le = (e, t) => {
383
355
  border-bottom-left-radius: ${t.borderRadius};
384
356
  `}
385
357
  ` : o;
386
- }, De = (e, t) => {
387
- var r, s;
388
- const o = f`
358
+ }, Oe = (e, t) => {
359
+ var r, a;
360
+ const o = g`
389
361
  background-color: ${(r = t.colors) == null ? void 0 : r.primary};
390
- color: ${(s = t.colors) == null ? void 0 : s.accent};
362
+ color: ${(a = t.colors) == null ? void 0 : a.accent};
391
363
  `;
392
- return t.borderRadius ? f`
364
+ return t.borderRadius ? g`
393
365
  ${o}
394
366
 
395
367
  border-top-left-radius: ${t.borderRadius};
@@ -403,7 +375,7 @@ const Le = (e, t) => {
403
375
  border-bottom-right-radius: ${t.borderRadius};
404
376
  `}
405
377
  ` : o;
406
- }, A = a.div`
378
+ }, A = s.div`
407
379
  margin-bottom: ${(e) => {
408
380
  var t;
409
381
  return (t = e.theme.sizes) == null ? void 0 : t.normal;
@@ -413,18 +385,18 @@ const Le = (e, t) => {
413
385
  }
414
386
  `, C = (e) => {
415
387
  var t, o;
416
- return f`
388
+ return g`
417
389
  margin: ${(t = e.theme.sizes) == null ? void 0 : t.medium} 0;
418
390
  padding: 0 ${(o = e.theme.sizes) == null ? void 0 : o.medium};
419
391
  `;
420
- }, We = a(be)`
392
+ }, De = s(ze)`
421
393
  & button.humany-form-component-button {
422
394
  ${(e) => {
423
- var t, o, r, s;
424
- return ((t = e.theme.colors) == null ? void 0 : t.primary) && ((o = e.theme.colors) == null ? void 0 : o.accent) && $e({
395
+ var t, o, r, a;
396
+ return ((t = e.theme.colors) == null ? void 0 : t.primary) && ((o = e.theme.colors) == null ? void 0 : o.accent) && pe({
425
397
  active: !1,
426
398
  primaryColor: (r = e.theme.colors) == null ? void 0 : r.primary,
427
- secondaryColor: (s = e.theme.colors) == null ? void 0 : s.accent,
399
+ secondaryColor: (a = e.theme.colors) == null ? void 0 : a.accent,
428
400
  theme: e.theme
429
401
  });
430
402
  }};
@@ -445,18 +417,18 @@ const Le = (e, t) => {
445
417
  }};
446
418
  }
447
419
  }
448
- `, Fe = a(Y)`
420
+ `, We = s(G)`
449
421
  white-space: pre-wrap;
450
422
  a {
451
423
  color: ${(e) => e.theme.colors.link};
452
424
  &:focus {
453
425
  ${(e) => {
454
426
  var t;
455
- return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && y;
427
+ return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && f;
456
428
  }};
457
429
  }
458
430
  }
459
- `, Pe = a(re)`
431
+ `, Ee = s(re)`
460
432
  padding: 0;
461
433
  list-style: none;
462
434
  margin: 0 -${(e) => {
@@ -469,8 +441,8 @@ const Le = (e, t) => {
469
441
  return (t = e.theme.sizes) == null ? void 0 : t.normal;
470
442
  }};
471
443
  }
472
- `, Ue = a.button`
473
- ${(e) => G(e)};
444
+ `, Fe = s.button`
445
+ ${(e) => K(e)};
474
446
  display: block;
475
447
  background-color: ${(e) => {
476
448
  var t;
@@ -479,16 +451,16 @@ const Le = (e, t) => {
479
451
  width: 100%;
480
452
  color: #fff;
481
453
  &:focus-visible {
482
- ${y}
454
+ ${f}
483
455
  background-color: transparent;
484
456
  }
485
- `, ee = Q(
486
- ({ boxed: e, className: t, agentData: o }, r) => /* @__PURE__ */ n(U, { ref: r, children: /* @__PURE__ */ n(_, { left: e, center: !e, children: /* @__PURE__ */ n(V, { padded: !!e, stacked: e ? "first" : void 0, children: /* @__PURE__ */ h(je, { children: [
457
+ `, Z = Q(
458
+ ({ boxed: e, className: t, agentData: o }, r) => /* @__PURE__ */ n(U, { ref: r, children: /* @__PURE__ */ n(_, { left: e, center: !e, children: /* @__PURE__ */ n(V, { padded: !!e, stacked: e ? "first" : void 0, children: /* @__PURE__ */ m(Re, { children: [
487
459
  /* @__PURE__ */ n("div", {}),
488
460
  /* @__PURE__ */ n("div", {}),
489
461
  /* @__PURE__ */ n("div", {})
490
462
  ] }) }) }) })
491
- ), _e = a.p`
463
+ ), Pe = s.p`
492
464
  && {
493
465
  font-size: ${(e) => {
494
466
  var t;
@@ -503,77 +475,77 @@ const Le = (e, t) => {
503
475
  var t;
504
476
  return (t = e.theme.colors) == null ? void 0 : t.text;
505
477
  }};
506
- `, te = (e) => new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), R = ({ className: e, name: t, timestamp: o }) => {
478
+ `, ee = (e) => new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), B = ({ className: e, name: t, timestamp: o }) => {
507
479
  if (!t && !o)
508
480
  return null;
509
481
  let r = "";
510
- return t ? o ? r = `${t}: ${te(o)}` : r = t : o && (r = te(o)), /* @__PURE__ */ n(_e, { children: r });
482
+ return t ? o ? r = `${t}: ${ee(o)}` : r = t : o && (r = ee(o)), /* @__PURE__ */ n(Pe, { children: r });
511
483
  }, le = ({
512
484
  className: e,
513
485
  children: t,
514
486
  sender: o,
515
487
  timestamp: r
516
488
  }) => {
517
- const { avatar: s, name: i } = o, { avatarSize: m } = N();
518
- return /* @__PURE__ */ h(
519
- Ve,
489
+ const { avatar: a, name: i } = o, { avatarSize: u } = I();
490
+ return /* @__PURE__ */ m(
491
+ Ue,
520
492
  {
521
- hasAvatar: !!s,
522
- className: T(
493
+ hasAvatar: !!a,
494
+ className: M(
523
495
  e,
524
496
  "humany-conversation-agent-message"
525
497
  ),
526
498
  children: [
527
- s && /* @__PURE__ */ n(Be, { avatarSize: m, children: typeof s == "string" ? (
499
+ a && /* @__PURE__ */ n(Ae, { avatarSize: u, children: typeof a == "string" ? (
528
500
  // eslint-disable-next-line jsx-a11y/alt-text
529
- /* @__PURE__ */ n("img", { src: s })
530
- ) : /* @__PURE__ */ n(x, { symbol: s }) }),
501
+ /* @__PURE__ */ n("img", { src: a })
502
+ ) : /* @__PURE__ */ n(v, { symbol: a }) }),
531
503
  t,
532
- /* @__PURE__ */ n(R, { name: i, timestamp: r })
504
+ /* @__PURE__ */ n(B, { name: i, timestamp: r })
533
505
  ]
534
506
  }
535
507
  );
536
- }, Ve = a.div`
508
+ }, Ue = s.div`
537
509
  display: grid;
538
510
  margin-right: 10%;
539
511
  width: 90%;
540
- ${(e) => e.hasAvatar ? f`
512
+ ${(e) => e.hasAvatar ? g`
541
513
  grid-template-columns: auto 1fr;
542
514
  grid-template-rows: 1fr auto;
543
515
  grid-template-areas:
544
516
  'avatar content'
545
517
  '. info';
546
- ` : f`
518
+ ` : g`
547
519
  grid-template-columns: 1fr;
548
520
  grid-template-rows: 1fr auto;
549
521
  grid-template-areas:
550
522
  'content'
551
523
  'info';
552
524
  `};
553
- `, qe = Q(
554
- ({ className: e, children: t, timestamp: o, discrete: r, fullWidth: s }, i) => /* @__PURE__ */ n(
555
- Ye,
525
+ `, _e = Q(
526
+ ({ className: e, children: t, timestamp: o, discrete: r, fullWidth: a }, i) => /* @__PURE__ */ n(
527
+ Ve,
556
528
  {
557
529
  ref: i,
558
- className: T(e, "humany-conversation-system-message"),
559
- fullWidth: s,
560
- children: r ? /* @__PURE__ */ h(Ge, { className: "humany-conversation-discrete-message", children: [
530
+ className: M(e, "humany-conversation-system-message"),
531
+ fullWidth: a,
532
+ children: r ? /* @__PURE__ */ m(qe, { className: "humany-conversation-discrete-message", children: [
561
533
  t,
562
- /* @__PURE__ */ n(R, { timestamp: o })
563
- ] }) : /* @__PURE__ */ h(B, { children: [
534
+ /* @__PURE__ */ n(B, { timestamp: o })
535
+ ] }) : /* @__PURE__ */ m(R, { children: [
564
536
  t,
565
- /* @__PURE__ */ n(R, { timestamp: o })
537
+ /* @__PURE__ */ n(B, { timestamp: o })
566
538
  ] })
567
539
  }
568
540
  )
569
- ), Ye = a.div`
541
+ ), Ve = s.div`
570
542
  ${(e) => e.fullWidth && "width: 100%"};
571
543
  padding: 0 ${(e) => {
572
544
  var t;
573
545
  return (t = e.theme.sizes) == null ? void 0 : t.large;
574
546
  }};
575
547
  overflow: auto;
576
- `, Ge = a.div`
548
+ `, qe = s.div`
577
549
  text-align: center;
578
550
  word-wrap: break-word;
579
551
  font-size: ${(e) => {
@@ -587,115 +559,162 @@ const Le = (e, t) => {
587
559
  > p {
588
560
  margin: 0;
589
561
  }
590
- `, Je = ({ className: e, children: t, timestamp: o }) => {
591
- const { userLabel: r = "" } = N();
592
- return /* @__PURE__ */ h(
593
- Qe,
562
+ `, Ye = ({ className: e, children: t, timestamp: o }) => {
563
+ const { userLabel: r = "" } = I();
564
+ return /* @__PURE__ */ m(
565
+ Ge,
594
566
  {
595
- className: T(e, "humany-conversation-user-message"),
567
+ className: M(e, "humany-conversation-user-message"),
596
568
  children: [
597
569
  t,
598
- /* @__PURE__ */ n(R, { name: r, timestamp: o })
570
+ /* @__PURE__ */ n(B, { name: r, timestamp: o })
599
571
  ]
600
572
  }
601
573
  );
602
- }, Qe = a.div`
574
+ }, Ge = s.div`
603
575
  margin-left: 10%;
604
576
  width: 90%;
605
577
  display: flex;
606
578
  flex-direction: column;
607
579
  align-items: flex-end;
608
- `, Z = (e) => Array.isArray(e) ? e : Object.keys(e).map((t) => ({
580
+ `, X = (e) => Array.isArray(e) ? e : Object.keys(e).map((t) => ({
609
581
  label: e[t],
610
582
  actionKey: t
611
- })), Xe = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
612
- Ze,
583
+ })), Je = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
584
+ Qe,
613
585
  {
614
586
  className: "humany-conversation-button-list",
615
587
  header: e,
616
- items: Z(t),
617
- renderItem: (r) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
618
- et,
619
- {
620
- onClick: () => {
621
- o("action", r);
622
- },
623
- "aria-label": r.label,
624
- title: r.label,
625
- children: [
626
- /* @__PURE__ */ n(x, { symbol: r.symbol }),
627
- r.label
628
- ]
629
- }
630
- ) }, r.actionKey)
588
+ items: X(t),
589
+ renderItem: (r) => {
590
+ var i;
591
+ const a = !!((i = r == null ? void 0 : r.data) != null && i.href);
592
+ return /* @__PURE__ */ n("li", { children: a ? /* @__PURE__ */ m(
593
+ Xe,
594
+ {
595
+ onClick: () => {
596
+ o("action", r);
597
+ },
598
+ href: r.data.href,
599
+ target: r.data.target,
600
+ "aria-label": r.label,
601
+ title: r.label,
602
+ children: [
603
+ /* @__PURE__ */ n(v, { symbol: r.symbol }),
604
+ r.label
605
+ ]
606
+ }
607
+ ) : /* @__PURE__ */ m(
608
+ Ze,
609
+ {
610
+ onClick: () => {
611
+ o("action", r);
612
+ },
613
+ "aria-label": r.label,
614
+ title: r.label,
615
+ children: [
616
+ /* @__PURE__ */ n(v, { symbol: r.symbol }),
617
+ r.label
618
+ ]
619
+ }
620
+ ) }, r.actionKey);
621
+ }
631
622
  }
632
- ), Ze = a(K)`
633
- ${j}
634
- > ul {
635
- display: flex;
636
- flex-wrap: wrap;
637
- gap: ${(e) => {
623
+ ), Qe = s(j)`
624
+ ${O}
625
+ > ul {
626
+ display: flex;
627
+ flex-wrap: wrap;
628
+ gap: ${(e) => {
638
629
  var t;
639
630
  return (t = e.theme.sizes) == null ? void 0 : t.normal;
640
631
  }};
641
- > li {
642
- margin: 0;
643
- }
632
+ > li {
633
+ margin: 0;
644
634
  }
645
- ${C}
646
- `, et = a(L)`
647
- ${G};
635
+ }
636
+ ${C}
637
+ `, Xe = s(ye)`
638
+ ${K};
648
639
 
649
- display: block;
650
- padding: ${(e) => {
640
+ display: block;
641
+ padding: ${(e) => {
651
642
  var t;
652
643
  return (t = e.theme.sizes) == null ? void 0 : t.normal;
653
644
  }};
654
- background-color: ${(e) => {
645
+ background-color: ${(e) => {
655
646
  var t;
656
647
  return (t = e.theme.colors) == null ? void 0 : t.primary;
657
648
  }};
658
- width: 100%;
659
- color: #ffffff;
660
- overflow: hidden;
661
- text-overflow: ellipsis;
662
- &:focus-visible {
663
- ${y}
664
- background-color: transparent;
665
- }
649
+ width: 100%;
650
+ color: #ffffff;
651
+ overflow: hidden;
652
+ text-overflow: ellipsis;
653
+ &:focus-visible {
654
+ ${f}
655
+ background-color: transparent;
656
+ }
666
657
 
667
- i,
668
- svg {
669
- margin-right: ${(e) => {
658
+ i,
659
+ svg {
660
+ margin-right: ${(e) => {
670
661
  var t;
671
662
  return (t = e.theme.sizes) == null ? void 0 : t.small;
672
663
  }};
673
- }
674
- `, tt = ({ type: e, content: t = {} }) => {
675
- const o = Le(e);
664
+ }
665
+ `, Ze = s(z)`
666
+ ${K};
667
+
668
+ display: block;
669
+ padding: ${(e) => {
670
+ var t;
671
+ return (t = e.theme.sizes) == null ? void 0 : t.normal;
672
+ }};
673
+ background-color: ${(e) => {
674
+ var t;
675
+ return (t = e.theme.colors) == null ? void 0 : t.primary;
676
+ }};
677
+ width: 100%;
678
+ color: #ffffff;
679
+ overflow: hidden;
680
+ text-overflow: ellipsis;
681
+ &:focus-visible {
682
+ ${f}
683
+ background-color: transparent;
684
+ }
685
+
686
+ i,
687
+ svg {
688
+ margin-right: ${(e) => {
689
+ var t;
690
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
691
+ }};
692
+ }
693
+ `, et = ({ type: e, content: t = {} }) => {
694
+ const o = be(e);
676
695
  return !o || !e ? null : /* @__PURE__ */ n(ke, { fallback: null, children: /* @__PURE__ */ n(o, { ...t }) });
677
- }, nt = ({ body: e }) => /* @__PURE__ */ n(ot, { html: e }), ot = a(Y)`
678
- ${ve}
696
+ }, tt = ({ body: e }) => /* @__PURE__ */ n(nt, { html: e }), nt = s(G)`
697
+ ${$e}
679
698
  color: inherit;
680
699
  white-space: pre-wrap;
681
700
  ${C}
682
701
  a {
683
702
  color: ${(e) => e.theme.colors.link};
684
703
  &:focus-visible {
685
- ${y};
704
+ ${f};
686
705
  }
687
706
  }
688
707
  `, rt = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
689
- st,
708
+ ot,
690
709
  {
691
710
  className: "humany-conversation-item-list",
692
711
  header: e,
693
- items: Z(t),
712
+ items: X(t),
694
713
  renderItem: (r) => {
695
- var s;
696
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(at, { children: [
697
- ((s = r.symbol) == null ? void 0 : s.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
698
- x,
714
+ var a;
715
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(st, { children: [
716
+ ((a = r.symbol) == null ? void 0 : a.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
717
+ v,
699
718
  {
700
719
  size: 22,
701
720
  symbol: {
@@ -704,9 +723,9 @@ const Le = (e, t) => {
704
723
  }
705
724
  }
706
725
  ) }),
707
- /* @__PURE__ */ h("div", { className: "item-body", children: [
726
+ /* @__PURE__ */ m("div", { className: "item-body", children: [
708
727
  /* @__PURE__ */ n(
709
- L,
728
+ z,
710
729
  {
711
730
  onClick: () => {
712
731
  o("action", r);
@@ -721,8 +740,8 @@ const Le = (e, t) => {
721
740
  ] }) }, r.actionKey);
722
741
  }
723
742
  }
724
- ), st = a(K)`
725
- ${j}
743
+ ), ot = s(j)`
744
+ ${O}
726
745
 
727
746
  > .humany-paragraph {
728
747
  ${C}
@@ -735,7 +754,7 @@ const Le = (e, t) => {
735
754
 
736
755
  ${(e) => J(e)(
737
756
  "h1",
738
- f`
757
+ g`
739
758
  white-space: normal;
740
759
  `
741
760
  )}
@@ -759,7 +778,7 @@ const Le = (e, t) => {
759
778
  border-bottom: none;
760
779
  }
761
780
  }
762
- `, at = a.div`
781
+ `, st = s.div`
763
782
  display: flex;
764
783
  gap: ${(e) => {
765
784
  var t;
@@ -798,7 +817,7 @@ const Le = (e, t) => {
798
817
  margin: 0;
799
818
 
800
819
  &:focus-visible {
801
- ${y}
820
+ ${f}
802
821
  span {
803
822
  color: ${(e) => {
804
823
  var t;
@@ -808,14 +827,14 @@ const Le = (e, t) => {
808
827
  }
809
828
  }
810
829
  }
811
- `, it = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
812
- lt,
830
+ `, at = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
831
+ it,
813
832
  {
814
833
  className: "humany-conversation-link-list",
815
834
  header: e,
816
- items: Z(t),
817
- renderItem: (r) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
818
- ct,
835
+ items: X(t),
836
+ renderItem: (r) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(
837
+ lt,
819
838
  {
820
839
  help: r.actionKey === "help",
821
840
  onClick: () => {
@@ -826,7 +845,7 @@ const Le = (e, t) => {
826
845
  children: [
827
846
  r.label,
828
847
  r.actionKey === "help" && /* @__PURE__ */ n(
829
- x,
848
+ v,
830
849
  {
831
850
  size: 14,
832
851
  symbol: {
@@ -839,13 +858,13 @@ const Le = (e, t) => {
839
858
  }
840
859
  ) }, r.actionKey)
841
860
  }
842
- ), lt = a(K)`
843
- ${j}
861
+ ), it = s(j)`
862
+ ${O}
844
863
  ${C}
845
864
 
846
865
  ${(e) => J(e)(
847
866
  "h1",
848
- f`
867
+ g`
849
868
  white-space: normal;
850
869
  `
851
870
  )}
@@ -861,7 +880,7 @@ const Le = (e, t) => {
861
880
  margin: 0;
862
881
  }
863
882
  }
864
- `, ct = a(L)`
883
+ `, lt = s(z)`
865
884
  display: block;
866
885
  text-align: left;
867
886
  font-weight: 300;
@@ -875,7 +894,7 @@ const Le = (e, t) => {
875
894
 
876
895
  ${(e) => {
877
896
  var t, o;
878
- return e.help && f`
897
+ return e.help && g`
879
898
  color: ${(t = e.theme.colors) == null ? void 0 : t.text};
880
899
  text-decoration: underline;
881
900
 
@@ -887,7 +906,7 @@ const Le = (e, t) => {
887
906
  }}
888
907
 
889
908
  &:focus-visible {
890
- ${y}
909
+ ${f}
891
910
  span {
892
911
  color: ${(e) => {
893
912
  var t;
@@ -896,18 +915,18 @@ const Le = (e, t) => {
896
915
  text-decoration: underline;
897
916
  }
898
917
  }
899
- `, dt = () => /* @__PURE__ */ n(mt, { className: "humany-conversation-separator" }), mt = a.div`
918
+ `, ct = () => /* @__PURE__ */ n(dt, { className: "humany-conversation-separator" }), dt = s.div`
900
919
  ${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
901
920
  width: 100%;
902
- `, ut = ({ text: e }) => /* @__PURE__ */ n(ht, { className: "humany-conversation-text", variant: "span", children: e }), ht = a(q)`
921
+ `, mt = ({ text: e }) => /* @__PURE__ */ n(ht, { className: "humany-conversation-text", variant: "span", children: e }), ht = s(Y)`
903
922
  ${C}
904
- `, gt = ({
923
+ `, ut = ({
905
924
  header: e = "Video call",
906
925
  acceptLabel: t = "Accept",
907
926
  declineLabel: o = "Decline",
908
927
  dispatch: r
909
928
  }) => {
910
- const s = Ce(() => [
929
+ const a = Ce(() => [
911
930
  {
912
931
  label: t,
913
932
  actionKey: "accept-video-call",
@@ -926,30 +945,30 @@ const Le = (e, t) => {
926
945
  }
927
946
  ], [t, o]);
928
947
  return /* @__PURE__ */ n(
929
- ft,
948
+ gt,
930
949
  {
931
950
  className: "humany-conversation-video-request",
932
951
  header: e,
933
- items: s,
952
+ items: a,
934
953
  renderItem: (i) => {
935
- const m = i.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
954
+ const u = i.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
936
955
  return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
937
- pt,
956
+ ft,
938
957
  {
939
958
  onClick: () => {
940
959
  r("action", i);
941
960
  },
942
961
  "aria-label": i.label,
943
962
  title: i.label,
944
- bgColor: m,
945
- children: /* @__PURE__ */ n(x, { symbol: i.symbol, size: 25 })
963
+ bgColor: u,
964
+ children: /* @__PURE__ */ n(v, { symbol: i.symbol, size: 25 })
946
965
  }
947
966
  ) }, i.actionKey);
948
967
  }
949
968
  }
950
969
  );
951
- }, ft = a(K)`
952
- ${(e) => j(e)}
970
+ }, gt = s(j)`
971
+ ${(e) => O(e)}
953
972
  > ul {
954
973
  display: flex;
955
974
  flex-wrap: wrap;
@@ -962,8 +981,8 @@ const Le = (e, t) => {
962
981
  }
963
982
  }
964
983
  ${(e) => C(e)}
965
- `, pt = a(L)`
966
- ${G};
984
+ `, ft = s(z)`
985
+ ${K};
967
986
 
968
987
  background-color: ${(e) => e.bgColor};
969
988
  display: flex;
@@ -975,7 +994,7 @@ const Le = (e, t) => {
975
994
  border-radius: 100%;
976
995
 
977
996
  &:focus-visible {
978
- ${y}
997
+ ${f}
979
998
  background-color: transparent;
980
999
 
981
1000
  i,
@@ -1002,62 +1021,62 @@ const Le = (e, t) => {
1002
1021
  stroke: #fff;
1003
1022
  }
1004
1023
  }
1005
- `, yt = ([e, t]) => ({ type: e, content: t }), bt = ({ items: e, dispatch: t }) => /* @__PURE__ */ n(
1006
- $t,
1024
+ `, pt = ([e, t]) => ({ type: e, content: t }), yt = ({ items: e, dispatch: t }) => /* @__PURE__ */ n(
1025
+ bt,
1007
1026
  {
1008
1027
  className: "humany-message-list",
1009
- items: e.map(yt),
1028
+ items: e.map(pt),
1010
1029
  renderLi: !0,
1011
1030
  renderItem: (o) => {
1012
1031
  switch (o.type) {
1013
1032
  case k.Text:
1014
- return /* @__PURE__ */ n(ut, { text: o.content });
1033
+ return /* @__PURE__ */ n(mt, { text: o.content });
1015
1034
  case k.HTML:
1016
- return /* @__PURE__ */ n(nt, { ...o.content });
1035
+ return /* @__PURE__ */ n(tt, { ...o.content });
1017
1036
  case k.Separator:
1018
- return /* @__PURE__ */ n(dt, { ...o.content });
1037
+ return /* @__PURE__ */ n(ct, { ...o.content });
1019
1038
  case k.ItemList:
1020
1039
  return /* @__PURE__ */ n(rt, { ...o.content, dispatch: t });
1021
1040
  case k.LinkList:
1022
- return /* @__PURE__ */ n(it, { ...o.content, dispatch: t });
1041
+ return /* @__PURE__ */ n(at, { ...o.content, dispatch: t });
1023
1042
  case k.ButtonList:
1024
- return /* @__PURE__ */ n(Xe, { ...o.content, dispatch: t });
1043
+ return /* @__PURE__ */ n(Je, { ...o.content, dispatch: t });
1025
1044
  case k.VideoRequest:
1026
- return /* @__PURE__ */ n(gt, { ...o.content, dispatch: t });
1045
+ return /* @__PURE__ */ n(ut, { ...o.content, dispatch: t });
1027
1046
  default:
1028
- return /* @__PURE__ */ n(tt, { type: o.type, content: o.content });
1047
+ return /* @__PURE__ */ n(et, { type: o.type, content: o.content });
1029
1048
  }
1030
1049
  }
1031
1050
  }
1032
- ), $t = a(re)`
1033
- ${xe}
1051
+ ), bt = s(re)`
1052
+ ${ve}
1034
1053
 
1035
1054
  > li {
1036
1055
  margin: 0;
1037
1056
  }
1038
- `, vt = Q(
1039
- ({ className: e, timestamp: t, sender: o, type: r, content: s }, i) => {
1040
- const m = ae(
1057
+ `, $t = Q(
1058
+ ({ className: e, timestamp: t, sender: o, type: r, content: a }, i) => {
1059
+ const u = ae(
1041
1060
  (d) => {
1042
1061
  let l = "first";
1043
- return s.length > 1 && (l = d === 0 ? "first" : d + 1 === s.length ? "last" : "middle"), l;
1062
+ return a.length > 1 && (l = d === 0 ? "first" : d + 1 === a.length ? "last" : "middle"), l;
1044
1063
  },
1045
- [s]
1046
- ), c = () => /* @__PURE__ */ n(B, { children: s.map((d) => {
1047
- const { key: l, body: v, title: S, form: I, actions: w } = d, b = !!v && !S && !I && !w;
1064
+ [a]
1065
+ ), c = () => /* @__PURE__ */ n(R, { children: a.map((d) => {
1066
+ const { key: l, body: $, title: S, form: L, actions: w } = d, y = !!$ && !S && !L && !w;
1048
1067
  return /* @__PURE__ */ n(
1049
- qe,
1068
+ _e,
1050
1069
  {
1051
1070
  className: e,
1052
- discrete: b,
1071
+ discrete: y,
1053
1072
  ref: i,
1054
1073
  timestamp: t,
1055
- fullWidth: !!I || !!w,
1056
- children: b && v ? /* @__PURE__ */ n(Y, { html: v }) : /* @__PURE__ */ n(F, { isSystem: !0, content: d })
1074
+ fullWidth: !!L || !!w,
1075
+ children: y && $ ? /* @__PURE__ */ n(G, { html: $ }) : /* @__PURE__ */ n(F, { isSystem: !0, content: d })
1057
1076
  },
1058
1077
  l
1059
1078
  );
1060
- }) }), g = () => /* @__PURE__ */ n(le, { sender: o, timestamp: t, className: e, children: /* @__PURE__ */ n(U, { className: "humany-message-content-bundle", children: s.map((d, l) => /* @__PURE__ */ n(
1079
+ }) }), p = () => /* @__PURE__ */ n(le, { sender: o, timestamp: t, className: e, children: /* @__PURE__ */ n(U, { className: "humany-message-content-bundle", children: a.map((d, l) => /* @__PURE__ */ n(
1061
1080
  _,
1062
1081
  {
1063
1082
  className: "humany-message-container",
@@ -1067,12 +1086,12 @@ const Le = (e, t) => {
1067
1086
  F,
1068
1087
  {
1069
1088
  content: d,
1070
- stacked: m(l)
1089
+ stacked: u(l)
1071
1090
  }
1072
1091
  )
1073
1092
  },
1074
1093
  d.key
1075
- )) }) }), p = () => /* @__PURE__ */ n(Je, { timestamp: t, className: e, children: /* @__PURE__ */ n(U, { className: "humany-message-content-bundle", children: s.map((d, l) => /* @__PURE__ */ n(
1094
+ )) }) }), x = () => /* @__PURE__ */ n(Ye, { timestamp: t, className: e, children: /* @__PURE__ */ n(U, { className: "humany-message-content-bundle", children: a.map((d, l) => /* @__PURE__ */ n(
1076
1095
  _,
1077
1096
  {
1078
1097
  className: "humany-message-container",
@@ -1083,58 +1102,58 @@ const Le = (e, t) => {
1083
1102
  {
1084
1103
  isUser: !0,
1085
1104
  content: d,
1086
- stacked: m(l)
1105
+ stacked: u(l)
1087
1106
  }
1088
1107
  )
1089
1108
  },
1090
1109
  d.key
1091
1110
  )) }) });
1092
1111
  switch (r) {
1093
- case W.System:
1112
+ case E.System:
1094
1113
  return c();
1095
- case W.Agent:
1096
- return g();
1097
- case W.User:
1114
+ case E.Agent:
1098
1115
  return p();
1116
+ case E.User:
1117
+ return x();
1099
1118
  default:
1100
1119
  return null;
1101
1120
  }
1102
1121
  }
1103
1122
  ), F = ({ content: e, isUser: t, isSystem: o, stacked: r }) => {
1104
- const s = X(), { title: i, body: m, actions: c, form: g, items: p } = e;
1105
- return p ? /* @__PURE__ */ n(V, { className: "humany-message-content", user: !!t, stacked: r, children: /* @__PURE__ */ n(bt, { items: p, dispatch: s }) }) : /* @__PURE__ */ h(
1123
+ const a = q(), { title: i, body: u, actions: c, form: p, items: x } = e;
1124
+ return x ? /* @__PURE__ */ n(V, { className: "humany-message-content", user: !!t, stacked: r, children: /* @__PURE__ */ n(yt, { items: x, dispatch: a }) }) : /* @__PURE__ */ m(
1106
1125
  V,
1107
1126
  {
1108
1127
  className: "humany-message-content",
1109
1128
  padded: !o,
1110
1129
  user: !!t,
1111
1130
  stacked: r,
1112
- fullWidth: !!g || !!c,
1131
+ fullWidth: !!p || !!c,
1113
1132
  children: [
1114
- i && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(Oe, { variant: "h2", children: i }) }),
1115
- m && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(Fe, { html: m }) }),
1116
- g && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
1117
- We,
1133
+ i && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(Ke, { variant: "h2", children: i }) }),
1134
+ u && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(We, { html: u }) }),
1135
+ p && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
1136
+ De,
1118
1137
  {
1119
- ...g,
1120
- onChange: (l, v) => {
1121
- s("form", {
1122
- data: v,
1123
- formKey: g.schema.id,
1138
+ ...p,
1139
+ onChange: (l, $) => {
1140
+ a("form", {
1141
+ data: $,
1142
+ formKey: p.schema.id,
1124
1143
  actionKey: l
1125
1144
  });
1126
1145
  }
1127
1146
  }
1128
1147
  ) }),
1129
1148
  c && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
1130
- Pe,
1149
+ Ee,
1131
1150
  {
1132
1151
  items: Object.keys(c).map((l) => ({ label: c[l], actionKey: l })),
1133
1152
  renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1134
- Ue,
1153
+ Fe,
1135
1154
  {
1136
1155
  onClick: () => {
1137
- s("action", l.actionKey);
1156
+ a("action", l.actionKey);
1138
1157
  },
1139
1158
  children: l.label
1140
1159
  }
@@ -1152,31 +1171,31 @@ const Le = (e, t) => {
1152
1171
  behavior: "smooth"
1153
1172
  });
1154
1173
  }, 250);
1155
- }, []), [t, o] = oe(!0), {
1174
+ }, []), [t, o] = ne(!0), {
1156
1175
  messages: r,
1157
- loading: s,
1176
+ loading: a,
1158
1177
  typingActors: i = []
1159
- } = N(), m = () => i && i.length ? i.map((c, g) => /* @__PURE__ */ n(P, { id: `typing_${c.name}`, children: /* @__PURE__ */ n(le, { timestamp: Date.now(), sender: c, children: /* @__PURE__ */ n(ee, { boxed: !0, ref: e }) }) }, `typing_${c.name}`)) : null;
1160
- return /* @__PURE__ */ h(B, { children: [
1161
- /* @__PURE__ */ h(xt, { tabIndex: 0, scrollableCss: t, ref: o, children: [
1162
- r && r.length ? r.map((c, g) => {
1163
- const { type: p, timestamp: d, sender: l, content: v } = c;
1178
+ } = I(), u = () => i && i.length ? i.map((c, p) => /* @__PURE__ */ n(P, { id: `typing_${c.name}`, children: /* @__PURE__ */ n(le, { timestamp: Date.now(), sender: c, children: /* @__PURE__ */ n(Z, { boxed: !0, ref: e }) }) }, `typing_${c.name}`)) : null;
1179
+ return /* @__PURE__ */ m(R, { children: [
1180
+ /* @__PURE__ */ m(vt, { tabIndex: 0, scrollableCss: t, ref: o, children: [
1181
+ r && r.length ? r.map((c, p) => {
1182
+ const { type: x, timestamp: d, sender: l, content: $ } = c;
1164
1183
  return /* @__PURE__ */ n(
1165
1184
  P,
1166
1185
  {
1167
1186
  className: "humany-conversation-entry",
1168
1187
  tabIndex: -1,
1169
- children: /* @__PURE__ */ n(vt, { ...c, ref: e })
1188
+ children: /* @__PURE__ */ n($t, { ...c, ref: e })
1170
1189
  },
1171
- `${p}_${l == null ? void 0 : l.name}_${d}_${v[0].key}`
1190
+ `${x}_${l == null ? void 0 : l.name}_${d}_${$[0].key}`
1172
1191
  );
1173
1192
  }) : null,
1174
- m(),
1175
- s && /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(ee, { ref: e }) })
1193
+ u(),
1194
+ a && /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(Z, { ref: e }) })
1176
1195
  ] }),
1177
- /* @__PURE__ */ n(Me, {})
1196
+ /* @__PURE__ */ n(Le, {})
1178
1197
  ] });
1179
- }, xt = a.div`
1198
+ }, vt = s.div`
1180
1199
  display: flex;
1181
1200
  flex-direction: column;
1182
1201
  align-items: stretch;
@@ -1187,9 +1206,9 @@ const Le = (e, t) => {
1187
1206
  }};
1188
1207
  ${(e) => !!e.scrollableCss && e.scrollableCss};
1189
1208
  &:focus-visible {
1190
- ${(e) => y(e)};
1209
+ ${(e) => f(e)};
1191
1210
  }
1192
- `, P = a.div`
1211
+ `, P = s.div`
1193
1212
  margin: 0;
1194
1213
  margin-bottom: ${(e) => {
1195
1214
  var t;
@@ -1223,42 +1242,42 @@ const Le = (e, t) => {
1223
1242
  }
1224
1243
  ${(e) => J(e)(
1225
1244
  "h1",
1226
- f`
1245
+ g`
1227
1246
  font-weight: normal;
1228
1247
  `
1229
1248
  )}
1230
- `, wt = ({ dispatch: e }) => {
1249
+ `, xt = ({ dispatch: e }) => {
1231
1250
  const t = Se(null);
1232
- return O(() => {
1251
+ return se(() => {
1233
1252
  t.current && t.current.parentNode && e("overlay-mounted", t.current);
1234
1253
  }, [t]), /* @__PURE__ */ n(
1235
- se,
1254
+ oe,
1236
1255
  {
1237
1256
  portalId: "humany-conversation-overlay-portal",
1238
1257
  className: "humany-conversation-overlay-outlet",
1239
1258
  ref: t
1240
1259
  }
1241
1260
  );
1242
- }, kt = ({
1261
+ }, wt = ({
1243
1262
  dispatch: e,
1244
1263
  header: t,
1245
1264
  buttonLabel: o
1246
- }) => /* @__PURE__ */ h(
1247
- Ct,
1265
+ }) => /* @__PURE__ */ m(
1266
+ kt,
1248
1267
  {
1249
1268
  portalId: "humany-conversation-portal",
1250
1269
  className: "humany-conversation-outlet",
1251
1270
  children: [
1252
- /* @__PURE__ */ h(St, { className: "humany-conversation-outlet-head", children: [
1271
+ /* @__PURE__ */ m(Ct, { className: "humany-conversation-outlet-head", children: [
1253
1272
  /* @__PURE__ */ n(
1254
- Lt,
1273
+ zt,
1255
1274
  {
1256
1275
  className: "humany-conversation-outlet-head-button",
1257
1276
  "aria-label": o,
1258
1277
  title: o,
1259
1278
  onClick: () => e("hide-overlay-conversation"),
1260
1279
  children: /* @__PURE__ */ n(
1261
- x,
1280
+ v,
1262
1281
  {
1263
1282
  symbol: {
1264
1283
  type: "Svg",
@@ -1270,7 +1289,7 @@ const Le = (e, t) => {
1270
1289
  }
1271
1290
  ),
1272
1291
  t && /* @__PURE__ */ n(
1273
- zt,
1292
+ St,
1274
1293
  {
1275
1294
  className: "humany-conversation-outlet-header",
1276
1295
  variant: "h1",
@@ -1281,7 +1300,7 @@ const Le = (e, t) => {
1281
1300
  /* @__PURE__ */ n(ce, {})
1282
1301
  ]
1283
1302
  }
1284
- ), Ct = a(se)`
1303
+ ), kt = s(oe)`
1285
1304
  z-index: 11;
1286
1305
  top: auto;
1287
1306
  height: 65%;
@@ -1296,7 +1315,7 @@ const Le = (e, t) => {
1296
1315
  var t;
1297
1316
  return (t = e.theme.sizes) == null ? void 0 : t.large;
1298
1317
  }};
1299
- `, St = a.div`
1318
+ `, Ct = s.div`
1300
1319
  display: flex;
1301
1320
  flex-direction: column;
1302
1321
  justify-content: center;
@@ -1310,7 +1329,7 @@ const Le = (e, t) => {
1310
1329
  return (t = e.theme.sizes) == null ? void 0 : t.normal;
1311
1330
  }};
1312
1331
  ${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
1313
- `, zt = a(q)`
1332
+ `, St = s(Y)`
1314
1333
  font-size: ${(e) => {
1315
1334
  var t;
1316
1335
  return (t = e.theme.fonts) == null ? void 0 : t.medium;
@@ -1320,7 +1339,7 @@ const Le = (e, t) => {
1320
1339
  return (t = e.theme.colors) == null ? void 0 : t.text;
1321
1340
  }};
1322
1341
  margin: 0;
1323
- `, Lt = a(L)`
1342
+ `, zt = s(z)`
1324
1343
  display: flex;
1325
1344
  align-items: center;
1326
1345
  justify-content: center;
@@ -1334,7 +1353,7 @@ const Le = (e, t) => {
1334
1353
  ${(e) => e.theme.borderRadius && `border-radius: ${e.theme.borderRadius};`}
1335
1354
 
1336
1355
  &:focus-visible {
1337
- ${y};
1356
+ ${f};
1338
1357
  }
1339
1358
 
1340
1359
  svg line {
@@ -1343,41 +1362,41 @@ const Le = (e, t) => {
1343
1362
  return (t = e.theme.colors) == null ? void 0 : t.text;
1344
1363
  }};
1345
1364
  }
1346
- `, Ot = ({ className: e, ...t }) => {
1365
+ `, Dt = ({ className: e, ...t }) => {
1347
1366
  const {
1348
1367
  overlay: o,
1349
1368
  overlayConversationHeader: r,
1350
- overlayConversationCloseLabel: s,
1369
+ overlayConversationCloseLabel: a,
1351
1370
  conversationControllerId: i
1352
- } = N(), m = X();
1353
- return /* @__PURE__ */ h(
1354
- we.Provider,
1371
+ } = I(), u = q();
1372
+ return /* @__PURE__ */ m(
1373
+ xe.Provider,
1355
1374
  {
1356
1375
  value: i ? { id: i } : null,
1357
1376
  children: [
1358
1377
  /* @__PURE__ */ n(
1359
- It,
1378
+ Lt,
1360
1379
  {
1361
1380
  ...t,
1362
- className: T(e, "humany-conversation-component"),
1381
+ className: M(e, "humany-conversation-component"),
1363
1382
  children: /* @__PURE__ */ n(ce, {})
1364
1383
  }
1365
1384
  ),
1366
- o && /* @__PURE__ */ h(B, { children: [
1367
- /* @__PURE__ */ n(wt, { dispatch: m }),
1385
+ o && /* @__PURE__ */ m(R, { children: [
1386
+ /* @__PURE__ */ n(xt, { dispatch: u }),
1368
1387
  o.conversation && /* @__PURE__ */ n(
1369
- kt,
1388
+ wt,
1370
1389
  {
1371
- dispatch: m,
1390
+ dispatch: u,
1372
1391
  header: r,
1373
- buttonLabel: s
1392
+ buttonLabel: a
1374
1393
  }
1375
1394
  )
1376
1395
  ] })
1377
1396
  ]
1378
1397
  }
1379
1398
  );
1380
- }, It = a.div`
1399
+ }, Lt = s.div`
1381
1400
  position: absolute;
1382
1401
  right: 0;
1383
1402
  left: 0;
@@ -1388,5 +1407,5 @@ const Le = (e, t) => {
1388
1407
  flex-direction: column;
1389
1408
  `;
1390
1409
  export {
1391
- Ot as default
1410
+ Dt as default
1392
1411
  };