@copilotkit/react-ui 0.14.0-alpha.5 → 0.14.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/.turbo/turbo-build.log +80 -80
  2. package/CHANGELOG.md +31 -0
  3. package/dist/chunk-2KAF7NKC.mjs +484 -0
  4. package/dist/chunk-2KAF7NKC.mjs.map +1 -0
  5. package/dist/chunk-5KEDV5VC.mjs +27 -0
  6. package/dist/chunk-5KEDV5VC.mjs.map +1 -0
  7. package/dist/chunk-6LAZQHEB.mjs +129 -0
  8. package/dist/chunk-6LAZQHEB.mjs.map +1 -0
  9. package/dist/chunk-7NSRDJ5C.mjs +3 -0
  10. package/dist/chunk-7NSRDJ5C.mjs.map +1 -0
  11. package/dist/chunk-C34L4AWW.mjs +39 -0
  12. package/dist/chunk-C34L4AWW.mjs.map +1 -0
  13. package/dist/chunk-CF3BK4OX.mjs +53 -0
  14. package/dist/chunk-CF3BK4OX.mjs.map +1 -0
  15. package/dist/chunk-CNQX2VY3.mjs +66 -0
  16. package/dist/chunk-CNQX2VY3.mjs.map +1 -0
  17. package/dist/chunk-GCOPYGHH.mjs +27 -0
  18. package/dist/chunk-GCOPYGHH.mjs.map +1 -0
  19. package/dist/chunk-H4VKQGVU.mjs +3 -0
  20. package/dist/chunk-H4VKQGVU.mjs.map +1 -0
  21. package/dist/chunk-IJLMKBSZ.mjs +25 -0
  22. package/dist/chunk-IJLMKBSZ.mjs.map +1 -0
  23. package/dist/chunk-INCNMGJ7.mjs +72 -0
  24. package/dist/chunk-INCNMGJ7.mjs.map +1 -0
  25. package/dist/chunk-IU3WTXLQ.mjs +3 -0
  26. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  27. package/dist/chunk-M3CZWJI3.mjs +44 -0
  28. package/dist/chunk-M3CZWJI3.mjs.map +1 -0
  29. package/dist/chunk-MC6KTH4X.mjs +12 -0
  30. package/dist/chunk-MC6KTH4X.mjs.map +1 -0
  31. package/dist/chunk-MRXNTQOX.mjs +55 -0
  32. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  33. package/dist/chunk-OHWEJUCS.mjs +18 -0
  34. package/dist/chunk-OHWEJUCS.mjs.map +1 -0
  35. package/dist/chunk-OOBQC5H6.mjs +34 -0
  36. package/dist/chunk-OOBQC5H6.mjs.map +1 -0
  37. package/dist/chunk-POVINPXX.mjs +26 -0
  38. package/dist/chunk-POVINPXX.mjs.map +1 -0
  39. package/dist/chunk-Q6YO7LDK.mjs +40 -0
  40. package/dist/chunk-Q6YO7LDK.mjs.map +1 -0
  41. package/dist/chunk-RPTRCFSO.mjs +42 -0
  42. package/dist/chunk-RPTRCFSO.mjs.map +1 -0
  43. package/dist/chunk-SEH5PQVW.mjs +52 -0
  44. package/dist/chunk-SEH5PQVW.mjs.map +1 -0
  45. package/dist/chunk-SHOTWRKC.mjs +18 -0
  46. package/dist/chunk-SHOTWRKC.mjs.map +1 -0
  47. package/dist/chunk-SRBUGQTM.mjs +109 -0
  48. package/dist/chunk-SRBUGQTM.mjs.map +1 -0
  49. package/dist/chunk-TEYIQHMK.mjs +12 -0
  50. package/dist/chunk-TEYIQHMK.mjs.map +1 -0
  51. package/dist/chunk-U6NJWGTV.mjs +3 -0
  52. package/dist/chunk-U6NJWGTV.mjs.map +1 -0
  53. package/dist/chunk-VGX2W5ZB.mjs +28 -0
  54. package/dist/chunk-VGX2W5ZB.mjs.map +1 -0
  55. package/dist/chunk-XGUBRIUV.mjs +72 -0
  56. package/dist/chunk-XGUBRIUV.mjs.map +1 -0
  57. package/dist/chunk-ZYC5YVDO.mjs +21 -0
  58. package/dist/chunk-ZYC5YVDO.mjs.map +1 -0
  59. package/dist/components/chat-components/chat-list.mjs +12 -440
  60. package/dist/components/chat-components/chat-list.mjs.map +1 -1
  61. package/dist/components/chat-components/chat-message-actions.mjs +7 -168
  62. package/dist/components/chat-components/chat-message-actions.mjs.map +1 -1
  63. package/dist/components/chat-components/chat-message.mjs +10 -403
  64. package/dist/components/chat-components/chat-message.mjs.map +1 -1
  65. package/dist/components/chat-components/chat-panel.mjs +9 -301
  66. package/dist/components/chat-components/chat-panel.mjs.map +1 -1
  67. package/dist/components/chat-components/chat-scroll-anchor.mjs +4 -44
  68. package/dist/components/chat-components/chat-scroll-anchor.mjs.map +1 -1
  69. package/dist/components/chat-components/clear-history.mjs +25 -249
  70. package/dist/components/chat-components/clear-history.mjs.map +1 -1
  71. package/dist/components/chat-components/copilot-chat.mjs +21 -809
  72. package/dist/components/chat-components/copilot-chat.mjs.map +1 -1
  73. package/dist/components/chat-components/default-empty-screen.mjs +7 -175
  74. package/dist/components/chat-components/default-empty-screen.mjs.map +1 -1
  75. package/dist/components/chat-components/external-link.mjs +3 -25
  76. package/dist/components/chat-components/external-link.mjs.map +1 -1
  77. package/dist/components/chat-components/markdown.mjs +3 -10
  78. package/dist/components/chat-components/markdown.mjs.map +1 -1
  79. package/dist/components/chat-components/prompt-form.mjs +8 -227
  80. package/dist/components/chat-components/prompt-form.mjs.map +1 -1
  81. package/dist/components/chat-components/theme-toggle.mjs +14 -130
  82. package/dist/components/chat-components/theme-toggle.mjs.map +1 -1
  83. package/dist/components/chat-components/toaster.mjs +3 -7
  84. package/dist/components/chat-components/toaster.mjs.map +1 -1
  85. package/dist/components/chat-components/ui/alert-dialog.mjs +5 -199
  86. package/dist/components/chat-components/ui/alert-dialog.mjs.map +1 -1
  87. package/dist/components/chat-components/ui/badge.mjs +7 -49
  88. package/dist/components/chat-components/ui/badge.mjs.map +1 -1
  89. package/dist/components/chat-components/ui/button.mjs +4 -85
  90. package/dist/components/chat-components/ui/button.mjs.map +1 -1
  91. package/dist/components/chat-components/ui/codeblock.mjs +7 -283
  92. package/dist/components/chat-components/ui/codeblock.mjs.map +1 -1
  93. package/dist/components/chat-components/ui/dialog.mjs +25 -93
  94. package/dist/components/chat-components/ui/dialog.mjs.map +1 -1
  95. package/dist/components/chat-components/ui/dropdown-menu.mjs +8 -61
  96. package/dist/components/chat-components/ui/dropdown-menu.mjs.map +1 -1
  97. package/dist/components/chat-components/ui/icons.mjs +4 -554
  98. package/dist/components/chat-components/ui/icons.mjs.map +1 -1
  99. package/dist/components/chat-components/ui/input.mjs +7 -48
  100. package/dist/components/chat-components/ui/input.mjs.map +1 -1
  101. package/dist/components/chat-components/ui/label.mjs +9 -51
  102. package/dist/components/chat-components/ui/label.mjs.map +1 -1
  103. package/dist/components/chat-components/ui/select.mjs +23 -106
  104. package/dist/components/chat-components/ui/select.mjs.map +1 -1
  105. package/dist/components/chat-components/ui/separator.mjs +4 -68
  106. package/dist/components/chat-components/ui/separator.mjs.map +1 -1
  107. package/dist/components/chat-components/ui/sheet.mjs +23 -92
  108. package/dist/components/chat-components/ui/sheet.mjs.map +1 -1
  109. package/dist/components/chat-components/ui/switch.mjs +8 -53
  110. package/dist/components/chat-components/ui/switch.mjs.map +1 -1
  111. package/dist/components/chat-components/ui/textarea.mjs +7 -48
  112. package/dist/components/chat-components/ui/textarea.mjs.map +1 -1
  113. package/dist/components/chat-components/ui/tooltip.mjs +4 -72
  114. package/dist/components/chat-components/ui/tooltip.mjs.map +1 -1
  115. package/dist/components/index.mjs +25 -925
  116. package/dist/components/index.mjs.map +1 -1
  117. package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs +24 -920
  118. package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs.map +1 -1
  119. package/dist/components/sidebar/copilot-sidebar.mjs +22 -842
  120. package/dist/components/sidebar/copilot-sidebar.mjs.map +1 -1
  121. package/dist/components/sidebar/sidebar-context.mjs +3 -10
  122. package/dist/components/sidebar/sidebar-context.mjs.map +1 -1
  123. package/dist/context/index.mjs +2 -0
  124. package/dist/context/index.mjs.map +1 -1
  125. package/dist/hooks/index.mjs +2 -0
  126. package/dist/hooks/index.mjs.map +1 -1
  127. package/dist/hooks/use-at-bottom.mjs +3 -19
  128. package/dist/hooks/use-at-bottom.mjs.map +1 -1
  129. package/dist/hooks/use-copy-to-clipboard.mjs +3 -26
  130. package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -1
  131. package/dist/hooks/use-enter-submit.mjs +3 -16
  132. package/dist/hooks/use-enter-submit.mjs.map +1 -1
  133. package/dist/index.mjs +28 -925
  134. package/dist/index.mjs.map +1 -1
  135. package/dist/lib/utils.mjs +3 -62
  136. package/dist/lib/utils.mjs.map +1 -1
  137. package/dist/lib/utils.test.mjs +1 -0
  138. package/dist/lib/utils.test.mjs.map +1 -1
  139. package/dist/types/index.mjs +2 -0
  140. package/dist/types/index.mjs.map +1 -1
  141. package/dist/types/types.mjs +2 -0
  142. package/dist/types/types.mjs.map +1 -1
  143. package/package.json +4 -4
@@ -1,254 +1,30 @@
1
- "use client";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
- var __async = (__this, __arguments, generator) => {
34
- return new Promise((resolve, reject) => {
35
- var fulfilled = (value) => {
36
- try {
37
- step(generator.next(value));
38
- } catch (e) {
39
- reject(e);
40
- }
41
- };
42
- var rejected = (value) => {
43
- try {
44
- step(generator.throw(value));
45
- } catch (e) {
46
- reject(e);
47
- }
48
- };
49
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
50
- step((generator = generator.apply(__this, __arguments)).next());
51
- });
52
- };
1
+ import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction } from '../../chunk-SRBUGQTM.mjs';
2
+ import { Button } from '../../chunk-M3CZWJI3.mjs';
3
+ import { IconSpinner } from '../../chunk-2KAF7NKC.mjs';
4
+ import '../../chunk-Q6YO7LDK.mjs';
5
+ import { __async } from '../../chunk-MRXNTQOX.mjs';
6
+ import * as React from 'react';
7
+ import { useRouter } from 'next/navigation';
8
+ import { toast } from 'react-hot-toast';
9
+ import { jsxs, jsx } from 'react/jsx-runtime';
53
10
 
54
- // src/components/chat-components/clear-history.tsx
55
- import * as React4 from "react";
56
- import { useRouter } from "next/navigation";
57
- import { toast } from "react-hot-toast";
58
-
59
- // src/components/chat-components/ui/button.tsx
60
- import * as React from "react";
61
- import { Slot } from "@radix-ui/react-slot";
62
- import { cva } from "class-variance-authority";
63
-
64
- // src/lib/utils.ts
65
- import { clsx } from "clsx";
66
- import { customAlphabet } from "nanoid";
67
- import { twMerge } from "tailwind-merge";
68
- function cn(...inputs) {
69
- return twMerge(clsx(inputs));
70
- }
71
- var nanoid = customAlphabet(
72
- "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
73
- 7
74
- );
75
-
76
- // src/components/chat-components/ui/button.tsx
77
- import { jsx } from "react/jsx-runtime";
78
- var buttonVariants = cva(
79
- "inline-flex items-center justify-center rounded-md text-sm font-medium shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
80
- {
81
- variants: {
82
- variant: {
83
- default: "bg-primary text-primary-foreground shadow-md hover:bg-primary/90",
84
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
85
- outline: "border border-input hover:bg-accent hover:text-accent-foreground",
86
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
87
- ghost: "shadow-none hover:bg-accent hover:text-accent-foreground",
88
- link: "text-primary underline-offset-4 shadow-none hover:underline"
89
- },
90
- size: {
91
- default: "h-8 px-4 py-2",
92
- sm: "h-8 rounded-md px-3",
93
- lg: "h-11 rounded-md px-8",
94
- icon: "h-8 w-8 p-0"
95
- }
96
- },
97
- defaultVariants: {
98
- variant: "default",
99
- size: "default"
100
- }
101
- }
102
- );
103
- var Button = React.forwardRef(
104
- (_a, ref) => {
105
- var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild"]);
106
- const Comp = asChild ? Slot : "button";
107
- return /* @__PURE__ */ jsx(Comp, __spreadValues({ className: cn(buttonVariants({ variant, size, className })), ref }, props));
108
- }
109
- );
110
- Button.displayName = "Button";
111
-
112
- // src/components/chat-components/ui/alert-dialog.tsx
113
- import * as React2 from "react";
114
- import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
115
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
116
- var AlertDialog = AlertDialogPrimitive.Root;
117
- var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
118
- var AlertDialogPortal = (_a) => {
119
- var _b = _a, {
120
- className,
121
- children
122
- } = _b, props = __objRest(_b, [
123
- "className",
124
- "children"
125
- ]);
126
- return /* @__PURE__ */ jsx2(AlertDialogPrimitive.Portal, __spreadProps(__spreadValues({ className: cn(className) }, props), { children: /* @__PURE__ */ jsx2("div", { className: "fixed inset-0 z-50 flex items-end justify-center sm:items-center", children }) }));
127
- };
128
- AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName;
129
- var AlertDialogOverlay = React2.forwardRef((_a, ref) => {
130
- var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
131
- return /* @__PURE__ */ jsx2(
132
- AlertDialogPrimitive.Overlay,
133
- __spreadProps(__spreadValues({
134
- className: cn(
135
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-opacity animate-in fade-in",
136
- className
137
- )
138
- }, props), {
139
- ref
140
- })
141
- );
142
- });
143
- AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
144
- var AlertDialogContent = React2.forwardRef((_a, ref) => {
145
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
146
- return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
147
- /* @__PURE__ */ jsx2(AlertDialogOverlay, {}),
148
- /* @__PURE__ */ jsx2(
149
- AlertDialogPrimitive.Content,
150
- __spreadValues({
151
- ref,
152
- className: cn(
153
- "fixed z-50 grid w-full max-w-lg scale-100 gap-4 border bg-background p-6 opacity-100 shadow-lg animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full",
154
- className
155
- )
156
- }, props)
157
- )
158
- ] });
159
- });
160
- AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
161
- var AlertDialogHeader = (_a) => {
162
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
163
- return /* @__PURE__ */ jsx2("div", __spreadValues({ className: cn("flex flex-col space-y-2 text-center sm:text-left", className) }, props));
164
- };
165
- AlertDialogHeader.displayName = "AlertDialogHeader";
166
- var AlertDialogFooter = (_a) => {
167
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
168
- return /* @__PURE__ */ jsx2(
169
- "div",
170
- __spreadValues({
171
- className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
172
- }, props)
173
- );
174
- };
175
- AlertDialogFooter.displayName = "AlertDialogFooter";
176
- var AlertDialogTitle = React2.forwardRef((_a, ref) => {
177
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
178
- return /* @__PURE__ */ jsx2(
179
- AlertDialogPrimitive.Title,
180
- __spreadValues({
181
- ref,
182
- className: cn("text-lg font-semibold", className)
183
- }, props)
184
- );
185
- });
186
- AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
187
- var AlertDialogDescription = React2.forwardRef((_a, ref) => {
188
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
189
- return /* @__PURE__ */ jsx2(
190
- AlertDialogPrimitive.Description,
191
- __spreadValues({
192
- ref,
193
- className: cn("text-sm text-muted-foreground", className)
194
- }, props)
195
- );
196
- });
197
- AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
198
- var AlertDialogAction = React2.forwardRef((_a, ref) => {
199
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
200
- return /* @__PURE__ */ jsx2(AlertDialogPrimitive.Action, __spreadValues({ ref, className: cn(buttonVariants(), className) }, props));
201
- });
202
- AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
203
- var AlertDialogCancel = React2.forwardRef((_a, ref) => {
204
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
205
- return /* @__PURE__ */ jsx2(
206
- AlertDialogPrimitive.Cancel,
207
- __spreadValues({
208
- ref,
209
- className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)
210
- }, props)
211
- );
212
- });
213
- AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
214
-
215
- // src/components/chat-components/ui/icons.tsx
216
- import * as React3 from "react";
217
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
218
- function IconSpinner(_a) {
219
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
220
- return /* @__PURE__ */ jsx3(
221
- "svg",
222
- __spreadProps(__spreadValues({
223
- xmlns: "http://www.w3.org/2000/svg",
224
- viewBox: "0 0 256 256",
225
- fill: "currentColor",
226
- className: cn("h-4 w-4 animate-spin", className)
227
- }, props), {
228
- children: /* @__PURE__ */ jsx3("path", { d: "M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128Z" })
229
- })
230
- );
231
- }
232
-
233
- // src/components/chat-components/clear-history.tsx
234
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
235
11
  function ClearHistory({ clearChats }) {
236
- const [open, setOpen] = React4.useState(false);
237
- const [isPending, startTransition] = React4.useTransition();
12
+ const [open, setOpen] = React.useState(false);
13
+ const [isPending, startTransition] = React.useTransition();
238
14
  const router = useRouter();
239
- return /* @__PURE__ */ jsxs3(AlertDialog, { open, onOpenChange: setOpen, children: [
240
- /* @__PURE__ */ jsx4(AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(Button, { variant: "ghost", disabled: isPending, children: [
241
- isPending && /* @__PURE__ */ jsx4(IconSpinner, { className: "mr-2" }),
15
+ return /* @__PURE__ */ jsxs(AlertDialog, { open, onOpenChange: setOpen, children: [
16
+ /* @__PURE__ */ jsx(AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", disabled: isPending, children: [
17
+ isPending && /* @__PURE__ */ jsx(IconSpinner, { className: "mr-2" }),
242
18
  "Clear history"
243
19
  ] }) }),
244
- /* @__PURE__ */ jsxs3(AlertDialogContent, { children: [
245
- /* @__PURE__ */ jsxs3(AlertDialogHeader, { children: [
246
- /* @__PURE__ */ jsx4(AlertDialogTitle, { children: "Are you absolutely sure?" }),
247
- /* @__PURE__ */ jsx4(AlertDialogDescription, { children: "This will permanently delete your chat history and remove your data from our servers." })
20
+ /* @__PURE__ */ jsxs(AlertDialogContent, { children: [
21
+ /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
22
+ /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Are you absolutely sure?" }),
23
+ /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This will permanently delete your chat history and remove your data from our servers." })
248
24
  ] }),
249
- /* @__PURE__ */ jsxs3(AlertDialogFooter, { children: [
250
- /* @__PURE__ */ jsx4(AlertDialogCancel, { disabled: isPending, children: "Cancel" }),
251
- /* @__PURE__ */ jsxs3(
25
+ /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
26
+ /* @__PURE__ */ jsx(AlertDialogCancel, { disabled: isPending, children: "Cancel" }),
27
+ /* @__PURE__ */ jsxs(
252
28
  AlertDialogAction,
253
29
  {
254
30
  disabled: isPending,
@@ -265,7 +41,7 @@ function ClearHistory({ clearChats }) {
265
41
  }));
266
42
  },
267
43
  children: [
268
- isPending && /* @__PURE__ */ jsx4(IconSpinner, { className: "mr-2 animate-spin" }),
44
+ isPending && /* @__PURE__ */ jsx(IconSpinner, { className: "mr-2 animate-spin" }),
269
45
  "Delete"
270
46
  ]
271
47
  }
@@ -274,7 +50,7 @@ function ClearHistory({ clearChats }) {
274
50
  ] })
275
51
  ] });
276
52
  }
277
- export {
278
- ClearHistory
279
- };
53
+
54
+ export { ClearHistory };
55
+ //# sourceMappingURL=out.js.map
280
56
  //# sourceMappingURL=clear-history.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/chat-components/clear-history.tsx","../../../src/components/chat-components/ui/button.tsx","../../../src/lib/utils.ts","../../../src/components/chat-components/ui/alert-dialog.tsx","../../../src/components/chat-components/ui/icons.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useRouter } from \"next/navigation\";\nimport { toast } from \"react-hot-toast\";\n\nimport { ServerActionResult } from \"../../types/types\";\nimport { Button } from \"./ui/button\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"./ui/alert-dialog\";\nimport { IconSpinner } from \"./ui/icons\";\n\ninterface ClearHistoryProps {\n clearChats: () => ServerActionResult<void>;\n}\n\nexport function ClearHistory({ clearChats }: ClearHistoryProps) {\n const [open, setOpen] = React.useState(false);\n const [isPending, startTransition] = React.useTransition();\n const router = useRouter();\n\n return (\n <AlertDialog open={open} onOpenChange={setOpen}>\n <AlertDialogTrigger asChild>\n <Button variant=\"ghost\" disabled={isPending}>\n {isPending && <IconSpinner className=\"mr-2\" />}\n Clear history\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This will permanently delete your chat history and remove your data from our servers.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel disabled={isPending}>Cancel</AlertDialogCancel>\n <AlertDialogAction\n disabled={isPending}\n onClick={(event: any) => {\n event.preventDefault();\n startTransition(async () => {\n const result = await clearChats();\n\n if (result && \"error\" in result) {\n toast.error(result.error);\n return;\n }\n\n setOpen(false);\n router.push(\"/\");\n });\n }}\n >\n {isPending && <IconSpinner className=\"mr-2 animate-spin\" />}\n Delete\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-md hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"shadow-none hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 shadow-none hover:underline\",\n },\n size: {\n default: \"h-8 px-4 py-2\",\n sm: \"h-8 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-8 w-8 p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = ({\n className,\n children,\n ...props\n}: AlertDialogPrimitive.AlertDialogPortalProps) => (\n <AlertDialogPrimitive.Portal className={cn(className)} {...props}>\n <div className=\"fixed inset-0 z-50 flex items-end justify-center sm:items-center\">\n {children}\n </div>\n </AlertDialogPrimitive.Portal>\n);\nAlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, children, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-opacity animate-in fade-in\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed z-50 grid w-full max-w-lg scale-100 gap-4 border bg-background p-6 opacity-100 shadow-lg animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full\",\n className,\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(buttonVariants({ variant: \"outline\" }), \"mt-2 sm:mt-0\", className)}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nfunction IconNextChat({\n className,\n inverted,\n ...props\n}: React.ComponentProps<\"svg\"> & { inverted?: boolean }) {\n const id = React.useId();\n\n return (\n <svg\n viewBox=\"0 0 17 17\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <defs>\n <linearGradient\n id={`gradient-${id}-1`}\n x1=\"10.6889\"\n y1=\"10.3556\"\n x2=\"13.8445\"\n y2=\"14.2667\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor={inverted ? \"white\" : \"black\"} />\n <stop offset={1} stopColor={inverted ? \"white\" : \"black\"} stopOpacity={0} />\n </linearGradient>\n <linearGradient\n id={`gradient-${id}-2`}\n x1=\"11.7555\"\n y1=\"4.8\"\n x2=\"11.7376\"\n y2=\"9.50002\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor={inverted ? \"white\" : \"black\"} />\n <stop offset={1} stopColor={inverted ? \"white\" : \"black\"} stopOpacity={0} />\n </linearGradient>\n </defs>\n <path\n d=\"M1 16L2.58314 11.2506C1.83084 9.74642 1.63835 8.02363 2.04013 6.39052C2.4419 4.75741 3.41171 3.32057 4.776 2.33712C6.1403 1.35367 7.81003 0.887808 9.4864 1.02289C11.1628 1.15798 12.7364 1.8852 13.9256 3.07442C15.1148 4.26363 15.842 5.83723 15.9771 7.5136C16.1122 9.18997 15.6463 10.8597 14.6629 12.224C13.6794 13.5883 12.2426 14.5581 10.6095 14.9599C8.97637 15.3616 7.25358 15.1692 5.74942 14.4169L1 16Z\"\n fill={inverted ? \"black\" : \"white\"}\n stroke={inverted ? \"black\" : \"white\"}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <mask\n id=\"mask0_91_2047\"\n style={{ maskType: \"alpha\" }}\n maskUnits=\"userSpaceOnUse\"\n x={1}\n y={0}\n width={16}\n height={16}\n >\n <circle cx={9} cy={8} r={8} fill={inverted ? \"black\" : \"white\"} />\n </mask>\n <g mask=\"url(#mask0_91_2047)\">\n <circle cx={9} cy={8} r={8} fill={inverted ? \"black\" : \"white\"} />\n <path\n d=\"M14.2896 14.0018L7.146 4.8H5.80005V11.1973H6.87681V6.16743L13.4444 14.6529C13.7407 14.4545 14.0231 14.2369 14.2896 14.0018Z\"\n fill={`url(#gradient-${id}-1)`}\n />\n <rect x=\"11.2222\" y=\"4.8\" width=\"1.06667\" height=\"6.4\" fill={`url(#gradient-${id}-2)`} />\n </g>\n </svg>\n );\n}\n\nfunction IconOpenAI({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <title>OpenAI icon</title>\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n );\n}\n\nfunction IconVercel({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n aria-label=\"Vercel logomark\"\n role=\"img\"\n viewBox=\"0 0 74 64\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z\" fill=\"currentColor\"></path>\n </svg>\n );\n}\n\nfunction IconGitHub({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <title>GitHub</title>\n <path d=\"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\" />\n </svg>\n );\n}\n\nfunction IconSeparator({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n fill=\"none\"\n shapeRendering=\"geometricPrecision\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M16.88 3.549L7.12 20.451\"></path>\n </svg>\n );\n}\n\nfunction IconArrowDown({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m205.66 149.66-72 72a8 8 0 0 1-11.32 0l-72-72a8 8 0 0 1 11.32-11.32L120 196.69V40a8 8 0 0 1 16 0v156.69l58.34-58.35a8 8 0 0 1 11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconArrowRight({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m221.66 133.66-72 72a8 8 0 0 1-11.32-11.32L196.69 136H40a8 8 0 0 1 0-16h156.69l-58.35-58.34a8 8 0 0 1 11.32-11.32l72 72a8 8 0 0 1 0 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconUser({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M230.92 212c-15.23-26.33-38.7-45.21-66.09-54.16a72 72 0 1 0-73.66 0c-27.39 8.94-50.86 27.82-66.09 54.16a8 8 0 1 0 13.85 8c18.84-32.56 52.14-52 89.07-52s70.23 19.44 89.07 52a8 8 0 1 0 13.85-8ZM72 96a56 56 0 1 1 56 56 56.06 56.06 0 0 1-56-56Z\" />\n </svg>\n );\n}\n\nfunction IconPlus({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8Z\" />\n </svg>\n );\n}\n\nfunction IconArrowElbow({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M200 32v144a8 8 0 0 1-8 8H67.31l34.35 34.34a8 8 0 0 1-11.32 11.32l-48-48a8 8 0 0 1 0-11.32l48-48a8 8 0 0 1 11.32 11.32L67.31 168H184V32a8 8 0 0 1 16 0Z\" />\n </svg>\n );\n}\n\nfunction IconSpinner({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4 animate-spin\", className)}\n {...props}\n >\n <path d=\"M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128Z\" />\n </svg>\n );\n}\n\nfunction IconMessage({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 48H40a16 16 0 0 0-16 16v160a15.84 15.84 0 0 0 9.25 14.5A16.05 16.05 0 0 0 40 240a15.89 15.89 0 0 0 10.25-3.78.69.69 0 0 0 .13-.11L82.5 208H216a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16ZM40 224Zm176-32H82.5a16 16 0 0 0-10.3 3.75l-.12.11L40 224V64h176Z\" />\n </svg>\n );\n}\n\nfunction IconTrash({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16ZM96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Z\" />\n </svg>\n );\n}\n\nfunction IconRefresh({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z\" />\n </svg>\n );\n}\n\nfunction IconStop({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z\" />\n </svg>\n );\n}\n\nfunction IconSidebar({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16ZM40 56h40v144H40Zm176 144H96V56h120v144Z\" />\n </svg>\n );\n}\n\nfunction IconMoon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M233.54 142.23a8 8 0 0 0-8-2 88.08 88.08 0 0 1-109.8-109.8 8 8 0 0 0-10-10 104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88 104.84 104.84 0 0 0 37-52.91 8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104 106 106 0 0 0 14.92-1.06 89 89 0 0 1-26.02 31.4Z\" />\n </svg>\n );\n}\n\nfunction IconSun({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64 64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48 48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z\" />\n </svg>\n );\n}\n\nfunction IconCopy({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z\" />\n </svg>\n );\n}\n\nfunction IconCheck({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconDownload({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconClose({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z\" />\n </svg>\n );\n}\n\nfunction IconEdit({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\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 className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10\"\n />\n </svg>\n );\n}\n\nfunction IconShare({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"m237.66 106.35-80-80A8 8 0 0 0 144 32v40.35c-25.94 2.22-54.59 14.92-78.16 34.91-28.38 24.08-46.05 55.11-49.76 87.37a12 12 0 0 0 20.68 9.58c11-11.71 50.14-48.74 107.24-52V192a8 8 0 0 0 13.66 5.65l80-80a8 8 0 0 0 0-11.3ZM160 172.69V144a8 8 0 0 0-8-8c-28.08 0-55.43 7.33-81.29 21.8a196.17 196.17 0 0 0-36.57 26.52c5.8-23.84 20.42-46.51 42.05-64.86C99.41 99.77 127.75 88 152 88a8 8 0 0 0 8-8V51.32L220.69 112Z\" />\n </svg>\n );\n}\n\nfunction IconUsers({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M117.25 157.92a60 60 0 1 0-66.5 0 95.83 95.83 0 0 0-47.22 37.71 8 8 0 1 0 13.4 8.74 80 80 0 0 1 134.14 0 8 8 0 0 0 13.4-8.74 95.83 95.83 0 0 0-47.22-37.71ZM40 108a44 44 0 1 1 44 44 44.05 44.05 0 0 1-44-44Zm210.14 98.7a8 8 0 0 1-11.07-2.33A79.83 79.83 0 0 0 172 168a8 8 0 0 1 0-16 44 44 0 1 0-16.34-84.87 8 8 0 1 1-5.94-14.85 60 60 0 0 1 55.53 105.64 95.83 95.83 0 0 1 47.22 37.71 8 8 0 0 1-2.33 11.07Z\" />\n </svg>\n );\n}\n\nfunction IconExternalLink({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8Z\" />\n </svg>\n );\n}\n\nfunction IconChevronUpDown({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M181.66 170.34a8 8 0 0 1 0 11.32l-48 48a8 8 0 0 1-11.32 0l-48-48a8 8 0 0 1 11.32-11.32L128 212.69l42.34-42.35a8 8 0 0 1 11.32 0Zm-96-84.68L128 43.31l42.34 42.35a8 8 0 0 0 11.32-11.32l-48-48a8 8 0 0 0-11.32 0l-48 48a8 8 0 0 0 11.32 11.32Z\" />\n </svg>\n );\n}\n\nexport {\n IconEdit,\n IconNextChat,\n IconOpenAI,\n IconVercel,\n IconGitHub,\n IconSeparator,\n IconArrowDown,\n IconArrowRight,\n IconUser,\n IconPlus,\n IconArrowElbow,\n IconSpinner,\n IconMessage,\n IconTrash,\n IconRefresh,\n IconStop,\n IconSidebar,\n IconMoon,\n IconSun,\n IconCopy,\n IconCheck,\n IconDownload,\n IconClose,\n IconShare,\n IconUsers,\n IconExternalLink,\n IconChevronUpDown,\n};\n"],"mappings":"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","names":["React","React","jsx","React","jsx","jsxs","jsx","jsx","jsxs"]}
1
+ {"version":3,"sources":["../../../src/components/chat-components/clear-history.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AA6Bd,SACgB,KADhB;AARD,SAAS,aAAa,EAAE,WAAW,GAAsB;AAC9D,QAAM,CAAC,MAAM,OAAO,IAAU,eAAS,KAAK;AAC5C,QAAM,CAAC,WAAW,eAAe,IAAU,oBAAc;AACzD,QAAM,SAAS,UAAU;AAEzB,SACE,qBAAC,eAAY,MAAY,cAAc,SACrC;AAAA,wBAAC,sBAAmB,SAAO,MACzB,+BAAC,UAAO,SAAQ,SAAQ,UAAU,WAC/B;AAAA,mBAAa,oBAAC,eAAY,WAAU,QAAO;AAAA,MAAG;AAAA,OAEjD,GACF;AAAA,IACA,qBAAC,sBACC;AAAA,2BAAC,qBACC;AAAA,4BAAC,oBAAiB,sCAAwB;AAAA,QAC1C,oBAAC,0BAAuB,mGAExB;AAAA,SACF;AAAA,MACA,qBAAC,qBACC;AAAA,4BAAC,qBAAkB,UAAU,WAAW,oBAAM;AAAA,QAC9C;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,SAAS,CAAC,UAAe;AACvB,oBAAM,eAAe;AACrB,8BAAgB,MAAY;AAC1B,sBAAM,SAAS,MAAM,WAAW;AAEhC,oBAAI,UAAU,WAAW,QAAQ;AAC/B,wBAAM,MAAM,OAAO,KAAK;AACxB;AAAA,gBACF;AAEA,wBAAQ,KAAK;AACb,uBAAO,KAAK,GAAG;AAAA,cACjB,EAAC;AAAA,YACH;AAAA,YAEC;AAAA,2BAAa,oBAAC,eAAY,WAAU,qBAAoB;AAAA,cAAG;AAAA;AAAA;AAAA,QAE9D;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useRouter } from \"next/navigation\";\nimport { toast } from \"react-hot-toast\";\n\nimport { ServerActionResult } from \"../../types/types\";\nimport { Button } from \"./ui/button\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"./ui/alert-dialog\";\nimport { IconSpinner } from \"./ui/icons\";\n\ninterface ClearHistoryProps {\n clearChats: () => ServerActionResult<void>;\n}\n\nexport function ClearHistory({ clearChats }: ClearHistoryProps) {\n const [open, setOpen] = React.useState(false);\n const [isPending, startTransition] = React.useTransition();\n const router = useRouter();\n\n return (\n <AlertDialog open={open} onOpenChange={setOpen}>\n <AlertDialogTrigger asChild>\n <Button variant=\"ghost\" disabled={isPending}>\n {isPending && <IconSpinner className=\"mr-2\" />}\n Clear history\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This will permanently delete your chat history and remove your data from our servers.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel disabled={isPending}>Cancel</AlertDialogCancel>\n <AlertDialogAction\n disabled={isPending}\n onClick={(event: any) => {\n event.preventDefault();\n startTransition(async () => {\n const result = await clearChats();\n\n if (result && \"error\" in result) {\n toast.error(result.error);\n return;\n }\n\n setOpen(false);\n router.push(\"/\");\n });\n }}\n >\n {isPending && <IconSpinner className=\"mr-2 animate-spin\" />}\n Delete\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n"]}