react-iiif-vault 1.0.8 → 1.0.9
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/Viewer.d.ts +1 -1
- package/.build/types/canvas-panel/index.d.ts +2 -1
- package/.build/types/canvas-panel/render/Audio.d.ts +1 -1
- package/.build/types/canvas-panel/render/Canvas.d.ts +2 -2
- package/.build/types/canvas-panel/render/CanvasBackground.d.ts +1 -1
- package/.build/types/canvas-panel/render/DefaultCanvasFallback.d.ts +1 -1
- package/.build/types/canvas-panel/render/Image.d.ts +1 -1
- package/.build/types/canvas-panel/render/Model.d.ts +1 -1
- package/.build/types/canvas-panel/render/Video.d.ts +1 -1
- package/.build/types/canvas-panel/render/VideoYouTube.d.ts +1 -1
- package/.build/types/components/CanvasAnnotations.d.ts +10 -0
- package/.build/types/components/CombinedMetadata.d.ts +4 -0
- package/.build/types/components/Image.d.ts +15 -0
- package/.build/types/components/ManifestMetadata.d.ts +4 -0
- package/.build/types/components/Metadata.d.ts +39 -0
- package/.build/types/components/SequenceThumbnails.d.ts +29 -0
- package/.build/types/components/SingleCanvasThumbnail.d.ts +20 -0
- package/.build/types/context/AnnotationContext.d.ts +1 -1
- package/.build/types/context/AnnotationPageContext.d.ts +1 -1
- package/.build/types/context/CanvasContext.d.ts +1 -1
- package/.build/types/context/CollectionContext.d.ts +1 -1
- package/.build/types/context/ContextBridge.d.ts +1 -1
- package/.build/types/context/ManifestContext.d.ts +1 -1
- package/.build/types/context/MediaContext.d.ts +1 -1
- package/.build/types/context/RangeContext.d.ts +1 -1
- package/.build/types/context/ResourceContext.d.ts +2 -2
- package/.build/types/context/VaultContext.d.ts +1 -1
- package/.build/types/demo/media-controls.d.ts +1 -1
- package/.build/types/demo/viewer-controls.d.ts +1 -1
- package/.build/types/features/rendering-strategy/3d-strategy.d.ts +1 -1
- package/.build/types/features/rendering-strategy/image-strategy.d.ts +1 -1
- package/.build/types/features/rendering-strategy/resource-types.d.ts +7 -7
- package/.build/types/features/rendering-strategy/strategies.d.ts +5 -5
- package/.build/types/features/rendering-strategy/textual-content-strategy.d.ts +1 -1
- package/.build/types/hooks/useEventListener.d.ts +1 -1
- package/.build/types/hooks/useExternalResource.d.ts +1 -1
- package/.build/types/hooks/useImage.d.ts +10 -0
- package/.build/types/hooks/useLoadImageService.d.ts +1 -1
- package/.build/types/hooks/useRenderingStrategy.d.ts +3 -3
- package/.build/types/hooks/useSimpleMediaPlayer.d.ts +2 -2
- package/.build/types/hooks/useVirtualAnnotationPageContext.d.ts +81 -81
- package/.build/types/index.d.ts +8 -0
- package/.build/types/utility/i18n-utils.d.ts +8 -6
- package/.build/types/viewers/SimpleViewerContext.d.ts +2 -2
- package/.build/types/viewers/SimpleViewerContext.hooks.d.ts +2 -0
- package/.build/types/viewers/SimpleViewerContext.types.d.ts +6 -4
- package/dist/bundle/cjs/index.js +7 -6
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +2390 -1174
- package/dist/bundle/esm/index.mjs.map +1 -1
- package/dist/canvas-panel/cjs/canvas-panel.js +5 -5
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -1
- package/dist/canvas-panel/esm/canvas-panel.mjs +540 -480
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -1
- package/dist/index.umd.js +78 -76
- package/dist/index.umd.js.map +1 -1
- package/dist/react17/cjs/index.js +7 -6
- package/dist/react17/cjs/index.js.map +1 -1
- package/dist/react17/esm/index.mjs +2390 -1174
- package/dist/react17/esm/index.mjs.map +1 -1
- package/dist/utils/cjs/utils.js +1 -1
- package/dist/utils/cjs/utils.js.map +1 -1
- package/dist/utils/esm/utils.mjs +21 -21
- package/dist/utils/esm/utils.mjs.map +1 -1
- package/package.json +24 -22
|
@@ -1,404 +1,446 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { expandTarget as le } from "@iiif/helpers/annotation-targets";
|
|
1
|
+
import { jsx as d, jsxs as X, Fragment as Oe } from "react/jsx-runtime";
|
|
2
|
+
import Ie, { createContext as xe, Component as bn, createElement as Pt, isValidElement as wn, useContext as ue, useMemo as N, useState as ae, useEffect as be, useCallback as Q, useRef as Ee, useLayoutEffect as st, Fragment as Ye, useReducer as Pn, forwardRef as ct, useImperativeHandle as Tt } from "react";
|
|
3
|
+
import { AtlasAuto as On, ModeContext as Sn, mergeStyles as xn, RegionHighlight as Tn, TileSet as En, HTMLPortal as In, useCanvas as Cn } from "@atlas-viewer/atlas";
|
|
4
|
+
import { globalVault as Et, Vault as Ot } from "@iiif/helpers/vault";
|
|
5
|
+
import { createStylesHelper as ut } from "@iiif/helpers/styles";
|
|
6
|
+
import { expandTarget as ot } from "@iiif/helpers/annotation-targets";
|
|
8
7
|
export * from "@iiif/helpers/annotation-targets";
|
|
9
|
-
import { expandTarget as
|
|
10
|
-
import { ImageServiceLoader as
|
|
11
|
-
import { createThumbnailHelper as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, fe(e, t);
|
|
16
|
-
}
|
|
17
|
-
function Et(e, t) {
|
|
18
|
-
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, fe(e, t);
|
|
19
|
-
}
|
|
20
|
-
var It = function(t, n) {
|
|
21
|
-
return t === void 0 && (t = []), n === void 0 && (n = []), t.length !== n.length || t.some(function(r, i) {
|
|
22
|
-
return !Object.is(r, n[i]);
|
|
23
|
-
});
|
|
24
|
-
}, Ae = {
|
|
8
|
+
import { expandTarget as jn } from "@iiif/helpers";
|
|
9
|
+
import { ImageServiceLoader as Mn, getImageServices as it, createImageServiceRequest as Rn, imageServiceRequestToString as Ln } from "@atlas-viewer/iiif-image-api";
|
|
10
|
+
import { createThumbnailHelper as An } from "@iiif/helpers/thumbnail";
|
|
11
|
+
import kn from "react-dom";
|
|
12
|
+
const Nn = xe(null), tt = {
|
|
13
|
+
didCatch: !1,
|
|
25
14
|
error: null
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
o[a] = arguments[a];
|
|
31
|
-
return r = e.call.apply(e, [this].concat(o)) || this, r.state = Ae, r.resetErrorBoundary = function() {
|
|
32
|
-
for (var s, c = arguments.length, d = new Array(c), u = 0; u < c; u++)
|
|
33
|
-
d[u] = arguments[u];
|
|
34
|
-
r.props.onReset == null || (s = r.props).onReset.apply(s, d), r.reset();
|
|
35
|
-
}, r;
|
|
15
|
+
};
|
|
16
|
+
class Vn extends bn {
|
|
17
|
+
constructor(t) {
|
|
18
|
+
super(t), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = tt;
|
|
36
19
|
}
|
|
37
|
-
|
|
20
|
+
static getDerivedStateFromError(t) {
|
|
38
21
|
return {
|
|
39
|
-
|
|
22
|
+
didCatch: !0,
|
|
23
|
+
error: t
|
|
40
24
|
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
25
|
+
}
|
|
26
|
+
resetErrorBoundary() {
|
|
27
|
+
const {
|
|
28
|
+
error: t
|
|
29
|
+
} = this.state;
|
|
30
|
+
if (t !== null) {
|
|
31
|
+
for (var n, o, r = arguments.length, a = new Array(r), i = 0; i < r; i++)
|
|
32
|
+
a[i] = arguments[i];
|
|
33
|
+
(n = (o = this.props).onReset) === null || n === void 0 || n.call(o, {
|
|
34
|
+
args: a,
|
|
35
|
+
reason: "imperative-api"
|
|
36
|
+
}), this.setState(tt);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
componentDidCatch(t, n) {
|
|
40
|
+
var o, r;
|
|
41
|
+
(o = (r = this.props).onError) === null || o === void 0 || o.call(r, t, n);
|
|
42
|
+
}
|
|
43
|
+
componentDidUpdate(t, n) {
|
|
44
|
+
const {
|
|
45
|
+
didCatch: o
|
|
46
|
+
} = this.state, {
|
|
47
|
+
resetKeys: r
|
|
48
|
+
} = this.props;
|
|
49
|
+
if (o && n.error !== null && _n(t.resetKeys, r)) {
|
|
50
|
+
var a, i;
|
|
51
|
+
(a = (i = this.props).onReset) === null || a === void 0 || a.call(i, {
|
|
52
|
+
next: r,
|
|
53
|
+
prev: t.resetKeys,
|
|
54
|
+
reason: "keys"
|
|
55
|
+
}), this.setState(tt);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
const {
|
|
60
|
+
children: t,
|
|
61
|
+
fallbackRender: n,
|
|
62
|
+
FallbackComponent: o,
|
|
63
|
+
fallback: r
|
|
64
|
+
} = this.props, {
|
|
65
|
+
didCatch: a,
|
|
66
|
+
error: i
|
|
67
|
+
} = this.state;
|
|
68
|
+
let s = t;
|
|
69
|
+
if (a) {
|
|
70
|
+
const f = {
|
|
58
71
|
error: i,
|
|
59
72
|
resetErrorBoundary: this.resetErrorBoundary
|
|
60
73
|
};
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
if (typeof n == "function")
|
|
75
|
+
s = n(f);
|
|
76
|
+
else if (o)
|
|
77
|
+
s = Pt(o, f);
|
|
78
|
+
else if (r === null || wn(r))
|
|
79
|
+
s = r;
|
|
80
|
+
else
|
|
81
|
+
throw i;
|
|
82
|
+
}
|
|
83
|
+
return Pt(Nn.Provider, {
|
|
84
|
+
value: {
|
|
85
|
+
didCatch: a,
|
|
86
|
+
error: i,
|
|
87
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
88
|
+
}
|
|
89
|
+
}, s);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function _n() {
|
|
93
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
94
|
+
return e.length !== t.length || e.some((n, o) => !Object.is(n, t[o]));
|
|
95
|
+
}
|
|
96
|
+
const Dn = {
|
|
73
97
|
collection: void 0,
|
|
74
98
|
manifest: void 0,
|
|
75
99
|
range: void 0,
|
|
76
100
|
canvas: void 0,
|
|
77
101
|
annotation: void 0,
|
|
78
102
|
annotationPage: void 0
|
|
79
|
-
},
|
|
80
|
-
function
|
|
81
|
-
const n =
|
|
103
|
+
}, lt = Ie.createContext(Dn), je = () => ue(lt);
|
|
104
|
+
function Le({ value: e, children: t }) {
|
|
105
|
+
const n = je(), o = N(() => ({
|
|
82
106
|
...n,
|
|
83
107
|
...e
|
|
84
108
|
}), [e, n]);
|
|
85
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ d(lt.Provider, { value: o, children: t });
|
|
86
110
|
}
|
|
87
|
-
const
|
|
111
|
+
const Ke = Ie.createContext({
|
|
88
112
|
vault: null,
|
|
89
113
|
setVaultInstance: (e) => {
|
|
90
114
|
}
|
|
91
115
|
});
|
|
92
|
-
function
|
|
116
|
+
function It({
|
|
93
117
|
vault: e,
|
|
94
118
|
vaultOptions: t,
|
|
95
119
|
useGlobal: n,
|
|
96
|
-
resources:
|
|
97
|
-
children:
|
|
120
|
+
resources: o,
|
|
121
|
+
children: r
|
|
98
122
|
}) {
|
|
99
|
-
const [
|
|
100
|
-
return /* @__PURE__ */
|
|
123
|
+
const [a, i] = ae(() => e || (n ? Et(t) : t ? new Ot(t) : new Ot()));
|
|
124
|
+
return /* @__PURE__ */ d(Ke.Provider, { value: { vault: a, setVaultInstance: i }, children: /* @__PURE__ */ d(Le, { value: o || {}, children: r }) });
|
|
101
125
|
}
|
|
102
|
-
const
|
|
103
|
-
const { vault: e } =
|
|
126
|
+
const re = () => {
|
|
127
|
+
const { vault: e } = ue(Ke);
|
|
104
128
|
if (e === null)
|
|
105
129
|
throw new Error("Vault not found. Ensure you have your provider set up correctly.");
|
|
106
130
|
return e;
|
|
107
131
|
};
|
|
108
|
-
function
|
|
109
|
-
const n = typeof e == "string" ? e : e.id,
|
|
110
|
-
return
|
|
132
|
+
function Ct(e, { noCache: t = !1 } = {}) {
|
|
133
|
+
const n = typeof e == "string" ? e : e.id, o = re(), [r, a] = ae(n), [i, s] = ae(void 0), f = N(() => o.get(n, { skipSelfReturn: !0 }) || void 0, [n, o]), [h, u] = ae(f);
|
|
134
|
+
return be(() => {
|
|
111
135
|
(async () => {
|
|
112
136
|
try {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
} catch (
|
|
116
|
-
s(
|
|
137
|
+
const y = f && !t ? f : await o.load(n), x = y ? y.id || y["@id"] : null;
|
|
138
|
+
y && r !== x && a(x), u(y);
|
|
139
|
+
} catch (y) {
|
|
140
|
+
s(y);
|
|
117
141
|
}
|
|
118
142
|
})();
|
|
119
143
|
}, [n, t]), {
|
|
120
|
-
isLoaded: !!
|
|
121
|
-
id:
|
|
144
|
+
isLoaded: !!h,
|
|
145
|
+
id: r,
|
|
122
146
|
requestId: n,
|
|
123
|
-
error:
|
|
124
|
-
resource:
|
|
125
|
-
cached: !!(
|
|
147
|
+
error: i,
|
|
148
|
+
resource: h,
|
|
149
|
+
cached: !!(h && h === f)
|
|
126
150
|
};
|
|
127
151
|
}
|
|
128
|
-
function
|
|
129
|
-
const { id: n, isLoaded:
|
|
152
|
+
function Bn(e, t) {
|
|
153
|
+
const { id: n, isLoaded: o, error: r, resource: a, requestId: i, cached: s } = Ct(
|
|
130
154
|
e,
|
|
131
155
|
t
|
|
132
156
|
);
|
|
133
|
-
return { id: n, isLoaded:
|
|
157
|
+
return { id: n, isLoaded: o, error: r, manifest: a, requestId: i, cached: s };
|
|
134
158
|
}
|
|
135
|
-
function
|
|
136
|
-
return /* @__PURE__ */
|
|
159
|
+
function qn({ manifest: e, children: t }) {
|
|
160
|
+
return /* @__PURE__ */ d(Le, { value: { manifest: e }, children: t });
|
|
137
161
|
}
|
|
138
|
-
function
|
|
139
|
-
return /* @__PURE__ */
|
|
162
|
+
function Qe({ canvas: e, children: t }) {
|
|
163
|
+
return /* @__PURE__ */ d(Le, { value: { canvas: e }, children: t });
|
|
140
164
|
}
|
|
141
|
-
function
|
|
142
|
-
const n =
|
|
143
|
-
return
|
|
144
|
-
(
|
|
145
|
-
(
|
|
146
|
-
|
|
165
|
+
function ye(e, t = []) {
|
|
166
|
+
const n = re(), [o, r] = ae(() => e(n.getState(), n));
|
|
167
|
+
return be(() => n.subscribe(
|
|
168
|
+
(a) => e(a, n),
|
|
169
|
+
(a) => {
|
|
170
|
+
r(a);
|
|
147
171
|
},
|
|
148
172
|
!1
|
|
149
|
-
), t),
|
|
173
|
+
), t), o;
|
|
150
174
|
}
|
|
151
|
-
const
|
|
152
|
-
function
|
|
153
|
-
const e =
|
|
154
|
-
return
|
|
175
|
+
const Ge = Ie.createContext([]);
|
|
176
|
+
function jt() {
|
|
177
|
+
const e = ue(Ge);
|
|
178
|
+
return ye(
|
|
155
179
|
(t) => e.map((n) => t.iiif.entities.Canvas[n]).filter(Boolean),
|
|
156
180
|
[e]
|
|
157
181
|
);
|
|
158
182
|
}
|
|
159
|
-
function
|
|
160
|
-
const { id: n, selector:
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
(s) =>
|
|
164
|
-
[
|
|
183
|
+
function Ce(e = {}, t = []) {
|
|
184
|
+
const { id: n, selector: o } = e, r = je();
|
|
185
|
+
re();
|
|
186
|
+
const a = n || r.manifest, i = ye(
|
|
187
|
+
(s) => a ? s.iiif.entities.Manifest[a] : void 0,
|
|
188
|
+
[a]
|
|
165
189
|
);
|
|
166
|
-
return
|
|
167
|
-
if (
|
|
168
|
-
return
|
|
169
|
-
}, [
|
|
190
|
+
return N(() => {
|
|
191
|
+
if (i)
|
|
192
|
+
return o ? o(i) : i;
|
|
193
|
+
}, [i, o, ...t]);
|
|
170
194
|
}
|
|
171
|
-
function
|
|
172
|
-
return /* @__PURE__ */
|
|
195
|
+
function Fn({ range: e, children: t }) {
|
|
196
|
+
return /* @__PURE__ */ d(Le, { value: { range: e }, children: t });
|
|
173
197
|
}
|
|
174
|
-
function
|
|
198
|
+
function Un(e, t) {
|
|
175
199
|
for (const n of t.items) {
|
|
176
200
|
if (n.type === "Canvas")
|
|
177
201
|
return n;
|
|
178
202
|
if (n.type === "SpecificResource")
|
|
179
203
|
return n.source;
|
|
180
204
|
if (n.type === "Range") {
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
183
|
-
return
|
|
205
|
+
const o = Un(e, e.get(n));
|
|
206
|
+
if (o)
|
|
207
|
+
return o;
|
|
184
208
|
}
|
|
185
209
|
}
|
|
186
210
|
return null;
|
|
187
211
|
}
|
|
188
|
-
function
|
|
189
|
-
var
|
|
212
|
+
function Mt(e, t) {
|
|
213
|
+
var o;
|
|
190
214
|
const n = [];
|
|
191
|
-
for (const
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
n.push({ id:
|
|
215
|
+
for (const r of t.items)
|
|
216
|
+
if (r.type === "SpecificResource" && ((o = r.source) == null ? void 0 : o.type) === "Canvas" && (r.source.id.indexOf("#") !== -1 ? n.push({ id: r.source.id.split("#")[0], type: "Canvas" }) : n.push(r.source)), r.type === "Range" && n.push(...Mt(e, e.get(r))), r.type === "SpecificResource") {
|
|
217
|
+
const a = typeof r.source == "string" ? r.source : r.source.id;
|
|
218
|
+
n.push({ id: a, type: "Canvas" });
|
|
195
219
|
}
|
|
196
220
|
return n;
|
|
197
221
|
}
|
|
198
|
-
function
|
|
199
|
-
for (const
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
return
|
|
222
|
+
function Po(e, t, n) {
|
|
223
|
+
for (const o of t.structures) {
|
|
224
|
+
const r = Rt(e, e.get(o), n);
|
|
225
|
+
if (r)
|
|
226
|
+
return r;
|
|
203
227
|
}
|
|
204
228
|
return null;
|
|
205
229
|
}
|
|
206
|
-
function
|
|
207
|
-
var
|
|
208
|
-
for (const
|
|
209
|
-
const s = (
|
|
210
|
-
if (
|
|
230
|
+
function Rt(e, t, n) {
|
|
231
|
+
var o, r, a;
|
|
232
|
+
for (const i of t.items) {
|
|
233
|
+
const s = (r = (o = i == null ? void 0 : i.source) == null ? void 0 : o.id) == null ? void 0 : r.split("#")[0];
|
|
234
|
+
if (i.type === "SpecificResource" && i.source === n || i.type === "SpecificResource" && ((a = i.source) == null ? void 0 : a.type) === "Canvas" && n === s)
|
|
211
235
|
return t;
|
|
212
|
-
if (
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
215
|
-
return
|
|
236
|
+
if (i.type === "Range") {
|
|
237
|
+
const f = Rt(e, e.get(i), n);
|
|
238
|
+
if (f)
|
|
239
|
+
return f;
|
|
216
240
|
}
|
|
217
241
|
}
|
|
218
242
|
return null;
|
|
219
243
|
}
|
|
220
|
-
function
|
|
221
|
-
const
|
|
222
|
-
if (!
|
|
244
|
+
function Oo(e, t, n, o = !1) {
|
|
245
|
+
const r = t.behavior, a = n ? e.get(n) : null;
|
|
246
|
+
if (!a)
|
|
223
247
|
return [];
|
|
224
|
-
const
|
|
225
|
-
if (u ||
|
|
226
|
-
return [{ id:
|
|
227
|
-
const [
|
|
228
|
-
if (
|
|
229
|
-
return
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
248
|
+
const i = a.behavior, s = o ? !1 : r.includes("paged"), f = s ? !1 : r.includes("continuous"), h = s || f ? !1 : r.includes("individuals"), u = i.includes("facing-pages"), y = i.includes("non-paged");
|
|
249
|
+
if (u || y || h || o)
|
|
250
|
+
return [{ id: a.id, type: "Canvas" }];
|
|
251
|
+
const [x, M] = Lt(e, t);
|
|
252
|
+
if (f)
|
|
253
|
+
return x;
|
|
254
|
+
const I = x.findIndex((b) => b.id === n);
|
|
255
|
+
if (I === -1)
|
|
232
256
|
return [];
|
|
233
|
-
for (const
|
|
234
|
-
if (
|
|
235
|
-
return
|
|
236
|
-
return [{ id:
|
|
237
|
-
}
|
|
238
|
-
function
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
return [
|
|
242
|
-
if (s || !
|
|
243
|
-
return [
|
|
244
|
-
const
|
|
257
|
+
for (const b of M)
|
|
258
|
+
if (b.includes(I))
|
|
259
|
+
return b.map((E) => x[E]);
|
|
260
|
+
return [{ id: a.id, type: "Canvas" }];
|
|
261
|
+
}
|
|
262
|
+
function Lt(e, t, { disablePaging: n, skipNonPaged: o } = {}) {
|
|
263
|
+
const r = t.behavior, a = r.includes("paged"), i = a ? !1 : r.includes("continuous"), s = a || i ? !1 : r.includes("individuals"), f = t.type === "Manifest" ? t.items : Mt(e, t);
|
|
264
|
+
if (i)
|
|
265
|
+
return [f, [f.map((I, b) => b)]];
|
|
266
|
+
if (s || !a || n)
|
|
267
|
+
return [f, f.map((I, b) => [b])];
|
|
268
|
+
const h = [];
|
|
245
269
|
let u = [];
|
|
246
|
-
const
|
|
247
|
-
u.length && (
|
|
270
|
+
const y = () => {
|
|
271
|
+
u.length && (h.push([...u]), u = []);
|
|
248
272
|
};
|
|
249
|
-
let
|
|
250
|
-
for (let
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
|
|
273
|
+
let x = 0, M = !1;
|
|
274
|
+
for (let I = 0; I < f.length; I++) {
|
|
275
|
+
const b = e.get(f[I]);
|
|
276
|
+
if (b.behavior.includes("non-paged")) {
|
|
277
|
+
I === x && x++, o || (y(), h.push([I]), y());
|
|
254
278
|
continue;
|
|
255
279
|
}
|
|
256
|
-
if (
|
|
257
|
-
u.length && (
|
|
280
|
+
if (I === x || b.behavior.includes("facing-pages")) {
|
|
281
|
+
u.length && (M = !0), y(), h.push([I]), y();
|
|
258
282
|
continue;
|
|
259
283
|
}
|
|
260
|
-
if (u.push(
|
|
261
|
-
|
|
284
|
+
if (u.push(I), M) {
|
|
285
|
+
y(), M = !1;
|
|
262
286
|
continue;
|
|
263
287
|
}
|
|
264
|
-
u.length > 1 &&
|
|
288
|
+
u.length > 1 && y();
|
|
265
289
|
}
|
|
266
|
-
return u.length &&
|
|
267
|
-
}
|
|
268
|
-
function
|
|
269
|
-
const { id: n, selector:
|
|
270
|
-
return
|
|
271
|
-
if (
|
|
272
|
-
return
|
|
273
|
-
}, [
|
|
274
|
-
}
|
|
275
|
-
function
|
|
276
|
-
var
|
|
277
|
-
const n =
|
|
290
|
+
return u.length && y(), [f, h];
|
|
291
|
+
}
|
|
292
|
+
function At(e = {}, t = []) {
|
|
293
|
+
const { id: n, selector: o } = e, r = je(), a = n || r.range, i = ye((s) => a ? s.iiif.entities.Range[a] : void 0, [a]);
|
|
294
|
+
return N(() => {
|
|
295
|
+
if (i)
|
|
296
|
+
return o ? o(i) : i;
|
|
297
|
+
}, [i, o, ...t]);
|
|
298
|
+
}
|
|
299
|
+
function $n({ startCanvas: e, disablePaging: t }) {
|
|
300
|
+
var I;
|
|
301
|
+
const n = re(), o = Ce(), r = At(), [a, i] = ae(void 0), s = r || o;
|
|
278
302
|
if (!s)
|
|
279
303
|
throw new Error("Nothing selected");
|
|
280
|
-
const [
|
|
281
|
-
() =>
|
|
304
|
+
const [f, h] = N(
|
|
305
|
+
() => Lt(n, s, { disablePaging: t }),
|
|
282
306
|
[n, s]
|
|
283
|
-
), u =
|
|
284
|
-
(
|
|
285
|
-
const
|
|
286
|
-
|
|
307
|
+
), u = Q(
|
|
308
|
+
(b) => {
|
|
309
|
+
const E = h.findIndex((C) => C.includes(b));
|
|
310
|
+
i(E === -1 ? 0 : E);
|
|
287
311
|
},
|
|
288
|
-
[
|
|
289
|
-
),
|
|
290
|
-
(
|
|
291
|
-
const
|
|
292
|
-
|
|
312
|
+
[f, h]
|
|
313
|
+
), y = Q(
|
|
314
|
+
(b) => {
|
|
315
|
+
const E = f.findIndex((C) => C.id === b);
|
|
316
|
+
E !== -1 ? u(E) : i(0);
|
|
293
317
|
},
|
|
294
|
-
[
|
|
295
|
-
),
|
|
296
|
-
|
|
297
|
-
}, [
|
|
298
|
-
|
|
299
|
-
}, [
|
|
300
|
-
return typeof
|
|
301
|
-
visibleItems: ((
|
|
302
|
-
cursor:
|
|
303
|
-
items:
|
|
304
|
-
sequence:
|
|
305
|
-
|
|
318
|
+
[f, h]
|
|
319
|
+
), x = Q(() => {
|
|
320
|
+
i((b) => b >= h.length - 1 ? b : b + 1);
|
|
321
|
+
}, [h]), M = Q(() => {
|
|
322
|
+
i((b) => b <= 0 ? 0 : b - 1);
|
|
323
|
+
}, [h]);
|
|
324
|
+
return typeof a > "u" && (e ? y(e) : i(0)), {
|
|
325
|
+
visibleItems: ((I = h[a]) == null ? void 0 : I.map((b) => f[b].id)) || [],
|
|
326
|
+
cursor: a,
|
|
327
|
+
items: f,
|
|
328
|
+
sequence: h,
|
|
329
|
+
hasPrevious: a > 0,
|
|
330
|
+
hasNext: a < h.length - 1,
|
|
331
|
+
setSequenceIndex: i,
|
|
306
332
|
setCanvasIndex: u,
|
|
307
|
-
setCanvasId:
|
|
308
|
-
next:
|
|
309
|
-
previous:
|
|
333
|
+
setCanvasId: y,
|
|
334
|
+
next: x,
|
|
335
|
+
previous: M
|
|
310
336
|
};
|
|
311
337
|
}
|
|
312
|
-
const
|
|
313
|
-
},
|
|
314
|
-
setCurrentCanvasId:
|
|
315
|
-
setCurrentCanvasIndex:
|
|
316
|
-
nextCanvas:
|
|
317
|
-
previousCanvas:
|
|
338
|
+
const De = () => {
|
|
339
|
+
}, Xe = xe({
|
|
340
|
+
setCurrentCanvasId: De,
|
|
341
|
+
setCurrentCanvasIndex: De,
|
|
342
|
+
nextCanvas: De,
|
|
343
|
+
previousCanvas: De,
|
|
318
344
|
items: [],
|
|
319
345
|
sequence: [],
|
|
320
|
-
setSequenceIndex:
|
|
321
|
-
currentSequenceIndex: 0
|
|
346
|
+
setSequenceIndex: De,
|
|
347
|
+
currentSequenceIndex: 0,
|
|
348
|
+
hasNext: !1,
|
|
349
|
+
hasPrevious: !1
|
|
322
350
|
});
|
|
323
|
-
function
|
|
324
|
-
const t =
|
|
351
|
+
function Wn(e) {
|
|
352
|
+
const t = Ce(), {
|
|
353
|
+
cursor: n,
|
|
354
|
+
visibleItems: o,
|
|
355
|
+
next: r,
|
|
356
|
+
sequence: a,
|
|
357
|
+
items: i,
|
|
358
|
+
setCanvasIndex: s,
|
|
359
|
+
setCanvasId: f,
|
|
360
|
+
previous: h,
|
|
361
|
+
setSequenceIndex: u,
|
|
362
|
+
hasNext: y,
|
|
363
|
+
hasPrevious: x
|
|
364
|
+
} = $n({
|
|
325
365
|
startCanvas: e.startCanvas,
|
|
326
366
|
disablePaging: e.pagingEnabled === !1
|
|
327
|
-
}),
|
|
367
|
+
}), M = N(
|
|
328
368
|
() => ({
|
|
329
|
-
sequence:
|
|
330
|
-
items:
|
|
369
|
+
sequence: a,
|
|
370
|
+
items: i,
|
|
331
371
|
// Extra functions.
|
|
332
|
-
setCurrentCanvasId:
|
|
333
|
-
nextCanvas:
|
|
334
|
-
previousCanvas:
|
|
335
|
-
totalCanvases:
|
|
372
|
+
setCurrentCanvasId: f,
|
|
373
|
+
nextCanvas: r,
|
|
374
|
+
previousCanvas: h,
|
|
375
|
+
totalCanvases: i.length,
|
|
336
376
|
setCurrentCanvasIndex: s,
|
|
337
377
|
setSequenceIndex: u,
|
|
338
|
-
currentSequenceIndex: n
|
|
378
|
+
currentSequenceIndex: n,
|
|
379
|
+
hasNext: y,
|
|
380
|
+
hasPrevious: x
|
|
339
381
|
}),
|
|
340
|
-
[
|
|
382
|
+
[a, i, f, r, h, i, s, u, n]
|
|
341
383
|
);
|
|
342
|
-
return t ?
|
|
384
|
+
return t ? o.length === 0 ? null : /* @__PURE__ */ d(Xe.Provider, { value: M, children: /* @__PURE__ */ d(Ge.Provider, { value: o, children: /* @__PURE__ */ d(Qe, { canvas: o[0], children: e.children }) }) }) : (console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ d("div", { children: "Sorry, something went wrong." }));
|
|
343
385
|
}
|
|
344
|
-
function
|
|
345
|
-
const t =
|
|
386
|
+
function Hn(e) {
|
|
387
|
+
const t = Bn(e.manifest);
|
|
346
388
|
if (!t)
|
|
347
|
-
return console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */
|
|
389
|
+
return console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ d("div", { children: "Sorry, something went wrong." });
|
|
348
390
|
if (t.error)
|
|
349
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ d("div", { children: t.error.toString() });
|
|
350
392
|
if (!t.isLoaded)
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
const n = /* @__PURE__ */
|
|
353
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ d("div", { children: "Loading..." });
|
|
394
|
+
const n = /* @__PURE__ */ d(Wn, { ...e, children: e.children });
|
|
395
|
+
return /* @__PURE__ */ d(qn, { manifest: t.id, children: e.rangeId ? /* @__PURE__ */ d(Fn, { range: e.rangeId, children: n }) : n });
|
|
354
396
|
}
|
|
355
|
-
function
|
|
356
|
-
return
|
|
397
|
+
function kt() {
|
|
398
|
+
return ue(Xe);
|
|
357
399
|
}
|
|
358
|
-
function
|
|
400
|
+
function Yn() {
|
|
359
401
|
return {
|
|
360
|
-
VaultContext:
|
|
361
|
-
ResourceContext:
|
|
362
|
-
SimpleViewerReactContext:
|
|
363
|
-
VisibleCanvasReactContext:
|
|
402
|
+
VaultContext: ue(Ke),
|
|
403
|
+
ResourceContext: ue(lt),
|
|
404
|
+
SimpleViewerReactContext: ue(Xe),
|
|
405
|
+
VisibleCanvasReactContext: ue(Ge)
|
|
364
406
|
};
|
|
365
407
|
}
|
|
366
|
-
function
|
|
367
|
-
return /* @__PURE__ */
|
|
408
|
+
function zn(e) {
|
|
409
|
+
return /* @__PURE__ */ d(It, { vault: e.bridge.VaultContext.vault || void 0, resources: e.bridge.ResourceContext, children: /* @__PURE__ */ d(Ge.Provider, { value: e.bridge.VisibleCanvasReactContext, children: /* @__PURE__ */ d(Xe.Provider, { value: e.bridge.SimpleViewerReactContext, children: e.children }) }) });
|
|
368
410
|
}
|
|
369
|
-
const
|
|
411
|
+
const Te = function(e) {
|
|
370
412
|
return function() {
|
|
371
413
|
const t = { type: e, getType: () => e, toString: () => e };
|
|
372
|
-
return (n,
|
|
414
|
+
return (n, o) => ({
|
|
373
415
|
...t,
|
|
374
416
|
...n !== void 0 && { payload: n },
|
|
375
|
-
...
|
|
417
|
+
...o !== void 0 && { meta: o }
|
|
376
418
|
});
|
|
377
419
|
};
|
|
378
|
-
},
|
|
379
|
-
importEntities:
|
|
380
|
-
modifyEntityField:
|
|
381
|
-
reorderEntityField:
|
|
382
|
-
addReference:
|
|
383
|
-
removeReference:
|
|
384
|
-
updateReference:
|
|
385
|
-
addMetadata:
|
|
386
|
-
removeMetadata:
|
|
387
|
-
updateMetadata:
|
|
388
|
-
reorderMetadata:
|
|
420
|
+
}, Kn = "@iiif/IMPORT_ENTITIES", Qn = "@iiif/MODIFY_ENTITY_FIELD", Gn = "@iiif/REORDER_ENTITY_FIELD", Xn = "@iiif/ADD_REFERENCE", Jn = "@iiif/UPDATE_REFERENCE", Zn = "@iiif/REMOVE_REFERENCE", er = "@iiif/ADD_METADATA", tr = "@iiif/REMOVE_METADATA", nr = "@iiif/UPDATE_METADATA", rr = "@iiif/REORDER_METADATA", or = Te(Kn)(), ir = Te(Qn)(), ar = Te(Gn)(), sr = Te(Xn)(), cr = Te(Zn)(), ur = Te(Jn)(), lr = Te(er)(), fr = Te(nr)(), dr = Te(tr)(), pr = Te(rr)(), nt = {
|
|
421
|
+
importEntities: or,
|
|
422
|
+
modifyEntityField: ir,
|
|
423
|
+
reorderEntityField: ar,
|
|
424
|
+
addReference: sr,
|
|
425
|
+
removeReference: cr,
|
|
426
|
+
updateReference: ur,
|
|
427
|
+
addMetadata: lr,
|
|
428
|
+
removeMetadata: dr,
|
|
429
|
+
updateMetadata: fr,
|
|
430
|
+
reorderMetadata: pr
|
|
389
431
|
};
|
|
390
|
-
function
|
|
391
|
-
const t =
|
|
392
|
-
return
|
|
432
|
+
function hr() {
|
|
433
|
+
const t = re().getStore();
|
|
434
|
+
return N(() => (n) => t.dispatch(n), [t]);
|
|
393
435
|
}
|
|
394
|
-
function
|
|
436
|
+
function St(e) {
|
|
395
437
|
return typeof e != "string" && e && e.bindToVault;
|
|
396
438
|
}
|
|
397
|
-
function
|
|
398
|
-
const e =
|
|
399
|
-
|
|
439
|
+
function yr() {
|
|
440
|
+
const e = re(), t = Ee([]), n = hr(), o = N(() => `vault://annotation-page/${(/* @__PURE__ */ new Date()).getTime()}/${Math.round(Math.random() * 1e9).toString(16)}`, []);
|
|
441
|
+
st(() => {
|
|
400
442
|
const s = {
|
|
401
|
-
id:
|
|
443
|
+
id: o,
|
|
402
444
|
type: "AnnotationPage",
|
|
403
445
|
behavior: [],
|
|
404
446
|
label: null,
|
|
@@ -415,7 +457,7 @@ function cn() {
|
|
|
415
457
|
service: []
|
|
416
458
|
};
|
|
417
459
|
n(
|
|
418
|
-
|
|
460
|
+
nt.importEntities({
|
|
419
461
|
entities: {
|
|
420
462
|
AnnotationPage: {
|
|
421
463
|
[s.id]: s
|
|
@@ -423,39 +465,39 @@ function cn() {
|
|
|
423
465
|
}
|
|
424
466
|
})
|
|
425
467
|
);
|
|
426
|
-
}, [
|
|
427
|
-
const
|
|
428
|
-
(s) =>
|
|
429
|
-
[
|
|
430
|
-
),
|
|
431
|
-
(s,
|
|
432
|
-
if (
|
|
433
|
-
if (
|
|
434
|
-
const
|
|
435
|
-
|
|
468
|
+
}, [o]);
|
|
469
|
+
const r = ye(
|
|
470
|
+
(s) => o ? s.iiif.entities.AnnotationPage[o] : null,
|
|
471
|
+
[o]
|
|
472
|
+
), a = Q(
|
|
473
|
+
(s, f) => {
|
|
474
|
+
if (o) {
|
|
475
|
+
if (St(s)) {
|
|
476
|
+
const y = s;
|
|
477
|
+
y.__vault || y.bindToVault(e), s = typeof y.source == "string" ? y.source : y.source.id, t.current[s] = y;
|
|
436
478
|
} else
|
|
437
479
|
typeof s != "string" && (s = s.id);
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
id:
|
|
480
|
+
const h = e.get({ id: o, type: "AnnotationPage" }), u = e.get({ id: s, type: "Annotation" });
|
|
481
|
+
h && u && (h.items.find((y) => y.id === u.id) || n(
|
|
482
|
+
nt.addReference({
|
|
483
|
+
id: o,
|
|
442
484
|
type: "AnnotationPage",
|
|
443
485
|
key: "items",
|
|
444
486
|
reference: {
|
|
445
487
|
id: s,
|
|
446
488
|
type: "Annotation"
|
|
447
489
|
},
|
|
448
|
-
index:
|
|
490
|
+
index: f
|
|
449
491
|
})
|
|
450
492
|
));
|
|
451
493
|
}
|
|
452
494
|
},
|
|
453
|
-
[
|
|
454
|
-
),
|
|
495
|
+
[o]
|
|
496
|
+
), i = Q(
|
|
455
497
|
(s) => {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
id:
|
|
498
|
+
o && (St(s) ? s = typeof s.source == "string" ? s.source : s.source.id : typeof s != "string" && (s = s.id), t.current[s] && t.current[s].beforeRemove(), e.get({ id: o, type: "AnnotationPage" }) && n(
|
|
499
|
+
nt.removeReference({
|
|
500
|
+
id: o,
|
|
459
501
|
type: "AnnotationPage",
|
|
460
502
|
key: "items",
|
|
461
503
|
reference: {
|
|
@@ -465,19 +507,19 @@ function cn() {
|
|
|
465
507
|
})
|
|
466
508
|
));
|
|
467
509
|
},
|
|
468
|
-
[
|
|
510
|
+
[o]
|
|
469
511
|
);
|
|
470
512
|
return [
|
|
471
|
-
|
|
513
|
+
r,
|
|
472
514
|
{
|
|
473
|
-
addAnnotation:
|
|
474
|
-
removeAnnotation:
|
|
515
|
+
addAnnotation: a,
|
|
516
|
+
removeAnnotation: i
|
|
475
517
|
}
|
|
476
518
|
];
|
|
477
519
|
}
|
|
478
|
-
const
|
|
479
|
-
function
|
|
480
|
-
const e =
|
|
520
|
+
const Nt = xe(null);
|
|
521
|
+
function gr() {
|
|
522
|
+
const e = ue(Nt);
|
|
481
523
|
return [
|
|
482
524
|
e.fullPage,
|
|
483
525
|
{
|
|
@@ -486,274 +528,274 @@ function un() {
|
|
|
486
528
|
}
|
|
487
529
|
];
|
|
488
530
|
}
|
|
489
|
-
function
|
|
490
|
-
const [t, { addAnnotation: n, removeAnnotation:
|
|
491
|
-
return /* @__PURE__ */
|
|
492
|
-
|
|
531
|
+
function mr({ children: e }) {
|
|
532
|
+
const [t, { addAnnotation: n, removeAnnotation: o }] = yr();
|
|
533
|
+
return /* @__PURE__ */ d(
|
|
534
|
+
Nt.Provider,
|
|
493
535
|
{
|
|
494
|
-
value:
|
|
536
|
+
value: N(() => ({ fullPage: t, addAnnotation: n, removeAnnotation: o }), [t]),
|
|
495
537
|
children: e
|
|
496
538
|
}
|
|
497
539
|
);
|
|
498
540
|
}
|
|
499
|
-
function
|
|
541
|
+
function vr({
|
|
500
542
|
width: e,
|
|
501
543
|
style: t,
|
|
502
544
|
height: n,
|
|
503
|
-
error:
|
|
504
|
-
resetErrorBoundary:
|
|
545
|
+
error: o,
|
|
546
|
+
resetErrorBoundary: r
|
|
505
547
|
}) {
|
|
506
|
-
return /* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ X("div", { style: { width: e, height: n, minHeight: 500, ...t || {}, background: "#f9f9f9" }, children: [
|
|
549
|
+
/* @__PURE__ */ d("h3", { children: "Error occurred" }),
|
|
550
|
+
/* @__PURE__ */ d("p", { children: o.message }),
|
|
551
|
+
/* @__PURE__ */ d("button", { onClick: r, children: "Reset" })
|
|
510
552
|
] });
|
|
511
553
|
}
|
|
512
|
-
const
|
|
513
|
-
function
|
|
514
|
-
return
|
|
554
|
+
const ft = xe(null);
|
|
555
|
+
function br() {
|
|
556
|
+
return ue(ft);
|
|
515
557
|
}
|
|
516
|
-
const
|
|
558
|
+
const Vt = xe(
|
|
517
559
|
() => {
|
|
518
560
|
}
|
|
519
|
-
),
|
|
561
|
+
), _t = xe(
|
|
520
562
|
() => {
|
|
521
563
|
}
|
|
522
564
|
);
|
|
523
|
-
function
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}), [t, e,
|
|
528
|
-
}
|
|
529
|
-
function
|
|
530
|
-
const { id: n, selector:
|
|
531
|
-
return
|
|
532
|
-
if (
|
|
533
|
-
return
|
|
534
|
-
}, [
|
|
535
|
-
}
|
|
536
|
-
const
|
|
565
|
+
function Ve(e, t, n, o, r = []) {
|
|
566
|
+
const a = ue(e === "portal" ? _t : Vt);
|
|
567
|
+
be(() => (e !== "none" && a(t, n, o), () => {
|
|
568
|
+
a(t, null);
|
|
569
|
+
}), [t, e, a, ...r]);
|
|
570
|
+
}
|
|
571
|
+
function Se(e = {}, t = []) {
|
|
572
|
+
const { id: n, selector: o } = e, r = je(), a = n || r.canvas, i = ye((s) => a ? s.iiif.entities.Canvas[a] : void 0, [a]);
|
|
573
|
+
return N(() => {
|
|
574
|
+
if (i)
|
|
575
|
+
return o ? o(i) : i;
|
|
576
|
+
}, [i, o, ...t]);
|
|
577
|
+
}
|
|
578
|
+
const Dt = xe(() => {
|
|
537
579
|
});
|
|
538
|
-
function
|
|
539
|
-
const t =
|
|
540
|
-
|
|
580
|
+
function wr(e) {
|
|
581
|
+
const t = Se(), n = ue(Dt);
|
|
582
|
+
be(() => t && t.id ? (n(t.id, e), () => n(t.id, -1)) : () => {
|
|
541
583
|
}, [t, e]);
|
|
542
584
|
}
|
|
543
|
-
function
|
|
585
|
+
function Pr({
|
|
544
586
|
children: e,
|
|
545
587
|
errorFallback: t,
|
|
546
588
|
outerContainerProps: n = {},
|
|
547
|
-
worldScale:
|
|
548
|
-
...
|
|
589
|
+
worldScale: o,
|
|
590
|
+
...r
|
|
549
591
|
}) {
|
|
550
|
-
const [
|
|
551
|
-
|
|
552
|
-
if (
|
|
553
|
-
const { [
|
|
554
|
-
return
|
|
592
|
+
const [a, i] = ae(), s = Yn(), f = t || vr, [h, u] = ae({}), y = Object.entries(h), [x, M] = ae({}), I = Object.entries(x), [b, E] = ae({}), C = N(() => o || Math.max(...Object.values(b)), [b]), A = N(() => ({ maxOverZoom: C || 1, ...r.runtimeOptions || {} }), [C, r.runtimeOptions]), S = Q((R, B) => {
|
|
593
|
+
E((j) => {
|
|
594
|
+
if (B === -1) {
|
|
595
|
+
const { [R]: O, ...U } = j;
|
|
596
|
+
return U;
|
|
555
597
|
}
|
|
556
|
-
return { ...
|
|
598
|
+
return { ...j, [R]: B };
|
|
557
599
|
});
|
|
558
|
-
}, []),
|
|
559
|
-
u(({ [
|
|
560
|
-
...
|
|
561
|
-
[
|
|
562
|
-
} :
|
|
563
|
-
}, []),
|
|
564
|
-
|
|
565
|
-
...
|
|
566
|
-
[
|
|
567
|
-
} :
|
|
600
|
+
}, []), F = Q((R, B, j) => {
|
|
601
|
+
u(({ [R]: O, ...U }) => B ? {
|
|
602
|
+
...U,
|
|
603
|
+
[R]: { element: B, props: j }
|
|
604
|
+
} : U);
|
|
605
|
+
}, []), L = Q((R, B, j) => {
|
|
606
|
+
M(({ [R]: O, ...U }) => B ? {
|
|
607
|
+
...U,
|
|
608
|
+
[R]: { element: B, props: j }
|
|
609
|
+
} : U);
|
|
568
610
|
}, []);
|
|
569
|
-
return /* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
-
|
|
611
|
+
return /* @__PURE__ */ X(Vn, { resetKeys: [], fallbackRender: (R) => /* @__PURE__ */ d(f, { ...r, ...R }), children: [
|
|
612
|
+
/* @__PURE__ */ d(
|
|
613
|
+
On,
|
|
572
614
|
{
|
|
573
|
-
...
|
|
574
|
-
containerProps: { style: { position: "relative" }, ...
|
|
575
|
-
htmlChildren: /* @__PURE__ */
|
|
576
|
-
onCreated: (
|
|
577
|
-
|
|
615
|
+
...r,
|
|
616
|
+
containerProps: { style: { position: "relative" }, ...r.containerProps || {} },
|
|
617
|
+
htmlChildren: /* @__PURE__ */ d(Oe, { children: y.map(([R, { element: B, props: j }]) => /* @__PURE__ */ d(Ie.Fragment, { children: /* @__PURE__ */ d(B, { ...j || {} }) }, R)) }),
|
|
618
|
+
onCreated: (R) => {
|
|
619
|
+
i(R), r.onCreated && r.onCreated(R);
|
|
578
620
|
},
|
|
579
621
|
runtimeOptions: A,
|
|
580
|
-
children: /* @__PURE__ */
|
|
622
|
+
children: /* @__PURE__ */ d(ft.Provider, { value: a, children: /* @__PURE__ */ d(Dt.Provider, { value: S, children: /* @__PURE__ */ d(Vt.Provider, { value: F, children: /* @__PURE__ */ d(_t.Provider, { value: L, children: /* @__PURE__ */ d(zn, { bridge: s, children: /* @__PURE__ */ d(Sn.Provider, { value: r.mode || "explore", children: /* @__PURE__ */ d(mr, { children: e }) }) }) }) }) }) })
|
|
581
623
|
}
|
|
582
624
|
),
|
|
583
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ d("div", { children: I.map(([R, { element: B, props: j }]) => /* @__PURE__ */ d(Ie.Fragment, { children: /* @__PURE__ */ d(B, { ...j || {} }) }, R)) })
|
|
584
626
|
] });
|
|
585
627
|
}
|
|
586
|
-
const
|
|
628
|
+
const We = {}, Bt = {
|
|
587
629
|
get(e) {
|
|
588
630
|
return e;
|
|
589
631
|
},
|
|
590
|
-
setMetaValue([e, t, n],
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
...
|
|
632
|
+
setMetaValue([e, t, n], o) {
|
|
633
|
+
const r = Bt.getResourceMeta(e, t), a = r ? r[n] : void 0, i = typeof o == "function" ? o(a) : o;
|
|
634
|
+
We[e] = {
|
|
635
|
+
...We[e] || {},
|
|
594
636
|
[t]: {
|
|
595
|
-
...(
|
|
596
|
-
[n]:
|
|
637
|
+
...(We[e] || {})[t] || {},
|
|
638
|
+
[n]: i
|
|
597
639
|
}
|
|
598
640
|
};
|
|
599
641
|
},
|
|
600
642
|
getResourceMeta: (e, t) => {
|
|
601
|
-
const n =
|
|
643
|
+
const n = We[e];
|
|
602
644
|
if (n)
|
|
603
645
|
return t ? n[t] : n;
|
|
604
646
|
}
|
|
605
647
|
};
|
|
606
|
-
function
|
|
648
|
+
function qt(e = Bt) {
|
|
607
649
|
return {
|
|
608
|
-
addEventListener(t, n,
|
|
650
|
+
addEventListener(t, n, o, r) {
|
|
609
651
|
if (t)
|
|
610
652
|
return e.setMetaValue(
|
|
611
653
|
[t.id, "eventManager", n],
|
|
612
|
-
(
|
|
613
|
-
const
|
|
614
|
-
for (const s of
|
|
615
|
-
if (s.callback ===
|
|
616
|
-
return
|
|
617
|
-
return [...
|
|
654
|
+
(a) => {
|
|
655
|
+
const i = a || [];
|
|
656
|
+
for (const s of i)
|
|
657
|
+
if (s.callback === o)
|
|
658
|
+
return i;
|
|
659
|
+
return [...i, { callback: o, scope: r }];
|
|
618
660
|
}
|
|
619
|
-
),
|
|
661
|
+
), o;
|
|
620
662
|
},
|
|
621
|
-
removeEventListener(t, n,
|
|
663
|
+
removeEventListener(t, n, o) {
|
|
622
664
|
t && e.setMetaValue(
|
|
623
665
|
[t.id, "eventManager", n],
|
|
624
|
-
(
|
|
666
|
+
(r) => (r || []).filter((a) => a.callback !== o)
|
|
625
667
|
);
|
|
626
668
|
},
|
|
627
669
|
getListenersAsProps(t, n) {
|
|
628
|
-
const
|
|
629
|
-
if (!
|
|
670
|
+
const o = typeof t == "string" ? { id: t } : t;
|
|
671
|
+
if (!o || !o.id)
|
|
630
672
|
return {};
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
for (const
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
for (const { callback:
|
|
637
|
-
(!u || n && u.indexOf(n) !== -1) &&
|
|
673
|
+
const r = e.getResourceMeta(o.id, "eventManager"), a = {};
|
|
674
|
+
if (r && o)
|
|
675
|
+
for (const i of Object.keys(r))
|
|
676
|
+
a[i] = (s) => {
|
|
677
|
+
const f = e.get(o);
|
|
678
|
+
for (const { callback: h, scope: u } of r[i] || [])
|
|
679
|
+
(!u || n && u.indexOf(n) !== -1) && h(s, f);
|
|
638
680
|
};
|
|
639
|
-
return
|
|
681
|
+
return a;
|
|
640
682
|
}
|
|
641
683
|
};
|
|
642
684
|
}
|
|
643
|
-
function
|
|
644
|
-
const n =
|
|
645
|
-
return
|
|
685
|
+
function Ft(e, t) {
|
|
686
|
+
const n = re(), o = N(() => qt(n), [n]), r = ye(() => e && e.id ? n.getResourceMeta(e.id, "eventManager") : null, [e]);
|
|
687
|
+
return N(() => e ? o.getListenersAsProps(e, t) : {}, [r, e, n, t]);
|
|
646
688
|
}
|
|
647
|
-
function
|
|
648
|
-
const n =
|
|
649
|
-
return
|
|
689
|
+
function ze(e, t) {
|
|
690
|
+
const n = re(), o = N(() => ut(n), [n]);
|
|
691
|
+
return ye(() => {
|
|
650
692
|
if (!e)
|
|
651
693
|
return null;
|
|
652
|
-
const
|
|
653
|
-
return
|
|
694
|
+
const r = o.getAppliedStyles(e.id);
|
|
695
|
+
return r ? t ? r[t] : r : void 0;
|
|
654
696
|
}, [e, t]);
|
|
655
697
|
}
|
|
656
|
-
function
|
|
657
|
-
const { id: n, selector:
|
|
658
|
-
(
|
|
659
|
-
[
|
|
660
|
-
),
|
|
661
|
-
(
|
|
698
|
+
function Ut(e = {}, t = []) {
|
|
699
|
+
const { id: n, selector: o } = e, r = je(), a = re(), i = n || r.annotation, s = ye(
|
|
700
|
+
(h) => i ? h.iiif.entities.Annotation[i] : void 0,
|
|
701
|
+
[i]
|
|
702
|
+
), f = ye(
|
|
703
|
+
(h) => s && s.body ? s.body.map((u) => u ? u.type === "SpecificResource" ? {
|
|
662
704
|
...u,
|
|
663
|
-
source:
|
|
664
|
-
} : u ?
|
|
705
|
+
source: a.get(u)
|
|
706
|
+
} : u ? h.iiif.entities[u.type][u.id] : null : null).filter(Boolean) : [],
|
|
665
707
|
[s]
|
|
666
708
|
);
|
|
667
|
-
return
|
|
709
|
+
return N(() => {
|
|
668
710
|
if (!s)
|
|
669
711
|
return;
|
|
670
|
-
const
|
|
712
|
+
const h = {
|
|
671
713
|
...s,
|
|
672
|
-
body:
|
|
673
|
-
target:
|
|
714
|
+
body: f,
|
|
715
|
+
target: ot(s.target, { typeMap: a.getState().iiif.mapping })
|
|
674
716
|
};
|
|
675
|
-
return
|
|
676
|
-
}, [s,
|
|
717
|
+
return o ? o(h) : h;
|
|
718
|
+
}, [s, o, f, ...t]);
|
|
677
719
|
}
|
|
678
|
-
const
|
|
720
|
+
const $t = ({
|
|
679
721
|
id: e,
|
|
680
722
|
style: t,
|
|
681
723
|
className: n,
|
|
682
|
-
interactive:
|
|
724
|
+
interactive: o
|
|
683
725
|
}) => {
|
|
684
|
-
const
|
|
685
|
-
return
|
|
686
|
-
|
|
726
|
+
const r = Ut({ id: e }), a = ze(r, "atlas"), i = ze(r, "html"), s = Ft(r, ["atlas"]), f = Se(), h = N(() => xn(t, a), [t, a]);
|
|
727
|
+
return f && r && r.target && r.target.selector && r.target.selector.type === "BoxSelector" && r.target.source && (r.target.source.id === f.id || r.target.source === f.id) ? /* @__PURE__ */ d(
|
|
728
|
+
Tn,
|
|
687
729
|
{
|
|
688
|
-
id:
|
|
730
|
+
id: r.id,
|
|
689
731
|
isEditing: !0,
|
|
690
|
-
region:
|
|
691
|
-
style:
|
|
692
|
-
className: (
|
|
693
|
-
interactive: !!(
|
|
694
|
-
href: (
|
|
695
|
-
title: (
|
|
696
|
-
hrefTarget: (
|
|
732
|
+
region: r.target.selector.spatial,
|
|
733
|
+
style: h,
|
|
734
|
+
className: (i == null ? void 0 : i.className) || n,
|
|
735
|
+
interactive: !!(i != null && i.href || o),
|
|
736
|
+
href: (i == null ? void 0 : i.href) || null,
|
|
737
|
+
title: (i == null ? void 0 : i.title) || null,
|
|
738
|
+
hrefTarget: (i == null ? void 0 : i.target) || null,
|
|
697
739
|
onClick: () => {
|
|
698
740
|
},
|
|
699
741
|
...s
|
|
700
742
|
}
|
|
701
743
|
) : null;
|
|
702
744
|
};
|
|
703
|
-
function
|
|
704
|
-
const { id: n, selector:
|
|
705
|
-
(s) =>
|
|
706
|
-
[
|
|
745
|
+
function Or(e = {}, t = []) {
|
|
746
|
+
const { id: n, selector: o } = e, r = je(), a = n || r.annotationPage, i = ye(
|
|
747
|
+
(s) => a ? s.iiif.entities.AnnotationPage[a] : void 0,
|
|
748
|
+
[a]
|
|
707
749
|
);
|
|
708
|
-
return
|
|
709
|
-
if (
|
|
710
|
-
return
|
|
711
|
-
}, [
|
|
750
|
+
return N(() => {
|
|
751
|
+
if (i)
|
|
752
|
+
return o ? o(i) : i;
|
|
753
|
+
}, [i, ...t]);
|
|
712
754
|
}
|
|
713
|
-
const
|
|
755
|
+
const at = ({
|
|
714
756
|
className: e,
|
|
715
757
|
page: t
|
|
716
758
|
}) => {
|
|
717
|
-
var
|
|
718
|
-
const n =
|
|
719
|
-
return
|
|
720
|
-
|
|
759
|
+
var a;
|
|
760
|
+
const n = Or({ id: t.id }) || t, o = ze(n, "atlas"), r = ze(n, "html");
|
|
761
|
+
return ye((i) => n.id ? i.iiif.entities.AnnotationPage[n.id] : null, []), /* @__PURE__ */ d(Ye, { children: (a = n.items) == null ? void 0 : a.map((i) => /* @__PURE__ */ d(
|
|
762
|
+
$t,
|
|
721
763
|
{
|
|
722
|
-
id:
|
|
723
|
-
style:
|
|
724
|
-
className: (
|
|
764
|
+
id: i.id,
|
|
765
|
+
style: o,
|
|
766
|
+
className: (r == null ? void 0 : r.className) || e
|
|
725
767
|
},
|
|
726
|
-
|
|
768
|
+
i.id
|
|
727
769
|
)) });
|
|
728
770
|
};
|
|
729
|
-
function
|
|
771
|
+
function Wt({
|
|
730
772
|
id: e,
|
|
731
773
|
image: t,
|
|
732
774
|
thumbnail: n,
|
|
733
|
-
isStatic:
|
|
734
|
-
x:
|
|
735
|
-
y:
|
|
736
|
-
children:
|
|
775
|
+
isStatic: o,
|
|
776
|
+
x: r = 0,
|
|
777
|
+
y: a = 0,
|
|
778
|
+
children: i,
|
|
737
779
|
selector: s,
|
|
738
|
-
onClick:
|
|
739
|
-
enableSizes:
|
|
780
|
+
onClick: f,
|
|
781
|
+
enableSizes: h
|
|
740
782
|
}) {
|
|
741
|
-
var
|
|
742
|
-
const u =
|
|
783
|
+
var y, x;
|
|
784
|
+
const u = N(() => {
|
|
743
785
|
if (!(!s || s.spatial.x === 0 && s.spatial.y === 0))
|
|
744
786
|
return s.spatial;
|
|
745
787
|
}, [s]);
|
|
746
|
-
return /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ d(
|
|
747
789
|
"world-object",
|
|
748
790
|
{
|
|
749
|
-
x:
|
|
750
|
-
y:
|
|
791
|
+
x: r + t.target.spatial.x,
|
|
792
|
+
y: a + t.target.spatial.y,
|
|
751
793
|
width: t.target.spatial.width,
|
|
752
794
|
height: t.target.spatial.height,
|
|
753
|
-
onClick:
|
|
754
|
-
children: t.service ? /* @__PURE__ */
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
-
|
|
795
|
+
onClick: f,
|
|
796
|
+
children: t.service ? /* @__PURE__ */ X(Ye, { children: [
|
|
797
|
+
/* @__PURE__ */ d(
|
|
798
|
+
En,
|
|
757
799
|
{
|
|
758
800
|
tiles: {
|
|
759
801
|
id: t.service.id || t.service["@id"] || "unknown",
|
|
@@ -762,20 +804,20 @@ function We({
|
|
|
762
804
|
imageService: t.service,
|
|
763
805
|
thumbnail: n && n.type === "fixed" ? n : void 0
|
|
764
806
|
},
|
|
765
|
-
enableSizes:
|
|
807
|
+
enableSizes: h,
|
|
766
808
|
x: 0,
|
|
767
809
|
y: 0,
|
|
768
|
-
width: (
|
|
769
|
-
height: (
|
|
810
|
+
width: (y = t.target) == null ? void 0 : y.spatial.width,
|
|
811
|
+
height: (x = t.target) == null ? void 0 : x.spatial.height,
|
|
770
812
|
crop: u
|
|
771
813
|
}
|
|
772
814
|
),
|
|
773
|
-
|
|
774
|
-
] }, "service") : /* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
815
|
+
i
|
|
816
|
+
] }, "service") : /* @__PURE__ */ X(Ye, { children: [
|
|
817
|
+
/* @__PURE__ */ d(
|
|
776
818
|
"world-image",
|
|
777
819
|
{
|
|
778
|
-
onClick:
|
|
820
|
+
onClick: f,
|
|
779
821
|
uri: t.id,
|
|
780
822
|
target: { x: 0, y: 0, width: t.target.spatial.width, height: t.target.spatial.height },
|
|
781
823
|
display: t.width && t.height ? {
|
|
@@ -785,20 +827,20 @@ function We({
|
|
|
785
827
|
crop: u
|
|
786
828
|
}
|
|
787
829
|
),
|
|
788
|
-
|
|
830
|
+
i
|
|
789
831
|
] }, "no-service")
|
|
790
832
|
},
|
|
791
833
|
e + (t.service ? "server" : "no-service")
|
|
792
834
|
);
|
|
793
835
|
}
|
|
794
|
-
function
|
|
836
|
+
function So(e) {
|
|
795
837
|
return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
|
|
796
838
|
}
|
|
797
|
-
function
|
|
798
|
-
const { selector: n, source:
|
|
799
|
-
if (
|
|
800
|
-
return [null,
|
|
801
|
-
const
|
|
839
|
+
function Ht(e, t) {
|
|
840
|
+
const { selector: n, source: o } = jn(t);
|
|
841
|
+
if (o.id !== e.id)
|
|
842
|
+
return [null, o];
|
|
843
|
+
const r = {
|
|
802
844
|
type: "BoxSelector",
|
|
803
845
|
spatial: {
|
|
804
846
|
x: 0,
|
|
@@ -811,294 +853,294 @@ function Ge(e, t) {
|
|
|
811
853
|
n ? n.type === "TemporalSelector" ? {
|
|
812
854
|
type: "TemporalBoxSelector",
|
|
813
855
|
temporal: n.temporal,
|
|
814
|
-
spatial:
|
|
856
|
+
spatial: r.spatial
|
|
815
857
|
} : n : null,
|
|
816
|
-
|
|
858
|
+
o
|
|
817
859
|
];
|
|
818
860
|
}
|
|
819
|
-
const
|
|
861
|
+
const Sr = {
|
|
820
862
|
makeChoice: () => {
|
|
821
863
|
}
|
|
822
|
-
},
|
|
823
|
-
function
|
|
824
|
-
var
|
|
825
|
-
const n = (
|
|
864
|
+
}, rt = { type: "unknown" }, ne = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }), xr = (e, t) => ({ type: "empty", width: e, height: t, annotations: { pages: [] }, image: null, images: [] });
|
|
865
|
+
function Tr(e, t) {
|
|
866
|
+
var o;
|
|
867
|
+
const n = (o = e == null ? void 0 : e.iiif) == null ? void 0 : o.meta[t];
|
|
826
868
|
return n ? n.annotationPageManager : null;
|
|
827
869
|
}
|
|
828
|
-
function
|
|
829
|
-
return
|
|
870
|
+
function Er(e, t) {
|
|
871
|
+
return ye(
|
|
830
872
|
(n) => {
|
|
831
|
-
const
|
|
873
|
+
const o = [];
|
|
832
874
|
if (!e)
|
|
833
|
-
return
|
|
834
|
-
const
|
|
835
|
-
for (const
|
|
836
|
-
if (!t || t.indexOf(
|
|
837
|
-
const
|
|
838
|
-
|
|
875
|
+
return o;
|
|
876
|
+
const r = Object.keys(n.iiif.entities.AnnotationPage);
|
|
877
|
+
for (const a of r)
|
|
878
|
+
if (!t || t.indexOf(a) !== -1) {
|
|
879
|
+
const i = Tr(n, a);
|
|
880
|
+
i && i.views && i.views[e] && o.push(a);
|
|
839
881
|
}
|
|
840
|
-
return
|
|
882
|
+
return o;
|
|
841
883
|
},
|
|
842
884
|
[e, t]
|
|
843
885
|
);
|
|
844
886
|
}
|
|
845
|
-
function
|
|
887
|
+
function Ir({
|
|
846
888
|
canvas: e,
|
|
847
889
|
manifest: t,
|
|
848
890
|
all: n,
|
|
849
|
-
canvases:
|
|
891
|
+
canvases: o
|
|
850
892
|
}) {
|
|
851
|
-
const
|
|
893
|
+
const r = [];
|
|
852
894
|
if (t)
|
|
853
|
-
for (const
|
|
854
|
-
|
|
895
|
+
for (const a of t.annotations)
|
|
896
|
+
r.indexOf(a.id) === -1 && r.push(a.id);
|
|
855
897
|
if (n) {
|
|
856
|
-
if (
|
|
857
|
-
for (const
|
|
858
|
-
for (const
|
|
859
|
-
|
|
898
|
+
if (o && o.length)
|
|
899
|
+
for (const a of o)
|
|
900
|
+
for (const i of a.annotations)
|
|
901
|
+
r.indexOf(i.id) === -1 && r.push(i.id);
|
|
860
902
|
} else if (e)
|
|
861
|
-
for (const
|
|
862
|
-
|
|
863
|
-
return
|
|
903
|
+
for (const a of e.annotations)
|
|
904
|
+
r.indexOf(a.id) === -1 && r.push(a.id);
|
|
905
|
+
return r;
|
|
864
906
|
}
|
|
865
|
-
function
|
|
866
|
-
var
|
|
867
|
-
const n = (
|
|
907
|
+
function Cr(e, t) {
|
|
908
|
+
var o;
|
|
909
|
+
const n = (o = e == null ? void 0 : e.iiif) == null ? void 0 : o.meta[t];
|
|
868
910
|
return n ? n.annotationPageManager : null;
|
|
869
911
|
}
|
|
870
|
-
function
|
|
871
|
-
const n =
|
|
912
|
+
function Yt(e, t = {}) {
|
|
913
|
+
const n = re(), o = Ce(), r = Se(), a = jt(), i = N(() => Ir({
|
|
872
914
|
all: t.all,
|
|
873
|
-
manifest:
|
|
874
|
-
canvas:
|
|
875
|
-
canvases:
|
|
876
|
-
}), [t.all,
|
|
915
|
+
manifest: o,
|
|
916
|
+
canvas: r,
|
|
917
|
+
canvases: a
|
|
918
|
+
}), [t.all, r, a, o]), s = Er(e, t.all ? void 0 : i), f = Q(
|
|
877
919
|
(u) => {
|
|
878
920
|
e && n.setMetaValue(
|
|
879
921
|
[u, "annotationPageManager", "views"],
|
|
880
|
-
(
|
|
881
|
-
...
|
|
922
|
+
(y) => y && !y[e] ? y : {
|
|
923
|
+
...y || {},
|
|
882
924
|
[e]: !1
|
|
883
925
|
}
|
|
884
926
|
);
|
|
885
927
|
},
|
|
886
928
|
[e, n]
|
|
887
|
-
),
|
|
888
|
-
(u,
|
|
929
|
+
), h = Q(
|
|
930
|
+
(u, y = {}) => {
|
|
889
931
|
if (!e)
|
|
890
932
|
return;
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
893
|
-
const
|
|
894
|
-
for (const
|
|
895
|
-
const
|
|
896
|
-
|
|
933
|
+
const x = n.getState(), M = [];
|
|
934
|
+
if (y != null && y.deselectOthers) {
|
|
935
|
+
const I = Object.keys(x.iiif.entities.AnnotationPage);
|
|
936
|
+
for (const b of I) {
|
|
937
|
+
const E = Cr(x, b);
|
|
938
|
+
E && E.views && E.views[e] && M.push(b);
|
|
897
939
|
}
|
|
898
940
|
}
|
|
899
|
-
for (const
|
|
900
|
-
|
|
941
|
+
for (const I of M)
|
|
942
|
+
f(I);
|
|
901
943
|
n.setMetaValue(
|
|
902
944
|
[u, "annotationPageManager", "views"],
|
|
903
|
-
(
|
|
904
|
-
...
|
|
945
|
+
(I) => I && I[e] ? I : {
|
|
946
|
+
...I || {},
|
|
905
947
|
[e]: !0
|
|
906
948
|
}
|
|
907
949
|
);
|
|
908
950
|
},
|
|
909
|
-
[e,
|
|
951
|
+
[e, f, n]
|
|
910
952
|
);
|
|
911
953
|
return {
|
|
912
|
-
availablePageIds:
|
|
954
|
+
availablePageIds: i,
|
|
913
955
|
enabledPageIds: s,
|
|
914
|
-
setPageEnabled:
|
|
915
|
-
setPageDisabled:
|
|
956
|
+
setPageEnabled: h,
|
|
957
|
+
setPageDisabled: f
|
|
916
958
|
};
|
|
917
959
|
}
|
|
918
|
-
function
|
|
919
|
-
return
|
|
920
|
-
}
|
|
921
|
-
const
|
|
922
|
-
function
|
|
923
|
-
return
|
|
924
|
-
}
|
|
925
|
-
function
|
|
926
|
-
const e =
|
|
927
|
-
return
|
|
928
|
-
|
|
929
|
-
}, []), [
|
|
930
|
-
(
|
|
931
|
-
if (
|
|
932
|
-
const
|
|
933
|
-
id:
|
|
934
|
-
width:
|
|
935
|
-
height:
|
|
936
|
-
source:
|
|
960
|
+
function jr(e, t) {
|
|
961
|
+
return ye((n, o) => o.get(e.map((r) => ({ id: r, type: t }))), [e, t]);
|
|
962
|
+
}
|
|
963
|
+
const Mr = Ie.createContext(new Mn());
|
|
964
|
+
function Je() {
|
|
965
|
+
return ue(Mr);
|
|
966
|
+
}
|
|
967
|
+
function Rr() {
|
|
968
|
+
const e = Je(), [t, n] = ae({}), o = Ee(!1);
|
|
969
|
+
return be(() => () => {
|
|
970
|
+
o.current = !0;
|
|
971
|
+
}, []), [Q(
|
|
972
|
+
(a, { height: i, width: s }) => {
|
|
973
|
+
if (a) {
|
|
974
|
+
const f = a.id || a["@id"], h = e.loadServiceSync({
|
|
975
|
+
id: f,
|
|
976
|
+
width: a.width || s,
|
|
977
|
+
height: a.height || i,
|
|
978
|
+
source: a
|
|
937
979
|
});
|
|
938
|
-
|
|
980
|
+
h ? a = h : t[f] || (o.current || n((u) => ({
|
|
939
981
|
...u,
|
|
940
|
-
[
|
|
982
|
+
[f]: "loading"
|
|
941
983
|
})), e.loadService({
|
|
942
|
-
id:
|
|
943
|
-
width:
|
|
944
|
-
height:
|
|
984
|
+
id: f,
|
|
985
|
+
width: a.width || s,
|
|
986
|
+
height: a.height || i
|
|
945
987
|
}).then(() => {
|
|
946
|
-
|
|
988
|
+
o.current || n((u) => ({
|
|
947
989
|
...u,
|
|
948
|
-
[
|
|
990
|
+
[f]: "done"
|
|
949
991
|
}));
|
|
950
992
|
}));
|
|
951
993
|
}
|
|
952
|
-
return
|
|
994
|
+
return a;
|
|
953
995
|
},
|
|
954
996
|
[e, t]
|
|
955
997
|
), t];
|
|
956
998
|
}
|
|
957
|
-
function
|
|
958
|
-
const t =
|
|
959
|
-
return
|
|
960
|
-
(
|
|
999
|
+
function dt(e = {}) {
|
|
1000
|
+
const t = Ut(), n = Se(e.canvasId ? { id: e.canvasId } : void 0);
|
|
1001
|
+
return ye(
|
|
1002
|
+
(o, r) => {
|
|
961
1003
|
if (!n)
|
|
962
1004
|
return [];
|
|
963
1005
|
if (t && e.enableSingleAnnotation)
|
|
964
1006
|
return [t];
|
|
965
|
-
const
|
|
966
|
-
for (const s of
|
|
967
|
-
|
|
968
|
-
return
|
|
1007
|
+
const a = r.get(n.items), i = [];
|
|
1008
|
+
for (const s of a)
|
|
1009
|
+
i.push(...r.get(s.items));
|
|
1010
|
+
return i;
|
|
969
1011
|
},
|
|
970
1012
|
[n]
|
|
971
1013
|
);
|
|
972
1014
|
}
|
|
973
|
-
function
|
|
1015
|
+
function Lr(e) {
|
|
974
1016
|
return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
|
|
975
1017
|
}
|
|
976
|
-
const
|
|
1018
|
+
const He = {}, zt = {
|
|
977
1019
|
get(e) {
|
|
978
1020
|
return e;
|
|
979
1021
|
},
|
|
980
|
-
setMetaValue([e, t, n],
|
|
981
|
-
const
|
|
982
|
-
|
|
983
|
-
...
|
|
1022
|
+
setMetaValue([e, t, n], o) {
|
|
1023
|
+
const r = zt.getResourceMeta(e, t), a = r ? r[n] : void 0, i = typeof o == "function" ? o(a) : o;
|
|
1024
|
+
He[e] = {
|
|
1025
|
+
...He[e] || {},
|
|
984
1026
|
[t]: {
|
|
985
|
-
...(
|
|
986
|
-
[n]:
|
|
1027
|
+
...(He[e] || {})[t] || {},
|
|
1028
|
+
[n]: i
|
|
987
1029
|
}
|
|
988
1030
|
};
|
|
989
1031
|
},
|
|
990
1032
|
getResourceMeta: (e, t) => {
|
|
991
|
-
const n =
|
|
1033
|
+
const n = He[e];
|
|
992
1034
|
if (n)
|
|
993
1035
|
return t ? n[t] : n;
|
|
994
1036
|
}
|
|
995
1037
|
};
|
|
996
|
-
function
|
|
997
|
-
function t(
|
|
998
|
-
const
|
|
999
|
-
if (!
|
|
1038
|
+
function Ar(e = zt) {
|
|
1039
|
+
function t(r) {
|
|
1040
|
+
const a = r ? typeof r == "string" ? e.get(r) : r : null;
|
|
1041
|
+
if (!a)
|
|
1000
1042
|
return [];
|
|
1001
|
-
const
|
|
1002
|
-
for (const
|
|
1003
|
-
s.push(...e.get(
|
|
1043
|
+
const i = e.get(a.items, { parent: a }), s = [];
|
|
1044
|
+
for (const f of i)
|
|
1045
|
+
s.push(...e.get(f.items, { parent: f }));
|
|
1004
1046
|
return s;
|
|
1005
1047
|
}
|
|
1006
|
-
function n(
|
|
1007
|
-
const
|
|
1008
|
-
let
|
|
1009
|
-
const
|
|
1010
|
-
for (const u of
|
|
1048
|
+
function n(r, a = []) {
|
|
1049
|
+
const i = Array.isArray(r) ? r : t(r), s = [];
|
|
1050
|
+
let f = null;
|
|
1051
|
+
const h = [];
|
|
1052
|
+
for (const u of i) {
|
|
1011
1053
|
if (u.type !== "Annotation")
|
|
1012
1054
|
throw new Error("getPaintables() accept either a canvas or list of annotations");
|
|
1013
|
-
const
|
|
1014
|
-
for (const
|
|
1015
|
-
const [
|
|
1016
|
-
if (
|
|
1017
|
-
const
|
|
1018
|
-
A.length === 0 && A.push(
|
|
1055
|
+
const y = Array.from(Array.isArray(u.body) ? u.body : [u.body]);
|
|
1056
|
+
for (const x of y) {
|
|
1057
|
+
const [M, { selector: I }] = Lr(x), b = e.get(M), E = (b.type || "unknown").toLowerCase();
|
|
1058
|
+
if (E === "choice") {
|
|
1059
|
+
const C = e.get(b.items, { parent: b.id }), A = a.length ? a.map((S) => C.find((F) => F.id === S)).filter(Boolean) : [C[0]];
|
|
1060
|
+
A.length === 0 && A.push(C[0]), f = {
|
|
1019
1061
|
type: "single-choice",
|
|
1020
|
-
items:
|
|
1062
|
+
items: C.map((S) => ({
|
|
1021
1063
|
id: S.id,
|
|
1022
1064
|
label: S.label,
|
|
1023
1065
|
selected: A.indexOf(S) !== -1
|
|
1024
1066
|
})),
|
|
1025
|
-
label:
|
|
1026
|
-
},
|
|
1067
|
+
label: M.label
|
|
1068
|
+
}, y.push(...A);
|
|
1027
1069
|
continue;
|
|
1028
1070
|
}
|
|
1029
|
-
s.indexOf(
|
|
1030
|
-
type:
|
|
1071
|
+
s.indexOf(E) === -1 && s.push(E), h.push({
|
|
1072
|
+
type: E,
|
|
1031
1073
|
annotationId: u.id,
|
|
1032
|
-
resource:
|
|
1074
|
+
resource: b,
|
|
1033
1075
|
target: u.target,
|
|
1034
|
-
selector:
|
|
1076
|
+
selector: I
|
|
1035
1077
|
});
|
|
1036
1078
|
}
|
|
1037
1079
|
}
|
|
1038
1080
|
return {
|
|
1039
1081
|
types: s,
|
|
1040
|
-
items:
|
|
1041
|
-
choice:
|
|
1082
|
+
items: h,
|
|
1083
|
+
choice: f
|
|
1042
1084
|
};
|
|
1043
1085
|
}
|
|
1044
|
-
function r
|
|
1045
|
-
const { choice:
|
|
1046
|
-
return
|
|
1086
|
+
function o(r) {
|
|
1087
|
+
const { choice: a } = n(r);
|
|
1088
|
+
return a;
|
|
1047
1089
|
}
|
|
1048
1090
|
return {
|
|
1049
1091
|
getAllPaintingAnnotations: t,
|
|
1050
1092
|
getPaintables: n,
|
|
1051
|
-
extractChoices:
|
|
1093
|
+
extractChoices: o
|
|
1052
1094
|
};
|
|
1053
1095
|
}
|
|
1054
|
-
function
|
|
1055
|
-
const n =
|
|
1056
|
-
() =>
|
|
1057
|
-
[n,
|
|
1058
|
-
),
|
|
1059
|
-
(u, { deselectOthers:
|
|
1096
|
+
function kr(e, t = []) {
|
|
1097
|
+
const n = re(), o = N(() => Ar(n), []), r = dt({ enableSingleAnnotation: e == null ? void 0 : e.enableSingleAnnotation }), [a, i] = ae((e == null ? void 0 : e.defaultChoices) || []), s = N(
|
|
1098
|
+
() => o.getPaintables(r, a),
|
|
1099
|
+
[n, r, a, ...t]
|
|
1100
|
+
), h = { makeChoice: Q(
|
|
1101
|
+
(u, { deselectOthers: y = !0, deselect: x = !1 } = {}) => {
|
|
1060
1102
|
if (s.choice) {
|
|
1061
1103
|
if (s.choice.type !== "single-choice")
|
|
1062
1104
|
throw new Error("Complex choice not supported yet");
|
|
1063
|
-
|
|
1064
|
-
if (
|
|
1065
|
-
const
|
|
1066
|
-
if (
|
|
1067
|
-
const
|
|
1068
|
-
return
|
|
1105
|
+
i((M) => {
|
|
1106
|
+
if (x) {
|
|
1107
|
+
const b = M.filter((E) => E !== u);
|
|
1108
|
+
if (b.length === 0) {
|
|
1109
|
+
const E = s.items[0].resource.id;
|
|
1110
|
+
return E ? [E] : [];
|
|
1069
1111
|
}
|
|
1070
|
-
return
|
|
1112
|
+
return b;
|
|
1071
1113
|
}
|
|
1072
|
-
if (
|
|
1114
|
+
if (y)
|
|
1073
1115
|
return [u];
|
|
1074
|
-
const
|
|
1075
|
-
if (
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1116
|
+
const I = [...M];
|
|
1117
|
+
if (I.length === 0 && s.items.length) {
|
|
1118
|
+
const b = s.items[0].resource.id;
|
|
1119
|
+
b && I.push(b);
|
|
1078
1120
|
}
|
|
1079
|
-
return
|
|
1121
|
+
return M.indexOf(u) !== -1 ? M : [...M, u];
|
|
1080
1122
|
});
|
|
1081
1123
|
}
|
|
1082
1124
|
},
|
|
1083
1125
|
[s.choice]
|
|
1084
1126
|
) };
|
|
1085
|
-
return [s,
|
|
1127
|
+
return [s, h];
|
|
1086
1128
|
}
|
|
1087
|
-
const
|
|
1088
|
-
function
|
|
1089
|
-
const
|
|
1090
|
-
return
|
|
1129
|
+
const Nr = ["model/gltf-binary"];
|
|
1130
|
+
function Vr(e, t) {
|
|
1131
|
+
const o = t.items[0].resource;
|
|
1132
|
+
return o.format ? Nr.indexOf(o.format) === -1 ? ne(`3D format: ${o.format} is unsupported`) : {
|
|
1091
1133
|
type: "3d-model",
|
|
1092
|
-
model:
|
|
1093
|
-
} :
|
|
1134
|
+
model: o
|
|
1135
|
+
} : ne("Unknown format");
|
|
1094
1136
|
}
|
|
1095
|
-
function
|
|
1096
|
-
var
|
|
1137
|
+
function _r(e, t) {
|
|
1138
|
+
var o;
|
|
1097
1139
|
if (!e.duration)
|
|
1098
|
-
return
|
|
1140
|
+
return ne("No duration on canvas");
|
|
1099
1141
|
if (t.items.length > 1)
|
|
1100
|
-
return
|
|
1101
|
-
const n = (
|
|
1142
|
+
return ne("Only one audio source supported");
|
|
1143
|
+
const n = (o = t.items[0]) == null ? void 0 : o.resource;
|
|
1102
1144
|
return n ? n.format ? {
|
|
1103
1145
|
type: "media",
|
|
1104
1146
|
media: {
|
|
@@ -1125,18 +1167,18 @@ function Vn(e, t) {
|
|
|
1125
1167
|
annotations: {
|
|
1126
1168
|
pages: []
|
|
1127
1169
|
}
|
|
1128
|
-
} :
|
|
1129
|
-
}
|
|
1130
|
-
function
|
|
1131
|
-
const
|
|
1132
|
-
for (const
|
|
1133
|
-
const
|
|
1134
|
-
if (!
|
|
1135
|
-
return
|
|
1136
|
-
let
|
|
1137
|
-
if (
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1170
|
+
} : ne("Audio does not have format") : ne("Unknown audio");
|
|
1171
|
+
}
|
|
1172
|
+
function Dr(e, t, n) {
|
|
1173
|
+
const o = [];
|
|
1174
|
+
for (const r of t.items) {
|
|
1175
|
+
const a = r.resource && r.resource.type === "SpecificResource" ? r.resource.source : r.resource;
|
|
1176
|
+
if (!a.id)
|
|
1177
|
+
return ne("No resource Identifier");
|
|
1178
|
+
let i;
|
|
1179
|
+
if (a.service) {
|
|
1180
|
+
const M = it(a);
|
|
1181
|
+
M[0] && (i = n(M[0], e));
|
|
1140
1182
|
}
|
|
1141
1183
|
const s = {
|
|
1142
1184
|
type: "BoxSelector",
|
|
@@ -1146,20 +1188,20 @@ function Ln(e, t, n) {
|
|
|
1146
1188
|
width: Number(e.width),
|
|
1147
1189
|
height: Number(e.height)
|
|
1148
1190
|
}
|
|
1149
|
-
}, [
|
|
1150
|
-
if (
|
|
1191
|
+
}, [f, h] = Ht(e, r.target);
|
|
1192
|
+
if (!(h.id === e.id || decodeURIComponent(h.id || "") === (e.id || "")))
|
|
1151
1193
|
continue;
|
|
1152
|
-
|
|
1153
|
-
let u =
|
|
1154
|
-
if (
|
|
1155
|
-
const
|
|
1194
|
+
r.resource.width && r.resource.height && (r.resource.width, r.resource.height);
|
|
1195
|
+
let u = r.resource.type === "SpecificResource" ? ot(r.resource) : null;
|
|
1196
|
+
if (r.selector) {
|
|
1197
|
+
const M = ot({
|
|
1156
1198
|
type: "SpecificResource",
|
|
1157
|
-
source:
|
|
1158
|
-
selector:
|
|
1199
|
+
source: r.resource,
|
|
1200
|
+
selector: r.selector
|
|
1159
1201
|
});
|
|
1160
|
-
|
|
1202
|
+
M && (u = M);
|
|
1161
1203
|
}
|
|
1162
|
-
const
|
|
1204
|
+
const y = u && u.selector && (u.selector.type === "BoxSelector" || u.selector.type === "TemporalBoxSelector") ? {
|
|
1163
1205
|
type: "BoxSelector",
|
|
1164
1206
|
spatial: {
|
|
1165
1207
|
x: u.selector.spatial.x,
|
|
@@ -1168,73 +1210,73 @@ function Ln(e, t, n) {
|
|
|
1168
1210
|
height: u.selector.spatial.height
|
|
1169
1211
|
}
|
|
1170
1212
|
} : void 0;
|
|
1171
|
-
|
|
1172
|
-
const
|
|
1173
|
-
id:
|
|
1213
|
+
i && !i.id && (i.id = i["@id"]);
|
|
1214
|
+
const x = {
|
|
1215
|
+
id: a.id,
|
|
1174
1216
|
type: "Image",
|
|
1175
|
-
annotationId:
|
|
1176
|
-
width: Number(
|
|
1177
|
-
height: Number(
|
|
1178
|
-
service:
|
|
1179
|
-
sizes:
|
|
1180
|
-
target:
|
|
1181
|
-
selector:
|
|
1217
|
+
annotationId: r.annotationId,
|
|
1218
|
+
width: Number(f || y ? a.width : e.width),
|
|
1219
|
+
height: Number(f || y ? a.height : e.height),
|
|
1220
|
+
service: i,
|
|
1221
|
+
sizes: i && i.sizes ? i.sizes : a.width && a.height ? [{ width: a.width, height: a.height }] : [],
|
|
1222
|
+
target: f && f.type !== "PointSelector" ? f : s,
|
|
1223
|
+
selector: y
|
|
1182
1224
|
};
|
|
1183
|
-
|
|
1225
|
+
o.push(x);
|
|
1184
1226
|
}
|
|
1185
1227
|
return {
|
|
1186
1228
|
type: "images",
|
|
1187
|
-
image:
|
|
1188
|
-
images:
|
|
1229
|
+
image: o[0],
|
|
1230
|
+
images: o,
|
|
1189
1231
|
choice: t.choice
|
|
1190
1232
|
};
|
|
1191
1233
|
}
|
|
1192
|
-
function
|
|
1193
|
-
const
|
|
1234
|
+
function Kt(e, t = {}, n) {
|
|
1235
|
+
const o = e.language || n || "none";
|
|
1194
1236
|
switch (e.type) {
|
|
1195
1237
|
case "TextualBody": {
|
|
1196
|
-
typeof e.value < "u" && (t[
|
|
1238
|
+
typeof e.value < "u" && (t[o] = e.value);
|
|
1197
1239
|
break;
|
|
1198
1240
|
}
|
|
1199
1241
|
case "List":
|
|
1200
1242
|
case "Composite":
|
|
1201
1243
|
case "Choice":
|
|
1202
|
-
e.items && e.items.forEach((
|
|
1244
|
+
e.items && e.items.forEach((r) => Kt(r, t, o));
|
|
1203
1245
|
}
|
|
1204
1246
|
return t;
|
|
1205
1247
|
}
|
|
1206
|
-
function
|
|
1248
|
+
function Br(e, t) {
|
|
1207
1249
|
const n = [];
|
|
1208
|
-
return t.items.forEach((
|
|
1209
|
-
if (
|
|
1210
|
-
const [
|
|
1211
|
-
n.push({ annotationId:
|
|
1250
|
+
return t.items.forEach((o) => {
|
|
1251
|
+
if (o.resource) {
|
|
1252
|
+
const [r] = Ht(e, o.target);
|
|
1253
|
+
n.push({ annotationId: o.annotationId, text: Kt(o.resource), target: r });
|
|
1212
1254
|
}
|
|
1213
1255
|
}), {
|
|
1214
1256
|
type: "textual-content",
|
|
1215
1257
|
items: n
|
|
1216
1258
|
};
|
|
1217
1259
|
}
|
|
1218
|
-
const
|
|
1219
|
-
function
|
|
1260
|
+
const qr = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
|
|
1261
|
+
function Fr(e, t) {
|
|
1220
1262
|
var s;
|
|
1221
|
-
const n = t.items.filter((
|
|
1222
|
-
let
|
|
1223
|
-
if (e.duration || (
|
|
1224
|
-
return
|
|
1225
|
-
const
|
|
1226
|
-
(
|
|
1263
|
+
const n = t.items.filter((f) => f.type === "video");
|
|
1264
|
+
let o = !1;
|
|
1265
|
+
if (e.duration || (o = !0), n.length > 1)
|
|
1266
|
+
return ne("Only one video source supported");
|
|
1267
|
+
const r = (s = n[0]) == null ? void 0 : s.resource, a = !!(r.service || []).find(
|
|
1268
|
+
(f) => (f.profile || "").includes("youtube.com")
|
|
1227
1269
|
);
|
|
1228
|
-
if (!
|
|
1229
|
-
return
|
|
1230
|
-
if (!
|
|
1231
|
-
return
|
|
1232
|
-
if ((!
|
|
1233
|
-
return
|
|
1234
|
-
const
|
|
1270
|
+
if (!a && o)
|
|
1271
|
+
return ne("Video does not have duration");
|
|
1272
|
+
if (!r)
|
|
1273
|
+
return ne("Unknown video");
|
|
1274
|
+
if ((!r.format || r.format === "text/html") && !a)
|
|
1275
|
+
return ne("Video does not have format");
|
|
1276
|
+
const i = {
|
|
1235
1277
|
annotationId: t.items[0].annotationId,
|
|
1236
1278
|
duration: e.duration,
|
|
1237
|
-
url:
|
|
1279
|
+
url: r.id,
|
|
1238
1280
|
type: "Video",
|
|
1239
1281
|
items: [],
|
|
1240
1282
|
target: {
|
|
@@ -1244,7 +1286,7 @@ function Fn(e, t) {
|
|
|
1244
1286
|
endTime: e.duration
|
|
1245
1287
|
}
|
|
1246
1288
|
},
|
|
1247
|
-
format:
|
|
1289
|
+
format: r.format,
|
|
1248
1290
|
selector: {
|
|
1249
1291
|
type: "TemporalSelector",
|
|
1250
1292
|
temporal: {
|
|
@@ -1253,77 +1295,77 @@ function Fn(e, t) {
|
|
|
1253
1295
|
}
|
|
1254
1296
|
}
|
|
1255
1297
|
};
|
|
1256
|
-
if (
|
|
1257
|
-
|
|
1258
|
-
const
|
|
1259
|
-
if (!
|
|
1260
|
-
return
|
|
1261
|
-
|
|
1298
|
+
if (a) {
|
|
1299
|
+
i.type = "VideoYouTube";
|
|
1300
|
+
const f = r.id.match(qr);
|
|
1301
|
+
if (!f[1])
|
|
1302
|
+
return ne("Video is not known youtube video");
|
|
1303
|
+
i.youTubeId = f[1];
|
|
1262
1304
|
}
|
|
1263
1305
|
return {
|
|
1264
1306
|
type: "media",
|
|
1265
|
-
media:
|
|
1307
|
+
media: i,
|
|
1266
1308
|
annotations: {
|
|
1267
1309
|
pages: []
|
|
1268
1310
|
}
|
|
1269
1311
|
};
|
|
1270
1312
|
}
|
|
1271
|
-
function
|
|
1313
|
+
function Ur({ canvas: e, paintables: t, supports: n, loadImageService: o }) {
|
|
1272
1314
|
if (!e)
|
|
1273
|
-
return console.log("No canvas"),
|
|
1315
|
+
return console.log("No canvas"), rt;
|
|
1274
1316
|
if (t.types.length === 0)
|
|
1275
|
-
return n.indexOf("empty") !== -1 ?
|
|
1317
|
+
return n.indexOf("empty") !== -1 ? xr(e.width, e.height) : (console.log("No paintables"), rt);
|
|
1276
1318
|
if (t.types.length !== 1)
|
|
1277
1319
|
if (t.types.length === 2 && t.types.indexOf("text") !== -1)
|
|
1278
|
-
t.types = t.types.filter((
|
|
1320
|
+
t.types = t.types.filter((a) => a !== "text");
|
|
1279
1321
|
else
|
|
1280
|
-
return n.indexOf("complex-timeline") === -1 ?
|
|
1281
|
-
const
|
|
1282
|
-
return
|
|
1322
|
+
return n.indexOf("complex-timeline") === -1 ? ne("Complex timeline not supported") : ne("ComplexTimelineStrategy not yet supported");
|
|
1323
|
+
const r = t.types[0];
|
|
1324
|
+
return r === "image" ? n.indexOf("images") === -1 ? ne("Image not supported") : Dr(e, t, o) : r === "Model" || r === "model" ? n.indexOf("3d-model") === -1 ? ne("3D not supported") : Vr(e, t) : r === "textualbody" ? n.indexOf("textual-content") === -1 ? ne("Textual content not supported") : Br(e, t) : r === "sound" || r === "audio" ? n.indexOf("media") === -1 ? ne("Media not supported") : _r(e, t) : r === "video" ? n.indexOf("media") === -1 ? ne("Media not supported") : Fr(e, t) : rt;
|
|
1283
1325
|
}
|
|
1284
|
-
function
|
|
1285
|
-
const t =
|
|
1326
|
+
function $r(e) {
|
|
1327
|
+
const t = Ce(), n = Se(), o = re(), [r, a] = Rr(), { enabledPageIds: i } = Yt((e == null ? void 0 : e.annotationPageManagerId) || (t == null ? void 0 : t.id) || (n == null ? void 0 : n.id), {
|
|
1286
1328
|
all: !1
|
|
1287
|
-
}), s =
|
|
1329
|
+
}), s = jr(i, "AnnotationPage"), f = (e == null ? void 0 : e.strategies) || [
|
|
1288
1330
|
"empty",
|
|
1289
1331
|
"images",
|
|
1290
1332
|
"media",
|
|
1291
1333
|
"textual-content",
|
|
1292
1334
|
"complex-timeline"
|
|
1293
|
-
], [
|
|
1294
|
-
return
|
|
1335
|
+
], [h, u] = kr(e, [a]), y = N(() => Ur({ canvas: n, paintables: h, supports: f, loadImageService: r }), [n, h, o, u.makeChoice]);
|
|
1336
|
+
return N(() => y.type === "unknown" ? [y, Sr] : [
|
|
1295
1337
|
{
|
|
1296
|
-
...
|
|
1338
|
+
...y,
|
|
1297
1339
|
annotations: { pages: s }
|
|
1298
1340
|
},
|
|
1299
1341
|
u
|
|
1300
|
-
], [
|
|
1342
|
+
], [y, s]);
|
|
1301
1343
|
}
|
|
1302
|
-
const
|
|
1303
|
-
const n =
|
|
1304
|
-
|
|
1344
|
+
const Wr = (e, t = []) => {
|
|
1345
|
+
const n = re();
|
|
1346
|
+
be(() => {
|
|
1305
1347
|
e(n);
|
|
1306
1348
|
}, [n, ...t]);
|
|
1307
1349
|
};
|
|
1308
|
-
function
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1311
|
-
|
|
1312
|
-
}), []), !
|
|
1350
|
+
function Qt(e, t, { canvasId: n, manifestId: o } = {}) {
|
|
1351
|
+
const r = re(), a = Je(), i = N(() => An(r, { imageServiceLoader: a }), [r, a]), [s, f] = ae(), h = Ce(o ? { id: o } : void 0), u = Se(n ? { id: n } : void 0), y = u || h, x = Ee(!1);
|
|
1352
|
+
if (be(() => (x.current = !1, () => {
|
|
1353
|
+
x.current = !0;
|
|
1354
|
+
}), []), !y)
|
|
1313
1355
|
throw new Error("Must be called under a manifest or canvas context.");
|
|
1314
|
-
return
|
|
1315
|
-
(
|
|
1316
|
-
|
|
1317
|
-
|
|
1356
|
+
return Wr(
|
|
1357
|
+
(M) => {
|
|
1358
|
+
i.getBestThumbnailAtSize(y, e, t).then((I) => {
|
|
1359
|
+
I.best && !x.current && f(I.best);
|
|
1318
1360
|
});
|
|
1319
1361
|
},
|
|
1320
|
-
[
|
|
1362
|
+
[y]
|
|
1321
1363
|
), s;
|
|
1322
1364
|
}
|
|
1323
|
-
function
|
|
1365
|
+
function Hr(e) {
|
|
1324
1366
|
return { isMuted: !1, playRequested: !1, isPlaying: !1, isFinished: !1, volume: 100, duration: e };
|
|
1325
1367
|
}
|
|
1326
|
-
function
|
|
1368
|
+
function Yr(e, t) {
|
|
1327
1369
|
switch (t.type) {
|
|
1328
1370
|
case "FINISHED":
|
|
1329
1371
|
return { ...e, isFinished: !0, isPlaying: !1, playRequested: !1 };
|
|
@@ -1346,120 +1388,120 @@ function qn(e, t) {
|
|
|
1346
1388
|
}
|
|
1347
1389
|
return e;
|
|
1348
1390
|
}
|
|
1349
|
-
function
|
|
1391
|
+
function zr(e) {
|
|
1350
1392
|
const t = Math.round(e);
|
|
1351
1393
|
return `${Math.floor(t / 60)}:${`${t % 60}`.padStart(2, "0")}`;
|
|
1352
1394
|
}
|
|
1353
|
-
function
|
|
1354
|
-
const [t, n] =
|
|
1355
|
-
|
|
1356
|
-
}, [e.duration]),
|
|
1357
|
-
|
|
1395
|
+
function pt(e) {
|
|
1396
|
+
const [t, n] = Pn(Yr, Hr(e.duration)), o = Ee(null), r = Ee(null), a = Ee(null), i = Ee(!1), s = Q(() => {
|
|
1397
|
+
r.current && o.current && (r.current.innerHTML = zr(o.current.currentTime), a.current && (a.current.style.width = `${o.current.currentTime / e.duration * 100}%`), i.current !== o.current.muted && (i.current = o.current.muted, n(o.current.muted ? { type: "MUTE" } : { type: "UNMUTE" })));
|
|
1398
|
+
}, [e.duration]), f = Q(() => {
|
|
1399
|
+
o.current && (n({ type: "PLAY_REQUESTED" }), o.current.play().then(() => {
|
|
1358
1400
|
n({ type: "PLAY" });
|
|
1359
1401
|
}), s());
|
|
1360
|
-
}, [s]),
|
|
1361
|
-
|
|
1362
|
-
}, [s]), u =
|
|
1363
|
-
|
|
1364
|
-
}, [s]),
|
|
1365
|
-
|
|
1366
|
-
}, []),
|
|
1367
|
-
|
|
1368
|
-
}, []),
|
|
1369
|
-
|
|
1370
|
-
}, []),
|
|
1371
|
-
|
|
1372
|
-
}, []),
|
|
1373
|
-
|
|
1374
|
-
}, []),
|
|
1375
|
-
|
|
1402
|
+
}, [s]), h = Q(() => {
|
|
1403
|
+
o.current && (o.current.duration > 0 && o.current.paused ? f() : u());
|
|
1404
|
+
}, [s]), u = Q(() => {
|
|
1405
|
+
o.current && (o.current.pause(), n({ type: "PAUSE" }), s());
|
|
1406
|
+
}, [s]), y = Q(() => {
|
|
1407
|
+
o.current && (o.current.muted = !o.current.muted, n(o.current.muted ? { type: "MUTE" } : { type: "UNMUTE" }));
|
|
1408
|
+
}, []), x = Q(() => {
|
|
1409
|
+
o.current && (o.current.muted = !0, n({ type: "MUTE" }));
|
|
1410
|
+
}, []), M = Q(() => {
|
|
1411
|
+
o.current && (o.current.muted = !1, n({ type: "UNMUTE" }));
|
|
1412
|
+
}, []), I = Q((C) => {
|
|
1413
|
+
o.current && (o.current.muted = !1, o.current.volume = C / 100, n({ type: "SET_VOLUME", volume: C }));
|
|
1414
|
+
}, []), b = Q((C) => {
|
|
1415
|
+
o.current && (o.current.currentTime = Math.max(0, Math.min(C * e.duration, e.duration)), s());
|
|
1416
|
+
}, []), E = Q((C) => {
|
|
1417
|
+
o.current && (o.current.currentTime = Math.max(0, Math.min(C, e.duration)), s());
|
|
1376
1418
|
}, []);
|
|
1377
|
-
return
|
|
1378
|
-
const
|
|
1419
|
+
return be(() => {
|
|
1420
|
+
const C = setInterval(() => {
|
|
1379
1421
|
s();
|
|
1380
1422
|
}, 350);
|
|
1381
|
-
return () => clearInterval(
|
|
1382
|
-
}, [s, e.duration]),
|
|
1383
|
-
const
|
|
1423
|
+
return () => clearInterval(C);
|
|
1424
|
+
}, [s, e.duration]), be(() => {
|
|
1425
|
+
const C = () => {
|
|
1384
1426
|
n({ type: "FINISHED" });
|
|
1385
|
-
}, A =
|
|
1386
|
-
return A == null || A.addEventListener("ended",
|
|
1427
|
+
}, A = o.current;
|
|
1428
|
+
return A == null || A.addEventListener("ended", C), () => A == null ? void 0 : A.removeEventListener("ended", C);
|
|
1387
1429
|
}, []), [
|
|
1388
|
-
{ element:
|
|
1430
|
+
{ element: o, currentTime: r, progress: a },
|
|
1389
1431
|
t,
|
|
1390
1432
|
{
|
|
1391
|
-
play:
|
|
1433
|
+
play: f,
|
|
1392
1434
|
pause: u,
|
|
1393
|
-
playPause:
|
|
1394
|
-
mute:
|
|
1395
|
-
unmute:
|
|
1396
|
-
toggleMute:
|
|
1397
|
-
setVolume:
|
|
1398
|
-
setDurationPercent:
|
|
1399
|
-
setTime:
|
|
1435
|
+
playPause: h,
|
|
1436
|
+
mute: x,
|
|
1437
|
+
unmute: M,
|
|
1438
|
+
toggleMute: y,
|
|
1439
|
+
setVolume: I,
|
|
1440
|
+
setDurationPercent: b,
|
|
1441
|
+
setTime: E
|
|
1400
1442
|
}
|
|
1401
1443
|
];
|
|
1402
1444
|
}
|
|
1403
|
-
const
|
|
1404
|
-
function
|
|
1405
|
-
const e =
|
|
1445
|
+
const Gt = xe(null), Xt = xe(null), Jt = xe(null);
|
|
1446
|
+
function xo() {
|
|
1447
|
+
const e = ue(Gt);
|
|
1406
1448
|
if (!e)
|
|
1407
1449
|
throw new Error("Ctx not found");
|
|
1408
1450
|
return e;
|
|
1409
1451
|
}
|
|
1410
|
-
function
|
|
1411
|
-
const e =
|
|
1452
|
+
function To() {
|
|
1453
|
+
const e = ue(Xt);
|
|
1412
1454
|
if (!e)
|
|
1413
1455
|
throw new Error("Ctx not found");
|
|
1414
1456
|
return e;
|
|
1415
1457
|
}
|
|
1416
|
-
function
|
|
1417
|
-
const e =
|
|
1458
|
+
function Eo() {
|
|
1459
|
+
const e = ue(Jt);
|
|
1418
1460
|
if (!e)
|
|
1419
1461
|
throw new Error("Ctx not found");
|
|
1420
1462
|
return e;
|
|
1421
1463
|
}
|
|
1422
|
-
function
|
|
1464
|
+
function Zt({
|
|
1423
1465
|
actions: e,
|
|
1424
1466
|
state: t,
|
|
1425
1467
|
children: n,
|
|
1426
|
-
currentTime:
|
|
1427
|
-
progress:
|
|
1428
|
-
element:
|
|
1468
|
+
currentTime: o,
|
|
1469
|
+
progress: r,
|
|
1470
|
+
element: a
|
|
1429
1471
|
}) {
|
|
1430
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ d(Jt.Provider, { value: { currentTime: o, progress: r, element: a }, children: /* @__PURE__ */ d(Xt.Provider, { value: e, children: /* @__PURE__ */ d(Gt.Provider, { value: t, children: n }) }) });
|
|
1431
1473
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const [{ element: n, currentTime:
|
|
1434
|
-
return /* @__PURE__ */
|
|
1435
|
-
|
|
1474
|
+
function en({ media: e, children: t }) {
|
|
1475
|
+
const [{ element: n, currentTime: o, progress: r }, a, i] = pt({ duration: e.duration });
|
|
1476
|
+
return /* @__PURE__ */ X(
|
|
1477
|
+
Zt,
|
|
1436
1478
|
{
|
|
1437
|
-
state:
|
|
1438
|
-
actions:
|
|
1439
|
-
currentTime:
|
|
1440
|
-
progress:
|
|
1479
|
+
state: a,
|
|
1480
|
+
actions: i,
|
|
1481
|
+
currentTime: o,
|
|
1482
|
+
progress: r,
|
|
1441
1483
|
element: n,
|
|
1442
1484
|
children: [
|
|
1443
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ d("audio", { ref: n, src: e.url }),
|
|
1444
1486
|
t
|
|
1445
1487
|
]
|
|
1446
1488
|
}
|
|
1447
1489
|
);
|
|
1448
1490
|
}
|
|
1449
|
-
function
|
|
1491
|
+
function tn({
|
|
1450
1492
|
media: e,
|
|
1451
1493
|
mediaControlsDeps: t,
|
|
1452
1494
|
children: n
|
|
1453
1495
|
}) {
|
|
1454
|
-
return
|
|
1496
|
+
return Ve("portal", "audio", en, { media: e, children: n }, [e, ...t || []]), null;
|
|
1455
1497
|
}
|
|
1456
|
-
function
|
|
1498
|
+
function nn({
|
|
1457
1499
|
element: e,
|
|
1458
1500
|
media: t,
|
|
1459
1501
|
playPause: n
|
|
1460
1502
|
}) {
|
|
1461
|
-
return /* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ X("div", { className: "video-container", part: "video-container", onClick: n, children: [
|
|
1504
|
+
/* @__PURE__ */ d("style", { children: `
|
|
1463
1505
|
.video-container {
|
|
1464
1506
|
position: absolute;
|
|
1465
1507
|
top: 0;
|
|
@@ -1473,37 +1515,37 @@ function it({
|
|
|
1473
1515
|
pointer-events: visible;
|
|
1474
1516
|
}
|
|
1475
1517
|
` }),
|
|
1476
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ d("video", { ref: e, src: t.url, style: { width: "100%", objectFit: "contain" } })
|
|
1477
1519
|
] });
|
|
1478
1520
|
}
|
|
1479
|
-
function
|
|
1521
|
+
function rn({
|
|
1480
1522
|
media: e,
|
|
1481
1523
|
mediaControlsDeps: t,
|
|
1482
1524
|
children: n
|
|
1483
1525
|
}) {
|
|
1484
|
-
const [{ element:
|
|
1485
|
-
return
|
|
1486
|
-
element:
|
|
1526
|
+
const [{ element: o, currentTime: r, progress: a }, i, s] = pt({ duration: e.duration });
|
|
1527
|
+
return Ve("overlay", "video-element", nn, {
|
|
1528
|
+
element: o,
|
|
1487
1529
|
media: e,
|
|
1488
1530
|
playPause: s.playPause
|
|
1489
|
-
}),
|
|
1531
|
+
}), Ve(
|
|
1490
1532
|
"portal",
|
|
1491
1533
|
"custom-controls",
|
|
1492
|
-
|
|
1534
|
+
Zt,
|
|
1493
1535
|
{
|
|
1494
|
-
state:
|
|
1536
|
+
state: i,
|
|
1495
1537
|
actions: s,
|
|
1496
|
-
currentTime:
|
|
1497
|
-
progress:
|
|
1498
|
-
element:
|
|
1538
|
+
currentTime: r,
|
|
1539
|
+
progress: a,
|
|
1540
|
+
element: o,
|
|
1499
1541
|
children: n
|
|
1500
1542
|
},
|
|
1501
|
-
[
|
|
1543
|
+
[r, i, e, ...t || []]
|
|
1502
1544
|
), null;
|
|
1503
1545
|
}
|
|
1504
|
-
function
|
|
1505
|
-
return /* @__PURE__ */
|
|
1506
|
-
/* @__PURE__ */
|
|
1546
|
+
function on({ model: e }) {
|
|
1547
|
+
return /* @__PURE__ */ X(Oe, { children: [
|
|
1548
|
+
/* @__PURE__ */ d("style", { children: `
|
|
1507
1549
|
.model-container {
|
|
1508
1550
|
position: absolute;
|
|
1509
1551
|
top: 0;
|
|
@@ -1517,7 +1559,7 @@ function at({ model: e }) {
|
|
|
1517
1559
|
pointer-events: visible;
|
|
1518
1560
|
}
|
|
1519
1561
|
` }),
|
|
1520
|
-
/* @__PURE__ */
|
|
1562
|
+
/* @__PURE__ */ d("div", { className: "model-container", children: /* @__PURE__ */ d(
|
|
1521
1563
|
"model-viewer",
|
|
1522
1564
|
{
|
|
1523
1565
|
"interaction-prompt": "none",
|
|
@@ -1529,12 +1571,12 @@ function at({ model: e }) {
|
|
|
1529
1571
|
) })
|
|
1530
1572
|
] });
|
|
1531
1573
|
}
|
|
1532
|
-
function
|
|
1533
|
-
return
|
|
1574
|
+
function an({ model: e, name: t }) {
|
|
1575
|
+
return Ve("overlay", `model-${t}`, on, { model: e }, [e]), null;
|
|
1534
1576
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const t =
|
|
1537
|
-
return !t || !t.height || !t.width ? null : /* @__PURE__ */
|
|
1577
|
+
function sn({ style: e }) {
|
|
1578
|
+
const t = Se();
|
|
1579
|
+
return !t || !t.height || !t.width ? null : /* @__PURE__ */ d(
|
|
1538
1580
|
"box",
|
|
1539
1581
|
{
|
|
1540
1582
|
interactive: !1,
|
|
@@ -1543,104 +1585,111 @@ function ct({ style: e }) {
|
|
|
1543
1585
|
}
|
|
1544
1586
|
);
|
|
1545
1587
|
}
|
|
1546
|
-
const
|
|
1547
|
-
function
|
|
1548
|
-
return /* @__PURE__ */
|
|
1588
|
+
const cn = Ie.createContext("en");
|
|
1589
|
+
function Io(e) {
|
|
1590
|
+
return /* @__PURE__ */ d(cn.Provider, { value: e.language, children: e.children });
|
|
1549
1591
|
}
|
|
1550
|
-
function
|
|
1551
|
-
return
|
|
1592
|
+
function ht() {
|
|
1593
|
+
return Ie.useContext(cn);
|
|
1552
1594
|
}
|
|
1553
|
-
function
|
|
1595
|
+
function xt(e) {
|
|
1554
1596
|
return e.indexOf("-") !== -1 ? e.slice(0, e.indexOf("-")) : e;
|
|
1555
1597
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const
|
|
1558
|
-
return
|
|
1598
|
+
function Kr({ as: e, language: t, children: n, viewingDirection: o, ...r }) {
|
|
1599
|
+
const a = ht();
|
|
1600
|
+
return N(() => xt(a) === xt(t), [a, t]) ? e ? /* @__PURE__ */ d(e, { ...r, children: n }) : /* @__PURE__ */ d("span", { ...r, children: n }) : e ? /* @__PURE__ */ d(e, { ...r, lang: t, dir: o, children: n }) : /* @__PURE__ */ d("span", { ...r, lang: t, dir: o, children: n });
|
|
1559
1601
|
}
|
|
1560
|
-
function
|
|
1602
|
+
function un(e, t, n) {
|
|
1561
1603
|
if (t.length === 0)
|
|
1562
1604
|
return;
|
|
1563
1605
|
if (t.length === 1)
|
|
1564
1606
|
return t[0];
|
|
1565
1607
|
if (t.indexOf(e) !== -1)
|
|
1566
1608
|
return e;
|
|
1567
|
-
const
|
|
1568
|
-
if (
|
|
1569
|
-
return
|
|
1570
|
-
for (const
|
|
1571
|
-
if (t.indexOf(
|
|
1572
|
-
return
|
|
1609
|
+
const o = e.indexOf("-") !== -1 ? e.slice(0, e.indexOf("-")) : null;
|
|
1610
|
+
if (o && t.indexOf(o) !== -1)
|
|
1611
|
+
return o;
|
|
1612
|
+
for (const r of n)
|
|
1613
|
+
if (t.indexOf(r) !== -1)
|
|
1614
|
+
return r;
|
|
1573
1615
|
return t.indexOf("none") !== -1 ? "none" : t.indexOf("@none") !== -1 ? "@none" : t[0];
|
|
1574
1616
|
}
|
|
1575
|
-
const
|
|
1576
|
-
const n =
|
|
1577
|
-
return
|
|
1578
|
-
const
|
|
1579
|
-
return
|
|
1617
|
+
const Qr = (e, t = []) => {
|
|
1618
|
+
const n = ht();
|
|
1619
|
+
return N(() => {
|
|
1620
|
+
const o = e();
|
|
1621
|
+
return un(n, o, []);
|
|
1580
1622
|
}, [n, ...t]);
|
|
1581
1623
|
};
|
|
1582
|
-
function
|
|
1583
|
-
|
|
1624
|
+
function Gr(e, t, n = `
|
|
1625
|
+
`) {
|
|
1626
|
+
const o = Qr(() => Object.keys(e || {}), [e]);
|
|
1584
1627
|
return [
|
|
1585
|
-
|
|
1628
|
+
N(() => {
|
|
1586
1629
|
if (!e)
|
|
1587
1630
|
return t || "";
|
|
1588
1631
|
if (typeof e == "string")
|
|
1589
1632
|
return e;
|
|
1590
|
-
const r =
|
|
1591
|
-
return r ? typeof r == "string" ? r : r.join(
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
n
|
|
1633
|
+
const r = o ? e[o] : void 0;
|
|
1634
|
+
return r ? typeof r == "string" ? r : r.join(n) : "";
|
|
1635
|
+
}, [o, t, e]),
|
|
1636
|
+
o
|
|
1595
1637
|
];
|
|
1596
1638
|
}
|
|
1597
|
-
function
|
|
1598
|
-
const e =
|
|
1599
|
-
return function(n,
|
|
1600
|
-
const
|
|
1639
|
+
function Co() {
|
|
1640
|
+
const e = ht();
|
|
1641
|
+
return function(n, o, r) {
|
|
1642
|
+
const a = Object.keys(n || {}), i = un(e, a, []);
|
|
1601
1643
|
if (!n)
|
|
1602
|
-
return
|
|
1644
|
+
return o || "";
|
|
1603
1645
|
if (typeof n == "string")
|
|
1604
1646
|
return n;
|
|
1605
|
-
const s =
|
|
1606
|
-
return s ? typeof s == "string" ? s : s.join(typeof
|
|
1647
|
+
const s = i ? n[i] : void 0;
|
|
1648
|
+
return s ? typeof s == "string" ? s : s.join(typeof r < "u" ? r : `
|
|
1607
1649
|
`) : "";
|
|
1608
1650
|
};
|
|
1609
1651
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1652
|
+
function Ne({
|
|
1653
|
+
as: e,
|
|
1654
|
+
defaultText: t,
|
|
1655
|
+
enableDangerouslySetInnerHTML: n,
|
|
1656
|
+
children: o,
|
|
1657
|
+
separator: r,
|
|
1658
|
+
...a
|
|
1659
|
+
}) {
|
|
1660
|
+
const [i, s] = Gr(o, t, r);
|
|
1661
|
+
return s ? /* @__PURE__ */ d(
|
|
1662
|
+
Kr,
|
|
1614
1663
|
{
|
|
1615
|
-
...
|
|
1664
|
+
...a,
|
|
1616
1665
|
as: e,
|
|
1617
|
-
language:
|
|
1618
|
-
title: n ? void 0 :
|
|
1666
|
+
language: s,
|
|
1667
|
+
title: n ? void 0 : i,
|
|
1619
1668
|
dangerouslySetInnerHTML: n ? {
|
|
1620
|
-
__html:
|
|
1669
|
+
__html: i
|
|
1621
1670
|
} : void 0,
|
|
1622
|
-
children: n ? void 0 :
|
|
1671
|
+
children: n ? void 0 : i
|
|
1623
1672
|
}
|
|
1624
|
-
) : e ? /* @__PURE__ */
|
|
1673
|
+
) : e ? /* @__PURE__ */ d(e, { ...a, children: i }) : /* @__PURE__ */ d(
|
|
1625
1674
|
"span",
|
|
1626
1675
|
{
|
|
1627
|
-
...
|
|
1628
|
-
title: n ? void 0 :
|
|
1676
|
+
...a,
|
|
1677
|
+
title: n ? void 0 : i,
|
|
1629
1678
|
dangerouslySetInnerHTML: n ? {
|
|
1630
|
-
__html:
|
|
1679
|
+
__html: i
|
|
1631
1680
|
} : void 0,
|
|
1632
|
-
children: n ? void 0 :
|
|
1681
|
+
children: n ? void 0 : i
|
|
1633
1682
|
}
|
|
1634
1683
|
);
|
|
1635
|
-
}
|
|
1636
|
-
function
|
|
1684
|
+
}
|
|
1685
|
+
function Xr({
|
|
1637
1686
|
element: e,
|
|
1638
1687
|
media: t,
|
|
1639
1688
|
playPause: n
|
|
1640
1689
|
}) {
|
|
1641
|
-
const
|
|
1642
|
-
return t.youTubeId ? /* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1690
|
+
const o = Ee(null);
|
|
1691
|
+
return t.youTubeId ? /* @__PURE__ */ X("div", { className: "video-container", part: "video-container", onClick: n, children: [
|
|
1692
|
+
/* @__PURE__ */ d("style", { children: `
|
|
1644
1693
|
.video-container {
|
|
1645
1694
|
position: absolute;
|
|
1646
1695
|
top: 0;
|
|
@@ -1659,11 +1708,11 @@ function Kn({
|
|
|
1659
1708
|
object-fit: contain;
|
|
1660
1709
|
}
|
|
1661
1710
|
` }),
|
|
1662
|
-
/* @__PURE__ */
|
|
1711
|
+
/* @__PURE__ */ d(
|
|
1663
1712
|
"iframe",
|
|
1664
1713
|
{
|
|
1665
1714
|
className: "video-yt",
|
|
1666
|
-
ref:
|
|
1715
|
+
ref: o,
|
|
1667
1716
|
src: `https://www.youtube.com/embed/${t.youTubeId}?enablejsapi=1&origin=${window.location.host}`,
|
|
1668
1717
|
referrerPolicy: "no-referrer",
|
|
1669
1718
|
sandbox: "allow-scripts allow-same-origin allow-presentation"
|
|
@@ -1671,328 +1720,1487 @@ function Kn({
|
|
|
1671
1720
|
)
|
|
1672
1721
|
] }) : null;
|
|
1673
1722
|
}
|
|
1674
|
-
function
|
|
1723
|
+
function Jr({
|
|
1675
1724
|
media: e,
|
|
1676
1725
|
mediaControlsDeps: t,
|
|
1677
1726
|
children: n
|
|
1678
1727
|
}) {
|
|
1679
|
-
const [{ element:
|
|
1680
|
-
return
|
|
1681
|
-
element:
|
|
1728
|
+
const [{ element: o, currentTime: r, progress: a }, i, s] = pt({ duration: e.duration });
|
|
1729
|
+
return Ve("overlay", "video-element", Xr, {
|
|
1730
|
+
element: o,
|
|
1682
1731
|
media: e,
|
|
1683
1732
|
playPause: s.playPause
|
|
1684
1733
|
}), null;
|
|
1685
1734
|
}
|
|
1686
|
-
function
|
|
1735
|
+
function ln({
|
|
1687
1736
|
x: e,
|
|
1688
1737
|
y: t,
|
|
1689
1738
|
onChoiceChange: n,
|
|
1690
|
-
registerActions:
|
|
1691
|
-
defaultChoices:
|
|
1692
|
-
isStatic:
|
|
1693
|
-
renderViewerControls:
|
|
1739
|
+
registerActions: o,
|
|
1740
|
+
defaultChoices: r,
|
|
1741
|
+
isStatic: a,
|
|
1742
|
+
renderViewerControls: i,
|
|
1694
1743
|
renderMediaControls: s,
|
|
1695
|
-
viewControlsDeps:
|
|
1696
|
-
mediaControlsDeps:
|
|
1744
|
+
viewControlsDeps: f,
|
|
1745
|
+
mediaControlsDeps: h,
|
|
1697
1746
|
strategies: u,
|
|
1698
|
-
throwOnUnknown:
|
|
1699
|
-
backgroundStyle:
|
|
1700
|
-
alwaysShowBackground:
|
|
1701
|
-
keepCanvasScale:
|
|
1702
|
-
enableSizes:
|
|
1703
|
-
enableYouTube:
|
|
1704
|
-
onClickPaintingAnnotation:
|
|
1747
|
+
throwOnUnknown: y,
|
|
1748
|
+
backgroundStyle: x,
|
|
1749
|
+
alwaysShowBackground: M,
|
|
1750
|
+
keepCanvasScale: I = !1,
|
|
1751
|
+
enableSizes: b = !1,
|
|
1752
|
+
enableYouTube: E = !0,
|
|
1753
|
+
onClickPaintingAnnotation: C,
|
|
1705
1754
|
children: A
|
|
1706
1755
|
}) {
|
|
1707
|
-
const S =
|
|
1756
|
+
const S = Se(), F = Ft(S, ["deep-zoom"]), [L] = gr(), R = br(), B = re(), j = N(() => ut(B), [B]), [O, U] = $r({
|
|
1708
1757
|
strategies: u || ["images"],
|
|
1709
|
-
defaultChoices:
|
|
1710
|
-
}),
|
|
1758
|
+
defaultChoices: r == null ? void 0 : r.map(({ id: V }) => V)
|
|
1759
|
+
}), H = O.type === "images" ? O.choice : void 0, G = N(() => I ? 1 : Math.max(
|
|
1711
1760
|
1,
|
|
1712
|
-
...
|
|
1713
|
-
var
|
|
1714
|
-
return (
|
|
1761
|
+
...O.type === "images" ? O.images.map((V) => {
|
|
1762
|
+
var te;
|
|
1763
|
+
return (V.width || 0) / ((te = V.target) == null ? void 0 : te.spatial.width);
|
|
1715
1764
|
}) : []
|
|
1716
|
-
), [
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
}, [
|
|
1720
|
-
if (
|
|
1721
|
-
for (const
|
|
1722
|
-
typeof
|
|
1723
|
-
opacity:
|
|
1765
|
+
), [I, O]);
|
|
1766
|
+
wr(G), be(() => {
|
|
1767
|
+
o && o(U);
|
|
1768
|
+
}, [O.annotations]), be(() => {
|
|
1769
|
+
if (r)
|
|
1770
|
+
for (const V of r)
|
|
1771
|
+
typeof V.opacity < "u" && j.applyStyles({ id: V.id }, "atlas", {
|
|
1772
|
+
opacity: V.opacity
|
|
1724
1773
|
});
|
|
1725
|
-
}, [
|
|
1726
|
-
n && n(
|
|
1727
|
-
}, [
|
|
1728
|
-
|
|
1774
|
+
}, [r]), st(() => {
|
|
1775
|
+
n && n(H);
|
|
1776
|
+
}, [H]), Ve(
|
|
1777
|
+
R && (O.type === "images" || O.type === "empty" || O.type === "textual-content" && i) ? "overlay" : "none",
|
|
1729
1778
|
`canvas-portal-controls-${S == null ? void 0 : S.id}`,
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
value:
|
|
1733
|
-
children:
|
|
1779
|
+
ft.Provider,
|
|
1780
|
+
i ? {
|
|
1781
|
+
value: R || null,
|
|
1782
|
+
children: i(O)
|
|
1734
1783
|
} : {},
|
|
1735
|
-
[S,
|
|
1784
|
+
[S, R, O, ...f || []]
|
|
1736
1785
|
);
|
|
1737
|
-
const
|
|
1786
|
+
const Y = Qt({ maxWidth: 256, maxHeight: 256 });
|
|
1738
1787
|
if (!S)
|
|
1739
1788
|
return null;
|
|
1740
|
-
const
|
|
1789
|
+
const Z = S.accompanyingCanvas, ee = Y && Y.type === "fixed" ? /* @__PURE__ */ d("world-object", { height: S.height, width: S.width, x: e, y: t, children: /* @__PURE__ */ d(
|
|
1741
1790
|
"world-image",
|
|
1742
1791
|
{
|
|
1743
|
-
uri:
|
|
1792
|
+
uri: Y.id,
|
|
1744
1793
|
target: { x: 0, y: 0, width: S.width, height: S.height },
|
|
1745
|
-
display:
|
|
1746
|
-
width:
|
|
1747
|
-
height:
|
|
1794
|
+
display: Y.width && Y.height ? {
|
|
1795
|
+
width: Y.width,
|
|
1796
|
+
height: Y.height
|
|
1748
1797
|
} : void 0,
|
|
1749
1798
|
crop: void 0
|
|
1750
1799
|
}
|
|
1751
1800
|
) }) : null;
|
|
1752
|
-
if (
|
|
1753
|
-
if (
|
|
1754
|
-
return
|
|
1755
|
-
if (
|
|
1756
|
-
throw new Error(
|
|
1801
|
+
if (O.type === "unknown") {
|
|
1802
|
+
if (ee)
|
|
1803
|
+
return ee;
|
|
1804
|
+
if (y)
|
|
1805
|
+
throw new Error(O.reason || "Unknown image strategy");
|
|
1757
1806
|
return null;
|
|
1758
1807
|
}
|
|
1759
|
-
const
|
|
1760
|
-
|
|
1761
|
-
|
|
1808
|
+
const se = /* @__PURE__ */ X(Ye, { children: [
|
|
1809
|
+
L ? /* @__PURE__ */ d(at, { page: L }) : null,
|
|
1810
|
+
O.annotations && O.annotations.pages ? O.annotations.pages.map((V) => /* @__PURE__ */ d(at, { page: V }, V.id)) : null,
|
|
1762
1811
|
A
|
|
1763
|
-
] }),
|
|
1764
|
-
return /* @__PURE__ */
|
|
1765
|
-
/* @__PURE__ */
|
|
1812
|
+
] }), me = O.type === "images" ? O.images.length : 0;
|
|
1813
|
+
return /* @__PURE__ */ X(Oe, { children: [
|
|
1814
|
+
/* @__PURE__ */ X(
|
|
1766
1815
|
"world-object",
|
|
1767
1816
|
{
|
|
1768
1817
|
height: S.height,
|
|
1769
1818
|
width: S.width,
|
|
1770
1819
|
x: e,
|
|
1771
1820
|
y: t,
|
|
1772
|
-
...
|
|
1821
|
+
...F,
|
|
1773
1822
|
children: [
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
var
|
|
1777
|
-
return /* @__PURE__ */
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
|
|
1823
|
+
O.type === "empty" || M ? /* @__PURE__ */ d(sn, { style: x }) : null,
|
|
1824
|
+
O.type === "textual-content" ? O.items.map((V, te) => {
|
|
1825
|
+
var $;
|
|
1826
|
+
return /* @__PURE__ */ X(Oe, { children: [
|
|
1827
|
+
/* @__PURE__ */ d(
|
|
1828
|
+
In,
|
|
1780
1829
|
{
|
|
1781
|
-
onClick:
|
|
1782
|
-
|
|
1830
|
+
onClick: C ? (le) => {
|
|
1831
|
+
le.stopPropagation(), C(V.annotationId, V, le);
|
|
1783
1832
|
} : void 0,
|
|
1784
|
-
target: ((
|
|
1785
|
-
children: /* @__PURE__ */
|
|
1833
|
+
target: (($ = V.target) == null ? void 0 : $.spatial) || void 0,
|
|
1834
|
+
children: /* @__PURE__ */ d("div", { "data-textual-content": !0, children: /* @__PURE__ */ d(Ne, { enableDangerouslySetInnerHTML: !0, children: V.text }) })
|
|
1786
1835
|
},
|
|
1787
|
-
|
|
1836
|
+
te
|
|
1788
1837
|
),
|
|
1789
|
-
|
|
1838
|
+
se
|
|
1790
1839
|
] });
|
|
1791
1840
|
}) : null,
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1841
|
+
O.type === "images" ? /* @__PURE__ */ X(Oe, { children: [
|
|
1842
|
+
O.images.map((V, te) => /* @__PURE__ */ d(
|
|
1843
|
+
Wt,
|
|
1795
1844
|
{
|
|
1796
|
-
isStatic:
|
|
1797
|
-
image:
|
|
1798
|
-
id:
|
|
1799
|
-
thumbnail:
|
|
1800
|
-
selector:
|
|
1801
|
-
enableSizes:
|
|
1802
|
-
onClick:
|
|
1803
|
-
|
|
1845
|
+
isStatic: a,
|
|
1846
|
+
image: V,
|
|
1847
|
+
id: V.id,
|
|
1848
|
+
thumbnail: te === 0 ? Y : void 0,
|
|
1849
|
+
selector: V.selector,
|
|
1850
|
+
enableSizes: b,
|
|
1851
|
+
onClick: C ? ($) => {
|
|
1852
|
+
$.stopPropagation(), C(V.annotationId, V, $);
|
|
1804
1853
|
} : void 0
|
|
1805
1854
|
},
|
|
1806
|
-
|
|
1855
|
+
V.id + te
|
|
1807
1856
|
)),
|
|
1808
|
-
|
|
1857
|
+
se
|
|
1809
1858
|
] }) : null,
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
s ? s(
|
|
1814
|
-
] }) :
|
|
1815
|
-
|
|
1816
|
-
s ? s(
|
|
1817
|
-
] }) :
|
|
1818
|
-
|
|
1819
|
-
s ? s(
|
|
1859
|
+
O.type === "3d-model" ? /* @__PURE__ */ d(an, { model: O.model }) : null,
|
|
1860
|
+
O.type === "media" ? /* @__PURE__ */ d(Oe, { children: O.media.type === "Sound" ? /* @__PURE__ */ X(tn, { media: O.media, mediaControlsDeps: h, children: [
|
|
1861
|
+
ee,
|
|
1862
|
+
s ? s(O) : null
|
|
1863
|
+
] }) : O.media.type === "Video" ? /* @__PURE__ */ X(rn, { media: O.media, mediaControlsDeps: h, children: [
|
|
1864
|
+
ee,
|
|
1865
|
+
s ? s(O) : null
|
|
1866
|
+
] }) : O.media.type === "VideoYouTube" && E ? /* @__PURE__ */ X(Jr, { media: O.media, mediaControlsDeps: h, children: [
|
|
1867
|
+
ee,
|
|
1868
|
+
s ? s(O) : null
|
|
1820
1869
|
] }) : null }) : null
|
|
1821
1870
|
]
|
|
1822
1871
|
},
|
|
1823
|
-
`${S.id}/${
|
|
1872
|
+
`${S.id}/${O.type}/${me}`
|
|
1824
1873
|
),
|
|
1825
|
-
|
|
1874
|
+
O.type === "media" && O.media.type === "Sound" && Z ? /* @__PURE__ */ d(Qe, { canvas: Z.id, children: /* @__PURE__ */ d(ln, { renderViewerControls: i }) }) : null
|
|
1826
1875
|
] });
|
|
1827
1876
|
}
|
|
1828
|
-
function
|
|
1829
|
-
const e =
|
|
1830
|
-
return e && e.vault ? e.vault :
|
|
1877
|
+
function Zr() {
|
|
1878
|
+
const e = ue(Ke);
|
|
1879
|
+
return e && e.vault ? e.vault : Et();
|
|
1831
1880
|
}
|
|
1832
|
-
const
|
|
1833
|
-
const
|
|
1834
|
-
if (
|
|
1835
|
-
return /* @__PURE__ */
|
|
1836
|
-
let
|
|
1837
|
-
return /* @__PURE__ */
|
|
1881
|
+
const eo = ct(function(t, n) {
|
|
1882
|
+
const o = Ce(), r = jt(), a = kt(), { ViewerControls: i, MediaControls: s } = t.components || {};
|
|
1883
|
+
if (Tt(n, () => a, [a]), !o)
|
|
1884
|
+
return /* @__PURE__ */ d("div", {});
|
|
1885
|
+
let f = 0;
|
|
1886
|
+
return /* @__PURE__ */ X(Oe, { children: [
|
|
1838
1887
|
t.header,
|
|
1839
|
-
/* @__PURE__ */
|
|
1840
|
-
|
|
1888
|
+
/* @__PURE__ */ d(
|
|
1889
|
+
ge.Viewer,
|
|
1841
1890
|
{
|
|
1842
1891
|
height: t.height,
|
|
1843
1892
|
mode: t.mode,
|
|
1844
|
-
children:
|
|
1845
|
-
const
|
|
1846
|
-
return
|
|
1847
|
-
|
|
1893
|
+
children: r.map((h, u) => {
|
|
1894
|
+
const y = f;
|
|
1895
|
+
return f += h.width + (t.spacing || 0), /* @__PURE__ */ d(Qe, { canvas: h.id, children: /* @__PURE__ */ d(
|
|
1896
|
+
ge.RenderCanvas,
|
|
1848
1897
|
{
|
|
1849
1898
|
strategies: ["3d-model", "media", "images", "empty", "textual-content"],
|
|
1850
|
-
renderViewerControls: u === 0 &&
|
|
1851
|
-
renderMediaControls: u === 0 && s ? () => /* @__PURE__ */
|
|
1852
|
-
x:
|
|
1899
|
+
renderViewerControls: u === 0 && i ? () => /* @__PURE__ */ d(i, {}) : void 0,
|
|
1900
|
+
renderMediaControls: u === 0 && s ? () => /* @__PURE__ */ d(s, {}) : void 0,
|
|
1901
|
+
x: y,
|
|
1853
1902
|
...t.canvasProps || {},
|
|
1854
1903
|
children: t.annotations
|
|
1855
1904
|
},
|
|
1856
|
-
|
|
1857
|
-
) },
|
|
1905
|
+
h.id
|
|
1906
|
+
) }, h.id);
|
|
1858
1907
|
})
|
|
1859
1908
|
},
|
|
1860
|
-
t.reuseAtlas ? "" :
|
|
1909
|
+
t.reuseAtlas ? "" : a.currentSequenceIndex
|
|
1861
1910
|
),
|
|
1862
1911
|
t.children
|
|
1863
1912
|
] });
|
|
1864
|
-
}),
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1913
|
+
}), ge = ct(function({
|
|
1914
|
+
children: t,
|
|
1915
|
+
height: n,
|
|
1916
|
+
annotations: o,
|
|
1917
|
+
canvasProps: r,
|
|
1918
|
+
spacing: a,
|
|
1919
|
+
header: i,
|
|
1920
|
+
components: s,
|
|
1921
|
+
mode: f,
|
|
1922
|
+
reuseAtlas: h,
|
|
1923
|
+
...u
|
|
1924
|
+
}, y) {
|
|
1925
|
+
const x = Zr();
|
|
1926
|
+
return /* @__PURE__ */ d(It, { vault: x, children: /* @__PURE__ */ d(Hn, { ...u, children: /* @__PURE__ */ d(
|
|
1927
|
+
eo,
|
|
1868
1928
|
{
|
|
1869
|
-
ref:
|
|
1929
|
+
ref: y,
|
|
1870
1930
|
height: n,
|
|
1871
1931
|
components: s,
|
|
1872
|
-
spacing:
|
|
1873
|
-
canvasProps:
|
|
1874
|
-
annotations:
|
|
1875
|
-
header:
|
|
1876
|
-
mode:
|
|
1932
|
+
spacing: a,
|
|
1933
|
+
canvasProps: r,
|
|
1934
|
+
annotations: o,
|
|
1935
|
+
header: i,
|
|
1936
|
+
mode: f,
|
|
1937
|
+
reuseAtlas: h,
|
|
1877
1938
|
children: t
|
|
1878
1939
|
}
|
|
1879
1940
|
) }) });
|
|
1880
1941
|
});
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
function
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
}
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1942
|
+
ge.RenderImage = Wt;
|
|
1943
|
+
ge.RenderCanvas = ln;
|
|
1944
|
+
ge.RenderAnnotationPage = at;
|
|
1945
|
+
ge.RenderAnnotation = $t;
|
|
1946
|
+
ge.Viewer = Pr;
|
|
1947
|
+
ge.CanvasBackground = sn;
|
|
1948
|
+
ge.Audio = tn;
|
|
1949
|
+
ge.Video = rn;
|
|
1950
|
+
ge.Model = an;
|
|
1951
|
+
ge.AudioHTML = en;
|
|
1952
|
+
ge.VideoHTML = nn;
|
|
1953
|
+
ge.ModelHTML = on;
|
|
1954
|
+
const jo = ct(
|
|
1955
|
+
function({ canvasId: t }, n) {
|
|
1956
|
+
const o = Cn(), r = Yt(t || (o == null ? void 0 : o.id)), a = re();
|
|
1957
|
+
return Tt(n, () => r, [t, o]), !o || r.enabledPageIds.length === 0 ? null : /* @__PURE__ */ d(Oe, { children: r.enabledPageIds.map((i) => /* @__PURE__ */ d(ge.RenderAnnotationPage, { page: a.get(i) }, i)) });
|
|
1958
|
+
}
|
|
1959
|
+
);
|
|
1960
|
+
function fn({
|
|
1961
|
+
metadata: e = [],
|
|
1962
|
+
config: t,
|
|
1963
|
+
labelWidth: n = 16,
|
|
1964
|
+
showEmptyMessage: o = !0,
|
|
1965
|
+
allowHtml: r,
|
|
1966
|
+
emptyFallback: a,
|
|
1967
|
+
classes: i = {},
|
|
1968
|
+
emptyMessage: s = "No metadata available",
|
|
1969
|
+
emptyValueFallback: f = "No value",
|
|
1970
|
+
emptyLabelFallback: h = "",
|
|
1971
|
+
separator: u,
|
|
1972
|
+
tableFooter: y,
|
|
1973
|
+
tableHeader: x
|
|
1974
|
+
}) {
|
|
1975
|
+
const M = N(() => {
|
|
1976
|
+
const b = (t || []).reduce((C, A) => [...C, ...A.keys], []), E = {};
|
|
1977
|
+
for (const C of e) {
|
|
1978
|
+
const A = C && C.label ? Object.values(C.label) : [];
|
|
1979
|
+
for (const S of A)
|
|
1980
|
+
if (S && S.length && (b.indexOf(`metadata.${S[0]}`) !== -1 || b.length === 0) && C) {
|
|
1981
|
+
const F = `metadata.${S[0]}`;
|
|
1982
|
+
E[F] = E[F] ? E[F] : [], E[F].push(C);
|
|
1983
|
+
break;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
return E;
|
|
1987
|
+
}, [t, e]);
|
|
1988
|
+
return Object.keys(M).length === 0 && o ? /* @__PURE__ */ d(Oe, { children: a }) || /* @__PURE__ */ d("div", { className: i.empty, children: s }) : t && t.length ? /* @__PURE__ */ X("table", { className: i.container, children: [
|
|
1989
|
+
x,
|
|
1990
|
+
/* @__PURE__ */ d("tbody", { children: t.map((b, E) => {
|
|
1991
|
+
const C = [];
|
|
1992
|
+
for (const A of b.keys)
|
|
1993
|
+
for (const S of M[A] || [])
|
|
1994
|
+
C.push(
|
|
1995
|
+
/* @__PURE__ */ d(
|
|
1996
|
+
Ne,
|
|
1997
|
+
{
|
|
1998
|
+
enableDangerouslySetInnerHTML: r,
|
|
1999
|
+
defaultText: f,
|
|
2000
|
+
separator: u,
|
|
2001
|
+
children: S.value
|
|
2002
|
+
},
|
|
2003
|
+
E + "__" + A
|
|
2004
|
+
)
|
|
2005
|
+
);
|
|
2006
|
+
return C.length === 0 ? null : /* @__PURE__ */ X("tr", { className: i.row, children: [
|
|
2007
|
+
/* @__PURE__ */ d("td", { className: i.label, style: n ? { minWidth: n } : {}, children: /* @__PURE__ */ d(
|
|
2008
|
+
Ne,
|
|
2009
|
+
{
|
|
2010
|
+
enableDangerouslySetInnerHTML: r,
|
|
2011
|
+
separator: u,
|
|
2012
|
+
defaultText: h,
|
|
2013
|
+
children: b.label
|
|
2014
|
+
}
|
|
2015
|
+
) }),
|
|
2016
|
+
/* @__PURE__ */ d("td", { className: i.value, children: C })
|
|
2017
|
+
] }, E);
|
|
2018
|
+
}) }),
|
|
2019
|
+
y
|
|
2020
|
+
] }) : /* @__PURE__ */ X("table", { className: i.container, children: [
|
|
2021
|
+
x,
|
|
2022
|
+
/* @__PURE__ */ d("tbody", { children: e && e.length ? e.map((b, E) => b ? /* @__PURE__ */ X("tr", { className: i.row, children: [
|
|
2023
|
+
/* @__PURE__ */ d("td", { className: i.label, style: n ? { minWidth: n } : {}, children: /* @__PURE__ */ d(
|
|
2024
|
+
Ne,
|
|
2025
|
+
{
|
|
2026
|
+
enableDangerouslySetInnerHTML: r,
|
|
2027
|
+
defaultText: f,
|
|
2028
|
+
separator: u,
|
|
2029
|
+
children: b.label
|
|
2030
|
+
}
|
|
2031
|
+
) }),
|
|
2032
|
+
/* @__PURE__ */ d("td", { className: i.value, children: /* @__PURE__ */ d(
|
|
2033
|
+
Ne,
|
|
2034
|
+
{
|
|
2035
|
+
enableDangerouslySetInnerHTML: r,
|
|
2036
|
+
defaultText: f,
|
|
2037
|
+
separator: u,
|
|
2038
|
+
children: b.value
|
|
2039
|
+
}
|
|
2040
|
+
) })
|
|
2041
|
+
] }, E) : null) : null }),
|
|
2042
|
+
y
|
|
2043
|
+
] });
|
|
2044
|
+
}
|
|
2045
|
+
function Mo(e) {
|
|
2046
|
+
const t = Ce(), n = Se(), o = At(), r = N(() => {
|
|
2047
|
+
const a = (t == null ? void 0 : t.metadata) || [], i = (n == null ? void 0 : n.metadata) || [], s = (o == null ? void 0 : o.metadata) || [];
|
|
2048
|
+
return [...a, ...i, ...s];
|
|
2049
|
+
}, [t, n, o]);
|
|
2050
|
+
return /* @__PURE__ */ d(fn, { metadata: r, ...e });
|
|
2051
|
+
}
|
|
2052
|
+
function dn(e, t = {}, n = []) {
|
|
2053
|
+
return N(() => {
|
|
2054
|
+
var i, s;
|
|
2055
|
+
if (!e)
|
|
2056
|
+
return null;
|
|
2057
|
+
let o = t.quality;
|
|
2058
|
+
e && e.extraQualities && t.quality && (e.extraQualities.includes(t.quality) || (console.log("Invalid quality", t.quality, e.extraQualities), o = "default"));
|
|
2059
|
+
const r = Rn(e);
|
|
2060
|
+
return Ln({
|
|
2061
|
+
identifier: r.identifier,
|
|
2062
|
+
server: r.server,
|
|
2063
|
+
scheme: r.scheme,
|
|
2064
|
+
type: "image",
|
|
2065
|
+
size: {
|
|
2066
|
+
max: !((i = t.size) != null && i.width) && !((s = t.size) != null && s.height),
|
|
2067
|
+
confined: !1,
|
|
2068
|
+
upscaled: !1,
|
|
2069
|
+
...t.size || {}
|
|
2070
|
+
},
|
|
2071
|
+
format: t.format || "jpg",
|
|
2072
|
+
// This isn't how it should be modelled, always full,
|
|
2073
|
+
// region: data.selector ? data.selector : { full: true },
|
|
2074
|
+
region: t.region || { full: !0 },
|
|
2075
|
+
rotation: t != null && t.rotation ? Number.isInteger(t.rotation) ? { angle: t.rotation } : t.rotation : { angle: 0 },
|
|
2076
|
+
quality: o || "default",
|
|
2077
|
+
prefix: r.prefix,
|
|
2078
|
+
originalPath: r.originalPath
|
|
2079
|
+
});
|
|
2080
|
+
}, [...n]);
|
|
2081
|
+
}
|
|
2082
|
+
function to(e) {
|
|
2083
|
+
const t = typeof e.src == "string" ? e.src : e.src.id, n = Je(), [o, r] = ae(!1);
|
|
2084
|
+
let a;
|
|
2085
|
+
if (t) {
|
|
2086
|
+
const s = n.loadServiceSync({ id: t });
|
|
2087
|
+
s && (a = s);
|
|
2088
|
+
}
|
|
2089
|
+
!a && !o && n.loadService({ id: t }).then(() => {
|
|
2090
|
+
r(!0);
|
|
2091
|
+
});
|
|
2092
|
+
const i = dn(
|
|
2093
|
+
a,
|
|
2094
|
+
{
|
|
2095
|
+
size: e.size,
|
|
2096
|
+
selector: e.region,
|
|
2097
|
+
rotation: e.rotation,
|
|
2098
|
+
format: e.format,
|
|
2099
|
+
region: e.region,
|
|
2100
|
+
quality: e.quality
|
|
2101
|
+
},
|
|
2102
|
+
[o, e.src, e.size, e.region, e.rotation, e.format, e.region, e.quality]
|
|
2103
|
+
);
|
|
2104
|
+
return be(() => () => {
|
|
2105
|
+
r(!1);
|
|
2106
|
+
}, [t]), i ? /* @__PURE__ */ d("img", { src: i, alt: e.alt, className: e.className, style: e.style }) : /* @__PURE__ */ d(no, { ...e, fetchImageService: !1 });
|
|
2107
|
+
}
|
|
2108
|
+
function no(e) {
|
|
2109
|
+
if (e.fetchImageService)
|
|
2110
|
+
return /* @__PURE__ */ d(to, { ...e });
|
|
2111
|
+
const t = typeof e.src == "string" ? { id: e.src, profile: "level0" } : e.src, n = dn(
|
|
2112
|
+
t,
|
|
2113
|
+
{
|
|
2114
|
+
size: e.size,
|
|
2115
|
+
selector: e.region,
|
|
2116
|
+
rotation: e.rotation,
|
|
2117
|
+
format: e.format,
|
|
2118
|
+
region: e.region,
|
|
2119
|
+
quality: e.quality
|
|
2120
|
+
},
|
|
2121
|
+
[e.src, e.size, e.region, e.rotation, e.format, e.region, e.quality]
|
|
2122
|
+
);
|
|
2123
|
+
return n ? /* @__PURE__ */ d("img", { src: n, alt: e.alt, className: e.className, style: e.style }) : null;
|
|
2124
|
+
}
|
|
2125
|
+
function Ro(e) {
|
|
2126
|
+
const t = Ce();
|
|
2127
|
+
return /* @__PURE__ */ d(fn, { metadata: (t == null ? void 0 : t.metadata) || [], ...e });
|
|
2128
|
+
}
|
|
2129
|
+
var pn = { exports: {} };
|
|
2130
|
+
(() => {
|
|
2131
|
+
var e = { 296: (r, a, i) => {
|
|
2132
|
+
var s = /^\s+|\s+$/g, f = /^[-+]0x[0-9a-f]+$/i, h = /^0b[01]+$/i, u = /^0o[0-7]+$/i, y = parseInt, x = typeof i.g == "object" && i.g && i.g.Object === Object && i.g, M = typeof self == "object" && self && self.Object === Object && self, I = x || M || Function("return this")(), b = Object.prototype.toString, E = Math.max, C = Math.min, A = function() {
|
|
2133
|
+
return I.Date.now();
|
|
2134
|
+
};
|
|
2135
|
+
function S(L) {
|
|
2136
|
+
var R = typeof L;
|
|
2137
|
+
return !!L && (R == "object" || R == "function");
|
|
2138
|
+
}
|
|
2139
|
+
function F(L) {
|
|
2140
|
+
if (typeof L == "number")
|
|
2141
|
+
return L;
|
|
2142
|
+
if (function(j) {
|
|
2143
|
+
return typeof j == "symbol" || /* @__PURE__ */ function(O) {
|
|
2144
|
+
return !!O && typeof O == "object";
|
|
2145
|
+
}(j) && b.call(j) == "[object Symbol]";
|
|
2146
|
+
}(L))
|
|
2147
|
+
return NaN;
|
|
2148
|
+
if (S(L)) {
|
|
2149
|
+
var R = typeof L.valueOf == "function" ? L.valueOf() : L;
|
|
2150
|
+
L = S(R) ? R + "" : R;
|
|
2151
|
+
}
|
|
2152
|
+
if (typeof L != "string")
|
|
2153
|
+
return L === 0 ? L : +L;
|
|
2154
|
+
L = L.replace(s, "");
|
|
2155
|
+
var B = h.test(L);
|
|
2156
|
+
return B || u.test(L) ? y(L.slice(2), B ? 2 : 8) : f.test(L) ? NaN : +L;
|
|
2157
|
+
}
|
|
2158
|
+
r.exports = function(L, R, B) {
|
|
2159
|
+
var j, O, U, H, G, Y, Z = 0, ee = !1, se = !1, me = !0;
|
|
2160
|
+
if (typeof L != "function")
|
|
2161
|
+
throw new TypeError("Expected a function");
|
|
2162
|
+
function V(oe) {
|
|
2163
|
+
var ie = j, de = O;
|
|
2164
|
+
return j = O = void 0, Z = oe, H = L.apply(de, ie);
|
|
2165
|
+
}
|
|
2166
|
+
function te(oe) {
|
|
2167
|
+
var ie = oe - Y;
|
|
2168
|
+
return Y === void 0 || ie >= R || ie < 0 || se && oe - Z >= U;
|
|
2169
|
+
}
|
|
2170
|
+
function $() {
|
|
2171
|
+
var oe = A();
|
|
2172
|
+
if (te(oe))
|
|
2173
|
+
return le(oe);
|
|
2174
|
+
G = setTimeout($, function(ie) {
|
|
2175
|
+
var de = R - (ie - Y);
|
|
2176
|
+
return se ? C(de, U - (ie - Z)) : de;
|
|
2177
|
+
}(oe));
|
|
2178
|
+
}
|
|
2179
|
+
function le(oe) {
|
|
2180
|
+
return G = void 0, me && j ? V(oe) : (j = O = void 0, H);
|
|
2181
|
+
}
|
|
2182
|
+
function fe() {
|
|
2183
|
+
var oe = A(), ie = te(oe);
|
|
2184
|
+
if (j = arguments, O = this, Y = oe, ie) {
|
|
2185
|
+
if (G === void 0)
|
|
2186
|
+
return function(de) {
|
|
2187
|
+
return Z = de, G = setTimeout($, R), ee ? V(de) : H;
|
|
2188
|
+
}(Y);
|
|
2189
|
+
if (se)
|
|
2190
|
+
return G = setTimeout($, R), V(Y);
|
|
2191
|
+
}
|
|
2192
|
+
return G === void 0 && (G = setTimeout($, R)), H;
|
|
2193
|
+
}
|
|
2194
|
+
return R = F(R) || 0, S(B) && (ee = !!B.leading, U = (se = "maxWait" in B) ? E(F(B.maxWait) || 0, R) : U, me = "trailing" in B ? !!B.trailing : me), fe.cancel = function() {
|
|
2195
|
+
G !== void 0 && clearTimeout(G), Z = 0, j = Y = O = G = void 0;
|
|
2196
|
+
}, fe.flush = function() {
|
|
2197
|
+
return G === void 0 ? H : le(A());
|
|
2198
|
+
}, fe;
|
|
2199
|
+
};
|
|
2200
|
+
}, 96: (r, a, i) => {
|
|
2201
|
+
var s = "Expected a function", f = NaN, h = "[object Symbol]", u = /^\s+|\s+$/g, y = /^[-+]0x[0-9a-f]+$/i, x = /^0b[01]+$/i, M = /^0o[0-7]+$/i, I = parseInt, b = typeof i.g == "object" && i.g && i.g.Object === Object && i.g, E = typeof self == "object" && self && self.Object === Object && self, C = b || E || Function("return this")(), A = Object.prototype.toString, S = Math.max, F = Math.min, L = function() {
|
|
2202
|
+
return C.Date.now();
|
|
2203
|
+
};
|
|
2204
|
+
function R(j) {
|
|
2205
|
+
var O = typeof j;
|
|
2206
|
+
return !!j && (O == "object" || O == "function");
|
|
2207
|
+
}
|
|
2208
|
+
function B(j) {
|
|
2209
|
+
if (typeof j == "number")
|
|
2210
|
+
return j;
|
|
2211
|
+
if (function(H) {
|
|
2212
|
+
return typeof H == "symbol" || /* @__PURE__ */ function(G) {
|
|
2213
|
+
return !!G && typeof G == "object";
|
|
2214
|
+
}(H) && A.call(H) == h;
|
|
2215
|
+
}(j))
|
|
2216
|
+
return f;
|
|
2217
|
+
if (R(j)) {
|
|
2218
|
+
var O = typeof j.valueOf == "function" ? j.valueOf() : j;
|
|
2219
|
+
j = R(O) ? O + "" : O;
|
|
2220
|
+
}
|
|
2221
|
+
if (typeof j != "string")
|
|
2222
|
+
return j === 0 ? j : +j;
|
|
2223
|
+
j = j.replace(u, "");
|
|
2224
|
+
var U = x.test(j);
|
|
2225
|
+
return U || M.test(j) ? I(j.slice(2), U ? 2 : 8) : y.test(j) ? f : +j;
|
|
2226
|
+
}
|
|
2227
|
+
r.exports = function(j, O, U) {
|
|
2228
|
+
var H = !0, G = !0;
|
|
2229
|
+
if (typeof j != "function")
|
|
2230
|
+
throw new TypeError(s);
|
|
2231
|
+
return R(U) && (H = "leading" in U ? !!U.leading : H, G = "trailing" in U ? !!U.trailing : G), function(Y, Z, ee) {
|
|
2232
|
+
var se, me, V, te, $, le, fe = 0, oe = !1, ie = !1, de = !0;
|
|
2233
|
+
if (typeof Y != "function")
|
|
2234
|
+
throw new TypeError(s);
|
|
2235
|
+
function _e(pe) {
|
|
2236
|
+
var ve = se, Pe = me;
|
|
2237
|
+
return se = me = void 0, fe = pe, te = Y.apply(Pe, ve);
|
|
2238
|
+
}
|
|
2239
|
+
function Be(pe) {
|
|
2240
|
+
var ve = pe - le;
|
|
2241
|
+
return le === void 0 || ve >= Z || ve < 0 || ie && pe - fe >= V;
|
|
2242
|
+
}
|
|
2243
|
+
function we() {
|
|
2244
|
+
var pe = L();
|
|
2245
|
+
if (Be(pe))
|
|
2246
|
+
return qe(pe);
|
|
2247
|
+
$ = setTimeout(we, function(ve) {
|
|
2248
|
+
var Pe = Z - (ve - le);
|
|
2249
|
+
return ie ? F(Pe, V - (ve - fe)) : Pe;
|
|
2250
|
+
}(pe));
|
|
2251
|
+
}
|
|
2252
|
+
function qe(pe) {
|
|
2253
|
+
return $ = void 0, de && se ? _e(pe) : (se = me = void 0, te);
|
|
2254
|
+
}
|
|
2255
|
+
function Me() {
|
|
2256
|
+
var pe = L(), ve = Be(pe);
|
|
2257
|
+
if (se = arguments, me = this, le = pe, ve) {
|
|
2258
|
+
if ($ === void 0)
|
|
2259
|
+
return function(Pe) {
|
|
2260
|
+
return fe = Pe, $ = setTimeout(we, Z), oe ? _e(Pe) : te;
|
|
2261
|
+
}(le);
|
|
2262
|
+
if (ie)
|
|
2263
|
+
return $ = setTimeout(we, Z), _e(le);
|
|
2264
|
+
}
|
|
2265
|
+
return $ === void 0 && ($ = setTimeout(we, Z)), te;
|
|
2266
|
+
}
|
|
2267
|
+
return Z = B(Z) || 0, R(ee) && (oe = !!ee.leading, V = (ie = "maxWait" in ee) ? S(B(ee.maxWait) || 0, Z) : V, de = "trailing" in ee ? !!ee.trailing : de), Me.cancel = function() {
|
|
2268
|
+
$ !== void 0 && clearTimeout($), fe = 0, se = le = me = $ = void 0;
|
|
2269
|
+
}, Me.flush = function() {
|
|
2270
|
+
return $ === void 0 ? te : qe(L());
|
|
2271
|
+
}, Me;
|
|
2272
|
+
}(j, O, { leading: H, maxWait: O, trailing: G });
|
|
2273
|
+
};
|
|
2274
|
+
}, 703: (r, a, i) => {
|
|
2275
|
+
var s = i(414);
|
|
2276
|
+
function f() {
|
|
2277
|
+
}
|
|
2278
|
+
function h() {
|
|
2279
|
+
}
|
|
2280
|
+
h.resetWarningCache = f, r.exports = function() {
|
|
2281
|
+
function u(M, I, b, E, C, A) {
|
|
2282
|
+
if (A !== s) {
|
|
2283
|
+
var S = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
|
|
2284
|
+
throw S.name = "Invariant Violation", S;
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
function y() {
|
|
2288
|
+
return u;
|
|
2289
|
+
}
|
|
2290
|
+
u.isRequired = u;
|
|
2291
|
+
var x = { array: u, bigint: u, bool: u, func: u, number: u, object: u, string: u, symbol: u, any: u, arrayOf: y, element: u, elementType: u, instanceOf: y, node: u, objectOf: y, oneOf: y, oneOfType: y, shape: y, exact: y, checkPropTypes: h, resetWarningCache: f };
|
|
2292
|
+
return x.PropTypes = x, x;
|
|
2293
|
+
};
|
|
2294
|
+
}, 697: (r, a, i) => {
|
|
2295
|
+
r.exports = i(703)();
|
|
2296
|
+
}, 414: (r) => {
|
|
2297
|
+
r.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
2298
|
+
} }, t = {};
|
|
2299
|
+
function n(r) {
|
|
2300
|
+
var a = t[r];
|
|
2301
|
+
if (a !== void 0)
|
|
2302
|
+
return a.exports;
|
|
2303
|
+
var i = t[r] = { exports: {} };
|
|
2304
|
+
return e[r](i, i.exports, n), i.exports;
|
|
2305
|
+
}
|
|
2306
|
+
n.n = (r) => {
|
|
2307
|
+
var a = r && r.__esModule ? () => r.default : () => r;
|
|
2308
|
+
return n.d(a, { a }), a;
|
|
2309
|
+
}, n.d = (r, a) => {
|
|
2310
|
+
for (var i in a)
|
|
2311
|
+
n.o(a, i) && !n.o(r, i) && Object.defineProperty(r, i, { enumerable: !0, get: a[i] });
|
|
2312
|
+
}, n.g = function() {
|
|
2313
|
+
if (typeof globalThis == "object")
|
|
2314
|
+
return globalThis;
|
|
2315
|
+
try {
|
|
2316
|
+
return this || new Function("return this")();
|
|
2317
|
+
} catch {
|
|
2318
|
+
if (typeof window == "object")
|
|
2319
|
+
return window;
|
|
2320
|
+
}
|
|
2321
|
+
}(), n.o = (r, a) => Object.prototype.hasOwnProperty.call(r, a), n.r = (r) => {
|
|
2322
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(r, "__esModule", { value: !0 });
|
|
2323
|
+
};
|
|
2324
|
+
var o = {};
|
|
2325
|
+
(() => {
|
|
2326
|
+
n.r(o), n.d(o, { LazyLoadComponent: () => yt, LazyLoadImage: () => vn, trackWindowScroll: () => le });
|
|
2327
|
+
const r = Ie;
|
|
2328
|
+
var a = n.n(r), i = n(697);
|
|
2329
|
+
const s = kn;
|
|
2330
|
+
var f = n.n(s);
|
|
2331
|
+
function h() {
|
|
2332
|
+
return typeof window < "u" && "IntersectionObserver" in window && "isIntersecting" in window.IntersectionObserverEntry.prototype;
|
|
2333
|
+
}
|
|
2334
|
+
function u(g) {
|
|
2335
|
+
return u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
|
|
2336
|
+
return typeof c;
|
|
2337
|
+
} : function(c) {
|
|
2338
|
+
return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
|
|
2339
|
+
}, u(g);
|
|
2340
|
+
}
|
|
2341
|
+
function y(g, c) {
|
|
2342
|
+
var m = Object.keys(g);
|
|
2343
|
+
if (Object.getOwnPropertySymbols) {
|
|
2344
|
+
var v = Object.getOwnPropertySymbols(g);
|
|
2345
|
+
c && (v = v.filter(function(k) {
|
|
2346
|
+
return Object.getOwnPropertyDescriptor(g, k).enumerable;
|
|
2347
|
+
})), m.push.apply(m, v);
|
|
2348
|
+
}
|
|
2349
|
+
return m;
|
|
2350
|
+
}
|
|
2351
|
+
function x(g, c, m) {
|
|
2352
|
+
return (c = I(c)) in g ? Object.defineProperty(g, c, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : g[c] = m, g;
|
|
2353
|
+
}
|
|
2354
|
+
function M(g, c) {
|
|
2355
|
+
for (var m = 0; m < c.length; m++) {
|
|
2356
|
+
var v = c[m];
|
|
2357
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(g, I(v.key), v);
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
function I(g) {
|
|
2361
|
+
var c = function(m, v) {
|
|
2362
|
+
if (u(m) !== "object" || m === null)
|
|
2363
|
+
return m;
|
|
2364
|
+
var k = m[Symbol.toPrimitive];
|
|
2365
|
+
if (k !== void 0) {
|
|
2366
|
+
var _ = k.call(m, "string");
|
|
2367
|
+
if (u(_) !== "object")
|
|
2368
|
+
return _;
|
|
2369
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2370
|
+
}
|
|
2371
|
+
return String(m);
|
|
2372
|
+
}(g);
|
|
2373
|
+
return u(c) === "symbol" ? c : String(c);
|
|
2374
|
+
}
|
|
2375
|
+
function b(g, c) {
|
|
2376
|
+
return b = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, v) {
|
|
2377
|
+
return m.__proto__ = v, m;
|
|
2378
|
+
}, b(g, c);
|
|
2379
|
+
}
|
|
2380
|
+
function E(g) {
|
|
2381
|
+
return E = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(c) {
|
|
2382
|
+
return c.__proto__ || Object.getPrototypeOf(c);
|
|
2383
|
+
}, E(g);
|
|
2384
|
+
}
|
|
2385
|
+
var C = function(g) {
|
|
2386
|
+
g.forEach(function(c) {
|
|
2387
|
+
c.isIntersecting && c.target.onVisible();
|
|
2388
|
+
});
|
|
2389
|
+
}, A = {}, S = function(g) {
|
|
2390
|
+
(function(l, p) {
|
|
2391
|
+
if (typeof p != "function" && p !== null)
|
|
2392
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
2393
|
+
l.prototype = Object.create(p && p.prototype, { constructor: { value: l, writable: !0, configurable: !0 } }), Object.defineProperty(l, "prototype", { writable: !1 }), p && b(l, p);
|
|
2394
|
+
})(q, g);
|
|
2395
|
+
var c, m, v, k, _ = (v = q, k = function() {
|
|
2396
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
2397
|
+
return !1;
|
|
2398
|
+
if (typeof Proxy == "function")
|
|
2399
|
+
return !0;
|
|
2400
|
+
try {
|
|
2401
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
2402
|
+
})), !0;
|
|
2403
|
+
} catch {
|
|
2404
|
+
return !1;
|
|
2405
|
+
}
|
|
2406
|
+
}(), function() {
|
|
2407
|
+
var l, p = E(v);
|
|
2408
|
+
if (k) {
|
|
2409
|
+
var T = E(this).constructor;
|
|
2410
|
+
l = Reflect.construct(p, arguments, T);
|
|
2411
|
+
} else
|
|
2412
|
+
l = p.apply(this, arguments);
|
|
2413
|
+
return function(P, w) {
|
|
2414
|
+
if (w && (u(w) === "object" || typeof w == "function"))
|
|
2415
|
+
return w;
|
|
2416
|
+
if (w !== void 0)
|
|
2417
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
2418
|
+
return function(D) {
|
|
2419
|
+
if (D === void 0)
|
|
2420
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2421
|
+
return D;
|
|
2422
|
+
}(P);
|
|
2423
|
+
}(this, l);
|
|
2424
|
+
});
|
|
2425
|
+
function q(l) {
|
|
2426
|
+
var p;
|
|
2427
|
+
if (function(P, w) {
|
|
2428
|
+
if (!(P instanceof w))
|
|
2429
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2430
|
+
}(this, q), (p = _.call(this, l)).supportsObserver = !l.scrollPosition && l.useIntersectionObserver && h(), p.supportsObserver) {
|
|
2431
|
+
var T = l.threshold;
|
|
2432
|
+
p.observer = function(P) {
|
|
2433
|
+
return A[P] = A[P] || new IntersectionObserver(C, { rootMargin: P + "px" }), A[P];
|
|
2434
|
+
}(T);
|
|
2435
|
+
}
|
|
2436
|
+
return p;
|
|
2437
|
+
}
|
|
2438
|
+
return c = q, m = [{ key: "componentDidMount", value: function() {
|
|
2439
|
+
this.placeholder && this.observer && (this.placeholder.onVisible = this.props.onVisible, this.observer.observe(this.placeholder)), this.supportsObserver || this.updateVisibility();
|
|
2440
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
2441
|
+
this.observer && this.placeholder && this.observer.unobserve(this.placeholder);
|
|
2442
|
+
} }, { key: "componentDidUpdate", value: function() {
|
|
2443
|
+
this.supportsObserver || this.updateVisibility();
|
|
2444
|
+
} }, { key: "getPlaceholderBoundingBox", value: function() {
|
|
2445
|
+
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props.scrollPosition, p = this.placeholder.getBoundingClientRect(), T = f().findDOMNode(this.placeholder).style, P = parseInt(T.getPropertyValue("margin-left"), 10) || 0, w = parseInt(T.getPropertyValue("margin-top"), 10) || 0;
|
|
2446
|
+
return { bottom: l.y + p.bottom + w, left: l.x + p.left + P, right: l.x + p.right + P, top: l.y + p.top + w };
|
|
2447
|
+
} }, { key: "isPlaceholderInViewport", value: function() {
|
|
2448
|
+
if (typeof window > "u" || !this.placeholder)
|
|
2449
|
+
return !1;
|
|
2450
|
+
var l = this.props, p = l.scrollPosition, T = l.threshold, P = this.getPlaceholderBoundingBox(p), w = p.y + window.innerHeight, D = p.x, z = p.x + window.innerWidth, K = p.y;
|
|
2451
|
+
return K - T <= P.bottom && w + T >= P.top && D - T <= P.right && z + T >= P.left;
|
|
2452
|
+
} }, { key: "updateVisibility", value: function() {
|
|
2453
|
+
this.isPlaceholderInViewport() && this.props.onVisible();
|
|
2454
|
+
} }, { key: "render", value: function() {
|
|
2455
|
+
var l = this, p = this.props, T = p.className, P = p.height, w = p.placeholder, D = p.style, z = p.width;
|
|
2456
|
+
if (w && typeof w.type != "function")
|
|
2457
|
+
return a().cloneElement(w, { ref: function(W) {
|
|
2458
|
+
return l.placeholder = W;
|
|
2459
|
+
} });
|
|
2460
|
+
var K = function(W) {
|
|
2461
|
+
for (var ce = 1; ce < arguments.length; ce++) {
|
|
2462
|
+
var J = arguments[ce] != null ? arguments[ce] : {};
|
|
2463
|
+
ce % 2 ? y(Object(J), !0).forEach(function(he) {
|
|
2464
|
+
x(W, he, J[he]);
|
|
2465
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(W, Object.getOwnPropertyDescriptors(J)) : y(Object(J)).forEach(function(he) {
|
|
2466
|
+
Object.defineProperty(W, he, Object.getOwnPropertyDescriptor(J, he));
|
|
2467
|
+
});
|
|
2468
|
+
}
|
|
2469
|
+
return W;
|
|
2470
|
+
}({ display: "inline-block" }, D);
|
|
2471
|
+
return z !== void 0 && (K.width = z), P !== void 0 && (K.height = P), a().createElement("span", { className: T, ref: function(W) {
|
|
2472
|
+
return l.placeholder = W;
|
|
2473
|
+
}, style: K }, w);
|
|
2474
|
+
} }], m && M(c.prototype, m), Object.defineProperty(c, "prototype", { writable: !1 }), q;
|
|
2475
|
+
}(a().Component);
|
|
2476
|
+
S.propTypes = { onVisible: i.PropTypes.func.isRequired, className: i.PropTypes.string, height: i.PropTypes.oneOfType([i.PropTypes.number, i.PropTypes.string]), placeholder: i.PropTypes.element, threshold: i.PropTypes.number, useIntersectionObserver: i.PropTypes.bool, scrollPosition: i.PropTypes.shape({ x: i.PropTypes.number.isRequired, y: i.PropTypes.number.isRequired }), width: i.PropTypes.oneOfType([i.PropTypes.number, i.PropTypes.string]) }, S.defaultProps = { className: "", placeholder: null, threshold: 100, useIntersectionObserver: !0 };
|
|
2477
|
+
const F = S;
|
|
2478
|
+
var L = n(296), R = n.n(L), B = n(96), j = n.n(B), O = function(g) {
|
|
2479
|
+
var c = getComputedStyle(g, null);
|
|
2480
|
+
return c.getPropertyValue("overflow") + c.getPropertyValue("overflow-y") + c.getPropertyValue("overflow-x");
|
|
2481
|
+
};
|
|
2482
|
+
const U = function(g) {
|
|
2483
|
+
if (!(g instanceof HTMLElement))
|
|
2484
|
+
return window;
|
|
2485
|
+
for (var c = g; c && c instanceof HTMLElement; ) {
|
|
2486
|
+
if (/(scroll|auto)/.test(O(c)))
|
|
2487
|
+
return c;
|
|
2488
|
+
c = c.parentNode;
|
|
2489
|
+
}
|
|
2490
|
+
return window;
|
|
2491
|
+
};
|
|
2492
|
+
function H(g) {
|
|
2493
|
+
return H = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
|
|
2494
|
+
return typeof c;
|
|
2495
|
+
} : function(c) {
|
|
2496
|
+
return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
|
|
2497
|
+
}, H(g);
|
|
2498
|
+
}
|
|
2499
|
+
var G = ["delayMethod", "delayTime"];
|
|
2500
|
+
function Y() {
|
|
2501
|
+
return Y = Object.assign ? Object.assign.bind() : function(g) {
|
|
2502
|
+
for (var c = 1; c < arguments.length; c++) {
|
|
2503
|
+
var m = arguments[c];
|
|
2504
|
+
for (var v in m)
|
|
2505
|
+
Object.prototype.hasOwnProperty.call(m, v) && (g[v] = m[v]);
|
|
2506
|
+
}
|
|
2507
|
+
return g;
|
|
2508
|
+
}, Y.apply(this, arguments);
|
|
2509
|
+
}
|
|
2510
|
+
function Z(g, c) {
|
|
2511
|
+
for (var m = 0; m < c.length; m++) {
|
|
2512
|
+
var v = c[m];
|
|
2513
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(g, (k = function(_, q) {
|
|
2514
|
+
if (H(_) !== "object" || _ === null)
|
|
2515
|
+
return _;
|
|
2516
|
+
var l = _[Symbol.toPrimitive];
|
|
2517
|
+
if (l !== void 0) {
|
|
2518
|
+
var p = l.call(_, "string");
|
|
2519
|
+
if (H(p) !== "object")
|
|
2520
|
+
return p;
|
|
2521
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2522
|
+
}
|
|
2523
|
+
return String(_);
|
|
2524
|
+
}(v.key), H(k) === "symbol" ? k : String(k)), v);
|
|
2525
|
+
}
|
|
2526
|
+
var k;
|
|
2527
|
+
}
|
|
2528
|
+
function ee(g, c) {
|
|
2529
|
+
return ee = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, v) {
|
|
2530
|
+
return m.__proto__ = v, m;
|
|
2531
|
+
}, ee(g, c);
|
|
2532
|
+
}
|
|
2533
|
+
function se(g, c) {
|
|
2534
|
+
if (c && (H(c) === "object" || typeof c == "function"))
|
|
2535
|
+
return c;
|
|
2536
|
+
if (c !== void 0)
|
|
2537
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
2538
|
+
return me(g);
|
|
2539
|
+
}
|
|
2540
|
+
function me(g) {
|
|
2541
|
+
if (g === void 0)
|
|
2542
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2543
|
+
return g;
|
|
2544
|
+
}
|
|
2545
|
+
function V(g) {
|
|
2546
|
+
return V = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(c) {
|
|
2547
|
+
return c.__proto__ || Object.getPrototypeOf(c);
|
|
2548
|
+
}, V(g);
|
|
2549
|
+
}
|
|
2550
|
+
var te = function() {
|
|
2551
|
+
return typeof window > "u" ? 0 : window.scrollX || window.pageXOffset;
|
|
2552
|
+
}, $ = function() {
|
|
2553
|
+
return typeof window > "u" ? 0 : window.scrollY || window.pageYOffset;
|
|
2554
|
+
};
|
|
2555
|
+
const le = function(g) {
|
|
2556
|
+
var c = function(m) {
|
|
2557
|
+
(function(T, P) {
|
|
2558
|
+
if (typeof P != "function" && P !== null)
|
|
2559
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
2560
|
+
T.prototype = Object.create(P && P.prototype, { constructor: { value: T, writable: !0, configurable: !0 } }), Object.defineProperty(T, "prototype", { writable: !1 }), P && ee(T, P);
|
|
2561
|
+
})(p, m);
|
|
2562
|
+
var v, k, _, q, l = (_ = p, q = function() {
|
|
2563
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
2564
|
+
return !1;
|
|
2565
|
+
if (typeof Proxy == "function")
|
|
2566
|
+
return !0;
|
|
2567
|
+
try {
|
|
2568
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
2569
|
+
})), !0;
|
|
2570
|
+
} catch {
|
|
2571
|
+
return !1;
|
|
2572
|
+
}
|
|
2573
|
+
}(), function() {
|
|
2574
|
+
var T, P = V(_);
|
|
2575
|
+
if (q) {
|
|
2576
|
+
var w = V(this).constructor;
|
|
2577
|
+
T = Reflect.construct(P, arguments, w);
|
|
2578
|
+
} else
|
|
2579
|
+
T = P.apply(this, arguments);
|
|
2580
|
+
return se(this, T);
|
|
2581
|
+
});
|
|
2582
|
+
function p(T) {
|
|
2583
|
+
var P;
|
|
2584
|
+
if (function(D, z) {
|
|
2585
|
+
if (!(D instanceof z))
|
|
2586
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2587
|
+
}(this, p), (P = l.call(this, T)).useIntersectionObserver = T.useIntersectionObserver && h(), P.useIntersectionObserver)
|
|
2588
|
+
return se(P);
|
|
2589
|
+
var w = P.onChangeScroll.bind(me(P));
|
|
2590
|
+
return T.delayMethod === "debounce" ? P.delayedScroll = R()(w, T.delayTime) : T.delayMethod === "throttle" && (P.delayedScroll = j()(w, T.delayTime)), P.state = { scrollPosition: { x: te(), y: $() } }, P.baseComponentRef = a().createRef(), P;
|
|
2591
|
+
}
|
|
2592
|
+
return v = p, (k = [{ key: "componentDidMount", value: function() {
|
|
2593
|
+
this.addListeners();
|
|
2594
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
2595
|
+
this.removeListeners();
|
|
2596
|
+
} }, { key: "componentDidUpdate", value: function() {
|
|
2597
|
+
typeof window > "u" || this.useIntersectionObserver || U(f().findDOMNode(this.baseComponentRef.current)) !== this.scrollElement && (this.removeListeners(), this.addListeners());
|
|
2598
|
+
} }, { key: "addListeners", value: function() {
|
|
2599
|
+
typeof window > "u" || this.useIntersectionObserver || (this.scrollElement = U(f().findDOMNode(this.baseComponentRef.current)), this.scrollElement.addEventListener("scroll", this.delayedScroll, { passive: !0 }), window.addEventListener("resize", this.delayedScroll, { passive: !0 }), this.scrollElement !== window && window.addEventListener("scroll", this.delayedScroll, { passive: !0 }));
|
|
2600
|
+
} }, { key: "removeListeners", value: function() {
|
|
2601
|
+
typeof window > "u" || this.useIntersectionObserver || (this.scrollElement.removeEventListener("scroll", this.delayedScroll), window.removeEventListener("resize", this.delayedScroll), this.scrollElement !== window && window.removeEventListener("scroll", this.delayedScroll));
|
|
2602
|
+
} }, { key: "onChangeScroll", value: function() {
|
|
2603
|
+
this.useIntersectionObserver || this.setState({ scrollPosition: { x: te(), y: $() } });
|
|
2604
|
+
} }, { key: "render", value: function() {
|
|
2605
|
+
var T = this.props, P = (T.delayMethod, T.delayTime, function(D, z) {
|
|
2606
|
+
if (D == null)
|
|
2607
|
+
return {};
|
|
2608
|
+
var K, W, ce = function(he, ke) {
|
|
2609
|
+
if (he == null)
|
|
2610
|
+
return {};
|
|
2611
|
+
var Re, $e, bt = {}, wt = Object.keys(he);
|
|
2612
|
+
for ($e = 0; $e < wt.length; $e++)
|
|
2613
|
+
Re = wt[$e], ke.indexOf(Re) >= 0 || (bt[Re] = he[Re]);
|
|
2614
|
+
return bt;
|
|
2615
|
+
}(D, z);
|
|
2616
|
+
if (Object.getOwnPropertySymbols) {
|
|
2617
|
+
var J = Object.getOwnPropertySymbols(D);
|
|
2618
|
+
for (W = 0; W < J.length; W++)
|
|
2619
|
+
K = J[W], z.indexOf(K) >= 0 || Object.prototype.propertyIsEnumerable.call(D, K) && (ce[K] = D[K]);
|
|
2620
|
+
}
|
|
2621
|
+
return ce;
|
|
2622
|
+
}(T, G)), w = this.useIntersectionObserver ? null : this.state.scrollPosition;
|
|
2623
|
+
return a().createElement(g, Y({ forwardRef: this.baseComponentRef, scrollPosition: w }, P));
|
|
2624
|
+
} }]) && Z(v.prototype, k), Object.defineProperty(v, "prototype", { writable: !1 }), p;
|
|
2625
|
+
}(a().Component);
|
|
2626
|
+
return c.propTypes = { delayMethod: i.PropTypes.oneOf(["debounce", "throttle"]), delayTime: i.PropTypes.number, useIntersectionObserver: i.PropTypes.bool }, c.defaultProps = { delayMethod: "throttle", delayTime: 300, useIntersectionObserver: !0 }, c;
|
|
2627
|
+
};
|
|
2628
|
+
function fe(g) {
|
|
2629
|
+
return fe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
|
|
2630
|
+
return typeof c;
|
|
2631
|
+
} : function(c) {
|
|
2632
|
+
return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
|
|
2633
|
+
}, fe(g);
|
|
2634
|
+
}
|
|
2635
|
+
function oe(g, c) {
|
|
2636
|
+
for (var m = 0; m < c.length; m++) {
|
|
2637
|
+
var v = c[m];
|
|
2638
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(g, (k = function(_, q) {
|
|
2639
|
+
if (fe(_) !== "object" || _ === null)
|
|
2640
|
+
return _;
|
|
2641
|
+
var l = _[Symbol.toPrimitive];
|
|
2642
|
+
if (l !== void 0) {
|
|
2643
|
+
var p = l.call(_, "string");
|
|
2644
|
+
if (fe(p) !== "object")
|
|
2645
|
+
return p;
|
|
2646
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2647
|
+
}
|
|
2648
|
+
return String(_);
|
|
2649
|
+
}(v.key), fe(k) === "symbol" ? k : String(k)), v);
|
|
2650
|
+
}
|
|
2651
|
+
var k;
|
|
2652
|
+
}
|
|
2653
|
+
function ie(g, c) {
|
|
2654
|
+
return ie = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, v) {
|
|
2655
|
+
return m.__proto__ = v, m;
|
|
2656
|
+
}, ie(g, c);
|
|
2657
|
+
}
|
|
2658
|
+
function de(g) {
|
|
2659
|
+
return de = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(c) {
|
|
2660
|
+
return c.__proto__ || Object.getPrototypeOf(c);
|
|
2661
|
+
}, de(g);
|
|
2662
|
+
}
|
|
2663
|
+
var _e = function(g) {
|
|
2664
|
+
(function(l, p) {
|
|
2665
|
+
if (typeof p != "function" && p !== null)
|
|
2666
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
2667
|
+
l.prototype = Object.create(p && p.prototype, { constructor: { value: l, writable: !0, configurable: !0 } }), Object.defineProperty(l, "prototype", { writable: !1 }), p && ie(l, p);
|
|
2668
|
+
})(q, g);
|
|
2669
|
+
var c, m, v, k, _ = (v = q, k = function() {
|
|
2670
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
2671
|
+
return !1;
|
|
2672
|
+
if (typeof Proxy == "function")
|
|
2673
|
+
return !0;
|
|
2674
|
+
try {
|
|
2675
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
2676
|
+
})), !0;
|
|
2677
|
+
} catch {
|
|
2678
|
+
return !1;
|
|
2679
|
+
}
|
|
2680
|
+
}(), function() {
|
|
2681
|
+
var l, p = de(v);
|
|
2682
|
+
if (k) {
|
|
2683
|
+
var T = de(this).constructor;
|
|
2684
|
+
l = Reflect.construct(p, arguments, T);
|
|
2685
|
+
} else
|
|
2686
|
+
l = p.apply(this, arguments);
|
|
2687
|
+
return function(P, w) {
|
|
2688
|
+
if (w && (fe(w) === "object" || typeof w == "function"))
|
|
2689
|
+
return w;
|
|
2690
|
+
if (w !== void 0)
|
|
2691
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
2692
|
+
return function(D) {
|
|
2693
|
+
if (D === void 0)
|
|
2694
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2695
|
+
return D;
|
|
2696
|
+
}(P);
|
|
2697
|
+
}(this, l);
|
|
2698
|
+
});
|
|
2699
|
+
function q(l) {
|
|
2700
|
+
return function(p, T) {
|
|
2701
|
+
if (!(p instanceof T))
|
|
2702
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2703
|
+
}(this, q), _.call(this, l);
|
|
2704
|
+
}
|
|
2705
|
+
return c = q, (m = [{ key: "render", value: function() {
|
|
2706
|
+
return a().createElement(F, this.props);
|
|
2707
|
+
} }]) && oe(c.prototype, m), Object.defineProperty(c, "prototype", { writable: !1 }), q;
|
|
2708
|
+
}(a().Component);
|
|
2709
|
+
const Be = le(_e);
|
|
2710
|
+
function we(g) {
|
|
2711
|
+
return we = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
|
|
2712
|
+
return typeof c;
|
|
2713
|
+
} : function(c) {
|
|
2714
|
+
return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
|
|
2715
|
+
}, we(g);
|
|
2716
|
+
}
|
|
2717
|
+
function qe(g, c) {
|
|
2718
|
+
for (var m = 0; m < c.length; m++) {
|
|
2719
|
+
var v = c[m];
|
|
2720
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(g, (k = function(_, q) {
|
|
2721
|
+
if (we(_) !== "object" || _ === null)
|
|
2722
|
+
return _;
|
|
2723
|
+
var l = _[Symbol.toPrimitive];
|
|
2724
|
+
if (l !== void 0) {
|
|
2725
|
+
var p = l.call(_, "string");
|
|
2726
|
+
if (we(p) !== "object")
|
|
2727
|
+
return p;
|
|
2728
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2729
|
+
}
|
|
2730
|
+
return String(_);
|
|
2731
|
+
}(v.key), we(k) === "symbol" ? k : String(k)), v);
|
|
2732
|
+
}
|
|
2733
|
+
var k;
|
|
2734
|
+
}
|
|
2735
|
+
function Me(g, c) {
|
|
2736
|
+
return Me = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, v) {
|
|
2737
|
+
return m.__proto__ = v, m;
|
|
2738
|
+
}, Me(g, c);
|
|
2739
|
+
}
|
|
2740
|
+
function pe(g) {
|
|
2741
|
+
if (g === void 0)
|
|
2742
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2743
|
+
return g;
|
|
2744
|
+
}
|
|
2745
|
+
function ve(g) {
|
|
2746
|
+
return ve = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(c) {
|
|
2747
|
+
return c.__proto__ || Object.getPrototypeOf(c);
|
|
2748
|
+
}, ve(g);
|
|
2749
|
+
}
|
|
2750
|
+
var Pe = function(g) {
|
|
2751
|
+
(function(l, p) {
|
|
2752
|
+
if (typeof p != "function" && p !== null)
|
|
2753
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
2754
|
+
l.prototype = Object.create(p && p.prototype, { constructor: { value: l, writable: !0, configurable: !0 } }), Object.defineProperty(l, "prototype", { writable: !1 }), p && Me(l, p);
|
|
2755
|
+
})(q, g);
|
|
2756
|
+
var c, m, v, k, _ = (v = q, k = function() {
|
|
2757
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
2758
|
+
return !1;
|
|
2759
|
+
if (typeof Proxy == "function")
|
|
2760
|
+
return !0;
|
|
2761
|
+
try {
|
|
2762
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
2763
|
+
})), !0;
|
|
2764
|
+
} catch {
|
|
2765
|
+
return !1;
|
|
2766
|
+
}
|
|
2767
|
+
}(), function() {
|
|
2768
|
+
var l, p = ve(v);
|
|
2769
|
+
if (k) {
|
|
2770
|
+
var T = ve(this).constructor;
|
|
2771
|
+
l = Reflect.construct(p, arguments, T);
|
|
2772
|
+
} else
|
|
2773
|
+
l = p.apply(this, arguments);
|
|
2774
|
+
return function(P, w) {
|
|
2775
|
+
if (w && (we(w) === "object" || typeof w == "function"))
|
|
2776
|
+
return w;
|
|
2777
|
+
if (w !== void 0)
|
|
2778
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
2779
|
+
return pe(P);
|
|
2780
|
+
}(this, l);
|
|
2781
|
+
});
|
|
2782
|
+
function q(l) {
|
|
2783
|
+
var p;
|
|
2784
|
+
(function(z, K) {
|
|
2785
|
+
if (!(z instanceof K))
|
|
2786
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2787
|
+
})(this, q), p = _.call(this, l);
|
|
2788
|
+
var T = l.afterLoad, P = l.beforeLoad, w = l.scrollPosition, D = l.visibleByDefault;
|
|
2789
|
+
return p.state = { visible: D }, D && (P(), T()), p.onVisible = p.onVisible.bind(pe(p)), p.isScrollTracked = !!(w && Number.isFinite(w.x) && w.x >= 0 && Number.isFinite(w.y) && w.y >= 0), p;
|
|
2790
|
+
}
|
|
2791
|
+
return c = q, (m = [{ key: "componentDidUpdate", value: function(l, p) {
|
|
2792
|
+
p.visible !== this.state.visible && this.props.afterLoad();
|
|
2793
|
+
} }, { key: "onVisible", value: function() {
|
|
2794
|
+
this.props.beforeLoad(), this.setState({ visible: !0 });
|
|
2795
|
+
} }, { key: "render", value: function() {
|
|
2796
|
+
if (this.state.visible)
|
|
2797
|
+
return this.props.children;
|
|
2798
|
+
var l = this.props, p = l.className, T = l.delayMethod, P = l.delayTime, w = l.height, D = l.placeholder, z = l.scrollPosition, K = l.style, W = l.threshold, ce = l.useIntersectionObserver, J = l.width;
|
|
2799
|
+
return this.isScrollTracked || ce && h() ? a().createElement(F, { className: p, height: w, onVisible: this.onVisible, placeholder: D, scrollPosition: z, style: K, threshold: W, useIntersectionObserver: ce, width: J }) : a().createElement(Be, { className: p, delayMethod: T, delayTime: P, height: w, onVisible: this.onVisible, placeholder: D, style: K, threshold: W, width: J });
|
|
2800
|
+
} }]) && qe(c.prototype, m), Object.defineProperty(c, "prototype", { writable: !1 }), q;
|
|
2801
|
+
}(a().Component);
|
|
2802
|
+
Pe.propTypes = { afterLoad: i.PropTypes.func, beforeLoad: i.PropTypes.func, useIntersectionObserver: i.PropTypes.bool, visibleByDefault: i.PropTypes.bool }, Pe.defaultProps = { afterLoad: function() {
|
|
2803
|
+
return {};
|
|
2804
|
+
}, beforeLoad: function() {
|
|
2805
|
+
return {};
|
|
2806
|
+
}, useIntersectionObserver: !0, visibleByDefault: !1 };
|
|
2807
|
+
const yt = Pe;
|
|
2808
|
+
function Ae(g) {
|
|
2809
|
+
return Ae = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
|
|
2810
|
+
return typeof c;
|
|
2811
|
+
} : function(c) {
|
|
2812
|
+
return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
|
|
2813
|
+
}, Ae(g);
|
|
2814
|
+
}
|
|
2815
|
+
var yn = ["afterLoad", "beforeLoad", "delayMethod", "delayTime", "effect", "placeholder", "placeholderSrc", "scrollPosition", "threshold", "useIntersectionObserver", "visibleByDefault", "wrapperClassName", "wrapperProps"];
|
|
2816
|
+
function gt(g, c) {
|
|
2817
|
+
var m = Object.keys(g);
|
|
2818
|
+
if (Object.getOwnPropertySymbols) {
|
|
2819
|
+
var v = Object.getOwnPropertySymbols(g);
|
|
2820
|
+
c && (v = v.filter(function(k) {
|
|
2821
|
+
return Object.getOwnPropertyDescriptor(g, k).enumerable;
|
|
2822
|
+
})), m.push.apply(m, v);
|
|
2823
|
+
}
|
|
2824
|
+
return m;
|
|
2825
|
+
}
|
|
2826
|
+
function mt(g) {
|
|
2827
|
+
for (var c = 1; c < arguments.length; c++) {
|
|
2828
|
+
var m = arguments[c] != null ? arguments[c] : {};
|
|
2829
|
+
c % 2 ? gt(Object(m), !0).forEach(function(v) {
|
|
2830
|
+
gn(g, v, m[v]);
|
|
2831
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(g, Object.getOwnPropertyDescriptors(m)) : gt(Object(m)).forEach(function(v) {
|
|
2832
|
+
Object.defineProperty(g, v, Object.getOwnPropertyDescriptor(m, v));
|
|
2833
|
+
});
|
|
2834
|
+
}
|
|
2835
|
+
return g;
|
|
2836
|
+
}
|
|
2837
|
+
function gn(g, c, m) {
|
|
2838
|
+
return (c = vt(c)) in g ? Object.defineProperty(g, c, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : g[c] = m, g;
|
|
2839
|
+
}
|
|
2840
|
+
function Fe() {
|
|
2841
|
+
return Fe = Object.assign ? Object.assign.bind() : function(g) {
|
|
2842
|
+
for (var c = 1; c < arguments.length; c++) {
|
|
2843
|
+
var m = arguments[c];
|
|
2844
|
+
for (var v in m)
|
|
2845
|
+
Object.prototype.hasOwnProperty.call(m, v) && (g[v] = m[v]);
|
|
2846
|
+
}
|
|
2847
|
+
return g;
|
|
2848
|
+
}, Fe.apply(this, arguments);
|
|
2849
|
+
}
|
|
2850
|
+
function mn(g, c) {
|
|
2851
|
+
for (var m = 0; m < c.length; m++) {
|
|
2852
|
+
var v = c[m];
|
|
2853
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(g, vt(v.key), v);
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
function vt(g) {
|
|
2857
|
+
var c = function(m, v) {
|
|
2858
|
+
if (Ae(m) !== "object" || m === null)
|
|
2859
|
+
return m;
|
|
2860
|
+
var k = m[Symbol.toPrimitive];
|
|
2861
|
+
if (k !== void 0) {
|
|
2862
|
+
var _ = k.call(m, "string");
|
|
2863
|
+
if (Ae(_) !== "object")
|
|
2864
|
+
return _;
|
|
2865
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2866
|
+
}
|
|
2867
|
+
return String(m);
|
|
2868
|
+
}(g);
|
|
2869
|
+
return Ae(c) === "symbol" ? c : String(c);
|
|
2870
|
+
}
|
|
2871
|
+
function Ze(g, c) {
|
|
2872
|
+
return Ze = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, v) {
|
|
2873
|
+
return m.__proto__ = v, m;
|
|
2874
|
+
}, Ze(g, c);
|
|
2875
|
+
}
|
|
2876
|
+
function Ue(g) {
|
|
2877
|
+
return Ue = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(c) {
|
|
2878
|
+
return c.__proto__ || Object.getPrototypeOf(c);
|
|
2879
|
+
}, Ue(g);
|
|
2880
|
+
}
|
|
2881
|
+
var et = function(g) {
|
|
2882
|
+
(function(l, p) {
|
|
2883
|
+
if (typeof p != "function" && p !== null)
|
|
2884
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
2885
|
+
l.prototype = Object.create(p && p.prototype, { constructor: { value: l, writable: !0, configurable: !0 } }), Object.defineProperty(l, "prototype", { writable: !1 }), p && Ze(l, p);
|
|
2886
|
+
})(q, g);
|
|
2887
|
+
var c, m, v, k, _ = (v = q, k = function() {
|
|
2888
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
2889
|
+
return !1;
|
|
2890
|
+
if (typeof Proxy == "function")
|
|
2891
|
+
return !0;
|
|
2892
|
+
try {
|
|
2893
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
2894
|
+
})), !0;
|
|
2895
|
+
} catch {
|
|
2896
|
+
return !1;
|
|
2897
|
+
}
|
|
2898
|
+
}(), function() {
|
|
2899
|
+
var l, p = Ue(v);
|
|
2900
|
+
if (k) {
|
|
2901
|
+
var T = Ue(this).constructor;
|
|
2902
|
+
l = Reflect.construct(p, arguments, T);
|
|
2903
|
+
} else
|
|
2904
|
+
l = p.apply(this, arguments);
|
|
2905
|
+
return function(P, w) {
|
|
2906
|
+
if (w && (Ae(w) === "object" || typeof w == "function"))
|
|
2907
|
+
return w;
|
|
2908
|
+
if (w !== void 0)
|
|
2909
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
2910
|
+
return function(D) {
|
|
2911
|
+
if (D === void 0)
|
|
2912
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2913
|
+
return D;
|
|
2914
|
+
}(P);
|
|
2915
|
+
}(this, l);
|
|
2916
|
+
});
|
|
2917
|
+
function q(l) {
|
|
2918
|
+
var p;
|
|
2919
|
+
return function(T, P) {
|
|
2920
|
+
if (!(T instanceof P))
|
|
2921
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2922
|
+
}(this, q), (p = _.call(this, l)).state = { loaded: !1 }, p;
|
|
2923
|
+
}
|
|
2924
|
+
return c = q, (m = [{ key: "onImageLoad", value: function() {
|
|
2925
|
+
var l = this;
|
|
2926
|
+
return this.state.loaded ? null : function(p) {
|
|
2927
|
+
l.props.onLoad(p), l.props.afterLoad(), l.setState({ loaded: !0 });
|
|
2928
|
+
};
|
|
2929
|
+
} }, { key: "getImg", value: function() {
|
|
2930
|
+
var l = this.props, p = (l.afterLoad, l.beforeLoad, l.delayMethod, l.delayTime, l.effect, l.placeholder, l.placeholderSrc, l.scrollPosition, l.threshold, l.useIntersectionObserver, l.visibleByDefault, l.wrapperClassName, l.wrapperProps, function(T, P) {
|
|
2931
|
+
if (T == null)
|
|
2932
|
+
return {};
|
|
2933
|
+
var w, D, z = function(W, ce) {
|
|
2934
|
+
if (W == null)
|
|
2935
|
+
return {};
|
|
2936
|
+
var J, he, ke = {}, Re = Object.keys(W);
|
|
2937
|
+
for (he = 0; he < Re.length; he++)
|
|
2938
|
+
J = Re[he], ce.indexOf(J) >= 0 || (ke[J] = W[J]);
|
|
2939
|
+
return ke;
|
|
2940
|
+
}(T, P);
|
|
2941
|
+
if (Object.getOwnPropertySymbols) {
|
|
2942
|
+
var K = Object.getOwnPropertySymbols(T);
|
|
2943
|
+
for (D = 0; D < K.length; D++)
|
|
2944
|
+
w = K[D], P.indexOf(w) >= 0 || Object.prototype.propertyIsEnumerable.call(T, w) && (z[w] = T[w]);
|
|
2945
|
+
}
|
|
2946
|
+
return z;
|
|
2947
|
+
}(l, yn));
|
|
2948
|
+
return a().createElement("img", Fe({}, p, { onLoad: this.onImageLoad() }));
|
|
2949
|
+
} }, { key: "getLazyLoadImage", value: function() {
|
|
2950
|
+
var l = this.props, p = l.beforeLoad, T = l.className, P = l.delayMethod, w = l.delayTime, D = l.height, z = l.placeholder, K = l.scrollPosition, W = l.style, ce = l.threshold, J = l.useIntersectionObserver, he = l.visibleByDefault, ke = l.width;
|
|
2951
|
+
return a().createElement(yt, { beforeLoad: p, className: T, delayMethod: P, delayTime: w, height: D, placeholder: z, scrollPosition: K, style: W, threshold: ce, useIntersectionObserver: J, visibleByDefault: he, width: ke }, this.getImg());
|
|
2952
|
+
} }, { key: "getWrappedLazyLoadImage", value: function(l) {
|
|
2953
|
+
var p = this.props, T = p.effect, P = p.height, w = p.placeholderSrc, D = p.width, z = p.wrapperClassName, K = p.wrapperProps, W = this.state.loaded, ce = W ? " lazy-load-image-loaded" : "", J = W || !w ? {} : { backgroundImage: "url(".concat(w, ")"), backgroundSize: "100% 100%" };
|
|
2954
|
+
return a().createElement("span", Fe({ className: z + " lazy-load-image-background " + T + ce, style: mt(mt({}, J), {}, { color: "transparent", display: "inline-block", height: P, width: D }) }, K), l);
|
|
2955
|
+
} }, { key: "render", value: function() {
|
|
2956
|
+
var l = this.props, p = l.effect, T = l.placeholderSrc, P = l.visibleByDefault, w = l.wrapperClassName, D = l.wrapperProps, z = this.getLazyLoadImage();
|
|
2957
|
+
return (p || T) && !P || w || D ? this.getWrappedLazyLoadImage(z) : z;
|
|
2958
|
+
} }]) && mn(c.prototype, m), Object.defineProperty(c, "prototype", { writable: !1 }), q;
|
|
2959
|
+
}(a().Component);
|
|
2960
|
+
et.propTypes = { onLoad: i.PropTypes.func, afterLoad: i.PropTypes.func, beforeLoad: i.PropTypes.func, delayMethod: i.PropTypes.string, delayTime: i.PropTypes.number, effect: i.PropTypes.string, placeholderSrc: i.PropTypes.string, threshold: i.PropTypes.number, useIntersectionObserver: i.PropTypes.bool, visibleByDefault: i.PropTypes.bool, wrapperClassName: i.PropTypes.string, wrapperProps: i.PropTypes.object }, et.defaultProps = { onLoad: function() {
|
|
2961
|
+
}, afterLoad: function() {
|
|
2962
|
+
return {};
|
|
2963
|
+
}, beforeLoad: function() {
|
|
2964
|
+
return {};
|
|
2965
|
+
}, delayMethod: "throttle", delayTime: 300, effect: "", placeholderSrc: null, threshold: 100, useIntersectionObserver: !0, visibleByDefault: !1, wrapperClassName: "" };
|
|
2966
|
+
const vn = et;
|
|
2967
|
+
})(), pn.exports = o;
|
|
2968
|
+
})();
|
|
2969
|
+
var ro = pn.exports;
|
|
2970
|
+
function oo(e, t, n = [], o = !1, r = []) {
|
|
2971
|
+
if (r.length && (t = t.filter((i) => r.indexOf(i) === -1)), !t || t.length === 0)
|
|
2972
|
+
return;
|
|
2973
|
+
if (t.length === 1)
|
|
2974
|
+
return t[0];
|
|
2975
|
+
if (!e)
|
|
2976
|
+
return t.indexOf("none") !== -1 ? "none" : t[0];
|
|
2977
|
+
if (t.indexOf(e) !== -1)
|
|
2978
|
+
return e;
|
|
2979
|
+
const a = e.indexOf("-") !== -1 ? e.slice(0, e.indexOf("-")) : null;
|
|
2980
|
+
if (a && t.indexOf(a) !== -1)
|
|
2981
|
+
return a;
|
|
2982
|
+
for (const i of n)
|
|
2983
|
+
if (t.indexOf(i) !== -1)
|
|
2984
|
+
return i;
|
|
2985
|
+
if (!o && e) {
|
|
2986
|
+
const i = t.map((s) => s.indexOf("-") !== -1 ? s.slice(0, s.indexOf("-")) : null).indexOf(e);
|
|
2987
|
+
if (i !== -1)
|
|
2988
|
+
return t[i];
|
|
2989
|
+
for (const s of n) {
|
|
2990
|
+
const f = s.indexOf("-") !== -1 ? s.slice(0, s.indexOf("-")) : null, h = f ? t.indexOf(f) : -1;
|
|
2991
|
+
if (h !== -1)
|
|
2992
|
+
return t[h];
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
return t.indexOf("none") !== -1 ? "none" : t.indexOf("@none") !== -1 ? "@none" : t[0];
|
|
2996
|
+
}
|
|
2997
|
+
function hn(e, t, n = {}) {
|
|
2998
|
+
const {
|
|
2999
|
+
strictFallback: o = !1,
|
|
3000
|
+
defaultText: r = "",
|
|
3001
|
+
separator: a = `
|
|
3002
|
+
`,
|
|
3003
|
+
fallbackLanguages: i = [],
|
|
3004
|
+
closest: s,
|
|
3005
|
+
skipLanguages: f
|
|
3006
|
+
} = n, h = Object.keys(e || {}), u = s ? t : oo(t, h, i, o, f);
|
|
3007
|
+
if (!e)
|
|
3008
|
+
return r;
|
|
3009
|
+
if (typeof e == "string")
|
|
3010
|
+
return e;
|
|
3011
|
+
const y = u ? e[u] : void 0;
|
|
3012
|
+
if (y && u) {
|
|
3013
|
+
if (typeof y == "string")
|
|
3014
|
+
return y;
|
|
3015
|
+
if (y.length === 1 && y[0] === "") {
|
|
3016
|
+
const x = n.skipLanguages || [];
|
|
3017
|
+
return hn(e, t, {
|
|
3018
|
+
...n,
|
|
3019
|
+
skipLanguages: [...x, u]
|
|
3020
|
+
});
|
|
3021
|
+
}
|
|
3022
|
+
return y.join(a);
|
|
3023
|
+
}
|
|
3024
|
+
return "";
|
|
3025
|
+
}
|
|
3026
|
+
function io(e, t = {}) {
|
|
3027
|
+
return hn(
|
|
3028
|
+
e,
|
|
3029
|
+
t.language || (typeof navigator < "u" ? navigator.language : "en"),
|
|
3030
|
+
t
|
|
3031
|
+
);
|
|
3032
|
+
}
|
|
3033
|
+
const ao = ro.LazyLoadComponent;
|
|
3034
|
+
function so(e) {
|
|
3035
|
+
const { size: t, visible: n, classes: o, canvasId: r, figure: a } = e, i = (t == null ? void 0 : t.width) || 128, s = (t == null ? void 0 : t.height) || (t == null ? void 0 : t.width) || 128, f = /* @__PURE__ */ d(co, { ...e }), h = /* @__PURE__ */ d(ao, { threshold: 300, style: { height: s, width: i }, visibleByDefault: n, children: r ? /* @__PURE__ */ d(Qe, { canvas: r, children: f }) : f });
|
|
3036
|
+
return a ? /* @__PURE__ */ d("figure", { className: o == null ? void 0 : o.figure, children: h }) : h;
|
|
3037
|
+
}
|
|
3038
|
+
function co({ fallback: e, size: t, classes: n, showLabel: o, alt: r, dereference: a = !1 }) {
|
|
3039
|
+
const i = Se(), s = (t == null ? void 0 : t.width) || 128, f = (t == null ? void 0 : t.height) || (t == null ? void 0 : t.width) || 128, h = r || io(i == null ? void 0 : i.label) || "", u = Qt({ width: s, height: f }, a);
|
|
3040
|
+
return !u || u.type !== "fixed" ? /* @__PURE__ */ d(Oe, { children: e }) : /* @__PURE__ */ X(Oe, { children: [
|
|
3041
|
+
/* @__PURE__ */ d("div", { className: n == null ? void 0 : n.imageWrapper, children: /* @__PURE__ */ d("img", { className: n == null ? void 0 : n.img, src: u.id, alt: h }) }),
|
|
3042
|
+
o ? /* @__PURE__ */ d(Ne, { as: "figcaption", className: n == null ? void 0 : n.label, children: i == null ? void 0 : i.label }) : null
|
|
3043
|
+
] });
|
|
3044
|
+
}
|
|
3045
|
+
function Lo({ flat: e, size: t, classes: n = {}, showLabel: o, figure: r, fallback: a }) {
|
|
3046
|
+
var M, I, b, E, C, A;
|
|
3047
|
+
const i = Ee(null), { items: s, sequence: f, currentSequenceIndex: h, setSequenceIndex: u } = kt(), y = {
|
|
3048
|
+
row: ((M = n.selected) == null ? void 0 : M.row) || n.row,
|
|
3049
|
+
item: ((I = n.selected) == null ? void 0 : I.item) || n.item,
|
|
3050
|
+
figure: ((b = n.selected) == null ? void 0 : b.figure) || n.figure,
|
|
3051
|
+
img: ((E = n.selected) == null ? void 0 : E.img) || n.img,
|
|
3052
|
+
label: ((C = n.selected) == null ? void 0 : C.label) || n.label,
|
|
3053
|
+
imageWrapper: ((A = n.selected) == null ? void 0 : A.imageWrapper) || n.imageWrapper
|
|
3054
|
+
};
|
|
3055
|
+
st(() => {
|
|
3056
|
+
if (!i.current)
|
|
3057
|
+
return;
|
|
3058
|
+
const S = i.current.querySelector("[data-selected=true]");
|
|
3059
|
+
S && S.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" });
|
|
3060
|
+
}, [h]);
|
|
3061
|
+
const x = [];
|
|
3062
|
+
for (const S of f) {
|
|
3063
|
+
const F = [], L = f[h] === S;
|
|
3064
|
+
for (const R of S) {
|
|
3065
|
+
const B = s[R];
|
|
3066
|
+
F.push(
|
|
3067
|
+
/* @__PURE__ */ d("div", { className: L ? y.item : n.item, children: /* @__PURE__ */ d(
|
|
3068
|
+
so,
|
|
3069
|
+
{
|
|
3070
|
+
classes: L ? y : n,
|
|
3071
|
+
canvasId: B.id,
|
|
3072
|
+
size: t,
|
|
3073
|
+
showLabel: o,
|
|
3074
|
+
figure: r,
|
|
3075
|
+
placeholder: /* @__PURE__ */ d("div", { style: { height: 128, width: 128 } }),
|
|
3076
|
+
fallback: a
|
|
3077
|
+
}
|
|
3078
|
+
) }, R)
|
|
3079
|
+
);
|
|
3080
|
+
}
|
|
3081
|
+
if (e) {
|
|
3082
|
+
x.push(F);
|
|
3083
|
+
continue;
|
|
3084
|
+
}
|
|
3085
|
+
x.push(
|
|
3086
|
+
/* @__PURE__ */ d(
|
|
3087
|
+
"div",
|
|
3088
|
+
{
|
|
3089
|
+
onClick: (R) => {
|
|
3090
|
+
u(f.indexOf(S));
|
|
3091
|
+
},
|
|
3092
|
+
"data-selected": L,
|
|
3093
|
+
className: L ? y.row : n.row,
|
|
3094
|
+
children: F
|
|
3095
|
+
}
|
|
3096
|
+
)
|
|
3097
|
+
);
|
|
3098
|
+
}
|
|
3099
|
+
return /* @__PURE__ */ d("div", { ref: i, className: n.container, children: x });
|
|
3100
|
+
}
|
|
3101
|
+
function Ao({ annotation: e, children: t }) {
|
|
3102
|
+
return /* @__PURE__ */ d(Le, { value: { annotation: e }, children: t });
|
|
3103
|
+
}
|
|
3104
|
+
function ko({ annotationPage: e, children: t }) {
|
|
3105
|
+
return /* @__PURE__ */ d(Le, { value: { annotationPage: e }, children: t });
|
|
3106
|
+
}
|
|
3107
|
+
function No({ collection: e, children: t }) {
|
|
3108
|
+
return /* @__PURE__ */ d(Le, { value: { collection: e }, children: t });
|
|
3109
|
+
}
|
|
3110
|
+
function Vo(e, t = {}) {
|
|
3111
|
+
return dt(t);
|
|
3112
|
+
}
|
|
3113
|
+
function _o(e, t = !1) {
|
|
3114
|
+
}
|
|
3115
|
+
function Do(e) {
|
|
3116
|
+
const n = je().manifest, o = e ? e.map((r) => typeof r == "string" ? r : r == null ? void 0 : r.id) : [];
|
|
3117
|
+
return ye(
|
|
3118
|
+
(r) => {
|
|
3119
|
+
const a = n ? r.iiif.entities.Manifest[n] : void 0, i = (a == null ? void 0 : a.items) || [];
|
|
1912
3120
|
if (typeof e > "u")
|
|
1913
|
-
return
|
|
3121
|
+
return i;
|
|
1914
3122
|
const s = [];
|
|
1915
|
-
for (const
|
|
1916
|
-
|
|
3123
|
+
for (const f of (a == null ? void 0 : a.items) || [])
|
|
3124
|
+
o.indexOf(f.id) !== -1 && s.push(f);
|
|
1917
3125
|
return s;
|
|
1918
3126
|
},
|
|
1919
|
-
[
|
|
3127
|
+
[o.join("/")]
|
|
1920
3128
|
);
|
|
1921
3129
|
}
|
|
1922
|
-
function
|
|
1923
|
-
const { id: n, selector:
|
|
1924
|
-
(s) =>
|
|
1925
|
-
[
|
|
3130
|
+
function Bo(e, t = []) {
|
|
3131
|
+
const { id: n, selector: o } = e, r = je(), a = n || r.collection, i = ye(
|
|
3132
|
+
(s) => a ? s.iiif.entities.Collection[a] : void 0,
|
|
3133
|
+
[a]
|
|
1926
3134
|
);
|
|
1927
|
-
return
|
|
1928
|
-
if (
|
|
1929
|
-
return
|
|
1930
|
-
}, [
|
|
1931
|
-
}
|
|
1932
|
-
function
|
|
1933
|
-
const
|
|
1934
|
-
|
|
3135
|
+
return N(() => {
|
|
3136
|
+
if (i)
|
|
3137
|
+
return o ? o(i) : i;
|
|
3138
|
+
}, [i, o, ...t]);
|
|
3139
|
+
}
|
|
3140
|
+
function qo(e, t, n, o, r = []) {
|
|
3141
|
+
const a = re(), i = N(() => qt(a), [a]);
|
|
3142
|
+
be(() => {
|
|
1935
3143
|
const s = e;
|
|
1936
|
-
return s ? (
|
|
1937
|
-
|
|
3144
|
+
return s ? (i.addEventListener(s, t, n, o), () => {
|
|
3145
|
+
i.removeEventListener(s, t, n);
|
|
1938
3146
|
}) : () => {
|
|
1939
3147
|
};
|
|
1940
|
-
}, [
|
|
3148
|
+
}, [i, e, t, ...r]);
|
|
1941
3149
|
}
|
|
1942
|
-
function
|
|
1943
|
-
const { id: n, isLoaded:
|
|
3150
|
+
function Fo(e, t) {
|
|
3151
|
+
const { id: n, isLoaded: o, error: r, resource: a, requestId: i, cached: s } = Ct(
|
|
1944
3152
|
e,
|
|
1945
3153
|
t
|
|
1946
3154
|
);
|
|
1947
|
-
return { id: n, isLoaded:
|
|
3155
|
+
return { id: n, isLoaded: o, error: r, manifest: a, requestId: i, cached: s };
|
|
1948
3156
|
}
|
|
1949
|
-
function
|
|
1950
|
-
const t =
|
|
3157
|
+
function uo({ cacheKey: e } = {}) {
|
|
3158
|
+
const t = Se(), n = dt(), o = re(), r = Je(), [a, i] = ae(void 0), [s, f] = ae(!1), [h, u] = ae("idle"), [y, x] = ae(void 0), M = t ? t.id : "undefined", I = N(() => {
|
|
1951
3159
|
try {
|
|
1952
3160
|
if (t && n.length) {
|
|
1953
|
-
const
|
|
1954
|
-
return S &&
|
|
3161
|
+
const E = n[0], C = o.get(E.body[0]), S = it(C)[0];
|
|
3162
|
+
return S && r.loadServiceSync({
|
|
1955
3163
|
id: S.id || S["@id"],
|
|
1956
3164
|
width: S.width || t.width,
|
|
1957
3165
|
height: S.height || t.height
|
|
1958
3166
|
}) || void 0;
|
|
1959
3167
|
}
|
|
1960
|
-
} catch (
|
|
1961
|
-
console.error(
|
|
3168
|
+
} catch (E) {
|
|
3169
|
+
console.error(E);
|
|
1962
3170
|
}
|
|
1963
|
-
}, [
|
|
1964
|
-
return
|
|
3171
|
+
}, [M, e, t]), b = h === "success" && a ? a : I;
|
|
3172
|
+
return be(() => {
|
|
1965
3173
|
(async () => {
|
|
1966
3174
|
try {
|
|
1967
3175
|
if (t && n.length) {
|
|
1968
|
-
const
|
|
3176
|
+
const E = n[0], C = o.get(E.body[0]), S = it(C)[0];
|
|
1969
3177
|
if (!S)
|
|
1970
3178
|
return;
|
|
1971
|
-
|
|
3179
|
+
f(!0), u("loading");
|
|
1972
3180
|
try {
|
|
1973
|
-
const
|
|
3181
|
+
const F = await r.loadService({
|
|
1974
3182
|
id: S.id || S["@id"],
|
|
1975
3183
|
width: S.width || t.width,
|
|
1976
3184
|
height: S.height || t.height
|
|
1977
3185
|
}) || void 0;
|
|
1978
|
-
|
|
1979
|
-
} catch (
|
|
1980
|
-
u("error"),
|
|
3186
|
+
i(F), u("success"), f(!1);
|
|
3187
|
+
} catch (F) {
|
|
3188
|
+
u("error"), x(F);
|
|
1981
3189
|
}
|
|
1982
3190
|
}
|
|
1983
|
-
} catch (
|
|
1984
|
-
u("error"),
|
|
3191
|
+
} catch (E) {
|
|
3192
|
+
u("error"), x(E);
|
|
1985
3193
|
}
|
|
1986
3194
|
})();
|
|
1987
|
-
}, [
|
|
1988
|
-
data:
|
|
3195
|
+
}, [M, e]), N(() => ({
|
|
3196
|
+
data: b,
|
|
1989
3197
|
isFetching: s,
|
|
1990
|
-
status:
|
|
1991
|
-
error:
|
|
1992
|
-
}), [
|
|
3198
|
+
status: h,
|
|
3199
|
+
error: y
|
|
3200
|
+
}), [b, s, h, y]);
|
|
1993
3201
|
}
|
|
1994
|
-
function
|
|
1995
|
-
const e =
|
|
3202
|
+
function Uo() {
|
|
3203
|
+
const e = uo();
|
|
1996
3204
|
return {
|
|
1997
3205
|
isLoading: e.isFetching,
|
|
1998
3206
|
tile: e.data ? {
|
|
@@ -2004,106 +3212,114 @@ function Pr() {
|
|
|
2004
3212
|
} : null
|
|
2005
3213
|
};
|
|
2006
3214
|
}
|
|
2007
|
-
function
|
|
2008
|
-
const e =
|
|
3215
|
+
function $o() {
|
|
3216
|
+
const e = Ce();
|
|
2009
3217
|
return e ? e.service.find(
|
|
2010
3218
|
(t) => t.profile === "SearchService1" || t.profile === "http://iiif.io/api/search/1/search"
|
|
2011
3219
|
) : void 0;
|
|
2012
3220
|
}
|
|
2013
|
-
function
|
|
2014
|
-
const e =
|
|
2015
|
-
return
|
|
3221
|
+
function Wo() {
|
|
3222
|
+
const e = re();
|
|
3223
|
+
return N(() => ut(e), [e]);
|
|
2016
3224
|
}
|
|
2017
3225
|
export {
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
3226
|
+
Ao as AnnotationContext,
|
|
3227
|
+
ko as AnnotationPageContext,
|
|
3228
|
+
jo as CanvasAnnotations,
|
|
3229
|
+
Qe as CanvasContext,
|
|
3230
|
+
ge as CanvasPanel,
|
|
3231
|
+
No as CollectionContext,
|
|
3232
|
+
Mo as CombinedMetadata,
|
|
3233
|
+
zn as ContextBridge,
|
|
3234
|
+
no as Image,
|
|
3235
|
+
Mr as ImageServiceLoaderContext,
|
|
3236
|
+
Wn as InnerViewerProvider,
|
|
3237
|
+
Io as LanguageProvider,
|
|
3238
|
+
Kr as LanguageString,
|
|
3239
|
+
Ne as LocaleString,
|
|
3240
|
+
qn as ManifestContext,
|
|
3241
|
+
Ro as ManifestMetadata,
|
|
3242
|
+
Zt as MediaPlayerProvider,
|
|
3243
|
+
fn as Metadata,
|
|
3244
|
+
Fn as RangeContext,
|
|
3245
|
+
Ke as ReactVaultContext,
|
|
3246
|
+
Le as ResourceProvider,
|
|
3247
|
+
lt as ResourceReactContext,
|
|
3248
|
+
Lo as SequenceThumbnails,
|
|
3249
|
+
Hn as SimpleViewerProvider,
|
|
3250
|
+
Xe as SimpleViewerReactContext,
|
|
3251
|
+
so as SingleCanvasThumbnail,
|
|
3252
|
+
It as VaultProvider,
|
|
3253
|
+
ft as ViewerPresetContext,
|
|
3254
|
+
mr as VirtualAnnotationProvider,
|
|
3255
|
+
Ge as VisibleCanvasReactContext,
|
|
3256
|
+
Sr as emptyActions,
|
|
3257
|
+
xr as emptyStrategy,
|
|
3258
|
+
Mt as findAllCanvasesInRange,
|
|
3259
|
+
Un as findFirstCanvasFromRange,
|
|
3260
|
+
Po as findManifestSelectedRange,
|
|
3261
|
+
Rt as findSelectedRange,
|
|
3262
|
+
Ir as flattenAnnotationPageIds,
|
|
3263
|
+
zr as formatTime,
|
|
3264
|
+
Vr as get3dStrategy,
|
|
3265
|
+
Dr as getImageStrategy,
|
|
3266
|
+
Lt as getManifestSequence,
|
|
3267
|
+
Ht as getParsedTargetSelector,
|
|
3268
|
+
Ur as getRenderingStrategy,
|
|
3269
|
+
Br as getTextualContentStrategy,
|
|
3270
|
+
Fr as getVideoStrategy,
|
|
3271
|
+
Oo as getVisibleCanvasesFromCanvasId,
|
|
3272
|
+
So as parseSpecificResource,
|
|
3273
|
+
rt as unknownResponse,
|
|
3274
|
+
ne as unsupportedStrategy,
|
|
3275
|
+
Ut as useAnnotation,
|
|
3276
|
+
Or as useAnnotationPage,
|
|
3277
|
+
Yt as useAnnotationPageManager,
|
|
3278
|
+
Vo as useAnnotationsAtTime,
|
|
3279
|
+
Se as useCanvas,
|
|
3280
|
+
_o as useCanvasClock,
|
|
3281
|
+
$n as useCanvasSequence,
|
|
3282
|
+
Do as useCanvasSubset,
|
|
3283
|
+
Qr as useClosestLanguage,
|
|
3284
|
+
Bo as useCollection,
|
|
3285
|
+
Yn as useContextBridge,
|
|
3286
|
+
Co as useCreateLocaleString,
|
|
3287
|
+
hr as useDispatch,
|
|
3288
|
+
qo as useEventListener,
|
|
3289
|
+
Zr as useExistingVault,
|
|
3290
|
+
Fo as useExternalCollection,
|
|
3291
|
+
Bn as useExternalManifest,
|
|
3292
|
+
Ct as useExternalResource,
|
|
3293
|
+
ht as useIIIFLanguage,
|
|
3294
|
+
dn as useImage,
|
|
3295
|
+
uo as useImageService,
|
|
3296
|
+
Je as useImageServiceLoader,
|
|
3297
|
+
Uo as useImageTile,
|
|
3298
|
+
Rr as useLoadImageService,
|
|
3299
|
+
Gr as useLocaleString,
|
|
3300
|
+
Ce as useManifest,
|
|
3301
|
+
To as useMediaActions,
|
|
3302
|
+
Eo as useMediaElements,
|
|
3303
|
+
xo as useMediaState,
|
|
3304
|
+
kr as usePaintables,
|
|
3305
|
+
dt as usePaintingAnnotations,
|
|
3306
|
+
At as useRange,
|
|
3307
|
+
$r as useRenderingStrategy,
|
|
3308
|
+
je as useResourceContext,
|
|
3309
|
+
Ft as useResourceEvents,
|
|
3310
|
+
jr as useResources,
|
|
3311
|
+
$o as useSearchService,
|
|
3312
|
+
pt as useSimpleMediaPlayer,
|
|
3313
|
+
kt as useSimpleViewer,
|
|
3314
|
+
Wo as useStyleHelper,
|
|
3315
|
+
ze as useStyles,
|
|
3316
|
+
Qt as useThumbnail,
|
|
3317
|
+
re as useVault,
|
|
3318
|
+
Wr as useVaultEffect,
|
|
3319
|
+
ye as useVaultSelector,
|
|
3320
|
+
br as useViewerPreset,
|
|
3321
|
+
yr as useVirtualAnnotationPage,
|
|
3322
|
+
gr as useVirtualAnnotationPageContext,
|
|
3323
|
+
jt as useVisibleCanvases
|
|
2108
3324
|
};
|
|
2109
3325
|
//# sourceMappingURL=index.mjs.map
|