@semics-tech/emdash-events 1.0.0-rc.1 → 1.0.0-rc.10

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.
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The look of the plugins' own full pages (`/booking`, the suite's `/_events/waiver`), which run outside the
3
+ * site's layout: a default stylesheet built only on the `--events-*` properties, and what a site sets through
4
+ * `eventsIntegration({ page })` / `eventsSuite({ page })`. It is one exact string so the signing page can allow
5
+ * it by hash (its CSP allows nothing else inline, `ceremonyCsp`). Web APIs only (R35).
6
+ *
7
+ * The site's own layout is deliberately not wrapped around these pages: an emailed link's one-time code is in the
8
+ * URL here, and a signing page's CSP would block the layout's scripts and styles anyway.
9
+ */
10
+ /** A theme value by property: `accent` sets `--events-accent` (the signing form follows, see `PAGE_CSS`). */
11
+ export declare const THEME_PROPERTIES: readonly ["fg", "muted", "bg", "border", "accent", "accent-fg", "error", "success", "radius", "font", "page-bg", "heading-font", "heading-fg"];
12
+ export type ThemeProperty = (typeof THEME_PROPERTIES)[number];
13
+ export interface PageBrand {
14
+ /** The site's name: the link's text, or the logo's alternative text. Also the organiser at the page's foot. */
15
+ name: string;
16
+ /** Where it links, a path on this site (default `/`). */
17
+ href?: string;
18
+ /** A logo, a path on this site. */
19
+ logo?: string;
20
+ /** The organiser's postal address, one line, at the page's foot and on a printed booking (T157). */
21
+ address?: string;
22
+ }
23
+ export interface PageOptions {
24
+ /** Values for the pages' custom properties, for example `{ accent: "#1f3a2e", "page-bg": "#f6f1ea" }`. */
25
+ theme?: Partial<Record<ThemeProperty, string>>;
26
+ /** A stylesheet on this site, loaded after the defaults: for `@font-face`, or any further rules. */
27
+ stylesheet?: string;
28
+ /** The site's name or logo at the top of each page. */
29
+ brand?: PageBrand;
30
+ /** The event's page, where "Book again" goes: a path with `{slug}` (default `/events/{slug}`). */
31
+ eventPath?: string;
32
+ }
33
+ /** Checks a site's page options when the site's config loads; a bad value stops the build with its name. */
34
+ export declare function checkPageOptions(page?: PageOptions): PageOptions;
35
+ /** The event's page for "Book again"; undefined when the booking does not know its slug. */
36
+ export declare function eventPageHref(slug: string | null | undefined, eventPath?: string): string | undefined;
37
+ /**
38
+ * Works with no site theme at all. Zero specificity on elements, so the components' own rules win; except the card
39
+ * rule for `main`'s sections, which outranks a component's own box (`.semics-payment`, `.semics-attendee-list`) so
40
+ * every card has the same edges, width and look (T158).
41
+ */
42
+ export declare const PAGE_CSS = "*,*::before,*::after{box-sizing:border-box}\nhtml{color-scheme:light;-webkit-text-size-adjust:100%}\nbody.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg, #f5f4f0);color:var(--events-fg, #1a1a1a);font-family:var(--events-font, system-ui, sans-serif);font-size:1.0625rem;line-height:1.55;overflow-wrap:anywhere;\n--esign-fg:var(--events-fg, #1a1a1a);--esign-muted:var(--events-muted, #4a4a4a);--esign-bg:var(--events-bg, #ffffff);--esign-border:var(--events-border, #6b6b6b);--esign-accent:var(--events-accent, #0b57d0);--esign-accent-fg:var(--events-accent-fg, #ffffff);--esign-error:var(--events-error, #b3261e);--esign-radius:var(--events-radius, 6px);--esign-font:var(--events-font, system-ui, sans-serif)}\n.semics-page-brand{max-inline-size:40rem;margin-inline:auto;padding:1.25rem 1rem 0;font-family:var(--events-heading-font, inherit);font-weight:600}\n.semics-page-brand a{color:var(--events-heading-fg, inherit);text-decoration:none}\n.semics-page-brand img{display:block;block-size:2.5rem;inline-size:auto;max-inline-size:100%}\n.semics-page-main{max-inline-size:40rem;margin-inline:auto;padding:1.5rem 1rem 2rem}\n:where(.semics-page) :is(h1,h2,h3){margin:0 0 .75rem;font-family:var(--events-heading-font, inherit);color:var(--events-heading-fg, inherit);line-height:1.2}\n:where(.semics-page) h1{margin-block-end:1.25rem;font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}\n:where(.semics-page) h2{font-size:1.25rem}\n:where(.semics-page) h3{font-size:1.0625rem}\n:where(.semics-page) p{margin:0 0 .75rem}\n:where(.semics-page) a{color:var(--events-accent, #0b57d0);text-underline-offset:.2em}\n:where(.semics-page) :focus-visible{outline:3px solid var(--events-accent, #0b57d0);outline-offset:2px}\n.semics-page-main > :is(section,form:not([hidden]),.semics-ceremony){margin-block:0 1.25rem;padding:clamp(1.25rem,.9rem + 1.8vw,1.75rem);background:var(--events-bg, #ffffff);border:1px solid color-mix(in srgb,var(--events-border, #6b6b6b) 30%,transparent);border-radius:calc(var(--events-radius, 6px) + 6px);box-shadow:0 1px 2px rgb(0 0 0 / .04),0 6px 24px rgb(0 0 0 / .05);max-inline-size:none}\n:where(.semics-page-main > section,.semics-page-main > form,.semics-page-main > .semics-ceremony) > :last-child{margin-block-end:0}\n:where(.semics-page) [role=\"alert\"]{padding:.75rem 1rem;border:1px solid var(--events-error, #b3261e);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-error, #b3261e)}\n:where(.semics-page) :is(input:not([type=\"checkbox\"],[type=\"radio\"],[type=\"hidden\"]),select,textarea){font:inherit;inline-size:100%;min-block-size:2.75rem;padding:.5rem .75rem;border:1px solid var(--events-border, #6b6b6b);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-fg, #1a1a1a)}\n:where(.semics-page) label{display:block}\n:where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}\n:where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}\n:where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}\n.semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}\n.semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}\n.semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}\n.semics-page-organiser p{margin:0}\n.semics-page-organiser address{font-style:normal}\n@media print{\n@page{margin:15mm}\nbody.semics-page{min-block-size:0;background:#ffffff;color:#000000;font-size:11pt}\n.semics-page-brand,.semics-page-actions,.semics-page-main form,.semics-page-main button,.semics-page-main details,.semics-add-to-calendar,[data-semics-payment-live]{display:none !important}\n.semics-page-main{max-inline-size:none;padding:0}\n.semics-page-main > :is(section,form:not([hidden]),.semics-ceremony){box-shadow:none;border-color:#999999;break-inside:avoid}\n.semics-ticket-pass{break-inside:avoid}\n.semics-page-organiser{max-inline-size:none;padding:1rem 0 0;color:#000000}\n}\n";
43
+ /** The stylesheet for a page: the defaults, then the site's theme. Exact: the signing page hashes this text. */
44
+ export declare function pageCss(page?: PageOptions): string;
@@ -0,0 +1,122 @@
1
+ // i18n-ignore-file: a stylesheet and its option names, no text for people.
2
+ /**
3
+ * The look of the plugins' own full pages (`/booking`, the suite's `/_events/waiver`), which run outside the
4
+ * site's layout: a default stylesheet built only on the `--events-*` properties, and what a site sets through
5
+ * `eventsIntegration({ page })` / `eventsSuite({ page })`. It is one exact string so the signing page can allow
6
+ * it by hash (its CSP allows nothing else inline, `ceremonyCsp`). Web APIs only (R35).
7
+ *
8
+ * The site's own layout is deliberately not wrapped around these pages: an emailed link's one-time code is in the
9
+ * URL here, and a signing page's CSP would block the layout's scripts and styles anyway.
10
+ */
11
+ /** A theme value by property: `accent` sets `--events-accent` (the signing form follows, see `PAGE_CSS`). */
12
+ export const THEME_PROPERTIES = [
13
+ "fg",
14
+ "muted",
15
+ "bg",
16
+ "border",
17
+ "accent",
18
+ "accent-fg",
19
+ "error",
20
+ "success",
21
+ "radius",
22
+ "font",
23
+ "page-bg",
24
+ "heading-font",
25
+ "heading-fg",
26
+ ];
27
+ /** One line of text for people: 1 to 300 characters, no control characters (line breaks included). */
28
+ function oneLine(value) {
29
+ if (typeof value !== "string" || !value.trim() || value.length > 300)
30
+ return false;
31
+ for (let i = 0; i < value.length; i++) {
32
+ const unit = value.charCodeAt(i);
33
+ if (unit <= 0x1f || unit === 0x7f)
34
+ return false;
35
+ }
36
+ return true;
37
+ }
38
+ /** One line of CSS, nothing that could end the declaration, the rule or the `<style>` element. */
39
+ const THEME_VALUE = /^[^;{}<>\\@]{1,200}$/;
40
+ /** A path on this site; `;` and `,` would end a source in the signing page's CSP header. */
41
+ const SITE_PATH = /^\/(?!\/)[^\s"'<>\\;,]*$/;
42
+ /** Checks a site's page options when the site's config loads; a bad value stops the build with its name. */
43
+ export function checkPageOptions(page = {}) {
44
+ const refuse = (what) => {
45
+ throw new Error(`page.${what} is not valid`); // i18n-ignore
46
+ };
47
+ for (const [name, value] of Object.entries(page.theme ?? {})) {
48
+ const known = THEME_PROPERTIES.includes(name);
49
+ if (!known || typeof value !== "string" || !THEME_VALUE.test(value) || /url\(/i.test(value))
50
+ refuse(`theme.${name}`);
51
+ }
52
+ const { brand, stylesheet, eventPath } = page;
53
+ if (stylesheet !== undefined && !SITE_PATH.test(stylesheet))
54
+ refuse("stylesheet");
55
+ if (eventPath !== undefined && !(SITE_PATH.test(eventPath) && eventPath.includes("{slug}")))
56
+ refuse("eventPath");
57
+ if (brand) {
58
+ if (typeof brand.name !== "string" || !brand.name.trim())
59
+ refuse("brand.name");
60
+ if (brand.href !== undefined && !SITE_PATH.test(brand.href))
61
+ refuse("brand.href");
62
+ if (brand.logo !== undefined && !SITE_PATH.test(brand.logo))
63
+ refuse("brand.logo");
64
+ if (brand.address !== undefined && !oneLine(brand.address))
65
+ refuse("brand.address");
66
+ }
67
+ return page;
68
+ }
69
+ /** The event's page for "Book again"; undefined when the booking does not know its slug. */
70
+ export function eventPageHref(slug, eventPath) {
71
+ return slug ? (eventPath ?? "/events/{slug}").replace("{slug}", encodeURIComponent(slug)) : undefined;
72
+ }
73
+ /**
74
+ * Works with no site theme at all. Zero specificity on elements, so the components' own rules win; except the card
75
+ * rule for `main`'s sections, which outranks a component's own box (`.semics-payment`, `.semics-attendee-list`) so
76
+ * every card has the same edges, width and look (T158).
77
+ */
78
+ export const PAGE_CSS = `*,*::before,*::after{box-sizing:border-box}
79
+ html{color-scheme:light;-webkit-text-size-adjust:100%}
80
+ body.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg, #f5f4f0);color:var(--events-fg, #1a1a1a);font-family:var(--events-font, system-ui, sans-serif);font-size:1.0625rem;line-height:1.55;overflow-wrap:anywhere;
81
+ --esign-fg:var(--events-fg, #1a1a1a);--esign-muted:var(--events-muted, #4a4a4a);--esign-bg:var(--events-bg, #ffffff);--esign-border:var(--events-border, #6b6b6b);--esign-accent:var(--events-accent, #0b57d0);--esign-accent-fg:var(--events-accent-fg, #ffffff);--esign-error:var(--events-error, #b3261e);--esign-radius:var(--events-radius, 6px);--esign-font:var(--events-font, system-ui, sans-serif)}
82
+ .semics-page-brand{max-inline-size:40rem;margin-inline:auto;padding:1.25rem 1rem 0;font-family:var(--events-heading-font, inherit);font-weight:600}
83
+ .semics-page-brand a{color:var(--events-heading-fg, inherit);text-decoration:none}
84
+ .semics-page-brand img{display:block;block-size:2.5rem;inline-size:auto;max-inline-size:100%}
85
+ .semics-page-main{max-inline-size:40rem;margin-inline:auto;padding:1.5rem 1rem 2rem}
86
+ :where(.semics-page) :is(h1,h2,h3){margin:0 0 .75rem;font-family:var(--events-heading-font, inherit);color:var(--events-heading-fg, inherit);line-height:1.2}
87
+ :where(.semics-page) h1{margin-block-end:1.25rem;font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}
88
+ :where(.semics-page) h2{font-size:1.25rem}
89
+ :where(.semics-page) h3{font-size:1.0625rem}
90
+ :where(.semics-page) p{margin:0 0 .75rem}
91
+ :where(.semics-page) a{color:var(--events-accent, #0b57d0);text-underline-offset:.2em}
92
+ :where(.semics-page) :focus-visible{outline:3px solid var(--events-accent, #0b57d0);outline-offset:2px}
93
+ .semics-page-main > :is(section,form:not([hidden]),.semics-ceremony){margin-block:0 1.25rem;padding:clamp(1.25rem,.9rem + 1.8vw,1.75rem);background:var(--events-bg, #ffffff);border:1px solid color-mix(in srgb,var(--events-border, #6b6b6b) 30%,transparent);border-radius:calc(var(--events-radius, 6px) + 6px);box-shadow:0 1px 2px rgb(0 0 0 / .04),0 6px 24px rgb(0 0 0 / .05);max-inline-size:none}
94
+ :where(.semics-page-main > section,.semics-page-main > form,.semics-page-main > .semics-ceremony) > :last-child{margin-block-end:0}
95
+ :where(.semics-page) [role="alert"]{padding:.75rem 1rem;border:1px solid var(--events-error, #b3261e);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-error, #b3261e)}
96
+ :where(.semics-page) :is(input:not([type="checkbox"],[type="radio"],[type="hidden"]),select,textarea){font:inherit;inline-size:100%;min-block-size:2.75rem;padding:.5rem .75rem;border:1px solid var(--events-border, #6b6b6b);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-fg, #1a1a1a)}
97
+ :where(.semics-page) label{display:block}
98
+ :where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}
99
+ :where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}
100
+ :where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}
101
+ .semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}
102
+ .semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}
103
+ .semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}
104
+ .semics-page-organiser p{margin:0}
105
+ .semics-page-organiser address{font-style:normal}
106
+ @media print{
107
+ @page{margin:15mm}
108
+ body.semics-page{min-block-size:0;background:#ffffff;color:#000000;font-size:11pt}
109
+ .semics-page-brand,.semics-page-actions,.semics-page-main form,.semics-page-main button,.semics-page-main details,.semics-add-to-calendar,[data-semics-payment-live]{display:none !important}
110
+ .semics-page-main{max-inline-size:none;padding:0}
111
+ .semics-page-main > :is(section,form:not([hidden]),.semics-ceremony){box-shadow:none;border-color:#999999;break-inside:avoid}
112
+ .semics-ticket-pass{break-inside:avoid}
113
+ .semics-page-organiser{max-inline-size:none;padding:1rem 0 0;color:#000000}
114
+ }
115
+ `;
116
+ /** The stylesheet for a page: the defaults, then the site's theme. Exact: the signing page hashes this text. */
117
+ export function pageCss(page = {}) {
118
+ const set = Object.entries(page.theme ?? {});
119
+ if (set.length === 0)
120
+ return PAGE_CSS;
121
+ return `${PAGE_CSS}:root{${set.map(([name, value]) => `--events-${name}:${value}`).join(";")}}\n`;
122
+ }
@@ -1,3 +1,5 @@
1
+ import { type PageOptions } from "../astro/lib/page.ts";
2
+ export type { PageOptions };
1
3
  export interface EventsIntegrationOptions {
2
4
  /**
3
5
  * The sandboxed core's plugin id. Defaults to the slug (`semics-events`, npm installs).
@@ -15,6 +17,8 @@ export interface EventsIntegrationOptions {
15
17
  * for a booking waiting for signatures (the suite passes its own, T066). Without it nothing is reconciled.
16
18
  */
17
19
  reconcile?: string;
20
+ /** How the plugin's own pages look on this site: theme, stylesheet, brand, event page path (`PageOptions`). */
21
+ page?: PageOptions;
18
22
  }
19
23
  /** The slice of Astro's integration API this needs (so the package takes no `astro` dependency). */
20
24
  interface SetupArgs {
@@ -1,4 +1,5 @@
1
1
  import { EVENTS_PLUGIN_ID } from "../astro/lib/call.js";
2
+ import { checkPageOptions } from "../astro/lib/page.js";
2
3
  const VIRTUAL = "virtual:semics-events/config";
3
4
  const RESOLVED = `\0${VIRTUAL}`;
4
5
  /**
@@ -14,6 +15,7 @@ export function eventsIntegration(options = {}) {
14
15
  const pluginId = options.pluginId ?? EVENTS_PLUGIN_ID;
15
16
  const config = [
16
17
  `export const pluginId = ${JSON.stringify(pluginId)};`,
18
+ `export const page = ${JSON.stringify(checkPageOptions(options.page))};`,
17
19
  `export const esignPluginId = ${JSON.stringify(options.esignPluginId ?? null)};`,
18
20
  options.reconcile
19
21
  ? `export { reconcileBooking as reconcile } from ${JSON.stringify(options.reconcile)};`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@semics-tech/emdash-events",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.10",
4
4
  "type": "module",
5
5
  "main": "dist/index.mjs",
6
6
  "exports": {
@@ -25,6 +25,9 @@
25
25
  "./i18n": "./src/i18n/index.ts",
26
26
  "./client/*": "./src/client/*.ts",
27
27
  "./astro/BookingPage.astro": "./src/astro/BookingPage.astro",
28
+ "./astro/PageBrand.astro": "./src/astro/PageBrand.astro",
29
+ "./astro/PageOrganiser.astro": "./src/astro/PageOrganiser.astro",
30
+ "./astro/CancelBooking.astro": "./src/astro/CancelBooking.astro",
28
31
  "./astro/DoorSignPage.astro": "./src/astro/DoorSignPage.astro",
29
32
  "./astro/CheckIn.astro": "./src/astro/CheckIn.astro",
30
33
  "./astro/OptOutPage.astro": "./src/astro/OptOutPage.astro",
@@ -34,6 +37,7 @@
34
37
  "./astro/EventCard.astro": "./src/astro/EventCard.astro",
35
38
  "./astro/BookingStatus.astro": "./src/astro/BookingStatus.astro",
36
39
  "./astro/PaymentReturn.astro": "./src/astro/PaymentReturn.astro",
40
+ "./astro/AttendeeList.astro": "./src/astro/AttendeeList.astro",
37
41
  "./astro/TicketPass.astro": "./src/astro/TicketPass.astro",
38
42
  "./astro/AddToCalendar.astro": "./src/astro/AddToCalendar.astro"
39
43
  },
@@ -55,7 +59,7 @@
55
59
  "typescript": "^5.9.0",
56
60
  "vitest": "^4.1.12",
57
61
  "zod": "4.6.5",
58
- "@semics-tech/shared": "0.1.0-rc.1"
62
+ "@semics-tech/shared": "0.1.0-rc.2"
59
63
  },
60
64
  "description": "Events bookings and ticketing for EmDash",
61
65
  "license": "MIT",
@@ -6,6 +6,7 @@
6
6
  // and emails of attendees who have not signed, until the cutoff. Rows come from `signingRows`.
7
7
  import { around, pickLocale, translator } from "../i18n/index";
8
8
  import type { SigningRow } from "./lib/attendees";
9
+ import { zonedAt } from "./lib/list";
9
10
 
10
11
  interface Props {
11
12
  rows: SigningRow[];
@@ -13,25 +14,20 @@ interface Props {
13
14
  action: string;
14
15
  /** While names may be changed: the deadline (ISO). */
15
16
  editUntil?: string;
17
+ /** The event's time zone, for that deadline. */
18
+ zone?: string | null;
16
19
  locale?: string;
20
+ /** A waiver after payment (T160): a seat not signed reads "Waiver pending" (else "Waiting"). */
21
+ pending?: boolean;
17
22
  }
18
23
 
19
- const { rows, action, editUntil } = Astro.props;
24
+ const { rows, action, editUntil, zone, pending } = Astro.props;
20
25
  const locale = pickLocale(Astro.props.locale, Astro.currentLocale);
21
26
  const { t, lang, dir } = translator(locale);
22
27
  const editable = rows.filter((r) => r.canEdit);
23
28
  const [untilBefore, untilAfter] = around(t("booking.attendees.editUntil"), "time");
24
29
  const [emailedBefore, emailedAfter] = around(t("booking.attendees.emailed"), "email");
25
- const at = (iso: string) => {
26
- try {
27
- const time = new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short", timeZone: "UTC" }).format(
28
- new Date(iso),
29
- );
30
- return t("time.utc", { time });
31
- } catch {
32
- return iso;
33
- }
34
- };
30
+ const at = (iso: string) => zonedAt(iso, zone, locale);
35
31
  ---
36
32
  <section class="semics-events semics-attendee-list" data-testid="attendee-list" lang={lang} dir={dir} aria-labelledby="semics-attendees-title">
37
33
  <h2 id="semics-attendees-title">{t("booking.attendees.title")}</h2>
@@ -40,7 +36,7 @@ const at = (iso: string) => {
40
36
  rows.map((row) => (
41
37
  <li data-testid="attendee-row" data-seat={row.seat} data-signing={row.signed ? "signed" : "waiting"}>
42
38
  <span class="semics-attendee-name" id={`semics-attendee-${row.seat}`}>{row.name}</span>
43
- <span class="semics-status-badge">{row.signed ? t("booking.attendees.signed") : t("booking.attendees.waiting")}</span>
39
+ <span class="semics-status-badge">{row.signed ? t("booking.attendees.signed") : t(pending ? "booking.attendees.pending" : "booking.attendees.waiting")}</span>
44
40
  {row.minor && <p class="semics-attendee-note">{t("booking.attendees.minor")}</p>}
45
41
  {row.canResend && row.email && (
46
42
  <p class="semics-attendee-note">
@@ -73,6 +69,7 @@ const at = (iso: string) => {
73
69
  ))
74
70
  }
75
71
  </ul>
72
+ {rows.some((r) => r.canResend) && <p class="semics-attendee-note" data-testid="attendee-not-arrived">{t("booking.attendees.notArrived")}</p>}
76
73
  {
77
74
  editable.length > 0 && (
78
75
  <form method="post" action={action} class="semics-attendee-edit" data-testid="attendee-edit">
@@ -8,11 +8,14 @@
8
8
  // `src/client/receipt.ts` clears the fragment and posts the receipt here, which forwards it to the
9
9
  // core's `signatures/receipt` (no access token needed: the receipt is HMAC-signed) and redirects to
10
10
  // `?ref=&waiver=<outcome>`.
11
- import { esignPluginId, pluginId, reconcile } from "virtual:semics-events/config";
11
+ import { esignPluginId, page, pluginId, reconcile } from "virtual:semics-events/config";
12
12
 
13
13
  import { type MessageKey, pickLocale, translator } from "../i18n/index";
14
14
  import AddToCalendar from "./AddToCalendar.astro";
15
15
  import BookingStatus from "./BookingStatus.astro";
16
+ import CancelBooking from "./CancelBooking.astro";
17
+ import PageBrand from "./PageBrand.astro";
18
+ import PageOrganiser from "./PageOrganiser.astro";
16
19
  import PaymentReturn from "./PaymentReturn.astro";
17
20
  import { callPublicRoute } from "./lib/call";
18
21
  import {
@@ -27,10 +30,11 @@ import {
27
30
  resumePayment,
28
31
  } from "./lib/checkout-form";
29
32
  import AttendeeList from "./AttendeeList.astro";
30
- import { handleAttendeeAction, signingRows } from "./lib/attendees";
33
+ import { handleAttendeeAction, signingRows, waiverStep } from "./lib/attendees";
34
+ import { eventPageHref, pageCss } from "./lib/page";
31
35
  import { paymentView } from "./lib/payment";
32
36
  import { forwardReceipt } from "./lib/receipt";
33
- import { type BookingView, type PublicEvent, ticketNames } from "./lib/widget";
37
+ import { asOfNow, type BookingView, type PublicEvent, reconcileWanted, ticketNames } from "./lib/widget";
34
38
  import TicketPass from "./TicketPass.astro";
35
39
 
36
40
  export const prerender = false;
@@ -62,7 +66,7 @@ const CODES = [
62
66
  "ESIGN_NOT_CONFIGURED",
63
67
  ];
64
68
  const WAIVER_OUTCOMES = ["signed", "declined", "voided", "expired", "failed"];
65
- const ATTENDEE_OUTCOMES = ["saved", "resent"];
69
+ const ATTENDEE_OUTCOMES = ["saved", "resent", "invited"];
66
70
  const errorText = (code: string, fallback: MessageKey) =>
67
71
  CODES.includes(code) ? t(`booking.error.${code}` as MessageKey) : t(fallback);
68
72
 
@@ -138,7 +142,8 @@ if (ref && token) {
138
142
  else missing = true;
139
143
  // A booking waiting for signatures is reconciled with e-sign (the suite supplies `reconcile`): a signer who
140
144
  // closed the tab or signed by email has a receipt this page forwards, then it shows the booking afresh.
141
- if (booking?.waiver?.lookups && reconcile && esignPluginId) {
145
+ // An ended booking's open envelopes are voided the same way (Pro's void intents, T152).
146
+ if (reconcileWanted(booking) && reconcile && esignPluginId) {
142
147
  const done = await reconcile(ctx, { booking, pluginId, esignPluginId });
143
148
  if (done.forwarded > 0) {
144
149
  const fresh = await callPublicRoute<BookingView>(ctx, {
@@ -153,6 +158,7 @@ if (ref && token) {
153
158
  } else if (ref && !opening) {
154
159
  missing = true;
155
160
  }
161
+ if (booking) booking = asOfNow(booking, Date.now());
156
162
  // The attendee signing list's forms (T133): Sign now, Resend and Save, against the fresh answer.
157
163
  if (booking && form && ref && token) {
158
164
  const done = await handleAttendeeAction(ctx, form, { ref, token }, { pluginId, esignPluginId }, booking);
@@ -165,8 +171,11 @@ if (booking?.eventId) {
165
171
  if (event.ok) names = ticketNames(event.data);
166
172
  }
167
173
  const signingList = booking && !cancelled ? signingRows(booking) : null;
174
+ // A waiver that comes after payment (Events Pro, T160): the signing step leads the page while seats wait.
175
+ const waiverNext = booking && !cancelled ? waiverStep(booking) : null;
168
176
  const payment = booking && !cancelled ? paymentView(booking, locale) : null;
169
- const passes = booking && !cancelled && booking.status === "confirmed" ? booking.attendees.filter((a) => a.code) : [];
177
+ const confirmed = Boolean(booking && !cancelled && booking.status === "confirmed");
178
+ const passes = booking && confirmed ? booking.attendees.filter((a) => a.code) : [];
170
179
  ---
171
180
  <!doctype html>
172
181
  <html lang={lang} dir={dir}>
@@ -176,9 +185,12 @@ const passes = booking && !cancelled && booking.status === "confirmed" ? booking
176
185
  <meta name="robots" content="noindex" />
177
186
  <meta name="referrer" content="no-referrer" />
178
187
  <title>{t("booking.title")}</title>
188
+ <style is:inline set:html={pageCss(page)}></style>
189
+ {page.stylesheet && <link rel="stylesheet" href={page.stylesheet} />}
179
190
  </head>
180
- <body>
181
- <main class="semics-booking" data-testid="booking-page">
191
+ <body class="semics-page">
192
+ <PageBrand brand={page.brand} />
193
+ <main class="semics-booking semics-page-main" data-testid="booking-page">
182
194
  <h1>{t("booking.title")}</h1>
183
195
  <form method="post" action={ref ? `/booking?ref=${ref}` : "/booking"} data-semics-fragment="receipt" hidden>
184
196
  <input type="hidden" name="intent" value="receipt" />
@@ -195,14 +207,27 @@ const passes = booking && !cancelled && booking.status === "confirmed" ? booking
195
207
  </form>
196
208
  ) : booking ? (
197
209
  <>
198
- <BookingStatus booking={booking} cancelled={cancelled} cancelAction={`/booking?ref=${ref}`} ticketNames={names} locale={locale} />
210
+ <BookingStatus booking={booking} cancelled={cancelled} ticketNames={names} bookAgain={eventPageHref(booking.event?.slug, page.eventPath)} showAttendees={!signingList} locale={locale} />
199
211
  {payment && <PaymentReturn view={payment} bookingRef={ref} action={`/booking?ref=${ref}`} locale={locale} />}
212
+ {waiverNext && (
213
+ <section class="semics-events semics-waiver-step" data-testid="waiver-step" aria-labelledby="semics-waiver-step-title">
214
+ <h2 id="semics-waiver-step-title">{t("booking.waiverStep.title")}</h2>
215
+ <p>{t("booking.waiverStep.lead")}</p>
216
+ {waiverNext.invite && <p>{t("booking.waiverStep.emailed")}</p>}
217
+ <form method="post" action={`/booking?ref=${ref}`}>
218
+ <input type="hidden" name="intent" value="sign-waiver" />
219
+ <button type="submit" data-testid="waiver-step-sign">{waiverNext.sign ? t("booking.waiverStep.sign") : t("booking.waiverStep.invite")}</button>
220
+ </form>
221
+ </section>
222
+ )}
200
223
  {signingList && (
201
224
  <AttendeeList
202
225
  rows={signingList}
203
226
  action={`/booking?ref=${ref}`}
204
227
  editUntil={booking.signingList?.editable ? booking.signingList.editUntil : undefined}
228
+ zone={booking.event?.timezone}
205
229
  locale={locale}
230
+ pending={booking.waiverAfter === true}
206
231
  />
207
232
  )}
208
233
  {passes.length > 0 && (
@@ -213,7 +238,15 @@ const passes = booking && !cancelled && booking.status === "confirmed" ? booking
213
238
  ))}
214
239
  </section>
215
240
  )}
216
- {!cancelled && booking.status === "confirmed" && <AddToCalendar signedQuery={booking.calendar?.query} locale={locale} />}
241
+ {confirmed && (
242
+ <div class="semics-page-actions" data-testid="booking-actions">
243
+ <AddToCalendar signedQuery={booking.calendar?.query} locale={locale} />
244
+ <button type="button" class="semics-print" data-print data-testid="booking-print" hidden>{t("booking.print")}</button>
245
+ </div>
246
+ )}
247
+ {booking.canCancel && !cancelled && (
248
+ <CancelBooking action={`/booking?ref=${ref}`} cancelBy={booking.cancelBy} zone={booking.event?.timezone} locale={locale} />
249
+ )}
217
250
  </>
218
251
  ) : missing ? (
219
252
  <p data-testid="booking-missing">{t("booking.missing")}</p>
@@ -222,9 +255,12 @@ const passes = booking && !cancelled && booking.status === "confirmed" ? booking
222
255
  ) : null
223
256
  }
224
257
  </main>
258
+ <PageOrganiser brand={page.brand} locale={locale} />
225
259
  <script>
226
260
  import "../client/receipt.ts";
227
261
  import "../client/payment.ts";
262
+ import "../client/forget-form.ts";
263
+ import "../client/print.ts";
228
264
  </script>
229
265
  </body>
230
266
  </html>