@seatmap-fyi/map-domain 0.1.0-alpha.3 → 0.1.0-alpha.48
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/arc-fan-rebuild.d.ts +13 -0
- package/dist/arc-fan-rebuild.js +163 -0
- package/dist/arc-fan.d.ts +27 -0
- package/dist/arc-fan.interface.d.ts +83 -0
- package/dist/arc-fan.interface.js +30 -0
- package/dist/arc-fan.js +182 -0
- package/dist/catalog.d.ts +10 -3
- package/dist/catalog.js +66 -10
- package/dist/categories.d.ts +27 -0
- package/dist/categories.js +217 -0
- package/dist/editor-state.d.ts +4 -1
- package/dist/editor-state.js +61 -31
- package/dist/floors.d.ts +22 -0
- package/dist/floors.js +77 -0
- package/dist/geometry/boundary.d.ts +1 -1
- package/dist/geometry/boundary.js +16 -12
- package/dist/geometry/curve-warnings.d.ts +1 -1
- package/dist/geometry/curve-warnings.js +3 -5
- package/dist/geometry/decoration-bounds.d.ts +4 -0
- package/dist/geometry/decoration-bounds.js +42 -0
- package/dist/geometry/ellipse.js +4 -12
- package/dist/geometry/geometry.d.ts +12 -3
- package/dist/geometry/geometry.js +37 -28
- package/dist/geometry/layout-transform.d.ts +10 -0
- package/dist/geometry/layout-transform.interface.d.ts +6 -0
- package/dist/geometry/layout-transform.interface.js +1 -0
- package/dist/geometry/layout-transform.js +206 -0
- package/dist/geometry/polygon-curves.d.ts +17 -0
- package/dist/geometry/polygon-curves.interface.d.ts +21 -0
- package/dist/geometry/polygon-curves.interface.js +5 -0
- package/dist/geometry/polygon-curves.js +169 -0
- package/dist/geometry/primitives.d.ts +1 -1
- package/dist/geometry/primitives.js +2 -3
- package/dist/geometry/seat-shape.d.ts +24 -0
- package/dist/geometry/seat-shape.js +101 -0
- package/dist/geometry/seating-layout.d.ts +20 -3
- package/dist/geometry/seating-layout.js +113 -19
- package/dist/geometry/units.d.ts +8 -0
- package/dist/geometry/units.js +13 -0
- package/dist/geometry/venue-outline.d.ts +4 -18
- package/dist/geometry/venue-outline.interface.d.ts +23 -0
- package/dist/geometry/venue-outline.interface.js +7 -0
- package/dist/geometry/venue-outline.js +107 -49
- package/dist/identity.d.ts +3 -1
- package/dist/identity.js +32 -9
- package/dist/issues.d.ts +15 -2
- package/dist/issues.js +16 -6
- package/dist/labels.d.ts +12 -1
- package/dist/labels.js +76 -11
- package/dist/layers.d.ts +26 -0
- package/dist/layers.js +86 -0
- package/dist/media.d.ts +27 -0
- package/dist/media.js +89 -0
- package/dist/physical-document.interface.d.ts +592 -0
- package/dist/physical-document.interface.js +179 -0
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +70 -25
- package/dist/reference.js +1 -1
- package/dist/row-segments.d.ts +30 -0
- package/dist/row-segments.js +113 -0
- package/dist/schema.d.ts +1578 -68
- package/dist/schema.js +467 -98
- package/dist/seat-proximity.d.ts +4 -0
- package/dist/seat-proximity.js +119 -0
- package/dist/section-elevation.d.ts +5 -0
- package/dist/section-elevation.interface.d.ts +26 -0
- package/dist/section-elevation.interface.js +8 -0
- package/dist/section-elevation.js +53 -0
- package/dist/section-fill-rebuild.d.ts +10 -0
- package/dist/section-fill-rebuild.js +64 -0
- package/dist/section-fill.d.ts +84 -0
- package/dist/section-fill.interface.d.ts +94 -0
- package/dist/section-fill.interface.js +22 -0
- package/dist/section-fill.js +306 -0
- package/dist/section-growth.d.ts +11 -0
- package/dist/section-growth.interface.d.ts +12 -0
- package/dist/section-growth.interface.js +1 -0
- package/dist/section-growth.js +198 -0
- package/dist/section-layout.d.ts +95 -0
- package/dist/section-layout.interface.d.ts +8 -0
- package/dist/section-layout.interface.js +5 -0
- package/dist/section-layout.js +70 -0
- package/dist/section-outline-refit.d.ts +8 -0
- package/dist/section-outline-refit.js +246 -0
- package/dist/section-refit.d.ts +22 -0
- package/dist/section-refit.interface.d.ts +49 -0
- package/dist/section-refit.interface.js +6 -0
- package/dist/section-refit.js +179 -0
- package/dist/section-scale.d.ts +2 -0
- package/dist/section-scale.js +128 -0
- package/dist/sections.d.ts +23 -0
- package/dist/sections.js +144 -0
- package/dist/selling.d.ts +34 -0
- package/dist/selling.js +148 -0
- package/dist/spacing-repairs.d.ts +31 -0
- package/dist/spacing-repairs.js +168 -0
- package/dist/table-layout.d.ts +29 -0
- package/dist/table-layout.js +134 -0
- package/dist/validation.d.ts +7 -2
- package/dist/validation.interface.d.ts +20 -0
- package/dist/validation.interface.js +9 -0
- package/dist/validation.js +227 -78
- package/dist/wayfinding.d.ts +10 -0
- package/dist/wayfinding.interface.d.ts +52 -0
- package/dist/wayfinding.interface.js +28 -0
- package/dist/wayfinding.js +63 -0
- package/package.json +109 -4
- package/dist/types.d.ts +0 -313
- package/dist/types.js +0 -91
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type DomainIssue } from "./issues.js";
|
|
2
|
+
import { type PhysicalDocumentV1 } from "./physical-document.interface.js";
|
|
3
|
+
/** Marker contact is permitted; clearance advice never blocks publishing or marks inventory invalid. */
|
|
4
|
+
export declare function seatProximityIssues(document: PhysicalDocumentV1): readonly DomainIssue[];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { documentGroupSeats } from "./catalog.js";
|
|
2
|
+
import { IssueCode, IssueSeverity, issue } from "./issues.js";
|
|
3
|
+
import { rowBookingLabel, inventoryName } from "./labels.js";
|
|
4
|
+
import { sectionCatalog } from "./sections.js";
|
|
5
|
+
import { SeatingKind } from "./physical-document.interface.js";
|
|
6
|
+
import { project, worldMatrices } from "./geometry/geometry.js";
|
|
7
|
+
import { LayoutUnitM } from "./geometry/units.js";
|
|
8
|
+
const seatClearanceM = 20.7 * LayoutUnitM;
|
|
9
|
+
const contactToleranceM = 1e-9;
|
|
10
|
+
const findings = new WeakMap();
|
|
11
|
+
/** Project physical parts once; names and review targets keep their booking identity. */
|
|
12
|
+
function inventorySeats(document) {
|
|
13
|
+
const result = [];
|
|
14
|
+
const sections = sectionCatalog(document);
|
|
15
|
+
const labels = new Map(document.sections.map((section) => [section.id, section.label]));
|
|
16
|
+
const matrices = worldMatrices(document);
|
|
17
|
+
let nextOwner = 0;
|
|
18
|
+
for (const group of document.seatingGroups) {
|
|
19
|
+
const owners = new Map();
|
|
20
|
+
const rows = group.kind === SeatingKind.Straight || group.kind === SeatingKind.Curved;
|
|
21
|
+
const ids = rows ? group.rows.map((row) => row.id) : [group.id];
|
|
22
|
+
for (const [index, id] of ids.entries()) {
|
|
23
|
+
const sectionId = sections.owners.get(id);
|
|
24
|
+
const label = rows ? rowBookingLabel(group, index) : inventoryName(group.labels);
|
|
25
|
+
owners.set(id, {
|
|
26
|
+
index: nextOwner++,
|
|
27
|
+
id,
|
|
28
|
+
name: `${rows ? "Row" : "Table"} “${label}”${sectionId ? ` in “${labels.get(sectionId)}”` : ""}`,
|
|
29
|
+
floorId: group.floorId ?? null,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const world = matrices.get(group.id);
|
|
33
|
+
for (const seat of documentGroupSeats(document, group)) {
|
|
34
|
+
if (seat.slot.gap)
|
|
35
|
+
continue;
|
|
36
|
+
result.push({
|
|
37
|
+
...project(world, seat.position),
|
|
38
|
+
owner: owners.get(seat.rowId ?? group.id),
|
|
39
|
+
diameter: Math.min(seat.size.width, seat.size.height),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
/** Adjacent cells bound regular layouts; each physical owner pair contributes one nearest finding. */
|
|
46
|
+
function nearbyPairs(seats) {
|
|
47
|
+
const cellSize = seats.reduce((size, seat) => Math.max(size, seat.diameter), seatClearanceM);
|
|
48
|
+
const cells = new Map();
|
|
49
|
+
const pairs = new Map();
|
|
50
|
+
const compare = (first, second) => {
|
|
51
|
+
const distance = Math.hypot(first.x - second.x, first.y - second.y);
|
|
52
|
+
const overlapDistance = (first.diameter + second.diameter) / 2;
|
|
53
|
+
const overlapping = distance < overlapDistance - contactToleranceM;
|
|
54
|
+
if (!overlapping && distance >= seatClearanceM)
|
|
55
|
+
return;
|
|
56
|
+
const later = first.owner.index >= second.owner.index ? first.owner : second.owner;
|
|
57
|
+
const earlier = first.owner.index >= second.owner.index ? second.owner : first.owner;
|
|
58
|
+
const key = `${later.index}:${earlier.index}`;
|
|
59
|
+
const previous = pairs.get(key);
|
|
60
|
+
if (previous &&
|
|
61
|
+
((previous.overlapping && !overlapping) ||
|
|
62
|
+
(previous.overlapping === overlapping && previous.distance <= distance)))
|
|
63
|
+
return;
|
|
64
|
+
pairs.set(key, { first: later, second: earlier, distance, overlapDistance, overlapping });
|
|
65
|
+
};
|
|
66
|
+
for (const seat of seats) {
|
|
67
|
+
const x = Math.floor(seat.x / cellSize);
|
|
68
|
+
const y = Math.floor(seat.y / cellSize);
|
|
69
|
+
const floor = seat.owner.floorId ?? "";
|
|
70
|
+
for (let dy = -1; dy <= 1; dy++) {
|
|
71
|
+
for (let dx = -1; dx <= 1; dx++) {
|
|
72
|
+
for (const previous of cells.get(`${floor}:${x + dx}:${y + dy}`) ?? [])
|
|
73
|
+
compare(seat, previous);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const key = `${floor}:${x}:${y}`;
|
|
77
|
+
const cell = cells.get(key);
|
|
78
|
+
if (cell)
|
|
79
|
+
cell.push(seat);
|
|
80
|
+
else
|
|
81
|
+
cells.set(key, [seat]);
|
|
82
|
+
}
|
|
83
|
+
return [...pairs.values()].sort((a, b) => {
|
|
84
|
+
return a.first.index - b.first.index || a.second.index - b.second.index;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/** Marker contact is permitted; clearance advice never blocks publishing or marks inventory invalid. */
|
|
88
|
+
export function seatProximityIssues(document) {
|
|
89
|
+
const cached = findings.get(document);
|
|
90
|
+
if (cached)
|
|
91
|
+
return cached;
|
|
92
|
+
const result = nearbyPairs(inventorySeats(document)).map((pair) => {
|
|
93
|
+
const sameOwner = pair.first === pair.second;
|
|
94
|
+
let code;
|
|
95
|
+
let message;
|
|
96
|
+
if (pair.overlapping) {
|
|
97
|
+
code = IssueCode.SeatOverlap;
|
|
98
|
+
message = sameOwner
|
|
99
|
+
? `${pair.first.name} has overlapping seats`
|
|
100
|
+
: `${pair.first.name} and ${pair.second.name} overlap`;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
code = IssueCode.SeatCramped;
|
|
104
|
+
message = sameOwner
|
|
105
|
+
? `${pair.first.name} has seats too close together`
|
|
106
|
+
: `${pair.first.name} and ${pair.second.name} are too close together`;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
...issue(code, message, sameOwner ? [pair.first.id] : [pair.first.id, pair.second.id]),
|
|
110
|
+
severity: IssueSeverity.Warning,
|
|
111
|
+
blocks: [],
|
|
112
|
+
description: pair.overlapping
|
|
113
|
+
? `The closest seats are ${pair.distance.toFixed(2)} m apart, so their markers overlap on the buyer map; at least ${pair.overlapDistance.toFixed(2)} m keeps them apart.`
|
|
114
|
+
: `The closest seats are ${pair.distance.toFixed(2)} m apart; at least ${seatClearanceM.toFixed(2)} m is needed.`,
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
findings.set(document, result);
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type PhysicalDocumentV1, type Section, type SectionElevation } from "./physical-document.interface.js";
|
|
2
|
+
import { type ResolvedSectionElevation, type SectionElevationChange } from "./section-elevation.interface.js";
|
|
3
|
+
export { SectionElevationEdit, type SectionElevationChange, type ResolvedSectionElevation, } from "./section-elevation.interface.js";
|
|
4
|
+
export declare function resolveSectionElevation(document: PhysicalDocumentV1, section: Section): ResolvedSectionElevation;
|
|
5
|
+
export declare function editSectionElevation(section: Section, current: ResolvedSectionElevation, change: SectionElevationChange): SectionElevation;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PointM, SectionTier } from "./physical-document.interface.js";
|
|
2
|
+
export declare enum SectionElevationEdit {
|
|
3
|
+
Tier = "tier",
|
|
4
|
+
Rake = "rake",
|
|
5
|
+
Height = "height",
|
|
6
|
+
AutomaticHeight = "automatic-height",
|
|
7
|
+
KeepEstimate = "keep-estimate"
|
|
8
|
+
}
|
|
9
|
+
export type SectionElevationChange = {
|
|
10
|
+
kind: SectionElevationEdit.Tier;
|
|
11
|
+
tier: SectionTier;
|
|
12
|
+
} | {
|
|
13
|
+
kind: SectionElevationEdit.Rake | SectionElevationEdit.Height;
|
|
14
|
+
value: number;
|
|
15
|
+
} | {
|
|
16
|
+
kind: SectionElevationEdit.AutomaticHeight | SectionElevationEdit.KeepEstimate;
|
|
17
|
+
};
|
|
18
|
+
export type ResolvedSectionElevation = {
|
|
19
|
+
tier?: SectionTier;
|
|
20
|
+
focal?: PointM;
|
|
21
|
+
rakeDeg: number;
|
|
22
|
+
frontRowHeightM: number;
|
|
23
|
+
automaticHeightM: number;
|
|
24
|
+
exactHeight: boolean;
|
|
25
|
+
estimated: boolean;
|
|
26
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var SectionElevationEdit;
|
|
2
|
+
(function (SectionElevationEdit) {
|
|
3
|
+
SectionElevationEdit["Tier"] = "tier";
|
|
4
|
+
SectionElevationEdit["Rake"] = "rake";
|
|
5
|
+
SectionElevationEdit["Height"] = "height";
|
|
6
|
+
SectionElevationEdit["AutomaticHeight"] = "automatic-height";
|
|
7
|
+
SectionElevationEdit["KeepEstimate"] = "keep-estimate";
|
|
8
|
+
})(SectionElevationEdit || (SectionElevationEdit = {}));
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { authoredFloorFocalPoint } from "./floors.js";
|
|
2
|
+
import { SectionFrontRowHeight, SectionRake, SectionTier, } from "./physical-document.interface.js";
|
|
3
|
+
import { SectionElevationEdit, } from "./section-elevation.interface.js";
|
|
4
|
+
export { SectionElevationEdit, } from "./section-elevation.interface.js";
|
|
5
|
+
const TierRiseM = {
|
|
6
|
+
[SectionTier.Floor]: 0,
|
|
7
|
+
[SectionTier.RaisedOne]: 1.33,
|
|
8
|
+
[SectionTier.RaisedTwo]: 2.66,
|
|
9
|
+
[SectionTier.RaisedThree]: 3.99,
|
|
10
|
+
};
|
|
11
|
+
const DefaultFocalRakeDeg = 12;
|
|
12
|
+
export function resolveSectionElevation(document, section) {
|
|
13
|
+
const settings = section.elevation;
|
|
14
|
+
const tier = settings?.tier;
|
|
15
|
+
const focal = document.zones?.find(({ id }) => id === section.zoneId)?.focalPoint ??
|
|
16
|
+
authoredFloorFocalPoint(document, section.floorId ?? null);
|
|
17
|
+
const automaticHeightM = TierRiseM[tier ?? SectionTier.Floor];
|
|
18
|
+
const exactHeight = settings?.frontRowHeightM !== undefined;
|
|
19
|
+
const estimated = Boolean(focal) && automaticHeightM === 0 && !exactHeight && settings?.rakeDeg === undefined;
|
|
20
|
+
return {
|
|
21
|
+
tier,
|
|
22
|
+
focal,
|
|
23
|
+
exactHeight,
|
|
24
|
+
estimated,
|
|
25
|
+
automaticHeightM,
|
|
26
|
+
frontRowHeightM: settings?.frontRowHeightM ?? automaticHeightM,
|
|
27
|
+
rakeDeg: settings?.rakeDeg ?? (estimated ? DefaultFocalRakeDeg : 0),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function bounded(value, { min, max }) {
|
|
31
|
+
return Math.round(Math.min(max, Math.max(min, value)) * 100) / 100;
|
|
32
|
+
}
|
|
33
|
+
export function editSectionElevation(section, current, change) {
|
|
34
|
+
const settings = section.elevation;
|
|
35
|
+
const tier = settings?.tier ?? SectionTier.Floor;
|
|
36
|
+
switch (change.kind) {
|
|
37
|
+
case SectionElevationEdit.Tier:
|
|
38
|
+
return { tier: change.tier, rakeDeg: settings?.rakeDeg ?? 0 };
|
|
39
|
+
case SectionElevationEdit.Rake:
|
|
40
|
+
return {
|
|
41
|
+
...settings,
|
|
42
|
+
tier,
|
|
43
|
+
rakeDeg: bounded(change.value, SectionRake),
|
|
44
|
+
...(!settings?.tier ? { frontRowHeightM: current.frontRowHeightM } : {}),
|
|
45
|
+
};
|
|
46
|
+
case SectionElevationEdit.Height:
|
|
47
|
+
return { ...settings, tier, frontRowHeightM: bounded(change.value, SectionFrontRowHeight) };
|
|
48
|
+
case SectionElevationEdit.AutomaticHeight:
|
|
49
|
+
return { tier, ...(settings?.rakeDeg !== undefined ? { rakeDeg: settings.rakeDeg } : {}) };
|
|
50
|
+
case SectionElevationEdit.KeepEstimate:
|
|
51
|
+
return { tier, rakeDeg: current.rakeDeg, frontRowHeightM: current.frontRowHeightM };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LabelDirection, NumberingScheme, type PhysicalDocumentV1, type Section, type UUID } from "./physical-document.interface.js";
|
|
2
|
+
import { type SectionFillExistingRow, type SectionFillPlan, type SectionFillReview } from "./section-fill.interface.js";
|
|
3
|
+
export declare const sectionFillRowNames: {
|
|
4
|
+
scheme: NumberingScheme;
|
|
5
|
+
startAt: number;
|
|
6
|
+
direction: LabelDirection;
|
|
7
|
+
};
|
|
8
|
+
export declare function sectionFillRows(document: PhysicalDocumentV1, sectionId: UUID): SectionFillExistingRow[];
|
|
9
|
+
/** Generated row and part ordinals own carry-forward. Printed labels and row geometry may change independently. */
|
|
10
|
+
export declare function reviewSectionFill(section: Section, source: readonly SectionFillExistingRow[], plan: SectionFillPlan, defaultCategoryId: UUID | undefined): SectionFillReview;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { rowBookingLabel, rowDisplayLabel, sequenceLabel } from "./labels.js";
|
|
2
|
+
import { LabelDirection, NumberingScheme, } from "./physical-document.interface.js";
|
|
3
|
+
import { SectionFillLossReason, } from "./section-fill.interface.js";
|
|
4
|
+
import { sectionCatalog } from "./sections.js";
|
|
5
|
+
export const sectionFillRowNames = {
|
|
6
|
+
scheme: NumberingScheme.Alphabetic,
|
|
7
|
+
startAt: 1,
|
|
8
|
+
direction: LabelDirection.Forward,
|
|
9
|
+
};
|
|
10
|
+
export function sectionFillRows(document, sectionId) {
|
|
11
|
+
const members = sectionCatalog(document).entries.get(sectionId)?.inventory;
|
|
12
|
+
if (!members?.size)
|
|
13
|
+
return [];
|
|
14
|
+
return document.seatingGroups.flatMap((group) => "rows" in group
|
|
15
|
+
? group.rows.flatMap((row, index) => members.has(row.id)
|
|
16
|
+
? [
|
|
17
|
+
{
|
|
18
|
+
row,
|
|
19
|
+
displayLabel: rowDisplayLabel(group, index),
|
|
20
|
+
bookingLabel: rowBookingLabel(group, index),
|
|
21
|
+
categoryId: row.categoryId === undefined ? group.categoryId : row.categoryId,
|
|
22
|
+
},
|
|
23
|
+
]
|
|
24
|
+
: [])
|
|
25
|
+
: []);
|
|
26
|
+
}
|
|
27
|
+
/** Generated row and part ordinals own carry-forward. Printed labels and row geometry may change independently. */
|
|
28
|
+
export function reviewSectionFill(section, source, plan, defaultCategoryId) {
|
|
29
|
+
const carried = new Map();
|
|
30
|
+
const losses = [];
|
|
31
|
+
let settingsKept = 0;
|
|
32
|
+
for (const { row, displayLabel, bookingLabel, categoryId } of source) {
|
|
33
|
+
const origin = row.fillOrigin;
|
|
34
|
+
const belongs = origin?.sectionId === section.id;
|
|
35
|
+
const planned = belongs ? plan.rows[origin.rowIndex]?.parts[origin.partIndex] : undefined;
|
|
36
|
+
const target = planned && !carried.has(planned) ? planned : undefined;
|
|
37
|
+
const rowName = belongs
|
|
38
|
+
? `${section.label}-${sequenceLabel(sectionFillRowNames, origin.rowIndex, 1)}${origin.partIndex ? `-${origin.partIndex + 1}` : ""}`
|
|
39
|
+
: displayLabel;
|
|
40
|
+
const seats = new Map();
|
|
41
|
+
if (target)
|
|
42
|
+
carried.set(target, { bookingLabel, seats });
|
|
43
|
+
row.seats.forEach((slot, index) => {
|
|
44
|
+
const { id, gap, categoryId: ownCategory, ...settings } = slot;
|
|
45
|
+
const effectiveCategory = ownCategory === undefined ? categoryId : ownCategory;
|
|
46
|
+
const carryCategory = effectiveCategory !== undefined && effectiveCategory !== defaultCategoryId;
|
|
47
|
+
const hasSettings = gap || carryCategory || Object.values(settings).some((value) => value !== undefined);
|
|
48
|
+
const exists = target !== undefined && index < target.seats;
|
|
49
|
+
if (exists && !gap) {
|
|
50
|
+
seats.set(index, { id, ...settings, ...(carryCategory && { categoryId: effectiveCategory }) });
|
|
51
|
+
if (hasSettings)
|
|
52
|
+
settingsKept++;
|
|
53
|
+
}
|
|
54
|
+
else if (hasSettings) {
|
|
55
|
+
losses.push({
|
|
56
|
+
row: rowName,
|
|
57
|
+
seat: slot.labelOverride ?? String(index + 1),
|
|
58
|
+
reason: exists ? SectionFillLossReason.Gap : SectionFillLossReason.MissingSeat,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return { carried, settingsKept, losses };
|
|
64
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SectionOutlineRole, type PhysicalDocumentV1, type PointM, type PolygonM, type Section } from "./physical-document.interface.js";
|
|
3
|
+
import { SectionFillDirection, SectionFillNumbering, type SectionFillInput, type SectionFillPlan, type SectionGrowInput } from "./section-fill.interface.js";
|
|
4
|
+
export { SectionFillDirection, SectionFillNumbering, SectionFillStatus } from "./section-fill.interface.js";
|
|
5
|
+
export type { SectionFillInput, SectionFillPart, SectionFillPlan, SectionFillRow, SectionFillReview, SectionGrowInput, } from "./section-fill.interface.js";
|
|
6
|
+
export { sectionOutlineSampleContour, sectionOutlineSamplingScale } from "./section-outline-refit.js";
|
|
7
|
+
export { sectionFillRows, reviewSectionFill, sectionFillRowNames } from "./section-fill-rebuild.js";
|
|
8
|
+
export declare const sectionFillDefaults: {
|
|
9
|
+
readonly direction: SectionFillDirection.Straight;
|
|
10
|
+
readonly numbering: SectionFillNumbering.Snake;
|
|
11
|
+
readonly seatPitchM: number;
|
|
12
|
+
readonly rowPitchM: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const SectionFillLimits: {
|
|
15
|
+
readonly seats: {
|
|
16
|
+
readonly min: 1;
|
|
17
|
+
readonly max: 10000;
|
|
18
|
+
};
|
|
19
|
+
readonly rows: {
|
|
20
|
+
readonly min: 1;
|
|
21
|
+
readonly max: 100;
|
|
22
|
+
};
|
|
23
|
+
readonly seatPitchM: {
|
|
24
|
+
readonly min: 0.25;
|
|
25
|
+
readonly max: 1.2;
|
|
26
|
+
};
|
|
27
|
+
readonly rowPitchM: {
|
|
28
|
+
readonly min: 0.3;
|
|
29
|
+
readonly max: 1.5;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const sectionFillInputSchema: z.ZodObject<{
|
|
33
|
+
targetSeats: z.ZodNumber;
|
|
34
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
direction: z.ZodEnum<typeof SectionFillDirection>;
|
|
36
|
+
numbering: z.ZodEnum<typeof SectionFillNumbering>;
|
|
37
|
+
seatPitchM: z.ZodNumber;
|
|
38
|
+
rowPitchM: z.ZodNumber;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
export declare const sectionGrowInputSchema: z.ZodObject<{
|
|
41
|
+
sectionId: z.ZodUUID;
|
|
42
|
+
fill: z.ZodObject<{
|
|
43
|
+
targetSeats: z.ZodNumber;
|
|
44
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
direction: z.ZodEnum<typeof SectionFillDirection>;
|
|
46
|
+
numbering: z.ZodEnum<typeof SectionFillNumbering>;
|
|
47
|
+
seatPitchM: z.ZodNumber;
|
|
48
|
+
rowPitchM: z.ZodNumber;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export declare function sectionFillFocalPoint(document: PhysicalDocumentV1, section: Section): PointM;
|
|
52
|
+
export declare function planSectionGrowth(document: PhysicalDocumentV1, { sectionId, fill }: SectionGrowInput): {
|
|
53
|
+
section: {
|
|
54
|
+
outline: PolygonM;
|
|
55
|
+
entrance?: import("./wayfinding.interface.js").EntranceAssignment;
|
|
56
|
+
buyerPhoto?: import("./physical-document.interface.js").BuyerPhoto;
|
|
57
|
+
floorId?: import("./physical-document.interface.js").UUID;
|
|
58
|
+
zoneId?: import("./physical-document.interface.js").UUID;
|
|
59
|
+
elevation?: import("./physical-document.interface.js").SectionElevation;
|
|
60
|
+
categoryId?: import("./physical-document.interface.js").UUID | null;
|
|
61
|
+
id: import("./physical-document.interface.js").UUID;
|
|
62
|
+
label: string;
|
|
63
|
+
displayLabel?: string;
|
|
64
|
+
outlineRole?: SectionOutlineRole;
|
|
65
|
+
rotationDeg?: number;
|
|
66
|
+
scalePercent?: number;
|
|
67
|
+
outlineGrowthFactor?: number;
|
|
68
|
+
rowRefitStrength?: number;
|
|
69
|
+
style?: import("./physical-document.interface.js").DecorationStyle;
|
|
70
|
+
labelPlacement?: import("./physical-document.interface.js").SectionLabelPlacement;
|
|
71
|
+
labelStyle: import("./physical-document.interface.js").LabelStyle;
|
|
72
|
+
};
|
|
73
|
+
grown: Section & {
|
|
74
|
+
outline: PolygonM;
|
|
75
|
+
};
|
|
76
|
+
} | undefined;
|
|
77
|
+
/** Preview a section fill without allocating inventory identities or editing the outline. */
|
|
78
|
+
export declare function planSectionFill(outline: PolygonM, request: SectionFillInput, focalPoint: PointM, sampleScale?: number): SectionFillPlan;
|
|
79
|
+
/** Grow only the authored outline and its openings. Inventory keeps its current layout. */
|
|
80
|
+
export declare function growSectionOutline(section: Section & {
|
|
81
|
+
outline: PolygonM;
|
|
82
|
+
}, request: SectionFillInput, focalPoint: PointM, maximumSeats: number): (Section & {
|
|
83
|
+
outline: PolygonM;
|
|
84
|
+
}) | undefined;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { PreparedBoundary } from "./geometry/boundary.js";
|
|
2
|
+
import type { LabelDirection, PointM, RowLayout, RowSlot, SeatSlot, StraightRows, UUID } from "./physical-document.interface.js";
|
|
3
|
+
export declare enum SectionFillDirection {
|
|
4
|
+
Straight = "straight",
|
|
5
|
+
Focal = "focal"
|
|
6
|
+
}
|
|
7
|
+
export declare enum SectionFillNumbering {
|
|
8
|
+
Snake = "snake",
|
|
9
|
+
LeftToRight = "leftToRight",
|
|
10
|
+
RightToLeft = "rightToLeft"
|
|
11
|
+
}
|
|
12
|
+
export declare enum SectionFillStatus {
|
|
13
|
+
Fits = "fits",
|
|
14
|
+
Capacity = "capacity",
|
|
15
|
+
Rows = "rows"
|
|
16
|
+
}
|
|
17
|
+
export type SectionFillInput = {
|
|
18
|
+
targetSeats: number;
|
|
19
|
+
rowCount?: number | undefined;
|
|
20
|
+
direction: SectionFillDirection;
|
|
21
|
+
numbering: SectionFillNumbering;
|
|
22
|
+
seatPitchM: number;
|
|
23
|
+
rowPitchM: number;
|
|
24
|
+
};
|
|
25
|
+
export type SectionGrowInput = {
|
|
26
|
+
sectionId: UUID;
|
|
27
|
+
fill: SectionFillInput;
|
|
28
|
+
};
|
|
29
|
+
export type SectionFillPart = {
|
|
30
|
+
layout: RowLayout;
|
|
31
|
+
seats: number;
|
|
32
|
+
};
|
|
33
|
+
export type SectionFillRow = {
|
|
34
|
+
parts: SectionFillPart[];
|
|
35
|
+
numbering: LabelDirection;
|
|
36
|
+
};
|
|
37
|
+
export type SectionFillPlan = {
|
|
38
|
+
status: SectionFillStatus;
|
|
39
|
+
maximumSeats: number;
|
|
40
|
+
maximumRows: number;
|
|
41
|
+
recipe: Pick<StraightRows["recipe"], "seatPitchM" | "rowPitchM">;
|
|
42
|
+
rows: SectionFillRow[];
|
|
43
|
+
};
|
|
44
|
+
export type SectionFillInterval = {
|
|
45
|
+
start: number;
|
|
46
|
+
end: number;
|
|
47
|
+
capacity: number;
|
|
48
|
+
};
|
|
49
|
+
export type SectionFillBand = {
|
|
50
|
+
y: number;
|
|
51
|
+
intervals: SectionFillInterval[];
|
|
52
|
+
capacity: number;
|
|
53
|
+
};
|
|
54
|
+
export type SectionFillEdge = {
|
|
55
|
+
low: PointM;
|
|
56
|
+
high: PointM;
|
|
57
|
+
slope: number;
|
|
58
|
+
};
|
|
59
|
+
export type SectionFillGrid = {
|
|
60
|
+
angle: number;
|
|
61
|
+
seatPitchM: number;
|
|
62
|
+
rowPitchM: number;
|
|
63
|
+
bands: SectionFillBand[];
|
|
64
|
+
capacity: number;
|
|
65
|
+
};
|
|
66
|
+
export type SectionFillBend = {
|
|
67
|
+
focalPoint: PointM;
|
|
68
|
+
boundary: PreparedBoundary;
|
|
69
|
+
normal: PointM;
|
|
70
|
+
clearanceM: number;
|
|
71
|
+
};
|
|
72
|
+
export declare enum SectionFillLossReason {
|
|
73
|
+
MissingSeat = "the seat no longer exists",
|
|
74
|
+
Gap = "removed seats"
|
|
75
|
+
}
|
|
76
|
+
export type SectionFillExistingRow = {
|
|
77
|
+
row: RowSlot;
|
|
78
|
+
displayLabel: string;
|
|
79
|
+
bookingLabel: string;
|
|
80
|
+
categoryId?: UUID | null;
|
|
81
|
+
};
|
|
82
|
+
export type SectionFillLoss = {
|
|
83
|
+
row: string;
|
|
84
|
+
seat: string;
|
|
85
|
+
reason: SectionFillLossReason;
|
|
86
|
+
};
|
|
87
|
+
export type SectionFillReview = {
|
|
88
|
+
carried: ReadonlyMap<SectionFillPart, {
|
|
89
|
+
bookingLabel: string;
|
|
90
|
+
seats: ReadonlyMap<number, SeatSlot>;
|
|
91
|
+
}>;
|
|
92
|
+
settingsKept: number;
|
|
93
|
+
losses: SectionFillLoss[];
|
|
94
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var SectionFillDirection;
|
|
2
|
+
(function (SectionFillDirection) {
|
|
3
|
+
SectionFillDirection["Straight"] = "straight";
|
|
4
|
+
SectionFillDirection["Focal"] = "focal";
|
|
5
|
+
})(SectionFillDirection || (SectionFillDirection = {}));
|
|
6
|
+
export var SectionFillNumbering;
|
|
7
|
+
(function (SectionFillNumbering) {
|
|
8
|
+
SectionFillNumbering["Snake"] = "snake";
|
|
9
|
+
SectionFillNumbering["LeftToRight"] = "leftToRight";
|
|
10
|
+
SectionFillNumbering["RightToLeft"] = "rightToLeft";
|
|
11
|
+
})(SectionFillNumbering || (SectionFillNumbering = {}));
|
|
12
|
+
export var SectionFillStatus;
|
|
13
|
+
(function (SectionFillStatus) {
|
|
14
|
+
SectionFillStatus["Fits"] = "fits";
|
|
15
|
+
SectionFillStatus["Capacity"] = "capacity";
|
|
16
|
+
SectionFillStatus["Rows"] = "rows";
|
|
17
|
+
})(SectionFillStatus || (SectionFillStatus = {}));
|
|
18
|
+
export var SectionFillLossReason;
|
|
19
|
+
(function (SectionFillLossReason) {
|
|
20
|
+
SectionFillLossReason["MissingSeat"] = "the seat no longer exists";
|
|
21
|
+
SectionFillLossReason["Gap"] = "removed seats";
|
|
22
|
+
})(SectionFillLossReason || (SectionFillLossReason = {}));
|