@alfadocs/ui-kit-debug 0.97.2 → 0.98.0

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 (42) hide show
  1. package/dist/_chunks/{document-preview-DXl9migE.js → document-preview-DXsCEj4U.js} +2 -2
  2. package/dist/_chunks/{document-preview-DXl9migE.js.map → document-preview-DXsCEj4U.js.map} +1 -1
  3. package/dist/_chunks/{muscle-scheme-CFBE2dme.js → muscle-scheme-kgCX5qfO.js} +2 -2
  4. package/dist/_chunks/{muscle-scheme-CFBE2dme.js.map → muscle-scheme-kgCX5qfO.js.map} +1 -1
  5. package/dist/_chunks/{notes-panel-BLjlYBt-.js → notes-panel-BKwd-bOV.js} +2 -2
  6. package/dist/_chunks/{notes-panel-BLjlYBt-.js.map → notes-panel-BKwd-bOV.js.map} +1 -1
  7. package/dist/_chunks/{patient-summary-card-vn1H4xWj.js → patient-summary-card-C-iVDo53.js} +4 -2
  8. package/dist/_chunks/{patient-summary-card-vn1H4xWj.js.map → patient-summary-card-C-iVDo53.js.map} +1 -1
  9. package/dist/_chunks/{rich-text-editor-RRkBN_WB.js → rich-text-editor-DHpV2q6d.js} +4 -4
  10. package/dist/_chunks/rich-text-editor-DHpV2q6d.js.map +1 -0
  11. package/dist/_chunks/{sign-document-DI561d1C.js → sign-document-cH9CboWB.js} +2 -2
  12. package/dist/_chunks/{sign-document-DI561d1C.js.map → sign-document-cH9CboWB.js.map} +1 -1
  13. package/dist/_chunks/{signature-capture-DN52VNKL.js → signature-capture-D6ut9_IR.js} +2 -2
  14. package/dist/_chunks/signature-capture-D6ut9_IR.js.map +1 -0
  15. package/dist/_chunks/{tabs-CVTukWRD.js → tabs-CBb2AidH.js} +17 -17
  16. package/dist/_chunks/tabs-CBb2AidH.js.map +1 -0
  17. package/dist/_chunks/{warning-stack-CAHQ0xxS.js → warning-stack-DKeAfj5M.js} +3 -3
  18. package/dist/_chunks/warning-stack-DKeAfj5M.js.map +1 -0
  19. package/dist/agent-catalog.json +1 -1
  20. package/dist/components/document-preview/index.js +1 -1
  21. package/dist/components/muscle-scheme/index.js +1 -1
  22. package/dist/components/notes-panel/index.js +1 -1
  23. package/dist/components/patient-summary-card/index.js +1 -1
  24. package/dist/components/patient-summary-card/patient-summary-card.d.ts.map +1 -1
  25. package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
  26. package/dist/components/rich-text-editor/index.js +1 -1
  27. package/dist/components/sign-document/index.js +1 -1
  28. package/dist/components/signature-capture/index.js +1 -1
  29. package/dist/components/signature-capture/signature-capture.d.ts.map +1 -1
  30. package/dist/components/skeleton-scheme/index.js +1 -1
  31. package/dist/components/tabs/index.js +1 -1
  32. package/dist/components/tabs/tabs.d.ts.map +1 -1
  33. package/dist/components/warning-stack/index.js +1 -1
  34. package/dist/components/warning-stack/warning-stack.d.ts.map +1 -1
  35. package/dist/host-compat.css +572 -0
  36. package/dist/index.js +9 -9
  37. package/dist/tokens.css +1 -1
  38. package/package.json +10 -3
  39. package/dist/_chunks/rich-text-editor-RRkBN_WB.js.map +0 -1
  40. package/dist/_chunks/signature-capture-DN52VNKL.js.map +0 -1
  41. package/dist/_chunks/tabs-CVTukWRD.js.map +0 -1
  42. package/dist/_chunks/warning-stack-CAHQ0xxS.js.map +0 -1
@@ -3,7 +3,7 @@ import { forwardRef as ne, useRef as o, useState as V, useId as ie, useCallback
3
3
  import { useTranslation as oe } from "react-i18next";
4
4
  import { u as le } from "./registry-DvAUVLHh.js";
5
5
  import { C as ce } from "./clinical-note-card-C7F_24IC.js";
6
- import { R as de } from "./rich-text-editor-RRkBN_WB.js";
6
+ import { R as de } from "./rich-text-editor-DHpV2q6d.js";
7
7
  import { T as pe } from "./text-area-Bt3p7Pt0.js";
8
8
  import { B as ue } from "./button-CPGiR_bH.js";
9
9
  import { C as me } from "./checkbox-BuZ1u__2.js";
@@ -321,4 +321,4 @@ const _e = ne(
321
321
  export {
322
322
  _e as N
323
323
  };
324
- //# sourceMappingURL=notes-panel-BLjlYBt-.js.map
324
+ //# sourceMappingURL=notes-panel-BKwd-bOV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notes-panel-BLjlYBt-.js","sources":["../../node_modules/lucide-react/dist/esm/icons/notebook-pen.mjs","../../src/components/notes-panel/notes-panel.agent.ts","../../src/components/notes-panel/notes-panel.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 [\"path\", { d: \"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4\", key: \"re6nr2\" }],\n [\"path\", { d: \"M2 6h4\", key: \"aawbzj\" }],\n [\"path\", { d: \"M2 10h4\", key: \"l0bgd4\" }],\n [\"path\", { d: \"M2 14h4\", key: \"1gsvsf\" }],\n [\"path\", { d: \"M2 18h4\", key: \"1bu2t1\" }],\n [\n \"path\",\n {\n d: \"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z\",\n key: \"pqwjuv\"\n }\n ]\n];\nconst NotebookPen = createLucideIcon(\"notebook-pen\", __iconNode);\n\nexport { __iconNode, NotebookPen as default };\n//# sourceMappingURL=notebook-pen.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — NotesPanel. */\n/* */\n/* The Notes tool: a composer over a note timeline. The agent reads the */\n/* timeline STRUCTURE (note ids + pinned / flagged / clinical flags — */\n/* never the note body or author, both PHI), composes and commits a new */\n/* note, and toggles a note's pinned / flagged state. `add_note` carries */\n/* the `phi` safety class: a note body is patient-identifiable clinical */\n/* content, so the host gates it behind the same confirm-before-act as a */\n/* destructive write and never auto-confirms. A clinical submission also */\n/* requires the host's `practice_add_clinical_note` permission (the */\n/* handle drops it when the gate is closed). */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NotesPanelHandle } from './notes-panel';\n\nexport const notesPanelAgent: AgentAdapter<NotesPanelHandle> = {\n id: 'notes-panel',\n // 'submit' backs add_note (compose + commit a note). pin / flag are toggles\n // with no dedicated capability in the closed vocabulary.\n capabilities: ['submit'],\n state: {\n notes: {\n type: 'Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>',\n descriptionKey: 'ui.agent.notesPanel.state.notes',\n description:\n 'Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).',\n read: (handle) => handle.getNotes(),\n },\n canAddClinical: {\n type: 'boolean',\n descriptionKey: 'ui.agent.notesPanel.state.canAddClinical',\n description:\n 'Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).',\n read: (handle) => handle.canAddClinical(),\n },\n },\n actions: {\n add_note: {\n // Writes a clinical/admin note body — patient-identifiable content. PHI.\n safety: 'phi',\n argsType: '{ content: string; clinical: boolean }',\n argsSchema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description:\n 'Note body. Rich HTML for the rich composer, else plain text.',\n },\n clinical: {\n type: 'boolean',\n description:\n 'Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed.',\n },\n },\n required: ['content', 'clinical'],\n },\n openWorld: true,\n descriptionKey: 'ui.agent.notesPanel.actions.addNote',\n description:\n 'Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).',\n examples: [\n {\n args: { content: 'Patient reported improvement.', clinical: true },\n note: 'Add a clinical note.',\n },\n ],\n invoke: (handle, args: { content: string; clinical: boolean }) => {\n handle.addNote(args);\n },\n },\n toggle_pin: {\n // Re-orders the timeline (pinned notes lead) — reversible view write.\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.togglePin',\n description: 'Toggle the pinned state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.togglePin(args.id);\n },\n },\n toggle_flag: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.toggleFlag',\n description: 'Toggle the flagged state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.toggleFlag(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'notes-panel',\n description: 'Marks the NotesPanel region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific notes panel from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { notesPanelAgent } from './notes-panel.agent';\nimport { ClinicalNoteCard } from '../clinical-note-card';\nimport type { ClinicalNoteCardProps } from '../clinical-note-card';\nimport { RichTextEditor } from '../rich-text-editor';\nimport type {\n RichTextEditorHandle,\n RichTextEditorProps,\n RichTextEditorToolbar,\n RedactorFactory,\n} from '../rich-text-editor';\nimport { TextArea } from '../text-area';\nimport { Button } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { NotebookPen } from 'lucide-react';\nimport { PanelHeader } from '../panel-header';\n\n/* ------------------------------------------------------------------ */\n/* NotesPanel — the Notes tool for the Control Room rail. */\n/* */\n/* A composer over an elevated ClinicalNoteCard timeline. Drops */\n/* into a ControlRoomRail tool `panel`, the patient profile, or the */\n/* care-plan editor — anywhere notes about the open entity belong. */\n/* The composer is the kit RichTextEditor by default (degrades to a */\n/* textarea where Redactor is absent), carries a permission-gated */\n/* \"clinical note\" toggle, and forwards the editor's AI affordances. */\n/* The note attaches to whatever entity the host is showing — the */\n/* host owns the attachment; the panel only emits content + clinical. */\n/* Pinned notes lead; pin / flag are inline per-note toggles. */\n/* ------------------------------------------------------------------ */\n\n/** One note in the panel — the data subset of `ClinicalNoteCard`. */\nexport type NotesPanelNote = Pick<\n ClinicalNoteCardProps,\n | 'id'\n | 'dateIso'\n | 'createdAtIso'\n | 'author'\n | 'clinical'\n | 'attachedTo'\n | 'content'\n | 'contentFormat'\n | 'pinned'\n | 'flagged'\n>;\n\n/**\n * Curated agent handle for NotesPanel. Reads the note timeline's STRUCTURE\n * (ids + pinned / flagged / clinical flags — never the note body or author,\n * both PHI) and drives the composer + per-note toggles. See\n * `notes-panel.agent.ts`.\n */\nexport interface NotesPanelHandle {\n /** Timeline snapshot — ids + flags only, never note content (PHI). */\n getNotes: () => Array<{\n id?: string;\n pinned: boolean;\n flagged: boolean;\n clinical: boolean;\n }>;\n /** Whether the composer is mounted (onAddNote is wired). */\n canAddNote: () => boolean;\n /** Whether clinical notes may be written (the permission gate). */\n canAddClinical: () => boolean;\n /** Commit a new note with explicit content (mirrors the composer's submit). */\n addNote: (submission: NotesPanelSubmission) => void;\n /** Toggle a note's pinned state (mirrors onTogglePin). */\n togglePin: (id: string) => void;\n /** Toggle a note's flagged state (mirrors onToggleFlag). */\n toggleFlag: (id: string) => void;\n}\n\n/** Payload handed to `onAddNote` when the composer commits. */\nexport interface NotesPanelSubmission {\n /** The note body — rich HTML (`composer='rich'`) or plain text. */\n content: string;\n /** Whether the \"clinical note\" toggle was set. */\n clinical: boolean;\n}\n\nexport interface NotesPanelProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific notes panel.\n */\n id?: string;\n /** Notes to render, newest-first by convention. Pinned notes lead. */\n notes: NotesPanelNote[];\n /** Commit a new note. Omit to hide the composer (read-only timeline). */\n onAddNote?: (submission: NotesPanelSubmission) => void;\n\n /* ----- Composer ----- */\n /**\n * `'rich'` (default) mounts the kit `RichTextEditor` (Redactor; degrades to a\n * textarea where Redactor is absent). `'plain'` keeps a simple `TextArea` for\n * lightweight surfaces / deterministic tests.\n */\n composer?: 'rich' | 'plain';\n /** Toolbar preset for the rich composer. Defaults to `'standard'`. */\n editorToolbar?: RichTextEditorToolbar;\n /** Inject the Redactor factory for the rich composer (else `window.$R`). */\n redactor?: RedactorFactory;\n /** Consumer image-upload endpoint for the rich composer. */\n imageUploadUrl?: string;\n\n /* ----- Clinical flag (permission-gated) ----- */\n /** Show the \"clinical note\" toggle in the composer. Default `true`. */\n showClinicalToggle?: boolean;\n /**\n * Permission gate — when `false` the clinical toggle is disabled and shows\n * `clinicalGatedReason` on hover/focus. Mirrors platform's\n * `practice_add_clinical_note` permission. Default `true`.\n */\n canAddClinicalNote?: boolean;\n /** Tooltip shown when the clinical toggle is gated off. */\n clinicalGatedReason?: string;\n /** Initial state of the clinical toggle. Default `false`. */\n defaultClinical?: boolean;\n\n /* ----- AI assistance (forwarded to RichTextEditor) ----- */\n onRequestAiDraft?: RichTextEditorProps['onRequestAiDraft'];\n aiDraftFormat?: RichTextEditorProps['aiDraftFormat'];\n aiPrivacyNotice?: RichTextEditorProps['aiPrivacyNotice'];\n onDictate?: RichTextEditorProps['onDictate'];\n onProofread?: RichTextEditorProps['onProofread'];\n onAutoFormat?: RichTextEditorProps['onAutoFormat'];\n\n /* ----- Per-note actions ----- */\n /** Toggle a note's pinned state — renders an inline pin button per note. */\n onTogglePin?: (id: string) => void;\n /** Toggle a note's flagged state — renders an inline flag button per note. */\n onToggleFlag?: (id: string) => void;\n\n /* ----- Labels / chrome ----- */\n /** Panel heading. Defaults to the localised \"Notes\". */\n title?: string;\n /** Composer placeholder. */\n composerPlaceholder?: string;\n /** Save-button label. */\n addNoteLabel?: string;\n /** Rendered when there are no notes. */\n emptyState?: ReactNode;\n /** Accessible name for the panel region (defaults to `title`). */\n 'aria-label'?: string;\n}\n\n/** Strip tags / entities to test whether a rich draft holds real content. */\nfunction hasRichContent(html: string): boolean {\n if (!html) return false;\n if (/<img\\b/i.test(html)) return true;\n return (\n html\n .replace(/<[^>]*>/g, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0\n );\n}\n\nexport const NotesPanel = forwardRef<HTMLElement, NotesPanelProps>(\n function NotesPanel(\n {\n id,\n notes,\n onAddNote,\n composer = 'rich',\n editorToolbar = 'standard',\n redactor,\n imageUploadUrl,\n showClinicalToggle = true,\n canAddClinicalNote = true,\n clinicalGatedReason,\n defaultClinical = false,\n onRequestAiDraft,\n aiDraftFormat,\n aiPrivacyNotice,\n onDictate,\n onProofread,\n onAutoFormat,\n onTogglePin,\n onToggleFlag,\n title,\n composerPlaceholder,\n addNoteLabel,\n emptyState,\n className,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation();\n const editorRef = useRef<RichTextEditorHandle>(null);\n const [draft, setDraft] = useState('');\n const [clinical, setClinical] = useState(defaultClinical);\n\n const heading = title ?? t('notesPanel.title', { defaultValue: 'Notes' });\n const headingId = useId();\n const placeholder =\n composerPlaceholder ??\n t('notesPanel.placeholder', { defaultValue: 'Add a note…' });\n const composerLabel = t('notesPanel.composerLabel', {\n defaultValue: 'New note',\n });\n\n // Live content check: plain reads the draft directly; rich strips the draft\n // (debounced) for the disabled state but commits from the editor handle.\n const hasContent =\n composer === 'rich' ? hasRichContent(draft) : draft.trim().length > 0;\n\n const commit = useCallback(() => {\n if (!onAddNote) return;\n if (composer === 'rich') {\n const html = editorRef.current?.getHTML() ?? draft;\n if (!hasRichContent(html)) return;\n onAddNote({ content: html, clinical });\n editorRef.current?.clear();\n } else {\n const text = draft.trim();\n if (!text) return;\n onAddNote({ content: text, clinical });\n }\n setDraft('');\n setClinical(defaultClinical);\n }, [composer, draft, clinical, defaultClinical, onAddNote]);\n\n // Pinned notes lead; order within each group is preserved.\n const ordered = [...notes].sort(\n (a, b) => Number(b.pinned ?? false) - Number(a.pinned ?? false),\n );\n\n /* ----- Agent handle (structural reads + composer / toggles) ----- */\n const notesRef = useRef(notes);\n notesRef.current = notes;\n const onAddNoteRef = useRef(onAddNote);\n onAddNoteRef.current = onAddNote;\n const onTogglePinRef = useRef(onTogglePin);\n onTogglePinRef.current = onTogglePin;\n const onToggleFlagRef = useRef(onToggleFlag);\n onToggleFlagRef.current = onToggleFlag;\n const canAddClinicalRef = useRef(canAddClinicalNote);\n canAddClinicalRef.current = canAddClinicalNote;\n\n const rootRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLElement, []);\n\n const handle = useMemo<NotesPanelHandle>(\n () => ({\n // Ids + flags only — never the note body or author (both PHI).\n getNotes: () =>\n notesRef.current.map((n) => ({\n id: n.id,\n pinned: !!n.pinned,\n flagged: !!n.flagged,\n clinical: !!n.clinical,\n })),\n canAddNote: () => !!onAddNoteRef.current,\n canAddClinical: () => canAddClinicalRef.current,\n addNote: (submission) => {\n // A clinical submission requires the permission gate to be open.\n if (submission.clinical && !canAddClinicalRef.current) return;\n onAddNoteRef.current?.(submission);\n },\n togglePin: (noteId) => onTogglePinRef.current?.(noteId),\n toggleFlag: (noteId) => onToggleFlagRef.current?.(noteId),\n }),\n [],\n );\n useAgentRegistration(notesPanelAgent, handle, id);\n\n return (\n <section\n ref={rootRef}\n data-component=\"notes-panel\"\n data-component-id={id}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel}\n className={['ds:flex ds:flex-col', className].filter(Boolean).join(' ')}\n {...rest}\n >\n {/* Shared rail header — pins to the top of the panel's scroll region\n while the composer + note timeline scroll beneath it. The rail\n injects the favourite / close actions via PanelHeaderActionsProvider. */}\n <PanelHeader\n title={heading}\n icon={<NotebookPen aria-hidden=\"true\" />}\n headingId={ariaLabel ? undefined : headingId}\n sticky\n divider\n />\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]\">\n {onAddNote ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {composer === 'rich' ? (\n <RichTextEditor\n ref={editorRef}\n ariaLabel={composerLabel}\n placeholder={placeholder}\n toolbar={editorToolbar}\n minHeight=\"sm\"\n redactor={redactor}\n imageUploadUrl={imageUploadUrl}\n onChange={({ html }) => setDraft(html)}\n onRequestAiDraft={onRequestAiDraft}\n aiDraftFormat={aiDraftFormat}\n aiPrivacyNotice={aiPrivacyNotice}\n onDictate={onDictate}\n onProofread={onProofread}\n onAutoFormat={onAutoFormat}\n />\n ) : (\n <TextArea\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n autoResize\n minRows={2}\n maxRows={6}\n aria-label={composerLabel}\n />\n )}\n <div\n className={[\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]',\n showClinicalToggle ? 'ds:justify-between' : 'ds:justify-end',\n ].join(' ')}\n >\n {showClinicalToggle ? (\n <Checkbox\n size=\"sm\"\n label={t('notesPanel.clinicalToggle', {\n defaultValue: 'Clinical note',\n })}\n checked={clinical}\n onCheckedChange={(next) => setClinical(next === true)}\n disabled={!canAddClinicalNote}\n disabledReason={\n canAddClinicalNote\n ? undefined\n : (clinicalGatedReason ??\n t('notesPanel.clinicalGated', {\n defaultValue:\n 'You do not have permission to write clinical notes.',\n }))\n }\n />\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={commit}\n disabled={!hasContent}\n >\n {addNoteLabel ??\n t('notesPanel.add', { defaultValue: 'Add note' })}\n </Button>\n </div>\n </div>\n ) : null}\n\n {ordered.length > 0 ? (\n <ul className=\"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0\">\n {ordered.map((note, index) => (\n <li key={note.id ?? index} className=\"ds:flex ds:flex-col\">\n {/* Elevated card per note; the list gap (not a separator)\n spaces them. Bodies clamp to five lines with read-more —\n the timeline is a read-only display surface. */}\n <ClinicalNoteCard\n surface=\"elevated\"\n truncate\n {...note}\n onTogglePin={\n onTogglePin && note.id\n ? () => onTogglePin(note.id as string)\n : undefined\n }\n onToggleFlag={\n onToggleFlag && note.id\n ? () => onToggleFlag(note.id as string)\n : undefined\n }\n />\n </li>\n ))}\n </ul>\n ) : (\n (emptyState ?? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('notesPanel.empty', { defaultValue: 'No notes yet.' })}\n </p>\n ))\n )}\n </div>\n </section>\n );\n },\n);\n"],"names":["__iconNode","NotebookPen","createLucideIcon","notesPanelAgent","handle","args","hasRichContent","html","NotesPanel","forwardRef","id","notes","onAddNote","composer","editorToolbar","redactor","imageUploadUrl","showClinicalToggle","canAddClinicalNote","clinicalGatedReason","defaultClinical","onRequestAiDraft","aiDraftFormat","aiPrivacyNotice","onDictate","onProofread","onAutoFormat","onTogglePin","onToggleFlag","title","composerPlaceholder","addNoteLabel","emptyState","className","ariaLabel","rest","ref","t","useTranslation","editorRef","useRef","draft","setDraft","useState","clinical","setClinical","heading","headingId","useId","placeholder","composerLabel","hasContent","commit","useCallback","_a","_b","text","ordered","a","b","notesRef","onAddNoteRef","onTogglePinRef","onToggleFlagRef","canAddClinicalRef","rootRef","useImperativeHandle","useMemo","n","submission","noteId","useAgentRegistration","jsxs","jsx","PanelHeader","RichTextEditor","TextArea","event","Checkbox","next","Button","note","index","ClinicalNoteCard"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,kEAAkE,KAAK,SAAQ,CAAE;AAAA,EAC/F,CAAC,QAAQ,EAAE,GAAG,UAAU,KAAK,SAAQ,CAAE;AAAA,EACvC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC;AA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gBAEN,cACErD,KAAgBqD,EAAK,KACjB,MAAMrD,EAAaqD,EAAK,EAAY,IACpC;AAAA,cAAA;AAAA,YAAA,KAhBDA,EAAK,MAAMC,CAmBpB,CACD,GACH,IAEClD,KACC,gBAAAyC,EAAC,KAAA,EAAE,WAAU,+DACV,UAAApC,EAAE,oBAAoB,EAAE,cAAc,gBAAA,CAAiB,EAAA,CAC1D;AAAA,UAAA,EAAA,CAGN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"notes-panel-BKwd-bOV.js","sources":["../../node_modules/lucide-react/dist/esm/icons/notebook-pen.mjs","../../src/components/notes-panel/notes-panel.agent.ts","../../src/components/notes-panel/notes-panel.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 [\"path\", { d: \"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4\", key: \"re6nr2\" }],\n [\"path\", { d: \"M2 6h4\", key: \"aawbzj\" }],\n [\"path\", { d: \"M2 10h4\", key: \"l0bgd4\" }],\n [\"path\", { d: \"M2 14h4\", key: \"1gsvsf\" }],\n [\"path\", { d: \"M2 18h4\", key: \"1bu2t1\" }],\n [\n \"path\",\n {\n d: \"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z\",\n key: \"pqwjuv\"\n }\n ]\n];\nconst NotebookPen = createLucideIcon(\"notebook-pen\", __iconNode);\n\nexport { __iconNode, NotebookPen as default };\n//# sourceMappingURL=notebook-pen.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — NotesPanel. */\n/* */\n/* The Notes tool: a composer over a note timeline. The agent reads the */\n/* timeline STRUCTURE (note ids + pinned / flagged / clinical flags — */\n/* never the note body or author, both PHI), composes and commits a new */\n/* note, and toggles a note's pinned / flagged state. `add_note` carries */\n/* the `phi` safety class: a note body is patient-identifiable clinical */\n/* content, so the host gates it behind the same confirm-before-act as a */\n/* destructive write and never auto-confirms. A clinical submission also */\n/* requires the host's `practice_add_clinical_note` permission (the */\n/* handle drops it when the gate is closed). */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NotesPanelHandle } from './notes-panel';\n\nexport const notesPanelAgent: AgentAdapter<NotesPanelHandle> = {\n id: 'notes-panel',\n // 'submit' backs add_note (compose + commit a note). pin / flag are toggles\n // with no dedicated capability in the closed vocabulary.\n capabilities: ['submit'],\n state: {\n notes: {\n type: 'Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>',\n descriptionKey: 'ui.agent.notesPanel.state.notes',\n description:\n 'Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).',\n read: (handle) => handle.getNotes(),\n },\n canAddClinical: {\n type: 'boolean',\n descriptionKey: 'ui.agent.notesPanel.state.canAddClinical',\n description:\n 'Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).',\n read: (handle) => handle.canAddClinical(),\n },\n },\n actions: {\n add_note: {\n // Writes a clinical/admin note body — patient-identifiable content. PHI.\n safety: 'phi',\n argsType: '{ content: string; clinical: boolean }',\n argsSchema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description:\n 'Note body. Rich HTML for the rich composer, else plain text.',\n },\n clinical: {\n type: 'boolean',\n description:\n 'Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed.',\n },\n },\n required: ['content', 'clinical'],\n },\n openWorld: true,\n descriptionKey: 'ui.agent.notesPanel.actions.addNote',\n description:\n 'Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).',\n examples: [\n {\n args: { content: 'Patient reported improvement.', clinical: true },\n note: 'Add a clinical note.',\n },\n ],\n invoke: (handle, args: { content: string; clinical: boolean }) => {\n handle.addNote(args);\n },\n },\n toggle_pin: {\n // Re-orders the timeline (pinned notes lead) — reversible view write.\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.togglePin',\n description: 'Toggle the pinned state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.togglePin(args.id);\n },\n },\n toggle_flag: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.toggleFlag',\n description: 'Toggle the flagged state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.toggleFlag(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'notes-panel',\n description: 'Marks the NotesPanel region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific notes panel from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { notesPanelAgent } from './notes-panel.agent';\nimport { ClinicalNoteCard } from '../clinical-note-card';\nimport type { ClinicalNoteCardProps } from '../clinical-note-card';\nimport { RichTextEditor } from '../rich-text-editor';\nimport type {\n RichTextEditorHandle,\n RichTextEditorProps,\n RichTextEditorToolbar,\n RedactorFactory,\n} from '../rich-text-editor';\nimport { TextArea } from '../text-area';\nimport { Button } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { NotebookPen } from 'lucide-react';\nimport { PanelHeader } from '../panel-header';\n\n/* ------------------------------------------------------------------ */\n/* NotesPanel — the Notes tool for the Control Room rail. */\n/* */\n/* A composer over an elevated ClinicalNoteCard timeline. Drops */\n/* into a ControlRoomRail tool `panel`, the patient profile, or the */\n/* care-plan editor — anywhere notes about the open entity belong. */\n/* The composer is the kit RichTextEditor by default (degrades to a */\n/* textarea where Redactor is absent), carries a permission-gated */\n/* \"clinical note\" toggle, and forwards the editor's AI affordances. */\n/* The note attaches to whatever entity the host is showing — the */\n/* host owns the attachment; the panel only emits content + clinical. */\n/* Pinned notes lead; pin / flag are inline per-note toggles. */\n/* ------------------------------------------------------------------ */\n\n/** One note in the panel — the data subset of `ClinicalNoteCard`. */\nexport type NotesPanelNote = Pick<\n ClinicalNoteCardProps,\n | 'id'\n | 'dateIso'\n | 'createdAtIso'\n | 'author'\n | 'clinical'\n | 'attachedTo'\n | 'content'\n | 'contentFormat'\n | 'pinned'\n | 'flagged'\n>;\n\n/**\n * Curated agent handle for NotesPanel. Reads the note timeline's STRUCTURE\n * (ids + pinned / flagged / clinical flags — never the note body or author,\n * both PHI) and drives the composer + per-note toggles. See\n * `notes-panel.agent.ts`.\n */\nexport interface NotesPanelHandle {\n /** Timeline snapshot — ids + flags only, never note content (PHI). */\n getNotes: () => Array<{\n id?: string;\n pinned: boolean;\n flagged: boolean;\n clinical: boolean;\n }>;\n /** Whether the composer is mounted (onAddNote is wired). */\n canAddNote: () => boolean;\n /** Whether clinical notes may be written (the permission gate). */\n canAddClinical: () => boolean;\n /** Commit a new note with explicit content (mirrors the composer's submit). */\n addNote: (submission: NotesPanelSubmission) => void;\n /** Toggle a note's pinned state (mirrors onTogglePin). */\n togglePin: (id: string) => void;\n /** Toggle a note's flagged state (mirrors onToggleFlag). */\n toggleFlag: (id: string) => void;\n}\n\n/** Payload handed to `onAddNote` when the composer commits. */\nexport interface NotesPanelSubmission {\n /** The note body — rich HTML (`composer='rich'`) or plain text. */\n content: string;\n /** Whether the \"clinical note\" toggle was set. */\n clinical: boolean;\n}\n\nexport interface NotesPanelProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific notes panel.\n */\n id?: string;\n /** Notes to render, newest-first by convention. Pinned notes lead. */\n notes: NotesPanelNote[];\n /** Commit a new note. Omit to hide the composer (read-only timeline). */\n onAddNote?: (submission: NotesPanelSubmission) => void;\n\n /* ----- Composer ----- */\n /**\n * `'rich'` (default) mounts the kit `RichTextEditor` (Redactor; degrades to a\n * textarea where Redactor is absent). `'plain'` keeps a simple `TextArea` for\n * lightweight surfaces / deterministic tests.\n */\n composer?: 'rich' | 'plain';\n /** Toolbar preset for the rich composer. Defaults to `'standard'`. */\n editorToolbar?: RichTextEditorToolbar;\n /** Inject the Redactor factory for the rich composer (else `window.$R`). */\n redactor?: RedactorFactory;\n /** Consumer image-upload endpoint for the rich composer. */\n imageUploadUrl?: string;\n\n /* ----- Clinical flag (permission-gated) ----- */\n /** Show the \"clinical note\" toggle in the composer. Default `true`. */\n showClinicalToggle?: boolean;\n /**\n * Permission gate — when `false` the clinical toggle is disabled and shows\n * `clinicalGatedReason` on hover/focus. Mirrors platform's\n * `practice_add_clinical_note` permission. Default `true`.\n */\n canAddClinicalNote?: boolean;\n /** Tooltip shown when the clinical toggle is gated off. */\n clinicalGatedReason?: string;\n /** Initial state of the clinical toggle. Default `false`. */\n defaultClinical?: boolean;\n\n /* ----- AI assistance (forwarded to RichTextEditor) ----- */\n onRequestAiDraft?: RichTextEditorProps['onRequestAiDraft'];\n aiDraftFormat?: RichTextEditorProps['aiDraftFormat'];\n aiPrivacyNotice?: RichTextEditorProps['aiPrivacyNotice'];\n onDictate?: RichTextEditorProps['onDictate'];\n onProofread?: RichTextEditorProps['onProofread'];\n onAutoFormat?: RichTextEditorProps['onAutoFormat'];\n\n /* ----- Per-note actions ----- */\n /** Toggle a note's pinned state — renders an inline pin button per note. */\n onTogglePin?: (id: string) => void;\n /** Toggle a note's flagged state — renders an inline flag button per note. */\n onToggleFlag?: (id: string) => void;\n\n /* ----- Labels / chrome ----- */\n /** Panel heading. Defaults to the localised \"Notes\". */\n title?: string;\n /** Composer placeholder. */\n composerPlaceholder?: string;\n /** Save-button label. */\n addNoteLabel?: string;\n /** Rendered when there are no notes. */\n emptyState?: ReactNode;\n /** Accessible name for the panel region (defaults to `title`). */\n 'aria-label'?: string;\n}\n\n/** Strip tags / entities to test whether a rich draft holds real content. */\nfunction hasRichContent(html: string): boolean {\n if (!html) return false;\n if (/<img\\b/i.test(html)) return true;\n return (\n html\n .replace(/<[^>]*>/g, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0\n );\n}\n\nexport const NotesPanel = forwardRef<HTMLElement, NotesPanelProps>(\n function NotesPanel(\n {\n id,\n notes,\n onAddNote,\n composer = 'rich',\n editorToolbar = 'standard',\n redactor,\n imageUploadUrl,\n showClinicalToggle = true,\n canAddClinicalNote = true,\n clinicalGatedReason,\n defaultClinical = false,\n onRequestAiDraft,\n aiDraftFormat,\n aiPrivacyNotice,\n onDictate,\n onProofread,\n onAutoFormat,\n onTogglePin,\n onToggleFlag,\n title,\n composerPlaceholder,\n addNoteLabel,\n emptyState,\n className,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation();\n const editorRef = useRef<RichTextEditorHandle>(null);\n const [draft, setDraft] = useState('');\n const [clinical, setClinical] = useState(defaultClinical);\n\n const heading = title ?? t('notesPanel.title', { defaultValue: 'Notes' });\n const headingId = useId();\n const placeholder =\n composerPlaceholder ??\n t('notesPanel.placeholder', { defaultValue: 'Add a note…' });\n const composerLabel = t('notesPanel.composerLabel', {\n defaultValue: 'New note',\n });\n\n // Live content check: plain reads the draft directly; rich strips the draft\n // (debounced) for the disabled state but commits from the editor handle.\n const hasContent =\n composer === 'rich' ? hasRichContent(draft) : draft.trim().length > 0;\n\n const commit = useCallback(() => {\n if (!onAddNote) return;\n if (composer === 'rich') {\n const html = editorRef.current?.getHTML() ?? draft;\n if (!hasRichContent(html)) return;\n onAddNote({ content: html, clinical });\n editorRef.current?.clear();\n } else {\n const text = draft.trim();\n if (!text) return;\n onAddNote({ content: text, clinical });\n }\n setDraft('');\n setClinical(defaultClinical);\n }, [composer, draft, clinical, defaultClinical, onAddNote]);\n\n // Pinned notes lead; order within each group is preserved.\n const ordered = [...notes].sort(\n (a, b) => Number(b.pinned ?? false) - Number(a.pinned ?? false),\n );\n\n /* ----- Agent handle (structural reads + composer / toggles) ----- */\n const notesRef = useRef(notes);\n notesRef.current = notes;\n const onAddNoteRef = useRef(onAddNote);\n onAddNoteRef.current = onAddNote;\n const onTogglePinRef = useRef(onTogglePin);\n onTogglePinRef.current = onTogglePin;\n const onToggleFlagRef = useRef(onToggleFlag);\n onToggleFlagRef.current = onToggleFlag;\n const canAddClinicalRef = useRef(canAddClinicalNote);\n canAddClinicalRef.current = canAddClinicalNote;\n\n const rootRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLElement, []);\n\n const handle = useMemo<NotesPanelHandle>(\n () => ({\n // Ids + flags only — never the note body or author (both PHI).\n getNotes: () =>\n notesRef.current.map((n) => ({\n id: n.id,\n pinned: !!n.pinned,\n flagged: !!n.flagged,\n clinical: !!n.clinical,\n })),\n canAddNote: () => !!onAddNoteRef.current,\n canAddClinical: () => canAddClinicalRef.current,\n addNote: (submission) => {\n // A clinical submission requires the permission gate to be open.\n if (submission.clinical && !canAddClinicalRef.current) return;\n onAddNoteRef.current?.(submission);\n },\n togglePin: (noteId) => onTogglePinRef.current?.(noteId),\n toggleFlag: (noteId) => onToggleFlagRef.current?.(noteId),\n }),\n [],\n );\n useAgentRegistration(notesPanelAgent, handle, id);\n\n return (\n <section\n ref={rootRef}\n data-component=\"notes-panel\"\n data-component-id={id}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel}\n className={['ds:flex ds:flex-col', className].filter(Boolean).join(' ')}\n {...rest}\n >\n {/* Shared rail header — pins to the top of the panel's scroll region\n while the composer + note timeline scroll beneath it. The rail\n injects the favourite / close actions via PanelHeaderActionsProvider. */}\n <PanelHeader\n title={heading}\n icon={<NotebookPen aria-hidden=\"true\" />}\n headingId={ariaLabel ? undefined : headingId}\n sticky\n divider\n />\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]\">\n {onAddNote ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {composer === 'rich' ? (\n <RichTextEditor\n ref={editorRef}\n ariaLabel={composerLabel}\n placeholder={placeholder}\n toolbar={editorToolbar}\n minHeight=\"sm\"\n redactor={redactor}\n imageUploadUrl={imageUploadUrl}\n onChange={({ html }) => setDraft(html)}\n onRequestAiDraft={onRequestAiDraft}\n aiDraftFormat={aiDraftFormat}\n aiPrivacyNotice={aiPrivacyNotice}\n onDictate={onDictate}\n onProofread={onProofread}\n onAutoFormat={onAutoFormat}\n />\n ) : (\n <TextArea\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n autoResize\n minRows={2}\n maxRows={6}\n aria-label={composerLabel}\n />\n )}\n <div\n className={[\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]',\n showClinicalToggle ? 'ds:justify-between' : 'ds:justify-end',\n ].join(' ')}\n >\n {showClinicalToggle ? (\n <Checkbox\n size=\"sm\"\n label={t('notesPanel.clinicalToggle', {\n defaultValue: 'Clinical note',\n })}\n checked={clinical}\n onCheckedChange={(next) => setClinical(next === true)}\n disabled={!canAddClinicalNote}\n disabledReason={\n canAddClinicalNote\n ? undefined\n : (clinicalGatedReason ??\n t('notesPanel.clinicalGated', {\n defaultValue:\n 'You do not have permission to write clinical notes.',\n }))\n }\n />\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={commit}\n disabled={!hasContent}\n >\n {addNoteLabel ??\n t('notesPanel.add', { defaultValue: 'Add note' })}\n </Button>\n </div>\n </div>\n ) : null}\n\n {ordered.length > 0 ? (\n <ul className=\"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0\">\n {ordered.map((note, index) => (\n <li key={note.id ?? index} className=\"ds:flex ds:flex-col\">\n {/* Elevated card per note; the list gap (not a separator)\n spaces them. Bodies clamp to five lines with read-more —\n the timeline is a read-only display surface. */}\n <ClinicalNoteCard\n surface=\"elevated\"\n truncate\n {...note}\n onTogglePin={\n onTogglePin && note.id\n ? () => onTogglePin(note.id as string)\n : undefined\n }\n onToggleFlag={\n onToggleFlag && note.id\n ? () => onToggleFlag(note.id as string)\n : undefined\n }\n />\n </li>\n ))}\n </ul>\n ) : (\n (emptyState ?? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('notesPanel.empty', { defaultValue: 'No notes yet.' })}\n </p>\n ))\n )}\n </div>\n </section>\n );\n },\n);\n"],"names":["__iconNode","NotebookPen","createLucideIcon","notesPanelAgent","handle","args","hasRichContent","html","NotesPanel","forwardRef","id","notes","onAddNote","composer","editorToolbar","redactor","imageUploadUrl","showClinicalToggle","canAddClinicalNote","clinicalGatedReason","defaultClinical","onRequestAiDraft","aiDraftFormat","aiPrivacyNotice","onDictate","onProofread","onAutoFormat","onTogglePin","onToggleFlag","title","composerPlaceholder","addNoteLabel","emptyState","className","ariaLabel","rest","ref","t","useTranslation","editorRef","useRef","draft","setDraft","useState","clinical","setClinical","heading","headingId","useId","placeholder","composerLabel","hasContent","commit","useCallback","_a","_b","text","ordered","a","b","notesRef","onAddNoteRef","onTogglePinRef","onToggleFlagRef","canAddClinicalRef","rootRef","useImperativeHandle","useMemo","n","submission","noteId","useAgentRegistration","jsxs","jsx","PanelHeader","RichTextEditor","TextArea","event","Checkbox","next","Button","note","index","ClinicalNoteCard"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,kEAAkE,KAAK,SAAQ,CAAE;AAA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X,UAAAhB,EAAQ,IAAI,CAACwB,GAAMC,MAClB,gBAAAT,EAAC,MAAA,EAA0B,WAAU,uBAInC,UAAA,gBAAAA;AAAA,cAACU;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,UAAQ;AAAA,gBACP,GAAGF;AAAA,gBACJ,aACEtD,KAAesD,EAAK,KAChB,MAAMtD,EAAYsD,EAAK,EAAY,IACnC;AAAA,gBAEN,cACErD,KAAgBqD,EAAK,KACjB,MAAMrD,EAAaqD,EAAK,EAAY,IACpC;AAAA,cAAA;AAAA,YAAA,KAhBDA,EAAK,MAAMC,CAmBpB,CACD,GACH,IAEClD,KACC,gBAAAyC,EAAC,KAAA,EAAE,WAAU,+DACV,UAAApC,EAAE,oBAAoB,EAAE,cAAc,gBAAA,CAAiB,EAAA,CAC1D;AAAA,UAAA,EAAA,CAGN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;","x_google_ignoreList":[0]}
@@ -406,11 +406,13 @@ const aa = {
406
406
  // children already `col-span-3`; doubling the parent to six tracks
407
407
  // (`repeat(2, …)`) lets grid auto-flow place two fields per row while
408
408
  // each column keeps its own subgrid label/value alignment.
409
+ // 672px, not the `@2xl` rem alias: container-query `rem` follows the
410
+ // host root font-size, so a non-16px root moves the threshold.
409
411
  /* @__PURE__ */ e("div", { className: "ds:@container/pfields", children: /* @__PURE__ */ e(
410
412
  Fe,
411
413
  {
412
414
  rowGap: "sm",
413
- className: "ds:@2xl/pfields:grid-cols-[repeat(2,auto_auto_minmax(0,1fr))]",
415
+ className: "ds:@[672px]/pfields:grid-cols-[repeat(2,auto_auto_minmax(0,1fr))]",
414
416
  children: W.map((a) => /* @__PURE__ */ e(
415
417
  Le,
416
418
  {
@@ -449,4 +451,4 @@ export {
449
451
  sa as P,
450
452
  Xe as p
451
453
  };
452
- //# sourceMappingURL=patient-summary-card-vn1H4xWj.js.map
454
+ //# sourceMappingURL=patient-summary-card-C-iVDo53.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patient-summary-card-vn1H4xWj.js","sources":["../../node_modules/lucide-react/dist/esm/icons/file-exclamation-point.mjs","../../node_modules/lucide-react/dist/esm/icons/message-square-warning.mjs","../../src/components/patient-summary-card/patient-summary-card.agent.ts","../../src/components/patient-summary-card/patient-summary-card.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 [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst FileExclamationPoint = createLucideIcon(\"file-exclamation-point\", __iconNode);\n\nexport { __iconNode, FileExclamationPoint as default };\n//# sourceMappingURL=file-exclamation-point.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 [\n \"path\",\n {\n d: \"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\",\n key: \"18887p\"\n }\n ],\n [\"path\", { d: \"M12 15h.01\", key: \"q59x07\" }],\n [\"path\", { d: \"M12 7v4\", key: \"xawao1\" }]\n];\nconst MessageSquareWarning = createLucideIcon(\"message-square-warning\", __iconNode);\n\nexport { __iconNode, MessageSquareWarning as default };\n//# sourceMappingURL=message-square-warning.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { PatientSummaryCardHandle } from './patient-summary-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — PatientSummaryCard */\n/* */\n/* Read-only adapter. Surfaces a STRUCTURAL snapshot of the patient */\n/* overview — counts, flags, and the consumer id only. Never the patient */\n/* name, age, contact details, or any clinical content, so an agent / */\n/* MCP runtime can answer \"does this patient have unpaid balances / */\n/* unsigned documents / AI consent?\" without re-parsing the DOM and */\n/* without leaking PHI (PRS §Security). */\n/* -------------------------------------------------------------------- */\n\nexport const patientSummaryCardAgent: AgentAdapter<PatientSummaryCardHandle> = {\n id: 'patient-summary-card',\n // The agent surface is a structural snapshot only — the single handle method\n // is a getSummary projection. The card MAY be human-customized (the optional\n // per-context \"Customize fields\" cog), but that field reordering is a UI\n // concern and is deliberately NOT exposed as an agent action; programmatic\n // field-set control lives on PatientDetails' adapter (set_field_order).\n capabilities: [],\n state: {\n summary: {\n type: '{ id?: string; hasUnpaid: boolean; unsignedDocumentsCount: number; highlightedAnamnesisCount: number; aiConsentGranted: boolean }',\n descriptionKey: 'ui.agent.patientSummaryCard.state.summary',\n description:\n 'Structural summary of the patient card — identifiers, counts, and consent flags only. Never patient identity or clinical content.',\n read: (handle) => handle.getSummary(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'patient-summary-card',\n description: 'Marks the PatientSummaryCard 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 CalendarDays,\n FileExclamationPoint,\n Mail,\n MapPin,\n MessageSquareWarning,\n Phone,\n ShieldCheck,\n Astroid,\n Users,\n type LucideIcon,\n} from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\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 { Skeleton } from '../skeleton/skeleton';\nimport { Tag } from '../tag/tag';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { isSafeEntityUrl } from '../_shared/is-safe-url';\nimport {\n resolveVisibleFields,\n type PatientField,\n type PatientFieldSection,\n} from '../_shared/patient-fields';\nimport { usePatientFieldVisibility } from '../_shared/field-visibility';\nimport { FieldVisibilityCog } from '../_shared/field-visibility-cog';\nimport {\n AgeChip,\n FieldValue,\n NeutralChip,\n SexChip,\n} from '../_shared/field-value';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { patientSummaryCardAgent } from './patient-summary-card.agent';\n\n/** A section list reference that stays stable across renders (legacy mode). */\nconst NO_SECTIONS: PatientFieldSection[] = [];\n\n/* -------------------------------------------------------------------- */\n/* PatientSummaryCard */\n/* */\n/* The patient-overview profile card every AlfaDocs in-app surface */\n/* composes by hand today (platform patient header, alfascribe patient */\n/* sidebar, check-in landing). Templated on ContactProfileCard: composes */\n/* Card + Avatar + KeyValueList + KeyValuePair + Badge + Tag + */\n/* TransactionChip + Link so the contact rows share a column and every */\n/* row uses the same lucide icon family. */\n/* */\n/* The kit owns the ORDER, ICONS, and LABELS — consumers pass data. No */\n/* free-text clinical content (anamnesis notes, diagnoses) ever lives */\n/* here: only counts/flags/relations are surfaced, so the card stays */\n/* PHI-light and the agent state can be derived without leaking patient */\n/* identity. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `patientSummaryCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n // Matches the kit's other `surface` props (ContactProfileCard,\n // OperatorHero). `'elevated'` wraps the content in `<Card>`.\n surface: {\n flat: '',\n elevated: '',\n },\n // Density tunes the avatar size + body padding. `comfortable` reads\n // as a page header; `compact` fits an embedded sidebar / aside.\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n surface: 'elevated',\n density: 'comfortable',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/** Patient phone number — already formatted for display by the consumer. */\nexport interface PatientSummaryCardPhone {\n /** Display string, e.g. `\"+39 055 123 4567\"`. Compiled into a `tel:` link. */\n prefixAndNumber: string;\n /** Optional label that distinguishes this number (e.g. \"Mobile\"). */\n label?: string;\n /** Whether SMS is enabled for this number — shows a small \"SMS\" chip. */\n smsEnabled?: boolean;\n}\n\n/** A family relation row — links one patient to another. */\nexport interface PatientSummaryCardFamilyRelation {\n /** Localised relation label, consumer-supplied (e.g. \"Mother\", \"Child\"). */\n relation: string;\n /** The related patient — name + optional in-app profile URL. */\n relatedPatient: {\n name: string;\n url?: string;\n };\n}\n\n/** Operator the patient is assigned to. */\nexport interface PatientSummaryCardAssignee {\n name: string;\n avatarUrl?: string;\n}\n\n/** AI-consent grant metadata — structural only, never the consented content. */\nexport interface PatientSummaryCardAiConsent {\n /** ISO-8601 / display string of when consent was granted. */\n grantedAt: string;\n /** Optional name of who recorded the grant. */\n grantedBy?: string;\n}\n\n/** Status flags rendered as glyph badges (counts / amounts only — no PHI). */\nexport interface PatientSummaryCardFlags {\n /** Number of anamnesis answers highlighted for clinical attention. */\n highlightedAnamnesisCount?: number;\n /** Outstanding balance in the smallest currency unit (cents). */\n unpaidAmountCents?: number;\n /** Number of documents awaiting the patient's signature. */\n unsignedDocumentsCount?: number;\n}\n\n/** Marketing-consent tri-state. */\nexport type PatientSummaryCardMarketingConsent = 'no' | 'yes' | 'not_specified';\n\nexport interface PatientSummaryCardHandle {\n /** Structural snapshot — identifiers and counts only, never patient identity. */\n getSummary: () => {\n id?: string;\n hasUnpaid: boolean;\n unsignedDocumentsCount: number;\n highlightedAnamnesisCount: number;\n aiConsentGranted: boolean;\n };\n}\n\nexport interface PatientSummaryCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children'\n> {\n /** Patient display name. Rendered as the heading. */\n name: string;\n /** Honorific — `'mr'` / `'ms'`. Prepended to the name in the heading. */\n title?: 'mr' | 'ms';\n /** Patient age in whole years — rendered in the identity line. */\n ageYears?: number;\n /** Date of birth — already formatted for display by the consumer. */\n dateOfBirth?: string;\n /** Biological sex marker — `'m'` / `'f'`. Drives the identity-line glyph copy. */\n gender?: 'm' | 'f';\n /** Optional avatar / photo URL. Falls back to initials. */\n avatarUrl?: string;\n /**\n * In-app patient profile URL. When safe, the heading becomes a link.\n * Guarded by the shared `isSafeEntityUrl` allow-list — unsafe URLs are\n * dropped and the heading renders as plain text.\n */\n patientUrl?: string;\n\n /* ----- Shared field model (preferred) ----- */\n\n /**\n * Patient fields in the shared model — the SAME `sections` shape\n * `PatientDetails` consumes (`@alfadocs/ui-kit` `PatientFieldSection`).\n * When provided, the card renders these (honouring `visibleFieldOrder`)\n * instead of the legacy contact props, so a consumer defines its patient-\n * field registry once and reuses it across every patient surface.\n *\n * The card renders each field's `label`, `value`, and `icon` only — it is\n * flat (section headings are not shown in the body) and never inline-edits;\n * `sensitive` / `copyable` / `mono` / `editable` are honoured by\n * `PatientDetails`, not the card (so the PHI lock glyph does not appear here).\n *\n * Pass `onVisibleFieldsChange` alongside `sections` to make THIS placement\n * self-curating (a \"Customize fields\" cog appears — show/hide + drag-and-drop\n * reorder).\n */\n sections?: PatientFieldSection[];\n /**\n * Ordered visible field ids for THIS placement. The order is a\n * per-INSTANCE, per-CONTEXT preference the kit never persists — wire it to\n * whatever scope the consumer wants (e.g. a global per-user setting, or a\n * different config in the care-plan view vs the patient folder). The same\n * field vocabulary can therefore display differently in different parts of\n * the app. Omit (`undefined`) ⇒ show every field; an explicit empty array\n * `[]` ⇒ show none (a card that starts collapsed to name + identity chips and\n * reveals fields via the cog). Also applied to the legacy contact rows (ids\n * `email` / `phone` / `cityProvince` / `marketingConsent` / `aiConsent` /\n * `assignedTo`).\n */\n visibleFieldOrder?: string[];\n /**\n * Make this card's field set user-customizable. When provided alongside\n * `sections`, a \"Customize fields\" cog renders in the header (show/hide +\n * drag-and-drop / Alt+Arrow reorder), and this fires with the next ordered\n * visible set. The consumer owns persistence + its scope — editing here\n * writes only THIS context's preference, never a shared/global one.\n */\n onVisibleFieldsChange?: (orderedIds: string[]) => void;\n\n /* ----- Contact rows (legacy — prefer `sections`) ----- */\n\n /** @deprecated Pass via `sections`. Patient email — `mailto:` link when `emailEnabled`. */\n email?: string;\n /** Whether email contact is enabled — gates the `mailto:` link. */\n emailEnabled?: boolean;\n /** Phone number block. Compiled into a `tel:` link. */\n phone?: PatientSummaryCardPhone;\n /** City / province display string. */\n cityProvince?: string;\n\n /* ----- Consent ----- */\n\n /** Marketing-consent tri-state. */\n marketingConsent?: PatientSummaryCardMarketingConsent;\n /** AI-consent grant metadata. When present, an \"AI consent\" row renders. */\n aiConsent?: PatientSummaryCardAiConsent;\n\n /* ----- Status flags ----- */\n\n /** Counts / amounts surfaced as glyph badges. */\n flags?: PatientSummaryCardFlags;\n\n /* ----- Relations & assignment ----- */\n\n /** Family relations — rendered as `<Tag>` chips, optionally linked. */\n familyRelations?: PatientSummaryCardFamilyRelation[];\n /** Operator the patient is assigned to. */\n assignedTo?: PatientSummaryCardAssignee;\n\n /* ----- Formatting ----- */\n\n /** ISO-4217 currency code for the unpaid-amount chip. Defaults to `EUR`. */\n currency?: string;\n /** BCP-47 locale override. Defaults to the active i18next language. */\n locale?: string;\n\n /* ----- States ----- */\n\n /** Render the skeleton loading placeholder. */\n loading?: boolean;\n\n /* ----- Slots & callbacks ----- */\n\n /** Rendered at the inline-end of the heading row (e.g. an action menu). */\n actionSlot?: ReactNode;\n /** Fires when the whole card / heading is activated. */\n onActivate?: () => void;\n\n /* ----- Styling ----- */\n\n /** `'elevated'` (default) wraps in `<Card>`; `'flat'` drops the chrome. */\n surface?: 'flat' | 'elevated';\n /** `'comfortable'` (default) reads as a header; `'compact'` for asides. */\n density?: 'comfortable' | 'compact';\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/* -------------------------------------------------------------------- */\n/* Flag glyphs — the closed set of status indicators */\n/* -------------------------------------------------------------------- */\n\n/** The closed set of status-flag keys (icon + tonal variant defined below). */\ntype FlagKey = 'highlightedAnamnesis' | 'unsignedDocuments';\n\nconst FLAG_ICON: Record<FlagKey, LucideIcon> = {\n highlightedAnamnesis: MessageSquareWarning,\n unsignedDocuments: FileExclamationPoint,\n};\n\nconst FLAG_VARIANT: Record<FlagKey, 'warning' | 'error'> = {\n highlightedAnamnesis: 'warning',\n unsignedDocuments: 'error',\n};\n\n/** English fallbacks for the flag badge accessible names (count-interpolated). */\nconst FLAG_LABEL_DEFAULTS: Record<FlagKey, string> = {\n highlightedAnamnesis: '{{count}} highlighted anamnesis answers',\n unsignedDocuments: '{{count}} unsigned documents',\n};\n\n/** English fallbacks for the marketing-consent tri-state chip. */\nconst MARKETING_CONSENT_DEFAULTS: Record<\n PatientSummaryCardMarketingConsent,\n string\n> = {\n yes: 'Yes',\n no: 'No',\n not_specified: 'Not specified',\n};\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PatientSummaryCard = forwardRef<\n HTMLDivElement,\n PatientSummaryCardProps\n>(\n (\n {\n name,\n title,\n ageYears,\n dateOfBirth,\n gender,\n avatarUrl,\n patientUrl,\n sections,\n visibleFieldOrder,\n onVisibleFieldsChange,\n email,\n emailEnabled = false,\n phone,\n cityProvince,\n marketingConsent,\n aiConsent,\n flags,\n familyRelations,\n assignedTo,\n currency = 'EUR',\n locale,\n loading = false,\n actionSlot,\n onActivate,\n surface = 'elevated',\n density = 'comfortable',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const unpaidAmountCents = flags?.unpaidAmountCents;\n const unsignedDocumentsCount = flags?.unsignedDocumentsCount ?? 0;\n const highlightedAnamnesisCount = flags?.highlightedAnamnesisCount ?? 0;\n const hasUnpaid = unpaidAmountCents != null && unpaidAmountCents > 0;\n\n // Imperative handle — structural snapshot only (counts/flags/ids),\n // never the patient name or any clinical content.\n const handle = useMemo<PatientSummaryCardHandle>(\n () => ({\n getSummary: () => ({\n id,\n hasUnpaid,\n unsignedDocumentsCount,\n highlightedAnamnesisCount,\n aiConsentGranted: aiConsent != null,\n }),\n }),\n [\n id,\n hasUnpaid,\n unsignedDocumentsCount,\n highlightedAnamnesisCount,\n aiConsent,\n ],\n );\n useAgentRegistration(patientSummaryCardAgent, handle, id);\n\n // Per-context field visibility. The cog (and live reordering) only engages\n // with the shared `sections` model AND an `onVisibleFieldsChange` handler;\n // legacy contact-prop cards stay read-only. The order is this placement's\n // own preference — never shared across surfaces.\n const customizable = !!sections && !!onVisibleFieldsChange;\n const fieldVisibility = usePatientFieldVisibility(sections ?? NO_SECTIONS, {\n value: visibleFieldOrder,\n onChange: onVisibleFieldsChange,\n });\n\n const resolvedAriaLabel =\n ariaLabel ??\n t('patientSummaryCard.regionLabel', { defaultValue: 'Patient overview' });\n\n // Heading text: optional honorific prefix + name.\n const TITLE_DEFAULTS: Record<'mr' | 'ms', string> = {\n mr: 'Mr.',\n ms: 'Ms.',\n };\n const honorific = title\n ? t(`patientSummaryCard.title.${title}`, {\n defaultValue: TITLE_DEFAULTS[title],\n })\n : undefined;\n const headingText = honorific ? `${honorific} ${name}` : name;\n\n // Identity line: the canonical sex / age / dob chips below the name — the\n // SAME chips the field model renders, so the header and the field rows\n // agree. Each chip is added only when its prop is present. (`dateOfBirth`\n // is a consumer-preformatted display string, so it goes through NeutralChip\n // directly rather than the date-parsing `dob` kind.)\n const identityChips: ReactNode[] = [];\n if (gender) {\n identityChips.push(<SexChip key=\"sex\" code={gender} />);\n }\n if (ageYears != null) {\n identityChips.push(<AgeChip key=\"age\" years={ageYears} />);\n }\n if (dateOfBirth) {\n identityChips.push(\n <NeutralChip key=\"dob\" icon={<CalendarDays />}>\n {dateOfBirth}\n </NeutralChip>,\n );\n }\n\n const isUrlSafe = !!patientUrl && isSafeEntityUrl(patientUrl);\n\n const avatarSize = density === 'comfortable' ? 'xl' : 'lg';\n const headingClass =\n density === 'comfortable' ? 'type-title-card' : 'type-title-item';\n const bodyGapClass =\n density === 'comfortable'\n ? 'ds:gap-[var(--spacing-md)]'\n : 'ds:gap-[var(--spacing-sm)]';\n\n /* ---------------------------------------------------------------- */\n /* Contact rows */\n /* ---------------------------------------------------------------- */\n\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n }> = [];\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.email', { defaultValue: 'Email' }),\n value: emailEnabled ? (\n <Link href={`mailto:${email}`} intent=\"default\" onClick={onActivate}>\n {email}\n </Link>\n ) : (\n <span className=\"ds:text-[color:var(--muted-foreground)]\">\n {email}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label:\n phone.label ??\n t('patientSummaryCard.label.phone', { defaultValue: 'Phone' }),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]\">\n <Link\n href={`tel:${normalisePhone(phone.prefixAndNumber)}`}\n intent=\"default\"\n >\n {phone.prefixAndNumber}\n </Link>\n {phone.smsEnabled ? (\n <Badge variant=\"success\" size=\"sm\">\n {t('patientSummaryCard.value.smsEnabled', {\n defaultValue: 'SMS',\n })}\n </Badge>\n ) : null}\n </span>\n ),\n });\n }\n\n if (cityProvince) {\n rows.push({\n key: 'cityProvince',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.cityProvince', {\n defaultValue: 'City / province',\n }),\n value: cityProvince,\n });\n }\n\n if (marketingConsent) {\n rows.push({\n key: 'marketingConsent',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.marketingConsent', {\n defaultValue: 'Marketing consent',\n }),\n value: (\n <Badge\n variant={\n marketingConsent === 'yes'\n ? 'success'\n : marketingConsent === 'no'\n ? 'error'\n : 'neutral'\n }\n size=\"sm\"\n withDot\n >\n {t(`patientSummaryCard.marketingConsent.${marketingConsent}`, {\n defaultValue: MARKETING_CONSENT_DEFAULTS[marketingConsent],\n })}\n </Badge>\n ),\n });\n }\n\n if (aiConsent) {\n rows.push({\n key: 'aiConsent',\n icon: <Astroid aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.aiConsent', {\n defaultValue: 'AI consent',\n }),\n value: aiConsent.grantedBy\n ? t('patientSummaryCard.value.aiConsentGrantedBy', {\n date: aiConsent.grantedAt,\n by: aiConsent.grantedBy,\n defaultValue: 'Granted {{date}} by {{by}}',\n })\n : t('patientSummaryCard.value.aiConsentGrantedAt', {\n date: aiConsent.grantedAt,\n defaultValue: 'Granted {{date}}',\n }),\n });\n }\n\n if (assignedTo) {\n rows.push({\n key: 'assignedTo',\n icon: <Users aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.assignedTo', {\n defaultValue: 'Assigned to',\n }),\n value: (\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <Avatar\n size=\"xs\"\n name={assignedTo.name}\n src={assignedTo.avatarUrl}\n />\n <span>{assignedTo.name}</span>\n </span>\n ),\n });\n }\n\n /* ---------------------------------------------------------------- */\n /* Attention-flag chips (VERBOSE — shown in the identity line) */\n /* */\n /* The unpaid balance + warning counts sit in the chip row under the */\n /* name, BEFORE the sex / age chips, each as a self-describing chip */\n /* (\"2 unsigned documents\") rather than a collapsed count badge in a */\n /* separate strip — the attention signals lead the patient's chips. */\n /* ---------------------------------------------------------------- */\n\n const flagBadges: Array<{ key: FlagKey; count: number }> = [];\n if (highlightedAnamnesisCount > 0) {\n flagBadges.push({\n key: 'highlightedAnamnesis',\n count: highlightedAnamnesisCount,\n });\n }\n if (unsignedDocumentsCount > 0) {\n flagBadges.push({\n key: 'unsignedDocuments',\n count: unsignedDocumentsCount,\n });\n }\n\n const attentionChips: ReactNode[] = [];\n if (hasUnpaid) {\n attentionChips.push(\n <TransactionChip\n key=\"unpaid\"\n state=\"debt\"\n amount={(unpaidAmountCents as number) / 100}\n currency={currency}\n locale={activeLocale}\n size=\"md\"\n showLabel\n />,\n );\n }\n flagBadges.forEach(({ key, count }) => {\n const FlagIcon = FLAG_ICON[key];\n // The Badge's visible text IS the count-interpolated label, so it's its\n // own accessible name — the leading glyph is decorative (aria-hidden).\n attentionChips.push(\n <Badge\n key={key}\n variant={FLAG_VARIANT[key]}\n size=\"md\"\n leading={<FlagIcon aria-hidden=\"true\" />}\n >\n {t(`patientSummaryCard.flag.${key}`, {\n count,\n defaultValue: FLAG_LABEL_DEFAULTS[key],\n })}\n </Badge>,\n );\n });\n\n /* ---------------------------------------------------------------- */\n /* Loading skeleton */\n /* ---------------------------------------------------------------- */\n\n const skeletonBody = (\n <div className={`ds:flex ds:flex-col ${bodyGapClass}`}>\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-md)]\">\n <Skeleton variant=\"circular\" size=\"lg\" />\n <div className=\"ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton variant=\"text\" width=\"60%\" />\n <Skeleton variant=\"text\" width=\"40%\" />\n </div>\n </div>\n <Skeleton variant=\"text\" lines={3} />\n </div>\n );\n\n /* ---------------------------------------------------------------- */\n /* Header */\n /* ---------------------------------------------------------------- */\n\n const heading = isUrlSafe ? (\n <Link\n href={patientUrl as string}\n intent=\"default\"\n weight=\"strong\"\n onClick={onActivate}\n className={`${headingClass} ds:no-underline`}\n >\n <span id={headingId}>{headingText}</span>\n </Link>\n ) : (\n <span\n id={headingId}\n className={`${headingClass} ds:text-[color:var(--foreground)]`}\n >\n {headingText}\n </span>\n );\n\n const header = (\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)]\">\n <Avatar\n size={avatarSize}\n name={name}\n src={avatarUrl}\n className=\"ds:shrink-0\"\n />\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n {heading}\n {attentionChips.length > 0 || identityChips.length > 0 ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {/* Attention flags lead, then the sex / age / dob identity chips. */}\n {attentionChips}\n {identityChips}\n </div>\n ) : null}\n </div>\n {customizable || actionSlot ? (\n <div className=\"ds:ms-auto ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-xs)]\">\n {customizable && sections ? (\n <FieldVisibilityCog\n sections={sections}\n visible={fieldVisibility.visible}\n onToggleField={fieldVisibility.toggleField}\n onToggleSection={fieldVisibility.toggleSection}\n onMoveFieldOnto={fieldVisibility.moveFieldOnto}\n onReset={fieldVisibility.reset}\n />\n ) : null}\n {actionSlot}\n </div>\n ) : null}\n </div>\n );\n\n /* ---------------------------------------------------------------- */\n /* Family relations */\n /* ---------------------------------------------------------------- */\n\n const familyBlock =\n familyRelations && familyRelations.length > 0 ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-[color:var(--muted-foreground)]\">\n {t('patientSummaryCard.label.familyRelations', {\n defaultValue: 'Family relations',\n })}\n </span>\n <div className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {familyRelations.map((rel, index) => {\n const safeUrl =\n !!rel.relatedPatient.url &&\n isSafeEntityUrl(rel.relatedPatient.url);\n const tagLabel = t('patientSummaryCard.value.familyRelation', {\n relation: rel.relation,\n name: rel.relatedPatient.name,\n defaultValue: '{{relation}}: {{name}}',\n });\n return safeUrl ? (\n <Link\n key={`${rel.relation}-${index}`}\n href={rel.relatedPatient.url as string}\n intent=\"default\"\n className=\"ds:no-underline\"\n >\n <Tag label={tagLabel} variant=\"neutral\" />\n </Link>\n ) : (\n <Tag\n key={`${rel.relation}-${index}`}\n label={tagLabel}\n variant=\"neutral\"\n />\n );\n })}\n </div>\n </div>\n ) : null;\n\n /* ---------------------------------------------------------------- */\n /* Body */\n /* ---------------------------------------------------------------- */\n\n // Field rows resolve through the SHARED model: when the consumer passes\n // `sections` (preferred), render those; otherwise wrap the legacy contact\n // rows as a single section. Either way `resolveVisibleFields` applies the\n // shared `visibleFieldOrder` preference, so the card and PatientDetails\n // always show the same fields, honouring the same per-user choice.\n const legacyFields: PatientField[] = rows.map((row) => ({\n id: row.key,\n label: row.label,\n value: row.value,\n icon: row.icon,\n }));\n const effectiveSections: PatientFieldSection[] = sections ?? [\n { id: 'contact', heading: '', fields: legacyFields },\n ];\n // With the shared `sections` model the order comes from the visibility hook\n // (so a cog reorder reflects live); legacy contact rows honour the raw\n // `visibleFieldOrder` prop.\n const order = sections ? fieldVisibility.visible : visibleFieldOrder;\n const visibleFields = resolveVisibleFields(\n effectiveSections,\n order,\n ).flatMap((resolved) => resolved.fields);\n\n const body = (\n <div className={`ds:flex ds:flex-col ${bodyGapClass}`}>\n {header}\n {visibleFields.length > 0 ? (\n // Container-queried so the fields flow into two columns when the\n // card is wide enough (the banner spans the full folder width), and\n // stay single-column in a narrow rail. The list's KeyValuePair\n // children already `col-span-3`; doubling the parent to six tracks\n // (`repeat(2, …)`) lets grid auto-flow place two fields per row while\n // each column keeps its own subgrid label/value alignment.\n <div className=\"ds:@container/pfields\">\n <KeyValueList\n rowGap=\"sm\"\n className=\"ds:@2xl/pfields:grid-cols-[repeat(2,auto_auto_minmax(0,1fr))]\"\n >\n {visibleFields.map((field) => (\n <KeyValuePair\n key={field.id}\n icon={field.icon ?? undefined}\n label={field.label}\n value={<FieldValue field={field} />}\n />\n ))}\n </KeyValueList>\n </div>\n ) : null}\n {familyBlock}\n </div>\n );\n\n const inner = loading ? skeletonBody : body;\n\n return (\n <div\n ref={ref}\n role=\"region\"\n // When the heading is rendered, the patient name (via\n // aria-labelledby) is the region's accessible name — the more\n // meaningful label than a generic \"Patient overview\". A consumer\n // aria-label still wins; the generic fallback only applies when\n // there is no heading to point at (loading state).\n aria-label={loading || ariaLabel ? resolvedAriaLabel : undefined}\n aria-labelledby={loading || ariaLabel ? undefined : headingId}\n aria-busy={loading || undefined}\n data-component=\"patient-summary-card\"\n data-component-id={id}\n data-density={density}\n id={id}\n className={rootVariants({ surface, density, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body>{inner}</Card.Body>\n </Card>\n ) : (\n inner\n )}\n </div>\n );\n },\n);\n\nPatientSummaryCard.displayName = 'PatientSummaryCard';\n\n/** Variant unions re-exported for downstream typing. */\nexport type PatientSummaryCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\nexport type PatientSummaryCardDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["__iconNode","FileExclamationPoint","createLucideIcon","MessageSquareWarning","patientSummaryCardAgent","handle","NO_SECTIONS","rootVariants","cva","normalisePhone","raw","FLAG_ICON","FLAG_VARIANT","FLAG_LABEL_DEFAULTS","MARKETING_CONSENT_DEFAULTS","PatientSummaryCard","forwardRef","name","title","ageYears","dateOfBirth","gender","avatarUrl","patientUrl","sections","visibleFieldOrder","onVisibleFieldsChange","email","emailEnabled","phone","cityProvince","marketingConsent","aiConsent","flags","familyRelations","assignedTo","currency","locale","loading","actionSlot","onActivate","surface","density","ariaLabel","id","className","rest","ref","i18n","useTranslation","headingId","useId","activeLocale","unpaidAmountCents","unsignedDocumentsCount","highlightedAnamnesisCount","hasUnpaid","useMemo","useAgentRegistration","customizable","fieldVisibility","usePatientFieldVisibility","resolvedAriaLabel","TITLE_DEFAULTS","honorific","headingText","identityChips","jsx","SexChip","AgeChip","NeutralChip","CalendarDays","isUrlSafe","isSafeEntityUrl","avatarSize","headingClass","bodyGapClass","rows","Mail","Link","Phone","jsxs","Badge","MapPin","ShieldCheck","Astroid","Users","Avatar","flagBadges","attentionChips","TransactionChip","key","count","FlagIcon","skeletonBody","Skeleton","heading","header","FieldVisibilityCog","familyBlock","rel","index","safeUrl","tagLabel","Tag","legacyFields","row","effectiveSections","order","visibleFields","resolveVisibleFields","resolved","body","KeyValueList","field","KeyValuePair","FieldValue","inner","Card"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,KAAuBC,GAAiB,0BAA0BF,EAAU;ACpBlF;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAC1C,GACMG,KAAuBD,GAAiB,0BAA0BF,EAAU,GCNrEI,KAAkE;AAAA,EAC7E,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MA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AAAA,YACP,WAAU;AAAA,YAET,UAAAJ,EAAc,IAAI,CAACK,MAClB,gBAAA/C;AAAA,cAACgD;AAAA,cAAA;AAAA,gBAEC,MAAMD,EAAM,QAAQ;AAAA,gBACpB,OAAOA,EAAM;AAAA,gBACb,OAAO,gBAAA/C,EAACiD,IAAA,EAAW,OAAAF,EAAA,CAAc;AAAA,cAAA;AAAA,cAH5BA,EAAM;AAAA,YAAA,CAKd;AAAA,UAAA;AAAA,QAAA,EACH,CACF;AAAA,UACE;AAAA,MACHf;AAAA,IAAA,GACH,GAGIkB,IAAQ/E,IAAUwD,KAAekB;AAEvC,WACE,gBAAA7C;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAApB;AAAA,QACA,MAAK;AAAA,QAML,cAAYT,KAAWK,IAAYmB,KAAoB;AAAA,QACvD,mBAAiBxB,KAAWK,IAAY,SAAYO;AAAA,QACpD,aAAWZ,KAAW;AAAA,QACtB,kBAAe;AAAA,QACf,qBAAmBM;AAAA,QACnB,gBAAcF;AAAA,QACd,IAAAE;AAAA,QACA,WAAWrC,GAAa,EAAE,SAAAkC,GAAS,SAAAC,GAAS,WAAAG,IAAW;AAAA,QACtD,GAAGC;AAAA,QAEH,UAAAL,MAAY,aACX,gBAAA0B,EAACmD,GAAA,EAAK,SAAQ,YACZ,UAAA,gBAAAnD,EAACmD,EAAK,MAAL,EAAW,UAAAD,EAAA,CAAM,EAAA,CACpB,IAEAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAtG,GAAmB,cAAc;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"patient-summary-card-C-iVDo53.js","sources":["../../node_modules/lucide-react/dist/esm/icons/file-exclamation-point.mjs","../../node_modules/lucide-react/dist/esm/icons/message-square-warning.mjs","../../src/components/patient-summary-card/patient-summary-card.agent.ts","../../src/components/patient-summary-card/patient-summary-card.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 [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst FileExclamationPoint = createLucideIcon(\"file-exclamation-point\", __iconNode);\n\nexport { __iconNode, FileExclamationPoint as default };\n//# sourceMappingURL=file-exclamation-point.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 [\n \"path\",\n {\n d: \"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\",\n key: \"18887p\"\n }\n ],\n [\"path\", { d: \"M12 15h.01\", key: \"q59x07\" }],\n [\"path\", { d: \"M12 7v4\", key: \"xawao1\" }]\n];\nconst MessageSquareWarning = createLucideIcon(\"message-square-warning\", __iconNode);\n\nexport { __iconNode, MessageSquareWarning as default };\n//# sourceMappingURL=message-square-warning.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { PatientSummaryCardHandle } from './patient-summary-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — PatientSummaryCard */\n/* */\n/* Read-only adapter. Surfaces a STRUCTURAL snapshot of the patient */\n/* overview — counts, flags, and the consumer id only. Never the patient */\n/* name, age, contact details, or any clinical content, so an agent / */\n/* MCP runtime can answer \"does this patient have unpaid balances / */\n/* unsigned documents / AI consent?\" without re-parsing the DOM and */\n/* without leaking PHI (PRS §Security). */\n/* -------------------------------------------------------------------- */\n\nexport const patientSummaryCardAgent: AgentAdapter<PatientSummaryCardHandle> = {\n id: 'patient-summary-card',\n // The agent surface is a structural snapshot only — the single handle method\n // is a getSummary projection. The card MAY be human-customized (the optional\n // per-context \"Customize fields\" cog), but that field reordering is a UI\n // concern and is deliberately NOT exposed as an agent action; programmatic\n // field-set control lives on PatientDetails' adapter (set_field_order).\n capabilities: [],\n state: {\n summary: {\n type: '{ id?: string; hasUnpaid: boolean; unsignedDocumentsCount: number; highlightedAnamnesisCount: number; aiConsentGranted: boolean }',\n descriptionKey: 'ui.agent.patientSummaryCard.state.summary',\n description:\n 'Structural summary of the patient card — identifiers, counts, and consent flags only. Never patient identity or clinical content.',\n read: (handle) => handle.getSummary(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'patient-summary-card',\n description: 'Marks the PatientSummaryCard 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 CalendarDays,\n FileExclamationPoint,\n Mail,\n MapPin,\n MessageSquareWarning,\n Phone,\n ShieldCheck,\n Astroid,\n Users,\n type LucideIcon,\n} from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\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 { Skeleton } from '../skeleton/skeleton';\nimport { Tag } from '../tag/tag';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { isSafeEntityUrl } from '../_shared/is-safe-url';\nimport {\n resolveVisibleFields,\n type PatientField,\n type PatientFieldSection,\n} from '../_shared/patient-fields';\nimport { usePatientFieldVisibility } from '../_shared/field-visibility';\nimport { FieldVisibilityCog } from '../_shared/field-visibility-cog';\nimport {\n AgeChip,\n FieldValue,\n NeutralChip,\n SexChip,\n} from '../_shared/field-value';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { patientSummaryCardAgent } from './patient-summary-card.agent';\n\n/** A section list reference that stays stable across renders (legacy mode). */\nconst NO_SECTIONS: PatientFieldSection[] = [];\n\n/* -------------------------------------------------------------------- */\n/* PatientSummaryCard */\n/* */\n/* The patient-overview profile card every AlfaDocs in-app surface */\n/* composes by hand today (platform patient header, alfascribe patient */\n/* sidebar, check-in landing). Templated on ContactProfileCard: composes */\n/* Card + Avatar + KeyValueList + KeyValuePair + Badge + Tag + */\n/* TransactionChip + Link so the contact rows share a column and every */\n/* row uses the same lucide icon family. */\n/* */\n/* The kit owns the ORDER, ICONS, and LABELS — consumers pass data. No */\n/* free-text clinical content (anamnesis notes, diagnoses) ever lives */\n/* here: only counts/flags/relations are surfaced, so the card stays */\n/* PHI-light and the agent state can be derived without leaking patient */\n/* identity. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `patientSummaryCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n // Matches the kit's other `surface` props (ContactProfileCard,\n // OperatorHero). `'elevated'` wraps the content in `<Card>`.\n surface: {\n flat: '',\n elevated: '',\n },\n // Density tunes the avatar size + body padding. `comfortable` reads\n // as a page header; `compact` fits an embedded sidebar / aside.\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n surface: 'elevated',\n density: 'comfortable',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/** Patient phone number — already formatted for display by the consumer. */\nexport interface PatientSummaryCardPhone {\n /** Display string, e.g. `\"+39 055 123 4567\"`. Compiled into a `tel:` link. */\n prefixAndNumber: string;\n /** Optional label that distinguishes this number (e.g. \"Mobile\"). */\n label?: string;\n /** Whether SMS is enabled for this number — shows a small \"SMS\" chip. */\n smsEnabled?: boolean;\n}\n\n/** A family relation row — links one patient to another. */\nexport interface PatientSummaryCardFamilyRelation {\n /** Localised relation label, consumer-supplied (e.g. \"Mother\", \"Child\"). */\n relation: string;\n /** The related patient — name + optional in-app profile URL. */\n relatedPatient: {\n name: string;\n url?: string;\n };\n}\n\n/** Operator the patient is assigned to. */\nexport interface PatientSummaryCardAssignee {\n name: string;\n avatarUrl?: string;\n}\n\n/** AI-consent grant metadata — structural only, never the consented content. */\nexport interface PatientSummaryCardAiConsent {\n /** ISO-8601 / display string of when consent was granted. */\n grantedAt: string;\n /** Optional name of who recorded the grant. */\n grantedBy?: string;\n}\n\n/** Status flags rendered as glyph badges (counts / amounts only — no PHI). */\nexport interface PatientSummaryCardFlags {\n /** Number of anamnesis answers highlighted for clinical attention. */\n highlightedAnamnesisCount?: number;\n /** Outstanding balance in the smallest currency unit (cents). */\n unpaidAmountCents?: number;\n /** Number of documents awaiting the patient's signature. */\n unsignedDocumentsCount?: number;\n}\n\n/** Marketing-consent tri-state. */\nexport type PatientSummaryCardMarketingConsent = 'no' | 'yes' | 'not_specified';\n\nexport interface PatientSummaryCardHandle {\n /** Structural snapshot — identifiers and counts only, never patient identity. */\n getSummary: () => {\n id?: string;\n hasUnpaid: boolean;\n unsignedDocumentsCount: number;\n highlightedAnamnesisCount: number;\n aiConsentGranted: boolean;\n };\n}\n\nexport interface PatientSummaryCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children'\n> {\n /** Patient display name. Rendered as the heading. */\n name: string;\n /** Honorific — `'mr'` / `'ms'`. Prepended to the name in the heading. */\n title?: 'mr' | 'ms';\n /** Patient age in whole years — rendered in the identity line. */\n ageYears?: number;\n /** Date of birth — already formatted for display by the consumer. */\n dateOfBirth?: string;\n /** Biological sex marker — `'m'` / `'f'`. Drives the identity-line glyph copy. */\n gender?: 'm' | 'f';\n /** Optional avatar / photo URL. Falls back to initials. */\n avatarUrl?: string;\n /**\n * In-app patient profile URL. When safe, the heading becomes a link.\n * Guarded by the shared `isSafeEntityUrl` allow-list — unsafe URLs are\n * dropped and the heading renders as plain text.\n */\n patientUrl?: string;\n\n /* ----- Shared field model (preferred) ----- */\n\n /**\n * Patient fields in the shared model — the SAME `sections` shape\n * `PatientDetails` consumes (`@alfadocs/ui-kit` `PatientFieldSection`).\n * When provided, the card renders these (honouring `visibleFieldOrder`)\n * instead of the legacy contact props, so a consumer defines its patient-\n * field registry once and reuses it across every patient surface.\n *\n * The card renders each field's `label`, `value`, and `icon` only — it is\n * flat (section headings are not shown in the body) and never inline-edits;\n * `sensitive` / `copyable` / `mono` / `editable` are honoured by\n * `PatientDetails`, not the card (so the PHI lock glyph does not appear here).\n *\n * Pass `onVisibleFieldsChange` alongside `sections` to make THIS placement\n * self-curating (a \"Customize fields\" cog appears — show/hide + drag-and-drop\n * reorder).\n */\n sections?: PatientFieldSection[];\n /**\n * Ordered visible field ids for THIS placement. The order is a\n * per-INSTANCE, per-CONTEXT preference the kit never persists — wire it to\n * whatever scope the consumer wants (e.g. a global per-user setting, or a\n * different config in the care-plan view vs the patient folder). The same\n * field vocabulary can therefore display differently in different parts of\n * the app. Omit (`undefined`) ⇒ show every field; an explicit empty array\n * `[]` ⇒ show none (a card that starts collapsed to name + identity chips and\n * reveals fields via the cog). Also applied to the legacy contact rows (ids\n * `email` / `phone` / `cityProvince` / `marketingConsent` / `aiConsent` /\n * `assignedTo`).\n */\n visibleFieldOrder?: string[];\n /**\n * Make this card's field set user-customizable. When provided alongside\n * `sections`, a \"Customize fields\" cog renders in the header (show/hide +\n * drag-and-drop / Alt+Arrow reorder), and this fires with the next ordered\n * visible set. The consumer owns persistence + its scope — editing here\n * writes only THIS context's preference, never a shared/global one.\n */\n onVisibleFieldsChange?: (orderedIds: string[]) => void;\n\n /* ----- Contact rows (legacy — prefer `sections`) ----- */\n\n /** @deprecated Pass via `sections`. Patient email — `mailto:` link when `emailEnabled`. */\n email?: string;\n /** Whether email contact is enabled — gates the `mailto:` link. */\n emailEnabled?: boolean;\n /** Phone number block. Compiled into a `tel:` link. */\n phone?: PatientSummaryCardPhone;\n /** City / province display string. */\n cityProvince?: string;\n\n /* ----- Consent ----- */\n\n /** Marketing-consent tri-state. */\n marketingConsent?: PatientSummaryCardMarketingConsent;\n /** AI-consent grant metadata. When present, an \"AI consent\" row renders. */\n aiConsent?: PatientSummaryCardAiConsent;\n\n /* ----- Status flags ----- */\n\n /** Counts / amounts surfaced as glyph badges. */\n flags?: PatientSummaryCardFlags;\n\n /* ----- Relations & assignment ----- */\n\n /** Family relations — rendered as `<Tag>` chips, optionally linked. */\n familyRelations?: PatientSummaryCardFamilyRelation[];\n /** Operator the patient is assigned to. */\n assignedTo?: PatientSummaryCardAssignee;\n\n /* ----- Formatting ----- */\n\n /** ISO-4217 currency code for the unpaid-amount chip. Defaults to `EUR`. */\n currency?: string;\n /** BCP-47 locale override. Defaults to the active i18next language. */\n locale?: string;\n\n /* ----- States ----- */\n\n /** Render the skeleton loading placeholder. */\n loading?: boolean;\n\n /* ----- Slots & callbacks ----- */\n\n /** Rendered at the inline-end of the heading row (e.g. an action menu). */\n actionSlot?: ReactNode;\n /** Fires when the whole card / heading is activated. */\n onActivate?: () => void;\n\n /* ----- Styling ----- */\n\n /** `'elevated'` (default) wraps in `<Card>`; `'flat'` drops the chrome. */\n surface?: 'flat' | 'elevated';\n /** `'comfortable'` (default) reads as a header; `'compact'` for asides. */\n density?: 'comfortable' | 'compact';\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/* -------------------------------------------------------------------- */\n/* Flag glyphs — the closed set of status indicators */\n/* -------------------------------------------------------------------- */\n\n/** The closed set of status-flag keys (icon + tonal variant defined below). */\ntype FlagKey = 'highlightedAnamnesis' | 'unsignedDocuments';\n\nconst FLAG_ICON: Record<FlagKey, LucideIcon> = {\n highlightedAnamnesis: MessageSquareWarning,\n unsignedDocuments: FileExclamationPoint,\n};\n\nconst FLAG_VARIANT: Record<FlagKey, 'warning' | 'error'> = {\n highlightedAnamnesis: 'warning',\n unsignedDocuments: 'error',\n};\n\n/** English fallbacks for the flag badge accessible names (count-interpolated). */\nconst FLAG_LABEL_DEFAULTS: Record<FlagKey, string> = {\n highlightedAnamnesis: '{{count}} highlighted anamnesis answers',\n unsignedDocuments: '{{count}} unsigned documents',\n};\n\n/** English fallbacks for the marketing-consent tri-state chip. */\nconst MARKETING_CONSENT_DEFAULTS: Record<\n PatientSummaryCardMarketingConsent,\n string\n> = {\n yes: 'Yes',\n no: 'No',\n not_specified: 'Not specified',\n};\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PatientSummaryCard = forwardRef<\n HTMLDivElement,\n PatientSummaryCardProps\n>(\n (\n {\n name,\n title,\n ageYears,\n dateOfBirth,\n gender,\n avatarUrl,\n patientUrl,\n sections,\n visibleFieldOrder,\n onVisibleFieldsChange,\n email,\n emailEnabled = false,\n phone,\n cityProvince,\n marketingConsent,\n aiConsent,\n flags,\n familyRelations,\n assignedTo,\n currency = 'EUR',\n locale,\n loading = false,\n actionSlot,\n onActivate,\n surface = 'elevated',\n density = 'comfortable',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const unpaidAmountCents = flags?.unpaidAmountCents;\n const unsignedDocumentsCount = flags?.unsignedDocumentsCount ?? 0;\n const highlightedAnamnesisCount = flags?.highlightedAnamnesisCount ?? 0;\n const hasUnpaid = unpaidAmountCents != null && unpaidAmountCents > 0;\n\n // Imperative handle — structural snapshot only (counts/flags/ids),\n // never the patient name or any clinical content.\n const handle = useMemo<PatientSummaryCardHandle>(\n () => ({\n getSummary: () => ({\n id,\n hasUnpaid,\n unsignedDocumentsCount,\n highlightedAnamnesisCount,\n aiConsentGranted: aiConsent != null,\n }),\n }),\n [\n id,\n hasUnpaid,\n unsignedDocumentsCount,\n highlightedAnamnesisCount,\n aiConsent,\n ],\n );\n useAgentRegistration(patientSummaryCardAgent, handle, id);\n\n // Per-context field visibility. The cog (and live reordering) only engages\n // with the shared `sections` model AND an `onVisibleFieldsChange` handler;\n // legacy contact-prop cards stay read-only. The order is this placement's\n // own preference — never shared across surfaces.\n const customizable = !!sections && !!onVisibleFieldsChange;\n const fieldVisibility = usePatientFieldVisibility(sections ?? NO_SECTIONS, {\n value: visibleFieldOrder,\n onChange: onVisibleFieldsChange,\n });\n\n const resolvedAriaLabel =\n ariaLabel ??\n t('patientSummaryCard.regionLabel', { defaultValue: 'Patient overview' });\n\n // Heading text: optional honorific prefix + name.\n const TITLE_DEFAULTS: Record<'mr' | 'ms', string> = {\n mr: 'Mr.',\n ms: 'Ms.',\n };\n const honorific = title\n ? t(`patientSummaryCard.title.${title}`, {\n defaultValue: TITLE_DEFAULTS[title],\n })\n : undefined;\n const headingText = honorific ? `${honorific} ${name}` : name;\n\n // Identity line: the canonical sex / age / dob chips below the name — the\n // SAME chips the field model renders, so the header and the field rows\n // agree. Each chip is added only when its prop is present. (`dateOfBirth`\n // is a consumer-preformatted display string, so it goes through NeutralChip\n // directly rather than the date-parsing `dob` kind.)\n const identityChips: ReactNode[] = [];\n if (gender) {\n identityChips.push(<SexChip key=\"sex\" code={gender} />);\n }\n if (ageYears != null) {\n identityChips.push(<AgeChip key=\"age\" years={ageYears} />);\n }\n if (dateOfBirth) {\n identityChips.push(\n <NeutralChip key=\"dob\" icon={<CalendarDays />}>\n {dateOfBirth}\n </NeutralChip>,\n );\n }\n\n const isUrlSafe = !!patientUrl && isSafeEntityUrl(patientUrl);\n\n const avatarSize = density === 'comfortable' ? 'xl' : 'lg';\n const headingClass =\n density === 'comfortable' ? 'type-title-card' : 'type-title-item';\n const bodyGapClass =\n density === 'comfortable'\n ? 'ds:gap-[var(--spacing-md)]'\n : 'ds:gap-[var(--spacing-sm)]';\n\n /* ---------------------------------------------------------------- */\n /* Contact rows */\n /* ---------------------------------------------------------------- */\n\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n }> = [];\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.email', { defaultValue: 'Email' }),\n value: emailEnabled ? (\n <Link href={`mailto:${email}`} intent=\"default\" onClick={onActivate}>\n {email}\n </Link>\n ) : (\n <span className=\"ds:text-[color:var(--muted-foreground)]\">\n {email}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label:\n phone.label ??\n t('patientSummaryCard.label.phone', { defaultValue: 'Phone' }),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]\">\n <Link\n href={`tel:${normalisePhone(phone.prefixAndNumber)}`}\n intent=\"default\"\n >\n {phone.prefixAndNumber}\n </Link>\n {phone.smsEnabled ? (\n <Badge variant=\"success\" size=\"sm\">\n {t('patientSummaryCard.value.smsEnabled', {\n defaultValue: 'SMS',\n })}\n </Badge>\n ) : null}\n </span>\n ),\n });\n }\n\n if (cityProvince) {\n rows.push({\n key: 'cityProvince',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.cityProvince', {\n defaultValue: 'City / province',\n }),\n value: cityProvince,\n });\n }\n\n if (marketingConsent) {\n rows.push({\n key: 'marketingConsent',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.marketingConsent', {\n defaultValue: 'Marketing consent',\n }),\n value: (\n <Badge\n variant={\n marketingConsent === 'yes'\n ? 'success'\n : marketingConsent === 'no'\n ? 'error'\n : 'neutral'\n }\n size=\"sm\"\n withDot\n >\n {t(`patientSummaryCard.marketingConsent.${marketingConsent}`, {\n defaultValue: MARKETING_CONSENT_DEFAULTS[marketingConsent],\n })}\n </Badge>\n ),\n });\n }\n\n if (aiConsent) {\n rows.push({\n key: 'aiConsent',\n icon: <Astroid aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.aiConsent', {\n defaultValue: 'AI consent',\n }),\n value: aiConsent.grantedBy\n ? t('patientSummaryCard.value.aiConsentGrantedBy', {\n date: aiConsent.grantedAt,\n by: aiConsent.grantedBy,\n defaultValue: 'Granted {{date}} by {{by}}',\n })\n : t('patientSummaryCard.value.aiConsentGrantedAt', {\n date: aiConsent.grantedAt,\n defaultValue: 'Granted {{date}}',\n }),\n });\n }\n\n if (assignedTo) {\n rows.push({\n key: 'assignedTo',\n icon: <Users aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.assignedTo', {\n defaultValue: 'Assigned to',\n }),\n value: (\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <Avatar\n size=\"xs\"\n name={assignedTo.name}\n src={assignedTo.avatarUrl}\n />\n <span>{assignedTo.name}</span>\n </span>\n ),\n });\n }\n\n /* ---------------------------------------------------------------- */\n /* Attention-flag chips (VERBOSE — shown in the identity line) */\n /* */\n /* The unpaid balance + warning counts sit in the chip row under the */\n /* name, BEFORE the sex / age chips, each as a self-describing chip */\n /* (\"2 unsigned documents\") rather than a collapsed count badge in a */\n /* separate strip — the attention signals lead the patient's chips. */\n /* ---------------------------------------------------------------- */\n\n const flagBadges: Array<{ key: FlagKey; count: number }> = [];\n if (highlightedAnamnesisCount > 0) {\n flagBadges.push({\n key: 'highlightedAnamnesis',\n count: highlightedAnamnesisCount,\n });\n }\n if (unsignedDocumentsCount > 0) {\n flagBadges.push({\n key: 'unsignedDocuments',\n count: unsignedDocumentsCount,\n });\n }\n\n const attentionChips: ReactNode[] = [];\n if (hasUnpaid) {\n attentionChips.push(\n <TransactionChip\n key=\"unpaid\"\n state=\"debt\"\n amount={(unpaidAmountCents as number) / 100}\n currency={currency}\n locale={activeLocale}\n size=\"md\"\n showLabel\n />,\n );\n }\n flagBadges.forEach(({ key, count }) => {\n const FlagIcon = FLAG_ICON[key];\n // The Badge's visible text IS the count-interpolated label, so it's its\n // own accessible name — the leading glyph is decorative (aria-hidden).\n attentionChips.push(\n <Badge\n key={key}\n variant={FLAG_VARIANT[key]}\n size=\"md\"\n leading={<FlagIcon aria-hidden=\"true\" />}\n >\n {t(`patientSummaryCard.flag.${key}`, {\n count,\n defaultValue: FLAG_LABEL_DEFAULTS[key],\n })}\n </Badge>,\n );\n });\n\n /* ---------------------------------------------------------------- */\n /* Loading skeleton */\n /* ---------------------------------------------------------------- */\n\n const skeletonBody = (\n <div className={`ds:flex ds:flex-col ${bodyGapClass}`}>\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-md)]\">\n <Skeleton variant=\"circular\" size=\"lg\" />\n <div className=\"ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton variant=\"text\" width=\"60%\" />\n <Skeleton variant=\"text\" width=\"40%\" />\n </div>\n </div>\n <Skeleton variant=\"text\" lines={3} />\n </div>\n );\n\n /* ---------------------------------------------------------------- */\n /* Header */\n /* ---------------------------------------------------------------- */\n\n const heading = isUrlSafe ? (\n <Link\n href={patientUrl as string}\n intent=\"default\"\n weight=\"strong\"\n onClick={onActivate}\n className={`${headingClass} ds:no-underline`}\n >\n <span id={headingId}>{headingText}</span>\n </Link>\n ) : (\n <span\n id={headingId}\n className={`${headingClass} ds:text-[color:var(--foreground)]`}\n >\n {headingText}\n </span>\n );\n\n const header = (\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)]\">\n <Avatar\n size={avatarSize}\n name={name}\n src={avatarUrl}\n className=\"ds:shrink-0\"\n />\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n {heading}\n {attentionChips.length > 0 || identityChips.length > 0 ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {/* Attention flags lead, then the sex / age / dob identity chips. */}\n {attentionChips}\n {identityChips}\n </div>\n ) : null}\n </div>\n {customizable || actionSlot ? (\n <div className=\"ds:ms-auto ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-xs)]\">\n {customizable && sections ? (\n <FieldVisibilityCog\n sections={sections}\n visible={fieldVisibility.visible}\n onToggleField={fieldVisibility.toggleField}\n onToggleSection={fieldVisibility.toggleSection}\n onMoveFieldOnto={fieldVisibility.moveFieldOnto}\n onReset={fieldVisibility.reset}\n />\n ) : null}\n {actionSlot}\n </div>\n ) : null}\n </div>\n );\n\n /* ---------------------------------------------------------------- */\n /* Family relations */\n /* ---------------------------------------------------------------- */\n\n const familyBlock =\n familyRelations && familyRelations.length > 0 ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-[color:var(--muted-foreground)]\">\n {t('patientSummaryCard.label.familyRelations', {\n defaultValue: 'Family relations',\n })}\n </span>\n <div className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {familyRelations.map((rel, index) => {\n const safeUrl =\n !!rel.relatedPatient.url &&\n isSafeEntityUrl(rel.relatedPatient.url);\n const tagLabel = t('patientSummaryCard.value.familyRelation', {\n relation: rel.relation,\n name: rel.relatedPatient.name,\n defaultValue: '{{relation}}: {{name}}',\n });\n return safeUrl ? (\n <Link\n key={`${rel.relation}-${index}`}\n href={rel.relatedPatient.url as string}\n intent=\"default\"\n className=\"ds:no-underline\"\n >\n <Tag label={tagLabel} variant=\"neutral\" />\n </Link>\n ) : (\n <Tag\n key={`${rel.relation}-${index}`}\n label={tagLabel}\n variant=\"neutral\"\n />\n );\n })}\n </div>\n </div>\n ) : null;\n\n /* ---------------------------------------------------------------- */\n /* Body */\n /* ---------------------------------------------------------------- */\n\n // Field rows resolve through the SHARED model: when the consumer passes\n // `sections` (preferred), render those; otherwise wrap the legacy contact\n // rows as a single section. Either way `resolveVisibleFields` applies the\n // shared `visibleFieldOrder` preference, so the card and PatientDetails\n // always show the same fields, honouring the same per-user choice.\n const legacyFields: PatientField[] = rows.map((row) => ({\n id: row.key,\n label: row.label,\n value: row.value,\n icon: row.icon,\n }));\n const effectiveSections: PatientFieldSection[] = sections ?? [\n { id: 'contact', heading: '', fields: legacyFields },\n ];\n // With the shared `sections` model the order comes from the visibility hook\n // (so a cog reorder reflects live); legacy contact rows honour the raw\n // `visibleFieldOrder` prop.\n const order = sections ? fieldVisibility.visible : visibleFieldOrder;\n const visibleFields = resolveVisibleFields(\n effectiveSections,\n order,\n ).flatMap((resolved) => resolved.fields);\n\n const body = (\n <div className={`ds:flex ds:flex-col ${bodyGapClass}`}>\n {header}\n {visibleFields.length > 0 ? (\n // Container-queried so the fields flow into two columns when the\n // card is wide enough (the banner spans the full folder width), and\n // stay single-column in a narrow rail. The list's KeyValuePair\n // children already `col-span-3`; doubling the parent to six tracks\n // (`repeat(2, …)`) lets grid auto-flow place two fields per row while\n // each column keeps its own subgrid label/value alignment.\n // 672px, not the `@2xl` rem alias: container-query `rem` follows the\n // host root font-size, so a non-16px root moves the threshold.\n <div className=\"ds:@container/pfields\">\n <KeyValueList\n rowGap=\"sm\"\n className=\"ds:@[672px]/pfields:grid-cols-[repeat(2,auto_auto_minmax(0,1fr))]\"\n >\n {visibleFields.map((field) => (\n <KeyValuePair\n key={field.id}\n icon={field.icon ?? undefined}\n label={field.label}\n value={<FieldValue field={field} />}\n />\n ))}\n </KeyValueList>\n </div>\n ) : null}\n {familyBlock}\n </div>\n );\n\n const inner = loading ? skeletonBody : body;\n\n return (\n <div\n ref={ref}\n role=\"region\"\n // When the heading is rendered, the patient name (via\n // aria-labelledby) is the region's accessible name — the more\n // meaningful label than a generic \"Patient overview\". A consumer\n // aria-label still wins; the generic fallback only applies when\n // there is no heading to point at (loading state).\n aria-label={loading || ariaLabel ? resolvedAriaLabel : undefined}\n aria-labelledby={loading || ariaLabel ? undefined : headingId}\n aria-busy={loading || undefined}\n data-component=\"patient-summary-card\"\n data-component-id={id}\n data-density={density}\n id={id}\n className={rootVariants({ surface, density, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body>{inner}</Card.Body>\n </Card>\n ) : (\n inner\n )}\n </div>\n );\n },\n);\n\nPatientSummaryCard.displayName = 'PatientSummaryCard';\n\n/** Variant unions re-exported for downstream typing. */\nexport type PatientSummaryCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\nexport type PatientSummaryCardDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["__iconNode","FileExclamationPoint","createLucideIcon","MessageSquareWarning","patientSummaryCardAgent","handle","NO_SECTIONS","rootVariants","cva","normalisePhone","raw","FLAG_ICON","FLAG_VARIANT","FLAG_LABEL_DEFAULTS","MARKETING_CONSENT_DEFAULTS","PatientSummaryCard","forwardRef","name","title","ageYears","dateOfBirth","gender","avatarUrl","patientUrl","sections","visibleFieldOrder","onVisibleFieldsChange","email","emailEnabled","phone","cityProvince","marketingConsent","aiConsent","flags","familyRelations","assignedTo","currency","locale","loading","actionSlot","onActivate","surface","density","ariaLabel","id","className","rest","ref","i18n","useTranslation","headingId","useId","activeLocale","unpaidAmountCents","unsignedDocumentsCount","highlightedAnamnesisCount","hasUnpaid","useMemo","useAgentRegistration","customizable","fieldVisibility","usePatientFieldVisibility","resolvedAriaLabel","TITLE_DEFAULTS","honorific","headingText","identityChips","jsx","SexChip","AgeChip","NeutralChip","CalendarDays","isUrlSafe","isSafeEntityUrl","avatarSize","headingClass","bodyGapClass","rows","Mail","Link","Phone","jsxs","Badge","MapPin","ShieldCheck","Astroid","Users","Avatar","flagBadges","attentionChips","TransactionChip","key","count","FlagIcon","skeletonBody","Skeleton","heading","header","FieldVisibilityCog","familyBlock","rel","index","safeUrl","tagLabel","Tag","legacyFields","row","effectiveSections","order","visibleFields","resolveVisibleFields","resolved","body","KeyValueList","field","KeyValuePair","FieldValue","inner","Card"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,KAAuBC,GAAiB,0BAA0BF,EAAU;ACpBlF;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAC1C,GACMG,KAAuBD,GAAiB,0BAA0BF,EAAU,GCNrEI,KAAkE;AAAA,EAC7E,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,WAAA;AAAA,IAAW;AAAA,EACtC;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,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D,IAAA,EAAW,OAAAF,EAAA,CAAc;AAAA,cAAA;AAAA,cAH5BA,EAAM;AAAA,YAAA,CAKd;AAAA,UAAA;AAAA,QAAA,EACH,CACF;AAAA,UACE;AAAA,MACHf;AAAA,IAAA,GACH,GAGIkB,IAAQ/E,IAAUwD,KAAekB;AAEvC,WACE,gBAAA7C;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAApB;AAAA,QACA,MAAK;AAAA,QAML,cAAYT,KAAWK,IAAYmB,KAAoB;AAAA,QACvD,mBAAiBxB,KAAWK,IAAY,SAAYO;AAAA,QACpD,aAAWZ,KAAW;AAAA,QACtB,kBAAe;AAAA,QACf,qBAAmBM;AAAA,QACnB,gBAAcF;AAAA,QACd,IAAAE;AAAA,QACA,WAAWrC,GAAa,EAAE,SAAAkC,GAAS,SAAAC,GAAS,WAAAG,IAAW;AAAA,QACtD,GAAGC;AAAA,QAEH,UAAAL,MAAY,aACX,gBAAA0B,EAACmD,GAAA,EAAK,SAAQ,YACZ,UAAA,gBAAAnD,EAACmD,EAAK,MAAL,EAAW,UAAAD,EAAA,CAAM,EAAA,CACpB,IAEAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAtG,GAAmB,cAAc;","x_google_ignoreList":[0,1]}
@@ -922,7 +922,7 @@ function xn({
922
922
  m.label[1]
923
923
  )}`,
924
924
  onMouseDown: g,
925
- children: /* @__PURE__ */ e("span", { className: "ds:hidden ds:@md/toolbar:inline", children: c(m.label[0], m.label[1]) })
925
+ children: /* @__PURE__ */ e("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: c(m.label[0], m.label[1]) })
926
926
  }
927
927
  ) }),
928
928
  /* @__PURE__ */ e(Ae.Content, { align: "start", children: Fe.map((d) => /* @__PURE__ */ e(
@@ -1812,8 +1812,8 @@ function Bn({
1812
1812
  A && x.length > 0 ? /* @__PURE__ */ e(f, {}) : null,
1813
1813
  x,
1814
1814
  K ? /* @__PURE__ */ v(ke, { children: [
1815
- /* @__PURE__ */ e("div", { className: "ds:hidden ds:@sm/toolbar:contents", children: U(S) }),
1816
- /* @__PURE__ */ v("div", { className: "ds:contents ds:@sm/toolbar:hidden", children: [
1815
+ /* @__PURE__ */ e("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children: U(S) }),
1816
+ /* @__PURE__ */ v("div", { className: "ds:contents ds:@[384px]/toolbar:hidden", children: [
1817
1817
  S ? /* @__PURE__ */ e(f, {}) : null,
1818
1818
  /* @__PURE__ */ v(q, { children: [
1819
1819
  /* @__PURE__ */ e(q.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
@@ -2618,4 +2618,4 @@ export {
2618
2618
  hn as r,
2619
2619
  Qn as w
2620
2620
  };
2621
- //# sourceMappingURL=rich-text-editor-RRkBN_WB.js.map
2621
+ //# sourceMappingURL=rich-text-editor-DHpV2q6d.js.map