@devicai/ui 0.32.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/cjs/api/client.js +13 -0
  2. package/dist/cjs/api/client.js.map +1 -1
  3. package/dist/cjs/api/types.js +10 -0
  4. package/dist/cjs/api/types.js.map +1 -1
  5. package/dist/cjs/components/ChatDrawer/ChatDrawer.js +3 -1
  6. package/dist/cjs/components/ChatDrawer/ChatDrawer.js.map +1 -1
  7. package/dist/cjs/components/ChatDrawer/ChatInput.js +138 -20
  8. package/dist/cjs/components/ChatDrawer/ChatInput.js.map +1 -1
  9. package/dist/cjs/components/ChatDrawer/ChatMessages.js +24 -3
  10. package/dist/cjs/components/ChatDrawer/ChatMessages.js.map +1 -1
  11. package/dist/cjs/components/ChatDrawer/pastedText.js +64 -0
  12. package/dist/cjs/components/ChatDrawer/pastedText.js.map +1 -0
  13. package/dist/cjs/components/ThreadStateTag/ThreadStateTag.js +59 -1
  14. package/dist/cjs/components/ThreadStateTag/ThreadStateTag.js.map +1 -1
  15. package/dist/cjs/styles.css +1 -1
  16. package/dist/esm/api/client.d.ts +8 -0
  17. package/dist/esm/api/client.js +13 -0
  18. package/dist/esm/api/client.js.map +1 -1
  19. package/dist/esm/api/types.d.ts +22 -5
  20. package/dist/esm/api/types.js +9 -1
  21. package/dist/esm/api/types.js.map +1 -1
  22. package/dist/esm/components/ChatDrawer/ChatDrawer.js +3 -1
  23. package/dist/esm/components/ChatDrawer/ChatDrawer.js.map +1 -1
  24. package/dist/esm/components/ChatDrawer/ChatDrawer.types.d.ts +16 -0
  25. package/dist/esm/components/ChatDrawer/ChatInput.d.ts +1 -1
  26. package/dist/esm/components/ChatDrawer/ChatInput.js +138 -20
  27. package/dist/esm/components/ChatDrawer/ChatInput.js.map +1 -1
  28. package/dist/esm/components/ChatDrawer/ChatMessages.js +24 -3
  29. package/dist/esm/components/ChatDrawer/ChatMessages.js.map +1 -1
  30. package/dist/esm/components/ChatDrawer/pastedText.d.ts +30 -0
  31. package/dist/esm/components/ChatDrawer/pastedText.js +59 -0
  32. package/dist/esm/components/ChatDrawer/pastedText.js.map +1 -0
  33. package/dist/esm/components/ThreadStateTag/ThreadStateTag.js +59 -1
  34. package/dist/esm/components/ThreadStateTag/ThreadStateTag.js.map +1 -1
  35. package/dist/esm/styles.css +1 -1
  36. package/package.json +1 -1
@@ -5,6 +5,7 @@ var React = require('react');
5
5
  var useSpeechRecording = require('../../hooks/useSpeechRecording.js');
6
6
  var client = require('../../api/client.js');
7
7
  var ReferenceChip = require('./ReferenceChip.js');
8
+ var pastedText = require('./pastedText.js');
8
9
 
9
10
  const FILE_TYPE_ACCEPT = {
10
11
  images: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
@@ -18,6 +19,14 @@ const FILE_TYPE_ACCEPT = {
18
19
  audio: ['audio/mpeg', 'audio/wav', 'audio/ogg'],
19
20
  video: ['video/mp4', 'video/webm', 'video/ogg'],
20
21
  };
22
+ // Extensions used to name images pasted from the clipboard, which arrive with a
23
+ // generic name ("image.png") or none at all.
24
+ const IMAGE_EXT_BY_MIME = {
25
+ 'image/jpeg': 'jpg',
26
+ 'image/png': 'png',
27
+ 'image/gif': 'gif',
28
+ 'image/webp': 'webp',
29
+ };
21
30
  // Handoff (hands-free) loop timings.
22
31
  const HANDOFF_PENDING_MS = 1000; // default cancellable countdown before auto-send
23
32
  const HANDOFF_INACTIVITY_MS = 6000; // silence (no speech) that ends the loop
@@ -26,7 +35,7 @@ const HANDOFF_HOLD_MS = 3000; // press-and-hold duration on the mic to arm hands
26
35
  * Chat input component with file upload support
27
36
  */
28
37
  function ChatInput({ onSend, disabled = false, placeholder = 'Type a message...', enableFileUploads = false, allowedFileTypes = { images: true, documents: true }, maxFileSize = 10 * 1024 * 1024, // 10MB
29
- enableSpeechToText = false, speechLanguage, speechTenantId, speechAutoStop = true, speechAutoStopCountdownMs, speechAutoStopSilenceMs, speechAutoStopSilenceRatio, speechAutoStopSilenceLevel, speechAutoStopSpeechLevel, speechHandoff = false, speechHandoffSendDelayMs, speechHandoffHoldMs, apiKey, baseUrl, sendButtonContent, disabledMessage, isProcessing = false, onStop, stopButtonContent, pendingInputWidget, onSubmitWidget, onCancelWidget, references, onRemoveReference, usageBar, limitBanner, }) {
38
+ enableLongTextPaste = false, longTextPasteThreshold = 2000, enableSpeechToText = false, speechLanguage, speechTenantId, speechAutoStop = true, speechAutoStopCountdownMs, speechAutoStopSilenceMs, speechAutoStopSilenceRatio, speechAutoStopSilenceLevel, speechAutoStopSpeechLevel, speechHandoff = false, speechHandoffSendDelayMs, speechHandoffHoldMs, apiKey, baseUrl, sendButtonContent, disabledMessage, isProcessing = false, onStop, stopButtonContent, pendingInputWidget, onSubmitWidget, onCancelWidget, references, onRemoveReference, usageBar, limitBanner, }) {
30
39
  // When a widget is pending as 'input', render it in place of the textarea
31
40
  if (pendingInputWidget) {
32
41
  const WidgetComponent = pendingInputWidget.widget.component;
@@ -34,8 +43,16 @@ enableSpeechToText = false, speechLanguage, speechTenantId, speechAutoStop = tru
34
43
  }
35
44
  const [message, setMessage] = React.useState('');
36
45
  const [files, setFiles] = React.useState([]);
46
+ // Long blocks of pasted text, kept out of the textarea and shown as cards.
47
+ const [pastedTexts, setPastedTexts] = React.useState([]);
48
+ const [isDraggingOver, setIsDraggingOver] = React.useState(false);
37
49
  const textareaRef = React.useRef(null);
38
50
  const fileInputRef = React.useRef(null);
51
+ // Monotonic counters so pasted images and text blocks get stable, unique ids.
52
+ const pasteCounterRef = React.useRef(0);
53
+ // Nested dragenter/dragleave events fire per child node; count them so the
54
+ // overlay only clears when the pointer truly leaves the input area.
55
+ const dragDepthRef = React.useRef(0);
39
56
  // Speech-to-text state
40
57
  const [transcriptId, setTranscriptId] = React.useState();
41
58
  const [isTranscribing, setIsTranscribing] = React.useState(false);
@@ -94,10 +111,34 @@ enableSpeechToText = false, speechLanguage, speechTenantId, speechAutoStop = tru
94
111
  const speechEnabled = enableSpeechToText && recording.isSupported && !!transcribeClient;
95
112
  const isRecordingActive = recording.isRecording || recording.isPaused;
96
113
  // Calculate accepted file types
97
- const acceptedTypes = Object.entries(allowedFileTypes)
114
+ const acceptedTypeList = React.useMemo(() => Object.entries(allowedFileTypes)
98
115
  .filter(([, enabled]) => enabled)
99
- .flatMap(([type]) => FILE_TYPE_ACCEPT[type] || [])
100
- .join(',');
116
+ .flatMap(([type]) => FILE_TYPE_ACCEPT[type] || []), [allowedFileTypes]);
117
+ const acceptedTypes = acceptedTypeList.join(',');
118
+ // Single entry point for every way of attaching a file (button, paste, drop):
119
+ // enforces the size limit and the allowed MIME types, which until now were
120
+ // only hinted at the native file dialog and never actually checked.
121
+ const addFiles = React.useCallback((incoming) => {
122
+ const validFiles = incoming.filter((file) => {
123
+ if (file.size > maxFileSize) {
124
+ console.warn(`File ${file.name} exceeds maximum size`);
125
+ return false;
126
+ }
127
+ if (acceptedTypeList.length > 0 && !acceptedTypeList.includes(file.type)) {
128
+ console.warn(`File type ${file.type || 'unknown'} is not allowed`);
129
+ return false;
130
+ }
131
+ return true;
132
+ });
133
+ if (validFiles.length > 0)
134
+ setFiles((prev) => [...prev, ...validFiles]);
135
+ }, [maxFileSize, acceptedTypeList]);
136
+ // Thumbnails for attached images. The cleanup revokes the previous batch on
137
+ // every change (and on unmount), so the object URLs never leak.
138
+ const filePreviews = React.useMemo(() => files.map((file) => file.type.startsWith('image/') ? URL.createObjectURL(file) : null), [files]);
139
+ React.useEffect(() => () => {
140
+ filePreviews.forEach((url) => url && URL.revokeObjectURL(url));
141
+ }, [filePreviews]);
101
142
  // Auto-resize textarea
102
143
  const handleInput = React.useCallback(() => {
103
144
  const textarea = textareaRef.current;
@@ -109,17 +150,26 @@ enableSpeechToText = false, speechLanguage, speechTenantId, speechAutoStop = tru
109
150
  // Handle send
110
151
  const handleSend = React.useCallback(() => {
111
152
  const trimmedMessage = message.trim();
112
- if (!trimmedMessage && files.length === 0)
153
+ if (!trimmedMessage && files.length === 0 && pastedTexts.length === 0)
113
154
  return;
114
- onSend(trimmedMessage, files.length > 0 ? files : undefined, transcriptId ? { transcriptId } : undefined);
155
+ // Pasted text is shown as a card but still reaches the model in full: each
156
+ // block is prepended to the message inside a delimiter the thread can parse
157
+ // back out (see parsePastedBlocks in ChatMessages).
158
+ const composedMessage = pastedTexts.length > 0
159
+ ? [...pastedTexts.map(pastedText.toPastedBlock), trimmedMessage]
160
+ .filter(Boolean)
161
+ .join('\n\n')
162
+ : trimmedMessage;
163
+ onSend(composedMessage, files.length > 0 ? files : undefined, transcriptId ? { transcriptId } : undefined);
115
164
  setMessage('');
116
165
  setFiles([]);
166
+ setPastedTexts([]);
117
167
  setTranscriptId(undefined);
118
168
  // Reset textarea height
119
169
  if (textareaRef.current) {
120
170
  textareaRef.current.style.height = 'auto';
121
171
  }
122
- }, [message, files, onSend, transcriptId]);
172
+ }, [message, files, pastedTexts, onSend, transcriptId]);
123
173
  // Keep a fresh send fn for the deferred handoff auto-send.
124
174
  handleSendRef.current = handleSend;
125
175
  // --- Speech-to-text handlers ---
@@ -376,26 +426,94 @@ enableSpeechToText = false, speechLanguage, speechTenantId, speechAutoStop = tru
376
426
  }, [handleSend]);
377
427
  // Handle file selection
378
428
  const handleFileSelect = React.useCallback((e) => {
379
- const selectedFiles = Array.from(e.target.files || []);
380
- // Filter valid files
381
- const validFiles = selectedFiles.filter((file) => {
382
- if (file.size > maxFileSize) {
383
- console.warn(`File ${file.name} exceeds maximum size`);
384
- return false;
385
- }
386
- return true;
387
- });
388
- setFiles((prev) => [...prev, ...validFiles]);
429
+ addFiles(Array.from(e.target.files || []));
389
430
  // Reset input
390
431
  if (fileInputRef.current) {
391
432
  fileInputRef.current.value = '';
392
433
  }
393
- }, [maxFileSize]);
434
+ }, [addFiles]);
394
435
  // Remove file
395
436
  const removeFile = React.useCallback((index) => {
396
437
  setFiles((prev) => prev.filter((_, i) => i !== index));
397
438
  }, []);
398
- return (jsxRuntime.jsxs("div", { className: "devic-input-area", children: [limitBanner, usageBar, disabledMessage && disabled && (jsxRuntime.jsxs("div", { className: "devic-input-disabled-notice", children: [jsxRuntime.jsx(WaitingIcon, {}), disabledMessage] })), speechError && (jsxRuntime.jsx("div", { className: "devic-speech-error", role: "alert", children: speechError })), handoffActive && (jsxRuntime.jsxs("div", { className: "devic-handoff-bar", "data-waiting": isProcessing ? 'true' : 'false', children: [jsxRuntime.jsx("span", { className: "devic-handoff-dot", "aria-hidden": "true" }), jsxRuntime.jsx("span", { className: "devic-handoff-label", children: isProcessing ? 'Hands-free · waiting for reply' : 'Hands-free on' }), jsxRuntime.jsx("button", { type: "button", className: "devic-handoff-stop", onClick: cancelHandoff, title: "Stop hands-free", "aria-label": "Stop hands-free", children: jsxRuntime.jsx(CloseIcon, {}) })] })), references && references.length > 0 && (jsxRuntime.jsx("div", { className: "devic-reference-chips", children: references.map((ref) => (jsxRuntime.jsx(ReferenceChip.ReferenceChip, { label: ref.label, variant: "input", onRemove: () => onRemoveReference?.(ref.id) }, ref.id))) })), files.length > 0 && (jsxRuntime.jsx("div", { className: "devic-file-preview", children: files.map((file, idx) => (jsxRuntime.jsxs("div", { className: "devic-file-preview-item", children: [jsxRuntime.jsx(FileIcon, {}), jsxRuntime.jsx("span", { children: file.name }), jsxRuntime.jsx("button", { className: "devic-file-remove", onClick: () => removeFile(idx), type: "button", children: "\u00D7" })] }, idx))) })), jsxRuntime.jsx("div", { className: "devic-input-wrapper", children: pendingSend ? (jsxRuntime.jsx("div", { className: "devic-speech-panel", "data-state": "pending", children: jsxRuntime.jsxs("div", { className: "devic-handoff-pending", children: [jsxRuntime.jsxs("div", { className: "devic-handoff-pending-icon", children: [jsxRuntime.jsx(SendCountdownRing, { progress: pendingProgress }), jsxRuntime.jsx(SendIcon, {})] }), jsxRuntime.jsxs("div", { className: "devic-handoff-pending-text", children: [jsxRuntime.jsx("span", { className: "devic-handoff-pending-title", children: "Sending\u2026 interact to cancel" }), message.trim() && (jsxRuntime.jsx("span", { className: "devic-handoff-pending-preview", children: message.trim() }))] })] }) })) : isTranscribing ? (jsxRuntime.jsxs("div", { className: "devic-speech-panel", "data-state": "processing", children: [jsxRuntime.jsx("span", { className: "devic-speech-spinner", "aria-hidden": "true" }), jsxRuntime.jsx("span", { className: "devic-speech-status", children: "Transcribing\u2026" })] })) : isRecordingActive ? (jsxRuntime.jsxs("div", { className: "devic-speech-panel", "data-state": "recording", children: [jsxRuntime.jsx("button", { className: "devic-input-btn devic-speech-cancel", onClick: cancelRecording, type: "button", title: "Cancel recording", children: jsxRuntime.jsx(CloseIcon, {}) }), jsxRuntime.jsxs("div", { className: "devic-speech-live", children: [jsxRuntime.jsx(Equalizer, { levels: recording.levels, paused: recording.isPaused }), jsxRuntime.jsx("span", { className: "devic-speech-timer", children: formatDuration(recording.durationMs) })] }), jsxRuntime.jsx("button", { className: "devic-input-btn", onClick: recording.isPaused ? recording.resume : recording.pause, type: "button", title: recording.isPaused ? 'Resume' : 'Pause', children: recording.isPaused ? jsxRuntime.jsx(PlayIcon, {}) : jsxRuntime.jsx(PauseIcon, {}) }), jsxRuntime.jsxs("div", { className: "devic-speech-confirm-wrap", "data-autostop": recording.isAutoStopping ? 'true' : 'false', children: [recording.isAutoStopping && (jsxRuntime.jsx(AutoStopRing, { progress: recording.autoStopProgress })), jsxRuntime.jsx("button", { className: "devic-input-btn devic-speech-confirm", onClick: () => void handleConfirm(), type: "button", title: recording.isAutoStopping
439
+ // Remove a pasted-text card
440
+ const removePastedText = React.useCallback((id) => {
441
+ setPastedTexts((prev) => prev.filter((p) => p.id !== id));
442
+ }, []);
443
+ // Paste: files in the clipboard become attachments; a long block of plain
444
+ // text becomes a card instead of flooding the textarea.
445
+ const handlePaste = React.useCallback((e) => {
446
+ const clipboard = e.clipboardData;
447
+ if (!clipboard)
448
+ return;
449
+ if (enableFileUploads) {
450
+ const pastedFiles = Array.from(clipboard.items)
451
+ .filter((item) => item.kind === 'file')
452
+ .map((item) => item.getAsFile())
453
+ .filter((file) => file !== null)
454
+ .map((file) => {
455
+ // Clipboard images share a generic name; give each one its own so
456
+ // several pasted screenshots don't collapse into the same label.
457
+ const ext = IMAGE_EXT_BY_MIME[file.type];
458
+ if (!ext)
459
+ return file;
460
+ pasteCounterRef.current += 1;
461
+ return new File([file], `pasted-image-${pasteCounterRef.current}.${ext}`, {
462
+ type: file.type,
463
+ });
464
+ });
465
+ if (pastedFiles.length > 0) {
466
+ e.preventDefault();
467
+ addFiles(pastedFiles);
468
+ return;
469
+ }
470
+ }
471
+ if (!enableLongTextPaste)
472
+ return;
473
+ const text = clipboard.getData('text/plain');
474
+ if (text.length <= longTextPasteThreshold)
475
+ return;
476
+ e.preventDefault();
477
+ pasteCounterRef.current += 1;
478
+ setPastedTexts((prev) => [
479
+ ...prev,
480
+ { id: String(pasteCounterRef.current), text },
481
+ ]);
482
+ }, [enableFileUploads, enableLongTextPaste, longTextPasteThreshold, addFiles]);
483
+ // --- Drag & drop ---
484
+ const handleDragEnter = React.useCallback((e) => {
485
+ if (!enableFileUploads || disabled)
486
+ return;
487
+ if (!e.dataTransfer.types.includes('Files'))
488
+ return;
489
+ e.preventDefault();
490
+ dragDepthRef.current += 1;
491
+ setIsDraggingOver(true);
492
+ }, [enableFileUploads, disabled]);
493
+ const handleDragOver = React.useCallback((e) => {
494
+ if (!enableFileUploads || disabled)
495
+ return;
496
+ if (!e.dataTransfer.types.includes('Files'))
497
+ return;
498
+ // Without this the browser navigates away to open the dropped file.
499
+ e.preventDefault();
500
+ e.dataTransfer.dropEffect = 'copy';
501
+ }, [enableFileUploads, disabled]);
502
+ const handleDragLeave = React.useCallback((e) => {
503
+ e.preventDefault();
504
+ dragDepthRef.current = Math.max(0, dragDepthRef.current - 1);
505
+ if (dragDepthRef.current === 0)
506
+ setIsDraggingOver(false);
507
+ }, []);
508
+ const handleDrop = React.useCallback((e) => {
509
+ if (!enableFileUploads || disabled)
510
+ return;
511
+ e.preventDefault();
512
+ dragDepthRef.current = 0;
513
+ setIsDraggingOver(false);
514
+ addFiles(Array.from(e.dataTransfer.files || []));
515
+ }, [enableFileUploads, disabled, addFiles]);
516
+ return (jsxRuntime.jsxs("div", { className: "devic-input-area", "data-dragging": isDraggingOver ? 'true' : 'false', onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [isDraggingOver && (jsxRuntime.jsxs("div", { className: "devic-drop-overlay", children: [jsxRuntime.jsx(AttachIcon, {}), jsxRuntime.jsx("span", { children: "Drop files to attach" })] })), limitBanner, usageBar, disabledMessage && disabled && (jsxRuntime.jsxs("div", { className: "devic-input-disabled-notice", children: [jsxRuntime.jsx(WaitingIcon, {}), disabledMessage] })), speechError && (jsxRuntime.jsx("div", { className: "devic-speech-error", role: "alert", children: speechError })), handoffActive && (jsxRuntime.jsxs("div", { className: "devic-handoff-bar", "data-waiting": isProcessing ? 'true' : 'false', children: [jsxRuntime.jsx("span", { className: "devic-handoff-dot", "aria-hidden": "true" }), jsxRuntime.jsx("span", { className: "devic-handoff-label", children: isProcessing ? 'Hands-free · waiting for reply' : 'Hands-free on' }), jsxRuntime.jsx("button", { type: "button", className: "devic-handoff-stop", onClick: cancelHandoff, title: "Stop hands-free", "aria-label": "Stop hands-free", children: jsxRuntime.jsx(CloseIcon, {}) })] })), references && references.length > 0 && (jsxRuntime.jsx("div", { className: "devic-reference-chips", children: references.map((ref) => (jsxRuntime.jsx(ReferenceChip.ReferenceChip, { label: ref.label, variant: "input", onRemove: () => onRemoveReference?.(ref.id) }, ref.id))) })), pastedTexts.length > 0 && (jsxRuntime.jsx("div", { className: "devic-pasted-cards", children: pastedTexts.map((pasted) => (jsxRuntime.jsxs("div", { className: "devic-pasted-card", children: [jsxRuntime.jsx("p", { className: "devic-pasted-card-preview", children: pastedText.pastedPreview(pasted.text) }), jsxRuntime.jsxs("div", { className: "devic-pasted-card-footer", children: [jsxRuntime.jsx("span", { className: "devic-pasted-card-badge", children: "PASTED" }), jsxRuntime.jsxs("span", { className: "devic-pasted-card-meta", children: [pastedText.pastedLineCount(pasted.text), " lines"] })] }), jsxRuntime.jsx("button", { className: "devic-file-remove devic-pasted-card-remove", onClick: () => removePastedText(pasted.id), type: "button", title: "Remove pasted text", "aria-label": "Remove pasted text", children: "\u00D7" })] }, pasted.id))) })), files.length > 0 && (jsxRuntime.jsx("div", { className: "devic-file-preview", children: files.map((file, idx) => (jsxRuntime.jsxs("div", { className: "devic-file-preview-item", children: [filePreviews[idx] ? (jsxRuntime.jsx("img", { className: "devic-file-preview-thumb", src: filePreviews[idx], alt: file.name })) : (jsxRuntime.jsx(FileIcon, {})), jsxRuntime.jsx("span", { children: file.name }), jsxRuntime.jsx("button", { className: "devic-file-remove", onClick: () => removeFile(idx), type: "button", children: "\u00D7" })] }, idx))) })), jsxRuntime.jsx("div", { className: "devic-input-wrapper", children: pendingSend ? (jsxRuntime.jsx("div", { className: "devic-speech-panel", "data-state": "pending", children: jsxRuntime.jsxs("div", { className: "devic-handoff-pending", children: [jsxRuntime.jsxs("div", { className: "devic-handoff-pending-icon", children: [jsxRuntime.jsx(SendCountdownRing, { progress: pendingProgress }), jsxRuntime.jsx(SendIcon, {})] }), jsxRuntime.jsxs("div", { className: "devic-handoff-pending-text", children: [jsxRuntime.jsx("span", { className: "devic-handoff-pending-title", children: "Sending\u2026 interact to cancel" }), message.trim() && (jsxRuntime.jsx("span", { className: "devic-handoff-pending-preview", children: message.trim() }))] })] }) })) : isTranscribing ? (jsxRuntime.jsxs("div", { className: "devic-speech-panel", "data-state": "processing", children: [jsxRuntime.jsx("span", { className: "devic-speech-spinner", "aria-hidden": "true" }), jsxRuntime.jsx("span", { className: "devic-speech-status", children: "Transcribing\u2026" })] })) : isRecordingActive ? (jsxRuntime.jsxs("div", { className: "devic-speech-panel", "data-state": "recording", children: [jsxRuntime.jsx("button", { className: "devic-input-btn devic-speech-cancel", onClick: cancelRecording, type: "button", title: "Cancel recording", children: jsxRuntime.jsx(CloseIcon, {}) }), jsxRuntime.jsxs("div", { className: "devic-speech-live", children: [jsxRuntime.jsx(Equalizer, { levels: recording.levels, paused: recording.isPaused }), jsxRuntime.jsx("span", { className: "devic-speech-timer", children: formatDuration(recording.durationMs) })] }), jsxRuntime.jsx("button", { className: "devic-input-btn", onClick: recording.isPaused ? recording.resume : recording.pause, type: "button", title: recording.isPaused ? 'Resume' : 'Pause', children: recording.isPaused ? jsxRuntime.jsx(PlayIcon, {}) : jsxRuntime.jsx(PauseIcon, {}) }), jsxRuntime.jsxs("div", { className: "devic-speech-confirm-wrap", "data-autostop": recording.isAutoStopping ? 'true' : 'false', children: [recording.isAutoStopping && (jsxRuntime.jsx(AutoStopRing, { progress: recording.autoStopProgress })), jsxRuntime.jsx("button", { className: "devic-input-btn devic-speech-confirm", onClick: () => void handleConfirm(), type: "button", title: recording.isAutoStopping
399
517
  ? 'Auto-sending… keep talking to cancel'
400
518
  : 'Confirm', children: jsxRuntime.jsx(CheckIcon, {}) })] })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [enableFileUploads && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { ref: fileInputRef, type: "file", accept: acceptedTypes, multiple: true, onChange: handleFileSelect, style: { display: 'none' } }), jsxRuntime.jsx("button", { className: "devic-input-btn", onClick: () => fileInputRef.current?.click(), disabled: disabled, type: "button", title: "Attach file", children: jsxRuntime.jsx(AttachIcon, {}) })] })), speechEnabled && (jsxRuntime.jsxs("div", { className: "devic-speech-mic-wrap", "data-holding": isHolding ? 'true' : 'false', children: [isHolding && jsxRuntime.jsx(HoldRing, { progress: holdProgress }), jsxRuntime.jsx("button", { className: "devic-input-btn devic-speech-mic", onClick: speechHandoff ? undefined : startOneShotRecording, onPointerDown: speechHandoff ? handleMicPointerDown : undefined, onPointerUp: speechHandoff ? handleMicPointerUp : undefined, onPointerCancel: speechHandoff ? handleMicPointerCancel : undefined, disabled: disabled || isProcessing, type: "button", title: speechHandoff
401
519
  ? 'Tap to dictate · hold to start hands-free'
@@ -407,7 +525,7 @@ enableSpeechToText = false, speechLanguage, speechTenantId, speechAutoStop = tru
407
525
  if (transcriptId && value.trim() === '')
408
526
  setTranscriptId(undefined);
409
527
  handleInput();
410
- }, onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled, rows: 1 }), isProcessing ? (stopButtonContent ? (jsxRuntime.jsxs("div", { className: "devic-send-btn-wrapper", children: [jsxRuntime.jsx("div", { className: "devic-send-btn-custom", "aria-hidden": "true", children: stopButtonContent }), jsxRuntime.jsx("button", { className: "devic-send-btn-overlay", onClick: onStop, type: "button", title: "Stop" })] })) : (jsxRuntime.jsx("button", { className: "devic-input-btn devic-stop-btn", onClick: onStop, type: "button", title: "Stop", children: jsxRuntime.jsx(StopIcon, {}) }))) : sendButtonContent ? (jsxRuntime.jsxs("div", { className: "devic-send-btn-wrapper", children: [jsxRuntime.jsx("div", { className: "devic-send-btn-custom", "aria-hidden": "true", children: sendButtonContent }), jsxRuntime.jsx("button", { className: "devic-send-btn-overlay", onClick: handleSend, disabled: disabled || (!message.trim() && files.length === 0), type: "button", title: "Send message" })] })) : (jsxRuntime.jsx("button", { className: "devic-input-btn devic-send-btn", onClick: handleSend, disabled: disabled || (!message.trim() && files.length === 0), type: "button", title: "Send message", children: jsxRuntime.jsx(SendIcon, {}) }))] })) })] }));
528
+ }, onKeyDown: handleKeyDown, onPaste: handlePaste, placeholder: placeholder, disabled: disabled, rows: 1 }), isProcessing ? (stopButtonContent ? (jsxRuntime.jsxs("div", { className: "devic-send-btn-wrapper", children: [jsxRuntime.jsx("div", { className: "devic-send-btn-custom", "aria-hidden": "true", children: stopButtonContent }), jsxRuntime.jsx("button", { className: "devic-send-btn-overlay", onClick: onStop, type: "button", title: "Stop" })] })) : (jsxRuntime.jsx("button", { className: "devic-input-btn devic-stop-btn", onClick: onStop, type: "button", title: "Stop", children: jsxRuntime.jsx(StopIcon, {}) }))) : sendButtonContent ? (jsxRuntime.jsxs("div", { className: "devic-send-btn-wrapper", children: [jsxRuntime.jsx("div", { className: "devic-send-btn-custom", "aria-hidden": "true", children: sendButtonContent }), jsxRuntime.jsx("button", { className: "devic-send-btn-overlay", onClick: handleSend, disabled: disabled || (!message.trim() && files.length === 0 && pastedTexts.length === 0), type: "button", title: "Send message" })] })) : (jsxRuntime.jsx("button", { className: "devic-input-btn devic-send-btn", onClick: handleSend, disabled: disabled || (!message.trim() && files.length === 0 && pastedTexts.length === 0), type: "button", title: "Send message", children: jsxRuntime.jsx(SendIcon, {}) }))] })) })] }));
411
529
  }
412
530
  /**
413
531
  * Live equalizer rendered from the recording amplitude levels (0..1 per bar).
@@ -1 +1 @@
1
- {"version":3,"file":"ChatInput.js","sources":["../../../../../src/components/ChatDrawer/ChatInput.tsx"],"sourcesContent":["import React, { useState, useRef, useCallback, useMemo, useEffect } from 'react';\nimport type { ChatInputProps } from './ChatDrawer.types';\nimport { useSpeechRecording } from '../../hooks/useSpeechRecording';\nimport { DevicApiClient } from '../../api/client';\nimport { ReferenceChip } from './ReferenceChip';\n\nconst FILE_TYPE_ACCEPT: Record<string, string[]> = {\n images: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],\n documents: [\n 'application/pdf',\n 'application/msword',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'text/plain',\n 'text/csv',\n ],\n audio: ['audio/mpeg', 'audio/wav', 'audio/ogg'],\n video: ['video/mp4', 'video/webm', 'video/ogg'],\n};\n\n// Handoff (hands-free) loop timings.\nconst HANDOFF_PENDING_MS = 1000; // default cancellable countdown before auto-send\nconst HANDOFF_INACTIVITY_MS = 6000; // silence (no speech) that ends the loop\nconst HANDOFF_HOLD_MS = 3000; // press-and-hold duration on the mic to arm hands-free\n\n/**\n * Chat input component with file upload support\n */\nexport function ChatInput({\n onSend,\n disabled = false,\n placeholder = 'Type a message...',\n enableFileUploads = false,\n allowedFileTypes = { images: true, documents: true },\n maxFileSize = 10 * 1024 * 1024, // 10MB\n enableSpeechToText = false,\n speechLanguage,\n speechTenantId,\n speechAutoStop = true,\n speechAutoStopCountdownMs,\n speechAutoStopSilenceMs,\n speechAutoStopSilenceRatio,\n speechAutoStopSilenceLevel,\n speechAutoStopSpeechLevel,\n speechHandoff = false,\n speechHandoffSendDelayMs,\n speechHandoffHoldMs,\n apiKey,\n baseUrl,\n sendButtonContent,\n disabledMessage,\n isProcessing = false,\n onStop,\n stopButtonContent,\n pendingInputWidget,\n onSubmitWidget,\n onCancelWidget,\n references,\n onRemoveReference,\n usageBar,\n limitBanner,\n}: ChatInputProps): JSX.Element {\n // When a widget is pending as 'input', render it in place of the textarea\n if (pendingInputWidget) {\n const WidgetComponent = pendingInputWidget.widget.component;\n return (\n <div className=\"devic-input-area\" data-widget-mode=\"input\">\n <div className=\"devic-input-widget\" data-tool-name={pendingInputWidget.toolName}>\n <WidgetComponent\n toolCall={pendingInputWidget.toolCall}\n params={pendingInputWidget.params}\n submit={(response) => onSubmitWidget?.(pendingInputWidget.toolCall.id, response)}\n cancel={(reason) => onCancelWidget?.(pendingInputWidget.toolCall.id, reason)}\n />\n </div>\n </div>\n );\n }\n const [message, setMessage] = useState('');\n const [files, setFiles] = useState<File[]>([]);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n // Speech-to-text state\n const [transcriptId, setTranscriptId] = useState<string | undefined>();\n const [isTranscribing, setIsTranscribing] = useState(false);\n const [speechError, setSpeechError] = useState<string | null>(null);\n // Holds the latest confirmRecording so the auto-stop callback (created before\n // confirmRecording is defined) always calls the current closure.\n const confirmRef = useRef<() => void>(() => {});\n const recording = useSpeechRecording({\n bars: 5,\n autoStop: speechAutoStop,\n ...(speechAutoStopCountdownMs != null && {\n autoStopCountdownMs: speechAutoStopCountdownMs,\n }),\n ...(speechAutoStopSilenceMs != null && {\n autoStopSilenceMs: speechAutoStopSilenceMs,\n }),\n ...(speechAutoStopSilenceRatio != null && {\n autoStopSilenceRatio: speechAutoStopSilenceRatio,\n }),\n ...(speechAutoStopSilenceLevel != null && {\n autoStopSilenceLevel: speechAutoStopSilenceLevel,\n }),\n ...(speechAutoStopSpeechLevel != null && {\n autoStopSpeechLevel: speechAutoStopSpeechLevel,\n }),\n onAutoStop: () => confirmRef.current(),\n });\n\n // --- Handoff (hands-free loop) state ---\n const [handoffActive, setHandoffActive] = useState(false);\n const [pendingSend, setPendingSend] = useState(false);\n const [pendingProgress, setPendingProgress] = useState(1);\n // Ref mirror so async callbacks (rAF, timers, document listeners) read the\n // live value without going stale.\n const handoffActiveRef = useRef(false);\n const pendingRafRef = useRef<number | null>(null);\n const inactivityTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const prevProcessingRef = useRef(isProcessing);\n // Always-fresh send fn so the deferred auto-send uses the latest message.\n const handleSendRef = useRef<() => void>(() => {});\n\n // --- Press-and-hold to arm hands-free ---\n // Holding the mic for `holdMs` fills a ring (0→1) and activates hands-free;\n // releasing earlier falls back to a single one-shot recording.\n const [holdProgress, setHoldProgress] = useState(0);\n const [isHolding, setIsHolding] = useState(false);\n const holdRafRef = useRef<number | null>(null);\n const holdFiredRef = useRef(false);\n\n // Client used only for the /whisper transcription call.\n const transcribeClient = useMemo(() => {\n if (!enableSpeechToText || !apiKey) return null;\n return new DevicApiClient({\n apiKey,\n baseUrl: baseUrl || 'https://api.devic.ai',\n });\n }, [enableSpeechToText, apiKey, baseUrl]);\n\n const speechEnabled =\n enableSpeechToText && recording.isSupported && !!transcribeClient;\n const isRecordingActive = recording.isRecording || recording.isPaused;\n\n // Calculate accepted file types\n const acceptedTypes = Object.entries(allowedFileTypes)\n .filter(([, enabled]) => enabled)\n .flatMap(([type]) => FILE_TYPE_ACCEPT[type] || [])\n .join(',');\n\n // Auto-resize textarea\n const handleInput = useCallback(() => {\n const textarea = textareaRef.current;\n if (textarea) {\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, 120)}px`;\n }\n }, []);\n\n // Handle send\n const handleSend = useCallback(() => {\n const trimmedMessage = message.trim();\n if (!trimmedMessage && files.length === 0) return;\n\n onSend(\n trimmedMessage,\n files.length > 0 ? files : undefined,\n transcriptId ? { transcriptId } : undefined,\n );\n setMessage('');\n setFiles([]);\n setTranscriptId(undefined);\n\n // Reset textarea height\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n }\n }, [message, files, onSend, transcriptId]);\n // Keep a fresh send fn for the deferred handoff auto-send.\n handleSendRef.current = handleSend;\n\n // --- Speech-to-text handlers ---\n\n const clearPending = useCallback(() => {\n if (pendingRafRef.current !== null) {\n cancelAnimationFrame(pendingRafRef.current);\n pendingRafRef.current = null;\n }\n setPendingSend(false);\n setPendingProgress(1);\n }, []);\n\n // Fully exit the hands-free loop and stop any recording in progress.\n const cancelHandoff = useCallback(() => {\n handoffActiveRef.current = false;\n setHandoffActive(false);\n clearPending();\n if (inactivityTimerRef.current) {\n clearTimeout(inactivityTimerRef.current);\n inactivityTimerRef.current = null;\n }\n recording.cancel();\n }, [clearPending, recording]);\n\n // One-shot recording: transcribe → fill the textarea for manual review/send.\n // No hands-free loop, so the textarea stays available afterwards.\n const startOneShotRecording = useCallback(() => {\n setSpeechError(null);\n void recording.start();\n }, [recording]);\n\n // Arm the hands-free loop and start listening.\n const startHandsfreeRecording = useCallback(() => {\n setSpeechError(null);\n handoffActiveRef.current = true;\n setHandoffActive(true);\n void recording.start();\n }, [recording]);\n\n // Stop and reset the press-and-hold progress loop.\n const clearHold = useCallback(() => {\n if (holdRafRef.current !== null) {\n cancelAnimationFrame(holdRafRef.current);\n holdRafRef.current = null;\n }\n setIsHolding(false);\n setHoldProgress(0);\n }, []);\n\n // Mic pressed: when hands-free is available, run a hold timer whose ring fills\n // (0→1) over `holdMs`. Completing it activates hands-free; releasing earlier\n // (handleMicPointerUp) falls back to a one-shot recording. Pointer capture\n // keeps the release event on the button even if the finger drifts off.\n const handleMicPointerDown = useCallback(\n (e: React.PointerEvent) => {\n if (disabled || isProcessing) return;\n try {\n e.currentTarget.setPointerCapture(e.pointerId);\n } catch {\n // ignore environments without pointer capture\n }\n const holdMs = speechHandoffHoldMs ?? HANDOFF_HOLD_MS;\n holdFiredRef.current = false;\n setIsHolding(true);\n setHoldProgress(0);\n const startedAt = Date.now();\n const step = () => {\n const progress = Math.min(1, (Date.now() - startedAt) / holdMs);\n setHoldProgress(progress);\n if (progress >= 1) {\n holdRafRef.current = null;\n holdFiredRef.current = true;\n setIsHolding(false);\n setHoldProgress(0);\n startHandsfreeRecording();\n return;\n }\n holdRafRef.current = requestAnimationFrame(step);\n };\n holdRafRef.current = requestAnimationFrame(step);\n },\n [disabled, isProcessing, speechHandoffHoldMs, startHandsfreeRecording],\n );\n\n // Mic released: if the hold already armed hands-free, do nothing; otherwise\n // treat it as a tap and start a one-shot recording.\n const handleMicPointerUp = useCallback(() => {\n if (holdFiredRef.current) {\n holdFiredRef.current = false;\n return;\n }\n if (holdRafRef.current === null && !isHolding) return; // already aborted\n clearHold();\n startOneShotRecording();\n }, [isHolding, clearHold, startOneShotRecording]);\n\n // Pointer cancelled (e.g. interrupted touch): abort the hold without recording.\n const handleMicPointerCancel = useCallback(() => {\n if (holdFiredRef.current) {\n holdFiredRef.current = false;\n return;\n }\n clearHold();\n }, [clearHold]);\n\n const cancelRecording = useCallback(() => {\n cancelHandoff();\n }, [cancelHandoff]);\n\n // Stop recording, transcribe the audio and fill the input for review.\n // Returns the trimmed transcription (or null if nothing was transcribed) so\n // the handoff loop can decide whether to auto-send or end.\n const confirmRecording = useCallback(async (): Promise<string | null> => {\n if (!transcribeClient) return null;\n const blob = await recording.stop();\n if (!blob || blob.size === 0) return null;\n\n setIsTranscribing(true);\n setSpeechError(null);\n try {\n const result = await transcribeClient.transcribeAudio(blob, {\n language: speechLanguage,\n tenantId: speechTenantId,\n });\n const text = (result.text || '').trim();\n if (text) {\n setMessage((prev) => (prev ? `${prev} ${text}`.trim() : text));\n setTranscriptId(result.transcriptId);\n }\n // Resize textarea and focus for review/edit.\n requestAnimationFrame(() => {\n const textarea = textareaRef.current;\n if (textarea) {\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, 120)}px`;\n textarea.focus();\n }\n });\n return text;\n } catch (e) {\n setSpeechError(\n `Could not transcribe the audio: ${(e as Error)?.message || 'unknown error'}`,\n );\n return null;\n } finally {\n setIsTranscribing(false);\n }\n }, [transcribeClient, recording, speechLanguage, speechTenantId]);\n\n // Cancellable countdown, then auto-send. Handoff stays active across the send\n // so the loop can continue after the assistant replies.\n const startPendingSend = useCallback(() => {\n const totalMs = speechHandoffSendDelayMs ?? HANDOFF_PENDING_MS;\n setPendingSend(true);\n setPendingProgress(1);\n const startedAt = Date.now();\n const step = () => {\n const elapsed = Date.now() - startedAt;\n setPendingProgress(Math.max(0, 1 - elapsed / totalMs));\n if (elapsed >= totalMs) {\n pendingRafRef.current = null;\n setPendingSend(false);\n setPendingProgress(1);\n handleSendRef.current(); // auto-send with the freshest message\n return;\n }\n pendingRafRef.current = requestAnimationFrame(step);\n };\n pendingRafRef.current = requestAnimationFrame(step);\n }, [speechHandoffSendDelayMs]);\n\n // Drives both the mic auto-stop and the manual confirm button, branching on\n // whether the hands-free loop is active.\n const handleConfirm = useCallback(async () => {\n const text = await confirmRecording();\n if (!handoffActiveRef.current) return; // normal mode: input already filled\n if (!text) {\n // Silent / empty turn → end the hands-free loop.\n cancelHandoff();\n setMessage('');\n setTranscriptId(undefined);\n return;\n }\n startPendingSend();\n }, [confirmRecording, cancelHandoff, startPendingSend]);\n\n // Auto-stop fires handleConfirm with the freshest closure.\n useEffect(() => {\n confirmRef.current = () => void handleConfirm();\n }, [handleConfirm]);\n\n // Any interaction during the pending countdown cancels the auto-send and\n // exits the loop (the user is taking manual control); text stays for editing.\n useEffect(() => {\n if (!pendingSend) return;\n const onInteract = () => {\n clearPending();\n handoffActiveRef.current = false;\n setHandoffActive(false);\n requestAnimationFrame(() => textareaRef.current?.focus());\n };\n document.addEventListener('mousedown', onInteract, true);\n document.addEventListener('keydown', onInteract, true);\n return () => {\n document.removeEventListener('mousedown', onInteract, true);\n document.removeEventListener('keydown', onInteract, true);\n };\n }, [pendingSend, clearPending]);\n\n // When the assistant finishes (isProcessing falls) while the loop is active,\n // re-activate listening for the next turn.\n useEffect(() => {\n const wasProcessing = prevProcessingRef.current;\n prevProcessingRef.current = isProcessing;\n if (\n handoffActive &&\n wasProcessing &&\n !isProcessing &&\n !disabled &&\n !pendingSend &&\n !isTranscribing &&\n !recording.isRecording &&\n !recording.isPaused\n ) {\n void recording.start();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isProcessing, handoffActive, disabled, pendingSend, isTranscribing]);\n\n // While listening in handoff with no speech yet, end the loop after a silence\n // window (an open mic with nothing said means the user is done).\n useEffect(() => {\n if (!(handoffActive && recording.isRecording && !recording.speechDetected)) {\n if (inactivityTimerRef.current) {\n clearTimeout(inactivityTimerRef.current);\n inactivityTimerRef.current = null;\n }\n return;\n }\n inactivityTimerRef.current = setTimeout(() => {\n if (handoffActiveRef.current && !recording.speechDetected) cancelHandoff();\n }, HANDOFF_INACTIVITY_MS);\n return () => {\n if (inactivityTimerRef.current) {\n clearTimeout(inactivityTimerRef.current);\n inactivityTimerRef.current = null;\n }\n };\n }, [handoffActive, recording.isRecording, recording.speechDetected, cancelHandoff]);\n\n // Cleanup deferred work on unmount.\n useEffect(() => {\n return () => {\n if (pendingRafRef.current !== null) cancelAnimationFrame(pendingRafRef.current);\n if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);\n if (holdRafRef.current !== null) cancelAnimationFrame(holdRafRef.current);\n };\n }, []);\n\n // Handle key press\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n handleSend();\n }\n },\n [handleSend]\n );\n\n // Handle file selection\n const handleFileSelect = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const selectedFiles = Array.from(e.target.files || []);\n\n // Filter valid files\n const validFiles = selectedFiles.filter((file) => {\n if (file.size > maxFileSize) {\n console.warn(`File ${file.name} exceeds maximum size`);\n return false;\n }\n return true;\n });\n\n setFiles((prev) => [...prev, ...validFiles]);\n\n // Reset input\n if (fileInputRef.current) {\n fileInputRef.current.value = '';\n }\n },\n [maxFileSize]\n );\n\n // Remove file\n const removeFile = useCallback((index: number) => {\n setFiles((prev) => prev.filter((_, i) => i !== index));\n }, []);\n\n return (\n <div className=\"devic-input-area\">\n {limitBanner}\n {usageBar}\n {disabledMessage && disabled && (\n <div className=\"devic-input-disabled-notice\">\n <WaitingIcon />\n {disabledMessage}\n </div>\n )}\n {speechError && (\n <div className=\"devic-speech-error\" role=\"alert\">\n {speechError}\n </div>\n )}\n {handoffActive && (\n <div className=\"devic-handoff-bar\" data-waiting={isProcessing ? 'true' : 'false'}>\n <span className=\"devic-handoff-dot\" aria-hidden=\"true\" />\n <span className=\"devic-handoff-label\">\n {isProcessing ? 'Hands-free · waiting for reply' : 'Hands-free on'}\n </span>\n <button\n type=\"button\"\n className=\"devic-handoff-stop\"\n onClick={cancelHandoff}\n title=\"Stop hands-free\"\n aria-label=\"Stop hands-free\"\n >\n <CloseIcon />\n </button>\n </div>\n )}\n {references && references.length > 0 && (\n <div className=\"devic-reference-chips\">\n {references.map((ref) => (\n <ReferenceChip\n key={ref.id}\n label={ref.label}\n variant=\"input\"\n onRemove={() => onRemoveReference?.(ref.id)}\n />\n ))}\n </div>\n )}\n {files.length > 0 && (\n <div className=\"devic-file-preview\">\n {files.map((file, idx) => (\n <div key={idx} className=\"devic-file-preview-item\">\n <FileIcon />\n <span>{file.name}</span>\n <button\n className=\"devic-file-remove\"\n onClick={() => removeFile(idx)}\n type=\"button\"\n >\n &times;\n </button>\n </div>\n ))}\n </div>\n )}\n\n <div className=\"devic-input-wrapper\">\n {pendingSend ? (\n <div className=\"devic-speech-panel\" data-state=\"pending\">\n <div className=\"devic-handoff-pending\">\n <div className=\"devic-handoff-pending-icon\">\n <SendCountdownRing progress={pendingProgress} />\n <SendIcon />\n </div>\n <div className=\"devic-handoff-pending-text\">\n <span className=\"devic-handoff-pending-title\">\n Sending… interact to cancel\n </span>\n {message.trim() && (\n <span className=\"devic-handoff-pending-preview\">{message.trim()}</span>\n )}\n </div>\n </div>\n </div>\n ) : isTranscribing ? (\n <div className=\"devic-speech-panel\" data-state=\"processing\">\n <span className=\"devic-speech-spinner\" aria-hidden=\"true\" />\n <span className=\"devic-speech-status\">Transcribing…</span>\n </div>\n ) : isRecordingActive ? (\n <div className=\"devic-speech-panel\" data-state=\"recording\">\n <button\n className=\"devic-input-btn devic-speech-cancel\"\n onClick={cancelRecording}\n type=\"button\"\n title=\"Cancel recording\"\n >\n <CloseIcon />\n </button>\n <div className=\"devic-speech-live\">\n <Equalizer levels={recording.levels} paused={recording.isPaused} />\n <span className=\"devic-speech-timer\">\n {formatDuration(recording.durationMs)}\n </span>\n </div>\n <button\n className=\"devic-input-btn\"\n onClick={recording.isPaused ? recording.resume : recording.pause}\n type=\"button\"\n title={recording.isPaused ? 'Resume' : 'Pause'}\n >\n {recording.isPaused ? <PlayIcon /> : <PauseIcon />}\n </button>\n <div\n className=\"devic-speech-confirm-wrap\"\n data-autostop={recording.isAutoStopping ? 'true' : 'false'}\n >\n {recording.isAutoStopping && (\n <AutoStopRing progress={recording.autoStopProgress} />\n )}\n <button\n className=\"devic-input-btn devic-speech-confirm\"\n onClick={() => void handleConfirm()}\n type=\"button\"\n title={\n recording.isAutoStopping\n ? 'Auto-sending… keep talking to cancel'\n : 'Confirm'\n }\n >\n <CheckIcon />\n </button>\n </div>\n </div>\n ) : (\n <>\n {enableFileUploads && (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept={acceptedTypes}\n multiple\n onChange={handleFileSelect}\n style={{ display: 'none' }}\n />\n <button\n className=\"devic-input-btn\"\n onClick={() => fileInputRef.current?.click()}\n disabled={disabled}\n type=\"button\"\n title=\"Attach file\"\n >\n <AttachIcon />\n </button>\n </>\n )}\n\n {speechEnabled && (\n <div\n className=\"devic-speech-mic-wrap\"\n data-holding={isHolding ? 'true' : 'false'}\n >\n {isHolding && <HoldRing progress={holdProgress} />}\n <button\n className=\"devic-input-btn devic-speech-mic\"\n onClick={speechHandoff ? undefined : startOneShotRecording}\n onPointerDown={speechHandoff ? handleMicPointerDown : undefined}\n onPointerUp={speechHandoff ? handleMicPointerUp : undefined}\n onPointerCancel={speechHandoff ? handleMicPointerCancel : undefined}\n disabled={disabled || isProcessing}\n type=\"button\"\n title={\n speechHandoff\n ? 'Tap to dictate · hold to start hands-free'\n : 'Record voice message'\n }\n >\n <MicIcon />\n </button>\n </div>\n )}\n\n <textarea\n ref={textareaRef}\n className=\"devic-input\"\n value={message}\n onChange={(e) => {\n const value = e.target.value;\n setMessage(value);\n // If the user clears the field, drop the transcript link so a fresh\n // message isn't wrongly attributed to the previous transcription.\n if (transcriptId && value.trim() === '') setTranscriptId(undefined);\n handleInput();\n }}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={disabled}\n rows={1}\n />\n\n {isProcessing ? (\n stopButtonContent ? (\n <div className=\"devic-send-btn-wrapper\">\n <div className=\"devic-send-btn-custom\" aria-hidden=\"true\">\n {stopButtonContent}\n </div>\n <button\n className=\"devic-send-btn-overlay\"\n onClick={onStop}\n type=\"button\"\n title=\"Stop\"\n />\n </div>\n ) : (\n <button\n className=\"devic-input-btn devic-stop-btn\"\n onClick={onStop}\n type=\"button\"\n title=\"Stop\"\n >\n <StopIcon />\n </button>\n )\n ) : sendButtonContent ? (\n <div className=\"devic-send-btn-wrapper\">\n <div className=\"devic-send-btn-custom\" aria-hidden=\"true\">\n {sendButtonContent}\n </div>\n <button\n className=\"devic-send-btn-overlay\"\n onClick={handleSend}\n disabled={disabled || (!message.trim() && files.length === 0)}\n type=\"button\"\n title=\"Send message\"\n />\n </div>\n ) : (\n <button\n className=\"devic-input-btn devic-send-btn\"\n onClick={handleSend}\n disabled={disabled || (!message.trim() && files.length === 0)}\n type=\"button\"\n title=\"Send message\"\n >\n <SendIcon />\n </button>\n )}\n </>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Live equalizer rendered from the recording amplitude levels (0..1 per bar).\n * When paused, bars collapse to a flat baseline.\n */\nfunction Equalizer({\n levels,\n paused,\n}: {\n levels: number[];\n paused: boolean;\n}): JSX.Element {\n return (\n <div className=\"devic-equalizer\" aria-hidden=\"true\" data-paused={paused}>\n {levels.map((level, i) => (\n <span\n key={i}\n className=\"devic-equalizer-bar\"\n style={{ height: `${Math.max(10, Math.round((paused ? 0 : level) * 100))}%` }}\n />\n ))}\n </div>\n );\n}\n\n// Geometry for the auto-stop ring drawn around the confirm button.\nconst AUTOSTOP_RING_R = 18;\nconst AUTOSTOP_RING_C = 2 * Math.PI * AUTOSTOP_RING_R;\n\n/**\n * Inverted circular progress drawn around the confirm button. Driven by\n * `progress` (1 → 0): a full ring that drains to empty over the countdown.\n */\nfunction AutoStopRing({ progress }: { progress: number }): JSX.Element {\n return (\n <svg className=\"devic-autostop-ring\" viewBox=\"0 0 40 40\" aria-hidden=\"true\">\n <circle\n className=\"devic-autostop-ring-track\"\n cx=\"20\"\n cy=\"20\"\n r={AUTOSTOP_RING_R}\n />\n <circle\n className=\"devic-autostop-ring-progress\"\n cx=\"20\"\n cy=\"20\"\n r={AUTOSTOP_RING_R}\n style={{\n strokeDasharray: AUTOSTOP_RING_C,\n strokeDashoffset: AUTOSTOP_RING_C * (1 - progress),\n }}\n />\n </svg>\n );\n}\n\n/**\n * Draining ring around the send icon during the handoff pending countdown.\n * Visually distinct from the auto-stop ring (slate→primary track, larger).\n */\nfunction SendCountdownRing({ progress }: { progress: number }): JSX.Element {\n return (\n <svg className=\"devic-handoff-ring\" viewBox=\"0 0 44 44\" aria-hidden=\"true\">\n <circle className=\"devic-handoff-ring-track\" cx=\"22\" cy=\"22\" r={AUTOSTOP_RING_R} />\n <circle\n className=\"devic-handoff-ring-progress\"\n cx=\"22\"\n cy=\"22\"\n r={AUTOSTOP_RING_R}\n style={{\n strokeDasharray: AUTOSTOP_RING_C,\n strokeDashoffset: AUTOSTOP_RING_C * (1 - progress),\n }}\n />\n </svg>\n );\n}\n\n/**\n * Filling ring drawn around the mic button while the user presses and holds to\n * arm hands-free. Driven by `progress` (0 → 1): an empty ring that fills\n * clockwise over the hold duration. Inverse of the draining auto-stop ring.\n */\nfunction HoldRing({ progress }: { progress: number }): JSX.Element {\n return (\n <svg className=\"devic-mic-hold-ring\" viewBox=\"0 0 40 40\" aria-hidden=\"true\">\n <circle\n className=\"devic-mic-hold-ring-track\"\n cx=\"20\"\n cy=\"20\"\n r={AUTOSTOP_RING_R}\n />\n <circle\n className=\"devic-mic-hold-ring-progress\"\n cx=\"20\"\n cy=\"20\"\n r={AUTOSTOP_RING_R}\n style={{\n strokeDasharray: AUTOSTOP_RING_C,\n strokeDashoffset: AUTOSTOP_RING_C * (1 - progress),\n }}\n />\n </svg>\n );\n}\n\n/** Formats milliseconds as m:ss. */\nfunction formatDuration(ms: number): string {\n const totalSeconds = Math.floor(ms / 1000);\n const minutes = Math.floor(totalSeconds / 60);\n const seconds = totalSeconds % 60;\n return `${minutes}:${seconds.toString().padStart(2, '0')}`;\n}\n\n/**\n * Attach icon\n */\nfunction AttachIcon(): JSX.Element {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48\" />\n </svg>\n );\n}\n\n/**\n * Send icon\n */\nfunction SendIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path d=\"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z\" />\n </svg>\n );\n}\n\n/**\n * File icon\n */\nfunction FileIcon(): JSX.Element {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n <polyline points=\"14,2 14,8 20,8\" />\n </svg>\n );\n}\n\n/**\n * Microphone icon\n */\nfunction MicIcon(): JSX.Element {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"23\" />\n <line x1=\"8\" y1=\"23\" x2=\"16\" y2=\"23\" />\n </svg>\n );\n}\n\n/**\n * Pause icon (two bars)\n */\nfunction PauseIcon(): JSX.Element {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <rect x=\"6\" y=\"4\" width=\"4\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"4\" height=\"16\" rx=\"1\" />\n </svg>\n );\n}\n\n/**\n * Play icon (triangle)\n */\nfunction PlayIcon(): JSX.Element {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M8 5v14l11-7z\" />\n </svg>\n );\n}\n\n/**\n * Check icon (confirm)\n */\nfunction CheckIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n );\n}\n\n/**\n * Close icon (cancel)\n */\nfunction CloseIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/**\n * Stop icon (square)\n */\nfunction StopIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\n/**\n * Waiting icon (clock)\n */\nfunction WaitingIcon(): JSX.Element {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12,6 12,12 16,14\" />\n </svg>\n );\n}\n"],"names":["_jsx","useState","useRef","useSpeechRecording","useMemo","DevicApiClient","useCallback","useEffect","_jsxs","ReferenceChip","_Fragment"],"mappings":";;;;;;;;AAMA,MAAM,gBAAgB,GAA6B;IACjD,MAAM,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC;AAC9D,IAAA,SAAS,EAAE;QACT,iBAAiB;QACjB,oBAAoB;QACpB,yEAAyE;QACzE,YAAY;QACZ,UAAU;AACX,KAAA;AACD,IAAA,KAAK,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,CAAC;AAC/C,IAAA,KAAK,EAAE,CAAC,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,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,cAAc,YAEnBA,cAAA,CAAA,MAAA,EAAA,EAAM,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAA,CAAG,EAAA,CAC9C;AAEV;AAEA;;AAEG;AACH,SAAS,WAAW,GAAA;IAClB,QACEQ,eAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EAAA,QAAA,EAAA,CAEtBR,cAAA,CAAA,QAAA,EAAA,EAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,EAAA,CAAG,EACjCA,cAAA,CAAA,UAAA,EAAA,EAAU,MAAM,EAAC,kBAAkB,EAAA,CAAG,CAAA,EAAA,CAClC;AAEV;;;;"}
1
+ {"version":3,"file":"ChatInput.js","sources":["../../../../../src/components/ChatDrawer/ChatInput.tsx"],"sourcesContent":["import React, { useState, useRef, useCallback, useMemo, useEffect } from 'react';\nimport type { ChatInputProps } from './ChatDrawer.types';\nimport { useSpeechRecording } from '../../hooks/useSpeechRecording';\nimport { DevicApiClient } from '../../api/client';\nimport { ReferenceChip } from './ReferenceChip';\nimport {\n toPastedBlock,\n pastedPreview,\n pastedLineCount,\n type PastedText,\n} from './pastedText';\n\nconst FILE_TYPE_ACCEPT: Record<string, string[]> = {\n images: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],\n documents: [\n 'application/pdf',\n 'application/msword',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'text/plain',\n 'text/csv',\n ],\n audio: ['audio/mpeg', 'audio/wav', 'audio/ogg'],\n video: ['video/mp4', 'video/webm', 'video/ogg'],\n};\n\n// Extensions used to name images pasted from the clipboard, which arrive with a\n// generic name (\"image.png\") or none at all.\nconst IMAGE_EXT_BY_MIME: Record<string, string> = {\n 'image/jpeg': 'jpg',\n 'image/png': 'png',\n 'image/gif': 'gif',\n 'image/webp': 'webp',\n};\n\n// Handoff (hands-free) loop timings.\nconst HANDOFF_PENDING_MS = 1000; // default cancellable countdown before auto-send\nconst HANDOFF_INACTIVITY_MS = 6000; // silence (no speech) that ends the loop\nconst HANDOFF_HOLD_MS = 3000; // press-and-hold duration on the mic to arm hands-free\n\n/**\n * Chat input component with file upload support\n */\nexport function ChatInput({\n onSend,\n disabled = false,\n placeholder = 'Type a message...',\n enableFileUploads = false,\n allowedFileTypes = { images: true, documents: true },\n maxFileSize = 10 * 1024 * 1024, // 10MB\n enableLongTextPaste = false,\n longTextPasteThreshold = 2000,\n enableSpeechToText = false,\n speechLanguage,\n speechTenantId,\n speechAutoStop = true,\n speechAutoStopCountdownMs,\n speechAutoStopSilenceMs,\n speechAutoStopSilenceRatio,\n speechAutoStopSilenceLevel,\n speechAutoStopSpeechLevel,\n speechHandoff = false,\n speechHandoffSendDelayMs,\n speechHandoffHoldMs,\n apiKey,\n baseUrl,\n sendButtonContent,\n disabledMessage,\n isProcessing = false,\n onStop,\n stopButtonContent,\n pendingInputWidget,\n onSubmitWidget,\n onCancelWidget,\n references,\n onRemoveReference,\n usageBar,\n limitBanner,\n}: ChatInputProps): JSX.Element {\n // When a widget is pending as 'input', render it in place of the textarea\n if (pendingInputWidget) {\n const WidgetComponent = pendingInputWidget.widget.component;\n return (\n <div className=\"devic-input-area\" data-widget-mode=\"input\">\n <div className=\"devic-input-widget\" data-tool-name={pendingInputWidget.toolName}>\n <WidgetComponent\n toolCall={pendingInputWidget.toolCall}\n params={pendingInputWidget.params}\n submit={(response) => onSubmitWidget?.(pendingInputWidget.toolCall.id, response)}\n cancel={(reason) => onCancelWidget?.(pendingInputWidget.toolCall.id, reason)}\n />\n </div>\n </div>\n );\n }\n const [message, setMessage] = useState('');\n const [files, setFiles] = useState<File[]>([]);\n // Long blocks of pasted text, kept out of the textarea and shown as cards.\n const [pastedTexts, setPastedTexts] = useState<PastedText[]>([]);\n const [isDraggingOver, setIsDraggingOver] = useState(false);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const fileInputRef = useRef<HTMLInputElement>(null);\n // Monotonic counters so pasted images and text blocks get stable, unique ids.\n const pasteCounterRef = useRef(0);\n // Nested dragenter/dragleave events fire per child node; count them so the\n // overlay only clears when the pointer truly leaves the input area.\n const dragDepthRef = useRef(0);\n\n // Speech-to-text state\n const [transcriptId, setTranscriptId] = useState<string | undefined>();\n const [isTranscribing, setIsTranscribing] = useState(false);\n const [speechError, setSpeechError] = useState<string | null>(null);\n // Holds the latest confirmRecording so the auto-stop callback (created before\n // confirmRecording is defined) always calls the current closure.\n const confirmRef = useRef<() => void>(() => {});\n const recording = useSpeechRecording({\n bars: 5,\n autoStop: speechAutoStop,\n ...(speechAutoStopCountdownMs != null && {\n autoStopCountdownMs: speechAutoStopCountdownMs,\n }),\n ...(speechAutoStopSilenceMs != null && {\n autoStopSilenceMs: speechAutoStopSilenceMs,\n }),\n ...(speechAutoStopSilenceRatio != null && {\n autoStopSilenceRatio: speechAutoStopSilenceRatio,\n }),\n ...(speechAutoStopSilenceLevel != null && {\n autoStopSilenceLevel: speechAutoStopSilenceLevel,\n }),\n ...(speechAutoStopSpeechLevel != null && {\n autoStopSpeechLevel: speechAutoStopSpeechLevel,\n }),\n onAutoStop: () => confirmRef.current(),\n });\n\n // --- Handoff (hands-free loop) state ---\n const [handoffActive, setHandoffActive] = useState(false);\n const [pendingSend, setPendingSend] = useState(false);\n const [pendingProgress, setPendingProgress] = useState(1);\n // Ref mirror so async callbacks (rAF, timers, document listeners) read the\n // live value without going stale.\n const handoffActiveRef = useRef(false);\n const pendingRafRef = useRef<number | null>(null);\n const inactivityTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const prevProcessingRef = useRef(isProcessing);\n // Always-fresh send fn so the deferred auto-send uses the latest message.\n const handleSendRef = useRef<() => void>(() => {});\n\n // --- Press-and-hold to arm hands-free ---\n // Holding the mic for `holdMs` fills a ring (0→1) and activates hands-free;\n // releasing earlier falls back to a single one-shot recording.\n const [holdProgress, setHoldProgress] = useState(0);\n const [isHolding, setIsHolding] = useState(false);\n const holdRafRef = useRef<number | null>(null);\n const holdFiredRef = useRef(false);\n\n // Client used only for the /whisper transcription call.\n const transcribeClient = useMemo(() => {\n if (!enableSpeechToText || !apiKey) return null;\n return new DevicApiClient({\n apiKey,\n baseUrl: baseUrl || 'https://api.devic.ai',\n });\n }, [enableSpeechToText, apiKey, baseUrl]);\n\n const speechEnabled =\n enableSpeechToText && recording.isSupported && !!transcribeClient;\n const isRecordingActive = recording.isRecording || recording.isPaused;\n\n // Calculate accepted file types\n const acceptedTypeList = useMemo(\n () =>\n Object.entries(allowedFileTypes)\n .filter(([, enabled]) => enabled)\n .flatMap(([type]) => FILE_TYPE_ACCEPT[type] || []),\n [allowedFileTypes]\n );\n const acceptedTypes = acceptedTypeList.join(',');\n\n // Single entry point for every way of attaching a file (button, paste, drop):\n // enforces the size limit and the allowed MIME types, which until now were\n // only hinted at the native file dialog and never actually checked.\n const addFiles = useCallback(\n (incoming: File[]) => {\n const validFiles = incoming.filter((file) => {\n if (file.size > maxFileSize) {\n console.warn(`File ${file.name} exceeds maximum size`);\n return false;\n }\n if (acceptedTypeList.length > 0 && !acceptedTypeList.includes(file.type)) {\n console.warn(`File type ${file.type || 'unknown'} is not allowed`);\n return false;\n }\n return true;\n });\n if (validFiles.length > 0) setFiles((prev) => [...prev, ...validFiles]);\n },\n [maxFileSize, acceptedTypeList]\n );\n\n // Thumbnails for attached images. The cleanup revokes the previous batch on\n // every change (and on unmount), so the object URLs never leak.\n const filePreviews = useMemo(\n () =>\n files.map((file) =>\n file.type.startsWith('image/') ? URL.createObjectURL(file) : null\n ),\n [files]\n );\n useEffect(\n () => () => {\n filePreviews.forEach((url) => url && URL.revokeObjectURL(url));\n },\n [filePreviews]\n );\n\n // Auto-resize textarea\n const handleInput = useCallback(() => {\n const textarea = textareaRef.current;\n if (textarea) {\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, 120)}px`;\n }\n }, []);\n\n // Handle send\n const handleSend = useCallback(() => {\n const trimmedMessage = message.trim();\n if (!trimmedMessage && files.length === 0 && pastedTexts.length === 0) return;\n\n // Pasted text is shown as a card but still reaches the model in full: each\n // block is prepended to the message inside a delimiter the thread can parse\n // back out (see parsePastedBlocks in ChatMessages).\n const composedMessage =\n pastedTexts.length > 0\n ? [...pastedTexts.map(toPastedBlock), trimmedMessage]\n .filter(Boolean)\n .join('\\n\\n')\n : trimmedMessage;\n\n onSend(\n composedMessage,\n files.length > 0 ? files : undefined,\n transcriptId ? { transcriptId } : undefined,\n );\n setMessage('');\n setFiles([]);\n setPastedTexts([]);\n setTranscriptId(undefined);\n\n // Reset textarea height\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n }\n }, [message, files, pastedTexts, onSend, transcriptId]);\n // Keep a fresh send fn for the deferred handoff auto-send.\n handleSendRef.current = handleSend;\n\n // --- Speech-to-text handlers ---\n\n const clearPending = useCallback(() => {\n if (pendingRafRef.current !== null) {\n cancelAnimationFrame(pendingRafRef.current);\n pendingRafRef.current = null;\n }\n setPendingSend(false);\n setPendingProgress(1);\n }, []);\n\n // Fully exit the hands-free loop and stop any recording in progress.\n const cancelHandoff = useCallback(() => {\n handoffActiveRef.current = false;\n setHandoffActive(false);\n clearPending();\n if (inactivityTimerRef.current) {\n clearTimeout(inactivityTimerRef.current);\n inactivityTimerRef.current = null;\n }\n recording.cancel();\n }, [clearPending, recording]);\n\n // One-shot recording: transcribe → fill the textarea for manual review/send.\n // No hands-free loop, so the textarea stays available afterwards.\n const startOneShotRecording = useCallback(() => {\n setSpeechError(null);\n void recording.start();\n }, [recording]);\n\n // Arm the hands-free loop and start listening.\n const startHandsfreeRecording = useCallback(() => {\n setSpeechError(null);\n handoffActiveRef.current = true;\n setHandoffActive(true);\n void recording.start();\n }, [recording]);\n\n // Stop and reset the press-and-hold progress loop.\n const clearHold = useCallback(() => {\n if (holdRafRef.current !== null) {\n cancelAnimationFrame(holdRafRef.current);\n holdRafRef.current = null;\n }\n setIsHolding(false);\n setHoldProgress(0);\n }, []);\n\n // Mic pressed: when hands-free is available, run a hold timer whose ring fills\n // (0→1) over `holdMs`. Completing it activates hands-free; releasing earlier\n // (handleMicPointerUp) falls back to a one-shot recording. Pointer capture\n // keeps the release event on the button even if the finger drifts off.\n const handleMicPointerDown = useCallback(\n (e: React.PointerEvent) => {\n if (disabled || isProcessing) return;\n try {\n e.currentTarget.setPointerCapture(e.pointerId);\n } catch {\n // ignore environments without pointer capture\n }\n const holdMs = speechHandoffHoldMs ?? HANDOFF_HOLD_MS;\n holdFiredRef.current = false;\n setIsHolding(true);\n setHoldProgress(0);\n const startedAt = Date.now();\n const step = () => {\n const progress = Math.min(1, (Date.now() - startedAt) / holdMs);\n setHoldProgress(progress);\n if (progress >= 1) {\n holdRafRef.current = null;\n holdFiredRef.current = true;\n setIsHolding(false);\n setHoldProgress(0);\n startHandsfreeRecording();\n return;\n }\n holdRafRef.current = requestAnimationFrame(step);\n };\n holdRafRef.current = requestAnimationFrame(step);\n },\n [disabled, isProcessing, speechHandoffHoldMs, startHandsfreeRecording],\n );\n\n // Mic released: if the hold already armed hands-free, do nothing; otherwise\n // treat it as a tap and start a one-shot recording.\n const handleMicPointerUp = useCallback(() => {\n if (holdFiredRef.current) {\n holdFiredRef.current = false;\n return;\n }\n if (holdRafRef.current === null && !isHolding) return; // already aborted\n clearHold();\n startOneShotRecording();\n }, [isHolding, clearHold, startOneShotRecording]);\n\n // Pointer cancelled (e.g. interrupted touch): abort the hold without recording.\n const handleMicPointerCancel = useCallback(() => {\n if (holdFiredRef.current) {\n holdFiredRef.current = false;\n return;\n }\n clearHold();\n }, [clearHold]);\n\n const cancelRecording = useCallback(() => {\n cancelHandoff();\n }, [cancelHandoff]);\n\n // Stop recording, transcribe the audio and fill the input for review.\n // Returns the trimmed transcription (or null if nothing was transcribed) so\n // the handoff loop can decide whether to auto-send or end.\n const confirmRecording = useCallback(async (): Promise<string | null> => {\n if (!transcribeClient) return null;\n const blob = await recording.stop();\n if (!blob || blob.size === 0) return null;\n\n setIsTranscribing(true);\n setSpeechError(null);\n try {\n const result = await transcribeClient.transcribeAudio(blob, {\n language: speechLanguage,\n tenantId: speechTenantId,\n });\n const text = (result.text || '').trim();\n if (text) {\n setMessage((prev) => (prev ? `${prev} ${text}`.trim() : text));\n setTranscriptId(result.transcriptId);\n }\n // Resize textarea and focus for review/edit.\n requestAnimationFrame(() => {\n const textarea = textareaRef.current;\n if (textarea) {\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, 120)}px`;\n textarea.focus();\n }\n });\n return text;\n } catch (e) {\n setSpeechError(\n `Could not transcribe the audio: ${(e as Error)?.message || 'unknown error'}`,\n );\n return null;\n } finally {\n setIsTranscribing(false);\n }\n }, [transcribeClient, recording, speechLanguage, speechTenantId]);\n\n // Cancellable countdown, then auto-send. Handoff stays active across the send\n // so the loop can continue after the assistant replies.\n const startPendingSend = useCallback(() => {\n const totalMs = speechHandoffSendDelayMs ?? HANDOFF_PENDING_MS;\n setPendingSend(true);\n setPendingProgress(1);\n const startedAt = Date.now();\n const step = () => {\n const elapsed = Date.now() - startedAt;\n setPendingProgress(Math.max(0, 1 - elapsed / totalMs));\n if (elapsed >= totalMs) {\n pendingRafRef.current = null;\n setPendingSend(false);\n setPendingProgress(1);\n handleSendRef.current(); // auto-send with the freshest message\n return;\n }\n pendingRafRef.current = requestAnimationFrame(step);\n };\n pendingRafRef.current = requestAnimationFrame(step);\n }, [speechHandoffSendDelayMs]);\n\n // Drives both the mic auto-stop and the manual confirm button, branching on\n // whether the hands-free loop is active.\n const handleConfirm = useCallback(async () => {\n const text = await confirmRecording();\n if (!handoffActiveRef.current) return; // normal mode: input already filled\n if (!text) {\n // Silent / empty turn → end the hands-free loop.\n cancelHandoff();\n setMessage('');\n setTranscriptId(undefined);\n return;\n }\n startPendingSend();\n }, [confirmRecording, cancelHandoff, startPendingSend]);\n\n // Auto-stop fires handleConfirm with the freshest closure.\n useEffect(() => {\n confirmRef.current = () => void handleConfirm();\n }, [handleConfirm]);\n\n // Any interaction during the pending countdown cancels the auto-send and\n // exits the loop (the user is taking manual control); text stays for editing.\n useEffect(() => {\n if (!pendingSend) return;\n const onInteract = () => {\n clearPending();\n handoffActiveRef.current = false;\n setHandoffActive(false);\n requestAnimationFrame(() => textareaRef.current?.focus());\n };\n document.addEventListener('mousedown', onInteract, true);\n document.addEventListener('keydown', onInteract, true);\n return () => {\n document.removeEventListener('mousedown', onInteract, true);\n document.removeEventListener('keydown', onInteract, true);\n };\n }, [pendingSend, clearPending]);\n\n // When the assistant finishes (isProcessing falls) while the loop is active,\n // re-activate listening for the next turn.\n useEffect(() => {\n const wasProcessing = prevProcessingRef.current;\n prevProcessingRef.current = isProcessing;\n if (\n handoffActive &&\n wasProcessing &&\n !isProcessing &&\n !disabled &&\n !pendingSend &&\n !isTranscribing &&\n !recording.isRecording &&\n !recording.isPaused\n ) {\n void recording.start();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isProcessing, handoffActive, disabled, pendingSend, isTranscribing]);\n\n // While listening in handoff with no speech yet, end the loop after a silence\n // window (an open mic with nothing said means the user is done).\n useEffect(() => {\n if (!(handoffActive && recording.isRecording && !recording.speechDetected)) {\n if (inactivityTimerRef.current) {\n clearTimeout(inactivityTimerRef.current);\n inactivityTimerRef.current = null;\n }\n return;\n }\n inactivityTimerRef.current = setTimeout(() => {\n if (handoffActiveRef.current && !recording.speechDetected) cancelHandoff();\n }, HANDOFF_INACTIVITY_MS);\n return () => {\n if (inactivityTimerRef.current) {\n clearTimeout(inactivityTimerRef.current);\n inactivityTimerRef.current = null;\n }\n };\n }, [handoffActive, recording.isRecording, recording.speechDetected, cancelHandoff]);\n\n // Cleanup deferred work on unmount.\n useEffect(() => {\n return () => {\n if (pendingRafRef.current !== null) cancelAnimationFrame(pendingRafRef.current);\n if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);\n if (holdRafRef.current !== null) cancelAnimationFrame(holdRafRef.current);\n };\n }, []);\n\n // Handle key press\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n handleSend();\n }\n },\n [handleSend]\n );\n\n // Handle file selection\n const handleFileSelect = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n addFiles(Array.from(e.target.files || []));\n\n // Reset input\n if (fileInputRef.current) {\n fileInputRef.current.value = '';\n }\n },\n [addFiles]\n );\n\n // Remove file\n const removeFile = useCallback((index: number) => {\n setFiles((prev) => prev.filter((_, i) => i !== index));\n }, []);\n\n // Remove a pasted-text card\n const removePastedText = useCallback((id: string) => {\n setPastedTexts((prev) => prev.filter((p) => p.id !== id));\n }, []);\n\n // Paste: files in the clipboard become attachments; a long block of plain\n // text becomes a card instead of flooding the textarea.\n const handlePaste = useCallback(\n (e: React.ClipboardEvent<HTMLTextAreaElement>) => {\n const clipboard = e.clipboardData;\n if (!clipboard) return;\n\n if (enableFileUploads) {\n const pastedFiles = Array.from(clipboard.items)\n .filter((item) => item.kind === 'file')\n .map((item) => item.getAsFile())\n .filter((file): file is File => file !== null)\n .map((file) => {\n // Clipboard images share a generic name; give each one its own so\n // several pasted screenshots don't collapse into the same label.\n const ext = IMAGE_EXT_BY_MIME[file.type];\n if (!ext) return file;\n pasteCounterRef.current += 1;\n return new File([file], `pasted-image-${pasteCounterRef.current}.${ext}`, {\n type: file.type,\n });\n });\n\n if (pastedFiles.length > 0) {\n e.preventDefault();\n addFiles(pastedFiles);\n return;\n }\n }\n\n if (!enableLongTextPaste) return;\n\n const text = clipboard.getData('text/plain');\n if (text.length <= longTextPasteThreshold) return;\n\n e.preventDefault();\n pasteCounterRef.current += 1;\n setPastedTexts((prev) => [\n ...prev,\n { id: String(pasteCounterRef.current), text },\n ]);\n },\n [enableFileUploads, enableLongTextPaste, longTextPasteThreshold, addFiles]\n );\n\n // --- Drag & drop ---\n\n const handleDragEnter = useCallback(\n (e: React.DragEvent) => {\n if (!enableFileUploads || disabled) return;\n if (!e.dataTransfer.types.includes('Files')) return;\n e.preventDefault();\n dragDepthRef.current += 1;\n setIsDraggingOver(true);\n },\n [enableFileUploads, disabled]\n );\n\n const handleDragOver = useCallback(\n (e: React.DragEvent) => {\n if (!enableFileUploads || disabled) return;\n if (!e.dataTransfer.types.includes('Files')) return;\n // Without this the browser navigates away to open the dropped file.\n e.preventDefault();\n e.dataTransfer.dropEffect = 'copy';\n },\n [enableFileUploads, disabled]\n );\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n dragDepthRef.current = Math.max(0, dragDepthRef.current - 1);\n if (dragDepthRef.current === 0) setIsDraggingOver(false);\n }, []);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n if (!enableFileUploads || disabled) return;\n e.preventDefault();\n dragDepthRef.current = 0;\n setIsDraggingOver(false);\n addFiles(Array.from(e.dataTransfer.files || []));\n },\n [enableFileUploads, disabled, addFiles]\n );\n\n return (\n <div\n className=\"devic-input-area\"\n data-dragging={isDraggingOver ? 'true' : 'false'}\n onDragEnter={handleDragEnter}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n {isDraggingOver && (\n <div className=\"devic-drop-overlay\">\n <AttachIcon />\n <span>Drop files to attach</span>\n </div>\n )}\n {limitBanner}\n {usageBar}\n {disabledMessage && disabled && (\n <div className=\"devic-input-disabled-notice\">\n <WaitingIcon />\n {disabledMessage}\n </div>\n )}\n {speechError && (\n <div className=\"devic-speech-error\" role=\"alert\">\n {speechError}\n </div>\n )}\n {handoffActive && (\n <div className=\"devic-handoff-bar\" data-waiting={isProcessing ? 'true' : 'false'}>\n <span className=\"devic-handoff-dot\" aria-hidden=\"true\" />\n <span className=\"devic-handoff-label\">\n {isProcessing ? 'Hands-free · waiting for reply' : 'Hands-free on'}\n </span>\n <button\n type=\"button\"\n className=\"devic-handoff-stop\"\n onClick={cancelHandoff}\n title=\"Stop hands-free\"\n aria-label=\"Stop hands-free\"\n >\n <CloseIcon />\n </button>\n </div>\n )}\n {references && references.length > 0 && (\n <div className=\"devic-reference-chips\">\n {references.map((ref) => (\n <ReferenceChip\n key={ref.id}\n label={ref.label}\n variant=\"input\"\n onRemove={() => onRemoveReference?.(ref.id)}\n />\n ))}\n </div>\n )}\n {pastedTexts.length > 0 && (\n <div className=\"devic-pasted-cards\">\n {pastedTexts.map((pasted) => (\n <div key={pasted.id} className=\"devic-pasted-card\">\n <p className=\"devic-pasted-card-preview\">\n {pastedPreview(pasted.text)}\n </p>\n <div className=\"devic-pasted-card-footer\">\n <span className=\"devic-pasted-card-badge\">PASTED</span>\n <span className=\"devic-pasted-card-meta\">\n {pastedLineCount(pasted.text)} lines\n </span>\n </div>\n <button\n className=\"devic-file-remove devic-pasted-card-remove\"\n onClick={() => removePastedText(pasted.id)}\n type=\"button\"\n title=\"Remove pasted text\"\n aria-label=\"Remove pasted text\"\n >\n &times;\n </button>\n </div>\n ))}\n </div>\n )}\n {files.length > 0 && (\n <div className=\"devic-file-preview\">\n {files.map((file, idx) => (\n <div key={idx} className=\"devic-file-preview-item\">\n {filePreviews[idx] ? (\n <img\n className=\"devic-file-preview-thumb\"\n src={filePreviews[idx]!}\n alt={file.name}\n />\n ) : (\n <FileIcon />\n )}\n <span>{file.name}</span>\n <button\n className=\"devic-file-remove\"\n onClick={() => removeFile(idx)}\n type=\"button\"\n >\n &times;\n </button>\n </div>\n ))}\n </div>\n )}\n\n <div className=\"devic-input-wrapper\">\n {pendingSend ? (\n <div className=\"devic-speech-panel\" data-state=\"pending\">\n <div className=\"devic-handoff-pending\">\n <div className=\"devic-handoff-pending-icon\">\n <SendCountdownRing progress={pendingProgress} />\n <SendIcon />\n </div>\n <div className=\"devic-handoff-pending-text\">\n <span className=\"devic-handoff-pending-title\">\n Sending… interact to cancel\n </span>\n {message.trim() && (\n <span className=\"devic-handoff-pending-preview\">{message.trim()}</span>\n )}\n </div>\n </div>\n </div>\n ) : isTranscribing ? (\n <div className=\"devic-speech-panel\" data-state=\"processing\">\n <span className=\"devic-speech-spinner\" aria-hidden=\"true\" />\n <span className=\"devic-speech-status\">Transcribing…</span>\n </div>\n ) : isRecordingActive ? (\n <div className=\"devic-speech-panel\" data-state=\"recording\">\n <button\n className=\"devic-input-btn devic-speech-cancel\"\n onClick={cancelRecording}\n type=\"button\"\n title=\"Cancel recording\"\n >\n <CloseIcon />\n </button>\n <div className=\"devic-speech-live\">\n <Equalizer levels={recording.levels} paused={recording.isPaused} />\n <span className=\"devic-speech-timer\">\n {formatDuration(recording.durationMs)}\n </span>\n </div>\n <button\n className=\"devic-input-btn\"\n onClick={recording.isPaused ? recording.resume : recording.pause}\n type=\"button\"\n title={recording.isPaused ? 'Resume' : 'Pause'}\n >\n {recording.isPaused ? <PlayIcon /> : <PauseIcon />}\n </button>\n <div\n className=\"devic-speech-confirm-wrap\"\n data-autostop={recording.isAutoStopping ? 'true' : 'false'}\n >\n {recording.isAutoStopping && (\n <AutoStopRing progress={recording.autoStopProgress} />\n )}\n <button\n className=\"devic-input-btn devic-speech-confirm\"\n onClick={() => void handleConfirm()}\n type=\"button\"\n title={\n recording.isAutoStopping\n ? 'Auto-sending… keep talking to cancel'\n : 'Confirm'\n }\n >\n <CheckIcon />\n </button>\n </div>\n </div>\n ) : (\n <>\n {enableFileUploads && (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept={acceptedTypes}\n multiple\n onChange={handleFileSelect}\n style={{ display: 'none' }}\n />\n <button\n className=\"devic-input-btn\"\n onClick={() => fileInputRef.current?.click()}\n disabled={disabled}\n type=\"button\"\n title=\"Attach file\"\n >\n <AttachIcon />\n </button>\n </>\n )}\n\n {speechEnabled && (\n <div\n className=\"devic-speech-mic-wrap\"\n data-holding={isHolding ? 'true' : 'false'}\n >\n {isHolding && <HoldRing progress={holdProgress} />}\n <button\n className=\"devic-input-btn devic-speech-mic\"\n onClick={speechHandoff ? undefined : startOneShotRecording}\n onPointerDown={speechHandoff ? handleMicPointerDown : undefined}\n onPointerUp={speechHandoff ? handleMicPointerUp : undefined}\n onPointerCancel={speechHandoff ? handleMicPointerCancel : undefined}\n disabled={disabled || isProcessing}\n type=\"button\"\n title={\n speechHandoff\n ? 'Tap to dictate · hold to start hands-free'\n : 'Record voice message'\n }\n >\n <MicIcon />\n </button>\n </div>\n )}\n\n <textarea\n ref={textareaRef}\n className=\"devic-input\"\n value={message}\n onChange={(e) => {\n const value = e.target.value;\n setMessage(value);\n // If the user clears the field, drop the transcript link so a fresh\n // message isn't wrongly attributed to the previous transcription.\n if (transcriptId && value.trim() === '') setTranscriptId(undefined);\n handleInput();\n }}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n placeholder={placeholder}\n disabled={disabled}\n rows={1}\n />\n\n {isProcessing ? (\n stopButtonContent ? (\n <div className=\"devic-send-btn-wrapper\">\n <div className=\"devic-send-btn-custom\" aria-hidden=\"true\">\n {stopButtonContent}\n </div>\n <button\n className=\"devic-send-btn-overlay\"\n onClick={onStop}\n type=\"button\"\n title=\"Stop\"\n />\n </div>\n ) : (\n <button\n className=\"devic-input-btn devic-stop-btn\"\n onClick={onStop}\n type=\"button\"\n title=\"Stop\"\n >\n <StopIcon />\n </button>\n )\n ) : sendButtonContent ? (\n <div className=\"devic-send-btn-wrapper\">\n <div className=\"devic-send-btn-custom\" aria-hidden=\"true\">\n {sendButtonContent}\n </div>\n <button\n className=\"devic-send-btn-overlay\"\n onClick={handleSend}\n disabled={disabled || (!message.trim() && files.length === 0 && pastedTexts.length === 0)}\n type=\"button\"\n title=\"Send message\"\n />\n </div>\n ) : (\n <button\n className=\"devic-input-btn devic-send-btn\"\n onClick={handleSend}\n disabled={disabled || (!message.trim() && files.length === 0 && pastedTexts.length === 0)}\n type=\"button\"\n title=\"Send message\"\n >\n <SendIcon />\n </button>\n )}\n </>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Live equalizer rendered from the recording amplitude levels (0..1 per bar).\n * When paused, bars collapse to a flat baseline.\n */\nfunction Equalizer({\n levels,\n paused,\n}: {\n levels: number[];\n paused: boolean;\n}): JSX.Element {\n return (\n <div className=\"devic-equalizer\" aria-hidden=\"true\" data-paused={paused}>\n {levels.map((level, i) => (\n <span\n key={i}\n className=\"devic-equalizer-bar\"\n style={{ height: `${Math.max(10, Math.round((paused ? 0 : level) * 100))}%` }}\n />\n ))}\n </div>\n );\n}\n\n// Geometry for the auto-stop ring drawn around the confirm button.\nconst AUTOSTOP_RING_R = 18;\nconst AUTOSTOP_RING_C = 2 * Math.PI * AUTOSTOP_RING_R;\n\n/**\n * Inverted circular progress drawn around the confirm button. Driven by\n * `progress` (1 → 0): a full ring that drains to empty over the countdown.\n */\nfunction AutoStopRing({ progress }: { progress: number }): JSX.Element {\n return (\n <svg className=\"devic-autostop-ring\" viewBox=\"0 0 40 40\" aria-hidden=\"true\">\n <circle\n className=\"devic-autostop-ring-track\"\n cx=\"20\"\n cy=\"20\"\n r={AUTOSTOP_RING_R}\n />\n <circle\n className=\"devic-autostop-ring-progress\"\n cx=\"20\"\n cy=\"20\"\n r={AUTOSTOP_RING_R}\n style={{\n strokeDasharray: AUTOSTOP_RING_C,\n strokeDashoffset: AUTOSTOP_RING_C * (1 - progress),\n }}\n />\n </svg>\n );\n}\n\n/**\n * Draining ring around the send icon during the handoff pending countdown.\n * Visually distinct from the auto-stop ring (slate→primary track, larger).\n */\nfunction SendCountdownRing({ progress }: { progress: number }): JSX.Element {\n return (\n <svg className=\"devic-handoff-ring\" viewBox=\"0 0 44 44\" aria-hidden=\"true\">\n <circle className=\"devic-handoff-ring-track\" cx=\"22\" cy=\"22\" r={AUTOSTOP_RING_R} />\n <circle\n className=\"devic-handoff-ring-progress\"\n cx=\"22\"\n cy=\"22\"\n r={AUTOSTOP_RING_R}\n style={{\n strokeDasharray: AUTOSTOP_RING_C,\n strokeDashoffset: AUTOSTOP_RING_C * (1 - progress),\n }}\n />\n </svg>\n );\n}\n\n/**\n * Filling ring drawn around the mic button while the user presses and holds to\n * arm hands-free. Driven by `progress` (0 → 1): an empty ring that fills\n * clockwise over the hold duration. Inverse of the draining auto-stop ring.\n */\nfunction HoldRing({ progress }: { progress: number }): JSX.Element {\n return (\n <svg className=\"devic-mic-hold-ring\" viewBox=\"0 0 40 40\" aria-hidden=\"true\">\n <circle\n className=\"devic-mic-hold-ring-track\"\n cx=\"20\"\n cy=\"20\"\n r={AUTOSTOP_RING_R}\n />\n <circle\n className=\"devic-mic-hold-ring-progress\"\n cx=\"20\"\n cy=\"20\"\n r={AUTOSTOP_RING_R}\n style={{\n strokeDasharray: AUTOSTOP_RING_C,\n strokeDashoffset: AUTOSTOP_RING_C * (1 - progress),\n }}\n />\n </svg>\n );\n}\n\n/** Formats milliseconds as m:ss. */\nfunction formatDuration(ms: number): string {\n const totalSeconds = Math.floor(ms / 1000);\n const minutes = Math.floor(totalSeconds / 60);\n const seconds = totalSeconds % 60;\n return `${minutes}:${seconds.toString().padStart(2, '0')}`;\n}\n\n/**\n * Attach icon\n */\nfunction AttachIcon(): JSX.Element {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48\" />\n </svg>\n );\n}\n\n/**\n * Send icon\n */\nfunction SendIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path d=\"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z\" />\n </svg>\n );\n}\n\n/**\n * File icon\n */\nfunction FileIcon(): JSX.Element {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n <polyline points=\"14,2 14,8 20,8\" />\n </svg>\n );\n}\n\n/**\n * Microphone icon\n */\nfunction MicIcon(): JSX.Element {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"23\" />\n <line x1=\"8\" y1=\"23\" x2=\"16\" y2=\"23\" />\n </svg>\n );\n}\n\n/**\n * Pause icon (two bars)\n */\nfunction PauseIcon(): JSX.Element {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <rect x=\"6\" y=\"4\" width=\"4\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"4\" height=\"16\" rx=\"1\" />\n </svg>\n );\n}\n\n/**\n * Play icon (triangle)\n */\nfunction PlayIcon(): JSX.Element {\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M8 5v14l11-7z\" />\n </svg>\n );\n}\n\n/**\n * Check icon (confirm)\n */\nfunction CheckIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n );\n}\n\n/**\n * Close icon (cancel)\n */\nfunction CloseIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/**\n * Stop icon (square)\n */\nfunction StopIcon(): JSX.Element {\n return (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\n/**\n * Waiting icon (clock)\n */\nfunction WaitingIcon(): JSX.Element {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12,6 12,12 16,14\" />\n </svg>\n );\n}\n"],"names":["_jsx","useState","useRef","useSpeechRecording","useMemo","DevicApiClient","useCallback","useEffect","toPastedBlock","_jsxs","ReferenceChip","pastedPreview","pastedLineCount","_Fragment"],"mappings":";;;;;;;;;AAYA,MAAM,gBAAgB,GAA6B;IACjD,MAAM,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC;AAC9D,IAAA,S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