mcp-chat-ui 1.0.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 (55) hide show
  1. package/README.md +327 -0
  2. package/dist/ChatUI.d.ts +2 -0
  3. package/dist/ChatUI.js +1781 -0
  4. package/dist/components/Composer.d.ts +35 -0
  5. package/dist/components/Composer.js +19 -0
  6. package/dist/components/DocumentViewer.d.ts +24 -0
  7. package/dist/components/DocumentViewer.js +16 -0
  8. package/dist/components/FormattedText.d.ts +9 -0
  9. package/dist/components/FormattedText.js +98 -0
  10. package/dist/components/InitPanel.d.ts +41 -0
  11. package/dist/components/InitPanel.js +20 -0
  12. package/dist/components/MessageItem.d.ts +19 -0
  13. package/dist/components/MessageItem.js +50 -0
  14. package/dist/components/MessageList.d.ts +22 -0
  15. package/dist/components/MessageList.js +19 -0
  16. package/dist/components/TakeActionModal.d.ts +26 -0
  17. package/dist/components/TakeActionModal.js +26 -0
  18. package/dist/components/TaskCardsModal.d.ts +13 -0
  19. package/dist/components/TaskCardsModal.js +17 -0
  20. package/dist/components/ToolResultOverlay.d.ts +9 -0
  21. package/dist/components/ToolResultOverlay.js +14 -0
  22. package/dist/components/TopBar.d.ts +13 -0
  23. package/dist/components/TopBar.js +9 -0
  24. package/dist/components/TypingDots.d.ts +1 -0
  25. package/dist/components/TypingDots.js +8 -0
  26. package/dist/components/VoiceOverlay.d.ts +11 -0
  27. package/dist/components/VoiceOverlay.js +9 -0
  28. package/dist/config.d.ts +179 -0
  29. package/dist/config.js +24 -0
  30. package/dist/constants/chatDefaults.d.ts +19 -0
  31. package/dist/constants/chatDefaults.js +234 -0
  32. package/dist/helpers/api.d.ts +12 -0
  33. package/dist/helpers/api.js +104 -0
  34. package/dist/helpers/taskAttributes.d.ts +11 -0
  35. package/dist/helpers/taskAttributes.js +41 -0
  36. package/dist/index.d.ts +5 -0
  37. package/dist/index.js +14 -0
  38. package/dist/models/chat.types.d.ts +72 -0
  39. package/dist/models/chat.types.js +2 -0
  40. package/dist/sdkUtilities.d.ts +27 -0
  41. package/dist/sdkUtilities.js +188 -0
  42. package/dist/styles.css +1412 -0
  43. package/dist/utils/classNames.d.ts +1 -0
  44. package/dist/utils/classNames.js +6 -0
  45. package/dist/utils/format.d.ts +2 -0
  46. package/dist/utils/format.js +18 -0
  47. package/dist/utils/generateGuid.d.ts +1 -0
  48. package/dist/utils/generateGuid.js +10 -0
  49. package/dist/utils/localStorage.d.ts +6 -0
  50. package/dist/utils/localStorage.js +39 -0
  51. package/dist/utils/storageKeys.d.ts +16 -0
  52. package/dist/utils/storageKeys.js +25 -0
  53. package/dist/utils/textDirection.d.ts +2 -0
  54. package/dist/utils/textDirection.js +20 -0
  55. package/package.json +52 -0
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import type { ChatUITextConfig } from "../config";
3
+ import type { AvailableTasksCard } from "../models/chat.types";
4
+ type ComposerProps = {
5
+ fileInputRef: React.RefObject<HTMLInputElement | null>;
6
+ composerRef: React.RefObject<HTMLTextAreaElement | null>;
7
+ selectedTaskCard: AvailableTasksCard | null;
8
+ selectedFiles: File[];
9
+ onClearSelected: (index: number) => void;
10
+ onUpload: (files: FileList | null) => void;
11
+ input: string;
12
+ onInputChange: (value: string) => void;
13
+ onInputKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
14
+ onInputFocus: () => void;
15
+ inputIsRtl: boolean;
16
+ inputLocale: string;
17
+ authToken: string;
18
+ sessionId: string;
19
+ pending: boolean;
20
+ voiceMode: boolean;
21
+ voiceUploading: boolean;
22
+ waveData: number[];
23
+ onToggleVoice: () => void;
24
+ onSendMessage: () => void;
25
+ voiceError: string | null;
26
+ canSend: boolean;
27
+ onCancelVoice: () => void;
28
+ onConfirmVoice: () => void;
29
+ onAttachClick: () => void;
30
+ onClearSelectedTask: () => void;
31
+ text: ChatUITextConfig["composer"];
32
+ voiceOverlayText: ChatUITextConfig["voiceOverlay"];
33
+ };
34
+ export default function Composer({ fileInputRef, composerRef, selectedTaskCard, selectedFiles, onClearSelected, onUpload, input, onInputChange, onInputKeyDown, onInputFocus, inputIsRtl, inputLocale, authToken, sessionId, pending, voiceMode, voiceUploading, waveData, onToggleVoice, onSendMessage, voiceError, canSend, onCancelVoice, onConfirmVoice, onAttachClick, onClearSelectedTask, text, voiceOverlayText, }: ComposerProps): import("react/jsx-runtime").JSX.Element;
35
+ export {};
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = Composer;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const lucide_react_1 = require("lucide-react");
9
+ const classNames_1 = require("../utils/classNames");
10
+ const VoiceOverlay_1 = __importDefault(require("./VoiceOverlay"));
11
+ function Composer({ fileInputRef, composerRef, selectedTaskCard, selectedFiles, onClearSelected, onUpload, input, onInputChange, onInputKeyDown, onInputFocus, inputIsRtl, inputLocale, authToken, sessionId, pending, voiceMode, voiceUploading, waveData, onToggleVoice, onSendMessage, voiceError, canSend, onCancelVoice, onConfirmVoice, onAttachClick, onClearSelectedTask, text, voiceOverlayText, }) {
12
+ var _a;
13
+ return ((0, jsx_runtime_1.jsx)("div", { className: "sticky bottom-0 bg-white/95 px-2 py-4 backdrop-blur sm:px-4", children: (0, jsx_runtime_1.jsx)("div", { className: "mx-auto w-full max-w-3xl", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsx)(VoiceOverlay_1.default, { voiceMode: voiceMode, waveData: waveData, voiceUploading: voiceUploading, onCancel: onCancelVoice, onConfirm: onConfirmVoice, text: voiceOverlayText }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap items-end gap-2 rounded-full bg-white px-3 py-2 shadow-[0_10px_40px_rgba(0,0,0,0.08)] ring-1 ring-[#252525]/5 sm:flex-nowrap", children: [(0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", multiple: true, className: "hidden", onChange: (e) => onUpload(e.target.files) }), (0, jsx_runtime_1.jsx)("button", { onClick: onAttachClick, disabled: !sessionId, className: (0, classNames_1.classNames)("inline-flex h-9 w-9 items-center justify-center bg-transparent text-gray-700 transition", !sessionId && "opacity-60"), title: text.attachTitle, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "relative flex-1", children: [selectedTaskCard && ((0, jsx_runtime_1.jsx)("div", { className: "mb-2 flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-2 rounded-full bg-blue-100 px-3 py-1 text-xs font-semibold text-blue-700 shadow-sm", children: [(0, jsx_runtime_1.jsxs)("span", { children: [text.selectedTaskPrefix, String((_a = selectedTaskCard.RequestId) !== null && _a !== void 0 ? _a : "")] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "inline-flex h-4 w-4 items-center justify-center rounded-full bg-blue-700 text-blue-100 transition hover:bg-blue-800", onClick: onClearSelectedTask, title: text.selectedTaskClearTitle, "aria-label": text.selectedTaskClearTitle, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-3 w-3" }) })] }) })), selectedFiles.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "mb-2 flex flex-wrap gap-2", children: selectedFiles.map((f, i) => ((0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-2 rounded-2xl border bg-white px-3 py-1 text-xs shadow-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { className: "h-3.5 w-3.5" }), " ", f.name, (0, jsx_runtime_1.jsx)("button", { className: "rounded-full p-0.5 hover:bg-gray-100", onClick: () => onClearSelected(i), children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-3.5 w-3.5" }) })] }, i))) })), (0, jsx_runtime_1.jsx)("textarea", { ref: composerRef, value: input, onChange: (e) => onInputChange(e.target.value), onFocus: onInputFocus, onKeyDown: onInputKeyDown, rows: 1, disabled: !authToken, dir: inputIsRtl ? "rtl" : "ltr", lang: inputLocale, placeholder: !authToken
14
+ ? text.placeholderAuthRequired
15
+ : text.placeholderDefault, className: "max-h-80 w-full resize-none bg-transparent px-1 py-1 outline-none", style: {
16
+ direction: inputIsRtl ? "rtl" : "ltr",
17
+ textAlign: inputIsRtl ? "right" : "left",
18
+ } })] }), (0, jsx_runtime_1.jsx)("button", { onClick: onToggleVoice, disabled: !authToken || pending, className: (0, classNames_1.classNames)("inline-flex h-9 w-9 items-center justify-center rounded-full bg-transparent transition", !authToken || pending ? "opacity-60" : "hover:bg-gray-50"), title: voiceMode ? text.voiceStopTitle : text.voiceStartTitle, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Mic, { className: "h-4 w-4 text-gray-700" }) }), (0, jsx_runtime_1.jsx)("button", { onClick: onSendMessage, disabled: !canSend, className: (0, classNames_1.classNames)("inline-flex h-9 w-9 items-center justify-center rounded-full bg-transparent transition", canSend ? "hover:bg-gray-50" : "opacity-60"), title: text.sendTitle, children: pending ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin text-gray-700" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Send, { className: "h-4 w-4 text-gray-700" })) })] }), voiceError && ((0, jsx_runtime_1.jsx)("div", { className: "mt-2 rounded-md bg-red-50 px-3 py-2 text-xs text-red-700", children: voiceError }))] }) }) }));
19
+ }
@@ -0,0 +1,24 @@
1
+ import type { ChatUITextConfig } from "../config";
2
+ type DocumentViewerProps = {
3
+ overlayUrl: string | null;
4
+ viewerLoading: boolean;
5
+ viewerUrl: string | null;
6
+ viewerKey: number;
7
+ viewerFilename: string;
8
+ gdocUrl: string | null;
9
+ blobUrl: string | null;
10
+ viewerError: string | null;
11
+ onClose: () => void;
12
+ onDownload: () => void;
13
+ onIframeLoad: () => void;
14
+ onUseGoogleViewer: () => void;
15
+ onUseDirectViewer: () => void;
16
+ takeActionProceedOpen: boolean;
17
+ takeActionSubmitting: boolean;
18
+ takeActionError: string | null;
19
+ onProceedTakeAction: () => void;
20
+ textButtonTheme: string;
21
+ text: ChatUITextConfig["documentViewer"];
22
+ };
23
+ export default function DocumentViewer({ overlayUrl, viewerLoading, viewerUrl, viewerKey, viewerFilename, gdocUrl, blobUrl, viewerError, onClose, onDownload, onIframeLoad, onUseGoogleViewer, onUseDirectViewer, takeActionProceedOpen, takeActionSubmitting, takeActionError, onProceedTakeAction, textButtonTheme, text, }: DocumentViewerProps): import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = DocumentViewer;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const framer_motion_1 = require("framer-motion");
6
+ const lucide_react_1 = require("lucide-react");
7
+ const classNames_1 = require("../utils/classNames");
8
+ function DocumentViewer({ overlayUrl, viewerLoading, viewerUrl, viewerKey, viewerFilename, gdocUrl, blobUrl, viewerError, onClose, onDownload, onIframeLoad, onUseGoogleViewer, onUseDirectViewer, takeActionProceedOpen, takeActionSubmitting, takeActionError, onProceedTakeAction, textButtonTheme, text, }) {
9
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: overlayUrl && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, className: "fixed inset-0 z-50 bg-[#252525]/50", onClick: onClose, children: (0, jsx_runtime_1.jsx)("div", { className: "absolute left-1/2 top-1/2", style: { transform: "translate(-50%, -50%)" }, children: (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { initial: { scale: 0.96, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.96, opacity: 0 }, transition: {
10
+ type: "spring",
11
+ stiffness: 300,
12
+ damping: 28,
13
+ }, className: "relative h-[95vh] w-[50vw] overflow-hidden rounded-2xl bg-white shadow-2xl", onClick: (e) => e.stopPropagation(), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "truncate text-sm font-semibold", children: text.title }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("button", { className: (0, classNames_1.classNames)("inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition", textButtonTheme), onClick: onDownload, type: "button", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Download, { className: "h-3.5 w-3.5" }), " ", text.downloadButton] }), (0, jsx_runtime_1.jsx)("button", { className: "rounded-lg p-1 hover:bg-gray-100", onClick: onClose, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-5 w-5" }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "h-[calc(95vh-52px)]", children: [viewerLoading && ((0, jsx_runtime_1.jsx)("div", { className: "flex h-full w-full items-center justify-center text-sm text-gray-600", children: text.loading })), (0, jsx_runtime_1.jsxs)("div", { className: "relative h-full w-full", children: [viewerUrl && ((0, jsx_runtime_1.jsx)("iframe", { src: viewerUrl, title: viewerFilename || text.iframeTitle, className: viewerLoading
14
+ ? "h-full w-full opacity-0"
15
+ : "h-full w-full opacity-100", onLoad: onIframeLoad, referrerPolicy: "no-referrer", sandbox: "allow-scripts allow-same-origin allow-forms allow-popups" }, viewerKey)), gdocUrl && blobUrl && ((0, jsx_runtime_1.jsxs)("div", { className: "pointer-events-none absolute right-2 top-2 flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)("pointer-events-auto rounded-md px-2 py-1 text-xs shadow transition", textButtonTheme), onClick: onUseGoogleViewer, children: text.useGoogleViewer }), (0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)("pointer-events-auto rounded-md px-2 py-1 text-xs shadow transition", textButtonTheme), onClick: onUseDirectViewer, children: text.useDirectViewer })] }))] }), viewerError && ((0, jsx_runtime_1.jsxs)("div", { className: "border-t bg-amber-50 px-4 py-2 text-xs text-amber-700", children: [viewerError, ". ", text.errorSuffix] }))] }), takeActionProceedOpen && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "pointer-events-none absolute bottom-3 left-3 flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)("pointer-events-auto inline-flex items-center justify-center rounded-xl px-4 py-2 text-sm font-medium shadow-sm transition", textButtonTheme), type: "button", onClick: onProceedTakeAction, disabled: takeActionSubmitting, children: takeActionSubmitting ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" })) : (text.proceedButton) }) }), takeActionError && ((0, jsx_runtime_1.jsx)("div", { className: "absolute bottom-3 right-3 max-w-[60%] rounded-xl bg-red-50 px-3 py-2 text-xs text-red-700 shadow", children: takeActionError }))] }))] }) }) })) }));
16
+ }
@@ -0,0 +1,9 @@
1
+ type FormattedTextProps = {
2
+ text: string;
3
+ onOpen: (href: string) => void;
4
+ isRtl?: boolean;
5
+ buttonClassName: string;
6
+ linkButtonLabel: string;
7
+ };
8
+ export default function FormattedText({ text, onOpen, isRtl, buttonClassName, linkButtonLabel, }: FormattedTextProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = FormattedText;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const classNames_1 = require("../utils/classNames");
6
+ function LinkButton({ href, title, onOpen, buttonClassName, label, }) {
7
+ return ((0, jsx_runtime_1.jsx)("button", { type: "button", title: title || href, onClick: (e) => {
8
+ e.stopPropagation();
9
+ onOpen(href);
10
+ }, className: (0, classNames_1.classNames)("align-baseline inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium shadow-sm transition", buttonClassName), children: label }));
11
+ }
12
+ function inlineRich(s, onOpen, buttonClassName, linkButtonLabel) {
13
+ const nodes = [];
14
+ const re = /(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\))|(\*\*[^*]+?\*\*)|((?:https?:\/\/)[^\s)]+)/g;
15
+ let last = 0;
16
+ let m;
17
+ while ((m = re.exec(s)) !== null) {
18
+ if (m.index > last)
19
+ nodes.push(s.slice(last, m.index));
20
+ if (m[1]) {
21
+ const text = m[2];
22
+ const url = m[3];
23
+ nodes.push((0, jsx_runtime_1.jsx)(LinkButton, { href: url, title: text, onOpen: onOpen, buttonClassName: buttonClassName, label: linkButtonLabel }, `${m.index}-md`));
24
+ }
25
+ else if (m[4]) {
26
+ const inner = m[4].slice(2, -2);
27
+ nodes.push((0, jsx_runtime_1.jsx)("strong", { children: inner.trim() }, `${m.index}-b`));
28
+ }
29
+ else if (m[5]) {
30
+ const url = m[5];
31
+ nodes.push((0, jsx_runtime_1.jsx)(LinkButton, { href: url, onOpen: onOpen, buttonClassName: buttonClassName, label: linkButtonLabel }, `${m.index}-u`));
32
+ }
33
+ last = re.lastIndex;
34
+ }
35
+ if (last < s.length)
36
+ nodes.push(s.slice(last));
37
+ return nodes;
38
+ }
39
+ function FormattedText({ text, onOpen, isRtl, buttonClassName, linkButtonLabel, }) {
40
+ const root = { type: "root", children: [] };
41
+ const uls = [];
42
+ const lastLiAtLevel = [];
43
+ const addChild = (parent, child) => {
44
+ (parent.children = parent.children || []).push(child);
45
+ };
46
+ const getIndentLevel = (s) => {
47
+ const spaces = (s.replace(/\t/g, " ").match(/^\s*/) || [""])[0].length;
48
+ return Math.floor(spaces / 2);
49
+ };
50
+ const lines = text.split(/\r?\n/);
51
+ for (let i = 0; i < lines.length; i++) {
52
+ const line = lines[i];
53
+ const bullet = line.match(/^(\s*)-\s+(.*)$/);
54
+ if (bullet) {
55
+ let level = getIndentLevel(bullet[1]);
56
+ while (level > 0 && !lastLiAtLevel[level - 1])
57
+ level--;
58
+ const parent = level === 0 ? root : lastLiAtLevel[level - 1];
59
+ if (!uls[level] || (parent.children || []).indexOf(uls[level]) === -1) {
60
+ uls[level] = { type: "ul", level, children: [] };
61
+ addChild(parent, uls[level]);
62
+ }
63
+ uls.length = level + 1;
64
+ lastLiAtLevel.length = level;
65
+ const li = {
66
+ type: "li",
67
+ children: [{ type: "p", text: bullet[2] }],
68
+ };
69
+ addChild(uls[level], li);
70
+ lastLiAtLevel[level] = li;
71
+ continue;
72
+ }
73
+ uls.length = 0;
74
+ lastLiAtLevel.length = 0;
75
+ if (line.trim() === "") {
76
+ addChild(root, { type: "br" });
77
+ }
78
+ else {
79
+ addChild(root, { type: "p", text: line });
80
+ }
81
+ }
82
+ const renderNode = (node, key) => {
83
+ if (node.type === "ul") {
84
+ return ((0, jsx_runtime_1.jsx)("ul", { className: (0, classNames_1.classNames)("list-disc space-y-1", isRtl ? "pr-6" : "pl-6"), children: (node.children || []).map((c, idx) => renderNode(c, String(key) + "-c" + idx)) }, key));
85
+ }
86
+ if (node.type === "li") {
87
+ return ((0, jsx_runtime_1.jsx)("li", { className: isRtl ? "text-right" : "text-left", children: (node.children || []).map((c, idx) => renderNode(c, String(key) + "-c" + idx)) }, key));
88
+ }
89
+ if (node.type === "p") {
90
+ return ((0, jsx_runtime_1.jsx)("p", { className: (0, classNames_1.classNames)("whitespace-pre-wrap", isRtl ? "text-right" : "text-left"), children: inlineRich(node.text || "", onOpen, buttonClassName, linkButtonLabel) }, key));
91
+ }
92
+ if (node.type === "br") {
93
+ return (0, jsx_runtime_1.jsx)("div", { className: "h-2" }, key);
94
+ }
95
+ return null;
96
+ };
97
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (root.children || []).map((n, i) => renderNode(n, i)) });
98
+ }
@@ -0,0 +1,41 @@
1
+ type InitPanelProps = {
2
+ show: boolean;
3
+ onClose: () => void;
4
+ requiredConfig: {
5
+ baseUrl: string;
6
+ setBaseUrl: (value: string) => void;
7
+ apiSubscriptionKey: string;
8
+ setApiSubscriptionKey: (value: string) => void;
9
+ loginSubscriptionKey: string;
10
+ setLoginSubscriptionKey: (value: string) => void;
11
+ token: string;
12
+ setToken: (value: string) => void;
13
+ isDab: boolean;
14
+ setIsDab: (value: boolean) => void;
15
+ };
16
+ initPreset: "requester" | "provider" | "custom";
17
+ setInitPreset: (preset: "requester" | "provider" | "custom") => void;
18
+ initUsername: string;
19
+ setInitUsername: (value: string) => void;
20
+ initPassword: string;
21
+ setInitPassword: (value: string) => void;
22
+ domain: string;
23
+ setDomain: (value: string) => void;
24
+ initContextWindow: string;
25
+ setInitContextWindow: (value: string) => void;
26
+ initServiceId: string;
27
+ setInitServiceId: (value: string) => void;
28
+ initRequestStepId: string;
29
+ setInitRequestStepId: (value: string) => void;
30
+ sessionId: string;
31
+ setSessionId: (value: string) => void;
32
+ speechLang: string;
33
+ setSpeechLang: (value: string) => void;
34
+ ttsLang: string;
35
+ setTtsLang: (value: string) => void;
36
+ initLoading: boolean;
37
+ onInitialize: () => Promise<void>;
38
+ textButtonTheme: string;
39
+ };
40
+ export default function InitPanel({ show, onClose, requiredConfig, initPreset, setInitPreset, initUsername, setInitUsername, initPassword, setInitPassword, domain, setDomain, initContextWindow, setInitContextWindow, initServiceId, setInitServiceId, initRequestStepId, setInitRequestStepId, sessionId, setSessionId, speechLang, setSpeechLang, ttsLang, setTtsLang, initLoading, onInitialize, textButtonTheme, }: InitPanelProps): import("react/jsx-runtime").JSX.Element;
41
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = InitPanel;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const framer_motion_1 = require("framer-motion");
6
+ const lucide_react_1 = require("lucide-react");
7
+ const classNames_1 = require("../utils/classNames");
8
+ function InitPanel({ show, onClose, requiredConfig, initPreset, setInitPreset, initUsername, setInitUsername, initPassword, setInitPassword, domain, setDomain, initContextWindow, setInitContextWindow, initServiceId, setInitServiceId, initRequestStepId, setInitRequestStepId, sessionId, setSessionId, speechLang, setSpeechLang, ttsLang, setTtsLang, initLoading, onInitialize, textButtonTheme, }) {
9
+ const presetOptions = [
10
+ { id: "requester", label: "Requester" },
11
+ { id: "provider", label: "Provider" },
12
+ { id: "custom", label: "Custom" },
13
+ ];
14
+ const { baseUrl, setBaseUrl, apiSubscriptionKey, setApiSubscriptionKey, loginSubscriptionKey, setLoginSubscriptionKey, token, setToken, isDab, setIsDab, } = requiredConfig;
15
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, className: "fixed inset-0 z-40 bg-[#252525]/30", onClick: onClose, children: (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { initial: { x: 400 }, animate: { x: 0 }, exit: { x: 400 }, transition: {
16
+ type: "spring",
17
+ stiffness: 280,
18
+ damping: 30,
19
+ }, className: "absolute right-0 top-0 flex h-full w-full max-w-xl flex-col rounded-2xl bg-white shadow-2xl", onClick: (e) => e.stopPropagation(), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between border-b px-4 py-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-semibold", children: "Login & initialize chat" }), (0, jsx_runtime_1.jsx)("button", { className: "rounded-lg p-1 hover:bg-gray-50", onClick: onClose, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-5 w-5" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 min-h-0 overflow-y-auto px-6 py-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex gap-3", children: presetOptions.map((preset) => ((0, jsx_runtime_1.jsx)("button", { onClick: () => setInitPreset(preset.id), className: (0, classNames_1.classNames)("flex-1 rounded-full px-3 py-2 text-sm font-medium transition", textButtonTheme, initPreset === preset.id ? null : "opacity-80"), children: preset.label }, preset.id))) }), (0, jsx_runtime_1.jsxs)("div", { className: "rounded-2xl border px-4 py-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs font-semibold text-gray-500", children: "Required SDK settings" }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "sm:col-span-2", children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-xs font-medium", children: "Token" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2 font-mono text-xs", value: token, onChange: (e) => setToken(e.target.value), spellCheck: false })] }), (0, jsx_runtime_1.jsxs)("div", { className: "sm:col-span-2", children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-xs font-medium", children: "Base URL" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2 font-mono text-xs", value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), spellCheck: false })] }), (0, jsx_runtime_1.jsxs)("div", { className: "sm:col-span-2", children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-xs font-medium", children: "API Subscription Key" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2 font-mono text-xs", value: apiSubscriptionKey, onChange: (e) => setApiSubscriptionKey(e.target.value), spellCheck: false })] }), (0, jsx_runtime_1.jsxs)("div", { className: "sm:col-span-2", children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-xs font-medium", children: "Login Subscription Key" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2 font-mono text-xs", value: loginSubscriptionKey, onChange: (e) => setLoginSubscriptionKey(e.target.value), spellCheck: false })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-xs font-medium", children: "Is Dab" }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("select", { className: "w-full appearance-none rounded-xl border px-3 py-2 pr-[2.25rem] text-xs", value: isDab ? "true" : "false", onChange: (e) => setIsDab(e.target.value === "true"), children: [(0, jsx_runtime_1.jsx)("option", { value: "false", children: "false" }), (0, jsx_runtime_1.jsx)("option", { value: "true", children: "true" })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "pointer-events-none absolute right-[0.9rem] top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500" })] })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: "Domain" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2", placeholder: "domain (e.g. dab.ae)", value: domain, onChange: (e) => setDomain(e.target.value), type: "text" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: "Username" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2", placeholder: "username", value: initUsername, onChange: (e) => setInitUsername(e.target.value), type: "text" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: "Password" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2", placeholder: "********", value: initPassword, onChange: (e) => setInitPassword(e.target.value), type: "password" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: "Context window" }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("select", { className: "w-full appearance-none rounded-xl border px-3 py-2 pr-[2.25rem]", value: initContextWindow, onChange: (e) => setInitContextWindow(e.target.value), children: [(0, jsx_runtime_1.jsx)("option", { value: "ComposeRequest", children: "ComposeRequest" }), (0, jsx_runtime_1.jsx)("option", { value: "TakeAction", children: "TakeAction" })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "pointer-events-none absolute right-[0.9rem] top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: "ServiceId (optional)" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2", placeholder: "e.g. 1001", value: initServiceId, onChange: (e) => setInitServiceId(e.target.value), type: "text" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: "RequestStepId (optional)" }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2", placeholder: "e.g. 2001", value: initRequestStepId, onChange: (e) => setInitRequestStepId(e.target.value), type: "text" })] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("label", { className: "mb-1 block text-sm font-medium", children: ["Session ID", " ", (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-gray-400", children: "(will be overridden by initializeChat)" })] }), (0, jsx_runtime_1.jsx)("input", { className: "w-full rounded-xl border px-3 py-2 font-mono", placeholder: "session Id", value: sessionId, onChange: (e) => setSessionId(e.target.value), type: "text" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: "Transcription language" }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("select", { className: "w-full appearance-none rounded-xl border px-3 py-2 pr-[2.25rem]", value: speechLang, onChange: (e) => setSpeechLang(e.target.value), children: [(0, jsx_runtime_1.jsx)("option", { value: "en-US", children: "English (US)" }), (0, jsx_runtime_1.jsx)("option", { value: "ar-JO", children: "Arabic (Jordan)" })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "pointer-events-none absolute right-[0.9rem] top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500" })] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: "TTS Language" }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("select", { className: "w-full appearance-none rounded-xl border px-3 py-2 pr-[2.25rem]", value: ttsLang, onChange: (e) => setTtsLang(e.target.value), children: [(0, jsx_runtime_1.jsx)("option", { value: "en-US", children: "English (US)" }), (0, jsx_runtime_1.jsx)("option", { value: "ar-EG", children: "Arabic (EG)" })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "pointer-events-none absolute right-[0.9rem] top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500" })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "pt-2", children: (0, jsx_runtime_1.jsxs)("button", { onClick: onInitialize, disabled: initLoading, className: (0, classNames_1.classNames)("inline-flex items-center gap-2 rounded-xl px-3 py-2 text-sm shadow-sm transition", textButtonTheme, initLoading ? "opacity-60" : null), children: [initLoading ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.LogIn, { className: "h-4 w-4" })), (0, jsx_runtime_1.jsx)("span", { children: initLoading ? "Signing in…" : "Sign in" })] }) })] }) })] }) })) }));
20
+ }
@@ -0,0 +1,19 @@
1
+ import type { ChatUITaskCardSize, ChatUITextConfig } from "../config";
2
+ import type { AvailableTasksCard, ChatMessage } from "../models/chat.types";
3
+ type MessageItemProps = {
4
+ m: ChatMessage;
5
+ openOverlay: (href: string) => void;
6
+ isRtl: boolean;
7
+ onOpenTaskCard?: (card: AvailableTasksCard) => void;
8
+ onSelectTaskCard?: (card: AvailableTasksCard) => void;
9
+ selectedTaskCardId?: AvailableTasksCard["RequestId"];
10
+ canSpeak?: boolean;
11
+ isSpeaking?: boolean;
12
+ onSpeak?: () => void;
13
+ onStopSpeak?: () => void;
14
+ textButtonTheme: string;
15
+ text: ChatUITextConfig["messageItem"];
16
+ taskCardSize: ChatUITaskCardSize;
17
+ };
18
+ export default function MessageItem({ m, openOverlay, isRtl, onOpenTaskCard, onSelectTaskCard, selectedTaskCardId, canSpeak, isSpeaking, onSpeak, onStopSpeak, textButtonTheme, text, taskCardSize, }: MessageItemProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = MessageItem;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const framer_motion_1 = require("framer-motion");
9
+ const lucide_react_1 = require("lucide-react");
10
+ const FormattedText_1 = __importDefault(require("./FormattedText"));
11
+ const classNames_1 = require("../utils/classNames");
12
+ const format_1 = require("../utils/format");
13
+ function MessageItem({ m, openOverlay, isRtl, onOpenTaskCard, onSelectTaskCard, selectedTaskCardId, canSpeak, isSpeaking, onSpeak, onStopSpeak, textButtonTheme, text, taskCardSize, }) {
14
+ const isUser = m.role === "User";
15
+ const alignRight = isUser;
16
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0, y: 6 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -6 }, transition: { duration: 0.18 }, className: (0, classNames_1.classNames)("flex w-full", alignRight ? "justify-end" : "justify-start"), children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)("max-w-[85%]", isUser ? "" : "w-full"), children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(isUser
17
+ ? "rounded-2xl px-4 py-3 shadow-sm"
18
+ : "px-1 py-0"), style: Object.assign({ direction: isRtl ? "rtl" : "ltr", textAlign: isRtl ? "right" : "left" }, (isUser
19
+ ? {
20
+ backgroundColor: "var(--chat-user-message-bg)",
21
+ color: "var(--chat-user-message-text)",
22
+ }
23
+ : {})), children: [m.attachments && m.attachments.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)("mb-2 flex flex-wrap gap-2", isRtl ? "justify-end" : "justify-start"), children: m.attachments.map((att, idx) => ((0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full bg-white/70 px-3 py-1 text-xs text-gray-800", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { className: "h-3 w-3" }), " ", att.name] }, idx))) })), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: (0, jsx_runtime_1.jsx)(FormattedText_1.default, { text: m.content, onOpen: openOverlay, isRtl: isRtl, buttonClassName: textButtonTheme, linkButtonLabel: text.linkButtonLabel }) }), !isUser && m.availableTasksCards && m.availableTasksCards.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-3", children: (0, jsx_runtime_1.jsx)("div", { className: "flex snap-x snap-mandatory gap-3 overflow-x-auto pb-2", children: m.availableTasksCards.map((card, idx) => {
24
+ var _a, _b, _c, _d, _e, _f, _g;
25
+ const requestSummary = (_b = (_a = card === null || card === void 0 ? void 0 : card.Details) === null || _a === void 0 ? void 0 : _a.RequestSummary) !== null && _b !== void 0 ? _b : "";
26
+ const preview = String(requestSummary).slice(0, 125);
27
+ const isSelected = selectedTaskCardId !== undefined &&
28
+ selectedTaskCardId !== null &&
29
+ String(selectedTaskCardId) === String((_c = card === null || card === void 0 ? void 0 : card.RequestId) !== null && _c !== void 0 ? _c : "");
30
+ const CardInner = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "space-y-0.5 text-sm font-semibold leading-tight", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "truncate", children: String((_d = card === null || card === void 0 ? void 0 : card.RequestId) !== null && _d !== void 0 ? _d : "") }), (0, jsx_runtime_1.jsx)("div", { className: "truncate text-xs font-medium text-gray-600", children: String((_e = card === null || card === void 0 ? void 0 : card.SubmitDate) !== null && _e !== void 0 ? _e : "") })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-4 text-xs leading-5 text-gray-700 underline decoration-gray-300 underline-offset-2", children: [preview, preview ? "..." : ""] }), onOpenTaskCard && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: (0, classNames_1.classNames)("absolute bottom-2 left-2 inline-flex items-center rounded-md px-2 py-1 text-[11px] font-semibold shadow-sm transition", textButtonTheme), onClick: (e) => {
31
+ e.stopPropagation();
32
+ onOpenTaskCard(card);
33
+ }, children: text.moreButton }))] }));
34
+ return ((0, jsx_runtime_1.jsx)("div", { role: onSelectTaskCard ? "button" : undefined, tabIndex: onSelectTaskCard ? 0 : undefined, onClick: onSelectTaskCard ? () => onSelectTaskCard(card) : undefined, onKeyDown: onSelectTaskCard
35
+ ? (e) => {
36
+ if (e.key === "Enter" || e.key === " ") {
37
+ e.preventDefault();
38
+ onSelectTaskCard(card);
39
+ }
40
+ }
41
+ : undefined, className: (0, classNames_1.classNames)("relative snap-start shrink-0 rounded-2xl border px-4 py-3 pb-10 text-left shadow-sm transition", onSelectTaskCard
42
+ ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-[#252525]/10"
43
+ : "", isSelected
44
+ ? "border-[#252525] bg-chat-card-selected hover:shadow-sm"
45
+ : "bg-white hover:bg-gray-50 hover:shadow-md"), style: {
46
+ width: (_f = taskCardSize.width) !== null && _f !== void 0 ? _f : 280,
47
+ height: taskCardSize.height,
48
+ }, title: onSelectTaskCard ? text.selectCardTitle : undefined, children: CardInner }, `${String((_g = card === null || card === void 0 ? void 0 : card.RequestId) !== null && _g !== void 0 ? _g : idx)}-${idx}`));
49
+ }) }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-1 flex items-center justify-between text-[10px] text-gray-500", children: [(0, jsx_runtime_1.jsx)("span", { children: (0, format_1.fmtTime)(m.ts) }), !isUser && canSpeak && onSpeak && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [isSpeaking && onStopSpeak && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onStopSpeak, className: "flex h-8 w-8 items-center justify-center rounded-full bg-[#252525] text-white shadow-sm hover:bg-gray-800", title: text.stopReadingTitle, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-4 w-4" }) })), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onSpeak, className: "flex h-8 w-8 items-center justify-center rounded-full bg-transparent text-gray-700 shadow-none transition hover:bg-gray-50", title: text.readMessageTitle, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Volume2, { className: "h-4 w-4" }) })] }))] })] }) }));
50
+ }
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import type { ChatUITaskCardSize, ChatUITextConfig } from "../config";
3
+ import type { AvailableTasksCard, ChatMessage } from "../models/chat.types";
4
+ type MessageListProps = {
5
+ messages: ChatMessage[];
6
+ pending: boolean;
7
+ openOverlay: (href: string) => void;
8
+ onOpenTaskCard: (card: AvailableTasksCard) => void;
9
+ onSelectTaskCard: (card: AvailableTasksCard) => void;
10
+ selectedTaskCardId?: AvailableTasksCard["RequestId"];
11
+ isRtl: boolean;
12
+ speakingMessageIndex: number | null;
13
+ onSpeak: (content: string, index: number) => void;
14
+ onStopSpeak: () => void;
15
+ textButtonTheme: string;
16
+ listEndRef?: React.RefObject<HTMLDivElement | null>;
17
+ text: ChatUITextConfig["emptyState"];
18
+ messageItemText: ChatUITextConfig["messageItem"];
19
+ taskCardSize: ChatUITaskCardSize;
20
+ };
21
+ export default function MessageList({ messages, pending, openOverlay, onOpenTaskCard, onSelectTaskCard, selectedTaskCardId, isRtl, speakingMessageIndex, onSpeak, onStopSpeak, textButtonTheme, listEndRef, text, messageItemText, taskCardSize, }: MessageListProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = MessageList;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const framer_motion_1 = require("framer-motion");
9
+ const MessageItem_1 = __importDefault(require("./MessageItem"));
10
+ const TypingDots_1 = __importDefault(require("./TypingDots"));
11
+ function MessageList({ messages, pending, openOverlay, onOpenTaskCard, onSelectTaskCard, selectedTaskCardId, isRtl, speakingMessageIndex, onSpeak, onStopSpeak, textButtonTheme, listEndRef, text, messageItemText, taskCardSize, }) {
12
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-6 sm:px-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "mx-auto w-full max-w-3xl", children: [messages.length === 0 && ((0, jsx_runtime_1.jsx)("div", { className: "mb-4 pt-24 text-center text-[2.43rem] font-semibold leading-tight text-gray-800", children: text.title })), (0, jsx_runtime_1.jsx)("div", { className: "space-y-5", children: (0, jsx_runtime_1.jsxs)(framer_motion_1.AnimatePresence, { initial: false, children: [messages.map((m, i) => {
13
+ var _a;
14
+ const canSpeak = m.role === "Assistant" &&
15
+ !!m.content &&
16
+ m.content.trim() !== "";
17
+ return ((0, jsx_runtime_1.jsx)(MessageItem_1.default, { m: m, openOverlay: openOverlay, onOpenTaskCard: onOpenTaskCard, onSelectTaskCard: onSelectTaskCard, selectedTaskCardId: selectedTaskCardId, isRtl: isRtl, canSpeak: canSpeak, isSpeaking: canSpeak && speakingMessageIndex === i, onSpeak: canSpeak ? () => onSpeak(m.content, i) : undefined, onStopSpeak: canSpeak ? onStopSpeak : undefined, textButtonTheme: textButtonTheme, text: messageItemText, taskCardSize: taskCardSize }, `${(_a = m.ts) !== null && _a !== void 0 ? _a : i}-${i}`));
18
+ }), pending && (0, jsx_runtime_1.jsx)(TypingDots_1.default, {}, "typing")] }) }), (0, jsx_runtime_1.jsx)("div", { ref: listEndRef })] }) }));
19
+ }
@@ -0,0 +1,26 @@
1
+ import type { ChatUITextConfig } from "../config";
2
+ import type { AvailableTasksCard, RequestStepAttribute, UserSignatureOption } from "../models/chat.types";
3
+ type TakeActionModalProps = {
4
+ open: boolean;
5
+ activeTaskCard: AvailableTasksCard | null;
6
+ takeActionStep: 1 | 2;
7
+ takeActionChoice: "" | "Approve" | "Reject";
8
+ takeActionComments: string;
9
+ takeActionSubmitting: boolean;
10
+ takeActionError: string | null;
11
+ visibleAttributes: RequestStepAttribute[];
12
+ signatureAlias: string | null;
13
+ userSignatures: UserSignatureOption[];
14
+ onBack: () => void;
15
+ onClose: () => void;
16
+ onChoiceChange: (value: "" | "Approve" | "Reject") => void;
17
+ onCommentsChange: (value: string) => void;
18
+ onStepChange: (step: 1 | 2) => void;
19
+ onSubmit: () => void;
20
+ onUpdateAttribute: (attr: RequestStepAttribute, value: string) => void;
21
+ getSignatureLabel: (sig: UserSignatureOption) => string;
22
+ textButtonTheme: string;
23
+ text: ChatUITextConfig["takeAction"];
24
+ };
25
+ export default function TakeActionModal({ open, activeTaskCard, takeActionStep, takeActionChoice, takeActionComments, takeActionSubmitting, takeActionError, visibleAttributes, signatureAlias, userSignatures, onBack, onClose, onChoiceChange, onCommentsChange, onStepChange, onSubmit, onUpdateAttribute, getSignatureLabel, textButtonTheme, text, }: TakeActionModalProps): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TakeActionModal;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const framer_motion_1 = require("framer-motion");
6
+ const lucide_react_1 = require("lucide-react");
7
+ const classNames_1 = require("../utils/classNames");
8
+ function TakeActionModal({ open, activeTaskCard, takeActionStep, takeActionChoice, takeActionComments, takeActionSubmitting, takeActionError, visibleAttributes, signatureAlias, userSignatures, onBack, onClose, onChoiceChange, onCommentsChange, onStepChange, onSubmit, onUpdateAttribute, getSignatureLabel, textButtonTheme, text, }) {
9
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: open && activeTaskCard && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, className: "fixed inset-0 z-50 bg-[#252525]/40", onClick: onClose, children: (0, jsx_runtime_1.jsx)("div", { className: "absolute left-1/2 top-1/2", style: { transform: "translate(-50%, -50%)" }, children: (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { initial: { scale: 0.96, opacity: 0, y: 8 }, animate: { scale: 1, opacity: 1, y: 0 }, exit: { scale: 0.96, opacity: 0, y: 8 }, transition: { type: "spring", stiffness: 320, damping: 28 }, className: "flex h-[70vh] w-[90vw] flex-col rounded-2xl bg-white shadow-2xl sm:h-[60vh] sm:w-[70vw] md:h-[55vh] md:w-[60vw] lg:h-[50vh] lg:w-[44vw]", onClick: (e) => e.stopPropagation(), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between px-4 py-3", children: [(0, jsx_runtime_1.jsx)("button", { className: "rounded-lg p-1 hover:bg-gray-100", onClick: onBack, type: "button", "aria-label": text.backAriaLabel, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowLeft, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsx)("button", { className: "rounded-lg p-1 hover:bg-gray-100", onClick: onClose, type: "button", "aria-label": text.closeAriaLabel, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-5 w-5" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 overflow-auto px-4 py-3", children: [takeActionStep === 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: text.actionTypeLabel }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("select", { className: "w-full appearance-none rounded-xl border px-3 py-2 pr-[2.25rem] text-sm focus:outline-none", value: takeActionChoice, onChange: (e) => onChoiceChange(e.target.value), disabled: takeActionSubmitting, children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: text.selectActionPlaceholder }), (0, jsx_runtime_1.jsx)("option", { value: "Approve", children: text.approveOption }), (0, jsx_runtime_1.jsx)("option", { value: "Reject", children: text.rejectOption })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "pointer-events-none absolute right-[0.9rem] top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500" })] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "mb-1 block text-sm font-medium", children: text.commentsLabel }), (0, jsx_runtime_1.jsx)("textarea", { className: "min-h-[110px] w-full resize-none rounded-xl border px-3 py-2 text-sm focus:outline-none", placeholder: text.commentsPlaceholder, value: takeActionComments, onChange: (e) => onCommentsChange(e.target.value), disabled: takeActionSubmitting })] })] })), takeActionStep === 2 && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [visibleAttributes.length === 0 && ((0, jsx_runtime_1.jsx)("div", { className: "text-sm text-gray-600", children: text.noEditableAttributes })), visibleAttributes.map((attr) => {
10
+ const isSignature = signatureAlias && attr.Alias === signatureAlias;
11
+ const value = attr.Value === null || attr.Value === undefined
12
+ ? ""
13
+ : String(attr.Value);
14
+ const disabled = !attr.IsProviderEditable || takeActionSubmitting;
15
+ const signatureOptions = Array.isArray(attr.Options)
16
+ ? attr.Options
17
+ : [];
18
+ const effectiveOptions = isSignature && userSignatures.length > 0
19
+ ? userSignatures
20
+ : signatureOptions;
21
+ const showOptionsSelect = effectiveOptions.length > 0;
22
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("label", { className: "mb-1 block text-sm font-medium", children: [attr.Name, attr.IsRequired ? " *" : ""] }), showOptionsSelect ? ((0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("select", { className: "w-full appearance-none rounded-xl border px-3 py-2 pr-[2.25rem] text-sm focus:outline-none", value: value, onChange: (e) => onUpdateAttribute(attr, e.target.value), disabled: disabled, children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: isSignature
23
+ ? text.selectSignaturePlaceholder
24
+ : text.selectOptionPlaceholder }), effectiveOptions.map((sig) => ((0, jsx_runtime_1.jsx)("option", { value: sig.interactorSignatureId, children: getSignatureLabel(sig) }, sig.interactorSignatureId)))] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "pointer-events-none absolute right-[0.9rem] top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500" })] })) : ((0, jsx_runtime_1.jsx)("input", { className: (0, classNames_1.classNames)("w-full rounded-xl border px-3 py-2 text-sm focus:outline-none", disabled ? "bg-gray-50 text-gray-500" : "bg-white"), value: value, onChange: (e) => onUpdateAttribute(attr, e.target.value), disabled: disabled, placeholder: isSignature ? text.signaturePlaceholder : undefined }))] }, `${attr.AttributeTypeId}-${attr.Alias}`));
25
+ })] }))] }), takeActionError && ((0, jsx_runtime_1.jsx)("div", { className: "border-t bg-red-50 px-4 py-2 text-xs text-red-700", children: takeActionError })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-end gap-2 px-4 py-3", children: [(0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)("inline-flex items-center justify-center rounded-xl px-3 py-2 text-sm font-medium transition", textButtonTheme), type: "button", onClick: onClose, disabled: takeActionSubmitting, children: text.cancelButton }), takeActionStep === 2 ? ((0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)("inline-flex items-center justify-center rounded-xl px-3 py-2 text-sm font-medium shadow-sm transition", textButtonTheme), type: "button", onClick: onSubmit, disabled: takeActionSubmitting || !takeActionChoice, children: takeActionSubmitting ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" })) : (text.submitButton) })) : ((0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)("inline-flex items-center justify-center rounded-xl px-3 py-2 text-sm font-medium shadow-sm transition", textButtonTheme), type: "button", onClick: () => onStepChange(2), disabled: !takeActionChoice || takeActionSubmitting, children: text.nextButton }))] })] }) }) })) }));
26
+ }
@@ -0,0 +1,13 @@
1
+ import type { ChatUITextConfig } from "../config";
2
+ import type { AvailableTasksCard } from "../models/chat.types";
3
+ type TaskCardsModalProps = {
4
+ open: boolean;
5
+ card: AvailableTasksCard | null;
6
+ onClose: () => void;
7
+ onTakeAction: (card: AvailableTasksCard) => void;
8
+ onShowDocument: (url: string) => void;
9
+ textButtonTheme: string;
10
+ text: ChatUITextConfig["taskCards"];
11
+ };
12
+ export default function TaskCardsModal({ open, card, onClose, onTakeAction, onShowDocument, textButtonTheme, text, }: TaskCardsModalProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TaskCardsModal;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const framer_motion_1 = require("framer-motion");
6
+ const lucide_react_1 = require("lucide-react");
7
+ const classNames_1 = require("../utils/classNames");
8
+ function TaskCardsModal({ open, card, onClose, onTakeAction, onShowDocument, textButtonTheme, text, }) {
9
+ var _a, _b, _c, _d, _e, _f;
10
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: open && card && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, className: "fixed inset-0 z-50 bg-[#252525]/40", onClick: onClose, children: (0, jsx_runtime_1.jsx)("div", { className: "absolute left-1/2 top-1/2", style: { transform: "translate(-50%, -50%)" }, children: (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { initial: { scale: 0.96, opacity: 0, y: 8 }, animate: { scale: 1, opacity: 1, y: 0 }, exit: { scale: 0.96, opacity: 0, y: 8 }, transition: { type: "spring", stiffness: 320, damping: 28 }, className: "flex h-[80vh] w-[90vw] flex-col rounded-2xl bg-white shadow-2xl sm:h-[75vh] sm:w-[70vw] md:h-[65vh] md:w-[60vw] lg:h-[44vh] lg:w-[44vw]", onClick: (e) => e.stopPropagation(), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between px-4 py-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "truncate text-sm font-semibold", children: text.modalTitle }), (0, jsx_runtime_1.jsx)("button", { className: "rounded-lg p-1 hover:bg-gray-100", onClick: onClose, type: "button", "aria-label": "Close", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-5 w-5" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 overflow-auto px-4 py-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { className: "whitespace-pre-wrap break-words text-sm leading-6 text-gray-900", children: (_b = (_a = card === null || card === void 0 ? void 0 : card.Details) === null || _a === void 0 ? void 0 : _a.RequestSummary) !== null && _b !== void 0 ? _b : "" }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { className: "whitespace-pre-wrap break-words text-sm leading-6 text-gray-900", children: (_d = (_c = card === null || card === void 0 ? void 0 : card.Details) === null || _c === void 0 ? void 0 : _c.TaskSummary) !== null && _d !== void 0 ? _d : "" }) })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-end gap-2 px-4 py-3", children: [(0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)("inline-flex items-center justify-center rounded-xl px-3 py-2 text-sm font-medium shadow-sm transition", textButtonTheme), type: "button", onClick: () => onTakeAction(card), children: text.takeActionButton }), (0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)("inline-flex items-center justify-center rounded-xl px-3 py-2 text-sm font-medium transition", textButtonTheme, !((_e = card === null || card === void 0 ? void 0 : card.Details) === null || _e === void 0 ? void 0 : _e.DocumentUrl) && "cursor-not-allowed opacity-50"), type: "button", disabled: !((_f = card === null || card === void 0 ? void 0 : card.Details) === null || _f === void 0 ? void 0 : _f.DocumentUrl), onClick: () => {
11
+ var _a;
12
+ const url = (_a = card === null || card === void 0 ? void 0 : card.Details) === null || _a === void 0 ? void 0 : _a.DocumentUrl;
13
+ if (!url)
14
+ return;
15
+ onShowDocument(url);
16
+ }, children: text.showDocumentButton })] })] }) }) })) }));
17
+ }
@@ -0,0 +1,9 @@
1
+ import type { ChatUITextConfig } from "../config";
2
+ type ToolResultOverlayProps = {
3
+ show: boolean;
4
+ onClose: () => void;
5
+ lastToolResult: unknown;
6
+ text: ChatUITextConfig["toolResult"];
7
+ };
8
+ export default function ToolResultOverlay({ show, onClose, lastToolResult, text, }: ToolResultOverlayProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = ToolResultOverlay;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const framer_motion_1 = require("framer-motion");
6
+ const lucide_react_1 = require("lucide-react");
7
+ const format_1 = require("../utils/format");
8
+ function ToolResultOverlay({ show, onClose, lastToolResult, text, }) {
9
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, className: "fixed inset-0 z-40 bg-[#252525]/40", onClick: onClose, children: (0, jsx_runtime_1.jsx)("div", { className: "absolute left-1/2 top-1/2", style: { transform: "translate(-50%, -50%)" }, children: (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { initial: { scale: 0.96, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.96, opacity: 0 }, transition: {
10
+ type: "spring",
11
+ stiffness: 300,
12
+ damping: 28,
13
+ }, className: "h-[80vh] w-[80vw] overflow-hidden rounded-2xl bg-white shadow-2xl", onClick: (e) => e.stopPropagation(), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between px-4 py-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-semibold", children: text.title }), (0, jsx_runtime_1.jsx)("button", { className: "rounded-lg p-1 hover:bg-gray-50", onClick: onClose, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-5 w-5" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-[calc(80vh-52px)] overflow-auto p-4", children: (0, jsx_runtime_1.jsx)("pre", { className: "whitespace-pre-wrap break-words text-sm leading-6", children: (0, format_1.safeStringify)(lastToolResult) }) })] }) }) })) }));
14
+ }
@@ -0,0 +1,13 @@
1
+ import type { ChatUITextConfig } from "../config";
2
+ type TopBarProps = {
3
+ sessionId: string;
4
+ authToken: string;
5
+ onClearChat: () => void;
6
+ onLogout: () => void;
7
+ onInitOpen: () => void;
8
+ textButtonTheme: string;
9
+ showInitButton?: boolean;
10
+ text: ChatUITextConfig["topBar"];
11
+ };
12
+ export default function TopBar({ sessionId, authToken, onClearChat, onLogout, onInitOpen, textButtonTheme, showInitButton, text, }: TopBarProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TopBar;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const lucide_react_1 = require("lucide-react");
6
+ const classNames_1 = require("../utils/classNames");
7
+ function TopBar({ sessionId, authToken, onClearChat, onLogout, onInitOpen, textButtonTheme, showInitButton = true, text, }) {
8
+ return ((0, jsx_runtime_1.jsx)("div", { className: "sticky top-0 z-10 bg-white/95 backdrop-blur", children: (0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-full max-w-3xl flex-wrap items-center justify-between gap-2 px-2 py-3 sm:px-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-sm text-gray-500", children: [text.sessionLabel, " ", (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-xs", children: sessionId })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: onClearChat, className: (0, classNames_1.classNames)("inline-flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm shadow-sm transition", textButtonTheme), title: text.clearTitle, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Trash2, { className: "h-4 w-4" }), " ", text.clearButton] }), showInitButton && authToken ? ((0, jsx_runtime_1.jsxs)("button", { onClick: onLogout, className: (0, classNames_1.classNames)("inline-flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm shadow-sm transition", textButtonTheme), title: text.logoutTitle, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "h-4 w-4" }), " ", text.logoutButton] })) : showInitButton ? ((0, jsx_runtime_1.jsxs)("button", { onClick: onInitOpen, className: (0, classNames_1.classNames)("inline-flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm shadow-sm transition", textButtonTheme), title: text.loginTitle, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogIn, { className: "h-4 w-4" }), " ", text.loginButton] })) : null] })] }) }));
9
+ }
@@ -0,0 +1 @@
1
+ export default function TypingDots(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TypingDots;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const framer_motion_1 = require("framer-motion");
6
+ function TypingDots() {
7
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0, y: 6 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -6 }, transition: { duration: 0.18 }, className: "flex w-full justify-start", children: (0, jsx_runtime_1.jsxs)("div", { className: "text-[1rem] leading-7 text-gray-900", children: [(0, jsx_runtime_1.jsx)("span", { className: "inline-block h-1.5 w-1.5 animate-bounce rounded-full bg-gray-400 [animation-delay:0ms]" }), (0, jsx_runtime_1.jsx)("span", { className: "ml-1 inline-block h-1.5 w-1.5 animate-bounce rounded-full bg-gray-400 [animation-delay:150ms]" }), (0, jsx_runtime_1.jsx)("span", { className: "ml-1 inline-block h-1.5 w-1.5 animate-bounce rounded-full bg-gray-400 [animation-delay:300ms]" })] }) }));
8
+ }