@annotorious/openseadragon 3.0.12 → 3.0.13
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.
|
@@ -2160,7 +2160,7 @@ class Yi extends fe {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
}
|
|
2162
2162
|
function Vm(r) {
|
|
2163
|
-
let t, e, i, s, n, o, a, l, h, c, u, d, f, p, m, _, y, x, g, v, w, I, A, C, N, S, R, E, b, D, F, G, $, M,
|
|
2163
|
+
let t, e, i, s, n, o, a, l, h, c, u, d, f, p, m, _, y, x, g, v, w, I, A, C, N, S, R, E, b, D, F, G, $, M, K, P, U, j, et, Q, H, X, lt;
|
|
2164
2164
|
return M = new Yi({
|
|
2165
2165
|
props: {
|
|
2166
2166
|
class: "a9s-corner-handle-topleft",
|
|
@@ -2251,7 +2251,7 @@ function Vm(r) {
|
|
|
2251
2251
|
) && r[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
2252
2252
|
}), {
|
|
2253
2253
|
c() {
|
|
2254
|
-
t = yt("rect"), a = _e(), l = yt("rect"), f = _e(), p = yt("rect"), x = _e(), g = yt("rect"), A = _e(), C = yt("rect"), E = _e(), b = yt("rect"), $ = _e(), he(M.$$.fragment),
|
|
2254
|
+
t = yt("rect"), a = _e(), l = yt("rect"), f = _e(), p = yt("rect"), x = _e(), g = yt("rect"), A = _e(), C = yt("rect"), E = _e(), b = yt("rect"), $ = _e(), he(M.$$.fragment), K = _e(), he(P.$$.fragment), U = _e(), he(j.$$.fragment), et = _e(), he(Q.$$.fragment), T(t, "class", "a9s-outer"), T(t, "style", e = /*computedStyle*/
|
|
2255
2255
|
r[1] ? "display:none;" : void 0), T(t, "x", i = /*geom*/
|
|
2256
2256
|
r[4].x), T(t, "y", s = /*geom*/
|
|
2257
2257
|
r[4].y), T(t, "width", n = /*geom*/
|
|
@@ -2282,7 +2282,7 @@ function Vm(r) {
|
|
|
2282
2282
|
r[4].h), T(b, "width", 1);
|
|
2283
2283
|
},
|
|
2284
2284
|
m(L, O) {
|
|
2285
|
-
it(L, t, O), it(L, a, O), it(L, l, O), it(L, f, O), it(L, p, O), it(L, x, O), it(L, g, O), it(L, A, O), it(L, C, O), it(L, E, O), it(L, b, O), it(L, $, O), ie(M, L, O), it(L,
|
|
2285
|
+
it(L, t, O), it(L, a, O), it(L, l, O), it(L, f, O), it(L, p, O), it(L, x, O), it(L, g, O), it(L, A, O), it(L, C, O), it(L, E, O), it(L, b, O), it(L, $, O), ie(M, L, O), it(L, K, O), ie(P, L, O), it(L, U, O), ie(j, L, O), it(L, et, O), ie(Q, L, O), H = !0, X || (lt = [
|
|
2286
2286
|
Dt(t, "pointerdown", function() {
|
|
2287
2287
|
Nt(
|
|
2288
2288
|
/*grab*/
|
|
@@ -2417,7 +2417,7 @@ function Vm(r) {
|
|
|
2417
2417
|
mt(M.$$.fragment, L), mt(P.$$.fragment, L), mt(j.$$.fragment, L), mt(Q.$$.fragment, L), H = !1;
|
|
2418
2418
|
},
|
|
2419
2419
|
d(L) {
|
|
2420
|
-
L && (rt(t), rt(a), rt(l), rt(f), rt(p), rt(x), rt(g), rt(A), rt(C), rt(E), rt(b), rt($), rt(
|
|
2420
|
+
L && (rt(t), rt(a), rt(l), rt(f), rt(p), rt(x), rt(g), rt(A), rt(C), rt(E), rt(b), rt($), rt(K), rt(U), rt(et)), se(M, L), se(P, L), se(j, L), se(Q, L), X = !1, ze(lt);
|
|
2421
2421
|
}
|
|
2422
2422
|
};
|
|
2423
2423
|
}
|
|
@@ -4181,7 +4181,7 @@ function Rg(r, t, e) {
|
|
|
4181
4181
|
const { updated: O } = L.changes;
|
|
4182
4182
|
e(7, $ = O == null ? void 0 : O.map((_t) => _t.newValue));
|
|
4183
4183
|
}, F.observe(G, { annotations: lt })) : e(7, $ = void 0);
|
|
4184
|
-
},
|
|
4184
|
+
}, K = (X) => {
|
|
4185
4185
|
const lt = Iu(), L = {
|
|
4186
4186
|
id: lt,
|
|
4187
4187
|
bodies: [],
|
|
@@ -4248,7 +4248,7 @@ function Rg(r, t, e) {
|
|
|
4248
4248
|
b,
|
|
4249
4249
|
D,
|
|
4250
4250
|
F,
|
|
4251
|
-
|
|
4251
|
+
K,
|
|
4252
4252
|
P,
|
|
4253
4253
|
U,
|
|
4254
4254
|
j,
|
|
@@ -5692,7 +5692,7 @@ bn.exports;
|
|
|
5692
5692
|
return _.test(U) ? G(U.slice(4).toLowerCase()) : U;
|
|
5693
5693
|
});
|
|
5694
5694
|
}
|
|
5695
|
-
function
|
|
5695
|
+
function K(P) {
|
|
5696
5696
|
return S(P, function(U) {
|
|
5697
5697
|
return y.test(U) ? "xn--" + $(U) : U;
|
|
5698
5698
|
});
|
|
@@ -5717,7 +5717,7 @@ bn.exports;
|
|
|
5717
5717
|
},
|
|
5718
5718
|
decode: G,
|
|
5719
5719
|
encode: $,
|
|
5720
|
-
toASCII:
|
|
5720
|
+
toASCII: K,
|
|
5721
5721
|
toUnicode: M
|
|
5722
5722
|
}, i && s)
|
|
5723
5723
|
if (r.exports == i)
|
|
@@ -6753,8 +6753,8 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
|
|
|
6753
6753
|
if (!(a && G === null)) {
|
|
6754
6754
|
var $ = d && l ? F.replace(/\./g, "%2E") : F, M = Le(g) ? typeof i == "function" ? i(b, $) : b : b + (d ? "." + $ : "[" + $ + "]");
|
|
6755
6755
|
x.set(t, w);
|
|
6756
|
-
var
|
|
6757
|
-
|
|
6756
|
+
var K = vd();
|
|
6757
|
+
K.set(Mo, x), bd(N, r(
|
|
6758
6758
|
G,
|
|
6759
6759
|
M,
|
|
6760
6760
|
i,
|
|
@@ -6772,7 +6772,7 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
|
|
|
6772
6772
|
m,
|
|
6773
6773
|
_,
|
|
6774
6774
|
y,
|
|
6775
|
-
|
|
6775
|
+
K
|
|
6776
6776
|
));
|
|
6777
6777
|
}
|
|
6778
6778
|
}
|
|
@@ -24012,7 +24012,7 @@ function Hb(r, t) {
|
|
|
24012
24012
|
);
|
|
24013
24013
|
for (let $ = 1; $ < u - 1; ++$) {
|
|
24014
24014
|
y = i[($ - 1) * 2], x = i[($ - 1) * 2 + 1], g = i[$ * 2], v = i[$ * 2 + 1], w = i[($ + 1) * 2], I = i[($ + 1) * 2 + 1], A = -(x - v), C = y - g, R = Math.sqrt(A * A + C * C), A /= R, C /= R, A *= p, C *= p, N = -(v - I), S = g - w, R = Math.sqrt(N * N + S * S), N /= R, S /= R, N *= p, S *= p;
|
|
24015
|
-
const M = g - y,
|
|
24015
|
+
const M = g - y, K = x - v, P = g - w, U = I - v, j = M * P + K * U, et = K * P - U * M, Q = et < 0;
|
|
24016
24016
|
if (Math.abs(et) < 1e-3 * Math.abs(j)) {
|
|
24017
24017
|
c.push(
|
|
24018
24018
|
g - A * b,
|
|
@@ -24036,7 +24036,7 @@ function Hb(r, t) {
|
|
|
24036
24036
|
));
|
|
24037
24037
|
continue;
|
|
24038
24038
|
}
|
|
24039
|
-
const H = (-A + y) * (-C + v) - (-A + g) * (-C + x), X = (-N + w) * (-S + v) - (-N + g) * (-S + I), lt = (M * X - P * H) / et, L = (U * H -
|
|
24039
|
+
const H = (-A + y) * (-C + v) - (-A + g) * (-C + x), X = (-N + w) * (-S + v) - (-N + g) * (-S + I), lt = (M * X - P * H) / et, L = (U * H - K * X) / et, O = (lt - g) * (lt - g) + (L - v) * (L - v), _t = g + (lt - g) * b, ht = v + (L - v) * b, vt = g - (lt - g) * D, xt = v - (L - v) * D, Ce = Math.min(M * M + K * K, P * P + U * U), Re = Q ? b : D, $i = Ce + Re * Re * m, Yf = O <= $i;
|
|
24040
24040
|
let Ss = n.join;
|
|
24041
24041
|
if (Ss === le.MITER && O / m > _ && (Ss = le.BEVEL), Yf)
|
|
24042
24042
|
switch (Ss) {
|
|
@@ -25802,7 +25802,7 @@ var to = /* @__PURE__ */ ((r) => (r[r.LINEAR_VERTICAL = 0] = "LINEAR_VERTICAL",
|
|
|
25802
25802
|
const Js = {
|
|
25803
25803
|
// TextMetrics requires getImageData readback for measuring fonts.
|
|
25804
25804
|
willReadFrequently: !0
|
|
25805
|
-
}, Oe = class
|
|
25805
|
+
}, Oe = class Z {
|
|
25806
25806
|
/**
|
|
25807
25807
|
* Checking that we can use modern canvas 2D API.
|
|
25808
25808
|
*
|
|
@@ -25812,10 +25812,10 @@ const Js = {
|
|
|
25812
25812
|
* @see https://developer.chrome.com/origintrials/#/view_trial/3585991203293757441
|
|
25813
25813
|
*/
|
|
25814
25814
|
static get experimentalLetterSpacingSupported() {
|
|
25815
|
-
let t =
|
|
25815
|
+
let t = Z._experimentalLetterSpacingSupported;
|
|
25816
25816
|
if (t !== void 0) {
|
|
25817
25817
|
const e = W.ADAPTER.getCanvasRenderingContext2D().prototype;
|
|
25818
|
-
t =
|
|
25818
|
+
t = Z._experimentalLetterSpacingSupported = "letterSpacing" in e || "textLetterSpacing" in e;
|
|
25819
25819
|
}
|
|
25820
25820
|
return t;
|
|
25821
25821
|
}
|
|
@@ -25841,23 +25841,23 @@ const Js = {
|
|
|
25841
25841
|
* @param canvas - optional specification of the canvas to use for measuring.
|
|
25842
25842
|
* @returns Measured width and height of the text.
|
|
25843
25843
|
*/
|
|
25844
|
-
static measureText(t, e, i, s =
|
|
25844
|
+
static measureText(t, e, i, s = Z._canvas) {
|
|
25845
25845
|
i = i ?? e.wordWrap;
|
|
25846
|
-
const n = e.toFontString(), o =
|
|
25846
|
+
const n = e.toFontString(), o = Z.measureFont(n);
|
|
25847
25847
|
o.fontSize === 0 && (o.fontSize = e.fontSize, o.ascent = e.fontSize);
|
|
25848
25848
|
const a = s.getContext("2d", Js);
|
|
25849
25849
|
a.font = n;
|
|
25850
|
-
const l = (i ?
|
|
25850
|
+
const l = (i ? Z.wordWrap(t, e, s) : t).split(/(?:\r\n|\r|\n)/), h = new Array(l.length);
|
|
25851
25851
|
let c = 0;
|
|
25852
25852
|
for (let p = 0; p < l.length; p++) {
|
|
25853
|
-
const m =
|
|
25853
|
+
const m = Z._measureText(l[p], e.letterSpacing, a);
|
|
25854
25854
|
h[p] = m, c = Math.max(c, m);
|
|
25855
25855
|
}
|
|
25856
25856
|
let u = c + e.strokeThickness;
|
|
25857
25857
|
e.dropShadow && (u += e.dropShadowDistance);
|
|
25858
25858
|
const d = e.lineHeight || o.fontSize + e.strokeThickness;
|
|
25859
25859
|
let f = Math.max(d, o.fontSize + e.strokeThickness * 2) + e.leading + (l.length - 1) * (d + e.leading);
|
|
25860
|
-
return e.dropShadow && (f += e.dropShadowDistance), new
|
|
25860
|
+
return e.dropShadow && (f += e.dropShadowDistance), new Z(
|
|
25861
25861
|
t,
|
|
25862
25862
|
e,
|
|
25863
25863
|
u,
|
|
@@ -25871,9 +25871,9 @@ const Js = {
|
|
|
25871
25871
|
}
|
|
25872
25872
|
static _measureText(t, e, i) {
|
|
25873
25873
|
let s = !1;
|
|
25874
|
-
|
|
25874
|
+
Z.experimentalLetterSpacingSupported && (Z.experimentalLetterSpacing ? (i.letterSpacing = `${e}px`, i.textLetterSpacing = `${e}px`, s = !0) : (i.letterSpacing = "0px", i.textLetterSpacing = "0px"));
|
|
25875
25875
|
let n = i.measureText(t).width;
|
|
25876
|
-
return n > 0 && (s ? n -= e : n += (
|
|
25876
|
+
return n > 0 && (s ? n -= e : n += (Z.graphemeSegmenter(t).length - 1) * e), n;
|
|
25877
25877
|
}
|
|
25878
25878
|
/**
|
|
25879
25879
|
* Applies newlines to a string to have it optimally fit into the horizontal
|
|
@@ -25883,53 +25883,53 @@ const Js = {
|
|
|
25883
25883
|
* @param canvas - optional specification of the canvas to use for measuring.
|
|
25884
25884
|
* @returns New string with new lines applied where required
|
|
25885
25885
|
*/
|
|
25886
|
-
static wordWrap(t, e, i =
|
|
25886
|
+
static wordWrap(t, e, i = Z._canvas) {
|
|
25887
25887
|
const s = i.getContext("2d", Js);
|
|
25888
25888
|
let n = 0, o = "", a = "";
|
|
25889
|
-
const l = /* @__PURE__ */ Object.create(null), { letterSpacing: h, whiteSpace: c } = e, u =
|
|
25889
|
+
const l = /* @__PURE__ */ Object.create(null), { letterSpacing: h, whiteSpace: c } = e, u = Z.collapseSpaces(c), d = Z.collapseNewlines(c);
|
|
25890
25890
|
let f = !u;
|
|
25891
|
-
const p = e.wordWrapWidth + h, m =
|
|
25891
|
+
const p = e.wordWrapWidth + h, m = Z.tokenize(t);
|
|
25892
25892
|
for (let _ = 0; _ < m.length; _++) {
|
|
25893
25893
|
let y = m[_];
|
|
25894
|
-
if (
|
|
25894
|
+
if (Z.isNewline(y)) {
|
|
25895
25895
|
if (!d) {
|
|
25896
|
-
a +=
|
|
25896
|
+
a += Z.addLine(o), f = !u, o = "", n = 0;
|
|
25897
25897
|
continue;
|
|
25898
25898
|
}
|
|
25899
25899
|
y = " ";
|
|
25900
25900
|
}
|
|
25901
25901
|
if (u) {
|
|
25902
|
-
const g =
|
|
25902
|
+
const g = Z.isBreakingSpace(y), v = Z.isBreakingSpace(o[o.length - 1]);
|
|
25903
25903
|
if (g && v)
|
|
25904
25904
|
continue;
|
|
25905
25905
|
}
|
|
25906
|
-
const x =
|
|
25906
|
+
const x = Z.getFromCache(y, h, l, s);
|
|
25907
25907
|
if (x > p)
|
|
25908
|
-
if (o !== "" && (a +=
|
|
25909
|
-
const g =
|
|
25908
|
+
if (o !== "" && (a += Z.addLine(o), o = "", n = 0), Z.canBreakWords(y, e.breakWords)) {
|
|
25909
|
+
const g = Z.wordWrapSplit(y);
|
|
25910
25910
|
for (let v = 0; v < g.length; v++) {
|
|
25911
25911
|
let w = g[v], I = w, A = 1;
|
|
25912
25912
|
for (; g[v + A]; ) {
|
|
25913
25913
|
const N = g[v + A];
|
|
25914
|
-
if (!
|
|
25914
|
+
if (!Z.canBreakChars(I, N, y, v, e.breakWords))
|
|
25915
25915
|
w += N;
|
|
25916
25916
|
else
|
|
25917
25917
|
break;
|
|
25918
25918
|
I = N, A++;
|
|
25919
25919
|
}
|
|
25920
25920
|
v += A - 1;
|
|
25921
|
-
const C =
|
|
25922
|
-
C + n > p && (a +=
|
|
25921
|
+
const C = Z.getFromCache(w, h, l, s);
|
|
25922
|
+
C + n > p && (a += Z.addLine(o), f = !1, o = "", n = 0), o += w, n += C;
|
|
25923
25923
|
}
|
|
25924
25924
|
} else {
|
|
25925
|
-
o.length > 0 && (a +=
|
|
25925
|
+
o.length > 0 && (a += Z.addLine(o), o = "", n = 0);
|
|
25926
25926
|
const g = _ === m.length - 1;
|
|
25927
|
-
a +=
|
|
25927
|
+
a += Z.addLine(y, !g), f = !1, o = "", n = 0;
|
|
25928
25928
|
}
|
|
25929
25929
|
else
|
|
25930
|
-
x + n > p && (f = !1, a +=
|
|
25930
|
+
x + n > p && (f = !1, a += Z.addLine(o), o = "", n = 0), (o.length > 0 || !Z.isBreakingSpace(y) || f) && (o += y, n += x);
|
|
25931
25931
|
}
|
|
25932
|
-
return a +=
|
|
25932
|
+
return a += Z.addLine(o, !1), a;
|
|
25933
25933
|
}
|
|
25934
25934
|
/**
|
|
25935
25935
|
* Convienience function for logging each line added during the wordWrap method.
|
|
@@ -25938,7 +25938,7 @@ const Js = {
|
|
|
25938
25938
|
* @returns A formatted line
|
|
25939
25939
|
*/
|
|
25940
25940
|
static addLine(t, e = !0) {
|
|
25941
|
-
return t =
|
|
25941
|
+
return t = Z.trimRight(t), t = e ? `${t}
|
|
25942
25942
|
` : t, t;
|
|
25943
25943
|
}
|
|
25944
25944
|
/**
|
|
@@ -25951,7 +25951,7 @@ const Js = {
|
|
|
25951
25951
|
*/
|
|
25952
25952
|
static getFromCache(t, e, i, s) {
|
|
25953
25953
|
let n = i[t];
|
|
25954
|
-
return typeof n != "number" && (n =
|
|
25954
|
+
return typeof n != "number" && (n = Z._measureText(t, e, s) + e, i[t] = n), n;
|
|
25955
25955
|
}
|
|
25956
25956
|
/**
|
|
25957
25957
|
* Determines whether we should collapse breaking spaces.
|
|
@@ -25979,7 +25979,7 @@ const Js = {
|
|
|
25979
25979
|
return "";
|
|
25980
25980
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
25981
25981
|
const i = t[e];
|
|
25982
|
-
if (!
|
|
25982
|
+
if (!Z.isBreakingSpace(i))
|
|
25983
25983
|
break;
|
|
25984
25984
|
t = t.slice(0, -1);
|
|
25985
25985
|
}
|
|
@@ -25991,7 +25991,7 @@ const Js = {
|
|
|
25991
25991
|
* @returns True if newline, False otherwise.
|
|
25992
25992
|
*/
|
|
25993
25993
|
static isNewline(t) {
|
|
25994
|
-
return typeof t != "string" ? !1 :
|
|
25994
|
+
return typeof t != "string" ? !1 : Z._newlines.includes(t.charCodeAt(0));
|
|
25995
25995
|
}
|
|
25996
25996
|
/**
|
|
25997
25997
|
* Determines if char is a breaking whitespace.
|
|
@@ -26004,7 +26004,7 @@ const Js = {
|
|
|
26004
26004
|
* @returns True if whitespace, False otherwise.
|
|
26005
26005
|
*/
|
|
26006
26006
|
static isBreakingSpace(t, e) {
|
|
26007
|
-
return typeof t != "string" ? !1 :
|
|
26007
|
+
return typeof t != "string" ? !1 : Z._breakingSpaces.includes(t.charCodeAt(0));
|
|
26008
26008
|
}
|
|
26009
26009
|
/**
|
|
26010
26010
|
* Splits a string into words, breaking-spaces and newLine characters
|
|
@@ -26018,7 +26018,7 @@ const Js = {
|
|
|
26018
26018
|
return e;
|
|
26019
26019
|
for (let s = 0; s < t.length; s++) {
|
|
26020
26020
|
const n = t[s], o = t[s + 1];
|
|
26021
|
-
if (
|
|
26021
|
+
if (Z.isBreakingSpace(n, o) || Z.isNewline(n)) {
|
|
26022
26022
|
i !== "" && (e.push(i), i = ""), e.push(n);
|
|
26023
26023
|
continue;
|
|
26024
26024
|
}
|
|
@@ -26067,7 +26067,7 @@ const Js = {
|
|
|
26067
26067
|
* @see TextMetrics.graphemeSegmenter
|
|
26068
26068
|
*/
|
|
26069
26069
|
static wordWrapSplit(t) {
|
|
26070
|
-
return
|
|
26070
|
+
return Z.graphemeSegmenter(t);
|
|
26071
26071
|
}
|
|
26072
26072
|
/**
|
|
26073
26073
|
* Calculates the ascent, descent and fontSize of a given font-style
|
|
@@ -26075,19 +26075,19 @@ const Js = {
|
|
|
26075
26075
|
* @returns Font properties object
|
|
26076
26076
|
*/
|
|
26077
26077
|
static measureFont(t) {
|
|
26078
|
-
if (
|
|
26079
|
-
return
|
|
26078
|
+
if (Z._fonts[t])
|
|
26079
|
+
return Z._fonts[t];
|
|
26080
26080
|
const e = {
|
|
26081
26081
|
ascent: 0,
|
|
26082
26082
|
descent: 0,
|
|
26083
26083
|
fontSize: 0
|
|
26084
|
-
}, i =
|
|
26084
|
+
}, i = Z._canvas, s = Z._context;
|
|
26085
26085
|
s.font = t;
|
|
26086
|
-
const n =
|
|
26087
|
-
let a = Math.ceil(s.measureText(
|
|
26088
|
-
const l = Math.ceil(
|
|
26089
|
-
if (a = a *
|
|
26090
|
-
return
|
|
26086
|
+
const n = Z.METRICS_STRING + Z.BASELINE_SYMBOL, o = Math.ceil(s.measureText(n).width);
|
|
26087
|
+
let a = Math.ceil(s.measureText(Z.BASELINE_SYMBOL).width);
|
|
26088
|
+
const l = Math.ceil(Z.HEIGHT_MULTIPLIER * a);
|
|
26089
|
+
if (a = a * Z.BASELINE_MULTIPLIER | 0, o === 0 || l === 0)
|
|
26090
|
+
return Z._fonts[t] = e, e;
|
|
26091
26091
|
i.width = o, i.height = l, s.fillStyle = "#f00", s.fillRect(0, 0, o, l), s.font = t, s.textBaseline = "alphabetic", s.fillStyle = "#000", s.fillText(n, 0, a);
|
|
26092
26092
|
const h = s.getImageData(0, 0, o, l).data, c = h.length, u = o * 4;
|
|
26093
26093
|
let d = 0, f = 0, p = !1;
|
|
@@ -26113,14 +26113,14 @@ const Js = {
|
|
|
26113
26113
|
else
|
|
26114
26114
|
break;
|
|
26115
26115
|
}
|
|
26116
|
-
return e.descent = d - a, e.fontSize = e.ascent + e.descent,
|
|
26116
|
+
return e.descent = d - a, e.fontSize = e.ascent + e.descent, Z._fonts[t] = e, e;
|
|
26117
26117
|
}
|
|
26118
26118
|
/**
|
|
26119
26119
|
* Clear font metrics in metrics cache.
|
|
26120
26120
|
* @param {string} [font] - font name. If font name not set then clear cache for all fonts.
|
|
26121
26121
|
*/
|
|
26122
26122
|
static clearMetrics(t = "") {
|
|
26123
|
-
t ? delete
|
|
26123
|
+
t ? delete Z._fonts[t] : Z._fonts = {};
|
|
26124
26124
|
}
|
|
26125
26125
|
/**
|
|
26126
26126
|
* Cached canvas element for measuring text
|
|
@@ -26129,26 +26129,26 @@ const Js = {
|
|
|
26129
26129
|
*/
|
|
26130
26130
|
static get _canvas() {
|
|
26131
26131
|
var t;
|
|
26132
|
-
if (!
|
|
26132
|
+
if (!Z.__canvas) {
|
|
26133
26133
|
let e;
|
|
26134
26134
|
try {
|
|
26135
26135
|
const i = new OffscreenCanvas(0, 0);
|
|
26136
26136
|
if ((t = i.getContext("2d", Js)) != null && t.measureText)
|
|
26137
|
-
return
|
|
26137
|
+
return Z.__canvas = i, i;
|
|
26138
26138
|
e = W.ADAPTER.createCanvas();
|
|
26139
26139
|
} catch {
|
|
26140
26140
|
e = W.ADAPTER.createCanvas();
|
|
26141
26141
|
}
|
|
26142
|
-
e.width = e.height = 10,
|
|
26142
|
+
e.width = e.height = 10, Z.__canvas = e;
|
|
26143
26143
|
}
|
|
26144
|
-
return
|
|
26144
|
+
return Z.__canvas;
|
|
26145
26145
|
}
|
|
26146
26146
|
/**
|
|
26147
26147
|
* TODO: this should be private, but isn't because of backward compat, will fix later.
|
|
26148
26148
|
* @ignore
|
|
26149
26149
|
*/
|
|
26150
26150
|
static get _context() {
|
|
26151
|
-
return
|
|
26151
|
+
return Z.__context || (Z.__context = Z._canvas.getContext("2d", Js)), Z.__context;
|
|
26152
26152
|
}
|
|
26153
26153
|
};
|
|
26154
26154
|
Oe.METRICS_STRING = "|ÉqÅ", /** Baseline symbol for calculate font metrics. */
|
|
@@ -28101,13 +28101,13 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
|
|
|
28101
28101
|
let F = u.pop();
|
|
28102
28102
|
if (!F) {
|
|
28103
28103
|
const $ = new Wb();
|
|
28104
|
-
let M,
|
|
28105
|
-
t.distanceFieldType === "none" ? (M = new jc(Y.EMPTY),
|
|
28104
|
+
let M, K;
|
|
28105
|
+
t.distanceFieldType === "none" ? (M = new jc(Y.EMPTY), K = tt.NORMAL) : (M = new jc(
|
|
28106
28106
|
Y.EMPTY,
|
|
28107
28107
|
{ program: er.from(bw, xw), uniforms: { uFWidth: 0 } }
|
|
28108
|
-
),
|
|
28108
|
+
), K = tt.NORMAL_NPM);
|
|
28109
28109
|
const P = new Wc($, M);
|
|
28110
|
-
P.blendMode =
|
|
28110
|
+
P.blendMode = K, F = {
|
|
28111
28111
|
index: 0,
|
|
28112
28112
|
indexCount: 0,
|
|
28113
28113
|
vertexCount: 0,
|
|
@@ -28145,17 +28145,17 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
|
|
|
28145
28145
|
const b = n[E];
|
|
28146
28146
|
let D = b.position.x + I[b.line] * (this._align === "justify" ? b.prevSpaces : 1);
|
|
28147
28147
|
this._roundPixels && (D = Math.round(D));
|
|
28148
|
-
const F = D * i, G = b.position.y * i, $ = b.texture, M = C[$.baseTexture.uid],
|
|
28149
|
-
M.indices[U * 6 + 0] = 0 + U * 4, M.indices[U * 6 + 1] = 1 + U * 4, M.indices[U * 6 + 2] = 2 + U * 4, M.indices[U * 6 + 3] = 0 + U * 4, M.indices[U * 6 + 4] = 2 + U * 4, M.indices[U * 6 + 5] = 3 + U * 4, M.vertices[U * 8 + 0] = F, M.vertices[U * 8 + 1] = G, M.vertices[U * 8 + 2] = F +
|
|
28148
|
+
const F = D * i, G = b.position.y * i, $ = b.texture, M = C[$.baseTexture.uid], K = $.frame, P = $._uvs, U = M.index++;
|
|
28149
|
+
M.indices[U * 6 + 0] = 0 + U * 4, M.indices[U * 6 + 1] = 1 + U * 4, M.indices[U * 6 + 2] = 2 + U * 4, M.indices[U * 6 + 3] = 0 + U * 4, M.indices[U * 6 + 4] = 2 + U * 4, M.indices[U * 6 + 5] = 3 + U * 4, M.vertices[U * 8 + 0] = F, M.vertices[U * 8 + 1] = G, M.vertices[U * 8 + 2] = F + K.width * i, M.vertices[U * 8 + 3] = G, M.vertices[U * 8 + 4] = F + K.width * i, M.vertices[U * 8 + 5] = G + K.height * i, M.vertices[U * 8 + 6] = F, M.vertices[U * 8 + 7] = G + K.height * i, M.uvs[U * 8 + 0] = P.x0, M.uvs[U * 8 + 1] = P.y0, M.uvs[U * 8 + 2] = P.x1, M.uvs[U * 8 + 3] = P.y1, M.uvs[U * 8 + 4] = P.x2, M.uvs[U * 8 + 5] = P.y2, M.uvs[U * 8 + 6] = P.x3, M.uvs[U * 8 + 7] = P.y3;
|
|
28150
28150
|
}
|
|
28151
28151
|
this._textWidth = p * i, this._textHeight = (s.y + t.lineHeight) * i;
|
|
28152
28152
|
for (const E in C) {
|
|
28153
28153
|
const b = C[E];
|
|
28154
28154
|
if (this.anchor.x !== 0 || this.anchor.y !== 0) {
|
|
28155
28155
|
let $ = 0;
|
|
28156
|
-
const M = this._textWidth * this.anchor.x,
|
|
28156
|
+
const M = this._textWidth * this.anchor.x, K = this._textHeight * this.anchor.y;
|
|
28157
28157
|
for (let P = 0; P < b.total; P++)
|
|
28158
|
-
b.vertices[$++] -= M, b.vertices[$++] -=
|
|
28158
|
+
b.vertices[$++] -= M, b.vertices[$++] -= K, b.vertices[$++] -= M, b.vertices[$++] -= K, b.vertices[$++] -= M, b.vertices[$++] -= K, b.vertices[$++] -= M, b.vertices[$++] -= K;
|
|
28159
28159
|
}
|
|
28160
28160
|
this._maxLineHeight = g * i;
|
|
28161
28161
|
const D = b.mesh.geometry.getBuffer("aVertexPosition"), F = b.mesh.geometry.getBuffer("aTextureCoord"), G = b.mesh.geometry.getIndex();
|
|
@@ -29008,13 +29008,13 @@ function Dw(r, t, e) {
|
|
|
29008
29008
|
const R = () => {
|
|
29009
29009
|
const G = l.viewport.getBounds();
|
|
29010
29010
|
w = l.viewport.viewportToImageRectangle(G);
|
|
29011
|
-
const { x: $, y: M, width:
|
|
29011
|
+
const { x: $, y: M, width: K, height: P } = w, U = c.getIntersecting($, M, K, P);
|
|
29012
29012
|
f.set(U.map((j) => j.id));
|
|
29013
29013
|
};
|
|
29014
29014
|
l.addHandler("canvas-press", x), l.addHandler("canvas-release", v), l.addHandler("update-viewport", m.redraw), l.addHandler("animation-finish", R);
|
|
29015
29015
|
const E = (G) => G.filter(($) => ir($)), b = (G) => ir(G.oldValue) && ir(G.newValue), D = (G) => {
|
|
29016
|
-
const { created: $, updated: M, deleted:
|
|
29017
|
-
if (E($ || []).forEach((P) => m.addAnnotation(P)), E(
|
|
29016
|
+
const { created: $, updated: M, deleted: K } = G.changes;
|
|
29017
|
+
if (E($ || []).forEach((P) => m.addAnnotation(P)), E(K || []).forEach((P) => m.removeAnnotation(P)), (M || []).filter((P) => b(P)).forEach(({ oldValue: P, newValue: U }) => m.updateAnnotation(P, U)), w) {
|
|
29018
29018
|
const { x: P, y: U, width: j, height: et } = w, Q = c.getIntersecting(P, U, j, et);
|
|
29019
29019
|
f.set(Q.map((H) => H.id));
|
|
29020
29020
|
} else
|
|
@@ -29615,7 +29615,7 @@ class ss extends ae {
|
|
|
29615
29615
|
}
|
|
29616
29616
|
}
|
|
29617
29617
|
function Qw(r) {
|
|
29618
|
-
let t, e, i, s, n, o, a, l, h, c, u, d, f, p, m, _, y, x, g, v, w, I, A, C, N, S, R, E, b, D, F, G, $, M,
|
|
29618
|
+
let t, e, i, s, n, o, a, l, h, c, u, d, f, p, m, _, y, x, g, v, w, I, A, C, N, S, R, E, b, D, F, G, $, M, K, P, U, j, et, Q, H, X, lt;
|
|
29619
29619
|
return M = new ss({
|
|
29620
29620
|
props: {
|
|
29621
29621
|
class: "a9s-corner-handle-topleft",
|
|
@@ -29706,7 +29706,7 @@ function Qw(r) {
|
|
|
29706
29706
|
) && r[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
29707
29707
|
}), {
|
|
29708
29708
|
c() {
|
|
29709
|
-
t = Et("rect"), a = ve(), l = Et("rect"), f = ve(), p = Et("rect"), x = ve(), g = Et("rect"), A = ve(), C = Et("rect"), E = ve(), b = Et("rect"), $ = ve(), Jt(M.$$.fragment),
|
|
29709
|
+
t = Et("rect"), a = ve(), l = Et("rect"), f = ve(), p = Et("rect"), x = ve(), g = Et("rect"), A = ve(), C = Et("rect"), E = ve(), b = Et("rect"), $ = ve(), Jt(M.$$.fragment), K = ve(), Jt(P.$$.fragment), U = ve(), Jt(j.$$.fragment), et = ve(), Jt(Q.$$.fragment), B(t, "class", "a9s-outer"), B(t, "style", e = /*computedStyle*/
|
|
29710
29710
|
r[1] ? "display:none;" : void 0), B(t, "x", i = /*geom*/
|
|
29711
29711
|
r[4].x), B(t, "y", s = /*geom*/
|
|
29712
29712
|
r[4].y), B(t, "width", n = /*geom*/
|
|
@@ -29737,7 +29737,7 @@ function Qw(r) {
|
|
|
29737
29737
|
r[4].h), B(b, "width", 1);
|
|
29738
29738
|
},
|
|
29739
29739
|
m(L, O) {
|
|
29740
|
-
pt(L, t, O), pt(L, a, O), pt(L, l, O), pt(L, f, O), pt(L, p, O), pt(L, x, O), pt(L, g, O), pt(L, A, O), pt(L, C, O), pt(L, E, O), pt(L, b, O), pt(L, $, O), Yt(M, L, O), pt(L,
|
|
29740
|
+
pt(L, t, O), pt(L, a, O), pt(L, l, O), pt(L, f, O), pt(L, p, O), pt(L, x, O), pt(L, g, O), pt(L, A, O), pt(L, C, O), pt(L, E, O), pt(L, b, O), pt(L, $, O), Yt(M, L, O), pt(L, K, O), Yt(P, L, O), pt(L, U, O), Yt(j, L, O), pt(L, et, O), Yt(Q, L, O), H = !0, X || (lt = [
|
|
29741
29741
|
zt(t, "pointerdown", function() {
|
|
29742
29742
|
jt(
|
|
29743
29743
|
/*grab*/
|
|
@@ -29872,7 +29872,7 @@ function Qw(r) {
|
|
|
29872
29872
|
dt(M.$$.fragment, L), dt(P.$$.fragment, L), dt(j.$$.fragment, L), dt(Q.$$.fragment, L), H = !1;
|
|
29873
29873
|
},
|
|
29874
29874
|
d(L) {
|
|
29875
|
-
L && (ct(t), ct(a), ct(l), ct(f), ct(p), ct(x), ct(g), ct(A), ct(C), ct(E), ct(b), ct($), ct(
|
|
29875
|
+
L && (ct(t), ct(a), ct(l), ct(f), ct(p), ct(x), ct(g), ct(A), ct(C), ct(E), ct(b), ct($), ct(K), ct(U), ct(et)), qt(M, L), qt(P, L), qt(j, L), qt(Q, L), X = !1, hr(lt);
|
|
29876
29876
|
}
|
|
29877
29877
|
};
|
|
29878
29878
|
}
|
|
@@ -30733,19 +30733,19 @@ function _E(r, t, e) {
|
|
|
30733
30733
|
let I, A, C;
|
|
30734
30734
|
const N = (M) => {
|
|
30735
30735
|
g.unobserve(I);
|
|
30736
|
-
const
|
|
30737
|
-
if (
|
|
30738
|
-
if (e(6, A =
|
|
30736
|
+
const K = M.filter(({ editable: P }) => P).map(({ id: P }) => P);
|
|
30737
|
+
if (K.length > 0) {
|
|
30738
|
+
if (e(6, A = K.map((P) => g.getAnnotation(P))), I = (P) => {
|
|
30739
30739
|
const { updated: U } = P.changes;
|
|
30740
30740
|
e(6, A = (U || []).map((j) => j.newValue));
|
|
30741
|
-
}, g.observe(I, { annotations:
|
|
30741
|
+
}, g.observe(I, { annotations: K }), y) {
|
|
30742
30742
|
const { width: P } = p.viewport.viewerElementToViewportRectangle(new _i.Rect(0, 0, 1, 1));
|
|
30743
30743
|
p.viewport.panBy(new _i.Point(Math.abs(P / 10), 0));
|
|
30744
30744
|
}
|
|
30745
30745
|
} else
|
|
30746
30746
|
e(6, A = void 0);
|
|
30747
|
-
}, S = (M,
|
|
30748
|
-
const { x: P, y: U } = p.viewport.viewerElementToImageCoordinates(new _i.Point(M,
|
|
30747
|
+
}, S = (M, K) => {
|
|
30748
|
+
const { x: P, y: U } = p.viewport.viewerElementToImageCoordinates(new _i.Point(M, K));
|
|
30749
30749
|
return [P, U];
|
|
30750
30750
|
}, R = (M) => {
|
|
30751
30751
|
p.setMouseNavEnabled(!1), C = M.timeStamp;
|
|
@@ -30754,22 +30754,22 @@ function _E(r, t, e) {
|
|
|
30754
30754
|
const { offsetX: P, offsetY: U } = M.detail, [j, et] = S(P, U), Q = g.getAt(j, et);
|
|
30755
30755
|
Q && (!l || l(Q)) && !A.find((X) => X.id === Q.id) && (w.set(Q.id), v.setSelected(Q.id));
|
|
30756
30756
|
}
|
|
30757
|
-
}, b = (M) => (
|
|
30757
|
+
}, b = (M) => (K) => {
|
|
30758
30758
|
var et;
|
|
30759
30759
|
const { target: P } = M, U = 10 * 60 * 1e3, j = ((et = P.creator) == null ? void 0 : et.id) !== f.id || !P.created || (/* @__PURE__ */ new Date()).getTime() - P.created.getTime() > U;
|
|
30760
30760
|
g.updateTarget({
|
|
30761
30761
|
...P,
|
|
30762
|
-
selector:
|
|
30762
|
+
selector: K.detail,
|
|
30763
30763
|
created: j ? P.created : /* @__PURE__ */ new Date(),
|
|
30764
30764
|
updated: j ? /* @__PURE__ */ new Date() : void 0,
|
|
30765
30765
|
updatedBy: j ? f : void 0
|
|
30766
30766
|
});
|
|
30767
30767
|
}, D = (M) => {
|
|
30768
|
-
const
|
|
30769
|
-
id:
|
|
30768
|
+
const K = kw(), P = {
|
|
30769
|
+
id: K,
|
|
30770
30770
|
bodies: [],
|
|
30771
30771
|
target: {
|
|
30772
|
-
annotation:
|
|
30772
|
+
annotation: K,
|
|
30773
30773
|
selector: M.detail,
|
|
30774
30774
|
creator: f,
|
|
30775
30775
|
created: /* @__PURE__ */ new Date()
|
|
@@ -31484,19 +31484,19 @@ const _u = (r, t) => {
|
|
|
31484
31484
|
}
|
|
31485
31485
|
});
|
|
31486
31486
|
f.$on("click", (M) => {
|
|
31487
|
-
const { originalEvent:
|
|
31488
|
-
P && !(u === "click" && c) ? n.userSelect(P.id,
|
|
31487
|
+
const { originalEvent: K, annotation: P } = M.detail;
|
|
31488
|
+
e.modalSelect ? n.isEmpty() && P && n.userSelect(P.id, K) : P && !(u === "click" && c) ? n.userSelect(P.id, K) : n.isEmpty() || n.clear();
|
|
31489
31489
|
}), r.element.addEventListener("pointerdown", (M) => {
|
|
31490
31490
|
if (s.current) {
|
|
31491
|
-
const
|
|
31492
|
-
l.emit("clickAnnotation",
|
|
31491
|
+
const K = o.getAnnotation(s.current);
|
|
31492
|
+
l.emit("clickAnnotation", K, M);
|
|
31493
31493
|
}
|
|
31494
31494
|
}), _u(r, e.theme);
|
|
31495
31495
|
const _ = fp(i, a, e.adapter), y = () => {
|
|
31496
31496
|
m.$set({ drawingEnabled: !1 }), setTimeout(() => m.$set({ drawingEnabled: !0 }), 1);
|
|
31497
31497
|
}, x = () => {
|
|
31498
31498
|
f.$destroy(), p.$destroy(), m.$destroy(), d.destroy(), a.destroy();
|
|
31499
|
-
}, g = FE(r, o), v = LE(r, o), w = () => m.getDrawingTool(), I = () => h, A = () => m.isDrawingEnabled(), C = (M,
|
|
31499
|
+
}, g = FE(r, o), v = LE(r, o), w = () => m.getDrawingTool(), I = () => h, A = () => m.isDrawingEnabled(), C = (M, K, P) => Lu(M, K, P), N = (M, K) => Ou(M, K), S = (M) => {
|
|
31500
31500
|
if (!Hn(M))
|
|
31501
31501
|
throw `No drawing tool named ${M}`;
|
|
31502
31502
|
m.$set({ toolName: M });
|