@zonetrix/viewer 2.11.0 → 2.11.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.
- package/dist/components/SeatMapViewer.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +408 -326
- package/package.json +1 -1
|
@@ -21,14 +21,14 @@ export interface SeatMapViewerProps {
|
|
|
21
21
|
onConfigLoad?: (config: SeatMapConfig) => void;
|
|
22
22
|
onError?: (error: Error) => void;
|
|
23
23
|
showFloorSelector?: boolean;
|
|
24
|
-
floorSelectorPosition?:
|
|
24
|
+
floorSelectorPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
25
25
|
floorSelectorClassName?: string;
|
|
26
26
|
showAllFloorsOption?: boolean;
|
|
27
27
|
allFloorsLabel?: string;
|
|
28
28
|
fitToView?: boolean;
|
|
29
29
|
fitPadding?: number;
|
|
30
30
|
showZoomControls?: boolean;
|
|
31
|
-
zoomControlsPosition?:
|
|
31
|
+
zoomControlsPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
32
32
|
zoomControlsClassName?: string;
|
|
33
33
|
/**
|
|
34
34
|
* Minimum zoom level.
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ export { useConfigFetcher } from './hooks/useConfigFetcher';
|
|
|
6
6
|
export { useContainerSize } from './hooks/useContainerSize';
|
|
7
7
|
export { useTouchGestures } from './hooks/useTouchGestures';
|
|
8
8
|
export { useFirebaseSeatStates } from './hooks/useFirebaseSeatStates';
|
|
9
|
-
export type { UseFirebaseSeatStatesOptions, UseFirebaseSeatStatesResult } from './hooks/useFirebaseSeatStates';
|
|
9
|
+
export type { UseFirebaseSeatStatesOptions, UseFirebaseSeatStatesResult, } from './hooks/useFirebaseSeatStates';
|
|
10
10
|
export { useFirebaseConfig } from './hooks/useFirebaseConfig';
|
|
11
|
-
export type { UseFirebaseConfigOptions, UseFirebaseConfigResult } from './hooks/useFirebaseConfig';
|
|
11
|
+
export type { UseFirebaseConfigOptions, UseFirebaseConfigResult, } from './hooks/useFirebaseConfig';
|
|
12
12
|
export { useRealtimeSeatMap } from './hooks/useRealtimeSeatMap';
|
|
13
|
-
export type { UseRealtimeSeatMapOptions, UseRealtimeSeatMapResult } from './hooks/useRealtimeSeatMap';
|
|
13
|
+
export type { UseRealtimeSeatMapOptions, UseRealtimeSeatMapResult, } from './hooks/useRealtimeSeatMap';
|
|
14
14
|
export { initializeFirebaseForViewer, isFirebaseInitialized, clearFirebaseInstance, } from './firebase/client';
|
package/dist/index.mjs
CHANGED
|
@@ -88,7 +88,11 @@ function Ct(n, r) {
|
|
|
88
88
|
}, s = (a) => {
|
|
89
89
|
a.touches.length < 2 && (t.current = null, o.current = null);
|
|
90
90
|
};
|
|
91
|
-
return i.addEventListener("touchstart", S, {
|
|
91
|
+
return i.addEventListener("touchstart", S, {
|
|
92
|
+
passive: !1
|
|
93
|
+
}), i.addEventListener("touchmove", p, {
|
|
94
|
+
passive: !1
|
|
95
|
+
}), i.addEventListener("touchend", s), () => {
|
|
92
96
|
i.removeEventListener("touchstart", S), i.removeEventListener("touchmove", p), i.removeEventListener("touchend", s);
|
|
93
97
|
};
|
|
94
98
|
}, [n, r]);
|
|
@@ -103,59 +107,64 @@ const Rt = {
|
|
|
103
107
|
seatHidden: "#4a4a4a",
|
|
104
108
|
gridLines: "#404040",
|
|
105
109
|
currency: "KD"
|
|
106
|
-
}, ke = J(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
s
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
110
|
+
}, ke = J(
|
|
111
|
+
({ seat: n, state: r, colors: t, onClick: o, onMouseEnter: d, onMouseLeave: l }) => {
|
|
112
|
+
const p = {
|
|
113
|
+
available: t.seatAvailable,
|
|
114
|
+
reserved: t.seatReserved,
|
|
115
|
+
selected: t.seatSelected,
|
|
116
|
+
unavailable: t.seatUnavailable,
|
|
117
|
+
hidden: t.seatHidden
|
|
118
|
+
// Hidden seats are filtered out, but included for type safety
|
|
119
|
+
}[r], s = r === "available" || r === "selected", a = z(() => {
|
|
120
|
+
s && o(n);
|
|
121
|
+
}, [n, o, s]), f = z(
|
|
122
|
+
(g) => {
|
|
123
|
+
d(n, g);
|
|
124
|
+
const C = g.target.getStage();
|
|
125
|
+
C && s && (C.container().style.cursor = "pointer");
|
|
126
|
+
},
|
|
127
|
+
[n, d, s]
|
|
128
|
+
), b = z(
|
|
129
|
+
(g) => {
|
|
130
|
+
l();
|
|
131
|
+
const C = g.target.getStage();
|
|
132
|
+
C && (C.container().style.cursor = "grab");
|
|
133
|
+
},
|
|
134
|
+
[l]
|
|
135
|
+
), x = {
|
|
136
|
+
x: n.position.x,
|
|
137
|
+
y: n.position.y,
|
|
138
|
+
fill: p,
|
|
139
|
+
stroke: "#ffffff",
|
|
140
|
+
strokeWidth: 1,
|
|
141
|
+
onClick: a,
|
|
142
|
+
onTap: a,
|
|
143
|
+
onMouseEnter: f,
|
|
144
|
+
onMouseLeave: b
|
|
145
|
+
};
|
|
146
|
+
return n.shape === "circle" ? /* @__PURE__ */ u(ze, { ...x, radius: 12 }) : /* @__PURE__ */ u(
|
|
147
|
+
De,
|
|
148
|
+
{
|
|
149
|
+
...x,
|
|
150
|
+
width: 24,
|
|
151
|
+
height: 24,
|
|
152
|
+
offsetX: 12,
|
|
153
|
+
offsetY: 12,
|
|
154
|
+
cornerRadius: n.shape === "square" ? 0 : 4
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
);
|
|
153
159
|
ke.displayName = "ViewerSeat";
|
|
154
160
|
const We = J(({ stage: n, stageColor: r }) => {
|
|
155
161
|
const t = n.config, o = t.shape || "rectangle", d = t.showLabel !== !1, l = t.color || r, i = t.width / t.height, S = i < 0.5, p = i > 2;
|
|
156
162
|
let s;
|
|
157
163
|
S ? s = t.width * 0.25 : p ? s = t.height * 0.35 : s = Math.min(t.width, t.height) * 0.25;
|
|
158
|
-
const a = t.label?.length || 6, x = t.width * 0.85 / a * 1.5, g = Math.max(
|
|
164
|
+
const a = t.label?.length || 6, x = t.width * 0.85 / a * 1.5, g = Math.max(
|
|
165
|
+
10,
|
|
166
|
+
Math.min(24, Math.min(s, x))
|
|
167
|
+
), C = 4, E = Math.max(20, t.width - C * 2), F = (t.width - E) / 2, R = {
|
|
159
168
|
fill: l + "80",
|
|
160
169
|
stroke: "#ffffff",
|
|
161
170
|
strokeWidth: 2,
|
|
@@ -205,26 +214,34 @@ const We = J(({ stage: n, stageColor: r }) => {
|
|
|
205
214
|
);
|
|
206
215
|
}
|
|
207
216
|
};
|
|
208
|
-
return /* @__PURE__ */ D(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
217
|
+
return /* @__PURE__ */ D(
|
|
218
|
+
bt,
|
|
219
|
+
{
|
|
220
|
+
x: n.position.x,
|
|
221
|
+
y: n.position.y,
|
|
222
|
+
rotation: t.rotation || 0,
|
|
223
|
+
children: [
|
|
224
|
+
I(),
|
|
225
|
+
d && /* @__PURE__ */ u(
|
|
226
|
+
Te,
|
|
227
|
+
{
|
|
228
|
+
text: t.label,
|
|
229
|
+
x: F,
|
|
230
|
+
y: C,
|
|
231
|
+
width: E,
|
|
232
|
+
height: t.height - C * 2,
|
|
233
|
+
fontSize: g,
|
|
234
|
+
fontStyle: "bold",
|
|
235
|
+
fill: "#ffffff",
|
|
236
|
+
align: "center",
|
|
237
|
+
verticalAlign: "middle",
|
|
238
|
+
wrap: "word",
|
|
239
|
+
ellipsis: !0
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
);
|
|
228
245
|
});
|
|
229
246
|
We.displayName = "ViewerStage";
|
|
230
247
|
const Pe = J(({ text: n }) => /* @__PURE__ */ u(
|
|
@@ -240,208 +257,199 @@ const Pe = J(({ text: n }) => /* @__PURE__ */ u(
|
|
|
240
257
|
}
|
|
241
258
|
));
|
|
242
259
|
Pe.displayName = "ViewerText";
|
|
243
|
-
const Xe = J(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
});
|
|
260
|
+
const Xe = J(
|
|
261
|
+
({
|
|
262
|
+
floors: n,
|
|
263
|
+
currentFloorId: r,
|
|
264
|
+
onFloorChange: t,
|
|
265
|
+
showAllOption: o,
|
|
266
|
+
allLabel: d,
|
|
267
|
+
position: l,
|
|
268
|
+
className: i
|
|
269
|
+
}) => {
|
|
270
|
+
const S = A(
|
|
271
|
+
() => [...n].sort((b, x) => b.order - x.order),
|
|
272
|
+
[n]
|
|
273
|
+
), s = {
|
|
274
|
+
position: "absolute",
|
|
275
|
+
display: "flex",
|
|
276
|
+
alignItems: "center",
|
|
277
|
+
gap: "8px",
|
|
278
|
+
padding: "8px 12px",
|
|
279
|
+
backgroundColor: "rgba(26, 26, 26, 0.95)",
|
|
280
|
+
borderRadius: "8px",
|
|
281
|
+
margin: "12px",
|
|
282
|
+
zIndex: 10,
|
|
283
|
+
...{
|
|
284
|
+
"top-left": { top: 0, left: 0 },
|
|
285
|
+
"top-right": { top: 0, right: 0 },
|
|
286
|
+
"bottom-left": { bottom: 0, left: 0 },
|
|
287
|
+
"bottom-right": { bottom: 0, right: 0 }
|
|
288
|
+
}[l]
|
|
289
|
+
}, a = {
|
|
290
|
+
padding: "10px 16px",
|
|
291
|
+
fontSize: "14px",
|
|
292
|
+
fontWeight: 500,
|
|
293
|
+
border: "1px solid #444",
|
|
294
|
+
borderRadius: "6px",
|
|
295
|
+
backgroundColor: "transparent",
|
|
296
|
+
color: "#fff",
|
|
297
|
+
cursor: "pointer",
|
|
298
|
+
transition: "all 0.2s ease",
|
|
299
|
+
minHeight: "44px",
|
|
300
|
+
touchAction: "manipulation"
|
|
301
|
+
}, f = {
|
|
302
|
+
...a,
|
|
303
|
+
backgroundColor: "#3A7DE5",
|
|
304
|
+
borderColor: "#3A7DE5"
|
|
305
|
+
};
|
|
306
|
+
return /* @__PURE__ */ D("div", { className: i, style: s, children: [
|
|
307
|
+
o && /* @__PURE__ */ u(
|
|
308
|
+
"button",
|
|
309
|
+
{
|
|
310
|
+
type: "button",
|
|
311
|
+
onClick: () => t(null),
|
|
312
|
+
style: r === null ? f : a,
|
|
313
|
+
children: d
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
S.map((b) => /* @__PURE__ */ u(
|
|
317
|
+
"button",
|
|
318
|
+
{
|
|
319
|
+
type: "button",
|
|
320
|
+
onClick: () => t(b.id),
|
|
321
|
+
style: r === b.id ? f : a,
|
|
322
|
+
children: b.name
|
|
323
|
+
},
|
|
324
|
+
b.id
|
|
325
|
+
))
|
|
326
|
+
] });
|
|
327
|
+
}
|
|
328
|
+
);
|
|
310
329
|
Xe.displayName = "FloorSelectorBar";
|
|
311
|
-
const Ye = J(
|
|
312
|
-
scale: n,
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
"
|
|
332
|
-
"
|
|
333
|
-
"
|
|
334
|
-
"
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
title: "Zoom Out",
|
|
378
|
-
children: "−"
|
|
379
|
-
}
|
|
380
|
-
)
|
|
381
|
-
] });
|
|
382
|
-
});
|
|
330
|
+
const Ye = J(
|
|
331
|
+
({ scale: n, minScale: r, maxScale: t, onZoomIn: o, onZoomOut: d, position: l, className: i }) => {
|
|
332
|
+
const p = {
|
|
333
|
+
position: "absolute",
|
|
334
|
+
display: "flex",
|
|
335
|
+
flexDirection: "column",
|
|
336
|
+
gap: "4px",
|
|
337
|
+
padding: "8px",
|
|
338
|
+
backgroundColor: "rgba(26, 26, 26, 0.95)",
|
|
339
|
+
borderRadius: "8px",
|
|
340
|
+
margin: "12px",
|
|
341
|
+
zIndex: 10,
|
|
342
|
+
...{
|
|
343
|
+
"top-left": { top: 0, left: 0 },
|
|
344
|
+
"top-right": { top: 0, right: 0 },
|
|
345
|
+
"bottom-left": { bottom: 0, left: 0 },
|
|
346
|
+
"bottom-right": { bottom: 0, right: 0 }
|
|
347
|
+
}[l]
|
|
348
|
+
}, s = {
|
|
349
|
+
width: "44px",
|
|
350
|
+
height: "44px",
|
|
351
|
+
minWidth: "44px",
|
|
352
|
+
minHeight: "44px",
|
|
353
|
+
fontSize: "22px",
|
|
354
|
+
fontWeight: "bold",
|
|
355
|
+
border: "1px solid #444",
|
|
356
|
+
borderRadius: "6px",
|
|
357
|
+
backgroundColor: "transparent",
|
|
358
|
+
color: "#fff",
|
|
359
|
+
cursor: "pointer",
|
|
360
|
+
display: "flex",
|
|
361
|
+
alignItems: "center",
|
|
362
|
+
justifyContent: "center",
|
|
363
|
+
transition: "all 0.2s ease",
|
|
364
|
+
touchAction: "manipulation"
|
|
365
|
+
}, a = {
|
|
366
|
+
...s,
|
|
367
|
+
opacity: 0.4,
|
|
368
|
+
cursor: "not-allowed"
|
|
369
|
+
}, f = n < t, b = n > r;
|
|
370
|
+
return /* @__PURE__ */ D("div", { className: i, style: p, children: [
|
|
371
|
+
/* @__PURE__ */ u(
|
|
372
|
+
"button",
|
|
373
|
+
{
|
|
374
|
+
type: "button",
|
|
375
|
+
onClick: o,
|
|
376
|
+
disabled: !f,
|
|
377
|
+
style: f ? s : a,
|
|
378
|
+
title: "Zoom In",
|
|
379
|
+
children: "+"
|
|
380
|
+
}
|
|
381
|
+
),
|
|
382
|
+
/* @__PURE__ */ u(
|
|
383
|
+
"button",
|
|
384
|
+
{
|
|
385
|
+
type: "button",
|
|
386
|
+
onClick: d,
|
|
387
|
+
disabled: !b,
|
|
388
|
+
style: b ? s : a,
|
|
389
|
+
title: "Zoom Out",
|
|
390
|
+
children: "−"
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
] });
|
|
394
|
+
}
|
|
395
|
+
);
|
|
383
396
|
Ye.displayName = "ZoomControls";
|
|
384
|
-
const Ae = J(
|
|
385
|
-
visible: n,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
/* @__PURE__ */ D("
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
o.price.toFixed(2)
|
|
397
|
+
const Ae = J(
|
|
398
|
+
({ visible: n, x: r, y: t, seat: o, currency: d, state: l }) => {
|
|
399
|
+
if (!n || !o) return null;
|
|
400
|
+
const i = o.seatNumber || (o.rowLabel && o.columnLabel ? `${o.rowLabel}-${o.columnLabel}` : "N/A"), S = {
|
|
401
|
+
position: "fixed",
|
|
402
|
+
left: `${r + 15}px`,
|
|
403
|
+
top: `${t + 15}px`,
|
|
404
|
+
zIndex: 1e3,
|
|
405
|
+
pointerEvents: "none"
|
|
406
|
+
}, p = {
|
|
407
|
+
backgroundColor: "rgba(26, 26, 26, 0.95)",
|
|
408
|
+
color: "#fff",
|
|
409
|
+
border: "1px solid #444",
|
|
410
|
+
borderRadius: "8px",
|
|
411
|
+
padding: "8px 12px",
|
|
412
|
+
fontSize: "13px",
|
|
413
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)",
|
|
414
|
+
minWidth: "140px"
|
|
415
|
+
}, s = {
|
|
416
|
+
color: "#9ca3af",
|
|
417
|
+
marginRight: "4px"
|
|
418
|
+
}, a = {
|
|
419
|
+
fontWeight: 600
|
|
420
|
+
}, f = {
|
|
421
|
+
color: "#4ade80",
|
|
422
|
+
fontWeight: 600
|
|
423
|
+
}, b = {
|
|
424
|
+
fontSize: "11px",
|
|
425
|
+
color: "#6b7280",
|
|
426
|
+
textTransform: "capitalize",
|
|
427
|
+
marginTop: "4px"
|
|
428
|
+
};
|
|
429
|
+
return /* @__PURE__ */ u("div", { style: S, children: /* @__PURE__ */ D("div", { style: p, children: [
|
|
430
|
+
o.sectionName && /* @__PURE__ */ D("div", { style: { marginBottom: "4px" }, children: [
|
|
431
|
+
/* @__PURE__ */ u("span", { style: s, children: "Section:" }),
|
|
432
|
+
/* @__PURE__ */ u("span", { style: { ...a, color: "#3b82f6" }, children: o.sectionName })
|
|
433
|
+
] }),
|
|
434
|
+
/* @__PURE__ */ D("div", { style: { marginBottom: "4px" }, children: [
|
|
435
|
+
/* @__PURE__ */ u("span", { style: s, children: "Seat:" }),
|
|
436
|
+
/* @__PURE__ */ u("span", { style: a, children: i })
|
|
437
|
+
] }),
|
|
438
|
+
o.price !== void 0 && o.price > 0 && l === "available" && /* @__PURE__ */ D("div", { style: { marginBottom: "4px" }, children: [
|
|
439
|
+
/* @__PURE__ */ u("span", { style: s, children: "Price:" }),
|
|
440
|
+
/* @__PURE__ */ D("span", { style: f, children: [
|
|
441
|
+
d,
|
|
442
|
+
" ",
|
|
443
|
+
o.price.toFixed(2)
|
|
444
|
+
] })
|
|
445
|
+
] }),
|
|
446
|
+
/* @__PURE__ */ D("div", { style: b, children: [
|
|
447
|
+
"Status: ",
|
|
448
|
+
l
|
|
437
449
|
] })
|
|
438
|
-
] })
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
l
|
|
442
|
-
] })
|
|
443
|
-
] }) });
|
|
444
|
-
});
|
|
450
|
+
] }) });
|
|
451
|
+
}
|
|
452
|
+
);
|
|
445
453
|
Ae.displayName = "SeatTooltip";
|
|
446
454
|
const Nt = ({
|
|
447
455
|
config: n,
|
|
@@ -481,9 +489,14 @@ const Nt = ({
|
|
|
481
489
|
// Touch gestures
|
|
482
490
|
touchEnabled: Ve = !0
|
|
483
491
|
}) => {
|
|
484
|
-
const Re = l !== void 0 ? l : d, fe = X(null), Me = X(null), T = wt(Me), [q, Ee] = k(
|
|
485
|
-
|
|
486
|
-
}, [
|
|
492
|
+
const Re = l !== void 0 ? l : d, fe = X(null), Me = X(null), T = wt(Me), [q, Ee] = k(
|
|
493
|
+
/* @__PURE__ */ new Set()
|
|
494
|
+
), [N, Q] = k(1), [P, V] = k({ x: 0, y: 0 }), [Oe, je] = k(null), [_e, qe] = k(1), se = X({ width: 0, height: 0 }), [ee, Ie] = k({ visible: !1, x: 0, y: 0, seat: null, state: "available" }), { config: Ze, loading: Ge, error: te } = xt(r), h = n || Ze, ge = t !== void 0, $ = ge ? t || null : Oe, ae = S !== void 0, Ke = z(
|
|
495
|
+
(e) => {
|
|
496
|
+
ge || je(e), o?.(e);
|
|
497
|
+
},
|
|
498
|
+
[ge, o]
|
|
499
|
+
), pe = h?.floors || [], Je = R !== void 0 ? R : pe.length > 1, ce = A(
|
|
487
500
|
() => h ? { ...h.colors, ...b } : { ...Rt, ...b },
|
|
488
501
|
[h, b]
|
|
489
502
|
), Z = A(() => {
|
|
@@ -512,19 +525,34 @@ const Nt = ({
|
|
|
512
525
|
}, [h, Z, le, de]);
|
|
513
526
|
B(() => {
|
|
514
527
|
if (!Y || !h || !H || T.width === 0 || T.height === 0) return;
|
|
515
|
-
const e = Math.abs(
|
|
528
|
+
const e = Math.abs(
|
|
529
|
+
T.width - se.current.width
|
|
530
|
+
), c = Math.abs(
|
|
531
|
+
T.height - se.current.height
|
|
532
|
+
);
|
|
516
533
|
if (!(se.current.width === 0) && e < 10 && c < 10) return;
|
|
517
534
|
se.current = T;
|
|
518
535
|
const y = T.width, w = T.height, m = y - _ * 2, j = w - _ * 2, K = m / H.width, ve = j / H.height, he = Math.min(K, ve, U), ct = H.minX + H.width / 2, lt = H.minY + H.height / 2, dt = y / 2, ht = w / 2, ut = dt - ct * he, ft = ht - lt * he;
|
|
519
536
|
Q(he), V({ x: ut, y: ft }), qe(he);
|
|
520
|
-
}, [
|
|
537
|
+
}, [
|
|
538
|
+
Y,
|
|
539
|
+
h,
|
|
540
|
+
H,
|
|
541
|
+
_,
|
|
542
|
+
U,
|
|
543
|
+
T,
|
|
544
|
+
$
|
|
545
|
+
]);
|
|
521
546
|
const O = A(() => {
|
|
522
547
|
const e = new Set(Re), c = new Set(i), v = new Set(p);
|
|
523
548
|
return { reserved: e, unavailable: c, myReserved: v };
|
|
524
|
-
}, [Re, i, p]), be = A(() => S ? new Set(S) : null, [S]), ne = z(
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
549
|
+
}, [Re, i, p]), be = A(() => S ? new Set(S) : null, [S]), ne = z(
|
|
550
|
+
(e) => {
|
|
551
|
+
const c = e.id, v = e.seatNumber || "";
|
|
552
|
+
return O.unavailable.has(c) || O.unavailable.has(v) ? "unavailable" : O.reserved.has(c) || O.reserved.has(v) ? "reserved" : O.myReserved.has(c) || O.myReserved.has(v) || q.has(c) ? "selected" : e.state;
|
|
553
|
+
},
|
|
554
|
+
[O, q]
|
|
555
|
+
);
|
|
528
556
|
B(() => {
|
|
529
557
|
h && E && E(h);
|
|
530
558
|
}, [h, E]), B(() => {
|
|
@@ -532,16 +560,25 @@ const Nt = ({
|
|
|
532
560
|
}, [te, F]), B(() => {
|
|
533
561
|
ae && be && Ee(be);
|
|
534
562
|
}, [ae, be]);
|
|
535
|
-
const Qe = z(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
563
|
+
const Qe = z(
|
|
564
|
+
(e) => {
|
|
565
|
+
const c = ne(e);
|
|
566
|
+
if (c !== "available" && c !== "selected")
|
|
567
|
+
return;
|
|
568
|
+
const v = q.has(e.id);
|
|
569
|
+
ae || Ee((y) => {
|
|
570
|
+
const w = new Set(y);
|
|
571
|
+
return v ? w.delete(e.id) : w.add(e.id), w;
|
|
572
|
+
}), v ? a?.(e) : (s?.(e), s || console.log("Seat selected:", e));
|
|
573
|
+
},
|
|
574
|
+
[
|
|
575
|
+
ne,
|
|
576
|
+
q,
|
|
577
|
+
ae,
|
|
578
|
+
s,
|
|
579
|
+
a
|
|
580
|
+
]
|
|
581
|
+
), re = A(() => h ? Z.filter((e) => q.has(e.id)) : [], [Z, q]);
|
|
545
582
|
B(() => {
|
|
546
583
|
f?.(re);
|
|
547
584
|
}, [re, f]);
|
|
@@ -558,7 +595,15 @@ const Nt = ({
|
|
|
558
595
|
y: w - m.y * e
|
|
559
596
|
});
|
|
560
597
|
}
|
|
561
|
-
}, [
|
|
598
|
+
}, [
|
|
599
|
+
g,
|
|
600
|
+
N,
|
|
601
|
+
ie,
|
|
602
|
+
U,
|
|
603
|
+
T,
|
|
604
|
+
h,
|
|
605
|
+
P
|
|
606
|
+
]), tt = z(() => {
|
|
562
607
|
if (!g) return;
|
|
563
608
|
const e = Math.max(N - ie, G);
|
|
564
609
|
if (e !== N) {
|
|
@@ -571,27 +616,38 @@ const Nt = ({
|
|
|
571
616
|
y: w - m.y * e
|
|
572
617
|
});
|
|
573
618
|
}
|
|
574
|
-
}, [
|
|
619
|
+
}, [
|
|
620
|
+
g,
|
|
621
|
+
N,
|
|
622
|
+
ie,
|
|
623
|
+
G,
|
|
624
|
+
T,
|
|
625
|
+
h,
|
|
626
|
+
P
|
|
627
|
+
]), nt = z((e) => {
|
|
575
628
|
V({
|
|
576
629
|
x: e.target.x(),
|
|
577
630
|
y: e.target.y()
|
|
578
631
|
});
|
|
579
|
-
}, []), rt = z(
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
632
|
+
}, []), rt = z(
|
|
633
|
+
(e) => {
|
|
634
|
+
if (!g) return;
|
|
635
|
+
e.evt.preventDefault();
|
|
636
|
+
const c = fe.current;
|
|
637
|
+
if (!c) return;
|
|
638
|
+
const v = c.scaleX(), y = c.getPointerPosition();
|
|
639
|
+
if (!y) return;
|
|
640
|
+
const w = 1.1, m = e.evt.deltaY > 0 ? v / w : v * w, j = Math.min(Math.max(m, G), U), K = {
|
|
641
|
+
x: (y.x - P.x) / v,
|
|
642
|
+
y: (y.y - P.y) / v
|
|
643
|
+
}, ve = {
|
|
644
|
+
x: y.x - K.x * j,
|
|
645
|
+
y: y.y - K.y * j
|
|
646
|
+
};
|
|
647
|
+
Q(j), V(ve);
|
|
648
|
+
},
|
|
649
|
+
[g, P, G, U]
|
|
650
|
+
);
|
|
595
651
|
Ct(fe, {
|
|
596
652
|
enabled: Ve && g,
|
|
597
653
|
minScale: G,
|
|
@@ -605,21 +661,24 @@ const Nt = ({
|
|
|
605
661
|
V(e);
|
|
606
662
|
}
|
|
607
663
|
});
|
|
608
|
-
const ot = z(
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
664
|
+
const ot = z(
|
|
665
|
+
(e, c) => {
|
|
666
|
+
if (!x) return;
|
|
667
|
+
const v = c.target.getStage();
|
|
668
|
+
if (!v) return;
|
|
669
|
+
const y = v.getPointerPosition();
|
|
670
|
+
if (!y) return;
|
|
671
|
+
const w = v.container().getBoundingClientRect();
|
|
672
|
+
Ie({
|
|
673
|
+
visible: !0,
|
|
674
|
+
x: w.left + y.x,
|
|
675
|
+
y: w.top + y.y,
|
|
676
|
+
seat: e,
|
|
677
|
+
state: ne(e)
|
|
678
|
+
});
|
|
679
|
+
},
|
|
680
|
+
[x, ne]
|
|
681
|
+
), it = z(() => {
|
|
623
682
|
Ie((e) => ({ ...e, visible: !1 }));
|
|
624
683
|
}, []);
|
|
625
684
|
if (Ge)
|
|
@@ -664,7 +723,10 @@ const Nt = ({
|
|
|
664
723
|
draggable: !0,
|
|
665
724
|
onDragEnd: nt,
|
|
666
725
|
onWheel: rt,
|
|
667
|
-
style: {
|
|
726
|
+
style: {
|
|
727
|
+
backgroundColor: h.canvas.backgroundColor,
|
|
728
|
+
cursor: "grab"
|
|
729
|
+
},
|
|
668
730
|
children: [
|
|
669
731
|
/* @__PURE__ */ u(ye, { listening: !1, children: le.map((e) => /* @__PURE__ */ u(
|
|
670
732
|
We,
|
|
@@ -770,7 +832,13 @@ const ue = {
|
|
|
770
832
|
unavailableSeats: []
|
|
771
833
|
};
|
|
772
834
|
function Et(n) {
|
|
773
|
-
const {
|
|
835
|
+
const {
|
|
836
|
+
seatMapId: r,
|
|
837
|
+
currentUserId: t,
|
|
838
|
+
enabled: o = !0,
|
|
839
|
+
onStateChange: d,
|
|
840
|
+
onError: l
|
|
841
|
+
} = n, i = X({ ...ue }), S = X(d), p = X(l), s = X(t);
|
|
774
842
|
S.current = d, p.current = l, s.current = t;
|
|
775
843
|
const a = z(
|
|
776
844
|
(g) => {
|
|
@@ -788,8 +856,14 @@ function Et(n) {
|
|
|
788
856
|
}
|
|
789
857
|
const C = xe(), E = Se(C, `seatmaps/${r}/seat_states`);
|
|
790
858
|
return Ne(E, (I) => {
|
|
791
|
-
const L = I.val() || {}, W = Mt(
|
|
792
|
-
|
|
859
|
+
const L = I.val() || {}, W = Mt(
|
|
860
|
+
L,
|
|
861
|
+
s.current
|
|
862
|
+
), Y = i.current;
|
|
863
|
+
(Y.loading || !me(Y.myReservedSeats, W.myReserved) || !me(
|
|
864
|
+
Y.otherReservedSeats,
|
|
865
|
+
W.otherReserved
|
|
866
|
+
) || !me(Y.unavailableSeats, W.unavailable)) && (i.current = {
|
|
793
867
|
states: L,
|
|
794
868
|
loading: !1,
|
|
795
869
|
error: null,
|
|
@@ -810,7 +884,11 @@ function Et(n) {
|
|
|
810
884
|
},
|
|
811
885
|
[r, o]
|
|
812
886
|
// Don't include currentUserId - we use currentUserIdRef.current which is always up-to-date
|
|
813
|
-
), f = z(() => i.current, []), b = z(() => ue, []), x = gt(
|
|
887
|
+
), f = z(() => i.current, []), b = z(() => ue, []), x = gt(
|
|
888
|
+
a,
|
|
889
|
+
f,
|
|
890
|
+
b
|
|
891
|
+
);
|
|
814
892
|
return {
|
|
815
893
|
states: x.states,
|
|
816
894
|
loading: x.loading,
|
|
@@ -835,7 +913,11 @@ function It(n) {
|
|
|
835
913
|
const g = z(async () => {
|
|
836
914
|
if (!r) return;
|
|
837
915
|
if (!we()) {
|
|
838
|
-
f(
|
|
916
|
+
f(
|
|
917
|
+
new Error(
|
|
918
|
+
"Firebase not initialized. Call initializeFirebaseForViewer first."
|
|
919
|
+
)
|
|
920
|
+
), s(!1);
|
|
839
921
|
return;
|
|
840
922
|
}
|
|
841
923
|
const C = xe(), E = Se(C, `seatmaps/${r}`);
|