@eyeon/map 2.0.15 → 2.0.19

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.
Files changed (106) hide show
  1. package/dist/assets/MapViewer.css +1 -1
  2. package/dist/assets/index.css +1 -1
  3. package/dist/chunks/MapViewer.js +2566 -2161
  4. package/dist/chunks/MapViewer.js.map +1 -1
  5. package/dist/chunks/responsive.js +2590 -0
  6. package/dist/chunks/responsive.js.map +1 -0
  7. package/dist/chunks/wheelZoom.js +163 -177
  8. package/dist/chunks/wheelZoom.js.map +1 -1
  9. package/dist/core/assignment.d.ts +19 -2
  10. package/dist/core/assignment.d.ts.map +1 -1
  11. package/dist/core/color.d.ts +7 -0
  12. package/dist/core/color.d.ts.map +1 -1
  13. package/dist/core/entranceIcon.d.ts +17 -3
  14. package/dist/core/entranceIcon.d.ts.map +1 -1
  15. package/dist/core/hostChrome.d.ts +13 -2
  16. package/dist/core/hostChrome.d.ts.map +1 -1
  17. package/dist/core/hoverTooltip.d.ts +37 -0
  18. package/dist/core/hoverTooltip.d.ts.map +1 -0
  19. package/dist/core/import/index.d.ts +10 -1
  20. package/dist/core/import/index.d.ts.map +1 -1
  21. package/dist/core/index.d.ts +3 -0
  22. package/dist/core/index.d.ts.map +1 -1
  23. package/dist/core/index.js +237 -189
  24. package/dist/core/layerStyles.d.ts +31 -0
  25. package/dist/core/layerStyles.d.ts.map +1 -1
  26. package/dist/core/outdoorDecoration.d.ts.map +1 -1
  27. package/dist/core/publicShapes.d.ts +14 -0
  28. package/dist/core/publicShapes.d.ts.map +1 -1
  29. package/dist/core/responsive.d.ts +6 -0
  30. package/dist/core/responsive.d.ts.map +1 -1
  31. package/dist/core/routing/graph-tools.d.ts +6 -5
  32. package/dist/core/routing/graph-tools.d.ts.map +1 -1
  33. package/dist/core/routing/pathfinding.d.ts +36 -0
  34. package/dist/core/routing/pathfinding.d.ts.map +1 -1
  35. package/dist/core/shapeFill.d.ts +40 -0
  36. package/dist/core/shapeFill.d.ts.map +1 -0
  37. package/dist/core/stacking.d.ts +4 -0
  38. package/dist/core/stacking.d.ts.map +1 -1
  39. package/dist/core/types.d.ts +21 -3
  40. package/dist/core/types.d.ts.map +1 -1
  41. package/dist/core/viewerReset.d.ts +24 -0
  42. package/dist/core/viewerReset.d.ts.map +1 -0
  43. package/dist/core/websiteModal.d.ts +15 -0
  44. package/dist/core/websiteModal.d.ts.map +1 -1
  45. package/dist/editor/MapEditor.d.ts.map +1 -1
  46. package/dist/editor/assignmentOverlay.d.ts +37 -0
  47. package/dist/editor/assignmentOverlay.d.ts.map +1 -0
  48. package/dist/editor/canvas/AssignedShapeOverlay.d.ts +8 -0
  49. package/dist/editor/canvas/AssignedShapeOverlay.d.ts.map +1 -0
  50. package/dist/editor/canvas/EditorCanvas.d.ts +6 -1
  51. package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
  52. package/dist/editor/canvas/coords.d.ts +9 -0
  53. package/dist/editor/canvas/coords.d.ts.map +1 -1
  54. package/dist/editor/canvas/editorFill.d.ts.map +1 -1
  55. package/dist/editor/canvas/editorHover.d.ts +4 -0
  56. package/dist/editor/canvas/editorHover.d.ts.map +1 -1
  57. package/dist/editor/draftOps.d.ts.map +1 -1
  58. package/dist/editor/entranceIcon.d.ts +2 -2
  59. package/dist/editor/entranceIcon.d.ts.map +1 -1
  60. package/dist/editor/index.css +369 -87
  61. package/dist/editor/index.js +4735 -4328
  62. package/dist/editor/index.js.map +1 -1
  63. package/dist/editor/panels/AssignForm.d.ts +4 -3
  64. package/dist/editor/panels/AssignForm.d.ts.map +1 -1
  65. package/dist/editor/panels/BulkAssignForm.d.ts +3 -1
  66. package/dist/editor/panels/BulkAssignForm.d.ts.map +1 -1
  67. package/dist/editor/panels/ConnectorAssign.d.ts.map +1 -1
  68. package/dist/editor/panels/FloorsPanel.d.ts.map +1 -1
  69. package/dist/editor/panels/Inspector.d.ts +4 -2
  70. package/dist/editor/panels/Inspector.d.ts.map +1 -1
  71. package/dist/editor/panels/LeftRail.d.ts.map +1 -1
  72. package/dist/editor/routeStubs.d.ts +11 -0
  73. package/dist/editor/routeStubs.d.ts.map +1 -1
  74. package/dist/specialIcons.d.ts +22 -1
  75. package/dist/specialIcons.d.ts.map +1 -1
  76. package/dist/test-maps/LF - Shops At South Town.ai +4468 -1
  77. package/dist/test-maps/LF - Shops At South Town.svg +245 -0
  78. package/dist/test-maps/shops-at-south-town/SVG/escalator.svg +13 -0
  79. package/dist/viewer/MapViewer.d.ts.map +1 -1
  80. package/dist/viewer/camera.d.ts +10 -0
  81. package/dist/viewer/camera.d.ts.map +1 -1
  82. package/dist/viewer/components/CameraRig.d.ts.map +1 -1
  83. package/dist/viewer/components/LevelMeshes.d.ts +12 -2
  84. package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
  85. package/dist/viewer/components/MapScene.d.ts +5 -2
  86. package/dist/viewer/components/MapScene.d.ts.map +1 -1
  87. package/dist/viewer/components/RouteLine.d.ts +28 -9
  88. package/dist/viewer/components/RouteLine.d.ts.map +1 -1
  89. package/dist/viewer/components/SvgVectorLayer.d.ts +1 -1
  90. package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -1
  91. package/dist/viewer/index.css +319 -62
  92. package/dist/viewer/index.js +1 -1
  93. package/dist/viewer/pointer.d.ts +42 -6
  94. package/dist/viewer/pointer.d.ts.map +1 -1
  95. package/dist/viewer/routeFloorChanges.d.ts +33 -0
  96. package/dist/viewer/routeFloorChanges.d.ts.map +1 -0
  97. package/dist/viewer/ui/HoverTooltip.d.ts +6 -0
  98. package/dist/viewer/ui/HoverTooltip.d.ts.map +1 -0
  99. package/dist/viewer/ui/MapControls.d.ts.map +1 -1
  100. package/dist/viewer/ui/RuntimeChrome.d.ts +2 -1
  101. package/dist/viewer/ui/RuntimeChrome.d.ts.map +1 -1
  102. package/dist/viewer/ui/WebsiteInfoModal.d.ts +3 -2
  103. package/dist/viewer/ui/WebsiteInfoModal.d.ts.map +1 -1
  104. package/package.json +1 -1
  105. package/dist/chunks/stacking.js +0 -2243
  106. package/dist/chunks/stacking.js.map +0 -1
@@ -1,170 +1,170 @@
1
- import { bb as M, aM as b, aL as _, aG as L, aO as $, bp as N, d as x, i as O, a$ as S, ad as y, bg as k, be as T } from "./stacking.js";
2
- function H(e, u, r) {
3
- var o, i, a, l;
4
- const s = M(e), t = [];
5
- for (const n of s.elements) {
6
- if (!n.d || n.interactive || u != null && u.has(n.id) || /^parking[-_]?lines?(?:[-_]|$)/i.test(n.id) || n.id.toLowerCase().startsWith("route-path") || b(n.id) || _(n.id) || L(n.id) || $(n.id)) continue;
7
- const d = N(n.id, r), m = (d == null ? void 0 : d.fill) ?? ((o = n.style) == null ? void 0 : o.fill), I = (d == null ? void 0 : d.stroke) ?? ((i = n.style) == null ? void 0 : i.stroke), h = (d == null ? void 0 : d.strokeWidth) ?? ((a = n.style) == null ? void 0 : a.strokeWidth);
1
+ import { bB as S, b4 as w, b2 as M, aZ as _, b6 as L, bP as O, aQ as $, B as F, c6 as N, d as y, bn as E, aq as k, bG as x, bE as T, k as W } from "./responsive.js";
2
+ function V(e, d, r) {
3
+ var i, o, u, a;
4
+ const c = S(e), t = [];
5
+ for (const n of c.elements) {
6
+ if (!n.d || n.interactive || d != null && d.has(n.id) || /^parking[-_]?lines?(?:[-_]|$)/i.test(n.id) || n.id.toLowerCase().startsWith("route-path") || w(n.id) || M(n.id) || _(n.id) || L(n.id)) continue;
7
+ const f = O(n.id, r), I = (f == null ? void 0 : f.fill) ?? ($(n.id) ? F(r) : (i = n.style) == null ? void 0 : i.fill), l = (f == null ? void 0 : f.stroke) ?? ((o = n.style) == null ? void 0 : o.stroke), m = (f == null ? void 0 : f.strokeWidth) ?? ((u = n.style) == null ? void 0 : u.strokeWidth);
8
8
  t.push({
9
9
  id: n.id,
10
10
  d: n.d,
11
- fill: m && m !== "none" ? m : void 0,
12
- stroke: I && I !== "none" ? I : void 0,
13
- strokeWidth: h,
14
- opacity: (l = n.style) == null ? void 0 : l.opacity
11
+ fill: I && I !== "none" ? I : void 0,
12
+ stroke: l && l !== "none" ? l : void 0,
13
+ strokeWidth: m,
14
+ opacity: (a = n.style) == null ? void 0 : a.opacity
15
15
  });
16
16
  }
17
- return t;
17
+ return N(t, (n) => n.id);
18
18
  }
19
- function W(e, u, r, s = x) {
19
+ function P(e, d, r, c = y) {
20
20
  const t = e.filter((n) => r.includes(n.id));
21
21
  if (t.length < 2) return null;
22
- const o = t.reduce((n, d) => d.id < n.id ? d : n), i = [];
22
+ const i = t.reduce((n, f) => f.id < n.id ? f : n), o = [];
23
23
  for (const n of t)
24
- n.id !== o.id && y(n, o) <= s && i.push(n.id);
25
- if (i.length === 0) return null;
26
- const a = new Set(i), l = [];
27
- for (const n of u) {
28
- let d = !1;
29
- if (a.has(n.fromAnchorId) && (n.fromAnchorId = o.id, d = !0), a.has(n.toAnchorId) && (n.toAnchorId = o.id, d = !0), n.fromAnchorId === n.toAnchorId) {
30
- l.push(n.id);
24
+ n.id !== i.id && k(n, i) <= c && o.push(n.id);
25
+ if (o.length === 0) return null;
26
+ const u = new Set(o), a = [];
27
+ for (const n of d) {
28
+ let f = !1;
29
+ if (u.has(n.fromAnchorId) && (n.fromAnchorId = i.id, f = !0), u.has(n.toAnchorId) && (n.toAnchorId = i.id, f = !0), n.fromAnchorId === n.toAnchorId) {
30
+ a.push(n.id);
31
31
  continue;
32
32
  }
33
- d && l.push(n.id);
33
+ f && a.push(n.id);
34
34
  }
35
35
  return {
36
- survivingAnchorId: o.id,
37
- removedAnchorIds: i,
38
- rewiredEdgeIds: l
36
+ survivingAnchorId: i.id,
37
+ removedAnchorIds: o,
38
+ rewiredEdgeIds: a
39
39
  };
40
40
  }
41
- function F(e, u = x) {
42
- const r = [], s = /* @__PURE__ */ new Set();
41
+ function D(e, d = y) {
42
+ const r = [], c = /* @__PURE__ */ new Set();
43
43
  for (let t = 0; t < e.length; t++) {
44
- if (s.has(e[t].id)) continue;
45
- const o = [e[t].id];
46
- for (let i = t + 1; i < e.length; i++)
47
- s.has(e[i].id) || e[t].levelId === e[i].levelId && y(e[t], e[i]) <= u && (o.push(e[i].id), s.add(e[i].id));
48
- o.length > 1 && (s.add(e[t].id), r.push(o));
44
+ if (c.has(e[t].id)) continue;
45
+ const i = [e[t].id];
46
+ for (let o = t + 1; o < e.length; o++)
47
+ c.has(e[o].id) || e[t].levelId === e[o].levelId && k(e[t], e[o]) <= d && (i.push(e[o].id), c.add(e[o].id));
48
+ i.length > 1 && (c.add(e[t].id), r.push(i));
49
49
  }
50
50
  return r;
51
51
  }
52
- function D(e, u, r = x) {
53
- const s = e.slice(), t = u.map((n) => ({ ...n })), o = /* @__PURE__ */ new Set();
54
- for (const n of F(s, r)) {
55
- const d = W(s, t, n, r);
56
- if (d)
57
- for (const m of d.removedAnchorIds) o.add(m);
52
+ function R(e, d, r = y) {
53
+ const c = e.slice(), t = d.map((n) => ({ ...n })), i = /* @__PURE__ */ new Set();
54
+ for (const n of D(c, r)) {
55
+ const f = P(c, t, n, r);
56
+ if (f)
57
+ for (const I of f.removedAnchorIds) i.add(I);
58
58
  }
59
- const i = s.filter((n) => !o.has(n.id)), a = /* @__PURE__ */ new Set(), l = [];
59
+ const o = c.filter((n) => !i.has(n.id)), u = /* @__PURE__ */ new Set(), a = [];
60
60
  for (const n of t) {
61
- if (o.has(n.fromAnchorId) || o.has(n.toAnchorId) || n.fromAnchorId === n.toAnchorId) continue;
62
- const d = Math.min(n.fromAnchorId, n.toAnchorId), m = Math.max(n.fromAnchorId, n.toAnchorId), I = `${d}|${m}`;
63
- a.has(I) || (a.add(I), l.push(n));
61
+ if (i.has(n.fromAnchorId) || i.has(n.toAnchorId) || n.fromAnchorId === n.toAnchorId) continue;
62
+ const f = Math.min(n.fromAnchorId, n.toAnchorId), I = Math.max(n.fromAnchorId, n.toAnchorId), l = `${f}|${I}`;
63
+ u.has(l) || (u.add(l), a.push(n));
64
64
  }
65
- return { anchors: i, edges: l };
65
+ return { anchors: o, edges: a };
66
66
  }
67
- function V(e, u, r, s = x) {
67
+ function Y(e, d, r, c = y) {
68
68
  let t = null;
69
- for (const i of u) {
70
- const a = S(e, i);
71
- a && (!t || a.distance < t.distance) && (t = { point: a.point, distance: a.distance });
69
+ for (const o of d) {
70
+ const u = E(e, o);
71
+ u && (!t || u.distance < t.distance) && (t = { point: u.point, distance: u.distance });
72
72
  }
73
73
  if (!t) return null;
74
- const o = r.find(
75
- (i) => i.levelId === e.levelId && y(i, t.point) <= s
74
+ const i = r.find(
75
+ (o) => o.levelId === e.levelId && k(o, t.point) <= c
76
76
  );
77
77
  return {
78
78
  unitAnchorId: e.id,
79
- junctionAnchor: o ? { x: o.x, y: o.y, existingId: o.id } : { x: t.point.x, y: t.point.y },
79
+ junctionAnchor: i ? { x: i.x, y: i.y, existingId: i.id } : { x: t.point.x, y: t.point.y },
80
80
  edge: {
81
81
  fromAnchorId: e.id,
82
- toAnchorId: o == null ? void 0 : o.id
82
+ toAnchorId: i == null ? void 0 : i.id
83
83
  }
84
84
  };
85
85
  }
86
- function Y(e, u, r, s) {
86
+ function q(e, d, r, c) {
87
87
  if (r.length === 0) return null;
88
88
  const t = r.flat();
89
89
  if (t.length === 0) return null;
90
- let o = 0, i = 0;
90
+ let i = 0, o = 0;
91
91
  for (const n of t)
92
- o += n.x, i += n.y;
93
- const a = { x: o / t.length, y: i / t.length }, l = k(a, r) ? a : t[0];
92
+ i += n.x, o += n.y;
93
+ const u = { x: i / t.length, y: o / t.length }, a = x(u, r) ? u : t[0];
94
94
  return {
95
- id: s,
96
- levelId: u,
95
+ id: c,
96
+ levelId: d,
97
97
  shapeId: e,
98
98
  kind: "unit",
99
- x: l.x,
100
- y: l.y,
99
+ x: a.x,
100
+ y: a.y,
101
101
  connectorId: null
102
102
  };
103
103
  }
104
- function U(e, u, r = 20) {
104
+ function X(e, d, r = 20) {
105
105
  if (e.length === 0)
106
106
  return { anchors: [], edges: [] };
107
- let s = 1 / 0, t = 1 / 0, o = -1 / 0, i = -1 / 0;
108
- for (const f of e)
109
- for (const c of f)
110
- s = Math.min(s, c.x), t = Math.min(t, c.y), o = Math.max(o, c.x), i = Math.max(i, c.y);
111
- const a = Math.max(1, Math.ceil((o - s) / r)), l = Math.max(1, Math.ceil((i - t) / r)), n = [];
112
- for (let f = 0; f < l; f++)
113
- for (let c = 0; c < a; c++) {
114
- const g = s + (c + 0.5) * r, p = t + (f + 0.5) * r, A = { x: g, y: p };
115
- k(A, e) && (u.length > 0 && k(A, u) || n.push({ key: `${c},${f}`, x: g, y: p, col: c, row: f }));
107
+ let c = 1 / 0, t = 1 / 0, i = -1 / 0, o = -1 / 0;
108
+ for (const s of e)
109
+ for (const h of s)
110
+ c = Math.min(c, h.x), t = Math.min(t, h.y), i = Math.max(i, h.x), o = Math.max(o, h.y);
111
+ const u = Math.max(1, Math.ceil((i - c) / r)), a = Math.max(1, Math.ceil((o - t) / r)), n = [];
112
+ for (let s = 0; s < a; s++)
113
+ for (let h = 0; h < u; h++) {
114
+ const p = c + (h + 0.5) * r, g = t + (s + 0.5) * r, A = { x: p, y: g };
115
+ x(A, e) && (d.length > 0 && x(A, d) || n.push({ key: `${h},${s}`, x: p, y: g, col: h, row: s }));
116
116
  }
117
- const d = new Map(n.map((f) => [f.key, f])), m = n.map((f) => ({
118
- tempId: f.key,
119
- x: f.x,
120
- y: f.y,
117
+ const f = new Map(n.map((s) => [s.key, s])), I = n.map((s) => ({
118
+ tempId: s.key,
119
+ x: s.x,
120
+ y: s.y,
121
121
  kind: "junction"
122
- })), I = [], h = /* @__PURE__ */ new Set();
123
- for (const f of n) {
124
- const c = [
125
- [f.col + 1, f.row],
126
- [f.col, f.row + 1]
122
+ })), l = [], m = /* @__PURE__ */ new Set();
123
+ for (const s of n) {
124
+ const h = [
125
+ [s.col + 1, s.row],
126
+ [s.col, s.row + 1]
127
127
  ];
128
- for (const [g, p] of c) {
129
- const A = `${g},${p}`;
130
- if (!d.has(A)) continue;
131
- const v = f.key < A ? `${f.key}|${A}` : `${A}|${f.key}`;
132
- h.has(v) || (h.add(v), I.push({ fromTempId: f.key, toTempId: A }));
128
+ for (const [p, g] of h) {
129
+ const A = `${p},${g}`;
130
+ if (!f.has(A)) continue;
131
+ const v = s.key < A ? `${s.key}|${A}` : `${A}|${s.key}`;
132
+ m.has(v) || (m.add(v), l.push({ fromTempId: s.key, toTempId: A }));
133
133
  }
134
134
  }
135
- return { anchors: m, edges: I };
135
+ return { anchors: I, edges: l };
136
136
  }
137
- function X(e, u, r, s, t = x) {
138
- const o = [], i = [];
139
- let a = s;
140
- const l = (d, m) => {
141
- const I = o.find(
142
- (f) => y(f, { x: d, y: m }) <= t
137
+ function Z(e, d, r, c, t = y) {
138
+ const i = [], o = [];
139
+ let u = c;
140
+ const a = (f, I) => {
141
+ const l = i.find(
142
+ (s) => k(s, { x: f, y: I }) <= t
143
143
  );
144
- if (I) return I.id;
145
- const h = a++;
146
- return o.push({
147
- id: h,
148
- levelId: u,
144
+ if (l) return l.id;
145
+ const m = u++;
146
+ return i.push({
147
+ id: m,
148
+ levelId: d,
149
149
  shapeId: null,
150
150
  kind: "junction",
151
- x: d,
152
- y: m,
151
+ x: f,
152
+ y: I,
153
153
  connectorId: null
154
- }), h;
154
+ }), m;
155
155
  };
156
- for (const d of e) {
157
- const m = T(d);
158
- for (const I of m)
159
- for (let h = 0; h < I.length - 1; h++) {
160
- const f = l(I[h].x, I[h].y), c = l(I[h + 1].x, I[h + 1].y);
161
- f === c || i.some(
162
- (p) => p.fromAnchorId === f && p.toAnchorId === c || p.fromAnchorId === c && p.toAnchorId === f
163
- ) || i.push({
164
- id: a++,
156
+ for (const f of e) {
157
+ const I = T(f);
158
+ for (const l of I)
159
+ for (let m = 0; m < l.length - 1; m++) {
160
+ const s = a(l[m].x, l[m].y), h = a(l[m + 1].x, l[m + 1].y);
161
+ s === h || o.some(
162
+ (g) => g.fromAnchorId === s && g.toAnchorId === h || g.fromAnchorId === h && g.toAnchorId === s
163
+ ) || o.push({
164
+ id: u++,
165
165
  mapId: r,
166
- fromAnchorId: f,
167
- toAnchorId: c,
166
+ fromAnchorId: s,
167
+ toAnchorId: h,
168
168
  weight: null,
169
169
  directed: !1,
170
170
  accessible: !0,
@@ -172,88 +172,74 @@ function X(e, u, r, s, t = x) {
172
172
  });
173
173
  }
174
174
  }
175
- const n = D(o, i, t);
176
- return { anchors: n.anchors, edges: n.edges, nextId: a };
175
+ const n = R(i, o, t);
176
+ return { anchors: n.anchors, edges: n.edges, nextId: u };
177
177
  }
178
- function P(e) {
178
+ function C(e) {
179
179
  return e === "entrance" ? "entrance" : e === "connector" ? "connector" : "unit";
180
180
  }
181
- function R(e) {
181
+ function K(e) {
182
182
  return e === "entrance" ? "entrance_link" : "unit_link";
183
183
  }
184
- function C(e, u, r) {
185
- if (k(e, u)) return "inside";
186
- for (const s of u) {
187
- if (s.length < 2) continue;
188
- const t = [...s, s[0]], o = S(e, t);
189
- if (o && o.distance <= r) return "near";
184
+ function B(e, d, r) {
185
+ if (x(e, d)) return "inside";
186
+ for (const c of d) {
187
+ if (c.length < 2) continue;
188
+ const t = [...c, c[0]], i = E(e, t);
189
+ if (i && i.distance <= r) return "near";
190
190
  }
191
191
  return null;
192
192
  }
193
- function E(e, u, r) {
194
- if (e.length === 0) return null;
195
- const s = e.filter((o) => (u.get(o.id) ?? 0) <= 1);
196
- return [...s.length > 0 ? s : e].sort((o, i) => y(o, r) - y(i, r))[0] ?? null;
193
+ function G(e, d, r) {
194
+ let c = null;
195
+ for (const t of d) {
196
+ if (!W.includes(t.kind)) continue;
197
+ const i = t.geometry.polygons ?? [];
198
+ if (i.length === 0) continue;
199
+ const o = B(e, i, r);
200
+ if (o === "inside") return t;
201
+ o === "near" && c == null && (c = t);
202
+ }
203
+ return c;
197
204
  }
198
- function q(e, u, r, s = x * 3) {
205
+ function Q(e, d, r, c = y * 3) {
199
206
  const t = /* @__PURE__ */ new Map();
200
- for (const l of u)
201
- t.set(l.fromAnchorId, (t.get(l.fromAnchorId) ?? 0) + 1), t.set(l.toAnchorId, (t.get(l.toAnchorId) ?? 0) + 1);
202
- const o = e.filter((l) => l.shapeId == null), i = /* @__PURE__ */ new Set();
203
- let a = 0;
204
- for (const l of r) {
205
- if (!O.includes(l.kind)) continue;
206
- const n = l.geometry.polygons ?? [];
207
- if (n.length === 0) continue;
208
- const d = o.filter((c) => !i.has(c.id)).map((c) => ({
209
- anchor: c,
210
- hit: C(c, n, s)
211
- })).filter(
212
- (c) => c.hit != null
213
- );
214
- if (d.length === 0) continue;
215
- const m = n.flat(), I = {
216
- x: m.reduce((c, g) => c + g.x, 0) / m.length,
217
- y: m.reduce((c, g) => c + g.y, 0) / m.length
218
- }, h = E(
219
- d.filter((c) => c.hit === "inside").map((c) => c.anchor),
220
- t,
221
- I
222
- ) ?? E(
223
- d.filter((c) => c.hit === "near").map((c) => c.anchor),
224
- t,
225
- I
226
- );
227
- if (!h || (h.shapeId = l.id, h.kind = P(l.kind), i.add(h.id), a += 1, (t.get(h.id) ?? 0) > 1)) continue;
228
- const f = R(h.kind);
229
- for (const c of u)
230
- (c.fromAnchorId === h.id || c.toAnchorId === h.id) && (c.kind = f);
207
+ for (const o of d)
208
+ t.set(o.fromAnchorId, (t.get(o.fromAnchorId) ?? 0) + 1), t.set(o.toAnchorId, (t.get(o.toAnchorId) ?? 0) + 1);
209
+ let i = 0;
210
+ for (const o of e) {
211
+ if (o.shapeId != null) continue;
212
+ const u = G(o, r, c);
213
+ if (!u || (o.shapeId = u.id, o.kind = C(u.kind), i += 1, (t.get(o.id) ?? 0) > 1)) continue;
214
+ const a = K(o.kind);
215
+ for (const n of d)
216
+ (n.fromAnchorId === o.id || n.toAnchorId === o.id) && (n.kind = a);
231
217
  }
232
- return a;
218
+ return i;
233
219
  }
234
- const K = 0.95, w = 1;
235
- function G(e = w) {
236
- return Math.pow(K, e);
220
+ const H = 0.95, b = 1;
221
+ function j(e = b) {
222
+ return Math.pow(H, e);
237
223
  }
238
- function B(e, u, r) {
239
- if (u === 0) return e;
240
- const s = G((r == null ? void 0 : r.zoomSpeed) ?? w), t = u < 0 ? e / s : e * s, o = (r == null ? void 0 : r.min) ?? Number.NEGATIVE_INFINITY, i = (r == null ? void 0 : r.max) ?? Number.POSITIVE_INFINITY;
241
- return Math.min(i, Math.max(o, t));
224
+ function J(e, d, r) {
225
+ if (d === 0) return e;
226
+ const c = j((r == null ? void 0 : r.zoomSpeed) ?? b), t = d < 0 ? e / c : e * c, i = (r == null ? void 0 : r.min) ?? Number.NEGATIVE_INFINITY, o = (r == null ? void 0 : r.max) ?? Number.POSITIVE_INFINITY;
227
+ return Math.min(o, Math.max(i, t));
242
228
  }
243
229
  export {
244
- K as W,
245
- w as a,
246
- q as b,
247
- V as c,
248
- U as d,
249
- D as e,
250
- F as f,
251
- G as g,
252
- X as i,
253
- B as n,
254
- H as o,
255
- P as r,
256
- Y as u,
257
- W as w
230
+ H as W,
231
+ b as a,
232
+ Q as b,
233
+ Y as c,
234
+ X as d,
235
+ R as e,
236
+ D as f,
237
+ j as g,
238
+ Z as i,
239
+ J as n,
240
+ V as o,
241
+ C as r,
242
+ q as u,
243
+ P as w
258
244
  };
259
245
  //# sourceMappingURL=wheelZoom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wheelZoom.js","sources":["../../src/core/outdoorDecoration.ts","../../src/core/routing/graph-tools.ts","../../src/core/wheelZoom.ts"],"sourcesContent":["import {\n parseSvgString,\n isInteractiveGroupLabel,\n isRouteFolderLabel,\n isRoutePathLabel,\n isStoreFolderLabel,\n} from './import';\nimport { resolveLayerStyle, type StaticLayerTheme } from './layerStyles';\n\nexport interface OutdoorDecorationPath {\n id: string;\n d: string;\n fill?: string;\n stroke?: string;\n strokeWidth?: number;\n opacity?: number;\n}\n\n/**\n * Paths the assign viewer draws from the live outdoor SVG: house-style\n * decoration (green area, parking lanes, icons) and any other\n * non-interactive art. Interactive / store folders stay out — those are\n * `cm_shapes` rows.\n */\nexport function outdoorDecorationFromSvg(\n svgText: string,\n suppressIds?: ReadonlySet<string>,\n theme?: StaticLayerTheme | null,\n): OutdoorDecorationPath[] {\n const parsed = parseSvgString(svgText);\n const out: OutdoorDecorationPath[] = [];\n for (const el of parsed.elements) {\n if (!el.d) continue;\n if (el.interactive) continue;\n if (suppressIds?.has(el.id)) continue;\n if (/^parking[-_]?lines?(?:[-_]|$)/i.test(el.id)) continue;\n if (el.id.toLowerCase().startsWith('route-path')) continue;\n if (isRoutePathLabel(el.id) || isRouteFolderLabel(el.id)) continue;\n if (isInteractiveGroupLabel(el.id) || isStoreFolderLabel(el.id)) continue;\n\n const layer = resolveLayerStyle(el.id, theme);\n const fill = layer?.fill ?? el.style?.fill;\n const stroke = layer?.stroke ?? el.style?.stroke;\n const strokeWidth = layer?.strokeWidth ?? el.style?.strokeWidth;\n out.push({\n id: el.id,\n d: el.d,\n fill: fill && fill !== 'none' ? fill : undefined,\n stroke: stroke && stroke !== 'none' ? stroke : undefined,\n strokeWidth,\n opacity: el.style?.opacity,\n });\n }\n return out;\n}\n","import type {\n AnchorKind,\n AutoConnectResult,\n CmAnchor,\n CmRouteEdge,\n ShapeGeometry,\n ShapeKind,\n SkeletonSuggestion,\n Vec2,\n WeldResult,\n} from '../types';\nimport { DEFAULT_WELD_TOLERANCE, INTERACTIVE_SHAPE_KINDS } from '../types';\nimport {\n distance,\n nearestPointOnPolyline,\n pathToPolygons,\n pointInPolygons,\n} from '../geometry';\n\nexport interface AnchorLike {\n id: number;\n x: number;\n y: number;\n levelId: number;\n shapeId?: number | null;\n kind?: string;\n}\n\nexport interface EdgeLike {\n id: number;\n fromAnchorId: number;\n toAnchorId: number;\n}\n\n/**\n * Weld anchors within tolerance into the surviving (lowest id) anchor.\n * Rewires edges that referenced removed anchors.\n */\nexport function weldAnchors(\n anchors: AnchorLike[],\n edges: EdgeLike[],\n candidateIds: number[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): WeldResult | null {\n const candidates = anchors.filter((a) => candidateIds.includes(a.id));\n if (candidates.length < 2) return null;\n\n // Cluster by proximity from the first candidate's position centroid of group\n const surviving = candidates.reduce((min, a) => (a.id < min.id ? a : min));\n const removed: number[] = [];\n\n for (const a of candidates) {\n if (a.id === surviving.id) continue;\n if (distance(a, surviving) <= tolerance) {\n removed.push(a.id);\n }\n }\n\n if (removed.length === 0) return null;\n\n const removedSet = new Set(removed);\n const rewired: number[] = [];\n\n for (const edge of edges) {\n let changed = false;\n if (removedSet.has(edge.fromAnchorId)) {\n edge.fromAnchorId = surviving.id;\n changed = true;\n }\n if (removedSet.has(edge.toAnchorId)) {\n edge.toAnchorId = surviving.id;\n changed = true;\n }\n // Drop self-loops\n if (edge.fromAnchorId === edge.toAnchorId) {\n rewired.push(edge.id);\n continue;\n }\n if (changed) rewired.push(edge.id);\n }\n\n return {\n survivingAnchorId: surviving.id,\n removedAnchorIds: removed,\n rewiredEdgeIds: rewired,\n };\n}\n\n/**\n * Find all pairs of anchors within tolerance that should be welded.\n */\nexport function findWeldCandidates(\n anchors: AnchorLike[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): number[][] {\n const groups: number[][] = [];\n const used = new Set<number>();\n\n for (let i = 0; i < anchors.length; i++) {\n if (used.has(anchors[i].id)) continue;\n const group = [anchors[i].id];\n for (let j = i + 1; j < anchors.length; j++) {\n if (used.has(anchors[j].id)) continue;\n if (\n anchors[i].levelId === anchors[j].levelId &&\n distance(anchors[i], anchors[j]) <= tolerance\n ) {\n group.push(anchors[j].id);\n used.add(anchors[j].id);\n }\n }\n if (group.length > 1) {\n used.add(anchors[i].id);\n groups.push(group);\n }\n }\n return groups;\n}\n\n/**\n * Merge coincident anchors and drop overlapping undirected edges.\n * Two SVG imports of the same ROUTES layer stack a second copy on top of\n * the first — dragging one junction then leaves the twin behind.\n */\nexport function collapseDuplicateRouteGraph<\n A extends AnchorLike,\n E extends EdgeLike,\n>(\n anchors: A[],\n edges: E[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): { anchors: A[]; edges: E[] } {\n const nextAnchors = anchors.slice();\n const nextEdges = edges.map((edge) => ({ ...edge }));\n const removed = new Set<number>();\n for (const group of findWeldCandidates(nextAnchors, tolerance)) {\n const result = weldAnchors(nextAnchors, nextEdges, group, tolerance);\n if (!result) continue;\n for (const id of result.removedAnchorIds) removed.add(id);\n }\n const alive = nextAnchors.filter((anchor) => !removed.has(anchor.id));\n const seen = new Set<string>();\n const uniqueEdges: E[] = [];\n for (const edge of nextEdges) {\n if (removed.has(edge.fromAnchorId) || removed.has(edge.toAnchorId)) continue;\n if (edge.fromAnchorId === edge.toAnchorId) continue;\n const lo = Math.min(edge.fromAnchorId, edge.toAnchorId);\n const hi = Math.max(edge.fromAnchorId, edge.toAnchorId);\n const key = `${lo}|${hi}`;\n if (seen.has(key)) continue;\n seen.add(key);\n uniqueEdges.push(edge);\n }\n return { anchors: alive, edges: uniqueEdges };\n}\n\n/**\n * Auto-connect a unit anchor to the nearest walkable segment via perpendicular projection.\n */\nexport function autoConnectUnitAnchor(\n unitAnchor: AnchorLike,\n walkablePolylines: Vec2[][],\n existingJunctions: AnchorLike[],\n weldTolerance = DEFAULT_WELD_TOLERANCE,\n): AutoConnectResult | null {\n let best: { point: Vec2; distance: number } | null = null;\n\n for (const line of walkablePolylines) {\n const hit = nearestPointOnPolyline(unitAnchor, line);\n if (hit && (!best || hit.distance < best.distance)) {\n best = { point: hit.point, distance: hit.distance };\n }\n }\n\n if (!best) return null;\n\n // Reuse existing junction if within weld tolerance\n const existing = existingJunctions.find(\n (j) =>\n j.levelId === unitAnchor.levelId &&\n distance(j, best!.point) <= weldTolerance,\n );\n\n return {\n unitAnchorId: unitAnchor.id,\n junctionAnchor: existing\n ? { x: existing.x, y: existing.y, existingId: existing.id }\n : { x: best.point.x, y: best.point.y },\n edge: {\n fromAnchorId: unitAnchor.id,\n toAnchorId: existing?.id,\n },\n };\n}\n\n/**\n * Place a unit anchor at the centroid of a shape's polygons, if the point lies inside.\n */\nexport function unitAnchorFromShape(\n shapeId: number,\n levelId: number,\n polygons: Vec2[][],\n tempId: number,\n): CmAnchor | null {\n if (polygons.length === 0) return null;\n const flat = polygons.flat();\n if (flat.length === 0) return null;\n\n let sx = 0;\n let sy = 0;\n for (const p of flat) {\n sx += p.x;\n sy += p.y;\n }\n const c = { x: sx / flat.length, y: sy / flat.length };\n\n // Prefer centroid if inside; otherwise use first polygon's average of extremes\n const point = pointInPolygons(c, polygons) ? c : flat[0];\n\n return {\n id: tempId,\n levelId,\n shapeId,\n kind: 'unit',\n x: point.x,\n y: point.y,\n connectorId: null,\n };\n}\n\n/**\n * Build a simple medial-axis-ish skeleton from walkable polygons minus voids.\n * This is a pragmatic approximation: sample a grid inside walkable, reject void cells,\n * connect adjacent free cells into a sparse graph, then prune to a polyline network.\n */\nexport function buildAutoSkeleton(\n walkablePolygons: Vec2[][],\n voidPolygons: Vec2[][],\n cellSize = 20,\n): SkeletonSuggestion {\n if (walkablePolygons.length === 0) {\n return { anchors: [], edges: [] };\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const poly of walkablePolygons) {\n for (const p of poly) {\n minX = Math.min(minX, p.x);\n minY = Math.min(minY, p.y);\n maxX = Math.max(maxX, p.x);\n maxY = Math.max(maxY, p.y);\n }\n }\n\n const cols = Math.max(1, Math.ceil((maxX - minX) / cellSize));\n const rows = Math.max(1, Math.ceil((maxY - minY) / cellSize));\n const free: Array<{ key: string; x: number; y: number; col: number; row: number }> = [];\n\n for (let row = 0; row < rows; row++) {\n for (let col = 0; col < cols; col++) {\n const x = minX + (col + 0.5) * cellSize;\n const y = minY + (row + 0.5) * cellSize;\n const pt = { x, y };\n if (!pointInPolygons(pt, walkablePolygons)) continue;\n if (voidPolygons.length > 0 && pointInPolygons(pt, voidPolygons)) continue;\n free.push({ key: `${col},${row}`, x, y, col, row });\n }\n }\n\n const byKey = new Map(free.map((c) => [c.key, c]));\n const anchors = free.map((c) => ({\n tempId: c.key,\n x: c.x,\n y: c.y,\n kind: 'junction' as const,\n }));\n\n const edges: Array<{ fromTempId: string; toTempId: string }> = [];\n const seen = new Set<string>();\n\n for (const cell of free) {\n const neighbors = [\n [cell.col + 1, cell.row],\n [cell.col, cell.row + 1],\n ];\n for (const [nc, nr] of neighbors) {\n const nk = `${nc},${nr}`;\n if (!byKey.has(nk)) continue;\n const edgeKey = cell.key < nk ? `${cell.key}|${nk}` : `${nk}|${cell.key}`;\n if (seen.has(edgeKey)) continue;\n seen.add(edgeKey);\n edges.push({ fromTempId: cell.key, toTempId: nk });\n }\n }\n\n return { anchors, edges };\n}\n\n/**\n * Convert route-path SVG line endpoints into welded anchors + edges.\n * This is the key converter step that repairs coincident-but-disconnected joins.\n *\n * Anchors land in raw SVG user space (Y down), the same space as shape\n * geometry. There is intentionally no viewbox-height flip here — mirroring\n * routes without mirroring shapes would silently desynchronise the two.\n */\nexport function importRoutePaths(\n pathDs: string[],\n levelId: number,\n mapId: number,\n startId: number,\n weldTolerance = DEFAULT_WELD_TOLERANCE,\n): { anchors: CmAnchor[]; edges: CmRouteEdge[]; nextId: number } {\n const anchors: CmAnchor[] = [];\n const edges: CmRouteEdge[] = [];\n let nextId = startId;\n\n const findOrCreate = (x: number, y: number): number => {\n const existing = anchors.find(\n (a) => distance(a, { x, y }) <= weldTolerance,\n );\n if (existing) return existing.id;\n const id = nextId++;\n anchors.push({\n id,\n levelId,\n shapeId: null,\n kind: 'junction',\n x,\n y,\n connectorId: null,\n });\n return id;\n };\n\n for (const d of pathDs) {\n const polys = pathToPolygons(d);\n for (const poly of polys) {\n for (let i = 0; i < poly.length - 1; i++) {\n const a = findOrCreate(poly[i].x, poly[i].y);\n const b = findOrCreate(poly[i + 1].x, poly[i + 1].y);\n if (a === b) continue;\n // Avoid duplicate edges\n const dup = edges.some(\n (e) =>\n (e.fromAnchorId === a && e.toAnchorId === b) ||\n (e.fromAnchorId === b && e.toAnchorId === a),\n );\n if (dup) continue;\n edges.push({\n id: nextId++,\n mapId,\n fromAnchorId: a,\n toAnchorId: b,\n weight: null,\n directed: false,\n accessible: true,\n kind: 'walk',\n });\n }\n }\n }\n\n const collapsed = collapseDuplicateRouteGraph(anchors, edges, weldTolerance);\n return { anchors: collapsed.anchors, edges: collapsed.edges, nextId };\n}\n\nexport function routeAnchorKindForShape(kind: ShapeKind): AnchorKind {\n if (kind === 'entrance') return 'entrance';\n if (kind === 'connector') return 'connector';\n return 'unit';\n}\n\nfunction routeLinkKind(kind: AnchorKind): CmRouteEdge['kind'] {\n return kind === 'entrance' ? 'entrance_link' : 'unit_link';\n}\n\n/** `inside` matches v1's store-mesh hit; `near` is a door-step fallback. */\nfunction pointOnPolygons(\n point: Vec2,\n polygons: Vec2[][],\n tolerance: number,\n): 'inside' | 'near' | null {\n if (pointInPolygons(point, polygons)) return 'inside';\n for (const poly of polygons) {\n if (poly.length < 2) continue;\n const closed = [...poly, poly[0]];\n const hit = nearestPointOnPolyline(point, closed);\n if (hit && hit.distance <= tolerance) return 'near';\n }\n return null;\n}\n\nfunction pickImportedShapeAnchor(\n candidates: CmAnchor[],\n degree: Map<number, number>,\n center: Vec2,\n): CmAnchor | null {\n if (candidates.length === 0) return null;\n const leaves = candidates.filter((anchor) => (degree.get(anchor.id) ?? 0) <= 1);\n const pool = leaves.length > 0 ? leaves : candidates;\n return [...pool].sort((a, b) => distance(a, center) - distance(b, center))[0] ?? null;\n}\n\nexport interface AttachableImportShape {\n id: number;\n kind: ShapeKind;\n geometry: Pick<ShapeGeometry, 'polygons'>;\n}\n\n/**\n * Same rule as v1 `assign_route_nodes_to_stores`: a route vertex that sits\n * inside (or on) an interactive shape is that store / amenity / entrance's\n * destination. Prefer a dedicated spur leaf; otherwise take the closest\n * vertex. Corridor through-points keep `walk` edges so the path stays joined.\n */\nexport function attachImportedRouteAnchors(\n anchors: CmAnchor[],\n edges: CmRouteEdge[],\n shapes: AttachableImportShape[],\n insideTolerance = DEFAULT_WELD_TOLERANCE * 3,\n): number {\n const degree = new Map<number, number>();\n for (const edge of edges) {\n degree.set(edge.fromAnchorId, (degree.get(edge.fromAnchorId) ?? 0) + 1);\n degree.set(edge.toAnchorId, (degree.get(edge.toAnchorId) ?? 0) + 1);\n }\n\n const free = anchors.filter((anchor) => anchor.shapeId == null);\n const used = new Set<number>();\n let attached = 0;\n\n for (const shape of shapes) {\n if (!INTERACTIVE_SHAPE_KINDS.includes(shape.kind)) continue;\n const polys = shape.geometry.polygons ?? [];\n if (polys.length === 0) continue;\n const hits = free\n .filter((anchor) => !used.has(anchor.id))\n .map((anchor) => ({\n anchor,\n hit: pointOnPolygons(anchor, polys, insideTolerance),\n }))\n .filter((row): row is { anchor: CmAnchor; hit: 'inside' | 'near' } =>\n row.hit != null,\n );\n if (hits.length === 0) continue;\n const verts = polys.flat();\n const center = {\n x: verts.reduce((s, p) => s + p.x, 0) / verts.length,\n y: verts.reduce((s, p) => s + p.y, 0) / verts.length,\n };\n const pick =\n pickImportedShapeAnchor(\n hits.filter((row) => row.hit === 'inside').map((row) => row.anchor),\n degree,\n center,\n ) ??\n pickImportedShapeAnchor(\n hits.filter((row) => row.hit === 'near').map((row) => row.anchor),\n degree,\n center,\n );\n if (!pick) continue;\n pick.shapeId = shape.id;\n pick.kind = routeAnchorKindForShape(shape.kind);\n used.add(pick.id);\n attached += 1;\n if ((degree.get(pick.id) ?? 0) > 1) continue;\n const linkKind = routeLinkKind(pick.kind);\n for (const edge of edges) {\n if (edge.fromAnchorId === pick.id || edge.toAnchorId === pick.id) {\n edge.kind = linkKind;\n }\n }\n }\n\n return attached;\n}\n","/**\n * Wheel / trackpad zoom curve for every map surface.\n *\n * PORTAL default MapViewer uses drei → three-stdlib OrbitControls, whose\n * `getZoomScale()` is `Math.pow(0.95, zoomSpeed)` **per wheel event** (not\n * scaled by `deltaY`). Edit Map / Wayfinding must use the same step or they\n * feel slower than the assign map.\n *\n * Scroll up zooms in; the caller keeps the pointer over the same map point\n * (`panAfterZoom` on the SVG canvas, `zoomToCursor` on OrbitControls).\n */\n\n/** three-stdlib OrbitControls `Math.pow(0.95, zoomSpeed)` base. */\nexport const WHEEL_ZOOM_BASE = 0.95;\n/** drei / three-stdlib default `zoomSpeed`. */\nexport const WHEEL_ZOOM_SPEED = 1;\n\n/**\n * OrbitControls dolly scale for one wheel event: `0.95 ** zoomSpeed`.\n * Sign of `deltaY` is ignored here; `nextZoomFromWheel` applies in vs out.\n */\nexport function wheelDollyScale(zoomSpeed = WHEEL_ZOOM_SPEED): number {\n return Math.pow(WHEEL_ZOOM_BASE, zoomSpeed);\n}\n\n/**\n * Next SVG / orthographic zoom from a wheel event.\n * `deltaY < 0` zooms in. Pan separately so the cursor stays on the same point.\n */\nexport function nextZoomFromWheel(\n currentZoom: number,\n deltaY: number,\n options?: {\n zoomSpeed?: number;\n min?: number;\n max?: number;\n },\n): number {\n if (deltaY === 0) return currentZoom;\n const scale = wheelDollyScale(options?.zoomSpeed ?? WHEEL_ZOOM_SPEED);\n const next = deltaY < 0 ? currentZoom / scale : currentZoom * scale;\n const min = options?.min ?? Number.NEGATIVE_INFINITY;\n const max = options?.max ?? Number.POSITIVE_INFINITY;\n return Math.min(max, Math.max(min, next));\n}\n"],"names":["outdoorDecorationFromSvg","svgText","suppressIds","theme","parsed","parseSvgString","out","el","isRoutePathLabel","isRouteFolderLabel","isInteractiveGroupLabel","isStoreFolderLabel","layer","resolveLayerStyle","fill","_a","stroke","_b","strokeWidth","_c","_d","weldAnchors","anchors","edges","candidateIds","tolerance","DEFAULT_WELD_TOLERANCE","candidates","a","surviving","min","removed","distance","removedSet","rewired","edge","changed","findWeldCandidates","groups","used","i","group","j","collapseDuplicateRouteGraph","nextAnchors","nextEdges","result","id","alive","anchor","seen","uniqueEdges","lo","hi","key","autoConnectUnitAnchor","unitAnchor","walkablePolylines","existingJunctions","weldTolerance","best","line","hit","nearestPointOnPolyline","existing","unitAnchorFromShape","shapeId","levelId","polygons","tempId","flat","sx","sy","p","c","point","pointInPolygons","buildAutoSkeleton","walkablePolygons","voidPolygons","cellSize","minX","minY","maxX","maxY","poly","cols","rows","free","row","col","x","y","pt","byKey","cell","neighbors","nc","nr","nk","edgeKey","importRoutePaths","pathDs","mapId","startId","nextId","findOrCreate","polys","pathToPolygons","b","e","collapsed","routeAnchorKindForShape","kind","routeLinkKind","pointOnPolygons","closed","pickImportedShapeAnchor","degree","center","leaves","attachImportedRouteAnchors","shapes","insideTolerance","attached","shape","INTERACTIVE_SHAPE_KINDS","hits","verts","s","pick","linkKind","WHEEL_ZOOM_BASE","WHEEL_ZOOM_SPEED","wheelDollyScale","zoomSpeed","nextZoomFromWheel","currentZoom","deltaY","options","scale","next","max"],"mappings":";AAwBO,SAASA,EACdC,GACAC,GACAC,GACyB;;AACzB,QAAMC,IAASC,EAAeJ,CAAO,GAC/BK,IAA+B,CAAA;AACrC,aAAWC,KAAMH,EAAO,UAAU;AAOhC,QANI,CAACG,EAAG,KACJA,EAAG,eACHL,KAAA,QAAAA,EAAa,IAAIK,EAAG,OACpB,iCAAiC,KAAKA,EAAG,EAAE,KAC3CA,EAAG,GAAG,YAAA,EAAc,WAAW,YAAY,KAC3CC,EAAiBD,EAAG,EAAE,KAAKE,EAAmBF,EAAG,EAAE,KACnDG,EAAwBH,EAAG,EAAE,KAAKI,EAAmBJ,EAAG,EAAE,EAAG;AAEjE,UAAMK,IAAQC,EAAkBN,EAAG,IAAIJ,CAAK,GACtCW,KAAOF,KAAA,gBAAAA,EAAO,WAAQG,IAAAR,EAAG,UAAH,gBAAAQ,EAAU,OAChCC,KAASJ,KAAA,gBAAAA,EAAO,aAAUK,IAAAV,EAAG,UAAH,gBAAAU,EAAU,SACpCC,KAAcN,KAAA,gBAAAA,EAAO,kBAAeO,IAAAZ,EAAG,UAAH,gBAAAY,EAAU;AACpD,IAAAb,EAAI,KAAK;AAAA,MACP,IAAIC,EAAG;AAAA,MACP,GAAGA,EAAG;AAAA,MACN,MAAMO,KAAQA,MAAS,SAASA,IAAO;AAAA,MACvC,QAAQE,KAAUA,MAAW,SAASA,IAAS;AAAA,MAC/C,aAAAE;AAAA,MACA,UAASE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;AACpE,SAAO,KAAK,IAAID,GAAiBG,CAAS;AAC5C;AAMO,SAASC,EACdC,GACAC,GACAC,GAKQ;AACR,MAAID,MAAW,EAAG,QAAOD;AACzB,QAAMG,IAAQN,GAAgBK,KAAA,gBAAAA,EAAS,cAAaN,CAAgB,GAC9DQ,IAAOH,IAAS,IAAID,IAAcG,IAAQH,IAAcG,GACxD9G,KAAM6G,KAAA,gBAAAA,EAAS,QAAO,OAAO,mBAC7BG,KAAMH,KAAA,gBAAAA,EAAS,QAAO,OAAO;AACnC,SAAO,KAAK,IAAIG,GAAK,KAAK,IAAIhH,GAAK+G,CAAI,CAAC;AAC1C;"}
1
+ {"version":3,"file":"wheelZoom.js","sources":["../../src/core/outdoorDecoration.ts","../../src/core/routing/graph-tools.ts","../../src/core/wheelZoom.ts"],"sourcesContent":["import {\n parseSvgString,\n isInteractiveGroupLabel,\n isRouteFolderLabel,\n isRoutePathLabel,\n isStoreFolderLabel,\n} from './import';\nimport { amenityHouseFill, isAmenityLayerId } from './shapeFill';\nimport {\n resolveLayerStyle,\n sortByOutdoorSvgPaintOrder,\n type StaticLayerTheme,\n} from './layerStyles';\n\nexport interface OutdoorDecorationPath {\n id: string;\n d: string;\n fill?: string;\n stroke?: string;\n strokeWidth?: number;\n opacity?: number;\n}\n\n/**\n * Paths the assign viewer draws from the live outdoor SVG: house-style\n * decoration (green area, parking lanes, icons) and any other\n * non-interactive art. Interactive / store folders stay out — those are\n * `cm_shapes` rows.\n */\nexport function outdoorDecorationFromSvg(\n svgText: string,\n suppressIds?: ReadonlySet<string>,\n theme?: StaticLayerTheme | null,\n): OutdoorDecorationPath[] {\n const parsed = parseSvgString(svgText);\n const out: OutdoorDecorationPath[] = [];\n for (const el of parsed.elements) {\n if (!el.d) continue;\n if (el.interactive) continue;\n if (suppressIds?.has(el.id)) continue;\n if (/^parking[-_]?lines?(?:[-_]|$)/i.test(el.id)) continue;\n if (el.id.toLowerCase().startsWith('route-path')) continue;\n if (isRoutePathLabel(el.id) || isRouteFolderLabel(el.id)) continue;\n if (isInteractiveGroupLabel(el.id) || isStoreFolderLabel(el.id)) continue;\n\n const layer = resolveLayerStyle(el.id, theme);\n const fill =\n layer?.fill ??\n (isAmenityLayerId(el.id) ? amenityHouseFill(theme) : el.style?.fill);\n const stroke = layer?.stroke ?? el.style?.stroke;\n const strokeWidth = layer?.strokeWidth ?? el.style?.strokeWidth;\n out.push({\n id: el.id,\n d: el.d,\n fill: fill && fill !== 'none' ? fill : undefined,\n stroke: stroke && stroke !== 'none' ? stroke : undefined,\n strokeWidth,\n opacity: el.style?.opacity,\n });\n }\n // Green areas last among house fills so they stay above parking lanes.\n return sortByOutdoorSvgPaintOrder(out, (item) => item.id);\n}\n","import type {\n AnchorKind,\n AutoConnectResult,\n CmAnchor,\n CmRouteEdge,\n ShapeGeometry,\n ShapeKind,\n SkeletonSuggestion,\n Vec2,\n WeldResult,\n} from '../types';\nimport { DEFAULT_WELD_TOLERANCE, INTERACTIVE_SHAPE_KINDS } from '../types';\nimport {\n distance,\n nearestPointOnPolyline,\n pathToPolygons,\n pointInPolygons,\n} from '../geometry';\n\nexport interface AnchorLike {\n id: number;\n x: number;\n y: number;\n levelId: number;\n shapeId?: number | null;\n kind?: string;\n}\n\nexport interface EdgeLike {\n id: number;\n fromAnchorId: number;\n toAnchorId: number;\n}\n\n/**\n * Weld anchors within tolerance into the surviving (lowest id) anchor.\n * Rewires edges that referenced removed anchors.\n */\nexport function weldAnchors(\n anchors: AnchorLike[],\n edges: EdgeLike[],\n candidateIds: number[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): WeldResult | null {\n const candidates = anchors.filter((a) => candidateIds.includes(a.id));\n if (candidates.length < 2) return null;\n\n // Cluster by proximity from the first candidate's position centroid of group\n const surviving = candidates.reduce((min, a) => (a.id < min.id ? a : min));\n const removed: number[] = [];\n\n for (const a of candidates) {\n if (a.id === surviving.id) continue;\n if (distance(a, surviving) <= tolerance) {\n removed.push(a.id);\n }\n }\n\n if (removed.length === 0) return null;\n\n const removedSet = new Set(removed);\n const rewired: number[] = [];\n\n for (const edge of edges) {\n let changed = false;\n if (removedSet.has(edge.fromAnchorId)) {\n edge.fromAnchorId = surviving.id;\n changed = true;\n }\n if (removedSet.has(edge.toAnchorId)) {\n edge.toAnchorId = surviving.id;\n changed = true;\n }\n // Drop self-loops\n if (edge.fromAnchorId === edge.toAnchorId) {\n rewired.push(edge.id);\n continue;\n }\n if (changed) rewired.push(edge.id);\n }\n\n return {\n survivingAnchorId: surviving.id,\n removedAnchorIds: removed,\n rewiredEdgeIds: rewired,\n };\n}\n\n/**\n * Find all pairs of anchors within tolerance that should be welded.\n */\nexport function findWeldCandidates(\n anchors: AnchorLike[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): number[][] {\n const groups: number[][] = [];\n const used = new Set<number>();\n\n for (let i = 0; i < anchors.length; i++) {\n if (used.has(anchors[i].id)) continue;\n const group = [anchors[i].id];\n for (let j = i + 1; j < anchors.length; j++) {\n if (used.has(anchors[j].id)) continue;\n if (\n anchors[i].levelId === anchors[j].levelId &&\n distance(anchors[i], anchors[j]) <= tolerance\n ) {\n group.push(anchors[j].id);\n used.add(anchors[j].id);\n }\n }\n if (group.length > 1) {\n used.add(anchors[i].id);\n groups.push(group);\n }\n }\n return groups;\n}\n\n/**\n * Merge coincident anchors and drop overlapping undirected edges.\n * Two SVG imports of the same ROUTES layer stack a second copy on top of\n * the first — dragging one junction then leaves the twin behind.\n */\nexport function collapseDuplicateRouteGraph<\n A extends AnchorLike,\n E extends EdgeLike,\n>(\n anchors: A[],\n edges: E[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): { anchors: A[]; edges: E[] } {\n const nextAnchors = anchors.slice();\n const nextEdges = edges.map((edge) => ({ ...edge }));\n const removed = new Set<number>();\n for (const group of findWeldCandidates(nextAnchors, tolerance)) {\n const result = weldAnchors(nextAnchors, nextEdges, group, tolerance);\n if (!result) continue;\n for (const id of result.removedAnchorIds) removed.add(id);\n }\n const alive = nextAnchors.filter((anchor) => !removed.has(anchor.id));\n const seen = new Set<string>();\n const uniqueEdges: E[] = [];\n for (const edge of nextEdges) {\n if (removed.has(edge.fromAnchorId) || removed.has(edge.toAnchorId)) continue;\n if (edge.fromAnchorId === edge.toAnchorId) continue;\n const lo = Math.min(edge.fromAnchorId, edge.toAnchorId);\n const hi = Math.max(edge.fromAnchorId, edge.toAnchorId);\n const key = `${lo}|${hi}`;\n if (seen.has(key)) continue;\n seen.add(key);\n uniqueEdges.push(edge);\n }\n return { anchors: alive, edges: uniqueEdges };\n}\n\n/**\n * Auto-connect a unit anchor to the nearest walkable segment via perpendicular projection.\n */\nexport function autoConnectUnitAnchor(\n unitAnchor: AnchorLike,\n walkablePolylines: Vec2[][],\n existingJunctions: AnchorLike[],\n weldTolerance = DEFAULT_WELD_TOLERANCE,\n): AutoConnectResult | null {\n let best: { point: Vec2; distance: number } | null = null;\n\n for (const line of walkablePolylines) {\n const hit = nearestPointOnPolyline(unitAnchor, line);\n if (hit && (!best || hit.distance < best.distance)) {\n best = { point: hit.point, distance: hit.distance };\n }\n }\n\n if (!best) return null;\n\n // Reuse existing junction if within weld tolerance\n const existing = existingJunctions.find(\n (j) =>\n j.levelId === unitAnchor.levelId &&\n distance(j, best!.point) <= weldTolerance,\n );\n\n return {\n unitAnchorId: unitAnchor.id,\n junctionAnchor: existing\n ? { x: existing.x, y: existing.y, existingId: existing.id }\n : { x: best.point.x, y: best.point.y },\n edge: {\n fromAnchorId: unitAnchor.id,\n toAnchorId: existing?.id,\n },\n };\n}\n\n/**\n * Place a unit anchor at the centroid of a shape's polygons, if the point lies inside.\n */\nexport function unitAnchorFromShape(\n shapeId: number,\n levelId: number,\n polygons: Vec2[][],\n tempId: number,\n): CmAnchor | null {\n if (polygons.length === 0) return null;\n const flat = polygons.flat();\n if (flat.length === 0) return null;\n\n let sx = 0;\n let sy = 0;\n for (const p of flat) {\n sx += p.x;\n sy += p.y;\n }\n const c = { x: sx / flat.length, y: sy / flat.length };\n\n // Prefer centroid if inside; otherwise use first polygon's average of extremes\n const point = pointInPolygons(c, polygons) ? c : flat[0];\n\n return {\n id: tempId,\n levelId,\n shapeId,\n kind: 'unit',\n x: point.x,\n y: point.y,\n connectorId: null,\n };\n}\n\n/**\n * Build a simple medial-axis-ish skeleton from walkable polygons minus voids.\n * This is a pragmatic approximation: sample a grid inside walkable, reject void cells,\n * connect adjacent free cells into a sparse graph, then prune to a polyline network.\n */\nexport function buildAutoSkeleton(\n walkablePolygons: Vec2[][],\n voidPolygons: Vec2[][],\n cellSize = 20,\n): SkeletonSuggestion {\n if (walkablePolygons.length === 0) {\n return { anchors: [], edges: [] };\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const poly of walkablePolygons) {\n for (const p of poly) {\n minX = Math.min(minX, p.x);\n minY = Math.min(minY, p.y);\n maxX = Math.max(maxX, p.x);\n maxY = Math.max(maxY, p.y);\n }\n }\n\n const cols = Math.max(1, Math.ceil((maxX - minX) / cellSize));\n const rows = Math.max(1, Math.ceil((maxY - minY) / cellSize));\n const free: Array<{ key: string; x: number; y: number; col: number; row: number }> = [];\n\n for (let row = 0; row < rows; row++) {\n for (let col = 0; col < cols; col++) {\n const x = minX + (col + 0.5) * cellSize;\n const y = minY + (row + 0.5) * cellSize;\n const pt = { x, y };\n if (!pointInPolygons(pt, walkablePolygons)) continue;\n if (voidPolygons.length > 0 && pointInPolygons(pt, voidPolygons)) continue;\n free.push({ key: `${col},${row}`, x, y, col, row });\n }\n }\n\n const byKey = new Map(free.map((c) => [c.key, c]));\n const anchors = free.map((c) => ({\n tempId: c.key,\n x: c.x,\n y: c.y,\n kind: 'junction' as const,\n }));\n\n const edges: Array<{ fromTempId: string; toTempId: string }> = [];\n const seen = new Set<string>();\n\n for (const cell of free) {\n const neighbors = [\n [cell.col + 1, cell.row],\n [cell.col, cell.row + 1],\n ];\n for (const [nc, nr] of neighbors) {\n const nk = `${nc},${nr}`;\n if (!byKey.has(nk)) continue;\n const edgeKey = cell.key < nk ? `${cell.key}|${nk}` : `${nk}|${cell.key}`;\n if (seen.has(edgeKey)) continue;\n seen.add(edgeKey);\n edges.push({ fromTempId: cell.key, toTempId: nk });\n }\n }\n\n return { anchors, edges };\n}\n\n/**\n * Convert ROUTES-group SVG line endpoints into welded anchors + edges.\n * This is the key converter step that repairs coincident-but-disconnected joins.\n *\n * Anchors land in raw SVG user space (Y down), the same space as shape\n * geometry. There is intentionally no viewbox-height flip here — mirroring\n * routes without mirroring shapes would silently desynchronise the two.\n */\nexport function importRoutePaths(\n pathDs: string[],\n levelId: number,\n mapId: number,\n startId: number,\n weldTolerance = DEFAULT_WELD_TOLERANCE,\n): { anchors: CmAnchor[]; edges: CmRouteEdge[]; nextId: number } {\n const anchors: CmAnchor[] = [];\n const edges: CmRouteEdge[] = [];\n let nextId = startId;\n\n const findOrCreate = (x: number, y: number): number => {\n const existing = anchors.find(\n (a) => distance(a, { x, y }) <= weldTolerance,\n );\n if (existing) return existing.id;\n const id = nextId++;\n anchors.push({\n id,\n levelId,\n shapeId: null,\n kind: 'junction',\n x,\n y,\n connectorId: null,\n });\n return id;\n };\n\n for (const d of pathDs) {\n const polys = pathToPolygons(d);\n for (const poly of polys) {\n for (let i = 0; i < poly.length - 1; i++) {\n const a = findOrCreate(poly[i].x, poly[i].y);\n const b = findOrCreate(poly[i + 1].x, poly[i + 1].y);\n if (a === b) continue;\n // Avoid duplicate edges\n const dup = edges.some(\n (e) =>\n (e.fromAnchorId === a && e.toAnchorId === b) ||\n (e.fromAnchorId === b && e.toAnchorId === a),\n );\n if (dup) continue;\n edges.push({\n id: nextId++,\n mapId,\n fromAnchorId: a,\n toAnchorId: b,\n weight: null,\n directed: false,\n accessible: true,\n kind: 'walk',\n });\n }\n }\n }\n\n const collapsed = collapseDuplicateRouteGraph(anchors, edges, weldTolerance);\n return { anchors: collapsed.anchors, edges: collapsed.edges, nextId };\n}\n\nexport function routeAnchorKindForShape(kind: ShapeKind): AnchorKind {\n if (kind === 'entrance') return 'entrance';\n if (kind === 'connector') return 'connector';\n return 'unit';\n}\n\nfunction routeLinkKind(kind: AnchorKind): CmRouteEdge['kind'] {\n return kind === 'entrance' ? 'entrance_link' : 'unit_link';\n}\n\n/** `inside` matches v1's store-mesh hit; `near` is a door-step fallback. */\nfunction pointOnPolygons(\n point: Vec2,\n polygons: Vec2[][],\n tolerance: number,\n): 'inside' | 'near' | null {\n if (pointInPolygons(point, polygons)) return 'inside';\n for (const poly of polygons) {\n if (poly.length < 2) continue;\n const closed = [...poly, poly[0]];\n const hit = nearestPointOnPolyline(point, closed);\n if (hit && hit.distance <= tolerance) return 'near';\n }\n return null;\n}\n\nexport interface AttachableImportShape {\n id: number;\n kind: ShapeKind;\n geometry: Pick<ShapeGeometry, 'polygons'>;\n}\n\nfunction shapeUnderImportedAnchor(\n point: Vec2,\n shapes: AttachableImportShape[],\n insideTolerance: number,\n): AttachableImportShape | null {\n let near: AttachableImportShape | null = null;\n for (const shape of shapes) {\n if (!INTERACTIVE_SHAPE_KINDS.includes(shape.kind)) continue;\n const polys = shape.geometry.polygons ?? [];\n if (polys.length === 0) continue;\n const hit = pointOnPolygons(point, polys, insideTolerance);\n if (hit === 'inside') return shape;\n if (hit === 'near' && near == null) near = shape;\n }\n return near;\n}\n\n/**\n * Check every imported route vertex. If it falls inside (or on) a store /\n * amenity / kiosk / connector, it becomes that shape's orange destination.\n * A shape may own any number of those points so pathfinding can leave from\n * the nearest door. Corridor through-points keep `walk` edges; leaf stubs\n * become `unit_link`.\n */\nexport function attachImportedRouteAnchors(\n anchors: CmAnchor[],\n edges: CmRouteEdge[],\n shapes: AttachableImportShape[],\n insideTolerance = DEFAULT_WELD_TOLERANCE * 3,\n): number {\n const degree = new Map<number, number>();\n for (const edge of edges) {\n degree.set(edge.fromAnchorId, (degree.get(edge.fromAnchorId) ?? 0) + 1);\n degree.set(edge.toAnchorId, (degree.get(edge.toAnchorId) ?? 0) + 1);\n }\n\n let attached = 0;\n for (const anchor of anchors) {\n if (anchor.shapeId != null) continue;\n const shape = shapeUnderImportedAnchor(anchor, shapes, insideTolerance);\n if (!shape) continue;\n anchor.shapeId = shape.id;\n anchor.kind = routeAnchorKindForShape(shape.kind);\n attached += 1;\n if ((degree.get(anchor.id) ?? 0) > 1) continue;\n const linkKind = routeLinkKind(anchor.kind);\n for (const edge of edges) {\n if (edge.fromAnchorId === anchor.id || edge.toAnchorId === anchor.id) {\n edge.kind = linkKind;\n }\n }\n }\n\n return attached;\n}\n","/**\n * Wheel / trackpad zoom curve for every map surface.\n *\n * PORTAL default MapViewer uses drei → three-stdlib OrbitControls, whose\n * `getZoomScale()` is `Math.pow(0.95, zoomSpeed)` **per wheel event** (not\n * scaled by `deltaY`). Edit Map / Wayfinding must use the same step or they\n * feel slower than the assign map.\n *\n * Scroll up zooms in; the caller keeps the pointer over the same map point\n * (`panAfterZoom` on the SVG canvas, `zoomToCursor` on OrbitControls).\n */\n\n/** three-stdlib OrbitControls `Math.pow(0.95, zoomSpeed)` base. */\nexport const WHEEL_ZOOM_BASE = 0.95;\n/** drei / three-stdlib default `zoomSpeed`. */\nexport const WHEEL_ZOOM_SPEED = 1;\n\n/**\n * OrbitControls dolly scale for one wheel event: `0.95 ** zoomSpeed`.\n * Sign of `deltaY` is ignored here; `nextZoomFromWheel` applies in vs out.\n */\nexport function wheelDollyScale(zoomSpeed = WHEEL_ZOOM_SPEED): number {\n return Math.pow(WHEEL_ZOOM_BASE, zoomSpeed);\n}\n\n/**\n * Next SVG / orthographic zoom from a wheel event.\n * `deltaY < 0` zooms in. Pan separately so the cursor stays on the same point.\n */\nexport function nextZoomFromWheel(\n currentZoom: number,\n deltaY: number,\n options?: {\n zoomSpeed?: number;\n min?: number;\n max?: number;\n },\n): number {\n if (deltaY === 0) return currentZoom;\n const scale = wheelDollyScale(options?.zoomSpeed ?? WHEEL_ZOOM_SPEED);\n const next = deltaY < 0 ? currentZoom / scale : currentZoom * scale;\n const min = options?.min ?? Number.NEGATIVE_INFINITY;\n const max = options?.max ?? Number.POSITIVE_INFINITY;\n return Math.min(max, Math.max(min, next));\n}\n"],"names":["outdoorDecorationFromSvg","svgText","suppressIds","theme","parsed","parseSvgString","out","el","isRoutePathLabel","isRouteFolderLabel","isInteractiveGroupLabel","isStoreFolderLabel","layer","resolveLayerStyle","fill","isAmenityLayerId","amenityHouseFill","_a","stroke","_b","strokeWidth","_c","_d","sortByOutdoorSvgPaintOrder","item","weldAnchors","anchors","edges","candidateIds","tolerance","DEFAULT_WELD_TOLERANCE","candidates","a","surviving","min","removed","distance","removedSet","rewired","edge","changed","findWeldCandidates","groups","used","i","group","j","collapseDuplicateRouteGraph","nextAnchors","nextEdges","result","id","alive","anchor","seen","uniqueEdges","lo","hi","key","autoConnectUnitAnchor","unitAnchor","walkablePolylines","existingJunctions","weldTolerance","best","line","hit","nearestPointOnPolyline","existing","unitAnchorFromShape","shapeId","levelId","polygons","tempId","flat","sx","sy","p","c","point","pointInPolygons","buildAutoSkeleton","walkablePolygons","voidPolygons","cellSize","minX","minY","maxX","maxY","poly","cols","rows","free","row","col","x","y","pt","byKey","cell","neighbors","nc","nr","nk","edgeKey","importRoutePaths","pathDs","mapId","startId","nextId","findOrCreate","d","polys","pathToPolygons","b","e","collapsed","routeAnchorKindForShape","kind","routeLinkKind","pointOnPolygons","closed","shapeUnderImportedAnchor","shapes","insideTolerance","near","shape","INTERACTIVE_SHAPE_KINDS","attachImportedRouteAnchors","degree","attached","linkKind","WHEEL_ZOOM_BASE","WHEEL_ZOOM_SPEED","wheelDollyScale","zoomSpeed","nextZoomFromWheel","currentZoom","deltaY","options","scale","next","max"],"mappings":";AA6BO,SAASA,EACdC,GACAC,GACAC,GACyB;;AACzB,QAAMC,IAASC,EAAeJ,CAAO,GAC/BK,IAA+B,CAAA;AACrC,aAAWC,KAAMH,EAAO,UAAU;AAOhC,QANI,CAACG,EAAG,KACJA,EAAG,eACHL,KAAA,QAAAA,EAAa,IAAIK,EAAG,OACpB,iC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Q,IAAOH,IAAS,IAAID,IAAcG,IAAQH,IAAcG,GACxD1G,KAAMyG,KAAA,gBAAAA,EAAS,QAAO,OAAO,mBAC7BG,KAAMH,KAAA,gBAAAA,EAAS,QAAO,OAAO;AACnC,SAAO,KAAK,IAAIG,GAAK,KAAK,IAAI5G,GAAK2G,CAAI,CAAC;AAC1C;"}
@@ -1,4 +1,4 @@
1
- import { AssignmentLayerType, AssignmentTargetType, CmShape, CmShapeAssignment, MapAssignRetailer, ShapeKind, ShapeLabel, ShapeStyle } from './types';
1
+ import { AssignmentLayerType, AssignmentTargetType, CmShape, CmShapeAssignment, MapAssignRetailer, ShapeKind, ShapeLabel, ShapeStyle, ThemeDefaults } from './types';
2
2
  export declare const DEFAULT_ASSIGNMENT_SIZE = 12;
3
3
  /** Escalator / elevator icons use the same Size default as store names. */
4
4
  export declare const CONNECTOR_ICON_SIZE = 12;
@@ -28,10 +28,27 @@ export declare function retailerOptionLabel(retailer: MapAssignRetailer, duplica
28
28
  export declare function resolvedAssignmentBgColor(assignment: {
29
29
  bgColor?: string | null;
30
30
  } | null | undefined, storeColor: string): string;
31
+ /** Amenity / kiosk / connection pads stay clear unless staff set a BG Color. */
32
+ export declare function isTransparentPadKind(kind?: ShapeKind): boolean;
33
+ /** Color-box fallback for BG Color — transparent on icon pads, else the store fill. */
34
+ export declare function assignmentPadFillFallback(kind: ShapeKind | undefined, storeColor: string): string;
31
35
  /** Per-store text override, or the theme store text color when none is set. */
32
36
  export declare function resolvedAssignmentTextColor(assignment: {
33
37
  textColor?: string | null;
34
38
  } | null | undefined, textColor: string): string;
39
+ export type AssignmentIconTheme = Pick<ThemeDefaults, 'AMENITY_ICON_COLOR' | 'KIOSK_ICON_COLOR' | 'CONNECTOR_ICON_COLOR' | 'STORE_TEXT_COLOR'>;
40
+ /** House color for an amenity / kiosk / connection icon, or store text otherwise. */
41
+ export declare function assignmentIconThemeFallback(assignment: {
42
+ layerType?: AssignmentLayerType;
43
+ } | null | undefined, theme: AssignmentIconTheme, shapeKind?: ShapeKind): string;
44
+ /**
45
+ * Per-item Icon Color / label color, or the amenity / kiosk / connection /
46
+ * store-text house default when none is set.
47
+ */
48
+ export declare function resolvedAssignmentIconColor(assignment: {
49
+ textColor?: string | null;
50
+ layerType?: AssignmentLayerType;
51
+ } | null | undefined, theme: AssignmentIconTheme, labelColor?: string | null, shapeKind?: ShapeKind): string;
35
52
  /** Kiosk app ID typed in Map options — not chosen from a device list. */
36
53
  export declare function parseKioskIdInput(raw: string): number | null;
37
54
  type AssignmentTargetFields = Pick<CmShapeAssignment, 'targetType' | 'retailerId' | 'amenityId' | 'kioskId'> & {
@@ -49,7 +66,7 @@ export declare function kioskAssignedName(assignment: {
49
66
  } | null | undefined, catalogName?: string | null): string | null;
50
67
  export declare function assignmentHasTarget(assignment: AssignmentTargetFields | null | undefined): boolean;
51
68
  /** Drop leftover retailer/custom text when the polygon is not assigned. */
52
- export declare function publishedShapeLabel(shape: Pick<CmShape, 'kind' | 'label' | 'style'>, assignment: CmShapeAssignment | null | undefined, retailer?: MapAssignRetailer | null): ShapeLabel;
69
+ export declare function publishedShapeLabel(shape: Pick<CmShape, 'kind' | 'label' | 'style'> & Partial<Pick<CmShape, 'origin' | 'sourceSvgId'>>, assignment: CmShapeAssignment | null | undefined, retailer?: MapAssignRetailer | null): ShapeLabel;
53
70
  export declare function assignmentDisplayText(assignment: CmShapeAssignment, retailer?: MapAssignRetailer | null): string | undefined;
54
71
  /**
55
72
  * Logo reference for retail_logo / custom_image — prefer the stable retailer