open-plant 1.4.19 → 1.4.21
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.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +913 -989
- package/dist/index.js.map +1 -1
- package/dist/types/core/gl-utils.d.ts +3 -1
- package/dist/types/core/gl-utils.d.ts.map +1 -1
- package/dist/types/core/m1-tile-renderer.d.ts +1 -0
- package/dist/types/core/m1-tile-renderer.d.ts.map +1 -1
- package/dist/types/react/wsi-viewer.d.ts +2 -1
- package/dist/types/react/wsi-viewer.d.ts.map +1 -1
- package/dist/types/wsi/wsi-renderer-types.d.ts +1 -0
- package/dist/types/wsi/wsi-renderer-types.d.ts.map +1 -1
- package/dist/types/wsi/wsi-tile-renderer.d.ts +2 -0
- package/dist/types/wsi/wsi-tile-renderer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var eo = Object.defineProperty;
|
|
|
2
2
|
var no = (e, t, n) => t in e ? eo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var S = (e, t, n) => no(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as Qt, jsxs as ci } from "react/jsx-runtime";
|
|
5
|
-
import { useRef as q, useMemo as at, useCallback as V, useEffect as
|
|
5
|
+
import { useRef as q, useMemo as at, useCallback as V, useEffect as z, useContext as ro, createContext as io, useState as ae, forwardRef as oo, useImperativeHandle as so } from "react";
|
|
6
6
|
function Zn(e, t, n) {
|
|
7
7
|
const r = e.createShader(t);
|
|
8
8
|
if (!r)
|
|
@@ -23,24 +23,24 @@ function Se(e, t, n) {
|
|
|
23
23
|
}
|
|
24
24
|
return o;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Lt(e, t, n) {
|
|
27
27
|
const r = e.getUniformLocation(t, n);
|
|
28
28
|
if (!r)
|
|
29
29
|
throw new Error(`Failed to get uniform location: ${n}`);
|
|
30
30
|
return r;
|
|
31
31
|
}
|
|
32
|
-
function ao(e) {
|
|
33
|
-
const
|
|
32
|
+
function ao(e, t) {
|
|
33
|
+
const n = e.getContext("webgl2", {
|
|
34
34
|
alpha: !1,
|
|
35
35
|
antialias: !1,
|
|
36
36
|
depth: !1,
|
|
37
37
|
stencil: !1,
|
|
38
|
-
preserveDrawingBuffer: !1,
|
|
38
|
+
preserveDrawingBuffer: t?.preserveDrawingBuffer ?? !1,
|
|
39
39
|
powerPreference: "high-performance"
|
|
40
40
|
});
|
|
41
|
-
if (!
|
|
41
|
+
if (!n)
|
|
42
42
|
throw new Error("WebGL2 is not available.");
|
|
43
|
-
return
|
|
43
|
+
return n;
|
|
44
44
|
}
|
|
45
45
|
function un(e) {
|
|
46
46
|
return e * Math.PI / 180;
|
|
@@ -165,61 +165,18 @@ class uo {
|
|
|
165
165
|
S(this, "destroyed", !1);
|
|
166
166
|
S(this, "fitted", !1);
|
|
167
167
|
S(this, "controlledViewState", !1);
|
|
168
|
-
this.canvas = t.canvas, this.imageWidth = Math.max(1, t.imageWidth), this.imageHeight = Math.max(1, t.imageHeight), this.clearColor = t.clearColor ?? [0.03, 0.05, 0.08, 1], this.gl = ao(this.canvas), this.program = Se(this.gl, lo, co);
|
|
168
|
+
this.canvas = t.canvas, this.imageWidth = Math.max(1, t.imageWidth), this.imageHeight = Math.max(1, t.imageHeight), this.clearColor = t.clearColor ?? [0.03, 0.05, 0.08, 1], this.gl = ao(this.canvas, { preserveDrawingBuffer: t.preserveDrawingBuffer }), this.program = Se(this.gl, lo, co);
|
|
169
169
|
const n = this.gl.createVertexArray(), r = this.gl.createBuffer();
|
|
170
170
|
if (!n || !r)
|
|
171
171
|
throw new Error("Failed to create WebGL buffers.");
|
|
172
172
|
this.vao = n, this.quadBuffer = r, this.gl.bindVertexArray(this.vao), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.quadBuffer);
|
|
173
|
-
const i = new Float32Array([
|
|
174
|
-
0,
|
|
175
|
-
0,
|
|
176
|
-
0,
|
|
177
|
-
0,
|
|
178
|
-
1,
|
|
179
|
-
0,
|
|
180
|
-
1,
|
|
181
|
-
0,
|
|
182
|
-
0,
|
|
183
|
-
1,
|
|
184
|
-
0,
|
|
185
|
-
1,
|
|
186
|
-
1,
|
|
187
|
-
1,
|
|
188
|
-
1,
|
|
189
|
-
1
|
|
190
|
-
]);
|
|
173
|
+
const i = new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1]);
|
|
191
174
|
this.gl.bufferData(this.gl.ARRAY_BUFFER, i, this.gl.STATIC_DRAW);
|
|
192
175
|
const o = this.gl.getAttribLocation(this.program, "aUnit"), s = this.gl.getAttribLocation(this.program, "aUv");
|
|
193
176
|
if (o < 0 || s < 0)
|
|
194
177
|
throw new Error("Failed to get attribute locations.");
|
|
195
178
|
const a = 4 * Float32Array.BYTES_PER_ELEMENT;
|
|
196
|
-
this.gl.enableVertexAttribArray(o), this.gl.vertexAttribPointer(
|
|
197
|
-
o,
|
|
198
|
-
2,
|
|
199
|
-
this.gl.FLOAT,
|
|
200
|
-
!1,
|
|
201
|
-
a,
|
|
202
|
-
0
|
|
203
|
-
), this.gl.enableVertexAttribArray(s), this.gl.vertexAttribPointer(
|
|
204
|
-
s,
|
|
205
|
-
2,
|
|
206
|
-
this.gl.FLOAT,
|
|
207
|
-
!1,
|
|
208
|
-
a,
|
|
209
|
-
2 * Float32Array.BYTES_PER_ELEMENT
|
|
210
|
-
), this.gl.bindVertexArray(null), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, null), this.uCameraLocation = Dt(
|
|
211
|
-
this.gl,
|
|
212
|
-
this.program,
|
|
213
|
-
"uCamera"
|
|
214
|
-
), this.uBoundsLocation = Dt(
|
|
215
|
-
this.gl,
|
|
216
|
-
this.program,
|
|
217
|
-
"uBounds"
|
|
218
|
-
), this.uTextureLocation = Dt(
|
|
219
|
-
this.gl,
|
|
220
|
-
this.program,
|
|
221
|
-
"uTexture"
|
|
222
|
-
), t.initialViewState && (this.controlledViewState = !0, this.camera.setViewState(t.initialViewState)), this.resizeObserver = new ResizeObserver(() => {
|
|
179
|
+
this.gl.enableVertexAttribArray(o), this.gl.vertexAttribPointer(o, 2, this.gl.FLOAT, !1, a, 0), this.gl.enableVertexAttribArray(s), this.gl.vertexAttribPointer(s, 2, this.gl.FLOAT, !1, a, 2 * Float32Array.BYTES_PER_ELEMENT), this.gl.bindVertexArray(null), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, null), this.uCameraLocation = Lt(this.gl, this.program, "uCamera"), this.uBoundsLocation = Lt(this.gl, this.program, "uBounds"), this.uTextureLocation = Lt(this.gl, this.program, "uTexture"), t.initialViewState && (this.controlledViewState = !0, this.camera.setViewState(t.initialViewState)), this.resizeObserver = new ResizeObserver(() => {
|
|
223
180
|
this.resize();
|
|
224
181
|
}), this.resizeObserver.observe(this.canvas), this.resize();
|
|
225
182
|
}
|
|
@@ -249,39 +206,14 @@ class uo {
|
|
|
249
206
|
try {
|
|
250
207
|
const r = await fetch(t.url);
|
|
251
208
|
if (!r.ok)
|
|
252
|
-
throw new Error(
|
|
253
|
-
`Tile fetch failed: ${r.status} ${r.statusText}`
|
|
254
|
-
);
|
|
209
|
+
throw new Error(`Tile fetch failed: ${r.status} ${r.statusText}`);
|
|
255
210
|
const i = await r.blob(), o = await createImageBitmap(i);
|
|
256
211
|
if (this.destroyed || n !== this.loadVersion)
|
|
257
212
|
return o.close(), null;
|
|
258
213
|
const s = this.gl.createTexture();
|
|
259
214
|
if (!s)
|
|
260
215
|
throw o.close(), new Error("Failed to create tile texture.");
|
|
261
|
-
return this.gl.bindTexture(this.gl.TEXTURE_2D, s), this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, 1), this.gl.texParameteri(
|
|
262
|
-
this.gl.TEXTURE_2D,
|
|
263
|
-
this.gl.TEXTURE_WRAP_S,
|
|
264
|
-
this.gl.CLAMP_TO_EDGE
|
|
265
|
-
), this.gl.texParameteri(
|
|
266
|
-
this.gl.TEXTURE_2D,
|
|
267
|
-
this.gl.TEXTURE_WRAP_T,
|
|
268
|
-
this.gl.CLAMP_TO_EDGE
|
|
269
|
-
), this.gl.texParameteri(
|
|
270
|
-
this.gl.TEXTURE_2D,
|
|
271
|
-
this.gl.TEXTURE_MIN_FILTER,
|
|
272
|
-
this.gl.LINEAR
|
|
273
|
-
), this.gl.texParameteri(
|
|
274
|
-
this.gl.TEXTURE_2D,
|
|
275
|
-
this.gl.TEXTURE_MAG_FILTER,
|
|
276
|
-
this.gl.LINEAR
|
|
277
|
-
), this.gl.texImage2D(
|
|
278
|
-
this.gl.TEXTURE_2D,
|
|
279
|
-
0,
|
|
280
|
-
this.gl.RGBA,
|
|
281
|
-
this.gl.RGBA,
|
|
282
|
-
this.gl.UNSIGNED_BYTE,
|
|
283
|
-
o
|
|
284
|
-
), this.gl.bindTexture(this.gl.TEXTURE_2D, null), o.close(), {
|
|
216
|
+
return this.gl.bindTexture(this.gl.TEXTURE_2D, s), this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, 1), this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_WRAP_S, this.gl.CLAMP_TO_EDGE), this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_WRAP_T, this.gl.CLAMP_TO_EDGE), this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR), this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR), this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, o), this.gl.bindTexture(this.gl.TEXTURE_2D, null), o.close(), {
|
|
285
217
|
id: t.id,
|
|
286
218
|
bounds: t.bounds,
|
|
287
219
|
texture: s
|
|
@@ -297,10 +229,7 @@ class uo {
|
|
|
297
229
|
(this.canvas.width !== o || this.canvas.height !== s) && (this.canvas.width = o, this.canvas.height = s), this.camera.setViewport(n, r), this.gl.viewport(0, 0, this.canvas.width, this.canvas.height), !this.fitted && !this.controlledViewState && (this.fitToImage(), this.fitted = !0), this.requestRender();
|
|
298
230
|
}
|
|
299
231
|
fitToImage() {
|
|
300
|
-
const t = this.camera.getViewportSize(), n = Math.min(
|
|
301
|
-
t.width / this.imageWidth,
|
|
302
|
-
t.height / this.imageHeight
|
|
303
|
-
), r = Number.isFinite(n) && n > 0 ? n : 1, i = t.width / r, o = t.height / r, s = (this.imageWidth - i) * 0.5, a = (this.imageHeight - o) * 0.5;
|
|
232
|
+
const t = this.camera.getViewportSize(), n = Math.min(t.width / this.imageWidth, t.height / this.imageHeight), r = Number.isFinite(n) && n > 0 ? n : 1, i = t.width / r, o = t.height / r, s = (this.imageWidth - i) * 0.5, a = (this.imageHeight - o) * 0.5;
|
|
304
233
|
this.camera.setViewState({
|
|
305
234
|
zoom: r,
|
|
306
235
|
offsetX: s,
|
|
@@ -314,24 +243,9 @@ class uo {
|
|
|
314
243
|
}
|
|
315
244
|
render() {
|
|
316
245
|
if (!this.destroyed) {
|
|
317
|
-
this.gl.clearColor(
|
|
318
|
-
this.clearColor[0],
|
|
319
|
-
this.clearColor[1],
|
|
320
|
-
this.clearColor[2],
|
|
321
|
-
this.clearColor[3]
|
|
322
|
-
), this.gl.clear(this.gl.COLOR_BUFFER_BIT), this.gl.useProgram(this.program), this.gl.bindVertexArray(this.vao), this.gl.uniformMatrix3fv(
|
|
323
|
-
this.uCameraLocation,
|
|
324
|
-
!1,
|
|
325
|
-
this.camera.getMatrix()
|
|
326
|
-
), this.gl.uniform1i(this.uTextureLocation, 0);
|
|
246
|
+
this.gl.clearColor(this.clearColor[0], this.clearColor[1], this.clearColor[2], this.clearColor[3]), this.gl.clear(this.gl.COLOR_BUFFER_BIT), this.gl.useProgram(this.program), this.gl.bindVertexArray(this.vao), this.gl.uniformMatrix3fv(this.uCameraLocation, !1, this.camera.getMatrix()), this.gl.uniform1i(this.uTextureLocation, 0);
|
|
327
247
|
for (const t of this.tiles)
|
|
328
|
-
this.gl.activeTexture(this.gl.TEXTURE0), this.gl.bindTexture(this.gl.TEXTURE_2D, t.texture), this.gl.uniform4f(
|
|
329
|
-
this.uBoundsLocation,
|
|
330
|
-
t.bounds[0],
|
|
331
|
-
t.bounds[1],
|
|
332
|
-
t.bounds[2],
|
|
333
|
-
t.bounds[3]
|
|
334
|
-
), this.gl.drawArrays(this.gl.TRIANGLE_STRIP, 0, 4);
|
|
248
|
+
this.gl.activeTexture(this.gl.TEXTURE0), this.gl.bindTexture(this.gl.TEXTURE_2D, t.texture), this.gl.uniform4f(this.uBoundsLocation, t.bounds[0], t.bounds[1], t.bounds[2], t.bounds[3]), this.gl.drawArrays(this.gl.TRIANGLE_STRIP, 0, 4);
|
|
335
249
|
this.gl.bindTexture(this.gl.TEXTURE_2D, null), this.gl.bindVertexArray(null);
|
|
336
250
|
}
|
|
337
251
|
}
|
|
@@ -704,18 +618,18 @@ function ve(e) {
|
|
|
704
618
|
}
|
|
705
619
|
const bo = (3 + 16 * te) * te, wo = (2 + 12 * te) * te, So = (9 + 64 * te) * te * te, fe = ve(4), Hn = ve(8), $n = ve(12), Kn = ve(16), Yt = ve(4);
|
|
706
620
|
function Ao(e, t, n, r, i, o, s) {
|
|
707
|
-
let a, l, c, f, u, h, d, m, g, y, p, x, E, w, P, R, B,
|
|
708
|
-
const Y = e - i, M = n - i,
|
|
709
|
-
w = Y *
|
|
710
|
-
let
|
|
711
|
-
if (
|
|
712
|
-
w = a *
|
|
713
|
-
const
|
|
714
|
-
w = Y * f, h = Ot * Y, d = h - (h - Y), m = Y - d, h = Ot * f, g = h - (h - f), y = f - g, P = m * y - (w - d * g - m * g - d * y), R =
|
|
715
|
-
const
|
|
716
|
-
w = a * f, h = Ot * a, d = h - (h - a), m = a - d, h = Ot * f, g = h - (h - f), y = f - g, P = m * y - (w - d * g - m * g - d * y), R = l * c, h = Ot * l, d = h - (h - l), m = l - d, h = Ot * c, g = h - (h - c), y = c - g, B = m * y - (R - d * g - m * g - d * y), p = P - B, u = P - p, Yt[0] = P - (p + u) + (u - B), x = w + p, u = x - w, E = w - (x - u) + (p - u), p = E - R, u = E - p, Yt[1] = E - (p + u) + (u - R),
|
|
717
|
-
const
|
|
718
|
-
return Kn[
|
|
621
|
+
let a, l, c, f, u, h, d, m, g, y, p, x, E, w, P, R, B, N;
|
|
622
|
+
const Y = e - i, M = n - i, T = t - o, O = r - o;
|
|
623
|
+
w = Y * O, h = Ot * Y, d = h - (h - Y), m = Y - d, h = Ot * O, g = h - (h - O), y = O - g, P = m * y - (w - d * g - m * g - d * y), R = T * M, h = Ot * T, d = h - (h - T), m = T - d, h = Ot * M, g = h - (h - M), y = M - g, B = m * y - (R - d * g - m * g - d * y), p = P - B, u = P - p, fe[0] = P - (p + u) + (u - B), x = w + p, u = x - w, E = w - (x - u) + (p - u), p = E - R, u = E - p, fe[1] = E - (p + u) + (u - R), N = x + p, u = N - x, fe[2] = x - (N - u) + (p - u), fe[3] = N;
|
|
624
|
+
let v = xo(4, fe), W = wo * s;
|
|
625
|
+
if (v >= W || -v >= W || (u = e - Y, a = e - (Y + u) + (u - i), u = n - M, c = n - (M + u) + (u - i), u = t - T, l = t - (T + u) + (u - o), u = r - O, f = r - (O + u) + (u - o), a === 0 && l === 0 && c === 0 && f === 0) || (W = So * s + yo * Math.abs(v), v += Y * f + O * a - (T * c + M * l), v >= W || -v >= W)) return v;
|
|
626
|
+
w = a * O, h = Ot * a, d = h - (h - a), m = a - d, h = Ot * O, g = h - (h - O), y = O - g, P = m * y - (w - d * g - m * g - d * y), R = l * M, h = Ot * l, d = h - (h - l), m = l - d, h = Ot * M, g = h - (h - M), y = M - g, B = m * y - (R - d * g - m * g - d * y), p = P - B, u = P - p, Yt[0] = P - (p + u) + (u - B), x = w + p, u = x - w, E = w - (x - u) + (p - u), p = E - R, u = E - p, Yt[1] = E - (p + u) + (u - R), N = x + p, u = N - x, Yt[2] = x - (N - u) + (p - u), Yt[3] = N;
|
|
627
|
+
const J = hn(4, fe, 4, Yt, Hn);
|
|
628
|
+
w = Y * f, h = Ot * Y, d = h - (h - Y), m = Y - d, h = Ot * f, g = h - (h - f), y = f - g, P = m * y - (w - d * g - m * g - d * y), R = T * c, h = Ot * T, d = h - (h - T), m = T - d, h = Ot * c, g = h - (h - c), y = c - g, B = m * y - (R - d * g - m * g - d * y), p = P - B, u = P - p, Yt[0] = P - (p + u) + (u - B), x = w + p, u = x - w, E = w - (x - u) + (p - u), p = E - R, u = E - p, Yt[1] = E - (p + u) + (u - R), N = x + p, u = N - x, Yt[2] = x - (N - u) + (p - u), Yt[3] = N;
|
|
629
|
+
const F = hn(J, Hn, 4, Yt, $n);
|
|
630
|
+
w = a * f, h = Ot * a, d = h - (h - a), m = a - d, h = Ot * f, g = h - (h - f), y = f - g, P = m * y - (w - d * g - m * g - d * y), R = l * c, h = Ot * l, d = h - (h - l), m = l - d, h = Ot * c, g = h - (h - c), y = c - g, B = m * y - (R - d * g - m * g - d * y), p = P - B, u = P - p, Yt[0] = P - (p + u) + (u - B), x = w + p, u = x - w, E = w - (x - u) + (p - u), p = E - R, u = E - p, Yt[1] = E - (p + u) + (u - R), N = x + p, u = N - x, Yt[2] = x - (N - u) + (p - u), Yt[3] = N;
|
|
631
|
+
const xt = hn(F, $n, 4, Yt, Kn);
|
|
632
|
+
return Kn[xt - 1];
|
|
719
633
|
}
|
|
720
634
|
function Eo(e, t, n, r, i, o) {
|
|
721
635
|
const s = (t - o) * (n - i), a = (e - i) * (r - o), l = s - a, c = Math.abs(s + a);
|
|
@@ -1710,7 +1624,7 @@ function eu(e, t, n) {
|
|
|
1710
1624
|
}
|
|
1711
1625
|
return `${Math.round(i * 1e3) / 1e3} pixels`;
|
|
1712
1626
|
}
|
|
1713
|
-
function
|
|
1627
|
+
function Pt() {
|
|
1714
1628
|
return typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now();
|
|
1715
1629
|
}
|
|
1716
1630
|
function ce(e) {
|
|
@@ -2555,19 +2469,19 @@ function ia({
|
|
|
2555
2469
|
resolveRegionStrokeStyle: P,
|
|
2556
2470
|
resolveRegionLabelStyle: R,
|
|
2557
2471
|
overlayShapes: B,
|
|
2558
|
-
hoveredRegionId:
|
|
2472
|
+
hoveredRegionId: N = null,
|
|
2559
2473
|
activeRegionId: Y = null,
|
|
2560
2474
|
regionLabelStyle: M,
|
|
2561
|
-
drawAreaTooltip:
|
|
2562
|
-
autoLiftRegionLabelAtMaxZoom:
|
|
2563
|
-
regionLabelAnchor:
|
|
2475
|
+
drawAreaTooltip: T,
|
|
2476
|
+
autoLiftRegionLabelAtMaxZoom: O = !1,
|
|
2477
|
+
regionLabelAnchor: v = "top-center",
|
|
2564
2478
|
clampRegionLabelToViewport: W = !0,
|
|
2565
|
-
regionLabelAutoLiftOffsetPx:
|
|
2566
|
-
invalidateRef:
|
|
2567
|
-
className:
|
|
2568
|
-
style:
|
|
2479
|
+
regionLabelAutoLiftOffsetPx: J,
|
|
2480
|
+
invalidateRef: F,
|
|
2481
|
+
className: xt,
|
|
2482
|
+
style: ft
|
|
2569
2483
|
}) {
|
|
2570
|
-
const
|
|
2484
|
+
const tt = q(null), _t = q(!1), Ct = q(/* @__PURE__ */ new Map()), L = q(e), C = q({
|
|
2571
2485
|
isDrawing: !1,
|
|
2572
2486
|
pointerId: null,
|
|
2573
2487
|
start: null,
|
|
@@ -2577,34 +2491,34 @@ function ia({
|
|
|
2577
2491
|
points: [],
|
|
2578
2492
|
screenPoints: [],
|
|
2579
2493
|
stampCenter: null
|
|
2580
|
-
}),
|
|
2494
|
+
}), U = u ?? e !== "cursor", lt = at(() => d && d.length > 0 ? d : !g || g.length === 0 ? mr : g.map((b, A) => ({
|
|
2581
2495
|
id: A,
|
|
2582
2496
|
coordinates: b
|
|
2583
|
-
})), [d, g]),
|
|
2497
|
+
})), [d, g]), dt = at(() => m ?? mr, [m]), j = at(() => {
|
|
2584
2498
|
const b = [];
|
|
2585
2499
|
for (let A = 0; A < lt.length; A += 1) {
|
|
2586
|
-
const
|
|
2500
|
+
const I = lt[A], D = tn(I.coordinates);
|
|
2587
2501
|
D.length !== 0 && b.push({
|
|
2588
|
-
region:
|
|
2502
|
+
region: I,
|
|
2589
2503
|
regionIndex: A,
|
|
2590
|
-
regionKey:
|
|
2504
|
+
regionKey: I.id ?? A,
|
|
2591
2505
|
polygons: D
|
|
2592
2506
|
});
|
|
2593
2507
|
}
|
|
2594
2508
|
return b;
|
|
2595
|
-
}, [lt]),
|
|
2509
|
+
}, [lt]), ht = at(() => {
|
|
2596
2510
|
const b = [];
|
|
2597
|
-
for (let A = 0; A <
|
|
2598
|
-
const
|
|
2511
|
+
for (let A = 0; A < dt.length; A += 1) {
|
|
2512
|
+
const I = dt[A], D = tn(I.coordinates);
|
|
2599
2513
|
D.length !== 0 && b.push({
|
|
2600
|
-
region:
|
|
2514
|
+
region: I,
|
|
2601
2515
|
regionIndex: A,
|
|
2602
|
-
regionKey:
|
|
2516
|
+
regionKey: I.id ?? A,
|
|
2603
2517
|
polygons: D
|
|
2604
2518
|
});
|
|
2605
2519
|
}
|
|
2606
2520
|
return b;
|
|
2607
|
-
}, [
|
|
2521
|
+
}, [dt]), rt = at(() => zn(p), [p]), Dt = at(() => Jt(rt, x), [rt, x]), Rt = at(() => Jt(rt, E), [rt, E]), mt = at(() => Jt(xi, w), [w]), At = at(() => ra(y), [y]), nt = at(() => kn(M), [M]), ct = at(() => $s(T), [T]), gt = at(() => Qs(o), [o]), ut = at(() => Us(s), [s]), it = at(
|
|
2608
2522
|
() => ({
|
|
2609
2523
|
position: "absolute",
|
|
2610
2524
|
inset: 0,
|
|
@@ -2613,107 +2527,107 @@ function ia({
|
|
|
2613
2527
|
height: "100%",
|
|
2614
2528
|
display: "block",
|
|
2615
2529
|
touchAction: "none",
|
|
2616
|
-
pointerEvents:
|
|
2617
|
-
cursor:
|
|
2618
|
-
...
|
|
2530
|
+
pointerEvents: U ? "auto" : "none",
|
|
2531
|
+
cursor: U ? e === "brush" ? "none" : "crosshair" : "default",
|
|
2532
|
+
...ft
|
|
2619
2533
|
}),
|
|
2620
|
-
[
|
|
2621
|
-
),
|
|
2622
|
-
const b =
|
|
2534
|
+
[U, e, ft]
|
|
2535
|
+
), vt = V(() => {
|
|
2536
|
+
const b = tt.current;
|
|
2623
2537
|
if (!b) return;
|
|
2624
|
-
const A = b.getBoundingClientRect(),
|
|
2538
|
+
const A = b.getBoundingClientRect(), I = Math.max(1, window.devicePixelRatio || 1), D = Math.max(1, Math.round(A.width * I)), Z = Math.max(1, Math.round(A.height * I));
|
|
2625
2539
|
(b.width !== D || b.height !== Z) && (b.width = D, b.height = Z);
|
|
2626
|
-
}, [
|
|
2540
|
+
}, [U, e]), Et = V(
|
|
2627
2541
|
(b) => {
|
|
2628
2542
|
const A = a.current;
|
|
2629
2543
|
if (!A || b.length === 0) return [];
|
|
2630
|
-
const
|
|
2544
|
+
const I = new Array(b.length);
|
|
2631
2545
|
for (let D = 0; D < b.length; D += 1) {
|
|
2632
2546
|
const Z = $t(A.worldToScreen(b[D][0], b[D][1]));
|
|
2633
2547
|
if (!Z) return [];
|
|
2634
|
-
|
|
2548
|
+
I[D] = Z;
|
|
2635
2549
|
}
|
|
2636
|
-
return
|
|
2550
|
+
return I;
|
|
2637
2551
|
},
|
|
2638
2552
|
[a]
|
|
2639
2553
|
), G = V(
|
|
2640
2554
|
(b) => {
|
|
2641
|
-
const A = a.current,
|
|
2642
|
-
if (!A || !
|
|
2643
|
-
const D =
|
|
2555
|
+
const A = a.current, I = tt.current;
|
|
2556
|
+
if (!A || !I) return null;
|
|
2557
|
+
const D = I.getBoundingClientRect(), Z = $t(A.screenToWorld(D.left + b[0], D.top + b[1]));
|
|
2644
2558
|
return Z ? Qe(Z, t, n) : null;
|
|
2645
2559
|
},
|
|
2646
2560
|
[a, t, n]
|
|
2647
|
-
),
|
|
2561
|
+
), K = V(() => {
|
|
2648
2562
|
const b = a.current, A = b?.getViewState?.().rotationDeg ?? 0;
|
|
2649
2563
|
if (!(Math.abs(A % 360) < 0.01 || !b))
|
|
2650
2564
|
return {
|
|
2651
|
-
worldToScreen: (
|
|
2565
|
+
worldToScreen: (I, D) => $t(b.worldToScreen(I, D)),
|
|
2652
2566
|
screenToWorld: G
|
|
2653
2567
|
};
|
|
2654
|
-
}, [a, G]),
|
|
2568
|
+
}, [a, G]), St = V(
|
|
2655
2569
|
(b) => {
|
|
2656
2570
|
if (!Number.isFinite(b) || b <= 0) return 0;
|
|
2657
|
-
const A = typeof r == "number" && Number.isFinite(r) && r > 0 ? r : 1,
|
|
2571
|
+
const A = typeof r == "number" && Number.isFinite(r) && r > 0 ? r : 1, I = typeof i == "number" && Number.isFinite(i) ? i : 0, D = a.current?.getViewState?.().zoom, Z = typeof D == "number" && Number.isFinite(D) && D > 0 ? D : 1, wt = I + Math.log2(Z), st = Math.max(1e-9, yi(A, I, wt));
|
|
2658
2572
|
return b / st / Z;
|
|
2659
2573
|
},
|
|
2660
2574
|
[r, i, a]
|
|
2661
|
-
),
|
|
2575
|
+
), et = V(
|
|
2662
2576
|
(b, A) => ea({
|
|
2663
2577
|
stampTool: b,
|
|
2664
2578
|
center: A,
|
|
2665
|
-
resolvedStampOptions:
|
|
2579
|
+
resolvedStampOptions: gt,
|
|
2666
2580
|
imageWidth: t,
|
|
2667
2581
|
imageHeight: n,
|
|
2668
|
-
micronsToWorldPixels:
|
|
2669
|
-
getRectangleProjection:
|
|
2582
|
+
micronsToWorldPixels: St,
|
|
2583
|
+
getRectangleProjection: K
|
|
2670
2584
|
}),
|
|
2671
|
-
[
|
|
2672
|
-
),
|
|
2673
|
-
const b =
|
|
2674
|
-
return Ne(e) ?
|
|
2675
|
-
}, [e,
|
|
2676
|
-
|
|
2677
|
-
const b =
|
|
2585
|
+
[St, t, n, gt, K]
|
|
2586
|
+
), Q = V(() => {
|
|
2587
|
+
const b = C.current;
|
|
2588
|
+
return Ne(e) ? et(e, b.stampCenter) : e === "brush" ? [] : b.isDrawing ? e === "freehand" ? b.points : e === "rectangle" ? Rn(b.start, b.current, K()) : e === "circular" ? Er(b.start, b.current) : [] : [];
|
|
2589
|
+
}, [e, et, K]), Mt = V(() => {
|
|
2590
|
+
vt();
|
|
2591
|
+
const b = tt.current;
|
|
2678
2592
|
if (!b) return;
|
|
2679
2593
|
const A = b.getContext("2d");
|
|
2680
2594
|
if (!A) return;
|
|
2681
|
-
const
|
|
2682
|
-
if (A.setTransform(1, 0, 0, 1, 0, 0), A.clearRect(0, 0, b.width, b.height), A.setTransform(
|
|
2683
|
-
for (const st of
|
|
2684
|
-
const { region:
|
|
2685
|
-
let ee = ue === "active" ?
|
|
2595
|
+
const I = Math.max(1, window.devicePixelRatio || 1), D = b.width / I, Z = b.height / I;
|
|
2596
|
+
if (A.setTransform(1, 0, 0, 1, 0, 0), A.clearRect(0, 0, b.width, b.height), A.setTransform(I, 0, 0, I, 0, 0), j.length > 0)
|
|
2597
|
+
for (const st of j) {
|
|
2598
|
+
const { region: yt, polygons: It, regionIndex: Ft, regionKey: kt } = st, ue = Je(Y, kt) ? "active" : Je(N, kt) ? "hover" : "default";
|
|
2599
|
+
let ee = ue === "active" ? Rt : ue === "hover" ? Dt : rt;
|
|
2686
2600
|
if (P) {
|
|
2687
2601
|
const _e = P({
|
|
2688
|
-
region:
|
|
2602
|
+
region: yt,
|
|
2689
2603
|
regionId: kt,
|
|
2690
|
-
regionIndex:
|
|
2604
|
+
regionIndex: Ft,
|
|
2691
2605
|
state: ue
|
|
2692
2606
|
});
|
|
2693
2607
|
ee = Jt(ee, _e || void 0);
|
|
2694
2608
|
}
|
|
2695
2609
|
const Ie = ue === "default" ? null : na(ee);
|
|
2696
|
-
for (const _e of
|
|
2697
|
-
const ln =
|
|
2610
|
+
for (const _e of It) {
|
|
2611
|
+
const ln = Et(_e.outer);
|
|
2698
2612
|
ln.length >= 4 && (Ie && Wt(A, ln, Ie, !0, !1), Wt(A, ln, ee, !0, !1));
|
|
2699
2613
|
for (const to of _e.holes) {
|
|
2700
|
-
const cn =
|
|
2614
|
+
const cn = Et(to);
|
|
2701
2615
|
cn.length >= 4 && (Ie && Wt(A, cn, Ie, !0, !1), Wt(A, cn, ee, !0, !1));
|
|
2702
2616
|
}
|
|
2703
2617
|
}
|
|
2704
2618
|
}
|
|
2705
|
-
if (
|
|
2706
|
-
for (const st of
|
|
2707
|
-
for (const
|
|
2708
|
-
const
|
|
2709
|
-
|
|
2710
|
-
for (const
|
|
2711
|
-
const kt =
|
|
2712
|
-
kt.length >= 4 && Wt(A, kt,
|
|
2619
|
+
if (ht.length > 0)
|
|
2620
|
+
for (const st of ht)
|
|
2621
|
+
for (const yt of st.polygons) {
|
|
2622
|
+
const It = Et(yt.outer);
|
|
2623
|
+
It.length >= 4 && Wt(A, It, mt, !0, !1);
|
|
2624
|
+
for (const Ft of yt.holes) {
|
|
2625
|
+
const kt = Et(Ft);
|
|
2626
|
+
kt.length >= 4 && Wt(A, kt, mt, !0, !1);
|
|
2713
2627
|
}
|
|
2714
2628
|
}
|
|
2715
2629
|
if (Array.isArray(B) && B.length > 0) {
|
|
2716
|
-
const st =
|
|
2630
|
+
const st = Et(
|
|
2717
2631
|
Vt([
|
|
2718
2632
|
[0, 0],
|
|
2719
2633
|
[t, 0],
|
|
@@ -2725,59 +2639,59 @@ function ia({
|
|
|
2725
2639
|
ctx: A,
|
|
2726
2640
|
overlayShapes: B,
|
|
2727
2641
|
imageOuterRing: st,
|
|
2728
|
-
worldToScreenPoints:
|
|
2729
|
-
baseStrokeStyle:
|
|
2730
|
-
onInvertedFillDebug: globalThis.__OPEN_PLANT_DEBUG_OVERLAY__ ? (
|
|
2731
|
-
const
|
|
2732
|
-
Ct.current.get(
|
|
2642
|
+
worldToScreenPoints: Et,
|
|
2643
|
+
baseStrokeStyle: rt,
|
|
2644
|
+
onInvertedFillDebug: globalThis.__OPEN_PLANT_DEBUG_OVERLAY__ ? (yt) => {
|
|
2645
|
+
const It = String(yt.id), Ft = `${yt.outerRingPoints}|${yt.sourceRingCount}|${yt.holeRingCount}|${yt.fillColor}`;
|
|
2646
|
+
Ct.current.get(It) !== Ft && (Ct.current.set(It, Ft), console.debug("[open-plant] invertedFill", yt));
|
|
2733
2647
|
} : void 0
|
|
2734
2648
|
});
|
|
2735
2649
|
}
|
|
2736
|
-
const
|
|
2737
|
-
if (
|
|
2650
|
+
const wt = Q();
|
|
2651
|
+
if (U) {
|
|
2738
2652
|
if (e === "brush")
|
|
2739
|
-
ks(A,
|
|
2740
|
-
else if (
|
|
2653
|
+
ks(A, C.current, ut), Os(A, C.current, a.current, ut);
|
|
2654
|
+
else if (wt.length > 0)
|
|
2741
2655
|
if (e === "freehand") {
|
|
2742
|
-
const st =
|
|
2743
|
-
st.length >= 2 && Wt(A, st,
|
|
2656
|
+
const st = Et(wt);
|
|
2657
|
+
st.length >= 2 && Wt(A, st, rt, !1, !1), st.length >= 3 && Wt(A, Et(Vt(wt)), rt, !0, !0, At);
|
|
2744
2658
|
} else {
|
|
2745
|
-
const st =
|
|
2746
|
-
st.length >= 4 && Wt(A, st,
|
|
2659
|
+
const st = Et(wt);
|
|
2660
|
+
st.length >= 4 && Wt(A, st, rt, !0, !0, At);
|
|
2747
2661
|
}
|
|
2748
2662
|
}
|
|
2749
|
-
if (
|
|
2750
|
-
const st = Math.max(1e-6, a.current?.getViewState?.().zoom ?? 1),
|
|
2751
|
-
|
|
2663
|
+
if (j.length > 0) {
|
|
2664
|
+
const st = Math.max(1e-6, a.current?.getViewState?.().zoom ?? 1), yt = typeof J == "number" && Number.isFinite(J) ? Math.max(0, J) : Wn(
|
|
2665
|
+
O,
|
|
2752
2666
|
st,
|
|
2753
2667
|
a.current?.getZoomRange?.(),
|
|
2754
2668
|
a.current?.getRegionLabelAutoLiftCapZoom?.()
|
|
2755
2669
|
);
|
|
2756
|
-
for (const
|
|
2757
|
-
if (!
|
|
2758
|
-
const
|
|
2759
|
-
if (!
|
|
2670
|
+
for (const It of j) {
|
|
2671
|
+
if (!It.region.label) continue;
|
|
2672
|
+
const Ft = Un(It.polygons, Et, v);
|
|
2673
|
+
if (!Ft) continue;
|
|
2760
2674
|
let kt = On(
|
|
2761
|
-
|
|
2675
|
+
nt,
|
|
2762
2676
|
R?.({
|
|
2763
|
-
region:
|
|
2764
|
-
regionId:
|
|
2765
|
-
regionIndex:
|
|
2677
|
+
region: It.region,
|
|
2678
|
+
regionId: It.regionKey,
|
|
2679
|
+
regionIndex: It.regionIndex,
|
|
2766
2680
|
zoom: st
|
|
2767
2681
|
})
|
|
2768
2682
|
);
|
|
2769
|
-
|
|
2683
|
+
yt > 0 && (kt = {
|
|
2770
2684
|
...kt,
|
|
2771
|
-
offsetY: kt.offsetY +
|
|
2772
|
-
}), Mi(A,
|
|
2685
|
+
offsetY: kt.offsetY + yt
|
|
2686
|
+
}), Mi(A, It.region.label, Ft, D, Z, kt, W);
|
|
2773
2687
|
}
|
|
2774
2688
|
}
|
|
2775
|
-
if (ct.enabled &&
|
|
2776
|
-
const st =
|
|
2689
|
+
if (ct.enabled && U && (e === "freehand" || e === "rectangle" || e === "circular")) {
|
|
2690
|
+
const st = C.current;
|
|
2777
2691
|
if (st.isDrawing) {
|
|
2778
|
-
const
|
|
2779
|
-
if (
|
|
2780
|
-
const
|
|
2692
|
+
const yt = e === "freehand" ? Vt(wt) : wt;
|
|
2693
|
+
if (yt.length >= 4) {
|
|
2694
|
+
const It = Ge(yt), Ft = typeof r == "number" && Number.isFinite(r) && r > 0 ? r : 0, kt = Ft > 0 ? It * Ft * Ft / (xr * xr) : 0, ue = ct.format(kt), ee = st.cursorScreen ?? (st.current ? $t(a.current?.worldToScreen(st.current[0], st.current[1]) ?? []) : null);
|
|
2781
2695
|
ee && Ks(
|
|
2782
2696
|
A,
|
|
2783
2697
|
ue,
|
|
@@ -2792,84 +2706,84 @@ function ia({
|
|
|
2792
2706
|
}
|
|
2793
2707
|
}
|
|
2794
2708
|
}, [
|
|
2795
|
-
|
|
2709
|
+
U,
|
|
2796
2710
|
e,
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2711
|
+
Q,
|
|
2712
|
+
vt,
|
|
2713
|
+
Et,
|
|
2800
2714
|
t,
|
|
2801
2715
|
n,
|
|
2802
2716
|
a,
|
|
2803
|
-
|
|
2717
|
+
j,
|
|
2804
2718
|
B,
|
|
2805
|
-
|
|
2719
|
+
N,
|
|
2806
2720
|
Y,
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2721
|
+
rt,
|
|
2722
|
+
Dt,
|
|
2723
|
+
Rt,
|
|
2724
|
+
At,
|
|
2725
|
+
ht,
|
|
2726
|
+
mt,
|
|
2813
2727
|
P,
|
|
2814
2728
|
R,
|
|
2815
|
-
|
|
2729
|
+
nt,
|
|
2816
2730
|
ct,
|
|
2817
|
-
|
|
2818
|
-
|
|
2731
|
+
O,
|
|
2732
|
+
v,
|
|
2819
2733
|
W,
|
|
2820
|
-
|
|
2734
|
+
J,
|
|
2821
2735
|
r,
|
|
2822
|
-
|
|
2736
|
+
ut
|
|
2823
2737
|
]), X = V(() => {
|
|
2824
2738
|
_t.current || (_t.current = !0, requestAnimationFrame(() => {
|
|
2825
2739
|
_t.current = !1, Mt();
|
|
2826
2740
|
}));
|
|
2827
|
-
}, [Mt]),
|
|
2828
|
-
const A =
|
|
2829
|
-
|
|
2741
|
+
}, [Mt]), Tt = V((b = !1) => {
|
|
2742
|
+
const A = C.current, I = tt.current;
|
|
2743
|
+
I && A.pointerId !== null && I.hasPointerCapture(A.pointerId) && I.releasePointerCapture(A.pointerId), A.isDrawing = !1, A.pointerId = null, A.start = null, A.current = null, A.points = [], A.screenPoints = [], A.stampCenter = null, b || (A.cursor = null, A.cursorScreen = null);
|
|
2830
2744
|
}, []), Bt = V(
|
|
2831
2745
|
(b) => {
|
|
2832
2746
|
const A = a.current;
|
|
2833
2747
|
if (!A || t <= 0 || n <= 0) return null;
|
|
2834
|
-
const
|
|
2835
|
-
return
|
|
2748
|
+
const I = $t(A.screenToWorld(b.clientX, b.clientY));
|
|
2749
|
+
return I ? Qe(I, t, n) : null;
|
|
2836
2750
|
},
|
|
2837
2751
|
[a, t, n]
|
|
2838
|
-
),
|
|
2839
|
-
const A =
|
|
2752
|
+
), zt = V((b) => {
|
|
2753
|
+
const A = tt.current;
|
|
2840
2754
|
if (!A) return null;
|
|
2841
|
-
const
|
|
2755
|
+
const I = A.getBoundingClientRect(), D = _(b.clientX - I.left, 0, I.width), Z = _(b.clientY - I.top, 0, I.height);
|
|
2842
2756
|
return !Number.isFinite(D) || !Number.isFinite(Z) ? null : [D, Z];
|
|
2843
|
-
}, []),
|
|
2844
|
-
const b =
|
|
2757
|
+
}, []), k = V(() => {
|
|
2758
|
+
const b = C.current;
|
|
2845
2759
|
if (!b.isDrawing) {
|
|
2846
|
-
|
|
2760
|
+
Tt(!0), X();
|
|
2847
2761
|
return;
|
|
2848
2762
|
}
|
|
2849
2763
|
let A = [];
|
|
2850
2764
|
if (e === "freehand")
|
|
2851
2765
|
b.points.length >= fs && (A = Vt(b.points));
|
|
2852
2766
|
else if (e === "rectangle")
|
|
2853
|
-
A = Rn(b.start, b.current,
|
|
2767
|
+
A = Rn(b.start, b.current, K());
|
|
2854
2768
|
else if (e === "circular")
|
|
2855
2769
|
A = Er(b.start, b.current);
|
|
2856
2770
|
else if (e === "brush") {
|
|
2857
|
-
const
|
|
2858
|
-
if (
|
|
2859
|
-
|
|
2771
|
+
const I = b.points[b.points.length - 1] ?? b.current ?? b.start;
|
|
2772
|
+
if (ut.clickSelectRoi && I && b.points.length <= 1 && l?.(I)) {
|
|
2773
|
+
Tt(!0), X();
|
|
2860
2774
|
return;
|
|
2861
2775
|
}
|
|
2862
|
-
const D = Math.max(0.25,
|
|
2863
|
-
radius:
|
|
2776
|
+
const D = Math.max(0.25, ut.edgeDetail), Z = b.screenPoints.length > 0 ? b.screenPoints : Et(b.points), wt = Math.max(0.5, ut.radius * 0.04 / D), st = cs(Z, {
|
|
2777
|
+
radius: ut.radius,
|
|
2864
2778
|
circleSides: Math.max(16, Math.round(32 * D)),
|
|
2865
|
-
simplifyTolerance:
|
|
2866
|
-
smoothingPasses:
|
|
2867
|
-
}),
|
|
2868
|
-
for (const
|
|
2869
|
-
const
|
|
2870
|
-
|
|
2779
|
+
simplifyTolerance: wt,
|
|
2780
|
+
smoothingPasses: ut.edgeSmoothing
|
|
2781
|
+
}), yt = [];
|
|
2782
|
+
for (const It of st) {
|
|
2783
|
+
const Ft = G(It);
|
|
2784
|
+
Ft && yt.push(Ft);
|
|
2871
2785
|
}
|
|
2872
|
-
A = Vt(
|
|
2786
|
+
A = Vt(yt);
|
|
2873
2787
|
}
|
|
2874
2788
|
(e === "freehand" || e === "rectangle" || e === "circular" || e === "brush") && Mr(A) && c && c({
|
|
2875
2789
|
tool: e,
|
|
@@ -2877,72 +2791,72 @@ function ia({
|
|
|
2877
2791
|
coordinates: A,
|
|
2878
2792
|
bbox: wr(A),
|
|
2879
2793
|
areaPx: Ge(A)
|
|
2880
|
-
}),
|
|
2794
|
+
}), Tt(!0), X();
|
|
2881
2795
|
}, [
|
|
2882
2796
|
e,
|
|
2883
2797
|
c,
|
|
2884
|
-
|
|
2798
|
+
Tt,
|
|
2885
2799
|
X,
|
|
2886
|
-
|
|
2800
|
+
Et,
|
|
2887
2801
|
G,
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2802
|
+
K,
|
|
2803
|
+
ut.radius,
|
|
2804
|
+
ut.edgeDetail,
|
|
2805
|
+
ut.edgeSmoothing,
|
|
2806
|
+
ut.clickSelectRoi,
|
|
2893
2807
|
l
|
|
2894
|
-
]),
|
|
2808
|
+
]), H = V(
|
|
2895
2809
|
(b, A) => {
|
|
2896
|
-
const
|
|
2897
|
-
if (!Mr(
|
|
2810
|
+
const I = et(b, A);
|
|
2811
|
+
if (!Mr(I)) return;
|
|
2898
2812
|
const D = b === "stamp-rectangle-4096px" ? "patch" : "roi", Z = {
|
|
2899
2813
|
tool: b,
|
|
2900
2814
|
intent: D,
|
|
2901
|
-
coordinates:
|
|
2902
|
-
bbox: wr(
|
|
2903
|
-
areaPx: Ge(
|
|
2815
|
+
coordinates: I,
|
|
2816
|
+
bbox: wr(I),
|
|
2817
|
+
areaPx: Ge(I)
|
|
2904
2818
|
};
|
|
2905
2819
|
c?.(Z), D === "patch" && f && f(Z);
|
|
2906
2820
|
},
|
|
2907
|
-
[
|
|
2908
|
-
),
|
|
2909
|
-
(b, A,
|
|
2910
|
-
const D = Math.max(Is,
|
|
2911
|
-
if (!
|
|
2912
|
-
b.points.push(A), b.screenPoints.push(
|
|
2821
|
+
[et, c, f]
|
|
2822
|
+
), $ = V(
|
|
2823
|
+
(b, A, I) => {
|
|
2824
|
+
const D = Math.max(Is, ut.radius * 0.1), Z = D * D, wt = b.screenPoints[b.screenPoints.length - 1];
|
|
2825
|
+
if (!wt) {
|
|
2826
|
+
b.points.push(A), b.screenPoints.push(I), b.current = A;
|
|
2913
2827
|
return;
|
|
2914
2828
|
}
|
|
2915
|
-
const st =
|
|
2916
|
-
st * st +
|
|
2829
|
+
const st = I[0] - wt[0], yt = I[1] - wt[1];
|
|
2830
|
+
st * st + yt * yt >= Z ? (b.points.push(A), b.screenPoints.push(I)) : (b.points[b.points.length - 1] = A, b.screenPoints[b.screenPoints.length - 1] = I), b.current = A;
|
|
2917
2831
|
},
|
|
2918
|
-
[
|
|
2919
|
-
),
|
|
2832
|
+
[ut.radius]
|
|
2833
|
+
), ot = V(
|
|
2920
2834
|
(b) => {
|
|
2921
|
-
if (!
|
|
2835
|
+
if (!U || e === "cursor" || b.button !== 0) return;
|
|
2922
2836
|
const A = Bt(b);
|
|
2923
2837
|
if (!A) return;
|
|
2924
|
-
const
|
|
2925
|
-
if (!
|
|
2838
|
+
const I = zt(b);
|
|
2839
|
+
if (!I) return;
|
|
2926
2840
|
if (b.preventDefault(), b.stopPropagation(), Ne(e)) {
|
|
2927
|
-
const
|
|
2928
|
-
|
|
2841
|
+
const wt = C.current;
|
|
2842
|
+
wt.stampCenter = A, H(e, A), X();
|
|
2929
2843
|
return;
|
|
2930
2844
|
}
|
|
2931
|
-
const D =
|
|
2845
|
+
const D = tt.current;
|
|
2932
2846
|
D && D.setPointerCapture(b.pointerId);
|
|
2933
|
-
const Z =
|
|
2934
|
-
Z.isDrawing = !0, Z.pointerId = b.pointerId, Z.start = A, Z.current = A, Z.cursor = A, Z.cursorScreen =
|
|
2847
|
+
const Z = C.current;
|
|
2848
|
+
Z.isDrawing = !0, Z.pointerId = b.pointerId, Z.start = A, Z.current = A, Z.cursor = A, Z.cursorScreen = I, Z.points = e === "freehand" || e === "brush" ? [A] : [], Z.screenPoints = e === "brush" ? [I] : [], X();
|
|
2935
2849
|
},
|
|
2936
|
-
[
|
|
2937
|
-
),
|
|
2850
|
+
[U, e, Bt, zt, H, X]
|
|
2851
|
+
), bt = V(
|
|
2938
2852
|
(b) => {
|
|
2939
|
-
if (!
|
|
2853
|
+
if (!U || e === "cursor") return;
|
|
2940
2854
|
const A = Bt(b);
|
|
2941
2855
|
if (!A) return;
|
|
2942
|
-
const
|
|
2943
|
-
if (!
|
|
2944
|
-
const D =
|
|
2945
|
-
if (D.cursor = A, D.cursorScreen =
|
|
2856
|
+
const I = zt(b);
|
|
2857
|
+
if (!I) return;
|
|
2858
|
+
const D = C.current;
|
|
2859
|
+
if (D.cursor = A, D.cursorScreen = I, Ne(e)) {
|
|
2946
2860
|
D.stampCenter = A, b.preventDefault(), b.stopPropagation(), X();
|
|
2947
2861
|
return;
|
|
2948
2862
|
}
|
|
@@ -2951,92 +2865,92 @@ function ia({
|
|
|
2951
2865
|
X();
|
|
2952
2866
|
return;
|
|
2953
2867
|
}
|
|
2954
|
-
b.preventDefault(), b.stopPropagation(),
|
|
2868
|
+
b.preventDefault(), b.stopPropagation(), $(D, A, I), X();
|
|
2955
2869
|
return;
|
|
2956
2870
|
}
|
|
2957
2871
|
if (!(!D.isDrawing || D.pointerId !== b.pointerId)) {
|
|
2958
2872
|
if (b.preventDefault(), b.stopPropagation(), e === "freehand") {
|
|
2959
|
-
const Z = a.current,
|
|
2960
|
-
if (!
|
|
2873
|
+
const Z = a.current, wt = Math.max(1e-6, Z?.getViewState?.().zoom ?? 1), st = hs / wt, yt = st * st, It = D.points[D.points.length - 1];
|
|
2874
|
+
if (!It)
|
|
2961
2875
|
D.points.push(A);
|
|
2962
2876
|
else {
|
|
2963
|
-
const
|
|
2964
|
-
|
|
2877
|
+
const Ft = A[0] - It[0], kt = A[1] - It[1];
|
|
2878
|
+
Ft * Ft + kt * kt >= yt && D.points.push(A);
|
|
2965
2879
|
}
|
|
2966
2880
|
} else
|
|
2967
2881
|
D.current = A;
|
|
2968
2882
|
X();
|
|
2969
2883
|
}
|
|
2970
2884
|
},
|
|
2971
|
-
[
|
|
2972
|
-
),
|
|
2885
|
+
[U, e, Bt, zt, X, a, $]
|
|
2886
|
+
), pt = V(
|
|
2973
2887
|
(b) => {
|
|
2974
|
-
const A =
|
|
2888
|
+
const A = C.current;
|
|
2975
2889
|
if (!A.isDrawing || A.pointerId !== b.pointerId) return;
|
|
2976
2890
|
b.preventDefault(), b.stopPropagation();
|
|
2977
|
-
const
|
|
2978
|
-
|
|
2979
|
-
const Z =
|
|
2980
|
-
Z && Z.hasPointerCapture(b.pointerId) && Z.releasePointerCapture(b.pointerId),
|
|
2891
|
+
const I = Bt(b), D = zt(b);
|
|
2892
|
+
I && (A.cursor = I, D && (A.cursorScreen = D), e === "brush" ? D && $(A, I, D) : A.current = I);
|
|
2893
|
+
const Z = tt.current;
|
|
2894
|
+
Z && Z.hasPointerCapture(b.pointerId) && Z.releasePointerCapture(b.pointerId), k();
|
|
2981
2895
|
},
|
|
2982
|
-
[
|
|
2896
|
+
[k, Bt, zt, e, $]
|
|
2983
2897
|
), Ut = V(() => {
|
|
2984
|
-
const b =
|
|
2898
|
+
const b = C.current;
|
|
2985
2899
|
let A = !1;
|
|
2986
2900
|
e === "brush" && !b.isDrawing && b.cursor && (b.cursor = null, b.cursorScreen = null, A = !0), Ne(e) && b.stampCenter && (b.stampCenter = null, A = !0), A && X();
|
|
2987
2901
|
}, [e, X]);
|
|
2988
|
-
return
|
|
2989
|
-
|
|
2990
|
-
const b =
|
|
2902
|
+
return z(() => {
|
|
2903
|
+
vt(), X();
|
|
2904
|
+
const b = tt.current;
|
|
2991
2905
|
if (!b) return;
|
|
2992
2906
|
const A = new ResizeObserver(() => {
|
|
2993
|
-
|
|
2907
|
+
vt(), X();
|
|
2994
2908
|
});
|
|
2995
2909
|
return A.observe(b), () => {
|
|
2996
2910
|
A.disconnect();
|
|
2997
2911
|
};
|
|
2998
|
-
}, [
|
|
2999
|
-
|
|
3000
|
-
}), [
|
|
3001
|
-
|
|
3002
|
-
}, [
|
|
3003
|
-
L.current !== e && (L.current = e,
|
|
3004
|
-
}, [e,
|
|
2912
|
+
}, [vt, X]), z(() => sn(() => {
|
|
2913
|
+
vt(), X();
|
|
2914
|
+
}), [vt, X]), z(() => {
|
|
2915
|
+
U || Tt(), X();
|
|
2916
|
+
}, [U, X, Tt]), z(() => {
|
|
2917
|
+
L.current !== e && (L.current = e, Tt(), X());
|
|
2918
|
+
}, [e, Tt, X]), z(() => {
|
|
3005
2919
|
X();
|
|
3006
|
-
}, [h, lt, B, X]),
|
|
3007
|
-
if (
|
|
3008
|
-
return
|
|
3009
|
-
|
|
2920
|
+
}, [h, lt, B, X]), z(() => {
|
|
2921
|
+
if (F)
|
|
2922
|
+
return F.current = X, () => {
|
|
2923
|
+
F.current === X && (F.current = null);
|
|
3010
2924
|
};
|
|
3011
|
-
}, [
|
|
3012
|
-
if (!
|
|
2925
|
+
}, [F, X]), z(() => {
|
|
2926
|
+
if (!U) return;
|
|
3013
2927
|
const b = (A) => {
|
|
3014
|
-
A.key === "Escape" && (
|
|
2928
|
+
A.key === "Escape" && (Tt(), X());
|
|
3015
2929
|
};
|
|
3016
2930
|
return window.addEventListener("keydown", b), () => {
|
|
3017
2931
|
window.removeEventListener("keydown", b);
|
|
3018
2932
|
};
|
|
3019
|
-
}, [
|
|
2933
|
+
}, [U, Tt, X]), /* @__PURE__ */ Qt(
|
|
3020
2934
|
"canvas",
|
|
3021
2935
|
{
|
|
3022
|
-
ref:
|
|
3023
|
-
className:
|
|
3024
|
-
style:
|
|
3025
|
-
onPointerDown:
|
|
3026
|
-
onPointerMove:
|
|
3027
|
-
onPointerUp:
|
|
3028
|
-
onPointerCancel:
|
|
2936
|
+
ref: tt,
|
|
2937
|
+
className: xt,
|
|
2938
|
+
style: it,
|
|
2939
|
+
onPointerDown: ot,
|
|
2940
|
+
onPointerMove: bt,
|
|
2941
|
+
onPointerUp: pt,
|
|
2942
|
+
onPointerCancel: pt,
|
|
3029
2943
|
onPointerLeave: Ut,
|
|
3030
2944
|
onContextMenu: (b) => {
|
|
3031
|
-
|
|
2945
|
+
U && b.preventDefault();
|
|
3032
2946
|
},
|
|
3033
2947
|
onWheel: (b) => {
|
|
3034
|
-
if (!
|
|
3035
|
-
const A =
|
|
2948
|
+
if (!U) return;
|
|
2949
|
+
const A = tt.current, I = a.current, D = typeof I?.handleWheelZoom == "function", Z = typeof I?.zoomBy == "function";
|
|
3036
2950
|
if (!A || !D && !Z) return;
|
|
3037
2951
|
b.preventDefault(), b.stopPropagation();
|
|
3038
|
-
const
|
|
3039
|
-
D ?
|
|
2952
|
+
const wt = A.getBoundingClientRect(), st = b.clientX - wt.left, yt = b.clientY - wt.top;
|
|
2953
|
+
D ? I.handleWheelZoom?.(b.deltaY, st, yt) : I.zoomBy?.(b.deltaY < 0 ? ps : ys, st, yt), X();
|
|
3040
2954
|
}
|
|
3041
2955
|
}
|
|
3042
2956
|
);
|
|
@@ -3050,7 +2964,7 @@ function pe() {
|
|
|
3050
2964
|
}
|
|
3051
2965
|
function iu({ tool: e = "cursor", stampOptions: t, brushOptions: n, fillColor: r, areaTooltip: i, onComplete: o, onPatchComplete: s, onBrushTap: a }) {
|
|
3052
2966
|
const { source: l, rendererRef: c, rendererSerial: f, setInteractionLock: u } = pe(), h = e !== "cursor";
|
|
3053
|
-
|
|
2967
|
+
z(() => (u("drawing-layer", h), () => u("drawing-layer", !1)), [h, u]);
|
|
3054
2968
|
const d = at(() => c.current?.getViewState(), [f]);
|
|
3055
2969
|
return l ? /* @__PURE__ */ Qt(
|
|
3056
2970
|
ia,
|
|
@@ -3293,10 +3207,10 @@ class ha {
|
|
|
3293
3207
|
if (!u || !h || !d || !m || !g || !y || !p || !x || !E || !w || !P || !R || !B)
|
|
3294
3208
|
throw new Error("Failed to resolve heatmap WebGL uniforms.");
|
|
3295
3209
|
this.uAccumResolution = u, this.uAccumPointSize = h, this.uAccumCoreRatio = d, this.uAccumPointAlpha = m, this.uColorAccumTexture = g, this.uColorGradientTexture = y, this.uColorOpacity = p, this.uColorCutoff = x, this.uColorGain = E, this.uColorGamma = w, this.uColorBias = P, this.uColorStretch = R, this.uColorResolution = B, t.bindVertexArray(this.accumVao), t.bindBuffer(t.ARRAY_BUFFER, this.pointBuffer), t.bufferData(t.ARRAY_BUFFER, 0, t.DYNAMIC_DRAW);
|
|
3296
|
-
const
|
|
3297
|
-
if (
|
|
3210
|
+
const N = t.getAttribLocation(this.accumProgram, "aCenter"), Y = t.getAttribLocation(this.accumProgram, "aWeight");
|
|
3211
|
+
if (N < 0 || Y < 0)
|
|
3298
3212
|
throw new Error("Failed to resolve heatmap WebGL attributes.");
|
|
3299
|
-
t.enableVertexAttribArray(
|
|
3213
|
+
t.enableVertexAttribArray(N), t.vertexAttribPointer(N, 2, t.FLOAT, !1, 12, 0), t.enableVertexAttribArray(Y), t.vertexAttribPointer(Y, 1, t.FLOAT, !1, 12, 8), t.bindVertexArray(null), t.bindVertexArray(this.colorVao), t.bindBuffer(t.ARRAY_BUFFER, this.quadBuffer), t.bufferData(t.ARRAY_BUFFER, new Float32Array([
|
|
3300
3214
|
-1,
|
|
3301
3215
|
-1,
|
|
3302
3216
|
1,
|
|
@@ -3707,28 +3621,28 @@ function Fr(e) {
|
|
|
3707
3621
|
if (!w || !P)
|
|
3708
3622
|
return 0;
|
|
3709
3623
|
const R = a.kernelRadiusPx + a.blurRadiusPx, B = Ia(f);
|
|
3710
|
-
let
|
|
3624
|
+
let N = 0;
|
|
3711
3625
|
for (let M = 0; M < c.length; M += 1) {
|
|
3712
|
-
const
|
|
3713
|
-
if (!Na(
|
|
3714
|
-
const
|
|
3715
|
-
if (!Number.isFinite(
|
|
3716
|
-
const W = r.worldToScreen(
|
|
3626
|
+
const T = c[M];
|
|
3627
|
+
if (!Na(T, f)) continue;
|
|
3628
|
+
const O = l.xs[T], v = l.ys[T];
|
|
3629
|
+
if (!Number.isFinite(O) || !Number.isFinite(v)) continue;
|
|
3630
|
+
const W = r.worldToScreen(O, v);
|
|
3717
3631
|
if (!Array.isArray(W) || W.length < 2) continue;
|
|
3718
|
-
const
|
|
3719
|
-
if (!Number.isFinite(
|
|
3720
|
-
const
|
|
3721
|
-
if (
|
|
3632
|
+
const J = Number(W[0]), F = Number(W[1]);
|
|
3633
|
+
if (!Number.isFinite(J) || !Number.isFinite(F)) continue;
|
|
3634
|
+
const xt = J * a.rasterScaleX, ft = F * a.rasterScaleY;
|
|
3635
|
+
if (xt < -R || ft < -R || xt > a.rasterWidth + R || ft > a.rasterHeight + R)
|
|
3722
3636
|
continue;
|
|
3723
|
-
const
|
|
3724
|
-
w[
|
|
3637
|
+
const tt = N * 2;
|
|
3638
|
+
w[tt] = xt, w[tt + 1] = ft, P[N] = Math.max(0, (l.ws[T] ?? 0) * B), N += 1;
|
|
3725
3639
|
}
|
|
3726
|
-
return
|
|
3640
|
+
return N <= 0 || !x.render({
|
|
3727
3641
|
width: a.rasterWidth,
|
|
3728
3642
|
height: a.rasterHeight,
|
|
3729
3643
|
positions: w,
|
|
3730
3644
|
weights: P,
|
|
3731
|
-
count:
|
|
3645
|
+
count: N,
|
|
3732
3646
|
kernelRadiusPx: a.kernelRadiusPx,
|
|
3733
3647
|
blurRadiusPx: a.blurRadiusPx,
|
|
3734
3648
|
pointAlpha: h,
|
|
@@ -3739,7 +3653,7 @@ function Fr(e) {
|
|
|
3739
3653
|
gamma: Li(g),
|
|
3740
3654
|
bias: Di(g),
|
|
3741
3655
|
stretch: Ni(g, a.rawZoom, i)
|
|
3742
|
-
}) ? 0 : (t.save(), p.length > 0 && Ba(t, r, p), y && (t.fillStyle = y, t.fillRect(0, 0, o, s)), t.globalAlpha = 1, t.imageSmoothingEnabled = !0, t.drawImage(x.canvas, 0, 0, a.rasterWidth, a.rasterHeight, 0, 0, o, s), t.restore(),
|
|
3656
|
+
}) ? 0 : (t.save(), p.length > 0 && Ba(t, r, p), y && (t.fillStyle = y, t.fillRect(0, 0, o, s)), t.globalAlpha = 1, t.imageSmoothingEnabled = !0, t.drawImage(x.canvas, 0, 0, a.rasterWidth, a.rasterHeight, 0, 0, o, s), t.restore(), N);
|
|
3743
3657
|
}
|
|
3744
3658
|
function ka(e) {
|
|
3745
3659
|
const { ctx: t, runtime: n, renderer: r, source: i, logicalWidth: o, logicalHeight: s, state: a } = e, l = Wi(n, a.data, a.clipPolygons, a.clipKey, i);
|
|
@@ -3877,8 +3791,8 @@ function ou({
|
|
|
3877
3791
|
onStats: m
|
|
3878
3792
|
}) {
|
|
3879
3793
|
const { rendererRef: g, source: y, registerDrawCallback: p, unregisterDrawCallback: x, requestOverlayRedraw: E } = pe(), w = at(() => {
|
|
3880
|
-
const
|
|
3881
|
-
return ge(
|
|
3794
|
+
const N = (u ?? []).map((Y) => Ce(Y?.coordinates)).filter((Y) => Y != null);
|
|
3795
|
+
return ge(N);
|
|
3882
3796
|
}, [u]), P = at(() => Bi(w), [w]), R = q({
|
|
3883
3797
|
sourceData: null,
|
|
3884
3798
|
fixedState: null,
|
|
@@ -3926,44 +3840,44 @@ function ou({
|
|
|
3926
3840
|
clipKey: P,
|
|
3927
3841
|
maxRenderedPoints: Math.max(Mn, Math.floor(d)),
|
|
3928
3842
|
onStats: m
|
|
3929
|
-
},
|
|
3930
|
-
const
|
|
3931
|
-
if (!
|
|
3932
|
-
const
|
|
3933
|
-
if (!
|
|
3934
|
-
|
|
3935
|
-
sourceData:
|
|
3843
|
+
}, z(() => (p(Tr, h, (Y, M, T) => {
|
|
3844
|
+
const O = B.current, v = R.current, W = g.current;
|
|
3845
|
+
if (!O.visible || !O.data || !W || !y) return;
|
|
3846
|
+
const J = Wi(v, O.data, O.clipPolygons, O.clipKey, y);
|
|
3847
|
+
if (!J) return;
|
|
3848
|
+
O.scaleMode === "fixed-zoom" && (!v.fixedState || !Vn(v.fixedState, O.data, O.clipKey) || O.fixedZoom !== void 0 && Math.abs(v.fixedState.referenceZoom - O.fixedZoom) > 1e-6) ? v.fixedState = Ua({
|
|
3849
|
+
sourceData: J,
|
|
3936
3850
|
renderer: W,
|
|
3937
3851
|
source: y,
|
|
3938
3852
|
logicalWidth: M,
|
|
3939
|
-
logicalHeight:
|
|
3940
|
-
radius:
|
|
3941
|
-
blur:
|
|
3942
|
-
fixedZoom:
|
|
3943
|
-
zoomThreshold:
|
|
3944
|
-
densityContrast:
|
|
3945
|
-
maxRenderedPoints:
|
|
3946
|
-
}) :
|
|
3947
|
-
const
|
|
3853
|
+
logicalHeight: T,
|
|
3854
|
+
radius: O.radius,
|
|
3855
|
+
blur: O.blur,
|
|
3856
|
+
fixedZoom: O.fixedZoom,
|
|
3857
|
+
zoomThreshold: O.zoomThreshold,
|
|
3858
|
+
densityContrast: O.densityContrast,
|
|
3859
|
+
maxRenderedPoints: O.maxRenderedPoints
|
|
3860
|
+
}) : O.scaleMode !== "fixed-zoom" && (v.fixedState = null);
|
|
3861
|
+
const xt = performance.now(), ft = ka({
|
|
3948
3862
|
ctx: Y,
|
|
3949
|
-
runtime:
|
|
3863
|
+
runtime: v,
|
|
3950
3864
|
renderer: W,
|
|
3951
3865
|
source: y,
|
|
3952
3866
|
logicalWidth: M,
|
|
3953
|
-
logicalHeight:
|
|
3954
|
-
state:
|
|
3867
|
+
logicalHeight: T,
|
|
3868
|
+
state: O
|
|
3955
3869
|
});
|
|
3956
|
-
!
|
|
3957
|
-
...
|
|
3958
|
-
renderTimeMs: performance.now() -
|
|
3870
|
+
!ft || !O.onStats || O.onStats({
|
|
3871
|
+
...ft,
|
|
3872
|
+
renderTimeMs: performance.now() - xt
|
|
3959
3873
|
});
|
|
3960
3874
|
}), () => {
|
|
3961
3875
|
x(Tr), R.current.sourceData = null, R.current.fixedState = null, R.current.screenLevelIndex = -1, R.current.screenSecondaryLevelIndex = -1, R.current.screenSecondaryLevelWeight = 0, R.current.screenPointAlpha = 0, R.current.screenNormalizationMaxWeight = 1, R.current.screenVisibilityStrength = 1, R.current.webgl?.destroy(), R.current.webgl = void 0, R.current.webglPositions = null, R.current.webglWeights = null, R.current.webglCapacity = 0;
|
|
3962
|
-
}), [p, x, g, y, h]),
|
|
3876
|
+
}), [p, x, g, y, h]), z(() => {
|
|
3963
3877
|
R.current.sourceData = null, R.current.fixedState = null, R.current.screenLevelIndex = -1, R.current.screenSecondaryLevelIndex = -1, R.current.screenSecondaryLevelWeight = 0, R.current.screenPointAlpha = 0, R.current.screenNormalizationMaxWeight = 1, R.current.screenVisibilityStrength = 1, E();
|
|
3964
|
-
}, [e?.positions, e?.weights, e?.count, P, E]),
|
|
3878
|
+
}, [e?.positions, e?.weights, e?.count, P, E]), z(() => {
|
|
3965
3879
|
R.current.fixedState = null, R.current.screenSecondaryLevelIndex = -1, R.current.screenSecondaryLevelWeight = 0, R.current.screenPointAlpha = 0, R.current.screenNormalizationMaxWeight = 1, R.current.screenVisibilityStrength = 1, E();
|
|
3966
|
-
}, [r, i, a, l, c, f, d, E]),
|
|
3880
|
+
}, [r, i, a, l, c, f, d, E]), z(() => {
|
|
3967
3881
|
E();
|
|
3968
3882
|
}, [t, n, o, s, E]), null;
|
|
3969
3883
|
}
|
|
@@ -4001,7 +3915,7 @@ function au({ shapes: e }) {
|
|
|
4001
3915
|
},
|
|
4002
3916
|
[]
|
|
4003
3917
|
), l = q({ shapes: e, worldToScreenPoints: a, source: r });
|
|
4004
|
-
return l.current = { shapes: e, worldToScreenPoints: a, source: r },
|
|
3918
|
+
return l.current = { shapes: e, worldToScreenPoints: a, source: r }, z(() => (i(Lr, 30, (f) => {
|
|
4005
3919
|
const { shapes: u, worldToScreenPoints: h, source: d } = l.current;
|
|
4006
3920
|
if (!Array.isArray(u) || u.length === 0 || !d) return;
|
|
4007
3921
|
const m = h(
|
|
@@ -4019,7 +3933,7 @@ function au({ shapes: e }) {
|
|
|
4019
3933
|
worldToScreenPoints: h,
|
|
4020
3934
|
baseStrokeStyle: jt
|
|
4021
3935
|
});
|
|
4022
|
-
}), () => o(Lr)), [i, o]),
|
|
3936
|
+
}), () => o(Lr)), [i, o]), z(() => {
|
|
4023
3937
|
s();
|
|
4024
3938
|
}, [n, e, r, s]), null;
|
|
4025
3939
|
}
|
|
@@ -4250,7 +4164,7 @@ function uu({ source: e, projectorRef: t, authToken: n = "", options: r, invalid
|
|
|
4250
4164
|
const a = q(null), l = q(null), c = q(null), f = q({
|
|
4251
4165
|
active: !1,
|
|
4252
4166
|
pointerId: null
|
|
4253
|
-
}), u = q(null), h = q(!1), d = he(r?.width, Xt.width, 64), m = he(r?.height, Xt.height, 48), g = he(r?.margin, Xt.margin, 0), y = he(r?.borderRadius, Xt.borderRadius, 0), p = he(r?.borderWidth, Xt.borderWidth, 0), x = Math.max(1, Math.round(he(r?.maxThumbnailTiles, Xt.maxThumbnailTiles, 1))), E = r?.backgroundColor || Xt.backgroundColor, w = r?.borderColor || Xt.borderColor, P = r?.viewportBorderColor || Xt.viewportBorderColor, R = r?.viewportBorderStyle === "stroke" || r?.viewportBorderStyle === "dash" ? r.viewportBorderStyle : Xt.viewportBorderStyle, B = r?.viewportFillColor ?? Xt.viewportFillColor,
|
|
4167
|
+
}), u = q(null), h = q(!1), d = he(r?.width, Xt.width, 64), m = he(r?.height, Xt.height, 48), g = he(r?.margin, Xt.margin, 0), y = he(r?.borderRadius, Xt.borderRadius, 0), p = he(r?.borderWidth, Xt.borderWidth, 0), x = Math.max(1, Math.round(he(r?.maxThumbnailTiles, Xt.maxThumbnailTiles, 1))), E = r?.backgroundColor || Xt.backgroundColor, w = r?.borderColor || Xt.borderColor, P = r?.viewportBorderColor || Xt.viewportBorderColor, R = r?.viewportBorderStyle === "stroke" || r?.viewportBorderStyle === "dash" ? r.viewportBorderStyle : Xt.viewportBorderStyle, B = r?.viewportFillColor ?? Xt.viewportFillColor, N = r?.interactive ?? Xt.interactive, Y = r?.showThumbnail ?? Xt.showThumbnail, M = r?.position || Xt.position, T = r?.onClose, O = r?.closeIcon, v = r?.closeButtonStyle, W = at(() => {
|
|
4254
4168
|
const L = {};
|
|
4255
4169
|
return M === "top-left" || M === "bottom-left" ? L.left = g : L.right = g, M === "top-left" || M === "top-right" ? L.top = g : L.bottom = g, {
|
|
4256
4170
|
position: "absolute",
|
|
@@ -4260,173 +4174,173 @@ function uu({ source: e, projectorRef: t, authToken: n = "", options: r, invalid
|
|
|
4260
4174
|
borderRadius: y,
|
|
4261
4175
|
overflow: "hidden",
|
|
4262
4176
|
zIndex: 4,
|
|
4263
|
-
pointerEvents:
|
|
4177
|
+
pointerEvents: N ? "auto" : "none",
|
|
4264
4178
|
touchAction: "none",
|
|
4265
4179
|
boxShadow: "0 10px 22px rgba(0, 0, 0, 0.3)",
|
|
4266
4180
|
...s
|
|
4267
4181
|
};
|
|
4268
|
-
}, [g, M, d, m, y,
|
|
4182
|
+
}, [g, M, d, m, y, N, s]), J = V(() => {
|
|
4269
4183
|
const L = a.current;
|
|
4270
4184
|
if (!L) return;
|
|
4271
|
-
const
|
|
4272
|
-
if (!
|
|
4273
|
-
const
|
|
4274
|
-
(L.width !==
|
|
4275
|
-
const
|
|
4276
|
-
|
|
4277
|
-
const
|
|
4278
|
-
xe(
|
|
4279
|
-
const
|
|
4280
|
-
if (
|
|
4281
|
-
const
|
|
4185
|
+
const C = L.getContext("2d");
|
|
4186
|
+
if (!C) return;
|
|
4187
|
+
const U = d, lt = m, dt = Math.max(1, window.devicePixelRatio || 1), j = Math.max(1, Math.round(U * dt)), ht = Math.max(1, Math.round(lt * dt));
|
|
4188
|
+
(L.width !== j || L.height !== ht) && (L.width = j, L.height = ht), C.setTransform(1, 0, 0, 1, 0, 0), C.clearRect(0, 0, L.width, L.height), C.setTransform(dt, 0, 0, dt, 0, 0), C.fillStyle = E, C.fillRect(0, 0, U, lt);
|
|
4189
|
+
const rt = t.current, Dt = Tn(rt?.getInitialRotationDeg?.()), Rt = Wr(e.width, e.height, U, lt, Dt), { contentX: mt, contentY: At, contentWidth: nt, contentHeight: ct, metrics: gt } = Rt, ut = l.current;
|
|
4190
|
+
ut && (C.save(), C.beginPath(), C.rect(mt, At, nt, ct), C.clip(), C.translate(mt, At), C.scale(nt / gt.width, ct / gt.height), C.transform(gt.cos, -gt.sin, gt.sin, gt.cos, gt.translateX - gt.minX, gt.translateY - gt.minY), C.drawImage(ut, 0, 0, e.width, e.height), C.restore()), C.strokeStyle = w, C.lineWidth = p, C.strokeRect(p * 0.5, p * 0.5, U - p, lt - p);
|
|
4191
|
+
const it = rt?.getViewBounds?.(), vt = rt?.getViewCorners?.(), Et = Array.isArray(vt) && vt.length >= 4 && vt.every((Q) => Array.isArray(Q) && Q.length >= 2 && Number.isFinite(Q[0]) && Number.isFinite(Q[1])) ? vt : null, G = xe(it) ? it : xe(c.current) ? c.current : null;
|
|
4192
|
+
xe(it) && (c.current = it);
|
|
4193
|
+
const K = R === "dash";
|
|
4194
|
+
if (Et) {
|
|
4195
|
+
const Q = Et.map((X) => Yr(X[0], X[1], Rt)), Mt = Or(Q, mt, At, mt + nt, At + ct);
|
|
4282
4196
|
if (Mt.length >= 3) {
|
|
4283
|
-
|
|
4197
|
+
C.beginPath();
|
|
4284
4198
|
for (let X = 0; X < Mt.length; X += 1)
|
|
4285
|
-
X === 0 ?
|
|
4286
|
-
|
|
4199
|
+
X === 0 ? C.moveTo(Mt[X][0], Mt[X][1]) : C.lineTo(Mt[X][0], Mt[X][1]);
|
|
4200
|
+
C.closePath(), C.fillStyle = B, C.fill(), C.strokeStyle = P, C.lineWidth = 2.25, K ? Nr(C, Mt, 4, 3) : C.stroke();
|
|
4287
4201
|
return;
|
|
4288
4202
|
}
|
|
4289
4203
|
}
|
|
4290
4204
|
if (!G)
|
|
4291
4205
|
return;
|
|
4292
|
-
const
|
|
4293
|
-
if (!(
|
|
4294
|
-
|
|
4295
|
-
for (let
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
}
|
|
4299
|
-
}, [d, m, E, w, p, t, e.width, e.height, B, P, R]),
|
|
4206
|
+
const St = Ga(G).map((Q) => Yr(Q[0], Q[1], Rt)), et = Or(St, mt, At, mt + nt, At + ct);
|
|
4207
|
+
if (!(et.length < 3)) {
|
|
4208
|
+
C.beginPath();
|
|
4209
|
+
for (let Q = 0; Q < et.length; Q += 1)
|
|
4210
|
+
Q === 0 ? C.moveTo(et[Q][0], et[Q][1]) : C.lineTo(et[Q][0], et[Q][1]);
|
|
4211
|
+
C.closePath(), C.fillStyle = B, C.fill(), C.strokeStyle = P, C.lineWidth = 2.25, K ? Nr(C, et, 4, 3) : C.stroke();
|
|
4212
|
+
}
|
|
4213
|
+
}, [d, m, E, w, p, t, e.width, e.height, B, P, R]), F = V(() => {
|
|
4300
4214
|
h.current || (h.current = !0, u.current = requestAnimationFrame(() => {
|
|
4301
|
-
h.current = !1, u.current = null,
|
|
4215
|
+
h.current = !1, u.current = null, J();
|
|
4302
4216
|
}));
|
|
4303
|
-
}, [
|
|
4304
|
-
(L,
|
|
4305
|
-
const
|
|
4306
|
-
if (!
|
|
4307
|
-
const lt =
|
|
4217
|
+
}, [J]), xt = V(
|
|
4218
|
+
(L, C) => {
|
|
4219
|
+
const U = a.current;
|
|
4220
|
+
if (!U) return null;
|
|
4221
|
+
const lt = U.getBoundingClientRect();
|
|
4308
4222
|
if (!lt.width || !lt.height) return null;
|
|
4309
|
-
const
|
|
4310
|
-
return Va(ct *
|
|
4223
|
+
const dt = t.current, j = Tn(dt?.getInitialRotationDeg?.()), ht = Wr(e.width, e.height, d, m, j), rt = lt.width / d, Dt = lt.height / m, Rt = ht.contentX * rt, mt = ht.contentY * Dt, At = ht.contentWidth * rt, nt = ht.contentHeight * Dt, ct = _((L - lt.left - Rt) / At, 0, 1), gt = _((C - lt.top - mt) / nt, 0, 1);
|
|
4224
|
+
return Va(ct * ht.metrics.width, gt * ht.metrics.height, ht, e.width, e.height);
|
|
4311
4225
|
},
|
|
4312
4226
|
[t, e.width, e.height, d, m]
|
|
4313
|
-
),
|
|
4314
|
-
(L,
|
|
4315
|
-
const
|
|
4316
|
-
if (!
|
|
4317
|
-
if (
|
|
4318
|
-
|
|
4227
|
+
), ft = V(
|
|
4228
|
+
(L, C) => {
|
|
4229
|
+
const U = t.current;
|
|
4230
|
+
if (!U) return;
|
|
4231
|
+
if (U.setViewCenter) {
|
|
4232
|
+
U.setViewCenter(L, C), F();
|
|
4319
4233
|
return;
|
|
4320
4234
|
}
|
|
4321
|
-
const lt =
|
|
4322
|
-
if (
|
|
4323
|
-
const
|
|
4324
|
-
|
|
4325
|
-
offsetX: L -
|
|
4326
|
-
offsetY:
|
|
4327
|
-
}),
|
|
4235
|
+
const lt = U.getViewBounds?.(), dt = xe(lt) ? lt : xe(c.current) ? c.current : null;
|
|
4236
|
+
if (!dt) return;
|
|
4237
|
+
const j = Math.max(1e-6, dt[2] - dt[0]), ht = Math.max(1e-6, dt[3] - dt[1]);
|
|
4238
|
+
U.setViewState({
|
|
4239
|
+
offsetX: L - j * 0.5,
|
|
4240
|
+
offsetY: C - ht * 0.5
|
|
4241
|
+
}), F();
|
|
4328
4242
|
},
|
|
4329
|
-
[t,
|
|
4330
|
-
),
|
|
4243
|
+
[t, F]
|
|
4244
|
+
), tt = V(
|
|
4331
4245
|
(L) => {
|
|
4332
|
-
if (!
|
|
4333
|
-
const
|
|
4334
|
-
if (!
|
|
4335
|
-
const
|
|
4336
|
-
|
|
4246
|
+
if (!N || L.button !== 0) return;
|
|
4247
|
+
const C = a.current;
|
|
4248
|
+
if (!C) return;
|
|
4249
|
+
const U = xt(L.clientX, L.clientY);
|
|
4250
|
+
U && (L.preventDefault(), L.stopPropagation(), C.setPointerCapture(L.pointerId), f.current = { active: !0, pointerId: L.pointerId }, ft(U[0], U[1]));
|
|
4337
4251
|
},
|
|
4338
|
-
[
|
|
4252
|
+
[N, xt, ft]
|
|
4339
4253
|
), _t = V(
|
|
4340
4254
|
(L) => {
|
|
4341
|
-
const
|
|
4342
|
-
if (!
|
|
4343
|
-
const
|
|
4344
|
-
|
|
4255
|
+
const C = f.current;
|
|
4256
|
+
if (!C.active || C.pointerId !== L.pointerId) return;
|
|
4257
|
+
const U = xt(L.clientX, L.clientY);
|
|
4258
|
+
U && (L.preventDefault(), L.stopPropagation(), ft(U[0], U[1]));
|
|
4345
4259
|
},
|
|
4346
|
-
[
|
|
4260
|
+
[xt, ft]
|
|
4347
4261
|
), Ct = V(
|
|
4348
4262
|
(L) => {
|
|
4349
|
-
const
|
|
4350
|
-
if (!
|
|
4351
|
-
const
|
|
4352
|
-
if (
|
|
4263
|
+
const C = f.current;
|
|
4264
|
+
if (!C.active || C.pointerId !== L.pointerId) return;
|
|
4265
|
+
const U = a.current;
|
|
4266
|
+
if (U && U.hasPointerCapture(L.pointerId))
|
|
4353
4267
|
try {
|
|
4354
|
-
|
|
4268
|
+
U.releasePointerCapture(L.pointerId);
|
|
4355
4269
|
} catch {
|
|
4356
4270
|
}
|
|
4357
|
-
f.current = { active: !1, pointerId: null },
|
|
4271
|
+
f.current = { active: !1, pointerId: null }, F();
|
|
4358
4272
|
},
|
|
4359
|
-
[
|
|
4273
|
+
[F]
|
|
4360
4274
|
);
|
|
4361
|
-
return
|
|
4275
|
+
return z(() => {
|
|
4362
4276
|
let L = !1;
|
|
4363
|
-
l.current = null,
|
|
4364
|
-
const
|
|
4365
|
-
if (!Y ||
|
|
4277
|
+
l.current = null, F();
|
|
4278
|
+
const C = 0, U = 2 ** (e.maxTierZoom - C), lt = Math.ceil(e.width / U), dt = Math.ceil(e.height / U), j = Math.max(1, Math.ceil(lt / e.tileSize)), ht = Math.max(1, Math.ceil(dt / e.tileSize)), rt = j * ht;
|
|
4279
|
+
if (!Y || rt > x)
|
|
4366
4280
|
return;
|
|
4367
|
-
const
|
|
4368
|
-
|
|
4369
|
-
const
|
|
4370
|
-
if (!
|
|
4281
|
+
const Dt = Math.min(d / Math.max(1, e.width), m / Math.max(1, e.height)), Rt = document.createElement("canvas");
|
|
4282
|
+
Rt.width = Math.max(1, Math.round(e.width * Dt)), Rt.height = Math.max(1, Math.round(e.height * Dt));
|
|
4283
|
+
const mt = Rt.getContext("2d");
|
|
4284
|
+
if (!mt)
|
|
4371
4285
|
return;
|
|
4372
|
-
|
|
4373
|
-
const
|
|
4374
|
-
for (let
|
|
4375
|
-
for (let ct = 0; ct <
|
|
4376
|
-
const
|
|
4377
|
-
|
|
4378
|
-
url: Xi(e,
|
|
4379
|
-
bounds: [
|
|
4286
|
+
mt.fillStyle = E, mt.fillRect(0, 0, Rt.width, Rt.height);
|
|
4287
|
+
const At = [];
|
|
4288
|
+
for (let nt = 0; nt < ht; nt += 1)
|
|
4289
|
+
for (let ct = 0; ct < j; ct += 1) {
|
|
4290
|
+
const gt = ct * e.tileSize * U, ut = nt * e.tileSize * U, it = Math.min((ct + 1) * e.tileSize, lt) * U, vt = Math.min((nt + 1) * e.tileSize, dt) * U;
|
|
4291
|
+
At.push({
|
|
4292
|
+
url: Xi(e, C, ct, nt),
|
|
4293
|
+
bounds: [gt, ut, it, vt]
|
|
4380
4294
|
});
|
|
4381
4295
|
}
|
|
4382
4296
|
return Promise.allSettled(
|
|
4383
|
-
|
|
4384
|
-
const ct = Wa(
|
|
4297
|
+
At.map(async (nt) => {
|
|
4298
|
+
const ct = Wa(nt.url, n), gt = await fetch(nt.url, {
|
|
4385
4299
|
headers: ct ? { Authorization: n } : void 0
|
|
4386
4300
|
});
|
|
4387
|
-
if (!
|
|
4388
|
-
throw new Error(`HTTP ${
|
|
4389
|
-
const
|
|
4390
|
-
return { tile:
|
|
4301
|
+
if (!gt.ok)
|
|
4302
|
+
throw new Error(`HTTP ${gt.status}`);
|
|
4303
|
+
const ut = await createImageBitmap(await gt.blob());
|
|
4304
|
+
return { tile: nt, bitmap: ut };
|
|
4391
4305
|
})
|
|
4392
|
-
).then((
|
|
4306
|
+
).then((nt) => {
|
|
4393
4307
|
if (L) {
|
|
4394
|
-
for (const
|
|
4395
|
-
|
|
4308
|
+
for (const ut of nt)
|
|
4309
|
+
ut.status === "fulfilled" && ut.value.bitmap.close();
|
|
4396
4310
|
return;
|
|
4397
4311
|
}
|
|
4398
|
-
const ct =
|
|
4399
|
-
for (const
|
|
4400
|
-
if (
|
|
4312
|
+
const ct = Rt.width / Math.max(1, e.width), gt = Rt.height / Math.max(1, e.height);
|
|
4313
|
+
for (const ut of nt) {
|
|
4314
|
+
if (ut.status !== "fulfilled") continue;
|
|
4401
4315
|
const {
|
|
4402
|
-
tile: { bounds:
|
|
4403
|
-
bitmap:
|
|
4404
|
-
} =
|
|
4405
|
-
|
|
4316
|
+
tile: { bounds: it },
|
|
4317
|
+
bitmap: vt
|
|
4318
|
+
} = ut.value, Et = it[0] * ct, G = it[1] * gt, K = Math.max(1, (it[2] - it[0]) * ct), St = Math.max(1, (it[3] - it[1]) * gt);
|
|
4319
|
+
mt.drawImage(vt, Et, G, K, St), vt.close();
|
|
4406
4320
|
}
|
|
4407
|
-
l.current =
|
|
4321
|
+
l.current = Rt, F();
|
|
4408
4322
|
}), () => {
|
|
4409
4323
|
L = !0;
|
|
4410
4324
|
};
|
|
4411
|
-
}, [e, n, E, d, m, Y, x,
|
|
4412
|
-
|
|
4413
|
-
}, [
|
|
4325
|
+
}, [e, n, E, d, m, Y, x, F]), z(() => {
|
|
4326
|
+
F();
|
|
4327
|
+
}, [F]), z(() => {
|
|
4414
4328
|
if (t.current) return;
|
|
4415
4329
|
let L = 0;
|
|
4416
|
-
const
|
|
4330
|
+
const C = () => {
|
|
4417
4331
|
if (t.current) {
|
|
4418
|
-
|
|
4332
|
+
F();
|
|
4419
4333
|
return;
|
|
4420
4334
|
}
|
|
4421
|
-
L = requestAnimationFrame(
|
|
4335
|
+
L = requestAnimationFrame(C);
|
|
4422
4336
|
};
|
|
4423
|
-
return L = requestAnimationFrame(
|
|
4424
|
-
}, [t,
|
|
4337
|
+
return L = requestAnimationFrame(C), () => cancelAnimationFrame(L);
|
|
4338
|
+
}, [t, F]), z(() => sn(() => F()), [F]), z(() => {
|
|
4425
4339
|
if (i)
|
|
4426
|
-
return i.current =
|
|
4427
|
-
i.current ===
|
|
4340
|
+
return i.current = F, () => {
|
|
4341
|
+
i.current === F && (i.current = null);
|
|
4428
4342
|
};
|
|
4429
|
-
}, [i,
|
|
4343
|
+
}, [i, F]), z(
|
|
4430
4344
|
() => () => {
|
|
4431
4345
|
f.current = { active: !1, pointerId: null }, u.current !== null && (cancelAnimationFrame(u.current), u.current = null), h.current = !1;
|
|
4432
4346
|
},
|
|
@@ -4442,7 +4356,7 @@ function uu({ source: e, projectorRef: t, authToken: n = "", options: r, invalid
|
|
|
4442
4356
|
display: "block",
|
|
4443
4357
|
borderRadius: "inherit"
|
|
4444
4358
|
},
|
|
4445
|
-
onPointerDown:
|
|
4359
|
+
onPointerDown: tt,
|
|
4446
4360
|
onPointerMove: _t,
|
|
4447
4361
|
onPointerUp: Ct,
|
|
4448
4362
|
onPointerCancel: Ct,
|
|
@@ -4454,16 +4368,16 @@ function uu({ source: e, projectorRef: t, authToken: n = "", options: r, invalid
|
|
|
4454
4368
|
}
|
|
4455
4369
|
}
|
|
4456
4370
|
),
|
|
4457
|
-
|
|
4371
|
+
T && /* @__PURE__ */ Qt(
|
|
4458
4372
|
"button",
|
|
4459
4373
|
{
|
|
4460
4374
|
type: "button",
|
|
4461
4375
|
"aria-label": "Hide overview map",
|
|
4462
4376
|
onClick: (L) => {
|
|
4463
|
-
L.stopPropagation(),
|
|
4377
|
+
L.stopPropagation(), T();
|
|
4464
4378
|
},
|
|
4465
|
-
style:
|
|
4466
|
-
children:
|
|
4379
|
+
style: v ? { ...v } : { ...Za },
|
|
4380
|
+
children: O ?? "×"
|
|
4467
4381
|
}
|
|
4468
4382
|
)
|
|
4469
4383
|
] });
|
|
@@ -4491,7 +4405,7 @@ function fu({ regions: e, strokeStyle: t }) {
|
|
|
4491
4405
|
},
|
|
4492
4406
|
[]
|
|
4493
4407
|
), f = q({ prepared: l, resolvedStrokeStyle: a, worldToScreenPoints: c });
|
|
4494
|
-
return f.current = { prepared: l, resolvedStrokeStyle: a, worldToScreenPoints: c },
|
|
4408
|
+
return f.current = { prepared: l, resolvedStrokeStyle: a, worldToScreenPoints: c }, z(() => (r(Xr, 20, (h) => {
|
|
4495
4409
|
const { prepared: d, resolvedStrokeStyle: m, worldToScreenPoints: g } = f.current;
|
|
4496
4410
|
for (const y of d)
|
|
4497
4411
|
for (const p of y.polygons) {
|
|
@@ -4502,7 +4416,7 @@ function fu({ regions: e, strokeStyle: t }) {
|
|
|
4502
4416
|
w.length >= 4 && Wt(h, w, m, !0, !1);
|
|
4503
4417
|
}
|
|
4504
4418
|
}
|
|
4505
|
-
}), () => i(Xr)), [r, i]),
|
|
4419
|
+
}), () => i(Xr)), [r, i]), z(() => {
|
|
4506
4420
|
o();
|
|
4507
4421
|
}, [l, a, o]), null;
|
|
4508
4422
|
}
|
|
@@ -4725,13 +4639,13 @@ async function nl(e, t, n) {
|
|
|
4725
4639
|
}
|
|
4726
4640
|
}
|
|
4727
4641
|
async function rl(e, t, n = {}) {
|
|
4728
|
-
const r =
|
|
4642
|
+
const r = Pt(), i = n.bridgeToDraw === !0;
|
|
4729
4643
|
if (!e || !e.count || !e.positions || !e.paletteIndices)
|
|
4730
4644
|
return {
|
|
4731
4645
|
data: null,
|
|
4732
4646
|
meta: {
|
|
4733
4647
|
mode: "hybrid-webgpu",
|
|
4734
|
-
durationMs:
|
|
4648
|
+
durationMs: Pt() - r,
|
|
4735
4649
|
usedWebGpu: !1,
|
|
4736
4650
|
candidateCount: 0,
|
|
4737
4651
|
bridgedToDraw: !1
|
|
@@ -4748,7 +4662,7 @@ async function rl(e, t, n = {}) {
|
|
|
4748
4662
|
data: w,
|
|
4749
4663
|
meta: {
|
|
4750
4664
|
mode: "hybrid-webgpu",
|
|
4751
|
-
durationMs:
|
|
4665
|
+
durationMs: Pt() - r,
|
|
4752
4666
|
usedWebGpu: !1,
|
|
4753
4667
|
candidateCount: 0,
|
|
4754
4668
|
bridgedToDraw: !1
|
|
@@ -4766,7 +4680,7 @@ async function rl(e, t, n = {}) {
|
|
|
4766
4680
|
data: w,
|
|
4767
4681
|
meta: {
|
|
4768
4682
|
mode: "hybrid-webgpu",
|
|
4769
|
-
durationMs:
|
|
4683
|
+
durationMs: Pt() - r,
|
|
4770
4684
|
usedWebGpu: !1,
|
|
4771
4685
|
candidateCount: 0,
|
|
4772
4686
|
bridgedToDraw: !1
|
|
@@ -4789,7 +4703,7 @@ async function rl(e, t, n = {}) {
|
|
|
4789
4703
|
data: nn(e, t),
|
|
4790
4704
|
meta: {
|
|
4791
4705
|
mode: "hybrid-webgpu",
|
|
4792
|
-
durationMs:
|
|
4706
|
+
durationMs: Pt() - r,
|
|
4793
4707
|
usedWebGpu: !1,
|
|
4794
4708
|
candidateCount: s,
|
|
4795
4709
|
bridgedToDraw: !1
|
|
@@ -4816,7 +4730,7 @@ async function rl(e, t, n = {}) {
|
|
|
4816
4730
|
data: P,
|
|
4817
4731
|
meta: {
|
|
4818
4732
|
mode: "hybrid-webgpu",
|
|
4819
|
-
durationMs:
|
|
4733
|
+
durationMs: Pt() - r,
|
|
4820
4734
|
usedWebGpu: !0,
|
|
4821
4735
|
candidateCount: 0,
|
|
4822
4736
|
bridgedToDraw: !0
|
|
@@ -4832,7 +4746,7 @@ async function rl(e, t, n = {}) {
|
|
|
4832
4746
|
data: w,
|
|
4833
4747
|
meta: {
|
|
4834
4748
|
mode: "hybrid-webgpu",
|
|
4835
|
-
durationMs:
|
|
4749
|
+
durationMs: Pt() - r,
|
|
4836
4750
|
usedWebGpu: !0,
|
|
4837
4751
|
candidateCount: 0,
|
|
4838
4752
|
bridgedToDraw: !1
|
|
@@ -4843,8 +4757,8 @@ async function rl(e, t, n = {}) {
|
|
|
4843
4757
|
const w = new Uint32Array(h);
|
|
4844
4758
|
let P = 0;
|
|
4845
4759
|
for (let B = 0; B < h; B += 1) {
|
|
4846
|
-
const
|
|
4847
|
-
Re(Y, M, o) && (w[P] =
|
|
4760
|
+
const N = d[B] ?? 0, Y = e.positions[N * 2], M = e.positions[N * 2 + 1];
|
|
4761
|
+
Re(Y, M, o) && (w[P] = N, P += 1);
|
|
4848
4762
|
}
|
|
4849
4763
|
const R = {
|
|
4850
4764
|
count: s,
|
|
@@ -4856,7 +4770,7 @@ async function rl(e, t, n = {}) {
|
|
|
4856
4770
|
data: R,
|
|
4857
4771
|
meta: {
|
|
4858
4772
|
mode: "hybrid-webgpu",
|
|
4859
|
-
durationMs:
|
|
4773
|
+
durationMs: Pt() - r,
|
|
4860
4774
|
usedWebGpu: !0,
|
|
4861
4775
|
candidateCount: h,
|
|
4862
4776
|
bridgedToDraw: !0
|
|
@@ -4878,7 +4792,7 @@ async function rl(e, t, n = {}) {
|
|
|
4878
4792
|
data: E,
|
|
4879
4793
|
meta: {
|
|
4880
4794
|
mode: "hybrid-webgpu",
|
|
4881
|
-
durationMs:
|
|
4795
|
+
durationMs: Pt() - r,
|
|
4882
4796
|
usedWebGpu: !0,
|
|
4883
4797
|
candidateCount: h,
|
|
4884
4798
|
bridgedToDraw: !1
|
|
@@ -4956,7 +4870,7 @@ const Me = new Gi(
|
|
|
4956
4870
|
indices: c,
|
|
4957
4871
|
meta: {
|
|
4958
4872
|
mode: "worker",
|
|
4959
|
-
durationMs: Number.isFinite(e.durationMs) ? e.durationMs :
|
|
4873
|
+
durationMs: Number.isFinite(e.durationMs) ? e.durationMs : Pt() - t.startMs
|
|
4960
4874
|
}
|
|
4961
4875
|
});
|
|
4962
4876
|
return;
|
|
@@ -4974,7 +4888,7 @@ const Me = new Gi(
|
|
|
4974
4888
|
data: a,
|
|
4975
4889
|
meta: {
|
|
4976
4890
|
mode: "worker",
|
|
4977
|
-
durationMs: Number.isFinite(e.durationMs) ? e.durationMs :
|
|
4891
|
+
durationMs: Number.isFinite(e.durationMs) ? e.durationMs : Pt() - t.startMs
|
|
4978
4892
|
}
|
|
4979
4893
|
});
|
|
4980
4894
|
},
|
|
@@ -4994,7 +4908,7 @@ async function il(e, t) {
|
|
|
4994
4908
|
};
|
|
4995
4909
|
const n = ce(e), r = e.positions.slice(0, n * 2), i = e.paletteIndices.slice(0, n), o = e.fillModes instanceof Uint8Array && e.fillModes.length >= n ? e.fillModes.slice(0, n) : null, s = e.ids instanceof Uint32Array && e.ids.length >= n ? e.ids.slice(0, n) : null;
|
|
4996
4910
|
return new Promise((a, l) => {
|
|
4997
|
-
const c =
|
|
4911
|
+
const c = Pt(), f = Me.beginRequest({
|
|
4998
4912
|
kind: "data",
|
|
4999
4913
|
resolve: a,
|
|
5000
4914
|
reject: l,
|
|
@@ -5003,7 +4917,7 @@ async function il(e, t) {
|
|
|
5003
4917
|
if (!f) {
|
|
5004
4918
|
a({
|
|
5005
4919
|
data: nn(e, t),
|
|
5006
|
-
meta: { mode: "sync", durationMs:
|
|
4920
|
+
meta: { mode: "sync", durationMs: Pt() - c }
|
|
5007
4921
|
});
|
|
5008
4922
|
return;
|
|
5009
4923
|
}
|
|
@@ -5034,7 +4948,7 @@ async function mu(e, t) {
|
|
|
5034
4948
|
};
|
|
5035
4949
|
const n = ce(e), r = e.positions.slice(0, n * 2);
|
|
5036
4950
|
return new Promise((i, o) => {
|
|
5037
|
-
const s =
|
|
4951
|
+
const s = Pt(), a = Me.beginRequest({
|
|
5038
4952
|
kind: "index",
|
|
5039
4953
|
resolve: i,
|
|
5040
4954
|
reject: o,
|
|
@@ -5043,7 +4957,7 @@ async function mu(e, t) {
|
|
|
5043
4957
|
if (!a) {
|
|
5044
4958
|
i({
|
|
5045
4959
|
indices: Ha(e, t),
|
|
5046
|
-
meta: { mode: "sync", durationMs:
|
|
4960
|
+
meta: { mode: "sync", durationMs: Pt() - s }
|
|
5047
4961
|
});
|
|
5048
4962
|
return;
|
|
5049
4963
|
}
|
|
@@ -5072,7 +4986,7 @@ function sl(e, t, n, r, i) {
|
|
|
5072
4986
|
() => r.map((c) => Ce(c.coordinates)).filter((c) => c != null),
|
|
5073
4987
|
[r]
|
|
5074
4988
|
);
|
|
5075
|
-
return
|
|
4989
|
+
return z(() => {
|
|
5076
4990
|
const c = ++o.current;
|
|
5077
4991
|
let f = !1;
|
|
5078
4992
|
if (!e)
|
|
@@ -5181,14 +5095,14 @@ function hl(e) {
|
|
|
5181
5095
|
const s = ul(e.sourceWidth, e.sourceHeight, o), a = 1 / s, l = new Int32Array(o), c = new Int32Array(o);
|
|
5182
5096
|
let f = 0;
|
|
5183
5097
|
if (i)
|
|
5184
|
-
for (let
|
|
5185
|
-
const W = i[
|
|
5186
|
-
!Number.isFinite(
|
|
5098
|
+
for (let v = 0; v < o; v += 1) {
|
|
5099
|
+
const W = i[v], J = e.positions[W * 2], F = e.positions[W * 2 + 1];
|
|
5100
|
+
!Number.isFinite(J) || !Number.isFinite(F) || (l[f] = Math.floor(J * a), c[f] = Math.floor(F * a), f += 1);
|
|
5187
5101
|
}
|
|
5188
5102
|
else
|
|
5189
|
-
for (let
|
|
5190
|
-
const W = e.positions[
|
|
5191
|
-
!Number.isFinite(W) || !Number.isFinite(
|
|
5103
|
+
for (let v = 0; v < r; v += 1) {
|
|
5104
|
+
const W = e.positions[v * 2], J = e.positions[v * 2 + 1];
|
|
5105
|
+
!Number.isFinite(W) || !Number.isFinite(J) || (l[f] = Math.floor(W * a), c[f] = Math.floor(J * a), f += 1);
|
|
5192
5106
|
}
|
|
5193
5107
|
if (f === 0)
|
|
5194
5108
|
return null;
|
|
@@ -5200,77 +5114,77 @@ function hl(e) {
|
|
|
5200
5114
|
m.fill(2147483647);
|
|
5201
5115
|
let y = 0;
|
|
5202
5116
|
const p = new Int32Array(f);
|
|
5203
|
-
for (let
|
|
5204
|
-
const W = l[
|
|
5205
|
-
let
|
|
5117
|
+
for (let v = 0; v < f; v += 1) {
|
|
5118
|
+
const W = l[v], J = c[v];
|
|
5119
|
+
let F = be(W, J, d);
|
|
5206
5120
|
for (; ; ) {
|
|
5207
|
-
const
|
|
5208
|
-
if (
|
|
5209
|
-
if (m[
|
|
5210
|
-
const
|
|
5121
|
+
const xt = m[F * 2];
|
|
5122
|
+
if (xt === 2147483647) {
|
|
5123
|
+
if (m[F * 2] = W, m[F * 2 + 1] = J, g[F] = 1, p[v] = F, y += 1, y * 4 > h * 3) {
|
|
5124
|
+
const ft = h;
|
|
5211
5125
|
h <<= 1, d = h - 1;
|
|
5212
|
-
const
|
|
5213
|
-
|
|
5214
|
-
for (let Ct = 0; Ct <
|
|
5126
|
+
const tt = new Int32Array(h * 2), _t = new Int32Array(h);
|
|
5127
|
+
tt.fill(2147483647);
|
|
5128
|
+
for (let Ct = 0; Ct < ft; Ct += 1) {
|
|
5215
5129
|
if (m[Ct * 2] === 2147483647) continue;
|
|
5216
|
-
const L = m[Ct * 2],
|
|
5217
|
-
let
|
|
5218
|
-
for (;
|
|
5219
|
-
|
|
5130
|
+
const L = m[Ct * 2], C = m[Ct * 2 + 1];
|
|
5131
|
+
let U = be(L, C, d);
|
|
5132
|
+
for (; tt[U * 2] !== 2147483647; ) U = U + 1 & d;
|
|
5133
|
+
tt[U * 2] = L, tt[U * 2 + 1] = C, _t[U] = g[Ct];
|
|
5220
5134
|
}
|
|
5221
|
-
for (m =
|
|
5222
|
-
|
|
5223
|
-
p[
|
|
5135
|
+
for (m = tt, g = _t, F = be(W, J, d); m[F * 2] !== W || m[F * 2 + 1] !== J; )
|
|
5136
|
+
F = F + 1 & d;
|
|
5137
|
+
p[v] = F;
|
|
5224
5138
|
}
|
|
5225
5139
|
break;
|
|
5226
5140
|
}
|
|
5227
|
-
if (
|
|
5228
|
-
g[
|
|
5141
|
+
if (xt === W && m[F * 2 + 1] === J) {
|
|
5142
|
+
g[F] += 1, p[v] = F;
|
|
5229
5143
|
break;
|
|
5230
5144
|
}
|
|
5231
|
-
|
|
5145
|
+
F = F + 1 & d;
|
|
5232
5146
|
}
|
|
5233
5147
|
}
|
|
5234
5148
|
const x = new Int32Array(y * 2), E = new Uint32Array(y), w = new Uint32Array(y), P = new Int32Array(h);
|
|
5235
5149
|
P.fill(Ze);
|
|
5236
5150
|
let R = 0, B = 0;
|
|
5237
|
-
for (let
|
|
5238
|
-
m[
|
|
5239
|
-
const
|
|
5151
|
+
for (let v = 0; v < h; v += 1)
|
|
5152
|
+
m[v * 2] !== 2147483647 && (x[R * 2] = m[v * 2], x[R * 2 + 1] = m[v * 2 + 1], E[R] = B, w[R] = g[v], P[v] = R, B += g[v], R += 1);
|
|
5153
|
+
const N = new Uint32Array(f), Y = new Uint32Array(y);
|
|
5240
5154
|
if (Y.set(E), i)
|
|
5241
|
-
for (let
|
|
5242
|
-
const W = P[p[
|
|
5243
|
-
|
|
5155
|
+
for (let v = 0; v < f; v += 1) {
|
|
5156
|
+
const W = P[p[v]];
|
|
5157
|
+
N[Y[W]] = i[v], Y[W] += 1;
|
|
5244
5158
|
}
|
|
5245
5159
|
else {
|
|
5246
|
-
let
|
|
5160
|
+
let v = 0;
|
|
5247
5161
|
for (let W = 0; W < r; W += 1) {
|
|
5248
|
-
const
|
|
5249
|
-
if (!Number.isFinite(
|
|
5250
|
-
const
|
|
5251
|
-
|
|
5162
|
+
const J = e.positions[W * 2], F = e.positions[W * 2 + 1];
|
|
5163
|
+
if (!Number.isFinite(J) || !Number.isFinite(F)) continue;
|
|
5164
|
+
const xt = P[p[v]];
|
|
5165
|
+
N[Y[xt]] = W, Y[xt] += 1, v += 1;
|
|
5252
5166
|
}
|
|
5253
5167
|
}
|
|
5254
5168
|
let M = 1;
|
|
5255
5169
|
for (; M < y * 2; ) M <<= 1;
|
|
5256
|
-
const
|
|
5257
|
-
|
|
5258
|
-
for (let
|
|
5259
|
-
const W = x[
|
|
5260
|
-
let
|
|
5261
|
-
for (; F
|
|
5262
|
-
F
|
|
5170
|
+
const T = M - 1, O = new Int32Array(M);
|
|
5171
|
+
O.fill(Ze);
|
|
5172
|
+
for (let v = 0; v < y; v += 1) {
|
|
5173
|
+
const W = x[v * 2], J = x[v * 2 + 1];
|
|
5174
|
+
let F = be(W, J, T);
|
|
5175
|
+
for (; O[F] !== Ze; ) F = F + 1 & T;
|
|
5176
|
+
O[F] = v;
|
|
5263
5177
|
}
|
|
5264
5178
|
return {
|
|
5265
5179
|
cellSize: s,
|
|
5266
5180
|
safeCount: r,
|
|
5267
5181
|
cellCount: y,
|
|
5268
5182
|
hashCapacity: M,
|
|
5269
|
-
hashTable:
|
|
5183
|
+
hashTable: O,
|
|
5270
5184
|
cellKeys: x,
|
|
5271
5185
|
cellOffsets: E,
|
|
5272
5186
|
cellLengths: w,
|
|
5273
|
-
pointIndices:
|
|
5187
|
+
pointIndices: N
|
|
5274
5188
|
};
|
|
5275
5189
|
}
|
|
5276
5190
|
function dl(e, t, n) {
|
|
@@ -5383,7 +5297,7 @@ async function pl(e, t) {
|
|
|
5383
5297
|
const yl = 0.65, xl = 4;
|
|
5384
5298
|
function bl(e, t, n, r, i, o, s, a) {
|
|
5385
5299
|
const l = !!(n || r || i), [c, f] = ae(null), u = q(null), h = q(null);
|
|
5386
|
-
|
|
5300
|
+
z(() => {
|
|
5387
5301
|
if (!l || !e) {
|
|
5388
5302
|
f(null);
|
|
5389
5303
|
return;
|
|
@@ -5403,24 +5317,24 @@ function bl(e, t, n, r, i, o, s, a) {
|
|
|
5403
5317
|
if (!Number.isFinite(x) || !Number.isFinite(E)) return null;
|
|
5404
5318
|
const w = Math.max(1e-6, p.getViewState().zoom), P = p.getPointSize(a), B = Math.max(xl, P * yl) / w;
|
|
5405
5319
|
if (!Number.isFinite(B) || B <= 0) return null;
|
|
5406
|
-
const { cellSize:
|
|
5407
|
-
let
|
|
5408
|
-
for (let
|
|
5409
|
-
for (let
|
|
5410
|
-
const lt = dl(c,
|
|
5320
|
+
const { cellSize: N, cellOffsets: Y, cellLengths: M, pointIndices: T, positions: O, safeCount: v } = c, W = Math.floor(x / N), J = Math.floor(E / N), F = Math.max(1, Math.ceil(B / N)), xt = B * B;
|
|
5321
|
+
let ft = -1, tt = xt, _t = 0, Ct = 0;
|
|
5322
|
+
for (let C = W - F; C <= W + F; C += 1)
|
|
5323
|
+
for (let U = J - F; U <= J + F; U += 1) {
|
|
5324
|
+
const lt = dl(c, C, U);
|
|
5411
5325
|
if (lt < 0) continue;
|
|
5412
|
-
const
|
|
5413
|
-
for (let
|
|
5414
|
-
const
|
|
5415
|
-
if (
|
|
5416
|
-
const
|
|
5417
|
-
|
|
5326
|
+
const dt = Y[lt], j = dt + M[lt];
|
|
5327
|
+
for (let ht = dt; ht < j; ht += 1) {
|
|
5328
|
+
const rt = T[ht];
|
|
5329
|
+
if (rt >= v) continue;
|
|
5330
|
+
const Dt = O[rt * 2], Rt = O[rt * 2 + 1], mt = Dt - x, At = Rt - E, nt = mt * mt + At * At;
|
|
5331
|
+
nt > tt || (tt = nt, ft = rt, _t = Dt, Ct = Rt);
|
|
5418
5332
|
}
|
|
5419
5333
|
}
|
|
5420
|
-
if (
|
|
5421
|
-
const L = c.ids ? Number(c.ids[
|
|
5334
|
+
if (ft < 0) return null;
|
|
5335
|
+
const L = c.ids ? Number(c.ids[ft]) : null;
|
|
5422
5336
|
return {
|
|
5423
|
-
index:
|
|
5337
|
+
index: ft,
|
|
5424
5338
|
id: L,
|
|
5425
5339
|
coordinate: [x, E],
|
|
5426
5340
|
pointCoordinate: [_t, Ct]
|
|
@@ -5450,12 +5364,12 @@ function bl(e, t, n, r, i, o, s, a) {
|
|
|
5450
5364
|
},
|
|
5451
5365
|
[r, d]
|
|
5452
5366
|
);
|
|
5453
|
-
return
|
|
5367
|
+
return z(() => {
|
|
5454
5368
|
if (i)
|
|
5455
5369
|
return i.current = d, () => {
|
|
5456
5370
|
i.current === d && (i.current = null);
|
|
5457
5371
|
};
|
|
5458
|
-
}, [i, d]),
|
|
5372
|
+
}, [i, d]), z(() => {
|
|
5459
5373
|
const y = u.current;
|
|
5460
5374
|
y !== null && (c && y < c.safeCount || (u.current = null, h.current = null, n?.({
|
|
5461
5375
|
index: null,
|
|
@@ -5463,7 +5377,7 @@ function bl(e, t, n, r, i, o, s, a) {
|
|
|
5463
5377
|
coordinate: null,
|
|
5464
5378
|
pointCoordinate: null
|
|
5465
5379
|
})));
|
|
5466
|
-
}, [c, n]),
|
|
5380
|
+
}, [c, n]), z(() => {
|
|
5467
5381
|
}, [o, n]), { getCellByCoordinates: d, emitPointHover: m, emitPointClick: g };
|
|
5468
5382
|
}
|
|
5469
5383
|
let wl = 0;
|
|
@@ -5485,45 +5399,45 @@ const pu = oo(function({
|
|
|
5485
5399
|
onClick: g,
|
|
5486
5400
|
dashed: y
|
|
5487
5401
|
}, p) {
|
|
5488
|
-
const { rendererRef: x, rendererSerial: E, source: w } = pe(), P = q(null), R = q(`__point_layer__${wl++}`),
|
|
5489
|
-
return so(p, () => ({ queryAt: Y }), [Y]),
|
|
5402
|
+
const { rendererRef: x, rendererSerial: E, source: w } = pe(), P = q(null), R = q(`__point_layer__${wl++}`), N = sl(f, h, t, u ?? Sl, d), { getCellByCoordinates: Y } = bl(N, w, m, g, P, "cursor", x, R.current);
|
|
5403
|
+
return so(p, () => ({ queryAt: Y }), [Y]), z(() => {
|
|
5490
5404
|
const M = x.current;
|
|
5491
5405
|
if (!M) return;
|
|
5492
|
-
const
|
|
5493
|
-
return M.registerPointLayer(
|
|
5494
|
-
M.unregisterPointLayer(
|
|
5406
|
+
const T = R.current;
|
|
5407
|
+
return M.registerPointLayer(T), () => {
|
|
5408
|
+
M.unregisterPointLayer(T);
|
|
5495
5409
|
};
|
|
5496
|
-
}, [x, E]),
|
|
5410
|
+
}, [x, E]), z(() => {
|
|
5497
5411
|
const M = x.current;
|
|
5498
5412
|
M && M.setPointPalette(n, R.current);
|
|
5499
|
-
}, [E, n, x]),
|
|
5413
|
+
}, [E, n, x]), z(() => {
|
|
5500
5414
|
const M = x.current;
|
|
5501
5415
|
M && M.setPointLineDash(y, R.current);
|
|
5502
|
-
}, [E, y, x]),
|
|
5416
|
+
}, [E, y, x]), z(() => {
|
|
5503
5417
|
const M = x.current;
|
|
5504
5418
|
M && M.setPointSizeByZoom(r, R.current);
|
|
5505
|
-
}, [E, r, x]),
|
|
5419
|
+
}, [E, r, x]), z(() => {
|
|
5506
5420
|
const M = x.current;
|
|
5507
5421
|
M && M.setPointSizeByMagnification(i, R.current);
|
|
5508
|
-
}, [E, i, x]),
|
|
5422
|
+
}, [E, i, x]), z(() => {
|
|
5509
5423
|
const M = x.current;
|
|
5510
5424
|
M && M.setPointWeightByMagnification(o, R.current);
|
|
5511
|
-
}, [E, o, x]),
|
|
5425
|
+
}, [E, o, x]), z(() => {
|
|
5512
5426
|
const M = x.current;
|
|
5513
5427
|
!M || s === void 0 || M.setPointOpacity(s, R.current);
|
|
5514
|
-
}, [E, s, x]),
|
|
5428
|
+
}, [E, s, x]), z(() => {
|
|
5515
5429
|
const M = x.current;
|
|
5516
5430
|
!M || a === void 0 || M.setPointStrokeScale(a, R.current);
|
|
5517
|
-
}, [E, a, x]),
|
|
5431
|
+
}, [E, a, x]), z(() => {
|
|
5518
5432
|
const M = x.current;
|
|
5519
5433
|
!M || l === void 0 || M.setPointInnerFillOpacity(l, R.current);
|
|
5520
|
-
}, [E, l, x]),
|
|
5434
|
+
}, [E, l, x]), z(() => {
|
|
5521
5435
|
const M = x.current;
|
|
5522
5436
|
M && M.setPointInnerFillColor(c, R.current);
|
|
5523
|
-
}, [E, c, x]),
|
|
5437
|
+
}, [E, c, x]), z(() => {
|
|
5524
5438
|
const M = x.current;
|
|
5525
|
-
M && M.setPointData(
|
|
5526
|
-
}, [E,
|
|
5439
|
+
M && M.setPointData(N, R.current);
|
|
5440
|
+
}, [E, N, x]), null;
|
|
5527
5441
|
}), Sl = [], Al = 180, Vr = 20;
|
|
5528
5442
|
function El(e) {
|
|
5529
5443
|
const t = _(e, 0, 1);
|
|
@@ -5572,7 +5486,7 @@ function Rl(e, t, n) {
|
|
|
5572
5486
|
},
|
|
5573
5487
|
[e, c]
|
|
5574
5488
|
);
|
|
5575
|
-
return
|
|
5489
|
+
return z(() => () => {
|
|
5576
5490
|
l();
|
|
5577
5491
|
}, [l]), {
|
|
5578
5492
|
regionLabelAutoLiftOffsetPx: r,
|
|
@@ -5711,278 +5625,278 @@ function yu({
|
|
|
5711
5625
|
onHover: m,
|
|
5712
5626
|
onClick: g
|
|
5713
5627
|
}) {
|
|
5714
|
-
const { rendererRef: y, rendererSerial: p, canvasRef: x, containerRef: E, registerDrawCallback: w, unregisterDrawCallback: P, requestOverlayRedraw: R, drawInvalidateRef: B, registerViewStateListener:
|
|
5715
|
-
if (
|
|
5628
|
+
const { rendererRef: y, rendererSerial: p, canvasRef: x, containerRef: E, registerDrawCallback: w, unregisterDrawCallback: P, requestOverlayRedraw: R, drawInvalidateRef: B, registerViewStateListener: N, screenToWorld: Y, worldToScreen: M, isInteractionLocked: T } = pe(), O = e ?? qr, v = t ?? Il, W = at(() => O.length > 0 ? O : v.length === 0 ? qr : v.map((G, K) => ({ id: K, coordinates: G })), [O, v]), [J, F] = ae(() => f ?? null), [xt, ft] = ae(() => u ?? null), tt = f !== void 0, _t = u !== void 0, Ct = tt ? f ?? null : J, L = _t ? u ?? null : xt, C = q(f ?? null), U = q(null), lt = q(null);
|
|
5629
|
+
if (U.current === null || lt.current === null) {
|
|
5716
5630
|
const G = _l++;
|
|
5717
|
-
|
|
5631
|
+
U.current = `__region_layer__${G}`, lt.current = `__region_label__${G}`;
|
|
5718
5632
|
}
|
|
5719
|
-
|
|
5720
|
-
_t &&
|
|
5721
|
-
}, [_t, u]),
|
|
5722
|
-
if (!
|
|
5633
|
+
z(() => {
|
|
5634
|
+
_t && ft(u ?? null);
|
|
5635
|
+
}, [_t, u]), z(() => {
|
|
5636
|
+
if (!tt) return;
|
|
5723
5637
|
const G = f ?? null;
|
|
5724
|
-
|
|
5725
|
-
}, [
|
|
5726
|
-
const
|
|
5638
|
+
C.current = G, F(G);
|
|
5639
|
+
}, [tt, f]);
|
|
5640
|
+
const dt = V(
|
|
5727
5641
|
(G) => {
|
|
5728
|
-
String(L) !== String(G) && (_t ||
|
|
5642
|
+
String(L) !== String(G) && (_t || ft(G), d?.(G));
|
|
5729
5643
|
},
|
|
5730
5644
|
[L, _t, d]
|
|
5731
|
-
), { regionLabelAutoLiftOffsetPx:
|
|
5645
|
+
), { regionLabelAutoLiftOffsetPx: j, syncRegionLabelAutoLiftTarget: ht } = Rl(l, y, B), rt = at(() => zn(n), [n]), Dt = at(() => Jt(rt, r), [rt, r]), Rt = at(() => Jt(rt, i), [rt, i]), { staticLabelStyle: mt, labelStyleResolver: At } = at(() => typeof s == "function" ? { staticLabelStyle: void 0, labelStyleResolver: s } : { staticLabelStyle: s, labelStyleResolver: void 0 }, [s]), nt = at(() => kn(mt), [mt]), ct = at(() => {
|
|
5732
5646
|
const G = [];
|
|
5733
|
-
for (let
|
|
5734
|
-
const
|
|
5735
|
-
|
|
5647
|
+
for (let K = 0; K < W.length; K += 1) {
|
|
5648
|
+
const St = W[K], et = tn(St.coordinates);
|
|
5649
|
+
et.length !== 0 && G.push({ region: St, regionIndex: K, regionKey: St.id ?? K, polygons: et });
|
|
5736
5650
|
}
|
|
5737
5651
|
return G;
|
|
5738
|
-
}, [W]),
|
|
5739
|
-
|
|
5652
|
+
}, [W]), gt = at(() => Tl(W), [W]);
|
|
5653
|
+
z(() => {
|
|
5740
5654
|
const G = y.current;
|
|
5741
5655
|
if (G)
|
|
5742
|
-
return
|
|
5743
|
-
|
|
5656
|
+
return ht(G.getViewState().zoom), N((K) => {
|
|
5657
|
+
ht(K.zoom);
|
|
5744
5658
|
});
|
|
5745
|
-
}, [p,
|
|
5746
|
-
!(L === null ? !0 : W.some((
|
|
5747
|
-
const
|
|
5748
|
-
!(
|
|
5749
|
-
}, [W, L,
|
|
5750
|
-
const
|
|
5659
|
+
}, [p, N, ht]), z(() => {
|
|
5660
|
+
!(L === null ? !0 : W.some((et, Q) => String(_n(et, Q)) === String(L))) && L !== null && dt(null);
|
|
5661
|
+
const K = C.current;
|
|
5662
|
+
!(K === null ? !0 : W.some((et, Q) => String(_n(et, Q)) === String(K))) && K !== null && (C.current = null, tt || F(null), m?.({ region: null, regionId: null, regionIndex: -1, coordinate: null }));
|
|
5663
|
+
}, [W, L, tt, m, dt]);
|
|
5664
|
+
const ut = V(
|
|
5751
5665
|
(G) => {
|
|
5752
|
-
const
|
|
5753
|
-
if (!
|
|
5754
|
-
const
|
|
5755
|
-
for (let
|
|
5756
|
-
const
|
|
5757
|
-
if (!
|
|
5758
|
-
|
|
5666
|
+
const K = y.current;
|
|
5667
|
+
if (!K || G.length === 0) return [];
|
|
5668
|
+
const St = new Array(G.length);
|
|
5669
|
+
for (let et = 0; et < G.length; et += 1) {
|
|
5670
|
+
const Q = $t(K.worldToScreen(G[et][0], G[et][1]));
|
|
5671
|
+
if (!Q) return [];
|
|
5672
|
+
St[et] = Q;
|
|
5759
5673
|
}
|
|
5760
|
-
return
|
|
5674
|
+
return St;
|
|
5761
5675
|
},
|
|
5762
5676
|
[]
|
|
5763
|
-
),
|
|
5677
|
+
), it = q({
|
|
5764
5678
|
preparedRegions: ct,
|
|
5765
5679
|
hoveredRegionId: Ct,
|
|
5766
5680
|
activeRegionId: L,
|
|
5767
|
-
resolvedStrokeStyle:
|
|
5768
|
-
resolvedHoverStrokeStyle:
|
|
5769
|
-
resolvedActiveStrokeStyle:
|
|
5681
|
+
resolvedStrokeStyle: rt,
|
|
5682
|
+
resolvedHoverStrokeStyle: Dt,
|
|
5683
|
+
resolvedActiveStrokeStyle: Rt,
|
|
5770
5684
|
resolveStrokeStyleProp: o,
|
|
5771
|
-
worldToScreenPoints:
|
|
5685
|
+
worldToScreenPoints: ut
|
|
5772
5686
|
});
|
|
5773
|
-
|
|
5687
|
+
it.current = {
|
|
5774
5688
|
preparedRegions: ct,
|
|
5775
5689
|
hoveredRegionId: Ct,
|
|
5776
5690
|
activeRegionId: L,
|
|
5777
|
-
resolvedStrokeStyle:
|
|
5778
|
-
resolvedHoverStrokeStyle:
|
|
5779
|
-
resolvedActiveStrokeStyle:
|
|
5691
|
+
resolvedStrokeStyle: rt,
|
|
5692
|
+
resolvedHoverStrokeStyle: Dt,
|
|
5693
|
+
resolvedActiveStrokeStyle: Rt,
|
|
5780
5694
|
resolveStrokeStyleProp: o,
|
|
5781
|
-
worldToScreenPoints:
|
|
5782
|
-
},
|
|
5783
|
-
const G = (
|
|
5695
|
+
worldToScreenPoints: ut
|
|
5696
|
+
}, z(() => {
|
|
5697
|
+
const G = (St) => {
|
|
5784
5698
|
const {
|
|
5785
|
-
preparedRegions:
|
|
5786
|
-
hoveredRegionId:
|
|
5699
|
+
preparedRegions: et,
|
|
5700
|
+
hoveredRegionId: Q,
|
|
5787
5701
|
activeRegionId: Mt,
|
|
5788
5702
|
resolvedStrokeStyle: X,
|
|
5789
|
-
resolvedHoverStrokeStyle:
|
|
5703
|
+
resolvedHoverStrokeStyle: Tt,
|
|
5790
5704
|
resolvedActiveStrokeStyle: Bt,
|
|
5791
|
-
resolveStrokeStyleProp:
|
|
5792
|
-
worldToScreenPoints:
|
|
5793
|
-
} =
|
|
5794
|
-
for (const
|
|
5795
|
-
const { region:
|
|
5796
|
-
let b = Ut === "active" ? Bt : Ut === "hover" ?
|
|
5797
|
-
if (
|
|
5798
|
-
const
|
|
5799
|
-
b = Jt(b,
|
|
5705
|
+
resolveStrokeStyleProp: zt,
|
|
5706
|
+
worldToScreenPoints: k
|
|
5707
|
+
} = it.current;
|
|
5708
|
+
for (const H of et) {
|
|
5709
|
+
const { region: $, polygons: ot, regionIndex: bt, regionKey: pt } = H, Ut = Je(Mt, pt) ? "active" : Je(Q, pt) ? "hover" : "default";
|
|
5710
|
+
let b = Ut === "active" ? Bt : Ut === "hover" ? Tt : X;
|
|
5711
|
+
if (zt) {
|
|
5712
|
+
const I = zt({ region: $, regionId: pt, regionIndex: bt, state: Ut });
|
|
5713
|
+
b = Jt(b, I || void 0);
|
|
5800
5714
|
}
|
|
5801
5715
|
const A = Ut === "default" ? null : Fl(b);
|
|
5802
|
-
for (const
|
|
5803
|
-
const D =
|
|
5804
|
-
D.length >= 4 && (A && Wt(
|
|
5805
|
-
for (const Z of
|
|
5806
|
-
const
|
|
5807
|
-
|
|
5716
|
+
for (const I of ot) {
|
|
5717
|
+
const D = k(I.outer);
|
|
5718
|
+
D.length >= 4 && (A && Wt(St, D, A, !0, !1), Wt(St, D, b, !0, !1));
|
|
5719
|
+
for (const Z of I.holes) {
|
|
5720
|
+
const wt = k(Z);
|
|
5721
|
+
wt.length >= 4 && (A && Wt(St, wt, A, !0, !1), Wt(St, wt, b, !0, !1));
|
|
5808
5722
|
}
|
|
5809
5723
|
}
|
|
5810
5724
|
}
|
|
5811
|
-
},
|
|
5812
|
-
if (
|
|
5813
|
-
return w(
|
|
5725
|
+
}, K = U.current;
|
|
5726
|
+
if (K)
|
|
5727
|
+
return w(K, 10, G), () => P(K);
|
|
5814
5728
|
}, [w, P]);
|
|
5815
|
-
const
|
|
5729
|
+
const vt = q({
|
|
5816
5730
|
preparedRegions: ct,
|
|
5817
|
-
resolvedLabelStyle:
|
|
5818
|
-
labelStyleResolver:
|
|
5731
|
+
resolvedLabelStyle: nt,
|
|
5732
|
+
labelStyleResolver: At,
|
|
5819
5733
|
labelAnchor: a,
|
|
5820
5734
|
autoLiftLabelAtMaxZoom: l,
|
|
5821
5735
|
clampLabelToViewport: c,
|
|
5822
|
-
regionLabelAutoLiftOffsetPx:
|
|
5736
|
+
regionLabelAutoLiftOffsetPx: j,
|
|
5823
5737
|
rendererRef: y
|
|
5824
5738
|
});
|
|
5825
|
-
|
|
5739
|
+
vt.current = {
|
|
5826
5740
|
preparedRegions: ct,
|
|
5827
|
-
resolvedLabelStyle:
|
|
5828
|
-
labelStyleResolver:
|
|
5741
|
+
resolvedLabelStyle: nt,
|
|
5742
|
+
labelStyleResolver: At,
|
|
5829
5743
|
labelAnchor: a,
|
|
5830
5744
|
autoLiftLabelAtMaxZoom: l,
|
|
5831
5745
|
clampLabelToViewport: c,
|
|
5832
|
-
regionLabelAutoLiftOffsetPx:
|
|
5746
|
+
regionLabelAutoLiftOffsetPx: j,
|
|
5833
5747
|
rendererRef: y
|
|
5834
|
-
},
|
|
5835
|
-
const G = (
|
|
5748
|
+
}, z(() => {
|
|
5749
|
+
const G = (St, et, Q) => {
|
|
5836
5750
|
const {
|
|
5837
5751
|
preparedRegions: Mt,
|
|
5838
5752
|
resolvedLabelStyle: X,
|
|
5839
|
-
labelStyleResolver:
|
|
5753
|
+
labelStyleResolver: Tt,
|
|
5840
5754
|
labelAnchor: Bt,
|
|
5841
|
-
autoLiftLabelAtMaxZoom:
|
|
5842
|
-
clampLabelToViewport:
|
|
5843
|
-
regionLabelAutoLiftOffsetPx:
|
|
5844
|
-
rendererRef:
|
|
5845
|
-
} =
|
|
5755
|
+
autoLiftLabelAtMaxZoom: zt,
|
|
5756
|
+
clampLabelToViewport: k,
|
|
5757
|
+
regionLabelAutoLiftOffsetPx: H,
|
|
5758
|
+
rendererRef: $
|
|
5759
|
+
} = vt.current;
|
|
5846
5760
|
if (Mt.length === 0) return;
|
|
5847
|
-
const
|
|
5848
|
-
for (const
|
|
5849
|
-
if (!
|
|
5761
|
+
const ot = Math.max(1e-6, $.current?.getViewState?.().zoom ?? 1), bt = typeof H == "number" && Number.isFinite(H) ? Math.max(0, H) : Wn(zt, ot, $.current?.getZoomRange?.(), $.current?.getRegionLabelAutoLiftCapZoom?.());
|
|
5762
|
+
for (const pt of Mt) {
|
|
5763
|
+
if (!pt.region.label) continue;
|
|
5850
5764
|
const Ut = Un(
|
|
5851
|
-
|
|
5765
|
+
pt.polygons,
|
|
5852
5766
|
(A) => {
|
|
5853
|
-
const
|
|
5854
|
-
if (!
|
|
5767
|
+
const I = $.current;
|
|
5768
|
+
if (!I) return [];
|
|
5855
5769
|
const D = [];
|
|
5856
5770
|
for (let Z = 0; Z < A.length; Z += 1) {
|
|
5857
|
-
const
|
|
5858
|
-
if (!
|
|
5859
|
-
D.push(
|
|
5771
|
+
const wt = $t(I.worldToScreen(A[Z][0], A[Z][1]));
|
|
5772
|
+
if (!wt) return [];
|
|
5773
|
+
D.push(wt);
|
|
5860
5774
|
}
|
|
5861
5775
|
return D;
|
|
5862
5776
|
},
|
|
5863
5777
|
Bt
|
|
5864
5778
|
);
|
|
5865
5779
|
if (!Ut) continue;
|
|
5866
|
-
let b = On(X,
|
|
5867
|
-
|
|
5780
|
+
let b = On(X, Tt?.({ region: pt.region, regionId: pt.regionKey, regionIndex: pt.regionIndex, zoom: ot }));
|
|
5781
|
+
bt > 0 && (b = { ...b, offsetY: b.offsetY + bt }), Mi(St, pt.region.label, Ut, et, Q, b, k);
|
|
5868
5782
|
}
|
|
5869
|
-
},
|
|
5870
|
-
if (
|
|
5871
|
-
return w(
|
|
5872
|
-
}, [w, P]),
|
|
5783
|
+
}, K = lt.current;
|
|
5784
|
+
if (K)
|
|
5785
|
+
return w(K, 50, G), () => P(K);
|
|
5786
|
+
}, [w, P]), z(() => {
|
|
5873
5787
|
R();
|
|
5874
|
-
}, [ct, Ct, L,
|
|
5875
|
-
const
|
|
5876
|
-
preparedRegionHits:
|
|
5788
|
+
}, [ct, Ct, L, rt, nt, j, R]);
|
|
5789
|
+
const Et = q({
|
|
5790
|
+
preparedRegionHits: gt,
|
|
5877
5791
|
labelAnchor: a,
|
|
5878
|
-
resolvedLabelStyle:
|
|
5879
|
-
labelStyleResolver:
|
|
5880
|
-
regionLabelAutoLiftOffsetPx:
|
|
5792
|
+
resolvedLabelStyle: nt,
|
|
5793
|
+
labelStyleResolver: At,
|
|
5794
|
+
regionLabelAutoLiftOffsetPx: j,
|
|
5881
5795
|
clampLabelToViewport: c,
|
|
5882
5796
|
onHover: m,
|
|
5883
5797
|
onClick: g,
|
|
5884
|
-
commitActive:
|
|
5798
|
+
commitActive: dt
|
|
5885
5799
|
});
|
|
5886
|
-
return
|
|
5887
|
-
preparedRegionHits:
|
|
5800
|
+
return Et.current = {
|
|
5801
|
+
preparedRegionHits: gt,
|
|
5888
5802
|
labelAnchor: a,
|
|
5889
|
-
resolvedLabelStyle:
|
|
5890
|
-
labelStyleResolver:
|
|
5891
|
-
regionLabelAutoLiftOffsetPx:
|
|
5803
|
+
resolvedLabelStyle: nt,
|
|
5804
|
+
labelStyleResolver: At,
|
|
5805
|
+
regionLabelAutoLiftOffsetPx: j,
|
|
5892
5806
|
clampLabelToViewport: c,
|
|
5893
5807
|
onHover: m,
|
|
5894
5808
|
onClick: g,
|
|
5895
|
-
commitActive:
|
|
5896
|
-
},
|
|
5809
|
+
commitActive: dt
|
|
5810
|
+
}, z(() => {
|
|
5897
5811
|
if (!h) return;
|
|
5898
5812
|
const G = E.current;
|
|
5899
5813
|
if (!G) return;
|
|
5900
|
-
const
|
|
5901
|
-
if (
|
|
5814
|
+
const K = (Q) => {
|
|
5815
|
+
if (T()) return;
|
|
5902
5816
|
const Mt = y.current;
|
|
5903
5817
|
if (!Mt) return;
|
|
5904
5818
|
const {
|
|
5905
5819
|
preparedRegionHits: X,
|
|
5906
|
-
labelAnchor:
|
|
5820
|
+
labelAnchor: Tt,
|
|
5907
5821
|
resolvedLabelStyle: Bt,
|
|
5908
|
-
labelStyleResolver:
|
|
5909
|
-
regionLabelAutoLiftOffsetPx:
|
|
5910
|
-
clampLabelToViewport:
|
|
5911
|
-
onHover:
|
|
5912
|
-
} =
|
|
5913
|
-
if (!
|
|
5914
|
-
let
|
|
5822
|
+
labelStyleResolver: zt,
|
|
5823
|
+
regionLabelAutoLiftOffsetPx: k,
|
|
5824
|
+
clampLabelToViewport: H,
|
|
5825
|
+
onHover: $
|
|
5826
|
+
} = Et.current, ot = Y(Q.clientX, Q.clientY);
|
|
5827
|
+
if (!ot) return;
|
|
5828
|
+
let bt = null, pt = null;
|
|
5915
5829
|
if (X.length > 0) {
|
|
5916
|
-
const b = M(
|
|
5830
|
+
const b = M(ot[0], ot[1]);
|
|
5917
5831
|
if (b) {
|
|
5918
5832
|
const A = x.current?.getBoundingClientRect();
|
|
5919
|
-
|
|
5920
|
-
|
|
5833
|
+
pt = Zr(
|
|
5834
|
+
ot,
|
|
5921
5835
|
b,
|
|
5922
5836
|
X,
|
|
5923
5837
|
Mt,
|
|
5924
|
-
|
|
5838
|
+
Tt,
|
|
5925
5839
|
Bt,
|
|
5926
|
-
|
|
5927
|
-
typeof
|
|
5840
|
+
zt,
|
|
5841
|
+
typeof k == "number" ? k : 0,
|
|
5928
5842
|
A?.width ?? 0,
|
|
5929
5843
|
A?.height ?? 0,
|
|
5930
|
-
|
|
5931
|
-
),
|
|
5844
|
+
H
|
|
5845
|
+
), bt = pt?.regionId ?? null;
|
|
5932
5846
|
}
|
|
5933
5847
|
}
|
|
5934
|
-
const Ut =
|
|
5935
|
-
String(Ut) !== String(
|
|
5936
|
-
region:
|
|
5937
|
-
regionId:
|
|
5938
|
-
regionIndex:
|
|
5939
|
-
coordinate:
|
|
5848
|
+
const Ut = C.current;
|
|
5849
|
+
String(Ut) !== String(bt) && (C.current = bt, tt || F(bt), $?.({
|
|
5850
|
+
region: pt?.region ?? null,
|
|
5851
|
+
regionId: bt,
|
|
5852
|
+
regionIndex: pt?.regionIndex ?? -1,
|
|
5853
|
+
coordinate: ot
|
|
5940
5854
|
}), R());
|
|
5941
|
-
},
|
|
5942
|
-
if (
|
|
5855
|
+
}, St = (Q) => {
|
|
5856
|
+
if (T()) return;
|
|
5943
5857
|
const Mt = y.current;
|
|
5944
5858
|
if (!Mt) return;
|
|
5945
5859
|
const {
|
|
5946
5860
|
preparedRegionHits: X,
|
|
5947
|
-
labelAnchor:
|
|
5861
|
+
labelAnchor: Tt,
|
|
5948
5862
|
resolvedLabelStyle: Bt,
|
|
5949
|
-
labelStyleResolver:
|
|
5950
|
-
regionLabelAutoLiftOffsetPx:
|
|
5951
|
-
clampLabelToViewport:
|
|
5952
|
-
onClick:
|
|
5953
|
-
commitActive:
|
|
5954
|
-
} =
|
|
5863
|
+
labelStyleResolver: zt,
|
|
5864
|
+
regionLabelAutoLiftOffsetPx: k,
|
|
5865
|
+
clampLabelToViewport: H,
|
|
5866
|
+
onClick: $,
|
|
5867
|
+
commitActive: ot
|
|
5868
|
+
} = Et.current;
|
|
5955
5869
|
if (X.length === 0) return;
|
|
5956
|
-
const
|
|
5957
|
-
if (!
|
|
5958
|
-
const
|
|
5959
|
-
if (!
|
|
5870
|
+
const bt = Y(Q.clientX, Q.clientY);
|
|
5871
|
+
if (!bt) return;
|
|
5872
|
+
const pt = M(bt[0], bt[1]);
|
|
5873
|
+
if (!pt) return;
|
|
5960
5874
|
const Ut = x.current?.getBoundingClientRect(), b = Zr(
|
|
5961
|
-
|
|
5962
|
-
|
|
5875
|
+
bt,
|
|
5876
|
+
pt,
|
|
5963
5877
|
X,
|
|
5964
5878
|
Mt,
|
|
5965
|
-
|
|
5879
|
+
Tt,
|
|
5966
5880
|
Bt,
|
|
5967
|
-
|
|
5968
|
-
typeof
|
|
5881
|
+
zt,
|
|
5882
|
+
typeof k == "number" ? k : 0,
|
|
5969
5883
|
Ut?.width ?? 0,
|
|
5970
5884
|
Ut?.height ?? 0,
|
|
5971
|
-
|
|
5885
|
+
H
|
|
5972
5886
|
), A = b?.regionId ?? null;
|
|
5973
|
-
|
|
5887
|
+
ot(A), b && $ && $({
|
|
5974
5888
|
region: b.region,
|
|
5975
5889
|
regionId: b.regionId,
|
|
5976
5890
|
regionIndex: b.regionIndex,
|
|
5977
|
-
coordinate:
|
|
5891
|
+
coordinate: bt
|
|
5978
5892
|
});
|
|
5979
|
-
},
|
|
5980
|
-
|
|
5893
|
+
}, et = () => {
|
|
5894
|
+
C.current !== null && (C.current = null, tt || F(null), Et.current.onHover?.({ region: null, regionId: null, regionIndex: -1, coordinate: null }), R());
|
|
5981
5895
|
};
|
|
5982
|
-
return G.addEventListener("pointermove",
|
|
5983
|
-
G.removeEventListener("pointermove",
|
|
5896
|
+
return G.addEventListener("pointermove", K), G.addEventListener("click", St), G.addEventListener("pointerleave", et), () => {
|
|
5897
|
+
G.removeEventListener("pointermove", K), G.removeEventListener("click", St), G.removeEventListener("pointerleave", et);
|
|
5984
5898
|
};
|
|
5985
|
-
}, [E, y, x, h,
|
|
5899
|
+
}, [E, y, x, h, tt, Y, M, T, R]), null;
|
|
5986
5900
|
}
|
|
5987
5901
|
function xu({
|
|
5988
5902
|
imageWidth: e,
|
|
@@ -5996,7 +5910,7 @@ function xu({
|
|
|
5996
5910
|
() => ({ width: "100%", height: "100%", display: "block", ...o }),
|
|
5997
5911
|
[o]
|
|
5998
5912
|
);
|
|
5999
|
-
return
|
|
5913
|
+
return z(() => {
|
|
6000
5914
|
const c = s.current;
|
|
6001
5915
|
if (!c)
|
|
6002
5916
|
return;
|
|
@@ -6009,10 +5923,10 @@ function xu({
|
|
|
6009
5923
|
return a.current = f, f.setTiles(n), () => {
|
|
6010
5924
|
f.destroy(), a.current = null;
|
|
6011
5925
|
};
|
|
6012
|
-
}, [e, t]),
|
|
5926
|
+
}, [e, t]), z(() => {
|
|
6013
5927
|
const c = a.current;
|
|
6014
5928
|
c && c.setTiles(n);
|
|
6015
|
-
}, [n]),
|
|
5929
|
+
}, [n]), z(() => {
|
|
6016
5930
|
const c = a.current;
|
|
6017
5931
|
!c || !r || c.setViewState(r);
|
|
6018
5932
|
}, [r]), /* @__PURE__ */ Qt("canvas", { ref: s, className: i, style: l });
|
|
@@ -6076,7 +5990,7 @@ class Dl {
|
|
|
6076
5990
|
const o = {
|
|
6077
5991
|
tile: r,
|
|
6078
5992
|
attempt: 0,
|
|
6079
|
-
readyAt:
|
|
5993
|
+
readyAt: Pt()
|
|
6080
5994
|
};
|
|
6081
5995
|
this.queue.push(o), this.queuedByKey.set(r.key, o);
|
|
6082
5996
|
}
|
|
@@ -6132,14 +6046,14 @@ class Dl {
|
|
|
6132
6046
|
if (this.inflight.size >= this.maxConcurrency || this.queue.length === 0) return;
|
|
6133
6047
|
const t = this.queue[0]?.readyAt;
|
|
6134
6048
|
if (typeof t != "number") return;
|
|
6135
|
-
const n = Math.max(0, t -
|
|
6049
|
+
const n = Math.max(0, t - Pt());
|
|
6136
6050
|
this.timerId = globalThis.setTimeout(() => {
|
|
6137
6051
|
this.timerId = null, this.pump();
|
|
6138
6052
|
}, n);
|
|
6139
6053
|
}
|
|
6140
6054
|
takeNextReadyQueueItem() {
|
|
6141
6055
|
if (this.queue.length === 0) return null;
|
|
6142
|
-
const t =
|
|
6056
|
+
const t = Pt(), n = this.queue[0];
|
|
6143
6057
|
return !n || n.readyAt > t ? null : (this.queue.shift(), this.queuedByKey.delete(n.tile.key), n);
|
|
6144
6058
|
}
|
|
6145
6059
|
startFetch(t) {
|
|
@@ -6175,7 +6089,7 @@ class Dl {
|
|
|
6175
6089
|
const a = t.attempt + 1, l = this.getRetryDelay(a), c = {
|
|
6176
6090
|
tile: t.tile,
|
|
6177
6091
|
attempt: a,
|
|
6178
|
-
readyAt:
|
|
6092
|
+
readyAt: Pt() + l
|
|
6179
6093
|
}, f = this.queuedByKey.get(t.tile.key);
|
|
6180
6094
|
f ? (f.tile = c.tile, f.readyAt = Math.min(f.readyAt, c.readyAt), f.attempt = Math.max(f.attempt, c.attempt)) : (this.queue.push(c), this.queuedByKey.set(c.tile.key, c)), this.sortQueue();
|
|
6181
6095
|
return;
|
|
@@ -6473,14 +6387,14 @@ function ji(e, t, n) {
|
|
|
6473
6387
|
const p = (c + u) * 0.5 / i / t.tileSize, x = (f + h) * 0.5 / i / t.tileSize, E = [];
|
|
6474
6388
|
for (let w = g; w <= y; w += 1)
|
|
6475
6389
|
for (let P = d; P <= m; P += 1) {
|
|
6476
|
-
const R = P * t.tileSize * i, B = w * t.tileSize * i,
|
|
6390
|
+
const R = P * t.tileSize * i, B = w * t.tileSize * i, N = Math.min((P + 1) * t.tileSize, o) * i, Y = Math.min((w + 1) * t.tileSize, s) * i, M = P - p, T = w - x;
|
|
6477
6391
|
E.push({
|
|
6478
6392
|
key: `${n}/${P}/${w}`,
|
|
6479
6393
|
tier: n,
|
|
6480
6394
|
x: P,
|
|
6481
6395
|
y: w,
|
|
6482
|
-
bounds: [R, B,
|
|
6483
|
-
distance2: M * M +
|
|
6396
|
+
bounds: [R, B, N, Y],
|
|
6397
|
+
distance2: M * M + T * T,
|
|
6484
6398
|
url: Xi(t, n, P, w)
|
|
6485
6399
|
});
|
|
6486
6400
|
}
|
|
@@ -6764,33 +6678,33 @@ function Cc(e) {
|
|
|
6764
6678
|
const x = [];
|
|
6765
6679
|
for (const [, M] of i)
|
|
6766
6680
|
p.has(M.key) || d(M.bounds, y) && x.push(M);
|
|
6767
|
-
x.sort((M,
|
|
6681
|
+
x.sort((M, T) => M.tier - T.tier);
|
|
6768
6682
|
for (const M of x)
|
|
6769
6683
|
M.lastUsed = o, t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, M.texture), t.uniform4f(s.uBounds, M.bounds[0], M.bounds[1], M.bounds[2], M.bounds[3]), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
|
|
6770
6684
|
let E = 0;
|
|
6771
6685
|
const w = [];
|
|
6772
6686
|
for (const M of g) {
|
|
6773
|
-
const
|
|
6774
|
-
if (!
|
|
6687
|
+
const T = i.get(M.key);
|
|
6688
|
+
if (!T) {
|
|
6775
6689
|
w.push(M);
|
|
6776
6690
|
continue;
|
|
6777
6691
|
}
|
|
6778
|
-
|
|
6692
|
+
T.lastUsed = o, t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, T.texture), t.uniform4f(s.uBounds, T.bounds[0], T.bounds[1], T.bounds[2], T.bounds[3]), t.drawArrays(t.TRIANGLE_STRIP, 0, 4), E += 1;
|
|
6779
6693
|
}
|
|
6780
6694
|
const P = w.slice(), R = 1e6, B = [];
|
|
6781
6695
|
m > 0 && B.push(m - 1), m < r.maxTierZoom && B.push(m + 1);
|
|
6782
6696
|
for (const M of B) {
|
|
6783
|
-
const
|
|
6784
|
-
for (const
|
|
6785
|
-
i.has(
|
|
6697
|
+
const T = u(M);
|
|
6698
|
+
for (const O of T)
|
|
6699
|
+
i.has(O.key) || (O.distance2 += R, P.push(O));
|
|
6786
6700
|
}
|
|
6787
6701
|
c.schedule(P), t.bindTexture(t.TEXTURE_2D, null), t.bindVertexArray(null);
|
|
6788
|
-
let
|
|
6702
|
+
let N = 0, Y = 0;
|
|
6789
6703
|
if (l.length > 0) {
|
|
6790
6704
|
t.enable(t.BLEND), t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA);
|
|
6791
6705
|
for (let M = 0; M < l.length; M += 1) {
|
|
6792
|
-
const
|
|
6793
|
-
|
|
6706
|
+
const T = l[M];
|
|
6707
|
+
T.pointCount <= 0 || (t.useProgram(T.pointProgram.program), t.bindVertexArray(T.pointProgram.vao), t.uniformMatrix3fv(T.pointProgram.uCamera, !1, n.getMatrix()), t.uniform1f(T.pointProgram.uPointSize, T.pointSizePx), t.uniform1f(T.pointProgram.uPointCssSize, T.pointCssSizePx), t.uniform2f(T.pointProgram.uPointLineDash, T.pointLineDash[0], T.pointLineDash[1]), t.uniform1f(T.pointProgram.uPointOpacity, T.pointOpacity), t.uniform1f(T.pointProgram.uPointStrokeScale, T.pointStrokeScale), t.uniform1f(T.pointProgram.uPointInnerFillAlpha, T.pointInnerFillOpacity), t.uniform3f(T.pointProgram.uPointInnerFillColor, T.pointInnerFillColor[0], T.pointInnerFillColor[1], T.pointInnerFillColor[2]), t.uniform1f(T.pointProgram.uPaletteSize, T.pointPaletteSize), t.uniform1i(T.pointProgram.uPalette, 1), t.activeTexture(t.TEXTURE1), t.bindTexture(t.TEXTURE_2D, T.pointProgram.paletteTexture), T.usePointIndices ? t.drawElements(t.POINTS, T.pointCount, t.UNSIGNED_INT, 0) : t.drawArrays(t.POINTS, 0, T.pointCount), N += T.pointCount, Y += 1);
|
|
6794
6708
|
}
|
|
6795
6709
|
t.bindTexture(t.TEXTURE_2D, null), t.bindVertexArray(null);
|
|
6796
6710
|
}
|
|
@@ -6798,7 +6712,7 @@ function Cc(e) {
|
|
|
6798
6712
|
tier: m,
|
|
6799
6713
|
visible: g.length,
|
|
6800
6714
|
rendered: E,
|
|
6801
|
-
points:
|
|
6715
|
+
points: N,
|
|
6802
6716
|
fallback: x.length,
|
|
6803
6717
|
cacheHits: E,
|
|
6804
6718
|
cacheMisses: w.length,
|
|
@@ -6851,7 +6765,7 @@ function ii(e) {
|
|
|
6851
6765
|
|
|
6852
6766
|
color.rgb = clamp(color.rgb + uBrightness, vec3(0.0), vec3(1.0));
|
|
6853
6767
|
outColor = color;
|
|
6854
|
-
}`), i =
|
|
6768
|
+
}`), i = Lt(e, r, "uCamera"), o = Lt(e, r, "uBounds"), s = Lt(e, r, "uTexture"), a = Lt(e, r, "uBrightness"), l = Lt(e, r, "uContrast"), c = Lt(e, r, "uSaturation"), f = e.createVertexArray(), u = e.createBuffer();
|
|
6855
6769
|
if (!f || !u)
|
|
6856
6770
|
throw new Error("buffer allocation failed");
|
|
6857
6771
|
e.bindVertexArray(f), e.bindBuffer(e.ARRAY_BUFFER, u), e.bufferData(e.ARRAY_BUFFER, new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1]), e.STATIC_DRAW);
|
|
@@ -6938,7 +6852,7 @@ function oi(e) {
|
|
|
6938
6852
|
vec3 fillRgb = (uPointInnerFillColor / 255.0) * fillAlpha * pointOpacity;
|
|
6939
6853
|
outColor = vec4(color.rgb * ringAlpha * pointOpacity + fillRgb, alpha);
|
|
6940
6854
|
}
|
|
6941
|
-
}`), i =
|
|
6855
|
+
}`), i = Lt(e, r, "uCamera"), o = Lt(e, r, "uPointSize"), s = Lt(e, r, "uPointCssSize"), a = Lt(e, r, "uPointOpacity"), l = Lt(e, r, "uPointStrokeScale"), c = Lt(e, r, "uPointInnerFillAlpha"), f = Lt(e, r, "uPointInnerFillColor"), u = Lt(e, r, "uPalette"), h = Lt(e, r, "uPaletteSize"), d = Lt(e, r, "uPointLineDash"), m = e.createVertexArray(), g = e.createBuffer(), y = e.createBuffer(), p = e.createBuffer(), x = e.createBuffer(), E = e.createTexture();
|
|
6942
6856
|
if (!m || !g || !y || !p || !x || !E)
|
|
6943
6857
|
throw new Error("point buffer allocation failed");
|
|
6944
6858
|
e.bindVertexArray(m), e.bindBuffer(e.ARRAY_BUFFER, g), e.bufferData(e.ARRAY_BUFFER, 0, e.DYNAMIC_DRAW);
|
|
@@ -6979,7 +6893,7 @@ function Qi(e) {
|
|
|
6979
6893
|
function Tc(e) {
|
|
6980
6894
|
const { state: t, camera: n, target: r, durationMs: i, easing: o, onUpdate: s } = e, a = n.getViewState();
|
|
6981
6895
|
Qi(t), t.animation = {
|
|
6982
|
-
startMs:
|
|
6896
|
+
startMs: Pt(),
|
|
6983
6897
|
durationMs: Math.max(0, i),
|
|
6984
6898
|
from: a,
|
|
6985
6899
|
to: r,
|
|
@@ -6988,7 +6902,7 @@ function Tc(e) {
|
|
|
6988
6902
|
const l = () => {
|
|
6989
6903
|
const c = t.animation;
|
|
6990
6904
|
if (!c) return;
|
|
6991
|
-
const f = Math.max(0,
|
|
6905
|
+
const f = Math.max(0, Pt() - c.startMs), u = c.durationMs <= 0 ? 1 : _(f / c.durationMs, 0, 1);
|
|
6992
6906
|
let h = u;
|
|
6993
6907
|
try {
|
|
6994
6908
|
h = c.easing(u);
|
|
@@ -7097,7 +7011,7 @@ function Bc(e, t, n, r, i) {
|
|
|
7097
7011
|
};
|
|
7098
7012
|
}, y = g(c);
|
|
7099
7013
|
e.viewAnimationState.animation = {
|
|
7100
|
-
startMs:
|
|
7014
|
+
startMs: Pt(),
|
|
7101
7015
|
durationMs: Math.max(0, i),
|
|
7102
7016
|
from: o,
|
|
7103
7017
|
to: { zoom: c, offsetX: y.offsetX, offsetY: y.offsetY, rotationDeg: o.rotationDeg },
|
|
@@ -7106,14 +7020,14 @@ function Bc(e, t, n, r, i) {
|
|
|
7106
7020
|
const p = () => {
|
|
7107
7021
|
const x = e.viewAnimationState.animation;
|
|
7108
7022
|
if (!x) return;
|
|
7109
|
-
const E = Math.max(0,
|
|
7110
|
-
e.camera.setViewState({ zoom: R, offsetX: B, offsetY:
|
|
7023
|
+
const E = Math.max(0, Pt() - x.startMs), w = _(E / i, 0, 1), P = _(w * w * (3 - 2 * w), 0, 1), R = o.zoom + (c - o.zoom) * P, { offsetX: B, offsetY: N } = g(R);
|
|
7024
|
+
e.camera.setViewState({ zoom: R, offsetX: B, offsetY: N, rotationDeg: o.rotationDeg });
|
|
7111
7025
|
const Y = w >= 1;
|
|
7112
7026
|
Y && (e.clampViewState(), e.viewAnimationState.animation = null, e.viewAnimationState.frame = null), e.onViewStateChange(e.camera.getViewState()), e.requestRender(), Y || (e.viewAnimationState.frame = requestAnimationFrame(p));
|
|
7113
7027
|
};
|
|
7114
7028
|
e.viewAnimationState.frame = requestAnimationFrame(p);
|
|
7115
7029
|
}
|
|
7116
|
-
const
|
|
7030
|
+
const Nt = "__default_point_layer__";
|
|
7117
7031
|
class Uc {
|
|
7118
7032
|
constructor(t, n, r = {}) {
|
|
7119
7033
|
S(this, "canvas");
|
|
@@ -7192,7 +7106,8 @@ class Uc {
|
|
|
7192
7106
|
antialias: !1,
|
|
7193
7107
|
depth: !1,
|
|
7194
7108
|
stencil: !1,
|
|
7195
|
-
powerPreference: "high-performance"
|
|
7109
|
+
powerPreference: "high-performance",
|
|
7110
|
+
preserveDrawingBuffer: r.preserveDrawingBuffer ?? !1
|
|
7196
7111
|
});
|
|
7197
7112
|
if (!i)
|
|
7198
7113
|
throw new Error("WebGL2 not supported");
|
|
@@ -7260,7 +7175,7 @@ class Uc {
|
|
|
7260
7175
|
Qi(this.viewAnimationState);
|
|
7261
7176
|
}
|
|
7262
7177
|
startViewAnimation(t, n, r) {
|
|
7263
|
-
Tc({
|
|
7178
|
+
this.resetZoomSnapStateForZoomChange(this.camera.getViewState().zoom, t.zoom), Tc({
|
|
7264
7179
|
state: this.viewAnimationState,
|
|
7265
7180
|
camera: this.camera,
|
|
7266
7181
|
target: t,
|
|
@@ -7297,8 +7212,8 @@ class Uc {
|
|
|
7297
7212
|
pointInnerFillColor: [...this.defaultPointInnerFillColor]
|
|
7298
7213
|
};
|
|
7299
7214
|
}
|
|
7300
|
-
ensurePointLayer(t =
|
|
7301
|
-
const n = String(t ||
|
|
7215
|
+
ensurePointLayer(t = Nt) {
|
|
7216
|
+
const n = String(t || Nt), r = this.pointLayers.get(n);
|
|
7302
7217
|
if (r) return r;
|
|
7303
7218
|
const i = this.createPointLayerState(n);
|
|
7304
7219
|
return this.pointLayers.set(n, i), i;
|
|
@@ -7326,8 +7241,15 @@ class Uc {
|
|
|
7326
7241
|
}
|
|
7327
7242
|
return n;
|
|
7328
7243
|
}
|
|
7244
|
+
resetZoomSnapState() {
|
|
7245
|
+
this.zoomSnapState.accumulatedDelta = 0, this.zoomSnapState.lastSnapTimeMs = 0, this.zoomSnapState.blockedDirection = null;
|
|
7246
|
+
}
|
|
7247
|
+
resetZoomSnapStateForZoomChange(t, n) {
|
|
7248
|
+
Math.abs(t - n) < 1e-6 || this.resetZoomSnapState();
|
|
7249
|
+
}
|
|
7329
7250
|
applyViewStateAndRender(t, n = !0) {
|
|
7330
|
-
|
|
7251
|
+
const r = this.camera.getViewState();
|
|
7252
|
+
n && this.cancelViewAnimation(), this.resetZoomSnapStateForZoomChange(r.zoom, t.zoom), this.camera.setViewState(t), this.onViewStateChange?.(this.camera.getViewState()), this.requestRender();
|
|
7331
7253
|
}
|
|
7332
7254
|
setAuthToken(t) {
|
|
7333
7255
|
this.authToken = String(t ?? ""), this.tileScheduler.setAuthToken(this.authToken);
|
|
@@ -7336,7 +7258,7 @@ class Uc {
|
|
|
7336
7258
|
const r = Ye(t), i = Ye(n);
|
|
7337
7259
|
if (this.minZoomOverride === r && this.maxZoomOverride === i)
|
|
7338
7260
|
return;
|
|
7339
|
-
this.minZoomOverride = r, this.maxZoomOverride = i, this.applyZoomBounds();
|
|
7261
|
+
this.minZoomOverride = r, this.maxZoomOverride = i, this.applyZoomBounds(), this.resetZoomSnapState();
|
|
7340
7262
|
const o = this.resolveTargetViewState({}), s = this.camera.getViewState();
|
|
7341
7263
|
cr(s, o) || this.applyViewStateAndRender(o);
|
|
7342
7264
|
}
|
|
@@ -7370,18 +7292,18 @@ class Uc {
|
|
|
7370
7292
|
this.ensurePointLayer(t);
|
|
7371
7293
|
}
|
|
7372
7294
|
unregisterPointLayer(t) {
|
|
7373
|
-
const n = String(t ||
|
|
7295
|
+
const n = String(t || Nt), r = this.pointLayers.get(n);
|
|
7374
7296
|
r && (this.pointLayers.delete(n), this.deletePointProgram(r.program), this.requestRender());
|
|
7375
7297
|
}
|
|
7376
|
-
setPointPalette(t, n =
|
|
7298
|
+
setPointPalette(t, n = Nt) {
|
|
7377
7299
|
const r = this.ensurePointLayer(n);
|
|
7378
7300
|
r.runtime = ni(r.runtime, this.gl, r.program, this.contextLost, t), !(!t || t.length === 0) && this.requestRender();
|
|
7379
7301
|
}
|
|
7380
|
-
setPointLineDash(t, n =
|
|
7302
|
+
setPointLineDash(t, n = Nt) {
|
|
7381
7303
|
const r = this.ensurePointLayer(n), i = ec(t);
|
|
7382
7304
|
r.pointLineDash[0] === i[0] && r.pointLineDash[1] === i[1] || (r.pointLineDash = i, this.requestRender());
|
|
7383
7305
|
}
|
|
7384
|
-
setPointData(t, n =
|
|
7306
|
+
setPointData(t, n = Nt) {
|
|
7385
7307
|
const r = this.ensurePointLayer(n);
|
|
7386
7308
|
r.runtime = ri(r.runtime, this.gl, r.program, this.contextLost, t), this.requestRender();
|
|
7387
7309
|
}
|
|
@@ -7389,31 +7311,31 @@ class Uc {
|
|
|
7389
7311
|
const n = !!t;
|
|
7390
7312
|
this.interactionLocked !== n && (this.interactionLocked = n, n && this.cancelDrag());
|
|
7391
7313
|
}
|
|
7392
|
-
setPointSizeByZoom(t, n =
|
|
7314
|
+
setPointSizeByZoom(t, n = Nt) {
|
|
7393
7315
|
const r = this.ensurePointLayer(n), i = $r(t);
|
|
7394
7316
|
$l(r.pointSizeZoomStops, i) || (r.pointSizeZoomStops = i, this.requestRender());
|
|
7395
7317
|
}
|
|
7396
|
-
setPointSizeByMagnification(t, n =
|
|
7318
|
+
setPointSizeByMagnification(t, n = Nt) {
|
|
7397
7319
|
const r = this.ensurePointLayer(n), i = Kr(t);
|
|
7398
7320
|
Kl(r.pointSizeMagnificationStops, i) || (r.pointSizeMagnificationStops = i, this.requestRender());
|
|
7399
7321
|
}
|
|
7400
|
-
setPointWeightByMagnification(t, n =
|
|
7322
|
+
setPointWeightByMagnification(t, n = Nt) {
|
|
7401
7323
|
const r = this.ensurePointLayer(n), i = jr(t);
|
|
7402
7324
|
jl(r.pointWeightMagnificationStops, i) || (r.pointWeightMagnificationStops = i, this.requestRender());
|
|
7403
7325
|
}
|
|
7404
|
-
setPointOpacity(t, n =
|
|
7326
|
+
setPointOpacity(t, n = Nt) {
|
|
7405
7327
|
const r = this.ensurePointLayer(n), i = Qr(t);
|
|
7406
7328
|
r.pointOpacity !== i && (r.pointOpacity = i, this.requestRender());
|
|
7407
7329
|
}
|
|
7408
|
-
setPointStrokeScale(t, n =
|
|
7330
|
+
setPointStrokeScale(t, n = Nt) {
|
|
7409
7331
|
const r = this.ensurePointLayer(n), i = qe(t);
|
|
7410
7332
|
r.pointStrokeScale !== i && (r.pointStrokeScale = i, this.requestRender());
|
|
7411
7333
|
}
|
|
7412
|
-
setPointInnerFillOpacity(t, n =
|
|
7334
|
+
setPointInnerFillOpacity(t, n = Nt) {
|
|
7413
7335
|
const r = this.ensurePointLayer(n), i = Jr(t);
|
|
7414
7336
|
r.pointInnerFillOpacity !== i && (r.pointInnerFillOpacity = i, this.requestRender());
|
|
7415
7337
|
}
|
|
7416
|
-
setPointInnerFillColor(t, n =
|
|
7338
|
+
setPointInnerFillColor(t, n = Nt) {
|
|
7417
7339
|
const r = this.ensurePointLayer(n), i = ti(t);
|
|
7418
7340
|
r.pointInnerFillColor[0] === i[0] && r.pointInnerFillColor[1] === i[1] && r.pointInnerFillColor[2] === i[2] || (r.pointInnerFillColor = i, this.requestRender());
|
|
7419
7341
|
}
|
|
@@ -7455,8 +7377,8 @@ class Uc {
|
|
|
7455
7377
|
const n = this.camera.getViewState();
|
|
7456
7378
|
Math.abs(n.rotationDeg - this.initialRotationDeg) < 1e-6 || this.setViewState({ rotationDeg: this.initialRotationDeg }, t);
|
|
7457
7379
|
}
|
|
7458
|
-
getPointSize(t =
|
|
7459
|
-
const n = this.pointLayers.get(String(t ||
|
|
7380
|
+
getPointSize(t = Nt) {
|
|
7381
|
+
const n = this.pointLayers.get(String(t || Nt)), r = n?.pointSizeMagnificationStops ?? this.defaultPointSizeMagnificationStops;
|
|
7460
7382
|
if (r && r.length > 0) {
|
|
7461
7383
|
const l = Math.max(1e-6, this.camera.getViewState().zoom), c = lr(this.source.mpp ?? 0, l);
|
|
7462
7384
|
if (c > 0) {
|
|
@@ -7467,11 +7389,11 @@ class Uc {
|
|
|
7467
7389
|
const i = Math.max(1e-6, this.camera.getViewState().zoom), o = this.source.maxTierZoom + Math.log2(i), s = n?.pointSizeZoomStops ?? this.defaultPointSizeZoomStops, a = Ql(o, s);
|
|
7468
7390
|
return _(a, me, Hr);
|
|
7469
7391
|
}
|
|
7470
|
-
getPointSizeByZoom(t =
|
|
7392
|
+
getPointSizeByZoom(t = Nt) {
|
|
7471
7393
|
return this.getPointSize(t);
|
|
7472
7394
|
}
|
|
7473
|
-
getPointStrokeScale(t =
|
|
7474
|
-
const n = this.pointLayers.get(String(t ||
|
|
7395
|
+
getPointStrokeScale(t = Nt) {
|
|
7396
|
+
const n = this.pointLayers.get(String(t || Nt)), r = n?.pointWeightMagnificationStops ?? this.defaultPointWeightMagnificationStops;
|
|
7475
7397
|
if (r && r.length > 0) {
|
|
7476
7398
|
const i = Math.max(1e-6, this.camera.getViewState().zoom), o = lr(this.source.mpp ?? 0, i);
|
|
7477
7399
|
if (o > 0)
|
|
@@ -7499,7 +7421,7 @@ class Uc {
|
|
|
7499
7421
|
o && this.setViewState(o, i);
|
|
7500
7422
|
}
|
|
7501
7423
|
setZoomSnaps(t, n) {
|
|
7502
|
-
this.zoomSnaps = ai(t, this.source.mpp), this.zoomSnapFitAsMin = !!n;
|
|
7424
|
+
this.zoomSnaps = ai(t, this.source.mpp), this.zoomSnapFitAsMin = !!n, this.resetZoomSnapState();
|
|
7503
7425
|
}
|
|
7504
7426
|
setPanExtent(t) {
|
|
7505
7427
|
this.applyPanExtent(t);
|
|
@@ -7538,7 +7460,7 @@ class Uc {
|
|
|
7538
7460
|
}
|
|
7539
7461
|
render() {
|
|
7540
7462
|
if (this.destroyed || this.contextLost || this.gl.isContextLost()) return;
|
|
7541
|
-
const t = this.onStats ?
|
|
7463
|
+
const t = this.onStats ? Pt() : 0;
|
|
7542
7464
|
this.frameSerial += 1;
|
|
7543
7465
|
const n = Cc({
|
|
7544
7466
|
gl: this.gl,
|
|
@@ -7572,7 +7494,7 @@ class Uc {
|
|
|
7572
7494
|
cacheHits: n.cacheHits,
|
|
7573
7495
|
cacheMisses: n.cacheMisses,
|
|
7574
7496
|
drawCalls: n.drawCalls,
|
|
7575
|
-
frameMs:
|
|
7497
|
+
frameMs: Pt() - t
|
|
7576
7498
|
});
|
|
7577
7499
|
}
|
|
7578
7500
|
}
|
|
@@ -7659,28 +7581,29 @@ function bu({
|
|
|
7659
7581
|
zoomSnaps: y,
|
|
7660
7582
|
zoomSnapFitAsMin: p,
|
|
7661
7583
|
panExtent: x,
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7584
|
+
preserveDrawingBuffer: E,
|
|
7585
|
+
onPointerWorldMove: w,
|
|
7586
|
+
debugOverlay: P = !1,
|
|
7587
|
+
debugOverlayStyle: R,
|
|
7588
|
+
className: B,
|
|
7589
|
+
style: N,
|
|
7590
|
+
children: Y
|
|
7668
7591
|
}) {
|
|
7669
|
-
const
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
}, [n]),
|
|
7673
|
-
|
|
7674
|
-
}, [r]),
|
|
7675
|
-
|
|
7676
|
-
}, [i]),
|
|
7677
|
-
|
|
7678
|
-
}, [o]),
|
|
7679
|
-
|
|
7680
|
-
}, [s]),
|
|
7681
|
-
|
|
7682
|
-
}, [
|
|
7683
|
-
const
|
|
7592
|
+
const M = q(null), T = q(null), O = q(null), v = q(null), W = q(null), J = q(null), F = q(kc), xt = q(!1), ft = q(/* @__PURE__ */ new Set()), tt = q(/* @__PURE__ */ new Set()), _t = q(n), Ct = q(r), L = q(i), C = q(o), U = q(s), [lt, dt] = ae(0), [j, ht] = ae(null), rt = q(P);
|
|
7593
|
+
z(() => {
|
|
7594
|
+
_t.current = n;
|
|
7595
|
+
}, [n]), z(() => {
|
|
7596
|
+
Ct.current = r;
|
|
7597
|
+
}, [r]), z(() => {
|
|
7598
|
+
L.current = i;
|
|
7599
|
+
}, [i]), z(() => {
|
|
7600
|
+
C.current = o;
|
|
7601
|
+
}, [o]), z(() => {
|
|
7602
|
+
U.current = s;
|
|
7603
|
+
}, [s]), z(() => {
|
|
7604
|
+
rt.current = P, P || ht(null);
|
|
7605
|
+
}, [P]);
|
|
7606
|
+
const Dt = at(() => ({ position: "relative", width: "100%", height: "100%", ...N }), [N]), Rt = at(
|
|
7684
7607
|
() => ({
|
|
7685
7608
|
position: "absolute",
|
|
7686
7609
|
top: 8,
|
|
@@ -7699,98 +7622,98 @@ function bu({
|
|
|
7699
7622
|
border: "1px solid rgba(173, 216, 255, 0.28)",
|
|
7700
7623
|
borderRadius: 8,
|
|
7701
7624
|
boxShadow: "0 8px 22px rgba(0,0,0,0.35)",
|
|
7702
|
-
...
|
|
7625
|
+
...R
|
|
7703
7626
|
}),
|
|
7704
|
-
[
|
|
7705
|
-
),
|
|
7706
|
-
(
|
|
7707
|
-
...
|
|
7708
|
-
rotationDeg:
|
|
7627
|
+
[R]
|
|
7628
|
+
), mt = Oc(l), At = V(
|
|
7629
|
+
(k) => ({
|
|
7630
|
+
...k,
|
|
7631
|
+
rotationDeg: k.rotationDeg - mt
|
|
7709
7632
|
}),
|
|
7710
|
-
[
|
|
7711
|
-
),
|
|
7712
|
-
(
|
|
7713
|
-
...
|
|
7714
|
-
rotationDeg:
|
|
7633
|
+
[mt]
|
|
7634
|
+
), nt = V(
|
|
7635
|
+
(k) => typeof k.rotationDeg != "number" || !Number.isFinite(k.rotationDeg) ? k : {
|
|
7636
|
+
...k,
|
|
7637
|
+
rotationDeg: k.rotationDeg + mt
|
|
7715
7638
|
},
|
|
7716
|
-
[
|
|
7717
|
-
),
|
|
7718
|
-
|
|
7719
|
-
}, []),
|
|
7720
|
-
`tier ${
|
|
7721
|
-
`tiles visible ${
|
|
7722
|
-
`cache size ${
|
|
7723
|
-
`queue inflight ${
|
|
7724
|
-
`points ${
|
|
7639
|
+
[mt]
|
|
7640
|
+
), ct = V((k) => {
|
|
7641
|
+
Ct.current?.(k), rt.current && ht(k);
|
|
7642
|
+
}, []), gt = at(() => j ? [
|
|
7643
|
+
`tier ${j.tier} | frame ${j.frameMs?.toFixed(2) ?? "-"} ms | drawCalls ${j.drawCalls ?? "-"}`,
|
|
7644
|
+
`tiles visible ${j.visible} | rendered ${j.rendered} | fallback ${j.fallback}`,
|
|
7645
|
+
`cache size ${j.cache} | hit ${j.cacheHits ?? "-"} | miss ${j.cacheMisses ?? "-"}`,
|
|
7646
|
+
`queue inflight ${j.inflight} | queued ${j.queued ?? "-"} | retries ${j.retries ?? "-"} | failed ${j.failed ?? "-"} | aborted ${j.aborted ?? "-"}`,
|
|
7647
|
+
`points ${j.points}`
|
|
7725
7648
|
].join(`
|
|
7726
|
-
`) : "stats: waiting for first frame...", [
|
|
7727
|
-
const
|
|
7728
|
-
if (!
|
|
7729
|
-
const
|
|
7730
|
-
if (!
|
|
7731
|
-
const
|
|
7732
|
-
(
|
|
7733
|
-
const
|
|
7734
|
-
|
|
7735
|
-
const
|
|
7736
|
-
for (let
|
|
7737
|
-
|
|
7738
|
-
}, []),
|
|
7739
|
-
|
|
7740
|
-
|
|
7649
|
+
`) : "stats: waiting for first frame...", [j]), ut = V(() => {
|
|
7650
|
+
const k = O.current;
|
|
7651
|
+
if (!k) return;
|
|
7652
|
+
const H = k.getContext("2d");
|
|
7653
|
+
if (!H) return;
|
|
7654
|
+
const $ = Math.max(1, window.devicePixelRatio || 1), ot = k.getBoundingClientRect(), bt = Math.max(1, Math.round(ot.width * $)), pt = Math.max(1, Math.round(ot.height * $));
|
|
7655
|
+
(k.width !== bt || k.height !== pt) && (k.width = bt, k.height = pt);
|
|
7656
|
+
const Ut = ot.width, b = ot.height;
|
|
7657
|
+
H.setTransform(1, 0, 0, 1, 0, 0), H.clearRect(0, 0, k.width, k.height), H.setTransform($, 0, 0, $, 0, 0);
|
|
7658
|
+
const A = F.current;
|
|
7659
|
+
for (let I = 0; I < A.length; I += 1)
|
|
7660
|
+
H.save(), A[I].draw(H, Ut, b), H.restore();
|
|
7661
|
+
}, []), it = V(() => {
|
|
7662
|
+
xt.current || (xt.current = !0, requestAnimationFrame(() => {
|
|
7663
|
+
xt.current = !1, ut();
|
|
7741
7664
|
}));
|
|
7742
|
-
}, [
|
|
7743
|
-
(
|
|
7744
|
-
const
|
|
7745
|
-
|
|
7665
|
+
}, [ut]), vt = V(
|
|
7666
|
+
(k, H, $) => {
|
|
7667
|
+
const ot = F.current.filter((bt) => bt.id !== k);
|
|
7668
|
+
ot.push({ id: k, priority: H, draw: $ }), ot.sort((bt, pt) => bt.priority - pt.priority), F.current = ot, it();
|
|
7746
7669
|
},
|
|
7747
|
-
[
|
|
7748
|
-
),
|
|
7749
|
-
(
|
|
7750
|
-
|
|
7670
|
+
[it]
|
|
7671
|
+
), Et = V(
|
|
7672
|
+
(k) => {
|
|
7673
|
+
F.current = F.current.filter((H) => H.id !== k), it();
|
|
7751
7674
|
},
|
|
7752
|
-
[
|
|
7753
|
-
),
|
|
7754
|
-
|
|
7755
|
-
}, []),
|
|
7756
|
-
const
|
|
7757
|
-
return
|
|
7758
|
-
}, []),
|
|
7759
|
-
const
|
|
7760
|
-
if (
|
|
7761
|
-
const
|
|
7762
|
-
if (!Array.isArray(
|
|
7763
|
-
const
|
|
7764
|
-
return !Number.isFinite(
|
|
7765
|
-
}, []),
|
|
7766
|
-
|
|
7767
|
-
}), []),
|
|
7768
|
-
(
|
|
7769
|
-
|
|
7770
|
-
const
|
|
7771
|
-
if (
|
|
7772
|
-
const
|
|
7773
|
-
for (let
|
|
7774
|
-
|
|
7675
|
+
[it]
|
|
7676
|
+
), G = V((k, H) => {
|
|
7677
|
+
H ? ft.current.add(k) : ft.current.delete(k), v.current?.setInteractionLock(ft.current.size > 0);
|
|
7678
|
+
}, []), K = V(() => ft.current.size > 0, []), St = V((k, H) => {
|
|
7679
|
+
const $ = v.current;
|
|
7680
|
+
return $ ? Nn($.worldToScreen(k, H)) : null;
|
|
7681
|
+
}, []), et = V((k, H) => {
|
|
7682
|
+
const $ = v.current;
|
|
7683
|
+
if (!$) return null;
|
|
7684
|
+
const ot = $.screenToWorld(k, H);
|
|
7685
|
+
if (!Array.isArray(ot) || ot.length < 2) return null;
|
|
7686
|
+
const bt = Number(ot[0]), pt = Number(ot[1]);
|
|
7687
|
+
return !Number.isFinite(bt) || !Number.isFinite(pt) ? null : [bt, pt];
|
|
7688
|
+
}, []), Q = V((k) => (tt.current.add(k), () => {
|
|
7689
|
+
tt.current.delete(k);
|
|
7690
|
+
}), []), Mt = V(
|
|
7691
|
+
(k) => {
|
|
7692
|
+
_t.current?.(At(k));
|
|
7693
|
+
const H = tt.current;
|
|
7694
|
+
if (H.size > 0) {
|
|
7695
|
+
const $ = Array.from(H);
|
|
7696
|
+
for (let ot = 0; ot < $.length; ot += 1)
|
|
7697
|
+
$[ot](k);
|
|
7775
7698
|
}
|
|
7776
|
-
|
|
7699
|
+
W.current?.(), J.current?.(), it();
|
|
7777
7700
|
},
|
|
7778
|
-
[
|
|
7701
|
+
[it, At]
|
|
7779
7702
|
);
|
|
7780
|
-
|
|
7781
|
-
const
|
|
7782
|
-
if (!
|
|
7783
|
-
const
|
|
7784
|
-
onViewStateChange:
|
|
7785
|
-
onStats:
|
|
7786
|
-
onTileError: (
|
|
7787
|
-
|
|
7703
|
+
z(() => {
|
|
7704
|
+
const k = T.current;
|
|
7705
|
+
if (!k || !e) return;
|
|
7706
|
+
const H = new Uc(k, e, {
|
|
7707
|
+
onViewStateChange: Mt,
|
|
7708
|
+
onStats: ct,
|
|
7709
|
+
onTileError: ($) => {
|
|
7710
|
+
L.current?.($);
|
|
7788
7711
|
},
|
|
7789
7712
|
onContextLost: () => {
|
|
7790
|
-
|
|
7713
|
+
C.current?.();
|
|
7791
7714
|
},
|
|
7792
7715
|
onContextRestored: () => {
|
|
7793
|
-
|
|
7716
|
+
U.current?.();
|
|
7794
7717
|
},
|
|
7795
7718
|
authToken: u,
|
|
7796
7719
|
imageColorSettings: a,
|
|
@@ -7801,86 +7724,87 @@ function bu({
|
|
|
7801
7724
|
viewTransition: g,
|
|
7802
7725
|
zoomSnaps: y,
|
|
7803
7726
|
zoomSnapFitAsMin: p,
|
|
7804
|
-
panExtent: x
|
|
7727
|
+
panExtent: x,
|
|
7728
|
+
preserveDrawingBuffer: E
|
|
7805
7729
|
});
|
|
7806
|
-
return
|
|
7807
|
-
|
|
7730
|
+
return v.current = H, dt(($) => $ + 1), t && H.setViewState(nt(t)), H.setInteractionLock(ft.current.size > 0), () => {
|
|
7731
|
+
H.destroy(), v.current = null;
|
|
7808
7732
|
};
|
|
7809
|
-
}, [e,
|
|
7810
|
-
|
|
7811
|
-
}, [u]),
|
|
7812
|
-
const
|
|
7813
|
-
!
|
|
7814
|
-
}, [t,
|
|
7815
|
-
|
|
7816
|
-
}, [c]),
|
|
7817
|
-
|
|
7818
|
-
}, [f]),
|
|
7819
|
-
|
|
7820
|
-
}, [d, m]),
|
|
7821
|
-
|
|
7822
|
-
}, [g]),
|
|
7823
|
-
|
|
7824
|
-
}, [y, p]),
|
|
7825
|
-
|
|
7826
|
-
}, [x]),
|
|
7827
|
-
|
|
7828
|
-
}, [a]),
|
|
7829
|
-
const
|
|
7830
|
-
if (!
|
|
7831
|
-
|
|
7832
|
-
const
|
|
7833
|
-
return
|
|
7834
|
-
|
|
7733
|
+
}, [e, ct, h, Mt, mt, nt]), z(() => {
|
|
7734
|
+
v.current?.setAuthToken(u);
|
|
7735
|
+
}, [u]), z(() => {
|
|
7736
|
+
const k = v.current;
|
|
7737
|
+
!k || !t || k.isViewAnimating() || k.setViewState(nt(t));
|
|
7738
|
+
}, [t, nt]), z(() => {
|
|
7739
|
+
v.current?.fitToImage();
|
|
7740
|
+
}, [c]), z(() => {
|
|
7741
|
+
v.current?.resetRotation();
|
|
7742
|
+
}, [f]), z(() => {
|
|
7743
|
+
v.current?.setZoomRange(d, m);
|
|
7744
|
+
}, [d, m]), z(() => {
|
|
7745
|
+
v.current?.setViewTransition(g);
|
|
7746
|
+
}, [g]), z(() => {
|
|
7747
|
+
v.current?.setZoomSnaps(y, p);
|
|
7748
|
+
}, [y, p]), z(() => {
|
|
7749
|
+
v.current?.setPanExtent(x);
|
|
7750
|
+
}, [x]), z(() => {
|
|
7751
|
+
v.current?.setImageColorSettings(a);
|
|
7752
|
+
}, [a]), z(() => {
|
|
7753
|
+
const k = O.current;
|
|
7754
|
+
if (!k) return;
|
|
7755
|
+
W.current = it, it();
|
|
7756
|
+
const H = new ResizeObserver(() => it());
|
|
7757
|
+
return H.observe(k), () => {
|
|
7758
|
+
H.disconnect(), W.current === it && (W.current = null);
|
|
7835
7759
|
};
|
|
7836
|
-
}, [
|
|
7837
|
-
const
|
|
7760
|
+
}, [it]), z(() => sn(() => it()), [it]);
|
|
7761
|
+
const X = at(
|
|
7838
7762
|
() => ({
|
|
7839
7763
|
source: e,
|
|
7840
|
-
rendererRef:
|
|
7841
|
-
rendererSerial:
|
|
7842
|
-
canvasRef:
|
|
7843
|
-
containerRef:
|
|
7844
|
-
drawInvalidateRef:
|
|
7845
|
-
overviewInvalidateRef:
|
|
7846
|
-
worldToScreen:
|
|
7847
|
-
screenToWorld:
|
|
7848
|
-
registerDrawCallback:
|
|
7849
|
-
unregisterDrawCallback:
|
|
7850
|
-
requestOverlayRedraw:
|
|
7851
|
-
registerViewStateListener:
|
|
7852
|
-
setInteractionLock:
|
|
7853
|
-
isInteractionLocked:
|
|
7764
|
+
rendererRef: v,
|
|
7765
|
+
rendererSerial: lt,
|
|
7766
|
+
canvasRef: T,
|
|
7767
|
+
containerRef: M,
|
|
7768
|
+
drawInvalidateRef: W,
|
|
7769
|
+
overviewInvalidateRef: J,
|
|
7770
|
+
worldToScreen: St,
|
|
7771
|
+
screenToWorld: et,
|
|
7772
|
+
registerDrawCallback: vt,
|
|
7773
|
+
unregisterDrawCallback: Et,
|
|
7774
|
+
requestOverlayRedraw: it,
|
|
7775
|
+
registerViewStateListener: Q,
|
|
7776
|
+
setInteractionLock: G,
|
|
7777
|
+
isInteractionLocked: K
|
|
7854
7778
|
}),
|
|
7855
|
-
[e,
|
|
7856
|
-
),
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
}, [
|
|
7860
|
-
const
|
|
7861
|
-
(
|
|
7862
|
-
const
|
|
7863
|
-
if (!
|
|
7864
|
-
const
|
|
7865
|
-
|
|
7779
|
+
[e, lt, St, et, vt, Et, it, Q, G, K]
|
|
7780
|
+
), Tt = q(w);
|
|
7781
|
+
z(() => {
|
|
7782
|
+
Tt.current = w;
|
|
7783
|
+
}, [w]);
|
|
7784
|
+
const Bt = V(
|
|
7785
|
+
(k) => {
|
|
7786
|
+
const H = Tt.current;
|
|
7787
|
+
if (!H) return;
|
|
7788
|
+
const $ = et(k.clientX, k.clientY), ot = !!$ && $[0] >= 0 && $[1] >= 0 && !!e && $[0] <= e.width && $[1] <= e.height;
|
|
7789
|
+
H({ coordinate: $, clientX: k.clientX, clientY: k.clientY, insideImage: ot });
|
|
7866
7790
|
},
|
|
7867
|
-
[
|
|
7868
|
-
),
|
|
7869
|
-
|
|
7791
|
+
[et, e]
|
|
7792
|
+
), zt = V(() => {
|
|
7793
|
+
Tt.current?.({ coordinate: null, clientX: -1, clientY: -1, insideImage: !1 });
|
|
7870
7794
|
}, []);
|
|
7871
|
-
return /* @__PURE__ */ Qt(oa, { value:
|
|
7795
|
+
return /* @__PURE__ */ Qt(oa, { value: X, children: /* @__PURE__ */ ci(
|
|
7872
7796
|
"div",
|
|
7873
7797
|
{
|
|
7874
|
-
ref:
|
|
7875
|
-
className:
|
|
7876
|
-
style:
|
|
7877
|
-
onPointerMove:
|
|
7878
|
-
onPointerLeave:
|
|
7798
|
+
ref: M,
|
|
7799
|
+
className: B,
|
|
7800
|
+
style: Dt,
|
|
7801
|
+
onPointerMove: w ? Bt : void 0,
|
|
7802
|
+
onPointerLeave: w ? zt : void 0,
|
|
7879
7803
|
children: [
|
|
7880
7804
|
/* @__PURE__ */ Qt(
|
|
7881
7805
|
"canvas",
|
|
7882
7806
|
{
|
|
7883
|
-
ref:
|
|
7807
|
+
ref: T,
|
|
7884
7808
|
className: "wsi-render-canvas",
|
|
7885
7809
|
style: {
|
|
7886
7810
|
position: "absolute",
|
|
@@ -7896,7 +7820,7 @@ function bu({
|
|
|
7896
7820
|
/* @__PURE__ */ Qt(
|
|
7897
7821
|
"canvas",
|
|
7898
7822
|
{
|
|
7899
|
-
ref:
|
|
7823
|
+
ref: O,
|
|
7900
7824
|
className: "wsi-overlay-canvas",
|
|
7901
7825
|
style: {
|
|
7902
7826
|
position: "absolute",
|
|
@@ -7910,8 +7834,8 @@ function bu({
|
|
|
7910
7834
|
}
|
|
7911
7835
|
}
|
|
7912
7836
|
),
|
|
7913
|
-
|
|
7914
|
-
|
|
7837
|
+
Y,
|
|
7838
|
+
P && /* @__PURE__ */ Qt("pre", { "data-open-plant-debug-overlay": !0, style: Rt, children: gt })
|
|
7915
7839
|
]
|
|
7916
7840
|
}
|
|
7917
7841
|
) });
|
|
@@ -8033,8 +7957,8 @@ function wu(e, t, n = {}) {
|
|
|
8033
7957
|
for (const P of x) {
|
|
8034
7958
|
const R = s[P];
|
|
8035
7959
|
let B = !1;
|
|
8036
|
-
for (const
|
|
8037
|
-
if (gi(g, y,
|
|
7960
|
+
for (const N of R.polygons)
|
|
7961
|
+
if (gi(g, y, N)) {
|
|
8038
7962
|
B = !0;
|
|
8039
7963
|
break;
|
|
8040
7964
|
}
|