@telia-ace/widget-conversation 1.0.41 → 1.1.1-rc.0

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