@museumwnf/viewer-layout 3.4.0 → 3.6.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,1640 +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({
452
- ...Q.value,
453
- records: Pe.value,
454
- outside: I(Ne).outside
455
- })))])) : v("", !0)]),
456
- N(e.$slots, "after", O(w(Q.value))),
457
- C(s, {
458
- term: I(J),
459
- html: Z.value,
460
- dir: I(B),
461
- onClose: I(X)
462
- }, null, 8, [
463
- "term",
464
- "html",
465
- "dir",
466
- "onClose"
467
- ])
468
- ], 2)) : (k(), y("p", Ze, F(I(a)("core.status.loading")), 1));
469
- }
470
- }, $e = ["dir"], et = {
471
- key: 0,
472
- class: "mwnf-essay__breadcrumb"
473
- }, tt = { class: "mwnf-essay__breadcrumb-label" }, nt = {
474
- key: 1,
475
- class: "mwnf-essay__breadcrumb-link"
476
- }, rt = ["aria-label"], it = { class: "mwnf-essay__title" }, at = {
477
- key: 0,
478
- class: "mwnf-essay__number"
479
- }, ot = ["innerHTML"], st = { class: "mwnf-essay__body" }, ct = { class: "mwnf-essay__main" }, lt = {
480
- key: 0,
481
- class: "mwnf-essay__status"
482
- }, ut = ["innerHTML"], dt = ["innerHTML"], ft = {
483
- key: 4,
484
- class: "mwnf-essay__nav"
485
- }, pt = {
486
- key: 1,
487
- class: "mwnf-essay__nav-spacer"
488
- }, mt = {
489
- key: 0,
490
- class: "mwnf-essay__side"
491
- }, ht = {
492
- key: 0,
493
- class: "mwnf-essay__panel"
494
- }, gt = {
495
- key: 0,
496
- class: "mwnf-essay__variants"
497
- }, _t = ["aria-pressed", "onClick"], vt = ["src", "alt"], yt = ["innerHTML"], bt = {
498
- key: 0,
499
- class: "mwnf-essay__panel-label"
500
- }, xt = ["innerHTML"], St = ["innerHTML"], Ct = {
501
- key: 0,
502
- class: "mwnf-essay__thumbs"
503
- }, wt = ["onClick"], Tt = ["src"], Et = {
504
- key: 2,
505
- class: "mwnf-essay__status"
506
- }, Dt = {
507
- __name: "EssayView",
508
- props: {
509
- spec: {
510
- type: Object,
511
- required: !0
512
- },
513
- id: {
514
- type: String,
515
- required: !0
516
- }
517
- },
518
- setup(e) {
519
- let n = e, { t: r } = be(), i = _e(), o = ne();
520
- function c(e) {
521
- return !!e && typeof e.walk == "function" && typeof e.children == "function";
522
- }
523
- function l(e) {
524
- return typeof e == "string" ? e : "themes";
525
- }
526
- 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({
527
- source: "themes",
528
- entity: f,
529
- childType: d.childType
530
- }) : ge({
531
- purpose: d?.purpose,
532
- rootId: d?.rootId,
533
- childType: d?.childType,
534
- entity: f,
535
- order: d?.order
536
- }), 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(() => {
537
- if (A.value) return p.children(A.value.id);
538
- let e = p.root.value;
539
- return e ? p.children(e.id) : p.walk().filter((e) => p.parents(e.id).length === 0);
540
- }), 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);
541
- V(() => [E.value?.id, U.value], async () => {
542
- if (ae.value = !1, !E.value) {
543
- ae.value = !0;
544
- return;
545
- }
546
- let e = U.value === "en" ? ["en"] : [U.value, "en"];
547
- await Promise.all([f, u].flatMap((t) => e.map((e) => i.loadTranslations(t, e)))), ae.value = !0;
548
- }, { immediate: !0 });
549
- function oe(e) {
550
- if (!e) return "";
551
- let t = T.value.placeholder, n = (e) => !!e && !!t && t.test(e), r = i.tr(f, e.id, U.value, "en");
552
- if (r.title && !n(r.title)) return r.title;
553
- let a = i.tr(f, e.id, "en").title;
554
- return a && !n(a) ? a : e.internal_name ?? e.id;
555
- }
556
- let K = g(() => ({
557
- node: E.value,
558
- text: G.value,
559
- language: U.value,
560
- tree: p,
561
- select: Ie,
562
- t: r,
563
- tr: (e, t) => i.tr(e, t, U.value, "en")
564
- }));
565
- function Y(e, t) {
566
- return t.split(".").reduce((e, t) => e?.[t], e);
567
- }
568
- function ce(e, t) {
569
- return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : Y(t.text, e) ?? "";
570
- }
571
- let X = g(() => ce(T.value.quote ?? "quote", K.value)), Z = g(() => ce(T.value.body ?? "description", K.value)), le = g(() => {
572
- if (!T.value.glossary || !E.value) return [];
573
- let e = [X.value, Z.value].filter(Boolean);
574
- return J(e.join("\n\n"), U.value);
575
- }), 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), {
576
- breaks: !0,
577
- glossary: Q.value
578
- }) : ""), we = g(() => E.value ? T.value.about?.(E.value) ?? !1 : !1), Ee = g(() => !!we.value);
579
- function De(e) {
580
- let t = we.value;
581
- return t && typeof t == "object" ? !!t[e] : !!T.value.aboutKeeps?.includes(e);
582
- }
583
- let Oe = [
584
- [1e3, "M"],
585
- [900, "CM"],
586
- [500, "D"],
587
- [400, "CD"],
588
- [100, "C"],
589
- [90, "XC"],
590
- [50, "L"],
591
- [40, "XL"],
592
- [10, "X"],
593
- [9, "IX"],
594
- [5, "V"],
595
- [4, "IV"],
596
- [1, "I"]
597
- ];
598
- function ke(e) {
599
- let t = e, n = "";
600
- for (let [e, r] of Oe) for (; t >= e;) n += r, t -= e;
601
- return n;
602
- }
603
- let Ae = g(() => {
604
- let e = T.value.numbering;
605
- if (!e || !E.value) return "";
606
- let t = (P.value.length ? P.value : [E.value]).findIndex((e) => e.id === n.id), r = t >= 0 ? t + 1 : 1;
607
- return e === "roman" ? ke(r) : String(r);
608
- });
609
- function je(e) {
610
- 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) : [] : [];
611
- }
612
- let Me = W(u), Ne = g(() => {
613
- let e = T.value.items?.of ?? je;
614
- return E.value ? e(E.value, K.value) : [];
615
- }), $ = g(() => Ne.value.map((e) => Me.value.get(e)).filter(Boolean)), Pe = j(null);
616
- V($, (e) => {
617
- e.some((e) => e.id === Pe.value) || (Pe.value = e[0]?.id ?? null);
618
- }, { immediate: !0 });
619
- let Fe = g(() => $.value.find((e) => e.id === Pe.value) ?? $.value[0] ?? null);
620
- function Ie(e) {
621
- Pe.value = e;
622
- }
623
- function Le(e) {
624
- let t = T.value.items?.route;
625
- return !t || !e ? null : typeof t == "function" ? t(e, K.value) : {
626
- name: t,
627
- params: { id: e.id }
628
- };
629
- }
630
- function Re(e) {
631
- let t = T.value.route;
632
- return !t || !e ? null : typeof t == "function" ? t(e, K.value) : {
633
- name: t,
634
- params: { id: e.id }
635
- };
636
- }
637
- function ze(e) {
638
- if (!e) return null;
639
- let t = i.tr(u, e.id, U.value, "en").name ?? e.internal_name ?? e.id;
640
- return {
641
- name: de(String(t)),
642
- image: e.images?.[0]?.url ?? "",
643
- imageAlt: fe(String(t))
644
- };
645
- }
646
- let Be = g(() => {
647
- let e = Fe.value;
648
- if (!e) return null;
649
- let t = ze(e), n = T.value.items?.caption?.(e, E.value, K.value);
650
- return {
651
- ...t,
652
- ...n
653
- };
654
- }), Ve = g(() => !!T.value.panel), He = g(() => {
655
- let e = Fe.value;
656
- if (!e) return [];
657
- let t = Be.value, n = e.images?.[0]?.url ? [{
658
- id: "__primary",
659
- image: e.images[0].url,
660
- alt: t?.imageAlt ?? "",
661
- caption: {
662
- title: t?.name ?? "",
663
- justification: "",
664
- fields: null
665
- }
666
- }] : [], r = T.value.panel?.variants?.(e, K.value) ?? [];
667
- return [...n, ...r.map((e, t) => ({
668
- id: e.id ?? `variant-${t}`,
669
- ...e
670
- }))];
671
- }), Ue = j(null);
672
- V(He, (e) => {
673
- e.some((e) => e.id === Ue.value) || (Ue.value = e[0]?.id ?? null);
674
- }, { immediate: !0 });
675
- let We = g(() => He.value.find((e) => e.id === Ue.value) ?? He.value[0] ?? null);
676
- function Ge(e) {
677
- Ue.value = e;
678
- }
679
- let Ke = g(() => {
680
- let e = We.value;
681
- return e?.image ? [{
682
- url: e.image,
683
- alt: e.alt ?? ""
684
- }] : [];
685
- }), qe = g(() => {
686
- let e = Fe.value;
687
- return !e || !T.value.panel?.fields ? [] : T.value.panel.fields(e, E.value, K.value) ?? [];
688
- }), Je = g(() => {
689
- let e = We.value?.caption?.fields;
690
- return e == null ? qe.value : e.map((e) => ({
691
- label: e.label ? r(e.label) : "",
692
- value: e.value
693
- }));
694
- }), Ye = g(() => {
695
- let e = We.value?.caption?.justification;
696
- return e ? de(String(e)) : "";
697
- }), Xe = g(() => $.value.map((e) => {
698
- let t = ze(e), n = T.value.items?.meta?.(e, K.value) ?? [], r = T.value.items?.badge?.(e, K.value) ?? "";
699
- return {
700
- id: e.id,
701
- image: t.image,
702
- imageAlt: t.imageAlt,
703
- name: t.name,
704
- meta: n,
705
- badge: r,
706
- to: Le(e)
707
- };
708
- })), Ze = g(() => T.value.breadcrumb && E.value ? p.parents(n.id) : []), Qe = g(() => {
709
- let e = T.value.tabs;
710
- return e ? e === "children" ? E.value ? p.children(E.value.id) : [] : P.value : [];
711
- }), 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(() => ({
712
- ...K.value,
713
- items: $.value,
714
- selected: Fe.value,
715
- selectedVariant: We.value,
716
- selectVariant: Ge,
717
- breadcrumb: Ze.value,
718
- previous: z.value,
719
- next: B.value
720
- })), 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));
721
- return (n, i) => x.value && !E.value ? (k(), _(I(ie), { key: 0 })) : E.value ? (k(), y("article", {
722
- key: 1,
723
- class: D(["mwnf-essay", { "mwnf-essay--about": Ee.value }]),
724
- dir: I(re) || void 0,
725
- onClick: i[0] ||= (...e) => I(me) && I(me)(...e)
726
- }, [
727
- N(n.$slots, "header", O(w(Mt.value)), () => [
728
- 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, {
729
- key: 0,
730
- to: Re(e),
731
- class: "mwnf-essay__breadcrumb-link"
732
- }, {
733
- default: H(() => [S(F(oe(e)), 1)]),
734
- _: 2
735
- }, 1032, ["to"])) : (k(), y("span", nt, F(oe(e)), 1))], 64))), 128))])) : v("", !0),
736
- Qe.value.length > 1 ? (k(), y("div", {
737
- key: 1,
738
- class: "mwnf-essay__tabs",
739
- role: "tablist",
740
- "aria-label": I(r)(At.value)
741
- }, [(k(!0), y(h, null, M(Qe.value, (t) => (k(), _(m, {
742
- key: t.id,
743
- to: Re(t),
744
- class: D(["mwnf-essay__tab", { "mwnf-essay__tab--active": t.id === e.id }])
745
- }, {
746
- default: H(() => [S(F(oe(t)), 1)]),
747
- _: 2
748
- }, 1032, ["to", "class"]))), 128))], 8, rt)) : v("", !0),
749
- b("h1", it, [Ae.value ? (k(), y("span", at, F(Ae.value), 1)) : v("", !0), b("span", { innerHTML: xe.value }, null, 8, ot)])
750
- ]),
751
- b("div", st, [b("div", ct, [
752
- ae.value ? v("", !0) : (k(), y("p", lt, F(I(r)("core.status.loading")), 1)),
753
- Se.value ? (k(), y("p", {
754
- key: 1,
755
- class: "mwnf-essay__quote",
756
- innerHTML: Se.value
757
- }, null, 8, ut)) : v("", !0),
758
- N(n.$slots, "before-body", O(w(Mt.value))),
759
- Ce.value ? (k(), y("div", {
760
- key: 2,
761
- class: "mwnf-essay__prose mwnf-sheet__block",
762
- innerHTML: Ce.value
763
- }, null, 8, dt)) : v("", !0),
764
- N(n.$slots, "after-body", O(w(Mt.value))),
765
- Ee.value ? v("", !0) : N(n.$slots, "justifications", O(w(Mt.value)), void 0, void 0, 3),
766
- Pt.value ? (k(), y("div", ft, [N(n.$slots, "navigation", O(w(Mt.value)), () => [z.value ? (k(), _(m, {
767
- key: 0,
768
- to: Re(z.value),
769
- class: "mwnf-essay__nav-link mwnf-essay__nav-link--previous"
770
- }, {
771
- default: H(() => [S("← " + F(I(r)(Dt.value)), 1)]),
772
- _: 1
773
- }, 8, ["to"])) : (k(), y("span", pt)), B.value ? (k(), _(m, {
774
- key: 2,
775
- to: Re(B.value),
776
- class: "mwnf-essay__nav-link mwnf-essay__nav-link--next"
777
- }, {
778
- default: H(() => [S(F(I(r)(Ot.value)) + " →", 1)]),
779
- _: 1
780
- }, 8, ["to"])) : v("", !0)])])) : v("", !0)
781
- ]), Nt.value ? (k(), y("div", mt, [
782
- N(n.$slots, "panel", O(w(Mt.value)), () => [Ve.value && Be.value ? (k(), y("div", ht, [
783
- C(t, { images: Ke.value }, null, 8, ["images"]),
784
- 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", {
785
- type: "button",
786
- class: D(["mwnf-essay__variant", { "mwnf-essay__variant--active": e.id === We.value?.id }]),
787
- "aria-pressed": e.id === We.value?.id ? "true" : "false",
788
- onClick: (t) => Ge(e.id)
789
- }, [e.image ? (k(), y("img", {
790
- key: 0,
791
- src: e.image,
792
- alt: e.alt ?? "",
793
- loading: "lazy"
794
- }, null, 8, vt)) : v("", !0)], 10, _t)]))), 128))])) : v("", !0),
795
- b("h3", {
796
- class: "mwnf-essay__panel-name",
797
- innerHTML: We.value?.caption?.title || Be.value.name
798
- }, null, 8, yt),
799
- (k(!0), y(h, null, M(Je.value, (e, t) => (k(), y("p", {
800
- key: t,
801
- class: "mwnf-essay__panel-field"
802
- }, [e.label ? (k(), y("span", bt, F(e.label), 1)) : v("", !0), b("span", { innerHTML: e.value }, null, 8, xt)]))), 128)),
803
- Ye.value ? (k(), y("p", {
804
- key: 1,
805
- class: "mwnf-essay__panel-justification mwnf-sheet__block",
806
- innerHTML: Ye.value
807
- }, null, 8, St)) : v("", !0),
808
- Le(Fe.value) ? (k(), _(m, {
809
- key: 2,
810
- to: Le(Fe.value),
811
- class: "mwnf-essay__panel-link"
812
- }, {
813
- default: H(() => [S(F(I(r)(jt.value)) + " →", 1)]),
814
- _: 1
815
- }, 8, ["to"])) : v("", !0)
816
- ])) : v("", !0)]),
817
- 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", {
818
- type: "button",
819
- class: D(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === Fe.value?.id }]),
820
- onClick: (t) => Ie(e.id)
821
- }, [e.images?.[0]?.url ? (k(), y("img", {
822
- key: 0,
823
- src: e.images[0].url,
824
- alt: "",
825
- loading: "lazy"
826
- }, null, 8, Tt)) : v("", !0)], 10, wt)]))), 128))])) : !Ve.value && Xe.value.length ? (k(), _(a, {
827
- key: 1,
828
- records: Xe.value
829
- }, null, 8, ["records"])) : v("", !0)]),
830
- N(n.$slots, "aside", O(w(Mt.value)))
831
- ])) : v("", !0)]),
832
- N(n.$slots, "after", O(w(Mt.value)), () => [C(ee)]),
833
- C(s, {
834
- term: I(pe),
835
- html: ve.value,
836
- dir: I(re),
837
- onClose: I(he)
838
- }, null, 8, [
839
- "term",
840
- "html",
841
- "dir",
842
- "onClose"
843
- ])
844
- ], 10, $e)) : (k(), y("p", Et, F(I(r)("core.status.loading")), 1));
845
- }
846
- }, Ot = { class: "mwnf-link-list" }, kt = {
847
- key: 0,
848
- class: "mwnf-link-list__back"
849
- }, At = {
850
- key: 1,
851
- class: "mwnf-link-list__title"
852
- }, jt = {
853
- key: 2,
854
- class: "mwnf-link-list__groups"
855
- }, Mt = {
856
- key: 0,
857
- class: "mwnf-link-list__heading"
858
- }, Nt = {
859
- key: 1,
860
- class: "mwnf-link-list__links"
861
- }, Pt = ["innerHTML"], Ft = ["innerHTML"], It = {
862
- key: 3,
863
- class: "mwnf-link-list__empty"
864
- }, Lt = {
865
- __name: "LinkListView",
866
- props: { spec: {
867
- type: Object,
868
- required: !0
869
- } },
870
- setup(e) {
871
- 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"));
872
- return (e, s) => (k(), y("div", Ot, [
873
- t.spec.back && a.value ? (k(), y("div", kt, [C(m, {
874
- to: t.spec.back.to,
875
- href: t.spec.back.href
876
- }, {
877
- default: H(() => [S(" ← " + F(a.value), 1)]),
878
- _: 1
879
- }, 8, ["to", "href"])])) : v("", !0),
880
- i.value ? (k(), y("h1", At, F(i.value), 1)) : v("", !0),
881
- N(e.$slots, "before"),
882
- r.value.length ? (k(), y("div", jt, [(k(!0), y(h, null, M(r.value, (t, r) => (k(), y("section", {
883
- key: r,
884
- class: "mwnf-link-list__group"
885
- }, [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", {
886
- key: t,
887
- class: "mwnf-link-list__item"
888
- }, [C(m, {
889
- class: "mwnf-link-list__link",
890
- to: e.to,
891
- href: e.href
892
- }, {
893
- default: H(() => [b("span", { innerHTML: I(Z)(e.label) }, null, 8, Pt)]),
894
- _: 2
895
- }, 1032, ["to", "href"]), e.note ? (k(), y("div", {
896
- key: 0,
897
- class: "mwnf-link-list__note",
898
- innerHTML: I(Z)(e.note)
899
- }, null, 8, Ft)) : v("", !0)]))), 128))])) : v("", !0)])]))), 128))])) : (k(), y("div", It, F(o.value), 1)),
900
- N(e.$slots, "after")
901
- ]));
902
- }
903
- }, Rt = { class: "mwnf-partner-list" }, zt = {
904
- key: 0,
905
- class: "mwnf-partner-list__title"
906
- }, Bt = {
907
- key: 1,
908
- class: "mwnf-partner-list__count"
909
- }, Vt = {
910
- key: 2,
911
- class: "mwnf-partner-list__toggle"
912
- }, Ht = {
913
- key: 3,
914
- class: "mwnf-partner-list__groups"
915
- }, Ut = {
916
- key: 0,
917
- class: "mwnf-partner-list__group-title"
918
- }, Wt = { class: "mwnf-partner-list__tier" }, Gt = { class: "mwnf-partner-list__row" }, Kt = {
919
- key: 0,
920
- class: "mwnf-partner-list__children"
921
- }, qt = {
922
- key: 0,
923
- class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
924
- }, Jt = { class: "mwnf-partner-list__tier-label" }, Yt = {
925
- key: 4,
926
- class: "mwnf-partner-list__empty"
927
- }, Xt = {
928
- __name: "PartnerListView",
929
- props: { spec: {
930
- type: Object,
931
- required: !0
932
- } },
933
- setup(e) {
934
- let t = e, { t: n, locale: r } = be(), i = _e(), a = g(() => t.spec), o = g(() => a.value.entity ?? "partners"), s = se(o.value);
935
- o.value && i.loadTranslations(o.value, "en");
936
- let c = {
937
- t: n,
938
- locale: r,
939
- tr: (e) => i.tr(o.value, e, r.value, "en"),
940
- renderInline: de,
941
- renderPlain: fe
942
- }, { filters: l, apply: d } = xe({
943
- keys: ["order"],
944
- page: !1
945
- }), f = g(() => l.order === "desc" ? "desc" : "asc");
946
- function ee() {
947
- d({ order: f.value === "asc" ? "desc" : "asc" });
948
- }
949
- let p = g(() => {
950
- let e = a.value, t = s.value ?? [];
951
- return e.scope ? t.filter((t) => e.scope(t, c)) : t;
952
- }), te = g(() => a.value.route);
953
- function m(e) {
954
- let t = te.value;
955
- return t ? typeof t == "function" ? t(e, c) : {
956
- name: t,
957
- params: { id: e.id }
958
- } : null;
959
- }
960
- function x(e) {
961
- let t = a.value.objectsRoute;
962
- return Q(e, c.tr(e.id), {
963
- route: m,
964
- objectsRoute: t ? (e) => t(e, c) : null
965
- });
966
- }
967
- function S(e, t) {
968
- let n = t.name ?? "";
969
- return {
970
- ...Q(e, {}, {}),
971
- name: n,
972
- plainName: D(n),
973
- city: t.city ?? "",
974
- location: t.city ?? "",
975
- logos: t.logo ? [{
976
- url: t.logo,
977
- alt: D(n),
978
- type: ""
979
- }] : [],
980
- itemCount: t.count ?? 0,
981
- route: t.route ?? null
982
- };
983
- }
984
- function T(e) {
985
- if (a.value.record) {
986
- let t = a.value.record(e, c);
987
- return {
988
- partner: e,
989
- row: t,
990
- view: S(e, t)
991
- };
992
- }
993
- let t = x(e);
994
- return {
995
- partner: e,
996
- row: {
997
- name: t.name,
998
- city: t.city,
999
- logo: t.logos[0]?.url ?? "",
1000
- count: t.itemCount,
1001
- route: t.route
1002
- },
1003
- view: t
1004
- };
1005
- }
1006
- function D(e) {
1007
- return String(e ?? "").replace(/<[^>]*>/g, "");
1008
- }
1009
- let A = g(() => a.value.nested ? le(p.value) : null), j = g(() => {
1010
- let e = a.value, t = e.group?.tier ?? !1, n = (e.group?.order ?? "country") === "name", r = n ? p.value.map((e) => ({
1011
- ...e,
1012
- country_id: "\0"
1013
- })) : p.value, i = Y(r, {
1014
- label: n ? () => "" : (t) => e.label ? e.label(t, c) : t,
1015
- tier: t,
1016
- order: f.value
1017
- }), o = (e, t) => D(e.row.name).localeCompare(D(t.row.name));
1018
- return i.map((t) => {
1019
- let r = t.main.map(T).sort(o), i = t.associated.map(T).sort(o);
1020
- if (n && f.value === "desc" && (r.reverse(), i.reverse()), e.nested && A.value) {
1021
- let e = new Set(i.map((e) => e.partner.id));
1022
- r = r.map((t) => {
1023
- let n = A.value.children(t.partner.id).filter((t) => e.has(t.id));
1024
- for (let t of n) e.delete(t.id);
1025
- return {
1026
- ...t,
1027
- children: n.map(T)
1028
- };
1029
- }), i = i.filter((t) => e.has(t.partner.id));
1030
- }
1031
- return {
1032
- country: t.country,
1033
- label: t.label,
1034
- main: r,
1035
- associated: i
1036
- };
1037
- });
1038
- }), 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(() => ({
1039
- objectsLabel: a.value.objectsLabel ?? "partner.item.objectsInSite",
1040
- emptyLabel: a.value.emptyLabel ?? "",
1041
- show: { actions: !!a.value.actions }
1042
- })), 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(() => ({
1043
- t: n,
1044
- locale: r,
1045
- groups: j.value,
1046
- orderDir: f.value,
1047
- toggleOrder: ee
1048
- }));
1049
- return (e, t) => (k(), y("section", Rt, [
1050
- U.value ? (k(), y("h1", zt, F(U.value), 1)) : v("", !0),
1051
- a.value.count ? (k(), y("div", Bt, F(R.value) + ": " + F(re.value), 1)) : v("", !0),
1052
- N(e.$slots, "before", O(w(W.value))),
1053
- a.value.orderToggle ? (k(), y("div", Vt, [b("button", {
1054
- type: "button",
1055
- class: "mwnf-partner-list__toggle-button",
1056
- onClick: ee
1057
- }, F(f.value === "asc" ? B.value : z.value), 1)])) : v("", !0),
1058
- I.value ? (k(), y("div", Ht, [(k(!0), y(h, null, M(j.value, (t) => (k(), _(P(ie.value === "accordion" ? "details" : "section"), E({
1059
- key: t.country ?? "",
1060
- class: "mwnf-partner-list__group"
1061
- }, { ref_for: !0 }, ie.value === "accordion" ? { open: !0 } : {}), {
1062
- default: H(() => [
1063
- (k(), _(P(ie.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
1064
- 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)])]),
1065
- _: 2
1066
- }, 1024)),
1067
- b("div", Wt, [(k(!0), y(h, null, M(t.main, (n) => (k(), y("div", {
1068
- key: n.partner.id,
1069
- class: "mwnf-partner-list__row-block"
1070
- }, [b("div", Gt, [N(e.$slots, "row", E({
1071
- group: t,
1072
- partner: n.partner,
1073
- row: n.row,
1074
- view: n.view
1075
- }, { ref_for: !0 }, W.value), () => [C(u, E({
1076
- variant: "line",
1077
- partner: n.view
1078
- }, { 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", {
1079
- key: n.partner.id,
1080
- class: "mwnf-partner-list__row mwnf-partner-list__row--child"
1081
- }, [N(e.$slots, "row", E({
1082
- group: t,
1083
- partner: n.partner,
1084
- row: n.row,
1085
- view: n.view
1086
- }, { ref_for: !0 }, W.value), () => [C(u, E({
1087
- variant: "line",
1088
- partner: n.view
1089
- }, { ref_for: !0 }, L.value), null, 16, ["partner"])])]))), 128))])) : v("", !0)]))), 128))]),
1090
- 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", {
1091
- key: n.partner.id,
1092
- class: "mwnf-partner-list__row"
1093
- }, [N(e.$slots, "row", E({
1094
- group: t,
1095
- partner: n.partner,
1096
- row: n.row,
1097
- view: n.view
1098
- }, { ref_for: !0 }, W.value), () => [C(u, E({
1099
- variant: "line",
1100
- partner: n.view
1101
- }, { ref_for: !0 }, L.value), null, 16, ["partner"])])]))), 128))])) : v("", !0)
1102
- ]),
1103
- _: 2
1104
- }, 1040))), 128))])) : (k(), y("p", Yt, F(V.value), 1)),
1105
- N(e.$slots, "after", O(w(W.value)))
1106
- ]));
1107
- }
1108
- }, Zt = { class: "mwnf-text-page" }, Qt = {
1109
- key: 0,
1110
- class: "mwnf-text-page__back"
1111
- }, $t = {
1112
- key: 1,
1113
- class: "mwnf-text-page__heading"
1114
- }, en = { class: "mwnf-prose" }, tn = ["innerHTML"], nn = {
1115
- __name: "TextPageView",
1116
- props: { spec: {
1117
- type: Object,
1118
- required: !0
1119
- } },
1120
- setup(e) {
1121
- 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(() => ({
1122
- t: n,
1123
- tr: (e, t) => r.tr(e, t, i.value, "en"),
1124
- language: i.value
1125
- })), 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);
1126
- return (e, n) => (k(), y("div", Zt, [
1127
- u.value && (t.spec.back === !0 || t.spec.back?.to || t.spec.back?.href) ? (k(), y("div", Qt, [C(m, {
1128
- to: t.spec.back === !0 ? {} : t.spec.back?.to,
1129
- href: t.spec.back === !0 ? "#" : t.spec.back?.href
1130
- }, {
1131
- default: H(() => [S(" ← " + F(u.value), 1)]),
1132
- _: 1
1133
- }, 8, ["to", "href"])])) : v("", !0),
1134
- a.value ? (k(), y("h1", $t, F(a.value), 1)) : v("", !0),
1135
- b("div", en, [o.value ? (k(), _(I(re), {
1136
- key: 0,
1137
- keypath: s.value
1138
- }, null, 8, ["keypath"])) : l.value ? (k(), y("div", {
1139
- key: 1,
1140
- innerHTML: l.value
1141
- }, null, 8, tn)) : v("", !0)])
1142
- ]));
1143
- }
1144
- }, rn = { class: "mwnf-search-form__row-label" }, an = ["onUpdate:modelValue"], on = ["value"], sn = ["onUpdate:modelValue"], cn = ["value"], ln = ["onUpdate:modelValue", "placeholder"], un = {
1145
- key: 0,
1146
- class: "mwnf-search-form__dates"
1147
- }, dn = {
1148
- key: 1,
1149
- class: "mwnf-facet"
1150
- }, fn = { class: "mwnf-facet__label" }, pn = { value: "" }, mn = ["value"], hn = {
1151
- key: 0,
1152
- class: "mwnf-search-form__dates"
1153
- }, gn = { class: "mwnf-search-form__radio-choice" }, _n = ["value"], vn = ["onUpdate:modelValue", "disabled"], yn = ["onUpdate:modelValue"], bn = { class: "mwnf-facet__label" }, xn = {
1154
- key: 0,
1155
- class: "mwnf-search-form__how-to"
1156
- }, Sn = {
1157
- __name: "SearchFormView",
1158
- props: { spec: {
1159
- type: Object,
1160
- required: !0
1161
- } },
1162
- setup(e) {
1163
- 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(() => {
1164
- let e = i.value.dates;
1165
- if (!e || e === "buckets") return null;
1166
- let t = e.presets;
1167
- return typeof t == "function" ? t() : t ?? G();
1168
- });
1169
- function u(e) {
1170
- return (e ?? []).map((e) => ({
1171
- value: e,
1172
- label: String(e)
1173
- }));
1174
- }
1175
- 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(() => {
1176
- let e = {};
1177
- for (let t of i.value.facets ?? []) e[t.key] = t.options ?? ie.value[t.key] ?? [];
1178
- return e;
1179
- }), ae = [{
1180
- key: "AND",
1181
- label: "catalogue.search.and"
1182
- }, {
1183
- key: "OR",
1184
- label: "catalogue.search.or"
1185
- }], oe = [
1186
- "catalogue.search.keywordOne",
1187
- "catalogue.search.keywordTwo",
1188
- "catalogue.search.keywordThree"
1189
- ], K = g(() => i.value.operators ?? ae), q = j(Array.from({ length: i.value.rows ?? 3 }, () => ({
1190
- keyword: "",
1191
- field: i.value.fields?.[0]?.key ?? "",
1192
- cond: (i.value.operators ?? ae)[0].key
1193
- })));
1194
- function J(e) {
1195
- return oe[e] ? n(oe[e]) : "";
1196
- }
1197
- 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])));
1198
- function Z() {
1199
- let e = {};
1200
- for (let t of i.value.extras ?? []) X[t.key] && (e[t.key] = "1");
1201
- return e;
1202
- }
1203
- function le(e) {
1204
- return r.push({
1205
- name: i.value.target,
1206
- query: e
1207
- });
1208
- }
1209
- function Q() {
1210
- let e = {};
1211
- if (a.value === "rows") q.value.forEach((t, n) => {
1212
- if (t.keyword) {
1213
- if (n === 0) e.q = t.keyword, t.field && (e.field = t.field);
1214
- else {
1215
- let r = n + 1;
1216
- e[`q${r}`] = t.keyword, t.field && (e[`field${r}`] = t.field), e[`op${r}`] = t.cond;
1217
- }
1218
- }
1219
- }), x.value && (e.from = String(x.value)), E.value && (e.to = String(E.value)), V.value && (e.lang = V.value);
1220
- else if (a.value === "radio") {
1221
- let t = Y.value, n = t ? ce[t] : "";
1222
- n && (e[t] = String(n));
1223
- }
1224
- return Object.assign(e, Z()), le(e);
1225
- }
1226
- function ue(e, t) {
1227
- if (t !== "" && t != null) return le({
1228
- [e]: String(t),
1229
- ...Z()
1230
- });
1231
- }
1232
- function de() {
1233
- return le(Z());
1234
- }
1235
- 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(() => ({
1236
- mode: a.value,
1237
- submit: Q,
1238
- showAll: de
1239
- }));
1240
- return (e, t) => (k(), y("section", { class: D(["mwnf-search-form", `mwnf-search-form--${a.value}`]) }, [
1241
- N(e.$slots, "intro", O(w(ge.value))),
1242
- N(e.$slots, "before", O(w(ge.value))),
1243
- C(f, {
1244
- class: "mwnf-search-form__panel",
1245
- mode: fe.value,
1246
- "apply-label": me.value,
1247
- "reset-label": he.value,
1248
- onApply: Q,
1249
- onReset: de
1250
- }, {
1251
- default: H(() => [
1252
- a.value === "rows" ? (k(), y(h, { key: 0 }, [
1253
- (k(!0), y(h, null, M(q.value, (e, t) => (k(), y("div", {
1254
- key: t,
1255
- class: "mwnf-search-form__row"
1256
- }, [
1257
- b("span", rn, F(J(t)), 1),
1258
- t > 0 ? U((k(), y("select", {
1259
- key: 0,
1260
- "onUpdate:modelValue": (t) => e.cond = t,
1261
- class: "mwnf-facet__select mwnf-search-form__operator"
1262
- }, [(k(!0), y(h, null, M(K.value, (e) => (k(), y("option", {
1263
- key: e.key,
1264
- value: e.key
1265
- }, F(I(n)(e.label)), 9, on))), 128))], 8, an)), [[z, e.cond]]) : v("", !0),
1266
- U(b("select", {
1267
- "onUpdate:modelValue": (t) => e.field = t,
1268
- class: "mwnf-facet__select mwnf-search-form__field"
1269
- }, [(k(!0), y(h, null, M(i.value.fields ?? [], (e) => (k(), y("option", {
1270
- key: e.key,
1271
- value: e.key
1272
- }, F(I(n)(e.label)), 9, cn))), 128))], 8, sn), [[z, e.field]]),
1273
- U(b("input", {
1274
- "onUpdate:modelValue": (t) => e.keyword = t,
1275
- type: "text",
1276
- class: "mwnf-search-form__keyword",
1277
- placeholder: I(n)("catalogue.search.keywordPlaceholder")
1278
- }, null, 8, ln), [[B, e.keyword]])
1279
- ]))), 128)),
1280
- te.value ? (k(), y("div", un, [C(l, {
1281
- modelValue: x.value,
1282
- "onUpdate:modelValue": t[0] ||= (e) => x.value = e,
1283
- label: I(n)("catalogue.facet.dateFrom"),
1284
- options: ee.value,
1285
- "any-label": "—"
1286
- }, null, 8, [
1287
- "modelValue",
1288
- "label",
1289
- "options"
1290
- ]), C(l, {
1291
- modelValue: E.value,
1292
- "onUpdate:modelValue": t[1] ||= (e) => E.value = e,
1293
- label: I(n)("catalogue.facet.dateTo"),
1294
- options: p.value,
1295
- "any-label": "—"
1296
- }, null, 8, [
1297
- "modelValue",
1298
- "label",
1299
- "options"
1300
- ])])) : v("", !0),
1301
- i.value.language ? (k(), y("label", dn, [b("span", fn, F(I(n)("catalogue.search.language")), 1), U(b("select", {
1302
- "onUpdate:modelValue": t[2] ||= (e) => T(V) ? V.value = e : null,
1303
- class: "mwnf-facet__select mwnf-search-form__language"
1304
- }, [b("option", pn, F(I(n)("catalogue.search.anyLanguage")), 1), (k(!0), y(h, null, M(ne.value, (e) => (k(), y("option", {
1305
- key: e,
1306
- value: e
1307
- }, F(e.toUpperCase()), 9, mn))), 128))], 512), [[z, I(V)]])])) : v("", !0)
1308
- ], 64)) : a.value === "facets" ? (k(), y(h, { key: 1 }, [(k(!0), y(h, null, M(i.value.facets ?? [], (e) => (k(), _(l, {
1309
- key: e.key,
1310
- label: e.label ? I(n)(e.label) : "",
1311
- options: W.value[e.key] ?? [],
1312
- "model-value": ce[e.key],
1313
- "onUpdate:modelValue": (t) => ue(e.key, t)
1314
- }, null, 8, [
1315
- "label",
1316
- "options",
1317
- "model-value",
1318
- "onUpdate:modelValue"
1319
- ]))), 128)), te.value ? (k(), y("div", hn, [C(l, {
1320
- "model-value": x.value,
1321
- label: I(n)("catalogue.facet.startDate"),
1322
- options: ee.value,
1323
- "onUpdate:modelValue": t[3] ||= (e) => {
1324
- x.value = e, ue("from", e);
1325
- }
1326
- }, null, 8, [
1327
- "model-value",
1328
- "label",
1329
- "options"
1330
- ]), C(l, {
1331
- "model-value": E.value,
1332
- label: I(n)("catalogue.facet.endDate"),
1333
- options: p.value,
1334
- "onUpdate:modelValue": t[4] ||= (e) => {
1335
- E.value = e, ue("to", e);
1336
- }
1337
- }, null, 8, [
1338
- "model-value",
1339
- "label",
1340
- "options"
1341
- ])])) : v("", !0)], 64)) : a.value === "radio" ? (k(!0), y(h, { key: 2 }, M(i.value.facets ?? [], (e) => (k(), y("div", {
1342
- key: e.key,
1343
- class: "mwnf-search-form__radio-row"
1344
- }, [b("label", gn, [U(b("input", {
1345
- "onUpdate:modelValue": t[5] ||= (e) => Y.value = e,
1346
- type: "radio",
1347
- name: "mwnf-search-form-filter",
1348
- value: e.key
1349
- }, null, 8, _n), [[R, Y.value]]), S(" " + F(e.label ? I(n)(e.label) : ""), 1)]), e.type === "year" ? U((k(), y("input", {
1350
- key: 1,
1351
- "onUpdate:modelValue": (t) => ce[e.key] = t,
1352
- type: "number",
1353
- class: "mwnf-search-form__year",
1354
- disabled: Y.value !== e.key
1355
- }, null, 8, vn)), [[B, ce[e.key]]]) : (k(), _(l, {
1356
- key: 0,
1357
- modelValue: ce[e.key],
1358
- "onUpdate:modelValue": (t) => ce[e.key] = t,
1359
- options: W.value[e.key] ?? [],
1360
- disabled: Y.value !== e.key
1361
- }, null, 8, [
1362
- "modelValue",
1363
- "onUpdate:modelValue",
1364
- "options",
1365
- "disabled"
1366
- ]))]))), 128)) : v("", !0),
1367
- (k(!0), y(h, null, M(i.value.extras ?? [], (e) => (k(), y("label", {
1368
- key: e.key,
1369
- class: "mwnf-facet mwnf-facet--checkbox"
1370
- }, [U(b("input", {
1371
- "onUpdate:modelValue": (t) => X[e.key] = t,
1372
- type: "checkbox",
1373
- class: "mwnf-facet__checkbox"
1374
- }, null, 8, yn), [[L, X[e.key]]]), b("span", bn, F(I(n)(e.label)), 1)]))), 128)),
1375
- N(e.$slots, "extras", O(w(ge.value)))
1376
- ]),
1377
- _: 3
1378
- }, 8, [
1379
- "mode",
1380
- "apply-label",
1381
- "reset-label"
1382
- ]),
1383
- i.value.howTo ? (k(), y("p", xn, [C(m, { to: { name: i.value.howTo } }, {
1384
- default: H(() => [S(F(I(n)("catalogue.search.howTo")), 1)]),
1385
- _: 1
1386
- }, 8, ["to"])])) : v("", !0),
1387
- N(e.$slots, "actions", O(w(ge.value)))
1388
- ], 2));
1389
- }
1390
- }, Cn = { class: "mwnf-timeline" }, wn = {
1391
- key: 0,
1392
- class: "mwnf-timeline__title"
1393
- }, Tn = {
1394
- key: 3,
1395
- class: "mwnf-facet"
1396
- }, En = { class: "mwnf-facet__label" }, Dn = [
1397
- "value",
1398
- "placeholder",
1399
- "onInput"
1400
- ], On = {
1401
- key: 1,
1402
- class: "mwnf-timeline__error"
1403
- }, kn = {
1404
- __name: "TimelineResultsView",
1405
- props: { spec: {
1406
- type: Object,
1407
- required: !0
1408
- } },
1409
- setup(e) {
1410
- let t = e, { t: n } = be(), r = Me(), a = g(() => t.spec), s = g(() => !!a.value.entrance), c = ke({
1411
- scope: t.spec.scope ?? "country",
1412
- countryLabel: t.spec.countryLabel,
1413
- countryIdForCode: t.spec.countryIdForCode,
1414
- tr: t.spec.tr,
1415
- timelinesEntity: t.spec.timelinesEntity,
1416
- eventsEntity: t.spec.eventsEntity
1417
- }), 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(() => ({
1418
- t: n,
1419
- tr: t.spec.tr,
1420
- years: {
1421
- min: z.value[0],
1422
- max: z.value[1]
1423
- }
1424
- })), 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;
1425
- function P(e) {
1426
- if (ee("collection") && e !== "" && e != null) return e === "pc" ? null : e;
1427
- }
1428
- function ne() {
1429
- for (let e of d.value) x[e] = "";
1430
- T.value = "";
1431
- }
1432
- function L() {
1433
- T.value = "";
1434
- let e = !!D.begin && !!D.end;
1435
- if (e && Number(D.begin) >= Number(D.end)) {
1436
- T.value = n(a.value.errorPeriod ?? "timeline.form.errorPeriod");
1437
- return;
1438
- }
1439
- if (!D.country && !e) {
1440
- T.value = n(a.value.errorSelect ?? "timeline.form.errorSelect");
1441
- return;
1442
- }
1443
- let t = {};
1444
- for (let e of d.value) D[e] && (t[e] = D[e]);
1445
- r.push({
1446
- name: a.value.route,
1447
- query: t
1448
- });
1449
- }
1450
- let R = g(() => {
1451
- if (s.value) return [];
1452
- let e = D;
1453
- return c.findEvents({
1454
- country: e.country || void 0,
1455
- collection: P(e.collection),
1456
- begin: e.begin,
1457
- end: e.end
1458
- });
1459
- }), z = g(() => {
1460
- let e = c.findEvents({
1461
- country: void 0,
1462
- collection: void 0
1463
- }).map((e) => e.year_from).filter((e) => Number.isFinite(e) && e !== 0);
1464
- return e.length ? [Math.min(...e), Math.max(...e)] : [null, null];
1465
- }), B = Ce(R, {
1466
- page: () => E ? E.page.value : 1,
1467
- size: () => a.value.pageSize ?? 15
1468
- });
1469
- function V(e) {
1470
- let t = a.value.countryLabel && e.country_id ? a.value.countryLabel(e.country_id) : "";
1471
- return {
1472
- id: e.id,
1473
- date: K(e, e.text, n),
1474
- caption: t ? de(String(t)) : "",
1475
- description: e.text?.description ? ue(String(e.text.description), { breaks: !0 }) : ""
1476
- };
1477
- }
1478
- let U = g(() => B.value.rows.map((e) => (a.value.event ?? V)(e, te.value))), re = g(() => (c.countries.value ?? []).map((e) => ({
1479
- value: e.value,
1480
- label: e.value === "all" ? n("timeline.form.allCountries") : e.label
1481
- }))), ie = g(() => a.value.collections?.(te.value) ?? []), W = g(() => {
1482
- let e = {};
1483
- 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);
1484
- return e;
1485
- }), G = g(() => ({
1486
- filters: D,
1487
- active: d.value.some((e) => D[e]),
1488
- apply: s.value ? L : (e) => E.apply(e),
1489
- reset: s.value ? ne : E.reset,
1490
- goToPage: s.value ? () => {} : E.goToPage,
1491
- events: R.value,
1492
- pageInfo: B.value,
1493
- countries: re.value,
1494
- collections: ie.value,
1495
- t: n,
1496
- tr: a.value.tr
1497
- })), ae = g(() => {
1498
- let e = a.value.gallery;
1499
- return !e || s.value ? null : !e.items || e.items(G.value);
1500
- }), oe = g(() => {
1501
- let e = ae.value;
1502
- return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
1503
- }), se = g(() => {
1504
- let e = ae.value;
1505
- return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
1506
- }), q = g(() => {
1507
- if (!oe.value) return null;
1508
- let e = {};
1509
- for (let t of d.value) D[t] && (e[t] = D[t]);
1510
- return {
1511
- to: {
1512
- name: a.value.gallery.route,
1513
- query: e
1514
- },
1515
- count: se.value,
1516
- label: n(a.value.gallery.label ?? "timeline.nav.seeGallery")
1517
- };
1518
- }), J = g(() => ({
1519
- ...G.value,
1520
- gallery: q.value
1521
- })), Y = g(() => a.value.summary ? a.value.summary(J.value) : [{
1522
- label: n(a.value.summaryLabel ?? "timeline.results.eventsFound"),
1523
- count: B.value.total
1524
- }]), ce = g(() => n(a.value.empty ?? "timeline.results.noResults")), X = g(() => ({
1525
- window: 5,
1526
- jump: !1,
1527
- ends: !0,
1528
- ...a.value.pagination ?? {}
1529
- }));
1530
- function Z(e, t) {
1531
- return e.label ? n(e.label) : t ? n(t) : "";
1532
- }
1533
- return (e, t) => (k(), y("section", Cn, [
1534
- N(e.$slots, "before", O(w(J.value))),
1535
- a.value.title ? (k(), y("h1", wn, F(I(n)(a.value.title)), 1)) : v("", !0),
1536
- C(f, {
1537
- class: "mwnf-timeline__filters",
1538
- title: a.value.filterTitle ? I(n)(a.value.filterTitle) : "",
1539
- "apply-label": s.value ? I(n)(a.value.submitLabel ?? "core.action.search") : a.value.applyLabel ? I(n)(a.value.applyLabel) : "",
1540
- "reset-label": a.value.resetLabel ? I(n)(a.value.resetLabel) : "",
1541
- onApply: t[2] ||= (e) => s.value ? L() : I(E).apply(),
1542
- onReset: t[3] ||= (e) => s.value ? ne() : I(E).reset()
1543
- }, {
1544
- default: H(() => [(k(!0), y(h, null, M(u.value, (e) => (k(), y(h, { key: e.key }, [e.key === "country" ? (k(), _(l, {
1545
- key: 0,
1546
- "model-value": I(D).country,
1547
- label: Z(e, "catalogue.facet.country"),
1548
- options: re.value,
1549
- placeholder: e.placeholder ? I(n)(e.placeholder) : I(n)("catalogue.facet.selectCountry"),
1550
- "any-label": e.anyLabel ? I(n)(e.anyLabel) : "",
1551
- "hide-empty": !!e.hideEmpty,
1552
- "onUpdate:modelValue": t[0] ||= (e) => I(D).country = e
1553
- }, null, 8, [
1554
- "model-value",
1555
- "label",
1556
- "options",
1557
- "placeholder",
1558
- "any-label",
1559
- "hide-empty"
1560
- ])) : e.key === "collection" ? (k(), _(l, {
1561
- key: 1,
1562
- "model-value": I(D).collection,
1563
- label: Z(e),
1564
- options: ie.value,
1565
- placeholder: e.placeholder ? I(n)(e.placeholder) : "",
1566
- "any-label": e.anyLabel ? I(n)(e.anyLabel) : "",
1567
- "hide-empty": !!e.hideEmpty,
1568
- "onUpdate:modelValue": t[1] ||= (e) => I(D).collection = e
1569
- }, null, 8, [
1570
- "model-value",
1571
- "label",
1572
- "options",
1573
- "placeholder",
1574
- "any-label",
1575
- "hide-empty"
1576
- ])) : (e.key === "begin" || e.key === "end") && W.value[e.key] ? (k(), _(l, {
1577
- key: 2,
1578
- "model-value": I(D)[e.key],
1579
- label: Z(e, e.key === "begin" ? "catalogue.facet.startDate" : "catalogue.facet.endDate"),
1580
- options: W.value[e.key],
1581
- placeholder: e.placeholder ? I(n)(e.placeholder) : I(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1582
- "any-label": e.anyLabel ? I(n)(e.anyLabel) : "",
1583
- "hide-empty": !!e.hideEmpty,
1584
- "onUpdate:modelValue": (t) => I(D)[e.key] = t
1585
- }, null, 8, [
1586
- "model-value",
1587
- "label",
1588
- "options",
1589
- "placeholder",
1590
- "any-label",
1591
- "hide-empty",
1592
- "onUpdate:modelValue"
1593
- ])) : (k(), y("label", Tn, [b("span", En, F(Z(e, e.key === "begin" ? "catalogue.facet.startDate" : "catalogue.facet.endDate")), 1), b("input", {
1594
- type: "number",
1595
- class: "mwnf-facet__select",
1596
- value: I(D)[e.key],
1597
- placeholder: e.placeholder ? I(n)(e.placeholder) : I(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1598
- onInput: (t) => I(D)[e.key] = t.target.value
1599
- }, null, 40, Dn)]))], 64))), 128))]),
1600
- _: 1
1601
- }, 8, [
1602
- "title",
1603
- "apply-label",
1604
- "reset-label"
1605
- ]),
1606
- s.value && T.value ? (k(), y("p", On, F(T.value), 1)) : v("", !0),
1607
- s.value ? v("", !0) : (k(), y(h, { key: 2 }, [
1608
- N(e.$slots, "summary", O(w(J.value)), () => [C(i, { parts: Y.value }, null, 8, ["parts"])]),
1609
- q.value ? (k(), _(m, {
1610
- key: 0,
1611
- class: "mwnf-timeline__gallery",
1612
- to: q.value.to
1613
- }, {
1614
- 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))])]),
1615
- _: 3
1616
- }, 8, ["to"])) : v("", !0),
1617
- N(e.$slots, "event", O(w(J.value)), () => [C(p, { events: U.value }, {
1618
- empty: H(() => [N(e.$slots, "empty", O(w(J.value)), () => [S(F(ce.value), 1)])]),
1619
- _: 3
1620
- }, 8, ["events"])]),
1621
- C(o, {
1622
- "page-info": I(B),
1623
- window: X.value.window,
1624
- jump: X.value.jump,
1625
- ends: X.value.ends,
1626
- onNavigate: I(E).goToPage
1627
- }, null, 8, [
1628
- "page-info",
1629
- "window",
1630
- "jump",
1631
- "ends",
1632
- "onNavigate"
1633
- ])
1634
- ], 64)),
1635
- N(e.$slots, "after", O(w(J.value)))
1636
- ]));
1637
- }
1638
- };
1639
- //#endregion
1640
- 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 };