react-iiif-vault 1.0.9 → 1.0.10
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.
- package/.build/types/hooks/useExistingVault.d.ts +2 -1
- package/.build/types/viewers/SimpleViewerContext.types.d.ts +2 -0
- package/README.md +495 -177
- package/dist/bundle/cjs/index.js +7 -7
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +384 -395
- package/dist/bundle/esm/index.mjs.map +1 -1
- package/dist/canvas-panel/cjs/canvas-panel.js +5 -5
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -1
- package/dist/canvas-panel/esm/canvas-panel.mjs +379 -390
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -1
- package/dist/index.umd.js +53 -53
- package/dist/index.umd.js.map +1 -1
- package/dist/react17/cjs/index.js +7 -7
- package/dist/react17/cjs/index.js.map +1 -1
- package/dist/react17/esm/index.mjs +384 -395
- package/dist/react17/esm/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as d, jsxs as X, Fragment as Oe } from "react/jsx-runtime";
|
|
2
|
-
import Ie, { createContext as xe, Component as
|
|
3
|
-
import { AtlasAuto as
|
|
4
|
-
import { globalVault as
|
|
2
|
+
import Ie, { createContext as xe, Component as wn, createElement as St, isValidElement as Pn, useContext as ue, useMemo as N, useState as ie, useEffect as be, useCallback as Q, useRef as Ee, useLayoutEffect as st, Fragment as Ye, useReducer as On, forwardRef as ct, useImperativeHandle as It } from "react";
|
|
3
|
+
import { AtlasAuto as Sn, ModeContext as xn, mergeStyles as Tn, RegionHighlight as En, TileSet as In, HTMLPortal as Cn, useCanvas as jn } from "@atlas-viewer/atlas";
|
|
4
|
+
import { globalVault as Ct, Vault as xt } from "@iiif/helpers/vault";
|
|
5
5
|
import { createStylesHelper as ut } from "@iiif/helpers/styles";
|
|
6
6
|
import { expandTarget as ot } from "@iiif/helpers/annotation-targets";
|
|
7
7
|
export * from "@iiif/helpers/annotation-targets";
|
|
8
|
-
import { expandTarget as
|
|
9
|
-
import { ImageServiceLoader as
|
|
10
|
-
import { createThumbnailHelper as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
8
|
+
import { expandTarget as Mn } from "@iiif/helpers";
|
|
9
|
+
import { ImageServiceLoader as Rn, getImageServices as it, createImageServiceRequest as Ln, imageServiceRequestToString as An } from "@atlas-viewer/iiif-image-api";
|
|
10
|
+
import { createThumbnailHelper as kn } from "@iiif/helpers/thumbnail";
|
|
11
|
+
import Nn from "react-dom";
|
|
12
|
+
const Vn = xe(null), tt = {
|
|
13
13
|
didCatch: !1,
|
|
14
14
|
error: null
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class _n extends wn {
|
|
17
17
|
constructor(t) {
|
|
18
18
|
super(t), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = tt;
|
|
19
19
|
}
|
|
@@ -46,7 +46,7 @@ class Vn extends bn {
|
|
|
46
46
|
} = this.state, {
|
|
47
47
|
resetKeys: r
|
|
48
48
|
} = this.props;
|
|
49
|
-
if (o && n.error !== null &&
|
|
49
|
+
if (o && n.error !== null && Dn(t.resetKeys, r)) {
|
|
50
50
|
var a, i;
|
|
51
51
|
(a = (i = this.props).onReset) === null || a === void 0 || a.call(i, {
|
|
52
52
|
next: r,
|
|
@@ -74,13 +74,13 @@ class Vn extends bn {
|
|
|
74
74
|
if (typeof n == "function")
|
|
75
75
|
s = n(f);
|
|
76
76
|
else if (o)
|
|
77
|
-
s =
|
|
78
|
-
else if (r === null ||
|
|
77
|
+
s = St(o, f);
|
|
78
|
+
else if (r === null || Pn(r))
|
|
79
79
|
s = r;
|
|
80
80
|
else
|
|
81
81
|
throw i;
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return St(Vn.Provider, {
|
|
84
84
|
value: {
|
|
85
85
|
didCatch: a,
|
|
86
86
|
error: i,
|
|
@@ -89,18 +89,18 @@ class Vn extends bn {
|
|
|
89
89
|
}, s);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Dn() {
|
|
93
93
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
94
94
|
return e.length !== t.length || e.some((n, o) => !Object.is(n, t[o]));
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const Bn = {
|
|
97
97
|
collection: void 0,
|
|
98
98
|
manifest: void 0,
|
|
99
99
|
range: void 0,
|
|
100
100
|
canvas: void 0,
|
|
101
101
|
annotation: void 0,
|
|
102
102
|
annotationPage: void 0
|
|
103
|
-
}, lt = Ie.createContext(
|
|
103
|
+
}, lt = Ie.createContext(Bn), je = () => ue(lt);
|
|
104
104
|
function Le({ value: e, children: t }) {
|
|
105
105
|
const n = je(), o = N(() => ({
|
|
106
106
|
...n,
|
|
@@ -113,24 +113,22 @@ const Ke = Ie.createContext({
|
|
|
113
113
|
setVaultInstance: (e) => {
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
|
-
function
|
|
116
|
+
function ft({
|
|
117
117
|
vault: e,
|
|
118
118
|
vaultOptions: t,
|
|
119
119
|
useGlobal: n,
|
|
120
120
|
resources: o,
|
|
121
121
|
children: r
|
|
122
122
|
}) {
|
|
123
|
-
const [a, i] =
|
|
123
|
+
const [a, i] = ie(() => e || (n ? Ct(t) : t ? new xt(t) : new xt()));
|
|
124
124
|
return /* @__PURE__ */ d(Ke.Provider, { value: { vault: a, setVaultInstance: i }, children: /* @__PURE__ */ d(Le, { value: o || {}, children: r }) });
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
};
|
|
132
|
-
function Ct(e, { noCache: t = !1 } = {}) {
|
|
133
|
-
const n = typeof e == "string" ? e : e.id, o = re(), [r, a] = ae(n), [i, s] = ae(void 0), f = N(() => o.get(n, { skipSelfReturn: !0 }) || void 0, [n, o]), [h, u] = ae(f);
|
|
126
|
+
function dt(e) {
|
|
127
|
+
const t = ue(Ke);
|
|
128
|
+
return e || (t && t.vault ? t.vault : Ct());
|
|
129
|
+
}
|
|
130
|
+
function jt(e, { noCache: t = !1 } = {}) {
|
|
131
|
+
const n = typeof e == "string" ? e : e.id, o = dt(), [r, a] = ie(n), [i, s] = ie(void 0), f = N(() => o.get(n, { skipSelfReturn: !0 }) || void 0, [n, o]), [h, u] = ie(f);
|
|
134
132
|
return be(() => {
|
|
135
133
|
(async () => {
|
|
136
134
|
try {
|
|
@@ -149,21 +147,27 @@ function Ct(e, { noCache: t = !1 } = {}) {
|
|
|
149
147
|
cached: !!(h && h === f)
|
|
150
148
|
};
|
|
151
149
|
}
|
|
152
|
-
function
|
|
153
|
-
const { id: n, isLoaded: o, error: r, resource: a, requestId: i, cached: s } =
|
|
150
|
+
function qn(e, t) {
|
|
151
|
+
const { id: n, isLoaded: o, error: r, resource: a, requestId: i, cached: s } = jt(
|
|
154
152
|
e,
|
|
155
153
|
t
|
|
156
154
|
);
|
|
157
155
|
return { id: n, isLoaded: o, error: r, manifest: a, requestId: i, cached: s };
|
|
158
156
|
}
|
|
159
|
-
function
|
|
157
|
+
function Fn({ manifest: e, children: t }) {
|
|
160
158
|
return /* @__PURE__ */ d(Le, { value: { manifest: e }, children: t });
|
|
161
159
|
}
|
|
162
160
|
function Qe({ canvas: e, children: t }) {
|
|
163
161
|
return /* @__PURE__ */ d(Le, { value: { canvas: e }, children: t });
|
|
164
162
|
}
|
|
163
|
+
const ae = () => {
|
|
164
|
+
const { vault: e } = ue(Ke);
|
|
165
|
+
if (e === null)
|
|
166
|
+
throw new Error("Vault not found. Ensure you have your provider set up correctly.");
|
|
167
|
+
return e;
|
|
168
|
+
};
|
|
165
169
|
function ye(e, t = []) {
|
|
166
|
-
const n =
|
|
170
|
+
const n = ae(), [o, r] = ie(() => e(n.getState(), n));
|
|
167
171
|
return be(() => n.subscribe(
|
|
168
172
|
(a) => e(a, n),
|
|
169
173
|
(a) => {
|
|
@@ -173,7 +177,7 @@ function ye(e, t = []) {
|
|
|
173
177
|
), t), o;
|
|
174
178
|
}
|
|
175
179
|
const Ge = Ie.createContext([]);
|
|
176
|
-
function
|
|
180
|
+
function Mt() {
|
|
177
181
|
const e = ue(Ge);
|
|
178
182
|
return ye(
|
|
179
183
|
(t) => e.map((n) => t.iiif.entities.Canvas[n]).filter(Boolean),
|
|
@@ -182,7 +186,7 @@ function jt() {
|
|
|
182
186
|
}
|
|
183
187
|
function Ce(e = {}, t = []) {
|
|
184
188
|
const { id: n, selector: o } = e, r = je();
|
|
185
|
-
|
|
189
|
+
ae();
|
|
186
190
|
const a = n || r.manifest, i = ye(
|
|
187
191
|
(s) => a ? s.iiif.entities.Manifest[a] : void 0,
|
|
188
192
|
[a]
|
|
@@ -192,28 +196,28 @@ function Ce(e = {}, t = []) {
|
|
|
192
196
|
return o ? o(i) : i;
|
|
193
197
|
}, [i, o, ...t]);
|
|
194
198
|
}
|
|
195
|
-
function
|
|
199
|
+
function Un({ range: e, children: t }) {
|
|
196
200
|
return /* @__PURE__ */ d(Le, { value: { range: e }, children: t });
|
|
197
201
|
}
|
|
198
|
-
function
|
|
202
|
+
function $n(e, t) {
|
|
199
203
|
for (const n of t.items) {
|
|
200
204
|
if (n.type === "Canvas")
|
|
201
205
|
return n;
|
|
202
206
|
if (n.type === "SpecificResource")
|
|
203
207
|
return n.source;
|
|
204
208
|
if (n.type === "Range") {
|
|
205
|
-
const o =
|
|
209
|
+
const o = $n(e, e.get(n));
|
|
206
210
|
if (o)
|
|
207
211
|
return o;
|
|
208
212
|
}
|
|
209
213
|
}
|
|
210
214
|
return null;
|
|
211
215
|
}
|
|
212
|
-
function
|
|
216
|
+
function Rt(e, t) {
|
|
213
217
|
var o;
|
|
214
218
|
const n = [];
|
|
215
219
|
for (const r of t.items)
|
|
216
|
-
if (r.type === "SpecificResource" && ((o = r.source) == null ? void 0 : o.type) === "Canvas" && (r.source.id.indexOf("#") !== -1 ? n.push({ id: r.source.id.split("#")[0], type: "Canvas" }) : n.push(r.source)), r.type === "Range" && n.push(...
|
|
220
|
+
if (r.type === "SpecificResource" && ((o = r.source) == null ? void 0 : o.type) === "Canvas" && (r.source.id.indexOf("#") !== -1 ? n.push({ id: r.source.id.split("#")[0], type: "Canvas" }) : n.push(r.source)), r.type === "Range" && n.push(...Rt(e, e.get(r))), r.type === "SpecificResource") {
|
|
217
221
|
const a = typeof r.source == "string" ? r.source : r.source.id;
|
|
218
222
|
n.push({ id: a, type: "Canvas" });
|
|
219
223
|
}
|
|
@@ -221,20 +225,20 @@ function Mt(e, t) {
|
|
|
221
225
|
}
|
|
222
226
|
function Po(e, t, n) {
|
|
223
227
|
for (const o of t.structures) {
|
|
224
|
-
const r =
|
|
228
|
+
const r = Lt(e, e.get(o), n);
|
|
225
229
|
if (r)
|
|
226
230
|
return r;
|
|
227
231
|
}
|
|
228
232
|
return null;
|
|
229
233
|
}
|
|
230
|
-
function
|
|
234
|
+
function Lt(e, t, n) {
|
|
231
235
|
var o, r, a;
|
|
232
236
|
for (const i of t.items) {
|
|
233
237
|
const s = (r = (o = i == null ? void 0 : i.source) == null ? void 0 : o.id) == null ? void 0 : r.split("#")[0];
|
|
234
238
|
if (i.type === "SpecificResource" && i.source === n || i.type === "SpecificResource" && ((a = i.source) == null ? void 0 : a.type) === "Canvas" && n === s)
|
|
235
239
|
return t;
|
|
236
240
|
if (i.type === "Range") {
|
|
237
|
-
const f =
|
|
241
|
+
const f = Lt(e, e.get(i), n);
|
|
238
242
|
if (f)
|
|
239
243
|
return f;
|
|
240
244
|
}
|
|
@@ -248,7 +252,7 @@ function Oo(e, t, n, o = !1) {
|
|
|
248
252
|
const i = a.behavior, s = o ? !1 : r.includes("paged"), f = s ? !1 : r.includes("continuous"), h = s || f ? !1 : r.includes("individuals"), u = i.includes("facing-pages"), y = i.includes("non-paged");
|
|
249
253
|
if (u || y || h || o)
|
|
250
254
|
return [{ id: a.id, type: "Canvas" }];
|
|
251
|
-
const [x, M] =
|
|
255
|
+
const [x, M] = At(e, t);
|
|
252
256
|
if (f)
|
|
253
257
|
return x;
|
|
254
258
|
const I = x.findIndex((b) => b.id === n);
|
|
@@ -259,8 +263,8 @@ function Oo(e, t, n, o = !1) {
|
|
|
259
263
|
return b.map((E) => x[E]);
|
|
260
264
|
return [{ id: a.id, type: "Canvas" }];
|
|
261
265
|
}
|
|
262
|
-
function
|
|
263
|
-
const r = t.behavior, a = r.includes("paged"), i = a ? !1 : r.includes("continuous"), s = a || i ? !1 : r.includes("individuals"), f = t.type === "Manifest" ? t.items :
|
|
266
|
+
function At(e, t, { disablePaging: n, skipNonPaged: o } = {}) {
|
|
267
|
+
const r = t.behavior, a = r.includes("paged"), i = a ? !1 : r.includes("continuous"), s = a || i ? !1 : r.includes("individuals"), f = t.type === "Manifest" ? t.items : Rt(e, t);
|
|
264
268
|
if (i)
|
|
265
269
|
return [f, [f.map((I, b) => b)]];
|
|
266
270
|
if (s || !a || n)
|
|
@@ -289,21 +293,21 @@ function Lt(e, t, { disablePaging: n, skipNonPaged: o } = {}) {
|
|
|
289
293
|
}
|
|
290
294
|
return u.length && y(), [f, h];
|
|
291
295
|
}
|
|
292
|
-
function
|
|
296
|
+
function kt(e = {}, t = []) {
|
|
293
297
|
const { id: n, selector: o } = e, r = je(), a = n || r.range, i = ye((s) => a ? s.iiif.entities.Range[a] : void 0, [a]);
|
|
294
298
|
return N(() => {
|
|
295
299
|
if (i)
|
|
296
300
|
return o ? o(i) : i;
|
|
297
301
|
}, [i, o, ...t]);
|
|
298
302
|
}
|
|
299
|
-
function
|
|
303
|
+
function Wn({ startCanvas: e, disablePaging: t }) {
|
|
300
304
|
var I;
|
|
301
|
-
const n =
|
|
305
|
+
const n = ae(), o = Ce(), r = kt(), [a, i] = ie(void 0), s = r || o;
|
|
302
306
|
if (!s)
|
|
303
307
|
throw new Error("Nothing selected");
|
|
304
308
|
const [f, h] = N(
|
|
305
|
-
() =>
|
|
306
|
-
[n, s]
|
|
309
|
+
() => At(n, s, { disablePaging: t }),
|
|
310
|
+
[n, s, t]
|
|
307
311
|
), u = Q(
|
|
308
312
|
(b) => {
|
|
309
313
|
const E = h.findIndex((C) => C.includes(b));
|
|
@@ -348,7 +352,7 @@ const De = () => {
|
|
|
348
352
|
hasNext: !1,
|
|
349
353
|
hasPrevious: !1
|
|
350
354
|
});
|
|
351
|
-
function
|
|
355
|
+
function Hn(e) {
|
|
352
356
|
const t = Ce(), {
|
|
353
357
|
cursor: n,
|
|
354
358
|
visibleItems: o,
|
|
@@ -361,7 +365,7 @@ function Wn(e) {
|
|
|
361
365
|
setSequenceIndex: u,
|
|
362
366
|
hasNext: y,
|
|
363
367
|
hasPrevious: x
|
|
364
|
-
} =
|
|
368
|
+
} = Wn({
|
|
365
369
|
startCanvas: e.startCanvas,
|
|
366
370
|
disablePaging: e.pagingEnabled === !1
|
|
367
371
|
}), M = N(
|
|
@@ -383,21 +387,21 @@ function Wn(e) {
|
|
|
383
387
|
);
|
|
384
388
|
return t ? o.length === 0 ? null : /* @__PURE__ */ d(Xe.Provider, { value: M, children: /* @__PURE__ */ d(Ge.Provider, { value: o, children: /* @__PURE__ */ d(Qe, { canvas: o[0], children: e.children }) }) }) : (console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ d("div", { children: "Sorry, something went wrong." }));
|
|
385
389
|
}
|
|
386
|
-
function
|
|
387
|
-
const t =
|
|
388
|
-
if (!
|
|
390
|
+
function Yn(e) {
|
|
391
|
+
const t = dt(e.vault), n = qn(e.manifest);
|
|
392
|
+
if (!n)
|
|
389
393
|
return console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ d("div", { children: "Sorry, something went wrong." });
|
|
390
|
-
if (
|
|
391
|
-
return /* @__PURE__ */ d("div", { children:
|
|
392
|
-
if (!
|
|
394
|
+
if (n.error)
|
|
395
|
+
return /* @__PURE__ */ d("div", { children: n.error.toString() });
|
|
396
|
+
if (!n.isLoaded)
|
|
393
397
|
return /* @__PURE__ */ d("div", { children: "Loading..." });
|
|
394
|
-
const
|
|
395
|
-
return /* @__PURE__ */ d(
|
|
398
|
+
const o = /* @__PURE__ */ d(Hn, { ...e, children: e.children });
|
|
399
|
+
return /* @__PURE__ */ d(ft, { vault: t, children: /* @__PURE__ */ d(Fn, { manifest: n.id, children: e.rangeId ? /* @__PURE__ */ d(Un, { range: e.rangeId, children: o }) : o }) });
|
|
396
400
|
}
|
|
397
|
-
function
|
|
401
|
+
function Nt() {
|
|
398
402
|
return ue(Xe);
|
|
399
403
|
}
|
|
400
|
-
function
|
|
404
|
+
function zn() {
|
|
401
405
|
return {
|
|
402
406
|
VaultContext: ue(Ke),
|
|
403
407
|
ResourceContext: ue(lt),
|
|
@@ -405,8 +409,8 @@ function Yn() {
|
|
|
405
409
|
VisibleCanvasReactContext: ue(Ge)
|
|
406
410
|
};
|
|
407
411
|
}
|
|
408
|
-
function
|
|
409
|
-
return /* @__PURE__ */ d(
|
|
412
|
+
function Kn(e) {
|
|
413
|
+
return /* @__PURE__ */ d(ft, { vault: e.bridge.VaultContext.vault || void 0, resources: e.bridge.ResourceContext, children: /* @__PURE__ */ d(Ge.Provider, { value: e.bridge.VisibleCanvasReactContext, children: /* @__PURE__ */ d(Xe.Provider, { value: e.bridge.SimpleViewerReactContext, children: e.children }) }) });
|
|
410
414
|
}
|
|
411
415
|
const Te = function(e) {
|
|
412
416
|
return function() {
|
|
@@ -417,27 +421,27 @@ const Te = function(e) {
|
|
|
417
421
|
...o !== void 0 && { meta: o }
|
|
418
422
|
});
|
|
419
423
|
};
|
|
420
|
-
},
|
|
421
|
-
importEntities:
|
|
422
|
-
modifyEntityField:
|
|
423
|
-
reorderEntityField:
|
|
424
|
-
addReference:
|
|
425
|
-
removeReference:
|
|
426
|
-
updateReference:
|
|
427
|
-
addMetadata:
|
|
428
|
-
removeMetadata:
|
|
429
|
-
updateMetadata:
|
|
430
|
-
reorderMetadata:
|
|
424
|
+
}, Qn = "@iiif/IMPORT_ENTITIES", Gn = "@iiif/MODIFY_ENTITY_FIELD", Xn = "@iiif/REORDER_ENTITY_FIELD", Jn = "@iiif/ADD_REFERENCE", Zn = "@iiif/UPDATE_REFERENCE", er = "@iiif/REMOVE_REFERENCE", tr = "@iiif/ADD_METADATA", nr = "@iiif/REMOVE_METADATA", rr = "@iiif/UPDATE_METADATA", or = "@iiif/REORDER_METADATA", ir = Te(Qn)(), ar = Te(Gn)(), sr = Te(Xn)(), cr = Te(Jn)(), ur = Te(er)(), lr = Te(Zn)(), fr = Te(tr)(), dr = Te(rr)(), pr = Te(nr)(), hr = Te(or)(), nt = {
|
|
425
|
+
importEntities: ir,
|
|
426
|
+
modifyEntityField: ar,
|
|
427
|
+
reorderEntityField: sr,
|
|
428
|
+
addReference: cr,
|
|
429
|
+
removeReference: ur,
|
|
430
|
+
updateReference: lr,
|
|
431
|
+
addMetadata: fr,
|
|
432
|
+
removeMetadata: pr,
|
|
433
|
+
updateMetadata: dr,
|
|
434
|
+
reorderMetadata: hr
|
|
431
435
|
};
|
|
432
|
-
function
|
|
433
|
-
const t =
|
|
436
|
+
function yr() {
|
|
437
|
+
const t = ae().getStore();
|
|
434
438
|
return N(() => (n) => t.dispatch(n), [t]);
|
|
435
439
|
}
|
|
436
|
-
function
|
|
440
|
+
function Tt(e) {
|
|
437
441
|
return typeof e != "string" && e && e.bindToVault;
|
|
438
442
|
}
|
|
439
|
-
function
|
|
440
|
-
const e =
|
|
443
|
+
function gr() {
|
|
444
|
+
const e = ae(), t = Ee([]), n = yr(), o = N(() => `vault://annotation-page/${(/* @__PURE__ */ new Date()).getTime()}/${Math.round(Math.random() * 1e9).toString(16)}`, []);
|
|
441
445
|
st(() => {
|
|
442
446
|
const s = {
|
|
443
447
|
id: o,
|
|
@@ -472,7 +476,7 @@ function yr() {
|
|
|
472
476
|
), a = Q(
|
|
473
477
|
(s, f) => {
|
|
474
478
|
if (o) {
|
|
475
|
-
if (
|
|
479
|
+
if (Tt(s)) {
|
|
476
480
|
const y = s;
|
|
477
481
|
y.__vault || y.bindToVault(e), s = typeof y.source == "string" ? y.source : y.source.id, t.current[s] = y;
|
|
478
482
|
} else
|
|
@@ -495,7 +499,7 @@ function yr() {
|
|
|
495
499
|
[o]
|
|
496
500
|
), i = Q(
|
|
497
501
|
(s) => {
|
|
498
|
-
o && (
|
|
502
|
+
o && (Tt(s) ? s = typeof s.source == "string" ? s.source : s.source.id : typeof s != "string" && (s = s.id), t.current[s] && t.current[s].beforeRemove(), e.get({ id: o, type: "AnnotationPage" }) && n(
|
|
499
503
|
nt.removeReference({
|
|
500
504
|
id: o,
|
|
501
505
|
type: "AnnotationPage",
|
|
@@ -517,9 +521,9 @@ function yr() {
|
|
|
517
521
|
}
|
|
518
522
|
];
|
|
519
523
|
}
|
|
520
|
-
const
|
|
521
|
-
function
|
|
522
|
-
const e = ue(
|
|
524
|
+
const Vt = xe(null);
|
|
525
|
+
function mr() {
|
|
526
|
+
const e = ue(Vt);
|
|
523
527
|
return [
|
|
524
528
|
e.fullPage,
|
|
525
529
|
{
|
|
@@ -528,17 +532,17 @@ function gr() {
|
|
|
528
532
|
}
|
|
529
533
|
];
|
|
530
534
|
}
|
|
531
|
-
function
|
|
532
|
-
const [t, { addAnnotation: n, removeAnnotation: o }] =
|
|
535
|
+
function vr({ children: e }) {
|
|
536
|
+
const [t, { addAnnotation: n, removeAnnotation: o }] = gr();
|
|
533
537
|
return /* @__PURE__ */ d(
|
|
534
|
-
|
|
538
|
+
Vt.Provider,
|
|
535
539
|
{
|
|
536
540
|
value: N(() => ({ fullPage: t, addAnnotation: n, removeAnnotation: o }), [t]),
|
|
537
541
|
children: e
|
|
538
542
|
}
|
|
539
543
|
);
|
|
540
544
|
}
|
|
541
|
-
function
|
|
545
|
+
function br({
|
|
542
546
|
width: e,
|
|
543
547
|
style: t,
|
|
544
548
|
height: n,
|
|
@@ -551,19 +555,19 @@ function vr({
|
|
|
551
555
|
/* @__PURE__ */ d("button", { onClick: r, children: "Reset" })
|
|
552
556
|
] });
|
|
553
557
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
556
|
-
return ue(
|
|
558
|
+
const pt = xe(null);
|
|
559
|
+
function wr() {
|
|
560
|
+
return ue(pt);
|
|
557
561
|
}
|
|
558
|
-
const
|
|
562
|
+
const _t = xe(
|
|
559
563
|
() => {
|
|
560
564
|
}
|
|
561
|
-
),
|
|
565
|
+
), Dt = xe(
|
|
562
566
|
() => {
|
|
563
567
|
}
|
|
564
568
|
);
|
|
565
569
|
function Ve(e, t, n, o, r = []) {
|
|
566
|
-
const a = ue(e === "portal" ?
|
|
570
|
+
const a = ue(e === "portal" ? Dt : _t);
|
|
567
571
|
be(() => (e !== "none" && a(t, n, o), () => {
|
|
568
572
|
a(t, null);
|
|
569
573
|
}), [t, e, a, ...r]);
|
|
@@ -575,21 +579,21 @@ function Se(e = {}, t = []) {
|
|
|
575
579
|
return o ? o(i) : i;
|
|
576
580
|
}, [i, o, ...t]);
|
|
577
581
|
}
|
|
578
|
-
const
|
|
582
|
+
const Bt = xe(() => {
|
|
579
583
|
});
|
|
580
|
-
function
|
|
581
|
-
const t = Se(), n = ue(
|
|
584
|
+
function Pr(e) {
|
|
585
|
+
const t = Se(), n = ue(Bt);
|
|
582
586
|
be(() => t && t.id ? (n(t.id, e), () => n(t.id, -1)) : () => {
|
|
583
587
|
}, [t, e]);
|
|
584
588
|
}
|
|
585
|
-
function
|
|
589
|
+
function Or({
|
|
586
590
|
children: e,
|
|
587
591
|
errorFallback: t,
|
|
588
592
|
outerContainerProps: n = {},
|
|
589
593
|
worldScale: o,
|
|
590
594
|
...r
|
|
591
595
|
}) {
|
|
592
|
-
const [a, i] =
|
|
596
|
+
const [a, i] = ie(), s = zn(), f = t || br, [h, u] = ie({}), y = Object.entries(h), [x, M] = ie({}), I = Object.entries(x), [b, E] = ie({}), C = N(() => o || Math.max(...Object.values(b)), [b]), A = N(() => ({ maxOverZoom: C || 1, ...r.runtimeOptions || {} }), [C, r.runtimeOptions]), S = Q((R, B) => {
|
|
593
597
|
E((j) => {
|
|
594
598
|
if (B === -1) {
|
|
595
599
|
const { [R]: O, ...U } = j;
|
|
@@ -608,9 +612,9 @@ function Pr({
|
|
|
608
612
|
[R]: { element: B, props: j }
|
|
609
613
|
} : U);
|
|
610
614
|
}, []);
|
|
611
|
-
return /* @__PURE__ */ X(
|
|
615
|
+
return /* @__PURE__ */ X(_n, { resetKeys: [], fallbackRender: (R) => /* @__PURE__ */ d(f, { ...r, ...R }), children: [
|
|
612
616
|
/* @__PURE__ */ d(
|
|
613
|
-
|
|
617
|
+
Sn,
|
|
614
618
|
{
|
|
615
619
|
...r,
|
|
616
620
|
containerProps: { style: { position: "relative" }, ...r.containerProps || {} },
|
|
@@ -619,18 +623,18 @@ function Pr({
|
|
|
619
623
|
i(R), r.onCreated && r.onCreated(R);
|
|
620
624
|
},
|
|
621
625
|
runtimeOptions: A,
|
|
622
|
-
children: /* @__PURE__ */ d(
|
|
626
|
+
children: /* @__PURE__ */ d(pt.Provider, { value: a, children: /* @__PURE__ */ d(Bt.Provider, { value: S, children: /* @__PURE__ */ d(_t.Provider, { value: F, children: /* @__PURE__ */ d(Dt.Provider, { value: L, children: /* @__PURE__ */ d(Kn, { bridge: s, children: /* @__PURE__ */ d(xn.Provider, { value: r.mode || "explore", children: /* @__PURE__ */ d(vr, { children: e }) }) }) }) }) }) })
|
|
623
627
|
}
|
|
624
628
|
),
|
|
625
629
|
/* @__PURE__ */ d("div", { children: I.map(([R, { element: B, props: j }]) => /* @__PURE__ */ d(Ie.Fragment, { children: /* @__PURE__ */ d(B, { ...j || {} }) }, R)) })
|
|
626
630
|
] });
|
|
627
631
|
}
|
|
628
|
-
const We = {},
|
|
632
|
+
const We = {}, qt = {
|
|
629
633
|
get(e) {
|
|
630
634
|
return e;
|
|
631
635
|
},
|
|
632
636
|
setMetaValue([e, t, n], o) {
|
|
633
|
-
const r =
|
|
637
|
+
const r = qt.getResourceMeta(e, t), a = r ? r[n] : void 0, i = typeof o == "function" ? o(a) : o;
|
|
634
638
|
We[e] = {
|
|
635
639
|
...We[e] || {},
|
|
636
640
|
[t]: {
|
|
@@ -645,7 +649,7 @@ const We = {}, Bt = {
|
|
|
645
649
|
return t ? n[t] : n;
|
|
646
650
|
}
|
|
647
651
|
};
|
|
648
|
-
function
|
|
652
|
+
function Ft(e = qt) {
|
|
649
653
|
return {
|
|
650
654
|
addEventListener(t, n, o, r) {
|
|
651
655
|
if (t)
|
|
@@ -682,12 +686,12 @@ function qt(e = Bt) {
|
|
|
682
686
|
}
|
|
683
687
|
};
|
|
684
688
|
}
|
|
685
|
-
function
|
|
686
|
-
const n =
|
|
689
|
+
function Ut(e, t) {
|
|
690
|
+
const n = ae(), o = N(() => Ft(n), [n]), r = ye(() => e && e.id ? n.getResourceMeta(e.id, "eventManager") : null, [e]);
|
|
687
691
|
return N(() => e ? o.getListenersAsProps(e, t) : {}, [r, e, n, t]);
|
|
688
692
|
}
|
|
689
693
|
function ze(e, t) {
|
|
690
|
-
const n =
|
|
694
|
+
const n = ae(), o = N(() => ut(n), [n]);
|
|
691
695
|
return ye(() => {
|
|
692
696
|
if (!e)
|
|
693
697
|
return null;
|
|
@@ -695,8 +699,8 @@ function ze(e, t) {
|
|
|
695
699
|
return r ? t ? r[t] : r : void 0;
|
|
696
700
|
}, [e, t]);
|
|
697
701
|
}
|
|
698
|
-
function
|
|
699
|
-
const { id: n, selector: o } = e, r = je(), a =
|
|
702
|
+
function $t(e = {}, t = []) {
|
|
703
|
+
const { id: n, selector: o } = e, r = je(), a = ae(), i = n || r.annotation, s = ye(
|
|
700
704
|
(h) => i ? h.iiif.entities.Annotation[i] : void 0,
|
|
701
705
|
[i]
|
|
702
706
|
), f = ye(
|
|
@@ -717,15 +721,15 @@ function Ut(e = {}, t = []) {
|
|
|
717
721
|
return o ? o(h) : h;
|
|
718
722
|
}, [s, o, f, ...t]);
|
|
719
723
|
}
|
|
720
|
-
const
|
|
724
|
+
const Wt = ({
|
|
721
725
|
id: e,
|
|
722
726
|
style: t,
|
|
723
727
|
className: n,
|
|
724
728
|
interactive: o
|
|
725
729
|
}) => {
|
|
726
|
-
const r =
|
|
730
|
+
const r = $t({ id: e }), a = ze(r, "atlas"), i = ze(r, "html"), s = Ut(r, ["atlas"]), f = Se(), h = N(() => Tn(t, a), [t, a]);
|
|
727
731
|
return f && r && r.target && r.target.selector && r.target.selector.type === "BoxSelector" && r.target.source && (r.target.source.id === f.id || r.target.source === f.id) ? /* @__PURE__ */ d(
|
|
728
|
-
|
|
732
|
+
En,
|
|
729
733
|
{
|
|
730
734
|
id: r.id,
|
|
731
735
|
isEditing: !0,
|
|
@@ -742,7 +746,7 @@ const $t = ({
|
|
|
742
746
|
}
|
|
743
747
|
) : null;
|
|
744
748
|
};
|
|
745
|
-
function
|
|
749
|
+
function Sr(e = {}, t = []) {
|
|
746
750
|
const { id: n, selector: o } = e, r = je(), a = n || r.annotationPage, i = ye(
|
|
747
751
|
(s) => a ? s.iiif.entities.AnnotationPage[a] : void 0,
|
|
748
752
|
[a]
|
|
@@ -757,9 +761,9 @@ const at = ({
|
|
|
757
761
|
page: t
|
|
758
762
|
}) => {
|
|
759
763
|
var a;
|
|
760
|
-
const n =
|
|
764
|
+
const n = Sr({ id: t.id }) || t, o = ze(n, "atlas"), r = ze(n, "html");
|
|
761
765
|
return ye((i) => n.id ? i.iiif.entities.AnnotationPage[n.id] : null, []), /* @__PURE__ */ d(Ye, { children: (a = n.items) == null ? void 0 : a.map((i) => /* @__PURE__ */ d(
|
|
762
|
-
|
|
766
|
+
Wt,
|
|
763
767
|
{
|
|
764
768
|
id: i.id,
|
|
765
769
|
style: o,
|
|
@@ -768,7 +772,7 @@ const at = ({
|
|
|
768
772
|
i.id
|
|
769
773
|
)) });
|
|
770
774
|
};
|
|
771
|
-
function
|
|
775
|
+
function Ht({
|
|
772
776
|
id: e,
|
|
773
777
|
image: t,
|
|
774
778
|
thumbnail: n,
|
|
@@ -795,7 +799,7 @@ function Wt({
|
|
|
795
799
|
onClick: f,
|
|
796
800
|
children: t.service ? /* @__PURE__ */ X(Ye, { children: [
|
|
797
801
|
/* @__PURE__ */ d(
|
|
798
|
-
|
|
802
|
+
In,
|
|
799
803
|
{
|
|
800
804
|
tiles: {
|
|
801
805
|
id: t.service.id || t.service["@id"] || "unknown",
|
|
@@ -836,8 +840,8 @@ function Wt({
|
|
|
836
840
|
function So(e) {
|
|
837
841
|
return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
|
|
838
842
|
}
|
|
839
|
-
function
|
|
840
|
-
const { selector: n, source: o } =
|
|
843
|
+
function Yt(e, t) {
|
|
844
|
+
const { selector: n, source: o } = Mn(t);
|
|
841
845
|
if (o.id !== e.id)
|
|
842
846
|
return [null, o];
|
|
843
847
|
const r = {
|
|
@@ -858,16 +862,16 @@ function Ht(e, t) {
|
|
|
858
862
|
o
|
|
859
863
|
];
|
|
860
864
|
}
|
|
861
|
-
const
|
|
865
|
+
const xr = {
|
|
862
866
|
makeChoice: () => {
|
|
863
867
|
}
|
|
864
|
-
}, rt = { type: "unknown" }, ne = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }),
|
|
865
|
-
function
|
|
868
|
+
}, rt = { type: "unknown" }, ne = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }), Tr = (e, t) => ({ type: "empty", width: e, height: t, annotations: { pages: [] }, image: null, images: [] });
|
|
869
|
+
function Er(e, t) {
|
|
866
870
|
var o;
|
|
867
871
|
const n = (o = e == null ? void 0 : e.iiif) == null ? void 0 : o.meta[t];
|
|
868
872
|
return n ? n.annotationPageManager : null;
|
|
869
873
|
}
|
|
870
|
-
function
|
|
874
|
+
function Ir(e, t) {
|
|
871
875
|
return ye(
|
|
872
876
|
(n) => {
|
|
873
877
|
const o = [];
|
|
@@ -876,7 +880,7 @@ function Er(e, t) {
|
|
|
876
880
|
const r = Object.keys(n.iiif.entities.AnnotationPage);
|
|
877
881
|
for (const a of r)
|
|
878
882
|
if (!t || t.indexOf(a) !== -1) {
|
|
879
|
-
const i =
|
|
883
|
+
const i = Er(n, a);
|
|
880
884
|
i && i.views && i.views[e] && o.push(a);
|
|
881
885
|
}
|
|
882
886
|
return o;
|
|
@@ -884,7 +888,7 @@ function Er(e, t) {
|
|
|
884
888
|
[e, t]
|
|
885
889
|
);
|
|
886
890
|
}
|
|
887
|
-
function
|
|
891
|
+
function Cr({
|
|
888
892
|
canvas: e,
|
|
889
893
|
manifest: t,
|
|
890
894
|
all: n,
|
|
@@ -904,18 +908,18 @@ function Ir({
|
|
|
904
908
|
r.indexOf(a.id) === -1 && r.push(a.id);
|
|
905
909
|
return r;
|
|
906
910
|
}
|
|
907
|
-
function
|
|
911
|
+
function jr(e, t) {
|
|
908
912
|
var o;
|
|
909
913
|
const n = (o = e == null ? void 0 : e.iiif) == null ? void 0 : o.meta[t];
|
|
910
914
|
return n ? n.annotationPageManager : null;
|
|
911
915
|
}
|
|
912
|
-
function
|
|
913
|
-
const n =
|
|
916
|
+
function zt(e, t = {}) {
|
|
917
|
+
const n = ae(), o = Ce(), r = Se(), a = Mt(), i = N(() => Cr({
|
|
914
918
|
all: t.all,
|
|
915
919
|
manifest: o,
|
|
916
920
|
canvas: r,
|
|
917
921
|
canvases: a
|
|
918
|
-
}), [t.all, r, a, o]), s =
|
|
922
|
+
}), [t.all, r, a, o]), s = Ir(e, t.all ? void 0 : i), f = Q(
|
|
919
923
|
(u) => {
|
|
920
924
|
e && n.setMetaValue(
|
|
921
925
|
[u, "annotationPageManager", "views"],
|
|
@@ -934,7 +938,7 @@ function Yt(e, t = {}) {
|
|
|
934
938
|
if (y != null && y.deselectOthers) {
|
|
935
939
|
const I = Object.keys(x.iiif.entities.AnnotationPage);
|
|
936
940
|
for (const b of I) {
|
|
937
|
-
const E =
|
|
941
|
+
const E = jr(x, b);
|
|
938
942
|
E && E.views && E.views[e] && M.push(b);
|
|
939
943
|
}
|
|
940
944
|
}
|
|
@@ -957,15 +961,15 @@ function Yt(e, t = {}) {
|
|
|
957
961
|
setPageDisabled: f
|
|
958
962
|
};
|
|
959
963
|
}
|
|
960
|
-
function
|
|
964
|
+
function Mr(e, t) {
|
|
961
965
|
return ye((n, o) => o.get(e.map((r) => ({ id: r, type: t }))), [e, t]);
|
|
962
966
|
}
|
|
963
|
-
const
|
|
967
|
+
const Rr = Ie.createContext(new Rn());
|
|
964
968
|
function Je() {
|
|
965
|
-
return ue(
|
|
969
|
+
return ue(Rr);
|
|
966
970
|
}
|
|
967
|
-
function
|
|
968
|
-
const e = Je(), [t, n] =
|
|
971
|
+
function Lr() {
|
|
972
|
+
const e = Je(), [t, n] = ie({}), o = Ee(!1);
|
|
969
973
|
return be(() => () => {
|
|
970
974
|
o.current = !0;
|
|
971
975
|
}, []), [Q(
|
|
@@ -996,8 +1000,8 @@ function Rr() {
|
|
|
996
1000
|
[e, t]
|
|
997
1001
|
), t];
|
|
998
1002
|
}
|
|
999
|
-
function
|
|
1000
|
-
const t =
|
|
1003
|
+
function ht(e = {}) {
|
|
1004
|
+
const t = $t(), n = Se(e.canvasId ? { id: e.canvasId } : void 0);
|
|
1001
1005
|
return ye(
|
|
1002
1006
|
(o, r) => {
|
|
1003
1007
|
if (!n)
|
|
@@ -1012,15 +1016,15 @@ function dt(e = {}) {
|
|
|
1012
1016
|
[n]
|
|
1013
1017
|
);
|
|
1014
1018
|
}
|
|
1015
|
-
function
|
|
1019
|
+
function Ar(e) {
|
|
1016
1020
|
return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
|
|
1017
1021
|
}
|
|
1018
|
-
const He = {},
|
|
1022
|
+
const He = {}, Kt = {
|
|
1019
1023
|
get(e) {
|
|
1020
1024
|
return e;
|
|
1021
1025
|
},
|
|
1022
1026
|
setMetaValue([e, t, n], o) {
|
|
1023
|
-
const r =
|
|
1027
|
+
const r = Kt.getResourceMeta(e, t), a = r ? r[n] : void 0, i = typeof o == "function" ? o(a) : o;
|
|
1024
1028
|
He[e] = {
|
|
1025
1029
|
...He[e] || {},
|
|
1026
1030
|
[t]: {
|
|
@@ -1035,7 +1039,7 @@ const He = {}, zt = {
|
|
|
1035
1039
|
return t ? n[t] : n;
|
|
1036
1040
|
}
|
|
1037
1041
|
};
|
|
1038
|
-
function
|
|
1042
|
+
function kr(e = Kt) {
|
|
1039
1043
|
function t(r) {
|
|
1040
1044
|
const a = r ? typeof r == "string" ? e.get(r) : r : null;
|
|
1041
1045
|
if (!a)
|
|
@@ -1054,7 +1058,7 @@ function Ar(e = zt) {
|
|
|
1054
1058
|
throw new Error("getPaintables() accept either a canvas or list of annotations");
|
|
1055
1059
|
const y = Array.from(Array.isArray(u.body) ? u.body : [u.body]);
|
|
1056
1060
|
for (const x of y) {
|
|
1057
|
-
const [M, { selector: I }] =
|
|
1061
|
+
const [M, { selector: I }] = Ar(x), b = e.get(M), E = (b.type || "unknown").toLowerCase();
|
|
1058
1062
|
if (E === "choice") {
|
|
1059
1063
|
const C = e.get(b.items, { parent: b.id }), A = a.length ? a.map((S) => C.find((F) => F.id === S)).filter(Boolean) : [C[0]];
|
|
1060
1064
|
A.length === 0 && A.push(C[0]), f = {
|
|
@@ -1093,8 +1097,8 @@ function Ar(e = zt) {
|
|
|
1093
1097
|
extractChoices: o
|
|
1094
1098
|
};
|
|
1095
1099
|
}
|
|
1096
|
-
function
|
|
1097
|
-
const n =
|
|
1100
|
+
function Nr(e, t = []) {
|
|
1101
|
+
const n = ae(), o = N(() => kr(n), []), r = ht({ enableSingleAnnotation: e == null ? void 0 : e.enableSingleAnnotation }), [a, i] = ie((e == null ? void 0 : e.defaultChoices) || []), s = N(
|
|
1098
1102
|
() => o.getPaintables(r, a),
|
|
1099
1103
|
[n, r, a, ...t]
|
|
1100
1104
|
), h = { makeChoice: Q(
|
|
@@ -1126,15 +1130,15 @@ function kr(e, t = []) {
|
|
|
1126
1130
|
) };
|
|
1127
1131
|
return [s, h];
|
|
1128
1132
|
}
|
|
1129
|
-
const
|
|
1130
|
-
function
|
|
1133
|
+
const Vr = ["model/gltf-binary"];
|
|
1134
|
+
function _r(e, t) {
|
|
1131
1135
|
const o = t.items[0].resource;
|
|
1132
|
-
return o.format ?
|
|
1136
|
+
return o.format ? Vr.indexOf(o.format) === -1 ? ne(`3D format: ${o.format} is unsupported`) : {
|
|
1133
1137
|
type: "3d-model",
|
|
1134
1138
|
model: o
|
|
1135
1139
|
} : ne("Unknown format");
|
|
1136
1140
|
}
|
|
1137
|
-
function
|
|
1141
|
+
function Dr(e, t) {
|
|
1138
1142
|
var o;
|
|
1139
1143
|
if (!e.duration)
|
|
1140
1144
|
return ne("No duration on canvas");
|
|
@@ -1169,7 +1173,7 @@ function _r(e, t) {
|
|
|
1169
1173
|
}
|
|
1170
1174
|
} : ne("Audio does not have format") : ne("Unknown audio");
|
|
1171
1175
|
}
|
|
1172
|
-
function
|
|
1176
|
+
function Br(e, t, n) {
|
|
1173
1177
|
const o = [];
|
|
1174
1178
|
for (const r of t.items) {
|
|
1175
1179
|
const a = r.resource && r.resource.type === "SpecificResource" ? r.resource.source : r.resource;
|
|
@@ -1188,7 +1192,7 @@ function Dr(e, t, n) {
|
|
|
1188
1192
|
width: Number(e.width),
|
|
1189
1193
|
height: Number(e.height)
|
|
1190
1194
|
}
|
|
1191
|
-
}, [f, h] =
|
|
1195
|
+
}, [f, h] = Yt(e, r.target);
|
|
1192
1196
|
if (!(h.id === e.id || decodeURIComponent(h.id || "") === (e.id || "")))
|
|
1193
1197
|
continue;
|
|
1194
1198
|
r.resource.width && r.resource.height && (r.resource.width, r.resource.height);
|
|
@@ -1231,7 +1235,7 @@ function Dr(e, t, n) {
|
|
|
1231
1235
|
choice: t.choice
|
|
1232
1236
|
};
|
|
1233
1237
|
}
|
|
1234
|
-
function
|
|
1238
|
+
function Qt(e, t = {}, n) {
|
|
1235
1239
|
const o = e.language || n || "none";
|
|
1236
1240
|
switch (e.type) {
|
|
1237
1241
|
case "TextualBody": {
|
|
@@ -1241,24 +1245,24 @@ function Kt(e, t = {}, n) {
|
|
|
1241
1245
|
case "List":
|
|
1242
1246
|
case "Composite":
|
|
1243
1247
|
case "Choice":
|
|
1244
|
-
e.items && e.items.forEach((r) =>
|
|
1248
|
+
e.items && e.items.forEach((r) => Qt(r, t, o));
|
|
1245
1249
|
}
|
|
1246
1250
|
return t;
|
|
1247
1251
|
}
|
|
1248
|
-
function
|
|
1252
|
+
function qr(e, t) {
|
|
1249
1253
|
const n = [];
|
|
1250
1254
|
return t.items.forEach((o) => {
|
|
1251
1255
|
if (o.resource) {
|
|
1252
|
-
const [r] =
|
|
1253
|
-
n.push({ annotationId: o.annotationId, text:
|
|
1256
|
+
const [r] = Yt(e, o.target);
|
|
1257
|
+
n.push({ annotationId: o.annotationId, text: Qt(o.resource), target: r });
|
|
1254
1258
|
}
|
|
1255
1259
|
}), {
|
|
1256
1260
|
type: "textual-content",
|
|
1257
1261
|
items: n
|
|
1258
1262
|
};
|
|
1259
1263
|
}
|
|
1260
|
-
const
|
|
1261
|
-
function
|
|
1264
|
+
const Fr = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
|
|
1265
|
+
function Ur(e, t) {
|
|
1262
1266
|
var s;
|
|
1263
1267
|
const n = t.items.filter((f) => f.type === "video");
|
|
1264
1268
|
let o = !1;
|
|
@@ -1297,7 +1301,7 @@ function Fr(e, t) {
|
|
|
1297
1301
|
};
|
|
1298
1302
|
if (a) {
|
|
1299
1303
|
i.type = "VideoYouTube";
|
|
1300
|
-
const f = r.id.match(
|
|
1304
|
+
const f = r.id.match(Fr);
|
|
1301
1305
|
if (!f[1])
|
|
1302
1306
|
return ne("Video is not known youtube video");
|
|
1303
1307
|
i.youTubeId = f[1];
|
|
@@ -1310,30 +1314,30 @@ function Fr(e, t) {
|
|
|
1310
1314
|
}
|
|
1311
1315
|
};
|
|
1312
1316
|
}
|
|
1313
|
-
function
|
|
1317
|
+
function $r({ canvas: e, paintables: t, supports: n, loadImageService: o }) {
|
|
1314
1318
|
if (!e)
|
|
1315
1319
|
return console.log("No canvas"), rt;
|
|
1316
1320
|
if (t.types.length === 0)
|
|
1317
|
-
return n.indexOf("empty") !== -1 ?
|
|
1321
|
+
return n.indexOf("empty") !== -1 ? Tr(e.width, e.height) : (console.log("No paintables"), rt);
|
|
1318
1322
|
if (t.types.length !== 1)
|
|
1319
1323
|
if (t.types.length === 2 && t.types.indexOf("text") !== -1)
|
|
1320
1324
|
t.types = t.types.filter((a) => a !== "text");
|
|
1321
1325
|
else
|
|
1322
1326
|
return n.indexOf("complex-timeline") === -1 ? ne("Complex timeline not supported") : ne("ComplexTimelineStrategy not yet supported");
|
|
1323
1327
|
const r = t.types[0];
|
|
1324
|
-
return r === "image" ? n.indexOf("images") === -1 ? ne("Image not supported") :
|
|
1328
|
+
return r === "image" ? n.indexOf("images") === -1 ? ne("Image not supported") : Br(e, t, o) : r === "Model" || r === "model" ? n.indexOf("3d-model") === -1 ? ne("3D not supported") : _r(e, t) : r === "textualbody" ? n.indexOf("textual-content") === -1 ? ne("Textual content not supported") : qr(e, t) : r === "sound" || r === "audio" ? n.indexOf("media") === -1 ? ne("Media not supported") : Dr(e, t) : r === "video" ? n.indexOf("media") === -1 ? ne("Media not supported") : Ur(e, t) : rt;
|
|
1325
1329
|
}
|
|
1326
|
-
function
|
|
1327
|
-
const t = Ce(), n = Se(), o =
|
|
1330
|
+
function Wr(e) {
|
|
1331
|
+
const t = Ce(), n = Se(), o = ae(), [r, a] = Lr(), { enabledPageIds: i } = zt((e == null ? void 0 : e.annotationPageManagerId) || (t == null ? void 0 : t.id) || (n == null ? void 0 : n.id), {
|
|
1328
1332
|
all: !1
|
|
1329
|
-
}), s =
|
|
1333
|
+
}), s = Mr(i, "AnnotationPage"), f = (e == null ? void 0 : e.strategies) || [
|
|
1330
1334
|
"empty",
|
|
1331
1335
|
"images",
|
|
1332
1336
|
"media",
|
|
1333
1337
|
"textual-content",
|
|
1334
1338
|
"complex-timeline"
|
|
1335
|
-
], [h, u] =
|
|
1336
|
-
return N(() => y.type === "unknown" ? [y,
|
|
1339
|
+
], [h, u] = Nr(e, [a]), y = N(() => $r({ canvas: n, paintables: h, supports: f, loadImageService: r }), [n, h, o, u.makeChoice]);
|
|
1340
|
+
return N(() => y.type === "unknown" ? [y, xr] : [
|
|
1337
1341
|
{
|
|
1338
1342
|
...y,
|
|
1339
1343
|
annotations: { pages: s }
|
|
@@ -1341,19 +1345,19 @@ function $r(e) {
|
|
|
1341
1345
|
u
|
|
1342
1346
|
], [y, s]);
|
|
1343
1347
|
}
|
|
1344
|
-
const
|
|
1345
|
-
const n =
|
|
1348
|
+
const Hr = (e, t = []) => {
|
|
1349
|
+
const n = ae();
|
|
1346
1350
|
be(() => {
|
|
1347
1351
|
e(n);
|
|
1348
1352
|
}, [n, ...t]);
|
|
1349
1353
|
};
|
|
1350
|
-
function
|
|
1351
|
-
const r =
|
|
1354
|
+
function Gt(e, t, { canvasId: n, manifestId: o } = {}) {
|
|
1355
|
+
const r = ae(), a = Je(), i = N(() => kn(r, { imageServiceLoader: a }), [r, a]), [s, f] = ie(), h = Ce(o ? { id: o } : void 0), u = Se(n ? { id: n } : void 0), y = u || h, x = Ee(!1);
|
|
1352
1356
|
if (be(() => (x.current = !1, () => {
|
|
1353
1357
|
x.current = !0;
|
|
1354
1358
|
}), []), !y)
|
|
1355
1359
|
throw new Error("Must be called under a manifest or canvas context.");
|
|
1356
|
-
return
|
|
1360
|
+
return Hr(
|
|
1357
1361
|
(M) => {
|
|
1358
1362
|
i.getBestThumbnailAtSize(y, e, t).then((I) => {
|
|
1359
1363
|
I.best && !x.current && f(I.best);
|
|
@@ -1362,10 +1366,10 @@ function Qt(e, t, { canvasId: n, manifestId: o } = {}) {
|
|
|
1362
1366
|
[y]
|
|
1363
1367
|
), s;
|
|
1364
1368
|
}
|
|
1365
|
-
function
|
|
1369
|
+
function Yr(e) {
|
|
1366
1370
|
return { isMuted: !1, playRequested: !1, isPlaying: !1, isFinished: !1, volume: 100, duration: e };
|
|
1367
1371
|
}
|
|
1368
|
-
function
|
|
1372
|
+
function zr(e, t) {
|
|
1369
1373
|
switch (t.type) {
|
|
1370
1374
|
case "FINISHED":
|
|
1371
1375
|
return { ...e, isFinished: !0, isPlaying: !1, playRequested: !1 };
|
|
@@ -1388,13 +1392,13 @@ function Yr(e, t) {
|
|
|
1388
1392
|
}
|
|
1389
1393
|
return e;
|
|
1390
1394
|
}
|
|
1391
|
-
function
|
|
1395
|
+
function Kr(e) {
|
|
1392
1396
|
const t = Math.round(e);
|
|
1393
1397
|
return `${Math.floor(t / 60)}:${`${t % 60}`.padStart(2, "0")}`;
|
|
1394
1398
|
}
|
|
1395
|
-
function
|
|
1396
|
-
const [t, n] =
|
|
1397
|
-
r.current && o.current && (r.current.innerHTML =
|
|
1399
|
+
function yt(e) {
|
|
1400
|
+
const [t, n] = On(zr, Yr(e.duration)), o = Ee(null), r = Ee(null), a = Ee(null), i = Ee(!1), s = Q(() => {
|
|
1401
|
+
r.current && o.current && (r.current.innerHTML = Kr(o.current.currentTime), a.current && (a.current.style.width = `${o.current.currentTime / e.duration * 100}%`), i.current !== o.current.muted && (i.current = o.current.muted, n(o.current.muted ? { type: "MUTE" } : { type: "UNMUTE" })));
|
|
1398
1402
|
}, [e.duration]), f = Q(() => {
|
|
1399
1403
|
o.current && (n({ type: "PLAY_REQUESTED" }), o.current.play().then(() => {
|
|
1400
1404
|
n({ type: "PLAY" });
|
|
@@ -1442,26 +1446,26 @@ function pt(e) {
|
|
|
1442
1446
|
}
|
|
1443
1447
|
];
|
|
1444
1448
|
}
|
|
1445
|
-
const
|
|
1449
|
+
const Xt = xe(null), Jt = xe(null), Zt = xe(null);
|
|
1446
1450
|
function xo() {
|
|
1447
|
-
const e = ue(
|
|
1451
|
+
const e = ue(Xt);
|
|
1448
1452
|
if (!e)
|
|
1449
1453
|
throw new Error("Ctx not found");
|
|
1450
1454
|
return e;
|
|
1451
1455
|
}
|
|
1452
1456
|
function To() {
|
|
1453
|
-
const e = ue(
|
|
1457
|
+
const e = ue(Jt);
|
|
1454
1458
|
if (!e)
|
|
1455
1459
|
throw new Error("Ctx not found");
|
|
1456
1460
|
return e;
|
|
1457
1461
|
}
|
|
1458
1462
|
function Eo() {
|
|
1459
|
-
const e = ue(
|
|
1463
|
+
const e = ue(Zt);
|
|
1460
1464
|
if (!e)
|
|
1461
1465
|
throw new Error("Ctx not found");
|
|
1462
1466
|
return e;
|
|
1463
1467
|
}
|
|
1464
|
-
function
|
|
1468
|
+
function en({
|
|
1465
1469
|
actions: e,
|
|
1466
1470
|
state: t,
|
|
1467
1471
|
children: n,
|
|
@@ -1469,12 +1473,12 @@ function Zt({
|
|
|
1469
1473
|
progress: r,
|
|
1470
1474
|
element: a
|
|
1471
1475
|
}) {
|
|
1472
|
-
return /* @__PURE__ */ d(
|
|
1476
|
+
return /* @__PURE__ */ d(Zt.Provider, { value: { currentTime: o, progress: r, element: a }, children: /* @__PURE__ */ d(Jt.Provider, { value: e, children: /* @__PURE__ */ d(Xt.Provider, { value: t, children: n }) }) });
|
|
1473
1477
|
}
|
|
1474
|
-
function
|
|
1475
|
-
const [{ element: n, currentTime: o, progress: r }, a, i] =
|
|
1478
|
+
function tn({ media: e, children: t }) {
|
|
1479
|
+
const [{ element: n, currentTime: o, progress: r }, a, i] = yt({ duration: e.duration });
|
|
1476
1480
|
return /* @__PURE__ */ X(
|
|
1477
|
-
|
|
1481
|
+
en,
|
|
1478
1482
|
{
|
|
1479
1483
|
state: a,
|
|
1480
1484
|
actions: i,
|
|
@@ -1488,14 +1492,14 @@ function en({ media: e, children: t }) {
|
|
|
1488
1492
|
}
|
|
1489
1493
|
);
|
|
1490
1494
|
}
|
|
1491
|
-
function
|
|
1495
|
+
function nn({
|
|
1492
1496
|
media: e,
|
|
1493
1497
|
mediaControlsDeps: t,
|
|
1494
1498
|
children: n
|
|
1495
1499
|
}) {
|
|
1496
|
-
return Ve("portal", "audio",
|
|
1500
|
+
return Ve("portal", "audio", tn, { media: e, children: n }, [e, ...t || []]), null;
|
|
1497
1501
|
}
|
|
1498
|
-
function
|
|
1502
|
+
function rn({
|
|
1499
1503
|
element: e,
|
|
1500
1504
|
media: t,
|
|
1501
1505
|
playPause: n
|
|
@@ -1518,20 +1522,20 @@ function nn({
|
|
|
1518
1522
|
/* @__PURE__ */ d("video", { ref: e, src: t.url, style: { width: "100%", objectFit: "contain" } })
|
|
1519
1523
|
] });
|
|
1520
1524
|
}
|
|
1521
|
-
function
|
|
1525
|
+
function on({
|
|
1522
1526
|
media: e,
|
|
1523
1527
|
mediaControlsDeps: t,
|
|
1524
1528
|
children: n
|
|
1525
1529
|
}) {
|
|
1526
|
-
const [{ element: o, currentTime: r, progress: a }, i, s] =
|
|
1527
|
-
return Ve("overlay", "video-element",
|
|
1530
|
+
const [{ element: o, currentTime: r, progress: a }, i, s] = yt({ duration: e.duration });
|
|
1531
|
+
return Ve("overlay", "video-element", rn, {
|
|
1528
1532
|
element: o,
|
|
1529
1533
|
media: e,
|
|
1530
1534
|
playPause: s.playPause
|
|
1531
1535
|
}), Ve(
|
|
1532
1536
|
"portal",
|
|
1533
1537
|
"custom-controls",
|
|
1534
|
-
|
|
1538
|
+
en,
|
|
1535
1539
|
{
|
|
1536
1540
|
state: i,
|
|
1537
1541
|
actions: s,
|
|
@@ -1543,7 +1547,7 @@ function rn({
|
|
|
1543
1547
|
[r, i, e, ...t || []]
|
|
1544
1548
|
), null;
|
|
1545
1549
|
}
|
|
1546
|
-
function
|
|
1550
|
+
function an({ model: e }) {
|
|
1547
1551
|
return /* @__PURE__ */ X(Oe, { children: [
|
|
1548
1552
|
/* @__PURE__ */ d("style", { children: `
|
|
1549
1553
|
.model-container {
|
|
@@ -1571,10 +1575,10 @@ function on({ model: e }) {
|
|
|
1571
1575
|
) })
|
|
1572
1576
|
] });
|
|
1573
1577
|
}
|
|
1574
|
-
function
|
|
1575
|
-
return Ve("overlay", `model-${t}`,
|
|
1578
|
+
function sn({ model: e, name: t }) {
|
|
1579
|
+
return Ve("overlay", `model-${t}`, an, { model: e }, [e]), null;
|
|
1576
1580
|
}
|
|
1577
|
-
function
|
|
1581
|
+
function cn({ style: e }) {
|
|
1578
1582
|
const t = Se();
|
|
1579
1583
|
return !t || !t.height || !t.width ? null : /* @__PURE__ */ d(
|
|
1580
1584
|
"box",
|
|
@@ -1585,21 +1589,21 @@ function sn({ style: e }) {
|
|
|
1585
1589
|
}
|
|
1586
1590
|
);
|
|
1587
1591
|
}
|
|
1588
|
-
const
|
|
1592
|
+
const un = Ie.createContext("en");
|
|
1589
1593
|
function Io(e) {
|
|
1590
|
-
return /* @__PURE__ */ d(
|
|
1594
|
+
return /* @__PURE__ */ d(un.Provider, { value: e.language, children: e.children });
|
|
1591
1595
|
}
|
|
1592
|
-
function
|
|
1593
|
-
return Ie.useContext(
|
|
1596
|
+
function gt() {
|
|
1597
|
+
return Ie.useContext(un);
|
|
1594
1598
|
}
|
|
1595
|
-
function
|
|
1599
|
+
function Et(e) {
|
|
1596
1600
|
return e.indexOf("-") !== -1 ? e.slice(0, e.indexOf("-")) : e;
|
|
1597
1601
|
}
|
|
1598
|
-
function
|
|
1599
|
-
const a =
|
|
1600
|
-
return N(() =>
|
|
1602
|
+
function Qr({ as: e, language: t, children: n, viewingDirection: o, ...r }) {
|
|
1603
|
+
const a = gt();
|
|
1604
|
+
return N(() => Et(a) === Et(t), [a, t]) ? e ? /* @__PURE__ */ d(e, { ...r, children: n }) : /* @__PURE__ */ d("span", { ...r, children: n }) : e ? /* @__PURE__ */ d(e, { ...r, lang: t, dir: o, children: n }) : /* @__PURE__ */ d("span", { ...r, lang: t, dir: o, children: n });
|
|
1601
1605
|
}
|
|
1602
|
-
function
|
|
1606
|
+
function ln(e, t, n) {
|
|
1603
1607
|
if (t.length === 0)
|
|
1604
1608
|
return;
|
|
1605
1609
|
if (t.length === 1)
|
|
@@ -1614,16 +1618,16 @@ function un(e, t, n) {
|
|
|
1614
1618
|
return r;
|
|
1615
1619
|
return t.indexOf("none") !== -1 ? "none" : t.indexOf("@none") !== -1 ? "@none" : t[0];
|
|
1616
1620
|
}
|
|
1617
|
-
const
|
|
1618
|
-
const n =
|
|
1621
|
+
const Gr = (e, t = []) => {
|
|
1622
|
+
const n = gt();
|
|
1619
1623
|
return N(() => {
|
|
1620
1624
|
const o = e();
|
|
1621
|
-
return
|
|
1625
|
+
return ln(n, o, []);
|
|
1622
1626
|
}, [n, ...t]);
|
|
1623
1627
|
};
|
|
1624
|
-
function
|
|
1628
|
+
function Xr(e, t, n = `
|
|
1625
1629
|
`) {
|
|
1626
|
-
const o =
|
|
1630
|
+
const o = Gr(() => Object.keys(e || {}), [e]);
|
|
1627
1631
|
return [
|
|
1628
1632
|
N(() => {
|
|
1629
1633
|
if (!e)
|
|
@@ -1637,9 +1641,9 @@ function Gr(e, t, n = `
|
|
|
1637
1641
|
];
|
|
1638
1642
|
}
|
|
1639
1643
|
function Co() {
|
|
1640
|
-
const e =
|
|
1644
|
+
const e = gt();
|
|
1641
1645
|
return function(n, o, r) {
|
|
1642
|
-
const a = Object.keys(n || {}), i =
|
|
1646
|
+
const a = Object.keys(n || {}), i = ln(e, a, []);
|
|
1643
1647
|
if (!n)
|
|
1644
1648
|
return o || "";
|
|
1645
1649
|
if (typeof n == "string")
|
|
@@ -1657,9 +1661,9 @@ function Ne({
|
|
|
1657
1661
|
separator: r,
|
|
1658
1662
|
...a
|
|
1659
1663
|
}) {
|
|
1660
|
-
const [i, s] =
|
|
1664
|
+
const [i, s] = Xr(o, t, r);
|
|
1661
1665
|
return s ? /* @__PURE__ */ d(
|
|
1662
|
-
|
|
1666
|
+
Qr,
|
|
1663
1667
|
{
|
|
1664
1668
|
...a,
|
|
1665
1669
|
as: e,
|
|
@@ -1682,7 +1686,7 @@ function Ne({
|
|
|
1682
1686
|
}
|
|
1683
1687
|
);
|
|
1684
1688
|
}
|
|
1685
|
-
function
|
|
1689
|
+
function Jr({
|
|
1686
1690
|
element: e,
|
|
1687
1691
|
media: t,
|
|
1688
1692
|
playPause: n
|
|
@@ -1720,19 +1724,19 @@ function Xr({
|
|
|
1720
1724
|
)
|
|
1721
1725
|
] }) : null;
|
|
1722
1726
|
}
|
|
1723
|
-
function
|
|
1727
|
+
function Zr({
|
|
1724
1728
|
media: e,
|
|
1725
1729
|
mediaControlsDeps: t,
|
|
1726
1730
|
children: n
|
|
1727
1731
|
}) {
|
|
1728
|
-
const [{ element: o, currentTime: r, progress: a }, i, s] =
|
|
1729
|
-
return Ve("overlay", "video-element",
|
|
1732
|
+
const [{ element: o, currentTime: r, progress: a }, i, s] = yt({ duration: e.duration });
|
|
1733
|
+
return Ve("overlay", "video-element", Jr, {
|
|
1730
1734
|
element: o,
|
|
1731
1735
|
media: e,
|
|
1732
1736
|
playPause: s.playPause
|
|
1733
1737
|
}), null;
|
|
1734
1738
|
}
|
|
1735
|
-
function
|
|
1739
|
+
function fn({
|
|
1736
1740
|
x: e,
|
|
1737
1741
|
y: t,
|
|
1738
1742
|
onChoiceChange: n,
|
|
@@ -1753,7 +1757,7 @@ function ln({
|
|
|
1753
1757
|
onClickPaintingAnnotation: C,
|
|
1754
1758
|
children: A
|
|
1755
1759
|
}) {
|
|
1756
|
-
const S = Se(), F =
|
|
1760
|
+
const S = Se(), F = Ut(S, ["deep-zoom"]), [L] = mr(), R = wr(), B = ae(), j = N(() => ut(B), [B]), [O, U] = Wr({
|
|
1757
1761
|
strategies: u || ["images"],
|
|
1758
1762
|
defaultChoices: r == null ? void 0 : r.map(({ id: V }) => V)
|
|
1759
1763
|
}), H = O.type === "images" ? O.choice : void 0, G = N(() => I ? 1 : Math.max(
|
|
@@ -1763,7 +1767,7 @@ function ln({
|
|
|
1763
1767
|
return (V.width || 0) / ((te = V.target) == null ? void 0 : te.spatial.width);
|
|
1764
1768
|
}) : []
|
|
1765
1769
|
), [I, O]);
|
|
1766
|
-
|
|
1770
|
+
Pr(G), be(() => {
|
|
1767
1771
|
o && o(U);
|
|
1768
1772
|
}, [O.annotations]), be(() => {
|
|
1769
1773
|
if (r)
|
|
@@ -1776,14 +1780,14 @@ function ln({
|
|
|
1776
1780
|
}, [H]), Ve(
|
|
1777
1781
|
R && (O.type === "images" || O.type === "empty" || O.type === "textual-content" && i) ? "overlay" : "none",
|
|
1778
1782
|
`canvas-portal-controls-${S == null ? void 0 : S.id}`,
|
|
1779
|
-
|
|
1783
|
+
pt.Provider,
|
|
1780
1784
|
i ? {
|
|
1781
1785
|
value: R || null,
|
|
1782
1786
|
children: i(O)
|
|
1783
1787
|
} : {},
|
|
1784
1788
|
[S, R, O, ...f || []]
|
|
1785
1789
|
);
|
|
1786
|
-
const Y =
|
|
1790
|
+
const Y = Gt({ maxWidth: 256, maxHeight: 256 });
|
|
1787
1791
|
if (!S)
|
|
1788
1792
|
return null;
|
|
1789
1793
|
const Z = S.accompanyingCanvas, ee = Y && Y.type === "fixed" ? /* @__PURE__ */ d("world-object", { height: S.height, width: S.width, x: e, y: t, children: /* @__PURE__ */ d(
|
|
@@ -1820,12 +1824,12 @@ function ln({
|
|
|
1820
1824
|
y: t,
|
|
1821
1825
|
...F,
|
|
1822
1826
|
children: [
|
|
1823
|
-
O.type === "empty" || M ? /* @__PURE__ */ d(
|
|
1827
|
+
O.type === "empty" || M ? /* @__PURE__ */ d(cn, { style: x }) : null,
|
|
1824
1828
|
O.type === "textual-content" ? O.items.map((V, te) => {
|
|
1825
1829
|
var $;
|
|
1826
1830
|
return /* @__PURE__ */ X(Oe, { children: [
|
|
1827
1831
|
/* @__PURE__ */ d(
|
|
1828
|
-
|
|
1832
|
+
Cn,
|
|
1829
1833
|
{
|
|
1830
1834
|
onClick: C ? (le) => {
|
|
1831
1835
|
le.stopPropagation(), C(V.annotationId, V, le);
|
|
@@ -1840,7 +1844,7 @@ function ln({
|
|
|
1840
1844
|
}) : null,
|
|
1841
1845
|
O.type === "images" ? /* @__PURE__ */ X(Oe, { children: [
|
|
1842
1846
|
O.images.map((V, te) => /* @__PURE__ */ d(
|
|
1843
|
-
|
|
1847
|
+
Ht,
|
|
1844
1848
|
{
|
|
1845
1849
|
isStatic: a,
|
|
1846
1850
|
image: V,
|
|
@@ -1856,14 +1860,14 @@ function ln({
|
|
|
1856
1860
|
)),
|
|
1857
1861
|
se
|
|
1858
1862
|
] }) : null,
|
|
1859
|
-
O.type === "3d-model" ? /* @__PURE__ */ d(
|
|
1860
|
-
O.type === "media" ? /* @__PURE__ */ d(Oe, { children: O.media.type === "Sound" ? /* @__PURE__ */ X(
|
|
1863
|
+
O.type === "3d-model" ? /* @__PURE__ */ d(sn, { model: O.model }) : null,
|
|
1864
|
+
O.type === "media" ? /* @__PURE__ */ d(Oe, { children: O.media.type === "Sound" ? /* @__PURE__ */ X(nn, { media: O.media, mediaControlsDeps: h, children: [
|
|
1861
1865
|
ee,
|
|
1862
1866
|
s ? s(O) : null
|
|
1863
|
-
] }) : O.media.type === "Video" ? /* @__PURE__ */ X(
|
|
1867
|
+
] }) : O.media.type === "Video" ? /* @__PURE__ */ X(on, { media: O.media, mediaControlsDeps: h, children: [
|
|
1864
1868
|
ee,
|
|
1865
1869
|
s ? s(O) : null
|
|
1866
|
-
] }) : O.media.type === "VideoYouTube" && E ? /* @__PURE__ */ X(
|
|
1870
|
+
] }) : O.media.type === "VideoYouTube" && E ? /* @__PURE__ */ X(Zr, { media: O.media, mediaControlsDeps: h, children: [
|
|
1867
1871
|
ee,
|
|
1868
1872
|
s ? s(O) : null
|
|
1869
1873
|
] }) : null }) : null
|
|
@@ -1871,16 +1875,12 @@ function ln({
|
|
|
1871
1875
|
},
|
|
1872
1876
|
`${S.id}/${O.type}/${me}`
|
|
1873
1877
|
),
|
|
1874
|
-
O.type === "media" && O.media.type === "Sound" && Z ? /* @__PURE__ */ d(Qe, { canvas: Z.id, children: /* @__PURE__ */ d(
|
|
1878
|
+
O.type === "media" && O.media.type === "Sound" && Z ? /* @__PURE__ */ d(Qe, { canvas: Z.id, children: /* @__PURE__ */ d(fn, { renderViewerControls: i }) }) : null
|
|
1875
1879
|
] });
|
|
1876
1880
|
}
|
|
1877
|
-
function Zr() {
|
|
1878
|
-
const e = ue(Ke);
|
|
1879
|
-
return e && e.vault ? e.vault : Et();
|
|
1880
|
-
}
|
|
1881
1881
|
const eo = ct(function(t, n) {
|
|
1882
|
-
const o = Ce(), r =
|
|
1883
|
-
if (
|
|
1882
|
+
const o = Ce(), r = Mt(), a = Nt(), { ViewerControls: i, MediaControls: s } = t.components || {};
|
|
1883
|
+
if (It(n, () => a, [a]), !o)
|
|
1884
1884
|
return /* @__PURE__ */ d("div", {});
|
|
1885
1885
|
let f = 0;
|
|
1886
1886
|
return /* @__PURE__ */ X(Oe, { children: [
|
|
@@ -1910,20 +1910,9 @@ const eo = ct(function(t, n) {
|
|
|
1910
1910
|
),
|
|
1911
1911
|
t.children
|
|
1912
1912
|
] });
|
|
1913
|
-
}), ge = ct(function({
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
annotations: o,
|
|
1917
|
-
canvasProps: r,
|
|
1918
|
-
spacing: a,
|
|
1919
|
-
header: i,
|
|
1920
|
-
components: s,
|
|
1921
|
-
mode: f,
|
|
1922
|
-
reuseAtlas: h,
|
|
1923
|
-
...u
|
|
1924
|
-
}, y) {
|
|
1925
|
-
const x = Zr();
|
|
1926
|
-
return /* @__PURE__ */ d(It, { vault: x, children: /* @__PURE__ */ d(Hn, { ...u, children: /* @__PURE__ */ d(
|
|
1913
|
+
}), ge = ct(function({ children: t, height: n, annotations: o, canvasProps: r, spacing: a, header: i, components: s, mode: f, reuseAtlas: h, ...u }, y) {
|
|
1914
|
+
const x = dt();
|
|
1915
|
+
return /* @__PURE__ */ d(ft, { vault: x, children: /* @__PURE__ */ d(Yn, { ...u, children: /* @__PURE__ */ d(
|
|
1927
1916
|
eo,
|
|
1928
1917
|
{
|
|
1929
1918
|
ref: y,
|
|
@@ -1939,25 +1928,25 @@ const eo = ct(function(t, n) {
|
|
|
1939
1928
|
}
|
|
1940
1929
|
) }) });
|
|
1941
1930
|
});
|
|
1942
|
-
ge.RenderImage =
|
|
1943
|
-
ge.RenderCanvas =
|
|
1931
|
+
ge.RenderImage = Ht;
|
|
1932
|
+
ge.RenderCanvas = fn;
|
|
1944
1933
|
ge.RenderAnnotationPage = at;
|
|
1945
|
-
ge.RenderAnnotation =
|
|
1946
|
-
ge.Viewer =
|
|
1947
|
-
ge.CanvasBackground =
|
|
1948
|
-
ge.Audio =
|
|
1949
|
-
ge.Video =
|
|
1950
|
-
ge.Model =
|
|
1951
|
-
ge.AudioHTML =
|
|
1952
|
-
ge.VideoHTML =
|
|
1953
|
-
ge.ModelHTML =
|
|
1934
|
+
ge.RenderAnnotation = Wt;
|
|
1935
|
+
ge.Viewer = Or;
|
|
1936
|
+
ge.CanvasBackground = cn;
|
|
1937
|
+
ge.Audio = nn;
|
|
1938
|
+
ge.Video = on;
|
|
1939
|
+
ge.Model = sn;
|
|
1940
|
+
ge.AudioHTML = tn;
|
|
1941
|
+
ge.VideoHTML = rn;
|
|
1942
|
+
ge.ModelHTML = an;
|
|
1954
1943
|
const jo = ct(
|
|
1955
1944
|
function({ canvasId: t }, n) {
|
|
1956
|
-
const o =
|
|
1957
|
-
return
|
|
1945
|
+
const o = jn(), r = zt(t || (o == null ? void 0 : o.id)), a = ae();
|
|
1946
|
+
return It(n, () => r, [t, o]), !o || r.enabledPageIds.length === 0 ? null : /* @__PURE__ */ d(Oe, { children: r.enabledPageIds.map((i) => /* @__PURE__ */ d(ge.RenderAnnotationPage, { page: a.get(i) }, i)) });
|
|
1958
1947
|
}
|
|
1959
1948
|
);
|
|
1960
|
-
function
|
|
1949
|
+
function dn({
|
|
1961
1950
|
metadata: e = [],
|
|
1962
1951
|
config: t,
|
|
1963
1952
|
labelWidth: n = 16,
|
|
@@ -2043,21 +2032,21 @@ function fn({
|
|
|
2043
2032
|
] });
|
|
2044
2033
|
}
|
|
2045
2034
|
function Mo(e) {
|
|
2046
|
-
const t = Ce(), n = Se(), o =
|
|
2035
|
+
const t = Ce(), n = Se(), o = kt(), r = N(() => {
|
|
2047
2036
|
const a = (t == null ? void 0 : t.metadata) || [], i = (n == null ? void 0 : n.metadata) || [], s = (o == null ? void 0 : o.metadata) || [];
|
|
2048
2037
|
return [...a, ...i, ...s];
|
|
2049
2038
|
}, [t, n, o]);
|
|
2050
|
-
return /* @__PURE__ */ d(
|
|
2039
|
+
return /* @__PURE__ */ d(dn, { metadata: r, ...e });
|
|
2051
2040
|
}
|
|
2052
|
-
function
|
|
2041
|
+
function pn(e, t = {}, n = []) {
|
|
2053
2042
|
return N(() => {
|
|
2054
2043
|
var i, s;
|
|
2055
2044
|
if (!e)
|
|
2056
2045
|
return null;
|
|
2057
2046
|
let o = t.quality;
|
|
2058
2047
|
e && e.extraQualities && t.quality && (e.extraQualities.includes(t.quality) || (console.log("Invalid quality", t.quality, e.extraQualities), o = "default"));
|
|
2059
|
-
const r =
|
|
2060
|
-
return
|
|
2048
|
+
const r = Ln(e);
|
|
2049
|
+
return An({
|
|
2061
2050
|
identifier: r.identifier,
|
|
2062
2051
|
server: r.server,
|
|
2063
2052
|
scheme: r.scheme,
|
|
@@ -2080,7 +2069,7 @@ function dn(e, t = {}, n = []) {
|
|
|
2080
2069
|
}, [...n]);
|
|
2081
2070
|
}
|
|
2082
2071
|
function to(e) {
|
|
2083
|
-
const t = typeof e.src == "string" ? e.src : e.src.id, n = Je(), [o, r] =
|
|
2072
|
+
const t = typeof e.src == "string" ? e.src : e.src.id, n = Je(), [o, r] = ie(!1);
|
|
2084
2073
|
let a;
|
|
2085
2074
|
if (t) {
|
|
2086
2075
|
const s = n.loadServiceSync({ id: t });
|
|
@@ -2089,7 +2078,7 @@ function to(e) {
|
|
|
2089
2078
|
!a && !o && n.loadService({ id: t }).then(() => {
|
|
2090
2079
|
r(!0);
|
|
2091
2080
|
});
|
|
2092
|
-
const i =
|
|
2081
|
+
const i = pn(
|
|
2093
2082
|
a,
|
|
2094
2083
|
{
|
|
2095
2084
|
size: e.size,
|
|
@@ -2108,7 +2097,7 @@ function to(e) {
|
|
|
2108
2097
|
function no(e) {
|
|
2109
2098
|
if (e.fetchImageService)
|
|
2110
2099
|
return /* @__PURE__ */ d(to, { ...e });
|
|
2111
|
-
const t = typeof e.src == "string" ? { id: e.src, profile: "level0" } : e.src, n =
|
|
2100
|
+
const t = typeof e.src == "string" ? { id: e.src, profile: "level0" } : e.src, n = pn(
|
|
2112
2101
|
t,
|
|
2113
2102
|
{
|
|
2114
2103
|
size: e.size,
|
|
@@ -2124,9 +2113,9 @@ function no(e) {
|
|
|
2124
2113
|
}
|
|
2125
2114
|
function Ro(e) {
|
|
2126
2115
|
const t = Ce();
|
|
2127
|
-
return /* @__PURE__ */ d(
|
|
2116
|
+
return /* @__PURE__ */ d(dn, { metadata: (t == null ? void 0 : t.metadata) || [], ...e });
|
|
2128
2117
|
}
|
|
2129
|
-
var
|
|
2118
|
+
var hn = { exports: {} };
|
|
2130
2119
|
(() => {
|
|
2131
2120
|
var e = { 296: (r, a, i) => {
|
|
2132
2121
|
var s = /^\s+|\s+$/g, f = /^[-+]0x[0-9a-f]+$/i, h = /^0b[01]+$/i, u = /^0o[0-7]+$/i, y = parseInt, x = typeof i.g == "object" && i.g && i.g.Object === Object && i.g, M = typeof self == "object" && self && self.Object === Object && self, I = x || M || Function("return this")(), b = Object.prototype.toString, E = Math.max, C = Math.min, A = function() {
|
|
@@ -2159,29 +2148,29 @@ var pn = { exports: {} };
|
|
|
2159
2148
|
var j, O, U, H, G, Y, Z = 0, ee = !1, se = !1, me = !0;
|
|
2160
2149
|
if (typeof L != "function")
|
|
2161
2150
|
throw new TypeError("Expected a function");
|
|
2162
|
-
function V(
|
|
2163
|
-
var
|
|
2164
|
-
return j = O = void 0, Z =
|
|
2151
|
+
function V(re) {
|
|
2152
|
+
var oe = j, de = O;
|
|
2153
|
+
return j = O = void 0, Z = re, H = L.apply(de, oe);
|
|
2165
2154
|
}
|
|
2166
|
-
function te(
|
|
2167
|
-
var
|
|
2168
|
-
return Y === void 0 ||
|
|
2155
|
+
function te(re) {
|
|
2156
|
+
var oe = re - Y;
|
|
2157
|
+
return Y === void 0 || oe >= R || oe < 0 || se && re - Z >= U;
|
|
2169
2158
|
}
|
|
2170
2159
|
function $() {
|
|
2171
|
-
var
|
|
2172
|
-
if (te(
|
|
2173
|
-
return le(
|
|
2174
|
-
G = setTimeout($, function(
|
|
2175
|
-
var de = R - (
|
|
2176
|
-
return se ? C(de, U - (
|
|
2177
|
-
}(
|
|
2160
|
+
var re = A();
|
|
2161
|
+
if (te(re))
|
|
2162
|
+
return le(re);
|
|
2163
|
+
G = setTimeout($, function(oe) {
|
|
2164
|
+
var de = R - (oe - Y);
|
|
2165
|
+
return se ? C(de, U - (oe - Z)) : de;
|
|
2166
|
+
}(re));
|
|
2178
2167
|
}
|
|
2179
|
-
function le(
|
|
2180
|
-
return G = void 0, me && j ? V(
|
|
2168
|
+
function le(re) {
|
|
2169
|
+
return G = void 0, me && j ? V(re) : (j = O = void 0, H);
|
|
2181
2170
|
}
|
|
2182
2171
|
function fe() {
|
|
2183
|
-
var
|
|
2184
|
-
if (j = arguments, O = this, Y =
|
|
2172
|
+
var re = A(), oe = te(re);
|
|
2173
|
+
if (j = arguments, O = this, Y = re, oe) {
|
|
2185
2174
|
if (G === void 0)
|
|
2186
2175
|
return function(de) {
|
|
2187
2176
|
return Z = de, G = setTimeout($, R), ee ? V(de) : H;
|
|
@@ -2229,7 +2218,7 @@ var pn = { exports: {} };
|
|
|
2229
2218
|
if (typeof j != "function")
|
|
2230
2219
|
throw new TypeError(s);
|
|
2231
2220
|
return R(U) && (H = "leading" in U ? !!U.leading : H, G = "trailing" in U ? !!U.trailing : G), function(Y, Z, ee) {
|
|
2232
|
-
var se, me, V, te, $, le, fe = 0,
|
|
2221
|
+
var se, me, V, te, $, le, fe = 0, re = !1, oe = !1, de = !0;
|
|
2233
2222
|
if (typeof Y != "function")
|
|
2234
2223
|
throw new TypeError(s);
|
|
2235
2224
|
function _e(pe) {
|
|
@@ -2238,7 +2227,7 @@ var pn = { exports: {} };
|
|
|
2238
2227
|
}
|
|
2239
2228
|
function Be(pe) {
|
|
2240
2229
|
var ve = pe - le;
|
|
2241
|
-
return le === void 0 || ve >= Z || ve < 0 ||
|
|
2230
|
+
return le === void 0 || ve >= Z || ve < 0 || oe && pe - fe >= V;
|
|
2242
2231
|
}
|
|
2243
2232
|
function we() {
|
|
2244
2233
|
var pe = L();
|
|
@@ -2246,7 +2235,7 @@ var pn = { exports: {} };
|
|
|
2246
2235
|
return qe(pe);
|
|
2247
2236
|
$ = setTimeout(we, function(ve) {
|
|
2248
2237
|
var Pe = Z - (ve - le);
|
|
2249
|
-
return
|
|
2238
|
+
return oe ? F(Pe, V - (ve - fe)) : Pe;
|
|
2250
2239
|
}(pe));
|
|
2251
2240
|
}
|
|
2252
2241
|
function qe(pe) {
|
|
@@ -2257,14 +2246,14 @@ var pn = { exports: {} };
|
|
|
2257
2246
|
if (se = arguments, me = this, le = pe, ve) {
|
|
2258
2247
|
if ($ === void 0)
|
|
2259
2248
|
return function(Pe) {
|
|
2260
|
-
return fe = Pe, $ = setTimeout(we, Z),
|
|
2249
|
+
return fe = Pe, $ = setTimeout(we, Z), re ? _e(Pe) : te;
|
|
2261
2250
|
}(le);
|
|
2262
|
-
if (
|
|
2251
|
+
if (oe)
|
|
2263
2252
|
return $ = setTimeout(we, Z), _e(le);
|
|
2264
2253
|
}
|
|
2265
2254
|
return $ === void 0 && ($ = setTimeout(we, Z)), te;
|
|
2266
2255
|
}
|
|
2267
|
-
return Z = B(Z) || 0, R(ee) && (
|
|
2256
|
+
return Z = B(Z) || 0, R(ee) && (re = !!ee.leading, V = (oe = "maxWait" in ee) ? S(B(ee.maxWait) || 0, Z) : V, de = "trailing" in ee ? !!ee.trailing : de), Me.cancel = function() {
|
|
2268
2257
|
$ !== void 0 && clearTimeout($), fe = 0, se = le = me = $ = void 0;
|
|
2269
2258
|
}, Me.flush = function() {
|
|
2270
2259
|
return $ === void 0 ? te : qe(L());
|
|
@@ -2323,10 +2312,10 @@ var pn = { exports: {} };
|
|
|
2323
2312
|
};
|
|
2324
2313
|
var o = {};
|
|
2325
2314
|
(() => {
|
|
2326
|
-
n.r(o), n.d(o, { LazyLoadComponent: () =>
|
|
2315
|
+
n.r(o), n.d(o, { LazyLoadComponent: () => mt, LazyLoadImage: () => bn, trackWindowScroll: () => le });
|
|
2327
2316
|
const r = Ie;
|
|
2328
2317
|
var a = n.n(r), i = n(697);
|
|
2329
|
-
const s =
|
|
2318
|
+
const s = Nn;
|
|
2330
2319
|
var f = n.n(s);
|
|
2331
2320
|
function h() {
|
|
2332
2321
|
return typeof window < "u" && "IntersectionObserver" in window && "isIntersecting" in window.IntersectionObserverEntry.prototype;
|
|
@@ -2608,10 +2597,10 @@ var pn = { exports: {} };
|
|
|
2608
2597
|
var K, W, ce = function(he, ke) {
|
|
2609
2598
|
if (he == null)
|
|
2610
2599
|
return {};
|
|
2611
|
-
var Re, $e,
|
|
2612
|
-
for ($e = 0; $e <
|
|
2613
|
-
Re =
|
|
2614
|
-
return
|
|
2600
|
+
var Re, $e, Pt = {}, Ot = Object.keys(he);
|
|
2601
|
+
for ($e = 0; $e < Ot.length; $e++)
|
|
2602
|
+
Re = Ot[$e], ke.indexOf(Re) >= 0 || (Pt[Re] = he[Re]);
|
|
2603
|
+
return Pt;
|
|
2615
2604
|
}(D, z);
|
|
2616
2605
|
if (Object.getOwnPropertySymbols) {
|
|
2617
2606
|
var J = Object.getOwnPropertySymbols(D);
|
|
@@ -2632,7 +2621,7 @@ var pn = { exports: {} };
|
|
|
2632
2621
|
return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
|
|
2633
2622
|
}, fe(g);
|
|
2634
2623
|
}
|
|
2635
|
-
function
|
|
2624
|
+
function re(g, c) {
|
|
2636
2625
|
for (var m = 0; m < c.length; m++) {
|
|
2637
2626
|
var v = c[m];
|
|
2638
2627
|
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(g, (k = function(_, q) {
|
|
@@ -2650,10 +2639,10 @@ var pn = { exports: {} };
|
|
|
2650
2639
|
}
|
|
2651
2640
|
var k;
|
|
2652
2641
|
}
|
|
2653
|
-
function
|
|
2654
|
-
return
|
|
2642
|
+
function oe(g, c) {
|
|
2643
|
+
return oe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, v) {
|
|
2655
2644
|
return m.__proto__ = v, m;
|
|
2656
|
-
},
|
|
2645
|
+
}, oe(g, c);
|
|
2657
2646
|
}
|
|
2658
2647
|
function de(g) {
|
|
2659
2648
|
return de = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(c) {
|
|
@@ -2664,7 +2653,7 @@ var pn = { exports: {} };
|
|
|
2664
2653
|
(function(l, p) {
|
|
2665
2654
|
if (typeof p != "function" && p !== null)
|
|
2666
2655
|
throw new TypeError("Super expression must either be null or a function");
|
|
2667
|
-
l.prototype = Object.create(p && p.prototype, { constructor: { value: l, writable: !0, configurable: !0 } }), Object.defineProperty(l, "prototype", { writable: !1 }), p &&
|
|
2656
|
+
l.prototype = Object.create(p && p.prototype, { constructor: { value: l, writable: !0, configurable: !0 } }), Object.defineProperty(l, "prototype", { writable: !1 }), p && oe(l, p);
|
|
2668
2657
|
})(q, g);
|
|
2669
2658
|
var c, m, v, k, _ = (v = q, k = function() {
|
|
2670
2659
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
@@ -2704,7 +2693,7 @@ var pn = { exports: {} };
|
|
|
2704
2693
|
}
|
|
2705
2694
|
return c = q, (m = [{ key: "render", value: function() {
|
|
2706
2695
|
return a().createElement(F, this.props);
|
|
2707
|
-
} }]) &&
|
|
2696
|
+
} }]) && re(c.prototype, m), Object.defineProperty(c, "prototype", { writable: !1 }), q;
|
|
2708
2697
|
}(a().Component);
|
|
2709
2698
|
const Be = le(_e);
|
|
2710
2699
|
function we(g) {
|
|
@@ -2804,7 +2793,7 @@ var pn = { exports: {} };
|
|
|
2804
2793
|
}, beforeLoad: function() {
|
|
2805
2794
|
return {};
|
|
2806
2795
|
}, useIntersectionObserver: !0, visibleByDefault: !1 };
|
|
2807
|
-
const
|
|
2796
|
+
const mt = Pe;
|
|
2808
2797
|
function Ae(g) {
|
|
2809
2798
|
return Ae = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
|
|
2810
2799
|
return typeof c;
|
|
@@ -2812,8 +2801,8 @@ var pn = { exports: {} };
|
|
|
2812
2801
|
return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
|
|
2813
2802
|
}, Ae(g);
|
|
2814
2803
|
}
|
|
2815
|
-
var
|
|
2816
|
-
function
|
|
2804
|
+
var gn = ["afterLoad", "beforeLoad", "delayMethod", "delayTime", "effect", "placeholder", "placeholderSrc", "scrollPosition", "threshold", "useIntersectionObserver", "visibleByDefault", "wrapperClassName", "wrapperProps"];
|
|
2805
|
+
function vt(g, c) {
|
|
2817
2806
|
var m = Object.keys(g);
|
|
2818
2807
|
if (Object.getOwnPropertySymbols) {
|
|
2819
2808
|
var v = Object.getOwnPropertySymbols(g);
|
|
@@ -2823,19 +2812,19 @@ var pn = { exports: {} };
|
|
|
2823
2812
|
}
|
|
2824
2813
|
return m;
|
|
2825
2814
|
}
|
|
2826
|
-
function
|
|
2815
|
+
function bt(g) {
|
|
2827
2816
|
for (var c = 1; c < arguments.length; c++) {
|
|
2828
2817
|
var m = arguments[c] != null ? arguments[c] : {};
|
|
2829
|
-
c % 2 ?
|
|
2830
|
-
|
|
2831
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(g, Object.getOwnPropertyDescriptors(m)) :
|
|
2818
|
+
c % 2 ? vt(Object(m), !0).forEach(function(v) {
|
|
2819
|
+
mn(g, v, m[v]);
|
|
2820
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(g, Object.getOwnPropertyDescriptors(m)) : vt(Object(m)).forEach(function(v) {
|
|
2832
2821
|
Object.defineProperty(g, v, Object.getOwnPropertyDescriptor(m, v));
|
|
2833
2822
|
});
|
|
2834
2823
|
}
|
|
2835
2824
|
return g;
|
|
2836
2825
|
}
|
|
2837
|
-
function
|
|
2838
|
-
return (c =
|
|
2826
|
+
function mn(g, c, m) {
|
|
2827
|
+
return (c = wt(c)) in g ? Object.defineProperty(g, c, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : g[c] = m, g;
|
|
2839
2828
|
}
|
|
2840
2829
|
function Fe() {
|
|
2841
2830
|
return Fe = Object.assign ? Object.assign.bind() : function(g) {
|
|
@@ -2847,13 +2836,13 @@ var pn = { exports: {} };
|
|
|
2847
2836
|
return g;
|
|
2848
2837
|
}, Fe.apply(this, arguments);
|
|
2849
2838
|
}
|
|
2850
|
-
function
|
|
2839
|
+
function vn(g, c) {
|
|
2851
2840
|
for (var m = 0; m < c.length; m++) {
|
|
2852
2841
|
var v = c[m];
|
|
2853
|
-
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(g,
|
|
2842
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(g, wt(v.key), v);
|
|
2854
2843
|
}
|
|
2855
2844
|
}
|
|
2856
|
-
function
|
|
2845
|
+
function wt(g) {
|
|
2857
2846
|
var c = function(m, v) {
|
|
2858
2847
|
if (Ae(m) !== "object" || m === null)
|
|
2859
2848
|
return m;
|
|
@@ -2944,18 +2933,18 @@ var pn = { exports: {} };
|
|
|
2944
2933
|
w = K[D], P.indexOf(w) >= 0 || Object.prototype.propertyIsEnumerable.call(T, w) && (z[w] = T[w]);
|
|
2945
2934
|
}
|
|
2946
2935
|
return z;
|
|
2947
|
-
}(l,
|
|
2936
|
+
}(l, gn));
|
|
2948
2937
|
return a().createElement("img", Fe({}, p, { onLoad: this.onImageLoad() }));
|
|
2949
2938
|
} }, { key: "getLazyLoadImage", value: function() {
|
|
2950
2939
|
var l = this.props, p = l.beforeLoad, T = l.className, P = l.delayMethod, w = l.delayTime, D = l.height, z = l.placeholder, K = l.scrollPosition, W = l.style, ce = l.threshold, J = l.useIntersectionObserver, he = l.visibleByDefault, ke = l.width;
|
|
2951
|
-
return a().createElement(
|
|
2940
|
+
return a().createElement(mt, { beforeLoad: p, className: T, delayMethod: P, delayTime: w, height: D, placeholder: z, scrollPosition: K, style: W, threshold: ce, useIntersectionObserver: J, visibleByDefault: he, width: ke }, this.getImg());
|
|
2952
2941
|
} }, { key: "getWrappedLazyLoadImage", value: function(l) {
|
|
2953
2942
|
var p = this.props, T = p.effect, P = p.height, w = p.placeholderSrc, D = p.width, z = p.wrapperClassName, K = p.wrapperProps, W = this.state.loaded, ce = W ? " lazy-load-image-loaded" : "", J = W || !w ? {} : { backgroundImage: "url(".concat(w, ")"), backgroundSize: "100% 100%" };
|
|
2954
|
-
return a().createElement("span", Fe({ className: z + " lazy-load-image-background " + T + ce, style:
|
|
2943
|
+
return a().createElement("span", Fe({ className: z + " lazy-load-image-background " + T + ce, style: bt(bt({}, J), {}, { color: "transparent", display: "inline-block", height: P, width: D }) }, K), l);
|
|
2955
2944
|
} }, { key: "render", value: function() {
|
|
2956
2945
|
var l = this.props, p = l.effect, T = l.placeholderSrc, P = l.visibleByDefault, w = l.wrapperClassName, D = l.wrapperProps, z = this.getLazyLoadImage();
|
|
2957
2946
|
return (p || T) && !P || w || D ? this.getWrappedLazyLoadImage(z) : z;
|
|
2958
|
-
} }]) &&
|
|
2947
|
+
} }]) && vn(c.prototype, m), Object.defineProperty(c, "prototype", { writable: !1 }), q;
|
|
2959
2948
|
}(a().Component);
|
|
2960
2949
|
et.propTypes = { onLoad: i.PropTypes.func, afterLoad: i.PropTypes.func, beforeLoad: i.PropTypes.func, delayMethod: i.PropTypes.string, delayTime: i.PropTypes.number, effect: i.PropTypes.string, placeholderSrc: i.PropTypes.string, threshold: i.PropTypes.number, useIntersectionObserver: i.PropTypes.bool, visibleByDefault: i.PropTypes.bool, wrapperClassName: i.PropTypes.string, wrapperProps: i.PropTypes.object }, et.defaultProps = { onLoad: function() {
|
|
2961
2950
|
}, afterLoad: function() {
|
|
@@ -2963,10 +2952,10 @@ var pn = { exports: {} };
|
|
|
2963
2952
|
}, beforeLoad: function() {
|
|
2964
2953
|
return {};
|
|
2965
2954
|
}, delayMethod: "throttle", delayTime: 300, effect: "", placeholderSrc: null, threshold: 100, useIntersectionObserver: !0, visibleByDefault: !1, wrapperClassName: "" };
|
|
2966
|
-
const
|
|
2967
|
-
})(),
|
|
2955
|
+
const bn = et;
|
|
2956
|
+
})(), hn.exports = o;
|
|
2968
2957
|
})();
|
|
2969
|
-
var ro =
|
|
2958
|
+
var ro = hn.exports;
|
|
2970
2959
|
function oo(e, t, n = [], o = !1, r = []) {
|
|
2971
2960
|
if (r.length && (t = t.filter((i) => r.indexOf(i) === -1)), !t || t.length === 0)
|
|
2972
2961
|
return;
|
|
@@ -2994,7 +2983,7 @@ function oo(e, t, n = [], o = !1, r = []) {
|
|
|
2994
2983
|
}
|
|
2995
2984
|
return t.indexOf("none") !== -1 ? "none" : t.indexOf("@none") !== -1 ? "@none" : t[0];
|
|
2996
2985
|
}
|
|
2997
|
-
function
|
|
2986
|
+
function yn(e, t, n = {}) {
|
|
2998
2987
|
const {
|
|
2999
2988
|
strictFallback: o = !1,
|
|
3000
2989
|
defaultText: r = "",
|
|
@@ -3014,7 +3003,7 @@ function hn(e, t, n = {}) {
|
|
|
3014
3003
|
return y;
|
|
3015
3004
|
if (y.length === 1 && y[0] === "") {
|
|
3016
3005
|
const x = n.skipLanguages || [];
|
|
3017
|
-
return
|
|
3006
|
+
return yn(e, t, {
|
|
3018
3007
|
...n,
|
|
3019
3008
|
skipLanguages: [...x, u]
|
|
3020
3009
|
});
|
|
@@ -3024,7 +3013,7 @@ function hn(e, t, n = {}) {
|
|
|
3024
3013
|
return "";
|
|
3025
3014
|
}
|
|
3026
3015
|
function io(e, t = {}) {
|
|
3027
|
-
return
|
|
3016
|
+
return yn(
|
|
3028
3017
|
e,
|
|
3029
3018
|
t.language || (typeof navigator < "u" ? navigator.language : "en"),
|
|
3030
3019
|
t
|
|
@@ -3036,7 +3025,7 @@ function so(e) {
|
|
|
3036
3025
|
return a ? /* @__PURE__ */ d("figure", { className: o == null ? void 0 : o.figure, children: h }) : h;
|
|
3037
3026
|
}
|
|
3038
3027
|
function co({ fallback: e, size: t, classes: n, showLabel: o, alt: r, dereference: a = !1 }) {
|
|
3039
|
-
const i = Se(), s = (t == null ? void 0 : t.width) || 128, f = (t == null ? void 0 : t.height) || (t == null ? void 0 : t.width) || 128, h = r || io(i == null ? void 0 : i.label) || "", u =
|
|
3028
|
+
const i = Se(), s = (t == null ? void 0 : t.width) || 128, f = (t == null ? void 0 : t.height) || (t == null ? void 0 : t.width) || 128, h = r || io(i == null ? void 0 : i.label) || "", u = Gt({ width: s, height: f }, a);
|
|
3040
3029
|
return !u || u.type !== "fixed" ? /* @__PURE__ */ d(Oe, { children: e }) : /* @__PURE__ */ X(Oe, { children: [
|
|
3041
3030
|
/* @__PURE__ */ d("div", { className: n == null ? void 0 : n.imageWrapper, children: /* @__PURE__ */ d("img", { className: n == null ? void 0 : n.img, src: u.id, alt: h }) }),
|
|
3042
3031
|
o ? /* @__PURE__ */ d(Ne, { as: "figcaption", className: n == null ? void 0 : n.label, children: i == null ? void 0 : i.label }) : null
|
|
@@ -3044,7 +3033,7 @@ function co({ fallback: e, size: t, classes: n, showLabel: o, alt: r, dereferenc
|
|
|
3044
3033
|
}
|
|
3045
3034
|
function Lo({ flat: e, size: t, classes: n = {}, showLabel: o, figure: r, fallback: a }) {
|
|
3046
3035
|
var M, I, b, E, C, A;
|
|
3047
|
-
const i = Ee(null), { items: s, sequence: f, currentSequenceIndex: h, setSequenceIndex: u } =
|
|
3036
|
+
const i = Ee(null), { items: s, sequence: f, currentSequenceIndex: h, setSequenceIndex: u } = Nt(), y = {
|
|
3048
3037
|
row: ((M = n.selected) == null ? void 0 : M.row) || n.row,
|
|
3049
3038
|
item: ((I = n.selected) == null ? void 0 : I.item) || n.item,
|
|
3050
3039
|
figure: ((b = n.selected) == null ? void 0 : b.figure) || n.figure,
|
|
@@ -3108,7 +3097,7 @@ function No({ collection: e, children: t }) {
|
|
|
3108
3097
|
return /* @__PURE__ */ d(Le, { value: { collection: e }, children: t });
|
|
3109
3098
|
}
|
|
3110
3099
|
function Vo(e, t = {}) {
|
|
3111
|
-
return
|
|
3100
|
+
return ht(t);
|
|
3112
3101
|
}
|
|
3113
3102
|
function _o(e, t = !1) {
|
|
3114
3103
|
}
|
|
@@ -3138,7 +3127,7 @@ function Bo(e, t = []) {
|
|
|
3138
3127
|
}, [i, o, ...t]);
|
|
3139
3128
|
}
|
|
3140
3129
|
function qo(e, t, n, o, r = []) {
|
|
3141
|
-
const a =
|
|
3130
|
+
const a = ae(), i = N(() => Ft(a), [a]);
|
|
3142
3131
|
be(() => {
|
|
3143
3132
|
const s = e;
|
|
3144
3133
|
return s ? (i.addEventListener(s, t, n, o), () => {
|
|
@@ -3148,14 +3137,14 @@ function qo(e, t, n, o, r = []) {
|
|
|
3148
3137
|
}, [i, e, t, ...r]);
|
|
3149
3138
|
}
|
|
3150
3139
|
function Fo(e, t) {
|
|
3151
|
-
const { id: n, isLoaded: o, error: r, resource: a, requestId: i, cached: s } =
|
|
3140
|
+
const { id: n, isLoaded: o, error: r, resource: a, requestId: i, cached: s } = jt(
|
|
3152
3141
|
e,
|
|
3153
3142
|
t
|
|
3154
3143
|
);
|
|
3155
3144
|
return { id: n, isLoaded: o, error: r, manifest: a, requestId: i, cached: s };
|
|
3156
3145
|
}
|
|
3157
3146
|
function uo({ cacheKey: e } = {}) {
|
|
3158
|
-
const t = Se(), n =
|
|
3147
|
+
const t = Se(), n = ht(), o = ae(), r = Je(), [a, i] = ie(void 0), [s, f] = ie(!1), [h, u] = ie("idle"), [y, x] = ie(void 0), M = t ? t.id : "undefined", I = N(() => {
|
|
3159
3148
|
try {
|
|
3160
3149
|
if (t && n.length) {
|
|
3161
3150
|
const E = n[0], C = o.get(E.body[0]), S = it(C)[0];
|
|
@@ -3219,7 +3208,7 @@ function $o() {
|
|
|
3219
3208
|
) : void 0;
|
|
3220
3209
|
}
|
|
3221
3210
|
function Wo() {
|
|
3222
|
-
const e =
|
|
3211
|
+
const e = ae();
|
|
3223
3212
|
return N(() => ut(e), [e]);
|
|
3224
3213
|
}
|
|
3225
3214
|
export {
|
|
@@ -3230,96 +3219,96 @@ export {
|
|
|
3230
3219
|
ge as CanvasPanel,
|
|
3231
3220
|
No as CollectionContext,
|
|
3232
3221
|
Mo as CombinedMetadata,
|
|
3233
|
-
|
|
3222
|
+
Kn as ContextBridge,
|
|
3234
3223
|
no as Image,
|
|
3235
|
-
|
|
3236
|
-
|
|
3224
|
+
Rr as ImageServiceLoaderContext,
|
|
3225
|
+
Hn as InnerViewerProvider,
|
|
3237
3226
|
Io as LanguageProvider,
|
|
3238
|
-
|
|
3227
|
+
Qr as LanguageString,
|
|
3239
3228
|
Ne as LocaleString,
|
|
3240
|
-
|
|
3229
|
+
Fn as ManifestContext,
|
|
3241
3230
|
Ro as ManifestMetadata,
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3231
|
+
en as MediaPlayerProvider,
|
|
3232
|
+
dn as Metadata,
|
|
3233
|
+
Un as RangeContext,
|
|
3245
3234
|
Ke as ReactVaultContext,
|
|
3246
3235
|
Le as ResourceProvider,
|
|
3247
3236
|
lt as ResourceReactContext,
|
|
3248
3237
|
Lo as SequenceThumbnails,
|
|
3249
|
-
|
|
3238
|
+
Yn as SimpleViewerProvider,
|
|
3250
3239
|
Xe as SimpleViewerReactContext,
|
|
3251
3240
|
so as SingleCanvasThumbnail,
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3241
|
+
ft as VaultProvider,
|
|
3242
|
+
pt as ViewerPresetContext,
|
|
3243
|
+
vr as VirtualAnnotationProvider,
|
|
3255
3244
|
Ge as VisibleCanvasReactContext,
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3245
|
+
xr as emptyActions,
|
|
3246
|
+
Tr as emptyStrategy,
|
|
3247
|
+
Rt as findAllCanvasesInRange,
|
|
3248
|
+
$n as findFirstCanvasFromRange,
|
|
3260
3249
|
Po as findManifestSelectedRange,
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3250
|
+
Lt as findSelectedRange,
|
|
3251
|
+
Cr as flattenAnnotationPageIds,
|
|
3252
|
+
Kr as formatTime,
|
|
3253
|
+
_r as get3dStrategy,
|
|
3254
|
+
Br as getImageStrategy,
|
|
3255
|
+
At as getManifestSequence,
|
|
3256
|
+
Yt as getParsedTargetSelector,
|
|
3257
|
+
$r as getRenderingStrategy,
|
|
3258
|
+
qr as getTextualContentStrategy,
|
|
3259
|
+
Ur as getVideoStrategy,
|
|
3271
3260
|
Oo as getVisibleCanvasesFromCanvasId,
|
|
3272
3261
|
So as parseSpecificResource,
|
|
3273
3262
|
rt as unknownResponse,
|
|
3274
3263
|
ne as unsupportedStrategy,
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3264
|
+
$t as useAnnotation,
|
|
3265
|
+
Sr as useAnnotationPage,
|
|
3266
|
+
zt as useAnnotationPageManager,
|
|
3278
3267
|
Vo as useAnnotationsAtTime,
|
|
3279
3268
|
Se as useCanvas,
|
|
3280
3269
|
_o as useCanvasClock,
|
|
3281
|
-
|
|
3270
|
+
Wn as useCanvasSequence,
|
|
3282
3271
|
Do as useCanvasSubset,
|
|
3283
|
-
|
|
3272
|
+
Gr as useClosestLanguage,
|
|
3284
3273
|
Bo as useCollection,
|
|
3285
|
-
|
|
3274
|
+
zn as useContextBridge,
|
|
3286
3275
|
Co as useCreateLocaleString,
|
|
3287
|
-
|
|
3276
|
+
yr as useDispatch,
|
|
3288
3277
|
qo as useEventListener,
|
|
3289
|
-
|
|
3278
|
+
dt as useExistingVault,
|
|
3290
3279
|
Fo as useExternalCollection,
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3280
|
+
qn as useExternalManifest,
|
|
3281
|
+
jt as useExternalResource,
|
|
3282
|
+
gt as useIIIFLanguage,
|
|
3283
|
+
pn as useImage,
|
|
3295
3284
|
uo as useImageService,
|
|
3296
3285
|
Je as useImageServiceLoader,
|
|
3297
3286
|
Uo as useImageTile,
|
|
3298
|
-
|
|
3299
|
-
|
|
3287
|
+
Lr as useLoadImageService,
|
|
3288
|
+
Xr as useLocaleString,
|
|
3300
3289
|
Ce as useManifest,
|
|
3301
3290
|
To as useMediaActions,
|
|
3302
3291
|
Eo as useMediaElements,
|
|
3303
3292
|
xo as useMediaState,
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3293
|
+
Nr as usePaintables,
|
|
3294
|
+
ht as usePaintingAnnotations,
|
|
3295
|
+
kt as useRange,
|
|
3296
|
+
Wr as useRenderingStrategy,
|
|
3308
3297
|
je as useResourceContext,
|
|
3309
|
-
|
|
3310
|
-
|
|
3298
|
+
Ut as useResourceEvents,
|
|
3299
|
+
Mr as useResources,
|
|
3311
3300
|
$o as useSearchService,
|
|
3312
|
-
|
|
3313
|
-
|
|
3301
|
+
yt as useSimpleMediaPlayer,
|
|
3302
|
+
Nt as useSimpleViewer,
|
|
3314
3303
|
Wo as useStyleHelper,
|
|
3315
3304
|
ze as useStyles,
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3305
|
+
Gt as useThumbnail,
|
|
3306
|
+
ae as useVault,
|
|
3307
|
+
Hr as useVaultEffect,
|
|
3319
3308
|
ye as useVaultSelector,
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3309
|
+
wr as useViewerPreset,
|
|
3310
|
+
gr as useVirtualAnnotationPage,
|
|
3311
|
+
mr as useVirtualAnnotationPageContext,
|
|
3312
|
+
Mt as useVisibleCanvases
|
|
3324
3313
|
};
|
|
3325
3314
|
//# sourceMappingURL=index.mjs.map
|