@copilotkit/react-core 2.0.0-rc.1 → 2.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,20 +1,16 @@
1
1
  "use client";
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_MarkdownSurfaces = require('./MarkdownSurfaces-C2XZISKn.cjs');
5
- require("./index.css");
4
+ const require_MarkdownSurfaces = require('./MarkdownSurfaces-S4wfUl3J.cjs');
6
5
  let _copilotkit_core = require("@copilotkit/core");
7
6
  let _ag_ui_client = require("@ag-ui/client");
8
7
  let react = require("react");
9
8
  react = require_MarkdownSurfaces.__toESM(react);
10
9
  let react_jsx_runtime = require("react/jsx-runtime");
11
- let tailwind_merge = require("tailwind-merge");
12
10
  let lucide_react = require("lucide-react");
13
11
  let _copilotkit_shared = require("@copilotkit/shared");
14
12
  let _copilotkit_react_core_context = require("@copilotkit/react-core/context");
15
13
  let _radix_ui_react_slot = require("@radix-ui/react-slot");
16
- let class_variance_authority = require("class-variance-authority");
17
- let clsx = require("clsx");
18
14
  let _radix_ui_react_tooltip = require("@radix-ui/react-tooltip");
19
15
  _radix_ui_react_tooltip = require_MarkdownSurfaces.__toESM(_radix_ui_react_tooltip);
20
16
  let _radix_ui_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
@@ -25,6 +21,7 @@ let _copilotkit_mcp_apps_renderer_activity = require("@copilotkit/mcp-apps-rende
25
21
  let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
26
22
  let zod_to_json_schema = require("zod-to-json-schema");
27
23
  let _a2ui_web_core_v0_9 = require("@a2ui/web_core/v0_9");
24
+ let _copilotkit_core_styles = require("@copilotkit/core/styles");
28
25
  let _radix_ui_react_popover = require("@radix-ui/react-popover");
29
26
  _radix_ui_react_popover = require_MarkdownSurfaces.__toESM(_radix_ui_react_popover);
30
27
  let react_dom = require("react-dom");
@@ -67,7 +64,7 @@ function renderInline(tokens) {
67
64
  case "em": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("em", { children: renderInline(token.tokens) }, i);
68
65
  case "del": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("del", { children: renderInline(token.tokens) }, i);
69
66
  case "codespan": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
70
- className: "cpk:rounded cpk:bg-black/5 cpk:px-1 cpk:py-0.5",
67
+ className: "cpk-markdown-inline-code",
71
68
  children: token.text
72
69
  }, i);
73
70
  case "br": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}, i);
@@ -85,7 +82,7 @@ function renderInline(tokens) {
85
82
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
86
83
  src: sanitizeImgSrc(img.href),
87
84
  alt: img.text,
88
- className: "cpk:max-w-full"
85
+ className: "cpk-markdown-image"
89
86
  }, i);
90
87
  }
91
88
  case "escape": return token.text;
@@ -105,7 +102,7 @@ function BlockToken({ token }) {
105
102
  case "code": {
106
103
  const c = token;
107
104
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
108
- className: "cpk:overflow-x-auto cpk:rounded-lg cpk:bg-muted cpk:text-foreground cpk:p-3",
105
+ className: "cpk-markdown-code-block",
109
106
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
110
107
  "data-language": c.lang || void 0,
111
108
  children: c.text
@@ -124,7 +121,7 @@ function BlockToken({ token }) {
124
121
  case "table": {
125
122
  const tbl = token;
126
123
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
127
- className: "cpk:overflow-x-auto",
124
+ className: "cpk-markdown-table-container",
128
125
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { children: tbl.header.map((cell, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: renderInline(cell.tokens) }, i)) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: tbl.rows.map((row, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { children: row.map((cell, j) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: renderInline(cell.tokens) }, j)) }, i)) })] })
129
126
  });
130
127
  }
@@ -137,85 +134,43 @@ function BlockToken({ token }) {
137
134
  }
138
135
  BasicMarkdownRenderer.displayName = "BasicMarkdownRenderer";
139
136
 
140
- //#endregion
141
- //#region src/lib/utils.ts
142
- const twMerge$11 = (0, tailwind_merge.extendTailwindMerge)({ prefix: "cpk" });
143
- function cn(...inputs) {
144
- return twMerge$11((0, clsx.clsx)(inputs));
145
- }
146
-
147
137
  //#endregion
148
138
  //#region src/components/ui/button.tsx
149
- const buttonVariants = (0, class_variance_authority.cva)("cpk:inline-flex cpk:items-center cpk:justify-center cpk:gap-2 cpk:whitespace-nowrap cpk:rounded-md cpk:text-sm cpk:font-medium cpk:transition-all cpk:disabled:pointer-events-none cpk:disabled:opacity-50 cpk:[&_svg]:pointer-events-none cpk:[&_svg:not([class*='size-'])]:size-4 cpk:shrink-0 cpk:[&_svg]:shrink-0 cpk:outline-none cpk:focus-visible:border-ring cpk:focus-visible:ring-ring/50 cpk:focus-visible:ring-[3px] cpk:aria-invalid:ring-destructive/20 cpk:dark:aria-invalid:ring-destructive/40 cpk:aria-invalid:border-destructive", {
150
- variants: {
151
- variant: {
152
- default: "cpk:bg-primary cpk:text-primary-foreground cpk:shadow-xs cpk:hover:bg-primary/90",
153
- destructive: "cpk:bg-destructive cpk:text-white cpk:shadow-xs cpk:hover:bg-destructive/90 cpk:focus-visible:ring-destructive/20 cpk:dark:focus-visible:ring-destructive/40 cpk:dark:bg-destructive/60",
154
- outline: "cpk:border cpk:bg-background cpk:shadow-xs cpk:hover:bg-accent cpk:hover:text-accent-foreground cpk:dark:bg-input/30 cpk:dark:border-input cpk:dark:hover:bg-input/50",
155
- secondary: "cpk:bg-secondary cpk:text-secondary-foreground cpk:shadow-xs cpk:hover:bg-secondary/80",
156
- ghost: "cpk:hover:bg-accent cpk:hover:text-accent-foreground cpk:dark:hover:bg-accent/50 cpk:cursor-pointer",
157
- link: "cpk:text-primary cpk:underline-offset-4 cpk:hover:underline",
158
- assistantMessageToolbarButton: [
159
- "cpk:cursor-pointer",
160
- "cpk:p-0 cpk:text-[rgb(93,93,93)] cpk:hover:bg-[#E8E8E8]",
161
- "cpk:dark:text-[rgb(243,243,243)] cpk:dark:hover:bg-[#303030]",
162
- "cpk:h-8 cpk:w-8",
163
- "cpk:transition-colors",
164
- "cpk:hover:text-[rgb(93,93,93)]",
165
- "cpk:dark:hover:text-[rgb(243,243,243)]"
166
- ],
167
- chatInputToolbarPrimary: [
168
- "cpk:cursor-pointer",
169
- "cpk:bg-black cpk:text-white",
170
- "cpk:dark:bg-white cpk:dark:text-black cpk:dark:focus-visible:outline-white",
171
- "cpk:rounded-full",
172
- "cpk:transition-colors",
173
- "cpk:focus:outline-none",
174
- "cpk:hover:opacity-70 cpk:disabled:hover:opacity-100",
175
- "cpk:disabled:cursor-not-allowed cpk:disabled:bg-[#00000014] cpk:disabled:text-[rgb(13,13,13)]",
176
- "cpk:dark:disabled:bg-[#454545] cpk:dark:disabled:text-white "
177
- ],
178
- chatInputToolbarSecondary: [
179
- "cpk:cursor-pointer",
180
- "cpk:bg-transparent cpk:text-[#444444]",
181
- "cpk:dark:text-white cpk:dark:border-[#404040]",
182
- "cpk:rounded-full",
183
- "cpk:transition-colors",
184
- "cpk:focus:outline-none",
185
- "cpk:hover:bg-[#f8f8f8] cpk:hover:text-[#333333]",
186
- "cpk:dark:hover:bg-[#404040] cpk:dark:hover:text-[#FFFFFF]",
187
- "cpk:disabled:cursor-not-allowed cpk:disabled:opacity-50",
188
- "cpk:disabled:hover:bg-transparent cpk:disabled:hover:text-[#444444]",
189
- "cpk:dark:disabled:hover:bg-transparent cpk:dark:disabled:hover:text-[#CCCCCC]"
190
- ]
191
- },
192
- size: {
193
- default: "cpk:h-9 cpk:px-4 cpk:py-2 cpk:has-[>svg]:px-3",
194
- sm: "cpk:h-8 cpk:rounded-md cpk:gap-1.5 cpk:px-3 cpk:has-[>svg]:px-2.5",
195
- lg: "cpk:h-10 cpk:rounded-md cpk:px-6 cpk:has-[>svg]:px-4",
196
- icon: "cpk:size-9",
197
- chatInputToolbarIcon: ["cpk:h-9 cpk:w-9 cpk:rounded-full"],
198
- chatInputToolbarIconLabel: [
199
- "cpk:h-9 cpk:px-3 cpk:rounded-full",
200
- "cpk:gap-2",
201
- "cpk:font-normal"
202
- ]
203
- }
204
- },
205
- defaultVariants: {
206
- variant: "default",
207
- size: "default"
208
- }
209
- });
139
+ const variantClasses = {
140
+ default: "cpk-button-default",
141
+ destructive: "cpk-button-destructive",
142
+ outline: "cpk-button-outline",
143
+ secondary: "cpk-button-secondary",
144
+ ghost: "cpk-button-ghost",
145
+ link: "cpk-button-link",
146
+ assistantMessageToolbarButton: "cpk-button-assistant-message-toolbar",
147
+ chatInputToolbarPrimary: "cpk-button-chat-input-toolbar-primary",
148
+ chatInputToolbarSecondary: "cpk-button-chat-input-toolbar-secondary"
149
+ };
150
+ const sizeClasses = {
151
+ default: "cpk-button-size-default",
152
+ sm: "cpk-button-size-sm",
153
+ lg: "cpk-button-size-lg",
154
+ icon: "cpk-button-size-icon",
155
+ chatInputToolbarIcon: "cpk-button-size-chat-input-toolbar-icon",
156
+ chatInputToolbarIconLabel: "cpk-button-size-chat-input-toolbar-icon-label"
157
+ };
158
+ /**
159
+ * Returns the class names for a button with the given variant and size,
160
+ * followed by `className`.
161
+ */
162
+ function buttonVariants({ variant, size, className, class: classProp } = {}) {
163
+ return require_MarkdownSurfaces.cn("cpk-button", variant !== null && variantClasses[variant ?? "default"], size !== null && sizeClasses[size ?? "default"], classProp, className);
164
+ }
210
165
  const Button = react.forwardRef(function Button({ className, variant, size, asChild = false, ...props }, ref) {
211
166
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(asChild ? _radix_ui_react_slot.Slot : "button", {
212
167
  ref,
213
168
  "data-slot": "button",
214
- className: cn(buttonVariants({
169
+ className: buttonVariants({
215
170
  variant,
216
171
  size,
217
172
  className
218
- })),
173
+ }),
219
174
  ...props
220
175
  });
221
176
  });
@@ -247,9 +202,9 @@ function TooltipContent({ className, sideOffset = 0, children, ...props }) {
247
202
  "data-copilotkit": true,
248
203
  "data-slot": "tooltip-content",
249
204
  sideOffset,
250
- className: cn("cpk:bg-primary cpk:text-primary-foreground cpk:animate-in cpk:fade-in-0 cpk:zoom-in-95 cpk:data-[state=closed]:animate-out cpk:data-[state=closed]:fade-out-0 cpk:data-[state=closed]:zoom-out-95 cpk:data-[side=bottom]:slide-in-from-top-2 cpk:data-[side=left]:slide-in-from-right-2 cpk:data-[side=right]:slide-in-from-left-2 cpk:data-[side=top]:slide-in-from-bottom-2 cpk:z-50 cpk:w-fit cpk:origin-(--radix-tooltip-content-transform-origin) cpk:rounded-md cpk:px-3 cpk:py-1.5 cpk:text-xs cpk:text-balance", className),
205
+ className: require_MarkdownSurfaces.cn("cpk-tooltip", className),
251
206
  ...props,
252
- children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Arrow, { className: "cpk:bg-primary cpk:fill-primary cpk:z-50 cpk:size-2.5 cpk:translate-y-[calc(-50%_-_2px)] cpk:rotate-45 cpk:rounded-[2px]" })]
207
+ children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Arrow, { className: "cpk-tooltip-arrow" })]
253
208
  }) });
254
209
  }
255
210
 
@@ -273,7 +228,7 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
273
228
  "data-copilotkit": true,
274
229
  "data-slot": "dropdown-menu-content",
275
230
  sideOffset,
276
- className: cn("cpk:bg-popover cpk:text-popover-foreground cpk:data-[state=open]:animate-in cpk:data-[state=closed]:animate-out cpk:data-[state=closed]:fade-out-0 cpk:data-[state=open]:fade-in-0 cpk:data-[state=closed]:zoom-out-95 cpk:data-[state=open]:zoom-in-95 cpk:data-[side=bottom]:slide-in-from-top-2 cpk:data-[side=left]:slide-in-from-right-2 cpk:data-[side=right]:slide-in-from-left-2 cpk:data-[side=top]:slide-in-from-bottom-2 cpk:z-50 cpk:max-h-(--radix-dropdown-menu-content-available-height) cpk:min-w-[8rem] cpk:origin-(--radix-dropdown-menu-content-transform-origin) cpk:overflow-x-hidden cpk:overflow-y-auto cpk:rounded-md cpk:border cpk:p-1 cpk:shadow-md", className),
231
+ className: require_MarkdownSurfaces.cn("cpk-dropdown-menu-content", className),
277
232
  ...props
278
233
  }) });
279
234
  }
@@ -282,7 +237,7 @@ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
282
237
  "data-slot": "dropdown-menu-item",
283
238
  "data-inset": inset,
284
239
  "data-variant": variant,
285
- className: cn("cpk:focus:bg-accent cpk:focus:text-accent-foreground cpk:data-[variant=destructive]:text-destructive cpk:data-[variant=destructive]:focus:bg-destructive/10 cpk:dark:data-[variant=destructive]:focus:bg-destructive/20 cpk:data-[variant=destructive]:focus:text-destructive cpk:data-[variant=destructive]:*:[svg]:!text-destructive cpk:[&_svg:not([class*='text-'])]:text-muted-foreground cpk:relative cpk:flex cpk:cursor-default cpk:items-center cpk:gap-2 cpk:rounded-sm cpk:px-2 cpk:py-1.5 cpk:text-sm cpk:outline-hidden cpk:select-none cpk:data-[disabled]:pointer-events-none cpk:data-[disabled]:opacity-50 cpk:data-[inset]:pl-8 cpk:[&_svg]:pointer-events-none cpk:[&_svg]:shrink-0 cpk:[&_svg:not([class*='size-'])]:size-4", className),
240
+ className: require_MarkdownSurfaces.cn("cpk-dropdown-menu-item", className),
286
241
  ...props
287
242
  });
288
243
  }
@@ -290,14 +245,14 @@ function DropdownMenuLabel({ className, inset, ...props }) {
290
245
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Label, {
291
246
  "data-slot": "dropdown-menu-label",
292
247
  "data-inset": inset,
293
- className: cn("cpk:px-2 cpk:py-1.5 cpk:text-sm cpk:font-medium cpk:data-[inset]:pl-8", className),
248
+ className: require_MarkdownSurfaces.cn("cpk-dropdown-menu-label", className),
294
249
  ...props
295
250
  });
296
251
  }
297
252
  function DropdownMenuSeparator({ className, ...props }) {
298
253
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Separator, {
299
254
  "data-slot": "dropdown-menu-separator",
300
- className: cn("cpk:bg-border cpk:-mx-1 cpk:my-1 cpk:h-px", className),
255
+ className: require_MarkdownSurfaces.cn("cpk-dropdown-menu-separator", className),
301
256
  ...props
302
257
  });
303
258
  }
@@ -311,15 +266,15 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
311
266
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.SubTrigger, {
312
267
  "data-slot": "dropdown-menu-sub-trigger",
313
268
  "data-inset": inset,
314
- className: cn("cpk:focus:bg-accent cpk:focus:text-accent-foreground cpk:data-[state=open]:bg-accent cpk:data-[state=open]:text-accent-foreground cpk:flex cpk:cursor-default cpk:items-center cpk:rounded-sm cpk:px-2 cpk:py-1.5 cpk:text-sm cpk:outline-hidden cpk:select-none cpk:data-[inset]:pl-8", className),
269
+ className: require_MarkdownSurfaces.cn("cpk-dropdown-menu-sub-trigger", className),
315
270
  ...props,
316
- children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRightIcon, { className: "cpk:ml-auto cpk:size-4" })]
271
+ children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRightIcon, { className: "cpk-dropdown-menu-sub-trigger-icon" })]
317
272
  });
318
273
  }
319
274
  function DropdownMenuSubContent({ className, ...props }) {
320
275
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.SubContent, {
321
276
  "data-slot": "dropdown-menu-sub-content",
322
- className: cn("cpk:bg-popover cpk:text-popover-foreground cpk:data-[state=open]:animate-in cpk:data-[state=closed]:animate-out cpk:data-[state=closed]:fade-out-0 cpk:data-[state=open]:fade-in-0 cpk:data-[state=closed]:zoom-out-95 cpk:data-[state=open]:zoom-in-95 cpk:data-[side=bottom]:slide-in-from-top-2 cpk:data-[side=left]:slide-in-from-right-2 cpk:data-[side=right]:slide-in-from-left-2 cpk:data-[side=top]:slide-in-from-bottom-2 cpk:z-50 cpk:min-w-[8rem] cpk:origin-(--radix-dropdown-menu-content-transform-origin) cpk:overflow-hidden cpk:rounded-md cpk:border cpk:p-1 cpk:shadow-lg", className),
277
+ className: require_MarkdownSurfaces.cn("cpk-dropdown-menu-sub-content", className),
323
278
  ...props
324
279
  });
325
280
  }
@@ -514,11 +469,11 @@ const CopilotChatAudioRecorder = (0, react.forwardRef)((props, ref) => {
514
469
  cleanup
515
470
  ]);
516
471
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
517
- className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:py-3 cpk:px-5", className),
472
+ className: require_MarkdownSurfaces.cn("cpk-audio-recorder", className),
518
473
  ...divProps,
519
474
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("canvas", {
520
475
  ref: canvasRef,
521
- className: "cpk:block cpk:w-full cpk:h-[26px]"
476
+ className: "cpk-audio-recorder-canvas"
522
477
  })
523
478
  });
524
479
  });
@@ -739,7 +694,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
739
694
  isComposingRef.current = false;
740
695
  },
741
696
  autoFocus,
742
- className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:py-3", isExpanded ? "cpk:px-5" : "cpk:pr-5")
697
+ className: isExpanded ? "cpk-chat-input-textarea-expanded" : "cpk-chat-input-textarea-compact"
743
698
  });
744
699
  const isProcessing = mode !== "transcribe" && isRunning;
745
700
  const canSend = resolvedValue.trim().length > 0 && !!onSubmitMessage;
@@ -757,7 +712,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
757
712
  onClick: handleSendButtonClick,
758
713
  disabled: isProcessing ? !canStop : !canSend,
759
714
  "aria-label": showsStop ? labels.chatInputToolbarStopButtonLabel : labels.chatInputToolbarSendButtonLabel,
760
- children: showsStop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Square, { className: "cpk:size-[18px] cpk:fill-current" }) : void 0
715
+ children: showsStop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Square, { className: "cpk-chat-input-stop-icon" }) : void 0
761
716
  });
762
717
  const BoundStartTranscribeButton = require_MarkdownSurfaces.renderSlot(startTranscribeButton, CopilotChatInput.StartTranscribeButton, { onClick: onStartTranscribe });
763
718
  const BoundCancelTranscribeButton = require_MarkdownSurfaces.renderSlot(cancelTranscribeButton, CopilotChatInput.CancelTranscribeButton, { onClick: onCancelTranscribe });
@@ -972,10 +927,10 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
972
927
  role: "listbox",
973
928
  "aria-label": labels.chatInputSlashMenuLabel,
974
929
  ref: slashMenuRef,
975
- className: "cpk:absolute cpk:bottom-full cpk:left-0 cpk:right-0 cpk:z-30 cpk:mb-2 cpk:max-h-64 cpk:overflow-y-auto cpk:rounded-lg cpk:border cpk:border-border cpk:bg-white cpk:shadow-lg cpk:dark:border-[#3a3a3a] cpk:dark:bg-[#1f1f1f]",
930
+ className: "cpk-chat-input-slash-menu",
976
931
  style: { maxHeight: `${SLASH_MENU_MAX_VISIBLE_ITEMS * SLASH_MENU_ITEM_HEIGHT_PX}px` },
977
932
  children: filteredCommands.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
978
- className: "cpk:px-3 cpk:py-2 cpk:text-sm cpk:text-muted-foreground",
933
+ className: "cpk-chat-input-slash-menu-empty",
979
934
  children: labels.chatInputSlashMenuEmptyText
980
935
  }) : filteredCommands.map((item, index) => {
981
936
  const isActive = index === slashHighlightIndex;
@@ -985,7 +940,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
985
940
  "aria-selected": isActive,
986
941
  "data-active": isActive ? "true" : void 0,
987
942
  "data-slash-index": index,
988
- className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:px-3 cpk:py-2 cpk:text-left cpk:text-sm cpk:transition-colors", "cpk:hover:bg-muted cpk:dark:hover:bg-[#2f2f2f]", isActive ? "cpk:bg-muted cpk:dark:bg-[#2f2f2f]" : "cpk:bg-transparent"),
943
+ className: "cpk-chat-input-slash-menu-item",
989
944
  onMouseEnter: () => setSlashHighlightIndex(index),
990
945
  onMouseDown: (event) => {
991
946
  event.preventDefault();
@@ -997,29 +952,29 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
997
952
  }) : null;
998
953
  const inputPill = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
999
954
  "data-testid": "copilot-chat-input",
1000
- className: (0, tailwind_merge.twMerge)("copilotKitInput", "cpk:flex cpk:w-full cpk:flex-col cpk:items-center cpk:justify-center", "cpk:cursor-text", "cpk:overflow-visible cpk:bg-clip-padding cpk:contain-inline-size", "cpk:bg-white cpk:dark:bg-[#303030]", "cpk:shadow-[0_4px_4px_0_#0000000a,0_0_1px_0_#0000009e] cpk:rounded-[28px]"),
955
+ className: "copilotKitInput cpk-chat-input-pill",
1001
956
  onClick: handleContainerClick,
1002
957
  "data-layout": isExpanded ? "expanded" : "compact",
1003
958
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1004
959
  ref: gridRef,
1005
- className: (0, tailwind_merge.twMerge)("cpk:grid cpk:w-full cpk:gap-x-3 cpk:gap-y-3 cpk:px-3 cpk:py-2", isExpanded ? "cpk:grid-cols-[auto_minmax(0,1fr)_auto] cpk:grid-rows-[auto_auto]" : "cpk:grid-cols-[auto_minmax(0,1fr)_auto] cpk:items-center"),
960
+ className: "cpk-chat-input-grid",
1006
961
  "data-layout": isExpanded ? "expanded" : "compact",
1007
962
  children: [
1008
963
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1009
964
  ref: addButtonContainerRef,
1010
- className: (0, tailwind_merge.twMerge)("cpk:flex cpk:items-center", isExpanded ? "cpk:row-start-2" : "cpk:row-start-1", "cpk:col-start-1"),
965
+ className: "cpk-chat-input-start",
1011
966
  children: BoundAddMenuButton
1012
967
  }),
1013
968
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1014
- className: (0, tailwind_merge.twMerge)("cpk:relative cpk:flex cpk:min-w-0 cpk:flex-col cpk:min-h-[50px] cpk:justify-center", isExpanded ? "cpk:col-span-3 cpk:row-start-1" : "cpk:col-start-2 cpk:row-start-1"),
969
+ className: "cpk-chat-input-field",
1015
970
  children: mode === "transcribe" ? BoundAudioRecorder : mode === "processing" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1016
- className: "cpk:flex cpk:w-full cpk:items-center cpk:justify-center cpk:py-3 cpk:px-5",
1017
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "cpk:size-[26px] cpk:animate-spin cpk:text-muted-foreground" })
971
+ className: "cpk-chat-input-processing",
972
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "cpk-chat-input-processing-spinner" })
1018
973
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [BoundTextArea, slashMenu] })
1019
974
  }),
1020
975
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1021
976
  ref: actionsContainerRef,
1022
- className: (0, tailwind_merge.twMerge)("cpk:flex cpk:items-center cpk:justify-end cpk:gap-2", isExpanded ? "cpk:col-start-3 cpk:row-start-2" : "cpk:col-start-3 cpk:row-start-1"),
977
+ className: "cpk-chat-input-actions",
1023
978
  children: mode === "transcribe" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [onCancelTranscribe && BoundCancelTranscribeButton, onFinishTranscribe && BoundFinishTranscribeButton] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [onStartTranscribe && BoundStartTranscribeButton, BoundSendButton] })
1024
979
  })
1025
980
  ]
@@ -1059,7 +1014,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1059
1014
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1060
1015
  "data-copilotkit": true,
1061
1016
  ref: containerRef,
1062
- className: cn("cpk:pointer-events-none cpk:relative cpk:z-20", positioning === "absolute" && "cpk:absolute cpk:bottom-0 cpk:left-0 cpk:right-0", className),
1017
+ className: require_MarkdownSurfaces.cn("cpk-chat-input", positioning === "absolute" && "cpk-chat-input-absolute", className),
1063
1018
  style: {
1064
1019
  transform: keyboardHeight > 0 ? `translateY(-${keyboardHeight}px)` : void 0,
1065
1020
  transition: "transform 0.2s ease-out",
@@ -1067,7 +1022,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1067
1022
  },
1068
1023
  ...props,
1069
1024
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1070
- className: "cpk:max-w-3xl cpk:mx-auto cpk:py-0 cpk:px-4 cpk:@3xl:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-4 cpk:pointer-events-auto",
1025
+ className: "cpk-chat-input-wrapper",
1071
1026
  children: inputPill
1072
1027
  }), shouldShowDisclaimer && BoundDisclaimer]
1073
1028
  });
@@ -1076,16 +1031,16 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1076
1031
  _CopilotChatInput.SendButton = ({ className, children, ...props }) => {
1077
1032
  const labels = require_MarkdownSurfaces.useCopilotChatConfiguration()?.labels ?? require_MarkdownSurfaces.CopilotChatDefaultLabels;
1078
1033
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1079
- className: "cpk:mr-[10px]",
1034
+ className: "cpk-chat-input-send",
1080
1035
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
1081
1036
  type: "button",
1082
1037
  "data-testid": "copilot-send-button",
1083
1038
  variant: "chatInputToolbarPrimary",
1084
1039
  size: "chatInputToolbarIcon",
1085
- className,
1040
+ className: require_MarkdownSurfaces.cn("cpk-chat-input-send-button", className),
1086
1041
  "aria-label": labels.chatInputToolbarSendButtonLabel,
1087
1042
  ...props,
1088
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowUp, { className: "cpk:size-[18px]" })
1043
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowUp, { className: "cpk-chat-input-send-icon" })
1089
1044
  })
1090
1045
  });
1091
1046
  };
@@ -1097,7 +1052,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1097
1052
  type: "button",
1098
1053
  variant: "chatInputToolbarSecondary",
1099
1054
  size: "chatInputToolbarIcon",
1100
- className: (0, tailwind_merge.twMerge)(defaultClassName, className),
1055
+ className: require_MarkdownSurfaces.cn(defaultClassName, className),
1101
1056
  "aria-label": labels[labelKey],
1102
1057
  ...props,
1103
1058
  children: icon
@@ -1109,23 +1064,23 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1109
1064
  };
1110
1065
  _CopilotChatInput.StartTranscribeButton = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
1111
1066
  "data-testid": "copilot-start-transcribe-button",
1112
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Mic, { className: "cpk:size-[18px]" }),
1067
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Mic, { className: "cpk-chat-input-toolbar-icon" }),
1113
1068
  labelKey: "chatInputToolbarStartTranscribeButtonLabel",
1114
- defaultClassName: "cpk:mr-2",
1069
+ defaultClassName: "cpk-chat-input-start-transcribe-button",
1115
1070
  ...props
1116
1071
  });
1117
1072
  _CopilotChatInput.CancelTranscribeButton = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
1118
1073
  "data-testid": "copilot-cancel-transcribe-button",
1119
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "cpk:size-[18px]" }),
1074
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "cpk-chat-input-toolbar-icon" }),
1120
1075
  labelKey: "chatInputToolbarCancelTranscribeButtonLabel",
1121
- defaultClassName: "cpk:mr-2",
1076
+ defaultClassName: "cpk-chat-input-cancel-transcribe-button",
1122
1077
  ...props
1123
1078
  });
1124
1079
  _CopilotChatInput.FinishTranscribeButton = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
1125
1080
  "data-testid": "copilot-finish-transcribe-button",
1126
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk:size-[18px]" }),
1081
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk-chat-input-toolbar-icon" }),
1127
1082
  labelKey: "chatInputToolbarFinishTranscribeButtonLabel",
1128
- defaultClassName: "cpk:mr-[10px]",
1083
+ defaultClassName: "cpk-chat-input-finish-transcribe-button",
1129
1084
  ...props
1130
1085
  });
1131
1086
  _CopilotChatInput.AddMenuButton = ({ className, toolsMenu, onAddFile, disabled, ...props }) => {
@@ -1167,11 +1122,11 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1167
1122
  "data-testid": "copilot-add-menu-button",
1168
1123
  variant: "chatInputToolbarSecondary",
1169
1124
  size: "chatInputToolbarIcon",
1170
- className: (0, tailwind_merge.twMerge)("cpk:ml-1", className),
1125
+ className: require_MarkdownSurfaces.cn("cpk-chat-input-add-menu-button", className),
1171
1126
  disabled: isDisabled,
1172
1127
  "aria-label": labels.chatInputToolbarAddButtonLabel,
1173
1128
  ...props,
1174
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "cpk:size-[20px]" })
1129
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "cpk-chat-input-add-menu-icon" })
1175
1130
  });
1176
1131
  if (!mounted) return button;
1177
1132
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipTrigger, {
@@ -1183,9 +1138,9 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1183
1138
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContent, {
1184
1139
  side: "bottom",
1185
1140
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1186
- className: "cpk:flex cpk:items-center cpk:gap-1 cpk:text-xs cpk:font-medium",
1141
+ className: "cpk-chat-input-add-menu-tooltip",
1187
1142
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.chatInputToolbarAddButtonLabel }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
1188
- className: "cpk:rounded cpk:bg-[#4a4a4a] cpk:px-1 cpk:py-[1px] cpk:font-mono cpk:text-[11px] cpk:text-white cpk:dark:bg-[#e0e0e0] cpk:dark:text-black",
1143
+ className: "cpk-chat-input-add-menu-shortcut",
1189
1144
  children: "/"
1190
1145
  })]
1191
1146
  })
@@ -1206,7 +1161,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1206
1161
  ref: internalTextareaRef,
1207
1162
  "data-testid": "copilot-chat-textarea",
1208
1163
  placeholder: placeholder ?? labels.chatInputPlaceholder,
1209
- className: (0, tailwind_merge.twMerge)("cpk:bg-transparent cpk:outline-none cpk:antialiased cpk:font-regular cpk:leading-relaxed cpk:text-[16px] cpk:placeholder:text-[#00000077] cpk:dark:placeholder:text-[#fffc]", className),
1164
+ className: require_MarkdownSurfaces.cn("cpk-chat-input-textarea", className),
1210
1165
  style: {
1211
1166
  overflow: "auto",
1212
1167
  resize: "none",
@@ -1220,7 +1175,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
1220
1175
  _CopilotChatInput.Disclaimer = ({ className, ...props }) => {
1221
1176
  const labels = require_MarkdownSurfaces.useCopilotChatConfiguration()?.labels ?? require_MarkdownSurfaces.CopilotChatDefaultLabels;
1222
1177
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1223
- className: cn("cpk:text-center cpk:text-xs cpk:text-muted-foreground cpk:py-3 cpk:px-4 cpk:max-w-3xl cpk:mx-auto", className),
1178
+ className: require_MarkdownSurfaces.cn("cpk-chat-input-disclaimer", className),
1224
1179
  ...props,
1225
1180
  children: labels.chatDisclaimerText
1226
1181
  });
@@ -1371,7 +1326,7 @@ function useRenderToolCall() {
1371
1326
 
1372
1327
  //#endregion
1373
1328
  //#region package.json
1374
- var version = "2.0.0-rc.1";
1329
+ var version$1 = "2.0.0-rc.3";
1375
1330
 
1376
1331
  //#endregion
1377
1332
  //#region src/components/CopilotKitInspector.tsx
@@ -1398,7 +1353,7 @@ const CopilotKitInspector = ({ core, openRequest, onVisibilityChange }) => {
1398
1353
  mod.configureWebInspectorElement(inspector, latestCoreRef.current, {
1399
1354
  development: process.env.NODE_ENV === "development",
1400
1355
  framework: "react",
1401
- sdkVersion: version
1356
+ sdkVersion: version$1
1402
1357
  });
1403
1358
  inspector.addEventListener("cpk-inspector-visibility-change", handleVisibilityChange);
1404
1359
  mountRef.current.appendChild(inspector);
@@ -2222,14 +2177,14 @@ function A2UIRetryingState({ content, showAfterMs, showAfterAttempts, debugExpos
2222
2177
  /** failed: a clean hard-failure card that replaces the skeleton in place. */
2223
2178
  function A2UIRecoveryFailure({ content, debugExposure }) {
2224
2179
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2225
- className: "cpk:rounded-lg cpk:border cpk:border-amber-200 cpk:bg-amber-50 cpk:p-3 cpk:text-sm cpk:text-amber-800",
2180
+ className: "cpk-a2ui-recovery-failure",
2226
2181
  children: [
2227
2182
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2228
- className: "cpk:font-medium",
2183
+ className: "cpk-a2ui-recovery-failure-title",
2229
2184
  children: "Couldn't generate the UI"
2230
2185
  }),
2231
2186
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2232
- className: "cpk:mt-1 cpk:text-xs cpk:text-amber-700",
2187
+ className: "cpk-a2ui-recovery-failure-description",
2233
2188
  children: "Something went wrong rendering this. You can keep chatting and try again."
2234
2189
  }),
2235
2190
  debugExposure !== "hidden" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIDebugDetails, {
@@ -2488,12 +2443,12 @@ function A2UIGeneratingSkeleton({ label, tokens, children }) {
2488
2443
  function A2UIDebugDetails({ label, open, payload }) {
2489
2444
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
2490
2445
  open,
2491
- className: "cpk:mt-2 cpk:text-xs",
2446
+ className: "cpk-a2ui-debug-details",
2492
2447
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
2493
- className: "cpk:cursor-pointer cpk:text-gray-500",
2448
+ className: "cpk-a2ui-debug-details-summary",
2494
2449
  children: label
2495
2450
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
2496
- className: "cpk:mt-1 cpk:overflow-auto cpk:rounded cpk:bg-gray-100 cpk:p-2 cpk:text-gray-700",
2451
+ className: "cpk-a2ui-debug-details-payload",
2497
2452
  style: { fontSize: 11 },
2498
2453
  children: JSON.stringify(payload, null, 2)
2499
2454
  })]
@@ -2724,7 +2679,7 @@ function createA2UIMessageRenderer(options) {
2724
2679
  }, [hasOps]);
2725
2680
  if (!hasOps) return renderLifecycle(content);
2726
2681
  const surfaces = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2727
- className: "cpk:flex cpk:min-h-0 cpk:flex-1 cpk:flex-col cpk:gap-6 cpk:overflow-auto cpk:py-6",
2682
+ className: "cpk-a2ui-message-surfaces",
2728
2683
  children: Array.from(groupedOperations.entries()).map(([surfaceId, ops]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReactSurfaceHost, {
2729
2684
  surfaceId,
2730
2685
  operations: ops,
@@ -2795,7 +2750,7 @@ async function runA2UIAction({ message, agent, copilotkit, onAction }) {
2795
2750
  */
2796
2751
  function ReactSurfaceHost({ surfaceId, operations, theme, agent, copilotkit, catalog, onAction, onReady }) {
2797
2752
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2798
- className: "cpk:flex cpk:w-full cpk:flex-none cpk:flex-col cpk:gap-4",
2753
+ className: "cpk-a2ui-message-surface-host",
2799
2754
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_copilotkit_a2ui_renderer.A2UIProvider, {
2800
2755
  onAction: (0, react.useCallback)((message) => runA2UIAction({
2801
2756
  message,
@@ -2824,12 +2779,12 @@ function ReactSurfaceHost({ surfaceId, operations, theme, agent, copilotkit, cat
2824
2779
  function A2UISurfaceOrError({ surfaceId }) {
2825
2780
  const error = (0, _copilotkit_a2ui_renderer.useA2UIError)();
2826
2781
  if (error) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2827
- className: "cpk:rounded-lg cpk:border cpk:border-red-200 cpk:bg-red-50 cpk:p-3 cpk:text-sm cpk:text-red-700",
2782
+ className: "cpk-a2ui-message-error",
2828
2783
  children: ["A2UI render error: ", error]
2829
2784
  });
2830
2785
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_copilotkit_a2ui_renderer.A2UIRenderer, {
2831
2786
  surfaceId,
2832
- className: "cpk:flex cpk:flex-1"
2787
+ className: "cpk-a2ui-message-surface"
2833
2788
  });
2834
2789
  }
2835
2790
  /**
@@ -4907,6 +4862,43 @@ var CopilotKitCoreReact = class extends _copilotkit_core.CopilotKitCore {
4907
4862
  }
4908
4863
  };
4909
4864
 
4865
+ //#endregion
4866
+ //#region src/styles/copilot-kit-styles.tsx
4867
+ const StyleOptionsContext = (0, react.createContext)({ inject: true });
4868
+ /** React 19 moves a `<style precedence>` into `<head>` and keeps one copy. */
4869
+ const hoistsStyles = Number.parseInt(react.version, 10) >= 19;
4870
+ /** Passes the provider's style options to `<CopilotKitStyles>`. */
4871
+ const CopilotStyleOptionsProvider = StyleOptionsContext.Provider;
4872
+ /**
4873
+ * Renders the CSS for CopilotKit's UI, so apps never import a stylesheet.
4874
+ * `CopilotChat` (and so `CopilotPopup` and `CopilotSidebar`) renders it for
4875
+ * you. Render it yourself only when you build a layout from the chat parts
4876
+ * without `CopilotChat`.
4877
+ *
4878
+ * React 19 moves the tag into `<head>` and keeps one copy, including in the
4879
+ * server HTML. React 18 renders it in place, one copy per `CopilotChat`.
4880
+ * Each copy holds the same CSS, so a second copy changes nothing.
4881
+ *
4882
+ * With a CSP nonce the tag always renders in place. React only adds a nonce to
4883
+ * a hoisted style when the app renders with `nonce: { style }`, and Next.js
4884
+ * passes a plain string, so a hoisted tag would be blocked.
4885
+ *
4886
+ * Renders nothing when `CopilotKitProvider` has `injectStyles={false}`.
4887
+ */
4888
+ function CopilotKitStyles() {
4889
+ const { nonce, inject } = (0, react.useContext)(StyleOptionsContext);
4890
+ if (!inject) return null;
4891
+ if (nonce || !hoistsStyles) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", {
4892
+ nonce,
4893
+ dangerouslySetInnerHTML: { __html: _copilotkit_core_styles.stylesheet }
4894
+ });
4895
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", {
4896
+ href: "copilotkit",
4897
+ precedence: "copilotkit",
4898
+ children: _copilotkit_core_styles.stylesheet
4899
+ });
4900
+ }
4901
+
4910
4902
  //#endregion
4911
4903
  //#region src/providers/CopilotKitProvider.tsx
4912
4904
  const zodToJsonSchemaAdapter = (schema, options) => {
@@ -4953,7 +4945,7 @@ function useStableArrayProp(prop, warningMessage, isMeaningfulChange) {
4953
4945
  return value;
4954
4946
  }
4955
4947
  /** Provide a shared core instance and synchronize runtime, tool, and UI configuration. */
4956
- const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, messageFilter, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, markdownRenderer, frontendTools, humanInTheLoop, openGenerativeUI, enableInspector, agentId, showIntelligenceIndicator = true, useSingleEndpoint, onError, a2ui, generativeUI, mcpApps, defaultThrottleMs, debug, learning }) => {
4948
+ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, nonce, injectStyles = true, messageFilter, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, markdownRenderer, frontendTools, humanInTheLoop, openGenerativeUI, enableInspector, agentId, showIntelligenceIndicator = true, useSingleEndpoint, onError, a2ui, generativeUI, mcpApps, defaultThrottleMs, debug, learning }) => {
4957
4949
  const learningConfig = (0, react.useMemo)(() => toLearningConfig(learning), [learning]);
4958
4950
  const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
4959
4951
  const [inspectorVisible, setInspectorVisible] = (0, react.useState)(false);
@@ -5432,41 +5424,47 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
5432
5424
  runtimeLicenseStatus
5433
5425
  ]);
5434
5426
  const runtimeLicenseWarningStatus = runtimeEntitlementRetryInProgress ? void 0 : licenseContextValue.status ?? void 0;
5435
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SandboxFunctionsContext.Provider, {
5436
- value: sandboxFunctionsList,
5437
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_copilotkit_react_core_context.CopilotKitContext.Provider, {
5438
- value: contextValue,
5439
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_copilotkit_react_core_context.LicenseContext.Provider, {
5440
- value: licenseContextValue,
5441
- children: [
5442
- a2uiActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIBuiltInToolCallRenderer, {}),
5443
- generativeUIActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.GenerativeUIToolCallRenderer, {}),
5444
- a2uiActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UICatalogContext, {
5445
- catalog: filteredCatalog,
5446
- includeSchema: a2ui?.includeSchema
5447
- }),
5448
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.MarkdownRendererProvider, {
5449
- renderer: markdownRenderer,
5450
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CopilotKitInspectorContextProvider, {
5451
- value: inspectorContextValue,
5452
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_copilotkit_react_core_context.CopilotKitAgentIdContext.Provider, {
5453
- value: agentId,
5454
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.GenerativeUIRuntimeContext.Provider, {
5455
- value: generativeUIRuntime,
5456
- children
5457
- })
5458
- }), shouldRenderInspector ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitInspector, {
5459
- core: copilotkit,
5460
- openRequest: inspectorOpenRequest,
5461
- onVisibilityChange: setInspectorVisible
5462
- }) : null]
5463
- })
5464
- }),
5465
- runtimeLicenseWarningStatus === "none" && !resolvedPublicKey && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "no_license" }),
5466
- runtimeLicenseWarningStatus === "expired" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "expired" }),
5467
- runtimeLicenseWarningStatus === "invalid" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "invalid" }),
5468
- runtimeLicenseWarningStatus === "expiring" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "expiring" })
5469
- ]
5427
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotStyleOptionsProvider, {
5428
+ value: (0, react.useMemo)(() => ({
5429
+ nonce,
5430
+ inject: injectStyles
5431
+ }), [nonce, injectStyles]),
5432
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SandboxFunctionsContext.Provider, {
5433
+ value: sandboxFunctionsList,
5434
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_copilotkit_react_core_context.CopilotKitContext.Provider, {
5435
+ value: contextValue,
5436
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_copilotkit_react_core_context.LicenseContext.Provider, {
5437
+ value: licenseContextValue,
5438
+ children: [
5439
+ a2uiActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIBuiltInToolCallRenderer, {}),
5440
+ generativeUIActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.GenerativeUIToolCallRenderer, {}),
5441
+ a2uiActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UICatalogContext, {
5442
+ catalog: filteredCatalog,
5443
+ includeSchema: a2ui?.includeSchema
5444
+ }),
5445
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.MarkdownRendererProvider, {
5446
+ renderer: markdownRenderer,
5447
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CopilotKitInspectorContextProvider, {
5448
+ value: inspectorContextValue,
5449
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_copilotkit_react_core_context.CopilotKitAgentIdContext.Provider, {
5450
+ value: agentId,
5451
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.GenerativeUIRuntimeContext.Provider, {
5452
+ value: generativeUIRuntime,
5453
+ children
5454
+ })
5455
+ }), shouldRenderInspector ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitInspector, {
5456
+ core: copilotkit,
5457
+ openRequest: inspectorOpenRequest,
5458
+ onVisibilityChange: setInspectorVisible
5459
+ }) : null]
5460
+ })
5461
+ }),
5462
+ runtimeLicenseWarningStatus === "none" && !resolvedPublicKey && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "no_license" }),
5463
+ runtimeLicenseWarningStatus === "expired" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "expired" }),
5464
+ runtimeLicenseWarningStatus === "invalid" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "invalid" }),
5465
+ runtimeLicenseWarningStatus === "expiring" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "expiring" })
5466
+ ]
5467
+ })
5470
5468
  })
5471
5469
  })
5472
5470
  });
@@ -5965,10 +5963,10 @@ function Collapsible({ open, id, className, children }) {
5965
5963
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5966
5964
  ref,
5967
5965
  id,
5968
- className: (0, tailwind_merge.twMerge)("cpk:grid cpk:transition-[grid-template-rows] cpk:duration-300 cpk:ease-[cubic-bezier(0.16,1,0.3,1)] cpk:motion-reduce:transition-none", className),
5966
+ className: require_MarkdownSurfaces.cn("cpk-collapsible", className),
5969
5967
  style: { gridTemplateRows: open ? "1fr" : "0fr" },
5970
5968
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5971
- className: "cpk:min-h-0 cpk:overflow-hidden",
5969
+ className: "cpk-collapsible-content",
5972
5970
  children
5973
5971
  })
5974
5972
  });
@@ -5982,20 +5980,20 @@ function StatusIcon({ status, className }) {
5982
5980
  }[status];
5983
5981
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
5984
5982
  "aria-hidden": "true",
5985
- className: (0, tailwind_merge.twMerge)("cpk:size-3.5 cpk:shrink-0 cpk:text-muted-foreground", status === "running" && "cpk:animate-spin", status === "failed" && "cpk:text-destructive", className)
5983
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-status-icon", status === "running" && "cpk-tool-call-status-icon-running", status === "failed" && "cpk-tool-call-status-icon-failed", className)
5986
5984
  });
5987
5985
  }
5988
5986
  function Chevron({ open, className }) {
5989
5987
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, {
5990
5988
  "aria-hidden": "true",
5991
- className: (0, tailwind_merge.twMerge)("cpk:size-3.5 cpk:shrink-0 cpk:transition-transform cpk:duration-200", open && "cpk:rotate-90", className)
5989
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-chevron", open && "cpk-tool-call-chevron-open", className)
5992
5990
  });
5993
5991
  }
5994
5992
  function FailedCount({ calls }) {
5995
5993
  const failed = calls.filter((call) => call.toolMessage?.error).length;
5996
5994
  if (!failed) return null;
5997
5995
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
5998
- className: "cpk:shrink-0 cpk:text-destructive",
5996
+ className: "cpk-tool-call-failed-count",
5999
5997
  children: [failed, " failed"]
6000
5998
  });
6001
5999
  }
@@ -6018,10 +6016,10 @@ function stringifyPayload(value) {
6018
6016
  }
6019
6017
  function Payload({ label, value }) {
6020
6018
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6021
- className: "cpk:text-[11px] cpk:font-medium cpk:uppercase cpk:tracking-wide cpk:text-muted-foreground",
6019
+ className: "cpk-tool-call-payload-label",
6022
6020
  children: label
6023
6021
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
6024
- className: "cpk:m-0 cpk:mt-1.5 cpk:max-h-[200px] cpk:overflow-auto cpk:rounded-lg cpk:bg-muted cpk:p-2.5 cpk:font-mono cpk:text-xs cpk:leading-relaxed cpk:text-foreground cpk:whitespace-pre-wrap cpk:break-words",
6022
+ className: "cpk-tool-call-payload-code",
6025
6023
  children: stringifyPayload(value)
6026
6024
  })] });
6027
6025
  }
@@ -6031,7 +6029,7 @@ function Payload({ label, value }) {
6031
6029
  */
6032
6030
  function ToolCallPayloads({ parameters, result, className }) {
6033
6031
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6034
- className: (0, tailwind_merge.twMerge)("cpk:grid cpk:gap-3", className),
6032
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-payloads", className),
6035
6033
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Payload, {
6036
6034
  label: "Arguments",
6037
6035
  value: parameters ?? {}
@@ -6050,36 +6048,35 @@ function ToolCallRow({ name, parameters, result, status, appearance, className,
6050
6048
  const [open, setOpen] = (0, react.useState)(false);
6051
6049
  const detailsId = (0, react.useId)();
6052
6050
  const preview = argumentPreview(parameters);
6053
- const line = appearance === "line";
6054
6051
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6055
6052
  "data-copilotkit": true,
6056
- className: (0, tailwind_merge.twMerge)(appearance === "card" && "cpk:border-t cpk:border-border", className),
6053
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-row", `cpk-tool-call-row-${appearance}`, className),
6057
6054
  ...props,
6058
6055
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6059
6056
  type: "button",
6060
6057
  "aria-expanded": open,
6061
6058
  "aria-controls": detailsId,
6062
6059
  onClick: () => setOpen((value) => !value),
6063
- className: (0, tailwind_merge.twMerge)("cpk:group/row cpk:m-0 cpk:flex cpk:min-w-0 cpk:cursor-pointer cpk:items-center cpk:gap-2 cpk:border-none cpk:bg-transparent cpk:text-left cpk:text-[13px] cpk:text-inherit cpk:transition-colors cpk:hover:bg-accent/60 cpk:focus-visible:outline-2 cpk:focus-visible:-outline-offset-2 cpk:focus-visible:outline-ring", line ? "cpk:-mx-1.5 cpk:w-[calc(100%+0.75rem)] cpk:rounded-md cpk:px-1.5 cpk:py-1" : appearance === "stack" ? "cpk:w-full cpk:px-3.5 cpk:py-2.5" : "cpk:w-full cpk:px-3.5 cpk:py-2"),
6060
+ className: "cpk-tool-call-row-button",
6064
6061
  children: [
6065
6062
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusIcon, { status }),
6066
6063
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6067
6064
  "data-testid": "copilot-tool-render-name",
6068
- className: (0, tailwind_merge.twMerge)("cpk:shrink-0 cpk:font-mono cpk:text-[13px] cpk:font-medium cpk:text-foreground", status === "running" && "cpk-shimmer"),
6065
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-row-name", status === "running" && "cpk-shimmer"),
6069
6066
  children: name
6070
6067
  }),
6071
6068
  preview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6072
- className: "cpk:min-w-0 cpk:truncate cpk:font-mono cpk:text-[13px] cpk:text-muted-foreground",
6069
+ className: "cpk-tool-call-row-preview",
6073
6070
  children: preview
6074
6071
  }),
6075
6072
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6076
6073
  "data-testid": "copilot-tool-render-status",
6077
- className: "cpk:sr-only",
6074
+ className: "cpk-tool-call-row-status",
6078
6075
  children: statusLabels[status]
6079
6076
  }),
6080
6077
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, {
6081
6078
  open,
6082
- className: (0, tailwind_merge.twMerge)("cpk:ml-auto cpk:text-muted-foreground", !open && "cpk:opacity-0 cpk:group-hover/row:opacity-100 cpk:group-focus-visible/row:opacity-100")
6079
+ className: "cpk-tool-call-row-chevron"
6083
6080
  })
6084
6081
  ]
6085
6082
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Collapsible, {
@@ -6088,7 +6085,7 @@ function ToolCallRow({ name, parameters, result, status, appearance, className,
6088
6085
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolCallPayloads, {
6089
6086
  parameters,
6090
6087
  result,
6091
- className: line ? "cpk:mt-1 cpk:mb-2 cpk:ml-5.5" : "cpk:px-3.5 cpk:pt-1 cpk:pb-3"
6088
+ className: "cpk-tool-call-row-payloads"
6092
6089
  })
6093
6090
  })]
6094
6091
  });
@@ -6130,16 +6127,16 @@ function CopilotChatToolCallGroup({ calls, renderCall, appearance = "card", isAc
6130
6127
  ...props
6131
6128
  };
6132
6129
  const runningLabel = current && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6133
- className: "cpk:shrink-0 cpk:font-medium cpk-shimmer",
6130
+ className: "cpk-tool-call-group-running cpk-shimmer",
6134
6131
  children: ["Running ", current.toolCall.function.name]
6135
6132
  }), preview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6136
- className: "cpk:min-w-0 cpk:truncate cpk:font-mono cpk:text-xs cpk:opacity-70",
6133
+ className: "cpk-tool-call-group-preview",
6137
6134
  children: preview
6138
6135
  })] });
6139
6136
  if (appearance === "line") {
6140
6137
  if (calls.length === 1 && !current) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6141
6138
  ...groupProps,
6142
- className: (0, tailwind_merge.twMerge)("cpk:my-2", className),
6139
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-group cpk-tool-call-group-line cpk-tool-call-group-single", className),
6143
6140
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolCallGroupContext.Provider, {
6144
6141
  value: {
6145
6142
  appearance: "line",
@@ -6151,20 +6148,20 @@ function CopilotChatToolCallGroup({ calls, renderCall, appearance = "card", isAc
6151
6148
  });
6152
6149
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6153
6150
  ...groupProps,
6154
- className: (0, tailwind_merge.twMerge)("cpk:my-3", className),
6151
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-group cpk-tool-call-group-line", className),
6155
6152
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6156
6153
  type: "button",
6157
6154
  "aria-expanded": open,
6158
6155
  "aria-controls": bodyId,
6159
6156
  onClick: () => setOpen((value) => !value),
6160
- className: "cpk:m-0 cpk:inline-flex cpk:max-w-full cpk:min-w-0 cpk:cursor-pointer cpk:items-center cpk:gap-1.5 cpk:rounded-md cpk:border-none cpk:bg-transparent cpk:p-0 cpk:py-0.5 cpk:text-sm cpk:text-muted-foreground cpk:transition-colors cpk:hover:text-foreground cpk:focus-visible:outline-2 cpk:focus-visible:outline-ring",
6157
+ className: "cpk-tool-call-group-line-toggle",
6161
6158
  children: [runningLabel || /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
6162
6159
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6163
- className: "cpk:shrink-0 cpk:font-medium",
6160
+ className: "cpk-tool-call-group-line-summary",
6164
6161
  children: ["Used ", pluralize(calls.length, "tool")]
6165
6162
  }),
6166
6163
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6167
- className: "cpk:min-w-0 cpk:truncate cpk:font-mono cpk:text-xs cpk:opacity-70",
6164
+ className: "cpk-tool-call-group-line-names",
6168
6165
  children: toolNames(calls)
6169
6166
  }),
6170
6167
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailedCount, { calls })
@@ -6173,7 +6170,7 @@ function CopilotChatToolCallGroup({ calls, renderCall, appearance = "card", isAc
6173
6170
  open,
6174
6171
  id: bodyId,
6175
6172
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6176
- className: "cpk:mt-1 cpk:ml-1 cpk:border-l-2 cpk:border-border cpk:py-0.5 cpk:pl-3",
6173
+ className: "cpk-tool-call-group-line-body",
6177
6174
  children: rows("line")
6178
6175
  })
6179
6176
  })]
@@ -6181,22 +6178,22 @@ function CopilotChatToolCallGroup({ calls, renderCall, appearance = "card", isAc
6181
6178
  }
6182
6179
  if (appearance === "stack") {
6183
6180
  const behind = open ? 0 : Math.min(calls.length - 1, 2);
6184
- const layer = "cpk:rounded-xl cpk:border cpk:border-border cpk:bg-card cpk:text-card-foreground";
6181
+ const layer = "cpk-tool-call-group-stack-layer";
6185
6182
  const latestStatus = entryStatus(latest, isActive);
6186
6183
  const latestPreview = entryPreview(latest);
6187
6184
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6188
6185
  ...groupProps,
6189
- className: (0, tailwind_merge.twMerge)("cpk:my-3", className),
6186
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-group cpk-tool-call-group-stack", className),
6190
6187
  style: {
6191
6188
  paddingBottom: behind * 6,
6192
6189
  ...props.style
6193
6190
  },
6194
6191
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6195
- className: "cpk:relative cpk:isolate",
6192
+ className: "cpk-tool-call-group-stack-pile",
6196
6193
  children: [
6197
6194
  Array.from({ length: behind }, (_, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6198
6195
  "aria-hidden": "true",
6199
- className: (0, tailwind_merge.twMerge)(layer, "cpk:absolute cpk:inset-0"),
6196
+ className: require_MarkdownSurfaces.cn(layer, "cpk-tool-call-group-stack-behind"),
6200
6197
  style: {
6201
6198
  transform: `translateY(${(index + 1) * 6}px) scaleX(${1 - (index + 1) * .045})`,
6202
6199
  zIndex: -1 - index,
@@ -6208,58 +6205,58 @@ function CopilotChatToolCallGroup({ calls, renderCall, appearance = "card", isAc
6208
6205
  "aria-expanded": open,
6209
6206
  "aria-controls": open ? bodyId : void 0,
6210
6207
  onClick: () => setOpen((value) => !value),
6211
- className: (0, tailwind_merge.twMerge)("cpk:relative cpk:m-0 cpk:flex cpk:min-w-0 cpk:cursor-pointer cpk:items-center cpk:text-left cpk:transition-colors cpk:focus-visible:outline-2 cpk:focus-visible:outline-ring", open ? "cpk:mb-1.5 cpk:w-full cpk:gap-1.5 cpk:rounded-md cpk:border-none cpk:bg-transparent cpk:p-0 cpk:py-0.5 cpk:text-xs cpk:text-muted-foreground cpk:hover:text-foreground" : (0, tailwind_merge.twMerge)(layer, "cpk:w-full cpk:gap-2 cpk:px-3.5 cpk:py-2.5 cpk:text-[13px] cpk:shadow-[0_1px_2px_rgb(0_0_0/0.04)] cpk:hover:bg-accent")),
6208
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-group-stack-toggle", open ? "cpk-tool-call-group-stack-toggle-open" : [layer, "cpk-tool-call-group-stack-toggle-closed"]),
6212
6209
  children: open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
6213
6210
  pluralize(calls.length, "tool call"),
6214
6211
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailedCount, { calls }),
6215
6212
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6216
- className: "cpk:ml-auto cpk:inline-flex cpk:items-center cpk:gap-1",
6213
+ className: "cpk-tool-call-group-stack-collapse",
6217
6214
  children: ["Collapse", /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, {
6218
6215
  open: true,
6219
- className: "cpk:-rotate-90"
6216
+ className: "cpk-tool-call-group-stack-collapse-icon"
6220
6217
  })]
6221
6218
  })
6222
6219
  ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6223
- className: "cpk:flex cpk:min-w-0 cpk:flex-1 cpk:items-center cpk:gap-2 cpk:animate-[cpk-stack-drop_260ms_cubic-bezier(0.16,1,0.3,1)] cpk:motion-reduce:animate-none",
6220
+ className: "cpk-tool-call-group-stack-latest",
6224
6221
  children: [
6225
6222
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusIcon, { status: latestStatus }),
6226
6223
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6227
- className: (0, tailwind_merge.twMerge)("cpk:shrink-0 cpk:font-mono cpk:font-medium cpk:text-foreground", latestStatus === "running" && "cpk-shimmer"),
6224
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-group-stack-name", latestStatus === "running" && "cpk-shimmer"),
6228
6225
  children: latest.toolCall.function.name
6229
6226
  }),
6230
6227
  latestPreview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6231
- className: "cpk:min-w-0 cpk:truncate cpk:font-mono cpk:text-muted-foreground",
6228
+ className: "cpk-tool-call-group-stack-preview",
6232
6229
  children: latestPreview
6233
6230
  }),
6234
6231
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6235
- className: "cpk:sr-only",
6232
+ className: "cpk-tool-call-group-stack-status",
6236
6233
  children: statusLabels[latestStatus]
6237
6234
  })
6238
6235
  ]
6239
6236
  }, latest.toolCall.id), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6240
- className: "cpk:ml-2 cpk:inline-flex cpk:shrink-0 cpk:items-center cpk:gap-2 cpk:text-xs cpk:text-muted-foreground",
6237
+ className: "cpk-tool-call-group-stack-meta",
6241
6238
  children: [
6242
6239
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailedCount, { calls }),
6243
6240
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6244
- className: "cpk:tabular-nums",
6241
+ className: "cpk-tool-call-group-stack-count",
6245
6242
  children: pluralize(calls.length, "call")
6246
6243
  }),
6247
6244
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, {
6248
6245
  open: false,
6249
- className: "cpk:rotate-90"
6246
+ className: "cpk-tool-call-group-stack-expand-icon"
6250
6247
  })
6251
6248
  ]
6252
6249
  })] })
6253
6250
  }),
6254
6251
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6255
6252
  "aria-live": "polite",
6256
- className: "cpk:sr-only",
6253
+ className: "cpk-tool-call-group-stack-live",
6257
6254
  children: open ? "" : `${latest.toolCall.function.name}: ${statusLabels[latestStatus]}`
6258
6255
  })
6259
6256
  ]
6260
6257
  }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6261
6258
  id: bodyId,
6262
- className: "cpk:grid cpk:gap-1.5",
6259
+ className: "cpk-tool-call-group-stack-items",
6263
6260
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolCallGroupContext.Provider, {
6264
6261
  value: {
6265
6262
  appearance: "stack",
@@ -6267,7 +6264,7 @@ function CopilotChatToolCallGroup({ calls, renderCall, appearance = "card", isAc
6267
6264
  active: isActive
6268
6265
  },
6269
6266
  children: calls.map((call, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6270
- className: (0, tailwind_merge.twMerge)(layer, "cpk:overflow-hidden cpk:shadow-[0_1px_2px_rgb(0_0_0/0.04)] cpk:animate-[cpk-stack-fan_240ms_cubic-bezier(0.16,1,0.3,1)_both] cpk:motion-reduce:animate-none"),
6267
+ className: require_MarkdownSurfaces.cn(layer, "cpk-tool-call-group-stack-item"),
6271
6268
  style: { animationDelay: `${index * 30}ms` },
6272
6269
  children: renderCall(call)
6273
6270
  }, call.toolCall.id))
@@ -6277,26 +6274,26 @@ function CopilotChatToolCallGroup({ calls, renderCall, appearance = "card", isAc
6277
6274
  }
6278
6275
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6279
6276
  ...groupProps,
6280
- className: (0, tailwind_merge.twMerge)("cpk:my-3 cpk:overflow-hidden cpk:rounded-xl cpk:border cpk:border-border cpk:bg-card cpk:text-card-foreground", className),
6277
+ className: require_MarkdownSurfaces.cn("cpk-tool-call-group cpk-tool-call-group-card", className),
6281
6278
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6282
6279
  type: "button",
6283
6280
  "aria-expanded": open,
6284
6281
  "aria-controls": bodyId,
6285
6282
  onClick: () => setOpen((value) => !value),
6286
- className: "cpk:m-0 cpk:flex cpk:w-full cpk:min-w-0 cpk:cursor-pointer cpk:items-center cpk:gap-2.5 cpk:border-none cpk:bg-transparent cpk:px-3.5 cpk:py-2.5 cpk:text-left cpk:text-[13px] cpk:text-inherit cpk:transition-colors cpk:hover:bg-accent/60 cpk:focus-visible:outline-2 cpk:focus-visible:-outline-offset-2 cpk:focus-visible:outline-ring",
6283
+ className: "cpk-tool-call-group-card-toggle",
6287
6284
  children: [
6288
6285
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusIcon, { status }),
6289
6286
  runningLabel || /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6290
- className: "cpk:shrink-0 cpk:font-medium cpk:text-foreground",
6287
+ className: "cpk-tool-call-group-card-summary",
6291
6288
  children: ["Used ", pluralize(calls.length, "tool")]
6292
6289
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6293
- className: "cpk:min-w-0 cpk:truncate cpk:font-mono cpk:text-xs cpk:text-muted-foreground",
6290
+ className: "cpk-tool-call-group-card-names",
6294
6291
  children: toolNames(calls)
6295
6292
  })] }),
6296
6293
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6297
- className: "cpk:ml-auto cpk:flex cpk:shrink-0 cpk:items-center cpk:gap-2 cpk:pl-2 cpk:text-xs cpk:text-muted-foreground",
6294
+ className: "cpk-tool-call-group-card-meta",
6298
6295
  children: [status === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailedCount, { calls }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6299
- className: "cpk:tabular-nums",
6296
+ className: "cpk-tool-call-group-card-status",
6300
6297
  children: status !== "running" ? statusLabels[status] : done > 0 && `${done} done`
6301
6298
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, { open })]
6302
6299
  })
@@ -6432,8 +6429,7 @@ function DefaultToolCallRenderer({ name, toolCallId, parameters, status, result
6432
6429
  appearance: group.appearance
6433
6430
  });
6434
6431
  const statusLabel = isActive ? "Running" : isComplete ? "Done" : status;
6435
- const dotClassName = isActive ? "cpk:bg-amber-500" : isComplete ? "cpk:bg-emerald-500" : "cpk:bg-zinc-400";
6436
- const badgeClassName = isActive ? "cpk:bg-amber-100 cpk:text-amber-800 cpk:dark:bg-amber-500/15 cpk:dark:text-amber-400" : isComplete ? "cpk:bg-emerald-100 cpk:text-emerald-800 cpk:dark:bg-emerald-500/15 cpk:dark:text-emerald-400" : "cpk:bg-zinc-100 cpk:text-zinc-800 cpk:dark:bg-zinc-700/40 cpk:dark:text-zinc-300";
6432
+ const tone = isActive ? "running" : isComplete ? "done" : "other";
6437
6433
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6438
6434
  "data-testid": "copilot-tool-render",
6439
6435
  "data-tool-name": name,
@@ -6441,20 +6437,20 @@ function DefaultToolCallRenderer({ name, toolCallId, parameters, status, result
6441
6437
  "data-status": status,
6442
6438
  "data-args": safeStringifyForAttr(parameters),
6443
6439
  "data-result": safeStringifyForAttr(result),
6444
- className: "cpk:mt-2 cpk:pb-2",
6440
+ className: "cpk-default-tool-call",
6445
6441
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6446
- className: "cpk:rounded-xl cpk:border cpk:border-zinc-200/60 cpk:bg-white/70 cpk:p-4 cpk:shadow-sm cpk:backdrop-blur cpk:dark:border-zinc-800/60 cpk:dark:bg-zinc-900/50",
6442
+ className: "cpk-default-tool-call-card",
6447
6443
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6448
6444
  type: "button",
6449
6445
  "aria-expanded": isExpanded,
6450
6446
  onClick: () => setIsExpanded(!isExpanded),
6451
- className: "cpk:flex cpk:w-full cpk:cursor-pointer cpk:select-none cpk:items-center cpk:justify-between cpk:gap-2.5 cpk:border-none cpk:bg-transparent cpk:p-0 cpk:m-0 cpk:text-left cpk:text-inherit",
6447
+ className: "cpk-default-tool-call-header",
6452
6448
  style: { font: "inherit" },
6453
6449
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6454
- className: "cpk:flex cpk:min-w-0 cpk:items-center cpk:gap-2",
6450
+ className: "cpk-default-tool-call-title",
6455
6451
  children: [
6456
6452
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
6457
- className: `cpk:h-3.5 cpk:w-3.5 cpk:flex-shrink-0 cpk:text-zinc-500 cpk:transition-transform cpk:dark:text-zinc-400 ${isExpanded ? "cpk:rotate-90" : ""}`,
6453
+ className: require_MarkdownSurfaces.cn("cpk-default-tool-call-chevron", isExpanded && "cpk-default-tool-call-chevron-open"),
6458
6454
  fill: "none",
6459
6455
  viewBox: "0 0 24 24",
6460
6456
  strokeWidth: 2,
@@ -6465,31 +6461,31 @@ function DefaultToolCallRenderer({ name, toolCallId, parameters, status, result
6465
6461
  d: "M8.25 4.5l7.5 7.5-7.5 7.5"
6466
6462
  })
6467
6463
  }),
6468
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `cpk:inline-block cpk:h-2 cpk:w-2 cpk:flex-shrink-0 cpk:rounded-full ${dotClassName}` }),
6464
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `cpk-default-tool-call-dot cpk-default-tool-call-dot-${tone}` }),
6469
6465
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6470
6466
  "data-testid": "copilot-tool-render-name",
6471
- className: "cpk:truncate cpk:text-[13px] cpk:font-semibold cpk:text-zinc-900 cpk:dark:text-zinc-100",
6467
+ className: "cpk-default-tool-call-name",
6472
6468
  children: name
6473
6469
  })
6474
6470
  ]
6475
6471
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6476
6472
  "data-testid": "copilot-tool-render-status",
6477
- className: `cpk:inline-flex cpk:flex-shrink-0 cpk:items-center cpk:rounded-full cpk:px-2 cpk:py-0.5 cpk:text-[11px] cpk:font-medium ${badgeClassName}`,
6473
+ className: `cpk-default-tool-call-badge cpk-default-tool-call-badge-${tone}`,
6478
6474
  children: statusLabel
6479
6475
  })]
6480
6476
  }), isExpanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6481
- className: "cpk:mt-3 cpk:grid cpk:gap-3",
6477
+ className: "cpk-default-tool-call-details",
6482
6478
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6483
- className: "cpk:text-[10px] cpk:uppercase cpk:text-zinc-500 cpk:dark:text-zinc-400",
6479
+ className: "cpk-default-tool-call-label",
6484
6480
  children: "Arguments"
6485
6481
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
6486
- className: "cpk:mt-1.5 cpk:max-h-[200px] cpk:overflow-auto cpk:rounded-md cpk:bg-zinc-100 cpk:p-2.5 cpk:text-[11px] cpk:leading-relaxed cpk:text-zinc-800 cpk:whitespace-pre-wrap cpk:break-words cpk:dark:bg-zinc-800/60 cpk:dark:text-zinc-200",
6482
+ className: "cpk-default-tool-call-code",
6487
6483
  children: safeStringifyForPre(parameters ?? {})
6488
6484
  })] }), result !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6489
- className: "cpk:text-[10px] cpk:uppercase cpk:text-zinc-500 cpk:dark:text-zinc-400",
6485
+ className: "cpk-default-tool-call-label",
6490
6486
  children: "Result"
6491
6487
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
6492
- className: "cpk:mt-1.5 cpk:max-h-[200px] cpk:overflow-auto cpk:rounded-md cpk:bg-zinc-100 cpk:p-2.5 cpk:text-[11px] cpk:leading-relaxed cpk:text-zinc-800 cpk:whitespace-pre-wrap cpk:break-words cpk:dark:bg-zinc-800/60 cpk:dark:text-zinc-200",
6488
+ className: "cpk-default-tool-call-code",
6493
6489
  children: typeof result === "string" ? result : safeStringifyForPre(result)
6494
6490
  })] })]
6495
6491
  })]
@@ -8332,9 +8328,9 @@ function CopilotChatToolCallsView({ message, messages = [], display: displayProp
8332
8328
  const failedIds = new Set(segment.calls.filter((call) => call.toolMessage?.error).map((call) => call.toolCall.id));
8333
8329
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Collapsible, {
8334
8330
  open: workOpen ?? true,
8335
- className: "cpk:-mx-2",
8331
+ className: "cpk-tool-calls-view-turn",
8336
8332
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8337
- className: "cpk:px-2 cpk:py-1.5",
8333
+ className: "cpk-tool-calls-view-turn-rows",
8338
8334
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolCallGroupContext.Provider, {
8339
8335
  value: {
8340
8336
  appearance: "line",
@@ -8379,7 +8375,7 @@ function InspectorKiteIcon({ className, ...props }) {
8379
8375
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
8380
8376
  ...props,
8381
8377
  "aria-hidden": "true",
8382
- className: (0, tailwind_merge.twMerge)("cpk:size-4", className),
8378
+ className: require_MarkdownSurfaces.cn("cpk-inspector-button-kite-icon", className),
8383
8379
  viewBox: "4.57 3.36 17.8 17.8",
8384
8380
  fill: "none",
8385
8381
  children: [
@@ -8527,7 +8523,7 @@ function CopilotChatInspectorButton({ title, className, onClick, onPointerDown,
8527
8523
  size: "icon",
8528
8524
  "data-testid": "copilot-inspector-button",
8529
8525
  "aria-label": `${labels.assistantMessageToolbarInspectorTitle} (${labels.assistantMessageToolbarInspectorLocalOnlyLabel.toLowerCase()})`,
8530
- className: (0, tailwind_merge.twMerge)("cpk:size-8 cpk:p-1.5", className),
8526
+ className: require_MarkdownSurfaces.cn("cpk-inspector-button", className),
8531
8527
  onPointerEnter: (event) => {
8532
8528
  onPointerEnter?.(event);
8533
8529
  if (!disabled && event.pointerType !== "touch") {
@@ -8557,7 +8553,7 @@ function CopilotChatInspectorButton({ title, className, onClick, onPointerDown,
8557
8553
  },
8558
8554
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Wrench, {
8559
8555
  "aria-hidden": "true",
8560
- className: "cpk:size-4",
8556
+ className: "cpk-inspector-button-icon",
8561
8557
  "data-testid": "copilot-inspector-icon"
8562
8558
  })
8563
8559
  })
@@ -8565,7 +8561,7 @@ function CopilotChatInspectorButton({ title, className, onClick, onPointerDown,
8565
8561
  align: "start",
8566
8562
  side: "top",
8567
8563
  sideOffset: 6,
8568
- className: (0, tailwind_merge.twMerge)("cpk:w-64 cpk:p-1 cpk:text-sm", dark && "dark"),
8564
+ className: require_MarkdownSurfaces.cn("cpk-inspector-button-menu", dark && "dark"),
8569
8565
  onPointerEnter: cancelClose,
8570
8566
  onPointerLeave: scheduleClose,
8571
8567
  onKeyDown: () => {
@@ -8580,9 +8576,9 @@ function CopilotChatInspectorButton({ title, className, onClick, onPointerDown,
8580
8576
  onFocusOutside: () => changeOpen(false),
8581
8577
  children: [
8582
8578
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DropdownMenuLabel, {
8583
- className: "cpk:flex cpk:items-center cpk:justify-between cpk:gap-3 cpk:px-2 cpk:py-2",
8579
+ className: "cpk-inspector-button-menu-header",
8584
8580
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8585
- className: "cpk:text-xs cpk:font-medium",
8581
+ className: "cpk-inspector-button-menu-title",
8586
8582
  children: labels.assistantMessageToolbarInspectorTitle
8587
8583
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Tooltip, {
8588
8584
  delayDuration: 1e3,
@@ -8590,13 +8586,13 @@ function CopilotChatInspectorButton({ title, className, onClick, onPointerDown,
8590
8586
  asChild: true,
8591
8587
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8592
8588
  tabIndex: 0,
8593
- className: "cpk:cursor-help cpk:rounded cpk:bg-muted cpk:px-1.5 cpk:py-0.5 cpk:text-[10px] cpk:font-normal cpk:text-muted-foreground",
8589
+ className: "cpk-inspector-button-local-badge",
8594
8590
  children: labels.assistantMessageToolbarInspectorLocalOnlyLabel
8595
8591
  })
8596
8592
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContent, {
8597
8593
  side: "top",
8598
8594
  sideOffset: 6,
8599
- className: (0, tailwind_merge.twMerge)("cpk:max-w-48 cpk:text-wrap", dark && "dark"),
8595
+ className: require_MarkdownSurfaces.cn("cpk-inspector-button-local-tooltip", dark && "dark"),
8600
8596
  onPointerEnter: cancelClose,
8601
8597
  onPointerLeave: scheduleClose,
8602
8598
  children: labels.assistantMessageToolbarInspectorLocalOnlyDescription
@@ -8609,27 +8605,27 @@ function CopilotChatInspectorButton({ title, className, onClick, onPointerDown,
8609
8605
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
8610
8606
  type: "button",
8611
8607
  onClick,
8612
- className: "cpk:w-full cpk:cursor-pointer cpk:items-start cpk:text-left",
8613
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InspectorKiteIcon, { className: "cpk:mt-0.5" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8614
- className: "cpk:block",
8608
+ className: "cpk-inspector-button-menu-item cpk-inspector-button-inspect-item",
8609
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InspectorKiteIcon, { className: "cpk-inspector-button-menu-item-icon" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8610
+ className: "cpk-inspector-button-menu-item-label",
8615
8611
  children: primaryLabel
8616
8612
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8617
- className: "cpk:block cpk:text-xs cpk:text-muted-foreground",
8613
+ className: "cpk-inspector-button-menu-item-description",
8618
8614
  children: labels.assistantMessageToolbarInspectorDescription
8619
8615
  })] })]
8620
8616
  })
8621
8617
  }),
8622
8618
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DropdownMenuItem, {
8623
8619
  onSelect: hideShortcuts,
8624
- className: "cpk:cursor-pointer cpk:items-start",
8620
+ className: "cpk-inspector-button-menu-item cpk-inspector-button-hide-item",
8625
8621
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.EyeOff, {
8626
8622
  "aria-hidden": "true",
8627
- className: "cpk:mt-0.5"
8623
+ className: "cpk-inspector-button-menu-item-icon"
8628
8624
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8629
- className: "cpk:block",
8625
+ className: "cpk-inspector-button-menu-item-label",
8630
8626
  children: labels.assistantMessageToolbarInspectorHideLabel
8631
8627
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8632
- className: "cpk:block cpk:text-xs cpk:text-muted-foreground",
8628
+ className: "cpk-inspector-button-menu-item-description",
8633
8629
  children: labels.assistantMessageToolbarInspectorHideDescription
8634
8630
  })] })]
8635
8631
  })
@@ -8663,7 +8659,7 @@ const PopoverContent = react.forwardRef(({ className, align = "start", sideOffse
8663
8659
  "data-slot": "popover-content",
8664
8660
  align,
8665
8661
  sideOffset,
8666
- className: cn("cpk:z-50 cpk:outline-none cpk:data-[state=open]:animate-in cpk:data-[state=open]:fade-in-0 cpk:data-[state=open]:zoom-in-95 cpk:data-[side=bottom]:slide-in-from-top-1 cpk:data-[side=top]:slide-in-from-bottom-1", className),
8662
+ className: require_MarkdownSurfaces.cn("cpk-popover", className),
8667
8663
  ...props
8668
8664
  }) }));
8669
8665
  PopoverContent.displayName = "PopoverContent";
@@ -8958,9 +8954,9 @@ function WorkText({ messageId, children }) {
8958
8954
  const open = context.workTextOpen.get(messageId);
8959
8955
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Collapsible, {
8960
8956
  open: open ?? true,
8961
- className: "cpk:-mx-2",
8957
+ className: "cpk-assistant-message-work-text",
8962
8958
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8963
- className: "cpk:px-2",
8959
+ className: "cpk-assistant-message-work-text-content",
8964
8960
  "data-work-text": open === void 0 ? "reply" : "narration",
8965
8961
  children
8966
8962
  })
@@ -9066,7 +9062,7 @@ function FeedbackCommentPopover({ feedbackComment, comment, savedComment, rating
9066
9062
  },
9067
9063
  onPointerEnter: () => comment.enter("pointer"),
9068
9064
  onPointerLeave: () => comment.leave("pointer"),
9069
- className: "cpk:z-[1300]",
9065
+ className: "cpk-assistant-message-feedback-popover",
9070
9066
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: require_MarkdownSurfaces.renderSlot(feedbackComment, CopilotChatAssistantMessage.FeedbackComment, {
9071
9067
  value: comment.draft,
9072
9068
  savedComment,
@@ -9193,7 +9189,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9193
9189
  const boundReadAloudButton = require_MarkdownSurfaces.renderSlot(readAloudButton, CopilotChatAssistantMessage.ReadAloudButton, { onClick: onReadAloud ? () => onReadAloud(message) : void 0 });
9194
9190
  const boundRegenerateButton = require_MarkdownSurfaces.renderSlot(regenerateButton, CopilotChatAssistantMessage.RegenerateButton, { onClick: onRegenerate ? () => onRegenerate(message) : void 0 });
9195
9191
  const boundToolbar = require_MarkdownSurfaces.renderSlot(toolbar, CopilotChatAssistantMessage.Toolbar, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9196
- className: "cpk:flex cpk:w-full cpk:items-center cpk:gap-1",
9192
+ className: "cpk-assistant-message-toolbar-items",
9197
9193
  children: [
9198
9194
  boundCopyButton,
9199
9195
  (onThumbsUp || thumbsUpButton || feedback) && boundThumbsUpButton,
@@ -9258,14 +9254,14 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9258
9254
  ref: root,
9259
9255
  "data-copilotkit": true,
9260
9256
  "data-testid": "copilot-assistant-message",
9261
- className: (0, tailwind_merge.twMerge)("copilotKitMessage copilotKitAssistantMessage", className),
9257
+ className: require_MarkdownSurfaces.cn("copilotKitMessage copilotKitAssistantMessage", className),
9262
9258
  ...props,
9263
9259
  "data-message-id": message.id,
9264
9260
  children: [
9265
9261
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkText, {
9266
9262
  messageId: message.id,
9267
9263
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9268
- className: "cpk:prose cpk:max-w-full cpk:break-words cpk:dark:prose-invert",
9264
+ className: "cpk-markdown cpk-assistant-message-markdown",
9269
9265
  children: boundMarkdownRenderer
9270
9266
  })
9271
9267
  }),
@@ -9293,7 +9289,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9293
9289
  };
9294
9290
  _CopilotChatAssistantMessage.Toolbar = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9295
9291
  "data-testid": "copilot-assistant-toolbar",
9296
- className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:-ml-[5px] cpk:-mt-[0px]", className),
9292
+ className: require_MarkdownSurfaces.cn("cpk-assistant-message-toolbar", className),
9297
9293
  ...props
9298
9294
  });
9299
9295
  const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, tooltipClassName, children, ...props }) => {
@@ -9346,7 +9342,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9346
9342
  onClick: handleClick,
9347
9343
  className,
9348
9344
  ...props,
9349
- children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk:size-[18px]" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "cpk:size-[18px]" })
9345
+ children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk-assistant-message-toolbar-icon" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "cpk-assistant-message-toolbar-icon" })
9350
9346
  });
9351
9347
  };
9352
9348
  _CopilotChatAssistantMessage.InspectorButton = CopilotChatInspectorButton;
@@ -9357,7 +9353,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9357
9353
  title: title || labels.assistantMessageToolbarThumbsUpLabel,
9358
9354
  ...props,
9359
9355
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ThumbsUp, {
9360
- className: "cpk:size-[18px]",
9356
+ className: "cpk-assistant-message-toolbar-icon",
9361
9357
  fill: props["aria-pressed"] === true ? "currentColor" : "none"
9362
9358
  })
9363
9359
  });
@@ -9369,7 +9365,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9369
9365
  title: title || labels.assistantMessageToolbarThumbsDownLabel,
9370
9366
  ...props,
9371
9367
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ThumbsDown, {
9372
- className: "cpk:size-[18px]",
9368
+ className: "cpk-assistant-message-toolbar-icon",
9373
9369
  fill: props["aria-pressed"] === true ? "currentColor" : "none"
9374
9370
  })
9375
9371
  });
@@ -9379,7 +9375,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9379
9375
  const changed = value.trim() !== savedComment;
9380
9376
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
9381
9377
  "data-testid": "copilot-feedback-comment",
9382
- className: (0, tailwind_merge.twMerge)("cpk:flex cpk:w-80 cpk:max-w-[calc(100vw-1rem)] cpk:items-center cpk:gap-1 cpk:rounded-full cpk:border cpk:border-border cpk:bg-background cpk:py-0.5 cpk:pl-3 cpk:pr-0.5 cpk:text-sm cpk:shadow-md", className),
9378
+ className: require_MarkdownSurfaces.cn("cpk-assistant-message-feedback-comment", className),
9383
9379
  onSubmit: (event) => {
9384
9380
  event.preventDefault();
9385
9381
  onSubmit();
@@ -9399,13 +9395,13 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9399
9395
  onChange: (event) => onChange(event.target.value),
9400
9396
  placeholder: labels.assistantMessageFeedbackCommentPlaceholder,
9401
9397
  "aria-label": labels.assistantMessageFeedbackCommentPlaceholder,
9402
- className: "cpk:min-w-0 cpk:flex-1 cpk:bg-transparent cpk:py-1 cpk:text-foreground cpk:outline-none cpk:placeholder:text-muted-foreground"
9398
+ className: "cpk-assistant-message-feedback-comment-input"
9403
9399
  }), changed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9404
9400
  type: "submit",
9405
9401
  variant: "assistantMessageToolbarButton",
9406
9402
  "aria-label": labels.assistantMessageFeedbackCommentSubmitLabel,
9407
9403
  title: labels.assistantMessageFeedbackCommentSubmitLabel,
9408
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowUp, { className: "cpk:size-[16px]" })
9404
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowUp, { className: "cpk-assistant-message-feedback-comment-submit-icon" })
9409
9405
  })]
9410
9406
  });
9411
9407
  };
@@ -9415,7 +9411,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9415
9411
  "data-testid": "copilot-read-aloud-button",
9416
9412
  title: title || labels.assistantMessageToolbarReadAloudLabel,
9417
9413
  ...props,
9418
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Volume2, { className: "cpk:size-[20px]" })
9414
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Volume2, { className: "cpk-assistant-message-read-aloud-icon" })
9419
9415
  });
9420
9416
  };
9421
9417
  _CopilotChatAssistantMessage.RegenerateButton = ({ title, ...props }) => {
@@ -9424,7 +9420,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
9424
9420
  "data-testid": "copilot-regenerate-button",
9425
9421
  title: title || labels.assistantMessageToolbarRegenerateLabel,
9426
9422
  ...props,
9427
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.RefreshCw, { className: "cpk:size-[18px]" })
9423
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.RefreshCw, { className: "cpk-assistant-message-toolbar-icon" })
9428
9424
  });
9429
9425
  };
9430
9426
  })(CopilotChatAssistantMessage || (CopilotChatAssistantMessage = {}));
@@ -9457,13 +9453,13 @@ function Lightbox({ onClose, children }) {
9457
9453
  }, [onClose]);
9458
9454
  if (typeof document === "undefined") return null;
9459
9455
  return (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9460
- className: "cpk:fixed cpk:inset-0 cpk:z-[9999] cpk:flex cpk:items-center cpk:justify-center cpk:bg-black/80 cpk:animate-fade-in",
9456
+ className: "cpk-attachment-lightbox",
9461
9457
  onClick: onClose,
9462
9458
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
9463
9459
  onClick: onClose,
9464
- className: "cpk:absolute cpk:top-4 cpk:right-4 cpk:text-white cpk:bg-white/10 cpk:hover:bg-white/20 cpk:rounded-full cpk:w-10 cpk:h-10 cpk:flex cpk:items-center cpk:justify-center cpk:cursor-pointer cpk:border-none cpk:z-10",
9460
+ className: "cpk-attachment-lightbox-close-button",
9465
9461
  "aria-label": labels.attachmentPreviewCloseButtonLabel,
9466
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "cpk:w-5 cpk:h-5" })
9462
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "cpk-attachment-lightbox-close-icon" })
9467
9463
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9468
9464
  onClick: (e) => e.stopPropagation(),
9469
9465
  children
@@ -9521,14 +9517,14 @@ const ImageAttachment = (0, react.memo)(function ImageAttachment({ src, classNam
9521
9517
  const [error, setError] = (0, react.useState)(false);
9522
9518
  const { thumbnailRef, vtName, open, openLightbox, closeLightbox } = useLightbox();
9523
9519
  if (error) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9524
- className: cn("cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:rounded-lg cpk:bg-muted cpk:p-4 cpk:text-sm cpk:text-muted-foreground", className),
9520
+ className: require_MarkdownSurfaces.cn("cpk-attachment-renderer cpk-attachment-renderer-image-error", className),
9525
9521
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "Failed to load image" })
9526
9522
  });
9527
9523
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
9528
9524
  ref: thumbnailRef,
9529
9525
  src,
9530
9526
  alt: "Image attachment",
9531
- className: cn("cpk:max-w-[80px] cpk:max-h-[80px] cpk:w-auto cpk:h-auto cpk:rounded-xl cpk:object-cover cpk:cursor-pointer cpk:bg-muted", className),
9527
+ className: require_MarkdownSurfaces.cn("cpk-attachment-renderer cpk-attachment-renderer-image", className),
9532
9528
  onClick: openLightbox,
9533
9529
  onError: () => setError(true)
9534
9530
  }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Lightbox, {
@@ -9537,20 +9533,20 @@ const ImageAttachment = (0, react.memo)(function ImageAttachment({ src, classNam
9537
9533
  style: { viewTransitionName: vtName },
9538
9534
  src,
9539
9535
  alt: "Image attachment",
9540
- className: "cpk:max-w-[90vw] cpk:max-h-[90vh] cpk:object-contain cpk:rounded-lg"
9536
+ className: "cpk-attachment-renderer-lightbox-image"
9541
9537
  })
9542
9538
  })] });
9543
9539
  });
9544
9540
  const AudioAttachment = (0, react.memo)(function AudioAttachment({ src, filename, className }) {
9545
9541
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9546
- className: cn("cpk:flex cpk:flex-col cpk:gap-1", className),
9542
+ className: require_MarkdownSurfaces.cn("cpk-attachment-renderer cpk-attachment-renderer-audio", className),
9547
9543
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("audio", {
9548
9544
  src,
9549
9545
  controls: true,
9550
9546
  preload: "metadata",
9551
- className: "cpk:max-w-[300px] cpk:w-full cpk:h-10"
9547
+ className: "cpk-attachment-renderer-audio-player"
9552
9548
  }), filename && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9553
- className: "cpk:text-xs cpk:text-muted-foreground cpk:truncate cpk:max-w-[300px]",
9549
+ className: "cpk-attachment-renderer-audio-filename",
9554
9550
  children: filename
9555
9551
  })]
9556
9552
  });
@@ -9560,7 +9556,7 @@ const VideoAttachment = (0, react.memo)(function VideoAttachment({ src, classNam
9560
9556
  src,
9561
9557
  controls: true,
9562
9558
  preload: "metadata",
9563
- className: cn("cpk:max-w-[400px] cpk:w-full cpk:rounded-lg", className)
9559
+ className: require_MarkdownSurfaces.cn("cpk-attachment-renderer cpk-attachment-renderer-video", className)
9564
9560
  });
9565
9561
  });
9566
9562
  const DocumentAttachment = (0, react.memo)(function DocumentAttachment({ src, source, filename, className }) {
@@ -9571,12 +9567,12 @@ const DocumentAttachment = (0, react.memo)(function DocumentAttachment({ src, so
9571
9567
  target: "_blank",
9572
9568
  rel: "noopener noreferrer",
9573
9569
  "aria-label": label,
9574
- className: cn("cpk:inline-flex cpk:max-w-full cpk:items-center cpk:gap-2 cpk:px-3 cpk:py-2 cpk:border cpk:border-border cpk:rounded-lg cpk:bg-muted", className),
9570
+ className: require_MarkdownSurfaces.cn("cpk-attachment-renderer cpk-attachment-renderer-document", className),
9575
9571
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9576
- className: "cpk:text-xs cpk:font-bold cpk:uppercase",
9572
+ className: "cpk-attachment-renderer-document-icon",
9577
9573
  children: (0, _copilotkit_shared.getDocumentIcon)(source.mimeType ?? "")
9578
9574
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9579
- className: "cpk:text-sm cpk:text-muted-foreground cpk:truncate",
9575
+ className: "cpk-attachment-renderer-document-name",
9580
9576
  children: filename || source.mimeType || "Unknown type"
9581
9577
  })]
9582
9578
  });
@@ -9641,7 +9637,7 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9641
9637
  });
9642
9638
  const showBranchNavigation = numberOfBranches && numberOfBranches > 1 && onSwitchToBranch;
9643
9639
  const BoundToolbar = require_MarkdownSurfaces.renderSlot(toolbar, CopilotChatUserMessage.Toolbar, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9644
- className: "cpk:flex cpk:items-center cpk:gap-1 cpk:justify-end",
9640
+ className: "cpk-user-message-toolbar-items",
9645
9641
  children: [
9646
9642
  additionalToolbarItems,
9647
9643
  BoundCopyButton,
@@ -9667,12 +9663,12 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9667
9663
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9668
9664
  "data-copilotkit": true,
9669
9665
  "data-testid": "copilot-user-message",
9670
- className: (0, tailwind_merge.twMerge)("copilotKitMessage copilotKitUserMessage cpk:flex cpk:flex-col cpk:items-end cpk:group cpk:pt-10", className),
9666
+ className: require_MarkdownSurfaces.cn("copilotKitMessage copilotKitUserMessage cpk-user-message", className),
9671
9667
  "data-message-id": message.id,
9672
9668
  ...props,
9673
9669
  children: [
9674
9670
  mediaParts.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9675
- className: "cpk:flex cpk:flex-row cpk:flex-wrap cpk:max-w-full cpk:justify-end cpk:gap-2 cpk:mb-2",
9671
+ className: "cpk-user-message-attachments",
9676
9672
  children: mediaParts.map((part, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotChatAttachmentRenderer, {
9677
9673
  type: part.type,
9678
9674
  source: part.source,
@@ -9686,17 +9682,17 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9686
9682
  }
9687
9683
  (function(_CopilotChatUserMessage) {
9688
9684
  _CopilotChatUserMessage.Container = ({ children, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9689
- className: (0, tailwind_merge.twMerge)("cpk:flex cpk:flex-col cpk:items-end cpk:group", className),
9685
+ className: require_MarkdownSurfaces.cn("cpk-user-message-container", className),
9690
9686
  ...props,
9691
9687
  children
9692
9688
  });
9693
9689
  _CopilotChatUserMessage.MessageRenderer = ({ content, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9694
- className: (0, tailwind_merge.twMerge)("cpk:prose cpk:dark:prose-invert cpk:bg-muted cpk:relative cpk:max-w-[80%] cpk:rounded-[18px] cpk:px-4 cpk:py-1.5 cpk:data-[multiline]:py-3 cpk:inline-block cpk:whitespace-pre-wrap", className),
9690
+ className: require_MarkdownSurfaces.cn("cpk-user-message-bubble", className),
9695
9691
  children: content
9696
9692
  });
9697
9693
  _CopilotChatUserMessage.Toolbar = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9698
9694
  "data-testid": "copilot-user-toolbar",
9699
- className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:justify-end cpk:-mr-[5px] cpk:mt-[4px] cpk:invisible cpk:group-hover:visible", className),
9695
+ className: require_MarkdownSurfaces.cn("cpk-user-message-toolbar", className),
9700
9696
  ...props
9701
9697
  });
9702
9698
  const ToolbarButton = _CopilotChatUserMessage.ToolbarButton = ({ title, children, className, ...props }) => {
@@ -9706,7 +9702,7 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9706
9702
  type: "button",
9707
9703
  variant: "assistantMessageToolbarButton",
9708
9704
  "aria-label": title,
9709
- className: (0, tailwind_merge.twMerge)(className),
9705
+ className,
9710
9706
  ...props,
9711
9707
  children
9712
9708
  })
@@ -9732,7 +9728,7 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9732
9728
  onClick: handleClick,
9733
9729
  className,
9734
9730
  ...props,
9735
- children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk:size-[18px]" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "cpk:size-[18px]" })
9731
+ children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk-user-message-toolbar-icon" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "cpk-user-message-toolbar-icon" })
9736
9732
  });
9737
9733
  };
9738
9734
  _CopilotChatUserMessage.EditButton = ({ className, title, ...props }) => {
@@ -9742,7 +9738,7 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9742
9738
  title: title || labels.userMessageToolbarEditMessageLabel,
9743
9739
  className,
9744
9740
  ...props,
9745
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Edit, { className: "cpk:size-[18px]" })
9741
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Edit, { className: "cpk-user-message-toolbar-icon" })
9746
9742
  });
9747
9743
  };
9748
9744
  _CopilotChatUserMessage.BranchNavigation = ({ className, currentBranch = 0, numberOfBranches = 1, onSwitchToBranch, message, ...props }) => {
@@ -9752,7 +9748,7 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9752
9748
  const canGoNext = currentBranch < numberOfBranches - 1;
9753
9749
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9754
9750
  "data-testid": "copilot-branch-navigation",
9755
- className: (0, tailwind_merge.twMerge)("cpk:flex cpk:items-center cpk:gap-1", className),
9751
+ className: require_MarkdownSurfaces.cn("cpk-user-message-branch-navigation", className),
9756
9752
  ...props,
9757
9753
  children: [
9758
9754
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
@@ -9764,12 +9760,12 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9764
9760
  message
9765
9761
  }),
9766
9762
  disabled: !canGoPrev,
9767
- className: "cpk:h-6 cpk:w-6 cpk:p-0",
9763
+ className: "cpk-user-message-branch-button",
9768
9764
  "aria-label": labels.userMessageToolbarPreviousBranchLabel,
9769
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeft, { className: "cpk:size-[20px]" })
9765
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeft, { className: "cpk-user-message-branch-icon" })
9770
9766
  }),
9771
9767
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
9772
- className: "cpk:text-sm cpk:text-muted-foreground cpk:px-0 cpk:font-medium",
9768
+ className: "cpk-user-message-branch-counter",
9773
9769
  children: [
9774
9770
  currentBranch + 1,
9775
9771
  "/",
@@ -9785,9 +9781,9 @@ function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfB
9785
9781
  message
9786
9782
  }),
9787
9783
  disabled: !canGoNext,
9788
- className: "cpk:h-6 cpk:w-6 cpk:p-0",
9784
+ className: "cpk-user-message-branch-button",
9789
9785
  "aria-label": labels.userMessageToolbarNextBranchLabel,
9790
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "cpk:size-[20px]" })
9786
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "cpk-user-message-branch-icon" })
9791
9787
  })
9792
9788
  ]
9793
9789
  });
@@ -9883,7 +9879,7 @@ function CopilotChatReasoningMessage({ message, messages, isRunning, isLatest: i
9883
9879
  })
9884
9880
  });
9885
9881
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9886
- className: (0, tailwind_merge.twMerge)("cpk:my-1", className),
9882
+ className: require_MarkdownSurfaces.cn("cpk-reasoning-message", className),
9887
9883
  "data-message-id": message.id,
9888
9884
  ...props,
9889
9885
  children: [boundHeader, boundToggle]
@@ -9894,47 +9890,47 @@ function CopilotChatReasoningMessage({ message, messages, isRunning, isLatest: i
9894
9890
  const isExpandable = !!hasContent;
9895
9891
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
9896
9892
  type: "button",
9897
- className: (0, tailwind_merge.twMerge)("cpk:inline-flex cpk:items-center cpk:gap-1 cpk:py-1 cpk:text-sm cpk:text-muted-foreground cpk:transition-colors cpk:select-none", isExpandable ? "cpk:hover:text-foreground cpk:cursor-pointer" : "cpk:cursor-default", className),
9893
+ className: require_MarkdownSurfaces.cn("cpk-reasoning-message-header", isExpandable && "cpk-reasoning-message-header-expandable", className),
9898
9894
  "aria-expanded": isExpandable ? isOpen : void 0,
9899
9895
  ...headerProps,
9900
9896
  children: [
9901
9897
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9902
- className: "cpk:font-medium",
9898
+ className: "cpk-reasoning-message-label",
9903
9899
  children: label
9904
9900
  }),
9905
9901
  isStreaming && !hasContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9906
- className: "cpk:inline-flex cpk:items-center cpk:ml-1",
9907
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cpk:w-1.5 cpk:h-1.5 cpk:rounded-full cpk:bg-muted-foreground cpk:animate-pulse" })
9902
+ className: "cpk-reasoning-message-indicator",
9903
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cpk-reasoning-message-indicator-dot" })
9908
9904
  }),
9909
9905
  headerChildren,
9910
- isExpandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: (0, tailwind_merge.twMerge)("cpk:size-3.5 cpk:shrink-0 cpk:transition-transform cpk:duration-200", isOpen && "cpk:rotate-90") })
9906
+ isExpandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: require_MarkdownSurfaces.cn("cpk-reasoning-message-chevron", isOpen && "cpk-reasoning-message-chevron-open") })
9911
9907
  ]
9912
9908
  });
9913
9909
  };
9914
9910
  _CopilotChatReasoningMessage.Content = ({ isStreaming, hasContent, className, children: contentChildren, ...contentProps }) => {
9915
9911
  if (!hasContent && !isStreaming) return null;
9916
9912
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9917
- className: (0, tailwind_merge.twMerge)("cpk:pb-2 cpk:pt-1", className),
9913
+ className: require_MarkdownSurfaces.cn("cpk-reasoning-message-content", className),
9918
9914
  ...contentProps,
9919
9915
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9920
- className: "cpk:text-sm cpk:text-muted-foreground",
9916
+ className: "cpk-reasoning-message-text",
9921
9917
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.StreamingMarkdownDefaultRenderer, {
9922
9918
  content: typeof contentChildren === "string" ? contentChildren : "",
9923
9919
  isStreaming
9924
9920
  }), isStreaming && hasContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9925
- className: "cpk:inline-flex cpk:items-center cpk:ml-1 cpk:align-middle",
9926
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cpk:w-2 cpk:h-2 cpk:rounded-full cpk:bg-muted-foreground cpk:animate-pulse-cursor" })
9921
+ className: "cpk-reasoning-message-cursor",
9922
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cpk-reasoning-message-cursor-dot" })
9927
9923
  })]
9928
9924
  })
9929
9925
  });
9930
9926
  };
9931
9927
  _CopilotChatReasoningMessage.Toggle = ({ isOpen, className, children: toggleChildren, ...toggleProps }) => {
9932
9928
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9933
- className: (0, tailwind_merge.twMerge)("cpk:grid cpk:transition-[grid-template-rows] cpk:duration-200 cpk:ease-in-out", className),
9929
+ className: require_MarkdownSurfaces.cn("cpk-reasoning-message-toggle", className),
9934
9930
  style: { gridTemplateRows: isOpen ? "1fr" : "0fr" },
9935
9931
  ...toggleProps,
9936
9932
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9937
- className: "cpk:overflow-hidden",
9933
+ className: "cpk-reasoning-message-toggle-content",
9938
9934
  children: toggleChildren
9939
9935
  })
9940
9936
  });
@@ -9947,8 +9943,6 @@ var CopilotChatReasoningMessage_default = CopilotChatReasoningMessage;
9947
9943
 
9948
9944
  //#endregion
9949
9945
  //#region src/components/chat/CopilotChatSuggestionPill.tsx
9950
- const baseClasses = "group cpk:inline-flex cpk:h-7 cpk:sm:h-8 cpk:items-center cpk:gap-1 cpk:sm:gap-1.5 cpk:rounded-full cpk:border cpk:border-border/60 cpk:bg-background cpk:px-2.5 cpk:sm:px-3 cpk:text-[11px] cpk:sm:text-xs cpk:leading-none cpk:text-foreground cpk:transition-colors cpk:cursor-pointer cpk:hover:bg-accent/60 cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring cpk:focus-visible:ring-offset-2 cpk:focus-visible:ring-offset-background cpk:disabled:cursor-not-allowed cpk:disabled:text-muted-foreground cpk:disabled:hover:bg-background cpk:disabled:hover:text-muted-foreground cpk:pointer-events-auto";
9951
- const labelClasses = "cpk:whitespace-nowrap cpk:font-medium cpk:leading-none";
9952
9946
  const CopilotChatSuggestionPill = react.default.forwardRef(function CopilotChatSuggestionPill({ className, children, icon, isLoading, type, ...props }, ref) {
9953
9947
  const showIcon = !isLoading && icon;
9954
9948
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
@@ -9956,22 +9950,22 @@ const CopilotChatSuggestionPill = react.default.forwardRef(function CopilotChatS
9956
9950
  "data-copilotkit": true,
9957
9951
  "data-testid": "copilot-suggestion",
9958
9952
  "data-slot": "suggestion-pill",
9959
- className: cn(baseClasses, className),
9953
+ className: className ? `cpk-suggestion-pill ${className}` : "cpk-suggestion-pill",
9960
9954
  type: type ?? "button",
9961
9955
  "aria-busy": isLoading || void 0,
9962
9956
  disabled: isLoading || props.disabled,
9963
9957
  ...props,
9964
9958
  children: [isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9965
- className: "cpk:flex cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:items-center cpk:justify-center cpk:text-muted-foreground",
9959
+ className: "cpk-suggestion-pill-icon",
9966
9960
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, {
9967
- className: "cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:animate-spin",
9961
+ className: "cpk-suggestion-pill-spinner",
9968
9962
  "aria-hidden": "true"
9969
9963
  })
9970
9964
  }) : showIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9971
- className: "cpk:flex cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:items-center cpk:justify-center cpk:text-muted-foreground",
9965
+ className: "cpk-suggestion-pill-icon",
9972
9966
  children: icon
9973
9967
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9974
- className: labelClasses,
9968
+ className: "cpk-suggestion-pill-label",
9975
9969
  children
9976
9970
  })]
9977
9971
  });
@@ -9985,7 +9979,7 @@ const DefaultContainer = react.default.forwardRef(function DefaultContainer({ cl
9985
9979
  ref,
9986
9980
  "data-copilotkit": true,
9987
9981
  "data-testid": "copilot-suggestions",
9988
- className: cn("cpk:flex cpk:flex-wrap cpk:items-center cpk:gap-1.5 cpk:sm:gap-2 cpk:pl-0 cpk:pr-4 cpk:@3xl:px-0 cpk:pointer-events-none", className),
9982
+ className: require_MarkdownSurfaces.cn("cpk-suggestion-view", className),
9989
9983
  ...props
9990
9984
  });
9991
9985
  });
@@ -10115,30 +10109,30 @@ function CopilotChatWorkSummary({ isWorking, isOpen, calls, elapsedMs, workingSi
10115
10109
  "data-testid": "copilot-work-summary",
10116
10110
  "data-state": isWorking ? "working" : "done",
10117
10111
  "aria-expanded": isOpen,
10118
- className: (0, tailwind_merge.twMerge)("cpk:m-0 cpk:inline-flex cpk:max-w-full cpk:cursor-pointer cpk:items-center cpk:gap-1.5 cpk:rounded-md cpk:border-none cpk:bg-transparent cpk:p-0 cpk:py-0.5 cpk:text-sm cpk:text-muted-foreground cpk:transition-colors cpk:hover:text-foreground cpk:focus-visible:outline-2 cpk:focus-visible:outline-ring", className),
10112
+ className: require_MarkdownSurfaces.cn("cpk-work-summary", className),
10119
10113
  ...props,
10120
10114
  children: [isWorking ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10121
- className: "cpk:font-medium cpk-shimmer",
10115
+ className: "cpk-work-summary-label cpk-shimmer",
10122
10116
  children: "Working"
10123
10117
  }), liveMs !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10124
- className: "cpk:text-xs cpk:tabular-nums cpk:opacity-70",
10118
+ className: "cpk-work-summary-detail cpk-work-summary-timer",
10125
10119
  children: formatDuration(liveMs)
10126
10120
  })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
10127
10121
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10128
- className: "cpk:font-medium",
10122
+ className: "cpk-work-summary-label",
10129
10123
  children: duration ? `Worked for ${duration}` : `Used ${pluralize(calls.length, "tool")}`
10130
10124
  }),
10131
10125
  duration && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10132
- className: "cpk:text-xs cpk:opacity-70",
10126
+ className: "cpk-work-summary-detail",
10133
10127
  children: pluralize(calls.length, "tool")
10134
10128
  }),
10135
10129
  failed > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
10136
- className: "cpk:text-destructive",
10130
+ className: "cpk-work-summary-failed",
10137
10131
  children: [failed, " failed"]
10138
10132
  })
10139
10133
  ] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, {
10140
10134
  "aria-hidden": "true",
10141
- className: (0, tailwind_merge.twMerge)("cpk:size-3.5 cpk:shrink-0 cpk:transition-transform cpk:duration-200", isOpen && "cpk:rotate-90")
10135
+ className: require_MarkdownSurfaces.cn("cpk-work-summary-chevron", isOpen && "cpk-work-summary-chevron-open")
10142
10136
  })]
10143
10137
  });
10144
10138
  }
@@ -10155,7 +10149,7 @@ function CopilotChatWorkSummary({ isWorking, isOpen, calls, elapsedMs, workingSi
10155
10149
  * checkmark — whose geometry lives in each path's `d` ATTRIBUTE so it
10156
10150
  * renders in every browser (the CSS `d:` property is Chrome-only).
10157
10151
  *
10158
- * Two states, driven by the `data-status` attribute (see globals.css
10152
+ * Two states, driven by the `data-status` attribute (see styles/css/intelligence-indicator.css
10159
10153
  * for the exact timing):
10160
10154
  * 1. **In-progress.** The arc spins (CSS rotation) inside the pill and
10161
10155
  * the checkmark is hidden. Label + icon are a saturated purple.
@@ -10169,7 +10163,7 @@ function CopilotChatWorkSummary({ isWorking, isOpen, calls, elapsedMs, workingSi
10169
10163
  * — the static check plus the color/slant shift carry the "done"
10170
10164
  * meaning, so no wording change is needed.
10171
10165
  *
10172
- * All motion is gated behind `prefers-reduced-motion` (globals.css):
10166
+ * All motion is gated behind `prefers-reduced-motion` (styles/css/intelligence-indicator.css):
10173
10167
  * when reduced motion is requested the arc does not spin and the two
10174
10168
  * states swap instantly, without transitions.
10175
10169
  *
@@ -10180,7 +10174,7 @@ function CopilotChatWorkSummary({ isWorking, isOpen, calls, elapsedMs, workingSi
10180
10174
  */
10181
10175
  function IntelligenceIndicatorView({ message, status, label, className, ...rest }) {
10182
10176
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
10183
- className: (0, tailwind_merge.twMerge)("cpk-intelligence-indicator", className),
10177
+ className: require_MarkdownSurfaces.cn("cpk-intelligence-indicator", className),
10184
10178
  role: "status",
10185
10179
  "aria-live": "polite",
10186
10180
  "data-testid": `cpk-intelligence-indicator-${message.id}`,
@@ -10752,7 +10746,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10752
10746
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Collapsible, {
10753
10747
  open: working || calls.length > 0,
10754
10748
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
10755
- className: "cpk:pt-1 cpk:pb-2",
10749
+ className: "cpk-message-view-work-summary",
10756
10750
  children: require_MarkdownSurfaces.renderSlot(workSummary, CopilotChatWorkSummary, {
10757
10751
  isWorking: working,
10758
10752
  isOpen: open,
@@ -11123,7 +11117,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
11123
11117
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11124
11118
  "data-copilotkit": true,
11125
11119
  "data-testid": "copilot-message-list",
11126
- className: (0, tailwind_merge.twMerge)("copilotKitMessages cpk:flex cpk:flex-col", className),
11120
+ className: require_MarkdownSurfaces.cn("copilotKitMessages cpk-message-view", className),
11127
11121
  ...props,
11128
11122
  children: [
11129
11123
  shouldVirtualize ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -11151,7 +11145,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
11151
11145
  interruptElement,
11152
11146
  pendingWorkSummary && renderWorkSummary(latestTurnKey, []),
11153
11147
  showCursor && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11154
- className: "cpk:mt-2",
11148
+ className: "cpk-message-view-cursor-container",
11155
11149
  children: require_MarkdownSurfaces.renderSlot(cursor, CopilotChatMessageView.Cursor, {})
11156
11150
  })
11157
11151
  ]
@@ -11162,7 +11156,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
11162
11156
  CopilotChatMessageView.Cursor = function Cursor({ className, ...props }) {
11163
11157
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11164
11158
  "data-testid": "copilot-loading-cursor",
11165
- className: (0, tailwind_merge.twMerge)("cpk:w-[11px] cpk:h-[11px] cpk:rounded-full cpk:bg-foreground cpk:animate-pulse-cursor cpk:ml-1", className),
11159
+ className: require_MarkdownSurfaces.cn("cpk-message-view-cursor", className),
11166
11160
  ...props
11167
11161
  });
11168
11162
  };
@@ -11178,17 +11172,16 @@ const CopilotChatAttachmentQueue = ({ attachments, onRemoveAttachment, className
11178
11172
  if (attachments.length === 0) return null;
11179
11173
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11180
11174
  "data-testid": "copilot-attachment-queue",
11181
- className: cn("cpk:flex cpk:flex-wrap cpk:gap-2 cpk:p-2", className),
11175
+ className: require_MarkdownSurfaces.cn("cpk-attachment-queue", className),
11182
11176
  children: attachments.map((attachment) => {
11183
- const isMedia = attachment.type === "image" || attachment.type === "video";
11184
11177
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11185
- className: cn("cpk:relative cpk:inline-flex cpk:rounded-lg cpk:overflow-hidden cpk:border cpk:border-border", isMedia ? "cpk:w-[72px] cpk:h-[72px]" : attachment.type === "audio" ? "cpk:min-w-[200px] cpk:max-w-[280px] cpk:flex-col cpk:p-1 cpk:pr-8" : "cpk:p-2 cpk:px-3 cpk:pr-8 cpk:max-w-[240px]"),
11178
+ className: require_MarkdownSurfaces.cn("cpk-attachment-queue-item", attachment.type === "image" || attachment.type === "video" ? "cpk-attachment-queue-item-media" : attachment.type === "audio" ? "cpk-attachment-queue-item-audio" : "cpk-attachment-queue-item-document"),
11186
11179
  children: [
11187
11180
  attachment.status === "uploading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UploadingOverlay, {}),
11188
11181
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttachmentPreview, { attachment }),
11189
11182
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11190
11183
  onClick: () => onRemoveAttachment(attachment.id),
11191
- className: cn("cpk:absolute cpk:bg-black/60 cpk:text-white cpk:border-none cpk:rounded-full cpk:w-5 cpk:h-5 cpk:flex cpk:items-center cpk:justify-center cpk:cursor-pointer cpk:text-[10px] cpk:z-20", isMedia ? "cpk:top-1 cpk:right-1" : "cpk:top-1.5 cpk:right-1.5"),
11184
+ className: "cpk-attachment-queue-remove-button",
11192
11185
  "aria-label": labels.attachmentRemoveButtonLabel,
11193
11186
  children: "✕"
11194
11187
  })
@@ -11199,12 +11192,12 @@ const CopilotChatAttachmentQueue = ({ attachments, onRemoveAttachment, className
11199
11192
  };
11200
11193
  function UploadingOverlay() {
11201
11194
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11202
- className: "cpk:absolute cpk:inset-0 cpk:flex cpk:items-center cpk:justify-center cpk:bg-black/40 cpk:z-10",
11203
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "cpk:w-5 cpk:h-5 cpk:border-2 cpk:border-white cpk:border-t-transparent cpk:rounded-full cpk:animate-spin" })
11195
+ className: "cpk-attachment-queue-uploading-overlay",
11196
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "cpk-attachment-queue-uploading-spinner" })
11204
11197
  });
11205
11198
  }
11206
11199
  function AttachmentPreview({ attachment }) {
11207
- if (attachment.status === "uploading") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "cpk:w-full cpk:h-full" });
11200
+ if (attachment.status === "uploading") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "cpk-attachment-queue-placeholder" });
11208
11201
  switch (attachment.type) {
11209
11202
  case "image": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImagePreview, { attachment });
11210
11203
  case "audio": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AudioPreview, { attachment });
@@ -11219,7 +11212,7 @@ function ImagePreview({ attachment }) {
11219
11212
  ref: thumbnailRef,
11220
11213
  src,
11221
11214
  alt: attachment.filename || "Image attachment",
11222
- className: "cpk:w-full cpk:h-full cpk:object-cover cpk:cursor-pointer",
11215
+ className: "cpk-attachment-queue-image",
11223
11216
  onClick: openLightbox
11224
11217
  }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Lightbox, {
11225
11218
  onClose: closeLightbox,
@@ -11227,20 +11220,20 @@ function ImagePreview({ attachment }) {
11227
11220
  style: { viewTransitionName: vtName },
11228
11221
  src,
11229
11222
  alt: attachment.filename || "Image attachment",
11230
- className: "cpk:max-w-[90vw] cpk:max-h-[90vh] cpk:object-contain cpk:rounded-lg"
11223
+ className: "cpk-attachment-queue-lightbox-image"
11231
11224
  })
11232
11225
  })] });
11233
11226
  }
11234
11227
  function AudioPreview({ attachment }) {
11235
11228
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11236
- className: "cpk:flex cpk:flex-col cpk:gap-1 cpk:w-full",
11229
+ className: "cpk-attachment-queue-audio",
11237
11230
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("audio", {
11238
11231
  src: (0, _copilotkit_shared.getSourceUrl)(attachment.source),
11239
11232
  controls: true,
11240
11233
  preload: "metadata",
11241
- className: "cpk:w-full cpk:h-8"
11234
+ className: "cpk-attachment-queue-audio-player"
11242
11235
  }), attachment.filename && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11243
- className: "cpk:text-xs cpk:font-medium cpk:overflow-hidden cpk:text-ellipsis cpk:whitespace-nowrap",
11236
+ className: "cpk-attachment-queue-audio-filename",
11244
11237
  children: attachment.filename
11245
11238
  })]
11246
11239
  });
@@ -11257,25 +11250,25 @@ function VideoPreview({ attachment }) {
11257
11250
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
11258
11251
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11259
11252
  ref: thumbnailRef,
11260
- className: "cpk:w-full cpk:h-full",
11253
+ className: "cpk-attachment-queue-video",
11261
11254
  children: attachment.thumbnail ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
11262
11255
  src: attachment.thumbnail,
11263
11256
  alt: attachment.filename || "Video thumbnail",
11264
- className: "cpk:w-full cpk:h-full cpk:object-cover"
11257
+ className: "cpk-attachment-queue-video-thumbnail"
11265
11258
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("video", {
11266
11259
  src,
11267
11260
  preload: "metadata",
11268
11261
  muted: true,
11269
- className: "cpk:w-full cpk:h-full cpk:object-cover"
11262
+ className: "cpk-attachment-queue-video-thumbnail"
11270
11263
  })
11271
11264
  }),
11272
11265
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11273
11266
  onClick: openLightbox,
11274
- className: "cpk:absolute cpk:inset-0 cpk:flex cpk:items-center cpk:justify-center cpk:z-10 cpk:cursor-pointer cpk:bg-black/20 cpk:border-none cpk:p-0",
11267
+ className: "cpk-attachment-queue-video-play-button",
11275
11268
  "aria-label": labels.attachmentPlayVideoButtonLabel,
11276
11269
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11277
- className: "cpk:w-8 cpk:h-8 cpk:rounded-full cpk:bg-black/60 cpk:flex cpk:items-center cpk:justify-center",
11278
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Play, { className: "cpk:w-4 cpk:h-4 cpk:text-white cpk:ml-0.5" })
11270
+ className: "cpk-attachment-queue-video-play-badge",
11271
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Play, { className: "cpk-attachment-queue-video-play-icon" })
11279
11272
  })
11280
11273
  }),
11281
11274
  open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Lightbox, {
@@ -11285,7 +11278,7 @@ function VideoPreview({ attachment }) {
11285
11278
  src,
11286
11279
  controls: true,
11287
11280
  autoPlay: true,
11288
- className: "cpk:max-w-[90vw] cpk:max-h-[90vh] cpk:rounded-lg"
11281
+ className: "cpk-attachment-queue-lightbox-video"
11289
11282
  })
11290
11283
  })
11291
11284
  ] });
@@ -11336,7 +11329,7 @@ function DocumentLightboxContent({ attachment, vtName }) {
11336
11329
  style: { viewTransitionName: vtName },
11337
11330
  src: blobUrl,
11338
11331
  title: attachment.filename || "PDF preview",
11339
- className: "cpk:w-[90vw] cpk:h-[90vh] cpk:max-w-[1000px] cpk:rounded-lg cpk:bg-white"
11332
+ className: "cpk-attachment-queue-pdf-preview"
11340
11333
  });
11341
11334
  }
11342
11335
  if (isText(mimeType)) {
@@ -11349,40 +11342,40 @@ function DocumentLightboxContent({ attachment, vtName }) {
11349
11342
  })() : null;
11350
11343
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11351
11344
  style: { viewTransitionName: vtName },
11352
- className: "cpk:w-[90vw] cpk:max-w-[800px] cpk:max-h-[90vh] cpk:overflow-auto cpk:rounded-lg cpk:bg-white cpk:dark:bg-gray-900 cpk:p-6",
11345
+ className: "cpk-attachment-queue-text-preview",
11353
11346
  children: [attachment.filename && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11354
- className: "cpk:text-sm cpk:font-medium cpk:text-gray-500 cpk:dark:text-gray-400 cpk:mb-4 cpk:pb-2 cpk:border-b cpk:border-gray-200 cpk:dark:border-gray-700",
11347
+ className: "cpk-attachment-queue-text-preview-filename",
11355
11348
  children: attachment.filename
11356
11349
  }), textContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
11357
- className: "cpk:text-sm cpk:whitespace-pre-wrap cpk:break-words cpk:text-gray-800 cpk:dark:text-gray-200 cpk:font-mono cpk:m-0",
11350
+ className: "cpk-attachment-queue-text-preview-content",
11358
11351
  children: textContent
11359
11352
  }) : blobUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
11360
11353
  src: blobUrl,
11361
11354
  title: attachment.filename || "Text preview",
11362
- className: "cpk:w-full cpk:h-[80vh] cpk:border-none"
11355
+ className: "cpk-attachment-queue-text-preview-frame"
11363
11356
  }) : null]
11364
11357
  });
11365
11358
  }
11366
11359
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11367
11360
  style: { viewTransitionName: vtName },
11368
- className: "cpk:flex cpk:flex-col cpk:items-center cpk:gap-4 cpk:p-8 cpk:rounded-lg cpk:bg-white cpk:dark:bg-gray-900",
11361
+ className: "cpk-attachment-queue-document-card",
11369
11362
  children: [
11370
11363
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11371
- className: "cpk:w-16 cpk:h-16 cpk:rounded-xl cpk:bg-primary cpk:text-primary-foreground cpk:flex cpk:items-center cpk:justify-center cpk:text-xl cpk:font-bold",
11364
+ className: "cpk-attachment-queue-document-card-icon",
11372
11365
  children: (0, _copilotkit_shared.getDocumentIcon)(mimeType ?? "")
11373
11366
  }),
11374
11367
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11375
- className: "cpk:text-center",
11368
+ className: "cpk-attachment-queue-document-card-details",
11376
11369
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11377
- className: "cpk:text-base cpk:font-medium cpk:text-gray-800 cpk:dark:text-gray-200",
11370
+ className: "cpk-attachment-queue-document-card-name",
11378
11371
  children: attachment.filename || "Document"
11379
11372
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11380
- className: "cpk:text-sm cpk:text-gray-500 cpk:dark:text-gray-400 cpk:mt-1",
11373
+ className: "cpk-attachment-queue-document-card-meta",
11381
11374
  children: [mimeType || "Unknown type", attachment.size != null && ` · ${(0, _copilotkit_shared.formatFileSize)(attachment.size)}`]
11382
11375
  })]
11383
11376
  }),
11384
11377
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11385
- className: "cpk:text-xs cpk:text-gray-400 cpk:dark:text-gray-500",
11378
+ className: "cpk-attachment-queue-document-card-note",
11386
11379
  children: "No preview available for this file type"
11387
11380
  })
11388
11381
  ]
@@ -11394,18 +11387,18 @@ function DocumentPreview({ attachment }) {
11394
11387
  const previewable = canPreviewInBrowser(mimeType);
11395
11388
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11396
11389
  ref: thumbnailRef,
11397
- className: cn("cpk:flex cpk:items-center cpk:gap-2", previewable && "cpk:cursor-pointer"),
11390
+ className: require_MarkdownSurfaces.cn("cpk-attachment-queue-document", previewable && "cpk-attachment-queue-document-previewable"),
11398
11391
  onClick: previewable ? openLightbox : void 0,
11399
11392
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11400
- className: "cpk:w-8 cpk:h-8 cpk:rounded-md cpk:bg-primary cpk:text-primary-foreground cpk:flex cpk:items-center cpk:justify-center cpk:text-[10px] cpk:font-semibold cpk:shrink-0",
11393
+ className: "cpk-attachment-queue-document-icon",
11401
11394
  children: (0, _copilotkit_shared.getDocumentIcon)(mimeType ?? "")
11402
11395
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11403
- className: "cpk:flex cpk:flex-col cpk:min-w-0",
11396
+ className: "cpk-attachment-queue-document-info",
11404
11397
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11405
- className: "cpk:text-xs cpk:font-medium cpk:break-all cpk:leading-tight",
11398
+ className: "cpk-attachment-queue-document-name",
11406
11399
  children: attachment.filename || "Document"
11407
11400
  }), attachment.size != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11408
- className: "cpk:text-[11px] cpk:text-muted-foreground",
11401
+ className: "cpk-attachment-queue-document-size",
11409
11402
  children: (0, _copilotkit_shared.formatFileSize)(attachment.size)
11410
11403
  })]
11411
11404
  })]
@@ -11541,11 +11534,11 @@ function computeOffsetTop(el, stopAt) {
11541
11534
  const SCROLL_BUTTON_OFFSET = 16;
11542
11535
  function DropOverlay() {
11543
11536
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11544
- className: cn("cpk:absolute cpk:inset-0 cpk:z-50 cpk:pointer-events-none", "cpk:flex cpk:items-center cpk:justify-center", "cpk:bg-primary/5 cpk:backdrop-blur-[2px]", "cpk:border-2 cpk:border-dashed cpk:border-primary/40 cpk:rounded-lg cpk:m-2"),
11537
+ className: "cpk-chat-view-drop-overlay",
11545
11538
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11546
- className: "cpk:flex cpk:flex-col cpk:items-center cpk:gap-2 cpk:text-primary/70",
11547
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Upload, { className: "cpk:w-8 cpk:h-8" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11548
- className: "cpk:text-sm cpk:font-medium",
11539
+ className: "cpk-chat-view-drop-overlay-content",
11540
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Upload, { className: "cpk-chat-view-drop-overlay-icon" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11541
+ className: "cpk-chat-view-drop-overlay-label",
11549
11542
  children: "Drop files here"
11550
11543
  })]
11551
11544
  })
@@ -11624,7 +11617,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11624
11617
  suggestions,
11625
11618
  loadingIndexes: suggestionLoadingIndexes,
11626
11619
  onSelectSuggestion,
11627
- className: "cpk:mb-3 cpk:lg:ml-4 cpk:lg:mr-4 cpk:ml-0 cpk:mr-0"
11620
+ className: "cpk-chat-view-suggestion-view"
11628
11621
  }) : null;
11629
11622
  const BoundScrollView = require_MarkdownSurfaces.renderSlot(scrollView, CopilotChatView.ScrollView, {
11630
11623
  autoScroll,
@@ -11635,9 +11628,9 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11635
11628
  "data-testid": "copilot-scroll-content",
11636
11629
  style: { paddingBottom: `${inputContainerHeight + (hasSuggestions ? 4 : 32)}px` },
11637
11630
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11638
- className: "cpk:max-w-3xl cpk:mx-auto",
11631
+ className: "cpk-chat-view-feed",
11639
11632
  children: [BoundMessageView, hasSuggestions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11640
- className: "cpk:pl-0 cpk:pr-4 cpk:@3xl:px-0 cpk:mt-4",
11633
+ className: "cpk-chat-view-suggestions",
11641
11634
  children: BoundSuggestionView
11642
11635
  }) : null]
11643
11636
  })
@@ -11662,11 +11655,11 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11662
11655
  });
11663
11656
  const welcomeScreenSlot = welcomeScreen === true ? void 0 : welcomeScreen;
11664
11657
  const inputWithAttachments = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11665
- className: "cpk:w-full",
11658
+ className: "cpk-chat-view-welcome-input-group",
11666
11659
  children: [attachments && attachments.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotChatAttachmentQueue, {
11667
11660
  attachments,
11668
11661
  onRemoveAttachment: (id) => onRemoveAttachment?.(id),
11669
- className: "cpk:mb-2"
11662
+ className: "cpk-chat-view-welcome-attachment-queue"
11670
11663
  }), BoundInputForWelcome]
11671
11664
  });
11672
11665
  const BoundWelcomeScreen = require_MarkdownSurfaces.renderSlot(welcomeScreenSlot, CopilotChatView.WelcomeScreen, {
@@ -11680,7 +11673,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11680
11673
  onDragOver,
11681
11674
  onDragLeave,
11682
11675
  onDrop,
11683
- className: cn("copilotKitChat cpk:@container cpk:relative cpk:h-full cpk:flex cpk:flex-col", className),
11676
+ className: require_MarkdownSurfaces.cn("copilotKitChat cpk-chat-view", className),
11684
11677
  ...props,
11685
11678
  children: [dragOver && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DropOverlay, {}), BoundWelcomeScreen]
11686
11679
  });
@@ -11702,7 +11695,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11702
11695
  onDragOver,
11703
11696
  onDragLeave,
11704
11697
  onDrop,
11705
- className: cn("copilotKitChat cpk:@container cpk:relative cpk:h-full cpk:flex cpk:flex-col", className),
11698
+ className: require_MarkdownSurfaces.cn("copilotKitChat cpk-chat-view", className),
11706
11699
  ...props,
11707
11700
  children: [
11708
11701
  dragOver && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DropOverlay, {}),
@@ -11710,13 +11703,13 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11710
11703
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11711
11704
  ref: setInputContainerEl,
11712
11705
  "data-testid": "copilot-input-overlay",
11713
- className: "cpk:absolute cpk:bottom-0 cpk:left-0 cpk:right-0 cpk:z-20 cpk:pointer-events-none",
11706
+ className: "cpk-chat-view-input-overlay",
11714
11707
  children: [attachments && attachments.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11715
- className: "cpk:max-w-3xl cpk:mx-auto cpk:w-full cpk:pointer-events-auto",
11708
+ className: "cpk-chat-view-attachments",
11716
11709
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotChatAttachmentQueue, {
11717
11710
  attachments,
11718
11711
  onRemoveAttachment: (id) => onRemoveAttachment?.(id),
11719
- className: "cpk:px-4"
11712
+ className: "cpk-chat-view-attachment-queue"
11720
11713
  })
11721
11714
  }), BoundInput]
11722
11715
  })
@@ -11827,19 +11820,19 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11827
11820
  value: state.isAtBottom,
11828
11821
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
11829
11822
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(use_stick_to_bottom.StickToBottom.Content, {
11830
- className: "cpk:overflow-y-auto cpk:overflow-x-hidden",
11823
+ className: "cpk-chat-view-scroll-viewport",
11831
11824
  style: {
11832
11825
  flex: "1 1 0%",
11833
11826
  minHeight: 0
11834
11827
  },
11835
11828
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11836
- className: "cpk:px-4 cpk:@3xl:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6",
11829
+ className: "cpk-chat-view-scroll-content",
11837
11830
  children
11838
11831
  })
11839
11832
  }),
11840
11833
  BoundFeather,
11841
11834
  !isAtBottom && !isResizing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11842
- className: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
11835
+ className: "cpk-chat-view-scroll-to-bottom",
11843
11836
  style: { bottom: `${inputContainerHeight + SCROLL_BUTTON_OFFSET}px` },
11844
11837
  children: require_MarkdownSurfaces.renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, { onClick: () => startBottomPin() })
11845
11838
  })
@@ -11859,15 +11852,15 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11859
11852
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScrollElementContext.Provider, {
11860
11853
  value: nonAutoScrollEl,
11861
11854
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11862
- className: cn("cpk:h-full cpk:max-h-full cpk:flex cpk:flex-col cpk:min-h-0 cpk:relative", className),
11855
+ className: require_MarkdownSurfaces.cn("cpk-chat-view-scroll-area", className),
11863
11856
  children: [
11864
11857
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11865
11858
  ref: nonAutoScrollRefCallback,
11866
- className: "cpk:flex-1 cpk:min-h-0 cpk:overflow-y-auto cpk:overflow-x-hidden",
11859
+ className: "cpk-chat-view-scroll-viewport",
11867
11860
  ...props,
11868
11861
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11869
11862
  ref: contentRef,
11870
- className: "cpk:px-4 cpk:@3xl:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6",
11863
+ className: "cpk-chat-view-scroll-content",
11871
11864
  children
11872
11865
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11873
11866
  ref: spacerRef,
@@ -11881,7 +11874,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11881
11874
  }),
11882
11875
  BoundFeather,
11883
11876
  showScrollButton && !isResizing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11884
- className: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
11877
+ className: "cpk-chat-view-scroll-to-bottom",
11885
11878
  style: { bottom: `${inputContainerHeight + SCROLL_BUTTON_OFFSET}px` },
11886
11879
  children: require_MarkdownSurfaces.renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, { onClick: () => scrollToBottom() })
11887
11880
  })
@@ -11927,9 +11920,9 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11927
11920
  };
11928
11921
  }, [nonAutoScrollEl, mode]);
11929
11922
  if (!hasMounted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11930
- className: "cpk:h-full cpk:max-h-full cpk:flex cpk:flex-col cpk:min-h-0 cpk:overflow-y-auto cpk:overflow-x-hidden",
11923
+ className: "cpk-chat-view-scroll-area cpk-chat-view-scroll-viewport",
11931
11924
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11932
- className: "cpk:px-4 cpk:@3xl:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6",
11925
+ className: "cpk-chat-view-scroll-content",
11933
11926
  children
11934
11927
  })
11935
11928
  });
@@ -11939,17 +11932,17 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11939
11932
  value: nonAutoScrollEl,
11940
11933
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11941
11934
  ref: nonAutoScrollRefCallback,
11942
- className: cn("cpk:h-full cpk:max-h-full cpk:flex cpk:flex-col cpk:min-h-0 cpk:overflow-y-auto cpk:overflow-x-hidden cpk:relative", className),
11935
+ className: require_MarkdownSurfaces.cn("cpk-chat-view-scroll-area cpk-chat-view-scroll-viewport", className),
11943
11936
  ...props,
11944
11937
  children: [
11945
11938
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11946
11939
  ref: contentRef,
11947
- className: "cpk:px-4 cpk:@3xl:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6",
11940
+ className: "cpk-chat-view-scroll-content",
11948
11941
  children
11949
11942
  }),
11950
11943
  BoundFeather,
11951
11944
  showScrollButton && !isResizing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11952
- className: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
11945
+ className: "cpk-chat-view-scroll-to-bottom",
11953
11946
  style: { bottom: `${inputContainerHeight + SCROLL_BUTTON_OFFSET}px` },
11954
11947
  children: require_MarkdownSurfaces.renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, { onClick: () => scrollToBottom() })
11955
11948
  })
@@ -11973,7 +11966,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11973
11966
  children
11974
11967
  });
11975
11968
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(use_stick_to_bottom.StickToBottom, {
11976
- className: cn("cpk:flex-1 cpk:max-h-full cpk:flex cpk:flex-col cpk:min-h-0", className),
11969
+ className: require_MarkdownSurfaces.cn("cpk-chat-view-scroll-view", className),
11977
11970
  resize: "smooth",
11978
11971
  initial: "smooth",
11979
11972
  ...props,
@@ -11993,10 +11986,10 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11993
11986
  "data-testid": "copilot-scroll-to-bottom",
11994
11987
  variant: "outline",
11995
11988
  size: "sm",
11996
- className: (0, tailwind_merge.twMerge)("cpk:rounded-full cpk:w-10 cpk:h-10 cpk:p-0 cpk:pointer-events-auto", "cpk:bg-white cpk:dark:bg-gray-900", "cpk:shadow-lg cpk:border cpk:border-gray-200 cpk:dark:border-gray-700", "cpk:hover:bg-gray-50 cpk:dark:hover:bg-gray-800", "cpk:flex cpk:items-center cpk:justify-center cpk:cursor-pointer", className),
11989
+ className: require_MarkdownSurfaces.cn("cpk-chat-view-scroll-to-bottom-button", className),
11997
11990
  "aria-label": labels.chatScrollToBottomLabel,
11998
11991
  ...props,
11999
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "cpk:w-4 cpk:h-4 cpk:text-gray-600 cpk:dark:text-white" })
11992
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "cpk-chat-view-scroll-to-bottom-icon" })
12000
11993
  });
12001
11994
  };
12002
11995
  _CopilotChatView.Feather = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -12006,7 +11999,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
12006
11999
  _CopilotChatView.WelcomeMessage = ({ className, ...props }) => {
12007
12000
  const labels = require_MarkdownSurfaces.useCopilotChatConfiguration()?.labels ?? require_MarkdownSurfaces.CopilotChatDefaultLabels;
12008
12001
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
12009
- className: cn("cpk:text-xl cpk:sm:text-2xl cpk:font-medium cpk:text-foreground cpk:text-center", className),
12002
+ className: require_MarkdownSurfaces.cn("cpk-chat-view-welcome-message", className),
12010
12003
  ...props,
12011
12004
  children: labels.welcomeMessageText
12012
12005
  });
@@ -12026,21 +12019,21 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
12026
12019
  });
12027
12020
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12028
12021
  "data-testid": "copilot-welcome-screen",
12029
- className: cn("cpk:flex-1 cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:px-4", className),
12022
+ className: require_MarkdownSurfaces.cn("cpk-chat-view-welcome-screen", className),
12030
12023
  ...props,
12031
12024
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12032
- className: "cpk:w-full cpk:max-w-3xl cpk:flex cpk:flex-col cpk:items-center",
12025
+ className: "cpk-chat-view-welcome-screen-content",
12033
12026
  children: [
12034
12027
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12035
- className: "cpk:mb-6",
12028
+ className: "cpk-chat-view-welcome-screen-message",
12036
12029
  children: BoundWelcomeMessage
12037
12030
  }),
12038
12031
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12039
- className: "cpk:w-full",
12032
+ className: "cpk-chat-view-welcome-screen-input",
12040
12033
  children: input
12041
12034
  }),
12042
12035
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12043
- className: "cpk:mt-4 cpk:flex cpk:justify-center",
12036
+ className: "cpk-chat-view-welcome-screen-suggestions",
12044
12037
  children: suggestionView
12045
12038
  })
12046
12039
  ]
@@ -12918,6 +12911,7 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
12918
12911
  ref: chatContainerRef,
12919
12912
  style: { display: "contents" },
12920
12913
  children: [
12914
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitStyles, {}),
12921
12915
  attachmentsEnabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
12922
12916
  type: "file",
12923
12917
  multiple: true,
@@ -12962,22 +12956,22 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
12962
12956
 
12963
12957
  //#endregion
12964
12958
  //#region src/components/chat/CopilotChatToggleButton.tsx
12959
+ const ICON_CLASS = "cpk-chat-toggle-button-icon";
12965
12960
  const DefaultOpenIcon = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MessageCircle, {
12966
- className: cn("cpk:h-6 cpk:w-6", className),
12961
+ className: className ?? ICON_CLASS,
12967
12962
  strokeWidth: 1.75,
12968
12963
  fill: "currentColor",
12969
12964
  ...props
12970
12965
  });
12971
12966
  const DefaultCloseIcon = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
12972
- className: cn("cpk:h-6 cpk:w-6", className),
12967
+ className: className ?? ICON_CLASS,
12973
12968
  strokeWidth: 1.75,
12974
12969
  ...props
12975
12970
  });
12976
12971
  DefaultOpenIcon.displayName = "CopilotChatToggleButton.OpenIcon";
12977
12972
  DefaultCloseIcon.displayName = "CopilotChatToggleButton.CloseIcon";
12978
12973
  const ICON_TRANSITION_STYLE = Object.freeze({ transition: "opacity 120ms ease-out, transform 260ms cubic-bezier(0.22, 1, 0.36, 1)" });
12979
- const ICON_WRAPPER_BASE = "cpk:pointer-events-none cpk:absolute cpk:inset-0 cpk:flex cpk:items-center cpk:justify-center cpk:will-change-transform";
12980
- const BUTTON_BASE_CLASSES = cn("copilotKitButton", "cpk:fixed cpk:bottom-6 cpk:right-6 cpk:z-[1100] cpk:flex cpk:h-14 cpk:w-14 cpk:items-center cpk:justify-center", "cpk:rounded-full cpk:border cpk:border-primary cpk:bg-primary cpk:text-primary-foreground", "cpk:shadow-sm cpk:transition-all cpk:duration-200 cpk:ease-out", "cpk:hover:scale-[1.04] cpk:hover:shadow-md", "cpk:cursor-pointer", "cpk:active:scale-[0.96]", "cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-primary/50 cpk:focus-visible:ring-offset-2 cpk:focus-visible:ring-offset-background", "cpk:disabled:pointer-events-none cpk:disabled:opacity-60");
12974
+ const ICON_WRAPPER_CLASS = "cpk-chat-toggle-button-icon-wrapper";
12981
12975
  const CopilotChatToggleButton = react.default.forwardRef(function CopilotChatToggleButton({ openIcon, closeIcon, className, ...buttonProps }, ref) {
12982
12976
  const { onClick, type, disabled, ...restProps } = buttonProps;
12983
12977
  const configuration = require_MarkdownSurfaces.useCopilotChatConfiguration();
@@ -12992,19 +12986,19 @@ const CopilotChatToggleButton = react.default.forwardRef(function CopilotChatTog
12992
12986
  setModalOpen(!isOpen);
12993
12987
  };
12994
12988
  const renderedOpenIcon = require_MarkdownSurfaces.renderSlot(openIcon, DefaultOpenIcon, {
12995
- className: "cpk:h-6 cpk:w-6",
12989
+ className: ICON_CLASS,
12996
12990
  "aria-hidden": true,
12997
12991
  focusable: false
12998
12992
  });
12999
12993
  const renderedCloseIcon = require_MarkdownSurfaces.renderSlot(closeIcon, DefaultCloseIcon, {
13000
- className: "cpk:h-6 cpk:w-6",
12994
+ className: ICON_CLASS,
13001
12995
  "aria-hidden": true,
13002
12996
  focusable: false
13003
12997
  });
13004
12998
  const openIconElement = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
13005
12999
  "aria-hidden": "true",
13006
13000
  "data-slot": "chat-toggle-button-open-icon",
13007
- className: ICON_WRAPPER_BASE,
13001
+ className: ICON_WRAPPER_CLASS,
13008
13002
  style: {
13009
13003
  ...ICON_TRANSITION_STYLE,
13010
13004
  opacity: isOpen ? 0 : 1,
@@ -13015,7 +13009,7 @@ const CopilotChatToggleButton = react.default.forwardRef(function CopilotChatTog
13015
13009
  const closeIconElement = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
13016
13010
  "aria-hidden": "true",
13017
13011
  "data-slot": "chat-toggle-button-close-icon",
13018
- className: ICON_WRAPPER_BASE,
13012
+ className: ICON_WRAPPER_CLASS,
13019
13013
  style: {
13020
13014
  ...ICON_TRANSITION_STYLE,
13021
13015
  opacity: isOpen ? 1 : 0,
@@ -13030,7 +13024,7 @@ const CopilotChatToggleButton = react.default.forwardRef(function CopilotChatTog
13030
13024
  "data-testid": "copilot-chat-toggle",
13031
13025
  "data-slot": "chat-toggle-button",
13032
13026
  "data-state": isOpen ? "open" : "closed",
13033
- className: cn(BUTTON_BASE_CLASSES, className),
13027
+ className: require_MarkdownSurfaces.cn("copilotKitButton cpk-chat-toggle-button", className),
13034
13028
  "aria-label": isOpen ? labels.chatToggleCloseLabel : labels.chatToggleOpenLabel,
13035
13029
  "aria-pressed": isOpen,
13036
13030
  disabled,
@@ -13124,21 +13118,21 @@ function CopilotModalHeader({ title, titleContent, closeButton, drawerLauncher,
13124
13118
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
13125
13119
  "data-testid": "copilot-modal-header",
13126
13120
  "data-slot": "copilot-modal-header",
13127
- className: cn("copilotKitHeader", "cpk:flex cpk:items-center cpk:justify-between cpk:border-b cpk:border-border cpk:px-4 cpk:py-4", "cpk:bg-background/95 cpk:backdrop-blur cpk:supports-[backdrop-filter]:bg-background/80", className),
13121
+ className: require_MarkdownSurfaces.cn("copilotKitHeader cpk-modal-header", className),
13128
13122
  ...rest,
13129
13123
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13130
- className: "cpk:flex cpk:w-full cpk:items-center cpk:gap-2",
13124
+ className: "cpk-modal-header-content",
13131
13125
  children: [
13132
13126
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13133
- className: "cpk:flex cpk:flex-1 cpk:justify-start",
13127
+ className: "cpk-modal-header-start",
13134
13128
  children: BoundDrawerLauncher ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { "aria-hidden": "true" })
13135
13129
  }),
13136
13130
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13137
- className: "cpk:flex cpk:flex-1 cpk:justify-center cpk:text-center",
13131
+ className: "cpk-modal-header-center",
13138
13132
  children: BoundTitle
13139
13133
  }),
13140
13134
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13141
- className: "cpk:flex cpk:flex-1 cpk:justify-end",
13135
+ className: "cpk-modal-header-end",
13142
13136
  children: BoundCloseButton
13143
13137
  })
13144
13138
  ]
@@ -13149,7 +13143,7 @@ CopilotModalHeader.displayName = "CopilotModalHeader";
13149
13143
  (function(_CopilotModalHeader) {
13150
13144
  _CopilotModalHeader.Title = ({ children, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13151
13145
  "data-testid": "copilot-header-title",
13152
- className: cn("cpk:w-full cpk:text-base cpk:font-medium cpk:leading-none cpk:tracking-tight cpk:text-foreground", className),
13146
+ className: require_MarkdownSurfaces.cn("cpk-modal-header-title", className),
13153
13147
  ...props,
13154
13148
  children
13155
13149
  });
@@ -13158,11 +13152,11 @@ CopilotModalHeader.displayName = "CopilotModalHeader";
13158
13152
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
13159
13153
  type: "button",
13160
13154
  "data-testid": "copilot-close-button",
13161
- className: cn("cpk:inline-flex cpk:size-8 cpk:items-center cpk:justify-center cpk:rounded-full cpk:text-muted-foreground cpk:transition cpk:cursor-pointer", "cpk:hover:bg-muted cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring", className),
13155
+ className: require_MarkdownSurfaces.cn("cpk-modal-header-close-button", className),
13162
13156
  "aria-label": labels.modalHeaderCloseButtonLabel,
13163
13157
  ...props,
13164
13158
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
13165
- className: "cpk:h-4 cpk:w-4",
13159
+ className: "cpk-modal-header-close-icon",
13166
13160
  "aria-hidden": "true"
13167
13161
  })
13168
13162
  });
@@ -13172,11 +13166,11 @@ CopilotModalHeader.displayName = "CopilotModalHeader";
13172
13166
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
13173
13167
  type: "button",
13174
13168
  "data-testid": "copilot-threads-drawer-launcher",
13175
- className: cn("cpk:inline-flex cpk:size-8 cpk:items-center cpk:justify-center cpk:rounded-full cpk:text-muted-foreground cpk:transition cpk:cursor-pointer", "cpk:hover:bg-muted cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring", className),
13169
+ className: require_MarkdownSurfaces.cn("cpk-modal-header-drawer-launcher", className),
13176
13170
  "aria-label": labels.modalHeaderThreadsButtonLabel,
13177
13171
  ...props,
13178
13172
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.PanelLeftOpen, {
13179
- className: "cpk:h-4 cpk:w-4",
13173
+ className: "cpk-modal-header-drawer-launcher-icon",
13180
13174
  "aria-hidden": "true"
13181
13175
  })
13182
13176
  });
@@ -13267,13 +13261,13 @@ function CopilotSidebarViewInternal({ header, toggleButton, width, position = "r
13267
13261
  position
13268
13262
  ]);
13269
13263
  const headerElement = require_MarkdownSurfaces.renderSlot(header, CopilotModalHeader, {});
13270
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [require_MarkdownSurfaces.renderSlot(toggleButton, CopilotChatToggleButton, position === "left" ? { className: "cpk:left-6 cpk:right-auto" } : {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
13264
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [require_MarkdownSurfaces.renderSlot(toggleButton, CopilotChatToggleButton, position === "left" ? { className: "cpk-sidebar-view-toggle-button-left" } : {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
13271
13265
  ref: sidebarRef,
13272
13266
  "data-copilotkit": true,
13273
13267
  "data-testid": "copilot-sidebar",
13274
13268
  "data-copilot-sidebar": true,
13275
13269
  "data-position": position,
13276
- className: cn("copilotKitSidebar copilotKitWindow", "cpk:fixed cpk:top-0 cpk:z-[1200] cpk:flex", position === "left" ? "cpk:left-0" : "cpk:right-0", "cpk:h-[100vh] cpk:h-[100dvh] cpk:max-h-screen", "cpk:w-full", position === "left" ? "cpk:border-r" : "cpk:border-l", "cpk:border-border cpk:bg-background cpk:text-foreground cpk:shadow-xl", "cpk:transition-transform cpk:duration-300 cpk:ease-out", isSidebarOpen ? "cpk:translate-x-0" : position === "left" ? "cpk:-translate-x-full cpk:pointer-events-none" : "cpk:translate-x-full cpk:pointer-events-none"),
13270
+ className: require_MarkdownSurfaces.cn("copilotKitSidebar copilotKitWindow cpk-sidebar-view", !isSidebarOpen && "cpk-sidebar-view-closed"),
13277
13271
  style: {
13278
13272
  "--sidebar-width": widthToCss(sidebarWidth),
13279
13273
  paddingTop: "env(safe-area-inset-top)",
@@ -13283,9 +13277,9 @@ function CopilotSidebarViewInternal({ header, toggleButton, width, position = "r
13283
13277
  "aria-label": configuration?.labels.sidebarLabel ?? require_MarkdownSurfaces.CopilotChatDefaultLabels.sidebarLabel,
13284
13278
  role: "complementary",
13285
13279
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13286
- className: "cpk:flex cpk:h-full cpk:w-full cpk:flex-col cpk:overflow-hidden",
13280
+ className: "cpk-sidebar-view-panel",
13287
13281
  children: [headerElement, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13288
- className: "cpk:flex-1 cpk:overflow-hidden",
13282
+ className: "cpk-sidebar-view-chat",
13289
13283
  "data-sidebar-chat": true,
13290
13284
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotChatView_default, { ...props })
13291
13285
  })]
@@ -13308,17 +13302,17 @@ CopilotSidebarView.displayName = "CopilotSidebarView";
13308
13302
  })
13309
13303
  });
13310
13304
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13311
- className: cn("cpk:h-full cpk:flex cpk:flex-col", className),
13305
+ className: require_MarkdownSurfaces.cn("cpk-sidebar-view-welcome-screen", className),
13312
13306
  ...props,
13313
13307
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13314
- className: "cpk:flex-1 cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:px-4",
13308
+ className: "cpk-sidebar-view-welcome-screen-message",
13315
13309
  children: BoundWelcomeMessage
13316
13310
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13317
- className: "cpk:px-8 cpk:pb-4",
13311
+ className: "cpk-sidebar-view-welcome-screen-footer",
13318
13312
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13319
- className: "cpk:max-w-3xl cpk:mx-auto",
13313
+ className: "cpk-sidebar-view-welcome-screen-content",
13320
13314
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13321
- className: "cpk:mb-4 cpk:flex cpk:justify-center",
13315
+ className: "cpk-sidebar-view-welcome-screen-suggestions",
13322
13316
  children: suggestionView
13323
13317
  }), input]
13324
13318
  })
@@ -13432,10 +13426,9 @@ function CopilotPopupViewInternal({ header, toggleButton, width, height, clickOu
13432
13426
  paddingLeft: "env(safe-area-inset-left)",
13433
13427
  paddingRight: "env(safe-area-inset-right)"
13434
13428
  }), [resolvedHeight, resolvedWidth]);
13435
- const popupAnimationClass = isPopupOpen && !isAnimatingOut ? "cpk:pointer-events-auto cpk:translate-y-0 cpk:opacity-100 cpk:md:scale-100" : "cpk:pointer-events-none cpk:translate-y-4 cpk:opacity-0 cpk:md:translate-y-5 cpk:md:scale-[0.95]";
13436
13429
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [toggleButtonElement, isRendered ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13437
13430
  "data-copilotkit": true,
13438
- className: cn("cpk:fixed cpk:inset-0 cpk:z-[1200] cpk:flex cpk:max-w-full cpk:flex-col cpk:items-stretch cpk:bg-transparent", "cpk:md:inset-auto cpk:md:bottom-24 cpk:md:right-6 cpk:md:items-end cpk:md:gap-4"),
13431
+ className: "cpk-popup-view",
13439
13432
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13440
13433
  ref: containerRef,
13441
13434
  tabIndex: -1,
@@ -13443,14 +13436,14 @@ function CopilotPopupViewInternal({ header, toggleButton, width, height, clickOu
13443
13436
  "aria-label": labels.modalHeaderTitle,
13444
13437
  "data-testid": "copilot-popup",
13445
13438
  "data-copilot-popup": true,
13446
- className: cn("copilotKitPopup copilotKitWindow", "cpk:relative cpk:flex cpk:h-full cpk:w-full cpk:flex-col cpk:overflow-hidden cpk:bg-background cpk:text-foreground", "cpk:origin-bottom cpk:focus:outline-none cpk:transform-gpu cpk:transition-transform cpk:transition-opacity cpk:duration-200 cpk:ease-out", "cpk:md:transition-transform cpk:md:transition-opacity", "cpk:rounded-none cpk:border cpk:border-border/0 cpk:shadow-none cpk:ring-0", "cpk:md:h-[var(--copilot-popup-height)] cpk:md:w-[var(--copilot-popup-width)]", "cpk:md:max-h-[var(--copilot-popup-max-height)] cpk:md:max-w-[var(--copilot-popup-max-width)]", "cpk:md:origin-bottom-right cpk:md:rounded-2xl cpk:md:border-border cpk:md:shadow-xl cpk:md:ring-1 cpk:md:ring-border/40", popupAnimationClass),
13439
+ className: require_MarkdownSurfaces.cn("copilotKitPopup copilotKitWindow cpk-popup-view-window", isPopupOpen && !isAnimatingOut && "cpk-popup-view-window-open"),
13447
13440
  style: popupStyle,
13448
13441
  children: [headerElement, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13449
- className: "cpk:flex-1 cpk:overflow-hidden",
13442
+ className: "cpk-popup-view-chat",
13450
13443
  "data-popup-chat": true,
13451
13444
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotChatView_default, {
13452
13445
  ...restProps,
13453
- className: cn("cpk:h-full cpk:min-h-0", className)
13446
+ className: require_MarkdownSurfaces.cn("cpk-popup-view-chat-view", className)
13454
13447
  })
13455
13448
  })]
13456
13449
  })
@@ -13472,13 +13465,13 @@ CopilotPopupView.displayName = "CopilotPopupView";
13472
13465
  })
13473
13466
  });
13474
13467
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13475
- className: cn("cpk:h-full cpk:flex cpk:flex-col", className),
13468
+ className: require_MarkdownSurfaces.cn("cpk-popup-view-welcome-screen", className),
13476
13469
  ...props,
13477
13470
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13478
- className: "cpk:flex-1 cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:px-4",
13471
+ className: "cpk-popup-view-welcome-screen-message",
13479
13472
  children: BoundWelcomeMessage
13480
13473
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13481
- className: "cpk:mb-4 cpk:flex cpk:justify-center cpk:px-4",
13474
+ className: "cpk-popup-view-welcome-screen-suggestions",
13482
13475
  children: suggestionView
13483
13476
  }), input] })]
13484
13477
  });
@@ -14145,6 +14138,7 @@ Object.defineProperty(exports, 'CopilotKitHeaderResolutionError', {
14145
14138
  });
14146
14139
  exports.CopilotKitInspector = CopilotKitInspector;
14147
14140
  exports.CopilotKitProvider = CopilotKitProvider;
14141
+ exports.CopilotKitStyles = CopilotKitStyles;
14148
14142
  Object.defineProperty(exports, 'CopilotModalHeader', {
14149
14143
  enumerable: true,
14150
14144
  get: function () {