@seatmap.pro/renderer 1.71.7 → 1.72.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/index.d.ts +1131 -871
  2. package/lib/index.js +1 -1
  3. package/package.json +5 -2
package/lib/index.d.ts CHANGED
@@ -1,847 +1,373 @@
1
1
  import KDBush from 'kdbush';
2
2
  import { Machine, Service } from 'robot3';
3
3
 
4
- /**
5
- * Base interface for seat properties.
6
- */
7
- interface IBaseSeat {
8
- /**
9
- * The unique identifier of the seat.
10
- */
11
- id: number;
12
- /**
13
- * The ID of the row this seat belongs to.
14
- */
15
- rowId: number;
16
- /**
17
- * The ID of the sector this seat belongs to.
18
- */
19
- sectorId: number;
20
- /**
21
- * The X coordinate of the seat within its section.
22
- */
23
- x: number;
24
- /**
25
- * The Y coordinate of the seat within its section.
26
- */
27
- y: number;
28
- /**
29
- * Untransformed grid X coordinate of the seat, relative to its section.
30
- * Populated on demand for a single section during block selection.
31
- */
32
- ix?: number;
33
- /**
34
- * Untransformed grid Y coordinate of the seat, relative to its section.
35
- * Populated on demand for a single section during block selection.
36
- */
37
- iy?: number;
38
- /**
39
- * The name or number of the seat.
40
- */
4
+ interface IPoint {
5
+ readonly x: number;
6
+ readonly y: number;
7
+ }
8
+
9
+ type ById$1<T> = {
10
+ [id: number]: T;
11
+ };
12
+ interface IPrice {
13
+ id: IPriceId;
41
14
  name: string;
42
- /**
43
- * Whether the seat is accessible for people with disabilities.
44
- */
45
- isAccessible?: boolean;
46
- /**
47
- * Whether the seat is marked with a special status.
48
- */
49
- isMarked?: boolean;
50
- customState?: string;
51
15
  }
52
- /**
53
- * A photo attached to a section, shown by the host page.
54
- */
55
- interface ISectionPhoto {
56
- url: string;
57
- thumbUrl?: string;
58
- caption?: string;
16
+ interface IColoredPrice extends IPrice {
17
+ color: string;
59
18
  }
60
19
  /**
61
- * Base interface for sector properties.
20
+ * @hidden
62
21
  */
63
- interface IBaseSector {
64
- /**
65
- * The unique identifier of the sector.
66
- */
67
- id: number;
68
- /**
69
- * The globally unique identifier for the sector.
70
- */
71
- guid?: string;
72
- /**
73
- * Whether this is a general admission (GA) sector.
74
- */
75
- isGa: boolean;
76
- /**
77
- * The name of the sector.
78
- */
79
- name: string;
80
- /**
81
- * The rotation angle of the sector in degrees.
82
- */
83
- angle?: number | null;
84
- /**
85
- * The type of the sector.
86
- */
87
- type?: string | null;
88
- /**
89
- * Whether the sector is disabled and cannot be interacted with.
90
- */
91
- disabled?: boolean;
92
- /**
93
- * Whether the sector is filtered out by current filter criteria.
94
- */
95
- filtered?: boolean;
96
- /**
97
- * Whether the sector is currently selected.
98
- */
99
- selected?: boolean;
100
- /**
101
- * Shape metadata for the sector (GA section shapes with text, color, etc.)
102
- */
103
- shapes?: ReadonlyArray<IShapeMetadata>;
104
- /** Label anchor X offset from section center (SEAT-624) */
105
- labelOffsetX?: number;
106
- /** Label anchor Y offset from section center (SEAT-624) */
107
- labelOffsetY?: number;
108
- /** Label style overrides (SEAT-624) */
109
- labelStyle?: ILabelStyle;
110
- /** Whether the section name label should render (SEAT-895) */
111
- labelVisible?: boolean;
112
- /** Photos attached to the section, in display order */
113
- photos?: ISectionPhoto[];
114
- }
22
+ type ColorSequenceSettings = string[][];
115
23
  /**
116
- * Label style overrides for GA section labels (SEAT-624).
24
+ * @hidden
117
25
  */
118
- interface ILabelStyle {
119
- fontScale?: number;
120
- color?: string;
121
- opacity?: number;
122
- fontWeight?: 'normal' | 'bold';
123
- background?: string;
124
- visible?: boolean;
125
- showPrice?: boolean;
126
- }
26
+ declare const sortPrices: <T extends IPrice>(prices: T[]) => T[];
127
27
  /**
128
- * Shape metadata from the API response.
28
+ * @hidden
129
29
  */
130
- interface IShapeMetadata {
131
- id?: string;
132
- text?: string;
133
- textColor?: string;
134
- textPosition?: string;
135
- fill?: string;
136
- width?: number;
137
- height?: number;
138
- top?: number;
139
- left?: number;
140
- angle?: number;
141
- order?: number;
142
- fontScale?: number;
143
- }
144
- type BrandingLevel = 'watermark' | 'interrupted';
30
+ declare const convertPricesToColored: (prices: IPrice[], colorSettings: ColorSequenceSettings) => IColoredPrice[];
145
31
  /**
146
- * Interface representing the schema data transfer object from the API.
147
32
  * @hidden
148
33
  */
149
- interface ISchemaDTO {
150
- plainSeats?: IPlainSeatsDTO;
151
- seats: ISeatDTO[];
152
- rows: IRowDTO[];
153
- sectors: ISectorDTO[];
154
- background: ISVGBackgroundDTO;
155
- requestTime?: number;
156
- responseSize?: number;
157
- configuration?: IConfigurationDTO;
158
- instanceId?: string;
159
- componentVersion?: string;
160
- branding?: BrandingLevel;
34
+ declare const convertPricesToColoredById: (prices: IPrice[], colorSettings: ColorSequenceSettings) => ById$1<IColoredPrice>;
35
+
36
+ interface IVisibilityStatus {
37
+ selectable: boolean;
38
+ visible: boolean;
161
39
  }
40
+ interface IVisibilityStatuses {
41
+ outline: IVisibilityStatus;
42
+ seat: IVisibilityStatus;
43
+ marker: IVisibilityStatus;
44
+ }
45
+
162
46
  /**
163
- * Interface representing the venue data transfer object from the API.
164
47
  * @hidden
165
48
  */
166
- interface IVenueDTO {
167
- guid: string;
168
- name: string;
169
- gaCapacity?: number;
170
- seatsCapacity?: number;
171
- seatmap: ISchemaDTO;
172
- schema: ISchemaDTO;
49
+ interface IRendererMachineContext {
50
+ mode?: string;
51
+ temporaryPan?: boolean;
52
+ viewportLocked?: boolean;
53
+ scale: number;
54
+ isEagleView: boolean;
55
+ events: DestEvent[];
56
+ hovered?: {
57
+ targetType: RendererTargetType;
58
+ id: number;
59
+ };
60
+ visibility?: IVisibilityStatuses;
61
+ enable3DView?: boolean;
62
+ rotationZ?: number;
63
+ perspectiveZ?: number;
64
+ tiltX?: number;
65
+ getWidth?: () => number;
66
+ getHeight?: () => number;
67
+ /** Zoom strategy configuration for eagle eye view interactions */
68
+ interactionZoomStrategy?: InteractionZoomStrategy;
173
69
  }
174
70
  /**
175
- * Interface representing the plain seats data transfer object from the API.
176
71
  * @hidden
177
72
  */
178
- interface IPlainSeatsDTO {
179
- ids: number[];
180
- x: number[];
181
- y: number[];
182
- rowIds: [];
183
- sectorIds: [];
184
- names: string[];
185
- }
73
+ type RendererMachineReducer<T> = (ctx: IRendererMachineContext, src: T) => IRendererMachineContext;
186
74
  /**
187
- * Untransformed grid coordinates for the seats of a single section, fetched on
188
- * demand. The arrays are aligned by index: seat `ids[i]` sits at grid cell
189
- * (`ix[i]`, `iy[i]`).
190
75
  * @hidden
191
76
  */
192
- interface ISectionGridDTO {
193
- ids: number[];
194
- ix: number[];
195
- iy: number[];
196
- }
77
+ type RendererMachine = Machine<any, IRendererMachineContext, any>;
197
78
  /**
198
- * Interface representing the base seat data transfer object from the API.
199
- * Contains the core properties of a seat as received from the backend.
200
79
  * @hidden
201
80
  */
202
- type ISeatDTO = IBaseSeat;
81
+ type RendererMachineService = Service<RendererMachine>;
203
82
  /**
204
- * Interface representing a row in the venue.
205
83
  * @hidden
206
84
  */
207
- interface IRowDTO {
208
- id: number;
209
- rowNumber: number;
210
- sectorId: number;
211
- name: string;
212
- seatName: string;
85
+ declare enum RendererTargetType {
86
+ SEAT = "seat",
87
+ SECTION = "section"
213
88
  }
214
89
  /**
215
- * Interface representing the base sector data transfer object from the API.
216
- * Contains the core properties of a sector as received from the backend.
217
90
  * @hidden
218
91
  */
219
- type ISectorDTO = Omit<IBaseSector, 'labelStyle'> & {
220
- /**
221
- * Label style overrides as sent by the API: a JSON string (SEAT-624 wire format).
222
- * Normalize with `withParsedLabelStyle` before putting a sector into the renderer
223
- * context, which types it as the parsed {@link ILabelStyle} object (SEAT-1069).
224
- */
225
- labelStyle?: string | ILabelStyle;
226
- };
92
+ declare enum RendererSelectMode {
93
+ REPLACE = "replace",
94
+ ADD = "add",
95
+ SUBTRACT = "subtract"
96
+ }
97
+ /**
98
+ * Source events
99
+ */
227
100
  /**
228
- * Interface representing the SVG background data transfer object from the API.
229
101
  * @hidden
230
102
  */
231
- interface ISVGBackgroundDTO {
232
- svg?: Nullable<string>;
233
- viewBox: {
103
+ declare enum SrcEventType {
104
+ DRAG_START = "srcDragStart",
105
+ DRAG_MOVE = "srcDragMove",
106
+ DRAG_END = "srcDragEnd",
107
+ CLICK = "srcClick",
108
+ MOUSE_MOVE = "srcMouseMove"
109
+ }
110
+ /**
111
+ * @hidden
112
+ */
113
+ type SrcEvent = IDragStartSrcEvent | IDragMoveSrcEvent | IDragEndSrcEvent | IClickSrcEvent | IMouseMoveSrcEvent;
114
+ /**
115
+ * @hidden
116
+ */
117
+ interface IDragSrcEvent<T> {
118
+ type: T;
119
+ origin: {
234
120
  x: number;
235
121
  y: number;
236
- width: number;
237
- height: number;
238
122
  };
239
- svgLink?: string;
240
- images?: IPngBackgroundDTO;
241
- outlineSvg?: Nullable<string>;
123
+ delta: {
124
+ x: number;
125
+ y: number;
126
+ };
127
+ shiftKey?: boolean;
128
+ altKey?: boolean;
129
+ metaKey?: boolean;
242
130
  }
243
131
  /**
244
- * Interface representing the configuration data transfer object from the API.
245
132
  * @hidden
246
133
  */
247
- interface IConfigurationDTO {
248
- accessible: number[];
249
- marked: number[];
250
- eventName?: string;
251
- }
134
+ type IDragStartSrcEvent = IDragSrcEvent<SrcEventType.DRAG_START>;
252
135
  /**
253
- * Interface representing a special price option for seats, sections, or sectors.
254
- * Contains information about a named price point with its identifier.
136
+ * @hidden
255
137
  */
256
- interface ISpecialPrice {
257
- /**
258
- * The name or label of the special price option.
259
- */
260
- name: string;
261
- /**
262
- * The unique identifier for this price option.
263
- */
264
- priceId: number;
265
- }
138
+ type IDragMoveSrcEvent = IDragSrcEvent<SrcEventType.DRAG_MOVE>;
266
139
  /**
267
- * Interface representing special state information for seats, sections, or sectors.
268
- * Contains additional properties that affect rendering or behavior.
140
+ * @hidden
269
141
  */
270
- interface ISpecialState {
271
- /**
272
- * Special state flag 1, used for custom state indicators.
273
- */
274
- s1?: number;
275
- /**
276
- * Array of special prices associated with this item.
277
- */
278
- prices?: ISpecialPrice[];
279
- /**
280
- * Category identifier for grouping items with similar special states.
281
- */
282
- category?: number;
283
- }
142
+ type IDragEndSrcEvent = IDragSrcEvent<SrcEventType.DRAG_END>;
284
143
  /**
285
- * Interface representing a price list data transfer object from the API.
286
144
  * @hidden
287
145
  */
288
- interface IPriceListDTO {
289
- seats: [number, IPriceId, ISpecialState?][];
290
- groupOfSeats: [number, number, number, ISpecialState?][];
291
- prices: IPriceDTO[];
292
- requestTime?: number;
293
- responseSize?: number;
146
+ interface IClickSrcEvent {
147
+ type: SrcEventType.CLICK;
148
+ target: HTMLElement;
149
+ point: {
150
+ x: number;
151
+ y: number;
152
+ };
153
+ section?: ISection;
154
+ seat?: ISeat;
155
+ shiftKey?: boolean;
156
+ altKey?: boolean;
157
+ metaKey?: boolean;
294
158
  }
295
159
  /**
296
- * Interface representing the price assignments of an event, regardless of seat availability.
297
- *
298
- * Seats are addressed by position in `seatIds`, which is ascending and delta encoded: the
299
- * first element is an absolute seat id and each later element is the increment from the one
300
- * before it. `seatPriceRuns` holds `[priceId, count]` pairs covering those seats in sequence,
301
- * and `seatPropertyIndexes` names the positions of the few seats carrying properties, whose
302
- * values are in `seatProperties`.
303
160
  * @hidden
304
161
  */
305
- interface IAssignmentListDTO {
306
- version?: string;
307
- seatIds: number[];
308
- seatPriceRuns: [IPriceId, number][];
309
- seatPropertyIndexes: number[];
310
- seatProperties: ISpecialState[];
311
- groupOfSeats: [number, number, ISpecialState?][];
312
- prices: IPriceDTO[];
313
- requestTime?: number;
314
- responseSize?: number;
162
+ interface IMouseMoveSrcEvent {
163
+ type: SrcEventType.MOUSE_MOVE;
164
+ target: HTMLElement;
165
+ section?: ISection;
166
+ seat?: ISeat;
315
167
  }
316
168
  /**
317
- * Interface representing the availability of an event, which changes on every lock, unlock and sale.
318
- *
319
- * `unavailableSeats` is delta encoded, so the first element is an absolute seat id and each
320
- * later element is the increment from the one before it.
169
+ * Output events
170
+ */
171
+ /**
321
172
  * @hidden
322
173
  */
323
- interface IAvailabilityDTO {
324
- version?: string;
325
- unavailableSeats: number[];
326
- groupOfSeats: [number, number, number][];
327
- requestTime?: number;
328
- responseSize?: number;
174
+ declare enum DestEventType {
175
+ PAN = "destPan",
176
+ RECT_SELECT = "destRectSelect",
177
+ DESELECT = "destDeselect",
178
+ PAN_ZOOM = "destPanZoom",
179
+ SEAT_SELECT = "destSeatSelect",
180
+ SEAT_CART_SWITCH = "destSeatCartSwitch",
181
+ SECTION_CLICK = "destSectionClick",
182
+ SEAT_MOUSE_ENTER = "destSeatMouseEnter",
183
+ SECTION_MOUSE_ENTER = "destSectionMouseEnter",
184
+ SEAT_MOUSE_LEAVE = "destSeatMouseLeave",
185
+ SECTION_MOUSE_LEAVE = "destSectionMouseLeave"
329
186
  }
330
- declare const emptyPriceList: () => IPriceListDTO;
331
187
  /**
332
- * Interface representing a price data transfer object from the API.
333
188
  * @hidden
334
189
  */
335
- interface IPriceDTO {
336
- id: IPriceId;
337
- name: string;
190
+ type DestEvent = IPanDestEvent | IRectSelectDestEvent | IPanZoomDestEvent | IDeselectDestEvent | ISeatSelectDestEvent | ISeatCartSwitchDestEvent | ISectionClickDestEvent | ISeatMouseEnterDestEvent | ISectionMouseEnterDestEvent | ISeatMouseLeaveDestEvent | ISectionMouseLeaveDestEvent;
191
+ /**
192
+ * @hidden
193
+ */
194
+ interface IPanDestEvent {
195
+ type: DestEventType.PAN;
196
+ isStart?: boolean;
197
+ isFinish?: boolean;
198
+ delta: {
199
+ x: number;
200
+ y: number;
201
+ };
338
202
  }
339
203
  /**
340
- * Type representing blurred image data.
341
204
  * @hidden
342
205
  */
343
- type IBlurred = {
344
- data: string;
345
- shrink_factor: number;
346
- size: number;
347
- status: string;
348
- };
206
+ interface IRectSelectDestEvent {
207
+ type: DestEventType.RECT_SELECT;
208
+ selectMode: RendererSelectMode;
209
+ isStart?: boolean;
210
+ isFinish?: boolean;
211
+ isRowsMode?: boolean;
212
+ isSectionsMode?: boolean;
213
+ isMixedMode?: boolean;
214
+ rect: {
215
+ x: number;
216
+ y: number;
217
+ width: number;
218
+ height: number;
219
+ };
220
+ }
349
221
  /**
350
- * Type representing a PNG image loaded from a URL.
222
+ * Pan-zoom destination event.
223
+ * Triggered when clicking in eagle eye view to zoom into the venue.
351
224
  * @hidden
352
225
  */
353
- type IPngFromUrl = {
354
- height: number;
355
- size: number;
356
- width: number;
357
- path: string;
358
- status: string;
359
- };
226
+ interface IPanZoomDestEvent {
227
+ type: DestEventType.PAN_ZOOM;
228
+ /** Target zoom scale */
229
+ scale: number;
230
+ /** Origin point in viewport coordinates */
231
+ origin?: {
232
+ x: number;
233
+ y: number;
234
+ };
235
+ /** Section at the clicked point, if any */
236
+ section?: ISection;
237
+ /** Zoom strategy to apply */
238
+ strategy?: InteractionZoomStrategy;
239
+ }
360
240
  /**
361
- * Type representing the tile grid sliced from the full-size background.
362
241
  * @hidden
363
242
  */
364
- type ITileGrid = {
365
- size: number;
366
- cols: number;
367
- rows: number;
368
- width: number;
369
- height: number;
370
- path: string;
371
- status: string;
372
- };
243
+ interface ISeatMouseEnterDestEvent {
244
+ type: DestEventType.SEAT_MOUSE_ENTER;
245
+ isRowsMode?: boolean;
246
+ seat: ISeat;
247
+ }
373
248
  /**
374
- * Interface representing PNG background images in different resolutions.
375
249
  * @hidden
376
250
  */
377
- interface IPngBackgroundDTO {
378
- blurred: IBlurred;
379
- preview: IPngFromUrl;
380
- full: IPngFromUrl;
381
- tiles?: ITileGrid;
382
- lods?: IPngFromUrl[];
251
+ interface ISectionMouseEnterDestEvent {
252
+ type: DestEventType.SECTION_MOUSE_ENTER;
253
+ section: ISection;
383
254
  }
384
-
385
255
  /**
386
- * Settings for the BookingApiClient.
387
256
  * @hidden
388
257
  */
389
- interface IBookingApiClientSettings {
390
- baseUrl: string;
391
- publicKey: string;
392
- debug?: boolean;
393
- forceSvg?: boolean;
394
- requestTimeoutMs?: number;
258
+ interface ISeatMouseLeaveDestEvent {
259
+ type: DestEventType.SEAT_MOUSE_LEAVE;
395
260
  }
396
261
  /**
397
- * Metrics for API requests.
398
262
  * @hidden
399
263
  */
400
- interface RequestMetrics {
401
- data?: string;
402
- requestTime: number;
403
- responseSize: number;
264
+ interface ISectionMouseLeaveDestEvent {
265
+ type: DestEventType.SECTION_MOUSE_LEAVE;
404
266
  }
405
267
  /**
406
- * Error thrown when the booking API returns a non-2xx response.
407
- * Preserves the HTTP status and the backend error code (e.g. EVENT_ARCHIVED, EVENT_NOT_PUBLISHED).
268
+ * @hidden
408
269
  */
409
- declare class ApiError extends Error {
410
- readonly status: number;
411
- readonly errorCode: string | undefined;
412
- constructor(status: number, statusText: string, errorCode?: string);
270
+ interface IDeselectDestEvent {
271
+ type: DestEventType.DESELECT;
413
272
  }
414
273
  /**
415
- * API client for fetching schema and price data from the booking API.
416
274
  * @hidden
417
275
  */
418
- declare class BookingApiClient {
419
- private settings;
420
- private splitPricingUnsupported;
421
- constructor(settings: IBookingApiClientSettings);
422
- /**
423
- * Returns schema data
424
- * @param schemaId Schema ID
425
- */
426
- fetchSchema(schemaId: number): Promise<ISchemaDTO>;
427
- /**
428
- * Returns schema data
429
- * @param venueId Venue GUID
430
- */
431
- fetchSchemaForVenue(venueId: string): Promise<Omit<IVenueDTO, 'seatmap'>>;
432
- /**
433
- * Returns schema data
434
- * @param eventId Event GUID
435
- */
436
- fetchSchemaForEvent(eventId: string): Promise<ISchemaDTO>;
437
- /**
438
- * Returns the untransformed grid coordinates for a single section of an event's schema.
439
- * @param eventId Event GUID
440
- * @param sectorId Section (sector) id
441
- */
442
- fetchSectionGridForEvent(eventId: string, sectorId: number): Promise<ISectionGridDTO>;
443
- /**
444
- * Returns the untransformed grid coordinates for a single section of a schema.
445
- * @param schemaId Schema id
446
- * @param sectorId Section (sector) id
447
- */
448
- fetchSectionGridForSchema(schemaId: number, sectorId: number): Promise<ISectionGridDTO>;
449
- private unpackSchemaDTO;
450
- /**
451
- * Return prices information
452
- * @param eventId Event GUID
453
- */
454
- fetchPricesForEvent(eventId: string): Promise<IPriceListDTO>;
455
- private fetchSplitPricesForEvent;
456
- /**
457
- * Return rows SVG information
458
- * @param eventId Event GUID
459
- */
460
- fetchRowsSvgForEvent(eventId: string): Promise<RequestMetrics>;
461
- /**
462
- * Makes request to booking API
463
- * @param url Relative API endpoint URL, e.g. 'event/prices/?id=XXX'
464
- */
465
- request<T>(url: string, options?: {
466
- baseUrl?: string;
467
- silent?: boolean;
468
- }): Promise<T>;
469
- /**
470
- * Makes request to booking API
471
- * @param url Relative API endpoint URL, e.g. 'event/prices/?id=XXX'
472
- */
473
- requestPlain<T extends RequestMetrics>(url: string): Promise<T>;
474
- private restoreIds;
475
- }
476
-
477
- declare function preconnectToApi(baseUrl: string): void;
478
-
479
- interface IPoint {
480
- readonly x: number;
481
- readonly y: number;
482
- }
483
-
484
- type ById$1<T> = {
485
- [id: number]: T;
486
- };
487
- interface IPrice {
488
- id: IPriceId;
489
- name: string;
490
- }
491
- interface IColoredPrice extends IPrice {
492
- color: string;
493
- }
494
- /**
495
- * @hidden
496
- */
497
- type ColorSequenceSettings = string[][];
498
- /**
499
- * @hidden
500
- */
501
- declare const sortPrices: <T extends IPrice>(prices: T[]) => T[];
502
- /**
503
- * @hidden
504
- */
505
- declare const convertPricesToColored: (prices: IPrice[], colorSettings: ColorSequenceSettings) => IColoredPrice[];
506
- /**
507
- * @hidden
508
- */
509
- declare const convertPricesToColoredById: (prices: IPrice[], colorSettings: ColorSequenceSettings) => ById$1<IColoredPrice>;
510
-
511
- interface IVisibilityStatus {
512
- selectable: boolean;
513
- visible: boolean;
514
- }
515
- interface IVisibilityStatuses {
516
- outline: IVisibilityStatus;
517
- seat: IVisibilityStatus;
518
- marker: IVisibilityStatus;
276
+ interface ISeatSelectDestEvent {
277
+ type: DestEventType.SEAT_SELECT;
278
+ selectMode: RendererSelectMode;
279
+ point: {
280
+ x: number;
281
+ y: number;
282
+ };
283
+ seat: ISeat;
284
+ isRowsMode?: boolean;
519
285
  }
520
-
521
286
  /**
522
287
  * @hidden
523
288
  */
524
- interface IRendererMachineContext {
525
- mode?: string;
526
- temporaryPan?: boolean;
527
- viewportLocked?: boolean;
528
- scale: number;
529
- isEagleView: boolean;
530
- events: DestEvent[];
531
- hovered?: {
532
- targetType: RendererTargetType;
533
- id: number;
289
+ interface ISeatCartSwitchDestEvent {
290
+ type: DestEventType.SEAT_CART_SWITCH;
291
+ point: {
292
+ x: number;
293
+ y: number;
534
294
  };
535
- visibility?: IVisibilityStatuses;
536
- enable3DView?: boolean;
537
- rotationZ?: number;
538
- perspectiveZ?: number;
539
- tiltX?: number;
540
- getWidth?: () => number;
541
- getHeight?: () => number;
542
- /** Zoom strategy configuration for eagle eye view interactions */
543
- interactionZoomStrategy?: InteractionZoomStrategy;
295
+ seat: ISeat;
544
296
  }
545
297
  /**
546
298
  * @hidden
547
299
  */
548
- type RendererMachineReducer<T> = (ctx: IRendererMachineContext, src: T) => IRendererMachineContext;
549
- /**
550
- * @hidden
551
- */
552
- type RendererMachine = Machine<any, IRendererMachineContext, any>;
553
- /**
554
- * @hidden
555
- */
556
- type RendererMachineService = Service<RendererMachine>;
557
- /**
558
- * @hidden
559
- */
560
- declare enum RendererTargetType {
561
- SEAT = "seat",
562
- SECTION = "section"
300
+ interface ISectionClickDestEvent {
301
+ type: DestEventType.SECTION_CLICK;
302
+ point: {
303
+ x: number;
304
+ y: number;
305
+ };
306
+ section: ISection;
307
+ isSectionsMode?: boolean;
563
308
  }
564
- /**
565
- * @hidden
566
- */
567
- declare enum RendererSelectMode {
568
- REPLACE = "replace",
569
- ADD = "add",
570
- SUBTRACT = "subtract"
309
+
310
+ type GpuTier = 'high' | 'constrained';
311
+ interface GpuProbeResult {
312
+ renderer: string;
313
+ maxTextureSize: number;
314
+ deviceMemory: number | undefined;
315
+ /** Texture upload throughput benchmark score (ms). Lower = faster GPU. -1 if benchmark failed. */
316
+ benchmarkMs: number;
571
317
  }
572
- /**
573
- * Source events
574
- */
575
- /**
576
- * @hidden
577
- */
578
- declare enum SrcEventType {
579
- DRAG_START = "srcDragStart",
580
- DRAG_MOVE = "srcDragMove",
581
- DRAG_END = "srcDragEnd",
582
- CLICK = "srcClick",
583
- MOUSE_MOVE = "srcMouseMove"
318
+ interface DeviceCapabilities {
319
+ tier: GpuTier;
320
+ maxCanvasDimension: number;
321
+ gpu: GpuProbeResult | null;
584
322
  }
323
+
585
324
  /**
325
+ * Label positioning and style data for a section outline (GA, seated, or background-bound).
586
326
  * @hidden
587
327
  */
588
- type SrcEvent = IDragStartSrcEvent | IDragMoveSrcEvent | IDragEndSrcEvent | IClickSrcEvent | IMouseMoveSrcEvent;
589
- /**
590
- * @hidden
591
- */
592
- interface IDragSrcEvent<T> {
593
- type: T;
594
- origin: {
328
+ interface ISectionLabelInfo {
329
+ id: number;
330
+ name: string;
331
+ transform: TransformArray;
332
+ isTable?: boolean;
333
+ textColor?: string;
334
+ /** Relative offset from section center for label positioning (SEAT-624) */
335
+ labelOffset?: {
595
336
  x: number;
596
337
  y: number;
597
338
  };
598
- delta: {
599
- x: number;
600
- y: number;
339
+ /** Style overrides for the label (SEAT-624) */
340
+ labelStyle?: {
341
+ fontScale?: number;
342
+ color?: string;
343
+ opacity?: number;
344
+ fontWeight?: 'normal' | 'bold';
345
+ background?: string;
346
+ visible?: boolean;
347
+ showPrice?: boolean;
601
348
  };
602
- shiftKey?: boolean;
603
- altKey?: boolean;
604
- metaKey?: boolean;
349
+ /** When true, label is centered on shape centroid (no vertical shift above seats) */
350
+ centroid?: boolean;
351
+ hideText?: boolean;
352
+ hasPrice?: boolean;
353
+ fontScale?: number;
605
354
  }
606
355
  /**
607
356
  * @hidden
608
357
  */
609
- type IDragStartSrcEvent = IDragSrcEvent<SrcEventType.DRAG_START>;
610
- /**
611
- * @hidden
612
- */
613
- type IDragMoveSrcEvent = IDragSrcEvent<SrcEventType.DRAG_MOVE>;
614
- /**
615
- * @hidden
616
- */
617
- type IDragEndSrcEvent = IDragSrcEvent<SrcEventType.DRAG_END>;
618
- /**
619
- * @hidden
620
- */
621
- interface IClickSrcEvent {
622
- type: SrcEventType.CLICK;
623
- target: HTMLElement;
624
- point: {
625
- x: number;
626
- y: number;
627
- };
628
- section?: ISection;
629
- seat?: ISeat;
630
- shiftKey?: boolean;
631
- altKey?: boolean;
632
- metaKey?: boolean;
633
- }
634
- /**
635
- * @hidden
636
- */
637
- interface IMouseMoveSrcEvent {
638
- type: SrcEventType.MOUSE_MOVE;
639
- target: HTMLElement;
640
- section?: ISection;
641
- seat?: ISeat;
642
- }
643
- /**
644
- * Output events
645
- */
646
- /**
647
- * @hidden
648
- */
649
- declare enum DestEventType {
650
- PAN = "destPan",
651
- RECT_SELECT = "destRectSelect",
652
- DESELECT = "destDeselect",
653
- PAN_ZOOM = "destPanZoom",
654
- SEAT_SELECT = "destSeatSelect",
655
- SEAT_CART_SWITCH = "destSeatCartSwitch",
656
- SECTION_CLICK = "destSectionClick",
657
- SEAT_MOUSE_ENTER = "destSeatMouseEnter",
658
- SECTION_MOUSE_ENTER = "destSectionMouseEnter",
659
- SEAT_MOUSE_LEAVE = "destSeatMouseLeave",
660
- SECTION_MOUSE_LEAVE = "destSectionMouseLeave"
661
- }
662
- /**
663
- * @hidden
664
- */
665
- type DestEvent = IPanDestEvent | IRectSelectDestEvent | IPanZoomDestEvent | IDeselectDestEvent | ISeatSelectDestEvent | ISeatCartSwitchDestEvent | ISectionClickDestEvent | ISeatMouseEnterDestEvent | ISectionMouseEnterDestEvent | ISeatMouseLeaveDestEvent | ISectionMouseLeaveDestEvent;
666
- /**
667
- * @hidden
668
- */
669
- interface IPanDestEvent {
670
- type: DestEventType.PAN;
671
- isStart?: boolean;
672
- isFinish?: boolean;
673
- delta: {
674
- x: number;
675
- y: number;
676
- };
677
- }
678
- /**
679
- * @hidden
680
- */
681
- interface IRectSelectDestEvent {
682
- type: DestEventType.RECT_SELECT;
683
- selectMode: RendererSelectMode;
684
- isStart?: boolean;
685
- isFinish?: boolean;
686
- isRowsMode?: boolean;
687
- isSectionsMode?: boolean;
688
- rect: {
689
- x: number;
690
- y: number;
691
- width: number;
692
- height: number;
693
- };
694
- }
695
- /**
696
- * Pan-zoom destination event.
697
- * Triggered when clicking in eagle eye view to zoom into the venue.
698
- * @hidden
699
- */
700
- interface IPanZoomDestEvent {
701
- type: DestEventType.PAN_ZOOM;
702
- /** Target zoom scale */
703
- scale: number;
704
- /** Origin point in viewport coordinates */
705
- origin?: {
706
- x: number;
707
- y: number;
708
- };
709
- /** Section at the clicked point, if any */
710
- section?: ISection;
711
- /** Zoom strategy to apply */
712
- strategy?: InteractionZoomStrategy;
713
- }
714
- /**
715
- * @hidden
716
- */
717
- interface ISeatMouseEnterDestEvent {
718
- type: DestEventType.SEAT_MOUSE_ENTER;
719
- isRowsMode?: boolean;
720
- seat: ISeat;
721
- }
722
- /**
723
- * @hidden
724
- */
725
- interface ISectionMouseEnterDestEvent {
726
- type: DestEventType.SECTION_MOUSE_ENTER;
727
- section: ISection;
728
- }
729
- /**
730
- * @hidden
731
- */
732
- interface ISeatMouseLeaveDestEvent {
733
- type: DestEventType.SEAT_MOUSE_LEAVE;
734
- }
735
- /**
736
- * @hidden
737
- */
738
- interface ISectionMouseLeaveDestEvent {
739
- type: DestEventType.SECTION_MOUSE_LEAVE;
740
- }
741
- /**
742
- * @hidden
743
- */
744
- interface IDeselectDestEvent {
745
- type: DestEventType.DESELECT;
746
- }
747
- /**
748
- * @hidden
749
- */
750
- interface ISeatSelectDestEvent {
751
- type: DestEventType.SEAT_SELECT;
752
- selectMode: RendererSelectMode;
753
- point: {
754
- x: number;
755
- y: number;
756
- };
757
- seat: ISeat;
758
- isRowsMode?: boolean;
759
- }
760
- /**
761
- * @hidden
762
- */
763
- interface ISeatCartSwitchDestEvent {
764
- type: DestEventType.SEAT_CART_SWITCH;
765
- point: {
766
- x: number;
767
- y: number;
768
- };
769
- seat: ISeat;
770
- }
771
- /**
772
- * @hidden
773
- */
774
- interface ISectionClickDestEvent {
775
- type: DestEventType.SECTION_CLICK;
776
- point: {
777
- x: number;
778
- y: number;
779
- };
780
- section: ISection;
781
- isSectionsMode?: boolean;
782
- }
783
-
784
- type GpuTier = 'high' | 'constrained';
785
- interface GpuProbeResult {
786
- renderer: string;
787
- maxTextureSize: number;
788
- deviceMemory: number | undefined;
789
- /** Texture upload throughput benchmark score (ms). Lower = faster GPU. -1 if benchmark failed. */
790
- benchmarkMs: number;
791
- }
792
- interface DeviceCapabilities {
793
- tier: GpuTier;
794
- maxCanvasDimension: number;
795
- gpu: GpuProbeResult | null;
796
- }
797
-
798
- /**
799
- * Label positioning and style data for a section outline (GA, seated, or background-bound).
800
- * @hidden
801
- */
802
- interface ISectionLabelInfo {
803
- id: number;
804
- name: string;
805
- transform: TransformArray;
806
- isTable?: boolean;
807
- textColor?: string;
808
- /** Relative offset from section center for label positioning (SEAT-624) */
809
- labelOffset?: {
810
- x: number;
811
- y: number;
812
- };
813
- /** Style overrides for the label (SEAT-624) */
814
- labelStyle?: {
815
- fontScale?: number;
816
- color?: string;
817
- opacity?: number;
818
- fontWeight?: 'normal' | 'bold';
819
- background?: string;
820
- visible?: boolean;
821
- showPrice?: boolean;
822
- };
823
- /** When true, label is centered on shape centroid (no vertical shift above seats) */
824
- centroid?: boolean;
825
- hideText?: boolean;
826
- hasPrice?: boolean;
827
- fontScale?: number;
828
- }
829
- /**
830
- * @hidden
831
- */
832
- declare class Context {
833
- private redrawHandler;
834
- element: HTMLElement;
835
- settings: IRendererSettings;
836
- seatImages: {
837
- [id: string]: HTMLImageElement;
358
+ declare class Context {
359
+ private redrawHandler;
360
+ element: HTMLElement;
361
+ settings: IRendererSettings;
362
+ seatImages: {
363
+ [id: string]: HTMLImageElement;
838
364
  };
839
365
  cart: ICart;
840
366
  gaCategories: {
841
- [id: number]: number;
367
+ [id: number]: number | string;
842
368
  };
843
369
  categoriesColor: {
844
- [id: number]: string | undefined;
370
+ [key: string]: string | undefined;
845
371
  };
846
372
  scale: number;
847
373
  translate: IPoint;
@@ -874,6 +400,8 @@ declare class Context {
874
400
  rowsById: ById<IRowDTO>;
875
401
  sectionsById: ById<ISector>;
876
402
  pricesById: ById<IColoredPrice>;
403
+ private priceByAmount;
404
+ private priceByAmountSource?;
877
405
  seatsKeysMissedOnPriceSet: string[];
878
406
  seatsIdsMissedOnPriceSet: number[];
879
407
  rowsPolylines?: Array<{
@@ -932,7 +460,7 @@ declare class Context {
932
460
  getPricesDTO(): IPriceListDTO;
933
461
  setHovered(seat: ISeat | undefined, isRowsMode?: boolean): void;
934
462
  private createSeatImages;
935
- initCart(cart: ICart): void;
463
+ initCart(cart: ICart): ICartChangeResult;
936
464
  get seats(): ISeat[];
937
465
  set seats(value: ISeat[]);
938
466
  rangeSeats(x1: number, y1: number, x2: number, y2: number): ISeat[];
@@ -946,16 +474,19 @@ declare class Context {
946
474
  /**
947
475
  * Clears the cart and records deselection timestamps for all seats.
948
476
  */
949
- clearCart(): void;
477
+ clearCart(): ICartChangeResult;
478
+ clearSeatVisualState(seatId: number): void;
479
+ private releaseSeatFromCart;
480
+ private pruneDeselectionTimestamps;
950
481
  /**
951
482
  * Removes seats from the cart by internal seat IDs and records deselection times.
952
483
  */
953
- removeSeatsFromCartByIds(ids: number[]): void;
484
+ removeSeatsFromCartByIds(ids: number[]): ICartChangeResult;
954
485
  /**
955
486
  * Triggers a selection pulse animation for a seat and clears any pending deselection.
956
487
  */
957
488
  triggerSeatSelectionPulse(seatId: number): void;
958
- addSeatsToCart(seats: ICartSeat[]): void;
489
+ addSeatsToCart(seats: ICartSeat[]): ICartChangeResult;
959
490
  rectSelectSeats(rect: {
960
491
  x: number;
961
492
  y: number;
@@ -972,6 +503,31 @@ declare class Context {
972
503
  repairSeat: (s: ICartSeat) => ICartSeat | undefined;
973
504
  private uniquePriceForAmount;
974
505
  afterCartUpdate: () => void;
506
+ onOrphanGroupsChange?: (groups: {
507
+ seats: ISeat[];
508
+ hovered: boolean;
509
+ }[]) => void;
510
+ private orphanGroupsByRow;
511
+ private orphanCartRowIds;
512
+ private orphanSweepToken;
513
+ private orphanSweepInFlight;
514
+ private orphanOutlinesShown;
515
+ venuePitch: number | undefined;
516
+ private orphanPitchCache;
517
+ private orphanPitchComputed;
518
+ invalidateOrphanPitch(): void;
519
+ get orphanPitch(): number | undefined;
520
+ private static readonly ORPHAN_SWEEP_CHUNK_WORK;
521
+ private get orphanGroupsEnabled();
522
+ private idsOf;
523
+ cartSeatIds(): number[];
524
+ private recomputeOrphanRows;
525
+ private recomputeOrphanRow;
526
+ private orphanSweepWork;
527
+ private sweepOrphanRowsInChunks;
528
+ private hoveredGroup;
529
+ emitOrphanGroups: () => void;
530
+ refreshOrphanGroups: (onlyRowIds?: readonly number[]) => void;
975
531
  repairGa: (ga: ICartGa) => ICartGa | undefined;
976
532
  private getSectionByName;
977
533
  private getRowBySectionAndNumber;
@@ -982,8 +538,10 @@ declare class Context {
982
538
  isSectionSelected(sectorId: number): boolean;
983
539
  addSeatToCart(seatId: number): void;
984
540
  removeSeatFromCart(seatId: number): void;
541
+ private rowIdsOf;
985
542
  getCartSeats(): ISeat[];
986
543
  getSeatSelection(): ISeat[];
544
+ resolveSectionIds(sections: ISector[] | number[] | string[]): number[];
987
545
  /**
988
546
  * Replaces the current section selection. Unknown ids/names are skipped.
989
547
  * Returns the resolved section ids that are now selected.
@@ -1065,6 +623,11 @@ interface ISeat extends IBaseSeat {
1065
623
  * Special state information for the seat.
1066
624
  */
1067
625
  special?: ISpecialState;
626
+ /**
627
+ * Renderer-local category key, set when a category is assigned by name rather
628
+ * than by number. Never sent to the server.
629
+ */
630
+ categoryKey?: string;
1068
631
  /**
1069
632
  * The state of the seat.
1070
633
  */
@@ -1741,10 +1304,19 @@ interface IRendererSettings {
1741
1304
  */
1742
1305
  padding?: number;
1743
1306
  /**
1744
- * Minimum zoom level required to enable seat selection.
1307
+ * Scale below which the renderer is in eagle (helicopter) view: the whole
1308
+ * venue is in frame, section outlines carry the navigation, and outlines
1309
+ * configured as `outlineVisibility: 'eagle-only'` are shown.
1745
1310
  *
1746
- * @deprecated
1747
- * Use visibilitySettings instead
1311
+ * Seat selection is not gated by this value. Use
1312
+ * `visibilitySettings.seats.selectable` for that.
1313
+ *
1314
+ * Defaults to 0.5 in the booking renderer and 0.66 in the admin renderer.
1315
+ */
1316
+ eagleViewMaxZoom?: number;
1317
+ /**
1318
+ * @deprecated Renamed to `eagleViewMaxZoom`, which is what this value has
1319
+ * always set. Still honoured when `eagleViewMaxZoom` is absent.
1748
1320
  */
1749
1321
  seatSelectionMinZoom?: number;
1750
1322
  /**
@@ -1802,13 +1374,32 @@ interface IRendererSettings {
1802
1374
  */
1803
1375
  disableCartInteractions?: boolean;
1804
1376
  /**
1377
+ * If true, outlines bound to the background svg are shown only in helicopter
1378
+ * (eagle) view and hidden once the map is zoomed past `eagleViewMaxZoom`.
1805
1379
  *
1380
+ * @deprecated Use `outlineVisibility: { svg: 'eagle-only' }` instead, which
1381
+ * covers every outline source. An explicit `outlineVisibility.svg` wins over
1382
+ * this flag.
1806
1383
  */
1807
1384
  disableOutlinesInHelicopterView?: boolean;
1808
1385
  /**
1809
1386
  * If true, hides all seats from view.
1810
1387
  */
1811
1388
  hideSeats?: boolean;
1389
+ /**
1390
+ * If true, rejects cart changes that would strand a single available seat
1391
+ * between taken ones.
1392
+ *
1393
+ * @remarks
1394
+ *
1395
+ * When left unset, the renderer takes the value from the event payload on
1396
+ * every `loadEvent`, and defaults to on when the payload carries no value.
1397
+ * Setting it explicitly overrides the payload for the lifetime of the
1398
+ * renderer, for buyer-facing guidance only: the `lock` and `sale` endpoints
1399
+ * apply the configured value either way, so turning it off here can surface
1400
+ * a refusal at checkout instead.
1401
+ */
1402
+ orphanPrevention?: boolean;
1812
1403
  /**
1813
1404
  * If true, shows the outline layer during animations.
1814
1405
  */
@@ -1939,6 +1530,11 @@ interface IRendererSettings {
1939
1530
  * Seat is passed as a param to the handler (see IExtendedSeat).
1940
1531
  *
1941
1532
  * To cancel seat selection you can return `false` or Promise resolving to `false`.
1533
+ *
1534
+ * Also fires for every companion seat an accepted orphan prevention
1535
+ * adjustment selects; returning `false` for any of them cancels the whole
1536
+ * change, and `onSeatDeselect` is called for the seats already confirmed.
1537
+ * Does not fire on the `groupSize` path, which never reports single seats.
1942
1538
  */
1943
1539
  onSeatSelect?: (seat: IExtendedSeat) => void | boolean | Promise<void | boolean>;
1944
1540
  /**
@@ -1949,8 +1545,66 @@ interface IRendererSettings {
1949
1545
  * Seat is passed as a param to the handler (see IExtendedSeat).
1950
1546
  *
1951
1547
  * To cancel seat deselection you can return `false` or Promise resolving to `false`.
1548
+ *
1549
+ * Also fires for every companion seat an accepted orphan prevention
1550
+ * adjustment releases; returning `false` for any of them cancels the whole
1551
+ * change, and `onSeatSelect` is called for the seats already confirmed.
1552
+ * Does not fire on the `groupSize` path, which never reports single seats.
1952
1553
  */
1953
1554
  onSeatDeselect?: (seat: IExtendedSeat) => void | boolean | Promise<void | boolean>;
1555
+ /**
1556
+ * Fires when orphan prevention rejects a cart change, to decide what happens next.
1557
+ *
1558
+ * @remarks
1559
+ *
1560
+ * Event details are passed as a param to the handler (see IOrphanSeatsBlockedEvent).
1561
+ *
1562
+ * Without a handler a blocked selection is completed with the suggested remedy, so the
1563
+ * buyer ends up with a selection the rule accepts. A blocked deselection is refused
1564
+ * rather than releasing further seats the buyer already holds, and so is a blocked click
1565
+ * under a `groupSize` above one, which the remedy would push past the group. A change the
1566
+ * rule cannot repair is refused on every path.
1567
+ *
1568
+ * Return `false` or a Promise resolving to `false` to refuse the change instead, and
1569
+ * present your own UI. Return `true` to apply the remedy, including on the paths the
1570
+ * default refuses. A handler that throws refuses the change.
1571
+ *
1572
+ * Whichever way it is resolved, `onSeatSelect` and `onSeatDeselect` then fire for the
1573
+ * clicked seat and for every seat the remedy touches. Refusing any one of them cancels
1574
+ * the whole change, and the seats already confirmed receive the opposite event, so a
1575
+ * hold placed from `onSeatSelect` always gets a matching release.
1576
+ *
1577
+ * @example Explain the adjustment and accept it
1578
+ * ```typescript
1579
+ * onOrphanSeatsBlocked: (event) => {
1580
+ * if (!event.remedy) {
1581
+ * showToast(`That would strand ${event.orphaned.length} seat(s).`);
1582
+ * return false;
1583
+ * }
1584
+ * showToast(`Added ${event.remedy.select.length} more seat(s) so none is left alone.`);
1585
+ * return true;
1586
+ * }
1587
+ * ```
1588
+ *
1589
+ * @example Ask the buyer first, using a real modal
1590
+ * ```typescript
1591
+ * onOrphanSeatsBlocked: async (event) => {
1592
+ * if (!event.remedy) return false;
1593
+ * return await confirmDialog(
1594
+ * `Seat ${event.orphaned.join(', ')} would be left on its own. Add it too?`,
1595
+ * );
1596
+ * }
1597
+ * ```
1598
+ *
1599
+ * @example Keep the refusal and drive your own interface
1600
+ * ```typescript
1601
+ * onOrphanSeatsBlocked: (event) => {
1602
+ * highlightSeats(event.orphaned);
1603
+ * return false;
1604
+ * }
1605
+ * ```
1606
+ */
1607
+ onOrphanSeatsBlocked?: (event: IOrphanSeatsBlockedEvent) => boolean | Promise<boolean>;
1954
1608
  /**
1955
1609
  * Fires when the user marks a seat or seats as selected.
1956
1610
  *
@@ -2080,154 +1734,721 @@ interface IRendererSettings {
2080
1734
  */
2081
1735
  onSeatSelectionChange?: () => void;
2082
1736
  /**
2083
- * Fires after seats selection was updated.
1737
+ * Fires after seats selection was updated.
1738
+ */
1739
+ onSeatsSelectionChange?: (seats: ISeat[]) => void;
1740
+ /**
1741
+ * You can control seats' styling by returning custom style for each seat
1742
+ */
1743
+ onBeforeSeatDraw?: (event: IBeforeSeatDrawEvent) => ISeatStyle;
1744
+ lockedSeatsFilter?: (seat: ISeat) => boolean;
1745
+ /**
1746
+ * Suppress console warnings for deprecated API methods.
1747
+ * Useful for gradual migration in production environments.
1748
+ * @default false
1749
+ */
1750
+ suppressDeprecationWarnings?: boolean;
1751
+ /**
1752
+ * Control visibility of outline types based on source.
1753
+ * Each source can be set to 'always', 'eagle-only', or 'hidden'.
1754
+ *
1755
+ * Source meanings:
1756
+ * - svg: bound to the background svg
1757
+ * - fallback: fallback outline generated from seats
1758
+ * - shape: editor-made basic shapes
1759
+ * - auto: editor-generated outline
1760
+ */
1761
+ outlineVisibility?: {
1762
+ auto?: 'always' | 'eagle-only' | 'hidden';
1763
+ fallback?: 'always' | 'eagle-only' | 'hidden';
1764
+ svg?: 'always' | 'eagle-only' | 'hidden';
1765
+ shape?: 'always' | 'eagle-only' | 'hidden';
1766
+ };
1767
+ }
1768
+ /**
1769
+ * Represents the possible interaction states of a seat.
1770
+ * Used to determine how a seat should be rendered based on user interaction.
1771
+ */
1772
+ type SeatInteractionState = 'default' | 'hovered' | 'selected' | 'unavailable' | 'loading' | 'error';
1773
+ /**
1774
+ * Interface for the event data passed to the onOrphanSeatsBlocked callback.
1775
+ * Describes the rejected change and how it can be made acceptable.
1776
+ */
1777
+ interface IOrphanSeatsBlockedEvent {
1778
+ /**
1779
+ * The ids of the seats the user tried to select or deselect.
1780
+ */
1781
+ attempted: number[];
1782
+ /**
1783
+ * The ids of the seats that would have been left stranded.
1784
+ */
1785
+ orphaned: number[];
1786
+ /**
1787
+ * The extra seats to select and deselect that would make the change acceptable,
1788
+ * or null when no such combination exists or when one of the seats it needs
1789
+ * cannot be selected.
1790
+ */
1791
+ remedy: {
1792
+ select: number[];
1793
+ deselect: number[];
1794
+ } | null;
1795
+ }
1796
+ /**
1797
+ * Interface returned by the cart methods that mutate the cart programmatically:
1798
+ * `initCart`, `addSeatsToCart`, `removeSeatsFromCartByIds` and
1799
+ * `removeSeatsFromCartByKeys`.
1800
+ *
1801
+ * @remarks
1802
+ *
1803
+ * Orphan prevention guides a buyer's own clicks through the
1804
+ * `onOrphanSeatsBlocked` callback. A programmatic change is reported here
1805
+ * instead, because these methods are synchronous and cannot wait for an answer.
1806
+ *
1807
+ * Adding seats is refused when it would strand a seat, since nothing is lost by
1808
+ * refusing. Restoring a cart and releasing seats are always applied and only
1809
+ * reported, because refusing either would take away seats the buyer already had.
1810
+ *
1811
+ * `applied` and `orphaned` answer different questions and must both be read.
1812
+ * `applied` says whether the cart changed; `orphaned` says whether the change
1813
+ * strands a seat. A restore or a release reports `applied: true` together with
1814
+ * a non-empty `orphaned`, because it goes through and strands a seat.
1815
+ */
1816
+ interface ICartChangeResult {
1817
+ /**
1818
+ * Whether the change reached the cart. False when `addSeatsToCart` refused a
1819
+ * stranding batch, and when the renderer has been destroyed.
1820
+ *
1821
+ * @remarks
1822
+ *
1823
+ * This is not a verdict on orphan prevention: read `orphaned` for that.
1824
+ */
1825
+ applied: boolean;
1826
+ /**
1827
+ * The ids of the seats the change leaves stranded, empty when there are none
1828
+ * and when orphan prevention is off.
1829
+ *
1830
+ * @remarks
1831
+ *
1832
+ * Non-empty alongside `applied: true` for `initCart` and the removal methods,
1833
+ * which report a stranding change rather than refusing it.
1834
+ */
1835
+ orphaned: number[];
1836
+ /**
1837
+ * The extra seats to select and deselect that would make the change
1838
+ * acceptable, or null when no such combination exists or when one of the
1839
+ * seats it needs cannot be selected.
1840
+ */
1841
+ remedy: {
1842
+ select: number[];
1843
+ deselect: number[];
1844
+ } | null;
1845
+ }
1846
+ /**
1847
+ * Interface for the event data passed to the onBeforeSeatDraw callback.
1848
+ * Contains information about the seat being drawn and its current state.
1849
+ */
1850
+ interface IBeforeSeatDrawEvent {
1851
+ /**
1852
+ * The seat being drawn.
1853
+ */
1854
+ seat: ISeat;
1855
+ /**
1856
+ * The current interaction state of the seat.
1857
+ */
1858
+ state: SeatInteractionState;
1859
+ /**
1860
+ * The default style that will be applied to the seat.
1861
+ */
1862
+ style: ISeatStyle;
1863
+ /**
1864
+ * The rendering context.
1865
+ */
1866
+ context: Context;
1867
+ }
1868
+ type BuiltinSeatStateKey = 'default' | 'unavailable' | 'filtered' | 'hovered' | 'selected' | 'loading' | 'error';
1869
+ interface ISeatStateRenderArgs {
1870
+ seat: ISeat;
1871
+ stateKey: string;
1872
+ style: ICustomSeatStyle;
1873
+ sizePx: number;
1874
+ }
1875
+ interface ICustomSeatStyle {
1876
+ tint?: string;
1877
+ svg?: string;
1878
+ imageId?: string;
1879
+ className?: string;
1880
+ priority?: number;
1881
+ blockInteraction?: boolean;
1882
+ keepSeatName?: boolean;
1883
+ render?: (args: ISeatStateRenderArgs) => HTMLElement | string;
1884
+ }
1885
+ interface IOrphanGroupStyle {
1886
+ color?: string;
1887
+ width?: number;
1888
+ dash?: number[];
1889
+ opacity?: number;
1890
+ padding?: number;
1891
+ }
1892
+ type SeatStylesMap = Partial<Record<BuiltinSeatStateKey, ISeatStyle>> & {
1893
+ [customKey: string]: ICustomSeatStyle | ISeatStyle | undefined;
1894
+ };
1895
+ interface IBasicSeatStyle {
1896
+ size: number;
1897
+ color: string;
1898
+ seatName?: {
1899
+ font: string;
1900
+ color: string;
1901
+ };
1902
+ stroke?: {
1903
+ width: number;
1904
+ color: string;
1905
+ align?: 'center' | 'inside' | 'outside';
1906
+ };
1907
+ imageId?: string;
1908
+ shadow?: {
1909
+ blur: number;
1910
+ color: string;
1911
+ x?: number;
1912
+ y?: number;
1913
+ };
1914
+ }
1915
+ interface ISeatStyle extends IBasicSeatStyle {
1916
+ accessible?: IBasicSeatStyle;
1917
+ }
1918
+ interface ISvgSectionStateStyles {
1919
+ default?: Pick<ISvgSectionStyle, 'sectionName' | 'stroke' | 'cursor' | 'bgColor'>;
1920
+ unavailable?: ISvgSectionStyle;
1921
+ filtered?: ISvgSectionStyle;
1922
+ hovered?: ISvgSectionStyle;
1923
+ selected?: ISvgSectionStyle;
1924
+ }
1925
+ interface IRendererSvgSectionStylesSetting extends ISvgSectionStateStyles {
1926
+ /**
1927
+ * Per-outline-source style overrides. Section outlines are tagged by source
1928
+ * (`svg`, `shape`, `auto`, `fallback`); a source entry overrides the flat
1929
+ * styles above for that source only, leaving the others on the global styles.
1930
+ * Use it to style, for example, hover on auto-generated seat-section outlines
1931
+ * (`fallback` / `auto`) differently from user zones (`svg`). Applies to the SVG
1932
+ * outline styling; in WebGL overlay mode the hover ring color still comes from
1933
+ * the flat `hovered.stroke.color`.
1934
+ */
1935
+ bySource?: Partial<Record<OutlineSource, ISvgSectionStateStyles>>;
1936
+ }
1937
+ interface ISvgSectionStyle {
1938
+ sectionName?: {
1939
+ color?: string;
1940
+ };
1941
+ bgColor?: string;
1942
+ stroke?: {
1943
+ color?: string;
1944
+ opacity?: number;
1945
+ width?: string;
1946
+ };
1947
+ cursor?: string;
1948
+ opacity?: number;
1949
+ }
1950
+ interface IRendererTheme {
1951
+ gridStep?: number;
1952
+ bgColor?: string;
1953
+ priceColors?: string[][];
1954
+ colorCategories?: string[];
1955
+ images?: {
1956
+ [id: string]: string;
1957
+ };
1958
+ seatStyles?: SeatStylesMap;
1959
+ /**
1960
+ * Styling for the dashed outline drawn around a group of seats that can only
1961
+ * be taken together, and around the seats a hovered seat would drag along.
1962
+ */
1963
+ orphanGroup?: IOrphanGroupStyle;
1964
+ svgSectionStyles?: IRendererSvgSectionStylesSetting;
1965
+ }
1966
+
1967
+ /**
1968
+ * Base interface for seat properties.
1969
+ */
1970
+ interface IBaseSeat {
1971
+ /**
1972
+ * The unique identifier of the seat.
1973
+ */
1974
+ id: number;
1975
+ /**
1976
+ * The ID of the row this seat belongs to.
1977
+ */
1978
+ rowId: number;
1979
+ /**
1980
+ * The ID of the sector this seat belongs to.
1981
+ */
1982
+ sectorId: number;
1983
+ /**
1984
+ * The X coordinate of the seat within its section.
1985
+ */
1986
+ x: number;
1987
+ /**
1988
+ * The Y coordinate of the seat within its section.
1989
+ */
1990
+ y: number;
1991
+ /**
1992
+ * Untransformed grid X coordinate of the seat, relative to its section.
1993
+ * Populated on demand for a single section during block selection.
1994
+ */
1995
+ ix?: number;
1996
+ /**
1997
+ * Untransformed grid Y coordinate of the seat, relative to its section.
1998
+ * Populated on demand for a single section during block selection.
1999
+ */
2000
+ iy?: number;
2001
+ /**
2002
+ * The name or number of the seat.
2003
+ */
2004
+ name: string;
2005
+ /**
2006
+ * Whether the seat is accessible for people with disabilities.
2007
+ */
2008
+ isAccessible?: boolean;
2009
+ /**
2010
+ * Whether the seat is marked with a special status.
2011
+ */
2012
+ isMarked?: boolean;
2013
+ customState?: string;
2014
+ }
2015
+ /**
2016
+ * A photo attached to a section, shown by the host page.
2017
+ */
2018
+ interface ISectionPhoto {
2019
+ url: string;
2020
+ thumbUrl?: string;
2021
+ caption?: string;
2022
+ }
2023
+ /**
2024
+ * Base interface for sector properties.
2025
+ */
2026
+ interface IBaseSector {
2027
+ /**
2028
+ * The unique identifier of the sector.
2029
+ */
2030
+ id: number;
2031
+ /**
2032
+ * The globally unique identifier for the sector.
2033
+ */
2034
+ guid?: string;
2035
+ /**
2036
+ * Whether this is a general admission (GA) sector.
2037
+ */
2038
+ isGa: boolean;
2039
+ /**
2040
+ * The name of the sector.
2041
+ */
2042
+ name: string;
2043
+ /**
2044
+ * The rotation angle of the sector in degrees.
2045
+ */
2046
+ angle?: number | null;
2047
+ /**
2048
+ * The type of the sector.
2049
+ */
2050
+ type?: string | null;
2051
+ /**
2052
+ * Whether the sector is disabled and cannot be interacted with.
2053
+ */
2054
+ disabled?: boolean;
2055
+ /**
2056
+ * Whether the sector is filtered out by current filter criteria.
2057
+ */
2058
+ filtered?: boolean;
2059
+ /**
2060
+ * Whether the sector is currently selected.
2061
+ */
2062
+ selected?: boolean;
2063
+ /**
2064
+ * Shape metadata for the sector (GA section shapes with text, color, etc.)
2065
+ */
2066
+ shapes?: ReadonlyArray<IShapeMetadata>;
2067
+ /** Label anchor X offset from section center (SEAT-624) */
2068
+ labelOffsetX?: number;
2069
+ /** Label anchor Y offset from section center (SEAT-624) */
2070
+ labelOffsetY?: number;
2071
+ /** Label style overrides (SEAT-624) */
2072
+ labelStyle?: ILabelStyle;
2073
+ /** Whether the section name label should render (SEAT-895) */
2074
+ labelVisible?: boolean;
2075
+ /** Photos attached to the section, in display order */
2076
+ photos?: ISectionPhoto[];
2077
+ }
2078
+ /**
2079
+ * Label style overrides for GA section labels (SEAT-624).
2080
+ */
2081
+ interface ILabelStyle {
2082
+ fontScale?: number;
2083
+ color?: string;
2084
+ opacity?: number;
2085
+ fontWeight?: 'normal' | 'bold';
2086
+ background?: string;
2087
+ visible?: boolean;
2088
+ showPrice?: boolean;
2089
+ }
2090
+ /**
2091
+ * Shape metadata from the API response.
2092
+ */
2093
+ interface IShapeMetadata {
2094
+ id?: string;
2095
+ text?: string;
2096
+ textColor?: string;
2097
+ textPosition?: string;
2098
+ fill?: string;
2099
+ width?: number;
2100
+ height?: number;
2101
+ top?: number;
2102
+ left?: number;
2103
+ angle?: number;
2104
+ order?: number;
2105
+ fontScale?: number;
2106
+ }
2107
+ type BrandingLevel = 'watermark' | 'interrupted';
2108
+ /**
2109
+ * Interface representing the schema data transfer object from the API.
2110
+ * @hidden
2111
+ */
2112
+ interface ISchemaDTO {
2113
+ plainSeats?: IPlainSeatsDTO;
2114
+ seats: ISeatDTO[];
2115
+ rows: IRowDTO[];
2116
+ sectors: ISectorDTO[];
2117
+ background: ISVGBackgroundDTO;
2118
+ requestTime?: number;
2119
+ responseSize?: number;
2120
+ configuration?: IConfigurationDTO;
2121
+ instanceId?: string;
2122
+ componentVersion?: string;
2123
+ branding?: BrandingLevel;
2124
+ }
2125
+ /**
2126
+ * Interface representing the venue data transfer object from the API.
2127
+ * @hidden
2128
+ */
2129
+ interface IVenueDTO {
2130
+ guid: string;
2131
+ name: string;
2132
+ gaCapacity?: number;
2133
+ seatsCapacity?: number;
2134
+ seatmap: ISchemaDTO;
2135
+ schema: ISchemaDTO;
2136
+ }
2137
+ /**
2138
+ * Interface representing the plain seats data transfer object from the API.
2139
+ * @hidden
2140
+ */
2141
+ interface IPlainSeatsDTO {
2142
+ ids: number[];
2143
+ x: number[];
2144
+ y: number[];
2145
+ rowIds: [];
2146
+ sectorIds: [];
2147
+ names: string[];
2148
+ }
2149
+ /**
2150
+ * Untransformed grid coordinates for the seats of a single section, fetched on
2151
+ * demand. The arrays are aligned by index: seat `ids[i]` sits at grid cell
2152
+ * (`ix[i]`, `iy[i]`).
2153
+ * @hidden
2154
+ */
2155
+ interface ISectionGridDTO {
2156
+ ids: number[];
2157
+ ix: number[];
2158
+ iy: number[];
2159
+ }
2160
+ /**
2161
+ * Interface representing the base seat data transfer object from the API.
2162
+ * Contains the core properties of a seat as received from the backend.
2163
+ * @hidden
2164
+ */
2165
+ type ISeatDTO = IBaseSeat;
2166
+ /**
2167
+ * Interface representing a row in the venue.
2168
+ * @hidden
2169
+ */
2170
+ interface IRowDTO {
2171
+ id: number;
2172
+ rowNumber: number;
2173
+ sectorId: number;
2174
+ name: string;
2175
+ seatName: string;
2176
+ }
2177
+ /**
2178
+ * Interface representing the base sector data transfer object from the API.
2179
+ * Contains the core properties of a sector as received from the backend.
2180
+ * @hidden
2181
+ */
2182
+ type ISectorDTO = Omit<IBaseSector, 'labelStyle'> & {
2183
+ /**
2184
+ * Label style overrides as sent by the API: a JSON string (SEAT-624 wire format).
2185
+ * Normalize with `withParsedLabelStyle` before putting a sector into the renderer
2186
+ * context, which types it as the parsed {@link ILabelStyle} object (SEAT-1069).
2187
+ */
2188
+ labelStyle?: string | ILabelStyle;
2189
+ };
2190
+ /**
2191
+ * Interface representing the SVG background data transfer object from the API.
2192
+ * @hidden
2193
+ */
2194
+ interface ISVGBackgroundDTO {
2195
+ svg?: Nullable<string>;
2196
+ viewBox: {
2197
+ x: number;
2198
+ y: number;
2199
+ width: number;
2200
+ height: number;
2201
+ };
2202
+ svgLink?: string;
2203
+ images?: IPngBackgroundDTO;
2204
+ outlineSvg?: Nullable<string>;
2205
+ }
2206
+ /**
2207
+ * Interface representing the configuration data transfer object from the API.
2208
+ * @hidden
2209
+ */
2210
+ interface IConfigurationDTO {
2211
+ accessible: number[];
2212
+ marked: number[];
2213
+ eventName?: string;
2214
+ }
2215
+ /**
2216
+ * Interface representing a special price option for seats, sections, or sectors.
2217
+ * Contains information about a named price point with its identifier.
2218
+ */
2219
+ interface ISpecialPrice {
2220
+ /**
2221
+ * The name or label of the special price option.
2222
+ */
2223
+ name: string;
2224
+ /**
2225
+ * The unique identifier for this price option.
2226
+ */
2227
+ priceId: number;
2228
+ }
2229
+ /**
2230
+ * Interface representing special state information for seats, sections, or sectors.
2231
+ * Contains additional properties that affect rendering or behavior.
2232
+ */
2233
+ interface ISpecialState {
2234
+ /**
2235
+ * Special state flag 1, used for custom state indicators.
2236
+ */
2237
+ s1?: number;
2238
+ /**
2239
+ * Array of special prices associated with this item.
2240
+ */
2241
+ prices?: ISpecialPrice[];
2242
+ /**
2243
+ * Category identifier for grouping items with similar special states.
2244
+ */
2245
+ category?: number;
2246
+ }
2247
+ /**
2248
+ * Interface representing a price list data transfer object from the API.
2249
+ * @hidden
2250
+ */
2251
+ interface IPriceListDTO {
2252
+ seats: [number, IPriceId, ISpecialState?][];
2253
+ groupOfSeats: [number, number, number, ISpecialState?][];
2254
+ prices: IPriceDTO[];
2255
+ /**
2256
+ * Live orphan seat prevention flag for the event, resolved at request time.
2257
+ * Absent on payloads from older backends or when the flag could not be resolved.
2258
+ */
2259
+ orphanPrevention?: boolean | null;
2260
+ requestTime?: number;
2261
+ responseSize?: number;
2262
+ }
2263
+ /**
2264
+ * Interface representing the price assignments of an event, regardless of seat availability.
2265
+ *
2266
+ * Seats are addressed by position in `seatIds`, which is ascending and delta encoded: the
2267
+ * first element is an absolute seat id and each later element is the increment from the one
2268
+ * before it. `seatPriceRuns` holds `[priceId, count]` pairs covering those seats in sequence,
2269
+ * and `seatPropertyIndexes` names the positions of the few seats carrying properties, whose
2270
+ * values are in `seatProperties`.
2271
+ * @hidden
2272
+ */
2273
+ interface IAssignmentListDTO {
2274
+ version?: string;
2275
+ seatIds: number[];
2276
+ seatPriceRuns: [IPriceId, number][];
2277
+ seatPropertyIndexes: number[];
2278
+ seatProperties: ISpecialState[];
2279
+ groupOfSeats: [number, number, ISpecialState?][];
2280
+ prices: IPriceDTO[];
2281
+ requestTime?: number;
2282
+ responseSize?: number;
2283
+ }
2284
+ /**
2285
+ * Interface representing the availability of an event, which changes on every lock, unlock and sale.
2286
+ *
2287
+ * `unavailableSeats` is delta encoded, so the first element is an absolute seat id and each
2288
+ * later element is the increment from the one before it.
2289
+ * @hidden
2290
+ */
2291
+ interface IAvailabilityDTO {
2292
+ version?: string;
2293
+ unavailableSeats: number[];
2294
+ groupOfSeats: [number, number, number][];
2295
+ /**
2296
+ * Live orphan seat prevention flag for the event, resolved at request time.
2297
+ * Absent on payloads from older backends or when the flag could not be resolved.
2298
+ */
2299
+ orphanPrevention?: boolean | null;
2300
+ requestTime?: number;
2301
+ responseSize?: number;
2302
+ }
2303
+ declare const emptyPriceList: () => IPriceListDTO;
2304
+ /**
2305
+ * Interface representing a price data transfer object from the API.
2306
+ * @hidden
2307
+ */
2308
+ interface IPriceDTO {
2309
+ id: IPriceId;
2310
+ name: string;
2311
+ }
2312
+ /**
2313
+ * Type representing blurred image data.
2314
+ * @hidden
2315
+ */
2316
+ type IBlurred = {
2317
+ data: string;
2318
+ shrink_factor: number;
2319
+ size: number;
2320
+ status: string;
2321
+ };
2322
+ /**
2323
+ * Type representing a PNG image loaded from a URL.
2324
+ * @hidden
2325
+ */
2326
+ type IPngFromUrl = {
2327
+ height: number;
2328
+ size: number;
2329
+ width: number;
2330
+ path: string;
2331
+ status: string;
2332
+ };
2333
+ /**
2334
+ * Type representing the tile grid sliced from the full-size background.
2335
+ * @hidden
2336
+ */
2337
+ type ITileGrid = {
2338
+ size: number;
2339
+ cols: number;
2340
+ rows: number;
2341
+ width: number;
2342
+ height: number;
2343
+ path: string;
2344
+ status: string;
2345
+ };
2346
+ /**
2347
+ * Interface representing PNG background images in different resolutions.
2348
+ * @hidden
2349
+ */
2350
+ interface IPngBackgroundDTO {
2351
+ blurred: IBlurred;
2352
+ preview: IPngFromUrl;
2353
+ full: IPngFromUrl;
2354
+ tiles?: ITileGrid;
2355
+ lods?: IPngFromUrl[];
2356
+ }
2357
+
2358
+ /**
2359
+ * Settings for the BookingApiClient.
2360
+ * @hidden
2361
+ */
2362
+ interface IBookingApiClientSettings {
2363
+ baseUrl: string;
2364
+ publicKey: string;
2365
+ debug?: boolean;
2366
+ forceSvg?: boolean;
2367
+ requestTimeoutMs?: number;
2368
+ }
2369
+ /**
2370
+ * Metrics for API requests.
2371
+ * @hidden
2372
+ */
2373
+ interface RequestMetrics {
2374
+ data?: string;
2375
+ requestTime: number;
2376
+ responseSize: number;
2377
+ }
2378
+ /**
2379
+ * Error thrown when the booking API returns a non-2xx response.
2380
+ * Preserves the HTTP status and the backend error code (e.g. EVENT_ARCHIVED, EVENT_NOT_PUBLISHED).
2381
+ */
2382
+ declare class ApiError extends Error {
2383
+ readonly status: number;
2384
+ readonly errorCode: string | undefined;
2385
+ constructor(status: number, statusText: string, errorCode?: string);
2386
+ }
2387
+ /**
2388
+ * API client for fetching schema and price data from the booking API.
2389
+ * @hidden
2390
+ */
2391
+ declare class BookingApiClient {
2392
+ private settings;
2393
+ private splitPricingUnsupported;
2394
+ constructor(settings: IBookingApiClientSettings);
2395
+ /**
2396
+ * Returns schema data
2397
+ * @param schemaId Schema ID
2084
2398
  */
2085
- onSeatsSelectionChange?: (seats: ISeat[]) => void;
2399
+ fetchSchema(schemaId: number): Promise<ISchemaDTO>;
2086
2400
  /**
2087
- * You can control seats' styling by returning custom style for each seat
2401
+ * Returns schema data
2402
+ * @param venueId Venue GUID
2088
2403
  */
2089
- onBeforeSeatDraw?: (event: IBeforeSeatDrawEvent) => ISeatStyle;
2090
- lockedSeatsFilter?: (seat: ISeat) => boolean;
2404
+ fetchSchemaForVenue(venueId: string): Promise<Omit<IVenueDTO, 'seatmap'>>;
2091
2405
  /**
2092
- * Suppress console warnings for deprecated API methods.
2093
- * Useful for gradual migration in production environments.
2094
- * @default false
2406
+ * Returns schema data
2407
+ * @param eventId Event GUID
2095
2408
  */
2096
- suppressDeprecationWarnings?: boolean;
2409
+ fetchSchemaForEvent(eventId: string): Promise<ISchemaDTO>;
2097
2410
  /**
2098
- * Control visibility of outline types based on source.
2099
- * Each source can be set to 'always', 'eagle-only', or 'hidden'.
2100
- *
2101
- * Source meanings:
2102
- * - svg: bound to the background svg
2103
- * - fallback: fallback outline generated from seats
2104
- * - shape: editor-made basic shapes
2105
- * - auto: editor-generated outline
2411
+ * Returns the untransformed grid coordinates for a single section of an event's schema.
2412
+ * @param eventId Event GUID
2413
+ * @param sectorId Section (sector) id
2106
2414
  */
2107
- outlineVisibility?: {
2108
- auto?: 'always' | 'eagle-only' | 'hidden';
2109
- fallback?: 'always' | 'eagle-only' | 'hidden';
2110
- svg?: 'always' | 'eagle-only' | 'hidden';
2111
- shape?: 'always' | 'eagle-only' | 'hidden';
2112
- };
2113
- }
2114
- /**
2115
- * Represents the possible interaction states of a seat.
2116
- * Used to determine how a seat should be rendered based on user interaction.
2117
- */
2118
- type SeatInteractionState = 'default' | 'hovered' | 'selected' | 'unavailable' | 'loading' | 'error';
2119
- /**
2120
- * Interface for the event data passed to the onBeforeSeatDraw callback.
2121
- * Contains information about the seat being drawn and its current state.
2122
- */
2123
- interface IBeforeSeatDrawEvent {
2415
+ fetchSectionGridForEvent(eventId: string, sectorId: number): Promise<ISectionGridDTO>;
2124
2416
  /**
2125
- * The seat being drawn.
2417
+ * Returns the untransformed grid coordinates for a single section of a schema.
2418
+ * @param schemaId Schema id
2419
+ * @param sectorId Section (sector) id
2126
2420
  */
2127
- seat: ISeat;
2421
+ fetchSectionGridForSchema(schemaId: number, sectorId: number): Promise<ISectionGridDTO>;
2422
+ private unpackSchemaDTO;
2128
2423
  /**
2129
- * The current interaction state of the seat.
2424
+ * Return prices information
2425
+ * @param eventId Event GUID
2130
2426
  */
2131
- state: SeatInteractionState;
2427
+ fetchPricesForEvent(eventId: string): Promise<IPriceListDTO>;
2428
+ private fetchSplitPricesForEvent;
2132
2429
  /**
2133
- * The default style that will be applied to the seat.
2430
+ * Return rows SVG information
2431
+ * @param eventId Event GUID
2134
2432
  */
2135
- style: ISeatStyle;
2433
+ fetchRowsSvgForEvent(eventId: string): Promise<RequestMetrics>;
2136
2434
  /**
2137
- * The rendering context.
2435
+ * Makes request to booking API
2436
+ * @param url Relative API endpoint URL, e.g. 'event/prices/?id=XXX'
2138
2437
  */
2139
- context: Context;
2140
- }
2141
- type BuiltinSeatStateKey = 'default' | 'unavailable' | 'filtered' | 'hovered' | 'selected' | 'loading' | 'error';
2142
- interface ISeatStateRenderArgs {
2143
- seat: ISeat;
2144
- stateKey: string;
2145
- style: ICustomSeatStyle;
2146
- sizePx: number;
2147
- }
2148
- interface ICustomSeatStyle {
2149
- tint?: string;
2150
- svg?: string;
2151
- imageId?: string;
2152
- className?: string;
2153
- priority?: number;
2154
- blockInteraction?: boolean;
2155
- keepSeatName?: boolean;
2156
- render?: (args: ISeatStateRenderArgs) => HTMLElement | string;
2157
- }
2158
- type SeatStylesMap = Partial<Record<BuiltinSeatStateKey, ISeatStyle>> & {
2159
- [customKey: string]: ICustomSeatStyle | ISeatStyle | undefined;
2160
- };
2161
- interface IBasicSeatStyle {
2162
- size: number;
2163
- color: string;
2164
- seatName?: {
2165
- font: string;
2166
- color: string;
2167
- };
2168
- stroke?: {
2169
- width: number;
2170
- color: string;
2171
- align: 'center' | 'inside' | 'outside';
2172
- };
2173
- imageId?: string;
2174
- shadow?: {
2175
- blur: number;
2176
- color: string;
2177
- x?: number;
2178
- y?: number;
2179
- };
2180
- }
2181
- interface ISeatStyle extends IBasicSeatStyle {
2182
- accessible?: IBasicSeatStyle;
2183
- }
2184
- interface ISvgSectionStateStyles {
2185
- default?: Pick<ISvgSectionStyle, 'sectionName' | 'stroke' | 'cursor' | 'bgColor'>;
2186
- unavailable?: ISvgSectionStyle;
2187
- filtered?: ISvgSectionStyle;
2188
- hovered?: ISvgSectionStyle;
2189
- selected?: ISvgSectionStyle;
2190
- }
2191
- interface IRendererSvgSectionStylesSetting extends ISvgSectionStateStyles {
2438
+ request<T>(url: string, options?: {
2439
+ baseUrl?: string;
2440
+ silent?: boolean;
2441
+ }): Promise<T>;
2192
2442
  /**
2193
- * Per-outline-source style overrides. Section outlines are tagged by source
2194
- * (`svg`, `shape`, `auto`, `fallback`); a source entry overrides the flat
2195
- * styles above for that source only, leaving the others on the global styles.
2196
- * Use it to style, for example, hover on auto-generated seat-section outlines
2197
- * (`fallback` / `auto`) differently from user zones (`svg`). Applies to the SVG
2198
- * outline styling; in WebGL overlay mode the hover ring color still comes from
2199
- * the flat `hovered.stroke.color`.
2443
+ * Makes request to booking API
2444
+ * @param url Relative API endpoint URL, e.g. 'event/prices/?id=XXX'
2200
2445
  */
2201
- bySource?: Partial<Record<OutlineSource, ISvgSectionStateStyles>>;
2202
- }
2203
- interface ISvgSectionStyle {
2204
- sectionName?: {
2205
- color?: string;
2206
- };
2207
- bgColor?: string;
2208
- stroke?: {
2209
- color?: string;
2210
- opacity?: number;
2211
- width?: string;
2212
- };
2213
- cursor?: string;
2214
- opacity?: number;
2215
- }
2216
- interface IRendererTheme {
2217
- gridStep?: number;
2218
- bgColor?: string;
2219
- priceColors?: string[][];
2220
- colorCategories?: string[];
2221
- images?: {
2222
- [id: string]: string;
2223
- };
2224
- seatStyles?: SeatStylesMap;
2225
- svgSectionStyles?: IRendererSvgSectionStylesSetting;
2446
+ requestPlain<T extends RequestMetrics>(url: string): Promise<T>;
2447
+ private restoreIds;
2226
2448
  }
2227
2449
 
2228
- /**
2229
- * @hidden
2230
- */
2450
+ declare function preconnectToApi(baseUrl: string): void;
2451
+
2231
2452
  declare class OutlineLayer {
2232
2453
  svgElement: SVGSVGElement;
2233
2454
  private context;
@@ -2246,6 +2467,7 @@ declare class OutlineLayer {
2246
2467
  constructor(context: Context);
2247
2468
  destroy(): void;
2248
2469
  applyOutlineAttributes(element: Element, source: OutlineSource, section: ISector): void;
2470
+ resolveOutlineVisibility(source: OutlineSource): "always" | "eagle-only" | "hidden";
2249
2471
  /**
2250
2472
  * Apply per-section textColor from shape metadata to text path elements.
2251
2473
  * Inline style overrides the generic CSS theme color.
@@ -2276,6 +2498,7 @@ declare class OutlineLayer {
2276
2498
  private checkCenterInViewBox;
2277
2499
  private getElementScreenRectInSvg;
2278
2500
  getSectionElement(id: number | undefined): Element | null;
2501
+ getSectionStateElement(id: number | undefined): Element | null;
2279
2502
  getSectionElements(id: number | undefined): Element[];
2280
2503
  getSectionCenter(id: Nullable<number>): Nullable<IPoint>;
2281
2504
  /** Extract data-font-scale attributes from SVG outline groups. */
@@ -2312,7 +2535,7 @@ declare class OutlineLayer {
2312
2535
  private appendShapeOutlines;
2313
2536
  createFallbackOutlineRect(section: ISector): SVGRectElement | null;
2314
2537
  private getRenderContext;
2315
- handleChangeEagleView(isEagleView?: boolean): void;
2538
+ handleChangeEagleView(): void;
2316
2539
  /** @deprecated Use disableSection() instead */
2317
2540
  disableSvgSectionById: (id: number) => void;
2318
2541
  /** @deprecated Use enableSection() instead */
@@ -2493,8 +2716,12 @@ interface IRenderer {
2493
2716
  * Initializes the cart with the provided cart data.
2494
2717
  *
2495
2718
  * @param cart - The cart data to initialize
2719
+ *
2720
+ * @returns The cart is restored whether or not it strands a seat; when orphan
2721
+ * prevention is on and it does, the result names the stranded seats. `applied`
2722
+ * is false only when the renderer has been destroyed (see ICartChangeResult).
2496
2723
  */
2497
- initCart: (cart: ICart) => void;
2724
+ initCart: (cart: ICart) => ICartChangeResult;
2498
2725
  /**
2499
2726
  * Gets the current cart state.
2500
2727
  *
@@ -2521,14 +2748,21 @@ interface IRenderer {
2521
2748
  * Adds seats to the cart.
2522
2749
  *
2523
2750
  * @param seats - The seats to add to the cart
2751
+ *
2752
+ * @returns When orphan prevention is on and the batch would strand a seat,
2753
+ * nothing is added, `applied` is false, and the result names the stranded
2754
+ * seats and how to adjust the batch (see ICartChangeResult).
2524
2755
  */
2525
- addSeatsToCart: (seats: ICartSeat[]) => void;
2756
+ addSeatsToCart: (seats: ICartSeat[]) => ICartChangeResult;
2526
2757
  /**
2527
2758
  * Removes seats from the cart by their IDs.
2528
2759
  *
2529
2760
  * @param seatIds - The IDs of the seats to remove
2761
+ *
2762
+ * @returns The seats are always removed. When orphan prevention is on and the
2763
+ * release strands a seat, the result names it (see ICartChangeResult).
2530
2764
  */
2531
- removeSeatsFromCartByIds: (seatIds: number[]) => void;
2765
+ removeSeatsFromCartByIds: (seatIds: number[]) => ICartChangeResult;
2532
2766
  /**
2533
2767
  * Disables seats by their IDs, making them unavailable for selection.
2534
2768
  *
@@ -2910,6 +3144,7 @@ declare class SelectionLayer extends SectionViewLayer {
2910
3144
  interface SectionHelperDeps {
2911
3145
  getContext: () => Context;
2912
3146
  getStageLayer: () => IStageLayer;
3147
+ redraw: () => void;
2913
3148
  getSelectionLayer: () => SelectionLayer | null;
2914
3149
  getOutlineLayer: () => OutlineLayer;
2915
3150
  getDataManager: () => DataManager;
@@ -2987,6 +3222,7 @@ declare class Renderer implements IRenderer {
2987
3222
  private minimapLayer?;
2988
3223
  private loaderLayer?;
2989
3224
  private markerLayer;
3225
+ private orphanGroupLayer;
2990
3226
  private markerManager;
2991
3227
  private markerUnsubscribe?;
2992
3228
  private dataManager;
@@ -3101,12 +3337,16 @@ declare class Renderer implements IRenderer {
3101
3337
  setGroupSize(groupSize: number): void;
3102
3338
  getSeatIds(seats: ISeat[] | number[] | string[]): number[];
3103
3339
  getMarkedSeatsIds(): number[];
3104
- setSeatsCategory(seats: ISeat[] | number[] | string[], category: number, color?: string): void;
3340
+ setSeatsCategory(seats: ISeat[] | number[] | string[], category: number | string, color?: string): void;
3105
3341
  setSeatsState(seats: ISeat[] | number[] | string[], stateKey: string): void;
3106
3342
  clearSeatsState(seats: ISeat[] | number[] | string[]): void;
3107
- setGaCategory(sectionId: number, category: number | undefined): void;
3343
+ setGaCategory(sections: ISector[] | number[] | string[], category: number | string | undefined, color?: string): void;
3344
+ clearSeatsCategory(seats: ISeat[] | number[] | string[]): void;
3345
+ clearGaCategory(sections: ISector[] | number[] | string[]): void;
3346
+ resetSeatsCategories(): void;
3347
+ resetGaCategories(): void;
3108
3348
  resetCategories(): void;
3109
- getCategoryColor(category: number): string | undefined;
3349
+ getCategoryColor(category: number | string): string | undefined;
3110
3350
  protected changeMachineContext(changes: Partial<IRendererMachineContext>): void;
3111
3351
  private setContextScale;
3112
3352
  /**
@@ -3168,8 +3408,13 @@ declare class Renderer implements IRenderer {
3168
3408
  * ```
3169
3409
  *
3170
3410
  * @param cart Cart state
3411
+ *
3412
+ * @returns The cart is restored whether or not it strands a seat; when
3413
+ * orphan prevention is on and it does, the result names the stranded seats.
3414
+ * `applied` is false only when the renderer has been destroyed and nothing
3415
+ * was restored (see ICartChangeResult).
3171
3416
  */
3172
- initCart(cart: ICart): void;
3417
+ initCart(cart: ICart): ICartChangeResult;
3173
3418
  /**
3174
3419
  * Clears the internal cart state.
3175
3420
  */
@@ -3298,20 +3543,30 @@ declare class Renderer implements IRenderer {
3298
3543
  * ```
3299
3544
  *
3300
3545
  * @param seats Array of seats to add
3546
+ *
3547
+ * @returns When orphan prevention is on and the batch would strand a seat,
3548
+ * nothing is added and the result names the stranded seats and how to adjust
3549
+ * the batch (see ICartChangeResult).
3301
3550
  */
3302
- addSeatsToCart(seats: ICartSeat[]): void;
3551
+ addSeatsToCart(seats: ICartSeat[]): ICartChangeResult;
3303
3552
  /**
3304
3553
  * Removes seats from internal cart.
3305
3554
  *
3306
3555
  * @param ids Array of internal seat IDs
3556
+ *
3557
+ * @returns The seats are always removed. When orphan prevention is on and the
3558
+ * release strands a seat, the result names it (see ICartChangeResult).
3307
3559
  */
3308
- removeSeatsFromCartByIds(ids: number[]): void;
3560
+ removeSeatsFromCartByIds(ids: number[]): ICartChangeResult;
3309
3561
  /**
3310
3562
  * Removes seats from internal cart.
3311
3563
  *
3312
3564
  * @param keys Array of composite seat keys
3565
+ *
3566
+ * @returns The seats are always removed. When orphan prevention is on and the
3567
+ * release strands a seat, the result names it (see ICartChangeResult).
3313
3568
  */
3314
- removeSeatsFromCartByKeys(keys: string[]): void;
3569
+ removeSeatsFromCartByKeys(keys: string[]): ICartChangeResult;
3315
3570
  disableSeatsByIds(ids: number[], options?: {
3316
3571
  resetAll?: boolean;
3317
3572
  }): void;
@@ -3583,6 +3838,7 @@ declare class SeatmapAdminRenderer extends Renderer {
3583
3838
  * - 'select': Seat selection (click/drag), GA section click supported
3584
3839
  * - 'selectRows': Row-based seat selection
3585
3840
  * - 'selectSections': Section-level click (fires onSectionClick for all section types)
3841
+ * - 'selectMixed': Drag selects seats and general admission sections together
3586
3842
  *
3587
3843
  * When set to 'pan', the outline layer is hidden. For any other mode, the outline layer is shown.
3588
3844
  *
@@ -3600,6 +3856,9 @@ declare class SeatmapAdminRenderer extends Renderer {
3600
3856
  *
3601
3857
  * // Set mode to 'selectSections' - section clicks fire onSectionClick for all sections
3602
3858
  * component.setMode('selectSections');
3859
+ *
3860
+ * // Set mode to 'selectMixed' - one drag selects seats and GA sections together
3861
+ * component.setMode('selectMixed');
3603
3862
  * ```
3604
3863
  */
3605
3864
  setMode(mode: string): boolean;
@@ -3726,6 +3985,7 @@ declare class SeatmapBookingRenderer extends Renderer {
3726
3985
  private debugOverlay?;
3727
3986
  private poweredByOverlay?;
3728
3987
  private interruptionOverlay?;
3988
+ private readonly orphanPreventionOverride;
3729
3989
  /**
3730
3990
  * Creates a new instance of the SeatmapBookingRenderer.
3731
3991
  *
@@ -3862,4 +4122,4 @@ declare class RotationAnimation {
3862
4122
  getAnimation(): IRotationAnimation | null;
3863
4123
  }
3864
4124
 
3865
- export { type AdminHotkeyAction, ApiError, BookingApiClient, type BrandingLevel, type BuiltinSeatStateKey, type ById, type ColorById, type ColorSequenceSettings, DataManager, type DataManagerEvent, type DataManagerEventCallback, type DeepPartial, type DestEvent, DestEventType, type HotkeysSetting, type IAdminRenderer, type IAdminRendererSettings, type IAssignmentListDTO, type IAvailabilityDTO, type IBackgroundImageLoadedEvent, type IBaseSeat, type IBaseSector, type IBasicSeatStyle, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type ICart, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type ICustomSeatStyle, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IEntityStates, type IErrorMessage, type IExtendedSeat, type ILabelStyle, type ILoadProgressEvent, type ILoaderSettings, type ILoaderTheme, type IMarker, type IMarkerSettings, type IMinimapSettings, type IMouseMoveSrcEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererAnimation, type IRendererMachineContext, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IResolvedMarker, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMetadata, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStateRenderArgs, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionGridDTO, type ISectionMetadata, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionPhoto, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type IShapeMetadata, type ISpecialPrice, type ISpecialState, type ISvgSectionStateStyles, type ISvgSectionStyle, type ITileGrid, type IVenueDTO, type IVisibilitySettings, type IWatermarkSettings, type IZoomSettings, type InteractionZoomStrategy, type InteractionZoomStrategyType, type LoaderStyle, type LoadingPhase, type MarkerAppearance, type MarkerTarget, type MinimapPosition, type Nullable, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, type RequestMetrics, RotationAnimation, type SeatFilter, type SeatInteractionState, type SeatStylesMap, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, StateManager, type StateManagerEvent, type StateManagerEventCallback, type TransformArray, VERSION, convertPricesToColored, convertPricesToColoredById, defaultZoomSettings, emptyPriceList, mergeSettings, preconnectToApi, sortPrices };
4125
+ export { type AdminHotkeyAction, ApiError, BookingApiClient, type BrandingLevel, type BuiltinSeatStateKey, type ById, type ColorById, type ColorSequenceSettings, DataManager, type DataManagerEvent, type DataManagerEventCallback, type DeepPartial, type DestEvent, DestEventType, type HotkeysSetting, type IAdminRenderer, type IAdminRendererSettings, type IAssignmentListDTO, type IAvailabilityDTO, type IBackgroundImageLoadedEvent, type IBaseSeat, type IBaseSector, type IBasicSeatStyle, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type ICart, type ICartChangeResult, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type ICustomSeatStyle, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IEntityStates, type IErrorMessage, type IExtendedSeat, type ILabelStyle, type ILoadProgressEvent, type ILoaderSettings, type ILoaderTheme, type IMarker, type IMarkerSettings, type IMinimapSettings, type IMouseMoveSrcEvent, type IOrphanGroupStyle, type IOrphanSeatsBlockedEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererAnimation, type IRendererMachineContext, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IResolvedMarker, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMetadata, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStateRenderArgs, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionGridDTO, type ISectionMetadata, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionPhoto, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type IShapeMetadata, type ISpecialPrice, type ISpecialState, type ISvgSectionStateStyles, type ISvgSectionStyle, type ITileGrid, type IVenueDTO, type IVisibilitySettings, type IWatermarkSettings, type IZoomSettings, type InteractionZoomStrategy, type InteractionZoomStrategyType, type LoaderStyle, type LoadingPhase, type MarkerAppearance, type MarkerTarget, type MinimapPosition, type Nullable, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, type RequestMetrics, RotationAnimation, type SeatFilter, type SeatInteractionState, type SeatStylesMap, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, StateManager, type StateManagerEvent, type StateManagerEventCallback, type TransformArray, VERSION, convertPricesToColored, convertPricesToColoredById, defaultZoomSettings, emptyPriceList, mergeSettings, preconnectToApi, sortPrices };