@copilotkit/react-ui 1.7.2-next.2 → 1.8.0-next.4

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 (162) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/{chunk-CBBFRI3Q.mjs → chunk-5JY5QJ2W.mjs} +9 -5
  3. package/dist/chunk-5JY5QJ2W.mjs.map +1 -0
  4. package/dist/{chunk-OFYI4UU4.mjs → chunk-7RIBDD4K.mjs} +19 -3
  5. package/dist/chunk-7RIBDD4K.mjs.map +1 -0
  6. package/dist/{chunk-AELKLZSG.mjs → chunk-AIR3MXUU.mjs} +12 -12
  7. package/dist/{chunk-YAGE7RCE.mjs → chunk-CGVOCLHN.mjs} +2 -2
  8. package/dist/{chunk-DLG7BZTA.mjs → chunk-CZUP2N4J.mjs} +2 -2
  9. package/dist/chunk-FBYETUFL.mjs +118 -0
  10. package/dist/chunk-FBYETUFL.mjs.map +1 -0
  11. package/dist/chunk-GIPO7UB2.mjs +24 -0
  12. package/dist/chunk-GIPO7UB2.mjs.map +1 -0
  13. package/dist/{chunk-6FTRYYR5.mjs → chunk-GJME6MK4.mjs} +72 -62
  14. package/dist/chunk-GJME6MK4.mjs.map +1 -0
  15. package/dist/{chunk-QXQDIFOC.mjs → chunk-H24B7QWO.mjs} +49 -38
  16. package/dist/chunk-H24B7QWO.mjs.map +1 -0
  17. package/dist/{chunk-QXTRFMPM.mjs → chunk-LYHZXHTJ.mjs} +15 -12
  18. package/dist/chunk-LYHZXHTJ.mjs.map +1 -0
  19. package/dist/chunk-ORSMX3SE.mjs +244 -0
  20. package/dist/chunk-ORSMX3SE.mjs.map +1 -0
  21. package/dist/{chunk-UPTB2MVO.mjs → chunk-PCTCOQK2.mjs} +4 -10
  22. package/dist/chunk-PCTCOQK2.mjs.map +1 -0
  23. package/dist/{chunk-ZIF5JJCH.mjs → chunk-QQ4FBIGN.mjs} +30 -59
  24. package/dist/chunk-QQ4FBIGN.mjs.map +1 -0
  25. package/dist/{chunk-R2O33F44.mjs → chunk-TFIQA2P5.mjs} +2 -2
  26. package/dist/{chunk-WGAZXTUA.mjs → chunk-TOQ7P4DO.mjs} +6 -9
  27. package/dist/chunk-TOQ7P4DO.mjs.map +1 -0
  28. package/dist/{chunk-3XAXY2Z3.mjs → chunk-UZTZXMYS.mjs} +2 -2
  29. package/dist/{chunk-RQNJNK2W.mjs → chunk-VC4NO5QZ.mjs} +2 -2
  30. package/dist/{chunk-YQ3D5IQV.mjs → chunk-XNQO5AZZ.mjs} +2 -5
  31. package/dist/chunk-XNQO5AZZ.mjs.map +1 -0
  32. package/dist/chunk-YC4NBUGE.mjs +97 -0
  33. package/dist/chunk-YC4NBUGE.mjs.map +1 -0
  34. package/dist/components/chat/Button.js.map +1 -1
  35. package/dist/components/chat/Button.mjs +3 -3
  36. package/dist/components/chat/Chat.d.ts +17 -1
  37. package/dist/components/chat/Chat.js +380 -906
  38. package/dist/components/chat/Chat.js.map +1 -1
  39. package/dist/components/chat/Chat.mjs +11 -18
  40. package/dist/components/chat/ChatContext.d.ts +20 -0
  41. package/dist/components/chat/ChatContext.js +44 -74
  42. package/dist/components/chat/ChatContext.js.map +1 -1
  43. package/dist/components/chat/ChatContext.mjs +2 -2
  44. package/dist/components/chat/CodeBlock.js +58 -82
  45. package/dist/components/chat/CodeBlock.js.map +1 -1
  46. package/dist/components/chat/CodeBlock.mjs +2 -2
  47. package/dist/components/chat/Header.js +516 -4
  48. package/dist/components/chat/Header.js.map +1 -1
  49. package/dist/components/chat/Header.mjs +10 -3
  50. package/dist/components/chat/Icons.d.ts +10 -9
  51. package/dist/components/chat/Icons.js +125 -164
  52. package/dist/components/chat/Icons.js.map +1 -1
  53. package/dist/components/chat/Icons.mjs +9 -5
  54. package/dist/components/chat/Input.d.ts +1 -1
  55. package/dist/components/chat/Input.js +13 -10
  56. package/dist/components/chat/Input.js.map +1 -1
  57. package/dist/components/chat/Input.mjs +3 -3
  58. package/dist/components/chat/Markdown.js +58 -56
  59. package/dist/components/chat/Markdown.js.map +1 -1
  60. package/dist/components/chat/Markdown.mjs +3 -3
  61. package/dist/components/chat/Messages.d.ts +1 -1
  62. package/dist/components/chat/Messages.js +70 -60
  63. package/dist/components/chat/Messages.js.map +1 -1
  64. package/dist/components/chat/Messages.mjs +3 -3
  65. package/dist/components/chat/Modal.js +1709 -1749
  66. package/dist/components/chat/Modal.js.map +1 -1
  67. package/dist/components/chat/Modal.mjs +20 -20
  68. package/dist/components/chat/Popup.js +1709 -1749
  69. package/dist/components/chat/Popup.js.map +1 -1
  70. package/dist/components/chat/Popup.mjs +21 -21
  71. package/dist/components/chat/Response.js.map +1 -1
  72. package/dist/components/chat/Response.mjs +3 -3
  73. package/dist/components/chat/Sidebar.js +1711 -1751
  74. package/dist/components/chat/Sidebar.js.map +1 -1
  75. package/dist/components/chat/Sidebar.mjs +21 -21
  76. package/dist/components/chat/Suggestion.js +4 -40
  77. package/dist/components/chat/Suggestion.js.map +1 -1
  78. package/dist/components/chat/Suggestion.mjs +2 -2
  79. package/dist/components/chat/Window.js.map +1 -1
  80. package/dist/components/chat/Window.mjs +3 -3
  81. package/dist/components/chat/index.js +1711 -1751
  82. package/dist/components/chat/index.js.map +1 -1
  83. package/dist/components/chat/index.mjs +24 -24
  84. package/dist/components/chat/messages/AssistantMessage.js +211 -59
  85. package/dist/components/chat/messages/AssistantMessage.js.map +1 -1
  86. package/dist/components/chat/messages/AssistantMessage.mjs +5 -5
  87. package/dist/components/chat/messages/RenderTextMessage.js +18 -2
  88. package/dist/components/chat/messages/RenderTextMessage.js.map +1 -1
  89. package/dist/components/chat/messages/RenderTextMessage.mjs +1 -1
  90. package/dist/components/chat/props.d.ts +53 -0
  91. package/dist/components/chat/props.js.map +1 -1
  92. package/dist/components/crew/index.mjs +1 -1
  93. package/dist/components/dev-console/console.js +51 -233
  94. package/dist/components/dev-console/console.js.map +1 -1
  95. package/dist/components/dev-console/console.mjs +5 -5
  96. package/dist/components/dev-console/index.js +51 -233
  97. package/dist/components/dev-console/index.js.map +1 -1
  98. package/dist/components/dev-console/index.mjs +5 -5
  99. package/dist/components/help-modal/index.js +29 -147
  100. package/dist/components/help-modal/index.js.map +1 -1
  101. package/dist/components/help-modal/index.mjs +1 -1
  102. package/dist/components/help-modal/modal.js +29 -147
  103. package/dist/components/help-modal/modal.js.map +1 -1
  104. package/dist/components/help-modal/modal.mjs +1 -1
  105. package/dist/components/index.js +1685 -1725
  106. package/dist/components/index.js.map +1 -1
  107. package/dist/components/index.mjs +30 -30
  108. package/dist/index.css +266 -98
  109. package/dist/index.css.map +1 -1
  110. package/dist/index.js +1694 -1734
  111. package/dist/index.js.map +1 -1
  112. package/dist/index.mjs +30 -30
  113. package/dist/types/css.d.ts +6 -5
  114. package/dist/types/css.js.map +1 -1
  115. package/package.json +4 -4
  116. package/src/components/chat/Chat.tsx +59 -22
  117. package/src/components/chat/ChatContext.tsx +29 -1
  118. package/src/components/chat/CodeBlock.tsx +2 -4
  119. package/src/components/chat/Header.tsx +8 -3
  120. package/src/components/chat/Icons.tsx +108 -108
  121. package/src/components/chat/Input.tsx +47 -38
  122. package/src/components/chat/Markdown.tsx +0 -3
  123. package/src/components/chat/Messages.tsx +68 -56
  124. package/src/components/chat/Suggestion.tsx +2 -3
  125. package/src/components/chat/messages/AssistantMessage.tsx +95 -3
  126. package/src/components/chat/messages/RenderTextMessage.tsx +17 -1
  127. package/src/components/chat/props.ts +66 -0
  128. package/src/components/dev-console/console.tsx +16 -54
  129. package/src/components/help-modal/modal.tsx +38 -101
  130. package/src/css/button.css +15 -4
  131. package/src/css/colors.css +56 -10
  132. package/src/css/console.css +46 -39
  133. package/src/css/header.css +23 -6
  134. package/src/css/input.css +35 -19
  135. package/src/css/markdown.css +2 -1
  136. package/src/css/messages.css +126 -16
  137. package/src/css/panel.css +1 -0
  138. package/src/css/suggestions.css +14 -6
  139. package/src/types/css.ts +6 -5
  140. package/dist/chunk-3VNMQWGT.mjs +0 -25
  141. package/dist/chunk-3VNMQWGT.mjs.map +0 -1
  142. package/dist/chunk-6FTRYYR5.mjs.map +0 -1
  143. package/dist/chunk-CBBFRI3Q.mjs.map +0 -1
  144. package/dist/chunk-FZC7X5PK.mjs +0 -262
  145. package/dist/chunk-FZC7X5PK.mjs.map +0 -1
  146. package/dist/chunk-OFYI4UU4.mjs.map +0 -1
  147. package/dist/chunk-QXQDIFOC.mjs.map +0 -1
  148. package/dist/chunk-QXTRFMPM.mjs.map +0 -1
  149. package/dist/chunk-TI7SY2RI.mjs +0 -164
  150. package/dist/chunk-TI7SY2RI.mjs.map +0 -1
  151. package/dist/chunk-UPTB2MVO.mjs.map +0 -1
  152. package/dist/chunk-VEC45H6Q.mjs +0 -18
  153. package/dist/chunk-VEC45H6Q.mjs.map +0 -1
  154. package/dist/chunk-WGAZXTUA.mjs.map +0 -1
  155. package/dist/chunk-YQ3D5IQV.mjs.map +0 -1
  156. package/dist/chunk-ZIF5JJCH.mjs.map +0 -1
  157. /package/dist/{chunk-AELKLZSG.mjs.map → chunk-AIR3MXUU.mjs.map} +0 -0
  158. /package/dist/{chunk-YAGE7RCE.mjs.map → chunk-CGVOCLHN.mjs.map} +0 -0
  159. /package/dist/{chunk-DLG7BZTA.mjs.map → chunk-CZUP2N4J.mjs.map} +0 -0
  160. /package/dist/{chunk-R2O33F44.mjs.map → chunk-TFIQA2P5.mjs.map} +0 -0
  161. /package/dist/{chunk-3XAXY2Z3.mjs.map → chunk-UZTZXMYS.mjs.map} +0 -0
  162. /package/dist/{chunk-RQNJNK2W.mjs.map → chunk-VC4NO5QZ.mjs.map} +0 -0
@@ -16,26 +16,6 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var __async = (__this, __arguments, generator) => {
20
- return new Promise((resolve, reject) => {
21
- var fulfilled = (value) => {
22
- try {
23
- step(generator.next(value));
24
- } catch (e) {
25
- reject(e);
26
- }
27
- };
28
- var rejected = (value) => {
29
- try {
30
- step(generator.throw(value));
31
- } catch (e) {
32
- reject(e);
33
- }
34
- };
35
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
36
- step((generator = generator.apply(__this, __arguments)).next());
37
- });
38
- };
39
19
 
40
20
  // src/components/help-modal/index.tsx
41
21
  var help_modal_exports = {};
@@ -62,101 +42,49 @@ var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
62
42
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
63
43
  }
64
44
  );
65
- var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
66
- "svg",
67
- {
68
- style: {
69
- animation: "copilotKitSpinAnimation 1s linear infinite",
70
- color
71
- },
72
- width: "24",
73
- height: "24",
74
- xmlns: "http://www.w3.org/2000/svg",
75
- fill: "none",
76
- viewBox: "0 0 24 24",
77
- children: [
78
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
79
- "circle",
80
- {
81
- style: { opacity: 0.25 },
82
- cx: "12",
83
- cy: "12",
84
- r: "10",
85
- stroke: "currentColor",
86
- strokeWidth: "4"
87
- }
88
- ),
89
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
- "path",
91
- {
92
- style: { opacity: 0.75 },
93
- fill: "currentColor",
94
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
95
- }
96
- )
97
- ]
98
- }
99
- );
100
45
 
101
46
  // src/components/help-modal/modal.tsx
102
47
  var import_jsx_runtime2 = require("react/jsx-runtime");
103
48
  function CopilotKitHelpModal() {
104
49
  const [showHelpModal, setShowHelpModal] = (0, import_react.useState)(false);
105
- const [issueDescription, setIssueDescription] = (0, import_react.useState)("");
106
- const [email, setEmail] = (0, import_react.useState)("");
107
- const [emailError, setEmailError] = (0, import_react.useState)("");
108
- const [submitting, setSubmitting] = (0, import_react.useState)(false);
109
- const validateEmail = (email2) => {
110
- const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
111
- return re.test(email2);
112
- };
113
- const handleSubmit = (e) => __async(this, null, function* () {
114
- e.preventDefault();
115
- if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
116
- setEmailError("Please enter a valid email address");
117
- return;
50
+ const buttonRef = (0, import_react.useRef)(null);
51
+ const popoverRef = (0, import_react.useRef)(null);
52
+ (0, import_react.useEffect)(() => {
53
+ const handleClickOutside = (event) => {
54
+ if (popoverRef.current && !popoverRef.current.contains(event.target) && buttonRef.current && !buttonRef.current.contains(event.target)) {
55
+ setShowHelpModal(false);
56
+ }
57
+ };
58
+ if (showHelpModal) {
59
+ document.addEventListener("mousedown", handleClickOutside);
118
60
  }
119
- setSubmitting(true);
120
- yield fetch("https://api.segment.io/v1/track", {
121
- method: "POST",
122
- headers: {
123
- "Content-Type": "application/json"
124
- },
125
- body: JSON.stringify({
126
- event: "oss.dev-console.help",
127
- anonymousId: window.crypto.randomUUID(),
128
- properties: { email, text: issueDescription },
129
- writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
130
- })
131
- });
132
- setEmailError("");
133
- setEmail("");
134
- setIssueDescription("");
135
- setSubmitting(false);
136
- setShowHelpModal(false);
137
- });
61
+ return () => {
62
+ document.removeEventListener("mousedown", handleClickOutside);
63
+ };
64
+ }, [showHelpModal]);
138
65
  const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
139
66
  "button",
140
67
  {
141
- onClick: () => setShowHelpModal(true),
142
- style: { width: "50px", height: "30px", marginRight: "0.25rem" },
143
- className: "text-sm p-0 bg-transparent rounded border border-blue-500",
68
+ ref: buttonRef,
69
+ onClick: () => setShowHelpModal(!showHelpModal),
70
+ className: "copilotKitDebugMenuTriggerButton relative",
144
71
  "aria-label": "Open Help",
145
72
  children: "Help"
146
73
  }
147
74
  );
148
- const submitButtonDisabled = (0, import_react.useMemo)(
149
- () => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
150
- [submitting, emailError, issueDescription]
151
- );
152
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
75
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "relative", children: [
153
76
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpButton, {}),
154
77
  showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
155
78
  "div",
156
79
  {
157
- className: "fixed inset-0 flex items-center justify-center p-4",
158
- style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
159
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
80
+ ref: popoverRef,
81
+ className: "absolute mt-2 z-50",
82
+ style: {
83
+ top: "100%",
84
+ right: "-120px",
85
+ width: "380px"
86
+ },
87
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bg-white rounded-lg shadow-xl w-full p-4 flex-col relative", children: [
160
88
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
161
89
  "button",
162
90
  {
@@ -169,7 +97,7 @@ function CopilotKitHelpModal() {
169
97
  ),
170
98
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
171
99
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "space-y-4 mb-4", children: [
172
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
100
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
173
101
  "a",
174
102
  {
175
103
  href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
@@ -178,7 +106,7 @@ function CopilotKitHelpModal() {
178
106
  children: "Visit the Troubleshooting and FAQ section in the docs"
179
107
  }
180
108
  ) }),
181
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
109
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
182
110
  "a",
183
111
  {
184
112
  href: "https://go.copilotkit.ai/dev-console-support-discord",
@@ -187,7 +115,7 @@ function CopilotKitHelpModal() {
187
115
  children: "Go to Discord Support Channel (Community Support)"
188
116
  }
189
117
  ) }),
190
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
118
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
191
119
  "a",
192
120
  {
193
121
  href: "https://go.copilotkit.ai/dev-console-support-slack",
@@ -196,52 +124,6 @@ function CopilotKitHelpModal() {
196
124
  children: "Apply for Priority Direct Slack Support"
197
125
  }
198
126
  ) })
199
- ] }),
200
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
201
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
202
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
203
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
204
- "textarea",
205
- {
206
- id: "feedback",
207
- rows: 4,
208
- className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
209
- placeholder: "A Loom link / screen recording is always great!",
210
- onChange: (e) => setIssueDescription(e.target.value),
211
- value: issueDescription,
212
- required: true
213
- }
214
- )
215
- ] }),
216
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
217
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
218
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
219
- "input",
220
- {
221
- type: "email",
222
- id: "email",
223
- className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
224
- placeholder: "Enter your email for follow-up",
225
- onChange: (e) => {
226
- setEmail(e.target.value);
227
- setEmailError("");
228
- },
229
- value: email
230
- }
231
- ),
232
- emailError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
233
- ] }),
234
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
235
- "button",
236
- {
237
- type: "submit",
238
- onClick: handleSubmit,
239
- disabled: submitButtonDisabled,
240
- style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
241
- className: "w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-500 text-base font-medium text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:shadow-none",
242
- children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
243
- }
244
- ) })
245
127
  ] })
246
128
  ] })
247
129
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/help-modal/index.tsx","../../../src/components/help-modal/modal.tsx","../../../src/components/help-modal/icons.tsx"],"sourcesContent":["export { CopilotKitHelpModal } from \"./modal\";\n","import React, { useMemo, useState } from \"react\";\nimport { CloseIcon, LifeBuoyIcon, LoadingSpinnerIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const [issueDescription, setIssueDescription] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [emailError, setEmailError] = useState(\"\");\n const [submitting, setSubmitting] = useState(false);\n\n const validateEmail = (email: string) => {\n const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return re.test(email);\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (email?.length > 0 && !validateEmail(email)) {\n setEmailError(\"Please enter a valid email address\");\n return;\n }\n setSubmitting(true);\n\n await fetch(\"https://api.segment.io/v1/track\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n event: \"oss.dev-console.help\",\n anonymousId: window.crypto.randomUUID(),\n properties: { email, text: issueDescription },\n writeKey: \"q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW\",\n }),\n });\n\n // Reset\n setEmailError(\"\");\n setEmail(\"\");\n setIssueDescription(\"\");\n setSubmitting(false);\n setShowHelpModal(false);\n };\n\n const HelpButton = () => (\n <button\n onClick={() => setShowHelpModal(true)}\n style={{ width: \"50px\", height: \"30px\", marginRight: \"0.25rem\" }}\n className=\"text-sm p-0 bg-transparent rounded border border-blue-500\"\n aria-label=\"Open Help\"\n >\n Help\n </button>\n );\n\n const submitButtonDisabled = useMemo(\n () => submitting || !!emailError || issueDescription == null || issueDescription?.length == 0,\n [submitting, emailError, issueDescription],\n );\n\n return (\n <>\n <HelpButton />\n {showHelpModal && (\n <div\n className=\"fixed inset-0 flex items-center justify-center p-4\"\n style={{ backgroundColor: \"rgba(11, 15, 26, 0.5)\", zIndex: 99 }}\n >\n <div className=\"bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative\">\n <button\n className=\"absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <div className=\"block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm\">\n <a\n href=\"https://docs.copilotkit.ai/coagents/troubleshooting/common-issues\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Visit the Troubleshooting and FAQ section in the docs\n </a>\n </div>\n <div className=\"block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <div className=\"block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n <form onSubmit={handleSubmit} className=\"flex flex-col space-y-2\">\n <div>\n <label htmlFor=\"feedback\" className=\"block text-sm font-medium text-gray-700 mb-1\">\n Let us know what your issue is:\n </label>\n <textarea\n id=\"feedback\"\n rows={4}\n className=\"w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500\"\n placeholder=\"A Loom link / screen recording is always great!\"\n onChange={(e) => setIssueDescription(e.target.value)}\n value={issueDescription}\n required\n ></textarea>\n </div>\n <div>\n <label htmlFor=\"email\" className=\"block text-sm font-medium text-gray-700 mb-1\">\n Email (optional):\n </label>\n <input\n type=\"email\"\n id=\"email\"\n className={`w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? \"border-red-500\" : \"\"}`}\n placeholder=\"Enter your email for follow-up\"\n onChange={(e) => {\n setEmail(e.target.value);\n setEmailError(\"\");\n }}\n value={email}\n />\n {emailError && <p className=\"text-red-500 text-sm mt-1\">{emailError}</p>}\n </div>\n <div className=\"bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg\">\n <button\n type=\"submit\"\n onClick={handleSubmit}\n disabled={submitButtonDisabled}\n style={\n submitButtonDisabled\n ? { backgroundColor: \"rgb(216, 216, 216)\", color: \"rgb(129, 129, 129)\" }\n : undefined\n }\n className=\"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-500 text-base font-medium text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:shadow-none\"\n >\n {submitting ? <LoadingSpinnerIcon color=\"white\" /> : \"Submit\"}\n </button>\n </div>\n </form>\n </div>\n </div>\n )}\n </>\n );\n}\n","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({ color = \"rgb(107 114 128)\" }: { color?: string }) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyC;;;ACerC;AAYG,IAAM,YAAY,MACvB;AAAA,EAAC;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CAAC,SAAI,WAAU,yEACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,OACE,uBACI,EAAE,iBAAiB,sBAAsB,OAAO,qBAAqB,IACrE;AAAA,gBAEN,WAAU;AAAA,gBAET,uBAAa,6CAAC,sBAAmB,OAAM,SAAQ,IAAK;AAAA;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["import_jsx_runtime","email"]}
1
+ {"version":3,"sources":["../../../src/components/help-modal/index.tsx","../../../src/components/help-modal/modal.tsx","../../../src/components/help-modal/icons.tsx"],"sourcesContent":["export { CopilotKitHelpModal } from \"./modal\";\n","import React, { useMemo, useState, useRef, useEffect } from \"react\";\nimport { CloseIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n // Close popover when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n popoverRef.current &&\n !popoverRef.current.contains(event.target as Node) &&\n buttonRef.current &&\n !buttonRef.current.contains(event.target as Node)\n ) {\n setShowHelpModal(false);\n }\n };\n\n if (showHelpModal) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [showHelpModal]);\n\n const HelpButton = () => (\n <button\n ref={buttonRef}\n onClick={() => setShowHelpModal(!showHelpModal)}\n className=\"copilotKitDebugMenuTriggerButton relative\"\n aria-label=\"Open Help\"\n >\n Help\n </button>\n );\n\n return (\n <div className=\"relative\">\n <HelpButton />\n {showHelpModal && (\n <div\n ref={popoverRef}\n className=\"absolute mt-2 z-50\"\n style={{\n top: \"100%\",\n right: \"-120px\",\n width: \"380px\",\n }}\n >\n <div className=\"bg-white rounded-lg shadow-xl w-full p-4 flex-col relative\">\n <button\n className=\"absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://docs.copilotkit.ai/coagents/troubleshooting/common-issues\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Visit the Troubleshooting and FAQ section in the docs\n </a>\n </div>\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n}\n","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({ color = \"rgb(107 114 128)\" }: { color?: string }) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA4D;;;ACexD;AAYG,IAAM,YAAY,MACvB;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,aAAY;AAAA,IACZ,QAAO;AAAA,IACP,OAAM;AAAA,IACN,QAAO;AAAA,IAEP,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wBAAuB;AAAA;AAC9E;;;ADPE,IAAAA,sBAAA;AA5BG,SAAS,sBAAsB;AACpC,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAS,KAAK;AACxD,QAAM,gBAAY,qBAA0B,IAAI;AAChD,Q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A;AAAA,YAED,GACF;AAAA,YACA,6CAAC,SAAI,WAAU,4BACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,QAAO;AAAA,gBACP,KAAI;AAAA,gBACL;AAAA;AAAA,YAED,GACF;AAAA,YACA,6CAAC,SAAI,WAAU,4BACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,QAAO;AAAA,gBACP,KAAI;AAAA,gBACL;AAAA;AAAA,YAED,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["import_jsx_runtime"]}
@@ -1,7 +1,7 @@
1
1
  import "../../chunk-KXE2JCUH.mjs";
2
2
  import {
3
3
  CopilotKitHelpModal
4
- } from "../../chunk-TI7SY2RI.mjs";
4
+ } from "../../chunk-YC4NBUGE.mjs";
5
5
  import "../../chunk-BH6PCAAL.mjs";
6
6
  import "../../chunk-MRXNTQOX.mjs";
7
7
  export {
@@ -16,26 +16,6 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var __async = (__this, __arguments, generator) => {
20
- return new Promise((resolve, reject) => {
21
- var fulfilled = (value) => {
22
- try {
23
- step(generator.next(value));
24
- } catch (e) {
25
- reject(e);
26
- }
27
- };
28
- var rejected = (value) => {
29
- try {
30
- step(generator.throw(value));
31
- } catch (e) {
32
- reject(e);
33
- }
34
- };
35
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
36
- step((generator = generator.apply(__this, __arguments)).next());
37
- });
38
- };
39
19
 
40
20
  // src/components/help-modal/modal.tsx
41
21
  var modal_exports = {};
@@ -60,101 +40,49 @@ var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
40
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
61
41
  }
62
42
  );
63
- var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
64
- "svg",
65
- {
66
- style: {
67
- animation: "copilotKitSpinAnimation 1s linear infinite",
68
- color
69
- },
70
- width: "24",
71
- height: "24",
72
- xmlns: "http://www.w3.org/2000/svg",
73
- fill: "none",
74
- viewBox: "0 0 24 24",
75
- children: [
76
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
77
- "circle",
78
- {
79
- style: { opacity: 0.25 },
80
- cx: "12",
81
- cy: "12",
82
- r: "10",
83
- stroke: "currentColor",
84
- strokeWidth: "4"
85
- }
86
- ),
87
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
- "path",
89
- {
90
- style: { opacity: 0.75 },
91
- fill: "currentColor",
92
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
93
- }
94
- )
95
- ]
96
- }
97
- );
98
43
 
99
44
  // src/components/help-modal/modal.tsx
100
45
  var import_jsx_runtime2 = require("react/jsx-runtime");
101
46
  function CopilotKitHelpModal() {
102
47
  const [showHelpModal, setShowHelpModal] = (0, import_react.useState)(false);
103
- const [issueDescription, setIssueDescription] = (0, import_react.useState)("");
104
- const [email, setEmail] = (0, import_react.useState)("");
105
- const [emailError, setEmailError] = (0, import_react.useState)("");
106
- const [submitting, setSubmitting] = (0, import_react.useState)(false);
107
- const validateEmail = (email2) => {
108
- const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
109
- return re.test(email2);
110
- };
111
- const handleSubmit = (e) => __async(this, null, function* () {
112
- e.preventDefault();
113
- if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
114
- setEmailError("Please enter a valid email address");
115
- return;
48
+ const buttonRef = (0, import_react.useRef)(null);
49
+ const popoverRef = (0, import_react.useRef)(null);
50
+ (0, import_react.useEffect)(() => {
51
+ const handleClickOutside = (event) => {
52
+ if (popoverRef.current && !popoverRef.current.contains(event.target) && buttonRef.current && !buttonRef.current.contains(event.target)) {
53
+ setShowHelpModal(false);
54
+ }
55
+ };
56
+ if (showHelpModal) {
57
+ document.addEventListener("mousedown", handleClickOutside);
116
58
  }
117
- setSubmitting(true);
118
- yield fetch("https://api.segment.io/v1/track", {
119
- method: "POST",
120
- headers: {
121
- "Content-Type": "application/json"
122
- },
123
- body: JSON.stringify({
124
- event: "oss.dev-console.help",
125
- anonymousId: window.crypto.randomUUID(),
126
- properties: { email, text: issueDescription },
127
- writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
128
- })
129
- });
130
- setEmailError("");
131
- setEmail("");
132
- setIssueDescription("");
133
- setSubmitting(false);
134
- setShowHelpModal(false);
135
- });
59
+ return () => {
60
+ document.removeEventListener("mousedown", handleClickOutside);
61
+ };
62
+ }, [showHelpModal]);
136
63
  const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
137
64
  "button",
138
65
  {
139
- onClick: () => setShowHelpModal(true),
140
- style: { width: "50px", height: "30px", marginRight: "0.25rem" },
141
- className: "text-sm p-0 bg-transparent rounded border border-blue-500",
66
+ ref: buttonRef,
67
+ onClick: () => setShowHelpModal(!showHelpModal),
68
+ className: "copilotKitDebugMenuTriggerButton relative",
142
69
  "aria-label": "Open Help",
143
70
  children: "Help"
144
71
  }
145
72
  );
146
- const submitButtonDisabled = (0, import_react.useMemo)(
147
- () => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
148
- [submitting, emailError, issueDescription]
149
- );
150
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
73
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "relative", children: [
151
74
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpButton, {}),
152
75
  showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
153
76
  "div",
154
77
  {
155
- className: "fixed inset-0 flex items-center justify-center p-4",
156
- style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
157
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
78
+ ref: popoverRef,
79
+ className: "absolute mt-2 z-50",
80
+ style: {
81
+ top: "100%",
82
+ right: "-120px",
83
+ width: "380px"
84
+ },
85
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bg-white rounded-lg shadow-xl w-full p-4 flex-col relative", children: [
158
86
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
159
87
  "button",
160
88
  {
@@ -167,7 +95,7 @@ function CopilotKitHelpModal() {
167
95
  ),
168
96
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
169
97
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "space-y-4 mb-4", children: [
170
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
98
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
171
99
  "a",
172
100
  {
173
101
  href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
@@ -176,7 +104,7 @@ function CopilotKitHelpModal() {
176
104
  children: "Visit the Troubleshooting and FAQ section in the docs"
177
105
  }
178
106
  ) }),
179
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
107
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
180
108
  "a",
181
109
  {
182
110
  href: "https://go.copilotkit.ai/dev-console-support-discord",
@@ -185,7 +113,7 @@ function CopilotKitHelpModal() {
185
113
  children: "Go to Discord Support Channel (Community Support)"
186
114
  }
187
115
  ) }),
188
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
116
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
189
117
  "a",
190
118
  {
191
119
  href: "https://go.copilotkit.ai/dev-console-support-slack",
@@ -194,52 +122,6 @@ function CopilotKitHelpModal() {
194
122
  children: "Apply for Priority Direct Slack Support"
195
123
  }
196
124
  ) })
197
- ] }),
198
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
199
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
200
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
201
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
202
- "textarea",
203
- {
204
- id: "feedback",
205
- rows: 4,
206
- className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
207
- placeholder: "A Loom link / screen recording is always great!",
208
- onChange: (e) => setIssueDescription(e.target.value),
209
- value: issueDescription,
210
- required: true
211
- }
212
- )
213
- ] }),
214
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
215
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
216
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
217
- "input",
218
- {
219
- type: "email",
220
- id: "email",
221
- className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
222
- placeholder: "Enter your email for follow-up",
223
- onChange: (e) => {
224
- setEmail(e.target.value);
225
- setEmailError("");
226
- },
227
- value: email
228
- }
229
- ),
230
- emailError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
231
- ] }),
232
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
233
- "button",
234
- {
235
- type: "submit",
236
- onClick: handleSubmit,
237
- disabled: submitButtonDisabled,
238
- style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
239
- className: "w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-500 text-base font-medium text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:shadow-none",
240
- children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
241
- }
242
- ) })
243
125
  ] })
244
126
  ] })
245
127
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/help-modal/modal.tsx","../../../src/components/help-modal/icons.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport { CloseIcon, LifeBuoyIcon, LoadingSpinnerIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const [issueDescription, setIssueDescription] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [emailError, setEmailError] = useState(\"\");\n const [submitting, setSubmitting] = useState(false);\n\n const validateEmail = (email: string) => {\n const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return re.test(email);\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (email?.length > 0 && !validateEmail(email)) {\n setEmailError(\"Please enter a valid email address\");\n return;\n }\n setSubmitting(true);\n\n await fetch(\"https://api.segment.io/v1/track\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n event: \"oss.dev-console.help\",\n anonymousId: window.crypto.randomUUID(),\n properties: { email, text: issueDescription },\n writeKey: \"q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW\",\n }),\n });\n\n // Reset\n setEmailError(\"\");\n setEmail(\"\");\n setIssueDescription(\"\");\n setSubmitting(false);\n setShowHelpModal(false);\n };\n\n const HelpButton = () => (\n <button\n onClick={() => setShowHelpModal(true)}\n style={{ width: \"50px\", height: \"30px\", marginRight: \"0.25rem\" }}\n className=\"text-sm p-0 bg-transparent rounded border border-blue-500\"\n aria-label=\"Open Help\"\n >\n Help\n </button>\n );\n\n const submitButtonDisabled = useMemo(\n () => submitting || !!emailError || issueDescription == null || issueDescription?.length == 0,\n [submitting, emailError, issueDescription],\n );\n\n return (\n <>\n <HelpButton />\n {showHelpModal && (\n <div\n className=\"fixed inset-0 flex items-center justify-center p-4\"\n style={{ backgroundColor: \"rgba(11, 15, 26, 0.5)\", zIndex: 99 }}\n >\n <div className=\"bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative\">\n <button\n className=\"absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <div className=\"block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm\">\n <a\n href=\"https://docs.copilotkit.ai/coagents/troubleshooting/common-issues\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Visit the Troubleshooting and FAQ section in the docs\n </a>\n </div>\n <div className=\"block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <div className=\"block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n <form onSubmit={handleSubmit} className=\"flex flex-col space-y-2\">\n <div>\n <label htmlFor=\"feedback\" className=\"block text-sm font-medium text-gray-700 mb-1\">\n Let us know what your issue is:\n </label>\n <textarea\n id=\"feedback\"\n rows={4}\n className=\"w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500\"\n placeholder=\"A Loom link / screen recording is always great!\"\n onChange={(e) => setIssueDescription(e.target.value)}\n value={issueDescription}\n required\n ></textarea>\n </div>\n <div>\n <label htmlFor=\"email\" className=\"block text-sm font-medium text-gray-700 mb-1\">\n Email (optional):\n </label>\n <input\n type=\"email\"\n id=\"email\"\n className={`w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? \"border-red-500\" : \"\"}`}\n placeholder=\"Enter your email for follow-up\"\n onChange={(e) => {\n setEmail(e.target.value);\n setEmailError(\"\");\n }}\n value={email}\n />\n {emailError && <p className=\"text-red-500 text-sm mt-1\">{emailError}</p>}\n </div>\n <div className=\"bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg\">\n <button\n type=\"submit\"\n onClick={handleSubmit}\n disabled={submitButtonDisabled}\n style={\n submitButtonDisabled\n ? { backgroundColor: \"rgb(216, 216, 216)\", color: \"rgb(129, 129, 129)\" }\n : undefined\n }\n className=\"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-500 text-base font-medium text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:shadow-none\"\n >\n {submitting ? <LoadingSpinnerIcon color=\"white\" /> : \"Submit\"}\n </button>\n </div>\n </form>\n </div>\n </div>\n )}\n </>\n );\n}\n","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({ color = \"rgb(107 114 128)\" }: { color?: string }) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyC;;;ACerC;AAYG,IAAM,YAAY,MACvB;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,aAAY;AAAA,IACZ,QAAO;AAAA,IACP,OAAM;AAAA,IACN,QAAO;AAAA,IAEP,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wBAAuB;AAAA;AAC9E;AAGK,IAAM,qBAAqB,CAAC,EAAE,QAAQ,mBAAmB,MAC9D;AAAA,EAAC;AAAA;AAAA,IACC,OAAO;AAAA,MACL,WAAW;AAAA,MACX;AAAA,IACF;AAAA,IACA,OAAM;AAAA,IACN,QAAO;AAAA,IACP,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IAER;AAAA;AAAA,QA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AAAA,YAED,GACF;AAAA,aACF;AAAA,UACA,8CAAC,UAAK,UAAU,cAAc,WAAU,2BACtC;AAAA,0DAAC,SACC;AAAA,2DAAC,WAAM,SAAQ,YAAW,WAAU,gDAA+C,6CAEnF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,MAAM;AAAA,kBACN,WAAU;AAAA,kBACV,aAAY;AAAA,kBACZ,UAAU,CAAC,MAAM,oBAAoB,EAAE,OAAO,KAAK;AAAA,kBACnD,OAAO;AAAA,kBACP,UAAQ;AAAA;AAAA,cACT;AAAA,eACH;AAAA,YACA,8CAAC,SACC;AAAA,2DAAC,WAAM,SAAQ,SAAQ,WAAU,gDAA+C,+BAEhF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,kBACL,IAAG;AAAA,kBACH,WAAW,6FAA6F,aAAa,mBAAmB;AAAA,kBACxI,aAAY;AAAA,kBACZ,UAAU,CAAC,MAAM;AACf,6BAAS,EAAE,OAAO,KAAK;AACvB,kCAAc,EAAE;AAAA,kBAClB;AAAA,kBACA,OAAO;AAAA;AAAA,cACT;AAAA,cACC,cAAc,6CAAC,OAAE,WAAU,6BAA6B,sBAAW;AAAA,eACtE;AAAA,YACA,6CAAC,SAAI,WAAU,yEACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,OACE,uBACI,EAAE,iBAAiB,sBAAsB,OAAO,qBAAqB,IACrE;AAAA,gBAEN,WAAU;AAAA,gBAET,uBAAa,6CAAC,sBAAmB,OAAM,SAAQ,IAAK;AAAA;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["import_jsx_runtime","email"]}
1
+ {"version":3,"sources":["../../../src/components/help-modal/modal.tsx","../../../src/components/help-modal/icons.tsx"],"sourcesContent":["import React, { useMemo, useState, useRef, useEffect } from \"react\";\nimport { CloseIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n // Close popover when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n popoverRef.current &&\n !popoverRef.current.contains(event.target as Node) &&\n buttonRef.current &&\n !buttonRef.current.contains(event.target as Node)\n ) {\n setShowHelpModal(false);\n }\n };\n\n if (showHelpModal) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [showHelpModal]);\n\n const HelpButton = () => (\n <button\n ref={buttonRef}\n onClick={() => setShowHelpModal(!showHelpModal)}\n className=\"copilotKitDebugMenuTriggerButton relative\"\n aria-label=\"Open Help\"\n >\n Help\n </button>\n );\n\n return (\n <div className=\"relative\">\n <HelpButton />\n {showHelpModal && (\n <div\n ref={popoverRef}\n className=\"absolute mt-2 z-50\"\n style={{\n top: \"100%\",\n right: \"-120px\",\n width: \"380px\",\n }}\n >\n <div className=\"bg-white rounded-lg shadow-xl w-full p-4 flex-col relative\">\n <button\n className=\"absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://docs.copilotkit.ai/coagents/troubleshooting/common-issues\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Visit the Troubleshooting and FAQ section in the docs\n </a>\n </div>\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n}\n","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({ color = \"rgb(107 114 128)\" }: { color?: string }) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA4D;;;ACexD;AAYG,IAAM,YAAY,MACvB;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,aAAY;AAAA,IACZ,QAAO;AAAA,IACP,OAAM;AAAA,IACN,QAAO;AAAA,IAEP,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wBAAuB;AAAA;AAC9E;;;ADPE,IAAAA,sBAAA;AA5BG,SAAS,sBAAsB;AACpC,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAS,KAAK;AACxD,QAAM,gBAAY,qBAA0B,IAAI;AAChD,QAAM,iBAAa,qBAAuB,IAAI;AAG9C,8BAAU,MAAM;AACd,UAAM,qBAAqB,CAAC,UAAsB;AAChD,UACE,WAAW,WACX,CAAC,WAAW,QAAQ,SAAS,MAAM,MAAc,KACjD,UAAU,WACV,CAAC,UAAU,QAAQ,SAAS,MAAM,MAAc,GAChD;AACA,yBAAiB,KAAK;AAAA,MACxB;AAAA,IACF;AAEA,QAAI,eAAe;AACjB,eAAS,iBAAiB,aAAa,kBAAkB;AAAA,IAC3D;AAEA,WAAO,MAAM;AACX,eAAS,oBAAoB,aAAa,kBAAkB;AAAA,IAC9D;AAAA,EACF,GAAG,CAAC,aAAa,CAAC;AAElB,QAAM,aAAa,MACjB;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,SAAS,MAAM,iBAAiB,CAAC,aAAa;AAAA,MAC9C,WAAU;AAAA,MACV,cAAW;AAAA,MACZ;AAAA;AAAA,EAED;AAGF,SACE,8CAAC,SAAI,WAAU,YACb;AAAA,iDAAC,cAAW;AAAA,IACX,iBACC;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAU;AAAA,QACV,OAAO;AAAA,UACL,KAAK;AAAA,UACL,OAAO;AAAA,UACP,OAAO;AAAA,QACT;AAAA,QAEA,wDAAC,SAAI,WAAU,8DACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,KAAK,QAAQ,OAAO,OAAO;AAAA,cACpC,SAAS,MAAM,iBAAiB,KAAK;AAAA,cACrC,cAAW;AAAA,cAEX,uDAAC,aAAU;AAAA;AAAA,UACb;AAAA,UACA,6CAAC,SAAI,WAAU,mCACb,uDAAC,QAAG,WAAU,sBAAqB,0BAAY,GACjD;AAAA,UACA,8CAAC,SAAI,WAAU,kBACb;AAAA,yDAAC,SAAI,WAAU,4BACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,QAAO;AAAA,gBACP,KAAI;AAAA,gBACL;AAAA;AAAA,YAED,GACF;AAAA,YACA,6CAAC,SAAI,WAAU,4BACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,QAAO;AAAA,gBACP,KAAI;AAAA,gBACL;AAAA;AAAA,YAED,GACF;AAAA,YACA,6CAAC,SAAI,WAAU,4BACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,QAAO;AAAA,gBACP,KAAI;AAAA,gBACL;AAAA;AAAA,YAED,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["import_jsx_runtime"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CopilotKitHelpModal
3
- } from "../../chunk-TI7SY2RI.mjs";
3
+ } from "../../chunk-YC4NBUGE.mjs";
4
4
  import "../../chunk-BH6PCAAL.mjs";
5
5
  import "../../chunk-MRXNTQOX.mjs";
6
6
  export {