@telia-ace/knowledge-widget-components-guide 1.1.1-rc.2 → 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.
@@ -0,0 +1,894 @@
1
+ import { jsx as a, Fragment as X, jsxs as w } from "react/jsx-runtime";
2
+ import { css as P } from "@emotion/react";
3
+ import r from "@emotion/styled";
4
+ import { ContactList as Y, contactLink as me } from "@telia-ace/knowledge-widget-adapters";
5
+ import { List as he, TextLink as Z, paddedBorderTabStyle as _, useRouteData as A, Feedback as ue, StyledHeaderText as ge, useDispatch as ee, useProperties as V, Text as G, SymbolBadge as F, useContainer as te, Tooltip as fe, StyledListButton as T, DropdownList as ne, useFavorites as be, StyledText as Q, FavoriteButton as ye, DrawerList as ae, DrawerAnimationType as oe, useChildren as pe, Lightbox as $e, DialogLink as ke, embeddedLinkMapper as we, createEmptyComponent as xe, Loader as ze, loadingOpacity as Le, Paragraph as Se, genericHtml as Be, headingElement as Ne, DialogList as Ce, contentBox as ve, Metadata as De, Button as Re, linkTabStyle as Oe } from "@telia-ace/knowledge-widget-ui";
6
+ import { NotFound as Te, Component as Fe } from "@telia-ace/widget-types-grid";
7
+ import { appendClassNames as I, buildCategoryTrail as Ie, createParams as Ee } from "@telia-ace/widget-utilities";
8
+ import { useMemo as E, useState as se, useEffect as le, useCallback as M, forwardRef as We } from "react";
9
+ import { PickerTypes as $ } from "@telia-ace/knowledge-widget-core";
10
+ const He = ({
11
+ className: e,
12
+ defaultAnswerVersionLabel: t,
13
+ guide: { perspective: n, perspectives: s },
14
+ availablePerspectives: d = []
15
+ }) => {
16
+ const { name: l, params: i } = A(), h = E(() => !s || !d.length ? [] : d.filter(({ name: c }) => !!s[c]).map(({ name: c, title: u }) => ({ label: u, connection: s[c] })), [s, d]);
17
+ return /* @__PURE__ */ a(
18
+ je,
19
+ {
20
+ className: I(e, "humany-guide-answer-version-picker"),
21
+ items: h,
22
+ renderItem: (c) => {
23
+ const u = c.label === "Default" ? t : c.label, b = n === c.connection, m = b && (!i.connection || n === i.connection);
24
+ return /* @__PURE__ */ a("li", { "data-version": c.connection, children: /* @__PURE__ */ a(
25
+ Me,
26
+ {
27
+ as: m ? "span" : void 0,
28
+ text: u,
29
+ routeName: l,
30
+ selected: b,
31
+ "aria-label": u,
32
+ title: u,
33
+ params: {
34
+ ...i,
35
+ connection: c.connection
36
+ }
37
+ },
38
+ c.connection
39
+ ) }, c.connection);
40
+ }
41
+ }
42
+ );
43
+ }, je = r(he)`
44
+ display: flex;
45
+ align-items: center;
46
+ flex-wrap: wrap;
47
+
48
+ list-style: none;
49
+ padding: 0;
50
+ margin: 0;
51
+
52
+ li:not(:last-child) {
53
+ margin: 0 calc(${(e) => {
54
+ var t;
55
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
56
+ }} * 2) 0 0;
57
+ }
58
+
59
+ li > span {
60
+ cursor: default;
61
+ }
62
+ `, Me = r(Z)`
63
+ font-weight: 300;
64
+ color: ${(e) => {
65
+ var t;
66
+ return (t = e.theme.colors) == null ? void 0 : t.text;
67
+ }};
68
+ text-decoration: none;
69
+
70
+ ${(e) => e.selected && P`
71
+ font-weight: bold;
72
+ text-decoration: underline;
73
+ `}
74
+
75
+ &:focus-visible {
76
+ ${_};
77
+ }
78
+ `, Pe = r(Y)`
79
+ border-top: ${(e) => e.theme.border};
80
+ ${(e) => e.backButtonShown === "true" && `border-bottom: ${e.theme.border};`}
81
+ `, Ae = r(ue)`
82
+ ${(e) => {
83
+ var t, n;
84
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
85
+ }}
86
+ `, Ve = r(ge)`
87
+ ${(e) => {
88
+ var t, n;
89
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
90
+ }}
91
+
92
+ display: block;
93
+ font-size: ${(e) => {
94
+ var t;
95
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
96
+ }};
97
+ font-weight: bold;
98
+ `, Ge = ({ backButtonShown: e = !1, accordion: t = !1 }) => {
99
+ const n = ee(), {
100
+ loading: s = !1,
101
+ dialog: d = [],
102
+ guide: l,
103
+ handoverContactMethods: i = [],
104
+ contactHeader: h,
105
+ showFeedback: c,
106
+ feedbackDirection: u = "horizontal",
107
+ feedbackRecognitionLabel: b,
108
+ feedbackGiven: m,
109
+ feedbackHeader: y,
110
+ positiveFeedbackLabel: g,
111
+ negativeFeedbackLabel: S,
112
+ contactFeedbackLabel: f
113
+ } = V(), [p, o] = se(!1);
114
+ return le(() => {
115
+ m || o(!1);
116
+ }, [m]), !c || !l || !l.allowFeedback || s && !m || d.length ? null : m && b && !i.length && !s ? /* @__PURE__ */ a(
117
+ Ve,
118
+ {
119
+ accordion: t ? "true" : "false",
120
+ tabindex: -1,
121
+ ref: (k) => {
122
+ !p && k && (o(!0), k.focus());
123
+ },
124
+ children: b
125
+ }
126
+ ) : l.hasHandover && i.length ? /* @__PURE__ */ a(
127
+ Pe,
128
+ {
129
+ backButtonShown: e ? "true" : "false",
130
+ accordion: t ? "true" : "false",
131
+ header: h,
132
+ contactMethods: i,
133
+ dispatch: n
134
+ }
135
+ ) : /* @__PURE__ */ a(
136
+ Ae,
137
+ {
138
+ accordion: t ? "true" : "false",
139
+ positive: g,
140
+ negative: l.hasHandover ? f : S,
141
+ header: y,
142
+ selected: m,
143
+ onFeedback: (k) => n("feedback", k),
144
+ direction: u
145
+ }
146
+ );
147
+ }, qe = ({
148
+ guide: { categories: e = [] },
149
+ toolbar: { picker: t = $.NONE }
150
+ }) => {
151
+ const [n, s] = se([]), d = te();
152
+ return le(() => {
153
+ Ie(
154
+ "index",
155
+ e.map((l) => l.toString()),
156
+ d
157
+ ).then((l) => {
158
+ s(l);
159
+ });
160
+ }, [e]), n.length ? /* @__PURE__ */ a(
161
+ fe,
162
+ {
163
+ className: "humany-guide-category-tooltip",
164
+ sticky: t === $.DRAWER,
165
+ content: /* @__PURE__ */ a(X, { children: n.map((l) => /* @__PURE__ */ a(
166
+ Je,
167
+ {
168
+ className: "humany-guide-category-trail",
169
+ children: l.map((i, h) => /* @__PURE__ */ w(
170
+ G,
171
+ {
172
+ className: "humany-guide-category-trail-segment",
173
+ children: [
174
+ i.symbol && h === 0 && /* @__PURE__ */ a(F, { size: 14, symbol: i.symbol }),
175
+ i.title,
176
+ h !== l.length - 1 && /* @__PURE__ */ a(Ke, { className: "humany-category-separator", children: "/" })
177
+ ]
178
+ },
179
+ i.id
180
+ ))
181
+ },
182
+ l.map((i) => i.id).join(".")
183
+ )) }),
184
+ children: t === $.DRAWER ? /* @__PURE__ */ a(
185
+ T,
186
+ {
187
+ className: "humany-guide-category-tooltip-button",
188
+ "data-has-label": "false",
189
+ "data-has-symbol": "true",
190
+ children: /* @__PURE__ */ a(
191
+ U,
192
+ {
193
+ size: 19,
194
+ symbol: { type: "Svg", content: "information" }
195
+ }
196
+ )
197
+ }
198
+ ) : /* @__PURE__ */ a(
199
+ U,
200
+ {
201
+ size: 19,
202
+ symbol: { type: "Svg", content: "information" }
203
+ }
204
+ )
205
+ }
206
+ ) : null;
207
+ }, Je = r.div`
208
+ i,
209
+ svg {
210
+ margin: 0 ${(e) => {
211
+ var t;
212
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
213
+ }} 0 0;
214
+ }
215
+
216
+ &:not(:last-child) {
217
+ margin: 0 0 ${(e) => {
218
+ var t;
219
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
220
+ }};
221
+ }
222
+ `, Ke = r(G)`
223
+ margin: 0 ${(e) => {
224
+ var t;
225
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
226
+ }};
227
+ `, U = r(F)`
228
+ display: block;
229
+ `, Qe = ({
230
+ header: e,
231
+ tooltip: t,
232
+ printActionLabel: n,
233
+ copyActionLabel: s,
234
+ addFavoriteTooltip: d,
235
+ removeFavoriteCancelLabel: l,
236
+ removeFavoriteConfirmLabel: i,
237
+ removeFavoriteHeader: h,
238
+ removeFavoriteLabel: c,
239
+ removeFavoriteTooltip: u,
240
+ toolbarFunctionsCloseButtonAriaLabel: b,
241
+ allowCopy: m = !1,
242
+ allowPrint: y = !1,
243
+ showFavoriteToggle: g = !1,
244
+ picker: S = $.NONE,
245
+ guide: f,
246
+ dispatch: p
247
+ }) => {
248
+ const [o, k] = be(), D = M(
249
+ (B) => {
250
+ f && p("copy", f);
251
+ },
252
+ [f, p]
253
+ ), C = M(() => {
254
+ f && p("print");
255
+ }, [f, p]), x = E(() => {
256
+ const { id: B, title: R } = f, v = [];
257
+ if (m && v.push({
258
+ type: "copy",
259
+ child: /* @__PURE__ */ w(
260
+ T,
261
+ {
262
+ "data-has-label": s ? "true" : "false",
263
+ "data-has-symbol": "true",
264
+ title: s,
265
+ "aria-label": n,
266
+ onClick: D,
267
+ children: [
268
+ /* @__PURE__ */ a(
269
+ j,
270
+ {
271
+ size: 16,
272
+ symbol: { type: "Svg", content: "copy" }
273
+ }
274
+ ),
275
+ s && /* @__PURE__ */ a(Q, { children: s })
276
+ ]
277
+ }
278
+ )
279
+ }), y && v.push({
280
+ type: "print",
281
+ child: /* @__PURE__ */ w(
282
+ T,
283
+ {
284
+ "data-has-label": n ? "true" : "false",
285
+ "data-has-symbol": "true",
286
+ title: n,
287
+ "aria-label": n,
288
+ onClick: C,
289
+ children: [
290
+ /* @__PURE__ */ a(
291
+ j,
292
+ {
293
+ size: 16,
294
+ symbol: { type: "Svg", content: "print" }
295
+ }
296
+ ),
297
+ n && /* @__PURE__ */ a(Q, { children: n })
298
+ ]
299
+ }
300
+ )
301
+ }), g) {
302
+ const O = o.indexOf(B) > -1;
303
+ v.push({
304
+ type: "favorite",
305
+ child: /* @__PURE__ */ a(
306
+ ye,
307
+ {
308
+ id: B,
309
+ guideTitle: R,
310
+ isFavorite: O,
311
+ buttonLabel: O ? u : d,
312
+ addFavoriteTooltip: d,
313
+ removeFavoriteCancelLabel: l,
314
+ removeFavoriteConfirmLabel: i,
315
+ removeFavoriteHeader: h,
316
+ removeFavoriteLabel: c,
317
+ removeFavoriteTooltip: u,
318
+ actions: k
319
+ }
320
+ )
321
+ });
322
+ }
323
+ return v;
324
+ }, [
325
+ o,
326
+ f,
327
+ m,
328
+ y,
329
+ g,
330
+ n,
331
+ s,
332
+ d,
333
+ l,
334
+ i,
335
+ h,
336
+ c,
337
+ u
338
+ ]);
339
+ if (!x.length)
340
+ return null;
341
+ const N = /* @__PURE__ */ a(
342
+ Xe,
343
+ {
344
+ tabIndex: 0,
345
+ title: t,
346
+ "data-has-symbol": "true",
347
+ "data-has-label": "false",
348
+ children: /* @__PURE__ */ a(
349
+ j,
350
+ {
351
+ symbol: { type: "Svg", content: "options" },
352
+ size: 18
353
+ }
354
+ )
355
+ }
356
+ ), z = ({ type: B, child: R }) => /* @__PURE__ */ a("li", { "data-function-type": B, children: R }, B);
357
+ return S === $.DROPDOWN ? /* @__PURE__ */ a(
358
+ Ue,
359
+ {
360
+ className: "humany-guide-functions-dropdown-list",
361
+ header: e,
362
+ items: x,
363
+ trigger: N,
364
+ renderItem: z,
365
+ closeButtonAriaLabel: b
366
+ }
367
+ ) : S === $.DRAWER ? /* @__PURE__ */ a(
368
+ ae,
369
+ {
370
+ className: "humany-guide-functions-drawer-list",
371
+ animation: { type: oe.SlideInBottom },
372
+ header: e,
373
+ items: x,
374
+ trigger: N,
375
+ renderItem: z,
376
+ closeButtonAriaLabel: b
377
+ }
378
+ ) : null;
379
+ }, j = r(F)`
380
+ circle {
381
+ fill: ${(e) => {
382
+ var t;
383
+ return (t = e.theme.colors) == null ? void 0 : t.text;
384
+ }};
385
+ }
386
+
387
+ line,
388
+ path,
389
+ rect {
390
+ stroke: ${(e) => {
391
+ var t;
392
+ return (t = e.theme.colors) == null ? void 0 : t.text;
393
+ }};
394
+ }
395
+ `, Ue = r(ne)`
396
+ display: block;
397
+ min-height: auto;
398
+ `, Xe = r(T)`
399
+ padding: calc(${(e) => {
400
+ var t;
401
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
402
+ }} * 2) 0;
403
+ `, Ye = (e, t) => {
404
+ var n;
405
+ return ((n = t.find((s) => s.id === e.id)) == null ? void 0 : n.label) || "";
406
+ }, Ze = ({
407
+ header: e,
408
+ tooltip: t,
409
+ picker: n = $.NONE,
410
+ guide: s,
411
+ ...d
412
+ }) => {
413
+ const { name: l, params: i } = A(), h = E(() => Object.keys(s.translations || {}).reduce(
414
+ (m, y) => {
415
+ const g = {};
416
+ return g.key = y, g.id = (s.translations || {})[y], g.label = d[`${y}LanguageLabel`], (g.id || g.label) && m.push(g), m;
417
+ },
418
+ []
419
+ ), [s, d]);
420
+ if (!h.length)
421
+ return null;
422
+ const c = Ye(s, h), u = /* @__PURE__ */ w(
423
+ _e,
424
+ {
425
+ tabIndex: 0,
426
+ title: t,
427
+ "data-has-symbol": "true",
428
+ "data-has-label": n === $.DROPDOWN && c ? "true" : "false",
429
+ children: [
430
+ n === $.DROPDOWN && /* @__PURE__ */ w(X, { children: [
431
+ c && /* @__PURE__ */ a(tt, { children: c }),
432
+ /* @__PURE__ */ a(
433
+ nt,
434
+ {
435
+ symbol: { type: "Svg", content: "caret-down" },
436
+ size: 11
437
+ }
438
+ )
439
+ ] }),
440
+ n === $.DRAWER && /* @__PURE__ */ a(
441
+ et,
442
+ {
443
+ symbol: { type: "Svg", content: "language" },
444
+ size: 20
445
+ }
446
+ )
447
+ ]
448
+ }
449
+ ), b = ({ label: m, key: y, id: g }) => /* @__PURE__ */ a("li", { "data-language": y, children: /* @__PURE__ */ a(
450
+ ot,
451
+ {
452
+ tabIndex: 0,
453
+ text: m,
454
+ routeName: l,
455
+ selected: s.id === g,
456
+ params: Ee({
457
+ ...i,
458
+ connection: void 0,
459
+ guide: g
460
+ })
461
+ }
462
+ ) }, y);
463
+ return n === $.DROPDOWN ? /* @__PURE__ */ a(
464
+ at,
465
+ {
466
+ className: "humany-guide-languages-dropdown-list",
467
+ header: e,
468
+ items: h,
469
+ trigger: u,
470
+ renderItem: b
471
+ }
472
+ ) : n === $.DRAWER ? /* @__PURE__ */ a(
473
+ ae,
474
+ {
475
+ className: "humany-guide-languages-drawer-list",
476
+ animation: { type: oe.SlideInBottom },
477
+ header: e,
478
+ items: h,
479
+ trigger: u,
480
+ renderItem: b
481
+ }
482
+ ) : null;
483
+ }, _e = r(T)`
484
+ &&& {
485
+ margin: 0 ${(e) => {
486
+ var t;
487
+ return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} * 2)`;
488
+ }} 0 0;
489
+ }
490
+ `, et = r(F)`
491
+ circle {
492
+ fill: ${(e) => {
493
+ var t;
494
+ return (t = e.theme.colors) == null ? void 0 : t.text;
495
+ }};
496
+ }
497
+
498
+ line,
499
+ path,
500
+ rect {
501
+ stroke: ${(e) => {
502
+ var t;
503
+ return (t = e.theme.colors) == null ? void 0 : t.text;
504
+ }};
505
+ }
506
+ `, tt = r(G)`
507
+ margin: 0 ${(e) => {
508
+ var t;
509
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
510
+ }} 0 0;
511
+ font-size: ${(e) => {
512
+ var t;
513
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
514
+ }};
515
+ `, nt = r(F)`
516
+ align-self: flex-end;
517
+ stroke-width: 2px;
518
+ stroke-linecap: round;
519
+
520
+ && {
521
+ width: 0.6em;
522
+ height: 1em;
523
+ }
524
+ line {
525
+ stroke: ${(e) => {
526
+ var t;
527
+ return (t = e.theme.colors) == null ? void 0 : t.text;
528
+ }};
529
+ }
530
+ `, at = r(ne)`
531
+ display: block;
532
+ min-height: auto;
533
+ `, ot = r(Z)`
534
+ color: ${(e) => {
535
+ var t, n;
536
+ return e.selected ? (t = e.theme.colors) == null ? void 0 : t.primary : (n = e.theme.colors) == null ? void 0 : n.text;
537
+ }};
538
+ ${(e) => e.selected && "font-weight: bold;"}
539
+
540
+ outline: none;
541
+ &:focus-visible {
542
+ ${_}
543
+ text-decoration: underline;
544
+ }
545
+ `, st = (e) => {
546
+ const {
547
+ allowCopy: t = !1,
548
+ allowPrint: n = !1,
549
+ guideCategories: s = !1,
550
+ language: d = !1,
551
+ showFavoriteToggle: l = !1,
552
+ picker: i = $.NONE
553
+ } = e;
554
+ return !t && !n && !d && !l && !s || i === $.NONE;
555
+ }, lt = ({ className: e = "", dispatch: t }) => {
556
+ const {
557
+ toolbarLanguageHeader: n,
558
+ toolbarFunctionsHeader: s,
559
+ toolbarLanguageTooltip: d,
560
+ toolbarFunctionsTooltip: l,
561
+ toolbarFunctionsCloseButtonAriaLabel: i,
562
+ printActionLabel: h,
563
+ copyActionLabel: c,
564
+ addFavoriteTooltip: u,
565
+ removeFavoriteCancelLabel: b,
566
+ removeFavoriteConfirmLabel: m,
567
+ removeFavoriteHeader: y,
568
+ removeFavoriteLabel: g,
569
+ removeFavoriteTooltip: S,
570
+ guide: f,
571
+ toolbar: p,
572
+ ...o
573
+ } = V();
574
+ if (!f || !p || st(p))
575
+ return null;
576
+ const { language: k, guideCategories: D, allowCopy: C, allowPrint: x, showFavoriteToggle: N, picker: z } = p;
577
+ return /* @__PURE__ */ w(rt, { className: I("humany-guide-toolbar", e), children: [
578
+ k && Object.keys(f.translations || {}).length > 1 && /* @__PURE__ */ a(
579
+ Ze,
580
+ {
581
+ guide: f,
582
+ header: n,
583
+ tooltip: d,
584
+ picker: z,
585
+ ...o
586
+ }
587
+ ),
588
+ D && /* @__PURE__ */ a(qe, { guide: f, toolbar: p }),
589
+ (C || x || N) && /* @__PURE__ */ a(
590
+ Qe,
591
+ {
592
+ guide: f,
593
+ header: s,
594
+ tooltip: l,
595
+ printActionLabel: h,
596
+ copyActionLabel: c,
597
+ addFavoriteTooltip: u,
598
+ removeFavoriteCancelLabel: b,
599
+ removeFavoriteConfirmLabel: m,
600
+ removeFavoriteHeader: y,
601
+ removeFavoriteLabel: g,
602
+ removeFavoriteTooltip: S,
603
+ toolbarFunctionsCloseButtonAriaLabel: i,
604
+ allowCopy: C,
605
+ allowPrint: x,
606
+ showFavoriteToggle: N,
607
+ picker: z,
608
+ dispatch: t
609
+ }
610
+ )
611
+ ] });
612
+ }, rt = r.div`
613
+ display: flex;
614
+ align-items: center;
615
+ justify-content: space-between;
616
+ margin: 0 0 0 auto;
617
+
618
+ > :not(:last-child) {
619
+ margin: 0 calc(${(e) => {
620
+ var t;
621
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
622
+ }} * 2) 0 0;
623
+ }
624
+ `, Ct = We(
625
+ ({ className: e, accordion: t = !1, ...n }, s) => {
626
+ const {
627
+ loading: d = !1,
628
+ dialog: l = [],
629
+ contactMethods: i = [],
630
+ showHeader: h = !0,
631
+ showAnswerVersions: c = !1,
632
+ defaultAnswerVersionLabel: u = "Default",
633
+ backButtonLabel: b,
634
+ metadataByLabel: m,
635
+ metadataModifiedLabel: y,
636
+ metadataPublishedLabel: g,
637
+ availablePerspectives: S,
638
+ metadata: f,
639
+ toolbar: p,
640
+ guide: o,
641
+ error: k
642
+ } = V(), {
643
+ params: { connection: D, guide: C }
644
+ } = A(), x = te(), N = pe(), z = ee(), B = E(() => ({
645
+ transform: {
646
+ img: (L) => /* @__PURE__ */ a($e, { attrs: L, htmlBody: (o == null ? void 0 : o.body) || "" }),
647
+ a: (L) => {
648
+ const { children: ie, ...ce } = L, J = ce["data-target"];
649
+ if (J && l.length) {
650
+ const K = l.find(
651
+ ({ connection: de }) => de === J
652
+ );
653
+ if (K)
654
+ return /* @__PURE__ */ a(ke, { ...K, children: ie });
655
+ }
656
+ return we(x)(L);
657
+ }
658
+ }
659
+ }), [o, x, l]), R = M(() => {
660
+ z("back");
661
+ }, [z]);
662
+ if (!o && !k && !d)
663
+ return xe(x, {
664
+ ...n,
665
+ className: I(e, "humany-guide")
666
+ });
667
+ const { id: v = "", title: O = "", body: W = "", translations: q = {} } = o || {};
668
+ if (k && k.status === 404)
669
+ return /* @__PURE__ */ a(Te, { showSearch: !1 });
670
+ const H = !!t && !!D, re = Object.keys(q).find((L) => q[L] === `${v}`);
671
+ return /* @__PURE__ */ w(
672
+ it,
673
+ {
674
+ ref: s,
675
+ ...n,
676
+ "data-loading": d,
677
+ className: I(e, "humany-guide"),
678
+ children: [
679
+ /* @__PURE__ */ w(
680
+ ut,
681
+ {
682
+ "data-loading": d,
683
+ accordion: t ? "true" : "false",
684
+ className: "humany-guide-content",
685
+ children: [
686
+ (c && o || !!p) && /* @__PURE__ */ w(ht, { className: "humany-guide-top", children: [
687
+ c && o && /* @__PURE__ */ a(
688
+ He,
689
+ {
690
+ defaultAnswerVersionLabel: u,
691
+ availablePerspectives: S,
692
+ guide: o
693
+ }
694
+ ),
695
+ !!p && /* @__PURE__ */ a(lt, { dispatch: z })
696
+ ] }),
697
+ !!(O || W) && /* @__PURE__ */ a(
698
+ ct,
699
+ {
700
+ className: "humany-guide-body",
701
+ accordion: t ? "true" : "false",
702
+ header: h && O || void 0,
703
+ html: W,
704
+ htmlParseInstruction: B,
705
+ lang: re
706
+ }
707
+ ),
708
+ l && W.indexOf("h-option-link") === -1 && /* @__PURE__ */ a(mt, { dialog: l }),
709
+ /* @__PURE__ */ a(
710
+ dt,
711
+ {
712
+ backButtonShown: H ? "true" : "false",
713
+ contactMethods: i,
714
+ dispatch: z,
715
+ guideId: o && o.id
716
+ }
717
+ ),
718
+ !i.length && C === (o == null ? void 0 : o.id) && /* @__PURE__ */ a(Ge, { backButtonShown: H, accordion: t }),
719
+ H && /* @__PURE__ */ w(bt, { "aria-label": b, onClick: R, children: [
720
+ /* @__PURE__ */ w(
721
+ yt,
722
+ {
723
+ width: "7",
724
+ height: "13",
725
+ viewBox: "0 0 7 13",
726
+ fill: "none",
727
+ xmlns: "http://www.w3.org/2000/svg",
728
+ children: [
729
+ /* @__PURE__ */ a("line", { x1: "6.64645", y1: "12.5513", x2: "0.648357", y2: "6.55319" }),
730
+ /* @__PURE__ */ a("line", { x1: "0.646447", y1: "6.64455", x2: "6.64454", y2: "0.646465" })
731
+ ]
732
+ }
733
+ ),
734
+ b && /* @__PURE__ */ a("span", { children: b })
735
+ ] }),
736
+ f && /* @__PURE__ */ a(
737
+ gt,
738
+ {
739
+ ...f,
740
+ modified: o == null ? void 0 : o.modified,
741
+ published: o == null ? void 0 : o.published,
742
+ modifiedBy: o == null ? void 0 : o.modifiedBy,
743
+ publishedBy: o == null ? void 0 : o.publishedBy,
744
+ byLabel: m,
745
+ modifiedLabel: y,
746
+ publishedLabel: g
747
+ }
748
+ ),
749
+ N.map((L) => /* @__PURE__ */ a(
750
+ ft,
751
+ {
752
+ id: L.id,
753
+ branch: "default",
754
+ embedded: !0
755
+ },
756
+ L.id
757
+ ))
758
+ ]
759
+ }
760
+ ),
761
+ /* @__PURE__ */ a(ze, { loading: d })
762
+ ]
763
+ }
764
+ );
765
+ }
766
+ ), it = r.div`
767
+ ${Le}
768
+ min-width: 0;
769
+ `, ct = r(Se)`
770
+ ${Be}
771
+ ${(e) => {
772
+ var t;
773
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large};`;
774
+ }}
775
+ display: block;
776
+ line-height: 1.6em;
777
+
778
+ ${(e) => {
779
+ var t, n;
780
+ return Ne(e)(
781
+ "h1",
782
+ P`
783
+ font-size: ${(t = e.theme.fonts) == null ? void 0 : t.large};
784
+ font-weight: normal;
785
+ line-height: 1.6em;
786
+ line-height: 1.6em;
787
+ margin: 0 0 ${(n = e.theme.sizes) == null ? void 0 : n.small};
788
+ `
789
+ );
790
+ }}
791
+
792
+ p {
793
+ font-weight: 300;
794
+ font-size: ${(e) => {
795
+ var t;
796
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
797
+ }};
798
+ color: ${(e) => {
799
+ var t;
800
+ return (t = e.theme.colors) == null ? void 0 : t.text;
801
+ }};
802
+ a {
803
+ display: inline;
804
+ }
805
+ }
806
+ `, dt = r(Y)`
807
+ border-top: ${(e) => e.theme.border};
808
+ ${(e) => e.backButtonShown === "true" && `border-bottom: ${e.theme.border};`}
809
+ `, mt = r(Ce)`
810
+ ${(e) => {
811
+ var t, n;
812
+ return `padding: 0 ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
813
+ }}
814
+ display: block;
815
+ `, ht = r.div`
816
+ ${(e) => {
817
+ var t, n;
818
+ return `padding: calc(${(t = e.theme.sizes) == null ? void 0 : t.normal}*2) ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
819
+ }}
820
+ display: flex;
821
+ justify-content: space-between;
822
+ align-items: center;
823
+ border-bottom: ${(e) => e.theme.border};
824
+ border-radius: ${(e) => `${e.theme.borderRadius} ${e.theme.borderRadius}`} 0 0;
825
+ background-color: #ffffff;
826
+ `, ut = r.div`
827
+ ${ve}
828
+ display: block;
829
+ > a {
830
+ ${me}
831
+ }
832
+
833
+ ${(e) => e.accordion === "true" && P`
834
+ white-space: normal;
835
+ box-shadow: none;
836
+ background-color: #fafafa;
837
+ `}
838
+ `, gt = r(De)`
839
+ display: block;
840
+ ${(e) => {
841
+ var t, n;
842
+ return `padding: calc(${(t = e.theme.sizes) == null ? void 0 : t.normal}*2) ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
843
+ }}
844
+ font-weight: 300;
845
+ font-size: ${(e) => {
846
+ var t;
847
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
848
+ }};
849
+ color: ${(e) => {
850
+ var t;
851
+ return (t = e.theme.colors) == null ? void 0 : t.text;
852
+ }};
853
+ border-top: ${(e) => e.theme.border};
854
+ `, ft = r(Fe)`
855
+ border-top: ${(e) => e.theme.border};
856
+ `, bt = r(Re)`
857
+ ${(e) => {
858
+ var t, n;
859
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.normal} calc(${(n = e.theme.sizes) == null ? void 0 : n.normal} * 2);`;
860
+ }}
861
+ color: ${(e) => {
862
+ var t;
863
+ return (t = e.theme.colors) == null ? void 0 : t.primary;
864
+ }};
865
+ text-decoration: underline;
866
+ font-size: ${(e) => {
867
+ var t;
868
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
869
+ }};
870
+ span {
871
+ font-weight: 300;
872
+ }
873
+ &:focus-visible {
874
+ ${Oe}
875
+ padding: ${(e) => {
876
+ var t, n;
877
+ return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} / 2) ${(n = e.theme.sizes) == null ? void 0 : n.small}`;
878
+ }};
879
+ }
880
+ `, yt = r.svg`
881
+ margin-right: ${(e) => {
882
+ var t;
883
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
884
+ }};
885
+ line {
886
+ stroke: ${(e) => {
887
+ var t;
888
+ return (t = e.theme.colors) == null ? void 0 : t.primary;
889
+ }};
890
+ }
891
+ `;
892
+ export {
893
+ Ct as default
894
+ };