@inkeep/agents-ui 0.15.30 → 0.16.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/index.cjs +1 -1
- package/dist/index.js +74 -73
- package/dist/primitives/atoms/markdown/index.cjs +1 -1
- package/dist/primitives/atoms/markdown/index.js +41 -39
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.js +691 -695
- package/dist/primitives/hooks/use-simple-scroll.cjs +1 -1
- package/dist/primitives/hooks/use-simple-scroll.d.ts +7 -0
- package/dist/primitives/hooks/use-simple-scroll.js +33 -30
- package/dist/primitives/index.cjs +1 -1
- package/dist/primitives/index.js +55 -54
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/utils/default-settings.cjs +1 -1
- package/dist/primitives/utils/default-settings.d.ts +1 -0
- package/dist/primitives/utils/default-settings.js +6 -5
- package/dist/primitives/utils/misc.cjs +5 -1
- package/dist/primitives/utils/misc.d.ts +2 -1
- package/dist/primitives/utils/misc.js +45 -20
- package/dist/react/embedded-chat.cjs +1 -1
- package/dist/react/embedded-chat.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +74 -73
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.js +65 -67
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +60 -59
- package/dist/types/config/ai.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),h=10;function T(f={}){const{isStreaming:r=!1,enabled:a=!0}=f,o=e.useRef(null),n=e.useRef(!0),s=e.useRef(!1),l=e.useRef(null),u=e.useCallback(()=>{const t=o.current;if(!t)return!0;const{scrollTop:c,scrollHeight:m,clientHeight:R}=t;return m-c-R<=h},[]),i=e.useCallback((t=!0)=>{const c=o.current;c&&(s.current||!n.current||c.scrollTo({top:c.scrollHeight,behavior:t?"smooth":"auto"}))},[]),S=e.useCallback(()=>{o.current&&(s.current=!0,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s.current=!1,r&&u()&&(n.current=!0)},150),r&&!u()&&(n.current=!1))},[r,u]);e.useEffect(()=>{if(!a||!r)return;const t=o.current;if(!t)return;const c=new MutationObserver(()=>{n.current&&!s.current&&r&&i(!1)});return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>c.disconnect()},[r,i,a]),e.useEffect(()=>{r&&(n.current=u())},[r,u]),e.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const b=e.useCallback(()=>{n.current=!0},[]);return{containerRef:o,scrollToBottom:i,handleScroll:S,isAtBottom:u,enableAutoScroll:b,shouldAutoScroll:()=>n.current}}exports.useSimpleScroll=T;
|
|
@@ -5,12 +5,19 @@ export interface UseSimpleScrollOptions {
|
|
|
5
5
|
* When true, auto-scroll behavior is enabled.
|
|
6
6
|
*/
|
|
7
7
|
isStreaming?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether auto-scroll is enabled at all.
|
|
10
|
+
* When false, all auto-scroll behavior is disabled.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
enabled?: boolean;
|
|
8
14
|
}
|
|
9
15
|
export declare function useSimpleScroll(options?: UseSimpleScrollOptions): {
|
|
10
16
|
containerRef: RefObject<HTMLDivElement | null>;
|
|
11
17
|
scrollToBottom: (smooth?: boolean) => void;
|
|
12
18
|
handleScroll: () => void;
|
|
13
19
|
isAtBottom: () => boolean;
|
|
20
|
+
enableAutoScroll: () => void;
|
|
14
21
|
/** Whether auto-scroll is currently active (not hijacked by user) */
|
|
15
22
|
shouldAutoScroll: () => boolean;
|
|
16
23
|
};
|
|
@@ -1,51 +1,54 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { isStreaming: r = !1 } =
|
|
6
|
-
const t = o.current;
|
|
7
|
-
if (!t) return !0;
|
|
8
|
-
const { scrollTop: e, scrollHeight: S, clientHeight: T } = t;
|
|
9
|
-
return S - e - T <= R;
|
|
10
|
-
}, []), i = f((t = !0) => {
|
|
2
|
+
import { useRef as s, useCallback as i, useEffect as f } from "react";
|
|
3
|
+
const d = 10;
|
|
4
|
+
function p(S = {}) {
|
|
5
|
+
const { isStreaming: r = !1, enabled: m = !0 } = S, o = s(null), n = s(!0), l = s(!1), u = s(null), c = i(() => {
|
|
11
6
|
const e = o.current;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
if (!e) return !0;
|
|
8
|
+
const { scrollTop: t, scrollHeight: T, clientHeight: R } = e;
|
|
9
|
+
return T - t - R <= d;
|
|
10
|
+
}, []), a = i((e = !0) => {
|
|
11
|
+
const t = o.current;
|
|
12
|
+
t && (l.current || !n.current || t.scrollTo({
|
|
13
|
+
top: t.scrollHeight,
|
|
14
|
+
behavior: e ? "smooth" : "auto"
|
|
15
15
|
}));
|
|
16
|
-
}, []), h =
|
|
17
|
-
o.current && (
|
|
18
|
-
|
|
16
|
+
}, []), h = i(() => {
|
|
17
|
+
o.current && (l.current = !0, u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
18
|
+
l.current = !1, r && c() && (n.current = !0);
|
|
19
19
|
}, 150), r && !c() && (n.current = !1));
|
|
20
20
|
}, [r, c]);
|
|
21
|
-
|
|
22
|
-
if (!r)
|
|
23
|
-
n.current = !0;
|
|
21
|
+
f(() => {
|
|
22
|
+
if (!m || !r)
|
|
24
23
|
return;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
n.current && !s.current && r && i(!1);
|
|
24
|
+
const e = o.current;
|
|
25
|
+
if (!e) return;
|
|
26
|
+
const t = new MutationObserver(() => {
|
|
27
|
+
n.current && !l.current && r && a(!1);
|
|
30
28
|
});
|
|
31
|
-
return
|
|
29
|
+
return t.observe(e, {
|
|
32
30
|
childList: !0,
|
|
33
31
|
subtree: !0,
|
|
34
32
|
characterData: !0
|
|
35
|
-
}), () =>
|
|
36
|
-
}, [r,
|
|
33
|
+
}), () => t.disconnect();
|
|
34
|
+
}, [r, a, m]), f(() => {
|
|
37
35
|
r && (n.current = c());
|
|
38
|
-
}, [r, c]),
|
|
36
|
+
}, [r, c]), f(() => () => {
|
|
39
37
|
u.current && clearTimeout(u.current);
|
|
40
|
-
}, [])
|
|
38
|
+
}, []);
|
|
39
|
+
const b = i(() => {
|
|
40
|
+
n.current = !0;
|
|
41
|
+
}, []);
|
|
42
|
+
return {
|
|
41
43
|
containerRef: o,
|
|
42
|
-
scrollToBottom:
|
|
44
|
+
scrollToBottom: a,
|
|
43
45
|
handleScroll: h,
|
|
44
46
|
isAtBottom: c,
|
|
47
|
+
enableAutoScroll: b,
|
|
45
48
|
/** Whether auto-scroll is currently active (not hijacked by user) */
|
|
46
49
|
shouldAutoScroll: () => n.current
|
|
47
50
|
};
|
|
48
51
|
}
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
p as useSimpleScroll
|
|
51
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./providers/base-events-provider.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./providers/base-events-provider.cjs"),i=require("./providers/chat-form-provider.cjs"),c=require("./providers/chat-history-provider.cjs"),n=require("./providers/config-provider.cjs"),l=require("./providers/feedback-provider.cjs"),p=require("./providers/form-field-provider.cjs"),d=require("./providers/help-menu-provider.cjs"),h=require("./providers/markdown-provider.cjs"),u=require("./providers/message-provider.cjs"),M=require("./providers/root-provider.cjs"),v=require("./providers/source-item-provider.cjs"),y=require("./providers/theme-provider.cjs"),P=require("./providers/widget-provider.cjs"),t=require("./providers/sidebar-chat-provider.cjs"),s=require("./providers/chat-bubble-provider.cjs"),S=require("./components/factory.cjs"),B=require("./components/embedded-chat.cjs"),k=require("./components/sidebar-chat/index.cjs"),I=require("./components/embedded-chat/chat-provider.cjs"),F=require("./components/embedded-search.cjs"),m=require("./components/embedded-search/search-provider.cjs"),f=require("./components/modal.cjs"),b=require("./components/modal/modal-provider.cjs"),R=require("./components/chat-button.cjs"),w=require("./components/searchbar.cjs"),H=require("./components/chat-bubble/index.cjs"),O=require("./components/data-summaries.cjs"),E=require("./components/chat-history/index.cjs"),T=require("./hooks/use-boolean.cjs"),W=require("./hooks/use-component-classnames.cjs"),x=require("./hooks/use-container-size.cjs"),A=require("./hooks/use-inkeep-open-state.cjs"),D=require("./hooks/use-copy-to-clipboard.cjs"),z=require("./hooks/use-instant-update.cjs"),L=require("./hooks/use-is-mounted.cjs"),j=require("./hooks/use-media-query.cjs"),Q=require("./hooks/use-resize-observer.cjs"),q=require("./hooks/use-scrolling-fades.cjs"),U=require("./hooks/use-settle-action.cjs"),$=require("./hooks/use-simple-scroll.cjs"),o=require("./utils/misc.cjs"),e=require("./utils/component-ids.cjs"),g=require("./utils/compose-refs.cjs"),K=require("./utils/merge-props.cjs"),N=require("./atoms/portal.cjs"),G=require("./atoms/icons/custom-icon.cjs"),J=require("./atoms/icons/built-in-icon-renderer.cjs"),V=require("./atoms/portal-with-theme.cjs"),r=require("./atoms/cmdk/index.cjs"),X=require("./atoms/error-boundary.cjs"),a=require("./atoms/shadow/context.cjs");exports.BaseEventsProvider=C.BaseEventsProvider;exports.useBaseEvents=C.useBaseEvents;exports.ChatFormProvider=i.ChatFormProvider;exports.useChatForm=i.useChatForm;exports.useChatFormState=i.useChatFormState;exports.ChatHistoryProvider=c.ChatHistoryProvider;exports.useChatHistory=c.useChatHistory;exports.InkeepConfigProvider=n.InkeepConfigProvider;exports.WebWidgetInteractionType=n.WebWidgetInteractionType;exports.useInkeepConfig=n.useInkeepConfig;exports.FeedbackProvider=l.FeedbackProvider;exports.useMessageFeedback=l.useMessageFeedback;exports.FormFieldProvider=p.FormFieldProvider;exports.useFormField=p.useFormField;exports.HelpMenuProvider=d.HelpMenuProvider;exports.useHelpMenu=d.useHelpMenu;exports.useHelpMenuState=d.useHelpMenuState;exports.ChatMarkdownProvider=h.ChatMarkdownProvider;exports.useChatMarkdown=h.useChatMarkdown;exports.MessageProvider=u.MessageProvider;exports.useMessage=u.useMessage;exports.useOptionalMessage=u.useOptionalMessage;exports.RootProvider=M.RootProvider;exports.SourceItemProvider=v.SourceItemProvider;exports.useSourceItem=v.useSourceItem;exports.ThemeProvider=y.ThemeProvider;exports.WidgetProvider=P.WidgetProvider;exports.useWidget=P.useWidget;exports.SidebarChatProvider=t.SidebarChatProvider;exports.useInkeepSidebarChat=t.useInkeepSidebarChat;exports.useOptionalSidebarChat=t.useOptionalSidebarChat;exports.useSidebarChat=t.useSidebarChat;exports.ChatBubbleProvider=s.ChatBubbleProvider;exports.useChatBubble=s.useChatBubble;exports.useInkeepChatBubble=s.useInkeepChatBubble;exports.useOptionalChatBubble=s.useOptionalChatBubble;exports.ikp=S.ikp;exports.jsxFactory=S.jsxFactory;exports.EmbeddedChatPrimitive=B;exports.SidebarChatPrimitive=k;exports.ChatProvider=I.ChatProvider;exports.useChat=I.useChat;exports.EmbeddedSearchPrimitive=F;exports.SearchProvider=m.SearchProvider;exports.SearchProviderImpl=m.SearchProviderImpl;exports.useSearch=m.useSearch;exports.ModalPrimitive=f;exports.ModalProvider=b.ModalProvider;exports.useModal=b.useModal;exports.ChatButtonPrimitive=R;exports.SearchBarPrimitive=w;exports.ChatBubblePrimitive=H;exports.DataSummaryPrimitive=O;exports.ChatHistoryPrimitive=E;exports.useBoolean=T.useBoolean;exports.useComponentClassNames=W.useComponentClassNames;exports.useContainerSize=x.useContainerSize;exports.useInkeepOpenState=A.useInkeepOpenState;exports.useCopyToClipboard=D.useCopyToClipboard;exports.useInstantUpdate=z.useInstantUpdate;exports.useIsMounted=L.useIsMounted;exports.useMediaQuery=j.useMediaQuery;exports.useResizeObserver=Q.useResizeObserver;exports.useScrollingFades=q.useScrollingFades;exports.useScrollingFadesHorizontal=q.useScrollingFadesHorizontal;exports.useSettleAction=U.useSettleAction;exports.useSimpleScroll=$.useSimpleScroll;exports.callAll=o.callAll;exports.dataAttr=o.dataAttr;exports.getInitials=o.getInitials;exports.getMessageContent=o.getMessageContent;exports.isCitationArtifact=o.isCitationArtifact;exports.isString=o.isString;exports.maybeRender=o.maybeRender;exports.toKebabCase=o.toKebabCase;exports.ChatBubbleComponentIds=e.ChatBubbleComponentIds;exports.DataSummaryComponentIds=e.DataSummaryComponentIds;exports.SearchBarComponentIds=e.SearchBarComponentIds;exports.SidebarChatComponentIds=e.SidebarChatComponentIds;exports.aiChatComponentIds=e.aiChatComponentIds;exports.aiChatHistoryComponentIds=e.aiChatHistoryComponentIds;exports.aiSearchComponentIds=e.aiSearchComponentIds;exports.chatButtonComponentIds=e.chatButtonComponentIds;exports.componentIDs=e.componentIDs;exports.markDownComponentIds=e.markDownComponentIds;exports.miscellanousComponentIds=e.miscellanousComponentIds;exports.modalComponentIds=e.modalComponentIds;exports.composeRefs=g.composeRefs;exports.useComposedRefs=g.useComposedRefs;exports.mergeProps=K.mergeProps;exports.Portal=N.Portal;exports.CustomIcon=G.CustomIcon;exports.BuiltInIconRenderer=J.BuiltInIconRenderer;exports.PortalWithTheme=V.PortalWithTheme;exports.Command=r.Command;exports.CommandDialog=r.CommandDialog;exports.CommandEmpty=r.CommandEmpty;exports.CommandInput=r.CommandInput;exports.CommandItem=r.CommandItem;exports.CommandList=r.CommandList;exports.CommandLoading=r.CommandLoading;exports.CommandRoot=r.CommandRoot;exports.CommandSeparator=r.CommandSeparator;exports.defaultFilter=r.defaultFilter;exports.useCommandState=r.useCommandState;exports.useCommandStore=r.useCommandStore;exports.ErrorBoundary=X.ErrorBoundary;exports.InkeepShadow=a.InkeepShadow;exports.InkeepShadowProvider=a.InkeepShadowProvider;exports.ShadowContext=a.ShadowContext;exports.useShadow=a.useShadow;
|
package/dist/primitives/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import { InkeepConfigProvider as I, WebWidgetInteractionType as c, useInkeepConf
|
|
|
5
5
|
import { FeedbackProvider as M, useMessageFeedback as k } from "./providers/feedback-provider.js";
|
|
6
6
|
import { FormFieldProvider as F, useFormField as H } from "./providers/form-field-provider.js";
|
|
7
7
|
import { HelpMenuProvider as R, useHelpMenu as E, useHelpMenuState as D } from "./providers/help-menu-provider.js";
|
|
8
|
-
import { ChatMarkdownProvider as W, useChatMarkdown as
|
|
9
|
-
import { MessageProvider as
|
|
8
|
+
import { ChatMarkdownProvider as W, useChatMarkdown as A } from "./providers/markdown-provider.js";
|
|
9
|
+
import { MessageProvider as z, useMessage as L, useOptionalMessage as $ } from "./providers/message-provider.js";
|
|
10
10
|
import { RootProvider as K } from "./providers/root-provider.js";
|
|
11
11
|
import { SourceItemProvider as Q, useSourceItem as U } from "./providers/source-item-provider.js";
|
|
12
12
|
import { ThemeProvider as G } from "./providers/theme-provider.js";
|
|
@@ -34,25 +34,25 @@ import { useCopyToClipboard as He } from "./hooks/use-copy-to-clipboard.js";
|
|
|
34
34
|
import { useInstantUpdate as Re } from "./hooks/use-instant-update.js";
|
|
35
35
|
import { useIsMounted as De } from "./hooks/use-is-mounted.js";
|
|
36
36
|
import { useMediaQuery as We } from "./hooks/use-media-query.js";
|
|
37
|
-
import { useResizeObserver as
|
|
37
|
+
import { useResizeObserver as Te } from "./hooks/use-resize-observer.js";
|
|
38
38
|
import { useScrollingFades as Le, useScrollingFadesHorizontal as $e } from "./hooks/use-scrolling-fades.js";
|
|
39
39
|
import { useSettleAction as Ke } from "./hooks/use-settle-action.js";
|
|
40
40
|
import { useSimpleScroll as Qe } from "./hooks/use-simple-scroll.js";
|
|
41
|
-
import { callAll as qe, dataAttr as Ge, getInitials as Je, getMessageContent as Ve,
|
|
42
|
-
import { ChatBubbleComponentIds as
|
|
43
|
-
import { composeRefs as
|
|
44
|
-
import { mergeProps as
|
|
45
|
-
import { Portal as
|
|
46
|
-
import { CustomIcon as
|
|
47
|
-
import { BuiltInIconRenderer as
|
|
48
|
-
import { PortalWithTheme as
|
|
49
|
-
import { Command as
|
|
50
|
-
import { ErrorBoundary as
|
|
51
|
-
import { InkeepShadow as
|
|
41
|
+
import { callAll as qe, dataAttr as Ge, getInitials as Je, getMessageContent as Ve, isCitationArtifact as Xe, isString as Ye, maybeRender as Ze, toKebabCase as _e } from "./utils/misc.js";
|
|
42
|
+
import { ChatBubbleComponentIds as oo, DataSummaryComponentIds as ro, SearchBarComponentIds as to, SidebarChatComponentIds as ao, aiChatComponentIds as mo, aiChatHistoryComponentIds as so, aiSearchComponentIds as io, chatButtonComponentIds as po, componentIDs as no, markDownComponentIds as uo, miscellanousComponentIds as Co, modalComponentIds as fo } from "./utils/component-ids.js";
|
|
43
|
+
import { composeRefs as ho, useComposedRefs as lo } from "./utils/compose-refs.js";
|
|
44
|
+
import { mergeProps as vo } from "./utils/merge-props.js";
|
|
45
|
+
import { Portal as bo } from "./atoms/portal.js";
|
|
46
|
+
import { CustomIcon as co } from "./atoms/icons/custom-icon.js";
|
|
47
|
+
import { BuiltInIconRenderer as Bo } from "./atoms/icons/built-in-icon-renderer.js";
|
|
48
|
+
import { PortalWithTheme as ko } from "./atoms/portal-with-theme.js";
|
|
49
|
+
import { Command as Fo, CommandDialog as Ho, CommandEmpty as wo, CommandInput as Ro, CommandItem as Eo, CommandList as Do, CommandLoading as Oo, CommandRoot as Wo, CommandSeparator as Ao, defaultFilter as To, useCommandState as zo, useCommandStore as Lo } from "./atoms/cmdk/index.js";
|
|
50
|
+
import { ErrorBoundary as jo } from "./atoms/error-boundary.js";
|
|
51
|
+
import { InkeepShadow as No, InkeepShadowProvider as Qo, ShadowContext as Uo, useShadow as qo } from "./atoms/shadow/context.js";
|
|
52
52
|
export {
|
|
53
53
|
u as BaseEventsProvider,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
Bo as BuiltInIconRenderer,
|
|
55
|
+
oo as ChatBubbleComponentIds,
|
|
56
56
|
s as ChatBubblePrimitive,
|
|
57
57
|
te as ChatBubbleProvider,
|
|
58
58
|
a as ChatButtonPrimitive,
|
|
@@ -61,65 +61,66 @@ export {
|
|
|
61
61
|
v as ChatHistoryProvider,
|
|
62
62
|
W as ChatMarkdownProvider,
|
|
63
63
|
ue as ChatProvider,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
Fo as Command,
|
|
65
|
+
Ho as CommandDialog,
|
|
66
|
+
wo as CommandEmpty,
|
|
67
|
+
Ro as CommandInput,
|
|
68
|
+
Eo as CommandItem,
|
|
69
|
+
Do as CommandList,
|
|
70
|
+
Oo as CommandLoading,
|
|
71
|
+
Wo as CommandRoot,
|
|
72
|
+
Ao as CommandSeparator,
|
|
73
|
+
co as CustomIcon,
|
|
74
|
+
ro as DataSummaryComponentIds,
|
|
75
75
|
i as DataSummaryPrimitive,
|
|
76
76
|
e as EmbeddedChatPrimitive,
|
|
77
77
|
r as EmbeddedSearchPrimitive,
|
|
78
|
-
|
|
78
|
+
jo as ErrorBoundary,
|
|
79
79
|
M as FeedbackProvider,
|
|
80
80
|
F as FormFieldProvider,
|
|
81
81
|
R as HelpMenuProvider,
|
|
82
82
|
I as InkeepConfigProvider,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
No as InkeepShadow,
|
|
84
|
+
Qo as InkeepShadowProvider,
|
|
85
|
+
z as MessageProvider,
|
|
86
86
|
t as ModalPrimitive,
|
|
87
87
|
ve as ModalProvider,
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
bo as Portal,
|
|
89
|
+
ko as PortalWithTheme,
|
|
90
90
|
K as RootProvider,
|
|
91
|
-
|
|
91
|
+
to as SearchBarComponentIds,
|
|
92
92
|
m as SearchBarPrimitive,
|
|
93
93
|
xe as SearchProvider,
|
|
94
94
|
he as SearchProviderImpl,
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
Uo as ShadowContext,
|
|
96
|
+
ao as SidebarChatComponentIds,
|
|
97
97
|
o as SidebarChatPrimitive,
|
|
98
98
|
Z as SidebarChatProvider,
|
|
99
99
|
Q as SourceItemProvider,
|
|
100
100
|
G as ThemeProvider,
|
|
101
101
|
c as WebWidgetInteractionType,
|
|
102
102
|
V as WidgetProvider,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
mo as aiChatComponentIds,
|
|
104
|
+
so as aiChatHistoryComponentIds,
|
|
105
|
+
io as aiSearchComponentIds,
|
|
106
106
|
qe as callAll,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
po as chatButtonComponentIds,
|
|
108
|
+
no as componentIDs,
|
|
109
|
+
ho as composeRefs,
|
|
110
110
|
Ge as dataAttr,
|
|
111
111
|
To as defaultFilter,
|
|
112
112
|
Je as getInitials,
|
|
113
113
|
Ve as getMessageContent,
|
|
114
114
|
pe as ikp,
|
|
115
|
-
Xe as
|
|
115
|
+
Xe as isCitationArtifact,
|
|
116
|
+
Ye as isString,
|
|
116
117
|
de as jsxFactory,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
uo as markDownComponentIds,
|
|
119
|
+
Ze as maybeRender,
|
|
120
|
+
vo as mergeProps,
|
|
121
|
+
Co as miscellanousComponentIds,
|
|
122
|
+
fo as modalComponentIds,
|
|
123
|
+
_e as toKebabCase,
|
|
123
124
|
C as useBaseEvents,
|
|
124
125
|
Ie as useBoolean,
|
|
125
126
|
Ce as useChat,
|
|
@@ -127,11 +128,11 @@ export {
|
|
|
127
128
|
h as useChatForm,
|
|
128
129
|
l as useChatFormState,
|
|
129
130
|
P as useChatHistory,
|
|
130
|
-
|
|
131
|
+
A as useChatMarkdown,
|
|
131
132
|
zo as useCommandState,
|
|
132
|
-
|
|
133
|
+
Lo as useCommandStore,
|
|
133
134
|
ge as useComponentClassNames,
|
|
134
|
-
|
|
135
|
+
lo as useComposedRefs,
|
|
135
136
|
Me as useContainerSize,
|
|
136
137
|
He as useCopyToClipboard,
|
|
137
138
|
H as useFormField,
|
|
@@ -150,12 +151,12 @@ export {
|
|
|
150
151
|
se as useOptionalChatBubble,
|
|
151
152
|
$ as useOptionalMessage,
|
|
152
153
|
ee as useOptionalSidebarChat,
|
|
153
|
-
|
|
154
|
+
Te as useResizeObserver,
|
|
154
155
|
Le as useScrollingFades,
|
|
155
156
|
$e as useScrollingFadesHorizontal,
|
|
156
157
|
le as useSearch,
|
|
157
158
|
Ke as useSettleAction,
|
|
158
|
-
|
|
159
|
+
qo as useShadow,
|
|
159
160
|
oe as useSidebarChat,
|
|
160
161
|
Qe as useSimpleScroll,
|
|
161
162
|
U as useSourceItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.16.0",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
|
|
@@ -5,7 +5,7 @@ import { useInkeepConfig as g } from "./config-provider.js";
|
|
|
5
5
|
const a = d(void 0), P = ({ children: e }) => {
|
|
6
6
|
const { baseSettings: t, componentType: o } = g(), { tags: s, analyticsProperties: n } = t, r = u(
|
|
7
7
|
() => ({
|
|
8
|
-
widgetLibraryVersion: "0.
|
|
8
|
+
widgetLibraryVersion: "0.16.0",
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../theme/index.cjs"),t=require("../../theme/colors.cjs"),s={baseUrl:"https://api.agents.inkeep.com",placeholder:"How do I get started?",aiAssistantName:void 0,shouldOpenLinksInNewTab:!0,disclaimerSettings:{isEnabled:!1,label:"Usage policy"},isShareButtonVisible:!1,isViewOnly:!1,isChatHistoryButtonVisible:!0,exampleQuestionsLabel:"Example questions",exampleQuestions:[],isFirstExampleQuestionHighlighted:!0,isCopyChatButtonVisible:!1,getHelpOptions:[],toolbarButtonLabels:{clear:"Clear",share:"Share",getHelp:"Get help",stop:"Stop",copyChat:"Copy"},context:{}},a={shouldBypassCaptcha:!1,tags:[],userProperties:{},primaryBrandColor:t.DEFAULT_PRIMARY_BRAND_COLOR,theme:{varsClassName:"inkeep-widget-vars",...e.theme}},
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../theme/index.cjs"),t=require("../../theme/colors.cjs"),s={baseUrl:"https://api.agents.inkeep.com",placeholder:"How do I get started?",aiAssistantName:void 0,shouldOpenLinksInNewTab:!0,disclaimerSettings:{isEnabled:!1,label:"Usage policy"},isShareButtonVisible:!1,isViewOnly:!1,isChatHistoryButtonVisible:!0,exampleQuestionsLabel:"Example questions",exampleQuestions:[],isFirstExampleQuestionHighlighted:!0,isCopyChatButtonVisible:!1,getHelpOptions:[],toolbarButtonLabels:{clear:"Clear",share:"Share",getHelp:"Get help",stop:"Stop",copyChat:"Copy"},context:{},shouldAutoScroll:!0},a={shouldBypassCaptcha:!1,tags:[],userProperties:{},primaryBrandColor:t.DEFAULT_PRIMARY_BRAND_COLOR,theme:{varsClassName:"inkeep-widget-vars",...e.theme}},l={shouldOpenLinksInNewTab:!1,defaultQuery:"",debounceTimeMs:0,tabs:["All","Publications","PDFs","GitHub","Forums","Discord","Slack","StackOverflow"],placeholder:"Search for anything...",view:"single-pane"};exports.defaultInkeepAIChatSettings=s;exports.defaultInkeepBaseSettings=a;exports.defaultInkeepSearchSettings=l;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { theme as e } from "../../theme/index.js";
|
|
3
3
|
import { DEFAULT_PRIMARY_BRAND_COLOR as t } from "../../theme/colors.js";
|
|
4
|
-
const
|
|
4
|
+
const l = {
|
|
5
5
|
baseUrl: "https://api.agents.inkeep.com",
|
|
6
6
|
placeholder: "How do I get started?",
|
|
7
7
|
aiAssistantName: void 0,
|
|
@@ -25,8 +25,9 @@ const i = {
|
|
|
25
25
|
stop: "Stop",
|
|
26
26
|
copyChat: "Copy"
|
|
27
27
|
},
|
|
28
|
-
context: {}
|
|
29
|
-
|
|
28
|
+
context: {},
|
|
29
|
+
shouldAutoScroll: !0
|
|
30
|
+
}, i = {
|
|
30
31
|
shouldBypassCaptcha: !1,
|
|
31
32
|
tags: [],
|
|
32
33
|
userProperties: {},
|
|
@@ -44,7 +45,7 @@ const i = {
|
|
|
44
45
|
view: "single-pane"
|
|
45
46
|
};
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
l as defaultInkeepAIChatSettings,
|
|
49
|
+
i as defaultInkeepBaseSettings,
|
|
49
50
|
o as defaultInkeepSearchSettings
|
|
50
51
|
};
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(...t)=>(...n)=>{for(const a of t)a?.(...n)},l=t=>typeof t=="string";function f(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/__/g,"__").toLowerCase()}const g=t=>t?"":void 0;function d(t){const n=t.split(" "),a=n[0]??"",o=n.length>1?n[n.length-1]:"";return a&&o?`${a.charAt(0)}${o.charAt(0)}`:a.charAt(0)}function m(t,n){return typeof t=="function"?t(n):t}function i(t){return t.type==="data-artifact"&&t.data?.type?.toLowerCase()==="citation"}const y=t=>{const n=e=>e.data?.artifactSummary?.title||e.data?.name||"Source",a=t.parts?.map(e=>{if(e.type==="text")return e.text;if(e.type==="data-component")return JSON.stringify(e.data);if(i(e)){const r=e.data?.artifactSummary?.url;return r?`[${n(e)}](${r})`:null}return null}).join("")??"",o=new Set,s=t.parts?.filter(i).filter(e=>{const r=e.data?.artifactSummary?.url;return!r||o.has(r)?!1:(o.add(r),!0)})??[];if(!s.length)return a;const c=`
|
|
2
|
+
|
|
3
|
+
**Sources:**
|
|
4
|
+
`+s.map(e=>{const r=e.data?.artifactSummary?.url;return`- [${n(e)}](${r})`}).join(`
|
|
5
|
+
`);return a+c};exports.callAll=u;exports.dataAttr=g;exports.getInitials=d;exports.getMessageContent=y;exports.isCitationArtifact=i;exports.isString=l;exports.maybeRender=m;exports.toKebabCase=f;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Message } from '../../types/index.ts';
|
|
1
|
+
import { ArtifactPart, Message } from '../../types/index.ts';
|
|
2
2
|
export declare const callAll: <T extends (...a: any[]) => void>(...fns: (T | undefined)[]) => (...a: Parameters<T>) => void;
|
|
3
3
|
export declare const isString: (v: any) => v is string;
|
|
4
4
|
/**
|
|
@@ -9,4 +9,5 @@ export type Booleanish = boolean | 'true' | 'false';
|
|
|
9
9
|
export declare const dataAttr: (guard: boolean | undefined) => Booleanish;
|
|
10
10
|
export declare function getInitials(name: string): string;
|
|
11
11
|
export declare function maybeRender<T>(children: ((param: T) => React.ReactNode) | React.ReactNode, param: T): React.ReactNode;
|
|
12
|
+
export declare function isCitationArtifact(part: Message['parts'][number]): part is ArtifactPart;
|
|
12
13
|
export declare const getMessageContent: (message: Message) => string;
|
|
@@ -1,31 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const
|
|
2
|
+
const c = (
|
|
3
3
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
4
4
|
(...t) => (...e) => {
|
|
5
|
-
for (const
|
|
6
|
-
|
|
5
|
+
for (const r of t)
|
|
6
|
+
r?.(...e);
|
|
7
7
|
}
|
|
8
|
-
),
|
|
9
|
-
function
|
|
8
|
+
), l = (t) => typeof t == "string";
|
|
9
|
+
function f(t) {
|
|
10
10
|
return t.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/__/g, "__").toLowerCase();
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
const e = t.split(" "),
|
|
15
|
-
return
|
|
12
|
+
const m = (t) => t ? "" : void 0;
|
|
13
|
+
function d(t) {
|
|
14
|
+
const e = t.split(" "), r = e[0] ?? "", o = e.length > 1 ? e[e.length - 1] : "";
|
|
15
|
+
return r && o ? `${r.charAt(0)}${o.charAt(0)}` : r.charAt(0);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function y(t, e) {
|
|
18
18
|
return typeof t == "function" ? t(e) : t;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
function s(t) {
|
|
21
|
+
return t.type === "data-artifact" && t.data?.type?.toLowerCase() === "citation";
|
|
22
|
+
}
|
|
23
|
+
const g = (t) => {
|
|
24
|
+
const e = (n) => n.data?.artifactSummary?.title || n.data?.name || "Source", r = t.parts?.map((n) => {
|
|
25
|
+
if (n.type === "text") return n.text;
|
|
26
|
+
if (n.type === "data-component") return JSON.stringify(n.data);
|
|
27
|
+
if (s(n)) {
|
|
28
|
+
const a = n.data?.artifactSummary?.url;
|
|
29
|
+
return a ? `[${e(n)}](${a})` : null;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}).join("") ?? "", o = /* @__PURE__ */ new Set(), i = t.parts?.filter(s).filter((n) => {
|
|
33
|
+
const a = n.data?.artifactSummary?.url;
|
|
34
|
+
return !a || o.has(a) ? !1 : (o.add(a), !0);
|
|
35
|
+
}) ?? [];
|
|
36
|
+
if (!i.length) return r;
|
|
37
|
+
const u = `
|
|
38
|
+
|
|
39
|
+
**Sources:**
|
|
40
|
+
` + i.map((n) => {
|
|
41
|
+
const a = n.data?.artifactSummary?.url;
|
|
42
|
+
return `- [${e(n)}](${a})`;
|
|
43
|
+
}).join(`
|
|
44
|
+
`);
|
|
45
|
+
return r + u;
|
|
46
|
+
};
|
|
23
47
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
s as
|
|
29
|
-
l as
|
|
30
|
-
|
|
48
|
+
c as callAll,
|
|
49
|
+
m as dataAttr,
|
|
50
|
+
d as getInitials,
|
|
51
|
+
g as getMessageContent,
|
|
52
|
+
s as isCitationArtifact,
|
|
53
|
+
l as isString,
|
|
54
|
+
y as maybeRender,
|
|
55
|
+
f as toKebabCase
|
|
31
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),s=require("../styled/components/embedded-chat.cjs"),a=require("../styled/components/chat-history.cjs"),C=require("../styled/components/modal.cjs"),H=require("../styled/components/shadow.cjs"),I=require("../styled/components/message.cjs"),A=require("../primitives/providers/chat-history-provider.cjs"),b=require("../primitives/providers/config-provider.cjs"),w=require("../primitives/providers/root-provider.cjs"),k=require("../primitives/providers/widget-provider.cjs"),M=require("../primitives/components/embedded-chat/chat-provider.cjs"),f=require("../primitives/components/modal/modal-provider.cjs"),p=require("../primitives/utils/misc.cjs"),E=require("../primitives/atoms/portal-with-theme.cjs"),P=require("../primitives/atoms/error-boundary.cjs"),B=require("./modal.cjs"),L=require("../primitives/providers/image-preview-provider.cjs"),q=require("./widget-toggle.cjs"),y=require("../primitives/components/embedded-chat/file-upload-input.cjs"),i=require("../styled/components/embedded-chat/file-upload-input.cjs"),m=require("../styled/components/embedded-chat/image-preview-modal.cjs");function D(r){const{baseSettings:t,aiChatSettings:n}=r;return e.jsx(P.ErrorBoundary,{children:e.jsx(H.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(w.RootProvider,{config:{baseSettings:t,aiChatSettings:n},componentType:b.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(S,{...r})})})})}function T(r){const{children:t,onToggleView:n,isHidden:o,shouldAutoFocusInput:d=!n}=r;return e.jsx(s.Provider,{isHidden:o,shouldAutoFocusInput:d,children:t})}function S(r){return e.jsx(T,{...r,children:e.jsx(v,{...r})})}function v(r){const{onToggleView:t,variant:n,header:o=W}=r,d=f.useModal(),l=k.useWidget(),x=d&&!l?B.ModalContent:g.Fragment;return e.jsx(L.ImagePreviewProvider,{children:e.jsx(x,{children:e.jsxs(s.Wrapper,{variant:n??(t?"no-shadow":"container-with-shadow"),"data-composite":p.dataAttr(!!r.onToggleView||d?.isOpen),children:[e.jsx(Z,{}),e.jsxs(s.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(N,{}),e.jsx(U,{})]}),e.jsx(z,{}),e.jsx(R,{}),e.jsx(J,{})]})})})}const W=r=>{const{onToggleView:t,askAILabel:n,searchLabel:o}=r,{aiChatSettings:d}=b.useInkeepConfig(),l=d.isChatHistoryButtonVisible,x=!!t||l;return e.jsx(s.Header,{"data-show-toolbar":p.dataAttr(x),children:x?e.jsxs(s.HeaderToolbar,{"data-show-widget-toggle":p.dataAttr(!!t),children:[e.jsx(s.HeaderToolbarWrapper,{children:l&&e.jsx(s.ChatHistoryTrigger,{})}),t&&e.jsx(q.WidgetToggle,{onToggleView:t,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(C.Close,{})]}):e.jsx(C.Close,{})})};function N(){const{isSessionLoading:r}=M.useChat();return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:r?e.jsx(s.MessagesSessionLoading,{}):e.jsx(V,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function V(){const{aiChatSettings:{components:r}}=b.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:n,isStreaming:o})=>{const d=t.at(-1),l=(c,j)=>{const h=r?.[c];if(!h)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof h=="function"&&h.length<=1)return g.createElement(h,j);const u=h(j,document.createElement("div"),null);return g.isValidElement(u)||typeof u=="string"?u:null}catch(u){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,u),null}},x=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx($,{}),t.map(c=>{const j=d?.id===c.id;return e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(F,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:r?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:l,renderMarkdown:x},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(I.EmbeddedChatMessagePart,{isLast:j}),(!o||!j)&&e.jsx(O,{})]})}),e.jsx(_,{}),e.jsx(Q,{})]})]},c.id)}),n&&d?.parts.length&&e.jsxs(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(F,{}),e.jsx(s.MessageLoading,{})]})]})}})}function $(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(I.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:r=>r.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},typeof t=="object"?t.label:t))})]})]})]})}function F(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]})}function R(){return e.jsx(E.PortalWithTheme,{children:e.jsx(m.EmbeddedChatImagePreviewModal,{children:e.jsx(m.EmbeddedChatImagePreviewModalOverlay,{children:e.jsxs(m.EmbeddedChatImagePreviewModalContent,{children:[e.jsx(m.EmbeddedChatImagePreviewModalClose,{}),e.jsx(m.EmbeddedChatImagePreviewModalImage,{}),e.jsx(m.EmbeddedChatImagePreviewModalFooter,{children:e.jsx(m.EmbeddedChatImagePreviewModalFileName,{})})]})})})})}function _(){return e.jsx(i.EmbeddedChatMessageFiles,{children:r=>r.map((t,n)=>{const o=t.url,d=t.mediaType??"",l=d.split("/").pop(),x=t.filename??(l?`untitled.${l}`:"untitled"),c=y.isImageMimeType(d);return e.jsxs(i.EmbeddedChatMessageFile,{url:o,name:x,mediaType:d,children:[c?e.jsx(i.EmbeddedChatFileThumbnail,{}):e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]},o||n)})})}function Q(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageCustomActions,{children:r=>r.map((t,n)=>e.jsx(s.MessageCustomAction,{action:t},`action-${n}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function O(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:r=>r.map((t,n)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(o=>e.jsxs(g.Fragment,{children:[o,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:o=>o.map((d,l)=>e.jsx(s.MessageSourceItemDescriptionPart,{part:d},`part-${l}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},n))})]})}function U(){return e.jsxs(s.Footer,{children:[e.jsx(i.EmbeddedChatInputNotification,{children:e.jsxs(i.EmbeddedChatInputNotificationContent,{children:[e.jsxs(i.EmbeddedChatInputNotificationHeader,{children:[e.jsx(i.EmbeddedChatInputNotificationTitle,{}),e.jsx(i.EmbeddedChatInputNotificationClose,{})]}),e.jsx(i.EmbeddedChatInputNotificationMessage,{})]})}),e.jsx(G,{}),e.jsx(K,{})]})}function G(){return e.jsxs(s.InputFieldset,{children:[e.jsx(i.EmbeddedChatFileInput,{}),e.jsx(i.EmbeddedChatDropZone,{children:"Drop files here to add to chat"}),e.jsx(i.EmbeddedChatFileList,{children:r=>r.map((t,n)=>{const o=y.isImageMimeType(t.type);return e.jsxs(i.EmbeddedChatFileItem,{file:t,children:[o?e.jsxs(i.EmbeddedChatFilePreviewTrigger,{children:[e.jsx(i.EmbeddedChatFileThumbnail,{}),e.jsx(i.EmbeddedChatFileName,{})]}):e.jsxs(i.EmbeddedChatFileContent,{children:[e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]}),e.jsx(i.EmbeddedChatFileRemove,{})]},`${t.name}-${t.lastModified}-${n}`)})}),e.jsxs(s.InputGroup,{children:[e.jsx(i.EmbeddedChatFileUploadButton,{}),e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]})]})}function K(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:r,unpinned:t})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(s.HelpAction,{action:n},n.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(n=>e.jsxs(s.HelpActionsMenuItem,{action:n,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function Z(){const{sessions:r}=A.useChatHistory(),{conversationId:t}=M.useChat();return e.jsxs(a.EmbeddedChatHistoryRoot,{children:[e.jsxs(a.EmbeddedChatHistoryHeader,{children:[e.jsxs(a.EmbeddedChatHistoryBackButton,{children:[e.jsx(a.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(a.EmbeddedChatHistoryTitle,{}),e.jsx(C.Close,{})]}),e.jsxs(a.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(a.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":p.dataAttr(n.id===t),children:[e.jsx(a.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(a.EmbeddedChatHistoryItemDate,{children:a.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(a.EmbeddedChatHistoryEmptyState,{}),e.jsx(a.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(a.EmbeddedChatHistoryFooter,{children:e.jsx(a.EmbeddedChatHistoryNewConversationButton,{})})]})}function z(){return e.jsx(E.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackField,{children:[e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function J(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((t,n)=>e.jsxs(s.FormField,{field:t,autoFocus:n===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(o=>e.jsxs(s.FormFieldSelectItem,{value:o.value,children:[e.jsx(s.FormFieldSelectItemText,{children:o.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},o.value))})})]}),t.inputType==="combobox"&&e.jsxs(s.FormFieldCombobox,{children:[e.jsxs(s.FormFieldComboboxControl,{children:["multiple"in t&&t.multiple&&e.jsx(s.FormFieldComboboxSelectedTags,{}),e.jsx(s.FormFieldComboboxInput,{}),e.jsx(s.FormFieldComboboxTrigger,{})]}),e.jsx(s.FormFieldComboboxPositioner,{children:e.jsx(s.FormFieldComboboxContent,{children:e.jsx(s.FormFieldComboboxList,{children:e.jsx(s.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(s.FormFieldComboboxListEmpty,{}):o.map(d=>e.jsxs(s.FormFieldComboboxItem,{item:d,children:[e.jsx(s.FormFieldComboboxItemText,{children:d.label}),e.jsx(s.FormFieldComboboxItemIndicator,{})]},d.value))})})})})]}),e.jsx(s.FormFieldDescription,{}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=D;exports.InkeepEmbeddedChatImpl=S;exports.InkeepEmbeddedChatImplContent=v;exports.InkeepEmbeddedChatProvider=T;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),s=require("../styled/components/embedded-chat.cjs"),a=require("../styled/components/chat-history.cjs"),C=require("../styled/components/modal.cjs"),H=require("../styled/components/shadow.cjs"),I=require("../styled/components/message.cjs"),A=require("../primitives/providers/chat-history-provider.cjs"),b=require("../primitives/providers/config-provider.cjs"),w=require("../primitives/providers/root-provider.cjs"),k=require("../primitives/providers/widget-provider.cjs"),M=require("../primitives/components/embedded-chat/chat-provider.cjs"),f=require("../primitives/components/modal/modal-provider.cjs"),p=require("../primitives/utils/misc.cjs"),E=require("../primitives/atoms/portal-with-theme.cjs"),P=require("../primitives/atoms/error-boundary.cjs"),B=require("./modal.cjs"),L=require("../primitives/providers/image-preview-provider.cjs"),q=require("./widget-toggle.cjs"),y=require("../primitives/components/embedded-chat/file-upload-input.cjs"),i=require("../styled/components/embedded-chat/file-upload-input.cjs"),m=require("../styled/components/embedded-chat/image-preview-modal.cjs");function D(r){const{baseSettings:t,aiChatSettings:n}=r;return e.jsx(P.ErrorBoundary,{children:e.jsx(H.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(w.RootProvider,{config:{baseSettings:t,aiChatSettings:n},componentType:b.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(S,{...r})})})})}function T(r){const{children:t,onToggleView:n,isHidden:o,shouldAutoFocusInput:d=!n}=r;return e.jsx(s.Provider,{isHidden:o,shouldAutoFocusInput:d,children:t})}function S(r){return e.jsx(T,{...r,children:e.jsx(v,{...r})})}function v(r){const{onToggleView:t,variant:n,header:o=W}=r,d=f.useModal(),l=k.useWidget(),x=d&&!l?B.ModalContent:g.Fragment;return e.jsx(L.ImagePreviewProvider,{children:e.jsx(x,{children:e.jsxs(s.Wrapper,{variant:n??(t?"no-shadow":"container-with-shadow"),"data-composite":p.dataAttr(!!r.onToggleView||d?.isOpen),children:[e.jsx(Z,{}),e.jsxs(s.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(N,{}),e.jsx(U,{})]}),e.jsx(z,{}),e.jsx(R,{}),e.jsx(J,{})]})})})}const W=r=>{const{onToggleView:t,askAILabel:n,searchLabel:o}=r,{aiChatSettings:d}=b.useInkeepConfig(),l=d.isChatHistoryButtonVisible,x=!!t||l;return e.jsx(s.Header,{"data-show-toolbar":p.dataAttr(x),children:x?e.jsxs(s.HeaderToolbar,{"data-show-widget-toggle":p.dataAttr(!!t),children:[e.jsx(s.HeaderToolbarWrapper,{children:l&&e.jsx(s.ChatHistoryTrigger,{})}),t&&e.jsx(q.WidgetToggle,{onToggleView:t,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(C.Close,{})]}):e.jsx(C.Close,{})})};function N(){const{isSessionLoading:r}=M.useChat();return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:r?e.jsx(s.MessagesSessionLoading,{}):e.jsx(V,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function V(){const{aiChatSettings:{components:r}}=b.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:n,isStreaming:o})=>{const d=t.at(-1),l=(c,j)=>{const h=r?.[c];if(!h)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof h=="function"&&h.length<=1)return g.createElement(h,j);const u=h(j,document.createElement("div"),null);return g.isValidElement(u)||typeof u=="string"?u:null}catch(u){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,u),null}},x=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx($,{}),t.map(c=>{const j=d?.id===c.id;return e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(F,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:r?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:l,renderMarkdown:x},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(I.EmbeddedChatMessagePart,{isLast:j}),(!o||!j)&&e.jsx(O,{})]})}),e.jsx(_,{}),e.jsx(Q,{})]})]},c.id)}),n&&d?.role==="user"&&d?.parts.length&&e.jsxs(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(F,{}),e.jsx(s.MessageLoading,{})]})]})}})}function $(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(I.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:r=>r.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},typeof t=="object"?t.label:t))})]})]})]})}function F(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]})}function R(){return e.jsx(E.PortalWithTheme,{children:e.jsx(m.EmbeddedChatImagePreviewModal,{children:e.jsx(m.EmbeddedChatImagePreviewModalOverlay,{children:e.jsxs(m.EmbeddedChatImagePreviewModalContent,{children:[e.jsx(m.EmbeddedChatImagePreviewModalClose,{}),e.jsx(m.EmbeddedChatImagePreviewModalImage,{}),e.jsx(m.EmbeddedChatImagePreviewModalFooter,{children:e.jsx(m.EmbeddedChatImagePreviewModalFileName,{})})]})})})})}function _(){return e.jsx(i.EmbeddedChatMessageFiles,{children:r=>r.map((t,n)=>{const o=t.url,d=t.mediaType??"",l=d.split("/").pop(),x=t.filename??(l?`untitled.${l}`:"untitled"),c=y.isImageMimeType(d);return e.jsxs(i.EmbeddedChatMessageFile,{url:o,name:x,mediaType:d,children:[c?e.jsx(i.EmbeddedChatFileThumbnail,{}):e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]},o||n)})})}function Q(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageCustomActions,{children:r=>r.map((t,n)=>e.jsx(s.MessageCustomAction,{action:t},`action-${n}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function O(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:r=>r.map((t,n)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(o=>e.jsxs(g.Fragment,{children:[o,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:o=>o.map((d,l)=>e.jsx(s.MessageSourceItemDescriptionPart,{part:d},`part-${l}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},n))})]})}function U(){return e.jsxs(s.Footer,{children:[e.jsx(i.EmbeddedChatInputNotification,{children:e.jsxs(i.EmbeddedChatInputNotificationContent,{children:[e.jsxs(i.EmbeddedChatInputNotificationHeader,{children:[e.jsx(i.EmbeddedChatInputNotificationTitle,{}),e.jsx(i.EmbeddedChatInputNotificationClose,{})]}),e.jsx(i.EmbeddedChatInputNotificationMessage,{})]})}),e.jsx(G,{}),e.jsx(K,{})]})}function G(){return e.jsxs(s.InputFieldset,{children:[e.jsx(i.EmbeddedChatFileInput,{}),e.jsx(i.EmbeddedChatDropZone,{children:"Drop files here to add to chat"}),e.jsx(i.EmbeddedChatFileList,{children:r=>r.map((t,n)=>{const o=y.isImageMimeType(t.type);return e.jsxs(i.EmbeddedChatFileItem,{file:t,children:[o?e.jsxs(i.EmbeddedChatFilePreviewTrigger,{children:[e.jsx(i.EmbeddedChatFileThumbnail,{}),e.jsx(i.EmbeddedChatFileName,{})]}):e.jsxs(i.EmbeddedChatFileContent,{children:[e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]}),e.jsx(i.EmbeddedChatFileRemove,{})]},`${t.name}-${t.lastModified}-${n}`)})}),e.jsxs(s.InputGroup,{children:[e.jsx(i.EmbeddedChatFileUploadButton,{}),e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]})]})}function K(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:r,unpinned:t})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(s.HelpAction,{action:n},n.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(n=>e.jsxs(s.HelpActionsMenuItem,{action:n,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function Z(){const{sessions:r}=A.useChatHistory(),{conversationId:t}=M.useChat();return e.jsxs(a.EmbeddedChatHistoryRoot,{children:[e.jsxs(a.EmbeddedChatHistoryHeader,{children:[e.jsxs(a.EmbeddedChatHistoryBackButton,{children:[e.jsx(a.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(a.EmbeddedChatHistoryTitle,{}),e.jsx(C.Close,{})]}),e.jsxs(a.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(a.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":p.dataAttr(n.id===t),children:[e.jsx(a.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(a.EmbeddedChatHistoryItemDate,{children:a.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(a.EmbeddedChatHistoryEmptyState,{}),e.jsx(a.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(a.EmbeddedChatHistoryFooter,{children:e.jsx(a.EmbeddedChatHistoryNewConversationButton,{})})]})}function z(){return e.jsx(E.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackField,{children:[e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function J(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((t,n)=>e.jsxs(s.FormField,{field:t,autoFocus:n===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(o=>e.jsxs(s.FormFieldSelectItem,{value:o.value,children:[e.jsx(s.FormFieldSelectItemText,{children:o.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},o.value))})})]}),t.inputType==="combobox"&&e.jsxs(s.FormFieldCombobox,{children:[e.jsxs(s.FormFieldComboboxControl,{children:["multiple"in t&&t.multiple&&e.jsx(s.FormFieldComboboxSelectedTags,{}),e.jsx(s.FormFieldComboboxInput,{}),e.jsx(s.FormFieldComboboxTrigger,{})]}),e.jsx(s.FormFieldComboboxPositioner,{children:e.jsx(s.FormFieldComboboxContent,{children:e.jsx(s.FormFieldComboboxList,{children:e.jsx(s.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(s.FormFieldComboboxListEmpty,{}):o.map(d=>e.jsxs(s.FormFieldComboboxItem,{item:d,children:[e.jsx(s.FormFieldComboboxItemText,{children:d.label}),e.jsx(s.FormFieldComboboxItemIndicator,{})]},d.value))})})})})]}),e.jsx(s.FormFieldDescription,{}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=D;exports.InkeepEmbeddedChatImpl=S;exports.InkeepEmbeddedChatImplContent=v;exports.InkeepEmbeddedChatProvider=T;
|