mudlet-map-renderer 2.6.0 → 2.6.1
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/{SkeletonMapReader-B6PzEWGP.js → SkeletonMapReader-ZPwsqemZ.js} +14 -3
- package/dist/SkeletonMapReader-ZPwsqemZ.js.map +1 -0
- package/dist/bigmap/Skeleton.d.ts +2 -0
- package/dist/bigmap/SkeletonMapReader.d.ts +7 -1
- package/dist/bigmap.mjs +14 -13
- package/dist/bigmap.mjs.map +1 -1
- package/dist/binary/loadMudletMap.d.ts +13 -0
- package/dist/binary.mjs +36 -35
- package/dist/binary.mjs.map +1 -1
- package/dist/export/exportViewport.d.ts +25 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +506 -476
- package/dist/index.mjs.map +1 -1
- package/dist/reader/HashLookup.d.ts +17 -0
- package/package.json +1 -1
- package/dist/SkeletonMapReader-B6PzEWGP.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, L as l, M as u, N as d, O as f, P as p, R as m, S as h, T as g, U as _, V as v, W as y, _ as b, a as x, b as S, c as C, d as
|
|
2
|
-
import { r as
|
|
3
|
-
import { t as
|
|
4
|
-
import
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, L as l, M as u, N as d, O as f, P as p, R as m, S as h, T as g, U as _, V as v, W as y, _ as b, a as x, b as S, c as C, d as ee, f as te, g as ne, h as w, i as re, j as T, k as ie, l as ae, m as oe, n as se, o as ce, p as le, r as E, s as ue, u as de, v as fe, w as pe, x as me, y as he, z as ge } from "./flushSceneShapes-c7ttw7D-.js";
|
|
2
|
+
import { r as _e, t as ve } from "./Area-MLM4Xe0E.js";
|
|
3
|
+
import { t as ye } from "./MapReader-BeVNpm6y.js";
|
|
4
|
+
import D from "konva";
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
6
|
-
var
|
|
7
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
6
|
+
var be = Object.create, xe = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, Ce = Object.getOwnPropertyNames, we = Object.getPrototypeOf, Te = Object.prototype.hasOwnProperty, O = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Ee = (e, t, n, r) => {
|
|
7
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = Ce(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !Te.call(e, s) && s !== n && xe(e, s, {
|
|
8
8
|
get: ((e) => t[e]).bind(null, s),
|
|
9
|
-
enumerable: !(r =
|
|
9
|
+
enumerable: !(r = Se(t, s)) || r.enumerable
|
|
10
10
|
});
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, De = (e, t, n) => (n = e == null ? {} : be(we(e)), Ee(t || !e || !e.__esModule ? xe(n, "default", {
|
|
13
13
|
value: e,
|
|
14
14
|
enumerable: !0
|
|
15
|
-
}) : n, e)),
|
|
16
|
-
function
|
|
15
|
+
}) : n, e)), Oe = .6, ke = .025, Ae = "rgb(225, 225, 225)";
|
|
16
|
+
function je() {
|
|
17
17
|
return {
|
|
18
|
-
roomSize:
|
|
19
|
-
lineWidth:
|
|
20
|
-
lineColor:
|
|
18
|
+
roomSize: Oe,
|
|
19
|
+
lineWidth: ke,
|
|
20
|
+
lineColor: Ae,
|
|
21
21
|
backgroundColor: "#000000",
|
|
22
22
|
instantMapMove: !1,
|
|
23
23
|
highlightCurrentRoom: !0,
|
|
@@ -73,7 +73,7 @@ function ke() {
|
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/MapState.ts
|
|
76
|
-
var
|
|
76
|
+
var Me = class {
|
|
77
77
|
constructor(e, t) {
|
|
78
78
|
this.events = new p(), this.highlights = /* @__PURE__ */ new Map(), this.paths = [], this.lens = u, this.mapReader = e, this.settings = t;
|
|
79
79
|
}
|
|
@@ -208,7 +208,7 @@ var Ae = class {
|
|
|
208
208
|
};
|
|
209
209
|
//#endregion
|
|
210
210
|
//#region src/scene/elements/GridLayout.ts
|
|
211
|
-
function
|
|
211
|
+
function Ne(e, t, n = {}) {
|
|
212
212
|
if (!t.gridEnabled) return [];
|
|
213
213
|
let r = n.inverseTransform ?? ((e, t) => ({
|
|
214
214
|
x: e,
|
|
@@ -245,11 +245,11 @@ function je(e, t, n = {}) {
|
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
247
|
//#region src/export/clipSceneToViewport.ts
|
|
248
|
-
function
|
|
248
|
+
function Pe(e, t, n, r) {
|
|
249
249
|
if (!n.cullingEnabled) return /* @__PURE__ */ new Map();
|
|
250
250
|
let { minX: i, maxX: a, minY: o, maxY: s } = t, c = n.roomSize / 2, l = r?.forward, u = (e, t, n, r) => {
|
|
251
251
|
if (l) {
|
|
252
|
-
let c =
|
|
252
|
+
let c = Fe(e, t, n, r, l);
|
|
253
253
|
return c.maxX >= i && c.minX <= a && c.maxY >= o && c.minY <= s;
|
|
254
254
|
}
|
|
255
255
|
return n >= i && e <= a && r >= o && t <= s;
|
|
@@ -262,7 +262,7 @@ function Me(e, t, n, r) {
|
|
|
262
262
|
for (let { shape: t, bounds: n } of e.areaExitLabelShapeRefs) d.set(t, u(n.x, n.y, n.x + n.width, n.y + n.height));
|
|
263
263
|
return d;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Fe(e, t, n, r, i) {
|
|
266
266
|
let a = i(e, t), o = i(n, t), s = i(n, r), c = i(e, r);
|
|
267
267
|
return {
|
|
268
268
|
minX: Math.min(a.x, o.x, s.x, c.x),
|
|
@@ -271,13 +271,13 @@ function Ne(e, t, n, r, i) {
|
|
|
271
271
|
maxY: Math.max(a.y, o.y, s.y, c.y)
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
let i =
|
|
274
|
+
function Ie(e, t, n, r) {
|
|
275
|
+
let i = Ne(t, n, { inverseTransform: r?.inverse });
|
|
276
276
|
if (!n.cullingEnabled) return {
|
|
277
277
|
...e.sceneShapes,
|
|
278
278
|
grid: i
|
|
279
279
|
};
|
|
280
|
-
let a =
|
|
280
|
+
let a = Pe(e, t, n, r);
|
|
281
281
|
return {
|
|
282
282
|
grid: i,
|
|
283
283
|
link: e.sceneShapes.link.filter((e) => a.get(e) ?? !0),
|
|
@@ -287,28 +287,28 @@ function Pe(e, t, n, r) {
|
|
|
287
287
|
}
|
|
288
288
|
//#endregion
|
|
289
289
|
//#region src/render/CullIndex.ts
|
|
290
|
-
var
|
|
290
|
+
var Le = 256, Re = 2, ze = 32, Be = 1 << 20, Ve = class {
|
|
291
291
|
constructor() {
|
|
292
292
|
this.entries = [], this.allShapes = /* @__PURE__ */ new Set(), this.linear = !0, this.originX = 0, this.originY = 0, this.cellSize = 1, this.cols = 0, this.rows = 0, this.cells = [], this.oversized = [], this.stamp = new Int32Array(), this.queryGen = 0;
|
|
293
293
|
}
|
|
294
294
|
build(e) {
|
|
295
295
|
this.entries = e, this.allShapes = new Set(e.map((e) => e.shape));
|
|
296
296
|
let t = e.length;
|
|
297
|
-
if (t <
|
|
297
|
+
if (t < Le) {
|
|
298
298
|
this.linear = !0;
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
301
|
this.linear = !1;
|
|
302
302
|
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
303
303
|
for (let t of e) t.minX < n && (n = t.minX), t.minY < r && (r = t.minY), t.maxX > i && (i = t.maxX), t.maxY > a && (a = t.maxY);
|
|
304
|
-
let o = Math.max(i - n, 1e-6), s = Math.max(a - r, 1e-6), c = Math.sqrt(o * s / Math.max(t /
|
|
304
|
+
let o = Math.max(i - n, 1e-6), s = Math.max(a - r, 1e-6), c = Math.sqrt(o * s / Math.max(t / Re, 1));
|
|
305
305
|
(!isFinite(c) || c <= 0) && (c = Math.max(o, s));
|
|
306
306
|
let l = Math.max(1, Math.ceil(o / c)), u = Math.max(1, Math.ceil(s / c));
|
|
307
|
-
for (; l * u >
|
|
307
|
+
for (; l * u > Be;) c *= 2, l = Math.max(1, Math.ceil(o / c)), u = Math.max(1, Math.ceil(s / c));
|
|
308
308
|
this.originX = n, this.originY = r, this.cellSize = c, this.cols = l, this.rows = u, this.cells = Array.from({ length: l * u }, () => []), this.oversized = [], this.stamp = new Int32Array(t), this.queryGen = 0;
|
|
309
309
|
for (let i = 0; i < t; i++) {
|
|
310
310
|
let t = e[i], a = this.clampCol(Math.floor((t.minX - n) / c)), o = this.clampCol(Math.floor((t.maxX - n) / c)), s = this.clampRow(Math.floor((t.minY - r) / c)), u = this.clampRow(Math.floor((t.maxY - r) / c));
|
|
311
|
-
if ((o - a + 1) * (u - s + 1) >
|
|
311
|
+
if ((o - a + 1) * (u - s + 1) > ze) {
|
|
312
312
|
this.oversized.push(i);
|
|
313
313
|
continue;
|
|
314
314
|
}
|
|
@@ -354,7 +354,7 @@ var Fe = 256, Ie = 2, Le = 32, Re = 1 << 20, ze = class {
|
|
|
354
354
|
return e < 0 ? 0 : e >= this.rows ? this.rows - 1 : e;
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
function
|
|
357
|
+
function He(t, n, r, i, a) {
|
|
358
358
|
if (a === e) return {
|
|
359
359
|
minX: t,
|
|
360
360
|
minY: n,
|
|
@@ -371,14 +371,14 @@ function Be(t, n, r, i, a) {
|
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
373
|
//#region src/rendering/SceneManager.ts
|
|
374
|
-
var
|
|
374
|
+
var Ue = {
|
|
375
375
|
grid: [],
|
|
376
376
|
link: [],
|
|
377
377
|
room: [],
|
|
378
378
|
topLabel: []
|
|
379
|
-
},
|
|
379
|
+
}, We = class {
|
|
380
380
|
constructor(e, t, n) {
|
|
381
|
-
this.camera = e, this.settings = t, this.standaloneExitShapeSet = /* @__PURE__ */ new Set(), this.pipeline = new
|
|
381
|
+
this.camera = e, this.settings = t, this.standaloneExitShapeSet = /* @__PURE__ */ new Set(), this.pipeline = new w(n, t);
|
|
382
382
|
}
|
|
383
383
|
get exitRenderer() {
|
|
384
384
|
return this.pipeline.exitRenderer;
|
|
@@ -411,7 +411,7 @@ var Ve = {
|
|
|
411
411
|
this.lastBuildResult = void 0, this.standaloneExitShapeSet = /* @__PURE__ */ new Set(), this.cullIndex = void 0, this.cullIndexTransform = void 0;
|
|
412
412
|
}
|
|
413
413
|
resetPipeline(e) {
|
|
414
|
-
this.pipeline = new
|
|
414
|
+
this.pipeline = new w(e, this.settings), this.reset();
|
|
415
415
|
}
|
|
416
416
|
cullInteractive(t = e) {
|
|
417
417
|
if (!this.lastBuildResult) return /* @__PURE__ */ new Set();
|
|
@@ -425,12 +425,12 @@ var Ve = {
|
|
|
425
425
|
}
|
|
426
426
|
ensureCullIndex(e) {
|
|
427
427
|
if (this.cullIndex && this.cullIndexTransform === e) return this.cullIndex;
|
|
428
|
-
let t = new
|
|
428
|
+
let t = new Ve();
|
|
429
429
|
return t.build(this.buildCullEntries(e)), this.cullIndex = t, this.cullIndexTransform = e, t;
|
|
430
430
|
}
|
|
431
431
|
buildCullEntries(e) {
|
|
432
432
|
let t = this.lastBuildResult, n = this.settings.roomSize / 2, r = [], i = (t, n, i, a, o) => {
|
|
433
|
-
let s =
|
|
433
|
+
let s = He(n, i, a, o, e);
|
|
434
434
|
r.push({
|
|
435
435
|
shape: t,
|
|
436
436
|
minX: s.minX,
|
|
@@ -449,14 +449,14 @@ var Ve = {
|
|
|
449
449
|
}
|
|
450
450
|
cull(t = e) {
|
|
451
451
|
if (!this.lastBuildResult) return {
|
|
452
|
-
shapes:
|
|
452
|
+
shapes: Ue,
|
|
453
453
|
stats: {
|
|
454
454
|
visibleRooms: 0,
|
|
455
455
|
totalRooms: 0,
|
|
456
456
|
visibleExits: 0
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
let n = this.camera.getCullingViewport(this.settings.cullingBounds), r = t === e ? void 0 : { forward: t }, i =
|
|
459
|
+
let n = this.camera.getCullingViewport(this.settings.cullingBounds), r = t === e ? void 0 : { forward: t }, i = Ie(this.lastBuildResult, n, this.settings, r);
|
|
460
460
|
return {
|
|
461
461
|
shapes: i,
|
|
462
462
|
stats: {
|
|
@@ -469,7 +469,7 @@ var Ve = {
|
|
|
469
469
|
};
|
|
470
470
|
//#endregion
|
|
471
471
|
//#region src/render/canvasGradient.ts
|
|
472
|
-
function
|
|
472
|
+
function k(e, t) {
|
|
473
473
|
if (typeof t == "string") return t;
|
|
474
474
|
if (t.type === "linear") {
|
|
475
475
|
let n = e.createLinearGradient(t.x0, t.y0, t.x1, t.y1);
|
|
@@ -482,13 +482,13 @@ function j(e, t) {
|
|
|
482
482
|
}
|
|
483
483
|
//#endregion
|
|
484
484
|
//#region src/render/RecordingLayer.ts
|
|
485
|
-
function
|
|
485
|
+
function A(e, t) {
|
|
486
486
|
switch (t.type) {
|
|
487
487
|
case "rect":
|
|
488
|
-
e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle =
|
|
488
|
+
e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
|
|
489
489
|
break;
|
|
490
490
|
case "circle":
|
|
491
|
-
e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle =
|
|
491
|
+
e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
|
|
492
492
|
break;
|
|
493
493
|
case "line": {
|
|
494
494
|
if (t.points.length < 4) break;
|
|
@@ -502,7 +502,7 @@ function M(e, t) {
|
|
|
502
502
|
if (t.vertices.length < 4) break;
|
|
503
503
|
e.beginPath(), e.moveTo(t.vertices[0], t.vertices[1]);
|
|
504
504
|
for (let n = 2; n < t.vertices.length; n += 2) e.lineTo(t.vertices[n], t.vertices[n + 1]);
|
|
505
|
-
e.closePath(), t.fill && (e.fillStyle =
|
|
505
|
+
e.closePath(), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
|
|
506
506
|
break;
|
|
507
507
|
case "text": {
|
|
508
508
|
let n = t.fontSize * 100, r = `${t.fontStyle} ${n}px ${t.fontFamily}`;
|
|
@@ -539,7 +539,7 @@ function M(e, t) {
|
|
|
539
539
|
break;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
var
|
|
542
|
+
var Ge = class {
|
|
543
543
|
constructor(e, t) {
|
|
544
544
|
this._visible = !0, this.noScaling = !1, this.commands = [], this.x = e, this.y = t;
|
|
545
545
|
}
|
|
@@ -569,32 +569,32 @@ var Ue = class {
|
|
|
569
569
|
}
|
|
570
570
|
materialize() {
|
|
571
571
|
if (this._konvaGroup) return this._konvaGroup;
|
|
572
|
-
let e = new
|
|
572
|
+
let e = new D.Group({
|
|
573
573
|
x: this.x,
|
|
574
574
|
y: this.y,
|
|
575
575
|
listening: !1,
|
|
576
576
|
visible: this._visible
|
|
577
577
|
}), t = this.commands;
|
|
578
|
-
return e.add(new
|
|
578
|
+
return e.add(new D.Shape({
|
|
579
579
|
listening: !1,
|
|
580
580
|
perfectDrawEnabled: !1,
|
|
581
581
|
sceneFunc: (e) => {
|
|
582
582
|
let n = e._context;
|
|
583
|
-
for (let e of t)
|
|
583
|
+
for (let e of t) A(n, e);
|
|
584
584
|
}
|
|
585
585
|
})), this._konvaGroup = e, e;
|
|
586
586
|
}
|
|
587
587
|
};
|
|
588
|
-
function
|
|
588
|
+
function Ke(e) {
|
|
589
589
|
if (e.noScaling || e.commands.length !== 1) return null;
|
|
590
590
|
let t = e.commands[0];
|
|
591
591
|
return t.type === "rect" ? typeof t.fill != "string" && t.fill !== void 0 || t.dash ? null : `r|${t.fill ?? ""}|${t.stroke ?? ""}|${t.sw}|${t.cr}` : t.type === "circle" ? typeof t.fill != "string" && t.fill !== void 0 || t.dash ? null : `c|${t.fill ?? ""}|${t.stroke ?? ""}|${t.sw}|${t.r}` : t.type === "line" ? t.dash || t.alpha !== void 0 ? null : `l|${t.stroke ?? ""}|${t.sw}|${t.lineCap ?? ""}|${t.lineJoin ?? ""}` : null;
|
|
592
592
|
}
|
|
593
|
-
var
|
|
593
|
+
var qe = class {
|
|
594
594
|
constructor(e, t = () => !1) {
|
|
595
595
|
this.coalesce = t, this.entries = [], this.nodeToEntry = /* @__PURE__ */ new Map(), this.buckets = /* @__PURE__ */ new Map(), this.konvaLayer = e, e.destroyChildren();
|
|
596
596
|
let n = this;
|
|
597
|
-
this.konvaShape = new
|
|
597
|
+
this.konvaShape = new D.Shape({
|
|
598
598
|
listening: !1,
|
|
599
599
|
perfectDrawEnabled: !1,
|
|
600
600
|
sceneFunc: (e) => {
|
|
@@ -609,7 +609,7 @@ var Ge = class {
|
|
|
609
609
|
if (!o.visible) continue;
|
|
610
610
|
let s = n * o.x + i * o.y + t.e, c = r * o.x + a * o.y + t.f;
|
|
611
611
|
o.noScaling ? e.setTransform(75, 0, 0, 75, s, c) : e.setTransform(n, r, i, a, s, c);
|
|
612
|
-
for (let t of o.commands)
|
|
612
|
+
for (let t of o.commands) A(e, t);
|
|
613
613
|
}
|
|
614
614
|
e.setTransform(t);
|
|
615
615
|
}
|
|
@@ -622,11 +622,11 @@ var Ge = class {
|
|
|
622
622
|
l.clear();
|
|
623
623
|
for (let t of this.entries) {
|
|
624
624
|
if (!t.visible || !n(t)) continue;
|
|
625
|
-
let u =
|
|
625
|
+
let u = Ke(t);
|
|
626
626
|
if (u === null) {
|
|
627
627
|
let n = r * t.x + a * t.y + s, l = i * t.x + o * t.y + c;
|
|
628
628
|
t.noScaling ? e.setTransform(75, 0, 0, 75, n, l) : e.setTransform(r, i, a, o, n, l);
|
|
629
|
-
for (let n of t.commands)
|
|
629
|
+
for (let n of t.commands) A(e, n);
|
|
630
630
|
} else {
|
|
631
631
|
let e = l.get(u);
|
|
632
632
|
e || l.set(u, e = []), e.push(t);
|
|
@@ -682,11 +682,11 @@ var Ge = class {
|
|
|
682
682
|
ensureShape() {
|
|
683
683
|
this.konvaShape.getParent() || this.konvaLayer.add(this.konvaShape);
|
|
684
684
|
}
|
|
685
|
-
},
|
|
685
|
+
}, j = class {
|
|
686
686
|
constructor(e) {
|
|
687
687
|
this.groups = [], this.konvaLayer = e, e.destroyChildren();
|
|
688
688
|
let t = this;
|
|
689
|
-
this.konvaShape = new
|
|
689
|
+
this.konvaShape = new D.Shape({
|
|
690
690
|
listening: !1,
|
|
691
691
|
perfectDrawEnabled: !1,
|
|
692
692
|
sceneFunc: (e) => {
|
|
@@ -695,7 +695,7 @@ var Ge = class {
|
|
|
695
695
|
if (!e._visible) continue;
|
|
696
696
|
let t = i * e.x + o * e.y + r.e, c = a * e.x + s * e.y + r.f;
|
|
697
697
|
e.noScaling ? n.setTransform(75, 0, 0, 75, t, c) : n.setTransform(i, a, o, s, t, c);
|
|
698
|
-
for (let t of e.commands)
|
|
698
|
+
for (let t of e.commands) A(n, t);
|
|
699
699
|
}
|
|
700
700
|
n.setTransform(r);
|
|
701
701
|
}
|
|
@@ -713,7 +713,7 @@ var Ge = class {
|
|
|
713
713
|
ensureShape() {
|
|
714
714
|
this.konvaShape.getParent() || this.konvaLayer.add(this.konvaShape);
|
|
715
715
|
}
|
|
716
|
-
},
|
|
716
|
+
}, Je = class {
|
|
717
717
|
constructor(e) {
|
|
718
718
|
this.konvaLayer = e;
|
|
719
719
|
}
|
|
@@ -729,14 +729,14 @@ var Ge = class {
|
|
|
729
729
|
};
|
|
730
730
|
//#endregion
|
|
731
731
|
//#region src/scene/Shape.ts
|
|
732
|
-
function
|
|
732
|
+
function Ye(e) {
|
|
733
733
|
return typeof e == "object" && !!e;
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function Xe(e, t) {
|
|
736
736
|
return t !== !1 && e ? e : void 0;
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
return
|
|
738
|
+
function M(e, t, n, r, i, a) {
|
|
739
|
+
return Ye(e) ? e.type === "linear" ? {
|
|
740
740
|
type: "linear",
|
|
741
741
|
x0: (t + e.x0) * r + i,
|
|
742
742
|
y0: (n + e.y0) * r + a,
|
|
@@ -756,14 +756,14 @@ function P(e, t, n, r, i, a) {
|
|
|
756
756
|
}
|
|
757
757
|
//#endregion
|
|
758
758
|
//#region src/render/shapeToRecording.ts
|
|
759
|
-
function
|
|
760
|
-
let t = new
|
|
761
|
-
return e.noScale && (t.noScaling = !0), t.layer = e.layer,
|
|
759
|
+
function Ze(e) {
|
|
760
|
+
let t = new Ge(e.x, e.y);
|
|
761
|
+
return e.noScale && (t.noScaling = !0), t.layer = e.layer, Qe(t, e.children, 0, 0), t;
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
for (let i of t)
|
|
763
|
+
function Qe(e, t, n, r) {
|
|
764
|
+
for (let i of t) $e(e, i, n, r);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function $e(e, t, n, r) {
|
|
767
767
|
switch (t.type) {
|
|
768
768
|
case "rect":
|
|
769
769
|
e.commands.push({
|
|
@@ -772,11 +772,11 @@ function Ze(e, t, n, r) {
|
|
|
772
772
|
y: t.y + r,
|
|
773
773
|
w: t.width,
|
|
774
774
|
h: t.height,
|
|
775
|
-
fill:
|
|
775
|
+
fill: M(t.paint.fill, n, r, 1, 0, 0),
|
|
776
776
|
stroke: t.paint.stroke,
|
|
777
777
|
sw: t.paint.strokeWidth ?? 0,
|
|
778
778
|
cr: t.cornerRadius ?? 0,
|
|
779
|
-
dash:
|
|
779
|
+
dash: Xe(t.paint.dash, t.paint.dashEnabled)
|
|
780
780
|
});
|
|
781
781
|
return;
|
|
782
782
|
case "circle":
|
|
@@ -785,20 +785,20 @@ function Ze(e, t, n, r) {
|
|
|
785
785
|
cx: t.cx + n,
|
|
786
786
|
cy: t.cy + r,
|
|
787
787
|
r: t.radius,
|
|
788
|
-
fill:
|
|
788
|
+
fill: M(t.paint.fill, n, r, 1, 0, 0),
|
|
789
789
|
stroke: t.paint.stroke,
|
|
790
790
|
sw: t.paint.strokeWidth ?? 0,
|
|
791
|
-
dash:
|
|
791
|
+
dash: Xe(t.paint.dash, t.paint.dashEnabled)
|
|
792
792
|
});
|
|
793
793
|
return;
|
|
794
794
|
case "line": {
|
|
795
|
-
let i = n === 0 && r === 0 ? t.points :
|
|
795
|
+
let i = n === 0 && r === 0 ? t.points : et(t.points, n, r);
|
|
796
796
|
e.commands.push({
|
|
797
797
|
type: "line",
|
|
798
798
|
points: i,
|
|
799
799
|
stroke: t.paint.stroke,
|
|
800
800
|
sw: t.paint.strokeWidth ?? 0,
|
|
801
|
-
dash:
|
|
801
|
+
dash: Xe(t.paint.dash, t.paint.dashEnabled),
|
|
802
802
|
lineCap: t.lineCap,
|
|
803
803
|
lineJoin: t.lineJoin,
|
|
804
804
|
alpha: t.paint.alpha
|
|
@@ -808,8 +808,8 @@ function Ze(e, t, n, r) {
|
|
|
808
808
|
case "polygon":
|
|
809
809
|
e.commands.push({
|
|
810
810
|
type: "polygon",
|
|
811
|
-
vertices: n === 0 && r === 0 ? t.vertices :
|
|
812
|
-
fill:
|
|
811
|
+
vertices: n === 0 && r === 0 ? t.vertices : et(t.vertices, n, r),
|
|
812
|
+
fill: M(t.paint.fill, n, r, 1, 0, 0),
|
|
813
813
|
stroke: t.paint.stroke,
|
|
814
814
|
sw: t.paint.strokeWidth ?? 0
|
|
815
815
|
});
|
|
@@ -835,7 +835,7 @@ function Ze(e, t, n, r) {
|
|
|
835
835
|
});
|
|
836
836
|
return;
|
|
837
837
|
case "image": {
|
|
838
|
-
let i =
|
|
838
|
+
let i = tt(t.src);
|
|
839
839
|
e.commands.push({
|
|
840
840
|
type: "image",
|
|
841
841
|
x: t.x + n,
|
|
@@ -848,32 +848,32 @@ function Ze(e, t, n, r) {
|
|
|
848
848
|
return;
|
|
849
849
|
}
|
|
850
850
|
case "group":
|
|
851
|
-
|
|
851
|
+
Qe(e, t.children, n + t.x, r + t.y);
|
|
852
852
|
return;
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function et(e, t, n) {
|
|
856
856
|
let r = Array(e.length);
|
|
857
857
|
for (let i = 0; i < e.length; i += 2) r[i] = e[i] + t, r[i + 1] = e[i + 1] + n;
|
|
858
858
|
return r;
|
|
859
859
|
}
|
|
860
|
-
function
|
|
861
|
-
let t =
|
|
860
|
+
function tt(e) {
|
|
861
|
+
let t = D === void 0 ? typeof Image < "u" ? new Image() : null : D.Util.createImageElement();
|
|
862
862
|
return t && (t.src = e), t;
|
|
863
863
|
}
|
|
864
864
|
//#endregion
|
|
865
865
|
//#region src/reader/ViewportDataSource.ts
|
|
866
|
-
function
|
|
866
|
+
function N(e) {
|
|
867
867
|
return !!e && e.viewportAware === !0;
|
|
868
868
|
}
|
|
869
869
|
//#endregion
|
|
870
870
|
//#region src/rendering/lod/RasterOverview.ts
|
|
871
|
-
function
|
|
871
|
+
function nt(e, t = 1) {
|
|
872
872
|
let n = Math.ceil(e) + 1, r = Math.ceil(e * t) + 1;
|
|
873
873
|
return Math.max(1, Math.min(48, Math.max(n, r)));
|
|
874
874
|
}
|
|
875
|
-
function
|
|
876
|
-
let r = e.width, i = e.height, a = new Uint32Array(e.data.buffer), o =
|
|
875
|
+
function rt(e, t, n) {
|
|
876
|
+
let r = e.width, i = e.height, a = new Uint32Array(e.data.buffer), o = nt(n.scale, n.roomSize), s = o >> 1;
|
|
877
877
|
t((e, t, c) => {
|
|
878
878
|
let l = Math.round(e * n.scale + n.offsetX) - s, u = Math.round(t * n.scale + n.offsetY) - s, d = n.colorOf(c);
|
|
879
879
|
for (let e = 0; e < o; e++) {
|
|
@@ -887,7 +887,7 @@ function tt(e, t, n) {
|
|
|
887
887
|
}
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function it(e) {
|
|
891
891
|
let t = e.trim(), n = 0, r = 0, i = 0;
|
|
892
892
|
if (t[0] === "#") t.length === 4 ? (n = parseInt(t[1] + t[1], 16), r = parseInt(t[2] + t[2], 16), i = parseInt(t[3] + t[3], 16)) : (n = parseInt(t.slice(1, 3), 16), r = parseInt(t.slice(3, 5), 16), i = parseInt(t.slice(5, 7), 16));
|
|
893
893
|
else {
|
|
@@ -898,12 +898,12 @@ function nt(e) {
|
|
|
898
898
|
}
|
|
899
899
|
//#endregion
|
|
900
900
|
//#region src/rendering/lod/LodController.ts
|
|
901
|
-
var
|
|
901
|
+
var at = .25, ot = 8192, st = class {
|
|
902
902
|
constructor(e, t, n, r) {
|
|
903
903
|
this.layer = e, this.camera = t, this.colorCss = n, this.roomSizeOf = r, this.visit = null, this.paintedRegion = null, this.paintedScale = 0, this.repaintScheduled = !1, this.destroyed = !1, this.packedCache = /* @__PURE__ */ new Map(), this.colorOf = (e) => {
|
|
904
904
|
let t = this.packedCache.get(e);
|
|
905
|
-
return t === void 0 && (t =
|
|
906
|
-
}, this.canvas =
|
|
905
|
+
return t === void 0 && (t = it(this.colorCss(e)), this.packedCache.set(e, t)), t;
|
|
906
|
+
}, this.canvas = D.Util.createCanvasElement(), this.layer.visible(!1);
|
|
907
907
|
}
|
|
908
908
|
setSource(e) {
|
|
909
909
|
this.visit = e, this.packedCache.clear(), this.paint();
|
|
@@ -930,21 +930,21 @@ var rt = .25, it = 8192, at = class {
|
|
|
930
930
|
paint() {
|
|
931
931
|
let e = this.visit;
|
|
932
932
|
if (!e) return;
|
|
933
|
-
let t = this.camera.getViewportBounds(), n = this.camera.getScale(), r = (t.maxX - t.minX) *
|
|
933
|
+
let t = this.camera.getViewportBounds(), n = this.camera.getScale(), r = (t.maxX - t.minX) * at, i = (t.maxY - t.minY) * at, a = {
|
|
934
934
|
minX: t.minX - r,
|
|
935
935
|
maxX: t.maxX + r,
|
|
936
936
|
minY: t.minY - i,
|
|
937
937
|
maxY: t.maxY + i
|
|
938
|
-
}, o = Math.min(
|
|
938
|
+
}, o = Math.min(ot, Math.max(1, Math.ceil((a.maxX - a.minX) * n))), s = Math.min(ot, Math.max(1, Math.ceil((a.maxY - a.minY) * n)));
|
|
939
939
|
this.canvas.width = o, this.canvas.height = s;
|
|
940
940
|
let c = this.canvas.getContext("2d"), l = c.createImageData(o, s);
|
|
941
|
-
|
|
941
|
+
rt(l, (t) => e(a, t), {
|
|
942
942
|
scale: n,
|
|
943
943
|
offsetX: -a.minX * n,
|
|
944
944
|
offsetY: -a.minY * n,
|
|
945
945
|
colorOf: this.colorOf,
|
|
946
946
|
roomSize: this.roomSizeOf()
|
|
947
|
-
}), c.putImageData(l, 0, 0), this.image ? this.image.image(this.canvas) : (this.image = new
|
|
947
|
+
}), c.putImageData(l, 0, 0), this.image ? this.image.image(this.canvas) : (this.image = new D.Image({
|
|
948
948
|
image: this.canvas,
|
|
949
949
|
listening: !1
|
|
950
950
|
}), this.layer.add(this.image)), this.image.position({
|
|
@@ -958,21 +958,21 @@ var rt = .25, it = 8192, at = class {
|
|
|
958
958
|
};
|
|
959
959
|
//#endregion
|
|
960
960
|
//#region src/rendering/lod/lodDecision.ts
|
|
961
|
-
function
|
|
961
|
+
function ct(e) {
|
|
962
962
|
return e.planeRoomCount > e.roomBudget && e.scale * e.scale < e.stageWidth * e.stageHeight / e.roomBudget;
|
|
963
963
|
}
|
|
964
|
-
function
|
|
965
|
-
return
|
|
964
|
+
function lt(e) {
|
|
965
|
+
return ct({
|
|
966
966
|
...e,
|
|
967
967
|
roomBudget: e.roomBudget
|
|
968
|
-
}) ? "raster" : e.exitBudget !== void 0 &&
|
|
968
|
+
}) ? "raster" : e.exitBudget !== void 0 && ct({
|
|
969
969
|
...e,
|
|
970
970
|
roomBudget: e.exitBudget
|
|
971
971
|
}) ? "roomsOnly" : "vector";
|
|
972
972
|
}
|
|
973
973
|
//#endregion
|
|
974
974
|
//#region src/rendering/lod/roomsOnlyArea.ts
|
|
975
|
-
function
|
|
975
|
+
function ut(e) {
|
|
976
976
|
return {
|
|
977
977
|
getAreaName: () => e.getAreaName(),
|
|
978
978
|
getAreaId: () => e.getAreaId(),
|
|
@@ -987,27 +987,27 @@ function ct(e) {
|
|
|
987
987
|
}
|
|
988
988
|
//#endregion
|
|
989
989
|
//#region src/rendering/KonvaRenderBackend.ts
|
|
990
|
-
var
|
|
990
|
+
var P = "rgb(120, 72, 0)", dt = .5, ft = (1 + 2 * dt) ** 2, pt = class {
|
|
991
991
|
get coordinateTransform() {
|
|
992
992
|
return this._coordinateTransform;
|
|
993
993
|
}
|
|
994
994
|
constructor(t, n) {
|
|
995
|
-
this.gridCachedBounds = null, this.currentStyle = x, this.hitTester = new
|
|
995
|
+
this.gridCachedBounds = null, this.currentStyle = x, this.hitTester = new ce(), this.lastHitShapes = [], this.shapeToDrawEntry = /* @__PURE__ */ new Map(), this.lastVisibleShapes = /* @__PURE__ */ new Set(), this.shapeToGroup = /* @__PURE__ */ new Map(), this.highlightShapes = /* @__PURE__ */ new Map(), this.pathShapes = [], this.spilledRoomPositions = /* @__PURE__ */ new Map(), this.currentRoomOverlay = [], this.destroyed = !1, this._coordinateTransform = e, this.coordinateInverse = e, this.liveEffects = /* @__PURE__ */ new Map(), this.sceneOverlays = /* @__PURE__ */ new Map(), this.sceneOverlayNodes = /* @__PURE__ */ new Map(), this.viewportSubscribers = /* @__PURE__ */ new Set(), this.lodMode = "vector", this.lastAppliedViewport = null, this.lastAppliedScale = null, this.refreshScheduled = !1, this.state = t, this.container = n, n ? (this.stage = new D.Stage({
|
|
996
996
|
container: n,
|
|
997
997
|
width: n.clientWidth,
|
|
998
998
|
height: n.clientHeight,
|
|
999
999
|
draggable: !1
|
|
1000
|
-
}), n.style.backgroundColor = t.settings.backgroundColor, this.camera = new
|
|
1000
|
+
}), n.style.backgroundColor = t.settings.backgroundColor, this.camera = new T(n.clientWidth, n.clientHeight)) : (this.stage = new D.Stage({
|
|
1001
1001
|
width: 1,
|
|
1002
1002
|
height: 1
|
|
1003
|
-
}), this.camera = new
|
|
1004
|
-
let r = new
|
|
1005
|
-
if (this.linkLayer = r, this.roomLayer = r, this.stage.add(r), this.positionLayer = new
|
|
1003
|
+
}), this.camera = new T(1, 1)), this.lodLayer = new D.Layer({ listening: !1 }), this.stage.add(this.lodLayer), this.gridLayer = new D.Layer({ listening: !1 }), this.stage.add(this.gridLayer);
|
|
1004
|
+
let r = new D.Layer({ listening: !1 });
|
|
1005
|
+
if (this.linkLayer = r, this.roomLayer = r, this.stage.add(r), this.positionLayer = new D.Layer({ listening: !1 }), this.stage.add(this.positionLayer), this.overlayLayer = new D.Layer({ listening: !1 }), this.stage.add(this.overlayLayer), this.topLabelLayer = new D.Layer({ listening: !1 }), this.stage.add(this.topLabelLayer), this.positionLayerNode = new Je(this.positionLayer), this.overlayLayerNode = new Je(this.overlayLayer), this.sceneNode = new qe(r, () => t.settings.coalesceRooms), this.gridLayerNode = new j(this.gridLayer), this.topLabelLayerNode = new j(this.topLabelLayer), this.sceneManager = new We(this.camera, t.settings, t.mapReader), this.lodController = new st(this.lodLayer, this.camera, (e) => this.state.mapReader.getColorValue(e), () => this.state.settings.roomSize), this.events = new p(n), this.culling = new ie(t.settings, () => this.applyClipping()), this.cameraChangeHandler = () => this.applyViewportToStage(), this.camera.on("change", this.cameraChangeHandler), n) {
|
|
1006
1006
|
this.origSetSize = this.camera.setSize.bind(this.camera);
|
|
1007
1007
|
let e = this.origSetSize;
|
|
1008
1008
|
this.camera.setSize = (t, n) => {
|
|
1009
1009
|
e(t, n), this.stage.width(t), this.stage.height(n);
|
|
1010
|
-
}, this.interactionHandler = new
|
|
1010
|
+
}, this.interactionHandler = new oe(n, this.camera, t, {
|
|
1011
1011
|
clientToMapPoint: (e, t) => this.camera.clientToMapPoint(e, t, n.getBoundingClientRect()),
|
|
1012
1012
|
pickAtPoint: (e, t) => this.hitTester.pick(e, t)
|
|
1013
1013
|
}, this.events);
|
|
@@ -1015,7 +1015,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1015
1015
|
this.applyStyleTransforms(), this.subscribeToState(t);
|
|
1016
1016
|
}
|
|
1017
1017
|
setStyle(e) {
|
|
1018
|
-
this.currentStyle = e, this.sceneNode = new
|
|
1018
|
+
this.currentStyle = e, this.sceneNode = new qe(this.linkLayer, () => this.state.settings.coalesceRooms), this.gridLayerNode = new j(this.gridLayer), this.topLabelLayerNode = new j(this.topLabelLayer), this.gridCachedBounds = null, this.sceneManager.resetPipeline(this.state.mapReader), this.shapeToDrawEntry = /* @__PURE__ */ new Map(), this.shapeToGroup.clear(), this.lastHitShapes = [], this.hitTester.clear(), this.applyStyleTransforms(), this.refresh();
|
|
1019
1019
|
}
|
|
1020
1020
|
applyStyleTransforms() {
|
|
1021
1021
|
let t = this.currentStyle, n = t.worldToScene ? (e, n) => t.worldToScene(e, n) : e, r = t.sceneToWorld ? (e, n) => t.sceneToWorld(e, n) : e, i = this.coordinateInverse, a = t.sceneLayerOffset ? (e) => t.sceneLayerOffset(e) : void 0;
|
|
@@ -1083,7 +1083,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1083
1083
|
let { currentAreaInstance: t, currentZIndex: n } = this.state;
|
|
1084
1084
|
if (t && n !== void 0 && this.hasRealViewport()) {
|
|
1085
1085
|
let t = this.state.settings.lodEnabled && this.computeLodMode() !== this.lodMode;
|
|
1086
|
-
if (!t &&
|
|
1086
|
+
if (!t && N(this.state.mapReader)) {
|
|
1087
1087
|
let n = this.lastAppliedViewport, r = this.lastAppliedScale, i = this.camera.getScale();
|
|
1088
1088
|
t = !n || r === null || e.minX < n.minX || e.maxX > n.maxX || e.minY < n.minY || e.maxY > n.maxY || i > r * 1.2 || i < r / 1.2;
|
|
1089
1089
|
}
|
|
@@ -1109,15 +1109,15 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
this.updateBackground();
|
|
1111
1111
|
let i = this.state.mapReader;
|
|
1112
|
-
if (
|
|
1113
|
-
let e = this.padViewport(this.camera.getViewportBounds()), t =
|
|
1112
|
+
if (N(i) && this.hasRealViewport()) {
|
|
1113
|
+
let e = this.padViewport(this.camera.getViewportBounds()), t = He(e.minX, e.minY, e.maxX, e.maxY, this.coordinateInverse);
|
|
1114
1114
|
i.setViewport(t), this.lastAppliedViewport = e, this.lastAppliedScale = this.camera.getScale();
|
|
1115
1115
|
}
|
|
1116
1116
|
let a = this.computeLodMode();
|
|
1117
1117
|
if (this.lodMode = a, a === "raster") this.clearVectorScene(), this.lodController.setSource(this.rasterVisit(e, r, t));
|
|
1118
1118
|
else {
|
|
1119
1119
|
this.lodController.clear();
|
|
1120
|
-
let n = a === "roomsOnly" ?
|
|
1120
|
+
let n = a === "roomsOnly" ? ut(e) : e;
|
|
1121
1121
|
this.buildScene(n, r, t), this.onSceneBuilt();
|
|
1122
1122
|
}
|
|
1123
1123
|
this.syncHighlights(), this.syncPaths(), n !== void 0 && this.onPositionChanged(n, !1, !1);
|
|
@@ -1128,7 +1128,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1128
1128
|
return this.camera.width > 1 || this.camera.height > 1;
|
|
1129
1129
|
}
|
|
1130
1130
|
padViewport(e) {
|
|
1131
|
-
let t = (e.maxX - e.minX) *
|
|
1131
|
+
let t = (e.maxX - e.minX) * dt + 1, n = (e.maxY - e.minY) * dt + 1;
|
|
1132
1132
|
return {
|
|
1133
1133
|
minX: e.minX - t,
|
|
1134
1134
|
maxX: e.maxX + t,
|
|
@@ -1138,7 +1138,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
planeRoomCount(e, t, n) {
|
|
1140
1140
|
let r = this.state.mapReader;
|
|
1141
|
-
return
|
|
1141
|
+
return N(r) ? r.getPlaneRoomCount(e.getAreaId(), n) : t.getRooms().length;
|
|
1142
1142
|
}
|
|
1143
1143
|
computeLodMode() {
|
|
1144
1144
|
let e = this.state.settings;
|
|
@@ -1146,18 +1146,18 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1146
1146
|
let { currentAreaInstance: t, currentZIndex: n } = this.state;
|
|
1147
1147
|
if (!t || n === void 0) return "vector";
|
|
1148
1148
|
let r = t.getPlane(n);
|
|
1149
|
-
return r ?
|
|
1149
|
+
return r ? lt({
|
|
1150
1150
|
planeRoomCount: this.planeRoomCount(t, r, n),
|
|
1151
1151
|
scale: this.camera.getScale(),
|
|
1152
1152
|
stageWidth: this.camera.width,
|
|
1153
1153
|
stageHeight: this.camera.height,
|
|
1154
|
-
roomBudget: e.lodRoomBudget /
|
|
1155
|
-
exitBudget: e.lodExitBudget /
|
|
1154
|
+
roomBudget: e.lodRoomBudget / ft,
|
|
1155
|
+
exitBudget: e.lodExitBudget / ft
|
|
1156
1156
|
}) : "vector";
|
|
1157
1157
|
}
|
|
1158
1158
|
rasterVisit(e, t, n) {
|
|
1159
1159
|
let r = this.state.mapReader;
|
|
1160
|
-
if (
|
|
1160
|
+
if (N(r)) {
|
|
1161
1161
|
let t = e.getAreaId();
|
|
1162
1162
|
return (e, i) => r.forEachInBounds(t, n, e, i);
|
|
1163
1163
|
}
|
|
@@ -1177,7 +1177,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
emitLodEvent(e, t, n, r) {
|
|
1179
1179
|
if (!this.state.settings.lodEnabled) return;
|
|
1180
|
-
let i = this.state.mapReader, a = this.planeRoomCount(t, n, r), o = this.lastAppliedViewport ?? this.camera.getViewportBounds(), s =
|
|
1180
|
+
let i = this.state.mapReader, a = this.planeRoomCount(t, n, r), o = this.lastAppliedViewport ?? this.camera.getViewportBounds(), s = N(i) ? i.estimateVisibleCount(t.getAreaId(), r, o) : a, c = e === "raster" ? !1 : !this.hitTestBudgetExceeded();
|
|
1181
1181
|
this.events.emit("lod", {
|
|
1182
1182
|
mode: e,
|
|
1183
1183
|
planeRoomCount: a,
|
|
@@ -1256,7 +1256,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1256
1256
|
buildScene(e, t, n) {
|
|
1257
1257
|
this.positionLayer.destroyChildren(), this.positionMarker = void 0, this.clearOverlayShapes(), this.currentRoomOverlay = [], this.sceneNode.destroyChildren(), this.gridLayerNode.destroyChildren(), this.gridCachedBounds = null, this.topLabelLayerNode.destroyChildren();
|
|
1258
1258
|
let r = this.computeNeighborSpill(e, n);
|
|
1259
|
-
this.spilledRoomPositions = r ?
|
|
1259
|
+
this.spilledRoomPositions = r ? he(r) : /* @__PURE__ */ new Map();
|
|
1260
1260
|
let i = this.sceneManager.rebuild(e, t, n, this.state.lens, r);
|
|
1261
1261
|
this.shapeToGroup = /* @__PURE__ */ new Map(), this.refreshGrid(this.camera.getViewportBounds());
|
|
1262
1262
|
for (let e of i.sceneShapes.link) {
|
|
@@ -1280,10 +1280,10 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1280
1280
|
return b(this.state.mapReader, e.getAreaId(), t, r, n.neighborSpillDistance, (e) => a.isVisible(e));
|
|
1281
1281
|
}
|
|
1282
1282
|
overlayReader() {
|
|
1283
|
-
return this.spilledRoomPositions.size === 0 || this.state.currentArea === void 0 || this.state.currentZIndex === void 0 ? this.state.mapReader : new
|
|
1283
|
+
return this.spilledRoomPositions.size === 0 || this.state.currentArea === void 0 || this.state.currentZIndex === void 0 ? this.state.mapReader : new ne(this.state.mapReader, this.state.currentArea, this.state.currentZIndex, this.spilledRoomPositions);
|
|
1284
1284
|
}
|
|
1285
1285
|
addStyledShape(e, t, n = !1) {
|
|
1286
|
-
let r = n || this.currentStyle === x ? [e] :
|
|
1286
|
+
let r = n || this.currentStyle === x ? [e] : E([e], this.currentStyle, this.styleContext());
|
|
1287
1287
|
if (r.length === 0) return;
|
|
1288
1288
|
let i;
|
|
1289
1289
|
i = r.length === 1 && r[0].type === "group" ? r[0] : {
|
|
@@ -1294,7 +1294,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1294
1294
|
layer: e.layer,
|
|
1295
1295
|
noScale: e.noScale
|
|
1296
1296
|
};
|
|
1297
|
-
let a =
|
|
1297
|
+
let a = Ze(i);
|
|
1298
1298
|
return t.addNode(a), a;
|
|
1299
1299
|
}
|
|
1300
1300
|
refreshGrid(e) {
|
|
@@ -1306,7 +1306,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1306
1306
|
let n = this.coordinateInverse, r = n(e.minX, e.minY), i = n(e.maxX, e.minY), a = n(e.maxX, e.maxY), o = n(e.minX, e.maxY), s = Math.min(r.x, i.x, a.x, o.x), c = Math.max(r.x, i.x, a.x, o.x), l = Math.min(r.y, i.y, a.y, o.y), u = Math.max(r.y, i.y, a.y, o.y), d = t.gridSize * 2, f = Math.floor((s - d) / t.gridSize) * t.gridSize, p = Math.ceil((c + d) / t.gridSize) * t.gridSize, m = Math.floor((l - d) / t.gridSize) * t.gridSize, h = Math.ceil((u + d) / t.gridSize) * t.gridSize, g = this.gridCachedBounds;
|
|
1307
1307
|
if (g && g.left === f && g.right === p && g.top === m && g.bottom === h) return;
|
|
1308
1308
|
this.gridLayerNode.destroyChildren();
|
|
1309
|
-
let _ =
|
|
1309
|
+
let _ = Ne(e, t, { inverseTransform: this.coordinateInverse });
|
|
1310
1310
|
for (let e of _) this.addStyledShape(e, this.gridLayerNode);
|
|
1311
1311
|
this.gridCachedBounds = {
|
|
1312
1312
|
left: f,
|
|
@@ -1362,8 +1362,8 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1362
1362
|
this.positionLayerNode.batchDraw();
|
|
1363
1363
|
return;
|
|
1364
1364
|
}
|
|
1365
|
-
let t =
|
|
1366
|
-
this.positionMarker = this.addStyledShape(
|
|
1365
|
+
let t = te(e, this.state.settings);
|
|
1366
|
+
this.positionMarker = this.addStyledShape(ae(t), this.positionLayerNode);
|
|
1367
1367
|
}
|
|
1368
1368
|
clearCurrentRoomOverlay() {
|
|
1369
1369
|
this.currentRoomOverlay.forEach((e) => e.destroy()), this.currentRoomOverlay = [], this.positionLayerNode.batchDraw();
|
|
@@ -1388,14 +1388,14 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1388
1388
|
this.state.currentAreaInstance && this.state.currentZIndex !== void 0 && this.state.currentAreaInstance.getLinkExits(this.state.currentZIndex).filter((t) => t.a === e.id || t.b === e.id).forEach((e) => {
|
|
1389
1389
|
let t = this.state.mapReader.getRoom(e.a), n = this.state.mapReader.getRoom(e.b);
|
|
1390
1390
|
if (!t || !n || (c.getExitTreatment ? c.getExitTreatment(e, t, n) : d(c, e, t, n)) !== "full") return;
|
|
1391
|
-
let r = s.renderDataWithColor(e,
|
|
1391
|
+
let r = s.renderDataWithColor(e, P, this.state.currentZIndex);
|
|
1392
1392
|
if (r) {
|
|
1393
1393
|
if (r.targetRoomId !== void 0 && this.spilledRoomPositions.has(r.targetRoomId)) return;
|
|
1394
1394
|
o.push(this.sceneManager.buildExitShape(r));
|
|
1395
1395
|
}
|
|
1396
1396
|
});
|
|
1397
|
-
for (let t of g(e, r,
|
|
1398
|
-
for (let t of i(e, r,
|
|
1397
|
+
for (let t of g(e, r, P)) o.push(h(t, e.id));
|
|
1398
|
+
for (let t of i(e, r, P)) o.push(me(t));
|
|
1399
1399
|
[...Object.values(e.exits), ...Object.values(e.specialExits)].forEach((e) => {
|
|
1400
1400
|
let t = this.state.mapReader.getRoom(e);
|
|
1401
1401
|
t && t.area === this.state.currentArea && t.z === this.state.currentZIndex && c.isVisible(t) && a.set(e, t);
|
|
@@ -1403,8 +1403,8 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1403
1403
|
let t = this.addStyledShape(e, this.positionLayerNode);
|
|
1404
1404
|
t && this.currentRoomOverlay.push(t);
|
|
1405
1405
|
}), a.forEach((i, a) => {
|
|
1406
|
-
let o = a === e.id, s =
|
|
1407
|
-
strokeOverride: o ?
|
|
1406
|
+
let o = a === e.id, s = pe(i, this.state.mapReader, r, {
|
|
1407
|
+
strokeOverride: o ? P : r.lineColor,
|
|
1408
1408
|
flatPipeline: !0,
|
|
1409
1409
|
...t(i, r.hiddenRooms)
|
|
1410
1410
|
});
|
|
@@ -1418,7 +1418,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1418
1418
|
if (n && (n.destroy(), this.highlightShapes.delete(e)), t !== void 0) {
|
|
1419
1419
|
let n = this.overlayReader().getRoom(e);
|
|
1420
1420
|
if (n && n.area === this.state.currentArea && n.z === this.state.currentZIndex) {
|
|
1421
|
-
let r =
|
|
1421
|
+
let r = de(n, t, this.state.settings), i = this.addStyledShape(ue(r), this.overlayLayerNode);
|
|
1422
1422
|
i && this.highlightShapes.set(e, i);
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
@@ -1431,7 +1431,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1431
1431
|
for (let [t] of this.state.highlights) {
|
|
1432
1432
|
let n = e.getRoom(t);
|
|
1433
1433
|
if (!n || n.area !== this.state.currentArea || n.z !== this.state.currentZIndex) continue;
|
|
1434
|
-
let r =
|
|
1434
|
+
let r = de(n, this.state.highlights.get(t).colors, this.state.settings), i = this.addStyledShape(ue(r), this.overlayLayerNode);
|
|
1435
1435
|
i && this.highlightShapes.set(t, i);
|
|
1436
1436
|
}
|
|
1437
1437
|
this.overlayLayerNode.batchDraw();
|
|
@@ -1442,7 +1442,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1442
1442
|
if (e === void 0 || t === void 0) return;
|
|
1443
1443
|
let n = this.overlayReader();
|
|
1444
1444
|
for (let r of this.state.paths) {
|
|
1445
|
-
let i =
|
|
1445
|
+
let i = ee(n, this.state.settings, r.locations, r.color, e, t);
|
|
1446
1446
|
for (let e of C(i)) {
|
|
1447
1447
|
let t = this.addStyledShape(e, this.overlayLayerNode);
|
|
1448
1448
|
t && this.pathShapes.push(t);
|
|
@@ -1461,7 +1461,7 @@ var I = "rgb(120, 72, 0)", lt = .5, ut = (1 + 2 * lt) ** 2, dt = class {
|
|
|
1461
1461
|
};
|
|
1462
1462
|
//#endregion
|
|
1463
1463
|
//#region src/style/shape/paintMap.ts
|
|
1464
|
-
function
|
|
1464
|
+
function F(e, t) {
|
|
1465
1465
|
if (e !== void 0) return typeof e == "string" ? t(e) : {
|
|
1466
1466
|
...e,
|
|
1467
1467
|
stops: e.stops.map((e) => ({
|
|
@@ -1470,7 +1470,7 @@ function L(e, t) {
|
|
|
1470
1470
|
}))
|
|
1471
1471
|
};
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function I(e) {
|
|
1474
1474
|
let t = e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);
|
|
1475
1475
|
return t ? {
|
|
1476
1476
|
r: parseInt(t[1]),
|
|
@@ -1484,13 +1484,13 @@ function R(e) {
|
|
|
1484
1484
|
a: 1
|
|
1485
1485
|
} : null;
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function L(e, t, n, r = 1) {
|
|
1488
1488
|
return r < 1 ? `rgba(${e}, ${t}, ${n}, ${r})` : `rgb(${e}, ${t}, ${n})`;
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1490
|
+
function R(e) {
|
|
1491
1491
|
return (.299 * e.r + .587 * e.g + .114 * e.b) / 255;
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1493
|
+
function mt(e, t, n) {
|
|
1494
1494
|
e /= 255, t /= 255, n /= 255;
|
|
1495
1495
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2;
|
|
1496
1496
|
if (r === i) return [
|
|
@@ -1505,99 +1505,99 @@ function ft(e, t, n) {
|
|
|
1505
1505
|
a
|
|
1506
1506
|
];
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function ht(e, t, n, r = 1) {
|
|
1509
1509
|
e = (e % 360 + 360) % 360;
|
|
1510
1510
|
let i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(e / 60 % 2 - 1)), o = n - i / 2, s, c, l;
|
|
1511
|
-
return e < 60 ? (s = i, c = a, l = 0) : e < 120 ? (s = a, c = i, l = 0) : e < 180 ? (s = 0, c = i, l = a) : e < 240 ? (s = 0, c = a, l = i) : e < 300 ? (s = a, c = 0, l = i) : (s = i, c = 0, l = a),
|
|
1511
|
+
return e < 60 ? (s = i, c = a, l = 0) : e < 120 ? (s = a, c = i, l = 0) : e < 180 ? (s = 0, c = i, l = a) : e < 240 ? (s = 0, c = a, l = i) : e < 300 ? (s = a, c = 0, l = i) : (s = i, c = 0, l = a), L(Math.round((s + o) * 255), Math.round((c + o) * 255), Math.round((l + o) * 255), r);
|
|
1512
1512
|
}
|
|
1513
1513
|
//#endregion
|
|
1514
1514
|
//#region src/style/shape/ParchmentStyle.ts
|
|
1515
|
-
var
|
|
1516
|
-
function St(e) {
|
|
1517
|
-
let t = R(e);
|
|
1518
|
-
if (!t) return z(yt, bt, xt);
|
|
1519
|
-
let n = B(t);
|
|
1520
|
-
return z(Math.round(gt + (yt - gt) * n), Math.round(_t + (bt - _t) * n), Math.round(vt + (xt - vt) * n), t.a);
|
|
1521
|
-
}
|
|
1522
|
-
function Ct(e) {
|
|
1523
|
-
let t = R(e);
|
|
1524
|
-
if (!t || t.a >= 1) return mt;
|
|
1525
|
-
let n = R(mt);
|
|
1526
|
-
return z(n.r, n.g, n.b, t.a);
|
|
1527
|
-
}
|
|
1515
|
+
var gt = "#4a3728", _t = "#3b2a1a", vt = 139, yt = 115, bt = 85, xt = 244, St = 228, Ct = 193;
|
|
1528
1516
|
function wt(e) {
|
|
1517
|
+
let t = I(e);
|
|
1518
|
+
if (!t) return L(xt, St, Ct);
|
|
1519
|
+
let n = R(t);
|
|
1520
|
+
return L(Math.round(vt + (xt - vt) * n), Math.round(yt + (St - yt) * n), Math.round(bt + (Ct - bt) * n), t.a);
|
|
1521
|
+
}
|
|
1522
|
+
function Tt(e) {
|
|
1523
|
+
let t = I(e);
|
|
1524
|
+
if (!t || t.a >= 1) return gt;
|
|
1525
|
+
let n = I(gt);
|
|
1526
|
+
return L(n.r, n.g, n.b, t.a);
|
|
1527
|
+
}
|
|
1528
|
+
function Et(e) {
|
|
1529
1529
|
return {
|
|
1530
1530
|
...e,
|
|
1531
|
-
fill:
|
|
1532
|
-
stroke: e.stroke ?
|
|
1531
|
+
fill: F(e.fill, wt),
|
|
1532
|
+
stroke: e.stroke ? Tt(e.stroke) : e.stroke
|
|
1533
1533
|
};
|
|
1534
1534
|
}
|
|
1535
|
-
var
|
|
1535
|
+
var Dt = { transform(e) {
|
|
1536
1536
|
switch (e.type) {
|
|
1537
1537
|
case "rect":
|
|
1538
1538
|
case "circle":
|
|
1539
1539
|
case "polygon": return {
|
|
1540
1540
|
...e,
|
|
1541
|
-
paint:
|
|
1541
|
+
paint: Et(e.paint)
|
|
1542
1542
|
};
|
|
1543
1543
|
case "line": return {
|
|
1544
1544
|
...e,
|
|
1545
1545
|
paint: e.paint.stroke ? {
|
|
1546
1546
|
...e.paint,
|
|
1547
|
-
stroke:
|
|
1547
|
+
stroke: Tt(e.paint.stroke)
|
|
1548
1548
|
} : e.paint
|
|
1549
1549
|
};
|
|
1550
1550
|
case "text": return {
|
|
1551
1551
|
...e,
|
|
1552
|
-
fill:
|
|
1552
|
+
fill: _t
|
|
1553
1553
|
};
|
|
1554
1554
|
case "image":
|
|
1555
1555
|
case "group": return e;
|
|
1556
1556
|
}
|
|
1557
|
-
} },
|
|
1558
|
-
function Pt(e) {
|
|
1559
|
-
let t = R(e);
|
|
1560
|
-
if (!t) return z(jt, Mt, Nt);
|
|
1561
|
-
let n = B(t);
|
|
1562
|
-
return z(Math.round(Ot + (jt - Ot) * n), Math.round(kt + (Mt - kt) * n), Math.round(At + (Nt - At) * n), t.a);
|
|
1563
|
-
}
|
|
1564
|
-
function Ft(e) {
|
|
1565
|
-
let t = R(e);
|
|
1566
|
-
if (!t || t.a >= 1) return Et;
|
|
1567
|
-
let n = R(Et);
|
|
1568
|
-
return z(n.r, n.g, n.b, t.a);
|
|
1569
|
-
}
|
|
1557
|
+
} }, Ot = "#c0deff", kt = "#e0f0ff", At = 20, jt = 40, Mt = 80, Nt = 60, Pt = 100, Ft = 160;
|
|
1570
1558
|
function It(e) {
|
|
1559
|
+
let t = I(e);
|
|
1560
|
+
if (!t) return L(Nt, Pt, Ft);
|
|
1561
|
+
let n = R(t);
|
|
1562
|
+
return L(Math.round(At + (Nt - At) * n), Math.round(jt + (Pt - jt) * n), Math.round(Mt + (Ft - Mt) * n), t.a);
|
|
1563
|
+
}
|
|
1564
|
+
function Lt(e) {
|
|
1565
|
+
let t = I(e);
|
|
1566
|
+
if (!t || t.a >= 1) return Ot;
|
|
1567
|
+
let n = I(Ot);
|
|
1568
|
+
return L(n.r, n.g, n.b, t.a);
|
|
1569
|
+
}
|
|
1570
|
+
function Rt(e) {
|
|
1571
1571
|
return {
|
|
1572
1572
|
...e,
|
|
1573
|
-
fill:
|
|
1574
|
-
stroke: e.stroke ?
|
|
1573
|
+
fill: F(e.fill, It),
|
|
1574
|
+
stroke: e.stroke ? Lt(e.stroke) : e.stroke
|
|
1575
1575
|
};
|
|
1576
1576
|
}
|
|
1577
|
-
var
|
|
1577
|
+
var zt = { transform(e) {
|
|
1578
1578
|
switch (e.type) {
|
|
1579
1579
|
case "rect":
|
|
1580
1580
|
case "circle":
|
|
1581
1581
|
case "polygon": return {
|
|
1582
1582
|
...e,
|
|
1583
|
-
paint:
|
|
1583
|
+
paint: Rt(e.paint)
|
|
1584
1584
|
};
|
|
1585
1585
|
case "line": return {
|
|
1586
1586
|
...e,
|
|
1587
1587
|
paint: e.paint.stroke ? {
|
|
1588
1588
|
...e.paint,
|
|
1589
|
-
stroke:
|
|
1589
|
+
stroke: Lt(e.paint.stroke)
|
|
1590
1590
|
} : e.paint
|
|
1591
1591
|
};
|
|
1592
1592
|
case "text": return {
|
|
1593
1593
|
...e,
|
|
1594
|
-
fill:
|
|
1594
|
+
fill: kt
|
|
1595
1595
|
};
|
|
1596
1596
|
case "image":
|
|
1597
1597
|
case "group": return e;
|
|
1598
1598
|
}
|
|
1599
|
-
} },
|
|
1600
|
-
function
|
|
1599
|
+
} }, Bt = "#00ffd0", Vt = .3, Ht = 3;
|
|
1600
|
+
function Ut(e, t, n) {
|
|
1601
1601
|
e /= 255, t /= 255, n /= 255;
|
|
1602
1602
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2;
|
|
1603
1603
|
if (r === i) return [
|
|
@@ -1612,68 +1612,68 @@ function Vt(e, t, n) {
|
|
|
1612
1612
|
a
|
|
1613
1613
|
];
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1615
|
+
function z(e, t, n, r = 1) {
|
|
1616
1616
|
e = (e % 360 + 360) % 360;
|
|
1617
1617
|
let i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(e / 60 % 2 - 1)), o = n - i / 2, s, c, l;
|
|
1618
1618
|
e < 60 ? (s = i, c = a, l = 0) : e < 120 ? (s = a, c = i, l = 0) : e < 180 ? (s = 0, c = i, l = a) : e < 240 ? (s = 0, c = a, l = i) : e < 300 ? (s = a, c = 0, l = i) : (s = i, c = 0, l = a);
|
|
1619
1619
|
let u = Math.round((s + o) * 255), d = Math.round((c + o) * 255), f = Math.round((l + o) * 255);
|
|
1620
1620
|
return r < 1 ? `rgba(${u}, ${d}, ${f}, ${r})` : `rgb(${u}, ${d}, ${f})`;
|
|
1621
1621
|
}
|
|
1622
|
-
function
|
|
1623
|
-
let t =
|
|
1622
|
+
function Wt(e) {
|
|
1623
|
+
let t = I(e);
|
|
1624
1624
|
if (!t) return {
|
|
1625
1625
|
h: 150,
|
|
1626
1626
|
a: 1
|
|
1627
1627
|
};
|
|
1628
|
-
let [n] =
|
|
1628
|
+
let [n] = Ut(t.r, t.g, t.b);
|
|
1629
1629
|
return {
|
|
1630
1630
|
h: n,
|
|
1631
1631
|
a: t.a
|
|
1632
1632
|
};
|
|
1633
1633
|
}
|
|
1634
|
-
function Wt(e) {
|
|
1635
|
-
let { h: t, a: n } = Ut(e);
|
|
1636
|
-
return Ht(t, .95, .65, n);
|
|
1637
|
-
}
|
|
1638
1634
|
function Gt(e) {
|
|
1639
|
-
let t =
|
|
1640
|
-
|
|
1641
|
-
let [n] = Vt(t.r, t.g, t.b);
|
|
1642
|
-
return Ht(n, .4, .1, t.a);
|
|
1635
|
+
let { h: t, a: n } = Wt(e);
|
|
1636
|
+
return z(t, .95, .65, n);
|
|
1643
1637
|
}
|
|
1644
1638
|
function Kt(e) {
|
|
1645
|
-
let
|
|
1646
|
-
|
|
1639
|
+
let t = I(e);
|
|
1640
|
+
if (!t) return "rgb(8, 12, 10)";
|
|
1641
|
+
let [n] = Ut(t.r, t.g, t.b);
|
|
1642
|
+
return z(n, .4, .1, t.a);
|
|
1647
1643
|
}
|
|
1648
1644
|
function qt(e) {
|
|
1645
|
+
let { h: t, a: n } = Wt(e);
|
|
1646
|
+
return z(t, .95, .65, Math.min(n, Vt));
|
|
1647
|
+
}
|
|
1648
|
+
function Jt(e) {
|
|
1649
1649
|
return {
|
|
1650
1650
|
...e,
|
|
1651
|
-
fill:
|
|
1652
|
-
stroke: e.stroke ?
|
|
1651
|
+
fill: F(e.fill, Kt),
|
|
1652
|
+
stroke: e.stroke ? Gt(e.stroke) : e.stroke
|
|
1653
1653
|
};
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1655
|
+
function Yt(e, t = !1) {
|
|
1656
1656
|
if (!e.stroke) return e;
|
|
1657
|
-
let n = (e.strokeWidth ?? 1) *
|
|
1657
|
+
let n = (e.strokeWidth ?? 1) * Ht;
|
|
1658
1658
|
return {
|
|
1659
|
-
stroke:
|
|
1659
|
+
stroke: qt(e.stroke),
|
|
1660
1660
|
strokeWidth: n,
|
|
1661
1661
|
dash: e.dash,
|
|
1662
1662
|
dashEnabled: e.dashEnabled,
|
|
1663
|
-
alpha: t ?
|
|
1663
|
+
alpha: t ? Vt : e.alpha
|
|
1664
1664
|
};
|
|
1665
1665
|
}
|
|
1666
|
-
var
|
|
1666
|
+
var Xt = { transform(e) {
|
|
1667
1667
|
switch (e.type) {
|
|
1668
1668
|
case "rect": {
|
|
1669
1669
|
let t = {
|
|
1670
1670
|
...e,
|
|
1671
|
-
paint:
|
|
1671
|
+
paint: Jt(e.paint)
|
|
1672
1672
|
};
|
|
1673
1673
|
return e.paint.stroke ? [{
|
|
1674
1674
|
...e,
|
|
1675
1675
|
paint: {
|
|
1676
|
-
...
|
|
1676
|
+
...Yt(e.paint),
|
|
1677
1677
|
fill: void 0
|
|
1678
1678
|
}
|
|
1679
1679
|
}, t] : t;
|
|
@@ -1681,12 +1681,12 @@ var Yt = { transform(e) {
|
|
|
1681
1681
|
case "circle": {
|
|
1682
1682
|
let t = {
|
|
1683
1683
|
...e,
|
|
1684
|
-
paint:
|
|
1684
|
+
paint: Jt(e.paint)
|
|
1685
1685
|
};
|
|
1686
1686
|
return e.paint.stroke ? [{
|
|
1687
1687
|
...e,
|
|
1688
1688
|
paint: {
|
|
1689
|
-
...
|
|
1689
|
+
...Yt(e.paint),
|
|
1690
1690
|
fill: void 0
|
|
1691
1691
|
}
|
|
1692
1692
|
}, t] : t;
|
|
@@ -1696,21 +1696,21 @@ var Yt = { transform(e) {
|
|
|
1696
1696
|
...e,
|
|
1697
1697
|
paint: e.paint.stroke ? {
|
|
1698
1698
|
...e.paint,
|
|
1699
|
-
stroke:
|
|
1699
|
+
stroke: Gt(e.paint.stroke)
|
|
1700
1700
|
} : e.paint
|
|
1701
1701
|
};
|
|
1702
1702
|
return e.paint.stroke ? [{
|
|
1703
1703
|
...e,
|
|
1704
|
-
paint:
|
|
1704
|
+
paint: Yt(e.paint, !0)
|
|
1705
1705
|
}, t] : t;
|
|
1706
1706
|
}
|
|
1707
1707
|
case "polygon": return {
|
|
1708
1708
|
...e,
|
|
1709
|
-
paint:
|
|
1709
|
+
paint: Jt(e.paint)
|
|
1710
1710
|
};
|
|
1711
1711
|
case "text": return {
|
|
1712
1712
|
...e,
|
|
1713
|
-
fill:
|
|
1713
|
+
fill: Bt
|
|
1714
1714
|
};
|
|
1715
1715
|
case "image":
|
|
1716
1716
|
case "group": return e;
|
|
@@ -1718,16 +1718,16 @@ var Yt = { transform(e) {
|
|
|
1718
1718
|
} };
|
|
1719
1719
|
//#endregion
|
|
1720
1720
|
//#region src/style/shape/wobble.ts
|
|
1721
|
-
function
|
|
1721
|
+
function B(e) {
|
|
1722
1722
|
let t = e | 0 || 1;
|
|
1723
1723
|
return () => (t = t * 1664525 + 1013904223 | 0, (t >>> 0) / 4294967296);
|
|
1724
1724
|
}
|
|
1725
|
-
function
|
|
1725
|
+
function V(...e) {
|
|
1726
1726
|
let t = 2654435769;
|
|
1727
1727
|
for (let n of e) t ^= (n * 1e3 | 0) + 2654435769 + (t << 6) + (t >> 2);
|
|
1728
1728
|
return t;
|
|
1729
1729
|
}
|
|
1730
|
-
function
|
|
1730
|
+
function Zt(e, t, n, r, i, a) {
|
|
1731
1731
|
let o = n - e, s = r - t, c = Math.sqrt(o * o + s * s);
|
|
1732
1732
|
if (c < .001) return [
|
|
1733
1733
|
e,
|
|
@@ -1742,17 +1742,17 @@ function Xt(e, t, n, r, i, a) {
|
|
|
1742
1742
|
}
|
|
1743
1743
|
return f.push(n + l * (a() - .5) * i * .3, r + u * (a() - .5) * i * .3), f;
|
|
1744
1744
|
}
|
|
1745
|
-
function
|
|
1745
|
+
function Qt(e, t, n) {
|
|
1746
1746
|
if (e.length < 4) return e;
|
|
1747
1747
|
let r = [];
|
|
1748
1748
|
for (let i = 0; i < e.length - 2; i += 2) {
|
|
1749
|
-
let a =
|
|
1749
|
+
let a = Zt(e[i], e[i + 1], e[i + 2], e[i + 3], t, n);
|
|
1750
1750
|
if (i === 0) r.push(...a);
|
|
1751
1751
|
else for (let e = 2; e < a.length; e++) r.push(a[e]);
|
|
1752
1752
|
}
|
|
1753
1753
|
return r;
|
|
1754
1754
|
}
|
|
1755
|
-
function
|
|
1755
|
+
function H(e, t, n, r, i, a) {
|
|
1756
1756
|
let o = [
|
|
1757
1757
|
e,
|
|
1758
1758
|
t,
|
|
@@ -1764,12 +1764,12 @@ function U(e, t, n, r, i, a) {
|
|
|
1764
1764
|
t + r
|
|
1765
1765
|
], s = [];
|
|
1766
1766
|
for (let e = 0; e < 4; e++) {
|
|
1767
|
-
let t = o[e * 2], n = o[e * 2 + 1], r = (e + 1) % 4, c = o[r * 2], l = o[r * 2 + 1], u =
|
|
1767
|
+
let t = o[e * 2], n = o[e * 2 + 1], r = (e + 1) % 4, c = o[r * 2], l = o[r * 2 + 1], u = Zt(t, n, c, l, i, a);
|
|
1768
1768
|
for (let e = 0; e < u.length - 2; e++) s.push(u[e]);
|
|
1769
1769
|
}
|
|
1770
1770
|
return s;
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1772
|
+
function $t(e, t, n, r, i) {
|
|
1773
1773
|
let a = [];
|
|
1774
1774
|
for (let o = 0; o < 24; o++) {
|
|
1775
1775
|
let s = o / 24 * Math.PI * 2, c = n + (i() - .5) * 2 * r;
|
|
@@ -1777,31 +1777,31 @@ function Qt(e, t, n, r, i) {
|
|
|
1777
1777
|
}
|
|
1778
1778
|
return a;
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1780
|
+
function en(e, t, n) {
|
|
1781
1781
|
let r = e.length / 2;
|
|
1782
1782
|
if (r < 2) return e;
|
|
1783
1783
|
let i = [];
|
|
1784
1784
|
for (let a = 0; a < r; a++) {
|
|
1785
|
-
let o = e[a * 2], s = e[a * 2 + 1], c = (a + 1) % r, l = e[c * 2], u = e[c * 2 + 1], d =
|
|
1785
|
+
let o = e[a * 2], s = e[a * 2 + 1], c = (a + 1) % r, l = e[c * 2], u = e[c * 2 + 1], d = Zt(o, s, l, u, t, n);
|
|
1786
1786
|
for (let e = 0; e < d.length - 2; e++) i.push(d[e]);
|
|
1787
1787
|
}
|
|
1788
1788
|
return i;
|
|
1789
1789
|
}
|
|
1790
1790
|
//#endregion
|
|
1791
1791
|
//#region src/style/shape/SketchyStyle.ts
|
|
1792
|
-
function
|
|
1792
|
+
function tn(e, t) {
|
|
1793
1793
|
if (!t) return e;
|
|
1794
1794
|
let n = t.match(/^rgba\(.+,\s*([\d.]+)\s*\)$/);
|
|
1795
1795
|
if (!n) return e;
|
|
1796
1796
|
let r = parseFloat(n[1]);
|
|
1797
1797
|
return r >= 1 ? e : `rgba(${parseInt(e.slice(1, 3), 16)}, ${parseInt(e.slice(3, 5), 16)}, ${parseInt(e.slice(5, 7), 16)}, ${r})`;
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1799
|
+
function nn(e) {
|
|
1800
1800
|
let { jitter: t, color: n } = e;
|
|
1801
1801
|
return { transform(e) {
|
|
1802
1802
|
switch (e.type) {
|
|
1803
1803
|
case "rect": {
|
|
1804
|
-
let r = V(
|
|
1804
|
+
let r = B(V(e.x, e.y, e.width, e.height)), i = e.paint.fill ? "#ffffff" : void 0, a = e.paint.stroke ? n : void 0;
|
|
1805
1805
|
if (e.cornerRadius && e.cornerRadius > 0) {
|
|
1806
1806
|
let n = [];
|
|
1807
1807
|
if (i && n.push({
|
|
@@ -1814,7 +1814,7 @@ function tn(e) {
|
|
|
1814
1814
|
}), a && e.paint.strokeWidth) {
|
|
1815
1815
|
let i = {
|
|
1816
1816
|
type: "polygon",
|
|
1817
|
-
vertices:
|
|
1817
|
+
vertices: H(e.x, e.y, e.width, e.height, t, r),
|
|
1818
1818
|
paint: {
|
|
1819
1819
|
stroke: a,
|
|
1820
1820
|
strokeWidth: e.paint.strokeWidth
|
|
@@ -1829,7 +1829,7 @@ function tn(e) {
|
|
|
1829
1829
|
}
|
|
1830
1830
|
return {
|
|
1831
1831
|
type: "polygon",
|
|
1832
|
-
vertices:
|
|
1832
|
+
vertices: H(e.x, e.y, e.width, e.height, t, r),
|
|
1833
1833
|
paint: {
|
|
1834
1834
|
fill: i,
|
|
1835
1835
|
stroke: a,
|
|
@@ -1841,10 +1841,10 @@ function tn(e) {
|
|
|
1841
1841
|
};
|
|
1842
1842
|
}
|
|
1843
1843
|
case "circle": {
|
|
1844
|
-
let r = V(
|
|
1844
|
+
let r = B(V(e.cx, e.cy, e.radius));
|
|
1845
1845
|
return {
|
|
1846
1846
|
type: "polygon",
|
|
1847
|
-
vertices:
|
|
1847
|
+
vertices: $t(e.cx, e.cy, e.radius, t, r),
|
|
1848
1848
|
paint: {
|
|
1849
1849
|
fill: e.paint.fill ? "#ffffff" : void 0,
|
|
1850
1850
|
stroke: e.paint.stroke ? n : void 0,
|
|
@@ -1856,7 +1856,7 @@ function tn(e) {
|
|
|
1856
1856
|
};
|
|
1857
1857
|
}
|
|
1858
1858
|
case "line": {
|
|
1859
|
-
let r = V(
|
|
1859
|
+
let r = B(V(...e.points.slice(0, 4))), i = Qt(e.points, t, r), a = tn(n, e.paint.stroke), o = {
|
|
1860
1860
|
...e.paint,
|
|
1861
1861
|
stroke: a
|
|
1862
1862
|
};
|
|
@@ -1867,7 +1867,7 @@ function tn(e) {
|
|
|
1867
1867
|
};
|
|
1868
1868
|
}
|
|
1869
1869
|
case "polygon": {
|
|
1870
|
-
let r = V(
|
|
1870
|
+
let r = B(V(...e.vertices.slice(0, 4))), i = en(e.vertices, t, r);
|
|
1871
1871
|
return {
|
|
1872
1872
|
...e,
|
|
1873
1873
|
vertices: i,
|
|
@@ -1889,10 +1889,10 @@ function tn(e) {
|
|
|
1889
1889
|
}
|
|
1890
1890
|
//#endregion
|
|
1891
1891
|
//#region src/style/shape/IsometricStyle.ts
|
|
1892
|
-
function
|
|
1893
|
-
return
|
|
1892
|
+
function U(e, t) {
|
|
1893
|
+
return F(e, (e) => _(e, t));
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function W(e, t) {
|
|
1896
1896
|
if (!t || typeof t == "string") return t;
|
|
1897
1897
|
if (t.type === "linear") {
|
|
1898
1898
|
let [n, r] = e(t.x0, t.y0), [i, a] = e(t.x1, t.y1);
|
|
@@ -1915,16 +1915,16 @@ function G(e, t) {
|
|
|
1915
1915
|
}
|
|
1916
1916
|
return i;
|
|
1917
1917
|
}
|
|
1918
|
-
function
|
|
1918
|
+
function rn(e) {
|
|
1919
1919
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
1920
1920
|
return (e, t) => [e * n - t * r, (e * r + t * n) * .5];
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1922
|
+
function an(e) {
|
|
1923
1923
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
1924
1924
|
return (e, t) => [e * n + 2 * t * r, -e * r + 2 * t * n];
|
|
1925
1925
|
}
|
|
1926
|
-
var
|
|
1927
|
-
function
|
|
1926
|
+
var G = 32;
|
|
1927
|
+
function on(e, t) {
|
|
1928
1928
|
let n = Array(t.length);
|
|
1929
1929
|
for (let r = 0; r < t.length; r += 2) {
|
|
1930
1930
|
let [i, a] = e(t[r], t[r + 1]);
|
|
@@ -1932,7 +1932,7 @@ function an(e, t) {
|
|
|
1932
1932
|
}
|
|
1933
1933
|
return n;
|
|
1934
1934
|
}
|
|
1935
|
-
function
|
|
1935
|
+
function sn(e, t, n, r, i) {
|
|
1936
1936
|
let [a, o] = e(t, n), [s, c] = e(t + r, n), [l, u] = e(t + r, n + i), [d, f] = e(t, n + i);
|
|
1937
1937
|
return [
|
|
1938
1938
|
a,
|
|
@@ -1945,8 +1945,8 @@ function on(e, t, n, r, i) {
|
|
|
1945
1945
|
f
|
|
1946
1946
|
];
|
|
1947
1947
|
}
|
|
1948
|
-
function
|
|
1949
|
-
let t = e.rotation ?? 0, n = e.depth ?? .18, r =
|
|
1948
|
+
function cn(e = {}) {
|
|
1949
|
+
let t = e.rotation ?? 0, n = e.depth ?? .18, r = rn(t), i = an(t);
|
|
1950
1950
|
function a(e, t, n, i) {
|
|
1951
1951
|
let [a, o] = r(e, t), [s, c] = r(e + n, t), [l, u] = r(e, t + i);
|
|
1952
1952
|
return [
|
|
@@ -1959,7 +1959,7 @@ function sn(e = {}) {
|
|
|
1959
1959
|
];
|
|
1960
1960
|
}
|
|
1961
1961
|
function o(e) {
|
|
1962
|
-
let { x: t, y: i, width: a, height: o, paint: s } = e, c =
|
|
1962
|
+
let { x: t, y: i, width: a, height: o, paint: s } = e, c = sn(r, t, i, a, o);
|
|
1963
1963
|
if (s.dash || s.dashEnabled) {
|
|
1964
1964
|
let t = [];
|
|
1965
1965
|
for (let n = 0; n < 8; n += 2) {
|
|
@@ -1985,7 +1985,7 @@ function sn(e = {}) {
|
|
|
1985
1985
|
if (n > 0 && s.fill) {
|
|
1986
1986
|
let t = [], i = 0;
|
|
1987
1987
|
for (let e = 1; e < 4; e++) c[e * 2 + 1] > c[i * 2 + 1] && (i = e);
|
|
1988
|
-
let a = c[i * 2], o = c[i * 2 + 1], l = (i + 3) % 4, u = c[l * 2], d = c[l * 2 + 1], f = (i + 1) % 4, p = c[f * 2], m = c[f * 2 + 1], h = (i + 2) % 4, g = c[h * 2], _ = c[h * 2 + 1], v =
|
|
1988
|
+
let a = c[i * 2], o = c[i * 2 + 1], l = (i + 3) % 4, u = c[l * 2], d = c[l * 2 + 1], f = (i + 1) % 4, p = c[f * 2], m = c[f * 2 + 1], h = (i + 2) % 4, g = c[h * 2], _ = c[h * 2 + 1], v = W(r, s.fill);
|
|
1989
1989
|
if (t.push({
|
|
1990
1990
|
type: "polygon",
|
|
1991
1991
|
vertices: [
|
|
@@ -1998,7 +1998,7 @@ function sn(e = {}) {
|
|
|
1998
1998
|
u,
|
|
1999
1999
|
d + n
|
|
2000
2000
|
],
|
|
2001
|
-
paint: { fill:
|
|
2001
|
+
paint: { fill: U(v, .2) },
|
|
2002
2002
|
layer: e.layer
|
|
2003
2003
|
}), t.push({
|
|
2004
2004
|
type: "polygon",
|
|
@@ -2012,7 +2012,7 @@ function sn(e = {}) {
|
|
|
2012
2012
|
a,
|
|
2013
2013
|
o + n
|
|
2014
2014
|
],
|
|
2015
|
-
paint: { fill:
|
|
2015
|
+
paint: { fill: U(v, .4) },
|
|
2016
2016
|
layer: e.layer
|
|
2017
2017
|
}), t.push({
|
|
2018
2018
|
type: "polygon",
|
|
@@ -2068,7 +2068,7 @@ function sn(e = {}) {
|
|
|
2068
2068
|
type: "polygon",
|
|
2069
2069
|
vertices: c,
|
|
2070
2070
|
paint: {
|
|
2071
|
-
fill:
|
|
2071
|
+
fill: W(r, s.fill),
|
|
2072
2072
|
stroke: s.stroke,
|
|
2073
2073
|
strokeWidth: s.strokeWidth
|
|
2074
2074
|
},
|
|
@@ -2078,15 +2078,15 @@ function sn(e = {}) {
|
|
|
2078
2078
|
};
|
|
2079
2079
|
}
|
|
2080
2080
|
function s(e) {
|
|
2081
|
-
let { cx: t, cy: i, radius: a, paint: o } = e, s = Array(
|
|
2082
|
-
for (let e = 0; e <
|
|
2083
|
-
let n = e /
|
|
2081
|
+
let { cx: t, cy: i, radius: a, paint: o } = e, s = Array(G * 2);
|
|
2082
|
+
for (let e = 0; e < G; e++) {
|
|
2083
|
+
let n = e / G * Math.PI * 2, [o, c] = r(t + Math.cos(n) * a, i + Math.sin(n) * a);
|
|
2084
2084
|
s[e * 2] = o, s[e * 2 + 1] = c;
|
|
2085
2085
|
}
|
|
2086
2086
|
if (o.dash || o.dashEnabled) {
|
|
2087
2087
|
let t = [];
|
|
2088
|
-
for (let n = 0; n <
|
|
2089
|
-
let r = (n + 1) %
|
|
2088
|
+
for (let n = 0; n < G; n++) {
|
|
2089
|
+
let r = (n + 1) % G;
|
|
2090
2090
|
t.push({
|
|
2091
2091
|
type: "line",
|
|
2092
2092
|
points: [
|
|
@@ -2105,18 +2105,18 @@ function sn(e = {}) {
|
|
|
2105
2105
|
}
|
|
2106
2106
|
return t;
|
|
2107
2107
|
}
|
|
2108
|
-
let c = [], l =
|
|
2108
|
+
let c = [], l = W(r, o.fill);
|
|
2109
2109
|
if (n > 0 && o.fill) {
|
|
2110
2110
|
let t = 0, r = 0, i = 0, a = -Infinity, u = Infinity, d = -Infinity;
|
|
2111
|
-
for (let e = 0; e <
|
|
2111
|
+
for (let e = 0; e < G; e++) s[e * 2] > a && (a = s[e * 2], t = e), s[e * 2] < u && (u = s[e * 2], r = e), s[e * 2 + 1] > d && (d = s[e * 2 + 1], i = e);
|
|
2112
2112
|
let f = [], p = t;
|
|
2113
|
-
for (let e = 0; e <=
|
|
2113
|
+
for (let e = 0; e <= G && (f.push(s[p * 2], s[p * 2 + 1]), p !== i); e++) p = (p + 1) % G;
|
|
2114
2114
|
for (let e = f.length - 2; e >= 0; e -= 2) f.push(f[e], f[e + 1] + n);
|
|
2115
2115
|
c.push({
|
|
2116
2116
|
type: "polygon",
|
|
2117
2117
|
vertices: f,
|
|
2118
2118
|
paint: {
|
|
2119
|
-
fill:
|
|
2119
|
+
fill: U(l, .2),
|
|
2120
2120
|
stroke: o.stroke,
|
|
2121
2121
|
strokeWidth: o.strokeWidth ? o.strokeWidth * .5 : void 0
|
|
2122
2122
|
},
|
|
@@ -2124,13 +2124,13 @@ function sn(e = {}) {
|
|
|
2124
2124
|
});
|
|
2125
2125
|
let m = [];
|
|
2126
2126
|
p = i;
|
|
2127
|
-
for (let e = 0; e <=
|
|
2127
|
+
for (let e = 0; e <= G && (m.push(s[p * 2], s[p * 2 + 1]), p !== r); e++) p = (p + 1) % G;
|
|
2128
2128
|
for (let e = m.length - 2; e >= 0; e -= 2) m.push(m[e], m[e + 1] + n);
|
|
2129
2129
|
c.push({
|
|
2130
2130
|
type: "polygon",
|
|
2131
2131
|
vertices: m,
|
|
2132
2132
|
paint: {
|
|
2133
|
-
fill:
|
|
2133
|
+
fill: U(l, .4),
|
|
2134
2134
|
stroke: o.stroke,
|
|
2135
2135
|
strokeWidth: o.strokeWidth ? o.strokeWidth * .5 : void 0
|
|
2136
2136
|
},
|
|
@@ -2158,14 +2158,14 @@ function sn(e = {}) {
|
|
|
2158
2158
|
case "circle": return s(e);
|
|
2159
2159
|
case "line": return {
|
|
2160
2160
|
...e,
|
|
2161
|
-
points:
|
|
2161
|
+
points: on(r, e.points)
|
|
2162
2162
|
};
|
|
2163
2163
|
case "polygon": return {
|
|
2164
2164
|
...e,
|
|
2165
|
-
vertices:
|
|
2165
|
+
vertices: on(r, e.vertices),
|
|
2166
2166
|
paint: {
|
|
2167
2167
|
...e.paint,
|
|
2168
|
-
fill:
|
|
2168
|
+
fill: W(r, e.paint.fill)
|
|
2169
2169
|
}
|
|
2170
2170
|
};
|
|
2171
2171
|
case "text": {
|
|
@@ -2230,21 +2230,21 @@ function sn(e = {}) {
|
|
|
2230
2230
|
}
|
|
2231
2231
|
//#endregion
|
|
2232
2232
|
//#region src/style/shape/ConstructionStyle.ts
|
|
2233
|
-
var
|
|
2234
|
-
function gn(e) {
|
|
2235
|
-
let t = R(e);
|
|
2236
|
-
if (!t) return z(pn, mn, hn);
|
|
2237
|
-
let n = B(t);
|
|
2238
|
-
return z(Math.round(un + (pn - un) * n), Math.round(dn + (mn - dn) * n), Math.round(fn + (hn - fn) * n), t.a);
|
|
2239
|
-
}
|
|
2233
|
+
var K = "#1a1a1a", ln = "#ffc200", un = "#ff6600", dn = 26, fn = 26, pn = 26, mn = 255, hn = 194, gn = 0;
|
|
2240
2234
|
function _n(e) {
|
|
2235
|
+
let t = I(e);
|
|
2236
|
+
if (!t) return L(mn, hn, gn);
|
|
2237
|
+
let n = R(t);
|
|
2238
|
+
return L(Math.round(dn + (mn - dn) * n), Math.round(fn + (hn - fn) * n), Math.round(pn + (gn - pn) * n), t.a);
|
|
2239
|
+
}
|
|
2240
|
+
function vn(e) {
|
|
2241
2241
|
return {
|
|
2242
2242
|
...e,
|
|
2243
|
-
fill:
|
|
2244
|
-
stroke: e.stroke ?
|
|
2243
|
+
fill: F(e.fill, _n),
|
|
2244
|
+
stroke: e.stroke ? K : e.stroke
|
|
2245
2245
|
};
|
|
2246
2246
|
}
|
|
2247
|
-
function
|
|
2247
|
+
function yn(e, t, n, r) {
|
|
2248
2248
|
let i = [], a = e.length;
|
|
2249
2249
|
for (let o = 0; o < a; o++) {
|
|
2250
2250
|
let s = e[o], c = e[(o + 1) % a], l = t * s[0] + n * s[1] - r, u = t * c[0] + n * c[1] - r;
|
|
@@ -2255,7 +2255,7 @@ function vn(e, t, n, r) {
|
|
|
2255
2255
|
}
|
|
2256
2256
|
return i;
|
|
2257
2257
|
}
|
|
2258
|
-
function
|
|
2258
|
+
function bn(e, t, n, r, i) {
|
|
2259
2259
|
let a = [
|
|
2260
2260
|
[e, t],
|
|
2261
2261
|
[e + n, t],
|
|
@@ -2263,37 +2263,37 @@ function yn(e, t, n, r, i) {
|
|
|
2263
2263
|
[e, t + r]
|
|
2264
2264
|
], o = i * .4, s = o * .35, c = e + t, l = e + n + t + r, u = Math.floor(c / o) - 1, d = Math.ceil(l / o) + 1, f = [];
|
|
2265
2265
|
for (let e = u; e <= d; e++) {
|
|
2266
|
-
let t = e * o, n = t + s, r =
|
|
2267
|
-
r =
|
|
2266
|
+
let t = e * o, n = t + s, r = yn(a, 1, 1, t);
|
|
2267
|
+
r = yn(r, -1, -1, -n), r.length >= 3 && f.push(r.flatMap((e) => [e[0], e[1]]));
|
|
2268
2268
|
}
|
|
2269
2269
|
return f;
|
|
2270
2270
|
}
|
|
2271
|
-
var
|
|
2271
|
+
var xn = { transform(e, t) {
|
|
2272
2272
|
switch (e.type) {
|
|
2273
2273
|
case "rect": {
|
|
2274
2274
|
if (!e.paint.fill) return {
|
|
2275
2275
|
...e,
|
|
2276
|
-
paint:
|
|
2276
|
+
paint: vn(e.paint)
|
|
2277
2277
|
};
|
|
2278
2278
|
let n = {
|
|
2279
2279
|
...e,
|
|
2280
2280
|
paint: {
|
|
2281
|
-
fill:
|
|
2281
|
+
fill: K,
|
|
2282
2282
|
strokeWidth: e.paint.strokeWidth
|
|
2283
2283
|
}
|
|
2284
|
-
}, r =
|
|
2284
|
+
}, r = bn(e.x, e.y, e.width, e.height, t.roomSize).map((t) => ({
|
|
2285
2285
|
type: "polygon",
|
|
2286
2286
|
vertices: t,
|
|
2287
2287
|
layer: e.layer,
|
|
2288
2288
|
paint: {
|
|
2289
|
-
fill:
|
|
2289
|
+
fill: ln,
|
|
2290
2290
|
alpha: .65
|
|
2291
2291
|
}
|
|
2292
2292
|
})), i = {
|
|
2293
2293
|
...e,
|
|
2294
2294
|
hit: void 0,
|
|
2295
2295
|
paint: {
|
|
2296
|
-
stroke:
|
|
2296
|
+
stroke: K,
|
|
2297
2297
|
strokeWidth: e.paint.strokeWidth
|
|
2298
2298
|
}
|
|
2299
2299
|
};
|
|
@@ -2305,38 +2305,38 @@ var bn = { transform(e, t) {
|
|
|
2305
2305
|
}
|
|
2306
2306
|
case "circle": return {
|
|
2307
2307
|
...e,
|
|
2308
|
-
paint:
|
|
2308
|
+
paint: vn(e.paint)
|
|
2309
2309
|
};
|
|
2310
2310
|
case "polygon": return {
|
|
2311
2311
|
...e,
|
|
2312
2312
|
paint: {
|
|
2313
2313
|
...e.paint,
|
|
2314
|
-
fill: e.paint.fill ?
|
|
2315
|
-
stroke: e.paint.stroke ?
|
|
2314
|
+
fill: e.paint.fill ? un : e.paint.fill,
|
|
2315
|
+
stroke: e.paint.stroke ? K : e.paint.stroke
|
|
2316
2316
|
}
|
|
2317
2317
|
};
|
|
2318
2318
|
case "line": return {
|
|
2319
2319
|
...e,
|
|
2320
2320
|
paint: e.paint.stroke ? {
|
|
2321
2321
|
...e.paint,
|
|
2322
|
-
stroke:
|
|
2322
|
+
stroke: un
|
|
2323
2323
|
} : e.paint
|
|
2324
2324
|
};
|
|
2325
2325
|
case "text": return {
|
|
2326
2326
|
...e,
|
|
2327
|
-
fill:
|
|
2328
|
-
stroke:
|
|
2327
|
+
fill: un,
|
|
2328
|
+
stroke: K,
|
|
2329
2329
|
strokeWidth: t.roomSize * .25
|
|
2330
2330
|
};
|
|
2331
2331
|
case "image":
|
|
2332
2332
|
case "group": return e;
|
|
2333
2333
|
}
|
|
2334
|
-
} },
|
|
2334
|
+
} }, Sn = "#c8eeff", Cn = "#00c8ff", wn = "#00ffaa", Tn = .2, En = 5, q = 190;
|
|
2335
2335
|
function Dn(e, t, n) {
|
|
2336
2336
|
e /= 255, t /= 255, n /= 255;
|
|
2337
2337
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2;
|
|
2338
2338
|
if (r === i) return [
|
|
2339
|
-
|
|
2339
|
+
q,
|
|
2340
2340
|
0,
|
|
2341
2341
|
a
|
|
2342
2342
|
];
|
|
@@ -2355,30 +2355,30 @@ function On(e, t, n, r = 1) {
|
|
|
2355
2355
|
return r < 1 ? `rgba(${u},${d},${f},${r})` : `rgb(${u},${d},${f})`;
|
|
2356
2356
|
}
|
|
2357
2357
|
function kn(e) {
|
|
2358
|
-
let t =
|
|
2359
|
-
if (!t) return On(
|
|
2358
|
+
let t = I(e);
|
|
2359
|
+
if (!t) return On(q, .55, .18);
|
|
2360
2360
|
let [n, r] = Dn(t.r, t.g, t.b);
|
|
2361
|
-
return On(r < .08 ?
|
|
2361
|
+
return On(r < .08 ? q : n, .55, .18, t.a);
|
|
2362
2362
|
}
|
|
2363
2363
|
function An(e) {
|
|
2364
2364
|
return {
|
|
2365
2365
|
...e,
|
|
2366
|
-
fill:
|
|
2367
|
-
stroke: e.stroke ?
|
|
2366
|
+
fill: F(e.fill, kn),
|
|
2367
|
+
stroke: e.stroke ? Cn : e.stroke
|
|
2368
2368
|
};
|
|
2369
2369
|
}
|
|
2370
2370
|
function jn(e) {
|
|
2371
2371
|
return {
|
|
2372
|
-
stroke:
|
|
2373
|
-
strokeWidth: (e.strokeWidth ?? 1) *
|
|
2374
|
-
alpha:
|
|
2372
|
+
stroke: Cn,
|
|
2373
|
+
strokeWidth: (e.strokeWidth ?? 1) * En,
|
|
2374
|
+
alpha: Tn
|
|
2375
2375
|
};
|
|
2376
2376
|
}
|
|
2377
2377
|
function Mn(e) {
|
|
2378
2378
|
return {
|
|
2379
|
-
stroke:
|
|
2380
|
-
strokeWidth: (e.strokeWidth ?? 1) *
|
|
2381
|
-
alpha:
|
|
2379
|
+
stroke: wn,
|
|
2380
|
+
strokeWidth: (e.strokeWidth ?? 1) * En,
|
|
2381
|
+
alpha: Tn,
|
|
2382
2382
|
dash: e.dash,
|
|
2383
2383
|
dashEnabled: e.dashEnabled
|
|
2384
2384
|
};
|
|
@@ -2425,7 +2425,7 @@ var Nn = { transform(e) {
|
|
|
2425
2425
|
...e,
|
|
2426
2426
|
paint: e.paint.stroke ? {
|
|
2427
2427
|
...e.paint,
|
|
2428
|
-
stroke:
|
|
2428
|
+
stroke: wn
|
|
2429
2429
|
} : e.paint
|
|
2430
2430
|
};
|
|
2431
2431
|
return e.paint.stroke ? [{
|
|
@@ -2438,13 +2438,13 @@ var Nn = { transform(e) {
|
|
|
2438
2438
|
...e,
|
|
2439
2439
|
paint: {
|
|
2440
2440
|
...e.paint,
|
|
2441
|
-
fill: e.paint.fill ?
|
|
2441
|
+
fill: e.paint.fill ? wn : e.paint.fill,
|
|
2442
2442
|
stroke: void 0
|
|
2443
2443
|
}
|
|
2444
2444
|
};
|
|
2445
2445
|
case "text": return {
|
|
2446
2446
|
...e,
|
|
2447
|
-
fill:
|
|
2447
|
+
fill: Sn
|
|
2448
2448
|
};
|
|
2449
2449
|
case "image":
|
|
2450
2450
|
case "group": return e;
|
|
@@ -2507,16 +2507,16 @@ function Fn(e = {}) {
|
|
|
2507
2507
|
//#region src/style/shape/StainedGlassStyle.ts
|
|
2508
2508
|
var In = "#0a0a0a", Ln = "#f4f0e0", Rn = .6, zn = .4, Bn = .62, Vn = 2.2, Hn = .06;
|
|
2509
2509
|
function Un(e) {
|
|
2510
|
-
let t =
|
|
2510
|
+
let t = I(e);
|
|
2511
2511
|
if (!t) return e;
|
|
2512
|
-
let [n, r, i] =
|
|
2513
|
-
return
|
|
2512
|
+
let [n, r, i] = mt(t.r, t.g, t.b);
|
|
2513
|
+
return ht(n, r < .08 ? r : Math.max(r, Rn), Math.min(Bn, Math.max(zn, i)), t.a);
|
|
2514
2514
|
}
|
|
2515
2515
|
function Wn(e) {
|
|
2516
2516
|
return Math.max((e ?? .04) * Vn, Hn);
|
|
2517
2517
|
}
|
|
2518
2518
|
function Gn(e) {
|
|
2519
|
-
let t =
|
|
2519
|
+
let t = F(e.fill, Un), n = t !== void 0 || e.stroke !== void 0;
|
|
2520
2520
|
return {
|
|
2521
2521
|
...e,
|
|
2522
2522
|
fill: t,
|
|
@@ -2551,16 +2551,16 @@ var Kn = { transform(e) {
|
|
|
2551
2551
|
}
|
|
2552
2552
|
} }, qn = "#1c3f6e", Jn = 1.4, Yn = .05, Xn = 198, Zn = 212, Qn = 230, $n = 248, er = 250, tr = 255;
|
|
2553
2553
|
function nr(e) {
|
|
2554
|
-
let t =
|
|
2555
|
-
if (!t) return
|
|
2556
|
-
let n =
|
|
2557
|
-
return
|
|
2554
|
+
let t = I(e);
|
|
2555
|
+
if (!t) return L($n, er, tr);
|
|
2556
|
+
let n = R(t);
|
|
2557
|
+
return L(Math.round(Xn + ($n - Xn) * n), Math.round(Zn + (er - Zn) * n), Math.round(Qn + (tr - Qn) * n), t.a);
|
|
2558
2558
|
}
|
|
2559
2559
|
function rr(e) {
|
|
2560
|
-
let t =
|
|
2560
|
+
let t = I(e);
|
|
2561
2561
|
if (!t || t.a >= 1) return qn;
|
|
2562
|
-
let n =
|
|
2563
|
-
return
|
|
2562
|
+
let n = I(qn);
|
|
2563
|
+
return L(n.r, n.g, n.b, t.a);
|
|
2564
2564
|
}
|
|
2565
2565
|
function ir(e) {
|
|
2566
2566
|
return Math.max((e ?? .04) * Jn, Yn);
|
|
@@ -2568,7 +2568,7 @@ function ir(e) {
|
|
|
2568
2568
|
function ar(e) {
|
|
2569
2569
|
return {
|
|
2570
2570
|
...e,
|
|
2571
|
-
fill:
|
|
2571
|
+
fill: F(e.fill, nr),
|
|
2572
2572
|
stroke: e.stroke ? rr(e.stroke) : e.stroke,
|
|
2573
2573
|
strokeWidth: e.stroke ? ir(e.strokeWidth) : e.strokeWidth
|
|
2574
2574
|
};
|
|
@@ -2598,15 +2598,15 @@ var or = { transform(e) {
|
|
|
2598
2598
|
}
|
|
2599
2599
|
} }, sr = "#7a6a48", cr = "#8a7a55", lr = "#4a3f28", ur = 78, dr = 93, fr = 52, pr = 221, mr = 207, hr = 166, gr = 2, _r = .26, vr = .02;
|
|
2600
2600
|
function yr(e) {
|
|
2601
|
-
let t =
|
|
2602
|
-
if (!t) return
|
|
2603
|
-
let n =
|
|
2604
|
-
return
|
|
2601
|
+
let t = I(e);
|
|
2602
|
+
if (!t) return L(pr, mr, hr);
|
|
2603
|
+
let n = R(t);
|
|
2604
|
+
return L(Math.round(ur + (pr - ur) * n), Math.round(dr + (mr - dr) * n), Math.round(fr + (hr - fr) * n), t.a);
|
|
2605
2605
|
}
|
|
2606
2606
|
function br(e) {
|
|
2607
2607
|
return {
|
|
2608
2608
|
...e,
|
|
2609
|
-
fill:
|
|
2609
|
+
fill: F(e.fill, yr),
|
|
2610
2610
|
stroke: e.stroke ? sr : e.stroke
|
|
2611
2611
|
};
|
|
2612
2612
|
}
|
|
@@ -2701,8 +2701,8 @@ var xr = {
|
|
|
2701
2701
|
}
|
|
2702
2702
|
} }, Cr = "#3a3a44";
|
|
2703
2703
|
function wr(e, t) {
|
|
2704
|
-
return
|
|
2705
|
-
let n =
|
|
2704
|
+
return F(e, (e) => {
|
|
2705
|
+
let n = I(e);
|
|
2706
2706
|
return n ? `rgba(${n.r}, ${n.g}, ${n.b}, ${(n.a * t).toFixed(3)})` : e;
|
|
2707
2707
|
});
|
|
2708
2708
|
}
|
|
@@ -2711,7 +2711,7 @@ function Tr(e = {}) {
|
|
|
2711
2711
|
function i(e, t, i, a, o, s) {
|
|
2712
2712
|
let c = wr(t.fill, r), l = [];
|
|
2713
2713
|
for (let t = 0; t < n; t++) {
|
|
2714
|
-
let n =
|
|
2714
|
+
let n = B(i + t * 2654435769);
|
|
2715
2715
|
l.push({
|
|
2716
2716
|
type: "polygon",
|
|
2717
2717
|
vertices: e(n),
|
|
@@ -2730,10 +2730,10 @@ function Tr(e = {}) {
|
|
|
2730
2730
|
switch (e.type) {
|
|
2731
2731
|
case "rect":
|
|
2732
2732
|
if (!e.paint.fill) {
|
|
2733
|
-
let n = V(
|
|
2733
|
+
let n = B(V(e.x, e.y, e.width, e.height));
|
|
2734
2734
|
return {
|
|
2735
2735
|
type: "polygon",
|
|
2736
|
-
vertices:
|
|
2736
|
+
vertices: H(e.x, e.y, e.width, e.height, t, n),
|
|
2737
2737
|
paint: {
|
|
2738
2738
|
stroke: e.paint.stroke,
|
|
2739
2739
|
strokeWidth: e.paint.strokeWidth ?? 0,
|
|
@@ -2744,13 +2744,13 @@ function Tr(e = {}) {
|
|
|
2744
2744
|
noScale: e.noScale
|
|
2745
2745
|
};
|
|
2746
2746
|
}
|
|
2747
|
-
return i((n) =>
|
|
2747
|
+
return i((n) => H(e.x, e.y, e.width, e.height, t, n), e.paint, V(e.x, e.y, e.width, e.height), e.layer, e.hit, e.noScale);
|
|
2748
2748
|
case "circle":
|
|
2749
2749
|
if (!e.paint.fill) {
|
|
2750
|
-
let n = V(
|
|
2750
|
+
let n = B(V(e.cx, e.cy, e.radius));
|
|
2751
2751
|
return {
|
|
2752
2752
|
type: "polygon",
|
|
2753
|
-
vertices:
|
|
2753
|
+
vertices: $t(e.cx, e.cy, e.radius, t, n),
|
|
2754
2754
|
paint: {
|
|
2755
2755
|
stroke: e.paint.stroke,
|
|
2756
2756
|
strokeWidth: e.paint.strokeWidth ?? 0,
|
|
@@ -2761,20 +2761,20 @@ function Tr(e = {}) {
|
|
|
2761
2761
|
noScale: e.noScale
|
|
2762
2762
|
};
|
|
2763
2763
|
}
|
|
2764
|
-
return i((n) =>
|
|
2764
|
+
return i((n) => $t(e.cx, e.cy, e.radius, t, n), e.paint, V(e.cx, e.cy, e.radius), e.layer, e.hit, e.noScale);
|
|
2765
2765
|
case "polygon":
|
|
2766
2766
|
if (!e.paint.fill) {
|
|
2767
|
-
let n = V(
|
|
2767
|
+
let n = B(V(...e.vertices.slice(0, 4)));
|
|
2768
2768
|
return {
|
|
2769
2769
|
...e,
|
|
2770
|
-
vertices:
|
|
2770
|
+
vertices: en(e.vertices, t, n),
|
|
2771
2771
|
paint: {
|
|
2772
2772
|
...e.paint,
|
|
2773
2773
|
alpha: .5
|
|
2774
2774
|
}
|
|
2775
2775
|
};
|
|
2776
2776
|
}
|
|
2777
|
-
return i((n) =>
|
|
2777
|
+
return i((n) => en(e.vertices, t, n), e.paint, V(...e.vertices.slice(0, 4)), e.layer, e.hit, e.noScale);
|
|
2778
2778
|
case "line": return {
|
|
2779
2779
|
...e,
|
|
2780
2780
|
paint: {
|
|
@@ -2795,15 +2795,15 @@ function Tr(e = {}) {
|
|
|
2795
2795
|
//#region src/style/shape/DarkModernStyle.ts
|
|
2796
2796
|
var Er = "rgba(255, 255, 255, 0.14)", Dr = "#5b6573", Or = "#e6e8ec", kr = "rgba(0, 0, 0, 0.38)", Ar = .08, jr = .34;
|
|
2797
2797
|
function Mr(e) {
|
|
2798
|
-
let t =
|
|
2798
|
+
let t = I(e);
|
|
2799
2799
|
if (!t) return "rgb(38, 42, 48)";
|
|
2800
|
-
let [n, r, i] =
|
|
2801
|
-
return
|
|
2800
|
+
let [n, r, i] = mt(t.r, t.g, t.b);
|
|
2801
|
+
return ht(n, Math.min(r, jr), .22 + i * .18, t.a);
|
|
2802
2802
|
}
|
|
2803
2803
|
function Nr(e) {
|
|
2804
2804
|
return {
|
|
2805
2805
|
...e,
|
|
2806
|
-
fill:
|
|
2806
|
+
fill: F(e.fill, Mr),
|
|
2807
2807
|
stroke: e.stroke ? Er : e.stroke
|
|
2808
2808
|
};
|
|
2809
2809
|
}
|
|
@@ -2868,21 +2868,21 @@ var Fr = { transform(e, t) {
|
|
|
2868
2868
|
}
|
|
2869
2869
|
} }, J = "#5a3a22", Ir = "#43301c", Lr = 120, Rr = 86, zr = 50, Br = 232, Vr = 205, Hr = 158;
|
|
2870
2870
|
function Ur(e) {
|
|
2871
|
-
let t =
|
|
2872
|
-
if (!t) return
|
|
2873
|
-
let n =
|
|
2874
|
-
return
|
|
2871
|
+
let t = I(e);
|
|
2872
|
+
if (!t) return L(Br, Vr, Hr);
|
|
2873
|
+
let n = R(t);
|
|
2874
|
+
return L(Math.round(Lr + (Br - Lr) * n), Math.round(Rr + (Vr - Rr) * n), Math.round(zr + (Hr - zr) * n), t.a);
|
|
2875
2875
|
}
|
|
2876
2876
|
function Wr(e) {
|
|
2877
|
-
let t =
|
|
2877
|
+
let t = I(e);
|
|
2878
2878
|
if (!t || t.a >= 1) return J;
|
|
2879
|
-
let n =
|
|
2880
|
-
return
|
|
2879
|
+
let n = I(J);
|
|
2880
|
+
return L(n.r, n.g, n.b, t.a);
|
|
2881
2881
|
}
|
|
2882
2882
|
function Gr(e) {
|
|
2883
2883
|
return {
|
|
2884
2884
|
...e,
|
|
2885
|
-
fill:
|
|
2885
|
+
fill: F(e.fill, Ur),
|
|
2886
2886
|
stroke: e.stroke ? Wr(e.stroke) : e.stroke
|
|
2887
2887
|
};
|
|
2888
2888
|
}
|
|
@@ -2957,7 +2957,7 @@ function Jr() {
|
|
|
2957
2957
|
type: "polygon",
|
|
2958
2958
|
vertices: qr(u, d, l),
|
|
2959
2959
|
paint: {
|
|
2960
|
-
fill:
|
|
2960
|
+
fill: L(Br, Vr, Hr, .85),
|
|
2961
2961
|
stroke: J,
|
|
2962
2962
|
strokeWidth: s
|
|
2963
2963
|
},
|
|
@@ -2986,14 +2986,14 @@ function Jr() {
|
|
|
2986
2986
|
}
|
|
2987
2987
|
//#endregion
|
|
2988
2988
|
//#region src/style/index.ts
|
|
2989
|
-
var Yr =
|
|
2989
|
+
var Yr = Dt, Xr = zt, Zr = Xt;
|
|
2990
2990
|
function Qr(e) {
|
|
2991
|
-
return
|
|
2991
|
+
return nn(e);
|
|
2992
2992
|
}
|
|
2993
2993
|
function $r(e = {}) {
|
|
2994
|
-
return
|
|
2994
|
+
return cn(e);
|
|
2995
2995
|
}
|
|
2996
|
-
var ei =
|
|
2996
|
+
var ei = xn, ti = Nn;
|
|
2997
2997
|
function ni(e = {}) {
|
|
2998
2998
|
return Fn(e);
|
|
2999
2999
|
}
|
|
@@ -3018,7 +3018,7 @@ var si = Fr, ci = Kr, li = class {
|
|
|
3018
3018
|
return this.backend.events;
|
|
3019
3019
|
}
|
|
3020
3020
|
constructor(e, t, n, r) {
|
|
3021
|
-
this.currentStyle = x, this.state = new
|
|
3021
|
+
this.currentStyle = x, this.state = new Me(e, t ?? je()), this.backend = r ? r(this.state) : new pt(this.state, n);
|
|
3022
3022
|
}
|
|
3023
3023
|
destroy() {
|
|
3024
3024
|
this.backend.destroy();
|
|
@@ -3191,7 +3191,7 @@ function di(e, t) {
|
|
|
3191
3191
|
y: (n + e.y) * i + s,
|
|
3192
3192
|
w: e.width * i,
|
|
3193
3193
|
h: e.height * i,
|
|
3194
|
-
fill:
|
|
3194
|
+
fill: M(e.paint.fill, t, n, i, o, s),
|
|
3195
3195
|
stroke: e.paint.stroke,
|
|
3196
3196
|
sw: (e.paint.strokeWidth ?? 0) * i,
|
|
3197
3197
|
cr: (e.cornerRadius ?? 0) * i,
|
|
@@ -3206,7 +3206,7 @@ function di(e, t) {
|
|
|
3206
3206
|
cx: (t + e.cx) * i + o,
|
|
3207
3207
|
cy: (n + e.cy) * i + s,
|
|
3208
3208
|
r: e.radius * i,
|
|
3209
|
-
fill:
|
|
3209
|
+
fill: M(e.paint.fill, t, n, i, o, s),
|
|
3210
3210
|
stroke: e.paint.stroke,
|
|
3211
3211
|
sw: (e.paint.strokeWidth ?? 0) * i,
|
|
3212
3212
|
dash: pi(e.paint.dash, i, e.paint.dashEnabled)
|
|
@@ -3230,7 +3230,7 @@ function di(e, t) {
|
|
|
3230
3230
|
let a = {
|
|
3231
3231
|
type: "polygon",
|
|
3232
3232
|
vertices: fi(e.vertices, t, n, i, o, s),
|
|
3233
|
-
fill:
|
|
3233
|
+
fill: M(e.paint.fill, t, n, i, o, s),
|
|
3234
3234
|
stroke: e.paint.stroke,
|
|
3235
3235
|
sw: (e.paint.strokeWidth ?? 0) * i
|
|
3236
3236
|
};
|
|
@@ -3470,10 +3470,10 @@ function Ei(e, t, n) {
|
|
|
3470
3470
|
function Di(e, t, n) {
|
|
3471
3471
|
switch (t.type) {
|
|
3472
3472
|
case "rect":
|
|
3473
|
-
e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle =
|
|
3473
|
+
e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
|
|
3474
3474
|
break;
|
|
3475
3475
|
case "circle":
|
|
3476
|
-
e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle =
|
|
3476
|
+
e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
|
|
3477
3477
|
break;
|
|
3478
3478
|
case "line": {
|
|
3479
3479
|
if (t.points.length < 4) break;
|
|
@@ -3487,7 +3487,7 @@ function Di(e, t, n) {
|
|
|
3487
3487
|
if (t.vertices.length < 4) break;
|
|
3488
3488
|
e.beginPath(), e.moveTo(t.vertices[0], t.vertices[1]);
|
|
3489
3489
|
for (let n = 2; n < t.vertices.length; n += 2) e.lineTo(t.vertices[n], t.vertices[n + 1]);
|
|
3490
|
-
e.closePath(), t.fill && (e.fillStyle =
|
|
3490
|
+
e.closePath(), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
|
|
3491
3491
|
break;
|
|
3492
3492
|
case "text": {
|
|
3493
3493
|
let n = t.fontSize * 100, r = `${t.fontStyle} ${n}px ${t.fontFamily}`;
|
|
@@ -3545,16 +3545,28 @@ function Oi(e, t, n = 0) {
|
|
|
3545
3545
|
};
|
|
3546
3546
|
}
|
|
3547
3547
|
//#endregion
|
|
3548
|
+
//#region src/export/exportViewport.ts
|
|
3549
|
+
function ki(e, t) {
|
|
3550
|
+
if (!N(e)) return () => {};
|
|
3551
|
+
let n = e.getViewport();
|
|
3552
|
+
return e.setViewport({
|
|
3553
|
+
minX: t.x,
|
|
3554
|
+
maxX: t.x + t.w,
|
|
3555
|
+
minY: t.y,
|
|
3556
|
+
maxY: t.y + t.h
|
|
3557
|
+
}), () => e.setViewport(n);
|
|
3558
|
+
}
|
|
3559
|
+
//#endregion
|
|
3548
3560
|
//#region src/export/SvgExporter.ts
|
|
3549
|
-
var
|
|
3561
|
+
var Ai = {
|
|
3550
3562
|
scale: 1,
|
|
3551
3563
|
offsetX: 0,
|
|
3552
3564
|
offsetY: 0
|
|
3553
3565
|
};
|
|
3554
|
-
function
|
|
3566
|
+
function ji(e) {
|
|
3555
3567
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3556
3568
|
}
|
|
3557
|
-
var
|
|
3569
|
+
var Mi = class {
|
|
3558
3570
|
constructor(e = {}) {
|
|
3559
3571
|
this.options = e;
|
|
3560
3572
|
}
|
|
@@ -3563,30 +3575,35 @@ var ji = class {
|
|
|
3563
3575
|
if (r === void 0 || i === void 0 || !a) return;
|
|
3564
3576
|
let o = a, s = o.getPlane(i);
|
|
3565
3577
|
if (!s) return;
|
|
3566
|
-
let c = e.settings, l = this.options.padding ?? 3, u = e.computeExportBounds(o, s, this.options.roomId, l), d =
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
},
|
|
3578
|
+
let c = e.settings, l = this.options.padding ?? 3, u = e.computeExportBounds(o, s, this.options.roomId, l), d = T.forMapBounds(u.x, u.x + u.w, u.y, u.y + u.h).getViewportBounds(), f = ki(e.mapReader, u);
|
|
3579
|
+
try {
|
|
3580
|
+
let r = Ie(new w(e.mapReader, c).buildScene(o, s, i, e.lens), d, c, {
|
|
3581
|
+
forward: t.worldToScene ? (e, n) => t.worldToScene(e, n) : void 0,
|
|
3582
|
+
inverse: t.sceneToWorld ? (e, n) => t.sceneToWorld(e, n) : void 0
|
|
3583
|
+
}), a = {
|
|
3584
|
+
scale: 1,
|
|
3585
|
+
roomSize: c.roomSize
|
|
3586
|
+
}, l = (e) => t === x ? e : E(e, t, a), f = Oi(u, t, c.roomSize * .5), p = [];
|
|
3587
|
+
return p.push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${f.x} ${f.y} ${f.w} ${f.h}">`), p.push(`<rect x="${f.x}" y="${f.y}" width="${f.w}" height="${f.h}" fill="${ji(c.backgroundColor)}"/>`), se(r, {
|
|
3588
|
+
state: e,
|
|
3589
|
+
viewportBounds: d,
|
|
3590
|
+
sceneOverlays: n,
|
|
3591
|
+
overlays: this.options.overlays
|
|
3592
|
+
}, (e, t) => {
|
|
3593
|
+
e.length !== 0 && p.push(...xi(di(t ? e : l(e), Ai)));
|
|
3594
|
+
}), p.push("</svg>"), p.join("\n");
|
|
3595
|
+
} finally {
|
|
3596
|
+
f();
|
|
3597
|
+
}
|
|
3598
|
+
}
|
|
3599
|
+
}, Ni = class {
|
|
3583
3600
|
constructor(e = {}) {
|
|
3584
3601
|
this.options = e;
|
|
3585
3602
|
}
|
|
3586
3603
|
render({ backend: e }) {
|
|
3587
3604
|
return e.exportCanvas(this.options)?.toDataURL("image/png");
|
|
3588
3605
|
}
|
|
3589
|
-
},
|
|
3606
|
+
}, Pi = class {
|
|
3590
3607
|
constructor(e = {}) {
|
|
3591
3608
|
this.options = e;
|
|
3592
3609
|
}
|
|
@@ -3603,14 +3620,14 @@ var ji = class {
|
|
|
3603
3620
|
};
|
|
3604
3621
|
//#endregion
|
|
3605
3622
|
//#region src/export/canvasToBytes.ts
|
|
3606
|
-
function
|
|
3623
|
+
function Fi(e, t = "image/png", n) {
|
|
3607
3624
|
let r = e.toDataURL(t, n), i = r.indexOf(","), a = i >= 0 ? r.slice(i + 1) : r, o = atob(a), s = new Uint8Array(o.length);
|
|
3608
3625
|
for (let e = 0; e < o.length; e++) s[e] = o.charCodeAt(e);
|
|
3609
3626
|
return s;
|
|
3610
3627
|
}
|
|
3611
3628
|
//#endregion
|
|
3612
3629
|
//#region src/export/CanvasExporter.ts
|
|
3613
|
-
var
|
|
3630
|
+
var Ii = class {
|
|
3614
3631
|
constructor(e) {
|
|
3615
3632
|
this.options = e;
|
|
3616
3633
|
}
|
|
@@ -3623,67 +3640,72 @@ var Fi = class {
|
|
|
3623
3640
|
scale: m,
|
|
3624
3641
|
offsetX: _,
|
|
3625
3642
|
offsetY: v
|
|
3626
|
-
}, b =
|
|
3643
|
+
}, b = T.forRenderCamera(l, u, m, _, v), S = {
|
|
3627
3644
|
forward: t.worldToScene ? (e, n) => t.worldToScene(e, n) : void 0,
|
|
3628
3645
|
inverse: t.sceneToWorld ? (e, n) => t.sceneToWorld(e, n) : void 0
|
|
3629
|
-
}, C =
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
},
|
|
3646
|
+
}, C = ki(e.mapReader, f);
|
|
3647
|
+
try {
|
|
3648
|
+
let r = Ie(new w(e.mapReader, c).buildScene(o, s, i, e.lens), b.getViewportBounds(), c, S), a = D.Util.createCanvasElement();
|
|
3649
|
+
a.width = l, a.height = u;
|
|
3650
|
+
let d = a.getContext("2d");
|
|
3651
|
+
if (!d) return;
|
|
3652
|
+
d.fillStyle = c.backgroundColor, d.fillRect(0, 0, l, u);
|
|
3653
|
+
let p = {
|
|
3654
|
+
scale: m,
|
|
3655
|
+
roomSize: c.roomSize
|
|
3656
|
+
}, h = (e) => t === x ? e : E(e, t, p);
|
|
3657
|
+
return se(r, {
|
|
3658
|
+
state: e,
|
|
3659
|
+
viewportBounds: T.forMapBounds(f.x, f.x + f.w, f.y, f.y + f.h).getViewportBounds(),
|
|
3660
|
+
sceneOverlays: n,
|
|
3661
|
+
overlays: this.options.overlays
|
|
3662
|
+
}, (e, t) => {
|
|
3663
|
+
e.length !== 0 && Ti(d, di(t ? e : h(e), y));
|
|
3664
|
+
}), a;
|
|
3665
|
+
} finally {
|
|
3666
|
+
C();
|
|
3667
|
+
}
|
|
3668
|
+
}
|
|
3669
|
+
}, Li = class {
|
|
3648
3670
|
constructor(e) {
|
|
3649
|
-
this.options = e, this.canvasExporter = new
|
|
3671
|
+
this.options = e, this.canvasExporter = new Ii(e);
|
|
3650
3672
|
}
|
|
3651
3673
|
render(e) {
|
|
3652
3674
|
let t = this.canvasExporter.render(e);
|
|
3653
|
-
if (t) return
|
|
3675
|
+
if (t) return Fi(t, this.options.mimeType, this.options.quality);
|
|
3654
3676
|
}
|
|
3655
|
-
}, Z,
|
|
3656
|
-
function
|
|
3677
|
+
}, Z, Ri, zi = 256;
|
|
3678
|
+
function Bi(e, t, n) {
|
|
3657
3679
|
let r = `${e.toFixed(2)}:${t}:${n.toFixed(3)}`;
|
|
3658
|
-
if (
|
|
3659
|
-
let i =
|
|
3680
|
+
if (Ri === r && Z) return Z;
|
|
3681
|
+
let i = zi, a = i / 2, o = document.createElement("canvas");
|
|
3660
3682
|
o.width = i, o.height = i;
|
|
3661
3683
|
let s = o.getContext("2d");
|
|
3662
3684
|
s.fillStyle = `rgba(0, 0, 0, ${e})`, s.fillRect(0, 0, i, i), s.globalCompositeOperation = "destination-out";
|
|
3663
3685
|
let c = s.createRadialGradient(a, a, 0, a, a, a), l = Math.min(n, .99);
|
|
3664
3686
|
c.addColorStop(0, "rgba(0, 0, 0, 1)"), c.addColorStop(l * .25, "rgba(0, 0, 0, 0.97)"), c.addColorStop(l * .5, "rgba(0, 0, 0, 0.82)"), c.addColorStop(l * .7, "rgba(0, 0, 0, 0.50)"), c.addColorStop(l * .85, "rgba(0, 0, 0, 0.22)"), c.addColorStop(l * .95, "rgba(0, 0, 0, 0.06)"), c.addColorStop(l, "rgba(0, 0, 0, 0)"), l < .98 && c.addColorStop(1, "rgba(0, 0, 0, 0)"), s.fillStyle = c, s.beginPath(), s.arc(a, a, a, 0, Math.PI * 2), s.fill(), s.globalCompositeOperation = "source-over";
|
|
3665
3687
|
let u = parseInt(t.slice(1, 3), 16), d = parseInt(t.slice(3, 5), 16), f = parseInt(t.slice(5, 7), 16), p = s.createRadialGradient(a, a, 0, a, a, a * l);
|
|
3666
|
-
return p.addColorStop(0, `rgba(${u}, ${d}, ${f}, 0.05)`), p.addColorStop(1, `rgba(${u}, ${d}, ${f}, 0)`), s.fillStyle = p, s.fillRect(0, 0, i, i), Z = o.toDataURL(),
|
|
3688
|
+
return p.addColorStop(0, `rgba(${u}, ${d}, ${f}, 0.05)`), p.addColorStop(1, `rgba(${u}, ${d}, ${f}, 0)`), s.fillStyle = p, s.fillRect(0, 0, i, i), Z = o.toDataURL(), Ri = r, Z;
|
|
3667
3689
|
}
|
|
3668
|
-
function
|
|
3690
|
+
function Vi(e, t, n, r) {
|
|
3669
3691
|
let { radius: i, intensity: a, color: o } = r, s = n.maxX - n.minX, c = n.maxY - n.minY, l = Math.sqrt(s * s + c * c), u = Math.max(l * 2.5, i * 4);
|
|
3670
3692
|
return {
|
|
3671
3693
|
cx: e,
|
|
3672
3694
|
cy: t,
|
|
3673
3695
|
displaySize: u,
|
|
3674
|
-
src:
|
|
3696
|
+
src: Bi(a, o, Math.round(i / (u / 2) * 50) / 50)
|
|
3675
3697
|
};
|
|
3676
3698
|
}
|
|
3677
3699
|
//#endregion
|
|
3678
3700
|
//#region src/overlay/AmbientLightOverlay.ts
|
|
3679
|
-
var
|
|
3701
|
+
var Hi = {
|
|
3680
3702
|
color: "#ffcc44",
|
|
3681
3703
|
radius: 12,
|
|
3682
3704
|
intensity: .7
|
|
3683
|
-
},
|
|
3705
|
+
}, Ui = class {
|
|
3684
3706
|
constructor(e) {
|
|
3685
3707
|
this.onPosition = () => this.ctx?.invalidate(), this.params = {
|
|
3686
|
-
...
|
|
3708
|
+
...Hi,
|
|
3687
3709
|
...e
|
|
3688
3710
|
};
|
|
3689
3711
|
}
|
|
@@ -3706,7 +3728,7 @@ var Vi = {
|
|
|
3706
3728
|
if (e.positionRoomId === void 0) return;
|
|
3707
3729
|
let n = e.mapReader.getRoom(e.positionRoomId);
|
|
3708
3730
|
if (!n) return;
|
|
3709
|
-
let r =
|
|
3731
|
+
let r = Vi(n.x, n.y, t, this.params);
|
|
3710
3732
|
return {
|
|
3711
3733
|
type: "image",
|
|
3712
3734
|
x: r.cx - r.displaySize / 2,
|
|
@@ -3717,7 +3739,7 @@ var Vi = {
|
|
|
3717
3739
|
layer: "overlay"
|
|
3718
3740
|
};
|
|
3719
3741
|
}
|
|
3720
|
-
},
|
|
3742
|
+
}, Wi = () => typeof performance < "u" ? performance.now() : Date.now(), Gi = typeof requestAnimationFrame < "u" ? requestAnimationFrame : (e) => setTimeout(() => e(Wi()), 16), Ki = typeof cancelAnimationFrame < "u" ? cancelAnimationFrame : (e) => clearTimeout(e), qi = class {
|
|
3721
3743
|
constructor(e, t, n = {}) {
|
|
3722
3744
|
this.worldX = e, this.worldY = t, this.cancelled = !1, this.transform = (e, t) => ({
|
|
3723
3745
|
x: e,
|
|
@@ -3726,7 +3748,7 @@ var Vi = {
|
|
|
3726
3748
|
}
|
|
3727
3749
|
attach(e) {
|
|
3728
3750
|
let t = this.transform(this.worldX, this.worldY);
|
|
3729
|
-
this.ring = new
|
|
3751
|
+
this.ring = new D.Circle({
|
|
3730
3752
|
x: t.x,
|
|
3731
3753
|
y: t.y,
|
|
3732
3754
|
radius: this.startRadius,
|
|
@@ -3741,12 +3763,12 @@ var Vi = {
|
|
|
3741
3763
|
n(1), this.onComplete?.();
|
|
3742
3764
|
return;
|
|
3743
3765
|
}
|
|
3744
|
-
let r =
|
|
3766
|
+
let r = Wi(), i = (e) => {
|
|
3745
3767
|
if (this.cancelled) return;
|
|
3746
3768
|
let t = Math.min((e - r) / this.duration, 1);
|
|
3747
|
-
n(t), t < 1 ? this.rafId =
|
|
3769
|
+
n(t), t < 1 ? this.rafId = Gi(i) : (this.rafId = void 0, this.onComplete?.());
|
|
3748
3770
|
};
|
|
3749
|
-
this.rafId =
|
|
3771
|
+
this.rafId = Gi(i);
|
|
3750
3772
|
}
|
|
3751
3773
|
updateViewport(e, t, n) {
|
|
3752
3774
|
if (this.transform = n, this.ring) {
|
|
@@ -3758,9 +3780,9 @@ var Vi = {
|
|
|
3758
3780
|
}
|
|
3759
3781
|
}
|
|
3760
3782
|
destroy() {
|
|
3761
|
-
this.cancelled = !0, this.rafId !== void 0 && (
|
|
3783
|
+
this.cancelled = !0, this.rafId !== void 0 && (Ki(this.rafId), this.rafId = void 0), this.ring?.destroy(), this.ring = void 0;
|
|
3762
3784
|
}
|
|
3763
|
-
},
|
|
3785
|
+
}, Ji = {
|
|
3764
3786
|
n: {
|
|
3765
3787
|
x: 0,
|
|
3766
3788
|
y: -1
|
|
@@ -3793,7 +3815,7 @@ var Vi = {
|
|
|
3793
3815
|
x: -Math.SQRT1_2,
|
|
3794
3816
|
y: Math.SQRT1_2
|
|
3795
3817
|
}
|
|
3796
|
-
},
|
|
3818
|
+
}, Yi = [
|
|
3797
3819
|
"n",
|
|
3798
3820
|
"s",
|
|
3799
3821
|
"e",
|
|
@@ -3802,22 +3824,22 @@ var Vi = {
|
|
|
3802
3824
|
"nw",
|
|
3803
3825
|
"se",
|
|
3804
3826
|
"sw"
|
|
3805
|
-
],
|
|
3827
|
+
], Xi = new Set([
|
|
3806
3828
|
"ne",
|
|
3807
3829
|
"nw",
|
|
3808
3830
|
"se",
|
|
3809
3831
|
"sw"
|
|
3810
|
-
]),
|
|
3832
|
+
]), Zi = {
|
|
3811
3833
|
clear: 10,
|
|
3812
3834
|
diagonal: .3,
|
|
3813
3835
|
preferred: 1,
|
|
3814
3836
|
distance: .05
|
|
3815
|
-
},
|
|
3837
|
+
}, Qi = [
|
|
3816
3838
|
"n",
|
|
3817
3839
|
"s",
|
|
3818
3840
|
"e",
|
|
3819
3841
|
"w"
|
|
3820
|
-
],
|
|
3842
|
+
], $i = [
|
|
3821
3843
|
"n",
|
|
3822
3844
|
"s",
|
|
3823
3845
|
"e",
|
|
@@ -3827,16 +3849,16 @@ var Vi = {
|
|
|
3827
3849
|
"se",
|
|
3828
3850
|
"sw"
|
|
3829
3851
|
];
|
|
3830
|
-
function
|
|
3852
|
+
function ea(e, t) {
|
|
3831
3853
|
return Math.max(0, Math.min(e.x + e.width, t.x + t.width) - Math.max(e.x, t.x)) * Math.max(0, Math.min(e.y + e.height, t.y + t.height) - Math.max(e.y, t.y));
|
|
3832
3854
|
}
|
|
3833
|
-
function
|
|
3855
|
+
function ta(e, t) {
|
|
3834
3856
|
let n = Math.max(e.x - (t.x + t.width), t.x - (e.x + e.width), 0), r = Math.max(e.y - (t.y + t.height), t.y - (e.y + e.height), 0);
|
|
3835
3857
|
return Math.hypot(n, r);
|
|
3836
3858
|
}
|
|
3837
3859
|
function Q(e, t, n) {
|
|
3838
|
-
let r =
|
|
3839
|
-
if (
|
|
3860
|
+
let r = Ji[t];
|
|
3861
|
+
if (Xi.has(t)) {
|
|
3840
3862
|
let t = e.x + r.x * n, i = e.y + r.y * n;
|
|
3841
3863
|
return {
|
|
3842
3864
|
x: r.x < 0 ? t - e.width : t,
|
|
@@ -3853,9 +3875,9 @@ function Q(e, t, n) {
|
|
|
3853
3875
|
height: e.height
|
|
3854
3876
|
};
|
|
3855
3877
|
}
|
|
3856
|
-
function
|
|
3857
|
-
let r = n.offset ?? .6, i = n.slots === 4 ?
|
|
3858
|
-
...
|
|
3878
|
+
function na(e, t, n = {}) {
|
|
3879
|
+
let r = n.offset ?? .6, i = n.slots === 4 ? Qi : Yi, a = {
|
|
3880
|
+
...Zi,
|
|
3859
3881
|
...n.weights
|
|
3860
3882
|
}, o = [], s = [];
|
|
3861
3883
|
for (let c of e) {
|
|
@@ -3865,11 +3887,11 @@ function ta(e, t, n = {}) {
|
|
|
3865
3887
|
for (let n = r; n <= r + e + 1e-9; n += u) {
|
|
3866
3888
|
let e = Q(c, t, n), r = !1, o = Infinity;
|
|
3867
3889
|
for (let t of p) {
|
|
3868
|
-
if (t.kind !== "exit" &&
|
|
3890
|
+
if (t.kind !== "exit" && ea(e, t) > 0) {
|
|
3869
3891
|
r = !0;
|
|
3870
3892
|
break;
|
|
3871
3893
|
}
|
|
3872
|
-
let n =
|
|
3894
|
+
let n = ta(e, t);
|
|
3873
3895
|
n < o && (o = n);
|
|
3874
3896
|
}
|
|
3875
3897
|
if (r) {
|
|
@@ -3896,7 +3918,7 @@ function ta(e, t, n = {}) {
|
|
|
3896
3918
|
continue;
|
|
3897
3919
|
}
|
|
3898
3920
|
let o = 0;
|
|
3899
|
-
c.preferred ? t === c.preferred && (o -= a.preferred) :
|
|
3921
|
+
c.preferred ? t === c.preferred && (o -= a.preferred) : Xi.has(t) && (o += a.diagonal);
|
|
3900
3922
|
let s = -i.value * a.clear + o;
|
|
3901
3923
|
n.onScored && h.push({
|
|
3902
3924
|
dir: t,
|
|
@@ -3919,9 +3941,9 @@ function ta(e, t, n = {}) {
|
|
|
3919
3941
|
off: r,
|
|
3920
3942
|
cost: 0,
|
|
3921
3943
|
clearance: 0
|
|
3922
|
-
}, m.clearance < (n.minClearance ?? 0)) for (let e of
|
|
3944
|
+
}, m.clearance < (n.minClearance ?? 0)) for (let e of $i) {
|
|
3923
3945
|
let t = Q(c, e, r);
|
|
3924
|
-
if (!p.some((e) => e.kind !== "exit" &&
|
|
3946
|
+
if (!p.some((e) => e.kind !== "exit" && ea(t, e) > 0)) {
|
|
3925
3947
|
m = {
|
|
3926
3948
|
box: t,
|
|
3927
3949
|
dir: e,
|
|
@@ -3933,7 +3955,7 @@ function ta(e, t, n = {}) {
|
|
|
3933
3955
|
}
|
|
3934
3956
|
}
|
|
3935
3957
|
n.onScored?.(c, h, m.dir);
|
|
3936
|
-
let g =
|
|
3958
|
+
let g = Ji[m.dir];
|
|
3937
3959
|
s.push({
|
|
3938
3960
|
id: c.id,
|
|
3939
3961
|
x: m.box.x,
|
|
@@ -3954,7 +3976,7 @@ function ta(e, t, n = {}) {
|
|
|
3954
3976
|
}
|
|
3955
3977
|
//#endregion
|
|
3956
3978
|
//#region src/overlay/WaypointOverlay.ts
|
|
3957
|
-
var
|
|
3979
|
+
var ra = class {
|
|
3958
3980
|
constructor() {
|
|
3959
3981
|
this.waypoints = [], this.placed = [];
|
|
3960
3982
|
}
|
|
@@ -4026,7 +4048,7 @@ var na = class {
|
|
|
4026
4048
|
});
|
|
4027
4049
|
}
|
|
4028
4050
|
if (f.length === 0) return [];
|
|
4029
|
-
let m = "rgba(20, 20, 24, 0.82)", h =
|
|
4051
|
+
let m = "rgba(20, 20, 24, 0.82)", h = na(f, u, {
|
|
4030
4052
|
offset: a * .7,
|
|
4031
4053
|
extend: a * 4,
|
|
4032
4054
|
clearCap: a * 1.5,
|
|
@@ -4084,11 +4106,11 @@ var na = class {
|
|
|
4084
4106
|
width: n.width,
|
|
4085
4107
|
height: n.height
|
|
4086
4108
|
});
|
|
4087
|
-
let C = p[t].lines,
|
|
4109
|
+
let C = p[t].lines, ee = (n.height - C.length * c) / 2;
|
|
4088
4110
|
for (let t = 0; t < C.length; t++) g.push({
|
|
4089
4111
|
type: "text",
|
|
4090
4112
|
x: n.x,
|
|
4091
|
-
y: n.y +
|
|
4113
|
+
y: n.y + ee + t * c,
|
|
4092
4114
|
width: n.width,
|
|
4093
4115
|
height: c,
|
|
4094
4116
|
text: C[t],
|
|
@@ -4102,7 +4124,7 @@ var na = class {
|
|
|
4102
4124
|
}
|
|
4103
4125
|
return g;
|
|
4104
4126
|
}
|
|
4105
|
-
},
|
|
4127
|
+
}, ia = /* @__PURE__ */ O(((e, t) => {
|
|
4106
4128
|
t.exports = class {
|
|
4107
4129
|
constructor() {
|
|
4108
4130
|
this.keys = /* @__PURE__ */ new Set(), this.queue = [];
|
|
@@ -4132,14 +4154,14 @@ var na = class {
|
|
|
4132
4154
|
return this.queue.find((t) => t.key === e);
|
|
4133
4155
|
}
|
|
4134
4156
|
};
|
|
4135
|
-
})),
|
|
4157
|
+
})), aa = /* @__PURE__ */ O(((e, t) => {
|
|
4136
4158
|
function n(e, t) {
|
|
4137
4159
|
let r = /* @__PURE__ */ new Map();
|
|
4138
4160
|
for (let [i, a] of e) i !== t && a instanceof Map ? r.set(i, n(a, t)) : i !== t && r.set(i, a);
|
|
4139
4161
|
return r;
|
|
4140
4162
|
}
|
|
4141
4163
|
t.exports = n;
|
|
4142
|
-
})),
|
|
4164
|
+
})), oa = /* @__PURE__ */ O(((e, t) => {
|
|
4143
4165
|
function n(e) {
|
|
4144
4166
|
let t = Number(e);
|
|
4145
4167
|
return !(isNaN(t) || t <= 0);
|
|
@@ -4154,7 +4176,7 @@ var na = class {
|
|
|
4154
4176
|
}), t;
|
|
4155
4177
|
}
|
|
4156
4178
|
t.exports = r;
|
|
4157
|
-
})),
|
|
4179
|
+
})), sa = /* @__PURE__ */ O(((e, t) => {
|
|
4158
4180
|
function n(e) {
|
|
4159
4181
|
if (!(e instanceof Map)) throw Error(`Invalid graph: Expected Map instead found ${typeof e}`);
|
|
4160
4182
|
e.forEach((e, t) => {
|
|
@@ -4166,8 +4188,8 @@ var na = class {
|
|
|
4166
4188
|
});
|
|
4167
4189
|
}
|
|
4168
4190
|
t.exports = n;
|
|
4169
|
-
})),
|
|
4170
|
-
var n =
|
|
4191
|
+
})), ca = /* @__PURE__ */ De((/* @__PURE__ */ O(((e, t) => {
|
|
4192
|
+
var n = ia(), r = aa(), i = oa(), a = sa();
|
|
4171
4193
|
t.exports = class {
|
|
4172
4194
|
constructor(e) {
|
|
4173
4195
|
e instanceof Map ? (a(e), this.graph = e) : e ? this.graph = i(e) : this.graph = /* @__PURE__ */ new Map();
|
|
@@ -4217,7 +4239,7 @@ var na = class {
|
|
|
4217
4239
|
return this.path(...e);
|
|
4218
4240
|
}
|
|
4219
4241
|
};
|
|
4220
|
-
})))(), 1),
|
|
4242
|
+
})))(), 1), la = {
|
|
4221
4243
|
1: "north",
|
|
4222
4244
|
2: "northeast",
|
|
4223
4245
|
3: "northwest",
|
|
@@ -4230,7 +4252,7 @@ var na = class {
|
|
|
4230
4252
|
10: "down",
|
|
4231
4253
|
11: "in",
|
|
4232
4254
|
12: "out"
|
|
4233
|
-
},
|
|
4255
|
+
}, ua = {
|
|
4234
4256
|
north: "n",
|
|
4235
4257
|
northeast: "ne",
|
|
4236
4258
|
northwest: "nw",
|
|
@@ -4243,7 +4265,7 @@ var na = class {
|
|
|
4243
4265
|
down: "down",
|
|
4244
4266
|
in: "in",
|
|
4245
4267
|
out: "out"
|
|
4246
|
-
},
|
|
4268
|
+
}, da = class {
|
|
4247
4269
|
constructor(e) {
|
|
4248
4270
|
this.mapReader = e, this.data = this.buildGraph();
|
|
4249
4271
|
}
|
|
@@ -4269,12 +4291,12 @@ var na = class {
|
|
|
4269
4291
|
buildGraph() {
|
|
4270
4292
|
let e = /* @__PURE__ */ new Map(), t = {}, n = 1, r = Infinity;
|
|
4271
4293
|
return this.mapReader.getRooms().forEach((i) => {
|
|
4272
|
-
let a = [], o = {}, s = new Set((i.exitLocks ?? []).map((e) =>
|
|
4294
|
+
let a = [], o = {}, s = new Set((i.exitLocks ?? []).map((e) => la[e]).filter((e) => !!e)), c = new Set(i.mSpecialExitLocks ?? []);
|
|
4273
4295
|
Object.entries(i.exits ?? {}).forEach(([e, t]) => {
|
|
4274
4296
|
if (s.has(e)) return;
|
|
4275
4297
|
let c = this.mapReader.getRoom(t);
|
|
4276
4298
|
if (c) {
|
|
4277
|
-
let s =
|
|
4299
|
+
let s = ua[e] ?? e, l = this.resolveEdgeWeight(i, s, c);
|
|
4278
4300
|
a.push({
|
|
4279
4301
|
id: t,
|
|
4280
4302
|
weight: l
|
|
@@ -4305,7 +4327,7 @@ var na = class {
|
|
|
4305
4327
|
};
|
|
4306
4328
|
//#endregion
|
|
4307
4329
|
//#region src/PathFinder.ts
|
|
4308
|
-
function
|
|
4330
|
+
function fa(e, t) {
|
|
4309
4331
|
e.push(t);
|
|
4310
4332
|
let n = e.length - 1;
|
|
4311
4333
|
for (; n > 0;) {
|
|
@@ -4314,7 +4336,7 @@ function da(e, t) {
|
|
|
4314
4336
|
[e[t], e[n]] = [e[n], e[t]], n = t;
|
|
4315
4337
|
}
|
|
4316
4338
|
}
|
|
4317
|
-
function
|
|
4339
|
+
function pa(e) {
|
|
4318
4340
|
if (e.length === 0) return;
|
|
4319
4341
|
let t = e[0], n = e.pop();
|
|
4320
4342
|
if (e.length > 0) {
|
|
@@ -4328,16 +4350,16 @@ function fa(e) {
|
|
|
4328
4350
|
}
|
|
4329
4351
|
return t;
|
|
4330
4352
|
}
|
|
4331
|
-
function
|
|
4353
|
+
function ma(e, t, n) {
|
|
4332
4354
|
let r = [n], i = n;
|
|
4333
4355
|
for (; i !== t;) i = e.get(i), r.push(i);
|
|
4334
4356
|
return r.reverse(), r;
|
|
4335
4357
|
}
|
|
4336
|
-
function
|
|
4358
|
+
function ha(e, t, n) {
|
|
4337
4359
|
let r = e.path(t.toString(), n.toString()), i = Array.isArray(r) ? r : r?.path;
|
|
4338
4360
|
return i ? i.map((e) => Number(e)) : null;
|
|
4339
4361
|
}
|
|
4340
|
-
function
|
|
4362
|
+
function ga(e, t, n, r) {
|
|
4341
4363
|
let i = r.getRoom(n);
|
|
4342
4364
|
if (!i) return null;
|
|
4343
4365
|
let a = i.x, o = i.y, s = i.z, c = r.getMaxEdgeDistance(), l = r.getMinEdgeWeight(), u = (e) => {
|
|
@@ -4346,16 +4368,16 @@ function ha(e, t, n, r) {
|
|
|
4346
4368
|
let n = t.x - a, i = t.y - o, u = t.z - s;
|
|
4347
4369
|
return Math.sqrt(n * n + i * i + u * u) / c * l;
|
|
4348
4370
|
}, d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), p = [];
|
|
4349
|
-
for (d.set(t, 0),
|
|
4371
|
+
for (d.set(t, 0), fa(p, {
|
|
4350
4372
|
id: t,
|
|
4351
4373
|
priority: u(t)
|
|
4352
4374
|
}); p.length > 0;) {
|
|
4353
|
-
let { id: r } =
|
|
4354
|
-
if (r === n) return
|
|
4375
|
+
let { id: r } = pa(p);
|
|
4376
|
+
if (r === n) return ma(f, t, n);
|
|
4355
4377
|
let i = d.get(r) ?? Infinity, a = e.get(r);
|
|
4356
4378
|
if (a) for (let e of a) {
|
|
4357
4379
|
let t = i + e.weight;
|
|
4358
|
-
t < (d.get(e.id) ?? Infinity) && (d.set(e.id, t), f.set(e.id, r),
|
|
4380
|
+
t < (d.get(e.id) ?? Infinity) && (d.set(e.id, t), f.set(e.id, r), fa(p, {
|
|
4359
4381
|
id: e.id,
|
|
4360
4382
|
priority: t + u(e.id)
|
|
4361
4383
|
}));
|
|
@@ -4363,9 +4385,9 @@ function ha(e, t, n, r) {
|
|
|
4363
4385
|
}
|
|
4364
4386
|
return null;
|
|
4365
4387
|
}
|
|
4366
|
-
var
|
|
4388
|
+
var _a = class {
|
|
4367
4389
|
constructor(e, t = "dijkstra") {
|
|
4368
|
-
this.cache = /* @__PURE__ */ new Map(), this._algorithm = t, this.mapGraph = new
|
|
4390
|
+
this.cache = /* @__PURE__ */ new Map(), this._algorithm = t, this.mapGraph = new da(e), this.dijkstraGraph = new ca.default(this.mapGraph.getGraphDefinition());
|
|
4369
4391
|
}
|
|
4370
4392
|
get algorithm() {
|
|
4371
4393
|
return this._algorithm;
|
|
@@ -4384,23 +4406,31 @@ var ga = class {
|
|
|
4384
4406
|
let r;
|
|
4385
4407
|
switch (this._algorithm) {
|
|
4386
4408
|
case "dijkstra":
|
|
4387
|
-
r =
|
|
4409
|
+
r = ha(this.dijkstraGraph, e, t);
|
|
4388
4410
|
break;
|
|
4389
4411
|
case "astar":
|
|
4390
|
-
r =
|
|
4412
|
+
r = ga(this.mapGraph.getAdj(), e, t, this.mapGraph);
|
|
4391
4413
|
break;
|
|
4392
4414
|
}
|
|
4393
4415
|
return this.cache.set(n, r), r;
|
|
4394
4416
|
}
|
|
4395
|
-
}
|
|
4417
|
+
};
|
|
4418
|
+
//#endregion
|
|
4419
|
+
//#region src/reader/HashLookup.ts
|
|
4420
|
+
function va(e) {
|
|
4421
|
+
return !!e && e.hashLookupCapable === !0;
|
|
4422
|
+
}
|
|
4423
|
+
//#endregion
|
|
4424
|
+
//#region src/lens/composeLenses.ts
|
|
4425
|
+
var $ = {
|
|
4396
4426
|
hidden: 2,
|
|
4397
4427
|
stub: 1,
|
|
4398
4428
|
full: 0
|
|
4399
4429
|
};
|
|
4400
|
-
function
|
|
4430
|
+
function ya(e, t, n) {
|
|
4401
4431
|
return n === "first" ? e : n === "least-restrictive" ? $[e] < $[t] ? e : t : $[e] > $[t] ? e : t;
|
|
4402
4432
|
}
|
|
4403
|
-
function
|
|
4433
|
+
function ba(e, ...t) {
|
|
4404
4434
|
let n = {}, r;
|
|
4405
4435
|
e && typeof e.isVisible == "function" ? r = [e, ...t] : (n = e ?? {}, r = t);
|
|
4406
4436
|
let i = n.exitStrategy ?? "most-restrictive", a = n.visibility ?? "and";
|
|
@@ -4416,7 +4446,7 @@ function va(e, ...t) {
|
|
|
4416
4446
|
for (let o of r) {
|
|
4417
4447
|
let r = o.getExitTreatment ? o.getExitTreatment(e, t, n) : d(o, e, t, n);
|
|
4418
4448
|
if (a === void 0) a = r;
|
|
4419
|
-
else if (a =
|
|
4449
|
+
else if (a = ya(a, r, i), i === "first") break;
|
|
4420
4450
|
}
|
|
4421
4451
|
return a ?? "full";
|
|
4422
4452
|
},
|
|
@@ -4429,7 +4459,7 @@ function va(e, ...t) {
|
|
|
4429
4459
|
}
|
|
4430
4460
|
//#endregion
|
|
4431
4461
|
//#region src/lens/ExplorationLens.ts
|
|
4432
|
-
var
|
|
4462
|
+
var xa = class {
|
|
4433
4463
|
constructor(e) {
|
|
4434
4464
|
this.version = 0, this.visited = e instanceof Set ? new Set(e) : new Set(e ?? []);
|
|
4435
4465
|
}
|
|
@@ -4464,7 +4494,7 @@ var ya = class {
|
|
|
4464
4494
|
clear() {
|
|
4465
4495
|
this.visited.size !== 0 && (this.visited.clear(), this.version++);
|
|
4466
4496
|
}
|
|
4467
|
-
},
|
|
4497
|
+
}, Sa = {
|
|
4468
4498
|
1: "north",
|
|
4469
4499
|
2: "northeast",
|
|
4470
4500
|
3: "northwest",
|
|
@@ -4478,7 +4508,7 @@ var ya = class {
|
|
|
4478
4508
|
11: "in",
|
|
4479
4509
|
12: "out"
|
|
4480
4510
|
};
|
|
4481
|
-
function
|
|
4511
|
+
function Ca() {
|
|
4482
4512
|
return {
|
|
4483
4513
|
areaWidth: 150,
|
|
4484
4514
|
areaHeight: 80,
|
|
@@ -4492,14 +4522,14 @@ function xa() {
|
|
|
4492
4522
|
highlightColor: "#ff9900"
|
|
4493
4523
|
};
|
|
4494
4524
|
}
|
|
4495
|
-
var
|
|
4525
|
+
var wa = class {
|
|
4496
4526
|
constructor(e, t, n) {
|
|
4497
|
-
this.areaNodes = /* @__PURE__ */ new Map(), this.connectionGroups = [], this.currentZoom = 1, this.domainInfo = /* @__PURE__ */ new Map(), this.domainFilter = "all", this.dotsMode = !1, this.settings = n ??
|
|
4527
|
+
this.areaNodes = /* @__PURE__ */ new Map(), this.connectionGroups = [], this.currentZoom = 1, this.domainInfo = /* @__PURE__ */ new Map(), this.domainFilter = "all", this.dotsMode = !1, this.settings = n ?? Ca(), this.stage = new D.Stage({
|
|
4498
4528
|
container: e,
|
|
4499
4529
|
width: e.clientWidth,
|
|
4500
4530
|
height: e.clientHeight,
|
|
4501
4531
|
draggable: !0
|
|
4502
|
-
}), this.backgroundLayer = new
|
|
4532
|
+
}), this.backgroundLayer = new D.Layer({ listening: !1 }), this.stage.add(this.backgroundLayer), this.connectionLayer = new D.Layer({ listening: !1 }), this.stage.add(this.connectionLayer), this.areaLayer = new D.Layer(), this.stage.add(this.areaLayer), this.mapReader = t, this.initScaling(), this.initResize(e);
|
|
4503
4533
|
}
|
|
4504
4534
|
initResize(e) {
|
|
4505
4535
|
new ResizeObserver(() => {
|
|
@@ -4591,7 +4621,7 @@ var Sa = class {
|
|
|
4591
4621
|
if (this.backgroundLayer.destroyChildren(), !this.backgroundConfig) return;
|
|
4592
4622
|
let e = new Image();
|
|
4593
4623
|
e.crossOrigin = "anonymous", e.onload = () => {
|
|
4594
|
-
this.backgroundImage = new
|
|
4624
|
+
this.backgroundImage = new D.Image({
|
|
4595
4625
|
x: this.backgroundConfig.x,
|
|
4596
4626
|
y: this.backgroundConfig.y,
|
|
4597
4627
|
image: e,
|
|
@@ -4684,7 +4714,7 @@ var Sa = class {
|
|
|
4684
4714
|
}
|
|
4685
4715
|
}
|
|
4686
4716
|
getLockedDirections(e) {
|
|
4687
|
-
return new Set((e.exitLocks ?? []).map((e) =>
|
|
4717
|
+
return new Set((e.exitLocks ?? []).map((e) => Sa[e]).filter((e) => !!e));
|
|
4688
4718
|
}
|
|
4689
4719
|
createConnection(e, t, n) {
|
|
4690
4720
|
let r = this.toPlanarDirection(n);
|
|
@@ -5146,7 +5176,7 @@ var Sa = class {
|
|
|
5146
5176
|
y: n.y + n.height / 2
|
|
5147
5177
|
}, a, o;
|
|
5148
5178
|
if (this.dotsMode ? (a = r, o = i) : (a = this.getEdgePoint(t, i), o = this.getEdgePoint(n, r)), !isFinite(a.x) || !isFinite(a.y) || !isFinite(o.x) || !isFinite(o.y)) continue;
|
|
5149
|
-
let s = this.dotsMode ? "#ffffff" : this.settings.connectionColor, c = this.dotsMode ? 1 : Math.min(this.settings.connectionLineWidth, 1 + e.connections.length * .5), l = new
|
|
5179
|
+
let s = this.dotsMode ? "#ffffff" : this.settings.connectionColor, c = this.dotsMode ? 1 : Math.min(this.settings.connectionLineWidth, 1 + e.connections.length * .5), l = new D.Line({
|
|
5150
5180
|
points: [
|
|
5151
5181
|
a.x,
|
|
5152
5182
|
a.y,
|
|
@@ -5179,16 +5209,16 @@ var Sa = class {
|
|
|
5179
5209
|
if (!isFinite(e.x) || !isFinite(e.y)) continue;
|
|
5180
5210
|
let t = e.areaId === this.highlightedArea;
|
|
5181
5211
|
if (this.dotsMode) {
|
|
5182
|
-
let n = e.x + e.width / 2, r = e.y + e.height / 2, i = new
|
|
5212
|
+
let n = e.x + e.width / 2, r = e.y + e.height / 2, i = new D.Group({
|
|
5183
5213
|
x: n,
|
|
5184
5214
|
y: r,
|
|
5185
5215
|
draggable: !0
|
|
5186
|
-
}), a = new
|
|
5216
|
+
}), a = new D.Circle({
|
|
5187
5217
|
radius: 6,
|
|
5188
5218
|
fill: t ? this.settings.highlightColor : "#ffffff",
|
|
5189
5219
|
stroke: t ? this.settings.highlightColor : "#ffffff",
|
|
5190
5220
|
strokeWidth: 1
|
|
5191
|
-
}), o = new
|
|
5221
|
+
}), o = new D.Text({
|
|
5192
5222
|
text: e.name,
|
|
5193
5223
|
fontSize: 10,
|
|
5194
5224
|
fill: "#ffffff",
|
|
@@ -5209,18 +5239,18 @@ var Sa = class {
|
|
|
5209
5239
|
this.stage.container().style.cursor = "pointer";
|
|
5210
5240
|
}), this.areaLayer.add(i);
|
|
5211
5241
|
} else {
|
|
5212
|
-
let n = new
|
|
5242
|
+
let n = new D.Group({
|
|
5213
5243
|
x: e.x,
|
|
5214
5244
|
y: e.y,
|
|
5215
5245
|
draggable: !0
|
|
5216
|
-
}), r = new
|
|
5246
|
+
}), r = new D.Rect({
|
|
5217
5247
|
width: e.width,
|
|
5218
5248
|
height: e.height,
|
|
5219
5249
|
fill: this.settings.areaFillColor,
|
|
5220
5250
|
stroke: t ? this.settings.highlightColor : this.settings.areaStrokeColor,
|
|
5221
5251
|
strokeWidth: t ? 3 : 2,
|
|
5222
5252
|
cornerRadius: 8
|
|
5223
|
-
}), i = new
|
|
5253
|
+
}), i = new D.Text({
|
|
5224
5254
|
text: e.name,
|
|
5225
5255
|
fontSize: this.settings.fontSize,
|
|
5226
5256
|
fill: this.settings.textColor,
|
|
@@ -5232,7 +5262,7 @@ var Sa = class {
|
|
|
5232
5262
|
verticalAlign: "middle",
|
|
5233
5263
|
ellipsis: !0,
|
|
5234
5264
|
wrap: "word"
|
|
5235
|
-
}), a = new
|
|
5265
|
+
}), a = new D.Text({
|
|
5236
5266
|
text: `${e.roomCount} rooms`,
|
|
5237
5267
|
fontSize: 10,
|
|
5238
5268
|
fill: this.settings.connectionColor,
|
|
@@ -5296,6 +5326,6 @@ var Sa = class {
|
|
|
5296
5326
|
}
|
|
5297
5327
|
};
|
|
5298
5328
|
//#endregion
|
|
5299
|
-
export { u as ALL_VISIBLE,
|
|
5329
|
+
export { u as ALL_VISIBLE, Ui as AmbientLightOverlay, ve as Area, wa as AreaMapRenderer, Xr as Blueprint, T as Camera, Ii as CanvasExporter, ei as Construction, ie as CullingManager, si as DarkModern, qe as DrawCommandLayerNode, xa as ExplorationLens, ni as GradientRooms, ii as GraphPaper, ce as HitTester, e as IDENTITY_TRANSFORM, $r as Isometric, da as MapGraph, ye as MapReader, li as MapRenderer, Me as MapState, Je as MaterializingLayerNode, Zr as Neon, Yr as Parchment, _a as PathFinder, _e as Plane, Pi as PngBlobExporter, Li as PngBytesExporter, Ni as PngExporter, ne as ProjectedMapReader, a as ROOM_UI_BORDER_COLOR, c as ROOM_UI_BORDER_THICKNESS, l as ROOM_UI_HIDDEN, Ge as RecordingGroupNode, j as RecordingLayerNode, qi as RippleEffect, ti as SciFi, Qr as Sketchy, ri as StainedGlass, Mi as SvgExporter, ai as Topographic, ci as TreasureMap, oi as Watercolor, ra as WaypointOverlay, E as applyStyleToShapes, di as buildDrawCommands, Fi as canvasToBytes, s as colorLightness, re as compose, ba as composeLenses, lt as computeLodMode, b as computeNeighborSpill, le as computePathData, Ca as createAreaMapSettings, je as createSettings, _ as darkenColor, d as defaultExitTreatment, m as getRoomBorderColor, ge as getRoomBorderThickness, y as hexToRgba, x as identityStyle, Ye as isGradientFill, va as isHashLookupCapable, v as isRoomHidden, N as isViewportDataSource, na as placeLabels, fe as projectRoom, Ti as renderToCanvas, Ze as shapeToRecording, ct as shouldUseRaster, he as spillPositionMap, xi as svgFromBatches, M as transformFill, Jr as treasureMapDecorations };
|
|
5300
5330
|
|
|
5301
5331
|
//# sourceMappingURL=index.mjs.map
|