@seatlayer/core 0.100.0 → 0.102.0
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/ar-TGXEBJUB.js +1 -0
- package/dist/be-JIDOHWF6.js +1 -0
- package/dist/bg-ODVJNCC2.js +1 -0
- package/dist/ca-3I7TMWYU.js +1 -0
- package/dist/{categoryInventory-DuOez0-4.d.cts → categoryInventory-7gSFTu0l.d.cts} +1 -1
- package/dist/{categoryInventory-DdJdJ4Og.d.ts → categoryInventory-hJxuFF9L.d.ts} +1 -1
- package/dist/chunk-254ABRJF.js +1 -0
- package/dist/{chunk-VWT44HBR.js → chunk-4DYJCT62.js} +1 -1
- package/dist/chunk-4R6TXHY2.js +1 -0
- package/dist/{chunk-D723OZEY.js → chunk-66T4EAUA.js} +1 -1
- package/dist/{chunk-GLGXP5I7.js → chunk-AFJWTB7L.js} +1 -1
- package/dist/chunk-COECA63Q.js +1 -0
- package/dist/chunk-EIV3CAGV.js +1 -0
- package/dist/chunk-FOIYJ5NT.js +1 -0
- package/dist/chunk-FUFRWRPM.js +1 -0
- package/dist/{chunk-KFVUBZMK.js → chunk-GPZFVQXV.js} +1 -1
- package/dist/{chunk-L34T3APU.js → chunk-GTRYL7YV.js} +1 -1
- package/dist/chunk-JRZHC75P.js +1 -0
- package/dist/chunk-KTMZ3QAO.js +1 -0
- package/dist/chunk-PHV2U54Y.js +1 -0
- package/dist/chunk-TAMY7HTV.js +1 -0
- package/dist/chunk-UEDS3HJ3.js +1 -0
- package/dist/{chunk-P4J57TK6.js → chunk-YPVYZYMH.js} +1 -1
- package/dist/chunk-ZS5YFXSE.js +1 -0
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +30 -9
- package/dist/core/chart-ops/index.d.ts +30 -9
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +72 -5
- package/dist/core/inventory/index.d.ts +72 -5
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +63 -6
- package/dist/core/layout/index.d.ts +63 -6
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +18 -4
- package/dist/core/quality/index.d.ts +18 -4
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.cjs +1 -1
- package/dist/core/render-assets/index.d.cts +2 -2
- package/dist/core/render-assets/index.d.ts +2 -2
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/cs-XXB624Z3.js +1 -0
- package/dist/cy-W2QNU2GO.js +1 -0
- package/dist/da-Q47YPK2E.js +1 -0
- package/dist/de-TS3DPLM5.js +1 -0
- package/dist/{el-ZPFVDCWA.js → el-3JQUH6DB.js} +1 -1
- package/dist/es-GP7VOX7S.js +1 -0
- package/dist/et-A22OMZ6V.js +1 -0
- package/dist/{eventConfigurations-DYn5XP3J.d.cts → eventConfigurations-BHIfPJJJ.d.cts} +1 -1
- package/dist/{eventConfigurations-BISNREZL.d.ts → eventConfigurations-I5UBS6r9.d.ts} +1 -1
- package/dist/fa-5MS3C6YX.js +1 -0
- package/dist/fi-OJLAOJO2.js +1 -0
- package/dist/fr-7ATOYJCF.js +1 -0
- package/dist/he-37LKRY5W.js +1 -0
- package/dist/hi-YXZ5EWK7.js +1 -0
- package/dist/hr-QFOPGLMR.js +1 -0
- package/dist/hu-RHRBK46E.js +1 -0
- package/dist/id-A5Q3MLSX.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +58 -17
- package/dist/index.d.ts +58 -17
- package/dist/index.js +1 -1
- package/dist/it-KG53QPQF.js +1 -0
- package/dist/ja-CC6EPUSN.js +1 -0
- package/dist/ko-7H4RGYFK.js +1 -0
- package/dist/ku-HFYWPSS4.js +1 -0
- package/dist/{labeling-CzuSxAkr.d.ts → labeling-2A31f781.d.cts} +11 -3
- package/dist/{labeling-owTTG6e0.d.cts → labeling-CDKZ9TO1.d.ts} +11 -3
- package/dist/localeLoaders-4YMC7FIZ.js +1 -0
- package/dist/lt-HQXE7W47.js +1 -0
- package/dist/lv-AN25XXPB.js +1 -0
- package/dist/ms-CWAYSF6E.js +1 -0
- package/dist/nl-63QBRZSZ.js +1 -0
- package/dist/no-RAPQMKWU.js +1 -0
- package/dist/pl-ILSTD4ZV.js +1 -0
- package/dist/pt-WF3US5D7.js +1 -0
- package/dist/{renderedQuality-BZycehrC.d.cts → renderedQuality-CwZ8hY-5.d.cts} +1 -1
- package/dist/{renderedQuality-DPElQ3-x.d.ts → renderedQuality-wDIiUId3.d.ts} +1 -1
- package/dist/{renderer-DnsIDiWN.d.cts → renderer-CdJx5l3B.d.ts} +12 -3
- package/dist/{renderer-DPKIlnuF.d.ts → renderer-D6ggv3bV.d.cts} +12 -3
- package/dist/ro-XR3HT6DE.js +1 -0
- package/dist/ru-TLJEWDPA.js +1 -0
- package/dist/{seatTypeIcons-dy3XQVWN.d.ts → seatTypeIcons-DMJX4rVN.d.cts} +2 -2
- package/dist/{seatTypeIcons-QwEebl3k.d.cts → seatTypeIcons-UpUTD8Xf.d.ts} +2 -2
- package/dist/{sections-DSIfnBJY.d.cts → sections-CempT5a0.d.cts} +5 -2
- package/dist/{sections-C8VTe6BN.d.ts → sections-lpdfwSdO.d.ts} +5 -2
- package/dist/{segmentedRowModel-CDvvJJ4-.d.cts → segmentedRowModel-Ddx5ol8T.d.cts} +1 -1
- package/dist/{segmentedRowModel-I8eYUQft.d.ts → segmentedRowModel-HwY4XuYa.d.ts} +1 -1
- package/dist/sk-OJC2EL3Z.js +1 -0
- package/dist/sl-7RGTVXCV.js +1 -0
- package/dist/sr-NHDJ54BS.js +1 -0
- package/dist/sv-ZODCCBCU.js +1 -0
- package/dist/{tableSizing-x8ADFtKS.d.cts → tableSizing-BJqAuJDg.d.cts} +3 -3
- package/dist/{tableSizing-0PwrOWi5.d.ts → tableSizing-C0zx97eg.d.ts} +3 -3
- package/dist/th-VCZA4MP5.js +1 -0
- package/dist/{ticketRestrictions-C8H-XJha.d.ts → ticketRestrictions-AU8UUmdL.d.ts} +39 -3
- package/dist/{ticketRestrictions-O-fv0Os6.d.cts → ticketRestrictions-DDQHiKF-.d.cts} +39 -3
- package/dist/tr-ROKZO3HC.js +1 -0
- package/dist/{types-DWx32xXH.d.cts → types-DL7qIUrD.d.cts} +85 -2
- package/dist/{types-DWx32xXH.d.ts → types-DL7qIUrD.d.ts} +85 -2
- package/dist/uk-LP2DPUHC.js +1 -0
- package/dist/vi-JDK3JRJR.js +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +102 -60
- package/dist/view3d/index.d.cts +26 -5
- package/dist/view3d/index.d.ts +26 -5
- package/dist/view3d/index.js +100 -58
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-P3GB3FAZ.js +1 -0
- package/dist/zh-Hant-YU4OKSFZ.js +1 -0
- package/package.json +1 -1
- package/dist/ar-Q44JP5JY.js +0 -1
- package/dist/be-CGFFSIQL.js +0 -1
- package/dist/bg-WOYK6OLH.js +0 -1
- package/dist/ca-77ZVI3X5.js +0 -1
- package/dist/chunk-23OTKCJU.js +0 -1
- package/dist/chunk-5BMXWOE7.js +0 -1
- package/dist/chunk-5ITK5236.js +0 -1
- package/dist/chunk-COOPHSHM.js +0 -1
- package/dist/chunk-CTIGUXXK.js +0 -1
- package/dist/chunk-HO4MFTVX.js +0 -1
- package/dist/chunk-HYEZPOZU.js +0 -1
- package/dist/chunk-N4J4CT6P.js +0 -1
- package/dist/chunk-QJXSZT3H.js +0 -1
- package/dist/chunk-UIMDB6GZ.js +0 -1
- package/dist/chunk-UISTXRO5.js +0 -1
- package/dist/cs-OSBZYCSR.js +0 -1
- package/dist/cy-ZCOJW2WH.js +0 -1
- package/dist/da-2PDK6JTR.js +0 -1
- package/dist/de-R5LLVFUU.js +0 -1
- package/dist/es-7YASJP32.js +0 -1
- package/dist/et-J4TV6KQL.js +0 -1
- package/dist/fa-4TEO7UGM.js +0 -1
- package/dist/fi-GIUDDKMH.js +0 -1
- package/dist/fr-J5J2XJLA.js +0 -1
- package/dist/he-OCEHSVUJ.js +0 -1
- package/dist/hi-EK5CTBW5.js +0 -1
- package/dist/hr-SLDTQOYC.js +0 -1
- package/dist/hu-2QNE77NO.js +0 -1
- package/dist/id-LGDAFQJK.js +0 -1
- package/dist/it-DT4Y3IYB.js +0 -1
- package/dist/ja-D5EY2XCQ.js +0 -1
- package/dist/ko-DD2NV45Q.js +0 -1
- package/dist/ku-KZCMVLBE.js +0 -1
- package/dist/localeLoaders-GGAKX22E.js +0 -1
- package/dist/lt-QWGTJ47Y.js +0 -1
- package/dist/lv-LYAIG3VK.js +0 -1
- package/dist/ms-XTF4KNGD.js +0 -1
- package/dist/nl-QEXY6XHS.js +0 -1
- package/dist/no-HCOXN2CN.js +0 -1
- package/dist/pl-BWY53TSD.js +0 -1
- package/dist/pt-2UJUBCPL.js +0 -1
- package/dist/ro-GGXOLTED.js +0 -1
- package/dist/ru-ZTFK3WCU.js +0 -1
- package/dist/sk-KU543Y2U.js +0 -1
- package/dist/sl-FT576R7A.js +0 -1
- package/dist/sr-WE3J46JE.js +0 -1
- package/dist/sv-YEAOPSEB.js +0 -1
- package/dist/th-BEBRDHJA.js +0 -1
- package/dist/tr-LOAHUPSH.js +0 -1
- package/dist/uk-2GMICSHN.js +0 -1
- package/dist/vi-TC5B6AUR.js +0 -1
- package/dist/zh-Hans-TSZWTZQY.js +0 -1
- package/dist/zh-Hant-TLB4FZYM.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-
|
|
2
|
-
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-
|
|
3
|
-
export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-
|
|
4
|
-
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as
|
|
1
|
+
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-DL7qIUrD.cjs';
|
|
2
|
+
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-D6ggv3bV.cjs';
|
|
3
|
+
export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-7gSFTu0l.cjs';
|
|
4
|
+
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GABoxMode, b as GA_UNIT_LABEL_PREFIX, c as GroupedTableBookingMode, d as GroupedTableInventoryUnit, e as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, f as MAX_GA_CAPACITY, g as MAX_ONE_PARTY_GUESTS, N as NotForSaleSelectionIssue, O as ONE_PARTY_LIMIT_MESSAGE, R as RestrictionChartDoc, h as RestrictionSeat, T as TicketOptionApplicabilityIssue, i as TicketSelection, j as TicketSelectionIssue, k as TicketSelectionOptions, l as TicketTierResolution, m as applicableTicketTiers, n as companionSelectionIssue, o as eventInventoryLimitFor, p as gaAreasOf, q as gaBoxBounds, r as gaBoxMode, s as gaInventorySegments, t as gaUnitLabel, u as gaUnitLabels, v as gaUnitLabelsForModel, w as gaWheelchairPlaceCount, x as gaWheelchairUnitLabels, y as groupedTableInventory, z as growJoinedGAInventory, A as isFullChartDoc, B as isGaUnitLabel, E as resolveTicketTierForSeat, F as ticketOptionNotApplicableIssue, H as ticketSelectionIssue, I as ticketTierAppliesToSeat, J as validGAInventorySegments } from '../../ticketRestrictions-DDQHiKF-.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Best-available seat selection — a PURE, fully unit-testable ranking function.
|
|
@@ -19,6 +19,15 @@ export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DE
|
|
|
19
19
|
* "Best" means, in priority order:
|
|
20
20
|
* 0. (opt-in) a run made entirely of `commercial.premium` seats — only when
|
|
21
21
|
* `preferPremium` is set; absent = this term is inert (byte-identical).
|
|
22
|
+
* ½. A run with fewer seats BEHIND THE STAGE (see `behindStageLabels`): on
|
|
23
|
+
* an end-stage layout, a seat in a block that reaches behind the focal
|
|
24
|
+
* point ranks after every seat in front of it, however close it sits.
|
|
25
|
+
* Off for in-the-round/arena layouts, for a single-category or
|
|
26
|
+
* single-zone request, and for a replacement-seat request.
|
|
27
|
+
* ¾. (opt-in) a run holding at least one AISLE seat — only when
|
|
28
|
+
* `preferAisle` is set with the chart's `aisleLabels`; absent = inert.
|
|
29
|
+
* After the behind-the-stage tier: an aisle is never worth a seat
|
|
30
|
+
* behind the stage. Before orphan and distance.
|
|
22
31
|
* 1. A single contiguous run of `qty` adjacent-available seats in ONE row
|
|
23
32
|
* (a booked/held/missing/wrong-category seat breaks contiguity).
|
|
24
33
|
* 2. …that does NOT strand a single isolated free seat ("orphan") beside the
|
|
@@ -59,7 +68,65 @@ interface BestAvailableOpts {
|
|
|
59
68
|
preferNearest?: boolean;
|
|
60
69
|
/** Logical rows containing the original seats in a recovery request. */
|
|
61
70
|
preferredRowIds?: readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* Opt-in aisle bias: a run holding at least one of `aisleLabels` beats one
|
|
73
|
+
* that holds none, after the behind-the-stage tier and before the
|
|
74
|
+
* orphan/distance rules. Inert unless both are given (byte-identical).
|
|
75
|
+
* `aisleLabels` are booking labels of aisle seats (core/layout/aisleSeats).
|
|
76
|
+
*/
|
|
77
|
+
preferAisle?: boolean;
|
|
78
|
+
aisleLabels?: ReadonlySet<string>;
|
|
62
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The labels of seats that sit BEHIND THE STAGE on an end-stage layout —
|
|
82
|
+
* empty when the layout is not end-stage.
|
|
83
|
+
*
|
|
84
|
+
* Seen on the Grand Theatre demo (2026-09-26): "Find 2 best seats" (all
|
|
85
|
+
* prices, any zone) picked West Choir A-1/A-2. The choir wraps round the
|
|
86
|
+
* sides and back of the stage, 266 units from the focal point, which is ON
|
|
87
|
+
* the stage; the nearest arena seat is 476 away, so distance alone put the
|
|
88
|
+
* choir first.
|
|
89
|
+
*
|
|
90
|
+
* Seats are taken per focal point (a zone may carry its own). For each group:
|
|
91
|
+
*
|
|
92
|
+
* - The AUDIENCE AXIS runs from the focal point F to the centroid of the
|
|
93
|
+
* group's seats: on an end stage, from the stage into the house.
|
|
94
|
+
* - A seat's DEPTH is its signed distance along that axis from F. A seat
|
|
95
|
+
* with negative depth is on the far side of the focal point from the
|
|
96
|
+
* audience: behind the stage.
|
|
97
|
+
* - A BLOCK (the seat's section, or its logical row when it has none) that
|
|
98
|
+
* reaches behind the stage is a stage-side block, and every seat in it
|
|
99
|
+
* ranks after the house. The choir's last seat, level with the stage lip,
|
|
100
|
+
* is only "close" because the choir hugs the stage.
|
|
101
|
+
*
|
|
102
|
+
* Why the focal point and not the stage's own outline: a thrust or a runway
|
|
103
|
+
* puts the stage's deepest point well into the house, and the tables and the
|
|
104
|
+
* parterre ends flanking it are among the best seats. Measured on the bundled
|
|
105
|
+
* templates, a stage-lip line demoted the whole opera parterre and a comedy
|
|
106
|
+
* club's front tables; the focal-point line demotes choirs, platform parties,
|
|
107
|
+
* head tables and the side blocks level with an arena's end stage.
|
|
108
|
+
*
|
|
109
|
+
* WHEN IT DOES NOT APPLY. In the round, in an arena bowl, in a stadium, on a
|
|
110
|
+
* thrust, the audience surrounds the focal point and "behind" means nothing.
|
|
111
|
+
* That is decided by COUNTING, not by a knife-edge distance: a group is
|
|
112
|
+
* end-stage only while at most one seat in ten sits behind its focal point,
|
|
113
|
+
* and the stage-side blocks hold at most one seat in four. Measured over every
|
|
114
|
+
* bundled template (2026-09-26): every end-stage theatre, hall and cinema has
|
|
115
|
+
* 0-8% of its seats behind the focal point; the nearest layouts that are not
|
|
116
|
+
* end-stage (a nightclub, a ballpark grandstand) 13%; the thrust, black-box
|
|
117
|
+
* and esports layouts 18-20%; every bowl, stadium and in-the-round layout
|
|
118
|
+
* 36-50%. The cut at 10% sits in the gap, with room on both sides.
|
|
119
|
+
*
|
|
120
|
+
* FLOAT-SAFE BY CONSTRUCTION (CLAUDE.md: x86 and arm64 disagree on
|
|
121
|
+
* near-equal floats). A seat within a tolerance of the line through F counts
|
|
122
|
+
* as ON the line, never behind it, so a seat level with the focal point
|
|
123
|
+
* cannot flip between runners. The tolerance is a millionth of the group's
|
|
124
|
+
* extent: orders of magnitude above float noise, far below any authored seat
|
|
125
|
+
* spacing. A group whose centroid sits on its focal point within that
|
|
126
|
+
* tolerance has no axis at all, and is in the round. Every other decision is
|
|
127
|
+
* an integer count.
|
|
128
|
+
*/
|
|
129
|
+
declare function behindStageLabels(seats: readonly ExpandedSeat[], focal: Point): Set<string>;
|
|
63
130
|
/**
|
|
64
131
|
* Pick the `qty` best available seats. Returns `{ labels }` on success, or
|
|
65
132
|
* `{ labels: [], reason }` when the request can't be satisfied at all.
|
|
@@ -198,4 +265,4 @@ declare function resolveRowTerminalCapacity(row: RowObject, pointer: Point): Row
|
|
|
198
265
|
/** Deterministically choose the start-edge count nearest the pointer. */
|
|
199
266
|
declare function resolveRowStartCapacity(row: RowObject, pointer: Point): RowCapacityProposal | null;
|
|
200
267
|
|
|
201
|
-
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, MAX_DIRECT_ROW_SWEEP, MAX_ROW_BLOCK_ROWS, MAX_ROW_SEATS, MIN_ROW_BLOCK_ROWS, MIN_ROW_SEATS, type RowBlockCountProposal, type RowCapacityProposal, capacityControl, categoryCapacity, chartCapacity, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowStartCapacity, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowStartEndpoint, rowTerminalEndpoint, rowWithStartCapacity, rowWithTerminalCapacity, strandedSingles };
|
|
268
|
+
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, MAX_DIRECT_ROW_SWEEP, MAX_ROW_BLOCK_ROWS, MAX_ROW_SEATS, MIN_ROW_BLOCK_ROWS, MIN_ROW_SEATS, type RowBlockCountProposal, type RowCapacityProposal, behindStageLabels, capacityControl, categoryCapacity, chartCapacity, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowStartCapacity, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowStartEndpoint, rowTerminalEndpoint, rowWithStartCapacity, rowWithTerminalCapacity, strandedSingles };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-
|
|
2
|
-
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-
|
|
3
|
-
export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-
|
|
4
|
-
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as
|
|
1
|
+
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-DL7qIUrD.js';
|
|
2
|
+
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-CdJx5l3B.js';
|
|
3
|
+
export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-hJxuFF9L.js';
|
|
4
|
+
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GABoxMode, b as GA_UNIT_LABEL_PREFIX, c as GroupedTableBookingMode, d as GroupedTableInventoryUnit, e as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, f as MAX_GA_CAPACITY, g as MAX_ONE_PARTY_GUESTS, N as NotForSaleSelectionIssue, O as ONE_PARTY_LIMIT_MESSAGE, R as RestrictionChartDoc, h as RestrictionSeat, T as TicketOptionApplicabilityIssue, i as TicketSelection, j as TicketSelectionIssue, k as TicketSelectionOptions, l as TicketTierResolution, m as applicableTicketTiers, n as companionSelectionIssue, o as eventInventoryLimitFor, p as gaAreasOf, q as gaBoxBounds, r as gaBoxMode, s as gaInventorySegments, t as gaUnitLabel, u as gaUnitLabels, v as gaUnitLabelsForModel, w as gaWheelchairPlaceCount, x as gaWheelchairUnitLabels, y as groupedTableInventory, z as growJoinedGAInventory, A as isFullChartDoc, B as isGaUnitLabel, E as resolveTicketTierForSeat, F as ticketOptionNotApplicableIssue, H as ticketSelectionIssue, I as ticketTierAppliesToSeat, J as validGAInventorySegments } from '../../ticketRestrictions-AU8UUmdL.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Best-available seat selection — a PURE, fully unit-testable ranking function.
|
|
@@ -19,6 +19,15 @@ export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DE
|
|
|
19
19
|
* "Best" means, in priority order:
|
|
20
20
|
* 0. (opt-in) a run made entirely of `commercial.premium` seats — only when
|
|
21
21
|
* `preferPremium` is set; absent = this term is inert (byte-identical).
|
|
22
|
+
* ½. A run with fewer seats BEHIND THE STAGE (see `behindStageLabels`): on
|
|
23
|
+
* an end-stage layout, a seat in a block that reaches behind the focal
|
|
24
|
+
* point ranks after every seat in front of it, however close it sits.
|
|
25
|
+
* Off for in-the-round/arena layouts, for a single-category or
|
|
26
|
+
* single-zone request, and for a replacement-seat request.
|
|
27
|
+
* ¾. (opt-in) a run holding at least one AISLE seat — only when
|
|
28
|
+
* `preferAisle` is set with the chart's `aisleLabels`; absent = inert.
|
|
29
|
+
* After the behind-the-stage tier: an aisle is never worth a seat
|
|
30
|
+
* behind the stage. Before orphan and distance.
|
|
22
31
|
* 1. A single contiguous run of `qty` adjacent-available seats in ONE row
|
|
23
32
|
* (a booked/held/missing/wrong-category seat breaks contiguity).
|
|
24
33
|
* 2. …that does NOT strand a single isolated free seat ("orphan") beside the
|
|
@@ -59,7 +68,65 @@ interface BestAvailableOpts {
|
|
|
59
68
|
preferNearest?: boolean;
|
|
60
69
|
/** Logical rows containing the original seats in a recovery request. */
|
|
61
70
|
preferredRowIds?: readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* Opt-in aisle bias: a run holding at least one of `aisleLabels` beats one
|
|
73
|
+
* that holds none, after the behind-the-stage tier and before the
|
|
74
|
+
* orphan/distance rules. Inert unless both are given (byte-identical).
|
|
75
|
+
* `aisleLabels` are booking labels of aisle seats (core/layout/aisleSeats).
|
|
76
|
+
*/
|
|
77
|
+
preferAisle?: boolean;
|
|
78
|
+
aisleLabels?: ReadonlySet<string>;
|
|
62
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The labels of seats that sit BEHIND THE STAGE on an end-stage layout —
|
|
82
|
+
* empty when the layout is not end-stage.
|
|
83
|
+
*
|
|
84
|
+
* Seen on the Grand Theatre demo (2026-09-26): "Find 2 best seats" (all
|
|
85
|
+
* prices, any zone) picked West Choir A-1/A-2. The choir wraps round the
|
|
86
|
+
* sides and back of the stage, 266 units from the focal point, which is ON
|
|
87
|
+
* the stage; the nearest arena seat is 476 away, so distance alone put the
|
|
88
|
+
* choir first.
|
|
89
|
+
*
|
|
90
|
+
* Seats are taken per focal point (a zone may carry its own). For each group:
|
|
91
|
+
*
|
|
92
|
+
* - The AUDIENCE AXIS runs from the focal point F to the centroid of the
|
|
93
|
+
* group's seats: on an end stage, from the stage into the house.
|
|
94
|
+
* - A seat's DEPTH is its signed distance along that axis from F. A seat
|
|
95
|
+
* with negative depth is on the far side of the focal point from the
|
|
96
|
+
* audience: behind the stage.
|
|
97
|
+
* - A BLOCK (the seat's section, or its logical row when it has none) that
|
|
98
|
+
* reaches behind the stage is a stage-side block, and every seat in it
|
|
99
|
+
* ranks after the house. The choir's last seat, level with the stage lip,
|
|
100
|
+
* is only "close" because the choir hugs the stage.
|
|
101
|
+
*
|
|
102
|
+
* Why the focal point and not the stage's own outline: a thrust or a runway
|
|
103
|
+
* puts the stage's deepest point well into the house, and the tables and the
|
|
104
|
+
* parterre ends flanking it are among the best seats. Measured on the bundled
|
|
105
|
+
* templates, a stage-lip line demoted the whole opera parterre and a comedy
|
|
106
|
+
* club's front tables; the focal-point line demotes choirs, platform parties,
|
|
107
|
+
* head tables and the side blocks level with an arena's end stage.
|
|
108
|
+
*
|
|
109
|
+
* WHEN IT DOES NOT APPLY. In the round, in an arena bowl, in a stadium, on a
|
|
110
|
+
* thrust, the audience surrounds the focal point and "behind" means nothing.
|
|
111
|
+
* That is decided by COUNTING, not by a knife-edge distance: a group is
|
|
112
|
+
* end-stage only while at most one seat in ten sits behind its focal point,
|
|
113
|
+
* and the stage-side blocks hold at most one seat in four. Measured over every
|
|
114
|
+
* bundled template (2026-09-26): every end-stage theatre, hall and cinema has
|
|
115
|
+
* 0-8% of its seats behind the focal point; the nearest layouts that are not
|
|
116
|
+
* end-stage (a nightclub, a ballpark grandstand) 13%; the thrust, black-box
|
|
117
|
+
* and esports layouts 18-20%; every bowl, stadium and in-the-round layout
|
|
118
|
+
* 36-50%. The cut at 10% sits in the gap, with room on both sides.
|
|
119
|
+
*
|
|
120
|
+
* FLOAT-SAFE BY CONSTRUCTION (CLAUDE.md: x86 and arm64 disagree on
|
|
121
|
+
* near-equal floats). A seat within a tolerance of the line through F counts
|
|
122
|
+
* as ON the line, never behind it, so a seat level with the focal point
|
|
123
|
+
* cannot flip between runners. The tolerance is a millionth of the group's
|
|
124
|
+
* extent: orders of magnitude above float noise, far below any authored seat
|
|
125
|
+
* spacing. A group whose centroid sits on its focal point within that
|
|
126
|
+
* tolerance has no axis at all, and is in the round. Every other decision is
|
|
127
|
+
* an integer count.
|
|
128
|
+
*/
|
|
129
|
+
declare function behindStageLabels(seats: readonly ExpandedSeat[], focal: Point): Set<string>;
|
|
63
130
|
/**
|
|
64
131
|
* Pick the `qty` best available seats. Returns `{ labels }` on success, or
|
|
65
132
|
* `{ labels: [], reason }` when the request can't be satisfied at all.
|
|
@@ -198,4 +265,4 @@ declare function resolveRowTerminalCapacity(row: RowObject, pointer: Point): Row
|
|
|
198
265
|
/** Deterministically choose the start-edge count nearest the pointer. */
|
|
199
266
|
declare function resolveRowStartCapacity(row: RowObject, pointer: Point): RowCapacityProposal | null;
|
|
200
267
|
|
|
201
|
-
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, MAX_DIRECT_ROW_SWEEP, MAX_ROW_BLOCK_ROWS, MAX_ROW_SEATS, MIN_ROW_BLOCK_ROWS, MIN_ROW_SEATS, type RowBlockCountProposal, type RowCapacityProposal, capacityControl, categoryCapacity, chartCapacity, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowStartCapacity, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowStartEndpoint, rowTerminalEndpoint, rowWithStartCapacity, rowWithTerminalCapacity, strandedSingles };
|
|
268
|
+
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, MAX_DIRECT_ROW_SWEEP, MAX_ROW_BLOCK_ROWS, MAX_ROW_SEATS, MIN_ROW_BLOCK_ROWS, MIN_ROW_SEATS, type RowBlockCountProposal, type RowCapacityProposal, behindStageLabels, capacityControl, categoryCapacity, chartCapacity, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowStartCapacity, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowStartEndpoint, rowTerminalEndpoint, rowWithStartCapacity, rowWithTerminalCapacity, strandedSingles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as D,b as Y,c as $,d as q,e as H,f as Q,g as U,h as V,i as Z,j as tt,k as nt,l as ot,m as et}from"../../chunk-ZS5YFXSE.js";import{a as ut,b as lt,c as pt,d as ft}from"../../chunk-254ABRJF.js";import{a as m}from"../../chunk-5N4H3KMR.js";import{a as rt,b as it,c as at,d as ct,e as st}from"../../chunk-4R6TXHY2.js";import"../../chunk-66T4EAUA.js";import"../../chunk-PHV2U54Y.js";import"../../chunk-JRZHC75P.js";import"../../chunk-UEDS3HJ3.js";import"../../chunk-TQN2VWQO.js";import"../../chunk-FOIYJ5NT.js";import{a as C,b as N,c as g,d as k,e as G,f as B,g as W,h as A,i as E,j as F,k as T,l as L,m as X,n as K,o as J,p as z}from"../../chunk-COECA63Q.js";import{Pa as f,d as _,e as v,f as I,g as j}from"../../chunk-EIV3CAGV.js";import"../../chunk-KTMZ3QAO.js";import"../../chunk-JBOTRSMY.js";import"../../chunk-CRCGO52K.js";var b=1,d=100;function w(t,n){if(!Number.isInteger(n)||n<b||n>d)return null;let e=t.rotation*Math.PI/180,i={x:Math.cos(e),y:Math.sin(e)},o={x:-i.y,y:i.x};return Array.from({length:n},(r,a)=>{let c=t.style==="intertwined"&&a%2===1?t.seatSpacing/2:0;return{type:"row",id:`__block_preview_${a}`,label:"",origin:{x:t.origin.x+o.x*a*t.rowGap+i.x*c,y:t.origin.y+o.y*a*t.rowGap+i.y*c},rotation:t.rotation,curve:t.curve,seatCount:t.seatsPerRow,seatSpacing:t.seatSpacing,categoryKey:"__preview__"}})}function x(t,n=t.rowCount){let e=w(t,n);return e?.length?f(e[e.length-1]):null}function xt(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y)||t.rowGap<=0)return null;let e=x(t,1);if(!e)return null;let i=t.rotation*Math.PI/180,o={x:-Math.sin(i),y:Math.cos(i)},r=(n.x-e.x)*o.x+(n.y-e.y)*o.y,a=Math.max(b,Math.min(d,Math.round(r/t.rowGap)+1)),c=x(t,a);return c?{rowCount:a,edgePoint:c}:null}function bt(t,n){return t.length!==n.rowCount?!1:[...t].sort((i,o)=>(i.rowBlockGeneration?.rowIndex??1/0)-(o.rowBlockGeneration?.rowIndex??1/0)).every((i,o)=>{let r=i.rowBlockGeneration;return r?.kind==="row-block-v1"&&r.groupId===n.groupId&&r.rowIndex===o&&r.signature===n.signature&&JSON.stringify(r)===JSON.stringify({...n,rowIndex:o})})}var s=1,u=300,y=330;function l(t){return t.seatCount>1?t.curve/(t.seatCount-1):0}function h(t,n){let e=t.rotation*Math.PI/180,i=l(t)*Math.PI/180,o,r;if(Math.abs(i)<1e-9)o=n*t.seatSpacing,r=0;else{let a=t.seatSpacing/(2*Math.sin(Math.abs(i)/2)),c=i*n;o=a*Math.sin(c),r=-a+a*Math.cos(c)}return{x:t.origin.x+o*Math.cos(e)-r*Math.sin(e),y:t.origin.y+o*Math.sin(e)+r*Math.cos(e)}}function M(t,n,e){let i=(t??[]).map(o=>({...o,index:o.index+n})).filter(o=>o.index>=0&&o.index<e);return i.length?i:void 0}function R(t,n){if(t.path||!Number.isInteger(n)||n<s||n>u)return null;let e=l(t);return{...t,seatCount:n,curve:e*(n-1)}}function O(t,n){if(t.path||!Number.isInteger(n)||n<s||n>u)return null;let e=l(t),i=t.seatCount-n,o=-i;return{...t,origin:h(t,i),rotation:m(t.rotation-e*i),seatCount:n,curve:e*(n-1),overrides:M(t.overrides,o,n)}}function P(t,n=t.seatCount){let e=R(t,n);return e?h(e,n-1):null}function S(t,n=t.seatCount){return O(t,n)?.origin??null}function ht(t,n){if(t.path||!Number.isFinite(n.x)||!Number.isFinite(n.y))return null;let e=l(t),i=Math.abs(e)<1e-9?u:Math.min(u,Math.floor(y/Math.abs(e))+1),o=null;for(let r=s;r<=Math.max(s,i);r+=1){let a=P(t,r);if(!a)continue;let c=Math.hypot(a.x-n.x,a.y-n.y),p=e*(r-1);(!o||c<o.distance||c===o.distance&&r<o.seatCount)&&(o={seatCount:r,curve:p,endpoint:a,distance:c})}return o}function wt(t,n){if(t.path||!Number.isFinite(n.x)||!Number.isFinite(n.y))return null;let e=l(t),i=Math.abs(e)<1e-9?u:Math.min(u,Math.floor(y/Math.abs(e))+1),o=null;for(let r=s;r<=Math.max(s,i);r+=1){let a=S(t,r);if(!a)continue;let c=Math.hypot(a.x-n.x,a.y-n.y),p=e*(r-1);(!o||c<o.distance||c===o.distance&&r<o.seatCount)&&(o={seatCount:r,curve:p,endpoint:a,distance:c})}return o}export{rt as CATEGORY_INVENTORY_FAMILIES,v as DEFAULT_EVENT_INVENTORY_LIMIT,C as GA_UNIT_LABEL_PREFIX,ot as GroupedTableProjectionError,I as LARGE_VENUE_INVENTORY_MODULE,y as MAX_DIRECT_ROW_SWEEP,_ as MAX_EVENT_INVENTORY,g as MAX_GA_CAPACITY,W as MAX_ONE_PARTY_GUESTS,d as MAX_ROW_BLOCK_ROWS,u as MAX_ROW_SEATS,b as MIN_ROW_BLOCK_ROWS,s as MIN_ROW_SEATS,A as ONE_PARTY_LIMIT_MESSAGE,H as applicableTicketTiers,Z as behindStageLabels,pt as capacityControl,lt as categoryCapacity,ut as chartCapacity,U as companionSelectionIssue,ct as describeCategoryInventoryConflict,it as effectiveSeatOwnerCategoryCounts,j as eventInventoryLimitFor,z as gaAreasOf,F as gaBoxBounds,E as gaBoxMode,B as gaInventorySegments,k as gaUnitLabel,T as gaUnitLabels,L as gaUnitLabelsForModel,X as gaWheelchairPlaceCount,K as gaWheelchairUnitLabels,et as groupedTableInventory,J as growJoinedGAInventory,at as inspectCategoryInventoryConflicts,bt as intactRowBlockMembers,Y as isFullChartDoc,N as isGaUnitLabel,tt as pickBestAvailable,nt as pickBestAvailableInventory,st as remediateCategoryInventoryConflicts,ft as resizeChartCapacity,xt as resolveRowBlockCount,wt as resolveRowStartCapacity,ht as resolveRowTerminalCapacity,Q as resolveTicketTierForSeat,x as rowBlockEdgePoint,w as rowBlockPreviewRows,S as rowStartEndpoint,P as rowTerminalEndpoint,O as rowWithStartCapacity,R as rowWithTerminalCapacity,D as strandedSingles,$ as ticketOptionNotApplicableIssue,V as ticketSelectionIssue,q as ticketTierAppliesToSeat,G as validGAInventorySegments};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ce=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var gt=Object.prototype.hasOwnProperty;var Mt=(e,t)=>{for(var n in t)ce(e,n,{get:t[n],enumerable:!0})},St=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xt(t))!gt.call(e,r)&&r!==n&&ce(e,r,{get:()=>t[r],enumerable:!(o=yt(t,r))||o.enumerable});return e};var wt=e=>St(ce({},"__esModule",{value:!0}),e);var no={};Mt(no,{AUTOMATIC_ROUND_TABLE_RADIUS_MAX:()=>Ve,AUTOMATIC_ROUND_TABLE_RADIUS_MIN:()=>Ye,DEFAULT_SEAT_RADIUS:()=>mt,FLOOR_STACK_GAP_RATIO:()=>ft,FLOOR_STACK_MIN_SURFACE_PX:()=>Hn,TABLE_SEAT_OFFSET:()=>X,TEXT_BACKGROUND_PADDING_MAX:()=>po,TEXT_BACKGROUND_RADIUS_MAX:()=>yo,TEXT_LETTER_SPACING_MAX:()=>mo,TEXT_LETTER_SPACING_MIN:()=>ho,TEXT_LINE_HEIGHT_MAX:()=>fo,TEXT_LINE_HEIGHT_MIN:()=>uo,TEXT_OPACITY_MIN:()=>bo,TEXT_WIDTH_MAX:()=>lo,TEXT_WIDTH_MIN:()=>co,allObjects:()=>lt,applyAffine:()=>Gn,automaticRoundTableRadius:()=>cn,buildAisleHoles:()=>vt,buildSeatIndex:()=>qn,buildSectionShell:()=>It,chartBounds:()=>$,combinedFloorZoneId:()=>ve,composeAffine:()=>Yn,createPerspectiveCamera:()=>Un,cubicPoint:()=>q,decomposeAffineLinear:()=>zn,distanceToRings:()=>_e,distributeAlongCubic:()=>le,expandBooth:()=>at,expandChart:()=>Tn,expandRow:()=>rt,expandRowSlots:()=>ot,expandTable:()=>st,expandTableSlots:()=>Pe,floorObjects:()=>On,floorStackPlacements:()=>ht,floorsOf:()=>te,gridStats:()=>to,hitTest:()=>Zn,initialFloorMode:()=>Xn,invertAffine:()=>Kn,layoutCombinedFloorPlan:()=>jn,layoutFloorStack:()=>Nn,mainFloorId:()=>Bn,nearestWithin:()=>Jn,objectCenter:()=>Ie,owningSectionForObject:()=>ct,perspectiveTangentAffine:()=>Vn,pointInPolygon:()=>we,pointInPolygonWithHoles:()=>W,polygonArea:()=>de,polygonInscribedAnchor:()=>he,polygonLabelPoint:()=>Rn,polygonNetArea:()=>Et,projectPerspectivePoint:()=>ae,queryRect:()=>eo,resolveSegmentedRowGroups:()=>me,rowInventoryCount:()=>vn,rowSeatPositions:()=>ie,segmentedRowComponentSeats:()=>Tt,segmentedRowComponents:()=>At,segmentedRowSeatTotal:()=>_t,smoothCubicThroughMiddle:()=>Pt,stackFloors:()=>An,tableInventoryCount:()=>kn,tableSeatCountsBySide:()=>it,textLayoutMetrics:()=>ue,translateObject:()=>se,usableHoles:()=>V});module.exports=wt(no);var ro=Math.PI/180;function H(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function N(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function q(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function Pt(e,t,n){let o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},r={x:(n.x-o.x)*4/3,y:(n.y-o.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+r.x,y:e.y+(t.y-e.y)/3+r.y},control2:{x:e.x+(t.x-e.x)*2/3+r.x,y:e.y+(t.y-e.y)*2/3+r.y},end:{...t}}}function le(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[q(e,.5)];let o=Array.from({length:n+1},(u,a)=>q(e,a/n)),r=new Float64Array(o.length);for(let u=1;u<o.length;u+=1){let a=o[u].x-o[u-1].x,c=o[u].y-o[u-1].y;r[u]=r[u-1]+Math.hypot(a,c)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],l=1;for(let u=0;u<t;u+=1){let a=i*u/(t-1);for(;l<r.length-1&&r[l]<a;)l+=1;let c=r[l-1],f=r[l],b=f===c?0:(a-c)/(f-c);s.push({x:o[l-1].x+(o[l].x-o[l-1].x)*b,y:o[l-1].y+(o[l].y-o[l-1].y)*b})}return s}function T(e,t){return{x:e.x+t.x,y:e.y+t.y}}function z(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _(e,t){return{x:e.x*t,y:e.y*t}}function Z(e,t=13){return Array.from({length:t},(n,o)=>q(e,o/(t-1)))}function Ce(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return N(e[o],e[o+1],n-o)}function Re(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[Ce(e,o)];for(let s=1;s<e.length-1;s+=1){let l=s/(e.length-1);l>o+1e-9&&l<r-1e-9&&i.push(e[s])}return i.push(Ce(e,r)),i}function Ee(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([b,p],y)=>{let m=H(N(e[b],e[p],.5),t);m<r&&(r=m,o=y)});let i=e[o],s=e[(o+1)%4],l=e[(o+2)%4],u=e[(o+3)%4],a=N(i,s,.5),c=z(t,a),f=Math.max(1e-9,Math.hypot(c.x,c.y));return{p0:i,p1:s,p2:l,p3:u,normal:_(c,1/f),depth:(H(i,u)+H(s,l))/2}}function Oe(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:s}=e,l=z(n,t),u=z(o,r),a=s*.22,c=s*.12;return{nearPath:{start:t,control1:T(T(t,_(l,1/3)),_(i,a)),control2:T(T(t,_(l,2/3)),_(i,a)),end:n},farPath:{start:o,control1:T(T(r,_(u,2/3)),_(i,c)),control2:T(T(r,_(u,1/3)),_(i,c)),end:r}}}function It(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((y,m)=>T(y,m),{x:0,y:0});o.x/=4,o.y/=4;let r=H(e[0],e[1]),i=H(e[0],e[3]),s=n==="auto"?r>i*1.25&&H(o,t)>i?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(y=>({...y}))};let l=Ee(e,t),{p0:u,p1:a,p2:c,p3:f}=l;if(s==="tapered")return{mode:s,outline:[T(u,_(z(a,u),.14)),T(u,_(z(a,u),1-.14)),c,f]};let{nearPath:b,farPath:p}=Oe(l);return{mode:s,outline:[...Z(b),...Z(p).slice(1)]}}function vt(e,t,n,o){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let r=Ee(e,t),{p0:i,p1:s,p2:l,p3:u}=r,a=o==="bezier"?Oe(r):null,c=a?Z(a.nearPath):null,f=a?Z(a.farPath).reverse():null,b=Math.min(.055,.18/(n+1));return Array.from({length:n},(p,y)=>{let m=(y+1)/(n+1),g=m-b/2,w=m+b/2;return c&&f?[...Re(c,g,w),...Re(f,g,w).reverse()]:[N(i,s,g),N(i,s,w),N(u,l,w),N(u,l,g)]})}var co=40,lo=1200,uo=.8,fo=3,ho=-2,mo=20,bo=.1,po=40,yo=40,Ae=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function kt(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/Ae(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let l of i.split(/\s+/)){let u=l.length;s&&s+1+u<=o?s+=1+u:(r+=Math.max(1,Math.ceil(u/o)),s=u%o)}}return Math.max(1,r)}function ue(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(l=>l.length))*Ae(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=kt(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}function Ct(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))}function _e(e,t){let n=1/0;for(let o of t)if(!(o.length<2))for(let r=0,i=o.length-1;r<o.length;i=r++){let s=Ct(e,o[i],o[r]);s<n&&(n=s)}return n}function Te(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,l=t[r].x,u=t[r].y;s>e.y!=u>e.y&&e.x<(l-i)*(e.y-s)/(u-s)+i&&(n=!n)}return n}function De(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Rt(e,t,n){let o=Te(e,t)&&!n.some(i=>Te(e,i)),r=_e(e,[t,...n]);return o?r:-r}function G(e,t,n,o,r){let i=Rt({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var fe=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let o=n.length-1;for(;o>0;){let r=o-1>>1;if(n[r].max>=n[o].max)break;[n[r],n[o]]=[n[o],n[r]],o=r}}pop(){let t=this.items,n=t[0],o=t.pop();if(t.length&&o){t[0]=o;let r=0;for(;;){let i=r*2+1,s=i+1,l=r;if(i<t.length&&t[i].max>t[l].max&&(l=i),s<t.length&&t[s].max>t[l].max&&(l=s),l===r)break;[t[l],t[r]]=[t[r],t[l]],r=l}}return n}};function de(e){if(e.length<3)return 0;let t=0;for(let n=0,o=e.length-1;n<e.length;o=n++)t+=(e[o].x+e[n].x)*(e[o].y-e[n].y);return Math.abs(t)/2}function Et(e,t){return Math.max(0,de(e)-De(t).reduce((n,o)=>n+de(o),0))}function he(e,t){let n=De(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let m=e.reduce((w,v)=>w+v.x,0)/e.length,g=e.reduce((w,v)=>w+v.y,0)/e.length;return{point:{x:m,y:g},radius:0}}let o=1/0,r=1/0,i=-1/0,s=-1/0;for(let m of e)m.x<o&&(o=m.x),m.y<r&&(r=m.y),m.x>i&&(i=m.x),m.y>s&&(s=m.y);let l=i-o,u=s-r,a=Math.min(l,u);if(!(a>0))return{point:{x:(o+i)/2,y:(r+s)/2},radius:0};let c=Math.max(l,u)/150,f=new fe,b=a/2;for(let m=o;m<i;m+=a)for(let g=r;g<s;g+=a)f.push(G(m+b,g+b,b,e,n));let p=G(o+l/2,r+u/2,0,e,n),y=0;for(;f.size;){let m=f.pop();if(!m)break;m.d>p.d&&(p=m),!(m.max-p.d<=c)&&(y>=4e3||(y+=1,b=m.h/2,f.push(G(m.x-b,m.y-b,b,e,n)),f.push(G(m.x+b,m.y-b,b,e,n)),f.push(G(m.x-b,m.y+b,b,e,n)),f.push(G(m.x+b,m.y+b,b,e,n))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function J(e,t,n){return Math.max(t,Math.min(n,e))}function F(e,t,n){return e<t?t:e>n?n:e}var So=Math.PI*2;function Le(e,t,n){return Ot(e,r=>({x:r.x+t,y:r.y+n}))}function Ot(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}var wo=4/3;function At(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],s=e[r+1],l=Math.hypot(s.x-i.x,s.y-i.y);if(l<=0)continue;let u=Math.max(1,Math.round(l/n)),a=l/u,c=Math.atan2(s.y-i.y,s.x-i.x),f=r===0,p=(r>0?t[r-1]:void 0)==="break"?2:1,y=f?{...i}:{x:i.x+Math.cos(c)*a*p,y:i.y+Math.sin(c)*a*p},m=f?u+1:Math.max(1,u-(p-1));o.push({origin:y,rotation:c*180/Math.PI,seatCount:m,seatSpacing:a})}return o}function Tt(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(o,r)=>({x:e.origin.x+n.x*r*e.seatSpacing,y:e.origin.y+n.y*r*e.seatSpacing}))}function _t(e){return e.reduce((t,n)=>t+n.seatCount,0)}function me(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((b,p)=>b.segmentedRow.componentIndex-p.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,l=i[0]?.segmentedRow;if(!l||!(s>=2&&i.length===s&&l?.boundaryBefore==="start"&&i.every((b,p)=>b.segmentedRow?.kind==="segmented-row-v1"&&b.segmentedRow.groupId===o&&b.segmentedRow.componentCount===s&&b.segmentedRow.componentIndex===p&&b.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(p===0?b.segmentedRow.boundaryBefore==="start":b.segmentedRow.boundaryBefore!=="start")&&b.segmentedRow.displayLabel===l.displayLabel)))continue;let a=i.reduce((b,p)=>b+p.seatCount,0),c=0,f=0;for(let b of i)b.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(b.id,{groupId:o,adjacencyOffset:c,displayOffset:f,displayLabel:l.displayLabel,totalSeats:a,canonical:i[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),c+=b.seatCount,f+=b.seatCount}return t}var Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Lt="abcdefghijklmnopqrstuvwxyz";function Ft(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function be(e,t=!1){let n=t?Lt:Dt;return Ft(Math.max(0,Math.floor(e)-1),n)}var Nt=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Fe(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Nt)for(;t>=o;)n+=r,t-=o;return n}function jt(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function ee(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",l=e.seatNumbering?.endAt,u=e.seatCount;if(i==="updown"||i==="updown-descending"){let p=Math.ceil(u/2),y=i==="updown"?t<p?n+2*t:n-1+2*(u-t):t<p?n+2*(p-1-t):n+1+2*(t-p);return`${s}${y}`}let a=i==="odd"||i==="even"?2:r,c=l!=null&&Number.isFinite(l)?l-(u-1)*a:n,f=o==="center"?jt(u)[t]:o==="rtl"?u-1-t:t,b;switch(i){case"odd":{let p=c%2===1?c:c+1;b=String(p+f*2);break}case"even":{let p=c%2===0?c:c+1;b=String(p+f*2);break}case"roman":b=Fe(c+f*r);break;case"letters-upper":b=be(c+f*r,!1);break;case"letters-lower":b=be(c+f*r,!0);break;default:b=String(c+f*r);break}return`${s}${b}`}function Bt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Ne(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${ee(e,t)}`}function pe(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(e.seatDisplayLabelMode==="number")return ee(e,t);if(!n)return`${e.displayLabel||e.label}-${ee(e,t)}`;let r=Bt(n),i=n.displayOffset+t;return`${n.displayLabel}-${ee(r,i)}`}var K=.02291666666666667,Ro=1/K,Ht=58,Xt=Ht*K;var Ut=3,je=0,ye=120,Gt=0,Kt=45,Yt=7,Y=1.2;function xe(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Vt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Yt?e:Ut}function Be(e,t={}){let n=xe(t.floorBaseHeightM,je,ye,0),o=Math.min(ye,n+Vt(e.elevation)*Xt),r=e.height===void 0?o:xe(e.height,je,ye,o),i=xe(e.rake,Gt,Kt,0);return{height:r,rake:i}}function He(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function Xe(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],s=e[r+1],l=s.x-i.x,u=s.y-i.y,a=l*l+u*u,c=a>1e-12?((t-i.x)*l+(n-i.y)*u)/a:0;c<0?c=0:c>1&&(c=1);let f=t-(i.x+c*l),b=n-(i.y+c*u);if(Math.abs(f)>=o||Math.abs(b)>=o)continue;let p=Math.hypot(f,b);p<o&&(o=p)}return o}function zt(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function Ue(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ge(e,t){let n=1/0;for(let o of He(e)){let r=Xe(t,o.x,o.y);r<n&&(n=r)}for(let o of He(t)){let r=Xe(e,o.x,o.y);r<n&&(n=r)}return n}function Wt(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let c of e)n+=c.x,o+=c.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let c of e){let f=Math.hypot(c.x-n,c.y-o);f>r&&(r=f,i=c)}let s=i.x-n,l=i.y-o,u=Math.hypot(s,l);u>1e-9?(s/=u,l/=u):(s=1,l=0);let a=e.map((c,f)=>({p:c,i:f,t:(c.x-n)*s+(c.y-o)*l})).sort((c,f)=>c.t-f.t);return{pts:a.map(c=>c.p),seatIndices:a.map(c=>t[c.i])}}function $t(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let v of e)n+=v.x,o+=v.y;n/=t,o/=t;let r=0,i=0,s=0,l=0,u=0,a=0,c=0;for(let v of e){let R=v.x-n,C=v.y-o;r+=R*R,s+=C*C,i+=R*C,l+=R*R*R,u+=C*C*C,a+=R*C*C,c+=C*R*R}let f=r*s-i*i;if(Math.abs(f)<1e-9)return null;let b=(l+a)/2,p=(u+c)/2,y=(b*s-p*i)/f,m=(p*r-b*i)/f,g=y+n,w=m+o;return!Number.isFinite(g)||!Number.isFinite(w)?null:{cx:g,cy:w}}var Qt=.15;function qt(e){if(e.length<2)return null;let t=e.map(M=>{let d=0,h=0;for(let S of M.pts)d+=S.x,h+=S.y;return{x:d/M.pts.length,y:h/M.pts.length}}),n=0,o=0;for(let M of t)n+=M.x,o+=M.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let M of t){let d=M.x-n,h=M.y-o;r+=d*d,i+=d*h,s+=h*h}let l=r+s,u=r*s-i*i,a=l/2+Math.sqrt(Math.max(0,l*l/4-u)),c,f;Math.abs(i)>1e-12?(c=a-s,f=i):r>=s?(c=1,f=0):(c=0,f=1);let b=Math.hypot(c,f);if(!(b>1e-12))return null;c/=b,f/=b;let p=0,y=0,m=0;for(let M of e){if(M.pts.length<2)continue;let d=M.pts[0],h=M.pts[M.pts.length-1],S=h.x-d.x,x=h.y-d.y,I=Math.hypot(S,x);if(!(I>1e-9))continue;let A=S/I,P=x/I;p+=(A*A-P*P)*I,y+=2*A*P*I,m+=I}if(m>0&&Math.hypot(p,y)>=Jt*m){let M=Math.atan2(y,p)/2,d=Math.cos(M),h=Math.sin(M);Math.abs(c*d+f*h)>en&&(c=-h,f=d)}let g=1/0,w=-1/0,v=[];for(let M of e){let d=1/0,h=-1/0;for(let S of M.pts){let x=S.x*c+S.y*f;x<d&&(d=x),x>h&&(h=x),x<g&&(g=x),x>w&&(w=x)}v.push(h-d)}let R=w-g;return R>1e-9?(v.sort((M,d)=>M-d),v[Math.min(v.length-1,Math.floor(v.length*.9))]/R<=Zt?{x:c,y:f}:null):null}var Zt=.35,Jt=.8,en=.7;function Ge(e,t,n,o){let r=new Map;for(let d of n){let h=t[d],S=h.rowId||`__seat-${d}`,x=r.get(S);x||(x={pts:[],idx:[]},r.set(S,x)),x.pts.push({x:h.x,y:h.y}),x.idx.push(d)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[d,h]of r){let S=Wt(h.pts,h.idx),x=0;for(let I of S.pts)x+=Math.hypot(I.x-o.x,I.y-o.y);i.push({id:d,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/S.pts.length})}let s=i.map(d=>zt(d.pts)),l=i.length<=256?i.length*(i.length-1)/2:0,u=l?new Float64Array(l):null;u?.fill(Number.NaN);let a=u?new Map(i.map((d,h)=>[d,h])):null,c=(d,h)=>(d>h&&([d,h]=[h,d]),d*(2*i.length-d-1)/2+(h-d-1)),f=(d,h)=>{if(!u)return ge(i[d].pts,i[h].pts);let S=c(d,h),x=u[S];if(!Number.isNaN(x))return x;let I=ge(i[d].pts,i[h].pts);return u[S]=I,I},b=(d,h)=>a?f(a.get(d),a.get(h)):ge(d.pts,h.pts),p=[];for(let d=0;d<i.length;d++){let h=1/0;for(let S=0;S<i.length;S++){if(d===S||Ue(s[d],s[S])>=h)continue;let x=f(d,S);x<h&&(h=x)}Number.isFinite(h)&&p.push(h)}p.sort((d,h)=>d-h);let y=p.length?p[Math.floor(p.length/2)]:1,m=Math.max(y*1.8,1e-6),g=i.map(()=>[]);for(let d=0;d<i.length;d++)for(let h=d+1;h<i.length;h++)Ue(s[d],s[h])>m||f(d,h)<=m&&(g[d].push(h),g[h].push(d));let w=0;for(let d=0;d<i.length;d++){if(i[d].blockId!==-1)continue;let h=w++,S=[d];for(i[d].blockId=h;S.length;){let x=S.pop();for(let I of g[x])i[I].blockId===-1&&(i[I].blockId=h,S.push(I))}}let v=new Map;for(let d of i){let h=v.get(d.blockId)??[];h.push(d),v.set(d.blockId,h)}let R=[];for(let d of i){if(d.pts.length<4)continue;let h=$t(d.pts);h&&(!Number.isFinite(h.cx)||!Number.isFinite(h.cy)||R.push({x:h.cx,y:h.cy}))}let C=R.length>=2?(()=>{let d=R.map(x=>x.x).sort((x,I)=>x-I),h=R.map(x=>x.y).sort((x,I)=>x-I),S=Math.floor(R.length/2);return{cx:d[S],cy:h[S]}})():null;if(C){let d=P=>Math.hypot(P.x-C.cx,P.y-C.cy),h=1/0,S=-1/0,x=[];for(let P of i){let k=1/0,E=-1/0;for(let D of P.pts){let j=d(D);j<k&&(k=j),j>E&&(E=j)}x.push(E-k),k<h&&(h=k),E>S&&(S=E)}let I=S-h;x.sort((P,k)=>P-k);let A=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(I>1e-9&&A/I<=Qt){let P=i.map(O=>{let Q=0;for(let pt of O.pts)Q+=d(pt);return{row:O,radius:Q/O.pts.length}}),k=0,E=0;for(let O of P)k+=O.radius,E+=O.row.focalDistance;k/=P.length,E/=P.length;let D=0;for(let O of P)D+=(O.radius-k)*(O.row.focalDistance-E);if(D<0)for(let O of P)O.radius=-O.radius;let B=1/0;for(let O of P)O.radius<B&&(B=O.radius);P.sort((O,Q)=>O.radius-Q.radius);let L=-1,U=-1/0,bt=I/Math.max(1,P.length)*.5,ke=[];for(let O of P)O.radius-U>bt&&(L++,U=O.radius),O.row.ordinal=L,O.row.blockDepth=O.radius-B,ke.push(O.row);return{sectionId:e,rows:ke,blockCount:w}}}let M=[];for(let[,d]of v){let h=qt(d);if(h){let S=P=>{let k=0;for(let E of P.pts)k+=E.x*h.x+E.y*h.y;return k/P.pts.length};d.sort((P,k)=>S(P)-S(k)),d.length>=2&&d[0].focalDistance>d[d.length-1].focalDistance&&d.reverse();let x=[],I=y*.5;for(let P of d){let k=x[x.length-1];k&&Math.abs(S(P)-S(k[0]))<I?k.push(P):x.push([P])}let A=0;for(let P=0;P<x.length;P++){if(P>0){let k=1/0;for(let E of x[P-1])for(let D of x[P])k=Math.min(k,b(E,D));A+=k}for(let k of x[P])k.ordinal=P,k.blockDepth=A,M.push(k)}}else{let S=1/0;for(let x of d)x.focalDistance<S&&(S=x.focalDistance);d.sort((x,I)=>x.focalDistance-I.focalDistance);for(let x=0;x<d.length;x++)d[x].ordinal=x,d[x].blockDepth=Math.max(0,d[x].focalDistance-S),M.push(d[x])}}return{sectionId:e,rows:M,blockCount:w}}var tn=/^\d{4}-\d{2}-\d{2}$/;function nn(e){let t=Date.parse(e);return Number.isFinite(t)?tn.test(e)?t+864e5:t:null}function on(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=nn(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function rn(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function sn(e){return e.status!=="draft"&&e.status!=="retracted"}function an(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function Ke(e,t={}){return!!e&&sn(e)&&rn(e,t.activeConfigurationId,t.activeConfigurationVersion)&&an(e,t.activeBasisSha256)&&on(e,t.now)}var Ye=36,Ve=160;function cn(e,t=360){let n=J(Math.round(Number.isFinite(e)?e:1),1,40),o=J(Number.isFinite(t)?t:360,120,360);return Math.round(J(n*4*(360/o),Ye,Ve))}var ln=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function un(e){return!!e&&ln.has(e)}var ze=1.1;var Do=Math.PI*2;var Lo=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,s=[],l=Math.atan2(o.y-r,o.x),u=Math.atan2(o.y-r,-o.x);for(let a=0;a<=24;a++){let c=l+(u-l)*a/24;s.push({x:i*Math.cos(c),y:r+i*Math.sin(c)})}return{half:70,home:t,backstop:n,fence:s}})();function We(e){return un(e)}function fn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function dn(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e.x-t.x,l=e.y-t.y;return{x:t.x+s*r-l*i,y:t.y+s*i+l*r}}function $e(e){let t=fn(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(u=>dn(u,{x:t.reduce((a,c)=>a+c.x,0)/t.length,y:t.reduce((a,c)=>a+c.y,0)/t.length},n)),r=1/0,i=1/0,s=-1/0,l=-1/0;for(let u of o)r=Math.min(r,u.x),i=Math.min(i,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return!Number.isFinite(r)||s-r<1e-6||l-i<1e-6?null:{minX:r,minY:i,maxX:s,maxY:l}}var hn=5,mn=3,bn=.92,pn=1.9,yn=2,xn=.6,gn=1,Mn=.06;function Sn(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?ze:We(e.stageKind)?Mn:gn}function Qe(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let s of te(e)){let l=s.baseHeightM??0;for(let u of s.objects){if(u.type!=="shape"||u.role!=="stage")continue;let a=$e(u);a&&(t=Math.min(t,a.minX),n=Math.min(n,a.minY),o=Math.max(o,a.maxX),r=Math.max(r,a.maxY),i=Math.max(i,l+Sn(u)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function wn(e,t,n,o){let r=1/0,i=1/0,s=-1/0,l=-1/0;for(let p of e)Number.isFinite(p.eyeHeightM)&&(r=Math.min(r,p.x),s=Math.max(s,p.x),i=Math.min(i,p.y),l=Math.max(l,p.y));if(!Number.isFinite(r))return null;let u=r*t,a=i*t,c=Math.max(1,Math.ceil((s-r)*t/n)+1),f=Math.max(1,Math.ceil((l-i)*t/n)+1),b=new Float64Array(c*f).fill(-1/0);for(let p of e){if(!Number.isFinite(p.eyeHeightM))continue;let y=p.eyeHeightM-Y,m=Math.min(c-1,Math.max(0,Math.floor((p.x*t-u)/n))),w=Math.min(f-1,Math.max(0,Math.floor((p.y*t-a)/n)))*c+m,v=y+o;v>b[w]&&(b[w]=v)}return{cellM:n,minX:u,minY:a,cols:c,rows:f,top:b}}function Pn(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function qe(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??K,i=n.cellM??xn,s=n.chairBackM??bn,l=n.selfRowSkipM??yn,u=n.clearThreshold??.9,a=n.partialThreshold??.25,c=Math.max(1,n.columns??hn),f=Math.max(1,n.rows??mn),b=wn(e,r,i,s);if(!b)return o;let p=(t.maxX-t.minX)*r,y=(t.maxY-t.minY)*r,m=p>=y,g=(t.minX+t.maxX)/2*r,w=(t.minY+t.maxY)/2*r,v=[];for(let C=0;C<c;C++){let M=(C+.5)/c-.5,d=m?g+M*p:g,h=m?w:w+M*y;for(let S=0;S<f;S++){let x=t.deckTopM+(f===1?0:S/(f-1)*pn);v.push({x:d,y:h,z:x})}}let R=i/2;for(let C of e){if(!Number.isFinite(C.eyeHeightM))continue;let M=C.x*r,d=C.y*r,h=C.eyeHeightM,S=0,x=1/0;for(let A of v){let P=A.x-M,k=A.y-d,E=Math.hypot(P,k);if(!(E>l)){S++;continue}let D=P/E,j=k/E,B=0;for(let L=l;L<E;L+=R){let U=Pn(b,M+D*L,d+j*L);if(!(!Number.isFinite(U)||U>=h)&&U>h+(A.z-h)*L/E){B=L;break}}B?x=Math.min(x,B):S++}let I=S/v.length;I>=u||o.set(C.id,{seatId:C.id,mark:I<a?"obstructedView":"restrictedView",visibleFraction:I,totalRays:v.length,atDistanceM:Number.isFinite(x)?x:0})}return o}function Ze(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function Me(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var re=Math.PI/180,In=9,X=16;function Se(e,t,n,o){let r=n*re,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function ie(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return le(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let a=0;a<t;a++)s.push(Se(a*n,0,r,i));return s}let l=o/(t-1)*re,u=n/(2*Math.sin(Math.abs(l)/2));for(let a=0;a<t;a++){let c=a*l,f=u*Math.sin(c),b=-u+u*Math.cos(c);s.push(Se(f,b,r,i))}return s}function nt(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function vn(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function ot(e,t){let n=nt(e);return ie(e).map((o,r)=>{let i=n.get(r),s=Me(i),l=Ne(e,r,i),u={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:l,displayLabel:pe(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(u).some(a=>a!==void 0&&a!==!1&&a!=="")?u:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function rt(e){let t=[];for(let n of ot(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function it(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function Pe(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(c=>[c.index,c])),r=(c,f,b,p)=>{let y=o.get(c),m=Me(y),g=y?.label??`${e.label}-${c+1}`,w=e.displayLabel??e.label;return{index:c,label:g,displayLabel:y?.displayLabel??`${w}-${c+1}`,x:f+(y?.dx??0),y:b+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:m.length>0,accessibility:m,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...p?{side:p}:{}}};if(e.shape==="round"){let c=(e.radius??40)+X,f=e.rotation*re,b=Math.max(0,Math.min(360,e.seatArc??360));if(b>=360||n===1){for(let g=0;g<n;g++){let w=f+g/n*2*Math.PI;t.push(r(g,e.center.x+c*Math.cos(w),e.center.y+c*Math.sin(w)))}return t}let p=b*re,y=(2*Math.PI-p)/2,m=f+y;for(let g=0;g<n;g++){let w=m+g/(n-1)*p;t.push(r(g,e.center.x+c*Math.cos(w),e.center.y+c*Math.sin(w)))}return t}let i=e.width??80,s=e.height??50,l=it(e),u=["top","bottom","left","right"],a=0;for(let c of u){let f=l[c];for(let b=0;b<f;b++){let p,y;c==="top"?(p=-i/2+(b+.5)*i/f,y=-s/2-X):c==="bottom"?(p=-i/2+(b+.5)*i/f,y=s/2+X):c==="left"?(p=-i/2-X,y=-s/2+(b+.5)*s/f):(p=i/2+X,y=-s/2+(b+.5)*s/f);let m=Se(p,y,e.rotation,e.center);t.push(r(a++,m.x,m.y,c))}}return t}function kn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Pe(e).filter(t=>!t.skipped).length}function st(e){return Pe(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function at(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function we(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,l=t[r].x,u=t[r].y;s>e.y!=u>e.y&&e.x<(l-i)*(e.y-s)/(u-s)+i&&(n=!n)}return n}function Cn(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),l=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=l+1e-7})}function V(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function W(e,t,n){return we(e,t)&&!V(n).some(o=>we(e,o)||Cn(e,o))}function Rn(e,t){return he(e,t).point}function oe(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Ie(e){switch(e.type){case"row":{let t=ie(e),n=nt(e),o=0,r=0,i=0;for(let s=0;s<t.length;s++){let l=n.get(s);l?.skip||(o+=t[s].x+(l?.dx??0),r+=t[s].y+(l?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return oe(e.points);case"section":return oe(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?oe(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function Je(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function En(e,t){if(e.type!=="gaArea"||!Je(e.points,t.outline))return!1;let n=V(e.holes),o=V(t.holes);return n.length===o.length&&n.every((r,i)=>Je(r,o[i]))}function ct(e,t,n=e.filter(r=>r.type==="section"),o=Ie(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(s=>(s.logicalSectionId??s.id)===r&&(En(t,s)||W(o,s.outline,s.holes))):void 0)??n.find(s=>W(o,s.outline,s.holes))}function te(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function On(e,t){let n=te(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function lt(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function se(e,t,n){let o=i=>({x:i.x+t,y:i.y+n}),r=i=>i.map(o);switch(e.type){case"row":return{...e,origin:o(e.origin)};case"table":case"booth":return{...e,center:o(e.center)};case"gaArea":return{...e,points:r(e.points),...e.holes?{holes:V(e.holes).map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:Le(e.outlinePath,t,n)}:{},...e.holes?{holes:V(e.holes).map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function An(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((o,r)=>{let i=-r*t;for(let s of o.objects)n.push(i===0?s:se(s,0,i))}),{...e,objects:n,floors:void 0}}function et(e,t,n,o,r,i,s,l,u){let a=[],c=e.filter(m=>m.type==="section"),f=me(e),b=m=>!m?.eventConfigurationId||m.eventConfigurationId===o&&(m.eventConfigurationVersion===void 0||m.eventConfigurationVersion===u),p=m=>Ke(m,{activeConfigurationId:o,activeConfigurationVersion:u,activeBasisSha256:r,now:l}),y=(m,g)=>p(m)?{...m,coverage:g}:void 0;for(let m of e){let g=[];if(m.type==="row"?g=rt(m):m.type==="table"?g=st(m):m.type==="booth"&&(g=at(m)),!g.length)continue;for(let M of g)M.viewUrl&&!b(M.viewMeta)&&(M.viewUrl=void 0,M.viewMeta=void 0);if(m.type==="row"){let M=f.get(m.id);if(M){let d=new Map((m.overrides??[]).map(h=>[h.index,h]));for(let h of g){let S=Number(h.id.slice(h.id.lastIndexOf(":")+1));if(!Number.isInteger(S))continue;h.logicalRowId=M.groupId,h.logicalSeatIndex=M.adjacencyOffset+S,d.get(S)?.displayLabel||(h.displayLabel=pe(m,S,M)),!h.viewUrl&&M.viewFromSeatUrl&&b(M.viewFromSeatMeta)&&(h.viewUrl=M.viewFromSeatUrl,h.viewMeta=M.viewFromSeatMeta);let x=d.get(S)?.confidenceEvidence;h.confidenceEvidence=y(x,"exact-seat")??y(m.confidenceEvidence,"row-representative")??y(M.confidenceEvidence,"row-representative")}}}let w=ct(e,m,c,m.type==="row"?oe(g):Ie(m)),v=w?.viewFromSeatUrl,C=(w?.zone?t?.find(M=>M.id===w.zone):void 0)?.focalPoint??n;for(let M of g){if(!M.confidenceEvidence){let d=Number(M.id.slice(M.id.lastIndexOf(":")+1)),h=(m.type==="row"||m.type==="table")&&Number.isInteger(d)?m.overrides?.find(S=>S.index===d)?.confidenceEvidence:void 0;M.confidenceEvidence=y(h,"exact-seat")??(m.type==="row"?y(m.confidenceEvidence,"row-representative"):void 0)}M.confidenceEvidence??=y(w?.confidenceEvidence,"section-representative")??(s?y(s.evidence,s.coverage):void 0),!M.viewUrl&&v&&b(w?.viewFromSeatMeta)&&(M.viewUrl=v,M.viewMeta=w?.viewFromSeatMeta),!M.viewUrl&&i&&b(i.meta)&&(M.viewUrl=i.url,M.viewMeta=i.meta),w&&(M.sectionId=w.logicalSectionId??w.id),w?.zone&&(M.zoneId=w.zone),C&&(M.focalPoint={...C})}a.push(...g)}return a}function Tn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,s=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,l=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,u=et(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&tt(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,u);for(let a of u)a.floorId=r.id;for(let a of u)o.push(a)}return o}let n=et(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&tt(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),_n(e,n,t)}function _n(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||Ze(t,qe(t,Qe(e))),t}function tt(e,t,n,o){let r=e.filter(f=>f.type==="section"),i=n>0||r.some(f=>f.height!==void 0||f.rake!==void 0||(f.elevation??0)>0);if(!r.length||!i||!t){for(let f of o)f.eyeHeightM=n+Y;return}let s=new Array(o.length),l=new Map;for(let f of r)l.has(f.id)||l.set(f.id,f);let u=new Map,a=new Map;for(let f=0;f<o.length;f++){let b=o[f],y=(b.sectionId?l.get(b.sectionId)??r.find(g=>g.logicalSectionId===b.sectionId&&W({x:b.x,y:b.y},g.outline,g.holes)):void 0)??r.find(g=>W({x:b.x,y:b.y},g.outline,g.holes))??null;if(s[f]=y,!y)continue;u.has(y.id)||u.set(y.id,Be(y,{floorBaseHeightM:n}));let m=a.get(y.id);m?m.push(f):a.set(y.id,[f])}let c=new Array(o.length).fill(void 0);for(let[f,b]of a){let p=u.get(f);if(!p)continue;let y=p.rake>0?Math.tan(p.rake*Math.PI/180):0,m=Ge(f,o,b,t);for(let g of m.rows){let w=g.blockDepth*K*y,v=p.height+w;for(let R of g.seatIndices)c[R]=v}}for(let f=0;f<o.length;f++){let b=o[f],p=s[f];if(!p){b.eyeHeightM=n+Y;continue}let y=u.get(p.id);b.eyeHeightM=(c[f]??y.height)+Y}}var ne=40;function $(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,s=-1/0,l=(a,c)=>{a<o&&(o=a),c<r&&(r=c),a>i&&(i=a),c>s&&(s=c)},u=a=>{if(Array.isArray(a))for(let c of a)!c||typeof c!="object"||l(c.x,c.y)};for(let a of lt(e))if(a.type==="row"){let c=new Map((a.overrides??[]).map(f=>[f.index,f]));ie(a).forEach((f,b)=>{let p=c.get(b);p?.skip||l(f.x+(p?.dx??0),f.y+(p?.dy??0))})}else if(a.type==="gaArea")u(a.points);else if(a.type==="section")u(a.outline);else if(a.type==="decorImage")l(a.x,a.y),l(a.x+a.width,a.y+a.height);else if(a.type==="shape")a.points&&a.points.length?u(a.points):a.x!=null&&a.y!=null&&a.width!=null&&a.height!=null&&(l(a.x,a.y),l(a.x+a.width,a.y+a.height));else if(a.type==="table"){let c=X+In,f=a.shape==="round"?(a.radius??40)+c:Math.max((a.width??80)/2,(a.height??50)/2)+c;l(a.center.x-f,a.center.y-f),l(a.center.x+f,a.center.y+f)}else if(a.type==="booth"){let c=Math.max(a.width,a.height)/2;l(a.center.x-c,a.center.y-c),l(a.center.x+c,a.center.y+c)}else if(a.type==="text"){if(n)continue;let c=ue(a);l(a.position.x,a.position.y),l(a.position.x+c.width,a.position.y+c.height)}for(let a of[e.referenceImage,e.backgroundImage]){if(!a)continue;let{center:c,width:f}=a;if(!c||!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(f))continue;let b=f*3/4;l(c.x-f/2,c.y-b/2),l(c.x+f/2,c.y+b/2)}if(!isFinite(o)){let a=e.focalPoint??{x:0,y:0};return{x:a.x-200,y:a.y-200,width:400,height:400}}return{x:o-ne,y:r-ne,width:i-o+ne*2,height:s-r+ne*2}}function ut(e){let t=e.backgroundImage;return t?.url&&!t.assetId?t:void 0}var ft=.08,Dn=.045;function ve(e){return`__floor__:${encodeURIComponent(e)}`}function dt(e,t,n){return{...e,objects:t,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function Ln(e,t,n){let o=e.focalPoint??t.focalPoint;return o?o.x:n.x+n.width/2}function ht(e){let t=e.floors??[];if(!t.length)return[];let n=t.map(s=>$(dt(e,s.objects,s.focalPoint),{freeText:"exclude"})),r=Math.max(1,...n.map(s=>s.width))*ft,i=0;return t.map((s,l)=>{let u=n[l],a=i-(u.y+u.height);return i-=u.height+r,{floorId:s.id,label:s.name??s.id,level:l,levelBadge:l===0?"G":String(l),translation:{x:-Ln(s,e,u),y:a},bounds:u}})}function Fn(e,t,n,o){let r=t==="name"?e.label:e.levelBadge;if(!r)return[];let i=Math.max(1,n*Dn),s=e.bounds.x+e.translation.x,l=e.bounds.y+e.translation.y+i*.4,u=`floor-level-${e.floorId}`,a={type:"text",id:`${u}-text`,text:r,position:{x:s,y:l},fontSize:i,rotation:0,color:o,bold:!0};if(t==="name")return[a];let c=i*.95;return[{type:"shape",id:`${u}-badge`,kind:"ellipse",x:s-c*.35,y:l-c*.3,width:c*2,height:c*2,fill:"transparent",stroke:{color:o,width:Math.max(1,i*.09)},opacity:.8},a]}function Nn(e,t={}){let n=e.floors;if(!n||n.length<2)return e;let o=ht(e),r=[];n.forEach((a,c)=>{let{x:f,y:b}=o[c].translation;for(let p of a.objects)c>0&&p.type==="shape"&&p.role==="stage"||r.push(se(p,f,b))});let i={...e,objects:r,floors:void 0},s=$(i,{freeText:"exclude"}),l=Math.max(1,s.width,s.height),u=e.theme?.textColor??"#94a3b8";for(let a of o)r.push(...Fn(a,t.labelStyle??"number",l,u));return{...i,objects:r,referenceImage:void 0,backgroundImage:void 0}}function jn(e){if(!e.floors||e.floors.length<2)return e;let t=!e.zones?.length,n=new Set,o=e.floors.flatMap(i=>i.objects.flatMap(s=>{if(s.type==="shape"&&s.role==="stage"){let l=JSON.stringify([s.kind,s.x,s.y,s.width,s.height,s.points,s.rotation??0,s.label,s.heightM,s.eventConfigurationIds]);if(n.has(l))return[];n.add(l)}return t&&s.type==="section"?[{...s,zone:ve(i.id)}]:[s]})),r=t?e.floors.map(i=>({id:ve(i.id),label:i.name,focalPoint:{...i.focalPoint}})):e.zones;return{...e,objects:o,zones:r,floors:void 0,referenceImage:void 0,backgroundImage:ut(e)}}function Bn(e){let t=e.floors;if(!t?.length)return null;let n=t.find(i=>i.objects.some(s=>s.type==="shape"&&s.role==="stage"));if(n)return n.id;let o=t[0],r=-1;for(let i of t){let s=$(dt(e,i.objects,i.focalPoint),{freeText:"exclude"}),l=s.width*s.height;l>r&&(r=l,o=i)}return o.id}var Hn=640;function Xn(e,t){return(e.floors?.length??0)<2?null:"all"}function Un(e,t=0){let n=Math.max(1,e.width,e.height),o={x:e.x+e.width/2,y:e.y+e.height/2},r=n*1.55,i=Math.max(n*.82,Math.max(0,t)+n*.45);return{target:o,distance:r,height:i,focalLength:Math.hypot(r,i),yawRad:-8*Math.PI/180}}function ae(e,t,n=0){let o=t.x-e.target.x,r=t.y-e.target.y,i=Math.cos(e.yawRad),s=Math.sin(e.yawRad),l=o*i-r*s,a=o*s+r*i-e.distance,c=n-e.height,f=Math.hypot(e.distance,e.height),b=(-e.distance*a-e.height*c)/f,p=(-e.height*a+e.distance*c)/f,y=Math.max(f*.08,b),m=e.focalLength/y;return{x:e.target.x+l*m,y:e.target.y-p*m,depth:y,scale:m}}function Gn(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function Kn(e){let t=e.a*e.d-e.b*e.c;if(!Number.isFinite(t)||Math.abs(t)<1e-9)throw new Error("perspective projection produced a singular affine");let n=e.d/t,o=-e.b/t,r=-e.c/t,i=e.a/t;return{a:n,b:o,c:r,d:i,e:-(n*e.e+r*e.f),f:-(o*e.e+i*e.f)}}function Yn(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}}function Vn(e,t,n=()=>0){let o=ae(e,t,n(t)),r={x:t.x+1,y:t.y},i={x:t.x,y:t.y+1},s=ae(e,r,n(r)),l=ae(e,i,n(i)),u=s.x-o.x,a=s.y-o.y,c=l.x-o.x,f=l.y-o.y;return{a:u,b:a,c,d:f,e:o.x-u*t.x-c*t.y,f:o.y-a*t.x-f*t.y}}function zn(e){let t=Math.hypot(e.a,e.b),n=e.a*e.d-e.b*e.c;return{rotationDeg:Math.atan2(e.b,e.a)*180/Math.PI,scaleX:t,scaleY:n/Math.max(t,1e-9),skewX:(e.a*e.c+e.b*e.d)/Math.max(n,1e-9)}}var mt=9;function Wn(e){if(e.kind==="circle")return{hx:e.r,hy:e.r};let t=e.width/2,n=e.height/2,o=e.rotation??0;if(!o)return{hx:t,hy:n};let r=o*Math.PI/180,i=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r));return{hx:t*i+n*s,hy:t*s+n*i}}function $n(e,t,n){let o=t-e.seat.x,r=n-e.seat.y;if(e.shape.kind==="circle")return o*o+r*r<=e.shape.r*e.shape.r;let i=e.shape.rotation??0,s=o,l=r;if(i){let u=-i*Math.PI/180,a=Math.cos(u),c=Math.sin(u);s=o*a-r*c,l=o*c+r*a}return Math.abs(s)<=e.shape.width/2&&Math.abs(l)<=e.shape.height/2}function Qn(e,t,n,o,r){if(e.shape.kind==="circle"){let y=Math.min(Math.max(e.seat.x,t),o),m=Math.min(Math.max(e.seat.y,n),r),g=e.seat.x-y,w=e.seat.y-m;return g*g+w*w<=e.shape.r*e.shape.r}let i=e.shape.rotation??0;if(!i)return e.seat.x-e.hx<=o&&e.seat.x+e.hx>=t&&e.seat.y-e.hy<=r&&e.seat.y+e.hy>=n;let s=i*Math.PI/180,l=Math.cos(s),u=Math.sin(s),a=e.shape.width/2,c=e.shape.height/2,f=[[-a,-c],[a,-c],[a,c],[-a,c]].map(([y,m])=>[e.seat.x+y*l-m*u,e.seat.y+y*u+m*l]),b=[[t,n],[o,n],[o,r],[t,r]],p=[[1,0],[0,1],[l,u],[-u,l]];for(let[y,m]of p){let g=1/0,w=-1/0;for(let[C,M]of f){let d=C*y+M*m;d<g&&(g=d),d>w&&(w=d)}let v=1/0,R=-1/0;for(let[C,M]of b){let d=C*y+M*m;d<v&&(v=d),d>R&&(R=d)}if(w<v||R<g)return!1}return!0}function qn(e,t={}){let n=t.seatRadius??mt,o=e.length,r=new Array(o),i=1/0,s=1/0,l=-1/0,u=-1/0,a=0;for(let d=0;d<o;d++){let h=e[d],S=t.shapeOf?.(h)??{kind:"circle",r:n},{hx:x,hy:I}=Wn(S);r[d]={seat:h,shape:S,hx:x,hy:I},h.x-x<i&&(i=h.x-x),h.y-I<s&&(s=h.y-I),h.x+x>l&&(l=h.x+x),h.y+I>u&&(u=h.y+I),x>a&&(a=x),I>a&&(a=I)}o===0&&(i=0,s=0,l=0,u=0);let c=a>0?a*4:1,f=Math.max(l-i,0),b=Math.max(u-s,0),p=Math.max(64,t.maxCells??o*4),y=c,m=Math.max(1,Math.ceil(f/y)||1),g=Math.max(1,Math.ceil(b/y)||1);for(;m*g>p&&(m>1||g>1);)y*=2,m=Math.max(1,Math.ceil(f/y)||1),g=Math.max(1,Math.ceil(b/y)||1);let w=m*g,v=new Int32Array(w+1),R=0;for(let d=0;d<o;d++){let h=r[d],S=F(Math.floor((h.seat.x-h.hx-i)/y),0,m-1),x=F(Math.floor((h.seat.x+h.hx-i)/y),0,m-1),I=F(Math.floor((h.seat.y-h.hy-s)/y),0,g-1),A=F(Math.floor((h.seat.y+h.hy-s)/y),0,g-1);for(let P=I;P<=A;P++)for(let k=S;k<=x;k++)v[P*m+k+1]++,R++}for(let d=0;d<w;d++)v[d+1]+=v[d];let C=new Int32Array(R),M=v.slice(0,w);for(let d=0;d<o;d++){let h=r[d],S=F(Math.floor((h.seat.x-h.hx-i)/y),0,m-1),x=F(Math.floor((h.seat.x+h.hx-i)/y),0,m-1),I=F(Math.floor((h.seat.y-h.hy-s)/y),0,g-1),A=F(Math.floor((h.seat.y+h.hy-s)/y),0,g-1);for(let P=I;P<=A;P++)for(let k=S;k<=x;k++){let E=P*m+k;C[M[E]++]=d}}return{seats:e,entries:r,minX:i,minY:s,cell:y,cols:m,rows:g,cellStart:v,items:C,stamp:new Int32Array(o),epoch:0}}function Zn(e,t,n={}){let{cols:o,rows:r,cell:i,minX:s,minY:l,cellStart:u,items:a,entries:c}=e,f=Math.floor((t.x-s)/i),b=Math.floor((t.y-l)/i);if(f<0||b<0||f>=o||b>=r)return null;let p=b*o+f,y=u[p+1],m=-1,g=1/0;for(let w=u[p];w<y;w++){let v=a[w],R=c[v];if(n.filter&&!n.filter(R.seat.id,R.seat)||!$n(R,t.x,t.y))continue;let C=t.x-R.seat.x,M=t.y-R.seat.y,d=C*C+M*M;(d<g||d===g&&v<m)&&(g=d,m=v)}return m<0?null:c[m].seat.id}function Jn(e,t,n,o={}){if(!(n>0))return null;let{cols:r,rows:i,cell:s,minX:l,minY:u,cellStart:a,items:c,entries:f}=e,b=Math.max(0,Math.floor((t.x-n-l)/s)),p=Math.min(r-1,Math.floor((t.x+n-l)/s)),y=Math.max(0,Math.floor((t.y-n-u)/s)),m=Math.min(i-1,Math.floor((t.y+n-u)/s));if(b>p||y>m)return null;let g=-1,w=n*n,v=e.stamp,R=++e.epoch;for(let C=y;C<=m;C++){let M=C*r;for(let d=b;d<=p;d++){let h=M+d,S=a[h+1];for(let x=a[h];x<S;x++){let I=c[x];if(v[I]===R)continue;v[I]=R;let A=f[I];if(o.filter&&!o.filter(A.seat.id,A.seat))continue;let P=t.x-A.seat.x,k=t.y-A.seat.y,E=P*P+k*k;(E<w||E===w&&I<g)&&(w=E,g=I)}}}return g<0?null:f[g].seat.id}function eo(e,t,n={}){let o=Math.min(t.x,t.x+t.width),r=Math.max(t.x,t.x+t.width),i=Math.min(t.y,t.y+t.height),s=Math.max(t.y,t.y+t.height),l=n.mode??"center",{cols:u,rows:a,cell:c,minX:f,minY:b,cellStart:p,items:y,entries:m}=e,g=Math.max(0,Math.floor((o-f)/c)),w=Math.min(u-1,Math.floor((r-f)/c)),v=Math.max(0,Math.floor((i-b)/c)),R=Math.min(a-1,Math.floor((s-b)/c));if(g>w||v>R)return[];let C=[],M=e.stamp,d=++e.epoch;for(let h=v;h<=R;h++){let S=h*u;for(let x=g;x<=w;x++){let I=S+x,A=p[I+1];for(let P=p[I];P<A;P++){let k=y[P];if(M[k]===d)continue;M[k]=d;let E=m[k];if(n.filter&&!n.filter(E.seat.id,E.seat))continue;(l==="center"?E.seat.x>=o&&E.seat.x<=r&&E.seat.y>=i&&E.seat.y<=s:Qn(E,o,i,r,s))&&C.push(k)}}}return C.sort((h,S)=>h-S),C.map(h=>m[h].seat.id)}function to(e){let t=e.cols*e.rows,n=0,o=0;for(let i=0;i<t;i++){let s=e.cellStart[i+1]-e.cellStart[i];s>0&&n++,s>o&&(o=s)}let r=e.items.length;return{cell:e.cell,cols:e.cols,rows:e.rows,cells:t,occupiedCells:n,refs:r,maxPerCell:o,meanPerOccupiedCell:n?r/n:0}}0&&(module.exports={AUTOMATIC_ROUND_TABLE_RADIUS_MAX,AUTOMATIC_ROUND_TABLE_RADIUS_MIN,DEFAULT_SEAT_RADIUS,FLOOR_STACK_GAP_RATIO,FLOOR_STACK_MIN_SURFACE_PX,TABLE_SEAT_OFFSET,TEXT_BACKGROUND_PADDING_MAX,TEXT_BACKGROUND_RADIUS_MAX,TEXT_LETTER_SPACING_MAX,TEXT_LETTER_SPACING_MIN,TEXT_LINE_HEIGHT_MAX,TEXT_LINE_HEIGHT_MIN,TEXT_OPACITY_MIN,TEXT_WIDTH_MAX,TEXT_WIDTH_MIN,allObjects,applyAffine,automaticRoundTableRadius,buildAisleHoles,buildSeatIndex,buildSectionShell,chartBounds,combinedFloorZoneId,composeAffine,createPerspectiveCamera,cubicPoint,decomposeAffineLinear,distanceToRings,distributeAlongCubic,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorStackPlacements,floorsOf,gridStats,hitTest,initialFloorMode,invertAffine,layoutCombinedFloorPlan,layoutFloorStack,mainFloorId,nearestWithin,objectCenter,owningSectionForObject,perspectiveTangentAffine,pointInPolygon,pointInPolygonWithHoles,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,projectPerspectivePoint,queryRect,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,stackFloors,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject,usableHoles});
|
|
1
|
+
"use strict";var fe=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var Lt=Object.prototype.hasOwnProperty;var _t=(e,t)=>{for(var n in t)fe(e,n,{get:t[n],enumerable:!0})},Dt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tt(t))!Lt.call(e,o)&&o!==n&&fe(e,o,{get:()=>t[o],enumerable:!(r=Ot(t,o))||r.enumerable});return e};var jt=e=>Dt(fe({},"__esModule",{value:!0}),e);var Cr={};_t(Cr,{AUTOMATIC_ROUND_TABLE_RADIUS_MAX:()=>nt,AUTOMATIC_ROUND_TABLE_RADIUS_MIN:()=>tt,CHAIR_NUMBERING_DIRECTIONS:()=>Ke,CHAIR_NUMBERING_FORMATS:()=>Ye,CHAIR_NUMBERING_START_MAX:()=>xe,DEFAULT_SEAT_RADIUS:()=>Pt,FLOOR_STACK_GAP_RATIO:()=>Mt,FLOOR_STACK_MIN_SURFACE_PX:()=>rr,TABLE_SEAT_OFFSET:()=>U,TEXT_BACKGROUND_PADDING_MAX:()=>Br,TEXT_BACKGROUND_RADIUS_MAX:()=>Hr,TEXT_LETTER_SPACING_MAX:()=>Nr,TEXT_LETTER_SPACING_MIN:()=>jr,TEXT_LINE_HEIGHT_MAX:()=>Dr,TEXT_LINE_HEIGHT_MIN:()=>_r,TEXT_OPACITY_MIN:()=>Fr,TEXT_WIDTH_MAX:()=>Lr,TEXT_WIDTH_MIN:()=>Tr,aisleSeatIds:()=>Rt,allObjects:()=>xt,applyAffine:()=>ar,automaticRoundTableRadius:()=>In,buildAisleHoles:()=>Bt,buildSeatIndex:()=>br,buildSectionShell:()=>Ft,chairNumberingProblem:()=>tn,chartBounds:()=>J,combinedFloorZoneId:()=>Ee,compactChairNumbering:()=>nn,composeAffine:()=>cr,createPerspectiveCamera:()=>ir,cubicPoint:()=>te,decomposeAffineLinear:()=>ur,distanceToRings:()=>He,distributeAlongCubic:()=>me,expandBooth:()=>yt,expandChart:()=>$n,expandRow:()=>bt,expandRowSlots:()=>mt,expandTable:()=>pt,expandTableSlots:()=>Re,floorObjects:()=>zn,floorStackPlacements:()=>vt,floorsOf:()=>Y,gridStats:()=>gr,hitTest:()=>hr,initialFloorMode:()=>or,invertAffine:()=>sr,isAisleSeat:()=>vr,isRowAisleSeats:()=>W,layoutCombinedFloorPlan:()=>tr,layoutFloorStack:()=>er,mainFloorId:()=>nr,mergeRowAisleSeats:()=>Ir,nearestWithin:()=>pr,objectCenter:()=>Ae,owningSectionForObject:()=>gt,perspectiveTangentAffine:()=>lr,pointInPolygon:()=>ke,pointInPolygonWithHoles:()=>Z,polygonArea:()=>pe,polygonInscribedAnchor:()=>ye,polygonLabelPoint:()=>Kn,polygonNetArea:()=>Vt,projectPerspectivePoint:()=>ue,queryRect:()=>yr,resolveRowAisleSeats:()=>wr,resolveSegmentedRowGroups:()=>Q,rowInventoryCount:()=>Gn,rowSeatPositions:()=>ce,segmentedRowComponentSeats:()=>Yt,segmentedRowComponents:()=>Kt,segmentedRowSeatTotal:()=>zt,smoothCubicThroughMiddle:()=>Nt,splitRowAisleSeats:()=>Pr,stackFloors:()=>Wn,tableChairBookingLabel:()=>Se,tableChairDisplayLabel:()=>Me,tableChairToken:()=>ze,tableInventoryCount:()=>Vn,tableSeatCountsBySide:()=>ht,textLayoutMetrics:()=>be,translateObject:()=>le,usableHoles:()=>z});module.exports=jt(Cr);var Rr=Math.PI/180;function H(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function N(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function te(e,t){let n=1-t,r=n*n*n,o=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:r*e.start.x+o*e.control1.x+i*e.control2.x+a*e.end.x,y:r*e.start.y+o*e.control1.y+i*e.control2.y+a*e.end.y}}function Nt(e,t,n){let r={x:(e.x+t.x)/2,y:(e.y+t.y)/2},o={x:(n.x-r.x)*4/3,y:(n.y-r.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+o.x,y:e.y+(t.y-e.y)/3+o.y},control2:{x:e.x+(t.x-e.x)*2/3+o.x,y:e.y+(t.y-e.y)*2/3+o.y},end:{...t}}}function me(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[te(e,.5)];let r=Array.from({length:n+1},(d,s)=>te(e,s/n)),o=new Float64Array(r.length);for(let d=1;d<r.length;d+=1){let s=r[d].x-r[d-1].x,c=r[d].y-r[d-1].y;o[d]=o[d-1]+Math.hypot(s,c)}let i=o[o.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],l=1;for(let d=0;d<t;d+=1){let s=i*d/(t-1);for(;l<o.length-1&&o[l]<s;)l+=1;let c=o[l-1],u=o[l],h=u===c?0:(s-c)/(u-c);a.push({x:r[l-1].x+(r[l].x-r[l-1].x)*h,y:r[l-1].y+(r[l].y-r[l-1].y)*h})}return a}function T(e,t){return{x:e.x+t.x,y:e.y+t.y}}function $(e,t){return{x:e.x-t.x,y:e.y-t.y}}function L(e,t){return{x:e.x*t,y:e.y*t}}function ne(e,t=13){return Array.from({length:t},(n,r)=>te(e,r/(t-1)))}function _e(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),r=Math.min(e.length-2,Math.floor(n));return N(e[r],e[r+1],n-r)}function De(e,t,n){let r=Math.max(0,Math.min(1,t)),o=Math.max(r,Math.min(1,n)),i=[_e(e,r)];for(let a=1;a<e.length-1;a+=1){let l=a/(e.length-1);l>r+1e-9&&l<o-1e-9&&i.push(e[a])}return i.push(_e(e,o)),i}function je(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],r=0,o=Number.POSITIVE_INFINITY;n.forEach(([h,p],y)=>{let b=H(N(e[h],e[p],.5),t);b<o&&(o=b,r=y)});let i=e[r],a=e[(r+1)%4],l=e[(r+2)%4],d=e[(r+3)%4],s=N(i,a,.5),c=$(t,s),u=Math.max(1e-9,Math.hypot(c.x,c.y));return{p0:i,p1:a,p2:l,p3:d,normal:L(c,1/u),depth:(H(i,d)+H(a,l))/2}}function Ne(e){let{p0:t,p1:n,p2:r,p3:o,normal:i,depth:a}=e,l=$(n,t),d=$(r,o),s=a*.22,c=a*.12;return{nearPath:{start:t,control1:T(T(t,L(l,1/3)),L(i,s)),control2:T(T(t,L(l,2/3)),L(i,s)),end:n},farPath:{start:r,control1:T(T(o,L(d,2/3)),L(i,c)),control2:T(T(o,L(d,1/3)),L(i,c)),end:o}}}function Ft(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let r=e.reduce((y,b)=>T(y,b),{x:0,y:0});r.x/=4,r.y/=4;let o=H(e[0],e[1]),i=H(e[0],e[3]),a=n==="auto"?o>i*1.25&&H(r,t)>i?"bezier":"tapered":n;if(a==="rectangle")return{mode:a,outline:e.map(y=>({...y}))};let l=je(e,t),{p0:d,p1:s,p2:c,p3:u}=l;if(a==="tapered")return{mode:a,outline:[T(d,L($(s,d),.14)),T(d,L($(s,d),1-.14)),c,u]};let{nearPath:h,farPath:p}=Ne(l);return{mode:a,outline:[...ne(h),...ne(p).slice(1)]}}function Bt(e,t,n,r){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let o=je(e,t),{p0:i,p1:a,p2:l,p3:d}=o,s=r==="bezier"?Ne(o):null,c=s?ne(s.nearPath):null,u=s?ne(s.farPath).reverse():null,h=Math.min(.055,.18/(n+1));return Array.from({length:n},(p,y)=>{let b=(y+1)/(n+1),x=b-h/2,w=b+h/2;return c&&u?[...De(c,x,w),...De(u,x,w).reverse()]:[N(i,a,x),N(i,a,w),N(d,l,w),N(d,l,x)]})}var Tr=40,Lr=1200,_r=.8,Dr=3,jr=-2,Nr=20,Fr=.1,Br=40,Hr=40,Fe=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Ht(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let r=Math.max(1,Math.floor(t/Fe(e))),o=0;for(let i of n){if(!i.length){o+=1;continue}let a=0;for(let l of i.split(/\s+/)){let d=l.length;a&&a+1+d<=r?a+=1+d:(o+=Math.max(1,Math.ceil(d/r)),a=d%r)}}return Math.max(1,o)}function be(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),r=Math.max(1,...n.map(l=>l.length))*Fe(e),o=e.width??r+t*2,i=Math.max(1,o-t*2),a=Ht(e,i);return{width:o,height:a*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:a,padding:t}}function Ut(e,t,n){let r=n.x-t.x,o=n.y-t.y,i=r*r+o*o,a=i?Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*o)/i)):0;return Math.hypot(e.x-(t.x+a*r),e.y-(t.y+a*o))}function He(e,t){let n=1/0;for(let r of t)if(!(r.length<2))for(let o=0,i=r.length-1;o<r.length;i=o++){let a=Ut(e,r[i],r[o]);a<n&&(n=a)}return n}function Be(e,t){let n=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){let i=t[r].x,a=t[r].y,l=t[o].x,d=t[o].y;a>e.y!=d>e.y&&e.x<(l-i)*(e.y-a)/(d-a)+i&&(n=!n)}return n}function Ue(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Gt(e,t,n){let r=Be(e,t)&&!n.some(i=>Be(e,i)),o=He(e,[t,...n]);return r?o:-o}function V(e,t,n,r,o){let i=Gt({x:e,y:t},r,o);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var he=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let r=n.length-1;for(;r>0;){let o=r-1>>1;if(n[o].max>=n[r].max)break;[n[o],n[r]]=[n[r],n[o]],r=o}}pop(){let t=this.items,n=t[0],r=t.pop();if(t.length&&r){t[0]=r;let o=0;for(;;){let i=o*2+1,a=i+1,l=o;if(i<t.length&&t[i].max>t[l].max&&(l=i),a<t.length&&t[a].max>t[l].max&&(l=a),l===o)break;[t[l],t[o]]=[t[o],t[l]],o=l}}return n}};function pe(e){if(e.length<3)return 0;let t=0;for(let n=0,r=e.length-1;n<e.length;r=n++)t+=(e[r].x+e[n].x)*(e[r].y-e[n].y);return Math.abs(t)/2}function Vt(e,t){return Math.max(0,pe(e)-Ue(t).reduce((n,r)=>n+pe(r),0))}function ye(e,t){let n=Ue(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let b=e.reduce((w,I)=>w+I.x,0)/e.length,x=e.reduce((w,I)=>w+I.y,0)/e.length;return{point:{x:b,y:x},radius:0}}let r=1/0,o=1/0,i=-1/0,a=-1/0;for(let b of e)b.x<r&&(r=b.x),b.y<o&&(o=b.y),b.x>i&&(i=b.x),b.y>a&&(a=b.y);let l=i-r,d=a-o,s=Math.min(l,d);if(!(s>0))return{point:{x:(r+i)/2,y:(o+a)/2},radius:0};let c=Math.max(l,d)/150,u=new he,h=s/2;for(let b=r;b<i;b+=s)for(let x=o;x<a;x+=s)u.push(V(b+h,x+h,h,e,n));let p=V(r+l/2,o+d/2,0,e,n),y=0;for(;u.size;){let b=u.pop();if(!b)break;b.d>p.d&&(p=b),!(b.max-p.d<=c)&&(y>=4e3||(y+=1,h=b.h/2,u.push(V(b.x-h,b.y-h,h,e,n)),u.push(V(b.x+h,b.y-h,h,e,n)),u.push(V(b.x-h,b.y+h,h,e,n)),u.push(V(b.x+h,b.y+h,h,e,n))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function re(e,t,n){return Math.max(t,Math.min(n,e))}function j(e,t,n){return e<t?t:e>n?n:e}var Xr=Math.PI*2;function Ge(e,t,n){return Xt(e,o=>({x:o.x+t,y:o.y+n}))}function Xt(e,t,n=1,r=!1){return{...e,start:t(e.start),segments:e.segments.map(o=>o.kind==="line"?{...o,end:t(o.end)}:o.kind==="arc"?{...o,center:t(o.center),radius:o.radius*Math.abs(n),clockwise:r?!o.clockwise:o.clockwise,end:t(o.end)}:{...o,control1:t(o.control1),control2:t(o.control2),end:t(o.end)})}}var Kr=4/3;function Kt(e,t,n){let r=[];for(let o=0;o<e.length-1;o+=1){let i=e[o],a=e[o+1],l=Math.hypot(a.x-i.x,a.y-i.y);if(l<=0)continue;let d=Math.max(1,Math.round(l/n)),s=l/d,c=Math.atan2(a.y-i.y,a.x-i.x),u=o===0,p=(o>0?t[o-1]:void 0)==="break"?2:1,y=u?{...i}:{x:i.x+Math.cos(c)*s*p,y:i.y+Math.sin(c)*s*p},b=u?d+1:Math.max(1,d-(p-1));r.push({origin:y,rotation:c*180/Math.PI,seatCount:b,seatSpacing:s})}return r}function Yt(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(r,o)=>({x:e.origin.x+n.x*o*e.seatSpacing,y:e.origin.y+n.y*o*e.seatSpacing}))}function zt(e){return e.reduce((t,n)=>t+n.seatCount,0)}function Q(e){let t=new Map,n=new Map;for(let r of e){if(r.type!=="row"||!r.segmentedRow)continue;let o=n.get(r.segmentedRow.groupId)??[];o.push(r),n.set(r.segmentedRow.groupId,o)}for(let[r,o]of n){let i=o.slice().sort((h,p)=>h.segmentedRow.componentIndex-p.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,l=i[0]?.segmentedRow;if(!l||!(a>=2&&i.length===a&&l?.boundaryBefore==="start"&&i.every((h,p)=>h.segmentedRow?.kind==="segmented-row-v1"&&h.segmentedRow.groupId===r&&h.segmentedRow.componentCount===a&&h.segmentedRow.componentIndex===p&&h.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(p===0?h.segmentedRow.boundaryBefore==="start":h.segmentedRow.boundaryBefore!=="start")&&h.segmentedRow.displayLabel===l.displayLabel)))continue;let s=i.reduce((h,p)=>h+p.seatCount,0),c=0,u=0;for(let h of i)h.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(h.id,{groupId:r,adjacencyOffset:c,displayOffset:u,displayLabel:l.displayLabel,totalSeats:s,canonical:i[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),c+=h.seatCount,u+=h.seatCount}return t}var Wt="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var $t="abcdefghijklmnopqrstuvwxyz";function Qt(e,t){let n=t.length,r=e+1,o="";for(;r>0;){r-=1;let i=r%n;o=t[i]+o,r=Math.floor(r/n)}return o}function q(e,t=!1){let n=t?$t:Wt;return Qt(Math.max(0,Math.floor(e)-1),n)}var qt=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Ve(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[r,o]of qt)for(;t>=r;)n+=o,t-=r;return n}function Zt(e){let t=new Array(e);return Array.from({length:e},(n,r)=>r).sort((n,r)=>Math.abs(2*n-(e-1))-Math.abs(2*r-(e-1))||n-r).forEach((n,r)=>t[n]=r),t}function oe(e,t){let n=e.seatLabelStart??1,r=e.seatNumbering?.direction??"ltr",o=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",l=e.seatNumbering?.endAt,d=e.seatCount;if(i==="updown"||i==="updown-descending"){let p=Math.ceil(d/2),y=i==="updown"?t<p?n+2*t:n-1+2*(d-t):t<p?n+2*(p-1-t):n+1+2*(t-p);return`${a}${y}`}let s=i==="odd"||i==="even"?2:o,c=l!=null&&Number.isFinite(l)?l-(d-1)*s:n,u=r==="center"?Zt(d)[t]:r==="rtl"?d-1-t:t,h;switch(i){case"odd":{let p=c%2===1?c:c+1;h=String(p+u*2);break}case"even":{let p=c%2===0?c:c+1;h=String(p+u*2);break}case"roman":h=Ve(c+u*o);break;case"letters-upper":h=q(c+u*o,!1);break;case"letters-lower":h=q(c+u*o,!0);break;default:h=String(c+u*o);break}return`${a}${h}`}function Jt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Xe(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${oe(e,t)}`}function ge(e,t,n,r){if(r?.displayLabel)return r.displayLabel;if(e.seatDisplayLabelMode==="number")return oe(e,t);if(!n)return`${e.displayLabel||e.label}-${oe(e,t)}`;let o=Jt(n),i=n.displayOffset+t;return`${n.displayLabel}-${oe(o,i)}`}var xe=999,Ke=["clockwise","anticlockwise"],Ye=["table-number","number","letter"];function Se(e,t){return`${e.label}-${t+1}`}function en(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function ze(e,t){let n=e.chairNumbering,r=n?.start??1,o=en(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?q(Math.max(1,r)+o):String(r+o)}function Me(e,t){let n=ze(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function tn(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,n=Object.keys(t).filter(r=>!["start","direction","format"].includes(r));return n.length?`chairNumbering has unsupported field(s): ${n.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>xe)?`chairNumbering.start must be a whole number from 0 to ${xe}`:t.direction!==void 0&&!Ke.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!Ye.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}function nn(e){let t={};return e.start!==void 0&&e.start!==1&&(t.start=e.start),e.direction==="anticlockwise"&&(t.direction="anticlockwise"),e.format&&e.format!=="table-number"&&(t.format=e.format),Object.keys(t).length?t:void 0}var X=.02291666666666667,Jr=1/X,rn=58,on=rn*X;var an=3,We=0,we=120,sn=0,cn=45,ln=7,K=1.2;function ve(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function un(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=ln?e:an}function $e(e,t={}){let n=ve(t.floorBaseHeightM,We,we,0),r=Math.min(we,n+un(e.elevation)*on),o=e.height===void 0?r:ve(e.height,We,we,r),i=ve(e.rake,sn,cn,0);return{height:o,rake:i}}function Qe(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function qe(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let r=1/0;for(let o=0;o+1<e.length;o++){let i=e[o],a=e[o+1],l=a.x-i.x,d=a.y-i.y,s=l*l+d*d,c=s>1e-12?((t-i.x)*l+(n-i.y)*d)/s:0;c<0?c=0:c>1&&(c=1);let u=t-(i.x+c*l),h=n-(i.y+c*d);if(Math.abs(u)>=r||Math.abs(h)>=r)continue;let p=Math.hypot(u,h);p<r&&(r=p)}return r}function dn(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let r=e.length||1;t/=r,n/=r;let o=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>o&&(o=a)}return{cx:t,cy:n,r:o}}function Ze(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Pe(e,t){let n=1/0;for(let r of Qe(e)){let o=qe(t,r.x,r.y);o<n&&(n=o)}for(let r of Qe(t)){let o=qe(e,r.x,r.y);o<n&&(n=o)}return n}function fn(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,r=0;for(let c of e)n+=c.x,r+=c.y;n/=e.length,r/=e.length;let o=-1,i=e[0];for(let c of e){let u=Math.hypot(c.x-n,c.y-r);u>o&&(o=u,i=c)}let a=i.x-n,l=i.y-r,d=Math.hypot(a,l);d>1e-9?(a/=d,l/=d):(a=1,l=0);let s=e.map((c,u)=>({p:c,i:u,t:(c.x-n)*a+(c.y-r)*l})).sort((c,u)=>c.t-u.t);return{pts:s.map(c=>c.p),seatIndices:s.map(c=>t[c.i])}}function mn(e){let t=e.length;if(t<3)return null;let n=0,r=0;for(let I of e)n+=I.x,r+=I.y;n/=t,r/=t;let o=0,i=0,a=0,l=0,d=0,s=0,c=0;for(let I of e){let R=I.x-n,k=I.y-r;o+=R*R,a+=k*k,i+=R*k,l+=R*R*R,d+=k*k*k,s+=R*k*k,c+=k*R*R}let u=o*a-i*i;if(Math.abs(u)<1e-9)return null;let h=(l+s)/2,p=(d+c)/2,y=(h*a-p*i)/u,b=(p*o-h*i)/u,x=y+n,w=b+r;return!Number.isFinite(x)||!Number.isFinite(w)?null:{cx:x,cy:w}}var bn=.15;function hn(e){if(e.length<2)return null;let t=e.map(S=>{let f=0,m=0;for(let M of S.pts)f+=M.x,m+=M.y;return{x:f/S.pts.length,y:m/S.pts.length}}),n=0,r=0;for(let S of t)n+=S.x,r+=S.y;n/=t.length,r/=t.length;let o=0,i=0,a=0;for(let S of t){let f=S.x-n,m=S.y-r;o+=f*f,i+=f*m,a+=m*m}let l=o+a,d=o*a-i*i,s=l/2+Math.sqrt(Math.max(0,l*l/4-d)),c,u;Math.abs(i)>1e-12?(c=s-a,u=i):o>=a?(c=1,u=0):(c=0,u=1);let h=Math.hypot(c,u);if(!(h>1e-12))return null;c/=h,u/=h;let p=0,y=0,b=0;for(let S of e){if(S.pts.length<2)continue;let f=S.pts[0],m=S.pts[S.pts.length-1],M=m.x-f.x,g=m.y-f.y,P=Math.hypot(M,g);if(!(P>1e-9))continue;let O=M/P,v=g/P;p+=(O*O-v*v)*P,y+=2*O*v*P,b+=P}if(b>0&&Math.hypot(p,y)>=yn*b){let S=Math.atan2(y,p)/2,f=Math.cos(S),m=Math.sin(S);Math.abs(c*f+u*m)>gn&&(c=-m,u=f)}let x=1/0,w=-1/0,I=[];for(let S of e){let f=1/0,m=-1/0;for(let M of S.pts){let g=M.x*c+M.y*u;g<f&&(f=g),g>m&&(m=g),g<x&&(x=g),g>w&&(w=g)}I.push(m-f)}let R=w-x;return R>1e-9?(I.sort((S,f)=>S-f),I[Math.min(I.length-1,Math.floor(I.length*.9))]/R<=pn?{x:c,y:u}:null):null}var pn=.35,yn=.8,gn=.7;function Je(e,t,n,r){let o=new Map;for(let f of n){let m=t[f],M=m.rowId||`__seat-${f}`,g=o.get(M);g||(g={pts:[],idx:[]},o.set(M,g)),g.pts.push({x:m.x,y:m.y}),g.idx.push(f)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[f,m]of o){let M=fn(m.pts,m.idx),g=0;for(let P of M.pts)g+=Math.hypot(P.x-r.x,P.y-r.y);i.push({id:f,pts:M.pts,seatIndices:M.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:g/M.pts.length})}let a=i.map(f=>dn(f.pts)),l=i.length<=256?i.length*(i.length-1)/2:0,d=l?new Float64Array(l):null;d?.fill(Number.NaN);let s=d?new Map(i.map((f,m)=>[f,m])):null,c=(f,m)=>(f>m&&([f,m]=[m,f]),f*(2*i.length-f-1)/2+(m-f-1)),u=(f,m)=>{if(!d)return Pe(i[f].pts,i[m].pts);let M=c(f,m),g=d[M];if(!Number.isNaN(g))return g;let P=Pe(i[f].pts,i[m].pts);return d[M]=P,P},h=(f,m)=>s?u(s.get(f),s.get(m)):Pe(f.pts,m.pts),p=[];for(let f=0;f<i.length;f++){let m=1/0;for(let M=0;M<i.length;M++){if(f===M||Ze(a[f],a[M])>=m)continue;let g=u(f,M);g<m&&(m=g)}Number.isFinite(m)&&p.push(m)}p.sort((f,m)=>f-m);let y=p.length?p[Math.floor(p.length/2)]:1,b=Math.max(y*1.8,1e-6),x=i.map(()=>[]);for(let f=0;f<i.length;f++)for(let m=f+1;m<i.length;m++)Ze(a[f],a[m])>b||u(f,m)<=b&&(x[f].push(m),x[m].push(f));let w=0;for(let f=0;f<i.length;f++){if(i[f].blockId!==-1)continue;let m=w++,M=[f];for(i[f].blockId=m;M.length;){let g=M.pop();for(let P of x[g])i[P].blockId===-1&&(i[P].blockId=m,M.push(P))}}let I=new Map;for(let f of i){let m=I.get(f.blockId)??[];m.push(f),I.set(f.blockId,m)}let R=[];for(let f of i){if(f.pts.length<4)continue;let m=mn(f.pts);m&&(!Number.isFinite(m.cx)||!Number.isFinite(m.cy)||R.push({x:m.cx,y:m.cy}))}let k=R.length>=2?(()=>{let f=R.map(g=>g.x).sort((g,P)=>g-P),m=R.map(g=>g.y).sort((g,P)=>g-P),M=Math.floor(R.length/2);return{cx:f[M],cy:m[M]}})():null;if(k){let f=v=>Math.hypot(v.x-k.cx,v.y-k.cy),m=1/0,M=-1/0,g=[];for(let v of i){let C=1/0,A=-1/0;for(let _ of v.pts){let F=f(_);F<C&&(C=F),F>A&&(A=F)}g.push(A-C),C<m&&(m=C),A>M&&(M=A)}let P=M-m;g.sort((v,C)=>v-C);let O=g[Math.min(g.length-1,Math.floor(g.length*.9))];if(P>1e-9&&O/P<=bn){let v=i.map(E=>{let ee=0;for(let Et of E.pts)ee+=f(Et);return{row:E,radius:ee/E.pts.length}}),C=0,A=0;for(let E of v)C+=E.radius,A+=E.row.focalDistance;C/=v.length,A/=v.length;let _=0;for(let E of v)_+=(E.radius-C)*(E.row.focalDistance-A);if(_<0)for(let E of v)E.radius=-E.radius;let B=1/0;for(let E of v)E.radius<B&&(B=E.radius);v.sort((E,ee)=>E.radius-ee.radius);let D=-1,G=-1/0,At=P/Math.max(1,v.length)*.5,Le=[];for(let E of v)E.radius-G>At&&(D++,G=E.radius),E.row.ordinal=D,E.row.blockDepth=E.radius-B,Le.push(E.row);return{sectionId:e,rows:Le,blockCount:w}}}let S=[];for(let[,f]of I){let m=hn(f);if(m){let M=v=>{let C=0;for(let A of v.pts)C+=A.x*m.x+A.y*m.y;return C/v.pts.length};f.sort((v,C)=>M(v)-M(C)),f.length>=2&&f[0].focalDistance>f[f.length-1].focalDistance&&f.reverse();let g=[],P=y*.5;for(let v of f){let C=g[g.length-1];C&&Math.abs(M(v)-M(C[0]))<P?C.push(v):g.push([v])}let O=0;for(let v=0;v<g.length;v++){if(v>0){let C=1/0;for(let A of g[v-1])for(let _ of g[v])C=Math.min(C,h(A,_));O+=C}for(let C of g[v])C.ordinal=v,C.blockDepth=O,S.push(C)}}else{let M=1/0;for(let g of f)g.focalDistance<M&&(M=g.focalDistance);f.sort((g,P)=>g.focalDistance-P.focalDistance);for(let g=0;g<f.length;g++)f[g].ordinal=g,f[g].blockDepth=Math.max(0,f[g].focalDistance-M),S.push(f[g])}}return{sectionId:e,rows:S,blockCount:w}}var xn=/^\d{4}-\d{2}-\d{2}$/;function Sn(e){let t=Date.parse(e);return Number.isFinite(t)?xn.test(e)?t+864e5:t:null}function Mn(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let r=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(r)&&(t instanceof Date?t.getTime():t)<=r+366*864e5}let n=Sn(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function wn(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function vn(e){return e.status!=="draft"&&e.status!=="retracted"}function Pn(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function et(e,t={}){return!!e&&vn(e)&&wn(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Pn(e,t.activeBasisSha256)&&Mn(e,t.now)}var tt=36,nt=160;function In(e,t=360){let n=re(Math.round(Number.isFinite(e)?e:1),1,40),r=re(Number.isFinite(t)?t:360,120,360);return Math.round(re(n*4*(360/r),tt,nt))}var Cn=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function kn(e){return!!e&&Cn.has(e)}var rt=1.1;var io=Math.PI*2;var ao=(()=>{let t={x:0,y:52},n=25,r={x:70,y:t.y-70},o=(r.x*r.x+r.y*r.y-4900)/(2*(r.y+70)),i=o+70,a=[],l=Math.atan2(r.y-o,r.x),d=Math.atan2(r.y-o,-r.x);for(let s=0;s<=24;s++){let c=l+(d-l)*s/24;a.push({x:i*Math.cos(c),y:o+i*Math.sin(c)})}return{half:70,home:t,backstop:n,fence:a}})();function ot(e){return kn(e)}function Rn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,r=e.width,o=e.height;return[{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+o},{x:t,y:n+o}]}function An(e,t,n){let r=n*Math.PI/180,o=Math.cos(r),i=Math.sin(r),a=e.x-t.x,l=e.y-t.y;return{x:t.x+a*o-l*i,y:t.y+a*i+l*o}}function it(e){let t=Rn(e);if(!t||t.length<2)return null;let n=e.rotation??0,r=Math.abs(n)<1e-6?t:t.map(d=>An(d,{x:t.reduce((s,c)=>s+c.x,0)/t.length,y:t.reduce((s,c)=>s+c.y,0)/t.length},n)),o=1/0,i=1/0,a=-1/0,l=-1/0;for(let d of r)o=Math.min(o,d.x),i=Math.min(i,d.y),a=Math.max(a,d.x),l=Math.max(l,d.y);return!Number.isFinite(o)||a-o<1e-6||l-i<1e-6?null:{minX:o,minY:i,maxX:a,maxY:l}}var En=5,On=3,Tn=.92,Ln=1.9,_n=2,Dn=.6,jn=1,Nn=.06;function Fn(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?rt:ot(e.stageKind)?Nn:jn}function at(e){let t=1/0,n=1/0,r=-1/0,o=-1/0,i=-1/0;for(let a of Y(e)){let l=a.baseHeightM??0;for(let d of a.objects){if(d.type!=="shape"||d.role!=="stage")continue;let s=it(d);s&&(t=Math.min(t,s.minX),n=Math.min(n,s.minY),r=Math.max(r,s.maxX),o=Math.max(o,s.maxY),i=Math.max(i,l+Fn(d)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:r,maxY:o,deckTopM:i}}function Bn(e,t,n,r){let o=1/0,i=1/0,a=-1/0,l=-1/0;for(let p of e)Number.isFinite(p.eyeHeightM)&&(o=Math.min(o,p.x),a=Math.max(a,p.x),i=Math.min(i,p.y),l=Math.max(l,p.y));if(!Number.isFinite(o))return null;let d=o*t,s=i*t,c=Math.max(1,Math.ceil((a-o)*t/n)+1),u=Math.max(1,Math.ceil((l-i)*t/n)+1),h=new Float64Array(c*u).fill(-1/0);for(let p of e){if(!Number.isFinite(p.eyeHeightM))continue;let y=p.eyeHeightM-K,b=Math.min(c-1,Math.max(0,Math.floor((p.x*t-d)/n))),w=Math.min(u-1,Math.max(0,Math.floor((p.y*t-s)/n)))*c+b,I=y+r;I>h[w]&&(h[w]=I)}return{cellM:n,minX:d,minY:s,cols:c,rows:u,top:h}}function Hn(e,t,n){let r=Math.floor((t-e.minX)/e.cellM),o=Math.floor((n-e.minY)/e.cellM);return r<0||o<0||r>=e.cols||o>=e.rows?-1/0:e.top[o*e.cols+r]}function st(e,t,n={}){let r=new Map;if(!t||!e.length)return r;let o=n.metresPerChartUnit??X,i=n.cellM??Dn,a=n.chairBackM??Tn,l=n.selfRowSkipM??_n,d=n.clearThreshold??.9,s=n.partialThreshold??.25,c=Math.max(1,n.columns??En),u=Math.max(1,n.rows??On),h=Bn(e,o,i,a);if(!h)return r;let p=(t.maxX-t.minX)*o,y=(t.maxY-t.minY)*o,b=p>=y,x=(t.minX+t.maxX)/2*o,w=(t.minY+t.maxY)/2*o,I=[];for(let k=0;k<c;k++){let S=(k+.5)/c-.5,f=b?x+S*p:x,m=b?w:w+S*y;for(let M=0;M<u;M++){let g=t.deckTopM+(u===1?0:M/(u-1)*Ln);I.push({x:f,y:m,z:g})}}let R=i/2;for(let k of e){if(!Number.isFinite(k.eyeHeightM))continue;let S=k.x*o,f=k.y*o,m=k.eyeHeightM,M=0,g=1/0;for(let O of I){let v=O.x-S,C=O.y-f,A=Math.hypot(v,C);if(!(A>l)){M++;continue}let _=v/A,F=C/A,B=0;for(let D=l;D<A;D+=R){let G=Hn(h,S+_*D,f+F*D);if(!(!Number.isFinite(G)||G>=m)&&G>m+(O.z-m)*D/A){B=D;break}}B?g=Math.min(g,B):M++}let P=M/I.length;P>=d||r.set(k.id,{seatId:k.id,mark:P<s?"obstructedView":"restrictedView",visibleFraction:P,totalRays:I.length,atDistanceM:Number.isFinite(g)?g:0})}return r}function ct(e,t){if(!t.size)return 0;let n=0;for(let r of e){let o=t.get(r.id);if(!o)continue;let i=r.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(r.commercial={...i,[o.mark]:!0},n++)}return n}function Ie(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var se=Math.PI/180,Un=9,U=16;function Ce(e,t,n,r){let o=n*se,i=Math.cos(o),a=Math.sin(o);return{x:r.x+e*i-t*a,y:r.y+e*a+t*i}}function ce(e){let{seatCount:t,seatSpacing:n,curve:r,rotation:o,origin:i}=e,a=[];if(e.path)return me(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(r===0){for(let s=0;s<t;s++)a.push(Ce(s*n,0,o,i));return a}let l=r/(t-1)*se,d=n/(2*Math.sin(Math.abs(l)/2));for(let s=0;s<t;s++){let c=s*l,u=d*Math.sin(c),h=-d+d*Math.cos(c);a.push(Ce(u,h,o,i))}return a}function ft(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Gn(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function mt(e,t){let n=ft(e);return ce(e).map((r,o)=>{let i=n.get(o),a=Ie(i),l=Xe(e,o,i),d={...e.commercial,...i?.commercial};return{index:o,x:r.x+(i?.dx??0),y:r.y+(i?.dy??0),label:l,displayLabel:ge(e,o,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(d).some(s=>s!==void 0&&s!==!1&&s!=="")?d:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function bt(e){let t=[];for(let n of mt(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function ht(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),r={top:0,bottom:0,left:0,right:0};if(!n.length)return r;let o=Math.max(0,Math.round(e.seatCount));for(let i=0;i<o;i++)r[n[i%n.length]]+=1;return r}function Re(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let r=new Map((e.overrides??[]).map(c=>[c.index,c])),o=(c,u,h,p)=>{let y=r.get(c),b=Ie(y),x=y?.label??Se(e,c);return{index:c,label:x,displayLabel:y?.displayLabel??Me(e,c),x:u+(y?.dx??0),y:h+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:b.length>0,accessibility:b,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...p?{side:p}:{}}};if(e.shape==="round"){let c=(e.radius??40)+U,u=e.rotation*se,h=Math.max(0,Math.min(360,e.seatArc??360));if(h>=360||n===1){for(let x=0;x<n;x++){let w=u+x/n*2*Math.PI;t.push(o(x,e.center.x+c*Math.cos(w),e.center.y+c*Math.sin(w)))}return t}let p=h*se,y=(2*Math.PI-p)/2,b=u+y;for(let x=0;x<n;x++){let w=b+x/(n-1)*p;t.push(o(x,e.center.x+c*Math.cos(w),e.center.y+c*Math.sin(w)))}return t}let i=e.width??80,a=e.height??50,l=ht(e),d=["top","bottom","left","right"],s=0;for(let c of d){let u=l[c];for(let h=0;h<u;h++){let p,y;c==="top"?(p=-i/2+(h+.5)*i/u,y=-a/2-U):c==="bottom"?(p=-i/2+(h+.5)*i/u,y=a/2+U):c==="left"?(p=-i/2-U,y=-a/2+(h+.5)*a/u):(p=i/2+U,y=-a/2+(h+.5)*a/u);let b=Ce(p,y,e.rotation,e.center);t.push(o(s++,b.x,b.y,c))}}return t}function Vn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Re(e).filter(t=>!t.skipped).length}function pt(e){return Re(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function yt(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function ke(e,t){let n=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){let i=t[r].x,a=t[r].y,l=t[o].x,d=t[o].y;a>e.y!=d>e.y&&e.x<(l-i)*(e.y-a)/(d-a)+i&&(n=!n)}return n}function Xn(e,t){return t.some((n,r)=>{let o=t[(r+1)%t.length],i=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y),l=(o.x-n.x)**2+(o.y-n.y)**2;return a>=-1e-7&&a<=l+1e-7})}function z(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Z(e,t,n){return ke(e,t)&&!z(n).some(r=>ke(e,r)||Xn(e,r))}function Kn(e,t){return ye(e,t).point}function ae(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;return{x:t/e.length,y:n/e.length}}function Ae(e){switch(e.type){case"row":{let t=ce(e),n=ft(e),r=0,o=0,i=0;for(let a=0;a<t.length;a++){let l=n.get(a);l?.skip||(r+=t[a].x+(l?.dx??0),o+=t[a].y+(l?.dy??0),i++)}return i?{x:r/i,y:o/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ae(e.points);case"section":return ae(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ae(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function lt(e,t){return e.length===t.length&&e.every((n,r)=>n.x===t[r].x&&n.y===t[r].y)}function Yn(e,t){if(e.type!=="gaArea"||!lt(e.points,t.outline))return!1;let n=z(e.holes),r=z(t.holes);return n.length===r.length&&n.every((o,i)=>lt(o,r[i]))}function gt(e,t,n=e.filter(o=>o.type==="section"),r=Ae(t)){let o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(o?n.find(a=>(a.logicalSectionId??a.id)===o&&(Yn(t,a)||Z(r,a.outline,a.holes))):void 0)??n.find(a=>Z(r,a.outline,a.holes))}function Y(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function zn(e,t){let n=Y(e);return(t?n.find(r=>r.id===t):n[0])?.objects??[]}function xt(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function le(e,t,n){let r=i=>({x:i.x+t,y:i.y+n}),o=i=>i.map(r);switch(e.type){case"row":return{...e,origin:r(e.origin)};case"table":case"booth":return{...e,center:r(e.center)};case"gaArea":return{...e,points:o(e.points),...e.holes?{holes:z(e.holes).map(o)}:{}};case"section":return{...e,outline:o(e.outline),...e.outlinePath?{outlinePath:Ge(e.outlinePath,t,n)}:{},...e.holes?{holes:z(e.holes).map(o)}:{}};case"text":return{...e,position:r(e.position)};case"shape":return{...e,...e.points?{points:o(e.points)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function Wn(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((r,o)=>{let i=-o*t;for(let a of r.objects)n.push(i===0?a:le(a,0,i))}),{...e,objects:n,floors:void 0}}function ut(e,t,n,r,o,i,a,l,d){let s=[],c=e.filter(b=>b.type==="section"),u=Q(e),h=b=>!b?.eventConfigurationId||b.eventConfigurationId===r&&(b.eventConfigurationVersion===void 0||b.eventConfigurationVersion===d),p=b=>et(b,{activeConfigurationId:r,activeConfigurationVersion:d,activeBasisSha256:o,now:l}),y=(b,x)=>p(b)?{...b,coverage:x}:void 0;for(let b of e){let x=[];if(b.type==="row"?x=bt(b):b.type==="table"?x=pt(b):b.type==="booth"&&(x=yt(b)),!x.length)continue;for(let S of x)S.viewUrl&&!h(S.viewMeta)&&(S.viewUrl=void 0,S.viewMeta=void 0);if(b.type==="row"){let S=u.get(b.id);if(S){let f=new Map((b.overrides??[]).map(m=>[m.index,m]));for(let m of x){let M=Number(m.id.slice(m.id.lastIndexOf(":")+1));if(!Number.isInteger(M))continue;m.logicalRowId=S.groupId,m.logicalSeatIndex=S.adjacencyOffset+M,f.get(M)?.displayLabel||(m.displayLabel=ge(b,M,S)),!m.viewUrl&&S.viewFromSeatUrl&&h(S.viewFromSeatMeta)&&(m.viewUrl=S.viewFromSeatUrl,m.viewMeta=S.viewFromSeatMeta);let g=f.get(M)?.confidenceEvidence;m.confidenceEvidence=y(g,"exact-seat")??y(b.confidenceEvidence,"row-representative")??y(S.confidenceEvidence,"row-representative")}}}let w=gt(e,b,c,b.type==="row"?ae(x):Ae(b)),I=w?.viewFromSeatUrl,k=(w?.zone?t?.find(S=>S.id===w.zone):void 0)?.focalPoint??n;for(let S of x){if(!S.confidenceEvidence){let f=Number(S.id.slice(S.id.lastIndexOf(":")+1)),m=(b.type==="row"||b.type==="table")&&Number.isInteger(f)?b.overrides?.find(M=>M.index===f)?.confidenceEvidence:void 0;S.confidenceEvidence=y(m,"exact-seat")??(b.type==="row"?y(b.confidenceEvidence,"row-representative"):void 0)}S.confidenceEvidence??=y(w?.confidenceEvidence,"section-representative")??(a?y(a.evidence,a.coverage):void 0),!S.viewUrl&&I&&h(w?.viewFromSeatMeta)&&(S.viewUrl=I,S.viewMeta=w?.viewFromSeatMeta),!S.viewUrl&&i&&h(i.meta)&&(S.viewUrl=i.url,S.viewMeta=i.meta),w&&(S.sectionId=w.logicalSectionId??w.id),w?.zone&&(S.zoneId=w.zone),k&&(S.focalPoint={...k})}s.push(...x)}return s}function $n(e,t={}){if(e.floors?.length){let r=[];for(let o of e.floors){let i=o.focalPoint??e.focalPoint,a=o.viewFromSeatUrl?{url:o.viewFromSeatUrl,meta:o.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,l=o.confidenceEvidence?{evidence:o.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,d=ut(o.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&dt(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,d);for(let s of d)s.floorId=o.id;for(let s of d)r.push(s)}return r}let n=ut(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&dt(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),Qn(e,n,t)}function Qn(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||ct(t,st(t,at(e))),t}function dt(e,t,n,r){let o=e.filter(u=>u.type==="section"),i=n>0||o.some(u=>u.height!==void 0||u.rake!==void 0||(u.elevation??0)>0);if(!o.length||!i||!t){for(let u of r)u.eyeHeightM=n+K;return}let a=new Array(r.length),l=new Map;for(let u of o)l.has(u.id)||l.set(u.id,u);let d=new Map,s=new Map;for(let u=0;u<r.length;u++){let h=r[u],y=(h.sectionId?l.get(h.sectionId)??o.find(x=>x.logicalSectionId===h.sectionId&&Z({x:h.x,y:h.y},x.outline,x.holes)):void 0)??o.find(x=>Z({x:h.x,y:h.y},x.outline,x.holes))??null;if(a[u]=y,!y)continue;d.has(y.id)||d.set(y.id,$e(y,{floorBaseHeightM:n}));let b=s.get(y.id);b?b.push(u):s.set(y.id,[u])}let c=new Array(r.length).fill(void 0);for(let[u,h]of s){let p=d.get(u);if(!p)continue;let y=p.rake>0?Math.tan(p.rake*Math.PI/180):0,b=Je(u,r,h,t);for(let x of b.rows){let w=x.blockDepth*X*y,I=p.height+w;for(let R of x.seatIndices)c[R]=I}}for(let u=0;u<r.length;u++){let h=r[u],p=a[u];if(!p){h.eyeHeightM=n+K;continue}let y=d.get(p.id);h.eyeHeightM=(c[u]??y.height)+K}}var ie=40;function J(e,t){let n=t?.freeText==="exclude",r=1/0,o=1/0,i=-1/0,a=-1/0,l=(s,c)=>{s<r&&(r=s),c<o&&(o=c),s>i&&(i=s),c>a&&(a=c)},d=s=>{if(Array.isArray(s))for(let c of s)!c||typeof c!="object"||l(c.x,c.y)};for(let s of xt(e))if(s.type==="row"){let c=new Map((s.overrides??[]).map(u=>[u.index,u]));ce(s).forEach((u,h)=>{let p=c.get(h);p?.skip||l(u.x+(p?.dx??0),u.y+(p?.dy??0))})}else if(s.type==="gaArea")d(s.points);else if(s.type==="section")d(s.outline);else if(s.type==="decorImage")l(s.x,s.y),l(s.x+s.width,s.y+s.height);else if(s.type==="shape")s.points&&s.points.length?d(s.points):s.x!=null&&s.y!=null&&s.width!=null&&s.height!=null&&(l(s.x,s.y),l(s.x+s.width,s.y+s.height));else if(s.type==="table"){let c=U+Un,u=s.shape==="round"?(s.radius??40)+c:Math.max((s.width??80)/2,(s.height??50)/2)+c;l(s.center.x-u,s.center.y-u),l(s.center.x+u,s.center.y+u)}else if(s.type==="booth"){let c=Math.max(s.width,s.height)/2;l(s.center.x-c,s.center.y-c),l(s.center.x+c,s.center.y+c)}else if(s.type==="text"){if(n)continue;let c=be(s);l(s.position.x,s.position.y),l(s.position.x+c.width,s.position.y+c.height)}for(let s of[e.referenceImage,e.backgroundImage]){if(!s)continue;let{center:c,width:u}=s;if(!c||!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(u))continue;let h=u*3/4;l(c.x-u/2,c.y-h/2),l(c.x+u/2,c.y+h/2)}if(!isFinite(r)){let s=e.focalPoint??{x:0,y:0};return{x:s.x-200,y:s.y-200,width:400,height:400}}return{x:r-ie,y:o-ie,width:i-r+ie*2,height:a-o+ie*2}}function St(e){let t=e.backgroundImage;return t?.url&&!t.assetId?t:void 0}var Mt=.08,qn=.045;function Ee(e){return`__floor__:${encodeURIComponent(e)}`}function wt(e,t,n){return{...e,objects:t,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function Zn(e,t,n){let r=e.focalPoint??t.focalPoint;return r?r.x:n.x+n.width/2}function vt(e){let t=e.floors??[];if(!t.length)return[];let n=t.map(a=>J(wt(e,a.objects,a.focalPoint),{freeText:"exclude"})),o=Math.max(1,...n.map(a=>a.width))*Mt,i=0;return t.map((a,l)=>{let d=n[l],s=i-(d.y+d.height);return i-=d.height+o,{floorId:a.id,label:a.name??a.id,level:l,levelBadge:l===0?"G":String(l),translation:{x:-Zn(a,e,d),y:s},bounds:d}})}function Jn(e,t,n,r){let o=t==="name"?e.label:e.levelBadge;if(!o)return[];let i=Math.max(1,n*qn),a=e.bounds.x+e.translation.x,l=e.bounds.y+e.translation.y+i*.4,d=`floor-level-${e.floorId}`,s={type:"text",id:`${d}-text`,text:o,position:{x:a,y:l},fontSize:i,rotation:0,color:r,bold:!0};if(t==="name")return[s];let c=i*.95;return[{type:"shape",id:`${d}-badge`,kind:"ellipse",x:a-c*.35,y:l-c*.3,width:c*2,height:c*2,fill:"transparent",stroke:{color:r,width:Math.max(1,i*.09)},opacity:.8},s]}function er(e,t={}){let n=e.floors;if(!n||n.length<2)return e;let r=vt(e),o=[];n.forEach((s,c)=>{let{x:u,y:h}=r[c].translation;for(let p of s.objects)c>0&&p.type==="shape"&&p.role==="stage"||o.push(le(p,u,h))});let i={...e,objects:o,floors:void 0},a=J(i,{freeText:"exclude"}),l=Math.max(1,a.width,a.height),d=e.theme?.textColor??"#94a3b8";for(let s of r)o.push(...Jn(s,t.labelStyle??"number",l,d));return{...i,objects:o,referenceImage:void 0,backgroundImage:void 0}}function tr(e){if(!e.floors||e.floors.length<2)return e;let t=!e.zones?.length,n=new Set,r=e.floors.flatMap(i=>i.objects.flatMap(a=>{if(a.type==="shape"&&a.role==="stage"){let l=JSON.stringify([a.kind,a.x,a.y,a.width,a.height,a.points,a.rotation??0,a.label,a.heightM,a.eventConfigurationIds]);if(n.has(l))return[];n.add(l)}return t&&a.type==="section"?[{...a,zone:Ee(i.id)}]:[a]})),o=t?e.floors.map(i=>({id:Ee(i.id),label:i.name,focalPoint:{...i.focalPoint}})):e.zones;return{...e,objects:r,zones:o,floors:void 0,referenceImage:void 0,backgroundImage:St(e)}}function nr(e){let t=e.floors;if(!t?.length)return null;let n=t.find(i=>i.objects.some(a=>a.type==="shape"&&a.role==="stage"));if(n)return n.id;let r=t[0],o=-1;for(let i of t){let a=J(wt(e,i.objects,i.focalPoint),{freeText:"exclude"}),l=a.width*a.height;l>o&&(o=l,r=i)}return r.id}var rr=640;function or(e,t){return(e.floors?.length??0)<2?null:"all"}function ir(e,t=0){let n=Math.max(1,e.width,e.height),r={x:e.x+e.width/2,y:e.y+e.height/2},o=n*1.55,i=Math.max(n*.82,Math.max(0,t)+n*.45);return{target:r,distance:o,height:i,focalLength:Math.hypot(o,i),yawRad:-8*Math.PI/180}}function ue(e,t,n=0){let r=t.x-e.target.x,o=t.y-e.target.y,i=Math.cos(e.yawRad),a=Math.sin(e.yawRad),l=r*i-o*a,s=r*a+o*i-e.distance,c=n-e.height,u=Math.hypot(e.distance,e.height),h=(-e.distance*s-e.height*c)/u,p=(-e.height*s+e.distance*c)/u,y=Math.max(u*.08,h),b=e.focalLength/y;return{x:e.target.x+l*b,y:e.target.y-p*b,depth:y,scale:b}}function ar(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function sr(e){let t=e.a*e.d-e.b*e.c;if(!Number.isFinite(t)||Math.abs(t)<1e-9)throw new Error("perspective projection produced a singular affine");let n=e.d/t,r=-e.b/t,o=-e.c/t,i=e.a/t;return{a:n,b:r,c:o,d:i,e:-(n*e.e+o*e.f),f:-(r*e.e+i*e.f)}}function cr(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}}function lr(e,t,n=()=>0){let r=ue(e,t,n(t)),o={x:t.x+1,y:t.y},i={x:t.x,y:t.y+1},a=ue(e,o,n(o)),l=ue(e,i,n(i)),d=a.x-r.x,s=a.y-r.y,c=l.x-r.x,u=l.y-r.y;return{a:d,b:s,c,d:u,e:r.x-d*t.x-c*t.y,f:r.y-s*t.x-u*t.y}}function ur(e){let t=Math.hypot(e.a,e.b),n=e.a*e.d-e.b*e.c;return{rotationDeg:Math.atan2(e.b,e.a)*180/Math.PI,scaleX:t,scaleY:n/Math.max(t,1e-9),skewX:(e.a*e.c+e.b*e.d)/Math.max(n,1e-9)}}var Pt=9;function dr(e){if(e.kind==="circle")return{hx:e.r,hy:e.r};let t=e.width/2,n=e.height/2,r=e.rotation??0;if(!r)return{hx:t,hy:n};let o=r*Math.PI/180,i=Math.abs(Math.cos(o)),a=Math.abs(Math.sin(o));return{hx:t*i+n*a,hy:t*a+n*i}}function fr(e,t,n){let r=t-e.seat.x,o=n-e.seat.y;if(e.shape.kind==="circle")return r*r+o*o<=e.shape.r*e.shape.r;let i=e.shape.rotation??0,a=r,l=o;if(i){let d=-i*Math.PI/180,s=Math.cos(d),c=Math.sin(d);a=r*s-o*c,l=r*c+o*s}return Math.abs(a)<=e.shape.width/2&&Math.abs(l)<=e.shape.height/2}function mr(e,t,n,r,o){if(e.shape.kind==="circle"){let y=Math.min(Math.max(e.seat.x,t),r),b=Math.min(Math.max(e.seat.y,n),o),x=e.seat.x-y,w=e.seat.y-b;return x*x+w*w<=e.shape.r*e.shape.r}let i=e.shape.rotation??0;if(!i)return e.seat.x-e.hx<=r&&e.seat.x+e.hx>=t&&e.seat.y-e.hy<=o&&e.seat.y+e.hy>=n;let a=i*Math.PI/180,l=Math.cos(a),d=Math.sin(a),s=e.shape.width/2,c=e.shape.height/2,u=[[-s,-c],[s,-c],[s,c],[-s,c]].map(([y,b])=>[e.seat.x+y*l-b*d,e.seat.y+y*d+b*l]),h=[[t,n],[r,n],[r,o],[t,o]],p=[[1,0],[0,1],[l,d],[-d,l]];for(let[y,b]of p){let x=1/0,w=-1/0;for(let[k,S]of u){let f=k*y+S*b;f<x&&(x=f),f>w&&(w=f)}let I=1/0,R=-1/0;for(let[k,S]of h){let f=k*y+S*b;f<I&&(I=f),f>R&&(R=f)}if(w<I||R<x)return!1}return!0}function br(e,t={}){let n=t.seatRadius??Pt,r=e.length,o=new Array(r),i=1/0,a=1/0,l=-1/0,d=-1/0,s=0;for(let f=0;f<r;f++){let m=e[f],M=t.shapeOf?.(m)??{kind:"circle",r:n},{hx:g,hy:P}=dr(M);o[f]={seat:m,shape:M,hx:g,hy:P},m.x-g<i&&(i=m.x-g),m.y-P<a&&(a=m.y-P),m.x+g>l&&(l=m.x+g),m.y+P>d&&(d=m.y+P),g>s&&(s=g),P>s&&(s=P)}r===0&&(i=0,a=0,l=0,d=0);let c=s>0?s*4:1,u=Math.max(l-i,0),h=Math.max(d-a,0),p=Math.max(64,t.maxCells??r*4),y=c,b=Math.max(1,Math.ceil(u/y)||1),x=Math.max(1,Math.ceil(h/y)||1);for(;b*x>p&&(b>1||x>1);)y*=2,b=Math.max(1,Math.ceil(u/y)||1),x=Math.max(1,Math.ceil(h/y)||1);let w=b*x,I=new Int32Array(w+1),R=0;for(let f=0;f<r;f++){let m=o[f],M=j(Math.floor((m.seat.x-m.hx-i)/y),0,b-1),g=j(Math.floor((m.seat.x+m.hx-i)/y),0,b-1),P=j(Math.floor((m.seat.y-m.hy-a)/y),0,x-1),O=j(Math.floor((m.seat.y+m.hy-a)/y),0,x-1);for(let v=P;v<=O;v++)for(let C=M;C<=g;C++)I[v*b+C+1]++,R++}for(let f=0;f<w;f++)I[f+1]+=I[f];let k=new Int32Array(R),S=I.slice(0,w);for(let f=0;f<r;f++){let m=o[f],M=j(Math.floor((m.seat.x-m.hx-i)/y),0,b-1),g=j(Math.floor((m.seat.x+m.hx-i)/y),0,b-1),P=j(Math.floor((m.seat.y-m.hy-a)/y),0,x-1),O=j(Math.floor((m.seat.y+m.hy-a)/y),0,x-1);for(let v=P;v<=O;v++)for(let C=M;C<=g;C++){let A=v*b+C;k[S[A]++]=f}}return{seats:e,entries:o,minX:i,minY:a,cell:y,cols:b,rows:x,cellStart:I,items:k,stamp:new Int32Array(r),epoch:0}}function hr(e,t,n={}){let{cols:r,rows:o,cell:i,minX:a,minY:l,cellStart:d,items:s,entries:c}=e,u=Math.floor((t.x-a)/i),h=Math.floor((t.y-l)/i);if(u<0||h<0||u>=r||h>=o)return null;let p=h*r+u,y=d[p+1],b=-1,x=1/0;for(let w=d[p];w<y;w++){let I=s[w],R=c[I];if(n.filter&&!n.filter(R.seat.id,R.seat)||!fr(R,t.x,t.y))continue;let k=t.x-R.seat.x,S=t.y-R.seat.y,f=k*k+S*S;(f<x||f===x&&I<b)&&(x=f,b=I)}return b<0?null:c[b].seat.id}function pr(e,t,n,r={}){if(!(n>0))return null;let{cols:o,rows:i,cell:a,minX:l,minY:d,cellStart:s,items:c,entries:u}=e,h=Math.max(0,Math.floor((t.x-n-l)/a)),p=Math.min(o-1,Math.floor((t.x+n-l)/a)),y=Math.max(0,Math.floor((t.y-n-d)/a)),b=Math.min(i-1,Math.floor((t.y+n-d)/a));if(h>p||y>b)return null;let x=-1,w=n*n,I=e.stamp,R=++e.epoch;for(let k=y;k<=b;k++){let S=k*o;for(let f=h;f<=p;f++){let m=S+f,M=s[m+1];for(let g=s[m];g<M;g++){let P=c[g];if(I[P]===R)continue;I[P]=R;let O=u[P];if(r.filter&&!r.filter(O.seat.id,O.seat))continue;let v=t.x-O.seat.x,C=t.y-O.seat.y,A=v*v+C*C;(A<w||A===w&&P<x)&&(w=A,x=P)}}}return x<0?null:u[x].seat.id}function yr(e,t,n={}){let r=Math.min(t.x,t.x+t.width),o=Math.max(t.x,t.x+t.width),i=Math.min(t.y,t.y+t.height),a=Math.max(t.y,t.y+t.height),l=n.mode??"center",{cols:d,rows:s,cell:c,minX:u,minY:h,cellStart:p,items:y,entries:b}=e,x=Math.max(0,Math.floor((r-u)/c)),w=Math.min(d-1,Math.floor((o-u)/c)),I=Math.max(0,Math.floor((i-h)/c)),R=Math.min(s-1,Math.floor((a-h)/c));if(x>w||I>R)return[];let k=[],S=e.stamp,f=++e.epoch;for(let m=I;m<=R;m++){let M=m*d;for(let g=x;g<=w;g++){let P=M+g,O=p[P+1];for(let v=p[P];v<O;v++){let C=y[v];if(S[C]===f)continue;S[C]=f;let A=b[C];if(n.filter&&!n.filter(A.seat.id,A.seat))continue;(l==="center"?A.seat.x>=r&&A.seat.x<=o&&A.seat.y>=i&&A.seat.y<=a:mr(A,r,i,o,a))&&k.push(C)}}}return k.sort((m,M)=>m-M),k.map(m=>b[m].seat.id)}function gr(e){let t=e.cols*e.rows,n=0,r=0;for(let i=0;i<t;i++){let a=e.cellStart[i+1]-e.cellStart[i];a>0&&n++,a>r&&(r=a)}let o=e.items.length;return{cell:e.cell,cols:e.cols,rows:e.rows,cells:t,occupiedCells:n,refs:o,maxPerCell:r,meanPerOccupiedCell:n?o/n:0}}var xr=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],Fo=new Map(xr.map(e=>[e.key,e]));var Sr=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],Bo=new Map(Sr.map(e=>[e.key,e]));var It=["start","end","both","none"];var Mr=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],Ho=new Set(Mr);function W(e){return typeof e=="string"&&It.includes(e)}function de(e,t){return e&&t?"both":e?"start":t?"end":"none"}function Ct(e){let t=new Map,n=Q(e);if(!n.size)return t;let r=new Map;for(let o of e){if(o.type!=="row"||!n.has(o.id))continue;let i=o.segmentedRow.groupId,a=r.get(i)??[];a.push(o),r.set(i,a)}for(let o of r.values())o.sort((i,a)=>i.segmentedRow.componentIndex-a.segmentedRow.componentIndex),o.forEach((i,a)=>{let l=o[a+1];t.set(i.id,{start:a>0&&i.segmentedRow.boundaryBefore==="continuous",end:!!l&&l.segmentedRow.boundaryBefore==="continuous"})});return t}function kt(e,t){let n=Number.isInteger(e.seatCount)&&e.seatCount>0?e.seatCount:0,r=new Set;for(let u of e.overrides??[])u.skip&&r.add(u.index);let o=u=>u>=0&&u<n&&!r.has(u),i=de(!t?.start,!t?.end),a=W(e.aisleSeats)?e.aisleSeats:void 0,l=a??i,d=-1,s=-1;for(let u=0;u<n;u+=1)o(u)&&(d<0&&(d=u),s=u);let c=new Set;if(d>=0){(l==="start"||l==="both")&&c.add(d),(l==="end"||l==="both")&&c.add(s);for(let u of r)o(u-1)&&c.add(u-1),o(u+1)&&c.add(u+1)}return{...a?{override:a}:{},automatic:i,slots:[...c].sort((u,h)=>u-h)}}function wr(e,t=[e]){return kt(e,e.segmentedRow?Ct(t).get(e.id):void 0)}function Rt(e){let t=new Set;for(let n of Y(e)){let r=Ct(n.objects);for(let o of n.objects)if(o.type==="row")for(let i of kt(o,r.get(o.id)).slots)t.add(`${o.id}:${i}`)}return t}function vr(e,t,n){return Rt(e).has(`${t}:${n}`)}function Oe(e){let t=W(e.aisleSeats)?e.aisleSeats:"both";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function Te(e,t){t==="both"?delete e.aisleSeats:e.aisleSeats=t}function Pr(e,t,n){if(!W(e.aisleSeats)){delete t.aisleSeats,delete n.aisleSeats;return}let r=Oe(e);Te(t,de(r.start,!0)),Te(n,de(!0,r.end))}function Ir(e,t){let n=e[0],r=e[e.length-1];if(!n||!r||!W(n.aisleSeats)&&!W(r.aisleSeats)){delete t.aisleSeats;return}Te(t,de(Oe(n).start,Oe(r).end))}0&&(module.exports={AUTOMATIC_ROUND_TABLE_RADIUS_MAX,AUTOMATIC_ROUND_TABLE_RADIUS_MIN,CHAIR_NUMBERING_DIRECTIONS,CHAIR_NUMBERING_FORMATS,CHAIR_NUMBERING_START_MAX,DEFAULT_SEAT_RADIUS,FLOOR_STACK_GAP_RATIO,FLOOR_STACK_MIN_SURFACE_PX,TABLE_SEAT_OFFSET,TEXT_BACKGROUND_PADDING_MAX,TEXT_BACKGROUND_RADIUS_MAX,TEXT_LETTER_SPACING_MAX,TEXT_LETTER_SPACING_MIN,TEXT_LINE_HEIGHT_MAX,TEXT_LINE_HEIGHT_MIN,TEXT_OPACITY_MIN,TEXT_WIDTH_MAX,TEXT_WIDTH_MIN,aisleSeatIds,allObjects,applyAffine,automaticRoundTableRadius,buildAisleHoles,buildSeatIndex,buildSectionShell,chairNumberingProblem,chartBounds,combinedFloorZoneId,compactChairNumbering,composeAffine,createPerspectiveCamera,cubicPoint,decomposeAffineLinear,distanceToRings,distributeAlongCubic,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorStackPlacements,floorsOf,gridStats,hitTest,initialFloorMode,invertAffine,isAisleSeat,isRowAisleSeats,layoutCombinedFloorPlan,layoutFloorStack,mainFloorId,mergeRowAisleSeats,nearestWithin,objectCenter,owningSectionForObject,perspectiveTangentAffine,pointInPolygon,pointInPolygonWithHoles,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,projectPerspectivePoint,queryRect,resolveRowAisleSeats,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,splitRowAisleSeats,stackFloors,tableChairBookingLabel,tableChairDisplayLabel,tableChairToken,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject,usableHoles});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as Point,
|
|
2
|
-
export { F as FloorLabelStyle } from '../../types-
|
|
3
|
-
export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject, L as usableHoles } from '../../tableSizing-
|
|
4
|
-
export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-
|
|
5
|
-
import { E as ExpandedSeat } from '../../renderer-
|
|
1
|
+
import { P as Point, v as CubicPath, w as TextObject, x as TableChairNumbering, T as TableObject, y as RowAisleSeats, C as ChartDoc, R as RowObject, a as ChartObject } from '../../types-DL7qIUrD.cjs';
|
|
2
|
+
export { F as FloorLabelStyle } from '../../types-DL7qIUrD.cjs';
|
|
3
|
+
export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject, L as usableHoles } from '../../tableSizing-BJqAuJDg.cjs';
|
|
4
|
+
export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-Ddx5ol8T.cjs';
|
|
5
|
+
import { E as ExpandedSeat } from '../../renderer-D6ggv3bV.cjs';
|
|
6
6
|
|
|
7
7
|
type SectionShellMode = 'auto' | 'rectangle' | 'tapered' | 'bezier';
|
|
8
8
|
declare function cubicPoint(path: CubicPath, t: number): Point;
|
|
@@ -374,4 +374,61 @@ interface TextLayoutMetrics {
|
|
|
374
374
|
* collision checks. Konva remains authoritative for exact glyph metrics. */
|
|
375
375
|
declare function textLayoutMetrics(text: TextObject): TextLayoutMetrics;
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
/**
|
|
378
|
+
* Buyer-facing chair numbers for a table. DISPLAY ONLY: the booking label of a
|
|
379
|
+
* chair stays `${table.label}-${index + 1}` (see `tableChairBookingLabel`)
|
|
380
|
+
* whatever the numbering says, so no ticket, hold or booking ever moves.
|
|
381
|
+
*
|
|
382
|
+
* Gaps (skipped chairs) keep their number, exactly as a row's seats and as
|
|
383
|
+
* tables always have: a gap at the third chair reads 1, 2, 4.
|
|
384
|
+
* Anticlockwise walks the same physical chairs in the reverse authored order
|
|
385
|
+
* (round tables: back round the ring; rectangular: right → left → bottom → top).
|
|
386
|
+
*/
|
|
387
|
+
declare const CHAIR_NUMBERING_START_MAX = 999;
|
|
388
|
+
declare const CHAIR_NUMBERING_DIRECTIONS: readonly ["clockwise", "anticlockwise"];
|
|
389
|
+
declare const CHAIR_NUMBERING_FORMATS: readonly ["table-number", "number", "letter"];
|
|
390
|
+
/** The stable inventory label of one chair. Never depends on `chairNumbering`. */
|
|
391
|
+
declare function tableChairBookingLabel(table: Pick<TableObject, 'label'>, index: number): string;
|
|
392
|
+
/** The token buyers read for chair `index`: "3", "C" (no table name). */
|
|
393
|
+
declare function tableChairToken(table: Pick<TableObject, 'seatCount' | 'chairNumbering'>, index: number): string;
|
|
394
|
+
/** What buyers read for chair `index` when the chair has no label of its own. */
|
|
395
|
+
declare function tableChairDisplayLabel(table: Pick<TableObject, 'label' | 'displayLabel' | 'seatCount' | 'chairNumbering'>, index: number): string;
|
|
396
|
+
/** Why a stored/proposed numbering is invalid, or null when it is fine. */
|
|
397
|
+
declare function chairNumberingProblem(value: unknown): string | null;
|
|
398
|
+
/** Drops default values so an all-default numbering is stored as absent. */
|
|
399
|
+
declare function compactChairNumbering(numbering: TableChairNumbering): TableChairNumbering | undefined;
|
|
400
|
+
|
|
401
|
+
/** What one row resolves to, for the Designer's aisle-seat control. */
|
|
402
|
+
interface RowAisleResolution {
|
|
403
|
+
/** The author's override, when the row carries one. */
|
|
404
|
+
override?: RowAisleSeats;
|
|
405
|
+
/** The ends the automatic rule marks for this row (before any override). */
|
|
406
|
+
automatic: RowAisleSeats;
|
|
407
|
+
/** Slot indices of the row's aisle seats (present seats only), ascending. */
|
|
408
|
+
slots: number[];
|
|
409
|
+
}
|
|
410
|
+
/** True when `value` is one of the four override values. */
|
|
411
|
+
declare function isRowAisleSeats(value: unknown): value is RowAisleSeats;
|
|
412
|
+
/**
|
|
413
|
+
* One row's aisle seats. `floorObjects` are the objects on the row's floor
|
|
414
|
+
* (segmented-row siblings are found there); omit them for a row on its own.
|
|
415
|
+
*/
|
|
416
|
+
declare function resolveRowAisleSeats(row: RowObject, floorObjects?: readonly ChartObject[]): RowAisleResolution;
|
|
417
|
+
/** Every aisle seat on the chart, as seat ids (`${rowId}:${slot}`), every floor. */
|
|
418
|
+
declare function aisleSeatIds(doc: ChartDoc): Set<string>;
|
|
419
|
+
/** Is slot `slotIndex` of row `rowId` an aisle seat? Convenience; prefer {@link aisleSeatIds} in loops. */
|
|
420
|
+
declare function isAisleSeat(doc: ChartDoc, rowId: string, slotIndex: number): boolean;
|
|
421
|
+
/**
|
|
422
|
+
* Carry an override across a split: each half keeps the original's outer end
|
|
423
|
+
* and gains an aisle at the new cut. Without an override both halves stay
|
|
424
|
+
* automatic, which already says exactly that.
|
|
425
|
+
*/
|
|
426
|
+
declare function splitRowAisleSeats(original: RowObject, first: RowObject, second: RowObject): void;
|
|
427
|
+
/**
|
|
428
|
+
* Carry overrides across a merge (`ordered` in seat order; the survivor is
|
|
429
|
+
* `ordered[0]`): the merged row keeps the first row's start and the last
|
|
430
|
+
* row's end. The old inner ends now continue into each other.
|
|
431
|
+
*/
|
|
432
|
+
declare function mergeRowAisleSeats(ordered: readonly RowObject[], survivor: RowObject): void;
|
|
433
|
+
|
|
434
|
+
export { type Affine2D, type BuildOptions, CHAIR_NUMBERING_DIRECTIONS, CHAIR_NUMBERING_FORMATS, CHAIR_NUMBERING_START_MAX, DEFAULT_SEAT_RADIUS, type InscribedAnchor, type PerspectiveBounds, type PerspectiveCamera, type PerspectivePoint, type QueryOptions, type Rect, type RectQueryOptions, type RowAisleResolution, type SeatIndex, type SeatShape, type SectionShellMode, TEXT_BACKGROUND_PADDING_MAX, TEXT_BACKGROUND_RADIUS_MAX, TEXT_LETTER_SPACING_MAX, TEXT_LETTER_SPACING_MIN, TEXT_LINE_HEIGHT_MAX, TEXT_LINE_HEIGHT_MIN, TEXT_OPACITY_MIN, TEXT_WIDTH_MAX, TEXT_WIDTH_MIN, type TextLayoutMetrics, aisleSeatIds, applyAffine, buildAisleHoles, buildSeatIndex, buildSectionShell, chairNumberingProblem, compactChairNumbering, composeAffine, createPerspectiveCamera, cubicPoint, decomposeAffineLinear, distanceToRings, distributeAlongCubic, gridStats, hitTest, invertAffine, isAisleSeat, isRowAisleSeats, mergeRowAisleSeats, nearestWithin, perspectiveTangentAffine, polygonArea, polygonInscribedAnchor, polygonNetArea, projectPerspectivePoint, queryRect, resolveRowAisleSeats, smoothCubicThroughMiddle, splitRowAisleSeats, tableChairBookingLabel, tableChairDisplayLabel, tableChairToken, textLayoutMetrics };
|