@museumwnf/viewer-layout 3.3.0 → 3.5.0

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