@inkeep/cxkit-primitives 0.5.95 → 0.5.96
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/components/embedded-chat/use-chat-action.cjs +1 -1
- package/dist/components/embedded-chat/use-chat-action.js +22 -11
- package/dist/components/embedded-chat/use-inkeep-chat.cjs +3 -3
- package/dist/components/embedded-chat/use-inkeep-chat.js +45 -42
- package/dist/components/embedded-chat.cjs +6 -6
- package/dist/components/embedded-chat.js +93 -87
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/dist/providers/chat-events-provider.cjs +1 -1
- package/dist/providers/chat-events-provider.js +57 -54
- package/dist/providers/chat-form-provider.cjs +1 -1
- package/dist/providers/chat-form-provider.js +56 -48
- package/dist/providers/feedback-provider.cjs +1 -1
- package/dist/providers/feedback-provider.js +47 -41
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
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 l=require("../../providers/conversation-provider.cjs"),a=require("../../providers/chat-events-provider.cjs"),p=require("../../providers/chat-form-provider.cjs"),c=require("../modal/modal-provider.cjs"),u=e=>{const{logEvent:n}=a.useChatEvents(),{conversation:o}=l.useInkeepConversation(),{openForm:t}=p.useChatForm(),i=c.useModal();return{handleAction:r=>{if(e.action.type==="open_form"){r?.onOpenForm?.();const s="name"in e?e:void 0;t?.(e.action.formSettings,s)}else e.action.type==="invoke_callback"&&(e.action.callback({conversation:o}),e.action.shouldCloseModal&&i?.setOpen(!1))},logHelpAction:()=>{"name"in e&&(n({eventName:"get_help_option_clicked",properties:{getHelpOption:e,conversation:o}}),e.action.type!=="open_form"&&n({eventName:"user_escalation_indicated",properties:{escalationType:"get_help_option",getHelpOption:e,conversation:o}}))}}};exports.useChatAction=u;
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useInkeepConversation as l } from "../../providers/conversation-provider.js";
|
|
3
3
|
import { useChatEvents as r } from "../../providers/chat-events-provider.js";
|
|
4
|
-
import { useChatForm as
|
|
5
|
-
import { useModal as
|
|
6
|
-
const v = (
|
|
7
|
-
const { logEvent: n } = r(), { conversation:
|
|
4
|
+
import { useChatForm as a } from "../../providers/chat-form-provider.js";
|
|
5
|
+
import { useModal as m } from "../modal/modal-provider.js";
|
|
6
|
+
const v = (e) => {
|
|
7
|
+
const { logEvent: n } = r(), { conversation: o } = l(), { openForm: t } = a(), p = m();
|
|
8
8
|
return { handleAction: (i) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
if (e.action.type === "open_form") {
|
|
10
|
+
i?.onOpenForm?.();
|
|
11
|
+
const s = "name" in e ? e : void 0;
|
|
12
|
+
t?.(e.action.formSettings, s);
|
|
13
|
+
} else e.action.type === "invoke_callback" && (e.action.callback({
|
|
14
|
+
conversation: o
|
|
15
|
+
}), e.action.shouldCloseModal && p?.setOpen(!1));
|
|
12
16
|
}, logHelpAction: () => {
|
|
13
|
-
"name" in
|
|
17
|
+
"name" in e && (n({
|
|
14
18
|
eventName: "get_help_option_clicked",
|
|
15
19
|
properties: {
|
|
16
|
-
getHelpOption:
|
|
17
|
-
conversation:
|
|
20
|
+
getHelpOption: e,
|
|
21
|
+
conversation: o
|
|
18
22
|
}
|
|
19
|
-
})
|
|
23
|
+
}), e.action.type !== "open_form" && n({
|
|
24
|
+
eventName: "user_escalation_indicated",
|
|
25
|
+
properties: {
|
|
26
|
+
escalationType: "get_help_option",
|
|
27
|
+
getHelpOption: e,
|
|
28
|
+
conversation: o
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
20
31
|
} };
|
|
21
32
|
};
|
|
22
33
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("openai"),t=require("react"),Le=require("../../providers/config-provider.cjs"),xe=require("../../providers/conversation-provider.cjs"),Be=require("../../providers/chat-events-provider.cjs"),F=require("../../utils/get-message-metadata.cjs"),re=require("../../utils/reset-query-params.cjs"),Oe=require("../../providers/chat-form-provider.cjs"),De=require("../../providers/widget-provider.cjs"),Fe=require("../../hooks/use-media-query.cjs"),Te=require("./use-captcha.cjs"),Ke=require("../modal/modal-provider.cjs"),g=require("../../utils/generate-uid.cjs"),Qe=require("../../utils/tools/links-tool.cjs"),We=require("../../atoms/api/analytics/conversation.cjs"),Je=require("../../utils/misc.cjs"),ze=()=>{const{chatId:y,isSharedChat:ie,setConversation:ce,conversation:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("openai"),t=require("react"),Le=require("../../providers/config-provider.cjs"),xe=require("../../providers/conversation-provider.cjs"),Be=require("../../providers/chat-events-provider.cjs"),F=require("../../utils/get-message-metadata.cjs"),re=require("../../utils/reset-query-params.cjs"),Oe=require("../../providers/chat-form-provider.cjs"),De=require("../../providers/widget-provider.cjs"),Fe=require("../../hooks/use-media-query.cjs"),Te=require("./use-captcha.cjs"),Ke=require("../modal/modal-provider.cjs"),g=require("../../utils/generate-uid.cjs"),Qe=require("../../utils/tools/links-tool.cjs"),We=require("../../atoms/api/analytics/conversation.cjs"),Je=require("../../utils/misc.cjs"),ze=()=>{const{chatId:y,isSharedChat:ie,setConversation:ce,conversation:A,resetConversation:le}=xe.useInkeepConversation(),{baseSettings:q,aiChatSettings:T}=Le.useInkeepConfig(),{aiApiBaseUrl:K,shouldBypassCaptcha:Q,filters:W}=q,J=Ke.useModal(),{getSolution:ue,prefetchSolution:P,invalidateSolution:z}=Te.useCaptcha({fetchUrl:`${K}/v1/challenge`,shouldBypassCaptcha:Q,shouldMakeInitialRequest:J?J.isOpen:!0}),de=new ae({baseURL:`${K}/v1`,apiKey:q.apiKey??"",dangerouslyAllowBrowser:!0}),{onInputMessageChange:ge,getTools:me,prompts:pe,model:fe,filters:H,onToolCall:he}=T,[S,R]=t.useState(""),j=t.useRef(null);t.useEffect(()=>{ge?.(S)},[S]);const[m,l]=t.useState([]),[G,M]=t.useState(!1),[ve,w]=t.useState(!1),[ye,V]=t.useState(null),[L,X]=t.useState(null),[C,I]=t.useState([]),Se=e=>{I(s=>[...s,e])},[Me,Y]=t.useState({}),o=t.useRef([]),k=t.useRef(null),{logEvent:b}=Be.useChatEvents(),Z=pe?.map((e,s)=>({id:`system-${Date.now().toString()}-${g.generateUid(4)}-${s}`,role:"system",content:e})),[we,Ce]=t.useState(!!y);t.useEffect(()=>{if(y){const{apiKey:e,analyticsApiBaseUrl:s}=q;We.getConversation(y,e,s).then(a=>{if(a){b({eventName:"shared_chat_loaded",properties:{conversation:a}}),Ce(!1),ce({...a});const r=a.messages.map(p=>({...p,content:Je.parseIfJson(p.content)}));l(r),o.current=r}})}},[y]);const Ie=e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${q.organizationDisplayName??"Administrator"}`;default:return`Hmm..
|
|
2
2
|
|
|
3
|
-
It seems I might be having some issues right now. Please clear the chat and try again.`}},ee=e=>{V(e),l(s=>{const a=[...s],r=a[a.length-1];return r&&(r.content=Ie(e)),a}),M(!1),
|
|
4
|
-
${F.serializeWorkflow(e)}`},...Z,r,
|
|
3
|
+
It seems I might be having some issues right now. Please clear the chat and try again.`}},ee=e=>{V(e),l(s=>{const a=[...s],r=a[a.length-1];return r&&(r.content=Ie(e)),a}),M(!1),w(!1),z(),P()},x=!S.trim()&&!C.length||G,ke=e=>{e.key==="Enter"&&!e.shiftKey&&!x&&!e.nativeEvent.isComposing&&(e.preventDefault(),B())},be=e=>{const s=e.target.value;R(s)},B=async(e=S)=>{if(x&&(!e||e.trim().length===0))return;M(!0);const s=L?m.length===2:m.length===0,a=F.getMessageMetadata(L,C,s);let r;const p=F.serializeAttachments(C);C.length&&p?r=[{type:"text",text:p}]:r=e;const se={id:`${Date.now().toString()}-${g.generateUid(4)}-1`,role:"user",content:r,metadata:a},f=[...m.length?[]:Z,se];if(ie&&y){re.resetQueryParams();const u=o.current.map((i,E)=>({id:`${i.id}-${g.generateUid(6)}-${E}`,role:i.role,...i.role==="assistant"?{links:i.links??[]}:{},content:i.content,metadata:i.metadata,tool_calls:i.tool_calls}));l([...u,...f]),o.current=[...u,...f]}else l(u=>[...u,...f]),o.current=[...o.current,...f];I([]),R(""),b({eventName:"user_message_submitted",properties:{}},o.current);const ne=[Qe.provideLinksTool,...me?.({conversation:A})||[]];try{const u={model:fe,messages:o.current,stream:!0,tools:ne,tool_choice:"auto"},i=await ue(),E=i?btoa(JSON.stringify(i)):null,oe=W||H?JSON.stringify({...W,...H}):void 0,U={};!Q&&E&&(U["X-INKEEP-CHALLENGE-SOLUTION"]=E),oe&&(U["inkeep-filters"]=oe);const h=de.beta.chat.completions.stream(u,Object.keys(U).length>0?{headers:U}:void 0),n={id:`${Date.now().toString()}-${g.generateUid(4)}-2`,role:"assistant",content:"",links:[],tool_calls:[]};l(d=>[...d,n]),h.on("content",(d,_)=>{w(!0),n.content=_,l(N=>{const c=[...N],O=c.findIndex($=>$.id===n.id);return O===-1?[...c,n]:(c[O]={...n},c)})}),h.on("tool_calls.function.arguments.done",async d=>{const{name:_,arguments:N}=d,c=ne?.find(v=>v.function.name===_);if(!c)return;const $=("parse"in c.function?c.function.parse:JSON.parse)(N),Ue=c.function.function?.($,h),Ne=c.renderMessageButtons?.({args:$,execution:Ue})??[];_==="provideLinks"?n.links=$.links??[]:Y(v=>({...v,[n.id]:[...v[n.id]??[],...Ne]})),n.tool_calls?.push({id:"call_"+g.generateUid(24),type:"function",function:{name:_,arguments:N}}),l(v=>{const D=[...v],Ae=D.findIndex(Re=>Re.id===n.id);return D[Ae]={...n},D}),he?.(d,{conversation:{...A,messages:[...o.current,n]}})}),h.on("error",ee),h.finalChatCompletion().then(async()=>{o.current=[...o.current,n],k.current=null,M(!1),w(!1),P(),await b({eventName:"assistant_message_received",properties:{}},o.current),b({eventName:"assistant_answer_displayed",properties:{}})}).catch(d=>{d instanceof ae.APIUserAbortError||console.warn(d)}),k.current=h.controller}catch(u){ee(u),M(!1),w(!1)}},_e=()=>{k.current&&(k.current.abort(),k.current=null),M(!1),w(!1),P()},te=()=>{V(null),l([]),o.current=[],le(),Y({}),I([]),re.resetQueryParams(),X(null),z(),P(),b({eventName:"chat_clear_button_clicked",properties:{conversation:A}})},$e=e=>{X(e);const{initialReplyMessage:s,displayName:a}=e,r={id:m.length.toString()+g.generateUid(4),role:"user",content:a},p={id:(m.length+1).toString()+g.generateUid(4),role:"assistant",content:s,links:[]},f=[{id:`system-${Date.now().toString()}-${g.generateUid(4)}-${e.id}`,role:"system",content:`Company has asked user to follow this guided workflow:
|
|
4
|
+
${F.serializeWorkflow(e)}`},...Z,r,p];l(f),I([])},{openForm:qe}=Oe.useChatForm(),Pe=De.useWidget();t.useImperativeHandle(T.chatFunctionsRef,()=>({submitMessage:B,updateInputMessage(e){R(e)},clearChat:te,openForm:e=>{Pe?.setView("chat"),qe(e)},focusInput:()=>{j.current?.focus()}}));const Ee=Fe.useMediaQuery("(max-width: 768px)");return{messages:m,input:S,isLoading:G,isStreaming:ve,isLoadingConversation:we,error:ye,isSubmitDisabled:x,handleInputChange:be,handleInputKeyDown:ke,handleSubmit:B,stop:_e,clear:te,handleWorkflow:$e,selectedWorkflow:L,messageAttachments:C,setMessageAttachments:I,addAttachment:Se,messageButtons:Me,isEmpty:m.length===0,inputRef:j,isMobile:Ee}};exports.useInkeepChat=ze;
|
|
@@ -16,13 +16,13 @@ import { provideLinksTool as Ge } from "../../utils/tools/links-tool.js";
|
|
|
16
16
|
import { getConversation as Ve } from "../../atoms/api/analytics/conversation.js";
|
|
17
17
|
import { parseIfJson as Xe } from "../../utils/misc.js";
|
|
18
18
|
const dt = () => {
|
|
19
|
-
const { chatId:
|
|
19
|
+
const { chatId: w, isSharedChat: ie, setConversation: ce, conversation: B, resetConversation: le } = Fe(), { baseSettings: E, aiChatSettings: T } = Ue(), { aiApiBaseUrl: W, shouldBypassCaptcha: J, filters: z } = E, H = qe(), { getSolution: ue, prefetchSolution: N, invalidateSolution: Q } = je({
|
|
20
20
|
fetchUrl: `${W}/v1/challenge`,
|
|
21
21
|
shouldBypassCaptcha: J,
|
|
22
22
|
shouldMakeInitialRequest: H ? H.isOpen : !0
|
|
23
23
|
}), me = new Oe({
|
|
24
24
|
baseURL: `${W}/v1`,
|
|
25
|
-
apiKey:
|
|
25
|
+
apiKey: E.apiKey ?? "",
|
|
26
26
|
dangerouslyAllowBrowser: !0
|
|
27
27
|
}), {
|
|
28
28
|
onInputMessageChange: ge,
|
|
@@ -31,23 +31,23 @@ const dt = () => {
|
|
|
31
31
|
model: fe,
|
|
32
32
|
filters: j,
|
|
33
33
|
onToolCall: he
|
|
34
|
-
} = T, [
|
|
34
|
+
} = T, [v, D] = l(""), q = K(null);
|
|
35
35
|
ae(() => {
|
|
36
|
-
ge?.(
|
|
37
|
-
}, [
|
|
38
|
-
const [p, c] = l([]), [G, C] = l(!1), [ye, I] = l(!1), [
|
|
36
|
+
ge?.(v);
|
|
37
|
+
}, [v]);
|
|
38
|
+
const [p, c] = l([]), [G, C] = l(!1), [ye, I] = l(!1), [we, V] = l(null), [O, X] = l(null), [M, S] = l([]), ve = (e) => {
|
|
39
39
|
S((t) => [...t, e]);
|
|
40
|
-
}, [Ce, Y] = l({}), n = K([]), k = K(null), { logEvent:
|
|
40
|
+
}, [Ce, Y] = l({}), n = K([]), k = K(null), { logEvent: _ } = Ke(), Z = de?.map((e, t) => ({
|
|
41
41
|
id: `system-${Date.now().toString()}-${g(4)}-${t}`,
|
|
42
42
|
role: "system",
|
|
43
43
|
content: e
|
|
44
|
-
})), [Ie, Me] = l(!!
|
|
44
|
+
})), [Ie, Me] = l(!!w);
|
|
45
45
|
ae(() => {
|
|
46
|
-
if (
|
|
47
|
-
const { apiKey: e, analyticsApiBaseUrl: t } =
|
|
48
|
-
Ve(
|
|
46
|
+
if (w) {
|
|
47
|
+
const { apiKey: e, analyticsApiBaseUrl: t } = E;
|
|
48
|
+
Ve(w, e, t).then((o) => {
|
|
49
49
|
if (o) {
|
|
50
|
-
|
|
50
|
+
_({
|
|
51
51
|
eventName: "shared_chat_loaded",
|
|
52
52
|
properties: {
|
|
53
53
|
conversation: o
|
|
@@ -61,13 +61,13 @@ const dt = () => {
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
}, [
|
|
64
|
+
}, [w]);
|
|
65
65
|
const Se = (e) => {
|
|
66
66
|
switch (e.code) {
|
|
67
67
|
case 400:
|
|
68
68
|
return e.message;
|
|
69
69
|
case 403:
|
|
70
|
-
return `There seems to be a configuration error. Please contact ${
|
|
70
|
+
return `There seems to be a configuration error. Please contact ${E.organizationDisplayName ?? "Administrator"}`;
|
|
71
71
|
default:
|
|
72
72
|
return `Hmm..
|
|
73
73
|
|
|
@@ -77,13 +77,13 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
77
77
|
V(e), c((t) => {
|
|
78
78
|
const o = [...t], a = o[o.length - 1];
|
|
79
79
|
return a && (a.content = Se(e)), o;
|
|
80
|
-
}), C(!1), I(!1), Q(),
|
|
81
|
-
}, P = !
|
|
80
|
+
}), C(!1), I(!1), Q(), N();
|
|
81
|
+
}, P = !v.trim() && !M.length || G, ke = (e) => {
|
|
82
82
|
e.key === "Enter" && !e.shiftKey && !P && !e.nativeEvent.isComposing && (e.preventDefault(), R());
|
|
83
|
-
},
|
|
83
|
+
}, _e = (e) => {
|
|
84
84
|
const t = e.target.value;
|
|
85
85
|
D(t);
|
|
86
|
-
}, R = async (e =
|
|
86
|
+
}, R = async (e = v) => {
|
|
87
87
|
if (P && (!e || e.trim().length === 0)) return;
|
|
88
88
|
C(!0);
|
|
89
89
|
const t = O ? p.length === 2 : p.length === 0, o = Te(O, M, t);
|
|
@@ -96,10 +96,10 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
96
96
|
content: a,
|
|
97
97
|
metadata: o
|
|
98
98
|
}, f = [...p.length ? [] : Z, se];
|
|
99
|
-
if (ie &&
|
|
99
|
+
if (ie && w) {
|
|
100
100
|
re();
|
|
101
|
-
const u = n.current.map((r,
|
|
102
|
-
id: `${r.id}-${g(6)}-${
|
|
101
|
+
const u = n.current.map((r, A) => ({
|
|
102
|
+
id: `${r.id}-${g(6)}-${A}`,
|
|
103
103
|
role: r.role,
|
|
104
104
|
...r.role === "assistant" ? { links: r.links ?? [] } : {},
|
|
105
105
|
content: r.content,
|
|
@@ -109,7 +109,7 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
109
109
|
c([...u, ...f]), n.current = [...u, ...f];
|
|
110
110
|
} else
|
|
111
111
|
c((u) => [...u, ...f]), n.current = [...n.current, ...f];
|
|
112
|
-
S([]), D(""),
|
|
112
|
+
S([]), D(""), _(
|
|
113
113
|
{
|
|
114
114
|
eventName: "user_message_submitted",
|
|
115
115
|
properties: {}
|
|
@@ -124,11 +124,11 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
124
124
|
stream: !0,
|
|
125
125
|
tools: ne,
|
|
126
126
|
tool_choice: "auto"
|
|
127
|
-
}, r = await ue(),
|
|
127
|
+
}, r = await ue(), A = r ? btoa(JSON.stringify(r)) : null, oe = z || j ? JSON.stringify({
|
|
128
128
|
...z,
|
|
129
129
|
...j
|
|
130
130
|
}) : void 0, x = {};
|
|
131
|
-
!J &&
|
|
131
|
+
!J && A && (x["X-INKEEP-CHALLENGE-SOLUTION"] = A), oe && (x["inkeep-filters"] = oe);
|
|
132
132
|
const h = me.beta.chat.completions.stream(
|
|
133
133
|
u,
|
|
134
134
|
Object.keys(x).length > 0 ? { headers: x } : void 0
|
|
@@ -141,14 +141,14 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
141
141
|
};
|
|
142
142
|
c((m) => [...m, s]), h.on("content", (m, b) => {
|
|
143
143
|
I(!0), s.content = b, c((L) => {
|
|
144
|
-
const i = [...L], U = i.findIndex((
|
|
144
|
+
const i = [...L], U = i.findIndex(($) => $.id === s.id);
|
|
145
145
|
return U === -1 ? [...i, s] : (i[U] = { ...s }, i);
|
|
146
146
|
});
|
|
147
147
|
}), h.on("tool_calls.function.arguments.done", async (m) => {
|
|
148
148
|
const { name: b, arguments: L } = m, i = ne?.find((y) => y.function.name === b);
|
|
149
149
|
if (!i) return;
|
|
150
|
-
const
|
|
151
|
-
b === "provideLinks" ? s.links =
|
|
150
|
+
const $ = ("parse" in i.function ? i.function.parse : JSON.parse)(L), xe = i.function.function?.($, h), Le = i.renderMessageButtons?.({ args: $, execution: xe }) ?? [];
|
|
151
|
+
b === "provideLinks" ? s.links = $.links ?? [] : Y((y) => ({
|
|
152
152
|
...y,
|
|
153
153
|
[s.id]: [...y[s.id] ?? [], ...Le]
|
|
154
154
|
})), s.tool_calls?.push({
|
|
@@ -167,24 +167,27 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
167
167
|
messages: [...n.current, s]
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
|
-
}), h.on("error", ee), h.finalChatCompletion().then(() => {
|
|
171
|
-
n.current = [...n.current, s], k.current = null, C(!1), I(!1),
|
|
170
|
+
}), h.on("error", ee), h.finalChatCompletion().then(async () => {
|
|
171
|
+
n.current = [...n.current, s], k.current = null, C(!1), I(!1), N(), await _(
|
|
172
172
|
{
|
|
173
173
|
eventName: "assistant_message_received",
|
|
174
174
|
properties: {}
|
|
175
175
|
},
|
|
176
176
|
n.current
|
|
177
|
-
)
|
|
177
|
+
), _({
|
|
178
|
+
eventName: "assistant_answer_displayed",
|
|
179
|
+
properties: {}
|
|
180
|
+
});
|
|
178
181
|
}).catch((m) => {
|
|
179
182
|
m instanceof Pe || console.warn(m);
|
|
180
183
|
}), k.current = h.controller;
|
|
181
184
|
} catch (u) {
|
|
182
185
|
ee(u), C(!1), I(!1);
|
|
183
186
|
}
|
|
184
|
-
},
|
|
185
|
-
k.current && (k.current.abort(), k.current = null), C(!1), I(!1),
|
|
187
|
+
}, be = () => {
|
|
188
|
+
k.current && (k.current.abort(), k.current = null), C(!1), I(!1), N();
|
|
186
189
|
}, te = () => {
|
|
187
|
-
V(null), c([]), n.current = [], le(), Y({}), S([]), re(), X(null), Q(),
|
|
190
|
+
V(null), c([]), n.current = [], le(), Y({}), S([]), re(), X(null), Q(), N(), _({
|
|
188
191
|
eventName: "chat_clear_button_clicked",
|
|
189
192
|
properties: {
|
|
190
193
|
conversation: B
|
|
@@ -208,7 +211,7 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
208
211
|
${Je(e)}`
|
|
209
212
|
}, ...Z, a, d];
|
|
210
213
|
c(f), S([]);
|
|
211
|
-
}, { openForm: Ee } = ze(),
|
|
214
|
+
}, { openForm: Ee } = ze(), Ne = He();
|
|
212
215
|
Re(T.chatFunctionsRef, () => ({
|
|
213
216
|
submitMessage: R,
|
|
214
217
|
updateInputMessage(e) {
|
|
@@ -216,35 +219,35 @@ ${Je(e)}`
|
|
|
216
219
|
},
|
|
217
220
|
clearChat: te,
|
|
218
221
|
openForm: (e) => {
|
|
219
|
-
|
|
222
|
+
Ne?.setView("chat"), Ee(e);
|
|
220
223
|
},
|
|
221
224
|
focusInput: () => {
|
|
222
225
|
q.current?.focus();
|
|
223
226
|
}
|
|
224
227
|
}));
|
|
225
|
-
const
|
|
228
|
+
const Ae = Qe("(max-width: 768px)");
|
|
226
229
|
return {
|
|
227
230
|
messages: p,
|
|
228
|
-
input:
|
|
231
|
+
input: v,
|
|
229
232
|
isLoading: G,
|
|
230
233
|
isStreaming: ye,
|
|
231
234
|
isLoadingConversation: Ie,
|
|
232
|
-
error:
|
|
235
|
+
error: we,
|
|
233
236
|
isSubmitDisabled: P,
|
|
234
|
-
handleInputChange:
|
|
237
|
+
handleInputChange: _e,
|
|
235
238
|
handleInputKeyDown: ke,
|
|
236
239
|
handleSubmit: R,
|
|
237
|
-
stop:
|
|
240
|
+
stop: be,
|
|
238
241
|
clear: te,
|
|
239
242
|
handleWorkflow: $e,
|
|
240
243
|
selectedWorkflow: O,
|
|
241
244
|
messageAttachments: M,
|
|
242
245
|
setMessageAttachments: S,
|
|
243
|
-
addAttachment:
|
|
246
|
+
addAttachment: ve,
|
|
244
247
|
messageButtons: Ce,
|
|
245
248
|
isEmpty: p.length === 0,
|
|
246
249
|
inputRef: q,
|
|
247
|
-
isMobile:
|
|
250
|
+
isMobile: Ae
|
|
248
251
|
};
|
|
249
252
|
};
|
|
250
253
|
export {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),ae=require("react-textarea-autosize"),ba=require("@radix-ui/react-avatar"),ga=require("@radix-ui/react-checkbox"),Pa=require("@radix-ui/react-popover"),Aa=require("@radix-ui/react-tooltip"),_a=require("@radix-ui/react-scroll-area"),I=require("../atoms/select.cjs"),A=require("../atoms/dialog.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),ae=require("react-textarea-autosize"),ba=require("@radix-ui/react-avatar"),ga=require("@radix-ui/react-checkbox"),Pa=require("@radix-ui/react-popover"),Aa=require("@radix-ui/react-tooltip"),_a=require("@radix-ui/react-scroll-area"),I=require("../atoms/select.cjs"),A=require("../atoms/dialog.cjs"),Ea=require("../atoms/avatars/ai.cjs"),Fa=require("../atoms/avatars/user.cjs"),E=require("../atoms/icons/custom-icon.cjs"),x=require("../atoms/icons/built-in-icon-renderer.cjs"),ka=require("../atoms/link.cjs"),U=require("../atoms/markdown/index.cjs"),w=require("../providers/attachment-item-provider.cjs"),F=require("../providers/attachments-bar-provider.cjs"),B=require("../providers/source-item-provider.cjs"),p=require("../providers/config-provider.cjs"),L=require("../providers/conversation-provider.cjs"),O=require("../providers/chat-events-provider.cjs"),ne=require("../providers/feedback-provider.cjs"),q=require("../providers/message-attachments-provider.cjs"),P=require("../providers/message-provider.cjs"),be=require("../atoms/icons/checkbox-icon.cjs"),te=require("../hooks/use-copy-to-clipboard.cjs"),K=require("../providers/feedback-item-provider.cjs"),Ia=require("../utils/get-message-metadata.cjs"),h=require("../utils/misc.cjs"),a=require("./factory.cjs"),v=require("./embedded-chat/chat-provider.cjs"),Ma=require("./tagline-logo-icon.cjs"),Sa=require("../hooks/use-settle-action.cjs"),xa=require("../hooks/use-container-size.cjs"),se=require("./embedded-chat/use-chat-action.cjs"),ie=require("../providers/help-menu-provider.cjs"),_=require("../providers/chat-form-provider.cjs"),f=require("../providers/form-field-provider.cjs"),Ba=require("react-hook-form"),fa=require("../utils/highlight-emphasis.cjs"),Ta=require("./modal/modal-provider.cjs"),ja=require("@inkeep/cxkit-color-mode"),re=require("../utils/compose-refs.cjs"),u=require("../utils/compose-event-handlers.cjs"),ya=require("../hooks/use-scroll-to-bottom.cjs"),Ha=require("../atoms/api/analytics/conversation.cjs"),wa=require("../utils/transform-source/index.cjs"),La=require("../hooks/use-debounce.cjs"),oe=require("../providers/hover-popover-provider.cjs"),Da=require("./modal/widget-auto-focus.cjs");function R(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const de=R(ba),z=R(ga),T=R(Pa),j=R(Aa),W=R(_a),Oa="__intro__",qa=a.ikp("div",{_id:"aiChatWrapper"}),ge=g.forwardRef((t,e)=>{const{...i}=t,{isHidden:s,isMobile:r}=v.useChat(),[o,d]=xa.useContainerSize(),c=re.useComposedRefs(e,o),m=d?.width?d.width>580:!0,l=Ta.useModal();return n.jsx(qa,{ref:c,"data-widget-md":h.dataAttr(m),"data-hidden":h.dataAttr(s),"data-in-modal":h.dataAttr(!!l),"data-mobile":h.dataAttr(r),...i})}),Ra=a.ikp("div",{_id:"aiChatConversationLoading"}),Pe=t=>{const{isLoadingConversation:e}=v.useChat();return e?n.jsx(Ra,{children:n.jsx("span",{children:"Loading..."}),...t}):null},Wa=a.ikp("div",{_id:"aiChatRoot"}),Ae=t=>{const{isLoadingConversation:e,isHidden:i}=v.useChat(),{form:s}=_.useChatForm();return e||s?null:n.jsx(Wa,{"data-hidden":h.dataAttr(i),...t})},Na=a.ikp("div",{_id:"aiChatHeader"}),_e=a.ikp("div",{_id:"aiChatHeader__Toolbar"}),Ee=a.ikp("div",{_id:"aiChatHeader__ToolbarHeaderWrapper"}),Qa=a.ikp("div",{_id:"aiChatHeader__ToolbarHeader"}),Fe=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),i=`Ask ${e.aiAssistantName||"AI"}`;return n.jsx(Qa,{...t,children:i})}),ke=a.ikp("div",{_id:"aiChatContent"}),Ie=a.ikp(W.Root,{_id:"aiChatContentScrollArea"}),$a=a.ikp(W.Viewport,{_id:"aiChatContentScrollArea__Viewport"}),Me=g.forwardRef(({children:t,...e},i)=>{const{containerRef:s}=ya.useScrollToBottom(),r=re.useComposedRefs(i,s);return n.jsx($a,{ref:r,children:n.jsx("div",{"data-part":"grid",style:{display:"grid"},children:t}),...e})}),Se=a.ikp(W.ScrollAreaScrollbar,{_id:"aiChatContentScrollArea__Scrollbar"}),xe=a.ikp(W.ScrollAreaThumb,{_id:"aiChatContentScrollArea__Thumb"}),Be=a.ikp(W.Corner,{_id:"aiChatContentScrollArea__Corner"}),Va=a.ikp("div",{_id:"aiChatMessages"}),fe=t=>{const e=v.useChat(),{children:i,...s}=t;return n.jsx(Va,{children:h.maybeRender(i,e),...s})},Ua=a.ikp("div",{_id:"aiChatDisclaimer"}),Te=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),[i,s]=g.useState(!1),r=La.useDebounce(i,100);return e.disclaimerSettings?.isEnabled?n.jsx(oe.HoverPopoverProvider,{open:i,setOpen:s,children:n.jsx(T.Root,{open:r,onOpenChange:s,children:n.jsx(Ua,{...t})})}):null}),Ka=a.ikp("span",{_id:"aiChatDisclaimerLabel"}),je=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),i=e.disclaimerSettings;return n.jsx(Ka,{children:i?.label,...t})}),za=a.ikp(T.Trigger,{_id:"aiChatDisclaimerTrigger",children:n.jsx(E.CustomIcon,{iconKey:"info"})}),ye=g.memo(t=>{const{setOpen:e}=oe.useHoverPopover(),i=()=>e(!0),s=()=>e(!1);return n.jsx(za,{onMouseEnter:i,onMouseLeave:s,...t})}),Ga=a.ikp(T.Content,{_id:"aiChatDisclaimerContent"}),He=t=>{const{setOpen:e}=oe.useHoverPopover(),i=()=>e(!0),s=()=>e(!1);return n.jsx(Ga,{onMouseEnter:i,onMouseLeave:s,side:"top",sideOffset:8,align:"end",alignOffset:-10,...t})},Ya=a.ikp(U.Markdown,{_id:"aiChatDisclaimerText"}),we=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),i=e.aiAssistantName,r=e.disclaimerSettings?.tooltip||`Information provided by ${i||"this AI assistant"} is not guaranteed to be accurate or comprehensive.`;return n.jsx(Ya,{shouldOpenLinksInNewTab:!0,children:r,...t})}),Le=a.ikp(T.Arrow,{_id:"aiChatDisclaimerArrow"}),Ja=a.ikp("div",{_id:"aiChatExampleQuestions"}),De=t=>{const{aiChatSettings:e}=p.useInkeepConfig(),{messages:i}=v.useChat();return!e.exampleQuestions?.length||i.length?null:n.jsx(Ja,{...t})},Xa=a.ikp("h3",{_id:"aiChatExampleQuestionsLabel"}),Oe=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig();return n.jsx(Xa,{children:e.exampleQuestionsLabel,...t})}),Za=a.ikp("div",{_id:"aiChatExampleQuestionsList"}),qe=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),i=e.exampleQuestions,{children:s,...r}=t;return n.jsx(Za,{children:h.maybeRender(s,i),...r})}),en=a.ikp("div",{_id:"aiChatExampleQuestion"}),Re=g.forwardRef((t,e)=>{const{aiChatSettings:i}=p.useInkeepConfig(),s=i.isFirstExampleQuestionHighlighted;return n.jsx(en,{ref:e,"data-highlight":h.dataAttr(s),...t})}),tn=a.ikp("button",{_id:"aiChatExampleQuestionButton"}),We=t=>{const{question:e,onClick:i,...s}=t,{handleSubmit:r}=v.useChat();return n.jsx(tn,{onClick:u.composeEventHandlers(i,()=>r(e)),children:e,...s})},an=a.ikp("div",{_id:"aiChatWorkflows"}),Ne=t=>{const{aiChatSettings:e}=p.useInkeepConfig(),{messages:i}=v.useChat();return!e.workflows?.length||i.length?null:n.jsx(an,{...t})},nn=a.ikp("h3",{_id:"aiChatWorkflowsLabel"}),Qe=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig();return n.jsx(nn,{children:e.workflowsHeader,...t})}),sn=a.ikp("div",{_id:"aiChatWorkflowsList"}),$e=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),i=e.workflows,{children:s,...r}=t;return n.jsx(sn,{children:h.maybeRender(s,i),...r})}),rn=a.ikp("button",{_id:"aiChatWorkflow"}),Ve=t=>{const{workflow:e,onClick:i,...s}=t,{handleWorkflow:r}=v.useChat();return n.jsx(rn,{onClick:u.composeEventHandlers(i,()=>r(e)),children:e.displayName,...s})},on=a.ikp("div",{_id:"aiChatMessageWrapper"}),ce=t=>{const{message:e,...i}=t;return e.role==="system"?null:n.jsx(P.MessageProvider,{message:e,children:n.jsx(on,{"data-role":e.role,...i})})},Ue=g.memo(t=>{const{message:e,...i}=t,{aiChatSettings:s,baseSettings:r}=p.useInkeepConfig(),o=s.aiAssistantName,d=o?`Hi, I'm ${o}!`:"Hi!",c=s.chatSubjectName??r.organizationDisplayName,m=`${d}
|
|
2
2
|
|
|
3
|
-
I'm an AI assistant trained on documentation, help articles, and other content.`,
|
|
3
|
+
I'm an AI assistant trained on documentation, help articles, and other content.`,l=c?`
|
|
4
4
|
|
|
5
5
|
Ask me anything about \`${c}\`.`:`
|
|
6
6
|
|
|
7
|
-
Let me know how I can help.`,b={content:s.introMessage??`${m}${h}`,id:Oa,...e,role:"assistant",links:[]};return n.jsx(ce,{message:b,...i})}),dn=a.ikp("div",{_id:"aiChatMessageHeader"}),Ke=t=>{const{message:e}=P.useMessage();return n.jsx(dn,{"data-role":e.role,...t})},cn=a.ikp("div",{_id:"aiChatMessageLoading"}),ze=t=>{const{isLoading:e,isStreaming:i,messages:s}=v.useChat(),{message:r}=P.useMessage();return!(s.at(-1)?.id===r?.id)||r.role!=="assistant"||!e||i?null:n.jsx(cn,{children:"Thinking...",...t})},mn=a.ikp("div",{_id:"aiChatMessageAvatar"}),Ge=t=>{const{message:e}=P.useMessage();return n.jsx(mn,{"data-role":e.role,...t})},ln=a.ikp(de.Root,{_id:"aiChatMessageAvatarContent"}),Ye=t=>{const{message:e}=P.useMessage(),{baseSettings:i}=C.useInkeepConfig();return n.jsx(ln,{"data-username":l.dataAttr(e.role==="user"&&!!i.userProperties.name),"data-role":e.role,...t})},hn=a.ikp(de.Fallback,{_id:"aiChatMessageAvatarFallback"}),Je=g.memo(t=>{const{baseSettings:e}=C.useInkeepConfig(),{message:i}=P.useMessage();return e.userProperties.name?n.jsx(hn,{"data-role":i.role,children:l.getInitials(e.userProperties.name),...t}):null}),pe=a.ikp(de.Image,{_id:"aiChatMessageAvatarImage"}),Xe=g.memo(t=>{const{onLoadingStatusChange:e,...i}=t,{aiChatSettings:s,baseSettings:{userProperties:r}}=C.useInkeepConfig(),{message:o}=P.useMessage(),{aiAssistantAvatar:d}=s??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,h=ja.useColorModeValue(c,m),[p,b]=g.useState(h);g.useEffect(()=>{b(h)},[h]);const k=y=>{y==="error"&&b(null)};return o.role==="user"?r.name?null:s.userAvatar?n.jsx(pe,{"data-type":"image",alt:"User avatar","data-role":o.role,src:s.userAvatar,...t}):n.jsx(Ea.default,{"data-type":"icon","data-role":o.role,...t}):p?n.jsx(pe,{src:p,alt:"AI assistant avatar","data-type":"image","data-role":o.role,onLoadingStatusChange:u.composeEventHandlers(e,k),...i}):n.jsx(Fa.default,{"data-type":"icon","data-role":o.role,...t})}),un=a.ikp("span",{_id:"aiChatMessageName"}),Ze=t=>{const{message:e}=P.useMessage();return n.jsx(un,{"data-role":e.role,children:e.role==="user"?"You":"AI assistant",...t})},Cn=a.ikp("div",{_id:"aiChatMessageContentWrapper"}),et=t=>{const{message:e}=P.useMessage(),{messageButtons:i}=v.useChat(),s=i[e.id]||[];return n.jsx(Cn,{"data-role":e.role,"data-has-message-buttons":l.dataAttr(!!s.length),...t})},pn=a.ikp("div",{_id:"aiChatMessageContent"}),tt=t=>{const{message:e}=P.useMessage();return n.jsx(pn,{"data-role":e.role,...t})},vn=a.ikp("div",{_id:"aiChatMessageAttachments"}),it=t=>{const{message:e}=P.useMessage(),i=e.metadata?.attributes?.attachments;return e.role!=="user"||!i?.length?null:n.jsx(O.MessageAttachmentsProvider,{children:n.jsx(vn,{...t})})},bn=a.ikp("div",{_id:"aiChatMessageAttachments__List"}),at=t=>{const{children:e,...i}=t,{message:s}=P.useMessage(),r=s.metadata?.attributes?.attachments;return r?n.jsx(bn,{children:l.maybeRender(e,r),...i}):null},gn=a.ikp("div",{_id:"aiChatMessageAttachments__Item"}),nt=t=>{const{attachment:e,onClick:i,...s}=t,{selectItem:r,onOpen:o}=O.useMessageAttachments(),d=()=>{r(e),o()};return n.jsx(w.AttachmentItemProvider,{attachment:e,children:n.jsx(gn,{onClick:u.composeEventHandlers(i,d),...s})})},Pn=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),st=t=>{const{attachment:e}=w.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Pn,{iconSettings:i,...t}):null},An=a.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),rt=t=>{const{attachment:e}=w.useAttachmentItem();return n.jsx(An,{children:e.title,...t})},_n=a.ikp(A.Root,{_id:"aiChatMessageAttachmentsPreview"}),ot=t=>{const{onOpenChange:e,...i}=t,{selectItem:s,isOpen:r,onClose:o,selectedItem:d}=O.useMessageAttachments(),c=m=>{m||(o(),s(null))};return n.jsx(_n,{open:r&&d!==null,onOpenChange:u.composeEventHandlers(e,c),...i})},dt=a.ikp(A.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),ct=a.ikp(A.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),Fn=a.ikp(A.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),mt=t=>{const{selectedItem:e}=O.useMessageAttachments();return n.jsx(Fn,{children:e?.title||"Attachment",...t})},lt=a.ikp(A.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:n.jsx(F.CustomIcon,{iconKey:"close"})}),En=a.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),ht=t=>{const{selectedItem:e}=O.useMessageAttachments();return n.jsx(En,{children:e?.content,...t})},ve=a.ikp("div",{_id:"aiChatMessage"}),ut=t=>{const{aiChatSettings:e}=C.useInkeepConfig(),{componentStyles:i,...s}=t,{message:r}=P.useMessage(),{logEvent:o}=U.useChatEvents(),d=l.getMessageContent(r),{conversation:c}=D.useInkeepConversation();return r.role==="user"?n.jsx(ve,{"data-role":r.role,children:d,...s}):n.jsx(ve,{"data-role":r.role,...s,children:n.jsx(V.Markdown,{children:d,componentStyles:i,shouldOpenLinksInNewTab:e.shouldOpenLinksInNewTab,onLinkClick:(m,h)=>{o({eventName:"assistant_message_inline_link_opened",properties:{title:h?.toString(),url:m}})},onCodeCopy:(m,h)=>{o({eventName:"assistant_code_block_copied",properties:{conversation:c,language:m,code:h}})}})})},kn=a.ikp("div",{_id:"aiChatMessageToolbar"}),Ct=t=>{const{isLoading:e,messages:i}=v.useChat(),{message:s}=P.useMessage();return i.at(-1)?.id===s?.id&&e||s.role==="user"?null:n.jsx(kn,{...t})},In=a.ikp("div",{_id:"aiChatMessageToolActions"}),pt=t=>{const{children:e,...i}=t,{message:s}=P.useMessage(),{messageButtons:r}=v.useChat(),o=r[s.id]||[];return n.jsx(In,{children:l.maybeRender(e,o),...i})},Mn=a.ikp("a",{_id:"aiChatMessageToolAction"}),Sn=a.ikp("button",{_id:"aiChatMessageToolAction"}),vt=t=>{const{onClick:e,action:i,...s}=t,{handleAction:r}=se.useChatAction(i),o=()=>{r()},d=i.label||"Contact Support",c=n.jsxs(n.Fragment,{children:[i.icon&&n.jsx(x.BuiltInIconRenderer,{iconSettings:i.icon}),d]});return i.action.type==="open_link"?n.jsx(Mn,{href:i.action.url,target:"_blank",rel:"noopener","data-type":i.action.type,onClick:u.composeEventHandlers(e,o),children:c,...s}):n.jsx(Sn,{"data-type":i.action.type,onClick:u.composeEventHandlers(e,o),children:c,...s})},xn=a.ikp("button",{_id:"aiChatMessageAction"}),bt=t=>{const{action:e,onClick:i,className:s,...r}=t,{conversation:o}=D.useInkeepConversation(),{message:d}=P.useMessage(),{isStreaming:c,messages:m}=v.useChat(),[h,p]=te.useCopyToClipboard(),{feedback:b,submitPositiveFeedback:k,setCurrentFeedback:y,currentFeedback:W}=ne.useMessageFeedback(),{logEvent:J}=U.useChatEvents(),[N,X]=Sa.useSettleAction(),{baseSettings:{privacyPreferences:he}}=C.useInkeepConfig(),{optOutAllAnalytics:Z}=he,ue=m.at(-1)?.id===d?.id,ee=d.role==="assistant";if(ue&&c||!ee||{copy:!1,upvote:Z,downvote:Z}[e])return null;const H={copy(){p(l.getMessageContent(d)),J({eventName:"assistant_message_copied",properties:{conversation:o}})},upvote(){k(d.id).then(()=>{X()})},downvote(){y(d.id)}},L={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},M={copy:n.jsx(F.CustomIcon,{iconKey:h?"messageCopied":"messageCopy"}),upvote:n.jsx(F.CustomIcon,{iconKey:N?"messageCopied":"thumbsUp"}),downvote:n.jsx(F.CustomIcon,{iconKey:"thumbsDown"})},S={copy:{"data-copied":l.dataAttr(h)},upvote:{"data-upvoted":l.dataAttr(b[d.id]?.type==="positive")},downvote:{"data-downvoted":l.dataAttr(b[d.id]?.type==="negative"),"data-state":W===null?"closed":"open"}};return n.jsx(xn,{"data-action":e,...S[e],children:M[e],"aria-label":L[e],className:`${s} ${e}`,onClick:u.composeEventHandlers(i,H[e]),...r})},Bn=a.ikp("div",{_id:"aiChatMessageSources"}),gt=t=>{const{message:e}=P.useMessage();return e.role!=="assistant"||!e.links?.length?null:n.jsx(Bn,{...t})},fn=a.ikp("div",{_id:"aiChatMessageSources__Header"}),Pt=t=>n.jsx(fn,{children:"Sources",...t}),Tn=a.ikp("div",{_id:"aiChatMessageSources__List"}),At=t=>{const{message:e}=P.useMessage(),{children:i,...s}=t,{baseSettings:{transformSource:r,organizationDisplayName:o},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=C.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.links.map(h=>{const p=wa.transformInkeepSource(h,"chatSourceItem",{organizationDisplayName:o,tabs:c,transformSource:r}),b=p.shouldOpenInNewTab!==void 0?p.shouldOpenInNewTab:d;return{...p,isExternal:b}});return n.jsx(Tn,{children:l.maybeRender(i,m),...s})},jn=a.ikp(ka.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),_t=t=>{const{source:e,onClick:i,...s}=t,{logEvent:r}=U.useChatEvents(),{conversation:o}=D.useInkeepConversation(),d=()=>{r({eventName:"assistant_source_item_clicked",properties:{conversation:o,link:e}})};return n.jsx(B.SourceItemProvider,{source:e,children:n.jsx(jn,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:u.composeEventHandlers(i,d),...s})})},yn=a.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),Ft=t=>{const{source:e}=B.useSourceItem();return e.breadcrumbs?.length?n.jsx(yn,{"data-type":e.type,...t}):null},Hn=a.ikp(F.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),wn=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),Et=t=>{const{source:e}=B.useSourceItem();return n.jsx(wn,{iconSettings:e.icon,"data-type":e.type,...t})},Ln=a.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),kt=t=>{const{source:e}=B.useSourceItem();return n.jsx(Ln,{"data-type":e.type,children:e.title,...t})},Dn=a.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),It=t=>{const{source:e}=B.useSourceItem();return n.jsx(Dn,{"data-type":e.type,...t})},On=a.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),Mt=t=>{const{source:e}=B.useSourceItem(),{children:i,...s}=t,r=g.useMemo(()=>e.description?fa.highlightEmphasis(e.description):[],[e.description]);return r.length?n.jsx(On,{"data-type":e.type,children:l.maybeRender(i,r),...s}):null},qn=a.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),St=t=>{const{part:e,...i}=t,{source:s}=B.useSourceItem();return typeof e=="string"?e:n.jsx(qn,{"data-type":s.type,children:e.content,"data-highlighted":l.dataAttr(e.highlighted),...i})},Rn=a.ikp(F.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),xt=t=>{const{source:e}=B.useSourceItem();return n.jsx(Rn,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Bt=a.ikp("div",{_id:"aiChatFooter"}),ft=a.ikp("div",{_id:"aiChatInput__Fieldset"}),Tt=a.ikp("div",{_id:"aiChatInput__Group"}),Wn=a.ikp("textarea",{_id:"aiChatInput"}),jt=g.forwardRef(({onChange:t,onKeyDown:e,...i},s)=>{const{handleInputChange:r,handleInputKeyDown:o,input:d,error:c,shouldAutoFocusInput:m,inputRef:h}=v.useChat(),{aiChatSettings:p}=C.useInkeepConfig(),b=re.useComposedRefs(s,h);return Da.useWidgetAutoFocus("chat",h,m),n.jsx(Wn,{asChild:!0,ref:b,maxLength:99999,placeholder:p.placeholder,value:d,onChange:u.composeEventHandlers(t,r),onKeyDown:u.composeEventHandlers(e,o),disabled:!!c||p.isViewOnly,...i,children:n.jsx(ae,{})})}),Nn=a.ikp("button",{_id:"aiChatInput__SendButton"}),yt=t=>{const{handleSubmit:e,isSubmitDisabled:i,error:s}=v.useChat(),{aiChatSettings:r}=C.useInkeepConfig(),{onClick:o,...d}=t;return n.jsx(Nn,{onClick:u.composeEventHandlers(o,()=>e()),"aria-label":"Send message",disabled:i||!!s||r.isViewOnly,...d})},Ht=a.ikp(F.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),Qn=a.ikp("div",{_id:"aiChatAttachmentsBar"}),wt=t=>{const{selectedWorkflow:e}=v.useChat();return!e||!e.supportedInputs?.length?null:n.jsx(E.AttachmentsBarProvider,{children:n.jsx(Qn,{...t})})},$n=a.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Lt=t=>{const{children:e,...i}=t,{messageAttachments:s}=v.useChat();return n.jsx($n,{children:l.maybeRender(e,s),...i})},Vn=a.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),Dt=t=>{const{attachment:e,...i}=t;return n.jsx(w.AttachmentItemProvider,{attachment:e,children:n.jsx(Vn,{...i})})},Un=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),Ot=t=>{const{attachment:e}=w.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Un,{iconSettings:i,...t}):null},Kn=a.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),qt=t=>{const{attachment:e}=w.useAttachmentItem();return n.jsx(Kn,{children:e.title,...t})},zn=a.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Rt=t=>{const{onClick:e,...i}=t,{attachment:s}=w.useAttachmentItem(),{setMessageAttachments:r}=v.useChat(),o=()=>{r(d=>d.filter(c=>c.id!==s.id))};return n.jsx(zn,{"aria-label":"Remove attachment",children:n.jsx(F.CustomIcon,{iconKey:"close"}),onClick:u.composeEventHandlers(e,o),...i})},Wt=a.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Nt=a.ikp(j.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Qt=a.ikp(j.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:n.jsx(F.CustomIcon,{iconKey:"info"})}),me=a.ikp(j.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),$t=a.ikp(j.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:n.jsxs(n.Fragment,{children:[n.jsx(me,{}),"Attachments will be kept in context for the entire conversation."]})}),Gn=a.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Vt=t=>{const{children:e,...i}=t,{selectedWorkflow:s}=v.useChat();return s?.supportedInputs?n.jsx(Gn,{children:l.maybeRender(e,s.supportedInputs),...i}):null},Yn=a.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),Ut=t=>{const{input:e,onClick:i,...s}=t,{selectedWorkflow:r,messageAttachments:o,setMessageAttachments:d}=v.useChat(),{selectInput:c,onOpen:m}=E.useAttachmentsBar(),h=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return r?e.onInvoke(r,e,d,[...o]):void 0;c(e),m()};return n.jsx(Yn,{children:e.displayName,onClick:u.composeEventHandlers(i,h),...s})},Jn=a.ikp(A.Root,{_id:"aiChatAttachmentsBar__Modal"}),Kt=t=>{const{onOpenChange:e,...i}=t,{selectInput:s,isOpen:r,onClose:o,selectedInput:d}=E.useAttachmentsBar(),c=m=>{m||(o(),s(null))};return n.jsx(Jn,{open:r&&d!==null,onOpenChange:u.composeEventHandlers(e,c),...i})},zt=a.ikp(A.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Gt=a.ikp(A.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Yt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),Xn=a.ikp(A.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),Jt=t=>{const{selectedInput:e}=E.useAttachmentsBar(),i=`Add ${e?.displayName}`;return n.jsx(Xn,{children:i,...t})},Zn=a.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Xt=t=>{const{selectedInput:e}=E.useAttachmentsBar(),i=e?.workflowModalProps?.modalHelpText;return i?n.jsx(Zn,{children:i,...t}):null},es=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),Zt=t=>{const{children:e,...i}=t,{selectedInput:s}=E.useAttachmentsBar(),r=s?.workflowModalProps?.modalHelpElement;return r?n.jsx(es,{asChild:!e,children:e||r,...i}):null},ei=a.ikp(A.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:n.jsx(F.CustomIcon,{iconKey:"close"})}),ti=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),ts=a.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),ii=t=>{const{onSubmit:e,...i}=t,{form:s}=E.useAttachmentsBar();return n.jsx(ts,{onSubmit:u.composeEventHandlers(e,s.onSubmit),...i})},ai=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),is=a.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),ni=t=>{const{form:e,selectedInput:i}=E.useAttachmentsBar();return n.jsx(is,{htmlFor:`${i?.id}-title`,children:e.labels.title,...t})},as=a.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),si=t=>{const{onChange:e,...i}=t,{form:s,selectedInput:r}=E.useAttachmentsBar();return n.jsx(as,{name:"title",value:s.data.title,id:`${r?.id}-title`,"data-invalid":l.dataAttr(!!s.errors.title),"aria-invalid":!!s.errors.title,onChange:u.composeEventHandlers(e,s.onChange),...i})},ns=a.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),ri=t=>{const{form:e}=E.useAttachmentsBar();return e.errors.title?n.jsx(ns,{"aria-live":"polite",children:e.errors.title,...t}):null},oi=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),ss=a.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),di=t=>{const{form:e,selectedInput:i}=E.useAttachmentsBar();return n.jsx(ss,{htmlFor:`${i?.id}-content`,children:e.labels.content,...t})},rs=a.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ci=t=>{const{onChange:e,...i}=t,{form:s,selectedInput:r}=E.useAttachmentsBar();return n.jsx(rs,{asChild:!0,rows:4,name:"content",value:s.data.content,id:`${r?.id}-content`,"data-invalid":l.dataAttr(!!s.errors.content),"aria-invalid":!!s.errors.content,onChange:u.composeEventHandlers(e,s.onChange),...i,children:n.jsx(ae,{maxRows:10})})},os=a.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),mi=t=>{const{form:e}=E.useAttachmentsBar();return e.errors.content?n.jsx(os,{"aria-live":"polite",children:e.errors.content,...t}):null},li=a.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),hi=a.ikp("div",{_id:"aiChatActionBar"}),ui=a.ikp("div",{_id:"aiChat__ChatActions"}),Ci=a.ikp("div",{_id:"aiChatTagline__Container"}),pi=a.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),vi=a.ikp(Ma.default,{_id:"aiChatTagline__Logo"}),bi=a.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),ds=a.ikp(j.Trigger,{_id:"aiChat__ChatAction"}),G=t=>{const{action:e,onClick:i,className:s,...r}=t,{clear:o,stop:d,isLoading:c,messages:m,selectedWorkflow:h}=v.useChat(),{conversation:p}=D.useInkeepConversation(),{aiChatSettings:b,baseSettings:k}=C.useInkeepConfig(),{logEvent:y}=U.useChatEvents(),[W,J]=te.useCopyToClipboard(),[N,X]=te.useCopyToClipboard();if({help:!1,copy:m.length===0||!b.isCopyChatButtonVisible||c,share:m.length===0||!b.isShareButtonVisible||!p.id||!!h||c,clear:m.length===0||b.isViewOnly||c,stop:!c}[e])return null;const ee={help:()=>{},copy:()=>{const Q=m.map(H=>{const L=`**${H.role==="assistant"?"AI Assistant":"User"}**`,M=l.getMessageContent(H),S=Ia.stringifyAttachments(H.metadata?.attributes?.attachments),$=S?`
|
|
7
|
+
Let me know how I can help.`,b={content:s.introMessage??`${m}${l}`,id:Oa,...e,role:"assistant",links:[]};return n.jsx(ce,{message:b,...i})}),dn=a.ikp("div",{_id:"aiChatMessageHeader"}),Ke=t=>{const{message:e}=P.useMessage();return n.jsx(dn,{"data-role":e.role,...t})},cn=a.ikp("div",{_id:"aiChatMessageLoading"}),ze=t=>{const{isLoading:e,isStreaming:i,messages:s}=v.useChat(),{message:r}=P.useMessage();return!(s.at(-1)?.id===r?.id)||r.role!=="assistant"||!e||i?null:n.jsx(cn,{children:"Thinking...",...t})},mn=a.ikp("div",{_id:"aiChatMessageAvatar"}),Ge=t=>{const{message:e}=P.useMessage();return n.jsx(mn,{"data-role":e.role,...t})},ln=a.ikp(de.Root,{_id:"aiChatMessageAvatarContent"}),Ye=t=>{const{message:e}=P.useMessage(),{baseSettings:i}=p.useInkeepConfig();return n.jsx(ln,{"data-username":h.dataAttr(e.role==="user"&&!!i.userProperties.name),"data-role":e.role,...t})},hn=a.ikp(de.Fallback,{_id:"aiChatMessageAvatarFallback"}),Je=g.memo(t=>{const{baseSettings:e}=p.useInkeepConfig(),{message:i}=P.useMessage();return e.userProperties.name?n.jsx(hn,{"data-role":i.role,children:h.getInitials(e.userProperties.name),...t}):null}),pe=a.ikp(de.Image,{_id:"aiChatMessageAvatarImage"}),Xe=g.memo(t=>{const{onLoadingStatusChange:e,...i}=t,{aiChatSettings:s,baseSettings:{userProperties:r}}=p.useInkeepConfig(),{message:o}=P.useMessage(),{aiAssistantAvatar:d}=s??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,l=ja.useColorModeValue(c,m),[C,b]=g.useState(l);g.useEffect(()=>{b(l)},[l]);const k=y=>{y==="error"&&b(null)};return o.role==="user"?r.name?null:s.userAvatar?n.jsx(pe,{"data-type":"image",alt:"User avatar","data-role":o.role,src:s.userAvatar,...t}):n.jsx(Fa.default,{"data-type":"icon","data-role":o.role,...t}):C?n.jsx(pe,{src:C,alt:"AI assistant avatar","data-type":"image","data-role":o.role,onLoadingStatusChange:u.composeEventHandlers(e,k),...i}):n.jsx(Ea.default,{"data-type":"icon","data-role":o.role,...t})}),un=a.ikp("span",{_id:"aiChatMessageName"}),Ze=t=>{const{message:e}=P.useMessage();return n.jsx(un,{"data-role":e.role,children:e.role==="user"?"You":"AI assistant",...t})},Cn=a.ikp("div",{_id:"aiChatMessageContentWrapper"}),et=t=>{const{message:e}=P.useMessage(),{messageButtons:i}=v.useChat(),s=i[e.id]||[];return n.jsx(Cn,{"data-role":e.role,"data-has-message-buttons":h.dataAttr(!!s.length),...t})},pn=a.ikp("div",{_id:"aiChatMessageContent"}),tt=t=>{const{message:e}=P.useMessage();return n.jsx(pn,{"data-role":e.role,...t})},vn=a.ikp("div",{_id:"aiChatMessageAttachments"}),it=t=>{const{message:e}=P.useMessage(),i=e.metadata?.attributes?.attachments;return e.role!=="user"||!i?.length?null:n.jsx(q.MessageAttachmentsProvider,{children:n.jsx(vn,{...t})})},bn=a.ikp("div",{_id:"aiChatMessageAttachments__List"}),at=t=>{const{children:e,...i}=t,{message:s}=P.useMessage(),r=s.metadata?.attributes?.attachments;return r?n.jsx(bn,{children:h.maybeRender(e,r),...i}):null},gn=a.ikp("div",{_id:"aiChatMessageAttachments__Item"}),nt=t=>{const{attachment:e,onClick:i,...s}=t,{selectItem:r,onOpen:o}=q.useMessageAttachments(),d=()=>{r(e),o()};return n.jsx(w.AttachmentItemProvider,{attachment:e,children:n.jsx(gn,{onClick:u.composeEventHandlers(i,d),...s})})},Pn=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),st=t=>{const{attachment:e}=w.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Pn,{iconSettings:i,...t}):null},An=a.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),rt=t=>{const{attachment:e}=w.useAttachmentItem();return n.jsx(An,{children:e.title,...t})},_n=a.ikp(A.Root,{_id:"aiChatMessageAttachmentsPreview"}),ot=t=>{const{onOpenChange:e,...i}=t,{selectItem:s,isOpen:r,onClose:o,selectedItem:d}=q.useMessageAttachments(),c=m=>{m||(o(),s(null))};return n.jsx(_n,{open:r&&d!==null,onOpenChange:u.composeEventHandlers(e,c),...i})},dt=a.ikp(A.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),ct=a.ikp(A.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),En=a.ikp(A.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),mt=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(En,{children:e?.title||"Attachment",...t})},lt=a.ikp(A.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:n.jsx(E.CustomIcon,{iconKey:"close"})}),Fn=a.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),ht=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(Fn,{children:e?.content,...t})},ve=a.ikp("div",{_id:"aiChatMessage"}),ut=t=>{const{aiChatSettings:e}=p.useInkeepConfig(),{componentStyles:i,...s}=t,{message:r}=P.useMessage(),{logEvent:o}=O.useChatEvents(),d=h.getMessageContent(r),{conversation:c}=L.useInkeepConversation();return r.role==="user"?n.jsx(ve,{"data-role":r.role,children:d,...s}):n.jsx(ve,{"data-role":r.role,...s,children:n.jsx(U.Markdown,{children:d,componentStyles:i,shouldOpenLinksInNewTab:e.shouldOpenLinksInNewTab,onLinkClick:(m,l)=>{o({eventName:"assistant_message_inline_link_opened",properties:{title:l?.toString(),url:m}})},onCodeCopy:(m,l)=>{o({eventName:"assistant_code_block_copied",properties:{conversation:c,language:m,code:l}})}})})},kn=a.ikp("div",{_id:"aiChatMessageToolbar"}),Ct=t=>{const{isLoading:e,messages:i}=v.useChat(),{message:s}=P.useMessage();return i.at(-1)?.id===s?.id&&e||s.role==="user"?null:n.jsx(kn,{...t})},In=a.ikp("div",{_id:"aiChatMessageToolActions"}),pt=t=>{const{children:e,...i}=t,{message:s}=P.useMessage(),{messageButtons:r}=v.useChat(),o=r[s.id]||[];return n.jsx(In,{children:h.maybeRender(e,o),...i})},Mn=a.ikp("a",{_id:"aiChatMessageToolAction"}),Sn=a.ikp("button",{_id:"aiChatMessageToolAction"}),vt=t=>{const{onClick:e,action:i,...s}=t,{handleAction:r}=se.useChatAction(i),{logEvent:o}=O.useChatEvents(),{conversation:d}=L.useInkeepConversation(),c=()=>{r(),o({eventName:"user_escalation_indicated",properties:{escalationType:"contact_us",conversation:d}})},m=i.label||"Contact Support",l=n.jsxs(n.Fragment,{children:[i.icon&&n.jsx(x.BuiltInIconRenderer,{iconSettings:i.icon}),m]});return i.action.type==="open_link"?n.jsx(Mn,{href:i.action.url,target:"_blank",rel:"noopener","data-type":i.action.type,onClick:u.composeEventHandlers(e,c),children:l,...s}):n.jsx(Sn,{"data-type":i.action.type,onClick:u.composeEventHandlers(e,c),children:l,...s})},xn=a.ikp("button",{_id:"aiChatMessageAction"}),bt=t=>{const{action:e,onClick:i,className:s,...r}=t,{conversation:o}=L.useInkeepConversation(),{message:d}=P.useMessage(),{isStreaming:c,messages:m}=v.useChat(),[l,C]=te.useCopyToClipboard(),{feedback:b,submitPositiveFeedback:k,setCurrentFeedback:y,currentFeedback:N}=ne.useMessageFeedback(),{logEvent:J}=O.useChatEvents(),[Q,X]=Sa.useSettleAction(),{baseSettings:{privacyPreferences:he}}=p.useInkeepConfig(),{optOutAllAnalytics:Z}=he,ue=m.at(-1)?.id===d?.id,ee=d.role==="assistant";if(ue&&c||!ee||{copy:!1,upvote:Z,downvote:Z}[e])return null;const H={copy(){C(h.getMessageContent(d)),J({eventName:"assistant_message_copied",properties:{conversation:o}})},upvote(){k(d.id).then(()=>{X()})},downvote(){y(d.id)}},D={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},M={copy:n.jsx(E.CustomIcon,{iconKey:l?"messageCopied":"messageCopy"}),upvote:n.jsx(E.CustomIcon,{iconKey:Q?"messageCopied":"thumbsUp"}),downvote:n.jsx(E.CustomIcon,{iconKey:"thumbsDown"})},S={copy:{"data-copied":h.dataAttr(l)},upvote:{"data-upvoted":h.dataAttr(b[d.id]?.type==="positive")},downvote:{"data-downvoted":h.dataAttr(b[d.id]?.type==="negative"),"data-state":N===null?"closed":"open"}};return n.jsx(xn,{"data-action":e,...S[e],children:M[e],"aria-label":D[e],className:`${s} ${e}`,onClick:u.composeEventHandlers(i,H[e]),...r})},Bn=a.ikp("div",{_id:"aiChatMessageSources"}),gt=t=>{const{message:e}=P.useMessage();return e.role!=="assistant"||!e.links?.length?null:n.jsx(Bn,{...t})},fn=a.ikp("div",{_id:"aiChatMessageSources__Header"}),Pt=t=>n.jsx(fn,{children:"Sources",...t}),Tn=a.ikp("div",{_id:"aiChatMessageSources__List"}),At=t=>{const{message:e}=P.useMessage(),{children:i,...s}=t,{baseSettings:{transformSource:r,organizationDisplayName:o},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=p.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.links.map(l=>{const C=wa.transformInkeepSource(l,"chatSourceItem",{organizationDisplayName:o,tabs:c,transformSource:r}),b=C.shouldOpenInNewTab!==void 0?C.shouldOpenInNewTab:d;return{...C,isExternal:b}});return n.jsx(Tn,{children:h.maybeRender(i,m),...s})},jn=a.ikp(ka.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),_t=t=>{const{source:e,onClick:i,...s}=t,{logEvent:r}=O.useChatEvents(),{conversation:o}=L.useInkeepConversation(),d=()=>{r({eventName:"assistant_source_item_clicked",properties:{conversation:o,link:e}})};return n.jsx(B.SourceItemProvider,{source:e,children:n.jsx(jn,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:u.composeEventHandlers(i,d),...s})})},yn=a.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),Et=t=>{const{source:e}=B.useSourceItem();return e.breadcrumbs?.length?n.jsx(yn,{"data-type":e.type,...t}):null},Hn=a.ikp(E.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),wn=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),Ft=t=>{const{source:e}=B.useSourceItem();return n.jsx(wn,{iconSettings:e.icon,"data-type":e.type,...t})},Ln=a.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),kt=t=>{const{source:e}=B.useSourceItem();return n.jsx(Ln,{"data-type":e.type,children:e.title,...t})},Dn=a.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),It=t=>{const{source:e}=B.useSourceItem();return n.jsx(Dn,{"data-type":e.type,...t})},On=a.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),Mt=t=>{const{source:e}=B.useSourceItem(),{children:i,...s}=t,r=g.useMemo(()=>e.description?fa.highlightEmphasis(e.description):[],[e.description]);return r.length?n.jsx(On,{"data-type":e.type,children:h.maybeRender(i,r),...s}):null},qn=a.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),St=t=>{const{part:e,...i}=t,{source:s}=B.useSourceItem();return typeof e=="string"?e:n.jsx(qn,{"data-type":s.type,children:e.content,"data-highlighted":h.dataAttr(e.highlighted),...i})},Rn=a.ikp(E.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),xt=t=>{const{source:e}=B.useSourceItem();return n.jsx(Rn,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Bt=a.ikp("div",{_id:"aiChatFooter"}),ft=a.ikp("div",{_id:"aiChatInput__Fieldset"}),Tt=a.ikp("div",{_id:"aiChatInput__Group"}),Wn=a.ikp("textarea",{_id:"aiChatInput"}),jt=g.forwardRef(({onChange:t,onKeyDown:e,...i},s)=>{const{handleInputChange:r,handleInputKeyDown:o,input:d,error:c,shouldAutoFocusInput:m,inputRef:l}=v.useChat(),{aiChatSettings:C}=p.useInkeepConfig(),b=re.useComposedRefs(s,l);return Da.useWidgetAutoFocus("chat",l,m),n.jsx(Wn,{asChild:!0,ref:b,maxLength:99999,placeholder:C.placeholder,value:d,onChange:u.composeEventHandlers(t,r),onKeyDown:u.composeEventHandlers(e,o),disabled:!!c||C.isViewOnly,...i,children:n.jsx(ae,{})})}),Nn=a.ikp("button",{_id:"aiChatInput__SendButton"}),yt=t=>{const{handleSubmit:e,isSubmitDisabled:i,error:s}=v.useChat(),{aiChatSettings:r}=p.useInkeepConfig(),{onClick:o,...d}=t;return n.jsx(Nn,{onClick:u.composeEventHandlers(o,()=>e()),"aria-label":"Send message",disabled:i||!!s||r.isViewOnly,...d})},Ht=a.ikp(E.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),Qn=a.ikp("div",{_id:"aiChatAttachmentsBar"}),wt=t=>{const{selectedWorkflow:e}=v.useChat();return!e||!e.supportedInputs?.length?null:n.jsx(F.AttachmentsBarProvider,{children:n.jsx(Qn,{...t})})},$n=a.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Lt=t=>{const{children:e,...i}=t,{messageAttachments:s}=v.useChat();return n.jsx($n,{children:h.maybeRender(e,s),...i})},Vn=a.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),Dt=t=>{const{attachment:e,...i}=t;return n.jsx(w.AttachmentItemProvider,{attachment:e,children:n.jsx(Vn,{...i})})},Un=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),Ot=t=>{const{attachment:e}=w.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Un,{iconSettings:i,...t}):null},Kn=a.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),qt=t=>{const{attachment:e}=w.useAttachmentItem();return n.jsx(Kn,{children:e.title,...t})},zn=a.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Rt=t=>{const{onClick:e,...i}=t,{attachment:s}=w.useAttachmentItem(),{setMessageAttachments:r}=v.useChat(),o=()=>{r(d=>d.filter(c=>c.id!==s.id))};return n.jsx(zn,{"aria-label":"Remove attachment",children:n.jsx(E.CustomIcon,{iconKey:"close"}),onClick:u.composeEventHandlers(e,o),...i})},Wt=a.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Nt=a.ikp(j.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Qt=a.ikp(j.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:n.jsx(E.CustomIcon,{iconKey:"info"})}),me=a.ikp(j.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),$t=a.ikp(j.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:n.jsxs(n.Fragment,{children:[n.jsx(me,{}),"Attachments will be kept in context for the entire conversation."]})}),Gn=a.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Vt=t=>{const{children:e,...i}=t,{selectedWorkflow:s}=v.useChat();return s?.supportedInputs?n.jsx(Gn,{children:h.maybeRender(e,s.supportedInputs),...i}):null},Yn=a.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),Ut=t=>{const{input:e,onClick:i,...s}=t,{selectedWorkflow:r,messageAttachments:o,setMessageAttachments:d}=v.useChat(),{selectInput:c,onOpen:m}=F.useAttachmentsBar(),l=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return r?e.onInvoke(r,e,d,[...o]):void 0;c(e),m()};return n.jsx(Yn,{children:e.displayName,onClick:u.composeEventHandlers(i,l),...s})},Jn=a.ikp(A.Root,{_id:"aiChatAttachmentsBar__Modal"}),Kt=t=>{const{onOpenChange:e,...i}=t,{selectInput:s,isOpen:r,onClose:o,selectedInput:d}=F.useAttachmentsBar(),c=m=>{m||(o(),s(null))};return n.jsx(Jn,{open:r&&d!==null,onOpenChange:u.composeEventHandlers(e,c),...i})},zt=a.ikp(A.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Gt=a.ikp(A.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Yt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),Xn=a.ikp(A.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),Jt=t=>{const{selectedInput:e}=F.useAttachmentsBar(),i=`Add ${e?.displayName}`;return n.jsx(Xn,{children:i,...t})},Zn=a.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Xt=t=>{const{selectedInput:e}=F.useAttachmentsBar(),i=e?.workflowModalProps?.modalHelpText;return i?n.jsx(Zn,{children:i,...t}):null},es=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),Zt=t=>{const{children:e,...i}=t,{selectedInput:s}=F.useAttachmentsBar(),r=s?.workflowModalProps?.modalHelpElement;return r?n.jsx(es,{asChild:!e,children:e||r,...i}):null},ei=a.ikp(A.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:n.jsx(E.CustomIcon,{iconKey:"close"})}),ti=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),ts=a.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),ii=t=>{const{onSubmit:e,...i}=t,{form:s}=F.useAttachmentsBar();return n.jsx(ts,{onSubmit:u.composeEventHandlers(e,s.onSubmit),...i})},ai=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),is=a.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),ni=t=>{const{form:e,selectedInput:i}=F.useAttachmentsBar();return n.jsx(is,{htmlFor:`${i?.id}-title`,children:e.labels.title,...t})},as=a.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),si=t=>{const{onChange:e,...i}=t,{form:s,selectedInput:r}=F.useAttachmentsBar();return n.jsx(as,{name:"title",value:s.data.title,id:`${r?.id}-title`,"data-invalid":h.dataAttr(!!s.errors.title),"aria-invalid":!!s.errors.title,onChange:u.composeEventHandlers(e,s.onChange),...i})},ns=a.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),ri=t=>{const{form:e}=F.useAttachmentsBar();return e.errors.title?n.jsx(ns,{"aria-live":"polite",children:e.errors.title,...t}):null},oi=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),ss=a.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),di=t=>{const{form:e,selectedInput:i}=F.useAttachmentsBar();return n.jsx(ss,{htmlFor:`${i?.id}-content`,children:e.labels.content,...t})},rs=a.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ci=t=>{const{onChange:e,...i}=t,{form:s,selectedInput:r}=F.useAttachmentsBar();return n.jsx(rs,{asChild:!0,rows:4,name:"content",value:s.data.content,id:`${r?.id}-content`,"data-invalid":h.dataAttr(!!s.errors.content),"aria-invalid":!!s.errors.content,onChange:u.composeEventHandlers(e,s.onChange),...i,children:n.jsx(ae,{maxRows:10})})},os=a.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),mi=t=>{const{form:e}=F.useAttachmentsBar();return e.errors.content?n.jsx(os,{"aria-live":"polite",children:e.errors.content,...t}):null},li=a.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),hi=a.ikp("div",{_id:"aiChatActionBar"}),ui=a.ikp("div",{_id:"aiChat__ChatActions"}),Ci=a.ikp("div",{_id:"aiChatTagline__Container"}),pi=a.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),vi=a.ikp(Ma.default,{_id:"aiChatTagline__Logo"}),bi=a.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),ds=a.ikp(j.Trigger,{_id:"aiChat__ChatAction"}),G=t=>{const{action:e,onClick:i,className:s,...r}=t,{clear:o,stop:d,isLoading:c,messages:m,selectedWorkflow:l}=v.useChat(),{conversation:C}=L.useInkeepConversation(),{aiChatSettings:b,baseSettings:k}=p.useInkeepConfig(),{logEvent:y}=O.useChatEvents(),[N,J]=te.useCopyToClipboard(),[Q,X]=te.useCopyToClipboard();if({help:!1,copy:m.length===0||!b.isCopyChatButtonVisible||c,share:m.length===0||!b.isShareButtonVisible||!C.id||!!l||c,clear:m.length===0||b.isViewOnly||c,stop:!c}[e])return null;const ee={help:()=>{},copy:()=>{const $=m.map(H=>{const D=`**${H.role==="assistant"?"AI Assistant":"User"}**`,M=h.getMessageContent(H),S=Ia.stringifyAttachments(H.metadata?.attributes?.attachments),V=S?`
|
|
8
8
|
|
|
9
9
|
**Attachments**
|
|
10
10
|
|
|
11
|
-
${S}`:"";return`${
|
|
11
|
+
${S}`:"";return`${D}
|
|
12
12
|
|
|
13
|
-
${M}${
|
|
13
|
+
${M}${V}`}).join(`
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
`);J(Q)},share:async()=>{const Q={visibility:"public",tags:[],userProperties:{},messages:p.messages.map(S=>({...S,createdAt:void 0,updatedAt:void 0,id:Date.now().toString()+S.id,conversationId:void 0}))},{apiKey:H,analyticsApiBaseUrl:L}=k,M=await Ha.logConversation("",Q,H,L);if(M){const $=`${b.shareChatUrlBasePath}?${D.SHARE_QUERY_PARAM}=${M?.id}`;X($),y({eventName:"chat_share_button_clicked",properties:{sharedConversationId:M?.id,originalConversationId:p.id,sharedChatUrl:$,conversation:M}})}},clear:o,stop:d},Ce={copy:W,share:N};return n.jsx(j.Tooltip,{delayDuration:0,open:Ce[e],children:n.jsx(ds,{"data-type":e,"data-copied":l.dataAttr(W||N),className:`${s} ${e}`,children:n.jsx(le,{action:e}),onClick:u.composeEventHandlers(i,ee[e]),...r})})},cs=a.ikp("span",{_id:"aiChat__ChatActionLabel"}),le=t=>{const{action:e,...i}=t,{aiChatSettings:s}=C.useInkeepConfig(),r=s.toolbarButtonLabels??{},o={help:r.getHelp??"Get Help",copy:r.copyChat??"Copy",share:r.share??"Share",clear:r.clear??"Clear",stop:r.stop??"Stop"};return n.jsx(cs,{children:o[e],...i})},ms=a.ikp(j.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),gi=t=>{const{action:e,children:i,...s}=t,r={copy:"Copied!",share:"Link copied!"};return n.jsxs(ms,{sideOffset:5,...s,children:[n.jsx(j.Arrow,{}),i||r[e]]})},ls=a.ikp(T.Root,{_id:"aiChatHelpActions"}),Pi=t=>{const{children:e,...i}=t,{aiChatSettings:s}=C.useInkeepConfig(),{getHelpOptions:r}=s;if(!r||(r??[]).length===0)return null;const{_pinned:o,_unpinned:d}=r.reduce((p,b)=>{const k=b.isPinnedToToolbar?"_pinned":"_unpinned";return{...p,[k]:[...p[k],b]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...o,d[0]]:o,m=d.length===1?[]:d,h=ie.useHelpMenuState();return n.jsx(ie.HelpMenuProvider,{value:h,children:n.jsx(ls,{open:h.open,onOpenChange:h.setOpen,children:l.maybeRender(e,{pinned:c,unpinned:m}),...i})})},hs=a.ikp(G,{_id:"aiChatHelpAction",action:"help"}),us=a.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),Ai=t=>{const{action:e,onClick:i,...s}=t,{handleAction:r,logHelpAction:o}=se.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:u.composeEventHandlers(i,()=>{r(),o()}),...s};return d==="open_link"?n.jsx(us,{href:e.action.url,...c}):n.jsx(hs,{...c})},Cs=a.ikp(T.Trigger,{_id:"aiChatHelpActions__Trigger"}),_i=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig();return n.jsx(G,{action:"help",...t,asChild:!0,children:n.jsx(Cs,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),ps=a.ikp(T.Content,{_id:"aiChatHelpActions__Menu"}),Fi=t=>n.jsx(ps,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),Ei=a.ikp(T.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),ki=t=>{const{action:e,onClick:i,...s}=t,{handleAction:r,logHelpAction:o}=se.useChatAction(e),{setOpen:d}=ie.useHelpMenu(),c=()=>{r({onOpenForm:()=>d(!1)}),o()},m=e.action.type,h=a.ikp(m==="open_link"?"a":"button",{_id:"aiChatHelpActions__MenuItem",children:e.name,"aria-label":e.name,"data-name":e.name,"data-type":e.action.type,...m==="open_link"&&{href:e.action.url,target:"_blank",rel:"noopener"},onClick:u.composeEventHandlers(i,c)});return n.jsx(h,{...s})},vs=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Ii=t=>{const{action:e,...i}=t;return e.icon?n.jsx(vs,{iconSettings:e.icon,...i}):null},bs=a.ikp(A.Root,{_id:"aiChatFeedbackModal"}),Mi=t=>{const{onOpenChange:e,...i}=t,{currentFeedback:s,setCurrentFeedback:r}=ne.useMessageFeedback();return n.jsx(bs,{open:s!==null,onOpenChange:u.composeEventHandlers(e,()=>r(null)),...i})},Si=a.ikp(A.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),xi=a.ikp(A.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Bi=a.ikp(A.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),fi=a.ikp(A.Close,{_id:"aiChatFeedbackModal__Close",children:n.jsx(F.CustomIcon,{iconKey:"close"})}),Ti=a.ikp("div",{_id:"aiChatFeedbackModal__Body"}),gs=a.ikp("form",{_id:"aiChatFeedbackForm"}),ji=t=>{const{onSubmit:e,...i}=t,{submitNegativeFeedback:s,currentFeedback:r,setCurrentFeedback:o}=ne.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,h=new FormData(m),p=Object.fromEntries(h.entries());r&&(s(r,p),o(null))};return n.jsx(gs,{onSubmit:u.composeEventHandlers(e,d),...i})},Ps=a.ikp("div",{_id:"aiChatFeedbackItem"}),yi=t=>{const{name:e,...i}=t;return n.jsx(K.FeedbackItemProvider,{name:e,children:n.jsx(Ps,{...i})})},As=a.ikp(z.Root,{_id:"aiChatFeedbackItem__Checkbox"}),Hi=t=>{const{name:e,focusItem:i}=K.useFeedbackItem(),{onCheckedChange:s,...r}=t,o=d=>{d&&i?.current?.focus()};return n.jsx(As,{id:`feedback-${e}`,name:e,onCheckedChange:u.composeEventHandlers(s,o),...r})},wi=a.ikp(z.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:n.jsx(be.CheckboxIcon,{})}),_s=a.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Li=t=>{const{name:e}=K.useFeedbackItem(),i={unrelated_response:"Didn't answer my question",inaccurate_statement:"Inaccurate statement",inaccurate_code_snippet:"Inaccurate code snippet",irrelevant_citations:"Irrelevant citations"};return n.jsx(_s,{htmlFor:`feedback-${e}`,children:i[e],...t})},Fs=a.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),Di=t=>{const{name:e,focusItem:i}=K.useFeedbackItem();return n.jsx(Fs,{ref:i,name:`${e}:description`,...t})},Oi=a.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),Es=a.ikp("div",{_id:"aiChatForm__Wrapper"}),qi=t=>{const{form:e}=_.useChatForm();return e?n.jsx(Es,{...t}):null},ks=a.ikp("form",{_id:"aiChatForm"}),Ri=t=>{const{onSubmit:e,...i}=t,{handleSubmit:s,isSuccess:r}=_.useChatForm();return r?null:n.jsx(ks,{onSubmit:u.composeEventHandlers(e,s),...i})},Is=a.ikp("button",{_id:"aiChatForm__Close",children:n.jsx(F.CustomIcon,{iconKey:"close"})}),Wi=t=>{const{onClick:e,...i}=t,{closeForm:s}=_.useChatForm();return n.jsx(Is,{onClick:u.composeEventHandlers(e,s),...i})},Ni=a.ikp("div",{_id:"aiChatForm__Header"}),Ms=a.ikp("h2",{_id:"aiChatForm__Heading"}),Qi=t=>{const{form:e}=_.useChatForm();return e?.heading?n.jsx(Ms,{children:e.heading,...t}):null},Ss=a.ikp(V.Markdown,{_id:"aiChatForm__Description"}),$i=t=>{const{form:e}=_.useChatForm();return e?.description?n.jsx(Ss,{children:e.description,...t}):null},xs=a.ikp("div",{_id:"aiChatForm__Content"}),Vi=t=>{const{children:e,...i}=t,{fields:s=[]}=_.useChatForm();return n.jsx(xs,{children:l.maybeRender(e,s),...i})},Bs=a.ikp("div",{_id:"aiChatForm__Field"}),Ui=t=>{const{field:e,autoFocus:i,...s}=t,{control:r,errors:o}=_.useChatForm();return n.jsx(Ba.Controller,{name:e.name,control:r,rules:{required:e.isRequired?`${e.label} is required.`:void 0},render:({field:d})=>{const c=d.value!==void 0||e.inputType==="file";return n.jsx(f.FormFieldProvider,{"data-invalid":l.dataAttr(!!o[e.name]),field:e,fieldProps:d,autoFocus:i,children:c&&n.jsx(Bs,{"data-input-type":e.inputType,"data-hidden":l.dataAttr(e.isHidden),...s})})}})},fs=a.ikp("label",{_id:"aiChatForm__FieldLabel"}),Ki=t=>{const{field:e}=f.useFormField();return n.jsx(fs,{"data-required":l.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},Ts=a.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),Y=t=>{const{field:e,error:i,fieldProps:{onChange:s,onBlur:r,...o},autoFocus:d}=f.useFormField(),{onChange:c,onBlur:m,...h}=t;return n.jsx(Ts,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":l.dataAttr(!!i),onChange:u.composeEventHandlers(c,s),onBlur:u.composeEventHandlers(m,r),...o,...h})},zi=a.ikp(Y,{_id:"aiChatForm__FieldEmail",type:"email"}),js=a.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Gi=t=>{const{field:e,error:i,fieldProps:{value:s,onChange:r,onBlur:o,...d},autoFocus:c}=f.useFormField(),{onChange:m,onBlur:h,...p}=t,b=k=>{const y=k.target.files;r(y)};return n.jsx(js,{id:e.name,autoFocus:c,"data-value":s,"data-invalid":l.dataAttr(!!i),...p,...d,onChange:u.composeEventHandlers(m,b),onBlur:u.composeEventHandlers(h,o)})},Yi=a.ikp(Y,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:n.jsx(ae,{maxRows:8})}),ys=a.ikp(z.Root,{_id:"aiChatForm__FieldCheckbox"}),Ji=t=>{const{field:e,error:i,fieldProps:s,autoFocus:r}=f.useFormField(),{onCheckedChange:o,...d}=t;return n.jsx(ys,{id:e.name,name:e.name,autoFocus:r,"data-invalid":l.dataAttr(!!i),checked:s.value,onCheckedChange:u.composeEventHandlers(o,s.onChange),...d})},Xi=a.ikp(z.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:n.jsx(be.CheckboxIcon,{})}),Hs=a.ikp(I.Root,{_id:"aiChatForm__FieldSelect"}),Zi=t=>{const{field:e,error:i,fieldProps:s}=f.useFormField(),{onValueChange:r,...o}=t;return n.jsx(Hs,{name:e.name,"data-invalid":l.dataAttr(!!i),value:s.value,onValueChange:u.composeEventHandlers(r,s.onChange),...o})},ea=a.ikp(I.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),ws=a.ikp(I.Value,{_id:"aiChatForm__FieldSelect__Value"}),ta=t=>{const{field:e}=f.useFormField();return n.jsx(ws,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},ia=a.ikp(I.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:n.jsx(x.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),aa=a.ikp(I.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),na=a.ikp(I.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),sa=a.ikp(I.Item,{_id:"aiChatForm__FieldSelect__Item"}),ra=a.ikp(I.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),oa=a.ikp(I.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:n.jsx(x.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),Ls=a.ikp("span",{_id:"aiChatForm__FieldError"}),da=t=>{const{error:e}=f.useFormField();return e?n.jsx(Ls,{children:e.message?.toString(),...t}):null},Ds=a.ikp("span",{_id:"aiChatForm__Error"}),ca=t=>{const{formError:e}=_.useChatForm();return e?n.jsx(Ds,{children:e.message,...t}):null},ma=a.ikp("div",{_id:"aiChatForm__Footer"}),Os=a.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel",type:"button"}),la=t=>{const{onClick:e,...i}=t,{closeForm:s}=_.useChatForm();return n.jsx(Os,{onClick:u.composeEventHandlers(e,s),...i})},qs=a.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),ha=t=>{const{onClick:e,...i}=t,{isSubmitting:s,form:r}=_.useChatForm(),o=r?.buttons.submit.label||"Submit";return n.jsx(qs,{disabled:s,...i,children:o})},Rs=a.ikp("div",{_id:"aiChatForm__Success"}),ua=t=>{const{isSuccess:e}=_.useChatForm();return e?n.jsx(Rs,{...t}):null},Ws=a.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),Ca=t=>{const{form:e}=_.useChatForm();return n.jsx(Ws,{children:e?.successView?.heading,...t})},Ns=a.ikp(V.Markdown,{_id:"aiChatForm__SuccessMessage"}),pa=t=>{const{form:e}=_.useChatForm();return n.jsx(Ns,{children:e?.successView?.message,...t})},Qs=a.ikp("button",{_id:"aiChatForm__SuccessButton"}),va=t=>{const{onClick:e,...i}=t,{form:s,closeForm:r}=_.useChatForm(),o=s?.successView?.doneButton;if(!o)return null;const d=o.icon&&n.jsx(x.BuiltInIconRenderer,{iconSettings:o.icon}),c=o.label;return n.jsx(Qs,{onClick:u.composeEventHandlers(e,r),children:n.jsxs(n.Fragment,{children:[d,c]}),...i})};exports.Provider=v.ChatProvider;exports.ActionBar=hi;exports.Actions=ui;exports.AttachmentsBar=wt;exports.AttachmentsBarActions=Wt;exports.AttachmentsBarAttachment=Dt;exports.AttachmentsBarAttachmentDelete=Rt;exports.AttachmentsBarAttachmentIcon=Ot;exports.AttachmentsBarAttachmentTitle=qt;exports.AttachmentsBarForm=ii;exports.AttachmentsBarFormContent=oi;exports.AttachmentsBarFormContentError=mi;exports.AttachmentsBarFormContentInput=ci;exports.AttachmentsBarFormContentLabel=di;exports.AttachmentsBarFormSubmitButton=li;exports.AttachmentsBarFormTitle=ai;exports.AttachmentsBarFormTitleError=ri;exports.AttachmentsBarFormTitleInput=si;exports.AttachmentsBarFormTitleLabel=ni;exports.AttachmentsBarInfoTip=Nt;exports.AttachmentsBarInfoTipArrow=me;exports.AttachmentsBarInfoTipIcon=Qt;exports.AttachmentsBarInfoTipText=$t;exports.AttachmentsBarInput=Ut;exports.AttachmentsBarInputs=Vt;exports.AttachmentsBarList=Lt;exports.AttachmentsBarModal=Kt;exports.AttachmentsBarModalBody=ti;exports.AttachmentsBarModalClose=ei;exports.AttachmentsBarModalContent=Gt;exports.AttachmentsBarModalDescription=Xt;exports.AttachmentsBarModalHeader=Yt;exports.AttachmentsBarModalHeading=Jt;exports.AttachmentsBarModalHelp=Zt;exports.AttachmentsBarModalOverlay=zt;exports.ChatAction=G;exports.ChatActionFeedback=gi;exports.ChatActionLabel=le;exports.ChatHelpAction=Ai;exports.Content=ke;exports.ContentScrollArea=Ie;exports.ContentScrollAreaCorner=Be;exports.ContentScrollAreaScrollbar=Se;exports.ContentScrollAreaThumb=xe;exports.ContentScrollAreaViewport=Me;exports.ConversationLoading=Pe;exports.Disclaimer=Te;exports.DisclaimerArrow=Le;exports.DisclaimerContent=He;exports.DisclaimerLabel=je;exports.DisclaimerText=we;exports.DisclaimerTrigger=ye;exports.EmbeddedChatPrimitiveActionBar=hi;exports.EmbeddedChatPrimitiveActions=ui;exports.EmbeddedChatPrimitiveAttachmentsBar=wt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=qt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=ii;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=oi;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=mi;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=ci;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=di;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=li;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=ai;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=si;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=ni;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Nt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=me;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=$t;exports.EmbeddedChatPrimitiveAttachmentsBarInput=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarList=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=ti;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=ei;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Gt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=zt;exports.EmbeddedChatPrimitiveChatAction=G;exports.EmbeddedChatPrimitiveChatActionFeedback=gi;exports.EmbeddedChatPrimitiveChatActionLabel=le;exports.EmbeddedChatPrimitiveChatHelpAction=Ai;exports.EmbeddedChatPrimitiveContent=ke;exports.EmbeddedChatPrimitiveContentScrollArea=Ie;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Be;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Se;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=xe;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=Me;exports.EmbeddedChatPrimitiveConversationLoading=Pe;exports.EmbeddedChatPrimitiveDisclaimer=Te;exports.EmbeddedChatPrimitiveDisclaimerArrow=Le;exports.EmbeddedChatPrimitiveDisclaimerContent=He;exports.EmbeddedChatPrimitiveDisclaimerLabel=je;exports.EmbeddedChatPrimitiveDisclaimerText=we;exports.EmbeddedChatPrimitiveDisclaimerTrigger=ye;exports.EmbeddedChatPrimitiveExampleQuestion=Re;exports.EmbeddedChatPrimitiveExampleQuestionButton=We;exports.EmbeddedChatPrimitiveExampleQuestions=De;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=Oe;exports.EmbeddedChatPrimitiveExampleQuestionsList=qe;exports.EmbeddedChatPrimitiveFeedbackForm=ji;exports.EmbeddedChatPrimitiveFeedbackItem=yi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=Hi;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=wi;exports.EmbeddedChatPrimitiveFeedbackItemDescription=Di;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Li;exports.EmbeddedChatPrimitiveFeedbackModal=Mi;exports.EmbeddedChatPrimitiveFeedbackModalBody=Ti;exports.EmbeddedChatPrimitiveFeedbackModalClose=fi;exports.EmbeddedChatPrimitiveFeedbackModalContent=xi;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Bi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=Si;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Oi;exports.EmbeddedChatPrimitiveFooter=Bt;exports.EmbeddedChatPrimitiveForm=Ri;exports.EmbeddedChatPrimitiveFormCancel=la;exports.EmbeddedChatPrimitiveFormClose=Wi;exports.EmbeddedChatPrimitiveFormContent=Vi;exports.EmbeddedChatPrimitiveFormDescription=$i;exports.EmbeddedChatPrimitiveFormError=ca;exports.EmbeddedChatPrimitiveFormField=Ui;exports.EmbeddedChatPrimitiveFormFieldCheckbox=Ji;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Xi;exports.EmbeddedChatPrimitiveFormFieldEmail=zi;exports.EmbeddedChatPrimitiveFormFieldError=da;exports.EmbeddedChatPrimitiveFormFieldFile=Gi;exports.EmbeddedChatPrimitiveFormFieldLabel=Ki;exports.EmbeddedChatPrimitiveFormFieldSelect=Zi;exports.EmbeddedChatPrimitiveFormFieldSelectContent=aa;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=ia;exports.EmbeddedChatPrimitiveFormFieldSelectItem=sa;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=oa;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=ra;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=ea;exports.EmbeddedChatPrimitiveFormFieldSelectValue=ta;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=na;exports.EmbeddedChatPrimitiveFormFieldText=Y;exports.EmbeddedChatPrimitiveFormFieldTextArea=Yi;exports.EmbeddedChatPrimitiveFormFooter=ma;exports.EmbeddedChatPrimitiveFormHeader=Ni;exports.EmbeddedChatPrimitiveFormHeading=Qi;exports.EmbeddedChatPrimitiveFormSubmit=ha;exports.EmbeddedChatPrimitiveFormSuccess=ua;exports.EmbeddedChatPrimitiveFormSuccessButton=va;exports.EmbeddedChatPrimitiveFormSuccessHeading=Ca;exports.EmbeddedChatPrimitiveFormSuccessMessage=pa;exports.EmbeddedChatPrimitiveFormWrapper=qi;exports.EmbeddedChatPrimitiveHeaderToolbar=_e;exports.EmbeddedChatPrimitiveHelpActions=Pi;exports.EmbeddedChatPrimitiveHelpActionsMenu=Fi;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=Ei;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=ki;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Ii;exports.EmbeddedChatPrimitiveHelpActionsTrigger=_i;exports.EmbeddedChatPrimitiveInput=jt;exports.EmbeddedChatPrimitiveInputFieldset=ft;exports.EmbeddedChatPrimitiveInputGroup=Tt;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Ue;exports.EmbeddedChatPrimitiveMessage=ut;exports.EmbeddedChatPrimitiveMessageAction=bt;exports.EmbeddedChatPrimitiveMessageAttachments=it;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=st;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsList=at;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=ot;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=ht;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=lt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=ct;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=mt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=dt;exports.EmbeddedChatPrimitiveMessageAvatar=Ge;exports.EmbeddedChatPrimitiveMessageAvatarContent=Ye;exports.EmbeddedChatPrimitiveMessageAvatarFallback=Je;exports.EmbeddedChatPrimitiveMessageAvatarImage=Xe;exports.EmbeddedChatPrimitiveMessageContent=tt;exports.EmbeddedChatPrimitiveMessageContentWrapper=et;exports.EmbeddedChatPrimitiveMessageHeader=Ke;exports.EmbeddedChatPrimitiveMessageLoading=ze;exports.EmbeddedChatPrimitiveMessageName=Ze;exports.EmbeddedChatPrimitiveMessageSourceItem=_t;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=Ft;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=Mt;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=St;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=Et;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=xt;exports.EmbeddedChatPrimitiveMessageSourceItemTag=It;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=kt;exports.EmbeddedChatPrimitiveMessageSources=gt;exports.EmbeddedChatPrimitiveMessageSourcesHeader=Pt;exports.EmbeddedChatPrimitiveMessageSourcesList=At;exports.EmbeddedChatPrimitiveMessageToolAction=vt;exports.EmbeddedChatPrimitiveMessageToolActions=pt;exports.EmbeddedChatPrimitiveMessageToolbar=Ct;exports.EmbeddedChatPrimitiveMessageWrapper=ce;exports.EmbeddedChatPrimitiveMessages=fe;exports.EmbeddedChatPrimitiveRoot=Ae;exports.EmbeddedChatPrimitiveSendButton=yt;exports.EmbeddedChatPrimitiveSendButtonIcon=Ht;exports.EmbeddedChatPrimitiveTaglineBrandName=bi;exports.EmbeddedChatPrimitiveTaglineContainer=Ci;exports.EmbeddedChatPrimitiveTaglineLogo=vi;exports.EmbeddedChatPrimitiveTaglineText=pi;exports.EmbeddedChatPrimitiveToolbarHeader=Ee;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=Fe;exports.EmbeddedChatPrimitiveWorkflow=Ve;exports.EmbeddedChatPrimitiveWorkflows=Ne;exports.EmbeddedChatPrimitiveWorkflowsLabel=Qe;exports.EmbeddedChatPrimitiveWorkflowsList=$e;exports.EmbeddedChatPrimitiveWrapper=ge;exports.ExampleQuestion=Re;exports.ExampleQuestionButton=We;exports.ExampleQuestions=De;exports.ExampleQuestionsLabel=Oe;exports.ExampleQuestionsList=qe;exports.FeedbackForm=ji;exports.FeedbackItem=yi;exports.FeedbackItemCheckbox=Hi;exports.FeedbackItemCheckboxIndicator=wi;exports.FeedbackItemDescription=Di;exports.FeedbackItemLabel=Li;exports.FeedbackModal=Mi;exports.FeedbackModalBody=Ti;exports.FeedbackModalClose=fi;exports.FeedbackModalContent=xi;exports.FeedbackModalHeader=Bi;exports.FeedbackModalOverlay=Si;exports.FeedbackSubmitButton=Oi;exports.Footer=Bt;exports.Form=Ri;exports.FormCancel=la;exports.FormClose=Wi;exports.FormContent=Vi;exports.FormDescription=$i;exports.FormError=ca;exports.FormField=Ui;exports.FormFieldCheckbox=Ji;exports.FormFieldCheckboxIndicator=Xi;exports.FormFieldEmail=zi;exports.FormFieldError=da;exports.FormFieldFile=Gi;exports.FormFieldLabel=Ki;exports.FormFieldSelect=Zi;exports.FormFieldSelectContent=aa;exports.FormFieldSelectIcon=ia;exports.FormFieldSelectItem=sa;exports.FormFieldSelectItemIndicator=oa;exports.FormFieldSelectItemText=ra;exports.FormFieldSelectTrigger=ea;exports.FormFieldSelectValue=ta;exports.FormFieldSelectViewport=na;exports.FormFieldText=Y;exports.FormFieldTextArea=Yi;exports.FormFooter=ma;exports.FormHeader=Ni;exports.FormHeading=Qi;exports.FormSubmit=ha;exports.FormSuccess=ua;exports.FormSuccessButton=va;exports.FormSuccessHeading=Ca;exports.FormSuccessMessage=pa;exports.FormWrapper=qi;exports.Header=Na;exports.HeaderToolbar=_e;exports.HeaderToolbarWrapper=Fe;exports.HelpActions=Pi;exports.HelpActionsMenu=Fi;exports.HelpActionsMenuArrow=Ei;exports.HelpActionsMenuItem=ki;exports.HelpActionsMenuItemIcon=Ii;exports.HelpActionsTrigger=_i;exports.Input=jt;exports.InputFieldset=ft;exports.InputGroup=Tt;exports.IntroMessageWrapper=Ue;exports.Message=ut;exports.MessageAction=bt;exports.MessageAttachments=it;exports.MessageAttachmentsItem=nt;exports.MessageAttachmentsItemIcon=st;exports.MessageAttachmentsItemTitle=rt;exports.MessageAttachmentsList=at;exports.MessageAttachmentsPreview=ot;exports.MessageAttachmentsPreviewBody=ht;exports.MessageAttachmentsPreviewClose=lt;exports.MessageAttachmentsPreviewContent=ct;exports.MessageAttachmentsPreviewHeader=mt;exports.MessageAttachmentsPreviewOverlay=dt;exports.MessageAvatar=Ge;exports.MessageAvatarContent=Ye;exports.MessageAvatarFallback=Je;exports.MessageAvatarImage=Xe;exports.MessageContent=tt;exports.MessageContentWrapper=et;exports.MessageHeader=Ke;exports.MessageLoading=ze;exports.MessageName=Ze;exports.MessageSourceItem=_t;exports.MessageSourceItemBreadcrumbIcon=Hn;exports.MessageSourceItemBreadcrumbs=Ft;exports.MessageSourceItemDescription=Mt;exports.MessageSourceItemDescriptionPart=St;exports.MessageSourceItemIcon=Et;exports.MessageSourceItemIndicator=xt;exports.MessageSourceItemTag=It;exports.MessageSourceItemTitle=kt;exports.MessageSources=gt;exports.MessageSourcesHeader=Pt;exports.MessageSourcesList=At;exports.MessageToolAction=vt;exports.MessageToolActions=pt;exports.MessageToolbar=Ct;exports.MessageWrapper=ce;exports.Messages=fe;exports.Root=Ae;exports.SendButton=yt;exports.SendButtonIcon=Ht;exports.TaglineBrandName=bi;exports.TaglineContainer=Ci;exports.TaglineLogo=vi;exports.TaglineText=pi;exports.ToolbarHeader=Ee;exports.Workflow=Ve;exports.Workflows=Ne;exports.WorkflowsLabel=Qe;exports.WorkflowsList=$e;exports.Wrapper=ge;
|
|
17
|
+
`);J($)},share:async()=>{const $={visibility:"public",tags:[],userProperties:{},messages:C.messages.map(S=>({...S,createdAt:void 0,updatedAt:void 0,id:Date.now().toString()+S.id,conversationId:void 0}))},{apiKey:H,analyticsApiBaseUrl:D}=k,M=await Ha.logConversation("",$,H,D);if(M){const V=`${b.shareChatUrlBasePath}?${L.SHARE_QUERY_PARAM}=${M?.id}`;X(V),y({eventName:"chat_share_button_clicked",properties:{sharedConversationId:M?.id,originalConversationId:C.id,sharedChatUrl:V,conversation:M}})}},clear:o,stop:d},Ce={copy:N,share:Q};return n.jsx(j.Tooltip,{delayDuration:0,open:Ce[e],children:n.jsx(ds,{"data-type":e,"data-copied":h.dataAttr(N||Q),className:`${s} ${e}`,children:n.jsx(le,{action:e}),onClick:u.composeEventHandlers(i,ee[e]),...r})})},cs=a.ikp("span",{_id:"aiChat__ChatActionLabel"}),le=t=>{const{action:e,...i}=t,{aiChatSettings:s}=p.useInkeepConfig(),r=s.toolbarButtonLabels??{},o={help:r.getHelp??"Get Help",copy:r.copyChat??"Copy",share:r.share??"Share",clear:r.clear??"Clear",stop:r.stop??"Stop"};return n.jsx(cs,{children:o[e],...i})},ms=a.ikp(j.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),gi=t=>{const{action:e,children:i,...s}=t,r={copy:"Copied!",share:"Link copied!"};return n.jsxs(ms,{sideOffset:5,...s,children:[n.jsx(j.Arrow,{}),i||r[e]]})},ls=a.ikp(T.Root,{_id:"aiChatHelpActions"}),Pi=t=>{const{children:e,...i}=t,{aiChatSettings:s}=p.useInkeepConfig(),{getHelpOptions:r}=s;if(!r||(r??[]).length===0)return null;const{_pinned:o,_unpinned:d}=r.reduce((C,b)=>{const k=b.isPinnedToToolbar?"_pinned":"_unpinned";return{...C,[k]:[...C[k],b]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...o,d[0]]:o,m=d.length===1?[]:d,l=ie.useHelpMenuState();return n.jsx(ie.HelpMenuProvider,{value:l,children:n.jsx(ls,{open:l.open,onOpenChange:l.setOpen,children:h.maybeRender(e,{pinned:c,unpinned:m}),...i})})},hs=a.ikp(G,{_id:"aiChatHelpAction",action:"help"}),us=a.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),Ai=t=>{const{action:e,onClick:i,...s}=t,{handleAction:r,logHelpAction:o}=se.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:u.composeEventHandlers(i,()=>{r(),o()}),...s};return d==="open_link"?n.jsx(us,{href:e.action.url,...c}):n.jsx(hs,{...c})},Cs=a.ikp(T.Trigger,{_id:"aiChatHelpActions__Trigger"}),_i=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig();return n.jsx(G,{action:"help",...t,asChild:!0,children:n.jsx(Cs,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),ps=a.ikp(T.Content,{_id:"aiChatHelpActions__Menu"}),Ei=t=>n.jsx(ps,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),Fi=a.ikp(T.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),ki=t=>{const{action:e,onClick:i,...s}=t,{handleAction:r,logHelpAction:o}=se.useChatAction(e),{setOpen:d}=ie.useHelpMenu(),c=()=>{r({onOpenForm:()=>d(!1)}),o()},m=e.action.type,l=a.ikp(m==="open_link"?"a":"button",{_id:"aiChatHelpActions__MenuItem",children:e.name,"aria-label":e.name,"data-name":e.name,"data-type":e.action.type,...m==="open_link"&&{href:e.action.url,target:"_blank",rel:"noopener"},onClick:u.composeEventHandlers(i,c)});return n.jsx(l,{...s})},vs=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Ii=t=>{const{action:e,...i}=t;return e.icon?n.jsx(vs,{iconSettings:e.icon,...i}):null},bs=a.ikp(A.Root,{_id:"aiChatFeedbackModal"}),Mi=t=>{const{onOpenChange:e,...i}=t,{currentFeedback:s,setCurrentFeedback:r}=ne.useMessageFeedback();return n.jsx(bs,{open:s!==null,onOpenChange:u.composeEventHandlers(e,()=>r(null)),...i})},Si=a.ikp(A.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),xi=a.ikp(A.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Bi=a.ikp(A.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),fi=a.ikp(A.Close,{_id:"aiChatFeedbackModal__Close",children:n.jsx(E.CustomIcon,{iconKey:"close"})}),Ti=a.ikp("div",{_id:"aiChatFeedbackModal__Body"}),gs=a.ikp("form",{_id:"aiChatFeedbackForm"}),ji=t=>{const{onSubmit:e,...i}=t,{submitNegativeFeedback:s,currentFeedback:r,setCurrentFeedback:o}=ne.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,l=new FormData(m),C=Object.fromEntries(l.entries());r&&(s(r,C),o(null))};return n.jsx(gs,{onSubmit:u.composeEventHandlers(e,d),...i})},Ps=a.ikp("div",{_id:"aiChatFeedbackItem"}),yi=t=>{const{name:e,...i}=t;return n.jsx(K.FeedbackItemProvider,{name:e,children:n.jsx(Ps,{...i})})},As=a.ikp(z.Root,{_id:"aiChatFeedbackItem__Checkbox"}),Hi=t=>{const{name:e,focusItem:i}=K.useFeedbackItem(),{onCheckedChange:s,...r}=t,o=d=>{d&&i?.current?.focus()};return n.jsx(As,{id:`feedback-${e}`,name:e,onCheckedChange:u.composeEventHandlers(s,o),...r})},wi=a.ikp(z.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:n.jsx(be.CheckboxIcon,{})}),_s=a.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Li=t=>{const{name:e}=K.useFeedbackItem(),i={unrelated_response:"Didn't answer my question",inaccurate_statement:"Inaccurate statement",inaccurate_code_snippet:"Inaccurate code snippet",irrelevant_citations:"Irrelevant citations"};return n.jsx(_s,{htmlFor:`feedback-${e}`,children:i[e],...t})},Es=a.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),Di=t=>{const{name:e,focusItem:i}=K.useFeedbackItem();return n.jsx(Es,{ref:i,name:`${e}:description`,...t})},Oi=a.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),Fs=a.ikp("div",{_id:"aiChatForm__Wrapper"}),qi=t=>{const{form:e}=_.useChatForm();return e?n.jsx(Fs,{...t}):null},ks=a.ikp("form",{_id:"aiChatForm"}),Ri=t=>{const{onSubmit:e,...i}=t,{handleSubmit:s,isSuccess:r}=_.useChatForm();return r?null:n.jsx(ks,{onSubmit:u.composeEventHandlers(e,s),...i})},Is=a.ikp("button",{_id:"aiChatForm__Close",children:n.jsx(E.CustomIcon,{iconKey:"close"})}),Wi=t=>{const{onClick:e,...i}=t,{closeForm:s}=_.useChatForm();return n.jsx(Is,{onClick:u.composeEventHandlers(e,s),...i})},Ni=a.ikp("div",{_id:"aiChatForm__Header"}),Ms=a.ikp("h2",{_id:"aiChatForm__Heading"}),Qi=t=>{const{form:e}=_.useChatForm();return e?.heading?n.jsx(Ms,{children:e.heading,...t}):null},Ss=a.ikp(U.Markdown,{_id:"aiChatForm__Description"}),$i=t=>{const{form:e}=_.useChatForm();return e?.description?n.jsx(Ss,{children:e.description,...t}):null},xs=a.ikp("div",{_id:"aiChatForm__Content"}),Vi=t=>{const{children:e,...i}=t,{fields:s=[]}=_.useChatForm();return n.jsx(xs,{children:h.maybeRender(e,s),...i})},Bs=a.ikp("div",{_id:"aiChatForm__Field"}),Ui=t=>{const{field:e,autoFocus:i,...s}=t,{control:r,errors:o}=_.useChatForm();return n.jsx(Ba.Controller,{name:e.name,control:r,rules:{required:e.isRequired?`${e.label} is required.`:void 0},render:({field:d})=>{const c=d.value!==void 0||e.inputType==="file";return n.jsx(f.FormFieldProvider,{"data-invalid":h.dataAttr(!!o[e.name]),field:e,fieldProps:d,autoFocus:i,children:c&&n.jsx(Bs,{"data-input-type":e.inputType,"data-hidden":h.dataAttr(e.isHidden),...s})})}})},fs=a.ikp("label",{_id:"aiChatForm__FieldLabel"}),Ki=t=>{const{field:e}=f.useFormField();return n.jsx(fs,{"data-required":h.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},Ts=a.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),Y=t=>{const{field:e,error:i,fieldProps:{onChange:s,onBlur:r,...o},autoFocus:d}=f.useFormField(),{onChange:c,onBlur:m,...l}=t;return n.jsx(Ts,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":h.dataAttr(!!i),onChange:u.composeEventHandlers(c,s),onBlur:u.composeEventHandlers(m,r),...o,...l})},zi=a.ikp(Y,{_id:"aiChatForm__FieldEmail",type:"email"}),js=a.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Gi=t=>{const{field:e,error:i,fieldProps:{value:s,onChange:r,onBlur:o,...d},autoFocus:c}=f.useFormField(),{onChange:m,onBlur:l,...C}=t,b=k=>{const y=k.target.files;r(y)};return n.jsx(js,{id:e.name,autoFocus:c,"data-value":s,"data-invalid":h.dataAttr(!!i),...C,...d,onChange:u.composeEventHandlers(m,b),onBlur:u.composeEventHandlers(l,o)})},Yi=a.ikp(Y,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:n.jsx(ae,{maxRows:8})}),ys=a.ikp(z.Root,{_id:"aiChatForm__FieldCheckbox"}),Ji=t=>{const{field:e,error:i,fieldProps:s,autoFocus:r}=f.useFormField(),{onCheckedChange:o,...d}=t;return n.jsx(ys,{id:e.name,name:e.name,autoFocus:r,"data-invalid":h.dataAttr(!!i),checked:s.value,onCheckedChange:u.composeEventHandlers(o,s.onChange),...d})},Xi=a.ikp(z.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:n.jsx(be.CheckboxIcon,{})}),Hs=a.ikp(I.Root,{_id:"aiChatForm__FieldSelect"}),Zi=t=>{const{field:e,error:i,fieldProps:s}=f.useFormField(),{onValueChange:r,...o}=t;return n.jsx(Hs,{name:e.name,"data-invalid":h.dataAttr(!!i),value:s.value,onValueChange:u.composeEventHandlers(r,s.onChange),...o})},ea=a.ikp(I.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),ws=a.ikp(I.Value,{_id:"aiChatForm__FieldSelect__Value"}),ta=t=>{const{field:e}=f.useFormField();return n.jsx(ws,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},ia=a.ikp(I.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:n.jsx(x.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),aa=a.ikp(I.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),na=a.ikp(I.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),sa=a.ikp(I.Item,{_id:"aiChatForm__FieldSelect__Item"}),ra=a.ikp(I.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),oa=a.ikp(I.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:n.jsx(x.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),Ls=a.ikp("span",{_id:"aiChatForm__FieldError"}),da=t=>{const{error:e}=f.useFormField();return e?n.jsx(Ls,{children:e.message?.toString(),...t}):null},Ds=a.ikp("span",{_id:"aiChatForm__Error"}),ca=t=>{const{formError:e}=_.useChatForm();return e?n.jsx(Ds,{children:e.message,...t}):null},ma=a.ikp("div",{_id:"aiChatForm__Footer"}),Os=a.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel",type:"button"}),la=t=>{const{onClick:e,...i}=t,{closeForm:s}=_.useChatForm();return n.jsx(Os,{onClick:u.composeEventHandlers(e,s),...i})},qs=a.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),ha=t=>{const{onClick:e,...i}=t,{isSubmitting:s,form:r}=_.useChatForm(),o=r?.buttons.submit.label||"Submit";return n.jsx(qs,{disabled:s,...i,children:o})},Rs=a.ikp("div",{_id:"aiChatForm__Success"}),ua=t=>{const{isSuccess:e}=_.useChatForm();return e?n.jsx(Rs,{...t}):null},Ws=a.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),Ca=t=>{const{form:e}=_.useChatForm();return n.jsx(Ws,{children:e?.successView?.heading,...t})},Ns=a.ikp(U.Markdown,{_id:"aiChatForm__SuccessMessage"}),pa=t=>{const{form:e}=_.useChatForm();return n.jsx(Ns,{children:e?.successView?.message,...t})},Qs=a.ikp("button",{_id:"aiChatForm__SuccessButton"}),va=t=>{const{onClick:e,...i}=t,{form:s,closeForm:r}=_.useChatForm(),o=s?.successView?.doneButton;if(!o)return null;const d=o.icon&&n.jsx(x.BuiltInIconRenderer,{iconSettings:o.icon}),c=o.label;return n.jsx(Qs,{onClick:u.composeEventHandlers(e,r),children:n.jsxs(n.Fragment,{children:[d,c]}),...i})};exports.Provider=v.ChatProvider;exports.ActionBar=hi;exports.Actions=ui;exports.AttachmentsBar=wt;exports.AttachmentsBarActions=Wt;exports.AttachmentsBarAttachment=Dt;exports.AttachmentsBarAttachmentDelete=Rt;exports.AttachmentsBarAttachmentIcon=Ot;exports.AttachmentsBarAttachmentTitle=qt;exports.AttachmentsBarForm=ii;exports.AttachmentsBarFormContent=oi;exports.AttachmentsBarFormContentError=mi;exports.AttachmentsBarFormContentInput=ci;exports.AttachmentsBarFormContentLabel=di;exports.AttachmentsBarFormSubmitButton=li;exports.AttachmentsBarFormTitle=ai;exports.AttachmentsBarFormTitleError=ri;exports.AttachmentsBarFormTitleInput=si;exports.AttachmentsBarFormTitleLabel=ni;exports.AttachmentsBarInfoTip=Nt;exports.AttachmentsBarInfoTipArrow=me;exports.AttachmentsBarInfoTipIcon=Qt;exports.AttachmentsBarInfoTipText=$t;exports.AttachmentsBarInput=Ut;exports.AttachmentsBarInputs=Vt;exports.AttachmentsBarList=Lt;exports.AttachmentsBarModal=Kt;exports.AttachmentsBarModalBody=ti;exports.AttachmentsBarModalClose=ei;exports.AttachmentsBarModalContent=Gt;exports.AttachmentsBarModalDescription=Xt;exports.AttachmentsBarModalHeader=Yt;exports.AttachmentsBarModalHeading=Jt;exports.AttachmentsBarModalHelp=Zt;exports.AttachmentsBarModalOverlay=zt;exports.ChatAction=G;exports.ChatActionFeedback=gi;exports.ChatActionLabel=le;exports.ChatHelpAction=Ai;exports.Content=ke;exports.ContentScrollArea=Ie;exports.ContentScrollAreaCorner=Be;exports.ContentScrollAreaScrollbar=Se;exports.ContentScrollAreaThumb=xe;exports.ContentScrollAreaViewport=Me;exports.ConversationLoading=Pe;exports.Disclaimer=Te;exports.DisclaimerArrow=Le;exports.DisclaimerContent=He;exports.DisclaimerLabel=je;exports.DisclaimerText=we;exports.DisclaimerTrigger=ye;exports.EmbeddedChatPrimitiveActionBar=hi;exports.EmbeddedChatPrimitiveActions=ui;exports.EmbeddedChatPrimitiveAttachmentsBar=wt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=qt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=ii;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=oi;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=mi;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=ci;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=di;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=li;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=ai;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=si;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=ni;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Nt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=me;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=$t;exports.EmbeddedChatPrimitiveAttachmentsBarInput=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarList=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=ti;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=ei;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Gt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=zt;exports.EmbeddedChatPrimitiveChatAction=G;exports.EmbeddedChatPrimitiveChatActionFeedback=gi;exports.EmbeddedChatPrimitiveChatActionLabel=le;exports.EmbeddedChatPrimitiveChatHelpAction=Ai;exports.EmbeddedChatPrimitiveContent=ke;exports.EmbeddedChatPrimitiveContentScrollArea=Ie;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Be;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Se;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=xe;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=Me;exports.EmbeddedChatPrimitiveConversationLoading=Pe;exports.EmbeddedChatPrimitiveDisclaimer=Te;exports.EmbeddedChatPrimitiveDisclaimerArrow=Le;exports.EmbeddedChatPrimitiveDisclaimerContent=He;exports.EmbeddedChatPrimitiveDisclaimerLabel=je;exports.EmbeddedChatPrimitiveDisclaimerText=we;exports.EmbeddedChatPrimitiveDisclaimerTrigger=ye;exports.EmbeddedChatPrimitiveExampleQuestion=Re;exports.EmbeddedChatPrimitiveExampleQuestionButton=We;exports.EmbeddedChatPrimitiveExampleQuestions=De;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=Oe;exports.EmbeddedChatPrimitiveExampleQuestionsList=qe;exports.EmbeddedChatPrimitiveFeedbackForm=ji;exports.EmbeddedChatPrimitiveFeedbackItem=yi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=Hi;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=wi;exports.EmbeddedChatPrimitiveFeedbackItemDescription=Di;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Li;exports.EmbeddedChatPrimitiveFeedbackModal=Mi;exports.EmbeddedChatPrimitiveFeedbackModalBody=Ti;exports.EmbeddedChatPrimitiveFeedbackModalClose=fi;exports.EmbeddedChatPrimitiveFeedbackModalContent=xi;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Bi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=Si;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Oi;exports.EmbeddedChatPrimitiveFooter=Bt;exports.EmbeddedChatPrimitiveForm=Ri;exports.EmbeddedChatPrimitiveFormCancel=la;exports.EmbeddedChatPrimitiveFormClose=Wi;exports.EmbeddedChatPrimitiveFormContent=Vi;exports.EmbeddedChatPrimitiveFormDescription=$i;exports.EmbeddedChatPrimitiveFormError=ca;exports.EmbeddedChatPrimitiveFormField=Ui;exports.EmbeddedChatPrimitiveFormFieldCheckbox=Ji;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Xi;exports.EmbeddedChatPrimitiveFormFieldEmail=zi;exports.EmbeddedChatPrimitiveFormFieldError=da;exports.EmbeddedChatPrimitiveFormFieldFile=Gi;exports.EmbeddedChatPrimitiveFormFieldLabel=Ki;exports.EmbeddedChatPrimitiveFormFieldSelect=Zi;exports.EmbeddedChatPrimitiveFormFieldSelectContent=aa;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=ia;exports.EmbeddedChatPrimitiveFormFieldSelectItem=sa;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=oa;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=ra;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=ea;exports.EmbeddedChatPrimitiveFormFieldSelectValue=ta;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=na;exports.EmbeddedChatPrimitiveFormFieldText=Y;exports.EmbeddedChatPrimitiveFormFieldTextArea=Yi;exports.EmbeddedChatPrimitiveFormFooter=ma;exports.EmbeddedChatPrimitiveFormHeader=Ni;exports.EmbeddedChatPrimitiveFormHeading=Qi;exports.EmbeddedChatPrimitiveFormSubmit=ha;exports.EmbeddedChatPrimitiveFormSuccess=ua;exports.EmbeddedChatPrimitiveFormSuccessButton=va;exports.EmbeddedChatPrimitiveFormSuccessHeading=Ca;exports.EmbeddedChatPrimitiveFormSuccessMessage=pa;exports.EmbeddedChatPrimitiveFormWrapper=qi;exports.EmbeddedChatPrimitiveHeaderToolbar=_e;exports.EmbeddedChatPrimitiveHelpActions=Pi;exports.EmbeddedChatPrimitiveHelpActionsMenu=Ei;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=Fi;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=ki;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Ii;exports.EmbeddedChatPrimitiveHelpActionsTrigger=_i;exports.EmbeddedChatPrimitiveInput=jt;exports.EmbeddedChatPrimitiveInputFieldset=ft;exports.EmbeddedChatPrimitiveInputGroup=Tt;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Ue;exports.EmbeddedChatPrimitiveMessage=ut;exports.EmbeddedChatPrimitiveMessageAction=bt;exports.EmbeddedChatPrimitiveMessageAttachments=it;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=st;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsList=at;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=ot;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=ht;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=lt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=ct;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=mt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=dt;exports.EmbeddedChatPrimitiveMessageAvatar=Ge;exports.EmbeddedChatPrimitiveMessageAvatarContent=Ye;exports.EmbeddedChatPrimitiveMessageAvatarFallback=Je;exports.EmbeddedChatPrimitiveMessageAvatarImage=Xe;exports.EmbeddedChatPrimitiveMessageContent=tt;exports.EmbeddedChatPrimitiveMessageContentWrapper=et;exports.EmbeddedChatPrimitiveMessageHeader=Ke;exports.EmbeddedChatPrimitiveMessageLoading=ze;exports.EmbeddedChatPrimitiveMessageName=Ze;exports.EmbeddedChatPrimitiveMessageSourceItem=_t;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=Et;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=Mt;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=St;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=Ft;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=xt;exports.EmbeddedChatPrimitiveMessageSourceItemTag=It;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=kt;exports.EmbeddedChatPrimitiveMessageSources=gt;exports.EmbeddedChatPrimitiveMessageSourcesHeader=Pt;exports.EmbeddedChatPrimitiveMessageSourcesList=At;exports.EmbeddedChatPrimitiveMessageToolAction=vt;exports.EmbeddedChatPrimitiveMessageToolActions=pt;exports.EmbeddedChatPrimitiveMessageToolbar=Ct;exports.EmbeddedChatPrimitiveMessageWrapper=ce;exports.EmbeddedChatPrimitiveMessages=fe;exports.EmbeddedChatPrimitiveRoot=Ae;exports.EmbeddedChatPrimitiveSendButton=yt;exports.EmbeddedChatPrimitiveSendButtonIcon=Ht;exports.EmbeddedChatPrimitiveTaglineBrandName=bi;exports.EmbeddedChatPrimitiveTaglineContainer=Ci;exports.EmbeddedChatPrimitiveTaglineLogo=vi;exports.EmbeddedChatPrimitiveTaglineText=pi;exports.EmbeddedChatPrimitiveToolbarHeader=Fe;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=Ee;exports.EmbeddedChatPrimitiveWorkflow=Ve;exports.EmbeddedChatPrimitiveWorkflows=Ne;exports.EmbeddedChatPrimitiveWorkflowsLabel=Qe;exports.EmbeddedChatPrimitiveWorkflowsList=$e;exports.EmbeddedChatPrimitiveWrapper=ge;exports.ExampleQuestion=Re;exports.ExampleQuestionButton=We;exports.ExampleQuestions=De;exports.ExampleQuestionsLabel=Oe;exports.ExampleQuestionsList=qe;exports.FeedbackForm=ji;exports.FeedbackItem=yi;exports.FeedbackItemCheckbox=Hi;exports.FeedbackItemCheckboxIndicator=wi;exports.FeedbackItemDescription=Di;exports.FeedbackItemLabel=Li;exports.FeedbackModal=Mi;exports.FeedbackModalBody=Ti;exports.FeedbackModalClose=fi;exports.FeedbackModalContent=xi;exports.FeedbackModalHeader=Bi;exports.FeedbackModalOverlay=Si;exports.FeedbackSubmitButton=Oi;exports.Footer=Bt;exports.Form=Ri;exports.FormCancel=la;exports.FormClose=Wi;exports.FormContent=Vi;exports.FormDescription=$i;exports.FormError=ca;exports.FormField=Ui;exports.FormFieldCheckbox=Ji;exports.FormFieldCheckboxIndicator=Xi;exports.FormFieldEmail=zi;exports.FormFieldError=da;exports.FormFieldFile=Gi;exports.FormFieldLabel=Ki;exports.FormFieldSelect=Zi;exports.FormFieldSelectContent=aa;exports.FormFieldSelectIcon=ia;exports.FormFieldSelectItem=sa;exports.FormFieldSelectItemIndicator=oa;exports.FormFieldSelectItemText=ra;exports.FormFieldSelectTrigger=ea;exports.FormFieldSelectValue=ta;exports.FormFieldSelectViewport=na;exports.FormFieldText=Y;exports.FormFieldTextArea=Yi;exports.FormFooter=ma;exports.FormHeader=Ni;exports.FormHeading=Qi;exports.FormSubmit=ha;exports.FormSuccess=ua;exports.FormSuccessButton=va;exports.FormSuccessHeading=Ca;exports.FormSuccessMessage=pa;exports.FormWrapper=qi;exports.Header=Na;exports.HeaderToolbar=_e;exports.HeaderToolbarWrapper=Ee;exports.HelpActions=Pi;exports.HelpActionsMenu=Ei;exports.HelpActionsMenuArrow=Fi;exports.HelpActionsMenuItem=ki;exports.HelpActionsMenuItemIcon=Ii;exports.HelpActionsTrigger=_i;exports.Input=jt;exports.InputFieldset=ft;exports.InputGroup=Tt;exports.IntroMessageWrapper=Ue;exports.Message=ut;exports.MessageAction=bt;exports.MessageAttachments=it;exports.MessageAttachmentsItem=nt;exports.MessageAttachmentsItemIcon=st;exports.MessageAttachmentsItemTitle=rt;exports.MessageAttachmentsList=at;exports.MessageAttachmentsPreview=ot;exports.MessageAttachmentsPreviewBody=ht;exports.MessageAttachmentsPreviewClose=lt;exports.MessageAttachmentsPreviewContent=ct;exports.MessageAttachmentsPreviewHeader=mt;exports.MessageAttachmentsPreviewOverlay=dt;exports.MessageAvatar=Ge;exports.MessageAvatarContent=Ye;exports.MessageAvatarFallback=Je;exports.MessageAvatarImage=Xe;exports.MessageContent=tt;exports.MessageContentWrapper=et;exports.MessageHeader=Ke;exports.MessageLoading=ze;exports.MessageName=Ze;exports.MessageSourceItem=_t;exports.MessageSourceItemBreadcrumbIcon=Hn;exports.MessageSourceItemBreadcrumbs=Et;exports.MessageSourceItemDescription=Mt;exports.MessageSourceItemDescriptionPart=St;exports.MessageSourceItemIcon=Ft;exports.MessageSourceItemIndicator=xt;exports.MessageSourceItemTag=It;exports.MessageSourceItemTitle=kt;exports.MessageSources=gt;exports.MessageSourcesHeader=Pt;exports.MessageSourcesList=At;exports.MessageToolAction=vt;exports.MessageToolActions=pt;exports.MessageToolbar=Ct;exports.MessageWrapper=ce;exports.Messages=fe;exports.Root=Ae;exports.SendButton=yt;exports.SendButtonIcon=Ht;exports.TaglineBrandName=bi;exports.TaglineContainer=Ci;exports.TaglineLogo=vi;exports.TaglineText=pi;exports.ToolbarHeader=Fe;exports.Workflow=Ve;exports.Workflows=Ne;exports.WorkflowsLabel=Qe;exports.WorkflowsList=$e;exports.Wrapper=ge;
|