dbf-mirador 4.3.0-testing1 → 4.3.0-testing2

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 (46) hide show
  1. package/dist/AudioViewer-tRH73pbt.js +40 -0
  2. package/dist/AudioViewer-tRH73pbt.js.map +1 -0
  3. package/dist/CommentSharp-DaW0oBJy.js +322 -0
  4. package/dist/CommentSharp-DaW0oBJy.js.map +1 -0
  5. package/dist/FailedImageContext-DYZ9cZx9.js +318 -0
  6. package/dist/FailedImageContext-DYZ9cZx9.js.map +1 -0
  7. package/dist/GalleryView-DyLH1kk0.js +176 -0
  8. package/dist/GalleryView-DyLH1kk0.js.map +1 -0
  9. package/dist/OpenSeadragonViewer-CBmX5sYE.js +7852 -0
  10. package/dist/OpenSeadragonViewer-CBmX5sYE.js.map +1 -0
  11. package/dist/PluginHook-DWFCXIIp.js +54 -0
  12. package/dist/PluginHook-DWFCXIIp.js.map +1 -0
  13. package/dist/SelectCollection-BK9ZDkK3.js +67 -0
  14. package/dist/SelectCollection-BK9ZDkK3.js.map +1 -0
  15. package/dist/TextViewer-D_1qzQE4.js +38 -0
  16. package/dist/TextViewer-D_1qzQE4.js.map +1 -0
  17. package/dist/VideoViewer-DzNjgLWE.js +42 -0
  18. package/dist/VideoViewer-DzNjgLWE.js.map +1 -0
  19. package/dist/WindowCanvasNavigationControls-D2uLtL_A.js +242 -0
  20. package/dist/WindowCanvasNavigationControls-D2uLtL_A.js.map +1 -0
  21. package/dist/WindowViewer-BW0_w7wv.js +27 -0
  22. package/dist/WindowViewer-BW0_w7wv.js.map +1 -0
  23. package/dist/WorkspaceArea-C0RjqnIL.js +22222 -0
  24. package/dist/WorkspaceArea-C0RjqnIL.js.map +1 -0
  25. package/dist/action-types-DjIbTE-A.js +74 -0
  26. package/dist/action-types-DjIbTE-A.js.map +1 -0
  27. package/dist/canvas-2ACcnS9Y.js +41 -0
  28. package/dist/canvas-2ACcnS9Y.js.map +1 -0
  29. package/dist/canvases-DTR37lo-.js +3270 -0
  30. package/dist/canvases-DTR37lo-.js.map +1 -0
  31. package/dist/createSvgIcon-Cwt8YPfm.js +2 -0
  32. package/dist/getters-B4oepJRC.js +2043 -0
  33. package/dist/getters-B4oepJRC.js.map +1 -0
  34. package/dist/index.module-CgUBfaXx.js +403 -0
  35. package/dist/index.module-CgUBfaXx.js.map +1 -0
  36. package/dist/mirador.es.js +9222 -0
  37. package/dist/mirador.es.js.map +1 -0
  38. package/dist/mirador.min.js +335 -0
  39. package/dist/mirador.min.js.map +1 -0
  40. package/dist/react-error-boundary.esm-ByHqCaxk.js +67 -0
  41. package/dist/react-error-boundary.esm-ByHqCaxk.js.map +1 -0
  42. package/dist/visuallyHidden-C4mhQkB0.js +98 -0
  43. package/dist/visuallyHidden-C4mhQkB0.js.map +1 -0
  44. package/dist/window-COQOIAli.js +138 -0
  45. package/dist/window-COQOIAli.js.map +1 -0
  46. package/package.json +3 -2
@@ -0,0 +1,3270 @@
1
+ import { $ as e, C as t, D as n, G as r, J as i, K as a, Q as o, S as s, T as c, Y as l, Z as u, a as d, c as f, d as p, f as m, ft as h, l as g, m as _, n as v, nt as y, o as b, q as x, rt as S, tt as C, u as w, ut as T, v as E, w as D, x as O } from "./getters-B4oepJRC.js";
2
+ //#region node_modules/lodash/_isKey.js
3
+ var k = /* @__PURE__ */ T(((e, t) => {
4
+ var n = S(), r = o(), i = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, a = /^\w*$/;
5
+ function s(e, t) {
6
+ if (n(e)) return !1;
7
+ var o = typeof e;
8
+ return o == "number" || o == "symbol" || o == "boolean" || e == null || r(e) ? !0 : a.test(e) || !i.test(e) || t != null && e in Object(t);
9
+ }
10
+ t.exports = s;
11
+ })), A = /* @__PURE__ */ T(((e, t) => {
12
+ t.exports = l()(Object, "create");
13
+ })), ee = /* @__PURE__ */ T(((e, t) => {
14
+ var n = A();
15
+ function r() {
16
+ this.__data__ = n ? n(null) : {}, this.size = 0;
17
+ }
18
+ t.exports = r;
19
+ })), te = /* @__PURE__ */ T(((e, t) => {
20
+ function n(e) {
21
+ var t = this.has(e) && delete this.__data__[e];
22
+ return this.size -= +!!t, t;
23
+ }
24
+ t.exports = n;
25
+ })), ne = /* @__PURE__ */ T(((e, t) => {
26
+ var n = A(), r = "__lodash_hash_undefined__", i = Object.prototype.hasOwnProperty;
27
+ function a(e) {
28
+ var t = this.__data__;
29
+ if (n) {
30
+ var a = t[e];
31
+ return a === r ? void 0 : a;
32
+ }
33
+ return i.call(t, e) ? t[e] : void 0;
34
+ }
35
+ t.exports = a;
36
+ })), re = /* @__PURE__ */ T(((e, t) => {
37
+ var n = A(), r = Object.prototype.hasOwnProperty;
38
+ function i(e) {
39
+ var t = this.__data__;
40
+ return n ? t[e] !== void 0 : r.call(t, e);
41
+ }
42
+ t.exports = i;
43
+ })), ie = /* @__PURE__ */ T(((e, t) => {
44
+ var n = A(), r = "__lodash_hash_undefined__";
45
+ function i(e, t) {
46
+ var i = this.__data__;
47
+ return this.size += +!this.has(e), i[e] = n && t === void 0 ? r : t, this;
48
+ }
49
+ t.exports = i;
50
+ })), ae = /* @__PURE__ */ T(((e, t) => {
51
+ var n = ee(), r = te(), i = ne(), a = re(), o = ie();
52
+ function s(e) {
53
+ var t = -1, n = e == null ? 0 : e.length;
54
+ for (this.clear(); ++t < n;) {
55
+ var r = e[t];
56
+ this.set(r[0], r[1]);
57
+ }
58
+ }
59
+ s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
60
+ })), oe = /* @__PURE__ */ T(((e, t) => {
61
+ function n() {
62
+ this.__data__ = [], this.size = 0;
63
+ }
64
+ t.exports = n;
65
+ })), j = /* @__PURE__ */ T(((e, t) => {
66
+ function n(e, t) {
67
+ return e === t || e !== e && t !== t;
68
+ }
69
+ t.exports = n;
70
+ })), M = /* @__PURE__ */ T(((e, t) => {
71
+ var n = j();
72
+ function r(e, t) {
73
+ for (var r = e.length; r--;) if (n(e[r][0], t)) return r;
74
+ return -1;
75
+ }
76
+ t.exports = r;
77
+ })), se = /* @__PURE__ */ T(((e, t) => {
78
+ var n = M(), r = Array.prototype.splice;
79
+ function i(e) {
80
+ var t = this.__data__, i = n(t, e);
81
+ return i < 0 ? !1 : (i == t.length - 1 ? t.pop() : r.call(t, i, 1), --this.size, !0);
82
+ }
83
+ t.exports = i;
84
+ })), ce = /* @__PURE__ */ T(((e, t) => {
85
+ var n = M();
86
+ function r(e) {
87
+ var t = this.__data__, r = n(t, e);
88
+ return r < 0 ? void 0 : t[r][1];
89
+ }
90
+ t.exports = r;
91
+ })), le = /* @__PURE__ */ T(((e, t) => {
92
+ var n = M();
93
+ function r(e) {
94
+ return n(this.__data__, e) > -1;
95
+ }
96
+ t.exports = r;
97
+ })), ue = /* @__PURE__ */ T(((e, t) => {
98
+ var n = M();
99
+ function r(e, t) {
100
+ var r = this.__data__, i = n(r, e);
101
+ return i < 0 ? (++this.size, r.push([e, t])) : r[i][1] = t, this;
102
+ }
103
+ t.exports = r;
104
+ })), N = /* @__PURE__ */ T(((e, t) => {
105
+ var n = oe(), r = se(), i = ce(), a = le(), o = ue();
106
+ function s(e) {
107
+ var t = -1, n = e == null ? 0 : e.length;
108
+ for (this.clear(); ++t < n;) {
109
+ var r = e[t];
110
+ this.set(r[0], r[1]);
111
+ }
112
+ }
113
+ s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
114
+ })), de = /* @__PURE__ */ T(((e, t) => {
115
+ var n = ae(), r = N(), a = i();
116
+ function o() {
117
+ this.size = 0, this.__data__ = {
118
+ hash: new n(),
119
+ map: new (a || r)(),
120
+ string: new n()
121
+ };
122
+ }
123
+ t.exports = o;
124
+ })), fe = /* @__PURE__ */ T(((e, t) => {
125
+ function n(e) {
126
+ var t = typeof e;
127
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
128
+ }
129
+ t.exports = n;
130
+ })), P = /* @__PURE__ */ T(((e, t) => {
131
+ var n = fe();
132
+ function r(e, t) {
133
+ var r = e.__data__;
134
+ return n(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
135
+ }
136
+ t.exports = r;
137
+ })), pe = /* @__PURE__ */ T(((e, t) => {
138
+ var n = P();
139
+ function r(e) {
140
+ var t = n(this, e).delete(e);
141
+ return this.size -= +!!t, t;
142
+ }
143
+ t.exports = r;
144
+ })), me = /* @__PURE__ */ T(((e, t) => {
145
+ var n = P();
146
+ function r(e) {
147
+ return n(this, e).get(e);
148
+ }
149
+ t.exports = r;
150
+ })), he = /* @__PURE__ */ T(((e, t) => {
151
+ var n = P();
152
+ function r(e) {
153
+ return n(this, e).has(e);
154
+ }
155
+ t.exports = r;
156
+ })), ge = /* @__PURE__ */ T(((e, t) => {
157
+ var n = P();
158
+ function r(e, t) {
159
+ var r = n(this, e), i = r.size;
160
+ return r.set(e, t), this.size += r.size == i ? 0 : 1, this;
161
+ }
162
+ t.exports = r;
163
+ })), F = /* @__PURE__ */ T(((e, t) => {
164
+ var n = de(), r = pe(), i = me(), a = he(), o = ge();
165
+ function s(e) {
166
+ var t = -1, n = e == null ? 0 : e.length;
167
+ for (this.clear(); ++t < n;) {
168
+ var r = e[t];
169
+ this.set(r[0], r[1]);
170
+ }
171
+ }
172
+ s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
173
+ })), _e = /* @__PURE__ */ T(((e, t) => {
174
+ var n = F(), r = "Expected a function";
175
+ function i(e, t) {
176
+ if (typeof e != "function" || t != null && typeof t != "function") throw TypeError(r);
177
+ var a = function() {
178
+ var n = arguments, r = t ? t.apply(this, n) : n[0], i = a.cache;
179
+ if (i.has(r)) return i.get(r);
180
+ var o = e.apply(this, n);
181
+ return a.cache = i.set(r, o) || i, o;
182
+ };
183
+ return a.cache = new (i.Cache || n)(), a;
184
+ }
185
+ i.Cache = n, t.exports = i;
186
+ })), ve = /* @__PURE__ */ T(((e, t) => {
187
+ var n = _e(), r = 500;
188
+ function i(e) {
189
+ var t = n(e, function(e) {
190
+ return i.size === r && i.clear(), e;
191
+ }), i = t.cache;
192
+ return t;
193
+ }
194
+ t.exports = i;
195
+ })), ye = /* @__PURE__ */ T(((e, t) => {
196
+ var n = ve(), r = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i = /\\(\\)?/g;
197
+ t.exports = n(function(e) {
198
+ var t = [];
199
+ return e.charCodeAt(0) === 46 && t.push(""), e.replace(r, function(e, n, r, a) {
200
+ t.push(r ? a.replace(i, "$1") : n || e);
201
+ }), t;
202
+ });
203
+ })), be = /* @__PURE__ */ T(((e, t) => {
204
+ function n(e, t) {
205
+ for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
206
+ return i;
207
+ }
208
+ t.exports = n;
209
+ })), xe = /* @__PURE__ */ T(((e, t) => {
210
+ var n = C(), r = be(), i = S(), a = o(), s = 1 / 0, c = n ? n.prototype : void 0, l = c ? c.toString : void 0;
211
+ function u(e) {
212
+ if (typeof e == "string") return e;
213
+ if (i(e)) return r(e, u) + "";
214
+ if (a(e)) return l ? l.call(e) : "";
215
+ var t = e + "";
216
+ return t == "0" && 1 / e == -s ? "-0" : t;
217
+ }
218
+ t.exports = u;
219
+ })), Se = /* @__PURE__ */ T(((e, t) => {
220
+ var n = xe();
221
+ function r(e) {
222
+ return e == null ? "" : n(e);
223
+ }
224
+ t.exports = r;
225
+ })), I = /* @__PURE__ */ T(((e, t) => {
226
+ var n = S(), r = k(), i = ye(), a = Se();
227
+ function o(e, t) {
228
+ return n(e) ? e : r(e, t) ? [e] : i(a(e));
229
+ }
230
+ t.exports = o;
231
+ })), L = /* @__PURE__ */ T(((e, t) => {
232
+ var n = o(), r = 1 / 0;
233
+ function i(e) {
234
+ if (typeof e == "string" || n(e)) return e;
235
+ var t = e + "";
236
+ return t == "0" && 1 / e == -r ? "-0" : t;
237
+ }
238
+ t.exports = i;
239
+ })), Ce = /* @__PURE__ */ T(((e, t) => {
240
+ var n = I(), r = L();
241
+ function i(e, t) {
242
+ t = n(t, e);
243
+ for (var i = 0, a = t.length; e != null && i < a;) e = e[r(t[i++])];
244
+ return i && i == a ? e : void 0;
245
+ }
246
+ t.exports = i;
247
+ })), we = /* @__PURE__ */ T(((e, t) => {
248
+ var n = x();
249
+ function r(e, t, r) {
250
+ t == "__proto__" && n ? n(e, t, {
251
+ configurable: !0,
252
+ enumerable: !0,
253
+ value: r,
254
+ writable: !0
255
+ }) : e[t] = r;
256
+ }
257
+ t.exports = r;
258
+ })), Te = /* @__PURE__ */ T(((e, t) => {
259
+ function n(e, t) {
260
+ for (var n = -1, r = e == null ? 0 : e.length, i = 0, a = []; ++n < r;) {
261
+ var o = e[n];
262
+ t(o, n, e) && (a[i++] = o);
263
+ }
264
+ return a;
265
+ }
266
+ t.exports = n;
267
+ })), Ee = /* @__PURE__ */ T(((e, t) => {
268
+ function n(e) {
269
+ return function(t, n, r) {
270
+ for (var i = -1, a = Object(t), o = r(t), s = o.length; s--;) {
271
+ var c = o[e ? s : ++i];
272
+ if (n(a[c], c, a) === !1) break;
273
+ }
274
+ return t;
275
+ };
276
+ }
277
+ t.exports = n;
278
+ })), De = /* @__PURE__ */ T(((e, t) => {
279
+ t.exports = Ee()();
280
+ })), Oe = /* @__PURE__ */ T(((e, t) => {
281
+ function n(e, t) {
282
+ for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
283
+ return r;
284
+ }
285
+ t.exports = n;
286
+ })), ke = /* @__PURE__ */ T(((e, t) => {
287
+ var n = Oe(), r = D(), i = S(), o = O(), s = a(), c = E(), l = Object.prototype.hasOwnProperty;
288
+ function u(e, t) {
289
+ var a = i(e), u = !a && r(e), d = !a && !u && o(e), f = !a && !u && !d && c(e), p = a || u || d || f, m = p ? n(e.length, String) : [], h = m.length;
290
+ for (var g in e) (t || l.call(e, g)) && !(p && (g == "length" || d && (g == "offset" || g == "parent") || f && (g == "buffer" || g == "byteLength" || g == "byteOffset") || s(g, h))) && m.push(g);
291
+ return m;
292
+ }
293
+ t.exports = u;
294
+ })), R = /* @__PURE__ */ T(((e, t) => {
295
+ var r = ke(), i = n(), a = s();
296
+ function o(e) {
297
+ return a(e) ? r(e) : i(e);
298
+ }
299
+ t.exports = o;
300
+ })), Ae = /* @__PURE__ */ T(((e, t) => {
301
+ var n = De(), r = R();
302
+ function i(e, t) {
303
+ return e && n(e, t, r);
304
+ }
305
+ t.exports = i;
306
+ })), je = /* @__PURE__ */ T(((e, t) => {
307
+ var n = s();
308
+ function r(e, t) {
309
+ return function(r, i) {
310
+ if (r == null) return r;
311
+ if (!n(r)) return e(r, i);
312
+ for (var a = r.length, o = t ? a : -1, s = Object(r); (t ? o-- : ++o < a) && i(s[o], o, s) !== !1;);
313
+ return r;
314
+ };
315
+ }
316
+ t.exports = r;
317
+ })), Me = /* @__PURE__ */ T(((e, t) => {
318
+ var n = Ae();
319
+ t.exports = je()(n);
320
+ })), Ne = /* @__PURE__ */ T(((e, t) => {
321
+ var n = N();
322
+ function r() {
323
+ this.__data__ = new n(), this.size = 0;
324
+ }
325
+ t.exports = r;
326
+ })), Pe = /* @__PURE__ */ T(((e, t) => {
327
+ function n(e) {
328
+ var t = this.__data__, n = t.delete(e);
329
+ return this.size = t.size, n;
330
+ }
331
+ t.exports = n;
332
+ })), Fe = /* @__PURE__ */ T(((e, t) => {
333
+ function n(e) {
334
+ return this.__data__.get(e);
335
+ }
336
+ t.exports = n;
337
+ })), Ie = /* @__PURE__ */ T(((e, t) => {
338
+ function n(e) {
339
+ return this.__data__.has(e);
340
+ }
341
+ t.exports = n;
342
+ })), Le = /* @__PURE__ */ T(((e, t) => {
343
+ var n = N(), r = i(), a = F(), o = 200;
344
+ function s(e, t) {
345
+ var i = this.__data__;
346
+ if (i instanceof n) {
347
+ var s = i.__data__;
348
+ if (!r || s.length < o - 1) return s.push([e, t]), this.size = ++i.size, this;
349
+ i = this.__data__ = new a(s);
350
+ }
351
+ return i.set(e, t), this.size = i.size, this;
352
+ }
353
+ t.exports = s;
354
+ })), Re = /* @__PURE__ */ T(((e, t) => {
355
+ var n = N(), r = Ne(), i = Pe(), a = Fe(), o = Ie(), s = Le();
356
+ function c(e) {
357
+ var t = this.__data__ = new n(e);
358
+ this.size = t.size;
359
+ }
360
+ c.prototype.clear = r, c.prototype.delete = i, c.prototype.get = a, c.prototype.has = o, c.prototype.set = s, t.exports = c;
361
+ })), ze = /* @__PURE__ */ T(((e, t) => {
362
+ function n(e) {
363
+ return this.__data__.set(e, "__lodash_hash_undefined__"), this;
364
+ }
365
+ t.exports = n;
366
+ })), Be = /* @__PURE__ */ T(((e, t) => {
367
+ function n(e) {
368
+ return this.__data__.has(e);
369
+ }
370
+ t.exports = n;
371
+ })), Ve = /* @__PURE__ */ T(((e, t) => {
372
+ var n = F(), r = ze(), i = Be();
373
+ function a(e) {
374
+ var t = -1, r = e == null ? 0 : e.length;
375
+ for (this.__data__ = new n(); ++t < r;) this.add(e[t]);
376
+ }
377
+ a.prototype.add = a.prototype.push = r, a.prototype.has = i, t.exports = a;
378
+ })), He = /* @__PURE__ */ T(((e, t) => {
379
+ function n(e, t) {
380
+ for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (t(e[n], n, e)) return !0;
381
+ return !1;
382
+ }
383
+ t.exports = n;
384
+ })), Ue = /* @__PURE__ */ T(((e, t) => {
385
+ function n(e, t) {
386
+ return e.has(t);
387
+ }
388
+ t.exports = n;
389
+ })), We = /* @__PURE__ */ T(((e, t) => {
390
+ var n = Ve(), r = He(), i = Ue(), a = 1, o = 2;
391
+ function s(e, t, s, c, l, u) {
392
+ var d = s & a, f = e.length, p = t.length;
393
+ if (f != p && !(d && p > f)) return !1;
394
+ var m = u.get(e), h = u.get(t);
395
+ if (m && h) return m == t && h == e;
396
+ var g = -1, _ = !0, v = s & o ? new n() : void 0;
397
+ for (u.set(e, t), u.set(t, e); ++g < f;) {
398
+ var y = e[g], b = t[g];
399
+ if (c) var x = d ? c(b, y, g, t, e, u) : c(y, b, g, e, t, u);
400
+ if (x !== void 0) {
401
+ if (x) continue;
402
+ _ = !1;
403
+ break;
404
+ }
405
+ if (v) {
406
+ if (!r(t, function(e, t) {
407
+ if (!i(v, t) && (y === e || l(y, e, s, c, u))) return v.push(t);
408
+ })) {
409
+ _ = !1;
410
+ break;
411
+ }
412
+ } else if (!(y === b || l(y, b, s, c, u))) {
413
+ _ = !1;
414
+ break;
415
+ }
416
+ }
417
+ return u.delete(e), u.delete(t), _;
418
+ }
419
+ t.exports = s;
420
+ })), Ge = /* @__PURE__ */ T(((e, t) => {
421
+ t.exports = y().Uint8Array;
422
+ })), Ke = /* @__PURE__ */ T(((e, t) => {
423
+ function n(e) {
424
+ var t = -1, n = Array(e.size);
425
+ return e.forEach(function(e, r) {
426
+ n[++t] = [r, e];
427
+ }), n;
428
+ }
429
+ t.exports = n;
430
+ })), qe = /* @__PURE__ */ T(((e, t) => {
431
+ function n(e) {
432
+ var t = -1, n = Array(e.size);
433
+ return e.forEach(function(e) {
434
+ n[++t] = e;
435
+ }), n;
436
+ }
437
+ t.exports = n;
438
+ })), Je = /* @__PURE__ */ T(((e, t) => {
439
+ var n = C(), r = Ge(), i = j(), a = We(), o = Ke(), s = qe(), c = 1, l = 2, u = "[object Boolean]", d = "[object Date]", f = "[object Error]", p = "[object Map]", m = "[object Number]", h = "[object RegExp]", g = "[object Set]", _ = "[object String]", v = "[object Symbol]", y = "[object ArrayBuffer]", b = "[object DataView]", x = n ? n.prototype : void 0, S = x ? x.valueOf : void 0;
440
+ function w(e, t, n, x, C, w, T) {
441
+ switch (n) {
442
+ case b:
443
+ if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
444
+ e = e.buffer, t = t.buffer;
445
+ case y: return !(e.byteLength != t.byteLength || !w(new r(e), new r(t)));
446
+ case u:
447
+ case d:
448
+ case m: return i(+e, +t);
449
+ case f: return e.name == t.name && e.message == t.message;
450
+ case h:
451
+ case _: return e == t + "";
452
+ case p: var E = o;
453
+ case g:
454
+ var D = x & c;
455
+ if (E ||= s, e.size != t.size && !D) return !1;
456
+ var O = T.get(e);
457
+ if (O) return O == t;
458
+ x |= l, T.set(e, t);
459
+ var k = a(E(e), E(t), x, C, w, T);
460
+ return T.delete(e), k;
461
+ case v: if (S) return S.call(e) == S.call(t);
462
+ }
463
+ return !1;
464
+ }
465
+ t.exports = w;
466
+ })), Ye = /* @__PURE__ */ T(((e, t) => {
467
+ function n(e, t) {
468
+ for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
469
+ return e;
470
+ }
471
+ t.exports = n;
472
+ })), Xe = /* @__PURE__ */ T(((e, t) => {
473
+ var n = Ye(), r = S();
474
+ function i(e, t, i) {
475
+ var a = t(e);
476
+ return r(e) ? a : n(a, i(e));
477
+ }
478
+ t.exports = i;
479
+ })), Ze = /* @__PURE__ */ T(((e, t) => {
480
+ function n() {
481
+ return [];
482
+ }
483
+ t.exports = n;
484
+ })), Qe = /* @__PURE__ */ T(((e, t) => {
485
+ var n = Te(), r = Ze(), i = Object.prototype.propertyIsEnumerable, a = Object.getOwnPropertySymbols;
486
+ t.exports = a ? function(e) {
487
+ return e == null ? [] : (e = Object(e), n(a(e), function(t) {
488
+ return i.call(e, t);
489
+ }));
490
+ } : r;
491
+ })), $e = /* @__PURE__ */ T(((e, t) => {
492
+ var n = Xe(), r = Qe(), i = R();
493
+ function a(e) {
494
+ return n(e, i, r);
495
+ }
496
+ t.exports = a;
497
+ })), et = /* @__PURE__ */ T(((e, t) => {
498
+ var n = $e(), r = 1, i = Object.prototype.hasOwnProperty;
499
+ function a(e, t, a, o, s, c) {
500
+ var l = a & r, u = n(e), d = u.length;
501
+ if (d != n(t).length && !l) return !1;
502
+ for (var f = d; f--;) {
503
+ var p = u[f];
504
+ if (!(l ? p in t : i.call(t, p))) return !1;
505
+ }
506
+ var m = c.get(e), h = c.get(t);
507
+ if (m && h) return m == t && h == e;
508
+ var g = !0;
509
+ c.set(e, t), c.set(t, e);
510
+ for (var _ = l; ++f < d;) {
511
+ p = u[f];
512
+ var v = e[p], y = t[p];
513
+ if (o) var b = l ? o(y, v, p, t, e, c) : o(v, y, p, e, t, c);
514
+ if (!(b === void 0 ? v === y || s(v, y, a, o, c) : b)) {
515
+ g = !1;
516
+ break;
517
+ }
518
+ _ ||= p == "constructor";
519
+ }
520
+ if (g && !_) {
521
+ var x = e.constructor, S = t.constructor;
522
+ x != S && "constructor" in e && "constructor" in t && !(typeof x == "function" && x instanceof x && typeof S == "function" && S instanceof S) && (g = !1);
523
+ }
524
+ return c.delete(e), c.delete(t), g;
525
+ }
526
+ t.exports = a;
527
+ })), tt = /* @__PURE__ */ T(((e, t) => {
528
+ var n = Re(), r = We(), i = Je(), a = et(), o = c(), s = S(), l = O(), u = E(), d = 1, f = "[object Arguments]", p = "[object Array]", m = "[object Object]", h = Object.prototype.hasOwnProperty;
529
+ function g(e, t, c, g, _, v) {
530
+ var y = s(e), b = s(t), x = y ? p : o(e), S = b ? p : o(t);
531
+ x = x == f ? m : x, S = S == f ? m : S;
532
+ var C = x == m, w = S == m, T = x == S;
533
+ if (T && l(e)) {
534
+ if (!l(t)) return !1;
535
+ y = !0, C = !1;
536
+ }
537
+ if (T && !C) return v ||= new n(), y || u(e) ? r(e, t, c, g, _, v) : i(e, t, x, c, g, _, v);
538
+ if (!(c & d)) {
539
+ var E = C && h.call(e, "__wrapped__"), D = w && h.call(t, "__wrapped__");
540
+ if (E || D) {
541
+ var O = E ? e.value() : e, k = D ? t.value() : t;
542
+ return v ||= new n(), _(O, k, c, g, v);
543
+ }
544
+ }
545
+ return T ? (v ||= new n(), a(e, t, c, g, _, v)) : !1;
546
+ }
547
+ t.exports = g;
548
+ })), nt = /* @__PURE__ */ T(((t, n) => {
549
+ var r = tt(), i = e();
550
+ function a(e, t, n, o, s) {
551
+ return e === t ? !0 : e == null || t == null || !i(e) && !i(t) ? e !== e && t !== t : r(e, t, n, o, a, s);
552
+ }
553
+ n.exports = a;
554
+ })), rt = /* @__PURE__ */ T(((e, t) => {
555
+ var n = Re(), r = nt(), i = 1, a = 2;
556
+ function o(e, t, o, s) {
557
+ var c = o.length, l = c, u = !s;
558
+ if (e == null) return !l;
559
+ for (e = Object(e); c--;) {
560
+ var d = o[c];
561
+ if (u && d[2] ? d[1] !== e[d[0]] : !(d[0] in e)) return !1;
562
+ }
563
+ for (; ++c < l;) {
564
+ d = o[c];
565
+ var f = d[0], p = e[f], m = d[1];
566
+ if (u && d[2]) {
567
+ if (p === void 0 && !(f in e)) return !1;
568
+ } else {
569
+ var h = new n();
570
+ if (s) var g = s(p, m, f, e, t, h);
571
+ if (!(g === void 0 ? r(m, p, i | a, s, h) : g)) return !1;
572
+ }
573
+ }
574
+ return !0;
575
+ }
576
+ t.exports = o;
577
+ })), it = /* @__PURE__ */ T(((e, t) => {
578
+ var n = u();
579
+ function r(e) {
580
+ return e === e && !n(e);
581
+ }
582
+ t.exports = r;
583
+ })), at = /* @__PURE__ */ T(((e, t) => {
584
+ var n = it(), r = R();
585
+ function i(e) {
586
+ for (var t = r(e), i = t.length; i--;) {
587
+ var a = t[i], o = e[a];
588
+ t[i] = [
589
+ a,
590
+ o,
591
+ n(o)
592
+ ];
593
+ }
594
+ return t;
595
+ }
596
+ t.exports = i;
597
+ })), ot = /* @__PURE__ */ T(((e, t) => {
598
+ function n(e, t) {
599
+ return function(n) {
600
+ return n != null && n[e] === t && (t !== void 0 || e in Object(n));
601
+ };
602
+ }
603
+ t.exports = n;
604
+ })), st = /* @__PURE__ */ T(((e, t) => {
605
+ var n = rt(), r = at(), i = ot();
606
+ function a(e) {
607
+ var t = r(e);
608
+ return t.length == 1 && t[0][2] ? i(t[0][0], t[0][1]) : function(r) {
609
+ return r === e || n(r, e, t);
610
+ };
611
+ }
612
+ t.exports = a;
613
+ })), ct = /* @__PURE__ */ T(((e, t) => {
614
+ var n = Ce();
615
+ function r(e, t, r) {
616
+ var i = e == null ? void 0 : n(e, t);
617
+ return i === void 0 ? r : i;
618
+ }
619
+ t.exports = r;
620
+ })), lt = /* @__PURE__ */ T(((e, t) => {
621
+ function n(e, t) {
622
+ return e != null && t in Object(e);
623
+ }
624
+ t.exports = n;
625
+ })), ut = /* @__PURE__ */ T(((e, n) => {
626
+ var r = I(), i = D(), o = S(), s = a(), c = t(), l = L();
627
+ function u(e, t, n) {
628
+ t = r(t, e);
629
+ for (var a = -1, u = t.length, d = !1; ++a < u;) {
630
+ var f = l(t[a]);
631
+ if (!(d = e != null && n(e, f))) break;
632
+ e = e[f];
633
+ }
634
+ return d || ++a != u ? d : (u = e == null ? 0 : e.length, !!u && c(u) && s(f, u) && (o(e) || i(e)));
635
+ }
636
+ n.exports = u;
637
+ })), dt = /* @__PURE__ */ T(((e, t) => {
638
+ var n = lt(), r = ut();
639
+ function i(e, t) {
640
+ return e != null && r(e, t, n);
641
+ }
642
+ t.exports = i;
643
+ })), ft = /* @__PURE__ */ T(((e, t) => {
644
+ var n = nt(), r = ct(), i = dt(), a = k(), o = it(), s = ot(), c = L(), l = 1, u = 2;
645
+ function d(e, t) {
646
+ return a(e) && o(t) ? s(c(e), t) : function(a) {
647
+ var o = r(a, e);
648
+ return o === void 0 && o === t ? i(a, e) : n(t, o, l | u);
649
+ };
650
+ }
651
+ t.exports = d;
652
+ })), pt = /* @__PURE__ */ T(((e, t) => {
653
+ function n(e) {
654
+ return function(t) {
655
+ return t?.[e];
656
+ };
657
+ }
658
+ t.exports = n;
659
+ })), mt = /* @__PURE__ */ T(((e, t) => {
660
+ var n = Ce();
661
+ function r(e) {
662
+ return function(t) {
663
+ return n(t, e);
664
+ };
665
+ }
666
+ t.exports = r;
667
+ })), ht = /* @__PURE__ */ T(((e, t) => {
668
+ var n = pt(), r = mt(), i = k(), a = L();
669
+ function o(e) {
670
+ return i(e) ? n(a(e)) : r(e);
671
+ }
672
+ t.exports = o;
673
+ })), gt = /* @__PURE__ */ T(((e, t) => {
674
+ var n = st(), i = ft(), a = r(), o = S(), s = ht();
675
+ function c(e) {
676
+ return typeof e == "function" ? e : e == null ? a : typeof e == "object" ? o(e) ? i(e[0], e[1]) : n(e) : s(e);
677
+ }
678
+ t.exports = c;
679
+ })), _t = class {
680
+ constructor(e, t = "single") {
681
+ this.canvases = e, this.viewType = t, this._groupings = null;
682
+ }
683
+ getCanvases(e) {
684
+ switch (this.viewType) {
685
+ case "book": return this.groupings()[Math.ceil(e / 2)];
686
+ default: return this.groupings()[e];
687
+ }
688
+ }
689
+ groupings() {
690
+ if (this._groupings) return this._groupings;
691
+ if (this.viewType === "scroll") return [this.canvases];
692
+ if (this.viewType !== "book") return this.canvases.map((e) => [e]);
693
+ let e = [];
694
+ return this.canvases.forEach((t, n) => {
695
+ if (n === 0) {
696
+ e.push([t]);
697
+ return;
698
+ }
699
+ n % 2 == 0 ? e[Math.ceil(n / 2)].push(t) : e.push([t]);
700
+ }), this._groupings = e, e;
701
+ }
702
+ }, vt = /* @__PURE__ */ T(((e, t) => {
703
+ (function(n, r) {
704
+ typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define("manifesto", [], r) : typeof e == "object" ? e.manifesto = r() : n.manifesto = r();
705
+ })(Object(typeof self < "u" ? self : e), () => (() => {
706
+ var e = {
707
+ 7019(e, t) {
708
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.CONTINUE = 100, t.SWITCHING_PROTOCOLS = 101, t.PROCESSING = 102, t.OK = 200, t.CREATED = 201, t.ACCEPTED = 202, t.NON_AUTHORITATIVE_INFORMATION = 203, t.NO_CONTENT = 204, t.RESET_CONTENT = 205, t.PARTIAL_CONTENT = 206, t.MULTI_STATUS = 207, t.MULTIPLE_CHOICES = 300, t.MOVED_PERMANENTLY = 301, t.MOVED_TEMPORARILY = 302, t.SEE_OTHER = 303, t.NOT_MODIFIED = 304, t.USE_PROXY = 305, t.TEMPORARY_REDIRECT = 307, t.BAD_REQUEST = 400, t.UNAUTHORIZED = 401, t.PAYMENT_REQUIRED = 402, t.FORBIDDEN = 403, t.NOT_FOUND = 404, t.METHOD_NOT_ALLOWED = 405, t.NOT_ACCEPTABLE = 406, t.PROXY_AUTHENTICATION_REQUIRED = 407, t.REQUEST_TIME_OUT = 408, t.CONFLICT = 409, t.GONE = 410, t.LENGTH_REQUIRED = 411, t.PRECONDITION_FAILED = 412, t.REQUEST_ENTITY_TOO_LARGE = 413, t.REQUEST_URI_TOO_LARGE = 414, t.UNSUPPORTED_MEDIA_TYPE = 415, t.REQUESTED_RANGE_NOT_SATISFIABLE = 416, t.EXPECTATION_FAILED = 417, t.IM_A_TEAPOT = 418, t.UNPROCESSABLE_ENTITY = 422, t.LOCKED = 423, t.FAILED_DEPENDENCY = 424, t.UNORDERED_COLLECTION = 425, t.UPGRADE_REQUIRED = 426, t.PRECONDITION_REQUIRED = 428, t.TOO_MANY_REQUESTS = 429, t.REQUEST_HEADER_FIELDS_TOO_LARGE = 431, t.INTERNAL_SERVER_ERROR = 500, t.NOT_IMPLEMENTED = 501, t.BAD_GATEWAY = 502, t.SERVICE_UNAVAILABLE = 503, t.GATEWAY_TIME_OUT = 504, t.HTTP_VERSION_NOT_SUPPORTED = 505, t.VARIANT_ALSO_NEGOTIATES = 506, t.INSUFFICIENT_STORAGE = 507, t.BANDWIDTH_LIMIT_EXCEEDED = 509, t.NOT_EXTENDED = 510, t.NETWORK_AUTHENTICATION_REQUIRED = 511;
709
+ },
710
+ 3957(e, t) {
711
+ var n, r, i, a, o, s, c, l, u, d;
712
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.ViewingHint = t.ViewingDirection = t.ServiceType = t.ServiceProfile = t.RenderingFormat = t.MediaType = t.IIIFResourceType = t.ExternalResourceType = t.Behavior = t.AnnotationMotivation = void 0, function(e) {
713
+ e.BOOKMARKING = "oa:bookmarking", e.CLASSIFYING = "oa:classifying", e.COMMENTING = "oa:commenting", e.DESCRIBING = "oa:describing", e.EDITING = "oa:editing", e.HIGHLIGHTING = "oa:highlighting", e.IDENTIFYING = "oa:identifying", e.LINKING = "oa:linking", e.MODERATING = "oa:moderating", e.PAINTING = "sc:painting", e.QUESTIONING = "oa:questioning", e.REPLYING = "oa:replying", e.TAGGING = "oa:tagging", e.TRANSCRIBING = "oad:transcribing";
714
+ }(n || (t.AnnotationMotivation = n = {})), function(e) {
715
+ e.AUTO_ADVANCE = "auto-advance", e.CONTINUOUS = "continuous", e.FACING_PAGES = "facing-pages", e.HIDDEN = "hidden", e.INDIVIDUALS = "individuals", e.MULTI_PART = "multi-part", e.NO_NAV = "no-nav", e.NON_PAGED = "non-paged", e.PAGED = "paged", e.REPEAT = "repeat", e.SEQUENCE = "sequence", e.THUMBNAIL_NAV = "thumbnail-nav", e.TOGETHER = "together", e.UNORDERED = "unordered";
716
+ }(r || (t.Behavior = r = {})), function(e) {
717
+ e.CANVAS = "canvas", e.CHOICE = "choice", e.OA_CHOICE = "oa:choice", e.CONTENT_AS_TEXT = "contentastext", e.DATASET = "dataset", e.DOCUMENT = "document", e.IMAGE = "image", e.MODEL = "model", e.MOVING_IMAGE = "movingimage", e.PDF = "pdf", e.PHYSICAL_OBJECT = "physicalobject", e.SOUND = "sound", e.TEXT = "text", e.TEXTUALBODY = "textualbody", e.VIDEO = "video";
718
+ }(i || (t.ExternalResourceType = i = {})), function(e) {
719
+ e.ANNOTATION = "annotation", e.CANVAS = "canvas", e.COLLECTION = "collection", e.MANIFEST = "manifest", e.RANGE = "range", e.SEQUENCE = "sequence";
720
+ }(a || (t.IIIFResourceType = a = {})), function(e) {
721
+ e.AUDIO_MP4 = "audio/mp4", e.CORTO = "application/corto", e.DICOM = "application/dicom", e.DRACO = "application/draco", e.EPUB = "application/epub+zip", e.GIRDER = "image/vnd.kitware.girder", e.GLB = "model/gltf-binary", e.GLTF = "model/gltf+json", e.IIIF_PRESENTATION_2 = "application/ld+json;profile=\"http://iiif.io/api/presentation/2/context.json\"", e.IIIF_PRESENTATION_3 = "application/ld+json;profile=\"http://iiif.io/api/presentation/3/context.json\"", e.JPG = "image/jpeg", e.M3U8 = "application/vnd.apple.mpegurl", e.MP3 = "audio/mp3", e.MPEG = "audio/mpeg", e.MPEG_DASH = "application/dash+xml", e.OBJ = "model/obj", e.OPF = "application/oebps-package+xml", e.PDF = "application/pdf", e.PLY = "application/ply", e.THREEJS = "application/vnd.threejs+json", e.USDZ = "model/vnd.usd+zip", e.VIDEO_MP4 = "video/mp4", e.WAV = "audio/wav", e.WEBM = "video/webm";
722
+ }(o || (t.MediaType = o = {})), function(e) {
723
+ e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.ODT = "application/vnd.oasis.opendocument.text", e.PDF = "application/pdf";
724
+ }(s || (t.RenderingFormat = s = {})), function(e) {
725
+ e.IMAGE_0_COMPLIANCE_LEVEL_0 = "http://library.stanford.edu/iiif/image-api/compliance.html#level0", e.IMAGE_0_COMPLIANCE_LEVEL_1 = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", e.IMAGE_0_COMPLIANCE_LEVEL_2 = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", e.IMAGE_0_CONFORMANCE_LEVEL_0 = "http://library.stanford.edu/iiif/image-api/conformance.html#level0", e.IMAGE_0_CONFORMANCE_LEVEL_1 = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", e.IMAGE_0_CONFORMANCE_LEVEL_2 = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", e.IMAGE_1_COMPLIANCE_LEVEL_0 = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", e.IMAGE_1_COMPLIANCE_LEVEL_1 = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", e.IMAGE_1_COMPLIANCE_LEVEL_2 = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", e.IMAGE_1_CONFORMANCE_LEVEL_0 = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", e.IMAGE_1_CONFORMANCE_LEVEL_1 = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", e.IMAGE_1_CONFORMANCE_LEVEL_2 = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", e.IMAGE_1_LEVEL_0 = "http://iiif.io/api/image/1/level0.json", e.IMAGE_1_PROFILE_LEVEL_0 = "http://iiif.io/api/image/1/profiles/level0.json", e.IMAGE_1_LEVEL_1 = "http://iiif.io/api/image/1/level1.json", e.IMAGE_1_PROFILE_LEVEL_1 = "http://iiif.io/api/image/1/profiles/level1.json", e.IMAGE_1_LEVEL_2 = "http://iiif.io/api/image/1/level2.json", e.IMAGE_1_PROFILE_LEVEL_2 = "http://iiif.io/api/image/1/profiles/level2.json", e.IMAGE_2_LEVEL_0 = "http://iiif.io/api/image/2/level0.json", e.IMAGE_2_PROFILE_LEVEL_0 = "http://iiif.io/api/image/2/profiles/level0.json", e.IMAGE_2_LEVEL_1 = "http://iiif.io/api/image/2/level1.json", e.IMAGE_2_PROFILE_LEVEL_1 = "http://iiif.io/api/image/2/profiles/level1.json", e.IMAGE_2_LEVEL_2 = "http://iiif.io/api/image/2/level2.json", e.IMAGE_2_PROFILE_LEVEL_2 = "http://iiif.io/api/image/2/profiles/level2.json", e.AUTH_0_CLICK_THROUGH = "http://iiif.io/api/auth/0/login/clickthrough", e.AUTH_0_LOGIN = "http://iiif.io/api/auth/0/login", e.AUTH_0_LOGOUT = "http://iiif.io/api/auth/0/logout", e.AUTH_0_RESTRICTED = "http://iiif.io/api/auth/0/login/restricted", e.AUTH_0_TOKEN = "http://iiif.io/api/auth/0/token", e.AUTH_1_CLICK_THROUGH = "http://iiif.io/api/auth/1/clickthrough", e.AUTH_1_EXTERNAL = "http://iiif.io/api/auth/1/external", e.AUTH_1_KIOSK = "http://iiif.io/api/auth/1/kiosk", e.AUTH_1_LOGIN = "http://iiif.io/api/auth/1/login", e.AUTH_1_LOGOUT = "http://iiif.io/api/auth/1/logout", e.AUTH_1_PROBE = "http://iiif.io/api/auth/1/probe", e.AUTH_1_TOKEN = "http://iiif.io/api/auth/1/token", e.SEARCH_0 = "http://iiif.io/api/search/0/search", e.SEARCH_0_AUTO_COMPLETE = "http://iiif.io/api/search/0/autocomplete", e.SEARCH_1 = "http://iiif.io/api/search/1/search", e.SEARCH_1_AUTO_COMPLETE = "http://iiif.io/api/search/1/autocomplete", e.TRACKING_EXTENSIONS = "http://universalviewer.io/tracking-extensions-profile", e.UI_EXTENSIONS = "http://universalviewer.io/ui-extensions-profile", e.PRINT_EXTENSIONS = "http://universalviewer.io/print-extensions-profile", e.SHARE_EXTENSIONS = "http://universalviewer.io/share-extensions-profile", e.DOWNLOAD_EXTENSIONS = "http://universalviewer.io/download-extensions-profile", e.OTHER_MANIFESTATIONS = "http://iiif.io/api/otherManifestations.json", e.IXIF = "http://wellcomelibrary.org/ld/ixif/0/alpha.json";
726
+ }(c || (t.ServiceProfile = c = {})), function(e) {
727
+ e.IMAGE_SERVICE_2 = "ImageService2", e.IMAGE_SERVICE_3 = "ImageService3";
728
+ }(l || (t.ServiceType = l = {})), function(e) {
729
+ e.BOTTOM_TO_TOP = "bottom-to-top", e.LEFT_TO_RIGHT = "left-to-right", e.RIGHT_TO_LEFT = "right-to-left", e.TOP_TO_BOTTOM = "top-to-bottom";
730
+ }(u || (t.ViewingDirection = u = {})), function(e) {
731
+ e.CONTINUOUS = "continuous", e.INDIVIDUALS = "individuals", e.NON_PAGED = "non-paged", e.PAGED = "paged", e.TOP = "top";
732
+ }(d || (t.ViewingHint = d = {}));
733
+ },
734
+ 916(e, t, n) {
735
+ e.exports = self.fetch || (self.fetch = n(6782).default || n(6782));
736
+ },
737
+ 1873(e, t, n) {
738
+ e.exports = n(9325).Symbol;
739
+ },
740
+ 4528(e) {
741
+ e.exports = function(e, t) {
742
+ for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
743
+ return e;
744
+ };
745
+ },
746
+ 3120(e, t, n) {
747
+ var r = n(4528), i = n(5891);
748
+ e.exports = function e(t, n, a, o, s) {
749
+ var c = -1, l = t.length;
750
+ for (a ||= i, s ||= []; ++c < l;) {
751
+ var u = t[c];
752
+ n > 0 && a(u) ? n > 1 ? e(u, n - 1, a, o, s) : r(s, u) : o || (s[s.length] = u);
753
+ }
754
+ return s;
755
+ };
756
+ },
757
+ 2552(e, t, n) {
758
+ var r = n(1873), i = n(659), a = n(9350), o = r ? r.toStringTag : void 0;
759
+ e.exports = function(e) {
760
+ return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : o && o in Object(e) ? i(e) : a(e);
761
+ };
762
+ },
763
+ 7534(e, t, n) {
764
+ var r = n(2552), i = n(346);
765
+ e.exports = function(e) {
766
+ return i(e) && r(e) == "[object Arguments]";
767
+ };
768
+ },
769
+ 4840(e, t, n) {
770
+ e.exports = typeof n.g == "object" && n.g && n.g.Object === Object && n.g;
771
+ },
772
+ 659(e, t, n) {
773
+ var r = n(1873), i = Object.prototype, a = i.hasOwnProperty, o = i.toString, s = r ? r.toStringTag : void 0;
774
+ e.exports = function(e) {
775
+ var t = a.call(e, s), n = e[s];
776
+ try {
777
+ e[s] = void 0;
778
+ var r = !0;
779
+ } catch {}
780
+ var i = o.call(e);
781
+ return r && (t ? e[s] = n : delete e[s]), i;
782
+ };
783
+ },
784
+ 5891(e, t, n) {
785
+ var r = n(1873), i = n(2428), a = n(6449), o = r ? r.isConcatSpreadable : void 0;
786
+ e.exports = function(e) {
787
+ return a(e) || i(e) || !!(o && e && e[o]);
788
+ };
789
+ },
790
+ 9350(e) {
791
+ var t = Object.prototype.toString;
792
+ e.exports = function(e) {
793
+ return t.call(e);
794
+ };
795
+ },
796
+ 9325(e, t, n) {
797
+ var r = n(4840), i = typeof self == "object" && self && self.Object === Object && self;
798
+ e.exports = r || i || Function("return this")();
799
+ },
800
+ 5970(e, t, n) {
801
+ var r = n(3120);
802
+ e.exports = function(e) {
803
+ return e != null && e.length ? r(e, 1) : [];
804
+ };
805
+ },
806
+ 3176(e, t, n) {
807
+ var r = n(3120), i = 1 / 0;
808
+ e.exports = function(e) {
809
+ return e != null && e.length ? r(e, i) : [];
810
+ };
811
+ },
812
+ 2428(e, t, n) {
813
+ var r = n(7534), i = n(346), a = Object.prototype, o = a.hasOwnProperty, s = a.propertyIsEnumerable;
814
+ e.exports = r(function() {
815
+ return arguments;
816
+ }()) ? r : function(e) {
817
+ return i(e) && o.call(e, "callee") && !s.call(e, "callee");
818
+ };
819
+ },
820
+ 6449(e) {
821
+ e.exports = Array.isArray;
822
+ },
823
+ 346(e) {
824
+ e.exports = function(e) {
825
+ return typeof e == "object" && !!e;
826
+ };
827
+ },
828
+ 3039(e, t, n) {
829
+ var r, i = this && this.__extends || (r = function(e, t) {
830
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
831
+ e.__proto__ = t;
832
+ } || function(e, t) {
833
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
834
+ }, r(e, t);
835
+ }, function(e, t) {
836
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
837
+ function n() {
838
+ this.constructor = e;
839
+ }
840
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
841
+ });
842
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Annotation = void 0;
843
+ var a = n(4799);
844
+ t.Annotation = function(e) {
845
+ function t(t, n) {
846
+ return e.call(this, t, n) || this;
847
+ }
848
+ return i(t, e), t.prototype.getBody = function() {
849
+ var e = [], t = this.getProperty("body");
850
+ if (t) {
851
+ if (Array.isArray(t)) for (var n = 0; n < t.length; n++) if ((o = t[n]).items) for (var r = 0; r < o.items.length; r++) {
852
+ var i = o.items[r];
853
+ e.push(new a.AnnotationBody(i, this.options));
854
+ }
855
+ else e.push(new a.AnnotationBody(o, this.options));
856
+ else if (t.items) for (n = 0; n < t.items.length; n++) {
857
+ var o = t.items[n];
858
+ e.push(new a.AnnotationBody(o, this.options));
859
+ }
860
+ else e.push(new a.AnnotationBody(t, this.options));
861
+ }
862
+ return e;
863
+ }, t.prototype.getMotivation = function() {
864
+ return this.getProperty("motivation") || null;
865
+ }, t.prototype.getOn = function() {
866
+ return this.getProperty("on");
867
+ }, t.prototype.getTarget = function() {
868
+ return this.getProperty("target");
869
+ }, t.prototype.getResource = function() {
870
+ return new a.Resource(this.getProperty("resource"), this.options);
871
+ }, t;
872
+ }(a.ManifestResource);
873
+ },
874
+ 2339(e, t, n) {
875
+ var r, i = this && this.__extends || (r = function(e, t) {
876
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
877
+ e.__proto__ = t;
878
+ } || function(e, t) {
879
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
880
+ }, r(e, t);
881
+ }, function(e, t) {
882
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
883
+ function n() {
884
+ this.constructor = e;
885
+ }
886
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
887
+ });
888
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.AnnotationBody = void 0;
889
+ var a = n(4799);
890
+ t.AnnotationBody = function(e) {
891
+ function t(t, n) {
892
+ return e.call(this, t, n) || this;
893
+ }
894
+ return i(t, e), t.prototype.getFormat = function() {
895
+ var e = this.getProperty("format");
896
+ return e ? a.Utils.getMediaType(e) : null;
897
+ }, t.prototype.getType = function() {
898
+ return this.getProperty("type") ? a.Utils.normaliseType(this.getProperty("type")) : null;
899
+ }, t.prototype.getValue = function() {
900
+ return this.getProperty("value");
901
+ }, t.prototype.getLanguage = function() {
902
+ return this.getProperty("language");
903
+ }, t.prototype.getWidth = function() {
904
+ return this.getProperty("width");
905
+ }, t.prototype.getHeight = function() {
906
+ return this.getProperty("height");
907
+ }, t;
908
+ }(a.ManifestResource);
909
+ },
910
+ 3435(e, t, n) {
911
+ var r, i = this && this.__extends || (r = function(e, t) {
912
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
913
+ e.__proto__ = t;
914
+ } || function(e, t) {
915
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
916
+ }, r(e, t);
917
+ }, function(e, t) {
918
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
919
+ function n() {
920
+ this.constructor = e;
921
+ }
922
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
923
+ });
924
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.AnnotationList = void 0;
925
+ var a = n(4799);
926
+ t.AnnotationList = function(e) {
927
+ function t(t, n, r) {
928
+ var i = e.call(this, n) || this;
929
+ return i.label = t, i.options = r, i;
930
+ }
931
+ return i(t, e), t.prototype.getIIIFResourceType = function() {
932
+ return a.Utils.normaliseType(this.getProperty("type"));
933
+ }, t.prototype.getLabel = function() {
934
+ return this.label;
935
+ }, t.prototype.getResources = function() {
936
+ var e = this;
937
+ return this.getProperty("resources").map(function(t) {
938
+ return new a.Annotation(t, e.options);
939
+ });
940
+ }, t.prototype.load = function() {
941
+ var e = this;
942
+ return new Promise(function(t, n) {
943
+ if (e.isLoaded) t(e);
944
+ else {
945
+ var r = e.__jsonld.id;
946
+ r ||= e.__jsonld["@id"], a.Utils.loadManifest(r).then(function(n) {
947
+ e.__jsonld = n, e.context = e.getProperty("context"), e.id = e.getProperty("id"), e.isLoaded = !0, t(e);
948
+ }).catch(n);
949
+ }
950
+ });
951
+ }, t;
952
+ }(a.JSONLDResource);
953
+ },
954
+ 3556(e, t, n) {
955
+ var r, i = this && this.__extends || (r = function(e, t) {
956
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
957
+ e.__proto__ = t;
958
+ } || function(e, t) {
959
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
960
+ }, r(e, t);
961
+ }, function(e, t) {
962
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
963
+ function n() {
964
+ this.constructor = e;
965
+ }
966
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
967
+ });
968
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.AnnotationPage = void 0;
969
+ var a = n(4799);
970
+ t.AnnotationPage = function(e) {
971
+ function t(t, n) {
972
+ return e.call(this, t, n) || this;
973
+ }
974
+ return i(t, e), t.prototype.getItems = function() {
975
+ return this.getProperty("items");
976
+ }, t.prototype.getAnnotations = function() {
977
+ var e = [], t = this.getProperty("items");
978
+ if (!t || !Array.isArray(t)) return e;
979
+ for (var n = 0; n < t.length; n++) {
980
+ var r = new a.Annotation(t[n], this.options);
981
+ e.push(r);
982
+ }
983
+ return e;
984
+ }, t;
985
+ }(a.ManifestResource);
986
+ },
987
+ 8098(e, t, n) {
988
+ var r, i = this && this.__extends || (r = function(e, t) {
989
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
990
+ e.__proto__ = t;
991
+ } || function(e, t) {
992
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
993
+ }, r(e, t);
994
+ }, function(e, t) {
995
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
996
+ function n() {
997
+ this.constructor = e;
998
+ }
999
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1000
+ }), a = this && this.__importDefault || function(e) {
1001
+ return e && e.__esModule ? e : { default: e };
1002
+ };
1003
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Canvas = void 0;
1004
+ var o = n(3957), s = n(4799), c = a(n(5970)), l = a(n(3176));
1005
+ t.Canvas = function(e) {
1006
+ function t(t, n) {
1007
+ return e.call(this, t, n) || this;
1008
+ }
1009
+ return i(t, e), t.prototype.getCanonicalImageUri = function(e) {
1010
+ var t = null, n = "default", r = e, i = r + ",";
1011
+ if (this.externalResource && this.externalResource.data && this.externalResource.data["@id"]) t = this.externalResource.data["@id"], r ||= this.externalResource.data.width, this.externalResource.data["@context"] && (this.externalResource.data["@context"].indexOf("/1.0/context.json") > -1 || this.externalResource.data["@context"].indexOf("/1.1/context.json") > -1 || this.externalResource.data["@context"].indexOf("/1/context.json") > -1) && (n = "native");
1012
+ else {
1013
+ var a = void 0;
1014
+ if ((a = this.getImages()) && a.length) {
1015
+ var o = a[0].getResource(), c = o.getServices();
1016
+ if (r ||= o.getWidth(), l = c ? c.find(function(e) {
1017
+ return s.Utils.isImageProfile(e.getProfile()) || s.Utils.isImageServiceType(e.getIIIFResourceType());
1018
+ }) : null) t = l.id, n = s.Utils.getImageQuality(l.getProfile());
1019
+ else if (r === o.getWidth()) return o.id;
1020
+ }
1021
+ if ((a = this.getContent()) && a.length) {
1022
+ var l, u = a[0].getBody()[0];
1023
+ if (c = u.getServices(), r ||= u.getWidth(), l = c ? c.find(function(e) {
1024
+ return s.Utils.isImageServiceType(e.getIIIFResourceType());
1025
+ }) : null) t = l.id, n = s.Utils.getImageQuality(l.getProfile());
1026
+ else if (r === u.getWidth()) return u.id;
1027
+ }
1028
+ if (!t) {
1029
+ var d = this.getProperty("thumbnail");
1030
+ if (d) {
1031
+ if (typeof d == "string") return d;
1032
+ if (d["@id"]) return d["@id"];
1033
+ if (d.length) return d[0].id;
1034
+ }
1035
+ }
1036
+ }
1037
+ return t && t.endsWith("/") && (t = t.substr(0, t.length - 1)), [
1038
+ t,
1039
+ "full",
1040
+ i,
1041
+ 0,
1042
+ n + ".jpg"
1043
+ ].join("/");
1044
+ }, t.prototype.getMaxDimensions = function() {
1045
+ var e, t = null;
1046
+ return this.externalResource && this.externalResource.data && this.externalResource.data.profile && (e = this.externalResource.data.profile, Array.isArray(e) && (e = e.filter(function(e) {
1047
+ return e.maxWidth ?? e.maxwidth;
1048
+ })[0]) && (t = new s.Size(e.maxWidth, e.maxHeight ? e.maxHeight : e.maxWidth))), this.externalResource && this.externalResource.data && this.externalResource.data.maxWidth && (t = new s.Size(this.externalResource.data.maxWidth, this.externalResource.data.maxHeight ? this.externalResource.data.maxHeight : this.externalResource.data.maxWidth)), t;
1049
+ }, t.prototype.getContent = function() {
1050
+ var e = [], t = this.__jsonld.items || this.__jsonld.content;
1051
+ if (!t) return e;
1052
+ var n = null;
1053
+ if (t.length && (n = new s.AnnotationPage(t[0], this.options)), !n) return e;
1054
+ for (var r = n.getAnnotations(), i = 0; i < r.length; i++) {
1055
+ var a = r[i];
1056
+ e.push(a);
1057
+ }
1058
+ return e;
1059
+ }, t.prototype.getAnnotations = function() {
1060
+ var e = [], t = this.__jsonld.annotations;
1061
+ if (!t || !Array.isArray(t)) return e;
1062
+ for (var n = 0; n < t.length; n++) {
1063
+ var r = new s.AnnotationPage(t[n], this.options);
1064
+ e.push(r);
1065
+ }
1066
+ return e;
1067
+ }, t.prototype.getDuration = function() {
1068
+ return this.getProperty("duration");
1069
+ }, t.prototype.getImages = function() {
1070
+ var e = [];
1071
+ if (!this.__jsonld.images) return e;
1072
+ for (var t = 0; t < this.__jsonld.images.length; t++) {
1073
+ var n = this.__jsonld.images[t], r = new s.Annotation(n, this.options);
1074
+ e.push(r);
1075
+ }
1076
+ return e;
1077
+ }, t.prototype.getIndex = function() {
1078
+ return this.getProperty("index");
1079
+ }, t.prototype.getOtherContent = function() {
1080
+ var e = this, t = (Array.isArray(this.getProperty("otherContent")) ? this.getProperty("otherContent") : [this.getProperty("otherContent")]).filter(function(e) {
1081
+ return e && typeof (t = e["@type"]) == "string" && t.toLowerCase() == t.toLowerCase();
1082
+ var t;
1083
+ }).map(function(t, n) {
1084
+ return new s.AnnotationList(t.label || `Annotation list ${n}`, t, e.options);
1085
+ }).map(function(e) {
1086
+ return e.load();
1087
+ });
1088
+ return Promise.all(t);
1089
+ }, t.prototype.getWidth = function() {
1090
+ return this.getProperty("width");
1091
+ }, t.prototype.getHeight = function() {
1092
+ return this.getProperty("height");
1093
+ }, t.prototype.getViewingHint = function() {
1094
+ var e = this.getProperty("viewingHint");
1095
+ return Array.isArray(e) && (e = e[0]), e || null;
1096
+ }, Object.defineProperty(t.prototype, "imageResources", {
1097
+ get: function() {
1098
+ var e = this, n = (0, l.default)([this.getImages().map(function(e) {
1099
+ return e.getResource();
1100
+ }), this.getContent().map(function(e) {
1101
+ return e.getBody();
1102
+ })]);
1103
+ return (0, c.default)(n.map(function(n) {
1104
+ switch (n.getProperty("type").toLowerCase()) {
1105
+ case o.ExternalResourceType.CHOICE:
1106
+ case o.ExternalResourceType.OA_CHOICE: return new t({ images: (0, c.default)([n.getProperty("default"), n.getProperty("item")]).map(function(e) {
1107
+ return { resource: e };
1108
+ }) }, e.options).getImages().map(function(e) {
1109
+ return e.getResource();
1110
+ });
1111
+ default: return n;
1112
+ }
1113
+ }));
1114
+ },
1115
+ enumerable: !1,
1116
+ configurable: !0
1117
+ }), Object.defineProperty(t.prototype, "resourceAnnotations", {
1118
+ get: function() {
1119
+ return (0, l.default)([this.getImages(), this.getContent()]);
1120
+ },
1121
+ enumerable: !1,
1122
+ configurable: !0
1123
+ }), t.prototype.resourceAnnotation = function(e) {
1124
+ return this.resourceAnnotations.find(function(t) {
1125
+ return t.getResource().id === e || (0, c.default)(Array(t.getBody())).some(function(t) {
1126
+ return t.id === e;
1127
+ });
1128
+ });
1129
+ }, t.prototype.onFragment = function(e) {
1130
+ var t = this.resourceAnnotation(e);
1131
+ if (t) {
1132
+ var n = t.getProperty("on"), r = t.getProperty("target");
1133
+ if (n && r) {
1134
+ var i = (n || r).match(/xywh=(.*)$/);
1135
+ if (i) return i[1].split(",").map(function(e) {
1136
+ return parseInt(e, 10);
1137
+ });
1138
+ }
1139
+ }
1140
+ }, Object.defineProperty(t.prototype, "iiifImageResources", {
1141
+ get: function() {
1142
+ return this.imageResources.filter(function(e) {
1143
+ return e && e.getServices()[0] && e.getServices()[0].id;
1144
+ });
1145
+ },
1146
+ enumerable: !1,
1147
+ configurable: !0
1148
+ }), Object.defineProperty(t.prototype, "imageServiceIds", {
1149
+ get: function() {
1150
+ return this.iiifImageResources.map(function(e) {
1151
+ return e.getServices()[0].id;
1152
+ });
1153
+ },
1154
+ enumerable: !1,
1155
+ configurable: !0
1156
+ }), Object.defineProperty(t.prototype, "aspectRatio", {
1157
+ get: function() {
1158
+ return this.getWidth() / this.getHeight();
1159
+ },
1160
+ enumerable: !1,
1161
+ configurable: !0
1162
+ }), t.prototype.getChoices = function() {
1163
+ for (var e = this, t = 0, n = this.getContent(); t < n.length; t++) {
1164
+ var r = n[t].getProperty("body");
1165
+ if (r && r.type?.toLowerCase() === o.ExternalResourceType.CHOICE && r.items && r.items.length) return r.items.map(function(t) {
1166
+ return new s.AnnotationBody(t, e.options);
1167
+ });
1168
+ }
1169
+ return [];
1170
+ }, t;
1171
+ }(s.Resource);
1172
+ },
1173
+ 8214(e, t, n) {
1174
+ var r, i = this && this.__extends || (r = function(e, t) {
1175
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1176
+ e.__proto__ = t;
1177
+ } || function(e, t) {
1178
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1179
+ }, r(e, t);
1180
+ }, function(e, t) {
1181
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1182
+ function n() {
1183
+ this.constructor = e;
1184
+ }
1185
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1186
+ });
1187
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Collection = void 0;
1188
+ var a = n(3957), o = n(4799);
1189
+ t.Collection = function(e) {
1190
+ function t(t, n) {
1191
+ var r = e.call(this, t, n) || this;
1192
+ return r.items = [], r._collections = null, r._manifests = null, t.__collection = r, r;
1193
+ }
1194
+ return i(t, e), t.prototype.getCollections = function() {
1195
+ return this._collections ? this._collections : this._collections = this.items.filter(function(e) {
1196
+ return e.isCollection();
1197
+ });
1198
+ }, t.prototype.getManifests = function() {
1199
+ return this._manifests ? this._manifests : this._manifests = this.items.filter(function(e) {
1200
+ return e.isManifest();
1201
+ });
1202
+ }, t.prototype.getCollectionByIndex = function(e) {
1203
+ for (var t, n = this.getCollections(), r = 0; r < n.length; r++) {
1204
+ var i = n[r];
1205
+ i.index === e && (t = i);
1206
+ }
1207
+ if (t) return t.options.index = e, t.load();
1208
+ throw Error("Collection index not found");
1209
+ }, t.prototype.getManifestByIndex = function(e) {
1210
+ for (var t, n = this.getManifests(), r = 0; r < n.length; r++) {
1211
+ var i = n[r];
1212
+ i.index === e && (t = i);
1213
+ }
1214
+ if (t) return t.options.index = e, t.load();
1215
+ throw Error("Manifest index not found");
1216
+ }, t.prototype.getTotalCollections = function() {
1217
+ return this.getCollections().length;
1218
+ }, t.prototype.getTotalManifests = function() {
1219
+ return this.getManifests().length;
1220
+ }, t.prototype.getTotalItems = function() {
1221
+ return this.items.length;
1222
+ }, t.prototype.getViewingDirection = function() {
1223
+ return this.getProperty("viewingDirection") ? this.getProperty("viewingDirection") : a.ViewingDirection.LEFT_TO_RIGHT;
1224
+ }, t.prototype.getBehavior = function() {
1225
+ var e = this.getProperty("behavior");
1226
+ return Array.isArray(e) && (e = e[0]), e || null;
1227
+ }, t.prototype.getViewingHint = function() {
1228
+ var e = this.getProperty("viewingHint");
1229
+ return Array.isArray(e) && (e = e[0]), e || null;
1230
+ }, t.prototype.getDefaultTree = function() {
1231
+ return e.prototype.getDefaultTree.call(this), this.defaultTree.data.type = o.Utils.normaliseType(o.TreeNodeType.COLLECTION), this._parseManifests(this), this._parseCollections(this), o.Utils.generateTreeNodeIds(this.defaultTree), this.defaultTree;
1232
+ }, t.prototype._parseManifests = function(e) {
1233
+ if (e.getManifests() && e.getManifests().length) for (var t = 0; t < e.getManifests().length; t++) {
1234
+ var n = e.getManifests()[t], r = n.getDefaultTree();
1235
+ r.label = n.parentLabel || n.getLabel().getValue(this.options.locale) || "manifest " + (t + 1), r.navDate = n.getNavDate(), r.data.id = n.id, r.data.type = o.Utils.normaliseType(o.TreeNodeType.MANIFEST), e.defaultTree.addNode(r);
1236
+ }
1237
+ }, t.prototype._parseCollections = function(e) {
1238
+ if (e.getCollections() && e.getCollections().length) for (var t = 0; t < e.getCollections().length; t++) {
1239
+ var n = e.getCollections()[t], r = n.getDefaultTree();
1240
+ r.label = n.parentLabel || n.getLabel().getValue(this.options.locale) || "collection " + (t + 1), r.navDate = n.getNavDate(), r.data.id = n.id, r.data.type = o.Utils.normaliseType(o.TreeNodeType.COLLECTION), e.defaultTree.addNode(r);
1241
+ }
1242
+ }, t;
1243
+ }(o.IIIFResource);
1244
+ },
1245
+ 1858(e, t) {
1246
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Duration = void 0, t.Duration = function() {
1247
+ function e(e, t) {
1248
+ this.start = e, this.end = t;
1249
+ }
1250
+ return e.prototype.getLength = function() {
1251
+ return this.end - this.start;
1252
+ }, e;
1253
+ }();
1254
+ },
1255
+ 2712(e, t) {
1256
+ Object.defineProperty(t, "__esModule", { value: !0 });
1257
+ },
1258
+ 3167(e, t) {
1259
+ Object.defineProperty(t, "__esModule", { value: !0 });
1260
+ },
1261
+ 672(e, t) {
1262
+ Object.defineProperty(t, "__esModule", { value: !0 });
1263
+ },
1264
+ 7376(e, t) {
1265
+ Object.defineProperty(t, "__esModule", { value: !0 });
1266
+ },
1267
+ 2184(e, t) {
1268
+ Object.defineProperty(t, "__esModule", { value: !0 });
1269
+ },
1270
+ 107(e, t, n) {
1271
+ var r, i = this && this.__extends || (r = function(e, t) {
1272
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1273
+ e.__proto__ = t;
1274
+ } || function(e, t) {
1275
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1276
+ }, r(e, t);
1277
+ }, function(e, t) {
1278
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1279
+ function n() {
1280
+ this.constructor = e;
1281
+ }
1282
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1283
+ });
1284
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.IIIFResource = void 0;
1285
+ var a = n(4799), o = n(3957);
1286
+ t.IIIFResource = function(e) {
1287
+ function t(t, n) {
1288
+ var r = e.call(this, t, n) || this;
1289
+ return r.index = -1, r.isLoaded = !1, r.options = Object.assign({
1290
+ defaultLabel: "-",
1291
+ locale: "en-GB",
1292
+ resource: r,
1293
+ pessimisticAccessControl: !1
1294
+ }, n), r;
1295
+ }
1296
+ return i(t, e), t.prototype.getAttribution = function() {
1297
+ var e = this.getProperty("attribution");
1298
+ return e ? a.PropertyValue.parse(e, this.options.locale) : new a.PropertyValue([], this.options.locale);
1299
+ }, t.prototype.getDescription = function() {
1300
+ var e = this.getProperty("description");
1301
+ return e === void 0 && (e = this.getProperty("summary")), e ? a.PropertyValue.parse(e, this.options.locale) : new a.PropertyValue([], this.options.locale);
1302
+ }, t.prototype.getSummary = function() {
1303
+ var e = this.getProperty("summary");
1304
+ return e === void 0 && (e = this.getProperty("description")), e ? a.PropertyValue.parse(e, this.options.locale) : new a.PropertyValue([], this.options.locale);
1305
+ }, t.prototype.getHomepage = function() {
1306
+ var e = this.getProperty("homepage");
1307
+ return e ? typeof e == "string" ? e : (Array.isArray(e) && e.length && (e = e[0]), e["@id"] || e.id) : null;
1308
+ }, t.prototype.getIIIFResourceType = function() {
1309
+ return a.Utils.normaliseType(this.getProperty("type"));
1310
+ }, t.prototype.getLogo = function() {
1311
+ var e = this.getProperty("logo");
1312
+ if (!e) {
1313
+ var t = this.getProperty("provider");
1314
+ if (!t) return null;
1315
+ var n = t.find(function(e) {
1316
+ return e.logo !== void 0;
1317
+ });
1318
+ e = n && n.logo !== void 0 ? n.logo : null;
1319
+ }
1320
+ return e ? typeof e == "string" ? e : (Array.isArray(e) && e.length && (e = e[0]), e["@id"] || e?.id) : null;
1321
+ }, t.prototype.getLicense = function() {
1322
+ return a.Utils.getLocalisedValue(this.getProperty("license"), this.options.locale);
1323
+ }, t.prototype.getRights = function() {
1324
+ var e = this.getProperty("rights");
1325
+ return e ? typeof e == "string" ? e : (Array.isArray(e) && e.length && (e = e[0]), e["@id"] || e.id) : null;
1326
+ }, t.prototype.getNavDate = function() {
1327
+ return new Date(this.getProperty("navDate"));
1328
+ }, t.prototype.getRelated = function() {
1329
+ return this.getProperty("related");
1330
+ }, t.prototype.getSeeAlso = function() {
1331
+ return this.getProperty("seeAlso");
1332
+ }, t.prototype.getTrackingLabel = function() {
1333
+ var e = this.getService(o.ServiceProfile.TRACKING_EXTENSIONS);
1334
+ return e ? e.getProperty("trackingLabel") : "";
1335
+ }, t.prototype.getDefaultTree = function() {
1336
+ return this.defaultTree = new a.TreeNode("root"), this.defaultTree.data = this, this.defaultTree;
1337
+ }, t.prototype.getRequiredStatement = function() {
1338
+ var e = null, t = this.getProperty("requiredStatement");
1339
+ if (t) (e = new a.LabelValuePair(this.options.locale)).parse(t);
1340
+ else {
1341
+ var n = this.getAttribution();
1342
+ n && n.length && ((e = new a.LabelValuePair(this.options.locale)).value = n);
1343
+ }
1344
+ return e;
1345
+ }, t.prototype.isCollection = function() {
1346
+ return this.getIIIFResourceType() === o.IIIFResourceType.COLLECTION;
1347
+ }, t.prototype.isManifest = function() {
1348
+ return this.getIIIFResourceType() === o.IIIFResourceType.MANIFEST;
1349
+ }, t.prototype.load = function() {
1350
+ var e = this;
1351
+ return new Promise(function(t) {
1352
+ if (e.isLoaded) t(e);
1353
+ else {
1354
+ var n = e.options;
1355
+ n.navDate = e.getNavDate();
1356
+ var r = e.__jsonld.id;
1357
+ r ||= e.__jsonld["@id"], a.Utils.loadManifest(r).then(function(r) {
1358
+ e.parentLabel = e.getLabel().getValue(n.locale);
1359
+ var i = a.Deserialiser.parse(r, n);
1360
+ (e = Object.assign(e, i)).index = n.index, t(e);
1361
+ });
1362
+ }
1363
+ });
1364
+ }, t;
1365
+ }(a.ManifestResource);
1366
+ },
1367
+ 6739(e, t) {
1368
+ Object.defineProperty(t, "__esModule", { value: !0 });
1369
+ },
1370
+ 7436(e, t) {
1371
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.JSONLDResource = void 0, t.JSONLDResource = function() {
1372
+ function e(e) {
1373
+ this.__jsonld = e, this.context = this.getProperty("context"), this.id = this.getProperty("id");
1374
+ }
1375
+ return e.prototype.getProperty = function(e) {
1376
+ var t = null;
1377
+ return this.__jsonld && ((t = this.__jsonld[e]) || (t = this.__jsonld["@" + e])), t;
1378
+ }, e;
1379
+ }();
1380
+ },
1381
+ 2817(e, t, n) {
1382
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.LabelValuePair = void 0;
1383
+ var r = n(4799);
1384
+ t.LabelValuePair = function() {
1385
+ function e(e) {
1386
+ this.label = null, this.value = null, this.defaultLocale = e;
1387
+ }
1388
+ return e.prototype.parse = function(e) {
1389
+ this.resource = e, this.label = r.PropertyValue.parse(this.resource.label, this.defaultLocale), this.value = r.PropertyValue.parse(this.resource.value, this.defaultLocale);
1390
+ }, e.prototype.getLabel = function(e) {
1391
+ return this.label === null ? null : (Array.isArray(e) && !e.length && (e = void 0), this.label.getValue(e || this.defaultLocale));
1392
+ }, e.prototype.getLabels = function(e) {
1393
+ return this.label === null ? [] : (Array.isArray(e) && !e.length && (e = void 0), this.label.getValues(e || this.defaultLocale));
1394
+ }, e.prototype.setLabel = function(e) {
1395
+ this.label === null && (this.label = new r.PropertyValue([])), this.label.setValue(e, this.defaultLocale);
1396
+ }, e.prototype.getValue = function(e, t) {
1397
+ return t === void 0 && (t = "<br/>"), this.value === null ? null : (Array.isArray(e) && !e.length && (e = void 0), this.value.getValue(e || this.defaultLocale, t));
1398
+ }, e.prototype.getValues = function(e) {
1399
+ return this.value === null ? [] : (Array.isArray(e) && !e.length && (e = void 0), this.value.getValues(e || this.defaultLocale));
1400
+ }, e.prototype.setValue = function(e) {
1401
+ this.value === null && (this.value = new r.PropertyValue([])), this.value.setValue(e, this.defaultLocale);
1402
+ }, e;
1403
+ }();
1404
+ },
1405
+ 72(e, t) {
1406
+ Object.defineProperty(t, "__esModule", { value: !0 });
1407
+ },
1408
+ 212(e, t) {
1409
+ var n, r = this && this.__extends || (n = function(e, t) {
1410
+ return n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1411
+ e.__proto__ = t;
1412
+ } || function(e, t) {
1413
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1414
+ }, n(e, t);
1415
+ }, function(e, t) {
1416
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1417
+ function r() {
1418
+ this.constructor = e;
1419
+ }
1420
+ n(e, t), e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
1421
+ });
1422
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.LanguageMap = void 0, t.LanguageMap = function(e) {
1423
+ function t() {
1424
+ return e !== null && e.apply(this, arguments) || this;
1425
+ }
1426
+ return r(t, e), t.getValue = function(e, t) {
1427
+ return e.getValue(t, "<br/>");
1428
+ }, t.getValues = function(e, t) {
1429
+ return e.getValues(t);
1430
+ }, t;
1431
+ }(Array);
1432
+ },
1433
+ 4531(e, t, n) {
1434
+ var r, i = this && this.__extends || (r = function(e, t) {
1435
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1436
+ e.__proto__ = t;
1437
+ } || function(e, t) {
1438
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1439
+ }, r(e, t);
1440
+ }, function(e, t) {
1441
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1442
+ function n() {
1443
+ this.constructor = e;
1444
+ }
1445
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1446
+ });
1447
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Manifest = void 0;
1448
+ var a = n(3957), o = n(4799);
1449
+ t.Manifest = function(e) {
1450
+ function t(t, n) {
1451
+ var r = e.call(this, t, n) || this;
1452
+ if (r.index = 0, r._allRanges = null, r.items = [], r._topRanges = [], r.__jsonld.structures && r.__jsonld.structures.length) for (var i = r._getTopRanges(), a = 0; a < i.length; a++) {
1453
+ var o = i[a];
1454
+ r._parseRanges(o, String(a));
1455
+ }
1456
+ return r;
1457
+ }
1458
+ return i(t, e), t.prototype.getPosterCanvas = function() {
1459
+ var e = this.getProperty("posterCanvas");
1460
+ return e &&= new o.Canvas(e, this.options), e;
1461
+ }, t.prototype.getAccompanyingCanvas = function() {
1462
+ var e = this.getProperty("accompanyingCanvas");
1463
+ return e &&= new o.Canvas(e, this.options), e;
1464
+ }, t.prototype.getBehavior = function() {
1465
+ var e = this.getProperty("behavior");
1466
+ return Array.isArray(e) && (e = e[0]), e || null;
1467
+ }, t.prototype.getDefaultTree = function() {
1468
+ if (e.prototype.getDefaultTree.call(this), this.defaultTree.data.type = o.Utils.normaliseType(o.TreeNodeType.MANIFEST), !this.isLoaded) return this.defaultTree;
1469
+ var t = this.getTopRanges();
1470
+ return t.length && t[0].getTree(this.defaultTree), o.Utils.generateTreeNodeIds(this.defaultTree), this.defaultTree;
1471
+ }, t.prototype._getTopRanges = function() {
1472
+ var e = [];
1473
+ if (this.__jsonld.structures && this.__jsonld.structures.length) {
1474
+ for (var t = 0; t < this.__jsonld.structures.length; t++) {
1475
+ var n = this.__jsonld.structures[t];
1476
+ n.viewingHint === a.ViewingHint.TOP && e.push(n);
1477
+ }
1478
+ if (!e.length) {
1479
+ var r = {};
1480
+ r.ranges = this.__jsonld.structures, e.push(r);
1481
+ }
1482
+ }
1483
+ return e;
1484
+ }, t.prototype.getTopRanges = function() {
1485
+ return this._topRanges;
1486
+ }, t.prototype._getRangeById = function(e) {
1487
+ if (this.__jsonld.structures && this.__jsonld.structures.length) for (var t = 0; t < this.__jsonld.structures.length; t++) {
1488
+ var n = this.__jsonld.structures[t];
1489
+ if (n["@id"] === e || n.id === e) return n;
1490
+ }
1491
+ return null;
1492
+ }, t.prototype._parseRanges = function(e, t, n) {
1493
+ var r = null;
1494
+ if (typeof e == "string" && (r = e, e = this._getRangeById(r)), e) {
1495
+ var i = new o.Range(e, this.options);
1496
+ i.parentRange = n, i.path = t, n ? n.items.push(i) : this._topRanges.push(i);
1497
+ var a = e.items || e.members;
1498
+ if (a) for (var s = 0; s < a.length; s++) {
1499
+ var c = a[s];
1500
+ if (c["@type"] && c["@type"].toLowerCase() === "sc:range" || c.type && c.type.toLowerCase() === "range") this._parseRanges(c, t + "/" + s, i);
1501
+ else if (c["@type"] && c["@type"].toLowerCase() === "sc:canvas" || c.type && c.type.toLowerCase() === "canvas") {
1502
+ i.canvases ||= [];
1503
+ var l = c.id || c["@id"];
1504
+ i.canvases.push(l);
1505
+ }
1506
+ }
1507
+ else if (e.ranges) for (s = 0; s < e.ranges.length; s++) this._parseRanges(e.ranges[s], t + "/" + s, i);
1508
+ } else console.warn("Range:", r, "does not exist");
1509
+ }, t.prototype.getAllRanges = function() {
1510
+ if (this._allRanges != null) return this._allRanges;
1511
+ this._allRanges = [];
1512
+ for (var e = this.getTopRanges(), t = function(t) {
1513
+ var r = e[t];
1514
+ r.id && n._allRanges.push(r);
1515
+ var i = function(e, t) {
1516
+ e.add(t);
1517
+ var n = t.getRanges();
1518
+ return n.length ? n.reduce(i, e) : e;
1519
+ }, a = Array.from(r.getRanges().reduce(i, /* @__PURE__ */ new Set()));
1520
+ n._allRanges = n._allRanges.concat(a);
1521
+ }, n = this, r = 0; r < e.length; r++) t(r);
1522
+ return this._allRanges;
1523
+ }, t.prototype.getRangeById = function(e) {
1524
+ for (var t = this.getAllRanges(), n = 0; n < t.length; n++) {
1525
+ var r = t[n];
1526
+ if (r.id === e) return r;
1527
+ }
1528
+ return null;
1529
+ }, t.prototype.getRangeByPath = function(e) {
1530
+ for (var t = this.getAllRanges(), n = 0; n < t.length; n++) {
1531
+ var r = t[n];
1532
+ if (r.path === e) return r;
1533
+ }
1534
+ return null;
1535
+ }, t.prototype.getSequences = function() {
1536
+ if (this.items.length) return this.items;
1537
+ var e = this.__jsonld.mediaSequences || this.__jsonld.sequences;
1538
+ if (e) for (var t = 0; t < e.length; t++) {
1539
+ var n = e[t], r = new o.Sequence(n, this.options);
1540
+ this.items.push(r);
1541
+ }
1542
+ else this.__jsonld.items && (r = new o.Sequence(this.__jsonld.items, this.options), this.items.push(r));
1543
+ return this.items;
1544
+ }, t.prototype.getSequenceByIndex = function(e) {
1545
+ return this.getSequences()[e];
1546
+ }, t.prototype.getTotalSequences = function() {
1547
+ return this.getSequences().length;
1548
+ }, t.prototype.getManifestType = function() {
1549
+ var e = this.getService(a.ServiceProfile.UI_EXTENSIONS);
1550
+ return e ? e.getProperty("manifestType") : o.ManifestType.EMPTY;
1551
+ }, t.prototype.isMultiSequence = function() {
1552
+ return this.getTotalSequences() > 1;
1553
+ }, t.prototype.isPagingEnabled = function() {
1554
+ var e = this.getViewingHint();
1555
+ if (e) return e === a.ViewingHint.PAGED;
1556
+ var t = this.getBehavior();
1557
+ return !!t && t === a.Behavior.PAGED;
1558
+ }, t.prototype.getViewingDirection = function() {
1559
+ return this.getProperty("viewingDirection");
1560
+ }, t.prototype.getViewingHint = function() {
1561
+ var e = this.getProperty("viewingHint");
1562
+ return Array.isArray(e) && (e = e[0]), e || null;
1563
+ }, t;
1564
+ }(o.IIIFResource);
1565
+ },
1566
+ 2315(e, t, n) {
1567
+ var r, i = this && this.__extends || (r = function(e, t) {
1568
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1569
+ e.__proto__ = t;
1570
+ } || function(e, t) {
1571
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1572
+ }, r(e, t);
1573
+ }, function(e, t) {
1574
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1575
+ function n() {
1576
+ this.constructor = e;
1577
+ }
1578
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1579
+ });
1580
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.ManifestResource = void 0;
1581
+ var a = n(4799), o = n(3957);
1582
+ t.ManifestResource = function(e) {
1583
+ function t(t, n) {
1584
+ var r = e.call(this, t) || this;
1585
+ return r.options = n, r;
1586
+ }
1587
+ return i(t, e), t.prototype.getIIIFResourceType = function() {
1588
+ return a.Utils.normaliseType(this.getProperty("type"));
1589
+ }, t.prototype.getLabel = function() {
1590
+ var e = this.getProperty("label");
1591
+ return e ? a.PropertyValue.parse(e, this.options.locale) : new a.PropertyValue([], this.options.locale);
1592
+ }, t.prototype.getDefaultLabel = function() {
1593
+ return this.getLabel().getValue(this.options.locale);
1594
+ }, t.prototype.getMetadata = function() {
1595
+ var e = this.getProperty("metadata"), t = [];
1596
+ if (!e) return t;
1597
+ for (var n = 0; n < e.length; n++) {
1598
+ var r = e[n], i = new a.LabelValuePair(this.options.locale);
1599
+ i.parse(r), t.push(i);
1600
+ }
1601
+ return t;
1602
+ }, t.prototype.getRendering = function(e) {
1603
+ for (var t = this.getRenderings(), n = 0; n < t.length; n++) {
1604
+ var r = t[n];
1605
+ if (r.getFormat() === e) return r;
1606
+ }
1607
+ return null;
1608
+ }, t.prototype.getRenderings = function() {
1609
+ var e, t = [];
1610
+ if (!(e = this.__jsonld ? this.__jsonld.rendering : this.rendering)) return t;
1611
+ Array.isArray(e) || (e = [e]);
1612
+ for (var n = 0; n < e.length; n++) {
1613
+ var r = e[n];
1614
+ t.push(new a.Rendering(r, this.options));
1615
+ }
1616
+ return t;
1617
+ }, t.prototype.getRequiredStatement = function() {
1618
+ var e = null, t = this.getProperty("requiredStatement");
1619
+ return t && (e = new a.LabelValuePair(this.options.locale)).parse(t), e;
1620
+ }, t.prototype.getService = function(e) {
1621
+ return a.Utils.getService(this, e);
1622
+ }, t.prototype.getServices = function() {
1623
+ return a.Utils.getServices(this);
1624
+ }, t.prototype.getThumbnail = function() {
1625
+ var e = this.getProperty("thumbnail");
1626
+ return Array.isArray(e) && (e = e[0]), e ? new a.Thumbnail(e, this.options) : null;
1627
+ }, t.prototype.isAnnotation = function() {
1628
+ return this.getIIIFResourceType() === o.IIIFResourceType.ANNOTATION;
1629
+ }, t.prototype.isCanvas = function() {
1630
+ return this.getIIIFResourceType() === o.IIIFResourceType.CANVAS;
1631
+ }, t.prototype.isCollection = function() {
1632
+ return this.getIIIFResourceType() === o.IIIFResourceType.COLLECTION;
1633
+ }, t.prototype.isManifest = function() {
1634
+ return this.getIIIFResourceType() === o.IIIFResourceType.MANIFEST;
1635
+ }, t.prototype.isRange = function() {
1636
+ return this.getIIIFResourceType() === o.IIIFResourceType.RANGE;
1637
+ }, t.prototype.isSequence = function() {
1638
+ return this.getIIIFResourceType() === o.IIIFResourceType.SEQUENCE;
1639
+ }, t;
1640
+ }(a.JSONLDResource);
1641
+ },
1642
+ 3043(e, t) {
1643
+ var n;
1644
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.ManifestType = void 0, function(e) {
1645
+ e.EMPTY = "", e.MANUSCRIPT = "manuscript", e.MONOGRAPH = "monograph";
1646
+ }(n || (t.ManifestType = n = {}));
1647
+ },
1648
+ 2006(e, t, n) {
1649
+ var r, i = this && this.__extends || (r = function(e, t) {
1650
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1651
+ e.__proto__ = t;
1652
+ } || function(e, t) {
1653
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1654
+ }, r(e, t);
1655
+ }, function(e, t) {
1656
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1657
+ function n() {
1658
+ this.constructor = e;
1659
+ }
1660
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1661
+ });
1662
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.PropertyValue = t.LocalizedValue = void 0;
1663
+ var a = n(41), o = function() {
1664
+ function e(e, t, n) {
1665
+ n === void 0 && (n = "none"), this._value = Array.isArray(e) && e.length === 1 ? e[0] : e, t !== "none" && t !== "@none" || (t = void 0), this._locale = t, this._defaultLocale = n;
1666
+ }
1667
+ return e.parseV2Value = function(t, n) {
1668
+ return typeof t == "string" ? new e(t, void 0, n) : t["@value"] ? new e(t["@value"], t["@language"], n) : null;
1669
+ }, Object.defineProperty(e.prototype, "value", {
1670
+ get: function() {
1671
+ return Array.isArray(this._value) ? this._value.join("<br/>") : this._value;
1672
+ },
1673
+ enumerable: !1,
1674
+ configurable: !0
1675
+ }), Object.defineProperty(e.prototype, "locale", {
1676
+ get: function() {
1677
+ return this._locale === void 0 ? this._defaultLocale : this._locale;
1678
+ },
1679
+ enumerable: !1,
1680
+ configurable: !0
1681
+ }), e.prototype.addValue = function(e) {
1682
+ Array.isArray(this._value) || (this._value = [this._value]), Array.isArray(e) ? this._value = this._value.concat(e) : this._value.push(e);
1683
+ }, e;
1684
+ }();
1685
+ t.LocalizedValue = o, t.PropertyValue = function(e) {
1686
+ function t(n, r) {
1687
+ n === void 0 && (n = []);
1688
+ var i = e.apply(this, n) || this;
1689
+ return i.__proto__ = t.prototype, i._defaultLocale = r, i;
1690
+ }
1691
+ return i(t, e), t.parse = function(e, n) {
1692
+ if (!e) return new t([], n);
1693
+ if (Array.isArray(e)) {
1694
+ var r = (i = e.map(function(e) {
1695
+ return o.parseV2Value(e, n);
1696
+ }).filter(function(e) {
1697
+ return e !== null;
1698
+ })).reduce(function(e, t) {
1699
+ var n = t._locale;
1700
+ return n ||= "none", e[n] ? e[n].addValue(t._value) : e[n] = t, e;
1701
+ }, {});
1702
+ return new t(Object.values(r), n);
1703
+ }
1704
+ return typeof e == "string" ? new t([new o(e, void 0, n)], n) : e["@language"] || e["@value"] ? new t((i = o.parseV2Value(e)) === null ? [] : [i], n) : new t(Object.keys(e).map(function(t) {
1705
+ var r = e[t];
1706
+ if (!Array.isArray(r)) throw Error("A IIIF v3 localized property value must have an array as the value for a given language.");
1707
+ return new o(r, t, n);
1708
+ }), n);
1709
+ var i;
1710
+ }, t.prototype.getSuitableLocale = function(e) {
1711
+ for (var t = Array.from(this.values()).map(function(e) {
1712
+ return e._locale;
1713
+ }).filter(function(e) {
1714
+ return e !== void 0;
1715
+ }), n = function(e) {
1716
+ var n = t.find(function(t) {
1717
+ return t === e;
1718
+ });
1719
+ if (n) return { value: n };
1720
+ }, r = 0, i = e; r < i.length; r++) {
1721
+ var o = n(i[r]);
1722
+ if (typeof o == "object") return o.value;
1723
+ }
1724
+ for (var s = function(e) {
1725
+ var n = t.find(function(t) {
1726
+ return a.Utils.getInexactLocale(t) === a.Utils.getInexactLocale(e);
1727
+ });
1728
+ if (n) return { value: n };
1729
+ }, c = 0, l = e; c < l.length; c++) {
1730
+ var u = s(l[c]);
1731
+ if (typeof u == "object") return u.value;
1732
+ }
1733
+ }, t.prototype.setValue = function(e, t) {
1734
+ var n = void 0;
1735
+ if (t) {
1736
+ var r = this.getSuitableLocale([t]);
1737
+ r && (n = this.find(function(e) {
1738
+ return e._locale === r;
1739
+ }));
1740
+ } else n = this.find(function(e) {
1741
+ return e._locale === void 0;
1742
+ });
1743
+ n ? n._value = e : this.push(new o(e, t, this._defaultLocale));
1744
+ }, t.prototype.getValue = function(e, t) {
1745
+ var n = this.getValues(e);
1746
+ return n.length === 0 ? null : t ? n.join(t) : n[0];
1747
+ }, t.prototype.getValues = function(e) {
1748
+ if (!this.length) return [];
1749
+ var t;
1750
+ if (t = e ? Array.isArray(e) ? e : [e] : [], this.length === 1 && this[0]._locale === void 0) {
1751
+ var n = this[0]._value;
1752
+ return Array.isArray(n) ? n : [n];
1753
+ }
1754
+ var r = this.getSuitableLocale(t);
1755
+ if (r) return n = this.find(function(e) {
1756
+ return e._locale === r;
1757
+ })._value, Array.isArray(n) ? n : [n];
1758
+ if (!this.find(function(e) {
1759
+ return e._locale === void 0;
1760
+ })) return n = this[0]._value, Array.isArray(n) ? n : [n];
1761
+ var i = this.find(function(e) {
1762
+ return e._locale === void 0;
1763
+ });
1764
+ return i ? Array.isArray(i._value) ? i._value : [i._value] : [];
1765
+ }, t;
1766
+ }(Array);
1767
+ },
1768
+ 3845(e, t, n) {
1769
+ var r, i = this && this.__extends || (r = function(e, t) {
1770
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1771
+ e.__proto__ = t;
1772
+ } || function(e, t) {
1773
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1774
+ }, r(e, t);
1775
+ }, function(e, t) {
1776
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1777
+ function n() {
1778
+ this.constructor = e;
1779
+ }
1780
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1781
+ });
1782
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Range = void 0;
1783
+ var a = n(4799), o = n(3957);
1784
+ t.Range = function(e) {
1785
+ function t(t, n) {
1786
+ var r = e.call(this, t, n) || this;
1787
+ return r._ranges = null, r.canvases = null, r.items = [], r;
1788
+ }
1789
+ return i(t, e), t.prototype.getCanvasIds = function() {
1790
+ return this.__jsonld.canvases ? this.__jsonld.canvases : this.canvases ? this.canvases : [];
1791
+ }, t.prototype.getDuration = function() {
1792
+ if (this.canvases && this.canvases.length) {
1793
+ for (var e = [], t = [], n = 0, r = this.canvases; n < r.length; n++) if (m = r[n]) {
1794
+ var i = m.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [void 0, m], o = i[1], s = i[2], c = i[3];
1795
+ o && (e.push(parseFloat(s)), t.push(parseFloat(c)));
1796
+ }
1797
+ if (e.length && t.length) return new a.Duration(Math.min.apply(Math, e), Math.max.apply(Math, t));
1798
+ } else {
1799
+ e = [], t = [];
1800
+ for (var l = 0, u = g = this.getRanges(); l < u.length; l++) (_ = u[l].getDuration()) && (e.push(_.start), t.push(_.end));
1801
+ if (e.length && t.length) return new a.Duration(Math.min.apply(Math, e), Math.max.apply(Math, t));
1802
+ }
1803
+ var d, f;
1804
+ if (this.canvases && this.canvases.length) for (var p = 0; p < this.canvases.length; p++) {
1805
+ var m = this.canvases[p], h = a.Utils.getTemporalComponent(m);
1806
+ h && h.length > 1 && (p === 0 && (d = Number(h[0])), p === this.canvases.length - 1 && (f = Number(h[1])));
1807
+ }
1808
+ else {
1809
+ var g = this.getRanges();
1810
+ for (p = 0; p < g.length; p++) {
1811
+ var _;
1812
+ (_ = g[p].getDuration()) && (p === 0 && (d = _.start), p === g.length - 1 && (f = _.end));
1813
+ }
1814
+ }
1815
+ if (d !== void 0 && f !== void 0) return new a.Duration(d, f);
1816
+ }, t.prototype.getRanges = function() {
1817
+ return this._ranges ? this._ranges : this._ranges = this.items.filter(function(e) {
1818
+ return e.isRange();
1819
+ });
1820
+ }, t.prototype.getBehavior = function() {
1821
+ var e = this.getProperty("behavior");
1822
+ return Array.isArray(e) && (e = e[0]), e || null;
1823
+ }, t.prototype.getViewingDirection = function() {
1824
+ return this.getProperty("viewingDirection");
1825
+ }, t.prototype.getViewingHint = function() {
1826
+ var e = this.getProperty("viewingHint");
1827
+ return Array.isArray(e) && (e = e[0]), e || null;
1828
+ }, t.prototype.getTree = function(e) {
1829
+ e.data = this, this.treeNode = e;
1830
+ var t = this.getRanges();
1831
+ if (t && t.length) for (var n = 0; n < t.length; n++) {
1832
+ var r = t[n], i = new a.TreeNode();
1833
+ e.addNode(i), this._parseTreeNode(i, r);
1834
+ }
1835
+ return a.Utils.generateTreeNodeIds(e), e;
1836
+ }, t.prototype.spansTime = function(e) {
1837
+ var t = this.getDuration();
1838
+ return !!(t && e >= t.start && e <= t.end);
1839
+ }, t.prototype._parseTreeNode = function(e, t) {
1840
+ e.label = t.getLabel().getValue(this.options.locale), e.data = t, e.data.type = a.Utils.normaliseType(a.TreeNodeType.RANGE), t.treeNode = e;
1841
+ var n = t.getRanges();
1842
+ if (n && n.length) for (var r = 0; r < n.length; r++) {
1843
+ var i = n[r];
1844
+ if (i.getBehavior() !== o.Behavior.NO_NAV) {
1845
+ var s = new a.TreeNode();
1846
+ e.addNode(s), this._parseTreeNode(s, i);
1847
+ }
1848
+ }
1849
+ }, t;
1850
+ }(a.ManifestResource);
1851
+ },
1852
+ 6940(e, t, n) {
1853
+ var r, i = this && this.__extends || (r = function(e, t) {
1854
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1855
+ e.__proto__ = t;
1856
+ } || function(e, t) {
1857
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1858
+ }, r(e, t);
1859
+ }, function(e, t) {
1860
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1861
+ function n() {
1862
+ this.constructor = e;
1863
+ }
1864
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1865
+ });
1866
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Rendering = void 0, t.Rendering = function(e) {
1867
+ function t(t, n) {
1868
+ return e.call(this, t, n) || this;
1869
+ }
1870
+ return i(t, e), t.prototype.getFormat = function() {
1871
+ return this.getProperty("format");
1872
+ }, t;
1873
+ }(n(4799).ManifestResource);
1874
+ },
1875
+ 258(e, t, n) {
1876
+ var r, i = this && this.__extends || (r = function(e, t) {
1877
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1878
+ e.__proto__ = t;
1879
+ } || function(e, t) {
1880
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1881
+ }, r(e, t);
1882
+ }, function(e, t) {
1883
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1884
+ function n() {
1885
+ this.constructor = e;
1886
+ }
1887
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1888
+ });
1889
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Resource = void 0;
1890
+ var a = n(4799);
1891
+ t.Resource = function(e) {
1892
+ function t(t, n) {
1893
+ return e.call(this, t, n) || this;
1894
+ }
1895
+ return i(t, e), t.prototype.getFormat = function() {
1896
+ var e = this.getProperty("format");
1897
+ return e ? e.toLowerCase() : null;
1898
+ }, t.prototype.getResources = function() {
1899
+ var e = [];
1900
+ if (!this.__jsonld.resources) return e;
1901
+ for (var t = 0; t < this.__jsonld.resources.length; t++) {
1902
+ var n = this.__jsonld.resources[t], r = new a.Annotation(n, this.options);
1903
+ e.push(r);
1904
+ }
1905
+ return e;
1906
+ }, t.prototype.getType = function() {
1907
+ var e = this.getProperty("type");
1908
+ return e ? a.Utils.normaliseType(e) : null;
1909
+ }, t.prototype.getWidth = function() {
1910
+ return this.getProperty("width");
1911
+ }, t.prototype.getHeight = function() {
1912
+ return this.getProperty("height");
1913
+ }, t.prototype.getMaxWidth = function() {
1914
+ return this.getProperty("maxWidth");
1915
+ }, t.prototype.getMaxHeight = function() {
1916
+ return this.getProperty("maxHeight") ? null : this.getMaxWidth();
1917
+ }, t;
1918
+ }(a.ManifestResource);
1919
+ },
1920
+ 4591(e, t, n) {
1921
+ var r, i = this && this.__extends || (r = function(e, t) {
1922
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1923
+ e.__proto__ = t;
1924
+ } || function(e, t) {
1925
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1926
+ }, r(e, t);
1927
+ }, function(e, t) {
1928
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1929
+ function n() {
1930
+ this.constructor = e;
1931
+ }
1932
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1933
+ });
1934
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Sequence = void 0;
1935
+ var a = n(3957), o = n(4799);
1936
+ t.Sequence = function(e) {
1937
+ function t(t, n) {
1938
+ var r = e.call(this, t, n) || this;
1939
+ return r.items = [], r._thumbnails = null, r;
1940
+ }
1941
+ return i(t, e), t.prototype.getCanvases = function() {
1942
+ if (this.items.length) return this.items;
1943
+ var e = this.__jsonld.canvases || this.__jsonld.elements;
1944
+ if (e) for (var t = 0; t < e.length; t++) {
1945
+ var n = e[t];
1946
+ (r = new o.Canvas(n, this.options)).index = t, this.items.push(r);
1947
+ }
1948
+ else if (this.__jsonld) for (t = 0; t < this.__jsonld.length; t++) {
1949
+ var r;
1950
+ n = this.__jsonld[t], (r = new o.Canvas(n, this.options)).index = t, this.items.push(r);
1951
+ }
1952
+ return this.items;
1953
+ }, t.prototype.getCanvasById = function(e) {
1954
+ for (var t = 0; t < this.getTotalCanvases(); t++) {
1955
+ var n = this.getCanvasByIndex(t), r = o.Utils.normaliseUrl(n.id);
1956
+ if (o.Utils.normaliseUrl(e) === r) return n;
1957
+ }
1958
+ return null;
1959
+ }, t.prototype.getCanvasByIndex = function(e) {
1960
+ return this.getCanvases()[e];
1961
+ }, t.prototype.getCanvasIndexById = function(e) {
1962
+ for (var t = 0; t < this.getTotalCanvases(); t++) if (this.getCanvasByIndex(t).id === e) return t;
1963
+ return null;
1964
+ }, t.prototype.getCanvasIndexByLabel = function(e, t) {
1965
+ e = e.trim(), isNaN(e) || (e = parseInt(e, 10).toString(), t && (e += "r"));
1966
+ for (var n, r, i, a = /(\d*)\D+(\d*)/, o = 0; o < this.getTotalCanvases(); o++) {
1967
+ var s = this.getCanvasByIndex(o);
1968
+ if (s.getLabel().getValue(this.options.locale) === e || (n = a.exec(e)) && (r = n[1], (i = n[2]) && RegExp("^" + r + "\\D+" + i + "$").test(s.getLabel().toString()))) return o;
1969
+ }
1970
+ return -1;
1971
+ }, t.prototype.getLastCanvasLabel = function(e) {
1972
+ for (var t = this.getTotalCanvases() - 1; t >= 0; t--) {
1973
+ var n = this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);
1974
+ if (e) {
1975
+ if (/^[a-zA-Z0-9]*$/.test(n)) return n;
1976
+ } else if (n) return n;
1977
+ }
1978
+ return this.options.defaultLabel;
1979
+ }, t.prototype.getLastPageIndex = function() {
1980
+ return this.getTotalCanvases() - 1;
1981
+ }, t.prototype.getNextPageIndex = function(e, t) {
1982
+ var n;
1983
+ if (t) {
1984
+ var r = this.getPagedIndices(e), i = this.getViewingDirection();
1985
+ n = i && i === a.ViewingDirection.RIGHT_TO_LEFT ? r[0] + 1 : r[r.length - 1] + 1;
1986
+ } else n = e + 1;
1987
+ return n > this.getLastPageIndex() ? -1 : n;
1988
+ }, t.prototype.getPagedIndices = function(e, t) {
1989
+ var n = [];
1990
+ if (t) {
1991
+ n = this.isFirstCanvas(e) || this.isLastCanvas(e) ? [e] : e % 2 ? [e, e + 1] : [e - 1, e];
1992
+ var r = this.getViewingDirection();
1993
+ r && r === a.ViewingDirection.RIGHT_TO_LEFT && (n = n.reverse());
1994
+ } else n.push(e);
1995
+ return n;
1996
+ }, t.prototype.getPrevPageIndex = function(e, t) {
1997
+ var n;
1998
+ if (t) {
1999
+ var r = this.getPagedIndices(e), i = this.getViewingDirection();
2000
+ n = i && i === a.ViewingDirection.RIGHT_TO_LEFT ? r[r.length - 1] - 1 : r[0] - 1;
2001
+ } else n = e - 1;
2002
+ return n;
2003
+ }, t.prototype.getStartCanvasIndex = function() {
2004
+ var e = this.getStartCanvas();
2005
+ if (e) {
2006
+ for (var t = 0; t < this.getTotalCanvases(); t++) if (this.getCanvasByIndex(t).id === e) return t;
2007
+ }
2008
+ return 0;
2009
+ }, t.prototype.getThumbs = function(e, t) {
2010
+ for (var n = [], r = this.getTotalCanvases(), i = 0; i < r; i++) {
2011
+ var a = this.getCanvasByIndex(i), s = new o.Thumb(e, a);
2012
+ n.push(s);
2013
+ }
2014
+ return n;
2015
+ }, t.prototype.getThumbnails = function() {
2016
+ if (this._thumbnails != null) return this._thumbnails;
2017
+ this._thumbnails = [];
2018
+ for (var e = this.getCanvases(), t = 0; t < e.length; t++) {
2019
+ var n = e[t].getThumbnail();
2020
+ n && this._thumbnails.push(n);
2021
+ }
2022
+ return this._thumbnails;
2023
+ }, t.prototype.getStartCanvas = function() {
2024
+ return this.getProperty("startCanvas");
2025
+ }, t.prototype.getTotalCanvases = function() {
2026
+ return this.getCanvases().length;
2027
+ }, t.prototype.getViewingDirection = function() {
2028
+ return this.getProperty("viewingDirection") ? this.getProperty("viewingDirection") : this.options.resource.getViewingDirection ? this.options.resource.getViewingDirection() : null;
2029
+ }, t.prototype.getViewingHint = function() {
2030
+ var e = this.getProperty("viewingHint");
2031
+ return Array.isArray(e) && (e = e[0]), e || null;
2032
+ }, t.prototype.isCanvasIndexOutOfRange = function(e) {
2033
+ return e > this.getTotalCanvases() - 1;
2034
+ }, t.prototype.isFirstCanvas = function(e) {
2035
+ return e === 0;
2036
+ }, t.prototype.isLastCanvas = function(e) {
2037
+ return e === this.getTotalCanvases() - 1;
2038
+ }, t.prototype.isMultiCanvas = function() {
2039
+ return this.getTotalCanvases() > 1;
2040
+ }, t.prototype.isPagingEnabled = function() {
2041
+ var e = this.getViewingHint();
2042
+ return !!e && e === a.ViewingHint.PAGED;
2043
+ }, t.prototype.isTotalCanvasesEven = function() {
2044
+ return this.getTotalCanvases() % 2 == 0;
2045
+ }, t;
2046
+ }(o.ManifestResource);
2047
+ },
2048
+ 4029(e, t, n) {
2049
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Deserialiser = void 0;
2050
+ var r = n(4799);
2051
+ t.Deserialiser = function() {
2052
+ function e() {}
2053
+ return e.parse = function(e, t) {
2054
+ return typeof e == "string" && (e = JSON.parse(e)), this.parseJson(e, t);
2055
+ }, e.parseJson = function(e, t) {
2056
+ var n;
2057
+ if (t && t.navDate && !isNaN(t.navDate.getTime()) && (e.navDate = t.navDate.toString()), e["@type"]) switch (e["@type"]) {
2058
+ case "sc:Collection":
2059
+ n = this.parseCollection(e, t);
2060
+ break;
2061
+ case "sc:Manifest":
2062
+ n = this.parseManifest(e, t);
2063
+ break;
2064
+ default: return null;
2065
+ }
2066
+ else switch (e.type) {
2067
+ case "Collection":
2068
+ n = this.parseCollection(e, t);
2069
+ break;
2070
+ case "Manifest":
2071
+ n = this.parseManifest(e, t);
2072
+ break;
2073
+ default: return null;
2074
+ }
2075
+ return n.isLoaded = !0, n;
2076
+ }, e.parseCollection = function(e, t) {
2077
+ var n = new r.Collection(e, t);
2078
+ return t ? (n.index = t.index || 0, t.resource && (n.parentCollection = t.resource.parentCollection)) : n.index = 0, this.parseCollections(n, t), this.parseManifests(n, t), this.parseItems(n, t), n;
2079
+ }, e.parseCollections = function(e, t) {
2080
+ var n;
2081
+ if (e.__jsonld.collections ? n = e.__jsonld.collections : e.__jsonld.items && (n = e.__jsonld.items.filter(function(e) {
2082
+ return e.type.toLowerCase() === "collection";
2083
+ })), n) for (var r = 0; r < n.length; r++) {
2084
+ t && (t.index = r);
2085
+ var i = this.parseCollection(n[r], t);
2086
+ i.index = r, i.parentCollection = e, e.items.push(i);
2087
+ }
2088
+ }, e.parseManifest = function(e, t) {
2089
+ return new r.Manifest(e, t);
2090
+ }, e.parseManifests = function(e, t) {
2091
+ var n;
2092
+ if (e.__jsonld.manifests ? n = e.__jsonld.manifests : e.__jsonld.items && (n = e.__jsonld.items.filter(function(e) {
2093
+ return e.type.toLowerCase() === "manifest";
2094
+ })), n) for (var r = 0; r < n.length; r++) {
2095
+ var i = this.parseManifest(n[r], t);
2096
+ i.index = r, i.parentCollection = e, e.items.push(i);
2097
+ }
2098
+ }, e.parseItem = function(e, t) {
2099
+ if (e["@type"]) {
2100
+ if (e["@type"].toLowerCase() === "sc:manifest") return this.parseManifest(e, t);
2101
+ if (e["@type"].toLowerCase() === "sc:collection") return this.parseCollection(e, t);
2102
+ } else if (e.type) {
2103
+ if (e.type.toLowerCase() === "manifest") return this.parseManifest(e, t);
2104
+ if (e.type.toLowerCase() === "collection") return this.parseCollection(e, t);
2105
+ }
2106
+ return null;
2107
+ }, e.parseItems = function(e, t) {
2108
+ var n = e.__jsonld.members || e.__jsonld.items;
2109
+ if (n) for (var r = function(r) {
2110
+ t && (t.index = r);
2111
+ var a = i.parseItem(n[r], t);
2112
+ return a ? e.items.filter(function(e) {
2113
+ return e.id === a.id;
2114
+ })[0] ? "continue" : (a.index = r, a.parentCollection = e, void e.items.push(a)) : { value: void 0 };
2115
+ }, i = this, a = 0; a < n.length; a++) {
2116
+ var o = r(a);
2117
+ if (typeof o == "object") return o.value;
2118
+ }
2119
+ }, e;
2120
+ }();
2121
+ },
2122
+ 9579(e, t, n) {
2123
+ var r, i = this && this.__extends || (r = function(e, t) {
2124
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
2125
+ e.__proto__ = t;
2126
+ } || function(e, t) {
2127
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
2128
+ }, r(e, t);
2129
+ }, function(e, t) {
2130
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
2131
+ function n() {
2132
+ this.constructor = e;
2133
+ }
2134
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
2135
+ });
2136
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Service = void 0;
2137
+ var a = n(4799);
2138
+ t.Service = function(e) {
2139
+ function t(t, n) {
2140
+ return e.call(this, t, n) || this;
2141
+ }
2142
+ return i(t, e), t.prototype.getProfile = function() {
2143
+ var e = this.getProperty("profile");
2144
+ return e ||= this.getProperty("dcterms:conformsTo"), Array.isArray(e) ? e[0] : e;
2145
+ }, t.prototype.getConfirmLabel = function() {
2146
+ return a.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale);
2147
+ }, t.prototype.getDescription = function() {
2148
+ return a.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale);
2149
+ }, t.prototype.getFailureDescription = function() {
2150
+ return a.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale);
2151
+ }, t.prototype.getFailureHeader = function() {
2152
+ return a.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale);
2153
+ }, t.prototype.getHeader = function() {
2154
+ return a.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale);
2155
+ }, t.prototype.getServiceLabel = function() {
2156
+ return a.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale);
2157
+ }, t.prototype.getInfoUri = function() {
2158
+ var e = this.id;
2159
+ return e.endsWith("/") || (e += "/"), e + "info.json";
2160
+ }, t;
2161
+ }(a.ManifestResource);
2162
+ },
2163
+ 2639(e, t) {
2164
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Size = void 0, t.Size = function(e, t) {
2165
+ this.width = e, this.height = t;
2166
+ };
2167
+ },
2168
+ 5633(e, t) {
2169
+ var n;
2170
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.StatusCode = void 0, function(e) {
2171
+ e[e.AUTHORIZATION_FAILED = 1] = "AUTHORIZATION_FAILED", e[e.FORBIDDEN = 2] = "FORBIDDEN", e[e.INTERNAL_SERVER_ERROR = 3] = "INTERNAL_SERVER_ERROR", e[e.RESTRICTED = 4] = "RESTRICTED";
2172
+ }(n || (t.StatusCode = n = {}));
2173
+ },
2174
+ 9692(e, t) {
2175
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Thumb = void 0, t.Thumb = function(e, t) {
2176
+ this.data = t, this.index = t.index, this.width = e;
2177
+ var n = t.getHeight() / t.getWidth();
2178
+ this.height = n ? Math.floor(this.width * n) : e, this.uri = t.getCanonicalImageUri(e), this.label = t.getLabel().getValue(), this.viewingHint = t.getViewingHint();
2179
+ };
2180
+ },
2181
+ 4204(e, t, n) {
2182
+ var r, i = this && this.__extends || (r = function(e, t) {
2183
+ return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
2184
+ e.__proto__ = t;
2185
+ } || function(e, t) {
2186
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
2187
+ }, r(e, t);
2188
+ }, function(e, t) {
2189
+ if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
2190
+ function n() {
2191
+ this.constructor = e;
2192
+ }
2193
+ r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
2194
+ });
2195
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Thumbnail = void 0, t.Thumbnail = function(e) {
2196
+ function t(t, n) {
2197
+ return e.call(this, t, n) || this;
2198
+ }
2199
+ return i(t, e), t;
2200
+ }(n(4799).Resource);
2201
+ },
2202
+ 8570(e, t, n) {
2203
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.TreeNode = void 0;
2204
+ var r = n(4799);
2205
+ t.TreeNode = function() {
2206
+ function e(e, t) {
2207
+ this.label = e, this.data = t || {}, this.nodes = [];
2208
+ }
2209
+ return e.prototype.addNode = function(e) {
2210
+ this.nodes.push(e), e.parentNode = this;
2211
+ }, e.prototype.isCollection = function() {
2212
+ return this.data.type === r.Utils.normaliseType(r.TreeNodeType.COLLECTION);
2213
+ }, e.prototype.isManifest = function() {
2214
+ return this.data.type === r.Utils.normaliseType(r.TreeNodeType.MANIFEST);
2215
+ }, e.prototype.isRange = function() {
2216
+ return this.data.type === r.Utils.normaliseType(r.TreeNodeType.RANGE);
2217
+ }, e;
2218
+ }();
2219
+ },
2220
+ 6386(e, t) {
2221
+ var n;
2222
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.TreeNodeType = void 0, function(e) {
2223
+ e.COLLECTION = "collection", e.MANIFEST = "manifest", e.RANGE = "range";
2224
+ }(n || (t.TreeNodeType = n = {}));
2225
+ },
2226
+ 41(e, t, n) {
2227
+ var r = this && this.__awaiter || function(e, t, n, r) {
2228
+ return new (n ||= Promise)(function(i, a) {
2229
+ function o(e) {
2230
+ try {
2231
+ c(r.next(e));
2232
+ } catch (e) {
2233
+ a(e);
2234
+ }
2235
+ }
2236
+ function s(e) {
2237
+ try {
2238
+ c(r.throw(e));
2239
+ } catch (e) {
2240
+ a(e);
2241
+ }
2242
+ }
2243
+ function c(e) {
2244
+ var t;
2245
+ e.done ? i(e.value) : (t = e.value, t instanceof n ? t : new n(function(e) {
2246
+ e(t);
2247
+ })).then(o, s);
2248
+ }
2249
+ c((r = r.apply(e, t || [])).next());
2250
+ });
2251
+ }, i = this && this.__generator || function(e, t) {
2252
+ var n, r, i, a = {
2253
+ label: 0,
2254
+ sent: function() {
2255
+ if (1 & i[0]) throw i[1];
2256
+ return i[1];
2257
+ },
2258
+ trys: [],
2259
+ ops: []
2260
+ }, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
2261
+ return o.next = s(0), o.throw = s(1), o.return = s(2), typeof Symbol == "function" && (o[Symbol.iterator] = function() {
2262
+ return this;
2263
+ }), o;
2264
+ function s(s) {
2265
+ return function(c) {
2266
+ return function(s) {
2267
+ if (n) throw TypeError("Generator is already executing.");
2268
+ for (; o && (o = 0, s[0] && (a = 0)), a;) try {
2269
+ if (n = 1, r && (i = 2 & s[0] ? r.return : s[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, s[1])).done) return i;
2270
+ switch (r = 0, i && (s = [2 & s[0], i.value]), s[0]) {
2271
+ case 0:
2272
+ case 1:
2273
+ i = s;
2274
+ break;
2275
+ case 4: return a.label++, {
2276
+ value: s[1],
2277
+ done: !1
2278
+ };
2279
+ case 5:
2280
+ a.label++, r = s[1], s = [0];
2281
+ continue;
2282
+ case 7:
2283
+ s = a.ops.pop(), a.trys.pop();
2284
+ continue;
2285
+ default:
2286
+ if (!((i = (i = a.trys).length > 0 && i[i.length - 1]) || s[0] !== 6 && s[0] !== 2)) {
2287
+ a = 0;
2288
+ continue;
2289
+ }
2290
+ if (s[0] === 3 && (!i || s[1] > i[0] && s[1] < i[3])) {
2291
+ a.label = s[1];
2292
+ break;
2293
+ }
2294
+ if (s[0] === 6 && a.label < i[1]) {
2295
+ a.label = i[1], i = s;
2296
+ break;
2297
+ }
2298
+ if (i && a.label < i[2]) {
2299
+ a.label = i[2], a.ops.push(s);
2300
+ break;
2301
+ }
2302
+ i[2] && a.ops.pop(), a.trys.pop();
2303
+ continue;
2304
+ }
2305
+ s = t.call(e, a);
2306
+ } catch (e) {
2307
+ s = [6, e], r = 0;
2308
+ } finally {
2309
+ n = i = 0;
2310
+ }
2311
+ if (5 & s[0]) throw s[1];
2312
+ return {
2313
+ value: s[0] ? s[1] : void 0,
2314
+ done: !0
2315
+ };
2316
+ }([s, c]);
2317
+ };
2318
+ }
2319
+ };
2320
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Utils = void 0;
2321
+ var a = n(4799), o = n(3957), s = n(7019);
2322
+ n(916), t.Utils = function() {
2323
+ function e() {}
2324
+ return e.getMediaType = function(e) {
2325
+ return (e = (e = e.toLowerCase()).split(";")[0]).trim();
2326
+ }, e.getImageQuality = function(e) {
2327
+ return e === o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 || e === o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 || e === o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 || e === o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 || e === o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 || e === o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 || e === o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 || e === o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 || e === o.ServiceProfile.IMAGE_1_LEVEL_1 || e === o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 || e === o.ServiceProfile.IMAGE_1_LEVEL_2 || e === o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2 ? "native" : "default";
2328
+ }, e.getInexactLocale = function(e) {
2329
+ return e.indexOf("-") === -1 ? e : e.substr(0, e.indexOf("-"));
2330
+ }, e.getLocalisedValue = function(e, t) {
2331
+ if (!Array.isArray(e)) return e;
2332
+ for (var n = 0; n < e.length; n++) {
2333
+ var r = e[n];
2334
+ if (t === r["@language"]) return r["@value"];
2335
+ }
2336
+ var i = t.substr(0, t.indexOf("-"));
2337
+ for (n = 0; n < e.length; n++) {
2338
+ var a = e[n];
2339
+ if (a["@language"] === i) return a["@value"];
2340
+ }
2341
+ return null;
2342
+ }, e.generateTreeNodeIds = function(t, n) {
2343
+ var r;
2344
+ n === void 0 && (n = 0), r = t.parentNode ? t.parentNode.id + "-" + n : "0", t.id = r;
2345
+ for (var i = 0; i < t.nodes.length; i++) {
2346
+ var a = t.nodes[i];
2347
+ e.generateTreeNodeIds(a, i);
2348
+ }
2349
+ }, e.normaliseType = function(e) {
2350
+ return (e = (e || "").toLowerCase()).indexOf(":") === -1 ? e : e.split(":")[1];
2351
+ }, e.normaliseUrl = function(e) {
2352
+ return (e = e.substr(e.indexOf("://"))).indexOf("#") !== -1 && (e = e.split("#")[0]), e;
2353
+ }, e.normalisedUrlsMatch = function(t, n) {
2354
+ return e.normaliseUrl(t) === e.normaliseUrl(n);
2355
+ }, e.isImageProfile = function(t) {
2356
+ return !!(e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2));
2357
+ }, e.isImageServiceType = function(e) {
2358
+ return e !== null && e.toLowerCase() === o.ServiceType.IMAGE_SERVICE_2.toLowerCase() || e === o.ServiceType.IMAGE_SERVICE_3.toLowerCase();
2359
+ }, e.isLevel0ImageProfile = function(t) {
2360
+ return !!(e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0));
2361
+ }, e.isLevel1ImageProfile = function(t) {
2362
+ return !!(e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1));
2363
+ }, e.isLevel2ImageProfile = function(t) {
2364
+ return !!(e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2));
2365
+ }, e.parseManifest = function(e, t) {
2366
+ return a.Deserialiser.parse(e, t);
2367
+ }, e.checkStatus = function(e) {
2368
+ if (e.ok) return e;
2369
+ var t = Error(e.statusText);
2370
+ return t.response = e, Promise.reject(t);
2371
+ }, e.loadManifest = function(t) {
2372
+ return new Promise(function(n, r) {
2373
+ fetch(t).then(e.checkStatus).then(function(e) {
2374
+ return e.json();
2375
+ }).then(function(e) {
2376
+ n(e);
2377
+ }).catch(function(e) {
2378
+ r();
2379
+ });
2380
+ });
2381
+ }, e.loadExternalResourcesAuth1 = function(t, n, r, i, a, o, s, c) {
2382
+ return new Promise(function(l, u) {
2383
+ var d = t.map(function(t) {
2384
+ return e.loadExternalResourceAuth1(t, n, r, i, a, o, s, c);
2385
+ });
2386
+ Promise.all(d).then(function() {
2387
+ l(t);
2388
+ }).catch(function(e) {
2389
+ u(e);
2390
+ });
2391
+ });
2392
+ }, e.loadExternalResourceAuth1 = function(t, n, a, o, c, l, u, d) {
2393
+ return r(this, void 0, void 0, function() {
2394
+ var r;
2395
+ return i(this, function(i) {
2396
+ switch (i.label) {
2397
+ case 0: return [4, o(t)];
2398
+ case 1: return (r = i.sent()) ? [4, t.getData(r)] : [3, 6];
2399
+ case 2: return i.sent(), t.status === s.OK ? [2, t] : [3, 3];
2400
+ case 3: return [4, e.doAuthChain(t, n, a, c, l, u, d)];
2401
+ case 4: i.sent(), i.label = 5;
2402
+ case 5:
2403
+ if (t.status === s.OK || t.status === s.MOVED_TEMPORARILY) return [2, t];
2404
+ throw e.createAuthorizationFailedError();
2405
+ case 6: return [4, t.getData()];
2406
+ case 7: return i.sent(), t.status !== s.MOVED_TEMPORARILY && t.status !== s.UNAUTHORIZED ? [3, 9] : [4, e.doAuthChain(t, n, a, c, l, u, d)];
2407
+ case 8: i.sent(), i.label = 9;
2408
+ case 9:
2409
+ if (t.status === s.OK || t.status === s.MOVED_TEMPORARILY) return [2, t];
2410
+ throw e.createAuthorizationFailedError();
2411
+ }
2412
+ });
2413
+ });
2414
+ }, e.doAuthChain = function(t, n, a, o, c, l, u) {
2415
+ return r(this, void 0, void 0, function() {
2416
+ var r, d, f, p, m, h, g, _;
2417
+ return i(this, function(i) {
2418
+ switch (i.label) {
2419
+ case 0: return t.isAccessControlled() ? ((r = t.externalService) && (r.options = t.options), (d = t.kioskService) && (d.options = t.options), (f = t.clickThroughService) && (f.options = t.options), (p = t.loginService) && (p.options = t.options), t.isResponseHandled || t.status !== s.MOVED_TEMPORARILY ? [3, 2] : [4, l(t)]) : [2, t];
2420
+ case 1:
2421
+ case 3:
2422
+ case 6:
2423
+ case 10:
2424
+ case 14: return i.sent(), [2, t];
2425
+ case 2: return m = null, h = null, (m = r) ? (h = m, [4, e.attemptResourceWithToken(t, a, m)]) : [3, 4];
2426
+ case 4: return (m = d) ? (h = m, (g = n(m)) ? [4, o(g)] : [3, 7]) : [3, 7];
2427
+ case 5:
2428
+ case 9:
2429
+ case 13: return i.sent(), [4, e.attemptResourceWithToken(t, a, m)];
2430
+ case 7: return (m = f) ? (h = m, [4, c(t, m)]) : [3, 11];
2431
+ case 8: return (_ = i.sent()) ? [4, o(_)] : [3, 11];
2432
+ case 11: return (m = p) ? (h = m, [4, c(t, m)]) : [3, 15];
2433
+ case 12: return (_ = i.sent()) ? [4, o(_)] : [3, 15];
2434
+ case 15: return h && u(t, h), [2];
2435
+ }
2436
+ });
2437
+ });
2438
+ }, e.attemptResourceWithToken = function(e, t, n) {
2439
+ return r(this, void 0, void 0, function() {
2440
+ var r, a;
2441
+ return i(this, function(i) {
2442
+ switch (i.label) {
2443
+ case 0: return (r = n.getService(o.ServiceProfile.AUTH_1_TOKEN)) ? [4, t(e, r)] : [3, 3];
2444
+ case 1: return (a = i.sent()) && a.accessToken ? [4, e.getData(a)] : [3, 3];
2445
+ case 2: return i.sent(), [2, e];
2446
+ case 3: return [2];
2447
+ }
2448
+ });
2449
+ });
2450
+ }, e.loadExternalResourcesAuth09 = function(t, n, r, i, a, o, s, c, l, u) {
2451
+ return new Promise(function(d, f) {
2452
+ var p = t.map(function(t) {
2453
+ return e.loadExternalResourceAuth09(t, n, r, i, a, o, s, c, l, u);
2454
+ });
2455
+ Promise.all(p).then(function() {
2456
+ d(t);
2457
+ }).catch(function(e) {
2458
+ f(e);
2459
+ });
2460
+ });
2461
+ }, e.loadExternalResourceAuth09 = function(t, n, r, i, a, o, c, l, u, d) {
2462
+ return new Promise(function(f, p) {
2463
+ d && d.pessimisticAccessControl ? t.getData().then(function() {
2464
+ t.isAccessControlled() ? t.clickThroughService ? (f(r(t)), f(i(t))) : a(t).then(function() {
2465
+ o(t, !0).then(function(n) {
2466
+ t.getData(n).then(function() {
2467
+ f(u(t));
2468
+ }).catch(function(t) {
2469
+ p(e.createInternalServerError(t));
2470
+ });
2471
+ }).catch(function(t) {
2472
+ p(e.createInternalServerError(t));
2473
+ });
2474
+ }).catch(function(t) {
2475
+ p(e.createInternalServerError(t));
2476
+ }) : f(t);
2477
+ }).catch(function(t) {
2478
+ p(e.createInternalServerError(t));
2479
+ }) : l(t, n).then(function(d) {
2480
+ d ? t.getData(d).then(function() {
2481
+ t.status === s.OK ? f(u(t)) : e.authorize(t, n, r, i, a, o, c, l).then(function() {
2482
+ f(u(t));
2483
+ }).catch(function(t) {
2484
+ p(e.createAuthorizationFailedError());
2485
+ });
2486
+ }).catch(function(t) {
2487
+ p(e.createAuthorizationFailedError());
2488
+ }) : e.authorize(t, n, r, i, a, o, c, l).then(function() {
2489
+ f(u(t));
2490
+ }).catch(function(t) {
2491
+ p(e.createAuthorizationFailedError());
2492
+ });
2493
+ }).catch(function(t) {
2494
+ p(e.createAuthorizationFailedError());
2495
+ });
2496
+ });
2497
+ }, e.createError = function(e, t) {
2498
+ var n = /* @__PURE__ */ Error();
2499
+ return n.message = t, n.name = String(e), n;
2500
+ }, e.createAuthorizationFailedError = function() {
2501
+ return e.createError(a.StatusCode.AUTHORIZATION_FAILED, "Authorization failed");
2502
+ }, e.createRestrictedError = function() {
2503
+ return e.createError(a.StatusCode.RESTRICTED, "Restricted");
2504
+ }, e.createInternalServerError = function(t) {
2505
+ return e.createError(a.StatusCode.INTERNAL_SERVER_ERROR, t);
2506
+ }, e.authorize = function(t, n, r, i, a, o, c, l) {
2507
+ return new Promise(function(u, d) {
2508
+ t.getData().then(function() {
2509
+ t.isAccessControlled() ? l(t, n).then(function(l) {
2510
+ l ? t.getData(l).then(function() {
2511
+ t.status === s.OK ? u(t) : e.showAuthInteraction(t, n, r, i, a, o, c, u, d);
2512
+ }).catch(function(t) {
2513
+ d(e.createInternalServerError(t));
2514
+ }) : o(t, !1).then(function(l) {
2515
+ l ? c(t, l, n).then(function() {
2516
+ t.getData(l).then(function() {
2517
+ t.status === s.OK ? u(t) : e.showAuthInteraction(t, n, r, i, a, o, c, u, d);
2518
+ }).catch(function(t) {
2519
+ d(e.createInternalServerError(t));
2520
+ });
2521
+ }).catch(function(t) {
2522
+ d(e.createInternalServerError(t));
2523
+ }) : e.showAuthInteraction(t, n, r, i, a, o, c, u, d);
2524
+ });
2525
+ }).catch(function(t) {
2526
+ d(e.createInternalServerError(t));
2527
+ }) : u(t);
2528
+ });
2529
+ });
2530
+ }, e.showAuthInteraction = function(t, n, r, i, a, o, c, l, u) {
2531
+ t.status !== s.MOVED_TEMPORARILY || t.isResponseHandled ? t.clickThroughService && !t.isResponseHandled ? r(t).then(function() {
2532
+ o(t, !0).then(function(r) {
2533
+ c(t, r, n).then(function() {
2534
+ t.getData(r).then(function() {
2535
+ l(t);
2536
+ }).catch(function(t) {
2537
+ u(e.createInternalServerError(t));
2538
+ });
2539
+ }).catch(function(t) {
2540
+ u(e.createInternalServerError(t));
2541
+ });
2542
+ }).catch(function(t) {
2543
+ u(e.createInternalServerError(t));
2544
+ });
2545
+ }) : a(t).then(function() {
2546
+ o(t, !0).then(function(r) {
2547
+ c(t, r, n).then(function() {
2548
+ t.getData(r).then(function() {
2549
+ l(t);
2550
+ }).catch(function(t) {
2551
+ u(e.createInternalServerError(t));
2552
+ });
2553
+ }).catch(function(t) {
2554
+ u(e.createInternalServerError(t));
2555
+ });
2556
+ }).catch(function(t) {
2557
+ u(e.createInternalServerError(t));
2558
+ });
2559
+ }) : l(t);
2560
+ }, e.getService = function(e, t) {
2561
+ for (var n = this.getServices(e), r = 0; r < n.length; r++) {
2562
+ var i = n[r];
2563
+ if (i.getProfile() === t) return i;
2564
+ }
2565
+ return null;
2566
+ }, e.getResourceById = function(t, n) {
2567
+ return e.traverseAndFind(t.__jsonld, "@id", n);
2568
+ }, e.traverseAndFind = function(t, n, r) {
2569
+ if (t.hasOwnProperty(n) && t[n] === r) return t;
2570
+ for (var i = 0; i < Object.keys(t).length; i++) if (typeof t[Object.keys(t)[i]] == "object") {
2571
+ var a = e.traverseAndFind(t[Object.keys(t)[i]], n, r);
2572
+ if (a != null) return a;
2573
+ }
2574
+ }, e.getServices = function(t, n) {
2575
+ var r = n === void 0 ? {} : n, i = r.onlyService, o = i !== void 0 && i, s = r.onlyServices, c = s !== void 0 && s, l = r.skipParentResources, u = [];
2576
+ (l === void 0 || !l) && t && t.options && t.options.resource && t.options.resource !== t && u.push.apply(u, e.getServices(t.options.resource, { onlyServices: !0 }));
2577
+ var d = c ? [] : (t.__jsonld || t).service || [];
2578
+ if (Array.isArray(d) || (d = [d]), o || d.push.apply(d, (t.__jsonld || t).services || []), d.length === 0) return u;
2579
+ for (var f = 0; f < d.length; f++) {
2580
+ var p = d[f];
2581
+ if (typeof p == "string") {
2582
+ var m = this.getResourceById(t.options.resource, p);
2583
+ m && u.push(new a.Service(m.__jsonld || m, t.options));
2584
+ } else u.push(new a.Service(p, t.options));
2585
+ }
2586
+ return u;
2587
+ }, e.getTemporalComponent = function(e) {
2588
+ var t = /t=([^&]+)/g.exec(e), n = null;
2589
+ return t && t[1] && (n = t[1].split(",")), n;
2590
+ }, e;
2591
+ }();
2592
+ },
2593
+ 8156(e, t, n) {
2594
+ var r = this && this.__createBinding || (Object.create ? function(e, t, n, r) {
2595
+ r === void 0 && (r = n);
2596
+ var i = Object.getOwnPropertyDescriptor(t, n);
2597
+ i && !("get" in i ? !t.__esModule : i.writable || i.configurable) || (i = {
2598
+ enumerable: !0,
2599
+ get: function() {
2600
+ return t[n];
2601
+ }
2602
+ }), Object.defineProperty(e, r, i);
2603
+ } : function(e, t, n, r) {
2604
+ r === void 0 && (r = n), e[r] = t[n];
2605
+ }), i = this && this.__exportStar || function(e, t) {
2606
+ for (var n in e) n === "default" || Object.prototype.hasOwnProperty.call(t, n) || r(t, e, n);
2607
+ };
2608
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.parseManifest = t.loadManifest = void 0, i(n(4799), t);
2609
+ var a = n(41);
2610
+ t.loadManifest = function(e) {
2611
+ return a.Utils.loadManifest(e);
2612
+ }, t.parseManifest = function(e, t) {
2613
+ return a.Utils.parseManifest(e, t);
2614
+ };
2615
+ },
2616
+ 4799(e, t, n) {
2617
+ var r = this && this.__createBinding || (Object.create ? function(e, t, n, r) {
2618
+ r === void 0 && (r = n);
2619
+ var i = Object.getOwnPropertyDescriptor(t, n);
2620
+ i && !("get" in i ? !t.__esModule : i.writable || i.configurable) || (i = {
2621
+ enumerable: !0,
2622
+ get: function() {
2623
+ return t[n];
2624
+ }
2625
+ }), Object.defineProperty(e, r, i);
2626
+ } : function(e, t, n, r) {
2627
+ r === void 0 && (r = n), e[r] = t[n];
2628
+ }), i = this && this.__exportStar || function(e, t) {
2629
+ for (var n in e) n === "default" || Object.prototype.hasOwnProperty.call(t, n) || r(t, e, n);
2630
+ };
2631
+ Object.defineProperty(t, "__esModule", { value: !0 }), i(n(7436), t), i(n(2315), t), i(n(258), t), i(n(107), t), i(n(3039), t), i(n(2339), t), i(n(3435), t), i(n(3556), t), i(n(8098), t), i(n(8214), t), i(n(1858), t), i(n(2712), t), i(n(3167), t), i(n(672), t), i(n(7376), t), i(n(2184), t), i(n(6739), t), i(n(2817), t), i(n(72), t), i(n(212), t), i(n(2006), t), i(n(4531), t), i(n(3043), t), i(n(3845), t), i(n(6940), t), i(n(4591), t), i(n(4029), t), i(n(9579), t), i(n(2639), t), i(n(5633), t), i(n(9692), t), i(n(4204), t), i(n(8570), t), i(n(6386), t), i(n(41), t);
2632
+ },
2633
+ 6782(e, t, n) {
2634
+ function r(e, t) {
2635
+ return t ||= {}, new Promise(function(n, r) {
2636
+ var i = new XMLHttpRequest(), a = [], o = [], s = {}, c = function() {
2637
+ return {
2638
+ ok: (i.status / 100 | 0) == 2,
2639
+ statusText: i.statusText,
2640
+ status: i.status,
2641
+ url: i.responseURL,
2642
+ text: function() {
2643
+ return Promise.resolve(i.responseText);
2644
+ },
2645
+ json: function() {
2646
+ return Promise.resolve(i.responseText).then(JSON.parse);
2647
+ },
2648
+ blob: function() {
2649
+ return Promise.resolve(new Blob([i.response]));
2650
+ },
2651
+ clone: c,
2652
+ headers: {
2653
+ keys: function() {
2654
+ return a;
2655
+ },
2656
+ entries: function() {
2657
+ return o;
2658
+ },
2659
+ get: function(e) {
2660
+ return s[e.toLowerCase()];
2661
+ },
2662
+ has: function(e) {
2663
+ return e.toLowerCase() in s;
2664
+ }
2665
+ }
2666
+ };
2667
+ };
2668
+ for (var l in i.open(t.method || "get", e, !0), i.onload = function() {
2669
+ i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(e, t, n) {
2670
+ a.push(t = t.toLowerCase()), o.push([t, n]), s[t] = s[t] ? s[t] + "," + n : n;
2671
+ }), n(c());
2672
+ }, i.onerror = r, i.withCredentials = t.credentials == "include", t.headers) i.setRequestHeader(l, t.headers[l]);
2673
+ i.send(t.body || null);
2674
+ });
2675
+ }
2676
+ n.r(t), n.d(t, { default: () => r });
2677
+ }
2678
+ }, t = {};
2679
+ function n(r) {
2680
+ var i = t[r];
2681
+ if (i !== void 0) return i.exports;
2682
+ var a = t[r] = { exports: {} };
2683
+ return e[r].call(a.exports, a, a.exports, n), a.exports;
2684
+ }
2685
+ return n.d = (e, t) => {
2686
+ for (var r in t) n.o(t, r) && !n.o(e, r) && Object.defineProperty(e, r, {
2687
+ enumerable: !0,
2688
+ get: t[r]
2689
+ });
2690
+ }, n.g = function() {
2691
+ if (typeof globalThis == "object") return globalThis;
2692
+ try {
2693
+ return this || Function("return this")();
2694
+ } catch {
2695
+ if (typeof window == "object") return window;
2696
+ }
2697
+ }(), n.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), n.r = (e) => {
2698
+ typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 });
2699
+ }, n(8156);
2700
+ })());
2701
+ })), z = vt();
2702
+ function B(e) {
2703
+ return e.getServices().find((e) => e.getProfile && z.Utils.isImageProfile(e.getProfile() || "") || z.Utils.isImageServiceType(e.getIIIFResourceType() || ""));
2704
+ }
2705
+ //#endregion
2706
+ //#region src/lib/MiradorCanvas.js
2707
+ var yt = class {
2708
+ constructor(e) {
2709
+ this.canvas = e;
2710
+ }
2711
+ get id() {
2712
+ return this.canvas.id;
2713
+ }
2714
+ getWidth() {
2715
+ return this.canvas.getWidth();
2716
+ }
2717
+ getHeight() {
2718
+ return this.canvas.getHeight();
2719
+ }
2720
+ get aspectRatio() {
2721
+ return this.canvas.getWidth() / this.canvas.getHeight();
2722
+ }
2723
+ get annotationListUris() {
2724
+ return Array(this.canvas.__jsonld.otherContent).flat().filter((e) => e && (typeof e == "string" || e["@type"] === "sc:AnnotationList")).map((e) => typeof e == "string" ? e : e["@id"]);
2725
+ }
2726
+ get canvasAnnotationPages() {
2727
+ return Array(this.canvas.__jsonld.annotations).flat().filter((e) => e && e.type === "AnnotationPage");
2728
+ }
2729
+ get imageResource() {
2730
+ return this.imageResources[0];
2731
+ }
2732
+ get imageResources() {
2733
+ return [this.canvas.getImages().map((e) => e.getResource()), this.canvas.getContent().map((e) => e.__jsonld.body.type === "Choice" ? e.__jsonld.body : e.getBody())].flat(Infinity).flatMap((e) => {
2734
+ switch (e.type || e.getProperty("type")) {
2735
+ case "Choice": return new z.Canvas({ images: e.items.map((e) => ({ resource: e })) }, this.canvas.options).getImages().map((e, t) => {
2736
+ let n = e.getResource();
2737
+ return n && (n.preferred = !t), n;
2738
+ });
2739
+ case "oa:Choice": return new z.Canvas({ images: [e.getProperty("default"), e.getProperty("item")].flat(Infinity).map((e) => ({ resource: e })) }, this.canvas.options).getImages().map((e, t) => {
2740
+ let n = e.getResource();
2741
+ return n && (n.preferred = !t), n;
2742
+ });
2743
+ default: {
2744
+ let t = e;
2745
+ return t.preferred = !0, t;
2746
+ }
2747
+ }
2748
+ });
2749
+ }
2750
+ get textResources() {
2751
+ return [this.canvas.getContent().map((e) => e.getBody())].flat(Infinity).filter((e) => e.getProperty("type") === "Text").flat();
2752
+ }
2753
+ get videoResources() {
2754
+ return [this.canvas.getContent().map((e) => e.getBody())].flat(Infinity).filter((e) => e.getProperty("type") === "Video").flat();
2755
+ }
2756
+ get audioResources() {
2757
+ return [this.canvas.getContent().map((e) => e.getBody())].flat(Infinity).filter((e) => e.getProperty("type") === "Sound").flat();
2758
+ }
2759
+ get v2VttContent() {
2760
+ return [this.canvas.getContent().map((e) => e.getBody())].flat(Infinity).filter((e) => e.getProperty("format") === "text/vtt").flat();
2761
+ }
2762
+ get v3VttContent() {
2763
+ return this.canvasAnnotationPages.map((e) => new z.AnnotationPage(e, this.canvas.options).getItems().map((e) => new z.Annotation(e, this.canvas.options).getBody())).flat(Infinity).filter((e) => e.getProperty("format") === "text/vtt").flat();
2764
+ }
2765
+ get resourceAnnotations() {
2766
+ return [this.canvas.getImages(), this.canvas.getContent()].flat(Infinity);
2767
+ }
2768
+ resourceAnnotation(e) {
2769
+ return this.resourceAnnotations.find((t) => t.getResource().id === e || Array(t.getBody()).flat().some((t) => t.id === e));
2770
+ }
2771
+ onFragment(e) {
2772
+ let t = this.resourceAnnotation(e);
2773
+ if (!t) return;
2774
+ let n = t.getProperty("on"), r = t.getProperty("target"), i = (n || r).match(/xywh=(.*)$/);
2775
+ if (i) return i[1].split(",").map((e) => parseInt(e, 10));
2776
+ }
2777
+ get iiifImageResources() {
2778
+ return this.imageResources.filter((e) => e && B(e)?.id);
2779
+ }
2780
+ get imageServiceIds() {
2781
+ return this.iiifImageResources.map((e) => e && B(e)?.id);
2782
+ }
2783
+ get service() {
2784
+ return this.canvas.__jsonld.service;
2785
+ }
2786
+ getLabel(e = void 0) {
2787
+ return this.canvas.getLabel().length > 0 ? this.canvas.getLabel().getValue(e) : String(this.canvas.index + 1);
2788
+ }
2789
+ }, V = class {
2790
+ constructor(e) {
2791
+ this.manifest = e;
2792
+ }
2793
+ get startCanvas() {
2794
+ let e, t = this.manifest.getSequences()[0];
2795
+ if (t) {
2796
+ if (e = t.getProperty("startCanvas"), !e) {
2797
+ let n = this.manifest.getProperty("start") || t.getProperty("start");
2798
+ e = n && (n.id || n.source);
2799
+ }
2800
+ return e && t.getCanvasById(e) || void 0;
2801
+ }
2802
+ }
2803
+ canvasAt(e) {
2804
+ let t = this.manifest.getSequences()[0], n = t && t.getCanvases();
2805
+ return n && n[e];
2806
+ }
2807
+ }, H = _([], (e, t) => (e) => e && new yt(e)), bt = _([], (e) => (e) => e && new V(e));
2808
+ //#endregion
2809
+ //#region src/lib/asArray.js
2810
+ function U(e) {
2811
+ return e === void 0 ? [] : Array.isArray(e) ? e : [e];
2812
+ }
2813
+ //#endregion
2814
+ //#region node_modules/lodash/_arrayAggregator.js
2815
+ var xt = /* @__PURE__ */ T(((e, t) => {
2816
+ function n(e, t, n, r) {
2817
+ for (var i = -1, a = e == null ? 0 : e.length; ++i < a;) {
2818
+ var o = e[i];
2819
+ t(r, o, n(o), e);
2820
+ }
2821
+ return r;
2822
+ }
2823
+ t.exports = n;
2824
+ })), St = /* @__PURE__ */ T(((e, t) => {
2825
+ var n = Me();
2826
+ function r(e, t, r, i) {
2827
+ return n(e, function(e, n, a) {
2828
+ t(i, e, r(e), a);
2829
+ }), i;
2830
+ }
2831
+ t.exports = r;
2832
+ })), Ct = /* @__PURE__ */ T(((e, t) => {
2833
+ var n = xt(), r = St(), i = gt(), a = S();
2834
+ function o(e, t) {
2835
+ return function(o, s) {
2836
+ var c = a(o) ? n : r, l = t ? t() : {};
2837
+ return c(o, e, i(s, 2), l);
2838
+ };
2839
+ }
2840
+ t.exports = o;
2841
+ })), wt = /* @__PURE__ */ h((/* @__PURE__ */ T(((e, t) => {
2842
+ var n = we(), r = Ct(), i = Object.prototype.hasOwnProperty;
2843
+ t.exports = r(function(e, t, r) {
2844
+ i.call(e, r) ? e[r].push(t) : n(e, r, [t]);
2845
+ });
2846
+ })))(), 1);
2847
+ function W(e) {
2848
+ return m(e).companionWindows || p;
2849
+ }
2850
+ var Tt = _([W, (e, { companionWindowId: t }) => t], (e, t) => t && e[t]), Et = _([Tt], (e) => e && e.locale), Dt = _([d, W], (e, t) => e && t[e.thumbnailNavigationId] && t[e.thumbnailNavigationId].position), Ot = _([f, W], (e, t) => (Object.keys(e) || []).reduce((n, r) => ({
2851
+ ...n,
2852
+ [r]: (0, wt.default)(e[r].companionWindowIds || w, (e) => t[e] && t[e].position)
2853
+ }), {})), kt = _([f, W], (e, t) => (Object.keys(e) || []).reduce((n, r) => ({
2854
+ ...n,
2855
+ [r]: (0, wt.default)((e[r].companionWindowIds || w).map((e) => t[e]), (e) => e.position)
2856
+ }), {})), At = _([(e, { windowId: t }) => t, kt], (e, t) => t[e] || p), jt = _([(e, { windowId: t }) => t, Ot], (e, t) => t[e] || p), Mt = _([At, (e, { position: t }) => t], (e, t) => e[t] || w), Nt = _([At, (e, { content: t }) => t], (e, t) => [].concat(...Object.values(e)).filter((e) => e.content === t)), Pt = _([jt, (e, { position: t }) => t], (e, t) => e[t] || w), Ft = _([(e, { position: t }) => t, d], (e, t) => {
2857
+ if (!t) return !1;
2858
+ let { companionAreaOpen: n, sideBarOpen: r } = t;
2859
+ return e !== "left" || !!(n && r);
2860
+ }), It = _([At], (e) => {
2861
+ let t = 0, n = 0;
2862
+ return [].concat(...Object.values(e)).forEach((e) => {
2863
+ e.position.match(/right/) && (t += 235), e.position.match(/bottom/) && (n += 201);
2864
+ }), {
2865
+ height: n,
2866
+ width: t
2867
+ };
2868
+ }), Lt = /* @__PURE__ */ T(((e, t) => {
2869
+ var n = function(e) {
2870
+ return r(e) && !i(e);
2871
+ };
2872
+ function r(e) {
2873
+ return !!e && typeof e == "object";
2874
+ }
2875
+ function i(e) {
2876
+ var t = Object.prototype.toString.call(e);
2877
+ return t === "[object RegExp]" || t === "[object Date]" || o(e);
2878
+ }
2879
+ var a = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
2880
+ function o(e) {
2881
+ return e.$$typeof === a;
2882
+ }
2883
+ function s(e) {
2884
+ return Array.isArray(e) ? [] : {};
2885
+ }
2886
+ function c(e, t) {
2887
+ return t.clone !== !1 && t.isMergeableObject(e) ? g(s(e), e, t) : e;
2888
+ }
2889
+ function l(e, t, n) {
2890
+ return e.concat(t).map(function(e) {
2891
+ return c(e, n);
2892
+ });
2893
+ }
2894
+ function u(e, t) {
2895
+ if (!t.customMerge) return g;
2896
+ var n = t.customMerge(e);
2897
+ return typeof n == "function" ? n : g;
2898
+ }
2899
+ function d(e) {
2900
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
2901
+ return Object.propertyIsEnumerable.call(e, t);
2902
+ }) : [];
2903
+ }
2904
+ function f(e) {
2905
+ return Object.keys(e).concat(d(e));
2906
+ }
2907
+ function p(e, t) {
2908
+ try {
2909
+ return t in e;
2910
+ } catch {
2911
+ return !1;
2912
+ }
2913
+ }
2914
+ function m(e, t) {
2915
+ return p(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
2916
+ }
2917
+ function h(e, t, n) {
2918
+ var r = {};
2919
+ return n.isMergeableObject(e) && f(e).forEach(function(t) {
2920
+ r[t] = c(e[t], n);
2921
+ }), f(t).forEach(function(i) {
2922
+ m(e, i) || (r[i] = p(e, i) && n.isMergeableObject(t[i]) ? u(i, n)(e[i], t[i], n) : c(t[i], n));
2923
+ }), r;
2924
+ }
2925
+ function g(e, t, r) {
2926
+ r ||= {}, r.arrayMerge = r.arrayMerge || l, r.isMergeableObject = r.isMergeableObject || n, r.cloneUnlessOtherwiseSpecified = c;
2927
+ var i = Array.isArray(t);
2928
+ return i === Array.isArray(e) ? i ? r.arrayMerge(e, t, r) : h(e, t, r) : c(t, r);
2929
+ }
2930
+ g.all = function(e, t) {
2931
+ if (!Array.isArray(e)) throw Error("first argument should be an array");
2932
+ return e.reduce(function(e, n) {
2933
+ return g(e, n, t);
2934
+ }, {});
2935
+ }, t.exports = g;
2936
+ })), Rt = /* @__PURE__ */ h(Lt(), 1), zt = [
2937
+ "ar",
2938
+ "fa",
2939
+ "he",
2940
+ "ur"
2941
+ ];
2942
+ function Bt(e) {
2943
+ return e ? zt.includes(e.split("-")[0].toLowerCase()) : !1;
2944
+ }
2945
+ //#endregion
2946
+ //#region src/state/selectors/config.js
2947
+ function G(e) {
2948
+ return m(e || {}).config || p;
2949
+ }
2950
+ function Vt(e) {
2951
+ let t = G(e).export;
2952
+ return Object.entries(t).reduce((t, [n, r]) => (r === !0 ? t[n] = e[n] : r.filter && (t[n] = Object.entries(e[n]).filter(r.filter).reduce((e, [t, n]) => (e[t] = n, e), {})), t), {});
2953
+ }
2954
+ var Ht = _([G], ({ availableLanguages: e, language: t }) => Object.keys(e).map((n) => ({
2955
+ current: n === t,
2956
+ label: e[n],
2957
+ locale: n
2958
+ }))), Ut = _([g, G], (e, t) => e.showZoomControls === void 0 ? t.workspace.showZoomControls : e.showZoomControls), Wt = _([G], ({ theme: e, themes: t, selectedTheme: n, language: r }) => {
2959
+ let i = (0, Rt.default)(e, t[n] || {});
2960
+ return i.direction || !Bt(r) ? i : {
2961
+ ...i,
2962
+ direction: "rtl"
2963
+ };
2964
+ }), Gt = _([G], ({ themes: e }) => Object.keys(e)), Kt = _([G], ({ id: e }) => e), qt = _([G], ({ theme: e, language: t }) => e.direction || (Bt(t) ? "rtl" : "ltr")), Jt = _([G], ({ requests: e }) => e || p), Yt = _([G], ({ thumbnails: e }) => e || p);
2965
+ //#endregion
2966
+ //#region src/lib/ThumbnailFactory.js
2967
+ function Xt(e) {
2968
+ let t = e.getProfile();
2969
+ return t.endsWith("#level1") || t.endsWith("#level2") ? !1 : t === "level0" || z.Utils.isLevel0ImageProfile(t);
2970
+ }
2971
+ function Zt(e) {
2972
+ let t = e.getProfile();
2973
+ return t.endsWith("#level0") || t.endsWith("#level1") ? !1 : t === "level2" || z.Utils.isLevel2ImageProfile(t);
2974
+ }
2975
+ function Qt(e) {
2976
+ return U(e.getProperty("type") || []).some((e) => e.startsWith("ImageService"));
2977
+ }
2978
+ function $t(e) {
2979
+ let t = e && e.getServices().find((e) => Qt(e) || z.Utils.isImageProfile(e.getProfile()));
2980
+ if (t) return t;
2981
+ }
2982
+ var en = class e {
2983
+ constructor(e = {}, { getMiradorCanvas: t, getMiradorManifest: n }) {
2984
+ this.iiifOpts = e, this.getMiradorCanvas = t, this.getMiradorManifest = n;
2985
+ }
2986
+ static staticImageUrl(e) {
2987
+ return {
2988
+ height: e.getProperty("height"),
2989
+ url: e.id,
2990
+ width: e.getProperty("width")
2991
+ };
2992
+ }
2993
+ static getPreferredImage(e) {
2994
+ return e.iiifImageResources[0] || e.imageResource;
2995
+ }
2996
+ static selectBestImageSize(e, t) {
2997
+ let n = U(e.getProperty("sizes")), r = {
2998
+ default: !0,
2999
+ height: e.getProperty("height") || 2 ** 53 - 1,
3000
+ width: e.getProperty("width") || 2 ** 53 - 1
3001
+ }, i = (e) => e.width * e.height - t;
3002
+ if (r = n.reduce((e, t) => {
3003
+ let n = i(t);
3004
+ return n < 0 ? e : Math.abs(n) < Math.abs(i(e)) ? t : e;
3005
+ }, r), r.width * r.height > t * 6 && (r = n.reduce((e, t) => Math.abs(i(t)) < Math.abs(i(e)) ? t : e, r)), !r.default) return r;
3006
+ }
3007
+ iiifThumbnailUrl(t) {
3008
+ let n, r, i, a = 120, o = 120, { maxHeight: s, maxWidth: c } = this.iiifOpts;
3009
+ s && (a = Math.max(s, 120)), c && (o = Math.max(c, 120));
3010
+ let l = $t(t);
3011
+ if (!l) return e.staticImageUrl(t);
3012
+ let u = t.getWidth() && t.getHeight() && t.getWidth() / t.getHeight(), d = c && s ? c * s : a * o, f = e.selectBestImageSize(l, d);
3013
+ if (f) r = f.width, i = f.height, n = `${r},${i}`;
3014
+ else if (Xt(l)) {
3015
+ if (!l.getProperty("height") && !l.getProperty("width")) return e.staticImageUrl(t);
3016
+ } else s && c ? Zt(l) ? (n = `!${o},${a}`, r = o, i = a, u && u > 1 && (i = Math.round(o / u)), u && u < 1 && (r = Math.round(a * u))) : o / a < u ? (n = `${o},`, r = o, u && (i = Math.round(o / u))) : (n = `,${a}`, i = a, u && (r = Math.round(a * u))) : s && !c ? (n = `,${a}`, i = a, u && (r = Math.round(a * u))) : !s && c ? (n = `${o},`, r = o, u && (i = Math.round(o / u))) : (n = ",120", i = 120, u && (r = Math.round(i * u)));
3017
+ let p = z.Utils.getImageQuality(l.getProfile()), m = l.id.replace(/\/+$/, ""), h = this.getFormat(l);
3018
+ return {
3019
+ height: i,
3020
+ url: [
3021
+ m,
3022
+ "full",
3023
+ n,
3024
+ 0,
3025
+ `${p}.${h}`
3026
+ ].join("/"),
3027
+ width: r
3028
+ };
3029
+ }
3030
+ getFormat(e) {
3031
+ let { preferredFormats: t = [] } = this.iiifOpts, n = e.getProperty("preferredFormats");
3032
+ if (!n) return "jpg";
3033
+ let r = n.filter((e) => t.includes(e));
3034
+ return r[0] ? r[0] : !n.includes("jpg") && t.includes("jpg") ? "jpg" : n[0] ? n[0] : "jpg";
3035
+ }
3036
+ getSourceContentResource(t) {
3037
+ let n = t.getThumbnail();
3038
+ if (n) return typeof n.__jsonld == "string" ? n.__jsonld : !t.isCollection() && !t.isManifest() && !t.isCanvas() && t.getType() === "image" && $t(t) && !$t(n) ? t : n;
3039
+ if (t.isCollection()) {
3040
+ let e = t.getManifests()[0];
3041
+ return e ? this.getSourceContentResource(e) : void 0;
3042
+ }
3043
+ if (t.isManifest()) {
3044
+ let e = this.getMiradorManifest(t), n = e.startCanvas || e.canvasAt(0);
3045
+ return n ? this.getSourceContentResource(n) : void 0;
3046
+ }
3047
+ if (t.isCanvas()) {
3048
+ let n = e.getPreferredImage(this.getMiradorCanvas(t));
3049
+ return n ? this.getSourceContentResource(n) : void 0;
3050
+ }
3051
+ if (t.getType() === "image") return t;
3052
+ }
3053
+ get(e) {
3054
+ if (!e) return;
3055
+ let t = this.getSourceContentResource(e);
3056
+ if (t) return typeof t == "string" ? { url: t } : this.iiifThumbnailUrl(t);
3057
+ }
3058
+ };
3059
+ function tn(e, t = {}) {
3060
+ return new en(t, {
3061
+ getMiradorCanvas: (e) => new yt(e),
3062
+ getMiradorManifest: (e) => new V(e)
3063
+ }).get(e);
3064
+ }
3065
+ //#endregion
3066
+ //#region src/state/selectors/thumbnails.js
3067
+ var nn = _([
3068
+ Yt,
3069
+ (e, t, n) => t,
3070
+ (e, t, n) => n
3071
+ ], (e, t, n) => ({
3072
+ maxHeight: t,
3073
+ maxWidth: n,
3074
+ preferredFormats: e.preferredFormats
3075
+ })), rn = _([
3076
+ nn,
3077
+ H,
3078
+ bt
3079
+ ], (e, t, n) => new en(e, {
3080
+ getMiradorCanvas: t,
3081
+ getMiradorManifest: n
3082
+ }));
3083
+ //#endregion
3084
+ //#region src/state/selectors/manifests.js
3085
+ function an(e, t) {
3086
+ if (!e) return;
3087
+ let n = z.Utils.parseManifest(structuredClone(e), t ? { locale: t } : void 0);
3088
+ if (n) return typeof n.getSequences != "function" && (n.getSequences = () => []), n;
3089
+ }
3090
+ var K = _([
3091
+ Et,
3092
+ G,
3093
+ (e, { locale: t }) => t
3094
+ ], (e, t = {}, n) => n || e || t.language || t.fallbackLanguages), on = Object.freeze({ missing: !0 }), sn = _([v], (e) => e || on), cn = _([v], (e) => e && e.error), ln = _(v, (e) => e && an(e.json)), q = _(ln, (e, { json: t }) => t, (e, t) => t && an(t) || e), J = _([q, K], (e, t) => t ?? (e && e.options && e.options.locale && e.options.locale.replace(/-.*$/, "")));
3095
+ function Y(e) {
3096
+ return _([q], (t) => t && t.getProperty(e));
3097
+ }
3098
+ var un = _([Y("provider"), J], (e, t) => e && e[0].label && z.PropertyValue.parse(e[0].label).getValue(t)), dn = Object.freeze({}), fn = _([Y("provider"), (e) => rn(e, dn)], (e, t) => {
3099
+ let n = e && e[0] && e[0].logo && e[0].logo[0];
3100
+ return n ? t.get(new z.Resource(n))?.url : null;
3101
+ }), pn = _([q, fn], (e, t) => t || e && e.getLogo()), mn = _([Y("homepage"), J], (e, t) => e && U(e).map((e) => ({
3102
+ label: z.PropertyValue.parse(e.label).getValue(t),
3103
+ value: e.id || e["@id"]
3104
+ }))), hn = _([q, J], (e, t) => e && e.getRenderings().map((e) => ({
3105
+ label: e.getLabel().getValue(t),
3106
+ value: e.id
3107
+ }))), gn = _([Y("seeAlso"), J], (e, t) => e && U(e).map((e) => ({
3108
+ format: e.format,
3109
+ label: z.PropertyValue.parse(e.label).getValue(t),
3110
+ value: e.id || e["@id"]
3111
+ }))), _n = gn, vn = _([Y("related"), J], (e, t) => e && U(e).map((e) => typeof e == "string" ? { value: e } : {
3112
+ format: e.format,
3113
+ label: z.PropertyValue.parse(e.label).getValue(t),
3114
+ value: e.id || e["@id"]
3115
+ })), yn = _([K, q], (e, t) => t && U(t.getRequiredStatement()).flatMap((t) => {
3116
+ let n = t?.getValues(e) ?? [];
3117
+ if (!n.length) return [];
3118
+ let r = t?.getLabels(e) ?? [];
3119
+ return Array.from({ length: Math.max(r.length, n.length) }, (e, t) => t).filter((e) => n[e]).map((e) => ({
3120
+ label: r[e] ?? null,
3121
+ values: [n[e]]
3122
+ }));
3123
+ })), bn = _([
3124
+ Y("rights"),
3125
+ Y("license"),
3126
+ J
3127
+ ], (e, t, n) => {
3128
+ let r = e || t;
3129
+ return U(z.PropertyValue.parse(r).getValues(n));
3130
+ });
3131
+ function xn(e, t) {
3132
+ let n = q(e, t), r = rn(e, 80, 120);
3133
+ if (!n) return;
3134
+ let i = r.get(n);
3135
+ return i && i.url;
3136
+ }
3137
+ var Sn = _([q, J], (e, t) => e && e.getLabel().getValue(t)), Cn = _([K, q], (e, t) => t && t.getDescription().getValue(e)), wn = _([Y("summary"), J], (e, t) => e && z.PropertyValue.parse(e).getValue(t)), Tn = _([q], (e) => e && e.id);
3138
+ function En(e, t = void 0) {
3139
+ return e && e.getMetadata().map((e) => ({
3140
+ label: e.getLabel(t),
3141
+ values: e.getValues(t)
3142
+ }));
3143
+ }
3144
+ var Dn = _([q, J], (e, t) => e && En(e, t));
3145
+ function On(e) {
3146
+ let t = /* @__PURE__ */ new Set([]), n = (e) => {
3147
+ if (e && typeof e == "object") {
3148
+ if (e["@language"] && e["@value"]) {
3149
+ t.add(e["@language"]);
3150
+ return;
3151
+ }
3152
+ Object.keys(e).forEach((e) => {
3153
+ t.add(e);
3154
+ });
3155
+ }
3156
+ };
3157
+ return Array.isArray(e) ? e.forEach((e) => n(e)) : n(e), [...t];
3158
+ }
3159
+ function kn(e) {
3160
+ if (!e) return [];
3161
+ let t = e.getProperty("metadata") || [], n = {};
3162
+ for (let e = 0; e < t.length; e += 1) {
3163
+ let r = t[e];
3164
+ On(r.label).forEach((e) => {
3165
+ n[e] = !0;
3166
+ }), On(r.value).forEach((e) => {
3167
+ n[e] = !0;
3168
+ });
3169
+ }
3170
+ return Object.keys(n);
3171
+ }
3172
+ var An = _([q], (e) => kn(e)), jn = _([q], (e) => e && (e.getService("http://iiif.io/api/search/0/search") || e.getService("http://iiif.io/api/search/1/search")) || null), Mn = _([jn], (e) => {
3173
+ let t = e && (e.getService("http://iiif.io/api/search/0/autocomplete") || e.getService("http://iiif.io/api/search/1/autocomplete"));
3174
+ return t && t;
3175
+ }), Nn = _([q], (e) => {
3176
+ if (!e || !e.getTopRanges) return null;
3177
+ let t = e.getTopRanges(), n = t.filter((e) => e.getProperty("viewingHint") === "top"), r = [];
3178
+ return n.length === 0 && t.length === 1 && (r = t[0].getRanges().filter((e) => e.getBehavior() === "sequence")), [].concat(e.getSequences(), r);
3179
+ }), X = _([
3180
+ Nn,
3181
+ d,
3182
+ (e, { sequenceId: t }) => t
3183
+ ], (e, t, n) => {
3184
+ if (!e) return null;
3185
+ if (n || t && t.sequenceId) {
3186
+ let r = e.find((e) => e.id === (n || t.sequenceId));
3187
+ if (r) return r;
3188
+ }
3189
+ return e[0];
3190
+ }), Pn = _([d, X], (e, t) => (t && e && e.canvasId && t.getCanvasById(e.canvasId) || {}).index || 0), Fn = _([X, q], (e, t) => t && (e && e.getViewingHint() || t.getViewingHint()) || null), In = _([
3191
+ d,
3192
+ X,
3193
+ q
3194
+ ], (e, t, n) => e && e.viewingDirection || t && t.getViewingDirection() || n && n.getViewingDirection() || null), Ln = _([X, q], (e, t) => {
3195
+ if (!t || !e) return [];
3196
+ let n = e && e.getProperty("behavior");
3197
+ if (n) return Array.isArray(n) ? n : [n];
3198
+ let r = t.getProperty("behavior");
3199
+ return r ? Array.isArray(r) ? r : [r] : [];
3200
+ }), Rn = _([X, q], (e, t) => e && e.getProperty("type") && e.isRange() ? e.getTree(new z.TreeNode("root")) : t && t.getDefaultTree());
3201
+ //#endregion
3202
+ //#region src/state/selectors/workspace.js
3203
+ function zn(e) {
3204
+ return m(e).elasticLayout;
3205
+ }
3206
+ var Bn = _([g], (e) => e.isFullscreenEnabled);
3207
+ function Vn(e) {
3208
+ let [t] = m(e).errors.items;
3209
+ return m(e).errors[t];
3210
+ }
3211
+ var Hn = _([g], ({ type: e }) => e), Un = _([g], ({ focusedWindowId: e }) => e), Wn = (e, { windowId: t }) => Un(e) === t, Gn = _([G, d], ({ window: e }, t = {}) => ({
3212
+ ...e,
3213
+ ...t
3214
+ }));
3215
+ function Kn(e) {
3216
+ let t = {};
3217
+ return Object.keys(f(e)).forEach((n) => {
3218
+ t[n] = Sn(e, { windowId: n });
3219
+ }), t;
3220
+ }
3221
+ var qn = _([f], (e) => Object.values(e).filter((e) => e.maximized === !0).map((e) => e.id)), Jn = _([
3222
+ d,
3223
+ Gn,
3224
+ Fn,
3225
+ Ln
3226
+ ], (e, { views: t = [], defaultView: n }, r, i) => {
3227
+ if (e && e.view) return e.view;
3228
+ let a = (t || []).find((e) => e.behaviors && e.behaviors.some((e) => r === e || i.includes(e)));
3229
+ return a && a.key || n;
3230
+ }), Yn = _([
3231
+ Fn,
3232
+ Ln,
3233
+ Gn
3234
+ ], (e, t, { views: n = [], defaultView: r }) => (n || []).reduce((n, i) => ((i.key === r || !i.behaviors || i.behaviors.some((n) => e === n || t.includes(n))) && n.push(i.key), n), [])), Xn = _([
3235
+ Hn,
3236
+ d,
3237
+ (e) => b(e).length > 1
3238
+ ], (e, t, n) => e === "elastic" || n && t && t.maximized === !1), Zn = (e) => m(e).infoResponses, Qn = _([X], (e) => e && e.getCanvases() || w), Z = _([X, (e, { canvasId: t }) => t], (e, t) => {
3239
+ if (!(!e || !t)) return e.getCanvasById(t);
3240
+ }), $n = _([X, d], (e, t) => {
3241
+ if (!(!e || !t)) return t.canvasId ? e.getCanvasById(t.canvasId) : e.getCanvasByIndex(0);
3242
+ }), er = _([d], (e) => e && (e.visibleCanvases || e.canvasId && [e.canvasId]) || w), Q = _([er, Qn], (e, t) => (t || []).filter((t) => e.includes(t.id))), $ = _([Qn, Jn], (e, t) => e && new _t(e, t).groupings()), tr = _([$, (e, { canvasId: t }) => t], (e, t) => e && e.find((e) => e.some((e) => e.id === t)) || w), nr = _([$, $n], (e, t, n) => {
3243
+ if (!e || !t) return;
3244
+ let r = e.findIndex((e) => e.some((e) => e.id === t.id));
3245
+ if (!(r < 0 || r + 1 >= e.length)) return e[r + 1];
3246
+ }), rr = _([$, $n], (e, t, n) => {
3247
+ if (!e || !t) return;
3248
+ let r = e.findIndex((e) => e.some((e) => e.id === t.id));
3249
+ if (!(r < 1)) return e[r - 1];
3250
+ }), ir = _([Z, J], (e, t) => e && (e.getLabel().length > 0 ? e.getLabel().getValue(t) : String(e.index + 1))), ar = _([Z, J], (e, t) => e && En(e, t)), or = _([Z], (e) => e && e.getProperty("description")), sr = _([Q, H], (e, t) => e.flatMap((e) => t(e).imageResources).filter((e) => !B(e))), cr = _([Q, H], (e, t) => e.flatMap((e) => t(e).textResources)), lr = _([Q, H], (e, t) => e.flatMap((e) => t(e).videoResources)), ur = _([Q, H], (e, t) => e.flatMap((e) => {
3251
+ let n = t(e);
3252
+ return n.v3VttContent.length ? n.v3VttContent : n.v2VttContent;
3253
+ })), dr = _([Q, H], (e, t) => e.flatMap((e) => t(e).audioResources)), fr = _([
3254
+ (e, { infoId: t }) => t,
3255
+ Z,
3256
+ H,
3257
+ Zn
3258
+ ], (e, t, n, r) => {
3259
+ let i = e;
3260
+ if (!e) {
3261
+ if (!t) return;
3262
+ let e = n(t).iiifImageResources[0];
3263
+ i = e && B(e)?.id;
3264
+ }
3265
+ return i && r[i] && !r[i].isFetching && r[i];
3266
+ });
3267
+ //#endregion
3268
+ export { gn as $, Ve as $t, Hn as A, Nt as At, K as B, B as Bt, Xn as C, Yt as Ct, Un as D, Pt as Dt, zn as E, Tt as Et, Rn as F, U as Ft, J as G, $e as Gt, Cn as H, _t as Ht, In as I, H as It, un as J, Xe as Jt, pn as K, Qe as Kt, Fn as L, bt as Lt, Pn as M, Dt as Mt, X as N, It as Nt, Bn as O, Et as Ot, Ln as P, Ct as Pt, jn as Q, Ue as Qt, Nn as R, V as Rt, Gn as S, Gt as St, Jn as T, Ft as Tt, cn as U, gt as Ut, Mn as V, vt as Vt, mn as W, nt as Wt, _n as X, qe as Xt, vn as Y, Ye as Yt, hn as Z, Ge as Zt, Q as _, Ht as _t, ir as a, we as an, q as at, Yn as b, Wt as bt, $n as c, I as cn, yn as ct, dr as d, ye as dn, rn as dt, Re as en, sn as et, ur as f, j as fn, en as ft, lr as g, Vt as gt, cr as h, Kt as ht, $ as i, Te as in, Tn as it, Wn as j, Mt as jt, Vn as k, W as kt, nr as l, Se as ln, bn as lt, sr as m, G as mt, or as n, R as nn, xn as nt, ar as o, Ce as on, An as ot, er as p, tn as pt, Dn as q, Ze as qt, tr as r, ke as rn, Sn as rt, Qn as s, L as sn, fn as st, Z as t, Me as tn, wn as tt, rr as u, be as un, nn as ut, fr as v, Jt as vt, Kn as w, Lt as wt, qn as x, qt as xt, Zn as y, Ut as yt, En as z, yt as zt };
3269
+
3270
+ //# sourceMappingURL=canvases-DTR37lo-.js.map