dbf-mirador 4.3.0-testing2 → 4.3.0-testing3
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/dist/{CommentSharp-DaW0oBJy.js → CommentSharp-BJ6oQAe3.js} +2 -2
- package/dist/{CommentSharp-DaW0oBJy.js.map → CommentSharp-BJ6oQAe3.js.map} +1 -1
- package/dist/{FailedImageContext-DYZ9cZx9.js → FailedImageContext-BhA0TpVp.js} +22 -1
- package/dist/FailedImageContext-BhA0TpVp.js.map +1 -0
- package/dist/{GalleryView-DyLH1kk0.js → GalleryView-rCx0Q4f3.js} +3 -3
- package/dist/{GalleryView-DyLH1kk0.js.map → GalleryView-rCx0Q4f3.js.map} +1 -1
- package/dist/{OpenSeadragonViewer-CBmX5sYE.js → OpenSeadragonViewer-B_KV5sbU.js} +270 -233
- package/dist/{OpenSeadragonViewer-CBmX5sYE.js.map → OpenSeadragonViewer-B_KV5sbU.js.map} +1 -1
- package/dist/{WindowViewer-BW0_w7wv.js → WindowViewer-DMNeTH1_.js} +2 -2
- package/dist/{WindowViewer-BW0_w7wv.js.map → WindowViewer-DMNeTH1_.js.map} +1 -1
- package/dist/{WorkspaceArea-C0RjqnIL.js → WorkspaceArea-CzKnpSim.js} +4 -4
- package/dist/{WorkspaceArea-C0RjqnIL.js.map → WorkspaceArea-CzKnpSim.js.map} +1 -1
- package/dist/mirador.es.js +7 -7
- package/dist/mirador.min.js +72 -72
- package/dist/mirador.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AnnotationsOverlay.jsx +21 -6
- package/src/lib/AnnotationItem.js +18 -0
- package/src/lib/AnnotationResource.js +14 -0
- package/src/lib/CanvasAnnotationDisplay.js +76 -0
- package/dist/FailedImageContext-DYZ9cZx9.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { G as e, K as t, Q as n, S as r, U as i, Z as a, a as o, at as s, b as c, dt as l, ft as u, g as d, i as f, m as p, rt as m, st as h, ut as g } from "./getters-B4oepJRC.js";
|
|
2
2
|
import { At as _, I as v, It as y, Ut as b, _ as x, a as S, bt as C, c as w, fn as T, in as ee, m as E, mt as D, on as te, tn as ne, un as re, y as O } from "./canvases-DTR37lo-.js";
|
|
3
|
-
import { O as k, c as A, h as ie, k as ae, n as oe, r as j, t as M } from "./FailedImageContext-
|
|
3
|
+
import { O as k, c as A, h as ie, k as ae, n as oe, r as j, t as M } from "./FailedImageContext-BhA0TpVp.js";
|
|
4
4
|
import { d as N, f as P, l as F, m as I, n as L, o as R, t as z, u as se } from "./index.module-CgUBfaXx.js";
|
|
5
|
-
import { i as
|
|
6
|
-
import { i as
|
|
7
|
-
import { Children as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { useTranslation as
|
|
10
|
-
import { styled as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
5
|
+
import { i as ce } from "./canvas-2ACcnS9Y.js";
|
|
6
|
+
import { i as le, r as B, t as V } from "./PluginHook-DWFCXIIp.js";
|
|
7
|
+
import { Children as ue, cloneElement as H, createContext as U, useCallback as W, useContext as G, useEffect as K, useId as de, useMemo as q, useReducer as fe, useRef as J, useState as Y } from "react";
|
|
8
|
+
import { jsx as X, jsxs as pe } from "react/jsx-runtime";
|
|
9
|
+
import { useTranslation as me } from "react-i18next";
|
|
10
|
+
import { styled as he } from "@mui/material/styles";
|
|
11
|
+
import ge from "@mui/material/Typography";
|
|
12
|
+
import _e from "react-dom";
|
|
13
|
+
import ve from "@mui/material/Box";
|
|
14
14
|
//#region src/state/selectors/viewer.js
|
|
15
|
-
var
|
|
15
|
+
var ye = p([
|
|
16
16
|
x,
|
|
17
17
|
R,
|
|
18
18
|
v,
|
|
19
19
|
y
|
|
20
|
-
], (e, t, n, r) => new L(e.map(r), t, n)),
|
|
20
|
+
], (e, t, n, r) => new L(e.map(r), t, n)), be = /* @__PURE__ */ g(((e, t) => {
|
|
21
21
|
var n = ne(), i = r();
|
|
22
22
|
function a(e, t) {
|
|
23
23
|
var r = -1, a = i(e) ? Array(e.length) : [];
|
|
@@ -26,14 +26,14 @@ var ve = p([
|
|
|
26
26
|
}), a;
|
|
27
27
|
}
|
|
28
28
|
t.exports = a;
|
|
29
|
-
})),
|
|
29
|
+
})), xe = /* @__PURE__ */ g(((e, t) => {
|
|
30
30
|
function n(e, t) {
|
|
31
31
|
var n = e.length;
|
|
32
32
|
for (e.sort(t); n--;) e[n] = e[n].value;
|
|
33
33
|
return e;
|
|
34
34
|
}
|
|
35
35
|
t.exports = n;
|
|
36
|
-
})),
|
|
36
|
+
})), Se = /* @__PURE__ */ g(((e, t) => {
|
|
37
37
|
var r = n();
|
|
38
38
|
function i(e, t) {
|
|
39
39
|
if (e !== t) {
|
|
@@ -44,8 +44,8 @@ var ve = p([
|
|
|
44
44
|
return 0;
|
|
45
45
|
}
|
|
46
46
|
t.exports = i;
|
|
47
|
-
})),
|
|
48
|
-
var n =
|
|
47
|
+
})), Ce = /* @__PURE__ */ g(((e, t) => {
|
|
48
|
+
var n = Se();
|
|
49
49
|
function r(e, t, r) {
|
|
50
50
|
for (var i = -1, a = e.criteria, o = t.criteria, s = a.length, c = r.length; ++i < s;) {
|
|
51
51
|
var l = n(a[i], o[i]);
|
|
@@ -54,8 +54,8 @@ var ve = p([
|
|
|
54
54
|
return e.index - t.index;
|
|
55
55
|
}
|
|
56
56
|
t.exports = r;
|
|
57
|
-
})),
|
|
58
|
-
var r = re(), i = te(), a = b(), o =
|
|
57
|
+
})), we = /* @__PURE__ */ g(((t, n) => {
|
|
58
|
+
var r = re(), i = te(), a = b(), o = be(), s = xe(), l = c(), u = Ce(), d = e(), f = m();
|
|
59
59
|
function p(e, t, n) {
|
|
60
60
|
t = t.length ? r(t, function(e) {
|
|
61
61
|
return f(e) ? function(t) {
|
|
@@ -76,7 +76,7 @@ var ve = p([
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
n.exports = p;
|
|
79
|
-
})),
|
|
79
|
+
})), Te = /* @__PURE__ */ g(((e, n) => {
|
|
80
80
|
var i = T(), o = r(), s = t(), c = a();
|
|
81
81
|
function l(e, t, n) {
|
|
82
82
|
if (!c(n)) return !1;
|
|
@@ -84,14 +84,14 @@ var ve = p([
|
|
|
84
84
|
return (r == "number" ? o(n) && s(t, n.length) : r == "string" && t in n) ? i(n[t], e) : !1;
|
|
85
85
|
}
|
|
86
86
|
n.exports = l;
|
|
87
|
-
})),
|
|
88
|
-
var n = I(), r =
|
|
87
|
+
})), Ee = /* @__PURE__ */ g(((e, t) => {
|
|
88
|
+
var n = I(), r = we(), i = P(), a = Te();
|
|
89
89
|
t.exports = i(function(e, t) {
|
|
90
90
|
if (e == null) return [];
|
|
91
91
|
var i = t.length;
|
|
92
92
|
return i > 1 && a(e, t[0], t[1]) ? t = [] : i > 2 && a(t[0], t[1], t[2]) && (t = [t[0]]), r(e, n(t, 1), []);
|
|
93
93
|
});
|
|
94
|
-
})),
|
|
94
|
+
})), De = /* @__PURE__ */ g(((e, t) => {
|
|
95
95
|
var n = F(), r = I(), i = N();
|
|
96
96
|
function a(e, t, a) {
|
|
97
97
|
var o = e.length;
|
|
@@ -100,12 +100,12 @@ var ve = p([
|
|
|
100
100
|
return i(r(c, 1), t, a);
|
|
101
101
|
}
|
|
102
102
|
t.exports = a;
|
|
103
|
-
})),
|
|
104
|
-
var n = ee(), r = P(), i =
|
|
103
|
+
})), Oe = /* @__PURE__ */ g(((e, t) => {
|
|
104
|
+
var n = ee(), r = P(), i = De(), a = se();
|
|
105
105
|
t.exports = r(function(e) {
|
|
106
106
|
return i(n(e, a));
|
|
107
107
|
});
|
|
108
|
-
})),
|
|
108
|
+
})), ke = /* @__PURE__ */ g(((e, t) => {
|
|
109
109
|
function n(e) {
|
|
110
110
|
return new n.Viewer(e);
|
|
111
111
|
}
|
|
@@ -1163,7 +1163,7 @@ var ve = p([
|
|
|
1163
1163
|
z(a, e);
|
|
1164
1164
|
},
|
|
1165
1165
|
pointercancel: function(e) {
|
|
1166
|
-
|
|
1166
|
+
le(a, e);
|
|
1167
1167
|
},
|
|
1168
1168
|
pointerupcaptured: function(e) {
|
|
1169
1169
|
L(a, e);
|
|
@@ -1330,7 +1330,7 @@ var ve = p([
|
|
|
1330
1330
|
var t = n[e.hash], r, i, a, o, s, c = t.activePointersLists.length;
|
|
1331
1331
|
for (r = 0; r < c; r++) if (a = t.activePointersLists[r], a.getLength() > 0) {
|
|
1332
1332
|
for (s = [], o = a.asArray(), i = 0; i < o.length; i++) s.push(o[i]);
|
|
1333
|
-
for (i = 0; i < s.length; i++)
|
|
1333
|
+
for (i = 0; i < s.length; i++) V(e, a, s[i]);
|
|
1334
1334
|
}
|
|
1335
1335
|
for (r = 0; r < c; r++) t.activePointersLists.pop();
|
|
1336
1336
|
t.sentDragEvent = !1;
|
|
@@ -1379,7 +1379,7 @@ var ve = p([
|
|
|
1379
1379
|
}
|
|
1380
1380
|
else t.element.setCapture(!0);
|
|
1381
1381
|
} else a = c(t, e.MouseTracker.havePointerEvents ? "pointerevent" : n.type), r && i(window.top) && e.addEvent(window.top, a.upName, a.upHandler, !0), e.addEvent(e.MouseTracker.captureElement, a.upName, a.upHandler, !0), e.addEvent(e.MouseTracker.captureElement, a.moveName, a.moveHandler, !0);
|
|
1382
|
-
|
|
1382
|
+
U(t, n, !0);
|
|
1383
1383
|
}
|
|
1384
1384
|
function u(t, n) {
|
|
1385
1385
|
var a, o, s;
|
|
@@ -1391,7 +1391,7 @@ var ve = p([
|
|
|
1391
1391
|
} catch {}
|
|
1392
1392
|
} else t.element.releaseCapture();
|
|
1393
1393
|
} else a = c(t, e.MouseTracker.havePointerEvents ? "pointerevent" : n.type), r && i(window.top) && e.removeEvent(window.top, a.upName, a.upHandler, !0), e.removeEvent(e.MouseTracker.captureElement, a.moveName, a.moveHandler, !0), e.removeEvent(e.MouseTracker.captureElement, a.upName, a.upHandler, !0);
|
|
1394
|
-
|
|
1394
|
+
U(t, n, !1);
|
|
1395
1395
|
}
|
|
1396
1396
|
function d(t) {
|
|
1397
1397
|
return e.MouseTracker.havePointerEvents ? t.pointerId : e.MouseTracker.mousePointerId;
|
|
@@ -1422,7 +1422,7 @@ var ve = p([
|
|
|
1422
1422
|
pointerType: "mouse",
|
|
1423
1423
|
isEmulated: !1
|
|
1424
1424
|
};
|
|
1425
|
-
|
|
1425
|
+
H(t, r), r.preventDefault && !r.defaultPrevented && e.cancelEvent(n), r.stopPropagation && e.stopEvent(n);
|
|
1426
1426
|
}
|
|
1427
1427
|
function y(t, n) {
|
|
1428
1428
|
var r = {
|
|
@@ -1431,7 +1431,7 @@ var ve = p([
|
|
|
1431
1431
|
pointerType: "mouse",
|
|
1432
1432
|
isEmulated: !1
|
|
1433
1433
|
};
|
|
1434
|
-
|
|
1434
|
+
H(t, r), r.preventDefault && !r.defaultPrevented && e.cancelEvent(n), r.stopPropagation && e.stopEvent(n);
|
|
1435
1435
|
}
|
|
1436
1436
|
function b(t, n) {
|
|
1437
1437
|
var r = null, i = {
|
|
@@ -1440,7 +1440,7 @@ var ve = p([
|
|
|
1440
1440
|
pointerType: "",
|
|
1441
1441
|
isEmulated: !1
|
|
1442
1442
|
};
|
|
1443
|
-
|
|
1443
|
+
H(t, i), t.keyDownHandler && !i.preventGesture && !i.defaultPrevented && (r = {
|
|
1444
1444
|
eventSource: t,
|
|
1445
1445
|
keyCode: n.keyCode ? n.keyCode : n.charCode,
|
|
1446
1446
|
ctrl: n.ctrlKey,
|
|
@@ -1459,7 +1459,7 @@ var ve = p([
|
|
|
1459
1459
|
pointerType: "",
|
|
1460
1460
|
isEmulated: !1
|
|
1461
1461
|
};
|
|
1462
|
-
|
|
1462
|
+
H(t, i), t.keyUpHandler && !i.preventGesture && !i.defaultPrevented && (r = {
|
|
1463
1463
|
eventSource: t,
|
|
1464
1464
|
keyCode: n.keyCode ? n.keyCode : n.charCode,
|
|
1465
1465
|
ctrl: n.ctrlKey,
|
|
@@ -1478,7 +1478,7 @@ var ve = p([
|
|
|
1478
1478
|
pointerType: "",
|
|
1479
1479
|
isEmulated: !1
|
|
1480
1480
|
};
|
|
1481
|
-
|
|
1481
|
+
H(t, i), t.keyHandler && !i.preventGesture && !i.defaultPrevented && (r = {
|
|
1482
1482
|
eventSource: t,
|
|
1483
1483
|
keyCode: n.keyCode ? n.keyCode : n.charCode,
|
|
1484
1484
|
ctrl: n.ctrlKey,
|
|
@@ -1497,7 +1497,7 @@ var ve = p([
|
|
|
1497
1497
|
pointerType: "",
|
|
1498
1498
|
isEmulated: !1
|
|
1499
1499
|
};
|
|
1500
|
-
|
|
1500
|
+
H(e, n), e.focusHandler && !n.preventGesture && e.focusHandler({
|
|
1501
1501
|
eventSource: e,
|
|
1502
1502
|
originalEvent: t,
|
|
1503
1503
|
userData: e.userData
|
|
@@ -1510,7 +1510,7 @@ var ve = p([
|
|
|
1510
1510
|
pointerType: "",
|
|
1511
1511
|
isEmulated: !1
|
|
1512
1512
|
};
|
|
1513
|
-
|
|
1513
|
+
H(e, n), e.blurHandler && !n.preventGesture && e.blurHandler({
|
|
1514
1514
|
eventSource: e,
|
|
1515
1515
|
originalEvent: t,
|
|
1516
1516
|
userData: e.userData
|
|
@@ -1523,7 +1523,7 @@ var ve = p([
|
|
|
1523
1523
|
pointerType: "mouse",
|
|
1524
1524
|
isEmulated: !1
|
|
1525
1525
|
};
|
|
1526
|
-
|
|
1526
|
+
H(t, i), t.contextMenuHandler && !i.preventGesture && !i.defaultPrevented && (r = {
|
|
1527
1527
|
eventSource: t,
|
|
1528
1528
|
position: g(m(n), t.element),
|
|
1529
1529
|
originalEvent: i.originalEvent,
|
|
@@ -1556,7 +1556,7 @@ var ve = p([
|
|
|
1556
1556
|
eventType: "wheel",
|
|
1557
1557
|
pointerType: "mouse",
|
|
1558
1558
|
isEmulated: n !== r
|
|
1559
|
-
},
|
|
1559
|
+
}, H(t, a), t.scrollHandler && !a.preventGesture && !a.defaultPrevented && (o = {
|
|
1560
1560
|
eventSource: t,
|
|
1561
1561
|
pointerType: "mouse",
|
|
1562
1562
|
position: h(n, t.element),
|
|
@@ -1578,7 +1578,7 @@ var ve = p([
|
|
|
1578
1578
|
pointerType: "mouse",
|
|
1579
1579
|
isEmulated: !1
|
|
1580
1580
|
};
|
|
1581
|
-
|
|
1581
|
+
H(t, i), n.target === t.element && U(t, r, !1), i.stopPropagation && e.stopEvent(n);
|
|
1582
1582
|
}
|
|
1583
1583
|
function ne(t, n) {
|
|
1584
1584
|
var r, i, a = n.changedTouches.length, o, s = t.getActivePointersListByType("touch");
|
|
@@ -1589,13 +1589,13 @@ var ve = p([
|
|
|
1589
1589
|
pointerType: "touch",
|
|
1590
1590
|
isEmulated: !1
|
|
1591
1591
|
};
|
|
1592
|
-
for (
|
|
1592
|
+
for (H(t, c), i = 0; i < a; i++) o = {
|
|
1593
1593
|
id: n.changedTouches[i].identifier,
|
|
1594
1594
|
type: "touch",
|
|
1595
1595
|
isPrimary: s.getLength() === 0,
|
|
1596
1596
|
currentPos: m(n.changedTouches[i]),
|
|
1597
1597
|
currentTime: r
|
|
1598
|
-
},
|
|
1598
|
+
}, W(t, c, o), q(t, c, o, 0), U(t, o, !0);
|
|
1599
1599
|
c.preventDefault && !c.defaultPrevented && e.cancelEvent(n), c.stopPropagation && e.stopEvent(n);
|
|
1600
1600
|
}
|
|
1601
1601
|
function re(t, n) {
|
|
@@ -1607,12 +1607,12 @@ var ve = p([
|
|
|
1607
1607
|
pointerType: "touch",
|
|
1608
1608
|
isEmulated: !1
|
|
1609
1609
|
};
|
|
1610
|
-
for (
|
|
1610
|
+
for (H(t, s), i = 0; i < a; i++) o = {
|
|
1611
1611
|
id: n.changedTouches[i].identifier,
|
|
1612
1612
|
type: "touch",
|
|
1613
1613
|
currentPos: m(n.changedTouches[i]),
|
|
1614
1614
|
currentTime: r
|
|
1615
|
-
},
|
|
1615
|
+
}, fe(t, s, o, 0), U(t, o, !1), G(t, s, o);
|
|
1616
1616
|
s.preventDefault && !s.defaultPrevented && e.cancelEvent(n), s.stopPropagation && e.stopEvent(n);
|
|
1617
1617
|
}
|
|
1618
1618
|
function O(t, n) {
|
|
@@ -1624,12 +1624,12 @@ var ve = p([
|
|
|
1624
1624
|
pointerType: "touch",
|
|
1625
1625
|
isEmulated: !1
|
|
1626
1626
|
};
|
|
1627
|
-
for (
|
|
1627
|
+
for (H(t, s), i = 0; i < a; i++) o = {
|
|
1628
1628
|
id: n.changedTouches[i].identifier,
|
|
1629
1629
|
type: "touch",
|
|
1630
1630
|
currentPos: m(n.changedTouches[i]),
|
|
1631
1631
|
currentTime: r
|
|
1632
|
-
},
|
|
1632
|
+
}, J(t, s, o);
|
|
1633
1633
|
s.preventDefault && !s.defaultPrevented && e.cancelEvent(n), s.stopPropagation && e.stopEvent(n);
|
|
1634
1634
|
}
|
|
1635
1635
|
function k(t, n) {
|
|
@@ -1639,10 +1639,10 @@ var ve = p([
|
|
|
1639
1639
|
pointerType: "touch",
|
|
1640
1640
|
isEmulated: !1
|
|
1641
1641
|
};
|
|
1642
|
-
for (
|
|
1642
|
+
for (H(t, o), i = 0; i < r; i++) a = {
|
|
1643
1643
|
id: n.changedTouches[i].identifier,
|
|
1644
1644
|
type: "touch"
|
|
1645
|
-
},
|
|
1645
|
+
}, Y(t, o, a);
|
|
1646
1646
|
o.stopPropagation && e.stopEvent(n);
|
|
1647
1647
|
}
|
|
1648
1648
|
function A(t, n) {
|
|
@@ -1658,7 +1658,7 @@ var ve = p([
|
|
|
1658
1658
|
pointerType: f(n),
|
|
1659
1659
|
isEmulated: !1
|
|
1660
1660
|
};
|
|
1661
|
-
|
|
1661
|
+
H(t, r), n.target === t.element && U(t, {
|
|
1662
1662
|
id: n.pointerId,
|
|
1663
1663
|
type: f(n)
|
|
1664
1664
|
}, !0), r.stopPropagation && e.stopEvent(n);
|
|
@@ -1670,7 +1670,7 @@ var ve = p([
|
|
|
1670
1670
|
pointerType: f(n),
|
|
1671
1671
|
isEmulated: !1
|
|
1672
1672
|
};
|
|
1673
|
-
|
|
1673
|
+
H(t, r), n.target === t.element && U(t, {
|
|
1674
1674
|
id: n.pointerId,
|
|
1675
1675
|
type: f(n)
|
|
1676
1676
|
}, !1), r.stopPropagation && e.stopEvent(n);
|
|
@@ -1688,7 +1688,7 @@ var ve = p([
|
|
|
1688
1688
|
pointerType: r.type,
|
|
1689
1689
|
isEmulated: !1
|
|
1690
1690
|
};
|
|
1691
|
-
|
|
1691
|
+
H(t, i), W(t, i, r);
|
|
1692
1692
|
}
|
|
1693
1693
|
function M(t, n) {
|
|
1694
1694
|
var r = {
|
|
@@ -1703,7 +1703,7 @@ var ve = p([
|
|
|
1703
1703
|
pointerType: r.type,
|
|
1704
1704
|
isEmulated: !1
|
|
1705
1705
|
};
|
|
1706
|
-
|
|
1706
|
+
H(t, i), G(t, i, r);
|
|
1707
1707
|
}
|
|
1708
1708
|
function N(t, n) {
|
|
1709
1709
|
var r = {
|
|
@@ -1718,7 +1718,7 @@ var ve = p([
|
|
|
1718
1718
|
pointerType: r.type,
|
|
1719
1719
|
isEmulated: !1
|
|
1720
1720
|
};
|
|
1721
|
-
|
|
1721
|
+
H(t, i), K(t, i, r), i.preventDefault && !i.defaultPrevented && e.cancelEvent(n), i.stopPropagation && e.stopEvent(n);
|
|
1722
1722
|
}
|
|
1723
1723
|
function P(t, n) {
|
|
1724
1724
|
var r = {
|
|
@@ -1733,7 +1733,7 @@ var ve = p([
|
|
|
1733
1733
|
pointerType: r.type,
|
|
1734
1734
|
isEmulated: !1
|
|
1735
1735
|
};
|
|
1736
|
-
|
|
1736
|
+
H(t, i), de(t, i, r), i.preventDefault && !i.defaultPrevented && e.cancelEvent(n), i.stopPropagation && e.stopEvent(n);
|
|
1737
1737
|
}
|
|
1738
1738
|
function F(t, n) {
|
|
1739
1739
|
var r = {
|
|
@@ -1748,7 +1748,7 @@ var ve = p([
|
|
|
1748
1748
|
pointerType: r.type,
|
|
1749
1749
|
isEmulated: !1
|
|
1750
1750
|
};
|
|
1751
|
-
|
|
1751
|
+
H(t, a), q(t, a, r, n.button), a.preventDefault && !a.defaultPrevented && e.cancelEvent(n), a.stopPropagation && e.stopEvent(n), a.shouldCapture && (i ? U(t, r, !0) : l(t, r));
|
|
1752
1752
|
}
|
|
1753
1753
|
function I(e, t) {
|
|
1754
1754
|
R(e, t);
|
|
@@ -1769,15 +1769,15 @@ var ve = p([
|
|
|
1769
1769
|
pointerType: r.type,
|
|
1770
1770
|
isEmulated: !1
|
|
1771
1771
|
};
|
|
1772
|
-
|
|
1772
|
+
H(t, i), fe(t, i, r, n.button), i.preventDefault && !i.defaultPrevented && e.cancelEvent(n), i.stopPropagation && e.stopEvent(n), i.shouldReleaseCapture && (n.target === t.element ? u(t, r) : U(t, r, !1));
|
|
1773
1773
|
}
|
|
1774
1774
|
function z(e, t) {
|
|
1775
|
-
|
|
1775
|
+
ce(e, t);
|
|
1776
1776
|
}
|
|
1777
1777
|
function se(t, n) {
|
|
1778
|
-
t.getActivePointersListByType(f(n)).getById(n.pointerId) &&
|
|
1778
|
+
t.getActivePointersListByType(f(n)).getById(n.pointerId) && ce(t, n), e.stopEvent(n);
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1780
|
+
function ce(t, n) {
|
|
1781
1781
|
var r = {
|
|
1782
1782
|
id: d(n),
|
|
1783
1783
|
type: f(n),
|
|
@@ -1790,9 +1790,9 @@ var ve = p([
|
|
|
1790
1790
|
pointerType: r.type,
|
|
1791
1791
|
isEmulated: !1
|
|
1792
1792
|
};
|
|
1793
|
-
|
|
1793
|
+
H(t, i), J(t, i, r), i.preventDefault && !i.defaultPrevented && e.cancelEvent(n), i.stopPropagation && e.stopEvent(n);
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1795
|
+
function le(t, n) {
|
|
1796
1796
|
var r = {
|
|
1797
1797
|
id: n.pointerId,
|
|
1798
1798
|
type: f(n)
|
|
@@ -1802,16 +1802,16 @@ var ve = p([
|
|
|
1802
1802
|
pointerType: r.type,
|
|
1803
1803
|
isEmulated: !1
|
|
1804
1804
|
};
|
|
1805
|
-
|
|
1805
|
+
H(t, i), Y(t, i, r), i.stopPropagation && e.stopEvent(n);
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1807
|
+
function B(e, t) {
|
|
1808
1808
|
return t.speed = 0, t.direction = 0, t.contactPos = t.currentPos, t.contactTime = t.currentTime, t.lastPos = t.currentPos, t.lastTime = t.currentTime, e.add(t);
|
|
1809
1809
|
}
|
|
1810
|
-
function
|
|
1810
|
+
function V(t, n, r) {
|
|
1811
1811
|
var i, a = n.getById(r.id);
|
|
1812
1812
|
return a ? (a.captured && (e.console.warn("stopTrackingPointer() called on captured pointer"), u(t, a)), n.removeContact(), i = n.removeById(r.id)) : i = n.getLength(), i;
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1814
|
+
function ue(e, t) {
|
|
1815
1815
|
switch (t.eventType) {
|
|
1816
1816
|
case "pointermove":
|
|
1817
1817
|
t.isStoppable = !0, t.isCancelable = !0, t.preventDefault = !1, t.preventGesture = !e.hasGestureHandlers, t.stopPropagation = !1;
|
|
@@ -1847,16 +1847,16 @@ var ve = p([
|
|
|
1847
1847
|
default: t.isStoppable = !1, t.isCancelable = !1, t.preventDefault = !1, t.preventGesture = !1, t.stopPropagation = !1;
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1851
|
-
n.eventSource = t, n.eventPhase = n.originalEvent ? n.originalEvent.eventPhase === void 0 ? 0 : n.originalEvent.eventPhase : 0, n.defaultPrevented = e.eventIsCanceled(n.originalEvent), n.shouldCapture = !1, n.shouldReleaseCapture = !1, n.userData = t.userData,
|
|
1850
|
+
function H(t, n) {
|
|
1851
|
+
n.eventSource = t, n.eventPhase = n.originalEvent ? n.originalEvent.eventPhase === void 0 ? 0 : n.originalEvent.eventPhase : 0, n.defaultPrevented = e.eventIsCanceled(n.originalEvent), n.shouldCapture = !1, n.shouldReleaseCapture = !1, n.userData = t.userData, ue(t, n), t.preProcessEventHandler && t.preProcessEventHandler(n);
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1853
|
+
function U(t, n, r) {
|
|
1854
1854
|
var i = t.getActivePointersListByType(n.type), a = i.getById(n.id);
|
|
1855
1855
|
a ? r && !a.captured ? (a.captured = !0, i.captureCount++) : !r && a.captured && (a.captured = !1, i.captureCount--, i.captureCount < 0 && (i.captureCount = 0, e.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))) : e.console.warn("updatePointerCaptured() called on untracked pointer");
|
|
1856
1856
|
}
|
|
1857
|
-
function
|
|
1857
|
+
function W(e, t, n) {
|
|
1858
1858
|
var r = e.getActivePointersListByType(n.type), i = r.getById(n.id);
|
|
1859
|
-
i ? (i.insideElement = !0, i.lastPos = i.currentPos, i.lastTime = i.currentTime, i.currentPos = n.currentPos, i.currentTime = n.currentTime, n = i) : (n.captured = !1, n.insideElementPressed = !1, n.insideElement = !0,
|
|
1859
|
+
i ? (i.insideElement = !0, i.lastPos = i.currentPos, i.lastTime = i.currentTime, i.currentPos = n.currentPos, i.currentTime = n.currentTime, n = i) : (n.captured = !1, n.insideElementPressed = !1, n.insideElement = !0, B(r, n)), e.enterHandler && e.enterHandler({
|
|
1860
1860
|
eventSource: e,
|
|
1861
1861
|
pointerType: n.type,
|
|
1862
1862
|
position: g(n.currentPos, e.element),
|
|
@@ -1869,9 +1869,9 @@ var ve = p([
|
|
|
1869
1869
|
userData: e.userData
|
|
1870
1870
|
});
|
|
1871
1871
|
}
|
|
1872
|
-
function
|
|
1872
|
+
function G(e, t, n) {
|
|
1873
1873
|
var r = e.getActivePointersListByType(n.type), i = r.getById(n.id), a;
|
|
1874
|
-
i ? (i.captured ? (i.insideElement = !1, i.lastPos = i.currentPos, i.lastTime = i.currentTime, i.currentPos = n.currentPos, i.currentTime = n.currentTime) :
|
|
1874
|
+
i ? (i.captured ? (i.insideElement = !1, i.lastPos = i.currentPos, i.lastTime = i.currentTime, i.currentPos = n.currentPos, i.currentTime = n.currentTime) : V(e, r, i), n = i) : (n.captured = !1, n.insideElementPressed = !1), (e.leaveHandler || e.exitHandler) && (a = {
|
|
1875
1875
|
eventSource: e,
|
|
1876
1876
|
pointerType: n.type,
|
|
1877
1877
|
position: n.currentPos && g(n.currentPos, e.element),
|
|
@@ -1884,7 +1884,7 @@ var ve = p([
|
|
|
1884
1884
|
userData: e.userData
|
|
1885
1885
|
}, e.leaveHandler && e.leaveHandler(a), e.exitHandler && e.exitHandler(a));
|
|
1886
1886
|
}
|
|
1887
|
-
function
|
|
1887
|
+
function K(e, t, n) {
|
|
1888
1888
|
var r = e.getActivePointersListByType(n.type), i = r.getById(n.id);
|
|
1889
1889
|
i ? n = i : (n.captured = !1, n.insideElementPressed = !1), e.overHandler && e.overHandler({
|
|
1890
1890
|
eventSource: e,
|
|
@@ -1899,7 +1899,7 @@ var ve = p([
|
|
|
1899
1899
|
userData: e.userData
|
|
1900
1900
|
});
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1902
|
+
function de(e, t, n) {
|
|
1903
1903
|
var r = e.getActivePointersListByType(n.type), i = r.getById(n.id);
|
|
1904
1904
|
i ? n = i : (n.captured = !1, n.insideElementPressed = !1), e.outHandler && e.outHandler({
|
|
1905
1905
|
eventSource: e,
|
|
@@ -1914,7 +1914,7 @@ var ve = p([
|
|
|
1914
1914
|
userData: e.userData
|
|
1915
1915
|
});
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1917
|
+
function q(t, r, i, a) {
|
|
1918
1918
|
var o = n[t.hash], s = t.getActivePointersListByType(i.type), c;
|
|
1919
1919
|
if (r.originalEvent.buttons === void 0 ? a === 0 ? s.buttons |= 1 : a === 1 ? s.buttons |= 4 : a === 2 ? s.buttons |= 2 : a === 3 ? s.buttons |= 8 : a === 4 ? s.buttons |= 16 : a === 5 && (s.buttons |= 32) : s.buttons = r.originalEvent.buttons, a !== 0) {
|
|
1920
1920
|
r.shouldCapture = !1, r.shouldReleaseCapture = !1, t.nonPrimaryPressHandler && !r.preventGesture && !r.defaultPrevented && (r.preventDefault = !0, t.nonPrimaryPressHandler({
|
|
@@ -1929,7 +1929,7 @@ var ve = p([
|
|
|
1929
1929
|
}));
|
|
1930
1930
|
return;
|
|
1931
1931
|
}
|
|
1932
|
-
c = s.getById(i.id), c ? (c.insideElementPressed = !0, c.insideElement = !0, c.originalTarget = r.originalEvent.target, c.contactPos = i.currentPos, c.contactTime = i.currentTime, c.lastPos = c.currentPos, c.lastTime = c.currentTime, c.currentPos = i.currentPos, c.currentTime = i.currentTime, i = c) : (i.captured = !1, i.insideElementPressed = !0, i.insideElement = !0, i.originalTarget = r.originalEvent.target,
|
|
1932
|
+
c = s.getById(i.id), c ? (c.insideElementPressed = !0, c.insideElement = !0, c.originalTarget = r.originalEvent.target, c.contactPos = i.currentPos, c.contactTime = i.currentTime, c.lastPos = c.currentPos, c.lastTime = c.currentTime, c.currentPos = i.currentPos, c.currentTime = i.currentTime, i = c) : (i.captured = !1, i.insideElementPressed = !0, i.insideElement = !0, i.originalTarget = r.originalEvent.target, B(s, i)), s.addContact(), !r.preventGesture && !r.defaultPrevented ? (r.shouldCapture = !0, r.shouldReleaseCapture = !1, r.preventDefault = !0, (t.dragHandler || t.dragEndHandler || t.pinchHandler) && e.MouseTracker.gesturePointVelocityTracker.addPoint(t, i), s.contacts === 1 ? t.pressHandler && !r.preventGesture && t.pressHandler({
|
|
1933
1933
|
eventSource: t,
|
|
1934
1934
|
pointerType: i.type,
|
|
1935
1935
|
position: g(i.contactPos, t.element),
|
|
@@ -1939,7 +1939,7 @@ var ve = p([
|
|
|
1939
1939
|
userData: t.userData
|
|
1940
1940
|
}) : s.contacts === 2 && t.pinchHandler && i.type === "touch" && (o.pinchGPoints = s.asArray(), o.lastPinchDist = o.currentPinchDist = o.pinchGPoints[0].currentPos.distanceTo(o.pinchGPoints[1].currentPos), o.lastPinchCenter = o.currentPinchCenter = _(o.pinchGPoints[0].currentPos, o.pinchGPoints[1].currentPos))) : (r.shouldCapture = !1, r.shouldReleaseCapture = !1);
|
|
1941
1941
|
}
|
|
1942
|
-
function
|
|
1942
|
+
function fe(t, r, i, a) {
|
|
1943
1943
|
var o = n[t.hash], s = t.getActivePointersListByType(i.type), c, l, u, d = !1, f;
|
|
1944
1944
|
if (r.originalEvent.buttons === void 0 ? a === 0 ? s.buttons ^= -2 : a === 1 ? s.buttons ^= -5 : a === 2 ? s.buttons ^= -3 : a === 3 ? s.buttons ^= -9 : a === 4 ? s.buttons ^= -17 : a === 5 && (s.buttons ^= -33) : s.buttons = r.originalEvent.buttons, r.shouldCapture = !1, a !== 0) {
|
|
1945
1945
|
r.shouldReleaseCapture = !1, t.nonPrimaryReleaseHandler && !r.preventGesture && !r.defaultPrevented && (r.preventDefault = !0, t.nonPrimaryReleaseHandler({
|
|
@@ -1954,7 +1954,7 @@ var ve = p([
|
|
|
1954
1954
|
}));
|
|
1955
1955
|
return;
|
|
1956
1956
|
}
|
|
1957
|
-
u = s.getById(i.id), u ? (s.removeContact(), u.captured && (d = !0), u.lastPos = u.currentPos, u.lastTime = u.currentTime, u.currentPos = i.currentPos, u.currentTime = i.currentTime, u.insideElement ||
|
|
1957
|
+
u = s.getById(i.id), u ? (s.removeContact(), u.captured && (d = !0), u.lastPos = u.currentPos, u.lastTime = u.currentTime, u.currentPos = i.currentPos, u.currentTime = i.currentTime, u.insideElement || V(t, s, u), c = u.currentPos, l = u.currentTime) : (i.captured = !1, i.insideElementPressed = !1, i.insideElement = !0, B(s, i), u = i), !r.preventGesture && !r.defaultPrevented && (d ? (r.shouldReleaseCapture = !0, r.preventDefault = !0, (t.dragHandler || t.dragEndHandler || t.pinchHandler) && e.MouseTracker.gesturePointVelocityTracker.removePoint(t, u), s.contacts === 0 ? (t.releaseHandler && c && t.releaseHandler({
|
|
1958
1958
|
eventSource: t,
|
|
1959
1959
|
pointerType: u.type,
|
|
1960
1960
|
position: g(c, t.element),
|
|
@@ -2006,12 +2006,12 @@ var ve = p([
|
|
|
2006
2006
|
userData: t.userData
|
|
2007
2007
|
}), r.preventDefault = !0)));
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2009
|
+
function J(e, t, r) {
|
|
2010
2010
|
var i = n[e.hash], a = e.getActivePointersListByType(r.type), o, s, c;
|
|
2011
2011
|
if (t.originalEvent.buttons !== void 0 && (a.buttons = t.originalEvent.buttons), o = a.getById(r.id), o) o.lastPos = o.currentPos, o.lastTime = o.currentTime, o.currentPos = r.currentPos, o.currentTime = r.currentTime;
|
|
2012
2012
|
else return;
|
|
2013
2013
|
t.shouldCapture = !1, t.shouldReleaseCapture = !1, e.stopHandler && r.type === "mouse" && (clearTimeout(e.stopTimeOut), e.stopTimeOut = setTimeout(function() {
|
|
2014
|
-
|
|
2014
|
+
X(e, t.originalEvent, r.type);
|
|
2015
2015
|
}, e.stopDelay)), a.contacts === 0 ? e.moveHandler && e.moveHandler({
|
|
2016
2016
|
eventSource: e,
|
|
2017
2017
|
pointerType: r.type,
|
|
@@ -2061,11 +2061,11 @@ var ve = p([
|
|
|
2061
2061
|
userData: e.userData
|
|
2062
2062
|
}), t.preventDefault = !0)));
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2064
|
+
function Y(e, t, n) {
|
|
2065
2065
|
var r = e.getActivePointersListByType(n.type), i = r.getById(n.id);
|
|
2066
|
-
i &&
|
|
2066
|
+
i && V(e, r, i);
|
|
2067
2067
|
}
|
|
2068
|
-
function
|
|
2068
|
+
function X(e, t, n) {
|
|
2069
2069
|
e.stopHandler && e.stopHandler({
|
|
2070
2070
|
eventSource: e,
|
|
2071
2071
|
pointerType: n,
|
|
@@ -2746,7 +2746,7 @@ var ve = p([
|
|
|
2746
2746
|
}), this.pagingControl = this.paging.element, this.toolbar ? this.toolbar.addControl(this.pagingControl, { anchor: e.ControlAnchor.BOTTOM_RIGHT }) : this.addControl(this.pagingControl, { anchor: this.sequenceControlAnchor || e.ControlAnchor.TOP_LEFT }))), this;
|
|
2747
2747
|
},
|
|
2748
2748
|
bindStandardControls: function() {
|
|
2749
|
-
var t = e.delegate(this, M), n = e.delegate(this, P), r = e.delegate(this, L), i = e.delegate(this, N), a = e.delegate(this, R), o = e.delegate(this, se), s = e.delegate(this,
|
|
2749
|
+
var t = e.delegate(this, M), n = e.delegate(this, P), r = e.delegate(this, L), i = e.delegate(this, N), a = e.delegate(this, R), o = e.delegate(this, se), s = e.delegate(this, ce), c = e.delegate(this, le), l = e.delegate(this, B), u = e.delegate(this, V), d = e.delegate(this, p), f = e.delegate(this, m), h = this.navImages, g = [], _ = !0;
|
|
2750
2750
|
return this.showNavigationControl && ((this.zoomInButton || this.zoomOutButton || this.homeButton || this.fullPageButton || this.rotateLeftButton || this.rotateRightButton || this.flipButton) && (_ = !1), this.showZoomControl && (g.push(this.zoomInButton = new e.Button({
|
|
2751
2751
|
element: this.zoomInButton ? e.getElement(this.zoomInButton) : null,
|
|
2752
2752
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
@@ -3421,22 +3421,22 @@ var ve = p([
|
|
|
3421
3421
|
function se() {
|
|
3422
3422
|
this.viewport && this.viewport.goHome();
|
|
3423
3423
|
}
|
|
3424
|
-
function
|
|
3424
|
+
function ce() {
|
|
3425
3425
|
this.isFullPage() && !e.isFullScreen() ? this.setFullPage(!1) : this.setFullScreen(!this.isFullPage()), this.buttonGroup && this.buttonGroup.emulateLeave(), this.fullPageButton.element.focus(), this.viewport && this.viewport.applyConstraints();
|
|
3426
3426
|
}
|
|
3427
|
-
function
|
|
3427
|
+
function le() {
|
|
3428
3428
|
if (this.viewport) {
|
|
3429
3429
|
var e = this.viewport.getRotation();
|
|
3430
3430
|
this.viewport.flipped ? e += this.rotationIncrement : e -= this.rotationIncrement, this.viewport.setRotation(e);
|
|
3431
3431
|
}
|
|
3432
3432
|
}
|
|
3433
|
-
function
|
|
3433
|
+
function B() {
|
|
3434
3434
|
if (this.viewport) {
|
|
3435
3435
|
var e = this.viewport.getRotation();
|
|
3436
3436
|
this.viewport.flipped ? e -= this.rotationIncrement : e += this.rotationIncrement, this.viewport.setRotation(e);
|
|
3437
3437
|
}
|
|
3438
3438
|
}
|
|
3439
|
-
function
|
|
3439
|
+
function V() {
|
|
3440
3440
|
this.viewport.toggleFlip();
|
|
3441
3441
|
}
|
|
3442
3442
|
e.determineDrawer = function(t) {
|
|
@@ -7216,7 +7216,7 @@ var ve = p([
|
|
|
7216
7216
|
}
|
|
7217
7217
|
});
|
|
7218
7218
|
})(n);
|
|
7219
|
-
})),
|
|
7219
|
+
})), Z = /* @__PURE__ */ u(s(), 1), Ae = /* @__PURE__ */ u(le(), 1), je = /* @__PURE__ */ u(Ee(), 1), Me = /* @__PURE__ */ u(Oe(), 1), Q = /* @__PURE__ */ u(ke(), 1), Ne = class {
|
|
7220
7220
|
constructor(e, t) {
|
|
7221
7221
|
this.viewer = e, this.ref = t, this.containerWidth = 0, this.containerHeight = 0, this.imgAspectRatio = 1;
|
|
7222
7222
|
}
|
|
@@ -7233,7 +7233,7 @@ var ve = p([
|
|
|
7233
7233
|
this.context2d && this.context2d.clearRect(0, 0, this.containerWidth, this.containerHeight);
|
|
7234
7234
|
}
|
|
7235
7235
|
resize() {
|
|
7236
|
-
this.containerWidth !== this.viewer.container.clientWidth && (this.containerWidth = this.viewer.container.clientWidth, this.canvasDiv.setAttribute("width", this.containerWidth), this.canvas.setAttribute("width", this.containerWidth)), this.containerHeight !== this.viewer.container.clientHeight && (this.containerHeight = this.viewer.container.clientHeight, this.canvasDiv.setAttribute("height", this.containerHeight), this.canvas.setAttribute("height", this.containerHeight)), this.viewportOrigin = new
|
|
7236
|
+
this.containerWidth !== this.viewer.container.clientWidth && (this.containerWidth = this.viewer.container.clientWidth, this.canvasDiv.setAttribute("width", this.containerWidth), this.canvas.setAttribute("width", this.containerWidth)), this.containerHeight !== this.viewer.container.clientHeight && (this.containerHeight = this.viewer.container.clientHeight, this.canvasDiv.setAttribute("height", this.containerHeight), this.canvas.setAttribute("height", this.containerHeight)), this.viewportOrigin = new Q.default.Point(0, 0);
|
|
7237
7237
|
let e = this.viewer.viewport.getBoundsNoRotateWithMargins(!0);
|
|
7238
7238
|
this.viewportOrigin.x = e.x, this.viewportOrigin.y = e.y * this.imgAspectRatio, this.viewportWidth = e.width, this.viewportHeight = e.height * this.imgAspectRatio;
|
|
7239
7239
|
let t = this.viewer.world.getItemAt(0);
|
|
@@ -7253,13 +7253,13 @@ var ve = p([
|
|
|
7253
7253
|
};
|
|
7254
7254
|
//#endregion
|
|
7255
7255
|
//#region src/lib/svgShapesToPath.js
|
|
7256
|
-
function
|
|
7256
|
+
function Pe(e) {
|
|
7257
7257
|
let t = e.tagName.toLowerCase(), n = (t) => parseFloat(e.getAttribute(t)) || 0;
|
|
7258
7258
|
if (t === "path") return new Path2D(e.getAttribute("d"));
|
|
7259
7259
|
let r = new Path2D();
|
|
7260
|
-
return
|
|
7260
|
+
return Fe[t]?.(r, e, n), r;
|
|
7261
7261
|
}
|
|
7262
|
-
var
|
|
7262
|
+
var Fe = {
|
|
7263
7263
|
circle: (e, t, n) => {
|
|
7264
7264
|
e.arc(n("cx"), n("cy"), n("r"), 0, 2 * Math.PI);
|
|
7265
7265
|
},
|
|
@@ -7272,27 +7272,48 @@ var Pe = {
|
|
|
7272
7272
|
line: (e, t, n) => {
|
|
7273
7273
|
e.moveTo(n("x1"), n("y1")), e.lineTo(n("x2"), n("y2"));
|
|
7274
7274
|
},
|
|
7275
|
-
polygon: (e, t) =>
|
|
7276
|
-
polyline: (e, t) =>
|
|
7275
|
+
polygon: (e, t) => Ie(e, t, !0),
|
|
7276
|
+
polyline: (e, t) => Ie(e, t, !1)
|
|
7277
7277
|
};
|
|
7278
|
-
function
|
|
7279
|
-
|
|
7278
|
+
function Ie(e, t, n) {
|
|
7279
|
+
Le(t.getAttribute("points")).forEach(([t, n], r) => {
|
|
7280
7280
|
r === 0 ? e.moveTo(t, n) : e.lineTo(t, n);
|
|
7281
7281
|
}), n && e.closePath();
|
|
7282
7282
|
}
|
|
7283
|
-
function
|
|
7283
|
+
function Le(e) {
|
|
7284
7284
|
let t = e.trim().split(/[\s,]+/).map(Number), n = [];
|
|
7285
7285
|
for (let e = 0; e < t.length - 1; e += 2) n.push([t[e], t[e + 1]]);
|
|
7286
7286
|
return n;
|
|
7287
7287
|
}
|
|
7288
7288
|
//#endregion
|
|
7289
7289
|
//#region src/lib/CanvasAnnotationDisplay.js
|
|
7290
|
-
var
|
|
7290
|
+
var Re = "M50.002 0C30.763 0 15 15.718 15 34.902c0 7.432 2.374 14.34 6.392 20.019L45.73 96.994c3.409 4.453 5.675 3.607 8.51-.235l26.843-45.683c.542-.981.967-2.026 1.338-3.092A34.446 34.446 0 0 0 85 34.902C85 15.718 69.24 0 50.002 0zm0 16.354c10.359 0 18.597 8.218 18.597 18.548c0 10.33-8.238 18.544-18.597 18.544c-10.36 0-18.601-8.215-18.601-18.544c0-10.33 8.241-18.548 18.6-18.548z", ze = 100, Be = {
|
|
7291
|
+
x: 50,
|
|
7292
|
+
y: 97
|
|
7293
|
+
}, $ = {
|
|
7294
|
+
x: 50,
|
|
7295
|
+
y: 34.9,
|
|
7296
|
+
radius: 18.6
|
|
7297
|
+
}, Ve = "#1e88e5", He = class {
|
|
7291
7298
|
constructor({ resource: e, palette: t, zoomRatio: n, offset: r, selected: i, hovered: a }) {
|
|
7292
7299
|
this.resource = e, this.palette = t, this.zoomRatio = n, this.offset = r, this.selected = i, this.hovered = a;
|
|
7293
7300
|
}
|
|
7294
7301
|
toContext(e) {
|
|
7295
|
-
this.context = e, this.resource.svgSelector ? this.svgContext() : this.resource.fragmentSelector && this.fragmentContext();
|
|
7302
|
+
this.context = e, this.resource.svgSelector ? this.svgContext() : this.resource.pointSelector ? this.pointContext() : this.resource.fragmentSelector && this.fragmentContext();
|
|
7303
|
+
}
|
|
7304
|
+
currentPalette() {
|
|
7305
|
+
return this.hovered ? this.palette.hovered : this.selected ? this.palette.selected : this.palette.default;
|
|
7306
|
+
}
|
|
7307
|
+
pointContext() {
|
|
7308
|
+
let { x: e, y: t } = this.resource.pointSelector, n = this.currentPalette();
|
|
7309
|
+
if (n.globalAlpha === 0) return;
|
|
7310
|
+
let r = 32 / this.zoomRatio / ze;
|
|
7311
|
+
this.context.save(), this.context.translate(this.offset.x + e, this.offset.y + t), this.context.scale(r, r), this.context.translate(-Be.x, -Be.y), this.context.globalAlpha = n.globalAlpha ?? 1, this.context.fillStyle = n.fillStyle || Ve, this.context.fill(new Path2D(Re));
|
|
7312
|
+
let { journeyOrder: i } = this.resource;
|
|
7313
|
+
i != null && this.journeyOrderBadgeContext(i), this.context.restore();
|
|
7314
|
+
}
|
|
7315
|
+
journeyOrderBadgeContext(e) {
|
|
7316
|
+
this.context.beginPath(), this.context.arc($.x, $.y, $.radius, 0, Math.PI * 2), this.context.fillStyle = "#ffffff", this.context.fill(), this.context.fillStyle = this.currentPalette().fillStyle || Ve, this.context.font = `bold ${$.radius}px sans-serif`, this.context.textAlign = "center", this.context.textBaseline = "middle", this.context.fillText(String(e), $.x, $.y);
|
|
7296
7317
|
}
|
|
7297
7318
|
get svgString() {
|
|
7298
7319
|
return this.resource.svgSelector.value;
|
|
@@ -7304,7 +7325,7 @@ var Le = class {
|
|
|
7304
7325
|
let e;
|
|
7305
7326
|
e = this.hovered ? this.palette.hovered : this.selected ? this.palette.selected : this.palette.default, e.globalAlpha !== 0 && [...this.svgPaths].forEach((t) => {
|
|
7306
7327
|
this.context.save(), this.context.translate(this.offset.x, this.offset.y);
|
|
7307
|
-
let n =
|
|
7328
|
+
let n = Pe(t);
|
|
7308
7329
|
this.context.strokeStyle = this.color, t.getAttribute("stroke-dasharray") && this.context.setLineDash(t.getAttribute("stroke-dasharray").split(","));
|
|
7309
7330
|
let r = {
|
|
7310
7331
|
fill: "fillStyle",
|
|
@@ -7335,31 +7356,37 @@ var Le = class {
|
|
|
7335
7356
|
};
|
|
7336
7357
|
//#endregion
|
|
7337
7358
|
//#region src/components/AnnotationsOverlay.jsx
|
|
7338
|
-
function
|
|
7339
|
-
let [
|
|
7340
|
-
if (
|
|
7341
|
-
let e = t.context2d, { svgPaths:
|
|
7342
|
-
return [...
|
|
7359
|
+
function Ue({ canvasWorld: e, osdCanvasOverlay: t, viewer: n }, r, i, a) {
|
|
7360
|
+
let [o, s] = e.canvasToWorldCoordinates(i.id), c = a.x - o, l = a.y - s;
|
|
7361
|
+
if (r.svgSelector) {
|
|
7362
|
+
let e = t.context2d, { svgPaths: n } = new He({ resource: r });
|
|
7363
|
+
return [...n].some((t) => e.isPointInPath(Pe(t), c, l));
|
|
7364
|
+
}
|
|
7365
|
+
if (r.pointSelector) {
|
|
7366
|
+
let { x: t, y: a } = r.pointSelector, o = e.canvases.findIndex((e) => e.id === i.id), s = n.world.getItemAt(o);
|
|
7367
|
+
if (!s) return !1;
|
|
7368
|
+
let u = 16 / s.viewportToImageZoom(n.viewport.getZoom(!0)), d = c - t, f = l - a;
|
|
7369
|
+
return d * d + f * f <= u * u;
|
|
7343
7370
|
}
|
|
7344
|
-
if (
|
|
7345
|
-
let [e, t,
|
|
7346
|
-
return e <=
|
|
7371
|
+
if (r.fragmentSelector) {
|
|
7372
|
+
let [e, t, n, i] = r.fragmentSelector;
|
|
7373
|
+
return e <= c && c <= e + n && t <= l && l <= t + i;
|
|
7347
7374
|
}
|
|
7348
7375
|
return !1;
|
|
7349
7376
|
}
|
|
7350
|
-
function
|
|
7377
|
+
function We(e) {
|
|
7351
7378
|
let t = e.originalEvent?.pointerType;
|
|
7352
7379
|
return (t === "touch" || t === "pen") && e.quick === !1;
|
|
7353
7380
|
}
|
|
7354
|
-
function
|
|
7355
|
-
let m =
|
|
7381
|
+
function Ge({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () => {}, drawAnnotations: r = !0, drawSearchAnnotations: i = !0, highlightAllAnnotations: a = !1, hoverAnnotation: o = () => {}, hoveredAnnotationIds: s = [], palette: c = {}, searchAnnotations: l = [], selectAnnotation: u = () => {}, selectedAnnotationId: d = null, viewer: f = null, windowId: p }) {
|
|
7382
|
+
let m = J(), h = q(() => new Ne(f, m), [m, f]), g = W((e) => {
|
|
7356
7383
|
d === e ? n(p, e) : u(p, e);
|
|
7357
7384
|
}, [
|
|
7358
7385
|
d,
|
|
7359
7386
|
n,
|
|
7360
7387
|
u,
|
|
7361
7388
|
p
|
|
7362
|
-
]), _ =
|
|
7389
|
+
]), _ = W((e, n) => {
|
|
7363
7390
|
let r = h.context2d;
|
|
7364
7391
|
e.forEach((e) => {
|
|
7365
7392
|
e.resources.forEach((e) => {
|
|
@@ -7368,7 +7395,7 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7368
7395
|
let o = f.world.getItemAt(i);
|
|
7369
7396
|
if (!o) return;
|
|
7370
7397
|
let c = t.offsetByCanvas(e.targetId), l = o.viewportToImageZoom(f.viewport.getZoom(!0));
|
|
7371
|
-
new
|
|
7398
|
+
new He({
|
|
7372
7399
|
hovered: s.includes(e.id),
|
|
7373
7400
|
offset: c,
|
|
7374
7401
|
palette: {
|
|
@@ -7391,7 +7418,7 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7391
7418
|
a,
|
|
7392
7419
|
s,
|
|
7393
7420
|
d
|
|
7394
|
-
]), v =
|
|
7421
|
+
]), v = W(() => {
|
|
7395
7422
|
i && _(l, c.search), r && _(e, c.annotations);
|
|
7396
7423
|
}, [
|
|
7397
7424
|
e,
|
|
@@ -7400,15 +7427,20 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7400
7427
|
i,
|
|
7401
7428
|
c,
|
|
7402
7429
|
l
|
|
7403
|
-
]), y =
|
|
7430
|
+
]), y = W(() => {
|
|
7404
7431
|
h && (h.clear(), h.resize(), h.canvasUpdate(v));
|
|
7405
|
-
}, [h, v]), b =
|
|
7432
|
+
}, [h, v]), b = W((n, r) => [...e, ...l].flatMap((e) => e.resources).filter((e) => n.id === e.targetId && Ue({
|
|
7433
|
+
canvasWorld: t,
|
|
7434
|
+
osdCanvasOverlay: h,
|
|
7435
|
+
viewer: f
|
|
7436
|
+
}, e, n, r)), [
|
|
7406
7437
|
e,
|
|
7407
7438
|
t,
|
|
7408
7439
|
h,
|
|
7409
|
-
l
|
|
7410
|
-
|
|
7411
|
-
|
|
7440
|
+
l,
|
|
7441
|
+
f
|
|
7442
|
+
]), x = W((e) => {
|
|
7443
|
+
if (We(e)) return;
|
|
7412
7444
|
let { position: n, eventSource: { viewport: r } } = e, i = r.pointFromPixel(n), a = t.canvasAtPoint(i);
|
|
7413
7445
|
if (!a) return;
|
|
7414
7446
|
let [o, s, c, l] = t.canvasToWorldCoordinates(a.id), u = b(a, i);
|
|
@@ -7420,7 +7452,11 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7420
7452
|
let o = 0;
|
|
7421
7453
|
for (let s = 0; s < 360; s += 1) {
|
|
7422
7454
|
let c = Math.cos(s * n) * e + i.x, l = Math.sin(s * n) * e + i.y;
|
|
7423
|
-
|
|
7455
|
+
Ue({
|
|
7456
|
+
canvasWorld: t,
|
|
7457
|
+
osdCanvasOverlay: h,
|
|
7458
|
+
viewer: f
|
|
7459
|
+
}, r, a, {
|
|
7424
7460
|
x: c,
|
|
7425
7461
|
y: l
|
|
7426
7462
|
}) && (o += 1);
|
|
@@ -7430,16 +7466,17 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7430
7466
|
score: o
|
|
7431
7467
|
};
|
|
7432
7468
|
};
|
|
7433
|
-
}, n = 1, r = (0,
|
|
7434
|
-
for (; n < Math.max(c, l) && r[0].score === r[1].score;) n *= 2, r = (0,
|
|
7469
|
+
}, n = 1, r = (0, je.default)(u.map(e(n)), "score");
|
|
7470
|
+
for (; n < Math.max(c, l) && r[0].score === r[1].score;) n *= 2, r = (0, je.default)(u.map(e(n)), "score");
|
|
7435
7471
|
g(r[0].anno.id);
|
|
7436
7472
|
}
|
|
7437
7473
|
}, [
|
|
7438
7474
|
b,
|
|
7439
7475
|
t,
|
|
7440
7476
|
h,
|
|
7441
|
-
g
|
|
7442
|
-
|
|
7477
|
+
g,
|
|
7478
|
+
f
|
|
7479
|
+
]), S = z(W((n) => {
|
|
7443
7480
|
if (e.length === 0 && l.length === 0) return;
|
|
7444
7481
|
let { position: r } = n, i = f.viewport.pointFromPixel(r), a = t.canvasAtPoint(i);
|
|
7445
7482
|
if (!a) {
|
|
@@ -7447,7 +7484,7 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7447
7484
|
return;
|
|
7448
7485
|
}
|
|
7449
7486
|
let c = b(a, i);
|
|
7450
|
-
(0,
|
|
7487
|
+
(0, Me.default)(s, c.map((e) => e.id)).length > 0 && o(p, c.map((e) => e.id));
|
|
7451
7488
|
}, [
|
|
7452
7489
|
e,
|
|
7453
7490
|
b,
|
|
@@ -7457,16 +7494,16 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7457
7494
|
l,
|
|
7458
7495
|
f,
|
|
7459
7496
|
p
|
|
7460
|
-
]), 10), C =
|
|
7497
|
+
]), 10), C = W(() => {
|
|
7461
7498
|
S.cancel(), o(p, []);
|
|
7462
7499
|
}, [
|
|
7463
7500
|
o,
|
|
7464
7501
|
S,
|
|
7465
7502
|
p
|
|
7466
|
-
]), w =
|
|
7503
|
+
]), w = W(() => {
|
|
7467
7504
|
y();
|
|
7468
7505
|
}, [y]);
|
|
7469
|
-
return
|
|
7506
|
+
return K(() => {
|
|
7470
7507
|
if (f) return f.addHandler("canvas-click", x), f.addHandler("canvas-exit", C), f.addHandler("mouse-move", S), f.addHandler("update-viewport", w), () => {
|
|
7471
7508
|
f.removeHandler("canvas-click", x), f.removeHandler("canvas-exit", C), f.removeHandler("mouse-move", S), f.removeHandler("update-viewport", w);
|
|
7472
7509
|
};
|
|
@@ -7476,7 +7513,7 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7476
7513
|
S,
|
|
7477
7514
|
w,
|
|
7478
7515
|
f
|
|
7479
|
-
]),
|
|
7516
|
+
]), K(() => {
|
|
7480
7517
|
f && f.forceRedraw();
|
|
7481
7518
|
}, [
|
|
7482
7519
|
e,
|
|
@@ -7487,9 +7524,9 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7487
7524
|
l,
|
|
7488
7525
|
d,
|
|
7489
7526
|
f
|
|
7490
|
-
]),
|
|
7527
|
+
]), K(() => {
|
|
7491
7528
|
m.current && (s.length > 0 ? m.current.style.cursor = "pointer" : m.current.style.cursor = "");
|
|
7492
|
-
}, [s, m]), f ?
|
|
7529
|
+
}, [s, m]), f ? _e.createPortal(/* @__PURE__ */ X("div", {
|
|
7493
7530
|
ref: m,
|
|
7494
7531
|
style: {
|
|
7495
7532
|
height: "100%",
|
|
@@ -7498,28 +7535,28 @@ function Be({ annotations: e = [], canvasWorld: t, deselectAnnotation: n = () =>
|
|
|
7498
7535
|
top: 0,
|
|
7499
7536
|
width: "100%"
|
|
7500
7537
|
},
|
|
7501
|
-
children: /* @__PURE__ */
|
|
7538
|
+
children: /* @__PURE__ */ X("canvas", {})
|
|
7502
7539
|
}), f.canvas) : null;
|
|
7503
7540
|
}
|
|
7504
|
-
|
|
7505
|
-
annotations:
|
|
7506
|
-
canvasWorld:
|
|
7507
|
-
deselectAnnotation:
|
|
7508
|
-
drawAnnotations:
|
|
7509
|
-
drawSearchAnnotations:
|
|
7510
|
-
highlightAllAnnotations:
|
|
7511
|
-
hoverAnnotation:
|
|
7512
|
-
hoveredAnnotationIds:
|
|
7513
|
-
palette:
|
|
7514
|
-
searchAnnotations:
|
|
7515
|
-
selectAnnotation:
|
|
7516
|
-
selectedAnnotationId:
|
|
7517
|
-
viewer:
|
|
7518
|
-
windowId:
|
|
7541
|
+
Ge.propTypes = {
|
|
7542
|
+
annotations: Z.default.arrayOf(Z.default.object),
|
|
7543
|
+
canvasWorld: Z.default.instanceOf(L).isRequired,
|
|
7544
|
+
deselectAnnotation: Z.default.func,
|
|
7545
|
+
drawAnnotations: Z.default.bool,
|
|
7546
|
+
drawSearchAnnotations: Z.default.bool,
|
|
7547
|
+
highlightAllAnnotations: Z.default.bool,
|
|
7548
|
+
hoverAnnotation: Z.default.func,
|
|
7549
|
+
hoveredAnnotationIds: Z.default.arrayOf(Z.default.string),
|
|
7550
|
+
palette: Z.default.object,
|
|
7551
|
+
searchAnnotations: Z.default.arrayOf(Z.default.object),
|
|
7552
|
+
selectAnnotation: Z.default.func,
|
|
7553
|
+
selectedAnnotationId: Z.default.string,
|
|
7554
|
+
viewer: Z.default.object,
|
|
7555
|
+
windowId: Z.default.string.isRequired
|
|
7519
7556
|
};
|
|
7520
7557
|
//#endregion
|
|
7521
7558
|
//#region src/components/ImageFailureMessage.jsx
|
|
7522
|
-
var
|
|
7559
|
+
var Ke = he(ve)(({ theme: e }) => ({
|
|
7523
7560
|
position: "absolute",
|
|
7524
7561
|
top: e.spacing(2),
|
|
7525
7562
|
left: "50%",
|
|
@@ -7531,21 +7568,21 @@ var Ve = me(_e)(({ theme: e }) => ({
|
|
|
7531
7568
|
zIndex: 1e3,
|
|
7532
7569
|
pointerEvents: "none"
|
|
7533
7570
|
}));
|
|
7534
|
-
function
|
|
7535
|
-
let { failedImages: t } =
|
|
7536
|
-
return e.some((e) => t.has(e)) ? /* @__PURE__ */
|
|
7571
|
+
function qe({ imageUrls: e = [] }) {
|
|
7572
|
+
let { failedImages: t } = G(M), { t: n } = me();
|
|
7573
|
+
return e.some((e) => t.has(e)) ? /* @__PURE__ */ X(Ke, {
|
|
7537
7574
|
role: "status",
|
|
7538
7575
|
"aria-live": "polite",
|
|
7539
|
-
children: /* @__PURE__ */
|
|
7576
|
+
children: /* @__PURE__ */ X(ge, {
|
|
7540
7577
|
variant: "body2",
|
|
7541
7578
|
children: n("imageFailedToLoad")
|
|
7542
7579
|
})
|
|
7543
7580
|
}) : null;
|
|
7544
7581
|
}
|
|
7545
|
-
|
|
7546
|
-
var
|
|
7582
|
+
qe.propTypes = { imageUrls: Z.default.arrayOf(Z.default.string) };
|
|
7583
|
+
var Je = i(h((e, { windowId: t }) => ({
|
|
7547
7584
|
annotations: k(e, { windowId: t }),
|
|
7548
|
-
canvasWorld:
|
|
7585
|
+
canvasWorld: ye(e, { windowId: t }),
|
|
7549
7586
|
drawAnnotations: D(e).window.forceDrawAnnotations || _(e, {
|
|
7550
7587
|
content: "annotations",
|
|
7551
7588
|
windowId: t
|
|
@@ -7563,7 +7600,7 @@ var Ue = i(h((e, { windowId: t }) => ({
|
|
|
7563
7600
|
deselectAnnotation: oe,
|
|
7564
7601
|
hoverAnnotation: j,
|
|
7565
7602
|
selectAnnotation: A
|
|
7566
|
-
}), d("AnnotationsOverlay"))(
|
|
7603
|
+
}), d("AnnotationsOverlay"))(Ge), Ye = {
|
|
7567
7604
|
get(e) {
|
|
7568
7605
|
return this.refs[e];
|
|
7569
7606
|
},
|
|
@@ -7574,13 +7611,13 @@ var Ue = i(h((e, { windowId: t }) => ({
|
|
|
7574
7611
|
set(e, t) {
|
|
7575
7612
|
this.refs[e] = t;
|
|
7576
7613
|
}
|
|
7577
|
-
},
|
|
7614
|
+
}, Xe = U(void 0);
|
|
7578
7615
|
//#endregion
|
|
7579
7616
|
//#region src/components/OpenSeadragonComponent.jsx
|
|
7580
|
-
function
|
|
7581
|
-
let c =
|
|
7617
|
+
function Ze({ children: e = void 0, Container: t = "div", osdConfig: n = {}, viewerConfig: r = {}, onUpdateViewport: i = () => {}, setViewer: a = () => {}, style: o = {}, ...s }) {
|
|
7618
|
+
let c = de(), l = J(), [u, d] = Y(!1), f = J(void 0), p = J(!1), m = J(null), h = J(!1), [, g] = fe((e) => e + 1, 0), _ = z(W((e) => {
|
|
7582
7619
|
f.current?.raiseEvent("mouse-move", e);
|
|
7583
|
-
}, [f]), 10), v =
|
|
7620
|
+
}, [f]), 10), v = W((e) => {
|
|
7584
7621
|
let { viewport: t } = e.eventSource;
|
|
7585
7622
|
p.current && (h.current || i({
|
|
7586
7623
|
bounds: t.getBounds(),
|
|
@@ -7590,10 +7627,10 @@ function Ke({ children: e = void 0, Container: t = "div", osdConfig: n = {}, vie
|
|
|
7590
7627
|
y: Math.round(t.centerSpringY.target.value),
|
|
7591
7628
|
zoom: t.zoomSpring.target.value
|
|
7592
7629
|
}));
|
|
7593
|
-
}, [i, p]), y =
|
|
7594
|
-
p.current || (p.current = !0, r.x != null && r.y != null && e.panTo(new
|
|
7630
|
+
}, [i, p]), y = W(({ viewport: e }) => {
|
|
7631
|
+
p.current || (p.current = !0, r.x != null && r.y != null && e.panTo(new Q.default.Point(r.x, r.y), !0), r.zoom != null && e.zoomTo(r.zoom, new Q.default.Point(r.x, r.y), !0), r.rotation != null && r.rotation !== e.getRotation() && e.setRotation(r.rotation), r.flip != null && (r.flip || !1) !== e.getFlip() && e.setFlip(r.flip), !r.x && !r.y && !r.zoom && (r.bounds ? (e.fitBounds(new Q.default.Rect(...r.bounds), !0), m.current = r.bounds) : e.goHome(!0)));
|
|
7595
7632
|
}, [p, r]);
|
|
7596
|
-
|
|
7633
|
+
K(() => {
|
|
7597
7634
|
let e = f.current;
|
|
7598
7635
|
if (!e) return;
|
|
7599
7636
|
let { viewport: t } = e;
|
|
@@ -7603,19 +7640,19 @@ function Ke({ children: e = void 0, Container: t = "div", osdConfig: n = {}, vie
|
|
|
7603
7640
|
}
|
|
7604
7641
|
if (r.bounds && (!m.current || r.bounds.length !== m.current.length || r.bounds.some((e, t) => e !== m.current[t]))) {
|
|
7605
7642
|
h.current = !0, m.current = r.bounds, e.addOnceHandler("tile-loaded", () => {
|
|
7606
|
-
let e = new
|
|
7643
|
+
let e = new Q.default.Rect(...r.bounds);
|
|
7607
7644
|
t.fitBoundsWithConstraints(e, !0), h.current = !1;
|
|
7608
7645
|
});
|
|
7609
7646
|
return;
|
|
7610
7647
|
}
|
|
7611
|
-
!r.x || !r.y || !r.zoom || (r.x != null && r.y != null && (Math.round(r.x) !== Math.round(t.centerSpringX.target.value) || Math.round(r.y) !== Math.round(t.centerSpringY.target.value)) && t.panTo(new
|
|
7648
|
+
!r.x || !r.y || !r.zoom || (r.x != null && r.y != null && (Math.round(r.x) !== Math.round(t.centerSpringX.target.value) || Math.round(r.y) !== Math.round(t.centerSpringY.target.value)) && t.panTo(new Q.default.Point(r.x, r.y), !1), r.zoom != null && r.zoom !== t.zoomSpring.target.value && t.zoomTo(r.zoom, new Q.default.Point(r.x, r.y), !1), r.rotation != null && r.rotation !== t.getRotation() && t.setRotation(r.rotation), r.flip != null && (r.flip || !1) !== t.getFlip() && t.setFlip(r.flip));
|
|
7612
7649
|
}, [
|
|
7613
7650
|
p,
|
|
7614
7651
|
y,
|
|
7615
7652
|
r,
|
|
7616
7653
|
f
|
|
7617
|
-
]),
|
|
7618
|
-
let e = (0,
|
|
7654
|
+
]), K(() => {
|
|
7655
|
+
let e = (0, Q.default)({
|
|
7619
7656
|
element: l.current,
|
|
7620
7657
|
...n
|
|
7621
7658
|
});
|
|
@@ -7630,21 +7667,21 @@ function Ke({ children: e = void 0, Container: t = "div", osdConfig: n = {}, vie
|
|
|
7630
7667
|
}), e.addHandler("animation-finish", v), e.innerTracker.moveHandler = _, f.current = e, a(e), e.addOnceHandler("tile-loaded", () => {
|
|
7631
7668
|
p.current = !1, y(e);
|
|
7632
7669
|
}), g();
|
|
7633
|
-
}, [l]),
|
|
7670
|
+
}, [l]), K(() => () => {
|
|
7634
7671
|
let e = f.current;
|
|
7635
7672
|
e && (e.innerTracker?.moveHandler === _ && (e.innerTracker.moveHandler = () => {}), e.removeAllHandlers(), e.destroy(), f.current = void 0, a(null));
|
|
7636
7673
|
}, []);
|
|
7637
|
-
let { t: b } =
|
|
7638
|
-
return
|
|
7674
|
+
let { t: b } = me();
|
|
7675
|
+
return K(() => {
|
|
7639
7676
|
let e = f?.current?.canvas?.firstElementChild;
|
|
7640
7677
|
e && (e.setAttribute("role", "img"), e.setAttribute("aria-label", b("digitizedView")), e.setAttribute("aria-describedby", c));
|
|
7641
7678
|
}, [
|
|
7642
7679
|
f?.current?.canvas?.firstElementChild,
|
|
7643
7680
|
c,
|
|
7644
7681
|
b
|
|
7645
|
-
]), /* @__PURE__ */
|
|
7682
|
+
]), /* @__PURE__ */ X(Xe.Provider, {
|
|
7646
7683
|
value: f,
|
|
7647
|
-
children: /* @__PURE__ */
|
|
7684
|
+
children: /* @__PURE__ */ X(t, {
|
|
7648
7685
|
id: c,
|
|
7649
7686
|
ref: l,
|
|
7650
7687
|
style: {
|
|
@@ -7656,33 +7693,33 @@ function Ke({ children: e = void 0, Container: t = "div", osdConfig: n = {}, vie
|
|
|
7656
7693
|
})
|
|
7657
7694
|
});
|
|
7658
7695
|
}
|
|
7659
|
-
|
|
7660
|
-
children:
|
|
7661
|
-
Container:
|
|
7662
|
-
onUpdateViewport:
|
|
7663
|
-
osdConfig:
|
|
7664
|
-
setViewer:
|
|
7665
|
-
style:
|
|
7666
|
-
viewerConfig:
|
|
7667
|
-
bounds:
|
|
7668
|
-
flip:
|
|
7669
|
-
rotation:
|
|
7670
|
-
x:
|
|
7671
|
-
y:
|
|
7672
|
-
zoom:
|
|
7696
|
+
Ze.propTypes = {
|
|
7697
|
+
children: Z.default.node,
|
|
7698
|
+
Container: Z.default.elementType,
|
|
7699
|
+
onUpdateViewport: Z.default.func,
|
|
7700
|
+
osdConfig: Z.default.object,
|
|
7701
|
+
setViewer: Z.default.func,
|
|
7702
|
+
style: Z.default.object,
|
|
7703
|
+
viewerConfig: Z.default.shape({
|
|
7704
|
+
bounds: Z.default.arrayOf(Z.default.number),
|
|
7705
|
+
flip: Z.default.bool,
|
|
7706
|
+
rotation: Z.default.number,
|
|
7707
|
+
x: Z.default.number,
|
|
7708
|
+
y: Z.default.number,
|
|
7709
|
+
zoom: Z.default.number
|
|
7673
7710
|
})
|
|
7674
7711
|
};
|
|
7675
7712
|
//#endregion
|
|
7676
7713
|
//#region src/components/OpenSeadragonTileSource.jsx
|
|
7677
|
-
function
|
|
7678
|
-
let a =
|
|
7679
|
-
return
|
|
7714
|
+
function Qe({ index: e = void 0, opacity: t = void 0, fitBounds: n = void 0, tileSource: r = {}, url: i = void 0 }) {
|
|
7715
|
+
let a = G(Xe), { notifyFailure: o, fallbackImage: s } = G(M), c = J(void 0);
|
|
7716
|
+
return K(() => {
|
|
7680
7717
|
t != null && c.current?.setOpacity(t);
|
|
7681
|
-
}, [t]),
|
|
7682
|
-
n && c.current?.fitBounds(new
|
|
7683
|
-
}, [n]),
|
|
7718
|
+
}, [t]), K(() => {
|
|
7719
|
+
n && c.current?.fitBounds(new Q.default.Rect(...n));
|
|
7720
|
+
}, [n]), K(() => {
|
|
7684
7721
|
!c.current || !a?.current || e == null || a.current.world.setItemIndex(c.current, e);
|
|
7685
|
-
}, [e, a]),
|
|
7722
|
+
}, [e, a]), K(() => {
|
|
7686
7723
|
if (!a?.current) return;
|
|
7687
7724
|
let l = () => {
|
|
7688
7725
|
s && a.current.addTiledImage({
|
|
@@ -7692,7 +7729,7 @@ function qe({ index: e = void 0, opacity: t = void 0, fitBounds: n = void 0, til
|
|
|
7692
7729
|
},
|
|
7693
7730
|
index: e,
|
|
7694
7731
|
opacity: t,
|
|
7695
|
-
fitBounds: n ? new
|
|
7732
|
+
fitBounds: n ? new Q.default.Rect(...n) : void 0,
|
|
7696
7733
|
success: (e) => {
|
|
7697
7734
|
c.current = e.item;
|
|
7698
7735
|
}
|
|
@@ -7706,7 +7743,7 @@ function qe({ index: e = void 0, opacity: t = void 0, fitBounds: n = void 0, til
|
|
|
7706
7743
|
tileSource: u,
|
|
7707
7744
|
index: e,
|
|
7708
7745
|
opacity: t,
|
|
7709
|
-
fitBounds: n ? new
|
|
7746
|
+
fitBounds: n ? new Q.default.Rect(...n) : void 0,
|
|
7710
7747
|
success: (e) => s(e),
|
|
7711
7748
|
error: (e) => {
|
|
7712
7749
|
let t = i || (typeof r == "string" ? r : r?.["@id"]);
|
|
@@ -7723,22 +7760,22 @@ function qe({ index: e = void 0, opacity: t = void 0, fitBounds: n = void 0, til
|
|
|
7723
7760
|
});
|
|
7724
7761
|
}, [a?.current, i]), null;
|
|
7725
7762
|
}
|
|
7726
|
-
|
|
7727
|
-
fitBounds:
|
|
7728
|
-
index:
|
|
7729
|
-
opacity:
|
|
7730
|
-
tileSource:
|
|
7731
|
-
url:
|
|
7763
|
+
Qe.propTypes = {
|
|
7764
|
+
fitBounds: Z.default.arrayOf(Z.default.number),
|
|
7765
|
+
index: Z.default.number,
|
|
7766
|
+
opacity: Z.default.number,
|
|
7767
|
+
tileSource: Z.default.oneOfType([Z.default.string, Z.default.object]),
|
|
7768
|
+
url: Z.default.string
|
|
7732
7769
|
};
|
|
7733
7770
|
//#endregion
|
|
7734
7771
|
//#region src/components/OpenSeadragonViewer.jsx
|
|
7735
|
-
var
|
|
7772
|
+
var $e = he("section")({
|
|
7736
7773
|
cursor: "grab",
|
|
7737
7774
|
flex: 1,
|
|
7738
7775
|
position: "relative"
|
|
7739
7776
|
});
|
|
7740
|
-
function
|
|
7741
|
-
let { t: d } =
|
|
7777
|
+
function et({ children: e = null, label: t = null, windowId: n, osdConfig: r = {}, viewerConfig: i = null, drawAnnotations: a = !1, infoResponses: o = [], canvasWorld: s, nonTiledImages: c = [], updateViewport: l, ...u }) {
|
|
7778
|
+
let { t: d } = me(), f = J(), [p, m] = Y(null), h = W(({ flip: e, rotation: t, x: r, y: i, zoom: a }) => {
|
|
7742
7779
|
l(n, {
|
|
7743
7780
|
flip: e,
|
|
7744
7781
|
rotation: t,
|
|
@@ -7746,13 +7783,13 @@ function Ye({ children: e = null, label: t = null, windowId: n, osdConfig: r = {
|
|
|
7746
7783
|
y: i,
|
|
7747
7784
|
zoom: a
|
|
7748
7785
|
});
|
|
7749
|
-
}, [l, n]), g =
|
|
7750
|
-
f.current?.viewport && f.current.viewport.fitBounds(new
|
|
7786
|
+
}, [l, n]), g = W((e = !0) => {
|
|
7787
|
+
f.current?.viewport && f.current.viewport.fitBounds(new Q.default.Rect(...s.worldBounds()), e);
|
|
7751
7788
|
}, [s, f]);
|
|
7752
|
-
|
|
7789
|
+
K(() => (Ye.set(n, f), () => Ye.remove(n)), [f, n]), K(() => {
|
|
7753
7790
|
f.current = p;
|
|
7754
7791
|
}, [f, p]);
|
|
7755
|
-
let _ =
|
|
7792
|
+
let _ = ue.map(e, (e) => H(e, { zoomToWorld: g })), v = {
|
|
7756
7793
|
canvasWorld: s,
|
|
7757
7794
|
drawAnnotations: a,
|
|
7758
7795
|
infoResponses: o,
|
|
@@ -7764,10 +7801,10 @@ function Ye({ children: e = null, label: t = null, windowId: n, osdConfig: r = {
|
|
|
7764
7801
|
viewerConfig: i,
|
|
7765
7802
|
windowId: n,
|
|
7766
7803
|
...u
|
|
7767
|
-
}, y =
|
|
7768
|
-
return /* @__PURE__ */
|
|
7769
|
-
className: (0,
|
|
7770
|
-
Container:
|
|
7804
|
+
}, y = q(() => [...o.map((e) => e.id), ...c.map((e) => e.id)], [o, c]);
|
|
7805
|
+
return /* @__PURE__ */ pe(Ze, {
|
|
7806
|
+
className: (0, Ae.default)(B("osd-container")),
|
|
7807
|
+
Container: $e,
|
|
7771
7808
|
osdConfig: r,
|
|
7772
7809
|
viewerConfig: i || (s.hasDimensions() ? { bounds: s.worldBounds() } : void 0),
|
|
7773
7810
|
onUpdateViewport: h,
|
|
@@ -7779,7 +7816,7 @@ function Ye({ children: e = null, label: t = null, windowId: n, osdConfig: r = {
|
|
|
7779
7816
|
let t = s.contentResource(e.id);
|
|
7780
7817
|
if (!t) return null;
|
|
7781
7818
|
let n = s.contentResourceToWorldCoordinates(t), r = s.layerIndexOfImageResource(t), i = s.layerOpacityOfImageResource(t);
|
|
7782
|
-
return /* @__PURE__ */
|
|
7819
|
+
return /* @__PURE__ */ X(Qe, {
|
|
7783
7820
|
tileSource: e.json,
|
|
7784
7821
|
fitBounds: n,
|
|
7785
7822
|
index: r,
|
|
@@ -7790,20 +7827,20 @@ function Ye({ children: e = null, label: t = null, windowId: n, osdConfig: r = {
|
|
|
7790
7827
|
let t = e.getProperty("type"), n = e.getProperty("format") || "";
|
|
7791
7828
|
if (!(t === "Image" || t === "dctypes:Image" || n.startsWith("image/"))) return null;
|
|
7792
7829
|
let r = s.contentResourceToWorldCoordinates(e), i = s.layerIndexOfImageResource(e), a = s.layerOpacityOfImageResource(e);
|
|
7793
|
-
return /* @__PURE__ */
|
|
7830
|
+
return /* @__PURE__ */ X(Qe, {
|
|
7794
7831
|
url: e.id,
|
|
7795
7832
|
fitBounds: r,
|
|
7796
7833
|
index: i,
|
|
7797
7834
|
opacity: a
|
|
7798
7835
|
}, e.id);
|
|
7799
7836
|
}),
|
|
7800
|
-
a && /* @__PURE__ */
|
|
7837
|
+
a && /* @__PURE__ */ X(Je, {
|
|
7801
7838
|
viewer: p,
|
|
7802
7839
|
windowId: n
|
|
7803
7840
|
}),
|
|
7804
7841
|
_,
|
|
7805
|
-
/* @__PURE__ */
|
|
7806
|
-
/* @__PURE__ */
|
|
7842
|
+
/* @__PURE__ */ X(qe, { imageUrls: y }),
|
|
7843
|
+
/* @__PURE__ */ X(V, {
|
|
7807
7844
|
targetName: "OpenSeadragonViewer",
|
|
7808
7845
|
viewer: p,
|
|
7809
7846
|
...v
|
|
@@ -7811,22 +7848,22 @@ function Ye({ children: e = null, label: t = null, windowId: n, osdConfig: r = {
|
|
|
7811
7848
|
]
|
|
7812
7849
|
});
|
|
7813
7850
|
}
|
|
7814
|
-
|
|
7815
|
-
canvasWorld:
|
|
7816
|
-
children:
|
|
7817
|
-
drawAnnotations:
|
|
7818
|
-
infoResponses:
|
|
7819
|
-
label:
|
|
7820
|
-
nonTiledImages:
|
|
7821
|
-
osdConfig:
|
|
7822
|
-
updateViewport:
|
|
7823
|
-
viewerConfig:
|
|
7824
|
-
windowId:
|
|
7851
|
+
et.propTypes = {
|
|
7852
|
+
canvasWorld: Z.default.instanceOf(L).isRequired,
|
|
7853
|
+
children: Z.default.node,
|
|
7854
|
+
drawAnnotations: Z.default.bool,
|
|
7855
|
+
infoResponses: Z.default.arrayOf(Z.default.object),
|
|
7856
|
+
label: Z.default.string,
|
|
7857
|
+
nonTiledImages: Z.default.array,
|
|
7858
|
+
osdConfig: Z.default.object,
|
|
7859
|
+
updateViewport: Z.default.func.isRequired,
|
|
7860
|
+
viewerConfig: Z.default.object,
|
|
7861
|
+
windowId: Z.default.string.isRequired
|
|
7825
7862
|
};
|
|
7826
7863
|
//#endregion
|
|
7827
7864
|
//#region src/containers/OpenSeadragonViewer.js
|
|
7828
|
-
var
|
|
7829
|
-
let n =
|
|
7865
|
+
var tt = /* @__PURE__ */ l({ default: () => nt }), nt = i(h((e, { windowId: t }) => {
|
|
7866
|
+
let n = ye(e, { windowId: t }), r = O(e), i = n.canvases.flatMap((e) => e.imageServiceIds);
|
|
7830
7867
|
return {
|
|
7831
7868
|
canvasWorld: n,
|
|
7832
7869
|
drawAnnotations: D(e).window.forceDrawAnnotations || _(e, {
|
|
@@ -7845,8 +7882,8 @@ var Xe = /* @__PURE__ */ l({ default: () => Ze }), Ze = i(h((e, { windowId: t })
|
|
|
7845
7882
|
osdConfig: D(e).osdConfig,
|
|
7846
7883
|
viewerConfig: f(e, { windowId: t })
|
|
7847
7884
|
};
|
|
7848
|
-
}, { updateViewport:
|
|
7885
|
+
}, { updateViewport: ce }), d("OpenSeadragonViewer"))(et);
|
|
7849
7886
|
//#endregion
|
|
7850
|
-
export {
|
|
7887
|
+
export { Je as a, He as c, Ye as i, Ne as l, tt as n, qe as o, et as r, Ge as s, nt as t, ye as u };
|
|
7851
7888
|
|
|
7852
|
-
//# sourceMappingURL=OpenSeadragonViewer-
|
|
7889
|
+
//# sourceMappingURL=OpenSeadragonViewer-B_KV5sbU.js.map
|