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