@stack-spot/ai-chat-widget 1.6.0 → 1.7.0-beta.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.
- package/dist/app-metadata.json +7 -7
- package/dist/components/Selector/index.d.ts +20 -0
- package/dist/components/Selector/index.d.ts.map +1 -0
- package/dist/components/Selector/index.js +134 -0
- package/dist/components/Selector/index.js.map +1 -0
- package/dist/components/Selector/styled.d.ts +2 -0
- package/dist/components/Selector/styled.d.ts.map +1 -0
- package/dist/components/Selector/styled.js +144 -0
- package/dist/components/Selector/styled.js.map +1 -0
- package/dist/regex.d.ts +1 -0
- package/dist/regex.d.ts.map +1 -1
- package/dist/regex.js +1 -0
- package/dist/regex.js.map +1 -1
- package/dist/views/Agents/AgentsTab.js +4 -4
- package/dist/views/Agents/AgentsTab.js.map +1 -1
- package/dist/views/Chat/AgentInfo.js +1 -1
- package/dist/views/Home/CustomAgent.js +3 -3
- package/dist/views/Home/CustomAgent.js.map +1 -1
- package/dist/views/Home/styled.js +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts +4 -0
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -0
- package/dist/views/MessageInput/AgentSelector.js +31 -0
- package/dist/views/MessageInput/AgentSelector.js.map +1 -0
- package/dist/views/MessageInput/ButtonAgent.d.ts +2 -0
- package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -0
- package/dist/views/MessageInput/ButtonAgent.js +17 -0
- package/dist/views/MessageInput/ButtonAgent.js.map +1 -0
- package/dist/views/MessageInput/ButtonGroup.d.ts +1 -1
- package/dist/views/MessageInput/ButtonGroup.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonGroup.js +4 -6
- package/dist/views/MessageInput/ButtonGroup.js.map +1 -1
- package/dist/views/MessageInput/QuickCommandSelector.d.ts +2 -11
- package/dist/views/MessageInput/QuickCommandSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/QuickCommandSelector.js +17 -130
- package/dist/views/MessageInput/QuickCommandSelector.js.map +1 -1
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/MessageInput/dictionary.d.ts.map +1 -1
- package/dist/views/MessageInput/dictionary.js +4 -2
- package/dist/views/MessageInput/dictionary.js.map +1 -1
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +4 -1
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +51 -144
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/package.json +1 -1
- package/src/app-metadata.json +7 -7
- package/src/components/Selector/index.tsx +245 -0
- package/src/components/Selector/styled.ts +145 -0
- package/src/regex.ts +1 -0
- package/src/views/Agents/AgentsTab.tsx +4 -4
- package/src/views/Chat/AgentInfo.tsx +1 -1
- package/src/views/Home/CustomAgent.tsx +3 -3
- package/src/views/Home/styled.ts +1 -1
- package/src/views/MessageInput/AgentSelector.tsx +35 -0
- package/src/views/MessageInput/ButtonAgent.tsx +36 -0
- package/src/views/MessageInput/ButtonGroup.tsx +3 -10
- package/src/views/MessageInput/QuickCommandSelector.tsx +21 -205
- package/src/views/MessageInput/dictionary.ts +4 -2
- package/src/views/MessageInput/index.tsx +8 -3
- package/src/views/MessageInput/styled.ts +51 -144
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRight, Code, KnowledgeSource, Send, Stack, Times, Workspace } from '@citric/icons';
|
|
3
3
|
import { IconButton } from '@citric/ui';
|
|
4
|
-
import { MiniLogo } from '@stack-spot/portal-components/svg';
|
|
5
4
|
import { listToClass } from '@stack-spot/portal-theme';
|
|
6
5
|
import { useEffect, useRef } from 'react';
|
|
7
6
|
import { useCurrentChatState, useWidget } from '../../context/hooks.js';
|
|
8
7
|
import { useMessageInputDictionary } from './dictionary.js';
|
|
9
8
|
/**
|
|
10
9
|
* Renders the button group at right bottom side of the message input. This includes the send button as well as the buttons to open the
|
|
11
|
-
* editor, change the
|
|
10
|
+
* editor, change the stack, etc.
|
|
12
11
|
*/
|
|
13
12
|
export const ButtonGroup = ({ onSend, onCancel, expanded, setExpanded, isLoading }) => {
|
|
14
13
|
const t = useMessageInputDictionary();
|
|
15
14
|
const widget = useWidget();
|
|
16
15
|
const featureButtonsWidth = useRef();
|
|
17
16
|
const featureButtons = useRef(null);
|
|
18
|
-
const agent = useCurrentChatState('agent');
|
|
19
17
|
const features = useCurrentChatState('features');
|
|
20
|
-
const hasFeatureButtons = features.
|
|
18
|
+
const hasFeatureButtons = features.workspace || features.knowledgeSource || features.stack || features.editor;
|
|
21
19
|
useEffect(() => {
|
|
22
20
|
if (!featureButtons.current)
|
|
23
21
|
return;
|
|
@@ -30,7 +28,7 @@ export const ButtonGroup = ({ onSend, onCancel, expanded, setExpanded, isLoading
|
|
|
30
28
|
featureButtons.current.style.width = `${featureButtonsWidth.current}px`;
|
|
31
29
|
},
|
|
32
30
|
// don't use the whole features object here, it would make every chat tab change rerun this effect.
|
|
33
|
-
[features.
|
|
34
|
-
return (_jsxs("div", { className: "button-group", children: [hasFeatureButtons && _jsxs(_Fragment, { children: [_jsxs("div", { ref: featureButtons, className: listToClass(['feature-buttons', expanded && 'expanded']), style: { width: expanded ? featureButtonsWidth.current : 0 }, children: [features.
|
|
31
|
+
[features.workspace, features.knowledgeSource, features.stack, features.editor]);
|
|
32
|
+
return (_jsxs("div", { className: "button-group", children: [hasFeatureButtons && _jsxs(_Fragment, { children: [_jsxs("div", { ref: featureButtons, className: listToClass(['feature-buttons', expanded && 'expanded']), style: { width: expanded ? featureButtonsWidth.current : 0 }, children: [features.workspace && (_jsx(IconButton, { "aria-label": t.workspace, title: t.workspace, onClick: () => widget.set('panel', 'workspace'), children: _jsx(Workspace, {}) })), features.knowledgeSource && (_jsx(IconButton, { "aria-label": t.knowledgeSource, title: t.knowledgeSource, onClick: () => widget.set('panel', 'ks'), children: _jsx(KnowledgeSource, {}) })), features.stack && (_jsx(IconButton, { "aria-label": t.stack, title: t.stack, onClick: () => widget.set('panel', 'stack'), children: _jsx(Stack, {}) })), features.editor && (_jsx(IconButton, { "aria-label": t.code, title: t.code, onClick: () => widget.set('panel', 'editor'), children: _jsx(Code, {}) }))] }), _jsx(IconButton, { title: expanded ? t.collapse : t.expand, className: listToClass(['expand', !expanded && 'collapsed']), "aria-label": expanded ? t.collapse : t.expand, onClick: () => setExpanded(v => !v), children: _jsx(ChevronRight, {}) })] }), isLoading ? (_jsx(IconButton, { "aria-label": t.cancel, onClick: onCancel, className: "send", title: t.cancel, children: _jsx(Times, {}) })) : (_jsx(IconButton, { "aria-label": t.send, onClick: onSend, className: "send", title: t.send, children: _jsx(Send, {}) }))] }));
|
|
35
33
|
};
|
|
36
34
|
//# sourceMappingURL=ButtonGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.js","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ButtonGroup.js","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;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,EACN,KAAC,UAAU,IACT,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EACvC,SAAS,EAAE,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,IAAI,WAAW,CAAC,CAAC,gBAChD,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAEnC,KAAC,YAAY,KAAG,GACL,IACZ,EACF,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,UAAU,kBAAa,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,CAAC,CAAC,MAAM,YACnF,KAAC,KAAK,KAAG,GACE,CACd,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,kBAAa,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,CAAC,CAAC,IAAI,YAC7E,KAAC,IAAI,KAAG,GACG,CACd,IACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* A reference to the input this quick commands panel is attached to.
|
|
4
|
-
*/
|
|
1
|
+
export declare const QuickCommandSelector: ({ inputRef }: {
|
|
5
2
|
inputRef: React.RefObject<HTMLTextAreaElement | HTMLInputElement>;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* This renders the floating Quick Commands panel that allows the user to select a quick command. This appears whenever the user types "/"
|
|
9
|
-
* in the textarea.
|
|
10
|
-
*/
|
|
11
|
-
export declare const QuickCommandSelector: ({ inputRef }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
3
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
4
|
//# sourceMappingURL=QuickCommandSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickCommandSelector.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/QuickCommandSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuickCommandSelector.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/QuickCommandSelector.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,oBAAoB,iBAAkB;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAA;CAAE,4CAyBvH,CAAA"}
|
|
@@ -1,142 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ExternalLink, QuickCommand } from '@citric/icons';
|
|
4
|
-
import { IconButton } from '@citric/ui';
|
|
5
|
-
import { useKeyboardControls } from '@stack-spot/portal-components';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { QuickCommand } from '@citric/icons';
|
|
6
3
|
import { aiClient } from '@stack-spot/portal-network';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Fading } from '../../components/Fading.js';
|
|
10
|
-
import { FallbackBoundary } from '../../components/FallbackBoundary/index.js';
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import { Selector } from '../../components/Selector/index.js';
|
|
11
6
|
import { useCurrentChat, useCurrentChatState } from '../../context/hooks.js';
|
|
12
7
|
import { quickCommandRegex } from '../../regex.js';
|
|
13
|
-
|
|
14
|
-
const sections = [undefined, 'personal', 'workspace', 'account', 'shared'];
|
|
15
|
-
const CommandListItem = ({ qc, onSelect }) => {
|
|
16
|
-
const t = useTranslate(dictionary);
|
|
17
|
-
return (_jsxs("li", { children: [_jsxs("button", { className: "qc", onClick: () => onSelect(qc.slug),
|
|
18
|
-
// the following line prevents a new line character in the message when the user presses enter to select a qc.
|
|
19
|
-
onKeyDown: e => e.key === 'Enter' && e.preventDefault(), onFocus: e => e.target.closest('li')?.classList.add('focus'), onBlur: e => e.target.closest('li')?.classList.remove('focus'), children: [_jsxs("p", { className: "qc-title", children: ["/", qc.slug] }), _jsx("p", { className: "qc-description", children: qc.description })] }), _jsx(IconButton, { as: "a", title: t.openQC, "aria-label": t.openQC, href: `${getUrlToStackSpotAI()}/quick-command/${qc.slug}`, target: "_blank", children: _jsx(ExternalLink, {}) })] }));
|
|
20
|
-
};
|
|
21
|
-
const CommandList = ({ filter, visibility, onSelect }) => {
|
|
22
|
-
const t = useTranslate(dictionary);
|
|
23
|
-
const quickCommands = aiClient.quickCommands.useQuery({ order: 'a-to-z' });
|
|
24
|
-
let filtered = quickCommands;
|
|
25
|
-
if (visibility || filter) {
|
|
26
|
-
const lowerFilter = filter?.toLocaleLowerCase();
|
|
27
|
-
filtered = quickCommands.filter(qc => (!lowerFilter || qc.slug.toLocaleLowerCase().startsWith(lowerFilter)) && (!visibility || qc.visibility_level === visibility));
|
|
28
|
-
}
|
|
29
|
-
if (!quickCommands.length)
|
|
30
|
-
return _jsx(Text, { className: "empty", colorScheme: "light.700", children: t.noData });
|
|
31
|
-
if (!filtered.length)
|
|
32
|
-
return _jsx(Text, { className: "empty", colorScheme: "light.700", children: t.noResults });
|
|
33
|
-
return (_jsx("ul", { className: "command-list", children: filtered.map(qc => _jsx(CommandListItem, { qc: qc, onSelect: onSelect }, qc.id)) }));
|
|
34
|
-
};
|
|
35
|
-
const SelectorContent = ({ filter, onClose, inputRef }) => {
|
|
36
|
-
const t = useTranslate(dictionary);
|
|
37
|
-
const ref = useRef(null);
|
|
8
|
+
export const QuickCommandSelector = ({ inputRef }) => {
|
|
38
9
|
const chat = useCurrentChat();
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const newValue = `/${slug}`;
|
|
10
|
+
const onSelectItem = useCallback((qc) => {
|
|
11
|
+
const newValue = `/${qc.slug}`;
|
|
42
12
|
chat.set('nextMessage', newValue);
|
|
43
|
-
onClose();
|
|
44
13
|
if (!inputRef.current)
|
|
45
14
|
return;
|
|
46
|
-
// the following line prevents bugs by setting the text area value before react gets the chance to.
|
|
47
15
|
inputRef.current.value = newValue;
|
|
48
16
|
inputRef.current.focus();
|
|
49
17
|
}, []);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
return (_jsxs("div", { ref: ref, children: [_jsxs("header", { children: [_jsx(IconBox, { children: _jsx(QuickCommand, {}) }), _jsx(Text, { as: "h3", children: "QUICK COMMANDS" })] }), _jsxs("div", { className: "body", children: [_jsx("ul", { className: "tabs", children: sections.map(createSectionItem) }), _jsx(FallbackBoundary, { message: t.error, mini: true, children: _jsx(CommandList, { onSelect: onSelectQC, filter: filter, visibility: visibility }) })] })] }));
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* This renders the floating Quick Commands panel that allows the user to select a quick command. This appears whenever the user types "/"
|
|
65
|
-
* in the textarea.
|
|
66
|
-
*/
|
|
67
|
-
export const QuickCommandSelector = ({ inputRef }) => {
|
|
68
|
-
const value = useCurrentChatState('nextMessage') ?? '';
|
|
69
|
-
const filter = useMemo(() => value === '/' || quickCommandRegex.test(value) ? value.substring(1) : undefined, [value]);
|
|
70
|
-
const [isClosed, setClosed] = useState(false);
|
|
71
|
-
const selectorRef = useRef(null);
|
|
72
|
-
const isEnabled = useCurrentChatState('features').quickCommands;
|
|
73
|
-
const shouldRender = isEnabled && filter !== undefined && !isClosed;
|
|
74
|
-
// Resets the closed state whenever the message input is cleared
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
if (!value)
|
|
77
|
-
setClosed(false);
|
|
78
|
-
}, [value]);
|
|
79
|
-
// Creates the following behavior while the user types in the message input:
|
|
80
|
-
// auto-complete on tab; move focus to the qc panel on press up or down; and close the qc panel on esc.
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
function getFirst() {
|
|
83
|
-
return selectorRef.current?.querySelector('.qc');
|
|
84
|
-
}
|
|
85
|
-
function onKeyDown(event) {
|
|
86
|
-
const key = event.key;
|
|
87
|
-
if (!selectorRef.current)
|
|
88
|
-
return;
|
|
89
|
-
if (key === 'Tab') {
|
|
90
|
-
getFirst()?.click();
|
|
91
|
-
event.preventDefault();
|
|
92
|
-
}
|
|
93
|
-
else if (key === 'ArrowDown' || key === 'ArrowUp') {
|
|
94
|
-
getFirst()?.focus();
|
|
95
|
-
event.preventDefault();
|
|
96
|
-
}
|
|
97
|
-
if (key === 'Escape') {
|
|
98
|
-
setClosed(true);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
inputRef.current?.addEventListener('keydown', onKeyDown);
|
|
102
|
-
return () => inputRef.current?.removeEventListener('keydown', onKeyDown);
|
|
103
|
-
}, []);
|
|
104
|
-
// Closes the panel when the user clicks outside the qc panel or the message input.
|
|
105
|
-
useEffect(() => {
|
|
106
|
-
if (!shouldRender)
|
|
107
|
-
return;
|
|
108
|
-
function onClickOut(e) {
|
|
109
|
-
const target = e.target;
|
|
110
|
-
if (!selectorRef.current?.contains(target) && !inputRef.current?.contains(target))
|
|
111
|
-
setClosed(true);
|
|
112
|
-
}
|
|
113
|
-
document.addEventListener('click', onClickOut);
|
|
114
|
-
return () => document.removeEventListener('click', onClickOut);
|
|
115
|
-
}, [shouldRender]);
|
|
116
|
-
return (_jsx(Fading, { visible: shouldRender, ref: selectorRef, className: "quick-command-selector", children: _jsx(SelectorContent, { filter: filter, onClose: () => setClosed(true), inputRef: inputRef }) }));
|
|
117
|
-
};
|
|
118
|
-
const dictionary = {
|
|
119
|
-
en: {
|
|
120
|
-
all: 'All',
|
|
121
|
-
personal: 'Personal',
|
|
122
|
-
account: 'Account',
|
|
123
|
-
shared: 'Shared',
|
|
124
|
-
workspace: 'Workspace',
|
|
125
|
-
error: 'Could not load the quick commands.',
|
|
126
|
-
noData: 'You don\'t have any quick command yet.',
|
|
127
|
-
noResults: 'There are no quick commands to show here.',
|
|
128
|
-
openQC: 'Open this quick command\'s settings in a new tab.',
|
|
129
|
-
},
|
|
130
|
-
pt: {
|
|
131
|
-
all: 'Todos',
|
|
132
|
-
personal: 'Pessoal',
|
|
133
|
-
account: 'Conta',
|
|
134
|
-
shared: 'Compartilhado',
|
|
135
|
-
workspace: 'Workspace',
|
|
136
|
-
error: 'Não foi possível carregar os quick commands.',
|
|
137
|
-
noData: 'Você ainda não possui quick commands.',
|
|
138
|
-
noResults: 'Não há quick commands para mostrar aqui.',
|
|
139
|
-
openQC: 'Abra as configurações deste quick command em uma nova aba.',
|
|
140
|
-
},
|
|
18
|
+
return _jsx(Selector, { inputRef: inputRef, selectorConfig: {
|
|
19
|
+
resourceName: 'Quick Command',
|
|
20
|
+
shortcut: '/',
|
|
21
|
+
icon: _jsx(QuickCommand, {}),
|
|
22
|
+
url: '/quick-command/',
|
|
23
|
+
regex: quickCommandRegex,
|
|
24
|
+
data: () => aiClient.quickCommands.useQuery({ order: 'a-to-z' }),
|
|
25
|
+
isEnabled: useCurrentChatState('features').quickCommands,
|
|
26
|
+
onSelect: onSelectItem,
|
|
27
|
+
} });
|
|
141
28
|
};
|
|
142
29
|
//# sourceMappingURL=QuickCommandSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickCommandSelector.js","sourceRoot":"","sources":["../../../src/views/MessageInput/QuickCommandSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"QuickCommandSelector.js","sourceRoot":"","sources":["../../../src/views/MessageInput/QuickCommandSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,OAAO,EAAE,WAAW,EAA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owledgeSource" | "agent" | "send" | "collapse" | "expand" | "removeConfig" | "removeStack" | "removeWorkspace" | "removeKS" | "removeSelection", string>;
|
|
1
|
+
export declare const useMessageInputDictionary: () => Record<"cancel" | "code" | "placeholder" | "selected" | "stack" | "workspace" | "knowledgeSource" | "agent" | "send" | "collapse" | "expand" | "removeConfig" | "removeStack" | "removeWorkspace" | "removeKS" | "removeSelection" | "remove", string>;
|
|
2
2
|
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"AA2CA,eAAO,MAAM,yBAAyB,8PAAiC,CAAA"}
|
|
@@ -9,7 +9,7 @@ const dictionary = {
|
|
|
9
9
|
collapse: 'Hide buttons',
|
|
10
10
|
expand: 'Show buttons',
|
|
11
11
|
send: 'Send message',
|
|
12
|
-
placeholder: '
|
|
12
|
+
placeholder: 'Message to %s',
|
|
13
13
|
cancel: 'Cancel',
|
|
14
14
|
removeConfig: 'Remove all the configuration',
|
|
15
15
|
removeStack: 'Stop using the current stack',
|
|
@@ -17,6 +17,7 @@ const dictionary = {
|
|
|
17
17
|
removeKS: 'Stop using this knowledge source',
|
|
18
18
|
selected: 'Selected',
|
|
19
19
|
removeSelection: 'Remove current code selection',
|
|
20
|
+
remove: 'Remove',
|
|
20
21
|
},
|
|
21
22
|
pt: {
|
|
22
23
|
stack: 'Selecionar stack',
|
|
@@ -27,7 +28,7 @@ const dictionary = {
|
|
|
27
28
|
collapse: 'Esconder botões',
|
|
28
29
|
expand: 'Mostrar botões',
|
|
29
30
|
send: 'Enviar mensagem',
|
|
30
|
-
placeholder: '
|
|
31
|
+
placeholder: 'Mensagem para %s',
|
|
31
32
|
cancel: 'Cancelar',
|
|
32
33
|
removeConfig: 'Remover todas as configurações',
|
|
33
34
|
removeStack: 'Parar de usar a stack atual',
|
|
@@ -35,6 +36,7 @@ const dictionary = {
|
|
|
35
36
|
removeKS: 'Parar de usar este knowledge source',
|
|
36
37
|
selected: 'Selecionado',
|
|
37
38
|
removeSelection: 'Desfazer seleção de código',
|
|
39
|
+
remove: 'Remover',
|
|
38
40
|
},
|
|
39
41
|
};
|
|
40
42
|
export const useMessageInputDictionary = () => useTranslate(dictionary);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEvE,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,kBAAkB;QAC7B,eAAe,EAAE,0BAA0B;QAC3C,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,cAAc;QACtB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEvE,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,kBAAkB;QAC7B,eAAe,EAAE,0BAA0B;QAC3C,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,cAAc;QACtB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,eAAe;QAC5B,MAAM,EAAE,QAAQ;QAChB,YAAY,EAAE,8BAA8B;QAC5C,WAAW,EAAE,8BAA8B;QAC3C,eAAe,EAAE,kCAAkC;QACnD,QAAQ,EAAE,kCAAkC;QAC5C,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,+BAA+B;QAChD,MAAM,EAAE,QAAQ;KACjB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,wBAAwB;QAC9B,SAAS,EAAE,sBAAsB;QACjC,eAAe,EAAE,8BAA8B;QAC/C,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE,iBAAiB;QAC3B,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,kBAAkB;QAC/B,MAAM,EAAE,UAAU;QAClB,YAAY,EAAE,gCAAgC;QAC9C,WAAW,EAAE,6BAA6B;QAC1C,eAAe,EAAE,iCAAiC;QAClD,QAAQ,EAAE,qCAAqC;QAC/C,QAAQ,EAAE,aAAa;QACvB,eAAe,EAAE,4BAA4B;QAC7C,MAAM,EAAE,SAAS;KAClB;CACmB,CAAA;AAEtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,eAAO,MAAM,YAAY,+CAoExB,CAAA"}
|
|
@@ -6,6 +6,8 @@ import { ProgressBar } from '../../components/ProgressBar.js';
|
|
|
6
6
|
import { useCurrentChat, useCurrentChatState, useWidgetState } from '../../context/hooks.js';
|
|
7
7
|
import { quickCommandRegex } from '../../regex.js';
|
|
8
8
|
import { ChatEntry } from '../../state/ChatEntry.js';
|
|
9
|
+
import { AgentSelector } from './AgentSelector.js';
|
|
10
|
+
import { ButtonAgent } from './ButtonAgent.js';
|
|
9
11
|
import { ButtonGroup } from './ButtonGroup.js';
|
|
10
12
|
import { useMessageInputDictionary } from './dictionary.js';
|
|
11
13
|
import { InfoBar } from './InfoBar.js';
|
|
@@ -26,6 +28,7 @@ export const MessageInput = () => {
|
|
|
26
28
|
const value = useCurrentChatState('nextMessage') ?? '';
|
|
27
29
|
const isMinimized = useWidgetState('isMinimized');
|
|
28
30
|
const textAreaRef = useRef(null);
|
|
31
|
+
const agentLabel = useCurrentChatState('agent')?.label ?? 'Stackspot AI';
|
|
29
32
|
const onSend = useCallback(async () => {
|
|
30
33
|
const message = chat.get('nextMessage');
|
|
31
34
|
if (!message)
|
|
@@ -47,7 +50,7 @@ export const MessageInput = () => {
|
|
|
47
50
|
if (!isLoading)
|
|
48
51
|
textAreaRef.current?.focus();
|
|
49
52
|
}, [isLoading]);
|
|
50
|
-
return (_jsxs(MessageInputBox, { "aria-busy": isLoading, className: "message-input", children: [_jsx(ProgressBar, { visible: isLoading, shimmer: true }), _jsx(InfoBar, {}), _jsxs("div", { className: listToClass(['action-box', focused && 'focused', isLoading && 'disabled']), children: [_jsx(
|
|
53
|
+
return (_jsxs(MessageInputBox, { "aria-busy": isLoading, className: "message-input", children: [_jsx(ProgressBar, { visible: isLoading, shimmer: true }), _jsx(InfoBar, {}), _jsx(QuickCommandSelector, { inputRef: textAreaRef }), _jsx(AgentSelector, { inputRef: textAreaRef }), _jsxs("div", { className: listToClass(['action-box', focused && 'focused', isLoading && 'disabled']), children: [_jsx(ButtonAgent, {}), _jsx(AdaptiveTextArea, { ref: textAreaRef, disabled: isLoading, placeholder: t.placeholder.replace('%s', agentLabel), onChange: e => chat.set('nextMessage', e.target.value), value: value, onFocus: () => setFocused(true), onBlur: () => setFocused(false), onKeyDown: onKeyDown, onIncreaseSize: () => setExpanded(false), onResetSize: () => !expansionLocked.current && setExpanded(true), maxHeight: isMinimized ? MIN_INPUT_HEIGHT : MAX_INPUT_HEIGHT }), _jsx(ButtonGroup, { onSend: onSend, onCancel: () => chat.abort(), expanded: expanded, isLoading: isLoading, setExpanded: (value) => {
|
|
51
54
|
setExpanded(value);
|
|
52
55
|
expansionLocked.current = expanded;
|
|
53
56
|
} })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,CAAC,GAAG,yBAAyB,EAAE,CAAA;IACrC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9C,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAC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U,CAAC,IAAI,CAAC,EAC/B,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAC/B,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EACxC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,EAChE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,GAC5D,EACF,KAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAC5B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;4BACrB,WAAW,CAAC,KAAK,CAAC,CAAA;4BAClB,eAAe,CAAC,OAAO,GAAG,QAAQ,CAAA;wBACpC,CAAC,GACD,IACE,IACU,CACnB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,MAAM,CAAA;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,MAAM,CAAA;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,eAAe,wOAkP3B,CAAA"}
|
|
@@ -86,12 +86,12 @@ export const MessageInputBox = styled.div `
|
|
|
86
86
|
display: flex;
|
|
87
87
|
position: relative;
|
|
88
88
|
flex-direction: row;
|
|
89
|
-
gap:
|
|
89
|
+
gap: 8px;
|
|
90
90
|
align-items: end;
|
|
91
91
|
border-radius: 4px;
|
|
92
92
|
border: 1px solid ${theme.color.light[500]};
|
|
93
93
|
background-color: ${theme.color.light[300]};
|
|
94
|
-
padding: 8px
|
|
94
|
+
padding: 10px 8px;
|
|
95
95
|
transition: border-color 0.3s, background-color 0.3s;
|
|
96
96
|
|
|
97
97
|
&.focused {
|
|
@@ -148,12 +148,16 @@ export const MessageInputBox = styled.div `
|
|
|
148
148
|
svg {
|
|
149
149
|
transform: rotate(180deg);
|
|
150
150
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
&.agent
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&.agent {
|
|
154
|
+
border-radius: 50%;
|
|
155
|
+
opacity: 1;
|
|
156
|
+
img {
|
|
157
|
+
width: 100%;
|
|
158
|
+
height: 100%;
|
|
159
|
+
border-radius: 50%;
|
|
160
|
+
}
|
|
157
161
|
}
|
|
158
162
|
}
|
|
159
163
|
|
|
@@ -189,6 +193,45 @@ export const MessageInputBox = styled.div `
|
|
|
189
193
|
width: 24px;
|
|
190
194
|
height: 24px;
|
|
191
195
|
}
|
|
196
|
+
|
|
197
|
+
.group-agent {
|
|
198
|
+
display: flex;
|
|
199
|
+
margin-left: 0.5rem;
|
|
200
|
+
margin-right: 0.5rem;
|
|
201
|
+
|
|
202
|
+
button {
|
|
203
|
+
margin-right: -0.5rem;
|
|
204
|
+
margin-left: -0.5rem;
|
|
205
|
+
border-radius: 50%;
|
|
206
|
+
background-color: ${theme.color.light[300]};
|
|
207
|
+
border: 1px solid ${theme.color.light[600]};
|
|
208
|
+
display: flex;
|
|
209
|
+
|
|
210
|
+
&.agent-selected:hover:before {
|
|
211
|
+
content: '';
|
|
212
|
+
width: 22px;
|
|
213
|
+
height: 22px;
|
|
214
|
+
position: absolute;
|
|
215
|
+
background-color: ${theme.color.light[300]};
|
|
216
|
+
border-radius: 100%;
|
|
217
|
+
opacity: 0.4;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.icon-remove {
|
|
221
|
+
display: none;
|
|
222
|
+
fill: ${theme.color.light.contrastText};
|
|
223
|
+
position: absolute;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&:hover .icon-remove {
|
|
227
|
+
display: flex;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.image {
|
|
231
|
+
margin: 1px;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
192
235
|
}
|
|
193
236
|
|
|
194
237
|
textarea {
|
|
@@ -204,141 +247,5 @@ export const MessageInputBox = styled.div `
|
|
|
204
247
|
box-shadow: none;
|
|
205
248
|
}
|
|
206
249
|
}
|
|
207
|
-
|
|
208
|
-
.quick-command-selector {
|
|
209
|
-
position: absolute;
|
|
210
|
-
border-radius: 4px;
|
|
211
|
-
border: 1px solid ${theme.color.light[600]};
|
|
212
|
-
background-color: ${theme.color.light[500]};
|
|
213
|
-
box-shadow: 0px 2px 16px 0px #0000005C;
|
|
214
|
-
display: flex;
|
|
215
|
-
flex-direction: column;
|
|
216
|
-
width: 480px;
|
|
217
|
-
bottom: 55px;
|
|
218
|
-
|
|
219
|
-
.loading, .error {
|
|
220
|
-
padding-bottom: 26px;
|
|
221
|
-
p {
|
|
222
|
-
width: 200px;
|
|
223
|
-
text-align: center;
|
|
224
|
-
line-height: 20px;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.empty {
|
|
229
|
-
padding-bottom: 26px;
|
|
230
|
-
width: 200px;
|
|
231
|
-
text-align: center;
|
|
232
|
-
line-height: 20px;
|
|
233
|
-
margin: auto;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
header {
|
|
237
|
-
display: flex;
|
|
238
|
-
flex-direction: row;
|
|
239
|
-
gap: 8px;
|
|
240
|
-
align-items: center;
|
|
241
|
-
padding: 8px;
|
|
242
|
-
font-family: 'San Francisco';
|
|
243
|
-
font-weight: 500;
|
|
244
|
-
font-size: 11px;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.body {
|
|
248
|
-
display: flex;
|
|
249
|
-
flex-direction: row;
|
|
250
|
-
align-items: center;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
ul {
|
|
254
|
-
margin: 0;
|
|
255
|
-
padding: 0;
|
|
256
|
-
list-style: none;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
ul.tabs {
|
|
260
|
-
display: flex;
|
|
261
|
-
flex-direction: column;
|
|
262
|
-
|
|
263
|
-
li {
|
|
264
|
-
display: flex;
|
|
265
|
-
flex-direction: column;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
button {
|
|
269
|
-
box-sizing: border-box;
|
|
270
|
-
color: ${theme.color.light[700]};
|
|
271
|
-
text-align: left;
|
|
272
|
-
padding: 10px;
|
|
273
|
-
font-weight: 600;
|
|
274
|
-
font-size: 12px;
|
|
275
|
-
transition: background-color 0.3s;
|
|
276
|
-
border-top-right-radius: 4px;
|
|
277
|
-
border-bottom-right-radius: 4px;
|
|
278
|
-
background-color: transparent;
|
|
279
|
-
border: none;
|
|
280
|
-
cursor: pointer;
|
|
281
|
-
outline: none;
|
|
282
|
-
|
|
283
|
-
&:hover, &.active, &:focus {
|
|
284
|
-
background-color: ${theme.color.light[600]};
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
&.active {
|
|
288
|
-
border-left: 1px solid ${theme.color.light.contrastText};
|
|
289
|
-
color: ${theme.color.light.contrastText};
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
ul.command-list {
|
|
295
|
-
align-self: stretch;
|
|
296
|
-
display: flex;
|
|
297
|
-
flex-direction: column;
|
|
298
|
-
gap: 2px;
|
|
299
|
-
overflow-y: auto;
|
|
300
|
-
flex: 1;
|
|
301
|
-
max-height: 170px;
|
|
302
|
-
|
|
303
|
-
li {
|
|
304
|
-
display: flex;
|
|
305
|
-
flex-direction: row;
|
|
306
|
-
align-items: center;
|
|
307
|
-
gap: 8px;
|
|
308
|
-
padding: 8px;
|
|
309
|
-
border-radius: 4px;
|
|
310
|
-
|
|
311
|
-
&:hover, &.focus {
|
|
312
|
-
background-color: ${theme.color.light[600]};
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
button.qc {
|
|
316
|
-
flex: 1;
|
|
317
|
-
border: none;
|
|
318
|
-
text-align: left;
|
|
319
|
-
background-color: transparent;
|
|
320
|
-
text-align: left;
|
|
321
|
-
outline: none;
|
|
322
|
-
overflow: hidden;
|
|
323
|
-
cursor: pointer;
|
|
324
|
-
|
|
325
|
-
.qc-title {
|
|
326
|
-
font-size: 11px;
|
|
327
|
-
margin: 0 0 4px 0;
|
|
328
|
-
color: ${theme.color.light.contrastText};
|
|
329
|
-
text-transform: uppercase;
|
|
330
|
-
text-overflow: ellipsis;
|
|
331
|
-
overflow: hidden;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.qc-description {
|
|
335
|
-
color: ${theme.color.light[700]};
|
|
336
|
-
font-size: 12px;
|
|
337
|
-
margin: 0;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
250
|
`;
|
|
344
251
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAC/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;AACnC,MAAM,CAAC,MA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