@museumwnf/viewer-layout 3.9.0 → 3.11.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.
@@ -1,1386 +0,0 @@
1
- import { d as e, i as t, l as n, n as r, t as i, u as a } from "./GlossaryPopover-DcptyNWI.js";
2
- import { a as o, i as s, n as c, o as l, s as ee, t as u } from "./TimelineEventList-gsoc-SBx.js";
3
- import { Fragment as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createSlots as _, createTextVNode as v, createVNode as y, guardReactiveProps as b, isRef as x, mergeProps as S, normalizeClass as te, normalizeProps as C, openBlock as w, reactive as T, ref as E, renderList as D, renderSlot as O, resolveDynamicComponent as ne, toDisplayString as k, unref as A, useSlots as j, vModelCheckbox as M, vModelRadio as N, vModelSelect as P, vModelText as re, watch as F, withCtx as I, withDirectives as L } from "vue";
4
- import { I18nText as R, NotFoundView as z, byId as B, centuryPresets as V, dateRange as H, entityRef as ie, eventDateLabel as U, glossaryEntries as ae, glossaryTermsForText as W, groupByCountry as G, md as K, mdInline as oe, partnerHierarchy as q, partnerView as J, renderBlock as se, renderInline as Y, renderPlain as X, sortChronological as Z, useCollectionTree as ce, useDataPackage as Q, useFacets as le, useGlossaryPopup as ue, useI18n as de, useListQuery as fe, useLocale as pe, usePagination as me, useRecordLanguage as he, useSearchLanguage as ge, useTimelineEvents as _e, yearBuckets as ve } from "@museumwnf/viewer-core";
5
- import { useRouter as ye } from "vue-router";
6
- //#region src/views/CatalogueResultsView.vue
7
- var be = {
8
- key: 0,
9
- class: "mwnf-catalogue__title"
10
- }, xe = {
11
- key: 0,
12
- class: "mwnf-facet"
13
- }, Se = {
14
- key: 0,
15
- class: "mwnf-facet__label"
16
- }, Ce = [
17
- "value",
18
- "placeholder",
19
- "onInput"
20
- ], we = {
21
- key: 1,
22
- class: "mwnf-facet"
23
- }, Te = {
24
- key: 0,
25
- class: "mwnf-facet__label"
26
- }, Ee = [
27
- "value",
28
- "placeholder",
29
- "onInput"
30
- ], De = {
31
- key: 2,
32
- class: "mwnf-facet mwnf-facet--checkbox"
33
- }, Oe = ["checked", "onChange"], ke = {
34
- key: 0,
35
- class: "mwnf-facet__label"
36
- }, Ae = { class: "mwnf-catalogue__body" }, je = { class: "mwnf-catalogue__results" }, Me = {
37
- key: 0,
38
- class: "mwnf-catalogue__aside"
39
- }, Ne = {
40
- __name: "CatalogueResultsView",
41
- props: {
42
- spec: {
43
- type: Object,
44
- required: !0
45
- },
46
- entity: {
47
- type: String,
48
- default: ""
49
- }
50
- },
51
- setup(e) {
52
- let t = e, { t: r, locale: i } = de(), c = Q(), u = t.spec.entity ?? t.entity, x = f(() => t.spec), S = ie(u);
53
- u && c.loadTranslations(u, "en");
54
- let T = f(() => x.value.keys ?? [...Object.keys(x.value.facets ?? {}), ...E()]);
55
- function E() {
56
- let e = x.value.dates;
57
- return e ? [e.begin ?? "begin", e.end ?? "end"] : [];
58
- }
59
- let { filters: j, page: M, active: N, apply: P, reset: re, goToPage: F } = fe({ keys: T.value }), L = {
60
- t: r,
61
- locale: i,
62
- tr: (e, t) => c.tr(e, t, i.value, "en"),
63
- renderInline: Y,
64
- renderPlain: X
65
- };
66
- function R(e, t) {
67
- if (typeof t.values == "function") return [t.values(e)].flat();
68
- let n = e?.[t.field];
69
- return Array.isArray(n) ? n : [n];
70
- }
71
- let z = f(() => {
72
- let e = x.value, t = S.value ?? [];
73
- e.scope && (t = t.filter((t) => e.scope(t, j, L)));
74
- for (let [n, r] of Object.entries(e.facets ?? {})) {
75
- let e = j[n];
76
- e && (t = t.filter((t) => R(t, r).map(String).includes(String(e))));
77
- }
78
- e.match && (t = t.filter((t) => e.match(t, j, L))), e.narrow && (t = e.narrow(t, j, L)), e.dates && (t = H(t, {
79
- begin: j[e.dates.begin ?? "begin"],
80
- end: j[e.dates.end ?? "end"],
81
- mode: e.dates.mode ?? "overlap",
82
- fields: e.dates.fields
83
- }));
84
- let n = e.sort ?? "chronological";
85
- return typeof n == "function" ? n(t) : n === "chronological" ? Z(t) : n && typeof n == "object" ? Z(t, n) : t;
86
- }), B = f(() => x.value.facetScope === "matching" ? z.value : S.value ?? []), V = le(B, () => x.value.facets ?? {}), U = me(z, {
87
- page: M,
88
- size: () => x.value.pageSize ?? 20
89
- }), ae = f(() => x.value.recordRoute ?? (t.entity ? `${t.entity}-detail` : "item"));
90
- function W(e) {
91
- let t = L.tr(u, e.id).name ?? e.internal_name ?? e.id;
92
- return {
93
- id: e.id,
94
- image: e.images?.[0]?.url ?? "",
95
- imageAlt: X(String(t)),
96
- name: Y(String(t)),
97
- meta: [],
98
- badge: e.type ?? "",
99
- to: {
100
- name: ae.value,
101
- params: { id: e.id }
102
- }
103
- };
104
- }
105
- let G = f(() => U.value.rows.map((e) => (x.value.record ?? W)(e, L))), K = f(() => ({
106
- filters: j,
107
- active: N.value,
108
- apply: P,
109
- reset: re,
110
- goToPage: F,
111
- matching: z.value,
112
- pageInfo: U.value,
113
- options: V.value
114
- })), oe = f(() => {
115
- let e = x.value;
116
- return e.summary ? e.summary({
117
- ...K.value,
118
- t: r,
119
- total: (S.value ?? []).length
120
- }) : [{
121
- label: r(e.summaryLabel ?? "catalogue.results.itemsFound"),
122
- count: U.value.total
123
- }];
124
- }), q = f(() => x.value.filterMode ?? "apply"), J = f(() => x.value.controls ?? []), se = f(() => J.value.length > 0 || !!x.value.panel);
125
- function ce(e, t) {
126
- q.value === "immediate" ? P({ [e]: t }) : j[e] = t;
127
- }
128
- let ue = f(() => r(x.value.empty ?? "catalogue.results.noResultsFilter")), pe = f(() => x.value.variant === "grid"), he = f(() => ({
129
- window: 5,
130
- jump: !1,
131
- ends: !0,
132
- ...x.value.pagination ?? {}
133
- }));
134
- return (e, t) => (w(), h("section", { class: te(["mwnf-catalogue", { "mwnf-catalogue--boxed": x.value.boxed }]) }, [
135
- O(e.$slots, "before", C(b(K.value))),
136
- x.value.title ? (w(), h("h1", be, k(A(r)(x.value.title)), 1)) : m("", !0),
137
- se.value || e.$slots.filters ? (w(), p(o, {
138
- key: 1,
139
- class: "mwnf-catalogue__filters",
140
- mode: q.value,
141
- title: x.value.filterTitle ? A(r)(x.value.filterTitle) : "",
142
- "reset-label": x.value.resetLabel ? A(r)(x.value.resetLabel) : "",
143
- onApply: t[2] ||= (e) => A(P)(),
144
- onReset: t[3] ||= (e) => A(re)()
145
- }, {
146
- default: I(() => [(w(!0), h(d, null, D(J.value, (e) => (w(), h(d, { key: e.key }, [e.type === "year" ? (w(), h("label", xe, [e.label ? (w(), h("span", Se, k(A(r)(e.label)), 1)) : m("", !0), g("input", {
147
- type: "number",
148
- class: "mwnf-facet__select",
149
- value: A(j)[e.key],
150
- placeholder: e.placeholder ? A(r)(e.placeholder) : "",
151
- onInput: (t) => A(j)[e.key] = t.target.value,
152
- onChange: t[0] ||= (e) => q.value === "immediate" ? A(P)() : null
153
- }, null, 40, Ce)])) : e.type === "query" ? (w(), h("label", we, [e.label ? (w(), h("span", Te, k(A(r)(e.label)), 1)) : m("", !0), g("input", {
154
- type: "text",
155
- class: "mwnf-facet__select",
156
- value: A(j)[e.key],
157
- placeholder: e.placeholder ? A(r)(e.placeholder) : "",
158
- onInput: (t) => A(j)[e.key] = t.target.value,
159
- onChange: t[1] ||= (e) => q.value === "immediate" ? A(P)() : null
160
- }, null, 40, Ee)])) : e.type === "checkbox" ? (w(), h("label", De, [g("input", {
161
- type: "checkbox",
162
- class: "mwnf-facet__checkbox",
163
- checked: A(j)[e.key] === "1",
164
- onChange: (t) => ce(e.key, t.target.checked ? "1" : "")
165
- }, null, 40, Oe), e.label ? (w(), h("span", ke, k(A(r)(e.label)), 1)) : m("", !0)])) : (w(), p(l, {
166
- key: 3,
167
- "model-value": A(j)[e.key],
168
- label: e.label ? A(r)(e.label) : "",
169
- options: A(V)[e.key] ?? [],
170
- placeholder: e.placeholder ? A(r)(e.placeholder) : "",
171
- "any-label": e.anyLabel ? A(r)(e.anyLabel) : "",
172
- "hide-empty": !!e.hideEmpty,
173
- "onUpdate:modelValue": (t) => ce(e.key, t)
174
- }, null, 8, [
175
- "model-value",
176
- "label",
177
- "options",
178
- "placeholder",
179
- "any-label",
180
- "hide-empty",
181
- "onUpdate:modelValue"
182
- ]))], 64))), 128)), O(e.$slots, "filters", C(b(K.value)))]),
183
- _: 3
184
- }, 8, [
185
- "mode",
186
- "title",
187
- "reset-label"
188
- ])) : m("", !0),
189
- y(s, { parts: oe.value }, _({ _: 2 }, [e.$slots.actions ? {
190
- name: "actions",
191
- fn: I(() => [O(e.$slots, "actions", C(b(K.value)))]),
192
- key: "0"
193
- } : void 0]), 1032, ["parts"]),
194
- g("div", Ae, [g("div", je, [(w(), p(ne(pe.value ? n : a), {
195
- records: G.value,
196
- "action-label": x.value.actionLabel ? A(r)(x.value.actionLabel) : ""
197
- }, {
198
- empty: I(() => [O(e.$slots, "empty", C(b(K.value)), () => [v(k(ue.value), 1)])]),
199
- _: 3
200
- }, 8, ["records", "action-label"])), y(ee, {
201
- "page-info": A(U),
202
- window: he.value.window,
203
- jump: he.value.jump,
204
- ends: he.value.ends,
205
- onNavigate: A(F)
206
- }, null, 8, [
207
- "page-info",
208
- "window",
209
- "jump",
210
- "ends",
211
- "onNavigate"
212
- ])]), e.$slots.aside ? (w(), h("aside", Me, [O(e.$slots, "aside", C(b(K.value)))])) : m("", !0)]),
213
- O(e.$slots, "after", C(b(K.value)))
214
- ], 2));
215
- }
216
- }, Pe = ["dir"], Fe = {
217
- key: 0,
218
- class: "mwnf-essay__breadcrumb"
219
- }, Ie = { class: "mwnf-essay__breadcrumb-label" }, Le = {
220
- key: 1,
221
- class: "mwnf-essay__breadcrumb-link"
222
- }, Re = ["aria-label"], ze = { class: "mwnf-essay__title" }, Be = {
223
- key: 0,
224
- class: "mwnf-essay__number"
225
- }, Ve = ["innerHTML"], He = { class: "mwnf-essay__body" }, Ue = { class: "mwnf-essay__main" }, We = {
226
- key: 0,
227
- class: "mwnf-essay__status"
228
- }, Ge = ["innerHTML"], Ke = ["innerHTML"], qe = {
229
- key: 4,
230
- class: "mwnf-essay__nav"
231
- }, Je = {
232
- key: 1,
233
- class: "mwnf-essay__nav-spacer"
234
- }, Ye = {
235
- key: 0,
236
- class: "mwnf-essay__side"
237
- }, Xe = {
238
- key: 0,
239
- class: "mwnf-essay__panel"
240
- }, Ze = {
241
- key: 0,
242
- class: "mwnf-essay__variants"
243
- }, Qe = ["aria-pressed", "onClick"], $e = ["src", "alt"], et = ["innerHTML"], tt = {
244
- key: 0,
245
- class: "mwnf-essay__panel-label"
246
- }, nt = ["innerHTML"], rt = ["innerHTML"], it = {
247
- key: 0,
248
- class: "mwnf-essay__thumbs"
249
- }, at = ["onClick"], ot = ["src"], st = {
250
- key: 2,
251
- class: "mwnf-essay__status"
252
- }, ct = {
253
- __name: "EssayView",
254
- props: {
255
- spec: {
256
- type: Object,
257
- required: !0
258
- },
259
- id: {
260
- type: String,
261
- required: !0
262
- }
263
- },
264
- setup(a) {
265
- let o = a, { t: s } = de(), c = Q(), l = j();
266
- function ee(e) {
267
- return !!e && typeof e.walk == "function" && typeof e.children == "function";
268
- }
269
- function u(e) {
270
- return typeof e == "string" ? e : "themes";
271
- }
272
- let _ = o.spec.entity ?? "items", x = o.spec.tree, S = x?.entity ?? (x?.themes ? u(x.themes) : o.spec.entity ?? "collections"), T = ee(x) ? x : x?.themes ? ce({
273
- source: "themes",
274
- entity: S,
275
- childType: x.childType
276
- }) : ce({
277
- purpose: x?.purpose,
278
- rootId: x?.rootId,
279
- childType: x?.childType,
280
- entity: S,
281
- order: x?.order
282
- }), ne = ie(S), M = f(() => ne.value !== null), N = f(() => o.spec), P = f(() => T.byId.value.get(o.id) ?? null), re = f(() => T.parents(o.id).at(-1) ?? null), L = f(() => {
283
- if (re.value) return T.children(re.value.id);
284
- let e = T.root.value;
285
- return e ? T.children(e.id) : T.walk().filter((e) => T.parents(e.id).length === 0);
286
- }), R = f(() => L.value.findIndex((e) => e.id === o.id)), V = f(() => N.value.navigation || !1), H = f(() => V.value === "siblings" ? R.value > 0 ? L.value[R.value - 1] : null : V.value === "tree" ? T.previous(o.id) : null), U = f(() => V.value === "siblings" ? R.value !== -1 && R.value < L.value.length - 1 ? L.value[R.value + 1] : null : V.value === "tree" ? T.next(o.id) : null), { language: G, dir: K } = he(P, { entity: S }), oe = f(() => P.value ? c.tr(S, P.value.id, G.value, "en") : {}), q = E(!1);
287
- F(() => [P.value?.id, G.value], async () => {
288
- if (q.value = !1, !P.value) {
289
- q.value = !0;
290
- return;
291
- }
292
- let e = G.value === "en" ? ["en"] : [G.value, "en"];
293
- await Promise.all([S, _].flatMap((t) => e.map((e) => c.loadTranslations(t, e)))), q.value = !0;
294
- }, { immediate: !0 });
295
- function J(e) {
296
- if (!e) return "";
297
- let t = N.value.placeholder, n = (e) => !!e && !!t && t.test(e), r = c.tr(S, e.id, G.value, "en");
298
- if (r.title && !n(r.title)) return r.title;
299
- let i = c.tr(S, e.id, "en").title;
300
- return i && !n(i) ? i : e.internal_name ?? e.id;
301
- }
302
- let Z = f(() => ({
303
- node: P.value,
304
- text: oe.value,
305
- language: G.value,
306
- tree: T,
307
- select: dt,
308
- t: s,
309
- tr: (e, t) => c.tr(e, t, G.value, "en")
310
- }));
311
- function le(e, t) {
312
- return t.split(".").reduce((e, t) => e?.[t], e);
313
- }
314
- function fe(e, t) {
315
- return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : le(t.text, e) ?? "";
316
- }
317
- let pe = f(() => fe(N.value.quote ?? "quote", Z.value)), me = f(() => fe(N.value.body ?? "description", Z.value)), ge = f(() => {
318
- if (!N.value.glossary || !P.value) return [];
319
- let e = [pe.value, me.value].filter(Boolean);
320
- return W(e.join("\n\n"), G.value);
321
- }), _e = f(() => ae(ge.value)), { active: ve, onClick: ye, close: be } = ue(ge), xe = f(() => ve.value ? se(ve.value.definition, { breaks: !0 }) : ""), Se = f(() => P.value ? N.value.heading ? N.value.heading(Z.value) : Y(String(J(P.value)), { glossary: _e.value }) : ""), Ce = f(() => pe.value ? Y(String(pe.value), { glossary: _e.value }) : ""), we = f(() => me.value ? se(String(me.value), {
322
- breaks: !0,
323
- glossary: _e.value
324
- }) : ""), Te = f(() => P.value ? N.value.about?.(P.value) ?? !1 : !1), Ee = f(() => !!Te.value);
325
- function De(e) {
326
- let t = Te.value;
327
- return t && typeof t == "object" ? !!t[e] : !!N.value.aboutKeeps?.includes(e);
328
- }
329
- let Oe = [
330
- [1e3, "M"],
331
- [900, "CM"],
332
- [500, "D"],
333
- [400, "CD"],
334
- [100, "C"],
335
- [90, "XC"],
336
- [50, "L"],
337
- [40, "XL"],
338
- [10, "X"],
339
- [9, "IX"],
340
- [5, "V"],
341
- [4, "IV"],
342
- [1, "I"]
343
- ];
344
- function ke(e) {
345
- let t = e, n = "";
346
- for (let [e, r] of Oe) for (; t >= e;) n += r, t -= e;
347
- return n;
348
- }
349
- let Ae = f(() => {
350
- let e = N.value.numbering;
351
- if (!e || !P.value) return "";
352
- let t = (L.value.length ? L.value : [P.value]).findIndex((e) => e.id === o.id), n = t >= 0 ? t + 1 : 1;
353
- return e === "roman" ? ke(n) : String(n);
354
- });
355
- function je(e) {
356
- return e ? Array.isArray(e.items) ? e.items.map((e) => e && typeof e == "object" ? e.id : e).filter((e) => e != null) : Array.isArray(e.item_ids) ? e.item_ids.filter((e) => e != null) : Array.isArray(e.pictures) ? e.pictures.map((e) => e?.picture_item_id).filter((e) => e != null) : [] : [];
357
- }
358
- let Me = B(_), Ne = f(() => {
359
- let e = N.value.items?.of ?? je;
360
- return P.value ? e(P.value, Z.value) : [];
361
- }), ct = f(() => Ne.value.map((e) => Me.value.get(e)).filter(Boolean)), lt = E(null);
362
- F(ct, (e) => {
363
- e.some((e) => e.id === lt.value) || (lt.value = e[0]?.id ?? null);
364
- }, { immediate: !0 });
365
- let ut = f(() => ct.value.find((e) => e.id === lt.value) ?? ct.value[0] ?? null);
366
- function dt(e) {
367
- lt.value = e;
368
- }
369
- function ft(e) {
370
- let t = N.value.items?.route;
371
- return !t || !e ? null : typeof t == "function" ? t(e, Z.value) : {
372
- name: t,
373
- params: { id: e.id }
374
- };
375
- }
376
- function pt(e) {
377
- let t = N.value.route;
378
- return !t || !e ? null : typeof t == "function" ? t(e, Z.value) : {
379
- name: t,
380
- params: { id: e.id }
381
- };
382
- }
383
- function mt(e) {
384
- if (!e) return null;
385
- let t = c.tr(_, e.id, G.value, "en").name ?? e.internal_name ?? e.id;
386
- return {
387
- name: Y(String(t)),
388
- image: e.images?.[0]?.url ?? "",
389
- imageAlt: X(String(t))
390
- };
391
- }
392
- let ht = f(() => {
393
- let e = ut.value;
394
- if (!e) return null;
395
- let t = mt(e), n = N.value.items?.caption?.(e, P.value, Z.value);
396
- return {
397
- ...t,
398
- ...n
399
- };
400
- }), gt = f(() => !!N.value.panel), _t = f(() => {
401
- let e = ut.value;
402
- if (!e) return [];
403
- let t = ht.value, n = e.images?.[0]?.url ? [{
404
- id: "__primary",
405
- image: e.images[0].url,
406
- alt: t?.imageAlt ?? "",
407
- caption: {
408
- title: t?.name ?? "",
409
- justification: "",
410
- fields: null
411
- }
412
- }] : [], r = N.value.panel?.variants?.(e, Z.value) ?? [];
413
- return [...n, ...r.map((e, t) => ({
414
- id: e.id ?? `variant-${t}`,
415
- ...e
416
- }))];
417
- }), vt = E(null);
418
- F(_t, (e) => {
419
- e.some((e) => e.id === vt.value) || (vt.value = e[0]?.id ?? null);
420
- }, { immediate: !0 });
421
- let yt = f(() => _t.value.find((e) => e.id === vt.value) ?? _t.value[0] ?? null);
422
- function bt(e) {
423
- vt.value = e;
424
- }
425
- let xt = f(() => {
426
- let e = yt.value;
427
- return e?.image ? [{
428
- url: e.image,
429
- alt: e.alt ?? ""
430
- }] : [];
431
- }), St = f(() => {
432
- let e = ut.value;
433
- return !e || !N.value.panel?.fields ? [] : N.value.panel.fields(e, P.value, Z.value) ?? [];
434
- }), Ct = f(() => {
435
- let e = yt.value?.caption?.fields;
436
- return e == null ? St.value : e.map((e) => ({
437
- label: e.label ? s(e.label) : "",
438
- value: e.value
439
- }));
440
- }), wt = f(() => {
441
- let e = yt.value?.caption?.justification;
442
- return e ? Y(String(e)) : "";
443
- }), Tt = f(() => ct.value.map((e) => {
444
- let t = mt(e), n = N.value.items?.meta?.(e, Z.value) ?? [], r = N.value.items?.badge?.(e, Z.value) ?? "";
445
- return {
446
- id: e.id,
447
- image: t.image,
448
- imageAlt: t.imageAlt,
449
- name: t.name,
450
- meta: n,
451
- badge: r,
452
- to: ft(e)
453
- };
454
- })), Et = f(() => N.value.breadcrumb && P.value ? T.parents(o.id) : []), Dt = f(() => {
455
- let e = N.value.tabs;
456
- return e ? e === "children" ? P.value ? T.children(P.value.id) : [] : L.value : [];
457
- }), Ot = f(() => N.value.previous ?? "core.pagination.previous"), kt = f(() => N.value.next ?? "core.pagination.next"), At = f(() => N.value.backTo ?? "record.action.backToResults"), jt = f(() => N.value.inThisTheme ?? "core.nav.inThisSection"), Mt = f(() => N.value.seeAll ?? "catalogue.results.seeDatabaseEntry"), $ = f(() => ({
458
- ...Z.value,
459
- items: ct.value,
460
- selected: ut.value,
461
- selectedVariant: yt.value,
462
- selectVariant: bt,
463
- breadcrumb: Et.value,
464
- previous: H.value,
465
- next: U.value
466
- })), Nt = f(() => Ee.value && !De("panel") ? !1 : gt.value || ct.value.length > 0 || !!l.aside), Pt = f(() => (!Ee.value || De("navigation")) && !!V.value && !!(H.value || U.value));
467
- return (o, c) => M.value && !P.value ? (w(), p(A(z), { key: 0 })) : P.value ? (w(), h("article", {
468
- key: 1,
469
- class: te(["mwnf-essay", { "mwnf-essay--about": Ee.value }]),
470
- dir: A(K) || void 0,
471
- onClick: c[0] ||= (...e) => A(ye) && A(ye)(...e)
472
- }, [
473
- O(o.$slots, "header", C(b($.value)), () => [
474
- Et.value.length ? (w(), h("p", Fe, [g("span", Ie, k(A(s)(At.value)), 1), (w(!0), h(d, null, D(Et.value, (t) => (w(), h(d, { key: t.id }, [pt(t) ? (w(), p(e, {
475
- key: 0,
476
- to: pt(t),
477
- class: "mwnf-essay__breadcrumb-link"
478
- }, {
479
- default: I(() => [v(k(J(t)), 1)]),
480
- _: 2
481
- }, 1032, ["to"])) : (w(), h("span", Le, k(J(t)), 1))], 64))), 128))])) : m("", !0),
482
- Dt.value.length > 1 ? (w(), h("div", {
483
- key: 1,
484
- class: "mwnf-essay__tabs",
485
- role: "tablist",
486
- "aria-label": A(s)(jt.value)
487
- }, [(w(!0), h(d, null, D(Dt.value, (t) => (w(), p(e, {
488
- key: t.id,
489
- to: pt(t),
490
- class: te(["mwnf-essay__tab", { "mwnf-essay__tab--active": t.id === a.id }])
491
- }, {
492
- default: I(() => [v(k(J(t)), 1)]),
493
- _: 2
494
- }, 1032, ["to", "class"]))), 128))], 8, Re)) : m("", !0),
495
- g("h1", ze, [Ae.value ? (w(), h("span", Be, k(Ae.value), 1)) : m("", !0), g("span", { innerHTML: Se.value }, null, 8, Ve)])
496
- ]),
497
- g("div", He, [g("div", Ue, [
498
- q.value ? m("", !0) : (w(), h("p", We, k(A(s)("core.status.loading")), 1)),
499
- Ce.value ? (w(), h("p", {
500
- key: 1,
501
- class: "mwnf-essay__quote",
502
- innerHTML: Ce.value
503
- }, null, 8, Ge)) : m("", !0),
504
- O(o.$slots, "before-body", C(b($.value))),
505
- we.value ? (w(), h("div", {
506
- key: 2,
507
- class: "mwnf-essay__prose mwnf-sheet__block",
508
- innerHTML: we.value
509
- }, null, 8, Ke)) : m("", !0),
510
- O(o.$slots, "after-body", C(b($.value))),
511
- Ee.value ? m("", !0) : O(o.$slots, "justifications", C(b($.value)), void 0, void 0, 3),
512
- Pt.value ? (w(), h("div", qe, [O(o.$slots, "navigation", C(b($.value)), () => [H.value ? (w(), p(e, {
513
- key: 0,
514
- to: pt(H.value),
515
- class: "mwnf-essay__nav-link mwnf-essay__nav-link--previous"
516
- }, {
517
- default: I(() => [v("← " + k(A(s)(Ot.value)), 1)]),
518
- _: 1
519
- }, 8, ["to"])) : (w(), h("span", Je)), U.value ? (w(), p(e, {
520
- key: 2,
521
- to: pt(U.value),
522
- class: "mwnf-essay__nav-link mwnf-essay__nav-link--next"
523
- }, {
524
- default: I(() => [v(k(A(s)(kt.value)) + " →", 1)]),
525
- _: 1
526
- }, 8, ["to"])) : m("", !0)])])) : m("", !0)
527
- ]), Nt.value ? (w(), h("div", Ye, [
528
- O(o.$slots, "panel", C(b($.value)), () => [gt.value && ht.value ? (w(), h("div", Xe, [
529
- y(r, { images: xt.value }, null, 8, ["images"]),
530
- _t.value.length > 1 ? (w(), h("ul", Ze, [(w(!0), h(d, null, D(_t.value, (e) => (w(), h("li", { key: e.id }, [g("button", {
531
- type: "button",
532
- class: te(["mwnf-essay__variant", { "mwnf-essay__variant--active": e.id === yt.value?.id }]),
533
- "aria-pressed": e.id === yt.value?.id ? "true" : "false",
534
- onClick: (t) => bt(e.id)
535
- }, [e.image ? (w(), h("img", {
536
- key: 0,
537
- src: e.image,
538
- alt: e.alt ?? "",
539
- loading: "lazy"
540
- }, null, 8, $e)) : m("", !0)], 10, Qe)]))), 128))])) : m("", !0),
541
- g("h3", {
542
- class: "mwnf-essay__panel-name",
543
- innerHTML: yt.value?.caption?.title || ht.value.name
544
- }, null, 8, et),
545
- (w(!0), h(d, null, D(Ct.value, (e, t) => (w(), h("p", {
546
- key: t,
547
- class: "mwnf-essay__panel-field"
548
- }, [e.label ? (w(), h("span", tt, k(e.label), 1)) : m("", !0), g("span", { innerHTML: e.value }, null, 8, nt)]))), 128)),
549
- wt.value ? (w(), h("p", {
550
- key: 1,
551
- class: "mwnf-essay__panel-justification mwnf-sheet__block",
552
- innerHTML: wt.value
553
- }, null, 8, rt)) : m("", !0),
554
- ft(ut.value) ? (w(), p(e, {
555
- key: 2,
556
- to: ft(ut.value),
557
- class: "mwnf-essay__panel-link"
558
- }, {
559
- default: I(() => [v(k(A(s)(Mt.value)) + " →", 1)]),
560
- _: 1
561
- }, 8, ["to"])) : m("", !0)
562
- ])) : m("", !0)]),
563
- O(o.$slots, "thumbnails", C(b($.value)), () => [gt.value && ct.value.length > 1 ? (w(), h("ul", it, [(w(!0), h(d, null, D(ct.value, (e) => (w(), h("li", { key: e.id }, [g("button", {
564
- type: "button",
565
- class: te(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === ut.value?.id }]),
566
- onClick: (t) => dt(e.id)
567
- }, [e.images?.[0]?.url ? (w(), h("img", {
568
- key: 0,
569
- src: e.images[0].url,
570
- alt: "",
571
- loading: "lazy"
572
- }, null, 8, ot)) : m("", !0)], 10, at)]))), 128))])) : !gt.value && Tt.value.length ? (w(), p(n, {
573
- key: 1,
574
- records: Tt.value
575
- }, null, 8, ["records"])) : m("", !0)]),
576
- O(o.$slots, "aside", C(b($.value)))
577
- ])) : m("", !0)]),
578
- O(o.$slots, "after", C(b($.value)), () => [y(t)]),
579
- y(i, {
580
- term: A(ve),
581
- html: xe.value,
582
- dir: A(K),
583
- onClose: A(be)
584
- }, null, 8, [
585
- "term",
586
- "html",
587
- "dir",
588
- "onClose"
589
- ])
590
- ], 10, Pe)) : (w(), h("p", st, k(A(s)("core.status.loading")), 1));
591
- }
592
- }, lt = { class: "mwnf-link-list" }, ut = {
593
- key: 0,
594
- class: "mwnf-link-list__back"
595
- }, dt = {
596
- key: 1,
597
- class: "mwnf-link-list__title"
598
- }, ft = {
599
- key: 2,
600
- class: "mwnf-link-list__groups"
601
- }, pt = {
602
- key: 0,
603
- class: "mwnf-link-list__heading"
604
- }, mt = {
605
- key: 1,
606
- class: "mwnf-link-list__links"
607
- }, ht = ["innerHTML"], gt = ["innerHTML"], _t = {
608
- key: 3,
609
- class: "mwnf-link-list__empty"
610
- }, vt = {
611
- __name: "LinkListView",
612
- props: { spec: {
613
- type: Object,
614
- required: !0
615
- } },
616
- setup(t) {
617
- let n = t, { t: r } = de(), i = f(() => ((typeof n.spec.groups == "function" ? n.spec.groups({}) : n.spec.groups ?? []) ?? []).filter((e) => e.links?.length > 0)), a = f(() => n.spec.title ? r(n.spec.title) : ""), o = f(() => n.spec.back?.label ? r(n.spec.back.label) : ""), s = f(() => r(n.spec.empty ?? "catalogue.results.noResults"));
618
- return (t, c) => (w(), h("div", lt, [
619
- n.spec.back && o.value ? (w(), h("div", ut, [y(e, {
620
- to: n.spec.back.to,
621
- href: n.spec.back.href
622
- }, {
623
- default: I(() => [v(" ← " + k(o.value), 1)]),
624
- _: 1
625
- }, 8, ["to", "href"])])) : m("", !0),
626
- a.value ? (w(), h("h1", dt, k(a.value), 1)) : m("", !0),
627
- O(t.$slots, "before"),
628
- i.value.length ? (w(), h("div", ft, [(w(!0), h(d, null, D(i.value, (n, i) => (w(), h("section", {
629
- key: i,
630
- class: "mwnf-link-list__group"
631
- }, [O(t.$slots, "group", { group: n }, () => [n.heading ? (w(), h("h2", pt, k(A(r)(n.heading)), 1)) : m("", !0), n.links?.length ? (w(), h("ul", mt, [(w(!0), h(d, null, D(n.links, (t, n) => (w(), h("li", {
632
- key: n,
633
- class: "mwnf-link-list__item"
634
- }, [y(e, {
635
- class: "mwnf-link-list__link",
636
- to: t.to,
637
- href: t.href
638
- }, {
639
- default: I(() => [g("span", { innerHTML: A(oe)(t.label) }, null, 8, ht)]),
640
- _: 2
641
- }, 1032, ["to", "href"]), t.note ? (w(), h("div", {
642
- key: 0,
643
- class: "mwnf-link-list__note",
644
- innerHTML: A(oe)(t.note)
645
- }, null, 8, gt)) : m("", !0)]))), 128))])) : m("", !0)])]))), 128))])) : (w(), h("div", _t, k(s.value), 1)),
646
- O(t.$slots, "after")
647
- ]));
648
- }
649
- }, yt = { class: "mwnf-partner-list" }, bt = {
650
- key: 0,
651
- class: "mwnf-partner-list__title"
652
- }, xt = {
653
- key: 1,
654
- class: "mwnf-partner-list__count"
655
- }, St = {
656
- key: 2,
657
- class: "mwnf-partner-list__toggle"
658
- }, Ct = {
659
- key: 3,
660
- class: "mwnf-partner-list__groups"
661
- }, wt = {
662
- key: 0,
663
- class: "mwnf-partner-list__group-title"
664
- }, Tt = { class: "mwnf-partner-list__tier" }, Et = { class: "mwnf-partner-list__row" }, Dt = {
665
- key: 0,
666
- class: "mwnf-partner-list__children"
667
- }, Ot = {
668
- key: 0,
669
- class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
670
- }, kt = { class: "mwnf-partner-list__tier-label" }, At = {
671
- key: 4,
672
- class: "mwnf-partner-list__empty"
673
- }, jt = {
674
- __name: "PartnerListView",
675
- props: { spec: {
676
- type: Object,
677
- required: !0
678
- } },
679
- setup(e) {
680
- let t = e, { t: n, locale: r } = de(), i = Q(), a = f(() => t.spec), o = f(() => a.value.entity ?? "partners"), s = ie(o.value);
681
- o.value && i.loadTranslations(o.value, "en");
682
- let l = {
683
- t: n,
684
- locale: r,
685
- tr: (e) => i.tr(o.value, e, r.value, "en"),
686
- renderInline: Y,
687
- renderPlain: X
688
- }, { filters: ee, apply: u } = fe({
689
- keys: ["order"],
690
- page: !1
691
- }), _ = f(() => ee.order === "desc" ? "desc" : "asc");
692
- function v() {
693
- u({ order: _.value === "asc" ? "desc" : "asc" });
694
- }
695
- let x = f(() => {
696
- let e = a.value, t = s.value ?? [];
697
- return e.scope ? t.filter((t) => e.scope(t, l)) : t;
698
- }), te = f(() => a.value.route);
699
- function T(e) {
700
- let t = te.value;
701
- return t ? typeof t == "function" ? t(e, l) : {
702
- name: t,
703
- params: { id: e.id }
704
- } : null;
705
- }
706
- function E(e) {
707
- let t = a.value.objectsRoute;
708
- return J(e, l.tr(e.id), {
709
- route: T,
710
- objectsRoute: t ? (e) => t(e, l) : null
711
- });
712
- }
713
- function A(e, t) {
714
- let n = t.name ?? "";
715
- return {
716
- ...J(e, {}, {}),
717
- name: n,
718
- plainName: M(n),
719
- city: t.city ?? "",
720
- location: t.city ?? "",
721
- logos: t.logo ? [{
722
- url: t.logo,
723
- alt: M(n),
724
- type: ""
725
- }] : [],
726
- itemCount: t.count ?? 0,
727
- route: t.route ?? null
728
- };
729
- }
730
- function j(e) {
731
- if (a.value.record) {
732
- let t = a.value.record(e, l);
733
- return {
734
- partner: e,
735
- row: t,
736
- view: A(e, t)
737
- };
738
- }
739
- let t = E(e);
740
- return {
741
- partner: e,
742
- row: {
743
- name: t.name,
744
- city: t.city,
745
- logo: t.logos[0]?.url ?? "",
746
- count: t.itemCount,
747
- route: t.route
748
- },
749
- view: t
750
- };
751
- }
752
- function M(e) {
753
- return String(e ?? "").replace(/<[^>]*>/g, "");
754
- }
755
- let N = f(() => a.value.nested ? q(x.value) : null), P = f(() => {
756
- let e = a.value, t = e.group?.tier ?? !1, n = (e.group?.order ?? "country") === "name", r = n ? x.value.map((e) => ({
757
- ...e,
758
- country_id: "\0"
759
- })) : x.value, i = G(r, {
760
- label: n ? () => "" : (t) => e.label ? e.label(t, l) : t,
761
- tier: t,
762
- order: _.value
763
- }), o = (e, t) => M(e.row.name).localeCompare(M(t.row.name));
764
- return i.map((t) => {
765
- let r = t.main.map(j).sort(o), i = t.associated.map(j).sort(o);
766
- if (n && _.value === "desc" && (r.reverse(), i.reverse()), e.nested && N.value) {
767
- let e = new Set(i.map((e) => e.partner.id));
768
- r = r.map((t) => {
769
- let n = N.value.children(t.partner.id).filter((t) => e.has(t.id));
770
- for (let t of n) e.delete(t.id);
771
- return {
772
- ...t,
773
- children: n.map(j)
774
- };
775
- }), i = i.filter((t) => e.has(t.partner.id));
776
- }
777
- return {
778
- country: t.country,
779
- label: t.label,
780
- main: r,
781
- associated: i
782
- };
783
- });
784
- }), re = f(() => P.value.some((e) => e.main.length > 0 || e.associated.length > 0)), F = f(() => n(a.value.associatedLabel ?? "partner.list.associated")), L = f(() => ({
785
- objectsLabel: a.value.objectsLabel ?? "partner.item.objectsInSite",
786
- emptyLabel: a.value.emptyLabel ?? "",
787
- show: { actions: !!a.value.actions }
788
- })), R = f(() => n(a.value.foundLabel ?? "partner.list.partnersFound")), z = f(() => n(a.value.sortAscendingLabel ?? "partner.list.sortAscending")), B = f(() => n(a.value.sortDescendingLabel ?? "partner.list.sortDescending")), V = f(() => n(a.value.empty ?? "catalogue.results.noResults")), H = f(() => a.value.title ? n(a.value.title) : ""), U = f(() => P.value.reduce((e, t) => e + t.main.length + t.associated.length, 0)), ae = f(() => a.value.variant ?? "accordion"), W = f(() => ({
789
- t: n,
790
- locale: r,
791
- groups: P.value,
792
- orderDir: _.value,
793
- toggleOrder: v
794
- }));
795
- return (e, t) => (w(), h("section", yt, [
796
- H.value ? (w(), h("h1", bt, k(H.value), 1)) : m("", !0),
797
- a.value.count ? (w(), h("div", xt, k(R.value) + ": " + k(U.value), 1)) : m("", !0),
798
- O(e.$slots, "before", C(b(W.value))),
799
- a.value.orderToggle ? (w(), h("div", St, [g("button", {
800
- type: "button",
801
- class: "mwnf-partner-list__toggle-button",
802
- onClick: v
803
- }, k(_.value === "asc" ? B.value : z.value), 1)])) : m("", !0),
804
- re.value ? (w(), h("div", Ct, [(w(!0), h(d, null, D(P.value, (t) => (w(), p(ne(ae.value === "accordion" ? "details" : "section"), S({
805
- key: t.country ?? "",
806
- class: "mwnf-partner-list__group"
807
- }, { ref_for: !0 }, ae.value === "accordion" ? { open: !0 } : {}), {
808
- default: I(() => [
809
- (w(), p(ne(ae.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
810
- default: I(() => [O(e.$slots, "group-heading", S({ group: t }, { ref_for: !0 }, W.value), () => [t.label ? (w(), h("h2", wt, k(t.label), 1)) : m("", !0)])]),
811
- _: 2
812
- }, 1024)),
813
- g("div", Tt, [(w(!0), h(d, null, D(t.main, (n) => (w(), h("div", {
814
- key: n.partner.id,
815
- class: "mwnf-partner-list__row-block"
816
- }, [g("div", Et, [O(e.$slots, "row", S({
817
- group: t,
818
- partner: n.partner,
819
- row: n.row,
820
- view: n.view
821
- }, { ref_for: !0 }, W.value), () => [y(c, S({
822
- variant: "line",
823
- partner: n.view
824
- }, { ref_for: !0 }, L.value), null, 16, ["partner"])])]), n.children?.length ? (w(), h("div", Dt, [(w(!0), h(d, null, D(n.children, (n) => (w(), h("div", {
825
- key: n.partner.id,
826
- class: "mwnf-partner-list__row mwnf-partner-list__row--child"
827
- }, [O(e.$slots, "row", S({
828
- group: t,
829
- partner: n.partner,
830
- row: n.row,
831
- view: n.view
832
- }, { ref_for: !0 }, W.value), () => [y(c, S({
833
- variant: "line",
834
- partner: n.view
835
- }, { ref_for: !0 }, L.value), null, 16, ["partner"])])]))), 128))])) : m("", !0)]))), 128))]),
836
- t.associated.length ? (w(), h("div", Ot, [g("p", kt, k(F.value), 1), (w(!0), h(d, null, D(t.associated, (n) => (w(), h("div", {
837
- key: n.partner.id,
838
- class: "mwnf-partner-list__row"
839
- }, [O(e.$slots, "row", S({
840
- group: t,
841
- partner: n.partner,
842
- row: n.row,
843
- view: n.view
844
- }, { ref_for: !0 }, W.value), () => [y(c, S({
845
- variant: "line",
846
- partner: n.view
847
- }, { ref_for: !0 }, L.value), null, 16, ["partner"])])]))), 128))])) : m("", !0)
848
- ]),
849
- _: 2
850
- }, 1040))), 128))])) : (w(), h("p", At, k(V.value), 1)),
851
- O(e.$slots, "after", C(b(W.value)))
852
- ]));
853
- }
854
- }, Mt = { class: "mwnf-text-page" }, $ = {
855
- key: 0,
856
- class: "mwnf-text-page__back"
857
- }, Nt = {
858
- key: 1,
859
- class: "mwnf-text-page__heading"
860
- }, Pt = { class: "mwnf-prose" }, Ft = ["innerHTML"], It = {
861
- __name: "TextPageView",
862
- props: { spec: {
863
- type: Object,
864
- required: !0
865
- } },
866
- setup(t) {
867
- let n = t, { t: r } = de(), i = Q(), a = pe(), o = f(() => n.spec.heading ? r(n.spec.heading) : ""), s = f(() => typeof n.spec.body == "string"), c = f(() => s.value ? n.spec.body : null), l = f(() => ({
868
- t: r,
869
- tr: (e, t) => i.tr(e, t, a.value, "en"),
870
- language: a.value
871
- })), ee = f(() => s.value ? null : typeof n.spec.body == "function" ? K(n.spec.body(l.value)) : null), u = f(() => n.spec.back === !1 ? null : n.spec.back === !0 ? r("core.action.back") : n.spec.back?.label ? r(n.spec.back.label) : null);
872
- return (t, r) => (w(), h("div", Mt, [
873
- u.value && (n.spec.back === !0 || n.spec.back?.to || n.spec.back?.href) ? (w(), h("div", $, [y(e, {
874
- to: n.spec.back === !0 ? {} : n.spec.back?.to,
875
- href: n.spec.back === !0 ? "#" : n.spec.back?.href
876
- }, {
877
- default: I(() => [v(" ← " + k(u.value), 1)]),
878
- _: 1
879
- }, 8, ["to", "href"])])) : m("", !0),
880
- o.value ? (w(), h("h1", Nt, k(o.value), 1)) : m("", !0),
881
- g("div", Pt, [s.value ? (w(), p(A(R), {
882
- key: 0,
883
- keypath: c.value
884
- }, null, 8, ["keypath"])) : ee.value ? (w(), h("div", {
885
- key: 1,
886
- innerHTML: ee.value
887
- }, null, 8, Ft)) : m("", !0)])
888
- ]));
889
- }
890
- }, Lt = { class: "mwnf-search-form__row-label" }, Rt = ["onUpdate:modelValue"], zt = ["value"], Bt = ["onUpdate:modelValue"], Vt = ["value"], Ht = ["onUpdate:modelValue", "placeholder"], Ut = {
891
- key: 0,
892
- class: "mwnf-search-form__dates"
893
- }, Wt = {
894
- key: 1,
895
- class: "mwnf-facet"
896
- }, Gt = { class: "mwnf-facet__label" }, Kt = { value: "" }, qt = ["value"], Jt = {
897
- key: 0,
898
- class: "mwnf-search-form__dates"
899
- }, Yt = { class: "mwnf-search-form__radio-choice" }, Xt = ["value"], Zt = ["onUpdate:modelValue", "disabled"], Qt = ["onUpdate:modelValue"], $t = { class: "mwnf-facet__label" }, en = {
900
- key: 0,
901
- class: "mwnf-search-form__how-to"
902
- }, tn = {
903
- __name: "SearchFormView",
904
- props: { spec: {
905
- type: Object,
906
- required: !0
907
- } },
908
- setup(t) {
909
- let n = t, { t: r } = de(), i = ye(), a = f(() => n.spec), s = f(() => a.value.mode), c = f(() => a.value.entity ? ie(a.value.entity).value ?? [] : []), ee = f(() => a.value.dates === "buckets"), u = f(() => {
910
- let e = a.value.dates;
911
- if (!e || e === "buckets") return null;
912
- let t = e.presets;
913
- return typeof t == "function" ? t() : t ?? V();
914
- });
915
- function _(e) {
916
- return (e ?? []).map((e) => ({
917
- value: e,
918
- label: String(e)
919
- }));
920
- }
921
- let S = f(() => ee.value ? ve(c.value, r) : []), ne = f(() => ee.value ? S.value : _(u.value?.from)), j = f(() => ee.value ? S.value : _(u.value?.to)), F = f(() => !!a.value.dates), R = E(""), z = E(""), B = a.value.language ? ge(a.value.language) : null, H = f(() => B?.languages.value ?? []), U = B?.language ?? E(""), ae = f(() => Object.fromEntries((a.value.facets ?? []).filter((e) => !e.options && e.type !== "year").map((e) => [e.key, { field: e.field ?? e.key }]))), W = le(c, ae), G = f(() => {
922
- let e = {};
923
- for (let t of a.value.facets ?? []) e[t.key] = t.options ?? W.value[t.key] ?? [];
924
- return e;
925
- }), K = [{
926
- key: "AND",
927
- label: "catalogue.search.and"
928
- }, {
929
- key: "OR",
930
- label: "catalogue.search.or"
931
- }], oe = [
932
- "catalogue.search.keywordOne",
933
- "catalogue.search.keywordTwo",
934
- "catalogue.search.keywordThree"
935
- ], q = f(() => a.value.operators ?? K), J = E(Array.from({ length: a.value.rows ?? 3 }, () => ({
936
- keyword: "",
937
- field: a.value.fields?.[0]?.key ?? "",
938
- cond: (a.value.operators ?? K)[0].key
939
- })));
940
- function se(e) {
941
- return oe[e] ? r(oe[e]) : "";
942
- }
943
- let Y = E(a.value.facets?.[0]?.key ?? ""), X = T(Object.fromEntries((a.value.facets ?? []).map((e) => [e.key, ""]))), Z = T(Object.fromEntries((a.value.extras ?? []).map((e) => [e.key, !1])));
944
- function ce() {
945
- let e = {};
946
- for (let t of a.value.extras ?? []) Z[t.key] && (e[t.key] = "1");
947
- return e;
948
- }
949
- function Q(e) {
950
- return i.push({
951
- name: a.value.target,
952
- query: e
953
- });
954
- }
955
- function ue() {
956
- let e = {};
957
- if (s.value === "rows") J.value.forEach((t, n) => {
958
- if (t.keyword) {
959
- if (n === 0) e.q = t.keyword, t.field && (e.field = t.field);
960
- else {
961
- let r = n + 1;
962
- e[`q${r}`] = t.keyword, t.field && (e[`field${r}`] = t.field), e[`op${r}`] = t.cond;
963
- }
964
- }
965
- }), R.value && (e.from = String(R.value)), z.value && (e.to = String(z.value)), U.value && (e.lang = U.value);
966
- else if (s.value === "radio") {
967
- let t = Y.value, n = t ? X[t] : "";
968
- n && (e[t] = String(n));
969
- }
970
- return Object.assign(e, ce()), Q(e);
971
- }
972
- function fe(e, t) {
973
- if (t !== "" && t != null) return Q({
974
- [e]: String(t),
975
- ...ce()
976
- });
977
- }
978
- function pe() {
979
- return Q(ce());
980
- }
981
- let me = f(() => s.value === "facets" ? "immediate" : "apply"), he = f(() => s.value === "radio" ? "core.action.browse" : "core.action.search"), _e = f(() => r(a.value.submitLabel ?? he.value)), be = f(() => r(a.value.showAllLabel ?? "core.action.reset")), xe = f(() => ({
982
- mode: s.value,
983
- submit: ue,
984
- showAll: pe
985
- }));
986
- return (t, n) => (w(), h("section", { class: te(["mwnf-search-form", `mwnf-search-form--${s.value}`]) }, [
987
- O(t.$slots, "intro", C(b(xe.value))),
988
- O(t.$slots, "before", C(b(xe.value))),
989
- y(o, {
990
- class: "mwnf-search-form__panel",
991
- mode: me.value,
992
- "apply-label": _e.value,
993
- "reset-label": be.value,
994
- onApply: ue,
995
- onReset: pe
996
- }, {
997
- default: I(() => [
998
- s.value === "rows" ? (w(), h(d, { key: 0 }, [
999
- (w(!0), h(d, null, D(J.value, (e, t) => (w(), h("div", {
1000
- key: t,
1001
- class: "mwnf-search-form__row"
1002
- }, [
1003
- g("span", Lt, k(se(t)), 1),
1004
- t > 0 ? L((w(), h("select", {
1005
- key: 0,
1006
- "onUpdate:modelValue": (t) => e.cond = t,
1007
- class: "mwnf-facet__select mwnf-search-form__operator"
1008
- }, [(w(!0), h(d, null, D(q.value, (e) => (w(), h("option", {
1009
- key: e.key,
1010
- value: e.key
1011
- }, k(A(r)(e.label)), 9, zt))), 128))], 8, Rt)), [[P, e.cond]]) : m("", !0),
1012
- L(g("select", {
1013
- "onUpdate:modelValue": (t) => e.field = t,
1014
- class: "mwnf-facet__select mwnf-search-form__field"
1015
- }, [(w(!0), h(d, null, D(a.value.fields ?? [], (e) => (w(), h("option", {
1016
- key: e.key,
1017
- value: e.key
1018
- }, k(A(r)(e.label)), 9, Vt))), 128))], 8, Bt), [[P, e.field]]),
1019
- L(g("input", {
1020
- "onUpdate:modelValue": (t) => e.keyword = t,
1021
- type: "text",
1022
- class: "mwnf-search-form__keyword",
1023
- placeholder: A(r)("catalogue.search.keywordPlaceholder")
1024
- }, null, 8, Ht), [[re, e.keyword]])
1025
- ]))), 128)),
1026
- F.value ? (w(), h("div", Ut, [y(l, {
1027
- modelValue: R.value,
1028
- "onUpdate:modelValue": n[0] ||= (e) => R.value = e,
1029
- label: A(r)("catalogue.facet.dateFrom"),
1030
- options: ne.value,
1031
- "any-label": "—"
1032
- }, null, 8, [
1033
- "modelValue",
1034
- "label",
1035
- "options"
1036
- ]), y(l, {
1037
- modelValue: z.value,
1038
- "onUpdate:modelValue": n[1] ||= (e) => z.value = e,
1039
- label: A(r)("catalogue.facet.dateTo"),
1040
- options: j.value,
1041
- "any-label": "—"
1042
- }, null, 8, [
1043
- "modelValue",
1044
- "label",
1045
- "options"
1046
- ])])) : m("", !0),
1047
- a.value.language ? (w(), h("label", Wt, [g("span", Gt, k(A(r)("catalogue.search.language")), 1), L(g("select", {
1048
- "onUpdate:modelValue": n[2] ||= (e) => x(U) ? U.value = e : null,
1049
- class: "mwnf-facet__select mwnf-search-form__language"
1050
- }, [g("option", Kt, k(A(r)("catalogue.search.anyLanguage")), 1), (w(!0), h(d, null, D(H.value, (e) => (w(), h("option", {
1051
- key: e,
1052
- value: e
1053
- }, k(e.toUpperCase()), 9, qt))), 128))], 512), [[P, A(U)]])])) : m("", !0)
1054
- ], 64)) : s.value === "facets" ? (w(), h(d, { key: 1 }, [(w(!0), h(d, null, D(a.value.facets ?? [], (e) => (w(), p(l, {
1055
- key: e.key,
1056
- label: e.label ? A(r)(e.label) : "",
1057
- options: G.value[e.key] ?? [],
1058
- "model-value": X[e.key],
1059
- "onUpdate:modelValue": (t) => fe(e.key, t)
1060
- }, null, 8, [
1061
- "label",
1062
- "options",
1063
- "model-value",
1064
- "onUpdate:modelValue"
1065
- ]))), 128)), F.value ? (w(), h("div", Jt, [y(l, {
1066
- "model-value": R.value,
1067
- label: A(r)("catalogue.facet.startDate"),
1068
- options: ne.value,
1069
- "onUpdate:modelValue": n[3] ||= (e) => {
1070
- R.value = e, fe("from", e);
1071
- }
1072
- }, null, 8, [
1073
- "model-value",
1074
- "label",
1075
- "options"
1076
- ]), y(l, {
1077
- "model-value": z.value,
1078
- label: A(r)("catalogue.facet.endDate"),
1079
- options: j.value,
1080
- "onUpdate:modelValue": n[4] ||= (e) => {
1081
- z.value = e, fe("to", e);
1082
- }
1083
- }, null, 8, [
1084
- "model-value",
1085
- "label",
1086
- "options"
1087
- ])])) : m("", !0)], 64)) : s.value === "radio" ? (w(!0), h(d, { key: 2 }, D(a.value.facets ?? [], (e) => (w(), h("div", {
1088
- key: e.key,
1089
- class: "mwnf-search-form__radio-row"
1090
- }, [g("label", Yt, [L(g("input", {
1091
- "onUpdate:modelValue": n[5] ||= (e) => Y.value = e,
1092
- type: "radio",
1093
- name: "mwnf-search-form-filter",
1094
- value: e.key
1095
- }, null, 8, Xt), [[N, Y.value]]), v(" " + k(e.label ? A(r)(e.label) : ""), 1)]), e.type === "year" ? L((w(), h("input", {
1096
- key: 1,
1097
- "onUpdate:modelValue": (t) => X[e.key] = t,
1098
- type: "number",
1099
- class: "mwnf-search-form__year",
1100
- disabled: Y.value !== e.key
1101
- }, null, 8, Zt)), [[re, X[e.key]]]) : (w(), p(l, {
1102
- key: 0,
1103
- modelValue: X[e.key],
1104
- "onUpdate:modelValue": (t) => X[e.key] = t,
1105
- options: G.value[e.key] ?? [],
1106
- disabled: Y.value !== e.key
1107
- }, null, 8, [
1108
- "modelValue",
1109
- "onUpdate:modelValue",
1110
- "options",
1111
- "disabled"
1112
- ]))]))), 128)) : m("", !0),
1113
- (w(!0), h(d, null, D(a.value.extras ?? [], (e) => (w(), h("label", {
1114
- key: e.key,
1115
- class: "mwnf-facet mwnf-facet--checkbox"
1116
- }, [L(g("input", {
1117
- "onUpdate:modelValue": (t) => Z[e.key] = t,
1118
- type: "checkbox",
1119
- class: "mwnf-facet__checkbox"
1120
- }, null, 8, Qt), [[M, Z[e.key]]]), g("span", $t, k(A(r)(e.label)), 1)]))), 128)),
1121
- O(t.$slots, "extras", C(b(xe.value)))
1122
- ]),
1123
- _: 3
1124
- }, 8, [
1125
- "mode",
1126
- "apply-label",
1127
- "reset-label"
1128
- ]),
1129
- a.value.howTo ? (w(), h("p", en, [y(e, { to: { name: a.value.howTo } }, {
1130
- default: I(() => [v(k(A(r)("catalogue.search.howTo")), 1)]),
1131
- _: 1
1132
- }, 8, ["to"])])) : m("", !0),
1133
- O(t.$slots, "actions", C(b(xe.value)))
1134
- ], 2));
1135
- }
1136
- }, nn = { class: "mwnf-timeline" }, rn = {
1137
- key: 0,
1138
- class: "mwnf-timeline__title"
1139
- }, an = {
1140
- key: 3,
1141
- class: "mwnf-facet"
1142
- }, on = { class: "mwnf-facet__label" }, sn = [
1143
- "value",
1144
- "placeholder",
1145
- "onInput"
1146
- ], cn = {
1147
- key: 1,
1148
- class: "mwnf-timeline__error"
1149
- }, ln = {
1150
- __name: "TimelineResultsView",
1151
- props: { spec: {
1152
- type: Object,
1153
- required: !0
1154
- } },
1155
- setup(t) {
1156
- let n = t, { t: r } = de(), i = ye(), a = f(() => n.spec), c = f(() => !!a.value.entrance), _ = _e({
1157
- scope: n.spec.scope ?? "country",
1158
- countryLabel: n.spec.countryLabel,
1159
- countryIdForCode: n.spec.countryIdForCode,
1160
- tr: n.spec.tr,
1161
- timelinesEntity: n.spec.timelinesEntity,
1162
- eventsEntity: n.spec.eventsEntity
1163
- }), x = f(() => a.value.controls ?? []), S = f(() => a.value.keys ?? x.value.map((e) => e.key)), te = (e) => x.value.some((t) => t.key === e), ne = f(() => ({
1164
- t: r,
1165
- tr: n.spec.tr,
1166
- years: {
1167
- min: z.value[0],
1168
- max: z.value[1]
1169
- }
1170
- })), j = T(Object.fromEntries(S.value.map((e) => [e, ""]))), M = E(""), N = c.value ? null : fe({ keys: S.value }), P = c.value ? j : N.filters;
1171
- function re(e) {
1172
- if (te("collection") && e !== "" && e != null) return e === "pc" ? null : e;
1173
- }
1174
- function F() {
1175
- for (let e of S.value) j[e] = "";
1176
- M.value = "";
1177
- }
1178
- function L() {
1179
- M.value = "";
1180
- let e = !!P.begin && !!P.end;
1181
- if (e && Number(P.begin) >= Number(P.end)) {
1182
- M.value = r(a.value.errorPeriod ?? "timeline.form.errorPeriod");
1183
- return;
1184
- }
1185
- if (!P.country && !e) {
1186
- M.value = r(a.value.errorSelect ?? "timeline.form.errorSelect");
1187
- return;
1188
- }
1189
- let t = {};
1190
- for (let e of S.value) P[e] && (t[e] = P[e]);
1191
- i.push({
1192
- name: a.value.route,
1193
- query: t
1194
- });
1195
- }
1196
- let R = f(() => {
1197
- if (c.value) return [];
1198
- let e = P;
1199
- return _.findEvents({
1200
- country: e.country || void 0,
1201
- collection: re(e.collection),
1202
- begin: e.begin,
1203
- end: e.end
1204
- });
1205
- }), z = f(() => {
1206
- let e = _.findEvents({
1207
- country: void 0,
1208
- collection: void 0
1209
- }).map((e) => e.year_from).filter((e) => Number.isFinite(e) && e !== 0);
1210
- return e.length ? [Math.min(...e), Math.max(...e)] : [null, null];
1211
- }), B = me(R, {
1212
- page: () => N ? N.page.value : 1,
1213
- size: () => a.value.pageSize ?? 15
1214
- });
1215
- function V(e) {
1216
- let t = a.value.countryLabel && e.country_id ? a.value.countryLabel(e.country_id) : "";
1217
- return {
1218
- id: e.id,
1219
- date: U(e, e.text, r),
1220
- caption: t ? Y(String(t)) : "",
1221
- description: e.text?.description ? se(String(e.text.description), { breaks: !0 }) : ""
1222
- };
1223
- }
1224
- let H = f(() => B.value.rows.map((e) => (a.value.event ?? V)(e, ne.value))), ie = f(() => (_.countries.value ?? []).map((e) => ({
1225
- value: e.value,
1226
- label: e.value === "all" ? r("timeline.form.allCountries") : e.label
1227
- }))), ae = f(() => a.value.collections?.(ne.value) ?? []), W = f(() => {
1228
- let e = {};
1229
- for (let t of x.value) (t.key === "begin" || t.key === "end") && t.options && (typeof t.options == "function" ? e[t.key] = t.options(ne.value) : e[t.key] = t.options);
1230
- return e;
1231
- }), G = f(() => ({
1232
- filters: P,
1233
- active: S.value.some((e) => P[e]),
1234
- apply: c.value ? L : (e) => N.apply(e),
1235
- reset: c.value ? F : N.reset,
1236
- goToPage: c.value ? () => {} : N.goToPage,
1237
- events: R.value,
1238
- pageInfo: B.value,
1239
- countries: ie.value,
1240
- collections: ae.value,
1241
- t: r,
1242
- tr: a.value.tr
1243
- })), K = f(() => {
1244
- let e = a.value.gallery;
1245
- return !e || c.value ? null : !e.items || e.items(G.value);
1246
- }), oe = f(() => {
1247
- let e = K.value;
1248
- return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
1249
- }), q = f(() => {
1250
- let e = K.value;
1251
- return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
1252
- }), J = f(() => {
1253
- if (!oe.value) return null;
1254
- let e = {};
1255
- for (let t of S.value) P[t] && (e[t] = P[t]);
1256
- return {
1257
- to: {
1258
- name: a.value.gallery.route,
1259
- query: e
1260
- },
1261
- count: q.value,
1262
- label: r(a.value.gallery.label ?? "timeline.nav.seeGallery")
1263
- };
1264
- }), X = f(() => ({
1265
- ...G.value,
1266
- gallery: J.value
1267
- })), Z = f(() => a.value.summary ? a.value.summary(X.value) : [{
1268
- label: r(a.value.summaryLabel ?? "timeline.results.eventsFound"),
1269
- count: B.value.total
1270
- }]), ce = f(() => r(a.value.empty ?? "timeline.results.noResults")), Q = f(() => ({
1271
- window: 5,
1272
- jump: !1,
1273
- ends: !0,
1274
- ...a.value.pagination ?? {}
1275
- }));
1276
- function le(e, t) {
1277
- return e.label ? r(e.label) : t ? r(t) : "";
1278
- }
1279
- return (t, n) => (w(), h("section", nn, [
1280
- O(t.$slots, "before", C(b(X.value))),
1281
- a.value.title ? (w(), h("h1", rn, k(A(r)(a.value.title)), 1)) : m("", !0),
1282
- y(o, {
1283
- class: "mwnf-timeline__filters",
1284
- title: a.value.filterTitle ? A(r)(a.value.filterTitle) : "",
1285
- "apply-label": c.value ? A(r)(a.value.submitLabel ?? "core.action.search") : a.value.applyLabel ? A(r)(a.value.applyLabel) : "",
1286
- "reset-label": a.value.resetLabel ? A(r)(a.value.resetLabel) : "",
1287
- onApply: n[2] ||= (e) => c.value ? L() : A(N).apply(),
1288
- onReset: n[3] ||= (e) => c.value ? F() : A(N).reset()
1289
- }, {
1290
- default: I(() => [(w(!0), h(d, null, D(x.value, (e) => (w(), h(d, { key: e.key }, [e.key === "country" ? (w(), p(l, {
1291
- key: 0,
1292
- "model-value": A(P).country,
1293
- label: le(e, "catalogue.facet.country"),
1294
- options: ie.value,
1295
- placeholder: e.placeholder ? A(r)(e.placeholder) : A(r)("catalogue.facet.selectCountry"),
1296
- "any-label": e.anyLabel ? A(r)(e.anyLabel) : "",
1297
- "hide-empty": !!e.hideEmpty,
1298
- "onUpdate:modelValue": n[0] ||= (e) => A(P).country = e
1299
- }, null, 8, [
1300
- "model-value",
1301
- "label",
1302
- "options",
1303
- "placeholder",
1304
- "any-label",
1305
- "hide-empty"
1306
- ])) : e.key === "collection" ? (w(), p(l, {
1307
- key: 1,
1308
- "model-value": A(P).collection,
1309
- label: le(e),
1310
- options: ae.value,
1311
- placeholder: e.placeholder ? A(r)(e.placeholder) : "",
1312
- "any-label": e.anyLabel ? A(r)(e.anyLabel) : "",
1313
- "hide-empty": !!e.hideEmpty,
1314
- "onUpdate:modelValue": n[1] ||= (e) => A(P).collection = e
1315
- }, null, 8, [
1316
- "model-value",
1317
- "label",
1318
- "options",
1319
- "placeholder",
1320
- "any-label",
1321
- "hide-empty"
1322
- ])) : (e.key === "begin" || e.key === "end") && W.value[e.key] ? (w(), p(l, {
1323
- key: 2,
1324
- "model-value": A(P)[e.key],
1325
- label: le(e, e.key === "begin" ? "catalogue.facet.startDate" : "catalogue.facet.endDate"),
1326
- options: W.value[e.key],
1327
- placeholder: e.placeholder ? A(r)(e.placeholder) : A(r)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1328
- "any-label": e.anyLabel ? A(r)(e.anyLabel) : "",
1329
- "hide-empty": !!e.hideEmpty,
1330
- "onUpdate:modelValue": (t) => A(P)[e.key] = t
1331
- }, null, 8, [
1332
- "model-value",
1333
- "label",
1334
- "options",
1335
- "placeholder",
1336
- "any-label",
1337
- "hide-empty",
1338
- "onUpdate:modelValue"
1339
- ])) : (w(), h("label", an, [g("span", on, k(le(e, e.key === "begin" ? "catalogue.facet.startDate" : "catalogue.facet.endDate")), 1), g("input", {
1340
- type: "number",
1341
- class: "mwnf-facet__select",
1342
- value: A(P)[e.key],
1343
- placeholder: e.placeholder ? A(r)(e.placeholder) : A(r)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1344
- onInput: (t) => A(P)[e.key] = t.target.value
1345
- }, null, 40, sn)]))], 64))), 128))]),
1346
- _: 1
1347
- }, 8, [
1348
- "title",
1349
- "apply-label",
1350
- "reset-label"
1351
- ]),
1352
- c.value && M.value ? (w(), h("p", cn, k(M.value), 1)) : m("", !0),
1353
- c.value ? m("", !0) : (w(), h(d, { key: 2 }, [
1354
- O(t.$slots, "summary", C(b(X.value)), () => [y(s, { parts: Z.value }, null, 8, ["parts"])]),
1355
- J.value ? (w(), p(e, {
1356
- key: 0,
1357
- class: "mwnf-timeline__gallery",
1358
- to: J.value.to
1359
- }, {
1360
- default: I(() => [O(t.$slots, "cross-link", C(b(X.value)), () => [v(k(J.value.label), 1), J.value.count == null ? m("", !0) : (w(), h(d, { key: 0 }, [v(" (" + k(J.value.count) + ")", 1)], 64))])]),
1361
- _: 3
1362
- }, 8, ["to"])) : m("", !0),
1363
- O(t.$slots, "event", C(b(X.value)), () => [y(u, { events: H.value }, {
1364
- empty: I(() => [O(t.$slots, "empty", C(b(X.value)), () => [v(k(ce.value), 1)])]),
1365
- _: 3
1366
- }, 8, ["events"])]),
1367
- y(ee, {
1368
- "page-info": A(B),
1369
- window: Q.value.window,
1370
- jump: Q.value.jump,
1371
- ends: Q.value.ends,
1372
- onNavigate: A(N).goToPage
1373
- }, null, 8, [
1374
- "page-info",
1375
- "window",
1376
- "jump",
1377
- "ends",
1378
- "onNavigate"
1379
- ])
1380
- ], 64)),
1381
- O(t.$slots, "after", C(b(X.value)))
1382
- ]));
1383
- }
1384
- };
1385
- //#endregion
1386
- export { vt as a, jt as i, tn as n, ct as o, It as r, Ne as s, ln as t };