@eyeon/map 2.0.1 → 2.0.2
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/README.md +18 -1
- package/dist/assets/MapViewer.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/chunks/MapViewer.js +1745 -356
- package/dist/chunks/MapViewer.js.map +1 -1
- package/dist/chunks/stacking.js +1321 -0
- package/dist/chunks/stacking.js.map +1 -0
- package/dist/core/geometry/index.d.ts +41 -4
- package/dist/core/geometry/index.d.ts.map +1 -1
- package/dist/core/hostChrome.d.ts +20 -0
- package/dist/core/hostChrome.d.ts.map +1 -0
- package/dist/core/import/index.d.ts +48 -3
- package/dist/core/import/index.d.ts.map +1 -1
- package/dist/core/import/svgStyle.d.ts +21 -0
- package/dist/core/import/svgStyle.d.ts.map +1 -0
- package/dist/core/import/svgTransform.d.ts +49 -0
- package/dist/core/import/svgTransform.d.ts.map +1 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +207 -266
- package/dist/core/index.js.map +1 -1
- package/dist/core/layerStyles.d.ts +28 -0
- package/dist/core/layerStyles.d.ts.map +1 -0
- package/dist/core/publish/index.d.ts +8 -2
- package/dist/core/publish/index.d.ts.map +1 -1
- package/dist/core/routing/graph-tools.d.ts +5 -1
- package/dist/core/routing/graph-tools.d.ts.map +1 -1
- package/dist/core/stacking.d.ts +61 -0
- package/dist/core/stacking.d.ts.map +1 -0
- package/dist/core/types.d.ts +27 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/editor/MapEditor.d.ts +28 -16
- package/dist/editor/MapEditor.d.ts.map +1 -1
- package/dist/editor/canvas/EditorCanvas.d.ts +15 -3
- package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
- package/dist/editor/canvas/coords.d.ts +21 -0
- package/dist/editor/canvas/coords.d.ts.map +1 -0
- package/dist/editor/draftOps.d.ts +19 -0
- package/dist/editor/draftOps.d.ts.map +1 -0
- package/dist/editor/geometryEdit.d.ts +34 -0
- package/dist/editor/geometryEdit.d.ts.map +1 -0
- package/dist/editor/index.css +1281 -145
- package/dist/editor/index.d.ts +8 -2
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/index.js +2293 -585
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/labels.d.ts +5 -0
- package/dist/editor/labels.d.ts.map +1 -0
- package/dist/editor/panels/FloorsPanel.d.ts +60 -0
- package/dist/editor/panels/FloorsPanel.d.ts.map +1 -0
- package/dist/editor/panels/ImportReviewPanel.d.ts +22 -0
- package/dist/editor/panels/ImportReviewPanel.d.ts.map +1 -0
- package/dist/editor/panels/Inspector.d.ts +4 -2
- package/dist/editor/panels/Inspector.d.ts.map +1 -1
- package/dist/editor/panels/LeftRail.d.ts +19 -6
- package/dist/editor/panels/LeftRail.d.ts.map +1 -1
- package/dist/editor/panels/PreviewOverlay.d.ts +11 -2
- package/dist/editor/panels/PreviewOverlay.d.ts.map +1 -1
- package/dist/editor/portalSurface.d.ts +11 -0
- package/dist/editor/portalSurface.d.ts.map +1 -0
- package/dist/editor/previewDocument.d.ts +9 -0
- package/dist/editor/previewDocument.d.ts.map +1 -0
- package/dist/editor/tools.d.ts +20 -0
- package/dist/editor/tools.d.ts.map +1 -0
- package/dist/test-maps/shops-at-south-town/BASE - Shops At South Town.ai +26780 -26
- package/dist/test-maps/shops-at-south-town/LF - Shops At South Town.ai +4487 -2
- package/dist/test-maps/shops-at-south-town/SVG/BASE - Shops At South Town.svg +567 -0
- package/dist/test-maps/shops-at-south-town/SVG/LF - Shops At South Town.svg +238 -0
- package/dist/test-maps/shops-at-south-town/SVG/UF - Shops At South Town.svg +276 -0
- package/dist/test-maps/shops-at-south-town/UF - Shops At South Town.ai +4228 -1
- package/dist/viewer/MapViewer.d.ts +14 -3
- package/dist/viewer/MapViewer.d.ts.map +1 -1
- package/dist/viewer/camera.d.ts +34 -0
- package/dist/viewer/camera.d.ts.map +1 -0
- package/dist/viewer/components/CameraRig.d.ts +18 -0
- package/dist/viewer/components/CameraRig.d.ts.map +1 -0
- package/dist/viewer/components/LevelMeshes.d.ts +6 -1
- package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
- package/dist/viewer/components/MapScene.d.ts +6 -1
- package/dist/viewer/components/MapScene.d.ts.map +1 -1
- package/dist/viewer/components/SvgVectorLayer.d.ts +18 -0
- package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -0
- package/dist/viewer/index.css +124 -35
- package/dist/viewer/index.d.ts +4 -0
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +9 -4
- package/dist/viewer/index.js.map +1 -1
- package/dist/viewer/ui/MapControls.d.ts +14 -0
- package/dist/viewer/ui/MapControls.d.ts.map +1 -0
- package/dist/viewer/ui/RuntimeChrome.d.ts +3 -3
- package/dist/viewer/ui/RuntimeChrome.d.ts.map +1 -1
- package/package.json +7 -3
- package/dist/chunks/graph-tools.js +0 -153
- package/dist/chunks/graph-tools.js.map +0 -1
- package/dist/chunks/pathfinding.js +0 -343
- package/dist/chunks/pathfinding.js.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Vec2 } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 2D affine matrix in SVG order:
|
|
4
|
+
*
|
|
5
|
+
* ```
|
|
6
|
+
* | a c e |
|
|
7
|
+
* | b d f |
|
|
8
|
+
* | 0 0 1 |
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export interface Matrix2D {
|
|
12
|
+
a: number;
|
|
13
|
+
b: number;
|
|
14
|
+
c: number;
|
|
15
|
+
d: number;
|
|
16
|
+
e: number;
|
|
17
|
+
f: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const IDENTITY_MATRIX: Matrix2D;
|
|
20
|
+
/**
|
|
21
|
+
* Matrix product `outer × inner`: the returned matrix applies `inner` first,
|
|
22
|
+
* then `outer`. SVG composes `transform="A B"` the same way — the rightmost
|
|
23
|
+
* transform is applied to the geometry first, and an ancestor `<g>` transform
|
|
24
|
+
* is the outer one relative to its descendants.
|
|
25
|
+
*/
|
|
26
|
+
export declare function multiplyMatrix(outer: Matrix2D, inner: Matrix2D): Matrix2D;
|
|
27
|
+
export declare function applyMatrix(m: Matrix2D, p: Vec2): Vec2;
|
|
28
|
+
export declare function isIdentityMatrix(m: Matrix2D, epsilon?: number): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Parse an SVG `transform` attribute into a single affine matrix.
|
|
31
|
+
* Unknown functions are skipped. Returns identity for empty / unparseable input.
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseTransform(raw: string | null | undefined): Matrix2D;
|
|
34
|
+
/**
|
|
35
|
+
* Bake an affine matrix into a path `d` string, emitting absolute commands.
|
|
36
|
+
*
|
|
37
|
+
* Flattening a bezier commutes with an affine map (control points transform
|
|
38
|
+
* independently, sampling parameters do not change), so
|
|
39
|
+
* `pathToPolygons(transformPathD(d, m))` equals `pathToPolygons(d)` mapped
|
|
40
|
+
* through `m`. That is what keeps `geometry.paths[].d` and `geometry.polygons`
|
|
41
|
+
* in the same coordinate space.
|
|
42
|
+
*
|
|
43
|
+
* Arcs commute exactly under a similarity (translate / rotate / uniform scale /
|
|
44
|
+
* mirror), which covers Illustrator output. A shear or non-uniform scale maps
|
|
45
|
+
* the same curve but reparameterises it, so individual sample points may shift
|
|
46
|
+
* along the outline even though the outline itself is right.
|
|
47
|
+
*/
|
|
48
|
+
export declare function transformPathD(d: string, m: Matrix2D): string;
|
|
49
|
+
//# sourceMappingURL=svgTransform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svgTransform.d.ts","sourceRoot":"","sources":["../../../src/core/import/svgTransform.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGrC;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,eAAO,MAAM,eAAe,EAAE,QAAiD,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,GAAG,QAAQ,CASzE;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAKtD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,SAAO,GAAG,OAAO,CASrE;AAmDD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAmBvE;AA+CD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CA8J7D"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export * from './types';
|
|
2
|
+
export * from './hostChrome';
|
|
3
|
+
export * from './layerStyles';
|
|
2
4
|
export * from './geometry';
|
|
3
5
|
export * from './import';
|
|
4
6
|
export * from './routing/graph-tools';
|
|
5
7
|
export * from './routing/pathfinding';
|
|
6
8
|
export * from './publish';
|
|
9
|
+
export * from './stacking';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,282 +1,223 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{ prefix: "escalator-", kind: "connector" },
|
|
16
|
-
{ prefix: "elevator-", kind: "connector" },
|
|
17
|
-
{ prefix: "stairs-", kind: "connector" },
|
|
18
|
-
{ prefix: "entrance-", kind: "entrance" },
|
|
19
|
-
{ prefix: "zone-", kind: "zone" },
|
|
20
|
-
{ prefix: "label-", kind: "label" },
|
|
21
|
-
{ prefix: "floorplate", kind: "floorplate" },
|
|
22
|
-
{ prefix: "base", kind: "floorplate" },
|
|
23
|
-
{ prefix: "decor", kind: "decor" },
|
|
24
|
-
{ prefix: "special-shape", kind: "decor" },
|
|
25
|
-
{ prefix: "overlay", kind: "decor" }
|
|
26
|
-
], $ = [
|
|
27
|
-
{ prefix: "parking-zone", kind: "parking_zone" },
|
|
28
|
-
{ prefix: "parking-lane", kind: "parking_zone" },
|
|
29
|
-
{ prefix: "parking-line", kind: "decor" },
|
|
30
|
-
{ prefix: "parking-icon", kind: "parking_icon" },
|
|
31
|
-
{ prefix: "green-area", kind: "green_area" },
|
|
32
|
-
{ prefix: "water", kind: "water" },
|
|
33
|
-
{ prefix: "decor", kind: "decor" },
|
|
34
|
-
{ prefix: "entrance-", kind: "entrance" },
|
|
35
|
-
{ prefix: "unit", kind: "unit" },
|
|
36
|
-
{ prefix: "store", kind: "unit" },
|
|
37
|
-
{ prefix: "interactive-", kind: "unit" },
|
|
38
|
-
{ prefix: "walkable", kind: "walkable" },
|
|
39
|
-
{ prefix: "amenity-", kind: "amenity" }
|
|
40
|
-
], A = "route-path";
|
|
41
|
-
function L(n, t = "floor") {
|
|
42
|
-
const o = n.toLowerCase(), a = t === "base" ? $ : P;
|
|
43
|
-
for (const { prefix: l, kind: p } of a)
|
|
44
|
-
if (o === l || o.startsWith(l))
|
|
45
|
-
return { kind: p, guessed: !1 };
|
|
46
|
-
return o.startsWith("interactive") ? { kind: "unit", guessed: !0 } : { kind: null, guessed: !1 };
|
|
47
|
-
}
|
|
48
|
-
function v(n) {
|
|
49
|
-
const t = n.trim().split(/[\s,]+/).map(Number);
|
|
50
|
-
if (t.length < 4) return "";
|
|
51
|
-
let o = `M ${t[0]} ${t[1]}`;
|
|
52
|
-
for (let a = 2; a < t.length; a += 2)
|
|
53
|
-
o += ` L ${t[a]} ${t[a + 1]}`;
|
|
54
|
-
return o += " Z", o;
|
|
55
|
-
}
|
|
56
|
-
function _(n, t, o, a) {
|
|
57
|
-
return `M ${n} ${t} L ${o} ${a}`;
|
|
58
|
-
}
|
|
59
|
-
function C(n) {
|
|
60
|
-
const t = n.match(/viewBox\s*=\s*["']([^"']+)["']/i), o = y(t == null ? void 0 : t[1]), a = [], l = [], p = /<(path|polygon|polyline|line|rect|g)\b([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/gi;
|
|
61
|
-
let i;
|
|
62
|
-
for (; (i = p.exec(n)) !== null; ) {
|
|
63
|
-
const e = i[1].toLowerCase(), c = i[2] ?? "", k = c.match(/\bid\s*=\s*["']([^"']+)["']/i);
|
|
64
|
-
if (!k) continue;
|
|
65
|
-
const f = k[1], g = /\bdata-interactive\s*=\s*["']?(true|1|yes)/i.test(c);
|
|
66
|
-
if (f.toLowerCase().startsWith(A)) {
|
|
67
|
-
const s = c.match(/\bd\s*=\s*["']([^"']+)["']/i);
|
|
68
|
-
s && l.push(s[1]);
|
|
69
|
-
const r = c.match(/\bpoints\s*=\s*["']([^"']+)["']/i);
|
|
70
|
-
r && l.push(v(r[1]).replace(/ Z$/, ""));
|
|
1
|
+
import { D as g, n as L, d as A, p as S, a as T } from "../chunks/stacking.js";
|
|
2
|
+
import { b as F, F as O, I as R, c as N, e as B, f as $, S as G, g as Y, h as H, j as V, k as j, l as K, o as U, q as W, r as X, s as z, t as Q, u as q, w as J, x as Z, y as ee, z as ne, A as te, B as oe, C as se, E as ae, G as ie, H as re, J as de, K as ce, L as le, M as fe, N as ue, O as he, P as pe, Q as me, R as Ie, i as ye, T as xe, U as ge, V as Ae, m as Se, W as ve, X as Le, Y as Te, Z as we, _ as Ee, $ as be, a0 as Me, a1 as Pe, a2 as ke, a3 as De, a4 as _e, a5 as Ce, a6 as Fe, a7 as Oe, a8 as Re, a9 as Ne, aa as Be, ab as $e, ac as Ge, ad as Ye, v as He, ae as Ve } from "../chunks/stacking.js";
|
|
3
|
+
function E(a, f, i, r = g) {
|
|
4
|
+
const e = a.filter((n) => i.includes(n.id));
|
|
5
|
+
if (e.length < 2) return null;
|
|
6
|
+
const t = e.reduce((n, c) => c.id < n.id ? c : n), o = [];
|
|
7
|
+
for (const n of e)
|
|
8
|
+
n.id !== t.id && A(n, t) <= r && o.push(n.id);
|
|
9
|
+
if (o.length === 0) return null;
|
|
10
|
+
const d = new Set(o), h = [];
|
|
11
|
+
for (const n of f) {
|
|
12
|
+
let c = !1;
|
|
13
|
+
if (d.has(n.fromAnchorId) && (n.fromAnchorId = t.id, c = !0), d.has(n.toAnchorId) && (n.toAnchorId = t.id, c = !0), n.fromAnchorId === n.toAnchorId) {
|
|
14
|
+
h.push(n.id);
|
|
71
15
|
continue;
|
|
72
16
|
}
|
|
73
|
-
|
|
74
|
-
if (e === "path") {
|
|
75
|
-
const s = c.match(/\bd\s*=\s*["']([^"']+)["']/i);
|
|
76
|
-
s && (d.d = s[1]);
|
|
77
|
-
} else if (e === "polygon" || e === "polyline") {
|
|
78
|
-
const s = c.match(/\bpoints\s*=\s*["']([^"']+)["']/i);
|
|
79
|
-
s && (d.d = v(s[1]));
|
|
80
|
-
} else if (e === "line") {
|
|
81
|
-
const s = (r) => {
|
|
82
|
-
const u = c.match(new RegExp(`\\b${r}\\s*=\\s*["']?(-?[\\d.]+)`, "i"));
|
|
83
|
-
return u ? Number(u[1]) : 0;
|
|
84
|
-
};
|
|
85
|
-
d.d = _(s("x1"), s("y1"), s("x2"), s("y2"));
|
|
86
|
-
} else if (e === "rect") {
|
|
87
|
-
const s = (b) => {
|
|
88
|
-
const m = c.match(new RegExp(`\\b${b}\\s*=\\s*["']?(-?[\\d.]+)`, "i"));
|
|
89
|
-
return m ? Number(m[1]) : 0;
|
|
90
|
-
}, r = s("x"), u = s("y"), h = s("width"), x = s("height");
|
|
91
|
-
d.d = `M ${r} ${u} L ${r + h} ${u} L ${r + h} ${u + x} L ${r} ${u + x} Z`;
|
|
92
|
-
} else if (e === "g") {
|
|
93
|
-
const s = i[3] ?? "", r = [], u = /<(path|polygon|polyline|line|rect)\b([^>]*)\/?>/gi;
|
|
94
|
-
let h;
|
|
95
|
-
for (; (h = u.exec(s)) !== null; ) {
|
|
96
|
-
const x = h[1].toLowerCase(), b = h[2] ?? "";
|
|
97
|
-
if (x === "path") {
|
|
98
|
-
const m = b.match(/\bd\s*=\s*["']([^"']+)["']/i);
|
|
99
|
-
m && r.push(m[1]);
|
|
100
|
-
} else if (x === "polygon" || x === "polyline") {
|
|
101
|
-
const m = b.match(/\bpoints\s*=\s*["']([^"']+)["']/i);
|
|
102
|
-
m && r.push(v(m[1]));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
r.length > 0 && (d.d = r.join(" "));
|
|
106
|
-
}
|
|
107
|
-
(d.d || e === "g") && a.push(d);
|
|
17
|
+
c && h.push(n.id);
|
|
108
18
|
}
|
|
109
|
-
return {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
19
|
+
return {
|
|
20
|
+
survivingAnchorId: t.id,
|
|
21
|
+
removedAnchorIds: o,
|
|
22
|
+
rewiredEdgeIds: h
|
|
23
|
+
};
|
|
113
24
|
}
|
|
114
|
-
function
|
|
115
|
-
const
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
kind: d,
|
|
123
|
-
guessed: s
|
|
124
|
-
};
|
|
125
|
-
if (!d) {
|
|
126
|
-
l.push(g.id), r.message = "No matching prefix; skipped", a.push(r);
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
if (!g.d) {
|
|
130
|
-
i.push(`Element ${g.id} has no drawable geometry`);
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
s && (p.push(r), r.message = "Guessed kind from interactive/fallback rule"), a.push(r), d === "walkable" && c++, d === "void" && k++, d === "unit" && f++;
|
|
134
|
-
const u = w([g.d], o.viewbox, !0), h = I(u);
|
|
135
|
-
e.push({
|
|
136
|
-
key: N(g.id),
|
|
137
|
-
kind: d,
|
|
138
|
-
geometry: u,
|
|
139
|
-
bbox: h,
|
|
140
|
-
sourceSvgId: g.id,
|
|
141
|
-
style: {}
|
|
142
|
-
});
|
|
25
|
+
function b(a, f = g) {
|
|
26
|
+
const i = [], r = /* @__PURE__ */ new Set();
|
|
27
|
+
for (let e = 0; e < a.length; e++) {
|
|
28
|
+
if (r.has(a[e].id)) continue;
|
|
29
|
+
const t = [a[e].id];
|
|
30
|
+
for (let o = e + 1; o < a.length; o++)
|
|
31
|
+
r.has(a[o].id) || a[e].levelId === a[o].levelId && A(a[e], a[o]) <= f && (t.push(a[o].id), r.add(a[o].id));
|
|
32
|
+
t.length > 1 && (r.add(a[e].id), i.push(t));
|
|
143
33
|
}
|
|
144
|
-
return
|
|
145
|
-
"No walkable layer found — auto-skeleton will be unavailable for this level"
|
|
146
|
-
), {
|
|
147
|
-
report: {
|
|
148
|
-
classified: a,
|
|
149
|
-
unrecognized: l,
|
|
150
|
-
guessed: p,
|
|
151
|
-
walkableCount: c,
|
|
152
|
-
voidCount: k,
|
|
153
|
-
unitCount: f,
|
|
154
|
-
warnings: i
|
|
155
|
-
},
|
|
156
|
-
shapes: e,
|
|
157
|
-
viewbox: o.viewbox,
|
|
158
|
-
routePathDs: o.routePathDs
|
|
159
|
-
};
|
|
34
|
+
return i;
|
|
160
35
|
}
|
|
161
|
-
function
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const e = a.get(i.sourceSvgId);
|
|
167
|
-
l.add(i.sourceSvgId), e ? e.kind !== i.kind ? p.push({
|
|
168
|
-
sourceSvgId: i.sourceSvgId,
|
|
169
|
-
change: "kind_changed",
|
|
170
|
-
existingShapeId: e.id,
|
|
171
|
-
existingKind: e.kind,
|
|
172
|
-
newKind: i.kind,
|
|
173
|
-
preserve: { key: e.key, assignment: !0, anchors: !0 }
|
|
174
|
-
}) : p.push({
|
|
175
|
-
sourceSvgId: i.sourceSvgId,
|
|
176
|
-
change: "unchanged",
|
|
177
|
-
existingShapeId: e.id,
|
|
178
|
-
existingKind: e.kind,
|
|
179
|
-
newKind: i.kind,
|
|
180
|
-
preserve: { key: e.key, assignment: !0, anchors: !0 }
|
|
181
|
-
}) : p.push({
|
|
182
|
-
sourceSvgId: i.sourceSvgId,
|
|
183
|
-
change: "added",
|
|
184
|
-
newKind: i.kind
|
|
185
|
-
});
|
|
36
|
+
function M(a, f, i, r = g) {
|
|
37
|
+
let e = null;
|
|
38
|
+
for (const o of f) {
|
|
39
|
+
const d = L(a, o);
|
|
40
|
+
d && (!e || d.distance < e.distance) && (e = { point: d.point, distance: d.distance });
|
|
186
41
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
existingShapeId: i.id,
|
|
192
|
-
existingKind: i.kind
|
|
193
|
-
});
|
|
42
|
+
if (!e) return null;
|
|
43
|
+
const t = i.find(
|
|
44
|
+
(o) => o.levelId === a.levelId && A(o, e.point) <= r
|
|
45
|
+
);
|
|
194
46
|
return {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
47
|
+
unitAnchorId: a.id,
|
|
48
|
+
junctionAnchor: t ? { x: t.x, y: t.y, existingId: t.id } : { x: e.point.x, y: e.point.y },
|
|
49
|
+
edge: {
|
|
50
|
+
fromAnchorId: a.id,
|
|
51
|
+
toAnchorId: t == null ? void 0 : t.id
|
|
52
|
+
}
|
|
198
53
|
};
|
|
199
54
|
}
|
|
200
|
-
function
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return {
|
|
209
|
-
id: e.id,
|
|
210
|
-
buildingId: e.buildingId,
|
|
211
|
-
kind: e.kind,
|
|
212
|
-
name: e.name,
|
|
213
|
-
levelIndex: e.levelIndex,
|
|
214
|
-
ordering: e.ordering,
|
|
215
|
-
sourceSvgUrl: a(e.sourceSvgKey),
|
|
216
|
-
viewbox: e.sourceViewbox,
|
|
217
|
-
transform: e.transform,
|
|
218
|
-
shapes: c,
|
|
219
|
-
anchors: k
|
|
220
|
-
};
|
|
221
|
-
}), { nodes: p, edges: i } = E(
|
|
222
|
-
n.anchors,
|
|
223
|
-
n.edges,
|
|
224
|
-
n.connectors
|
|
225
|
-
);
|
|
55
|
+
function P(a, f, i, r) {
|
|
56
|
+
if (i.length === 0) return null;
|
|
57
|
+
const e = i.flat();
|
|
58
|
+
if (e.length === 0) return null;
|
|
59
|
+
let t = 0, o = 0;
|
|
60
|
+
for (const n of e)
|
|
61
|
+
t += n.x, o += n.y;
|
|
62
|
+
const d = { x: t / e.length, y: o / e.length }, h = S(d, i) ? d : e[0];
|
|
226
63
|
return {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
64
|
+
id: r,
|
|
65
|
+
levelId: f,
|
|
66
|
+
shapeId: a,
|
|
67
|
+
kind: "unit",
|
|
68
|
+
x: h.x,
|
|
69
|
+
y: h.y,
|
|
70
|
+
connectorId: null
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function k(a, f, i = 20) {
|
|
74
|
+
if (a.length === 0)
|
|
75
|
+
return { anchors: [], edges: [] };
|
|
76
|
+
let r = 1 / 0, e = 1 / 0, t = -1 / 0, o = -1 / 0;
|
|
77
|
+
for (const s of a)
|
|
78
|
+
for (const l of s)
|
|
79
|
+
r = Math.min(r, l.x), e = Math.min(e, l.y), t = Math.max(t, l.x), o = Math.max(o, l.y);
|
|
80
|
+
const d = Math.max(1, Math.ceil((t - r) / i)), h = Math.max(1, Math.ceil((o - e) / i)), n = [];
|
|
81
|
+
for (let s = 0; s < h; s++)
|
|
82
|
+
for (let l = 0; l < d; l++) {
|
|
83
|
+
const I = r + (l + 0.5) * i, x = e + (s + 0.5) * i, y = { x: I, y: x };
|
|
84
|
+
S(y, a) && (f.length > 0 && S(y, f) || n.push({ key: `${l},${s}`, x: I, y: x, col: l, row: s }));
|
|
85
|
+
}
|
|
86
|
+
const c = new Map(n.map((s) => [s.key, s])), p = n.map((s) => ({
|
|
87
|
+
tempId: s.key,
|
|
88
|
+
x: s.x,
|
|
89
|
+
y: s.y,
|
|
90
|
+
kind: "junction"
|
|
91
|
+
})), u = [], m = /* @__PURE__ */ new Set();
|
|
92
|
+
for (const s of n) {
|
|
93
|
+
const l = [
|
|
94
|
+
[s.col + 1, s.row],
|
|
95
|
+
[s.col, s.row + 1]
|
|
96
|
+
];
|
|
97
|
+
for (const [I, x] of l) {
|
|
98
|
+
const y = `${I},${x}`;
|
|
99
|
+
if (!c.has(y)) continue;
|
|
100
|
+
const v = s.key < y ? `${s.key}|${y}` : `${y}|${s.key}`;
|
|
101
|
+
m.has(v) || (m.add(v), u.push({ fromTempId: s.key, toTempId: y }));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return { anchors: p, edges: u };
|
|
105
|
+
}
|
|
106
|
+
function D(a, f, i, r, e = g) {
|
|
107
|
+
const t = [], o = [];
|
|
108
|
+
let d = r;
|
|
109
|
+
const h = (n, c) => {
|
|
110
|
+
const p = t.find(
|
|
111
|
+
(m) => A(m, { x: n, y: c }) <= e
|
|
112
|
+
);
|
|
113
|
+
if (p) return p.id;
|
|
114
|
+
const u = d++;
|
|
115
|
+
return t.push({
|
|
116
|
+
id: u,
|
|
117
|
+
levelId: f,
|
|
118
|
+
shapeId: null,
|
|
119
|
+
kind: "junction",
|
|
120
|
+
x: n,
|
|
121
|
+
y: c,
|
|
122
|
+
connectorId: null
|
|
123
|
+
}), u;
|
|
242
124
|
};
|
|
125
|
+
for (const n of a) {
|
|
126
|
+
const c = T(n);
|
|
127
|
+
for (const p of c)
|
|
128
|
+
for (let u = 0; u < p.length - 1; u++) {
|
|
129
|
+
const m = h(p[u].x, p[u].y), s = h(p[u + 1].x, p[u + 1].y);
|
|
130
|
+
m === s || o.some(
|
|
131
|
+
(I) => I.fromAnchorId === m && I.toAnchorId === s || I.fromAnchorId === s && I.toAnchorId === m
|
|
132
|
+
) || o.push({
|
|
133
|
+
id: d++,
|
|
134
|
+
mapId: i,
|
|
135
|
+
fromAnchorId: m,
|
|
136
|
+
toAnchorId: s,
|
|
137
|
+
weight: null,
|
|
138
|
+
directed: !1,
|
|
139
|
+
accessible: !0,
|
|
140
|
+
kind: "walk"
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return { anchors: t, edges: o, nextId: d };
|
|
243
145
|
}
|
|
244
146
|
export {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
H as
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
ie as
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
147
|
+
F as DEFAULT_THEME,
|
|
148
|
+
g as DEFAULT_WELD_TOLERANCE,
|
|
149
|
+
O as FLOOR_CHANGE_PENALTY,
|
|
150
|
+
R as IDENTITY_MATRIX,
|
|
151
|
+
N as IMPORT_DRIFT_THRESHOLD,
|
|
152
|
+
B as IMPORT_PERSISTED_KINDS,
|
|
153
|
+
$ as INTERACTIVE_SHAPE_KINDS,
|
|
154
|
+
G as STATIC_LAYER_STYLES,
|
|
155
|
+
Y as angleFromWall,
|
|
156
|
+
H as applyMatrix,
|
|
157
|
+
V as approximateArc,
|
|
158
|
+
j as approximateCubic,
|
|
159
|
+
K as approximateQuadratic,
|
|
160
|
+
M as autoConnectUnitAnchor,
|
|
161
|
+
U as bboxOf,
|
|
162
|
+
W as bboxUnion,
|
|
163
|
+
X as boundsFromStackedLevels,
|
|
164
|
+
k as buildAutoSkeleton,
|
|
165
|
+
z as buildGeometryFromPaths,
|
|
166
|
+
Q as centroid,
|
|
167
|
+
q as classifyId,
|
|
168
|
+
J as compareBuildingFloors,
|
|
169
|
+
Z as compileDocument,
|
|
170
|
+
ee as compileGraph,
|
|
171
|
+
ne as defaultViewerLevelId,
|
|
172
|
+
te as diffImport,
|
|
173
|
+
A as distance,
|
|
174
|
+
oe as expandBounds,
|
|
175
|
+
se as findNearestAmenityPath,
|
|
176
|
+
ae as findPath,
|
|
177
|
+
b as findWeldCandidates,
|
|
178
|
+
ie as flipY,
|
|
179
|
+
re as floorSwitcherDisplayLevels,
|
|
180
|
+
de as floorSwitcherLevels,
|
|
181
|
+
ce as geometryBBox,
|
|
182
|
+
le as geometryCentroid,
|
|
183
|
+
D as importRoutePaths,
|
|
184
|
+
fe as importSvg,
|
|
185
|
+
ue as inlineSvgStyles,
|
|
186
|
+
he as isGeometrySpaceStale,
|
|
187
|
+
pe as isIdentityMatrix,
|
|
188
|
+
me as isInteractiveGroupLabel,
|
|
189
|
+
Ie as isLayerContainerLabel,
|
|
190
|
+
ye as isMapViewerHost,
|
|
191
|
+
xe as isNonInteractiveGroupLabel,
|
|
192
|
+
ge as isOutdoorLevel,
|
|
193
|
+
Ae as isStoreFolderLabel,
|
|
194
|
+
Se as mapSurface,
|
|
195
|
+
ve as mergePresentationStyle,
|
|
196
|
+
Le as mergeTheme,
|
|
197
|
+
Te as multiplyMatrix,
|
|
198
|
+
L as nearestPointOnPolyline,
|
|
199
|
+
we as normalizeGeometrySpace,
|
|
200
|
+
Ee as normalizeLayerLabel,
|
|
201
|
+
be as normalizeLayerName,
|
|
202
|
+
Me as normalizePublishedDocument,
|
|
203
|
+
Pe as parseSvgString,
|
|
204
|
+
ke as parseTransform,
|
|
205
|
+
De as parseViewBox,
|
|
206
|
+
T as pathToPolygons,
|
|
207
|
+
_e as pointInPolygon,
|
|
208
|
+
S as pointInPolygons,
|
|
209
|
+
Ce as projectOntoSegment,
|
|
210
|
+
Fe as readPresentationStyle,
|
|
211
|
+
Oe as resolveLayerStyle,
|
|
212
|
+
Re as shouldShowFloorSwitcher,
|
|
213
|
+
Ne as snapAngle,
|
|
214
|
+
Be as tokenizePathData,
|
|
215
|
+
$e as transformPathD,
|
|
216
|
+
Ge as unionViewBox,
|
|
217
|
+
P as unitAnchorFromShape,
|
|
218
|
+
Ye as viewBoxToBounds,
|
|
219
|
+
He as viewerChrome,
|
|
220
|
+
Ve as viewerLevelStack,
|
|
221
|
+
E as weldAnchors
|
|
281
222
|
};
|
|
282
223
|
//# sourceMappingURL=index.js.map
|