@telia-ace/widget-conversation 1.1.2-rc.6 → 1.1.2-rc.7

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