react-iiif-vault 1.0.0 → 1.0.1
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/canvas-panel/index.d.ts +2 -0
- package/dist/bundle/cjs/index.js +7 -7
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +933 -924
- package/dist/bundle/esm/index.mjs.map +1 -1
- package/dist/canvas-panel/cjs/canvas-panel.js +7 -7
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -1
- package/dist/canvas-panel/esm/canvas-panel.mjs +367 -358
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -1
- package/dist/index.umd.js +36 -36
- 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 +933 -924
- package/dist/react17/esm/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsx as x, jsxs as N, Fragment as Me } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import me, { useContext as H, useMemo as E, useState as B, useEffect as K, useCallback as D, createContext as ce, useRef as ge, useLayoutEffect as hr, Fragment as Ke, useReducer as
|
|
4
|
-
import { AtlasAuto as un,
|
|
5
|
-
import { serialize as
|
|
2
|
+
import * as at from "react";
|
|
3
|
+
import me, { useContext as H, useMemo as E, useState as B, useEffect as K, useCallback as D, createContext as ce, useRef as ge, useLayoutEffect as hr, Fragment as Ke, useReducer as an, forwardRef as yr, useImperativeHandle as cn } from "react";
|
|
4
|
+
import { AtlasAuto as un, ModeContext as ln, mergeStyles as fn, RegionHighlight as pn, TileSet as dn, HTMLPortal as hn } from "@atlas-viewer/atlas";
|
|
5
|
+
import { serialize as yn, serializeConfigPresentation2 as vn, serializeConfigPresentation3 as gn, isSpecificResource as mn, HAS_PART as Ze, PART_OF as Xe, frameResource as vr, normalize as bn } from "@iiif/parser";
|
|
6
6
|
import { ImageServiceLoader as gr, getImageServices as mt, getFixedSizeFromImage as Yt } from "@atlas-viewer/iiif-image-api";
|
|
7
7
|
function bt(e, t) {
|
|
8
8
|
return bt = Object.setPrototypeOf || function(i, n) {
|
|
9
9
|
return i.__proto__ = n, i;
|
|
10
10
|
}, bt(e, t);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function An(e, t) {
|
|
13
13
|
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, bt(e, t);
|
|
14
14
|
}
|
|
15
|
-
var
|
|
15
|
+
var xn = function(t, r) {
|
|
16
16
|
return t === void 0 && (t = []), r === void 0 && (r = []), t.length !== r.length || t.some(function(i, n) {
|
|
17
17
|
return !Object.is(i, r[n]);
|
|
18
18
|
});
|
|
19
19
|
}, Gt = {
|
|
20
20
|
error: null
|
|
21
|
-
},
|
|
22
|
-
|
|
21
|
+
}, wn = /* @__PURE__ */ function(e) {
|
|
22
|
+
An(t, e);
|
|
23
23
|
function t() {
|
|
24
|
-
for (var i, n = arguments.length, s = new Array(n),
|
|
25
|
-
s[
|
|
24
|
+
for (var i, n = arguments.length, s = new Array(n), o = 0; o < n; o++)
|
|
25
|
+
s[o] = arguments[o];
|
|
26
26
|
return i = e.call.apply(e, [this].concat(s)) || this, i.state = Gt, i.resetErrorBoundary = function() {
|
|
27
|
-
for (var
|
|
27
|
+
for (var a, u = arguments.length, d = new Array(u), l = 0; l < u; l++)
|
|
28
28
|
d[l] = arguments[l];
|
|
29
|
-
i.props.onReset == null || (
|
|
29
|
+
i.props.onReset == null || (a = i.props).onReset.apply(a, d), i.reset();
|
|
30
30
|
}, i;
|
|
31
31
|
}
|
|
32
32
|
t.getDerivedStateFromError = function(n) {
|
|
@@ -38,40 +38,40 @@ var An = function(t, r) {
|
|
|
38
38
|
return r.reset = function() {
|
|
39
39
|
this.setState(Gt);
|
|
40
40
|
}, r.componentDidCatch = function(n, s) {
|
|
41
|
-
var
|
|
42
|
-
(
|
|
41
|
+
var o, a;
|
|
42
|
+
(o = (a = this.props).onError) == null || o.call(a, n, s);
|
|
43
43
|
}, r.componentDidUpdate = function(n, s) {
|
|
44
|
-
var
|
|
45
|
-
if (
|
|
44
|
+
var o = this.state.error, a = this.props.resetKeys;
|
|
45
|
+
if (o !== null && s.error !== null && xn(n.resetKeys, a)) {
|
|
46
46
|
var u, d;
|
|
47
|
-
(u = (d = this.props).onResetKeysChange) == null || u.call(d, n.resetKeys,
|
|
47
|
+
(u = (d = this.props).onResetKeysChange) == null || u.call(d, n.resetKeys, a), this.reset();
|
|
48
48
|
}
|
|
49
49
|
}, r.render = function() {
|
|
50
|
-
var n = this.state.error, s = this.props,
|
|
50
|
+
var n = this.state.error, s = this.props, o = s.fallbackRender, a = s.FallbackComponent, u = s.fallback;
|
|
51
51
|
if (n !== null) {
|
|
52
52
|
var d = {
|
|
53
53
|
error: n,
|
|
54
54
|
resetErrorBoundary: this.resetErrorBoundary
|
|
55
55
|
};
|
|
56
|
-
if (/* @__PURE__ */
|
|
56
|
+
if (/* @__PURE__ */ at.isValidElement(u))
|
|
57
57
|
return u;
|
|
58
|
-
if (typeof
|
|
59
|
-
return
|
|
60
|
-
if (
|
|
61
|
-
return /* @__PURE__ */
|
|
58
|
+
if (typeof o == "function")
|
|
59
|
+
return o(d);
|
|
60
|
+
if (a)
|
|
61
|
+
return /* @__PURE__ */ at.createElement(a, d);
|
|
62
62
|
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
63
63
|
}
|
|
64
64
|
return this.props.children;
|
|
65
65
|
}, t;
|
|
66
|
-
}(
|
|
67
|
-
const
|
|
66
|
+
}(at.Component);
|
|
67
|
+
const Sn = {
|
|
68
68
|
collection: void 0,
|
|
69
69
|
manifest: void 0,
|
|
70
70
|
range: void 0,
|
|
71
71
|
canvas: void 0,
|
|
72
72
|
annotation: void 0,
|
|
73
73
|
annotationPage: void 0
|
|
74
|
-
}, Et = me.createContext(
|
|
74
|
+
}, Et = me.createContext(Sn), be = () => H(Et);
|
|
75
75
|
function Te({ value: e, children: t }) {
|
|
76
76
|
const r = be(), i = E(() => ({
|
|
77
77
|
...r,
|
|
@@ -79,7 +79,7 @@ function Te({ value: e, children: t }) {
|
|
|
79
79
|
}), [e, r]);
|
|
80
80
|
return /* @__PURE__ */ x(Et.Provider, { value: i, children: t });
|
|
81
81
|
}
|
|
82
|
-
var
|
|
82
|
+
var Cn = Object.defineProperty, Mn = (e, t, r) => t in e ? Cn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ve = (e, t, r) => (Mn(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
83
83
|
const q = function(e) {
|
|
84
84
|
return function() {
|
|
85
85
|
const t = { type: e, getType: () => e, toString: () => e };
|
|
@@ -89,31 +89,31 @@ const q = function(e) {
|
|
|
89
89
|
...i !== void 0 && { meta: i }
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
|
-
}, mr = "@iiif/IMPORT_ENTITIES", br = "@iiif/MODIFY_ENTITY_FIELD", Ar = "@iiif/REORDER_ENTITY_FIELD", xr = "@iiif/ADD_REFERENCE", At = "@iiif/UPDATE_REFERENCE", wr = "@iiif/REMOVE_REFERENCE", Sr = "@iiif/ADD_METADATA", Cr = "@iiif/REMOVE_METADATA", xt = "@iiif/UPDATE_METADATA", Mr = "@iiif/REORDER_METADATA", Rr = q(mr)(),
|
|
92
|
+
}, mr = "@iiif/IMPORT_ENTITIES", br = "@iiif/MODIFY_ENTITY_FIELD", Ar = "@iiif/REORDER_ENTITY_FIELD", xr = "@iiif/ADD_REFERENCE", At = "@iiif/UPDATE_REFERENCE", wr = "@iiif/REMOVE_REFERENCE", Sr = "@iiif/ADD_METADATA", Cr = "@iiif/REMOVE_METADATA", xt = "@iiif/UPDATE_METADATA", Mr = "@iiif/REORDER_METADATA", Rr = q(mr)(), Rn = q(br)(), In = q(Ar)(), Tn = q(xr)(), kn = q(wr)(), On = q(At)(), En = q(Sr)(), Pn = q(xt)(), Ln = q(Cr)(), Fn = q(Mr)(), jn = {
|
|
93
93
|
importEntities: Rr,
|
|
94
|
-
modifyEntityField:
|
|
95
|
-
reorderEntityField:
|
|
96
|
-
addReference:
|
|
97
|
-
removeReference:
|
|
98
|
-
updateReference:
|
|
99
|
-
addMetadata:
|
|
100
|
-
removeMetadata:
|
|
101
|
-
updateMetadata:
|
|
102
|
-
reorderMetadata:
|
|
103
|
-
}, Ir = "@iiif/ADD_MAPPING", Tr = "@iiif/ADD_MAPPINGS",
|
|
104
|
-
setMetaValue:
|
|
105
|
-
setMetaValueDynamic:
|
|
106
|
-
unsetMetaValue:
|
|
107
|
-
}, wt = "RESOURCE_ERROR", Pr = "RESOURCE_LOADING", St = "RESOURCE_READY", Lr = "@iiif/REQUEST_RESOURCE", Fr = "@iiif/REQUEST_ERROR", jr = "@iiif/REQUEST_MISMATCH", $r = "@iiif/REQUEST_COMPLETE",
|
|
108
|
-
const { entities: r, resource: i, mapping: n } =
|
|
94
|
+
modifyEntityField: Rn,
|
|
95
|
+
reorderEntityField: In,
|
|
96
|
+
addReference: Tn,
|
|
97
|
+
removeReference: kn,
|
|
98
|
+
updateReference: On,
|
|
99
|
+
addMetadata: En,
|
|
100
|
+
removeMetadata: Ln,
|
|
101
|
+
updateMetadata: Pn,
|
|
102
|
+
reorderMetadata: Fn
|
|
103
|
+
}, Ir = "@iiif/ADD_MAPPING", Tr = "@iiif/ADD_MAPPINGS", $n = q(Ir)(), Dn = q(Tr)(), kr = "@iiif/SET_META_VALUE", Or = "@iiif/SET_META_VALUE_DYNAMIC", Er = "@iiif/UNSET_META_VALUE", qn = q(kr)(), _n = q(Or)(), Un = q(Er)(), Jt = {
|
|
104
|
+
setMetaValue: qn,
|
|
105
|
+
setMetaValueDynamic: _n,
|
|
106
|
+
unsetMetaValue: Un
|
|
107
|
+
}, wt = "RESOURCE_ERROR", Pr = "RESOURCE_LOADING", St = "RESOURCE_READY", Lr = "@iiif/REQUEST_RESOURCE", Fr = "@iiif/REQUEST_ERROR", jr = "@iiif/REQUEST_MISMATCH", $r = "@iiif/REQUEST_COMPLETE", Vn = "@iiif/REQUEST_OFFLINE_RESOURCE", Nn = q(Lr)(), Dr = q(Fr)(), Hn = q(jr)(), Bn = q($r)(), Pt = "@iiif/BATCH", zn = "@iiif/BATCH_IMPORT", Ct = q(Pt)(), Wn = (e, t) => {
|
|
108
|
+
const { entities: r, resource: i, mapping: n } = bn(t);
|
|
109
109
|
if (i.id === void 0)
|
|
110
110
|
return [Dr({ id: e, message: "ID is not defined in resource." })];
|
|
111
|
-
const s = [Rr({ entities: r }),
|
|
112
|
-
return i.id !== e && (s.push(
|
|
111
|
+
const s = [Rr({ entities: r }), Dn({ mapping: n })];
|
|
112
|
+
return i.id !== e && (s.push($n({ id: e, type: i.type })), s.push(Hn({ requestId: e, actualId: i.id }))), s.push(Bn({ id: e })), s;
|
|
113
113
|
}, Kt = Number.isNaN || function(e) {
|
|
114
114
|
return typeof e == "number" && e !== e;
|
|
115
115
|
};
|
|
116
|
-
function
|
|
116
|
+
function Qn(e, t) {
|
|
117
117
|
return !!(e === t || Kt(e) && Kt(t));
|
|
118
118
|
}
|
|
119
119
|
function Zt(e, t) {
|
|
@@ -122,7 +122,7 @@ function Zt(e, t) {
|
|
|
122
122
|
if (e.length !== t.length)
|
|
123
123
|
return !1;
|
|
124
124
|
for (let r = 0; r < e.length; r++)
|
|
125
|
-
if (!
|
|
125
|
+
if (!Qn(e[r], t[r]))
|
|
126
126
|
return !1;
|
|
127
127
|
return !0;
|
|
128
128
|
}
|
|
@@ -132,16 +132,16 @@ function ct(e, t, r) {
|
|
|
132
132
|
return;
|
|
133
133
|
const s = e.iiif.entities[n][i.resourceUri];
|
|
134
134
|
if (s && s[Ze]) {
|
|
135
|
-
const
|
|
136
|
-
return vr(s,
|
|
135
|
+
const o = s[Ze].find((a) => r ? a[Xe] === r.id : a[Xe] === s.id);
|
|
136
|
+
return vr(s, o);
|
|
137
137
|
}
|
|
138
138
|
return s;
|
|
139
139
|
}
|
|
140
140
|
function Xt(e, t, { waitTimeout: r = 30 } = {}) {
|
|
141
141
|
return async (i, n) => {
|
|
142
|
-
const s = e.getStore(),
|
|
143
|
-
if (
|
|
144
|
-
switch (
|
|
142
|
+
const s = e.getStore(), o = s.getState(), a = o.iiif.requests[i];
|
|
143
|
+
if (a)
|
|
144
|
+
switch (a.loadingState) {
|
|
145
145
|
case wt:
|
|
146
146
|
break;
|
|
147
147
|
case Pr: {
|
|
@@ -176,17 +176,17 @@ function Xt(e, t, { waitTimeout: r = 30 } = {}) {
|
|
|
176
176
|
break;
|
|
177
177
|
}
|
|
178
178
|
case St: {
|
|
179
|
-
const u = ct(
|
|
179
|
+
const u = ct(o, i);
|
|
180
180
|
if (u)
|
|
181
181
|
return u;
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
e.dispatch(
|
|
185
|
+
e.dispatch(Nn({ id: i }));
|
|
186
186
|
try {
|
|
187
187
|
const u = await t(i, n);
|
|
188
188
|
!u.id && !u["@id"] && (u["@type"] && (u["@id"] = i), u.id = i);
|
|
189
|
-
const d =
|
|
189
|
+
const d = Wn(i, u);
|
|
190
190
|
return e.dispatch(Ct({ actions: d })), ct(s.getState(), i);
|
|
191
191
|
} catch (u) {
|
|
192
192
|
throw e.dispatch(Dr({ id: i, message: u.toString() })), u;
|
|
@@ -210,22 +210,22 @@ function qr() {
|
|
|
210
210
|
}
|
|
211
211
|
const er = (e) => {
|
|
212
212
|
let t;
|
|
213
|
-
const r = /* @__PURE__ */ new Set(), i = (
|
|
214
|
-
const u = typeof
|
|
213
|
+
const r = /* @__PURE__ */ new Set(), i = (o, a) => {
|
|
214
|
+
const u = typeof o == "function" ? o(t) : o;
|
|
215
215
|
if (!Object.is(u, t)) {
|
|
216
216
|
const d = t;
|
|
217
|
-
t =
|
|
217
|
+
t = a ?? typeof u != "object" ? u : Object.assign({}, t, u), r.forEach((l) => l(t, d));
|
|
218
218
|
}
|
|
219
|
-
}, n = () => t, s = { setState: i, getState: n, subscribe: (
|
|
219
|
+
}, n = () => t, s = { setState: i, getState: n, subscribe: (o) => (r.add(o), () => r.delete(o)), destroy: () => {
|
|
220
220
|
r.clear();
|
|
221
221
|
} };
|
|
222
222
|
return t = e(i, n, s), s;
|
|
223
|
-
},
|
|
223
|
+
}, Yn = (e) => e ? er(e) : er, Gn = (e, t) => (r, i, n) => (n.dispatch = (s) => (r((o) => e(o, s), !1, s), s), n.dispatchFromDevtools = !0, { dispatch: (...s) => n.dispatch(...s), ...t }), Jn = Gn, Mt = /* @__PURE__ */ new Map(), Ne = (e) => {
|
|
224
224
|
const t = Mt.get(e);
|
|
225
225
|
return t ? Object.fromEntries(
|
|
226
226
|
Object.entries(t.stores).map(([r, i]) => [r, i.getState()])
|
|
227
227
|
) : {};
|
|
228
|
-
},
|
|
228
|
+
}, Kn = (e, t, r) => {
|
|
229
229
|
if (e === void 0)
|
|
230
230
|
return {
|
|
231
231
|
type: "untracked",
|
|
@@ -239,8 +239,8 @@ const er = (e) => {
|
|
|
239
239
|
stores: {}
|
|
240
240
|
};
|
|
241
241
|
return Mt.set(r.name, n), { type: "tracked", store: e, ...n };
|
|
242
|
-
},
|
|
243
|
-
const { enabled: s, anonymousActionType:
|
|
242
|
+
}, Zn = (e, t = {}) => (r, i, n) => {
|
|
243
|
+
const { enabled: s, anonymousActionType: o, store: a, ...u } = t;
|
|
244
244
|
let d;
|
|
245
245
|
try {
|
|
246
246
|
d = (s ?? !1) && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
@@ -248,21 +248,21 @@ const er = (e) => {
|
|
|
248
248
|
}
|
|
249
249
|
if (!d)
|
|
250
250
|
return e(r, i, n);
|
|
251
|
-
const { connection: l, ...p } =
|
|
251
|
+
const { connection: l, ...p } = Kn(a, d, u);
|
|
252
252
|
let v = !0;
|
|
253
253
|
n.setState = (g, b, A) => {
|
|
254
254
|
const w = r(g, b);
|
|
255
255
|
if (!v)
|
|
256
256
|
return w;
|
|
257
|
-
const C = A === void 0 ? { type:
|
|
258
|
-
return
|
|
257
|
+
const C = A === void 0 ? { type: o || "anonymous" } : typeof A == "string" ? { type: A } : A;
|
|
258
|
+
return a === void 0 ? (l == null || l.send(C, i()), w) : (l == null || l.send(
|
|
259
259
|
{
|
|
260
260
|
...C,
|
|
261
|
-
type: `${
|
|
261
|
+
type: `${a}/${C.type}`
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
...Ne(u.name),
|
|
265
|
-
[
|
|
265
|
+
[a]: n.getState()
|
|
266
266
|
}
|
|
267
267
|
), w);
|
|
268
268
|
};
|
|
@@ -297,7 +297,7 @@ const er = (e) => {
|
|
|
297
297
|
g.payload,
|
|
298
298
|
(A) => {
|
|
299
299
|
if (A.type === "__setState") {
|
|
300
|
-
if (
|
|
300
|
+
if (a === void 0) {
|
|
301
301
|
m(A.state);
|
|
302
302
|
return;
|
|
303
303
|
}
|
|
@@ -308,7 +308,7 @@ const er = (e) => {
|
|
|
308
308
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
309
309
|
`
|
|
310
310
|
);
|
|
311
|
-
const w = A.state[
|
|
311
|
+
const w = A.state[a];
|
|
312
312
|
if (w == null)
|
|
313
313
|
return;
|
|
314
314
|
JSON.stringify(n.getState()) !== JSON.stringify(w) && m(w);
|
|
@@ -320,35 +320,35 @@ const er = (e) => {
|
|
|
320
320
|
case "DISPATCH":
|
|
321
321
|
switch (g.payload.type) {
|
|
322
322
|
case "RESET":
|
|
323
|
-
return m(h),
|
|
323
|
+
return m(h), a === void 0 ? l == null ? void 0 : l.init(n.getState()) : l == null ? void 0 : l.init(Ne(u.name));
|
|
324
324
|
case "COMMIT":
|
|
325
|
-
if (
|
|
325
|
+
if (a === void 0) {
|
|
326
326
|
l == null || l.init(n.getState());
|
|
327
327
|
return;
|
|
328
328
|
}
|
|
329
329
|
return l == null ? void 0 : l.init(Ne(u.name));
|
|
330
330
|
case "ROLLBACK":
|
|
331
331
|
return ut(g.state, (A) => {
|
|
332
|
-
if (
|
|
332
|
+
if (a === void 0) {
|
|
333
333
|
m(A), l == null || l.init(n.getState());
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
|
-
m(A[
|
|
336
|
+
m(A[a]), l == null || l.init(Ne(u.name));
|
|
337
337
|
});
|
|
338
338
|
case "JUMP_TO_STATE":
|
|
339
339
|
case "JUMP_TO_ACTION":
|
|
340
340
|
return ut(g.state, (A) => {
|
|
341
|
-
if (
|
|
341
|
+
if (a === void 0) {
|
|
342
342
|
m(A);
|
|
343
343
|
return;
|
|
344
344
|
}
|
|
345
|
-
JSON.stringify(n.getState()) !== JSON.stringify(A[
|
|
345
|
+
JSON.stringify(n.getState()) !== JSON.stringify(A[a]) && m(A[a]);
|
|
346
346
|
});
|
|
347
347
|
case "IMPORT_STATE": {
|
|
348
348
|
const { nextLiftedState: A } = g.payload, w = (b = A.computedStates.slice(-1)[0]) == null ? void 0 : b.state;
|
|
349
349
|
if (!w)
|
|
350
350
|
return;
|
|
351
|
-
m(
|
|
351
|
+
m(a === void 0 ? w : w[a]), l == null || l.send(
|
|
352
352
|
null,
|
|
353
353
|
// FIXME no-any
|
|
354
354
|
A
|
|
@@ -361,7 +361,7 @@ const er = (e) => {
|
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
363
|
}), h;
|
|
364
|
-
},
|
|
364
|
+
}, Xn = Zn, ut = (e, t) => {
|
|
365
365
|
let r;
|
|
366
366
|
try {
|
|
367
367
|
r = JSON.parse(e);
|
|
@@ -372,24 +372,24 @@ const er = (e) => {
|
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
374
|
r !== void 0 && t(r);
|
|
375
|
-
},
|
|
375
|
+
}, es = (e) => (t, r, i) => {
|
|
376
376
|
const n = i.subscribe;
|
|
377
|
-
return i.subscribe = (s,
|
|
377
|
+
return i.subscribe = (s, o, a) => {
|
|
378
378
|
let u = s;
|
|
379
|
-
if (
|
|
380
|
-
const d = (
|
|
379
|
+
if (o) {
|
|
380
|
+
const d = (a == null ? void 0 : a.equalityFn) || Object.is;
|
|
381
381
|
let l = s(i.getState());
|
|
382
382
|
u = (p) => {
|
|
383
383
|
const v = s(p);
|
|
384
384
|
if (!d(l, v)) {
|
|
385
385
|
const m = l;
|
|
386
|
-
|
|
386
|
+
o(l = v, m);
|
|
387
387
|
}
|
|
388
|
-
},
|
|
388
|
+
}, a != null && a.fireImmediately && o(l, l);
|
|
389
389
|
}
|
|
390
390
|
return n(u);
|
|
391
391
|
}, e(t, r, i);
|
|
392
|
-
},
|
|
392
|
+
}, ts = es, rs = (e = {}, t) => {
|
|
393
393
|
switch (t.type) {
|
|
394
394
|
case Ir:
|
|
395
395
|
return {
|
|
@@ -408,16 +408,16 @@ const er = (e) => {
|
|
|
408
408
|
function lt(e, t, r, i) {
|
|
409
409
|
return !(!e[r] || !e[r][t] || !e[r][t][i] || !Array.isArray(e[r][t][i]));
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function is(e, t) {
|
|
412
412
|
const r = {}, i = [];
|
|
413
413
|
for (const [n, s] of Object.entries(e || {})) {
|
|
414
414
|
i.push(n);
|
|
415
|
-
const
|
|
416
|
-
if (!
|
|
415
|
+
const o = (t || {})[n];
|
|
416
|
+
if (!o || o.length === 0) {
|
|
417
417
|
r[n] = s;
|
|
418
418
|
continue;
|
|
419
419
|
}
|
|
420
|
-
r[n] =
|
|
420
|
+
r[n] = o;
|
|
421
421
|
}
|
|
422
422
|
for (const [n, s] of Object.entries(t || {}))
|
|
423
423
|
i.indexOf(n) === -1 && (r[n] = s);
|
|
@@ -429,7 +429,7 @@ function R(e) {
|
|
|
429
429
|
function ft(e, t) {
|
|
430
430
|
return typeof e > "u" ? t : e;
|
|
431
431
|
}
|
|
432
|
-
const
|
|
432
|
+
const ns = (e = qr(), t) => {
|
|
433
433
|
var r;
|
|
434
434
|
const i = (n, s) => ({
|
|
435
435
|
...e,
|
|
@@ -454,19 +454,19 @@ const is = (e = qr(), t) => {
|
|
|
454
454
|
const n = e[R(t).type][R(t).id];
|
|
455
455
|
if (typeof n == "string")
|
|
456
456
|
return e;
|
|
457
|
-
const s = Array.from(n[R(t).key]), [
|
|
458
|
-
return s.splice(R(t).endIndex, 0,
|
|
457
|
+
const s = Array.from(n[R(t).key]), [o] = s.splice(R(t).startIndex, 1);
|
|
458
|
+
return s.splice(R(t).endIndex, 0, o), i(n, { [R(t).key]: s });
|
|
459
459
|
}
|
|
460
460
|
case mr: {
|
|
461
461
|
const n = Object.keys(R(t).entities), s = { ...e };
|
|
462
|
-
for (const
|
|
463
|
-
const
|
|
462
|
+
for (const o of n) {
|
|
463
|
+
const a = R(t).entities[o], u = { ...e[o] || {} };
|
|
464
464
|
let d = !1;
|
|
465
|
-
const l = Object.keys(
|
|
466
|
-
if (
|
|
465
|
+
const l = Object.keys(a || {}) || [];
|
|
466
|
+
if (a && l) {
|
|
467
467
|
for (const p of l)
|
|
468
|
-
d = !0, u[p] = e[
|
|
469
|
-
d && (s[
|
|
468
|
+
d = !0, u[p] = e[o][p] ? is(e[o][p], a[p]) : a[p];
|
|
469
|
+
d && (s[o] = u);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
return s;
|
|
@@ -481,41 +481,41 @@ const is = (e = qr(), t) => {
|
|
|
481
481
|
case wr: {
|
|
482
482
|
if (!lt(e, R(t).id, R(t).type, R(t).key))
|
|
483
483
|
return e;
|
|
484
|
-
const n = e[R(t).type][R(t).id], s = Array.from(n[R(t).key]),
|
|
484
|
+
const n = e[R(t).type][R(t).id], s = Array.from(n[R(t).key]), o = ft(
|
|
485
485
|
R(t).index,
|
|
486
|
-
s.findIndex((
|
|
486
|
+
s.findIndex((a) => a && a.id === R(t).reference.id)
|
|
487
487
|
);
|
|
488
|
-
return
|
|
488
|
+
return o === -1 || ((r = s[o]) == null ? void 0 : r.id) !== R(t).reference.id ? e : (t.type === At ? s.splice(o, 1, R(t).reference) : s.splice(o, 1), i(n, { [R(t).key]: s }));
|
|
489
489
|
}
|
|
490
490
|
case Sr: {
|
|
491
491
|
const n = e[R(t).type][R(t).id];
|
|
492
492
|
if (!n)
|
|
493
493
|
return e;
|
|
494
|
-
const s = Array.from(n.metadata || []),
|
|
494
|
+
const s = Array.from(n.metadata || []), o = R(t);
|
|
495
495
|
return s.splice(ft(t.payload.beforeIndex, s.length + 1), 0, {
|
|
496
|
-
label:
|
|
497
|
-
value:
|
|
496
|
+
label: o.label,
|
|
497
|
+
value: o.label
|
|
498
498
|
}), i(n, { metadata: s });
|
|
499
499
|
}
|
|
500
500
|
case Mr: {
|
|
501
501
|
const n = e[R(t).type][R(t).id];
|
|
502
502
|
if (typeof n == "string" || !n)
|
|
503
503
|
return e;
|
|
504
|
-
const s = Array.from(n.metadata || []), [
|
|
505
|
-
return s.splice(R(t).endIndex, 0,
|
|
504
|
+
const s = Array.from(n.metadata || []), [o] = s.splice(R(t).startIndex, 1);
|
|
505
|
+
return s.splice(R(t).endIndex, 0, o), i(n, { metadata: s });
|
|
506
506
|
}
|
|
507
507
|
case xt:
|
|
508
508
|
case Cr: {
|
|
509
|
-
const n = e[R(t).type][R(t).id], s = Array.from(n.metadata || []),
|
|
510
|
-
return typeof
|
|
509
|
+
const n = e[R(t).type][R(t).id], s = Array.from(n.metadata || []), o = R(t).atIndex;
|
|
510
|
+
return typeof o > "u" || o === -1 || !s[o] ? e : (t.type === xt ? s.splice(o, 1, { label: R(t).label, value: R(t).value }) : s.splice(o, 1), i(n, { metadata: s }));
|
|
511
511
|
}
|
|
512
512
|
default:
|
|
513
513
|
return e;
|
|
514
514
|
}
|
|
515
|
-
},
|
|
515
|
+
}, ss = (e = {}, t) => {
|
|
516
516
|
switch (t.type) {
|
|
517
517
|
case Lr:
|
|
518
|
-
case
|
|
518
|
+
case Vn:
|
|
519
519
|
return {
|
|
520
520
|
...e,
|
|
521
521
|
[t.payload.id]: {
|
|
@@ -560,8 +560,8 @@ const is = (e = qr(), t) => {
|
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
return e;
|
|
563
|
-
},
|
|
564
|
-
const { id: r, updateValue: i, value: n, meta: s, key:
|
|
563
|
+
}, os = (e = {}, t) => {
|
|
564
|
+
const { id: r, updateValue: i, value: n, meta: s, key: o } = t && t.payload || {};
|
|
565
565
|
switch (t.type) {
|
|
566
566
|
case kr:
|
|
567
567
|
return {
|
|
@@ -570,7 +570,7 @@ const is = (e = qr(), t) => {
|
|
|
570
570
|
...e[r] || {},
|
|
571
571
|
[s]: {
|
|
572
572
|
...e[r] ? e[r][s] || {} : {},
|
|
573
|
-
[
|
|
573
|
+
[o]: n
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
};
|
|
@@ -581,18 +581,18 @@ const is = (e = qr(), t) => {
|
|
|
581
581
|
...e[r] || {},
|
|
582
582
|
[s]: {
|
|
583
583
|
...e[r] ? e[r][s] || {} : {},
|
|
584
|
-
[
|
|
584
|
+
[o]: e[r] && e[r][s] ? i(e[r][s][o]) : i(void 0)
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
};
|
|
588
588
|
case Er:
|
|
589
|
-
return e[r] && e[r][s] && e[r][s][
|
|
589
|
+
return e[r] && e[r][s] && e[r][s][o] ? {
|
|
590
590
|
...e,
|
|
591
591
|
[r]: {
|
|
592
592
|
...e[r] || {},
|
|
593
593
|
[s]: {
|
|
594
594
|
...e[r] ? e[r][s] || {} : {},
|
|
595
|
-
[
|
|
595
|
+
[o]: void 0
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
} : e;
|
|
@@ -605,15 +605,15 @@ function _r(e = {}) {
|
|
|
605
605
|
return function(r = {}, i) {
|
|
606
606
|
let n = !1;
|
|
607
607
|
const s = {};
|
|
608
|
-
for (let
|
|
609
|
-
const
|
|
610
|
-
s[
|
|
608
|
+
for (let o = 0; o < t.length; o++) {
|
|
609
|
+
const a = t[o];
|
|
610
|
+
s[a] = e[a](r[a], i), n = n || s[a] !== r[a];
|
|
611
611
|
}
|
|
612
612
|
return n ? s : r;
|
|
613
613
|
};
|
|
614
614
|
}
|
|
615
615
|
function as(e) {
|
|
616
|
-
return (t, r) => r && r.type === Pt ? r.payload.actions.reduce(e, t) : r && r.type ===
|
|
616
|
+
return (t, r) => r && r.type === Pt ? r.payload.actions.reduce(e, t) : r && r.type === zn ? {
|
|
617
617
|
...t,
|
|
618
618
|
iiif: {
|
|
619
619
|
...t.iiif,
|
|
@@ -621,13 +621,13 @@ function as(e) {
|
|
|
621
621
|
}
|
|
622
622
|
} : e(t, r);
|
|
623
623
|
}
|
|
624
|
-
const
|
|
625
|
-
mapping:
|
|
626
|
-
entities:
|
|
627
|
-
requests:
|
|
628
|
-
meta:
|
|
624
|
+
const cs = _r({
|
|
625
|
+
mapping: rs,
|
|
626
|
+
entities: ns,
|
|
627
|
+
requests: ss,
|
|
628
|
+
meta: os
|
|
629
629
|
});
|
|
630
|
-
function
|
|
630
|
+
function us() {
|
|
631
631
|
return {
|
|
632
632
|
iiif: {
|
|
633
633
|
entities: qr(),
|
|
@@ -637,16 +637,16 @@ function cs() {
|
|
|
637
637
|
}
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function ls(e = {}) {
|
|
641
641
|
const {
|
|
642
642
|
enableDevtools: t = !1,
|
|
643
643
|
iiifStoreName: r = "iiif",
|
|
644
|
-
defaultState: i =
|
|
644
|
+
defaultState: i = us(),
|
|
645
645
|
customReducers: n = {}
|
|
646
|
-
} = e, s = as(_r({ [r]:
|
|
647
|
-
return
|
|
646
|
+
} = e, s = as(_r({ [r]: cs, ...n }));
|
|
647
|
+
return Yn(ts(Xn(Jn(s, i), { enabled: t })));
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function fs(e) {
|
|
650
650
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(t, r) {
|
|
651
651
|
var i = e.get(t);
|
|
652
652
|
i ? i.push(r) : e.set(t, [r]);
|
|
@@ -673,10 +673,10 @@ function G(e, t, r, i = !0) {
|
|
|
673
673
|
const s = t[Se][e];
|
|
674
674
|
if (!s)
|
|
675
675
|
return s;
|
|
676
|
-
const
|
|
676
|
+
const o = r.get(t[Se][e], {
|
|
677
677
|
parent: this.id ? { id: this.id, type: this.type } : void 0
|
|
678
678
|
});
|
|
679
|
-
return n.has(
|
|
679
|
+
return n.has(o) || (n.clear(), n.set(o, Ce(o, r))), n.get(o);
|
|
680
680
|
},
|
|
681
681
|
set(s) {
|
|
682
682
|
t[Se][e] !== s && (this[we] ? r.modifyEntityField({ id: this.id, type: this.type }, e, Ur(s)) : this[Se][e] = s);
|
|
@@ -684,7 +684,7 @@ function G(e, t, r, i = !0) {
|
|
|
684
684
|
});
|
|
685
685
|
}
|
|
686
686
|
const Se = Symbol.for("_refs_"), we = Symbol.for("_reactive_"), Oe = Symbol.for("_defined_"), tr = Symbol.for("_parent_");
|
|
687
|
-
function
|
|
687
|
+
function ps(e, t = !1, r) {
|
|
688
688
|
const i = {
|
|
689
689
|
id: "",
|
|
690
690
|
type: "unknown",
|
|
@@ -757,7 +757,7 @@ function fs(e, t = !1, r) {
|
|
|
757
757
|
};
|
|
758
758
|
return G("items", i, e), G("annotations", i, e), G("structures", i, e), G("seeAlso", i, e), G("rendering", i, e), G("partOf", i, e), G("start", i, e, !1), G("supplementary", i, e), G("homepage", i, e), G("thumbnail", i, e), G("placeholderCanvas", i, e, !1), G("accompanyingCanvas", i, e, !1), G("provider", i, e), G("body", i, e), G("logo", i, e), i;
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function ds(e) {
|
|
761
761
|
return !!e[Oe];
|
|
762
762
|
}
|
|
763
763
|
function Ur(e) {
|
|
@@ -765,11 +765,11 @@ function Ur(e) {
|
|
|
765
765
|
}
|
|
766
766
|
function Ce(e, t, r = !1, i) {
|
|
767
767
|
if (Array.isArray(e))
|
|
768
|
-
return e.map((
|
|
768
|
+
return e.map((a) => Ce(a, t, r));
|
|
769
769
|
if (!e || !e.type || !e.id)
|
|
770
770
|
return e;
|
|
771
|
-
const n =
|
|
772
|
-
return r &&
|
|
771
|
+
const n = ps(t, r), s = Object.create(n), o = Object.assign(s, e);
|
|
772
|
+
return r && o.reactive(), o;
|
|
773
773
|
}
|
|
774
774
|
function rr(e) {
|
|
775
775
|
switch (e) {
|
|
@@ -799,11 +799,11 @@ let Rt = class {
|
|
|
799
799
|
enableDevtools: !0
|
|
800
800
|
},
|
|
801
801
|
t || {}
|
|
802
|
-
), this.store = r ||
|
|
802
|
+
), this.store = r || ls({
|
|
803
803
|
customReducers: this.options.reducers,
|
|
804
804
|
defaultState: this.options.defaultState,
|
|
805
805
|
enableDevtools: this.options.enableDevtools
|
|
806
|
-
}), this.emitter =
|
|
806
|
+
}), this.emitter = fs(), this.remoteFetcher = Xt(this, this.options.customFetcher), this.staticFetcher = Xt(this, (i, n) => n);
|
|
807
807
|
}
|
|
808
808
|
batch(t) {
|
|
809
809
|
this.isBatching = !0;
|
|
@@ -825,7 +825,7 @@ let Rt = class {
|
|
|
825
825
|
}
|
|
826
826
|
modifyEntityField(t, r, i) {
|
|
827
827
|
this.dispatch(
|
|
828
|
-
|
|
828
|
+
jn.modifyEntityField({
|
|
829
829
|
id: t.id,
|
|
830
830
|
type: t.type,
|
|
831
831
|
key: r,
|
|
@@ -858,13 +858,13 @@ let Rt = class {
|
|
|
858
858
|
};
|
|
859
859
|
}
|
|
860
860
|
serialize(t, r) {
|
|
861
|
-
return
|
|
861
|
+
return yn(this.getState().iiif, t, r);
|
|
862
862
|
}
|
|
863
863
|
toPresentation2(t) {
|
|
864
|
-
return this.serialize(t,
|
|
864
|
+
return this.serialize(t, vn);
|
|
865
865
|
}
|
|
866
866
|
toPresentation3(t) {
|
|
867
|
-
return this.serialize(t,
|
|
867
|
+
return this.serialize(t, gn);
|
|
868
868
|
}
|
|
869
869
|
hydrate(t, r, i = {}) {
|
|
870
870
|
return this.get(t, r, { ...i, skipSelfReturn: !1 });
|
|
@@ -875,9 +875,9 @@ let Rt = class {
|
|
|
875
875
|
let s = i.parent ? typeof i.parent == "string" ? i.parent : i.parent.id : void 0;
|
|
876
876
|
if (Array.isArray(t))
|
|
877
877
|
return t.map((p) => this.get(p, i));
|
|
878
|
-
const
|
|
879
|
-
if (
|
|
880
|
-
const p = rr(r ||
|
|
878
|
+
const o = this.getState();
|
|
879
|
+
if (mn(t) && !i.preserveSpecificResources && (t = t.source), typeof t == "string") {
|
|
880
|
+
const p = rr(r || o.iiif.mapping[t]);
|
|
881
881
|
if (!p)
|
|
882
882
|
return n ? null : { id: t, type: "unknown" };
|
|
883
883
|
t = { id: t, type: p };
|
|
@@ -886,9 +886,9 @@ let Rt = class {
|
|
|
886
886
|
const p = Array.isArray(t.partOf) ? t.partOf[0] : t.partOf;
|
|
887
887
|
p && (typeof p == "string" && (s = p), typeof p.id == "string" && (s = p.id));
|
|
888
888
|
}
|
|
889
|
-
const
|
|
889
|
+
const a = rr(r || (t == null ? void 0 : t.type)), u = t == null ? void 0 : t.id, d = o.iiif.entities[a];
|
|
890
890
|
if (!d) {
|
|
891
|
-
const p =
|
|
891
|
+
const p = o.iiif.requests[u];
|
|
892
892
|
return p && p.resourceUri !== u ? this.get(p.resourceUri, i) : n ? null : t;
|
|
893
893
|
}
|
|
894
894
|
const l = d[t.id];
|
|
@@ -912,7 +912,7 @@ let Rt = class {
|
|
|
912
912
|
return this.get(r, { skipSelfReturn: !1 });
|
|
913
913
|
if (typeof t == "function")
|
|
914
914
|
try {
|
|
915
|
-
const n = t(this.get(r, { skipSelfReturn: !1 })), s = (
|
|
915
|
+
const n = t(this.get(r, { skipSelfReturn: !1 })), s = (o) => this.deep(o, n);
|
|
916
916
|
return s.size = Array.isArray(n) ? n.length : 1, s;
|
|
917
917
|
} catch {
|
|
918
918
|
const n = (s) => this.deep(s, void 0);
|
|
@@ -971,7 +971,7 @@ let Rt = class {
|
|
|
971
971
|
return Ce(this.get(t, { skipSelfReturn: !1 }), this);
|
|
972
972
|
}
|
|
973
973
|
isWrapped(t) {
|
|
974
|
-
return
|
|
974
|
+
return ds(t);
|
|
975
975
|
}
|
|
976
976
|
setMetaValue([t, r, i], n) {
|
|
977
977
|
this.dispatch(
|
|
@@ -989,11 +989,11 @@ let Rt = class {
|
|
|
989
989
|
);
|
|
990
990
|
}
|
|
991
991
|
};
|
|
992
|
-
function
|
|
992
|
+
function hs() {
|
|
993
993
|
return typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
994
994
|
}
|
|
995
995
|
function Vr(e) {
|
|
996
|
-
const t =
|
|
996
|
+
const t = hs();
|
|
997
997
|
try {
|
|
998
998
|
const i = t.IIIF_VAULT;
|
|
999
999
|
if (i)
|
|
@@ -1019,8 +1019,8 @@ function Nr({
|
|
|
1019
1019
|
resources: i,
|
|
1020
1020
|
children: n
|
|
1021
1021
|
}) {
|
|
1022
|
-
const [s,
|
|
1023
|
-
return /* @__PURE__ */ x(tt.Provider, { value: { vault: s, setVaultInstance:
|
|
1022
|
+
const [s, o] = B(() => e || (r ? Vr(t) : t ? new Rt(t) : new Rt()));
|
|
1023
|
+
return /* @__PURE__ */ x(tt.Provider, { value: { vault: s, setVaultInstance: o }, children: /* @__PURE__ */ x(Te, { value: i || {}, children: n }) });
|
|
1024
1024
|
}
|
|
1025
1025
|
const V = () => {
|
|
1026
1026
|
const { vault: e } = H(tt);
|
|
@@ -1029,33 +1029,33 @@ const V = () => {
|
|
|
1029
1029
|
return e;
|
|
1030
1030
|
};
|
|
1031
1031
|
function Hr(e, { noCache: t = !1 } = {}) {
|
|
1032
|
-
const r = typeof e == "string" ? e : e.id, i = V(), [n, s] = B(r), [
|
|
1032
|
+
const r = typeof e == "string" ? e : e.id, i = V(), [n, s] = B(r), [o, a] = B(void 0), u = E(() => i.get(r, { skipSelfReturn: !0 }) || void 0, [r, i]), [d, l] = B(u);
|
|
1033
1033
|
return K(() => {
|
|
1034
1034
|
(async () => {
|
|
1035
1035
|
try {
|
|
1036
1036
|
const p = u && !t ? u : await i.load(r), v = p ? p.id || p["@id"] : null;
|
|
1037
1037
|
p && n !== v && s(v), l(p);
|
|
1038
1038
|
} catch (p) {
|
|
1039
|
-
|
|
1039
|
+
a(p);
|
|
1040
1040
|
}
|
|
1041
1041
|
})();
|
|
1042
1042
|
}, [r, t]), {
|
|
1043
1043
|
isLoaded: !!d,
|
|
1044
1044
|
id: n,
|
|
1045
1045
|
requestId: r,
|
|
1046
|
-
error:
|
|
1046
|
+
error: o,
|
|
1047
1047
|
resource: d,
|
|
1048
1048
|
cached: !!(d && d === u)
|
|
1049
1049
|
};
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1052
|
-
const { id: r, isLoaded: i, error: n, resource: s, requestId:
|
|
1051
|
+
function ys(e, t) {
|
|
1052
|
+
const { id: r, isLoaded: i, error: n, resource: s, requestId: o, cached: a } = Hr(
|
|
1053
1053
|
e,
|
|
1054
1054
|
t
|
|
1055
1055
|
);
|
|
1056
|
-
return { id: r, isLoaded: i, error: n, manifest: s, requestId:
|
|
1056
|
+
return { id: r, isLoaded: i, error: n, manifest: s, requestId: o, cached: a };
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function vs({ manifest: e, children: t }) {
|
|
1059
1059
|
return /* @__PURE__ */ x(Te, { value: { manifest: e }, children: t });
|
|
1060
1060
|
}
|
|
1061
1061
|
function Lt({ canvas: e, children: t }) {
|
|
@@ -1082,26 +1082,26 @@ function Br() {
|
|
|
1082
1082
|
function ke(e = {}, t = []) {
|
|
1083
1083
|
const { id: r, selector: i } = e, n = be();
|
|
1084
1084
|
V();
|
|
1085
|
-
const s = r || n.manifest,
|
|
1086
|
-
(
|
|
1085
|
+
const s = r || n.manifest, o = Q(
|
|
1086
|
+
(a) => s ? a.iiif.entities.Manifest[s] : void 0,
|
|
1087
1087
|
[s]
|
|
1088
1088
|
);
|
|
1089
1089
|
return E(() => {
|
|
1090
|
-
if (
|
|
1091
|
-
return i ? i(
|
|
1092
|
-
}, [
|
|
1090
|
+
if (o)
|
|
1091
|
+
return i ? i(o) : o;
|
|
1092
|
+
}, [o, i, ...t]);
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function gs({ range: e, children: t }) {
|
|
1095
1095
|
return /* @__PURE__ */ x(Te, { value: { range: e }, children: t });
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function ms(e, t) {
|
|
1098
1098
|
for (const r of t.items) {
|
|
1099
1099
|
if (r.type === "Canvas")
|
|
1100
1100
|
return r;
|
|
1101
1101
|
if (r.type === "SpecificResource")
|
|
1102
1102
|
return r.source;
|
|
1103
1103
|
if (r.type === "Range") {
|
|
1104
|
-
const i =
|
|
1104
|
+
const i = ms(e, e.get(r));
|
|
1105
1105
|
if (i)
|
|
1106
1106
|
return i;
|
|
1107
1107
|
}
|
|
@@ -1118,7 +1118,7 @@ function zr(e, t) {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
return r;
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function Tc(e, t, r) {
|
|
1122
1122
|
for (const i of t.structures) {
|
|
1123
1123
|
const n = Wr(e, e.get(i), r);
|
|
1124
1124
|
if (n)
|
|
@@ -1128,23 +1128,23 @@ function Ic(e, t, r) {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
function Wr(e, t, r) {
|
|
1130
1130
|
var i, n, s;
|
|
1131
|
-
for (const
|
|
1132
|
-
const
|
|
1133
|
-
if (
|
|
1131
|
+
for (const o of t.items) {
|
|
1132
|
+
const a = (n = (i = o == null ? void 0 : o.source) == null ? void 0 : i.id) == null ? void 0 : n.split("#")[0];
|
|
1133
|
+
if (o.type === "SpecificResource" && o.source === r || o.type === "SpecificResource" && ((s = o.source) == null ? void 0 : s.type) === "Canvas" && r === a)
|
|
1134
1134
|
return t;
|
|
1135
|
-
if (
|
|
1136
|
-
const u = Wr(e, e.get(
|
|
1135
|
+
if (o.type === "Range") {
|
|
1136
|
+
const u = Wr(e, e.get(o), r);
|
|
1137
1137
|
if (u)
|
|
1138
1138
|
return u;
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
1141
|
return null;
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function kc(e, t, r, i = !1) {
|
|
1144
1144
|
const n = t.behavior, s = r ? e.get(r) : null;
|
|
1145
1145
|
if (!s)
|
|
1146
1146
|
return [];
|
|
1147
|
-
const
|
|
1147
|
+
const o = s.behavior, a = i ? !1 : n.includes("paged"), u = a ? !1 : n.includes("continuous"), d = a || u ? !1 : n.includes("individuals"), l = o.includes("facing-pages"), p = o.includes("non-paged");
|
|
1148
1148
|
if (l || p || d || i)
|
|
1149
1149
|
return [{ id: s.id, type: "Canvas" }];
|
|
1150
1150
|
const [v, m] = Qr(e, t);
|
|
@@ -1159,10 +1159,10 @@ function Tc(e, t, r, i = !1) {
|
|
|
1159
1159
|
return [{ id: s.id, type: "Canvas" }];
|
|
1160
1160
|
}
|
|
1161
1161
|
function Qr(e, t, { disablePaging: r, skipNonPaged: i } = {}) {
|
|
1162
|
-
const n = t.behavior, s = n.includes("paged"),
|
|
1163
|
-
if (
|
|
1162
|
+
const n = t.behavior, s = n.includes("paged"), o = s ? !1 : n.includes("continuous"), a = s || o ? !1 : n.includes("individuals"), u = t.type === "Manifest" ? t.items : zr(e, t);
|
|
1163
|
+
if (o)
|
|
1164
1164
|
return [u, [u.map((h, g) => g)]];
|
|
1165
|
-
if (
|
|
1165
|
+
if (a || !s || r)
|
|
1166
1166
|
return [u, u.map((h, g) => [g])];
|
|
1167
1167
|
const d = [];
|
|
1168
1168
|
let l = [];
|
|
@@ -1188,44 +1188,44 @@ function Qr(e, t, { disablePaging: r, skipNonPaged: i } = {}) {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
return l.length && p(), [u, d];
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1192
|
-
const { id: r, selector: i } = e, n = be(), s = r || n.range,
|
|
1191
|
+
function bs(e = {}, t = []) {
|
|
1192
|
+
const { id: r, selector: i } = e, n = be(), s = r || n.range, o = Q((a) => s ? a.iiif.entities.Range[s] : void 0, [s]);
|
|
1193
1193
|
return E(() => {
|
|
1194
|
-
if (
|
|
1195
|
-
return i ? i(
|
|
1196
|
-
}, [
|
|
1194
|
+
if (o)
|
|
1195
|
+
return i ? i(o) : o;
|
|
1196
|
+
}, [o, i, ...t]);
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function As({ startCanvas: e, disablePaging: t }) {
|
|
1199
1199
|
var h;
|
|
1200
|
-
const r = V(), i = ke(), n =
|
|
1201
|
-
if (!
|
|
1200
|
+
const r = V(), i = ke(), n = bs(), [s, o] = B(void 0), a = n || i;
|
|
1201
|
+
if (!a)
|
|
1202
1202
|
throw new Error("Nothing selected");
|
|
1203
1203
|
const [u, d] = E(
|
|
1204
|
-
() => Qr(r,
|
|
1205
|
-
[r,
|
|
1204
|
+
() => Qr(r, a, { disablePaging: t }),
|
|
1205
|
+
[r, a]
|
|
1206
1206
|
), l = D(
|
|
1207
1207
|
(g) => {
|
|
1208
1208
|
const b = d.findIndex((A) => A.includes(g));
|
|
1209
|
-
|
|
1209
|
+
o(b === -1 ? 0 : b);
|
|
1210
1210
|
},
|
|
1211
1211
|
[u, d]
|
|
1212
1212
|
), p = D(
|
|
1213
1213
|
(g) => {
|
|
1214
1214
|
const b = u.findIndex((A) => A.id === g);
|
|
1215
|
-
b !== -1 ? l(b) :
|
|
1215
|
+
b !== -1 ? l(b) : o(0);
|
|
1216
1216
|
},
|
|
1217
1217
|
[u, d]
|
|
1218
1218
|
), v = D(() => {
|
|
1219
|
-
|
|
1219
|
+
o((g) => g >= d.length ? g : g + 1);
|
|
1220
1220
|
}, [d]), m = D(() => {
|
|
1221
|
-
|
|
1221
|
+
o((g) => g <= 0 ? 0 : g - 1);
|
|
1222
1222
|
}, [d]);
|
|
1223
|
-
return typeof s > "u" && (e ? p(e) :
|
|
1223
|
+
return typeof s > "u" && (e ? p(e) : o(0)), {
|
|
1224
1224
|
visibleItems: ((h = d[s]) == null ? void 0 : h.map((g) => u[g].id)) || [],
|
|
1225
1225
|
cursor: s,
|
|
1226
1226
|
items: u,
|
|
1227
1227
|
sequence: d,
|
|
1228
|
-
setSequenceIndex:
|
|
1228
|
+
setSequenceIndex: o,
|
|
1229
1229
|
setCanvasIndex: l,
|
|
1230
1230
|
setCanvasId: p,
|
|
1231
1231
|
next: v,
|
|
@@ -1243,42 +1243,42 @@ const Fe = () => {
|
|
|
1243
1243
|
setSequenceIndex: Fe,
|
|
1244
1244
|
currentSequenceIndex: 0
|
|
1245
1245
|
});
|
|
1246
|
-
function
|
|
1247
|
-
const t = ke(), { cursor: r, visibleItems: i, next: n, sequence: s, items:
|
|
1246
|
+
function xs(e) {
|
|
1247
|
+
const t = ke(), { cursor: r, visibleItems: i, next: n, sequence: s, items: o, setCanvasIndex: a, setCanvasId: u, previous: d, setSequenceIndex: l } = As({
|
|
1248
1248
|
startCanvas: e.startCanvas,
|
|
1249
1249
|
disablePaging: e.pagingEnabled === !1
|
|
1250
1250
|
}), p = E(
|
|
1251
1251
|
() => ({
|
|
1252
1252
|
sequence: s,
|
|
1253
|
-
items:
|
|
1253
|
+
items: o,
|
|
1254
1254
|
// Extra functions.
|
|
1255
1255
|
setCurrentCanvasId: u,
|
|
1256
1256
|
nextCanvas: n,
|
|
1257
1257
|
previousCanvas: d,
|
|
1258
|
-
totalCanvases:
|
|
1259
|
-
setCurrentCanvasIndex:
|
|
1258
|
+
totalCanvases: o.length,
|
|
1259
|
+
setCurrentCanvasIndex: a,
|
|
1260
1260
|
setSequenceIndex: l,
|
|
1261
1261
|
currentSequenceIndex: r
|
|
1262
1262
|
}),
|
|
1263
|
-
[s,
|
|
1263
|
+
[s, o, u, n, d, o, a, l, r]
|
|
1264
1264
|
);
|
|
1265
1265
|
return t ? /* @__PURE__ */ x(it.Provider, { value: p, children: /* @__PURE__ */ x(rt.Provider, { value: i, children: /* @__PURE__ */ x(Lt, { canvas: i[0], children: e.children }) }) }) : (console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ x("div", { children: "Sorry, something went wrong." }));
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1268
|
-
const t =
|
|
1267
|
+
function ws(e) {
|
|
1268
|
+
const t = ys(e.manifest);
|
|
1269
1269
|
if (!t)
|
|
1270
1270
|
return console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ x("div", { children: "Sorry, something went wrong." });
|
|
1271
1271
|
if (t.error)
|
|
1272
1272
|
return /* @__PURE__ */ x("div", { children: t.error.toString() });
|
|
1273
1273
|
if (!t.isLoaded)
|
|
1274
1274
|
return /* @__PURE__ */ x("div", { children: "Loading..." });
|
|
1275
|
-
const r = /* @__PURE__ */ x(
|
|
1276
|
-
return /* @__PURE__ */ x(
|
|
1275
|
+
const r = /* @__PURE__ */ x(xs, { ...e, children: e.children });
|
|
1276
|
+
return /* @__PURE__ */ x(vs, { manifest: t.id, children: e.rangeId ? /* @__PURE__ */ x(gs, { range: e.rangeId, children: r }) : r });
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1278
|
+
function Ss() {
|
|
1279
1279
|
return H(it);
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function Cs() {
|
|
1282
1282
|
return {
|
|
1283
1283
|
VaultContext: H(tt),
|
|
1284
1284
|
ResourceContext: H(Et),
|
|
@@ -1286,7 +1286,7 @@ function Ss() {
|
|
|
1286
1286
|
VisibleCanvasReactContext: H(rt)
|
|
1287
1287
|
};
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function Ms(e) {
|
|
1290
1290
|
return /* @__PURE__ */ x(Nr, { vault: e.bridge.VaultContext.vault || void 0, resources: e.bridge.ResourceContext, children: /* @__PURE__ */ x(rt.Provider, { value: e.bridge.VisibleCanvasReactContext, children: /* @__PURE__ */ x(it.Provider, { value: e.bridge.SimpleViewerReactContext, children: e.children }) }) });
|
|
1291
1291
|
}
|
|
1292
1292
|
const se = function(e) {
|
|
@@ -1298,29 +1298,29 @@ const se = function(e) {
|
|
|
1298
1298
|
...i !== void 0 && { meta: i }
|
|
1299
1299
|
});
|
|
1300
1300
|
};
|
|
1301
|
-
},
|
|
1302
|
-
importEntities:
|
|
1303
|
-
modifyEntityField:
|
|
1304
|
-
reorderEntityField:
|
|
1305
|
-
addReference:
|
|
1306
|
-
removeReference:
|
|
1307
|
-
updateReference:
|
|
1308
|
-
addMetadata:
|
|
1309
|
-
removeMetadata:
|
|
1310
|
-
updateMetadata:
|
|
1311
|
-
reorderMetadata:
|
|
1301
|
+
}, Rs = "@iiif/IMPORT_ENTITIES", Is = "@iiif/MODIFY_ENTITY_FIELD", Ts = "@iiif/REORDER_ENTITY_FIELD", ks = "@iiif/ADD_REFERENCE", Os = "@iiif/UPDATE_REFERENCE", Es = "@iiif/REMOVE_REFERENCE", Ps = "@iiif/ADD_METADATA", Ls = "@iiif/REMOVE_METADATA", Fs = "@iiif/UPDATE_METADATA", js = "@iiif/REORDER_METADATA", $s = se(Rs)(), Ds = se(Is)(), qs = se(Ts)(), _s = se(ks)(), Us = se(Es)(), Vs = se(Os)(), Ns = se(Ps)(), Hs = se(Fs)(), Bs = se(Ls)(), zs = se(js)(), pt = {
|
|
1302
|
+
importEntities: $s,
|
|
1303
|
+
modifyEntityField: Ds,
|
|
1304
|
+
reorderEntityField: qs,
|
|
1305
|
+
addReference: _s,
|
|
1306
|
+
removeReference: Us,
|
|
1307
|
+
updateReference: Vs,
|
|
1308
|
+
addMetadata: Ns,
|
|
1309
|
+
removeMetadata: Bs,
|
|
1310
|
+
updateMetadata: Hs,
|
|
1311
|
+
reorderMetadata: zs
|
|
1312
1312
|
};
|
|
1313
|
-
function
|
|
1313
|
+
function Ws() {
|
|
1314
1314
|
const t = V().getStore();
|
|
1315
1315
|
return E(() => (r) => t.dispatch(r), [t]);
|
|
1316
1316
|
}
|
|
1317
1317
|
function ir(e) {
|
|
1318
1318
|
return typeof e != "string" && e && e.bindToVault;
|
|
1319
1319
|
}
|
|
1320
|
-
function
|
|
1321
|
-
const e = V(), t = ge([]), r =
|
|
1320
|
+
function Qs() {
|
|
1321
|
+
const e = V(), t = ge([]), r = Ws(), i = E(() => `vault://annotation-page/${(/* @__PURE__ */ new Date()).getTime()}/${Math.round(Math.random() * 1e9).toString(16)}`, []);
|
|
1322
1322
|
hr(() => {
|
|
1323
|
-
const
|
|
1323
|
+
const a = {
|
|
1324
1324
|
id: i,
|
|
1325
1325
|
type: "AnnotationPage",
|
|
1326
1326
|
behavior: [],
|
|
@@ -1341,31 +1341,31 @@ function Ws() {
|
|
|
1341
1341
|
pt.importEntities({
|
|
1342
1342
|
entities: {
|
|
1343
1343
|
AnnotationPage: {
|
|
1344
|
-
[
|
|
1344
|
+
[a.id]: a
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
1347
|
})
|
|
1348
1348
|
);
|
|
1349
1349
|
}, [i]);
|
|
1350
1350
|
const n = Q(
|
|
1351
|
-
(
|
|
1351
|
+
(a) => i ? a.iiif.entities.AnnotationPage[i] : null,
|
|
1352
1352
|
[i]
|
|
1353
1353
|
), s = D(
|
|
1354
|
-
(
|
|
1354
|
+
(a, u) => {
|
|
1355
1355
|
if (i) {
|
|
1356
|
-
if (ir(
|
|
1357
|
-
const p =
|
|
1358
|
-
p.__vault || p.bindToVault(e),
|
|
1356
|
+
if (ir(a)) {
|
|
1357
|
+
const p = a;
|
|
1358
|
+
p.__vault || p.bindToVault(e), a = typeof p.source == "string" ? p.source : p.source.id, t.current[a] = p;
|
|
1359
1359
|
} else
|
|
1360
|
-
typeof
|
|
1361
|
-
const d = e.get({ id: i, type: "AnnotationPage" }), l = e.get({ id:
|
|
1360
|
+
typeof a != "string" && (a = a.id);
|
|
1361
|
+
const d = e.get({ id: i, type: "AnnotationPage" }), l = e.get({ id: a, type: "Annotation" });
|
|
1362
1362
|
d && l && (d.items.find((p) => p.id === l.id) || r(
|
|
1363
1363
|
pt.addReference({
|
|
1364
1364
|
id: i,
|
|
1365
1365
|
type: "AnnotationPage",
|
|
1366
1366
|
key: "items",
|
|
1367
1367
|
reference: {
|
|
1368
|
-
id:
|
|
1368
|
+
id: a,
|
|
1369
1369
|
type: "Annotation"
|
|
1370
1370
|
},
|
|
1371
1371
|
index: u
|
|
@@ -1374,15 +1374,15 @@ function Ws() {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
},
|
|
1376
1376
|
[i]
|
|
1377
|
-
),
|
|
1378
|
-
(
|
|
1379
|
-
i && (ir(
|
|
1377
|
+
), o = D(
|
|
1378
|
+
(a) => {
|
|
1379
|
+
i && (ir(a) ? a = typeof a.source == "string" ? a.source : a.source.id : typeof a != "string" && (a = a.id), t.current[a] && t.current[a].beforeRemove(), e.get({ id: i, type: "AnnotationPage" }) && r(
|
|
1380
1380
|
pt.removeReference({
|
|
1381
1381
|
id: i,
|
|
1382
1382
|
type: "AnnotationPage",
|
|
1383
1383
|
key: "items",
|
|
1384
1384
|
reference: {
|
|
1385
|
-
id:
|
|
1385
|
+
id: a,
|
|
1386
1386
|
type: "Annotation"
|
|
1387
1387
|
}
|
|
1388
1388
|
})
|
|
@@ -1394,12 +1394,12 @@ function Ws() {
|
|
|
1394
1394
|
n,
|
|
1395
1395
|
{
|
|
1396
1396
|
addAnnotation: s,
|
|
1397
|
-
removeAnnotation:
|
|
1397
|
+
removeAnnotation: o
|
|
1398
1398
|
}
|
|
1399
1399
|
];
|
|
1400
1400
|
}
|
|
1401
1401
|
const Yr = ce(null);
|
|
1402
|
-
function
|
|
1402
|
+
function Ys() {
|
|
1403
1403
|
const e = H(Yr);
|
|
1404
1404
|
return [
|
|
1405
1405
|
e.fullPage,
|
|
@@ -1409,8 +1409,8 @@ function Qs() {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
];
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1413
|
-
const [t, { addAnnotation: r, removeAnnotation: i }] =
|
|
1412
|
+
function Gs({ children: e }) {
|
|
1413
|
+
const [t, { addAnnotation: r, removeAnnotation: i }] = Qs();
|
|
1414
1414
|
return /* @__PURE__ */ x(
|
|
1415
1415
|
Yr.Provider,
|
|
1416
1416
|
{
|
|
@@ -1419,7 +1419,7 @@ function Ys({ children: e }) {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
);
|
|
1421
1421
|
}
|
|
1422
|
-
function
|
|
1422
|
+
function Js({
|
|
1423
1423
|
width: e,
|
|
1424
1424
|
style: t,
|
|
1425
1425
|
height: r,
|
|
@@ -1433,7 +1433,7 @@ function Gs({
|
|
|
1433
1433
|
] });
|
|
1434
1434
|
}
|
|
1435
1435
|
const Ft = ce(null);
|
|
1436
|
-
function
|
|
1436
|
+
function Ks() {
|
|
1437
1437
|
return H(Ft);
|
|
1438
1438
|
}
|
|
1439
1439
|
const Gr = ce(
|
|
@@ -1450,27 +1450,27 @@ function Le(e, t, r, i, n = []) {
|
|
|
1450
1450
|
}), [t, e, s, ...n]);
|
|
1451
1451
|
}
|
|
1452
1452
|
function ue(e = {}, t = []) {
|
|
1453
|
-
const { id: r, selector: i } = e, n = be(), s = r || n.canvas,
|
|
1453
|
+
const { id: r, selector: i } = e, n = be(), s = r || n.canvas, o = Q((a) => s ? a.iiif.entities.Canvas[s] : void 0, [s]);
|
|
1454
1454
|
return E(() => {
|
|
1455
|
-
if (
|
|
1456
|
-
return i ? i(
|
|
1457
|
-
}, [
|
|
1455
|
+
if (o)
|
|
1456
|
+
return i ? i(o) : o;
|
|
1457
|
+
}, [o, i, ...t]);
|
|
1458
1458
|
}
|
|
1459
1459
|
const Kr = ce(() => {
|
|
1460
1460
|
});
|
|
1461
|
-
function
|
|
1461
|
+
function Zs(e) {
|
|
1462
1462
|
const t = ue(), r = H(Kr);
|
|
1463
1463
|
K(() => t && t.id ? (r(t.id, e), () => r(t.id, -1)) : () => {
|
|
1464
1464
|
}, [t, e]);
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1466
|
+
function Xs({
|
|
1467
1467
|
children: e,
|
|
1468
1468
|
errorFallback: t,
|
|
1469
1469
|
outerContainerProps: r = {},
|
|
1470
1470
|
worldScale: i,
|
|
1471
1471
|
...n
|
|
1472
1472
|
}) {
|
|
1473
|
-
const [s,
|
|
1473
|
+
const [s, o] = B(), a = Cs(), u = t || Js, [d, l] = B({}), p = Object.entries(d), [v, m] = B({}), h = Object.entries(v), [g, b] = B({}), A = E(() => i || Math.max(...Object.values(g)), [g]), w = E(() => ({ maxOverZoom: A || 1 }), [A]), C = D((I, L) => {
|
|
1474
1474
|
b((P) => {
|
|
1475
1475
|
if (L === -1) {
|
|
1476
1476
|
const { [I]: M, ...$ } = P;
|
|
@@ -1489,7 +1489,7 @@ function Zs({
|
|
|
1489
1489
|
[I]: { element: L, props: P }
|
|
1490
1490
|
} : $);
|
|
1491
1491
|
}, []);
|
|
1492
|
-
return /* @__PURE__ */ N(
|
|
1492
|
+
return /* @__PURE__ */ N(wn, { resetKeys: [], fallbackRender: (I) => /* @__PURE__ */ x(u, { ...n, ...I }), children: [
|
|
1493
1493
|
/* @__PURE__ */ x(
|
|
1494
1494
|
un,
|
|
1495
1495
|
{
|
|
@@ -1497,10 +1497,10 @@ function Zs({
|
|
|
1497
1497
|
containerProps: { style: { position: "relative" }, ...n.containerProps || {} },
|
|
1498
1498
|
htmlChildren: /* @__PURE__ */ x(Me, { children: p.map(([I, { element: L, props: P }]) => /* @__PURE__ */ x(me.Fragment, { children: /* @__PURE__ */ x(L, { ...P || {} }) }, I)) }),
|
|
1499
1499
|
onCreated: (I) => {
|
|
1500
|
-
|
|
1500
|
+
o(I), n.onCreated && n.onCreated(I);
|
|
1501
1501
|
},
|
|
1502
1502
|
runtimeOptions: w,
|
|
1503
|
-
children: /* @__PURE__ */ x(Ft.Provider, { value: s, children: /* @__PURE__ */ x(Kr.Provider, { value: C, children: /* @__PURE__ */ x(Gr.Provider, { value: T, children: /* @__PURE__ */ x(Jr.Provider, { value: j, children: /* @__PURE__ */ x(
|
|
1503
|
+
children: /* @__PURE__ */ x(Ft.Provider, { value: s, children: /* @__PURE__ */ x(Kr.Provider, { value: C, children: /* @__PURE__ */ x(Gr.Provider, { value: T, children: /* @__PURE__ */ x(Jr.Provider, { value: j, children: /* @__PURE__ */ x(Ms, { bridge: a, children: /* @__PURE__ */ x(ln.Provider, { value: n.mode || "explore", children: /* @__PURE__ */ x(Gs, { children: e }) }) }) }) }) }) })
|
|
1504
1504
|
}
|
|
1505
1505
|
),
|
|
1506
1506
|
/* @__PURE__ */ x("div", { children: h.map(([I, { element: L, props: P }]) => /* @__PURE__ */ x(me.Fragment, { children: /* @__PURE__ */ x(L, { ...P || {} }) }, I)) })
|
|
@@ -1511,12 +1511,12 @@ const He = {}, Zr = {
|
|
|
1511
1511
|
return e;
|
|
1512
1512
|
},
|
|
1513
1513
|
setMetaValue([e, t, r], i) {
|
|
1514
|
-
const n = Zr.getResourceMeta(e, t), s = n ? n[r] : void 0,
|
|
1514
|
+
const n = Zr.getResourceMeta(e, t), s = n ? n[r] : void 0, o = typeof i == "function" ? i(s) : i;
|
|
1515
1515
|
He[e] = {
|
|
1516
1516
|
...He[e] || {},
|
|
1517
1517
|
[t]: {
|
|
1518
1518
|
...(He[e] || {})[t] || {},
|
|
1519
|
-
[r]:
|
|
1519
|
+
[r]: o
|
|
1520
1520
|
}
|
|
1521
1521
|
};
|
|
1522
1522
|
},
|
|
@@ -1533,11 +1533,11 @@ function Xr(e = Zr) {
|
|
|
1533
1533
|
return e.setMetaValue(
|
|
1534
1534
|
[t.id, "eventManager", r],
|
|
1535
1535
|
(s) => {
|
|
1536
|
-
const
|
|
1537
|
-
for (const
|
|
1538
|
-
if (
|
|
1539
|
-
return
|
|
1540
|
-
return [...
|
|
1536
|
+
const o = s || [];
|
|
1537
|
+
for (const a of o)
|
|
1538
|
+
if (a.callback === i)
|
|
1539
|
+
return o;
|
|
1540
|
+
return [...o, { callback: i, scope: n }];
|
|
1541
1541
|
}
|
|
1542
1542
|
), i;
|
|
1543
1543
|
},
|
|
@@ -1553,11 +1553,11 @@ function Xr(e = Zr) {
|
|
|
1553
1553
|
return {};
|
|
1554
1554
|
const n = e.getResourceMeta(i.id, "eventManager"), s = {};
|
|
1555
1555
|
if (n && i)
|
|
1556
|
-
for (const
|
|
1557
|
-
s[
|
|
1556
|
+
for (const o of Object.keys(n))
|
|
1557
|
+
s[o] = (a) => {
|
|
1558
1558
|
const u = e.get(i);
|
|
1559
|
-
for (const { callback: d, scope: l } of n[
|
|
1560
|
-
(!l || r && l.indexOf(r) !== -1) && d(
|
|
1559
|
+
for (const { callback: d, scope: l } of n[o] || [])
|
|
1560
|
+
(!l || r && l.indexOf(r) !== -1) && d(a, u);
|
|
1561
1561
|
};
|
|
1562
1562
|
return s;
|
|
1563
1563
|
}
|
|
@@ -1572,12 +1572,12 @@ const Be = {}, ti = {
|
|
|
1572
1572
|
return e;
|
|
1573
1573
|
},
|
|
1574
1574
|
setMetaValue([e, t, r], i) {
|
|
1575
|
-
const n = ti.getResourceMeta(e, t), s = n ? n[r] : void 0,
|
|
1575
|
+
const n = ti.getResourceMeta(e, t), s = n ? n[r] : void 0, o = typeof i == "function" ? i(s) : i;
|
|
1576
1576
|
Be[e] = {
|
|
1577
1577
|
...Be[e] || {},
|
|
1578
1578
|
[t]: {
|
|
1579
1579
|
...(Be[e] || {})[t] || {},
|
|
1580
|
-
[r]:
|
|
1580
|
+
[r]: o
|
|
1581
1581
|
}
|
|
1582
1582
|
};
|
|
1583
1583
|
},
|
|
@@ -1608,20 +1608,20 @@ function et(e, t) {
|
|
|
1608
1608
|
return n ? t ? n[t] : n : void 0;
|
|
1609
1609
|
}, [e, t]);
|
|
1610
1610
|
}
|
|
1611
|
-
var
|
|
1611
|
+
var eo = Object.defineProperty, to = (e, t, r) => t in e ? eo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Qe = (e, t, r) => (to(e, typeof t != "symbol" ? t + "" : t, r), r), ro = /* @__PURE__ */ function() {
|
|
1612
1612
|
function e(t, r) {
|
|
1613
|
-
var i = [], n = !0, s = !1,
|
|
1613
|
+
var i = [], n = !0, s = !1, o = void 0;
|
|
1614
1614
|
try {
|
|
1615
|
-
for (var
|
|
1615
|
+
for (var a = t[Symbol.iterator](), u; !(n = (u = a.next()).done) && (i.push(u.value), !(r && i.length === r)); n = !0)
|
|
1616
1616
|
;
|
|
1617
1617
|
} catch (d) {
|
|
1618
|
-
s = !0,
|
|
1618
|
+
s = !0, o = d;
|
|
1619
1619
|
} finally {
|
|
1620
1620
|
try {
|
|
1621
|
-
!n &&
|
|
1621
|
+
!n && a.return && a.return();
|
|
1622
1622
|
} finally {
|
|
1623
1623
|
if (s)
|
|
1624
|
-
throw
|
|
1624
|
+
throw o;
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
1627
1627
|
return i;
|
|
@@ -1633,64 +1633,64 @@ var Xs = Object.defineProperty, ea = (e, t, r) => t in e ? Xs(e, t, { enumerable
|
|
|
1633
1633
|
return e(t, r);
|
|
1634
1634
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
1635
1635
|
};
|
|
1636
|
-
}(), $e = Math.PI * 2, dt = function(e, t, r, i, n, s,
|
|
1637
|
-
var
|
|
1638
|
-
|
|
1639
|
-
var d = i *
|
|
1636
|
+
}(), $e = Math.PI * 2, dt = function(e, t, r, i, n, s, o) {
|
|
1637
|
+
var a = e.x, u = e.y;
|
|
1638
|
+
a *= t, u *= r;
|
|
1639
|
+
var d = i * a - n * u, l = n * a + i * u;
|
|
1640
1640
|
return {
|
|
1641
1641
|
x: d + s,
|
|
1642
|
-
y: l +
|
|
1642
|
+
y: l + o
|
|
1643
1643
|
};
|
|
1644
|
-
},
|
|
1645
|
-
var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t),
|
|
1644
|
+
}, io = function(e, t) {
|
|
1645
|
+
var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t), o = Math.sin(e + t);
|
|
1646
1646
|
return [{
|
|
1647
1647
|
x: i - n * r,
|
|
1648
1648
|
y: n + i * r
|
|
1649
1649
|
}, {
|
|
1650
|
-
x: s +
|
|
1651
|
-
y:
|
|
1650
|
+
x: s + o * r,
|
|
1651
|
+
y: o - s * r
|
|
1652
1652
|
}, {
|
|
1653
1653
|
x: s,
|
|
1654
|
-
y:
|
|
1654
|
+
y: o
|
|
1655
1655
|
}];
|
|
1656
1656
|
}, nr = function(e, t, r, i) {
|
|
1657
1657
|
var n = e * i - t * r < 0 ? -1 : 1, s = e * r + t * i;
|
|
1658
1658
|
return s > 1 && (s = 1), s < -1 && (s = -1), n * Math.acos(s);
|
|
1659
|
-
},
|
|
1659
|
+
}, no = function(e, t, r, i, n, s, o, a, u, d, l, p) {
|
|
1660
1660
|
var v = Math.pow(n, 2), m = Math.pow(s, 2), h = Math.pow(l, 2), g = Math.pow(p, 2), b = v * m - v * g - m * h;
|
|
1661
|
-
b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (
|
|
1661
|
+
b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (o === a ? -1 : 1);
|
|
1662
1662
|
var A = b * n / s * p, w = b * -s / n * l, C = d * A - u * w + (e + r) / 2, T = u * A + d * w + (t + i) / 2, j = (l - A) / n, I = (p - w) / s, L = (-l - A) / n, P = (-p - w) / s, M = nr(1, 0, j, I), $ = nr(j, I, L, P);
|
|
1663
|
-
return
|
|
1664
|
-
},
|
|
1665
|
-
var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx,
|
|
1666
|
-
if (s === 0 ||
|
|
1663
|
+
return a === 0 && $ > 0 && ($ -= $e), a === 1 && $ < 0 && ($ += $e), [C, T, M, $];
|
|
1664
|
+
}, so = function(e) {
|
|
1665
|
+
var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, o = e.ry, a = e.xAxisRotation, u = a === void 0 ? 0 : a, d = e.largeArcFlag, l = d === void 0 ? 0 : d, p = e.sweepFlag, v = p === void 0 ? 0 : p, m = [];
|
|
1666
|
+
if (s === 0 || o === 0)
|
|
1667
1667
|
return [];
|
|
1668
1668
|
var h = Math.sin(u * $e / 360), g = Math.cos(u * $e / 360), b = g * (t - i) / 2 + h * (r - n) / 2, A = -h * (t - i) / 2 + g * (r - n) / 2;
|
|
1669
1669
|
if (b === 0 && A === 0)
|
|
1670
1670
|
return [];
|
|
1671
|
-
s = Math.abs(s),
|
|
1672
|
-
var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(
|
|
1673
|
-
w > 1 && (s *= Math.sqrt(w),
|
|
1674
|
-
var C =
|
|
1671
|
+
s = Math.abs(s), o = Math.abs(o);
|
|
1672
|
+
var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(o, 2);
|
|
1673
|
+
w > 1 && (s *= Math.sqrt(w), o *= Math.sqrt(w));
|
|
1674
|
+
var C = no(t, r, i, n, s, o, l, v, h, g, b, A), T = ro(C, 4), j = T[0], I = T[1], L = T[2], P = T[3], M = Math.abs(P) / ($e / 4);
|
|
1675
1675
|
Math.abs(1 - M) < 1e-7 && (M = 1);
|
|
1676
1676
|
var $ = Math.max(Math.ceil(M), 1);
|
|
1677
1677
|
P /= $;
|
|
1678
1678
|
for (var ie = 0; ie < $; ie++)
|
|
1679
|
-
m.push(
|
|
1679
|
+
m.push(io(L, P)), L += P;
|
|
1680
1680
|
return m.map(function(Z) {
|
|
1681
|
-
var U = dt(Z[0], s,
|
|
1681
|
+
var U = dt(Z[0], s, o, g, h, j, I), z = U.x, ee = U.y, ne = dt(Z[1], s, o, g, h, j, I), xe = ne.x, O = ne.y, W = dt(Z[2], s, o, g, h, j, I), X = W.x, de = W.y;
|
|
1682
1682
|
return { x1: z, y1: ee, x2: xe, y2: O, x: X, y: de };
|
|
1683
1683
|
});
|
|
1684
1684
|
};
|
|
1685
1685
|
function ri(e) {
|
|
1686
1686
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1687
1687
|
}
|
|
1688
|
-
var
|
|
1689
|
-
function
|
|
1688
|
+
var oo = co, ht = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, ao = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
1689
|
+
function co(e) {
|
|
1690
1690
|
var t = [];
|
|
1691
|
-
return e.replace(
|
|
1691
|
+
return e.replace(ao, function(r, i, n) {
|
|
1692
1692
|
var s = i.toLowerCase();
|
|
1693
|
-
for (n =
|
|
1693
|
+
for (n = lo(n), s == "m" && n.length > 2 && (t.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
|
|
1694
1694
|
if (n.length == ht[s])
|
|
1695
1695
|
return n.unshift(i), t.push(n);
|
|
1696
1696
|
if (n.length < ht[s])
|
|
@@ -1699,20 +1699,20 @@ function oa(e) {
|
|
|
1699
1699
|
}
|
|
1700
1700
|
}), t;
|
|
1701
1701
|
}
|
|
1702
|
-
var
|
|
1703
|
-
function
|
|
1704
|
-
var t = e.match(
|
|
1702
|
+
var uo = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
1703
|
+
function lo(e) {
|
|
1704
|
+
var t = e.match(uo);
|
|
1705
1705
|
return t ? t.map(Number) : [];
|
|
1706
1706
|
}
|
|
1707
|
-
const
|
|
1708
|
-
var
|
|
1709
|
-
function
|
|
1707
|
+
const fo = /* @__PURE__ */ ri(oo);
|
|
1708
|
+
var po = ho;
|
|
1709
|
+
function ho(e) {
|
|
1710
1710
|
var t = 0, r = 0, i = 0, n = 0;
|
|
1711
1711
|
return e.map(function(s) {
|
|
1712
1712
|
s = s.slice();
|
|
1713
|
-
var
|
|
1714
|
-
if (
|
|
1715
|
-
switch (s[0] =
|
|
1713
|
+
var o = s[0], a = o.toUpperCase();
|
|
1714
|
+
if (o != a)
|
|
1715
|
+
switch (s[0] = a, o) {
|
|
1716
1716
|
case "a":
|
|
1717
1717
|
s[6] += i, s[7] += n;
|
|
1718
1718
|
break;
|
|
@@ -1726,7 +1726,7 @@ function pa(e) {
|
|
|
1726
1726
|
for (var u = 1; u < s.length; )
|
|
1727
1727
|
s[u++] += i, s[u++] += n;
|
|
1728
1728
|
}
|
|
1729
|
-
switch (
|
|
1729
|
+
switch (a) {
|
|
1730
1730
|
case "Z":
|
|
1731
1731
|
i = t, n = r;
|
|
1732
1732
|
break;
|
|
@@ -1745,10 +1745,10 @@ function pa(e) {
|
|
|
1745
1745
|
return s;
|
|
1746
1746
|
});
|
|
1747
1747
|
}
|
|
1748
|
-
const
|
|
1749
|
-
function
|
|
1750
|
-
const t =
|
|
1751
|
-
let i, n = 0, s = 0,
|
|
1748
|
+
const yo = /* @__PURE__ */ ri(po);
|
|
1749
|
+
function vo(e) {
|
|
1750
|
+
const t = fo(e), r = yo(t);
|
|
1751
|
+
let i, n = 0, s = 0, o = 0, a = 0, u, d, l = 0, p = 0;
|
|
1752
1752
|
const v = [];
|
|
1753
1753
|
for (let m = 0; m < r.length; m++) {
|
|
1754
1754
|
let h = r[m];
|
|
@@ -1766,7 +1766,7 @@ function ha(e) {
|
|
|
1766
1766
|
case "S":
|
|
1767
1767
|
{
|
|
1768
1768
|
let b = l, A = p;
|
|
1769
|
-
(i === "C" || i == "S") && (b += b -
|
|
1769
|
+
(i === "C" || i == "S") && (b += b - o, A += A - a), h = ["C", b, A, h[1], h[2], h[3], h[4]];
|
|
1770
1770
|
}
|
|
1771
1771
|
break;
|
|
1772
1772
|
case "T":
|
|
@@ -1777,7 +1777,7 @@ function ha(e) {
|
|
|
1777
1777
|
break;
|
|
1778
1778
|
case "A":
|
|
1779
1779
|
{
|
|
1780
|
-
const b =
|
|
1780
|
+
const b = so({
|
|
1781
1781
|
px: l,
|
|
1782
1782
|
py: p,
|
|
1783
1783
|
cx: h[6],
|
|
@@ -1799,7 +1799,7 @@ function ha(e) {
|
|
|
1799
1799
|
h = ["L", n, s];
|
|
1800
1800
|
break;
|
|
1801
1801
|
}
|
|
1802
|
-
i = g, l = h[h.length - 2], p = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (
|
|
1802
|
+
i = g, l = h[h.length - 2], p = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (o = h[h.length - 4], a = h[h.length - 3]) : (o = l, a = p), v.push(h);
|
|
1803
1803
|
}
|
|
1804
1804
|
return v;
|
|
1805
1805
|
}
|
|
@@ -1834,15 +1834,15 @@ function ha(e) {
|
|
|
1834
1834
|
* See the License for the specific language governing permissions and
|
|
1835
1835
|
* limitations under the License.
|
|
1836
1836
|
*/
|
|
1837
|
-
function
|
|
1837
|
+
function go(e, t, r, i = 1) {
|
|
1838
1838
|
return new ii(e, t, r).subdivide(i);
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function mo(e, t, r, i, n = 1) {
|
|
1841
1841
|
return new $t(
|
|
1842
1842
|
new Float64Array([e.x, e.y, t.x, t.y, r.x, r.y, i.x, i.y])
|
|
1843
1843
|
).subdivide(n);
|
|
1844
1844
|
}
|
|
1845
|
-
function
|
|
1845
|
+
function bo(e) {
|
|
1846
1846
|
return e.x * e.x + e.y * e.y;
|
|
1847
1847
|
}
|
|
1848
1848
|
function De(e) {
|
|
@@ -1863,13 +1863,13 @@ class ii {
|
|
|
1863
1863
|
};
|
|
1864
1864
|
}
|
|
1865
1865
|
mapToBasic() {
|
|
1866
|
-
const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y:
|
|
1866
|
+
const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: o } = this.end, a = 2 * i - t - s, u = 2 * n - r - o, d = (i - t) * a + (n - r) * u, l = (s - i) * a + (o - n) * u, p = (s - t) * u - (o - r) * a, v = d / p, m = l / p, h = Math.abs(p) / (Math.hypot(a, u) * Math.abs(m - v));
|
|
1867
1867
|
return { x0: t, x2: s, scale: h, cross: p };
|
|
1868
1868
|
}
|
|
1869
1869
|
subdivide(t) {
|
|
1870
|
-
const r = this.mapToBasic(), i = De(r.x0), n = De(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t),
|
|
1871
|
-
for (let l = 1; l <
|
|
1872
|
-
const p = (Ee(i + (n - i) * l /
|
|
1870
|
+
const r = this.mapToBasic(), i = De(r.x0), n = De(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), o = Math.ceil(s), a = Ee(i), u = Ee(n), d = [0];
|
|
1871
|
+
for (let l = 1; l < o; l++) {
|
|
1872
|
+
const p = (Ee(i + (n - i) * l / o) - a) / (u - a);
|
|
1873
1873
|
d.push(p);
|
|
1874
1874
|
}
|
|
1875
1875
|
return d.push(1), d.map((l) => this.eval(l));
|
|
@@ -1881,16 +1881,16 @@ class $t {
|
|
|
1881
1881
|
Qe(this, "c"), this.c = t;
|
|
1882
1882
|
}
|
|
1883
1883
|
weightsum(t, r, i, n) {
|
|
1884
|
-
const s = t * this.c[0] + r * this.c[2] + i * this.c[4] + n * this.c[6],
|
|
1885
|
-
return { x: s, y:
|
|
1884
|
+
const s = t * this.c[0] + r * this.c[2] + i * this.c[4] + n * this.c[6], o = t * this.c[1] + r * this.c[3] + i * this.c[5] + n * this.c[7];
|
|
1885
|
+
return { x: s, y: o };
|
|
1886
1886
|
}
|
|
1887
1887
|
eval(t) {
|
|
1888
|
-
const r = 1 - t, i = r * r * r, n = 3 * r * r * t, s = 3 * r * t * t,
|
|
1889
|
-
return this.weightsum(i, n, s,
|
|
1888
|
+
const r = 1 - t, i = r * r * r, n = 3 * r * r * t, s = 3 * r * t * t, o = t * t * t;
|
|
1889
|
+
return this.weightsum(i, n, s, o);
|
|
1890
1890
|
}
|
|
1891
1891
|
deriv(t) {
|
|
1892
|
-
const r = 1 - t, i = -3 * r * r, n = 3 * t * t, s = -6 * t * r - i,
|
|
1893
|
-
return this.weightsum(i, s,
|
|
1892
|
+
const r = 1 - t, i = -3 * r * r, n = 3 * t * t, s = -6 * t * r - i, o = 6 * t * r - n;
|
|
1893
|
+
return this.weightsum(i, s, o, n);
|
|
1894
1894
|
}
|
|
1895
1895
|
// quadratic bezier with matching endpoints and minimum max vector error
|
|
1896
1896
|
midpoint_quadbez() {
|
|
@@ -1900,23 +1900,23 @@ class $t {
|
|
|
1900
1900
|
subsegment(t, r) {
|
|
1901
1901
|
const i = new Float64Array(8), n = this.eval(t), s = this.eval(r);
|
|
1902
1902
|
i[0] = n.x, i[1] = n.y;
|
|
1903
|
-
const
|
|
1904
|
-
i[2] = n.x +
|
|
1903
|
+
const o = (r - t) / 3, a = this.deriv(t);
|
|
1904
|
+
i[2] = n.x + o * a.x, i[3] = n.y + o * a.y;
|
|
1905
1905
|
const u = this.deriv(r);
|
|
1906
|
-
return i[4] = s.x -
|
|
1906
|
+
return i[4] = s.x - o * u.x, i[5] = s.y - o * u.y, i[6] = s.x, i[7] = s.y, new $t(i);
|
|
1907
1907
|
}
|
|
1908
1908
|
// Very fancy subdivision scheme
|
|
1909
1909
|
subdivide(t) {
|
|
1910
|
-
const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s =
|
|
1910
|
+
const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s = bo(this.weightsum(1, -3, 3, -1)), o = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), a = [];
|
|
1911
1911
|
let u = 0;
|
|
1912
|
-
for (let h = 0; h <
|
|
1913
|
-
const g = h /
|
|
1912
|
+
for (let h = 0; h < o; h++) {
|
|
1913
|
+
const g = h / o, b = (h + 1) / o, A = this.subsegment(g, b).midpoint_quadbez(), w = A.mapToBasic(), C = De(w.x0), T = De(w.x2), j = Math.sqrt(w.scale);
|
|
1914
1914
|
let I = Math.abs(T - C) * j;
|
|
1915
1915
|
if (Math.sign(w.x0) != Math.sign(w.x2)) {
|
|
1916
1916
|
const L = n / j, P = n * Math.abs(T - C) / De(L);
|
|
1917
1917
|
I = Math.max(I, P);
|
|
1918
1918
|
}
|
|
1919
|
-
|
|
1919
|
+
a.push({
|
|
1920
1920
|
quad: A,
|
|
1921
1921
|
a0: C,
|
|
1922
1922
|
a2: T,
|
|
@@ -1927,15 +1927,15 @@ class $t {
|
|
|
1927
1927
|
let v = 0, m = 0;
|
|
1928
1928
|
for (let h = 1; h < l; h++) {
|
|
1929
1929
|
const g = u * h / l;
|
|
1930
|
-
for (; v +
|
|
1931
|
-
v +=
|
|
1932
|
-
const b =
|
|
1933
|
-
p.push(
|
|
1930
|
+
for (; v + a[m].val < g; )
|
|
1931
|
+
v += a[m].val, m++;
|
|
1932
|
+
const b = a[m].a0, A = a[m].a2, w = Ee(b), C = Ee(A), T = b + (A - b) * (g - v) / a[m].val, j = (Ee(T) - w) / (C - w);
|
|
1933
|
+
p.push(a[m].quad.eval(j));
|
|
1934
1934
|
}
|
|
1935
1935
|
return p.push({ x: this.c[6], y: this.c[7] }), p;
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
|
-
const
|
|
1938
|
+
const Ao = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, xo = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, sr = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
|
|
1939
1939
|
function Ye(e, {
|
|
1940
1940
|
domParser: t,
|
|
1941
1941
|
svgPreprocessor: r,
|
|
@@ -1946,11 +1946,11 @@ function Ye(e, {
|
|
|
1946
1946
|
e.reduce(
|
|
1947
1947
|
(n, s) => {
|
|
1948
1948
|
const {
|
|
1949
|
-
selector:
|
|
1950
|
-
selectors:
|
|
1949
|
+
selector: o,
|
|
1950
|
+
selectors: a,
|
|
1951
1951
|
iiifRenderingHints: u
|
|
1952
1952
|
} = Ye(s, { domParser: t, svgPreprocessor: r, iiifRenderingHints: i });
|
|
1953
|
-
return
|
|
1953
|
+
return o && (n.selector || (n.selector = o), n.selectors.push(...a)), u && (n.iiifRenderingHints = n.iiifRenderingHints || { type: "ImageApiSelector" }, Object.assign(n.iiifRenderingHints, u)), n;
|
|
1954
1954
|
},
|
|
1955
1955
|
{
|
|
1956
1956
|
selector: null,
|
|
@@ -1989,7 +1989,7 @@ function Ye(e, {
|
|
|
1989
1989
|
iiifRenderingHints: i
|
|
1990
1990
|
});
|
|
1991
1991
|
}
|
|
1992
|
-
if (
|
|
1992
|
+
if (Mo(e)) {
|
|
1993
1993
|
const n = [];
|
|
1994
1994
|
if (e.region) {
|
|
1995
1995
|
const s = Ye(
|
|
@@ -2005,9 +2005,9 @@ function Ye(e, {
|
|
|
2005
2005
|
});
|
|
2006
2006
|
}
|
|
2007
2007
|
if (e.type === "FragmentSelector") {
|
|
2008
|
-
const n =
|
|
2008
|
+
const n = Ao.exec(e.value);
|
|
2009
2009
|
if (n) {
|
|
2010
|
-
const
|
|
2010
|
+
const o = {
|
|
2011
2011
|
type: "BoxSelector",
|
|
2012
2012
|
spatial: {
|
|
2013
2013
|
unit: n[2] === "percent:" || n[2] === "pct:" ? "percent" : "pixel",
|
|
@@ -2018,14 +2018,14 @@ function Ye(e, {
|
|
|
2018
2018
|
}
|
|
2019
2019
|
};
|
|
2020
2020
|
return te({
|
|
2021
|
-
selector:
|
|
2022
|
-
selectors: [
|
|
2021
|
+
selector: o,
|
|
2022
|
+
selectors: [o],
|
|
2023
2023
|
iiifRenderingHints: i
|
|
2024
2024
|
});
|
|
2025
2025
|
}
|
|
2026
|
-
const s = e.value.match(
|
|
2026
|
+
const s = e.value.match(xo);
|
|
2027
2027
|
if (s) {
|
|
2028
|
-
const
|
|
2028
|
+
const o = {
|
|
2029
2029
|
type: "TemporalSelector",
|
|
2030
2030
|
temporal: {
|
|
2031
2031
|
startTime: s[4] ? parseFloat(s[4]) : 0,
|
|
@@ -2033,8 +2033,8 @@ function Ye(e, {
|
|
|
2033
2033
|
}
|
|
2034
2034
|
};
|
|
2035
2035
|
return te({
|
|
2036
|
-
selector:
|
|
2037
|
-
selectors: [
|
|
2036
|
+
selector: o,
|
|
2037
|
+
selectors: [o],
|
|
2038
2038
|
iiifRenderingHints: i
|
|
2039
2039
|
});
|
|
2040
2040
|
}
|
|
@@ -2048,7 +2048,7 @@ function Ye(e, {
|
|
|
2048
2048
|
t || (typeof window < "u" ? t = new window.DOMParser() : console.warn(
|
|
2049
2049
|
"No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."
|
|
2050
2050
|
));
|
|
2051
|
-
let n = [], s,
|
|
2051
|
+
let n = [], s, o, a = (r == null ? void 0 : r(e.value)) ?? e.value, u;
|
|
2052
2052
|
if (t) {
|
|
2053
2053
|
const l = t.parseFromString(e.value, "image/svg+xml").querySelector("svg");
|
|
2054
2054
|
if (!l)
|
|
@@ -2067,13 +2067,13 @@ function Ye(e, {
|
|
|
2067
2067
|
// urx
|
|
2068
2068
|
Math.max(...n.map((v) => v[1]))
|
|
2069
2069
|
// ury
|
|
2070
|
-
], { style:
|
|
2070
|
+
], { style: o, svg: a } = Co(p.element) ?? { svg: a });
|
|
2071
2071
|
}
|
|
2072
2072
|
const d = {
|
|
2073
2073
|
type: "SvgSelector",
|
|
2074
|
-
svg:
|
|
2074
|
+
svg: a,
|
|
2075
2075
|
svgShape: u,
|
|
2076
|
-
style:
|
|
2076
|
+
style: o,
|
|
2077
2077
|
points: n.length ? n : void 0,
|
|
2078
2078
|
spatial: s ? { unit: "pixel", x: s[0], y: s[1], width: s[2] - s[0], height: s[3] - s[1] } : void 0
|
|
2079
2079
|
};
|
|
@@ -2089,7 +2089,7 @@ function Ye(e, {
|
|
|
2089
2089
|
iiifRenderingHints: i
|
|
2090
2090
|
});
|
|
2091
2091
|
}
|
|
2092
|
-
function
|
|
2092
|
+
function wo(e) {
|
|
2093
2093
|
const t = e.map((i) => i[0]).reduce(
|
|
2094
2094
|
(i, n) => (i[n] += 1, i),
|
|
2095
2095
|
{ C: 0, Q: 0, L: 0, M: 0 }
|
|
@@ -2119,40 +2119,40 @@ function ni(e) {
|
|
|
2119
2119
|
const i = r.getAttribute("d");
|
|
2120
2120
|
if (!i)
|
|
2121
2121
|
continue;
|
|
2122
|
-
const n =
|
|
2123
|
-
return { element: r, points:
|
|
2122
|
+
const n = vo(i);
|
|
2123
|
+
return { element: r, points: So(n), shapeType: wo(n) };
|
|
2124
2124
|
}
|
|
2125
2125
|
case "circle": {
|
|
2126
2126
|
const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("r") ?? "0");
|
|
2127
2127
|
if (!s)
|
|
2128
2128
|
continue;
|
|
2129
|
-
const
|
|
2130
|
-
for (let
|
|
2131
|
-
const u =
|
|
2132
|
-
|
|
2129
|
+
const o = [];
|
|
2130
|
+
for (let a = 0; a <= 360; a += 12) {
|
|
2131
|
+
const u = a * Math.PI / 180;
|
|
2132
|
+
o.push([i + s * Math.cos(u), n + s * Math.sin(u)]);
|
|
2133
2133
|
}
|
|
2134
|
-
return { element: r, points:
|
|
2134
|
+
return { element: r, points: o, shapeType: "circle" };
|
|
2135
2135
|
}
|
|
2136
2136
|
case "ellipse": {
|
|
2137
|
-
const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("rx") ?? "0"),
|
|
2138
|
-
if (!s && !
|
|
2137
|
+
const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("rx") ?? "0"), o = parseFloat(r.getAttribute("ry") ?? "0");
|
|
2138
|
+
if (!s && !o)
|
|
2139
2139
|
continue;
|
|
2140
|
-
const
|
|
2140
|
+
const a = [];
|
|
2141
2141
|
for (let u = 0; u <= 360; u += 12) {
|
|
2142
|
-
const d = Math.tan(u / 360 * Math.PI), l = s * (1 - d ** 2) / (1 + d ** 2), p =
|
|
2143
|
-
|
|
2142
|
+
const d = Math.tan(u / 360 * Math.PI), l = s * (1 - d ** 2) / (1 + d ** 2), p = o * 2 * d / (1 + d ** 2);
|
|
2143
|
+
a.push([i + l, n + p]);
|
|
2144
2144
|
}
|
|
2145
|
-
return { element: r, points:
|
|
2145
|
+
return { element: r, points: a, shapeType: "ellipse" };
|
|
2146
2146
|
}
|
|
2147
2147
|
case "line": {
|
|
2148
|
-
const i = parseFloat(r.getAttribute("x0") ?? "0"), n = parseFloat(r.getAttribute("y0") ?? "0"), s = parseFloat(r.getAttribute("x1") ?? "0"),
|
|
2149
|
-
if (i === s && n ===
|
|
2148
|
+
const i = parseFloat(r.getAttribute("x0") ?? "0"), n = parseFloat(r.getAttribute("y0") ?? "0"), s = parseFloat(r.getAttribute("x1") ?? "0"), o = parseFloat(r.getAttribute("y1") ?? "0");
|
|
2149
|
+
if (i === s && n === o)
|
|
2150
2150
|
continue;
|
|
2151
2151
|
return {
|
|
2152
2152
|
element: r,
|
|
2153
2153
|
points: [
|
|
2154
2154
|
[i, n],
|
|
2155
|
-
[s,
|
|
2155
|
+
[s, o]
|
|
2156
2156
|
],
|
|
2157
2157
|
shapeType: "polyline"
|
|
2158
2158
|
};
|
|
@@ -2166,16 +2166,16 @@ function ni(e) {
|
|
|
2166
2166
|
return r.tagName.toLowerCase() === "polygon" && (i.push(i[0]), n = "polygon"), { element: r, points: i, shapeType: n };
|
|
2167
2167
|
}
|
|
2168
2168
|
case "rect": {
|
|
2169
|
-
const i = parseFloat(r.getAttribute("x") ?? "0"), n = parseFloat(r.getAttribute("y") ?? "0"), s = parseFloat(r.getAttribute("width") ?? "0"),
|
|
2170
|
-
if (!s || !
|
|
2169
|
+
const i = parseFloat(r.getAttribute("x") ?? "0"), n = parseFloat(r.getAttribute("y") ?? "0"), s = parseFloat(r.getAttribute("width") ?? "0"), o = parseFloat(r.getAttribute("height") ?? "0");
|
|
2170
|
+
if (!s || !o)
|
|
2171
2171
|
continue;
|
|
2172
2172
|
return {
|
|
2173
2173
|
element: r,
|
|
2174
2174
|
points: [
|
|
2175
2175
|
[i, n],
|
|
2176
2176
|
[i + s, n],
|
|
2177
|
-
[i + s, n +
|
|
2178
|
-
[i, n +
|
|
2177
|
+
[i + s, n + o],
|
|
2178
|
+
[i, n + o],
|
|
2179
2179
|
[i, n]
|
|
2180
2180
|
],
|
|
2181
2181
|
shapeType: "rect"
|
|
@@ -2186,7 +2186,7 @@ function ni(e) {
|
|
|
2186
2186
|
}
|
|
2187
2187
|
return null;
|
|
2188
2188
|
}
|
|
2189
|
-
function
|
|
2189
|
+
function So(e) {
|
|
2190
2190
|
const t = [];
|
|
2191
2191
|
for (let r = 0; r < e.length; r++) {
|
|
2192
2192
|
const i = t[t.length - 1] ?? [0, 0], n = e[r];
|
|
@@ -2197,7 +2197,7 @@ function xa(e) {
|
|
|
2197
2197
|
continue;
|
|
2198
2198
|
case "C":
|
|
2199
2199
|
t.push(
|
|
2200
|
-
...
|
|
2200
|
+
...mo(
|
|
2201
2201
|
{ x: i[0], y: i[1] },
|
|
2202
2202
|
{ x: n[1], y: n[2] },
|
|
2203
2203
|
{ x: n[3], y: n[4] },
|
|
@@ -2208,7 +2208,7 @@ function xa(e) {
|
|
|
2208
2208
|
continue;
|
|
2209
2209
|
case "Q":
|
|
2210
2210
|
t.push(
|
|
2211
|
-
...
|
|
2211
|
+
...go(
|
|
2212
2212
|
{ x: i[0], y: i[1] },
|
|
2213
2213
|
{ x: n[1], y: n[2] },
|
|
2214
2214
|
{ x: n[3], y: n[4] }
|
|
@@ -2220,7 +2220,7 @@ function xa(e) {
|
|
|
2220
2220
|
}
|
|
2221
2221
|
return t;
|
|
2222
2222
|
}
|
|
2223
|
-
function
|
|
2223
|
+
function Co(e) {
|
|
2224
2224
|
const t = {};
|
|
2225
2225
|
if (e.hasAttribute("fill") ? (t.fill = e.getAttribute("fill"), e.removeAttribute("fill")) : e.style.fill && (t.fill = e.style.fill), t.fill) {
|
|
2226
2226
|
const i = sr.exec(t.fill);
|
|
@@ -2237,14 +2237,14 @@ function wa(e) {
|
|
|
2237
2237
|
throw new Error("Could not find root SVG element");
|
|
2238
2238
|
return { svg: r.outerHTML, style: Object.keys(t).length > 0 ? t : void 0 };
|
|
2239
2239
|
}
|
|
2240
|
-
function
|
|
2240
|
+
function Mo(e) {
|
|
2241
2241
|
return !!e && e.type === "iiif:ImageApiSelector" && e.type === "iiif:ImageApiSelector";
|
|
2242
2242
|
}
|
|
2243
2243
|
function te(e) {
|
|
2244
2244
|
if (e.iiifRenderingHints) {
|
|
2245
2245
|
const t = e.iiifRenderingHints;
|
|
2246
2246
|
if (t.rotation) {
|
|
2247
|
-
const r =
|
|
2247
|
+
const r = Ro(t.rotation);
|
|
2248
2248
|
if (r)
|
|
2249
2249
|
if (e.selectors.length)
|
|
2250
2250
|
for (const i of e.selectors)
|
|
@@ -2259,7 +2259,7 @@ function te(e) {
|
|
|
2259
2259
|
delete e.iiifRenderingHints;
|
|
2260
2260
|
return e;
|
|
2261
2261
|
}
|
|
2262
|
-
function
|
|
2262
|
+
function Ro(e) {
|
|
2263
2263
|
let t = parseFloat(e);
|
|
2264
2264
|
return t && e.startsWith("!") && (t = 360 - t), t && (t = t % 360), t !== t ? 0 : t || 0;
|
|
2265
2265
|
}
|
|
@@ -2335,95 +2335,95 @@ function Re(e, t = {}) {
|
|
|
2335
2335
|
};
|
|
2336
2336
|
}
|
|
2337
2337
|
function si(e = {}, t = []) {
|
|
2338
|
-
const { id: r, selector: i } = e, n = be(), s = V(),
|
|
2339
|
-
(d) =>
|
|
2340
|
-
[
|
|
2338
|
+
const { id: r, selector: i } = e, n = be(), s = V(), o = r || n.annotation, a = Q(
|
|
2339
|
+
(d) => o ? d.iiif.entities.Annotation[o] : void 0,
|
|
2340
|
+
[o]
|
|
2341
2341
|
), u = Q(
|
|
2342
|
-
(d) =>
|
|
2342
|
+
(d) => a && a.body ? a.body.map((l) => l ? l.type === "SpecificResource" ? {
|
|
2343
2343
|
...l,
|
|
2344
2344
|
source: s.get(l)
|
|
2345
2345
|
} : l ? d.iiif.entities[l.type][l.id] : null : null).filter(Boolean) : [],
|
|
2346
|
-
[
|
|
2346
|
+
[a]
|
|
2347
2347
|
);
|
|
2348
2348
|
return E(() => {
|
|
2349
|
-
if (!
|
|
2349
|
+
if (!a)
|
|
2350
2350
|
return;
|
|
2351
2351
|
const d = {
|
|
2352
|
-
...
|
|
2352
|
+
...a,
|
|
2353
2353
|
body: u,
|
|
2354
|
-
target: Re(
|
|
2354
|
+
target: Re(a.target, { typeMap: s.getState().iiif.mapping })
|
|
2355
2355
|
};
|
|
2356
2356
|
return i ? i(d) : d;
|
|
2357
|
-
}, [
|
|
2357
|
+
}, [a, i, u, ...t]);
|
|
2358
2358
|
}
|
|
2359
|
-
const
|
|
2359
|
+
const oi = ({
|
|
2360
2360
|
id: e,
|
|
2361
2361
|
style: t,
|
|
2362
2362
|
className: r,
|
|
2363
2363
|
interactive: i
|
|
2364
2364
|
}) => {
|
|
2365
|
-
const n = si({ id: e }), s = et(n, "atlas"),
|
|
2365
|
+
const n = si({ id: e }), s = et(n, "atlas"), o = et(n, "html"), a = ei(n, ["atlas"]), u = ue(), d = E(() => fn(t, s), [t, s]);
|
|
2366
2366
|
return u && n && n.target && n.target.selector && n.target.selector.type === "BoxSelector" && n.target.source && (n.target.source.id === u.id || n.target.source === u.id) ? /* @__PURE__ */ x(
|
|
2367
|
-
|
|
2367
|
+
pn,
|
|
2368
2368
|
{
|
|
2369
2369
|
id: n.id,
|
|
2370
2370
|
isEditing: !0,
|
|
2371
2371
|
region: n.target.selector.spatial,
|
|
2372
2372
|
style: d,
|
|
2373
|
-
className: (
|
|
2374
|
-
interactive: !!(
|
|
2375
|
-
href: (
|
|
2376
|
-
title: (
|
|
2377
|
-
hrefTarget: (
|
|
2373
|
+
className: (o == null ? void 0 : o.className) || r,
|
|
2374
|
+
interactive: !!(o != null && o.href || i),
|
|
2375
|
+
href: (o == null ? void 0 : o.href) || null,
|
|
2376
|
+
title: (o == null ? void 0 : o.title) || null,
|
|
2377
|
+
hrefTarget: (o == null ? void 0 : o.target) || null,
|
|
2378
2378
|
onClick: () => {
|
|
2379
2379
|
},
|
|
2380
|
-
...
|
|
2380
|
+
...a
|
|
2381
2381
|
}
|
|
2382
2382
|
) : null;
|
|
2383
2383
|
};
|
|
2384
|
-
function
|
|
2385
|
-
const { id: r, selector: i } = e, n = be(), s = r || n.annotationPage,
|
|
2386
|
-
(
|
|
2384
|
+
function Io(e = {}, t = []) {
|
|
2385
|
+
const { id: r, selector: i } = e, n = be(), s = r || n.annotationPage, o = Q(
|
|
2386
|
+
(a) => s ? a.iiif.entities.AnnotationPage[s] : void 0,
|
|
2387
2387
|
[s]
|
|
2388
2388
|
);
|
|
2389
2389
|
return E(() => {
|
|
2390
|
-
if (
|
|
2391
|
-
return i ? i(
|
|
2392
|
-
}, [
|
|
2390
|
+
if (o)
|
|
2391
|
+
return i ? i(o) : o;
|
|
2392
|
+
}, [o, ...t]);
|
|
2393
2393
|
}
|
|
2394
2394
|
const It = ({
|
|
2395
2395
|
className: e,
|
|
2396
2396
|
page: t
|
|
2397
2397
|
}) => {
|
|
2398
2398
|
var s;
|
|
2399
|
-
const r =
|
|
2400
|
-
return Q((
|
|
2401
|
-
|
|
2399
|
+
const r = Io({ id: t.id }) || t, i = et(r, "atlas"), n = et(r, "html");
|
|
2400
|
+
return Q((o) => r.id ? o.iiif.entities.AnnotationPage[r.id] : null, []), /* @__PURE__ */ x(Ke, { children: (s = r.items) == null ? void 0 : s.map((o) => /* @__PURE__ */ x(
|
|
2401
|
+
oi,
|
|
2402
2402
|
{
|
|
2403
|
-
id:
|
|
2403
|
+
id: o.id,
|
|
2404
2404
|
style: i,
|
|
2405
2405
|
className: (n == null ? void 0 : n.className) || e
|
|
2406
2406
|
},
|
|
2407
|
-
|
|
2407
|
+
o.id
|
|
2408
2408
|
)) });
|
|
2409
2409
|
};
|
|
2410
|
-
function
|
|
2410
|
+
function ai({
|
|
2411
2411
|
id: e,
|
|
2412
2412
|
image: t,
|
|
2413
2413
|
thumbnail: r,
|
|
2414
2414
|
isStatic: i,
|
|
2415
2415
|
x: n = 0,
|
|
2416
2416
|
y: s = 0,
|
|
2417
|
-
children:
|
|
2418
|
-
selector:
|
|
2417
|
+
children: o,
|
|
2418
|
+
selector: a,
|
|
2419
2419
|
onClick: u,
|
|
2420
2420
|
enableSizes: d
|
|
2421
2421
|
}) {
|
|
2422
2422
|
var p, v;
|
|
2423
2423
|
const l = E(() => {
|
|
2424
|
-
if (!(!
|
|
2425
|
-
return
|
|
2426
|
-
}, [
|
|
2424
|
+
if (!(!a || a.spatial.x === 0 && a.spatial.y === 0))
|
|
2425
|
+
return a.spatial;
|
|
2426
|
+
}, [a]);
|
|
2427
2427
|
return /* @__PURE__ */ x(
|
|
2428
2428
|
"world-object",
|
|
2429
2429
|
{
|
|
@@ -2434,7 +2434,7 @@ function oi({
|
|
|
2434
2434
|
onClick: u,
|
|
2435
2435
|
children: t.service ? /* @__PURE__ */ N(Ke, { children: [
|
|
2436
2436
|
/* @__PURE__ */ x(
|
|
2437
|
-
|
|
2437
|
+
dn,
|
|
2438
2438
|
{
|
|
2439
2439
|
tiles: {
|
|
2440
2440
|
id: t.service.id || t.service["@id"] || "unknown",
|
|
@@ -2451,7 +2451,7 @@ function oi({
|
|
|
2451
2451
|
crop: l
|
|
2452
2452
|
}
|
|
2453
2453
|
),
|
|
2454
|
-
|
|
2454
|
+
o
|
|
2455
2455
|
] }, "service") : /* @__PURE__ */ N(Ke, { children: [
|
|
2456
2456
|
/* @__PURE__ */ x(
|
|
2457
2457
|
"world-image",
|
|
@@ -2466,26 +2466,26 @@ function oi({
|
|
|
2466
2466
|
crop: l
|
|
2467
2467
|
}
|
|
2468
2468
|
),
|
|
2469
|
-
|
|
2469
|
+
o
|
|
2470
2470
|
] }, "no-service")
|
|
2471
2471
|
},
|
|
2472
2472
|
e + (t.service ? "server" : "no-service")
|
|
2473
2473
|
);
|
|
2474
2474
|
}
|
|
2475
|
-
var
|
|
2475
|
+
var To = Object.defineProperty, ko = (e, t, r) => t in e ? To(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ge = (e, t, r) => (ko(e, typeof t != "symbol" ? t + "" : t, r), r), Oo = /* @__PURE__ */ function() {
|
|
2476
2476
|
function e(t, r) {
|
|
2477
|
-
var i = [], n = !0, s = !1,
|
|
2477
|
+
var i = [], n = !0, s = !1, o = void 0;
|
|
2478
2478
|
try {
|
|
2479
|
-
for (var
|
|
2479
|
+
for (var a = t[Symbol.iterator](), u; !(n = (u = a.next()).done) && (i.push(u.value), !(r && i.length === r)); n = !0)
|
|
2480
2480
|
;
|
|
2481
2481
|
} catch (d) {
|
|
2482
|
-
s = !0,
|
|
2482
|
+
s = !0, o = d;
|
|
2483
2483
|
} finally {
|
|
2484
2484
|
try {
|
|
2485
|
-
!n &&
|
|
2485
|
+
!n && a.return && a.return();
|
|
2486
2486
|
} finally {
|
|
2487
2487
|
if (s)
|
|
2488
|
-
throw
|
|
2488
|
+
throw o;
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
2491
2491
|
return i;
|
|
@@ -2497,64 +2497,64 @@ var Ra = Object.defineProperty, Ia = (e, t, r) => t in e ? Ra(e, t, { enumerable
|
|
|
2497
2497
|
return e(t, r);
|
|
2498
2498
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
2499
2499
|
};
|
|
2500
|
-
}(), qe = Math.PI * 2, yt = function(e, t, r, i, n, s,
|
|
2501
|
-
var
|
|
2502
|
-
|
|
2503
|
-
var d = i *
|
|
2500
|
+
}(), qe = Math.PI * 2, yt = function(e, t, r, i, n, s, o) {
|
|
2501
|
+
var a = e.x, u = e.y;
|
|
2502
|
+
a *= t, u *= r;
|
|
2503
|
+
var d = i * a - n * u, l = n * a + i * u;
|
|
2504
2504
|
return {
|
|
2505
2505
|
x: d + s,
|
|
2506
|
-
y: l +
|
|
2506
|
+
y: l + o
|
|
2507
2507
|
};
|
|
2508
|
-
},
|
|
2509
|
-
var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t),
|
|
2508
|
+
}, Eo = function(e, t) {
|
|
2509
|
+
var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t), o = Math.sin(e + t);
|
|
2510
2510
|
return [{
|
|
2511
2511
|
x: i - n * r,
|
|
2512
2512
|
y: n + i * r
|
|
2513
2513
|
}, {
|
|
2514
|
-
x: s +
|
|
2515
|
-
y:
|
|
2514
|
+
x: s + o * r,
|
|
2515
|
+
y: o - s * r
|
|
2516
2516
|
}, {
|
|
2517
2517
|
x: s,
|
|
2518
|
-
y:
|
|
2518
|
+
y: o
|
|
2519
2519
|
}];
|
|
2520
|
-
},
|
|
2520
|
+
}, or = function(e, t, r, i) {
|
|
2521
2521
|
var n = e * i - t * r < 0 ? -1 : 1, s = e * r + t * i;
|
|
2522
2522
|
return s > 1 && (s = 1), s < -1 && (s = -1), n * Math.acos(s);
|
|
2523
|
-
},
|
|
2523
|
+
}, Po = function(e, t, r, i, n, s, o, a, u, d, l, p) {
|
|
2524
2524
|
var v = Math.pow(n, 2), m = Math.pow(s, 2), h = Math.pow(l, 2), g = Math.pow(p, 2), b = v * m - v * g - m * h;
|
|
2525
|
-
b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (
|
|
2526
|
-
var A = b * n / s * p, w = b * -s / n * l, C = d * A - u * w + (e + r) / 2, T = u * A + d * w + (t + i) / 2, j = (l - A) / n, I = (p - w) / s, L = (-l - A) / n, P = (-p - w) / s, M =
|
|
2527
|
-
return
|
|
2528
|
-
},
|
|
2529
|
-
var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx,
|
|
2530
|
-
if (s === 0 ||
|
|
2525
|
+
b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (o === a ? -1 : 1);
|
|
2526
|
+
var A = b * n / s * p, w = b * -s / n * l, C = d * A - u * w + (e + r) / 2, T = u * A + d * w + (t + i) / 2, j = (l - A) / n, I = (p - w) / s, L = (-l - A) / n, P = (-p - w) / s, M = or(1, 0, j, I), $ = or(j, I, L, P);
|
|
2527
|
+
return a === 0 && $ > 0 && ($ -= qe), a === 1 && $ < 0 && ($ += qe), [C, T, M, $];
|
|
2528
|
+
}, Lo = function(e) {
|
|
2529
|
+
var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, o = e.ry, a = e.xAxisRotation, u = a === void 0 ? 0 : a, d = e.largeArcFlag, l = d === void 0 ? 0 : d, p = e.sweepFlag, v = p === void 0 ? 0 : p, m = [];
|
|
2530
|
+
if (s === 0 || o === 0)
|
|
2531
2531
|
return [];
|
|
2532
2532
|
var h = Math.sin(u * qe / 360), g = Math.cos(u * qe / 360), b = g * (t - i) / 2 + h * (r - n) / 2, A = -h * (t - i) / 2 + g * (r - n) / 2;
|
|
2533
2533
|
if (b === 0 && A === 0)
|
|
2534
2534
|
return [];
|
|
2535
|
-
s = Math.abs(s),
|
|
2536
|
-
var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(
|
|
2537
|
-
w > 1 && (s *= Math.sqrt(w),
|
|
2538
|
-
var C =
|
|
2535
|
+
s = Math.abs(s), o = Math.abs(o);
|
|
2536
|
+
var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(o, 2);
|
|
2537
|
+
w > 1 && (s *= Math.sqrt(w), o *= Math.sqrt(w));
|
|
2538
|
+
var C = Po(t, r, i, n, s, o, l, v, h, g, b, A), T = Oo(C, 4), j = T[0], I = T[1], L = T[2], P = T[3], M = Math.abs(P) / (qe / 4);
|
|
2539
2539
|
Math.abs(1 - M) < 1e-7 && (M = 1);
|
|
2540
2540
|
var $ = Math.max(Math.ceil(M), 1);
|
|
2541
2541
|
P /= $;
|
|
2542
2542
|
for (var ie = 0; ie < $; ie++)
|
|
2543
|
-
m.push(
|
|
2543
|
+
m.push(Eo(L, P)), L += P;
|
|
2544
2544
|
return m.map(function(Z) {
|
|
2545
|
-
var U = yt(Z[0], s,
|
|
2545
|
+
var U = yt(Z[0], s, o, g, h, j, I), z = U.x, ee = U.y, ne = yt(Z[1], s, o, g, h, j, I), xe = ne.x, O = ne.y, W = yt(Z[2], s, o, g, h, j, I), X = W.x, de = W.y;
|
|
2546
2546
|
return { x1: z, y1: ee, x2: xe, y2: O, x: X, y: de };
|
|
2547
2547
|
});
|
|
2548
|
-
},
|
|
2548
|
+
}, Fo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2549
2549
|
function ci(e) {
|
|
2550
2550
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2551
2551
|
}
|
|
2552
|
-
var
|
|
2553
|
-
function
|
|
2552
|
+
var jo = Do, vt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, $o = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
2553
|
+
function Do(e) {
|
|
2554
2554
|
var t = [];
|
|
2555
|
-
return e.replace(
|
|
2555
|
+
return e.replace($o, function(r, i, n) {
|
|
2556
2556
|
var s = i.toLowerCase();
|
|
2557
|
-
for (n =
|
|
2557
|
+
for (n = _o(n), s == "m" && n.length > 2 && (t.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
|
|
2558
2558
|
if (n.length == vt[s])
|
|
2559
2559
|
return n.unshift(i), t.push(n);
|
|
2560
2560
|
if (n.length < vt[s])
|
|
@@ -2563,20 +2563,20 @@ function ja(e) {
|
|
|
2563
2563
|
}
|
|
2564
2564
|
}), t;
|
|
2565
2565
|
}
|
|
2566
|
-
var
|
|
2567
|
-
function
|
|
2568
|
-
var t = e.match(
|
|
2566
|
+
var qo = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
2567
|
+
function _o(e) {
|
|
2568
|
+
var t = e.match(qo);
|
|
2569
2569
|
return t ? t.map(Number) : [];
|
|
2570
2570
|
}
|
|
2571
|
-
const
|
|
2572
|
-
var
|
|
2573
|
-
function
|
|
2571
|
+
const Uo = /* @__PURE__ */ ci(jo);
|
|
2572
|
+
var Vo = No;
|
|
2573
|
+
function No(e) {
|
|
2574
2574
|
var t = 0, r = 0, i = 0, n = 0;
|
|
2575
2575
|
return e.map(function(s) {
|
|
2576
2576
|
s = s.slice();
|
|
2577
|
-
var
|
|
2578
|
-
if (
|
|
2579
|
-
switch (s[0] =
|
|
2577
|
+
var o = s[0], a = o.toUpperCase();
|
|
2578
|
+
if (o != a)
|
|
2579
|
+
switch (s[0] = a, o) {
|
|
2580
2580
|
case "a":
|
|
2581
2581
|
s[6] += i, s[7] += n;
|
|
2582
2582
|
break;
|
|
@@ -2590,7 +2590,7 @@ function Ua(e) {
|
|
|
2590
2590
|
for (var u = 1; u < s.length; )
|
|
2591
2591
|
s[u++] += i, s[u++] += n;
|
|
2592
2592
|
}
|
|
2593
|
-
switch (
|
|
2593
|
+
switch (a) {
|
|
2594
2594
|
case "Z":
|
|
2595
2595
|
i = t, n = r;
|
|
2596
2596
|
break;
|
|
@@ -2609,10 +2609,10 @@ function Ua(e) {
|
|
|
2609
2609
|
return s;
|
|
2610
2610
|
});
|
|
2611
2611
|
}
|
|
2612
|
-
const
|
|
2613
|
-
function
|
|
2614
|
-
const t =
|
|
2615
|
-
let i, n = 0, s = 0,
|
|
2612
|
+
const Ho = /* @__PURE__ */ ci(Vo);
|
|
2613
|
+
function Bo(e) {
|
|
2614
|
+
const t = Uo(e), r = Ho(t);
|
|
2615
|
+
let i, n = 0, s = 0, o = 0, a = 0, u, d, l = 0, p = 0;
|
|
2616
2616
|
const v = [];
|
|
2617
2617
|
for (let m = 0; m < r.length; m++) {
|
|
2618
2618
|
let h = r[m];
|
|
@@ -2630,7 +2630,7 @@ function Na(e) {
|
|
|
2630
2630
|
case "S":
|
|
2631
2631
|
{
|
|
2632
2632
|
let b = l, A = p;
|
|
2633
|
-
(i === "C" || i == "S") && (b += b -
|
|
2633
|
+
(i === "C" || i == "S") && (b += b - o, A += A - a), h = ["C", b, A, h[1], h[2], h[3], h[4]];
|
|
2634
2634
|
}
|
|
2635
2635
|
break;
|
|
2636
2636
|
case "T":
|
|
@@ -2641,7 +2641,7 @@ function Na(e) {
|
|
|
2641
2641
|
break;
|
|
2642
2642
|
case "A":
|
|
2643
2643
|
{
|
|
2644
|
-
const b =
|
|
2644
|
+
const b = Lo({
|
|
2645
2645
|
px: l,
|
|
2646
2646
|
py: p,
|
|
2647
2647
|
cx: h[6],
|
|
@@ -2663,7 +2663,7 @@ function Na(e) {
|
|
|
2663
2663
|
h = ["L", n, s];
|
|
2664
2664
|
break;
|
|
2665
2665
|
}
|
|
2666
|
-
i = g, l = h[h.length - 2], p = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (
|
|
2666
|
+
i = g, l = h[h.length - 2], p = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (o = h[h.length - 4], a = h[h.length - 3]) : (o = l, a = p), v.push(h);
|
|
2667
2667
|
}
|
|
2668
2668
|
return v;
|
|
2669
2669
|
}
|
|
@@ -2698,15 +2698,15 @@ function Na(e) {
|
|
|
2698
2698
|
* See the License for the specific language governing permissions and
|
|
2699
2699
|
* limitations under the License.
|
|
2700
2700
|
*/
|
|
2701
|
-
function
|
|
2701
|
+
function zo(e, t, r, i = 1) {
|
|
2702
2702
|
return new ui(e, t, r).subdivide(i);
|
|
2703
2703
|
}
|
|
2704
|
-
function
|
|
2704
|
+
function Wo(e, t, r, i, n = 1) {
|
|
2705
2705
|
return new Dt(
|
|
2706
2706
|
new Float64Array([e.x, e.y, t.x, t.y, r.x, r.y, i.x, i.y])
|
|
2707
2707
|
).subdivide(n);
|
|
2708
2708
|
}
|
|
2709
|
-
function
|
|
2709
|
+
function Qo(e) {
|
|
2710
2710
|
return e.x * e.x + e.y * e.y;
|
|
2711
2711
|
}
|
|
2712
2712
|
function _e(e) {
|
|
@@ -2727,13 +2727,13 @@ class ui {
|
|
|
2727
2727
|
};
|
|
2728
2728
|
}
|
|
2729
2729
|
mapToBasic() {
|
|
2730
|
-
const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y:
|
|
2730
|
+
const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: o } = this.end, a = 2 * i - t - s, u = 2 * n - r - o, d = (i - t) * a + (n - r) * u, l = (s - i) * a + (o - n) * u, p = (s - t) * u - (o - r) * a, v = d / p, m = l / p, h = Math.abs(p) / (Math.hypot(a, u) * Math.abs(m - v));
|
|
2731
2731
|
return { x0: t, x2: s, scale: h, cross: p };
|
|
2732
2732
|
}
|
|
2733
2733
|
subdivide(t) {
|
|
2734
|
-
const r = this.mapToBasic(), i = _e(r.x0), n = _e(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t),
|
|
2735
|
-
for (let l = 1; l <
|
|
2736
|
-
const p = (Pe(i + (n - i) * l /
|
|
2734
|
+
const r = this.mapToBasic(), i = _e(r.x0), n = _e(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), o = Math.ceil(s), a = Pe(i), u = Pe(n), d = [0];
|
|
2735
|
+
for (let l = 1; l < o; l++) {
|
|
2736
|
+
const p = (Pe(i + (n - i) * l / o) - a) / (u - a);
|
|
2737
2737
|
d.push(p);
|
|
2738
2738
|
}
|
|
2739
2739
|
return d.push(1), d.map((l) => this.eval(l));
|
|
@@ -2745,16 +2745,16 @@ class Dt {
|
|
|
2745
2745
|
Ge(this, "c"), this.c = t;
|
|
2746
2746
|
}
|
|
2747
2747
|
weightsum(t, r, i, n) {
|
|
2748
|
-
const s = t * this.c[0] + r * this.c[2] + i * this.c[4] + n * this.c[6],
|
|
2749
|
-
return { x: s, y:
|
|
2748
|
+
const s = t * this.c[0] + r * this.c[2] + i * this.c[4] + n * this.c[6], o = t * this.c[1] + r * this.c[3] + i * this.c[5] + n * this.c[7];
|
|
2749
|
+
return { x: s, y: o };
|
|
2750
2750
|
}
|
|
2751
2751
|
eval(t) {
|
|
2752
|
-
const r = 1 - t, i = r * r * r, n = 3 * r * r * t, s = 3 * r * t * t,
|
|
2753
|
-
return this.weightsum(i, n, s,
|
|
2752
|
+
const r = 1 - t, i = r * r * r, n = 3 * r * r * t, s = 3 * r * t * t, o = t * t * t;
|
|
2753
|
+
return this.weightsum(i, n, s, o);
|
|
2754
2754
|
}
|
|
2755
2755
|
deriv(t) {
|
|
2756
|
-
const r = 1 - t, i = -3 * r * r, n = 3 * t * t, s = -6 * t * r - i,
|
|
2757
|
-
return this.weightsum(i, s,
|
|
2756
|
+
const r = 1 - t, i = -3 * r * r, n = 3 * t * t, s = -6 * t * r - i, o = 6 * t * r - n;
|
|
2757
|
+
return this.weightsum(i, s, o, n);
|
|
2758
2758
|
}
|
|
2759
2759
|
// quadratic bezier with matching endpoints and minimum max vector error
|
|
2760
2760
|
midpoint_quadbez() {
|
|
@@ -2764,23 +2764,23 @@ class Dt {
|
|
|
2764
2764
|
subsegment(t, r) {
|
|
2765
2765
|
const i = new Float64Array(8), n = this.eval(t), s = this.eval(r);
|
|
2766
2766
|
i[0] = n.x, i[1] = n.y;
|
|
2767
|
-
const
|
|
2768
|
-
i[2] = n.x +
|
|
2767
|
+
const o = (r - t) / 3, a = this.deriv(t);
|
|
2768
|
+
i[2] = n.x + o * a.x, i[3] = n.y + o * a.y;
|
|
2769
2769
|
const u = this.deriv(r);
|
|
2770
|
-
return i[4] = s.x -
|
|
2770
|
+
return i[4] = s.x - o * u.x, i[5] = s.y - o * u.y, i[6] = s.x, i[7] = s.y, new Dt(i);
|
|
2771
2771
|
}
|
|
2772
2772
|
// Very fancy subdivision scheme
|
|
2773
2773
|
subdivide(t) {
|
|
2774
|
-
const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s =
|
|
2774
|
+
const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s = Qo(this.weightsum(1, -3, 3, -1)), o = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), a = [];
|
|
2775
2775
|
let u = 0;
|
|
2776
|
-
for (let h = 0; h <
|
|
2777
|
-
const g = h /
|
|
2776
|
+
for (let h = 0; h < o; h++) {
|
|
2777
|
+
const g = h / o, b = (h + 1) / o, A = this.subsegment(g, b).midpoint_quadbez(), w = A.mapToBasic(), C = _e(w.x0), T = _e(w.x2), j = Math.sqrt(w.scale);
|
|
2778
2778
|
let I = Math.abs(T - C) * j;
|
|
2779
2779
|
if (Math.sign(w.x0) != Math.sign(w.x2)) {
|
|
2780
2780
|
const L = n / j, P = n * Math.abs(T - C) / _e(L);
|
|
2781
2781
|
I = Math.max(I, P);
|
|
2782
2782
|
}
|
|
2783
|
-
|
|
2783
|
+
a.push({
|
|
2784
2784
|
quad: A,
|
|
2785
2785
|
a0: C,
|
|
2786
2786
|
a2: T,
|
|
@@ -2791,15 +2791,15 @@ class Dt {
|
|
|
2791
2791
|
let v = 0, m = 0;
|
|
2792
2792
|
for (let h = 1; h < l; h++) {
|
|
2793
2793
|
const g = u * h / l;
|
|
2794
|
-
for (; v +
|
|
2795
|
-
v +=
|
|
2796
|
-
const b =
|
|
2797
|
-
p.push(
|
|
2794
|
+
for (; v + a[m].val < g; )
|
|
2795
|
+
v += a[m].val, m++;
|
|
2796
|
+
const b = a[m].a0, A = a[m].a2, w = Pe(b), C = Pe(A), T = b + (A - b) * (g - v) / a[m].val, j = (Pe(T) - w) / (C - w);
|
|
2797
|
+
p.push(a[m].quad.eval(j));
|
|
2798
2798
|
}
|
|
2799
2799
|
return p.push({ x: this.c[6], y: this.c[7] }), p;
|
|
2800
2800
|
}
|
|
2801
2801
|
}
|
|
2802
|
-
const
|
|
2802
|
+
const Yo = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, Go = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, ar = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
|
|
2803
2803
|
function Je(e, {
|
|
2804
2804
|
domParser: t,
|
|
2805
2805
|
svgPreprocessor: r,
|
|
@@ -2810,11 +2810,11 @@ function Je(e, {
|
|
|
2810
2810
|
e.reduce(
|
|
2811
2811
|
(n, s) => {
|
|
2812
2812
|
const {
|
|
2813
|
-
selector:
|
|
2814
|
-
selectors:
|
|
2813
|
+
selector: o,
|
|
2814
|
+
selectors: a,
|
|
2815
2815
|
iiifRenderingHints: u
|
|
2816
2816
|
} = Je(s, { domParser: t, svgPreprocessor: r, iiifRenderingHints: i });
|
|
2817
|
-
return
|
|
2817
|
+
return o && (n.selector || (n.selector = o), n.selectors.push(...a)), u && (n.iiifRenderingHints = n.iiifRenderingHints || { type: "ImageApiSelector" }, Object.assign(n.iiifRenderingHints, u)), n;
|
|
2818
2818
|
},
|
|
2819
2819
|
{
|
|
2820
2820
|
selector: null,
|
|
@@ -2853,7 +2853,7 @@ function Je(e, {
|
|
|
2853
2853
|
iiifRenderingHints: i
|
|
2854
2854
|
});
|
|
2855
2855
|
}
|
|
2856
|
-
if (
|
|
2856
|
+
if (Xo(e)) {
|
|
2857
2857
|
const n = [];
|
|
2858
2858
|
if (e.region) {
|
|
2859
2859
|
const s = Je(
|
|
@@ -2869,9 +2869,9 @@ function Je(e, {
|
|
|
2869
2869
|
});
|
|
2870
2870
|
}
|
|
2871
2871
|
if (e.type === "FragmentSelector") {
|
|
2872
|
-
const n =
|
|
2872
|
+
const n = Yo.exec(e.value);
|
|
2873
2873
|
if (n) {
|
|
2874
|
-
const
|
|
2874
|
+
const o = {
|
|
2875
2875
|
type: "BoxSelector",
|
|
2876
2876
|
spatial: {
|
|
2877
2877
|
unit: n[2] === "percent:" || n[2] === "pct:" ? "percent" : "pixel",
|
|
@@ -2882,14 +2882,14 @@ function Je(e, {
|
|
|
2882
2882
|
}
|
|
2883
2883
|
};
|
|
2884
2884
|
return re({
|
|
2885
|
-
selector:
|
|
2886
|
-
selectors: [
|
|
2885
|
+
selector: o,
|
|
2886
|
+
selectors: [o],
|
|
2887
2887
|
iiifRenderingHints: i
|
|
2888
2888
|
});
|
|
2889
2889
|
}
|
|
2890
|
-
const s = e.value.match(
|
|
2890
|
+
const s = e.value.match(Go);
|
|
2891
2891
|
if (s) {
|
|
2892
|
-
const
|
|
2892
|
+
const o = {
|
|
2893
2893
|
type: "TemporalSelector",
|
|
2894
2894
|
temporal: {
|
|
2895
2895
|
startTime: s[4] ? parseFloat(s[4]) : 0,
|
|
@@ -2897,8 +2897,8 @@ function Je(e, {
|
|
|
2897
2897
|
}
|
|
2898
2898
|
};
|
|
2899
2899
|
return re({
|
|
2900
|
-
selector:
|
|
2901
|
-
selectors: [
|
|
2900
|
+
selector: o,
|
|
2901
|
+
selectors: [o],
|
|
2902
2902
|
iiifRenderingHints: i
|
|
2903
2903
|
});
|
|
2904
2904
|
}
|
|
@@ -2912,7 +2912,7 @@ function Je(e, {
|
|
|
2912
2912
|
t || (typeof window < "u" ? t = new window.DOMParser() : console.warn(
|
|
2913
2913
|
"No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."
|
|
2914
2914
|
));
|
|
2915
|
-
let n = [], s,
|
|
2915
|
+
let n = [], s, o, a = (r == null ? void 0 : r(e.value)) ?? e.value, u;
|
|
2916
2916
|
if (t) {
|
|
2917
2917
|
const l = t.parseFromString(e.value, "image/svg+xml").querySelector("svg");
|
|
2918
2918
|
if (!l)
|
|
@@ -2931,13 +2931,13 @@ function Je(e, {
|
|
|
2931
2931
|
// urx
|
|
2932
2932
|
Math.max(...n.map((v) => v[1]))
|
|
2933
2933
|
// ury
|
|
2934
|
-
], { style:
|
|
2934
|
+
], { style: o, svg: a } = Zo(p.element) ?? { svg: a });
|
|
2935
2935
|
}
|
|
2936
2936
|
const d = {
|
|
2937
2937
|
type: "SvgSelector",
|
|
2938
|
-
svg:
|
|
2938
|
+
svg: a,
|
|
2939
2939
|
svgShape: u,
|
|
2940
|
-
style:
|
|
2940
|
+
style: o,
|
|
2941
2941
|
points: n.length ? n : void 0,
|
|
2942
2942
|
spatial: s ? { unit: "pixel", x: s[0], y: s[1], width: s[2] - s[0], height: s[3] - s[1] } : void 0
|
|
2943
2943
|
};
|
|
@@ -2953,7 +2953,7 @@ function Je(e, {
|
|
|
2953
2953
|
iiifRenderingHints: i
|
|
2954
2954
|
});
|
|
2955
2955
|
}
|
|
2956
|
-
function
|
|
2956
|
+
function Jo(e) {
|
|
2957
2957
|
const t = e.map((i) => i[0]).reduce(
|
|
2958
2958
|
(i, n) => (i[n] += 1, i),
|
|
2959
2959
|
{ C: 0, Q: 0, L: 0, M: 0 }
|
|
@@ -2983,40 +2983,40 @@ function li(e) {
|
|
|
2983
2983
|
const i = r.getAttribute("d");
|
|
2984
2984
|
if (!i)
|
|
2985
2985
|
continue;
|
|
2986
|
-
const n =
|
|
2987
|
-
return { element: r, points:
|
|
2986
|
+
const n = Bo(i);
|
|
2987
|
+
return { element: r, points: Ko(n), shapeType: Jo(n) };
|
|
2988
2988
|
}
|
|
2989
2989
|
case "circle": {
|
|
2990
2990
|
const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("r") ?? "0");
|
|
2991
2991
|
if (!s)
|
|
2992
2992
|
continue;
|
|
2993
|
-
const
|
|
2994
|
-
for (let
|
|
2995
|
-
const u =
|
|
2996
|
-
|
|
2993
|
+
const o = [];
|
|
2994
|
+
for (let a = 0; a <= 360; a += 12) {
|
|
2995
|
+
const u = a * Math.PI / 180;
|
|
2996
|
+
o.push([i + s * Math.cos(u), n + s * Math.sin(u)]);
|
|
2997
2997
|
}
|
|
2998
|
-
return { element: r, points:
|
|
2998
|
+
return { element: r, points: o, shapeType: "circle" };
|
|
2999
2999
|
}
|
|
3000
3000
|
case "ellipse": {
|
|
3001
|
-
const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("rx") ?? "0"),
|
|
3002
|
-
if (!s && !
|
|
3001
|
+
const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("rx") ?? "0"), o = parseFloat(r.getAttribute("ry") ?? "0");
|
|
3002
|
+
if (!s && !o)
|
|
3003
3003
|
continue;
|
|
3004
|
-
const
|
|
3004
|
+
const a = [];
|
|
3005
3005
|
for (let u = 0; u <= 360; u += 12) {
|
|
3006
|
-
const d = Math.tan(u / 360 * Math.PI), l = s * (1 - d ** 2) / (1 + d ** 2), p =
|
|
3007
|
-
|
|
3006
|
+
const d = Math.tan(u / 360 * Math.PI), l = s * (1 - d ** 2) / (1 + d ** 2), p = o * 2 * d / (1 + d ** 2);
|
|
3007
|
+
a.push([i + l, n + p]);
|
|
3008
3008
|
}
|
|
3009
|
-
return { element: r, points:
|
|
3009
|
+
return { element: r, points: a, shapeType: "ellipse" };
|
|
3010
3010
|
}
|
|
3011
3011
|
case "line": {
|
|
3012
|
-
const i = parseFloat(r.getAttribute("x0") ?? "0"), n = parseFloat(r.getAttribute("y0") ?? "0"), s = parseFloat(r.getAttribute("x1") ?? "0"),
|
|
3013
|
-
if (i === s && n ===
|
|
3012
|
+
const i = parseFloat(r.getAttribute("x0") ?? "0"), n = parseFloat(r.getAttribute("y0") ?? "0"), s = parseFloat(r.getAttribute("x1") ?? "0"), o = parseFloat(r.getAttribute("y1") ?? "0");
|
|
3013
|
+
if (i === s && n === o)
|
|
3014
3014
|
continue;
|
|
3015
3015
|
return {
|
|
3016
3016
|
element: r,
|
|
3017
3017
|
points: [
|
|
3018
3018
|
[i, n],
|
|
3019
|
-
[s,
|
|
3019
|
+
[s, o]
|
|
3020
3020
|
],
|
|
3021
3021
|
shapeType: "polyline"
|
|
3022
3022
|
};
|
|
@@ -3030,16 +3030,16 @@ function li(e) {
|
|
|
3030
3030
|
return r.tagName.toLowerCase() === "polygon" && (i.push(i[0]), n = "polygon"), { element: r, points: i, shapeType: n };
|
|
3031
3031
|
}
|
|
3032
3032
|
case "rect": {
|
|
3033
|
-
const i = parseFloat(r.getAttribute("x") ?? "0"), n = parseFloat(r.getAttribute("y") ?? "0"), s = parseFloat(r.getAttribute("width") ?? "0"),
|
|
3034
|
-
if (!s || !
|
|
3033
|
+
const i = parseFloat(r.getAttribute("x") ?? "0"), n = parseFloat(r.getAttribute("y") ?? "0"), s = parseFloat(r.getAttribute("width") ?? "0"), o = parseFloat(r.getAttribute("height") ?? "0");
|
|
3034
|
+
if (!s || !o)
|
|
3035
3035
|
continue;
|
|
3036
3036
|
return {
|
|
3037
3037
|
element: r,
|
|
3038
3038
|
points: [
|
|
3039
3039
|
[i, n],
|
|
3040
3040
|
[i + s, n],
|
|
3041
|
-
[i + s, n +
|
|
3042
|
-
[i, n +
|
|
3041
|
+
[i + s, n + o],
|
|
3042
|
+
[i, n + o],
|
|
3043
3043
|
[i, n]
|
|
3044
3044
|
],
|
|
3045
3045
|
shapeType: "rect"
|
|
@@ -3050,7 +3050,7 @@ function li(e) {
|
|
|
3050
3050
|
}
|
|
3051
3051
|
return null;
|
|
3052
3052
|
}
|
|
3053
|
-
function
|
|
3053
|
+
function Ko(e) {
|
|
3054
3054
|
const t = [];
|
|
3055
3055
|
for (let r = 0; r < e.length; r++) {
|
|
3056
3056
|
const i = t[t.length - 1] ?? [0, 0], n = e[r];
|
|
@@ -3061,7 +3061,7 @@ function Ga(e) {
|
|
|
3061
3061
|
continue;
|
|
3062
3062
|
case "C":
|
|
3063
3063
|
t.push(
|
|
3064
|
-
...
|
|
3064
|
+
...Wo(
|
|
3065
3065
|
{ x: i[0], y: i[1] },
|
|
3066
3066
|
{ x: n[1], y: n[2] },
|
|
3067
3067
|
{ x: n[3], y: n[4] },
|
|
@@ -3072,7 +3072,7 @@ function Ga(e) {
|
|
|
3072
3072
|
continue;
|
|
3073
3073
|
case "Q":
|
|
3074
3074
|
t.push(
|
|
3075
|
-
...
|
|
3075
|
+
...zo(
|
|
3076
3076
|
{ x: i[0], y: i[1] },
|
|
3077
3077
|
{ x: n[1], y: n[2] },
|
|
3078
3078
|
{ x: n[3], y: n[4] }
|
|
@@ -3084,14 +3084,14 @@ function Ga(e) {
|
|
|
3084
3084
|
}
|
|
3085
3085
|
return t;
|
|
3086
3086
|
}
|
|
3087
|
-
function
|
|
3087
|
+
function Zo(e) {
|
|
3088
3088
|
const t = {};
|
|
3089
3089
|
if (e.hasAttribute("fill") ? (t.fill = e.getAttribute("fill"), e.removeAttribute("fill")) : e.style.fill && (t.fill = e.style.fill), t.fill) {
|
|
3090
|
-
const i =
|
|
3090
|
+
const i = ar.exec(t.fill);
|
|
3091
3091
|
i && (t.fillOpacity = parseFloat(i[4]), t.fill = `rgb(${i[1]}, ${i[2]}, ${i[3]})`);
|
|
3092
3092
|
}
|
|
3093
3093
|
if (e.hasAttribute("fill-opacity") ? (t.fillOpacity = parseFloat(e.getAttribute("fill-opacity")), e.removeAttribute("fill-opacity")) : e.style.fillOpacity && (t.fillOpacity = parseFloat(e.style.fillOpacity)), e.hasAttribute("stroke") ? (t.stroke = e.getAttribute("stroke"), e.removeAttribute("stroke")) : e.style.stroke && (t.stroke = e.style.stroke), t.stroke) {
|
|
3094
|
-
const i =
|
|
3094
|
+
const i = ar.exec(t.stroke);
|
|
3095
3095
|
i && (t.strokeOpacity = parseFloat(i[4]), t.stroke = `rgb(${i[1]}, ${i[2]}, ${i[3]})`);
|
|
3096
3096
|
}
|
|
3097
3097
|
e.hasAttribute("stroke-opacity") ? (t.strokeOpacity = parseFloat(e.getAttribute("stroke-opacity")), e.removeAttribute("stroke-opacity")) : e.style.strokeOpacity && (t.strokeOpacity = parseFloat(e.style.strokeOpacity)), e.hasAttribute("stroke-width") ? (t.strokeWidth = e.getAttribute("stroke-width"), e.removeAttribute("stroke-width")) : e.style.strokeWidth && (t.strokeWidth = e.style.strokeWidth), e.hasAttribute("stroke-dasharray") ? (t.strokeDasharray = e.getAttribute("stroke-dasharray"), e.removeAttribute("stroke-dasharray")) : e.style.strokeDasharray && (t.strokeDasharray = e.style.strokeDasharray);
|
|
@@ -3101,14 +3101,14 @@ function Ja(e) {
|
|
|
3101
3101
|
throw new Error("Could not find root SVG element");
|
|
3102
3102
|
return { svg: r.outerHTML, style: Object.keys(t).length > 0 ? t : void 0 };
|
|
3103
3103
|
}
|
|
3104
|
-
function
|
|
3104
|
+
function Xo(e) {
|
|
3105
3105
|
return !!e && e.type === "iiif:ImageApiSelector" && e.type === "iiif:ImageApiSelector";
|
|
3106
3106
|
}
|
|
3107
3107
|
function re(e) {
|
|
3108
3108
|
if (e.iiifRenderingHints) {
|
|
3109
3109
|
const t = e.iiifRenderingHints;
|
|
3110
3110
|
if (t.rotation) {
|
|
3111
|
-
const r =
|
|
3111
|
+
const r = ea(t.rotation);
|
|
3112
3112
|
if (r)
|
|
3113
3113
|
if (e.selectors.length)
|
|
3114
3114
|
for (const i of e.selectors)
|
|
@@ -3123,7 +3123,7 @@ function re(e) {
|
|
|
3123
3123
|
delete e.iiifRenderingHints;
|
|
3124
3124
|
return e;
|
|
3125
3125
|
}
|
|
3126
|
-
function
|
|
3126
|
+
function ea(e) {
|
|
3127
3127
|
let t = parseFloat(e);
|
|
3128
3128
|
return t && e.startsWith("!") && (t = 360 - t), t && (t = t % 360), t !== t ? 0 : t || 0;
|
|
3129
3129
|
}
|
|
@@ -3198,8 +3198,8 @@ function je(e, t = {}) {
|
|
|
3198
3198
|
selectors: []
|
|
3199
3199
|
};
|
|
3200
3200
|
}
|
|
3201
|
-
var
|
|
3202
|
-
function
|
|
3201
|
+
var ta = Object.defineProperty, ra = (e, t, r) => t in e ? ta(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, cr = (e, t, r) => (ra(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
3202
|
+
function ia(e) {
|
|
3203
3203
|
return Array.isArray(e) ? e : e ? [e] : [];
|
|
3204
3204
|
}
|
|
3205
3205
|
const ur = [
|
|
@@ -3215,7 +3215,7 @@ const ur = [
|
|
|
3215
3215
|
"Service",
|
|
3216
3216
|
"ContentResource"
|
|
3217
3217
|
];
|
|
3218
|
-
function
|
|
3218
|
+
function na(e) {
|
|
3219
3219
|
if (typeof e > "u" || e === null)
|
|
3220
3220
|
throw new Error("Null or undefined is not a valid entity.");
|
|
3221
3221
|
if (Array.isArray(e))
|
|
@@ -3384,7 +3384,7 @@ class qt {
|
|
|
3384
3384
|
traverseUnknown(t) {
|
|
3385
3385
|
if (!t["@type"] || typeof t == "string")
|
|
3386
3386
|
return t;
|
|
3387
|
-
switch (
|
|
3387
|
+
switch (na(t)) {
|
|
3388
3388
|
case "sc:Collection":
|
|
3389
3389
|
return this.traverseCollection(t);
|
|
3390
3390
|
case "sc:Manifest":
|
|
@@ -3457,7 +3457,7 @@ class qt {
|
|
|
3457
3457
|
}, t);
|
|
3458
3458
|
}
|
|
3459
3459
|
}
|
|
3460
|
-
const
|
|
3460
|
+
const sa = "http://library.stanford.edu/iiif/image-api/compliance.html#level0", fi = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", pi = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", oa = "http://library.stanford.edu/iiif/image-api/conformance.html#level0", di = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", hi = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", aa = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", yi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", vi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", ca = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", gi = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", mi = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", ua = "http://iiif.io/api/image/1/level0.json", la = "http://iiif.io/api/image/1/profiles/level0.json", bi = "http://iiif.io/api/image/1/level1.json", Ai = "http://iiif.io/api/image/1/profiles/level1.json", xi = "http://iiif.io/api/image/1/level2.json", wi = "http://iiif.io/api/image/1/profiles/level2.json", fa = "http://iiif.io/api/image/2/level0.json", pa = "http://iiif.io/api/image/2/profiles/level0.json", Si = "http://iiif.io/api/image/2/level1.json", Ci = "http://iiif.io/api/image/2/profiles/level1.json", Mi = "http://iiif.io/api/image/2/level2.json", Ri = "http://iiif.io/api/image/2/profiles/level2.json", da = "level0", Ii = "level1", Ti = "level2", ha = "http://iiif.io/api/image/2/level0", ki = "http://iiif.io/api/image/2/level1", Oi = "http://iiif.io/api/image/2/level2", ya = [
|
|
3461
3461
|
ki,
|
|
3462
3462
|
Oi,
|
|
3463
3463
|
fi,
|
|
@@ -3478,35 +3478,35 @@ const io = "http://library.stanford.edu/iiif/image-api/compliance.html#level0",
|
|
|
3478
3478
|
Ri,
|
|
3479
3479
|
Ii,
|
|
3480
3480
|
Ti
|
|
3481
|
-
],
|
|
3482
|
-
|
|
3481
|
+
], va = [
|
|
3482
|
+
ha,
|
|
3483
3483
|
ki,
|
|
3484
3484
|
Oi,
|
|
3485
|
-
|
|
3485
|
+
sa,
|
|
3486
3486
|
fi,
|
|
3487
3487
|
pi,
|
|
3488
|
-
|
|
3488
|
+
oa,
|
|
3489
3489
|
di,
|
|
3490
3490
|
hi,
|
|
3491
|
-
|
|
3491
|
+
aa,
|
|
3492
3492
|
yi,
|
|
3493
3493
|
vi,
|
|
3494
|
-
|
|
3494
|
+
ca,
|
|
3495
3495
|
gi,
|
|
3496
3496
|
mi,
|
|
3497
|
-
|
|
3498
|
-
|
|
3497
|
+
ua,
|
|
3498
|
+
la,
|
|
3499
3499
|
bi,
|
|
3500
3500
|
Ai,
|
|
3501
3501
|
xi,
|
|
3502
3502
|
wi,
|
|
3503
|
-
|
|
3504
|
-
|
|
3503
|
+
fa,
|
|
3504
|
+
pa,
|
|
3505
3505
|
Si,
|
|
3506
3506
|
Ci,
|
|
3507
3507
|
Mi,
|
|
3508
3508
|
Ri,
|
|
3509
|
-
|
|
3509
|
+
da,
|
|
3510
3510
|
Ii,
|
|
3511
3511
|
Ti
|
|
3512
3512
|
];
|
|
@@ -3542,14 +3542,14 @@ function Ie(e, t = "none") {
|
|
|
3542
3542
|
function Ei(e) {
|
|
3543
3543
|
if (Array.isArray(e))
|
|
3544
3544
|
return Ei(e.find((t) => typeof t == "string"));
|
|
3545
|
-
if (
|
|
3545
|
+
if (va.indexOf(e) !== -1)
|
|
3546
3546
|
return "level2";
|
|
3547
|
-
if (
|
|
3547
|
+
if (ya.indexOf(e) !== -1)
|
|
3548
3548
|
return "level1";
|
|
3549
3549
|
if (typeof e == "string")
|
|
3550
3550
|
return e;
|
|
3551
3551
|
}
|
|
3552
|
-
function
|
|
3552
|
+
function ga(e) {
|
|
3553
3553
|
const t = Array.isArray(e) ? e : [e];
|
|
3554
3554
|
for (const r of t)
|
|
3555
3555
|
switch (r) {
|
|
@@ -3563,7 +3563,7 @@ function vo(e) {
|
|
|
3563
3563
|
return "ImageApiSelector";
|
|
3564
3564
|
}
|
|
3565
3565
|
}
|
|
3566
|
-
function
|
|
3566
|
+
function ma(e) {
|
|
3567
3567
|
switch (e) {
|
|
3568
3568
|
case "http://iiif.io/api/image/2/level0.json":
|
|
3569
3569
|
case "http://iiif.io/api/image/2/level1.json":
|
|
@@ -3598,18 +3598,18 @@ function lr(e) {
|
|
|
3598
3598
|
return e.slice(t.length + 1);
|
|
3599
3599
|
return e;
|
|
3600
3600
|
}
|
|
3601
|
-
const
|
|
3601
|
+
const ba = ["Collection", "Manifest", "Annotation", "AnnotationPage", "Range", "Service"];
|
|
3602
3602
|
function _t(e) {
|
|
3603
3603
|
const t = e["@id"] || e.id;
|
|
3604
3604
|
let r = e["@type"] || e.type;
|
|
3605
3605
|
const i = e.profile || void 0, n = e["@context"] || void 0;
|
|
3606
3606
|
if (i) {
|
|
3607
|
-
const s =
|
|
3607
|
+
const s = ma(i);
|
|
3608
3608
|
if (s)
|
|
3609
3609
|
return s;
|
|
3610
3610
|
}
|
|
3611
3611
|
if (n) {
|
|
3612
|
-
const s =
|
|
3612
|
+
const s = ga(n);
|
|
3613
3613
|
if (s)
|
|
3614
3614
|
return s;
|
|
3615
3615
|
}
|
|
@@ -3635,7 +3635,7 @@ function _t(e) {
|
|
|
3635
3635
|
return "TextualBody";
|
|
3636
3636
|
}
|
|
3637
3637
|
}
|
|
3638
|
-
if (r &&
|
|
3638
|
+
if (r && ba.indexOf(r) !== -1)
|
|
3639
3639
|
return r;
|
|
3640
3640
|
if (e.format) {
|
|
3641
3641
|
if (e.format.startsWith("image/"))
|
|
@@ -3647,28 +3647,28 @@ function _t(e) {
|
|
|
3647
3647
|
}
|
|
3648
3648
|
return t && (t.endsWith(".jpg") || t.endsWith(".png") || t.endsWith(".jpeg")) ? "Image" : r || "unknown";
|
|
3649
3649
|
}
|
|
3650
|
-
const
|
|
3651
|
-
function
|
|
3652
|
-
const t = e.match(
|
|
3650
|
+
const Aa = /http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;
|
|
3651
|
+
function xa(e) {
|
|
3652
|
+
const t = e.match(Aa);
|
|
3653
3653
|
return t ? t[0] : e;
|
|
3654
3654
|
}
|
|
3655
|
-
function
|
|
3655
|
+
function wa(e, t = "Rights/License", r = "none") {
|
|
3656
3656
|
let i = null;
|
|
3657
3657
|
const n = [], s = Array.isArray(e) ? e : [e];
|
|
3658
|
-
for (const
|
|
3659
|
-
const
|
|
3660
|
-
if (
|
|
3661
|
-
|
|
3658
|
+
for (const o of s) {
|
|
3659
|
+
const a = o ? xa(o) : void 0;
|
|
3660
|
+
if (a && (a.indexOf("creativecommons.org") !== -1 || a.indexOf("rightsstatements.org") !== -1)) {
|
|
3661
|
+
a.startsWith("https://") ? i = `http://${a.slice(8)}` : i = a;
|
|
3662
3662
|
continue;
|
|
3663
3663
|
}
|
|
3664
|
-
|
|
3664
|
+
a && n.push({
|
|
3665
3665
|
label: { [r]: [t] },
|
|
3666
|
-
value: { [r]: [
|
|
3666
|
+
value: { [r]: [a] }
|
|
3667
3667
|
});
|
|
3668
3668
|
}
|
|
3669
3669
|
return [i, n];
|
|
3670
3670
|
}
|
|
3671
|
-
const
|
|
3671
|
+
const Sa = [
|
|
3672
3672
|
"http://iiif.io/api/presentation/2/context.json",
|
|
3673
3673
|
"http://iiif.io/api/image/2/context.json",
|
|
3674
3674
|
"http://iiif.io/api/image/1/context.json",
|
|
@@ -3679,16 +3679,16 @@ const wo = [
|
|
|
3679
3679
|
"http://iiif.io/api/auth/0/context.json",
|
|
3680
3680
|
"http://iiif.io/api/annex/openannotation/context.json"
|
|
3681
3681
|
];
|
|
3682
|
-
function
|
|
3682
|
+
function Ca(e) {
|
|
3683
3683
|
if (e) {
|
|
3684
3684
|
const t = Array.isArray(e) ? e : [e], r = [];
|
|
3685
3685
|
for (const i of t)
|
|
3686
|
-
i === "http://iiif.io/api/presentation/2/context.json" && r.push("http://iiif.io/api/presentation/3/context.json"),
|
|
3686
|
+
i === "http://iiif.io/api/presentation/2/context.json" && r.push("http://iiif.io/api/presentation/3/context.json"), Sa.indexOf(i) === -1 && r.push(i);
|
|
3687
3687
|
if (t.length)
|
|
3688
3688
|
return r.length === 1 ? r[0] : r;
|
|
3689
3689
|
}
|
|
3690
3690
|
}
|
|
3691
|
-
function
|
|
3691
|
+
function Ma(e) {
|
|
3692
3692
|
return e ? e.map((t) => ({
|
|
3693
3693
|
label: Ie(t.label),
|
|
3694
3694
|
value: Ie(t.value)
|
|
@@ -3704,7 +3704,7 @@ function fe(e) {
|
|
|
3704
3704
|
e.viewingHint && t.push(e.viewingHint);
|
|
3705
3705
|
let r;
|
|
3706
3706
|
return Array.isArray(e.motivation) ? r = e.motivation.map(lr) : e.motivation && (r = lr(e.motivation)), {
|
|
3707
|
-
"@context": e["@context"] ?
|
|
3707
|
+
"@context": e["@context"] ? Ca(e["@context"]) : void 0,
|
|
3708
3708
|
id: (e["@id"] || Pi(e)).trim(),
|
|
3709
3709
|
type: _t(e),
|
|
3710
3710
|
behavior: t.length ? t : void 0,
|
|
@@ -3719,7 +3719,7 @@ function fe(e) {
|
|
|
3719
3719
|
};
|
|
3720
3720
|
}
|
|
3721
3721
|
function pe(e) {
|
|
3722
|
-
const [t, r] =
|
|
3722
|
+
const [t, r] = wa(e.license), i = [...e.metadata ? Ma(e.metadata) : [], ...r];
|
|
3723
3723
|
return {
|
|
3724
3724
|
rights: t,
|
|
3725
3725
|
metadata: i.length ? i : void 0,
|
|
@@ -3730,13 +3730,13 @@ function pe(e) {
|
|
|
3730
3730
|
} : void 0,
|
|
3731
3731
|
navDate: e.navDate,
|
|
3732
3732
|
summary: e.description ? Ie(e.description) : void 0,
|
|
3733
|
-
thumbnail:
|
|
3733
|
+
thumbnail: Ra(e.thumbnail)
|
|
3734
3734
|
};
|
|
3735
3735
|
}
|
|
3736
|
-
function
|
|
3736
|
+
function Ra(e) {
|
|
3737
3737
|
return e && (Array.isArray(e) ? e : [e]).map((t) => typeof t == "string" ? { id: t, type: "Image" } : (t.type === "unknown" && (t.type = "Image"), t));
|
|
3738
3738
|
}
|
|
3739
|
-
function
|
|
3739
|
+
function Ia(e) {
|
|
3740
3740
|
if (!e.within)
|
|
3741
3741
|
return;
|
|
3742
3742
|
const t = Array.isArray(e.within) ? e.within : [e.within], r = [];
|
|
@@ -3767,22 +3767,22 @@ function Ae(e) {
|
|
|
3767
3767
|
label: Ie(Tt.providerName)
|
|
3768
3768
|
}
|
|
3769
3769
|
] : void 0,
|
|
3770
|
-
partOf:
|
|
3770
|
+
partOf: Ia(e),
|
|
3771
3771
|
rendering: e.rendering,
|
|
3772
3772
|
seeAlso: e.seeAlso,
|
|
3773
3773
|
start: e.startCanvas,
|
|
3774
|
-
service: e.service ?
|
|
3774
|
+
service: e.service ? ia(e.service) : void 0,
|
|
3775
3775
|
supplementary: r ? [r] : void 0
|
|
3776
3776
|
};
|
|
3777
3777
|
}
|
|
3778
|
-
function
|
|
3778
|
+
function Ta(e) {
|
|
3779
3779
|
return {
|
|
3780
3780
|
chars: e.chars,
|
|
3781
3781
|
format: e.format ? e.format : void 0,
|
|
3782
3782
|
language: e.language
|
|
3783
3783
|
};
|
|
3784
3784
|
}
|
|
3785
|
-
function
|
|
3785
|
+
function ka(e) {
|
|
3786
3786
|
return le({
|
|
3787
3787
|
...fe(e),
|
|
3788
3788
|
...pe(e),
|
|
@@ -3790,7 +3790,7 @@ function To(e) {
|
|
|
3790
3790
|
items: e.members
|
|
3791
3791
|
});
|
|
3792
3792
|
}
|
|
3793
|
-
function
|
|
3793
|
+
function Oa(e) {
|
|
3794
3794
|
const t = [], r = [];
|
|
3795
3795
|
let i;
|
|
3796
3796
|
for (const s of e.sequences || [])
|
|
@@ -3805,7 +3805,7 @@ function ko(e) {
|
|
|
3805
3805
|
structures: e.structures
|
|
3806
3806
|
});
|
|
3807
3807
|
}
|
|
3808
|
-
function
|
|
3808
|
+
function Ea(e) {
|
|
3809
3809
|
return le({
|
|
3810
3810
|
...fe(e),
|
|
3811
3811
|
...pe(e),
|
|
@@ -3820,7 +3820,7 @@ function Oo(e) {
|
|
|
3820
3820
|
] : void 0
|
|
3821
3821
|
});
|
|
3822
3822
|
}
|
|
3823
|
-
function
|
|
3823
|
+
function Pa(e) {
|
|
3824
3824
|
return le({
|
|
3825
3825
|
...fe(e),
|
|
3826
3826
|
...pe(e),
|
|
@@ -3828,7 +3828,7 @@ function Eo(e) {
|
|
|
3828
3828
|
items: e.resources && e.resources.length ? e.resources : void 0
|
|
3829
3829
|
});
|
|
3830
3830
|
}
|
|
3831
|
-
function
|
|
3831
|
+
function La(e) {
|
|
3832
3832
|
return !e.canvases || e.canvases.length === 0 ? {
|
|
3833
3833
|
canvases: [],
|
|
3834
3834
|
behavior: []
|
|
@@ -3838,7 +3838,7 @@ function Po(e) {
|
|
|
3838
3838
|
startCanvas: e.startCanvas
|
|
3839
3839
|
};
|
|
3840
3840
|
}
|
|
3841
|
-
function
|
|
3841
|
+
function Fa(e) {
|
|
3842
3842
|
function t(r) {
|
|
3843
3843
|
if (Array.isArray(r)) {
|
|
3844
3844
|
if (r.length > 1)
|
|
@@ -3879,10 +3879,10 @@ function kt(e) {
|
|
|
3879
3879
|
...fe(t),
|
|
3880
3880
|
...pe(t),
|
|
3881
3881
|
...Ae(t),
|
|
3882
|
-
...
|
|
3882
|
+
...Ta(t)
|
|
3883
3883
|
});
|
|
3884
3884
|
}
|
|
3885
|
-
function
|
|
3885
|
+
function ja(e) {
|
|
3886
3886
|
const t = [];
|
|
3887
3887
|
return e.default && e.default !== "rdf:nil" && t.push(e.default), e.item && e.item !== "rdf:nil" && t.push(...e.item), {
|
|
3888
3888
|
...fe(e),
|
|
@@ -3890,7 +3890,7 @@ function Fo(e) {
|
|
|
3890
3890
|
items: t
|
|
3891
3891
|
};
|
|
3892
3892
|
}
|
|
3893
|
-
function
|
|
3893
|
+
function $a(e) {
|
|
3894
3894
|
return le({
|
|
3895
3895
|
...fe(e),
|
|
3896
3896
|
...pe(e),
|
|
@@ -3898,14 +3898,14 @@ function jo(e) {
|
|
|
3898
3898
|
items: e.members
|
|
3899
3899
|
});
|
|
3900
3900
|
}
|
|
3901
|
-
function
|
|
3902
|
-
const { "@id": t, "@type": r, "@context": i, profile: n, ...s } = e,
|
|
3903
|
-
return t && (
|
|
3904
|
-
...
|
|
3901
|
+
function Da(e) {
|
|
3902
|
+
const { "@id": t, "@type": r, "@context": i, profile: n, ...s } = e, o = {};
|
|
3903
|
+
return t && (o["@id"] = t), o["@type"] = _t(e), o["@type"] === "unknown" && (i && i.length && (o["@context"] = i), o["@type"] = "Service"), n && (o.profile = Ei(n)), le({
|
|
3904
|
+
...o,
|
|
3905
3905
|
...s
|
|
3906
3906
|
});
|
|
3907
3907
|
}
|
|
3908
|
-
function
|
|
3908
|
+
function qa(e) {
|
|
3909
3909
|
return le({
|
|
3910
3910
|
...fe(e),
|
|
3911
3911
|
...pe(e),
|
|
@@ -3913,17 +3913,17 @@ function Do(e) {
|
|
|
3913
3913
|
});
|
|
3914
3914
|
}
|
|
3915
3915
|
new qt({
|
|
3916
|
-
collection: [
|
|
3917
|
-
manifest: [
|
|
3918
|
-
canvas: [
|
|
3919
|
-
annotationList: [
|
|
3920
|
-
sequence: [
|
|
3921
|
-
annotation: [
|
|
3916
|
+
collection: [ka],
|
|
3917
|
+
manifest: [Oa],
|
|
3918
|
+
canvas: [Ea],
|
|
3919
|
+
annotationList: [Pa],
|
|
3920
|
+
sequence: [La],
|
|
3921
|
+
annotation: [Fa],
|
|
3922
3922
|
contentResource: [kt],
|
|
3923
|
-
choice: [
|
|
3924
|
-
range: [
|
|
3925
|
-
service: [
|
|
3926
|
-
layer: [
|
|
3923
|
+
choice: [ja],
|
|
3924
|
+
range: [$a],
|
|
3925
|
+
service: [Da],
|
|
3926
|
+
layer: [qa]
|
|
3927
3927
|
});
|
|
3928
3928
|
function Ot(e) {
|
|
3929
3929
|
if ((Array.isArray(e["@type"]) && e["@type"].includes("oa:SvgSelector") || e["@type"] == "oa:SvgSelector") && ("chars" in e || "value" in e))
|
|
@@ -3953,11 +3953,11 @@ function Ot(e) {
|
|
|
3953
3953
|
}
|
|
3954
3954
|
var pr = { exports: {} };
|
|
3955
3955
|
(function(e, t) {
|
|
3956
|
-
var r = Object.defineProperty, i = (s,
|
|
3957
|
-
(function(s,
|
|
3958
|
-
|
|
3959
|
-
})(
|
|
3960
|
-
const
|
|
3956
|
+
var r = Object.defineProperty, i = (s, o, a) => o in s ? r(s, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : s[o] = a, n = (s, o, a) => (i(s, typeof o != "symbol" ? o + "" : o, a), a);
|
|
3957
|
+
(function(s, o) {
|
|
3958
|
+
o(t);
|
|
3959
|
+
})(Fo, function(s) {
|
|
3960
|
+
const o = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", a = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", u = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", d = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", l = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", p = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", v = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", m = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", h = "http://iiif.io/api/image/1/level1.json", g = "http://iiif.io/api/image/1/profiles/level1.json", b = "http://iiif.io/api/image/1/level2.json", A = "http://iiif.io/api/image/1/profiles/level2.json", w = "http://iiif.io/api/image/2/level1.json", C = "http://iiif.io/api/image/2/profiles/level1.json", T = "http://iiif.io/api/image/2/level2.json", j = "http://iiif.io/api/image/2/profiles/level2.json", I = "level1", L = "level2", P = "http://iiif.io/api/image/2/level1", M = "http://iiif.io/api/image/2/level2", $ = [P, M, o, a, u, d, l, p, v, m, h, g, b, A, w, C, T, j, I, L], ie = ["http://iiif.io/api/image/2/level0", P, M, "http://library.stanford.edu/iiif/image-api/compliance.html#level0", o, a, "http://library.stanford.edu/iiif/image-api/conformance.html#level0", u, d, "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", l, p, "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", v, m, "http://iiif.io/api/image/1/level0.json", "http://iiif.io/api/image/1/profiles/level0.json", h, g, b, A, "http://iiif.io/api/image/2/level0.json", "http://iiif.io/api/image/2/profiles/level0.json", w, C, T, j, "level0", I, L], Z = ["sc:Collection", "sc:Manifest", "sc:Canvas", "sc:AnnotationList", "oa:Annotation", "sc:Range", "sc:Layer", "sc:Sequence", "oa:Choice", "Service", "ContentResource"];
|
|
3961
3961
|
class U {
|
|
3962
3962
|
constructor(c, y = {}) {
|
|
3963
3963
|
n(this, "traversals"), n(this, "options"), this.traversals = { collection: [], manifest: [], canvas: [], annotationList: [], sequence: [], annotation: [], contentResource: [], choice: [], range: [], service: [], layer: [], ...c }, this.options = { convertPropsToArray: !0, mergeMemberProperties: !0, allowUndefinedReturn: !1, ...y };
|
|
@@ -4256,16 +4256,16 @@ var pr = { exports: {} };
|
|
|
4256
4256
|
const y = encodeURI(f.id || f["@id"] || "").trim();
|
|
4257
4257
|
return y && c ? `${y}/${c}` : y || (Bt++, `http://example.org/${f["@type"]}${c ? `/${c}` : ""}/${Bt}`);
|
|
4258
4258
|
}
|
|
4259
|
-
function
|
|
4259
|
+
function oe(f) {
|
|
4260
4260
|
const c = [...f.behavior || []];
|
|
4261
4261
|
let y;
|
|
4262
4262
|
return f.viewingHint && c.push(f.viewingHint), Array.isArray(f.motivation) ? y = f.motivation.map(X) : f.motivation && (y = X(f.motivation)), { "@context": f["@context"] ? en(f["@context"]) : void 0, id: (f["@id"] || zt(f)).trim(), type: nt(f), behavior: c.length ? c : void 0, height: f.height ? f.height : void 0, width: f.width ? f.width : void 0, motivation: y, viewingDirection: f.viewingDirection, profile: f.profile, format: f.format ? f.format : void 0, duration: void 0, timeMode: void 0 };
|
|
4263
4263
|
}
|
|
4264
|
-
function
|
|
4264
|
+
function ae(f) {
|
|
4265
4265
|
const [c, y] = function(k, Y = "Rights/License", Ue = "none") {
|
|
4266
4266
|
let Ve = null;
|
|
4267
|
-
const Wt = [],
|
|
4268
|
-
for (const Qt of
|
|
4267
|
+
const Wt = [], on = Array.isArray(k) ? k : [k];
|
|
4268
|
+
for (const Qt of on) {
|
|
4269
4269
|
const ye = Qt ? Zi(Qt) : void 0;
|
|
4270
4270
|
!ye || ye.indexOf("creativecommons.org") === -1 && ye.indexOf("rightsstatements.org") === -1 ? ye && Wt.push({ label: { [Ue]: [Y] }, value: { [Ue]: [ye] } }) : Ve = ye.startsWith("https://") ? `http://${ye.slice(8)}` : ye;
|
|
4271
4271
|
}
|
|
@@ -4292,26 +4292,26 @@ var pr = { exports: {} };
|
|
|
4292
4292
|
}
|
|
4293
4293
|
function st(f) {
|
|
4294
4294
|
const c = f;
|
|
4295
|
-
return z({ ...
|
|
4295
|
+
return z({ ...oe(c), ...ae(c), ...he(c), ...(y = c, { chars: y.chars, format: y.format ? y.format : void 0, language: y.language }) });
|
|
4296
4296
|
var y;
|
|
4297
4297
|
}
|
|
4298
4298
|
const nn = new U({ collection: [function(f) {
|
|
4299
|
-
return z({ ...
|
|
4299
|
+
return z({ ...oe(f), ...ae(f), ...he(f), items: f.members });
|
|
4300
4300
|
}], manifest: [function(f) {
|
|
4301
4301
|
const c = [], y = [];
|
|
4302
4302
|
let S;
|
|
4303
4303
|
for (const k of f.sequences || [])
|
|
4304
4304
|
k.canvases.length && c.push(...k.canvases), k.behavior && y.push(...k.behavior), k.startCanvas && (S = k.startCanvas);
|
|
4305
|
-
const F =
|
|
4306
|
-
return y.length && (F.behavior ? F.behavior.push(...y) : F.behavior = y), z({ ...F, ...
|
|
4305
|
+
const F = oe(f);
|
|
4306
|
+
return y.length && (F.behavior ? F.behavior.push(...y) : F.behavior = y), z({ ...F, ...ae(f), ...he(f), start: S, items: c, structures: f.structures });
|
|
4307
4307
|
}], canvas: [function(f) {
|
|
4308
|
-
return z({ ...
|
|
4308
|
+
return z({ ...oe(f), ...ae(f), ...he(f), annotations: f.otherContent && f.otherContent.length ? f.otherContent : void 0, items: f.images && f.images.length ? [{ id: zt(f, "annotation-page"), type: "AnnotationPage", items: f.images }] : void 0 });
|
|
4309
4309
|
}], annotationList: [function(f) {
|
|
4310
|
-
return z({ ...
|
|
4310
|
+
return z({ ...oe(f), ...ae(f), ...he(f), items: f.resources && f.resources.length ? f.resources : void 0 });
|
|
4311
4311
|
}], sequence: [function(f) {
|
|
4312
4312
|
return f.canvases && f.canvases.length !== 0 ? { canvases: f.canvases, behavior: f.viewingHint ? [f.viewingHint] : [], startCanvas: f.startCanvas } : { canvases: [], behavior: [] };
|
|
4313
4313
|
}], annotation: [function(f) {
|
|
4314
|
-
return z({ ...
|
|
4314
|
+
return z({ ...oe(f), ...ae(f), ...he(f), target: function c(y) {
|
|
4315
4315
|
if (Array.isArray(y)) {
|
|
4316
4316
|
if (y.length > 1)
|
|
4317
4317
|
return { type: "List", items: y.map(c) };
|
|
@@ -4330,28 +4330,28 @@ var pr = { exports: {} };
|
|
|
4330
4330
|
throw new Error(`Unsupported source type on annotation: ${y.full["@type"]}`);
|
|
4331
4331
|
S = { id: y.full["@id"], type: "Canvas" };
|
|
4332
4332
|
}
|
|
4333
|
-
return { type: "SpecificResource", source: S, selector:
|
|
4333
|
+
return { type: "SpecificResource", source: S, selector: ot(y.selector) };
|
|
4334
4334
|
}
|
|
4335
4335
|
return encodeURI(y["@id"]).trim();
|
|
4336
4336
|
}(f.on), body: Array.isArray(f.resource) ? f.resource.map(st) : st(f.resource) });
|
|
4337
4337
|
}], contentResource: [st], choice: [function(f) {
|
|
4338
4338
|
const c = [];
|
|
4339
|
-
return f.default && f.default !== "rdf:nil" && c.push(f.default), f.item && f.item !== "rdf:nil" && c.push(...f.item), { ...
|
|
4339
|
+
return f.default && f.default !== "rdf:nil" && c.push(f.default), f.item && f.item !== "rdf:nil" && c.push(...f.item), { ...oe(f), ...ae(f), items: c };
|
|
4340
4340
|
}], range: [function(f) {
|
|
4341
|
-
return z({ ...
|
|
4341
|
+
return z({ ...oe(f), ...ae(f), ...he(f), items: f.members });
|
|
4342
4342
|
}], service: [function(f) {
|
|
4343
4343
|
const { "@id": c, "@type": y, "@context": S, profile: F, ...k } = f, Y = {};
|
|
4344
4344
|
return c && (Y["@id"] = c), Y["@type"] = nt(f), Y["@type"] === "unknown" && (S && S.length && (Y["@context"] = S), Y["@type"] = "Service"), F && (Y.profile = W(F)), z({ ...Y, ...k });
|
|
4345
4345
|
}], layer: [function(f) {
|
|
4346
|
-
return z({ ...
|
|
4346
|
+
return z({ ...oe(f), ...ae(f), ...he(f) });
|
|
4347
4347
|
}] });
|
|
4348
|
-
function
|
|
4348
|
+
function ot(f) {
|
|
4349
4349
|
if ((Array.isArray(f["@type"]) && f["@type"].includes("oa:SvgSelector") || f["@type"] == "oa:SvgSelector") && ("chars" in f || "value" in f))
|
|
4350
4350
|
return { type: "SvgSelector", value: "chars" in f ? f.chars : f.value };
|
|
4351
4351
|
if (f["@type"] === "oa:FragmentSelector")
|
|
4352
4352
|
return { type: "FragmentSelector", value: f.value };
|
|
4353
4353
|
if (f["@type"] === "oa:Choice")
|
|
4354
|
-
return [
|
|
4354
|
+
return [ot(f.default), ...(Array.isArray(f.item) ? f.item : [f.item]).map(ot)];
|
|
4355
4355
|
if (f["@type"] == "iiif:ImageApiSelector")
|
|
4356
4356
|
return { type: "ImageApiSelector", region: "region" in f ? f.region : void 0, rotation: "rotation" in f ? f.rotation : void 0 };
|
|
4357
4357
|
throw new Error(`Unsupported selector type: ${f["@type"]}`);
|
|
@@ -4362,7 +4362,7 @@ var pr = { exports: {} };
|
|
|
4362
4362
|
s.upgrade = sn, Object.defineProperties(s, { __esModule: { value: !0 }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4363
4363
|
});
|
|
4364
4364
|
})(pr, pr.exports);
|
|
4365
|
-
function
|
|
4365
|
+
function Oc(e) {
|
|
4366
4366
|
return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
|
|
4367
4367
|
}
|
|
4368
4368
|
function Li(e, t) {
|
|
@@ -4387,16 +4387,16 @@ function Li(e, t) {
|
|
|
4387
4387
|
i
|
|
4388
4388
|
];
|
|
4389
4389
|
}
|
|
4390
|
-
const
|
|
4390
|
+
const _a = {
|
|
4391
4391
|
makeChoice: () => {
|
|
4392
4392
|
}
|
|
4393
|
-
}, gt = { type: "unknown" }, _ = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }),
|
|
4394
|
-
function
|
|
4393
|
+
}, gt = { type: "unknown" }, _ = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }), Ua = (e, t) => ({ type: "empty", width: e, height: t, annotations: { pages: [] }, image: null, images: [] });
|
|
4394
|
+
function Va(e, t) {
|
|
4395
4395
|
var i;
|
|
4396
4396
|
const r = (i = e == null ? void 0 : e.iiif) == null ? void 0 : i.meta[t];
|
|
4397
4397
|
return r ? r.annotationPageManager : null;
|
|
4398
4398
|
}
|
|
4399
|
-
function
|
|
4399
|
+
function Na(e, t) {
|
|
4400
4400
|
return Q(
|
|
4401
4401
|
(r) => {
|
|
4402
4402
|
const i = [];
|
|
@@ -4405,15 +4405,15 @@ function Vo(e, t) {
|
|
|
4405
4405
|
const n = Object.keys(r.iiif.entities.AnnotationPage);
|
|
4406
4406
|
for (const s of n)
|
|
4407
4407
|
if (!t || t.indexOf(s) !== -1) {
|
|
4408
|
-
const
|
|
4409
|
-
|
|
4408
|
+
const o = Va(r, s);
|
|
4409
|
+
o && o.views && o.views[e] && i.push(s);
|
|
4410
4410
|
}
|
|
4411
4411
|
return i;
|
|
4412
4412
|
},
|
|
4413
4413
|
[e, t]
|
|
4414
4414
|
);
|
|
4415
4415
|
}
|
|
4416
|
-
function
|
|
4416
|
+
function Ha({
|
|
4417
4417
|
canvas: e,
|
|
4418
4418
|
manifest: t,
|
|
4419
4419
|
all: r,
|
|
@@ -4426,25 +4426,25 @@ function No({
|
|
|
4426
4426
|
if (r) {
|
|
4427
4427
|
if (i && i.length)
|
|
4428
4428
|
for (const s of i)
|
|
4429
|
-
for (const
|
|
4430
|
-
n.indexOf(
|
|
4429
|
+
for (const o of s.annotations)
|
|
4430
|
+
n.indexOf(o.id) === -1 && n.push(o.id);
|
|
4431
4431
|
} else if (e)
|
|
4432
4432
|
for (const s of e.annotations)
|
|
4433
4433
|
n.indexOf(s.id) === -1 && n.push(s.id);
|
|
4434
4434
|
return n;
|
|
4435
4435
|
}
|
|
4436
|
-
function
|
|
4436
|
+
function Ba(e, t) {
|
|
4437
4437
|
var i;
|
|
4438
4438
|
const r = (i = e == null ? void 0 : e.iiif) == null ? void 0 : i.meta[t];
|
|
4439
4439
|
return r ? r.annotationPageManager : null;
|
|
4440
4440
|
}
|
|
4441
|
-
function
|
|
4442
|
-
const r = V(), i = ke(), n = ue(), s = Br(),
|
|
4441
|
+
function za(e, t = {}) {
|
|
4442
|
+
const r = V(), i = ke(), n = ue(), s = Br(), o = E(() => Ha({
|
|
4443
4443
|
all: t.all,
|
|
4444
4444
|
manifest: i,
|
|
4445
4445
|
canvas: n,
|
|
4446
4446
|
canvases: s
|
|
4447
|
-
}), [t.all, n, s, i]),
|
|
4447
|
+
}), [t.all, n, s, i]), a = Na(e, t.all ? void 0 : o), u = D(
|
|
4448
4448
|
(l) => {
|
|
4449
4449
|
e && r.setMetaValue(
|
|
4450
4450
|
[l, "annotationPageManager", "views"],
|
|
@@ -4463,7 +4463,7 @@ function Bo(e, t = {}) {
|
|
|
4463
4463
|
if (p != null && p.deselectOthers) {
|
|
4464
4464
|
const h = Object.keys(v.iiif.entities.AnnotationPage);
|
|
4465
4465
|
for (const g of h) {
|
|
4466
|
-
const b =
|
|
4466
|
+
const b = Ba(v, g);
|
|
4467
4467
|
b && b.views && b.views[e] && m.push(g);
|
|
4468
4468
|
}
|
|
4469
4469
|
}
|
|
@@ -4480,30 +4480,30 @@ function Bo(e, t = {}) {
|
|
|
4480
4480
|
[e, u, r]
|
|
4481
4481
|
);
|
|
4482
4482
|
return {
|
|
4483
|
-
availablePageIds:
|
|
4484
|
-
enabledPageIds:
|
|
4483
|
+
availablePageIds: o,
|
|
4484
|
+
enabledPageIds: a,
|
|
4485
4485
|
setPageEnabled: d,
|
|
4486
4486
|
setPageDisabled: u
|
|
4487
4487
|
};
|
|
4488
4488
|
}
|
|
4489
|
-
function
|
|
4489
|
+
function Wa(e, t) {
|
|
4490
4490
|
return Q((r, i) => i.get(e.map((n) => ({ id: n, type: t }))), [e, t]);
|
|
4491
4491
|
}
|
|
4492
|
-
const
|
|
4492
|
+
const Qa = me.createContext(new gr());
|
|
4493
4493
|
function Ut() {
|
|
4494
|
-
return H(
|
|
4494
|
+
return H(Qa);
|
|
4495
4495
|
}
|
|
4496
|
-
function
|
|
4496
|
+
function Ya() {
|
|
4497
4497
|
const e = Ut(), [t, r] = B({}), i = ge(!1);
|
|
4498
4498
|
return K(() => () => {
|
|
4499
4499
|
i.current = !0;
|
|
4500
4500
|
}, []), [D(
|
|
4501
|
-
(s, { height:
|
|
4501
|
+
(s, { height: o, width: a }) => {
|
|
4502
4502
|
if (s) {
|
|
4503
4503
|
const u = s.id || s["@id"], d = e.loadServiceSync({
|
|
4504
4504
|
id: u,
|
|
4505
|
-
width: s.width ||
|
|
4506
|
-
height: s.height ||
|
|
4505
|
+
width: s.width || a,
|
|
4506
|
+
height: s.height || o,
|
|
4507
4507
|
source: s
|
|
4508
4508
|
});
|
|
4509
4509
|
d ? s = d : t[u] || (i.current || r((l) => ({
|
|
@@ -4511,8 +4511,8 @@ function Qo() {
|
|
|
4511
4511
|
[u]: "loading"
|
|
4512
4512
|
})), e.loadService({
|
|
4513
4513
|
id: u,
|
|
4514
|
-
width: s.width ||
|
|
4515
|
-
height: s.height ||
|
|
4514
|
+
width: s.width || a,
|
|
4515
|
+
height: s.height || o
|
|
4516
4516
|
}).then(() => {
|
|
4517
4517
|
i.current || r((l) => ({
|
|
4518
4518
|
...l,
|
|
@@ -4533,15 +4533,15 @@ function Vt(e = {}) {
|
|
|
4533
4533
|
return [];
|
|
4534
4534
|
if (t && e.enableSingleAnnotation)
|
|
4535
4535
|
return [t];
|
|
4536
|
-
const s = n.get(r.items),
|
|
4537
|
-
for (const
|
|
4538
|
-
|
|
4539
|
-
return
|
|
4536
|
+
const s = n.get(r.items), o = [];
|
|
4537
|
+
for (const a of s)
|
|
4538
|
+
o.push(...n.get(a.items));
|
|
4539
|
+
return o;
|
|
4540
4540
|
},
|
|
4541
4541
|
[r]
|
|
4542
4542
|
);
|
|
4543
4543
|
}
|
|
4544
|
-
function
|
|
4544
|
+
function Ga(e) {
|
|
4545
4545
|
return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
|
|
4546
4546
|
}
|
|
4547
4547
|
const ze = {}, Fi = {
|
|
@@ -4549,12 +4549,12 @@ const ze = {}, Fi = {
|
|
|
4549
4549
|
return e;
|
|
4550
4550
|
},
|
|
4551
4551
|
setMetaValue([e, t, r], i) {
|
|
4552
|
-
const n = Fi.getResourceMeta(e, t), s = n ? n[r] : void 0,
|
|
4552
|
+
const n = Fi.getResourceMeta(e, t), s = n ? n[r] : void 0, o = typeof i == "function" ? i(s) : i;
|
|
4553
4553
|
ze[e] = {
|
|
4554
4554
|
...ze[e] || {},
|
|
4555
4555
|
[t]: {
|
|
4556
4556
|
...(ze[e] || {})[t] || {},
|
|
4557
|
-
[r]:
|
|
4557
|
+
[r]: o
|
|
4558
4558
|
}
|
|
4559
4559
|
};
|
|
4560
4560
|
},
|
|
@@ -4564,26 +4564,26 @@ const ze = {}, Fi = {
|
|
|
4564
4564
|
return t ? r[t] : r;
|
|
4565
4565
|
}
|
|
4566
4566
|
};
|
|
4567
|
-
function
|
|
4567
|
+
function Ja(e = Fi) {
|
|
4568
4568
|
function t(n) {
|
|
4569
4569
|
const s = n ? typeof n == "string" ? e.get(n) : n : null;
|
|
4570
4570
|
if (!s)
|
|
4571
4571
|
return [];
|
|
4572
|
-
const
|
|
4573
|
-
for (const u of
|
|
4574
|
-
|
|
4575
|
-
return
|
|
4572
|
+
const o = e.get(s.items, { parent: s }), a = [];
|
|
4573
|
+
for (const u of o)
|
|
4574
|
+
a.push(...e.get(u.items, { parent: u }));
|
|
4575
|
+
return a;
|
|
4576
4576
|
}
|
|
4577
4577
|
function r(n, s = []) {
|
|
4578
|
-
const
|
|
4578
|
+
const o = Array.isArray(n) ? n : t(n), a = [];
|
|
4579
4579
|
let u = null;
|
|
4580
4580
|
const d = [];
|
|
4581
|
-
for (const l of
|
|
4581
|
+
for (const l of o) {
|
|
4582
4582
|
if (l.type !== "Annotation")
|
|
4583
4583
|
throw new Error("getPaintables() accept either a canvas or list of annotations");
|
|
4584
4584
|
const p = Array.from(Array.isArray(l.body) ? l.body : [l.body]);
|
|
4585
4585
|
for (const v of p) {
|
|
4586
|
-
const [m, { selector: h }] =
|
|
4586
|
+
const [m, { selector: h }] = Ga(v), g = e.get(m), b = (g.type || "unknown").toLowerCase();
|
|
4587
4587
|
if (b === "choice") {
|
|
4588
4588
|
const A = e.get(g.items, { parent: g.id }), w = s.length ? s.map((C) => A.find((T) => T.id === C)).filter(Boolean) : [A[0]];
|
|
4589
4589
|
w.length === 0 && w.push(A[0]), u = {
|
|
@@ -4597,7 +4597,7 @@ function Go(e = Fi) {
|
|
|
4597
4597
|
}, p.push(...w);
|
|
4598
4598
|
continue;
|
|
4599
4599
|
}
|
|
4600
|
-
|
|
4600
|
+
a.indexOf(b) === -1 && a.push(b), d.push({
|
|
4601
4601
|
type: b,
|
|
4602
4602
|
annotationId: l.id,
|
|
4603
4603
|
resource: g,
|
|
@@ -4607,7 +4607,7 @@ function Go(e = Fi) {
|
|
|
4607
4607
|
}
|
|
4608
4608
|
}
|
|
4609
4609
|
return {
|
|
4610
|
-
types:
|
|
4610
|
+
types: a,
|
|
4611
4611
|
items: d,
|
|
4612
4612
|
choice: u
|
|
4613
4613
|
};
|
|
@@ -4622,20 +4622,20 @@ function Go(e = Fi) {
|
|
|
4622
4622
|
extractChoices: i
|
|
4623
4623
|
};
|
|
4624
4624
|
}
|
|
4625
|
-
function
|
|
4626
|
-
const r = V(), i = E(() =>
|
|
4625
|
+
function Ka(e, t = []) {
|
|
4626
|
+
const r = V(), i = E(() => Ja(r), []), n = Vt({ enableSingleAnnotation: e == null ? void 0 : e.enableSingleAnnotation }), [s, o] = B((e == null ? void 0 : e.defaultChoices) || []), a = E(
|
|
4627
4627
|
() => i.getPaintables(n, s),
|
|
4628
4628
|
[r, n, s, ...t]
|
|
4629
4629
|
), d = { makeChoice: D(
|
|
4630
4630
|
(l, { deselectOthers: p = !0, deselect: v = !1 } = {}) => {
|
|
4631
|
-
if (
|
|
4632
|
-
if (
|
|
4631
|
+
if (a.choice) {
|
|
4632
|
+
if (a.choice.type !== "single-choice")
|
|
4633
4633
|
throw new Error("Complex choice not supported yet");
|
|
4634
|
-
|
|
4634
|
+
o((m) => {
|
|
4635
4635
|
if (v) {
|
|
4636
4636
|
const g = m.filter((b) => b !== l);
|
|
4637
4637
|
if (g.length === 0) {
|
|
4638
|
-
const b =
|
|
4638
|
+
const b = a.items[0].resource.id;
|
|
4639
4639
|
return b ? [b] : [];
|
|
4640
4640
|
}
|
|
4641
4641
|
return g;
|
|
@@ -4643,30 +4643,30 @@ function Jo(e, t = []) {
|
|
|
4643
4643
|
if (p)
|
|
4644
4644
|
return [l];
|
|
4645
4645
|
const h = [...m];
|
|
4646
|
-
if (h.length === 0 &&
|
|
4647
|
-
const g =
|
|
4646
|
+
if (h.length === 0 && a.items.length) {
|
|
4647
|
+
const g = a.items[0].resource.id;
|
|
4648
4648
|
g && h.push(g);
|
|
4649
4649
|
}
|
|
4650
4650
|
return m.indexOf(l) !== -1 ? m : [...m, l];
|
|
4651
4651
|
});
|
|
4652
4652
|
}
|
|
4653
4653
|
},
|
|
4654
|
-
[
|
|
4654
|
+
[a.choice]
|
|
4655
4655
|
) };
|
|
4656
|
-
return [
|
|
4656
|
+
return [a, d];
|
|
4657
4657
|
}
|
|
4658
|
-
function
|
|
4658
|
+
function Za(e, t, r) {
|
|
4659
4659
|
const i = [];
|
|
4660
4660
|
for (const n of t.items) {
|
|
4661
4661
|
const s = n.resource && n.resource.type === "SpecificResource" ? n.resource.source : n.resource;
|
|
4662
4662
|
if (!s.id)
|
|
4663
4663
|
return _("No resource Identifier");
|
|
4664
|
-
let
|
|
4664
|
+
let o;
|
|
4665
4665
|
if (s.service) {
|
|
4666
4666
|
const m = mt(s);
|
|
4667
|
-
m[0] && (
|
|
4667
|
+
m[0] && (o = r(m[0], e));
|
|
4668
4668
|
}
|
|
4669
|
-
const
|
|
4669
|
+
const a = {
|
|
4670
4670
|
type: "BoxSelector",
|
|
4671
4671
|
spatial: {
|
|
4672
4672
|
x: 0,
|
|
@@ -4696,16 +4696,16 @@ function Ko(e, t, r) {
|
|
|
4696
4696
|
height: l.selector.spatial.height
|
|
4697
4697
|
}
|
|
4698
4698
|
} : void 0;
|
|
4699
|
-
|
|
4699
|
+
o && !o.id && (o.id = o["@id"]);
|
|
4700
4700
|
const v = {
|
|
4701
4701
|
id: s.id,
|
|
4702
4702
|
type: "Image",
|
|
4703
4703
|
annotationId: n.annotationId,
|
|
4704
4704
|
width: Number(u || p ? s.width : e.width),
|
|
4705
4705
|
height: Number(u || p ? s.height : e.height),
|
|
4706
|
-
service:
|
|
4707
|
-
sizes:
|
|
4708
|
-
target: u && u.type !== "PointSelector" ? u :
|
|
4706
|
+
service: o,
|
|
4707
|
+
sizes: o && o.sizes ? o.sizes : s.width && s.height ? [{ width: s.width, height: s.height }] : [],
|
|
4708
|
+
target: u && u.type !== "PointSelector" ? u : a,
|
|
4709
4709
|
selector: p
|
|
4710
4710
|
};
|
|
4711
4711
|
i.push(v);
|
|
@@ -4717,15 +4717,15 @@ function Ko(e, t, r) {
|
|
|
4717
4717
|
choice: t.choice
|
|
4718
4718
|
};
|
|
4719
4719
|
}
|
|
4720
|
-
const
|
|
4721
|
-
function
|
|
4720
|
+
const Xa = ["model/gltf-binary"];
|
|
4721
|
+
function ec(e, t) {
|
|
4722
4722
|
const i = t.items[0].resource;
|
|
4723
|
-
return i.format ?
|
|
4723
|
+
return i.format ? Xa.indexOf(i.format) === -1 ? _(`3D format: ${i.format} is unsupported`) : {
|
|
4724
4724
|
type: "3d-model",
|
|
4725
4725
|
model: i
|
|
4726
4726
|
} : _("Unknown format");
|
|
4727
4727
|
}
|
|
4728
|
-
function
|
|
4728
|
+
function tc(e, t) {
|
|
4729
4729
|
var i;
|
|
4730
4730
|
if (!e.duration)
|
|
4731
4731
|
return _("No duration on canvas");
|
|
@@ -4760,16 +4760,16 @@ function ec(e, t) {
|
|
|
4760
4760
|
}
|
|
4761
4761
|
} : _("Audio does not have format") : _("Unknown audio");
|
|
4762
4762
|
}
|
|
4763
|
-
const
|
|
4764
|
-
function
|
|
4765
|
-
var
|
|
4766
|
-
const r = t.items.filter((
|
|
4763
|
+
const rc = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
|
|
4764
|
+
function ic(e, t) {
|
|
4765
|
+
var o;
|
|
4766
|
+
const r = t.items.filter((a) => a.type === "video");
|
|
4767
4767
|
if (!e.duration)
|
|
4768
4768
|
return _("No duration on canvas");
|
|
4769
4769
|
if (r.length > 1)
|
|
4770
4770
|
return _("Only one video source supported");
|
|
4771
|
-
const i = (
|
|
4772
|
-
(
|
|
4771
|
+
const i = (o = r[0]) == null ? void 0 : o.resource, n = !!(i.service || []).find(
|
|
4772
|
+
(a) => (a.profile || "").includes("youtube.com")
|
|
4773
4773
|
);
|
|
4774
4774
|
if (!i)
|
|
4775
4775
|
return _("Unknown video");
|
|
@@ -4799,10 +4799,10 @@ function rc(e, t) {
|
|
|
4799
4799
|
};
|
|
4800
4800
|
if (n) {
|
|
4801
4801
|
s.type = "VideoYouTube";
|
|
4802
|
-
const
|
|
4803
|
-
if (!
|
|
4802
|
+
const a = i.id.match(rc);
|
|
4803
|
+
if (!a[1])
|
|
4804
4804
|
return _("Video is not known youtube video");
|
|
4805
|
-
s.youTubeId =
|
|
4805
|
+
s.youTubeId = a[1];
|
|
4806
4806
|
}
|
|
4807
4807
|
return {
|
|
4808
4808
|
type: "media",
|
|
@@ -4826,7 +4826,7 @@ function ji(e, t = {}, r) {
|
|
|
4826
4826
|
}
|
|
4827
4827
|
return t;
|
|
4828
4828
|
}
|
|
4829
|
-
function
|
|
4829
|
+
function nc(e, t) {
|
|
4830
4830
|
const r = [];
|
|
4831
4831
|
return t.items.forEach((i) => {
|
|
4832
4832
|
if (i.resource) {
|
|
@@ -4838,37 +4838,37 @@ function ic(e, t) {
|
|
|
4838
4838
|
items: r
|
|
4839
4839
|
};
|
|
4840
4840
|
}
|
|
4841
|
-
function
|
|
4842
|
-
const t = ke(), r = ue(), i = V(), [n, s] =
|
|
4841
|
+
function sc(e) {
|
|
4842
|
+
const t = ke(), r = ue(), i = V(), [n, s] = Ya(), { enabledPageIds: o } = za((e == null ? void 0 : e.annotationPageManagerId) || (t == null ? void 0 : t.id) || (r == null ? void 0 : r.id), {
|
|
4843
4843
|
all: !1
|
|
4844
|
-
}),
|
|
4844
|
+
}), a = Wa(o, "AnnotationPage"), u = (e == null ? void 0 : e.strategies) || [
|
|
4845
4845
|
"empty",
|
|
4846
4846
|
"images",
|
|
4847
4847
|
"media",
|
|
4848
4848
|
"textual-content",
|
|
4849
4849
|
"complex-timeline"
|
|
4850
|
-
], [d, l] =
|
|
4850
|
+
], [d, l] = Ka(e, [s]), p = E(() => {
|
|
4851
4851
|
if (!r)
|
|
4852
4852
|
return console.log("No canvas"), gt;
|
|
4853
4853
|
if (d.types.length === 0)
|
|
4854
|
-
return u.indexOf("empty") !== -1 ?
|
|
4854
|
+
return u.indexOf("empty") !== -1 ? Ua(r.width, r.height) : (console.log("No paintables"), gt);
|
|
4855
4855
|
if (d.types.length !== 1)
|
|
4856
4856
|
if (d.types.length === 2 && d.types.indexOf("text") !== -1)
|
|
4857
4857
|
d.types = d.types.filter((m) => m !== "text");
|
|
4858
4858
|
else
|
|
4859
4859
|
return u.indexOf("complex-timeline") === -1 ? _("Complex timeline not supported") : _("ComplexTimelineStrategy not yet supported");
|
|
4860
4860
|
const v = d.types[0];
|
|
4861
|
-
return v === "image" ? u.indexOf("images") === -1 ? _("Image not supported") :
|
|
4861
|
+
return v === "image" ? u.indexOf("images") === -1 ? _("Image not supported") : Za(r, d, n) : v === "Model" || v === "model" ? u.indexOf("3d-model") === -1 ? _("3D not supported") : ec(r, d) : v === "textualbody" ? u.indexOf("textual-content") === -1 ? _("Textual content not supported") : nc(r, d) : v === "sound" || v === "audio" ? u.indexOf("media") === -1 ? _("Media not supported") : tc(r, d) : v === "video" ? u.indexOf("media") === -1 ? _("Media not supported") : ic(r, d) : (console.log("No idea"), gt);
|
|
4862
4862
|
}, [r, d, i, l.makeChoice]);
|
|
4863
|
-
return E(() => p.type === "unknown" ? [p,
|
|
4863
|
+
return E(() => p.type === "unknown" ? [p, _a] : [
|
|
4864
4864
|
{
|
|
4865
4865
|
...p,
|
|
4866
|
-
annotations: { pages:
|
|
4866
|
+
annotations: { pages: a }
|
|
4867
4867
|
},
|
|
4868
4868
|
l
|
|
4869
|
-
], [p,
|
|
4869
|
+
], [p, a]);
|
|
4870
4870
|
}
|
|
4871
|
-
const
|
|
4871
|
+
const oc = (e, t = []) => {
|
|
4872
4872
|
const r = V();
|
|
4873
4873
|
K(() => {
|
|
4874
4874
|
e(r);
|
|
@@ -4878,12 +4878,12 @@ const sc = (e, t = []) => {
|
|
|
4878
4878
|
return e;
|
|
4879
4879
|
},
|
|
4880
4880
|
setMetaValue([e, t, r], i) {
|
|
4881
|
-
const n = $i.getResourceMeta(e, t), s = n ? n[r] : void 0,
|
|
4881
|
+
const n = $i.getResourceMeta(e, t), s = n ? n[r] : void 0, o = typeof i == "function" ? i(s) : i;
|
|
4882
4882
|
We[e] = {
|
|
4883
4883
|
...We[e] || {},
|
|
4884
4884
|
[t]: {
|
|
4885
4885
|
...(We[e] || {})[t] || {},
|
|
4886
|
-
[r]:
|
|
4886
|
+
[r]: o
|
|
4887
4887
|
}
|
|
4888
4888
|
};
|
|
4889
4889
|
},
|
|
@@ -4893,15 +4893,15 @@ const sc = (e, t = []) => {
|
|
|
4893
4893
|
return t ? r[t] : r;
|
|
4894
4894
|
}
|
|
4895
4895
|
}, ac = new gr();
|
|
4896
|
-
function
|
|
4896
|
+
function cc(e = $i, t = {}) {
|
|
4897
4897
|
const r = t.imageServiceLoader || ac;
|
|
4898
|
-
async function i(n, s,
|
|
4899
|
-
const d = () => r.getThumbnailFromResource(void 0, s,
|
|
4898
|
+
async function i(n, s, o = !1, a = [], u) {
|
|
4899
|
+
const d = () => r.getThumbnailFromResource(void 0, s, o, a);
|
|
4900
4900
|
if (!n)
|
|
4901
|
-
return await r.getThumbnailFromResource(void 0, s,
|
|
4901
|
+
return await r.getThumbnailFromResource(void 0, s, o, a);
|
|
4902
4902
|
if (typeof n == "string") {
|
|
4903
4903
|
const p = Yt(n);
|
|
4904
|
-
return p &&
|
|
4904
|
+
return p && a.push(p), await r.getThumbnailFromResource(void 0, s, o, a);
|
|
4905
4905
|
}
|
|
4906
4906
|
const l = e.get(n, { skipSelfReturn: !1 });
|
|
4907
4907
|
if (typeof l == "string")
|
|
@@ -4910,34 +4910,34 @@ function oc(e = $i, t = {}) {
|
|
|
4910
4910
|
return await d();
|
|
4911
4911
|
switch (await (async (p) => {
|
|
4912
4912
|
if (p && p.thumbnail && p.thumbnail.length) {
|
|
4913
|
-
const v = e.get(p.thumbnail[0]), m = await r.getImageCandidates(v,
|
|
4914
|
-
m && m.length &&
|
|
4913
|
+
const v = e.get(p.thumbnail[0]), m = await r.getImageCandidates(v, o);
|
|
4914
|
+
m && m.length && a.push(...m);
|
|
4915
4915
|
}
|
|
4916
4916
|
})(l), l.type) {
|
|
4917
4917
|
case "Annotation": {
|
|
4918
4918
|
const p = Array.isArray(l.body) ? l.body : [l.body], v = e.get(p[0]);
|
|
4919
|
-
return u && !v.width && (v.width = u.width, v.height = u.height), await r.getThumbnailFromResource(v, s,
|
|
4919
|
+
return u && !v.width && (v.width = u.width, v.height = u.height), await r.getThumbnailFromResource(v, s, o, a);
|
|
4920
4920
|
}
|
|
4921
4921
|
case "Canvas": {
|
|
4922
4922
|
const p = l;
|
|
4923
|
-
return i(p.items[0], s,
|
|
4923
|
+
return i(p.items[0], s, o, a, {
|
|
4924
4924
|
width: p.width,
|
|
4925
4925
|
height: p.height
|
|
4926
4926
|
});
|
|
4927
4927
|
}
|
|
4928
4928
|
case "AnnotationPage":
|
|
4929
|
-
return i(l.items[0], s,
|
|
4929
|
+
return i(l.items[0], s, o, a, u);
|
|
4930
4930
|
case "Choice": {
|
|
4931
4931
|
const p = l;
|
|
4932
|
-
return !p.items || p.items[0] ? await d() : i(p.items[0], s,
|
|
4932
|
+
return !p.items || p.items[0] ? await d() : i(p.items[0], s, o, a, u);
|
|
4933
4933
|
}
|
|
4934
4934
|
case "Collection": {
|
|
4935
4935
|
const p = l.items[0];
|
|
4936
|
-
return p ? i(p, s,
|
|
4936
|
+
return p ? i(p, s, o, a, u) : await d();
|
|
4937
4937
|
}
|
|
4938
4938
|
case "Manifest": {
|
|
4939
4939
|
const p = l.items[0];
|
|
4940
|
-
return p ? i(p, s,
|
|
4940
|
+
return p ? i(p, s, o, a, u) : await d();
|
|
4941
4941
|
}
|
|
4942
4942
|
case "SpecificResource":
|
|
4943
4943
|
case "Image":
|
|
@@ -4946,7 +4946,7 @@ function oc(e = $i, t = {}) {
|
|
|
4946
4946
|
case "Text":
|
|
4947
4947
|
case "TextualBody":
|
|
4948
4948
|
case "Video":
|
|
4949
|
-
return u && !l.width && (l.width = u.width, l.height = u.height), r.getThumbnailFromResource(l, s,
|
|
4949
|
+
return u && !l.width && (l.width = u.width, l.height = u.height), r.getThumbnailFromResource(l, s, o, a);
|
|
4950
4950
|
}
|
|
4951
4951
|
return await d();
|
|
4952
4952
|
}
|
|
@@ -4954,25 +4954,25 @@ function oc(e = $i, t = {}) {
|
|
|
4954
4954
|
getBestThumbnailAtSize: i
|
|
4955
4955
|
};
|
|
4956
4956
|
}
|
|
4957
|
-
function
|
|
4958
|
-
const n = V(), s = Ut(),
|
|
4957
|
+
function uc(e, t, { canvasId: r, manifestId: i } = {}) {
|
|
4958
|
+
const n = V(), s = Ut(), o = E(() => cc(n, { imageServiceLoader: s }), [n, s]), [a, u] = B(), d = ke(i ? { id: i } : void 0), l = ue(r ? { id: r } : void 0), p = l || d, v = ge(!1);
|
|
4959
4959
|
if (K(() => (v.current = !1, () => {
|
|
4960
4960
|
v.current = !0;
|
|
4961
4961
|
}), []), !p)
|
|
4962
4962
|
throw new Error("Must be called under a manifest or canvas context.");
|
|
4963
|
-
return
|
|
4963
|
+
return oc(
|
|
4964
4964
|
(m) => {
|
|
4965
|
-
|
|
4965
|
+
o.getBestThumbnailAtSize(p, e, t).then((h) => {
|
|
4966
4966
|
h.best && !v.current && u(h.best);
|
|
4967
4967
|
});
|
|
4968
4968
|
},
|
|
4969
4969
|
[p]
|
|
4970
|
-
),
|
|
4970
|
+
), a;
|
|
4971
4971
|
}
|
|
4972
|
-
function
|
|
4972
|
+
function lc(e) {
|
|
4973
4973
|
return { isMuted: !1, playRequested: !1, isPlaying: !1, isFinished: !1, volume: 100, duration: e };
|
|
4974
4974
|
}
|
|
4975
|
-
function
|
|
4975
|
+
function fc(e, t) {
|
|
4976
4976
|
switch (t.type) {
|
|
4977
4977
|
case "FINISHED":
|
|
4978
4978
|
return { ...e, isFinished: !0, isPlaying: !1, playRequested: !1 };
|
|
@@ -4995,22 +4995,22 @@ function lc(e, t) {
|
|
|
4995
4995
|
}
|
|
4996
4996
|
return e;
|
|
4997
4997
|
}
|
|
4998
|
-
function
|
|
4998
|
+
function pc(e) {
|
|
4999
4999
|
const t = Math.round(e);
|
|
5000
5000
|
return `${Math.floor(t / 60)}:${`${t % 60}`.padStart(2, "0")}`;
|
|
5001
5001
|
}
|
|
5002
5002
|
function Nt(e) {
|
|
5003
|
-
const [t, r] =
|
|
5004
|
-
n.current && i.current && (n.current.innerHTML =
|
|
5003
|
+
const [t, r] = an(fc, lc(e.duration)), i = ge(null), n = ge(null), s = ge(null), o = ge(!1), a = D(() => {
|
|
5004
|
+
n.current && i.current && (n.current.innerHTML = pc(i.current.currentTime), s.current && (s.current.style.width = `${i.current.currentTime / e.duration * 100}%`), o.current !== i.current.muted && (o.current = i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" })));
|
|
5005
5005
|
}, [e.duration]), u = D(() => {
|
|
5006
5006
|
i.current && (r({ type: "PLAY_REQUESTED" }), i.current.play().then(() => {
|
|
5007
5007
|
r({ type: "PLAY" });
|
|
5008
|
-
}),
|
|
5009
|
-
}, [
|
|
5008
|
+
}), a());
|
|
5009
|
+
}, [a]), d = D(() => {
|
|
5010
5010
|
i.current && (i.current.duration > 0 && i.current.paused ? u() : l());
|
|
5011
|
-
}, [
|
|
5012
|
-
i.current && (i.current.pause(), r({ type: "PAUSE" }),
|
|
5013
|
-
}, [
|
|
5011
|
+
}, [a]), l = D(() => {
|
|
5012
|
+
i.current && (i.current.pause(), r({ type: "PAUSE" }), a());
|
|
5013
|
+
}, [a]), p = D(() => {
|
|
5014
5014
|
i.current && (i.current.muted = !i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" }));
|
|
5015
5015
|
}, []), v = D(() => {
|
|
5016
5016
|
i.current && (i.current.muted = !0, r({ type: "MUTE" }));
|
|
@@ -5019,16 +5019,16 @@ function Nt(e) {
|
|
|
5019
5019
|
}, []), h = D((A) => {
|
|
5020
5020
|
i.current && (i.current.muted = !1, i.current.volume = A / 100, r({ type: "SET_VOLUME", volume: A }));
|
|
5021
5021
|
}, []), g = D((A) => {
|
|
5022
|
-
i.current && (i.current.currentTime = Math.max(0, Math.min(A * e.duration, e.duration)),
|
|
5022
|
+
i.current && (i.current.currentTime = Math.max(0, Math.min(A * e.duration, e.duration)), a());
|
|
5023
5023
|
}, []), b = D((A) => {
|
|
5024
|
-
i.current && (i.current.currentTime = Math.max(0, Math.min(A, e.duration)),
|
|
5024
|
+
i.current && (i.current.currentTime = Math.max(0, Math.min(A, e.duration)), a());
|
|
5025
5025
|
}, []);
|
|
5026
5026
|
return K(() => {
|
|
5027
5027
|
const A = setInterval(() => {
|
|
5028
|
-
|
|
5028
|
+
a();
|
|
5029
5029
|
}, 350);
|
|
5030
5030
|
return () => clearInterval(A);
|
|
5031
|
-
}, [
|
|
5031
|
+
}, [a, e.duration]), K(() => {
|
|
5032
5032
|
const A = () => {
|
|
5033
5033
|
r({ type: "FINISHED" });
|
|
5034
5034
|
}, w = i.current;
|
|
@@ -5050,19 +5050,19 @@ function Nt(e) {
|
|
|
5050
5050
|
];
|
|
5051
5051
|
}
|
|
5052
5052
|
const Di = ce(null), qi = ce(null), _i = ce(null);
|
|
5053
|
-
function
|
|
5053
|
+
function Ec() {
|
|
5054
5054
|
const e = H(Di);
|
|
5055
5055
|
if (!e)
|
|
5056
5056
|
throw new Error("Ctx not found");
|
|
5057
5057
|
return e;
|
|
5058
5058
|
}
|
|
5059
|
-
function
|
|
5059
|
+
function Pc() {
|
|
5060
5060
|
const e = H(qi);
|
|
5061
5061
|
if (!e)
|
|
5062
5062
|
throw new Error("Ctx not found");
|
|
5063
5063
|
return e;
|
|
5064
5064
|
}
|
|
5065
|
-
function
|
|
5065
|
+
function Lc() {
|
|
5066
5066
|
const e = H(_i);
|
|
5067
5067
|
if (!e)
|
|
5068
5068
|
throw new Error("Ctx not found");
|
|
@@ -5079,12 +5079,12 @@ function Ui({
|
|
|
5079
5079
|
return /* @__PURE__ */ x(_i.Provider, { value: { currentTime: i, progress: n, element: s }, children: /* @__PURE__ */ x(qi.Provider, { value: e, children: /* @__PURE__ */ x(Di.Provider, { value: t, children: r }) }) });
|
|
5080
5080
|
}
|
|
5081
5081
|
function Vi({ media: e, children: t }) {
|
|
5082
|
-
const [{ element: r, currentTime: i, progress: n }, s,
|
|
5082
|
+
const [{ element: r, currentTime: i, progress: n }, s, o] = Nt({ duration: e.duration });
|
|
5083
5083
|
return /* @__PURE__ */ N(
|
|
5084
5084
|
Ui,
|
|
5085
5085
|
{
|
|
5086
5086
|
state: s,
|
|
5087
|
-
actions:
|
|
5087
|
+
actions: o,
|
|
5088
5088
|
currentTime: i,
|
|
5089
5089
|
progress: n,
|
|
5090
5090
|
element: r,
|
|
@@ -5130,24 +5130,24 @@ function Bi({
|
|
|
5130
5130
|
mediaControlsDeps: t,
|
|
5131
5131
|
children: r
|
|
5132
5132
|
}) {
|
|
5133
|
-
const [{ element: i, currentTime: n, progress: s },
|
|
5133
|
+
const [{ element: i, currentTime: n, progress: s }, o, a] = Nt({ duration: e.duration });
|
|
5134
5134
|
return Le("overlay", "video-element", Hi, {
|
|
5135
5135
|
element: i,
|
|
5136
5136
|
media: e,
|
|
5137
|
-
playPause:
|
|
5137
|
+
playPause: a.playPause
|
|
5138
5138
|
}), Le(
|
|
5139
5139
|
"portal",
|
|
5140
5140
|
"custom-controls",
|
|
5141
5141
|
Ui,
|
|
5142
5142
|
{
|
|
5143
|
-
state:
|
|
5144
|
-
actions:
|
|
5143
|
+
state: o,
|
|
5144
|
+
actions: a,
|
|
5145
5145
|
currentTime: n,
|
|
5146
5146
|
progress: s,
|
|
5147
5147
|
element: i,
|
|
5148
5148
|
children: r
|
|
5149
5149
|
},
|
|
5150
|
-
[n,
|
|
5150
|
+
[n, o, e, ...t || []]
|
|
5151
5151
|
), null;
|
|
5152
5152
|
}
|
|
5153
5153
|
function zi({ model: e }) {
|
|
@@ -5193,7 +5193,7 @@ function Qi({ style: e }) {
|
|
|
5193
5193
|
);
|
|
5194
5194
|
}
|
|
5195
5195
|
const Yi = me.createContext("en");
|
|
5196
|
-
function
|
|
5196
|
+
function Fc(e) {
|
|
5197
5197
|
return /* @__PURE__ */ x(Yi.Provider, { value: e.language, children: e.children });
|
|
5198
5198
|
}
|
|
5199
5199
|
function Ht() {
|
|
@@ -5202,7 +5202,7 @@ function Ht() {
|
|
|
5202
5202
|
function dr(e) {
|
|
5203
5203
|
return e.indexOf("-") !== -1 ? e.slice(0, e.indexOf("-")) : e;
|
|
5204
5204
|
}
|
|
5205
|
-
function
|
|
5205
|
+
function dc({ as: e, language: t, children: r, viewingDirection: i, ...n }) {
|
|
5206
5206
|
const s = Ht();
|
|
5207
5207
|
return E(() => dr(s) === dr(t), [s, t]) ? e ? /* @__PURE__ */ x(e, { ...n, children: r }) : /* @__PURE__ */ x("span", { ...n, children: r }) : e ? /* @__PURE__ */ x(e, { ...n, lang: t, dir: i, children: r }) : /* @__PURE__ */ x("span", { ...n, lang: t, dir: i, children: r });
|
|
5208
5208
|
}
|
|
@@ -5221,15 +5221,15 @@ function Gi(e, t, r) {
|
|
|
5221
5221
|
return n;
|
|
5222
5222
|
return t.indexOf("none") !== -1 ? "none" : t.indexOf("@none") !== -1 ? "@none" : t[0];
|
|
5223
5223
|
}
|
|
5224
|
-
const
|
|
5224
|
+
const hc = (e, t = []) => {
|
|
5225
5225
|
const r = Ht();
|
|
5226
5226
|
return E(() => {
|
|
5227
5227
|
const i = e();
|
|
5228
5228
|
return Gi(r, i, []);
|
|
5229
5229
|
}, [r, ...t]);
|
|
5230
5230
|
};
|
|
5231
|
-
function
|
|
5232
|
-
const r =
|
|
5231
|
+
function yc(e, t) {
|
|
5232
|
+
const r = hc(() => Object.keys(e || {}), [e]);
|
|
5233
5233
|
return [
|
|
5234
5234
|
E(() => {
|
|
5235
5235
|
if (!e)
|
|
@@ -5243,27 +5243,27 @@ function hc(e, t) {
|
|
|
5243
5243
|
r
|
|
5244
5244
|
];
|
|
5245
5245
|
}
|
|
5246
|
-
function
|
|
5246
|
+
function jc() {
|
|
5247
5247
|
const e = Ht();
|
|
5248
5248
|
return function(r, i, n) {
|
|
5249
|
-
const s = Object.keys(r || {}),
|
|
5249
|
+
const s = Object.keys(r || {}), o = Gi(e, s, []);
|
|
5250
5250
|
if (!r)
|
|
5251
5251
|
return i || "";
|
|
5252
5252
|
if (typeof r == "string")
|
|
5253
5253
|
return r;
|
|
5254
|
-
const
|
|
5255
|
-
return
|
|
5254
|
+
const a = o ? r[o] : void 0;
|
|
5255
|
+
return a ? typeof a == "string" ? a : a.join(typeof n < "u" ? n : `
|
|
5256
5256
|
`) : "";
|
|
5257
5257
|
};
|
|
5258
5258
|
}
|
|
5259
|
-
const
|
|
5260
|
-
const [s,
|
|
5261
|
-
return
|
|
5262
|
-
|
|
5259
|
+
const vc = ({ as: e, defaultText: t, enableDangerouslySetInnerHTML: r, children: i, ...n }) => {
|
|
5260
|
+
const [s, o] = yc(i, t);
|
|
5261
|
+
return o ? /* @__PURE__ */ x(
|
|
5262
|
+
dc,
|
|
5263
5263
|
{
|
|
5264
5264
|
...n,
|
|
5265
5265
|
as: e,
|
|
5266
|
-
language:
|
|
5266
|
+
language: o,
|
|
5267
5267
|
title: r ? void 0 : s,
|
|
5268
5268
|
dangerouslySetInnerHTML: r ? {
|
|
5269
5269
|
__html: s
|
|
@@ -5282,7 +5282,7 @@ const yc = ({ as: e, defaultText: t, enableDangerouslySetInnerHTML: r, children:
|
|
|
5282
5282
|
}
|
|
5283
5283
|
);
|
|
5284
5284
|
};
|
|
5285
|
-
function
|
|
5285
|
+
function gc({
|
|
5286
5286
|
element: e,
|
|
5287
5287
|
media: t,
|
|
5288
5288
|
playPause: r
|
|
@@ -5320,16 +5320,16 @@ function vc({
|
|
|
5320
5320
|
)
|
|
5321
5321
|
] }) : null;
|
|
5322
5322
|
}
|
|
5323
|
-
function
|
|
5323
|
+
function mc({
|
|
5324
5324
|
media: e,
|
|
5325
5325
|
mediaControlsDeps: t,
|
|
5326
5326
|
children: r
|
|
5327
5327
|
}) {
|
|
5328
|
-
const [{ element: i, currentTime: n, progress: s },
|
|
5329
|
-
return Le("overlay", "video-element",
|
|
5328
|
+
const [{ element: i, currentTime: n, progress: s }, o, a] = Nt({ duration: e.duration });
|
|
5329
|
+
return Le("overlay", "video-element", gc, {
|
|
5330
5330
|
element: i,
|
|
5331
5331
|
media: e,
|
|
5332
|
-
playPause:
|
|
5332
|
+
playPause: a.playPause
|
|
5333
5333
|
}), null;
|
|
5334
5334
|
}
|
|
5335
5335
|
function Ji({
|
|
@@ -5339,8 +5339,8 @@ function Ji({
|
|
|
5339
5339
|
registerActions: i,
|
|
5340
5340
|
defaultChoices: n,
|
|
5341
5341
|
isStatic: s,
|
|
5342
|
-
renderViewerControls:
|
|
5343
|
-
renderMediaControls:
|
|
5342
|
+
renderViewerControls: o,
|
|
5343
|
+
renderMediaControls: a,
|
|
5344
5344
|
viewControlsDeps: u,
|
|
5345
5345
|
mediaControlsDeps: d,
|
|
5346
5346
|
strategies: l,
|
|
@@ -5353,7 +5353,7 @@ function Ji({
|
|
|
5353
5353
|
onClickPaintingAnnotation: A,
|
|
5354
5354
|
children: w
|
|
5355
5355
|
}) {
|
|
5356
|
-
const C = ue(), T = ei(C, ["deep-zoom"]), [j] =
|
|
5356
|
+
const C = ue(), T = ei(C, ["deep-zoom"]), [j] = Ys(), I = Ks(), L = V(), P = E(() => jt(L), [L]), [M, $] = sc({
|
|
5357
5357
|
strategies: l || ["images"],
|
|
5358
5358
|
defaultChoices: n == null ? void 0 : n.map(({ id: O }) => O)
|
|
5359
5359
|
}), ie = M.type === "images" ? M.choice : void 0, Z = E(() => h ? 1 : Math.max(
|
|
@@ -5363,7 +5363,7 @@ function Ji({
|
|
|
5363
5363
|
return (O.width || 0) / ((W = O.target) == null ? void 0 : W.spatial.width);
|
|
5364
5364
|
}) : []
|
|
5365
5365
|
), [h, M]);
|
|
5366
|
-
|
|
5366
|
+
Zs(Z), K(() => {
|
|
5367
5367
|
i && i($);
|
|
5368
5368
|
}, [M.annotations]), K(() => {
|
|
5369
5369
|
if (n)
|
|
@@ -5374,16 +5374,16 @@ function Ji({
|
|
|
5374
5374
|
}, [n]), hr(() => {
|
|
5375
5375
|
r && r(ie);
|
|
5376
5376
|
}, [ie]), Le(
|
|
5377
|
-
I && (M.type === "images" || M.type === "empty" || M.type === "textual-content" &&
|
|
5377
|
+
I && (M.type === "images" || M.type === "empty" || M.type === "textual-content" && o) ? "overlay" : "none",
|
|
5378
5378
|
`canvas-portal-controls-${C == null ? void 0 : C.id}`,
|
|
5379
5379
|
Ft.Provider,
|
|
5380
|
-
|
|
5380
|
+
o ? {
|
|
5381
5381
|
value: I || null,
|
|
5382
|
-
children:
|
|
5382
|
+
children: o(M)
|
|
5383
5383
|
} : {},
|
|
5384
5384
|
[C, I, M, ...u || []]
|
|
5385
5385
|
);
|
|
5386
|
-
const U =
|
|
5386
|
+
const U = uc({ maxWidth: 256, maxHeight: 256 });
|
|
5387
5387
|
if (!C)
|
|
5388
5388
|
return null;
|
|
5389
5389
|
const z = C.accompanyingCanvas, ee = U && U.type === "fixed" ? /* @__PURE__ */ x("world-object", { height: C.height, width: C.width, x: e, y: t, children: /* @__PURE__ */ x(
|
|
@@ -5425,13 +5425,13 @@ function Ji({
|
|
|
5425
5425
|
var X;
|
|
5426
5426
|
return /* @__PURE__ */ N(Me, { children: [
|
|
5427
5427
|
/* @__PURE__ */ x(
|
|
5428
|
-
|
|
5428
|
+
hn,
|
|
5429
5429
|
{
|
|
5430
5430
|
onClick: A ? (de) => {
|
|
5431
5431
|
de.stopPropagation(), A(O.annotationId, O, de);
|
|
5432
5432
|
} : void 0,
|
|
5433
5433
|
target: ((X = O.target) == null ? void 0 : X.spatial) || void 0,
|
|
5434
|
-
children: /* @__PURE__ */ x("div", { "data-textual-content": !0, children: /* @__PURE__ */ x(
|
|
5434
|
+
children: /* @__PURE__ */ x("div", { "data-textual-content": !0, children: /* @__PURE__ */ x(vc, { enableDangerouslySetInnerHTML: !0, children: O.text }) })
|
|
5435
5435
|
},
|
|
5436
5436
|
W
|
|
5437
5437
|
),
|
|
@@ -5440,7 +5440,7 @@ function Ji({
|
|
|
5440
5440
|
}) : null,
|
|
5441
5441
|
M.type === "images" ? /* @__PURE__ */ N(Me, { children: [
|
|
5442
5442
|
M.images.map((O, W) => /* @__PURE__ */ x(
|
|
5443
|
-
|
|
5443
|
+
ai,
|
|
5444
5444
|
{
|
|
5445
5445
|
isStatic: s,
|
|
5446
5446
|
image: O,
|
|
@@ -5459,70 +5459,79 @@ function Ji({
|
|
|
5459
5459
|
M.type === "3d-model" ? /* @__PURE__ */ x(Wi, { model: M.model }) : null,
|
|
5460
5460
|
M.type === "media" ? /* @__PURE__ */ x(Me, { children: M.media.type === "Sound" ? /* @__PURE__ */ N(Ni, { media: M.media, mediaControlsDeps: d, children: [
|
|
5461
5461
|
ee,
|
|
5462
|
-
|
|
5462
|
+
a ? a(M) : null
|
|
5463
5463
|
] }) : M.media.type === "Video" ? /* @__PURE__ */ N(Bi, { media: M.media, mediaControlsDeps: d, children: [
|
|
5464
5464
|
ee,
|
|
5465
|
-
|
|
5466
|
-
] }) : M.media.type === "VideoYouTube" && b ? /* @__PURE__ */ N(
|
|
5465
|
+
a ? a(M) : null
|
|
5466
|
+
] }) : M.media.type === "VideoYouTube" && b ? /* @__PURE__ */ N(mc, { media: M.media, mediaControlsDeps: d, children: [
|
|
5467
5467
|
ee,
|
|
5468
|
-
|
|
5468
|
+
a ? a(M) : null
|
|
5469
5469
|
] }) : null }) : null
|
|
5470
5470
|
]
|
|
5471
5471
|
},
|
|
5472
5472
|
`${C.id}/${M.type}/${xe}`
|
|
5473
5473
|
),
|
|
5474
|
-
M.type === "media" && M.media.type === "Sound" && z ? /* @__PURE__ */ x(Lt, { canvas: z.id, children: /* @__PURE__ */ x(Ji, { renderViewerControls:
|
|
5474
|
+
M.type === "media" && M.media.type === "Sound" && z ? /* @__PURE__ */ x(Lt, { canvas: z.id, children: /* @__PURE__ */ x(Ji, { renderViewerControls: o }) }) : null
|
|
5475
5475
|
] });
|
|
5476
5476
|
}
|
|
5477
|
-
function
|
|
5477
|
+
function bc() {
|
|
5478
5478
|
const e = H(tt);
|
|
5479
5479
|
return e && e.vault ? e.vault : Vr();
|
|
5480
5480
|
}
|
|
5481
|
-
const
|
|
5482
|
-
const i = ke(), n = Br(), s =
|
|
5481
|
+
const Ac = yr(function(t, r) {
|
|
5482
|
+
const i = ke(), n = Br(), s = Ss(), { ViewerControls: o, MediaControls: a } = t.components || {};
|
|
5483
5483
|
if (cn(r, () => s, [s]), !i)
|
|
5484
5484
|
return /* @__PURE__ */ x("div", {});
|
|
5485
5485
|
let u = 0;
|
|
5486
5486
|
return /* @__PURE__ */ N(Me, { children: [
|
|
5487
5487
|
t.header,
|
|
5488
|
-
/* @__PURE__ */ x(
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5488
|
+
/* @__PURE__ */ x(
|
|
5489
|
+
J.Viewer,
|
|
5490
|
+
{
|
|
5491
|
+
height: t.height,
|
|
5492
|
+
mode: t.mode,
|
|
5493
|
+
children: n.map((d, l) => {
|
|
5494
|
+
const p = u;
|
|
5495
|
+
return u += d.width + (t.spacing || 0), /* @__PURE__ */ x(Lt, { canvas: d.id, children: /* @__PURE__ */ x(
|
|
5496
|
+
J.RenderCanvas,
|
|
5497
|
+
{
|
|
5498
|
+
strategies: ["3d-model", "media", "images", "empty", "textual-content"],
|
|
5499
|
+
renderViewerControls: l === 0 && o ? () => /* @__PURE__ */ x(o, {}) : void 0,
|
|
5500
|
+
renderMediaControls: l === 0 && a ? () => /* @__PURE__ */ x(a, {}) : void 0,
|
|
5501
|
+
x: p,
|
|
5502
|
+
...t.canvasProps || {},
|
|
5503
|
+
children: t.annotations
|
|
5504
|
+
},
|
|
5505
|
+
d.id
|
|
5506
|
+
) }, d.id);
|
|
5507
|
+
})
|
|
5508
|
+
},
|
|
5509
|
+
t.reuseAtlas ? "" : s.currentSequenceIndex
|
|
5510
|
+
),
|
|
5503
5511
|
t.children
|
|
5504
5512
|
] });
|
|
5505
|
-
}), J = yr(function({ children: t, height: r, annotations: i, canvasProps: n, spacing: s, header:
|
|
5506
|
-
const
|
|
5507
|
-
return /* @__PURE__ */ x(Nr, { vault:
|
|
5508
|
-
|
|
5513
|
+
}), J = yr(function({ children: t, height: r, annotations: i, canvasProps: n, spacing: s, header: o, components: a, mode: u, ...d }, l) {
|
|
5514
|
+
const p = bc();
|
|
5515
|
+
return /* @__PURE__ */ x(Nr, { vault: p, children: /* @__PURE__ */ x(ws, { ...d, children: /* @__PURE__ */ x(
|
|
5516
|
+
Ac,
|
|
5509
5517
|
{
|
|
5510
|
-
ref:
|
|
5518
|
+
ref: l,
|
|
5511
5519
|
height: r,
|
|
5512
|
-
components:
|
|
5520
|
+
components: a,
|
|
5513
5521
|
spacing: s,
|
|
5514
5522
|
canvasProps: n,
|
|
5515
5523
|
annotations: i,
|
|
5516
|
-
header:
|
|
5524
|
+
header: o,
|
|
5525
|
+
mode: u,
|
|
5517
5526
|
children: t
|
|
5518
5527
|
}
|
|
5519
5528
|
) }) });
|
|
5520
5529
|
});
|
|
5521
|
-
J.RenderImage =
|
|
5530
|
+
J.RenderImage = ai;
|
|
5522
5531
|
J.RenderCanvas = Ji;
|
|
5523
5532
|
J.RenderAnnotationPage = It;
|
|
5524
|
-
J.RenderAnnotation =
|
|
5525
|
-
J.Viewer =
|
|
5533
|
+
J.RenderAnnotation = oi;
|
|
5534
|
+
J.Viewer = Xs;
|
|
5526
5535
|
J.CanvasBackground = Qi;
|
|
5527
5536
|
J.Audio = Ni;
|
|
5528
5537
|
J.Video = Bi;
|
|
@@ -5530,64 +5539,64 @@ J.Model = Wi;
|
|
|
5530
5539
|
J.AudioHTML = Vi;
|
|
5531
5540
|
J.VideoHTML = Hi;
|
|
5532
5541
|
J.ModelHTML = zi;
|
|
5533
|
-
function
|
|
5542
|
+
function $c({ annotation: e, children: t }) {
|
|
5534
5543
|
return /* @__PURE__ */ x(Te, { value: { annotation: e }, children: t });
|
|
5535
5544
|
}
|
|
5536
|
-
function
|
|
5545
|
+
function Dc({ annotationPage: e, children: t }) {
|
|
5537
5546
|
return /* @__PURE__ */ x(Te, { value: { annotationPage: e }, children: t });
|
|
5538
5547
|
}
|
|
5539
|
-
function
|
|
5548
|
+
function qc({ collection: e, children: t }) {
|
|
5540
5549
|
return /* @__PURE__ */ x(Te, { value: { collection: e }, children: t });
|
|
5541
5550
|
}
|
|
5542
|
-
function
|
|
5551
|
+
function _c(e, t = {}) {
|
|
5543
5552
|
return Vt(t);
|
|
5544
5553
|
}
|
|
5545
|
-
function
|
|
5554
|
+
function Uc(e, t = !1) {
|
|
5546
5555
|
}
|
|
5547
|
-
function
|
|
5556
|
+
function Vc(e) {
|
|
5548
5557
|
const r = be().manifest, i = e ? e.map((n) => typeof n == "string" ? n : n == null ? void 0 : n.id) : [];
|
|
5549
5558
|
return Q(
|
|
5550
5559
|
(n) => {
|
|
5551
|
-
const s = r ? n.iiif.entities.Manifest[r] : void 0,
|
|
5560
|
+
const s = r ? n.iiif.entities.Manifest[r] : void 0, o = (s == null ? void 0 : s.items) || [];
|
|
5552
5561
|
if (typeof e > "u")
|
|
5553
|
-
return
|
|
5554
|
-
const
|
|
5562
|
+
return o;
|
|
5563
|
+
const a = [];
|
|
5555
5564
|
for (const u of (s == null ? void 0 : s.items) || [])
|
|
5556
|
-
i.indexOf(u.id) !== -1 &&
|
|
5557
|
-
return
|
|
5565
|
+
i.indexOf(u.id) !== -1 && a.push(u);
|
|
5566
|
+
return a;
|
|
5558
5567
|
},
|
|
5559
5568
|
[i.join("/")]
|
|
5560
5569
|
);
|
|
5561
5570
|
}
|
|
5562
|
-
function
|
|
5563
|
-
const { id: r, selector: i } = e, n = be(), s = r || n.collection,
|
|
5564
|
-
(
|
|
5571
|
+
function Nc(e, t = []) {
|
|
5572
|
+
const { id: r, selector: i } = e, n = be(), s = r || n.collection, o = Q(
|
|
5573
|
+
(a) => s ? a.iiif.entities.Collection[s] : void 0,
|
|
5565
5574
|
[s]
|
|
5566
5575
|
);
|
|
5567
5576
|
return E(() => {
|
|
5568
|
-
if (
|
|
5569
|
-
return i ? i(
|
|
5570
|
-
}, [
|
|
5577
|
+
if (o)
|
|
5578
|
+
return i ? i(o) : o;
|
|
5579
|
+
}, [o, i, ...t]);
|
|
5571
5580
|
}
|
|
5572
|
-
function
|
|
5573
|
-
const s = V(),
|
|
5581
|
+
function Hc(e, t, r, i, n = []) {
|
|
5582
|
+
const s = V(), o = E(() => Xr(s), [s]);
|
|
5574
5583
|
K(() => {
|
|
5575
|
-
const
|
|
5576
|
-
return
|
|
5577
|
-
|
|
5584
|
+
const a = e;
|
|
5585
|
+
return a ? (o.addEventListener(a, t, r, i), () => {
|
|
5586
|
+
o.removeEventListener(a, t, r);
|
|
5578
5587
|
}) : () => {
|
|
5579
5588
|
};
|
|
5580
|
-
}, [
|
|
5589
|
+
}, [o, e, t, ...n]);
|
|
5581
5590
|
}
|
|
5582
|
-
function
|
|
5583
|
-
const { id: r, isLoaded: i, error: n, resource: s, requestId:
|
|
5591
|
+
function Bc(e, t) {
|
|
5592
|
+
const { id: r, isLoaded: i, error: n, resource: s, requestId: o, cached: a } = Hr(
|
|
5584
5593
|
e,
|
|
5585
5594
|
t
|
|
5586
5595
|
);
|
|
5587
|
-
return { id: r, isLoaded: i, error: n, manifest: s, requestId:
|
|
5596
|
+
return { id: r, isLoaded: i, error: n, manifest: s, requestId: o, cached: a };
|
|
5588
5597
|
}
|
|
5589
|
-
function
|
|
5590
|
-
const t = ue(), r = Vt(), i = V(), n = Ut(), [s,
|
|
5598
|
+
function xc({ cacheKey: e } = {}) {
|
|
5599
|
+
const t = ue(), r = Vt(), i = V(), n = Ut(), [s, o] = B(void 0), [a, u] = B(!1), [d, l] = B("idle"), [p, v] = B(void 0), m = t ? t.id : "undefined", h = E(() => {
|
|
5591
5600
|
try {
|
|
5592
5601
|
if (t && r.length) {
|
|
5593
5602
|
const b = r[0], A = i.get(b.body[0]), C = mt(A)[0];
|
|
@@ -5615,7 +5624,7 @@ function Ac({ cacheKey: e } = {}) {
|
|
|
5615
5624
|
width: C.width || t.width,
|
|
5616
5625
|
height: C.height || t.height
|
|
5617
5626
|
}) || void 0;
|
|
5618
|
-
|
|
5627
|
+
o(T), l("success"), u(!1);
|
|
5619
5628
|
} catch (T) {
|
|
5620
5629
|
l("error"), v(T);
|
|
5621
5630
|
}
|
|
@@ -5626,13 +5635,13 @@ function Ac({ cacheKey: e } = {}) {
|
|
|
5626
5635
|
})();
|
|
5627
5636
|
}, [m, e]), E(() => ({
|
|
5628
5637
|
data: g,
|
|
5629
|
-
isFetching:
|
|
5638
|
+
isFetching: a,
|
|
5630
5639
|
status: d,
|
|
5631
5640
|
error: p
|
|
5632
|
-
}), [g,
|
|
5641
|
+
}), [g, a, d, p]);
|
|
5633
5642
|
}
|
|
5634
|
-
function
|
|
5635
|
-
const e =
|
|
5643
|
+
function zc() {
|
|
5644
|
+
const e = xc();
|
|
5636
5645
|
return {
|
|
5637
5646
|
isLoading: e.isFetching,
|
|
5638
5647
|
tile: e.data ? {
|
|
@@ -5644,106 +5653,106 @@ function Bc() {
|
|
|
5644
5653
|
} : null
|
|
5645
5654
|
};
|
|
5646
5655
|
}
|
|
5647
|
-
function
|
|
5656
|
+
function Wc() {
|
|
5648
5657
|
const e = ke();
|
|
5649
5658
|
return e ? e.service.find(
|
|
5650
5659
|
(t) => t.profile === "SearchService1" || t.profile === "http://iiif.io/api/search/1/search"
|
|
5651
5660
|
) : void 0;
|
|
5652
5661
|
}
|
|
5653
|
-
function
|
|
5662
|
+
function Qc() {
|
|
5654
5663
|
const e = V();
|
|
5655
5664
|
return E(() => jt(e), [e]);
|
|
5656
5665
|
}
|
|
5657
5666
|
export {
|
|
5658
|
-
|
|
5659
|
-
|
|
5667
|
+
$c as AnnotationContext,
|
|
5668
|
+
Dc as AnnotationPageContext,
|
|
5660
5669
|
Lt as CanvasContext,
|
|
5661
5670
|
J as CanvasPanel,
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5671
|
+
qc as CollectionContext,
|
|
5672
|
+
Ms as ContextBridge,
|
|
5673
|
+
Qa as ImageServiceLoaderContext,
|
|
5674
|
+
xs as InnerViewerProvider,
|
|
5675
|
+
Fc as LanguageProvider,
|
|
5676
|
+
dc as LanguageString,
|
|
5677
|
+
vc as LocaleString,
|
|
5678
|
+
vs as ManifestContext,
|
|
5670
5679
|
Ui as MediaPlayerProvider,
|
|
5671
|
-
|
|
5680
|
+
gs as RangeContext,
|
|
5672
5681
|
tt as ReactVaultContext,
|
|
5673
5682
|
Te as ResourceProvider,
|
|
5674
5683
|
Et as ResourceReactContext,
|
|
5675
|
-
|
|
5684
|
+
ws as SimpleViewerProvider,
|
|
5676
5685
|
it as SimpleViewerReactContext,
|
|
5677
5686
|
Nr as VaultProvider,
|
|
5678
5687
|
Ft as ViewerPresetContext,
|
|
5679
|
-
|
|
5688
|
+
Gs as VirtualAnnotationProvider,
|
|
5680
5689
|
rt as VisibleCanvasReactContext,
|
|
5681
|
-
|
|
5682
|
-
|
|
5690
|
+
_a as emptyActions,
|
|
5691
|
+
Ua as emptyStrategy,
|
|
5683
5692
|
Re as expandTarget,
|
|
5684
5693
|
zr as findAllCanvasesInRange,
|
|
5685
|
-
|
|
5686
|
-
|
|
5694
|
+
ms as findFirstCanvasFromRange,
|
|
5695
|
+
Tc as findManifestSelectedRange,
|
|
5687
5696
|
Wr as findSelectedRange,
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5697
|
+
Ha as flattenAnnotationPageIds,
|
|
5698
|
+
pc as formatTime,
|
|
5699
|
+
Za as getImageStrategy,
|
|
5691
5700
|
Qr as getManifestSequence,
|
|
5692
5701
|
Li as getParsedTargetSelector,
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5702
|
+
kc as getVisibleCanvasesFromCanvasId,
|
|
5703
|
+
Mo as isImageApiSelector,
|
|
5704
|
+
Ro as parseRotation,
|
|
5696
5705
|
Ye as parseSelector,
|
|
5697
|
-
|
|
5706
|
+
Oc as parseSpecificResource,
|
|
5698
5707
|
gt as unknownResponse,
|
|
5699
5708
|
_ as unsupportedStrategy,
|
|
5700
5709
|
si as useAnnotation,
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5710
|
+
Io as useAnnotationPage,
|
|
5711
|
+
za as useAnnotationPageManager,
|
|
5712
|
+
_c as useAnnotationsAtTime,
|
|
5704
5713
|
ue as useCanvas,
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5714
|
+
Uc as useCanvasClock,
|
|
5715
|
+
As as useCanvasSequence,
|
|
5716
|
+
Vc as useCanvasSubset,
|
|
5717
|
+
hc as useClosestLanguage,
|
|
5718
|
+
Nc as useCollection,
|
|
5719
|
+
Cs as useContextBridge,
|
|
5720
|
+
jc as useCreateLocaleString,
|
|
5721
|
+
Ws as useDispatch,
|
|
5722
|
+
Hc as useEventListener,
|
|
5723
|
+
bc as useExistingVault,
|
|
5724
|
+
Bc as useExternalCollection,
|
|
5725
|
+
ys as useExternalManifest,
|
|
5717
5726
|
Hr as useExternalResource,
|
|
5718
5727
|
Ht as useIIIFLanguage,
|
|
5719
|
-
|
|
5728
|
+
xc as useImageService,
|
|
5720
5729
|
Ut as useImageServiceLoader,
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5730
|
+
zc as useImageTile,
|
|
5731
|
+
Ya as useLoadImageService,
|
|
5732
|
+
yc as useLocaleString,
|
|
5724
5733
|
ke as useManifest,
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5734
|
+
Pc as useMediaActions,
|
|
5735
|
+
Lc as useMediaElements,
|
|
5736
|
+
Ec as useMediaState,
|
|
5737
|
+
Ka as usePaintables,
|
|
5729
5738
|
Vt as usePaintingAnnotations,
|
|
5730
|
-
|
|
5731
|
-
|
|
5739
|
+
bs as useRange,
|
|
5740
|
+
sc as useRenderingStrategy,
|
|
5732
5741
|
be as useResourceContext,
|
|
5733
5742
|
ei as useResourceEvents,
|
|
5734
|
-
|
|
5735
|
-
|
|
5743
|
+
Wa as useResources,
|
|
5744
|
+
Wc as useSearchService,
|
|
5736
5745
|
Nt as useSimpleMediaPlayer,
|
|
5737
|
-
|
|
5738
|
-
|
|
5746
|
+
Ss as useSimpleViewer,
|
|
5747
|
+
Qc as useStyleHelper,
|
|
5739
5748
|
et as useStyles,
|
|
5740
|
-
|
|
5749
|
+
uc as useThumbnail,
|
|
5741
5750
|
V as useVault,
|
|
5742
|
-
|
|
5751
|
+
oc as useVaultEffect,
|
|
5743
5752
|
Q as useVaultSelector,
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5753
|
+
Ks as useViewerPreset,
|
|
5754
|
+
Qs as useVirtualAnnotationPage,
|
|
5755
|
+
Ys as useVirtualAnnotationPageContext,
|
|
5747
5756
|
Br as useVisibleCanvases
|
|
5748
5757
|
};
|
|
5749
5758
|
//# sourceMappingURL=index.mjs.map
|