@annotorious/plugin-segment-anything 0.1.13 → 0.1.14
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/index.js +36 -36
- package/dist/index.js.map +1 -1
- package/dist/openseadragon/index.d.ts +1 -0
- package/dist/openseadragon/index.js +399 -393
- package/dist/openseadragon/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ let We = () => ({
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
-
var
|
|
41
|
+
var xe = { exports: {} }, Ge = xe.exports, De;
|
|
42
42
|
function Ve() {
|
|
43
43
|
return De || (De = 1, function(W) {
|
|
44
44
|
//! openseadragon 5.0.1
|
|
@@ -1366,17 +1366,17 @@ function Ve() {
|
|
|
1366
1366
|
*/
|
|
1367
1367
|
multiply(i) {
|
|
1368
1368
|
let r = this.values, a = i.values;
|
|
1369
|
-
var s = r[0 * 3 + 0], o = r[0 * 3 + 1], l = r[0 * 3 + 2], h = r[1 * 3 + 0], d = r[1 * 3 + 1], f = r[1 * 3 + 2], v = r[2 * 3 + 0], w = r[2 * 3 + 1], T = r[2 * 3 + 2], x = a[0 * 3 + 0], E = a[0 * 3 + 1], P = a[0 * 3 + 2], I = a[1 * 3 + 0],
|
|
1369
|
+
var s = r[0 * 3 + 0], o = r[0 * 3 + 1], l = r[0 * 3 + 2], h = r[1 * 3 + 0], d = r[1 * 3 + 1], f = r[1 * 3 + 2], v = r[2 * 3 + 0], w = r[2 * 3 + 1], T = r[2 * 3 + 2], x = a[0 * 3 + 0], E = a[0 * 3 + 1], P = a[0 * 3 + 2], I = a[1 * 3 + 0], B = a[1 * 3 + 1], z = a[1 * 3 + 2], V = a[2 * 3 + 0], Z = a[2 * 3 + 1], X = a[2 * 3 + 2];
|
|
1370
1370
|
return new t([
|
|
1371
1371
|
x * s + E * h + P * v,
|
|
1372
1372
|
x * o + E * d + P * w,
|
|
1373
1373
|
x * l + E * f + P * T,
|
|
1374
|
-
I * s +
|
|
1375
|
-
I * o +
|
|
1376
|
-
I * l +
|
|
1377
|
-
V * s +
|
|
1378
|
-
V * o +
|
|
1379
|
-
V * l +
|
|
1374
|
+
I * s + B * h + z * v,
|
|
1375
|
+
I * o + B * d + z * w,
|
|
1376
|
+
I * l + B * f + z * T,
|
|
1377
|
+
V * s + Z * h + X * v,
|
|
1378
|
+
V * o + Z * d + X * w,
|
|
1379
|
+
V * l + Z * f + X * T
|
|
1380
1380
|
]);
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
@@ -1584,7 +1584,7 @@ function Ve() {
|
|
|
1584
1584
|
I(g, y);
|
|
1585
1585
|
},
|
|
1586
1586
|
keydown: function(y) {
|
|
1587
|
-
|
|
1587
|
+
B(g, y);
|
|
1588
1588
|
},
|
|
1589
1589
|
keyup: function(y) {
|
|
1590
1590
|
z(g, y);
|
|
@@ -1593,96 +1593,96 @@ function Ve() {
|
|
|
1593
1593
|
V(g, y);
|
|
1594
1594
|
},
|
|
1595
1595
|
focus: function(y) {
|
|
1596
|
-
|
|
1596
|
+
Z(g, y);
|
|
1597
1597
|
},
|
|
1598
1598
|
blur: function(y) {
|
|
1599
|
-
|
|
1599
|
+
X(g, y);
|
|
1600
1600
|
},
|
|
1601
1601
|
contextmenu: function(y) {
|
|
1602
1602
|
$(g, y);
|
|
1603
1603
|
},
|
|
1604
1604
|
wheel: function(y) {
|
|
1605
|
-
|
|
1605
|
+
Y(g, y);
|
|
1606
1606
|
},
|
|
1607
1607
|
mousewheel: function(y) {
|
|
1608
|
-
|
|
1608
|
+
U(g, y);
|
|
1609
1609
|
},
|
|
1610
1610
|
DOMMouseScroll: function(y) {
|
|
1611
|
-
|
|
1611
|
+
U(g, y);
|
|
1612
1612
|
},
|
|
1613
1613
|
MozMousePixelScroll: function(y) {
|
|
1614
|
-
|
|
1614
|
+
U(g, y);
|
|
1615
1615
|
},
|
|
1616
1616
|
losecapture: function(y) {
|
|
1617
|
-
|
|
1617
|
+
j(g, y);
|
|
1618
1618
|
},
|
|
1619
1619
|
mouseenter: function(y) {
|
|
1620
1620
|
G(g, y);
|
|
1621
1621
|
},
|
|
1622
1622
|
mouseleave: function(y) {
|
|
1623
|
-
|
|
1623
|
+
fe(g, y);
|
|
1624
1624
|
},
|
|
1625
1625
|
mouseover: function(y) {
|
|
1626
|
-
|
|
1626
|
+
ge(g, y);
|
|
1627
1627
|
},
|
|
1628
1628
|
mouseout: function(y) {
|
|
1629
|
-
|
|
1629
|
+
me(g, y);
|
|
1630
1630
|
},
|
|
1631
1631
|
mousedown: function(y) {
|
|
1632
|
-
|
|
1632
|
+
ue(g, y);
|
|
1633
1633
|
},
|
|
1634
1634
|
mouseup: function(y) {
|
|
1635
|
-
|
|
1635
|
+
ve(g, y);
|
|
1636
1636
|
},
|
|
1637
1637
|
mousemove: function(y) {
|
|
1638
|
-
|
|
1638
|
+
we(g, y);
|
|
1639
1639
|
},
|
|
1640
1640
|
touchstart: function(y) {
|
|
1641
|
-
|
|
1641
|
+
L(g, y);
|
|
1642
1642
|
},
|
|
1643
1643
|
touchend: function(y) {
|
|
1644
|
-
|
|
1644
|
+
q(g, y);
|
|
1645
1645
|
},
|
|
1646
1646
|
touchmove: function(y) {
|
|
1647
|
-
|
|
1647
|
+
ee(g, y);
|
|
1648
1648
|
},
|
|
1649
1649
|
touchcancel: function(y) {
|
|
1650
|
-
|
|
1650
|
+
ne(g, y);
|
|
1651
1651
|
},
|
|
1652
1652
|
gesturestart: function(y) {
|
|
1653
1653
|
se(g, y);
|
|
1654
1654
|
},
|
|
1655
1655
|
// Safari/Safari iOS
|
|
1656
1656
|
gesturechange: function(y) {
|
|
1657
|
-
|
|
1657
|
+
oe(g, y);
|
|
1658
1658
|
},
|
|
1659
1659
|
// Safari/Safari iOS
|
|
1660
1660
|
gotpointercapture: function(y) {
|
|
1661
1661
|
le(g, y);
|
|
1662
1662
|
},
|
|
1663
1663
|
lostpointercapture: function(y) {
|
|
1664
|
-
|
|
1664
|
+
he(g, y);
|
|
1665
1665
|
},
|
|
1666
1666
|
pointerenter: function(y) {
|
|
1667
1667
|
G(g, y);
|
|
1668
1668
|
},
|
|
1669
1669
|
pointerleave: function(y) {
|
|
1670
|
-
|
|
1670
|
+
fe(g, y);
|
|
1671
1671
|
},
|
|
1672
1672
|
pointerover: function(y) {
|
|
1673
|
-
|
|
1673
|
+
ge(g, y);
|
|
1674
1674
|
},
|
|
1675
1675
|
pointerout: function(y) {
|
|
1676
|
-
|
|
1676
|
+
me(g, y);
|
|
1677
1677
|
},
|
|
1678
1678
|
pointerdown: function(y) {
|
|
1679
|
-
|
|
1679
|
+
ue(g, y);
|
|
1680
1680
|
},
|
|
1681
1681
|
pointerup: function(y) {
|
|
1682
|
-
|
|
1682
|
+
ve(g, y);
|
|
1683
1683
|
},
|
|
1684
1684
|
pointermove: function(y) {
|
|
1685
|
-
|
|
1685
|
+
we(g, y);
|
|
1686
1686
|
},
|
|
1687
1687
|
pointercancel: function(y) {
|
|
1688
1688
|
Se(g, y);
|
|
@@ -2372,26 +2372,26 @@ function Ve() {
|
|
|
2372
2372
|
}
|
|
2373
2373
|
}
|
|
2374
2374
|
e.MouseTracker.gesturePointVelocityTracker = /* @__PURE__ */ function() {
|
|
2375
|
-
var p = [], c = 0, g = 0, y = function(
|
|
2376
|
-
return
|
|
2375
|
+
var p = [], c = 0, g = 0, y = function(Q, M) {
|
|
2376
|
+
return Q.hash.toString() + M.type + M.id.toString();
|
|
2377
2377
|
}, S = function() {
|
|
2378
|
-
var
|
|
2379
|
-
for (Pe =
|
|
2380
|
-
|
|
2381
|
-
}, D = function(
|
|
2382
|
-
var
|
|
2378
|
+
var Q, M = p.length, ae, re, de = e.now(), Pe, Re, Ce;
|
|
2379
|
+
for (Pe = de - g, g = de, Q = 0; Q < M; Q++)
|
|
2380
|
+
ae = p[Q], re = ae.gPoint, re.direction = Math.atan2(re.currentPos.y - ae.lastPos.y, re.currentPos.x - ae.lastPos.x), Re = ae.lastPos.distanceTo(re.currentPos), ae.lastPos = re.currentPos, Ce = 1e3 * Re / (Pe + 1), re.speed = 0.75 * Ce + 0.25 * re.speed;
|
|
2381
|
+
}, D = function(Q, M) {
|
|
2382
|
+
var ae = y(Q, M);
|
|
2383
2383
|
p.push(
|
|
2384
2384
|
{
|
|
2385
|
-
guid:
|
|
2385
|
+
guid: ae,
|
|
2386
2386
|
gPoint: M,
|
|
2387
2387
|
lastPos: M.currentPos
|
|
2388
2388
|
}
|
|
2389
2389
|
), p.length === 1 && (g = e.now(), c = window.setInterval(S, 50));
|
|
2390
|
-
}, H = function(
|
|
2391
|
-
var
|
|
2392
|
-
for (re = 0; re <
|
|
2393
|
-
if (p[re].guid ===
|
|
2394
|
-
p.splice(re, 1),
|
|
2390
|
+
}, H = function(Q, M) {
|
|
2391
|
+
var ae = y(Q, M), re, de = p.length;
|
|
2392
|
+
for (re = 0; re < de; re++)
|
|
2393
|
+
if (p[re].guid === ae) {
|
|
2394
|
+
p.splice(re, 1), de--, de === 0 && window.clearInterval(c);
|
|
2395
2395
|
break;
|
|
2396
2396
|
}
|
|
2397
2397
|
};
|
|
@@ -2499,15 +2499,15 @@ function Ve() {
|
|
|
2499
2499
|
}
|
|
2500
2500
|
};
|
|
2501
2501
|
function r(p) {
|
|
2502
|
-
var c = t[p.hash], g, y, S, D, H,
|
|
2503
|
-
for (g = 0; g <
|
|
2502
|
+
var c = t[p.hash], g, y, S, D, H, Q = c.activePointersLists.length;
|
|
2503
|
+
for (g = 0; g < Q; g++)
|
|
2504
2504
|
if (S = c.activePointersLists[g], S.getLength() > 0) {
|
|
2505
2505
|
for (H = [], D = S.asArray(), y = 0; y < D.length; y++)
|
|
2506
2506
|
H.push(D[y]);
|
|
2507
2507
|
for (y = 0; y < H.length; y++)
|
|
2508
|
-
|
|
2508
|
+
ce(p, S, H[y]);
|
|
2509
2509
|
}
|
|
2510
|
-
for (g = 0; g <
|
|
2510
|
+
for (g = 0; g < Q; g++)
|
|
2511
2511
|
c.activePointersLists.pop();
|
|
2512
2512
|
c.sentDragEvent = !1;
|
|
2513
2513
|
}
|
|
@@ -2664,7 +2664,7 @@ function Ve() {
|
|
|
2664
2664
|
};
|
|
2665
2665
|
m(p, g), g.preventDefault && !g.defaultPrevented && e.cancelEvent(c), g.stopPropagation && e.stopEvent(c);
|
|
2666
2666
|
}
|
|
2667
|
-
function
|
|
2667
|
+
function B(p, c) {
|
|
2668
2668
|
var g = null, y = {
|
|
2669
2669
|
originalEvent: c,
|
|
2670
2670
|
eventType: "keydown",
|
|
@@ -2721,7 +2721,7 @@ function Ve() {
|
|
|
2721
2721
|
userData: p.userData
|
|
2722
2722
|
}, p.keyHandler(g)), (g && g.preventDefault || y.preventDefault && !y.defaultPrevented) && e.cancelEvent(c), y.stopPropagation && e.stopEvent(c);
|
|
2723
2723
|
}
|
|
2724
|
-
function
|
|
2724
|
+
function Z(p, c) {
|
|
2725
2725
|
var g = {
|
|
2726
2726
|
originalEvent: c,
|
|
2727
2727
|
eventType: "focus",
|
|
@@ -2736,7 +2736,7 @@ function Ve() {
|
|
|
2736
2736
|
}
|
|
2737
2737
|
);
|
|
2738
2738
|
}
|
|
2739
|
-
function
|
|
2739
|
+
function X(p, c) {
|
|
2740
2740
|
var g = {
|
|
2741
2741
|
originalEvent: c,
|
|
2742
2742
|
eventType: "blur",
|
|
@@ -2766,10 +2766,10 @@ function Ve() {
|
|
|
2766
2766
|
userData: p.userData
|
|
2767
2767
|
}, p.contextMenuHandler(g)), (g && g.preventDefault || y.preventDefault && !y.defaultPrevented) && e.cancelEvent(c), y.stopPropagation && e.stopEvent(c);
|
|
2768
2768
|
}
|
|
2769
|
-
function
|
|
2770
|
-
|
|
2769
|
+
function Y(p, c) {
|
|
2770
|
+
O(p, c, c);
|
|
2771
2771
|
}
|
|
2772
|
-
function
|
|
2772
|
+
function U(p, c) {
|
|
2773
2773
|
var g = {
|
|
2774
2774
|
target: c.target || c.srcElement,
|
|
2775
2775
|
type: "wheel",
|
|
@@ -2783,9 +2783,9 @@ function Ve() {
|
|
|
2783
2783
|
deltaX: 0,
|
|
2784
2784
|
deltaZ: 0
|
|
2785
2785
|
};
|
|
2786
|
-
e.MouseTracker.wheelEventName === "mousewheel" ? g.deltaY = -c.wheelDelta / e.DEFAULT_SETTINGS.pixelsPerWheelLine : g.deltaY = c.detail,
|
|
2786
|
+
e.MouseTracker.wheelEventName === "mousewheel" ? g.deltaY = -c.wheelDelta / e.DEFAULT_SETTINGS.pixelsPerWheelLine : g.deltaY = c.detail, O(p, g, c);
|
|
2787
2787
|
}
|
|
2788
|
-
function
|
|
2788
|
+
function O(p, c, g) {
|
|
2789
2789
|
var y = 0, S, D = null;
|
|
2790
2790
|
y = c.deltaY ? c.deltaY < 0 ? 1 : -1 : 0, S = {
|
|
2791
2791
|
originalEvent: c,
|
|
@@ -2804,7 +2804,7 @@ function Ve() {
|
|
|
2804
2804
|
userData: p.userData
|
|
2805
2805
|
}, p.scrollHandler(D)), S.stopPropagation && e.stopEvent(g), (D && D.preventDefault || S.preventDefault && !S.defaultPrevented) && e.cancelEvent(g);
|
|
2806
2806
|
}
|
|
2807
|
-
function
|
|
2807
|
+
function j(p, c) {
|
|
2808
2808
|
var g = {
|
|
2809
2809
|
id: e.MouseTracker.mousePointerId,
|
|
2810
2810
|
type: "mouse"
|
|
@@ -2816,16 +2816,16 @@ function Ve() {
|
|
|
2816
2816
|
};
|
|
2817
2817
|
m(p, y), c.target === p.element && _(p, g, !1), y.stopPropagation && e.stopEvent(c);
|
|
2818
2818
|
}
|
|
2819
|
-
function
|
|
2819
|
+
function L(p, c) {
|
|
2820
2820
|
var g, y, S = c.changedTouches.length, D, H = p.getActivePointersListByType("touch");
|
|
2821
2821
|
g = e.now(), H.getLength() > c.touches.length - S && e.console.warn("Tracked touch contact count doesn't match event.touches.length");
|
|
2822
|
-
var
|
|
2822
|
+
var Q = {
|
|
2823
2823
|
originalEvent: c,
|
|
2824
2824
|
eventType: "pointerdown",
|
|
2825
2825
|
pointerType: "touch",
|
|
2826
2826
|
isEmulated: !1
|
|
2827
2827
|
};
|
|
2828
|
-
for (m(p,
|
|
2828
|
+
for (m(p, Q), y = 0; y < S; y++)
|
|
2829
2829
|
D = {
|
|
2830
2830
|
id: c.changedTouches[y].identifier,
|
|
2831
2831
|
type: "touch",
|
|
@@ -2833,10 +2833,10 @@ function Ve() {
|
|
|
2833
2833
|
isPrimary: H.getLength() === 0,
|
|
2834
2834
|
currentPos: w(c.changedTouches[y]),
|
|
2835
2835
|
currentTime: g
|
|
2836
|
-
}, b(p,
|
|
2837
|
-
|
|
2836
|
+
}, b(p, Q, D), k(p, Q, D, 0), _(p, D, !0);
|
|
2837
|
+
Q.preventDefault && !Q.defaultPrevented && e.cancelEvent(c), Q.stopPropagation && e.stopEvent(c);
|
|
2838
2838
|
}
|
|
2839
|
-
function
|
|
2839
|
+
function q(p, c) {
|
|
2840
2840
|
var g, y, S = c.changedTouches.length, D;
|
|
2841
2841
|
g = e.now();
|
|
2842
2842
|
var H = {
|
|
@@ -2851,10 +2851,10 @@ function Ve() {
|
|
|
2851
2851
|
type: "touch",
|
|
2852
2852
|
currentPos: w(c.changedTouches[y]),
|
|
2853
2853
|
currentTime: g
|
|
2854
|
-
},
|
|
2854
|
+
}, K(p, H, D, 0), _(p, D, !1), F(p, H, D);
|
|
2855
2855
|
H.preventDefault && !H.defaultPrevented && e.cancelEvent(c), H.stopPropagation && e.stopEvent(c);
|
|
2856
2856
|
}
|
|
2857
|
-
function
|
|
2857
|
+
function ee(p, c) {
|
|
2858
2858
|
var g, y, S = c.changedTouches.length, D;
|
|
2859
2859
|
g = e.now();
|
|
2860
2860
|
var H = {
|
|
@@ -2869,10 +2869,10 @@ function Ve() {
|
|
|
2869
2869
|
type: "touch",
|
|
2870
2870
|
currentPos: w(c.changedTouches[y]),
|
|
2871
2871
|
currentTime: g
|
|
2872
|
-
},
|
|
2872
|
+
}, J(p, H, D);
|
|
2873
2873
|
H.preventDefault && !H.defaultPrevented && e.cancelEvent(c), H.stopPropagation && e.stopEvent(c);
|
|
2874
2874
|
}
|
|
2875
|
-
function
|
|
2875
|
+
function ne(p, c) {
|
|
2876
2876
|
var g = c.changedTouches.length, y, S, D = {
|
|
2877
2877
|
originalEvent: c,
|
|
2878
2878
|
eventType: "pointercancel",
|
|
@@ -2883,13 +2883,13 @@ function Ve() {
|
|
|
2883
2883
|
S = {
|
|
2884
2884
|
id: c.changedTouches[y].identifier,
|
|
2885
2885
|
type: "touch"
|
|
2886
|
-
},
|
|
2886
|
+
}, N(p, D, S);
|
|
2887
2887
|
D.stopPropagation && e.stopEvent(c);
|
|
2888
2888
|
}
|
|
2889
2889
|
function se(p, c) {
|
|
2890
2890
|
return e.eventIsCanceled(c) || c.preventDefault(), !1;
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2892
|
+
function oe(p, c) {
|
|
2893
2893
|
return e.eventIsCanceled(c) || c.preventDefault(), !1;
|
|
2894
2894
|
}
|
|
2895
2895
|
function le(p, c) {
|
|
@@ -2904,7 +2904,7 @@ function Ve() {
|
|
|
2904
2904
|
type: f(c)
|
|
2905
2905
|
}, !0), g.stopPropagation && e.stopEvent(c);
|
|
2906
2906
|
}
|
|
2907
|
-
function
|
|
2907
|
+
function he(p, c) {
|
|
2908
2908
|
var g = {
|
|
2909
2909
|
originalEvent: c,
|
|
2910
2910
|
eventType: "lostpointercapture",
|
|
@@ -2931,7 +2931,7 @@ function Ve() {
|
|
|
2931
2931
|
};
|
|
2932
2932
|
m(p, y), b(p, y, g);
|
|
2933
2933
|
}
|
|
2934
|
-
function
|
|
2934
|
+
function fe(p, c) {
|
|
2935
2935
|
var g = {
|
|
2936
2936
|
id: d(c),
|
|
2937
2937
|
type: f(c),
|
|
@@ -2946,7 +2946,7 @@ function Ve() {
|
|
|
2946
2946
|
};
|
|
2947
2947
|
m(p, y), F(p, y, g);
|
|
2948
2948
|
}
|
|
2949
|
-
function
|
|
2949
|
+
function ge(p, c) {
|
|
2950
2950
|
var g = {
|
|
2951
2951
|
id: d(c),
|
|
2952
2952
|
type: f(c),
|
|
@@ -2961,7 +2961,7 @@ function Ve() {
|
|
|
2961
2961
|
};
|
|
2962
2962
|
m(p, y), A(p, y, g), y.preventDefault && !y.defaultPrevented && e.cancelEvent(c), y.stopPropagation && e.stopEvent(c);
|
|
2963
2963
|
}
|
|
2964
|
-
function
|
|
2964
|
+
function me(p, c) {
|
|
2965
2965
|
var g = {
|
|
2966
2966
|
id: d(c),
|
|
2967
2967
|
type: f(c),
|
|
@@ -2976,7 +2976,7 @@ function Ve() {
|
|
|
2976
2976
|
};
|
|
2977
2977
|
m(p, y), R(p, y, g), y.preventDefault && !y.defaultPrevented && e.cancelEvent(c), y.stopPropagation && e.stopEvent(c);
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2979
|
+
function ue(p, c) {
|
|
2980
2980
|
var g = {
|
|
2981
2981
|
id: d(c),
|
|
2982
2982
|
type: f(c),
|
|
@@ -2989,16 +2989,16 @@ function Ve() {
|
|
|
2989
2989
|
pointerType: g.type,
|
|
2990
2990
|
isEmulated: !1
|
|
2991
2991
|
};
|
|
2992
|
-
m(p, S),
|
|
2992
|
+
m(p, S), k(p, S, g, c.button), S.preventDefault && !S.defaultPrevented && e.cancelEvent(c), S.stopPropagation && e.stopEvent(c), S.shouldCapture && (y ? _(p, g, !0) : l(p, g));
|
|
2993
2993
|
}
|
|
2994
|
-
function
|
|
2995
|
-
|
|
2994
|
+
function ve(p, c) {
|
|
2995
|
+
ye(p, c);
|
|
2996
2996
|
}
|
|
2997
2997
|
function _e(p, c) {
|
|
2998
2998
|
var g = p.getActivePointersListByType(f(c));
|
|
2999
|
-
g.getById(c.pointerId) &&
|
|
2999
|
+
g.getById(c.pointerId) && ye(p, c), e.stopEvent(c);
|
|
3000
3000
|
}
|
|
3001
|
-
function
|
|
3001
|
+
function ye(p, c) {
|
|
3002
3002
|
var g;
|
|
3003
3003
|
g = {
|
|
3004
3004
|
id: d(c),
|
|
@@ -3013,16 +3013,16 @@ function Ve() {
|
|
|
3013
3013
|
pointerType: g.type,
|
|
3014
3014
|
isEmulated: !1
|
|
3015
3015
|
};
|
|
3016
|
-
m(p, y),
|
|
3016
|
+
m(p, y), K(p, y, g, c.button), y.preventDefault && !y.defaultPrevented && e.cancelEvent(c), y.stopPropagation && e.stopEvent(c), y.shouldReleaseCapture && (c.target === p.element ? h(p, g) : _(p, g, !1));
|
|
3017
3017
|
}
|
|
3018
|
-
function
|
|
3019
|
-
|
|
3018
|
+
function we(p, c) {
|
|
3019
|
+
Te(p, c);
|
|
3020
3020
|
}
|
|
3021
3021
|
function Ee(p, c) {
|
|
3022
3022
|
var g = p.getActivePointersListByType(f(c));
|
|
3023
|
-
g.getById(c.pointerId) &&
|
|
3023
|
+
g.getById(c.pointerId) && Te(p, c), e.stopEvent(c);
|
|
3024
3024
|
}
|
|
3025
|
-
function
|
|
3025
|
+
function Te(p, c) {
|
|
3026
3026
|
var g = {
|
|
3027
3027
|
id: d(c),
|
|
3028
3028
|
type: f(c),
|
|
@@ -3035,7 +3035,7 @@ function Ve() {
|
|
|
3035
3035
|
pointerType: g.type,
|
|
3036
3036
|
isEmulated: !1
|
|
3037
3037
|
};
|
|
3038
|
-
m(p, y),
|
|
3038
|
+
m(p, y), J(p, y, g), y.preventDefault && !y.defaultPrevented && e.cancelEvent(c), y.stopPropagation && e.stopEvent(c);
|
|
3039
3039
|
}
|
|
3040
3040
|
function Se(p, c) {
|
|
3041
3041
|
var g = {
|
|
@@ -3047,12 +3047,12 @@ function Ve() {
|
|
|
3047
3047
|
pointerType: g.type,
|
|
3048
3048
|
isEmulated: !1
|
|
3049
3049
|
};
|
|
3050
|
-
m(p, y),
|
|
3050
|
+
m(p, y), N(p, y, g), y.stopPropagation && e.stopEvent(c);
|
|
3051
3051
|
}
|
|
3052
|
-
function
|
|
3052
|
+
function pe(p, c) {
|
|
3053
3053
|
return c.speed = 0, c.direction = 0, c.contactPos = c.currentPos, c.contactTime = c.currentTime, c.lastPos = c.currentPos, c.lastTime = c.currentTime, p.add(c);
|
|
3054
3054
|
}
|
|
3055
|
-
function
|
|
3055
|
+
function ce(p, c, g) {
|
|
3056
3056
|
var y, S = c.getById(g.id);
|
|
3057
3057
|
return S ? (S.captured && (e.console.warn("stopTrackingPointer() called on captured pointer"), h(p, S)), c.removeContact(), y = c.removeById(g.id)) : y = c.getLength(), y;
|
|
3058
3058
|
}
|
|
@@ -3107,7 +3107,7 @@ function Ve() {
|
|
|
3107
3107
|
}
|
|
3108
3108
|
function b(p, c, g) {
|
|
3109
3109
|
var y = p.getActivePointersListByType(g.type), S;
|
|
3110
|
-
S = y.getById(g.id), S ? (S.insideElement = !0, S.lastPos = S.currentPos, S.lastTime = S.currentTime, S.currentPos = g.currentPos, S.currentTime = g.currentTime, g = S) : (g.captured = !1, g.insideElementPressed = !1, g.insideElement = !0,
|
|
3110
|
+
S = y.getById(g.id), S ? (S.insideElement = !0, S.lastPos = S.currentPos, S.lastTime = S.currentTime, S.currentPos = g.currentPos, S.currentTime = g.currentTime, g = S) : (g.captured = !1, g.insideElementPressed = !1, g.insideElement = !0, pe(y, g)), p.enterHandler && p.enterHandler(
|
|
3111
3111
|
{
|
|
3112
3112
|
eventSource: p,
|
|
3113
3113
|
pointerType: g.type,
|
|
@@ -3124,7 +3124,7 @@ function Ve() {
|
|
|
3124
3124
|
}
|
|
3125
3125
|
function F(p, c, g) {
|
|
3126
3126
|
var y = p.getActivePointersListByType(g.type), S, D;
|
|
3127
|
-
S = y.getById(g.id), S ? (S.captured ? (S.insideElement = !1, S.lastPos = S.currentPos, S.lastTime = S.currentTime, S.currentPos = g.currentPos, S.currentTime = g.currentTime) :
|
|
3127
|
+
S = y.getById(g.id), S ? (S.captured ? (S.insideElement = !1, S.lastPos = S.currentPos, S.lastTime = S.currentTime, S.currentPos = g.currentPos, S.currentTime = g.currentTime) : ce(p, y, S), g = S) : (g.captured = !1, g.insideElementPressed = !1), (p.leaveHandler || p.exitHandler) && (D = {
|
|
3128
3128
|
eventSource: p,
|
|
3129
3129
|
pointerType: g.type,
|
|
3130
3130
|
// GitHub PR: https://github.com/openseadragon/openseadragon/pull/1754 (gPoint.currentPos && )
|
|
@@ -3170,7 +3170,7 @@ function Ve() {
|
|
|
3170
3170
|
userData: p.userData
|
|
3171
3171
|
});
|
|
3172
3172
|
}
|
|
3173
|
-
function
|
|
3173
|
+
function k(p, c, g, y) {
|
|
3174
3174
|
var S = t[p.hash], D = p.getActivePointersListByType(g.type), H;
|
|
3175
3175
|
if (typeof c.originalEvent.buttons < "u" ? D.buttons = c.originalEvent.buttons : y === 0 ? D.buttons |= 1 : y === 1 ? D.buttons |= 4 : y === 2 ? D.buttons |= 2 : y === 3 ? D.buttons |= 8 : y === 4 ? D.buttons |= 16 : y === 5 && (D.buttons |= 32), y !== 0) {
|
|
3176
3176
|
c.shouldCapture = !1, c.shouldReleaseCapture = !1, p.nonPrimaryPressHandler && !c.preventGesture && !c.defaultPrevented && (c.preventDefault = !0, p.nonPrimaryPressHandler(
|
|
@@ -3187,7 +3187,7 @@ function Ve() {
|
|
|
3187
3187
|
));
|
|
3188
3188
|
return;
|
|
3189
3189
|
}
|
|
3190
|
-
H = D.getById(g.id), H ? (H.insideElementPressed = !0, H.insideElement = !0, H.originalTarget = c.originalEvent.target, H.contactPos = g.currentPos, H.contactTime = g.currentTime, H.lastPos = H.currentPos, H.lastTime = H.currentTime, H.currentPos = g.currentPos, H.currentTime = g.currentTime, g = H) : (g.captured = !1, g.insideElementPressed = !0, g.insideElement = !0, g.originalTarget = c.originalEvent.target,
|
|
3190
|
+
H = D.getById(g.id), H ? (H.insideElementPressed = !0, H.insideElement = !0, H.originalTarget = c.originalEvent.target, H.contactPos = g.currentPos, H.contactTime = g.currentTime, H.lastPos = H.currentPos, H.lastTime = H.currentTime, H.currentPos = g.currentPos, H.currentTime = g.currentTime, g = H) : (g.captured = !1, g.insideElementPressed = !0, g.insideElement = !0, g.originalTarget = c.originalEvent.target, pe(D, g)), D.addContact(), !c.preventGesture && !c.defaultPrevented ? (c.shouldCapture = !0, c.shouldReleaseCapture = !1, c.preventDefault = !0, (p.dragHandler || p.dragEndHandler || p.pinchHandler) && e.MouseTracker.gesturePointVelocityTracker.addPoint(p, g), D.contacts === 1 ? p.pressHandler && !c.preventGesture && p.pressHandler(
|
|
3191
3191
|
{
|
|
3192
3192
|
eventSource: p,
|
|
3193
3193
|
pointerType: g.type,
|
|
@@ -3199,8 +3199,8 @@ function Ve() {
|
|
|
3199
3199
|
}
|
|
3200
3200
|
) : D.contacts === 2 && p.pinchHandler && g.type === "touch" && (S.pinchGPoints = D.asArray(), S.lastPinchDist = S.currentPinchDist = S.pinchGPoints[0].currentPos.distanceTo(S.pinchGPoints[1].currentPos), S.lastPinchCenter = S.currentPinchCenter = E(S.pinchGPoints[0].currentPos, S.pinchGPoints[1].currentPos))) : (c.shouldCapture = !1, c.shouldReleaseCapture = !1);
|
|
3201
3201
|
}
|
|
3202
|
-
function
|
|
3203
|
-
var S = t[p.hash], D = p.getActivePointersListByType(g.type), H,
|
|
3202
|
+
function K(p, c, g, y) {
|
|
3203
|
+
var S = t[p.hash], D = p.getActivePointersListByType(g.type), H, Q, M, ae = !1, re;
|
|
3204
3204
|
if (typeof c.originalEvent.buttons < "u" ? D.buttons = c.originalEvent.buttons : y === 0 ? D.buttons ^= -2 : y === 1 ? D.buttons ^= -5 : y === 2 ? D.buttons ^= -3 : y === 3 ? D.buttons ^= -9 : y === 4 ? D.buttons ^= -17 : y === 5 && (D.buttons ^= -33), c.shouldCapture = !1, y !== 0) {
|
|
3205
3205
|
c.shouldReleaseCapture = !1, p.nonPrimaryReleaseHandler && !c.preventGesture && !c.defaultPrevented && (c.preventDefault = !0, p.nonPrimaryReleaseHandler(
|
|
3206
3206
|
{
|
|
@@ -3216,7 +3216,7 @@ function Ve() {
|
|
|
3216
3216
|
));
|
|
3217
3217
|
return;
|
|
3218
3218
|
}
|
|
3219
|
-
M = D.getById(g.id), M ? (D.removeContact(), M.captured && (
|
|
3219
|
+
M = D.getById(g.id), M ? (D.removeContact(), M.captured && (ae = !0), M.lastPos = M.currentPos, M.lastTime = M.currentTime, M.currentPos = g.currentPos, M.currentTime = g.currentTime, M.insideElement || ce(p, D, M), H = M.currentPos, Q = M.currentTime) : (g.captured = !1, g.insideElementPressed = !1, g.insideElement = !0, pe(D, g), M = g), !c.preventGesture && !c.defaultPrevented && (ae ? (c.shouldReleaseCapture = !0, c.preventDefault = !0, (p.dragHandler || p.dragEndHandler || p.pinchHandler) && e.MouseTracker.gesturePointVelocityTracker.removePoint(p, M), D.contacts === 0 ? (p.releaseHandler && H && p.releaseHandler(
|
|
3220
3220
|
{
|
|
3221
3221
|
eventSource: p,
|
|
3222
3222
|
pointerType: M.type,
|
|
@@ -3240,7 +3240,7 @@ function Ve() {
|
|
|
3240
3240
|
originalEvent: c.originalEvent,
|
|
3241
3241
|
userData: p.userData
|
|
3242
3242
|
}
|
|
3243
|
-
), S.sentDragEvent = !1, (p.clickHandler || p.dblClickHandler) && M.insideElement && (re =
|
|
3243
|
+
), S.sentDragEvent = !1, (p.clickHandler || p.dblClickHandler) && M.insideElement && (re = Q - M.contactTime <= p.clickTimeThreshold && M.contactPos.distanceTo(H) <= p.clickDistThreshold, p.clickHandler && p.clickHandler(
|
|
3244
3244
|
{
|
|
3245
3245
|
eventSource: p,
|
|
3246
3246
|
pointerType: M.type,
|
|
@@ -3278,14 +3278,14 @@ function Ve() {
|
|
|
3278
3278
|
}
|
|
3279
3279
|
), c.preventDefault = !0)));
|
|
3280
3280
|
}
|
|
3281
|
-
function
|
|
3282
|
-
var y = t[p.hash], S = p.getActivePointersListByType(g.type), D, H,
|
|
3281
|
+
function J(p, c, g) {
|
|
3282
|
+
var y = t[p.hash], S = p.getActivePointersListByType(g.type), D, H, Q;
|
|
3283
3283
|
if (typeof c.originalEvent.buttons < "u" && (S.buttons = c.originalEvent.buttons), D = S.getById(g.id), D)
|
|
3284
3284
|
D.lastPos = D.currentPos, D.lastTime = D.currentTime, D.currentPos = g.currentPos, D.currentTime = g.currentTime;
|
|
3285
3285
|
else
|
|
3286
3286
|
return;
|
|
3287
3287
|
c.shouldCapture = !1, c.shouldReleaseCapture = !1, p.stopHandler && g.type === "mouse" && (clearTimeout(p.stopTimeOut), p.stopTimeOut = setTimeout(function() {
|
|
3288
|
-
|
|
3288
|
+
te(p, c.originalEvent, g.type);
|
|
3289
3289
|
}, p.stopDelay)), S.contacts === 0 ? p.moveHandler && p.moveHandler(
|
|
3290
3290
|
{
|
|
3291
3291
|
eventSource: p,
|
|
@@ -3306,13 +3306,13 @@ function Ve() {
|
|
|
3306
3306
|
originalEvent: c.originalEvent,
|
|
3307
3307
|
userData: p.userData
|
|
3308
3308
|
}
|
|
3309
|
-
)), p.dragHandler && !c.preventGesture && !c.defaultPrevented && (D = S.asArray()[0],
|
|
3309
|
+
)), p.dragHandler && !c.preventGesture && !c.defaultPrevented && (D = S.asArray()[0], Q = D.currentPos.minus(D.lastPos), p.dragHandler(
|
|
3310
3310
|
{
|
|
3311
3311
|
eventSource: p,
|
|
3312
3312
|
pointerType: D.type,
|
|
3313
3313
|
position: x(D.currentPos, p.element),
|
|
3314
3314
|
buttons: S.buttons,
|
|
3315
|
-
delta:
|
|
3315
|
+
delta: Q,
|
|
3316
3316
|
speed: D.speed,
|
|
3317
3317
|
direction: D.direction,
|
|
3318
3318
|
shift: c.originalEvent.shiftKey,
|
|
@@ -3330,7 +3330,7 @@ function Ve() {
|
|
|
3330
3330
|
originalEvent: c.originalEvent,
|
|
3331
3331
|
userData: p.userData
|
|
3332
3332
|
}
|
|
3333
|
-
)), p.pinchHandler && g.type === "touch" && !c.preventGesture && !c.defaultPrevented && (
|
|
3333
|
+
)), p.pinchHandler && g.type === "touch" && !c.preventGesture && !c.defaultPrevented && (Q = y.pinchGPoints[0].currentPos.distanceTo(y.pinchGPoints[1].currentPos), Q !== y.currentPinchDist && (y.lastPinchDist = y.currentPinchDist, y.currentPinchDist = Q, y.lastPinchCenter = y.currentPinchCenter, y.currentPinchCenter = E(y.pinchGPoints[0].currentPos, y.pinchGPoints[1].currentPos), p.pinchHandler(
|
|
3334
3334
|
{
|
|
3335
3335
|
eventSource: p,
|
|
3336
3336
|
pointerType: "touch",
|
|
@@ -3345,11 +3345,11 @@ function Ve() {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
), c.preventDefault = !0)));
|
|
3347
3347
|
}
|
|
3348
|
-
function
|
|
3348
|
+
function N(p, c, g) {
|
|
3349
3349
|
var y = p.getActivePointersListByType(g.type), S;
|
|
3350
|
-
S = y.getById(g.id), S &&
|
|
3350
|
+
S = y.getById(g.id), S && ce(p, y, S);
|
|
3351
3351
|
}
|
|
3352
|
-
function
|
|
3352
|
+
function te(p, c, g) {
|
|
3353
3353
|
p.stopHandler && p.stopHandler({
|
|
3354
3354
|
eventSource: p,
|
|
3355
3355
|
pointerType: g,
|
|
@@ -3603,7 +3603,7 @@ function Ve() {
|
|
|
3603
3603
|
];
|
|
3604
3604
|
if (u.drawerOptions = Object.assign(
|
|
3605
3605
|
{},
|
|
3606
|
-
F.reduce((R,
|
|
3606
|
+
F.reduce((R, k) => (R[k] = u[k], delete u[k], R), {}),
|
|
3607
3607
|
u.drawerOptions
|
|
3608
3608
|
), e.extend(!0, this, {
|
|
3609
3609
|
//internal state and dom identifiers
|
|
@@ -3711,8 +3711,8 @@ function Ve() {
|
|
|
3711
3711
|
lastClickTime: null,
|
|
3712
3712
|
draggingToZoom: !1
|
|
3713
3713
|
}, this._sequenceIndex = 0, this._firstOpen = !0, this._updateRequestId = null, this._loadQueue = [], this.currentOverlays = [], this._updatePixelDensityRatioBind = null, this._lastScrollTime = e.now(), e.EventSource.call(this), this.addHandler("open-failed", function(R) {
|
|
3714
|
-
var
|
|
3715
|
-
_._showMessage(
|
|
3714
|
+
var k = e.getString("Errors.OpenFailed", R.eventSource, R.message);
|
|
3715
|
+
_._showMessage(k);
|
|
3716
3716
|
}), e.ControlDock.call(this, u), this.xmlPath && (this.tileSources = [this.xmlPath]), this.element = this.element || document.getElementById(this.id), this.canvas = e.makeNeutralElement("div"), this.canvas.className = "openseadragon-canvas", function(R) {
|
|
3717
3717
|
R.width = "100%", R.height = "100%", R.overflow = "hidden", R.position = "absolute", R.top = "0px", R.left = "0px";
|
|
3718
3718
|
}(this.canvas.style), e.setElementTouchActionNone(this.canvas), u.tabIndex !== "" && (this.canvas.tabIndex = u.tabIndex === void 0 ? 0 : u.tabIndex), this.container.className = "openseadragon-container", function(R) {
|
|
@@ -3730,18 +3730,18 @@ function Ve() {
|
|
|
3730
3730
|
keyHandler: e.delegate(this, E),
|
|
3731
3731
|
clickHandler: e.delegate(this, P),
|
|
3732
3732
|
dblClickHandler: e.delegate(this, I),
|
|
3733
|
-
dragHandler: e.delegate(this,
|
|
3733
|
+
dragHandler: e.delegate(this, B),
|
|
3734
3734
|
dragEndHandler: e.delegate(this, z),
|
|
3735
3735
|
enterHandler: e.delegate(this, V),
|
|
3736
|
-
leaveHandler: e.delegate(this,
|
|
3737
|
-
pressHandler: e.delegate(this,
|
|
3736
|
+
leaveHandler: e.delegate(this, Z),
|
|
3737
|
+
pressHandler: e.delegate(this, X),
|
|
3738
3738
|
releaseHandler: e.delegate(this, $),
|
|
3739
|
-
nonPrimaryPressHandler: e.delegate(this,
|
|
3740
|
-
nonPrimaryReleaseHandler: e.delegate(this,
|
|
3741
|
-
scrollHandler: e.delegate(this,
|
|
3742
|
-
pinchHandler: e.delegate(this,
|
|
3743
|
-
focusHandler: e.delegate(this,
|
|
3744
|
-
blurHandler: e.delegate(this,
|
|
3739
|
+
nonPrimaryPressHandler: e.delegate(this, Y),
|
|
3740
|
+
nonPrimaryReleaseHandler: e.delegate(this, U),
|
|
3741
|
+
scrollHandler: e.delegate(this, q),
|
|
3742
|
+
pinchHandler: e.delegate(this, O),
|
|
3743
|
+
focusHandler: e.delegate(this, j),
|
|
3744
|
+
blurHandler: e.delegate(this, L)
|
|
3745
3745
|
}), this.outerTracker = new e.MouseTracker({
|
|
3746
3746
|
userData: "Viewer.outerTracker",
|
|
3747
3747
|
element: this.container,
|
|
@@ -3750,8 +3750,8 @@ function Ve() {
|
|
|
3750
3750
|
clickDistThreshold: this.clickDistThreshold,
|
|
3751
3751
|
dblClickTimeThreshold: this.dblClickTimeThreshold,
|
|
3752
3752
|
dblClickDistThreshold: this.dblClickDistThreshold,
|
|
3753
|
-
enterHandler: e.delegate(this,
|
|
3754
|
-
leaveHandler: e.delegate(this,
|
|
3753
|
+
enterHandler: e.delegate(this, ee),
|
|
3754
|
+
leaveHandler: e.delegate(this, ne)
|
|
3755
3755
|
}), this.toolbar && (this.toolbar = new e.ControlDock({ element: this.toolbar })), this.bindStandardControls(), t[this.hash].prevContainerSize = i(this.container), window.ResizeObserver ? (this._autoResizePolling = !1, this._resizeObserver = new ResizeObserver(function() {
|
|
3756
3756
|
t[_.hash].needsResize = !0;
|
|
3757
3757
|
}), this._resizeObserver.observe(this.container, {})) : this._autoResizePolling = !0, this.world = new e.World({
|
|
@@ -3884,34 +3884,34 @@ function Ve() {
|
|
|
3884
3884
|
if (e.isArray(u) || (u = [u]), !u.length)
|
|
3885
3885
|
return this;
|
|
3886
3886
|
this._opening = !0;
|
|
3887
|
-
for (var b = u.length, F = 0, A = 0, R,
|
|
3887
|
+
for (var b = u.length, F = 0, A = 0, R, k = function() {
|
|
3888
3888
|
if (F + A === b)
|
|
3889
3889
|
if (F) {
|
|
3890
3890
|
(_._firstOpen || !_.preserveViewport) && (_.viewport.goHome(!0), _.viewport.update()), _._firstOpen = !1;
|
|
3891
|
-
var
|
|
3892
|
-
if (
|
|
3893
|
-
for (var
|
|
3894
|
-
_.currentOverlays[
|
|
3895
|
-
_._drawOverlays(), _._opening = !1, _.raiseEvent("open", { source:
|
|
3891
|
+
var N = u[0];
|
|
3892
|
+
if (N.tileSource && (N = N.tileSource), _.overlays && !_.preserveOverlays)
|
|
3893
|
+
for (var te = 0; te < _.overlays.length; te++)
|
|
3894
|
+
_.currentOverlays[te] = a(_, _.overlays[te]);
|
|
3895
|
+
_._drawOverlays(), _._opening = !1, _.raiseEvent("open", { source: N });
|
|
3896
3896
|
} else
|
|
3897
3897
|
_._opening = !1, _.raiseEvent("open-failed", R);
|
|
3898
|
-
},
|
|
3899
|
-
(!e.isPlainObject(
|
|
3900
|
-
tileSource:
|
|
3901
|
-
}),
|
|
3902
|
-
var
|
|
3903
|
-
|
|
3904
|
-
if (F++,
|
|
3905
|
-
for (var g = 0; g <
|
|
3906
|
-
_.addOverlay(
|
|
3907
|
-
|
|
3898
|
+
}, K = function(N) {
|
|
3899
|
+
(!e.isPlainObject(N) || !N.tileSource) && (N = {
|
|
3900
|
+
tileSource: N
|
|
3901
|
+
}), N.index !== void 0 && (e.console.error("[Viewer.open] setting indexes here is not supported; use addTiledImage instead"), delete N.index), N.collectionImmediately === void 0 && (N.collectionImmediately = !0);
|
|
3902
|
+
var te = N.success;
|
|
3903
|
+
N.success = function(c) {
|
|
3904
|
+
if (F++, N.tileSource.overlays)
|
|
3905
|
+
for (var g = 0; g < N.tileSource.overlays.length; g++)
|
|
3906
|
+
_.addOverlay(N.tileSource.overlays[g]);
|
|
3907
|
+
te && te(c), k();
|
|
3908
3908
|
};
|
|
3909
|
-
var p =
|
|
3910
|
-
|
|
3911
|
-
A++, R || (R = c), p && p(c),
|
|
3912
|
-
}, _.addTiledImage(
|
|
3913
|
-
},
|
|
3914
|
-
|
|
3909
|
+
var p = N.error;
|
|
3910
|
+
N.error = function(c) {
|
|
3911
|
+
A++, R || (R = c), p && p(c), k();
|
|
3912
|
+
}, _.addTiledImage(N);
|
|
3913
|
+
}, J = 0; J < u.length; J++)
|
|
3914
|
+
K(u[J]);
|
|
3915
3915
|
return this;
|
|
3916
3916
|
},
|
|
3917
3917
|
/**
|
|
@@ -3969,17 +3969,17 @@ function Ve() {
|
|
|
3969
3969
|
};
|
|
3970
3970
|
m = e.extend(!0, _, m);
|
|
3971
3971
|
const b = m.mainDrawer, F = m.redrawImmediately, A = m.drawerOptions, R = this.drawer;
|
|
3972
|
-
let
|
|
3973
|
-
if (u && u.prototype instanceof e.DrawerBase ? (
|
|
3972
|
+
let k = null;
|
|
3973
|
+
if (u && u.prototype instanceof e.DrawerBase ? (k = u, u = "custom") : typeof u == "string" && (k = e.determineDrawer(u)), k || e.console.warn("Unsupported drawer! Drawer must be an existing string type, or a class that extends OpenSeadragon.DrawerBase."), k && k.isSupported()) {
|
|
3974
3974
|
R && b && R.destroy();
|
|
3975
|
-
const
|
|
3975
|
+
const K = new k({
|
|
3976
3976
|
viewer: this,
|
|
3977
3977
|
viewport: this.viewport,
|
|
3978
3978
|
element: this.canvas,
|
|
3979
3979
|
debugGridColor: this.debugGridColor,
|
|
3980
3980
|
options: A || this.drawerOptions[u]
|
|
3981
3981
|
});
|
|
3982
|
-
return b && (this.drawer =
|
|
3982
|
+
return b && (this.drawer = K, F && this.forceRedraw()), K;
|
|
3983
3983
|
}
|
|
3984
3984
|
return !1;
|
|
3985
3985
|
},
|
|
@@ -4089,16 +4089,16 @@ function Ve() {
|
|
|
4089
4089
|
var m = document.body, _ = m.style, b = document.documentElement.style, F = this, A, R;
|
|
4090
4090
|
if (u === this.isFullPage())
|
|
4091
4091
|
return this;
|
|
4092
|
-
var
|
|
4092
|
+
var k = {
|
|
4093
4093
|
fullPage: u,
|
|
4094
4094
|
preventDefaultAction: !1
|
|
4095
4095
|
};
|
|
4096
|
-
if (this.raiseEvent("pre-full-page",
|
|
4096
|
+
if (this.raiseEvent("pre-full-page", k), k.preventDefaultAction)
|
|
4097
4097
|
return this;
|
|
4098
4098
|
if (u && this.element) {
|
|
4099
4099
|
for (this.elementSize = e.getElementSize(this.element), this.pageScroll = e.getPageScroll(), this.elementMargin = this.element.style.margin, this.element.style.margin = "0", this.elementPadding = this.element.style.padding, this.element.style.padding = "0", this.bodyMargin = _.margin, this.docMargin = b.margin, _.margin = "0", b.margin = "0", this.bodyPadding = _.padding, this.docPadding = b.padding, _.padding = "0", b.padding = "0", this.bodyWidth = _.width, this.docWidth = b.width, _.width = "100%", b.width = "100%", this.bodyHeight = _.height, this.docHeight = b.height, _.height = "100%", b.height = "100%", this.bodyDisplay = _.display, _.display = "block", this.previousBody = [], t[this.hash].prevElementParent = this.element.parentNode, t[this.hash].prevNextSibling = this.element.nextSibling, t[this.hash].prevElementWidth = this.element.style.width, t[this.hash].prevElementHeight = this.element.style.height, A = m.childNodes.length, R = 0; R < A; R++)
|
|
4100
4100
|
this.previousBody.push(m.childNodes[0]), m.removeChild(m.childNodes[0]);
|
|
4101
|
-
this.toolbar && this.toolbar.element && (this.toolbar.parentNode = this.toolbar.element.parentNode, this.toolbar.nextSibling = this.toolbar.element.nextSibling, m.appendChild(this.toolbar.element), e.addClass(this.toolbar.element, "fullpage")), e.addClass(this.element, "fullpage"), m.appendChild(this.element), this.element.style.height = "100vh", this.element.style.width = "100vw", this.toolbar && this.toolbar.element && (this.element.style.height = e.getElementSize(this.element).y - e.getElementSize(this.toolbar.element).y + "px"), t[this.hash].fullPage = !0, e.delegate(this,
|
|
4101
|
+
this.toolbar && this.toolbar.element && (this.toolbar.parentNode = this.toolbar.element.parentNode, this.toolbar.nextSibling = this.toolbar.element.nextSibling, m.appendChild(this.toolbar.element), e.addClass(this.toolbar.element, "fullpage")), e.addClass(this.element, "fullpage"), m.appendChild(this.element), this.element.style.height = "100vh", this.element.style.width = "100vw", this.toolbar && this.toolbar.element && (this.element.style.height = e.getElementSize(this.element).y - e.getElementSize(this.toolbar.element).y + "px"), t[this.hash].fullPage = !0, e.delegate(this, ee)({});
|
|
4102
4102
|
} else {
|
|
4103
4103
|
for (this.element.style.margin = this.elementMargin, this.element.style.padding = this.elementPadding, _.margin = this.bodyMargin, b.margin = this.docMargin, _.padding = this.bodyPadding, b.padding = this.docPadding, _.width = this.bodyWidth, b.width = this.docWidth, _.height = this.bodyHeight, b.height = this.docHeight, _.display = this.bodyDisplay, m.removeChild(this.element), A = this.previousBody.length, R = 0; R < A; R++)
|
|
4104
4104
|
m.appendChild(this.previousBody.shift());
|
|
@@ -4109,12 +4109,12 @@ function Ve() {
|
|
|
4109
4109
|
this.toolbar.element,
|
|
4110
4110
|
this.toolbar.nextSibling
|
|
4111
4111
|
), delete this.toolbar.parentNode, delete this.toolbar.nextSibling), this.element.style.width = t[this.hash].prevElementWidth, this.element.style.height = t[this.hash].prevElementHeight;
|
|
4112
|
-
var
|
|
4112
|
+
var K = 0, J = function() {
|
|
4113
4113
|
e.setPageScroll(F.pageScroll);
|
|
4114
|
-
var
|
|
4115
|
-
|
|
4114
|
+
var N = e.getPageScroll();
|
|
4115
|
+
K++, K < 10 && (N.x !== F.pageScroll.x || N.y !== F.pageScroll.y) && e.requestAnimationFrame(J);
|
|
4116
4116
|
};
|
|
4117
|
-
e.requestAnimationFrame(
|
|
4117
|
+
e.requestAnimationFrame(J), t[this.hash].fullPage = !1, e.delegate(this, ne)({});
|
|
4118
4118
|
}
|
|
4119
4119
|
return this.navigator && this.viewport && this.navigator.update(this.viewport), this.raiseEvent("full-page", { fullPage: u }), this;
|
|
4120
4120
|
},
|
|
@@ -4253,9 +4253,9 @@ function Ve() {
|
|
|
4253
4253
|
options: u
|
|
4254
4254
|
};
|
|
4255
4255
|
function b(R) {
|
|
4256
|
-
for (var
|
|
4257
|
-
if (m._loadQueue[
|
|
4258
|
-
m._loadQueue.splice(
|
|
4256
|
+
for (var k = 0; k < m._loadQueue.length; k++)
|
|
4257
|
+
if (m._loadQueue[k] === _) {
|
|
4258
|
+
m._loadQueue.splice(k, 1);
|
|
4259
4259
|
break;
|
|
4260
4260
|
}
|
|
4261
4261
|
m._loadQueue.length === 0 && F(_), m.raiseEvent("add-item-failed", R), u.error && u.error(R);
|
|
@@ -4282,12 +4282,12 @@ function Ve() {
|
|
|
4282
4282
|
}
|
|
4283
4283
|
this._loadQueue.push(_);
|
|
4284
4284
|
function A() {
|
|
4285
|
-
for (var R,
|
|
4285
|
+
for (var R, k, K; m._loadQueue.length && (R = m._loadQueue[0], !!R.tileSource); ) {
|
|
4286
4286
|
if (m._loadQueue.splice(0, 1), R.options.replace) {
|
|
4287
|
-
var
|
|
4288
|
-
|
|
4287
|
+
var J = m.world.getIndexOfItem(R.options.replaceItem);
|
|
4288
|
+
J !== -1 && (R.options.index = J), m.world.removeItem(R.options.replaceItem);
|
|
4289
4289
|
}
|
|
4290
|
-
|
|
4290
|
+
k = new e.TiledImage({
|
|
4291
4291
|
viewer: m,
|
|
4292
4292
|
source: R.tileSource,
|
|
4293
4293
|
viewport: m.viewport,
|
|
@@ -4325,15 +4325,15 @@ function Ve() {
|
|
|
4325
4325
|
ajaxHeaders: R.options.ajaxHeaders,
|
|
4326
4326
|
debugMode: m.debugMode,
|
|
4327
4327
|
subPixelRoundingForTransparency: m.subPixelRoundingForTransparency
|
|
4328
|
-
}), m.collectionMode && m.world.setAutoRefigureSizes(!1), m.navigator && (
|
|
4328
|
+
}), m.collectionMode && m.world.setAutoRefigureSizes(!1), m.navigator && (K = e.extend({}, R.options, {
|
|
4329
4329
|
replace: !1,
|
|
4330
4330
|
// navigator already removed the layer, nothing to replace
|
|
4331
|
-
originalTiledImage:
|
|
4331
|
+
originalTiledImage: k,
|
|
4332
4332
|
tileSource: R.tileSource
|
|
4333
|
-
}), m.navigator.addTiledImage(
|
|
4333
|
+
}), m.navigator.addTiledImage(K)), m.world.addItem(k, {
|
|
4334
4334
|
index: R.options.index
|
|
4335
4335
|
}), m._loadQueue.length === 0 && F(R), m.world.getItemCount() === 1 && !m.preserveViewport && m.viewport.goHome(!0), R.options.success && R.options.success({
|
|
4336
|
-
item:
|
|
4336
|
+
item: k
|
|
4337
4337
|
});
|
|
4338
4338
|
}
|
|
4339
4339
|
}
|
|
@@ -4464,7 +4464,7 @@ function Ve() {
|
|
|
4464
4464
|
* @returns {OpenSeadragon.Viewer} Chainable.
|
|
4465
4465
|
*/
|
|
4466
4466
|
bindStandardControls: function() {
|
|
4467
|
-
var u = e.delegate(this,
|
|
4467
|
+
var u = e.delegate(this, fe), m = e.delegate(this, me), _ = e.delegate(this, _e), b = e.delegate(this, ge), F = e.delegate(this, ye), A = e.delegate(this, Ee), R = e.delegate(this, Te), k = e.delegate(this, Se), K = e.delegate(this, pe), J = e.delegate(this, ce), N = e.delegate(this, v), te = e.delegate(this, w), p = this.navImages, c = [], g = !0;
|
|
4468
4468
|
return this.showNavigationControl && ((this.zoomInButton || this.zoomOutButton || this.homeButton || this.fullPageButton || this.rotateLeftButton || this.rotateRightButton || this.flipButton) && (g = !1), this.showZoomControl && (c.push(this.zoomInButton = new e.Button({
|
|
4469
4469
|
element: this.zoomInButton ? e.getElement(this.zoomInButton) : null,
|
|
4470
4470
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
@@ -4479,8 +4479,8 @@ function Ve() {
|
|
|
4479
4479
|
onClick: _,
|
|
4480
4480
|
onEnter: u,
|
|
4481
4481
|
onExit: m,
|
|
4482
|
-
onFocus:
|
|
4483
|
-
onBlur:
|
|
4482
|
+
onFocus: N,
|
|
4483
|
+
onBlur: te
|
|
4484
4484
|
})), c.push(this.zoomOutButton = new e.Button({
|
|
4485
4485
|
element: this.zoomOutButton ? e.getElement(this.zoomOutButton) : null,
|
|
4486
4486
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
@@ -4495,8 +4495,8 @@ function Ve() {
|
|
|
4495
4495
|
onClick: F,
|
|
4496
4496
|
onEnter: b,
|
|
4497
4497
|
onExit: m,
|
|
4498
|
-
onFocus:
|
|
4499
|
-
onBlur:
|
|
4498
|
+
onFocus: N,
|
|
4499
|
+
onBlur: te
|
|
4500
4500
|
}))), this.showHomeControl && c.push(this.homeButton = new e.Button({
|
|
4501
4501
|
element: this.homeButton ? e.getElement(this.homeButton) : null,
|
|
4502
4502
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
@@ -4507,8 +4507,8 @@ function Ve() {
|
|
|
4507
4507
|
srcHover: G(this.prefixUrl, p.home.HOVER),
|
|
4508
4508
|
srcDown: G(this.prefixUrl, p.home.DOWN),
|
|
4509
4509
|
onRelease: A,
|
|
4510
|
-
onFocus:
|
|
4511
|
-
onBlur:
|
|
4510
|
+
onFocus: N,
|
|
4511
|
+
onBlur: te
|
|
4512
4512
|
})), this.showFullPageControl && c.push(this.fullPageButton = new e.Button({
|
|
4513
4513
|
element: this.fullPageButton ? e.getElement(this.fullPageButton) : null,
|
|
4514
4514
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
@@ -4519,8 +4519,8 @@ function Ve() {
|
|
|
4519
4519
|
srcHover: G(this.prefixUrl, p.fullpage.HOVER),
|
|
4520
4520
|
srcDown: G(this.prefixUrl, p.fullpage.DOWN),
|
|
4521
4521
|
onRelease: R,
|
|
4522
|
-
onFocus:
|
|
4523
|
-
onBlur:
|
|
4522
|
+
onFocus: N,
|
|
4523
|
+
onBlur: te
|
|
4524
4524
|
})), this.showRotationControl && (c.push(this.rotateLeftButton = new e.Button({
|
|
4525
4525
|
element: this.rotateLeftButton ? e.getElement(this.rotateLeftButton) : null,
|
|
4526
4526
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
@@ -4530,9 +4530,9 @@ function Ve() {
|
|
|
4530
4530
|
srcGroup: G(this.prefixUrl, p.rotateleft.GROUP),
|
|
4531
4531
|
srcHover: G(this.prefixUrl, p.rotateleft.HOVER),
|
|
4532
4532
|
srcDown: G(this.prefixUrl, p.rotateleft.DOWN),
|
|
4533
|
-
onRelease:
|
|
4534
|
-
onFocus:
|
|
4535
|
-
onBlur:
|
|
4533
|
+
onRelease: k,
|
|
4534
|
+
onFocus: N,
|
|
4535
|
+
onBlur: te
|
|
4536
4536
|
})), c.push(this.rotateRightButton = new e.Button({
|
|
4537
4537
|
element: this.rotateRightButton ? e.getElement(this.rotateRightButton) : null,
|
|
4538
4538
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
@@ -4542,9 +4542,9 @@ function Ve() {
|
|
|
4542
4542
|
srcGroup: G(this.prefixUrl, p.rotateright.GROUP),
|
|
4543
4543
|
srcHover: G(this.prefixUrl, p.rotateright.HOVER),
|
|
4544
4544
|
srcDown: G(this.prefixUrl, p.rotateright.DOWN),
|
|
4545
|
-
onRelease:
|
|
4546
|
-
onFocus:
|
|
4547
|
-
onBlur:
|
|
4545
|
+
onRelease: K,
|
|
4546
|
+
onFocus: N,
|
|
4547
|
+
onBlur: te
|
|
4548
4548
|
}))), this.showFlipControl && c.push(this.flipButton = new e.Button({
|
|
4549
4549
|
element: this.flipButton ? e.getElement(this.flipButton) : null,
|
|
4550
4550
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
@@ -4554,14 +4554,14 @@ function Ve() {
|
|
|
4554
4554
|
srcGroup: G(this.prefixUrl, p.flip.GROUP),
|
|
4555
4555
|
srcHover: G(this.prefixUrl, p.flip.HOVER),
|
|
4556
4556
|
srcDown: G(this.prefixUrl, p.flip.DOWN),
|
|
4557
|
-
onRelease:
|
|
4558
|
-
onFocus:
|
|
4559
|
-
onBlur:
|
|
4557
|
+
onRelease: J,
|
|
4558
|
+
onFocus: N,
|
|
4559
|
+
onBlur: te
|
|
4560
4560
|
})), g ? (this.buttonGroup = new e.ButtonGroup({
|
|
4561
4561
|
buttons: c,
|
|
4562
4562
|
clickTimeThreshold: this.clickTimeThreshold,
|
|
4563
4563
|
clickDistThreshold: this.clickDistThreshold
|
|
4564
|
-
}), this.navControl = this.buttonGroup.element, this.addHandler("open", e.delegate(this,
|
|
4564
|
+
}), this.navControl = this.buttonGroup.element, this.addHandler("open", e.delegate(this, we)), this.toolbar ? this.toolbar.addControl(
|
|
4565
4565
|
this.navControl,
|
|
4566
4566
|
{ anchor: this.navigationControlAnchor || e.ControlAnchor.TOP_LEFT }
|
|
4567
4567
|
) : this.addControl(
|
|
@@ -4841,13 +4841,13 @@ function Ve() {
|
|
|
4841
4841
|
} catch {
|
|
4842
4842
|
}
|
|
4843
4843
|
}
|
|
4844
|
-
function
|
|
4845
|
-
|
|
4846
|
-
b(
|
|
4847
|
-
}),
|
|
4844
|
+
function k(K, J) {
|
|
4845
|
+
K.ready ? b(K) : (K.addHandler("ready", function() {
|
|
4846
|
+
b(K);
|
|
4847
|
+
}), K.addHandler("open-failed", function(N) {
|
|
4848
4848
|
F({
|
|
4849
|
-
message:
|
|
4850
|
-
source:
|
|
4849
|
+
message: N.message,
|
|
4850
|
+
source: J
|
|
4851
4851
|
});
|
|
4852
4852
|
}));
|
|
4853
4853
|
}
|
|
@@ -4859,30 +4859,30 @@ function Ve() {
|
|
|
4859
4859
|
ajaxWithCredentials: u.ajaxWithCredentials,
|
|
4860
4860
|
ajaxHeaders: _.ajaxHeaders ? _.ajaxHeaders : u.ajaxHeaders,
|
|
4861
4861
|
splitHashDataForPost: u.splitHashDataForPost,
|
|
4862
|
-
success: function(
|
|
4863
|
-
b(
|
|
4862
|
+
success: function(te) {
|
|
4863
|
+
b(te.tileSource);
|
|
4864
4864
|
}
|
|
4865
|
-
}), m.addHandler("open-failed", function(
|
|
4866
|
-
F(
|
|
4865
|
+
}), m.addHandler("open-failed", function(te) {
|
|
4866
|
+
F(te);
|
|
4867
4867
|
});
|
|
4868
4868
|
else if (e.isPlainObject(m) || m.nodeType)
|
|
4869
4869
|
if (m.crossOriginPolicy === void 0 && (_.crossOriginPolicy !== void 0 || u.crossOriginPolicy !== void 0) && (m.crossOriginPolicy = _.crossOriginPolicy !== void 0 ? _.crossOriginPolicy : u.crossOriginPolicy), m.ajaxWithCredentials === void 0 && (m.ajaxWithCredentials = u.ajaxWithCredentials), e.isFunction(m.getTileUrl)) {
|
|
4870
|
-
var
|
|
4871
|
-
|
|
4870
|
+
var K = new e.TileSource(m);
|
|
4871
|
+
K.getTileUrl = m.getTileUrl, b(K);
|
|
4872
4872
|
} else {
|
|
4873
|
-
var
|
|
4874
|
-
if (!
|
|
4873
|
+
var J = e.TileSource.determineType(A, m);
|
|
4874
|
+
if (!J) {
|
|
4875
4875
|
F({
|
|
4876
4876
|
message: "Unable to load TileSource",
|
|
4877
4877
|
source: m
|
|
4878
4878
|
});
|
|
4879
4879
|
return;
|
|
4880
4880
|
}
|
|
4881
|
-
var
|
|
4882
|
-
|
|
4881
|
+
var N = J.prototype.configure.apply(A, [m]);
|
|
4882
|
+
k(new J(N), m);
|
|
4883
4883
|
}
|
|
4884
4884
|
else
|
|
4885
|
-
|
|
4885
|
+
k(m, m);
|
|
4886
4886
|
});
|
|
4887
4887
|
}
|
|
4888
4888
|
function a(u, m) {
|
|
@@ -4900,23 +4900,23 @@ function Ve() {
|
|
|
4900
4900
|
}
|
|
4901
4901
|
var F = m.location, A = m.width, R = m.height;
|
|
4902
4902
|
if (!F) {
|
|
4903
|
-
var
|
|
4903
|
+
var k = m.x, K = m.y;
|
|
4904
4904
|
if (m.px !== void 0) {
|
|
4905
|
-
var
|
|
4905
|
+
var J = u.viewport.imageToViewportRectangle(new e.Rect(
|
|
4906
4906
|
m.px,
|
|
4907
4907
|
m.py,
|
|
4908
4908
|
A || 0,
|
|
4909
4909
|
R || 0
|
|
4910
4910
|
));
|
|
4911
|
-
|
|
4911
|
+
k = J.x, K = J.y, A = A !== void 0 ? J.width : void 0, R = R !== void 0 ? J.height : void 0;
|
|
4912
4912
|
}
|
|
4913
|
-
F = new e.Point(
|
|
4913
|
+
F = new e.Point(k, K);
|
|
4914
4914
|
}
|
|
4915
|
-
var
|
|
4916
|
-
return
|
|
4915
|
+
var N = m.placement;
|
|
4916
|
+
return N && e.type(N) === "string" && (N = e.Placement[m.placement.toUpperCase()]), new e.Overlay({
|
|
4917
4917
|
element: _,
|
|
4918
4918
|
location: F,
|
|
4919
|
-
placement:
|
|
4919
|
+
placement: N,
|
|
4920
4920
|
onDraw: m.onDraw,
|
|
4921
4921
|
checkResize: m.checkResize,
|
|
4922
4922
|
width: A,
|
|
@@ -5071,7 +5071,7 @@ function Ve() {
|
|
|
5071
5071
|
m.zoomToRefPoint ? this.viewport.pointFromPixel(u.position, !0) : null
|
|
5072
5072
|
), this.viewport.applyConstraints()));
|
|
5073
5073
|
}
|
|
5074
|
-
function
|
|
5074
|
+
function B(u) {
|
|
5075
5075
|
var m, _ = {
|
|
5076
5076
|
tracker: u.eventSource,
|
|
5077
5077
|
pointerType: u.pointerType,
|
|
@@ -5138,7 +5138,7 @@ function Ve() {
|
|
|
5138
5138
|
originalEvent: u.originalEvent
|
|
5139
5139
|
});
|
|
5140
5140
|
}
|
|
5141
|
-
function
|
|
5141
|
+
function Z(u) {
|
|
5142
5142
|
this.raiseEvent("canvas-exit", {
|
|
5143
5143
|
tracker: u.eventSource,
|
|
5144
5144
|
pointerType: u.pointerType,
|
|
@@ -5150,7 +5150,7 @@ function Ve() {
|
|
|
5150
5150
|
originalEvent: u.originalEvent
|
|
5151
5151
|
});
|
|
5152
5152
|
}
|
|
5153
|
-
function
|
|
5153
|
+
function X(u) {
|
|
5154
5154
|
var m;
|
|
5155
5155
|
if (this.raiseEvent("canvas-press", {
|
|
5156
5156
|
tracker: u.eventSource,
|
|
@@ -5176,7 +5176,7 @@ function Ve() {
|
|
|
5176
5176
|
originalEvent: u.originalEvent
|
|
5177
5177
|
});
|
|
5178
5178
|
}
|
|
5179
|
-
function
|
|
5179
|
+
function Y(u) {
|
|
5180
5180
|
this.raiseEvent("canvas-nonprimary-press", {
|
|
5181
5181
|
tracker: u.eventSource,
|
|
5182
5182
|
position: u.position,
|
|
@@ -5186,7 +5186,7 @@ function Ve() {
|
|
|
5186
5186
|
originalEvent: u.originalEvent
|
|
5187
5187
|
});
|
|
5188
5188
|
}
|
|
5189
|
-
function
|
|
5189
|
+
function U(u) {
|
|
5190
5190
|
this.raiseEvent("canvas-nonprimary-release", {
|
|
5191
5191
|
tracker: u.eventSource,
|
|
5192
5192
|
position: u.position,
|
|
@@ -5196,7 +5196,7 @@ function Ve() {
|
|
|
5196
5196
|
originalEvent: u.originalEvent
|
|
5197
5197
|
});
|
|
5198
5198
|
}
|
|
5199
|
-
function
|
|
5199
|
+
function O(u) {
|
|
5200
5200
|
var m, _, b, F, A = {
|
|
5201
5201
|
tracker: u.eventSource,
|
|
5202
5202
|
pointerType: u.pointerType,
|
|
@@ -5215,26 +5215,26 @@ function Ve() {
|
|
|
5215
5215
|
var R = Math.atan2(
|
|
5216
5216
|
u.gesturePoints[0].currentPos.y - u.gesturePoints[1].currentPos.y,
|
|
5217
5217
|
u.gesturePoints[0].currentPos.x - u.gesturePoints[1].currentPos.x
|
|
5218
|
-
),
|
|
5218
|
+
), k = Math.atan2(
|
|
5219
5219
|
u.gesturePoints[0].lastPos.y - u.gesturePoints[1].lastPos.y,
|
|
5220
5220
|
u.gesturePoints[0].lastPos.x - u.gesturePoints[1].lastPos.x
|
|
5221
5221
|
);
|
|
5222
|
-
_ = this.viewport.pointFromPixel(u.center, !0), this.viewport.rotateTo(this.viewport.getRotation(!0) + (R -
|
|
5222
|
+
_ = this.viewport.pointFromPixel(u.center, !0), this.viewport.rotateTo(this.viewport.getRotation(!0) + (R - k) * (180 / Math.PI), _, !0);
|
|
5223
5223
|
}
|
|
5224
5224
|
}
|
|
5225
|
-
function
|
|
5225
|
+
function j(u) {
|
|
5226
5226
|
this.raiseEvent("canvas-focus", {
|
|
5227
5227
|
tracker: u.eventSource,
|
|
5228
5228
|
originalEvent: u.originalEvent
|
|
5229
5229
|
});
|
|
5230
5230
|
}
|
|
5231
|
-
function
|
|
5231
|
+
function L(u) {
|
|
5232
5232
|
this.raiseEvent("canvas-blur", {
|
|
5233
5233
|
tracker: u.eventSource,
|
|
5234
5234
|
originalEvent: u.originalEvent
|
|
5235
5235
|
});
|
|
5236
5236
|
}
|
|
5237
|
-
function
|
|
5237
|
+
function q(u) {
|
|
5238
5238
|
var m, _, b, F, A;
|
|
5239
5239
|
F = e.now(), A = F - this._lastScrollTime, A > this.minScrollDeltaTime ? (this._lastScrollTime = F, m = {
|
|
5240
5240
|
tracker: u.eventSource,
|
|
@@ -5249,7 +5249,7 @@ function Ve() {
|
|
|
5249
5249
|
_.zoomToRefPoint ? this.viewport.pointFromPixel(u.position, !0) : null
|
|
5250
5250
|
), this.viewport.applyConstraints())), u.preventDefault = m.preventDefault) : u.preventDefault = !0;
|
|
5251
5251
|
}
|
|
5252
|
-
function
|
|
5252
|
+
function ee(u) {
|
|
5253
5253
|
t[this.hash].mouseInside = !0, f(this), this.raiseEvent("container-enter", {
|
|
5254
5254
|
tracker: u.eventSource,
|
|
5255
5255
|
pointerType: u.pointerType,
|
|
@@ -5261,7 +5261,7 @@ function Ve() {
|
|
|
5261
5261
|
originalEvent: u.originalEvent
|
|
5262
5262
|
});
|
|
5263
5263
|
}
|
|
5264
|
-
function
|
|
5264
|
+
function ne(u) {
|
|
5265
5265
|
u.pointers < 1 && (t[this.hash].mouseInside = !1, t[this.hash].animating || h(this)), this.raiseEvent("container-exit", {
|
|
5266
5266
|
tracker: u.eventSource,
|
|
5267
5267
|
pointerType: u.pointerType,
|
|
@@ -5276,15 +5276,15 @@ function Ve() {
|
|
|
5276
5276
|
function se(u) {
|
|
5277
5277
|
le(u), u.isOpen() ? u._updateRequestId = o(u, se) : u._updateRequestId = !1;
|
|
5278
5278
|
}
|
|
5279
|
-
function
|
|
5279
|
+
function oe(u, m) {
|
|
5280
5280
|
var _ = u.viewport, b = _.getZoom(), F = _.getCenter();
|
|
5281
5281
|
_.resize(m, u.preserveImageSizeOnResize), _.panTo(F, !0);
|
|
5282
5282
|
var A;
|
|
5283
5283
|
if (u.preserveImageSizeOnResize)
|
|
5284
5284
|
A = t[u.hash].prevContainerSize.x / m.x;
|
|
5285
5285
|
else {
|
|
5286
|
-
var R = new e.Point(0, 0),
|
|
5287
|
-
A =
|
|
5286
|
+
var R = new e.Point(0, 0), k = new e.Point(t[u.hash].prevContainerSize.x, t[u.hash].prevContainerSize.y).distanceTo(R), K = new e.Point(m.x, m.y).distanceTo(R);
|
|
5287
|
+
A = K / k * t[u.hash].prevContainerSize.x / m.x;
|
|
5288
5288
|
}
|
|
5289
5289
|
_.zoomTo(b * A, null, !0), t[u.hash].prevContainerSize = m, t[u.hash].forceRedraw = !0, t[u.hash].needsResize = !1, t[u.hash].forceResize = !1;
|
|
5290
5290
|
}
|
|
@@ -5297,55 +5297,55 @@ function Ve() {
|
|
|
5297
5297
|
var _ = t[u.hash].prevContainerSize;
|
|
5298
5298
|
m.equals(_) || (t[u.hash].needsResize = !0);
|
|
5299
5299
|
}
|
|
5300
|
-
t[u.hash].needsResize &&
|
|
5300
|
+
t[u.hash].needsResize && oe(u, m || i(u.container));
|
|
5301
5301
|
}
|
|
5302
5302
|
var b = u.viewport.update(), F = u.world.update(b) || b;
|
|
5303
5303
|
b && u.raiseEvent("viewport-change"), u.referenceStrip && (F = u.referenceStrip.update(u.viewport) || F);
|
|
5304
5304
|
var A = t[u.hash].animating;
|
|
5305
5305
|
!A && F && (u.raiseEvent("animation-start"), f(u));
|
|
5306
5306
|
var R = A && !F;
|
|
5307
|
-
R && (t[u.hash].animating = !1), (F || R || t[u.hash].forceRedraw || u.world.needsDraw()) && (
|
|
5307
|
+
R && (t[u.hash].animating = !1), (F || R || t[u.hash].forceRedraw || u.world.needsDraw()) && (he(u), u._drawOverlays(), u.navigator && u.navigator.update(u.viewport), t[u.hash].forceRedraw = !1, F && u.raiseEvent("animation")), R && (u.raiseEvent("animation-finish"), t[u.hash].mouseInside || h(u)), t[u.hash].animating = F;
|
|
5308
5308
|
}
|
|
5309
5309
|
}
|
|
5310
|
-
function
|
|
5310
|
+
function he(u) {
|
|
5311
5311
|
u.imageLoader.clear(), u.world.draw(), u.raiseEvent("update-viewport", {});
|
|
5312
5312
|
}
|
|
5313
5313
|
function G(u, m) {
|
|
5314
5314
|
return u ? u + m : m;
|
|
5315
5315
|
}
|
|
5316
|
-
function pe() {
|
|
5317
|
-
t[this.hash].lastZoomTime = e.now(), t[this.hash].zoomFactor = this.zoomPerSecond, t[this.hash].zooming = !0, he(this);
|
|
5318
|
-
}
|
|
5319
5316
|
function fe() {
|
|
5320
|
-
t[this.hash].lastZoomTime = e.now(), t[this.hash].zoomFactor =
|
|
5317
|
+
t[this.hash].lastZoomTime = e.now(), t[this.hash].zoomFactor = this.zoomPerSecond, t[this.hash].zooming = !0, ue(this);
|
|
5321
5318
|
}
|
|
5322
5319
|
function ge() {
|
|
5320
|
+
t[this.hash].lastZoomTime = e.now(), t[this.hash].zoomFactor = 1 / this.zoomPerSecond, t[this.hash].zooming = !0, ue(this);
|
|
5321
|
+
}
|
|
5322
|
+
function me() {
|
|
5323
5323
|
t[this.hash].zooming = !1;
|
|
5324
5324
|
}
|
|
5325
|
-
function
|
|
5326
|
-
e.requestAnimationFrame(e.delegate(u,
|
|
5325
|
+
function ue(u) {
|
|
5326
|
+
e.requestAnimationFrame(e.delegate(u, ve));
|
|
5327
5327
|
}
|
|
5328
|
-
function
|
|
5328
|
+
function ve() {
|
|
5329
5329
|
var u, m, _;
|
|
5330
|
-
t[this.hash].zooming && this.viewport && (u = e.now(), m = u - t[this.hash].lastZoomTime, _ = Math.pow(t[this.hash].zoomFactor, m / 1e3), this.viewport.zoomBy(_), this.viewport.applyConstraints(), t[this.hash].lastZoomTime = u,
|
|
5330
|
+
t[this.hash].zooming && this.viewport && (u = e.now(), m = u - t[this.hash].lastZoomTime, _ = Math.pow(t[this.hash].zoomFactor, m / 1e3), this.viewport.zoomBy(_), this.viewport.applyConstraints(), t[this.hash].lastZoomTime = u, ue(this));
|
|
5331
5331
|
}
|
|
5332
5332
|
function _e() {
|
|
5333
5333
|
this.viewport && (t[this.hash].zooming = !1, this.viewport.zoomBy(
|
|
5334
5334
|
this.zoomPerClick / 1
|
|
5335
5335
|
), this.viewport.applyConstraints());
|
|
5336
5336
|
}
|
|
5337
|
-
function
|
|
5337
|
+
function ye() {
|
|
5338
5338
|
this.viewport && (t[this.hash].zooming = !1, this.viewport.zoomBy(
|
|
5339
5339
|
1 / this.zoomPerClick
|
|
5340
5340
|
), this.viewport.applyConstraints());
|
|
5341
5341
|
}
|
|
5342
|
-
function
|
|
5342
|
+
function we() {
|
|
5343
5343
|
this.buttonGroup && (this.buttonGroup.emulateEnter(), this.buttonGroup.emulateLeave());
|
|
5344
5344
|
}
|
|
5345
5345
|
function Ee() {
|
|
5346
5346
|
this.viewport && this.viewport.goHome();
|
|
5347
5347
|
}
|
|
5348
|
-
function
|
|
5348
|
+
function Te() {
|
|
5349
5349
|
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();
|
|
5350
5350
|
}
|
|
5351
5351
|
function Se() {
|
|
@@ -5354,13 +5354,13 @@ function Ve() {
|
|
|
5354
5354
|
this.viewport.flipped ? u += this.rotationIncrement : u -= this.rotationIncrement, this.viewport.setRotation(u);
|
|
5355
5355
|
}
|
|
5356
5356
|
}
|
|
5357
|
-
function
|
|
5357
|
+
function pe() {
|
|
5358
5358
|
if (this.viewport) {
|
|
5359
5359
|
var u = this.viewport.getRotation();
|
|
5360
5360
|
this.viewport.flipped ? u -= this.rotationIncrement : u += this.rotationIncrement, this.viewport.setRotation(u);
|
|
5361
5361
|
}
|
|
5362
5362
|
}
|
|
5363
|
-
function
|
|
5363
|
+
function ce() {
|
|
5364
5364
|
this.viewport.toggleFlip();
|
|
5365
5365
|
}
|
|
5366
5366
|
e.determineDrawer = function(u) {
|
|
@@ -6669,8 +6669,8 @@ function Ve() {
|
|
|
6669
6669
|
var l = null;
|
|
6670
6670
|
return this.levels.length > 0 && a >= this.minLevel && a <= this.maxLevel && (l = this.levels[a].url), l;
|
|
6671
6671
|
}
|
|
6672
|
-
var h = "0", d = Math.pow(0.5, this.maxLevel - a), f, v, w, T, x, E, P, I,
|
|
6673
|
-
return this.levelSizes ? (f = this.levelSizes[a].width, v = this.levelSizes[a].height) : (f = Math.ceil(this.width * d), v = Math.ceil(this.height * d)), w = this.getTileWidth(a), T = this.getTileHeight(a), x = Math.round(w / d), E = Math.round(T / d), this.version === 1 ?
|
|
6672
|
+
var h = "0", d = Math.pow(0.5, this.maxLevel - a), f, v, w, T, x, E, P, I, B, z, V, Z, X, $, Y, U;
|
|
6673
|
+
return this.levelSizes ? (f = this.levelSizes[a].width, v = this.levelSizes[a].height) : (f = Math.ceil(this.width * d), v = Math.ceil(this.height * d)), w = this.getTileWidth(a), T = this.getTileHeight(a), x = Math.round(w / d), E = Math.round(T / d), this.version === 1 ? Y = "native." + this.tileFormat : Y = "default." + this.tileFormat, f < w && v < T ? (this.version === 2 && f === this.width ? Z = "full" : this.version === 3 && f === this.width && v === this.height ? Z = "max" : this.version === 3 ? Z = f + "," + v : Z = f + ",", P = "full") : (I = s * x, B = o * E, z = Math.min(x, this.width - I), V = Math.min(E, this.height - B), s === 0 && o === 0 && z === this.width && V === this.height ? P = "full" : P = [I, B, z, V].join(","), X = Math.min(w, f - s * w), $ = Math.min(T, v - o * T), this.version === 2 && X === this.width ? Z = "full" : this.version === 3 && X === this.width && $ === this.height ? Z = "max" : this.version === 3 ? Z = X + "," + $ : Z = X + ","), U = [this._id, P, Z, h, Y].join("/"), U;
|
|
6674
6674
|
},
|
|
6675
6675
|
__testonly__: {
|
|
6676
6676
|
canBeTiled: t,
|
|
@@ -7531,7 +7531,7 @@ function Ve() {
|
|
|
7531
7531
|
this.containsPoint(f, n) && i.push(f);
|
|
7532
7532
|
for (var v = this._getSegments(), w = t._getSegments(), T = 0; T < v.length; T++)
|
|
7533
7533
|
for (var x = v[T], E = 0; E < w.length; E++) {
|
|
7534
|
-
var P = w[E], I =
|
|
7534
|
+
var P = w[E], I = B(
|
|
7535
7535
|
x[0],
|
|
7536
7536
|
x[1],
|
|
7537
7537
|
P[0],
|
|
@@ -7539,20 +7539,20 @@ function Ve() {
|
|
|
7539
7539
|
);
|
|
7540
7540
|
I && i.push(I);
|
|
7541
7541
|
}
|
|
7542
|
-
function
|
|
7543
|
-
var
|
|
7544
|
-
if (
|
|
7542
|
+
function B(U, O, j, L) {
|
|
7543
|
+
var q = O.minus(U), ee = L.minus(j), ne = -ee.x * q.y + q.x * ee.y;
|
|
7544
|
+
if (ne === 0)
|
|
7545
7545
|
return null;
|
|
7546
|
-
var se = (
|
|
7547
|
-
return -1e-10 <= se && se <= 1 - n && -1e-10 <=
|
|
7546
|
+
var se = (q.x * (U.y - j.y) - q.y * (U.x - j.x)) / ne, oe = (ee.x * (U.y - j.y) - ee.y * (U.x - j.x)) / ne;
|
|
7547
|
+
return -1e-10 <= se && se <= 1 - n && -1e-10 <= oe && oe <= 1 - n ? new e.Point(U.x + oe * q.x, U.y + oe * q.y) : null;
|
|
7548
7548
|
}
|
|
7549
7549
|
if (i.length === 0)
|
|
7550
7550
|
return null;
|
|
7551
|
-
for (var z = i[0].x, V = i[0].x,
|
|
7552
|
-
var
|
|
7553
|
-
|
|
7551
|
+
for (var z = i[0].x, V = i[0].x, Z = i[0].y, X = i[0].y, $ = 1; $ < i.length; $++) {
|
|
7552
|
+
var Y = i[$];
|
|
7553
|
+
Y.x < z && (z = Y.x), Y.x > V && (V = Y.x), Y.y < Z && (Z = Y.y), Y.y > X && (X = Y.y);
|
|
7554
7554
|
}
|
|
7555
|
-
return new e.Rect(z,
|
|
7555
|
+
return new e.Rect(z, Z, V - z, X - Z);
|
|
7556
7556
|
},
|
|
7557
7557
|
// private
|
|
7558
7558
|
_getSegments: function() {
|
|
@@ -7720,13 +7720,13 @@ function Ve() {
|
|
|
7720
7720
|
var w, T, x, E, P, I;
|
|
7721
7721
|
for (d.scroll === "horizontal" ? w = d.panelWidth : w = d.panelHeight, T = Math.ceil(f / w) + 5, x = Math.ceil((Math.abs(v) + f) / w) + 1, T = x - T, T = T < 0 ? 0 : T, P = T; P < x && P < d.panels.length; P++)
|
|
7722
7722
|
if (I = d.panels[P], !I.activePanel) {
|
|
7723
|
-
var
|
|
7724
|
-
z.referenceStripThumbnailUrl ?
|
|
7723
|
+
var B, z = d.viewer.tileSources[P];
|
|
7724
|
+
z.referenceStripThumbnailUrl ? B = {
|
|
7725
7725
|
type: "image",
|
|
7726
7726
|
url: z.referenceStripThumbnailUrl
|
|
7727
|
-
} :
|
|
7727
|
+
} : B = z, E = new e.Viewer({
|
|
7728
7728
|
id: I.id,
|
|
7729
|
-
tileSources: [
|
|
7729
|
+
tileSources: [B],
|
|
7730
7730
|
element: I,
|
|
7731
7731
|
navigatorSizeRatio: d.sizeRatio,
|
|
7732
7732
|
showNavigator: !1,
|
|
@@ -8720,7 +8720,7 @@ function Ve() {
|
|
|
8720
8720
|
*
|
|
8721
8721
|
*/
|
|
8722
8722
|
_drawTiles(l) {
|
|
8723
|
-
var h = l.getTilesToDraw().map((
|
|
8723
|
+
var h = l.getTilesToDraw().map((U) => U.tile);
|
|
8724
8724
|
if (!(l.opacity === 0 || h.length === 0 && !l.placeholderFillStyle)) {
|
|
8725
8725
|
var d = h[0], f;
|
|
8726
8726
|
d && (f = l.opacity < 1 || l.compositeOperation && l.compositeOperation !== "source-over" || !l._isBottomItem() && l.source.hasTransparency(d.context2D, d.getUrl(), d.ajaxHeaders, d.postData));
|
|
@@ -8739,46 +8739,46 @@ function Ve() {
|
|
|
8739
8739
|
this._saveContext(f);
|
|
8740
8740
|
var I = l.imageToViewportRectangle(l._clip, !0);
|
|
8741
8741
|
I = I.rotate(-l.getRotation(!0), l._getRotationPoint(!0));
|
|
8742
|
-
var
|
|
8743
|
-
v && (
|
|
8742
|
+
var B = this.viewportToDrawerRectangle(I);
|
|
8743
|
+
v && (B = B.times(v)), w && (B = B.translate(w)), this._setClip(B, f), P = !0;
|
|
8744
8744
|
}
|
|
8745
8745
|
if (l._croppingPolygons) {
|
|
8746
8746
|
var z = this;
|
|
8747
8747
|
P || this._saveContext(f);
|
|
8748
8748
|
try {
|
|
8749
|
-
var V = l._croppingPolygons.map(function(
|
|
8750
|
-
return
|
|
8751
|
-
var
|
|
8752
|
-
return v && (
|
|
8749
|
+
var V = l._croppingPolygons.map(function(U) {
|
|
8750
|
+
return U.map(function(O) {
|
|
8751
|
+
var j = l.imageToViewportCoordinates(O.x, O.y, !0).rotate(-l.getRotation(!0), l._getRotationPoint(!0)), L = z.viewportCoordToDrawerCoord(j);
|
|
8752
|
+
return v && (L = L.times(v)), w && (L = L.plus(w)), L;
|
|
8753
8753
|
});
|
|
8754
8754
|
});
|
|
8755
8755
|
this._clipWithPolygons(V, f);
|
|
8756
|
-
} catch (
|
|
8757
|
-
e.console.error(
|
|
8756
|
+
} catch (U) {
|
|
8757
|
+
e.console.error(U);
|
|
8758
8758
|
}
|
|
8759
8759
|
P = !0;
|
|
8760
8760
|
}
|
|
8761
8761
|
if (l._hasOpaqueTile = !1, l.placeholderFillStyle && l._hasOpaqueTile === !1) {
|
|
8762
|
-
let
|
|
8763
|
-
v && (
|
|
8764
|
-
let
|
|
8765
|
-
typeof l.placeholderFillStyle == "function" ?
|
|
8762
|
+
let U = this.viewportToDrawerRectangle(l.getBoundsNoRotate(!0));
|
|
8763
|
+
v && (U = U.times(v)), w && (U = U.translate(w));
|
|
8764
|
+
let O = null;
|
|
8765
|
+
typeof l.placeholderFillStyle == "function" ? O = l.placeholderFillStyle(l, this.context) : O = l.placeholderFillStyle, this._drawRectangle(U, O, f);
|
|
8766
8766
|
}
|
|
8767
|
-
var
|
|
8768
|
-
if (
|
|
8769
|
-
|
|
8770
|
-
else if (
|
|
8767
|
+
var Z = s(l.subPixelRoundingForTransparency), X = !1;
|
|
8768
|
+
if (Z === e.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS)
|
|
8769
|
+
X = !0;
|
|
8770
|
+
else if (Z === e.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST) {
|
|
8771
8771
|
var $ = this.viewer && this.viewer.isAnimating();
|
|
8772
|
-
|
|
8772
|
+
X = !$;
|
|
8773
8773
|
}
|
|
8774
|
-
for (var
|
|
8775
|
-
d = h[
|
|
8774
|
+
for (var Y = 0; Y < h.length; Y++)
|
|
8775
|
+
d = h[Y], this._drawTile(
|
|
8776
8776
|
d,
|
|
8777
8777
|
l,
|
|
8778
8778
|
f,
|
|
8779
8779
|
v,
|
|
8780
8780
|
w,
|
|
8781
|
-
|
|
8781
|
+
X,
|
|
8782
8782
|
l.source
|
|
8783
8783
|
), this.viewer && this.viewer.raiseEvent("tile-drawn", {
|
|
8784
8784
|
tiledImage: l,
|
|
@@ -8881,13 +8881,13 @@ function Ve() {
|
|
|
8881
8881
|
E.x,
|
|
8882
8882
|
E.y
|
|
8883
8883
|
)), this._raiseTileDrawingEvent(d, h, l, P);
|
|
8884
|
-
var I,
|
|
8885
|
-
l.sourceBounds ? (I = Math.min(l.sourceBounds.width, P.canvas.width),
|
|
8884
|
+
var I, B;
|
|
8885
|
+
l.sourceBounds ? (I = Math.min(l.sourceBounds.width, P.canvas.width), B = Math.min(l.sourceBounds.height, P.canvas.height)) : (I = P.canvas.width, B = P.canvas.height), h.translate(x.x + E.x / 2, 0), l.flipped && h.scale(-1, 1), h.drawImage(
|
|
8886
8886
|
P.canvas,
|
|
8887
8887
|
0,
|
|
8888
8888
|
0,
|
|
8889
8889
|
I,
|
|
8890
|
-
|
|
8890
|
+
B,
|
|
8891
8891
|
-E.x / 2,
|
|
8892
8892
|
x.y,
|
|
8893
8893
|
E.x,
|
|
@@ -9248,27 +9248,27 @@ function Ve() {
|
|
|
9248
9248
|
return;
|
|
9249
9249
|
let E = x[0], P = w.compositeOperation || this.viewer.compositeOperation || w._clip || w._croppingPolygons || w.debugMode, I = P || w.opacity < 1 || E.hasTransparency;
|
|
9250
9250
|
P && (v && this._outputContext.drawImage(this._renderingCanvas, 0, 0), r.bindFramebuffer(r.FRAMEBUFFER, null), r.clear(r.COLOR_BUFFER_BIT)), r.useProgram(this._firstPass.shaderProgram), I ? (r.bindFramebuffer(r.FRAMEBUFFER, this._glFrameBuffer), r.clear(r.COLOR_BUFFER_BIT)) : r.bindFramebuffer(r.FRAMEBUFFER, null);
|
|
9251
|
-
let
|
|
9251
|
+
let B = f, z = w.getRotation(!0);
|
|
9252
9252
|
if (z % 360 !== 0) {
|
|
9253
|
-
let
|
|
9254
|
-
|
|
9253
|
+
let U = e.Mat3.makeRotation(-z * Math.PI / 180), O = w.getBoundsNoRotate(!0).getCenter(), j = e.Mat3.makeTranslation(O.x, O.y), L = e.Mat3.makeTranslation(-O.x, -O.y), q = j.multiply(U).multiply(L);
|
|
9254
|
+
B = f.multiply(q);
|
|
9255
9255
|
}
|
|
9256
9256
|
let V = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS);
|
|
9257
9257
|
if (V <= 0)
|
|
9258
9258
|
throw new Error(`WegGL error: bad value for gl parameter MAX_TEXTURE_IMAGE_UNITS (${V}). This could happen
|
|
9259
9259
|
if too many contexts have been created and not released, or there is another problem with the graphics card.`);
|
|
9260
|
-
let
|
|
9261
|
-
for (let
|
|
9262
|
-
let
|
|
9263
|
-
if (
|
|
9264
|
-
for (let
|
|
9265
|
-
r.activeTexture(r.TEXTURE0 +
|
|
9266
|
-
r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferTexturePosition), r.bufferData(r.ARRAY_BUFFER,
|
|
9267
|
-
r.uniformMatrix3fv(this._firstPass.uTransformMatrices[se], !1,
|
|
9268
|
-
}), r.uniform1fv(this._firstPass.uOpacities, new Float32Array(
|
|
9260
|
+
let Z = new Float32Array(V * 12), X = new Array(V), $ = new Array(V), Y = new Array(V);
|
|
9261
|
+
for (let U = 0; U < x.length; U++) {
|
|
9262
|
+
let O = x[U].tile, j = U % V, L = j + 1, q = O.getCanvasContext(), ee = q ? this._TextureMap.get(q.canvas) : null;
|
|
9263
|
+
if (ee || (this._tileReadyHandler({ tile: O, tiledImage: w }), ee = q ? this._TextureMap.get(q.canvas) : null), ee && this._getTileData(O, w, ee, B, j, Z, X, $, Y), L === V || U === x.length - 1) {
|
|
9264
|
+
for (let ne = 0; ne <= L; ne++)
|
|
9265
|
+
r.activeTexture(r.TEXTURE0 + ne), r.bindTexture(r.TEXTURE_2D, X[ne]);
|
|
9266
|
+
r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferTexturePosition), r.bufferData(r.ARRAY_BUFFER, Z, r.DYNAMIC_DRAW), $.forEach((ne, se) => {
|
|
9267
|
+
r.uniformMatrix3fv(this._firstPass.uTransformMatrices[se], !1, ne);
|
|
9268
|
+
}), r.uniform1fv(this._firstPass.uOpacities, new Float32Array(Y)), r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferOutputPosition), r.vertexAttribPointer(this._firstPass.aOutputPosition, 2, r.FLOAT, !1, 0, 0), r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferTexturePosition), r.vertexAttribPointer(this._firstPass.aTexturePosition, 2, r.FLOAT, !1, 0, 0), r.bindBuffer(r.ARRAY_BUFFER, this._firstPass.bufferIndex), r.vertexAttribPointer(this._firstPass.aIndex, 1, r.FLOAT, !1, 0, 0), r.drawArrays(r.TRIANGLES, 0, 6 * L);
|
|
9269
9269
|
}
|
|
9270
9270
|
}
|
|
9271
|
-
I && (r.useProgram(this._secondPass.shaderProgram), r.bindFramebuffer(r.FRAMEBUFFER, null), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, this._renderToTexture), this._gl.uniform1f(this._secondPass.uOpacityMultiplier, w.opacity), r.bindBuffer(r.ARRAY_BUFFER, this._secondPass.bufferTexturePosition), r.vertexAttribPointer(this._secondPass.aTexturePosition, 2, r.FLOAT, !1, 0, 0), r.bindBuffer(r.ARRAY_BUFFER, this._secondPass.bufferOutputPosition), r.vertexAttribPointer(this._secondPass.aOutputPosition, 2, r.FLOAT, !1, 0, 0), r.drawArrays(r.TRIANGLES, 0, 6)), v = !0, P && (this._applyContext2dPipeline(w, x, T), v = !1, r.bindFramebuffer(r.FRAMEBUFFER, null), r.clear(r.COLOR_BUFFER_BIT)), T === 0 && this._raiseTiledImageDrawnEvent(w, x.map((
|
|
9271
|
+
I && (r.useProgram(this._secondPass.shaderProgram), r.bindFramebuffer(r.FRAMEBUFFER, null), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, this._renderToTexture), this._gl.uniform1f(this._secondPass.uOpacityMultiplier, w.opacity), r.bindBuffer(r.ARRAY_BUFFER, this._secondPass.bufferTexturePosition), r.vertexAttribPointer(this._secondPass.aTexturePosition, 2, r.FLOAT, !1, 0, 0), r.bindBuffer(r.ARRAY_BUFFER, this._secondPass.bufferOutputPosition), r.vertexAttribPointer(this._secondPass.aOutputPosition, 2, r.FLOAT, !1, 0, 0), r.drawArrays(r.TRIANGLES, 0, 6)), v = !0, P && (this._applyContext2dPipeline(w, x, T), v = !1, r.bindFramebuffer(r.FRAMEBUFFER, null), r.clear(r.COLOR_BUFFER_BIT)), T === 0 && this._raiseTiledImageDrawnEvent(w, x.map((U) => U.tile));
|
|
9272
9272
|
}
|
|
9273
9273
|
}), v && this._outputContext.drawImage(this._renderingCanvas, 0, 0);
|
|
9274
9274
|
}
|
|
@@ -9314,22 +9314,22 @@ function Ve() {
|
|
|
9314
9314
|
_getTileData(i, r, a, s, o, l, h, d, f) {
|
|
9315
9315
|
let v = a.texture, w = a.position;
|
|
9316
9316
|
l.set(w, o * 12);
|
|
9317
|
-
let T = this._calculateOverlapFraction(i, r), x = i.positionedBounds.width * T.x, E = i.positionedBounds.height * T.y, P = i.positionedBounds.x + (i.x === 0 ? 0 : x), I = i.positionedBounds.y + (i.y === 0 ? 0 : E),
|
|
9317
|
+
let T = this._calculateOverlapFraction(i, r), x = i.positionedBounds.width * T.x, E = i.positionedBounds.height * T.y, P = i.positionedBounds.x + (i.x === 0 ? 0 : x), I = i.positionedBounds.y + (i.y === 0 ? 0 : E), B = i.positionedBounds.x + i.positionedBounds.width - (i.isRightMost ? 0 : x), z = i.positionedBounds.y + i.positionedBounds.height - (i.isBottomMost ? 0 : E), V = B - P, Z = z - I, X = new e.Mat3([
|
|
9318
9318
|
V,
|
|
9319
9319
|
0,
|
|
9320
9320
|
0,
|
|
9321
9321
|
0,
|
|
9322
|
-
|
|
9322
|
+
Z,
|
|
9323
9323
|
0,
|
|
9324
9324
|
P,
|
|
9325
9325
|
I,
|
|
9326
9326
|
1
|
|
9327
9327
|
]);
|
|
9328
9328
|
if (i.flipped) {
|
|
9329
|
-
let
|
|
9330
|
-
|
|
9329
|
+
let Y = e.Mat3.makeTranslation(0.5, 0), U = e.Mat3.makeTranslation(-0.5, 0), O = Y.multiply(e.Mat3.makeScaling(-1, 1)).multiply(U);
|
|
9330
|
+
X = X.multiply(O);
|
|
9331
9331
|
}
|
|
9332
|
-
let $ = s.multiply(
|
|
9332
|
+
let $ = s.multiply(X);
|
|
9333
9333
|
f[o] = i.opacity, h[o] = v, d[o] = $.values;
|
|
9334
9334
|
}
|
|
9335
9335
|
// private
|
|
@@ -9507,8 +9507,8 @@ function Ve() {
|
|
|
9507
9507
|
if (!this._TextureMap.get(o)) {
|
|
9508
9508
|
let h = this._gl, d = h.createTexture(), f, v = a.source.tileOverlap, w, T;
|
|
9509
9509
|
if (r.sourceBounds ? (w = Math.min(r.sourceBounds.width, o.width) / o.width, T = Math.min(r.sourceBounds.height, o.height) / o.height) : (w = 1, T = 1), v > 0) {
|
|
9510
|
-
let E = this._calculateOverlapFraction(r, a), P = (r.x === 0 ? 0 : E.x) * w, I = (r.y === 0 ? 0 : E.y) * T,
|
|
9511
|
-
f = this._makeQuadVertexBuffer(P,
|
|
9510
|
+
let E = this._calculateOverlapFraction(r, a), P = (r.x === 0 ? 0 : E.x) * w, I = (r.y === 0 ? 0 : E.y) * T, B = (r.isRightMost ? 1 : 1 - E.x) * w, z = (r.isBottomMost ? 1 : 1 - E.y) * T;
|
|
9511
|
+
f = this._makeQuadVertexBuffer(P, B, I, z);
|
|
9512
9512
|
} else w === 1 && T === 1 ? f = this._unitQuad : f = this._makeQuadVertexBuffer(0, w, 0, T);
|
|
9513
9513
|
let x = {
|
|
9514
9514
|
texture: d,
|
|
@@ -11648,28 +11648,28 @@ function Ve() {
|
|
|
11648
11648
|
// returns boolean flag of whether the image should be marked as fully loaded
|
|
11649
11649
|
_updateLevelsForViewport: function() {
|
|
11650
11650
|
var t = this._getLevelsInterval(), n = t.lowestLevel, i = t.highestLevel, r = [], a = this.getDrawArea(), s = e.now();
|
|
11651
|
-
if (this._lastDrawn.forEach((
|
|
11652
|
-
|
|
11651
|
+
if (this._lastDrawn.forEach((B) => {
|
|
11652
|
+
B.tile.beingDrawn = !1;
|
|
11653
11653
|
}), this._tilesToDraw = [], this._tilesLoading = 0, this.loadingCoverage = {}, !a)
|
|
11654
11654
|
return this._needsDraw = !1, this._fullyLoaded;
|
|
11655
11655
|
var o = new Array(i - n + 1);
|
|
11656
|
-
for (let
|
|
11657
|
-
o[
|
|
11658
|
-
for (let
|
|
11659
|
-
var l = this.tilesMatrix[
|
|
11656
|
+
for (let B = 0, z = i; z >= n; z--, B++)
|
|
11657
|
+
o[B] = z;
|
|
11658
|
+
for (let B = i + 1; B <= this.source.maxLevel; B++) {
|
|
11659
|
+
var l = this.tilesMatrix[B] && this.tilesMatrix[B][0] && this.tilesMatrix[B][0][0];
|
|
11660
11660
|
if (l && l.isBottomMost && l.isRightMost && l.loaded) {
|
|
11661
|
-
o.push(
|
|
11661
|
+
o.push(B);
|
|
11662
11662
|
break;
|
|
11663
11663
|
}
|
|
11664
11664
|
}
|
|
11665
11665
|
let h = !1;
|
|
11666
|
-
for (let
|
|
11667
|
-
let z = o[
|
|
11666
|
+
for (let B = 0; B < o.length; B++) {
|
|
11667
|
+
let z = o[B];
|
|
11668
11668
|
var d = this.viewport.deltaPixelsFromPointsNoRotate(
|
|
11669
11669
|
this.source.getPixelRatio(z),
|
|
11670
11670
|
!0
|
|
11671
11671
|
).x * this._scaleSpring.current.value;
|
|
11672
|
-
if (
|
|
11672
|
+
if (B === o.length - 1 || d >= this.minPixelRatio)
|
|
11673
11673
|
h = !0;
|
|
11674
11674
|
else if (!h)
|
|
11675
11675
|
continue;
|
|
@@ -11695,21 +11695,21 @@ function Ve() {
|
|
|
11695
11695
|
r
|
|
11696
11696
|
);
|
|
11697
11697
|
r = E.bestTiles;
|
|
11698
|
-
var P = E.updatedTiles.filter((V) => V.loaded), I = /* @__PURE__ */ function(V,
|
|
11698
|
+
var P = E.updatedTiles.filter((V) => V.loaded), I = /* @__PURE__ */ function(V, Z, X) {
|
|
11699
11699
|
return function($) {
|
|
11700
11700
|
return {
|
|
11701
11701
|
tile: $,
|
|
11702
11702
|
level: V,
|
|
11703
|
-
levelOpacity:
|
|
11704
|
-
currentTime:
|
|
11703
|
+
levelOpacity: Z,
|
|
11704
|
+
currentTime: X
|
|
11705
11705
|
};
|
|
11706
11706
|
};
|
|
11707
11707
|
}(z, T, s);
|
|
11708
11708
|
if (this._tilesToDraw[z] = P.map(I), this._providesCoverage(this.coverage, z))
|
|
11709
11709
|
break;
|
|
11710
11710
|
}
|
|
11711
|
-
return r && r.length > 0 ? (r.forEach(function(
|
|
11712
|
-
|
|
11711
|
+
return r && r.length > 0 ? (r.forEach(function(B) {
|
|
11712
|
+
B && !B.context2D && this._loadTile(B, s);
|
|
11713
11713
|
}, this), this._needsDraw = !0, !1) : this._tilesLoading === 0;
|
|
11714
11714
|
},
|
|
11715
11715
|
/**
|
|
@@ -11797,15 +11797,15 @@ function Ve() {
|
|
|
11797
11797
|
this.getFlip() && (f.x += 1, this.wrapHorizontal || (f.x = Math.min(f.x, v.x - 1)));
|
|
11798
11798
|
for (var T = Math.max(0, (f.x - d.x) * (f.y - d.y)), x = new Array(T), E = 0, P = d.x; P <= f.x; P++)
|
|
11799
11799
|
for (var I = d.y; I <= f.y; I++) {
|
|
11800
|
-
var
|
|
11800
|
+
var B;
|
|
11801
11801
|
if (this.getFlip()) {
|
|
11802
11802
|
var z = (v.x + P % v.x) % v.x;
|
|
11803
|
-
|
|
11803
|
+
B = P + v.x - z - z - 1;
|
|
11804
11804
|
} else
|
|
11805
|
-
|
|
11806
|
-
if (r.intersection(this.getTileBounds(t,
|
|
11805
|
+
B = P;
|
|
11806
|
+
if (r.intersection(this.getTileBounds(t, B, I)) !== null) {
|
|
11807
11807
|
var V = this._updateTile(
|
|
11808
|
-
|
|
11808
|
+
B,
|
|
11809
11809
|
I,
|
|
11810
11810
|
t,
|
|
11811
11811
|
i,
|
|
@@ -12438,7 +12438,7 @@ function Ve() {
|
|
|
12438
12438
|
}
|
|
12439
12439
|
);
|
|
12440
12440
|
}(C);
|
|
12441
|
-
}(
|
|
12441
|
+
}(xe)), xe.exports;
|
|
12442
12442
|
}
|
|
12443
12443
|
var je = Ve();
|
|
12444
12444
|
const Ze = /* @__PURE__ */ Oe(je), qe = (W, C = [255, 255, 255, 255], e = [0, 0, 0, 255]) => {
|
|
@@ -12490,13 +12490,14 @@ const Ze = /* @__PURE__ */ Oe(je), qe = (W, C = [255, 255, 255, 255], e = [0, 0,
|
|
|
12490
12490
|
});
|
|
12491
12491
|
});
|
|
12492
12492
|
}, Fe = (W) => {
|
|
12493
|
-
|
|
12493
|
+
var r;
|
|
12494
|
+
const C = (r = W.element) == null ? void 0 : r.querySelector(".openseadragon-canvas");
|
|
12494
12495
|
if (!C) throw "[a9s-sam] Error creating overlay canvas";
|
|
12495
12496
|
const e = W.drawer.canvas, t = document.createElement("canvas");
|
|
12496
12497
|
t.width = e.width, t.height = e.height;
|
|
12497
12498
|
const n = t.getContext("2d");
|
|
12498
12499
|
if (!n) throw "[a9s-sam] Error creating preview drawing context";
|
|
12499
|
-
return new ResizeObserver((
|
|
12500
|
+
return new ResizeObserver((a) => {
|
|
12500
12501
|
try {
|
|
12501
12502
|
t.width = e.width, t.height = e.height;
|
|
12502
12503
|
} catch {
|
|
@@ -12579,51 +12580,53 @@ const Ze = /* @__PURE__ */ Oe(je), qe = (W, C = [255, 255, 255, 255], e = [0, 0,
|
|
|
12579
12580
|
}), rt = (W, C = {}) => {
|
|
12580
12581
|
const { viewer: e } = W;
|
|
12581
12582
|
let t = !1, n = "add";
|
|
12582
|
-
const i = We(), r = et()
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
const
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
r.
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12583
|
+
const i = We(), r = et();
|
|
12584
|
+
let a, s;
|
|
12585
|
+
const o = (O) => {
|
|
12586
|
+
const { isSAMReady: j, sam: L } = r;
|
|
12587
|
+
if (!L || !j) return;
|
|
12588
|
+
const q = e.drawer.canvas, ee = q.width / (L.currentScale * q.offsetWidth), ne = q.height / (L.currentScale * q.offsetHeight), se = O.x * ee + L.currentBounds.x, oe = O.y * ne + L.currentBounds.y;
|
|
12589
|
+
return { x: se, y: oe };
|
|
12590
|
+
}, l = (O) => {
|
|
12591
|
+
var q;
|
|
12592
|
+
if (!r.isSAMReady || !r.isOSDReady || !!((q = r.sam) != null && q.currentPrompt)) return;
|
|
12593
|
+
const L = { x: O.offsetX, y: O.offsetY };
|
|
12594
|
+
r.lastPointerPos = L, r.isAnimationInProgress || w(L);
|
|
12595
|
+
}, h = (O) => {
|
|
12596
|
+
var se, oe, le, he;
|
|
12597
|
+
const j = { x: O.offsetX, y: O.offsetY }, L = o(j);
|
|
12598
|
+
if (!L) return;
|
|
12599
|
+
O.shiftKey || n === "remove" ? r.sam.currentPrompt = {
|
|
12600
|
+
include: ((se = r.sam.currentPrompt) == null ? void 0 : se.include) || [],
|
|
12601
|
+
exclude: [...((oe = r.sam.currentPrompt) == null ? void 0 : oe.exclude) || [], L]
|
|
12599
12602
|
} : r.sam.currentPrompt = {
|
|
12600
|
-
include: [...((
|
|
12601
|
-
exclude: ((
|
|
12603
|
+
include: [...((le = r.sam.currentPrompt) == null ? void 0 : le.include) || [], L],
|
|
12604
|
+
exclude: ((he = r.sam.currentPrompt) == null ? void 0 : he.exclude) || []
|
|
12602
12605
|
};
|
|
12603
|
-
const { currentPrompt:
|
|
12604
|
-
s.setPrompt(
|
|
12605
|
-
}, d = (
|
|
12606
|
-
|
|
12607
|
-
}, f = (
|
|
12608
|
-
e.isMouseNavEnabled() || h(
|
|
12606
|
+
const { currentPrompt: q, currentBounds: ee, currentScale: ne } = r.sam;
|
|
12607
|
+
s.setPrompt(q, ee, ne), Y.postMessage({ type: "decode", prompt: r.sam.currentPrompt });
|
|
12608
|
+
}, d = (O) => {
|
|
12609
|
+
O.quick && (!r.sam || !r.isSAMReady || !r.isOSDReady || r.isAnimationInProgress || (e.setMouseNavEnabled(!1), h(O.originalEvent)));
|
|
12610
|
+
}, f = (O) => {
|
|
12611
|
+
e.isMouseNavEnabled() || h(O);
|
|
12609
12612
|
}, v = () => {
|
|
12610
12613
|
if (!r.sam) return;
|
|
12611
12614
|
r.viewportVersion += 1, i.emit("encodingStart");
|
|
12612
|
-
const
|
|
12613
|
-
|
|
12614
|
-
}, w = (
|
|
12615
|
+
const O = Ne(r.sam.currentCanvas);
|
|
12616
|
+
Y.postMessage({ type: "encode", data: O, viewportVersion: r.viewportVersion });
|
|
12617
|
+
}, w = (O) => {
|
|
12615
12618
|
if (r.lastEncodingVersion !== r.viewportVersion) return;
|
|
12616
|
-
const
|
|
12617
|
-
|
|
12619
|
+
const j = o(O);
|
|
12620
|
+
j && Y.postMessage({ type: "decode_preview", point: j });
|
|
12618
12621
|
}, T = () => {
|
|
12619
|
-
const { canvas:
|
|
12622
|
+
const { canvas: O, bounds: j, scale: L } = Ke(e.drawer.canvas);
|
|
12620
12623
|
r.sam = {
|
|
12621
12624
|
// The current 1024 x 1024 SAM working canvas
|
|
12622
|
-
currentCanvas:
|
|
12625
|
+
currentCanvas: O,
|
|
12623
12626
|
// The bbox of the resized & padded viewport on the working canvas
|
|
12624
|
-
currentBounds:
|
|
12627
|
+
currentBounds: j,
|
|
12625
12628
|
// The current SAM scale (longer image dimension / 1024)
|
|
12626
|
-
currentScale:
|
|
12629
|
+
currentScale: L,
|
|
12627
12630
|
// New annotation ID for the current shape
|
|
12628
12631
|
currentAnnotationId: be()
|
|
12629
12632
|
};
|
|
@@ -12639,56 +12642,59 @@ const Ze = /* @__PURE__ */ Oe(je), qe = (W, C = [255, 255, 255, 255], e = [0, 0,
|
|
|
12639
12642
|
});
|
|
12640
12643
|
const I = () => {
|
|
12641
12644
|
e.element.addEventListener("pointermove", l), e.element.addEventListener("pointerdown", f), e.addHandler("canvas-click", d);
|
|
12642
|
-
},
|
|
12643
|
-
var
|
|
12644
|
-
(
|
|
12645
|
-
}, z = (
|
|
12646
|
-
t = !1, e == null || e.setMouseNavEnabled(!0), a.hide(), s.hide(),
|
|
12647
|
-
},
|
|
12645
|
+
}, B = () => {
|
|
12646
|
+
var O, j;
|
|
12647
|
+
(O = e.element) == null || O.removeEventListener("pointermove", l), (j = e.element) == null || j.removeEventListener("pointerdown", f), e == null || e.removeHandler("canvas-click", d);
|
|
12648
|
+
}, z = (O) => n = O, V = () => {
|
|
12649
|
+
t = !1, e == null || e.setMouseNavEnabled(!0), a.hide(), s.hide(), B();
|
|
12650
|
+
}, Z = () => {
|
|
12648
12651
|
V(), P();
|
|
12649
|
-
},
|
|
12652
|
+
}, X = () => {
|
|
12650
12653
|
if (r.sam) {
|
|
12651
|
-
const
|
|
12652
|
-
|
|
12654
|
+
const O = W.state.store.getAnnotation(r.sam.currentAnnotationId);
|
|
12655
|
+
O && (W.removeAnnotation(r.sam.currentAnnotationId), i.emit("deleteAnnotation", O));
|
|
12653
12656
|
}
|
|
12654
|
-
|
|
12657
|
+
Z();
|
|
12655
12658
|
};
|
|
12656
12659
|
e.addHandler("animation-start", x), e.addHandler("animation-finish", E);
|
|
12657
12660
|
const $ = () => {
|
|
12658
|
-
a.destroy(), s.destroy(),
|
|
12659
|
-
},
|
|
12660
|
-
return
|
|
12661
|
-
const { type:
|
|
12662
|
-
if (
|
|
12661
|
+
a.destroy(), s.destroy(), B(), e == null || e.removeHandler("animation-start", x), e == null || e.removeHandler("animation-finish", E);
|
|
12662
|
+
}, Y = new ke();
|
|
12663
|
+
return Y.onmessage = (O) => {
|
|
12664
|
+
const { type: j } = O.data;
|
|
12665
|
+
if (j === "init_success")
|
|
12663
12666
|
r.isSAMReady = !0, i.emit("initialized"), t && v();
|
|
12664
|
-
else if (
|
|
12665
|
-
const { viewportVersion:
|
|
12666
|
-
r.lastEncodingVersion =
|
|
12667
|
-
} else if (
|
|
12667
|
+
else if (j === "encode_success") {
|
|
12668
|
+
const { viewportVersion: L } = O.data;
|
|
12669
|
+
r.lastEncodingVersion = L, L < r.viewportVersion ? console.log("[a9s-sam] Stale encoding - discarding") : (i.emit("encodingFinished"), r.lastPointerPos && w(r.lastPointerPos));
|
|
12670
|
+
} else if (j === "decode_preview_success") {
|
|
12668
12671
|
if (r.sam && !r.isAnimationInProgress) {
|
|
12669
|
-
const { result:
|
|
12670
|
-
|
|
12672
|
+
const { result: L, viewportVersion: q } = O.data;
|
|
12673
|
+
q === r.viewportVersion ? a.render(L, r.sam.currentBounds) : console.log("[a9s-sam] Stale preview - discarding");
|
|
12671
12674
|
}
|
|
12672
|
-
} else if (
|
|
12675
|
+
} else if (j === "decode_success") {
|
|
12673
12676
|
if (a.clear(), r.sam) {
|
|
12674
|
-
const
|
|
12675
|
-
|
|
12676
|
-
}
|
|
12677
|
-
} else if (
|
|
12678
|
-
const { error:
|
|
12679
|
-
i.emit("initError",
|
|
12680
|
-
} else if (
|
|
12681
|
-
const { viewportVersion:
|
|
12682
|
-
|
|
12677
|
+
const L = Xe(O.data.result, r.sam, W.getUser(), e), { store: q } = W.state, ee = q.getAnnotation(r.sam.currentAnnotationId);
|
|
12678
|
+
ee ? (q.updateAnnotation(r.sam.currentAnnotationId, L), i.emit("updateAnnotation", L, ee, r.sam.currentPrompt)) : (q.addAnnotation(L), i.emit("createAnnotation", L, r.sam.currentPrompt));
|
|
12679
|
+
}
|
|
12680
|
+
} else if (j === "init_error") {
|
|
12681
|
+
const { error: L } = O.data;
|
|
12682
|
+
i.emit("initError", L);
|
|
12683
|
+
} else if (j === "encode_error") {
|
|
12684
|
+
const { viewportVersion: L } = O.data;
|
|
12685
|
+
L === r.viewportVersion && setTimeout(() => v(), 100);
|
|
12683
12686
|
}
|
|
12684
|
-
},
|
|
12687
|
+
}, {
|
|
12685
12688
|
destroy: $,
|
|
12686
|
-
|
|
12687
|
-
|
|
12689
|
+
init: () => {
|
|
12690
|
+
a = Qe(e, C), s = $e(e), Y.postMessage({ type: "init" });
|
|
12691
|
+
},
|
|
12692
|
+
reset: X,
|
|
12693
|
+
restart: Z,
|
|
12688
12694
|
setQueryMode: z,
|
|
12689
12695
|
start: P,
|
|
12690
12696
|
stop: V,
|
|
12691
|
-
on: (
|
|
12697
|
+
on: (O, j) => i.on(O, j)
|
|
12692
12698
|
};
|
|
12693
12699
|
};
|
|
12694
12700
|
export {
|