@alfadocs/ui-kit-debug 1.54.0 → 1.54.2

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.
Files changed (35) hide show
  1. package/dist/_chunks/{booking-CPUjwxj0.js → booking-BN7TXe27.js} +1542 -1532
  2. package/dist/_chunks/booking-BN7TXe27.js.map +1 -0
  3. package/dist/_chunks/{contact-profile-card-h0QX4_5B.js → contact-profile-card-B-HzocbB.js} +45 -47
  4. package/dist/_chunks/contact-profile-card-B-HzocbB.js.map +1 -0
  5. package/dist/_chunks/error-page-C15GfNEj.js +312 -0
  6. package/dist/_chunks/error-page-C15GfNEj.js.map +1 -0
  7. package/dist/_chunks/{error-page-illustration-QGJAvuFB.js → error-page-illustration-bFti0VEc.js} +73 -56
  8. package/dist/_chunks/error-page-illustration-bFti0VEc.js.map +1 -0
  9. package/dist/_chunks/{login-dev-card-C7wo-Hv1.js → login-dev-card-q7iTojvV.js} +2 -2
  10. package/dist/_chunks/{login-dev-card-C7wo-Hv1.js.map → login-dev-card-q7iTojvV.js.map} +1 -1
  11. package/dist/agent-catalog.json +5 -1
  12. package/dist/components/booking/booking-types.d.ts +14 -2
  13. package/dist/components/booking/booking-types.d.ts.map +1 -1
  14. package/dist/components/booking/booking.d.ts.map +1 -1
  15. package/dist/components/booking/index.js +1 -1
  16. package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
  17. package/dist/components/contact-profile-card/index.js +1 -1
  18. package/dist/index.js +136 -134
  19. package/dist/index.js.map +1 -1
  20. package/dist/patterns/error-page/error-page-illustration.d.ts +3 -1
  21. package/dist/patterns/error-page/error-page-illustration.d.ts.map +1 -1
  22. package/dist/patterns/error-page/error-page.d.ts +34 -2
  23. package/dist/patterns/error-page/error-page.d.ts.map +1 -1
  24. package/dist/patterns/error-page/index.d.ts +2 -1
  25. package/dist/patterns/error-page/index.d.ts.map +1 -1
  26. package/dist/patterns/error-page/index.js +7 -5
  27. package/dist/patterns/error-page/index.js.map +1 -1
  28. package/dist/patterns/login-form/index.js +1 -1
  29. package/dist/tokens.css +1 -1
  30. package/package.json +1 -1
  31. package/dist/_chunks/booking-CPUjwxj0.js.map +0 -1
  32. package/dist/_chunks/contact-profile-card-h0QX4_5B.js.map +0 -1
  33. package/dist/_chunks/error-page-CKFJlekz.js +0 -275
  34. package/dist/_chunks/error-page-CKFJlekz.js.map +0 -1
  35. package/dist/_chunks/error-page-illustration-QGJAvuFB.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"contact-profile-card-h0QX4_5B.js","sources":["../../src/components/contact-profile-card/contact-profile-card.agent.ts","../../src/components/contact-profile-card/contact-profile-card.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ContactProfileCardHandle } from './contact-profile-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — ContactProfileCard */\n/* */\n/* Read-only adapter. Surfaces the rendered profession field so an */\n/* agent / MCP runtime can resolve \"what kind of practice is this?\" */\n/* without re-parsing the DOM. No actions yet — the card is a passive */\n/* presentation surface; navigation lives on the consumer's page. */\n/* -------------------------------------------------------------------- */\n\nexport const contactProfileCardAgent: AgentAdapter<ContactProfileCardHandle> = {\n id: 'contact-profile-card',\n // Passive presentation surface — only exposes the rendered profession for\n // introspection. No interactive capability is backed by the handle.\n capabilities: [],\n state: {\n profession: {\n type: 'string',\n descriptionKey: 'ui.agent.contactProfileCard.state.profession',\n description:\n 'Profession string the card is currently rendering — undefined when the consumer omitted it.',\n read: (handle) => handle.getProfession(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'contact-profile-card',\n description: 'Marks the ContactProfileCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Banknote,\n ExternalLink,\n Globe,\n Heart,\n Languages as LanguagesIcon,\n Mail,\n MapPin,\n MessageCircle,\n Phone,\n ShieldCheck,\n Stethoscope,\n type LucideIcon,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { formatPriceOrFree } from '../_shared/format-price';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { contactProfileCardAgent } from './contact-profile-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* ContactProfileCard */\n/* */\n/* Replaces the bespoke \"Profilo\" / \"Practice info\" cards that every */\n/* AlfaDocs surface composes by hand (booking-website PracticeInfoCard, */\n/* alfascribe operator pages, builders docs example, …). Composes Card */\n/* + KeyValueList + KeyValuePair so the labels share a column (no */\n/* zigzag values) and every row uses the same lucide icon family. */\n/* */\n/* The component is intentionally opinionated: every field is optional, */\n/* but the ORDER, ICONS, and LABELS are owned by the kit. Consumers */\n/* pass the data; the kit owns the visual + i18n. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `contactProfileCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\n// Override the KVP icon colour at the card root so every inner row's\n// leading glyph paints with `--accent` (brand magenta/violet) instead\n// of the default `--muted-foreground`. The ContactProfileCard is a\n// marketing surface — muted icons read as disabled against the\n// otherwise saturated card chrome. Scoped via CSS custom property so\n// only this card's icons shift; standalone KVPs elsewhere keep\n// `--muted-foreground`.\nconst rootVariants = cva(\n 'ds:w-full ds:text-[color:var(--foreground)] ds:[--key-value-pair-icon-color:var(--accent)]',\n {\n variants: {\n // Matches the kit's other `surface` props (Booking, ReviewsPanel).\n // The card itself renders `<Card variant=\"elevated\">` so the\n // `surface=\"flat\"` opt-out is rare — most consumers want the\n // boundary.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface ContactProfileCardAddress {\n /** Display text — already formatted by the consumer (street, postcode, city). */\n line: string;\n /** Optional lat/lng — drives the static-map link + the embedded thumbnail. */\n lat?: number;\n lng?: number;\n}\n\nexport interface ContactProfileCardHandle {\n /** Resolved consumer-supplied data — useful for agent introspection. */\n getProfession: () => string | undefined;\n}\n\nexport interface ContactProfileCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'children'\n> {\n /**\n * Override the localised \"Profilo\" / \"Profile\" heading. Most\n * consumers leave this unset.\n */\n heading?: string;\n /**\n * Free-text intro paragraph rendered above the data rows (e.g.\n * the practice's `bookingDescription` field). When omitted, the\n * card jumps straight into the data rows.\n */\n description?: string;\n\n /* ----- Identity rows ----- */\n\n /** Street + postcode + city, with optional lat/lng for the map link. */\n address?: ContactProfileCardAddress;\n /** Phone number, displayed as-is. Compiled into a `tel:` link. */\n phone?: string;\n /**\n * WhatsApp number — digits only (no `+`, no spaces). Compiled into\n * a `https://wa.me/<number>` link with an optional pre-filled message.\n */\n whatsappNumber?: string;\n /** Optional pre-filled WhatsApp message. Consumer-localised. */\n whatsappMessage?: string;\n /** Public-facing email. Compiled into a `mailto:` link. */\n email?: string;\n /** Practice website (already an absolute URL with protocol). */\n website?: string;\n\n /* ----- Embedded map thumbnail ----- */\n\n /**\n * Google Maps Static API key. When provided alongside `address.lat`\n * and `address.lng`, renders a static-map thumbnail at the top of\n * the card — a single one-shot `<img>` fetch, no JS SDK boot, no\n * consent gate needed (the same pattern PracticeResults uses).\n *\n * Without it (or without coords), the card renders info rows only —\n * the address row's \"Open in Google Maps\" link is still emitted as\n * a real `<a>` so the spatial cue isn't lost.\n *\n * Additive — existing consumers that don't pass this prop see the\n * same render as before.\n */\n googleMapsApiKey?: string;\n /**\n * Zoom level for the embedded map thumbnail. Default `14` —\n * neighbourhood-level, shows the pin in context. Ignored when the\n * thumbnail isn't rendered.\n */\n mapZoom?: number;\n\n /* ----- Profile metadata ----- */\n\n /**\n * ISO 639-1 language codes the practice speaks. Rendered as\n * `<Badge variant=\"neutral\">` chips. Each code is auto-resolved\n * into the active locale's native language name via the kit's\n * built-in `languages.<iso>` i18n bundle (18 ISO codes × 18\n * locales). For example `languages={['it', 'en']}` with\n * `i18n.language === 'it'` renders \"Italiano\" + \"Inglese\".\n *\n * Unknown / unbundled codes fall back to the uppercase ISO code\n * (`'xyz'` → `'XYZ'`). To override a specific label — regional\n * dialect, brand-voice variant, codes the kit doesn't ship — pass\n * `languageLabels`.\n */\n languages?: string[];\n /**\n * Override map from ISO code → display label, applied on top of\n * the kit's i18n auto-resolution. Only set when you need a\n * consumer-specific label for a code — the typical case is\n * regional dialect / brand-voice variants / non-ISO codes.\n *\n * Resolution order: `languageLabels[code]` > `t('languages.<code>')`\n * > `code.toUpperCase()`.\n */\n languageLabels?: Record<string, string>;\n /**\n * Insurance / convention strings (consumer-supplied, free text).\n * Rendered as `<Badge variant=\"info\">` chips.\n */\n insurances?: string[];\n /**\n * First-visit price in the smallest currency unit (cents / centesimi).\n * Formatted via `Intl.NumberFormat`; `0` renders the translated word\n * \"Free\". Omit when the consumer doesn't want to show the price.\n */\n firstVisitPriceCents?: number;\n /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */\n currencyCode?: string;\n /** Profession line — single value or already-joined comma list. */\n profession?: string;\n /** Show the \"expert for anxious patients\" row when true. */\n specializedInFearPatients?: boolean;\n\n /* ----- Telemetry hooks ----- */\n\n /**\n * Fires when the patient clicks the phone link. The kit emits a\n * `track('practice_profile_card_phone_click')` event before\n * invoking this — gate consumer-side analytics on the same event\n * to avoid duplicate fires.\n */\n onPhoneClick?: () => void;\n /** Fires when the patient clicks the WhatsApp link. */\n onWhatsAppClick?: () => void;\n /** Fires when the patient clicks the static-map link. */\n onMapClick?: () => void;\n /** Fires when the patient clicks the email mailto link. */\n onEmailClick?: () => void;\n\n /* ----- Slots ----- */\n\n /**\n * Rendered above the heading — e.g. a `<Avatar>` for the operator\n * variant, or a coloured chip strip. Optional.\n */\n headerSlot?: ReactNode;\n /**\n * Render an arbitrary map widget at the top of the card chrome —\n * replaces the built-in static `<img>` thumbnail that\n * `googleMapsApiKey` would otherwise produce. Use this when you\n * want an interactive map inside the card boundary instead of a\n * fixed image:\n *\n * <ContactProfileCard\n * mapSlot={\n * <PracticeMap practice={practice} googleMapsApiKey={key} />\n * }\n * …\n * />\n *\n * When both `mapSlot` and `googleMapsApiKey` are provided, the slot\n * wins (explicit > implicit). When neither is provided, no map area\n * renders. The slot is unstyled — pass through any container chrome\n * the consumer wants (e.g. a fixed height wrapper). The kit\n * positions it where the static thumbnail would have lived.\n */\n mapSlot?: ReactNode;\n /**\n * Rendered at the end of the card body, below the rows. Use for\n * a \"Book now\" `<Button>` or a \"View full profile\" link.\n */\n footerSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps the card in `<Card variant=\"elevated\">`\n * for a defined surface — what most consumers want when the card\n * stands alone on a page. `'flat'` drops the Card chrome so the\n * content sits naked — use when an outer card / sheet already\n * provides the boundary (e.g. embedded inside a `<Sheet>` or a\n * parent `<Card.Body>`).\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/** Build the WhatsApp `wa.me` URL. Number must already be digits-only. */\nfunction buildWhatsAppHref(number: string, message?: string): string {\n const base = `https://wa.me/${number}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/** Google Maps search query — works without an API key. */\nfunction buildMapHref(address: ContactProfileCardAddress): string {\n const q = encodeURIComponent(address.line);\n return `https://www.google.com/maps/search/?api=1&query=${q}`;\n}\n\n/* -------------------------------------------------------------------- */\n/* MapThumbStrip — embedded Google Static Maps image */\n/* */\n/* Full-width strip rendered at the top of the card when the consumer */\n/* supplies both `address.lat`/`lng` and `googleMapsApiKey`. Same */\n/* one-shot `<img>` strategy as PracticeResults' StaticMapThumb (no JS */\n/* SDK boot → no consent gate needed), but full-card-width instead of */\n/* a 12rem aside. */\n/* -------------------------------------------------------------------- */\n\ninterface MapThumbStripProps {\n apiKey: string;\n center: { lat: number; lng: number };\n zoom: number;\n altText: string;\n}\n\n/**\n * Resolve the kit's `--map-marker-color` token to a six-character hex\n * string (no leading `#`) for Google Static Maps' `markers=color:` URL\n * parameter, which requires a literal hex value at fetch time.\n *\n * SSR-safe: when `document` is undefined we fall back to the kit's\n * brand violet. Same helper as PracticeResults — keep in sync if you\n * touch one.\n */\nfunction getStaticMapMarkerHex(): string {\n if (typeof document === 'undefined') return '4945a3';\n const raw = getComputedStyle(document.documentElement)\n .getPropertyValue('--map-marker-color')\n .trim();\n const match = /^#?([0-9a-fA-F]{6})$/.exec(raw);\n return match ? match[1] : '4945a3';\n}\n\nfunction MapThumbStrip({ apiKey, center, zoom, altText }: MapThumbStripProps) {\n // 640×192 keeps the asset under Google's 1MP free tier at scale=2\n // (1280×384 actual) and matches the strip's 12rem height at a\n // ~3.33:1 aspect ratio. Marker colour resolves from the kit's\n // `--map-marker-color` token at runtime so the value still lives\n // in `src/tokens/**` per the closed-palette constraint.\n const markerHex = getStaticMapMarkerHex();\n const src =\n `https://maps.googleapis.com/maps/api/staticmap` +\n `?center=${center.lat},${center.lng}` +\n `&zoom=${zoom}` +\n `&size=640x192&scale=2` +\n `&markers=color:0x${markerHex}%7C${center.lat},${center.lng}` +\n `&key=${encodeURIComponent(apiKey)}`;\n return (\n <img\n src={src}\n alt={altText}\n loading=\"lazy\"\n decoding=\"async\"\n width={640}\n height={192}\n className=\"ds:block ds:inline-size-full ds:block-size-[12rem] ds:[object-fit:cover] ds:rounded-[var(--radius-md)]\"\n />\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const ContactProfileCard = forwardRef<\n HTMLDivElement,\n ContactProfileCardProps\n>(\n (\n {\n heading,\n description,\n address,\n phone,\n whatsappNumber,\n whatsappMessage,\n email,\n website,\n languages,\n languageLabels,\n insurances,\n firstVisitPriceCents,\n currencyCode = 'EUR',\n profession,\n specializedInFearPatients,\n googleMapsApiKey,\n mapZoom = 14,\n onPhoneClick,\n onWhatsAppClick,\n onMapClick,\n onEmailClick,\n headerSlot,\n footerSlot,\n mapSlot,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const headingId = useId();\n const locale = i18n.language ?? 'en';\n\n const resolvedHeading = heading ?? t('contactProfileCard.heading');\n const resolvedAriaLabel = ariaLabel ?? resolvedHeading;\n\n const formattedPrice = useMemo(() => {\n if (firstVisitPriceCents == null) return undefined;\n // 0 is a free first visit: the chip reads \"Free\", not \"€0.00\".\n return formatPriceOrFree(\n firstVisitPriceCents,\n currencyCode,\n locale,\n t('common.freeOfCharge'),\n );\n }, [firstVisitPriceCents, currencyCode, locale, t]);\n\n // Compose the rows in display order. Each `row` carries the icon +\n // localised label + the rendered value. Skipping a field is just\n // omitting the row — `KeyValueList` collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n alignValue?: 'start' | 'end';\n }> = [];\n\n if (address) {\n rows.push({\n key: 'address',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.address'),\n value: (\n <span className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span>{address.line}</span>\n {address.lat != null && address.lng != null ? (\n <Link\n href={buildMapHref(address)}\n external\n intent=\"default\"\n onClick={onMapClick}\n >\n {t('contactProfileCard.openInGoogleMaps')}\n </Link>\n ) : null}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.phone'),\n value: (\n <Link\n href={`tel:${normalisePhone(phone)}`}\n intent=\"default\"\n onClick={onPhoneClick}\n >\n {phone}\n </Link>\n ),\n });\n }\n\n if (whatsappNumber) {\n rows.push({\n key: 'whatsapp',\n icon: <MessageCircle aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.whatsapp'),\n value: (\n <Link\n href={buildWhatsAppHref(whatsappNumber, whatsappMessage)}\n external\n intent=\"default\"\n onClick={onWhatsAppClick}\n >\n {whatsappNumber}\n </Link>\n ),\n });\n }\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.email'),\n value: (\n <Link\n href={`mailto:${email}`}\n intent=\"default\"\n onClick={onEmailClick}\n >\n {email}\n </Link>\n ),\n });\n }\n\n if (website) {\n rows.push({\n key: 'website',\n icon: <Globe aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.website'),\n value: (\n <Link href={website} external intent=\"default\">\n {website}\n </Link>\n ),\n });\n }\n\n if (languages && languages.length > 0) {\n // Resolution order, highest to lowest:\n // 1. consumer `languageLabels` override — for regional dialects,\n // brand-voice variants, or codes the kit doesn't ship.\n // 2. kit i18n bundle (`languages.<iso>`) — auto-resolves the 18\n // ISO codes the kit ships into the active locale's native\n // language name. Retires consumer-side ISO→label plumbing.\n // 3. uppercase fallback for unknown codes that the consumer\n // didn't override.\n const resolveLabel = (code: string): string => {\n if (languageLabels?.[code]) return languageLabels[code];\n const key = `languages.${code}`;\n if (i18n.exists(key)) return t(key);\n return code.toUpperCase();\n };\n rows.push({\n key: 'languages',\n icon: <LanguagesIcon aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.languages'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {languages.map((code) => (\n <Badge key={code} variant=\"neutral\">\n {resolveLabel(code)}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (insurances && insurances.length > 0) {\n rows.push({\n key: 'insurances',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.insurances'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {insurances.map((ins) => (\n <Badge key={ins} variant=\"info\">\n {ins}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (formattedPrice) {\n // The one figure on this card a patient compares between\n // practices, so it gets a chip and is pinned to the row's end.\n // Left as body text where the label happens to stop, its\n // position shifts card to card and the eye has to hunt for it.\n // `accentSoft`, not `brand`. The languages and insurance rows on\n // this card are tonal chips (`neutral` and `info`), so a solid\n // `brand` fill would read as a different class of object rather\n // than the same family. `accentSoft` is the same tonal recipe in\n // the most distinct hue on the card, so the price still leads.\n // `lg` because `md` sets the label at the smallest step of the\n // ramp, and `.theme-accessible` cannot lift it — the one figure\n // patients compare should not be the smallest text on the card.\n rows.push({\n key: 'firstVisitPrice',\n icon: <Banknote aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.firstVisitPrice'),\n value: (\n <Badge variant=\"accentSoft\" size=\"lg\">\n {formattedPrice}\n </Badge>\n ),\n alignValue: 'end',\n });\n }\n\n if (specializedInFearPatients) {\n rows.push({\n key: 'expertForAnxiousPatients',\n icon: <Heart aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.expertForAnxiousPatients'),\n value: t('contactProfileCard.value.yesShort'),\n });\n }\n\n if (profession) {\n rows.push({\n key: 'profession',\n icon: <Stethoscope aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.profession'),\n value: profession,\n });\n }\n\n // Imperative handle for agent integrations.\n useAgentRegistration(\n contactProfileCardAgent,\n { getProfession: () => profession },\n id,\n );\n\n // Embedded static-map thumbnail. Renders only when the consumer\n // supplies BOTH a usable lat/lng pair AND a `googleMapsApiKey`.\n // The d.ts-promised behaviour; without a key the strip is silently\n // omitted and the address row's \"Open in Google Maps\" link still\n // emits as the spatial-cue fallback.\n const showMapThumb =\n !!googleMapsApiKey &&\n address?.lat !== undefined &&\n address?.lng !== undefined;\n const mapThumb = showMapThumb ? (\n <MapThumbStrip\n apiKey={googleMapsApiKey!}\n center={{ lat: address!.lat!, lng: address!.lng! }}\n zoom={mapZoom}\n altText={t('contactProfileCard.map.alt', {\n address: address!.line,\n defaultValue: 'Map showing {{address}}',\n })}\n />\n ) : null;\n\n // Map area: explicit consumer slot wins over the implicit\n // googleMapsApiKey-driven static thumbnail. 0.33.4 introduces the\n // slot so consumers can embed an interactive <MapView> /\n // <PracticeMap> wrapper inside the card chrome instead of the\n // fixed static <img>. When neither is set the area renders as\n // nothing. 0.33.6 moves the area from above the heading to below\n // the data rows — the map reads as the spatial closer (\"here it\n // is on the map\") rather than a stylised hero, and any CTA in\n // footerSlot still lands at the very bottom.\n const mapArea = mapSlot ?? mapThumb;\n\n const body = (\n <>\n {description ? (\n <p className=\"type-body-sm ds:m-0 ds:whitespace-pre-line\">\n {description}\n </p>\n ) : null}\n {rows.length > 0 ? (\n <KeyValueList rowGap=\"md\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon}\n label={row.label}\n value={row.value}\n alignValue={row.alignValue}\n />\n ))}\n </KeyValueList>\n ) : null}\n {mapArea}\n {footerSlot}\n </>\n );\n\n // `surface=\"flat\"` skips the Card wrapper — the consumer is\n // already inside a Card / Sheet and doesn't want a double border.\n const inner = (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {headerSlot}\n <h2\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedHeading}\n </h2>\n </div>\n {body}\n </>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"contact-profile-card\"\n data-component-id={id}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </Card.Body>\n </Card>\n ) : (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nContactProfileCard.displayName = 'ContactProfileCard';\n\n// Helper export so consumers can mirror the kit's row order if they\n// need to compose a partial alternative (rare).\nexport const CONTACT_PROFILE_CARD_ROW_KEYS = [\n 'address',\n 'phone',\n 'whatsapp',\n 'email',\n 'website',\n 'languages',\n 'insurances',\n 'firstVisitPrice',\n 'expertForAnxiousPatients',\n 'profession',\n] as const;\n\n// Defensive icon export so consumers can render the same glyph\n// outside the card if they need it for consistency.\nexport const CONTACT_PROFILE_CARD_ROW_ICONS: Record<\n (typeof CONTACT_PROFILE_CARD_ROW_KEYS)[number],\n LucideIcon\n> = {\n address: MapPin,\n phone: Phone,\n whatsapp: MessageCircle,\n email: Mail,\n website: Globe,\n languages: LanguagesIcon,\n insurances: ShieldCheck,\n firstVisitPrice: Banknote,\n expertForAnxiousPatients: Heart,\n profession: Stethoscope,\n};\n\n// Re-exports of the rootVariants type for downstream typing.\nexport type ContactProfileCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n\n// ExternalLink is exported by lucide-react and used elsewhere in the\n// kit; re-exporting here so consumers don't have to add it as a\n// peer-dep import for icon parity in their own UIs.\nexport { ExternalLink };\n"],"names":["contactProfileCardAgent","handle","rootVariants","cva","normalisePhone","raw","buildWhatsAppHref","number","message","base","buildMapHref","address","getStaticMapMarkerHex","match","MapThumbStrip","apiKey","center","zoom","altText","markerHex","src","jsx","ContactProfileCard","forwardRef","heading","description","phone","whatsappNumber","whatsappMessage","email","website","languages","languageLabels","insurances","firstVisitPriceCents","currencyCode","profession","specializedInFearPatients","googleMapsApiKey","mapZoom","onPhoneClick","onWhatsAppClick","onMapClick","onEmailClick","headerSlot","footerSlot","mapSlot","surface","ariaLabel","id","className","rest","ref","i18n","useTranslation","headingId","useId","locale","resolvedHeading","resolvedAriaLabel","formattedPrice","useMemo","formatPriceOrFree","rows","MapPin","jsxs","Link","Phone","MessageCircle","Mail","Globe","resolveLabel","code","key","LanguagesIcon","Badge","ShieldCheck","ins","Banknote","Heart","Stethoscope","useAgentRegistration","mapThumb","mapArea","body","Fragment","KeyValueList","row","KeyValuePair","inner","Card","CONTACT_PROFILE_CARD_ROW_KEYS","CONTACT_PROFILE_CARD_ROW_ICONS"],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAMA,KAAkE;AAAA,EAC7E,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,cAAA;AAAA,IAAc;AAAA,EACzC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCqBMC,KAAeC;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,MAKR,SAAS;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,iBAAiB,EAAE,SAAS,WAAA;AAAA,EAAW;AAE3C;AAmMA,SAASC,GAAeC,GAAqB;AAC3C,SAAOA,EAAI,QAAQ,WAAW,EAAE;AAClC;AAGA,SAASC,GAAkBC,GAAgBC,GAA0B;AACnE,QAAMC,IAAO,iBA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,IACJ,gBAAAxB,EAAAoB,GAAA,EACE,UAAA;AAAA,MAAA,gBAAApB,EAAC,OAAA,EAAI,WAAU,kDACZ,UAAA;AAAA,QAAArB;AAAA,QACD,gBAAAvB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAIkC;AAAA,YACJ,WAAU;AAAA,YAET,UAAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MACH,GACF;AAAA,MACC0B;AAAA,IAAA,GACH;AAGF,WACE,gBAAA/D;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAA+B;AAAA,QACA,MAAK;AAAA,QACL,cAAYO;AAAA,QACZ,mBAAiBJ;AAAA,QACjB,kBAAe;AAAA,QACf,qBAAmBN;AAAA,QACnB,IAAAA;AAAA,QACA,WAAW/C,GAAa,EAAE,SAAA6C,GAAS,WAAAG,IAAW;AAAA,QAC7C,GAAGC;AAAA,QAEH,gBAAY,aACX,gBAAA9B,EAACqE,KAAK,SAAQ,YACZ,4BAACA,EAAK,MAAL,EAAU,WAAU,kDAClB,aACH,EAAA,CACF,sBAEC,OAAA,EAAI,WAAU,kDACZ,UAAAD,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAnE,GAAmB,cAAc;AAI1B,MAAMqE,KAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAIaC,KAGT;AAAA,EACF,SAAS5B;AAAA,EACT,OAAOG;AAAA,EACP,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,SAASC;AAAA,EACT,WAAWI;AAAAA,EACX,YAAYE;AAAA,EACZ,iBAAiBE;AAAA,EACjB,0BAA0BC;AAAA,EAC1B,YAAYC;AACd;"}
@@ -1,275 +0,0 @@
1
- import { jsx as r, jsxs as x } from "react/jsx-runtime";
2
- import { forwardRef as H, useMemo as K, useState as R, useEffect as _, useRef as C } from "react";
3
- import { useTranslation as Q } from "react-i18next";
4
- import { c as W } from "./index-D2ZczOXr.js";
5
- import { B as T } from "./button-CYPx2xFq.js";
6
- import { L as J } from "./logo-CuaqxTGK.js";
7
- import { i as X } from "./safe-href-5dbsfbQn.js";
8
- import { E as Z } from "./error-page-illustration-QGJAvuFB.js";
9
- import { loadLocale as ee, LOCALES_WITH_BUNDLES as re } from "../i18n/config.js";
10
- import { R as oe } from "./rotate-ccw-BBQnIVTr.js";
11
- import { L as te } from "./log-in-OQUEoGhX.js";
12
- import { c as D } from "./createLucideIcon-DhHxpK9K.js";
13
- /**
14
- * @license lucide-react v1.22.0 - ISC
15
- *
16
- * This source code is licensed under the ISC license.
17
- * See the LICENSE file in the root directory of this source tree.
18
- */
19
- const ae = [
20
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
21
- ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
22
- ["path", { d: "M12 17h.01", key: "p32p05" }]
23
- ], ne = D("circle-question-mark", ae);
24
- /**
25
- * @license lucide-react v1.22.0 - ISC
26
- *
27
- * This source code is licensed under the ISC license.
28
- * See the LICENSE file in the root directory of this source tree.
29
- */
30
- const se = [
31
- ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
32
- [
33
- "path",
34
- {
35
- d: "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
36
- key: "r6nss1"
37
- }
38
- ]
39
- ], ie = D("house", se), de = [
40
- 400,
41
- 401,
42
- 403,
43
- 404,
44
- 405,
45
- 410,
46
- 419,
47
- 429,
48
- 500,
49
- 502,
50
- 503,
51
- 504,
52
- "offline",
53
- "maintenance"
54
- ], I = {
55
- 400: { key: "badRequest", mood: "jumbled", primary: "home" },
56
- 401: { key: "unauthorised", mood: "locked", primary: "login" },
57
- 403: { key: "forbidden", mood: "roped", primary: "home" },
58
- 404: { key: "notFound", mood: "lost", primary: "home" },
59
- 405: { key: "methodNotAllowed", mood: "wrong-way", primary: "home" },
60
- 410: { key: "gone", mood: "vanished", primary: "home" },
61
- 419: { key: "expired", mood: "asleep", primary: "login" },
62
- 429: { key: "tooManyRequests", mood: "melt", primary: "retry" },
63
- 500: { key: "serverError", mood: "patched", primary: "retry" },
64
- 502: { key: "badGateway", mood: "unplugged", primary: "retry" },
65
- 503: { key: "maintenance", mood: "rebuild", primary: "retry" },
66
- 504: { key: "timeout", mood: "snail", primary: "retry" },
67
- offline: { key: "offline", mood: "adrift", primary: "retry" },
68
- maintenance: { key: "maintenance", mood: "rebuild", primary: "retry" },
69
- generic: { key: "generic", mood: "puzzled", primary: "home" }
70
- };
71
- function ce(e) {
72
- return de.includes(e) ? I[e] : I.generic;
73
- }
74
- const le = "alfadocs-ui.locale", me = "it", ue = (e) => {
75
- if (!e) return;
76
- const o = e.toLowerCase().replaceAll("_", "-").split("-")[0], t = o === "cn" ? "zh" : o;
77
- return re.includes(t) ? t : void 0;
78
- }, pe = () => {
79
- try {
80
- return window.localStorage.getItem(le);
81
- } catch {
82
- return null;
83
- }
84
- };
85
- function ye(e = {}) {
86
- var p;
87
- const o = typeof window < "u", t = e.saved !== void 0 ? e.saved : o ? pe() : null, i = e.browser ?? (o && typeof navigator < "u" ? (p = navigator.languages) != null && p.length ? navigator.languages : [navigator.language] : []), u = e.document ?? (typeof document < "u" ? document.documentElement.lang : ""), f = [
88
- e.locale,
89
- t,
90
- ...i,
91
- e.hostLocaleIsDefault ? void 0 : u
92
- ];
93
- for (const h of f) {
94
- const y = ue(h);
95
- if (y) return y;
96
- }
97
- return me;
98
- }
99
- const z = (e, o) => ee(e, o), ge = W(
100
- "ds:flex ds:flex-col ds:items-center ds:justify-center ds:bg-[var(--background)] ds:text-[var(--foreground)] ds:px-[var(--spacing-md)] ds:py-[var(--spacing-2xl)]",
101
- {
102
- variants: {
103
- layout: {
104
- /** Fills the viewport: the whole page is the error. */
105
- page: "ds:min-h-screen",
106
- /** Fills its container, under the host's own header. */
107
- embedded: "ds:[min-block-size:100%]"
108
- }
109
- },
110
- defaultVariants: { layout: "page" }
111
- }
112
- ), fe = /* @__PURE__ */ new Set(["ar"]), he = 1500;
113
- function ve(e, o) {
114
- const t = e instanceof Date ? e : new Date(e);
115
- if (Number.isNaN(t.getTime())) return;
116
- const i = /* @__PURE__ */ new Date(), u = i.toDateString() === t.toDateString() ? {} : {
117
- day: "numeric",
118
- month: "short",
119
- ...i.getFullYear() === t.getFullYear() ? {} : { year: "numeric" }
120
- };
121
- return new Intl.DateTimeFormat(o === "en" ? "en-GB" : o, {
122
- ...u,
123
- hour: "2-digit",
124
- minute: "2-digit"
125
- }).format(t);
126
- }
127
- const B = (e, o) => !!e.getResource(o, "ui", "errorPage"), ke = (e) => X(e) ? e : "#", be = H(
128
- ({
129
- status: e,
130
- homeHref: o = "/",
131
- loginHref: t,
132
- supportHref: i,
133
- onRetry: u,
134
- requestId: f,
135
- backAt: p,
136
- locale: h,
137
- hostLocaleIsDefault: y = !1,
138
- title: M,
139
- message: F,
140
- showLogo: G = !0,
141
- as: j = "main",
142
- focusHeading: N = !0,
143
- layout: O,
144
- className: $,
145
- ...U
146
- }, V) => {
147
- const { i18n: l } = Q("ui"), d = K(
148
- () => ye({ locale: h, hostLocaleIsDefault: y }),
149
- [h, y]
150
- ), [n, v] = R(
151
- () => B(l, d) ? d : null
152
- ), [, Y] = R(0);
153
- _(() => {
154
- let a = !0;
155
- const k = B(l, d);
156
- v(k ? d : null);
157
- const b = () => a && Y((g) => g + 1);
158
- z("en", l).then(b).catch(() => {
159
- });
160
- const L = k ? void 0 : setTimeout(
161
- () => a && v((g) => g ?? "en"),
162
- he
163
- );
164
- return z(d, l).then(() => {
165
- a && (v(d), b());
166
- }).catch(() => a && v((g) => g ?? "en")), () => {
167
- a = !1, clearTimeout(L);
168
- };
169
- }, [l, d]);
170
- const s = l.getFixedT(
171
- n && n !== "en" ? [n, "en"] : "en",
172
- "ui"
173
- ), c = ce(e), P = c.key === "maintenance" && p ? ve(p, n ?? "en") : void 0, S = C(null), A = C(!1);
174
- _(() => {
175
- var a;
176
- !n || !N || A.current || (A.current = !0, (a = S.current) == null || a.focus({ preventScroll: !0 }));
177
- }, [n, N]);
178
- const q = u ?? (() => window.location.reload()), w = c.primary === "login" && !t ? "retry" : c.primary, E = (a, k, b, L) => /* @__PURE__ */ r(
179
- T,
180
- {
181
- intent: L,
182
- size: "lg",
183
- flipIconInRtl: a === "login",
184
- asChild: !0,
185
- startIcon: b,
186
- "data-action": a,
187
- children: /* @__PURE__ */ r("a", { href: ke(k), children: s(`errorPage.actions.${a}`) })
188
- },
189
- a
190
- ), m = [];
191
- return w === "retry" ? m.push(
192
- /* @__PURE__ */ r(
193
- T,
194
- {
195
- intent: "primary",
196
- size: "lg",
197
- startIcon: /* @__PURE__ */ r(oe, { "aria-hidden": "true" }),
198
- onClick: q,
199
- "data-action": "retry",
200
- children: s("errorPage.actions.retry")
201
- },
202
- "retry"
203
- )
204
- ) : w === "login" && t && m.push(
205
- E("login", t, /* @__PURE__ */ r(te, { "aria-hidden": "true" }), "primary")
206
- ), e !== "offline" && c.key !== "maintenance" && m.push(
207
- E(
208
- "home",
209
- o,
210
- /* @__PURE__ */ r(ie, { "aria-hidden": "true" }),
211
- w === "home" ? "primary" : "secondary"
212
- )
213
- ), i && m.push(
214
- E(
215
- "support",
216
- i,
217
- /* @__PURE__ */ r(ne, { "aria-hidden": "true" }),
218
- "ghost"
219
- )
220
- ), /* @__PURE__ */ r(
221
- j,
222
- {
223
- ref: V,
224
- "data-component": "error-page",
225
- "data-status": String(e),
226
- lang: n ?? void 0,
227
- "aria-busy": n ? void 0 : !0,
228
- dir: n && fe.has(n) ? "rtl" : "ltr",
229
- className: ge({ layout: O, className: $ }),
230
- ...U,
231
- children: /* @__PURE__ */ x(
232
- "div",
233
- {
234
- className: n ? "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-lg)] ds:text-center ds:[max-inline-size:32rem]" : "ds:invisible",
235
- children: [
236
- /* @__PURE__ */ r(Z, { mood: c.mood }),
237
- /* @__PURE__ */ x("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
238
- /* @__PURE__ */ x(
239
- "h1",
240
- {
241
- ref: S,
242
- tabIndex: -1,
243
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:outline-none",
244
- children: [
245
- typeof e == "number" && /* @__PURE__ */ r("span", { className: "type-label ds:text-[var(--muted-foreground)]", children: s("errorPage.statusLabel", { status: e }) }),
246
- /* @__PURE__ */ r("span", { className: "type-title-page", children: M ?? s(`errorPage.status.${c.key}.title`) })
247
- ]
248
- }
249
- ),
250
- /* @__PURE__ */ r("p", { className: "type-body ds:text-[var(--muted-foreground)]", children: F ?? s(`errorPage.status.${c.key}.message`) }),
251
- P && /* @__PURE__ */ r("p", { className: "type-body ds:font-semibold", children: s("errorPage.backAt", { time: P }) })
252
- ] }),
253
- m.length > 0 && /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-center ds:gap-[var(--spacing-sm)]", children: m }),
254
- f && /* @__PURE__ */ x("p", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: [
255
- s("errorPage.reference", { id: f }),
256
- /* @__PURE__ */ r("br", {}),
257
- s("errorPage.referenceHint")
258
- ] }),
259
- G && /* @__PURE__ */ r(J, { decorative: !0, size: "sm", className: "ds:opacity-70" })
260
- ]
261
- }
262
- )
263
- }
264
- );
265
- }
266
- );
267
- be.displayName = "ErrorPage";
268
- export {
269
- me as E,
270
- de as a,
271
- be as b,
272
- ce as e,
273
- ye as r
274
- };
275
- //# sourceMappingURL=error-page-CKFJlekz.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-page-CKFJlekz.js","sources":["../../node_modules/lucide-react/dist/esm/icons/circle-question-mark.mjs","../../node_modules/lucide-react/dist/esm/icons/house.mjs","../../src/patterns/error-page/error-page-statuses.ts","../../src/patterns/error-page/error-page-locale.ts","../../src/patterns/error-page/error-page.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\", key: \"1u773s\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst CircleQuestionMark = createLucideIcon(\"circle-question-mark\", __iconNode);\n\nexport { __iconNode, CircleQuestionMark as default };\n//# sourceMappingURL=circle-question-mark.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\", key: \"5wwlr5\" }],\n [\n \"path\",\n {\n d: \"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\",\n key: \"r6nss1\"\n }\n ]\n];\nconst House = createLucideIcon(\"house\", __iconNode);\n\nexport { __iconNode, House as default };\n//# sourceMappingURL=house.mjs.map\n","import type { ErrorPageMood } from './error-page-illustration';\n\n/** The statuses with their own copy. Anything else shows `generic`. */\nexport const ERROR_PAGE_STATUSES = [\n 400,\n 401,\n 403,\n 404,\n 405,\n 410,\n 419,\n 429,\n 500,\n 502,\n 503,\n 504,\n 'offline',\n 'maintenance',\n] as const;\n\nexport type ErrorPageKnownStatus = (typeof ERROR_PAGE_STATUSES)[number];\n\n/** What the status's main button does. */\nexport type ErrorPagePrimaryAction = 'home' | 'retry' | 'login';\n\nexport interface ErrorPageStatusSpec {\n /** Key under `ui.errorPage.status.*`. */\n key: string;\n /** How the Alfadocs mark shows the trouble. */\n mood: ErrorPageMood;\n primary: ErrorPagePrimaryAction;\n}\n\nconst SPECS: Record<ErrorPageKnownStatus | 'generic', ErrorPageStatusSpec> = {\n 400: { key: 'badRequest', mood: 'jumbled', primary: 'home' },\n 401: { key: 'unauthorised', mood: 'locked', primary: 'login' },\n 403: { key: 'forbidden', mood: 'roped', primary: 'home' },\n 404: { key: 'notFound', mood: 'lost', primary: 'home' },\n 405: { key: 'methodNotAllowed', mood: 'wrong-way', primary: 'home' },\n 410: { key: 'gone', mood: 'vanished', primary: 'home' },\n 419: { key: 'expired', mood: 'asleep', primary: 'login' },\n 429: { key: 'tooManyRequests', mood: 'melt', primary: 'retry' },\n 500: { key: 'serverError', mood: 'patched', primary: 'retry' },\n 502: { key: 'badGateway', mood: 'unplugged', primary: 'retry' },\n 503: { key: 'maintenance', mood: 'rebuild', primary: 'retry' },\n 504: { key: 'timeout', mood: 'snail', primary: 'retry' },\n offline: { key: 'offline', mood: 'adrift', primary: 'retry' },\n maintenance: { key: 'maintenance', mood: 'rebuild', primary: 'retry' },\n generic: { key: 'generic', mood: 'puzzled', primary: 'home' },\n};\n\n/** The spec for any status; unknown ones fall back to `generic`. */\nexport function errorPageStatusSpec(\n status: number | 'offline' | 'maintenance',\n): ErrorPageStatusSpec {\n return (ERROR_PAGE_STATUSES as readonly (number | string)[]).includes(status)\n ? SPECS[status as ErrorPageKnownStatus]\n : SPECS.generic;\n}\n","import type { i18n as I18n } from 'i18next';\nimport { loadLocale } from '../../i18n/config';\nimport { LOCALES_WITH_BUNDLES } from '../../i18n/supported-locales';\n\n/** Where LocalePicker and HeaderSettings save a language the visitor\n * picked: `LOCALE_STORAGE_KEY` in locale-picker.tsx, copied so the error\n * page does not bundle the picker. */\nexport const SAVED_LOCALE_KEY = 'alfadocs-ui.locale';\n\n/** Used when nothing else names a language the kit ships. */\nexport const ERROR_PAGE_FALLBACK_LOCALE = 'it';\n\nexport interface ErrorPageLocaleSources {\n /** Host-supplied locale. Always wins when the kit ships it. */\n locale?: string;\n /** True when `<html lang>` is only the site default, not the visitor's\n * language: for example an error raised before routing read it. */\n hostLocaleIsDefault?: boolean;\n /** Test seams; the browser values are read when omitted. */\n saved?: string | null;\n browser?: readonly string[];\n document?: string;\n}\n\nconst shipped = (tag: string | null | undefined): string | undefined => {\n if (!tag) return undefined;\n const base = tag.toLowerCase().replaceAll('_', '-').split('-')[0];\n // The legacy `cn` code is Chinese.\n const code = base === 'cn' ? 'zh' : base;\n return (LOCALES_WITH_BUNDLES as readonly string[]).includes(code)\n ? code\n : undefined;\n};\n\nconst readSaved = (): string | null => {\n try {\n return window.localStorage.getItem(SAVED_LOCALE_KEY);\n } catch {\n return null;\n }\n};\n\n/**\n * The language to show an error in. First match wins:\n * 1. the `locale` prop;\n * 2. the language the visitor picked before in the kit;\n * 3. the browser's languages, in order;\n * 4. `<html lang>`, unless the host says it is only its default;\n * 5. Italian.\n * Only languages the kit ships count at each step.\n */\nexport function resolveErrorPageLocale(\n sources: ErrorPageLocaleSources = {},\n): string {\n const inBrowser = typeof window !== 'undefined';\n const saved =\n sources.saved !== undefined\n ? sources.saved\n : inBrowser\n ? readSaved()\n : null;\n const browser =\n sources.browser ??\n (inBrowser && typeof navigator !== 'undefined'\n ? navigator.languages?.length\n ? navigator.languages\n : [navigator.language]\n : []);\n const documentLang =\n sources.document ??\n (typeof document !== 'undefined' ? document.documentElement.lang : '');\n\n const candidates = [\n sources.locale,\n saved,\n ...browser,\n sources.hostLocaleIsDefault ? undefined : documentLang,\n ];\n for (const candidate of candidates) {\n const code = shipped(candidate);\n if (code) return code;\n }\n return ERROR_PAGE_FALLBACK_LOCALE;\n}\n\n/** Fetches the kit's bundle for a language without changing the host's\n * active language. Rejects when the bundle cannot load. */\nexport const loadErrorPageLocale = (\n language: string,\n instance: I18n,\n): Promise<void> => loadLocale(language, instance);\n","/* -------------------------------------------------------------------- */\n/* ErrorPage — one branded, translated page for every HTTP error. */\n/* */\n/* A status picks the illustration, the copy and the main action (home, */\n/* retry or log in). The language is chosen in the browser, so a host */\n/* whose server rendered the error before it knew the visitor's */\n/* language still shows the right one: see `resolveErrorPageLocale`. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react';\nimport type { i18n as I18n } from 'i18next';\nimport { useTranslation } from 'react-i18next';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { CircleQuestionMark, House, LogIn, RotateCcw } from 'lucide-react';\nimport { Button } from '../../components/button';\nimport { Logo } from '../../components/logo';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { errorPageStatusSpec } from './error-page-statuses';\nimport { ErrorPageIllustration } from './error-page-illustration';\nimport {\n loadErrorPageLocale,\n resolveErrorPageLocale,\n} from './error-page-locale';\n\nconst errorPageVariants = cva(\n 'ds:flex ds:flex-col ds:items-center ds:justify-center ds:bg-[var(--background)] ds:text-[var(--foreground)] ds:px-[var(--spacing-md)] ds:py-[var(--spacing-2xl)]',\n {\n variants: {\n layout: {\n /** Fills the viewport: the whole page is the error. */\n page: 'ds:min-h-screen',\n /** Fills its container, under the host's own header. */\n embedded: 'ds:[min-block-size:100%]',\n },\n },\n defaultVariants: { layout: 'page' },\n },\n);\n\nconst RTL = new Set(['ar']);\n\n/** How long to wait for the chosen language before showing English. An\n * error page often appears because the network is failing. */\nconst LANGUAGE_PATIENCE = 1500;\n\n/** \"22:00\" today, \"30 set, 22:00\" on another day, and with the year when\n * it is not this year. Undefined for a date that does not parse, so a\n * bad value shows nothing. */\nfunction formatBackAt(\n value: Date | string,\n locale: string,\n): string | undefined {\n const at = value instanceof Date ? value : new Date(value);\n if (Number.isNaN(at.getTime())) return undefined;\n const now = new Date();\n const day =\n now.toDateString() === at.toDateString()\n ? {}\n : ({\n day: 'numeric',\n month: 'short',\n ...(now.getFullYear() === at.getFullYear()\n ? {}\n : { year: 'numeric' }),\n } as const);\n // Plain `en` formats the US way; the kit writes British English.\n return new Intl.DateTimeFormat(locale === 'en' ? 'en-GB' : locale, {\n ...day,\n hour: '2-digit',\n minute: '2-digit',\n }).format(at);\n}\n\n/** True when the instance holds error page copy for a language. A host\n * may register its own `ui` bundle, even a partial one for this page:\n * the kit's full bundle is still merged in, and English backs every\n * key, so a gap never shows as a raw key. */\nconst hasCopy = (instance: I18n, language: string): boolean =>\n Boolean(instance.getResource(language, 'ui', 'errorPage'));\n\n/** Links the page may render: paths on the same site, and web, mail and\n * phone addresses written out in full. Anything else becomes `#`. */\nconst safeHref = (href: string): string => (isSafeHref(href) ? href : '#');\n\nexport interface ErrorPageProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'title'>,\n VariantProps<typeof errorPageVariants> {\n /** HTTP status, `'offline'` for a network error in the browser, or\n * `'maintenance'` for planned downtime with no HTTP error behind it.\n * Statuses without their own copy show the generic page. */\n status: number | 'offline' | 'maintenance';\n /** Where \"Go to the home page\" leads. Default `/`. Like every link\n * here it may be a path on the same site or an `http(s)`, `mailto:`\n * or `tel:` address; anything else is replaced with `#`. */\n homeHref?: string;\n /** Where \"Log in\" leads for 401 and 419. Without it, those statuses\n * offer \"Try again\" instead. */\n loginHref?: string;\n /** Adds \"Contact support\". A path, a web address, `mailto:` or `tel:`. */\n supportHref?: string;\n /** \"Try again\". Default: reload the page. */\n onRetry?: () => void;\n /** Shown for support to quote, e.g. the host's X-Request-Id. */\n requestId?: string;\n /** When planned maintenance should end, for 503 and `'maintenance'`.\n * Shown in the visitor's own time zone and language. Pass a `Date`, or\n * an ISO string with its offset (`2026-10-01T22:00:00+02:00`): without\n * one the browser reads it as the visitor's local time. */\n backAt?: Date | string;\n /** The host's language. Always wins when the kit ships it. */\n locale?: string;\n /** True when `<html lang>` is only the site default, as on an error\n * raised before routing: the page then skips it when choosing. */\n hostLocaleIsDefault?: boolean;\n /** Replaces the status title. Pass it already translated. */\n title?: string;\n /** Replaces the status message. Pass it already translated. */\n message?: string;\n /** Signs the page with the Alfadocs wordmark. Default true. */\n showLogo?: boolean;\n /** Renders as `<main>` (default) or `<div>` when the host already has\n * a main landmark. */\n as?: 'main' | 'div';\n /** Moves focus to the heading once shown. Default true. */\n focusHeading?: boolean;\n}\n\nexport const ErrorPage = forwardRef<HTMLElement, ErrorPageProps>(\n (\n {\n status,\n homeHref = '/',\n loginHref,\n supportHref,\n onRetry,\n requestId,\n backAt,\n locale,\n hostLocaleIsDefault = false,\n title,\n message,\n showLogo = true,\n as: Root = 'main',\n focusHeading = true,\n layout,\n className,\n ...rest\n },\n ref,\n ) => {\n const { i18n } = useTranslation('ui');\n const language = useMemo(\n () => resolveErrorPageLocale({ locale, hostLocaleIsDefault }),\n [locale, hostLocaleIsDefault],\n );\n // The chosen language may not be loaded yet. Until it is, the page\n // stays hidden rather than flashing English. If it cannot load, or\n // takes too long (offline, a failing gateway), the page shows in\n // English and switches over if the language arrives after all.\n const [shown, setShown] = useState<string | null>(() =>\n hasCopy(i18n, language) ? language : null,\n );\n // Bumped when a bundle lands, so copy that arrives then is drawn.\n const [, setLoaded] = useState(0);\n useEffect(() => {\n let current = true;\n const ready = hasCopy(i18n, language);\n setShown(ready ? language : null);\n const landed = () => current && setLoaded((count) => count + 1);\n // The kit's full bundles: English backs every key, and a host's own\n // instance may hold neither yet. A loaded bundle resolves at once.\n void loadErrorPageLocale('en', i18n)\n .then(landed)\n .catch(() => undefined);\n const patience = ready\n ? undefined\n : setTimeout(\n () => current && setShown((now) => now ?? 'en'),\n LANGUAGE_PATIENCE,\n );\n loadErrorPageLocale(language, i18n)\n .then(() => {\n if (!current) return;\n setShown(language);\n landed();\n })\n .catch(() => current && setShown((now) => now ?? 'en'));\n return () => {\n current = false;\n clearTimeout(patience);\n };\n }, [i18n, language]);\n\n // The chosen language first, English for any key it lacks.\n const t = i18n.getFixedT(\n shown && shown !== 'en' ? [shown, 'en'] : 'en',\n 'ui',\n );\n const spec = errorPageStatusSpec(status);\n const backTime =\n spec.key === 'maintenance' && backAt\n ? formatBackAt(backAt, shown ?? 'en')\n : undefined;\n\n const headingRef = useRef<HTMLHeadingElement | null>(null);\n // Once only: a language that arrives late must not pull focus back.\n const focused = useRef(false);\n useEffect(() => {\n if (!shown || !focusHeading || focused.current) return;\n focused.current = true;\n headingRef.current?.focus({ preventScroll: true });\n }, [shown, focusHeading]);\n\n const retry = onRetry ?? (() => window.location.reload());\n const primary =\n spec.primary === 'login' && !loginHref ? 'retry' : spec.primary;\n\n const link = (\n action: 'home' | 'login' | 'support',\n href: string,\n icon: ReactNode,\n intent: 'primary' | 'secondary' | 'ghost',\n ) => (\n <Button\n key={action}\n intent={intent}\n size=\"lg\"\n flipIconInRtl={action === 'login'}\n asChild\n startIcon={icon}\n data-action={action}\n >\n <a href={safeHref(href)}>{t(`errorPage.actions.${action}`)}</a>\n </Button>\n );\n\n const actions: ReactNode[] = [];\n if (primary === 'retry') {\n actions.push(\n <Button\n key=\"retry\"\n intent=\"primary\"\n size=\"lg\"\n startIcon={<RotateCcw aria-hidden=\"true\" />}\n onClick={retry}\n data-action=\"retry\"\n >\n {t('errorPage.actions.retry')}\n </Button>,\n );\n } else if (primary === 'login' && loginHref) {\n actions.push(\n link('login', loginHref, <LogIn aria-hidden=\"true\" />, 'primary'),\n );\n }\n // Always a way back, except offline or during maintenance, where\n // there is nowhere to go.\n if (status !== 'offline' && spec.key !== 'maintenance') {\n actions.push(\n link(\n 'home',\n homeHref,\n <House aria-hidden=\"true\" />,\n primary === 'home' ? 'primary' : 'secondary',\n ),\n );\n }\n if (supportHref) {\n actions.push(\n link(\n 'support',\n supportHref,\n <CircleQuestionMark aria-hidden=\"true\" />,\n 'ghost',\n ),\n );\n }\n\n return (\n <Root\n ref={ref as Ref<HTMLDivElement>}\n data-component=\"error-page\"\n data-status={String(status)}\n lang={shown ?? undefined}\n aria-busy={shown ? undefined : true}\n dir={shown && RTL.has(shown) ? 'rtl' : 'ltr'}\n className={errorPageVariants({ layout, className })}\n {...rest}\n >\n <div\n className={\n shown\n ? 'ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-lg)] ds:text-center ds:[max-inline-size:32rem]'\n : 'ds:invisible'\n }\n >\n <ErrorPageIllustration mood={spec.mood} />\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {/* Focus lands here, so the status label sits inside the\n heading: a screen reader would never read a label before\n it. No outline: the heading is focused by script only and\n is not in the tab order. */}\n <h1\n ref={headingRef}\n tabIndex={-1}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:outline-none\"\n >\n {typeof status === 'number' && (\n <span className=\"type-label ds:text-[var(--muted-foreground)]\">\n {t('errorPage.statusLabel', { status })}\n </span>\n )}\n <span className=\"type-title-page\">\n {title ?? t(`errorPage.status.${spec.key}.title`)}\n </span>\n </h1>\n <p className=\"type-body ds:text-[var(--muted-foreground)]\">\n {message ?? t(`errorPage.status.${spec.key}.message`)}\n </p>\n {backTime && (\n <p className=\"type-body ds:font-semibold\">\n {t('errorPage.backAt', { time: backTime })}\n </p>\n )}\n </div>\n {actions.length > 0 && (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:justify-center ds:gap-[var(--spacing-sm)]\">\n {actions}\n </div>\n )}\n {requestId && (\n <p className=\"type-body-sm ds:text-[var(--muted-foreground)]\">\n {t('errorPage.reference', { id: requestId })}\n <br />\n {t('errorPage.referenceHint')}\n </p>\n )}\n {showLogo && <Logo decorative size=\"sm\" className=\"ds:opacity-70\" />}\n </div>\n </Root>\n );\n },\n);\nErrorPage.displayName = 'ErrorPage';\n"],"names":["__iconNode","CircleQuestionMark","createLucideIcon","House","ERROR_PAGE_STATUSES","SPECS","errorPageStatusSpec","status","SAVED_LOCALE_KEY","ERROR_PAGE_FALLBACK_LOCALE","shipped","tag","base","code","LOCALES_WITH_BUNDLES","readSaved","resolveErrorPageLocale","sources","inBrowser","saved","browser","_a","documentLang","candidates","candidate","loadErrorPageLocale","language","instance","loadLocale","errorPageVariants","cva","RTL","LANGUAGE_PATIENCE","formatBackAt","value","locale","at","now","day","hasCopy","safeHref","href","isSafeHref","ErrorPage","forwardRef","homeHref","loginHref","supportHref","onRetry","requestId","backAt","hostLocaleIsDefault","title","message","showLogo","Root","focusHeading","layout","className","rest","ref","i18n","useTranslation","useMemo","shown","setShown","useState","setLoaded","useEffect","current","ready","landed","count","patience","t","spec","backTime","headingRef","useRef","focused","retry","primary","link","action","icon","intent","jsx","Button","actions","RotateCcw","LogIn","jsxs","ErrorPageIllustration","Logo"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,MAAM,KAAK,UAAU;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,wCAAwC,KAAK,SAAQ,CAAE;AAAA,EACrE,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,KAAqBC,EAAiB,wBAAwBF,EAAU;ACd9E;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,8CAA8C,KAAK,SAAQ,CAAE;AAAA,EAC3E;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMG,KAAQD,EAAiB,SAASF,EAAU,GChBrCI,KAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAeMC,IAAuE;AAAA,EAC3E,KAAK,EAAE,KAAK,cAAc,MAAM,WAAW,SAAS,OAAA;AA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AW;AAAA,kCAC1C,MAAA,EAAG;AAAA,gBACHyB,EAAE,yBAAyB;AAAA,cAAA,GAC9B;AAAA,cAEDpB,uBAAauC,GAAA,EAAK,YAAU,IAAC,MAAK,MAAK,WAAU,gBAAA,CAAgB;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACpE;AAAA,IAAA;AAAA,EAGN;AACF;AACAlD,GAAU,cAAc;","x_google_ignoreList":[0,1]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-page-illustration-QGJAvuFB.js","sources":["../../src/patterns/error-page/error-page-illustration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* ErrorPageIllustration — the Alfadocs mark, having a bad day. */\n/* */\n/* One mood per error, all drawn from the four pieces of the mark. */\n/* Easter egg: click the mark and it snaps back together for a moment. */\n/* Decorative and pointer-only on purpose: nothing here is needed to */\n/* recover from the error. Every motion scales off */\n/* --animation-duration, so reduced motion and the accessible themes */\n/* hold it still, and each mood settles after about five seconds. */\n/* -------------------------------------------------------------------- */\n\nimport { useEffect, useRef, useState, type ReactNode } from 'react';\nimport {\n ALL,\n CENTRE,\n Mark,\n Piece,\n type PieceName,\n} from '../_shared/mark-pieces';\n\nexport type ErrorPageMood =\n | 'jumbled'\n | 'locked'\n | 'roped'\n | 'lost'\n | 'wrong-way'\n | 'vanished'\n | 'asleep'\n | 'patched'\n | 'melt'\n | 'unplugged'\n | 'rebuild'\n | 'snail'\n | 'adrift'\n | 'puzzled';\n\n/* ---- The mark ------------------------------------------------------ */\n/* Its four pieces live in `_shared/mark-pieces`, shared with the\n animated brand mark. */\n\n/** A dashed outline where a piece belongs. */\nfunction Slot({ name }: { name: PieceName }): ReactNode {\n return (\n <Piece\n name={name}\n fill=\"none\"\n stroke=\"var(--primary)\"\n strokeWidth=\"2\"\n strokeDasharray=\"5 5\"\n strokeOpacity=\"0.55\"\n />\n );\n}\n\nfunction Ground({ cx = 74, rx = 46 }: { cx?: number; rx?: number }) {\n return (\n <ellipse\n cx={cx}\n cy=\"206\"\n rx={rx}\n ry=\"4\"\n fill=\"var(--muted-foreground)\"\n fillOpacity=\"0.2\"\n />\n );\n}\n\n/* ---- Motion ---------------------------------------------------------- */\n/* Every class is written out in full: Tailwind only generates the ones it\n can read as a whole string. Each mood plays for about five seconds and\n then rests, so nothing moves for longer without the visitor asking\n (WCAG 2.2.2); a click on the mark plays it again. */\n\nconst DRIP =\n 'ds:[transform-box:fill-box] ds:origin-top ds:motion-safe:animate-[error-page-drip_calc(var(--animation-duration)*15)_ease-in-out_1]';\nconst DROP =\n 'ds:motion-safe:animate-[error-page-drop_calc(var(--animation-duration)*12)_ease-in_2]';\nconst ROCK =\n 'ds:[transform-box:fill-box] ds:origin-bottom ds:motion-safe:animate-[error-page-rock_calc(var(--animation-duration)*20)_ease-in-out_1]';\nconst BOB =\n 'ds:[transform-box:fill-box] ds:origin-center ds:motion-safe:animate-[error-page-bob_calc(var(--animation-duration)*14)_ease-in-out_1]';\nconst SWING =\n 'ds:[transform-box:fill-box] ds:origin-top ds:motion-safe:animate-[error-page-swing_calc(var(--animation-duration)*18)_ease-in-out_1]';\nconst WIGGLE =\n 'ds:[transform-box:fill-box] ds:origin-center ds:motion-safe:animate-[error-page-wiggle_calc(var(--animation-duration)*10)_ease-in-out_2]';\nconst RISE =\n 'ds:[transform-box:fill-box] ds:origin-center ds:motion-safe:animate-[error-page-rise_calc(var(--animation-duration)*16)_ease-out_1]';\nconst FLICKER =\n 'ds:motion-safe:animate-[error-page-flicker_calc(var(--animation-duration)*6)_steps(1)_4]';\nconst CRAWL =\n 'ds:motion-safe:animate-[error-page-crawl_calc(var(--animation-duration)*24)_ease-in-out_1]';\nconst BUMP =\n 'ds:motion-safe:animate-[error-page-bump_calc(var(--animation-duration)*12)_ease-in-out_2]';\nconst BREATHE =\n 'ds:[transform-box:fill-box] ds:origin-center ds:motion-safe:animate-[error-page-breathe_calc(var(--animation-duration)*20)_ease-in-out_1]';\nconst LATE = 'ds:[animation-delay:calc(var(--animation-duration)*5)]';\nconst LATER = 'ds:[animation-delay:calc(var(--animation-duration)*9)]';\nconst POP =\n 'ds:[transform-box:fill-box] ds:origin-center ds:motion-safe:animate-[error-page-pop_calc(var(--animation-duration)*3)_ease-out_1]';\n\n/* ---- Moods ----------------------------------------------------------- */\n\n/** 400: the pieces have been put together the wrong way round. */\nfunction Jumbled(): ReactNode {\n const turns: Record<PieceName, number> = {\n top: 75,\n right: -60,\n left: 40,\n bottom: -95,\n };\n return (\n <>\n {ALL.map((name, i) => {\n const [cx, cy] = CENTRE[name];\n return (\n <g key={name} transform={`rotate(${turns[name]} ${cx} ${cy})`}>\n <g className={`${WIGGLE} ${i % 2 ? LATE : ''}`}>\n <Piece name={name} />\n </g>\n </g>\n );\n })}\n <Ground />\n </>\n );\n}\n\n/** 401: a padlock hangs on the mark until you log in. */\nfunction Locked(): ReactNode {\n return (\n <>\n <Mark />\n <g className={SWING}>\n <path\n d=\"M60 84 v-12 a14 14 0 0 1 28 0 v12\"\n fill=\"none\"\n stroke=\"var(--muted-foreground)\"\n strokeWidth=\"6\"\n strokeLinecap=\"round\"\n />\n <rect\n x=\"50\"\n y=\"82\"\n width=\"48\"\n height=\"38\"\n rx=\"7\"\n fill=\"var(--muted-foreground)\"\n />\n <circle cx=\"74\" cy=\"97\" r=\"4.5\" fill=\"var(--background)\" />\n <rect\n x=\"72\"\n y=\"99\"\n width=\"4\"\n height=\"10\"\n rx=\"2\"\n fill=\"var(--background)\"\n />\n </g>\n <Ground />\n </>\n );\n}\n\n/** 403: roped off, like a VIP area. */\nfunction Roped(): ReactNode {\n const post = (x: number) => (\n <g fill=\"var(--muted-foreground)\">\n <rect x={x - 3} y=\"158\" width=\"6\" height=\"48\" rx=\"3\" />\n <circle cx={x} cy=\"157\" r=\"6\" />\n <rect x={x - 11} y=\"202\" width=\"22\" height=\"5\" rx=\"2.5\" />\n </g>\n );\n return (\n <>\n <Mark />\n {post(8)}\n {post(140)}\n <g className={SWING}>\n <path\n d=\"M8 160 Q74 196 140 160\"\n fill=\"none\"\n stroke=\"var(--destructive)\"\n strokeWidth=\"6\"\n strokeLinecap=\"round\"\n />\n </g>\n </>\n );\n}\n\n/** 404: a piece has fallen off and rocks on the ground. */\nfunction Lost(): ReactNode {\n return (\n <>\n <Mark except={['right']} />\n <Slot name=\"right\" />\n <Ground cx={150} rx={28} />\n <g transform=\"translate(150 204)\">\n <g className={ROCK}>\n <rect\n x=\"-24.67\"\n y=\"-35\"\n width=\"49.34\"\n height=\"33.99\"\n rx=\"4.56\"\n transform=\"rotate(10)\"\n />\n </g>\n </g>\n </>\n );\n}\n\n/** 405: a piece turned the wrong way keeps bumping into its slot. */\nfunction WrongWay(): ReactNode {\n return (\n <>\n <Mark except={['right']} />\n <Slot name=\"right\" />\n <g className={BUMP}>\n <g transform=\"translate(40 0) rotate(90 121 70)\">\n <Piece name=\"right\" />\n </g>\n </g>\n <Ground />\n </>\n );\n}\n\n/** 410: only a ghost of the mark is left, drifting away. */\nfunction Vanished(): ReactNode {\n const bits: [number, number, string][] = [\n [34, 44, ''],\n [96, 18, LATE],\n [118, 92, LATER],\n [62, 118, LATE],\n [20, 96, LATER],\n ];\n return (\n <>\n {ALL.map((name) => (\n <Slot key={name} name={name} />\n ))}\n {bits.map(([x, y, delay]) => (\n <rect\n key={`${x}-${y}`}\n x={x}\n y={y}\n width=\"6\"\n height=\"6\"\n rx=\"1.5\"\n className={`${RISE} ${delay}`}\n />\n ))}\n <Ground />\n </>\n );\n}\n\n/** 419: the page was left open so long the mark fell asleep. */\nfunction Asleep(): ReactNode {\n const z = (x: number, y: number, size: number, delay: string) => (\n <path\n d={`M${x} ${y} h${size} l-${size} ${size} h${size}`}\n fill=\"none\"\n stroke=\"var(--muted-foreground)\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={`${RISE} ${delay}`}\n />\n );\n return (\n <>\n <g transform=\"rotate(14 74 74)\">\n <g className={BREATHE}>\n <Mark />\n </g>\n </g>\n {z(122, 22, 10, '')}\n {z(140, 2, 13, LATE)}\n {z(160, -16, 16, LATER)}\n <Ground />\n </>\n );\n}\n\n/** 500: something broke on our side, and it is being patched up. */\nfunction Patched(): ReactNode {\n return (\n <>\n <g className={BREATHE}>\n <Mark />\n {/* The crack, cut through the bottom piece. */}\n <polyline\n points=\"62,102 75,113 67,119 83,128 75,137 91,145\"\n fill=\"none\"\n stroke=\"var(--background)\"\n strokeWidth=\"4.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n {/* A sticking plaster across it. */}\n <g transform=\"rotate(-40 78 122)\">\n <rect\n x=\"46\"\n y=\"111\"\n width=\"64\"\n height=\"22\"\n rx=\"11\"\n fill=\"var(--muted)\"\n stroke=\"var(--border)\"\n strokeWidth=\"1.5\"\n />\n <rect\n x=\"68\"\n y=\"111\"\n width=\"20\"\n height=\"22\"\n fill=\"var(--border)\"\n fillOpacity=\"0.6\"\n />\n <g fill=\"var(--muted-foreground)\" fillOpacity=\"0.5\">\n <circle cx=\"55\" cy=\"118\" r=\"1.4\" />\n <circle cx=\"55\" cy=\"126\" r=\"1.4\" />\n <circle cx=\"101\" cy=\"118\" r=\"1.4\" />\n <circle cx=\"101\" cy=\"126\" r=\"1.4\" />\n </g>\n </g>\n </g>\n <Ground />\n </>\n );\n}\n\n/** A drip hanging from the melting edge, with a round bead at its end. */\nfunction Drip({\n cx,\n top,\n length,\n className = '',\n}: {\n cx: number;\n top: number;\n length: number;\n className?: string;\n}): ReactNode {\n return (\n <g className={`${DRIP} ${className}`}>\n <rect x={cx - 3.5} y={top} width=\"7\" height={length} rx=\"3.5\" />\n <circle cx={cx} cy={top + length} r=\"4.2\" />\n </g>\n );\n}\n\n/** 429: so many requests the mark has overheated and melted. */\nfunction Melt(): ReactNode {\n return (\n <>\n <Mark />\n {/* The bottom edge sags as it melts. */}\n <path d=\"M67 139 L99 131 L101 138 Q92 151 80 152 Q70 153 68 143 Z\" />\n <Drip cx={75} top={144} length={20} className={LATE} />\n <Drip cx={85.5} top={141} length={32} />\n <Drip cx={96} top={137} length={13} className={LATER} />\n <circle cx=\"85.5\" cy=\"179\" r=\"3.2\" className={DROP} />\n <ellipse cx=\"86\" cy=\"204\" rx=\"30\" ry=\"5.5\" fillOpacity=\"0.3\" />\n </>\n );\n}\n\n/** 502: the mark has come apart, with a spark where it broke. */\nfunction Unplugged(): ReactNode {\n return (\n <>\n <g transform=\"translate(-12 -8)\">\n <Piece name=\"top\" />\n <Piece name=\"left\" />\n </g>\n <g transform=\"translate(12 8)\">\n <Piece name=\"right\" />\n <Piece name=\"bottom\" />\n </g>\n <polyline\n points=\"66,62 80,72 68,78 84,90\"\n fill=\"none\"\n stroke=\"var(--accent)\"\n strokeWidth=\"4\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={FLICKER}\n />\n <Ground />\n </>\n );\n}\n\n/** 503 and maintenance: a crane lowers a piece back into place. */\nfunction Rebuild(): ReactNode {\n return (\n <>\n <Mark except={['right']} />\n <Slot name=\"right\" />\n <g className={SWING}>\n <line\n x1=\"121\"\n y1=\"-24\"\n x2=\"121\"\n y2=\"6\"\n stroke=\"var(--muted-foreground)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M121 6 v5 a4 4 0 1 1 -4 4\"\n fill=\"none\"\n stroke=\"var(--muted-foreground)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <g transform=\"translate(0 -36)\">\n <Piece name=\"right\" />\n </g>\n </g>\n <Ground />\n </>\n );\n}\n\n/** 504: the missing piece is on its way, by snail. */\nfunction Snail(): ReactNode {\n return (\n <>\n <Mark except={['right']} />\n <Slot name=\"right\" />\n <Ground cx={140} rx={34} />\n <g className={CRAWL}>\n <g fill=\"var(--muted-foreground)\" fillOpacity=\"0.45\">\n <rect x=\"110\" y=\"198\" width=\"58\" height=\"8\" rx=\"4\" />\n <rect x=\"110\" y=\"184\" width=\"12\" height=\"22\" rx=\"6\" />\n </g>\n <g\n stroke=\"var(--muted-foreground)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n >\n <line x1=\"113\" y1=\"186\" x2=\"108\" y2=\"173\" />\n <line x1=\"119\" y1=\"186\" x2=\"121\" y2=\"172\" />\n </g>\n <circle cx=\"108\" cy=\"172\" r=\"2.5\" fill=\"var(--muted-foreground)\" />\n <circle cx=\"121\" cy=\"171\" r=\"2.5\" fill=\"var(--muted-foreground)\" />\n <circle\n cx=\"146\"\n cy=\"185\"\n r=\"16\"\n fill=\"var(--muted-foreground)\"\n fillOpacity=\"0.7\"\n />\n <path\n d=\"M146 185 a3 3 0 1 1 3 3 a7 7 0 1 1 -7 -7 a11 11 0 1 1 11 11\"\n fill=\"none\"\n stroke=\"var(--background)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <rect\n x=\"-13\"\n y=\"-9\"\n width=\"26\"\n height=\"18\"\n rx=\"3\"\n transform=\"translate(147 161) rotate(-15)\"\n />\n </g>\n </>\n );\n}\n\n/** Offline: the pieces have drifted apart. */\nfunction Adrift(): ReactNode {\n const drift: Record<PieceName, [number, number, string]> = {\n top: [0, -12, ''],\n right: [14, 0, LATE],\n left: [-14, 0, LATER],\n bottom: [0, 14, LATE],\n };\n return (\n <>\n <Ground />\n {ALL.map((name) => {\n const [x, y, delay] = drift[name];\n return (\n <g key={name} transform={`translate(${x} ${y})`}>\n <g className={`${BOB} ${delay}`}>\n <Piece name={name} />\n </g>\n </g>\n );\n })}\n </>\n );\n}\n\n/** Any other error: the mark is as puzzled as you are. */\nfunction Puzzled(): ReactNode {\n return (\n <>\n <g className={ROCK}>\n <Mark />\n </g>\n <g className={BOB}>\n <path\n d=\"M140 -2 a10 10 0 1 1 10 10 v7\"\n fill=\"none\"\n stroke=\"var(--muted-foreground)\"\n strokeWidth=\"5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <circle cx=\"150\" cy=\"27\" r=\"3\" fill=\"var(--muted-foreground)\" />\n </g>\n <Ground />\n </>\n );\n}\n\nconst MOODS: Record<ErrorPageMood, () => ReactNode> = {\n jumbled: Jumbled,\n locked: Locked,\n roped: Roped,\n lost: Lost,\n 'wrong-way': WrongWay,\n vanished: Vanished,\n asleep: Asleep,\n patched: Patched,\n melt: Melt,\n unplugged: Unplugged,\n rebuild: Rebuild,\n snail: Snail,\n adrift: Adrift,\n puzzled: Puzzled,\n};\n\n/** How long the mark stays fixed after a click, in milliseconds. */\nconst FIXED_FOR = 3000;\n\nexport function ErrorPageIllustration({\n mood,\n}: {\n mood: ErrorPageMood;\n}): ReactNode {\n const ref = useRef<HTMLDivElement | null>(null);\n const [fixed, setFixed] = useState(false);\n\n // A listener rather than onClick: the egg is for the pointer only, and\n // the element stays out of the accessibility tree.\n useEffect(() => {\n const element = ref.current;\n if (!element) return undefined;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const fix = () => {\n setFixed(true);\n clearTimeout(timer);\n timer = setTimeout(() => setFixed(false), FIXED_FOR);\n };\n element.addEventListener('click', fix);\n return () => {\n element.removeEventListener('click', fix);\n clearTimeout(timer);\n };\n }, []);\n\n const Scene = MOODS[mood];\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n data-mood={fixed ? 'fixed' : mood}\n className=\"ds:w-48 ds:select-none\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"-20 -24 200 240\"\n fill=\"var(--primary)\"\n className=\"ds:block ds:w-full ds:h-auto ds:overflow-visible\"\n >\n {fixed ? (\n <g className={POP}>\n <Mark />\n </g>\n ) : (\n <Scene />\n )}\n </svg>\n </div>\n );\n}\n"],"names":["Slot","name","jsx","Piece","Ground","cx","rx","DRIP","DROP","ROCK","BOB","SWING","WIGGLE","RISE","FLICKER","CRAWL","BUMP","BREATHE","LATE","LATER","POP","Jumbled","turns","jsxs","Fragment","ALL","i","cy","CENTRE","Locked","Mark","Roped","post","x","Lost","WrongWay","Vanished","bits","y","delay","Asleep","z","size","Patched","Drip","top","length","className","Melt","Unplugged","Rebuild","Snail","Adrift","drift","Puzzled","MOODS","FIXED_FOR","ErrorPageIllustration","mood","ref","useRef","fixed","setFixed","useState","useEffect","element","timer","fix","Scene"],"mappings":";;;AAyCA,SAASA,EAAK,EAAE,MAAAC,KAAwC;AACtD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAF;AAAA,MACA,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,eAAc;AAAA,IAAA;AAAA,EAAA;AAGpB;AAEA,SAASG,EAAO,EAAE,IAAAC,IAAK,IAAI,IAAAC,IAAK,MAAoC;AAClE,SACE,gBAAAJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAAG;AAAA,MACA,IAAG;AAAA,MACH,IAAAC;AAAA,MACA,IAAG;AAAA,MACH,MAAK;AAAA,MACL,aAAY;AAAA,IAAA;AAAA,EAAA;AAGlB;AAQA,MAAMC,IACJ,uIACIC,IACJ,yFACIC,IACJ,0IACIC,IACJ,yIACIC,IACJ,wIACIC,IACJ,4IACIC,IACJ,uIACIC,IACJ,4FACIC,IACJ,8FACIC,IACJ,6FACIC,IACJ,6IACIC,IAAO,0DACPC,IAAQ,0DACRC,IACJ;AAKF,SAASC,IAAqB;AAC5B,QAAMC,IAAmC;AAAA,IACvC,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA;AAEV,SACE,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAC,EAAI,IAAI,CAACxB,GAAMyB,MAAM;AACpB,YAAM,CAACrB,GAAIsB,CAAE,IAAIC,EAAO3B,CAAI;AAC5B,aACE,gBAAAC,EAAC,KAAA,EAAa,WAAW,UAAUoB,EAAMrB,CAAI,CAAC,IAAII,CAAE,IAAIsB,CAAE,KACxD,UAAA,gBAAAzB,EAAC,KAAA,EAAE,WAAW,GAAGU,CAAM,IAAIc,IAAI,IAAIR,I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