@telia-ace/widget-conversation 1.1.1-rc.1 → 1.1.1-rc.3

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