@wealthx/shadcn 1.5.23 → 1.5.25
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/.turbo/turbo-build.log +147 -147
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-K4GJTP6N.mjs → chunk-4FJC64FV.mjs} +467 -386
- package/dist/{chunk-FGHM34AV.mjs → chunk-7JVKSZ4O.mjs} +1 -1
- package/dist/{chunk-6HTE24TP.mjs → chunk-EY5YPFKX.mjs} +1 -1
- package/dist/{chunk-3HFOSFOM.mjs → chunk-IG7DEIWU.mjs} +4 -4
- package/dist/{chunk-2VTOF7PW.mjs → chunk-K2KX3NX7.mjs} +1 -1
- package/dist/{chunk-NXZ2F4JA.mjs → chunk-KGBLORCQ.mjs} +1 -1
- package/dist/{chunk-2SDEURIQ.mjs → chunk-PX2B3Q3A.mjs} +7 -7
- package/dist/{chunk-66NM4AX2.mjs → chunk-QM7LU2BR.mjs} +10 -10
- package/dist/{chunk-4UCRTTVL.mjs → chunk-RNLIZRAK.mjs} +1 -1
- package/dist/{chunk-BWG7AX6X.mjs → chunk-SQ54W3JH.mjs} +1 -1
- package/dist/{chunk-RJHE3V4M.mjs → chunk-UMR3HVZF.mjs} +4 -4
- package/dist/{chunk-JGUC3KCA.mjs → chunk-VNB5E7SI.mjs} +5 -5
- package/dist/{chunk-ETT5JAXF.mjs → chunk-Z5QI7CW2.mjs} +1 -1
- package/dist/components/ui/about-you-form.mjs +4 -4
- package/dist/components/ui/ai-assistant-drawer.mjs +2 -2
- package/dist/components/ui/{ai-conversations.js → ai-conversations/index.js} +818 -740
- package/dist/components/ui/ai-conversations/index.mjs +42 -0
- package/dist/components/ui/appointment-action-dialogs.mjs +1 -1
- package/dist/components/ui/appointment-availability-settings.mjs +5 -5
- package/dist/components/ui/appointment-book-dialog.mjs +4 -4
- package/dist/components/ui/appointment-detail-sheet.mjs +3 -3
- package/dist/components/ui/appointment-upcoming-card.mjs +1 -1
- package/dist/components/ui/assets-liabilities-side-card.mjs +6 -6
- package/dist/components/ui/backoffice-signup-steps.mjs +4 -4
- package/dist/components/ui/bank-statement-generate-dialog.mjs +6 -6
- package/dist/components/ui/contact-alert-dialog/index.mjs +2 -2
- package/dist/components/ui/create-contact-modal.mjs +3 -3
- package/dist/components/ui/date-picker.mjs +2 -2
- package/dist/components/ui/expense-detail-item.mjs +3 -3
- package/dist/components/ui/expense-work-details.mjs +9 -9
- package/dist/components/ui/file-preview-dialog.mjs +2 -2
- package/dist/components/ui/financial-drawers.mjs +2 -2
- package/dist/components/ui/form-primitives.mjs +2 -2
- package/dist/components/ui/frontend-signup-steps.mjs +5 -5
- package/dist/components/ui/income-work-details.mjs +3 -3
- package/dist/components/ui/kanban-column.mjs +4 -4
- package/dist/components/ui/opportunity-card.mjs +1 -1
- package/dist/components/ui/opportunity-edit-modals.mjs +6 -6
- package/dist/components/ui/opportunity-summary-tab.mjs +8 -8
- package/dist/components/ui/pipeline-board.mjs +6 -6
- package/dist/components/ui/pipeline-dialogs.mjs +5 -5
- package/dist/components/ui/property-report-dialog.mjs +4 -4
- package/dist/components/ui/savings-goal-modal.mjs +4 -4
- package/dist/components/ui/share-details-dialog.mjs +2 -2
- package/dist/components/ui/signup-form-primitives.mjs +1 -1
- package/dist/index.js +4912 -4834
- package/dist/index.mjs +160 -160
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/components/index.tsx +1 -0
- package/src/components/ui/ai-conversations/helpers.tsx +31 -0
- package/src/components/ui/ai-conversations/index.tsx +468 -0
- package/src/components/ui/ai-conversations/lead-panel.tsx +517 -0
- package/src/components/ui/ai-conversations/list.tsx +335 -0
- package/src/components/ui/ai-conversations/thread.tsx +919 -0
- package/src/components/ui/ai-conversations/types.ts +83 -0
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +1 -1
- package/dist/components/ui/ai-conversations.mjs +0 -42
- package/src/components/ui/ai-conversations.tsx +0 -2213
- package/dist/{chunk-A43XIVO6.mjs → chunk-2PWTXE66.mjs} +3 -3
- package/dist/{chunk-PSBQ4I3M.mjs → chunk-53ZB2JWT.mjs} +6 -6
- package/dist/{chunk-G6RCC2SF.mjs → chunk-5ST6BK7R.mjs} +3 -3
- package/dist/{chunk-H5NI6ZIU.mjs → chunk-734FOOJC.mjs} +3 -3
- package/dist/{chunk-ONYADWSO.mjs → chunk-ABVCQWDY.mjs} +3 -3
- package/dist/{chunk-AADJ5IT6.mjs → chunk-ECC2LLZM.mjs} +3 -3
- package/dist/{chunk-DK55HZPN.mjs → chunk-KENLXFJ7.mjs} +6 -6
- package/dist/{chunk-ET4MTPIY.mjs → chunk-LDC6V6DJ.mjs} +3 -3
- package/dist/{chunk-3S4XQTAL.mjs → chunk-SO4RB3XB.mjs} +9 -9
- package/dist/{chunk-UMF6LLQK.mjs → chunk-TRM3KIHT.mjs} +3 -3
|
@@ -56,7 +56,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
56
56
|
));
|
|
57
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
58
|
|
|
59
|
-
// src/components/ui/ai-conversations.tsx
|
|
59
|
+
// src/components/ui/ai-conversations/index.tsx
|
|
60
60
|
var ai_conversations_exports = {};
|
|
61
61
|
__export(ai_conversations_exports, {
|
|
62
62
|
AICollectedDataSection: () => AICollectedDataSection,
|
|
@@ -71,15 +71,8 @@ __export(ai_conversations_exports, {
|
|
|
71
71
|
LeadInfoPanel: () => LeadInfoPanel
|
|
72
72
|
});
|
|
73
73
|
module.exports = __toCommonJS(ai_conversations_exports);
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
77
|
-
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
78
|
-
var import_extension_link = __toESM(require("@tiptap/extension-link"));
|
|
79
|
-
var import_react_markdown = __toESM(require("react-markdown"));
|
|
80
|
-
var import_rehype_raw = __toESM(require("rehype-raw"));
|
|
81
|
-
var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
|
|
82
|
-
var import_lucide_react4 = require("lucide-react");
|
|
74
|
+
var import_react5 = require("react");
|
|
75
|
+
var import_lucide_react7 = require("lucide-react");
|
|
83
76
|
|
|
84
77
|
// src/lib/utils.ts
|
|
85
78
|
var import_clsx = require("clsx");
|
|
@@ -165,8 +158,10 @@ function AvatarFallback(_a) {
|
|
|
165
158
|
);
|
|
166
159
|
}
|
|
167
160
|
|
|
168
|
-
// src/components/ui/
|
|
161
|
+
// src/components/ui/button.tsx
|
|
162
|
+
var import_react = require("react");
|
|
169
163
|
var import_class_variance_authority = require("class-variance-authority");
|
|
164
|
+
var import_lucide_react = require("lucide-react");
|
|
170
165
|
|
|
171
166
|
// src/lib/slot.tsx
|
|
172
167
|
var React = __toESM(require("react"));
|
|
@@ -215,56 +210,9 @@ var Slot = React.forwardRef(
|
|
|
215
210
|
);
|
|
216
211
|
Slot.displayName = "Slot";
|
|
217
212
|
|
|
218
|
-
// src/components/ui/badge.tsx
|
|
219
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
220
|
-
var badgeVariants = (0, import_class_variance_authority.cva)(
|
|
221
|
-
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2.5 py-0.5 text-caption whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
222
|
-
{
|
|
223
|
-
variants: {
|
|
224
|
-
variant: {
|
|
225
|
-
default: "border-primary/40 bg-primary/10 text-foreground [a&]:hover:bg-primary/15",
|
|
226
|
-
secondary: "border-border bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
|
|
227
|
-
destructive: "border-destructive/40 bg-destructive/10 text-destructive-text focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/15",
|
|
228
|
-
success: "border-success/40 bg-success/10 text-success-text [a&]:hover:bg-success/15",
|
|
229
|
-
warning: "border-warning/40 bg-warning/10 text-warning-text [a&]:hover:bg-warning/15",
|
|
230
|
-
info: "border-info/40 bg-info/10 text-info-text [a&]:hover:bg-info/15",
|
|
231
|
-
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
232
|
-
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
233
|
-
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
defaultVariants: {
|
|
237
|
-
variant: "default"
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
function Badge(_a) {
|
|
242
|
-
var _b = _a, {
|
|
243
|
-
className,
|
|
244
|
-
variant = "default",
|
|
245
|
-
asChild = false
|
|
246
|
-
} = _b, props = __objRest(_b, [
|
|
247
|
-
"className",
|
|
248
|
-
"variant",
|
|
249
|
-
"asChild"
|
|
250
|
-
]);
|
|
251
|
-
const Comp = asChild ? Slot : "span";
|
|
252
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
253
|
-
Comp,
|
|
254
|
-
__spreadValues({
|
|
255
|
-
className: cn(badgeVariants({ variant }), className),
|
|
256
|
-
"data-slot": "badge",
|
|
257
|
-
"data-variant": variant
|
|
258
|
-
}, props)
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
213
|
// src/components/ui/button.tsx
|
|
263
|
-
var
|
|
264
|
-
var
|
|
265
|
-
var import_lucide_react = require("lucide-react");
|
|
266
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
267
|
-
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
214
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
215
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
268
216
|
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-button whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
269
217
|
{
|
|
270
218
|
variants: {
|
|
@@ -317,7 +265,7 @@ var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
|
317
265
|
]);
|
|
318
266
|
const Comp = asChild ? Slot : "button";
|
|
319
267
|
const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
|
|
320
|
-
return /* @__PURE__ */ (0,
|
|
268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
321
269
|
Comp,
|
|
322
270
|
__spreadProps(__spreadValues({
|
|
323
271
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -328,127 +276,35 @@ var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
|
328
276
|
ref,
|
|
329
277
|
type
|
|
330
278
|
}, props), {
|
|
331
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
332
|
-
/* @__PURE__ */ (0,
|
|
279
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
280
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Loader2, { "aria-hidden": "true", className: "animate-spin" }),
|
|
333
281
|
!isIconOnly && children
|
|
334
282
|
] }) : children
|
|
335
283
|
})
|
|
336
284
|
);
|
|
337
285
|
});
|
|
338
286
|
|
|
339
|
-
// src/components/ui/
|
|
340
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
341
|
-
function Input(_a) {
|
|
342
|
-
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
343
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
344
|
-
"input",
|
|
345
|
-
__spreadValues({
|
|
346
|
-
className: cn(
|
|
347
|
-
"h-9 w-full min-w-0 border border-input bg-transparent px-3 py-1 text-body-medium font-sans shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-label-medium file:text-foreground placeholder:font-normal placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
|
|
348
|
-
"focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20",
|
|
349
|
-
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
350
|
-
className
|
|
351
|
-
),
|
|
352
|
-
"data-slot": "input",
|
|
353
|
-
type
|
|
354
|
-
}, props)
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// src/components/ui/dropdown-menu.tsx
|
|
287
|
+
// src/components/ui/dialog.tsx
|
|
359
288
|
var import_lucide_react2 = require("lucide-react");
|
|
360
|
-
var
|
|
289
|
+
var import_dialog = require("@base-ui/react/dialog");
|
|
361
290
|
|
|
362
291
|
// src/lib/theme-provider.tsx
|
|
363
292
|
var import_react2 = require("react");
|
|
364
|
-
var
|
|
293
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
365
294
|
var ThemeVarsContext = (0, import_react2.createContext)({});
|
|
366
295
|
function useThemeVars() {
|
|
367
296
|
return (0, import_react2.useContext)(ThemeVarsContext);
|
|
368
297
|
}
|
|
369
298
|
|
|
370
|
-
// src/components/ui/dropdown-menu.tsx
|
|
371
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
372
|
-
function DropdownMenu(_a) {
|
|
373
|
-
var props = __objRest(_a, []);
|
|
374
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_menu.Menu.Root, __spreadValues({ "data-slot": "dropdown-menu" }, props));
|
|
375
|
-
}
|
|
376
|
-
function DropdownMenuTrigger(_a) {
|
|
377
|
-
var props = __objRest(_a, []);
|
|
378
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_menu.Menu.Trigger, __spreadValues({ "data-slot": "dropdown-menu-trigger" }, props));
|
|
379
|
-
}
|
|
380
|
-
function DropdownMenuContent(_a) {
|
|
381
|
-
var _b = _a, {
|
|
382
|
-
className,
|
|
383
|
-
sideOffset = 4,
|
|
384
|
-
style
|
|
385
|
-
} = _b, props = __objRest(_b, [
|
|
386
|
-
"className",
|
|
387
|
-
"sideOffset",
|
|
388
|
-
"style"
|
|
389
|
-
]);
|
|
390
|
-
const themeVars = useThemeVars();
|
|
391
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_menu.Menu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_menu.Menu.Positioner, { sideOffset, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
392
|
-
import_menu.Menu.Popup,
|
|
393
|
-
__spreadValues({
|
|
394
|
-
className: cn(
|
|
395
|
-
"z-50 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-none border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
396
|
-
className
|
|
397
|
-
),
|
|
398
|
-
"data-slot": "dropdown-menu-content",
|
|
399
|
-
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
400
|
-
}, props)
|
|
401
|
-
) }) });
|
|
402
|
-
}
|
|
403
|
-
function DropdownMenuItem(_a) {
|
|
404
|
-
var _b = _a, {
|
|
405
|
-
className,
|
|
406
|
-
inset,
|
|
407
|
-
variant = "default"
|
|
408
|
-
} = _b, props = __objRest(_b, [
|
|
409
|
-
"className",
|
|
410
|
-
"inset",
|
|
411
|
-
"variant"
|
|
412
|
-
]);
|
|
413
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
414
|
-
import_menu.Menu.Item,
|
|
415
|
-
__spreadValues({
|
|
416
|
-
className: cn(
|
|
417
|
-
"relative flex cursor-default items-center gap-2 rounded-none px-2 py-1.5 text-body-small outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
418
|
-
className
|
|
419
|
-
),
|
|
420
|
-
"data-inset": inset,
|
|
421
|
-
"data-slot": "dropdown-menu-item",
|
|
422
|
-
"data-variant": variant
|
|
423
|
-
}, props)
|
|
424
|
-
);
|
|
425
|
-
}
|
|
426
|
-
function DropdownMenuSeparator(_a) {
|
|
427
|
-
var _b = _a, {
|
|
428
|
-
className
|
|
429
|
-
} = _b, props = __objRest(_b, [
|
|
430
|
-
"className"
|
|
431
|
-
]);
|
|
432
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
433
|
-
import_menu.Menu.Separator,
|
|
434
|
-
__spreadValues({
|
|
435
|
-
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
436
|
-
"data-slot": "dropdown-menu-separator"
|
|
437
|
-
}, props)
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
299
|
// src/components/ui/dialog.tsx
|
|
442
|
-
var
|
|
443
|
-
var import_dialog = require("@base-ui/react/dialog");
|
|
444
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
300
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
445
301
|
function Dialog(_a) {
|
|
446
302
|
var props = __objRest(_a, []);
|
|
447
|
-
return /* @__PURE__ */ (0,
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dialog.Dialog.Root, __spreadValues({ "data-slot": "dialog" }, props));
|
|
448
304
|
}
|
|
449
305
|
function DialogPortal(_a) {
|
|
450
306
|
var props = __objRest(_a, []);
|
|
451
|
-
return /* @__PURE__ */ (0,
|
|
307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dialog.Dialog.Portal, __spreadValues({ "data-slot": "dialog-portal" }, props));
|
|
452
308
|
}
|
|
453
309
|
function DialogOverlay(_a) {
|
|
454
310
|
var _b = _a, {
|
|
@@ -456,7 +312,7 @@ function DialogOverlay(_a) {
|
|
|
456
312
|
} = _b, props = __objRest(_b, [
|
|
457
313
|
"className"
|
|
458
314
|
]);
|
|
459
|
-
return /* @__PURE__ */ (0,
|
|
315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
460
316
|
import_dialog.Dialog.Backdrop,
|
|
461
317
|
__spreadValues({
|
|
462
318
|
className: cn(
|
|
@@ -502,9 +358,9 @@ function DialogContent(_a) {
|
|
|
502
358
|
const themeVars = useThemeVars();
|
|
503
359
|
const isAuto = size === "auto";
|
|
504
360
|
const sizeStyle = isAuto ? { minWidth: minWidth != null ? minWidth : DIALOG_AUTO_MIN_WIDTH } : { maxWidth: DIALOG_MAX_WIDTHS[size] };
|
|
505
|
-
return /* @__PURE__ */ (0,
|
|
506
|
-
/* @__PURE__ */ (0,
|
|
507
|
-
/* @__PURE__ */ (0,
|
|
361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(DialogPortal, { container: container != null ? container : void 0, children: [
|
|
362
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DialogOverlay, { style: themeVars }),
|
|
363
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
508
364
|
import_dialog.Dialog.Popup,
|
|
509
365
|
__spreadProps(__spreadValues({
|
|
510
366
|
className: cn(
|
|
@@ -525,14 +381,14 @@ function DialogContent(_a) {
|
|
|
525
381
|
}, props), {
|
|
526
382
|
children: [
|
|
527
383
|
children,
|
|
528
|
-
showCloseButton ? /* @__PURE__ */ (0,
|
|
384
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
529
385
|
import_dialog.Dialog.Close,
|
|
530
386
|
{
|
|
531
387
|
className: "absolute top-4 right-4 inline-flex size-7 items-center justify-center transition-colors hover:bg-foreground/5 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border focus-visible:ring-offset-0 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
532
388
|
"data-slot": "dialog-close",
|
|
533
389
|
children: [
|
|
534
|
-
/* @__PURE__ */ (0,
|
|
535
|
-
/* @__PURE__ */ (0,
|
|
390
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.XIcon, {}),
|
|
391
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Close" })
|
|
536
392
|
]
|
|
537
393
|
}
|
|
538
394
|
) : null
|
|
@@ -547,7 +403,7 @@ function DialogHeader(_a) {
|
|
|
547
403
|
} = _b, props = __objRest(_b, [
|
|
548
404
|
"className"
|
|
549
405
|
]);
|
|
550
|
-
return /* @__PURE__ */ (0,
|
|
406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
551
407
|
"div",
|
|
552
408
|
__spreadValues({
|
|
553
409
|
className: cn("flex flex-col gap-1.5", className),
|
|
@@ -565,7 +421,7 @@ function DialogFooter(_a) {
|
|
|
565
421
|
"showCloseButton",
|
|
566
422
|
"children"
|
|
567
423
|
]);
|
|
568
|
-
return /* @__PURE__ */ (0,
|
|
424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
569
425
|
"div",
|
|
570
426
|
__spreadProps(__spreadValues({
|
|
571
427
|
className: cn(
|
|
@@ -577,7 +433,7 @@ function DialogFooter(_a) {
|
|
|
577
433
|
}, props), {
|
|
578
434
|
children: [
|
|
579
435
|
children,
|
|
580
|
-
showCloseButton ? /* @__PURE__ */ (0,
|
|
436
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
581
437
|
import_dialog.Dialog.Close,
|
|
582
438
|
{
|
|
583
439
|
className: cn(buttonVariants({ variant: "outline" })),
|
|
@@ -591,7 +447,7 @@ function DialogFooter(_a) {
|
|
|
591
447
|
}
|
|
592
448
|
function DialogTitle(_a) {
|
|
593
449
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
594
|
-
return /* @__PURE__ */ (0,
|
|
450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
595
451
|
import_dialog.Dialog.Title,
|
|
596
452
|
__spreadValues({
|
|
597
453
|
className: cn("text-h5 leading-none", className),
|
|
@@ -605,7 +461,7 @@ function DialogDescription(_a) {
|
|
|
605
461
|
} = _b, props = __objRest(_b, [
|
|
606
462
|
"className"
|
|
607
463
|
]);
|
|
608
|
-
return /* @__PURE__ */ (0,
|
|
464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
609
465
|
import_dialog.Dialog.Description,
|
|
610
466
|
__spreadValues({
|
|
611
467
|
className: cn("text-body-small text-muted-foreground", className),
|
|
@@ -614,178 +470,16 @@ function DialogDescription(_a) {
|
|
|
614
470
|
);
|
|
615
471
|
}
|
|
616
472
|
|
|
617
|
-
// src/components/ui/popover.tsx
|
|
618
|
-
var import_popover = require("@base-ui/react/popover");
|
|
619
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
620
|
-
function Popover(_a) {
|
|
621
|
-
var props = __objRest(_a, []);
|
|
622
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
623
|
-
}
|
|
624
|
-
function PopoverTrigger(_a) {
|
|
625
|
-
var props = __objRest(_a, []);
|
|
626
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
627
|
-
}
|
|
628
|
-
function PopoverContent(_a) {
|
|
629
|
-
var _b = _a, {
|
|
630
|
-
className,
|
|
631
|
-
align = "center",
|
|
632
|
-
sideOffset = 4,
|
|
633
|
-
style
|
|
634
|
-
} = _b, props = __objRest(_b, [
|
|
635
|
-
"className",
|
|
636
|
-
"align",
|
|
637
|
-
"sideOffset",
|
|
638
|
-
"style"
|
|
639
|
-
]);
|
|
640
|
-
const themeVars = useThemeVars();
|
|
641
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
642
|
-
import_popover.Popover.Positioner,
|
|
643
|
-
{
|
|
644
|
-
className: "z-[200]",
|
|
645
|
-
align,
|
|
646
|
-
sideOffset,
|
|
647
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
648
|
-
import_popover.Popover.Popup,
|
|
649
|
-
__spreadValues({
|
|
650
|
-
className: cn(
|
|
651
|
-
"z-50 w-72 border border-border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
652
|
-
className
|
|
653
|
-
),
|
|
654
|
-
"data-slot": "popover-content",
|
|
655
|
-
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
656
|
-
}, props)
|
|
657
|
-
)
|
|
658
|
-
}
|
|
659
|
-
) });
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
// src/components/ui/separator.tsx
|
|
663
|
-
var import_separator = require("@base-ui/react/separator");
|
|
664
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
665
|
-
function Separator(_a) {
|
|
666
|
-
var _b = _a, {
|
|
667
|
-
className,
|
|
668
|
-
orientation = "horizontal"
|
|
669
|
-
} = _b, props = __objRest(_b, [
|
|
670
|
-
"className",
|
|
671
|
-
"orientation"
|
|
672
|
-
]);
|
|
673
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
674
|
-
import_separator.Separator,
|
|
675
|
-
__spreadValues({
|
|
676
|
-
className: cn(
|
|
677
|
-
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
678
|
-
className
|
|
679
|
-
),
|
|
680
|
-
"data-orientation": orientation,
|
|
681
|
-
"data-slot": "separator"
|
|
682
|
-
}, props)
|
|
683
|
-
);
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
// src/components/ui/tabs.tsx
|
|
687
|
-
var import_class_variance_authority3 = require("class-variance-authority");
|
|
688
|
-
var import_tabs = require("@base-ui/react/tabs");
|
|
689
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
690
|
-
function Tabs(_a) {
|
|
691
|
-
var _b = _a, {
|
|
692
|
-
className,
|
|
693
|
-
orientation = "horizontal"
|
|
694
|
-
} = _b, props = __objRest(_b, [
|
|
695
|
-
"className",
|
|
696
|
-
"orientation"
|
|
697
|
-
]);
|
|
698
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
699
|
-
import_tabs.Tabs.Root,
|
|
700
|
-
__spreadValues({
|
|
701
|
-
className: cn(
|
|
702
|
-
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
703
|
-
className
|
|
704
|
-
),
|
|
705
|
-
"data-orientation": orientation,
|
|
706
|
-
"data-slot": "tabs"
|
|
707
|
-
}, props)
|
|
708
|
-
);
|
|
709
|
-
}
|
|
710
|
-
var tabsListVariants = (0, import_class_variance_authority3.cva)(
|
|
711
|
-
"group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-none p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
|
|
712
|
-
{
|
|
713
|
-
variants: {
|
|
714
|
-
variant: {
|
|
715
|
-
default: "bg-muted",
|
|
716
|
-
line: "bg-transparent p-0"
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
|
-
defaultVariants: {
|
|
720
|
-
variant: "default"
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
);
|
|
724
|
-
function TabsList(_a) {
|
|
725
|
-
var _b = _a, {
|
|
726
|
-
className,
|
|
727
|
-
variant = "default"
|
|
728
|
-
} = _b, props = __objRest(_b, [
|
|
729
|
-
"className",
|
|
730
|
-
"variant"
|
|
731
|
-
]);
|
|
732
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
733
|
-
import_tabs.Tabs.List,
|
|
734
|
-
__spreadValues({
|
|
735
|
-
className: cn(tabsListVariants({ variant }), className),
|
|
736
|
-
"data-slot": "tabs-list",
|
|
737
|
-
"data-variant": variant
|
|
738
|
-
}, props)
|
|
739
|
-
);
|
|
740
|
-
}
|
|
741
|
-
function TabsTrigger(_a) {
|
|
742
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
743
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
744
|
-
import_tabs.Tabs.Tab,
|
|
745
|
-
__spreadValues({
|
|
746
|
-
className: cn(
|
|
747
|
-
// Base layout & typography
|
|
748
|
-
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap",
|
|
749
|
-
"rounded-none border border-transparent px-1.5 py-1 text-label-medium",
|
|
750
|
-
"text-muted-foreground transition-all",
|
|
751
|
-
// Vertical orientation
|
|
752
|
-
"group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
|
|
753
|
-
// Hover & focus
|
|
754
|
-
"hover:text-foreground",
|
|
755
|
-
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring",
|
|
756
|
-
// Disabled
|
|
757
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
758
|
-
// Active state — Default variant: primary/10 bg + subtle shadow
|
|
759
|
-
// Base UI uses data-active attribute for the active/selected tab
|
|
760
|
-
"data-active:bg-primary/10 data-active:text-foreground",
|
|
761
|
-
"group-data-[variant=default]/tabs-list:data-active:shadow-sm",
|
|
762
|
-
// Active state — Line variant: suppress bg & shadow
|
|
763
|
-
"group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
764
|
-
"group-data-[variant=line]/tabs-list:data-active:shadow-none",
|
|
765
|
-
// Indicator pseudo-element (visible only for Line variant, active state)
|
|
766
|
-
"after:absolute after:bg-primary after:opacity-0 after:transition-opacity",
|
|
767
|
-
"group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5",
|
|
768
|
-
"group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5",
|
|
769
|
-
"group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
770
|
-
// SVG icons
|
|
771
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
772
|
-
className
|
|
773
|
-
),
|
|
774
|
-
"data-slot": "tabs-trigger"
|
|
775
|
-
}, props)
|
|
776
|
-
);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
473
|
// src/components/ui/toggle-group.tsx
|
|
780
474
|
var React3 = __toESM(require("react"));
|
|
781
475
|
var import_toggle_group = require("@base-ui/react/toggle-group");
|
|
782
476
|
var import_toggle2 = require("@base-ui/react/toggle");
|
|
783
477
|
|
|
784
478
|
// src/components/ui/toggle.tsx
|
|
785
|
-
var
|
|
479
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
786
480
|
var import_toggle = require("@base-ui/react/toggle");
|
|
787
|
-
var
|
|
788
|
-
var toggleVariants = (0,
|
|
481
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
482
|
+
var toggleVariants = (0, import_class_variance_authority2.cva)(
|
|
789
483
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-pressed:bg-primary/10 data-pressed:inset-ring data-pressed:inset-ring-primary data-pressed:text-foreground data-pressed:hover:bg-primary/10 data-pressed:hover:text-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
790
484
|
{
|
|
791
485
|
variants: {
|
|
@@ -807,7 +501,7 @@ var toggleVariants = (0, import_class_variance_authority4.cva)(
|
|
|
807
501
|
);
|
|
808
502
|
|
|
809
503
|
// src/components/ui/toggle-group.tsx
|
|
810
|
-
var
|
|
504
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
811
505
|
var ToggleGroupContext = React3.createContext({
|
|
812
506
|
size: "default",
|
|
813
507
|
variant: "default",
|
|
@@ -829,7 +523,7 @@ function ToggleGroup(_a) {
|
|
|
829
523
|
"type",
|
|
830
524
|
"children"
|
|
831
525
|
]);
|
|
832
|
-
return /* @__PURE__ */ (0,
|
|
526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
833
527
|
import_toggle_group.ToggleGroup,
|
|
834
528
|
__spreadProps(__spreadValues({
|
|
835
529
|
className: cn(
|
|
@@ -844,7 +538,7 @@ function ToggleGroup(_a) {
|
|
|
844
538
|
multiple: type === "multiple",
|
|
845
539
|
style: { "--gap": spacing }
|
|
846
540
|
}, props), {
|
|
847
|
-
children: /* @__PURE__ */ (0,
|
|
541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children })
|
|
848
542
|
})
|
|
849
543
|
);
|
|
850
544
|
}
|
|
@@ -861,7 +555,7 @@ function ToggleGroupItem(_a) {
|
|
|
861
555
|
"size"
|
|
862
556
|
]);
|
|
863
557
|
const context = React3.useContext(ToggleGroupContext);
|
|
864
|
-
return /* @__PURE__ */ (0,
|
|
558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
865
559
|
import_toggle2.Toggle,
|
|
866
560
|
__spreadProps(__spreadValues({
|
|
867
561
|
className: cn(
|
|
@@ -884,33 +578,16 @@ function ToggleGroupItem(_a) {
|
|
|
884
578
|
);
|
|
885
579
|
}
|
|
886
580
|
|
|
887
|
-
// src/components/ui/textarea.tsx
|
|
888
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
889
|
-
function Textarea(_a) {
|
|
890
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
891
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
892
|
-
"textarea",
|
|
893
|
-
__spreadValues({
|
|
894
|
-
className: cn(
|
|
895
|
-
// WealthX: removed shadow-xs (flat panels), added font-sans
|
|
896
|
-
"flex field-sizing-content min-h-16 w-full border border-input bg-transparent px-3 py-2 text-body-medium font-sans transition-[color,box-shadow] outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
897
|
-
className
|
|
898
|
-
),
|
|
899
|
-
"data-slot": "textarea"
|
|
900
|
-
}, props)
|
|
901
|
-
);
|
|
902
|
-
}
|
|
903
|
-
|
|
904
581
|
// src/components/ui/tooltip.tsx
|
|
905
582
|
var import_tooltip = require("@base-ui/react/tooltip");
|
|
906
|
-
var
|
|
583
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
907
584
|
function TooltipProvider(_a) {
|
|
908
585
|
var _b = _a, {
|
|
909
586
|
delay = 0
|
|
910
587
|
} = _b, props = __objRest(_b, [
|
|
911
588
|
"delay"
|
|
912
589
|
]);
|
|
913
|
-
return /* @__PURE__ */ (0,
|
|
590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
914
591
|
import_tooltip.Tooltip.Provider,
|
|
915
592
|
__spreadValues({
|
|
916
593
|
"data-slot": "tooltip-provider",
|
|
@@ -920,11 +597,11 @@ function TooltipProvider(_a) {
|
|
|
920
597
|
}
|
|
921
598
|
function Tooltip(_a) {
|
|
922
599
|
var props = __objRest(_a, []);
|
|
923
|
-
return /* @__PURE__ */ (0,
|
|
600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
|
|
924
601
|
}
|
|
925
602
|
function TooltipTrigger(_a) {
|
|
926
603
|
var props = __objRest(_a, []);
|
|
927
|
-
return /* @__PURE__ */ (0,
|
|
604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
928
605
|
}
|
|
929
606
|
function TooltipContent(_a) {
|
|
930
607
|
var _b = _a, {
|
|
@@ -941,36 +618,201 @@ function TooltipContent(_a) {
|
|
|
941
618
|
"style"
|
|
942
619
|
]);
|
|
943
620
|
const themeVars = useThemeVars();
|
|
944
|
-
return /* @__PURE__ */ (0,
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Positioner, { sideOffset, side, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
945
622
|
import_tooltip.Tooltip.Popup,
|
|
946
623
|
__spreadProps(__spreadValues({
|
|
947
624
|
className: cn(
|
|
948
|
-
"relative z-50 w-fit animate-in overflow-visible bg-brand-secondary px-3 py-1.5 text-caption text-balance text-brand-secondary-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
|
|
625
|
+
"relative z-50 w-fit animate-in overflow-visible bg-brand-secondary px-3 py-1.5 text-caption text-balance text-brand-secondary-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
|
|
626
|
+
className
|
|
627
|
+
),
|
|
628
|
+
"data-slot": "tooltip-content",
|
|
629
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
630
|
+
}, props), {
|
|
631
|
+
children: [
|
|
632
|
+
children,
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Arrow, { className: "z-50 size-2.5 rotate-45 bg-brand-secondary data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1 data-[side=top]:-bottom-1" })
|
|
634
|
+
]
|
|
635
|
+
})
|
|
636
|
+
) }) });
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// src/components/ui/ai-conversations/list.tsx
|
|
640
|
+
var import_lucide_react3 = require("lucide-react");
|
|
641
|
+
|
|
642
|
+
// src/components/ui/badge.tsx
|
|
643
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
644
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
645
|
+
var badgeVariants = (0, import_class_variance_authority3.cva)(
|
|
646
|
+
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2.5 py-0.5 text-caption whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
647
|
+
{
|
|
648
|
+
variants: {
|
|
649
|
+
variant: {
|
|
650
|
+
default: "border-primary/40 bg-primary/10 text-foreground [a&]:hover:bg-primary/15",
|
|
651
|
+
secondary: "border-border bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
|
|
652
|
+
destructive: "border-destructive/40 bg-destructive/10 text-destructive-text focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/15",
|
|
653
|
+
success: "border-success/40 bg-success/10 text-success-text [a&]:hover:bg-success/15",
|
|
654
|
+
warning: "border-warning/40 bg-warning/10 text-warning-text [a&]:hover:bg-warning/15",
|
|
655
|
+
info: "border-info/40 bg-info/10 text-info-text [a&]:hover:bg-info/15",
|
|
656
|
+
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
657
|
+
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
658
|
+
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
defaultVariants: {
|
|
662
|
+
variant: "default"
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
function Badge(_a) {
|
|
667
|
+
var _b = _a, {
|
|
668
|
+
className,
|
|
669
|
+
variant = "default",
|
|
670
|
+
asChild = false
|
|
671
|
+
} = _b, props = __objRest(_b, [
|
|
672
|
+
"className",
|
|
673
|
+
"variant",
|
|
674
|
+
"asChild"
|
|
675
|
+
]);
|
|
676
|
+
const Comp = asChild ? Slot : "span";
|
|
677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
678
|
+
Comp,
|
|
679
|
+
__spreadValues({
|
|
680
|
+
className: cn(badgeVariants({ variant }), className),
|
|
681
|
+
"data-slot": "badge",
|
|
682
|
+
"data-variant": variant
|
|
683
|
+
}, props)
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// src/components/ui/input.tsx
|
|
688
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
689
|
+
function Input(_a) {
|
|
690
|
+
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
692
|
+
"input",
|
|
693
|
+
__spreadValues({
|
|
694
|
+
className: cn(
|
|
695
|
+
"h-9 w-full min-w-0 border border-input bg-transparent px-3 py-1 text-body-medium font-sans shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-label-medium file:text-foreground placeholder:font-normal placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
|
|
696
|
+
"focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20",
|
|
697
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
698
|
+
className
|
|
699
|
+
),
|
|
700
|
+
"data-slot": "input",
|
|
701
|
+
type
|
|
702
|
+
}, props)
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// src/components/ui/tabs.tsx
|
|
707
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
708
|
+
var import_tabs = require("@base-ui/react/tabs");
|
|
709
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
710
|
+
function Tabs(_a) {
|
|
711
|
+
var _b = _a, {
|
|
712
|
+
className,
|
|
713
|
+
orientation = "horizontal"
|
|
714
|
+
} = _b, props = __objRest(_b, [
|
|
715
|
+
"className",
|
|
716
|
+
"orientation"
|
|
717
|
+
]);
|
|
718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
719
|
+
import_tabs.Tabs.Root,
|
|
720
|
+
__spreadValues({
|
|
721
|
+
className: cn(
|
|
722
|
+
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
723
|
+
className
|
|
724
|
+
),
|
|
725
|
+
"data-orientation": orientation,
|
|
726
|
+
"data-slot": "tabs"
|
|
727
|
+
}, props)
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
var tabsListVariants = (0, import_class_variance_authority4.cva)(
|
|
731
|
+
"group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-none p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
|
|
732
|
+
{
|
|
733
|
+
variants: {
|
|
734
|
+
variant: {
|
|
735
|
+
default: "bg-muted",
|
|
736
|
+
line: "bg-transparent p-0"
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
defaultVariants: {
|
|
740
|
+
variant: "default"
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
function TabsList(_a) {
|
|
745
|
+
var _b = _a, {
|
|
746
|
+
className,
|
|
747
|
+
variant = "default"
|
|
748
|
+
} = _b, props = __objRest(_b, [
|
|
749
|
+
"className",
|
|
750
|
+
"variant"
|
|
751
|
+
]);
|
|
752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
753
|
+
import_tabs.Tabs.List,
|
|
754
|
+
__spreadValues({
|
|
755
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
756
|
+
"data-slot": "tabs-list",
|
|
757
|
+
"data-variant": variant
|
|
758
|
+
}, props)
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
function TabsTrigger(_a) {
|
|
762
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
764
|
+
import_tabs.Tabs.Tab,
|
|
765
|
+
__spreadValues({
|
|
766
|
+
className: cn(
|
|
767
|
+
// Base layout & typography
|
|
768
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap",
|
|
769
|
+
"rounded-none border border-transparent px-1.5 py-1 text-label-medium",
|
|
770
|
+
"text-muted-foreground transition-all",
|
|
771
|
+
// Vertical orientation
|
|
772
|
+
"group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
|
|
773
|
+
// Hover & focus
|
|
774
|
+
"hover:text-foreground",
|
|
775
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring",
|
|
776
|
+
// Disabled
|
|
777
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
778
|
+
// Active state — Default variant: primary/10 bg + subtle shadow
|
|
779
|
+
// Base UI uses data-active attribute for the active/selected tab
|
|
780
|
+
"data-active:bg-primary/10 data-active:text-foreground",
|
|
781
|
+
"group-data-[variant=default]/tabs-list:data-active:shadow-sm",
|
|
782
|
+
// Active state — Line variant: suppress bg & shadow
|
|
783
|
+
"group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
784
|
+
"group-data-[variant=line]/tabs-list:data-active:shadow-none",
|
|
785
|
+
// Indicator pseudo-element (visible only for Line variant, active state)
|
|
786
|
+
"after:absolute after:bg-primary after:opacity-0 after:transition-opacity",
|
|
787
|
+
"group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5",
|
|
788
|
+
"group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5",
|
|
789
|
+
"group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
790
|
+
// SVG icons
|
|
791
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
949
792
|
className
|
|
950
793
|
),
|
|
951
|
-
"data-slot": "
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
children: [
|
|
955
|
-
children,
|
|
956
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tooltip.Tooltip.Arrow, { className: "z-50 size-2.5 rotate-45 bg-brand-secondary data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1 data-[side=top]:-bottom-1" })
|
|
957
|
-
]
|
|
958
|
-
})
|
|
959
|
-
) }) });
|
|
794
|
+
"data-slot": "tabs-trigger"
|
|
795
|
+
}, props)
|
|
796
|
+
);
|
|
960
797
|
}
|
|
961
798
|
|
|
962
|
-
// src/components/ui/ai-conversations.tsx
|
|
963
|
-
var
|
|
799
|
+
// src/components/ui/ai-conversations/helpers.tsx
|
|
800
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
964
801
|
function displayContactName(name) {
|
|
965
802
|
return name.trim() || "Website User";
|
|
966
803
|
}
|
|
967
804
|
var PANEL_HEADER_HEIGHT = "h-[94px]";
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
805
|
+
function ContactAvatar({
|
|
806
|
+
name,
|
|
807
|
+
size = "md",
|
|
808
|
+
className
|
|
809
|
+
}) {
|
|
810
|
+
const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
|
|
811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// src/components/ui/ai-conversations/list.tsx
|
|
815
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
974
816
|
var STATUS_CONFIG = {
|
|
975
817
|
"ai-active": {
|
|
976
818
|
label: "AI Active",
|
|
@@ -999,22 +841,18 @@ function ConversationStatusChip({
|
|
|
999
841
|
className
|
|
1000
842
|
}) {
|
|
1001
843
|
const { label, variant, dotClass } = STATUS_CONFIG[status];
|
|
1002
|
-
return /* @__PURE__ */ (0,
|
|
1003
|
-
showDot && /* @__PURE__ */ (0,
|
|
844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Badge, { variant, className, children: [
|
|
845
|
+
showDot && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn("size-1.5 shrink-0 rounded-full", dotClass) }),
|
|
1004
846
|
label
|
|
1005
847
|
] });
|
|
1006
848
|
}
|
|
1007
|
-
function ContactAvatar({ name, size = "md", className }) {
|
|
1008
|
-
const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
|
|
1009
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
|
|
1010
|
-
}
|
|
1011
849
|
function ConversationListItem({
|
|
1012
850
|
data,
|
|
1013
851
|
isActive,
|
|
1014
852
|
onClick,
|
|
1015
853
|
onRead
|
|
1016
854
|
}) {
|
|
1017
|
-
return /* @__PURE__ */ (0,
|
|
855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1018
856
|
"button",
|
|
1019
857
|
{
|
|
1020
858
|
type: "button",
|
|
@@ -1028,25 +866,25 @@ function ConversationListItem({
|
|
|
1028
866
|
isActive ? "bg-muted" : "hover:bg-muted/40"
|
|
1029
867
|
),
|
|
1030
868
|
children: [
|
|
1031
|
-
/* @__PURE__ */ (0,
|
|
1032
|
-
/* @__PURE__ */ (0,
|
|
1033
|
-
/* @__PURE__ */ (0,
|
|
1034
|
-
/* @__PURE__ */ (0,
|
|
1035
|
-
/* @__PURE__ */ (0,
|
|
1036
|
-
data.status === "needs-attention" && /* @__PURE__ */ (0,
|
|
1037
|
-
data.channel === "email" ? /* @__PURE__ */ (0,
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
869
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ContactAvatar, { name: data.contact.name }),
|
|
870
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mb-1 flex items-center justify-between gap-2", children: [
|
|
872
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(data.contact.name) }),
|
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
874
|
+
data.status === "needs-attention" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.Flag, { className: "size-3 text-warning-text" }),
|
|
875
|
+
data.channel === "email" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.Mail, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.MessageSquare, { className: "size-3 text-muted-foreground" }),
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: data.timestamp })
|
|
1039
877
|
] })
|
|
1040
878
|
] }),
|
|
1041
|
-
/* @__PURE__ */ (0,
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1043
|
-
/* @__PURE__ */ (0,
|
|
1044
|
-
data.assignedTo && /* @__PURE__ */ (0,
|
|
879
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
|
|
880
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ConversationStatusChip, { status: data.status, showDot: true }),
|
|
882
|
+
data.assignedTo && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "truncate text-xs text-muted-foreground", children: [
|
|
1045
883
|
"\u2192 ",
|
|
1046
884
|
data.assignedTo
|
|
1047
885
|
] })
|
|
1048
886
|
] }),
|
|
1049
|
-
data.unreadCount ? /* @__PURE__ */ (0,
|
|
887
|
+
data.unreadCount ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1050
888
|
Badge,
|
|
1051
889
|
{
|
|
1052
890
|
variant: "default",
|
|
@@ -1055,8 +893,8 @@ function ConversationListItem({
|
|
|
1055
893
|
}
|
|
1056
894
|
) : null
|
|
1057
895
|
] }),
|
|
1058
|
-
/* @__PURE__ */ (0,
|
|
1059
|
-
data.lastMessageRole === "bot" ? /* @__PURE__ */ (0,
|
|
896
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "line-clamp-2 text-sm leading-relaxed text-muted-foreground", children: [
|
|
897
|
+
data.lastMessageRole === "bot" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-medium text-foreground/60", children: "AI: " }) : data.lastMessageRole === "advisor" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-medium text-foreground/60", children: "You: " }) : data.lastMessageRole === "visitor" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "font-medium text-foreground/60", children: [
|
|
1060
898
|
displayContactName(data.contact.name).split(" ")[0],
|
|
1061
899
|
":",
|
|
1062
900
|
" "
|
|
@@ -1071,45 +909,36 @@ function ConversationListItem({
|
|
|
1071
909
|
function filterConversations(conversations, query, filter, channelFilter) {
|
|
1072
910
|
const q = query.toLowerCase();
|
|
1073
911
|
return conversations.filter((c) => {
|
|
1074
|
-
var _a;
|
|
1075
|
-
const matchesFilter = filter === "all" || (filter === "
|
|
1076
|
-
const matchesChannel = channelFilter === "all" || ((
|
|
912
|
+
var _a, _b;
|
|
913
|
+
const matchesFilter = filter === "all" || (filter === "emails" ? ((_a = c.channel) != null ? _a : "chat") === "email" : c.status === filter);
|
|
914
|
+
const matchesChannel = channelFilter === "all" || ((_b = c.channel) != null ? _b : "chat") === channelFilter;
|
|
1077
915
|
const matchesSearch = !q || c.contact.name.toLowerCase().includes(q) || c.lastMessage.toLowerCase().includes(q);
|
|
1078
916
|
return matchesFilter && matchesChannel && matchesSearch;
|
|
1079
917
|
});
|
|
1080
918
|
}
|
|
1081
919
|
var FILTER_TABS = [
|
|
1082
920
|
{ id: "all", label: "All" },
|
|
1083
|
-
{ id: "
|
|
1084
|
-
{ id: "ai-active", label: "AI Active" },
|
|
921
|
+
{ id: "emails", label: "Emails" },
|
|
1085
922
|
{ id: "needs-attention", label: "Urgent" },
|
|
1086
|
-
{ id: "closed", label: "Archived" }
|
|
923
|
+
{ id: "closed", label: "Archived" },
|
|
924
|
+
{ id: "ai-active", label: "AI Active" }
|
|
1087
925
|
];
|
|
1088
926
|
function ConversationList({
|
|
1089
927
|
conversations,
|
|
1090
928
|
activeId,
|
|
1091
929
|
searchQuery = "",
|
|
1092
930
|
activeFilter = "all",
|
|
1093
|
-
channelFilter
|
|
931
|
+
channelFilter = "all",
|
|
1094
932
|
hasMore,
|
|
1095
933
|
isLoadingMore,
|
|
1096
934
|
onSearchChange,
|
|
1097
935
|
onFilterChange,
|
|
1098
|
-
onChannelFilterChange,
|
|
1099
936
|
onSelect,
|
|
1100
937
|
onRead,
|
|
1101
938
|
onLoadMore,
|
|
1102
939
|
className
|
|
1103
940
|
}) {
|
|
1104
|
-
|
|
1105
|
-
function handleChannelFilterChange(vals) {
|
|
1106
|
-
const v = vals[0];
|
|
1107
|
-
if (v) {
|
|
1108
|
-
setChannelFilter(v);
|
|
1109
|
-
onChannelFilterChange == null ? void 0 : onChannelFilterChange(v);
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1113
942
|
"div",
|
|
1114
943
|
{
|
|
1115
944
|
className: cn(
|
|
@@ -1117,50 +946,31 @@ function ConversationList({
|
|
|
1117
946
|
className
|
|
1118
947
|
),
|
|
1119
948
|
children: [
|
|
1120
|
-
/* @__PURE__ */ (0,
|
|
1121
|
-
/* @__PURE__ */ (0,
|
|
1122
|
-
/* @__PURE__ */ (0,
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
Input,
|
|
1126
|
-
{
|
|
1127
|
-
value: searchQuery,
|
|
1128
|
-
onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
|
|
1129
|
-
placeholder: "Search conversations...",
|
|
1130
|
-
className: "h-8 pl-8 text-sm"
|
|
1131
|
-
}
|
|
1132
|
-
)
|
|
1133
|
-
] }),
|
|
1134
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1135
|
-
ToggleGroup,
|
|
949
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn(PANEL_HEADER_HEIGHT, "flex shrink-0 flex-col"), children: [
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex shrink-0 items-center border-b border-border px-3 py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative flex-1", children: [
|
|
951
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.Search, { className: "absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
952
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
953
|
+
Input,
|
|
1136
954
|
{
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
value: [channelFilter],
|
|
1142
|
-
onValueChange: handleChannelFilterChange,
|
|
1143
|
-
className: "shrink-0",
|
|
1144
|
-
children: [
|
|
1145
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ToggleGroupItem, { value: "all", "aria-label": "All channels", children: "All" }),
|
|
1146
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ToggleGroupItem, { value: "chat", "aria-label": "Chat", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.MessageSquare, { className: "size-3.5" }) }),
|
|
1147
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ToggleGroupItem, { value: "email", "aria-label": "Email", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.Mail, { className: "size-3.5" }) })
|
|
1148
|
-
]
|
|
955
|
+
value: searchQuery,
|
|
956
|
+
onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
|
|
957
|
+
placeholder: "Search conversations...",
|
|
958
|
+
className: "h-8 pl-8 text-sm"
|
|
1149
959
|
}
|
|
1150
960
|
)
|
|
1151
|
-
] }),
|
|
1152
|
-
/* @__PURE__ */ (0,
|
|
961
|
+
] }) }),
|
|
962
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-1 items-center border-b border-border", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1153
963
|
Tabs,
|
|
1154
964
|
{
|
|
1155
965
|
value: activeFilter,
|
|
1156
966
|
onValueChange: (v) => v && (onFilterChange == null ? void 0 : onFilterChange(v)),
|
|
1157
967
|
className: "w-full",
|
|
1158
|
-
children: /* @__PURE__ */ (0,
|
|
968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1159
969
|
TabsList,
|
|
1160
970
|
{
|
|
1161
971
|
variant: "line",
|
|
1162
972
|
className: "w-full justify-start gap-0 h-auto",
|
|
1163
|
-
children: FILTER_TABS.map((tab) => /* @__PURE__ */ (0,
|
|
973
|
+
children: FILTER_TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1164
974
|
TabsTrigger,
|
|
1165
975
|
{
|
|
1166
976
|
value: tab.id,
|
|
@@ -1174,17 +984,17 @@ function ConversationList({
|
|
|
1174
984
|
}
|
|
1175
985
|
) })
|
|
1176
986
|
] }),
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
987
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: (() => {
|
|
1178
988
|
const filtered = filterConversations(
|
|
1179
989
|
conversations,
|
|
1180
990
|
searchQuery,
|
|
1181
991
|
activeFilter,
|
|
1182
992
|
channelFilter
|
|
1183
993
|
);
|
|
1184
|
-
return filtered.length === 0 ? /* @__PURE__ */ (0,
|
|
1185
|
-
/* @__PURE__ */ (0,
|
|
1186
|
-
/* @__PURE__ */ (0,
|
|
1187
|
-
searchQuery && /* @__PURE__ */ (0,
|
|
994
|
+
return filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col items-center justify-center gap-2 p-8 text-muted-foreground", children: [
|
|
995
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.MessageSquare, { className: "size-8 opacity-30" }),
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm", children: "No conversations" }),
|
|
997
|
+
searchQuery && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1188
998
|
Button,
|
|
1189
999
|
{
|
|
1190
1000
|
variant: "outline",
|
|
@@ -1193,7 +1003,7 @@ function ConversationList({
|
|
|
1193
1003
|
children: "Clear search"
|
|
1194
1004
|
}
|
|
1195
1005
|
),
|
|
1196
|
-
!searchQuery && activeFilter !== "all" && /* @__PURE__ */ (0,
|
|
1006
|
+
!searchQuery && activeFilter !== "all" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1197
1007
|
Button,
|
|
1198
1008
|
{
|
|
1199
1009
|
variant: "outline",
|
|
@@ -1202,8 +1012,8 @@ function ConversationList({
|
|
|
1202
1012
|
children: "Clear filter"
|
|
1203
1013
|
}
|
|
1204
1014
|
)
|
|
1205
|
-
] }) : /* @__PURE__ */ (0,
|
|
1206
|
-
filtered.map((item) => /* @__PURE__ */ (0,
|
|
1015
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1016
|
+
filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1207
1017
|
ConversationListItem,
|
|
1208
1018
|
{
|
|
1209
1019
|
data: item,
|
|
@@ -1213,7 +1023,7 @@ function ConversationList({
|
|
|
1213
1023
|
},
|
|
1214
1024
|
item.id
|
|
1215
1025
|
)),
|
|
1216
|
-
hasMore && /* @__PURE__ */ (0,
|
|
1026
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "border-t border-border p-3", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1217
1027
|
Button,
|
|
1218
1028
|
{
|
|
1219
1029
|
variant: "outline",
|
|
@@ -1230,32 +1040,206 @@ function ConversationList({
|
|
|
1230
1040
|
}
|
|
1231
1041
|
);
|
|
1232
1042
|
}
|
|
1043
|
+
|
|
1044
|
+
// src/components/ui/ai-conversations/thread.tsx
|
|
1045
|
+
var import_react3 = __toESM(require("react"));
|
|
1046
|
+
var import_react4 = require("@tiptap/react");
|
|
1047
|
+
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
1048
|
+
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
1049
|
+
var import_extension_link = __toESM(require("@tiptap/extension-link"));
|
|
1050
|
+
var import_react_markdown = __toESM(require("react-markdown"));
|
|
1051
|
+
var import_rehype_raw = __toESM(require("rehype-raw"));
|
|
1052
|
+
var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
|
|
1053
|
+
var import_lucide_react5 = require("lucide-react");
|
|
1054
|
+
|
|
1055
|
+
// src/components/ui/dropdown-menu.tsx
|
|
1056
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1057
|
+
var import_menu = require("@base-ui/react/menu");
|
|
1058
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1059
|
+
function DropdownMenu(_a) {
|
|
1060
|
+
var props = __objRest(_a, []);
|
|
1061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Root, __spreadValues({ "data-slot": "dropdown-menu" }, props));
|
|
1062
|
+
}
|
|
1063
|
+
function DropdownMenuTrigger(_a) {
|
|
1064
|
+
var props = __objRest(_a, []);
|
|
1065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Trigger, __spreadValues({ "data-slot": "dropdown-menu-trigger" }, props));
|
|
1066
|
+
}
|
|
1067
|
+
function DropdownMenuContent(_a) {
|
|
1068
|
+
var _b = _a, {
|
|
1069
|
+
className,
|
|
1070
|
+
sideOffset = 4,
|
|
1071
|
+
style
|
|
1072
|
+
} = _b, props = __objRest(_b, [
|
|
1073
|
+
"className",
|
|
1074
|
+
"sideOffset",
|
|
1075
|
+
"style"
|
|
1076
|
+
]);
|
|
1077
|
+
const themeVars = useThemeVars();
|
|
1078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Positioner, { sideOffset, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1079
|
+
import_menu.Menu.Popup,
|
|
1080
|
+
__spreadValues({
|
|
1081
|
+
className: cn(
|
|
1082
|
+
"z-50 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-none border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
1083
|
+
className
|
|
1084
|
+
),
|
|
1085
|
+
"data-slot": "dropdown-menu-content",
|
|
1086
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
1087
|
+
}, props)
|
|
1088
|
+
) }) });
|
|
1089
|
+
}
|
|
1090
|
+
function DropdownMenuItem(_a) {
|
|
1091
|
+
var _b = _a, {
|
|
1092
|
+
className,
|
|
1093
|
+
inset,
|
|
1094
|
+
variant = "default"
|
|
1095
|
+
} = _b, props = __objRest(_b, [
|
|
1096
|
+
"className",
|
|
1097
|
+
"inset",
|
|
1098
|
+
"variant"
|
|
1099
|
+
]);
|
|
1100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1101
|
+
import_menu.Menu.Item,
|
|
1102
|
+
__spreadValues({
|
|
1103
|
+
className: cn(
|
|
1104
|
+
"relative flex cursor-default items-center gap-2 rounded-none px-2 py-1.5 text-body-small outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
1105
|
+
className
|
|
1106
|
+
),
|
|
1107
|
+
"data-inset": inset,
|
|
1108
|
+
"data-slot": "dropdown-menu-item",
|
|
1109
|
+
"data-variant": variant
|
|
1110
|
+
}, props)
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
function DropdownMenuSeparator(_a) {
|
|
1114
|
+
var _b = _a, {
|
|
1115
|
+
className
|
|
1116
|
+
} = _b, props = __objRest(_b, [
|
|
1117
|
+
"className"
|
|
1118
|
+
]);
|
|
1119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1120
|
+
import_menu.Menu.Separator,
|
|
1121
|
+
__spreadValues({
|
|
1122
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
1123
|
+
"data-slot": "dropdown-menu-separator"
|
|
1124
|
+
}, props)
|
|
1125
|
+
);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
// src/components/ui/popover.tsx
|
|
1129
|
+
var import_popover = require("@base-ui/react/popover");
|
|
1130
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1131
|
+
function Popover(_a) {
|
|
1132
|
+
var props = __objRest(_a, []);
|
|
1133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
1134
|
+
}
|
|
1135
|
+
function PopoverTrigger(_a) {
|
|
1136
|
+
var props = __objRest(_a, []);
|
|
1137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
1138
|
+
}
|
|
1139
|
+
function PopoverContent(_a) {
|
|
1140
|
+
var _b = _a, {
|
|
1141
|
+
className,
|
|
1142
|
+
align = "center",
|
|
1143
|
+
sideOffset = 4,
|
|
1144
|
+
style
|
|
1145
|
+
} = _b, props = __objRest(_b, [
|
|
1146
|
+
"className",
|
|
1147
|
+
"align",
|
|
1148
|
+
"sideOffset",
|
|
1149
|
+
"style"
|
|
1150
|
+
]);
|
|
1151
|
+
const themeVars = useThemeVars();
|
|
1152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1153
|
+
import_popover.Popover.Positioner,
|
|
1154
|
+
{
|
|
1155
|
+
className: "z-[200]",
|
|
1156
|
+
align,
|
|
1157
|
+
sideOffset,
|
|
1158
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1159
|
+
import_popover.Popover.Popup,
|
|
1160
|
+
__spreadValues({
|
|
1161
|
+
className: cn(
|
|
1162
|
+
"z-50 w-72 border border-border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
1163
|
+
className
|
|
1164
|
+
),
|
|
1165
|
+
"data-slot": "popover-content",
|
|
1166
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
1167
|
+
}, props)
|
|
1168
|
+
)
|
|
1169
|
+
}
|
|
1170
|
+
) });
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
// src/components/ui/separator.tsx
|
|
1174
|
+
var import_separator = require("@base-ui/react/separator");
|
|
1175
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1176
|
+
function Separator(_a) {
|
|
1177
|
+
var _b = _a, {
|
|
1178
|
+
className,
|
|
1179
|
+
orientation = "horizontal"
|
|
1180
|
+
} = _b, props = __objRest(_b, [
|
|
1181
|
+
"className",
|
|
1182
|
+
"orientation"
|
|
1183
|
+
]);
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1185
|
+
import_separator.Separator,
|
|
1186
|
+
__spreadValues({
|
|
1187
|
+
className: cn(
|
|
1188
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
1189
|
+
className
|
|
1190
|
+
),
|
|
1191
|
+
"data-orientation": orientation,
|
|
1192
|
+
"data-slot": "separator"
|
|
1193
|
+
}, props)
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
// src/components/ui/textarea.tsx
|
|
1198
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1199
|
+
function Textarea(_a) {
|
|
1200
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1202
|
+
"textarea",
|
|
1203
|
+
__spreadValues({
|
|
1204
|
+
className: cn(
|
|
1205
|
+
// WealthX: removed shadow-xs (flat panels), added font-sans
|
|
1206
|
+
"flex field-sizing-content min-h-16 w-full border border-input bg-transparent px-3 py-2 text-body-medium font-sans transition-[color,box-shadow] outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
1207
|
+
className
|
|
1208
|
+
),
|
|
1209
|
+
"data-slot": "textarea"
|
|
1210
|
+
}, props)
|
|
1211
|
+
);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
// src/components/ui/ai-conversations/thread.tsx
|
|
1215
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1233
1216
|
function BubbleAvatar({
|
|
1234
1217
|
role,
|
|
1235
1218
|
senderName
|
|
1236
1219
|
}) {
|
|
1237
1220
|
if (role === "bot") {
|
|
1238
|
-
return /* @__PURE__ */ (0,
|
|
1221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { className: "border border-border bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "size-3.5 text-muted-foreground" }) }) });
|
|
1239
1222
|
}
|
|
1240
1223
|
if (role === "advisor") {
|
|
1241
|
-
return /* @__PURE__ */ (0,
|
|
1224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { className: "font-semibold", children: getInitials(senderName != null ? senderName : "Advisor") }) });
|
|
1242
1225
|
}
|
|
1243
|
-
return /* @__PURE__ */ (0,
|
|
1226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
|
|
1244
1227
|
}
|
|
1245
|
-
function ChatBubble({ message, className }) {
|
|
1246
|
-
const { role, content, timestamp, senderName } = message;
|
|
1228
|
+
function ChatBubble({ message, channel, className }) {
|
|
1229
|
+
const { role, content, timestamp, senderName, subject } = message;
|
|
1230
|
+
const isEmail = channel === "email";
|
|
1247
1231
|
if (role === "system") {
|
|
1248
|
-
return /* @__PURE__ */ (0,
|
|
1249
|
-
/* @__PURE__ */ (0,
|
|
1250
|
-
/* @__PURE__ */ (0,
|
|
1251
|
-
/* @__PURE__ */ (0,
|
|
1232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" }),
|
|
1234
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" })
|
|
1252
1236
|
] });
|
|
1253
1237
|
}
|
|
1254
1238
|
const isAdvisor = role === "advisor";
|
|
1255
1239
|
const isBot = role === "bot";
|
|
1256
1240
|
const isVisitor = role === "visitor";
|
|
1257
1241
|
const displayName = isBot ? "AI Assistant" : isAdvisor ? senderName != null ? senderName : "Advisor" : senderName != null ? senderName : "Lead";
|
|
1258
|
-
return /* @__PURE__ */ (0,
|
|
1242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1259
1243
|
"div",
|
|
1260
1244
|
{
|
|
1261
1245
|
className: cn(
|
|
@@ -1264,29 +1248,59 @@ function ChatBubble({ message, className }) {
|
|
|
1264
1248
|
className
|
|
1265
1249
|
),
|
|
1266
1250
|
children: [
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
1268
|
-
/* @__PURE__ */ (0,
|
|
1251
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar, { role, senderName }),
|
|
1252
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1269
1253
|
"div",
|
|
1270
1254
|
{
|
|
1271
1255
|
className: cn(
|
|
1272
|
-
"flex
|
|
1256
|
+
"flex flex-col gap-1",
|
|
1257
|
+
isEmail ? "max-w-[85%] w-full" : "max-w-[70%]",
|
|
1273
1258
|
isAdvisor && "items-end"
|
|
1274
1259
|
),
|
|
1275
1260
|
children: [
|
|
1276
|
-
/* @__PURE__ */ (0,
|
|
1277
|
-
/* @__PURE__ */ (0,
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: displayName }),
|
|
1262
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1278
1263
|
"div",
|
|
1279
1264
|
{
|
|
1280
1265
|
className: cn(
|
|
1281
|
-
"
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1266
|
+
"text-sm leading-relaxed break-words",
|
|
1267
|
+
!isEmail && "px-3 py-2 [&_p]:m-0 [&_a]:underline",
|
|
1268
|
+
isEmail && [
|
|
1269
|
+
"border border-border bg-background px-4 py-3 w-full",
|
|
1270
|
+
"[&_p]:mb-2 [&_p:last-child]:mb-0",
|
|
1271
|
+
"[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
|
|
1272
|
+
"[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
|
|
1273
|
+
"[&_li]:mb-0.5",
|
|
1274
|
+
"[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
|
|
1275
|
+
"[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
|
|
1276
|
+
"[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
|
|
1277
|
+
"[&_strong]:font-semibold [&_em]:italic",
|
|
1278
|
+
"[&_a]:underline [&_a]:text-primary",
|
|
1279
|
+
"[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground [&_blockquote]:italic",
|
|
1280
|
+
"[&_hr]:my-3 [&_hr]:border-border"
|
|
1281
|
+
],
|
|
1282
|
+
!isEmail && isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
|
|
1283
|
+
!isEmail && isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
|
|
1284
|
+
!isEmail && isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground",
|
|
1285
|
+
isEmail && isAdvisor && "bg-muted/30"
|
|
1285
1286
|
),
|
|
1286
|
-
children:
|
|
1287
|
+
children: [
|
|
1288
|
+
isEmail && subject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mb-2.5 border-b border-border pb-2", children: [
|
|
1289
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs font-medium text-muted-foreground", children: "Subject:" }),
|
|
1290
|
+
" ",
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-foreground", children: subject })
|
|
1292
|
+
] }),
|
|
1293
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1294
|
+
import_react_markdown.default,
|
|
1295
|
+
{
|
|
1296
|
+
rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize.default, import_rehype_sanitize.defaultSchema]],
|
|
1297
|
+
children: content
|
|
1298
|
+
}
|
|
1299
|
+
)
|
|
1300
|
+
]
|
|
1287
1301
|
}
|
|
1288
1302
|
),
|
|
1289
|
-
timestamp && /* @__PURE__ */ (0,
|
|
1303
|
+
timestamp && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: timestamp })
|
|
1290
1304
|
]
|
|
1291
1305
|
}
|
|
1292
1306
|
)
|
|
@@ -1300,7 +1314,7 @@ function ComposerToolbarButton({
|
|
|
1300
1314
|
pressed,
|
|
1301
1315
|
onToggle
|
|
1302
1316
|
}) {
|
|
1303
|
-
return /* @__PURE__ */ (0,
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1304
1318
|
"button",
|
|
1305
1319
|
{
|
|
1306
1320
|
type: "button",
|
|
@@ -1311,11 +1325,13 @@ function ComposerToolbarButton({
|
|
|
1311
1325
|
"flex size-7 items-center justify-center transition-colors",
|
|
1312
1326
|
pressed ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
1313
1327
|
),
|
|
1314
|
-
children: /* @__PURE__ */ (0,
|
|
1328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "size-3.5" })
|
|
1315
1329
|
}
|
|
1316
1330
|
);
|
|
1317
1331
|
}
|
|
1318
|
-
function ComposerLinkPopover({
|
|
1332
|
+
function ComposerLinkPopover({
|
|
1333
|
+
editor
|
|
1334
|
+
}) {
|
|
1319
1335
|
const [open, setOpen] = import_react3.default.useState(false);
|
|
1320
1336
|
const [url, setUrl] = import_react3.default.useState("");
|
|
1321
1337
|
const handleApply = () => {
|
|
@@ -1325,7 +1341,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
1325
1341
|
setOpen(false);
|
|
1326
1342
|
setUrl("");
|
|
1327
1343
|
};
|
|
1328
|
-
return /* @__PURE__ */ (0,
|
|
1344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1329
1345
|
Popover,
|
|
1330
1346
|
{
|
|
1331
1347
|
open,
|
|
@@ -1338,7 +1354,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
1338
1354
|
setOpen(newOpen);
|
|
1339
1355
|
},
|
|
1340
1356
|
children: [
|
|
1341
|
-
/* @__PURE__ */ (0,
|
|
1357
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1342
1358
|
PopoverTrigger,
|
|
1343
1359
|
{
|
|
1344
1360
|
"aria-label": "Insert link",
|
|
@@ -1346,11 +1362,11 @@ function ComposerLinkPopover({ editor }) {
|
|
|
1346
1362
|
"flex size-7 items-center justify-center transition-colors",
|
|
1347
1363
|
(editor == null ? void 0 : editor.isActive("link")) ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
1348
1364
|
),
|
|
1349
|
-
children: /* @__PURE__ */ (0,
|
|
1365
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Link2, { className: "size-3.5" })
|
|
1350
1366
|
}
|
|
1351
1367
|
),
|
|
1352
|
-
/* @__PURE__ */ (0,
|
|
1353
|
-
/* @__PURE__ */ (0,
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
1369
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1354
1370
|
"input",
|
|
1355
1371
|
{
|
|
1356
1372
|
type: "url",
|
|
@@ -1362,7 +1378,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
1362
1378
|
autoFocus: true
|
|
1363
1379
|
}
|
|
1364
1380
|
),
|
|
1365
|
-
/* @__PURE__ */ (0,
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
|
|
1366
1382
|
] }) })
|
|
1367
1383
|
]
|
|
1368
1384
|
}
|
|
@@ -1372,8 +1388,8 @@ function ComposerEmailFieldRow({
|
|
|
1372
1388
|
label,
|
|
1373
1389
|
children
|
|
1374
1390
|
}) {
|
|
1375
|
-
return /* @__PURE__ */ (0,
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
|
|
1377
1393
|
children
|
|
1378
1394
|
] });
|
|
1379
1395
|
}
|
|
@@ -1389,6 +1405,7 @@ function ChatComposer({
|
|
|
1389
1405
|
onSendEmail,
|
|
1390
1406
|
onTakeOver,
|
|
1391
1407
|
onLetAiHandle,
|
|
1408
|
+
emailReplySubject,
|
|
1392
1409
|
className
|
|
1393
1410
|
}) {
|
|
1394
1411
|
const [channel, setChannel] = import_react3.default.useState(
|
|
@@ -1397,7 +1414,12 @@ function ChatComposer({
|
|
|
1397
1414
|
const [emailTo, setEmailTo] = import_react3.default.useState(contactEmail);
|
|
1398
1415
|
const [emailCc, setEmailCc] = import_react3.default.useState("");
|
|
1399
1416
|
const [showCc, setShowCc] = import_react3.default.useState(false);
|
|
1400
|
-
const [emailSubject, setEmailSubject] = import_react3.default.useState(
|
|
1417
|
+
const [emailSubject, setEmailSubject] = import_react3.default.useState(
|
|
1418
|
+
emailReplySubject ? `Re: ${emailReplySubject}` : ""
|
|
1419
|
+
);
|
|
1420
|
+
const [emailMode, setEmailMode] = import_react3.default.useState(
|
|
1421
|
+
emailReplySubject ? "reply" : "new"
|
|
1422
|
+
);
|
|
1401
1423
|
const [, forceUpdate] = import_react3.default.useReducer((x) => x + 1, 0);
|
|
1402
1424
|
const editor = (0, import_react4.useEditor)({
|
|
1403
1425
|
extensions: [
|
|
@@ -1417,7 +1439,21 @@ function ChatComposer({
|
|
|
1417
1439
|
setChannel(c);
|
|
1418
1440
|
onChannelChange == null ? void 0 : onChannelChange(c);
|
|
1419
1441
|
};
|
|
1420
|
-
|
|
1442
|
+
const handleNewEmail = () => {
|
|
1443
|
+
setEmailSubject("");
|
|
1444
|
+
setEmailCc("");
|
|
1445
|
+
setShowCc(false);
|
|
1446
|
+
editor == null ? void 0 : editor.commands.clearContent();
|
|
1447
|
+
};
|
|
1448
|
+
const handleEmailModeChange = (mode2) => {
|
|
1449
|
+
setEmailMode(mode2);
|
|
1450
|
+
if (mode2 === "new") {
|
|
1451
|
+
handleNewEmail();
|
|
1452
|
+
} else {
|
|
1453
|
+
setEmailSubject(emailReplySubject ? `Re: ${emailReplySubject}` : "");
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1421
1457
|
"div",
|
|
1422
1458
|
{
|
|
1423
1459
|
className: cn(
|
|
@@ -1425,27 +1461,27 @@ function ChatComposer({
|
|
|
1425
1461
|
className
|
|
1426
1462
|
),
|
|
1427
1463
|
children: [
|
|
1428
|
-
isEmailIntegrated && /* @__PURE__ */ (0,
|
|
1464
|
+
isEmailIntegrated && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1429
1465
|
Tabs,
|
|
1430
1466
|
{
|
|
1431
1467
|
value: channel,
|
|
1432
1468
|
onValueChange: (v) => v && handleChannelChange(v),
|
|
1433
|
-
children: /* @__PURE__ */ (0,
|
|
1434
|
-
/* @__PURE__ */ (0,
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1469
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsList, { variant: "default", className: "w-full", children: [
|
|
1470
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MessageSquare, { className: "size-3.5" }),
|
|
1436
1472
|
"Chat"
|
|
1437
1473
|
] }),
|
|
1438
|
-
/* @__PURE__ */ (0,
|
|
1439
|
-
/* @__PURE__ */ (0,
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Mail, { className: "size-3.5" }),
|
|
1440
1476
|
"Email"
|
|
1441
1477
|
] })
|
|
1442
1478
|
] })
|
|
1443
1479
|
}
|
|
1444
1480
|
) }),
|
|
1445
|
-
mode === "ai" ? /* @__PURE__ */ (0,
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1447
|
-
/* @__PURE__ */ (0,
|
|
1448
|
-
/* @__PURE__ */ (0,
|
|
1481
|
+
mode === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "AI is handling this conversation." }),
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1449
1485
|
Button,
|
|
1450
1486
|
{
|
|
1451
1487
|
variant: "link",
|
|
@@ -1455,12 +1491,12 @@ function ChatComposer({
|
|
|
1455
1491
|
children: "Take Over"
|
|
1456
1492
|
}
|
|
1457
1493
|
),
|
|
1458
|
-
/* @__PURE__ */ (0,
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "to reply directly." })
|
|
1459
1495
|
] }) : (
|
|
1460
1496
|
/* Email panel stays in normal flow to anchor container height;
|
|
1461
1497
|
chat panel is an absolute overlay so both tabs share identical dimensions */
|
|
1462
|
-
/* @__PURE__ */ (0,
|
|
1463
|
-
/* @__PURE__ */ (0,
|
|
1498
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1464
1500
|
"div",
|
|
1465
1501
|
{
|
|
1466
1502
|
className: cn(
|
|
@@ -1469,8 +1505,8 @@ function ChatComposer({
|
|
|
1469
1505
|
),
|
|
1470
1506
|
"aria-hidden": channel !== "email",
|
|
1471
1507
|
children: [
|
|
1472
|
-
/* @__PURE__ */ (0,
|
|
1473
|
-
/* @__PURE__ */ (0,
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(ComposerEmailFieldRow, { label: "To", children: [
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1474
1510
|
"input",
|
|
1475
1511
|
{
|
|
1476
1512
|
type: "email",
|
|
@@ -1480,7 +1516,7 @@ function ChatComposer({
|
|
|
1480
1516
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
1481
1517
|
}
|
|
1482
1518
|
),
|
|
1483
|
-
/* @__PURE__ */ (0,
|
|
1519
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1484
1520
|
"button",
|
|
1485
1521
|
{
|
|
1486
1522
|
type: "button",
|
|
@@ -1488,12 +1524,12 @@ function ChatComposer({
|
|
|
1488
1524
|
className: "flex shrink-0 items-center gap-0.5 text-sm text-muted-foreground hover:text-foreground",
|
|
1489
1525
|
children: [
|
|
1490
1526
|
"CC",
|
|
1491
|
-
/* @__PURE__ */ (0,
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronDown, { className: "size-3.5" })
|
|
1492
1528
|
]
|
|
1493
1529
|
}
|
|
1494
1530
|
)
|
|
1495
1531
|
] }),
|
|
1496
|
-
showCc && /* @__PURE__ */ (0,
|
|
1532
|
+
showCc && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1497
1533
|
"input",
|
|
1498
1534
|
{
|
|
1499
1535
|
type: "email",
|
|
@@ -1503,7 +1539,7 @@ function ChatComposer({
|
|
|
1503
1539
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
1504
1540
|
}
|
|
1505
1541
|
) }),
|
|
1506
|
-
/* @__PURE__ */ (0,
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1507
1543
|
"input",
|
|
1508
1544
|
{
|
|
1509
1545
|
type: "text",
|
|
@@ -1513,68 +1549,96 @@ function ChatComposer({
|
|
|
1513
1549
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
1514
1550
|
}
|
|
1515
1551
|
) }),
|
|
1516
|
-
/* @__PURE__ */ (0,
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react4.EditorContent, { editor }),
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-0.5", children: [
|
|
1555
|
+
emailReplySubject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1556
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1557
|
+
ToggleGroup,
|
|
1558
|
+
{
|
|
1559
|
+
type: "single",
|
|
1560
|
+
variant: "outline",
|
|
1561
|
+
size: "sm",
|
|
1562
|
+
spacing: 0,
|
|
1563
|
+
value: [emailMode],
|
|
1564
|
+
onValueChange: (values) => {
|
|
1565
|
+
const v = values[0];
|
|
1566
|
+
if (v) handleEmailModeChange(v);
|
|
1567
|
+
},
|
|
1568
|
+
className: "mr-1.5",
|
|
1569
|
+
children: [
|
|
1570
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "reply", children: "Reply" }),
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "new", children: "New email" })
|
|
1572
|
+
]
|
|
1573
|
+
}
|
|
1574
|
+
),
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
|
|
1576
|
+
] }),
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1520
1578
|
ComposerToolbarButton,
|
|
1521
1579
|
{
|
|
1522
1580
|
label: "Bold",
|
|
1523
|
-
icon:
|
|
1581
|
+
icon: import_lucide_react5.Bold,
|
|
1524
1582
|
pressed: editor == null ? void 0 : editor.isActive("bold"),
|
|
1525
1583
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
|
|
1526
1584
|
}
|
|
1527
1585
|
),
|
|
1528
|
-
/* @__PURE__ */ (0,
|
|
1586
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1529
1587
|
ComposerToolbarButton,
|
|
1530
1588
|
{
|
|
1531
1589
|
label: "Italic",
|
|
1532
|
-
icon:
|
|
1590
|
+
icon: import_lucide_react5.Italic,
|
|
1533
1591
|
pressed: editor == null ? void 0 : editor.isActive("italic"),
|
|
1534
1592
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
|
|
1535
1593
|
}
|
|
1536
1594
|
),
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1538
1596
|
ComposerToolbarButton,
|
|
1539
1597
|
{
|
|
1540
1598
|
label: "Underline",
|
|
1541
|
-
icon:
|
|
1599
|
+
icon: import_lucide_react5.Underline,
|
|
1542
1600
|
pressed: editor == null ? void 0 : editor.isActive("underline"),
|
|
1543
1601
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
|
|
1544
1602
|
}
|
|
1545
1603
|
),
|
|
1546
|
-
/* @__PURE__ */ (0,
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1548
|
-
/* @__PURE__ */ (0,
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
|
|
1605
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerLinkPopover, { editor }),
|
|
1606
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerToolbarButton, { label: "Attach file", icon: import_lucide_react5.Paperclip })
|
|
1549
1607
|
] }),
|
|
1550
|
-
/* @__PURE__ */ (0,
|
|
1551
|
-
Button,
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1609
|
+
onLetAiHandle && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
|
|
1611
|
+
"Let AI Handle"
|
|
1612
|
+
] }),
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1614
|
+
Button,
|
|
1615
|
+
{
|
|
1616
|
+
size: "sm",
|
|
1617
|
+
onClick: () => {
|
|
1618
|
+
var _a;
|
|
1619
|
+
const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
|
|
1620
|
+
onSendEmail == null ? void 0 : onSendEmail({
|
|
1621
|
+
content: html,
|
|
1622
|
+
to: emailTo,
|
|
1623
|
+
cc: emailCc,
|
|
1624
|
+
subject: emailSubject
|
|
1625
|
+
});
|
|
1626
|
+
editor == null ? void 0 : editor.commands.clearContent();
|
|
1627
|
+
},
|
|
1628
|
+
disabled: !editor || editor.isEmpty || !emailTo.trim(),
|
|
1629
|
+
children: [
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Send, { className: "mr-1.5 size-3.5" }),
|
|
1631
|
+
"Send Email"
|
|
1632
|
+
]
|
|
1633
|
+
}
|
|
1634
|
+
)
|
|
1635
|
+
] })
|
|
1572
1636
|
] })
|
|
1573
1637
|
]
|
|
1574
1638
|
}
|
|
1575
1639
|
),
|
|
1576
|
-
channel === "chat" && /* @__PURE__ */ (0,
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1640
|
+
channel === "chat" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
|
|
1641
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1578
1642
|
Textarea,
|
|
1579
1643
|
{
|
|
1580
1644
|
value: inputValue,
|
|
@@ -1583,19 +1647,19 @@ function ChatComposer({
|
|
|
1583
1647
|
className: "min-h-0 flex-1 resize-none text-base"
|
|
1584
1648
|
}
|
|
1585
1649
|
),
|
|
1586
|
-
/* @__PURE__ */ (0,
|
|
1587
|
-
/* @__PURE__ */ (0,
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
1652
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
|
|
1589
1653
|
"Let AI Handle"
|
|
1590
1654
|
] }),
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1592
1656
|
Button,
|
|
1593
1657
|
{
|
|
1594
1658
|
size: "sm",
|
|
1595
1659
|
onClick: () => onSend == null ? void 0 : onSend(inputValue),
|
|
1596
1660
|
disabled: !inputValue.trim(),
|
|
1597
1661
|
children: [
|
|
1598
|
-
/* @__PURE__ */ (0,
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Send, { className: "mr-1.5 size-3.5" }),
|
|
1599
1663
|
"Send"
|
|
1600
1664
|
]
|
|
1601
1665
|
}
|
|
@@ -1623,6 +1687,7 @@ function ChatThread({
|
|
|
1623
1687
|
onSendEmail,
|
|
1624
1688
|
onTakeOver,
|
|
1625
1689
|
onLetAiHandle,
|
|
1690
|
+
emailReplySubject,
|
|
1626
1691
|
onReopen,
|
|
1627
1692
|
onMarkUrgent,
|
|
1628
1693
|
onUnmarkUrgent,
|
|
@@ -1675,8 +1740,8 @@ function ChatThread({
|
|
|
1675
1740
|
const el = scrollRef.current;
|
|
1676
1741
|
if (el) el.scrollTop = el.scrollHeight;
|
|
1677
1742
|
}, [isAiTyping]);
|
|
1678
|
-
return /* @__PURE__ */ (0,
|
|
1679
|
-
/* @__PURE__ */ (0,
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
1744
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1680
1745
|
"div",
|
|
1681
1746
|
{
|
|
1682
1747
|
className: cn(
|
|
@@ -1684,7 +1749,7 @@ function ChatThread({
|
|
|
1684
1749
|
"flex items-center gap-3 border-b border-border px-4"
|
|
1685
1750
|
),
|
|
1686
1751
|
children: [
|
|
1687
|
-
onBack && /* @__PURE__ */ (0,
|
|
1752
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1688
1753
|
Button,
|
|
1689
1754
|
{
|
|
1690
1755
|
variant: "ghost",
|
|
@@ -1692,28 +1757,28 @@ function ChatThread({
|
|
|
1692
1757
|
className: "size-8 shrink-0 md:hidden",
|
|
1693
1758
|
onClick: onBack,
|
|
1694
1759
|
"aria-label": "Back to conversations",
|
|
1695
|
-
children: /* @__PURE__ */ (0,
|
|
1760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ArrowLeft, { className: "size-4" })
|
|
1696
1761
|
}
|
|
1697
1762
|
),
|
|
1698
|
-
/* @__PURE__ */ (0,
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
1700
|
-
/* @__PURE__ */ (0,
|
|
1701
|
-
/* @__PURE__ */ (0,
|
|
1702
|
-
/* @__PURE__ */ (0,
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContactAvatar, { name: contact.name, size: "md" }),
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
1767
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ConversationStatusChip, { status, showDot: true })
|
|
1703
1768
|
] }),
|
|
1704
|
-
contact.email && /* @__PURE__ */ (0,
|
|
1769
|
+
contact.email && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-muted-foreground", children: contact.email })
|
|
1705
1770
|
] }),
|
|
1706
|
-
/* @__PURE__ */ (0,
|
|
1707
|
-
/* @__PURE__ */ (0,
|
|
1708
|
-
isClosed && /* @__PURE__ */ (0,
|
|
1709
|
-
!isClosed && aiIsHandling && /* @__PURE__ */ (0,
|
|
1710
|
-
!isClosed && !aiIsHandling && /* @__PURE__ */ (0,
|
|
1711
|
-
/* @__PURE__ */ (0,
|
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
1772
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "hidden items-center gap-2 md:flex", children: [
|
|
1773
|
+
isClosed && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
|
|
1774
|
+
!isClosed && aiIsHandling && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
|
|
1775
|
+
!isClosed && !aiIsHandling && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
1776
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
|
|
1712
1777
|
"Let AI Handle"
|
|
1713
1778
|
] })
|
|
1714
1779
|
] }),
|
|
1715
|
-
/* @__PURE__ */ (0,
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1780
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenu, { children: [
|
|
1781
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1717
1782
|
DropdownMenuTrigger,
|
|
1718
1783
|
{
|
|
1719
1784
|
className: cn(
|
|
@@ -1721,38 +1786,38 @@ function ChatThread({
|
|
|
1721
1786
|
"size-8"
|
|
1722
1787
|
),
|
|
1723
1788
|
"aria-label": "More actions",
|
|
1724
|
-
children: /* @__PURE__ */ (0,
|
|
1789
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MoreHorizontal, { className: "size-4" })
|
|
1725
1790
|
}
|
|
1726
1791
|
),
|
|
1727
|
-
/* @__PURE__ */ (0,
|
|
1728
|
-
onShowLeadInfo && /* @__PURE__ */ (0,
|
|
1729
|
-
/* @__PURE__ */ (0,
|
|
1792
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuContent, { children: [
|
|
1793
|
+
onShowLeadInfo && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1730
1795
|
DropdownMenuItem,
|
|
1731
1796
|
{
|
|
1732
1797
|
className: "md:hidden",
|
|
1733
1798
|
onClick: onShowLeadInfo,
|
|
1734
1799
|
children: [
|
|
1735
|
-
/* @__PURE__ */ (0,
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronRight, { className: "mr-2 size-4" }),
|
|
1736
1801
|
"Lead Info"
|
|
1737
1802
|
]
|
|
1738
1803
|
}
|
|
1739
1804
|
),
|
|
1740
|
-
/* @__PURE__ */ (0,
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, { className: "md:hidden" })
|
|
1741
1806
|
] }),
|
|
1742
|
-
status === "needs-attention" ? /* @__PURE__ */ (0,
|
|
1743
|
-
/* @__PURE__ */ (0,
|
|
1807
|
+
status === "needs-attention" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
|
|
1808
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Flag, { className: "mr-2 size-4" }),
|
|
1744
1809
|
"Unmark Urgent"
|
|
1745
|
-
] }) : /* @__PURE__ */ (0,
|
|
1746
|
-
/* @__PURE__ */ (0,
|
|
1810
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onMarkUrgent, children: [
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Flag, { className: "mr-2 size-4" }),
|
|
1747
1812
|
"Mark as Urgent"
|
|
1748
1813
|
] }),
|
|
1749
|
-
/* @__PURE__ */ (0,
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1814
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.UserCheck, { className: "mr-2 size-4" }),
|
|
1751
1816
|
"Assign to advisor"
|
|
1752
1817
|
] }),
|
|
1753
|
-
/* @__PURE__ */ (0,
|
|
1754
|
-
/* @__PURE__ */ (0,
|
|
1755
|
-
/* @__PURE__ */ (0,
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Archive, { className: "mr-2 size-4" }),
|
|
1756
1821
|
"Archive"
|
|
1757
1822
|
] })
|
|
1758
1823
|
] })
|
|
@@ -1761,7 +1826,7 @@ function ChatThread({
|
|
|
1761
1826
|
]
|
|
1762
1827
|
}
|
|
1763
1828
|
),
|
|
1764
|
-
/* @__PURE__ */ (0,
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1765
1830
|
"div",
|
|
1766
1831
|
{
|
|
1767
1832
|
ref: scrollRef,
|
|
@@ -1769,29 +1834,29 @@ function ChatThread({
|
|
|
1769
1834
|
className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4",
|
|
1770
1835
|
tabIndex: 0,
|
|
1771
1836
|
children: [
|
|
1772
|
-
isLoadingMoreMessages && /* @__PURE__ */ (0,
|
|
1773
|
-
messages.length === 0 ? /* @__PURE__ */ (0,
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
1776
|
-
] }) : messages.map((msg) => /* @__PURE__ */ (0,
|
|
1777
|
-
isAiTyping && !isClosed && /* @__PURE__ */ (0,
|
|
1778
|
-
/* @__PURE__ */ (0,
|
|
1779
|
-
/* @__PURE__ */ (0,
|
|
1780
|
-
/* @__PURE__ */ (0,
|
|
1781
|
-
/* @__PURE__ */ (0,
|
|
1782
|
-
/* @__PURE__ */ (0,
|
|
1783
|
-
/* @__PURE__ */ (0,
|
|
1784
|
-
/* @__PURE__ */ (0,
|
|
1837
|
+
isLoadingMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
|
|
1838
|
+
messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
|
|
1839
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MessageSquare, { className: "size-8 opacity-30" }),
|
|
1840
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm", children: "No messages yet" })
|
|
1841
|
+
] }) : messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatBubble, { message: msg, channel }, msg.id)),
|
|
1842
|
+
isAiTyping && !isClosed && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex gap-2.5", children: [
|
|
1843
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar, { role: "bot" }),
|
|
1844
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
1845
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
|
|
1846
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
|
|
1847
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
|
|
1849
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
|
|
1785
1850
|
] })
|
|
1786
1851
|
] })
|
|
1787
1852
|
] })
|
|
1788
1853
|
]
|
|
1789
1854
|
}
|
|
1790
1855
|
),
|
|
1791
|
-
isClosed ? /* @__PURE__ */ (0,
|
|
1792
|
-
/* @__PURE__ */ (0,
|
|
1793
|
-
/* @__PURE__ */ (0,
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1856
|
+
isClosed ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
|
|
1857
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Lock, { className: "size-3.5 shrink-0" }),
|
|
1858
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "This conversation is closed." }),
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1795
1860
|
Button,
|
|
1796
1861
|
{
|
|
1797
1862
|
variant: "outline",
|
|
@@ -1801,7 +1866,7 @@ function ChatThread({
|
|
|
1801
1866
|
children: "Reopen"
|
|
1802
1867
|
}
|
|
1803
1868
|
)
|
|
1804
|
-
] }) : /* @__PURE__ */ (0,
|
|
1869
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1805
1870
|
ChatComposer,
|
|
1806
1871
|
{
|
|
1807
1872
|
mode,
|
|
@@ -1814,34 +1879,45 @@ function ChatThread({
|
|
|
1814
1879
|
onSend,
|
|
1815
1880
|
onSendEmail,
|
|
1816
1881
|
onTakeOver,
|
|
1817
|
-
onLetAiHandle
|
|
1882
|
+
onLetAiHandle,
|
|
1883
|
+
emailReplySubject
|
|
1818
1884
|
}
|
|
1819
1885
|
)
|
|
1820
1886
|
] });
|
|
1821
1887
|
}
|
|
1888
|
+
|
|
1889
|
+
// src/components/ui/ai-conversations/lead-panel.tsx
|
|
1890
|
+
var import_lucide_react6 = require("lucide-react");
|
|
1891
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1822
1892
|
function AICollectedDataSection({
|
|
1823
1893
|
fields,
|
|
1824
1894
|
className
|
|
1825
1895
|
}) {
|
|
1826
|
-
return /* @__PURE__ */ (0,
|
|
1896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1827
1897
|
"div",
|
|
1828
1898
|
{
|
|
1829
1899
|
className: "flex items-center justify-between gap-2 border-b border-border/40 py-1.5 last:border-b-0",
|
|
1830
1900
|
children: [
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1834
|
-
field.confidence === "confirmed" ? /* @__PURE__ */ (0,
|
|
1901
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
|
|
1904
|
+
field.confidence === "confirmed" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
|
|
1835
1905
|
] })
|
|
1836
1906
|
]
|
|
1837
1907
|
},
|
|
1838
1908
|
i
|
|
1839
1909
|
)) });
|
|
1840
1910
|
}
|
|
1911
|
+
var APPOINTMENT_STATUS_LABEL = {
|
|
1912
|
+
requested: "Lead requested",
|
|
1913
|
+
confirmed: "Confirmed",
|
|
1914
|
+
pending: "Pending confirmation",
|
|
1915
|
+
cancelled: "Cancelled"
|
|
1916
|
+
};
|
|
1841
1917
|
var MEETING_ICON = {
|
|
1842
|
-
video:
|
|
1843
|
-
phone:
|
|
1844
|
-
"in-person":
|
|
1918
|
+
video: import_lucide_react6.Video,
|
|
1919
|
+
phone: import_lucide_react6.Phone,
|
|
1920
|
+
"in-person": import_lucide_react6.MapPin
|
|
1845
1921
|
};
|
|
1846
1922
|
var MEETING_LABEL = {
|
|
1847
1923
|
video: "Video Call",
|
|
@@ -1849,9 +1925,9 @@ var MEETING_LABEL = {
|
|
|
1849
1925
|
"in-person": "In Person"
|
|
1850
1926
|
};
|
|
1851
1927
|
var MEETING_DETAIL_ICON = {
|
|
1852
|
-
video:
|
|
1853
|
-
phone:
|
|
1854
|
-
"in-person":
|
|
1928
|
+
video: import_lucide_react6.Link2,
|
|
1929
|
+
phone: import_lucide_react6.PhoneCall,
|
|
1930
|
+
"in-person": import_lucide_react6.Navigation
|
|
1855
1931
|
};
|
|
1856
1932
|
function MeetingDetailRow({
|
|
1857
1933
|
meetingType,
|
|
@@ -1859,9 +1935,9 @@ function MeetingDetailRow({
|
|
|
1859
1935
|
}) {
|
|
1860
1936
|
const DetailIcon = MEETING_DETAIL_ICON[meetingType];
|
|
1861
1937
|
const isLink = detail.startsWith("http");
|
|
1862
|
-
return /* @__PURE__ */ (0,
|
|
1863
|
-
/* @__PURE__ */ (0,
|
|
1864
|
-
isLink ? /* @__PURE__ */ (0,
|
|
1938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1940
|
+
isLink ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1865
1941
|
"a",
|
|
1866
1942
|
{
|
|
1867
1943
|
href: detail,
|
|
@@ -1870,7 +1946,7 @@ function MeetingDetailRow({
|
|
|
1870
1946
|
className: "text-sm text-primary underline underline-offset-2 break-all hover:text-primary/80",
|
|
1871
1947
|
children: detail
|
|
1872
1948
|
}
|
|
1873
|
-
) : /* @__PURE__ */ (0,
|
|
1949
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground break-all", children: detail })
|
|
1874
1950
|
] });
|
|
1875
1951
|
}
|
|
1876
1952
|
function AppointmentSection({
|
|
@@ -1883,23 +1959,23 @@ function AppointmentSection({
|
|
|
1883
1959
|
}) {
|
|
1884
1960
|
const AppointmentIcon = MEETING_ICON[appointment.meetingType];
|
|
1885
1961
|
const canReschedule = !isAnonymous && !!onRescheduleAppointment;
|
|
1886
|
-
return /* @__PURE__ */ (0,
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1888
|
-
/* @__PURE__ */ (0,
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
1962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1964
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
1965
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
|
|
1890
1966
|
] }),
|
|
1891
|
-
/* @__PURE__ */ (0,
|
|
1892
|
-
/* @__PURE__ */ (0,
|
|
1893
|
-
/* @__PURE__ */ (0,
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
|
|
1894
1970
|
] }),
|
|
1895
|
-
appointment.meetingDetail && /* @__PURE__ */ (0,
|
|
1971
|
+
appointment.meetingDetail && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1896
1972
|
MeetingDetailRow,
|
|
1897
1973
|
{
|
|
1898
1974
|
meetingType: appointment.meetingType,
|
|
1899
1975
|
detail: appointment.meetingDetail
|
|
1900
1976
|
}
|
|
1901
1977
|
),
|
|
1902
|
-
/* @__PURE__ */ (0,
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1903
1979
|
"span",
|
|
1904
1980
|
{
|
|
1905
1981
|
className: cn("text-sm font-medium", {
|
|
@@ -1911,9 +1987,9 @@ function AppointmentSection({
|
|
|
1911
1987
|
children: APPOINTMENT_STATUS_LABEL[appointment.status]
|
|
1912
1988
|
}
|
|
1913
1989
|
),
|
|
1914
|
-
appointment.status === "requested" && /* @__PURE__ */ (0,
|
|
1915
|
-
/* @__PURE__ */ (0,
|
|
1916
|
-
/* @__PURE__ */ (0,
|
|
1990
|
+
appointment.status === "requested" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-2 pt-1", children: [
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1917
1993
|
Button,
|
|
1918
1994
|
{
|
|
1919
1995
|
variant: "outline",
|
|
@@ -1923,7 +1999,7 @@ function AppointmentSection({
|
|
|
1923
1999
|
children: "Decline"
|
|
1924
2000
|
}
|
|
1925
2001
|
),
|
|
1926
|
-
canReschedule && /* @__PURE__ */ (0,
|
|
2002
|
+
canReschedule && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1927
2003
|
Button,
|
|
1928
2004
|
{
|
|
1929
2005
|
variant: "ghost",
|
|
@@ -1934,7 +2010,7 @@ function AppointmentSection({
|
|
|
1934
2010
|
}
|
|
1935
2011
|
)
|
|
1936
2012
|
] }),
|
|
1937
|
-
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ (0,
|
|
2013
|
+
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1938
2014
|
Button,
|
|
1939
2015
|
{
|
|
1940
2016
|
variant: "outline",
|
|
@@ -1947,13 +2023,13 @@ function AppointmentSection({
|
|
|
1947
2023
|
] });
|
|
1948
2024
|
}
|
|
1949
2025
|
function PanelSectionHeader({ children }) {
|
|
1950
|
-
return /* @__PURE__ */ (0,
|
|
2026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
|
|
1951
2027
|
}
|
|
1952
2028
|
function PanelSection({
|
|
1953
2029
|
children,
|
|
1954
2030
|
last = false
|
|
1955
2031
|
}) {
|
|
1956
|
-
return /* @__PURE__ */ (0,
|
|
2032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
|
|
1957
2033
|
}
|
|
1958
2034
|
function LeadInfoPanel({
|
|
1959
2035
|
contact,
|
|
@@ -1979,8 +2055,8 @@ function LeadInfoPanel({
|
|
|
1979
2055
|
}) {
|
|
1980
2056
|
const isAnonymous = !contact.name.trim();
|
|
1981
2057
|
const addToContactsDisabled = isAnonymous || isKnownContact;
|
|
1982
|
-
return /* @__PURE__ */ (0,
|
|
1983
|
-
/* @__PURE__ */ (0,
|
|
2058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1984
2060
|
"div",
|
|
1985
2061
|
{
|
|
1986
2062
|
className: cn(
|
|
@@ -1988,7 +2064,7 @@ function LeadInfoPanel({
|
|
|
1988
2064
|
"flex items-center justify-between border-b border-border px-4"
|
|
1989
2065
|
),
|
|
1990
2066
|
children: [
|
|
1991
|
-
onBack && /* @__PURE__ */ (0,
|
|
2067
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1992
2068
|
Button,
|
|
1993
2069
|
{
|
|
1994
2070
|
variant: "ghost",
|
|
@@ -1996,15 +2072,15 @@ function LeadInfoPanel({
|
|
|
1996
2072
|
className: "size-8 shrink-0 md:hidden",
|
|
1997
2073
|
onClick: onBack,
|
|
1998
2074
|
"aria-label": "Back to conversation",
|
|
1999
|
-
children: /* @__PURE__ */ (0,
|
|
2075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ArrowLeft, { className: "size-4" })
|
|
2000
2076
|
}
|
|
2001
2077
|
),
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2003
|
-
onToggleCollapse && /* @__PURE__ */ (0,
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
|
|
2079
|
+
onToggleCollapse && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2005
2081
|
TooltipTrigger,
|
|
2006
2082
|
{
|
|
2007
|
-
render: /* @__PURE__ */ (0,
|
|
2083
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2008
2084
|
Button,
|
|
2009
2085
|
{
|
|
2010
2086
|
variant: "ghost",
|
|
@@ -2012,8 +2088,8 @@ function LeadInfoPanel({
|
|
|
2012
2088
|
className: "size-7",
|
|
2013
2089
|
onClick: onToggleCollapse,
|
|
2014
2090
|
"aria-label": isCollapsed ? "Expand panel" : "Collapse panel",
|
|
2015
|
-
children: /* @__PURE__ */ (0,
|
|
2016
|
-
|
|
2091
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2092
|
+
import_lucide_react6.ChevronRight,
|
|
2017
2093
|
{
|
|
2018
2094
|
className: cn(
|
|
2019
2095
|
"size-4 transition-transform duration-150",
|
|
@@ -2025,26 +2101,26 @@ function LeadInfoPanel({
|
|
|
2025
2101
|
)
|
|
2026
2102
|
}
|
|
2027
2103
|
),
|
|
2028
|
-
/* @__PURE__ */ (0,
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
|
|
2029
2105
|
] })
|
|
2030
2106
|
]
|
|
2031
2107
|
}
|
|
2032
2108
|
),
|
|
2033
|
-
!isCollapsed && /* @__PURE__ */ (0,
|
|
2034
|
-
/* @__PURE__ */ (0,
|
|
2035
|
-
/* @__PURE__ */ (0,
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2038
|
-
/* @__PURE__ */ (0,
|
|
2039
|
-
/* @__PURE__ */ (0,
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2041
|
-
topic && /* @__PURE__ */ (0,
|
|
2109
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "Contact" }),
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContactAvatar, { name: contact.name, size: "lg" }),
|
|
2114
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: source }),
|
|
2117
|
+
topic && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
|
|
2042
2118
|
] })
|
|
2043
2119
|
] }),
|
|
2044
|
-
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */ (0,
|
|
2045
|
-
contact.email && /* @__PURE__ */ (0,
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2047
|
-
/* @__PURE__ */ (0,
|
|
2120
|
+
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-3 flex flex-col gap-1.5", children: [
|
|
2121
|
+
contact.email && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Mail, { className: "size-4 shrink-0" }),
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2048
2124
|
"a",
|
|
2049
2125
|
{
|
|
2050
2126
|
href: `mailto:${contact.email}`,
|
|
@@ -2053,9 +2129,9 @@ function LeadInfoPanel({
|
|
|
2053
2129
|
}
|
|
2054
2130
|
)
|
|
2055
2131
|
] }),
|
|
2056
|
-
contact.phone && /* @__PURE__ */ (0,
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2058
|
-
/* @__PURE__ */ (0,
|
|
2132
|
+
contact.phone && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.PhoneCall, { className: "size-4 shrink-0" }),
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2059
2135
|
"a",
|
|
2060
2136
|
{
|
|
2061
2137
|
href: `tel:${contact.phone}`,
|
|
@@ -2064,31 +2140,31 @@ function LeadInfoPanel({
|
|
|
2064
2140
|
}
|
|
2065
2141
|
)
|
|
2066
2142
|
] }),
|
|
2067
|
-
firstSeen && /* @__PURE__ */ (0,
|
|
2143
|
+
firstSeen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
|
|
2068
2144
|
"First seen: ",
|
|
2069
2145
|
firstSeen
|
|
2070
2146
|
] })
|
|
2071
2147
|
] })
|
|
2072
2148
|
] }),
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2075
|
-
aiFields.length > 0 ? /* @__PURE__ */ (0,
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2077
|
-
/* @__PURE__ */ (0,
|
|
2078
|
-
/* @__PURE__ */ (0,
|
|
2079
|
-
/* @__PURE__ */ (0,
|
|
2149
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "AI-Collected Data" }),
|
|
2151
|
+
aiFields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AICollectedDataSection, { fields: aiFields }),
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3 text-success-text" }),
|
|
2080
2156
|
"confirmed"
|
|
2081
2157
|
] }),
|
|
2082
|
-
/* @__PURE__ */ (0,
|
|
2083
|
-
/* @__PURE__ */ (0,
|
|
2158
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.HelpCircle, { className: "size-3 text-warning-text" }),
|
|
2084
2160
|
"estimated"
|
|
2085
2161
|
] })
|
|
2086
2162
|
] })
|
|
2087
|
-
] }) : /* @__PURE__ */ (0,
|
|
2163
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
|
|
2088
2164
|
] }),
|
|
2089
|
-
/* @__PURE__ */ (0,
|
|
2090
|
-
/* @__PURE__ */ (0,
|
|
2091
|
-
appointment ? /* @__PURE__ */ (0,
|
|
2165
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "Appointment" }),
|
|
2167
|
+
appointment ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2092
2168
|
AppointmentSection,
|
|
2093
2169
|
{
|
|
2094
2170
|
appointment,
|
|
@@ -2098,7 +2174,7 @@ function LeadInfoPanel({
|
|
|
2098
2174
|
onDeclineAppointment,
|
|
2099
2175
|
onRescheduleAppointment
|
|
2100
2176
|
}
|
|
2101
|
-
) : /* @__PURE__ */ (0,
|
|
2177
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2102
2178
|
Button,
|
|
2103
2179
|
{
|
|
2104
2180
|
variant: "outline",
|
|
@@ -2107,20 +2183,20 @@ function LeadInfoPanel({
|
|
|
2107
2183
|
disabled: isAnonymous,
|
|
2108
2184
|
onClick: onBookAppointment,
|
|
2109
2185
|
children: [
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
2186
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Plus, { className: "mr-1.5 size-3.5" }),
|
|
2111
2187
|
"Book Appointment"
|
|
2112
2188
|
]
|
|
2113
2189
|
}
|
|
2114
2190
|
)
|
|
2115
2191
|
] }),
|
|
2116
|
-
/* @__PURE__ */ (0,
|
|
2117
|
-
/* @__PURE__ */ (0,
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2119
|
-
/* @__PURE__ */ (0,
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2192
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "CRM Actions" }),
|
|
2194
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2121
2197
|
TooltipTrigger,
|
|
2122
2198
|
{
|
|
2123
|
-
render: /* @__PURE__ */ (0,
|
|
2199
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2124
2200
|
Button,
|
|
2125
2201
|
{
|
|
2126
2202
|
variant: "outline",
|
|
@@ -2129,16 +2205,16 @@ function LeadInfoPanel({
|
|
|
2129
2205
|
disabled: addToContactsDisabled,
|
|
2130
2206
|
onClick: onAddToContacts,
|
|
2131
2207
|
children: [
|
|
2132
|
-
/* @__PURE__ */ (0,
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.UserPlus, { className: "mr-1.5 size-3.5" }),
|
|
2133
2209
|
"Add to Contacts"
|
|
2134
2210
|
]
|
|
2135
2211
|
}
|
|
2136
2212
|
)
|
|
2137
2213
|
}
|
|
2138
2214
|
),
|
|
2139
|
-
isKnownContact && /* @__PURE__ */ (0,
|
|
2215
|
+
isKnownContact && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: "Already in contacts" })
|
|
2140
2216
|
] }),
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2217
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2142
2218
|
Button,
|
|
2143
2219
|
{
|
|
2144
2220
|
variant: "outline",
|
|
@@ -2147,23 +2223,23 @@ function LeadInfoPanel({
|
|
|
2147
2223
|
disabled: isAnonymous,
|
|
2148
2224
|
onClick: onCreateOpportunity,
|
|
2149
2225
|
children: [
|
|
2150
|
-
/* @__PURE__ */ (0,
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Briefcase, { className: "mr-1.5 size-3.5" }),
|
|
2151
2227
|
"Add to CRM"
|
|
2152
2228
|
]
|
|
2153
2229
|
}
|
|
2154
2230
|
)
|
|
2155
2231
|
] })
|
|
2156
2232
|
] }),
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2158
|
-
/* @__PURE__ */ (0,
|
|
2159
|
-
/* @__PURE__ */ (0,
|
|
2160
|
-
notesSaveStatus === "saving" && /* @__PURE__ */ (0,
|
|
2161
|
-
notesSaveStatus === "saved" && /* @__PURE__ */ (0,
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { last: true, children: [
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mb-2.5 flex items-center justify-between", children: [
|
|
2235
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
|
|
2236
|
+
notesSaveStatus === "saving" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
|
|
2237
|
+
notesSaveStatus === "saved" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3" }),
|
|
2163
2239
|
"Saved"
|
|
2164
2240
|
] })
|
|
2165
2241
|
] }),
|
|
2166
|
-
/* @__PURE__ */ (0,
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2167
2243
|
Textarea,
|
|
2168
2244
|
{
|
|
2169
2245
|
value: internalNotes,
|
|
@@ -2177,6 +2253,9 @@ function LeadInfoPanel({
|
|
|
2177
2253
|
] })
|
|
2178
2254
|
] });
|
|
2179
2255
|
}
|
|
2256
|
+
|
|
2257
|
+
// src/components/ui/ai-conversations/index.tsx
|
|
2258
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2180
2259
|
function ConversationsPage({
|
|
2181
2260
|
conversations,
|
|
2182
2261
|
activeConversationId,
|
|
@@ -2215,6 +2294,7 @@ function ConversationsPage({
|
|
|
2215
2294
|
onSendEmail,
|
|
2216
2295
|
onTakeOver,
|
|
2217
2296
|
onLetAiHandle,
|
|
2297
|
+
emailReplySubject,
|
|
2218
2298
|
onReopen,
|
|
2219
2299
|
onMarkUrgent,
|
|
2220
2300
|
onUnmarkUrgent,
|
|
@@ -2232,7 +2312,7 @@ function ConversationsPage({
|
|
|
2232
2312
|
onLoadMore,
|
|
2233
2313
|
className
|
|
2234
2314
|
}) {
|
|
2235
|
-
const [mobilePanel, setMobilePanel] = (0,
|
|
2315
|
+
const [mobilePanel, setMobilePanel] = (0, import_react5.useState)(
|
|
2236
2316
|
"list"
|
|
2237
2317
|
);
|
|
2238
2318
|
const handleSelectConversation = (id) => {
|
|
@@ -2243,12 +2323,12 @@ function ConversationsPage({
|
|
|
2243
2323
|
onToggleLeadPanel == null ? void 0 : onToggleLeadPanel();
|
|
2244
2324
|
setMobilePanel(showLeadPanel ? "chat" : "lead");
|
|
2245
2325
|
};
|
|
2246
|
-
return /* @__PURE__ */ (0,
|
|
2326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2247
2327
|
"div",
|
|
2248
2328
|
{
|
|
2249
2329
|
className: cn("flex h-full overflow-hidden bg-background", className),
|
|
2250
2330
|
children: [
|
|
2251
|
-
/* @__PURE__ */ (0,
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2252
2332
|
ConversationList,
|
|
2253
2333
|
{
|
|
2254
2334
|
conversations,
|
|
@@ -2266,12 +2346,11 @@ function ConversationsPage({
|
|
|
2266
2346
|
onLoadMore,
|
|
2267
2347
|
className: cn(
|
|
2268
2348
|
"shrink-0 md:w-[320px]",
|
|
2269
|
-
// Mobile: full width, visible only on list panel
|
|
2270
2349
|
mobilePanel === "list" ? "flex w-full md:flex" : "hidden md:flex"
|
|
2271
2350
|
)
|
|
2272
2351
|
}
|
|
2273
2352
|
),
|
|
2274
|
-
contact ? /* @__PURE__ */ (0,
|
|
2353
|
+
contact ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2275
2354
|
ChatThread,
|
|
2276
2355
|
{
|
|
2277
2356
|
contact,
|
|
@@ -2288,6 +2367,7 @@ function ConversationsPage({
|
|
|
2288
2367
|
onSendEmail,
|
|
2289
2368
|
onTakeOver,
|
|
2290
2369
|
onLetAiHandle,
|
|
2370
|
+
emailReplySubject,
|
|
2291
2371
|
onReopen,
|
|
2292
2372
|
onMarkUrgent,
|
|
2293
2373
|
onUnmarkUrgent,
|
|
@@ -2304,31 +2384,29 @@ function ConversationsPage({
|
|
|
2304
2384
|
)
|
|
2305
2385
|
},
|
|
2306
2386
|
contact.id
|
|
2307
|
-
) : /* @__PURE__ */ (0,
|
|
2387
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2308
2388
|
"div",
|
|
2309
2389
|
{
|
|
2310
2390
|
className: cn(
|
|
2311
2391
|
"min-w-0 flex-1 items-center justify-center border-r border-border bg-muted/10",
|
|
2312
2392
|
mobilePanel === "chat" ? "flex md:flex" : "hidden md:flex"
|
|
2313
2393
|
),
|
|
2314
|
-
children: /* @__PURE__ */ (0,
|
|
2315
|
-
/* @__PURE__ */ (0,
|
|
2316
|
-
/* @__PURE__ */ (0,
|
|
2394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
|
|
2395
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.MessageSquare, { className: "size-10 opacity-30" }),
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm", children: "Select a conversation" })
|
|
2317
2397
|
] })
|
|
2318
2398
|
}
|
|
2319
2399
|
),
|
|
2320
|
-
contact && /* @__PURE__ */ (0,
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2400
|
+
contact && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2401
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2322
2402
|
"div",
|
|
2323
2403
|
{
|
|
2324
2404
|
className: cn(
|
|
2325
|
-
// Mobile: full-width, instant show/hide based on mobilePanel
|
|
2326
2405
|
mobilePanel === "lead" ? "flex w-full shrink-0 flex-col" : "hidden",
|
|
2327
|
-
// Desktop: always rendered, animate width open/close
|
|
2328
2406
|
"md:block md:shrink-0 md:overflow-hidden md:transition-[width] md:duration-200 md:ease-in-out",
|
|
2329
2407
|
showLeadPanel ? "md:w-[320px]" : "md:w-0"
|
|
2330
2408
|
),
|
|
2331
|
-
children: /* @__PURE__ */ (0,
|
|
2409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2332
2410
|
LeadInfoPanel,
|
|
2333
2411
|
{
|
|
2334
2412
|
contact,
|
|
@@ -2354,11 +2432,11 @@ function ConversationsPage({
|
|
|
2354
2432
|
)
|
|
2355
2433
|
}
|
|
2356
2434
|
),
|
|
2357
|
-
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ (0,
|
|
2358
|
-
/* @__PURE__ */ (0,
|
|
2435
|
+
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Tooltip, { children: [
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2359
2437
|
TooltipTrigger,
|
|
2360
2438
|
{
|
|
2361
|
-
render: /* @__PURE__ */ (0,
|
|
2439
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2362
2440
|
Button,
|
|
2363
2441
|
{
|
|
2364
2442
|
variant: "ghost",
|
|
@@ -2366,12 +2444,12 @@ function ConversationsPage({
|
|
|
2366
2444
|
className: "size-8",
|
|
2367
2445
|
"aria-label": "Show lead info",
|
|
2368
2446
|
onClick: handleToggleLeadPanel,
|
|
2369
|
-
children: /* @__PURE__ */ (0,
|
|
2447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.ChevronLeft, { className: "size-4" })
|
|
2370
2448
|
}
|
|
2371
2449
|
)
|
|
2372
2450
|
}
|
|
2373
2451
|
),
|
|
2374
|
-
/* @__PURE__ */ (0,
|
|
2452
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipContent, { children: "Show lead info" })
|
|
2375
2453
|
] }) })
|
|
2376
2454
|
] })
|
|
2377
2455
|
]
|
|
@@ -2386,8 +2464,8 @@ function AiConvAssignAdvisorDialog({
|
|
|
2386
2464
|
onValueChange,
|
|
2387
2465
|
onConfirm
|
|
2388
2466
|
}) {
|
|
2389
|
-
const [search, setSearch] = (0,
|
|
2390
|
-
const [roleFilter, setRoleFilter] = (0,
|
|
2467
|
+
const [search, setSearch] = (0, import_react5.useState)("");
|
|
2468
|
+
const [roleFilter, setRoleFilter] = (0, import_react5.useState)("");
|
|
2391
2469
|
const roles = Array.from(
|
|
2392
2470
|
new Set(advisors.map((a) => a.role).filter(Boolean))
|
|
2393
2471
|
);
|
|
@@ -2401,13 +2479,13 @@ function AiConvAssignAdvisorDialog({
|
|
|
2401
2479
|
setRoleFilter("");
|
|
2402
2480
|
}
|
|
2403
2481
|
};
|
|
2404
|
-
return /* @__PURE__ */ (0,
|
|
2405
|
-
/* @__PURE__ */ (0,
|
|
2406
|
-
/* @__PURE__ */ (0,
|
|
2407
|
-
/* @__PURE__ */ (0,
|
|
2482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogContent, { children: [
|
|
2483
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogHeader, { children: [
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogTitle, { children: "Assign to advisor" }),
|
|
2485
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogDescription, { children: "Choose an advisor to handle this conversation." })
|
|
2408
2486
|
] }),
|
|
2409
|
-
/* @__PURE__ */ (0,
|
|
2410
|
-
roles.length > 0 && /* @__PURE__ */ (0,
|
|
2487
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-0", children: [
|
|
2488
|
+
roles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2411
2489
|
ToggleGroup,
|
|
2412
2490
|
{
|
|
2413
2491
|
type: "single",
|
|
@@ -2420,14 +2498,14 @@ function AiConvAssignAdvisorDialog({
|
|
|
2420
2498
|
setRoleFilter(!v || v === "__all__" ? "" : v);
|
|
2421
2499
|
},
|
|
2422
2500
|
children: [
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2424
|
-
roles.map((role) => /* @__PURE__ */ (0,
|
|
2501
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToggleGroupItem, { value: "__all__", children: "All" }),
|
|
2502
|
+
roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToggleGroupItem, { value: role, children: role }, role))
|
|
2425
2503
|
]
|
|
2426
2504
|
}
|
|
2427
2505
|
) }),
|
|
2428
|
-
/* @__PURE__ */ (0,
|
|
2429
|
-
/* @__PURE__ */ (0,
|
|
2430
|
-
/* @__PURE__ */ (0,
|
|
2506
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 border border-input px-3", children: [
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Search, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2431
2509
|
"input",
|
|
2432
2510
|
{
|
|
2433
2511
|
type: "text",
|
|
@@ -2438,7 +2516,7 @@ function AiConvAssignAdvisorDialog({
|
|
|
2438
2516
|
}
|
|
2439
2517
|
)
|
|
2440
2518
|
] }),
|
|
2441
|
-
/* @__PURE__ */ (0,
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2442
2520
|
"button",
|
|
2443
2521
|
{
|
|
2444
2522
|
type: "button",
|
|
@@ -2448,19 +2526,19 @@ function AiConvAssignAdvisorDialog({
|
|
|
2448
2526
|
value === advisor.id && "bg-muted font-medium"
|
|
2449
2527
|
),
|
|
2450
2528
|
children: [
|
|
2451
|
-
/* @__PURE__ */ (0,
|
|
2452
|
-
/* @__PURE__ */ (0,
|
|
2453
|
-
/* @__PURE__ */ (0,
|
|
2454
|
-
advisor.role && /* @__PURE__ */ (0,
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-sm", children: advisor.name }),
|
|
2532
|
+
advisor.role && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
|
|
2455
2533
|
] })
|
|
2456
2534
|
]
|
|
2457
2535
|
},
|
|
2458
2536
|
advisor.id
|
|
2459
2537
|
)) })
|
|
2460
2538
|
] }),
|
|
2461
|
-
/* @__PURE__ */ (0,
|
|
2462
|
-
/* @__PURE__ */ (0,
|
|
2463
|
-
/* @__PURE__ */ (0,
|
|
2539
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogFooter, { children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { onClick: onConfirm, children: "Assign" })
|
|
2464
2542
|
] })
|
|
2465
2543
|
] }) });
|
|
2466
2544
|
}
|