@burdenoff/microfe-eventfullymanaged 2026.1030.1 → 2026.1101.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/eventfullymanaged/api/eventApi.d.ts +39 -0
- package/dist/eventfullymanaged/api/eventApi.d.ts.map +1 -1
- package/dist/eventfullymanaged/api/eventApi.js +187 -157
- package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
- package/dist/eventfullymanaged/components/FloorPlanZoneEditor.d.ts +24 -0
- package/dist/eventfullymanaged/components/FloorPlanZoneEditor.d.ts.map +1 -0
- package/dist/eventfullymanaged/components/FloorPlanZoneEditor.js +65 -0
- package/dist/eventfullymanaged/components/FloorPlanZoneEditor.js.map +1 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/ZoneCanvas.d.ts +24 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/ZoneCanvas.d.ts.map +1 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/ZoneCanvas.js +169 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/ZoneCanvas.js.map +1 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.d.ts +33 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.d.ts.map +1 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.js +248 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.js.map +1 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/useZoneEditorState.d.ts +33 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/useZoneEditorState.d.ts.map +1 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/useZoneEditorState.js +78 -0
- package/dist/eventfullymanaged/components/floorPlanEditor/useZoneEditorState.js.map +1 -0
- package/dist/eventfullymanaged/lib/floorPlanZones.d.ts +148 -0
- package/dist/eventfullymanaged/lib/floorPlanZones.d.ts.map +1 -0
- package/dist/eventfullymanaged/lib/floorPlanZones.js +239 -0
- package/dist/eventfullymanaged/lib/floorPlanZones.js.map +1 -0
- package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.d.ts.map +1 -1
- package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js +63 -57
- package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.d.ts +13 -0
- package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.d.ts.map +1 -0
- package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.js +181 -0
- package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.js.map +1 -0
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.d.ts.map +1 -1
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js +367 -291
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js.map +1 -1
- package/dist/eventfullymanaged/types/index.d.ts.map +1 -1
- package/dist/utils/pageContext.js +1 -1
- package/package.json +1 -1
|
@@ -4,69 +4,33 @@ import { useCreateFloorPlanMutation as n, useDeleteFloorPlanMutation as r, useUp
|
|
|
4
4
|
import { ActionMenu as o } from "../../components/ActionMenu.js";
|
|
5
5
|
import { describeError as s, mutationSucceeded as c } from "../../lib/mutationResult.js";
|
|
6
6
|
import { ImageUploadField as l } from "../../components/ImageUploadField.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { asNumber as u, asString as d, extractZones as ee, serializeZones as te, summarizeZones as f, zoneTypeLabel as p } from "../../lib/floorPlanZones.js";
|
|
8
|
+
import { FloorPlanZoneEditor as m } from "../../components/FloorPlanZoneEditor.js";
|
|
9
|
+
import { useZoneEditorState as ne } from "../../components/floorPlanEditor/useZoneEditorState.js";
|
|
10
|
+
import { useCallback as re, useEffect as ie, useMemo as h, useState as g } from "react";
|
|
11
|
+
import { useParams as ae } from "react-router";
|
|
12
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
|
+
import { ArrowLeft as oe, LayoutGrid as y, Map as b, PencilRuler as x, Plus as S, SquareStack as C } from "lucide-react";
|
|
14
|
+
import { AlertDialog as w, AlertDialogAction as T, AlertDialogCancel as se, AlertDialogContent as ce, AlertDialogDescription as le, AlertDialogFooter as ue, AlertDialogHeader as de, AlertDialogTitle as fe, Badge as E, Button as D, GlassCard as O, GradientText as pe, IllustratedEmptyState as me, Input as he, Skeleton as k } from "@burdenoff/fe-libs/ui";
|
|
12
15
|
//#region src/eventfullymanaged/pages/venues/FloorPlansPage.tsx
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
function k(e) {
|
|
19
|
-
return typeof e == "string" && e.trim() !== "" ? e : void 0;
|
|
20
|
-
}
|
|
21
|
-
function A(e) {
|
|
22
|
-
if (!e) return [];
|
|
23
|
-
let t = e;
|
|
24
|
-
if (!Array.isArray(t) && typeof t == "object") {
|
|
25
|
-
let e = t;
|
|
26
|
-
Array.isArray(e.zones) ? t = e.zones : Array.isArray(e.areas) ? t = e.areas : Array.isArray(e.booths) && (t = e.booths);
|
|
27
|
-
}
|
|
28
|
-
let n = Array.isArray(t) ? t.map((e, t) => [String(t), e]) : typeof t == "object" && t ? Object.entries(t) : [], r = [];
|
|
29
|
-
for (let [e, t] of n) {
|
|
30
|
-
if (typeof t != "object" || !t) continue;
|
|
31
|
-
let n = t, i = k(n.label) ?? k(n.name) ?? k(n.title) ?? k(n.id) ?? e, a = O(n.x), o = O(n.y), s = O(n.w) ?? O(n.width), c = O(n.h) ?? O(n.height), l;
|
|
32
|
-
if (a !== void 0 && o !== void 0 && s !== void 0 && c !== void 0) {
|
|
33
|
-
let e = a <= 1 && o <= 1 && s <= 1 && c <= 1 ? 100 : 1;
|
|
34
|
-
(e === 100 || a <= 100 && o <= 100 && s <= 100 && c <= 100) && (l = {
|
|
35
|
-
x: a * e,
|
|
36
|
-
y: o * e,
|
|
37
|
-
w: s * e,
|
|
38
|
-
h: c * e
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
r.push({
|
|
42
|
-
key: `${e}-${i}`,
|
|
43
|
-
label: i,
|
|
44
|
-
type: k(n.type) ?? k(n.kind),
|
|
45
|
-
capacity: O(n.capacity) ?? O(n.seats),
|
|
46
|
-
rect: l
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return r;
|
|
50
|
-
}
|
|
51
|
-
function j(e, t) {
|
|
52
|
-
let n = [];
|
|
53
|
-
t.length > 0 && n.push({
|
|
16
|
+
var A = "/EventfullyManaged/FloorPlans";
|
|
17
|
+
function ge(e, t) {
|
|
18
|
+
let n = [], r = f(t);
|
|
19
|
+
r.zones > 0 && n.push({
|
|
54
20
|
label: "Zones",
|
|
55
|
-
value:
|
|
56
|
-
})
|
|
57
|
-
let r = t.filter((e) => (e.type ?? "").toLowerCase().includes("booth")).length;
|
|
58
|
-
r > 0 && n.push({
|
|
21
|
+
value: r.zones.toLocaleString()
|
|
22
|
+
}), r.booths > 0 && n.push({
|
|
59
23
|
label: "Booths",
|
|
60
|
-
value: r.toLocaleString()
|
|
24
|
+
value: r.booths.toLocaleString()
|
|
61
25
|
});
|
|
62
|
-
let i =
|
|
26
|
+
let i = r.capacity, a = e.dimensions ?? {}, o = u(a.capacity) ?? u(a.totalCapacity), s = i > 0 ? i : o;
|
|
63
27
|
s !== void 0 && s > 0 && n.push({
|
|
64
28
|
label: "Total capacity",
|
|
65
29
|
value: s.toLocaleString()
|
|
66
30
|
});
|
|
67
|
-
let c =
|
|
31
|
+
let c = u(a.width), l = u(a.height);
|
|
68
32
|
if (c !== void 0 && l !== void 0) {
|
|
69
|
-
let e =
|
|
33
|
+
let e = d(a.unit) ?? "m";
|
|
70
34
|
n.push({
|
|
71
35
|
label: "Dimensions",
|
|
72
36
|
value: `${c} × ${l} ${e}`
|
|
@@ -74,109 +38,145 @@ function j(e, t) {
|
|
|
74
38
|
}
|
|
75
39
|
return n;
|
|
76
40
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
return /* @__PURE__ */
|
|
41
|
+
function _e({ plan: e, zones: t, editing: n, saving: r, onAttachImage: i, onStartEditing: a, onSaveZones: o, onStopEditing: s, editor: c }) {
|
|
42
|
+
let u = t.filter((e) => e.rect);
|
|
43
|
+
return /* @__PURE__ */ v(O, {
|
|
80
44
|
treatment: "plain",
|
|
81
45
|
className: "overflow-hidden border-border-seam p-0",
|
|
82
46
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ v("div", {
|
|
84
48
|
className: "flex items-center justify-between gap-2 border-b border-border-seam px-5 py-3",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ v("div", {
|
|
86
50
|
className: "flex min-w-0 items-center gap-2 text-text-primary",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ _(b, { className: "h-4 w-4 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ _("h2", {
|
|
88
52
|
className: "truncate text-base font-semibold",
|
|
89
53
|
children: e.name
|
|
90
54
|
})]
|
|
91
|
-
}),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
55
|
+
}), /* @__PURE__ */ v("div", {
|
|
56
|
+
className: "flex shrink-0 items-center gap-2",
|
|
57
|
+
children: [t.length > 0 ? /* @__PURE__ */ v(E, {
|
|
58
|
+
variant: "secondary",
|
|
59
|
+
children: [
|
|
60
|
+
t.length,
|
|
61
|
+
" ",
|
|
62
|
+
t.length === 1 ? "zone" : "zones"
|
|
63
|
+
]
|
|
64
|
+
}) : null, e.imageUrl && !n ? /* @__PURE__ */ v(D, {
|
|
65
|
+
type: "button",
|
|
66
|
+
size: "sm",
|
|
67
|
+
variant: "outline",
|
|
68
|
+
onClick: a,
|
|
69
|
+
children: [/* @__PURE__ */ _(x, { className: "h-4 w-4" }), t.length > 0 ? "Edit zones" : "Add zones"]
|
|
70
|
+
}) : null]
|
|
71
|
+
})]
|
|
100
72
|
}),
|
|
101
|
-
e.imageUrl ? /* @__PURE__ */ m
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
73
|
+
e.imageUrl && n ? /* @__PURE__ */ _(m, {
|
|
74
|
+
editor: c,
|
|
75
|
+
planName: e.name,
|
|
76
|
+
imageUrl: e.imageUrl,
|
|
77
|
+
saving: r,
|
|
78
|
+
onSave: (t) => o(e, t),
|
|
79
|
+
onCancel: s
|
|
80
|
+
}) : e.imageUrl ? /* @__PURE__ */ _("div", {
|
|
81
|
+
className: "flex justify-center bg-bg-sunken p-3",
|
|
82
|
+
children: /* @__PURE__ */ v("div", {
|
|
83
|
+
className: "relative inline-block max-w-full",
|
|
84
|
+
children: [/* @__PURE__ */ _("img", {
|
|
85
|
+
src: e.imageUrl,
|
|
86
|
+
alt: `${e.name} floor plan`,
|
|
87
|
+
className: "block h-auto max-h-[32rem] w-auto max-w-full"
|
|
88
|
+
}), u.map((e) => /* @__PURE__ */ v("div", {
|
|
89
|
+
"data-testid": "floor-plan-zone",
|
|
90
|
+
className: "absolute flex flex-col items-center justify-center overflow-hidden rounded-md border border-accent-primary/70 bg-action-primary-bg/15 text-[10px] font-medium leading-tight text-accent-primary",
|
|
91
|
+
style: {
|
|
92
|
+
left: `${e.rect?.x}%`,
|
|
93
|
+
top: `${e.rect?.y}%`,
|
|
94
|
+
width: `${e.rect?.w}%`,
|
|
95
|
+
height: `${e.rect?.h}%`
|
|
96
|
+
},
|
|
97
|
+
title: [
|
|
98
|
+
e.label,
|
|
99
|
+
p(e.type),
|
|
100
|
+
e.capacity === void 0 ? "" : `capacity ${e.capacity}`
|
|
101
|
+
].filter(Boolean).join(" · "),
|
|
102
|
+
children: [/* @__PURE__ */ _("span", {
|
|
103
|
+
className: "max-w-full truncate px-1",
|
|
104
|
+
children: e.label
|
|
105
|
+
}), e.capacity === void 0 ? null : /* @__PURE__ */ _("span", {
|
|
106
|
+
className: "max-w-full truncate px-1 text-text-muted",
|
|
107
|
+
children: e.capacity
|
|
108
|
+
})]
|
|
109
|
+
}, e.id))]
|
|
110
|
+
})
|
|
111
|
+
}) : /* @__PURE__ */ _("div", {
|
|
122
112
|
className: "p-6",
|
|
123
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ v("div", {
|
|
124
114
|
className: "rounded-card border border-dashed border-border-default bg-bg-sunken p-6",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ _("p", {
|
|
126
116
|
className: "mb-3 text-center text-sm text-text-secondary",
|
|
127
|
-
children: "No image attached yet. Upload the hall map for this plan."
|
|
128
|
-
}), /* @__PURE__ */
|
|
117
|
+
children: "No image attached yet. Upload the hall map for this plan, then draw its zones and booths."
|
|
118
|
+
}), /* @__PURE__ */ _(l, {
|
|
129
119
|
label: "Upload floor plan image",
|
|
130
|
-
folderPath:
|
|
120
|
+
folderPath: A,
|
|
131
121
|
value: null,
|
|
132
|
-
onUploaded: (t) =>
|
|
122
|
+
onUploaded: (t) => i(e, t),
|
|
133
123
|
hint: "Stored securely in Files and shown here once attached."
|
|
134
124
|
})]
|
|
135
125
|
})
|
|
136
126
|
}),
|
|
137
|
-
t.length > 0 ? /* @__PURE__ */
|
|
127
|
+
t.length > 0 && !n ? /* @__PURE__ */ v("div", {
|
|
138
128
|
className: "border-t border-border-seam px-5 py-4",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ v("div", {
|
|
140
130
|
className: "mb-2 flex items-center gap-2 text-sm font-medium text-text-primary",
|
|
141
|
-
children: [/* @__PURE__ */
|
|
142
|
-
}), /* @__PURE__ */
|
|
131
|
+
children: [/* @__PURE__ */ _(y, { className: "h-4 w-4 text-text-muted" }), "Labeled zones"]
|
|
132
|
+
}), /* @__PURE__ */ _("div", {
|
|
143
133
|
className: "flex flex-wrap gap-2",
|
|
144
|
-
children: t.map((e) =>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
className: "
|
|
149
|
-
children: [
|
|
150
|
-
|
|
151
|
-
|
|
134
|
+
children: t.map((e) => {
|
|
135
|
+
let t = p(e.type);
|
|
136
|
+
return /* @__PURE__ */ v(E, {
|
|
137
|
+
variant: "outline",
|
|
138
|
+
className: "gap-1.5",
|
|
139
|
+
children: [
|
|
140
|
+
e.label,
|
|
141
|
+
t ? /* @__PURE__ */ v("span", {
|
|
142
|
+
className: "text-text-muted",
|
|
143
|
+
children: ["· ", t]
|
|
144
|
+
}) : null,
|
|
145
|
+
e.capacity === void 0 ? null : /* @__PURE__ */ v("span", {
|
|
146
|
+
className: "text-text-muted",
|
|
147
|
+
children: ["· ", e.capacity]
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
}, e.id);
|
|
151
|
+
})
|
|
152
152
|
})]
|
|
153
153
|
}) : null
|
|
154
154
|
]
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
let { id:
|
|
159
|
-
if (!(!
|
|
160
|
-
let e = await
|
|
161
|
-
venueId:
|
|
162
|
-
name:
|
|
163
|
-
imageUrl:
|
|
157
|
+
function j() {
|
|
158
|
+
let { id: u = "" } = ae(), { navigate: d } = e(), { data: f, loading: p, refetch: m } = a(u), [y, { loading: b }] = n(), [x] = i(), [E] = r(), [j, M] = g(""), [N, P] = g(""), [F, I] = g(null), [L, R] = g(!1), [z, B] = g(null), [ve, V] = g(!1), H = ne(), [U, W] = g(null), G = f?.venue, K = h(() => f?.floorPlans?.items ?? [], [f]), q = h(() => K.find((e) => e.id === F) ?? K[0] ?? null, [K, F]), J = h(() => ee(q?.interactiveAreas), [q]), Y = h(() => q ? ge(q, J) : [], [q, J]), X = (e) => e.venueId || u, ye = async () => {
|
|
159
|
+
if (!(!j.trim() || !u)) try {
|
|
160
|
+
let e = await y({ variables: { input: {
|
|
161
|
+
venueId: u,
|
|
162
|
+
name: j.trim(),
|
|
163
|
+
imageUrl: N,
|
|
164
164
|
dimensions: {},
|
|
165
165
|
interactiveAreas: {}
|
|
166
166
|
} } });
|
|
167
167
|
if (!c(e, e.data?.createFloorPlan?.id, "Could not create floor plan")) return;
|
|
168
|
-
|
|
168
|
+
M(""), P(""), R(!1);
|
|
169
169
|
let n = e.data?.createFloorPlan?.id;
|
|
170
|
-
n &&
|
|
170
|
+
n && I(n), t.success("Floor plan created"), await m();
|
|
171
171
|
} catch (e) {
|
|
172
172
|
t.error("Could not create floor plan", s(e));
|
|
173
173
|
}
|
|
174
|
-
},
|
|
174
|
+
}, be = async (e, n) => {
|
|
175
175
|
try {
|
|
176
|
-
let t = await
|
|
176
|
+
let t = await x({ variables: {
|
|
177
177
|
id: e.id,
|
|
178
178
|
input: {
|
|
179
|
-
venueId: e
|
|
179
|
+
venueId: X(e),
|
|
180
180
|
name: e.name,
|
|
181
181
|
imageUrl: n,
|
|
182
182
|
dimensions: e.dimensions ?? {},
|
|
@@ -184,193 +184,269 @@ function N() {
|
|
|
184
184
|
}
|
|
185
185
|
} });
|
|
186
186
|
if (!c(t, t.data?.updateFloorPlan?.id, "Could not attach image")) return;
|
|
187
|
-
await
|
|
187
|
+
await m();
|
|
188
188
|
} catch (e) {
|
|
189
189
|
t.error("Could not attach image", s(e));
|
|
190
190
|
}
|
|
191
|
-
},
|
|
192
|
-
|
|
191
|
+
}, Z = re(() => {
|
|
192
|
+
B(null);
|
|
193
|
+
}, []), xe = (e, t) => {
|
|
194
|
+
H.reset(t), B(e.id);
|
|
195
|
+
}, Q = z !== null && H.dirty;
|
|
196
|
+
ie(() => {
|
|
197
|
+
if (!Q) return;
|
|
198
|
+
let e = (e) => {
|
|
199
|
+
e.preventDefault();
|
|
200
|
+
};
|
|
201
|
+
return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
202
|
+
}, [Q]);
|
|
203
|
+
let Se = () => {
|
|
204
|
+
if (Q) {
|
|
205
|
+
W({ kind: "venue" });
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
d(`/venues/${u}`);
|
|
209
|
+
}, Ce = (e) => {
|
|
210
|
+
if (Q && z !== e) {
|
|
211
|
+
W({
|
|
212
|
+
kind: "plan",
|
|
213
|
+
planId: e
|
|
214
|
+
});
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
z !== e && Z(), I(e);
|
|
218
|
+
}, $ = () => {
|
|
219
|
+
let e = U;
|
|
220
|
+
W(null), Z(), e?.kind === "plan" ? I(e.planId) : e?.kind === "venue" && d(`/venues/${u}`);
|
|
221
|
+
}, we = async (e, n) => {
|
|
222
|
+
V(!0);
|
|
223
|
+
try {
|
|
224
|
+
let r = await x({ variables: {
|
|
225
|
+
id: e.id,
|
|
226
|
+
input: {
|
|
227
|
+
venueId: X(e),
|
|
228
|
+
name: e.name,
|
|
229
|
+
imageUrl: e.imageUrl ?? null,
|
|
230
|
+
dimensions: e.dimensions ?? {},
|
|
231
|
+
interactiveAreas: te(n, e.interactiveAreas)
|
|
232
|
+
}
|
|
233
|
+
} });
|
|
234
|
+
return c(r, r.data?.updateFloorPlan?.id, "Could not save zones") ? (await m(), Z(), t.success("Zones saved", `${n.length} ${n.length === 1 ? "zone" : "zones"} on ${e.name}`), !0) : !1;
|
|
235
|
+
} catch (e) {
|
|
236
|
+
return t.error("Could not save zones", s(e)), !1;
|
|
237
|
+
} finally {
|
|
238
|
+
V(!1);
|
|
239
|
+
}
|
|
240
|
+
}, Te = async (e) => {
|
|
241
|
+
let n;
|
|
242
|
+
try {
|
|
243
|
+
n = await E({ variables: { id: e.id } });
|
|
244
|
+
} catch (e) {
|
|
245
|
+
throw t.error("Could not delete floor plan", s(e)), e;
|
|
246
|
+
}
|
|
193
247
|
if (n.error) throw t.error("Could not delete floor plan", n.error.message), n.error;
|
|
194
248
|
if (!n.data?.deleteFloorPlan) throw t.error("Could not delete floor plan", "The server did not confirm the change."), Error("delete-unconfirmed");
|
|
195
|
-
|
|
249
|
+
F === e.id && I(null), z === e.id && Z(), t.success("Floor plan deleted", e.name), await m();
|
|
196
250
|
};
|
|
197
|
-
return /* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ v("div", {
|
|
198
252
|
className: "space-y-6 p-6",
|
|
199
|
-
children: [
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
onClick: () => W((e) => !e),
|
|
224
|
-
children: [/* @__PURE__ */ p(v, { className: "h-4 w-4" }), "Add floor plan"]
|
|
225
|
-
})]
|
|
226
|
-
}), O ? /* @__PURE__ */ m("div", {
|
|
227
|
-
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
228
|
-
children: [/* @__PURE__ */ p(E, { className: "h-96 rounded-card lg:col-span-2" }), /* @__PURE__ */ p(E, { className: "h-96 rounded-card" })]
|
|
229
|
-
}) : K.length === 0 && !U ? /* @__PURE__ */ p(S, {
|
|
230
|
-
treatment: "plain",
|
|
231
|
-
className: "border-border-seam",
|
|
232
|
-
children: /* @__PURE__ */ p(w, {
|
|
233
|
-
illustration: "empty-files",
|
|
234
|
-
title: "No floor plans yet.",
|
|
235
|
-
description: "Add one to start mapping this venue — upload the hall map and label its zones.",
|
|
236
|
-
action: /* @__PURE__ */ m(x, {
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ v("div", {
|
|
255
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between",
|
|
256
|
+
children: [/* @__PURE__ */ v("div", {
|
|
257
|
+
className: "space-y-3",
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ v(D, {
|
|
260
|
+
type: "button",
|
|
261
|
+
variant: "ghost",
|
|
262
|
+
size: "sm",
|
|
263
|
+
onClick: Se,
|
|
264
|
+
children: [/* @__PURE__ */ _(oe, { className: "h-4 w-4" }), "Back to Venue"]
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ _(pe, {
|
|
267
|
+
as: "h1",
|
|
268
|
+
className: "text-2xl font-bold",
|
|
269
|
+
children: G?.name ? `${G.name} — Floor Plans` : "Floor Plans"
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ _("p", {
|
|
272
|
+
className: "text-sm text-text-secondary",
|
|
273
|
+
children: "Map the hall layout, booth positions, stage and entrances so exhibitors and attendees can navigate on the day."
|
|
274
|
+
})
|
|
275
|
+
]
|
|
276
|
+
}), /* @__PURE__ */ v(D, {
|
|
237
277
|
type: "button",
|
|
238
|
-
onClick: () =>
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
-
})
|
|
241
|
-
})
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
children:
|
|
278
|
+
onClick: () => R((e) => !e),
|
|
279
|
+
children: [/* @__PURE__ */ _(S, { className: "h-4 w-4" }), "Add floor plan"]
|
|
280
|
+
})]
|
|
281
|
+
}),
|
|
282
|
+
p ? /* @__PURE__ */ v("div", {
|
|
283
|
+
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
284
|
+
children: [/* @__PURE__ */ _(k, { className: "h-96 rounded-card lg:col-span-2" }), /* @__PURE__ */ _(k, { className: "h-96 rounded-card" })]
|
|
285
|
+
}) : K.length === 0 && !L ? /* @__PURE__ */ _(O, {
|
|
286
|
+
treatment: "plain",
|
|
287
|
+
className: "border-border-seam",
|
|
288
|
+
children: /* @__PURE__ */ _(me, {
|
|
289
|
+
illustration: "empty-files",
|
|
290
|
+
title: "No floor plans yet.",
|
|
291
|
+
description: "Add one to start mapping this venue — upload the hall map and label its zones.",
|
|
292
|
+
action: /* @__PURE__ */ v(D, {
|
|
293
|
+
type: "button",
|
|
294
|
+
onClick: () => R(!0),
|
|
295
|
+
children: [/* @__PURE__ */ _(S, { className: "h-4 w-4" }), "Add floor plan"]
|
|
256
296
|
})
|
|
257
297
|
})
|
|
258
|
-
})
|
|
259
|
-
className: "
|
|
260
|
-
children: [
|
|
261
|
-
|
|
298
|
+
}) : /* @__PURE__ */ v("div", {
|
|
299
|
+
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
300
|
+
children: [/* @__PURE__ */ _("div", {
|
|
301
|
+
className: "lg:col-span-2",
|
|
302
|
+
children: q ? /* @__PURE__ */ _(_e, {
|
|
303
|
+
plan: q,
|
|
304
|
+
zones: J,
|
|
305
|
+
editing: z === q.id,
|
|
306
|
+
saving: ve,
|
|
307
|
+
onAttachImage: be,
|
|
308
|
+
onStartEditing: () => xe(q, J),
|
|
309
|
+
onSaveZones: we,
|
|
310
|
+
onStopEditing: Z,
|
|
311
|
+
editor: H
|
|
312
|
+
}) : /* @__PURE__ */ _(O, {
|
|
262
313
|
treatment: "plain",
|
|
263
|
-
className: "border-border-seam p-
|
|
264
|
-
children:
|
|
265
|
-
className: "text-sm
|
|
266
|
-
children: "
|
|
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
|
-
|
|
314
|
+
className: "flex h-full items-center justify-center border-border-seam p-10",
|
|
315
|
+
children: /* @__PURE__ */ _("p", {
|
|
316
|
+
className: "text-sm text-text-secondary",
|
|
317
|
+
children: "Add a floor plan to preview it here."
|
|
318
|
+
})
|
|
319
|
+
})
|
|
320
|
+
}), /* @__PURE__ */ v("div", {
|
|
321
|
+
className: "space-y-6",
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ v(O, {
|
|
324
|
+
treatment: "plain",
|
|
325
|
+
className: "border-border-seam p-5",
|
|
326
|
+
children: [/* @__PURE__ */ _("h2", {
|
|
327
|
+
className: "text-sm font-semibold text-text-primary",
|
|
328
|
+
children: "Available Floor Plans"
|
|
329
|
+
}), /* @__PURE__ */ _("ul", {
|
|
330
|
+
className: "mt-3 space-y-2",
|
|
331
|
+
role: "list",
|
|
332
|
+
children: K.length === 0 ? /* @__PURE__ */ _("li", {
|
|
333
|
+
className: "text-sm text-text-secondary",
|
|
334
|
+
children: "None yet — create one below."
|
|
335
|
+
}) : K.map((e) => {
|
|
336
|
+
let t = q?.id === e.id;
|
|
337
|
+
return /* @__PURE__ */ _("li", { children: /* @__PURE__ */ v("div", {
|
|
338
|
+
className: `flex items-center gap-3 rounded-card border p-3 transition-colors ${t ? "border-accent-primary bg-action-primary-bg/10" : "border-border-seam hover:border-border-strong"}`,
|
|
339
|
+
children: [/* @__PURE__ */ v("button", {
|
|
340
|
+
type: "button",
|
|
341
|
+
onClick: () => Ce(e.id),
|
|
342
|
+
className: "flex min-w-0 flex-1 items-center gap-3 text-left focus-visible:outline-none",
|
|
343
|
+
"aria-pressed": t,
|
|
344
|
+
children: [/* @__PURE__ */ _("span", {
|
|
345
|
+
className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-md ${t ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary"}`,
|
|
346
|
+
children: /* @__PURE__ */ _(C, { className: "h-4 w-4" })
|
|
347
|
+
}), /* @__PURE__ */ v("span", {
|
|
348
|
+
className: "min-w-0",
|
|
349
|
+
children: [/* @__PURE__ */ _("span", {
|
|
350
|
+
className: "block truncate text-sm font-medium text-text-primary",
|
|
351
|
+
children: e.name
|
|
352
|
+
}), /* @__PURE__ */ _("span", {
|
|
353
|
+
className: "block text-xs text-text-muted",
|
|
354
|
+
children: e.imageUrl ? "Map attached" : "No image yet"
|
|
355
|
+
})]
|
|
293
356
|
})]
|
|
357
|
+
}), /* @__PURE__ */ _(o, {
|
|
358
|
+
ariaLabel: `Floor plan actions for ${e.name}`,
|
|
359
|
+
entityName: e.name,
|
|
360
|
+
deleteLabel: "Delete floor plan",
|
|
361
|
+
onDelete: () => Te(e)
|
|
294
362
|
})]
|
|
295
|
-
})
|
|
296
|
-
ariaLabel: `Floor plan actions for ${e.name}`,
|
|
297
|
-
entityName: e.name,
|
|
298
|
-
deleteLabel: "Delete floor plan",
|
|
299
|
-
onDelete: () => Q(e)
|
|
300
|
-
})]
|
|
301
|
-
}) }, e.id);
|
|
302
|
-
})
|
|
303
|
-
})]
|
|
304
|
-
}),
|
|
305
|
-
q ? /* @__PURE__ */ m(S, {
|
|
306
|
-
treatment: "metric",
|
|
307
|
-
className: "p-5",
|
|
308
|
-
children: [/* @__PURE__ */ p("h2", {
|
|
309
|
-
className: "text-sm font-semibold text-text-primary",
|
|
310
|
-
children: "Plan Details"
|
|
311
|
-
}), Y.length > 0 ? /* @__PURE__ */ p("dl", {
|
|
312
|
-
className: "mt-3 space-y-2",
|
|
313
|
-
children: Y.map((e) => /* @__PURE__ */ m("div", {
|
|
314
|
-
className: "flex items-center justify-between text-sm",
|
|
315
|
-
children: [/* @__PURE__ */ p("dt", {
|
|
316
|
-
className: "text-text-secondary",
|
|
317
|
-
children: e.label
|
|
318
|
-
}), /* @__PURE__ */ p("dd", {
|
|
319
|
-
className: "font-semibold tabular-nums text-text-primary",
|
|
320
|
-
children: e.value
|
|
321
|
-
})]
|
|
322
|
-
}, e.label))
|
|
323
|
-
}) : /* @__PURE__ */ p("p", {
|
|
324
|
-
className: "mt-3 text-sm text-text-secondary",
|
|
325
|
-
children: "No zones or dimensions captured for this plan yet."
|
|
326
|
-
})]
|
|
327
|
-
}) : null,
|
|
328
|
-
U || K.length === 0 ? /* @__PURE__ */ m(S, {
|
|
329
|
-
treatment: "plain",
|
|
330
|
-
className: "border-border-seam p-5",
|
|
331
|
-
children: [/* @__PURE__ */ p("h2", {
|
|
332
|
-
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
333
|
-
children: "Add a floor plan"
|
|
334
|
-
}), /* @__PURE__ */ m("div", {
|
|
335
|
-
className: "space-y-4",
|
|
336
|
-
children: [
|
|
337
|
-
/* @__PURE__ */ p(T, {
|
|
338
|
-
type: "text",
|
|
339
|
-
value: L,
|
|
340
|
-
onChange: (e) => R(e.target.value),
|
|
341
|
-
placeholder: "Main Hall Layout",
|
|
342
|
-
"aria-label": "Floor plan name"
|
|
343
|
-
}),
|
|
344
|
-
/* @__PURE__ */ p(l, {
|
|
345
|
-
label: "Upload floor plan image",
|
|
346
|
-
folderPath: D,
|
|
347
|
-
value: z || null,
|
|
348
|
-
onUploaded: B,
|
|
349
|
-
hint: "Optional now — you can attach it later from the viewer."
|
|
350
|
-
}),
|
|
351
|
-
/* @__PURE__ */ m("div", {
|
|
352
|
-
className: "flex justify-end gap-2",
|
|
353
|
-
children: [K.length > 0 ? /* @__PURE__ */ p(x, {
|
|
354
|
-
type: "button",
|
|
355
|
-
variant: "ghost",
|
|
356
|
-
onClick: () => W(!1),
|
|
357
|
-
children: "Cancel"
|
|
358
|
-
}) : null, /* @__PURE__ */ m(x, {
|
|
359
|
-
type: "button",
|
|
360
|
-
onClick: X,
|
|
361
|
-
disabled: P || !L.trim(),
|
|
362
|
-
children: [/* @__PURE__ */ p(v, { className: "h-4 w-4" }), P ? "Creating…" : "Create"]
|
|
363
|
-
})]
|
|
363
|
+
}) }, e.id);
|
|
364
364
|
})
|
|
365
|
-
]
|
|
366
|
-
})
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
365
|
+
})]
|
|
366
|
+
}),
|
|
367
|
+
q ? /* @__PURE__ */ v(O, {
|
|
368
|
+
treatment: "metric",
|
|
369
|
+
className: "p-5",
|
|
370
|
+
children: [/* @__PURE__ */ _("h2", {
|
|
371
|
+
className: "text-sm font-semibold text-text-primary",
|
|
372
|
+
children: "Plan Details"
|
|
373
|
+
}), Y.length > 0 ? /* @__PURE__ */ _("dl", {
|
|
374
|
+
className: "mt-3 space-y-2",
|
|
375
|
+
children: Y.map((e) => /* @__PURE__ */ v("div", {
|
|
376
|
+
className: "flex items-center justify-between text-sm",
|
|
377
|
+
children: [/* @__PURE__ */ _("dt", {
|
|
378
|
+
className: "text-text-secondary",
|
|
379
|
+
children: e.label
|
|
380
|
+
}), /* @__PURE__ */ _("dd", {
|
|
381
|
+
className: "font-semibold tabular-nums text-text-primary",
|
|
382
|
+
children: e.value
|
|
383
|
+
})]
|
|
384
|
+
}, e.label))
|
|
385
|
+
}) : /* @__PURE__ */ _("p", {
|
|
386
|
+
className: "mt-3 text-sm text-text-secondary",
|
|
387
|
+
children: "No zones or dimensions captured for this plan yet."
|
|
388
|
+
})]
|
|
389
|
+
}) : null,
|
|
390
|
+
L || K.length === 0 ? /* @__PURE__ */ v(O, {
|
|
391
|
+
treatment: "plain",
|
|
392
|
+
className: "border-border-seam p-5",
|
|
393
|
+
children: [/* @__PURE__ */ _("h2", {
|
|
394
|
+
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
395
|
+
children: "Add a floor plan"
|
|
396
|
+
}), /* @__PURE__ */ v("div", {
|
|
397
|
+
className: "space-y-4",
|
|
398
|
+
children: [
|
|
399
|
+
/* @__PURE__ */ _(he, {
|
|
400
|
+
type: "text",
|
|
401
|
+
value: j,
|
|
402
|
+
onChange: (e) => M(e.target.value),
|
|
403
|
+
placeholder: "Main Hall Layout",
|
|
404
|
+
"aria-label": "Floor plan name"
|
|
405
|
+
}),
|
|
406
|
+
/* @__PURE__ */ _(l, {
|
|
407
|
+
label: "Upload floor plan image",
|
|
408
|
+
folderPath: A,
|
|
409
|
+
value: N || null,
|
|
410
|
+
onUploaded: P,
|
|
411
|
+
hint: "Optional now — you can attach it later from the viewer."
|
|
412
|
+
}),
|
|
413
|
+
/* @__PURE__ */ v("div", {
|
|
414
|
+
className: "flex justify-end gap-2",
|
|
415
|
+
children: [K.length > 0 ? /* @__PURE__ */ _(D, {
|
|
416
|
+
type: "button",
|
|
417
|
+
variant: "ghost",
|
|
418
|
+
onClick: () => R(!1),
|
|
419
|
+
children: "Cancel"
|
|
420
|
+
}) : null, /* @__PURE__ */ v(D, {
|
|
421
|
+
type: "button",
|
|
422
|
+
onClick: ye,
|
|
423
|
+
disabled: b || !j.trim(),
|
|
424
|
+
children: [/* @__PURE__ */ _(S, { className: "h-4 w-4" }), b ? "Creating…" : "Create"]
|
|
425
|
+
})]
|
|
426
|
+
})
|
|
427
|
+
]
|
|
428
|
+
})]
|
|
429
|
+
}) : null
|
|
430
|
+
]
|
|
431
|
+
})]
|
|
432
|
+
}),
|
|
433
|
+
/* @__PURE__ */ _(w, {
|
|
434
|
+
open: U !== null,
|
|
435
|
+
onOpenChange: (e) => e ? void 0 : W(null),
|
|
436
|
+
children: /* @__PURE__ */ v(ce, { children: [/* @__PURE__ */ v(de, { children: [/* @__PURE__ */ _(fe, { children: "Discard unsaved zone changes?" }), /* @__PURE__ */ v(le, { children: [
|
|
437
|
+
"The zones you edited on this floor plan have not been saved.",
|
|
438
|
+
" ",
|
|
439
|
+
U?.kind === "venue" ? "Leaving this page" : "Switching plans",
|
|
440
|
+
" will discard them."
|
|
441
|
+
] })] }), /* @__PURE__ */ v(ue, { children: [/* @__PURE__ */ _(se, { children: "Keep editing" }), /* @__PURE__ */ _(T, {
|
|
442
|
+
onClick: $,
|
|
443
|
+
children: "Discard changes"
|
|
444
|
+
})] })] })
|
|
445
|
+
})
|
|
446
|
+
]
|
|
371
447
|
});
|
|
372
448
|
}
|
|
373
449
|
//#endregion
|
|
374
|
-
export {
|
|
450
|
+
export { j as default };
|
|
375
451
|
|
|
376
452
|
//# sourceMappingURL=FloorPlansPage.js.map
|