tessitura-seatmap
Version:
Tessitura-integrated seatmap components, built with React and Mantine (includes SYOS).
866 lines (865 loc) • 27.3 kB
JavaScript
var Ee = Object.defineProperty;
var ue = (n) => {
throw TypeError(n);
};
var Re = (n, t, a) => t in n ? Ee(n, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[t] = a;
var O = (n, t, a) => Re(n, typeof t != "symbol" ? t + "" : t, a), de = (n, t, a) => t.has(n) || ue("Cannot " + a);
var $ = (n, t, a) => (de(n, t, "read from private field"), a ? a.call(n) : t.get(n)), oe = (n, t, a) => t.has(n) ? ue("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, a), fe = (n, t, a, d) => (de(n, t, "write to private field"), d ? d.call(n, a) : t.set(n, a), a);
import _e, { useState as j, useEffect as ne, useMemo as re } from "react";
import { SeatmapAccordion as Te } from "react-svg-seatmap";
import { createTheme as ye, MantineProvider as xe, Tabs as C, Menu as ie, Button as le, Flex as ce, Title as pe, Text as te, Modal as Pe, Skeleton as Ie, Space as ke } from "@mantine/core";
import { Notifications as Ne, notifications as me } from "@mantine/notifications";
import { IconChevronUp as Ae, IconChevronDown as $e, IconShoppingCart as he } from "@tabler/icons-react";
var ee = { exports: {} }, H = {};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Se;
function Ce() {
if (Se) return H;
Se = 1;
var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
function a(d, f, u) {
var S = null;
if (u !== void 0 && (S = "" + u), f.key !== void 0 && (S = "" + f.key), "key" in f) {
u = {};
for (var m in f)
m !== "key" && (u[m] = f[m]);
} else u = f;
return f = u.ref, {
$$typeof: n,
type: d,
key: S,
ref: f !== void 0 ? f : null,
props: u
};
}
return H.Fragment = t, H.jsx = a, H.jsxs = a, H;
}
var J = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var be;
function Oe() {
return be || (be = 1, process.env.NODE_ENV !== "production" && function() {
function n(e) {
if (e == null) return null;
if (typeof e == "function")
return e.$$typeof === v ? null : e.displayName || e.name || null;
if (typeof e == "string") return e;
switch (e) {
case A:
return "Fragment";
case P:
return "Profiler";
case F:
return "StrictMode";
case l:
return "Suspense";
case L:
return "SuspenseList";
case X:
return "Activity";
}
if (typeof e == "object")
switch (typeof e.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), e.$$typeof) {
case x:
return "Portal";
case g:
return (e.displayName || "Context") + ".Provider";
case k:
return (e._context.displayName || "Context") + ".Consumer";
case I:
var r = e.render;
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
case U:
return r = e.displayName || null, r !== null ? r : n(e.type) || "Memo";
case M:
r = e._payload, e = e._init;
try {
return n(e(r));
} catch {
}
}
return null;
}
function t(e) {
return "" + e;
}
function a(e) {
try {
t(e);
var r = !1;
} catch {
r = !0;
}
if (r) {
r = console;
var c = r.error, p = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
return c.call(
r,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
p
), t(e);
}
}
function d(e) {
if (e === A) return "<>";
if (typeof e == "object" && e !== null && e.$$typeof === M)
return "<...>";
try {
var r = n(e);
return r ? "<" + r + ">" : "<...>";
} catch {
return "<...>";
}
}
function f() {
var e = G.A;
return e === null ? null : e.getOwner();
}
function u() {
return Error("react-stack-top-frame");
}
function S(e) {
if (z.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning) return !1;
}
return e.key !== void 0;
}
function m(e, r) {
function c() {
K || (K = !0, console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
r
));
}
c.isReactWarning = !0, Object.defineProperty(e, "key", {
get: c,
configurable: !0
});
}
function _() {
var e = n(this.type);
return V[e] || (V[e] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), e = this.props.ref, e !== void 0 ? e : null;
}
function b(e, r, c, p, R, w, Y, se) {
return c = w.ref, e = {
$$typeof: D,
type: e,
key: r,
props: w,
_owner: R
}, (c !== void 0 ? c : null) !== null ? Object.defineProperty(e, "ref", {
enumerable: !1,
get: _
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(e, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.defineProperty(e, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: Y
}), Object.defineProperty(e, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: se
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
}
function E(e, r, c, p, R, w, Y, se) {
var T = r.children;
if (T !== void 0)
if (p)
if (Q(T)) {
for (p = 0; p < T.length; p++)
y(T[p]);
Object.freeze && Object.freeze(T);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else y(T);
if (z.call(r, "key")) {
T = n(e);
var W = Object.keys(r).filter(function(we) {
return we !== "key";
});
p = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", i[T + p] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,
p,
T,
W,
T
), i[T + p] = !0);
}
if (T = null, c !== void 0 && (a(c), T = "" + c), S(r) && (a(r.key), T = "" + r.key), "key" in r) {
c = {};
for (var ae in r)
ae !== "key" && (c[ae] = r[ae]);
} else c = r;
return T && m(
c,
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
), b(
e,
T,
w,
R,
f(),
c,
Y,
se
);
}
function y(e) {
typeof e == "object" && e !== null && e.$$typeof === D && e._store && (e._store.validated = 1);
}
var h = _e, D = Symbol.for("react.transitional.element"), x = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), F = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), g = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), U = Symbol.for("react.memo"), M = Symbol.for("react.lazy"), X = Symbol.for("react.activity"), v = Symbol.for("react.client.reference"), G = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, Q = Array.isArray, Z = console.createTask ? console.createTask : function() {
return null;
};
h = {
"react-stack-bottom-frame": function(e) {
return e();
}
};
var K, V = {}, q = h["react-stack-bottom-frame"].bind(
h,
u
)(), o = Z(d(u)), i = {};
J.Fragment = A, J.jsx = function(e, r, c, p, R) {
var w = 1e4 > G.recentlyCreatedOwnerStacks++;
return E(
e,
r,
c,
!1,
p,
R,
w ? Error("react-stack-top-frame") : q,
w ? Z(d(e)) : o
);
}, J.jsxs = function(e, r, c, p, R) {
var w = 1e4 > G.recentlyCreatedOwnerStacks++;
return E(
e,
r,
c,
!0,
p,
R,
w ? Error("react-stack-top-frame") : q,
w ? Z(d(e)) : o
);
};
}()), J;
}
var ge;
function De() {
return ge || (ge = 1, process.env.NODE_ENV === "production" ? ee.exports = Ce() : ee.exports = Oe()), ee.exports;
}
var s = De(), B, N;
class ve {
constructor(t) {
oe(this, B);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
oe(this, N, async (t) => {
const a = await fetch(`${$(this, B)}/${t}`);
if (!a.ok)
throw new Error(`Error fetching data: ${a.statusText}`);
return a.json();
});
O(this, "getPerformanceDetails", async (t) => $(this, N).call(this, `TXN/Performances/${t}`));
O(this, "getPerformanceSeats", async (t, a, d) => $(this, N).call(this, `TXN/Performances/${t}/Seats?constituentId=${a}&modeOfSaleId=${d}&performanceId=${t}`));
O(this, "getZoneAvailability", async (t) => $(this, N).call(this, `TXN/Performances/ZoneAvailabilities?performanceIds=${t}`));
O(this, "getPerformancePriceTypes", async (t, a, d) => $(this, N).call(this, `TXN/Performances/Prices?modeOfSaleId=${a}&performanceIds=${t}&sourceId=${d}`));
O(this, "getPriceTypeDetails", async (t, a, d) => $(this, N).call(this, `TXN/PriceTypes/Details?modeOfSaleId=${a}&performanceIds=${t}&sourceId=${d}`));
O(this, "getFacilityScreens", async (t) => $(this, N).call(this, `TXN/Facilities/${t}/Screens`));
O(this, "getSeatStatuses", async () => $(this, N).call(this, "ReferenceData/SeatStatuses"));
fe(this, B, t);
}
}
B = new WeakMap(), N = new WeakMap();
const je = (n) => {
const t = [
"#5a8ef7",
"#de5472",
"#9b98e5",
"#f8d376",
"#e89171",
"#72a588",
"#abd0f1",
"#61d4a4",
"#f7b7a3",
"#b5ead7",
"#ffdac1",
"#c7ceea",
"#ffb7b2",
"#b2f7ef",
"#f6abb6",
"#b5ead7",
"#c9cba3",
"#ffe156",
"#6a0572",
"#ab83a1",
"#f67280",
"#355c7d",
"#99b898",
"#f8b195",
"#f6cd61",
"#3ec300",
"#f9d423",
"#e27d60",
"#85dcb0",
"#e8a87c",
"#c38d9e",
"#41b3a3",
"#f38181",
"#a8e063",
"#f7cac9",
"#92a8d1",
"#f9b7b7",
"#b8a9c9",
"#ffb347",
"#b2d7e4"
];
return t[n % t.length];
}, Ve = ({
endpoint: n,
performanceId: t,
svg: a,
constituentId: d,
modeOfSaleId: f
}) => {
const [, u] = j(null), S = [
"allocations",
"screens",
"sections",
"zones",
"holds",
"seatType",
"stairs"
], [m, _] = j(
"allocations"
), [b, E] = j({}), [y, h] = j(!0);
ne(() => {
const P = async () => {
try {
console.log("Fetching data...");
const g = new ve(n), I = t.toString(), l = await g.getPerformanceSeats(
I,
d,
f
);
return h(!1), l;
} catch (g) {
console.error("Error fetching data:", g);
}
}, k = (g) => {
const I = {
allocations: "SeatStatusId",
screens: "ScreenId",
sections: "SectionId",
zones: "ZoneId",
holds: "HoldCodeId",
seatType: "SeatTypeId",
stairs: "HasStairs"
}, l = {};
for (const L of S) {
const U = I[L || "allocations"], M = g.map((v) => ({
id: v.Id,
cssSelector: `#seat-${v.SeatNumber}-${v.SeatRow.replace(
"*",
"_"
)}-${v.ScreenId}`,
displayGroup: U === "HasStairs" ? v.HasStairs ? "Has Stairs" : "No Stairs" : v[U].toString()
})), X = M.reduce((v, G) => {
const z = G.displayGroup;
return v[z] || (v[z] = je(Object.keys(v).length)), v;
}, {});
l[L] = {
seats: M,
groupMapping: X
};
}
E(l);
};
P().then((g) => {
k(g), console.log("Finished fetching data");
});
}, [d, n, f, t, S]);
const { seatData: D, displayGroupMapping: x } = re(() => {
var g, I;
const P = ((g = b[m || "allocations"]) == null ? void 0 : g.seats) || [], k = ((I = b[m || "allocations"]) == null ? void 0 : I.groupMapping) || {};
return { seatData: P, displayGroupMapping: k };
}, [b, m]), A = ye({}), F = re(() => {
const P = (k, g) => {
u(g ? k : null);
};
return /* @__PURE__ */ s.jsx(
Te,
{
svg: a,
seats: y ? [] : D,
onClick: P,
displayGroupMapping: x
}
);
}, [x, y, D, a]);
return /* @__PURE__ */ s.jsxs(xe, { theme: A, children: [
/* @__PURE__ */ s.jsx(
C,
{
variant: "outline",
value: m,
onChange: (P) => _(
P
),
children: /* @__PURE__ */ s.jsxs(C.List, { justify: "flex-end", children: [
/* @__PURE__ */ s.jsx(C.Tab, { value: "allocations", children: "Availability" }),
/* @__PURE__ */ s.jsx(C.Tab, { value: "screens", children: "Screens" }),
/* @__PURE__ */ s.jsx(C.Tab, { value: "sections", children: "Sections" }),
/* @__PURE__ */ s.jsx(C.Tab, { value: "zones", children: "Zones" }),
/* @__PURE__ */ s.jsx(C.Tab, { value: "holds", children: "Holds" }),
/* @__PURE__ */ s.jsx(C.Tab, { value: "seatType", children: "Seat Type" }),
/* @__PURE__ */ s.jsx(C.Tab, { value: "stairs", children: "Stairs" })
] })
}
),
F
] });
}, Fe = (n, t, a, d) => {
const [f, u] = j(!0), [S, m] = j(null), [_, b] = j(
[]
);
return ne(() => {
(async () => {
try {
console.log("Fetching data...");
const y = await fetch(
`${n}/TXN/Performances/${t}/Seats?constituentId=${a}&modeOfSaleId=${d}&performanceId=${t}`
);
if (!y.ok)
throw new Error("Failed to fetch data");
const h = await y.json();
return console.log("Finished fetching data"), h || [];
} catch (y) {
u(!1), m("Failed to fetch data"), console.error(y);
}
})().then((y) => {
b(y), u(!1);
});
}, [a, n, d, t]), { loading: f, data: _, error: S };
}, Me = (n) => n.filter((t) => t.SeatStatusId === 0).map((t) => ({
id: t.Id,
// name: seat.SeatNumber,
available: t.AllocationId === 0,
displayGroup: t.ZoneId.toString(),
selectionGroups: {
row: { value: t.SeatRow, parent: "section" },
section: t.ScreenId.toString()
},
cssSelector: `#seat-${t.SeatNumber}-${t.SeatRow.replace(
"*",
"_"
)}-${t.ScreenId}`
})), Ge = (n) => {
const [t, a] = j();
ne(() => {
(async () => {
try {
if (!n) return;
const u = await fetch(n);
if (!u.ok)
throw new Error("Network response was not ok");
const S = await u.json(), m = d(S.facilities);
console.log("Mapped seat images:", m), a(m);
} catch (u) {
console.error("Error fetching seat images:", u);
}
})();
}, [n]);
const d = (f) => f.flatMap(
(u) => u.seat_images.reduce((S, m) => {
const _ = m.split("/").pop(), b = _ == null ? void 0 : _.split("seat");
if (!b)
return console.error("Invalid file name format:", _), S;
const E = b[b.length - 1].split("-");
return E.length < 4 ? (console.error("Invalid seat information format:", E), S) : [
{
url: m,
facilityId: u.facility_no,
screenId: parseInt(E[3], 10),
rowName: E[2],
seatName: E[1]
},
...S
];
}, [])
);
return {
seatImages: t
};
}, ze = ({
performanceName: n,
performanceDate: t
}) => {
const [a, d] = j(!1), f = (u, S, m) => /* @__PURE__ */ s.jsxs(ce, { gap: 20, align: "center", children: [
/* @__PURE__ */ s.jsx(
"svg",
{
viewBox: "0 0 18 18",
xmlns: "http://www.w3.org/2000/svg",
style: {
width: "18px",
height: "18px"
},
children: /* @__PURE__ */ s.jsx(
"circle",
{
cx: "9",
cy: "9",
r: "6",
style: {
strokeWidth: "5px",
stroke: m,
fill: S
}
}
)
}
),
/* @__PURE__ */ s.jsx(te, { size: "sm", children: u })
] });
return /* @__PURE__ */ s.jsxs(ie, { opened: a, position: "bottom-end", offset: 0, withinPortal: !1, children: [
/* @__PURE__ */ s.jsx(ie.Target, { children: /* @__PURE__ */ s.jsx(
le,
{
variant: "white",
color: "black",
size: "xs",
rightSection: a ? /* @__PURE__ */ s.jsx(Ae, { size: 14 }) : /* @__PURE__ */ s.jsx($e, { size: 14 }),
onClick: () => d((u) => !u),
children: "See details"
}
) }),
/* @__PURE__ */ s.jsxs(ie.Dropdown, { style: { zIndex: 0 }, children: [
/* @__PURE__ */ s.jsxs(ce, { direction: "column", gap: 10, p: "md", maw: "275px", children: [
/* @__PURE__ */ s.jsx(pe, { order: 2, size: "xl", textWrap: "balance", children: n }),
/* @__PURE__ */ s.jsx(pe, { order: 3, size: "sm", textWrap: "balance", children: t })
] }),
/* @__PURE__ */ s.jsxs(
ce,
{
direction: "column",
gap: 10,
p: "md",
maw: "275px",
style: { borderTop: "1px solid #cecece" },
children: [
f("Available", "#fff", "#9b98e5"),
f("Selected", "#9b98e5", "#9b98e5"),
f("Not available", "#bfbfbf", "#bfbfbf")
]
}
)
] })
] });
}, qe = ({
endpoint: n,
performanceId: t,
facilityId: a,
svg: d,
viewFromSeat: f,
constituentId: u,
modeOfSaleId: S,
sourceId: m
}) => {
var V, q;
const [_, b] = j(!1), [E, y] = j([]), [h, D] = j(null), { data: x, loading: A } = Fe(
n,
t,
u,
S
), { seatImages: F } = Ge(f), [P, k] = j(!0), [g, I] = j(""), [l, L] = j(null);
ne(() => {
(async () => {
try {
const i = new ve(n), e = t.toString(), r = [
i.getPerformanceDetails(e),
i.getZoneAvailability(e),
i.getPerformancePriceTypes(
e,
S,
m
),
i.getPriceTypeDetails(
e,
S,
m
),
i.getFacilityScreens(a.toString())
];
Promise.all(r).then(
([
c,
p,
R,
w,
Y
]) => {
L({
performanceDetails: c,
zoneAvailability: p,
performancePrices: R,
priceTypeDetails: w,
facilityScreens: Y
});
}
);
} catch (i) {
console.error("Error fetching data:", i);
}
})();
}, [n, t, x]);
const U = (o) => {
if (l && l.performancePrices) {
const i = x.find(
(r) => r.Id === o
);
return l.performancePrices.filter(
(r) => r.ZoneId === (i == null ? void 0 : i.ZoneId) && r.Enabled === !0
);
}
return null;
}, M = (o) => {
const i = x.find(
(e) => e.Id === o
);
if (i) {
const e = F == null ? void 0 : F.filter(
(p) => p.facilityId === a.toString() && p.screenId === i.ScreenId && p.rowName === i.SeatRow
);
if (console.log("imagesInRow", e), (e == null ? void 0 : e.length) === 0)
return null;
const r = parseInt(i.SeatNumber), c = e == null ? void 0 : e.reduce(function(p, R) {
const w = parseInt(R.seatName), Y = parseInt(p.seatName);
return Math.abs(w - r) < Math.abs(Y - r) ? R : p;
});
return c ? c.url : null;
}
}, X = (o, i) => {
D({
id: o,
action: i ? "selecting" : "deselecting"
}), b(!0), k(!0);
}, v = (o, i) => /* @__PURE__ */ s.jsxs("div", { className: "price-types__selector", children: [
/* @__PURE__ */ s.jsxs("div", { className: "price-types__description", children: [
/* @__PURE__ */ s.jsx(te, { children: o }),
/* @__PURE__ */ s.jsx(te, { fw: 700, children: i.toLocaleString("en-US", {
style: "currency",
currency: "USD"
}) })
] }),
/* @__PURE__ */ s.jsx("div", { className: "price-types__action", children: /* @__PURE__ */ s.jsx(
le,
{
variant: "outline",
color: "black",
loading: g === o,
onClick: () => {
h && (y((e) => [...e, h.id]), I(o), setTimeout(() => {
I(""), b(!1);
const e = x.find(
(r) => r.Id === h.id
);
if (e) {
const r = l == null ? void 0 : l.facilityScreens.Screens.find(
(c) => c.Id === (e == null ? void 0 : e.ScreenId)
);
me.show({
title: "Added to cart",
message: `${r ? r.Description.toUpperCase() + ", " : ""}Seat ${e.SeatNumber}, Row ${e.SeatRow}, ${o}`,
position: "top-right",
icon: /* @__PURE__ */ s.jsx(he, { size: "1rem" }),
autoClose: 1e4
});
}
}, 2e3));
},
children: "Select"
}
) })
] }), G = () => {
if (h) {
const o = x.find(
(i) => i.Id === h.id
);
if (l && l.facilityScreens) {
const i = l.facilityScreens.Screens.find(
(r) => r.Id === (o == null ? void 0 : o.ScreenId)
);
return `${i == null ? void 0 : i.Description.toUpperCase()}, Row ${o == null ? void 0 : o.SeatRow}, Seat ${o == null ? void 0 : o.SeatNumber}`;
}
return `Row ${o == null ? void 0 : o.SeatRow}, Seat ${o == null ? void 0 : o.SeatNumber}`;
}
}, z = () => {
if (h) {
if (h.action === "selecting") {
const o = U(h.id);
if (!o) return null;
const i = M(h.id);
return /* @__PURE__ */ s.jsxs("div", { className: "seat-details", children: [
i && /* @__PURE__ */ s.jsx("div", { className: "view-from-seat", children: /* @__PURE__ */ s.jsx(
Ie,
{
visible: P,
className: "view-from-seat__skeleton",
children: /* @__PURE__ */ s.jsx(
"img",
{
src: i,
alt: `View from seat ${h.id}`,
className: "view-from-seat__image",
onLoad: () => k(!1)
}
)
}
) }),
/* @__PURE__ */ s.jsx("div", { className: "price-types", children: o.map((e) => {
const r = l == null ? void 0 : l.priceTypeDetails.find(
(c) => c.PriceTypeId === e.PriceTypeId
);
return r ? v(
r.AliasDescription,
e.Price
) : null;
}) })
] });
} else if (h.action === "deselecting")
return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
/* @__PURE__ */ s.jsx(te, { size: "sm", children: "You have already selected this seat." }),
/* @__PURE__ */ s.jsx(ke, { h: "md" }),
/* @__PURE__ */ s.jsx(
le,
{
color: "black",
onClick: () => {
y(
(o) => o.filter((i) => i !== h.id)
), b(!1), me.show({
title: "Removed from cart",
color: "red",
message: `Seat ${h.id} has been removed from your cart.`,
position: "top-right",
icon: /* @__PURE__ */ s.jsx(he, { size: "1rem" }),
autoClose: 1e4
});
},
children: "Remove Seat"
}
)
] });
}
return null;
}, Q = re(() => {
if (A || !x)
return [];
const o = Me(x);
return console.log(o), o;
}, [x]), Z = re(() => A || !x ? {} : Q.reduce((i, e) => {
const r = e.displayGroup;
return r && !i[r] && (i[r] = je(Object.keys(i).length)), i;
}, {}), [x]), K = ye({
headings: {
sizes: {
h3: {
fontWeight: "normal"
}
}
}
});
return /* @__PURE__ */ s.jsxs(xe, { theme: K, children: [
/* @__PURE__ */ s.jsx(Ne, { portalProps: { target: ".seatmap" } }),
/* @__PURE__ */ s.jsx(
Te,
{
svg: d,
seats: A ? [] : Q,
selectedSeatIds: E,
onClick: X,
displayGroupMapping: Z,
rightControls: [
/* @__PURE__ */ s.jsx(
ze,
{
performanceName: ((V = l == null ? void 0 : l.performanceDetails) == null ? void 0 : V.Description) || "ERROR",
performanceDate: (l != null && l.performanceDetails.Date ? new Intl.DateTimeFormat("en-GB", {
dateStyle: "full",
timeStyle: "short",
timeZone: "Australia/Sydney"
}).format(
new Date(l == null ? void 0 : l.performanceDetails.Date)
) : "") + (" in " + ((q = l == null ? void 0 : l.performanceDetails) == null ? void 0 : q.Facility.Description) || "ERROR")
}
)
]
}
),
/* @__PURE__ */ s.jsx(
Pe,
{
title: G(),
opened: _,
onClose: () => {
b(!1);
},
styles: {
inner: { position: "absolute" },
title: { fontWeight: 700 },
content: { borderRadius: "0.5rem" }
},
centered: !0,
size: "auto",
portalProps: { target: ".seatmap" },
overlayProps: { fixed: !1 },
children: z()
}
)
] });
};
export {
Ve as TessituraPerformanceViewer,
qe as TessituraSYOS
};