@mieweb/ui 0.6.1-dev.132 → 0.6.1-dev.134
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.
- package/README.md +46 -10
- package/dist/CsvBlock-7K6XVRYO.cjs +15 -0
- package/dist/CsvBlock-7K6XVRYO.cjs.map +1 -0
- package/dist/CsvBlock-AAV4QMSF.js +6 -0
- package/dist/CsvBlock-AAV4QMSF.js.map +1 -0
- package/dist/HtmlPreviewBlock-74XQF3KT.cjs +15 -0
- package/dist/HtmlPreviewBlock-74XQF3KT.cjs.map +1 -0
- package/dist/HtmlPreviewBlock-DNINC7RW.js +6 -0
- package/dist/HtmlPreviewBlock-DNINC7RW.js.map +1 -0
- package/dist/MermaidBlock-PKXGFGU6.js +6 -0
- package/dist/MermaidBlock-PKXGFGU6.js.map +1 -0
- package/dist/MermaidBlock-R4U7IHSZ.cjs +15 -0
- package/dist/MermaidBlock-R4U7IHSZ.cjs.map +1 -0
- package/dist/SurveyBlock-E52I4PW3.cjs +15 -0
- package/dist/SurveyBlock-E52I4PW3.cjs.map +1 -0
- package/dist/SurveyBlock-IULSBG22.js +6 -0
- package/dist/SurveyBlock-IULSBG22.js.map +1 -0
- package/dist/brands/index.cjs +12 -12
- package/dist/brands/index.js +3 -3
- package/dist/{chunk-2DS3RJ2D.js → chunk-33PO3J4O.js} +35 -3
- package/dist/chunk-33PO3J4O.js.map +1 -0
- package/dist/chunk-6RV7HQ4U.cjs +198 -0
- package/dist/chunk-6RV7HQ4U.cjs.map +1 -0
- package/dist/chunk-74NOFB34.cjs +137 -0
- package/dist/chunk-74NOFB34.cjs.map +1 -0
- package/dist/chunk-CPJIOOBM.js +196 -0
- package/dist/chunk-CPJIOOBM.js.map +1 -0
- package/dist/{chunk-R6PBBPU3.js → chunk-CYMZ2QS5.js} +2 -2
- package/dist/{chunk-R6PBBPU3.js.map → chunk-CYMZ2QS5.js.map} +1 -1
- package/dist/chunk-FGIIXD37.js +182 -0
- package/dist/chunk-FGIIXD37.js.map +1 -0
- package/dist/chunk-FZQAF3WA.cjs +154 -0
- package/dist/chunk-FZQAF3WA.cjs.map +1 -0
- package/dist/chunk-MHJMUKLA.js +89 -0
- package/dist/chunk-MHJMUKLA.js.map +1 -0
- package/dist/chunk-NCRYCG5G.js +135 -0
- package/dist/chunk-NCRYCG5G.js.map +1 -0
- package/dist/chunk-NSLR3B7K.js +318 -0
- package/dist/chunk-NSLR3B7K.js.map +1 -0
- package/dist/{chunk-Z6NRP4Z5.cjs → chunk-SNEQXSC5.cjs} +2 -2
- package/dist/{chunk-Z6NRP4Z5.cjs.map → chunk-SNEQXSC5.cjs.map} +1 -1
- package/dist/chunk-UL3PQ7HL.cjs +91 -0
- package/dist/chunk-UL3PQ7HL.cjs.map +1 -0
- package/dist/chunk-VO3NWSCQ.cjs +184 -0
- package/dist/chunk-VO3NWSCQ.cjs.map +1 -0
- package/dist/chunk-WGC3KOP7.js +148 -0
- package/dist/chunk-WGC3KOP7.js.map +1 -0
- package/dist/{chunk-IBZXDX4L.cjs → chunk-WHUD3XHR.cjs} +35 -3
- package/dist/chunk-WHUD3XHR.cjs.map +1 -0
- package/dist/chunk-Y65SK5Y2.cjs +338 -0
- package/dist/chunk-Y65SK5Y2.cjs.map +1 -0
- package/dist/components/Markdown/index.cjs +51 -0
- package/dist/components/Markdown/index.cjs.map +1 -0
- package/dist/components/Markdown/index.css +331 -0
- package/dist/components/Markdown/index.css.map +1 -0
- package/dist/components/Markdown/index.d.cts +82 -0
- package/dist/components/Markdown/index.d.ts +82 -0
- package/dist/components/Markdown/index.js +10 -0
- package/dist/components/Markdown/index.js.map +1 -0
- package/dist/components/Markdown/styles.css +351 -0
- package/dist/index.cjs +1244 -570
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +331 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +137 -1
- package/dist/index.d.ts +137 -1
- package/dist/index.js +1091 -456
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/package.json +23 -2
- package/dist/chunk-2DS3RJ2D.js.map +0 -1
- package/dist/chunk-IBZXDX4L.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
export { Toggle, toggleVariants } from './chunk-Y2S6QMKU.js';
|
|
1
2
|
export { VisuallyHidden } from './chunk-H2CIKJQI.js';
|
|
2
|
-
export { brands } from './chunk-
|
|
3
|
+
export { brands } from './chunk-CYMZ2QS5.js';
|
|
4
|
+
export { webchartBrand } from './chunk-CW66SO5O.js';
|
|
5
|
+
export { defaultBrand } from './chunk-PSTGFXQG.js';
|
|
3
6
|
export { enterpriseHealthBrand } from './chunk-MTZPVOP6.js';
|
|
4
7
|
export { miewebBrand } from './chunk-NERS5ZT6.js';
|
|
5
8
|
export { wagglelineBrand } from './chunk-2NTYAALC.js';
|
|
6
|
-
export { webchartBrand } from './chunk-CW66SO5O.js';
|
|
7
9
|
export { createBrandPreset, generateBrandCSS, generateTailwindTheme } from './chunk-WOYUQ4AT.js';
|
|
8
10
|
export { bluehiveBrand } from './chunk-3T7QGLNB.js';
|
|
9
11
|
export { ccmeBrand } from './chunk-SCQRJPSV.js';
|
|
10
12
|
export { ozwellBrand } from './chunk-5YUBQIC7.js';
|
|
11
|
-
export {
|
|
13
|
+
export { Slider, sliderRangeVariants, sliderThumbVariants, sliderTrackVariants } from './chunk-JBB25LFB.js';
|
|
12
14
|
import { Spinner, SpinnerWithLabel } from './chunk-VCO2IZOG.js';
|
|
13
15
|
export { FullPageSpinner, Spinner, SpinnerWithLabel, spinnerVariants } from './chunk-VCO2IZOG.js';
|
|
14
16
|
import { Switch } from './chunk-43GBCUSQ.js';
|
|
@@ -24,7 +26,8 @@ export { Textarea, textareaVariants } from './chunk-6LFG4JFF.js';
|
|
|
24
26
|
export { ThemeProvider, ThemeProviderContext, ThemeToggle, themeToggleIconVariants, themeToggleVariants, useThemeContext } from './chunk-I56VBDSC.js';
|
|
25
27
|
import { Tooltip } from './chunk-FZJBFJJR.js';
|
|
26
28
|
export { Tooltip } from './chunk-FZJBFJJR.js';
|
|
27
|
-
|
|
29
|
+
import { RecordButton } from './chunk-QVJBUWJQ.js';
|
|
30
|
+
export { RecordButton, formatDuration, recordButtonVariants } from './chunk-QVJBUWJQ.js';
|
|
28
31
|
export { RichTextEditor, convertAngleBracketsToMustache, processDictation } from './chunk-AEGYWRSL.js';
|
|
29
32
|
export { DateButton, DatePicker, RadioOption, SchedulePicker, TimeButton, TimePicker, dateButtonVariants, radioOptionVariants, timeButtonVariants } from './chunk-4DMZAVB2.js';
|
|
30
33
|
export { ScrollArea, scrollAreaVariants } from './chunk-BIT27PPD.js';
|
|
@@ -34,8 +37,13 @@ export { Separator, separatorVariants } from './chunk-BX6BTDTR.js';
|
|
|
34
37
|
export { Sheet, SheetBody, SheetClose, SheetDescription, SheetFooter, SheetHeader, SheetTitle, sheetContentVariants, sheetOverlayVariants } from './chunk-4LVPQ44A.js';
|
|
35
38
|
import { Skeleton } from './chunk-4Z6ZZKIY.js';
|
|
36
39
|
export { Skeleton, SkeletonCard, SkeletonTable, SkeletonText, skeletonVariants } from './chunk-4Z6ZZKIY.js';
|
|
37
|
-
export { Slider, sliderRangeVariants, sliderThumbVariants, sliderTrackVariants } from './chunk-JBB25LFB.js';
|
|
38
40
|
export { Label, labelVariants } from './chunk-DUPR6FEL.js';
|
|
41
|
+
export { CodeBlock, MarkdownRenderer, highlightCode, useMarkdown } from './chunk-NSLR3B7K.js';
|
|
42
|
+
export { CsvBlock } from './chunk-FGIIXD37.js';
|
|
43
|
+
export { HtmlPreviewBlock } from './chunk-NCRYCG5G.js';
|
|
44
|
+
export { MermaidBlock } from './chunk-WGC3KOP7.js';
|
|
45
|
+
export { SurveyBlock } from './chunk-CPJIOOBM.js';
|
|
46
|
+
export { FenceBlock } from './chunk-MHJMUKLA.js';
|
|
39
47
|
export { Pagination, SimplePagination, paginationButtonVariants } from './chunk-J3BU3JBX.js';
|
|
40
48
|
export { PhoneInput, PhoneInputGroup } from './chunk-OX2RIVN7.js';
|
|
41
49
|
import { Progress } from './chunk-IYIYL2SQ.js';
|
|
@@ -43,8 +51,6 @@ export { CircularProgress, Progress, circularProgressVariants, progressBarFillVa
|
|
|
43
51
|
export { QuickAction, QuickActionGroup, QuickActionIcons, quickActionIconVariants, quickActionVariants } from './chunk-3CJBUAJ4.js';
|
|
44
52
|
import { RadioGroup, Radio } from './chunk-EZKRAW2X.js';
|
|
45
53
|
export { Radio, RadioGroup, radioVariants } from './chunk-EZKRAW2X.js';
|
|
46
|
-
import { RecordButton } from './chunk-QVJBUWJQ.js';
|
|
47
|
-
export { RecordButton, formatDuration, recordButtonVariants } from './chunk-QVJBUWJQ.js';
|
|
48
54
|
import { Card, CardHeader, CardContent, CardTitle } from './chunk-6555OYRU.js';
|
|
49
55
|
export { Card, CardActions, CardBadge, CardCollapsible, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, CardMedia, CardStat, CardTitle, cardAccentVariants, cardVariants } from './chunk-6555OYRU.js';
|
|
50
56
|
import { Checkbox } from './chunk-XCLQZ4FV.js';
|
|
@@ -89,13 +95,13 @@ import { dateToDisplayFormat, isValidDate, displayFormatToDateString } from './c
|
|
|
89
95
|
export { calculateAge, dateToDisplayFormat, displayFormatToDateString, formatDateValue, isDateEmpty, isDateInFuture, isDateInPast, isValidDate, isValidDrivingAge, parseDateValue } from './chunk-RC2YMOMS.js';
|
|
90
96
|
import { isStorybookDocsMode } from './chunk-VSQF22GL.js';
|
|
91
97
|
export { isStorybookDocsMode } from './chunk-VSQF22GL.js';
|
|
92
|
-
export { miewebUIPreset, miewebUISafelist } from './chunk-
|
|
98
|
+
export { miewebUIPreset, miewebUISafelist } from './chunk-33PO3J4O.js';
|
|
93
99
|
import { Alert, AlertTitle, AlertDescription } from './chunk-MV3MTHWQ.js';
|
|
94
100
|
export { Alert, AlertDescription, AlertTitle, alertVariants } from './chunk-MV3MTHWQ.js';
|
|
95
101
|
import { cn } from './chunk-F3SOEIN2.js';
|
|
96
102
|
export { cn } from './chunk-F3SOEIN2.js';
|
|
97
|
-
import * as
|
|
98
|
-
import
|
|
103
|
+
import * as React49 from 'react';
|
|
104
|
+
import React49__default, { createContext, useState, useEffect, useCallback, useMemo, useContext, useRef } from 'react';
|
|
99
105
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
100
106
|
import { cva } from 'class-variance-authority';
|
|
101
107
|
import * as ReactDOM from 'react-dom';
|
|
@@ -569,8 +575,8 @@ function AdditionalFields({
|
|
|
569
575
|
className,
|
|
570
576
|
collapsible = true
|
|
571
577
|
}) {
|
|
572
|
-
const [isExpanded, setIsExpanded] =
|
|
573
|
-
const contentId =
|
|
578
|
+
const [isExpanded, setIsExpanded] = React49.useState(defaultExpanded);
|
|
579
|
+
const contentId = React49.useId();
|
|
574
580
|
const handleNameChange = (id, name) => {
|
|
575
581
|
const updated = value.map(
|
|
576
582
|
(entry) => entry.id === id ? { ...entry, name } : entry
|
|
@@ -1008,10 +1014,10 @@ function AddressForm({
|
|
|
1008
1014
|
className,
|
|
1009
1015
|
googlePlaces
|
|
1010
1016
|
}) {
|
|
1011
|
-
const generatedId =
|
|
1017
|
+
const generatedId = React49.useId();
|
|
1012
1018
|
const idPrefix = id || generatedId;
|
|
1013
|
-
const autocompleteRef =
|
|
1014
|
-
const inputRef =
|
|
1019
|
+
const autocompleteRef = React49.useRef(null);
|
|
1020
|
+
const inputRef = React49.useRef(null);
|
|
1015
1021
|
const mergedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
1016
1022
|
const mergedPlaceholders = { ...DEFAULT_PLACEHOLDERS, ...placeholders };
|
|
1017
1023
|
const handleChange = (field, fieldValue) => {
|
|
@@ -1020,7 +1026,7 @@ function AddressForm({
|
|
|
1020
1026
|
[field]: fieldValue
|
|
1021
1027
|
});
|
|
1022
1028
|
};
|
|
1023
|
-
|
|
1029
|
+
React49.useEffect(() => {
|
|
1024
1030
|
if (!googlePlaces?.enabled || !inputRef.current) return;
|
|
1025
1031
|
const googleMaps = globalThis.window?.google;
|
|
1026
1032
|
if (!googleMaps?.maps?.places?.Autocomplete) {
|
|
@@ -1881,7 +1887,7 @@ function ToolResultDisplay({
|
|
|
1881
1887
|
showRawData = false,
|
|
1882
1888
|
className
|
|
1883
1889
|
}) {
|
|
1884
|
-
const [showJson, setShowJson] =
|
|
1890
|
+
const [showJson, setShowJson] = React49.useState(false);
|
|
1885
1891
|
if (result.type === "error") {
|
|
1886
1892
|
return /* @__PURE__ */ jsx(
|
|
1887
1893
|
"div",
|
|
@@ -2043,7 +2049,7 @@ function MCPToolCallDisplay({
|
|
|
2043
2049
|
onLinkClick,
|
|
2044
2050
|
className
|
|
2045
2051
|
}) {
|
|
2046
|
-
const [showDetails, setShowDetails] =
|
|
2052
|
+
const [showDetails, setShowDetails] = React49.useState(!defaultCollapsed);
|
|
2047
2053
|
const formatDuration2 = (ms) => {
|
|
2048
2054
|
if (!ms) return null;
|
|
2049
2055
|
if (ms < 1e3) return `${ms}ms`;
|
|
@@ -2290,7 +2296,7 @@ function ContentBlock({
|
|
|
2290
2296
|
role,
|
|
2291
2297
|
renderTextContent
|
|
2292
2298
|
}) {
|
|
2293
|
-
const [isCollapsed, setIsCollapsed] =
|
|
2299
|
+
const [isCollapsed, setIsCollapsed] = React49.useState(
|
|
2294
2300
|
content.collapsed ?? false
|
|
2295
2301
|
);
|
|
2296
2302
|
if (content.type === "text" && content.text) {
|
|
@@ -2725,7 +2731,7 @@ function AttachmentPreviewItem({
|
|
|
2725
2731
|
);
|
|
2726
2732
|
}
|
|
2727
2733
|
AttachmentPreviewItem.displayName = "AttachmentPreviewItem";
|
|
2728
|
-
var AttachmentPicker =
|
|
2734
|
+
var AttachmentPicker = React49.forwardRef(
|
|
2729
2735
|
({
|
|
2730
2736
|
onFilesSelected,
|
|
2731
2737
|
acceptedTypes = ["image/*", "video/*", ".pdf", ".doc", ".docx"],
|
|
@@ -2738,8 +2744,8 @@ var AttachmentPicker = React48.forwardRef(
|
|
|
2738
2744
|
className,
|
|
2739
2745
|
children
|
|
2740
2746
|
}, ref) => {
|
|
2741
|
-
const inputRef =
|
|
2742
|
-
|
|
2747
|
+
const inputRef = React49.useRef(null);
|
|
2748
|
+
React49.useImperativeHandle(ref, () => inputRef.current);
|
|
2743
2749
|
const handleClick = () => {
|
|
2744
2750
|
inputRef.current?.click();
|
|
2745
2751
|
};
|
|
@@ -2831,8 +2837,8 @@ function DragDropZone({
|
|
|
2831
2837
|
children,
|
|
2832
2838
|
className
|
|
2833
2839
|
}) {
|
|
2834
|
-
const [isDragging, setIsDragging] =
|
|
2835
|
-
const dragCounterRef =
|
|
2840
|
+
const [isDragging, setIsDragging] = React49.useState(false);
|
|
2841
|
+
const dragCounterRef = React49.useRef(0);
|
|
2836
2842
|
const handleDragEnter = (event) => {
|
|
2837
2843
|
event.preventDefault();
|
|
2838
2844
|
event.stopPropagation();
|
|
@@ -2934,7 +2940,7 @@ function CameraButton({
|
|
|
2934
2940
|
disabled = false,
|
|
2935
2941
|
className
|
|
2936
2942
|
}) {
|
|
2937
|
-
const inputRef =
|
|
2943
|
+
const inputRef = React49.useRef(null);
|
|
2938
2944
|
const handleClick = () => {
|
|
2939
2945
|
inputRef.current?.click();
|
|
2940
2946
|
};
|
|
@@ -3072,7 +3078,7 @@ var sendButtonVariants = cva(
|
|
|
3072
3078
|
}
|
|
3073
3079
|
}
|
|
3074
3080
|
);
|
|
3075
|
-
var SendButton =
|
|
3081
|
+
var SendButton = React49.forwardRef(
|
|
3076
3082
|
({ className, variant, canSend, isLoading, disabled, ...props }, ref) => {
|
|
3077
3083
|
return /* @__PURE__ */ jsx(
|
|
3078
3084
|
"button",
|
|
@@ -3137,7 +3143,7 @@ var SendButton = React48.forwardRef(
|
|
|
3137
3143
|
}
|
|
3138
3144
|
);
|
|
3139
3145
|
SendButton.displayName = "SendButton";
|
|
3140
|
-
var MessageComposer =
|
|
3146
|
+
var MessageComposer = React49.forwardRef(
|
|
3141
3147
|
({
|
|
3142
3148
|
onSend,
|
|
3143
3149
|
onTypingStart,
|
|
@@ -3162,11 +3168,11 @@ var MessageComposer = React48.forwardRef(
|
|
|
3162
3168
|
inputTrailing,
|
|
3163
3169
|
className
|
|
3164
3170
|
}, ref) => {
|
|
3165
|
-
const textareaRef =
|
|
3166
|
-
const [internalContent, setInternalContent] =
|
|
3171
|
+
const textareaRef = React49.useRef(null);
|
|
3172
|
+
const [internalContent, setInternalContent] = React49.useState("");
|
|
3167
3173
|
const isControlled = controlledValue !== void 0;
|
|
3168
3174
|
const content = isControlled ? controlledValue : internalContent;
|
|
3169
|
-
const setContent =
|
|
3175
|
+
const setContent = React49.useCallback(
|
|
3170
3176
|
(val) => {
|
|
3171
3177
|
if (isControlled) {
|
|
3172
3178
|
const newVal = typeof val === "function" ? val(controlledValue) : val;
|
|
@@ -3177,20 +3183,20 @@ var MessageComposer = React48.forwardRef(
|
|
|
3177
3183
|
},
|
|
3178
3184
|
[isControlled, controlledValue, onValueChange]
|
|
3179
3185
|
);
|
|
3180
|
-
const [attachments, setAttachments] =
|
|
3186
|
+
const [attachments, setAttachments] = React49.useState(
|
|
3181
3187
|
[]
|
|
3182
3188
|
);
|
|
3183
|
-
const [isTyping, setIsTyping] =
|
|
3184
|
-
const typingTimeoutRef =
|
|
3185
|
-
|
|
3186
|
-
|
|
3189
|
+
const [isTyping, setIsTyping] = React49.useState(false);
|
|
3190
|
+
const typingTimeoutRef = React49.useRef(null);
|
|
3191
|
+
React49.useImperativeHandle(ref, () => textareaRef.current);
|
|
3192
|
+
React49.useEffect(() => {
|
|
3187
3193
|
const textarea = textareaRef.current;
|
|
3188
3194
|
if (textarea) {
|
|
3189
3195
|
textarea.style.height = "auto";
|
|
3190
3196
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 150)}px`;
|
|
3191
3197
|
}
|
|
3192
3198
|
}, [content]);
|
|
3193
|
-
|
|
3199
|
+
React49.useEffect(() => {
|
|
3194
3200
|
if (content.length > 0 && !isTyping) {
|
|
3195
3201
|
setIsTyping(true);
|
|
3196
3202
|
onTypingStart?.();
|
|
@@ -3210,12 +3216,12 @@ var MessageComposer = React48.forwardRef(
|
|
|
3210
3216
|
}
|
|
3211
3217
|
};
|
|
3212
3218
|
}, [content, isTyping, onTypingStart, onTypingStop]);
|
|
3213
|
-
|
|
3219
|
+
React49.useEffect(() => {
|
|
3214
3220
|
if (autoFocus) {
|
|
3215
3221
|
textareaRef.current?.focus();
|
|
3216
3222
|
}
|
|
3217
3223
|
}, [autoFocus]);
|
|
3218
|
-
|
|
3224
|
+
React49.useEffect(() => {
|
|
3219
3225
|
if (replyTo) {
|
|
3220
3226
|
textareaRef.current?.focus();
|
|
3221
3227
|
}
|
|
@@ -3279,7 +3285,7 @@ var MessageComposer = React48.forwardRef(
|
|
|
3279
3285
|
return prev.filter((a) => a.id !== attachmentId);
|
|
3280
3286
|
});
|
|
3281
3287
|
};
|
|
3282
|
-
|
|
3288
|
+
React49.useEffect(() => {
|
|
3283
3289
|
const currentAttachments = attachments;
|
|
3284
3290
|
return () => {
|
|
3285
3291
|
currentAttachments.forEach((a) => {
|
|
@@ -3846,7 +3852,7 @@ function defaultFormatTimestamp(timestamp) {
|
|
|
3846
3852
|
minute: "2-digit"
|
|
3847
3853
|
});
|
|
3848
3854
|
}
|
|
3849
|
-
var MessageBubble =
|
|
3855
|
+
var MessageBubble = React49.forwardRef(
|
|
3850
3856
|
({
|
|
3851
3857
|
className,
|
|
3852
3858
|
message,
|
|
@@ -4321,7 +4327,7 @@ function LoadMoreButton({
|
|
|
4321
4327
|
);
|
|
4322
4328
|
}
|
|
4323
4329
|
LoadMoreButton.displayName = "LoadMoreButton";
|
|
4324
|
-
var MessageList =
|
|
4330
|
+
var MessageList = React49.forwardRef(
|
|
4325
4331
|
({
|
|
4326
4332
|
messages,
|
|
4327
4333
|
currentUser,
|
|
@@ -4340,19 +4346,19 @@ var MessageList = React48.forwardRef(
|
|
|
4340
4346
|
className,
|
|
4341
4347
|
autoScroll = "onNewMessage"
|
|
4342
4348
|
}, ref) => {
|
|
4343
|
-
const scrollContainerRef =
|
|
4344
|
-
const bottomRef =
|
|
4345
|
-
const [isUserScrolled, setIsUserScrolled] =
|
|
4346
|
-
const prevMessageCountRef =
|
|
4347
|
-
|
|
4348
|
-
const handleScroll =
|
|
4349
|
+
const scrollContainerRef = React49.useRef(null);
|
|
4350
|
+
const bottomRef = React49.useRef(null);
|
|
4351
|
+
const [isUserScrolled, setIsUserScrolled] = React49.useState(false);
|
|
4352
|
+
const prevMessageCountRef = React49.useRef(messages.length);
|
|
4353
|
+
React49.useImperativeHandle(ref, () => scrollContainerRef.current);
|
|
4354
|
+
const handleScroll = React49.useCallback(() => {
|
|
4349
4355
|
const container = scrollContainerRef.current;
|
|
4350
4356
|
if (!container) return;
|
|
4351
4357
|
const { scrollTop, scrollHeight, clientHeight } = container;
|
|
4352
4358
|
const isAtBottom = scrollHeight - scrollTop - clientHeight < 100;
|
|
4353
4359
|
setIsUserScrolled(!isAtBottom);
|
|
4354
4360
|
}, []);
|
|
4355
|
-
|
|
4361
|
+
React49.useEffect(() => {
|
|
4356
4362
|
const container = scrollContainerRef.current;
|
|
4357
4363
|
const bottom = bottomRef.current;
|
|
4358
4364
|
if (!container || !bottom) return;
|
|
@@ -4368,7 +4374,7 @@ var MessageList = React48.forwardRef(
|
|
|
4368
4374
|
}
|
|
4369
4375
|
}
|
|
4370
4376
|
}, [messages, currentUser.id, autoScroll, isUserScrolled]);
|
|
4371
|
-
|
|
4377
|
+
React49.useEffect(() => {
|
|
4372
4378
|
const bottom = bottomRef.current;
|
|
4373
4379
|
if (bottom && !isLoading) {
|
|
4374
4380
|
bottom.scrollIntoView();
|
|
@@ -4421,7 +4427,7 @@ var MessageList = React48.forwardRef(
|
|
|
4421
4427
|
{
|
|
4422
4428
|
"data-slot": "message-list-content",
|
|
4423
4429
|
className: "flex flex-col gap-1 p-4",
|
|
4424
|
-
children: messageGroups.map((group) => /* @__PURE__ */ jsxs(
|
|
4430
|
+
children: messageGroups.map((group) => /* @__PURE__ */ jsxs(React49.Fragment, { children: [
|
|
4425
4431
|
groupByDate && group.label && /* @__PURE__ */ jsx(DateSeparator, { label: group.label }),
|
|
4426
4432
|
group.messages.map((message, index) => {
|
|
4427
4433
|
const prevMessage = group.messages[index - 1];
|
|
@@ -4728,13 +4734,13 @@ function AIChat({
|
|
|
4728
4734
|
onClose,
|
|
4729
4735
|
renderTextContent
|
|
4730
4736
|
}) {
|
|
4731
|
-
const messagesEndRef =
|
|
4732
|
-
const messages =
|
|
4737
|
+
const messagesEndRef = React49.useRef(null);
|
|
4738
|
+
const messages = React49.useMemo(
|
|
4733
4739
|
() => session?.messages || messagesProp || [],
|
|
4734
4740
|
[session?.messages, messagesProp]
|
|
4735
4741
|
);
|
|
4736
4742
|
const isGenerating = session?.isGenerating || isGeneratingProp || false;
|
|
4737
|
-
|
|
4743
|
+
React49.useEffect(() => {
|
|
4738
4744
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
4739
4745
|
}, [messages]);
|
|
4740
4746
|
const handleSend = async (message) => {
|
|
@@ -5014,7 +5020,7 @@ function FloatingAIChat({
|
|
|
5014
5020
|
pulse = false,
|
|
5015
5021
|
...chatProps
|
|
5016
5022
|
}) {
|
|
5017
|
-
const [internalOpen, setInternalOpen] =
|
|
5023
|
+
const [internalOpen, setInternalOpen] = React49.useState(defaultOpen);
|
|
5018
5024
|
const isControlled = controlledOpen !== void 0;
|
|
5019
5025
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
5020
5026
|
const handleOpenChange = (open) => {
|
|
@@ -5044,6 +5050,635 @@ function FloatingAIChat({
|
|
|
5044
5050
|
)
|
|
5045
5051
|
] });
|
|
5046
5052
|
}
|
|
5053
|
+
function normalizeString(value) {
|
|
5054
|
+
return value.trim().replace(/\s+/g, " ").toLowerCase();
|
|
5055
|
+
}
|
|
5056
|
+
function stableStringify(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
5057
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
5058
|
+
if (seen.has(value)) return '"[Circular]"';
|
|
5059
|
+
seen.add(value);
|
|
5060
|
+
if (Array.isArray(value))
|
|
5061
|
+
return "[" + value.map((v) => stableStringify(v, seen)).join(",") + "]";
|
|
5062
|
+
const keys = Object.keys(value).sort();
|
|
5063
|
+
return "{" + keys.map(
|
|
5064
|
+
(k) => JSON.stringify(k) + ":" + stableStringify(value[k], seen)
|
|
5065
|
+
).join(",") + "}";
|
|
5066
|
+
}
|
|
5067
|
+
function safeStableStringify(value) {
|
|
5068
|
+
try {
|
|
5069
|
+
return stableStringify(value);
|
|
5070
|
+
} catch {
|
|
5071
|
+
return '"[Unserializable]"';
|
|
5072
|
+
}
|
|
5073
|
+
}
|
|
5074
|
+
function defaultReconciliationIsEqual(current, proposed) {
|
|
5075
|
+
const a = current ?? "";
|
|
5076
|
+
const b = proposed ?? "";
|
|
5077
|
+
if (a === b) return true;
|
|
5078
|
+
if (typeof a === "string" && typeof b === "string") {
|
|
5079
|
+
return normalizeString(a) === normalizeString(b);
|
|
5080
|
+
}
|
|
5081
|
+
if (a instanceof Date && b instanceof Date) {
|
|
5082
|
+
return a.getTime() === b.getTime();
|
|
5083
|
+
}
|
|
5084
|
+
if (typeof a === "object" && typeof b === "object" && a && b) {
|
|
5085
|
+
try {
|
|
5086
|
+
return stableStringify(a) === stableStringify(b);
|
|
5087
|
+
} catch {
|
|
5088
|
+
return false;
|
|
5089
|
+
}
|
|
5090
|
+
}
|
|
5091
|
+
return false;
|
|
5092
|
+
}
|
|
5093
|
+
function resolveConfidenceLevel(p) {
|
|
5094
|
+
if (p.confidenceLevel) return p.confidenceLevel;
|
|
5095
|
+
if (typeof p.confidence !== "number") return void 0;
|
|
5096
|
+
if (p.confidence >= 0.85) return "high";
|
|
5097
|
+
if (p.confidence >= 0.6) return "medium";
|
|
5098
|
+
return "low";
|
|
5099
|
+
}
|
|
5100
|
+
function defaultAcceptedFor(p) {
|
|
5101
|
+
if (typeof p.defaultAccepted === "boolean") return p.defaultAccepted;
|
|
5102
|
+
if (p.required) return true;
|
|
5103
|
+
return resolveConfidenceLevel(p) !== "low";
|
|
5104
|
+
}
|
|
5105
|
+
var panelVariants = cva(
|
|
5106
|
+
[
|
|
5107
|
+
"rounded-xl bg-card text-card-foreground",
|
|
5108
|
+
"border border-border shadow-sm",
|
|
5109
|
+
"flex flex-col overflow-hidden"
|
|
5110
|
+
],
|
|
5111
|
+
{
|
|
5112
|
+
variants: {
|
|
5113
|
+
tone: {
|
|
5114
|
+
default: "",
|
|
5115
|
+
accent: "ring-1 ring-primary-200 dark:ring-primary-900"
|
|
5116
|
+
}
|
|
5117
|
+
},
|
|
5118
|
+
defaultVariants: {
|
|
5119
|
+
tone: "default"
|
|
5120
|
+
}
|
|
5121
|
+
}
|
|
5122
|
+
);
|
|
5123
|
+
var confidenceBadgeVariants = cva(
|
|
5124
|
+
"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",
|
|
5125
|
+
{
|
|
5126
|
+
variants: {
|
|
5127
|
+
level: {
|
|
5128
|
+
high: "bg-success-100 text-success dark:bg-success-900/30 dark:text-success-300",
|
|
5129
|
+
medium: "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",
|
|
5130
|
+
low: "bg-amber-200 text-amber-800 dark:bg-amber-900/40 dark:text-amber-200"
|
|
5131
|
+
}
|
|
5132
|
+
},
|
|
5133
|
+
defaultVariants: { level: "high" }
|
|
5134
|
+
}
|
|
5135
|
+
);
|
|
5136
|
+
function formatValueDefault(value) {
|
|
5137
|
+
if (value === null || value === void 0 || value === "") {
|
|
5138
|
+
return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground italic", "aria-label": "empty", children: "\u2014" });
|
|
5139
|
+
}
|
|
5140
|
+
if (value instanceof Date) return value.toLocaleDateString();
|
|
5141
|
+
if (typeof value === "object") {
|
|
5142
|
+
try {
|
|
5143
|
+
return JSON.stringify(value);
|
|
5144
|
+
} catch {
|
|
5145
|
+
return String(value);
|
|
5146
|
+
}
|
|
5147
|
+
}
|
|
5148
|
+
return String(value);
|
|
5149
|
+
}
|
|
5150
|
+
function ConfidenceBadge({ level }) {
|
|
5151
|
+
const labels = {
|
|
5152
|
+
high: "High confidence",
|
|
5153
|
+
medium: "Medium confidence",
|
|
5154
|
+
low: "Low confidence"
|
|
5155
|
+
};
|
|
5156
|
+
return /* @__PURE__ */ jsx(
|
|
5157
|
+
"span",
|
|
5158
|
+
{
|
|
5159
|
+
className: cn(confidenceBadgeVariants({ level })),
|
|
5160
|
+
"data-slot": "reconciliation-confidence",
|
|
5161
|
+
children: labels[level]
|
|
5162
|
+
}
|
|
5163
|
+
);
|
|
5164
|
+
}
|
|
5165
|
+
function ReconciliationProposalRow({
|
|
5166
|
+
proposal,
|
|
5167
|
+
state,
|
|
5168
|
+
onAcceptedChange,
|
|
5169
|
+
onValueChange,
|
|
5170
|
+
onToggleEditing
|
|
5171
|
+
}) {
|
|
5172
|
+
const safeState = state ?? {
|
|
5173
|
+
accepted: defaultAcceptedFor(proposal),
|
|
5174
|
+
editing: false,
|
|
5175
|
+
value: proposal.proposed
|
|
5176
|
+
};
|
|
5177
|
+
const rowId = React49.useId();
|
|
5178
|
+
const checkboxId = `${rowId}-accept`;
|
|
5179
|
+
const level = resolveConfidenceLevel(proposal);
|
|
5180
|
+
const render = proposal.renderValue ?? formatValueDefault;
|
|
5181
|
+
const canEdit = Boolean(proposal.renderEditor);
|
|
5182
|
+
return /* @__PURE__ */ jsxs(
|
|
5183
|
+
"li",
|
|
5184
|
+
{
|
|
5185
|
+
"data-slot": "reconciliation-row",
|
|
5186
|
+
"data-accepted": safeState.accepted,
|
|
5187
|
+
className: cn(
|
|
5188
|
+
"flex gap-3 px-4 py-3 transition-colors",
|
|
5189
|
+
safeState.accepted ? "bg-background" : "bg-muted/40",
|
|
5190
|
+
"border-border border-b last:border-b-0"
|
|
5191
|
+
),
|
|
5192
|
+
children: [
|
|
5193
|
+
/* @__PURE__ */ jsx("div", { className: "pt-0.5", children: /* @__PURE__ */ jsx(
|
|
5194
|
+
Checkbox,
|
|
5195
|
+
{
|
|
5196
|
+
id: checkboxId,
|
|
5197
|
+
checked: safeState.accepted,
|
|
5198
|
+
onChange: (e) => onAcceptedChange(e.target.checked),
|
|
5199
|
+
disabled: proposal.required,
|
|
5200
|
+
"aria-label": `Apply update for ${proposal.label}`
|
|
5201
|
+
}
|
|
5202
|
+
) }),
|
|
5203
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
5204
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
5205
|
+
/* @__PURE__ */ jsxs(
|
|
5206
|
+
"label",
|
|
5207
|
+
{
|
|
5208
|
+
htmlFor: checkboxId,
|
|
5209
|
+
className: cn(
|
|
5210
|
+
"text-foreground cursor-pointer text-sm font-medium",
|
|
5211
|
+
proposal.required && "cursor-default"
|
|
5212
|
+
),
|
|
5213
|
+
children: [
|
|
5214
|
+
proposal.label,
|
|
5215
|
+
proposal.required && /* @__PURE__ */ jsx(
|
|
5216
|
+
"span",
|
|
5217
|
+
{
|
|
5218
|
+
className: "text-muted-foreground ml-1 text-xs font-normal",
|
|
5219
|
+
"aria-label": "required",
|
|
5220
|
+
children: "(required)"
|
|
5221
|
+
}
|
|
5222
|
+
)
|
|
5223
|
+
]
|
|
5224
|
+
}
|
|
5225
|
+
),
|
|
5226
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5227
|
+
level && /* @__PURE__ */ jsx(ConfidenceBadge, { level }),
|
|
5228
|
+
canEdit && /* @__PURE__ */ jsx(
|
|
5229
|
+
"button",
|
|
5230
|
+
{
|
|
5231
|
+
type: "button",
|
|
5232
|
+
onClick: onToggleEditing,
|
|
5233
|
+
className: cn(
|
|
5234
|
+
"text-muted-foreground hover:text-foreground text-xs",
|
|
5235
|
+
"focus-visible:ring-ring rounded focus-visible:ring-2 focus-visible:outline-none",
|
|
5236
|
+
"hover:underline"
|
|
5237
|
+
),
|
|
5238
|
+
"aria-expanded": safeState.editing,
|
|
5239
|
+
"aria-controls": `${rowId}-editor`,
|
|
5240
|
+
children: safeState.editing ? "Done" : "Edit"
|
|
5241
|
+
}
|
|
5242
|
+
)
|
|
5243
|
+
] })
|
|
5244
|
+
] }),
|
|
5245
|
+
proposal.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-0.5 text-xs", children: proposal.description }),
|
|
5246
|
+
/* @__PURE__ */ jsxs("dl", { className: "mt-2 grid grid-cols-1 gap-2 text-sm sm:grid-cols-2", children: [
|
|
5247
|
+
/* @__PURE__ */ jsxs("div", { className: "border-border/60 rounded-md border border-dashed px-3 py-2", children: [
|
|
5248
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground text-[11px] tracking-wide uppercase", children: "On file" }),
|
|
5249
|
+
/* @__PURE__ */ jsx("dd", { className: "text-foreground mt-0.5 break-words", children: render(proposal.current) })
|
|
5250
|
+
] }),
|
|
5251
|
+
/* @__PURE__ */ jsxs(
|
|
5252
|
+
"div",
|
|
5253
|
+
{
|
|
5254
|
+
className: cn(
|
|
5255
|
+
"rounded-md border px-3 py-2",
|
|
5256
|
+
safeState.accepted ? "border-primary-300 bg-primary-50/60 dark:border-primary-700 dark:bg-primary-950/30" : "border-border bg-background"
|
|
5257
|
+
),
|
|
5258
|
+
children: [
|
|
5259
|
+
/* @__PURE__ */ jsxs("dt", { className: "text-muted-foreground flex items-center gap-1 text-[11px] tracking-wide uppercase", children: [
|
|
5260
|
+
/* @__PURE__ */ jsx(
|
|
5261
|
+
SparklesIcon,
|
|
5262
|
+
{
|
|
5263
|
+
size: "sm",
|
|
5264
|
+
className: "text-primary-700 dark:text-primary-400"
|
|
5265
|
+
}
|
|
5266
|
+
),
|
|
5267
|
+
"From AI",
|
|
5268
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "(AI-suggested value)" })
|
|
5269
|
+
] }),
|
|
5270
|
+
/* @__PURE__ */ jsx(
|
|
5271
|
+
"dd",
|
|
5272
|
+
{
|
|
5273
|
+
id: `${rowId}-editor`,
|
|
5274
|
+
className: "text-foreground mt-0.5 break-words",
|
|
5275
|
+
children: safeState.editing && proposal.renderEditor ? proposal.renderEditor(safeState.value, onValueChange) : render(safeState.value)
|
|
5276
|
+
}
|
|
5277
|
+
)
|
|
5278
|
+
]
|
|
5279
|
+
}
|
|
5280
|
+
)
|
|
5281
|
+
] }),
|
|
5282
|
+
proposal.hint && /* @__PURE__ */ jsx(
|
|
5283
|
+
"p",
|
|
5284
|
+
{
|
|
5285
|
+
className: cn(
|
|
5286
|
+
"mt-2 text-xs",
|
|
5287
|
+
level === "low" ? "text-amber-700 dark:text-amber-300" : "text-muted-foreground"
|
|
5288
|
+
),
|
|
5289
|
+
children: proposal.hint
|
|
5290
|
+
}
|
|
5291
|
+
)
|
|
5292
|
+
] })
|
|
5293
|
+
]
|
|
5294
|
+
}
|
|
5295
|
+
);
|
|
5296
|
+
}
|
|
5297
|
+
function relativeTimeLabel(date) {
|
|
5298
|
+
const seconds = Math.max(0, Math.round((Date.now() - date.getTime()) / 1e3));
|
|
5299
|
+
if (seconds < 45) return "just now";
|
|
5300
|
+
if (seconds < 90) return "1 minute ago";
|
|
5301
|
+
if (seconds < 3600) return `${Math.round(seconds / 60)} minutes ago`;
|
|
5302
|
+
if (seconds < 5400) return "1 hour ago";
|
|
5303
|
+
if (seconds < 86400) return `${Math.round(seconds / 3600)} hours ago`;
|
|
5304
|
+
return date.toLocaleString();
|
|
5305
|
+
}
|
|
5306
|
+
function SourcePill({ source }) {
|
|
5307
|
+
return /* @__PURE__ */ jsxs(
|
|
5308
|
+
"div",
|
|
5309
|
+
{
|
|
5310
|
+
"data-slot": "reconciliation-source",
|
|
5311
|
+
className: cn(
|
|
5312
|
+
"inline-flex items-center gap-2 rounded-full",
|
|
5313
|
+
"border-border bg-muted/60 border px-3 py-1 text-xs font-medium",
|
|
5314
|
+
"text-muted-foreground"
|
|
5315
|
+
),
|
|
5316
|
+
children: [
|
|
5317
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary-700 dark:text-primary-400 flex items-center", children: source.icon ?? /* @__PURE__ */ jsx(SparklesIcon, { size: "sm" }) }),
|
|
5318
|
+
source.thumbnailUrl && /* @__PURE__ */ jsx(
|
|
5319
|
+
"img",
|
|
5320
|
+
{
|
|
5321
|
+
src: source.thumbnailUrl,
|
|
5322
|
+
alt: "",
|
|
5323
|
+
className: "h-5 w-5 rounded object-cover",
|
|
5324
|
+
"aria-hidden": "true"
|
|
5325
|
+
}
|
|
5326
|
+
),
|
|
5327
|
+
/* @__PURE__ */ jsx("span", { className: "text-foreground", children: source.label }),
|
|
5328
|
+
source.generatedAt && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
5329
|
+
"\xB7 ",
|
|
5330
|
+
relativeTimeLabel(source.generatedAt)
|
|
5331
|
+
] })
|
|
5332
|
+
]
|
|
5333
|
+
}
|
|
5334
|
+
);
|
|
5335
|
+
}
|
|
5336
|
+
function AIReconciliationPanel({
|
|
5337
|
+
title,
|
|
5338
|
+
description,
|
|
5339
|
+
source,
|
|
5340
|
+
proposals,
|
|
5341
|
+
onApply,
|
|
5342
|
+
onSkip,
|
|
5343
|
+
variant = "panel",
|
|
5344
|
+
open,
|
|
5345
|
+
onOpenChange,
|
|
5346
|
+
tone,
|
|
5347
|
+
applyLabel,
|
|
5348
|
+
skipLabel = "Skip for now",
|
|
5349
|
+
acceptAllLabel = "Accept all",
|
|
5350
|
+
rejectAllLabel = "Reject all",
|
|
5351
|
+
hideBulkActions,
|
|
5352
|
+
isEqual = defaultReconciliationIsEqual,
|
|
5353
|
+
onNothingToReconcile,
|
|
5354
|
+
className
|
|
5355
|
+
}) {
|
|
5356
|
+
const effective = React49.useMemo(
|
|
5357
|
+
() => proposals.filter((p) => !isEqual(p.current, p.proposed)),
|
|
5358
|
+
[proposals, isEqual]
|
|
5359
|
+
);
|
|
5360
|
+
const stateSignature = React49.useMemo(
|
|
5361
|
+
() => effective.map(
|
|
5362
|
+
(p) => `${p.id}\u241F${safeStableStringify(p.proposed)}\u241F${p.defaultAccepted ?? ""}\u241F${p.required ?? ""}\u241F${p.confidence ?? ""}\u241F${p.confidenceLevel ?? ""}`
|
|
5363
|
+
).join("|"),
|
|
5364
|
+
[effective]
|
|
5365
|
+
);
|
|
5366
|
+
const [rowStates, setRowStates] = React49.useState(
|
|
5367
|
+
() => Object.fromEntries(
|
|
5368
|
+
effective.map((p) => [
|
|
5369
|
+
p.id,
|
|
5370
|
+
{
|
|
5371
|
+
accepted: defaultAcceptedFor(p),
|
|
5372
|
+
editing: false,
|
|
5373
|
+
value: p.proposed
|
|
5374
|
+
}
|
|
5375
|
+
])
|
|
5376
|
+
)
|
|
5377
|
+
);
|
|
5378
|
+
React49.useEffect(() => {
|
|
5379
|
+
setRowStates(
|
|
5380
|
+
Object.fromEntries(
|
|
5381
|
+
effective.map((p) => [
|
|
5382
|
+
p.id,
|
|
5383
|
+
{
|
|
5384
|
+
accepted: defaultAcceptedFor(p),
|
|
5385
|
+
editing: false,
|
|
5386
|
+
value: p.proposed
|
|
5387
|
+
}
|
|
5388
|
+
])
|
|
5389
|
+
)
|
|
5390
|
+
);
|
|
5391
|
+
}, [stateSignature]);
|
|
5392
|
+
const reportedEmpty = React49.useRef(false);
|
|
5393
|
+
React49.useEffect(() => {
|
|
5394
|
+
if (effective.length === 0 && !reportedEmpty.current) {
|
|
5395
|
+
reportedEmpty.current = true;
|
|
5396
|
+
onNothingToReconcile?.();
|
|
5397
|
+
}
|
|
5398
|
+
if (effective.length > 0) reportedEmpty.current = false;
|
|
5399
|
+
}, [effective.length, onNothingToReconcile]);
|
|
5400
|
+
const acceptedCount = React49.useMemo(
|
|
5401
|
+
() => Object.values(rowStates).filter((s) => s.accepted).length,
|
|
5402
|
+
[rowStates]
|
|
5403
|
+
);
|
|
5404
|
+
const [submitting, setSubmitting] = React49.useState(false);
|
|
5405
|
+
const setAllAccepted = React49.useCallback(
|
|
5406
|
+
(accepted) => {
|
|
5407
|
+
setRowStates((prev) => {
|
|
5408
|
+
const next = { ...prev };
|
|
5409
|
+
for (const p of effective) {
|
|
5410
|
+
if (p.required && !accepted) continue;
|
|
5411
|
+
const base = prev[p.id] ?? {
|
|
5412
|
+
accepted: defaultAcceptedFor(p),
|
|
5413
|
+
editing: false,
|
|
5414
|
+
value: p.proposed
|
|
5415
|
+
};
|
|
5416
|
+
next[p.id] = { ...base, accepted };
|
|
5417
|
+
}
|
|
5418
|
+
return next;
|
|
5419
|
+
});
|
|
5420
|
+
},
|
|
5421
|
+
[effective]
|
|
5422
|
+
);
|
|
5423
|
+
const setRowAccepted = React49.useCallback(
|
|
5424
|
+
(id, accepted) => {
|
|
5425
|
+
const proposal = effective.find((p) => p.id === id);
|
|
5426
|
+
setRowStates((prev) => {
|
|
5427
|
+
const base = prev[id] ?? {
|
|
5428
|
+
accepted: proposal ? defaultAcceptedFor(proposal) : false,
|
|
5429
|
+
editing: false,
|
|
5430
|
+
value: proposal?.proposed
|
|
5431
|
+
};
|
|
5432
|
+
return { ...prev, [id]: { ...base, accepted } };
|
|
5433
|
+
});
|
|
5434
|
+
},
|
|
5435
|
+
[effective]
|
|
5436
|
+
);
|
|
5437
|
+
const setRowValue = React49.useCallback(
|
|
5438
|
+
(id, value) => {
|
|
5439
|
+
const proposal = effective.find((p) => p.id === id);
|
|
5440
|
+
setRowStates((prev) => {
|
|
5441
|
+
const base = prev[id] ?? {
|
|
5442
|
+
accepted: proposal ? defaultAcceptedFor(proposal) : false,
|
|
5443
|
+
editing: false,
|
|
5444
|
+
value: proposal?.proposed
|
|
5445
|
+
};
|
|
5446
|
+
return { ...prev, [id]: { ...base, value } };
|
|
5447
|
+
});
|
|
5448
|
+
},
|
|
5449
|
+
[effective]
|
|
5450
|
+
);
|
|
5451
|
+
const toggleRowEditing = React49.useCallback(
|
|
5452
|
+
(id) => {
|
|
5453
|
+
const proposal = effective.find((p) => p.id === id);
|
|
5454
|
+
setRowStates((prev) => {
|
|
5455
|
+
const base = prev[id] ?? {
|
|
5456
|
+
accepted: proposal ? defaultAcceptedFor(proposal) : false,
|
|
5457
|
+
editing: false,
|
|
5458
|
+
value: proposal?.proposed
|
|
5459
|
+
};
|
|
5460
|
+
return { ...prev, [id]: { ...base, editing: !base.editing } };
|
|
5461
|
+
});
|
|
5462
|
+
},
|
|
5463
|
+
[effective]
|
|
5464
|
+
);
|
|
5465
|
+
const handleApply = React49.useCallback(async () => {
|
|
5466
|
+
const accepted = effective.filter((p) => rowStates[p.id]?.accepted).map((p) => ({
|
|
5467
|
+
id: p.id,
|
|
5468
|
+
value: rowStates[p.id]?.value ?? p.proposed
|
|
5469
|
+
}));
|
|
5470
|
+
if (accepted.length === 0) return;
|
|
5471
|
+
try {
|
|
5472
|
+
setSubmitting(true);
|
|
5473
|
+
await onApply(accepted);
|
|
5474
|
+
} finally {
|
|
5475
|
+
setSubmitting(false);
|
|
5476
|
+
}
|
|
5477
|
+
}, [effective, rowStates, onApply]);
|
|
5478
|
+
const containerRef = React49.useRef(null);
|
|
5479
|
+
React49.useEffect(() => {
|
|
5480
|
+
const el = containerRef.current;
|
|
5481
|
+
if (!el) return void 0;
|
|
5482
|
+
const handler = (e) => {
|
|
5483
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
5484
|
+
if (acceptedCount === 0 || submitting) return;
|
|
5485
|
+
e.preventDefault();
|
|
5486
|
+
void handleApply();
|
|
5487
|
+
return;
|
|
5488
|
+
}
|
|
5489
|
+
if (e.key !== "a" && e.key !== "A") return;
|
|
5490
|
+
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
5491
|
+
const target = e.target;
|
|
5492
|
+
const tag = target?.tagName?.toLowerCase();
|
|
5493
|
+
if (tag === "input" || tag === "textarea" || target?.isContentEditable) {
|
|
5494
|
+
return;
|
|
5495
|
+
}
|
|
5496
|
+
e.preventDefault();
|
|
5497
|
+
setAllAccepted(acceptedCount !== effective.length);
|
|
5498
|
+
};
|
|
5499
|
+
el.addEventListener("keydown", handler);
|
|
5500
|
+
return () => el.removeEventListener("keydown", handler);
|
|
5501
|
+
}, [
|
|
5502
|
+
acceptedCount,
|
|
5503
|
+
effective.length,
|
|
5504
|
+
setAllAccepted,
|
|
5505
|
+
handleApply,
|
|
5506
|
+
submitting
|
|
5507
|
+
]);
|
|
5508
|
+
const allAccepted = effective.length > 0 && acceptedCount === effective.length;
|
|
5509
|
+
const someAccepted = acceptedCount > 0 && !allAccepted;
|
|
5510
|
+
const resolvedApplyLabel = applyLabel ?? (acceptedCount === 1 ? "Apply 1 update" : `Apply ${acceptedCount} updates`);
|
|
5511
|
+
const grouped = React49.useMemo(() => {
|
|
5512
|
+
const map = /* @__PURE__ */ new Map();
|
|
5513
|
+
for (const p of effective) {
|
|
5514
|
+
const key = p.group;
|
|
5515
|
+
const arr = map.get(key) ?? [];
|
|
5516
|
+
arr.push(p);
|
|
5517
|
+
map.set(key, arr);
|
|
5518
|
+
}
|
|
5519
|
+
return Array.from(map.entries());
|
|
5520
|
+
}, [effective]);
|
|
5521
|
+
const bulkBar = !hideBulkActions && effective.length > 1 ? /* @__PURE__ */ jsxs(
|
|
5522
|
+
"div",
|
|
5523
|
+
{
|
|
5524
|
+
className: cn(
|
|
5525
|
+
"border-border flex items-center justify-between gap-2 border-b",
|
|
5526
|
+
"bg-muted/40 px-4 py-2"
|
|
5527
|
+
),
|
|
5528
|
+
"data-slot": "reconciliation-bulk",
|
|
5529
|
+
children: [
|
|
5530
|
+
/* @__PURE__ */ jsx(
|
|
5531
|
+
Checkbox,
|
|
5532
|
+
{
|
|
5533
|
+
checked: allAccepted,
|
|
5534
|
+
indeterminate: someAccepted,
|
|
5535
|
+
onChange: (e) => setAllAccepted(e.target.checked),
|
|
5536
|
+
"aria-label": allAccepted ? rejectAllLabel : acceptAllLabel,
|
|
5537
|
+
label: allAccepted ? rejectAllLabel : acceptAllLabel
|
|
5538
|
+
}
|
|
5539
|
+
),
|
|
5540
|
+
/* @__PURE__ */ jsxs(
|
|
5541
|
+
"p",
|
|
5542
|
+
{
|
|
5543
|
+
className: "text-muted-foreground text-xs",
|
|
5544
|
+
role: "status",
|
|
5545
|
+
"aria-live": "polite",
|
|
5546
|
+
children: [
|
|
5547
|
+
acceptedCount,
|
|
5548
|
+
" of ",
|
|
5549
|
+
effective.length,
|
|
5550
|
+
" selected"
|
|
5551
|
+
]
|
|
5552
|
+
}
|
|
5553
|
+
)
|
|
5554
|
+
]
|
|
5555
|
+
}
|
|
5556
|
+
) : null;
|
|
5557
|
+
const rowList = /* @__PURE__ */ jsx(
|
|
5558
|
+
"ul",
|
|
5559
|
+
{
|
|
5560
|
+
"data-slot": "reconciliation-rows",
|
|
5561
|
+
className: "divide-border max-h-[60vh] overflow-y-auto",
|
|
5562
|
+
children: grouped.map(([groupKey, items]) => /* @__PURE__ */ jsxs(React49.Fragment, { children: [
|
|
5563
|
+
groupKey && /* @__PURE__ */ jsx(
|
|
5564
|
+
"li",
|
|
5565
|
+
{
|
|
5566
|
+
"aria-hidden": "true",
|
|
5567
|
+
className: cn(
|
|
5568
|
+
"bg-muted/30 text-muted-foreground border-border",
|
|
5569
|
+
"border-b px-4 py-1.5 text-[11px] font-medium tracking-wide uppercase"
|
|
5570
|
+
),
|
|
5571
|
+
children: groupKey
|
|
5572
|
+
}
|
|
5573
|
+
),
|
|
5574
|
+
items.map((p) => /* @__PURE__ */ jsx(
|
|
5575
|
+
ReconciliationProposalRow,
|
|
5576
|
+
{
|
|
5577
|
+
proposal: p,
|
|
5578
|
+
state: rowStates[p.id],
|
|
5579
|
+
onAcceptedChange: (a) => setRowAccepted(p.id, a),
|
|
5580
|
+
onValueChange: (v) => setRowValue(p.id, v),
|
|
5581
|
+
onToggleEditing: () => toggleRowEditing(p.id)
|
|
5582
|
+
},
|
|
5583
|
+
p.id
|
|
5584
|
+
))
|
|
5585
|
+
] }, groupKey ?? "__nogroup"))
|
|
5586
|
+
}
|
|
5587
|
+
);
|
|
5588
|
+
const footerButtons = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5589
|
+
onSkip && /* @__PURE__ */ jsx(
|
|
5590
|
+
Button,
|
|
5591
|
+
{
|
|
5592
|
+
type: "button",
|
|
5593
|
+
variant: "ghost",
|
|
5594
|
+
onClick: onSkip,
|
|
5595
|
+
disabled: submitting,
|
|
5596
|
+
children: skipLabel
|
|
5597
|
+
}
|
|
5598
|
+
),
|
|
5599
|
+
/* @__PURE__ */ jsx(
|
|
5600
|
+
Button,
|
|
5601
|
+
{
|
|
5602
|
+
type: "button",
|
|
5603
|
+
onClick: handleApply,
|
|
5604
|
+
disabled: acceptedCount === 0 || submitting,
|
|
5605
|
+
isLoading: submitting,
|
|
5606
|
+
loadingText: "Applying\u2026",
|
|
5607
|
+
children: resolvedApplyLabel
|
|
5608
|
+
}
|
|
5609
|
+
)
|
|
5610
|
+
] });
|
|
5611
|
+
if (variant === "modal") {
|
|
5612
|
+
if (!onOpenChange) {
|
|
5613
|
+
throw new Error(
|
|
5614
|
+
'AIReconciliationPanel: `onOpenChange` is required when `variant="modal"`.'
|
|
5615
|
+
);
|
|
5616
|
+
}
|
|
5617
|
+
return /* @__PURE__ */ jsxs(Modal, { open: Boolean(open), onOpenChange, size: "2xl", children: [
|
|
5618
|
+
/* @__PURE__ */ jsxs(ModalHeader, { children: [
|
|
5619
|
+
/* @__PURE__ */ jsx(ModalTitle, { children: title }),
|
|
5620
|
+
/* @__PURE__ */ jsx(ModalClose, {})
|
|
5621
|
+
] }),
|
|
5622
|
+
/* @__PURE__ */ jsx(ModalBody, { className: "px-0 py-0", children: /* @__PURE__ */ jsxs(
|
|
5623
|
+
"div",
|
|
5624
|
+
{
|
|
5625
|
+
ref: containerRef,
|
|
5626
|
+
"data-slot": "reconciliation-panel",
|
|
5627
|
+
"data-variant": "modal",
|
|
5628
|
+
className: cn("flex flex-col", className),
|
|
5629
|
+
role: "group",
|
|
5630
|
+
"aria-label": title,
|
|
5631
|
+
children: [
|
|
5632
|
+
/* @__PURE__ */ jsxs("div", { className: "border-border border-b px-6 py-3", children: [
|
|
5633
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: description }),
|
|
5634
|
+
/* @__PURE__ */ jsx("div", { className: cn(description && "mt-3"), children: /* @__PURE__ */ jsx(SourcePill, { source }) })
|
|
5635
|
+
] }),
|
|
5636
|
+
effective.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground px-6 py-6 text-sm", children: "No updates to review \u2014 your profile already matches the scan." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5637
|
+
bulkBar,
|
|
5638
|
+
rowList
|
|
5639
|
+
] })
|
|
5640
|
+
]
|
|
5641
|
+
}
|
|
5642
|
+
) }),
|
|
5643
|
+
/* @__PURE__ */ jsx(ModalFooter, { children: effective.length === 0 ? /* @__PURE__ */ jsx(Button, { onClick: () => onOpenChange(false), children: "Close" }) : footerButtons })
|
|
5644
|
+
] });
|
|
5645
|
+
}
|
|
5646
|
+
if (effective.length === 0) return null;
|
|
5647
|
+
return /* @__PURE__ */ jsxs(
|
|
5648
|
+
"div",
|
|
5649
|
+
{
|
|
5650
|
+
ref: containerRef,
|
|
5651
|
+
"data-slot": "reconciliation-panel",
|
|
5652
|
+
"data-variant": "panel",
|
|
5653
|
+
className: cn(panelVariants({ tone }), className),
|
|
5654
|
+
role: "group",
|
|
5655
|
+
"aria-label": title,
|
|
5656
|
+
children: [
|
|
5657
|
+
/* @__PURE__ */ jsx("div", { className: "border-border border-b px-4 pt-4 pb-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
5658
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
5659
|
+
/* @__PURE__ */ jsx("h2", { className: "text-foreground text-base font-semibold", children: title }),
|
|
5660
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: description })
|
|
5661
|
+
] }),
|
|
5662
|
+
/* @__PURE__ */ jsx(SourcePill, { source })
|
|
5663
|
+
] }) }),
|
|
5664
|
+
bulkBar,
|
|
5665
|
+
rowList,
|
|
5666
|
+
/* @__PURE__ */ jsx(
|
|
5667
|
+
"div",
|
|
5668
|
+
{
|
|
5669
|
+
className: cn(
|
|
5670
|
+
"border-border flex flex-col-reverse gap-2 border-t px-4 py-3",
|
|
5671
|
+
"sm:flex-row sm:items-center sm:justify-end sm:gap-3"
|
|
5672
|
+
),
|
|
5673
|
+
"data-slot": "reconciliation-footer",
|
|
5674
|
+
children: footerButtons
|
|
5675
|
+
}
|
|
5676
|
+
)
|
|
5677
|
+
]
|
|
5678
|
+
}
|
|
5679
|
+
);
|
|
5680
|
+
}
|
|
5681
|
+
AIReconciliationPanel.displayName = "AIReconciliationPanel";
|
|
5047
5682
|
function AppHeader({
|
|
5048
5683
|
children,
|
|
5049
5684
|
className,
|
|
@@ -5360,10 +5995,10 @@ function AuthDialog({
|
|
|
5360
5995
|
requireEmailVerification = false,
|
|
5361
5996
|
className
|
|
5362
5997
|
}) {
|
|
5363
|
-
const [internalMode, setInternalMode] =
|
|
5364
|
-
const [isLoading, setIsLoading] =
|
|
5365
|
-
const [error, setError] =
|
|
5366
|
-
const [success, setSuccess] =
|
|
5998
|
+
const [internalMode, setInternalMode] = React49.useState("login");
|
|
5999
|
+
const [isLoading, setIsLoading] = React49.useState(false);
|
|
6000
|
+
const [error, setError] = React49.useState(null);
|
|
6001
|
+
const [success, setSuccess] = React49.useState(null);
|
|
5367
6002
|
const mode = controlledMode ?? internalMode;
|
|
5368
6003
|
const setMode = (newMode) => {
|
|
5369
6004
|
setError(null);
|
|
@@ -5374,14 +6009,14 @@ function AuthDialog({
|
|
|
5374
6009
|
setInternalMode(newMode);
|
|
5375
6010
|
}
|
|
5376
6011
|
};
|
|
5377
|
-
|
|
6012
|
+
React49.useEffect(() => {
|
|
5378
6013
|
const handleEscape = (e) => {
|
|
5379
6014
|
if (e.key === "Escape" && isOpen) onClose();
|
|
5380
6015
|
};
|
|
5381
6016
|
document.addEventListener("keydown", handleEscape);
|
|
5382
6017
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
5383
6018
|
}, [isOpen, onClose]);
|
|
5384
|
-
|
|
6019
|
+
React49.useEffect(() => {
|
|
5385
6020
|
if (isOpen) {
|
|
5386
6021
|
document.body.style.overflow = "hidden";
|
|
5387
6022
|
} else {
|
|
@@ -5607,9 +6242,9 @@ function AuthDialog({
|
|
|
5607
6242
|
);
|
|
5608
6243
|
}
|
|
5609
6244
|
function LoginForm({ onSubmit, isLoading, onForgotPassword }) {
|
|
5610
|
-
const [email, setEmail] =
|
|
5611
|
-
const [password, setPassword] =
|
|
5612
|
-
const [showPassword, setShowPassword] =
|
|
6245
|
+
const [email, setEmail] = React49.useState("");
|
|
6246
|
+
const [password, setPassword] = React49.useState("");
|
|
6247
|
+
const [showPassword, setShowPassword] = React49.useState(false);
|
|
5613
6248
|
const handleSubmit = (e) => {
|
|
5614
6249
|
e.preventDefault();
|
|
5615
6250
|
onSubmit(email, password);
|
|
@@ -5711,11 +6346,11 @@ function SignupForm({
|
|
|
5711
6346
|
termsUrl,
|
|
5712
6347
|
privacyUrl
|
|
5713
6348
|
}) {
|
|
5714
|
-
const [email, setEmail] =
|
|
5715
|
-
const [password, setPassword] =
|
|
5716
|
-
const [confirmPassword, setConfirmPassword] =
|
|
5717
|
-
const [acceptedTerms, setAcceptedTerms] =
|
|
5718
|
-
const [showPassword, setShowPassword] =
|
|
6349
|
+
const [email, setEmail] = React49.useState("");
|
|
6350
|
+
const [password, setPassword] = React49.useState("");
|
|
6351
|
+
const [confirmPassword, setConfirmPassword] = React49.useState("");
|
|
6352
|
+
const [acceptedTerms, setAcceptedTerms] = React49.useState(false);
|
|
6353
|
+
const [showPassword, setShowPassword] = React49.useState(false);
|
|
5719
6354
|
const passwordsMatch = password === confirmPassword;
|
|
5720
6355
|
const handleSubmit = (e) => {
|
|
5721
6356
|
e.preventDefault();
|
|
@@ -5864,7 +6499,7 @@ function ForgotPasswordForm({
|
|
|
5864
6499
|
isLoading,
|
|
5865
6500
|
onBack
|
|
5866
6501
|
}) {
|
|
5867
|
-
const [email, setEmail] =
|
|
6502
|
+
const [email, setEmail] = React49.useState("");
|
|
5868
6503
|
const handleSubmit = (e) => {
|
|
5869
6504
|
e.preventDefault();
|
|
5870
6505
|
onSubmit(email);
|
|
@@ -5915,9 +6550,9 @@ function ForgotPasswordForm({
|
|
|
5915
6550
|
] });
|
|
5916
6551
|
}
|
|
5917
6552
|
function ResetPasswordForm({ onSubmit, isLoading }) {
|
|
5918
|
-
const [password, setPassword] =
|
|
5919
|
-
const [confirmPassword, setConfirmPassword] =
|
|
5920
|
-
const [showPassword, setShowPassword] =
|
|
6553
|
+
const [password, setPassword] = React49.useState("");
|
|
6554
|
+
const [confirmPassword, setConfirmPassword] = React49.useState("");
|
|
6555
|
+
const [showPassword, setShowPassword] = React49.useState(false);
|
|
5921
6556
|
const passwordsMatch = password === confirmPassword;
|
|
5922
6557
|
const handleSubmit = (e) => {
|
|
5923
6558
|
e.preventDefault();
|
|
@@ -6283,9 +6918,9 @@ function ServiceSelect({
|
|
|
6283
6918
|
error,
|
|
6284
6919
|
className
|
|
6285
6920
|
}) {
|
|
6286
|
-
const [isOpen, setIsOpen] =
|
|
6287
|
-
const dropdownRef =
|
|
6288
|
-
|
|
6921
|
+
const [isOpen, setIsOpen] = React49.useState(false);
|
|
6922
|
+
const dropdownRef = React49.useRef(null);
|
|
6923
|
+
React49.useEffect(() => {
|
|
6289
6924
|
function handleClickOutside(event) {
|
|
6290
6925
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
6291
6926
|
setIsOpen(false);
|
|
@@ -6460,7 +7095,7 @@ function DialogOverlay({
|
|
|
6460
7095
|
className,
|
|
6461
7096
|
titleId
|
|
6462
7097
|
}) {
|
|
6463
|
-
|
|
7098
|
+
React49.useEffect(() => {
|
|
6464
7099
|
if (!isOpen || isStorybookDocsMode()) {
|
|
6465
7100
|
return void 0;
|
|
6466
7101
|
}
|
|
@@ -6514,8 +7149,8 @@ function BookingDialog({
|
|
|
6514
7149
|
isLoading = false,
|
|
6515
7150
|
className
|
|
6516
7151
|
}) {
|
|
6517
|
-
const titleId =
|
|
6518
|
-
const [formData, setFormData] =
|
|
7152
|
+
const titleId = React49.useId();
|
|
7153
|
+
const [formData, setFormData] = React49.useState({
|
|
6519
7154
|
firstName: defaultValues?.firstName || "",
|
|
6520
7155
|
lastName: defaultValues?.lastName || "",
|
|
6521
7156
|
phoneNumber: defaultValues?.phoneNumber || "",
|
|
@@ -6524,7 +7159,7 @@ function BookingDialog({
|
|
|
6524
7159
|
consentEmail: defaultValues?.consentEmail ?? false,
|
|
6525
7160
|
consentSms: defaultValues?.consentSms ?? false
|
|
6526
7161
|
});
|
|
6527
|
-
const [errors, setErrors] =
|
|
7162
|
+
const [errors, setErrors] = React49.useState({});
|
|
6528
7163
|
const validate = () => {
|
|
6529
7164
|
const newErrors = {};
|
|
6530
7165
|
if (!formData.firstName.trim()) {
|
|
@@ -6792,7 +7427,7 @@ function InlineBookingForm({
|
|
|
6792
7427
|
isLoading = false,
|
|
6793
7428
|
className
|
|
6794
7429
|
}) {
|
|
6795
|
-
const [formData, setFormData] =
|
|
7430
|
+
const [formData, setFormData] = React49.useState({
|
|
6796
7431
|
firstName: defaultValues?.firstName || "",
|
|
6797
7432
|
lastName: defaultValues?.lastName || "",
|
|
6798
7433
|
phoneNumber: defaultValues?.phoneNumber || "",
|
|
@@ -6801,7 +7436,7 @@ function InlineBookingForm({
|
|
|
6801
7436
|
consentEmail: defaultValues?.consentEmail ?? false,
|
|
6802
7437
|
consentSms: defaultValues?.consentSms ?? false
|
|
6803
7438
|
});
|
|
6804
|
-
const [errors, setErrors] =
|
|
7439
|
+
const [errors, setErrors] = React49.useState({});
|
|
6805
7440
|
const validate = () => {
|
|
6806
7441
|
const newErrors = {};
|
|
6807
7442
|
if (!formData.firstName.trim()) {
|
|
@@ -7530,7 +8165,7 @@ function HoursSummary({
|
|
|
7530
8165
|
defaultExpanded = false,
|
|
7531
8166
|
className
|
|
7532
8167
|
}) {
|
|
7533
|
-
const [isExpanded, setIsExpanded] =
|
|
8168
|
+
const [isExpanded, setIsExpanded] = React49.useState(defaultExpanded);
|
|
7534
8169
|
const isOpen = isCurrentlyOpen(schedule.officeHours);
|
|
7535
8170
|
const todayHours = getTodayHours(schedule.officeHours, use24Hour);
|
|
7536
8171
|
const hasStructuredHours = schedule.officeHours && schedule.officeHours.length > 0;
|
|
@@ -8005,17 +8640,17 @@ function CheckrIntegration({
|
|
|
8005
8640
|
viewDetails = "View Details",
|
|
8006
8641
|
noReportsSelected = "No reports selected"
|
|
8007
8642
|
} = labels;
|
|
8008
|
-
const [showInviteModal, setShowInviteModal] =
|
|
8009
|
-
const [candidateName, setCandidateName] =
|
|
8010
|
-
const [candidateEmail, setCandidateEmail] =
|
|
8011
|
-
const [candidatePhone, setCandidatePhone] =
|
|
8012
|
-
const [selectedPackage, setSelectedPackage] =
|
|
8643
|
+
const [showInviteModal, setShowInviteModal] = React49.useState(false);
|
|
8644
|
+
const [candidateName, setCandidateName] = React49.useState("");
|
|
8645
|
+
const [candidateEmail, setCandidateEmail] = React49.useState("");
|
|
8646
|
+
const [candidatePhone, setCandidatePhone] = React49.useState("");
|
|
8647
|
+
const [selectedPackage, setSelectedPackage] = React49.useState(
|
|
8013
8648
|
packages[0]?.id || ""
|
|
8014
8649
|
);
|
|
8015
|
-
const [selectedReports, setSelectedReports] =
|
|
8650
|
+
const [selectedReports, setSelectedReports] = React49.useState(
|
|
8016
8651
|
/* @__PURE__ */ new Set()
|
|
8017
8652
|
);
|
|
8018
|
-
|
|
8653
|
+
React49.useEffect(() => {
|
|
8019
8654
|
setSelectedReports((prev) => prev.size > 0 ? /* @__PURE__ */ new Set() : prev);
|
|
8020
8655
|
}, [reports, connected]);
|
|
8021
8656
|
const statusLabels = {
|
|
@@ -8049,7 +8684,7 @@ function CheckrIntegration({
|
|
|
8049
8684
|
failed: "bg-destructive",
|
|
8050
8685
|
expired: "bg-muted-foreground"
|
|
8051
8686
|
};
|
|
8052
|
-
const statusCounts =
|
|
8687
|
+
const statusCounts = React49.useMemo(() => {
|
|
8053
8688
|
const counts = {
|
|
8054
8689
|
pending: 0,
|
|
8055
8690
|
running: 0,
|
|
@@ -8588,7 +9223,7 @@ function CommandPaletteProvider({
|
|
|
8588
9223
|
}
|
|
8589
9224
|
}, [isOpen, open, close]);
|
|
8590
9225
|
useCommandK(toggle, enableShortcut);
|
|
8591
|
-
|
|
9226
|
+
React49__default.useEffect(() => {
|
|
8592
9227
|
if (!customEventName) return;
|
|
8593
9228
|
const handler = () => open();
|
|
8594
9229
|
document.addEventListener(customEventName, handler);
|
|
@@ -9500,11 +10135,11 @@ function formatRetryTime(time) {
|
|
|
9500
10135
|
}
|
|
9501
10136
|
function useConnectionStatus(options = {}) {
|
|
9502
10137
|
const { onDisconnect, onReconnect } = options;
|
|
9503
|
-
const [isOnline, setIsOnline] =
|
|
10138
|
+
const [isOnline, setIsOnline] = React49.useState(() => {
|
|
9504
10139
|
if (typeof window === "undefined") return true;
|
|
9505
10140
|
return navigator.onLine;
|
|
9506
10141
|
});
|
|
9507
|
-
|
|
10142
|
+
React49.useEffect(() => {
|
|
9508
10143
|
const handleOnline = () => {
|
|
9509
10144
|
setIsOnline(true);
|
|
9510
10145
|
onReconnect?.();
|
|
@@ -9623,10 +10258,10 @@ function RowActionMenu({
|
|
|
9623
10258
|
item,
|
|
9624
10259
|
actions
|
|
9625
10260
|
}) {
|
|
9626
|
-
const [open, setOpen] =
|
|
9627
|
-
const menuRef =
|
|
9628
|
-
const buttonRef =
|
|
9629
|
-
|
|
10261
|
+
const [open, setOpen] = React49.useState(false);
|
|
10262
|
+
const menuRef = React49.useRef(null);
|
|
10263
|
+
const buttonRef = React49.useRef(null);
|
|
10264
|
+
React49.useEffect(() => {
|
|
9630
10265
|
if (!open) return;
|
|
9631
10266
|
function handleClick(e) {
|
|
9632
10267
|
if (menuRef.current && !menuRef.current.contains(e.target) && buttonRef.current && !buttonRef.current.contains(e.target)) {
|
|
@@ -9636,7 +10271,7 @@ function RowActionMenu({
|
|
|
9636
10271
|
document.addEventListener("mousedown", handleClick);
|
|
9637
10272
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
9638
10273
|
}, [open]);
|
|
9639
|
-
|
|
10274
|
+
React49.useEffect(() => {
|
|
9640
10275
|
if (!open) return;
|
|
9641
10276
|
function handleKey(e) {
|
|
9642
10277
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -9644,8 +10279,8 @@ function RowActionMenu({
|
|
|
9644
10279
|
document.addEventListener("keydown", handleKey);
|
|
9645
10280
|
return () => document.removeEventListener("keydown", handleKey);
|
|
9646
10281
|
}, [open]);
|
|
9647
|
-
const [menuPos, setMenuPos] =
|
|
9648
|
-
|
|
10282
|
+
const [menuPos, setMenuPos] = React49.useState(null);
|
|
10283
|
+
React49.useLayoutEffect(() => {
|
|
9649
10284
|
if (!open || !buttonRef.current) return;
|
|
9650
10285
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
9651
10286
|
setMenuPos({
|
|
@@ -9828,9 +10463,9 @@ function buildDefaultActions(onView, onEdit, onDelete) {
|
|
|
9828
10463
|
function ViewModalActions({
|
|
9829
10464
|
viewTarget
|
|
9830
10465
|
}) {
|
|
9831
|
-
const [shareOpen, setShareOpen] =
|
|
9832
|
-
const shareRef =
|
|
9833
|
-
|
|
10466
|
+
const [shareOpen, setShareOpen] = React49.useState(false);
|
|
10467
|
+
const shareRef = React49.useRef(null);
|
|
10468
|
+
React49.useEffect(() => {
|
|
9834
10469
|
if (!shareOpen) return;
|
|
9835
10470
|
const handleClick = (e) => {
|
|
9836
10471
|
if (shareRef.current && !shareRef.current.contains(e.target)) {
|
|
@@ -9967,7 +10602,7 @@ function ViewModalActions({
|
|
|
9967
10602
|
)
|
|
9968
10603
|
] });
|
|
9969
10604
|
}
|
|
9970
|
-
var CountBadge =
|
|
10605
|
+
var CountBadge = React49.forwardRef(
|
|
9971
10606
|
({
|
|
9972
10607
|
className,
|
|
9973
10608
|
variant,
|
|
@@ -9983,18 +10618,18 @@ var CountBadge = React48.forwardRef(
|
|
|
9983
10618
|
countVariant,
|
|
9984
10619
|
...props
|
|
9985
10620
|
}, ref) => {
|
|
9986
|
-
const [open, setOpen] =
|
|
9987
|
-
const containerRef =
|
|
9988
|
-
const [deleteTarget, setDeleteTarget] =
|
|
9989
|
-
const [editTarget, setEditTarget] =
|
|
10621
|
+
const [open, setOpen] = React49.useState(false);
|
|
10622
|
+
const containerRef = React49.useRef(null);
|
|
10623
|
+
const [deleteTarget, setDeleteTarget] = React49.useState(null);
|
|
10624
|
+
const [editTarget, setEditTarget] = React49.useState(
|
|
9990
10625
|
null
|
|
9991
10626
|
);
|
|
9992
|
-
const [editForm, setEditForm] =
|
|
9993
|
-
const [viewTarget, setViewTarget] =
|
|
10627
|
+
const [editForm, setEditForm] = React49.useState({});
|
|
10628
|
+
const [viewTarget, setViewTarget] = React49.useState(
|
|
9994
10629
|
null
|
|
9995
10630
|
);
|
|
9996
10631
|
const showMenu = items && items.length > 0;
|
|
9997
|
-
|
|
10632
|
+
React49.useEffect(() => {
|
|
9998
10633
|
if (!open) return;
|
|
9999
10634
|
const handleClickOutside = (e) => {
|
|
10000
10635
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -10004,7 +10639,7 @@ var CountBadge = React48.forwardRef(
|
|
|
10004
10639
|
document.addEventListener("mousedown", handleClickOutside);
|
|
10005
10640
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
10006
10641
|
}, [open]);
|
|
10007
|
-
|
|
10642
|
+
React49.useEffect(() => {
|
|
10008
10643
|
if (!open) return;
|
|
10009
10644
|
const handleEscape = (e) => {
|
|
10010
10645
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -10012,13 +10647,13 @@ var CountBadge = React48.forwardRef(
|
|
|
10012
10647
|
document.addEventListener("keydown", handleEscape);
|
|
10013
10648
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
10014
10649
|
}, [open]);
|
|
10015
|
-
const handleDeleteRequest =
|
|
10650
|
+
const handleDeleteRequest = React49.useCallback((item) => {
|
|
10016
10651
|
setDeleteTarget(item);
|
|
10017
10652
|
}, []);
|
|
10018
|
-
const handleViewRequest =
|
|
10653
|
+
const handleViewRequest = React49.useCallback((item) => {
|
|
10019
10654
|
setViewTarget(item);
|
|
10020
10655
|
}, []);
|
|
10021
|
-
const handleEditRequest =
|
|
10656
|
+
const handleEditRequest = React49.useCallback((item) => {
|
|
10022
10657
|
setEditTarget(item);
|
|
10023
10658
|
setEditForm({
|
|
10024
10659
|
label: item.label,
|
|
@@ -10441,7 +11076,7 @@ function CookieConsentBanner({
|
|
|
10441
11076
|
isMobileApp = false,
|
|
10442
11077
|
className
|
|
10443
11078
|
}) {
|
|
10444
|
-
const [isAnimating, setIsAnimating] =
|
|
11079
|
+
const [isAnimating, setIsAnimating] = React49.useState(false);
|
|
10445
11080
|
const handleAccept = () => {
|
|
10446
11081
|
setIsAnimating(true);
|
|
10447
11082
|
setTimeout(() => {
|
|
@@ -10500,7 +11135,7 @@ function CookieConsentBanner({
|
|
|
10500
11135
|
appName,
|
|
10501
11136
|
" you are agreeing to our",
|
|
10502
11137
|
" ",
|
|
10503
|
-
legalLinks.map((link, index) => /* @__PURE__ */ jsxs(
|
|
11138
|
+
legalLinks.map((link, index) => /* @__PURE__ */ jsxs(React49.Fragment, { children: [
|
|
10504
11139
|
index > 0 && (index === legalLinks.length - 1 ? " and " : ", "),
|
|
10505
11140
|
/* @__PURE__ */ jsx(
|
|
10506
11141
|
"a",
|
|
@@ -10624,20 +11259,20 @@ function CompactCookieBanner({
|
|
|
10624
11259
|
var COOKIE_CONSENT_KEY = "cookie-consent-accepted";
|
|
10625
11260
|
function useCookieConsent(options = {}) {
|
|
10626
11261
|
const { storageKey = COOKIE_CONSENT_KEY, onConsent } = options;
|
|
10627
|
-
const [hasConsented, setHasConsented] =
|
|
11262
|
+
const [hasConsented, setHasConsented] = React49.useState(() => {
|
|
10628
11263
|
if (typeof window === "undefined") return false;
|
|
10629
11264
|
return localStorage.getItem(storageKey) === "true";
|
|
10630
11265
|
});
|
|
10631
|
-
const acceptCookies =
|
|
11266
|
+
const acceptCookies = React49.useCallback(() => {
|
|
10632
11267
|
localStorage.setItem(storageKey, "true");
|
|
10633
11268
|
setHasConsented(true);
|
|
10634
11269
|
onConsent?.();
|
|
10635
11270
|
}, [storageKey, onConsent]);
|
|
10636
|
-
const declineCookies =
|
|
11271
|
+
const declineCookies = React49.useCallback(() => {
|
|
10637
11272
|
localStorage.setItem(storageKey, "declined");
|
|
10638
11273
|
setHasConsented(true);
|
|
10639
11274
|
}, [storageKey]);
|
|
10640
|
-
const resetConsent =
|
|
11275
|
+
const resetConsent = React49.useCallback(() => {
|
|
10641
11276
|
localStorage.removeItem(storageKey);
|
|
10642
11277
|
setHasConsented(false);
|
|
10643
11278
|
}, [storageKey]);
|
|
@@ -11024,9 +11659,9 @@ function CSVFileUpload({
|
|
|
11024
11659
|
selectFile = "Select a file to upload or drag and drop",
|
|
11025
11660
|
selectButton = "Select File to Upload"
|
|
11026
11661
|
} = labels;
|
|
11027
|
-
const inputRef =
|
|
11028
|
-
const [isDragging, setIsDragging] =
|
|
11029
|
-
const handleDrop =
|
|
11662
|
+
const inputRef = React49.useRef(null);
|
|
11663
|
+
const [isDragging, setIsDragging] = React49.useState(false);
|
|
11664
|
+
const handleDrop = React49.useCallback(
|
|
11030
11665
|
(e) => {
|
|
11031
11666
|
e.preventDefault();
|
|
11032
11667
|
setIsDragging(false);
|
|
@@ -11037,14 +11672,14 @@ function CSVFileUpload({
|
|
|
11037
11672
|
},
|
|
11038
11673
|
[onFileSelect]
|
|
11039
11674
|
);
|
|
11040
|
-
const handleDragOver =
|
|
11675
|
+
const handleDragOver = React49.useCallback((e) => {
|
|
11041
11676
|
e.preventDefault();
|
|
11042
11677
|
setIsDragging(true);
|
|
11043
11678
|
}, []);
|
|
11044
|
-
const handleDragLeave =
|
|
11679
|
+
const handleDragLeave = React49.useCallback(() => {
|
|
11045
11680
|
setIsDragging(false);
|
|
11046
11681
|
}, []);
|
|
11047
|
-
const handleFileChange =
|
|
11682
|
+
const handleFileChange = React49.useCallback(
|
|
11048
11683
|
(e) => {
|
|
11049
11684
|
const file = e.target.files?.[0];
|
|
11050
11685
|
if (file) {
|
|
@@ -11109,7 +11744,7 @@ var widgetVariants = cva("", {
|
|
|
11109
11744
|
size: "md"
|
|
11110
11745
|
}
|
|
11111
11746
|
});
|
|
11112
|
-
var DashboardWidget =
|
|
11747
|
+
var DashboardWidget = React49.forwardRef(
|
|
11113
11748
|
({
|
|
11114
11749
|
className,
|
|
11115
11750
|
size,
|
|
@@ -11204,7 +11839,7 @@ var DashboardWidget = React48.forwardRef(
|
|
|
11204
11839
|
}
|
|
11205
11840
|
);
|
|
11206
11841
|
DashboardWidget.displayName = "DashboardWidget";
|
|
11207
|
-
var DashboardWidgetInfo =
|
|
11842
|
+
var DashboardWidgetInfo = React49.forwardRef(({ className, items, columns = 2, layout = "stacked", ...props }, ref) => {
|
|
11208
11843
|
const gridCols = {
|
|
11209
11844
|
1: "grid-cols-1",
|
|
11210
11845
|
2: "grid-cols-2",
|
|
@@ -11338,10 +11973,10 @@ function WidgetRowActionMenu({
|
|
|
11338
11973
|
rowIndex,
|
|
11339
11974
|
actions
|
|
11340
11975
|
}) {
|
|
11341
|
-
const [open, setOpen] =
|
|
11342
|
-
const menuRef =
|
|
11343
|
-
const buttonRef =
|
|
11344
|
-
|
|
11976
|
+
const [open, setOpen] = React49.useState(false);
|
|
11977
|
+
const menuRef = React49.useRef(null);
|
|
11978
|
+
const buttonRef = React49.useRef(null);
|
|
11979
|
+
React49.useEffect(() => {
|
|
11345
11980
|
if (!open) return;
|
|
11346
11981
|
function handleClick(e) {
|
|
11347
11982
|
if (menuRef.current && !menuRef.current.contains(e.target) && buttonRef.current && !buttonRef.current.contains(e.target)) {
|
|
@@ -11351,7 +11986,7 @@ function WidgetRowActionMenu({
|
|
|
11351
11986
|
document.addEventListener("mousedown", handleClick);
|
|
11352
11987
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
11353
11988
|
}, [open]);
|
|
11354
|
-
|
|
11989
|
+
React49.useEffect(() => {
|
|
11355
11990
|
if (!open) return;
|
|
11356
11991
|
function handleKey(e) {
|
|
11357
11992
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -11359,8 +11994,8 @@ function WidgetRowActionMenu({
|
|
|
11359
11994
|
document.addEventListener("keydown", handleKey);
|
|
11360
11995
|
return () => document.removeEventListener("keydown", handleKey);
|
|
11361
11996
|
}, [open]);
|
|
11362
|
-
const [menuPos, setMenuPos] =
|
|
11363
|
-
|
|
11997
|
+
const [menuPos, setMenuPos] = React49.useState(null);
|
|
11998
|
+
React49.useLayoutEffect(() => {
|
|
11364
11999
|
if (!open || !buttonRef.current) return;
|
|
11365
12000
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
11366
12001
|
setMenuPos({
|
|
@@ -11441,7 +12076,7 @@ function WidgetRowActionMenu({
|
|
|
11441
12076
|
)
|
|
11442
12077
|
] });
|
|
11443
12078
|
}
|
|
11444
|
-
var DashboardWidgetTable =
|
|
12079
|
+
var DashboardWidgetTable = React49.forwardRef(DashboardWidgetTableInner);
|
|
11445
12080
|
var actionColorMap = {
|
|
11446
12081
|
primary: "bg-primary-100 text-primary-900 dark:bg-primary-900/40 dark:text-primary-300",
|
|
11447
12082
|
green: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",
|
|
@@ -11452,7 +12087,7 @@ var actionColorMap = {
|
|
|
11452
12087
|
amber: "bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",
|
|
11453
12088
|
neutral: "bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"
|
|
11454
12089
|
};
|
|
11455
|
-
var DashboardWidgetActions =
|
|
12090
|
+
var DashboardWidgetActions = React49.forwardRef(({ className, actions, columns = 2, ...props }, ref) => {
|
|
11456
12091
|
const gridCols = {
|
|
11457
12092
|
1: "grid-cols-1",
|
|
11458
12093
|
2: "grid-cols-2",
|
|
@@ -11505,7 +12140,7 @@ var DashboardWidgetActions = React48.forwardRef(({ className, actions, columns =
|
|
|
11505
12140
|
);
|
|
11506
12141
|
});
|
|
11507
12142
|
DashboardWidgetActions.displayName = "DashboardWidgetActions";
|
|
11508
|
-
var DashboardWidgetDataCards =
|
|
12143
|
+
var DashboardWidgetDataCards = React49.forwardRef(({ className, items, columns = 2, footer, ...props }, ref) => {
|
|
11509
12144
|
const gridCols = {
|
|
11510
12145
|
2: "grid-cols-2",
|
|
11511
12146
|
3: "grid-cols-3",
|
|
@@ -11707,24 +12342,24 @@ function DateRangePicker({
|
|
|
11707
12342
|
labels = {}
|
|
11708
12343
|
}) {
|
|
11709
12344
|
const finalPresets = presets || getDefaultPresets(labels);
|
|
11710
|
-
const [isCalendarOpen, setIsCalendarOpen] =
|
|
11711
|
-
const [leftMonth, setLeftMonth] =
|
|
12345
|
+
const [isCalendarOpen, setIsCalendarOpen] = React49.useState(false);
|
|
12346
|
+
const [leftMonth, setLeftMonth] = React49.useState(
|
|
11712
12347
|
() => value?.start?.getMonth() ?? (/* @__PURE__ */ new Date()).getMonth()
|
|
11713
12348
|
);
|
|
11714
|
-
const [leftYear, setLeftYear] =
|
|
12349
|
+
const [leftYear, setLeftYear] = React49.useState(
|
|
11715
12350
|
() => value?.start?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear()
|
|
11716
12351
|
);
|
|
11717
|
-
const [rangeStart, setRangeStart] =
|
|
12352
|
+
const [rangeStart, setRangeStart] = React49.useState(
|
|
11718
12353
|
value?.start ?? null
|
|
11719
12354
|
);
|
|
11720
|
-
const [rangeEnd, setRangeEnd] =
|
|
12355
|
+
const [rangeEnd, setRangeEnd] = React49.useState(
|
|
11721
12356
|
value?.end ?? null
|
|
11722
12357
|
);
|
|
11723
|
-
const [selectingEnd, setSelectingEnd] =
|
|
11724
|
-
const [hoverDate, setHoverDate] =
|
|
11725
|
-
const calendarRef =
|
|
11726
|
-
const triggerRef =
|
|
11727
|
-
const [resolvedAlign, setResolvedAlign] =
|
|
12358
|
+
const [selectingEnd, setSelectingEnd] = React49.useState(false);
|
|
12359
|
+
const [hoverDate, setHoverDate] = React49.useState(null);
|
|
12360
|
+
const calendarRef = React49.useRef(null);
|
|
12361
|
+
const triggerRef = React49.useRef(null);
|
|
12362
|
+
const [resolvedAlign, setResolvedAlign] = React49.useState(
|
|
11728
12363
|
align === "end" ? "end" : "start"
|
|
11729
12364
|
);
|
|
11730
12365
|
const isMobileVariant = variant === "mobile";
|
|
@@ -11734,7 +12369,7 @@ function DateRangePicker({
|
|
|
11734
12369
|
);
|
|
11735
12370
|
const rightMonth = leftMonth === 11 ? 0 : leftMonth + 1;
|
|
11736
12371
|
const rightYear = leftMonth === 11 ? leftYear + 1 : leftYear;
|
|
11737
|
-
|
|
12372
|
+
React49.useEffect(() => {
|
|
11738
12373
|
if (!value) {
|
|
11739
12374
|
setRangeStart(null);
|
|
11740
12375
|
setRangeEnd(null);
|
|
@@ -11743,7 +12378,7 @@ function DateRangePicker({
|
|
|
11743
12378
|
setRangeStart(value.start ?? null);
|
|
11744
12379
|
setRangeEnd(value.end ?? null);
|
|
11745
12380
|
}, [value]);
|
|
11746
|
-
const wrapperRef =
|
|
12381
|
+
const wrapperRef = React49.useRef(null);
|
|
11747
12382
|
useClickOutside(wrapperRef, () => {
|
|
11748
12383
|
if (isCalendarOpen) {
|
|
11749
12384
|
setIsCalendarOpen(false);
|
|
@@ -11755,7 +12390,7 @@ function DateRangePicker({
|
|
|
11755
12390
|
setSelectingEnd(false);
|
|
11756
12391
|
triggerRef.current?.focus();
|
|
11757
12392
|
}, isCalendarOpen);
|
|
11758
|
-
|
|
12393
|
+
React49.useEffect(() => {
|
|
11759
12394
|
if (isStorybookDocsMode()) return;
|
|
11760
12395
|
if (isMobileVariant && isCalendarOpen) {
|
|
11761
12396
|
const prev = document.body.style.overflow;
|
|
@@ -11765,7 +12400,7 @@ function DateRangePicker({
|
|
|
11765
12400
|
};
|
|
11766
12401
|
}
|
|
11767
12402
|
}, [isMobileVariant, isCalendarOpen]);
|
|
11768
|
-
|
|
12403
|
+
React49.useLayoutEffect(() => {
|
|
11769
12404
|
if (isMobileVariant || !isCalendarOpen) return;
|
|
11770
12405
|
if (align === "start" || align === "end") {
|
|
11771
12406
|
setResolvedAlign(align);
|
|
@@ -11870,7 +12505,7 @@ function DateRangePicker({
|
|
|
11870
12505
|
return isSameDay(date, today);
|
|
11871
12506
|
};
|
|
11872
12507
|
const displayValue = value ? formatDateRange(value) : "";
|
|
11873
|
-
const monthNames =
|
|
12508
|
+
const monthNames = React49.useMemo(
|
|
11874
12509
|
() => Array.from(
|
|
11875
12510
|
{ length: 12 },
|
|
11876
12511
|
(_, i) => new Intl.DateTimeFormat(void 0, { month: "long" }).format(
|
|
@@ -11879,7 +12514,7 @@ function DateRangePicker({
|
|
|
11879
12514
|
),
|
|
11880
12515
|
[]
|
|
11881
12516
|
);
|
|
11882
|
-
const weekdayNames =
|
|
12517
|
+
const weekdayNames = React49.useMemo(
|
|
11883
12518
|
() => Array.from(
|
|
11884
12519
|
{ length: 7 },
|
|
11885
12520
|
(_, i) => new Intl.DateTimeFormat(void 0, { weekday: "short" }).format(
|
|
@@ -12308,11 +12943,11 @@ function DropZone({
|
|
|
12308
12943
|
className,
|
|
12309
12944
|
children
|
|
12310
12945
|
}) {
|
|
12311
|
-
const [isDragging, setIsDragging] =
|
|
12312
|
-
const inputRef =
|
|
12313
|
-
const dropZoneRef =
|
|
12314
|
-
const dragCounter =
|
|
12315
|
-
const handleDragEnter =
|
|
12946
|
+
const [isDragging, setIsDragging] = React49.useState(false);
|
|
12947
|
+
const inputRef = React49.useRef(null);
|
|
12948
|
+
const dropZoneRef = React49.useRef(null);
|
|
12949
|
+
const dragCounter = React49.useRef(0);
|
|
12950
|
+
const handleDragEnter = React49.useCallback(
|
|
12316
12951
|
(e) => {
|
|
12317
12952
|
e.preventDefault();
|
|
12318
12953
|
e.stopPropagation();
|
|
@@ -12324,7 +12959,7 @@ function DropZone({
|
|
|
12324
12959
|
},
|
|
12325
12960
|
[disabled]
|
|
12326
12961
|
);
|
|
12327
|
-
const handleDragLeave =
|
|
12962
|
+
const handleDragLeave = React49.useCallback(
|
|
12328
12963
|
(e) => {
|
|
12329
12964
|
e.preventDefault();
|
|
12330
12965
|
e.stopPropagation();
|
|
@@ -12336,11 +12971,11 @@ function DropZone({
|
|
|
12336
12971
|
},
|
|
12337
12972
|
[disabled]
|
|
12338
12973
|
);
|
|
12339
|
-
const handleDragOver =
|
|
12974
|
+
const handleDragOver = React49.useCallback((e) => {
|
|
12340
12975
|
e.preventDefault();
|
|
12341
12976
|
e.stopPropagation();
|
|
12342
12977
|
}, []);
|
|
12343
|
-
const handleDrop =
|
|
12978
|
+
const handleDrop = React49.useCallback(
|
|
12344
12979
|
(e) => {
|
|
12345
12980
|
e.preventDefault();
|
|
12346
12981
|
e.stopPropagation();
|
|
@@ -12353,12 +12988,12 @@ function DropZone({
|
|
|
12353
12988
|
},
|
|
12354
12989
|
[disabled, onFilesSelected]
|
|
12355
12990
|
);
|
|
12356
|
-
const handleClick =
|
|
12991
|
+
const handleClick = React49.useCallback(() => {
|
|
12357
12992
|
if (!disabled) {
|
|
12358
12993
|
inputRef.current?.click();
|
|
12359
12994
|
}
|
|
12360
12995
|
}, [disabled]);
|
|
12361
|
-
const handleKeyDown =
|
|
12996
|
+
const handleKeyDown = React49.useCallback(
|
|
12362
12997
|
(e) => {
|
|
12363
12998
|
if ((e.key === "Enter" || e.key === " ") && !disabled) {
|
|
12364
12999
|
e.preventDefault();
|
|
@@ -12367,7 +13002,7 @@ function DropZone({
|
|
|
12367
13002
|
},
|
|
12368
13003
|
[disabled]
|
|
12369
13004
|
);
|
|
12370
|
-
const handleInputChange =
|
|
13005
|
+
const handleInputChange = React49.useCallback(
|
|
12371
13006
|
(e) => {
|
|
12372
13007
|
if (e.target.files && e.target.files.length > 0) {
|
|
12373
13008
|
onFilesSelected(e.target.files);
|
|
@@ -12458,7 +13093,7 @@ DropZone.displayName = "DropZone";
|
|
|
12458
13093
|
function FilePreviewItem({ file, onRemove, disabled }) {
|
|
12459
13094
|
const isPdf = file.file.type === "application/pdf";
|
|
12460
13095
|
const isImage = file.file.type.startsWith("image/");
|
|
12461
|
-
const handleRemove =
|
|
13096
|
+
const handleRemove = React49.useCallback(() => {
|
|
12462
13097
|
onRemove(file.id);
|
|
12463
13098
|
}, [file.id, onRemove]);
|
|
12464
13099
|
return /* @__PURE__ */ jsxs(
|
|
@@ -12604,24 +13239,24 @@ function useCamera({
|
|
|
12604
13239
|
width = 1920,
|
|
12605
13240
|
height = 1080
|
|
12606
13241
|
} = {}) {
|
|
12607
|
-
const [permission, setPermission] =
|
|
12608
|
-
const [stream, setStream] =
|
|
12609
|
-
const [isReady, setIsReady] =
|
|
12610
|
-
const [error, setError] =
|
|
12611
|
-
const [currentFacingMode, setCurrentFacingMode] =
|
|
12612
|
-
const videoRef =
|
|
12613
|
-
const canvasRef =
|
|
12614
|
-
|
|
13242
|
+
const [permission, setPermission] = React49.useState("prompt");
|
|
13243
|
+
const [stream, setStream] = React49.useState(null);
|
|
13244
|
+
const [isReady, setIsReady] = React49.useState(false);
|
|
13245
|
+
const [error, setError] = React49.useState(null);
|
|
13246
|
+
const [currentFacingMode, setCurrentFacingMode] = React49.useState(initialFacingMode);
|
|
13247
|
+
const videoRef = React49.useRef(null);
|
|
13248
|
+
const canvasRef = React49.useRef(null);
|
|
13249
|
+
React49.useEffect(() => {
|
|
12615
13250
|
checkCameraPermission().then(setPermission);
|
|
12616
13251
|
}, []);
|
|
12617
|
-
|
|
13252
|
+
React49.useEffect(() => {
|
|
12618
13253
|
return () => {
|
|
12619
13254
|
if (stream) {
|
|
12620
13255
|
stream.getTracks().forEach((track) => track.stop());
|
|
12621
13256
|
}
|
|
12622
13257
|
};
|
|
12623
13258
|
}, [stream]);
|
|
12624
|
-
const startCamera =
|
|
13259
|
+
const startCamera = React49.useCallback(async () => {
|
|
12625
13260
|
if (!hasCameraSupport()) {
|
|
12626
13261
|
setPermission("unavailable");
|
|
12627
13262
|
setError(new Error("Camera is not supported on this device"));
|
|
@@ -12655,7 +13290,7 @@ function useCamera({
|
|
|
12655
13290
|
}
|
|
12656
13291
|
}
|
|
12657
13292
|
}, [currentFacingMode, width, height]);
|
|
12658
|
-
const stopCamera =
|
|
13293
|
+
const stopCamera = React49.useCallback(() => {
|
|
12659
13294
|
if (stream) {
|
|
12660
13295
|
stream.getTracks().forEach((track) => track.stop());
|
|
12661
13296
|
setStream(null);
|
|
@@ -12665,8 +13300,8 @@ function useCamera({
|
|
|
12665
13300
|
videoRef.current.srcObject = null;
|
|
12666
13301
|
}
|
|
12667
13302
|
}, [stream]);
|
|
12668
|
-
const shouldRestartRef =
|
|
12669
|
-
const switchCamera =
|
|
13303
|
+
const shouldRestartRef = React49.useRef(false);
|
|
13304
|
+
const switchCamera = React49.useCallback(() => {
|
|
12670
13305
|
const newFacingMode = currentFacingMode === "user" ? "environment" : "user";
|
|
12671
13306
|
if (stream) {
|
|
12672
13307
|
stream.getTracks().forEach((track) => track.stop());
|
|
@@ -12679,13 +13314,13 @@ function useCamera({
|
|
|
12679
13314
|
}
|
|
12680
13315
|
setCurrentFacingMode(newFacingMode);
|
|
12681
13316
|
}, [currentFacingMode, stream]);
|
|
12682
|
-
|
|
13317
|
+
React49.useEffect(() => {
|
|
12683
13318
|
if (shouldRestartRef.current && !stream) {
|
|
12684
13319
|
shouldRestartRef.current = false;
|
|
12685
13320
|
startCamera();
|
|
12686
13321
|
}
|
|
12687
13322
|
}, [currentFacingMode, stream, startCamera]);
|
|
12688
|
-
const capturePhoto =
|
|
13323
|
+
const capturePhoto = React49.useCallback(() => {
|
|
12689
13324
|
if (!videoRef.current || !isReady) {
|
|
12690
13325
|
return null;
|
|
12691
13326
|
}
|
|
@@ -13232,14 +13867,14 @@ function WebcamModal({
|
|
|
13232
13867
|
width: 1920,
|
|
13233
13868
|
height: 1080
|
|
13234
13869
|
});
|
|
13235
|
-
const [capturedFile, setCapturedFile] =
|
|
13236
|
-
const [previewUrl, setPreviewUrl] =
|
|
13237
|
-
const [autoDetectEnabled, setAutoDetectEnabled] =
|
|
13238
|
-
const [videoDimensions, setVideoDimensions] =
|
|
13870
|
+
const [capturedFile, setCapturedFile] = React49.useState(null);
|
|
13871
|
+
const [previewUrl, setPreviewUrl] = React49.useState(null);
|
|
13872
|
+
const [autoDetectEnabled, setAutoDetectEnabled] = React49.useState(enableAutoCapture);
|
|
13873
|
+
const [videoDimensions, setVideoDimensions] = React49.useState({
|
|
13239
13874
|
width: 0,
|
|
13240
13875
|
height: 0
|
|
13241
13876
|
});
|
|
13242
|
-
const handleAutoCapture =
|
|
13877
|
+
const handleAutoCapture = React49.useCallback(() => {
|
|
13243
13878
|
const file = capturePhoto();
|
|
13244
13879
|
if (file) {
|
|
13245
13880
|
setCapturedFile(file);
|
|
@@ -13260,8 +13895,8 @@ function WebcamModal({
|
|
|
13260
13895
|
},
|
|
13261
13896
|
handleAutoCapture
|
|
13262
13897
|
);
|
|
13263
|
-
const hasStartedRef =
|
|
13264
|
-
|
|
13898
|
+
const hasStartedRef = React49.useRef(false);
|
|
13899
|
+
React49.useEffect(() => {
|
|
13265
13900
|
const video = videoRef.current;
|
|
13266
13901
|
if (video && isReady) {
|
|
13267
13902
|
const updateDimensions = () => {
|
|
@@ -13275,7 +13910,7 @@ function WebcamModal({
|
|
|
13275
13910
|
return () => video.removeEventListener("resize", updateDimensions);
|
|
13276
13911
|
}
|
|
13277
13912
|
}, [isReady, videoRef]);
|
|
13278
|
-
|
|
13913
|
+
React49.useEffect(() => {
|
|
13279
13914
|
if (open && permission !== "denied" && permission !== "unavailable") {
|
|
13280
13915
|
if (!hasStartedRef.current) {
|
|
13281
13916
|
hasStartedRef.current = true;
|
|
@@ -13294,7 +13929,7 @@ function WebcamModal({
|
|
|
13294
13929
|
});
|
|
13295
13930
|
}
|
|
13296
13931
|
}, [open, permission]);
|
|
13297
|
-
|
|
13932
|
+
React49.useEffect(() => {
|
|
13298
13933
|
if (isReady && autoDetectEnabled && !capturedFile) {
|
|
13299
13934
|
detection.startDetection();
|
|
13300
13935
|
}
|
|
@@ -13302,7 +13937,7 @@ function WebcamModal({
|
|
|
13302
13937
|
detection.stopDetection();
|
|
13303
13938
|
};
|
|
13304
13939
|
}, [isReady, autoDetectEnabled, capturedFile]);
|
|
13305
|
-
const handleCapture =
|
|
13940
|
+
const handleCapture = React49.useCallback(() => {
|
|
13306
13941
|
const file = capturePhoto();
|
|
13307
13942
|
if (file) {
|
|
13308
13943
|
setCapturedFile(file);
|
|
@@ -13310,7 +13945,7 @@ function WebcamModal({
|
|
|
13310
13945
|
stopCamera();
|
|
13311
13946
|
}
|
|
13312
13947
|
}, [capturePhoto, stopCamera]);
|
|
13313
|
-
const handleRetake =
|
|
13948
|
+
const handleRetake = React49.useCallback(() => {
|
|
13314
13949
|
if (previewUrl) {
|
|
13315
13950
|
URL.revokeObjectURL(previewUrl);
|
|
13316
13951
|
}
|
|
@@ -13319,13 +13954,13 @@ function WebcamModal({
|
|
|
13319
13954
|
detection.resetDetection();
|
|
13320
13955
|
startCamera();
|
|
13321
13956
|
}, [previewUrl, startCamera, detection]);
|
|
13322
|
-
const handleConfirm =
|
|
13957
|
+
const handleConfirm = React49.useCallback(() => {
|
|
13323
13958
|
if (capturedFile) {
|
|
13324
13959
|
onCapture(capturedFile);
|
|
13325
13960
|
onOpenChange(false);
|
|
13326
13961
|
}
|
|
13327
13962
|
}, [capturedFile, onCapture, onOpenChange]);
|
|
13328
|
-
const handleClose =
|
|
13963
|
+
const handleClose = React49.useCallback(() => {
|
|
13329
13964
|
stopCamera();
|
|
13330
13965
|
detection.stopDetection();
|
|
13331
13966
|
if (previewUrl) {
|
|
@@ -13477,13 +14112,13 @@ function useFileUpload({
|
|
|
13477
14112
|
multiple = false,
|
|
13478
14113
|
onValidationError
|
|
13479
14114
|
} = {}) {
|
|
13480
|
-
const [files, setFiles] =
|
|
13481
|
-
|
|
14115
|
+
const [files, setFiles] = React49.useState([]);
|
|
14116
|
+
React49.useEffect(() => {
|
|
13482
14117
|
return () => {
|
|
13483
14118
|
files.forEach((f) => URL.revokeObjectURL(f.previewUrl));
|
|
13484
14119
|
};
|
|
13485
14120
|
}, []);
|
|
13486
|
-
const addFiles =
|
|
14121
|
+
const addFiles = React49.useCallback(
|
|
13487
14122
|
(fileList, source = "upload") => {
|
|
13488
14123
|
const newFiles = [];
|
|
13489
14124
|
const errors = [];
|
|
@@ -13515,7 +14150,7 @@ function useFileUpload({
|
|
|
13515
14150
|
},
|
|
13516
14151
|
[acceptedFileTypes, maxFileSizeMb, multiple, onValidationError]
|
|
13517
14152
|
);
|
|
13518
|
-
const addFile =
|
|
14153
|
+
const addFile = React49.useCallback(
|
|
13519
14154
|
(file, source = "upload") => {
|
|
13520
14155
|
const dataTransfer = new DataTransfer();
|
|
13521
14156
|
dataTransfer.items.add(file);
|
|
@@ -13523,7 +14158,7 @@ function useFileUpload({
|
|
|
13523
14158
|
},
|
|
13524
14159
|
[addFiles]
|
|
13525
14160
|
);
|
|
13526
|
-
const removeFile =
|
|
14161
|
+
const removeFile = React49.useCallback((id) => {
|
|
13527
14162
|
setFiles((prev) => {
|
|
13528
14163
|
const fileToRemove = prev.find((f) => f.id === id);
|
|
13529
14164
|
if (fileToRemove) {
|
|
@@ -13532,13 +14167,13 @@ function useFileUpload({
|
|
|
13532
14167
|
return prev.filter((f) => f.id !== id);
|
|
13533
14168
|
});
|
|
13534
14169
|
}, []);
|
|
13535
|
-
const clearFiles =
|
|
14170
|
+
const clearFiles = React49.useCallback(() => {
|
|
13536
14171
|
setFiles((prev) => {
|
|
13537
14172
|
prev.forEach((f) => URL.revokeObjectURL(f.previewUrl));
|
|
13538
14173
|
return [];
|
|
13539
14174
|
});
|
|
13540
14175
|
}, []);
|
|
13541
|
-
const getFiles =
|
|
14176
|
+
const getFiles = React49.useCallback(() => {
|
|
13542
14177
|
return files.map((f) => f.file);
|
|
13543
14178
|
}, [files]);
|
|
13544
14179
|
return {
|
|
@@ -13566,12 +14201,12 @@ function DocumentScanner({
|
|
|
13566
14201
|
onValidationError,
|
|
13567
14202
|
onStateChange
|
|
13568
14203
|
}) {
|
|
13569
|
-
const [state, setState] =
|
|
13570
|
-
const [error, setError] =
|
|
13571
|
-
const [isWebcamOpen, setIsWebcamOpen] =
|
|
13572
|
-
const [validationErrors, setValidationErrors] =
|
|
14204
|
+
const [state, setState] = React49.useState("idle");
|
|
14205
|
+
const [error, setError] = React49.useState(null);
|
|
14206
|
+
const [isWebcamOpen, setIsWebcamOpen] = React49.useState(false);
|
|
14207
|
+
const [validationErrors, setValidationErrors] = React49.useState([]);
|
|
13573
14208
|
const isMobile = useIsMobile();
|
|
13574
|
-
const cameraInputRef =
|
|
14209
|
+
const cameraInputRef = React49.useRef(null);
|
|
13575
14210
|
const {
|
|
13576
14211
|
files,
|
|
13577
14212
|
addFiles,
|
|
@@ -13589,17 +14224,17 @@ function DocumentScanner({
|
|
|
13589
14224
|
onValidationError?.(errors);
|
|
13590
14225
|
}
|
|
13591
14226
|
});
|
|
13592
|
-
|
|
14227
|
+
React49.useEffect(() => {
|
|
13593
14228
|
onStateChange?.(state);
|
|
13594
14229
|
}, [state, onStateChange]);
|
|
13595
|
-
|
|
14230
|
+
React49.useEffect(() => {
|
|
13596
14231
|
if (hasFiles && state === "idle") {
|
|
13597
14232
|
setState("preview");
|
|
13598
14233
|
} else if (!hasFiles && state === "preview") {
|
|
13599
14234
|
setState("idle");
|
|
13600
14235
|
}
|
|
13601
14236
|
}, [hasFiles, state]);
|
|
13602
|
-
const handleFilesSelected =
|
|
14237
|
+
const handleFilesSelected = React49.useCallback(
|
|
13603
14238
|
(fileList) => {
|
|
13604
14239
|
setError(null);
|
|
13605
14240
|
setValidationErrors([]);
|
|
@@ -13607,10 +14242,10 @@ function DocumentScanner({
|
|
|
13607
14242
|
},
|
|
13608
14243
|
[addFiles]
|
|
13609
14244
|
);
|
|
13610
|
-
const handleCameraCapture =
|
|
14245
|
+
const handleCameraCapture = React49.useCallback(() => {
|
|
13611
14246
|
cameraInputRef.current?.click();
|
|
13612
14247
|
}, []);
|
|
13613
|
-
const handleCameraInputChange =
|
|
14248
|
+
const handleCameraInputChange = React49.useCallback(
|
|
13614
14249
|
(e) => {
|
|
13615
14250
|
if (e.target.files && e.target.files.length > 0) {
|
|
13616
14251
|
setError(null);
|
|
@@ -13621,7 +14256,7 @@ function DocumentScanner({
|
|
|
13621
14256
|
},
|
|
13622
14257
|
[addFiles]
|
|
13623
14258
|
);
|
|
13624
|
-
const handleWebcamCapture =
|
|
14259
|
+
const handleWebcamCapture = React49.useCallback(
|
|
13625
14260
|
(file) => {
|
|
13626
14261
|
setError(null);
|
|
13627
14262
|
setValidationErrors([]);
|
|
@@ -13629,7 +14264,7 @@ function DocumentScanner({
|
|
|
13629
14264
|
},
|
|
13630
14265
|
[addFile]
|
|
13631
14266
|
);
|
|
13632
|
-
const handleScan =
|
|
14267
|
+
const handleScan = React49.useCallback(async () => {
|
|
13633
14268
|
if (!hasFiles) return;
|
|
13634
14269
|
try {
|
|
13635
14270
|
setState("processing");
|
|
@@ -13648,11 +14283,11 @@ function DocumentScanner({
|
|
|
13648
14283
|
setError(errorMessage);
|
|
13649
14284
|
}
|
|
13650
14285
|
}, [hasFiles, getFiles, onScan, onResult, clearFiles]);
|
|
13651
|
-
const handleRetry =
|
|
14286
|
+
const handleRetry = React49.useCallback(() => {
|
|
13652
14287
|
setState("preview");
|
|
13653
14288
|
setError(null);
|
|
13654
14289
|
}, []);
|
|
13655
|
-
const handleClearAll =
|
|
14290
|
+
const handleClearAll = React49.useCallback(() => {
|
|
13656
14291
|
clearFiles();
|
|
13657
14292
|
setError(null);
|
|
13658
14293
|
setValidationErrors([]);
|
|
@@ -13965,10 +14600,10 @@ function useDropzone({
|
|
|
13965
14600
|
multiple = false,
|
|
13966
14601
|
disabled = false
|
|
13967
14602
|
}) {
|
|
13968
|
-
const [isDragging, setIsDragging] =
|
|
13969
|
-
const inputRef =
|
|
13970
|
-
const dragCounter =
|
|
13971
|
-
const handleDragEnter =
|
|
14603
|
+
const [isDragging, setIsDragging] = React49.useState(false);
|
|
14604
|
+
const inputRef = React49.useRef(null);
|
|
14605
|
+
const dragCounter = React49.useRef(0);
|
|
14606
|
+
const handleDragEnter = React49.useCallback(
|
|
13972
14607
|
(e) => {
|
|
13973
14608
|
e.preventDefault();
|
|
13974
14609
|
e.stopPropagation();
|
|
@@ -13980,11 +14615,11 @@ function useDropzone({
|
|
|
13980
14615
|
},
|
|
13981
14616
|
[disabled]
|
|
13982
14617
|
);
|
|
13983
|
-
const handleDragOver =
|
|
14618
|
+
const handleDragOver = React49.useCallback((e) => {
|
|
13984
14619
|
e.preventDefault();
|
|
13985
14620
|
e.stopPropagation();
|
|
13986
14621
|
}, []);
|
|
13987
|
-
const handleDragLeave =
|
|
14622
|
+
const handleDragLeave = React49.useCallback((e) => {
|
|
13988
14623
|
e.preventDefault();
|
|
13989
14624
|
e.stopPropagation();
|
|
13990
14625
|
dragCounter.current--;
|
|
@@ -13992,7 +14627,7 @@ function useDropzone({
|
|
|
13992
14627
|
setIsDragging(false);
|
|
13993
14628
|
}
|
|
13994
14629
|
}, []);
|
|
13995
|
-
const handleDrop =
|
|
14630
|
+
const handleDrop = React49.useCallback(
|
|
13996
14631
|
(e) => {
|
|
13997
14632
|
e.preventDefault();
|
|
13998
14633
|
e.stopPropagation();
|
|
@@ -14006,7 +14641,7 @@ function useDropzone({
|
|
|
14006
14641
|
},
|
|
14007
14642
|
[disabled, multiple, onDrop]
|
|
14008
14643
|
);
|
|
14009
|
-
const handleInputChange =
|
|
14644
|
+
const handleInputChange = React49.useCallback(
|
|
14010
14645
|
(e) => {
|
|
14011
14646
|
const files = e.target.files ? Array.from(e.target.files) : [];
|
|
14012
14647
|
if (files.length > 0) {
|
|
@@ -14016,7 +14651,7 @@ function useDropzone({
|
|
|
14016
14651
|
},
|
|
14017
14652
|
[onDrop]
|
|
14018
14653
|
);
|
|
14019
|
-
const open =
|
|
14654
|
+
const open = React49.useCallback(() => {
|
|
14020
14655
|
if (!disabled) {
|
|
14021
14656
|
inputRef.current?.click();
|
|
14022
14657
|
}
|
|
@@ -14066,7 +14701,7 @@ function ClaimProviderForm({
|
|
|
14066
14701
|
termsUrl = "/terms",
|
|
14067
14702
|
className = ""
|
|
14068
14703
|
}) {
|
|
14069
|
-
const [formData, setFormData] =
|
|
14704
|
+
const [formData, setFormData] = React49.useState({
|
|
14070
14705
|
firstName: "",
|
|
14071
14706
|
lastName: "",
|
|
14072
14707
|
email: "",
|
|
@@ -14369,14 +15004,14 @@ function CreateInvoiceModal({
|
|
|
14369
15004
|
initialStep = 1,
|
|
14370
15005
|
initialEmployerId = ""
|
|
14371
15006
|
}) {
|
|
14372
|
-
const [step, setStep] =
|
|
14373
|
-
const [employerId, setEmployerId] =
|
|
14374
|
-
const [selectedOrders, setSelectedOrders] =
|
|
15007
|
+
const [step, setStep] = React49.useState(initialStep);
|
|
15008
|
+
const [employerId, setEmployerId] = React49.useState(initialEmployerId);
|
|
15009
|
+
const [selectedOrders, setSelectedOrders] = React49.useState(
|
|
14375
15010
|
/* @__PURE__ */ new Set()
|
|
14376
15011
|
);
|
|
14377
|
-
const [dueDate, setDueDate] =
|
|
14378
|
-
const [notes, setNotes] =
|
|
14379
|
-
|
|
15012
|
+
const [dueDate, setDueDate] = React49.useState("");
|
|
15013
|
+
const [notes, setNotes] = React49.useState("");
|
|
15014
|
+
React49.useEffect(() => {
|
|
14380
15015
|
if (!open) {
|
|
14381
15016
|
setStep(initialStep);
|
|
14382
15017
|
setEmployerId(initialEmployerId);
|
|
@@ -14385,7 +15020,7 @@ function CreateInvoiceModal({
|
|
|
14385
15020
|
setNotes("");
|
|
14386
15021
|
}
|
|
14387
15022
|
}, [open, initialStep, initialEmployerId]);
|
|
14388
|
-
|
|
15023
|
+
React49.useEffect(() => {
|
|
14389
15024
|
if (!dueDate && open) {
|
|
14390
15025
|
const date = /* @__PURE__ */ new Date();
|
|
14391
15026
|
date.setDate(date.getDate() + defaultDueDays);
|
|
@@ -14808,14 +15443,14 @@ function CreateReferralModal({
|
|
|
14808
15443
|
errorMessage,
|
|
14809
15444
|
currency = "$"
|
|
14810
15445
|
}) {
|
|
14811
|
-
const [selectedServices, setSelectedServices] =
|
|
15446
|
+
const [selectedServices, setSelectedServices] = React49.useState(
|
|
14812
15447
|
/* @__PURE__ */ new Set()
|
|
14813
15448
|
);
|
|
14814
|
-
const [notes, setNotes] =
|
|
14815
|
-
const [priority, setPriority] =
|
|
15449
|
+
const [notes, setNotes] = React49.useState("");
|
|
15450
|
+
const [priority, setPriority] = React49.useState(
|
|
14816
15451
|
"normal"
|
|
14817
15452
|
);
|
|
14818
|
-
|
|
15453
|
+
React49.useEffect(() => {
|
|
14819
15454
|
if (!open) {
|
|
14820
15455
|
setSelectedServices(/* @__PURE__ */ new Set());
|
|
14821
15456
|
setNotes("");
|
|
@@ -15116,15 +15751,15 @@ function EditUserRoleModal({
|
|
|
15116
15751
|
isSubmitting = false,
|
|
15117
15752
|
errorMessage
|
|
15118
15753
|
}) {
|
|
15119
|
-
const [selectedRoleId, setSelectedRoleId] =
|
|
15754
|
+
const [selectedRoleId, setSelectedRoleId] = React49.useState(
|
|
15120
15755
|
user?.currentRoleId || ""
|
|
15121
15756
|
);
|
|
15122
|
-
|
|
15757
|
+
React49.useEffect(() => {
|
|
15123
15758
|
if (user?.currentRoleId) {
|
|
15124
15759
|
setSelectedRoleId(user.currentRoleId);
|
|
15125
15760
|
}
|
|
15126
15761
|
}, [user?.currentRoleId]);
|
|
15127
|
-
|
|
15762
|
+
React49.useEffect(() => {
|
|
15128
15763
|
if (!open && user?.currentRoleId) {
|
|
15129
15764
|
setSelectedRoleId(user.currentRoleId);
|
|
15130
15765
|
}
|
|
@@ -15295,24 +15930,24 @@ function EmployeeForm({
|
|
|
15295
15930
|
emailRequired = "Email is required",
|
|
15296
15931
|
dobRequired = "Date of birth is required"
|
|
15297
15932
|
} = labels;
|
|
15298
|
-
const [firstName, setFirstName] =
|
|
15299
|
-
const [lastName, setLastName] =
|
|
15300
|
-
const [email, setEmail] =
|
|
15301
|
-
const [dob, setDob] =
|
|
15302
|
-
const [selectedDepartments, setSelectedDepartments] =
|
|
15303
|
-
const [title, setTitle] =
|
|
15304
|
-
const [address, setAddress] =
|
|
15933
|
+
const [firstName, setFirstName] = React49.useState(initialData.firstName ?? "");
|
|
15934
|
+
const [lastName, setLastName] = React49.useState(initialData.lastName ?? "");
|
|
15935
|
+
const [email, setEmail] = React49.useState(initialData.email ?? "");
|
|
15936
|
+
const [dob, setDob] = React49.useState(initialData.dob ?? "");
|
|
15937
|
+
const [selectedDepartments, setSelectedDepartments] = React49.useState(initialData.departments ?? []);
|
|
15938
|
+
const [title, setTitle] = React49.useState(initialData.title ?? "");
|
|
15939
|
+
const [address, setAddress] = React49.useState(
|
|
15305
15940
|
initialData.address ?? {}
|
|
15306
15941
|
);
|
|
15307
|
-
const [phones, setPhones] =
|
|
15942
|
+
const [phones, setPhones] = React49.useState(
|
|
15308
15943
|
initialData.phones ?? [{ number: "", type: "cell" }]
|
|
15309
15944
|
);
|
|
15310
|
-
const [isActive, setIsActive] =
|
|
15311
|
-
const [additionalInfo, setAdditionalInfo] =
|
|
15945
|
+
const [isActive, setIsActive] = React49.useState(initialData.isActive ?? true);
|
|
15946
|
+
const [additionalInfo, setAdditionalInfo] = React49.useState(
|
|
15312
15947
|
initialData.additionalInfo ?? ""
|
|
15313
15948
|
);
|
|
15314
|
-
const [sendInvite, setSendInvite] =
|
|
15315
|
-
const [errors, setErrors] =
|
|
15949
|
+
const [sendInvite, setSendInvite] = React49.useState(false);
|
|
15950
|
+
const [errors, setErrors] = React49.useState({});
|
|
15316
15951
|
const validate = () => {
|
|
15317
15952
|
const newErrors = {};
|
|
15318
15953
|
if (!firstName.trim()) newErrors.firstName = firstNameRequired;
|
|
@@ -15731,8 +16366,8 @@ function EmployeeProfileCard({
|
|
|
15731
16366
|
className,
|
|
15732
16367
|
labels = {}
|
|
15733
16368
|
}) {
|
|
15734
|
-
const [isExpanded, setIsExpanded] =
|
|
15735
|
-
const fileInputRef =
|
|
16369
|
+
const [isExpanded, setIsExpanded] = React49.useState(defaultExpanded);
|
|
16370
|
+
const fileInputRef = React49.useRef(null);
|
|
15736
16371
|
const {
|
|
15737
16372
|
moreDetails = "more details",
|
|
15738
16373
|
lessDetails = "less details",
|
|
@@ -16265,13 +16900,13 @@ function EmployerList({
|
|
|
16265
16900
|
emptyMessage = "No employers linked yet",
|
|
16266
16901
|
className = ""
|
|
16267
16902
|
}) {
|
|
16268
|
-
const [searchQuery, setSearchQuery] =
|
|
16903
|
+
const [searchQuery, setSearchQuery] = React49.useState("");
|
|
16269
16904
|
const handleSearch = (e) => {
|
|
16270
16905
|
const query = e.target.value;
|
|
16271
16906
|
setSearchQuery(query);
|
|
16272
16907
|
onSearch?.(query);
|
|
16273
16908
|
};
|
|
16274
|
-
const filteredEmployers =
|
|
16909
|
+
const filteredEmployers = React49.useMemo(() => {
|
|
16275
16910
|
if (!searchQuery.trim()) return employers;
|
|
16276
16911
|
const q = searchQuery.toLowerCase();
|
|
16277
16912
|
return employers.filter(
|
|
@@ -16920,7 +17555,7 @@ function EmployerServiceModal({
|
|
|
16920
17555
|
isSubmitting = false,
|
|
16921
17556
|
errorMessage
|
|
16922
17557
|
}) {
|
|
16923
|
-
const [config, setConfig] =
|
|
17558
|
+
const [config, setConfig] = React49.useState({
|
|
16924
17559
|
serviceId: service?.id || "",
|
|
16925
17560
|
employerId: employer?.id || "",
|
|
16926
17561
|
customPrice: existingConfig?.customPrice,
|
|
@@ -16932,7 +17567,7 @@ function EmployerServiceModal({
|
|
|
16932
17567
|
notes: existingConfig?.notes,
|
|
16933
17568
|
billingCode: existingConfig?.billingCode
|
|
16934
17569
|
});
|
|
16935
|
-
|
|
17570
|
+
React49.useEffect(() => {
|
|
16936
17571
|
setConfig({
|
|
16937
17572
|
serviceId: service?.id || "",
|
|
16938
17573
|
employerId: employer?.id || "",
|
|
@@ -17809,8 +18444,8 @@ function FileManager({
|
|
|
17809
18444
|
errorMessage,
|
|
17810
18445
|
className = ""
|
|
17811
18446
|
}) {
|
|
17812
|
-
const [isDragging, setIsDragging] =
|
|
17813
|
-
const fileInputRef =
|
|
18447
|
+
const [isDragging, setIsDragging] = React49.useState(false);
|
|
18448
|
+
const fileInputRef = React49.useRef(null);
|
|
17814
18449
|
const hasActions = !!(onPreview || onDownload || onDelete);
|
|
17815
18450
|
const handleDragOver = (e) => {
|
|
17816
18451
|
e.preventDefault();
|
|
@@ -17995,10 +18630,10 @@ function FileRowActionMenu({
|
|
|
17995
18630
|
onDownload,
|
|
17996
18631
|
onDelete
|
|
17997
18632
|
}) {
|
|
17998
|
-
const [open, setOpen] =
|
|
17999
|
-
const menuRef =
|
|
18000
|
-
const buttonRef =
|
|
18001
|
-
|
|
18633
|
+
const [open, setOpen] = React49.useState(false);
|
|
18634
|
+
const menuRef = React49.useRef(null);
|
|
18635
|
+
const buttonRef = React49.useRef(null);
|
|
18636
|
+
React49.useEffect(() => {
|
|
18002
18637
|
if (!open) return;
|
|
18003
18638
|
function handleClick(e) {
|
|
18004
18639
|
if (menuRef.current && !menuRef.current.contains(e.target) && buttonRef.current && !buttonRef.current.contains(e.target)) {
|
|
@@ -18008,7 +18643,7 @@ function FileRowActionMenu({
|
|
|
18008
18643
|
document.addEventListener("mousedown", handleClick);
|
|
18009
18644
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
18010
18645
|
}, [open]);
|
|
18011
|
-
|
|
18646
|
+
React49.useEffect(() => {
|
|
18012
18647
|
if (!open) return;
|
|
18013
18648
|
function handleKey(e) {
|
|
18014
18649
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -18016,8 +18651,8 @@ function FileRowActionMenu({
|
|
|
18016
18651
|
document.addEventListener("keydown", handleKey);
|
|
18017
18652
|
return () => document.removeEventListener("keydown", handleKey);
|
|
18018
18653
|
}, [open]);
|
|
18019
|
-
const [menuPos, setMenuPos] =
|
|
18020
|
-
|
|
18654
|
+
const [menuPos, setMenuPos] = React49.useState(null);
|
|
18655
|
+
React49.useLayoutEffect(() => {
|
|
18021
18656
|
if (!open || !buttonRef.current) return;
|
|
18022
18657
|
function updatePosition() {
|
|
18023
18658
|
if (!buttonRef.current) return;
|
|
@@ -18137,14 +18772,14 @@ function HelpSupportPanel({
|
|
|
18137
18772
|
successMessage,
|
|
18138
18773
|
className = ""
|
|
18139
18774
|
}) {
|
|
18140
|
-
const [searchTerm, setSearchTerm] =
|
|
18141
|
-
const [expandedFaq, setExpandedFaq] =
|
|
18142
|
-
const [formData, setFormData] =
|
|
18775
|
+
const [searchTerm, setSearchTerm] = React49.useState("");
|
|
18776
|
+
const [expandedFaq, setExpandedFaq] = React49.useState(null);
|
|
18777
|
+
const [formData, setFormData] = React49.useState({
|
|
18143
18778
|
subject: "",
|
|
18144
18779
|
message: "",
|
|
18145
18780
|
email: ""
|
|
18146
18781
|
});
|
|
18147
|
-
const [showSuccess, setShowSuccess] =
|
|
18782
|
+
const [showSuccess, setShowSuccess] = React49.useState(false);
|
|
18148
18783
|
const filteredFaqs = faqs.filter(
|
|
18149
18784
|
(faq) => faq.question.toLowerCase().includes(searchTerm.toLowerCase()) || faq.answer.toLowerCase().includes(searchTerm.toLowerCase())
|
|
18150
18785
|
);
|
|
@@ -18616,7 +19251,7 @@ function HRISProviderSelector({
|
|
|
18616
19251
|
syncPending = "We are still waiting on data from your HRIS Provider. Please check back later.",
|
|
18617
19252
|
supportEmail = "support@bluehive.com"
|
|
18618
19253
|
} = labels;
|
|
18619
|
-
const filteredProviders =
|
|
19254
|
+
const filteredProviders = React49.useMemo(() => {
|
|
18620
19255
|
if (!searchQuery.trim()) return providers;
|
|
18621
19256
|
const query = searchQuery.toLowerCase();
|
|
18622
19257
|
return providers.filter((p) => p.displayName.toLowerCase().includes(query));
|
|
@@ -18903,11 +19538,11 @@ function InventoryManager({
|
|
|
18903
19538
|
isLoading = false,
|
|
18904
19539
|
className = ""
|
|
18905
19540
|
}) {
|
|
18906
|
-
const [updateType, setUpdateType] =
|
|
19541
|
+
const [updateType, setUpdateType] = React49.useState(
|
|
18907
19542
|
"credit"
|
|
18908
19543
|
);
|
|
18909
|
-
const [updateAmount, setUpdateAmount] =
|
|
18910
|
-
const [updateMemo, setUpdateMemo] =
|
|
19544
|
+
const [updateAmount, setUpdateAmount] = React49.useState("");
|
|
19545
|
+
const [updateMemo, setUpdateMemo] = React49.useState("");
|
|
18911
19546
|
const handleSubmit = () => {
|
|
18912
19547
|
if (!updateAmount || !onUpdateSubmit) return;
|
|
18913
19548
|
const amount = parseInt(updateAmount, 10);
|
|
@@ -18973,7 +19608,7 @@ function InventoryManager({
|
|
|
18973
19608
|
/* @__PURE__ */ jsx("th", { className: "text-muted-foreground py-2 text-left text-xs font-medium tracking-wider uppercase", children: "Change" }),
|
|
18974
19609
|
/* @__PURE__ */ jsx("th", { className: "text-muted-foreground py-2 text-right text-xs font-medium tracking-wider uppercase", children: "Quantity" })
|
|
18975
19610
|
] }) }),
|
|
18976
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-border/50 divide-y", children: logEntries.map((entry) => /* @__PURE__ */ jsxs(
|
|
19611
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-border/50 divide-y", children: logEntries.map((entry) => /* @__PURE__ */ jsxs(React49.Fragment, { children: [
|
|
18977
19612
|
/* @__PURE__ */ jsxs("tr", { children: [
|
|
18978
19613
|
/* @__PURE__ */ jsx(
|
|
18979
19614
|
"td",
|
|
@@ -19207,12 +19842,12 @@ function InviteUserModal({
|
|
|
19207
19842
|
errorMessage,
|
|
19208
19843
|
successMessage
|
|
19209
19844
|
}) {
|
|
19210
|
-
const [email, setEmail] =
|
|
19211
|
-
const [firstName, setFirstName] =
|
|
19212
|
-
const [lastName, setLastName] =
|
|
19213
|
-
const [roleId, setRoleId] =
|
|
19214
|
-
const [message, setMessage] =
|
|
19215
|
-
|
|
19845
|
+
const [email, setEmail] = React49.useState("");
|
|
19846
|
+
const [firstName, setFirstName] = React49.useState("");
|
|
19847
|
+
const [lastName, setLastName] = React49.useState("");
|
|
19848
|
+
const [roleId, setRoleId] = React49.useState(defaultRoleId || "");
|
|
19849
|
+
const [message, setMessage] = React49.useState("");
|
|
19850
|
+
React49.useEffect(() => {
|
|
19216
19851
|
if (!open) {
|
|
19217
19852
|
setEmail("");
|
|
19218
19853
|
setFirstName("");
|
|
@@ -19452,7 +20087,7 @@ function InvoiceList({
|
|
|
19452
20087
|
currency = "$",
|
|
19453
20088
|
className = ""
|
|
19454
20089
|
}) {
|
|
19455
|
-
const [searchQuery, setSearchQuery] =
|
|
20090
|
+
const [searchQuery, setSearchQuery] = React49.useState("");
|
|
19456
20091
|
const handleSearch = (e) => {
|
|
19457
20092
|
const query = e.target.value;
|
|
19458
20093
|
setSearchQuery(query);
|
|
@@ -19489,7 +20124,7 @@ function InvoiceList({
|
|
|
19489
20124
|
{ value: "overdue", label: "Overdue" },
|
|
19490
20125
|
{ value: "cancelled", label: "Cancelled" }
|
|
19491
20126
|
];
|
|
19492
|
-
const filteredInvoices =
|
|
20127
|
+
const filteredInvoices = React49.useMemo(() => {
|
|
19493
20128
|
let result = invoices;
|
|
19494
20129
|
if (statusFilter !== "all") {
|
|
19495
20130
|
result = result.filter((inv) => inv.status === statusFilter);
|
|
@@ -19502,7 +20137,7 @@ function InvoiceList({
|
|
|
19502
20137
|
}
|
|
19503
20138
|
return result;
|
|
19504
20139
|
}, [invoices, statusFilter, searchQuery]);
|
|
19505
|
-
const totals =
|
|
20140
|
+
const totals = React49.useMemo(() => {
|
|
19506
20141
|
return {
|
|
19507
20142
|
total: filteredInvoices.reduce((sum, inv) => sum + inv.amount, 0),
|
|
19508
20143
|
paid: filteredInvoices.filter((inv) => inv.status === "paid").reduce((sum, inv) => sum + inv.amount, 0),
|
|
@@ -19726,16 +20361,16 @@ function InvoicePaymentPage({
|
|
|
19726
20361
|
showStripeBranding = true,
|
|
19727
20362
|
className = ""
|
|
19728
20363
|
}) {
|
|
19729
|
-
const [paymentMethod, setPaymentMethod] =
|
|
20364
|
+
const [paymentMethod, setPaymentMethod] = React49.useState(
|
|
19730
20365
|
acceptedMethods[0] || "card"
|
|
19731
20366
|
);
|
|
19732
|
-
const [name, setName] =
|
|
19733
|
-
const [email, setEmail] =
|
|
19734
|
-
const [cardNumber, setCardNumber] =
|
|
19735
|
-
const [expiry, setExpiry] =
|
|
19736
|
-
const [cvc, setCvc] =
|
|
19737
|
-
const [routingNumber, setRoutingNumber] =
|
|
19738
|
-
const [accountNumber, setAccountNumber] =
|
|
20367
|
+
const [name, setName] = React49.useState("");
|
|
20368
|
+
const [email, setEmail] = React49.useState("");
|
|
20369
|
+
const [cardNumber, setCardNumber] = React49.useState("");
|
|
20370
|
+
const [expiry, setExpiry] = React49.useState("");
|
|
20371
|
+
const [cvc, setCvc] = React49.useState("");
|
|
20372
|
+
const [routingNumber, setRoutingNumber] = React49.useState("");
|
|
20373
|
+
const [accountNumber, setAccountNumber] = React49.useState("");
|
|
19739
20374
|
const formatCurrency3 = (amount) => {
|
|
19740
20375
|
return `${currency}${amount.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
19741
20376
|
};
|
|
@@ -20540,10 +21175,10 @@ function LanguageSelector({
|
|
|
20540
21175
|
disabled = false,
|
|
20541
21176
|
className
|
|
20542
21177
|
}) {
|
|
20543
|
-
const [isOpen, setIsOpen] =
|
|
20544
|
-
const containerRef =
|
|
21178
|
+
const [isOpen, setIsOpen] = React49.useState(false);
|
|
21179
|
+
const containerRef = React49.useRef(null);
|
|
20545
21180
|
const selectedLanguage = languages.find((l) => l.code === value);
|
|
20546
|
-
|
|
21181
|
+
React49.useEffect(() => {
|
|
20547
21182
|
const handleClickOutside = (e) => {
|
|
20548
21183
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
20549
21184
|
setIsOpen(false);
|
|
@@ -20552,7 +21187,7 @@ function LanguageSelector({
|
|
|
20552
21187
|
document.addEventListener("mousedown", handleClickOutside);
|
|
20553
21188
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
20554
21189
|
}, []);
|
|
20555
|
-
|
|
21190
|
+
React49.useEffect(() => {
|
|
20556
21191
|
const handleEscape = (e) => {
|
|
20557
21192
|
if (e.key === "Escape") setIsOpen(false);
|
|
20558
21193
|
};
|
|
@@ -21084,7 +21719,7 @@ function formatLastSeen(date) {
|
|
|
21084
21719
|
if (diffDays < 7) return `${diffDays}d ago`;
|
|
21085
21720
|
return date.toLocaleDateString();
|
|
21086
21721
|
}
|
|
21087
|
-
var ConversationHeader =
|
|
21722
|
+
var ConversationHeader = React49.forwardRef(
|
|
21088
21723
|
({
|
|
21089
21724
|
className,
|
|
21090
21725
|
size,
|
|
@@ -21206,7 +21841,7 @@ var ConversationHeader = React48.forwardRef(
|
|
|
21206
21841
|
}
|
|
21207
21842
|
);
|
|
21208
21843
|
ConversationHeader.displayName = "ConversationHeader";
|
|
21209
|
-
var ConversationListItem =
|
|
21844
|
+
var ConversationListItem = React49.forwardRef(({ className, conversation, isSelected, onSelect, ...props }, ref) => {
|
|
21210
21845
|
const participant = conversation.participants.find((p) => !p.isCurrentUser);
|
|
21211
21846
|
const title = getConversationTitle(conversation, participant);
|
|
21212
21847
|
const avatarUrl = conversation.avatarUrl || participant?.avatarUrl;
|
|
@@ -21414,7 +22049,7 @@ function ConversationListSkeleton({
|
|
|
21414
22049
|
}
|
|
21415
22050
|
ConversationListSkeleton.displayName = "ConversationListSkeleton";
|
|
21416
22051
|
function LightboxModal({ attachment, onClose }) {
|
|
21417
|
-
|
|
22052
|
+
React49.useEffect(() => {
|
|
21418
22053
|
const handleKeyDown = (event) => {
|
|
21419
22054
|
if (event.key === "Escape") {
|
|
21420
22055
|
onClose();
|
|
@@ -21511,7 +22146,7 @@ function LightboxModal({ attachment, onClose }) {
|
|
|
21511
22146
|
);
|
|
21512
22147
|
}
|
|
21513
22148
|
LightboxModal.displayName = "LightboxModal";
|
|
21514
|
-
var MessageThread =
|
|
22149
|
+
var MessageThread = React49.forwardRef(
|
|
21515
22150
|
({
|
|
21516
22151
|
conversation,
|
|
21517
22152
|
messages,
|
|
@@ -21542,8 +22177,8 @@ var MessageThread = React48.forwardRef(
|
|
|
21542
22177
|
onError,
|
|
21543
22178
|
className
|
|
21544
22179
|
}, ref) => {
|
|
21545
|
-
const [lightboxAttachment, setLightboxAttachment] =
|
|
21546
|
-
const [replyTo, setReplyTo] =
|
|
22180
|
+
const [lightboxAttachment, setLightboxAttachment] = React49.useState(null);
|
|
22181
|
+
const [replyTo, setReplyTo] = React49.useState(null);
|
|
21547
22182
|
const participant = conversation?.type === "direct" ? conversation.participants.find((p) => p.id !== currentUser.id) : void 0;
|
|
21548
22183
|
const handleAttachmentClick = (attachment, message) => {
|
|
21549
22184
|
if (attachment.type === "image" || attachment.type === "video") {
|
|
@@ -21715,13 +22350,13 @@ function useMessages(options) {
|
|
|
21715
22350
|
onRetry,
|
|
21716
22351
|
onLoadMore
|
|
21717
22352
|
} = options;
|
|
21718
|
-
const [messages, setMessages] =
|
|
21719
|
-
const [isSending, setIsSending] =
|
|
21720
|
-
const [isLoadingMore, setIsLoadingMore] =
|
|
21721
|
-
|
|
22353
|
+
const [messages, setMessages] = React49.useState(initialMessages);
|
|
22354
|
+
const [isSending, setIsSending] = React49.useState(false);
|
|
22355
|
+
const [isLoadingMore, setIsLoadingMore] = React49.useState(false);
|
|
22356
|
+
React49.useEffect(() => {
|
|
21722
22357
|
setMessages(initialMessages);
|
|
21723
22358
|
}, [initialMessages]);
|
|
21724
|
-
const addMessage =
|
|
22359
|
+
const addMessage = React49.useCallback((message) => {
|
|
21725
22360
|
setMessages((prev) => {
|
|
21726
22361
|
if (prev.some((m) => m.id === message.id)) {
|
|
21727
22362
|
return prev;
|
|
@@ -21729,7 +22364,7 @@ function useMessages(options) {
|
|
|
21729
22364
|
return [...prev, message];
|
|
21730
22365
|
});
|
|
21731
22366
|
}, []);
|
|
21732
|
-
const updateMessage =
|
|
22367
|
+
const updateMessage = React49.useCallback(
|
|
21733
22368
|
(messageId, updates) => {
|
|
21734
22369
|
setMessages(
|
|
21735
22370
|
(prev) => prev.map((m) => m.id === messageId ? { ...m, ...updates } : m)
|
|
@@ -21737,22 +22372,22 @@ function useMessages(options) {
|
|
|
21737
22372
|
},
|
|
21738
22373
|
[]
|
|
21739
22374
|
);
|
|
21740
|
-
const removeMessage =
|
|
22375
|
+
const removeMessage = React49.useCallback((messageId) => {
|
|
21741
22376
|
setMessages((prev) => prev.filter((m) => m.id !== messageId));
|
|
21742
22377
|
}, []);
|
|
21743
|
-
const updateStatus =
|
|
22378
|
+
const updateStatus = React49.useCallback(
|
|
21744
22379
|
(messageId, status) => {
|
|
21745
22380
|
updateMessage(messageId, { status });
|
|
21746
22381
|
},
|
|
21747
22382
|
[updateMessage]
|
|
21748
22383
|
);
|
|
21749
|
-
const markAsRead =
|
|
22384
|
+
const markAsRead = React49.useCallback(
|
|
21750
22385
|
(messageId) => {
|
|
21751
22386
|
updateStatus(messageId, "read");
|
|
21752
22387
|
},
|
|
21753
22388
|
[updateStatus]
|
|
21754
22389
|
);
|
|
21755
|
-
const sendMessage =
|
|
22390
|
+
const sendMessage = React49.useCallback(
|
|
21756
22391
|
async (newMessage) => {
|
|
21757
22392
|
const optimisticId = `optimistic-${Date.now()}`;
|
|
21758
22393
|
const optimisticMessage = {
|
|
@@ -21784,7 +22419,7 @@ function useMessages(options) {
|
|
|
21784
22419
|
},
|
|
21785
22420
|
[currentUser, onSend, addMessage, updateStatus]
|
|
21786
22421
|
);
|
|
21787
|
-
const retryMessage =
|
|
22422
|
+
const retryMessage = React49.useCallback(
|
|
21788
22423
|
async (messageId) => {
|
|
21789
22424
|
updateStatus(messageId, "sending");
|
|
21790
22425
|
try {
|
|
@@ -21798,7 +22433,7 @@ function useMessages(options) {
|
|
|
21798
22433
|
},
|
|
21799
22434
|
[onRetry, updateStatus]
|
|
21800
22435
|
);
|
|
21801
|
-
const loadMore =
|
|
22436
|
+
const loadMore = React49.useCallback(async () => {
|
|
21802
22437
|
if (isLoadingMore || !onLoadMore) return;
|
|
21803
22438
|
setIsLoadingMore(true);
|
|
21804
22439
|
try {
|
|
@@ -21829,13 +22464,13 @@ function useTypingIndicator(options = {}) {
|
|
|
21829
22464
|
onTypingStart,
|
|
21830
22465
|
onTypingStop
|
|
21831
22466
|
} = options;
|
|
21832
|
-
const [participants, setParticipants] =
|
|
21833
|
-
const [isLocalTyping, setIsLocalTyping] =
|
|
21834
|
-
const typingTimeoutRef =
|
|
21835
|
-
|
|
22467
|
+
const [participants, setParticipants] = React49.useState(initialParticipants);
|
|
22468
|
+
const [isLocalTyping, setIsLocalTyping] = React49.useState(false);
|
|
22469
|
+
const typingTimeoutRef = React49.useRef(null);
|
|
22470
|
+
React49.useEffect(() => {
|
|
21836
22471
|
setParticipants(initialParticipants);
|
|
21837
22472
|
}, [initialParticipants]);
|
|
21838
|
-
const startTyping =
|
|
22473
|
+
const startTyping = React49.useCallback(() => {
|
|
21839
22474
|
if (!isLocalTyping) {
|
|
21840
22475
|
setIsLocalTyping(true);
|
|
21841
22476
|
onTypingStart?.();
|
|
@@ -21848,21 +22483,21 @@ function useTypingIndicator(options = {}) {
|
|
|
21848
22483
|
onTypingStop?.();
|
|
21849
22484
|
}, debounceTime);
|
|
21850
22485
|
}, [isLocalTyping, debounceTime, onTypingStart, onTypingStop]);
|
|
21851
|
-
const stopTyping =
|
|
22486
|
+
const stopTyping = React49.useCallback(() => {
|
|
21852
22487
|
if (typingTimeoutRef.current) {
|
|
21853
22488
|
clearTimeout(typingTimeoutRef.current);
|
|
21854
22489
|
}
|
|
21855
22490
|
setIsLocalTyping(false);
|
|
21856
22491
|
onTypingStop?.();
|
|
21857
22492
|
}, [onTypingStop]);
|
|
21858
|
-
|
|
22493
|
+
React49.useEffect(() => {
|
|
21859
22494
|
return () => {
|
|
21860
22495
|
if (typingTimeoutRef.current) {
|
|
21861
22496
|
clearTimeout(typingTimeoutRef.current);
|
|
21862
22497
|
}
|
|
21863
22498
|
};
|
|
21864
22499
|
}, []);
|
|
21865
|
-
const typingState =
|
|
22500
|
+
const typingState = React49.useMemo(
|
|
21866
22501
|
() => ({
|
|
21867
22502
|
participants,
|
|
21868
22503
|
lastUpdated: /* @__PURE__ */ new Date()
|
|
@@ -21878,11 +22513,11 @@ function useTypingIndicator(options = {}) {
|
|
|
21878
22513
|
}
|
|
21879
22514
|
function useMessageScroll(options) {
|
|
21880
22515
|
const { messages, currentUserId, threshold = 100 } = options;
|
|
21881
|
-
const scrollContainerRef =
|
|
21882
|
-
const bottomRef =
|
|
21883
|
-
const [isScrolledUp, setIsScrolledUp] =
|
|
21884
|
-
const prevMessageCountRef =
|
|
21885
|
-
|
|
22516
|
+
const scrollContainerRef = React49.useRef(null);
|
|
22517
|
+
const bottomRef = React49.useRef(null);
|
|
22518
|
+
const [isScrolledUp, setIsScrolledUp] = React49.useState(false);
|
|
22519
|
+
const prevMessageCountRef = React49.useRef(messages.length);
|
|
22520
|
+
React49.useEffect(() => {
|
|
21886
22521
|
const container = scrollContainerRef.current;
|
|
21887
22522
|
if (!container) return;
|
|
21888
22523
|
const handleScroll = () => {
|
|
@@ -21893,12 +22528,12 @@ function useMessageScroll(options) {
|
|
|
21893
22528
|
container.addEventListener("scroll", handleScroll);
|
|
21894
22529
|
return () => container.removeEventListener("scroll", handleScroll);
|
|
21895
22530
|
}, [threshold]);
|
|
21896
|
-
const scrollToBottom =
|
|
22531
|
+
const scrollToBottom = React49.useCallback((smooth = true) => {
|
|
21897
22532
|
bottomRef.current?.scrollIntoView({
|
|
21898
22533
|
behavior: smooth ? "smooth" : "auto"
|
|
21899
22534
|
});
|
|
21900
22535
|
}, []);
|
|
21901
|
-
|
|
22536
|
+
React49.useEffect(() => {
|
|
21902
22537
|
const messageCountChanged = messages.length !== prevMessageCountRef.current;
|
|
21903
22538
|
prevMessageCountRef.current = messages.length;
|
|
21904
22539
|
if (!messageCountChanged) return;
|
|
@@ -21917,9 +22552,9 @@ function useMessageScroll(options) {
|
|
|
21917
22552
|
}
|
|
21918
22553
|
function useReadReceipts(options) {
|
|
21919
22554
|
const { currentUserId, onMarkRead, threshold = 0.5 } = options;
|
|
21920
|
-
const observerRef =
|
|
21921
|
-
const observedMessagesRef =
|
|
21922
|
-
|
|
22555
|
+
const observerRef = React49.useRef(null);
|
|
22556
|
+
const observedMessagesRef = React49.useRef(/* @__PURE__ */ new Set());
|
|
22557
|
+
React49.useEffect(() => {
|
|
21923
22558
|
observerRef.current = new IntersectionObserver(
|
|
21924
22559
|
(entries) => {
|
|
21925
22560
|
entries.forEach((entry) => {
|
|
@@ -21938,7 +22573,7 @@ function useReadReceipts(options) {
|
|
|
21938
22573
|
observerRef.current?.disconnect();
|
|
21939
22574
|
};
|
|
21940
22575
|
}, [onMarkRead, threshold]);
|
|
21941
|
-
const observeMessage =
|
|
22576
|
+
const observeMessage = React49.useCallback(
|
|
21942
22577
|
(element, message) => {
|
|
21943
22578
|
if (!element || !observerRef.current) return;
|
|
21944
22579
|
if (message.sender.id !== currentUserId && message.status !== "read" && !observedMessagesRef.current.has(message.id)) {
|
|
@@ -22893,13 +23528,13 @@ function OrderConfirmationWizard({
|
|
|
22893
23528
|
stepTitles = ["Verify Employee", "Consent & ID", "Confirmation"],
|
|
22894
23529
|
className = ""
|
|
22895
23530
|
}) {
|
|
22896
|
-
const [step, setStep] =
|
|
22897
|
-
const [employeeVerified, setEmployeeVerified] =
|
|
22898
|
-
const [verificationNotes, setVerificationNotes] =
|
|
22899
|
-
const [consentObtained, setConsentObtained] =
|
|
22900
|
-
const [idVerified, setIdVerified] =
|
|
22901
|
-
const [idType, setIdType] =
|
|
22902
|
-
const [confirmationNotes, setConfirmationNotes] =
|
|
23531
|
+
const [step, setStep] = React49.useState(initialStep);
|
|
23532
|
+
const [employeeVerified, setEmployeeVerified] = React49.useState(false);
|
|
23533
|
+
const [verificationNotes, setVerificationNotes] = React49.useState("");
|
|
23534
|
+
const [consentObtained, setConsentObtained] = React49.useState(false);
|
|
23535
|
+
const [idVerified, setIdVerified] = React49.useState(false);
|
|
23536
|
+
const [idType, setIdType] = React49.useState("");
|
|
23537
|
+
const [confirmationNotes, setConfirmationNotes] = React49.useState("");
|
|
22903
23538
|
const handleStepChange = (newStep) => {
|
|
22904
23539
|
setStep(newStep);
|
|
22905
23540
|
onStepChange?.(newStep);
|
|
@@ -22927,7 +23562,7 @@ function OrderConfirmationWizard({
|
|
|
22927
23562
|
const stepNum = index + 1;
|
|
22928
23563
|
const isActive = step === stepNum;
|
|
22929
23564
|
const isComplete = step > stepNum;
|
|
22930
|
-
return /* @__PURE__ */ jsxs(
|
|
23565
|
+
return /* @__PURE__ */ jsxs(React49.Fragment, { children: [
|
|
22931
23566
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
22932
23567
|
/* @__PURE__ */ jsx(
|
|
22933
23568
|
"div",
|
|
@@ -23512,7 +24147,7 @@ function OrderList({
|
|
|
23512
24147
|
actions,
|
|
23513
24148
|
className
|
|
23514
24149
|
}) {
|
|
23515
|
-
const filteredOrders =
|
|
24150
|
+
const filteredOrders = React49.useMemo(() => {
|
|
23516
24151
|
const activeTabConfig = tabs.find((t) => t.id === activeTab);
|
|
23517
24152
|
if (!activeTabConfig?.statuses || !getOrderStatus) {
|
|
23518
24153
|
return orders;
|
|
@@ -23521,7 +24156,7 @@ function OrderList({
|
|
|
23521
24156
|
(order) => activeTabConfig.statuses.includes(getOrderStatus(order))
|
|
23522
24157
|
);
|
|
23523
24158
|
}, [orders, activeTab, tabs, getOrderStatus]);
|
|
23524
|
-
const tabCounts =
|
|
24159
|
+
const tabCounts = React49.useMemo(() => {
|
|
23525
24160
|
if (!getOrderStatus) return {};
|
|
23526
24161
|
const counts = {};
|
|
23527
24162
|
tabs.forEach((tab) => {
|
|
@@ -23745,7 +24380,7 @@ function OrderLookupForm({
|
|
|
23745
24380
|
welcomeMessage = "Look up your order by entering the information below.",
|
|
23746
24381
|
className = ""
|
|
23747
24382
|
}) {
|
|
23748
|
-
const [formData, setFormData] =
|
|
24383
|
+
const [formData, setFormData] = React49.useState({
|
|
23749
24384
|
orderNumber: "",
|
|
23750
24385
|
dateOfBirth: "",
|
|
23751
24386
|
lastName: ""
|
|
@@ -24279,14 +24914,14 @@ function OverflowMenuItem({
|
|
|
24279
24914
|
function PatientOverflowMenu({
|
|
24280
24915
|
onAction
|
|
24281
24916
|
}) {
|
|
24282
|
-
const [open, setOpen] =
|
|
24283
|
-
const menuRef =
|
|
24917
|
+
const [open, setOpen] = React49.useState(false);
|
|
24918
|
+
const menuRef = React49.useRef(null);
|
|
24284
24919
|
useClickOutside(
|
|
24285
24920
|
menuRef,
|
|
24286
|
-
|
|
24921
|
+
React49.useCallback(() => setOpen(false), [])
|
|
24287
24922
|
);
|
|
24288
24923
|
useEscapeKey(
|
|
24289
|
-
|
|
24924
|
+
React49.useCallback(() => setOpen(false), []),
|
|
24290
24925
|
open
|
|
24291
24926
|
);
|
|
24292
24927
|
const handleAction = (action) => {
|
|
@@ -24471,7 +25106,7 @@ function AlertRow({ comments }) {
|
|
|
24471
25106
|
/* @__PURE__ */ jsx("span", { className: "text-foreground text-sm", children: comments.join("; ") })
|
|
24472
25107
|
] });
|
|
24473
25108
|
}
|
|
24474
|
-
var PatientHeader =
|
|
25109
|
+
var PatientHeader = React49.forwardRef(
|
|
24475
25110
|
({
|
|
24476
25111
|
patient,
|
|
24477
25112
|
allergies = [],
|
|
@@ -24500,13 +25135,13 @@ var PatientHeader = React48.forwardRef(
|
|
|
24500
25135
|
const hasComments = showCommentsBanner && comments.length > 0;
|
|
24501
25136
|
const hasProviders = showProviderBanner && !!(patient.attendingProvider || patient.familyProvider);
|
|
24502
25137
|
const hasInfoRows = hasAllergies || hasMedications || hasComments || hasProviders;
|
|
24503
|
-
const [addModalType, setAddModalType] =
|
|
24504
|
-
const [addForm, setAddForm] =
|
|
25138
|
+
const [addModalType, setAddModalType] = React49.useState(null);
|
|
25139
|
+
const [addForm, setAddForm] = React49.useState({});
|
|
24505
25140
|
const addEntityLabel = addModalType ? ADD_ENTITY_LABELS[addModalType] ?? "" : "";
|
|
24506
|
-
const [contactModalOpen, setContactModalOpen] =
|
|
24507
|
-
const [editPatientOpen, setEditPatientOpen] =
|
|
24508
|
-
const [editPatientForm, setEditPatientForm] =
|
|
24509
|
-
const handleOverflowAction =
|
|
25141
|
+
const [contactModalOpen, setContactModalOpen] = React49.useState(false);
|
|
25142
|
+
const [editPatientOpen, setEditPatientOpen] = React49.useState(false);
|
|
25143
|
+
const [editPatientForm, setEditPatientForm] = React49.useState({});
|
|
25144
|
+
const handleOverflowAction = React49.useCallback(
|
|
24510
25145
|
(action) => {
|
|
24511
25146
|
if (action === "contact") {
|
|
24512
25147
|
setContactModalOpen(true);
|
|
@@ -25987,7 +26622,7 @@ function PermissionItem({
|
|
|
25987
26622
|
parentChecked
|
|
25988
26623
|
}) {
|
|
25989
26624
|
const hasChildren = permission.children && permission.children.length > 0;
|
|
25990
|
-
const [isExpanded, setIsExpanded] =
|
|
26625
|
+
const [isExpanded, setIsExpanded] = React49.useState(true);
|
|
25991
26626
|
const handleChange = (checked) => {
|
|
25992
26627
|
onToggle(permission.id, checked);
|
|
25993
26628
|
if (!checked && hasChildren) {
|
|
@@ -26069,12 +26704,12 @@ function PermissionsEditor({
|
|
|
26069
26704
|
summary = "Summary",
|
|
26070
26705
|
all = "All"
|
|
26071
26706
|
} = labels;
|
|
26072
|
-
const [expandedGroups, setExpandedGroups] =
|
|
26707
|
+
const [expandedGroups, setExpandedGroups] = React49.useState(
|
|
26073
26708
|
() => new Set(
|
|
26074
26709
|
groups.filter((g) => g.defaultExpanded !== false).map((g) => g.id)
|
|
26075
26710
|
)
|
|
26076
26711
|
);
|
|
26077
|
-
const permissionMap =
|
|
26712
|
+
const permissionMap = React49.useMemo(() => {
|
|
26078
26713
|
const map = /* @__PURE__ */ new Map();
|
|
26079
26714
|
const processPermissions = (permissions) => {
|
|
26080
26715
|
permissions.forEach((perm) => {
|
|
@@ -26118,7 +26753,7 @@ function PermissionsEditor({
|
|
|
26118
26753
|
onEmployersChange([...selectedEmployers, employerId]);
|
|
26119
26754
|
}
|
|
26120
26755
|
};
|
|
26121
|
-
const assignedPermissionNames =
|
|
26756
|
+
const assignedPermissionNames = React49.useMemo(() => {
|
|
26122
26757
|
return assignedPermissions.map((id) => permissionMap.get(id)?.name).filter(Boolean);
|
|
26123
26758
|
}, [assignedPermissions, permissionMap]);
|
|
26124
26759
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-6", className), "data-slot": "perm-editor", children: [
|
|
@@ -26535,7 +27170,7 @@ var logoContainerVariants = cva(
|
|
|
26535
27170
|
}
|
|
26536
27171
|
);
|
|
26537
27172
|
var ProviderLogo = ({ logoURL, name, variant }) => {
|
|
26538
|
-
const [hasError, setHasError] =
|
|
27173
|
+
const [hasError, setHasError] = React49.useState(false);
|
|
26539
27174
|
if (!logoURL || hasError) {
|
|
26540
27175
|
return /* @__PURE__ */ jsx(
|
|
26541
27176
|
"div",
|
|
@@ -26670,7 +27305,7 @@ function formatAddressSingleLine2(address) {
|
|
|
26670
27305
|
parts.push(`${address.city}, ${address.state} ${address.postalCode}`);
|
|
26671
27306
|
return parts.join(", ");
|
|
26672
27307
|
}
|
|
26673
|
-
var ProviderCard =
|
|
27308
|
+
var ProviderCard = React49.forwardRef(
|
|
26674
27309
|
({
|
|
26675
27310
|
provider,
|
|
26676
27311
|
variant = "compact",
|
|
@@ -27155,7 +27790,7 @@ function ProviderLogo2({
|
|
|
27155
27790
|
size = "md",
|
|
27156
27791
|
className
|
|
27157
27792
|
}) {
|
|
27158
|
-
const [hasError, setHasError] =
|
|
27793
|
+
const [hasError, setHasError] = React49.useState(false);
|
|
27159
27794
|
const initials = name.split(" ").map((word) => word[0]).join("").toUpperCase().slice(0, 2);
|
|
27160
27795
|
if (!src || hasError) {
|
|
27161
27796
|
return /* @__PURE__ */ jsx(
|
|
@@ -27593,7 +28228,7 @@ function ProviderDetailHeaderSkeleton({
|
|
|
27593
28228
|
/* @__PURE__ */ jsx("div", { className: "h-3 w-12 rounded bg-gray-200 dark:bg-gray-700" })
|
|
27594
28229
|
] }, i)) }),
|
|
27595
28230
|
/* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-6", children: [
|
|
27596
|
-
/* @__PURE__ */ jsx("div", { className: "mb-4 hidden items-center gap-2 sm:flex", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsxs(
|
|
28231
|
+
/* @__PURE__ */ jsx("div", { className: "mb-4 hidden items-center gap-2 sm:flex", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsxs(React49.Fragment, { children: [
|
|
27597
28232
|
i > 1 && /* @__PURE__ */ jsx("div", { className: "h-4 w-4 rounded-full bg-gray-200 dark:bg-gray-700" }),
|
|
27598
28233
|
/* @__PURE__ */ jsx("div", { className: "h-4 w-16 rounded bg-gray-200 dark:bg-gray-700" })
|
|
27599
28234
|
] }, i)) }),
|
|
@@ -28519,7 +29154,7 @@ var SearchResultsMessage = ({
|
|
|
28519
29154
|
}
|
|
28520
29155
|
);
|
|
28521
29156
|
};
|
|
28522
|
-
var ProviderSearchBar =
|
|
29157
|
+
var ProviderSearchBar = React49.forwardRef(
|
|
28523
29158
|
({
|
|
28524
29159
|
onSearch,
|
|
28525
29160
|
onGeolocate,
|
|
@@ -28540,10 +29175,10 @@ var ProviderSearchBar = React48.forwardRef(
|
|
|
28540
29175
|
className,
|
|
28541
29176
|
...props
|
|
28542
29177
|
}, ref) => {
|
|
28543
|
-
const [internalValue, setInternalValue] =
|
|
29178
|
+
const [internalValue, setInternalValue] = React49.useState(
|
|
28544
29179
|
defaultValue || ""
|
|
28545
29180
|
);
|
|
28546
|
-
const [validationError, setValidationError] =
|
|
29181
|
+
const [validationError, setValidationError] = React49.useState(
|
|
28547
29182
|
null
|
|
28548
29183
|
);
|
|
28549
29184
|
const zipValue = value ?? internalValue;
|
|
@@ -28824,7 +29459,7 @@ function XMarkIcon({ className }) {
|
|
|
28824
29459
|
);
|
|
28825
29460
|
}
|
|
28826
29461
|
function InputField({ label, icon, className, id, ...props }) {
|
|
28827
|
-
const generatedId =
|
|
29462
|
+
const generatedId = React49.useId();
|
|
28828
29463
|
const inputId = id || generatedId;
|
|
28829
29464
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
28830
29465
|
label && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: labelVariants2(), children: label }),
|
|
@@ -28848,7 +29483,7 @@ function SelectField({
|
|
|
28848
29483
|
id,
|
|
28849
29484
|
...props
|
|
28850
29485
|
}) {
|
|
28851
|
-
const generatedId =
|
|
29486
|
+
const generatedId = React49.useId();
|
|
28852
29487
|
const selectId = id || generatedId;
|
|
28853
29488
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
28854
29489
|
label && /* @__PURE__ */ jsx("label", { htmlFor: selectId, className: labelVariants2(), children: label }),
|
|
@@ -28901,12 +29536,12 @@ function ServiceMultiSelect({
|
|
|
28901
29536
|
disabled = false,
|
|
28902
29537
|
showCounts = false
|
|
28903
29538
|
}) {
|
|
28904
|
-
const [isOpen, setIsOpen] =
|
|
28905
|
-
const [searchTerm, setSearchTerm] =
|
|
28906
|
-
const containerRef =
|
|
28907
|
-
const inputRef =
|
|
28908
|
-
const listboxId =
|
|
28909
|
-
|
|
29539
|
+
const [isOpen, setIsOpen] = React49.useState(false);
|
|
29540
|
+
const [searchTerm, setSearchTerm] = React49.useState("");
|
|
29541
|
+
const containerRef = React49.useRef(null);
|
|
29542
|
+
const inputRef = React49.useRef(null);
|
|
29543
|
+
const listboxId = React49.useId();
|
|
29544
|
+
React49.useEffect(() => {
|
|
28910
29545
|
function handleClickOutside(event) {
|
|
28911
29546
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
28912
29547
|
setIsOpen(false);
|
|
@@ -28915,14 +29550,14 @@ function ServiceMultiSelect({
|
|
|
28915
29550
|
document.addEventListener("mousedown", handleClickOutside);
|
|
28916
29551
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
28917
29552
|
}, []);
|
|
28918
|
-
const filteredServices =
|
|
29553
|
+
const filteredServices = React49.useMemo(() => {
|
|
28919
29554
|
if (!searchTerm) return services;
|
|
28920
29555
|
const lowerSearch = searchTerm.toLowerCase();
|
|
28921
29556
|
return services.filter(
|
|
28922
29557
|
(service) => service.label.toLowerCase().includes(lowerSearch) || service.category?.toLowerCase().includes(lowerSearch)
|
|
28923
29558
|
);
|
|
28924
29559
|
}, [services, searchTerm]);
|
|
28925
|
-
const groupedServices =
|
|
29560
|
+
const groupedServices = React49.useMemo(() => {
|
|
28926
29561
|
const groups = {};
|
|
28927
29562
|
filteredServices.forEach((service) => {
|
|
28928
29563
|
const category = service.category || "Other";
|
|
@@ -28931,7 +29566,7 @@ function ServiceMultiSelect({
|
|
|
28931
29566
|
});
|
|
28932
29567
|
return groups;
|
|
28933
29568
|
}, [filteredServices]);
|
|
28934
|
-
const selectedServiceObjects =
|
|
29569
|
+
const selectedServiceObjects = React49.useMemo(
|
|
28935
29570
|
() => services.filter((s) => selectedServices.includes(s.value)),
|
|
28936
29571
|
[services, selectedServices]
|
|
28937
29572
|
);
|
|
@@ -29437,10 +30072,10 @@ function ProviderSelector({
|
|
|
29437
30072
|
size = "md",
|
|
29438
30073
|
className
|
|
29439
30074
|
}) {
|
|
29440
|
-
const [isOpen, setIsOpen] =
|
|
29441
|
-
const [searchQuery, setSearchQuery] =
|
|
29442
|
-
const containerRef =
|
|
29443
|
-
|
|
30075
|
+
const [isOpen, setIsOpen] = React49.useState(false);
|
|
30076
|
+
const [searchQuery, setSearchQuery] = React49.useState("");
|
|
30077
|
+
const containerRef = React49.useRef(null);
|
|
30078
|
+
React49.useEffect(() => {
|
|
29444
30079
|
function handleClickOutside(event) {
|
|
29445
30080
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
29446
30081
|
setIsOpen(false);
|
|
@@ -29449,7 +30084,7 @@ function ProviderSelector({
|
|
|
29449
30084
|
document.addEventListener("mousedown", handleClickOutside);
|
|
29450
30085
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
29451
30086
|
}, []);
|
|
29452
|
-
|
|
30087
|
+
React49.useEffect(() => {
|
|
29453
30088
|
function handleEscape(event) {
|
|
29454
30089
|
if (event.key === "Escape") {
|
|
29455
30090
|
setIsOpen(false);
|
|
@@ -29458,12 +30093,12 @@ function ProviderSelector({
|
|
|
29458
30093
|
document.addEventListener("keydown", handleEscape);
|
|
29459
30094
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
29460
30095
|
}, []);
|
|
29461
|
-
|
|
30096
|
+
React49.useEffect(() => {
|
|
29462
30097
|
if (!isOpen) {
|
|
29463
30098
|
setSearchQuery("");
|
|
29464
30099
|
}
|
|
29465
30100
|
}, [isOpen]);
|
|
29466
|
-
const filteredProviders =
|
|
30101
|
+
const filteredProviders = React49.useMemo(() => {
|
|
29467
30102
|
if (!searchQuery) return providers;
|
|
29468
30103
|
const query = searchQuery.toLowerCase();
|
|
29469
30104
|
return providers.filter(
|
|
@@ -29753,9 +30388,9 @@ function ProviderSettings({
|
|
|
29753
30388
|
defaultTab = "general",
|
|
29754
30389
|
className = ""
|
|
29755
30390
|
}) {
|
|
29756
|
-
const [settings, setSettings] =
|
|
29757
|
-
const [hasChanges, setHasChanges] =
|
|
29758
|
-
|
|
30391
|
+
const [settings, setSettings] = React49.useState(initialSettings);
|
|
30392
|
+
const [hasChanges, setHasChanges] = React49.useState(false);
|
|
30393
|
+
React49.useEffect(() => {
|
|
29759
30394
|
setSettings(initialSettings);
|
|
29760
30395
|
setHasChanges(false);
|
|
29761
30396
|
}, [initialSettings]);
|
|
@@ -30987,11 +31622,11 @@ function RecurringServiceSetupModal({
|
|
|
30987
31622
|
cancel = "Cancel",
|
|
30988
31623
|
save = "Save"
|
|
30989
31624
|
} = labels;
|
|
30990
|
-
const instanceId =
|
|
31625
|
+
const instanceId = React49.useId();
|
|
30991
31626
|
const providerSelectId = `${instanceId}-provider`;
|
|
30992
31627
|
const serviceSelectId = `${instanceId}-service`;
|
|
30993
31628
|
const occurrenceSelectId = `${instanceId}-occurrence`;
|
|
30994
|
-
const [formData, setFormData] =
|
|
31629
|
+
const [formData, setFormData] = React49.useState(
|
|
30995
31630
|
initialData || {
|
|
30996
31631
|
providerId: "",
|
|
30997
31632
|
serviceId: "",
|
|
@@ -30999,7 +31634,7 @@ function RecurringServiceSetupModal({
|
|
|
30999
31634
|
overrideConsent: false
|
|
31000
31635
|
}
|
|
31001
31636
|
);
|
|
31002
|
-
|
|
31637
|
+
React49.useEffect(() => {
|
|
31003
31638
|
if (initialData) {
|
|
31004
31639
|
setFormData(initialData);
|
|
31005
31640
|
} else {
|
|
@@ -31212,9 +31847,9 @@ function RejectionModal({
|
|
|
31212
31847
|
isSubmitting = false,
|
|
31213
31848
|
variant = "danger"
|
|
31214
31849
|
}) {
|
|
31215
|
-
const [selectedReasonId, setSelectedReasonId] =
|
|
31216
|
-
const [details, setDetails] =
|
|
31217
|
-
|
|
31850
|
+
const [selectedReasonId, setSelectedReasonId] = React49.useState("");
|
|
31851
|
+
const [details, setDetails] = React49.useState("");
|
|
31852
|
+
React49.useEffect(() => {
|
|
31218
31853
|
if (!open) {
|
|
31219
31854
|
setSelectedReasonId("");
|
|
31220
31855
|
setDetails("");
|
|
@@ -31671,7 +32306,7 @@ function ReportDashboard({
|
|
|
31671
32306
|
)
|
|
31672
32307
|
] });
|
|
31673
32308
|
}
|
|
31674
|
-
var ResultsEntryForm =
|
|
32309
|
+
var ResultsEntryForm = React49.forwardRef(function ResultsEntryForm2({
|
|
31675
32310
|
employeeFirstName,
|
|
31676
32311
|
employeeLastName,
|
|
31677
32312
|
initialData = {},
|
|
@@ -31699,30 +32334,30 @@ var ResultsEntryForm = React48.forwardRef(function ResultsEntryForm2({
|
|
|
31699
32334
|
addProviderContact = "Click here to add a provider contact",
|
|
31700
32335
|
pleaseSelectResult = "Please select a result"
|
|
31701
32336
|
} = labels;
|
|
31702
|
-
const [result, setResult] =
|
|
32337
|
+
const [result, setResult] = React49.useState(
|
|
31703
32338
|
initialData.result ?? null
|
|
31704
32339
|
);
|
|
31705
|
-
const [alternateText, setAlternateText] =
|
|
32340
|
+
const [alternateText, setAlternateText] = React49.useState(
|
|
31706
32341
|
initialData.alternateText ?? ""
|
|
31707
32342
|
);
|
|
31708
|
-
const [dateDrawnValue, setDateDrawnValue] =
|
|
32343
|
+
const [dateDrawnValue, setDateDrawnValue] = React49.useState(
|
|
31709
32344
|
initialData.dateDrawn ?? ""
|
|
31710
32345
|
);
|
|
31711
|
-
const [dateCompletedValue, setDateCompletedValue] =
|
|
32346
|
+
const [dateCompletedValue, setDateCompletedValue] = React49.useState(
|
|
31712
32347
|
initialData.dateCompleted ?? ""
|
|
31713
32348
|
);
|
|
31714
|
-
const [recommendations, setRecommendations] =
|
|
32349
|
+
const [recommendations, setRecommendations] = React49.useState(
|
|
31715
32350
|
initialData.recommendations ?? ""
|
|
31716
32351
|
);
|
|
31717
|
-
const [files, setFiles] =
|
|
31718
|
-
const [selectedContacts, setSelectedContacts] =
|
|
32352
|
+
const [files, setFiles] = React49.useState(initialData.files ?? []);
|
|
32353
|
+
const [selectedContacts, setSelectedContacts] = React49.useState(
|
|
31719
32354
|
initialData.providerContacts ?? []
|
|
31720
32355
|
);
|
|
31721
|
-
const [applyToAll, setApplyToAll] =
|
|
32356
|
+
const [applyToAll, setApplyToAll] = React49.useState(
|
|
31722
32357
|
initialData.applyToAllServices ?? false
|
|
31723
32358
|
);
|
|
31724
|
-
const [showError, setShowError] =
|
|
31725
|
-
const fileInputRef =
|
|
32359
|
+
const [showError, setShowError] = React49.useState(false);
|
|
32360
|
+
const fileInputRef = React49.useRef(null);
|
|
31726
32361
|
const handleFileSelect = (e) => {
|
|
31727
32362
|
const selectedFiles = Array.from(e.target.files || []);
|
|
31728
32363
|
setFiles((prev) => [...prev, ...selectedFiles]);
|
|
@@ -31738,7 +32373,7 @@ var ResultsEntryForm = React48.forwardRef(function ResultsEntryForm2({
|
|
|
31738
32373
|
(prev) => prev.includes(contactId) ? prev.filter((id) => id !== contactId) : [...prev, contactId]
|
|
31739
32374
|
);
|
|
31740
32375
|
};
|
|
31741
|
-
const validateAndSubmit =
|
|
32376
|
+
const validateAndSubmit = React49.useCallback(() => {
|
|
31742
32377
|
if (!result) {
|
|
31743
32378
|
setShowError(true);
|
|
31744
32379
|
return;
|
|
@@ -31765,7 +32400,7 @@ var ResultsEntryForm = React48.forwardRef(function ResultsEntryForm2({
|
|
|
31765
32400
|
applyToAll,
|
|
31766
32401
|
onSubmit
|
|
31767
32402
|
]);
|
|
31768
|
-
|
|
32403
|
+
React49.useImperativeHandle(
|
|
31769
32404
|
ref,
|
|
31770
32405
|
() => ({
|
|
31771
32406
|
submit: validateAndSubmit
|
|
@@ -32041,7 +32676,7 @@ function ResultsEntryModal({
|
|
|
32041
32676
|
...props
|
|
32042
32677
|
}) {
|
|
32043
32678
|
const { submit = "Submit", close = "Close" } = labels;
|
|
32044
|
-
const formRef =
|
|
32679
|
+
const formRef = React49.useRef(null);
|
|
32045
32680
|
const employeeName = employeeFirstName || employeeLastName ? `${employeeFirstName ?? ""} ${employeeLastName ?? ""}`.trim() : void 0;
|
|
32046
32681
|
const handleSubmitClick = () => {
|
|
32047
32682
|
formRef.current?.submit();
|
|
@@ -32171,7 +32806,7 @@ function ScheduleCalendar({
|
|
|
32171
32806
|
isLoading = false,
|
|
32172
32807
|
className = ""
|
|
32173
32808
|
}) {
|
|
32174
|
-
const [currentDate, setCurrentDate] =
|
|
32809
|
+
const [currentDate, setCurrentDate] = React49.useState(selectedDate);
|
|
32175
32810
|
const formatTime4 = (date) => {
|
|
32176
32811
|
const d = typeof date === "string" ? new Date(date) : date;
|
|
32177
32812
|
return d.toLocaleTimeString("en-US", {
|
|
@@ -32643,7 +33278,7 @@ function SubCategoryAccordion({
|
|
|
32643
33278
|
onServiceClick,
|
|
32644
33279
|
index
|
|
32645
33280
|
}) {
|
|
32646
|
-
const [isExpanded, setIsExpanded] =
|
|
33281
|
+
const [isExpanded, setIsExpanded] = React49.useState(
|
|
32647
33282
|
subCategory.defaultExpanded ?? false
|
|
32648
33283
|
);
|
|
32649
33284
|
const contentId = `sub-content-${index}`;
|
|
@@ -32710,7 +33345,7 @@ function CategoryAccordionItem({
|
|
|
32710
33345
|
onExpandChange
|
|
32711
33346
|
}) {
|
|
32712
33347
|
const isControlled = expandedCategories !== void 0;
|
|
32713
|
-
const [internalExpanded, setInternalExpanded] =
|
|
33348
|
+
const [internalExpanded, setInternalExpanded] = React49.useState(
|
|
32714
33349
|
category.defaultExpanded ?? false
|
|
32715
33350
|
);
|
|
32716
33351
|
const isExpanded = isControlled ? expandedCategories.includes(category.name) : internalExpanded;
|
|
@@ -32808,7 +33443,7 @@ function ServiceAccordion({
|
|
|
32808
33443
|
className,
|
|
32809
33444
|
"aria-label": ariaLabel = "Service categories"
|
|
32810
33445
|
}) {
|
|
32811
|
-
const [internalExpanded, setInternalExpanded] =
|
|
33446
|
+
const [internalExpanded, setInternalExpanded] = React49.useState([]);
|
|
32812
33447
|
const isControlled = controlledExpanded !== void 0;
|
|
32813
33448
|
const expanded = isControlled ? controlledExpanded : internalExpanded;
|
|
32814
33449
|
const handleExpandChange = (categoryName, isExpanded) => {
|
|
@@ -33100,7 +33735,7 @@ function ServiceBadgeGroup({
|
|
|
33100
33735
|
size = "md",
|
|
33101
33736
|
onShowMore
|
|
33102
33737
|
}) {
|
|
33103
|
-
const badges =
|
|
33738
|
+
const badges = React49.Children.toArray(children);
|
|
33104
33739
|
const visibleBadges = maxVisible ? badges.slice(0, maxVisible) : badges;
|
|
33105
33740
|
const hiddenCount = maxVisible ? badges.length - maxVisible : 0;
|
|
33106
33741
|
return /* @__PURE__ */ jsxs(
|
|
@@ -33953,15 +34588,15 @@ function ServicePicker({
|
|
|
33953
34588
|
fullWidth = false,
|
|
33954
34589
|
className
|
|
33955
34590
|
}) {
|
|
33956
|
-
const [searchQuery, setSearchQuery] =
|
|
33957
|
-
const [expandedGroups, setExpandedGroups] =
|
|
34591
|
+
const [searchQuery, setSearchQuery] = React49.useState("");
|
|
34592
|
+
const [expandedGroups, setExpandedGroups] = React49.useState(
|
|
33958
34593
|
/* @__PURE__ */ new Set()
|
|
33959
34594
|
);
|
|
33960
|
-
const filteredGroups =
|
|
34595
|
+
const filteredGroups = React49.useMemo(
|
|
33961
34596
|
() => filterServices(groups, searchQuery),
|
|
33962
34597
|
[groups, searchQuery]
|
|
33963
34598
|
);
|
|
33964
|
-
const searchResults =
|
|
34599
|
+
const searchResults = React49.useMemo(
|
|
33965
34600
|
() => searchQuery ? flattenServices(filteredGroups) : [],
|
|
33966
34601
|
[filteredGroups, searchQuery]
|
|
33967
34602
|
);
|
|
@@ -34410,16 +35045,16 @@ function ServicePricingManager({
|
|
|
34410
35045
|
categories: _categories = [],
|
|
34411
35046
|
className = ""
|
|
34412
35047
|
}) {
|
|
34413
|
-
const [searchTerm, setSearchTerm] =
|
|
34414
|
-
const [selectedCategory, setSelectedCategory] =
|
|
35048
|
+
const [searchTerm, setSearchTerm] = React49.useState("");
|
|
35049
|
+
const [selectedCategory, setSelectedCategory] = React49.useState(
|
|
34415
35050
|
null
|
|
34416
35051
|
);
|
|
34417
|
-
const [editingService, setEditingService] =
|
|
34418
|
-
const [editPrice, setEditPrice] =
|
|
34419
|
-
const [editEmployerPrice, setEditEmployerPrice] =
|
|
34420
|
-
const [showBulkModal, setShowBulkModal] =
|
|
34421
|
-
const [bulkAdjustment, setBulkAdjustment] =
|
|
34422
|
-
const [bulkAdjustmentType, setBulkAdjustmentType] =
|
|
35052
|
+
const [editingService, setEditingService] = React49.useState(null);
|
|
35053
|
+
const [editPrice, setEditPrice] = React49.useState("");
|
|
35054
|
+
const [editEmployerPrice, setEditEmployerPrice] = React49.useState("");
|
|
35055
|
+
const [showBulkModal, setShowBulkModal] = React49.useState(false);
|
|
35056
|
+
const [bulkAdjustment, setBulkAdjustment] = React49.useState("");
|
|
35057
|
+
const [bulkAdjustmentType, setBulkAdjustmentType] = React49.useState("percent");
|
|
34423
35058
|
const formatCurrency3 = (amount) => {
|
|
34424
35059
|
return new Intl.NumberFormat("en-US", {
|
|
34425
35060
|
style: "currency",
|
|
@@ -34810,7 +35445,7 @@ function ServiceShippingSettings({
|
|
|
34810
35445
|
isSaving = false,
|
|
34811
35446
|
className = ""
|
|
34812
35447
|
}) {
|
|
34813
|
-
const [address, setAddress] =
|
|
35448
|
+
const [address, setAddress] = React49.useState(
|
|
34814
35449
|
defaultAddress || {
|
|
34815
35450
|
name: "",
|
|
34816
35451
|
street1: "",
|
|
@@ -35012,7 +35647,7 @@ function SetupServiceModal({
|
|
|
35012
35647
|
errorMessage,
|
|
35013
35648
|
title = "Add New Service"
|
|
35014
35649
|
}) {
|
|
35015
|
-
const [formData, setFormData] =
|
|
35650
|
+
const [formData, setFormData] = React49.useState({
|
|
35016
35651
|
name: "",
|
|
35017
35652
|
description: "",
|
|
35018
35653
|
price: 0,
|
|
@@ -35022,7 +35657,7 @@ function SetupServiceModal({
|
|
|
35022
35657
|
initialInventory: void 0,
|
|
35023
35658
|
autoAcceptReferrals: false
|
|
35024
35659
|
});
|
|
35025
|
-
|
|
35660
|
+
React49.useEffect(() => {
|
|
35026
35661
|
if (!open) {
|
|
35027
35662
|
setFormData({
|
|
35028
35663
|
name: "",
|
|
@@ -36014,7 +36649,7 @@ function NewsletterForm({
|
|
|
36014
36649
|
isLoading = false,
|
|
36015
36650
|
className
|
|
36016
36651
|
}) {
|
|
36017
|
-
const [email, setEmail] =
|
|
36652
|
+
const [email, setEmail] = React49.useState("");
|
|
36018
36653
|
function handleSubmit(e) {
|
|
36019
36654
|
e.preventDefault();
|
|
36020
36655
|
if (email.trim()) {
|
|
@@ -36139,7 +36774,7 @@ function LegalLinks({
|
|
|
36139
36774
|
{
|
|
36140
36775
|
"data-slot": "site-footer-legal",
|
|
36141
36776
|
className: cn("flex flex-wrap items-center gap-x-4 gap-y-1", className),
|
|
36142
|
-
children: links.map((link, index) => /* @__PURE__ */ jsxs(
|
|
36777
|
+
children: links.map((link, index) => /* @__PURE__ */ jsxs(React49.Fragment, { children: [
|
|
36143
36778
|
index > 0 && /* @__PURE__ */ jsx(
|
|
36144
36779
|
"span",
|
|
36145
36780
|
{
|
|
@@ -36630,9 +37265,9 @@ function UserMenu({
|
|
|
36630
37265
|
menuItems = [],
|
|
36631
37266
|
className
|
|
36632
37267
|
}) {
|
|
36633
|
-
const [isOpen, setIsOpen] =
|
|
36634
|
-
const menuRef =
|
|
36635
|
-
|
|
37268
|
+
const [isOpen, setIsOpen] = React49.useState(false);
|
|
37269
|
+
const menuRef = React49.useRef(null);
|
|
37270
|
+
React49.useEffect(() => {
|
|
36636
37271
|
function handleClickOutside(event) {
|
|
36637
37272
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
36638
37273
|
setIsOpen(false);
|
|
@@ -36928,7 +37563,7 @@ function SiteHeader({
|
|
|
36928
37563
|
userMenuItems,
|
|
36929
37564
|
className
|
|
36930
37565
|
}) {
|
|
36931
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
37566
|
+
const [mobileMenuOpen, setMobileMenuOpen] = React49.useState(false);
|
|
36932
37567
|
const colorVariant = variant === "primary" || variant === "transparent" ? "light" : "dark";
|
|
36933
37568
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36934
37569
|
/* @__PURE__ */ jsx("div", { "data-slot": "site-header-spacer", className: "h-16", "aria-hidden": "true" }),
|
|
@@ -37300,29 +37935,29 @@ function SSOConfigForm({
|
|
|
37300
37935
|
delete: deleteLabel = "Delete SSO",
|
|
37301
37936
|
cancel = "Cancel"
|
|
37302
37937
|
} = labels;
|
|
37303
|
-
const [clientDomain, setClientDomain] =
|
|
37938
|
+
const [clientDomain, setClientDomain] = React49.useState(
|
|
37304
37939
|
initialData.clientDomain ?? ""
|
|
37305
37940
|
);
|
|
37306
|
-
const [ssoLoginUrl, setSsoLoginUrl] =
|
|
37941
|
+
const [ssoLoginUrl, setSsoLoginUrl] = React49.useState(
|
|
37307
37942
|
initialData.ssoLoginUrl ?? ""
|
|
37308
37943
|
);
|
|
37309
|
-
const [ssoLogoutUrl, setSsoLogoutUrl] =
|
|
37944
|
+
const [ssoLogoutUrl, setSsoLogoutUrl] = React49.useState(
|
|
37310
37945
|
initialData.ssoLogoutUrl ?? ""
|
|
37311
37946
|
);
|
|
37312
|
-
const [forceReauth, setForceReauth] =
|
|
37947
|
+
const [forceReauth, setForceReauth] = React49.useState(
|
|
37313
37948
|
initialData.forceReauthentication ?? false
|
|
37314
37949
|
);
|
|
37315
|
-
const [idpSigns, setIdpSigns] =
|
|
37950
|
+
const [idpSigns, setIdpSigns] = React49.useState(
|
|
37316
37951
|
initialData.idpSignsRequest ?? false
|
|
37317
37952
|
);
|
|
37318
|
-
const [allowUnencrypted, setAllowUnencrypted] =
|
|
37953
|
+
const [allowUnencrypted, setAllowUnencrypted] = React49.useState(
|
|
37319
37954
|
initialData.allowUnencryptedAssertion ?? false
|
|
37320
37955
|
);
|
|
37321
|
-
const [certificateFile, setCertificateFile] =
|
|
37956
|
+
const [certificateFile, setCertificateFile] = React49.useState(
|
|
37322
37957
|
null
|
|
37323
37958
|
);
|
|
37324
|
-
const fileInputRef =
|
|
37325
|
-
const [errors, setErrors] =
|
|
37959
|
+
const fileInputRef = React49.useRef(null);
|
|
37960
|
+
const [errors, setErrors] = React49.useState({});
|
|
37326
37961
|
const validate = () => {
|
|
37327
37962
|
const newErrors = {};
|
|
37328
37963
|
if (!clientDomain.trim()) {
|
|
@@ -37680,7 +38315,7 @@ function StepIndicator({
|
|
|
37680
38315
|
const status = getStepStatus(index);
|
|
37681
38316
|
const isLast = index === steps.length - 1;
|
|
37682
38317
|
const clickable = isClickable(index);
|
|
37683
|
-
return /* @__PURE__ */ jsxs(
|
|
38318
|
+
return /* @__PURE__ */ jsxs(React49.Fragment, { children: [
|
|
37684
38319
|
/* @__PURE__ */ jsxs("div", { className: `flex flex-row items-center ${sizes.gap}`, children: [
|
|
37685
38320
|
circleButton(step, index, status, clickable),
|
|
37686
38321
|
stepLabel(step, status, false)
|
|
@@ -37897,10 +38532,10 @@ function TableOfContents({
|
|
|
37897
38532
|
scrollSpyOptions,
|
|
37898
38533
|
className
|
|
37899
38534
|
}) {
|
|
37900
|
-
const [discoveredItems, setDiscoveredItems] =
|
|
38535
|
+
const [discoveredItems, setDiscoveredItems] = React49.useState([]);
|
|
37901
38536
|
const flatItems = manualItems ?? discoveredItems;
|
|
37902
38537
|
const contentEl = contentRef?.current ?? null;
|
|
37903
|
-
|
|
38538
|
+
React49.useEffect(() => {
|
|
37904
38539
|
if (manualItems) return;
|
|
37905
38540
|
const container = contentEl ?? document;
|
|
37906
38541
|
let frameId = null;
|
|
@@ -37931,7 +38566,7 @@ function TableOfContents({
|
|
|
37931
38566
|
if (frameId !== null) cancelAnimationFrame(frameId);
|
|
37932
38567
|
};
|
|
37933
38568
|
}, [manualItems, selector, maxDepth, contentEl]);
|
|
37934
|
-
const ids =
|
|
38569
|
+
const ids = React49.useMemo(() => flatItems.map((i) => i.id), [flatItems]);
|
|
37935
38570
|
const isControlled = controlledActiveId !== void 0;
|
|
37936
38571
|
const { activeId: spyActiveId } = useScrollSpy({
|
|
37937
38572
|
ids,
|
|
@@ -37940,12 +38575,12 @@ function TableOfContents({
|
|
|
37940
38575
|
...scrollSpyOptions
|
|
37941
38576
|
});
|
|
37942
38577
|
const activeId = isControlled ? controlledActiveId : spyActiveId;
|
|
37943
|
-
|
|
38578
|
+
React49.useEffect(() => {
|
|
37944
38579
|
if (!isControlled && onActiveChange) {
|
|
37945
38580
|
onActiveChange(spyActiveId);
|
|
37946
38581
|
}
|
|
37947
38582
|
}, [spyActiveId, isControlled, onActiveChange]);
|
|
37948
|
-
const handleClick =
|
|
38583
|
+
const handleClick = React49.useCallback(
|
|
37949
38584
|
(e, id) => {
|
|
37950
38585
|
if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
37951
38586
|
return;
|
|
@@ -37966,7 +38601,7 @@ function TableOfContents({
|
|
|
37966
38601
|
},
|
|
37967
38602
|
[contentEl, scrollOffset, smooth]
|
|
37968
38603
|
);
|
|
37969
|
-
const tree =
|
|
38604
|
+
const tree = React49.useMemo(() => nestItems(flatItems), [flatItems]);
|
|
37970
38605
|
if (hideWhenEmpty && tree.length === 0) return null;
|
|
37971
38606
|
return /* @__PURE__ */ jsxs("nav", { "aria-label": "Table of contents", className: cn("text-sm", className), children: [
|
|
37972
38607
|
title && /* @__PURE__ */ jsx("p", { className: "text-foreground mb-3 font-semibold", children: title }),
|
|
@@ -38867,7 +39502,7 @@ function WebChartReportViewer({
|
|
|
38867
39502
|
dateFrom = "From",
|
|
38868
39503
|
dateTo = "To"
|
|
38869
39504
|
} = labels;
|
|
38870
|
-
const [modalOpen, setModalOpen] =
|
|
39505
|
+
const [modalOpen, setModalOpen] = React49.useState(false);
|
|
38871
39506
|
const handleReportClick = (report) => {
|
|
38872
39507
|
onReportSelect?.(report);
|
|
38873
39508
|
setModalOpen(true);
|
|
@@ -39105,7 +39740,7 @@ function ReportTimeRange({
|
|
|
39105
39740
|
],
|
|
39106
39741
|
className
|
|
39107
39742
|
}) {
|
|
39108
|
-
const [preset, setPreset] =
|
|
39743
|
+
const [preset, setPreset] = React49.useState("this-month");
|
|
39109
39744
|
const handlePresetChange = (value) => {
|
|
39110
39745
|
setPreset(value);
|
|
39111
39746
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -39207,7 +39842,7 @@ function isValidUrl(url) {
|
|
|
39207
39842
|
}
|
|
39208
39843
|
}
|
|
39209
39844
|
}
|
|
39210
|
-
var WebsiteInput =
|
|
39845
|
+
var WebsiteInput = React49.forwardRef(
|
|
39211
39846
|
({
|
|
39212
39847
|
value = "",
|
|
39213
39848
|
onChange,
|
|
@@ -39218,7 +39853,7 @@ var WebsiteInput = React48.forwardRef(
|
|
|
39218
39853
|
error,
|
|
39219
39854
|
...props
|
|
39220
39855
|
}, ref) => {
|
|
39221
|
-
const [localError, setLocalError] =
|
|
39856
|
+
const [localError, setLocalError] = React49.useState();
|
|
39222
39857
|
const handleChange = (e) => {
|
|
39223
39858
|
onChange?.(e.target.value);
|
|
39224
39859
|
if (localError) {
|
|
@@ -39300,7 +39935,7 @@ function WebsiteInputGroup({
|
|
|
39300
39935
|
typeLabels,
|
|
39301
39936
|
className
|
|
39302
39937
|
}) {
|
|
39303
|
-
const websites =
|
|
39938
|
+
const websites = React49.useMemo(() => {
|
|
39304
39939
|
if (value.length >= minEntries) return value;
|
|
39305
39940
|
const padding = Array(minEntries - value.length).fill(null).map(() => ({ url: "", type: "website" }));
|
|
39306
39941
|
return [...value, ...padding];
|
|
@@ -39448,6 +40083,6 @@ function WebsiteInputGroup({
|
|
|
39448
40083
|
}
|
|
39449
40084
|
WebsiteInputGroup.displayName = "WebsiteInputGroup";
|
|
39450
40085
|
|
|
39451
|
-
export { AIChat, AIChatModal, AIChatTrigger, AILogoIcon, AIMessageDisplay, AITypingIndicator, AccessDeniedPage, ActionButton2 as ActionButton, ActionButtonsBar, ActiveFilters, AddContactModal, AddServiceCard, AdditionalFields, Address, AddressCard, AddressCompact, AddressDisplay, AddressForm, AddressInline, AppHeader, AppHeaderActions, AppHeaderBrand, AppHeaderDivider, AppHeaderIconButton, AppHeaderSearch, AppHeaderSection, AppHeaderTitle, AppHeaderUserMenu, AttachmentPicker, AttachmentPreview, AttachmentPreviewItem, AuthButtons, AuthDialog, BookAppointmentButton, BookingDialog, BusinessHours, BusinessHoursEditor, CSVColumnMapper, CSVFileUpload, CameraButton, CardSkeleton, CharacterCounter, CheckrIntegration, ChevronIcon, ClaimListingButton, ClaimProviderForm, CloseIcon, CommandPalette, CommandPaletteProvider, CommandPaletteTrigger, CompactCookieBanner, CompactFilterBar, CompactHeader, CompactHours, CompactProviderHeader, ConnectionStatusBadge, ConnectionStatusBar, ConnectionStatusOverlay, ConsentSwitch, ConversationHeader, ConversationListItem, ConversationListSkeleton, CookieConsentBanner, CopyrightText, CountBadge, CreateInvoiceModal, CreateReferralModal, DEFAULT_ERROR_CONFIGS, DEFAULT_LANGUAGES, DEFAULT_RADIUS_OPTIONS, DEFAULT_SOCIAL_PROVIDERS, DOTBadge, DashboardWidget, DashboardWidgetActions, DashboardWidgetDataCards, DashboardWidgetInfo, DashboardWidgetTable, DateRangeFilter, DateRangePicker, DateSeparator, DialogOverlay, DisclaimerText, DocumentDetectionOverlay, DocumentScanner, DragDropZone, DropZone, DropzoneOverlay, EditUserRoleModal, EmployeeForm, EmployeeProfileCard, EmployerContactCard, EmployerList, EmployerPricingCard, EmployerServiceModal, EmployerView, EmptyState, ErrorPage, FileManager, FilePreview, FloatingAIChat, FloatingInput, FooterLinkSection, SocialMediaLinks2 as FooterSocialLinks, HRISProviderSelector, HelpSupportPanel, HeroSearchBar, HoursSummary, InlineBookingForm, InventoryManager, InviteUserModal, InvoiceList, InvoicePaymentPage, InvoiceView, LanguageSelector, LanguageSelectorInline, LanguageSelectorNative, LegalLinks, LightboxModal, LoadMoreButton, LoadingBar, LoadingDots, LoadingOverlay, LoadingPage, LoadingSkeleton, MCPToolCallDisplay, MaintenancePage, MessageAvatar, MessageBubble, MessageComposer, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, MobileBackButton, MobileMenuButton, MobileMenuPanel, NavLinks, NewsletterForm, NotFoundPage, NotificationCenter, OfflinePage, OnboardingCompletion, OnboardingStepQuestion, OnboardingWizard, OpenStatusBadge, OrderCard, OrderConfirmation, OrderConfirmationWizard, OrderDetailSidebar, OrderList, OrderLookupForm, OrderSidebar, OrderSidebarTabs, PageHeader, PatientHeader, PaymentHistoryTable, PaymentMethodBank, PaymentMethodCard, PaymentMethodList, PendingClaimsTable, PermissionsEditor, ProductVersion, ProductVersionBadge, Breadcrumb2 as ProviderBreadcrumb, ProviderCard, ProviderCardGrid, ProviderCardSkeleton, ProviderDetailHeader, ProviderDetailHeaderSkeleton, ProviderLogo2 as ProviderLogo, ProviderOverview, ProviderSearchBar, ProviderSearchFilters, ProviderSelector, ProviderSettings, SocialMediaLinks as ProviderSocialLinks, ProviderUsersTable, QuickBookCard, QuickLinksCard, ReadReceiptIndicator, RecurringServiceAddCard, RecurringServiceCard, RecurringServiceGrid, RecurringServiceSetupModal, RefreshIcon, RejectionModal, ReportDashboard, ReportDatePicker, ReportLink, ReportTimeRange, ResourceLink, ResultsEntryCard, ResultsEntryForm, ResultsEntryModal, SSOConfigForm, ScheduleCalendar, SearchResultsMessage, SelectedServicesBadges, SendButton, SendIcon, 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, SkeletonMessage, SparklesIcon, SpinnerIcon2 as SpinnerIcon, StepIndicator, StripeBadge, StripeSecureBadge, SuggestedActions, TableOfContents, TimelineEventList, TimelineProgress, Toast, ToastContainer, ToastProvider, ToolStatusIcon, TypingIndicator, UpdateAvailableOverlay, UserMenu, VerifiedBadge2 as VerifiedBadge, WEBSITE_TYPES, WebChartReportViewer, WebcamModal, WebsiteInput, WebsiteInputGroup, bubbleVariants2 as bubbleVariants, calculateDateRange, countBadgeVariants, countChipVariants, create24HourSchedule, createDefaultSchedule, createWeekdaySchedule, defaultOrderTabs, formatAddressLines, formatAddressSingleLine, formatCityState, formatCityStateZip, formatDateLabel, formatFileSize2 as formatFileSize, formatLastSeen, generateAttachmentId, generateId, getConversationSubtitle, getConversationTitle, getDefaultPresets, getExtendedPresets, getFileType, getGoogleMapsSearchUrl, getGoogleMapsUrl, getToolIcon, groupMessagesByDate, headerVariants, isSameSenderGroup, isValidUrl, sendButtonVariants, useCamera, useCommandPalette, useConnectionStatus, useCookieConsent, useDocumentDetection, useDropzone, useFileUpload, useMessageScroll, useMessages, useReadReceipts, useSidebar, useToast, useTypingIndicator, validateFile, widgetVariants };
|
|
40086
|
+
export { AIChat, AIChatModal, AIChatTrigger, AILogoIcon, AIMessageDisplay, AIReconciliationPanel, AITypingIndicator, AccessDeniedPage, ActionButton2 as ActionButton, ActionButtonsBar, ActiveFilters, AddContactModal, AddServiceCard, AdditionalFields, Address, AddressCard, AddressCompact, AddressDisplay, AddressForm, AddressInline, AppHeader, AppHeaderActions, AppHeaderBrand, AppHeaderDivider, AppHeaderIconButton, AppHeaderSearch, AppHeaderSection, AppHeaderTitle, AppHeaderUserMenu, AttachmentPicker, AttachmentPreview, AttachmentPreviewItem, AuthButtons, AuthDialog, BookAppointmentButton, BookingDialog, BusinessHours, BusinessHoursEditor, CSVColumnMapper, CSVFileUpload, CameraButton, CardSkeleton, CharacterCounter, CheckrIntegration, ChevronIcon, ClaimListingButton, ClaimProviderForm, CloseIcon, CommandPalette, CommandPaletteProvider, CommandPaletteTrigger, CompactCookieBanner, CompactFilterBar, CompactHeader, CompactHours, CompactProviderHeader, ConnectionStatusBadge, ConnectionStatusBar, ConnectionStatusOverlay, ConsentSwitch, ConversationHeader, ConversationListItem, ConversationListSkeleton, CookieConsentBanner, CopyrightText, CountBadge, CreateInvoiceModal, CreateReferralModal, DEFAULT_ERROR_CONFIGS, DEFAULT_LANGUAGES, DEFAULT_RADIUS_OPTIONS, DEFAULT_SOCIAL_PROVIDERS, DOTBadge, DashboardWidget, DashboardWidgetActions, DashboardWidgetDataCards, DashboardWidgetInfo, DashboardWidgetTable, DateRangeFilter, DateRangePicker, DateSeparator, DialogOverlay, DisclaimerText, DocumentDetectionOverlay, DocumentScanner, DragDropZone, DropZone, DropzoneOverlay, EditUserRoleModal, EmployeeForm, EmployeeProfileCard, EmployerContactCard, EmployerList, EmployerPricingCard, EmployerServiceModal, EmployerView, EmptyState, ErrorPage, FileManager, FilePreview, FloatingAIChat, FloatingInput, FooterLinkSection, SocialMediaLinks2 as FooterSocialLinks, HRISProviderSelector, HelpSupportPanel, HeroSearchBar, HoursSummary, InlineBookingForm, InventoryManager, InviteUserModal, InvoiceList, InvoicePaymentPage, InvoiceView, LanguageSelector, LanguageSelectorInline, LanguageSelectorNative, LegalLinks, LightboxModal, LoadMoreButton, LoadingBar, LoadingDots, LoadingOverlay, LoadingPage, LoadingSkeleton, MCPToolCallDisplay, MaintenancePage, MessageAvatar, MessageBubble, MessageComposer, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, MobileBackButton, MobileMenuButton, MobileMenuPanel, NavLinks, NewsletterForm, NotFoundPage, NotificationCenter, OfflinePage, OnboardingCompletion, OnboardingStepQuestion, OnboardingWizard, OpenStatusBadge, OrderCard, OrderConfirmation, OrderConfirmationWizard, OrderDetailSidebar, OrderList, OrderLookupForm, OrderSidebar, OrderSidebarTabs, PageHeader, PatientHeader, PaymentHistoryTable, PaymentMethodBank, PaymentMethodCard, PaymentMethodList, PendingClaimsTable, PermissionsEditor, ProductVersion, ProductVersionBadge, Breadcrumb2 as ProviderBreadcrumb, ProviderCard, ProviderCardGrid, ProviderCardSkeleton, ProviderDetailHeader, ProviderDetailHeaderSkeleton, ProviderLogo2 as ProviderLogo, ProviderOverview, ProviderSearchBar, ProviderSearchFilters, ProviderSelector, ProviderSettings, SocialMediaLinks as ProviderSocialLinks, ProviderUsersTable, QuickBookCard, QuickLinksCard, ReadReceiptIndicator, RecurringServiceAddCard, RecurringServiceCard, RecurringServiceGrid, RecurringServiceSetupModal, RefreshIcon, RejectionModal, ReportDashboard, ReportDatePicker, ReportLink, ReportTimeRange, ResourceLink, ResultsEntryCard, ResultsEntryForm, ResultsEntryModal, SSOConfigForm, ScheduleCalendar, SearchResultsMessage, SelectedServicesBadges, SendButton, SendIcon, 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, SkeletonMessage, SparklesIcon, SpinnerIcon2 as SpinnerIcon, StepIndicator, StripeBadge, StripeSecureBadge, SuggestedActions, TableOfContents, TimelineEventList, TimelineProgress, Toast, ToastContainer, ToastProvider, ToolStatusIcon, TypingIndicator, UpdateAvailableOverlay, UserMenu, VerifiedBadge2 as VerifiedBadge, WEBSITE_TYPES, WebChartReportViewer, WebcamModal, WebsiteInput, WebsiteInputGroup, bubbleVariants2 as bubbleVariants, calculateDateRange, countBadgeVariants, countChipVariants, create24HourSchedule, createDefaultSchedule, createWeekdaySchedule, defaultOrderTabs, defaultReconciliationIsEqual, formatAddressLines, formatAddressSingleLine, formatCityState, formatCityStateZip, formatDateLabel, formatFileSize2 as formatFileSize, formatLastSeen, generateAttachmentId, generateId, getConversationSubtitle, getConversationTitle, getDefaultPresets, getExtendedPresets, getFileType, getGoogleMapsSearchUrl, getGoogleMapsUrl, getToolIcon, groupMessagesByDate, headerVariants, isSameSenderGroup, isValidUrl, panelVariants as reconciliationPanelVariants, sendButtonVariants, useCamera, useCommandPalette, useConnectionStatus, useCookieConsent, useDocumentDetection, useDropzone, useFileUpload, useMessageScroll, useMessages, useReadReceipts, useSidebar, useToast, useTypingIndicator, validateFile, widgetVariants };
|
|
39452
40087
|
//# sourceMappingURL=index.js.map
|
|
39453
40088
|
//# sourceMappingURL=index.js.map
|