@burdenoff/microfe-eventfullymanaged 2026.1110.12 → 2026.1114.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.
@@ -1 +1 @@
1
- {"version":3,"file":"AttendeeProfilePage.js","names":["AttendeeConversation","conversationContext","useMemo","attendeeId","attendeeName","useRegisterPageConversationContext","ContextConversationWidget","AttendeeProfilePage","useParams","useEventfullyManaged","attendeesQuery","useAttendeesQuery","registrationsQuery","useRegistrationsQuery","conversationRef","useRef","attendee","item","id","registrations","registration","PagePurpose","EmphasisPanel","GradientText","GlassCard","EntityListSection","AttendeeRecommendations","NextSteps","Ticket","navigate","Users","MessageSquare"],"sources":["../../../../src/eventfullymanaged/pages/modules/AttendeeProfilePage.tsx"],"sourcesContent":["import { MessageSquare, Ticket, Users } from 'lucide-react';\nimport { ContextConversationWidget } from '@burdenoff/fe-libs/shared';\nimport { useRegisterPageConversationContext } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { EmphasisPanel, GlassCard, GradientText, NextSteps, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useMemo, useRef } from 'react';\nimport { useParams } from 'react-router';\n\nimport { useAttendeesQuery, useRegistrationsQuery } from '../../api/eventApi';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { AttendeeRecommendations } from './AttendeeRecommendations';\nimport { EntityListSection } from './EntityListSection';\n\n/**\n * Direct message thread with a single attendee, backed by wspace-conversations-svc.\n * Kept as a dedicated component so `useRegisterPageConversationContext` scopes the\n * thread to this attendee (entityType + entityId) and unregisters on unmount.\n */\nfunction AttendeeConversation({ attendeeId, attendeeName }: { attendeeId: string; attendeeName: string }) {\n // Stable reference: `useRegisterPageConversationContext` keys its effect on this\n // object's identity, so a fresh inline object every render would loop the shared\n // PageConversationContextProvider (see NetworkingPage for the full rationale).\n const conversationContext = useMemo(\n () => ({\n entityType: 'EVENTFULLYMANAGED_ATTENDEE',\n entityId: attendeeId,\n contextTitle: `Attendee · ${attendeeName}`,\n }),\n [attendeeId, attendeeName]\n );\n useRegisterPageConversationContext(conversationContext);\n return <ContextConversationWidget widgetKey=\"attendee-message\" />;\n}\n\ntype AttendeeRow = {\n id: string;\n eventId?: string;\n fullName?: string;\n email?: string;\n company?: string;\n role?: string;\n};\n\ntype RegistrationRow = {\n id: string;\n attendeeId?: string;\n status?: string;\n quantity?: number;\n currency?: string;\n totalAmount?: string;\n};\n\nexport default function AttendeeProfilePage() {\n const { id = '' } = useParams();\n const { navigate } = useEventfullyManaged();\n const attendeesQuery = useAttendeesQuery({ limit: 100, offset: 0 });\n const registrationsQuery = useRegistrationsQuery({ limit: 100, offset: 0 });\n const conversationRef = useRef<HTMLDivElement | null>(null);\n\n const attendee = useMemo(\n () => ((attendeesQuery.data?.attendees.items ?? []) as AttendeeRow[]).find((item) => item.id === id),\n [id, attendeesQuery.data]\n );\n const registrations = useMemo(\n () =>\n ((registrationsQuery.data?.registrations.items ?? []) as RegistrationRow[]).filter(\n (registration) => registration.attendeeId === id\n ),\n [id, registrationsQuery.data]\n );\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n A single view of one attendee — who they are and everything they have registered for. Use this when you need to\n look someone up: verify their ticket, answer a support question, or understand their history with your events\n before reaching out.\n </PagePurpose>\n\n <EmphasisPanel>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Attendee</GradientText> Profile\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {attendeesQuery.loading\n ? 'Loading attendee profile...'\n : attendee\n ? `${attendee.fullName ?? attendee.id} profile from registration and attendee APIs.`\n : 'Attendee not found in current query scope.'}\n </p>\n {attendee ? (\n <div className=\"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n <GlassCard treatment=\"metric\" className=\"p-3\">\n <p className=\"text-xs uppercase tracking-wide text-text-secondary\">Name</p>\n <p className=\"mt-1 font-medium text-text-primary\">{attendee.fullName ?? attendee.id}</p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"p-3\">\n <p className=\"text-xs uppercase tracking-wide text-text-secondary\">Email</p>\n <p className=\"mt-1 font-medium text-text-primary\">{attendee.email ?? 'Unavailable'}</p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"p-3\">\n <p className=\"text-xs uppercase tracking-wide text-text-secondary\">Company</p>\n <p className=\"mt-1 font-medium text-text-primary\">{attendee.company ?? 'Unavailable'}</p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"p-3\">\n <p className=\"text-xs uppercase tracking-wide text-text-secondary\">Role</p>\n <p className=\"mt-1 font-medium text-text-primary\">{attendee.role ?? 'Unavailable'}</p>\n </GlassCard>\n </div>\n ) : null}\n </EmphasisPanel>\n\n <EntityListSection\n heading={\n registrationsQuery.loading ? 'Loading attendee registrations...' : `Registrations (${registrations.length})`\n }\n emptyLabel=\"No registrations linked to this attendee.\"\n rows={registrations.map((registration) => ({\n id: registration.id,\n title: `Registration ${registration.id}`,\n subtitle: [\n registration.quantity ? `Qty ${registration.quantity}` : undefined,\n registration.totalAmount ? `${registration.totalAmount} ${registration.currency ?? ''}` : undefined,\n ]\n .filter(Boolean)\n .join(' • '),\n status: registration.status,\n }))}\n />\n\n {attendee?.eventId ? (\n <AttendeeRecommendations\n attendeeId={attendee.id}\n eventId={attendee.eventId}\n attendees={(attendeesQuery.data?.attendees.items ?? []) as AttendeeRow[]}\n />\n ) : null}\n\n {id ? (\n <div ref={conversationRef} className=\"space-y-3\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Messages</h2>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Start a direct conversation with this attendee. Threads and attachments are handled by the shared\n conversations service.\n </p>\n </div>\n <AttendeeConversation attendeeId={id} attendeeName={attendee?.fullName ?? attendee?.id ?? id} />\n </div>\n ) : null}\n\n <NextSteps\n storageKey=\"eventfullymanaged-attendee-profile\"\n title=\"Act on this attendee\"\n steps={[\n {\n id: 'view-registrations',\n label: 'Review all registrations',\n description: 'See the full registration list to manage tickets and payments.',\n icon: <Ticket className=\"h-4 w-4\" />,\n onClick: () => navigate('/registration'),\n },\n {\n id: 'networking',\n label: 'Find networking matches',\n description: 'Connect this attendee with relevant people and meetings.',\n icon: <Users className=\"h-4 w-4\" />,\n onClick: () => navigate('/networking'),\n },\n {\n id: 'reach-out',\n label: 'Send a message',\n description: 'Open a direct conversation thread with this attendee.',\n icon: <MessageSquare className=\"h-4 w-4\" />,\n onClick: () => conversationRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' }),\n },\n ]}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAASA,EAAqB,EAAE,eAAY,mBAA8D;CAIxG,IAAMC,IAAsBC,SACnB;EACL,YAAY;EACZ,UAAUC;EACV,cAAc,cAAcC;CAC9B,IACA,CAACD,GAAYC,CAAY,CAC3B;CAEA,OADAC,EAAmCJ,CAAmB,GAC/C,kBAACK,GAAD,EAA2B,WAAU,mBAAoB,CAAA;AAClE;AAoBA,SAAwBC,IAAsB;CAC5C,IAAM,EAAE,QAAK,OAAOC,EAAU,GACxB,EAAE,gBAAaC,EAAqB,GACpCC,IAAiBC,EAAkB;EAAE,OAAO;EAAK,QAAQ;CAAE,CAAC,GAC5DC,IAAqBC,EAAsB;EAAE,OAAO;EAAK,QAAQ;CAAE,CAAC,GACpEC,IAAkBC,EAA8B,IAAI,GAEpDC,IAAWd,SACPQ,EAAe,MAAM,UAAU,SAAS,CAAC,EAAA,CAAqB,MAAM,MAASO,EAAK,OAAOC,CAAE,GACnG,CAACA,GAAIR,EAAe,IAAI,CAC1B,GACMS,IAAgBjB,SAEhBU,EAAmB,MAAM,cAAc,SAAS,CAAC,EAAA,CAAyB,QACzE,MAAiBQ,EAAa,eAAeF,CAChD,GACF,CAACA,GAAIN,EAAmB,IAAI,CAC9B;CAEA,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACS,GAAD,EAAA,UAAa,qPAIA,CA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AttendeeProfilePage.js","names":["AttendeeConversation","conversationContext","useMemo","attendeeId","attendeeName","useRegisterPageConversationContext","ContextConversationWidget","AttendeeProfilePage","useParams","useEventfullyManaged","attendeesQuery","useAttendeesQuery","registrationsQuery","useRegistrationsQuery","conversationRef","useRef","attendee","item","id","registrations","registration","historyQuery","useAttendeeHistoryQuery","history","PagePurpose","EmphasisPanel","GradientText","GlassCard","EntityListSection","entry","Button","navigate","AttendeeRecommendations","NextSteps","Ticket","Users","MessageSquare"],"sources":["../../../../src/eventfullymanaged/pages/modules/AttendeeProfilePage.tsx"],"sourcesContent":["import { MessageSquare, Ticket, Users } from 'lucide-react';\nimport { ContextConversationWidget } from '@burdenoff/fe-libs/shared';\nimport { useRegisterPageConversationContext } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { EmphasisPanel, GlassCard, GradientText, NextSteps, PagePurpose, Button } from '@burdenoff/fe-libs/ui';\nimport { useMemo, useRef } from 'react';\nimport { useParams } from 'react-router';\n\nimport {\n type AttendeeHistoryEntryGql,\n useAttendeeHistoryQuery,\n useAttendeesQuery,\n useRegistrationsQuery,\n} from '../../api/eventApi';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { AttendeeRecommendations } from './AttendeeRecommendations';\nimport { EntityListSection } from './EntityListSection';\n\n/**\n * Direct message thread with a single attendee, backed by wspace-conversations-svc.\n * Kept as a dedicated component so `useRegisterPageConversationContext` scopes the\n * thread to this attendee (entityType + entityId) and unregisters on unmount.\n */\nfunction AttendeeConversation({ attendeeId, attendeeName }: { attendeeId: string; attendeeName: string }) {\n // Stable reference: `useRegisterPageConversationContext` keys its effect on this\n // object's identity, so a fresh inline object every render would loop the shared\n // PageConversationContextProvider (see NetworkingPage for the full rationale).\n const conversationContext = useMemo(\n () => ({\n entityType: 'EVENTFULLYMANAGED_ATTENDEE',\n entityId: attendeeId,\n contextTitle: `Attendee · ${attendeeName}`,\n }),\n [attendeeId, attendeeName]\n );\n useRegisterPageConversationContext(conversationContext);\n return <ContextConversationWidget widgetKey=\"attendee-message\" />;\n}\n\ntype AttendeeRow = {\n id: string;\n eventId?: string;\n fullName?: string;\n email?: string;\n company?: string;\n role?: string;\n};\n\ntype RegistrationRow = {\n id: string;\n attendeeId?: string;\n status?: string;\n quantity?: number;\n currency?: string;\n totalAmount?: string;\n};\n\nexport default function AttendeeProfilePage() {\n const { id = '' } = useParams();\n const { navigate } = useEventfullyManaged();\n const attendeesQuery = useAttendeesQuery({ limit: 100, offset: 0 });\n const registrationsQuery = useRegistrationsQuery({ limit: 100, offset: 0 });\n const conversationRef = useRef<HTMLDivElement | null>(null);\n\n const attendee = useMemo(\n () => ((attendeesQuery.data?.attendees.items ?? []) as AttendeeRow[]).find((item) => item.id === id),\n [id, attendeesQuery.data]\n );\n const registrations = useMemo(\n () =>\n ((registrationsQuery.data?.registrations.items ?? []) as RegistrationRow[]).filter(\n (registration) => registration.attendeeId === id\n ),\n [id, registrationsQuery.data]\n );\n // BOFF-5893 — cross-event history: every event this person attended or\n // registered for in the workspace, linked by email.\n const historyQuery = useAttendeeHistoryQuery({ email: attendee?.email });\n const history = useMemo(\n () => (historyQuery.data?.attendeeHistory ?? []) as AttendeeHistoryEntryGql[],\n [historyQuery.data]\n );\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n A single view of one attendee — who they are and everything they have registered for. Use this when you need to\n look someone up: verify their ticket, answer a support question, or understand their history with your events\n before reaching out.\n </PagePurpose>\n\n <EmphasisPanel>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Attendee</GradientText> Profile\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {attendeesQuery.loading\n ? 'Loading attendee profile...'\n : attendee\n ? `${attendee.fullName ?? attendee.id} profile from registration and attendee APIs.`\n : 'Attendee not found in current query scope.'}\n </p>\n {attendee ? (\n <div className=\"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n <GlassCard treatment=\"metric\" className=\"p-3\">\n <p className=\"text-xs uppercase tracking-wide text-text-secondary\">Name</p>\n <p className=\"mt-1 font-medium text-text-primary\">{attendee.fullName ?? attendee.id}</p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"p-3\">\n <p className=\"text-xs uppercase tracking-wide text-text-secondary\">Email</p>\n <p className=\"mt-1 font-medium text-text-primary\">{attendee.email ?? 'Unavailable'}</p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"p-3\">\n <p className=\"text-xs uppercase tracking-wide text-text-secondary\">Company</p>\n <p className=\"mt-1 font-medium text-text-primary\">{attendee.company ?? 'Unavailable'}</p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"p-3\">\n <p className=\"text-xs uppercase tracking-wide text-text-secondary\">Role</p>\n <p className=\"mt-1 font-medium text-text-primary\">{attendee.role ?? 'Unavailable'}</p>\n </GlassCard>\n </div>\n ) : null}\n </EmphasisPanel>\n\n <EntityListSection\n heading={\n registrationsQuery.loading ? 'Loading attendee registrations...' : `Registrations (${registrations.length})`\n }\n emptyLabel=\"No registrations linked to this attendee.\"\n rows={registrations.map((registration) => ({\n id: registration.id,\n title: `Registration ${registration.id}`,\n subtitle: [\n registration.quantity ? `Qty ${registration.quantity}` : undefined,\n registration.totalAmount ? `${registration.totalAmount} ${registration.currency ?? ''}` : undefined,\n ]\n .filter(Boolean)\n .join(' • '),\n status: registration.status,\n }))}\n />\n\n {attendee?.email ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {historyQuery.loading ? 'Loading event history…' : `Event History (${history.length})`}\n </h2>\n </div>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Every event this person registered for or attended in this workspace, matched by email.\n </p>\n <div className=\"mt-4\">\n {history.length === 0 && !historyQuery.loading ? (\n <p className=\"py-6 text-center text-sm text-text-secondary\">No other events found for this email.</p>\n ) : (\n <ul className=\"space-y-2.5\">\n {history.map((entry) => (\n <li\n key={`${entry.attendeeId}-${entry.eventId}`}\n className=\"flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3\"\n >\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{entry.eventName}</p>\n <p className=\"truncate text-xs text-text-secondary\">\n {entry.registrationStatus\n ? `Registration ${entry.registrationStatus.toLowerCase()}`\n : 'No registration'}\n {entry.checkedIn ? ' • Checked in' : ''}\n </p>\n </div>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n onClick={() => navigate(`/events/${entry.eventId}`)}\n >\n View event\n </Button>\n </li>\n ))}\n </ul>\n )}\n </div>\n </GlassCard>\n ) : null}\n\n {attendee?.eventId ? (\n <AttendeeRecommendations\n attendeeId={attendee.id}\n eventId={attendee.eventId}\n attendees={(attendeesQuery.data?.attendees.items ?? []) as AttendeeRow[]}\n />\n ) : null}\n\n {id ? (\n <div ref={conversationRef} className=\"space-y-3\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Messages</h2>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Start a direct conversation with this attendee. Threads and attachments are handled by the shared\n conversations service.\n </p>\n </div>\n <AttendeeConversation attendeeId={id} attendeeName={attendee?.fullName ?? attendee?.id ?? id} />\n </div>\n ) : null}\n\n <NextSteps\n storageKey=\"eventfullymanaged-attendee-profile\"\n title=\"Act on this attendee\"\n steps={[\n {\n id: 'view-registrations',\n label: 'Review all registrations',\n description: 'See the full registration list to manage tickets and payments.',\n icon: <Ticket className=\"h-4 w-4\" />,\n onClick: () => navigate('/registration'),\n },\n {\n id: 'networking',\n label: 'Find networking matches',\n description: 'Connect this attendee with relevant people and meetings.',\n icon: <Users className=\"h-4 w-4\" />,\n onClick: () => navigate('/networking'),\n },\n {\n id: 'reach-out',\n label: 'Send a message',\n description: 'Open a direct conversation thread with this attendee.',\n icon: <MessageSquare className=\"h-4 w-4\" />,\n onClick: () => conversationRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' }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AU;IAArC,UAAA,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KAA0C,UAAA;IAAY,CAAA,GACpE,kBAAC,KAAD;KAAG,WAAU;KAAmC,UAAA;IAG7C,CAAA,CACA,EAAA,CAAA,GACL,kBAACd,GAAD;KAAsB,YAAYkB;KAAI,cAAcF,GAAU,YAAYA,GAAU,MAAME;IAAK,CAAA,CAC5F;GACH,CAAA,IAAA;GAEJ,kBAACe,GAAD;IACE,YAAW;IACX,OAAM;IACN,OAAO;KACL;MACE,IAAI;MACJ,OAAO;MACP,aAAa;MACb,MAAM,kBAACC,GAAD,EAAQ,WAAU,UAAW,CAAA;MACnC,eAAeH,EAAS,eAAe;KACzC;KACA;MACE,IAAI;MACJ,OAAO;MACP,aAAa;MACb,MAAM,kBAACI,GAAD,EAAO,WAAU,UAAW,CAAA;MAClC,eAAeJ,EAAS,aAAa;KACvC;KACA;MACE,IAAI;MACJ,OAAO;MACP,aAAa;MACb,MAAM,kBAACK,GAAD,EAAe,WAAU,UAAW,CAAA;MAC1C,eAAetB,EAAgB,SAAS,eAAe;OAAE,UAAU;OAAU,OAAO;MAAQ,CAAC;KAC/F;IACF;GACD,CAAA;EACE;;AAET"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Workspace event templates (BOFF-5893). Listed on the Events page; a
3
+ * template is saved from an event's detail page and instantiates a new DRAFT
4
+ * event with the template's sessions, ticket types and sponsors already in
5
+ * place.
6
+ */
7
+ export declare function EventTemplatesSection(): import('react').JSX.Element;
@@ -0,0 +1,173 @@
1
+ import { useCreateEventFromTemplateMutation as e, useDeleteEventTemplateMutation as t, useEventTemplatesQuery as n } from "../../api/eventApi.js";
2
+ import { Pagination as r, usePagination as i } from "../../components/Pagination.js";
3
+ import { useEventfullyManaged as a } from "../../context/EventfullyManagedContext.js";
4
+ import { describeError as o, mutationSucceeded as s } from "../../lib/mutationResult.js";
5
+ import { notify as c } from "../../lib/toast.js";
6
+ import { useMemo as l, useState as u } from "react";
7
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
+ import { CopyPlus as p, LayoutTemplate as m, Trash2 as h } from "lucide-react";
9
+ import { Badge as g, Button as _, GlassCard as v, Input as y } from "@burdenoff/fe-libs/ui";
10
+ // src/eventfullymanaged/pages/modules/EventTemplatesSection.tsx
11
+ function b(e) {
12
+ let t = e.getTimezoneOffset() * 6e4;
13
+ return new Date(e.getTime() - t).toISOString().slice(0, 16);
14
+ }
15
+ function x(e) {
16
+ if (!e) return null;
17
+ let t = new Date(e);
18
+ return Number.isNaN(t.getTime()) ? null : t.toISOString();
19
+ }
20
+ function S() {
21
+ let { navigate: S } = a(), C = i({ pageSize: 10 }), w = n({
22
+ limit: C.limit,
23
+ offset: C.offset
24
+ }), [T, { loading: E }] = e(), [D, { loading: O }] = t(), [k, A] = u(null), [j, M] = u(""), [N, P] = u(""), [F, I] = u(""), L = l(() => w.data?.eventTemplates.items ?? [], [w.data]), R = w.data?.eventTemplates.total ?? 0, z = (e) => {
25
+ A(e.id), M(`${e.name} — next edition`), P(() => b(new Date(Date.now() + 6048e5))), I(() => b(new Date(Date.now() + 6048e5 + 108e5)));
26
+ }, B = async (e) => {
27
+ let t = x(N);
28
+ if (!j.trim() || !t) {
29
+ c.error("A name and a start date are required");
30
+ return;
31
+ }
32
+ let n = "Could not create the event from this template";
33
+ try {
34
+ let r = await T({ variables: { input: {
35
+ templateId: e.id,
36
+ name: j,
37
+ startAt: t,
38
+ endAt: x(F)
39
+ } } }), i = r.data?.createEventFromTemplate;
40
+ if (!s(r, i?.id, n)) return;
41
+ c.success(`Event "${i?.name ?? ""}" created from the template`), A(null), S(`/events/${i?.id}`);
42
+ } catch (e) {
43
+ c.error(n, o(e));
44
+ }
45
+ }, V = async (e) => {
46
+ let t = "Could not delete the template";
47
+ try {
48
+ let n = await D({ variables: { id: e.id } });
49
+ if (!s(n, n.data?.deleteEventTemplate === !0 ? e.id : void 0, t)) return;
50
+ c.success("Template deleted");
51
+ } catch (e) {
52
+ c.error(t, o(e));
53
+ }
54
+ };
55
+ return /* @__PURE__ */ f(v, {
56
+ treatment: "plain",
57
+ className: "border-border-seam p-5",
58
+ children: [
59
+ /* @__PURE__ */ d("div", {
60
+ className: "flex items-center justify-between",
61
+ children: /* @__PURE__ */ d("h2", {
62
+ className: "text-lg font-semibold text-text-primary",
63
+ children: w.loading ? "Loading templates…" : `Event Templates (${R})`
64
+ })
65
+ }),
66
+ /* @__PURE__ */ d("p", {
67
+ className: "mt-1 text-sm text-text-secondary",
68
+ children: "Reusable blueprints of your best events. Save any event as a template from its detail page, then spin up the next edition with sessions, ticket types and sponsors already in place."
69
+ }),
70
+ /* @__PURE__ */ f("div", {
71
+ className: "mt-4",
72
+ children: [L.length === 0 && !w.loading ? /* @__PURE__ */ d("p", {
73
+ className: "py-8 text-center text-sm text-text-secondary",
74
+ children: "No templates yet. Open an event and use “Save as template”."
75
+ }) : /* @__PURE__ */ d("ul", {
76
+ className: "space-y-2.5",
77
+ children: L.map((e) => /* @__PURE__ */ f("li", {
78
+ className: "rounded-card border border-border-seam bg-bg-surface p-3",
79
+ children: [/* @__PURE__ */ f("div", {
80
+ className: "flex items-center justify-between gap-3",
81
+ children: [/* @__PURE__ */ f("div", {
82
+ className: "min-w-0",
83
+ children: [/* @__PURE__ */ d("p", {
84
+ className: "truncate font-medium text-text-primary",
85
+ children: e.name
86
+ }), e.description ? /* @__PURE__ */ d("p", {
87
+ className: "truncate text-xs text-text-secondary",
88
+ children: e.description
89
+ }) : null]
90
+ }), /* @__PURE__ */ f("div", {
91
+ className: "flex shrink-0 items-center gap-2",
92
+ children: [
93
+ e.sourceEventId ? /* @__PURE__ */ d(g, {
94
+ variant: "info",
95
+ className: "uppercase",
96
+ children: "From event"
97
+ }) : null,
98
+ /* @__PURE__ */ f(_, {
99
+ type: "button",
100
+ size: "sm",
101
+ variant: "outline",
102
+ "aria-label": `Use template ${e.name}`,
103
+ onClick: () => z(e),
104
+ children: [/* @__PURE__ */ d(p, { className: "h-3.5 w-3.5" }), "Use template"]
105
+ }),
106
+ /* @__PURE__ */ d(_, {
107
+ type: "button",
108
+ size: "sm",
109
+ variant: "outline",
110
+ "aria-label": `Delete template ${e.name}`,
111
+ disabled: O,
112
+ onClick: () => void V(e),
113
+ children: /* @__PURE__ */ d(h, { className: "h-3.5 w-3.5" })
114
+ })
115
+ ]
116
+ })]
117
+ }), k === e.id ? /* @__PURE__ */ f("div", {
118
+ className: "mt-3 grid gap-3 border-t border-border-seam pt-3 sm:grid-cols-2 lg:grid-cols-4",
119
+ children: [
120
+ /* @__PURE__ */ d(y, {
121
+ value: j,
122
+ onChange: (e) => M(e.target.value),
123
+ "aria-label": "New event name",
124
+ placeholder: "New event name"
125
+ }),
126
+ /* @__PURE__ */ d(y, {
127
+ type: "datetime-local",
128
+ value: N,
129
+ onChange: (e) => P(e.target.value),
130
+ "aria-label": "New event start"
131
+ }),
132
+ /* @__PURE__ */ d(y, {
133
+ type: "datetime-local",
134
+ value: F,
135
+ onChange: (e) => I(e.target.value),
136
+ "aria-label": "New event end"
137
+ }),
138
+ /* @__PURE__ */ f("div", {
139
+ className: "flex items-center gap-2",
140
+ children: [/* @__PURE__ */ f(_, {
141
+ type: "button",
142
+ size: "sm",
143
+ onClick: () => void B(e),
144
+ disabled: E,
145
+ children: [/* @__PURE__ */ d(m, { className: "h-3.5 w-3.5" }), E ? "Creating…" : "Create event"]
146
+ }), /* @__PURE__ */ d(_, {
147
+ type: "button",
148
+ size: "sm",
149
+ variant: "ghost",
150
+ onClick: () => A(null),
151
+ children: "Cancel"
152
+ })]
153
+ })
154
+ ]
155
+ }) : null]
156
+ }, e.id))
157
+ }), /* @__PURE__ */ d(r, {
158
+ offset: C.offset,
159
+ limit: C.limit,
160
+ loadedCount: L.length,
161
+ total: R,
162
+ onPrev: C.prevPage,
163
+ onNext: C.nextPage,
164
+ itemLabel: "templates",
165
+ loading: w.loading
166
+ })]
167
+ })
168
+ ]
169
+ });
170
+ }
171
+ export { S as EventTemplatesSection };
172
+
173
+ //# sourceMappingURL=EventTemplatesSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventTemplatesSection.js","names":["Badge","Badge$1","isoToLocalInput","offsetMs","date","localInputToIso","value","EventTemplatesSection","useEventfullyManaged","pagination","usePagination","templatesQuery","useEventTemplatesQuery","createFromTemplate","creating","useCreateEventFromTemplateMutation","deleteTemplate","deleting","useDeleteEventTemplateMutation","draftFor","setDraftFor","useState","draftName","setDraftName","draftStart","setDraftStart","draftEnd","setDraftEnd","templates","useMemo","total","openDraft","template","onCreateEvent","startAt","failureMessage","response","created","mutationSucceeded","notify","navigate","error","describeError","onDelete","GlassCard","Button","CopyPlus","Trash2","Input","LayoutTemplate","Pagination"],"sources":["../../../../src/eventfullymanaged/pages/modules/EventTemplatesSection.tsx"],"sourcesContent":["import { CopyPlus, LayoutTemplate, Trash2 } from 'lucide-react';\nimport { Badge, Button, GlassCard, Input } from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport {\n type EventTemplateGql,\n useCreateEventFromTemplateMutation,\n useDeleteEventTemplateMutation,\n useEventTemplatesQuery,\n} from '../../api/eventApi';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\n/** ISO timestamp -> value for <input type=\"datetime-local\"> (local time, minute precision). */\nfunction isoToLocalInput(date: Date): string {\n const offsetMs = date.getTimezoneOffset() * 60_000;\n return new Date(date.getTime() - offsetMs).toISOString().slice(0, 16);\n}\n\n/** datetime-local value -> ISO timestamp for the DateTime scalar. */\nfunction localInputToIso(value: string): string | null {\n if (!value) return null;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? null : date.toISOString();\n}\n\n/**\n * Workspace event templates (BOFF-5893). Listed on the Events page; a\n * template is saved from an event's detail page and instantiates a new DRAFT\n * event with the template's sessions, ticket types and sponsors already in\n * place.\n */\nexport function EventTemplatesSection() {\n const { navigate } = useEventfullyManaged();\n const pagination = usePagination({ pageSize: 10 });\n const templatesQuery = useEventTemplatesQuery({ limit: pagination.limit, offset: pagination.offset });\n const [createFromTemplate, { loading: creating }] = useCreateEventFromTemplateMutation();\n const [deleteTemplate, { loading: deleting }] = useDeleteEventTemplateMutation();\n\n const [draftFor, setDraftFor] = useState<string | null>(null);\n const [draftName, setDraftName] = useState('');\n const [draftStart, setDraftStart] = useState('');\n const [draftEnd, setDraftEnd] = useState('');\n\n const templates = useMemo(\n () => (templatesQuery.data?.eventTemplates.items ?? []) as EventTemplateGql[],\n [templatesQuery.data]\n );\n const total = templatesQuery.data?.eventTemplates.total ?? 0;\n\n const openDraft = (template: EventTemplateGql) => {\n // Lazily compute the default window only when the draft opens, so the\n // render path stays pure (react-hooks/purity).\n setDraftFor(template.id);\n setDraftName(`${template.name} — next edition`);\n setDraftStart(() => isoToLocalInput(new Date(Date.now() + 7 * 24 * 3600 * 1000)));\n setDraftEnd(() => isoToLocalInput(new Date(Date.now() + 7 * 24 * 3600 * 1000 + 3 * 3600 * 1000)));\n };\n\n const onCreateEvent = async (template: EventTemplateGql) => {\n const startAt = localInputToIso(draftStart);\n if (!draftName.trim() || !startAt) {\n notify.error('A name and a start date are required');\n return;\n }\n const failureMessage = 'Could not create the event from this template';\n try {\n const response = await createFromTemplate({\n variables: {\n input: {\n templateId: template.id,\n name: draftName,\n startAt,\n endAt: localInputToIso(draftEnd),\n },\n },\n });\n const created = response.data?.createEventFromTemplate;\n if (!mutationSucceeded(response, created?.id, failureMessage)) return;\n notify.success(`Event \"${created?.name ?? ''}\" created from the template`);\n setDraftFor(null);\n navigate(`/events/${created?.id}`);\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n const onDelete = async (template: EventTemplateGql) => {\n const failureMessage = 'Could not delete the template';\n try {\n const response = await deleteTemplate({ variables: { id: template.id } });\n if (\n !mutationSucceeded(\n response,\n response.data?.deleteEventTemplate === true ? template.id : undefined,\n failureMessage\n )\n )\n return;\n notify.success('Template deleted');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n return (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {templatesQuery.loading ? 'Loading templates…' : `Event Templates (${total})`}\n </h2>\n </div>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Reusable blueprints of your best events. Save any event as a template from its detail page, then spin up the\n next edition with sessions, ticket types and sponsors already in place.\n </p>\n <div className=\"mt-4\">\n {templates.length === 0 && !templatesQuery.loading ? (\n <p className=\"py-8 text-center text-sm text-text-secondary\">\n No templates yet. Open an event and use “Save as template”.\n </p>\n ) : (\n <ul className=\"space-y-2.5\">\n {templates.map((template) => (\n <li key={template.id} className=\"rounded-card border border-border-seam bg-bg-surface p-3\">\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{template.name}</p>\n {template.description ? (\n <p className=\"truncate text-xs text-text-secondary\">{template.description}</p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {template.sourceEventId ? (\n <Badge variant=\"info\" className=\"uppercase\">\n From event\n </Badge>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n aria-label={`Use template ${template.name}`}\n onClick={() => openDraft(template)}\n >\n <CopyPlus className=\"h-3.5 w-3.5\" />\n Use template\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n aria-label={`Delete template ${template.name}`}\n disabled={deleting}\n onClick={() => void onDelete(template)}\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n </div>\n {draftFor === template.id ? (\n <div className=\"mt-3 grid gap-3 border-t border-border-seam pt-3 sm:grid-cols-2 lg:grid-cols-4\">\n <Input\n value={draftName}\n onChange={(e) => setDraftName(e.target.value)}\n aria-label=\"New event name\"\n placeholder=\"New event name\"\n />\n <Input\n type=\"datetime-local\"\n value={draftStart}\n onChange={(e) => setDraftStart(e.target.value)}\n aria-label=\"New event start\"\n />\n <Input\n type=\"datetime-local\"\n value={draftEnd}\n onChange={(e) => setDraftEnd(e.target.value)}\n aria-label=\"New event end\"\n />\n <div className=\"flex items-center gap-2\">\n <Button type=\"button\" size=\"sm\" onClick={() => void onCreateEvent(template)} disabled={creating}>\n <LayoutTemplate className=\"h-3.5 w-3.5\" />\n {creating ? 'Creating…' : 'Create event'}\n </Button>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={() => setDraftFor(null)}>\n Cancel\n </Button>\n </div>\n </div>\n ) : null}\n </li>\n ))}\n </ul>\n )}\n <Pagination\n offset={pagination.offset}\n limit={pagination.limit}\n loadedCount={templates.length}\n total={total}\n onPrev={pagination.prevPage}\n onNext={pagination.nextPage}\n itemLabel=\"templates\"\n loading={templatesQuery.loading}\n />\n </div>\n </GlassCard>\n );\n}\n"],"mappings":";;;;;;;;;;AAgBA,SAASE,EAAgB,GAAoB;CAC3C,IAAMC,IAAWC,EAAK,kBAAkB,IAAI;CAC5C,OAAO,IAAI,KAAKA,EAAK,QAAQ,IAAID,CAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;AACtE;AAGA,SAASE,EAAgB,GAA8B;CACrD,IAAI,CAACC,GAAO,OAAO;CACnB,IAAMF,IAAO,IAAI,KAAKE,CAAK;CAC3B,OAAO,OAAO,MAAMF,EAAK,QAAQ,CAAC,IAAI,OAAOA,EAAK,YAAY;AAChE;AAQA,SAAgBG,IAAwB;CACtC,IAAM,EAAE,gBAAaC,EAAqB,GACpCC,IAAaC,EAAc,EAAE,UAAU,GAAG,CAAC,GAC3CC,IAAiBC,EAAuB;EAAE,OAAOH,EAAW;EAAO,QAAQA,EAAW;CAAO,CAAC,GAC9F,CAACI,GAAoB,EAAE,SAASC,OAAcC,EAAmC,GACjF,CAACC,GAAgB,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