@mieweb/ui 0.11.0-dev.29 → 0.11.0-dev.30

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 (116) hide show
  1. package/MIGRATION.md +67 -0
  2. package/README.md +10 -0
  3. package/dist/EncounterMdyEditor-3SQY4MK2.js +286 -0
  4. package/dist/EncounterMdyEditor-3SQY4MK2.js.map +1 -0
  5. package/dist/EncounterMdyEditor-73PTTIRY.cjs +288 -0
  6. package/dist/EncounterMdyEditor-73PTTIRY.cjs.map +1 -0
  7. package/dist/chunk-25MPUVTM.js +339 -0
  8. package/dist/chunk-25MPUVTM.js.map +1 -0
  9. package/dist/{chunk-2VISTX7O.js → chunk-3NOVISM6.js} +3 -3
  10. package/dist/{chunk-2VISTX7O.js.map → chunk-3NOVISM6.js.map} +1 -1
  11. package/dist/{chunk-6GKIISNZ.cjs → chunk-3Y3ZCDNF.cjs} +176 -63
  12. package/dist/chunk-3Y3ZCDNF.cjs.map +1 -0
  13. package/dist/{chunk-AK4LHJPC.js → chunk-4JXO5JTE.js} +84 -3
  14. package/dist/chunk-4JXO5JTE.js.map +1 -0
  15. package/dist/chunk-4NB4WOGU.cjs +666 -0
  16. package/dist/chunk-4NB4WOGU.cjs.map +1 -0
  17. package/dist/{chunk-434L5RYF.js → chunk-4P27Y52M.js} +3 -3
  18. package/dist/{chunk-434L5RYF.js.map → chunk-4P27Y52M.js.map} +1 -1
  19. package/dist/{chunk-PRA2V5BP.cjs → chunk-5KGYTNOA.cjs} +7 -7
  20. package/dist/{chunk-PRA2V5BP.cjs.map → chunk-5KGYTNOA.cjs.map} +1 -1
  21. package/dist/chunk-5LNLB2XT.js +634 -0
  22. package/dist/chunk-5LNLB2XT.js.map +1 -0
  23. package/dist/chunk-5YOT4DVH.js +31 -0
  24. package/dist/chunk-5YOT4DVH.js.map +1 -0
  25. package/dist/chunk-7HFZL5V5.js +2425 -0
  26. package/dist/chunk-7HFZL5V5.js.map +1 -0
  27. package/dist/{chunk-XZNHS7YQ.cjs → chunk-7XC6E4BT.cjs} +3 -3
  28. package/dist/{chunk-XZNHS7YQ.cjs.map → chunk-7XC6E4BT.cjs.map} +1 -1
  29. package/dist/{chunk-JM4YFLO4.js → chunk-AIJYZP7M.js} +3 -3
  30. package/dist/{chunk-JM4YFLO4.js.map → chunk-AIJYZP7M.js.map} +1 -1
  31. package/dist/chunk-BBLEGF5L.js +66 -0
  32. package/dist/chunk-BBLEGF5L.js.map +1 -0
  33. package/dist/{chunk-MBDT2MGR.js → chunk-BIQIE3VW.js} +4 -4
  34. package/dist/{chunk-MBDT2MGR.js.map → chunk-BIQIE3VW.js.map} +1 -1
  35. package/dist/chunk-FSLI5IKP.cjs +54 -0
  36. package/dist/chunk-FSLI5IKP.cjs.map +1 -0
  37. package/dist/chunk-GADJASST.js +3 -0
  38. package/dist/chunk-GADJASST.js.map +1 -0
  39. package/dist/chunk-IXUIOR4K.cjs +2457 -0
  40. package/dist/chunk-IXUIOR4K.cjs.map +1 -0
  41. package/dist/chunk-K2BY7YPJ.cjs +4 -0
  42. package/dist/chunk-K2BY7YPJ.cjs.map +1 -0
  43. package/dist/{chunk-H3P7POFC.cjs → chunk-MA3Y6AYA.cjs} +3 -3
  44. package/dist/{chunk-H3P7POFC.cjs.map → chunk-MA3Y6AYA.cjs.map} +1 -1
  45. package/dist/chunk-QO4A6U73.cjs +342 -0
  46. package/dist/chunk-QO4A6U73.cjs.map +1 -0
  47. package/dist/{chunk-43QBEF6N.js → chunk-QR7B6UPR.js} +176 -63
  48. package/dist/chunk-QR7B6UPR.js.map +1 -0
  49. package/dist/chunk-SMPLM6K3.js +4107 -0
  50. package/dist/chunk-SMPLM6K3.js.map +1 -0
  51. package/dist/chunk-SV6YGK4U.cjs +88 -0
  52. package/dist/chunk-SV6YGK4U.cjs.map +1 -0
  53. package/dist/{chunk-MQ5WJ3NO.js → chunk-UDUYZDTA.js} +14 -72
  54. package/dist/chunk-UDUYZDTA.js.map +1 -0
  55. package/dist/{chunk-ZLBNYCYT.cjs → chunk-XPVQI3MM.cjs} +84 -3
  56. package/dist/chunk-XPVQI3MM.cjs.map +1 -0
  57. package/dist/{chunk-AQUHEKXL.cjs → chunk-XQHDQ64G.cjs} +4 -4
  58. package/dist/{chunk-AQUHEKXL.cjs.map → chunk-XQHDQ64G.cjs.map} +1 -1
  59. package/dist/chunk-Z2OOJGHL.cjs +4155 -0
  60. package/dist/chunk-Z2OOJGHL.cjs.map +1 -0
  61. package/dist/{chunk-QKW2QCGI.cjs → chunk-ZK2R6UGF.cjs} +13 -72
  62. package/dist/chunk-ZK2R6UGF.cjs.map +1 -0
  63. package/dist/components/ActionPlan/index.cjs +4 -4
  64. package/dist/components/ActionPlan/index.js +2 -2
  65. package/dist/components/AlertDialog/index.d.cts +1 -1
  66. package/dist/components/AlertDialog/index.d.ts +1 -1
  67. package/dist/components/EmailEditor/index.cjs +13 -12
  68. package/dist/components/EmailEditor/index.js +4 -3
  69. package/dist/components/MediaEditor/index.cjs +7 -7
  70. package/dist/components/MediaEditor/index.js +2 -2
  71. package/dist/components/RichTextEditor/index.cjs +5 -4
  72. package/dist/components/RichTextEditor/index.d.cts +34 -0
  73. package/dist/components/RichTextEditor/index.d.ts +34 -0
  74. package/dist/components/RichTextEditor/index.js +2 -1
  75. package/dist/components/SuperChat/index.cjs +10 -9
  76. package/dist/components/SuperChat/index.cjs.map +1 -1
  77. package/dist/components/SuperChat/index.js +2 -1
  78. package/dist/components/SuperChat/index.js.map +1 -1
  79. package/dist/components/Textarea/index.cjs +6 -5
  80. package/dist/components/Textarea/index.js +3 -2
  81. package/dist/esheet.cjs +4237 -25
  82. package/dist/esheet.cjs.map +1 -1
  83. package/dist/esheet.d.cts +753 -6
  84. package/dist/esheet.d.ts +753 -6
  85. package/dist/esheet.js +4099 -21
  86. package/dist/esheet.js.map +1 -1
  87. package/dist/index.cjs +204 -3072
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.d.cts +71 -9
  90. package/dist/index.d.ts +71 -9
  91. package/dist/index.js +38 -2968
  92. package/dist/index.js.map +1 -1
  93. package/dist/kerebron.cjs +7 -268
  94. package/dist/kerebron.cjs.map +1 -1
  95. package/dist/kerebron.d.cts +7 -1
  96. package/dist/kerebron.d.ts +7 -1
  97. package/dist/kerebron.js +6 -270
  98. package/dist/kerebron.js.map +1 -1
  99. package/dist/model-WFFZRQMY.js +18 -0
  100. package/dist/model-WFFZRQMY.js.map +1 -0
  101. package/dist/model-Y7WRIGGA.cjs +79 -0
  102. package/dist/model-Y7WRIGGA.cjs.map +1 -0
  103. package/dist/styles.css +1 -1
  104. package/dist/tailwind-preset.cjs +4 -4
  105. package/dist/tailwind-preset.js +1 -1
  106. package/package.json +30 -9
  107. package/dist/chunk-43QBEF6N.js.map +0 -1
  108. package/dist/chunk-6GKIISNZ.cjs.map +0 -1
  109. package/dist/chunk-AK4LHJPC.js.map +0 -1
  110. package/dist/chunk-MQ5WJ3NO.js.map +0 -1
  111. package/dist/chunk-QKW2QCGI.cjs.map +0 -1
  112. package/dist/chunk-SFSBYC46.js +0 -1596
  113. package/dist/chunk-SFSBYC46.js.map +0 -1
  114. package/dist/chunk-ZIJMLRI3.cjs +0 -1633
  115. package/dist/chunk-ZIJMLRI3.cjs.map +0 -1
  116. package/dist/chunk-ZLBNYCYT.cjs.map +0 -1
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ export { TranscriptView, formatTimestampMs } from './chunk-LAEIVOIY.js';
31
31
  export { PlayButton, VideoCard } from './chunk-43K7OQ3E.js';
32
32
  export { VisuallyHidden } from './chunk-H2CIKJQI.js';
33
33
  export { MONTH_LETTERS, MONTH_NAMES, YearTimeline, resolveCurrent } from './chunk-MUYUFOGL.js';
34
- export { ActionPlan, defaultActionPlanLabels } from './chunk-434L5RYF.js';
34
+ export { ActionPlan, defaultActionPlanLabels } from './chunk-4P27Y52M.js';
35
35
  export { ActivityFeed, defaultActivityFeedLabels } from './chunk-X5JOEZVR.js';
36
36
  import './chunk-YGS2TRMP.js';
37
37
  export { AssociationList, defaultAssociationListLabels } from './chunk-5HKZR6UG.js';
@@ -48,8 +48,8 @@ import { Skeleton } from './chunk-ZIUADGAR.js';
48
48
  export { Skeleton, SkeletonCard, SkeletonTable, SkeletonText, skeletonVariants } from './chunk-ZIUADGAR.js';
49
49
  export { SourceTip } from './chunk-KFEN2SRZ.js';
50
50
  export { Sparkline } from './chunk-CG4ZKJLE.js';
51
- import { ButtonGroup, SparklesIcon, RefreshIcon, CloseIcon, JumpToBottomButton, AIMessageDisplay } from './chunk-MQ5WJ3NO.js';
52
- export { AILogoIcon, AIMessageDisplay, AITypingIndicator, ButtonGroup, ChatBubble, ChevronIcon, CloseIcon, CollapsiblePill, MCPToolCallDisplay, MessageAvatar, RefreshIcon, ResourceLink, SendIcon, SparklesIcon, SpinnerIcon, ToolStatusIcon, getToolIcon } from './chunk-MQ5WJ3NO.js';
51
+ import { SparklesIcon, RefreshIcon, CloseIcon, JumpToBottomButton, AIMessageDisplay } from './chunk-UDUYZDTA.js';
52
+ export { AILogoIcon, AIMessageDisplay, AITypingIndicator, ChatBubble, ChevronIcon, CloseIcon, CollapsiblePill, MCPToolCallDisplay, MessageAvatar, RefreshIcon, ResourceLink, SendIcon, SparklesIcon, SpinnerIcon, ToolStatusIcon, getToolIcon } from './chunk-UDUYZDTA.js';
53
53
  import { useTypingEmulation, EmptyState } from './chunk-OZKJYLN6.js';
54
54
  export { AttachmentPreview, ConversationHeader, ConversationListItem, ConversationListSkeleton, DateSeparator, EmptyState, LightboxModal, LoadMoreButton, MessageBubble, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, ReadReceiptIndicator, SkeletonMessage, TypingIndicator, bubbleVariants, formatDateLabel, formatFileSize, formatLastSeen, getConversationSubtitle, getConversationTitle, groupMessagesByDate, headerVariants, isSameSenderGroup, useMessageScroll, useMessages, useReadReceipts, useTypingEmulation, useTypingIndicator } from './chunk-OZKJYLN6.js';
55
55
  import { notifyComposerMigrationOnce, ChatComposer, DEFAULT_MAX_FILE_SIZE, DEFAULT_ACCEPTED_FILE_TYPES, ComposerSelector } from './chunk-DAAJ3B2T.js';
@@ -66,7 +66,7 @@ export { ReadingProgressBar } from './chunk-WKSUL2ZN.js';
66
66
  export { DictationButton, defaultDictationLabels, useDictation } from './chunk-MZA2LDS4.js';
67
67
  import { RecordButton } from './chunk-MQOYDQTF.js';
68
68
  export { RecordButton, formatDuration, recordButtonVariants } from './chunk-MQOYDQTF.js';
69
- export { FillerWordsModal, MediaEditor, SilenceSettingsModal, SpeedMarkerMenu, WordEditorModal } from './chunk-JM4YFLO4.js';
69
+ export { FillerWordsModal, MediaEditor, SilenceSettingsModal, SpeedMarkerMenu, WordEditorModal } from './chunk-AIJYZP7M.js';
70
70
  export { Slider, sliderRangeVariants, sliderThumbVariants, sliderTrackVariants } from './chunk-V5VPECJI.js';
71
71
  export { MediaFeed } from './chunk-2X54ZLT6.js';
72
72
  import './chunk-RISZWWEQ.js';
@@ -92,7 +92,7 @@ import { CountryDropdownBase } from './chunk-OTIKWEFZ.js';
92
92
  export { CountryCodeDropdown, formatE164, validatePhoneNumber } from './chunk-OTIKWEFZ.js';
93
93
  export { CustomizableDashboard, DashboardCustomizePanel, consolidateColumns, mergeColumnOrder, moveAcrossColumns, reorderOnDrop, requiredColumns } from './chunk-F6W62K4J.js';
94
94
  export { Sheet, SheetBody, SheetClose, SheetDescription, SheetFooter, SheetHeader, SheetTitle, sheetContentVariants, sheetOverlayVariants } from './chunk-LMBXJZLG.js';
95
- export { EMAIL_BLOCK_TYPES, EmailEditor, createDefaultDesignSettings, createEmailBlock, createEmailHtmlSanitizer, createEmptyEmailContentTree, defaultEmailEditorLabels, generateEmailBlockId, renderEmailMjml } from './chunk-MBDT2MGR.js';
95
+ export { EMAIL_BLOCK_TYPES, EmailEditor, createDefaultDesignSettings, createEmailBlock, createEmailHtmlSanitizer, createEmptyEmailContentTree, defaultEmailEditorLabels, generateEmailBlockId, renderEmailMjml } from './chunk-BIQIE3VW.js';
96
96
  import './chunk-XBAAHOCP.js';
97
97
  import { Tabs, TabsList, TabsTrigger, TabsContent } from './chunk-ME7EVT6F.js';
98
98
  export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants, tabsTriggerVariants } from './chunk-ME7EVT6F.js';
@@ -103,8 +103,6 @@ export { FloatingWindow, MinimizedWindow } from './chunk-UJDWFDKE.js';
103
103
  export { Breadcrumb, BreadcrumbSlash } from './chunk-SCXELRRZ.js';
104
104
  import './chunk-OF7NTZ2I.js';
105
105
  export { CalendarView, defaultCalendarLabels } from './chunk-RZSSQ7AT.js';
106
- import { Checkbox } from './chunk-753Z3NXL.js';
107
- export { Checkbox, CheckboxGroup, checkboxVariants } from './chunk-753Z3NXL.js';
108
106
  import './chunk-XXA4NZUC.js';
109
107
  export { ClampedText } from './chunk-VU3ZMJBN.js';
110
108
  export { CollabStatus, defaultCollabStatusLabels, useYjsCollabStatus } from './chunk-UY2EZYIC.js';
@@ -134,7 +132,7 @@ export { useMediaTransport } from './chunk-GW4RFJZ5.js';
134
132
  export { useUrlTab } from './chunk-CVNPNZMX.js';
135
133
  import './chunk-7XUN3OQT.js';
136
134
  export { formatPhoneNumber, isPhoneNumberEmpty, isValidPhoneNumber, unformatPhoneNumber } from './chunk-ZVPJ2MH6.js';
137
- export { miewebUIPreset, miewebUISafelist } from './chunk-AK4LHJPC.js';
135
+ export { miewebUIPreset, miewebUISafelist } from './chunk-4JXO5JTE.js';
138
136
  export { Accordion } from './chunk-BHKGVFTY.js';
139
137
  import './chunk-H2Y7HZV5.js';
140
138
  export { AvatarGroup, defaultAvatarGroupLabels } from './chunk-DVDT7TX7.js';
@@ -145,33 +143,40 @@ import { Spinner, SpinnerWithLabel } from './chunk-UA7E7PDS.js';
145
143
  export { FullPageSpinner, Spinner, SpinnerWithLabel, spinnerVariants } from './chunk-UA7E7PDS.js';
146
144
  import { evaluateDue, completedKeys, normalizeOrders } from './chunk-Y5KEFV5O.js';
147
145
  export { buildChartOrderRows, buildEncounterOrderRows, dueForOrder, evaluateDue, evaluateProgram, isApplicable } from './chunk-Y5KEFV5O.js';
148
- import { useCodeLookupConfig, RowActionToolbar, RowIconButton, toolbarKeyNav, parseSig, labelToMedicationFields, MedicationEditor } from './chunk-SFSBYC46.js';
149
- export { ALLERGY_TYPE_LABELS, AllergyList, AllergyManager, CodeLookupProvider, MEDICATION_STATUS_LABELS, MedicationEditor, MedicationList, MedicationReconciliation, RowActionToolbar, RowIconButton, labelToMedicationFields, lookupToMedicationFields, parseMedicationLabel, parseSig, toolbarKeyNav, useCodeLookupConfig } from './chunk-SFSBYC46.js';
146
+ import { parseSig, labelToMedicationFields, MedicationEditor, useCodeLookupConfig } from './chunk-SMPLM6K3.js';
147
+ export { ALLERGY_TYPE_LABELS, AllergyList, AllergyManager, Assessment, CodeLookupProvider, ConditionEditor, DateRangeFilter, DateRangePicker, MEDICATION_STATUS_LABELS, MedicationEditor, MedicationList, MedicationReconciliation, ORDER_TYPE_META, ORDER_TYPE_SEARCH_DOMAINS, calculateDateRange, doseFormToQuantityUnit, getDefaultPresets, getExtendedPresets, isConditionCodetype, labelToMedicationFields, lookupToMedicationFields, normalizeConditionCodingSystem, orderTypeForCodetype, parseMedicationLabel, parseSig, useCodeLookupConfig } from './chunk-SMPLM6K3.js';
148
+ import { currentAssertion, CodingChips, toolbarKeyNav } from './chunk-5LNLB2XT.js';
149
+ export { CHANGE_TYPE_LABELS, CONCERN_STATUS_LABELS, CodingChips, ProblemList, RowActionToolbar, RowIconButton, UncertaintyBadge, concernGroupKey, concernHistoryContent, currentAssertion, toolbarKeyNav } from './chunk-5LNLB2XT.js';
150
150
  import { Tooltip } from './chunk-YFWDS6MX.js';
151
151
  export { Tooltip } from './chunk-YFWDS6MX.js';
152
+ import { ButtonGroup } from './chunk-BBLEGF5L.js';
153
+ export { ButtonGroup } from './chunk-BBLEGF5L.js';
152
154
  import { RadioGroup, Radio } from './chunk-EPSB4WTL.js';
153
155
  export { Radio, RadioGroup, radioVariants } from './chunk-EPSB4WTL.js';
154
156
  import { Label } from './chunk-I3WGZPI6.js';
155
157
  export { Label, labelVariants } from './chunk-I3WGZPI6.js';
156
158
  import { DateInput } from './chunk-I6Y2KLTZ.js';
157
159
  export { DateInput } from './chunk-I6Y2KLTZ.js';
158
- import { Textarea } from './chunk-2VISTX7O.js';
159
- export { TextAreaRich as RichTextArea, TextAreaPlain, TextAreaRich, Textarea, htmlToPlain, plainToHtml, textareaVariants } from './chunk-2VISTX7O.js';
160
- export { MacroLibrary, RichTextEditor, convertAngleBracketsToMustache, processDictation } from './chunk-43QBEF6N.js';
160
+ import { Textarea } from './chunk-3NOVISM6.js';
161
+ export { TextAreaRich as RichTextArea, TextAreaPlain, TextAreaRich, Textarea, htmlToPlain, plainToHtml, textareaVariants } from './chunk-3NOVISM6.js';
162
+ export { MacroLibrary, RichTextEditor, convertAngleBracketsToMustache, processDictation } from './chunk-QR7B6UPR.js';
163
+ import './chunk-5YOT4DVH.js';
161
164
  export { Separator, separatorVariants } from './chunk-OQWZYKJM.js';
162
165
  import { Select } from './chunk-VCI2Y7ST.js';
163
166
  export { Select, selectTriggerVariants } from './chunk-VCI2Y7ST.js';
164
167
  import './chunk-AMYFRY7K.js';
165
- import { Dropdown, DropdownItem, DropdownSeparator, DropdownContent, DropdownHeader } from './chunk-OYUIEJPN.js';
168
+ import { Dropdown, DropdownContent, DropdownItem, DropdownHeader, DropdownSeparator } from './chunk-OYUIEJPN.js';
166
169
  export { Dropdown, DropdownContent, DropdownHeader, DropdownItem, DropdownLabel, DropdownSeparator, DropdownSubmenu } from './chunk-OYUIEJPN.js';
167
170
  import { Card, CardHeader, CardContent, CardTitle } from './chunk-QYSUYB3S.js';
168
171
  export { Card, CardActions, CardBadge, CardCollapsible, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, CardMedia, CardStat, CardTitle, cardAccentVariants, cardVariants } from './chunk-QYSUYB3S.js';
172
+ import { Checkbox } from './chunk-753Z3NXL.js';
173
+ export { Checkbox, CheckboxGroup, checkboxVariants } from './chunk-753Z3NXL.js';
169
174
  import { Modal, ModalHeader, ModalTitle, ModalClose, ModalBody, ModalFooter } from './chunk-TWQSMUE6.js';
170
175
  export { Modal, ModalBody, ModalClose, ModalFooter, ModalHeader, ModalTitle, modalContentVariants, modalOverlayVariants } from './chunk-TWQSMUE6.js';
171
176
  import './chunk-6NZXWKUE.js';
172
177
  import { Input, inputVariants } from './chunk-3IMM2PM4.js';
173
178
  export { Input, RequiredMark, floatingGroupLabelVariants, floatingGroupVariants, floatingLabelVariants, inputVariants } from './chunk-3IMM2PM4.js';
174
- import { useDragReorder, reorderIds, dragIndicatorClasses } from './chunk-YUMOM3KE.js';
179
+ import { useDragReorder, dragIndicatorClasses } from './chunk-YUMOM3KE.js';
175
180
  export { DEFAULT_DRAG_REORDER_LABELS, dragIndicatorClasses, moveIdBy, reorderIds, useDragReorder } from './chunk-YUMOM3KE.js';
176
181
  import { useLiveAnnouncement } from './chunk-HNXLLDPN.js';
177
182
  export { useLiveAnnouncement } from './chunk-HNXLLDPN.js';
@@ -188,11 +193,11 @@ export { calculateAge, dateToDisplayFormat, displayFormatToDateString, formatDat
188
193
  export { isHtmlEmpty, stripHtmlTags } from './chunk-ERLPVXOV.js';
189
194
  import { isStorybookDocsMode } from './chunk-VSQF22GL.js';
190
195
  export { isStorybookDocsMode } from './chunk-VSQF22GL.js';
191
- import { AlertTriangle, Loader2, Plus, RefreshCw, Pencil, GripVertical, Trash2, AlertCircle, ArrowLeft, Users, FilePlus, CheckCircle, ChevronDown, Clock, FileText, ClipboardList, Stethoscope, Mail, Phone, ClipboardCheck, Eye, Info, Link, ChevronUp, History, StickyNote, ExternalLink, MoreVertical, Send, Scan, TestTube2, Pill, Share, User, Download, ChevronRight, Calendar, Printer, ClipboardPlus, FileCheck, Wheat, Bell, FileHeart, HeartPulse, Paperclip, HelpCircle, MoreHorizontal, Settings, Upload as Upload$1, Camera, Check as Check$1, X as X$1, ScanLine, Image } from './chunk-BKSPDTX4.js';
196
+ import { AlertTriangle, Loader2, ArrowLeft, Users, Plus, FilePlus, CheckCircle, ChevronDown, Clock, FileText, ClipboardList, Stethoscope, Mail, Phone, ClipboardCheck, Eye, Info, Share, User, Download, ExternalLink, ChevronRight, MoreVertical, Pencil, Send, Calendar, Printer, ClipboardPlus, FileCheck, Wheat, Pill, Bell, FileHeart, HeartPulse, AlertCircle as AlertCircle$1, Paperclip, GripVertical, MoreHorizontal, Trash2, Settings, Upload as Upload$1, Scan, Camera, Check as Check$1, X as X$1, ScanLine, RefreshCw as RefreshCw$1, Image } from './chunk-BKSPDTX4.js';
192
197
  export { Accessibility as AccessibilityIcon, Activity as ActivityIcon, AlertCircle as AlertCircleIcon, AlertTriangle as AlertTriangleIcon, Wheat as AllergyIcon, WheatOff as AllergyOffIcon, Ambulance as AmbulanceIcon, ArrowLeft as ArrowLeftIcon, ArrowRight as ArrowRightIcon, ArrowUpDown as ArrowUpDownIcon, ArrowUp as ArrowUpIcon, AtSign as AtSignIcon, Baby as BabyIcon, BadgeAlert as BadgeAlertIcon, BadgeCheck as BadgeCheckIcon, BadgeMinus as BadgeMinusIcon, BadgePlus as BadgePlusIcon, BadgeX as BadgeXIcon, Ban as BanIcon, Bandage as BandageIcon, BedDouble as BedDoubleIcon, Bed as BedIcon, BedSingle as BedSingleIcon, Bell as BellIcon, BellOff as BellOffIcon, Biohazard as BiohazardIcon, Bone as BoneIcon, BookOpenCheck as BookOpenCheckIcon, BookOpen as BookOpenIcon, Bookmark as BookmarkIcon, Bot as BotIcon, Brain as BrainIcon, Briefcase as BriefcaseIcon, BriefcaseMedical as BriefcaseMedicalIcon, Building as BuildingIcon, CalendarCheck as CalendarCheckIcon, Calendar as CalendarIcon, Camera as CameraIcon, Cannabis as CannabisIcon, BarChart3 as ChartIcon, CheckCircle as CheckCircleIcon, Check as CheckIcon, ChevronDown as ChevronDownIcon, ChevronLeft as ChevronLeftIcon, ChevronRight as ChevronRightIcon, ChevronUp as ChevronUpIcon, Cigarette as CigaretteIcon, CigaretteOff as CigaretteOffIcon, CircleDotDashed as CircleDotDashedIcon, CircleDot as CircleDotIcon, CircleUser as CircleUserIcon, ClipboardCheck as ClipboardCheckIcon, Clipboard as ClipboardIcon, ClipboardList as ClipboardListIcon, ClipboardPlus as ClipboardPlusIcon, Clock as ClockIcon, Cog as CogIcon, Columns as ColumnsIcon, Copy as CopyIcon, CreditCard as CreditCardIcon, Cross as CrossIcon, Dna as DnaIcon, DollarSign as DollarSignIcon, Download as DownloadIcon, Droplet as DropletIcon, Droplets as DropletsIcon, Ear as EarIcon, ExternalLink as ExternalLinkIcon, Eye as EyeIcon, EyeOff as EyeOffIcon, FileCheck2 as FileCheck2Icon, FileCheck as FileCheckIcon, FileHeart as FileHeartIcon, File as FileIcon, FilePlus2 as FilePlus2Icon, FilePlus as FilePlusIcon, FileText as FileTextIcon, Filter as FilterIcon, Fingerprint as FingerprintIcon, Flag as FlagIcon, FlaskConical as FlaskIcon, FlaskRound as FlaskRoundIcon, Folder as FolderIcon, FolderOpen as FolderOpenIcon, Footprints as FootprintsIcon, Glasses as GlassesIcon, Globe as GlobeIcon, LayoutGrid as GridIcon, GripVertical as GripVerticalIcon, Hand as HandIcon, HandMetal as HandMetalIcon, Hash as HashIcon, Heart as HeartIcon, HeartOff as HeartOffIcon, HeartPulse as HeartPulseIcon, HelpCircle as HelpCircleIcon, History as HistoryIcon, Home as HomeIcon, Hospital as HospitalIcon, Image as ImageIcon, Info as InfoIcon, Key as KeyIcon, Link as LinkIcon, List as ListIcon, Loader2 as LoaderIcon, Lock as LockIcon, LogIn as LogInIcon, LogOut as LogOutIcon, Mail as MailIcon, MapPin as MapPinIcon, Maximize as MaximizeIcon, Menu as MenuIcon, MessageSquare as MessageIcon, Mic as MicIcon, Microscope as MicroscopeIcon, Minimize as MinimizeIcon, Minus as MinusIcon, Monitor as MonitorIcon, Moon as MoonIcon, MoreHorizontal as MoreHorizontalIcon, MoreVertical as MoreVerticalIcon, NotebookPen as NotebookPenIcon, Palette as PaletteIcon, Paperclip as PaperclipIcon, CircleUserRound as PatientIcon, Pencil as PencilIcon, UserRound as PersonIcon, Phone as PhoneIcon, PieChart as PieChartIcon, Pill as PillIcon, Plus as PlusIcon, Printer as PrinterIcon, Radiation as RadiationIcon, Ruler as RulerIcon, Save as SaveIcon, Scale as ScaleIcon, Scaling as ScalingIcon, ScanEye as ScanEyeIcon, Scan as ScanIcon, ScanLine as ScanLineIcon, Search as SearchIcon, Settings as SettingsIcon, Share as ShareIcon, ShieldCheck as ShieldCheckIcon, Shield as ShieldIcon, ShieldPlus as ShieldPlusIcon, Sliders as SlidersIcon, Sparkle as SparkleIcon, Star as StarIcon, Stethoscope as StethoscopeIcon, StickyNote as StickyNoteIcon, Square as StopIcon, Sun as SunIcon, Syringe as SyringeIcon, Table as TableIcon, Tablets as TabletsIcon, Tag as TagIcon, TestTube2 as TestTubeIcon, TestTubes as TestTubesIcon, Thermometer as ThermometerIcon, ThermometerSun as ThermometerSunIcon, ThumbsDown as ThumbsDownIcon, ThumbsUp as ThumbsUpIcon, Timer as TimerIcon, Trash2 as TrashIcon, TrendingDown as TrendingDownIcon, TrendingUp as TrendingUpIcon, Truck as TruckIcon, Unlock as UnlockIcon, Upload as UploadIcon, UserCheck as UserCheckIcon, User as UserIcon, UserMinus as UserMinusIcon, UserPlus as UserPlusIcon, UserRoundCheck as UserRoundCheckIcon, UserRoundMinus as UserRoundMinusIcon, UserRoundPlus as UserRoundPlusIcon, UserRoundX as UserRoundXIcon, Users as UsersIcon, Weight as WeightIcon, Wrench as WrenchIcon, XCircle as XCircleIcon, X2 as XIcon, Zap as ZapIcon } from './chunk-BKSPDTX4.js';
193
198
  import { usePrefersReducedMotion } from './chunk-XDU65GLW.js';
194
199
  export { usePrefersReducedMotion } from './chunk-XDU65GLW.js';
195
- import { isRtl, useDirection } from './chunk-YVKBXNPK.js';
200
+ import { useDirection } from './chunk-YVKBXNPK.js';
196
201
  export { RTL_LOCALES, isRtl, isRtlLocale, useDirection } from './chunk-YVKBXNPK.js';
197
202
  import { Badge } from './chunk-522WJIVI.js';
198
203
  export { Badge, badgeVariants } from './chunk-522WJIVI.js';
@@ -211,7 +216,7 @@ import * as React13 from 'react';
211
216
  import React13__default, { createContext, useState, useEffect, useCallback, useMemo, useContext, useRef, useId } from 'react';
212
217
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
213
218
  import { cva } from 'class-variance-authority';
214
- import { AudioWaveform, FileUp, X, AlertCircle as AlertCircle$1, Calendar as Calendar$1, ChevronLeft, ChevronRight as ChevronRight$1, ChevronDown as ChevronDown$1, Maximize2, Minimize2, FolderUp, Upload, Edit2, Check, ChevronUp as ChevronUp$1, Phone as Phone$1, Mail as Mail$1, Clock as Clock$1, MapPin, Shield, Building2, SlidersHorizontal, Trash2 as Trash2$1, Pencil as Pencil$1, Plus as Plus$1, ExternalLink as ExternalLink$1, Link as Link$1, AlertTriangle as AlertTriangle$1, RefreshCw as RefreshCw$1 } from 'lucide-react';
219
+ import { AudioWaveform, FileUp, X, AlertCircle, Maximize2, Minimize2, FolderUp, Upload, Edit2, Check, ChevronUp, ChevronDown as ChevronDown$1, Calendar as Calendar$1, Phone as Phone$1, Mail as Mail$1, Clock as Clock$1, MapPin, Shield, ChevronRight as ChevronRight$1, Building2, SlidersHorizontal, Trash2 as Trash2$1, Pencil as Pencil$1, Plus as Plus$1, ExternalLink as ExternalLink$1, Link, AlertTriangle as AlertTriangle$1, RefreshCw } from 'lucide-react';
215
220
  import * as ReactDOM from 'react-dom';
216
221
  import { createPortal } from 'react-dom';
217
222
 
@@ -6767,1515 +6772,6 @@ function AppHeaderUserMenu({
6767
6772
  }
6768
6773
  );
6769
6774
  }
6770
- var GROUP_ORDER = [
6771
- {
6772
- key: "active",
6773
- label: "Active",
6774
- statuses: ["active", "recurrence", "relapse"]
6775
- },
6776
- { key: "inactive", label: "Inactive", statuses: ["inactive", "remission"] },
6777
- { key: "resolved", label: "Resolved", statuses: ["resolved"] }
6778
- ];
6779
- function concernGroupKey(concern) {
6780
- if (currentAssertion(concern)?.verificationStatus === "unconfirmed") {
6781
- return "unconfirmed";
6782
- }
6783
- return GROUP_ORDER.find((g) => g.statuses.includes(concern.clinicalStatus))?.key ?? "active";
6784
- }
6785
- var CONCERN_STATUS_LABELS = {
6786
- active: "Active",
6787
- recurrence: "Recurrence",
6788
- relapse: "Relapse",
6789
- inactive: "Inactive",
6790
- remission: "Remission",
6791
- resolved: "Resolved"
6792
- };
6793
- var CHANGE_TYPE_LABELS = {
6794
- refinement: "Refined",
6795
- revision: "Revised",
6796
- progression: "Progressed",
6797
- reattribution: "Re-attributed"
6798
- };
6799
- var DEFAULT_ACTIONS = [
6800
- "open",
6801
- "observe",
6802
- "refine",
6803
- "revise",
6804
- "resolve",
6805
- "relate",
6806
- "move-up",
6807
- "move-down"
6808
- ];
6809
- var ACTION_META = {
6810
- open: { label: "Open", icon: ExternalLink },
6811
- observe: { label: "Add observation (progress note)", icon: StickyNote },
6812
- refine: { label: "Refine (more specific)", icon: Pencil },
6813
- revise: { label: "Revise (prior was wrong)", icon: RefreshCw },
6814
- resolve: { label: "Resolve", icon: CheckCircle },
6815
- relate: { label: "Relate to another problem", icon: Link },
6816
- "move-up": { label: "Move up (Alt+\u2191)", icon: ChevronUp },
6817
- "move-down": { label: "Move down (Alt+\u2193)", icon: ChevronDown }
6818
- };
6819
- var VERIFICATION_BADGE = {
6820
- unconfirmed: { label: "Unconfirmed", variant: "outline" },
6821
- provisional: { label: "Provisional", variant: "warning" },
6822
- differential: { label: "Differential", variant: "warning" },
6823
- confirmed: { label: "Confirmed", variant: "success" },
6824
- refuted: { label: "Refuted", variant: "secondary" },
6825
- "entered-in-error": { label: "Entered in error", variant: "secondary" }
6826
- };
6827
- function currentAssertion(concern) {
6828
- for (let i = concern.assertions.length - 1; i >= 0; i--) {
6829
- const a = concern.assertions[i];
6830
- if (a.verificationStatus !== "refuted" && a.verificationStatus !== "entered-in-error") {
6831
- return a;
6832
- }
6833
- }
6834
- return concern.assertions[concern.assertions.length - 1];
6835
- }
6836
- var UNCERTAIN_FIELD_LABELS = {
6837
- coding: "Coding",
6838
- onset: "Onset",
6839
- severity: "Severity",
6840
- laterality: "Laterality",
6841
- bodySite: "Body site"
6842
- };
6843
- function describeFieldUncertainty(field, f) {
6844
- const label = UNCERTAIN_FIELD_LABELS[field];
6845
- if (!f.known) {
6846
- const reason = f.reason === "asked-unknown" ? "asked \u2014 unknown" : (f.reason ?? "unknown").replace(/-/g, " ");
6847
- return `${label}: ${reason}${f.note ? ` (${f.note})` : ""}`;
6848
- }
6849
- return `${label}: ${f.confidence ?? "uncertain"} confidence${f.note ? ` (${f.note})` : ""}`;
6850
- }
6851
- function CodingChips({ coding }) {
6852
- if (!coding?.length) return null;
6853
- const icd = coding.filter((c) => c.system.startsWith("ICD"));
6854
- const inline = icd.length > 0 ? icd : coding.filter((c) => c.primary);
6855
- const label = inline.map((c) => c.code).join(", ");
6856
- return /* @__PURE__ */ jsx(
6857
- Tooltip,
6858
- {
6859
- content: /* @__PURE__ */ jsx("span", { className: "flex flex-col gap-0.5", children: coding.map((c) => /* @__PURE__ */ jsxs("span", { children: [
6860
- c.system,
6861
- " ",
6862
- c.code,
6863
- c.display ? ` \u2014 ${c.display}` : "",
6864
- c.primary ? " \xB7 primary" : "",
6865
- c.mappedFrom ? ` \xB7 mapped from ${c.mappedFrom}` : ""
6866
- ] }, `${c.system}:${c.code}`)) }),
6867
- children: /* @__PURE__ */ jsxs(
6868
- "span",
6869
- {
6870
- tabIndex: 0,
6871
- className: "text-muted-foreground focus-visible:ring-ring rounded text-xs whitespace-nowrap focus-visible:ring-2 focus-visible:outline-none",
6872
- children: [
6873
- "(",
6874
- label || "coded",
6875
- ")"
6876
- ]
6877
- }
6878
- )
6879
- }
6880
- );
6881
- }
6882
- function concernHistoryContent(concern) {
6883
- return /* @__PURE__ */ jsxs("span", { className: "flex max-w-xs flex-col gap-1", children: [
6884
- /* @__PURE__ */ jsx("span", { className: "font-semibold", children: "History" }),
6885
- [...concern.assertions].reverse().map((a) => /* @__PURE__ */ jsxs("span", { children: [
6886
- a.date,
6887
- " \u2014 ",
6888
- a.text,
6889
- a.changeType ? ` (${CHANGE_TYPE_LABELS[a.changeType].toLowerCase()})` : "",
6890
- a.verificationStatus === "refuted" ? " \u2014 refuted" : ""
6891
- ] }, a.id)),
6892
- concern.observations && concern.observations.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
6893
- /* @__PURE__ */ jsx("span", { className: "mt-1 font-semibold", children: "Observations" }),
6894
- [...concern.observations].reverse().slice(0, 3).map((o) => /* @__PURE__ */ jsxs("span", { children: [
6895
- o.date,
6896
- " \u2014 ",
6897
- o.text
6898
- ] }, o.id))
6899
- ] }),
6900
- (currentAssertion(concern)?.coding?.length ?? 0) > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
6901
- /* @__PURE__ */ jsx("span", { className: "mt-1 font-semibold", children: "Coding" }),
6902
- currentAssertion(concern).coding.map((c) => /* @__PURE__ */ jsxs("span", { children: [
6903
- c.system,
6904
- " ",
6905
- c.code,
6906
- c.display ? ` \u2014 ${c.display}` : ""
6907
- ] }, `${c.system}:${c.code}`))
6908
- ] })
6909
- ] });
6910
- }
6911
- function UncertaintyBadge({
6912
- uncertainty
6913
- }) {
6914
- if (!uncertainty) return null;
6915
- const fieldEntries = Object.entries(uncertainty.fields ?? {});
6916
- const overall = uncertainty.overall && uncertainty.overall !== "confirmed" ? uncertainty.overall : null;
6917
- if (!overall && fieldEntries.length === 0) return null;
6918
- const lines = [
6919
- ...overall ? [`Overall certainty: ${overall}`] : [],
6920
- ...fieldEntries.map(([field, f]) => describeFieldUncertainty(field, f))
6921
- ];
6922
- return /* @__PURE__ */ jsx(Tooltip, { content: lines.join(" \xB7 "), children: /* @__PURE__ */ jsxs(Badge, { variant: "warning", size: "sm", className: "gap-1", children: [
6923
- /* @__PURE__ */ jsx(HelpCircle, { size: 10 }),
6924
- overall ? `${overall} certainty` : `${fieldEntries.length} uncertain`
6925
- ] }) });
6926
- }
6927
- function AssertionTimeline({ concern }) {
6928
- const items = [...concern.assertions].reverse();
6929
- return /* @__PURE__ */ jsx(
6930
- "ol",
6931
- {
6932
- "aria-label": "Assertion history",
6933
- className: "border-border ms-1.5 mt-2 space-y-2 border-s ps-4",
6934
- children: items.map((a) => {
6935
- const refuted = a.verificationStatus === "refuted" || a.verificationStatus === "entered-in-error";
6936
- const verification = VERIFICATION_BADGE[a.verificationStatus];
6937
- return /* @__PURE__ */ jsxs("li", { className: "relative text-sm", children: [
6938
- /* @__PURE__ */ jsx(
6939
- "span",
6940
- {
6941
- "aria-hidden": true,
6942
- className: "bg-border absolute -start-5 top-1.5 h-2 w-2 rounded-full"
6943
- }
6944
- ),
6945
- /* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
6946
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs tabular-nums", children: a.date }),
6947
- /* @__PURE__ */ jsx(
6948
- "span",
6949
- {
6950
- className: cn(
6951
- "text-foreground font-medium",
6952
- refuted && "text-muted-foreground line-through"
6953
- ),
6954
- children: a.text
6955
- }
6956
- ),
6957
- a.changeType && /* @__PURE__ */ jsx(Badge, { variant: "secondary", size: "sm", children: CHANGE_TYPE_LABELS[a.changeType] }),
6958
- /* @__PURE__ */ jsx(Badge, { variant: verification.variant, size: "sm", children: verification.label }),
6959
- /* @__PURE__ */ jsx(UncertaintyBadge, { uncertainty: a.uncertainty }),
6960
- /* @__PURE__ */ jsx(CodingChips, { coding: a.coding })
6961
- ] }),
6962
- a.note && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-0.5 text-xs", children: a.note })
6963
- ] }, a.id);
6964
- })
6965
- }
6966
- );
6967
- }
6968
- function ConcernRow({
6969
- concern,
6970
- actions,
6971
- readOnly,
6972
- canReorder,
6973
- drag,
6974
- onAction
6975
- }) {
6976
- const [expanded, setExpanded] = React13.useState(false);
6977
- const current = currentAssertion(concern);
6978
- const hasHistory = concern.assertions.length > 1;
6979
- const visibleActions = actions.filter(
6980
- (a) => canReorder || a !== "move-up" && a !== "move-down"
6981
- );
6982
- const handleRowKeyDown = (e) => {
6983
- if (e.target !== e.currentTarget) return;
6984
- if (e.altKey && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
6985
- if (!canReorder) return;
6986
- e.preventDefault();
6987
- onAction?.(concern, e.key === "ArrowUp" ? "move-up" : "move-down");
6988
- } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
6989
- e.preventDefault();
6990
- const list = e.currentTarget.closest("ul");
6991
- if (!list) return;
6992
- const rows = Array.from(
6993
- list.querySelectorAll("li[data-concern-id]")
6994
- );
6995
- const i = rows.indexOf(e.currentTarget);
6996
- rows[e.key === "ArrowUp" ? Math.max(0, i - 1) : Math.min(rows.length - 1, i + 1)]?.focus();
6997
- } else if ((e.key === "Enter" || e.key === " ") && hasHistory) {
6998
- e.preventDefault();
6999
- setExpanded((v) => !v);
7000
- }
7001
- };
7002
- if (!current) return null;
7003
- return (
7004
- // Roving-focus row (WAI-ARIA listbox-like keyboard pattern): the row is a
7005
- // legitimate focus stop so ↑/↓ navigate rows, Enter toggles history, and
7006
- // Alt+↑/↓ reorders — required for 508 keyboard operability.
7007
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-noninteractive-tabindex */
7008
- /* @__PURE__ */ jsxs(
7009
- "li",
7010
- {
7011
- "data-slot": "clinical-list-row",
7012
- "data-concern-id": concern.concernId,
7013
- tabIndex: 0,
7014
- onKeyDown: handleRowKeyDown,
7015
- ...drag.rowProps(concern.concernId),
7016
- "aria-label": `${current.text}. ${hasHistory ? "Press Enter to toggle history. " : ""}${canReorder ? "Alt plus arrow keys to reorder." : ""}`,
7017
- className: cn(
7018
- "group border-border/60 relative border-b px-1 py-2",
7019
- "focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none",
7020
- drag.enabled && "cursor-grab active:cursor-grabbing",
7021
- dragIndicatorClasses(drag, concern.concernId)
7022
- ),
7023
- children: [
7024
- /* @__PURE__ */ jsxs("div", { className: "flex min-h-9 flex-wrap items-center gap-x-2 gap-y-1", children: [
7025
- drag.enabled ? /* @__PURE__ */ jsx(
7026
- GripVertical,
7027
- {
7028
- size: 14,
7029
- "aria-hidden": true,
7030
- className: "text-muted-foreground/50 shrink-0"
7031
- }
7032
- ) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60 select-none", children: "\u2022" }),
7033
- /* @__PURE__ */ jsx(Tooltip, { content: concernHistoryContent(concern), children: /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: current.text }) }),
7034
- /* @__PURE__ */ jsx(CodingChips, { coding: current.coding }),
7035
- current.verificationStatus !== "confirmed" && current.verificationStatus !== "unconfirmed" && /* @__PURE__ */ jsx(
7036
- Badge,
7037
- {
7038
- variant: VERIFICATION_BADGE[current.verificationStatus].variant,
7039
- size: "sm",
7040
- children: VERIFICATION_BADGE[current.verificationStatus].label
7041
- }
7042
- ),
7043
- /* @__PURE__ */ jsx(UncertaintyBadge, { uncertainty: current.uncertainty }),
7044
- concern.relationships?.map((r) => /* @__PURE__ */ jsxs(Badge, { variant: "outline", size: "sm", children: [
7045
- /* @__PURE__ */ jsx(Link, { size: 10, className: "me-1" }),
7046
- r.type.replace(/-/g, " "),
7047
- r.display ? `: ${r.display}` : ""
7048
- ] }, `${r.type}:${r.concernId}`)),
7049
- hasHistory && /* @__PURE__ */ jsxs(
7050
- Button,
7051
- {
7052
- variant: "ghost",
7053
- size: "sm",
7054
- onClick: () => setExpanded((v) => !v),
7055
- "aria-expanded": expanded,
7056
- leftIcon: /* @__PURE__ */ jsx(History, { size: 12 }),
7057
- rightIcon: expanded ? /* @__PURE__ */ jsx(ChevronUp, { size: 12 }) : /* @__PURE__ */ jsx(ChevronDown, { size: 12 }),
7058
- className: "text-muted-foreground h-auto px-1.5 py-0.5 text-xs",
7059
- children: [
7060
- concern.assertions.length,
7061
- " assertions"
7062
- ]
7063
- }
7064
- ),
7065
- !readOnly && /* @__PURE__ */ jsx(RowActionToolbar, { label: `Actions for ${current.text}`, align: "top", children: visibleActions.map((action) => /* @__PURE__ */ jsx(
7066
- RowIconButton,
7067
- {
7068
- label: ACTION_META[action].label,
7069
- icon: ACTION_META[action].icon,
7070
- onClick: () => onAction?.(concern, action)
7071
- },
7072
- action
7073
- )) })
7074
- ] }),
7075
- expanded && /* @__PURE__ */ jsxs(Fragment, { children: [
7076
- /* @__PURE__ */ jsx(AssertionTimeline, { concern }),
7077
- concern.observations && concern.observations.length > 0 && /* @__PURE__ */ jsxs("div", { className: "ms-1.5 mt-2 ps-4", children: [
7078
- /* @__PURE__ */ jsx("h5", { className: "text-muted-foreground text-xs font-semibold tracking-wide uppercase", children: "Observations" }),
7079
- /* @__PURE__ */ jsx("ol", { "aria-label": "Observations", className: "mt-1 space-y-1", children: [...concern.observations].reverse().map((o) => /* @__PURE__ */ jsxs("li", { className: "flex flex-wrap gap-x-2 text-sm", children: [
7080
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs tabular-nums", children: o.date }),
7081
- /* @__PURE__ */ jsx("span", { className: "text-foreground", children: o.text }),
7082
- o.author && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
7083
- "\u2014 ",
7084
- o.author
7085
- ] })
7086
- ] }, o.id)) })
7087
- ] })
7088
- ] })
7089
- ]
7090
- }
7091
- )
7092
- );
7093
- }
7094
- var ProblemList = React13.forwardRef(
7095
- ({
7096
- concerns,
7097
- title = "Problem list",
7098
- onAction,
7099
- onAddProblem,
7100
- onReorder,
7101
- actions = DEFAULT_ACTIONS,
7102
- readOnly = false,
7103
- emptyMessage = "No problems recorded.",
7104
- className,
7105
- "data-testid": dataTestId,
7106
- ...props
7107
- }, ref) => {
7108
- const [draft, setDraft] = React13.useState("");
7109
- const [announcement, setAnnouncement] = useLiveAnnouncement();
7110
- const submitDraft = () => {
7111
- const text = draft.trim();
7112
- if (!text) return;
7113
- onAddProblem?.(text);
7114
- setDraft("");
7115
- };
7116
- const moveConcern = React13.useCallback(
7117
- (concern, dir) => {
7118
- if (!onReorder || readOnly) return;
7119
- const groupKey = concernGroupKey(concern);
7120
- const ids = concerns.map((c) => c.concernId);
7121
- const from = ids.indexOf(concern.concernId);
7122
- let to = from + dir;
7123
- while (to >= 0 && to < concerns.length && concernGroupKey(concerns[to]) !== groupKey) {
7124
- to += dir;
7125
- }
7126
- if (to < 0 || to >= concerns.length) return;
7127
- [ids[from], ids[to]] = [ids[to], ids[from]];
7128
- const current = currentAssertion(concern);
7129
- setAnnouncement(
7130
- `${current?.text ?? concern.concernId} moved ${dir === -1 ? "up" : "down"}`
7131
- );
7132
- onReorder(ids);
7133
- },
7134
- [concerns, onReorder, readOnly, setAnnouncement]
7135
- );
7136
- const handleAction = React13.useCallback(
7137
- (concern, action) => {
7138
- if (action === "move-up") moveConcern(concern, -1);
7139
- else if (action === "move-down") moveConcern(concern, 1);
7140
- else onAction?.(concern, action);
7141
- },
7142
- [moveConcern, onAction]
7143
- );
7144
- const groupById = React13.useMemo(
7145
- () => new Map(
7146
- concerns.map((c) => [c.concernId, concernGroupKey(c)])
7147
- ),
7148
- [concerns]
7149
- );
7150
- const groupOf = React13.useCallback(
7151
- (id) => groupById.get(id),
7152
- [groupById]
7153
- );
7154
- const drag = useDragReorder({
7155
- ids: concerns.map((c) => c.concernId),
7156
- onReorder: readOnly || !onReorder ? void 0 : (newIds) => {
7157
- setAnnouncement("Problem list reordered");
7158
- onReorder(newIds);
7159
- },
7160
- canDropOn: (dragged, target) => groupOf(dragged) === groupOf(target)
7161
- });
7162
- const groups = [
7163
- {
7164
- key: "unconfirmed",
7165
- label: "Unconfirmed",
7166
- items: concerns.filter((c) => concernGroupKey(c) === "unconfirmed")
7167
- },
7168
- ...GROUP_ORDER.map(({ key, label }) => ({
7169
- key,
7170
- label,
7171
- items: concerns.filter((c) => concernGroupKey(c) === key)
7172
- }))
7173
- // Active stays visible as the empty state only when nothing is recorded
7174
- // at all — an empty Active section next to populated groups would
7175
- // misleadingly read "No problems recorded".
7176
- ].filter(
7177
- (g) => g.items.length > 0 || g.key === "active" && concerns.length === 0
7178
- );
7179
- return /* @__PURE__ */ jsxs(
7180
- Card,
7181
- {
7182
- ref,
7183
- padding: "none",
7184
- className: cn("w-full", className),
7185
- "data-testid": dataTestId,
7186
- ...props,
7187
- children: [
7188
- title !== null && /* @__PURE__ */ jsx(CardHeader, { className: "border-border bg-muted/50 border-b px-4 py-3", children: /* @__PURE__ */ jsx("h3", { className: "text-foreground text-sm font-semibold tracking-wide uppercase", children: title }) }),
7189
- /* @__PURE__ */ jsxs(CardContent, { className: "space-y-6 px-4 py-4", children: [
7190
- groups.map(({ key, label, items }) => /* @__PURE__ */ jsxs("section", { "aria-label": label, children: [
7191
- /* @__PURE__ */ jsx(
7192
- "h4",
7193
- {
7194
- "data-slot": "clinical-list-heading",
7195
- className: "border-border text-foreground border-b pb-1 text-sm font-semibold tracking-wide uppercase",
7196
- children: label
7197
- }
7198
- ),
7199
- items.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "mt-1", children: items.map((concern) => /* @__PURE__ */ jsx(
7200
- ConcernRow,
7201
- {
7202
- concern,
7203
- actions,
7204
- readOnly,
7205
- canReorder: drag.enabled,
7206
- drag,
7207
- onAction: handleAction
7208
- },
7209
- concern.concernId
7210
- )) }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-2 text-sm", children: emptyMessage })
7211
- ] }, key)),
7212
- !readOnly && onAddProblem && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
7213
- /* @__PURE__ */ jsx(
7214
- "input",
7215
- {
7216
- type: "text",
7217
- "data-slot": "input",
7218
- value: draft,
7219
- onChange: (e) => setDraft(e.target.value),
7220
- onKeyDown: (e) => {
7221
- if (e.key === "Enter") submitDraft();
7222
- },
7223
- placeholder: "Add problem (name is enough)\u2026",
7224
- "aria-label": "Add problem",
7225
- className: cn(
7226
- "border-border bg-background text-foreground placeholder:text-muted-foreground",
7227
- "h-8 flex-1 rounded-md border px-2.5 text-sm",
7228
- "focus:ring-ring focus:ring-2 focus:outline-none"
7229
- )
7230
- }
7231
- ),
7232
- /* @__PURE__ */ jsx(
7233
- Button,
7234
- {
7235
- variant: "outline",
7236
- size: "sm",
7237
- onClick: submitDraft,
7238
- disabled: !draft.trim(),
7239
- leftIcon: /* @__PURE__ */ jsx(Plus, { size: 12 }),
7240
- className: "h-8",
7241
- children: "Add"
7242
- }
7243
- )
7244
- ] })
7245
- ] }),
7246
- /* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "sr-only", children: announcement })
7247
- ]
7248
- }
7249
- );
7250
- }
7251
- );
7252
- ProblemList.displayName = "ProblemList";
7253
- function orderTypeForCodetype(codetype) {
7254
- const ct = codetype.toUpperCase();
7255
- if (["RXNORM", "FDB", "FDB MEDNAME", "NDC", "CVX"].includes(ct)) {
7256
- return "medication";
7257
- }
7258
- if (ct.startsWith("LOINC") || ct.endsWith("ORDER")) return "lab";
7259
- return "procedure";
7260
- }
7261
- function contextOrderSearch(ctx) {
7262
- const ContextOrderSearch = ({
7263
- domains,
7264
- preferDomains,
7265
- preferCodetypes,
7266
- billableOnly,
7267
- placeholder,
7268
- onPick,
7269
- onFreeText
7270
- }) => {
7271
- const Lookup = ctx.component;
7272
- return /* @__PURE__ */ jsx(
7273
- Lookup,
7274
- {
7275
- indexUrl: ctx.indexUrl,
7276
- locale: ctx.locale,
7277
- domains,
7278
- preferDomains,
7279
- preferCodetypes,
7280
- billableOnly,
7281
- bare: true,
7282
- clearOnSelect: true,
7283
- placeholder,
7284
- onSelect: (result) => onPick({
7285
- fullid: result.fullid,
7286
- label: result.label,
7287
- codetype: result.codetype,
7288
- fullcode: result.fullcode
7289
- }),
7290
- onFreeText
7291
- }
7292
- );
7293
- };
7294
- return ContextOrderSearch;
7295
- }
7296
- function isConditionCodetype(codetype) {
7297
- const ct = codetype.toUpperCase();
7298
- return ct === "ICD10" || ct === "ICD9" || ct === "SNOMED US" || ct === "OSHA" || ct === "FMCSA" || ct === "NFPA" || ct === "FAA";
7299
- }
7300
- var ORDER_TYPE_SEARCH_DOMAINS = {
7301
- medication: ["med", "vaccine"],
7302
- lab: ["lab"],
7303
- imaging: ["procedure"],
7304
- procedure: ["procedure"],
7305
- referral: ["procedure"]
7306
- };
7307
- var ORDER_TYPE_PLACEHOLDERS = {
7308
- auto: "Search medications, labs, imaging, procedures\u2026",
7309
- medication: 'Search medications\u2026 (try "lasix")',
7310
- lab: 'Search labs\u2026 (try "a1c")',
7311
- imaging: 'Search imaging\u2026 (try "chest x")',
7312
- procedure: "Search procedures\u2026",
7313
- referral: "Search referrals & consults\u2026"
7314
- };
7315
- var ORDER_TYPE_META = {
7316
- medication: { label: "Medication", icon: Pill },
7317
- lab: { label: "Lab", icon: TestTube2 },
7318
- imaging: { label: "Imaging", icon: Scan },
7319
- procedure: { label: "Procedure", icon: Stethoscope },
7320
- referral: { label: "Referral", icon: Send }
7321
- };
7322
- var ACTION_META2 = {
7323
- refine: { label: "Refine (more specific)", icon: Pencil },
7324
- revise: { label: "Revise (prior was wrong)", icon: RefreshCw },
7325
- "add-order": { label: "Add order", icon: Plus }
7326
- };
7327
- function OrderContent({ order }) {
7328
- const meta = ORDER_TYPE_META[order.type];
7329
- const Icon = meta.icon;
7330
- return /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [
7331
- /* @__PURE__ */ jsx(Tooltip, { content: meta.label, children: /* @__PURE__ */ jsx(Icon, { size: 14 }) }),
7332
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: meta.label }),
7333
- /* @__PURE__ */ jsx("span", { className: "text-foreground", children: order.display }),
7334
- order.priority && order.priority !== "routine" && /* @__PURE__ */ jsx(
7335
- Badge,
7336
- {
7337
- variant: order.priority === "stat" ? "danger" : "warning",
7338
- size: "sm",
7339
- children: order.priority
7340
- }
7341
- ),
7342
- order.detail && /* @__PURE__ */ jsx("span", { className: "text-xs", children: order.detail }),
7343
- order.timing && /* @__PURE__ */ jsx("span", { className: "text-xs", children: order.timing })
7344
- ] });
7345
- }
7346
- function OrderRow({
7347
- order,
7348
- drag,
7349
- controls
7350
- }) {
7351
- const interactive = Boolean(
7352
- controls?.moveWithin || controls?.moveToProblem || controls?.edit || controls?.editStart || controls?.remove
7353
- );
7354
- const canEdit = Boolean(controls?.edit || controls?.editStart);
7355
- const [editing, setEditing] = React13.useState(null);
7356
- const [menuOpen, setMenuOpen] = React13.useState(false);
7357
- const pick = (fn) => () => {
7358
- setMenuOpen(false);
7359
- fn();
7360
- };
7361
- const beginEdit = () => {
7362
- if (controls?.editStart?.(order)) return;
7363
- if (controls?.edit) {
7364
- setEditing({ display: order.display, detail: order.detail ?? "" });
7365
- }
7366
- };
7367
- const saveEdit = () => {
7368
- if (!editing) return;
7369
- const display = editing.display.trim();
7370
- if (display) {
7371
- controls?.edit?.(order, {
7372
- display,
7373
- detail: editing.detail.trim() || void 0
7374
- });
7375
- }
7376
- setEditing(null);
7377
- };
7378
- const handleKeyDown = (e) => {
7379
- if (e.target !== e.currentTarget || !controls) return;
7380
- if (e.altKey && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
7381
- e.preventDefault();
7382
- controls.moveWithin?.(order, e.key === "ArrowUp" ? -1 : 1);
7383
- } else if (e.altKey && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
7384
- e.preventDefault();
7385
- const back = isRtl(e.currentTarget) ? "ArrowRight" : "ArrowLeft";
7386
- const adj = controls.adjacentProblem(order, e.key === back ? -1 : 1);
7387
- if (adj) controls.moveToProblem?.(order, adj.concernId);
7388
- } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
7389
- e.preventDefault();
7390
- const list = e.currentTarget.closest("ul");
7391
- if (!list) return;
7392
- const rows = Array.from(
7393
- list.querySelectorAll("li[data-order-id]")
7394
- );
7395
- const i = rows.indexOf(e.currentTarget);
7396
- rows[e.key === "ArrowUp" ? Math.max(0, i - 1) : Math.min(rows.length - 1, i + 1)]?.focus();
7397
- }
7398
- };
7399
- return (
7400
- // Order rows are focus stops so the drag interactions have a full keyboard
7401
- // equivalent: Alt+↑/↓ reorders, Alt+←/→ moves between problems (508).
7402
- /* @__PURE__ */ jsxs(
7403
- "li",
7404
- {
7405
- "data-order-id": order.orderId,
7406
- tabIndex: interactive && !editing ? 0 : void 0,
7407
- onKeyDown: interactive && !editing ? handleKeyDown : void 0,
7408
- "aria-label": interactive && !editing ? `${order.display}. Alt plus up or down to reorder; Alt plus left or right to move to another problem.` : void 0,
7409
- ...editing ? {} : drag.rowProps(order),
7410
- className: cn(
7411
- "group/order relative flex items-center gap-1.5 py-1",
7412
- "focus-visible:ring-ring rounded focus-visible:ring-2 focus-visible:outline-none",
7413
- drag.enabled && !editing && "cursor-grab active:cursor-grabbing",
7414
- drag.draggingId === order.orderId && "opacity-40",
7415
- drag.over?.type === "order" && drag.over.id === order.orderId && (drag.over.after ? "shadow-[inset_0_-2px_0_0_var(--color-primary-500,#3b82f6)]" : "shadow-[inset_0_2px_0_0_var(--color-primary-500,#3b82f6)]")
7416
- ),
7417
- children: [
7418
- drag.enabled && !editing && /* @__PURE__ */ jsx(
7419
- GripVertical,
7420
- {
7421
- size: 12,
7422
- "aria-hidden": true,
7423
- className: "text-muted-foreground/40 shrink-0"
7424
- }
7425
- ),
7426
- editing ? /* @__PURE__ */ jsxs(
7427
- "div",
7428
- {
7429
- role: "form",
7430
- "aria-label": `Edit order ${order.display}`,
7431
- className: "flex flex-1 flex-wrap items-center gap-1.5",
7432
- children: [
7433
- /* @__PURE__ */ jsx("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx(
7434
- Input,
7435
- {
7436
- autoFocus: true,
7437
- size: "sm",
7438
- value: editing.display,
7439
- onChange: (e) => setEditing(
7440
- (prev) => prev ? { ...prev, display: e.target.value } : prev
7441
- ),
7442
- onKeyDown: (e) => {
7443
- if (e.key === "Enter") saveEdit();
7444
- else if (e.key === "Escape") setEditing(null);
7445
- },
7446
- "aria-label": "Order description",
7447
- className: "h-7"
7448
- }
7449
- ) }),
7450
- /* @__PURE__ */ jsx("div", { className: "w-40", children: /* @__PURE__ */ jsx(
7451
- Input,
7452
- {
7453
- size: "sm",
7454
- value: editing.detail,
7455
- onChange: (e) => setEditing(
7456
- (prev) => prev ? { ...prev, detail: e.target.value } : prev
7457
- ),
7458
- onKeyDown: (e) => {
7459
- if (e.key === "Enter") saveEdit();
7460
- else if (e.key === "Escape") setEditing(null);
7461
- },
7462
- placeholder: "detail (sig, timing\u2026)",
7463
- "aria-label": "Order detail",
7464
- className: "h-7 text-xs"
7465
- }
7466
- ) }),
7467
- /* @__PURE__ */ jsx(
7468
- Button,
7469
- {
7470
- variant: "outline",
7471
- size: "sm",
7472
- onClick: saveEdit,
7473
- disabled: !editing.display.trim(),
7474
- className: "h-7 text-xs",
7475
- children: "Save"
7476
- }
7477
- ),
7478
- /* @__PURE__ */ jsx(
7479
- Button,
7480
- {
7481
- variant: "ghost",
7482
- size: "sm",
7483
- onClick: () => setEditing(null),
7484
- className: "h-7 text-xs",
7485
- children: "Cancel"
7486
- }
7487
- )
7488
- ]
7489
- }
7490
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
7491
- /* @__PURE__ */ jsx(OrderContent, { order }),
7492
- interactive && /* @__PURE__ */ jsxs(
7493
- RowActionToolbar,
7494
- {
7495
- label: `Actions for ${order.display}`,
7496
- group: "order",
7497
- children: [
7498
- canEdit && /* @__PURE__ */ jsx(
7499
- RowIconButton,
7500
- {
7501
- label: "Edit",
7502
- icon: Pencil,
7503
- size: "sm",
7504
- onClick: beginEdit
7505
- }
7506
- ),
7507
- (controls?.moveWithin || controls?.moveToProblem && controls.targets.some(
7508
- (t) => t.concernId !== order.concernId
7509
- )) && /* @__PURE__ */ jsxs(
7510
- Dropdown,
7511
- {
7512
- open: menuOpen,
7513
- onOpenChange: setMenuOpen,
7514
- trigger: /* @__PURE__ */ jsx(
7515
- Button,
7516
- {
7517
- variant: "ghost",
7518
- size: "icon",
7519
- "aria-label": `Move ${order.display}`,
7520
- className: "h-7 w-7 shrink-0",
7521
- children: /* @__PURE__ */ jsx(MoreVertical, { size: 14 })
7522
- }
7523
- ),
7524
- placement: "bottom-end",
7525
- children: [
7526
- controls?.moveWithin && /* @__PURE__ */ jsxs(Fragment, { children: [
7527
- /* @__PURE__ */ jsx(
7528
- DropdownItem,
7529
- {
7530
- icon: /* @__PURE__ */ jsx(ChevronUp, { size: 14 }),
7531
- onClick: pick(() => controls.moveWithin?.(order, -1)),
7532
- children: "Move up"
7533
- }
7534
- ),
7535
- /* @__PURE__ */ jsx(
7536
- DropdownItem,
7537
- {
7538
- icon: /* @__PURE__ */ jsx(ChevronDown, { size: 14 }),
7539
- onClick: pick(() => controls.moveWithin?.(order, 1)),
7540
- children: "Move down"
7541
- }
7542
- )
7543
- ] }),
7544
- controls?.moveToProblem && controls.targets.some(
7545
- (t) => t.concernId !== order.concernId
7546
- ) && /* @__PURE__ */ jsxs(Fragment, { children: [
7547
- controls.moveWithin && /* @__PURE__ */ jsx(DropdownSeparator, {}),
7548
- controls.targets.filter((t) => t.concernId !== order.concernId).map((t) => /* @__PURE__ */ jsxs(
7549
- DropdownItem,
7550
- {
7551
- icon: /* @__PURE__ */ jsx(Link, { size: 14 }),
7552
- onClick: pick(
7553
- () => controls.moveToProblem?.(order, t.concernId)
7554
- ),
7555
- children: [
7556
- "Move to: ",
7557
- t.label
7558
- ]
7559
- },
7560
- t.concernId
7561
- ))
7562
- ] })
7563
- ]
7564
- }
7565
- ),
7566
- controls?.remove && /* @__PURE__ */ jsx(
7567
- RowIconButton,
7568
- {
7569
- label: "Remove",
7570
- icon: Trash2,
7571
- size: "sm",
7572
- onClick: () => controls.remove?.(order)
7573
- }
7574
- )
7575
- ]
7576
- }
7577
- )
7578
- ] })
7579
- ]
7580
- }
7581
- )
7582
- );
7583
- }
7584
- function AddOrderForm({
7585
- id,
7586
- problemText,
7587
- onSubmit,
7588
- onCancel,
7589
- renderSearch
7590
- }) {
7591
- const [type, setType] = React13.useState(
7592
- renderSearch ? "auto" : "medication"
7593
- );
7594
- const [display, setDisplay] = React13.useState("");
7595
- const inputRef = React13.useRef(null);
7596
- React13.useEffect(() => {
7597
- inputRef.current?.focus();
7598
- }, []);
7599
- const submit = () => {
7600
- const text = display.trim();
7601
- if (!text) return;
7602
- onSubmit({ type: type === "auto" ? "procedure" : type, display: text });
7603
- setDisplay("");
7604
- inputRef.current?.focus();
7605
- };
7606
- const handlePick = (pick) => {
7607
- onSubmit({
7608
- type: type === "auto" ? orderTypeForCodetype(pick.codetype) : type,
7609
- display: pick.label,
7610
- code: {
7611
- fullid: pick.fullid,
7612
- codetype: pick.codetype,
7613
- fullcode: pick.fullcode
7614
- }
7615
- });
7616
- };
7617
- return /* @__PURE__ */ jsxs(
7618
- "div",
7619
- {
7620
- id,
7621
- role: "form",
7622
- "aria-label": `Add order for ${problemText}`,
7623
- className: "border-border bg-muted/40 ms-2.5 mt-1.5 flex flex-wrap items-center gap-1.5 rounded-md border border-dashed p-2",
7624
- children: [
7625
- /* @__PURE__ */ jsxs(
7626
- "select",
7627
- {
7628
- "aria-label": "Order type filter",
7629
- "data-slot": "select-trigger",
7630
- value: type,
7631
- onChange: (e) => setType(e.target.value),
7632
- onKeyDown: (e) => {
7633
- if (e.key === "Escape") onCancel();
7634
- },
7635
- className: cn(
7636
- "border-border bg-background text-foreground rounded-md border px-1.5 text-sm",
7637
- renderSearch ? "h-10" : "h-8",
7638
- "focus:ring-ring focus:ring-2 focus:outline-none"
7639
- ),
7640
- children: [
7641
- renderSearch && /* @__PURE__ */ jsx("option", { value: "auto", children: "Auto" }),
7642
- Object.keys(ORDER_TYPE_META).map((t) => /* @__PURE__ */ jsx("option", { value: t, children: ORDER_TYPE_META[t].label }, t))
7643
- ]
7644
- }
7645
- ),
7646
- renderSearch ? /* @__PURE__ */ jsx("div", { className: "min-w-64 flex-1", children: renderSearch({
7647
- domains: type === "auto" ? void 0 : ORDER_TYPE_SEARCH_DOMAINS[type],
7648
- placeholder: ORDER_TYPE_PLACEHOLDERS[type],
7649
- onPick: handlePick,
7650
- onFreeText: (text) => {
7651
- const t = text.trim();
7652
- if (!t) return;
7653
- onSubmit({
7654
- type: type === "auto" ? "procedure" : type,
7655
- display: t
7656
- });
7657
- }
7658
- }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
7659
- /* @__PURE__ */ jsx("div", { className: "min-w-48 flex-1", children: /* @__PURE__ */ jsx(
7660
- Input,
7661
- {
7662
- ref: inputRef,
7663
- size: "sm",
7664
- value: display,
7665
- onChange: (e) => setDisplay(e.target.value),
7666
- onKeyDown: (e) => {
7667
- if (e.key === "Enter") submit();
7668
- else if (e.key === "Escape") onCancel();
7669
- },
7670
- placeholder: "e.g. lisinopril 10 mg tablet \u2014 1 po daily",
7671
- "aria-label": "Order description"
7672
- }
7673
- ) }),
7674
- /* @__PURE__ */ jsx(
7675
- Button,
7676
- {
7677
- variant: "outline",
7678
- size: "sm",
7679
- onClick: submit,
7680
- disabled: !display.trim(),
7681
- leftIcon: /* @__PURE__ */ jsx(Plus, { size: 12 }),
7682
- className: "h-8",
7683
- children: "Add"
7684
- }
7685
- )
7686
- ] }),
7687
- /* @__PURE__ */ jsx(
7688
- Button,
7689
- {
7690
- variant: "ghost",
7691
- size: "sm",
7692
- onClick: onCancel,
7693
- className: renderSearch ? "h-10" : "h-8",
7694
- children: "Done"
7695
- }
7696
- )
7697
- ]
7698
- }
7699
- );
7700
- }
7701
- var Assessment = React13.forwardRef(
7702
- ({
7703
- concerns,
7704
- items,
7705
- orders = [],
7706
- title = "Assessment & plan",
7707
- showPlan = true,
7708
- onShowPlanChange,
7709
- onAction,
7710
- rowActions = [
7711
- ...Object.keys(ACTION_META2),
7712
- "remove",
7713
- "move"
7714
- ],
7715
- orderActions = ["edit", "remove", "move"],
7716
- addModes,
7717
- onRemoveAssessment,
7718
- onAddOrder,
7719
- onAddAssessment,
7720
- onLinkOrder,
7721
- onEditOrderStart,
7722
- onEditOrder,
7723
- onRemoveOrder,
7724
- onReorderItems,
7725
- onReorderOrders,
7726
- renderOrderSearch,
7727
- readOnly = false,
7728
- defaultAddMode = "auto",
7729
- billableOnly = false,
7730
- className,
7731
- "data-testid": dataTestId,
7732
- ...props
7733
- }, ref) => {
7734
- const instanceId = React13.useId();
7735
- const [addingFor, setAddingFor] = React13.useState(null);
7736
- const requestedAddModes = addModes ?? [
7737
- "auto",
7738
- "problem",
7739
- "order"
7740
- ];
7741
- const availableAddModes = requestedAddModes.filter((mode) => {
7742
- if (mode === "problem") return Boolean(onAddAssessment);
7743
- if (mode === "order") return Boolean(onAddOrder);
7744
- return Boolean(onAddAssessment && onAddOrder);
7745
- });
7746
- const initialAddMode = availableAddModes.includes(defaultAddMode) ? defaultAddMode : availableAddModes[0] ?? defaultAddMode;
7747
- const [selectedAddMode, setSelectedAddMode] = React13.useState(initialAddMode);
7748
- const addMode = availableAddModes.includes(selectedAddMode) ? selectedAddMode : availableAddModes[0] ?? defaultAddMode;
7749
- const [pendingFreeText, setPendingFreeText] = React13.useState(
7750
- null
7751
- );
7752
- React13.useEffect(() => {
7753
- if (addMode !== "auto") setPendingFreeText(null);
7754
- }, [addMode]);
7755
- const [announcement, setAnnouncement] = useLiveAnnouncement();
7756
- const ambientCodeLookup = useCodeLookupConfig();
7757
- const effectiveRenderOrderSearch = renderOrderSearch === false ? void 0 : renderOrderSearch ?? (ambientCodeLookup ? contextOrderSearch(ambientCodeLookup) : void 0);
7758
- const concernById = React13.useMemo(
7759
- () => new Map(concerns.map((c) => [c.concernId, c])),
7760
- [concerns]
7761
- );
7762
- const assertionOf = (item) => concernById.get(item.concernId)?.assertions.find((a) => a.id === item.assertionId);
7763
- const unlinkedOrders = orders.filter(
7764
- (o) => !o.concernId || !items.some((i) => i.concernId === o.concernId)
7765
- );
7766
- const toolbarActions = rowActions.filter(
7767
- (action) => action in ACTION_META2 && (action === "add-order" ? Boolean(onAddOrder || onAction) : Boolean(onAction))
7768
- );
7769
- const showConcernToolbar = toolbarActions.length > 0 || rowActions.includes("remove") && Boolean(onRemoveAssessment);
7770
- const drag = useDragReorder({
7771
- ids: items.map((i) => i.concernId),
7772
- onReorder: readOnly || !rowActions.includes("move") || !onReorderItems ? void 0 : (ids) => {
7773
- setAnnouncement("Assessment concerns reordered");
7774
- onReorderItems(ids);
7775
- }
7776
- });
7777
- const problemLabel = React13.useCallback(
7778
- (concernId) => concernById.get(concernId)?.assertions.find(
7779
- (a) => items.some(
7780
- (i) => i.concernId === concernId && i.assertionId === a.id
7781
- )
7782
- )?.text ?? concernId,
7783
- [concernById, items]
7784
- );
7785
- const orderControls = readOnly ? void 0 : {
7786
- moveWithin: orderActions.includes("move") && onReorderOrders ? (order, dir) => {
7787
- const planIds = orders.filter((o) => o.concernId === order.concernId).map((o) => o.orderId);
7788
- const i = planIds.indexOf(order.orderId);
7789
- const target = planIds[i + dir];
7790
- if (!target) return;
7791
- onReorderOrders(
7792
- reorderIds(
7793
- orders.map((o) => o.orderId),
7794
- order.orderId,
7795
- target,
7796
- dir === 1
7797
- )
7798
- );
7799
- setAnnouncement(
7800
- `${order.display} moved ${dir === -1 ? "up" : "down"}`
7801
- );
7802
- } : void 0,
7803
- moveToProblem: orderActions.includes("move") && onLinkOrder ? (order, concernId) => {
7804
- onLinkOrder(order, concernId);
7805
- setAnnouncement(
7806
- `${order.display} moved to ${problemLabel(concernId)}`
7807
- );
7808
- } : void 0,
7809
- edit: orderActions.includes("edit") && onEditOrder ? (order, changes) => {
7810
- onEditOrder(order, changes);
7811
- setAnnouncement(`${changes.display} updated`);
7812
- } : void 0,
7813
- editStart: orderActions.includes("edit") ? onEditOrderStart : void 0,
7814
- remove: orderActions.includes("remove") && onRemoveOrder ? (order) => {
7815
- onRemoveOrder(order);
7816
- setAnnouncement(`${order.display} removed`);
7817
- } : void 0,
7818
- adjacentProblem: (order, dir) => {
7819
- const i = items.findIndex((it) => it.concernId === order.concernId);
7820
- const adj = items[i + dir];
7821
- return adj ? { concernId: adj.concernId, label: problemLabel(adj.concernId) } : null;
7822
- },
7823
- targets: items.map((it) => ({
7824
- concernId: it.concernId,
7825
- label: problemLabel(it.concernId)
7826
- }))
7827
- };
7828
- const orderDragEnabled = !readOnly && orderActions.includes("move") && Boolean(onReorderOrders || onLinkOrder);
7829
- const [draggingOrderId, setDraggingOrderId] = React13.useState(
7830
- null
7831
- );
7832
- const draggingOrderRef = React13.useRef(null);
7833
- const [orderOver, setOrderOver] = React13.useState(null);
7834
- const resetOrderDrag = () => {
7835
- draggingOrderRef.current = null;
7836
- setDraggingOrderId(null);
7837
- setOrderOver(null);
7838
- };
7839
- const dropOnOrder = (dragged, target, after) => {
7840
- if (dragged.concernId !== target.concernId && target.concernId) {
7841
- onLinkOrder?.(dragged, target.concernId);
7842
- setAnnouncement(
7843
- `${dragged.display} moved to ${problemLabel(target.concernId)}`
7844
- );
7845
- } else {
7846
- setAnnouncement(`${dragged.display} reordered`);
7847
- }
7848
- onReorderOrders?.(
7849
- reorderIds(
7850
- orders.map((o) => o.orderId),
7851
- dragged.orderId,
7852
- target.orderId,
7853
- after
7854
- )
7855
- );
7856
- };
7857
- const orderDrag = {
7858
- enabled: orderDragEnabled,
7859
- draggingId: draggingOrderId,
7860
- over: orderOver,
7861
- rowProps: (order) => orderDragEnabled ? {
7862
- draggable: true,
7863
- onDragStart: (e) => {
7864
- e.stopPropagation();
7865
- e.dataTransfer.effectAllowed = "move";
7866
- e.dataTransfer.setData("text/plain", order.orderId);
7867
- draggingOrderRef.current = order.orderId;
7868
- setDraggingOrderId(order.orderId);
7869
- },
7870
- onDragEnd: (e) => {
7871
- e.stopPropagation();
7872
- resetOrderDrag();
7873
- },
7874
- onDragOver: (e) => {
7875
- const dragged = draggingOrderRef.current;
7876
- if (!dragged || dragged === order.orderId) return;
7877
- e.preventDefault();
7878
- e.stopPropagation();
7879
- e.dataTransfer.dropEffect = "move";
7880
- const r = e.currentTarget.getBoundingClientRect();
7881
- const after = e.clientY > r.top + r.height / 2;
7882
- setOrderOver({ type: "order", id: order.orderId, after });
7883
- },
7884
- onDrop: (e) => {
7885
- const draggedId = draggingOrderRef.current ?? e.dataTransfer.getData("text/plain");
7886
- const dragged = orders.find((o) => o.orderId === draggedId);
7887
- if (!dragged || dragged.orderId === order.orderId) return;
7888
- e.preventDefault();
7889
- e.stopPropagation();
7890
- const r = e.currentTarget.getBoundingClientRect();
7891
- const after = e.clientY > r.top + r.height / 2;
7892
- dropOnOrder(dragged, order, after);
7893
- resetOrderDrag();
7894
- }
7895
- } : {}
7896
- };
7897
- const blockProps = (concernId) => {
7898
- const itemProps = drag.rowProps(concernId);
7899
- if (!orderDragEnabled) return itemProps;
7900
- return {
7901
- ...itemProps,
7902
- onDragOver: (e) => {
7903
- const draggingOrder = draggingOrderRef.current;
7904
- if (draggingOrder) {
7905
- const dragged = orders.find((o) => o.orderId === draggingOrder);
7906
- if (dragged?.concernId === concernId) return;
7907
- e.preventDefault();
7908
- e.dataTransfer.dropEffect = "move";
7909
- setOrderOver({ type: "concern", concernId });
7910
- return;
7911
- }
7912
- itemProps.onDragOver?.(e);
7913
- },
7914
- onDragLeave: (e) => {
7915
- if (draggingOrderRef.current) {
7916
- setOrderOver(
7917
- (prev) => prev?.type === "concern" && prev.concernId === concernId ? null : prev
7918
- );
7919
- return;
7920
- }
7921
- itemProps.onDragLeave?.(e);
7922
- },
7923
- onDrop: (e) => {
7924
- const payload = draggingOrderRef.current ?? e.dataTransfer.getData("text/plain");
7925
- const dragged = orders.find((o) => o.orderId === payload);
7926
- if (dragged) {
7927
- e.preventDefault();
7928
- if (dragged.concernId !== concernId) {
7929
- onLinkOrder?.(dragged, concernId);
7930
- setAnnouncement(
7931
- `${dragged.display} moved to ${problemLabel(concernId)}`
7932
- );
7933
- }
7934
- resetOrderDrag();
7935
- return;
7936
- }
7937
- itemProps.onDrop?.(e);
7938
- }
7939
- };
7940
- };
7941
- return /* @__PURE__ */ jsxs(
7942
- Card,
7943
- {
7944
- ref,
7945
- padding: "none",
7946
- className: cn("w-full", className),
7947
- "data-testid": dataTestId,
7948
- ...props,
7949
- children: [
7950
- title !== null && /* @__PURE__ */ jsxs(CardHeader, { className: "border-border bg-muted/50 flex flex-row items-center justify-between border-b px-4 py-3", children: [
7951
- /* @__PURE__ */ jsx("h3", { className: "text-foreground text-sm font-semibold tracking-wide uppercase", children: title }),
7952
- onShowPlanChange && /* @__PURE__ */ jsx(
7953
- Checkbox,
7954
- {
7955
- size: "sm",
7956
- checked: showPlan,
7957
- onChange: (e) => onShowPlanChange(e.target.checked),
7958
- label: "Show plan"
7959
- }
7960
- )
7961
- ] }),
7962
- /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 px-4 py-4", children: [
7963
- items.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "No problems assessed this visit." }),
7964
- /* @__PURE__ */ jsx("ol", { className: "space-y-3", children: items.map((item, index) => {
7965
- const assertion = assertionOf(item);
7966
- if (!assertion) return null;
7967
- const linkedOrders = orders.filter(
7968
- (o) => o.concernId === item.concernId
7969
- );
7970
- const bp = blockProps(item.concernId);
7971
- const formOpen = addingFor === item.concernId;
7972
- const addOrderFormId = `${instanceId}-add-order-${item.concernId}`;
7973
- return /* @__PURE__ */ jsxs(
7974
- "li",
7975
- {
7976
- "data-slot": "assessment-problem",
7977
- "data-concern-id": item.concernId,
7978
- ...bp,
7979
- draggable: drag.enabled && !formOpen,
7980
- className: cn(
7981
- "group border-border/60 relative rounded-md border px-3 py-2",
7982
- drag.enabled && !formOpen && "cursor-grab active:cursor-grabbing",
7983
- dragIndicatorClasses(drag, item.concernId),
7984
- orderOver?.type === "concern" && orderOver.concernId === item.concernId && "ring-primary-400 bg-primary-50/50 dark:bg-primary-950/50 ring-2"
7985
- ),
7986
- children: [
7987
- /* @__PURE__ */ jsxs(
7988
- "div",
7989
- {
7990
- className: cn(
7991
- "flex flex-wrap items-center gap-x-2 gap-y-1",
7992
- drag.enabled && formOpen && "cursor-grab active:cursor-grabbing"
7993
- ),
7994
- draggable: drag.enabled && formOpen,
7995
- onDragStart: formOpen ? bp.onDragStart : void 0,
7996
- onDragEnd: formOpen ? bp.onDragEnd : void 0,
7997
- children: [
7998
- drag.enabled && /* @__PURE__ */ jsx(
7999
- GripVertical,
8000
- {
8001
- size: 14,
8002
- "aria-hidden": true,
8003
- className: "text-muted-foreground/50 shrink-0"
8004
- }
8005
- ),
8006
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-sm font-semibold tabular-nums", children: [
8007
- index + 1,
8008
- "."
8009
- ] }),
8010
- /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: assertion.text }),
8011
- assertion.verificationStatus !== "confirmed" && /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", children: assertion.verificationStatus }),
8012
- /* @__PURE__ */ jsx(CodingChips, { coding: assertion.coding }),
8013
- !readOnly && showConcernToolbar && /* @__PURE__ */ jsxs(
8014
- RowActionToolbar,
8015
- {
8016
- label: `Actions for ${assertion.text}`,
8017
- align: "top",
8018
- className: cn(
8019
- "pointer-fine:group-has-[[data-order-id]:hover]:pointer-events-none",
8020
- "pointer-fine:group-has-[[data-order-id]:hover]:opacity-0",
8021
- "pointer-fine:group-has-[[data-order-id]:focus-within]:pointer-events-none",
8022
- "pointer-fine:group-has-[[data-order-id]:focus-within]:opacity-0"
8023
- ),
8024
- children: [
8025
- toolbarActions.map((action) => {
8026
- const meta = ACTION_META2[action];
8027
- return /* @__PURE__ */ jsx(
8028
- RowIconButton,
8029
- {
8030
- label: meta.label,
8031
- icon: meta.icon,
8032
- size: "sm",
8033
- expanded: action === "add-order" && onAddOrder ? addingFor === item.concernId : void 0,
8034
- controls: action === "add-order" && onAddOrder ? addOrderFormId : void 0,
8035
- onClick: () => {
8036
- if (action === "add-order" && onAddOrder) {
8037
- setAddingFor(
8038
- (prev) => prev === item.concernId ? null : item.concernId
8039
- );
8040
- } else {
8041
- onAction?.(item, action);
8042
- }
8043
- }
8044
- },
8045
- action
8046
- );
8047
- }),
8048
- rowActions.includes("remove") && onRemoveAssessment && /* @__PURE__ */ jsx(
8049
- RowIconButton,
8050
- {
8051
- label: `Remove ${assertion.text} from assessment`,
8052
- icon: Trash2,
8053
- size: "sm",
8054
- onClick: () => {
8055
- onRemoveAssessment(item);
8056
- setAnnouncement(
8057
- `${assertion.text} removed from assessment`
8058
- );
8059
- }
8060
- }
8061
- )
8062
- ]
8063
- }
8064
- )
8065
- ]
8066
- }
8067
- ),
8068
- item.note && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1 ps-6 text-sm", children: item.note }),
8069
- showPlan && linkedOrders.length > 0 && /* @__PURE__ */ jsx(
8070
- "ul",
8071
- {
8072
- "aria-label": `Plan for ${assertion.text}`,
8073
- className: "border-border ms-2.5 mt-1.5 border-s ps-4",
8074
- children: linkedOrders.map((order) => /* @__PURE__ */ jsx(
8075
- OrderRow,
8076
- {
8077
- order,
8078
- drag: orderDrag,
8079
- controls: orderControls
8080
- },
8081
- order.orderId
8082
- ))
8083
- }
8084
- ),
8085
- !readOnly && onAddOrder && addingFor === item.concernId && /* @__PURE__ */ jsx(
8086
- AddOrderForm,
8087
- {
8088
- id: addOrderFormId,
8089
- problemText: assertion.text,
8090
- onSubmit: (order) => {
8091
- onAddOrder(item, order);
8092
- setAnnouncement(
8093
- `${order.display} added to ${assertion.text}`
8094
- );
8095
- setAddingFor(null);
8096
- },
8097
- onCancel: () => setAddingFor(null),
8098
- renderSearch: effectiveRenderOrderSearch
8099
- }
8100
- )
8101
- ]
8102
- },
8103
- item.concernId
8104
- );
8105
- }) }),
8106
- !readOnly && availableAddModes.length > 0 && effectiveRenderOrderSearch && (onAddAssessment || onAddOrder) && /* @__PURE__ */ jsxs(
8107
- "div",
8108
- {
8109
- role: "form",
8110
- "aria-label": "Add concern or order",
8111
- className: "border-border bg-muted/40 flex flex-wrap items-center gap-2 rounded-md border border-dashed p-2",
8112
- children: [
8113
- /* @__PURE__ */ jsxs(
8114
- "select",
8115
- {
8116
- "aria-label": "What to add",
8117
- "data-slot": "select-trigger",
8118
- value: addMode,
8119
- onChange: (e) => {
8120
- setSelectedAddMode(e.target.value);
8121
- setPendingFreeText(null);
8122
- },
8123
- className: cn(
8124
- "border-border bg-background text-foreground h-10 rounded-md border px-1.5 text-sm",
8125
- "focus:ring-ring focus:ring-2 focus:outline-none"
8126
- ),
8127
- children: [
8128
- availableAddModes.includes("auto") && /* @__PURE__ */ jsx("option", { value: "auto", children: "Add (auto)" }),
8129
- availableAddModes.includes("problem") && onAddAssessment && /* @__PURE__ */ jsx("option", { value: "problem", children: "Add concern" }),
8130
- availableAddModes.includes("order") && onAddOrder && /* @__PURE__ */ jsx("option", { value: "order", children: "Add order" })
8131
- ]
8132
- }
8133
- ),
8134
- /* @__PURE__ */ jsx("div", { className: "min-w-64 flex-1", children: effectiveRenderOrderSearch({
8135
- domains: addMode === "problem" ? ["condition", "occupational"] : addMode === "order" ? ["med", "lab", "procedure", "vaccine"] : void 0,
8136
- // auto: everything — the pick decides
8137
- // auto: concerns rank ahead of orders — surveillance
8138
- // programs first (rare, high-value hits like "dot" or
8139
- // "hearing"), then diagnoses, then meds/labs/procedures.
8140
- // concern mode: programs still lead the diagnoses.
8141
- preferDomains: addMode === "auto" ? ["occupational", "condition"] : addMode === "problem" ? ["occupational"] : void 0,
8142
- // assessments code in ICD-10: boost it over SNOMED
8143
- preferCodetypes: addMode !== "order" ? ["ICD10"] : void 0,
8144
- billableOnly: addMode !== "order" && billableOnly,
8145
- placeholder: addMode === "problem" ? 'Search diagnoses & programs\u2026 (try "chf" or "hearing conservation")' : addMode === "order" ? "Search medications, labs, imaging, procedures\u2026" : "Add concern or order\u2026 (a diagnosis or surveillance program becomes a concern; meds, labs & imaging become orders)",
8146
- onPick: (pick) => {
8147
- const asProblem = addMode === "problem" || addMode === "auto" && isConditionCodetype(pick.codetype) && Boolean(onAddAssessment);
8148
- if (asProblem) {
8149
- onAddAssessment?.({
8150
- label: pick.label,
8151
- code: {
8152
- fullid: pick.fullid,
8153
- codetype: pick.codetype,
8154
- fullcode: pick.fullcode
8155
- }
8156
- });
8157
- } else {
8158
- onAddOrder?.(null, {
8159
- type: orderTypeForCodetype(pick.codetype),
8160
- display: pick.label,
8161
- code: {
8162
- fullid: pick.fullid,
8163
- codetype: pick.codetype,
8164
- fullcode: pick.fullcode
8165
- }
8166
- });
8167
- }
8168
- },
8169
- onFreeText: (text) => {
8170
- if (addMode === "problem") {
8171
- onAddAssessment?.({ label: text });
8172
- } else if (addMode === "order") {
8173
- onAddOrder?.(null, {
8174
- type: "procedure",
8175
- display: text
8176
- });
8177
- } else {
8178
- setPendingFreeText(text);
8179
- }
8180
- }
8181
- }) }),
8182
- addMode === "auto" && pendingFreeText !== null && /* @__PURE__ */ jsxs(
8183
- "div",
8184
- {
8185
- role: "group",
8186
- "aria-label": `Add "${pendingFreeText}" as`,
8187
- className: "flex w-full flex-wrap items-center gap-1.5 ps-1",
8188
- children: [
8189
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-sm", children: [
8190
- "Add",
8191
- " ",
8192
- /* @__PURE__ */ jsxs("span", { className: "text-foreground font-medium", children: [
8193
- "\u201C",
8194
- pendingFreeText,
8195
- "\u201D"
8196
- ] }),
8197
- " ",
8198
- "as:"
8199
- ] }),
8200
- onAddAssessment && /* @__PURE__ */ jsx(
8201
- Button,
8202
- {
8203
- variant: "outline",
8204
- size: "sm",
8205
- className: "h-7 text-xs",
8206
- onClick: () => {
8207
- onAddAssessment({ label: pendingFreeText });
8208
- setPendingFreeText(null);
8209
- },
8210
- children: "Concern"
8211
- }
8212
- ),
8213
- onAddOrder && /* @__PURE__ */ jsx(
8214
- Button,
8215
- {
8216
- variant: "outline",
8217
- size: "sm",
8218
- className: "h-7 text-xs",
8219
- onClick: () => {
8220
- onAddOrder(null, {
8221
- type: "procedure",
8222
- display: pendingFreeText
8223
- });
8224
- setPendingFreeText(null);
8225
- },
8226
- children: "Order"
8227
- }
8228
- ),
8229
- /* @__PURE__ */ jsx(
8230
- Button,
8231
- {
8232
- variant: "ghost",
8233
- size: "sm",
8234
- className: "h-7 text-xs",
8235
- onClick: () => setPendingFreeText(null),
8236
- children: "Cancel"
8237
- }
8238
- )
8239
- ]
8240
- }
8241
- )
8242
- ]
8243
- }
8244
- ),
8245
- showPlan && unlinkedOrders.length > 0 && /* @__PURE__ */ jsxs(
8246
- "section",
8247
- {
8248
- "aria-label": "Orders not linked to a concern",
8249
- className: "rounded-md border border-amber-300 bg-amber-50 px-3 py-2 dark:border-amber-700 dark:bg-amber-950",
8250
- children: [
8251
- /* @__PURE__ */ jsxs("h4", { className: "flex items-center gap-1.5 text-sm font-semibold text-amber-900 dark:text-amber-200", children: [
8252
- /* @__PURE__ */ jsx(AlertCircle, { size: 14 }),
8253
- "Orders not linked to a concern"
8254
- ] }),
8255
- /* @__PURE__ */ jsx("ul", { className: "mt-1", children: unlinkedOrders.map((order) => (
8256
- // Same row component as linked orders: focusable, Alt+arrow
8257
- // keyboard moves, and the Move menu (508 parity with drag)
8258
- /* @__PURE__ */ jsx(
8259
- OrderRow,
8260
- {
8261
- order,
8262
- drag: orderDrag,
8263
- controls: orderControls
8264
- },
8265
- order.orderId
8266
- )
8267
- )) })
8268
- ]
8269
- }
8270
- )
8271
- ] }),
8272
- /* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "sr-only", children: announcement })
8273
- ]
8274
- }
8275
- );
8276
- }
8277
- );
8278
- Assessment.displayName = "Assessment";
8279
6775
  var DEFAULT_SOCIAL_PROVIDERS = [
8280
6776
  { id: "google", name: "Google", color: "#4285F4" },
8281
6777
  { id: "microsoft", name: "Microsoft", color: "#00A4EF" },
@@ -11660,645 +10156,6 @@ var CaseManagementHeader = React13.forwardRef(
11660
10156
  }
11661
10157
  );
11662
10158
  CaseManagementHeader.displayName = "CaseManagementHeader";
11663
- var MODE_META = {
11664
- add: { title: "Add problem", changeType: void 0 },
11665
- observe: { title: "Progress observation", changeType: void 0 },
11666
- refine: { title: "Refine problem", changeType: "refinement" },
11667
- revise: { title: "Revise problem", changeType: "revision" },
11668
- relate: { title: "Relate problem", changeType: void 0 }
11669
- };
11670
- var CODING_SYSTEMS = ["SNOMED", "ICD-10-CM", "ICD-11"];
11671
- var VERIFICATION_OPTIONS = [
11672
- { value: "unconfirmed", label: "Unconfirmed" },
11673
- { value: "provisional", label: "Provisional" },
11674
- { value: "differential", label: "Differential" },
11675
- { value: "confirmed", label: "Confirmed" }
11676
- ];
11677
- var RELATIONSHIP_OPTIONS = [
11678
- { value: "caused-by", label: "Caused by" },
11679
- { value: "evolved-from", label: "Evolved from" },
11680
- { value: "differential-sibling", label: "Differential sibling" },
11681
- { value: "complication-of", label: "Complication of" }
11682
- ];
11683
- var SEVERITIES = ["mild", "moderate", "severe"];
11684
- var CONFIDENCES = ["low", "medium", "high"];
11685
- function normalizeConditionCodingSystem(codetype) {
11686
- const ct = codetype.toUpperCase().replace(/[^A-Z0-9]/g, "");
11687
- if (ct === "ICD10" || ct === "ICD10CM") return "ICD-10-CM";
11688
- if (ct === "ICD11") return "ICD-11";
11689
- if (ct === "SNOMED" || ct === "SNOMEDCT" || ct === "SNOMEDUS") {
11690
- return "SNOMED";
11691
- }
11692
- return codetype;
11693
- }
11694
- function withSinglePrimary(coding) {
11695
- if (coding.length === 0) return coding;
11696
- const primaryIndex = coding.findIndex((entry) => entry.primary);
11697
- const selectedIndex = primaryIndex >= 0 ? primaryIndex : 0;
11698
- return coding.map((entry, index) => ({
11699
- ...entry,
11700
- primary: index === selectedIndex
11701
- }));
11702
- }
11703
- function contextConditionCodeSearch(ctx) {
11704
- const ContextConditionCodeSearch = ({
11705
- placeholder,
11706
- onPick,
11707
- onFreeText
11708
- }) => {
11709
- const Lookup = ctx.component;
11710
- return /* @__PURE__ */ jsx(
11711
- Lookup,
11712
- {
11713
- indexUrl: ctx.indexUrl,
11714
- locale: ctx.locale,
11715
- domains: ["condition"],
11716
- preferCodetypes: ["ICD10"],
11717
- bare: true,
11718
- clearOnSelect: false,
11719
- placeholder,
11720
- onSelect: (result) => onPick({
11721
- fullid: result.fullid,
11722
- label: result.label,
11723
- codetype: result.codetype,
11724
- fullcode: result.fullcode
11725
- }),
11726
- onFreeText
11727
- }
11728
- );
11729
- };
11730
- return ContextConditionCodeSearch;
11731
- }
11732
- function FieldFlag({
11733
- label,
11734
- value,
11735
- onChange,
11736
- hasValue
11737
- }) {
11738
- const unknown = value?.known === false;
11739
- return /* @__PURE__ */ jsxs(
11740
- "span",
11741
- {
11742
- role: "group",
11743
- "aria-label": `Certainty for ${label}`,
11744
- className: "flex items-center gap-1",
11745
- children: [
11746
- /* @__PURE__ */ jsx(
11747
- "button",
11748
- {
11749
- type: "button",
11750
- "aria-pressed": unknown,
11751
- onClick: () => onChange(
11752
- unknown ? void 0 : { known: false, reason: "asked-unknown" }
11753
- ),
11754
- className: cn(
11755
- "rounded-full border px-2 py-0.5 text-[11px] font-medium transition-colors",
11756
- unknown ? "border-warning/50 bg-warning/10 text-warning-800 dark:text-warning-200" : "border-border text-muted-foreground hover:text-foreground"
11757
- ),
11758
- children: "Unknown"
11759
- }
11760
- ),
11761
- hasValue && !unknown && CONFIDENCES.map((c) => {
11762
- const active = value?.known !== false && value?.confidence === c;
11763
- return /* @__PURE__ */ jsx(
11764
- "button",
11765
- {
11766
- type: "button",
11767
- "aria-pressed": active,
11768
- "aria-label": `${label} confidence ${c}`,
11769
- onClick: () => onChange(active ? void 0 : { known: true, confidence: c }),
11770
- className: cn(
11771
- "rounded-full border px-1.5 py-0.5 text-[11px] transition-colors",
11772
- active ? "border-primary-400 bg-primary-100 text-primary-900 dark:border-primary-600 dark:bg-primary-950 dark:text-primary-200" : "border-border text-muted-foreground hover:text-foreground"
11773
- ),
11774
- children: c
11775
- },
11776
- c
11777
- );
11778
- })
11779
- ]
11780
- }
11781
- );
11782
- }
11783
- function ObservationHistory({ concern }) {
11784
- const observations = concern?.observations;
11785
- if (!observations?.length) return null;
11786
- return /* @__PURE__ */ jsxs("section", { "aria-label": "Past observations", className: "space-y-1", children: [
11787
- /* @__PURE__ */ jsx("h4", { className: "text-muted-foreground text-xs font-semibold tracking-wide uppercase", children: "Observations" }),
11788
- /* @__PURE__ */ jsx("ol", { className: "border-border max-h-40 space-y-1.5 overflow-y-auto rounded-md border p-2", children: [...observations].reverse().map((o) => /* @__PURE__ */ jsxs("li", { className: "flex flex-wrap gap-x-2 text-sm", children: [
11789
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs tabular-nums", children: o.date }),
11790
- /* @__PURE__ */ jsx("span", { className: "text-foreground flex-1", children: o.text }),
11791
- o.author && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
11792
- "\u2014 ",
11793
- o.author
11794
- ] })
11795
- ] }, o.id)) })
11796
- ] });
11797
- }
11798
- function ConditionEditor({
11799
- mode,
11800
- open,
11801
- onOpenChange,
11802
- concern,
11803
- relatableConcerns = [],
11804
- onSave,
11805
- onRelate,
11806
- onAddObservation,
11807
- renderCodeSearch,
11808
- className,
11809
- "data-testid": dataTestId
11810
- }) {
11811
- const prior = concern ? currentAssertion(concern) : void 0;
11812
- const ambientCodeLookup = useCodeLookupConfig();
11813
- const effectiveRenderCodeSearch = renderCodeSearch === false ? void 0 : renderCodeSearch ?? (ambientCodeLookup ? contextConditionCodeSearch(ambientCodeLookup) : void 0);
11814
- const [text, setText] = React13.useState("");
11815
- const [coding, setCoding] = React13.useState([]);
11816
- const [verification, setVerification] = React13.useState("confirmed");
11817
- const [severity, setSeverity] = React13.useState();
11818
- const [onsetDate, setOnsetDate] = React13.useState("");
11819
- const [onsetFuzzy, setOnsetFuzzy] = React13.useState("");
11820
- const [note, setNote] = React13.useState("");
11821
- const [progression, setProgression] = React13.useState(false);
11822
- const [fields, setFields] = React13.useState({});
11823
- const [relType, setRelType] = React13.useState("caused-by");
11824
- const [relTarget, setRelTarget] = React13.useState("");
11825
- const [observation, setObservation] = React13.useState("");
11826
- React13.useEffect(() => {
11827
- if (!open) return;
11828
- setText(prior?.text ?? "");
11829
- setCoding(withSinglePrimary(prior?.coding ?? []));
11830
- setVerification(
11831
- mode === "add" ? "unconfirmed" : prior?.verificationStatus ?? "confirmed"
11832
- );
11833
- setSeverity(prior?.severity);
11834
- const priorOnsetDate = prior?.onset?.date;
11835
- setOnsetDate(priorOnsetDate ? dateToDisplayFormat(priorOnsetDate) : "");
11836
- setOnsetFuzzy(priorOnsetDate ? "" : prior?.onset?.fuzzy ?? "");
11837
- setNote("");
11838
- setProgression(false);
11839
- setFields(prior?.uncertainty?.fields ?? {});
11840
- setRelType("caused-by");
11841
- setRelTarget("");
11842
- setObservation("");
11843
- }, [open, mode, prior]);
11844
- const setField = (field) => (f) => setFields((prev) => {
11845
- const next = { ...prev };
11846
- if (f) next[field] = f;
11847
- else delete next[field];
11848
- return next;
11849
- });
11850
- const updateCoding = (i, patch) => setCoding((prev) => prev.map((c, j) => j === i ? { ...c, ...patch } : c));
11851
- const codingUnknown = fields.coding?.known === false;
11852
- const hasInvalidOnsetDate = fields.onset?.known !== false && Boolean(onsetDate) && !isValidDate(onsetDate);
11853
- const handleCodePick = (pick) => {
11854
- const system = normalizeConditionCodingSystem(pick.codetype);
11855
- setCoding(
11856
- (prev) => prev.some((c) => c.system === system && c.code === pick.fullcode) ? prev : withSinglePrimary([
11857
- ...prev,
11858
- { system, code: pick.fullcode, display: pick.label }
11859
- ])
11860
- );
11861
- setText((prev) => prev || pick.label);
11862
- setFields((prev) => {
11863
- if (prev.coding?.known !== false) return prev;
11864
- const next = { ...prev };
11865
- delete next.coding;
11866
- return next;
11867
- });
11868
- };
11869
- const handleSave = () => {
11870
- if (mode === "relate") {
11871
- if (!relTarget) return;
11872
- onRelate?.({ type: relType, concernId: relTarget });
11873
- onOpenChange(false);
11874
- return;
11875
- }
11876
- if (mode === "observe") {
11877
- if (!observation.trim()) return;
11878
- onAddObservation?.(observation.trim());
11879
- onOpenChange(false);
11880
- return;
11881
- }
11882
- if (!text.trim() || hasInvalidOnsetDate) return;
11883
- if (observation.trim()) onAddObservation?.(observation.trim());
11884
- const uncertainty = Object.keys(fields).length > 0 ? { fields } : void 0;
11885
- onSave?.({
11886
- text: text.trim(),
11887
- // write the trimmed values back — whitespace in codes breaks equality
11888
- // checks downstream. A field marked explicitly unknown must not carry a
11889
- // value (e.g. one seeded from the prior assertion): value + "unknown"
11890
- // would be contradictory, so unknown wins and the value is dropped.
11891
- coding: fields.coding?.known === false ? [] : withSinglePrimary(
11892
- coding.filter((c) => c.code.trim()).map((c) => ({
11893
- ...c,
11894
- code: c.code.trim(),
11895
- display: c.display?.trim() || void 0,
11896
- mappedFrom: c.mappedFrom?.trim() || void 0
11897
- }))
11898
- ),
11899
- verificationStatus: verification,
11900
- changeType: mode === "refine" ? progression ? "progression" : "refinement" : MODE_META[mode].changeType,
11901
- supersedes: prior?.id,
11902
- severity: fields.severity?.known === false ? void 0 : severity,
11903
- onset: fields.onset?.known === false ? void 0 : onsetDate || onsetFuzzy ? {
11904
- date: onsetDate ? displayFormatToDateString(onsetDate) : void 0,
11905
- fuzzy: onsetFuzzy || void 0
11906
- } : void 0,
11907
- uncertainty,
11908
- note: note.trim() || void 0
11909
- });
11910
- onOpenChange(false);
11911
- };
11912
- const saveDisabled = mode === "relate" ? !relTarget : mode === "observe" ? !observation.trim() : !text.trim() || hasInvalidOnsetDate;
11913
- return /* @__PURE__ */ jsxs(
11914
- Modal,
11915
- {
11916
- open,
11917
- onOpenChange,
11918
- size: "2xl",
11919
- className,
11920
- children: [
11921
- /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsxs(ModalTitle, { children: [
11922
- MODE_META[mode].title,
11923
- prior ? ` \u2014 ${prior.text}` : ""
11924
- ] }) }),
11925
- /* @__PURE__ */ jsx(ModalBody, { "data-testid": dataTestId, className: "space-y-5", children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
11926
- mode === "revise" && /* @__PURE__ */ jsxs(
11927
- "div",
11928
- {
11929
- role: "alert",
11930
- className: "border-warning/30 bg-warning/10 text-warning-800 dark:text-warning-200 flex items-start gap-2 rounded-md border px-3 py-2 text-sm",
11931
- children: [
11932
- /* @__PURE__ */ jsx(AlertTriangle, { size: 16 }),
11933
- /* @__PURE__ */ jsxs("span", { children: [
11934
- "Revising marks the prior assertion ",
11935
- /* @__PURE__ */ jsx("strong", { children: "refuted" }),
11936
- " (it was never true) \u2014 history is preserved on the timeline. Use",
11937
- " ",
11938
- /* @__PURE__ */ jsx("em", { children: "Refine" }),
11939
- " instead if the prior was correct but less specific."
11940
- ] })
11941
- ]
11942
- }
11943
- ),
11944
- mode === "relate" ? /* @__PURE__ */ jsxs(Fragment, { children: [
11945
- /* @__PURE__ */ jsx(
11946
- Select,
11947
- {
11948
- label: "Relationship",
11949
- options: RELATIONSHIP_OPTIONS,
11950
- value: relType,
11951
- onValueChange: (v) => setRelType(v)
11952
- }
11953
- ),
11954
- /* @__PURE__ */ jsx(
11955
- Select,
11956
- {
11957
- label: "Related problem",
11958
- placeholder: "Select a problem\u2026",
11959
- options: relatableConcerns.filter((c) => c.concernId !== concern?.concernId).map((c) => ({
11960
- value: c.concernId,
11961
- label: currentAssertion(c)?.text ?? c.concernId
11962
- })),
11963
- value: relTarget,
11964
- onValueChange: setRelTarget
11965
- }
11966
- )
11967
- ] }) : mode === "observe" ? /* @__PURE__ */ jsxs(Fragment, { children: [
11968
- /* @__PURE__ */ jsx(ObservationHistory, { concern }),
11969
- /* @__PURE__ */ jsx(
11970
- Textarea,
11971
- {
11972
- label: "New observation",
11973
- value: observation,
11974
- onChange: (e) => setObservation(e.target.value),
11975
- placeholder: "e.g. BP improving on current regimen; patient reports better sleep",
11976
- rows: 3,
11977
- autoFocus: true
11978
- }
11979
- )
11980
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
11981
- (mode === "refine" || mode === "revise") && /* @__PURE__ */ jsx(ObservationHistory, { concern }),
11982
- mode === "add" && effectiveRenderCodeSearch && !text.trim() ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
11983
- /* @__PURE__ */ jsxs("span", { className: "text-foreground block text-sm font-medium", children: [
11984
- "Problem name",
11985
- /* @__PURE__ */ jsx("span", { className: "text-destructive ms-1", "aria-hidden": "true", children: "*" })
11986
- ] }),
11987
- effectiveRenderCodeSearch({
11988
- placeholder: "Search conditions \u2014 or type a name and press Enter\u2026",
11989
- onPick: handleCodePick,
11990
- onFreeText: (t) => setText(t.trim())
11991
- }),
11992
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "Picking a code fills the name and coding together; free text is fine \u2014 codes can be added any time." })
11993
- ] }) : /* @__PURE__ */ jsx(
11994
- Input,
11995
- {
11996
- label: "Problem name",
11997
- required: true,
11998
- value: text,
11999
- onChange: (e) => setText(e.target.value),
12000
- placeholder: "e.g. Type 1 diabetes mellitus with neuropathy"
12001
- }
12002
- ),
12003
- mode === "refine" && /* @__PURE__ */ jsx(
12004
- Checkbox,
12005
- {
12006
- size: "sm",
12007
- checked: progression,
12008
- onChange: (e) => setProgression(e.target.checked),
12009
- label: "Disease progressed (e.g. new complication) rather than a more specific diagnosis"
12010
- }
12011
- ),
12012
- /* @__PURE__ */ jsxs("fieldset", { className: "space-y-3", children: [
12013
- /* @__PURE__ */ jsx("legend", { className: "sr-only", children: "Coding" }),
12014
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
12015
- /* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-center gap-2 text-sm font-medium", children: [
12016
- "Coding",
12017
- /* @__PURE__ */ jsx(
12018
- FieldFlag,
12019
- {
12020
- label: "Coding",
12021
- value: fields.coding,
12022
- onChange: setField("coding"),
12023
- hasValue: coding.length > 0
12024
- }
12025
- )
12026
- ] }),
12027
- /* @__PURE__ */ jsx(
12028
- Button,
12029
- {
12030
- variant: "ghost",
12031
- size: "sm",
12032
- disabled: codingUnknown,
12033
- onClick: () => setCoding((prev) => [
12034
- ...prev,
12035
- {
12036
- system: "SNOMED",
12037
- code: "",
12038
- primary: prev.length === 0
12039
- }
12040
- ]),
12041
- leftIcon: /* @__PURE__ */ jsx(Plus, { size: 12 }),
12042
- className: "h-8 shrink-0 text-xs",
12043
- children: "Add code"
12044
- }
12045
- )
12046
- ] }),
12047
- effectiveRenderCodeSearch && !(mode === "add" && !text.trim()) && /* @__PURE__ */ jsx("div", { children: effectiveRenderCodeSearch({
12048
- placeholder: "Search codes \u2014 ICD-10-CM / SNOMED\u2026",
12049
- onPick: handleCodePick,
12050
- onFreeText: (t) => setText((prev) => prev || t)
12051
- }) }),
12052
- coding.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "Optional \u2014 a name-only problem is valid. Codes can be added any time." }),
12053
- coding.length > 0 && /* @__PURE__ */ jsxs(
12054
- "div",
12055
- {
12056
- "aria-hidden": "true",
12057
- "data-slot": "condition-coding-header",
12058
- className: "text-muted-foreground hidden grid-cols-[minmax(8rem,1.1fr)_minmax(7rem,0.9fr)_minmax(10rem,1.5fr)_5.5rem_2.5rem] items-center gap-2 px-1 text-xs font-medium sm:!grid",
12059
- children: [
12060
- /* @__PURE__ */ jsx("span", { children: "System" }),
12061
- /* @__PURE__ */ jsx("span", { children: "Code" }),
12062
- /* @__PURE__ */ jsx("span", { children: "Display" }),
12063
- /* @__PURE__ */ jsx("span", { className: "text-center", children: "Primary code" }),
12064
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Actions" })
12065
- ]
12066
- }
12067
- ),
12068
- coding.length > 0 && /* @__PURE__ */ jsx(
12069
- RadioGroup,
12070
- {
12071
- name: "primary-coding",
12072
- label: "Primary display code",
12073
- value: String(
12074
- Math.max(
12075
- 0,
12076
- coding.findIndex((entry) => entry.primary)
12077
- )
12078
- ),
12079
- onValueChange: (value) => {
12080
- const selectedIndex = Number(value);
12081
- setCoding(
12082
- (prev) => prev.map((entry, index) => ({
12083
- ...entry,
12084
- primary: index === selectedIndex
12085
- }))
12086
- );
12087
- },
12088
- size: "sm",
12089
- className: "gap-2 [&_[data-slot=radio-group-items]]:gap-2 sm:[&_[data-slot=radio-group-legend]]:sr-only",
12090
- children: coding.map((c, i) => /* @__PURE__ */ jsxs(
12091
- "div",
12092
- {
12093
- "data-slot": "condition-coding-row",
12094
- className: "border-border/70 grid grid-cols-1 gap-2 rounded-md border p-2 sm:grid-cols-[minmax(8rem,1.1fr)_minmax(7rem,0.9fr)_minmax(10rem,1.5fr)_5.5rem_2.5rem] sm:items-center sm:border-0 sm:p-0",
12095
- children: [
12096
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
12097
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs sm:hidden", children: "System" }),
12098
- /* @__PURE__ */ jsx(
12099
- Select,
12100
- {
12101
- "aria-label": `Coding system ${i + 1}`,
12102
- options: CODING_SYSTEMS.map((s) => ({
12103
- value: s,
12104
- label: s
12105
- })),
12106
- value: c.system,
12107
- onValueChange: (v) => updateCoding(i, { system: v }),
12108
- disabled: codingUnknown
12109
- }
12110
- )
12111
- ] }),
12112
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
12113
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs sm:hidden", children: "Code" }),
12114
- /* @__PURE__ */ jsx(
12115
- Input,
12116
- {
12117
- "aria-label": `Code ${i + 1}`,
12118
- value: c.code,
12119
- onChange: (e) => updateCoding(i, { code: e.target.value }),
12120
- placeholder: "Code",
12121
- disabled: codingUnknown,
12122
- className: "font-mono"
12123
- }
12124
- )
12125
- ] }),
12126
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
12127
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs sm:hidden", children: "Display" }),
12128
- /* @__PURE__ */ jsx(
12129
- Input,
12130
- {
12131
- "aria-label": `Display ${i + 1}`,
12132
- value: c.display ?? "",
12133
- onChange: (e) => updateCoding(i, { display: e.target.value }),
12134
- placeholder: "Display",
12135
- disabled: codingUnknown
12136
- }
12137
- )
12138
- ] }),
12139
- /* @__PURE__ */ jsxs("div", { className: "flex min-h-10 items-center gap-1.5 text-xs sm:justify-center", children: [
12140
- /* @__PURE__ */ jsx(
12141
- Radio,
12142
- {
12143
- value: String(i),
12144
- "aria-label": `Primary code: ${c.system} ${c.code || `row ${i + 1}`}`,
12145
- disabled: codingUnknown
12146
- }
12147
- ),
12148
- /* @__PURE__ */ jsx("span", { className: "sm:sr-only", children: "Primary code" })
12149
- ] }),
12150
- /* @__PURE__ */ jsx(
12151
- Button,
12152
- {
12153
- variant: "ghost",
12154
- size: "icon",
12155
- "aria-label": `Remove code ${i + 1}`,
12156
- disabled: codingUnknown,
12157
- onClick: () => setCoding(
12158
- (prev) => withSinglePrimary(
12159
- prev.filter((_, index) => index !== i)
12160
- )
12161
- ),
12162
- className: "h-10 w-10 justify-self-start sm:justify-self-center",
12163
- children: /* @__PURE__ */ jsx(Trash2, { size: 14 })
12164
- }
12165
- )
12166
- ]
12167
- },
12168
- i
12169
- ))
12170
- }
12171
- )
12172
- ] }),
12173
- /* @__PURE__ */ jsx(
12174
- Select,
12175
- {
12176
- label: "Verification status",
12177
- options: VERIFICATION_OPTIONS,
12178
- value: verification,
12179
- onValueChange: (v) => setVerification(v)
12180
- }
12181
- ),
12182
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-end gap-x-4 gap-y-2", children: [
12183
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
12184
- /* @__PURE__ */ jsx("span", { className: "block text-sm font-medium", children: "Severity" }),
12185
- /* @__PURE__ */ jsx(
12186
- "div",
12187
- {
12188
- role: "group",
12189
- "aria-label": "Severity",
12190
- className: "border-border inline-flex items-center overflow-hidden rounded-md border",
12191
- children: SEVERITIES.map((s) => {
12192
- const active = severity === s;
12193
- return /* @__PURE__ */ jsx(
12194
- "button",
12195
- {
12196
- type: "button",
12197
- "aria-pressed": active,
12198
- disabled: fields.severity?.known === false,
12199
- onClick: () => setSeverity(active ? void 0 : s),
12200
- className: cn(
12201
- "border-border border-s px-2.5 py-1 text-xs font-medium capitalize transition-colors first:border-s-0",
12202
- "disabled:opacity-40",
12203
- active ? "bg-primary-600 text-white" : "bg-background text-muted-foreground hover:text-foreground"
12204
- ),
12205
- children: s
12206
- },
12207
- s
12208
- );
12209
- })
12210
- }
12211
- )
12212
- ] }),
12213
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
12214
- /* @__PURE__ */ jsx("span", { className: "block text-sm font-medium", children: "Certainty" }),
12215
- /* @__PURE__ */ jsx(
12216
- FieldFlag,
12217
- {
12218
- label: "Severity",
12219
- value: fields.severity,
12220
- onChange: setField("severity"),
12221
- hasValue: Boolean(severity)
12222
- }
12223
- )
12224
- ] })
12225
- ] }),
12226
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
12227
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
12228
- "Onset",
12229
- /* @__PURE__ */ jsx(
12230
- FieldFlag,
12231
- {
12232
- label: "Onset",
12233
- value: fields.onset,
12234
- onChange: setField("onset"),
12235
- hasValue: Boolean(onsetDate || onsetFuzzy)
12236
- }
12237
- )
12238
- ] }),
12239
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 items-end gap-2 sm:grid-cols-[minmax(10rem,0.8fr)_auto_minmax(14rem,1.2fr)]", children: [
12240
- /* @__PURE__ */ jsx(
12241
- DateInput,
12242
- {
12243
- "aria-label": "Onset date (exact)",
12244
- value: onsetDate,
12245
- onChange: (value) => {
12246
- setOnsetDate(value);
12247
- if (value) setOnsetFuzzy("");
12248
- },
12249
- disabled: fields.onset?.known === false,
12250
- validateOnBlur: true,
12251
- width: "full"
12252
- }
12253
- ),
12254
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground pb-3 text-center text-xs", children: "or" }),
12255
- /* @__PURE__ */ jsx(
12256
- Input,
12257
- {
12258
- "aria-label": "Onset (fuzzy)",
12259
- value: onsetFuzzy,
12260
- onChange: (e) => {
12261
- setOnsetFuzzy(e.target.value);
12262
- if (e.target.value) setOnsetDate("");
12263
- },
12264
- disabled: fields.onset?.known === false,
12265
- placeholder: 'Fuzzy \u2014 "since her twenties", "~3 months ago"'
12266
- }
12267
- )
12268
- ] })
12269
- ] }),
12270
- /* @__PURE__ */ jsx(
12271
- Textarea,
12272
- {
12273
- label: "Note",
12274
- value: note,
12275
- onChange: (e) => setNote(e.target.value),
12276
- placeholder: "e.g. patient thinks it started after the fall, not sure",
12277
- rows: 2
12278
- }
12279
- ),
12280
- Object.keys(fields).length > 0 && /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground flex items-center gap-1.5 text-xs", children: [
12281
- /* @__PURE__ */ jsx(HelpCircle, { size: 12 }),
12282
- /* @__PURE__ */ jsxs("span", { children: [
12283
- "Uncertainty recorded:",
12284
- " ",
12285
- Object.entries(fields).map(
12286
- ([k, f]) => f?.known === false ? `${k} unknown` : `${f?.confidence ?? "unspecified"} confidence in ${k}`
12287
- ).join(", ")
12288
- ] })
12289
- ] })
12290
- ] })
12291
- ] }) }),
12292
- /* @__PURE__ */ jsxs(ModalFooter, { children: [
12293
- /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => onOpenChange(false), children: "Cancel" }),
12294
- /* @__PURE__ */ jsx(Button, { onClick: handleSave, disabled: saveDisabled, children: mode === "relate" ? "Relate" : mode === "observe" ? "Add observation" : "Save" }),
12295
- mode !== "relate" && mode !== "observe" && !text.trim() && /* @__PURE__ */ jsx(Badge, { variant: "outline", size: "sm", className: "text-muted-foreground", children: "name required" })
12296
- ] })
12297
- ]
12298
- }
12299
- );
12300
- }
12301
- ConditionEditor.displayName = "ConditionEditor";
12302
10159
  function CheckrIntegration({
12303
10160
  connected = false,
12304
10161
  account,
@@ -15924,793 +13781,6 @@ var DashboardWidgetDataCards = React13.forwardRef(({ className, items, columns =
15924
13781
  );
15925
13782
  });
15926
13783
  DashboardWidgetDataCards.displayName = "DashboardWidgetDataCards";
15927
- function getDefaultPresets(labels = {}) {
15928
- const {
15929
- today = "Today",
15930
- thisWeek = "This Week",
15931
- thisMonth = "This Month",
15932
- lastMonth = "Last Month",
15933
- last24Hours = "Last 24 Hours",
15934
- last7Days = "Last 7 Days",
15935
- last30Days = "Last 30 Days"
15936
- } = labels;
15937
- return [
15938
- { key: "today", label: today },
15939
- { key: "this-week", label: thisWeek },
15940
- { key: "this-month", label: thisMonth },
15941
- { key: "last-month", label: lastMonth },
15942
- { key: "last-24-hours", label: last24Hours },
15943
- { key: "last-7-days", label: last7Days },
15944
- { key: "last-30-days", label: last30Days }
15945
- ];
15946
- }
15947
- function getExtendedPresets(labels = {}) {
15948
- const {
15949
- today = "Today",
15950
- yesterday = "Yesterday",
15951
- thisWeek = "This Week",
15952
- lastWeek = "Last Week",
15953
- thisMonth = "This Month",
15954
- lastMonth = "Last Month",
15955
- thisQuarter = "This Quarter",
15956
- lastQuarter = "Last Quarter",
15957
- thisYear = "This Year",
15958
- lastYear = "Last Year",
15959
- last24Hours = "Last 24 Hours",
15960
- last7Days = "Last 7 Days",
15961
- last30Days = "Last 30 Days",
15962
- last90Days = "Last 90 Days",
15963
- last365Days = "Last 365 Days"
15964
- } = labels;
15965
- return [
15966
- { key: "today", label: today },
15967
- { key: "yesterday", label: yesterday },
15968
- { key: "last-24-hours", label: last24Hours },
15969
- { key: "this-week", label: thisWeek },
15970
- { key: "last-week", label: lastWeek },
15971
- { key: "last-7-days", label: last7Days },
15972
- { key: "this-month", label: thisMonth },
15973
- { key: "last-month", label: lastMonth },
15974
- { key: "last-30-days", label: last30Days },
15975
- { key: "this-quarter", label: thisQuarter },
15976
- { key: "last-quarter", label: lastQuarter },
15977
- { key: "last-90-days", label: last90Days },
15978
- { key: "this-year", label: thisYear },
15979
- { key: "last-year", label: lastYear },
15980
- { key: "last-365-days", label: last365Days }
15981
- ];
15982
- }
15983
- function endOfDay(d) {
15984
- return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 23, 59, 59, 999);
15985
- }
15986
- function calculateDateRange(presetKey) {
15987
- const now = /* @__PURE__ */ new Date();
15988
- const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
15989
- switch (presetKey) {
15990
- case "today":
15991
- return { start: today, end: endOfDay(today) };
15992
- case "yesterday": {
15993
- const yesterday = new Date(today);
15994
- yesterday.setDate(today.getDate() - 1);
15995
- return { start: yesterday, end: endOfDay(yesterday) };
15996
- }
15997
- case "this-week": {
15998
- const dayOfWeek = today.getDay();
15999
- const sunday = new Date(today);
16000
- sunday.setDate(today.getDate() - dayOfWeek);
16001
- const saturday = new Date(sunday);
16002
- saturday.setDate(sunday.getDate() + 6);
16003
- return { start: sunday, end: endOfDay(saturday) };
16004
- }
16005
- case "last-week": {
16006
- const dayOfWeek = today.getDay();
16007
- const lastSunday = new Date(today);
16008
- lastSunday.setDate(today.getDate() - dayOfWeek - 7);
16009
- const lastSaturday = new Date(lastSunday);
16010
- lastSaturday.setDate(lastSunday.getDate() + 6);
16011
- return { start: lastSunday, end: endOfDay(lastSaturday) };
16012
- }
16013
- case "this-month": {
16014
- const firstDay = new Date(now.getFullYear(), now.getMonth(), 1);
16015
- const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0);
16016
- return { start: firstDay, end: endOfDay(lastDay) };
16017
- }
16018
- case "last-month": {
16019
- const firstDay = new Date(now.getFullYear(), now.getMonth() - 1, 1);
16020
- const lastDay = new Date(now.getFullYear(), now.getMonth(), 0);
16021
- return { start: firstDay, end: endOfDay(lastDay) };
16022
- }
16023
- case "this-quarter": {
16024
- const quarter = Math.floor(now.getMonth() / 3);
16025
- const firstDay = new Date(now.getFullYear(), quarter * 3, 1);
16026
- const lastDay = new Date(now.getFullYear(), quarter * 3 + 3, 0);
16027
- return { start: firstDay, end: endOfDay(lastDay) };
16028
- }
16029
- case "last-quarter": {
16030
- const quarter = Math.floor(now.getMonth() / 3);
16031
- const firstDay = new Date(now.getFullYear(), (quarter - 1) * 3, 1);
16032
- const lastDay = new Date(now.getFullYear(), quarter * 3, 0);
16033
- return { start: firstDay, end: endOfDay(lastDay) };
16034
- }
16035
- case "this-year": {
16036
- const firstDay = new Date(now.getFullYear(), 0, 1);
16037
- const lastDay = new Date(now.getFullYear(), 11, 31);
16038
- return { start: firstDay, end: endOfDay(lastDay) };
16039
- }
16040
- case "last-year": {
16041
- const firstDay = new Date(now.getFullYear() - 1, 0, 1);
16042
- const lastDay = new Date(now.getFullYear() - 1, 11, 31);
16043
- return { start: firstDay, end: endOfDay(lastDay) };
16044
- }
16045
- case "last-24-hours":
16046
- return {
16047
- start: new Date(now.getTime() - 24 * 60 * 60 * 1e3),
16048
- end: now
16049
- };
16050
- case "last-7-days":
16051
- return {
16052
- start: new Date(now.getTime() - 7 * 24 * 60 * 60 * 1e3),
16053
- end: now
16054
- };
16055
- case "last-30-days":
16056
- return {
16057
- start: new Date(now.getTime() - 30 * 24 * 60 * 60 * 1e3),
16058
- end: now
16059
- };
16060
- case "last-90-days":
16061
- return {
16062
- start: new Date(now.getTime() - 90 * 24 * 60 * 60 * 1e3),
16063
- end: now
16064
- };
16065
- case "last-365-days":
16066
- return {
16067
- start: new Date(now.getTime() - 365 * 24 * 60 * 60 * 1e3),
16068
- end: now
16069
- };
16070
- default:
16071
- return { start: null, end: null };
16072
- }
16073
- }
16074
- function formatDateRange(range) {
16075
- if (!range.start && !range.end) return "";
16076
- const formatDate4 = (d) => {
16077
- if (!d) return "";
16078
- return d.toLocaleDateString("en-US", {
16079
- month: "short",
16080
- day: "numeric",
16081
- year: "numeric"
16082
- });
16083
- };
16084
- if (range.start && range.end) {
16085
- return `${formatDate4(range.start)} - ${formatDate4(range.end)}`;
16086
- }
16087
- return formatDate4(range.start || range.end);
16088
- }
16089
- function DateRangePicker({
16090
- value,
16091
- onChange,
16092
- presets,
16093
- activePreset,
16094
- placeholder = "Pick a date range",
16095
- className,
16096
- align = "auto",
16097
- showPresets = true,
16098
- variant = "desktop",
16099
- labels = {}
16100
- }) {
16101
- const finalPresets = presets || getDefaultPresets(labels);
16102
- const [isCalendarOpen, setIsCalendarOpen] = React13.useState(false);
16103
- const [leftMonth, setLeftMonth] = React13.useState(
16104
- () => value?.start?.getMonth() ?? (/* @__PURE__ */ new Date()).getMonth()
16105
- );
16106
- const [leftYear, setLeftYear] = React13.useState(
16107
- () => value?.start?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear()
16108
- );
16109
- const [rangeStart, setRangeStart] = React13.useState(
16110
- value?.start ?? null
16111
- );
16112
- const [rangeEnd, setRangeEnd] = React13.useState(
16113
- value?.end ?? null
16114
- );
16115
- const [selectingEnd, setSelectingEnd] = React13.useState(false);
16116
- const [hoverDate, setHoverDate] = React13.useState(null);
16117
- const calendarRef = React13.useRef(null);
16118
- const triggerRef = React13.useRef(null);
16119
- const [resolvedAlign, setResolvedAlign] = React13.useState(
16120
- align === "end" ? "end" : "start"
16121
- );
16122
- const isMobileVariant = variant === "mobile";
16123
- const isResponsive = variant === "responsive";
16124
- const focusTrapRef = useFocusTrap(
16125
- isMobileVariant && isCalendarOpen
16126
- );
16127
- const rightMonth = leftMonth === 11 ? 0 : leftMonth + 1;
16128
- const rightYear = leftMonth === 11 ? leftYear + 1 : leftYear;
16129
- React13.useEffect(() => {
16130
- if (!value) {
16131
- setRangeStart(null);
16132
- setRangeEnd(null);
16133
- return;
16134
- }
16135
- setRangeStart(value.start ?? null);
16136
- setRangeEnd(value.end ?? null);
16137
- }, [value]);
16138
- const wrapperRef = React13.useRef(null);
16139
- const outsideRefs = React13.useMemo(
16140
- () => [wrapperRef, calendarRef],
16141
- [calendarRef]
16142
- );
16143
- useClickOutside(
16144
- outsideRefs,
16145
- () => {
16146
- setIsCalendarOpen(false);
16147
- setSelectingEnd(false);
16148
- },
16149
- isCalendarOpen
16150
- );
16151
- const { anchorRef, floatingRef, style } = useAnchoredPosition({
16152
- open: !isMobileVariant && isCalendarOpen,
16153
- placement: resolvedAlign === "end" ? "bottom-end" : "bottom-start"
16154
- });
16155
- useEscapeKey(() => {
16156
- setIsCalendarOpen(false);
16157
- setSelectingEnd(false);
16158
- triggerRef.current?.focus();
16159
- }, isCalendarOpen);
16160
- React13.useEffect(() => {
16161
- if (isStorybookDocsMode()) return;
16162
- if (isMobileVariant && isCalendarOpen) {
16163
- const prev = document.body.style.overflow;
16164
- document.body.style.overflow = "hidden";
16165
- return () => {
16166
- document.body.style.overflow = prev;
16167
- };
16168
- }
16169
- }, [isMobileVariant, isCalendarOpen]);
16170
- React13.useLayoutEffect(() => {
16171
- if (isMobileVariant || !isCalendarOpen) return;
16172
- if (align === "start" || align === "end") {
16173
- setResolvedAlign(align);
16174
- return;
16175
- }
16176
- if (typeof window === "undefined") return;
16177
- const trigger = triggerRef.current;
16178
- if (!trigger) return;
16179
- const rect = trigger.getBoundingClientRect();
16180
- const estimatedPopupWidth = showPresets ? 840 : 640;
16181
- const margin = 8;
16182
- const overflowsRight = rect.left + estimatedPopupWidth > window.innerWidth - margin;
16183
- const fitsLeftAligned = rect.right - estimatedPopupWidth >= margin;
16184
- setResolvedAlign(overflowsRight && fitsLeftAligned ? "end" : "start");
16185
- }, [align, isCalendarOpen, isMobileVariant, showPresets]);
16186
- const handlePresetSelect = (presetKey) => {
16187
- const range = calculateDateRange(presetKey);
16188
- setRangeStart(range.start);
16189
- setRangeEnd(range.end);
16190
- setSelectingEnd(false);
16191
- setIsCalendarOpen(false);
16192
- if (range.start) {
16193
- setLeftMonth(range.start.getMonth());
16194
- setLeftYear(range.start.getFullYear());
16195
- }
16196
- onChange(range, presetKey);
16197
- };
16198
- const handleDayClick = (day, month, year) => {
16199
- const clicked = new Date(year, month, day);
16200
- if (!selectingEnd) {
16201
- setRangeStart(clicked);
16202
- setRangeEnd(null);
16203
- setSelectingEnd(true);
16204
- } else {
16205
- let start = rangeStart;
16206
- let end = clicked;
16207
- if (end < start) {
16208
- [start, end] = [end, start];
16209
- }
16210
- setRangeStart(start);
16211
- setRangeEnd(end);
16212
- setSelectingEnd(false);
16213
- if (variant !== "mobile") {
16214
- setIsCalendarOpen(false);
16215
- }
16216
- onChange({ start, end });
16217
- }
16218
- };
16219
- const toggleCalendar = () => {
16220
- if (!isCalendarOpen) {
16221
- if (value?.start) {
16222
- setRangeStart(value.start);
16223
- setRangeEnd(value.end ?? null);
16224
- setLeftMonth(value.start.getMonth());
16225
- setLeftYear(value.start.getFullYear());
16226
- } else {
16227
- const now = /* @__PURE__ */ new Date();
16228
- setLeftMonth(now.getMonth());
16229
- setLeftYear(now.getFullYear());
16230
- }
16231
- setSelectingEnd(false);
16232
- }
16233
- setIsCalendarOpen(!isCalendarOpen);
16234
- };
16235
- const goToPrevMonth = () => {
16236
- if (leftMonth === 0) {
16237
- setLeftMonth(11);
16238
- setLeftYear(leftYear - 1);
16239
- } else {
16240
- setLeftMonth(leftMonth - 1);
16241
- }
16242
- };
16243
- const goToNextMonth = () => {
16244
- if (leftMonth === 11) {
16245
- setLeftMonth(0);
16246
- setLeftYear(leftYear + 1);
16247
- } else {
16248
- setLeftMonth(leftMonth + 1);
16249
- }
16250
- };
16251
- const getDaysInMonth = (month, year) => new Date(year, month + 1, 0).getDate();
16252
- const getFirstDayOfMonth = (month, year) => new Date(year, month, 1).getDay();
16253
- const isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
16254
- const isInRange = (date) => {
16255
- const start = rangeStart;
16256
- const end = selectingEnd ? hoverDate : rangeEnd;
16257
- if (!start || !end) return false;
16258
- const [lo, hi] = start <= end ? [start, end] : [end, start];
16259
- return date > lo && date < hi;
16260
- };
16261
- const isStart = (date) => {
16262
- if (!rangeStart) return false;
16263
- return isSameDay(date, rangeStart);
16264
- };
16265
- const isEnd = (date) => {
16266
- const end = selectingEnd ? hoverDate : rangeEnd;
16267
- if (!end) return false;
16268
- return isSameDay(date, end);
16269
- };
16270
- const isToday = (date) => {
16271
- const today = /* @__PURE__ */ new Date();
16272
- return isSameDay(date, today);
16273
- };
16274
- const displayValue = value ? formatDateRange(value) : "";
16275
- const monthNames = React13.useMemo(
16276
- () => Array.from(
16277
- { length: 12 },
16278
- (_, i) => new Intl.DateTimeFormat(void 0, { month: "long" }).format(
16279
- new Date(2e3, i, 1)
16280
- )
16281
- ),
16282
- []
16283
- );
16284
- const weekdayNames = React13.useMemo(
16285
- () => Array.from(
16286
- { length: 7 },
16287
- (_, i) => new Intl.DateTimeFormat(void 0, { weekday: "short" }).format(
16288
- new Date(1970, 0, 4 + i)
16289
- )
16290
- ),
16291
- []
16292
- );
16293
- const renderMonthGrid = (month, year) => {
16294
- const daysInMonth = getDaysInMonth(month, year);
16295
- const firstDay = getFirstDayOfMonth(month, year);
16296
- const prevMonth = month === 0 ? 11 : month - 1;
16297
- const prevYear = month === 0 ? year - 1 : year;
16298
- const daysInPrevMonth = getDaysInMonth(prevMonth, prevYear);
16299
- const cells = [];
16300
- for (let i = firstDay - 1; i >= 0; i--) {
16301
- cells.push({
16302
- day: daysInPrevMonth - i,
16303
- month: prevMonth,
16304
- year: prevYear,
16305
- isCurrentMonth: false
16306
- });
16307
- }
16308
- for (let i = 1; i <= daysInMonth; i++) {
16309
- cells.push({ day: i, month, year, isCurrentMonth: true });
16310
- }
16311
- const nextMonth = month === 11 ? 0 : month + 1;
16312
- const nextYear = month === 11 ? year + 1 : year;
16313
- const remaining = 42 - cells.length;
16314
- for (let i = 1; i <= remaining; i++) {
16315
- cells.push({
16316
- day: i,
16317
- month: nextMonth,
16318
- year: nextYear,
16319
- isCurrentMonth: false
16320
- });
16321
- }
16322
- return /* @__PURE__ */ jsxs("div", { className: "w-[280px]", "data-slot": "date-range-grid", children: [
16323
- /* @__PURE__ */ jsx("div", { className: "mb-1 grid grid-cols-7", "data-slot": "date-range-weekdays", children: weekdayNames.map((dayName) => /* @__PURE__ */ jsx(
16324
- "div",
16325
- {
16326
- className: "text-muted-foreground py-1 text-center text-xs font-medium",
16327
- "data-slot": "date-range-weekday",
16328
- children: dayName
16329
- },
16330
- dayName
16331
- )) }),
16332
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-7", "data-slot": "date-range-day-grid", children: cells.map((cell, index) => {
16333
- const date = new Date(cell.year, cell.month, cell.day);
16334
- const inRange = isInRange(date);
16335
- const start = isStart(date);
16336
- const end = isEnd(date);
16337
- const today = isToday(date);
16338
- return /* @__PURE__ */ jsx(
16339
- "button",
16340
- {
16341
- type: "button",
16342
- "data-slot": "date-range-day",
16343
- onClick: () => handleDayClick(cell.day, cell.month, cell.year),
16344
- onMouseEnter: () => {
16345
- if (selectingEnd) {
16346
- setHoverDate(date);
16347
- }
16348
- },
16349
- className: cn(
16350
- "relative h-9 w-10 text-center text-sm",
16351
- "focus:ring-ring focus:z-10 focus:ring-2 focus:outline-none",
16352
- "transition-colors",
16353
- // Not current month — dimmed
16354
- !cell.isCurrentMonth && "text-muted-foreground/50",
16355
- // Current month — normal
16356
- cell.isCurrentMonth && "text-foreground",
16357
- // Hover
16358
- "hover:bg-muted",
16359
- // In range background
16360
- inRange && "bg-muted",
16361
- // Start date
16362
- start && "bg-foreground text-background hover:bg-foreground rounded-s-md font-semibold",
16363
- // End date
16364
- end && !start && "border-foreground text-foreground rounded-e-md border font-semibold",
16365
- // Today indicator (only if not start/end)
16366
- today && !start && !end && "font-semibold"
16367
- ),
16368
- children: cell.day
16369
- },
16370
- index
16371
- );
16372
- }) })
16373
- ] });
16374
- };
16375
- return /* @__PURE__ */ jsxs(
16376
- "div",
16377
- {
16378
- ref: (node) => {
16379
- wrapperRef.current = node;
16380
- anchorRef.current = node;
16381
- },
16382
- className: cn("relative inline-block", className),
16383
- "data-slot": "date-range-picker",
16384
- children: [
16385
- /* @__PURE__ */ jsxs(
16386
- "button",
16387
- {
16388
- ref: triggerRef,
16389
- type: "button",
16390
- onClick: toggleCalendar,
16391
- "aria-expanded": isCalendarOpen,
16392
- "aria-haspopup": "dialog",
16393
- "data-slot": "date-range-trigger",
16394
- className: cn(
16395
- "border-input bg-background hover:bg-muted",
16396
- "inline-flex w-[300px] items-center gap-2 rounded-md border px-4 py-2 text-start text-sm font-normal",
16397
- "focus:ring-ring focus:ring-2 focus:outline-none",
16398
- "transition-colors",
16399
- !displayValue && "text-muted-foreground"
16400
- ),
16401
- children: [
16402
- /* @__PURE__ */ jsx(Calendar$1, { className: "h-4 w-4", "data-slot": "date-range-trigger-icon" }),
16403
- displayValue || placeholder
16404
- ]
16405
- }
16406
- ),
16407
- isMobileVariant && isCalendarOpen && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
16408
- /* @__PURE__ */ jsx(
16409
- "div",
16410
- {
16411
- "data-slot": "date-range-mobile-overlay",
16412
- className: "fixed inset-0 z-50 flex items-end justify-center bg-black/40",
16413
- onClick: (event) => {
16414
- if (event.target !== event.currentTarget) return;
16415
- setIsCalendarOpen(false);
16416
- setSelectingEnd(false);
16417
- setHoverDate(null);
16418
- if (triggerRef.current instanceof HTMLElement) {
16419
- triggerRef.current.focus();
16420
- }
16421
- },
16422
- children: /* @__PURE__ */ jsxs(
16423
- "div",
16424
- {
16425
- ref: (node) => {
16426
- calendarRef.current = node;
16427
- focusTrapRef.current = node;
16428
- },
16429
- className: "bg-background animate-in slide-in-from-bottom max-h-[90vh] w-full max-w-md overflow-y-auto rounded-t-2xl px-6 pt-4 pb-6 shadow-xl",
16430
- role: "dialog",
16431
- "aria-modal": "true",
16432
- "aria-labelledby": "mobile-date-range-title",
16433
- "data-slot": "date-range-mobile-sheet",
16434
- children: [
16435
- /* @__PURE__ */ jsx(
16436
- "div",
16437
- {
16438
- className: "bg-muted mx-auto mb-4 h-1 w-10 rounded-full",
16439
- "data-slot": "date-range-mobile-handle"
16440
- }
16441
- ),
16442
- /* @__PURE__ */ jsx(
16443
- "h3",
16444
- {
16445
- id: "mobile-date-range-title",
16446
- className: "mb-4 text-lg font-semibold",
16447
- "data-slot": "date-range-mobile-title",
16448
- children: placeholder
16449
- }
16450
- ),
16451
- /* @__PURE__ */ jsxs(
16452
- "div",
16453
- {
16454
- className: "mb-3 flex items-center justify-center gap-4",
16455
- "data-slot": "date-range-month-header",
16456
- children: [
16457
- /* @__PURE__ */ jsx(
16458
- "button",
16459
- {
16460
- type: "button",
16461
- onClick: goToPrevMonth,
16462
- className: "hover:bg-muted rounded-md p-1 transition-colors",
16463
- "aria-label": "Previous month",
16464
- "data-slot": "date-range-nav",
16465
- children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4 rtl:-scale-x-100" })
16466
- }
16467
- ),
16468
- /* @__PURE__ */ jsxs(
16469
- "div",
16470
- {
16471
- className: "text-sm font-medium",
16472
- "data-slot": "date-range-month-label",
16473
- children: [
16474
- monthNames[leftMonth],
16475
- " ",
16476
- leftYear
16477
- ]
16478
- }
16479
- ),
16480
- /* @__PURE__ */ jsx(
16481
- "button",
16482
- {
16483
- type: "button",
16484
- onClick: goToNextMonth,
16485
- className: "hover:bg-muted rounded-md p-1 transition-colors",
16486
- "aria-label": "Next month",
16487
- "data-slot": "date-range-nav",
16488
- children: /* @__PURE__ */ jsx(ChevronRight$1, { className: "h-4 w-4 rtl:-scale-x-100" })
16489
- }
16490
- )
16491
- ]
16492
- }
16493
- ),
16494
- /* @__PURE__ */ jsx(
16495
- "div",
16496
- {
16497
- className: "flex justify-center",
16498
- onMouseLeave: () => setHoverDate(null),
16499
- children: renderMonthGrid(leftMonth, leftYear)
16500
- }
16501
- ),
16502
- /* @__PURE__ */ jsx(
16503
- "button",
16504
- {
16505
- type: "button",
16506
- "data-slot": "date-range-mobile-done",
16507
- onClick: () => {
16508
- setIsCalendarOpen(false);
16509
- setSelectingEnd(false);
16510
- if (triggerRef.current instanceof HTMLElement) {
16511
- triggerRef.current.focus();
16512
- }
16513
- },
16514
- className: "border-input hover:bg-muted mt-6 w-full rounded-lg border py-3 text-sm font-medium transition-colors",
16515
- children: labels?.done ?? "Done"
16516
- }
16517
- )
16518
- ]
16519
- }
16520
- )
16521
- }
16522
- ),
16523
- !isMobileVariant && isCalendarOpen && createPortal(
16524
- /* @__PURE__ */ jsx(
16525
- "div",
16526
- {
16527
- ref: (node) => {
16528
- calendarRef.current = node;
16529
- floatingRef.current = node;
16530
- },
16531
- style,
16532
- className: cn(
16533
- "overflow-auto",
16534
- "bg-background border-border rounded-lg border shadow-lg"
16535
- ),
16536
- role: "dialog",
16537
- "aria-label": "Choose date range",
16538
- "data-slot": "date-range-popup",
16539
- children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
16540
- showPresets && /* @__PURE__ */ jsx(
16541
- "div",
16542
- {
16543
- className: cn(
16544
- "border-border flex w-[200px] shrink-0 flex-col gap-0.5 border-e p-3",
16545
- isResponsive && "hidden md:flex"
16546
- ),
16547
- "data-slot": "date-range-presets",
16548
- children: finalPresets.map((preset) => /* @__PURE__ */ jsx(
16549
- "button",
16550
- {
16551
- type: "button",
16552
- onClick: () => handlePresetSelect(preset.key),
16553
- "data-slot": "date-range-preset",
16554
- className: cn(
16555
- "rounded-md px-3 py-1.5 text-start text-sm transition-colors",
16556
- "hover:bg-muted",
16557
- activePreset === preset.key && "bg-primary-800 text-white"
16558
- ),
16559
- children: preset.label
16560
- },
16561
- preset.key
16562
- ))
16563
- }
16564
- ),
16565
- /* @__PURE__ */ jsxs("div", { className: "p-4", "data-slot": "date-range-calendar", children: [
16566
- /* @__PURE__ */ jsx(
16567
- "p",
16568
- {
16569
- className: "text-muted-foreground mb-4 text-sm",
16570
- "data-slot": "date-range-subtitle",
16571
- children: "Select a start and end date from the calendar."
16572
- }
16573
- ),
16574
- /* @__PURE__ */ jsxs(
16575
- "div",
16576
- {
16577
- className: "flex gap-8",
16578
- onMouseLeave: () => setHoverDate(null),
16579
- "data-slot": "date-range-calendars",
16580
- children: [
16581
- /* @__PURE__ */ jsxs("div", { children: [
16582
- /* @__PURE__ */ jsxs(
16583
- "div",
16584
- {
16585
- className: "mb-3 flex items-center",
16586
- "data-slot": "date-range-month-header",
16587
- children: [
16588
- /* @__PURE__ */ jsx(
16589
- "button",
16590
- {
16591
- type: "button",
16592
- onClick: goToPrevMonth,
16593
- className: "hover:bg-muted rounded-md p-1 transition-colors",
16594
- "aria-label": "Previous month",
16595
- "data-slot": "date-range-nav",
16596
- children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4 rtl:-scale-x-100" })
16597
- }
16598
- ),
16599
- /* @__PURE__ */ jsxs(
16600
- "div",
16601
- {
16602
- className: "flex-1 text-center text-sm font-medium",
16603
- "data-slot": "date-range-month-label",
16604
- children: [
16605
- monthNames[leftMonth],
16606
- " ",
16607
- leftYear
16608
- ]
16609
- }
16610
- ),
16611
- isResponsive && /* @__PURE__ */ jsx(
16612
- "button",
16613
- {
16614
- type: "button",
16615
- onClick: goToNextMonth,
16616
- className: "hover:bg-muted rounded-md p-1 transition-colors md:hidden",
16617
- "aria-label": "Next month",
16618
- "data-slot": "date-range-nav",
16619
- children: /* @__PURE__ */ jsx(ChevronRight$1, { className: "h-4 w-4 rtl:-scale-x-100" })
16620
- }
16621
- )
16622
- ]
16623
- }
16624
- ),
16625
- renderMonthGrid(leftMonth, leftYear)
16626
- ] }),
16627
- /* @__PURE__ */ jsxs("div", { className: cn(isResponsive && "hidden md:block"), children: [
16628
- /* @__PURE__ */ jsxs(
16629
- "div",
16630
- {
16631
- className: "mb-3 flex items-center",
16632
- "data-slot": "date-range-month-header",
16633
- children: [
16634
- /* @__PURE__ */ jsxs(
16635
- "div",
16636
- {
16637
- className: "flex-1 text-center text-sm font-medium",
16638
- "data-slot": "date-range-month-label",
16639
- children: [
16640
- monthNames[rightMonth],
16641
- " ",
16642
- rightYear
16643
- ]
16644
- }
16645
- ),
16646
- /* @__PURE__ */ jsx(
16647
- "button",
16648
- {
16649
- type: "button",
16650
- onClick: goToNextMonth,
16651
- className: "hover:bg-muted rounded-md p-1 transition-colors",
16652
- "aria-label": "Next month",
16653
- "data-slot": "date-range-nav",
16654
- children: /* @__PURE__ */ jsx(ChevronRight$1, { className: "h-4 w-4 rtl:-scale-x-100" })
16655
- }
16656
- )
16657
- ]
16658
- }
16659
- ),
16660
- renderMonthGrid(rightMonth, rightYear)
16661
- ] })
16662
- ]
16663
- }
16664
- )
16665
- ] })
16666
- ] })
16667
- }
16668
- ),
16669
- document.body
16670
- )
16671
- ]
16672
- }
16673
- );
16674
- }
16675
- function DateRangeFilter({
16676
- value: _value,
16677
- onChange,
16678
- presets,
16679
- activePreset,
16680
- variant = "outline",
16681
- className,
16682
- labels = {}
16683
- }) {
16684
- const finalPresets = presets || getDefaultPresets(labels);
16685
- const activeLabel = finalPresets.find((p) => p.key === activePreset)?.label;
16686
- const handlePresetSelect = (presetKey) => {
16687
- const range = calculateDateRange(presetKey);
16688
- onChange(range, presetKey);
16689
- };
16690
- return /* @__PURE__ */ jsx(
16691
- Dropdown,
16692
- {
16693
- trigger: /* @__PURE__ */ jsxs(Button, { variant, size: "md", className, children: [
16694
- /* @__PURE__ */ jsx(Calendar$1, { className: "me-2 h-4 w-4" }),
16695
- activeLabel || labels.filter || "Filter by Date",
16696
- /* @__PURE__ */ jsx(ChevronDown$1, { className: "ms-2 h-3 w-3" })
16697
- ] }),
16698
- className: "w-56",
16699
- "data-slot": "date-range-filter",
16700
- children: finalPresets.map((preset) => /* @__PURE__ */ jsx(
16701
- DropdownItem,
16702
- {
16703
- onClick: () => handlePresetSelect(preset.key),
16704
- className: cn(
16705
- activePreset === preset.key && "bg-primary/10 text-primary"
16706
- ),
16707
- children: preset.label
16708
- },
16709
- preset.key
16710
- ))
16711
- }
16712
- );
16713
- }
16714
13784
  function DropZone({
16715
13785
  onFilesSelected,
16716
13786
  acceptedFileTypes,
@@ -17565,7 +14635,7 @@ function CameraViewfinder({
17565
14635
  function PermissionDeniedMessage({ onRetry }) {
17566
14636
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-8", children: [
17567
14637
  /* @__PURE__ */ jsxs(Alert, { variant: "warning", className: "w-full", children: [
17568
- /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5" }),
14638
+ /* @__PURE__ */ jsx(AlertCircle$1, { className: "h-5 w-5" }),
17569
14639
  /* @__PURE__ */ jsx(AlertTitle, { children: "Camera access denied" }),
17570
14640
  /* @__PURE__ */ jsx(AlertDescription, { children: "Please allow camera access in your browser settings to use this feature. You may need to refresh the page after changing permissions." })
17571
14641
  ] }),
@@ -17577,12 +14647,12 @@ function PermissionDeniedMessage({ onRetry }) {
17577
14647
  /* @__PURE__ */ jsx("li", { children: "Click the button below to try again" })
17578
14648
  ] })
17579
14649
  ] }),
17580
- /* @__PURE__ */ jsx(Button, { onClick: onRetry, leftIcon: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }), children: "Try again" })
14650
+ /* @__PURE__ */ jsx(Button, { onClick: onRetry, leftIcon: /* @__PURE__ */ jsx(RefreshCw$1, { className: "h-4 w-4" }), children: "Try again" })
17581
14651
  ] });
17582
14652
  }
17583
14653
  function CameraUnavailableMessage() {
17584
14654
  return /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center gap-4 py-8", children: /* @__PURE__ */ jsxs(Alert, { variant: "danger", children: [
17585
- /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5" }),
14655
+ /* @__PURE__ */ jsx(AlertCircle$1, { className: "h-5 w-5" }),
17586
14656
  /* @__PURE__ */ jsx(AlertTitle, { children: "Camera unavailable" }),
17587
14657
  /* @__PURE__ */ jsx(AlertDescription, { children: "No camera was detected on this device. Please ensure your camera is connected and not in use by another application." })
17588
14658
  ] }) });
@@ -17607,7 +14677,7 @@ function PhotoPreview({
17607
14677
  {
17608
14678
  variant: "secondary",
17609
14679
  onClick: onRetake,
17610
- leftIcon: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }),
14680
+ leftIcon: /* @__PURE__ */ jsx(RefreshCw$1, { className: "h-4 w-4" }),
17611
14681
  children: "Retake"
17612
14682
  }
17613
14683
  ),
@@ -17808,7 +14878,7 @@ function WebcamModal({
17808
14878
  onClick: switchCamera,
17809
14879
  disabled: !isReady,
17810
14880
  "aria-label": `Switch to ${currentFacingMode === "user" ? "back" : "front"} camera`,
17811
- children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-5 w-5" })
14881
+ children: /* @__PURE__ */ jsx(RefreshCw$1, { className: "h-5 w-5" })
17812
14882
  }
17813
14883
  ),
17814
14884
  /* @__PURE__ */ jsx(
@@ -18094,7 +15164,7 @@ function DocumentScanner({
18094
15164
  if (state === "error") {
18095
15165
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 py-8", children: [
18096
15166
  /* @__PURE__ */ jsxs(Alert, { variant: "danger", className: "w-full", children: [
18097
- /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5" }),
15167
+ /* @__PURE__ */ jsx(AlertCircle$1, { className: "h-5 w-5" }),
18098
15168
  /* @__PURE__ */ jsx(AlertTitle, { children: "Processing failed" }),
18099
15169
  /* @__PURE__ */ jsx(AlertDescription, { children: error })
18100
15170
  ] }),
@@ -18121,7 +15191,7 @@ function DocumentScanner({
18121
15191
  dismissible: true,
18122
15192
  onDismiss: () => setValidationErrors([]),
18123
15193
  children: [
18124
- /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5" }),
15194
+ /* @__PURE__ */ jsx(AlertCircle$1, { className: "h-5 w-5" }),
18125
15195
  /* @__PURE__ */ jsx(AlertTitle, { children: "Some files were not added" }),
18126
15196
  /* @__PURE__ */ jsx(AlertDescription, { children: /* @__PURE__ */ jsx("ul", { className: "mt-2 list-inside list-disc space-y-1", children: validationErrors.map((err, index) => /* @__PURE__ */ jsxs("li", { className: "text-sm", children: [
18127
15197
  /* @__PURE__ */ jsxs("strong", { children: [
@@ -18263,7 +15333,7 @@ function DocumentScanner({
18263
15333
  dismissible: true,
18264
15334
  onDismiss: () => setValidationErrors([]),
18265
15335
  children: [
18266
- /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5" }),
15336
+ /* @__PURE__ */ jsx(AlertCircle$1, { className: "h-5 w-5" }),
18267
15337
  /* @__PURE__ */ jsx(AlertTitle, { children: "Invalid files" }),
18268
15338
  /* @__PURE__ */ jsx(AlertDescription, { children: /* @__PURE__ */ jsx("ul", { className: "mt-2 list-inside list-disc space-y-1", children: validationErrors.map((err, index) => /* @__PURE__ */ jsxs("li", { className: "text-sm", children: [
18269
15339
  /* @__PURE__ */ jsxs("strong", { children: [
@@ -20496,7 +17566,7 @@ function EmployeeProfileCard({
20496
17566
  "data-slot": "employee-card-toggle",
20497
17567
  children: isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
20498
17568
  lessDetails,
20499
- /* @__PURE__ */ jsx(ChevronUp$1, { className: "h-4 w-4" })
17569
+ /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
20500
17570
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
20501
17571
  moreDetails,
20502
17572
  /* @__PURE__ */ jsx(ChevronDown$1, { className: "h-4 w-4" })
@@ -28470,7 +25540,7 @@ function DetailItem({
28470
25540
  function AllergyRow({ allergies }) {
28471
25541
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
28472
25542
  /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [
28473
- /* @__PURE__ */ jsx(AlertCircle, { size: 16, className: "text-red-600 dark:text-red-400" }),
25543
+ /* @__PURE__ */ jsx(AlertCircle$1, { size: 16, className: "text-red-600 dark:text-red-400" }),
28474
25544
  /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold tracking-wide text-red-700 uppercase dark:text-red-400", children: "Allergies" })
28475
25545
  ] }),
28476
25546
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: allergies.map((a, i) => /* @__PURE__ */ jsx(
@@ -36582,7 +33652,7 @@ var ResultsEntryForm = React13.forwardRef(function ResultsEntryForm2({
36582
33652
  className: "flex items-center gap-2 font-semibold",
36583
33653
  "data-slot": "ref-no-providers-heading",
36584
33654
  children: [
36585
- /* @__PURE__ */ jsx(AlertCircle$1, { className: "text-warning h-5 w-5" }),
33655
+ /* @__PURE__ */ jsx(AlertCircle, { className: "text-warning h-5 w-5" }),
36586
33656
  noProviderContacts
36587
33657
  ]
36588
33658
  }
@@ -43714,7 +40784,7 @@ function WebChartReportViewer({
43714
40784
  onClick: onReconnect,
43715
40785
  className: "mt-2",
43716
40786
  children: [
43717
- /* @__PURE__ */ jsx(Link$1, { className: "me-2 h-4 w-4" }),
40787
+ /* @__PURE__ */ jsx(Link, { className: "me-2 h-4 w-4" }),
43718
40788
  reconnect
43719
40789
  ]
43720
40790
  }
@@ -43722,7 +40792,7 @@ function WebChartReportViewer({
43722
40792
  ] })
43723
40793
  ] }),
43724
40794
  !error && !loading && /* @__PURE__ */ jsxs(Button, { onClick: onRefreshReports, className: "mb-4", children: [
43725
- /* @__PURE__ */ jsx(RefreshCw$1, { className: "me-2 h-4 w-4" }),
40795
+ /* @__PURE__ */ jsx(RefreshCw, { className: "me-2 h-4 w-4" }),
43726
40796
  refreshReports
43727
40797
  ] }),
43728
40798
  /* @__PURE__ */ jsx(
@@ -43840,7 +40910,7 @@ function WebChartReportViewer({
43840
40910
  onClick: onRefreshReport,
43841
40911
  title: refreshReport,
43842
40912
  "aria-label": refreshReport,
43843
- children: /* @__PURE__ */ jsx(RefreshCw$1, { className: "h-4 w-4" })
40913
+ children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" })
43844
40914
  }
43845
40915
  )
43846
40916
  ]
@@ -44250,6 +41320,6 @@ function WebsiteInputGroup({
44250
41320
  }
44251
41321
  WebsiteInputGroup.displayName = "WebsiteInputGroup";
44252
41322
 
44253
- export { AIChat, AIChatModal, AIChatTrigger, AIReconciliationPanel, AccessDeniedPage, ActionButton2 as ActionButton, ActionButtonsBar, ActiveFilters, AddContactModal, AddServiceCard, AdditionalFields, Address, AddressCard, AddressCompact, AddressDisplay, AddressForm, AddressInline, AppHeader, AppHeaderActions, AppHeaderBrand, AppHeaderDivider, AppHeaderIconButton, AppHeaderSearch, AppHeaderSection, AppHeaderTitle, AppHeaderUserMenu, Assessment, AuthButtons, AuthDialog, BUSINESS_HOURS_END_OF_DAY, BookAppointmentButton, BookingDialog, BusinessHours, BusinessHoursEditor, CHANGE_TYPE_LABELS, CONCERN_STATUS_LABELS, CSVColumnMapper, CSVFileUpload, CardSkeleton, CaseContextBar, CaseManagementHeader, CheckrIntegration, ClaimListingButton, ClaimProviderForm, CodingChips, CommandPalette, CommandPaletteProvider, CommandPaletteTrigger, CompactCookieBanner, CompactFilterBar, CompactHeader, CompactHours, CompactProviderHeader, ConditionEditor, ConnectionStatusBadge, ConnectionStatusBar, ConnectionStatusOverlay, ConsentSwitch, CookieConsentBanner, CopyrightText, CountBadge, CountryDropdown, CreateInvoiceModal, CreateReferralModal, DEFAULT_BUSINESS_HOURS_EDITOR_LABELS, DEFAULT_ERROR_CONFIGS, DEFAULT_LANGUAGES, DEFAULT_RADIUS_OPTIONS, DEFAULT_SERVICE_PRICING_MANAGER_LABELS, DEFAULT_SOCIAL_PROVIDERS, DOTBadge, DashboardWidget, DashboardWidgetActions, DashboardWidgetDataCards, DashboardWidgetInfo, DashboardWidgetTable, DateRangeFilter, DateRangePicker, DialogOverlay, DisclaimerText, DockablePanel, DocumentDetectionOverlay, DocumentScanner, DropZone, DropzoneOverlay, EditUserRoleModal, EmployeeForm, EmployeeProfileCard, EmployerContactCard, EmployerList, EmployerPricingCard, EmployerServiceModal, EmployerView, ErrorPage, FileManager, FilePreview, FloatingAIChat, FloatingInput, FooterLinkSection, SocialMediaLinks2 as FooterSocialLinks, HRISProviderSelector, HandsFreeChat, HealthSurveillance, HelpSupportPanel, HeroSearchBar, HeyOzwell, HeyOzwellSelector, HeyOzwellToggle, HoursSummary, ImagingOrderEditor, InlineBookingForm, InventoryManager, InviteUserModal, InvoiceList, InvoicePaymentPage, InvoiceView, LabOrderEditor, LanguageSelector, LanguageSelectorInline, LanguageSelectorNative, LegalLinks, LoadingBar, LoadingDots, LoadingOverlay, LoadingPage, LoadingSkeleton, MODEL_MANIFEST, MaintenancePage, MobileBackButton, MobileMenuButton, MobileMenuPanel, ModelInfoList, NavLinks, NewsletterForm, NotFoundPage, NotificationCenter, ORDER_TYPE_META, ORDER_TYPE_SEARCH_DOMAINS, OfflinePage, OnboardingCompletion, OnboardingStepQuestion, OnboardingWizard, OpenStatusBadge, OrderCard, OrderConfirmation, OrderConfirmationWizard, OrderDetailSidebar, OrderEditor, OrderList, OrderLookupForm, OrderSidebar, OrderSidebarTabs, OzwellChat, OzwellSettingsMenu, PageHeader, PatientHeader, PaymentHistoryTable, PaymentMethodBank, PaymentMethodCard, PaymentMethodList, PendingClaimsTable, PermissionsEditor, PillSelect, PresentingProblems, ProblemList, ProcedureOrderEditor, ProductVersion, ProductVersionBadge, Breadcrumb2 as ProviderBreadcrumb, ProviderCard, ProviderCardGrid, ProviderCardSkeleton, ProviderDetailHeader, ProviderDetailHeaderSkeleton, ProviderLogo2 as ProviderLogo, ProviderOverview, ProviderSearchBar, ProviderSearchFilters, ProviderSelector, ProviderSettings, SocialMediaLinks as ProviderSocialLinks, ProviderUsersTable, QuickBookCard, QuickLinksCard, RELEVANCE_LABELS, RecurringServiceAddCard, RecurringServiceCard, RecurringServiceGrid, RecurringServiceSetupModal, ReferralEditor, RejectionModal, ReportDashboard, ReportDatePicker, ReportLink, ReportTimeRange, ResultsEntryCard, ResultsEntryForm, ResultsEntryModal, SSOConfigForm, ScheduleCalendar, SearchResultsMessage, SelectedServicesBadges, ServerErrorPage, ServiceAccordion, ServiceBadge, ServiceBadgeGroup, ServiceCard, ServiceCategoryBadge, ServiceGeneralSettings, ServiceGrid, ServiceLink, ServiceList, ServiceMultiSelect, ServicePicker, ServicePricingManager, ServiceSelect, ServiceShippingSettings, ServiceTagCloud, ServiceTagCloudBadges, SetupServiceModal, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMobileToggle, SidebarNav, SidebarNavGroup, SidebarNavItem, SidebarProvider, SidebarSearch, SidebarToggle, SimpleFooter, SiteFooter, SiteHeader, SiteLogo, StepIndicator, StripeBadge, StripeSecureBadge, SuggestedActions, TableOfContents, TimelineEventList, TimelineProgress, Toast, ToastContainer, ToastProvider, UncertaintyBadge, UpdateAvailableOverlay, UserMenu, VerifiedBadge2 as VerifiedBadge, VisitScribe, VoiceManager, VoiceSetup, WEBSITE_TYPES, WebChartReportViewer, WebcamModal, WebsiteInput, WebsiteInputGroup, attributeSegments, calculateDateRange, centroid, chime, clusterEmbeddings, concernGroupKey, concernHistoryContent, cosine, countBadgeVariants, countChipVariants, create24HourSchedule, createDefaultSchedule, createWeekdaySchedule, currentAssertion, defaultCaseManagementHeaderLabels, defaultHeyOzwellSelectorLabels, defaultOrderTabs, defaultReconciliationIsEqual, formatAddressLines, formatAddressSingleLine, formatCityState, formatCityStateZip, generateId, getDefaultPresets, getExtendedPresets, getGoogleMapsSearchUrl, getGoogleMapsUrl, getWakeWarm, inferSpeakerRoles, isConditionCodetype, isValidUrl, labelClusters, medicationToOrder, mergeTurns, normalizeClosingTime, normalizeConditionCodingSystem, openRollingRecorder, orderToMedication, orderTypeForCodetype, parseTimeInput, panelVariants as reconciliationPanelVariants, subscribeWakeWarm, useCamera, useCommandPalette, useConnectionStatus, useCookieConsent, useDiarization, useDocumentDetection, useDropzone, useFileUpload, useHeyOzwell, useOptionalToast, useSidebar, useSpeakerVerify, useToast, useVisitScribe, useVoiceSetup, useWakeWord, warmWakeModels, widgetVariants };
41323
+ export { AIChat, AIChatModal, AIChatTrigger, AIReconciliationPanel, AccessDeniedPage, ActionButton2 as ActionButton, ActionButtonsBar, ActiveFilters, AddContactModal, AddServiceCard, AdditionalFields, Address, AddressCard, AddressCompact, AddressDisplay, AddressForm, AddressInline, AppHeader, AppHeaderActions, AppHeaderBrand, AppHeaderDivider, AppHeaderIconButton, AppHeaderSearch, AppHeaderSection, AppHeaderTitle, AppHeaderUserMenu, AuthButtons, AuthDialog, BUSINESS_HOURS_END_OF_DAY, BookAppointmentButton, BookingDialog, BusinessHours, BusinessHoursEditor, CSVColumnMapper, CSVFileUpload, CardSkeleton, CaseContextBar, CaseManagementHeader, CheckrIntegration, ClaimListingButton, ClaimProviderForm, CommandPalette, CommandPaletteProvider, CommandPaletteTrigger, CompactCookieBanner, CompactFilterBar, CompactHeader, CompactHours, CompactProviderHeader, ConnectionStatusBadge, ConnectionStatusBar, ConnectionStatusOverlay, ConsentSwitch, CookieConsentBanner, CopyrightText, CountBadge, CountryDropdown, CreateInvoiceModal, CreateReferralModal, DEFAULT_BUSINESS_HOURS_EDITOR_LABELS, DEFAULT_ERROR_CONFIGS, DEFAULT_LANGUAGES, DEFAULT_RADIUS_OPTIONS, DEFAULT_SERVICE_PRICING_MANAGER_LABELS, DEFAULT_SOCIAL_PROVIDERS, DOTBadge, DashboardWidget, DashboardWidgetActions, DashboardWidgetDataCards, DashboardWidgetInfo, DashboardWidgetTable, DialogOverlay, DisclaimerText, DockablePanel, DocumentDetectionOverlay, DocumentScanner, DropZone, DropzoneOverlay, EditUserRoleModal, EmployeeForm, EmployeeProfileCard, EmployerContactCard, EmployerList, EmployerPricingCard, EmployerServiceModal, EmployerView, ErrorPage, FileManager, FilePreview, FloatingAIChat, FloatingInput, FooterLinkSection, SocialMediaLinks2 as FooterSocialLinks, HRISProviderSelector, HandsFreeChat, HealthSurveillance, HelpSupportPanel, HeroSearchBar, HeyOzwell, HeyOzwellSelector, HeyOzwellToggle, HoursSummary, ImagingOrderEditor, InlineBookingForm, InventoryManager, InviteUserModal, InvoiceList, InvoicePaymentPage, InvoiceView, LabOrderEditor, LanguageSelector, LanguageSelectorInline, LanguageSelectorNative, LegalLinks, LoadingBar, LoadingDots, LoadingOverlay, LoadingPage, LoadingSkeleton, MODEL_MANIFEST, MaintenancePage, MobileBackButton, MobileMenuButton, MobileMenuPanel, ModelInfoList, NavLinks, NewsletterForm, NotFoundPage, NotificationCenter, OfflinePage, OnboardingCompletion, OnboardingStepQuestion, OnboardingWizard, OpenStatusBadge, OrderCard, OrderConfirmation, OrderConfirmationWizard, OrderDetailSidebar, OrderEditor, OrderList, OrderLookupForm, OrderSidebar, OrderSidebarTabs, OzwellChat, OzwellSettingsMenu, PageHeader, PatientHeader, PaymentHistoryTable, PaymentMethodBank, PaymentMethodCard, PaymentMethodList, PendingClaimsTable, PermissionsEditor, PillSelect, PresentingProblems, ProcedureOrderEditor, ProductVersion, ProductVersionBadge, Breadcrumb2 as ProviderBreadcrumb, ProviderCard, ProviderCardGrid, ProviderCardSkeleton, ProviderDetailHeader, ProviderDetailHeaderSkeleton, ProviderLogo2 as ProviderLogo, ProviderOverview, ProviderSearchBar, ProviderSearchFilters, ProviderSelector, ProviderSettings, SocialMediaLinks as ProviderSocialLinks, ProviderUsersTable, QuickBookCard, QuickLinksCard, RELEVANCE_LABELS, RecurringServiceAddCard, RecurringServiceCard, RecurringServiceGrid, RecurringServiceSetupModal, ReferralEditor, RejectionModal, ReportDashboard, ReportDatePicker, ReportLink, ReportTimeRange, ResultsEntryCard, ResultsEntryForm, ResultsEntryModal, SSOConfigForm, ScheduleCalendar, SearchResultsMessage, SelectedServicesBadges, ServerErrorPage, ServiceAccordion, ServiceBadge, ServiceBadgeGroup, ServiceCard, ServiceCategoryBadge, ServiceGeneralSettings, ServiceGrid, ServiceLink, ServiceList, ServiceMultiSelect, ServicePicker, ServicePricingManager, ServiceSelect, ServiceShippingSettings, ServiceTagCloud, ServiceTagCloudBadges, SetupServiceModal, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMobileToggle, SidebarNav, SidebarNavGroup, SidebarNavItem, SidebarProvider, SidebarSearch, SidebarToggle, SimpleFooter, SiteFooter, SiteHeader, SiteLogo, StepIndicator, StripeBadge, StripeSecureBadge, SuggestedActions, TableOfContents, TimelineEventList, TimelineProgress, Toast, ToastContainer, ToastProvider, UpdateAvailableOverlay, UserMenu, VerifiedBadge2 as VerifiedBadge, VisitScribe, VoiceManager, VoiceSetup, WEBSITE_TYPES, WebChartReportViewer, WebcamModal, WebsiteInput, WebsiteInputGroup, attributeSegments, centroid, chime, clusterEmbeddings, cosine, countBadgeVariants, countChipVariants, create24HourSchedule, createDefaultSchedule, createWeekdaySchedule, defaultCaseManagementHeaderLabels, defaultHeyOzwellSelectorLabels, defaultOrderTabs, defaultReconciliationIsEqual, formatAddressLines, formatAddressSingleLine, formatCityState, formatCityStateZip, generateId, getGoogleMapsSearchUrl, getGoogleMapsUrl, getWakeWarm, inferSpeakerRoles, isValidUrl, labelClusters, medicationToOrder, mergeTurns, normalizeClosingTime, openRollingRecorder, orderToMedication, parseTimeInput, panelVariants as reconciliationPanelVariants, subscribeWakeWarm, useCamera, useCommandPalette, useConnectionStatus, useCookieConsent, useDiarization, useDocumentDetection, useDropzone, useFileUpload, useHeyOzwell, useOptionalToast, useSidebar, useSpeakerVerify, useToast, useVisitScribe, useVoiceSetup, useWakeWord, warmWakeModels, widgetVariants };
44254
41324
  //# sourceMappingURL=index.js.map
44255
41325
  //# sourceMappingURL=index.js.map