@inkeep/agents-ui 0.15.12 → 0.15.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +230 -220
  3. package/dist/primitives/atoms/combobox.cjs +1 -0
  4. package/dist/primitives/atoms/combobox.js +275 -0
  5. package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
  6. package/dist/primitives/atoms/icons/built-in-icons.d.ts +2 -0
  7. package/dist/primitives/atoms/icons/built-in-icons.js +33 -31
  8. package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
  9. package/dist/primitives/atoms/icons/inkeep-default-icons.js +4 -1
  10. package/dist/primitives/components/chat-history/index.cjs +1 -0
  11. package/dist/primitives/components/chat-history/index.d.ts +27 -0
  12. package/dist/primitives/components/chat-history/index.js +105 -0
  13. package/dist/primitives/components/embedded-chat/use-captcha.cjs +1 -0
  14. package/dist/primitives/components/embedded-chat/use-captcha.d.ts +23 -6
  15. package/dist/primitives/components/embedded-chat/use-captcha.js +67 -0
  16. package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +2 -2
  17. package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +12 -3
  18. package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +252 -144
  19. package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
  20. package/dist/primitives/components/embedded-chat/use-stream-processor.d.ts +2 -0
  21. package/dist/primitives/components/embedded-chat/use-stream-processor.js +127 -90
  22. package/dist/primitives/components/embedded-chat.cjs +4 -4
  23. package/dist/primitives/components/embedded-chat.d.ts +26 -2
  24. package/dist/primitives/components/embedded-chat.js +1304 -1149
  25. package/dist/primitives/components/index.cjs +1 -1
  26. package/dist/primitives/components/index.d.ts +1 -0
  27. package/dist/primitives/components/index.js +20 -18
  28. package/dist/primitives/hooks/use-anonymous-session.cjs +1 -0
  29. package/dist/primitives/hooks/use-anonymous-session.d.ts +12 -0
  30. package/dist/primitives/hooks/use-anonymous-session.js +57 -0
  31. package/dist/primitives/hooks/use-conversation-loader.cjs +1 -0
  32. package/dist/primitives/hooks/use-conversation-loader.d.ts +13 -0
  33. package/dist/primitives/hooks/use-conversation-loader.js +36 -0
  34. package/dist/primitives/hooks/use-inkeep-api-client.cjs +1 -0
  35. package/dist/primitives/hooks/use-inkeep-api-client.d.ts +33 -0
  36. package/dist/primitives/hooks/use-inkeep-api-client.js +87 -0
  37. package/dist/primitives/hooks/use-local-storage.cjs +1 -0
  38. package/dist/primitives/hooks/use-local-storage.d.ts +8 -0
  39. package/dist/primitives/hooks/use-local-storage.js +26 -0
  40. package/dist/primitives/hooks/use-simple-scroll.cjs +1 -1
  41. package/dist/primitives/hooks/use-simple-scroll.d.ts +12 -1
  42. package/dist/primitives/hooks/use-simple-scroll.js +45 -12
  43. package/dist/primitives/index.cjs +1 -1
  44. package/dist/primitives/index.js +157 -151
  45. package/dist/primitives/providers/base-events-provider.cjs +1 -1
  46. package/dist/primitives/providers/base-events-provider.js +1 -1
  47. package/dist/primitives/providers/chat-history-provider.cjs +1 -0
  48. package/dist/primitives/providers/chat-history-provider.d.ts +32 -0
  49. package/dist/primitives/providers/chat-history-provider.js +105 -0
  50. package/dist/primitives/providers/index.cjs +1 -1
  51. package/dist/primitives/providers/index.d.ts +1 -0
  52. package/dist/primitives/providers/index.js +55 -52
  53. package/dist/primitives/utils/component-ids.cjs +1 -1
  54. package/dist/primitives/utils/component-ids.d.ts +56 -0
  55. package/dist/primitives/utils/component-ids.js +31 -1
  56. package/dist/primitives/utils/default-settings.cjs +1 -1
  57. package/dist/primitives/utils/default-settings.d.ts +2 -0
  58. package/dist/primitives/utils/default-settings.js +6 -4
  59. package/dist/primitives/utils/form.cjs +1 -1
  60. package/dist/primitives/utils/form.d.ts +1 -1
  61. package/dist/primitives/utils/form.js +3 -1
  62. package/dist/react/chat-button-modal.cjs +1 -0
  63. package/dist/react/chat-button-modal.d.ts +22 -0
  64. package/dist/react/chat-button-modal.js +41 -0
  65. package/dist/react/chat-button.cjs +1 -1
  66. package/dist/react/chat-button.js +42 -38
  67. package/dist/react/embedded-chat.cjs +1 -1
  68. package/dist/react/embedded-chat.js +285 -240
  69. package/dist/react/index.cjs +1 -1
  70. package/dist/react/index.d.ts +1 -0
  71. package/dist/react/index.js +230 -220
  72. package/dist/react/sidebar-chat.cjs +1 -1
  73. package/dist/react/sidebar-chat.js +26 -22
  74. package/dist/styled/components/chat-bubble.cjs +1 -1
  75. package/dist/styled/components/chat-bubble.js +1 -1
  76. package/dist/styled/components/chat-history.cjs +1 -0
  77. package/dist/styled/components/chat-history.d.ts +15 -0
  78. package/dist/styled/components/chat-history.js +197 -0
  79. package/dist/styled/components/data-summary-group.cjs +1 -1
  80. package/dist/styled/components/data-summary-group.js +24 -24
  81. package/dist/styled/components/embedded-chat/session-loading.cjs +1 -0
  82. package/dist/styled/components/embedded-chat/session-loading.d.ts +1 -0
  83. package/dist/styled/components/embedded-chat/session-loading.js +26 -0
  84. package/dist/styled/components/embedded-chat.cjs +1 -1
  85. package/dist/styled/components/embedded-chat.d.ts +22 -1
  86. package/dist/styled/components/embedded-chat.js +735 -565
  87. package/dist/styled/components/embedded-search.cjs +1 -1
  88. package/dist/styled/components/embedded-search.js +1 -1
  89. package/dist/styled/components/index.cjs +1 -1
  90. package/dist/styled/components/index.d.ts +1 -0
  91. package/dist/styled/components/index.js +22 -20
  92. package/dist/styled/components/message.cjs +1 -1
  93. package/dist/styled/components/message.js +191 -183
  94. package/dist/styled/components/sidebar-chat.cjs +1 -1
  95. package/dist/styled/components/sidebar-chat.js +1 -1
  96. package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.cjs +1 -1
  97. package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.js +3 -2
  98. package/dist/styled/components/ui/recipes/combobox.cjs +1 -0
  99. package/dist/styled/components/ui/recipes/combobox.d.ts +4 -0
  100. package/dist/styled/components/ui/recipes/combobox.js +57 -0
  101. package/dist/styled/components/ui/recipes/index.cjs +1 -1
  102. package/dist/styled/components/ui/recipes/index.d.ts +1 -0
  103. package/dist/styled/components/ui/recipes/index.js +29 -27
  104. package/dist/styled/components/ui/recipes/modal.d.ts +1 -1
  105. package/dist/styled/components/ui/recipes/scrollable.d.ts +1 -1
  106. package/dist/styled/components/ui/recipes/select.d.ts +1 -1
  107. package/dist/styled/index.cjs +1 -1
  108. package/dist/styled/index.js +193 -185
  109. package/dist/styled/inkeep.css.cjs +328 -6
  110. package/dist/styled/inkeep.css.js +328 -6
  111. package/dist/types/config/ai.d.ts +17 -1
  112. package/dist/types/config/base.d.ts +21 -0
  113. package/dist/types/config/settings/form.d.ts +9 -1
  114. package/dist/types/icons/built-in.d.ts +1 -1
  115. package/dist/types/icons/custom.d.ts +3 -0
  116. package/package.json +6 -5
@@ -1,122 +1,159 @@
1
1
  "use client";
2
- import { useState as h, useRef as y, useCallback as R, useEffect as w, useMemo as z } from "react";
3
- import { DEFAULT_ERROR_MESSAGE as G } from "./use-inkeep-chat.js";
4
- function K(c, a, C) {
5
- const [p, v] = h([]), [d, D] = h(/* @__PURE__ */ new Map()), [T, M] = h(Date.now()), [P, g] = h(!1), A = y(0), S = y(0), b = y([]), f = y(d);
6
- f.current = d;
7
- const k = R(() => {
8
- const t = [];
9
- let e = "", r = [], i = !1;
10
- c.length > A.current && (M(Date.now()), A.current = c.length), S.current = 0;
11
- const u = /* @__PURE__ */ new Map(), o = (n = !1) => {
12
- if (r.length > 0) {
13
- const s = `group-${S.current++}`, m = f.current.get(s);
14
- m ? u.set(s, {
15
- ...m,
16
- isCompleted: n
17
- }) : u.set(s, {
18
- isCompleted: n
19
- }), t.push({
2
+ import { useState as O, useRef as I, useMemo as M, useEffect as P, useCallback as U } from "react";
3
+ import { DEFAULT_ERROR_MESSAGE as $ } from "./use-inkeep-chat.js";
4
+ function S(a, n) {
5
+ if (n)
6
+ return a.findIndex((d) => d.type === "tool_call" && d.toolCallId === n);
7
+ const m = a.length - 1;
8
+ return m >= 0 && a[m].type === "tool_call" ? m : -1;
9
+ }
10
+ function z(a) {
11
+ const n = a.ctx, d = a.details?.data, h = n?.toolCallId ?? n?.callId ?? a.toolCallId ?? d?.toolCallId;
12
+ return typeof h == "string" ? h : void 0;
13
+ }
14
+ function B(a, n, m) {
15
+ const [d, h] = O(!1), v = I(0), A = I(0), R = I(Date.now()), y = I(/* @__PURE__ */ new Map()), k = I(null), { processedParts: C, summaryTimings: F } = M(() => {
16
+ const r = [];
17
+ let e = "", o = [], w = !1;
18
+ a.length > v.current && (R.current = Date.now(), v.current = a.length), A.current = 0;
19
+ const u = /* @__PURE__ */ new Map(), g = (s = !1) => {
20
+ if (o.length > 0) {
21
+ const t = `group-${A.current++}`, i = y.current.get(t);
22
+ i ? u.set(t, {
23
+ ...i,
24
+ isCompleted: s
25
+ }) : u.set(t, {
26
+ isCompleted: s
27
+ }), r.push({
20
28
  type: "summary-group",
21
- summaries: [...r],
22
- groupKey: s
23
- }), r = [];
29
+ summaries: [...o],
30
+ groupKey: t
31
+ }), o = [];
24
32
  }
25
33
  };
26
- for (const n of c)
27
- if (n.type === "text")
28
- o(!0), e += n.text || "";
29
- else if (n.type === "data-summary")
30
- e.trim() && (t.push({ type: "text", text: e }), e = ""), r.push(n.data);
31
- else if (n.type === "data-operation") {
32
- e.trim() && (t.push({ type: "text", text: e }), e = "");
33
- const s = n.data;
34
- if (s?.type) {
35
- if ((s.type === "tool_call" || s.type === "tool_result") && s.details?.data?.inDelegatedAgent === !1)
34
+ for (const s of a)
35
+ if (s.type === "text")
36
+ g(!0), e += s.text || "";
37
+ else if (s.type === "data-summary")
38
+ e.trim() && (r.push({ type: "text", text: e }), e = ""), o.push(s.data);
39
+ else if (s.type === "data-operation") {
40
+ e.trim() && (r.push({ type: "text", text: e }), e = "");
41
+ const t = s.data;
42
+ if (t?.type) {
43
+ if ((t.type === "tool_call" || t.type === "tool_result") && t.details?.data?.inDelegatedAgent === !1)
36
44
  continue;
37
- switch (s.type) {
45
+ switch (t.type) {
38
46
  case "agent_initializing":
39
47
  break;
40
48
  case "completion": {
41
- const { type: l } = s;
42
- r.push({ type: l, label: "Completed" }), o(!0);
49
+ const { type: l } = t;
50
+ o.push({ type: l, label: "Completed" }), g(!0);
43
51
  break;
44
52
  }
45
53
  case "error": {
46
- const l = s.message || "Unknown error";
47
- if (console.warn("Data operation error:", l), !t.length)
48
- o(!0), C(new Error(l)), i || (t.push({ type: "text", text: G }), i = !0);
54
+ const l = t.message || "Unknown error";
55
+ if (console.warn("Data operation error:", l), !r.length)
56
+ g(!0), k.current = l, w || (r.push({ type: "text", text: $ }), w = !0);
49
57
  else {
50
- const { type: x, label: _ } = s;
51
- r.push({ type: x, label: _ });
58
+ const { type: f, label: c } = t;
59
+ o.push({ type: f, label: c });
52
60
  }
53
61
  break;
54
62
  }
63
+ case "tool_call": {
64
+ const { type: l, label: f } = t, c = z(t);
65
+ o.push({ type: l, label: f, ...c && { toolCallId: c } });
66
+ break;
67
+ }
68
+ case "tool_result": {
69
+ const { type: l, label: f } = t, c = z(t), T = { type: l, label: f }, L = S(o, c);
70
+ if (L >= 0) {
71
+ o[L] = T;
72
+ break;
73
+ }
74
+ const D = r.filter(
75
+ (b) => b?.type === "summary-group"
76
+ );
77
+ if (c) {
78
+ let b = !1;
79
+ for (let p = D.length - 1; p >= 0; p--) {
80
+ const x = D[p].summaries;
81
+ if (x?.length) {
82
+ const G = S(x, c);
83
+ if (G >= 0) {
84
+ x[G] = T, b = !0;
85
+ break;
86
+ }
87
+ }
88
+ }
89
+ if (b) break;
90
+ } else {
91
+ const p = D[D.length - 1]?.summaries;
92
+ if (p?.length) {
93
+ const x = S(p, void 0);
94
+ if (x >= 0) {
95
+ p[x] = T;
96
+ break;
97
+ }
98
+ }
99
+ }
100
+ o.push(T);
101
+ break;
102
+ }
55
103
  default: {
56
- const { type: l, label: x } = s;
57
- r.push({ type: l, label: x });
104
+ const { type: l, label: f } = t;
105
+ o.push({ type: l, label: f });
58
106
  break;
59
107
  }
60
108
  }
61
109
  }
62
- } else if (n.type === "data-artifact")
63
- if (n.data?.type?.toLowerCase() === "citation") {
64
- const s = n.data, m = s.artifactSummary || {
65
- title: s.name
110
+ } else if (s.type === "data-artifact")
111
+ if (s.data?.type?.toLowerCase() === "citation") {
112
+ const t = s.data, i = t.artifactSummary || {
113
+ title: t.name
66
114
  };
67
- e += ` ^${m?.title || s.name}^`;
115
+ e += ` ^${i?.title || t.name}^`;
68
116
  } else
69
- e.trim() && (t.push({ type: "text", text: e }), e = ""), t.push(n);
70
- else n.type === "data-component" ? (e.trim() && (t.push({ type: "text", text: e }), e = ""), o(!0), t.push(n)) : (e.trim() && (t.push({ type: "text", text: e }), e = ""), o(!0), t.push(n));
71
- return o(!a), e.trim() && t.push({ type: "text", text: e }), { processed: t, newTimings: u };
72
- }, [c, a, C]);
73
- w(() => {
74
- if (b.current === c)
75
- return;
76
- b.current = c;
77
- const { processed: t, newTimings: e } = k();
78
- v(t), (e.size !== f.current.size || Array.from(e.entries()).some(([i, u]) => {
79
- const o = f.current.get(i);
80
- return !o || o.isCompleted !== u.isCompleted;
81
- })) && D(e);
82
- }, [k, c]), w(() => {
83
- a || D((t) => {
84
- const e = new Map(t);
85
- let r = !1;
86
- for (const [i, u] of e.entries())
87
- u.isCompleted || (e.set(i, {
88
- ...u,
89
- isCompleted: !0
90
- }), r = !0);
91
- return r ? e : t;
92
- });
93
- }, [a]);
94
- const L = R(() => {
95
- const t = Date.now() - T, e = Array.from(f.current.values()).some(
96
- (i) => !i.isCompleted
97
- ), r = t > 1e3 && !e;
98
- g(r);
99
- }, [T]);
100
- w(() => {
101
- if (!a) {
102
- g(!1);
117
+ e.trim() && (r.push({ type: "text", text: e }), e = ""), r.push(s);
118
+ else s.type === "data-component" ? (e.trim() && (r.push({ type: "text", text: e }), e = ""), g(!0), r.push(s)) : (e.trim() && (r.push({ type: "text", text: e }), e = ""), g(!0), r.push(s));
119
+ if (g(!n), e.trim() && r.push({ type: "text", text: e }), !n)
120
+ for (const [s, t] of u.entries())
121
+ t.isCompleted || u.set(s, { ...t, isCompleted: !0 });
122
+ const E = u.size !== y.current.size || Array.from(u.entries()).some(([s, t]) => {
123
+ const i = y.current.get(s);
124
+ return !i || i.isCompleted !== t.isCompleted;
125
+ }) ? u : y.current;
126
+ return y.current = E, { processedParts: r, summaryTimings: E };
127
+ }, [a, n]);
128
+ P(() => {
129
+ k.current && (m(new Error(k.current)), k.current = null);
130
+ });
131
+ const _ = U(() => {
132
+ const r = Date.now() - R.current, e = Array.from(y.current.values()).some(
133
+ (w) => !w.isCompleted
134
+ ), o = r > 1e3 && !e;
135
+ h(o);
136
+ }, []);
137
+ P(() => {
138
+ if (!n) {
139
+ h(!1);
103
140
  return;
104
141
  }
105
- if (!(p.length > 0)) {
106
- g(!1);
142
+ if (!(C.length > 0)) {
143
+ h(!1);
107
144
  return;
108
145
  }
109
- const e = setInterval(L, 200);
146
+ const e = setInterval(_, 200);
110
147
  return () => clearInterval(e);
111
- }, [a, L, p.length]);
112
- const E = z(() => !!(!(p.length > 0) && a), [p.length, a]);
148
+ }, [n, _, C.length]);
149
+ const N = M(() => !!(!(C.length > 0) && n), [C.length, n]);
113
150
  return {
114
- processedParts: p,
115
- summaryTimings: d,
116
- shouldShowInitialLoading: E,
117
- shouldShowStreamDelayLoading: P
151
+ processedParts: C,
152
+ summaryTimings: F,
153
+ shouldShowInitialLoading: N,
154
+ shouldShowStreamDelayLoading: d
118
155
  };
119
156
  }
120
157
  export {
121
- K as useStreamProcessor
158
+ B as useStreamProcessor
122
159
  };
@@ -1,11 +1,11 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("react"),ha=require("react-dom/client"),Z=require("react-textarea-autosize"),ua=require("@radix-ui/react-avatar"),Ca=require("@radix-ui/react-checkbox"),pa=require("@radix-ui/react-popover"),va=require("@radix-ui/react-tooltip"),ba=require("@radix-ui/react-scroll-area"),y=require("../atoms/select.cjs"),F=require("../atoms/dialog.cjs"),ga=require("../atoms/avatars/ai.cjs"),Pa=require("../atoms/avatars/user.cjs"),f=require("../atoms/icons/custom-icon.cjs"),T=require("../atoms/icons/built-in-icon-renderer.cjs"),Aa=require("../atoms/link.cjs"),Q=require("../atoms/markdown/index.cjs"),D=require("../providers/attachment-item-provider.cjs"),S=require("../providers/attachments-bar-provider.cjs"),j=require("../providers/source-item-provider.cjs"),b=require("../providers/config-provider.cjs"),ee=require("../providers/feedback-provider.cjs"),q=require("../providers/message-attachments-provider.cjs"),_=require("../providers/message-provider.cjs"),le=require("../atoms/icons/checkbox-icon.cjs"),J=require("../hooks/use-copy-to-clipboard.cjs"),V=require("../providers/feedback-item-provider.cjs"),u=require("../utils/misc.cjs"),a=require("./factory.cjs"),P=require("./embedded-chat/chat-provider.cjs"),_a=require("./tagline-logo-icon.cjs"),Ea=require("../hooks/use-settle-action.cjs"),Fa=require("../hooks/use-container-size.cjs"),te=require("./embedded-chat/use-chat-action.cjs"),X=require("../providers/help-menu-provider.cjs"),k=require("../providers/chat-form-provider.cjs"),H=require("../providers/form-field-provider.cjs"),ka=require("react-hook-form"),Ia=require("../utils/highlight-emphasis.cjs"),Ma=require("./modal/modal-provider.cjs"),fa=require("../../color-mode/index.cjs"),ie=require("../utils/compose-refs.cjs"),C=require("../utils/compose-event-handlers.cjs"),Sa=require("../hooks/use-simple-scroll.cjs"),xa=require("../hooks/use-debounce.cjs"),ae=require("../providers/hover-popover-provider.cjs"),Ba=require("./modal/widget-auto-focus.cjs"),ne=require("../providers/base-events-provider.cjs"),ya=require("../atoms/shadow/context.cjs"),Ta=require("../utils/get-source-icon.cjs");function R(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const ja=R(ha),re=R(ua),$=R(Ca),w=R(pa),L=R(va),W=R(ba),Ha="__intro__",wa=a.ikp("div",{_id:"aiChatWrapper"}),he=h.forwardRef((t,e)=>{const{...i}=t,{isHidden:r,isMobile:s}=P.useChat(),[o,d]=Fa.useContainerSize(),c=ie.useComposedRefs(e,o),m=d?.width?d.width>580:!0,l=Ma.useModal();return n.jsx(wa,{ref:c,"data-widget-md":u.dataAttr(m),"data-hidden":u.dataAttr(r),"data-in-modal":u.dataAttr(!!l),"data-mobile":u.dataAttr(s),...i})}),La=a.ikp("div",{_id:"aiChatRoot"}),ue=t=>{const{isHidden:e}=P.useChat(),{form:i}=k.useChatForm();return i?null:n.jsx(La,{"data-hidden":u.dataAttr(e),...t})},Da=a.ikp("div",{_id:"aiChatHeader"}),Ce=a.ikp("div",{_id:"aiChatHeader__Toolbar"}),pe=a.ikp("div",{_id:"aiChatHeader__ToolbarHeaderWrapper"}),Ra=a.ikp("div",{_id:"aiChatHeader__ToolbarHeader"}),ve=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=`Ask ${e.aiAssistantName||"AI"}`;return n.jsx(Ra,{...t,children:i})}),be=a.ikp("div",{_id:"aiChatContent"}),ge=a.ikp(W.Root,{_id:"aiChatContentScrollArea"}),Oa=a.ikp(W.Viewport,{_id:"aiChatContentScrollArea__Viewport"}),Pe=h.forwardRef(({children:t,...e},i)=>{const{containerRef:r,scrollToBottom:s}=Sa.useSimpleScroll(),o=ie.useComposedRefs(i,r),{messages:d}=P.useChat();return h.useEffect(()=>{d.length>0&&s()},[d.length,s]),n.jsx(Oa,{ref:o,children:n.jsx("div",{"data-part":"grid",style:{display:"grid"},children:t}),...e})}),Ae=a.ikp(W.ScrollAreaScrollbar,{_id:"aiChatContentScrollArea__Scrollbar"}),_e=a.ikp(W.ScrollAreaThumb,{_id:"aiChatContentScrollArea__Thumb"}),Ee=a.ikp(W.Corner,{_id:"aiChatContentScrollArea__Corner"}),qa=a.ikp("div",{_id:"aiChatMessages"}),Fe=t=>{const e=P.useChat(),{children:i,...r}=t;return n.jsx(qa,{children:u.maybeRender(i,e),...r})},Wa=a.ikp("div",{_id:"aiChatDisclaimer"}),ke=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),[i,r]=h.useState(!1),s=xa.useDebounce(i,100);return e.disclaimerSettings?.isEnabled?n.jsx(ae.HoverPopoverProvider,{open:i,setOpen:r,children:n.jsx(w.Root,{open:s,onOpenChange:r,children:n.jsx(Wa,{...t})})}):null}),Na=a.ikp("span",{_id:"aiChatDisclaimerLabel"}),Ie=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=e.disclaimerSettings;return n.jsx(Na,{children:i?.label,...t})}),Qa=a.ikp(w.Trigger,{_id:"aiChatDisclaimerTrigger",children:n.jsx(f.CustomIcon,{iconKey:"info"})}),Me=h.memo(t=>{const{setOpen:e}=ae.useHoverPopover(),i=()=>e(!0),r=()=>e(!1);return n.jsx(Qa,{onMouseEnter:i,onMouseLeave:r,...t})}),Va=a.ikp(w.Content,{_id:"aiChatDisclaimerContent"}),fe=t=>{const{setOpen:e}=ae.useHoverPopover(),i=()=>e(!0),r=()=>e(!1);return n.jsx(Va,{onMouseEnter:i,onMouseLeave:r,side:"top",sideOffset:8,align:"end",alignOffset:-10,...t})},$a=a.ikp(Q.Markdown,{_id:"aiChatDisclaimerText"}),Se=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=e.aiAssistantName,s=e.disclaimerSettings?.tooltip||`Information provided by ${i||"this AI assistant"} is not guaranteed to be accurate or comprehensive.`;return n.jsx($a,{shouldOpenLinksInNewTab:!0,children:s,...t})}),xe=a.ikp(w.Arrow,{_id:"aiChatDisclaimerArrow"}),Ua=a.ikp("div",{_id:"aiChatExampleQuestions"}),Be=t=>{const{aiChatSettings:e}=b.useInkeepConfig(),{messages:i}=P.useChat();return!e.exampleQuestions?.length||i.length?null:n.jsx(Ua,{...t})},Ka=a.ikp("h3",{_id:"aiChatExampleQuestionsLabel"}),ye=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig();return n.jsx(Ka,{children:e.exampleQuestionsLabel,...t})}),za=a.ikp("div",{_id:"aiChatExampleQuestionsList"}),Te=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=e.exampleQuestions,{children:r,...s}=t;return n.jsx(za,{children:u.maybeRender(r,i),...s})}),Ga=a.ikp("div",{_id:"aiChatExampleQuestion"}),je=h.forwardRef((t,e)=>{const{aiChatSettings:i}=b.useInkeepConfig(),r=i.isFirstExampleQuestionHighlighted;return n.jsx(Ga,{ref:e,"data-highlight":u.dataAttr(r),...t})}),Ya=a.ikp("button",{_id:"aiChatExampleQuestionButton"}),He=t=>{const{question:e,onClick:i,...r}=t,s=typeof e=="object"?e.value:e,o=typeof e=="object"?e.label:e,{handleSubmit:d}=P.useChat();return n.jsx(Ya,{onClick:C.composeEventHandlers(i,()=>d(s)),children:o,...r})},Ja=a.ikp("div",{_id:"aiChatWorkflows"}),we=t=>{const{aiChatSettings:e}=b.useInkeepConfig(),{messages:i}=P.useChat();return!e.workflows?.length||i.length?null:n.jsx(Ja,{...t})},Xa=a.ikp("h3",{_id:"aiChatWorkflowsLabel"}),Le=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig();return n.jsx(Xa,{children:e.workflowsHeader,...t})}),Za=a.ikp("div",{_id:"aiChatWorkflowsList"}),De=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=e.workflows,{children:r,...s}=t;return n.jsx(Za,{children:u.maybeRender(r,i),...s})}),en=a.ikp("button",{_id:"aiChatWorkflow"}),Re=t=>{const{workflow:e,onClick:i,...r}=t,s=o=>{};return n.jsx(en,{onClick:C.composeEventHandlers(i,()=>s()),children:e.displayName,...r})},tn=a.ikp("div",{_id:"aiChatMessageWrapper"}),se=t=>{const{message:e,...i}=t;return e.role==="system"?null:n.jsx(_.MessageProvider,{message:e,children:n.jsx(tn,{"data-role":e.role,...i})})},Oe=h.memo(t=>{const{message:e,...i}=t,{aiChatSettings:r,baseSettings:s}=b.useInkeepConfig(),o=r.aiAssistantName,d=o?`Hi, I'm ${o}!`:"Hi!",c=r.chatSubjectName??s.organizationDisplayName,m=c?`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),Ba=require("react-dom/client"),ie=require("react-textarea-autosize"),Ta=require("@radix-ui/react-avatar"),ya=require("@radix-ui/react-checkbox"),Ha=require("@radix-ui/react-popover"),ja=require("@radix-ui/react-tooltip"),wa=require("@radix-ui/react-scroll-area"),j=require("../atoms/select.cjs"),S=require("../atoms/combobox.cjs"),A=require("../atoms/dialog.cjs"),La=require("../atoms/avatars/ai.cjs"),Da=require("../atoms/avatars/user.cjs"),x=require("../atoms/icons/custom-icon.cjs"),w=require("../atoms/icons/built-in-icon-renderer.cjs"),Ra=require("../atoms/link.cjs"),z=require("../atoms/markdown/index.cjs"),V=require("../providers/attachment-item-provider.cjs"),B=require("../providers/attachments-bar-provider.cjs"),O=require("../providers/source-item-provider.cjs"),g=require("../providers/config-provider.cjs"),ae=require("../providers/feedback-provider.cjs"),U=require("../providers/message-attachments-provider.cjs"),_=require("../providers/message-provider.cjs"),ue=require("../atoms/icons/checkbox-icon.cjs"),ee=require("../hooks/use-copy-to-clipboard.cjs"),G=require("../providers/feedback-item-provider.cjs"),u=require("../utils/misc.cjs"),a=require("./factory.cjs"),F=require("./embedded-chat/chat-provider.cjs"),Oa=require("./tagline-logo-icon.cjs"),qa=require("../hooks/use-settle-action.cjs"),Wa=require("../hooks/use-container-size.cjs"),re=require("./embedded-chat/use-chat-action.cjs"),te=require("../providers/help-menu-provider.cjs"),k=require("../providers/chat-form-provider.cjs"),H=require("../providers/form-field-provider.cjs"),Na=require("react-hook-form"),Va=require("../utils/highlight-emphasis.cjs"),Qa=require("./modal/modal-provider.cjs"),$a=require("../../color-mode/index.cjs"),oe=require("../utils/compose-refs.cjs"),C=require("../utils/compose-event-handlers.cjs"),Ua=require("../hooks/use-simple-scroll.cjs"),Ka=require("../hooks/use-debounce.cjs"),ne=require("../providers/hover-popover-provider.cjs"),za=require("./modal/widget-auto-focus.cjs"),se=require("../providers/base-events-provider.cjs"),Ga=require("../atoms/shadow/context.cjs"),Ya=require("../utils/get-source-icon.cjs"),Ja=require("../providers/chat-history-provider.cjs");function Q(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const Xa=Q(Ba),de=Q(Ta),Y=Q(ya),q=Q(Ha),W=Q(ja),K=Q(wa),Za="__intro__",er=767,tr=a.ikp("div",{_id:"aiChatWrapper"}),Ce=l.forwardRef(({chatHistoryLayout:t,isChatHistoryOpen:e,setChatHistoryOpen:i,isChatHistoryButtonVisible:o,children:n,...s},d)=>{l.useEffect(()=>{t==="stack"?i(!1):t==="sidepane"&&o&&i(!0)},[t,o,i]);const c=t==="stack"&&e;return r.jsx(tr,{ref:d,"data-chat-history-layout":t,"data-chat-history-open":u.dataAttr(e),"data-stack-history-open":u.dataAttr(c),...s,children:n})});Ce.displayName="EmbeddedChatWrapperInner";const be=l.forwardRef((t,e)=>{const{children:i,...o}=t,{isHidden:n,isMobile:s}=F.useChat(),{aiChatSettings:d}=g.useInkeepConfig(),{isChatHistoryButtonVisible:c}=d,[m,h]=Wa.useContainerSize(),b=oe.useComposedRefs(e,m),v=h?.width?h.width>580:!0,p=Qa.useModal(),P=(h?.width??0)>er?"sidepane":"stack";return r.jsx(Ja.ChatHistoryProvider,{layout:P,children:({isOpen:I,setIsOpen:M})=>r.jsx(Ce,{ref:b,chatHistoryLayout:P,isChatHistoryOpen:I,setChatHistoryOpen:M,isChatHistoryButtonVisible:!!c,"data-widget-md":u.dataAttr(v),"data-hidden":u.dataAttr(n),"data-in-modal":u.dataAttr(!!p),"data-mobile":u.dataAttr(s),...o,children:i})})}),ir=a.ikp("div",{_id:"aiChatRoot"}),pe=t=>{const{isHidden:e}=F.useChat(),{form:i}=k.useChatForm();return i?null:r.jsx(ir,{"data-hidden":u.dataAttr(e),...t})},ar=a.ikp("div",{_id:"aiChatHeader"}),ve=a.ikp("div",{_id:"aiChatHeader__Toolbar"}),ge=a.ikp("div",{_id:"aiChatHeader__ToolbarHeaderWrapper"}),rr=a.ikp(x.CustomIcon,{_id:"aiChatHeader__ChatHistoryButtonIcon"}),Pe=l.memo(t=>r.jsx(rr,{...t})),Fe=a.ikp("button",{_id:"aiChatHeader__ChatHistoryButton"}),or=a.ikp("div",{_id:"aiChatHeader__ToolbarHeader"}),_e=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig(),i=`Ask ${e.aiAssistantName||"AI"}`;return r.jsx(or,{...t,children:i})}),Ee=a.ikp("div",{_id:"aiChatContent"}),Ae=a.ikp(K.Root,{_id:"aiChatContentScrollArea"}),nr=a.ikp(K.Viewport,{_id:"aiChatContentScrollArea__Viewport"}),ke=l.forwardRef(({children:t,...e},i)=>{const{messages:o,isStreaming:n}=F.useChat(),{containerRef:s,scrollToBottom:d,handleScroll:c}=Ua.useSimpleScroll({isStreaming:n}),m=oe.useComposedRefs(i,s);return l.useEffect(()=>{o.length>0&&!n&&d()},[o.length,d,n]),r.jsx(nr,{ref:m,onScroll:c,children:r.jsx("div",{"data-part":"grid",style:{display:"grid"},children:t}),...e})}),Ie=a.ikp(K.ScrollAreaScrollbar,{_id:"aiChatContentScrollArea__Scrollbar"}),Me=a.ikp(K.ScrollAreaThumb,{_id:"aiChatContentScrollArea__Thumb"}),fe=a.ikp(K.Corner,{_id:"aiChatContentScrollArea__Corner"}),sr=a.ikp("div",{_id:"aiChatMessages"}),xe=t=>{const e=F.useChat(),{children:i,...o}=t;return r.jsx(sr,{children:u.maybeRender(i,e),...o})},dr=a.ikp("div",{_id:"aiChatDisclaimer"}),Se=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig(),[i,o]=l.useState(!1),n=Ka.useDebounce(i,100);return e.disclaimerSettings?.isEnabled?r.jsx(ne.HoverPopoverProvider,{open:i,setOpen:o,children:r.jsx(q.Root,{open:n,onOpenChange:o,children:r.jsx(dr,{...t})})}):null}),cr=a.ikp("span",{_id:"aiChatDisclaimerLabel"}),Be=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig(),i=e.disclaimerSettings;return r.jsx(cr,{children:i?.label,...t})}),mr=a.ikp(q.Trigger,{_id:"aiChatDisclaimerTrigger",children:r.jsx(x.CustomIcon,{iconKey:"info"})}),Te=l.memo(t=>{const{setOpen:e}=ne.useHoverPopover(),i=()=>e(!0),o=()=>e(!1);return r.jsx(mr,{onMouseEnter:i,onMouseLeave:o,...t})}),lr=a.ikp(q.Content,{_id:"aiChatDisclaimerContent"}),ye=t=>{const{setOpen:e}=ne.useHoverPopover(),i=()=>e(!0),o=()=>e(!1);return r.jsx(lr,{onMouseEnter:i,onMouseLeave:o,side:"top",sideOffset:8,align:"end",alignOffset:-10,...t})},hr=a.ikp(z.Markdown,{_id:"aiChatDisclaimerText"}),He=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig(),i=e.aiAssistantName,n=e.disclaimerSettings?.tooltip||`Information provided by ${i||"this AI assistant"} is not guaranteed to be accurate or comprehensive.`;return r.jsx(hr,{shouldOpenLinksInNewTab:!0,children:n,...t})}),je=a.ikp(q.Arrow,{_id:"aiChatDisclaimerArrow"}),ur=a.ikp("div",{_id:"aiChatExampleQuestions"}),we=t=>{const{aiChatSettings:e}=g.useInkeepConfig(),{messages:i}=F.useChat();return!e.exampleQuestions?.length||i.length?null:r.jsx(ur,{...t})},Cr=a.ikp("h3",{_id:"aiChatExampleQuestionsLabel"}),Le=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig();return r.jsx(Cr,{children:e.exampleQuestionsLabel,...t})}),br=a.ikp("div",{_id:"aiChatExampleQuestionsList"}),De=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig(),i=e.exampleQuestions,{children:o,...n}=t;return r.jsx(br,{children:u.maybeRender(o,i),...n})}),pr=a.ikp("div",{_id:"aiChatExampleQuestion"}),Re=l.forwardRef((t,e)=>{const{aiChatSettings:i}=g.useInkeepConfig(),o=i.isFirstExampleQuestionHighlighted;return r.jsx(pr,{ref:e,"data-highlight":u.dataAttr(o),...t})}),vr=a.ikp("button",{_id:"aiChatExampleQuestionButton"}),Oe=t=>{const{question:e,onClick:i,...o}=t,n=typeof e=="object"?e.value:e,s=typeof e=="object"?e.label:e,{handleSubmit:d}=F.useChat();return r.jsx(vr,{onClick:C.composeEventHandlers(i,()=>d(n)),children:s,...o})},gr=a.ikp("div",{_id:"aiChatWorkflows"}),qe=t=>{const{aiChatSettings:e}=g.useInkeepConfig(),{messages:i}=F.useChat();return!e.workflows?.length||i.length?null:r.jsx(gr,{...t})},Pr=a.ikp("h3",{_id:"aiChatWorkflowsLabel"}),We=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig();return r.jsx(Pr,{children:e.workflowsHeader,...t})}),Fr=a.ikp("div",{_id:"aiChatWorkflowsList"}),Ne=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig(),i=e.workflows,{children:o,...n}=t;return r.jsx(Fr,{children:u.maybeRender(o,i),...n})}),_r=a.ikp("button",{_id:"aiChatWorkflow"}),Ve=t=>{const{workflow:e,onClick:i,...o}=t,n=s=>{};return r.jsx(_r,{onClick:C.composeEventHandlers(i,()=>n()),children:e.displayName,...o})},Er=a.ikp("div",{_id:"aiChatMessageWrapper"}),ce=t=>{const{message:e,...i}=t;return e.role==="system"?null:r.jsx(_.MessageProvider,{message:e,children:r.jsx(Er,{"data-role":e.role,...i})})},Qe=l.memo(t=>{const{message:e,...i}=t,{aiChatSettings:o,baseSettings:n}=g.useInkeepConfig(),s=o.aiAssistantName,d=s?`Hi, I'm ${s}!`:"Hi!",c=o.chatSubjectName??n.organizationDisplayName,m=c?`
2
2
 
3
3
  Ask me anything about \`${c}\`.`:`
4
4
 
5
- How can I help?`,p={parts:[{type:"text",text:r.introMessage??`${d}${m}`}],id:Ha,...e,role:"assistant"};return n.jsx(se,{message:p,...i})}),an=a.ikp("div",{_id:"aiChatMessageHeader"}),qe=t=>{const{message:e}=_.useMessage();return n.jsx(an,{"data-role":e.role,...t})},nn=a.ikp("div",{_id:"aiChatMessageLoading",children:"Thinking..."}),We=t=>n.jsx(nn,{...t}),rn=a.ikp("div",{_id:"aiChatMessageAvatar"}),Ne=t=>{const{message:e}=_.useMessage();return n.jsx(rn,{"data-role":e.role,...t})},sn=a.ikp(re.Root,{_id:"aiChatMessageAvatarContent"}),Qe=t=>{const{message:e}=_.useMessage(),{baseSettings:i}=b.useInkeepConfig();return n.jsx(sn,{"data-username":u.dataAttr(e.role==="user"&&!!i.userProperties.name),"data-role":e.role,...t})},on=a.ikp(re.Fallback,{_id:"aiChatMessageAvatarFallback"}),Ve=h.memo(t=>{const{baseSettings:e}=b.useInkeepConfig(),{message:i}=_.useMessage();return e.userProperties.name?n.jsx(on,{"data-role":i.role,children:u.getInitials(e.userProperties.name),...t}):null}),me=a.ikp(re.Image,{_id:"aiChatMessageAvatarImage"}),$e=h.memo(t=>{const{onLoadingStatusChange:e,...i}=t,{aiChatSettings:r,baseSettings:{userProperties:s}}=b.useInkeepConfig(),{message:o}=_.useMessage(),{aiAssistantAvatar:d}=r??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,l=fa.useColorModeValue(c,m),[p,g]=h.useState(l);h.useEffect(()=>{g(l)},[l]);const v=A=>{A==="error"&&g(null)};return o.role==="user"?s.name?null:r.userAvatar?n.jsx(me,{"data-type":"image",alt:"User avatar","data-role":o.role,src:r.userAvatar,...t}):n.jsx(Pa.default,{"data-type":"icon","data-role":o.role,...t}):p?n.jsx(me,{src:p,alt:"AI assistant avatar","data-type":"image","data-role":o.role,onLoadingStatusChange:C.composeEventHandlers(e,v),...i}):n.jsx(ga.default,{"data-type":"icon","data-role":o.role,...t})}),dn=a.ikp("span",{_id:"aiChatMessageName"}),Ue=t=>{const{message:e}=_.useMessage(),{aiChatSettings:i}=b.useInkeepConfig(),{aiAssistantName:r}=i;return n.jsx(dn,{"data-role":e.role,children:e.role==="user"?"You":r||"AI assistant",...t})},cn=a.ikp("div",{_id:"aiChatMessageContentWrapper"}),Ke=t=>{const{message:e}=_.useMessage();return n.jsx(cn,{"data-role":e.role,...t})},mn=a.ikp("div",{_id:"aiChatMessageContent"}),ze=t=>{const{message:e}=_.useMessage();return n.jsx(mn,{"data-role":e.role,...t})},ln=a.ikp("div",{_id:"aiChatMessageAttachments"}),Ge=t=>{const{message:e}=_.useMessage(),i=[];return e.role!=="user"||!i?.length?null:n.jsx(q.MessageAttachmentsProvider,{children:n.jsx(ln,{...t})})},hn=a.ikp("div",{_id:"aiChatMessageAttachments__List"}),Ye=t=>{const{children:e,...i}=t,r=[];return r?n.jsx(hn,{children:u.maybeRender(e,r),...i}):null},un=a.ikp("div",{_id:"aiChatMessageAttachments__Item"}),Je=t=>{const{attachment:e,onClick:i,...r}=t,{selectItem:s,onOpen:o}=q.useMessageAttachments(),d=()=>{s(e),o()};return n.jsx(D.AttachmentItemProvider,{attachment:e,children:n.jsx(un,{onClick:C.composeEventHandlers(i,d),...r})})},Cn=a.ikp(T.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),Xe=t=>{const{attachment:e}=D.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Cn,{iconSettings:i,...t}):null},pn=a.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),Ze=t=>{const{attachment:e}=D.useAttachmentItem();return n.jsx(pn,{children:e.title,...t})},vn=a.ikp(F.Root,{_id:"aiChatMessageAttachmentsPreview"}),et=t=>{const{onOpenChange:e,...i}=t,{selectItem:r,isOpen:s,onClose:o,selectedItem:d}=q.useMessageAttachments(),c=m=>{m||(o(),r(null))};return n.jsx(vn,{open:s&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...i})},tt=a.ikp(F.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),it=a.ikp(F.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),bn=a.ikp(F.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),at=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(bn,{children:e?.title||"Attachment",...t})},nt=a.ikp(F.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),gn=a.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),rt=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(gn,{children:e?.content,...t})},st=t=>{const{text:e,componentStyles:i,...r}=t,{aiChatSettings:s}=b.useInkeepConfig(),{shouldOpenLinksInNewTab:o}=s;return n.jsx(Q.Markdown,{children:e,componentStyles:i,shouldOpenLinksInNewTab:o,...r})},ot=({name:t,props:e,componentDef:i})=>{const s=ya.useShadow()?.shadowHost,o=h.useRef(void 0),d=h.useRef(null),c=h.useRef(null),m=h.useRef(!1),[l,p]=h.useState(!1),[g,v]=h.useState(!1),A=h.useRef(i);h.useMemo(()=>{i!==A.current&&(typeof i=="function"&&typeof A.current=="function"?i.toString()!==A.current.toString()&&(A.current=i):A.current=i)},[i]);const x=A.current;return h.useEffect(()=>{o.current||(o.current=`dyn:${t}:${crypto.randomUUID()}`,p(!0))},[t]),h.useLayoutEffect(()=>{if(!x||!s||!l||!o.current)return;const E=o.current,I=document.createElement("div");return I.setAttribute("data-ikp-component",""),I.setAttribute("data-component",t),I.setAttribute("slot",E),d.current=I,m.current=!1,s.appendChild(I),v(!0),()=>{m.current=!0,v(!1),queueMicrotask(()=>{try{c.current&&(c.current.unmount(),c.current=null)}catch(M){console.debug("Ignoring unmount error:",M)}I.parentNode===s&&I.remove(),d.current=null})}},[x,s,l,t]),h.useEffect(()=>{const E=d.current;if(!E||m.current)return;const I=B=>{if(typeof B!="function"||B.length>1)return!1;try{if(typeof B=="function"&&B.constructor===Function){const O=B({});return h.isValidElement(O)}return!1}catch{return!0}};let M;if(I(x))try{const B=x;M=h.createElement(B,e||{})}catch(B){console.error("Error creating React element from component:",B);return}else if(typeof x=="function")M=x(e||{},E,null);else{console.error("Invalid component definition");return}if(h.isValidElement(M)||typeof M=="string"){if(m.current)return;c.current||(c.current=ja.createRoot(E)),!m.current&&c.current&&c.current.render(M);return}c.current&&!m.current&&c.current.render(null)},[i,e,g]),n.jsx("slot",{name:o.current})},Pn=a.ikp("div",{_id:"aiChatMessagePart"}),An=a.ikp("div",{_id:"aiChatMessageToolbar"}),dt=t=>{const{isLoading:e,messages:i}=P.useChat(),{message:r}=_.useMessage();return i.at(-1)?.id===r?.id&&e||r.role==="user"?null:n.jsx(An,{...t})},_n=a.ikp("div",{_id:"aiChatMessageCustomActions"}),ct=t=>{const{children:e,...i}=t,{aiChatSettings:r}=b.useInkeepConfig(),{message:s}=_.useMessage(),{isStreaming:o,messages:d}=P.useChat(),c=d.at(-1)?.id===s?.id,m=s.role==="assistant",l=r.messageActions||[];return c&&o||!m?null:n.jsx(_n,{children:u.maybeRender(e,l),...i})},En=a.ikp("a",{_id:"aiChatMessageCustomAction"}),Fn=a.ikp("button",{_id:"aiChatMessageCustomAction"}),mt=t=>{const{onClick:e,action:i,...r}=t,{message:s}=_.useMessage(),{handleAction:o}=te.useChatAction(i,s.id),{logEvent:d}=ne.useBaseEvents(),{conversationId:c}=P.useChat(),m=()=>{o(),d({eventName:"user_escalation_indicated",properties:{escalationType:"contact_us",conversationId:c}})},l=i.label,p=n.jsxs(n.Fragment,{children:[i.icon&&n.jsx(T.BuiltInIconRenderer,{iconSettings:i.icon}),l]});return i.action.type==="open_link"?n.jsx(En,{href:i.action.url,target:"_blank",rel:"noopener","data-type":i.action.type,onClick:C.composeEventHandlers(e,m),children:p,...r}):n.jsx(Fn,{"data-type":i.action.type,onClick:C.composeEventHandlers(e,m),children:p,...r})},kn=a.ikp("button",{_id:"aiChatMessageAction"}),lt=t=>{const{action:e,onClick:i,className:r,...s}=t,{conversationId:o}=P.useChat(),{baseSettings:{onFeedback:d}}=b.useInkeepConfig(),{message:c}=_.useMessage(),{isStreaming:m,messages:l}=P.useChat(),[p,g]=J.useCopyToClipboard(),{feedback:v,submitPositiveFeedback:A,setCurrentFeedback:x,currentFeedback:E}=ee.useMessageFeedback(),{logEvent:I}=ne.useBaseEvents(),[M,B]=Ea.useSettleAction(),O=l.at(-1)?.id===c?.id,z=c.role==="assistant";if(O&&m||!z)return null;const N={copy(){g(u.getMessageContent(c)),I({eventName:"assistant_message_copied",properties:{conversationId:o}})},upvote(){A(c.id).then(()=>{B()})},downvote(){x(c.id)}},G={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},Y={copy:n.jsx(f.CustomIcon,{iconKey:p?"messageCopied":"messageCopy"}),upvote:n.jsx(f.CustomIcon,{iconKey:M?"messageCopied":"thumbsUp"}),downvote:n.jsx(f.CustomIcon,{iconKey:"thumbsDown"})},la={copy:{"data-copied":u.dataAttr(p)},upvote:{"data-upvoted":u.dataAttr(v[c.id]?.type==="positive")},downvote:{"data-downvoted":u.dataAttr(v[c.id]?.type==="negative"),"data-state":E===null?"closed":"open"}};return{copy:!1,upvote:!d,downvote:!d}[e]?null:n.jsx(kn,{"data-action":e,...la[e],children:Y[e],"aria-label":G[e],className:`${r} ${e}`,onClick:C.composeEventHandlers(i,N[e]),...s})},In=a.ikp("div",{_id:"aiChatMessageSources"}),ht=t=>{const{message:e}=_.useMessage();return e.role!=="assistant"||!e.parts.filter(r=>r.type==="data-artifact"&&r.data?.type?.toLowerCase()==="citation")?.length?null:n.jsx(In,{...t})},Mn=a.ikp("div",{_id:"aiChatMessageSources__Header"}),ut=t=>n.jsx(Mn,{children:"Sources",...t}),fn=a.ikp("div",{_id:"aiChatMessageSources__List"}),Ct=t=>{const{message:e}=_.useMessage(),{children:i,...r}=t,{baseSettings:{transformSource:s,organizationDisplayName:o},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=b.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.parts.filter(g=>g.type==="data-artifact"&&g.data?.type?.toLowerCase()==="citation");if(!m?.length)return null;const l=new Map,p=m.filter(g=>{const v=g.data.artifactSummary.url;return!v||l.has(v)?!1:(l.set(v,!0),!0)}).map(g=>{const v=g.data,A={id:v?.artifactId,title:v?.artifactSummary?.title||v?.name,url:v?.artifactSummary?.url||"",description:"",breadcrumbs:[],type:v?.artifactSummary?.record_type,contentType:v?.artifactType,tag:v?.artifactType},E=(s??(M=>({...M,shouldOpenInNewTab:d,icon:Ta.getIcon(M)})))(A,"chatSourceItem",{organizationDisplayName:o,tabs:c}),I=E.shouldOpenInNewTab!==void 0?E.shouldOpenInNewTab:d;return{...E,isExternal:I}});return n.jsx(fn,{children:u.maybeRender(i,p),...r})},Sn=a.ikp(Aa.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),pt=t=>{const{source:e,onClick:i,...r}=t,{logEvent:s}=ne.useBaseEvents(),{conversationId:o}=P.useChat(),d=()=>{s({eventName:"assistant_source_item_clicked",properties:{conversationId:o,link:e}})};return n.jsx(j.SourceItemProvider,{source:e,children:n.jsx(Sn,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:C.composeEventHandlers(i,d),...r})})},xn=a.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),vt=t=>{const{source:e}=j.useSourceItem();return e.breadcrumbs?.length?n.jsx(xn,{"data-type":e.type,...t}):null},Bn=a.ikp(f.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),yn=a.ikp(T.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),bt=t=>{const{source:e}=j.useSourceItem();return n.jsx(yn,{iconSettings:e.icon,"data-type":e.type,...t})},Tn=a.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),gt=t=>{const{source:e}=j.useSourceItem();return n.jsx(Tn,{"data-type":e.type,children:e.title,...t})},jn=a.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),Pt=t=>{const{source:e}=j.useSourceItem();return n.jsx(jn,{"data-type":e.type,...t})},Hn=a.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),At=t=>{const{source:e}=j.useSourceItem(),{children:i,...r}=t,s=h.useMemo(()=>e.description?Ia.highlightEmphasis(e.description):[],[e.description]);return s.length?n.jsx(Hn,{"data-type":e.type,children:u.maybeRender(i,s),...r}):null},wn=a.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),_t=t=>{const{part:e,...i}=t,{source:r}=j.useSourceItem();return typeof e=="string"?e:n.jsx(wn,{"data-type":r.type,children:e.content,"data-highlighted":u.dataAttr(e.highlighted),...i})},Ln=a.ikp(f.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),Et=t=>{const{source:e}=j.useSourceItem();return n.jsx(Ln,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Ft=a.ikp("div",{_id:"aiChatFooter"}),kt=a.ikp("div",{_id:"aiChatInput__Fieldset"}),It=a.ikp("div",{_id:"aiChatInput__Group"}),Dn=a.ikp("textarea",{_id:"aiChatInput"}),Mt=h.forwardRef(({onChange:t,onKeyDown:e,...i},r)=>{const{handleInputChange:s,handleInputKeyDown:o,input:d,error:c,shouldAutoFocusInput:m,inputRef:l}=P.useChat(),{aiChatSettings:p}=b.useInkeepConfig(),g=ie.useComposedRefs(r,l);return Ba.useWidgetAutoFocus("chat",l,m),n.jsx(Dn,{asChild:!0,ref:g,maxLength:99999,placeholder:p.placeholder,value:d,onChange:C.composeEventHandlers(t,s),onKeyDown:C.composeEventHandlers(e,o),disabled:!!c||p.isViewOnly,...i,children:n.jsx(Z,{})})}),Rn=a.ikp("button",{_id:"aiChatInput__SendButton"}),ft=t=>{const{handleSubmit:e,isSubmitDisabled:i,error:r}=P.useChat(),{aiChatSettings:s}=b.useInkeepConfig(),{onClick:o,...d}=t;return n.jsx(Rn,{onClick:C.composeEventHandlers(o,()=>e()),"aria-label":"Send message",disabled:i||!!r||s.isViewOnly,...d})},St=a.ikp(f.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),On=a.ikp("div",{_id:"aiChatAttachmentsBar"}),xt=t=>{const e={supportedInputs:[]};return!e||!e.supportedInputs?.length?null:n.jsx(S.AttachmentsBarProvider,{children:n.jsx(On,{...t})})},qn=a.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Bt=t=>{const{children:e,...i}=t,r=[];return n.jsx(qn,{children:u.maybeRender(e,r),...i})},Wn=a.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),yt=t=>{const{attachment:e,...i}=t;return n.jsx(D.AttachmentItemProvider,{attachment:e,children:n.jsx(Wn,{...i})})},Nn=a.ikp(T.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),Tt=t=>{const{attachment:e}=D.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Nn,{iconSettings:i,...t}):null},Qn=a.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),jt=t=>{const{attachment:e}=D.useAttachmentItem();return n.jsx(Qn,{children:e.title,...t})},Vn=a.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Ht=t=>{const{onClick:e,...i}=t,r=()=>{};return n.jsx(Vn,{"aria-label":"Remove attachment",children:n.jsx(f.CustomIcon,{iconKey:"close"}),onClick:C.composeEventHandlers(e,r),...i})},wt=a.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Lt=a.ikp(L.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Dt=a.ikp(L.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:n.jsx(f.CustomIcon,{iconKey:"info"})}),oe=a.ikp(L.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),Rt=a.ikp(L.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:n.jsxs(n.Fragment,{children:[n.jsx(oe,{}),"Attachments will be kept in context for the entire conversation."]})}),$n=a.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Ot=t=>{const{children:e,...i}=t,r={supportedInputs:[]};return r?.supportedInputs?n.jsx($n,{children:u.maybeRender(e,r.supportedInputs),...i}):null},Un=a.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),qt=t=>{const{input:e,onClick:i,...r}=t,s={supportedInputs:[]},o=[],d=()=>{},{selectInput:c,onOpen:m}=S.useAttachmentsBar(),l=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return s?e.onInvoke(s,e,d,[...o]):void 0;c(e),m()};return n.jsx(Un,{children:e.displayName,onClick:C.composeEventHandlers(i,l),...r})},Kn=a.ikp(F.Root,{_id:"aiChatAttachmentsBar__Modal"}),Wt=t=>{const{onOpenChange:e,...i}=t,{selectInput:r,isOpen:s,onClose:o,selectedInput:d}=S.useAttachmentsBar(),c=m=>{m||(o(),r(null))};return n.jsx(Kn,{open:s&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...i})},Nt=a.ikp(F.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Qt=a.ikp(F.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Vt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),zn=a.ikp(F.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),$t=t=>{const{selectedInput:e}=S.useAttachmentsBar(),i=`Add ${e?.displayName}`;return n.jsx(zn,{children:i,...t})},Gn=a.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Ut=t=>{const{selectedInput:e}=S.useAttachmentsBar(),i=e?.workflowModalProps?.modalHelpText;return i?n.jsx(Gn,{children:i,...t}):null},Yn=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),Kt=t=>{const{children:e,...i}=t,{selectedInput:r}=S.useAttachmentsBar(),s=r?.workflowModalProps?.modalHelpElement;return s?n.jsx(Yn,{asChild:!e,children:e||s,...i}):null},zt=a.ikp(F.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),Gt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),Jn=a.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),Yt=t=>{const{onSubmit:e,...i}=t,{form:r}=S.useAttachmentsBar();return n.jsx(Jn,{onSubmit:C.composeEventHandlers(e,r.onSubmit),...i})},Jt=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),Xn=a.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),Xt=t=>{const{form:e,selectedInput:i}=S.useAttachmentsBar();return n.jsx(Xn,{htmlFor:`${i?.id}-title`,children:e.labels.title,...t})},Zn=a.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),Zt=t=>{const{onChange:e,...i}=t,{form:r,selectedInput:s}=S.useAttachmentsBar();return n.jsx(Zn,{name:"title",value:r.data.title,id:`${s?.id}-title`,"data-invalid":u.dataAttr(!!r.errors.title),"aria-invalid":!!r.errors.title,onChange:C.composeEventHandlers(e,r.onChange),...i})},er=a.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),ei=t=>{const{form:e}=S.useAttachmentsBar();return e.errors.title?n.jsx(er,{"aria-live":"polite",children:e.errors.title,...t}):null},ti=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),tr=a.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),ii=t=>{const{form:e,selectedInput:i}=S.useAttachmentsBar();return n.jsx(tr,{htmlFor:`${i?.id}-content`,children:e.labels.content,...t})},ir=a.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ai=t=>{const{onChange:e,...i}=t,{form:r,selectedInput:s}=S.useAttachmentsBar();return n.jsx(ir,{asChild:!0,rows:4,name:"content",value:r.data.content,id:`${s?.id}-content`,"data-invalid":u.dataAttr(!!r.errors.content),"aria-invalid":!!r.errors.content,onChange:C.composeEventHandlers(e,r.onChange),...i,children:n.jsx(Z,{maxRows:10})})},ar=a.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),ni=t=>{const{form:e}=S.useAttachmentsBar();return e.errors.content?n.jsx(ar,{"aria-live":"polite",children:e.errors.content,...t}):null},ri=a.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),si=a.ikp("div",{_id:"aiChatActionBar"}),oi=a.ikp("div",{_id:"aiChat__ChatActions"}),di=a.ikp("div",{_id:"aiChatTagline__Container"}),ci=a.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),mi=a.ikp(_a.default,{_id:"aiChatTagline__Logo"}),li=a.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),nr=a.ikp(L.Trigger,{_id:"aiChat__ChatAction"}),U=t=>{const{action:e,onClick:i,className:r,...s}=t,o={},{clear:d,stop:c,isBusy:m,messages:l}=P.useChat(),{conversationId:p}=P.useChat(),{aiChatSettings:g}=b.useInkeepConfig(),[v,A]=J.useCopyToClipboard(),[x]=J.useCopyToClipboard(),E=l.length>0;if({help:!1,copy:!E||!g.isCopyChatButtonVisible||m,share:!E||!g.isShareButtonVisible||!p||!!o||m,clear:!E||g.isViewOnly||m,stop:!m}[e])return null;const O={help:()=>{},copy:()=>{const ce=l.map(N=>{const G=`**${N.role==="assistant"?"AI Assistant":"User"}**`,Y=u.getMessageContent(N);return`${G}
5
+ How can I help?`,b={parts:[{type:"text",text:o.introMessage??`${d}${m}`}],id:Za,...e,role:"assistant"};return r.jsx(ce,{message:b,...i})}),Ar=a.ikp("div",{_id:"aiChatMessageHeader"}),$e=t=>{const{message:e}=_.useMessage();return r.jsx(Ar,{"data-role":e.role,...t})},kr=a.ikp("div",{_id:"aiChatMessageLoading",children:"Thinking..."}),Ue=t=>r.jsx(kr,{...t}),Ir=a.ikp("div",{_id:"aiChatMessageAvatar"}),Ke=t=>{const{message:e}=_.useMessage();return r.jsx(Ir,{"data-role":e.role,...t})},Mr=a.ikp(de.Root,{_id:"aiChatMessageAvatarContent"}),ze=t=>{const{message:e}=_.useMessage(),{baseSettings:i}=g.useInkeepConfig();return r.jsx(Mr,{"data-username":u.dataAttr(e.role==="user"&&!!i.userProperties.name),"data-role":e.role,...t})},fr=a.ikp(de.Fallback,{_id:"aiChatMessageAvatarFallback"}),Ge=l.memo(t=>{const{baseSettings:e}=g.useInkeepConfig(),{message:i}=_.useMessage();return e.userProperties.name?r.jsx(fr,{"data-role":i.role,children:u.getInitials(e.userProperties.name),...t}):null}),he=a.ikp(de.Image,{_id:"aiChatMessageAvatarImage"}),Ye=l.memo(t=>{const{onLoadingStatusChange:e,...i}=t,{aiChatSettings:o,baseSettings:{userProperties:n}}=g.useInkeepConfig(),{message:s}=_.useMessage(),{aiAssistantAvatar:d}=o??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,h=$a.useColorModeValue(c,m),[b,v]=l.useState(h);l.useEffect(()=>{v(h)},[h]);const p=P=>{P==="error"&&v(null)};return s.role==="user"?n.name?null:o.userAvatar?r.jsx(he,{"data-type":"image",alt:"User avatar","data-role":s.role,src:o.userAvatar,...t}):r.jsx(Da.default,{"data-type":"icon","data-role":s.role,...t}):b?r.jsx(he,{src:b,alt:"AI assistant avatar","data-type":"image","data-role":s.role,onLoadingStatusChange:C.composeEventHandlers(e,p),...i}):r.jsx(La.default,{"data-type":"icon","data-role":s.role,...t})}),xr=a.ikp("span",{_id:"aiChatMessageName"}),Je=t=>{const{message:e}=_.useMessage(),{aiChatSettings:i}=g.useInkeepConfig(),{aiAssistantName:o}=i;return r.jsx(xr,{"data-role":e.role,children:e.role==="user"?"You":o||"AI assistant",...t})},Sr=a.ikp("div",{_id:"aiChatMessageContentWrapper"}),Xe=t=>{const{message:e}=_.useMessage();return r.jsx(Sr,{"data-role":e.role,...t})},Br=a.ikp("div",{_id:"aiChatMessageContent"}),Ze=t=>{const{message:e}=_.useMessage();return r.jsx(Br,{"data-role":e.role,...t})},Tr=a.ikp("div",{_id:"aiChatMessageAttachments"}),et=t=>{const{message:e}=_.useMessage(),i=[];return e.role!=="user"||!i?.length?null:r.jsx(U.MessageAttachmentsProvider,{children:r.jsx(Tr,{...t})})},yr=a.ikp("div",{_id:"aiChatMessageAttachments__List"}),tt=t=>{const{children:e,...i}=t,o=[];return o?r.jsx(yr,{children:u.maybeRender(e,o),...i}):null},Hr=a.ikp("div",{_id:"aiChatMessageAttachments__Item"}),it=t=>{const{attachment:e,onClick:i,...o}=t,{selectItem:n,onOpen:s}=U.useMessageAttachments(),d=()=>{n(e),s()};return r.jsx(V.AttachmentItemProvider,{attachment:e,children:r.jsx(Hr,{onClick:C.composeEventHandlers(i,d),...o})})},jr=a.ikp(w.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),at=t=>{const{attachment:e}=V.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?r.jsx(jr,{iconSettings:i,...t}):null},wr=a.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),rt=t=>{const{attachment:e}=V.useAttachmentItem();return r.jsx(wr,{children:e.title,...t})},Lr=a.ikp(A.Root,{_id:"aiChatMessageAttachmentsPreview"}),ot=t=>{const{onOpenChange:e,...i}=t,{selectItem:o,isOpen:n,onClose:s,selectedItem:d}=U.useMessageAttachments(),c=m=>{m||(s(),o(null))};return r.jsx(Lr,{open:n&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...i})},nt=a.ikp(A.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),st=a.ikp(A.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),Dr=a.ikp(A.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),dt=t=>{const{selectedItem:e}=U.useMessageAttachments();return r.jsx(Dr,{children:e?.title||"Attachment",...t})},ct=a.ikp(A.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:r.jsx(x.CustomIcon,{iconKey:"close"})}),Rr=a.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),mt=t=>{const{selectedItem:e}=U.useMessageAttachments();return r.jsx(Rr,{children:e?.content,...t})},lt=t=>{const{text:e,componentStyles:i,...o}=t,{aiChatSettings:n}=g.useInkeepConfig(),{shouldOpenLinksInNewTab:s}=n;return r.jsx(z.Markdown,{children:e,componentStyles:i,shouldOpenLinksInNewTab:s,...o})},ht=({name:t,props:e,componentDef:i})=>{const n=Ga.useShadow()?.shadowHost,s=l.useRef(void 0),d=l.useRef(null),c=l.useRef(null),m=l.useRef(!1),[h,b]=l.useState(!1),[v,p]=l.useState(!1),P=l.useRef(i);l.useMemo(()=>{i!==P.current&&(typeof i=="function"&&typeof P.current=="function"?i.toString()!==P.current.toString()&&(P.current=i):P.current=i)},[i]);const I=P.current,M=l.useRef(e);M.current=e;const f=l.useRef(null),L=l.useRef(I);L.current!==I&&(f.current=null,L.current=I),l.useEffect(()=>{s.current||(s.current=`dyn:${t}:${crypto.randomUUID()}`,b(!0))},[t]),l.useLayoutEffect(()=>{if(!I||!n||!h||!s.current)return;const D=s.current,E=document.createElement("div");return E.setAttribute("data-ikp-component",""),E.setAttribute("data-component",t),E.setAttribute("slot",D),d.current=E,m.current=!1,n.appendChild(E),p(!0),()=>{m.current=!0,p(!1),queueMicrotask(()=>{try{c.current&&(c.current.unmount(),c.current=null)}catch(N){console.debug("Ignoring unmount error:",N)}E.parentNode===n&&E.remove(),d.current=null})}},[I,n,h,t]);const $=D=>{const E=d.current;if(!E||m.current)return;const N=y=>{if(f.current!==null)return f.current;if(typeof y!="function"||y.length>1)return f.current=!1,!1;try{if(y.constructor===Function){const Z=y({});return f.current=l.isValidElement(Z),f.current}return f.current=!1,!1}catch{return f.current=!0,!0}};let T;const R=P.current;if(N(R))try{T=l.createElement(R,D||{})}catch(y){console.error("Error creating React element from component:",y);return}else if(typeof R=="function")T=R(D||{},E,null);else{console.error("Invalid component definition");return}if(l.isValidElement(T)||typeof T=="string"){if(m.current)return;c.current||(c.current=Xa.createRoot(E)),!m.current&&c.current&&c.current.render(T);return}c.current&&!m.current&&c.current.render(null)};return l.useEffect(()=>{$(M.current)},[I,v]),l.useEffect(()=>{!c.current||m.current||$(e)},[e]),r.jsx("slot",{name:s.current})},Or=a.ikp("div",{_id:"aiChatMessagePart"}),qr=a.ikp("div",{_id:"aiChatMessageToolbar"}),ut=t=>{const{isLoading:e,messages:i}=F.useChat(),{message:o}=_.useMessage();return i.at(-1)?.id===o?.id&&e||o.role==="user"?null:r.jsx(qr,{...t})},Wr=a.ikp("div",{_id:"aiChatMessageCustomActions"}),Ct=t=>{const{children:e,...i}=t,{aiChatSettings:o}=g.useInkeepConfig(),{message:n}=_.useMessage(),{isStreaming:s,messages:d}=F.useChat(),c=d.at(-1)?.id===n?.id,m=n.role==="assistant",h=o.messageActions||[];return c&&s||!m?null:r.jsx(Wr,{children:u.maybeRender(e,h),...i})},Nr=a.ikp("a",{_id:"aiChatMessageCustomAction"}),Vr=a.ikp("button",{_id:"aiChatMessageCustomAction"}),bt=t=>{const{onClick:e,action:i,...o}=t,{message:n}=_.useMessage(),{handleAction:s}=re.useChatAction(i,n.id),{logEvent:d}=se.useBaseEvents(),{conversationId:c}=F.useChat(),m=()=>{s(),d({eventName:"user_escalation_indicated",properties:{escalationType:"contact_us",conversationId:c}})},h=i.label,b=r.jsxs(r.Fragment,{children:[i.icon&&r.jsx(w.BuiltInIconRenderer,{iconSettings:i.icon}),h]});return i.action.type==="open_link"?r.jsx(Nr,{href:i.action.url,target:"_blank",rel:"noopener","data-type":i.action.type,onClick:C.composeEventHandlers(e,m),children:b,...o}):r.jsx(Vr,{"data-type":i.action.type,onClick:C.composeEventHandlers(e,m),children:b,...o})},Qr=a.ikp("button",{_id:"aiChatMessageAction"}),pt=t=>{const{action:e,onClick:i,className:o,...n}=t,{conversationId:s}=F.useChat(),{baseSettings:{onFeedback:d}}=g.useInkeepConfig(),{message:c}=_.useMessage(),{isStreaming:m,messages:h}=F.useChat(),[b,v]=ee.useCopyToClipboard(),{feedback:p,submitPositiveFeedback:P,setCurrentFeedback:I,currentFeedback:M}=ae.useMessageFeedback(),{logEvent:f}=se.useBaseEvents(),[L,$]=qa.useSettleAction(),D=h.at(-1)?.id===c?.id,E=c.role==="assistant";if(D&&m||!E)return null;const T={copy(){v(u.getMessageContent(c)),f({eventName:"assistant_message_copied",properties:{conversationId:s}})},upvote(){P(c.id).then(()=>{$()})},downvote(){I(c.id)}},R={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},y={copy:r.jsx(x.CustomIcon,{iconKey:b?"messageCopied":"messageCopy"}),upvote:r.jsx(x.CustomIcon,{iconKey:L?"messageCopied":"thumbsUp"}),downvote:r.jsx(x.CustomIcon,{iconKey:"thumbsDown"})},Z={copy:{"data-copied":u.dataAttr(b)},upvote:{"data-upvoted":u.dataAttr(p[c.id]?.type==="positive")},downvote:{"data-downvoted":u.dataAttr(p[c.id]?.type==="negative"),"data-state":M===null?"closed":"open"}};return{copy:!1,upvote:!d,downvote:!d}[e]?null:r.jsx(Qr,{"data-action":e,...Z[e],children:y[e],"aria-label":R[e],className:`${o} ${e}`,onClick:C.composeEventHandlers(i,T[e]),...n})},$r=a.ikp("div",{_id:"aiChatMessageSources"}),vt=t=>{const{message:e}=_.useMessage();return e.role!=="assistant"||!e.parts.filter(o=>o.type==="data-artifact"&&o.data?.type?.toLowerCase()==="citation")?.length?null:r.jsx($r,{...t})},Ur=a.ikp("div",{_id:"aiChatMessageSources__Header"}),gt=t=>r.jsx(Ur,{children:"Sources",...t}),Kr=a.ikp("div",{_id:"aiChatMessageSources__List"}),Pt=t=>{const{message:e}=_.useMessage(),{children:i,...o}=t,{baseSettings:{transformSource:n,organizationDisplayName:s},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=g.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.parts.filter(v=>v.type==="data-artifact"&&v.data?.type?.toLowerCase()==="citation");if(!m?.length)return null;const h=new Map,b=m.filter(v=>{const p=v.data.artifactSummary.url;return!p||h.has(p)?!1:(h.set(p,!0),!0)}).map(v=>{const p=v.data,P={id:p?.artifactId,title:p?.artifactSummary?.title||p?.name,url:p?.artifactSummary?.url||"",description:"",breadcrumbs:[],type:p?.artifactSummary?.record_type,contentType:p?.artifactType,tag:p?.artifactType},M=(n??(L=>({...L,shouldOpenInNewTab:d,icon:Ya.getIcon(L)})))(P,"chatSourceItem",{organizationDisplayName:s,tabs:c}),f=M.shouldOpenInNewTab!==void 0?M.shouldOpenInNewTab:d;return{...M,isExternal:f}});return r.jsx(Kr,{children:u.maybeRender(i,b),...o})},zr=a.ikp(Ra.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),Ft=t=>{const{source:e,onClick:i,...o}=t,{logEvent:n}=se.useBaseEvents(),{conversationId:s}=F.useChat(),d=()=>{n({eventName:"assistant_source_item_clicked",properties:{conversationId:s,link:e}})};return r.jsx(O.SourceItemProvider,{source:e,children:r.jsx(zr,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:C.composeEventHandlers(i,d),...o})})},Gr=a.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),_t=t=>{const{source:e}=O.useSourceItem();return e.breadcrumbs?.length?r.jsx(Gr,{"data-type":e.type,...t}):null},Yr=a.ikp(x.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),Jr=a.ikp(w.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),Et=t=>{const{source:e}=O.useSourceItem();return r.jsx(Jr,{iconSettings:e.icon,"data-type":e.type,...t})},Xr=a.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),At=t=>{const{source:e}=O.useSourceItem();return r.jsx(Xr,{"data-type":e.type,children:e.title,...t})},Zr=a.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),kt=t=>{const{source:e}=O.useSourceItem();return r.jsx(Zr,{"data-type":e.type,...t})},eo=a.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),It=t=>{const{source:e}=O.useSourceItem(),{children:i,...o}=t,n=l.useMemo(()=>e.description?Va.highlightEmphasis(e.description):[],[e.description]);return n.length?r.jsx(eo,{"data-type":e.type,children:u.maybeRender(i,n),...o}):null},to=a.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),Mt=t=>{const{part:e,...i}=t,{source:o}=O.useSourceItem();return typeof e=="string"?e:r.jsx(to,{"data-type":o.type,children:e.content,"data-highlighted":u.dataAttr(e.highlighted),...i})},io=a.ikp(x.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),ft=t=>{const{source:e}=O.useSourceItem();return r.jsx(io,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},xt=a.ikp("div",{_id:"aiChatFooter"}),St=a.ikp("div",{_id:"aiChatInput__Fieldset"}),Bt=a.ikp("div",{_id:"aiChatInput__Group"}),ao=a.ikp("textarea",{_id:"aiChatInput"}),Tt=l.forwardRef(({onChange:t,onKeyDown:e,...i},o)=>{const{handleInputChange:n,handleInputKeyDown:s,input:d,error:c,shouldAutoFocusInput:m,inputRef:h}=F.useChat(),{aiChatSettings:b}=g.useInkeepConfig(),v=oe.useComposedRefs(o,h);return za.useWidgetAutoFocus("chat",h,m),r.jsx(ao,{asChild:!0,ref:v,maxLength:99999,placeholder:b.placeholder,value:d,onChange:C.composeEventHandlers(t,n),onKeyDown:C.composeEventHandlers(e,s),disabled:!!c||b.isViewOnly,...i,children:r.jsx(ie,{})})}),ro=a.ikp("button",{_id:"aiChatInput__SendButton"}),yt=t=>{const{handleSubmit:e,isSubmitDisabled:i,error:o}=F.useChat(),{aiChatSettings:n}=g.useInkeepConfig(),{onClick:s,...d}=t;return r.jsx(ro,{onClick:C.composeEventHandlers(s,()=>e()),"aria-label":"Send message",disabled:i||!!o||n.isViewOnly,...d})},Ht=a.ikp(x.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),oo=a.ikp("div",{_id:"aiChatAttachmentsBar"}),jt=t=>{const e={supportedInputs:[]};return!e||!e.supportedInputs?.length?null:r.jsx(B.AttachmentsBarProvider,{children:r.jsx(oo,{...t})})},no=a.ikp("div",{_id:"aiChatAttachmentsBar__List"}),wt=t=>{const{children:e,...i}=t,o=[];return r.jsx(no,{children:u.maybeRender(e,o),...i})},so=a.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),Lt=t=>{const{attachment:e,...i}=t;return r.jsx(V.AttachmentItemProvider,{attachment:e,children:r.jsx(so,{...i})})},co=a.ikp(w.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),Dt=t=>{const{attachment:e}=V.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?r.jsx(co,{iconSettings:i,...t}):null},mo=a.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),Rt=t=>{const{attachment:e}=V.useAttachmentItem();return r.jsx(mo,{children:e.title,...t})},lo=a.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Ot=t=>{const{onClick:e,...i}=t,o=()=>{};return r.jsx(lo,{"aria-label":"Remove attachment",children:r.jsx(x.CustomIcon,{iconKey:"close"}),onClick:C.composeEventHandlers(e,o),...i})},qt=a.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Wt=a.ikp(W.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Nt=a.ikp(W.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:r.jsx(x.CustomIcon,{iconKey:"info"})}),me=a.ikp(W.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),Vt=a.ikp(W.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:r.jsxs(r.Fragment,{children:[r.jsx(me,{}),"Attachments will be kept in context for the entire conversation."]})}),ho=a.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Qt=t=>{const{children:e,...i}=t,o={supportedInputs:[]};return o?.supportedInputs?r.jsx(ho,{children:u.maybeRender(e,o.supportedInputs),...i}):null},uo=a.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),$t=t=>{const{input:e,onClick:i,...o}=t,n={supportedInputs:[]},s=[],d=()=>{},{selectInput:c,onOpen:m}=B.useAttachmentsBar(),h=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return n?e.onInvoke(n,e,d,[...s]):void 0;c(e),m()};return r.jsx(uo,{children:e.displayName,onClick:C.composeEventHandlers(i,h),...o})},Co=a.ikp(A.Root,{_id:"aiChatAttachmentsBar__Modal"}),Ut=t=>{const{onOpenChange:e,...i}=t,{selectInput:o,isOpen:n,onClose:s,selectedInput:d}=B.useAttachmentsBar(),c=m=>{m||(s(),o(null))};return r.jsx(Co,{open:n&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...i})},Kt=a.ikp(A.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),zt=a.ikp(A.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Gt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),bo=a.ikp(A.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),Yt=t=>{const{selectedInput:e}=B.useAttachmentsBar(),i=`Add ${e?.displayName}`;return r.jsx(bo,{children:i,...t})},po=a.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Jt=t=>{const{selectedInput:e}=B.useAttachmentsBar(),i=e?.workflowModalProps?.modalHelpText;return i?r.jsx(po,{children:i,...t}):null},vo=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),Xt=t=>{const{children:e,...i}=t,{selectedInput:o}=B.useAttachmentsBar(),n=o?.workflowModalProps?.modalHelpElement;return n?r.jsx(vo,{asChild:!e,children:e||n,...i}):null},Zt=a.ikp(A.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:r.jsx(x.CustomIcon,{iconKey:"close"})}),ei=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),go=a.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),ti=t=>{const{onSubmit:e,...i}=t,{form:o}=B.useAttachmentsBar();return r.jsx(go,{onSubmit:C.composeEventHandlers(e,o.onSubmit),...i})},ii=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),Po=a.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),ai=t=>{const{form:e,selectedInput:i}=B.useAttachmentsBar();return r.jsx(Po,{htmlFor:`${i?.id}-title`,children:e.labels.title,...t})},Fo=a.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ri=t=>{const{onChange:e,...i}=t,{form:o,selectedInput:n}=B.useAttachmentsBar();return r.jsx(Fo,{name:"title",value:o.data.title,id:`${n?.id}-title`,"data-invalid":u.dataAttr(!!o.errors.title),"aria-invalid":!!o.errors.title,onChange:C.composeEventHandlers(e,o.onChange),...i})},_o=a.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),oi=t=>{const{form:e}=B.useAttachmentsBar();return e.errors.title?r.jsx(_o,{"aria-live":"polite",children:e.errors.title,...t}):null},ni=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),Eo=a.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),si=t=>{const{form:e,selectedInput:i}=B.useAttachmentsBar();return r.jsx(Eo,{htmlFor:`${i?.id}-content`,children:e.labels.content,...t})},Ao=a.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),di=t=>{const{onChange:e,...i}=t,{form:o,selectedInput:n}=B.useAttachmentsBar();return r.jsx(Ao,{asChild:!0,rows:4,name:"content",value:o.data.content,id:`${n?.id}-content`,"data-invalid":u.dataAttr(!!o.errors.content),"aria-invalid":!!o.errors.content,onChange:C.composeEventHandlers(e,o.onChange),...i,children:r.jsx(ie,{maxRows:10})})},ko=a.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),ci=t=>{const{form:e}=B.useAttachmentsBar();return e.errors.content?r.jsx(ko,{"aria-live":"polite",children:e.errors.content,...t}):null},mi=a.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),li=a.ikp("div",{_id:"aiChatActionBar"}),hi=a.ikp("div",{_id:"aiChat__ChatActions"}),ui=a.ikp("div",{_id:"aiChatTagline__Container"}),Ci=a.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),bi=a.ikp(Oa.default,{_id:"aiChatTagline__Logo"}),pi=a.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),Io=a.ikp(W.Trigger,{_id:"aiChat__ChatAction"}),J=t=>{const{action:e,onClick:i,className:o,...n}=t,s={},{clear:d,stop:c,isBusy:m,messages:h}=F.useChat(),{conversationId:b}=F.useChat(),{aiChatSettings:v}=g.useInkeepConfig(),[p,P]=ee.useCopyToClipboard(),[I]=ee.useCopyToClipboard(),M=h.length>0;if({help:!1,copy:!M||!v.isCopyChatButtonVisible||m,share:!M||!v.isShareButtonVisible||!b||!!s||m,clear:!M||v.isViewOnly||m,stop:!m}[e])return null;const D={help:()=>{},copy:()=>{const N=h.map(T=>{const R=`**${T.role==="assistant"?"AI Assistant":"User"}**`,y=u.getMessageContent(T);return`${R}
6
6
 
7
- ${Y}`}).join(`
7
+ ${y}`}).join(`
8
8
 
9
9
  ---
10
10
 
11
- `);A(ce)},share:async()=>{},clear:d,stop:c},z={copy:v,share:x};return n.jsx(L.Tooltip,{delayDuration:0,open:z[e],children:n.jsx(nr,{"data-type":e,"data-copied":u.dataAttr(v||x),className:`${r} ${e}`,children:n.jsx(de,{action:e}),onClick:C.composeEventHandlers(i,O[e]),...s})})},rr=a.ikp("span",{_id:"aiChat__ChatActionLabel"}),de=t=>{const{action:e,...i}=t,{aiChatSettings:r}=b.useInkeepConfig(),s=r.toolbarButtonLabels??{},o={help:s.getHelp??"Get Help",copy:s.copyChat??"Copy",share:s.share??"Share",clear:s.clear??"Clear",stop:s.stop??"Stop"};return n.jsx(rr,{children:o[e],...i})},sr=a.ikp(L.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),hi=t=>{const{action:e,children:i,...r}=t,s={copy:"Copied!",share:"Link copied!"};return n.jsxs(sr,{sideOffset:5,...r,children:[n.jsx(L.Arrow,{}),i||s[e]]})},or=a.ikp(w.Root,{_id:"aiChatHelpActions"}),ui=t=>{const{children:e,...i}=t,{aiChatSettings:r}=b.useInkeepConfig(),{getHelpOptions:s}=r;if(!s||(s??[]).length===0)return null;const{_pinned:o,_unpinned:d}=s.reduce((p,g)=>{const v=g.isPinnedToToolbar?"_pinned":"_unpinned";return{...p,[v]:[...p[v],g]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...o,d[0]]:o,m=d.length===1?[]:d,l=X.useHelpMenuState();return n.jsx(X.HelpMenuProvider,{value:l,children:n.jsx(or,{open:l.open,onOpenChange:l.setOpen,children:u.maybeRender(e,{pinned:c,unpinned:m}),...i})})},dr=a.ikp(U,{_id:"aiChatHelpAction",action:"help"}),cr=a.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),Ci=t=>{const{action:e,onClick:i,...r}=t,{handleAction:s,logHelpAction:o}=te.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:C.composeEventHandlers(i,()=>{s(),o()}),...r};return d==="open_link"?n.jsx(cr,{href:e.action.url,...c}):n.jsx(dr,{...c})},mr=a.ikp(w.Trigger,{_id:"aiChatHelpActions__Trigger"}),pi=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig();return n.jsx(U,{action:"help",...t,asChild:!0,children:n.jsx(mr,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),lr=a.ikp(w.Content,{_id:"aiChatHelpActions__Menu"}),vi=t=>n.jsx(lr,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),bi=a.ikp(w.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),gi=t=>{const{action:e,onClick:i,...r}=t,{handleAction:s,logHelpAction:o}=te.useChatAction(e),{setOpen:d}=X.useHelpMenu(),c=()=>{s({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:C.composeEventHandlers(i,c)});return n.jsx(l,{...r})},hr=a.ikp(T.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Pi=t=>{const{action:e,...i}=t;return e.icon?n.jsx(hr,{iconSettings:e.icon,...i}):null},ur=a.ikp(F.Root,{_id:"aiChatFeedbackModal"}),Ai=t=>{const{onOpenChange:e,...i}=t,{currentFeedback:r,setCurrentFeedback:s}=ee.useMessageFeedback();return n.jsx(ur,{open:r!==null,onOpenChange:C.composeEventHandlers(e,()=>s(null)),...i})},_i=a.ikp(F.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),Ei=a.ikp(F.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Fi=a.ikp(F.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),ki=a.ikp(F.Close,{_id:"aiChatFeedbackModal__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),Ii=a.ikp("div",{_id:"aiChatFeedbackModal__Body"}),Cr=a.ikp("form",{_id:"aiChatFeedbackForm"}),Mi=t=>{const{onSubmit:e,...i}=t,{submitNegativeFeedback:r,currentFeedback:s,setCurrentFeedback:o}=ee.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,l=new FormData(m),p=Object.fromEntries(l.entries());s&&(r(s,p),o(null))};return n.jsx(Cr,{onSubmit:C.composeEventHandlers(e,d),...i})},pr=a.ikp("div",{_id:"aiChatFeedbackItem"}),fi=t=>{const{name:e,...i}=t;return n.jsx(V.FeedbackItemProvider,{name:e,children:n.jsx(pr,{...i})})},vr=a.ikp($.Root,{_id:"aiChatFeedbackItem__Checkbox"}),Si=t=>{const{name:e,focusItem:i}=V.useFeedbackItem(),{onCheckedChange:r,...s}=t,o=d=>{d&&i?.current?.focus()};return n.jsx(vr,{id:`feedback-${e}`,name:e,onCheckedChange:C.composeEventHandlers(r,o),...s})},xi=a.ikp($.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:n.jsx(le.CheckboxIcon,{})}),br=a.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Bi=t=>{const{name:e}=V.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(br,{htmlFor:`feedback-${e}`,children:i[e],...t})},gr=a.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),yi=t=>{const{name:e,focusItem:i}=V.useFeedbackItem();return n.jsx(gr,{ref:i,name:`${e}:description`,...t})},Ti=a.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),Pr=a.ikp("div",{_id:"aiChatForm__Wrapper"}),ji=t=>{const{form:e}=k.useChatForm();return e?n.jsx(Pr,{...t}):null},Ar=a.ikp("form",{_id:"aiChatForm"}),Hi=t=>{const{onSubmit:e,...i}=t,{conversationId:r,messages:s}=P.useChat(),{handleSubmit:o,isSuccess:d}=k.useChatForm();return d?null:n.jsx(Ar,{onSubmit:C.composeEventHandlers(e,c=>o(c,{id:r,messages:s})),...i})},_r=a.ikp("button",{_id:"aiChatForm__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),wi=t=>{const{onClick:e,...i}=t,{closeForm:r}=k.useChatForm();return n.jsx(_r,{onClick:C.composeEventHandlers(e,r),...i})},Li=a.ikp("div",{_id:"aiChatForm__Header"}),Er=a.ikp("h2",{_id:"aiChatForm__Heading"}),Di=t=>{const{form:e}=k.useChatForm();return e?.heading?n.jsx(Er,{children:e.heading,...t}):null},Fr=a.ikp(Q.Markdown,{_id:"aiChatForm__Description"}),Ri=t=>{const{form:e}=k.useChatForm();return e?.description?n.jsx(Fr,{children:e.description,...t}):null},kr=a.ikp("div",{_id:"aiChatForm__Content"}),Oi=t=>{const{children:e,...i}=t,{getFields:r}=k.useChatForm(),{conversationId:s}=P.useChat(),o=r(s)||[];return n.jsx(kr,{children:u.maybeRender(e,o),...i})},Ir=a.ikp("div",{_id:"aiChatForm__Field"}),qi=t=>{const{field:e,autoFocus:i,...r}=t,{control:s,errors:o}=k.useChatForm();return n.jsx(ka.Controller,{name:e.name,control:s,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(H.FormFieldProvider,{"data-invalid":u.dataAttr(!!o[e.name]),field:e,fieldProps:d,autoFocus:i,children:c&&n.jsx(Ir,{"data-input-type":e.inputType,"data-hidden":u.dataAttr(e.isHidden),...r})})}})},Mr=a.ikp("label",{_id:"aiChatForm__FieldLabel"}),Wi=t=>{const{field:e}=H.useFormField();return n.jsx(Mr,{"data-required":u.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},fr=a.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),K=t=>{const{field:e,error:i,fieldProps:{onChange:r,onBlur:s,...o},autoFocus:d}=H.useFormField(),{onChange:c,onBlur:m,...l}=t;return n.jsx(fr,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":u.dataAttr(!!i),onChange:C.composeEventHandlers(c,r),onBlur:C.composeEventHandlers(m,s),...o,...l})},Ni=a.ikp(K,{_id:"aiChatForm__FieldEmail",type:"email"}),Sr=a.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Qi=t=>{const{field:e,error:i,fieldProps:{value:r,onChange:s,onBlur:o,...d},autoFocus:c}=H.useFormField(),{onChange:m,onBlur:l,...p}=t,g=v=>{const A=v.target.files;s(A)};return n.jsx(Sr,{id:e.name,autoFocus:c,"data-value":r,"data-invalid":u.dataAttr(!!i),...p,...d,onChange:C.composeEventHandlers(m,g),onBlur:C.composeEventHandlers(l,o)})},Vi=a.ikp(K,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:n.jsx(Z,{maxRows:8})}),xr=a.ikp($.Root,{_id:"aiChatForm__FieldCheckbox"}),$i=t=>{const{field:e,error:i,fieldProps:r,autoFocus:s}=H.useFormField(),{onCheckedChange:o,...d}=t;return n.jsx(xr,{id:e.name,name:e.name,autoFocus:s,"data-invalid":u.dataAttr(!!i),checked:r.value,onCheckedChange:C.composeEventHandlers(o,r.onChange),...d})},Ui=a.ikp($.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:n.jsx(le.CheckboxIcon,{})}),Br=a.ikp(y.Root,{_id:"aiChatForm__FieldSelect"}),Ki=t=>{const{field:e,error:i,fieldProps:r}=H.useFormField(),{onValueChange:s,...o}=t;return n.jsx(Br,{name:e.name,"data-invalid":u.dataAttr(!!i),value:r.value,onValueChange:C.composeEventHandlers(s,r.onChange),...o})},zi=a.ikp(y.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),yr=a.ikp(y.Value,{_id:"aiChatForm__FieldSelect__Value"}),Gi=t=>{const{field:e}=H.useFormField();return n.jsx(yr,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},Yi=a.ikp(y.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:n.jsx(T.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),Ji=a.ikp(y.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),Xi=a.ikp(y.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),Zi=a.ikp(y.Item,{_id:"aiChatForm__FieldSelect__Item"}),ea=a.ikp(y.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),ta=a.ikp(y.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:n.jsx(T.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),Tr=a.ikp("span",{_id:"aiChatForm__FieldError"}),ia=t=>{const{error:e}=H.useFormField();return e?n.jsx(Tr,{children:e.message?.toString(),...t}):null},jr=a.ikp("span",{_id:"aiChatForm__Error"}),aa=t=>{const{formError:e}=k.useChatForm();return e?n.jsx(jr,{children:e.message,...t}):null},na=a.ikp("div",{_id:"aiChatForm__Footer"}),Hr=a.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel",type:"button"}),ra=t=>{const{onClick:e,...i}=t,{closeForm:r}=k.useChatForm();return n.jsx(Hr,{onClick:C.composeEventHandlers(e,r),...i})},wr=a.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),sa=t=>{const{onClick:e,...i}=t,{isSubmitting:r,form:s}=k.useChatForm(),o=s?.buttons.submit.label||"Submit";return n.jsx(wr,{disabled:r,...i,children:o})},Lr=a.ikp("div",{_id:"aiChatForm__Success"}),oa=t=>{const{isSuccess:e}=k.useChatForm();return e?n.jsx(Lr,{...t}):null},Dr=a.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),da=t=>{const{form:e}=k.useChatForm();return n.jsx(Dr,{children:e?.successView?.heading,...t})},Rr=a.ikp(Q.Markdown,{_id:"aiChatForm__SuccessMessage"}),ca=t=>{const{form:e}=k.useChatForm();return n.jsx(Rr,{children:e?.successView?.message,...t})},Or=a.ikp("button",{_id:"aiChatForm__SuccessButton"}),ma=t=>{const{onClick:e,...i}=t,{form:r,closeForm:s}=k.useChatForm(),o=r?.successView?.doneButton;if(!o)return null;const d=o.icon&&n.jsx(T.BuiltInIconRenderer,{iconSettings:o.icon}),c=o.label;return n.jsx(Or,{onClick:C.composeEventHandlers(e,s),children:n.jsxs(n.Fragment,{children:[d,c]}),...i})};exports.Provider=P.ChatProvider;exports.ActionBar=si;exports.Actions=oi;exports.AttachmentsBar=xt;exports.AttachmentsBarActions=wt;exports.AttachmentsBarAttachment=yt;exports.AttachmentsBarAttachmentDelete=Ht;exports.AttachmentsBarAttachmentIcon=Tt;exports.AttachmentsBarAttachmentTitle=jt;exports.AttachmentsBarForm=Yt;exports.AttachmentsBarFormContent=ti;exports.AttachmentsBarFormContentError=ni;exports.AttachmentsBarFormContentInput=ai;exports.AttachmentsBarFormContentLabel=ii;exports.AttachmentsBarFormSubmitButton=ri;exports.AttachmentsBarFormTitle=Jt;exports.AttachmentsBarFormTitleError=ei;exports.AttachmentsBarFormTitleInput=Zt;exports.AttachmentsBarFormTitleLabel=Xt;exports.AttachmentsBarInfoTip=Lt;exports.AttachmentsBarInfoTipArrow=oe;exports.AttachmentsBarInfoTipIcon=Dt;exports.AttachmentsBarInfoTipText=Rt;exports.AttachmentsBarInput=qt;exports.AttachmentsBarInputs=Ot;exports.AttachmentsBarList=Bt;exports.AttachmentsBarModal=Wt;exports.AttachmentsBarModalBody=Gt;exports.AttachmentsBarModalClose=zt;exports.AttachmentsBarModalContent=Qt;exports.AttachmentsBarModalDescription=Ut;exports.AttachmentsBarModalHeader=Vt;exports.AttachmentsBarModalHeading=$t;exports.AttachmentsBarModalHelp=Kt;exports.AttachmentsBarModalOverlay=Nt;exports.ChatAction=U;exports.ChatActionFeedback=hi;exports.ChatActionLabel=de;exports.ChatHelpAction=Ci;exports.Content=be;exports.ContentScrollArea=ge;exports.ContentScrollAreaCorner=Ee;exports.ContentScrollAreaScrollbar=Ae;exports.ContentScrollAreaThumb=_e;exports.ContentScrollAreaViewport=Pe;exports.Disclaimer=ke;exports.DisclaimerArrow=xe;exports.DisclaimerContent=fe;exports.DisclaimerLabel=Ie;exports.DisclaimerText=Se;exports.DisclaimerTrigger=Me;exports.DynamicComponent=ot;exports.EmbeddedChatPrimitiveActionBar=si;exports.EmbeddedChatPrimitiveActions=oi;exports.EmbeddedChatPrimitiveAttachmentsBar=xt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=wt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=yt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Ht;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=Tt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=jt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=ti;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=ni;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=ai;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=ii;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=ei;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=oe;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarInput=qt;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarList=Bt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=Gt;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=$t;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=Nt;exports.EmbeddedChatPrimitiveChatAction=U;exports.EmbeddedChatPrimitiveChatActionFeedback=hi;exports.EmbeddedChatPrimitiveChatActionLabel=de;exports.EmbeddedChatPrimitiveChatHelpAction=Ci;exports.EmbeddedChatPrimitiveContent=be;exports.EmbeddedChatPrimitiveContentScrollArea=ge;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Ee;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Ae;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=_e;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=Pe;exports.EmbeddedChatPrimitiveDisclaimer=ke;exports.EmbeddedChatPrimitiveDisclaimerArrow=xe;exports.EmbeddedChatPrimitiveDisclaimerContent=fe;exports.EmbeddedChatPrimitiveDisclaimerLabel=Ie;exports.EmbeddedChatPrimitiveDisclaimerText=Se;exports.EmbeddedChatPrimitiveDisclaimerTrigger=Me;exports.EmbeddedChatPrimitiveDynamicComponent=ot;exports.EmbeddedChatPrimitiveExampleQuestion=je;exports.EmbeddedChatPrimitiveExampleQuestionButton=He;exports.EmbeddedChatPrimitiveExampleQuestions=Be;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=ye;exports.EmbeddedChatPrimitiveExampleQuestionsList=Te;exports.EmbeddedChatPrimitiveFeedbackForm=Mi;exports.EmbeddedChatPrimitiveFeedbackItem=fi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=Si;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=xi;exports.EmbeddedChatPrimitiveFeedbackItemDescription=yi;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Bi;exports.EmbeddedChatPrimitiveFeedbackModal=Ai;exports.EmbeddedChatPrimitiveFeedbackModalBody=Ii;exports.EmbeddedChatPrimitiveFeedbackModalClose=ki;exports.EmbeddedChatPrimitiveFeedbackModalContent=Ei;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Fi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=_i;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Ti;exports.EmbeddedChatPrimitiveFooter=Ft;exports.EmbeddedChatPrimitiveForm=Hi;exports.EmbeddedChatPrimitiveFormCancel=ra;exports.EmbeddedChatPrimitiveFormClose=wi;exports.EmbeddedChatPrimitiveFormContent=Oi;exports.EmbeddedChatPrimitiveFormDescription=Ri;exports.EmbeddedChatPrimitiveFormError=aa;exports.EmbeddedChatPrimitiveFormField=qi;exports.EmbeddedChatPrimitiveFormFieldCheckbox=$i;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Ui;exports.EmbeddedChatPrimitiveFormFieldEmail=Ni;exports.EmbeddedChatPrimitiveFormFieldError=ia;exports.EmbeddedChatPrimitiveFormFieldFile=Qi;exports.EmbeddedChatPrimitiveFormFieldLabel=Wi;exports.EmbeddedChatPrimitiveFormFieldSelect=Ki;exports.EmbeddedChatPrimitiveFormFieldSelectContent=Ji;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=Yi;exports.EmbeddedChatPrimitiveFormFieldSelectItem=Zi;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=ta;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=ea;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=zi;exports.EmbeddedChatPrimitiveFormFieldSelectValue=Gi;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=Xi;exports.EmbeddedChatPrimitiveFormFieldText=K;exports.EmbeddedChatPrimitiveFormFieldTextArea=Vi;exports.EmbeddedChatPrimitiveFormFooter=na;exports.EmbeddedChatPrimitiveFormHeader=Li;exports.EmbeddedChatPrimitiveFormHeading=Di;exports.EmbeddedChatPrimitiveFormSubmit=sa;exports.EmbeddedChatPrimitiveFormSuccess=oa;exports.EmbeddedChatPrimitiveFormSuccessButton=ma;exports.EmbeddedChatPrimitiveFormSuccessHeading=da;exports.EmbeddedChatPrimitiveFormSuccessMessage=ca;exports.EmbeddedChatPrimitiveFormWrapper=ji;exports.EmbeddedChatPrimitiveHeaderToolbar=Ce;exports.EmbeddedChatPrimitiveHelpActions=ui;exports.EmbeddedChatPrimitiveHelpActionsMenu=vi;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=bi;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=gi;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Pi;exports.EmbeddedChatPrimitiveHelpActionsTrigger=pi;exports.EmbeddedChatPrimitiveInput=Mt;exports.EmbeddedChatPrimitiveInputFieldset=kt;exports.EmbeddedChatPrimitiveInputGroup=It;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Oe;exports.EmbeddedChatPrimitiveMarkdown=st;exports.EmbeddedChatPrimitiveMessageAction=lt;exports.EmbeddedChatPrimitiveMessageAttachments=Ge;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=Je;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=Xe;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=Ze;exports.EmbeddedChatPrimitiveMessageAttachmentsList=Ye;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=et;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=it;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=at;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=tt;exports.EmbeddedChatPrimitiveMessageAvatar=Ne;exports.EmbeddedChatPrimitiveMessageAvatarContent=Qe;exports.EmbeddedChatPrimitiveMessageAvatarFallback=Ve;exports.EmbeddedChatPrimitiveMessageAvatarImage=$e;exports.EmbeddedChatPrimitiveMessageContent=ze;exports.EmbeddedChatPrimitiveMessageContentWrapper=Ke;exports.EmbeddedChatPrimitiveMessageCustomAction=mt;exports.EmbeddedChatPrimitiveMessageCustomActions=ct;exports.EmbeddedChatPrimitiveMessageHeader=qe;exports.EmbeddedChatPrimitiveMessageLoading=We;exports.EmbeddedChatPrimitiveMessageName=Ue;exports.EmbeddedChatPrimitiveMessageSourceItem=pt;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=vt;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=At;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=_t;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=bt;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=Et;exports.EmbeddedChatPrimitiveMessageSourceItemTag=Pt;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=gt;exports.EmbeddedChatPrimitiveMessageSources=ht;exports.EmbeddedChatPrimitiveMessageSourcesHeader=ut;exports.EmbeddedChatPrimitiveMessageSourcesList=Ct;exports.EmbeddedChatPrimitiveMessageToolbar=dt;exports.EmbeddedChatPrimitiveMessageWrapper=se;exports.EmbeddedChatPrimitiveMessages=Fe;exports.EmbeddedChatPrimitiveRoot=ue;exports.EmbeddedChatPrimitiveSendButton=ft;exports.EmbeddedChatPrimitiveSendButtonIcon=St;exports.EmbeddedChatPrimitiveTaglineBrandName=li;exports.EmbeddedChatPrimitiveTaglineContainer=di;exports.EmbeddedChatPrimitiveTaglineLogo=mi;exports.EmbeddedChatPrimitiveTaglineText=ci;exports.EmbeddedChatPrimitiveToolbarHeader=ve;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=pe;exports.EmbeddedChatPrimitiveWorkflow=Re;exports.EmbeddedChatPrimitiveWorkflows=we;exports.EmbeddedChatPrimitiveWorkflowsLabel=Le;exports.EmbeddedChatPrimitiveWorkflowsList=De;exports.EmbeddedChatPrimitiveWrapper=he;exports.ExampleQuestion=je;exports.ExampleQuestionButton=He;exports.ExampleQuestions=Be;exports.ExampleQuestionsLabel=ye;exports.ExampleQuestionsList=Te;exports.FeedbackForm=Mi;exports.FeedbackItem=fi;exports.FeedbackItemCheckbox=Si;exports.FeedbackItemCheckboxIndicator=xi;exports.FeedbackItemDescription=yi;exports.FeedbackItemLabel=Bi;exports.FeedbackModal=Ai;exports.FeedbackModalBody=Ii;exports.FeedbackModalClose=ki;exports.FeedbackModalContent=Ei;exports.FeedbackModalHeader=Fi;exports.FeedbackModalOverlay=_i;exports.FeedbackSubmitButton=Ti;exports.Footer=Ft;exports.Form=Hi;exports.FormCancel=ra;exports.FormClose=wi;exports.FormContent=Oi;exports.FormDescription=Ri;exports.FormError=aa;exports.FormField=qi;exports.FormFieldCheckbox=$i;exports.FormFieldCheckboxIndicator=Ui;exports.FormFieldEmail=Ni;exports.FormFieldError=ia;exports.FormFieldFile=Qi;exports.FormFieldLabel=Wi;exports.FormFieldSelect=Ki;exports.FormFieldSelectContent=Ji;exports.FormFieldSelectIcon=Yi;exports.FormFieldSelectItem=Zi;exports.FormFieldSelectItemIndicator=ta;exports.FormFieldSelectItemText=ea;exports.FormFieldSelectTrigger=zi;exports.FormFieldSelectValue=Gi;exports.FormFieldSelectViewport=Xi;exports.FormFieldText=K;exports.FormFieldTextArea=Vi;exports.FormFooter=na;exports.FormHeader=Li;exports.FormHeading=Di;exports.FormSubmit=sa;exports.FormSuccess=oa;exports.FormSuccessButton=ma;exports.FormSuccessHeading=da;exports.FormSuccessMessage=ca;exports.FormWrapper=ji;exports.Header=Da;exports.HeaderToolbar=Ce;exports.HeaderToolbarWrapper=pe;exports.HelpActions=ui;exports.HelpActionsMenu=vi;exports.HelpActionsMenuArrow=bi;exports.HelpActionsMenuItem=gi;exports.HelpActionsMenuItemIcon=Pi;exports.HelpActionsTrigger=pi;exports.Input=Mt;exports.InputFieldset=kt;exports.InputGroup=It;exports.IntroMessageWrapper=Oe;exports.Markdown=st;exports.MessageAction=lt;exports.MessageAttachments=Ge;exports.MessageAttachmentsItem=Je;exports.MessageAttachmentsItemIcon=Xe;exports.MessageAttachmentsItemTitle=Ze;exports.MessageAttachmentsList=Ye;exports.MessageAttachmentsPreview=et;exports.MessageAttachmentsPreviewBody=rt;exports.MessageAttachmentsPreviewClose=nt;exports.MessageAttachmentsPreviewContent=it;exports.MessageAttachmentsPreviewHeader=at;exports.MessageAttachmentsPreviewOverlay=tt;exports.MessageAvatar=Ne;exports.MessageAvatarContent=Qe;exports.MessageAvatarFallback=Ve;exports.MessageAvatarImage=$e;exports.MessageContent=ze;exports.MessageContentWrapper=Ke;exports.MessageCustomAction=mt;exports.MessageCustomActions=ct;exports.MessageHeader=qe;exports.MessageLoading=We;exports.MessageName=Ue;exports.MessageSourceItem=pt;exports.MessageSourceItemBreadcrumbIcon=Bn;exports.MessageSourceItemBreadcrumbs=vt;exports.MessageSourceItemDescription=At;exports.MessageSourceItemDescriptionPart=_t;exports.MessageSourceItemIcon=bt;exports.MessageSourceItemIndicator=Et;exports.MessageSourceItemTag=Pt;exports.MessageSourceItemTitle=gt;exports.MessageSources=ht;exports.MessageSourcesHeader=ut;exports.MessageSourcesList=Ct;exports.MessageToolbar=dt;exports.MessageWrapper=se;exports.Messages=Fe;exports.PrimitiveMessagePart=Pn;exports.Root=ue;exports.SendButton=ft;exports.SendButtonIcon=St;exports.TaglineBrandName=li;exports.TaglineContainer=di;exports.TaglineLogo=mi;exports.TaglineText=ci;exports.ToolbarHeader=ve;exports.Workflow=Re;exports.Workflows=we;exports.WorkflowsLabel=Le;exports.WorkflowsList=De;exports.Wrapper=he;
11
+ `);P(N)},share:async()=>{},clear:d,stop:c},E={copy:p,share:I};return r.jsx(W.Tooltip,{delayDuration:0,open:E[e],children:r.jsx(Io,{"data-type":e,"data-copied":u.dataAttr(p||I),className:`${o} ${e}`,children:r.jsx(le,{action:e}),onClick:C.composeEventHandlers(i,D[e]),...n})})},Mo=a.ikp("span",{_id:"aiChat__ChatActionLabel"}),le=t=>{const{action:e,...i}=t,{aiChatSettings:o}=g.useInkeepConfig(),n=o.toolbarButtonLabels??{},s={help:n.getHelp??"Get Help",copy:n.copyChat??"Copy",share:n.share??"Share",clear:n.clear??"Clear",stop:n.stop??"Stop"};return r.jsx(Mo,{children:s[e],...i})},fo=a.ikp(W.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),vi=t=>{const{action:e,children:i,...o}=t,n={copy:"Copied!",share:"Link copied!"};return r.jsxs(fo,{sideOffset:5,...o,children:[r.jsx(W.Arrow,{}),i||n[e]]})},xo=a.ikp(q.Root,{_id:"aiChatHelpActions"}),gi=t=>{const{children:e,...i}=t,{aiChatSettings:o}=g.useInkeepConfig(),{getHelpOptions:n}=o;if(!n||(n??[]).length===0)return null;const{_pinned:s,_unpinned:d}=n.reduce((b,v)=>{const p=v.isPinnedToToolbar?"_pinned":"_unpinned";return{...b,[p]:[...b[p],v]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...s,d[0]]:s,m=d.length===1?[]:d,h=te.useHelpMenuState();return r.jsx(te.HelpMenuProvider,{value:h,children:r.jsx(xo,{open:h.open,onOpenChange:h.setOpen,children:u.maybeRender(e,{pinned:c,unpinned:m}),...i})})},So=a.ikp(J,{_id:"aiChatHelpAction",action:"help"}),Bo=a.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),Pi=t=>{const{action:e,onClick:i,...o}=t,{handleAction:n,logHelpAction:s}=re.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:C.composeEventHandlers(i,()=>{n(),s()}),...o};return d==="open_link"?r.jsx(Bo,{href:e.action.url,...c}):r.jsx(So,{...c})},To=a.ikp(q.Trigger,{_id:"aiChatHelpActions__Trigger"}),Fi=l.memo(t=>{const{aiChatSettings:e}=g.useInkeepConfig();return r.jsx(J,{action:"help",...t,asChild:!0,children:r.jsx(To,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),yo=a.ikp(q.Content,{_id:"aiChatHelpActions__Menu"}),_i=t=>r.jsx(yo,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),Ei=a.ikp(q.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),Ai=t=>{const{action:e,onClick:i,...o}=t,{handleAction:n,logHelpAction:s}=re.useChatAction(e),{setOpen:d}=te.useHelpMenu(),c=()=>{n({onOpenForm:()=>d(!1)}),s()},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:C.composeEventHandlers(i,c)});return r.jsx(h,{...o})},Ho=a.ikp(w.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),ki=t=>{const{action:e,...i}=t;return e.icon?r.jsx(Ho,{iconSettings:e.icon,...i}):null},jo=a.ikp(A.Root,{_id:"aiChatFeedbackModal"}),Ii=t=>{const{onOpenChange:e,...i}=t,{currentFeedback:o,setCurrentFeedback:n}=ae.useMessageFeedback();return r.jsx(jo,{open:o!==null,onOpenChange:C.composeEventHandlers(e,()=>n(null)),...i})},Mi=a.ikp(A.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),fi=a.ikp(A.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),xi=a.ikp(A.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),Si=a.ikp(A.Close,{_id:"aiChatFeedbackModal__Close",children:r.jsx(x.CustomIcon,{iconKey:"close"})}),Bi=a.ikp("div",{_id:"aiChatFeedbackModal__Body"}),wo=a.ikp("form",{_id:"aiChatFeedbackForm"}),Ti=t=>{const{onSubmit:e,...i}=t,{submitNegativeFeedback:o,currentFeedback:n,setCurrentFeedback:s}=ae.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,h=new FormData(m),b=Object.fromEntries(h.entries());n&&(o(n,b),s(null))};return r.jsx(wo,{onSubmit:C.composeEventHandlers(e,d),...i})},Lo=a.ikp("div",{_id:"aiChatFeedbackItem"}),yi=t=>{const{name:e,...i}=t;return r.jsx(G.FeedbackItemProvider,{name:e,children:r.jsx(Lo,{...i})})},Do=a.ikp(Y.Root,{_id:"aiChatFeedbackItem__Checkbox"}),Hi=t=>{const{name:e,focusItem:i}=G.useFeedbackItem(),{onCheckedChange:o,...n}=t,s=d=>{d&&i?.current?.focus()};return r.jsx(Do,{id:`feedback-${e}`,name:e,onCheckedChange:C.composeEventHandlers(o,s),...n})},ji=a.ikp(Y.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:r.jsx(ue.CheckboxIcon,{})}),Ro=a.ikp("label",{_id:"aiChatFeedbackItem__Label"}),wi=t=>{const{name:e}=G.useFeedbackItem(),i={unrelated_response:"Didn't answer my question",inaccurate_statement:"Inaccurate statement",inaccurate_code_snippet:"Inaccurate code snippet",irrelevant_citations:"Irrelevant citations"};return r.jsx(Ro,{htmlFor:`feedback-${e}`,children:i[e],...t})},Oo=a.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),Li=t=>{const{name:e,focusItem:i}=G.useFeedbackItem();return r.jsx(Oo,{ref:i,name:`${e}:description`,...t})},Di=a.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),qo=a.ikp("div",{_id:"aiChatForm__Wrapper"}),Ri=t=>{const{form:e}=k.useChatForm();return e?r.jsx(qo,{...t}):null},Wo=a.ikp("form",{_id:"aiChatForm"}),Oi=t=>{const{onSubmit:e,...i}=t,{conversationId:o,messages:n}=F.useChat(),{handleSubmit:s,isSuccess:d}=k.useChatForm();return d?null:r.jsx(Wo,{onSubmit:C.composeEventHandlers(e,c=>s(c,{id:o,messages:n})),...i})},No=a.ikp("button",{_id:"aiChatForm__Close",children:r.jsx(x.CustomIcon,{iconKey:"close"})}),qi=t=>{const{onClick:e,...i}=t,{closeForm:o}=k.useChatForm();return r.jsx(No,{onClick:C.composeEventHandlers(e,o),...i})},Wi=a.ikp("div",{_id:"aiChatForm__Header"}),Vo=a.ikp("h2",{_id:"aiChatForm__Heading"}),Ni=t=>{const{form:e}=k.useChatForm();return e?.heading?r.jsx(Vo,{children:e.heading,...t}):null},Qo=a.ikp(z.Markdown,{_id:"aiChatForm__Description"}),Vi=t=>{const{form:e}=k.useChatForm();return e?.description?r.jsx(Qo,{shouldOpenLinksInNewTab:!0,children:e.description,...t}):null},$o=a.ikp("div",{_id:"aiChatForm__Content"}),Qi=t=>{const{children:e,...i}=t,{getFields:o}=k.useChatForm(),{conversationId:n}=F.useChat(),s=o(n)||[];return r.jsx($o,{children:u.maybeRender(e,s),...i})},Uo=a.ikp("div",{_id:"aiChatForm__Field"}),$i=t=>{const{field:e,autoFocus:i,...o}=t,{control:n,errors:s}=k.useChatForm();return r.jsx(Na.Controller,{name:e.name,control:n,rules:{required:e.isRequired?`${e.label} is required.`:void 0},render:({field:d})=>{const c=d.value!==void 0||e.inputType==="file";return r.jsx(H.FormFieldProvider,{"data-invalid":u.dataAttr(!!s[e.name]),field:e,fieldProps:d,autoFocus:i,children:c&&r.jsx(Uo,{"data-input-type":e.inputType,"data-hidden":u.dataAttr(e.isHidden),...o})})}})},Ko=a.ikp("label",{_id:"aiChatForm__FieldLabel"}),Ui=t=>{const{field:e}=H.useFormField();return r.jsx(Ko,{"data-required":u.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},zo=a.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),X=t=>{const{field:e,error:i,fieldProps:{onChange:o,onBlur:n,...s},autoFocus:d}=H.useFormField(),{onChange:c,onBlur:m,...h}=t;return r.jsx(zo,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":u.dataAttr(!!i),onChange:C.composeEventHandlers(c,o),onBlur:C.composeEventHandlers(m,n),...s,...h})},Ki=a.ikp(X,{_id:"aiChatForm__FieldEmail",type:"email"}),Go=a.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),zi=t=>{const{field:e,error:i,fieldProps:{value:o,onChange:n,onBlur:s,...d},autoFocus:c}=H.useFormField(),{onChange:m,onBlur:h,...b}=t,v=p=>{const P=p.target.files;n(P)};return r.jsx(Go,{id:e.name,autoFocus:c,"data-value":o,"data-invalid":u.dataAttr(!!i),...b,...d,onChange:C.composeEventHandlers(m,v),onBlur:C.composeEventHandlers(h,s)})},Gi=a.ikp(X,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:r.jsx(ie,{maxRows:8})}),Yo=a.ikp(Y.Root,{_id:"aiChatForm__FieldCheckbox"}),Yi=t=>{const{field:e,error:i,fieldProps:o,autoFocus:n}=H.useFormField(),{onCheckedChange:s,...d}=t;return r.jsx(Yo,{id:e.name,name:e.name,autoFocus:n,"data-invalid":u.dataAttr(!!i),checked:o.value,onCheckedChange:C.composeEventHandlers(s,o.onChange),...d})},Ji=a.ikp(Y.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:r.jsx(ue.CheckboxIcon,{})}),Jo=a.ikp(j.Root,{_id:"aiChatForm__FieldSelect"}),Xi=t=>{const{field:e,error:i,fieldProps:o}=H.useFormField(),{onValueChange:n,...s}=t;return r.jsx(Jo,{name:e.name,"data-invalid":u.dataAttr(!!i),value:o.value,onValueChange:C.composeEventHandlers(n,o.onChange),...s})},Zi=a.ikp(j.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),Xo=a.ikp(j.Value,{_id:"aiChatForm__FieldSelect__Value"}),ea=t=>{const{field:e}=H.useFormField();return r.jsx(Xo,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},ta=a.ikp(j.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:r.jsx(w.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),ia=a.ikp(j.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),aa=a.ikp(j.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),ra=a.ikp(j.Item,{_id:"aiChatForm__FieldSelect__Item"}),oa=a.ikp(j.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),na=a.ikp(j.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:r.jsx(w.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),sa=t=>{const{field:e,error:i,fieldProps:o}=H.useFormField(),{onValueChange:n,...s}=t;if(e.inputType!=="combobox")return null;const d=e,{items:c,placeholder:m,multiple:h}=d,b=Array.isArray(o.value)?o.value:[],v={name:e.name,"data-invalid":u.dataAttr(!!i)||void 0,items:c,defaultValue:b,multiple:h??!1,placeholder:m,onValueChange:C.composeEventHandlers(n,p=>o.onChange(p.value)),...s};return r.jsx(S.ComboboxRoot,{...v})},Zo={_id:"aiChatForm__FieldCombobox__Control"},da=a.ikp(S.ComboboxControl,Zo),en={_id:"aiChatForm__FieldCombobox__Input"},ca=a.ikp(S.ComboboxInput,en),tn={_id:"aiChatForm__FieldCombobox__Trigger",children:r.jsx(w.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})},ma=a.ikp(S.ComboboxTrigger,tn),an={_id:"aiChatForm__FieldCombobox__SelectedTags"},la=a.ikp(S.ComboboxSelectedTags,an),rn={_id:"aiChatForm__FieldCombobox__Content"},ha=a.ikp(S.ComboboxContent,rn),on={_id:"aiChatForm__FieldCombobox__Positioner"},ua=a.ikp(S.ComboboxPositioner,on),nn={_id:"aiChatForm__FieldCombobox__List"},Ca=a.ikp(S.ComboboxList,nn),ba=a.ikp(S.ComboboxItem,{_id:"aiChatForm__FieldCombobox__Item"}),pa=a.ikp(S.ComboboxItemText,{_id:"aiChatForm__FieldCombobox__ItemText"}),va=a.ikp(S.ComboboxItemIndicator,{_id:"aiChatForm__FieldCombobox__ItemIndicator"}),ga=S.ComboboxListItems,Pa=a.ikp(S.ComboboxListEmpty,{_id:"aiChatForm__FieldCombobox__ListEmpty"}),sn=a.ikp("p",{_id:"aiChatForm__FieldDescription"}),Fa=t=>{const{field:e}=H.useFormField();return e.description?r.jsx(sn,{children:e.description,...t}):null},dn=a.ikp("span",{_id:"aiChatForm__FieldError"}),_a=t=>{const{error:e}=H.useFormField();return e?r.jsx(dn,{children:e.message?.toString(),...t}):null},cn=a.ikp("span",{_id:"aiChatForm__Error"}),Ea=t=>{const{formError:e}=k.useChatForm();return e?r.jsx(cn,{children:e.message,...t}):null},Aa=a.ikp("div",{_id:"aiChatForm__Footer"}),mn=a.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel",type:"button"}),ka=t=>{const{onClick:e,...i}=t,{closeForm:o}=k.useChatForm();return r.jsx(mn,{onClick:C.composeEventHandlers(e,o),...i})},ln=a.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),Ia=t=>{const{onClick:e,...i}=t,{isSubmitting:o,form:n}=k.useChatForm(),s=n?.buttons.submit.label||"Submit";return r.jsx(ln,{disabled:o,...i,children:s})},hn=a.ikp("div",{_id:"aiChatForm__Success"}),Ma=t=>{const{isSuccess:e}=k.useChatForm();return e?r.jsx(hn,{...t}):null},un=a.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),fa=t=>{const{form:e}=k.useChatForm();return r.jsx(un,{children:e?.successView?.heading,...t})},Cn=a.ikp(z.Markdown,{_id:"aiChatForm__SuccessMessage"}),xa=t=>{const{form:e}=k.useChatForm();return r.jsx(Cn,{shouldOpenLinksInNewTab:!0,children:e?.successView?.message,...t})},bn=a.ikp("button",{_id:"aiChatForm__SuccessButton"}),Sa=t=>{const{onClick:e,...i}=t,{form:o,closeForm:n}=k.useChatForm(),s=o?.successView?.doneButton;if(!s)return null;const d=s.icon&&r.jsx(w.BuiltInIconRenderer,{iconSettings:s.icon}),c=s.label;return r.jsx(bn,{onClick:C.composeEventHandlers(e,n),children:r.jsxs(r.Fragment,{children:[d,c]}),...i})};exports.Provider=F.ChatProvider;exports.ActionBar=li;exports.Actions=hi;exports.AttachmentsBar=jt;exports.AttachmentsBarActions=qt;exports.AttachmentsBarAttachment=Lt;exports.AttachmentsBarAttachmentDelete=Ot;exports.AttachmentsBarAttachmentIcon=Dt;exports.AttachmentsBarAttachmentTitle=Rt;exports.AttachmentsBarForm=ti;exports.AttachmentsBarFormContent=ni;exports.AttachmentsBarFormContentError=ci;exports.AttachmentsBarFormContentInput=di;exports.AttachmentsBarFormContentLabel=si;exports.AttachmentsBarFormSubmitButton=mi;exports.AttachmentsBarFormTitle=ii;exports.AttachmentsBarFormTitleError=oi;exports.AttachmentsBarFormTitleInput=ri;exports.AttachmentsBarFormTitleLabel=ai;exports.AttachmentsBarInfoTip=Wt;exports.AttachmentsBarInfoTipArrow=me;exports.AttachmentsBarInfoTipIcon=Nt;exports.AttachmentsBarInfoTipText=Vt;exports.AttachmentsBarInput=$t;exports.AttachmentsBarInputs=Qt;exports.AttachmentsBarList=wt;exports.AttachmentsBarModal=Ut;exports.AttachmentsBarModalBody=ei;exports.AttachmentsBarModalClose=Zt;exports.AttachmentsBarModalContent=zt;exports.AttachmentsBarModalDescription=Jt;exports.AttachmentsBarModalHeader=Gt;exports.AttachmentsBarModalHeading=Yt;exports.AttachmentsBarModalHelp=Xt;exports.AttachmentsBarModalOverlay=Kt;exports.ChatAction=J;exports.ChatActionFeedback=vi;exports.ChatActionLabel=le;exports.ChatHelpAction=Pi;exports.ChatHistoryButton=Fe;exports.ChatHistoryButtonIcon=Pe;exports.Content=Ee;exports.ContentScrollArea=Ae;exports.ContentScrollAreaCorner=fe;exports.ContentScrollAreaScrollbar=Ie;exports.ContentScrollAreaThumb=Me;exports.ContentScrollAreaViewport=ke;exports.Disclaimer=Se;exports.DisclaimerArrow=je;exports.DisclaimerContent=ye;exports.DisclaimerLabel=Be;exports.DisclaimerText=He;exports.DisclaimerTrigger=Te;exports.DynamicComponent=ht;exports.EmbeddedChatPrimitiveActionBar=li;exports.EmbeddedChatPrimitiveActions=hi;exports.EmbeddedChatPrimitiveAttachmentsBar=jt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=qt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=ti;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=ni;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=ci;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=di;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=si;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=mi;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=ii;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=oi;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=ai;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=me;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Nt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarInput=$t;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarList=wt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=ei;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Gt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=Kt;exports.EmbeddedChatPrimitiveChatAction=J;exports.EmbeddedChatPrimitiveChatActionFeedback=vi;exports.EmbeddedChatPrimitiveChatActionLabel=le;exports.EmbeddedChatPrimitiveChatHelpAction=Pi;exports.EmbeddedChatPrimitiveChatHistoryButton=Fe;exports.EmbeddedChatPrimitiveChatHistoryButtonIcon=Pe;exports.EmbeddedChatPrimitiveContent=Ee;exports.EmbeddedChatPrimitiveContentScrollArea=Ae;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=fe;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Ie;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=Me;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=ke;exports.EmbeddedChatPrimitiveDisclaimer=Se;exports.EmbeddedChatPrimitiveDisclaimerArrow=je;exports.EmbeddedChatPrimitiveDisclaimerContent=ye;exports.EmbeddedChatPrimitiveDisclaimerLabel=Be;exports.EmbeddedChatPrimitiveDisclaimerText=He;exports.EmbeddedChatPrimitiveDisclaimerTrigger=Te;exports.EmbeddedChatPrimitiveDynamicComponent=ht;exports.EmbeddedChatPrimitiveExampleQuestion=Re;exports.EmbeddedChatPrimitiveExampleQuestionButton=Oe;exports.EmbeddedChatPrimitiveExampleQuestions=we;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=Le;exports.EmbeddedChatPrimitiveExampleQuestionsList=De;exports.EmbeddedChatPrimitiveFeedbackForm=Ti;exports.EmbeddedChatPrimitiveFeedbackItem=yi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=Hi;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=ji;exports.EmbeddedChatPrimitiveFeedbackItemDescription=Li;exports.EmbeddedChatPrimitiveFeedbackItemLabel=wi;exports.EmbeddedChatPrimitiveFeedbackModal=Ii;exports.EmbeddedChatPrimitiveFeedbackModalBody=Bi;exports.EmbeddedChatPrimitiveFeedbackModalClose=Si;exports.EmbeddedChatPrimitiveFeedbackModalContent=fi;exports.EmbeddedChatPrimitiveFeedbackModalHeader=xi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=Mi;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Di;exports.EmbeddedChatPrimitiveFooter=xt;exports.EmbeddedChatPrimitiveForm=Oi;exports.EmbeddedChatPrimitiveFormCancel=ka;exports.EmbeddedChatPrimitiveFormClose=qi;exports.EmbeddedChatPrimitiveFormContent=Qi;exports.EmbeddedChatPrimitiveFormDescription=Vi;exports.EmbeddedChatPrimitiveFormError=Ea;exports.EmbeddedChatPrimitiveFormField=$i;exports.EmbeddedChatPrimitiveFormFieldCheckbox=Yi;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Ji;exports.EmbeddedChatPrimitiveFormFieldCombobox=sa;exports.EmbeddedChatPrimitiveFormFieldComboboxContent=ha;exports.EmbeddedChatPrimitiveFormFieldComboboxControl=da;exports.EmbeddedChatPrimitiveFormFieldComboboxInput=ca;exports.EmbeddedChatPrimitiveFormFieldComboboxItem=ba;exports.EmbeddedChatPrimitiveFormFieldComboboxItemIndicator=va;exports.EmbeddedChatPrimitiveFormFieldComboboxItemText=pa;exports.EmbeddedChatPrimitiveFormFieldComboboxList=Ca;exports.EmbeddedChatPrimitiveFormFieldComboboxListEmpty=Pa;exports.EmbeddedChatPrimitiveFormFieldComboboxListItems=ga;exports.EmbeddedChatPrimitiveFormFieldComboboxPositioner=ua;exports.EmbeddedChatPrimitiveFormFieldComboboxSelectedTags=la;exports.EmbeddedChatPrimitiveFormFieldComboboxTrigger=ma;exports.EmbeddedChatPrimitiveFormFieldDescription=Fa;exports.EmbeddedChatPrimitiveFormFieldEmail=Ki;exports.EmbeddedChatPrimitiveFormFieldError=_a;exports.EmbeddedChatPrimitiveFormFieldFile=zi;exports.EmbeddedChatPrimitiveFormFieldLabel=Ui;exports.EmbeddedChatPrimitiveFormFieldSelect=Xi;exports.EmbeddedChatPrimitiveFormFieldSelectContent=ia;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=ta;exports.EmbeddedChatPrimitiveFormFieldSelectItem=ra;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=na;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=oa;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=Zi;exports.EmbeddedChatPrimitiveFormFieldSelectValue=ea;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=aa;exports.EmbeddedChatPrimitiveFormFieldText=X;exports.EmbeddedChatPrimitiveFormFieldTextArea=Gi;exports.EmbeddedChatPrimitiveFormFooter=Aa;exports.EmbeddedChatPrimitiveFormHeader=Wi;exports.EmbeddedChatPrimitiveFormHeading=Ni;exports.EmbeddedChatPrimitiveFormSubmit=Ia;exports.EmbeddedChatPrimitiveFormSuccess=Ma;exports.EmbeddedChatPrimitiveFormSuccessButton=Sa;exports.EmbeddedChatPrimitiveFormSuccessHeading=fa;exports.EmbeddedChatPrimitiveFormSuccessMessage=xa;exports.EmbeddedChatPrimitiveFormWrapper=Ri;exports.EmbeddedChatPrimitiveHeaderToolbar=ve;exports.EmbeddedChatPrimitiveHelpActions=gi;exports.EmbeddedChatPrimitiveHelpActionsMenu=_i;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=Ei;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=Ai;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=ki;exports.EmbeddedChatPrimitiveHelpActionsTrigger=Fi;exports.EmbeddedChatPrimitiveInput=Tt;exports.EmbeddedChatPrimitiveInputFieldset=St;exports.EmbeddedChatPrimitiveInputGroup=Bt;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Qe;exports.EmbeddedChatPrimitiveMarkdown=lt;exports.EmbeddedChatPrimitiveMessageAction=pt;exports.EmbeddedChatPrimitiveMessageAttachments=et;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=it;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=at;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsList=tt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=ot;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=mt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=ct;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=st;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=dt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=nt;exports.EmbeddedChatPrimitiveMessageAvatar=Ke;exports.EmbeddedChatPrimitiveMessageAvatarContent=ze;exports.EmbeddedChatPrimitiveMessageAvatarFallback=Ge;exports.EmbeddedChatPrimitiveMessageAvatarImage=Ye;exports.EmbeddedChatPrimitiveMessageContent=Ze;exports.EmbeddedChatPrimitiveMessageContentWrapper=Xe;exports.EmbeddedChatPrimitiveMessageCustomAction=bt;exports.EmbeddedChatPrimitiveMessageCustomActions=Ct;exports.EmbeddedChatPrimitiveMessageHeader=$e;exports.EmbeddedChatPrimitiveMessageLoading=Ue;exports.EmbeddedChatPrimitiveMessageName=Je;exports.EmbeddedChatPrimitiveMessageSourceItem=Ft;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=_t;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=It;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=Mt;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=Et;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=ft;exports.EmbeddedChatPrimitiveMessageSourceItemTag=kt;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=At;exports.EmbeddedChatPrimitiveMessageSources=vt;exports.EmbeddedChatPrimitiveMessageSourcesHeader=gt;exports.EmbeddedChatPrimitiveMessageSourcesList=Pt;exports.EmbeddedChatPrimitiveMessageToolbar=ut;exports.EmbeddedChatPrimitiveMessageWrapper=ce;exports.EmbeddedChatPrimitiveMessages=xe;exports.EmbeddedChatPrimitiveRoot=pe;exports.EmbeddedChatPrimitiveSendButton=yt;exports.EmbeddedChatPrimitiveSendButtonIcon=Ht;exports.EmbeddedChatPrimitiveTaglineBrandName=pi;exports.EmbeddedChatPrimitiveTaglineContainer=ui;exports.EmbeddedChatPrimitiveTaglineLogo=bi;exports.EmbeddedChatPrimitiveTaglineText=Ci;exports.EmbeddedChatPrimitiveToolbarHeader=_e;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=ge;exports.EmbeddedChatPrimitiveWorkflow=Ve;exports.EmbeddedChatPrimitiveWorkflows=qe;exports.EmbeddedChatPrimitiveWorkflowsLabel=We;exports.EmbeddedChatPrimitiveWorkflowsList=Ne;exports.EmbeddedChatPrimitiveWrapper=be;exports.ExampleQuestion=Re;exports.ExampleQuestionButton=Oe;exports.ExampleQuestions=we;exports.ExampleQuestionsLabel=Le;exports.ExampleQuestionsList=De;exports.FeedbackForm=Ti;exports.FeedbackItem=yi;exports.FeedbackItemCheckbox=Hi;exports.FeedbackItemCheckboxIndicator=ji;exports.FeedbackItemDescription=Li;exports.FeedbackItemLabel=wi;exports.FeedbackModal=Ii;exports.FeedbackModalBody=Bi;exports.FeedbackModalClose=Si;exports.FeedbackModalContent=fi;exports.FeedbackModalHeader=xi;exports.FeedbackModalOverlay=Mi;exports.FeedbackSubmitButton=Di;exports.Footer=xt;exports.Form=Oi;exports.FormCancel=ka;exports.FormClose=qi;exports.FormContent=Qi;exports.FormDescription=Vi;exports.FormError=Ea;exports.FormField=$i;exports.FormFieldCheckbox=Yi;exports.FormFieldCheckboxIndicator=Ji;exports.FormFieldCombobox=sa;exports.FormFieldComboboxContent=ha;exports.FormFieldComboboxControl=da;exports.FormFieldComboboxInput=ca;exports.FormFieldComboboxItem=ba;exports.FormFieldComboboxItemIndicator=va;exports.FormFieldComboboxItemText=pa;exports.FormFieldComboboxList=Ca;exports.FormFieldComboboxListEmpty=Pa;exports.FormFieldComboboxListItems=ga;exports.FormFieldComboboxPositioner=ua;exports.FormFieldComboboxSelectedTags=la;exports.FormFieldComboboxTrigger=ma;exports.FormFieldDescription=Fa;exports.FormFieldEmail=Ki;exports.FormFieldError=_a;exports.FormFieldFile=zi;exports.FormFieldLabel=Ui;exports.FormFieldSelect=Xi;exports.FormFieldSelectContent=ia;exports.FormFieldSelectIcon=ta;exports.FormFieldSelectItem=ra;exports.FormFieldSelectItemIndicator=na;exports.FormFieldSelectItemText=oa;exports.FormFieldSelectTrigger=Zi;exports.FormFieldSelectValue=ea;exports.FormFieldSelectViewport=aa;exports.FormFieldText=X;exports.FormFieldTextArea=Gi;exports.FormFooter=Aa;exports.FormHeader=Wi;exports.FormHeading=Ni;exports.FormSubmit=Ia;exports.FormSuccess=Ma;exports.FormSuccessButton=Sa;exports.FormSuccessHeading=fa;exports.FormSuccessMessage=xa;exports.FormWrapper=Ri;exports.Header=ar;exports.HeaderToolbar=ve;exports.HeaderToolbarWrapper=ge;exports.HelpActions=gi;exports.HelpActionsMenu=_i;exports.HelpActionsMenuArrow=Ei;exports.HelpActionsMenuItem=Ai;exports.HelpActionsMenuItemIcon=ki;exports.HelpActionsTrigger=Fi;exports.Input=Tt;exports.InputFieldset=St;exports.InputGroup=Bt;exports.IntroMessageWrapper=Qe;exports.Markdown=lt;exports.MessageAction=pt;exports.MessageAttachments=et;exports.MessageAttachmentsItem=it;exports.MessageAttachmentsItemIcon=at;exports.MessageAttachmentsItemTitle=rt;exports.MessageAttachmentsList=tt;exports.MessageAttachmentsPreview=ot;exports.MessageAttachmentsPreviewBody=mt;exports.MessageAttachmentsPreviewClose=ct;exports.MessageAttachmentsPreviewContent=st;exports.MessageAttachmentsPreviewHeader=dt;exports.MessageAttachmentsPreviewOverlay=nt;exports.MessageAvatar=Ke;exports.MessageAvatarContent=ze;exports.MessageAvatarFallback=Ge;exports.MessageAvatarImage=Ye;exports.MessageContent=Ze;exports.MessageContentWrapper=Xe;exports.MessageCustomAction=bt;exports.MessageCustomActions=Ct;exports.MessageHeader=$e;exports.MessageLoading=Ue;exports.MessageName=Je;exports.MessageSourceItem=Ft;exports.MessageSourceItemBreadcrumbIcon=Yr;exports.MessageSourceItemBreadcrumbs=_t;exports.MessageSourceItemDescription=It;exports.MessageSourceItemDescriptionPart=Mt;exports.MessageSourceItemIcon=Et;exports.MessageSourceItemIndicator=ft;exports.MessageSourceItemTag=kt;exports.MessageSourceItemTitle=At;exports.MessageSources=vt;exports.MessageSourcesHeader=gt;exports.MessageSourcesList=Pt;exports.MessageToolbar=ut;exports.MessageWrapper=ce;exports.Messages=xe;exports.PrimitiveMessagePart=Or;exports.Root=pe;exports.SendButton=yt;exports.SendButtonIcon=Ht;exports.TaglineBrandName=pi;exports.TaglineContainer=ui;exports.TaglineLogo=bi;exports.TaglineText=Ci;exports.ToolbarHeader=_e;exports.Workflow=Ve;exports.Workflows=qe;exports.WorkflowsLabel=We;exports.WorkflowsList=Ne;exports.Wrapper=be;