@arbidocs/react 0.4.147 → 0.4.150
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts/index.cjs +17 -7
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.d.cts +7 -1
- package/dist/artifacts/index.d.ts +7 -1
- package/dist/artifacts/index.js +11 -2
- package/dist/artifacts/index.js.map +1 -1
- package/dist/{chunk-MFMJHBJR.js → chunk-3XYIQZTH.js} +52 -3
- package/dist/chunk-3XYIQZTH.js.map +1 -0
- package/dist/{chunk-YIFUMQGA.cjs → chunk-IQIDM3KM.cjs} +10 -16
- package/dist/chunk-IQIDM3KM.cjs.map +1 -0
- package/dist/{chunk-KLPY2HUC.cjs → chunk-JFKWH6EP.cjs} +57 -2
- package/dist/chunk-JFKWH6EP.cjs.map +1 -0
- package/dist/{chunk-7AFGROHZ.js → chunk-JQ7Y723H.js} +11 -16
- package/dist/{chunk-7AFGROHZ.js.map → chunk-JQ7Y723H.js.map} +1 -1
- package/dist/{chunk-J3BYHBKW.js → chunk-KD7CKXWQ.js} +1721 -1427
- package/dist/chunk-KD7CKXWQ.js.map +1 -0
- package/dist/{chunk-65WT5PHA.cjs → chunk-L66ZJ2UI.cjs} +1733 -1425
- package/dist/chunk-L66ZJ2UI.cjs.map +1 -0
- package/dist/document-tools/index.cjs +31 -0
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.cts +19 -1
- package/dist/document-tools/index.d.ts +19 -1
- package/dist/document-tools/index.js +30 -1
- package/dist/document-tools/index.js.map +1 -1
- package/dist/{index-2Y2MVegs.d.ts → index-BV7pBlgY.d.cts} +119 -6
- package/dist/{index-2Y2MVegs.d.cts → index-BV7pBlgY.d.ts} +119 -6
- package/dist/{index-3E0neHf_.d.cts → index-DyFzmDZ2.d.cts} +46 -1
- package/dist/{index-3E0neHf_.d.ts → index-DyFzmDZ2.d.ts} +46 -1
- package/dist/index.cjs +1394 -1223
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1355 -339
- package/dist/index.d.ts +1355 -339
- package/dist/index.js +581 -505
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +33 -9
- package/dist/shell/index.d.cts +3 -1
- package/dist/shell/index.d.ts +3 -1
- package/dist/shell/index.js +1 -1
- package/dist/ui/index.cjs +174 -118
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-65WT5PHA.cjs.map +0 -1
- package/dist/chunk-J3BYHBKW.js.map +0 -1
- package/dist/chunk-KLPY2HUC.cjs.map +0 -1
- package/dist/chunk-MFMJHBJR.js.map +0 -1
- package/dist/chunk-YIFUMQGA.cjs.map +0 -1
|
@@ -330,6 +330,333 @@ function IconToggle({
|
|
|
330
330
|
] }) : button
|
|
331
331
|
] });
|
|
332
332
|
}
|
|
333
|
+
var ENTITY_MAPPINGS = {
|
|
334
|
+
PRODUCT: {
|
|
335
|
+
NAMES: {
|
|
336
|
+
SINGULAR: "ARBI Docs"
|
|
337
|
+
},
|
|
338
|
+
ICONS: {
|
|
339
|
+
DEFAULT: lucideReact.MessageSquareLock
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
SECTION: {
|
|
343
|
+
NAMES: {
|
|
344
|
+
SINGULAR: "Section"
|
|
345
|
+
},
|
|
346
|
+
ICONS: {
|
|
347
|
+
DEFAULT: lucideReact.ChevronsDown
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
WORKSPACE: {
|
|
351
|
+
NAMES: {
|
|
352
|
+
SINGULAR: "Workspace",
|
|
353
|
+
PLURAL: "Workspaces"
|
|
354
|
+
},
|
|
355
|
+
ICONS: {
|
|
356
|
+
DEFAULT: lucideReact.SquareM,
|
|
357
|
+
NEW: lucideReact.SquarePlus,
|
|
358
|
+
LIST: lucideReact.LayoutGrid,
|
|
359
|
+
SETTINGS: lucideReact.Columns3Cog
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
CONVERSATION: {
|
|
363
|
+
NAMES: {
|
|
364
|
+
SINGULAR: "Thread",
|
|
365
|
+
PLURAL: "Threads",
|
|
366
|
+
NEW: "New Thread"
|
|
367
|
+
},
|
|
368
|
+
ICONS: {
|
|
369
|
+
DEFAULT: lucideReact.MessagesSquare,
|
|
370
|
+
OFF: lucideReact.MessageSquareOff,
|
|
371
|
+
ACTIVE: lucideReact.MessageSquareText,
|
|
372
|
+
NEW: lucideReact.MessageSquarePlus,
|
|
373
|
+
LIST: lucideReact.MessageSquareMore
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
DOCUMENT: {
|
|
377
|
+
NAMES: {
|
|
378
|
+
SINGULAR: "File",
|
|
379
|
+
PLURAL: "Files"
|
|
380
|
+
},
|
|
381
|
+
ICONS: {
|
|
382
|
+
DEFAULT: lucideReact.FolderOpen,
|
|
383
|
+
OFF: lucideReact.CaptionsOff
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
VIEWER: {
|
|
387
|
+
NAMES: {
|
|
388
|
+
SINGULAR: "Viewer",
|
|
389
|
+
PLURAL: "Viewers"
|
|
390
|
+
},
|
|
391
|
+
ICONS: {
|
|
392
|
+
DEFAULT: lucideReact.Eye,
|
|
393
|
+
OFF: lucideReact.EyeOff
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
TAG: {
|
|
397
|
+
NAMES: {
|
|
398
|
+
SINGULAR: "Field",
|
|
399
|
+
PLURAL: "Fields"
|
|
400
|
+
},
|
|
401
|
+
ICONS: {
|
|
402
|
+
DEFAULT: lucideReact.Hash,
|
|
403
|
+
NEW: lucideReact.FolderPlus
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
ANNOTATION: {
|
|
407
|
+
NAMES: {
|
|
408
|
+
SINGULAR: "Annotation",
|
|
409
|
+
PLURAL: "Annotations"
|
|
410
|
+
},
|
|
411
|
+
ICONS: {
|
|
412
|
+
DEFAULT: lucideReact.StickyNote,
|
|
413
|
+
NEW: lucideReact.StickyNote
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
// A tag of any kind — what the Tags page lists. TAG stays "Field": the Files page's custom
|
|
417
|
+
// columns (labels and annotations as document fields) are named after it.
|
|
418
|
+
ANY_TAG: {
|
|
419
|
+
NAMES: {
|
|
420
|
+
SINGULAR: "Tag",
|
|
421
|
+
PLURAL: "Tags"
|
|
422
|
+
},
|
|
423
|
+
ICONS: {
|
|
424
|
+
DEFAULT: lucideReact.Tags
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
// The kinds of TAG (a tag's `kind`): a label files things; an issue is a point in dispute; a
|
|
428
|
+
// person and an organisation are entities the documents name; a saved search is a stored query.
|
|
429
|
+
LABEL: {
|
|
430
|
+
NAMES: {
|
|
431
|
+
SINGULAR: "Label",
|
|
432
|
+
PLURAL: "Labels"
|
|
433
|
+
},
|
|
434
|
+
ICONS: {
|
|
435
|
+
DEFAULT: lucideReact.Tags
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
ISSUE: {
|
|
439
|
+
NAMES: {
|
|
440
|
+
SINGULAR: "Issue",
|
|
441
|
+
PLURAL: "Issues"
|
|
442
|
+
},
|
|
443
|
+
ICONS: {
|
|
444
|
+
DEFAULT: lucideReact.Scale
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
PERSON: {
|
|
448
|
+
NAMES: {
|
|
449
|
+
SINGULAR: "Person",
|
|
450
|
+
PLURAL: "People"
|
|
451
|
+
},
|
|
452
|
+
ICONS: {
|
|
453
|
+
DEFAULT: lucideReact.Contact
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
ORGANISATION: {
|
|
457
|
+
NAMES: {
|
|
458
|
+
SINGULAR: "Organisation",
|
|
459
|
+
PLURAL: "Organisations"
|
|
460
|
+
},
|
|
461
|
+
ICONS: {
|
|
462
|
+
DEFAULT: lucideReact.Building2
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
SAVED_SEARCH: {
|
|
466
|
+
NAMES: {
|
|
467
|
+
SINGULAR: "Saved search",
|
|
468
|
+
PLURAL: "Saved searches"
|
|
469
|
+
},
|
|
470
|
+
ICONS: {
|
|
471
|
+
DEFAULT: lucideReact.Search
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
// A statement the workspace knows — a date, a decision, a preference — written by hand or kept by
|
|
475
|
+
// the assistant, optionally grounded in source passages (`facts`, fct-*). Distinct from
|
|
476
|
+
// ANNOTATION, a value attached TO a document; a fact is workspace-scoped and stands alone.
|
|
477
|
+
FACT: {
|
|
478
|
+
NAMES: {
|
|
479
|
+
SINGULAR: "Fact",
|
|
480
|
+
PLURAL: "Facts"
|
|
481
|
+
},
|
|
482
|
+
ICONS: {
|
|
483
|
+
DEFAULT: lucideReact.NotebookText,
|
|
484
|
+
NEW: lucideReact.NotebookPen
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
USER: {
|
|
488
|
+
NAMES: {
|
|
489
|
+
SINGULAR: "User",
|
|
490
|
+
PLURAL: "Users"
|
|
491
|
+
},
|
|
492
|
+
ICONS: {
|
|
493
|
+
DEFAULT: lucideReact.User,
|
|
494
|
+
NEW: lucideReact.UserPlus,
|
|
495
|
+
SETTINGS: lucideReact.Settings2
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
WORKSPACEUSER: {
|
|
499
|
+
NAMES: {
|
|
500
|
+
SINGULAR: "Member",
|
|
501
|
+
PLURAL: "Members"
|
|
502
|
+
},
|
|
503
|
+
ICONS: {
|
|
504
|
+
DEFAULT: lucideReact.User,
|
|
505
|
+
PLURAL: lucideReact.Users,
|
|
506
|
+
NEW: lucideReact.UserPlus,
|
|
507
|
+
SETTINGS: lucideReact.Settings2
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
CONTACT: {
|
|
511
|
+
NAMES: {
|
|
512
|
+
SINGULAR: "Contact",
|
|
513
|
+
PLURAL: "Contacts"
|
|
514
|
+
},
|
|
515
|
+
ICONS: {
|
|
516
|
+
// A starred person, not an address-book card: contacts here are the
|
|
517
|
+
// people you talk to, and the star reads as "your people".
|
|
518
|
+
DEFAULT: lucideReact.UserStar,
|
|
519
|
+
NEW: lucideReact.UserPlus
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
TASK: {
|
|
523
|
+
NAMES: {
|
|
524
|
+
SINGULAR: "Job",
|
|
525
|
+
PLURAL: "Jobs"
|
|
526
|
+
},
|
|
527
|
+
ICONS: {
|
|
528
|
+
DEFAULT: lucideReact.ClipboardList
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
PROJECT: {
|
|
532
|
+
NAMES: {
|
|
533
|
+
SINGULAR: "Project",
|
|
534
|
+
PLURAL: "Projects"
|
|
535
|
+
},
|
|
536
|
+
ICONS: {
|
|
537
|
+
DEFAULT: lucideReact.CreditCard
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
SKILL: {
|
|
541
|
+
NAMES: {
|
|
542
|
+
SINGULAR: "Skill",
|
|
543
|
+
PLURAL: "Skills"
|
|
544
|
+
},
|
|
545
|
+
ICONS: {
|
|
546
|
+
DEFAULT: lucideReact.Wrench
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
ACCOUNT: {
|
|
550
|
+
NAMES: {
|
|
551
|
+
SINGULAR: "Account"
|
|
552
|
+
},
|
|
553
|
+
ICONS: {
|
|
554
|
+
DEFAULT: lucideReact.CircleUserRound
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
NOTIFICATIONS: {
|
|
558
|
+
NAMES: {
|
|
559
|
+
SINGULAR: "Activity",
|
|
560
|
+
PLURAL: "Activities"
|
|
561
|
+
},
|
|
562
|
+
ICONS: {
|
|
563
|
+
DEFAULT: lucideReact.Bell
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
MESSAGE: {
|
|
567
|
+
NAMES: {
|
|
568
|
+
SINGULAR: "Message",
|
|
569
|
+
PLURAL: "Messages"
|
|
570
|
+
},
|
|
571
|
+
ICONS: {
|
|
572
|
+
DEFAULT: lucideReact.MessageSquare
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
NOTIFICATION: {
|
|
576
|
+
NAMES: {
|
|
577
|
+
SINGULAR: "Notification",
|
|
578
|
+
PLURAL: "Notifications"
|
|
579
|
+
},
|
|
580
|
+
ICONS: {
|
|
581
|
+
DEFAULT: lucideReact.Bell
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
APP: {
|
|
585
|
+
NAMES: {
|
|
586
|
+
SINGULAR: "Application",
|
|
587
|
+
PLURAL: "Applications"
|
|
588
|
+
},
|
|
589
|
+
ICONS: {
|
|
590
|
+
DEFAULT: lucideReact.LayoutGrid,
|
|
591
|
+
HOME: lucideReact.LayoutGrid,
|
|
592
|
+
LOGOUT: lucideReact.LogOut,
|
|
593
|
+
UPLOAD: lucideReact.Upload
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
HELP: {
|
|
597
|
+
NAMES: {
|
|
598
|
+
SINGULAR: "Help",
|
|
599
|
+
PLURAL: "Help"
|
|
600
|
+
},
|
|
601
|
+
ICONS: {
|
|
602
|
+
DEFAULT: lucideReact.MessageSquareLock,
|
|
603
|
+
DOCS: lucideReact.BookOpen,
|
|
604
|
+
FAQ: lucideReact.FileQuestion,
|
|
605
|
+
ABOUT: lucideReact.Info
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
USERSHIELD: {
|
|
609
|
+
NAMES: {
|
|
610
|
+
SINGULAR: "User Shield",
|
|
611
|
+
PLURAL: "User Shields"
|
|
612
|
+
},
|
|
613
|
+
ICONS: {
|
|
614
|
+
DEFAULT: lucideReact.MessageSquareLock
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
function configureEntityRegistry(overrides) {
|
|
619
|
+
for (const [type, def] of Object.entries(overrides)) {
|
|
620
|
+
const target = ENTITY_MAPPINGS[type];
|
|
621
|
+
if (!target) continue;
|
|
622
|
+
if (def?.NAMES) Object.assign(target.NAMES, def.NAMES);
|
|
623
|
+
if (def?.ICONS) Object.assign(target.ICONS, def.ICONS);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
var getEntityIcon = (entityType, variant = "DEFAULT") => {
|
|
627
|
+
const icons = ENTITY_MAPPINGS[entityType]?.ICONS;
|
|
628
|
+
return icons?.[variant] || icons?.DEFAULT;
|
|
629
|
+
};
|
|
630
|
+
var getEntityLabel = (entityType, form = "SINGULAR") => {
|
|
631
|
+
const entityMapping = ENTITY_MAPPINGS[entityType];
|
|
632
|
+
if (!entityMapping) return "";
|
|
633
|
+
const names = entityMapping.NAMES;
|
|
634
|
+
const singularName = names.SINGULAR || "";
|
|
635
|
+
if (form === "NEW") return names.NEW !== void 0 ? names.NEW : "New " + singularName;
|
|
636
|
+
if (form === "SHORT")
|
|
637
|
+
return names.SHORT !== void 0 ? names.SHORT : singularName.substring(0, 3) + ".";
|
|
638
|
+
if (form === "PLURAL") return names.PLURAL !== void 0 ? names.PLURAL : singularName + "s";
|
|
639
|
+
return singularName;
|
|
640
|
+
};
|
|
641
|
+
var EntityIcon = ({ entityType, variant = "DEFAULT", ...props }) => {
|
|
642
|
+
const IconComponent = getEntityIcon(entityType, variant);
|
|
643
|
+
return IconComponent ? React__namespace.default.createElement(IconComponent, props) : null;
|
|
644
|
+
};
|
|
645
|
+
var VISIBILITY_ICONS = {
|
|
646
|
+
PRIVATE: lucideReact.MessageSquareLock,
|
|
647
|
+
SHARED: lucideReact.Users
|
|
648
|
+
};
|
|
649
|
+
var VisibilityIcon = ({
|
|
650
|
+
isShared,
|
|
651
|
+
className,
|
|
652
|
+
...props
|
|
653
|
+
}) => {
|
|
654
|
+
const IconComponent = isShared ? VISIBILITY_ICONS.SHARED : VISIBILITY_ICONS.PRIVATE;
|
|
655
|
+
return React__namespace.default.createElement(IconComponent, {
|
|
656
|
+
...props,
|
|
657
|
+
className: [isShared ? "text-secondary" : "text-primary", className].filter(Boolean).join(" ")
|
|
658
|
+
});
|
|
659
|
+
};
|
|
333
660
|
var Select = SelectPrimitive__namespace.Root;
|
|
334
661
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
335
662
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
@@ -459,7 +786,7 @@ function VisibilityToggle({
|
|
|
459
786
|
tooltipInactive,
|
|
460
787
|
tooltipMixed,
|
|
461
788
|
label = "Visibility",
|
|
462
|
-
workspaceLabel = "
|
|
789
|
+
workspaceLabel = getEntityLabel("WORKSPACE"),
|
|
463
790
|
"data-testid": dataTestId
|
|
464
791
|
}) {
|
|
465
792
|
const itemsArray = React.useMemo(() => Array.isArray(items) ? items : [items], [items]);
|
|
@@ -532,6 +859,75 @@ function VisibilityToggle({
|
|
|
532
859
|
}
|
|
533
860
|
);
|
|
534
861
|
}
|
|
862
|
+
var COLORS2 = {
|
|
863
|
+
text: "text-green-text",
|
|
864
|
+
bg: "bg-green-text"
|
|
865
|
+
};
|
|
866
|
+
function VerifiedToggle({
|
|
867
|
+
verified,
|
|
868
|
+
onToggle,
|
|
869
|
+
disabled = false,
|
|
870
|
+
showLabel = true,
|
|
871
|
+
showTooltip = true,
|
|
872
|
+
tooltipActive,
|
|
873
|
+
tooltipInactive,
|
|
874
|
+
"data-testid": dataTestId
|
|
875
|
+
}) {
|
|
876
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
877
|
+
IconToggle,
|
|
878
|
+
{
|
|
879
|
+
icon: lucideReact.CheckCircle2,
|
|
880
|
+
isActive: verified,
|
|
881
|
+
onToggle,
|
|
882
|
+
colors: COLORS2,
|
|
883
|
+
disabled,
|
|
884
|
+
showLabel,
|
|
885
|
+
label: "Verified",
|
|
886
|
+
showTooltip,
|
|
887
|
+
tooltipActive: tooltipActive || "Verified by a human \u2014 click to unverify",
|
|
888
|
+
tooltipInactive: tooltipInactive || "Not verified \u2014 click to verify",
|
|
889
|
+
"data-testid": dataTestId
|
|
890
|
+
}
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
// src/lib/format-friendly-date.ts
|
|
895
|
+
function formatFriendlyDate(dateString, includeTime = true) {
|
|
896
|
+
if (!dateString) return "";
|
|
897
|
+
try {
|
|
898
|
+
if (dateString.includes("Today") || dateString.includes("Yesterday") || /\w+ \d+, \d+:\d+:\d+/.test(dateString)) {
|
|
899
|
+
return dateString;
|
|
900
|
+
}
|
|
901
|
+
if (/^\d{1,2}:\d{2}(:\d{2})?$/.test(dateString)) {
|
|
902
|
+
return dateString;
|
|
903
|
+
}
|
|
904
|
+
const date = new Date(dateString);
|
|
905
|
+
if (isNaN(date.getTime())) return dateString;
|
|
906
|
+
const timeOptions = { hour: "2-digit", minute: "2-digit" };
|
|
907
|
+
const timeString = date.toLocaleTimeString([], timeOptions);
|
|
908
|
+
const now = /* @__PURE__ */ new Date();
|
|
909
|
+
const today = now.toDateString();
|
|
910
|
+
const yesterday = new Date(now);
|
|
911
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
912
|
+
if (date.toDateString() === today) {
|
|
913
|
+
return includeTime ? `Today, ${timeString}` : "today";
|
|
914
|
+
} else if (date.toDateString() === yesterday.toDateString()) {
|
|
915
|
+
return includeTime ? `Yesterday, ${timeString}` : "yesterday";
|
|
916
|
+
} else {
|
|
917
|
+
const dateOptions = {
|
|
918
|
+
month: "short",
|
|
919
|
+
day: "numeric"
|
|
920
|
+
};
|
|
921
|
+
if (date.getFullYear() !== now.getFullYear()) {
|
|
922
|
+
dateOptions.year = "numeric";
|
|
923
|
+
}
|
|
924
|
+
const formattedDate = date.toLocaleDateString([], dateOptions);
|
|
925
|
+
return includeTime ? `${formattedDate}, ${timeString}` : formattedDate;
|
|
926
|
+
}
|
|
927
|
+
} catch {
|
|
928
|
+
return dateString;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
535
931
|
|
|
536
932
|
// src/documents/media-error.ts
|
|
537
933
|
function classifyMediaError(err, kind) {
|
|
@@ -2085,601 +2481,251 @@ function MarkMenu({
|
|
|
2085
2481
|
else openWith("press");
|
|
2086
2482
|
return;
|
|
2087
2483
|
}
|
|
2088
|
-
if (shouldClickRunPrimary && primary?.onSelect) {
|
|
2089
|
-
e.preventDefault();
|
|
2090
|
-
close();
|
|
2091
|
-
primary.onSelect();
|
|
2092
|
-
}
|
|
2093
|
-
};
|
|
2094
|
-
const handleMenuKeyDown = (e) => {
|
|
2095
|
-
const list = rows();
|
|
2096
|
-
const index = list.indexOf(document.activeElement);
|
|
2097
|
-
let target;
|
|
2098
|
-
if (e.key === "ArrowDown") target = list[(index + 1) % list.length];
|
|
2099
|
-
else if (e.key === "ArrowUp") target = list[(index - 1 + list.length) % list.length];
|
|
2100
|
-
else if (e.key === "Home") target = list[0];
|
|
2101
|
-
else if (e.key === "End") target = list[list.length - 1];
|
|
2102
|
-
else if (e.key === "Escape") {
|
|
2103
|
-
e.preventDefault();
|
|
2104
|
-
e.stopPropagation();
|
|
2105
|
-
close(true);
|
|
2106
|
-
return;
|
|
2107
|
-
} else if (e.key === "Tab") {
|
|
2108
|
-
close();
|
|
2109
|
-
return;
|
|
2110
|
-
}
|
|
2111
|
-
if (target) {
|
|
2112
|
-
e.preventDefault();
|
|
2113
|
-
target.focus();
|
|
2114
|
-
}
|
|
2115
|
-
};
|
|
2116
|
-
const choose = (item) => {
|
|
2117
|
-
const wasKey = mode.current === "key";
|
|
2118
|
-
close(wasKey);
|
|
2119
|
-
item.onSelect?.();
|
|
2120
|
-
};
|
|
2121
|
-
const setTriggerRef = React.useCallback(
|
|
2122
|
-
(el) => {
|
|
2123
|
-
triggerRef.current = el;
|
|
2124
|
-
if (typeof externalRef === "function") externalRef(el);
|
|
2125
|
-
else if (externalRef) externalRef.current = el;
|
|
2126
|
-
},
|
|
2127
|
-
[externalRef]
|
|
2128
|
-
);
|
|
2129
|
-
const triggerProps = {
|
|
2130
|
-
ref: setTriggerRef,
|
|
2131
|
-
className,
|
|
2132
|
-
"data-testid": testId,
|
|
2133
|
-
"data-slot": "mark",
|
|
2134
|
-
"aria-haspopup": "true",
|
|
2135
|
-
"aria-expanded": open,
|
|
2136
|
-
"aria-controls": open ? menuId : void 0,
|
|
2137
|
-
onPointerDown: handlePointerDown,
|
|
2138
|
-
onPointerEnter: handlePointerEnter,
|
|
2139
|
-
onPointerMove: handlePointerMove,
|
|
2140
|
-
onPointerLeave: handlePointerLeave,
|
|
2141
|
-
onFocus: handleFocus,
|
|
2142
|
-
onBlur: handleBlur,
|
|
2143
|
-
onKeyDown: handleKeyDown,
|
|
2144
|
-
onClick: handleClick,
|
|
2145
|
-
...rest
|
|
2146
|
-
};
|
|
2147
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: open && !isEmpty, children: [
|
|
2148
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverAnchor, { asChild: true, children: as === "a" ? /* @__PURE__ */ jsxRuntime.jsx("a", { href, ...triggerProps, children }) : /* @__PURE__ */ jsxRuntime.jsx("span", { role: "button", tabIndex: 0, ...triggerProps, children }) }),
|
|
2149
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2150
|
-
PopoverContent,
|
|
2151
|
-
{
|
|
2152
|
-
ref: contentRef,
|
|
2153
|
-
id: menuId,
|
|
2154
|
-
side,
|
|
2155
|
-
align: "start",
|
|
2156
|
-
sideOffset: 6,
|
|
2157
|
-
collisionPadding: 8,
|
|
2158
|
-
role: "group",
|
|
2159
|
-
"data-testid": menuTestId,
|
|
2160
|
-
"data-slot": "mark-menu",
|
|
2161
|
-
className: "w-auto min-w-[12rem] max-w-[min(22rem,calc(100vw-1rem))] p-1",
|
|
2162
|
-
onOpenAutoFocus: (e) => {
|
|
2163
|
-
e.preventDefault();
|
|
2164
|
-
if (focusFirstOnOpen.current) firstItem()?.focus();
|
|
2165
|
-
},
|
|
2166
|
-
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
2167
|
-
onEscapeKeyDown: (e) => {
|
|
2168
|
-
e.preventDefault();
|
|
2169
|
-
close(true);
|
|
2170
|
-
},
|
|
2171
|
-
onInteractOutside: (e) => {
|
|
2172
|
-
if (triggerRef.current?.contains(e.target)) e.preventDefault();
|
|
2173
|
-
},
|
|
2174
|
-
onPointerEnter: clearTimer,
|
|
2175
|
-
onPointerLeave: (e) => {
|
|
2176
|
-
if (!isCoarse(e.pointerType) && mode.current === "hover")
|
|
2177
|
-
schedule(() => close(), closeDelay);
|
|
2178
|
-
},
|
|
2179
|
-
children: [
|
|
2180
|
-
preview && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-sm", children: preview }),
|
|
2181
|
-
ordered.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "menu", "aria-label": menuLabel, onKeyDown: handleMenuKeyDown, children: ordered.map((item) => {
|
|
2182
|
-
const rowClass = chunkS6A6FSG7_cjs.cn(
|
|
2183
|
-
"flex w-full cursor-pointer items-center rounded-sm px-2 py-1.5 text-left text-sm outline-none transition-colors hover:bg-accent focus-visible:bg-accent pointer-coarse:min-h-11 pointer-coarse:px-3",
|
|
2184
|
-
item.primary && "font-medium pointer-coarse:text-base",
|
|
2185
|
-
item.destructive && "text-destructive"
|
|
2186
|
-
);
|
|
2187
|
-
return item.href && !item.onSelect ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2188
|
-
"a",
|
|
2189
|
-
{
|
|
2190
|
-
role: "menuitem",
|
|
2191
|
-
tabIndex: -1,
|
|
2192
|
-
href: item.href,
|
|
2193
|
-
className: rowClass,
|
|
2194
|
-
"data-testid": item.testId,
|
|
2195
|
-
onClick: () => close(),
|
|
2196
|
-
children: item.label
|
|
2197
|
-
},
|
|
2198
|
-
item.id
|
|
2199
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2200
|
-
"button",
|
|
2201
|
-
{
|
|
2202
|
-
type: "button",
|
|
2203
|
-
role: "menuitem",
|
|
2204
|
-
tabIndex: -1,
|
|
2205
|
-
className: rowClass,
|
|
2206
|
-
"data-testid": item.testId,
|
|
2207
|
-
onClick: () => choose(item),
|
|
2208
|
-
children: item.label
|
|
2209
|
-
},
|
|
2210
|
-
item.id
|
|
2211
|
-
);
|
|
2212
|
-
}) })
|
|
2213
|
-
]
|
|
2214
|
-
}
|
|
2215
|
-
)
|
|
2216
|
-
] });
|
|
2217
|
-
}
|
|
2218
|
-
var Command = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2219
|
-
cmdk.Command,
|
|
2220
|
-
{
|
|
2221
|
-
ref,
|
|
2222
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
2223
|
-
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
2224
|
-
className
|
|
2225
|
-
),
|
|
2226
|
-
...props
|
|
2227
|
-
}
|
|
2228
|
-
));
|
|
2229
|
-
Command.displayName = cmdk.Command.displayName;
|
|
2230
|
-
var CommandDialog = ({ children, ...props }) => {
|
|
2231
|
-
return /* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.Dialog, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) });
|
|
2232
|
-
};
|
|
2233
|
-
var CommandInput = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b px-3", "data-cmdk-input-wrapper": "", children: [
|
|
2234
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
2235
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2236
|
-
cmdk.Command.Input,
|
|
2237
|
-
{
|
|
2238
|
-
ref,
|
|
2239
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
2240
|
-
"flex h-10 pointer-coarse:h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
2241
|
-
className
|
|
2242
|
-
),
|
|
2243
|
-
...props
|
|
2244
|
-
}
|
|
2245
|
-
)
|
|
2246
|
-
] }));
|
|
2247
|
-
CommandInput.displayName = cmdk.Command.Input.displayName;
|
|
2248
|
-
var CommandList = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2249
|
-
cmdk.Command.List,
|
|
2250
|
-
{
|
|
2251
|
-
ref,
|
|
2252
|
-
className: chunkS6A6FSG7_cjs.cn("max-h-[min(300px,50dvh)] overflow-y-auto overflow-x-hidden", className),
|
|
2253
|
-
...props
|
|
2254
|
-
}
|
|
2255
|
-
));
|
|
2256
|
-
CommandList.displayName = cmdk.Command.List.displayName;
|
|
2257
|
-
var CommandEmpty = React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
|
|
2258
|
-
CommandEmpty.displayName = cmdk.Command.Empty.displayName;
|
|
2259
|
-
var CommandGroup = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2260
|
-
cmdk.Command.Group,
|
|
2261
|
-
{
|
|
2262
|
-
ref,
|
|
2263
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
2264
|
-
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
2265
|
-
className
|
|
2266
|
-
),
|
|
2267
|
-
...props
|
|
2268
|
-
}
|
|
2269
|
-
));
|
|
2270
|
-
CommandGroup.displayName = cmdk.Command.Group.displayName;
|
|
2271
|
-
var CommandSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2272
|
-
cmdk.Command.Separator,
|
|
2273
|
-
{
|
|
2274
|
-
ref,
|
|
2275
|
-
className: chunkS6A6FSG7_cjs.cn("-mx-1 h-px bg-border", className),
|
|
2276
|
-
...props
|
|
2277
|
-
}
|
|
2278
|
-
));
|
|
2279
|
-
CommandSeparator.displayName = cmdk.Command.Separator.displayName;
|
|
2280
|
-
var CommandItem = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2281
|
-
cmdk.Command.Item,
|
|
2282
|
-
{
|
|
2283
|
-
ref,
|
|
2284
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
2285
|
-
"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 pointer-coarse:min-h-11 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
2286
|
-
className
|
|
2287
|
-
),
|
|
2288
|
-
...props
|
|
2289
|
-
}
|
|
2290
|
-
));
|
|
2291
|
-
CommandItem.displayName = cmdk.Command.Item.displayName;
|
|
2292
|
-
var CommandShortcut = ({ className, ...props }) => {
|
|
2293
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2294
|
-
"span",
|
|
2295
|
-
{
|
|
2296
|
-
className: chunkS6A6FSG7_cjs.cn("ml-auto text-sm tracking-widest text-muted-foreground", className),
|
|
2297
|
-
...props
|
|
2298
|
-
}
|
|
2299
|
-
);
|
|
2300
|
-
};
|
|
2301
|
-
CommandShortcut.displayName = "CommandShortcut";
|
|
2302
|
-
var AI_COMPONENTS = {
|
|
2303
|
-
a: (p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2304
|
-
"a",
|
|
2305
|
-
{
|
|
2306
|
-
className: "text-ai-accent underline underline-offset-2",
|
|
2307
|
-
target: "_blank",
|
|
2308
|
-
rel: "noopener noreferrer",
|
|
2309
|
-
...p
|
|
2484
|
+
if (shouldClickRunPrimary && primary?.onSelect) {
|
|
2485
|
+
e.preventDefault();
|
|
2486
|
+
close();
|
|
2487
|
+
primary.onSelect();
|
|
2310
2488
|
}
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
components: AI_COMPONENTS,
|
|
2329
|
-
isStreaming,
|
|
2330
|
-
allowHtml,
|
|
2331
|
-
testId: "ai-markdown",
|
|
2332
|
-
children
|
|
2489
|
+
};
|
|
2490
|
+
const handleMenuKeyDown = (e) => {
|
|
2491
|
+
const list = rows();
|
|
2492
|
+
const index = list.indexOf(document.activeElement);
|
|
2493
|
+
let target;
|
|
2494
|
+
if (e.key === "ArrowDown") target = list[(index + 1) % list.length];
|
|
2495
|
+
else if (e.key === "ArrowUp") target = list[(index - 1 + list.length) % list.length];
|
|
2496
|
+
else if (e.key === "Home") target = list[0];
|
|
2497
|
+
else if (e.key === "End") target = list[list.length - 1];
|
|
2498
|
+
else if (e.key === "Escape") {
|
|
2499
|
+
e.preventDefault();
|
|
2500
|
+
e.stopPropagation();
|
|
2501
|
+
close(true);
|
|
2502
|
+
return;
|
|
2503
|
+
} else if (e.key === "Tab") {
|
|
2504
|
+
close();
|
|
2505
|
+
return;
|
|
2333
2506
|
}
|
|
2507
|
+
if (target) {
|
|
2508
|
+
e.preventDefault();
|
|
2509
|
+
target.focus();
|
|
2510
|
+
}
|
|
2511
|
+
};
|
|
2512
|
+
const choose = (item) => {
|
|
2513
|
+
const wasKey = mode.current === "key";
|
|
2514
|
+
close(wasKey);
|
|
2515
|
+
item.onSelect?.();
|
|
2516
|
+
};
|
|
2517
|
+
const setTriggerRef = React.useCallback(
|
|
2518
|
+
(el) => {
|
|
2519
|
+
triggerRef.current = el;
|
|
2520
|
+
if (typeof externalRef === "function") externalRef(el);
|
|
2521
|
+
else if (externalRef) externalRef.current = el;
|
|
2522
|
+
},
|
|
2523
|
+
[externalRef]
|
|
2334
2524
|
);
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
const shapeClass = shape === "pill" ? "rounded-full" : "rounded-md";
|
|
2358
|
-
const sizeClasses2 = size === "base" ? "gap-1.5 px-1.5 py-0.5" : "gap-1 px-1";
|
|
2359
|
-
const textSizeClass = size === "base" ? "text-base" : "text-sm";
|
|
2360
|
-
const baseClasses = chunkS6A6FSG7_cjs.cn(
|
|
2361
|
-
"group/pill items-center",
|
|
2362
|
-
fullWidth ? "flex w-full" : "inline-flex",
|
|
2363
|
-
sizeClasses2,
|
|
2364
|
-
shapeClass,
|
|
2365
|
-
"border border-transparent",
|
|
2366
|
-
"transition-colors",
|
|
2367
|
-
className
|
|
2368
|
-
);
|
|
2369
|
-
const interactiveClasses = "relative cursor-pointer hover:bg-muted pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']";
|
|
2370
|
-
const disabledClasses = "cursor-default opacity-60";
|
|
2371
|
-
const highlightClasses = "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground";
|
|
2372
|
-
const mainContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2373
|
-
onIconClick ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2374
|
-
"span",
|
|
2525
|
+
const triggerProps = {
|
|
2526
|
+
ref: setTriggerRef,
|
|
2527
|
+
className,
|
|
2528
|
+
"data-testid": testId,
|
|
2529
|
+
"data-slot": "mark",
|
|
2530
|
+
"aria-haspopup": "true",
|
|
2531
|
+
"aria-expanded": open,
|
|
2532
|
+
"aria-controls": open ? menuId : void 0,
|
|
2533
|
+
onPointerDown: handlePointerDown,
|
|
2534
|
+
onPointerEnter: handlePointerEnter,
|
|
2535
|
+
onPointerMove: handlePointerMove,
|
|
2536
|
+
onPointerLeave: handlePointerLeave,
|
|
2537
|
+
onFocus: handleFocus,
|
|
2538
|
+
onBlur: handleBlur,
|
|
2539
|
+
onKeyDown: handleKeyDown,
|
|
2540
|
+
onClick: handleClick,
|
|
2541
|
+
...rest
|
|
2542
|
+
};
|
|
2543
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: open && !isEmpty, children: [
|
|
2544
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverAnchor, { asChild: true, children: as === "a" ? /* @__PURE__ */ jsxRuntime.jsx("a", { href, ...triggerProps, children }) : /* @__PURE__ */ jsxRuntime.jsx("span", { role: "button", tabIndex: 0, ...triggerProps, children }) }),
|
|
2545
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2546
|
+
PopoverContent,
|
|
2375
2547
|
{
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2548
|
+
ref: contentRef,
|
|
2549
|
+
id: menuId,
|
|
2550
|
+
side,
|
|
2551
|
+
align: "start",
|
|
2552
|
+
sideOffset: 6,
|
|
2553
|
+
collisionPadding: 8,
|
|
2554
|
+
role: "group",
|
|
2555
|
+
"data-testid": menuTestId,
|
|
2556
|
+
"data-slot": "mark-menu",
|
|
2557
|
+
className: "w-auto min-w-[12rem] max-w-[min(22rem,calc(100vw-1rem))] p-1",
|
|
2558
|
+
onOpenAutoFocus: (e) => {
|
|
2559
|
+
e.preventDefault();
|
|
2560
|
+
if (focusFirstOnOpen.current) firstItem()?.focus();
|
|
2561
|
+
},
|
|
2562
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
2563
|
+
onEscapeKeyDown: (e) => {
|
|
2564
|
+
e.preventDefault();
|
|
2565
|
+
close(true);
|
|
2566
|
+
},
|
|
2567
|
+
onInteractOutside: (e) => {
|
|
2568
|
+
if (triggerRef.current?.contains(e.target)) e.preventDefault();
|
|
2569
|
+
},
|
|
2570
|
+
onPointerEnter: clearTimer,
|
|
2571
|
+
onPointerLeave: (e) => {
|
|
2572
|
+
if (!isCoarse(e.pointerType) && mode.current === "hover")
|
|
2573
|
+
schedule(() => close(), closeDelay);
|
|
2382
2574
|
},
|
|
2383
|
-
children: icon
|
|
2384
|
-
}
|
|
2385
|
-
) : icon,
|
|
2386
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2387
|
-
"span",
|
|
2388
|
-
{
|
|
2389
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
2390
|
-
textSizeClass,
|
|
2391
|
-
"font-medium truncate leading-tight min-w-0",
|
|
2392
|
-
labelMaxWidth,
|
|
2393
|
-
labelClassName
|
|
2394
|
-
),
|
|
2395
|
-
children: label
|
|
2396
|
-
}
|
|
2397
|
-
),
|
|
2398
|
-
secondaryText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground flex-shrink-0 leading-none", children: secondaryText })
|
|
2399
|
-
] });
|
|
2400
|
-
const tooltipWrap = (content, tip, side = tooltipSide, triggerClassName, triggerProps) => /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
2401
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2402
|
-
TooltipTrigger,
|
|
2403
|
-
{
|
|
2404
|
-
onFocusCapture: (e) => e.stopPropagation(),
|
|
2405
|
-
className: triggerClassName,
|
|
2406
|
-
...triggerProps,
|
|
2407
|
-
children: content
|
|
2408
|
-
}
|
|
2409
|
-
),
|
|
2410
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side, className: "p-2", children: tip })
|
|
2411
|
-
] });
|
|
2412
|
-
const mainAreaClass = chunkS6A6FSG7_cjs.cn("inline-flex items-center gap-1", fullWidth && "min-w-0 flex-1");
|
|
2413
|
-
const mainAreaTouchClass = chunkS6A6FSG7_cjs.cn(
|
|
2414
|
-
mainAreaClass,
|
|
2415
|
-
(onClick || href) && !disabled && "relative pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']"
|
|
2416
|
-
);
|
|
2417
|
-
if (onMoreClick || moreContent) {
|
|
2418
|
-
let mainArea;
|
|
2419
|
-
if (tooltipContent) {
|
|
2420
|
-
mainArea = tooltipWrap(
|
|
2421
|
-
mainContent,
|
|
2422
|
-
tooltipContent,
|
|
2423
|
-
tooltipSide,
|
|
2424
|
-
chunkS6A6FSG7_cjs.cn(mainAreaTouchClass, disabled && "opacity-60"),
|
|
2425
|
-
{
|
|
2426
|
-
type: "button",
|
|
2427
|
-
onClick: href ? onClick : disabled ? void 0 : onClick,
|
|
2428
|
-
disabled: disabled || void 0
|
|
2429
|
-
}
|
|
2430
|
-
);
|
|
2431
|
-
} else if (href) {
|
|
2432
|
-
mainArea = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2433
|
-
"a",
|
|
2434
|
-
{
|
|
2435
|
-
href,
|
|
2436
|
-
target: "_blank",
|
|
2437
|
-
rel: "noopener noreferrer",
|
|
2438
|
-
className: mainAreaTouchClass,
|
|
2439
|
-
onClick,
|
|
2440
|
-
children: mainContent
|
|
2441
|
-
}
|
|
2442
|
-
);
|
|
2443
|
-
} else if (onClick) {
|
|
2444
|
-
mainArea = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2445
|
-
"button",
|
|
2446
|
-
{
|
|
2447
|
-
type: "button",
|
|
2448
|
-
onClick: disabled ? void 0 : onClick,
|
|
2449
|
-
disabled,
|
|
2450
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
2451
|
-
"relative inline-flex items-center gap-1 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']",
|
|
2452
|
-
disabled && "opacity-60"
|
|
2453
|
-
),
|
|
2454
|
-
children: mainContent
|
|
2455
|
-
}
|
|
2456
|
-
);
|
|
2457
|
-
} else {
|
|
2458
|
-
mainArea = /* @__PURE__ */ jsxRuntime.jsx("span", { className: mainAreaTouchClass, children: mainContent });
|
|
2459
|
-
}
|
|
2460
|
-
const moreArea = moreContent ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 leading-none", children: moreContent }) : tooltipWrap(
|
|
2461
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "w-3.5 h-3.5" }),
|
|
2462
|
-
"Click for more",
|
|
2463
|
-
tooltipSide,
|
|
2464
|
-
"flex-shrink-0 leading-none text-muted-foreground hover:text-foreground",
|
|
2465
|
-
{
|
|
2466
|
-
type: "button",
|
|
2467
|
-
onClick: (e) => {
|
|
2468
|
-
e.stopPropagation();
|
|
2469
|
-
onMoreClick?.(e);
|
|
2470
|
-
}
|
|
2471
|
-
}
|
|
2472
|
-
);
|
|
2473
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2474
|
-
"span",
|
|
2475
|
-
{
|
|
2476
|
-
ref,
|
|
2477
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
2478
|
-
baseClasses,
|
|
2479
|
-
(onClick || href) && !disabled && "cursor-pointer hover:bg-muted",
|
|
2480
|
-
highlight && highlightClasses
|
|
2481
|
-
),
|
|
2482
|
-
"data-testid": testId,
|
|
2483
2575
|
children: [
|
|
2484
|
-
|
|
2485
|
-
|
|
2576
|
+
preview && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-sm", children: preview }),
|
|
2577
|
+
ordered.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "menu", "aria-label": menuLabel, onKeyDown: handleMenuKeyDown, children: ordered.map((item) => {
|
|
2578
|
+
const rowClass = chunkS6A6FSG7_cjs.cn(
|
|
2579
|
+
"flex w-full cursor-pointer items-center rounded-sm px-2 py-1.5 text-left text-sm outline-none transition-colors hover:bg-accent focus-visible:bg-accent pointer-coarse:min-h-11 pointer-coarse:px-3",
|
|
2580
|
+
item.primary && "font-medium pointer-coarse:text-base",
|
|
2581
|
+
item.destructive && "text-destructive"
|
|
2582
|
+
);
|
|
2583
|
+
return item.href && !item.onSelect ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2584
|
+
"a",
|
|
2585
|
+
{
|
|
2586
|
+
role: "menuitem",
|
|
2587
|
+
tabIndex: -1,
|
|
2588
|
+
href: item.href,
|
|
2589
|
+
className: rowClass,
|
|
2590
|
+
"data-testid": item.testId,
|
|
2591
|
+
onClick: () => close(),
|
|
2592
|
+
children: item.label
|
|
2593
|
+
},
|
|
2594
|
+
item.id
|
|
2595
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2596
|
+
"button",
|
|
2597
|
+
{
|
|
2598
|
+
type: "button",
|
|
2599
|
+
role: "menuitem",
|
|
2600
|
+
tabIndex: -1,
|
|
2601
|
+
className: rowClass,
|
|
2602
|
+
"data-testid": item.testId,
|
|
2603
|
+
onClick: () => choose(item),
|
|
2604
|
+
children: item.label
|
|
2605
|
+
},
|
|
2606
|
+
item.id
|
|
2607
|
+
);
|
|
2608
|
+
}) })
|
|
2486
2609
|
]
|
|
2487
2610
|
}
|
|
2488
|
-
)
|
|
2611
|
+
)
|
|
2612
|
+
] });
|
|
2613
|
+
}
|
|
2614
|
+
var Command = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2615
|
+
cmdk.Command,
|
|
2616
|
+
{
|
|
2617
|
+
ref,
|
|
2618
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
2619
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
2620
|
+
className
|
|
2621
|
+
),
|
|
2622
|
+
...props
|
|
2489
2623
|
}
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
tooltipContent,
|
|
2505
|
-
tooltipSide,
|
|
2506
|
-
chunkS6A6FSG7_cjs.cn(baseClasses, interactiveClasses),
|
|
2507
|
-
{ "data-testid": testId }
|
|
2508
|
-
);
|
|
2509
|
-
}
|
|
2510
|
-
return tooltipWrap(
|
|
2511
|
-
mainContent,
|
|
2512
|
-
tooltipContent,
|
|
2513
|
-
tooltipSide,
|
|
2514
|
-
chunkS6A6FSG7_cjs.cn(
|
|
2515
|
-
baseClasses,
|
|
2516
|
-
onClick && !disabled ? interactiveClasses : "",
|
|
2517
|
-
disabled ? disabledClasses : "",
|
|
2518
|
-
highlight && highlightClasses
|
|
2624
|
+
));
|
|
2625
|
+
Command.displayName = cmdk.Command.displayName;
|
|
2626
|
+
var CommandDialog = ({ children, ...props }) => {
|
|
2627
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.Dialog, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) });
|
|
2628
|
+
};
|
|
2629
|
+
var CommandInput = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b px-3", "data-cmdk-input-wrapper": "", children: [
|
|
2630
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
2631
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2632
|
+
cmdk.Command.Input,
|
|
2633
|
+
{
|
|
2634
|
+
ref,
|
|
2635
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
2636
|
+
"flex h-10 pointer-coarse:h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
2637
|
+
className
|
|
2519
2638
|
),
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2639
|
+
...props
|
|
2640
|
+
}
|
|
2641
|
+
)
|
|
2642
|
+
] }));
|
|
2643
|
+
CommandInput.displayName = cmdk.Command.Input.displayName;
|
|
2644
|
+
var CommandList = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2645
|
+
cmdk.Command.List,
|
|
2646
|
+
{
|
|
2647
|
+
ref,
|
|
2648
|
+
className: chunkS6A6FSG7_cjs.cn("max-h-[min(300px,50dvh)] overflow-y-auto overflow-x-hidden", className),
|
|
2649
|
+
...props
|
|
2528
2650
|
}
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
);
|
|
2651
|
+
));
|
|
2652
|
+
CommandList.displayName = cmdk.Command.List.displayName;
|
|
2653
|
+
var CommandEmpty = React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
|
|
2654
|
+
CommandEmpty.displayName = cmdk.Command.Empty.displayName;
|
|
2655
|
+
var CommandGroup = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2656
|
+
cmdk.Command.Group,
|
|
2657
|
+
{
|
|
2658
|
+
ref,
|
|
2659
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
2660
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
2661
|
+
className
|
|
2662
|
+
),
|
|
2663
|
+
...props
|
|
2543
2664
|
}
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
2553
|
-
baseClasses,
|
|
2554
|
-
disabled ? disabledClasses : interactiveClasses,
|
|
2555
|
-
highlight && highlightClasses
|
|
2556
|
-
),
|
|
2557
|
-
"data-testid": testId,
|
|
2558
|
-
children: mainContent
|
|
2559
|
-
}
|
|
2560
|
-
);
|
|
2665
|
+
));
|
|
2666
|
+
CommandGroup.displayName = cmdk.Command.Group.displayName;
|
|
2667
|
+
var CommandSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2668
|
+
cmdk.Command.Separator,
|
|
2669
|
+
{
|
|
2670
|
+
ref,
|
|
2671
|
+
className: chunkS6A6FSG7_cjs.cn("-mx-1 h-px bg-border", className),
|
|
2672
|
+
...props
|
|
2561
2673
|
}
|
|
2674
|
+
));
|
|
2675
|
+
CommandSeparator.displayName = cmdk.Command.Separator.displayName;
|
|
2676
|
+
var CommandItem = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2677
|
+
cmdk.Command.Item,
|
|
2678
|
+
{
|
|
2679
|
+
ref,
|
|
2680
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
2681
|
+
"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 pointer-coarse:min-h-11 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
2682
|
+
className
|
|
2683
|
+
),
|
|
2684
|
+
...props
|
|
2685
|
+
}
|
|
2686
|
+
));
|
|
2687
|
+
CommandItem.displayName = cmdk.Command.Item.displayName;
|
|
2688
|
+
var CommandShortcut = ({ className, ...props }) => {
|
|
2562
2689
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2563
2690
|
"span",
|
|
2564
2691
|
{
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
"data-testid": testId,
|
|
2568
|
-
children: mainContent
|
|
2692
|
+
className: chunkS6A6FSG7_cjs.cn("ml-auto text-sm tracking-widest text-muted-foreground", className),
|
|
2693
|
+
...props
|
|
2569
2694
|
}
|
|
2570
2695
|
);
|
|
2571
|
-
});
|
|
2572
|
-
var TAG_TYPE_LABELS = {
|
|
2573
|
-
checkbox: "Checkbox",
|
|
2574
|
-
select: "Select",
|
|
2575
|
-
number: "Number",
|
|
2576
|
-
text: "Text",
|
|
2577
|
-
folder: "Folder",
|
|
2578
|
-
search: "Saved Search",
|
|
2579
|
-
date: "Date",
|
|
2580
|
-
assistant: "AI Assistant"
|
|
2581
|
-
};
|
|
2582
|
-
var TAG_TYPE_ICONS = {
|
|
2583
|
-
checkbox: lucideReact.SquareCheckBig,
|
|
2584
|
-
select: lucideReact.List,
|
|
2585
|
-
number: lucideReact.Hash,
|
|
2586
|
-
text: lucideReact.NotebookPen,
|
|
2587
|
-
folder: lucideReact.Folder,
|
|
2588
|
-
search: lucideReact.Search,
|
|
2589
|
-
date: lucideReact.Calendar,
|
|
2590
|
-
assistant: lucideReact.Bot
|
|
2591
|
-
};
|
|
2592
|
-
function getTagTypeIcon(type) {
|
|
2593
|
-
return TAG_TYPE_ICONS[type ?? "text"] || lucideReact.NotebookPen;
|
|
2594
|
-
}
|
|
2595
|
-
function getTagTypeLabel(type) {
|
|
2596
|
-
const t = type ?? "text";
|
|
2597
|
-
return TAG_TYPE_LABELS[t] || t;
|
|
2598
|
-
}
|
|
2599
|
-
var BASE_COLORS = {
|
|
2600
|
-
"0": "#10b981",
|
|
2601
|
-
"1": "#3b82f6",
|
|
2602
|
-
"2": "#8b5cf6",
|
|
2603
|
-
"3": "#f43f5e",
|
|
2604
|
-
"4": "#f59e0b",
|
|
2605
|
-
"5": "#84cc16",
|
|
2606
|
-
"6": "#a855f7",
|
|
2607
|
-
"7": "#06b6d4",
|
|
2608
|
-
"8": "#f97316",
|
|
2609
|
-
"9": "#14b8a6",
|
|
2610
|
-
a: "#ef4444",
|
|
2611
|
-
b: "#6366f1",
|
|
2612
|
-
c: "#ec4899",
|
|
2613
|
-
d: "#22c55e",
|
|
2614
|
-
e: "#eab308",
|
|
2615
|
-
f: "#0ea5e9"
|
|
2616
2696
|
};
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
tag,
|
|
2622
|
-
size = "md",
|
|
2623
|
-
className = "",
|
|
2624
|
-
onClick,
|
|
2625
|
-
showTooltip = true,
|
|
2626
|
-
tooltipContent
|
|
2627
|
-
}) {
|
|
2628
|
-
const tagType = tag.tag_type?.type ?? "text";
|
|
2629
|
-
const iconSize = size === "sm" ? 12 : size === "md" ? 14 : 16;
|
|
2630
|
-
const Icon2 = getTagTypeIcon(tagType);
|
|
2631
|
-
const sizeClasses2 = {
|
|
2632
|
-
sm: "p-0.5",
|
|
2633
|
-
md: "p-1",
|
|
2634
|
-
lg: "p-1.5"
|
|
2635
|
-
};
|
|
2636
|
-
const tagColor = tag.color ?? getEntityColor(tag.external_id);
|
|
2637
|
-
const iconElement = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2638
|
-
"span",
|
|
2697
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
2698
|
+
var AI_COMPONENTS = {
|
|
2699
|
+
a: (p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2700
|
+
"a",
|
|
2639
2701
|
{
|
|
2640
|
-
className:
|
|
2641
|
-
|
|
2642
|
-
|
|
2702
|
+
className: "text-ai-accent underline underline-offset-2",
|
|
2703
|
+
target: "_blank",
|
|
2704
|
+
rel: "noopener noreferrer",
|
|
2705
|
+
...p
|
|
2643
2706
|
}
|
|
2644
|
-
)
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
] }),
|
|
2658
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5 text-sm", children: [
|
|
2659
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2660
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Type:" }),
|
|
2661
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: getTagTypeLabel(tagType) })
|
|
2662
|
-
] }),
|
|
2663
|
-
tag.doctag_count != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2664
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Documents:" }),
|
|
2665
|
-
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "secondary", className: "h-5 min-w-[20px] justify-center", children: tag.doctag_count ?? 0 })
|
|
2666
|
-
] }),
|
|
2667
|
-
tag.shared != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: tag.shared ? "Shared" : "Private" }) })
|
|
2668
|
-
] })
|
|
2669
|
-
] });
|
|
2670
|
-
const resolvedTooltip = showTooltip ? tooltipContent ?? defaultTooltip : void 0;
|
|
2707
|
+
),
|
|
2708
|
+
// Redline marks: deletions in red strike, <ins>/<mark> additions accented.
|
|
2709
|
+
del: (p) => /* @__PURE__ */ jsxRuntime.jsx("del", { className: "rounded bg-destructive/10 text-destructive decoration-destructive/60", ...p }),
|
|
2710
|
+
ins: (p) => /* @__PURE__ */ jsxRuntime.jsx("ins", { className: "rounded bg-ai-accent-soft px-0.5 text-ai-accent no-underline", ...p }),
|
|
2711
|
+
mark: (p) => /* @__PURE__ */ jsxRuntime.jsx("mark", { className: "rounded bg-ai-accent-soft px-0.5 text-ai-accent", ...p }),
|
|
2712
|
+
thead: (p) => /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-secondary/60", ...p })
|
|
2713
|
+
};
|
|
2714
|
+
function AiMarkdown({
|
|
2715
|
+
children,
|
|
2716
|
+
className,
|
|
2717
|
+
isStreaming,
|
|
2718
|
+
allowHtml
|
|
2719
|
+
}) {
|
|
2671
2720
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2672
|
-
|
|
2721
|
+
chunkOC7F5SNA_cjs.MarkdownRenderer,
|
|
2673
2722
|
{
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
onClick,
|
|
2681
|
-
className,
|
|
2682
|
-
"data-testid": `tag-entity-${tag.external_id}`
|
|
2723
|
+
className: className ?? "text-sm",
|
|
2724
|
+
components: AI_COMPONENTS,
|
|
2725
|
+
isStreaming,
|
|
2726
|
+
allowHtml,
|
|
2727
|
+
testId: "ai-markdown",
|
|
2728
|
+
children
|
|
2683
2729
|
}
|
|
2684
2730
|
);
|
|
2685
2731
|
}
|
|
@@ -3204,901 +3250,946 @@ var EmlIcon = ({ size = 16, className = "" }) => {
|
|
|
3204
3250
|
stroke: FILE_TYPE_COLORS.eml,
|
|
3205
3251
|
strokeWidth: "1",
|
|
3206
3252
|
strokeLinecap: "round",
|
|
3207
|
-
strokeLinejoin: "round"
|
|
3208
|
-
}
|
|
3209
|
-
),
|
|
3210
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3211
|
-
"path",
|
|
3212
|
-
{
|
|
3213
|
-
d: "M14 2v6h6",
|
|
3214
|
-
fill: "none",
|
|
3215
|
-
stroke: FILE_TYPE_COLORS.white,
|
|
3216
|
-
strokeWidth: "1",
|
|
3217
|
-
strokeLinecap: "round",
|
|
3218
|
-
strokeLinejoin: "round"
|
|
3219
|
-
}
|
|
3220
|
-
),
|
|
3221
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3222
|
-
"rect",
|
|
3223
|
-
{
|
|
3224
|
-
x: "7",
|
|
3225
|
-
y: "12",
|
|
3226
|
-
width: "10",
|
|
3227
|
-
height: "7",
|
|
3228
|
-
rx: "1",
|
|
3229
|
-
fill: "none",
|
|
3230
|
-
stroke: "white",
|
|
3231
|
-
strokeWidth: "1.2"
|
|
3232
|
-
}
|
|
3233
|
-
),
|
|
3234
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 13l5 3 5-3", fill: "none", stroke: "white", strokeWidth: "1.2", strokeLinejoin: "round" })
|
|
3235
|
-
]
|
|
3236
|
-
}
|
|
3237
|
-
);
|
|
3238
|
-
};
|
|
3239
|
-
var ArbiIcon = ({
|
|
3240
|
-
size = 20,
|
|
3241
|
-
className = "",
|
|
3242
|
-
"aria-label": ariaLabel = "ARBI Docs",
|
|
3243
|
-
"aria-hidden": ariaHidden = false
|
|
3244
|
-
}) => {
|
|
3245
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3246
|
-
"img",
|
|
3247
|
-
{
|
|
3248
|
-
src: "/favicon.svg",
|
|
3249
|
-
alt: ariaLabel,
|
|
3250
|
-
className: `rounded object-contain ${className}`,
|
|
3251
|
-
style: { width: size, height: size },
|
|
3252
|
-
"aria-label": ariaLabel,
|
|
3253
|
-
"aria-hidden": ariaHidden
|
|
3254
|
-
}
|
|
3255
|
-
);
|
|
3256
|
-
};
|
|
3257
|
-
var ArbiBotHeadIcon = ({ size = 24, className = "" }) => {
|
|
3258
|
-
const maskId = React.useId();
|
|
3259
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3260
|
-
"svg",
|
|
3261
|
-
{
|
|
3262
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3263
|
-
width: size,
|
|
3264
|
-
height: size,
|
|
3265
|
-
viewBox: "30 -5 190 190",
|
|
3266
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
3267
|
-
className,
|
|
3268
|
-
children: [
|
|
3269
|
-
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("mask", { id: maskId, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(0,250) scale(0.1,-0.1)", children: [
|
|
3270
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0", y: "0", width: "2500", height: "2500", fill: "white" }),
|
|
3271
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "855", cy: "1715", r: "190", fill: "black" }),
|
|
3272
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "855", cy: "1715", r: "50", fill: "white" }),
|
|
3273
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "1665", cy: "1700", r: "190", fill: "black" }),
|
|
3274
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "1665", cy: "1700", r: "50", fill: "white" })
|
|
3275
|
-
] }) }) }),
|
|
3276
|
-
/* @__PURE__ */ jsxRuntime.jsxs("g", { mask: `url(#${maskId})`, children: [
|
|
3277
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3278
|
-
"g",
|
|
3279
|
-
{
|
|
3280
|
-
transform: "translate(0,250) scale(0.1,-0.1)",
|
|
3281
|
-
fill: "currentColor",
|
|
3282
|
-
stroke: "currentColor",
|
|
3283
|
-
strokeWidth: "100",
|
|
3284
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1038 2434 c-217 -39 -406 -154 -522 -318 -121 -170 -176 -376 -103 -384 l27 -3 0 -106 c0 -88 -3 -108 -17 -118 -15 -11 -16 -18 -5 -66 44 -188 209 -369 420 -459 l65 -28 -74 -7 c-283 -26 -444 -152 -535 -418 -70 -204 -73 -507 -5 -507 4 0 12 75 19 168 18 263 68 419 167 530 78 87 224 162 263 134 9 -6 43 -26 76 -43 224 -117 802 -95 948 38 38 34 165 -22 253 -111 117 -119 168 -268 187 -549 6 -92 15 -167 19 -167 89 0 53 415 -54 627 -88 173 -238 270 -458 295 l-99 11 75 32 c201 88 367 274 406 454 10 47 9 56 -5 66 -13 10 -16 32 -16 118 l0 106 28 3 c91 10 -12 297 -165 459 -202 214 -544 307 -895 243z m472 -84 c170 -43 323 -140 416 -264 47 -61 117 -197 128 -248 l6 -28 -65 0 c-64 0 -65 1 -78 33 -43 102 -109 136 -262 137 l-110 0 -38 -40 c-25 -27 -46 -40 -65 -41 -134 -5 -394 1 -410 10 -11 6 -30 24 -42 41 l-21 30 -112 0 c-156 -1 -219 -33 -262 -136 -14 -34 -14 -34 -80 -34 -76 0 -74 -7 -30 103 96 243 311 406 595 452 118 20 319 13 430 -15z m-561 -505 c97 -50 126 -174 61 -263 -118 -163 -380 -23 -309 165 35 93 162 143 248 98z m799 -15 c129 -96 69 -304 -92 -318 -189 -16 -265 218 -106 326 48 33 149 29 198 -8z m272 -389 c0 -23 -45 -110 -86 -168 -245 -343 -856 -408 -1231 -130 -90 67 -213 236 -213 294 0 11 132 13 765 13 457 0 765 -4 765 -9z" })
|
|
3285
|
-
}
|
|
3286
|
-
),
|
|
3287
|
-
/* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(0,250) scale(0.1,-0.1)", fill: "currentColor", stroke: "none", children: [
|
|
3288
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M785 1777 c-60 -60 -59 -134 1 -186 92 -82 236 9 204 128 -25 93 -138 125 -205 58z m161 -29 c7 -22 -19 -52 -40 -45 -21 7 -30 35 -17 51 19 23 48 20 57 -6z" }),
|
|
3289
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1591 1803 c-128 -67 -85 -243 60 -243 83 0 141 99 105 178 -32 69 -103 97 -165 65z m127 -59 c4 -25 -19 -47 -41 -38 -22 8 -30 34 -16 51 17 20 53 12 57 -13z" }),
|
|
3290
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M843 1347 c-9 -15 9 -63 41 -108 148 -202 565 -209 730 -12 37 44 60 103 47 116 -13 13 -810 17 -818 4z" })
|
|
3291
|
-
] })
|
|
3292
|
-
] })
|
|
3293
|
-
]
|
|
3294
|
-
}
|
|
3295
|
-
);
|
|
3296
|
-
};
|
|
3297
|
-
function ThreadVisibilityIcon({
|
|
3298
|
-
shared,
|
|
3299
|
-
className,
|
|
3300
|
-
...props
|
|
3301
|
-
}) {
|
|
3302
|
-
const Icon2 = shared ? lucideReact.MessageSquareShare : lucideReact.MessageSquareLock;
|
|
3303
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { ...props, className: chunkS6A6FSG7_cjs.cn(shared ? "text-secondary" : "text-primary", className) });
|
|
3304
|
-
}
|
|
3305
|
-
function getDocumentTitle(document2, defaultValue = "") {
|
|
3306
|
-
if (!document2) return defaultValue;
|
|
3307
|
-
return document2.doc_metadata?.title || document2.file_name || defaultValue;
|
|
3308
|
-
}
|
|
3309
|
-
var MAX_LABEL_CHARS = 30;
|
|
3310
|
-
function clampLabel(text) {
|
|
3311
|
-
return text.length > MAX_LABEL_CHARS ? `${text.slice(0, MAX_LABEL_CHARS).trimEnd()}\u2026` : text;
|
|
3312
|
-
}
|
|
3313
|
-
var IMAGE_EXTENSIONS = /* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "bmp", "tiff", "tif", "webp"]);
|
|
3314
|
-
var VIDEO_EXTENSIONS = /* @__PURE__ */ new Set(["mp4", "mpeg", "mpg", "webm", "mov", "avi", "mkv"]);
|
|
3315
|
-
var AUDIO_EXTENSIONS = /* @__PURE__ */ new Set(["mp3", "wav", "m4a", "aac", "ogg", "flac"]);
|
|
3316
|
-
var EMAIL_EXTENSIONS = /* @__PURE__ */ new Set(["eml", "msg"]);
|
|
3317
|
-
var DOCX_EXTENSIONS = /* @__PURE__ */ new Set(["doc", "docx", "odt", "rtf"]);
|
|
3318
|
-
var XLSX_EXTENSIONS = /* @__PURE__ */ new Set(["xls", "xlsx", "csv", "ods"]);
|
|
3319
|
-
var HTML_EXTENSIONS = /* @__PURE__ */ new Set(["html", "htm", "mhtml"]);
|
|
3320
|
-
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
3321
|
-
"txt",
|
|
3322
|
-
"text",
|
|
3323
|
-
"md",
|
|
3324
|
-
"markdown",
|
|
3325
|
-
"log",
|
|
3326
|
-
"json",
|
|
3327
|
-
"xml",
|
|
3328
|
-
"yaml",
|
|
3329
|
-
"yml"
|
|
3330
|
-
]);
|
|
3331
|
-
function getDocIcon(fileName, iconSize = 14) {
|
|
3332
|
-
const ext = fileName?.split(".").pop()?.toLowerCase();
|
|
3333
|
-
if (ext && VIDEO_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(VidIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3334
|
-
if (ext && AUDIO_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(AudIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3335
|
-
if (ext && IMAGE_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(ImgIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3336
|
-
if (ext && EMAIL_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(EmlIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3337
|
-
if (ext && DOCX_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(DocIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3338
|
-
if (ext && XLSX_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(XlsIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3339
|
-
if (ext && HTML_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(HtmlIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3340
|
-
if (ext && TEXT_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(TxtIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3341
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PdfIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3342
|
-
}
|
|
3343
|
-
function DocumentEntity({
|
|
3344
|
-
doc,
|
|
3345
|
-
icon,
|
|
3346
|
-
size = "sm",
|
|
3347
|
-
labelMaxWidth,
|
|
3348
|
-
labelClassName,
|
|
3349
|
-
onClick,
|
|
3350
|
-
onIconClick,
|
|
3351
|
-
viewing,
|
|
3352
|
-
iconBadge,
|
|
3353
|
-
status,
|
|
3354
|
-
actions,
|
|
3355
|
-
tooltipContent,
|
|
3356
|
-
className,
|
|
3357
|
-
fullWidth,
|
|
3358
|
-
noClamp,
|
|
3359
|
-
"data-testid": testId
|
|
3360
|
-
}) {
|
|
3361
|
-
const title = getDocumentTitle(doc);
|
|
3362
|
-
const ext = doc.file_name?.split(".").pop()?.toLowerCase();
|
|
3363
|
-
const iconSize = size === "base" ? 16 : 14;
|
|
3364
|
-
const eyeSizeClass = size === "base" ? "h-4 w-4" : "h-3.5 w-3.5";
|
|
3365
|
-
const baseIcon = icon ?? getDocIcon(doc.file_name, iconSize);
|
|
3366
|
-
const displayIcon = viewing || iconBadge ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex flex-shrink-0 items-center justify-center", children: [
|
|
3367
|
-
viewing ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: chunkS6A6FSG7_cjs.cn("text-primary-foreground", eyeSizeClass) }) : baseIcon,
|
|
3368
|
-
iconBadge
|
|
3369
|
-
] }) : baseIcon;
|
|
3370
|
-
const defaultTooltip = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 text-xs max-w-[440px]", children: [
|
|
3371
|
-
doc.folder && // `flex-wrap` so a deep folder path wraps WITHIN the balloon instead of
|
|
3372
|
-
// spilling out of it (each path segment is atomic and wraps as a unit;
|
|
3373
|
-
// `min-w-0` + `break-all` lets a single over-long segment break too).
|
|
3374
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-wrap items-center gap-0.5 text-muted-foreground", children: [
|
|
3375
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpen, { className: "h-3 w-3 text-yellow-600 shrink-0" }),
|
|
3376
|
-
doc.folder.split("/").map((part, i, arr) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-0.5", children: [
|
|
3377
|
-
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/50 mx-0.5", children: "/" }),
|
|
3378
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `break-all ${i < arr.length - 1 ? "text-muted-foreground/70" : ""}`, children: part })
|
|
3379
|
-
] }, i))
|
|
3380
|
-
] }),
|
|
3381
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium break-words", children: [
|
|
3382
|
-
title,
|
|
3383
|
-
ext ? `.${ext}` : ""
|
|
3384
|
-
] })
|
|
3385
|
-
] });
|
|
3386
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3387
|
-
EntityPill,
|
|
3388
|
-
{
|
|
3389
|
-
icon: displayIcon,
|
|
3390
|
-
size,
|
|
3391
|
-
label: fullWidth || noClamp ? title : clampLabel(title),
|
|
3392
|
-
labelMaxWidth: labelMaxWidth ?? "max-w-[140px]",
|
|
3393
|
-
labelClassName,
|
|
3394
|
-
secondaryText: status,
|
|
3395
|
-
fullWidth,
|
|
3396
|
-
onClick,
|
|
3397
|
-
onIconClick,
|
|
3398
|
-
moreContent: actions,
|
|
3399
|
-
className,
|
|
3400
|
-
highlight: viewing,
|
|
3401
|
-
"data-testid": testId,
|
|
3402
|
-
tooltipContent: tooltipContent ?? defaultTooltip
|
|
3253
|
+
strokeLinejoin: "round"
|
|
3254
|
+
}
|
|
3255
|
+
),
|
|
3256
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3257
|
+
"path",
|
|
3258
|
+
{
|
|
3259
|
+
d: "M14 2v6h6",
|
|
3260
|
+
fill: "none",
|
|
3261
|
+
stroke: FILE_TYPE_COLORS.white,
|
|
3262
|
+
strokeWidth: "1",
|
|
3263
|
+
strokeLinecap: "round",
|
|
3264
|
+
strokeLinejoin: "round"
|
|
3265
|
+
}
|
|
3266
|
+
),
|
|
3267
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3268
|
+
"rect",
|
|
3269
|
+
{
|
|
3270
|
+
x: "7",
|
|
3271
|
+
y: "12",
|
|
3272
|
+
width: "10",
|
|
3273
|
+
height: "7",
|
|
3274
|
+
rx: "1",
|
|
3275
|
+
fill: "none",
|
|
3276
|
+
stroke: "white",
|
|
3277
|
+
strokeWidth: "1.2"
|
|
3278
|
+
}
|
|
3279
|
+
),
|
|
3280
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 13l5 3 5-3", fill: "none", stroke: "white", strokeWidth: "1.2", strokeLinejoin: "round" })
|
|
3281
|
+
]
|
|
3403
3282
|
}
|
|
3404
3283
|
);
|
|
3405
|
-
}
|
|
3406
|
-
var VARIANT_STYLES = {
|
|
3407
|
-
"mine-paid": {
|
|
3408
|
-
pill: "text-primary",
|
|
3409
|
-
icon: "text-primary"
|
|
3410
|
-
},
|
|
3411
|
-
other: {
|
|
3412
|
-
pill: "text-secondary",
|
|
3413
|
-
icon: "text-secondary"
|
|
3414
|
-
},
|
|
3415
|
-
"mine-free": {
|
|
3416
|
-
pill: "text-muted-foreground",
|
|
3417
|
-
icon: "text-muted-foreground"
|
|
3418
|
-
},
|
|
3419
|
-
common: {
|
|
3420
|
-
pill: "",
|
|
3421
|
-
icon: "text-muted-foreground"
|
|
3422
|
-
}
|
|
3423
3284
|
};
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
}
|
|
3431
|
-
function ProjectEntity({
|
|
3432
|
-
name,
|
|
3433
|
-
label,
|
|
3434
|
-
icon,
|
|
3435
|
-
subscription = "none",
|
|
3436
|
-
hasCollaborators = false,
|
|
3437
|
-
size = "sm",
|
|
3438
|
-
className,
|
|
3439
|
-
onClick,
|
|
3440
|
-
relation,
|
|
3441
|
-
isPaid,
|
|
3442
|
-
tooltipContent
|
|
3443
|
-
}) {
|
|
3444
|
-
const paid = isPaid ?? (subscription === "active" || subscription === "past_due" || subscription === "dev");
|
|
3445
|
-
const variant = resolveVariant(relation, paid, hasCollaborators);
|
|
3446
|
-
const { pill, icon: iconClass } = VARIANT_STYLES[variant];
|
|
3447
|
-
const iconSizeClass = size === "base" ? "h-4 w-4" : "h-3.5 w-3.5";
|
|
3448
|
-
const iconNode = icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: chunkS6A6FSG7_cjs.cn(iconSizeClass, iconClass) });
|
|
3285
|
+
var ArbiIcon = ({
|
|
3286
|
+
size = 20,
|
|
3287
|
+
className = "",
|
|
3288
|
+
"aria-label": ariaLabel = "ARBI Docs",
|
|
3289
|
+
"aria-hidden": ariaHidden = false
|
|
3290
|
+
}) => {
|
|
3449
3291
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3450
|
-
|
|
3292
|
+
"img",
|
|
3451
3293
|
{
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
tooltipContent
|
|
3294
|
+
src: "/favicon.svg",
|
|
3295
|
+
alt: ariaLabel,
|
|
3296
|
+
className: `rounded object-contain ${className}`,
|
|
3297
|
+
style: { width: size, height: size },
|
|
3298
|
+
"aria-label": ariaLabel,
|
|
3299
|
+
"aria-hidden": ariaHidden
|
|
3459
3300
|
}
|
|
3460
3301
|
);
|
|
3461
|
-
}
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3302
|
+
};
|
|
3303
|
+
var ArbiBotHeadIcon = ({ size = 24, className = "" }) => {
|
|
3304
|
+
const maskId = React.useId();
|
|
3305
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3306
|
+
"svg",
|
|
3465
3307
|
{
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3308
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3309
|
+
width: size,
|
|
3310
|
+
height: size,
|
|
3311
|
+
viewBox: "30 -5 190 190",
|
|
3312
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3313
|
+
className,
|
|
3314
|
+
children: [
|
|
3315
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("mask", { id: maskId, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(0,250) scale(0.1,-0.1)", children: [
|
|
3316
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0", y: "0", width: "2500", height: "2500", fill: "white" }),
|
|
3317
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "855", cy: "1715", r: "190", fill: "black" }),
|
|
3318
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "855", cy: "1715", r: "50", fill: "white" }),
|
|
3319
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "1665", cy: "1700", r: "190", fill: "black" }),
|
|
3320
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "1665", cy: "1700", r: "50", fill: "white" })
|
|
3321
|
+
] }) }) }),
|
|
3322
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { mask: `url(#${maskId})`, children: [
|
|
3323
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3324
|
+
"g",
|
|
3325
|
+
{
|
|
3326
|
+
transform: "translate(0,250) scale(0.1,-0.1)",
|
|
3327
|
+
fill: "currentColor",
|
|
3328
|
+
stroke: "currentColor",
|
|
3329
|
+
strokeWidth: "100",
|
|
3330
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1038 2434 c-217 -39 -406 -154 -522 -318 -121 -170 -176 -376 -103 -384 l27 -3 0 -106 c0 -88 -3 -108 -17 -118 -15 -11 -16 -18 -5 -66 44 -188 209 -369 420 -459 l65 -28 -74 -7 c-283 -26 -444 -152 -535 -418 -70 -204 -73 -507 -5 -507 4 0 12 75 19 168 18 263 68 419 167 530 78 87 224 162 263 134 9 -6 43 -26 76 -43 224 -117 802 -95 948 38 38 34 165 -22 253 -111 117 -119 168 -268 187 -549 6 -92 15 -167 19 -167 89 0 53 415 -54 627 -88 173 -238 270 -458 295 l-99 11 75 32 c201 88 367 274 406 454 10 47 9 56 -5 66 -13 10 -16 32 -16 118 l0 106 28 3 c91 10 -12 297 -165 459 -202 214 -544 307 -895 243z m472 -84 c170 -43 323 -140 416 -264 47 -61 117 -197 128 -248 l6 -28 -65 0 c-64 0 -65 1 -78 33 -43 102 -109 136 -262 137 l-110 0 -38 -40 c-25 -27 -46 -40 -65 -41 -134 -5 -394 1 -410 10 -11 6 -30 24 -42 41 l-21 30 -112 0 c-156 -1 -219 -33 -262 -136 -14 -34 -14 -34 -80 -34 -76 0 -74 -7 -30 103 96 243 311 406 595 452 118 20 319 13 430 -15z m-561 -505 c97 -50 126 -174 61 -263 -118 -163 -380 -23 -309 165 35 93 162 143 248 98z m799 -15 c129 -96 69 -304 -92 -318 -189 -16 -265 218 -106 326 48 33 149 29 198 -8z m272 -389 c0 -23 -45 -110 -86 -168 -245 -343 -856 -408 -1231 -130 -90 67 -213 236 -213 294 0 11 132 13 765 13 457 0 765 -4 765 -9z" })
|
|
3331
|
+
}
|
|
3332
|
+
),
|
|
3333
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(0,250) scale(0.1,-0.1)", fill: "currentColor", stroke: "none", children: [
|
|
3334
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M785 1777 c-60 -60 -59 -134 1 -186 92 -82 236 9 204 128 -25 93 -138 125 -205 58z m161 -29 c7 -22 -19 -52 -40 -45 -21 7 -30 35 -17 51 19 23 48 20 57 -6z" }),
|
|
3335
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1591 1803 c-128 -67 -85 -243 60 -243 83 0 141 99 105 178 -32 69 -103 97 -165 65z m127 -59 c4 -25 -19 -47 -41 -38 -22 8 -30 34 -16 51 17 20 53 12 57 -13z" }),
|
|
3336
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M843 1347 c-9 -15 9 -63 41 -108 148 -202 565 -209 730 -12 37 44 60 103 47 116 -13 13 -810 17 -818 4z" })
|
|
3337
|
+
] })
|
|
3338
|
+
] })
|
|
3339
|
+
]
|
|
3471
3340
|
}
|
|
3472
3341
|
);
|
|
3473
|
-
}
|
|
3474
|
-
var sizeClasses = {
|
|
3475
|
-
xs: "h-5 w-5",
|
|
3476
|
-
sm: "h-6 w-6",
|
|
3477
|
-
md: "h-8 w-8",
|
|
3478
|
-
lg: "h-10 w-10"
|
|
3479
|
-
};
|
|
3480
|
-
var textSizeClasses = {
|
|
3481
|
-
xs: "text-xs",
|
|
3482
|
-
sm: "text-xs",
|
|
3483
|
-
md: "text-xs",
|
|
3484
|
-
lg: "text-sm"
|
|
3485
|
-
};
|
|
3486
|
-
var presenceDotClasses = {
|
|
3487
|
-
xs: "w-2 h-2 border",
|
|
3488
|
-
sm: "w-2.5 h-2.5 border",
|
|
3489
|
-
md: "w-3 h-3 border-2",
|
|
3490
|
-
lg: "w-3.5 h-3.5 border-2"
|
|
3491
|
-
};
|
|
3492
|
-
var presencePositionClasses = {
|
|
3493
|
-
xs: "-right-1 bottom-0",
|
|
3494
|
-
sm: "-right-1 bottom-0",
|
|
3495
|
-
md: "-right-1.5 -bottom-0.5",
|
|
3496
|
-
lg: "-right-1.5 -bottom-0.5"
|
|
3497
|
-
};
|
|
3498
|
-
var PRESENCE_LABELS = {
|
|
3499
|
-
connected: "Online",
|
|
3500
|
-
connecting: "Connecting",
|
|
3501
|
-
disconnected: "Offline",
|
|
3502
|
-
error: "Connection problem",
|
|
3503
|
-
hidden: "Status hidden"
|
|
3504
|
-
};
|
|
3505
|
-
var presenceColorClasses = {
|
|
3506
|
-
connected: "bg-status-online",
|
|
3507
|
-
connecting: "bg-status-connecting",
|
|
3508
|
-
disconnected: "bg-status-away",
|
|
3509
|
-
error: "bg-status-busy",
|
|
3510
|
-
hidden: "bg-status-offline"
|
|
3511
3342
|
};
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
variant = "pill",
|
|
3343
|
+
function ThreadVisibilityIcon({
|
|
3344
|
+
shared,
|
|
3515
3345
|
className,
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3346
|
+
...props
|
|
3347
|
+
}) {
|
|
3348
|
+
const Icon2 = shared ? lucideReact.MessageSquareShare : lucideReact.MessageSquareLock;
|
|
3349
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { ...props, className: chunkS6A6FSG7_cjs.cn(shared ? "text-secondary" : "text-primary", className) });
|
|
3350
|
+
}
|
|
3351
|
+
var EntityPill = React.forwardRef(function EntityPill2({
|
|
3352
|
+
icon,
|
|
3353
|
+
label,
|
|
3354
|
+
secondaryText,
|
|
3355
|
+
size = "sm",
|
|
3356
|
+
shape = "rounded",
|
|
3357
|
+
className,
|
|
3358
|
+
labelMaxWidth = "max-w-[320px]",
|
|
3359
|
+
labelClassName,
|
|
3360
|
+
fullWidth = false,
|
|
3361
|
+
highlight = false,
|
|
3530
3362
|
onClick,
|
|
3363
|
+
onIconClick,
|
|
3364
|
+
onMoreClick,
|
|
3365
|
+
moreContent,
|
|
3366
|
+
href,
|
|
3367
|
+
disabled = false,
|
|
3531
3368
|
tooltipContent,
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3369
|
+
tooltipSide = "bottom",
|
|
3370
|
+
"data-testid": testId
|
|
3371
|
+
}, ref) {
|
|
3372
|
+
const shapeClass = shape === "pill" ? "rounded-full" : "rounded-md";
|
|
3373
|
+
const sizeClasses2 = size === "base" ? "gap-1.5 px-1.5 py-0.5" : "gap-1 px-1";
|
|
3374
|
+
const textSizeClass = size === "base" ? "text-base" : "text-sm";
|
|
3375
|
+
const baseClasses = chunkS6A6FSG7_cjs.cn(
|
|
3376
|
+
"group/pill items-center",
|
|
3377
|
+
fullWidth ? "flex w-full" : "inline-flex",
|
|
3378
|
+
sizeClasses2,
|
|
3379
|
+
shapeClass,
|
|
3380
|
+
"border border-transparent",
|
|
3381
|
+
"transition-colors",
|
|
3382
|
+
className
|
|
3383
|
+
);
|
|
3384
|
+
const interactiveClasses = "relative cursor-pointer hover:bg-muted pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']";
|
|
3385
|
+
const disabledClasses = "cursor-default opacity-60";
|
|
3386
|
+
const highlightClasses = "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground";
|
|
3387
|
+
const mainContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3388
|
+
onIconClick ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3389
|
+
"span",
|
|
3390
|
+
{
|
|
3391
|
+
role: "button",
|
|
3392
|
+
tabIndex: 0,
|
|
3393
|
+
className: "flex-shrink-0 cursor-pointer hover:opacity-70 transition-opacity",
|
|
3394
|
+
onClick: (e) => {
|
|
3395
|
+
e.stopPropagation();
|
|
3396
|
+
onIconClick(e);
|
|
3397
|
+
},
|
|
3398
|
+
children: icon
|
|
3399
|
+
}
|
|
3400
|
+
) : icon,
|
|
3401
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3402
|
+
"span",
|
|
3537
3403
|
{
|
|
3538
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
3539
|
-
|
|
3540
|
-
|
|
3404
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
3405
|
+
textSizeClass,
|
|
3406
|
+
"font-medium truncate leading-tight min-w-0",
|
|
3407
|
+
labelMaxWidth,
|
|
3408
|
+
labelClassName
|
|
3409
|
+
),
|
|
3410
|
+
children: label
|
|
3541
3411
|
}
|
|
3542
|
-
)
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
const
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
{
|
|
3562
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
3563
|
-
textSizeClasses[size],
|
|
3564
|
-
"font-semibold leading-none",
|
|
3565
|
-
isAgent ? "rounded-full bg-transparent" : `text-white ${colorClass}`
|
|
3566
|
-
),
|
|
3567
|
-
style: surfaceStyle,
|
|
3568
|
-
children: initials
|
|
3569
|
-
}
|
|
3570
|
-
)
|
|
3571
|
-
]
|
|
3572
|
-
}
|
|
3412
|
+
),
|
|
3413
|
+
secondaryText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground flex-shrink-0 leading-none", children: secondaryText })
|
|
3414
|
+
] });
|
|
3415
|
+
const tooltipWrap = (content, tip, side = tooltipSide, triggerClassName, triggerProps) => /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
3416
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3417
|
+
TooltipTrigger,
|
|
3418
|
+
{
|
|
3419
|
+
onFocusCapture: (e) => e.stopPropagation(),
|
|
3420
|
+
className: triggerClassName,
|
|
3421
|
+
...triggerProps,
|
|
3422
|
+
children: content
|
|
3423
|
+
}
|
|
3424
|
+
),
|
|
3425
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side, className: "p-2", children: tip })
|
|
3426
|
+
] });
|
|
3427
|
+
const mainAreaClass = chunkS6A6FSG7_cjs.cn("inline-flex items-center gap-1", fullWidth && "min-w-0 flex-1");
|
|
3428
|
+
const mainAreaTouchClass = chunkS6A6FSG7_cjs.cn(
|
|
3429
|
+
mainAreaClass,
|
|
3430
|
+
(onClick || href) && !disabled && "relative pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']"
|
|
3573
3431
|
);
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
{
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
),
|
|
3583
|
-
style: showUnread ? { backgroundColor: "#00adef" } : void 0,
|
|
3584
|
-
"data-testid": "user-entity-presence",
|
|
3585
|
-
role: "img",
|
|
3586
|
-
"aria-label": showUnread ? "Unread messages" : PRESENCE_LABELS[displayStatus],
|
|
3587
|
-
title: showUnread ? "Unread messages" : PRESENCE_LABELS[displayStatus]
|
|
3588
|
-
}
|
|
3589
|
-
) : null;
|
|
3590
|
-
const avatarElement = statusDot ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3591
|
-
"div",
|
|
3592
|
-
{
|
|
3593
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
3594
|
-
"relative inline-block",
|
|
3595
|
-
sizeClasses[size],
|
|
3596
|
-
variant === "pill" ? "" : className
|
|
3597
|
-
),
|
|
3598
|
-
children: [
|
|
3599
|
-
avatarCore,
|
|
3600
|
-
statusDot
|
|
3601
|
-
]
|
|
3602
|
-
}
|
|
3603
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkS6A6FSG7_cjs.cn("inline-block", variant === "pill" ? "" : className), children: avatarCore });
|
|
3604
|
-
const pillAvatar = (
|
|
3605
|
-
// shrink-0: when the pill is squeezed the NAME truncates away — the avatar
|
|
3606
|
-
// must never collapse under it and overflow onto neighbouring text.
|
|
3607
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: chunkS6A6FSG7_cjs.cn("relative inline-block shrink-0", sizeClasses[size]), children: [
|
|
3608
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkS6A6FSG7_cjs.cn("block transition-opacity", canMessage && "group-hover/pill:opacity-0"), children: avatarCore }),
|
|
3609
|
-
canMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3610
|
-
"span",
|
|
3432
|
+
if (onMoreClick || moreContent) {
|
|
3433
|
+
let mainArea;
|
|
3434
|
+
if (tooltipContent) {
|
|
3435
|
+
mainArea = tooltipWrap(
|
|
3436
|
+
mainContent,
|
|
3437
|
+
tooltipContent,
|
|
3438
|
+
tooltipSide,
|
|
3439
|
+
chunkS6A6FSG7_cjs.cn(mainAreaTouchClass, disabled && "opacity-60"),
|
|
3611
3440
|
{
|
|
3612
|
-
"
|
|
3613
|
-
|
|
3614
|
-
|
|
3441
|
+
type: "button",
|
|
3442
|
+
onClick: href ? onClick : disabled ? void 0 : onClick,
|
|
3443
|
+
disabled: disabled || void 0
|
|
3615
3444
|
}
|
|
3616
|
-
)
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
if (resolvedTooltip) {
|
|
3632
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
3633
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3634
|
-
TooltipTrigger,
|
|
3635
|
-
{
|
|
3636
|
-
type: "button",
|
|
3637
|
-
onClick: clickable ? onClick : void 0,
|
|
3638
|
-
onFocusCapture: (e) => e.stopPropagation(),
|
|
3639
|
-
className: chunkS6A6FSG7_cjs.cn(rowClass, clickable && clickableClass, className),
|
|
3640
|
-
"data-testid": "user-entity-pill",
|
|
3641
|
-
children: row
|
|
3642
|
-
}
|
|
3643
|
-
),
|
|
3644
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { className: "p-2", children: resolvedTooltip })
|
|
3645
|
-
] });
|
|
3646
|
-
}
|
|
3647
|
-
if (clickable) {
|
|
3648
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3445
|
+
);
|
|
3446
|
+
} else if (href) {
|
|
3447
|
+
mainArea = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3448
|
+
"a",
|
|
3449
|
+
{
|
|
3450
|
+
href,
|
|
3451
|
+
target: "_blank",
|
|
3452
|
+
rel: "noopener noreferrer",
|
|
3453
|
+
className: mainAreaTouchClass,
|
|
3454
|
+
onClick,
|
|
3455
|
+
children: mainContent
|
|
3456
|
+
}
|
|
3457
|
+
);
|
|
3458
|
+
} else if (onClick) {
|
|
3459
|
+
mainArea = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3649
3460
|
"button",
|
|
3650
3461
|
{
|
|
3651
3462
|
type: "button",
|
|
3652
|
-
onClick,
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3463
|
+
onClick: disabled ? void 0 : onClick,
|
|
3464
|
+
disabled,
|
|
3465
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
3466
|
+
"relative inline-flex items-center gap-1 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']",
|
|
3467
|
+
disabled && "opacity-60"
|
|
3468
|
+
),
|
|
3469
|
+
children: mainContent
|
|
3656
3470
|
}
|
|
3657
3471
|
);
|
|
3472
|
+
} else {
|
|
3473
|
+
mainArea = /* @__PURE__ */ jsxRuntime.jsx("span", { className: mainAreaTouchClass, children: mainContent });
|
|
3658
3474
|
}
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3475
|
+
const moreArea = moreContent ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 leading-none", children: moreContent }) : tooltipWrap(
|
|
3476
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "w-3.5 h-3.5" }),
|
|
3477
|
+
"Click for more",
|
|
3478
|
+
tooltipSide,
|
|
3479
|
+
"flex-shrink-0 leading-none text-muted-foreground hover:text-foreground",
|
|
3480
|
+
{
|
|
3481
|
+
type: "button",
|
|
3482
|
+
onClick: (e) => {
|
|
3483
|
+
e.stopPropagation();
|
|
3484
|
+
onMoreClick?.(e);
|
|
3669
3485
|
}
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3486
|
+
}
|
|
3487
|
+
);
|
|
3488
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3489
|
+
"span",
|
|
3490
|
+
{
|
|
3491
|
+
ref,
|
|
3492
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
3493
|
+
baseClasses,
|
|
3494
|
+
(onClick || href) && !disabled && "cursor-pointer hover:bg-muted",
|
|
3495
|
+
highlight && highlightClasses
|
|
3496
|
+
),
|
|
3497
|
+
"data-testid": testId,
|
|
3498
|
+
children: [
|
|
3499
|
+
mainArea,
|
|
3500
|
+
moreArea
|
|
3501
|
+
]
|
|
3502
|
+
}
|
|
3503
|
+
);
|
|
3673
3504
|
}
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3678
|
-
"span",
|
|
3679
|
-
{
|
|
3680
|
-
"data-testid": "agent-badge",
|
|
3681
|
-
className: chunkS6A6FSG7_cjs.cn(
|
|
3682
|
-
"inline-flex shrink-0 items-center gap-1 rounded-full border border-ai-accent/50",
|
|
3683
|
-
"bg-ai-accent-soft px-2 py-0.5 text-xs font-bold uppercase tracking-wider text-ai-accent",
|
|
3684
|
-
className
|
|
3685
|
-
),
|
|
3686
|
-
children: [
|
|
3687
|
-
/* @__PURE__ */ jsxRuntime.jsx(ArbiBotHeadIcon, { size: 14, className: "text-ai-accent" }),
|
|
3688
|
-
"Agent"
|
|
3689
|
-
]
|
|
3690
|
-
}
|
|
3691
|
-
);
|
|
3692
|
-
}
|
|
3693
|
-
var PRESENCE_WORDS = {
|
|
3694
|
-
connected: "Online",
|
|
3695
|
-
connecting: "Connecting",
|
|
3696
|
-
disconnected: "Offline",
|
|
3697
|
-
error: "Connection problem",
|
|
3698
|
-
hidden: null
|
|
3699
|
-
};
|
|
3700
|
-
function PresenceLabel({
|
|
3701
|
-
status,
|
|
3702
|
-
className
|
|
3703
|
-
}) {
|
|
3704
|
-
if (!status) return null;
|
|
3705
|
-
const word = PRESENCE_WORDS[status];
|
|
3706
|
-
if (!word) return null;
|
|
3707
|
-
const online = status === "connected";
|
|
3708
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3709
|
-
"span",
|
|
3710
|
-
{
|
|
3711
|
-
"data-testid": "presence-label",
|
|
3712
|
-
className: chunkS6A6FSG7_cjs.cn("inline-flex shrink-0 items-center gap-1 text-xs", className),
|
|
3713
|
-
children: [
|
|
3505
|
+
if (tooltipContent) {
|
|
3506
|
+
if (href) {
|
|
3507
|
+
return tooltipWrap(
|
|
3714
3508
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3715
|
-
"
|
|
3509
|
+
"a",
|
|
3716
3510
|
{
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3511
|
+
href,
|
|
3512
|
+
target: "_blank",
|
|
3513
|
+
rel: "noopener noreferrer",
|
|
3514
|
+
className: mainAreaClass,
|
|
3515
|
+
onClick,
|
|
3516
|
+
children: mainContent
|
|
3722
3517
|
}
|
|
3723
3518
|
),
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
var PACKAGE_BADGE_VARIANTS = [
|
|
3730
|
-
"default",
|
|
3731
|
-
"accent",
|
|
3732
|
-
"secondary",
|
|
3733
|
-
"destructive",
|
|
3734
|
-
"outline"
|
|
3735
|
-
];
|
|
3736
|
-
function isPackageBadgeVariant(v) {
|
|
3737
|
-
return PACKAGE_BADGE_VARIANTS.some((known) => known === v);
|
|
3738
|
-
}
|
|
3739
|
-
function PackageStatusBadge({ variant, ...rest }) {
|
|
3740
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: isPackageBadgeVariant(variant) ? variant : "outline", ...rest });
|
|
3741
|
-
}
|
|
3742
|
-
var registry = {
|
|
3743
|
-
variants: {},
|
|
3744
|
-
fallback: "outline",
|
|
3745
|
-
Badge: PackageStatusBadge
|
|
3746
|
-
};
|
|
3747
|
-
function configureStatusRegistry(map, opts) {
|
|
3748
|
-
Object.assign(registry.variants, map);
|
|
3749
|
-
if (opts?.fallback) registry.fallback = opts.fallback;
|
|
3750
|
-
if (opts?.Badge) registry.Badge = opts.Badge;
|
|
3751
|
-
}
|
|
3752
|
-
function getStatusVariant(status) {
|
|
3753
|
-
return registry.variants[status] ?? registry.fallback;
|
|
3754
|
-
}
|
|
3755
|
-
function StatusPill({ status, label, variant, className, testId }) {
|
|
3756
|
-
const Badge2 = registry.Badge;
|
|
3757
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Badge2, { variant: variant ?? getStatusVariant(status), className, "data-testid": testId, children: label ?? status });
|
|
3758
|
-
}
|
|
3759
|
-
var RAG_LABELS = { red: "At risk", amber: "Attention", green: "On track" };
|
|
3760
|
-
function configureRagLabels(labels) {
|
|
3761
|
-
RAG_LABELS = { ...RAG_LABELS, ...labels };
|
|
3762
|
-
}
|
|
3763
|
-
function RagDot({
|
|
3764
|
-
rag,
|
|
3765
|
-
withLabel,
|
|
3766
|
-
className
|
|
3767
|
-
}) {
|
|
3768
|
-
const color = rag === "red" ? "bg-destructive" : rag === "amber" ? "bg-warning" : "bg-success";
|
|
3769
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: chunkS6A6FSG7_cjs.cn("inline-flex items-center gap-1.5", className), "data-testid": `rag-${rag}`, children: [
|
|
3770
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkS6A6FSG7_cjs.cn("size-2 rounded-full", color) }),
|
|
3771
|
-
withLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: RAG_LABELS[rag] })
|
|
3772
|
-
] });
|
|
3773
|
-
}
|
|
3774
|
-
var ENTITY_MAPPINGS = {
|
|
3775
|
-
PRODUCT: {
|
|
3776
|
-
NAMES: {
|
|
3777
|
-
SINGULAR: "ARBI Docs"
|
|
3778
|
-
},
|
|
3779
|
-
ICONS: {
|
|
3780
|
-
DEFAULT: lucideReact.MessageSquareLock
|
|
3781
|
-
}
|
|
3782
|
-
},
|
|
3783
|
-
SECTION: {
|
|
3784
|
-
NAMES: {
|
|
3785
|
-
SINGULAR: "Section"
|
|
3786
|
-
},
|
|
3787
|
-
ICONS: {
|
|
3788
|
-
DEFAULT: lucideReact.ChevronsDown
|
|
3789
|
-
}
|
|
3790
|
-
},
|
|
3791
|
-
WORKSPACE: {
|
|
3792
|
-
NAMES: {
|
|
3793
|
-
SINGULAR: "Workspace",
|
|
3794
|
-
PLURAL: "Workspaces"
|
|
3795
|
-
},
|
|
3796
|
-
ICONS: {
|
|
3797
|
-
DEFAULT: lucideReact.SquareM,
|
|
3798
|
-
NEW: lucideReact.SquarePlus,
|
|
3799
|
-
LIST: lucideReact.LayoutGrid,
|
|
3800
|
-
SETTINGS: lucideReact.Columns3Cog
|
|
3801
|
-
}
|
|
3802
|
-
},
|
|
3803
|
-
CONVERSATION: {
|
|
3804
|
-
NAMES: {
|
|
3805
|
-
SINGULAR: "Thread",
|
|
3806
|
-
PLURAL: "Threads",
|
|
3807
|
-
NEW: "New Thread"
|
|
3808
|
-
},
|
|
3809
|
-
ICONS: {
|
|
3810
|
-
DEFAULT: lucideReact.MessagesSquare,
|
|
3811
|
-
OFF: lucideReact.MessageSquareOff,
|
|
3812
|
-
ACTIVE: lucideReact.MessageSquareText,
|
|
3813
|
-
NEW: lucideReact.MessageSquarePlus,
|
|
3814
|
-
LIST: lucideReact.MessageSquareMore
|
|
3815
|
-
}
|
|
3816
|
-
},
|
|
3817
|
-
DOCUMENT: {
|
|
3818
|
-
NAMES: {
|
|
3819
|
-
SINGULAR: "File",
|
|
3820
|
-
PLURAL: "Files"
|
|
3821
|
-
},
|
|
3822
|
-
ICONS: {
|
|
3823
|
-
DEFAULT: lucideReact.FolderOpen,
|
|
3824
|
-
OFF: lucideReact.CaptionsOff
|
|
3825
|
-
}
|
|
3826
|
-
},
|
|
3827
|
-
VIEWER: {
|
|
3828
|
-
NAMES: {
|
|
3829
|
-
SINGULAR: "Viewer",
|
|
3830
|
-
PLURAL: "Viewers"
|
|
3831
|
-
},
|
|
3832
|
-
ICONS: {
|
|
3833
|
-
DEFAULT: lucideReact.Eye,
|
|
3834
|
-
OFF: lucideReact.EyeOff
|
|
3835
|
-
}
|
|
3836
|
-
},
|
|
3837
|
-
TAG: {
|
|
3838
|
-
NAMES: {
|
|
3839
|
-
SINGULAR: "Field",
|
|
3840
|
-
PLURAL: "Fields"
|
|
3841
|
-
},
|
|
3842
|
-
ICONS: {
|
|
3843
|
-
DEFAULT: lucideReact.Hash,
|
|
3844
|
-
NEW: lucideReact.FolderPlus
|
|
3845
|
-
}
|
|
3846
|
-
},
|
|
3847
|
-
ANNOTATION: {
|
|
3848
|
-
NAMES: {
|
|
3849
|
-
SINGULAR: "Annotation",
|
|
3850
|
-
PLURAL: "Annotations"
|
|
3851
|
-
},
|
|
3852
|
-
ICONS: {
|
|
3853
|
-
DEFAULT: lucideReact.StickyNote,
|
|
3854
|
-
NEW: lucideReact.StickyNote
|
|
3855
|
-
}
|
|
3856
|
-
},
|
|
3857
|
-
// A tag of any kind — what the Tags page lists. TAG stays "Field": the Files page's custom
|
|
3858
|
-
// columns (labels and annotations as document fields) are named after it.
|
|
3859
|
-
ANY_TAG: {
|
|
3860
|
-
NAMES: {
|
|
3861
|
-
SINGULAR: "Tag",
|
|
3862
|
-
PLURAL: "Tags"
|
|
3863
|
-
},
|
|
3864
|
-
ICONS: {
|
|
3865
|
-
DEFAULT: lucideReact.Tags
|
|
3866
|
-
}
|
|
3867
|
-
},
|
|
3868
|
-
// The kinds of TAG (a tag's `kind`): a label files things; an issue is a point in dispute; a
|
|
3869
|
-
// person and an organisation are entities the documents name; a saved search is a stored query.
|
|
3870
|
-
LABEL: {
|
|
3871
|
-
NAMES: {
|
|
3872
|
-
SINGULAR: "Label",
|
|
3873
|
-
PLURAL: "Labels"
|
|
3874
|
-
},
|
|
3875
|
-
ICONS: {
|
|
3876
|
-
DEFAULT: lucideReact.Tags
|
|
3877
|
-
}
|
|
3878
|
-
},
|
|
3879
|
-
ISSUE: {
|
|
3880
|
-
NAMES: {
|
|
3881
|
-
SINGULAR: "Issue",
|
|
3882
|
-
PLURAL: "Issues"
|
|
3883
|
-
},
|
|
3884
|
-
ICONS: {
|
|
3885
|
-
DEFAULT: lucideReact.Scale
|
|
3886
|
-
}
|
|
3887
|
-
},
|
|
3888
|
-
PERSON: {
|
|
3889
|
-
NAMES: {
|
|
3890
|
-
SINGULAR: "Person",
|
|
3891
|
-
PLURAL: "People"
|
|
3892
|
-
},
|
|
3893
|
-
ICONS: {
|
|
3894
|
-
DEFAULT: lucideReact.Contact
|
|
3895
|
-
}
|
|
3896
|
-
},
|
|
3897
|
-
ORGANISATION: {
|
|
3898
|
-
NAMES: {
|
|
3899
|
-
SINGULAR: "Organisation",
|
|
3900
|
-
PLURAL: "Organisations"
|
|
3901
|
-
},
|
|
3902
|
-
ICONS: {
|
|
3903
|
-
DEFAULT: lucideReact.Building2
|
|
3904
|
-
}
|
|
3905
|
-
},
|
|
3906
|
-
SAVED_SEARCH: {
|
|
3907
|
-
NAMES: {
|
|
3908
|
-
SINGULAR: "Saved search",
|
|
3909
|
-
PLURAL: "Saved searches"
|
|
3910
|
-
},
|
|
3911
|
-
ICONS: {
|
|
3912
|
-
DEFAULT: lucideReact.Search
|
|
3913
|
-
}
|
|
3914
|
-
},
|
|
3915
|
-
// Workspace knowledge the assistant retains and recalls — durable free text,
|
|
3916
|
-
// optionally grounded in source passages. Distinct from ANNOTATION, which is
|
|
3917
|
-
// attached TO a document field; a NOTE is workspace-scoped and stands alone.
|
|
3918
|
-
// Stored server-side as `memories` (mem-*); "Note" is the user-facing name.
|
|
3919
|
-
NOTE: {
|
|
3920
|
-
NAMES: {
|
|
3921
|
-
SINGULAR: "Note",
|
|
3922
|
-
PLURAL: "Notes"
|
|
3923
|
-
},
|
|
3924
|
-
ICONS: {
|
|
3925
|
-
DEFAULT: lucideReact.NotebookText,
|
|
3926
|
-
NEW: lucideReact.NotebookPen
|
|
3519
|
+
tooltipContent,
|
|
3520
|
+
tooltipSide,
|
|
3521
|
+
chunkS6A6FSG7_cjs.cn(baseClasses, interactiveClasses),
|
|
3522
|
+
{ "data-testid": testId }
|
|
3523
|
+
);
|
|
3927
3524
|
}
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3525
|
+
return tooltipWrap(
|
|
3526
|
+
mainContent,
|
|
3527
|
+
tooltipContent,
|
|
3528
|
+
tooltipSide,
|
|
3529
|
+
chunkS6A6FSG7_cjs.cn(
|
|
3530
|
+
baseClasses,
|
|
3531
|
+
onClick && !disabled ? interactiveClasses : "",
|
|
3532
|
+
disabled ? disabledClasses : "",
|
|
3533
|
+
highlight && highlightClasses
|
|
3534
|
+
),
|
|
3535
|
+
{
|
|
3536
|
+
type: "button",
|
|
3537
|
+
ref,
|
|
3538
|
+
onClick: onClick && !disabled ? onClick : void 0,
|
|
3539
|
+
disabled: disabled || void 0,
|
|
3540
|
+
"data-testid": testId
|
|
3541
|
+
}
|
|
3542
|
+
);
|
|
3543
|
+
}
|
|
3544
|
+
if (href) {
|
|
3545
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3546
|
+
"a",
|
|
3547
|
+
{
|
|
3548
|
+
ref,
|
|
3549
|
+
href,
|
|
3550
|
+
target: "_blank",
|
|
3551
|
+
rel: "noopener noreferrer",
|
|
3552
|
+
className: chunkS6A6FSG7_cjs.cn(baseClasses, interactiveClasses),
|
|
3553
|
+
"data-testid": testId,
|
|
3554
|
+
onClick,
|
|
3555
|
+
children: mainContent
|
|
3556
|
+
}
|
|
3557
|
+
);
|
|
3558
|
+
}
|
|
3559
|
+
if (onClick) {
|
|
3560
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3561
|
+
"button",
|
|
3562
|
+
{
|
|
3563
|
+
ref,
|
|
3564
|
+
type: "button",
|
|
3565
|
+
onClick: disabled ? void 0 : onClick,
|
|
3566
|
+
disabled,
|
|
3567
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
3568
|
+
baseClasses,
|
|
3569
|
+
disabled ? disabledClasses : interactiveClasses,
|
|
3570
|
+
highlight && highlightClasses
|
|
3571
|
+
),
|
|
3572
|
+
"data-testid": testId,
|
|
3573
|
+
children: mainContent
|
|
3574
|
+
}
|
|
3575
|
+
);
|
|
3576
|
+
}
|
|
3577
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3578
|
+
"span",
|
|
3579
|
+
{
|
|
3580
|
+
ref,
|
|
3581
|
+
className: chunkS6A6FSG7_cjs.cn(baseClasses, highlight && highlightClasses),
|
|
3582
|
+
"data-testid": testId,
|
|
3583
|
+
children: mainContent
|
|
3938
3584
|
}
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3585
|
+
);
|
|
3586
|
+
});
|
|
3587
|
+
function getDocumentTitle(document2, defaultValue = "") {
|
|
3588
|
+
if (!document2) return defaultValue;
|
|
3589
|
+
return document2.doc_metadata?.title || document2.file_name || defaultValue;
|
|
3590
|
+
}
|
|
3591
|
+
var IMAGE_FILE_TYPES = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "bmp", "tiff", "webp"]);
|
|
3592
|
+
function isImageDocument(document2) {
|
|
3593
|
+
return !!document2?.file_type && IMAGE_FILE_TYPES.has(document2.file_type.toLowerCase());
|
|
3594
|
+
}
|
|
3595
|
+
var MAX_LABEL_CHARS = 30;
|
|
3596
|
+
function clampLabel(text) {
|
|
3597
|
+
return text.length > MAX_LABEL_CHARS ? `${text.slice(0, MAX_LABEL_CHARS).trimEnd()}\u2026` : text;
|
|
3598
|
+
}
|
|
3599
|
+
var IMAGE_EXTENSIONS = /* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "bmp", "tiff", "tif", "webp"]);
|
|
3600
|
+
var VIDEO_EXTENSIONS = /* @__PURE__ */ new Set(["mp4", "mpeg", "mpg", "webm", "mov", "avi", "mkv"]);
|
|
3601
|
+
var AUDIO_EXTENSIONS = /* @__PURE__ */ new Set(["mp3", "wav", "m4a", "aac", "ogg", "flac"]);
|
|
3602
|
+
var EMAIL_EXTENSIONS = /* @__PURE__ */ new Set(["eml", "msg"]);
|
|
3603
|
+
var DOCX_EXTENSIONS = /* @__PURE__ */ new Set(["doc", "docx", "odt", "rtf"]);
|
|
3604
|
+
var XLSX_EXTENSIONS = /* @__PURE__ */ new Set(["xls", "xlsx", "csv", "ods"]);
|
|
3605
|
+
var HTML_EXTENSIONS = /* @__PURE__ */ new Set(["html", "htm", "mhtml"]);
|
|
3606
|
+
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
3607
|
+
"txt",
|
|
3608
|
+
"text",
|
|
3609
|
+
"md",
|
|
3610
|
+
"markdown",
|
|
3611
|
+
"log",
|
|
3612
|
+
"json",
|
|
3613
|
+
"xml",
|
|
3614
|
+
"yaml",
|
|
3615
|
+
"yml"
|
|
3616
|
+
]);
|
|
3617
|
+
function getDocIcon(fileName, iconSize = 14) {
|
|
3618
|
+
const ext = fileName?.split(".").pop()?.toLowerCase();
|
|
3619
|
+
if (ext && VIDEO_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(VidIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3620
|
+
if (ext && AUDIO_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(AudIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3621
|
+
if (ext && IMAGE_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(ImgIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3622
|
+
if (ext && EMAIL_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(EmlIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3623
|
+
if (ext && DOCX_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(DocIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3624
|
+
if (ext && XLSX_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(XlsIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3625
|
+
if (ext && HTML_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(HtmlIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3626
|
+
if (ext && TEXT_EXTENSIONS.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(TxtIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3627
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PdfIcon, { size: iconSize, className: "flex-shrink-0" });
|
|
3628
|
+
}
|
|
3629
|
+
function DocumentEntity({
|
|
3630
|
+
doc,
|
|
3631
|
+
icon,
|
|
3632
|
+
size = "sm",
|
|
3633
|
+
labelMaxWidth,
|
|
3634
|
+
labelClassName,
|
|
3635
|
+
onClick,
|
|
3636
|
+
onIconClick,
|
|
3637
|
+
viewing,
|
|
3638
|
+
iconBadge,
|
|
3639
|
+
status,
|
|
3640
|
+
actions,
|
|
3641
|
+
tooltipContent,
|
|
3642
|
+
className,
|
|
3643
|
+
fullWidth,
|
|
3644
|
+
noClamp,
|
|
3645
|
+
"data-testid": testId
|
|
3646
|
+
}) {
|
|
3647
|
+
const title = getDocumentTitle(doc);
|
|
3648
|
+
const ext = doc.file_name?.split(".").pop()?.toLowerCase();
|
|
3649
|
+
const iconSize = size === "base" ? 16 : 14;
|
|
3650
|
+
const eyeSizeClass = size === "base" ? "h-4 w-4" : "h-3.5 w-3.5";
|
|
3651
|
+
const baseIcon = icon ?? getDocIcon(doc.file_name, iconSize);
|
|
3652
|
+
const displayIcon = viewing || iconBadge ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex flex-shrink-0 items-center justify-center", children: [
|
|
3653
|
+
viewing ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: chunkS6A6FSG7_cjs.cn("text-primary-foreground", eyeSizeClass) }) : baseIcon,
|
|
3654
|
+
iconBadge
|
|
3655
|
+
] }) : baseIcon;
|
|
3656
|
+
const defaultTooltip = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 text-xs max-w-[440px]", children: [
|
|
3657
|
+
doc.folder && // `flex-wrap` so a deep folder path wraps WITHIN the balloon instead of
|
|
3658
|
+
// spilling out of it (each path segment is atomic and wraps as a unit;
|
|
3659
|
+
// `min-w-0` + `break-all` lets a single over-long segment break too).
|
|
3660
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-wrap items-center gap-0.5 text-muted-foreground", children: [
|
|
3661
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpen, { className: "h-3 w-3 text-yellow-600 shrink-0" }),
|
|
3662
|
+
doc.folder.split("/").map((part, i, arr) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-0.5", children: [
|
|
3663
|
+
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/50 mx-0.5", children: "/" }),
|
|
3664
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `break-all ${i < arr.length - 1 ? "text-muted-foreground/70" : ""}`, children: part })
|
|
3665
|
+
] }, i))
|
|
3666
|
+
] }),
|
|
3667
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium break-words", children: [
|
|
3668
|
+
title,
|
|
3669
|
+
ext ? `.${ext}` : ""
|
|
3670
|
+
] })
|
|
3671
|
+
] });
|
|
3672
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3673
|
+
EntityPill,
|
|
3674
|
+
{
|
|
3675
|
+
icon: displayIcon,
|
|
3676
|
+
size,
|
|
3677
|
+
label: fullWidth || noClamp ? title : clampLabel(title),
|
|
3678
|
+
labelMaxWidth: labelMaxWidth ?? "max-w-[140px]",
|
|
3679
|
+
labelClassName,
|
|
3680
|
+
secondaryText: status,
|
|
3681
|
+
fullWidth,
|
|
3682
|
+
onClick,
|
|
3683
|
+
onIconClick,
|
|
3684
|
+
moreContent: actions,
|
|
3685
|
+
className,
|
|
3686
|
+
highlight: viewing,
|
|
3687
|
+
"data-testid": testId,
|
|
3688
|
+
tooltipContent: tooltipContent ?? defaultTooltip
|
|
3950
3689
|
}
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3690
|
+
);
|
|
3691
|
+
}
|
|
3692
|
+
var TAG_TYPE_LABELS = {
|
|
3693
|
+
checkbox: "Checkbox",
|
|
3694
|
+
select: "Select",
|
|
3695
|
+
number: "Number",
|
|
3696
|
+
text: "Text",
|
|
3697
|
+
folder: "Folder",
|
|
3698
|
+
search: "Saved Search",
|
|
3699
|
+
date: "Date",
|
|
3700
|
+
assistant: "AI Assistant"
|
|
3701
|
+
};
|
|
3702
|
+
var TAG_TYPE_ICONS = {
|
|
3703
|
+
checkbox: lucideReact.SquareCheckBig,
|
|
3704
|
+
select: lucideReact.List,
|
|
3705
|
+
number: lucideReact.Hash,
|
|
3706
|
+
text: lucideReact.NotebookPen,
|
|
3707
|
+
folder: lucideReact.Folder,
|
|
3708
|
+
search: lucideReact.Search,
|
|
3709
|
+
date: lucideReact.Calendar,
|
|
3710
|
+
assistant: lucideReact.Bot
|
|
3711
|
+
};
|
|
3712
|
+
function getTagTypeIcon(type) {
|
|
3713
|
+
return TAG_TYPE_ICONS[type ?? "text"] || lucideReact.NotebookPen;
|
|
3714
|
+
}
|
|
3715
|
+
function getTagTypeLabel(type) {
|
|
3716
|
+
const t = type ?? "text";
|
|
3717
|
+
return TAG_TYPE_LABELS[t] || t;
|
|
3718
|
+
}
|
|
3719
|
+
var BASE_COLORS = {
|
|
3720
|
+
"0": "#10b981",
|
|
3721
|
+
"1": "#3b82f6",
|
|
3722
|
+
"2": "#8b5cf6",
|
|
3723
|
+
"3": "#f43f5e",
|
|
3724
|
+
"4": "#f59e0b",
|
|
3725
|
+
"5": "#84cc16",
|
|
3726
|
+
"6": "#a855f7",
|
|
3727
|
+
"7": "#06b6d4",
|
|
3728
|
+
"8": "#f97316",
|
|
3729
|
+
"9": "#14b8a6",
|
|
3730
|
+
a: "#ef4444",
|
|
3731
|
+
b: "#6366f1",
|
|
3732
|
+
c: "#ec4899",
|
|
3733
|
+
d: "#22c55e",
|
|
3734
|
+
e: "#eab308",
|
|
3735
|
+
f: "#0ea5e9"
|
|
3736
|
+
};
|
|
3737
|
+
function getEntityColor(entityId) {
|
|
3738
|
+
return BASE_COLORS[entityId[4]] || BASE_COLORS["0"];
|
|
3739
|
+
}
|
|
3740
|
+
function TagEntity({
|
|
3741
|
+
tag,
|
|
3742
|
+
size = "md",
|
|
3743
|
+
className = "",
|
|
3744
|
+
onClick,
|
|
3745
|
+
showTooltip = true,
|
|
3746
|
+
tooltipContent
|
|
3747
|
+
}) {
|
|
3748
|
+
const tagType = tag.tag_type?.type ?? "text";
|
|
3749
|
+
const iconSize = size === "sm" ? 12 : size === "md" ? 14 : 16;
|
|
3750
|
+
const Icon2 = getTagTypeIcon(tagType);
|
|
3751
|
+
const sizeClasses2 = {
|
|
3752
|
+
sm: "p-0.5",
|
|
3753
|
+
md: "p-1",
|
|
3754
|
+
lg: "p-1.5"
|
|
3755
|
+
};
|
|
3756
|
+
const tagColor = tag.color ?? getEntityColor(tag.external_id);
|
|
3757
|
+
const iconElement = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3758
|
+
"span",
|
|
3759
|
+
{
|
|
3760
|
+
className: `inline-flex items-center justify-center rounded-md text-white flex-shrink-0 ${sizeClasses2[size]}`,
|
|
3761
|
+
style: { backgroundColor: tagColor },
|
|
3762
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: iconSize, className: "flex-shrink-0" })
|
|
3962
3763
|
}
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3764
|
+
);
|
|
3765
|
+
const pillSize = size === "lg" ? "base" : "sm";
|
|
3766
|
+
const defaultTooltip = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
3767
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3768
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3769
|
+
"span",
|
|
3770
|
+
{
|
|
3771
|
+
className: "inline-flex items-center justify-center rounded-md text-white p-1",
|
|
3772
|
+
style: { backgroundColor: tagColor },
|
|
3773
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 16 })
|
|
3774
|
+
}
|
|
3775
|
+
),
|
|
3776
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: tag.name })
|
|
3777
|
+
] }),
|
|
3778
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5 text-sm", children: [
|
|
3779
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3780
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Type:" }),
|
|
3781
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: getTagTypeLabel(tagType) })
|
|
3782
|
+
] }),
|
|
3783
|
+
tag.doctag_count != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3784
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Documents:" }),
|
|
3785
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "secondary", className: "h-5 min-w-[20px] justify-center", children: tag.doctag_count ?? 0 })
|
|
3786
|
+
] }),
|
|
3787
|
+
tag.shared != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: tag.shared ? "Shared" : "Private" }) })
|
|
3788
|
+
] })
|
|
3789
|
+
] });
|
|
3790
|
+
const resolvedTooltip = showTooltip ? tooltipContent ?? defaultTooltip : void 0;
|
|
3791
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3792
|
+
EntityPill,
|
|
3793
|
+
{
|
|
3794
|
+
icon: iconElement,
|
|
3795
|
+
label: tag.name,
|
|
3796
|
+
size: pillSize,
|
|
3797
|
+
shape: "rounded",
|
|
3798
|
+
labelMaxWidth: "max-w-[180px]",
|
|
3799
|
+
tooltipContent: resolvedTooltip,
|
|
3800
|
+
onClick,
|
|
3801
|
+
className,
|
|
3802
|
+
"data-testid": `tag-entity-${tag.external_id}`
|
|
3971
3803
|
}
|
|
3804
|
+
);
|
|
3805
|
+
}
|
|
3806
|
+
|
|
3807
|
+
// src/entities/tag-kinds.ts
|
|
3808
|
+
var KIND_ENTITY = {
|
|
3809
|
+
label: "LABEL",
|
|
3810
|
+
annotation: "ANNOTATION",
|
|
3811
|
+
search: "SAVED_SEARCH",
|
|
3812
|
+
issue: "ISSUE",
|
|
3813
|
+
person: "PERSON",
|
|
3814
|
+
organisation: "ORGANISATION"
|
|
3815
|
+
};
|
|
3816
|
+
function tagKindTitle(kind, { plural = false } = {}) {
|
|
3817
|
+
return getEntityLabel(KIND_ENTITY[kind], plural ? "PLURAL" : "SINGULAR");
|
|
3818
|
+
}
|
|
3819
|
+
function tagKindNouns(kind) {
|
|
3820
|
+
return {
|
|
3821
|
+
singular: tagKindTitle(kind).toLowerCase(),
|
|
3822
|
+
plural: tagKindTitle(kind, { plural: true }).toLowerCase()
|
|
3823
|
+
};
|
|
3824
|
+
}
|
|
3825
|
+
var VARIANT_STYLES = {
|
|
3826
|
+
"mine-paid": {
|
|
3827
|
+
pill: "text-primary",
|
|
3828
|
+
icon: "text-primary"
|
|
3972
3829
|
},
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
PLURAL: "Projects"
|
|
3977
|
-
},
|
|
3978
|
-
ICONS: {
|
|
3979
|
-
DEFAULT: lucideReact.CreditCard
|
|
3980
|
-
}
|
|
3830
|
+
other: {
|
|
3831
|
+
pill: "text-secondary",
|
|
3832
|
+
icon: "text-secondary"
|
|
3981
3833
|
},
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
PLURAL: "Skills"
|
|
3986
|
-
},
|
|
3987
|
-
ICONS: {
|
|
3988
|
-
DEFAULT: lucideReact.Wrench
|
|
3989
|
-
}
|
|
3834
|
+
"mine-free": {
|
|
3835
|
+
pill: "text-muted-foreground",
|
|
3836
|
+
icon: "text-muted-foreground"
|
|
3990
3837
|
},
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3838
|
+
common: {
|
|
3839
|
+
pill: "",
|
|
3840
|
+
icon: "text-muted-foreground"
|
|
3841
|
+
}
|
|
3842
|
+
};
|
|
3843
|
+
function resolveVariant(relation, paid, hasCollaborators) {
|
|
3844
|
+
if (relation === "common") return "common";
|
|
3845
|
+
if (relation === "other") return "other";
|
|
3846
|
+
if (relation === "mine") return paid ? "mine-paid" : "mine-free";
|
|
3847
|
+
if (paid) return hasCollaborators ? "other" : "mine-paid";
|
|
3848
|
+
return "mine-free";
|
|
3849
|
+
}
|
|
3850
|
+
function ProjectEntity({
|
|
3851
|
+
name,
|
|
3852
|
+
label,
|
|
3853
|
+
icon,
|
|
3854
|
+
subscription = "none",
|
|
3855
|
+
hasCollaborators = false,
|
|
3856
|
+
size = "sm",
|
|
3857
|
+
className,
|
|
3858
|
+
onClick,
|
|
3859
|
+
relation,
|
|
3860
|
+
isPaid,
|
|
3861
|
+
tooltipContent
|
|
3862
|
+
}) {
|
|
3863
|
+
const paid = isPaid ?? (subscription === "active" || subscription === "past_due" || subscription === "dev");
|
|
3864
|
+
const variant = resolveVariant(relation, paid, hasCollaborators);
|
|
3865
|
+
const { pill, icon: iconClass } = VARIANT_STYLES[variant];
|
|
3866
|
+
const iconSizeClass = size === "base" ? "h-4 w-4" : "h-3.5 w-3.5";
|
|
3867
|
+
const iconNode = icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: chunkS6A6FSG7_cjs.cn(iconSizeClass, iconClass) });
|
|
3868
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3869
|
+
EntityPill,
|
|
3870
|
+
{
|
|
3871
|
+
icon: iconNode,
|
|
3872
|
+
label: label ?? name,
|
|
3873
|
+
size,
|
|
3874
|
+
shape: "rounded",
|
|
3875
|
+
className: chunkS6A6FSG7_cjs.cn(pill, className),
|
|
3876
|
+
onClick,
|
|
3877
|
+
tooltipContent
|
|
3997
3878
|
}
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
3879
|
+
);
|
|
3880
|
+
}
|
|
3881
|
+
function VerifiedBadge({ className, label = "Identity verified" }) {
|
|
3882
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3883
|
+
lucideReact.BadgeCheck,
|
|
3884
|
+
{
|
|
3885
|
+
role: "img",
|
|
3886
|
+
"aria-label": label,
|
|
3887
|
+
"data-testid": "verified-badge",
|
|
3888
|
+
className: chunkS6A6FSG7_cjs.cn("h-3.5 w-3.5 shrink-0 text-sky-500", className),
|
|
3889
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("title", { children: label })
|
|
4006
3890
|
}
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
3891
|
+
);
|
|
3892
|
+
}
|
|
3893
|
+
var sizeClasses = {
|
|
3894
|
+
xs: "h-5 w-5",
|
|
3895
|
+
sm: "h-6 w-6",
|
|
3896
|
+
md: "h-8 w-8",
|
|
3897
|
+
lg: "h-10 w-10"
|
|
3898
|
+
};
|
|
3899
|
+
var textSizeClasses = {
|
|
3900
|
+
xs: "text-xs",
|
|
3901
|
+
sm: "text-xs",
|
|
3902
|
+
md: "text-xs",
|
|
3903
|
+
lg: "text-sm"
|
|
3904
|
+
};
|
|
3905
|
+
var presenceDotClasses = {
|
|
3906
|
+
xs: "w-2 h-2 border",
|
|
3907
|
+
sm: "w-2.5 h-2.5 border",
|
|
3908
|
+
md: "w-3 h-3 border-2",
|
|
3909
|
+
lg: "w-3.5 h-3.5 border-2"
|
|
3910
|
+
};
|
|
3911
|
+
var presencePositionClasses = {
|
|
3912
|
+
xs: "-right-1 bottom-0",
|
|
3913
|
+
sm: "-right-1 bottom-0",
|
|
3914
|
+
md: "-right-1.5 -bottom-0.5",
|
|
3915
|
+
lg: "-right-1.5 -bottom-0.5"
|
|
3916
|
+
};
|
|
3917
|
+
var PRESENCE_LABELS = {
|
|
3918
|
+
connected: "Online",
|
|
3919
|
+
connecting: "Connecting",
|
|
3920
|
+
disconnected: "Offline",
|
|
3921
|
+
error: "Connection problem",
|
|
3922
|
+
hidden: "Status hidden"
|
|
3923
|
+
};
|
|
3924
|
+
var presenceColorClasses = {
|
|
3925
|
+
connected: "bg-status-online",
|
|
3926
|
+
connecting: "bg-status-connecting",
|
|
3927
|
+
disconnected: "bg-status-away",
|
|
3928
|
+
error: "bg-status-busy",
|
|
3929
|
+
hidden: "bg-status-offline"
|
|
3930
|
+
};
|
|
3931
|
+
var UserEntity = React.memo(function UserEntity2({
|
|
3932
|
+
size = "md",
|
|
3933
|
+
variant = "pill",
|
|
3934
|
+
className,
|
|
3935
|
+
showTooltip = true,
|
|
3936
|
+
interactive = true,
|
|
3937
|
+
hasUnreadMessages = false,
|
|
3938
|
+
initials = "",
|
|
3939
|
+
displayName = "",
|
|
3940
|
+
picture,
|
|
3941
|
+
avatarImageClassName,
|
|
3942
|
+
colorClass = "",
|
|
3943
|
+
isAgent = false,
|
|
3944
|
+
isVerified = false,
|
|
3945
|
+
agentStyle,
|
|
3946
|
+
avatarStyle,
|
|
3947
|
+
isMe = false,
|
|
3948
|
+
displayStatus,
|
|
3949
|
+
onClick,
|
|
3950
|
+
tooltipContent,
|
|
3951
|
+
empty = false
|
|
3952
|
+
}) {
|
|
3953
|
+
if (empty) {
|
|
3954
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3955
|
+
Avatar,
|
|
3956
|
+
{
|
|
3957
|
+
className: chunkS6A6FSG7_cjs.cn(sizeClasses[size], "border border-border", className),
|
|
3958
|
+
"data-testid": "user-entity",
|
|
3959
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "bg-status-empty text-muted-foreground text-xs font-semibold", children: "?" })
|
|
3960
|
+
}
|
|
3961
|
+
);
|
|
3962
|
+
}
|
|
3963
|
+
const agentBadge = isAgent ? /* @__PURE__ */ jsxRuntime.jsx(ArbiBotHeadIcon, { className: "w-3.5 h-3.5 text-muted-foreground" }) : void 0;
|
|
3964
|
+
const canMessage = interactive && !isMe && !isAgent;
|
|
3965
|
+
const showUnread = hasUnreadMessages && !isMe && !isAgent;
|
|
3966
|
+
const surfaceStyle = avatarStyle ?? agentStyle;
|
|
3967
|
+
const avatarCore = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3968
|
+
Avatar,
|
|
3969
|
+
{
|
|
3970
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
3971
|
+
sizeClasses[size],
|
|
3972
|
+
isAgent ? "rounded-full border-2 border-dashed" : "border border-white"
|
|
3973
|
+
),
|
|
3974
|
+
style: surfaceStyle,
|
|
3975
|
+
"data-testid": "user-entity",
|
|
3976
|
+
children: [
|
|
3977
|
+
picture && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: picture, alt: initials, className: avatarImageClassName }),
|
|
3978
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3979
|
+
AvatarFallback,
|
|
3980
|
+
{
|
|
3981
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
3982
|
+
textSizeClasses[size],
|
|
3983
|
+
"font-semibold leading-none",
|
|
3984
|
+
isAgent ? "rounded-full bg-transparent" : `text-white ${colorClass}`
|
|
3985
|
+
),
|
|
3986
|
+
style: surfaceStyle,
|
|
3987
|
+
children: initials
|
|
3988
|
+
}
|
|
3989
|
+
)
|
|
3990
|
+
]
|
|
4015
3991
|
}
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
3992
|
+
);
|
|
3993
|
+
const statusDot = showUnread || displayStatus ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3994
|
+
"span",
|
|
3995
|
+
{
|
|
3996
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
3997
|
+
"absolute rounded-full border-white",
|
|
3998
|
+
presenceDotClasses[size],
|
|
3999
|
+
presencePositionClasses[size],
|
|
4000
|
+
!showUnread && displayStatus ? presenceColorClasses[displayStatus] : ""
|
|
4001
|
+
),
|
|
4002
|
+
style: showUnread ? { backgroundColor: "#00adef" } : void 0,
|
|
4003
|
+
"data-testid": "user-entity-presence",
|
|
4004
|
+
role: "img",
|
|
4005
|
+
"aria-label": showUnread ? "Unread messages" : PRESENCE_LABELS[displayStatus],
|
|
4006
|
+
title: showUnread ? "Unread messages" : PRESENCE_LABELS[displayStatus]
|
|
4024
4007
|
}
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4008
|
+
) : null;
|
|
4009
|
+
const avatarElement = statusDot ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4010
|
+
"div",
|
|
4011
|
+
{
|
|
4012
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
4013
|
+
"relative inline-block",
|
|
4014
|
+
sizeClasses[size],
|
|
4015
|
+
variant === "pill" ? "" : className
|
|
4016
|
+
),
|
|
4017
|
+
children: [
|
|
4018
|
+
avatarCore,
|
|
4019
|
+
statusDot
|
|
4020
|
+
]
|
|
4036
4021
|
}
|
|
4037
|
-
}
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4022
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkS6A6FSG7_cjs.cn("inline-block", variant === "pill" ? "" : className), children: avatarCore });
|
|
4023
|
+
const pillAvatar = (
|
|
4024
|
+
// shrink-0: when the pill is squeezed the NAME truncates away — the avatar
|
|
4025
|
+
// must never collapse under it and overflow onto neighbouring text.
|
|
4026
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: chunkS6A6FSG7_cjs.cn("relative inline-block shrink-0", sizeClasses[size]), children: [
|
|
4027
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkS6A6FSG7_cjs.cn("block transition-opacity", canMessage && "group-hover/pill:opacity-0"), children: avatarCore }),
|
|
4028
|
+
canMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4029
|
+
"span",
|
|
4030
|
+
{
|
|
4031
|
+
"aria-hidden": true,
|
|
4032
|
+
className: "absolute inset-0 flex items-center justify-center rounded-full bg-muted text-foreground opacity-0 transition-opacity group-hover/pill:opacity-100",
|
|
4033
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleMore, { className: size === "xs" ? "h-3 w-3" : "h-4 w-4" })
|
|
4034
|
+
}
|
|
4035
|
+
),
|
|
4036
|
+
statusDot
|
|
4037
|
+
] })
|
|
4038
|
+
);
|
|
4039
|
+
const resolvedTooltip = showTooltip ? tooltipContent : void 0;
|
|
4040
|
+
if (variant === "pill") {
|
|
4041
|
+
const row = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4042
|
+
pillAvatar,
|
|
4043
|
+
displayName && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 max-w-[320px] truncate text-sm leading-tight", children: displayName }),
|
|
4044
|
+
isVerified && !isAgent && /* @__PURE__ */ jsxRuntime.jsx(VerifiedBadge, {}),
|
|
4045
|
+
agentBadge
|
|
4046
|
+
] });
|
|
4047
|
+
const rowClass = "group/pill inline-flex min-w-0 items-center gap-2";
|
|
4048
|
+
const clickable = interactive && !!onClick;
|
|
4049
|
+
const clickableClass = "relative cursor-pointer rounded-md px-1 py-0.5 -mx-1 transition-colors hover:bg-muted/60 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']";
|
|
4050
|
+
if (resolvedTooltip) {
|
|
4051
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
4052
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4053
|
+
TooltipTrigger,
|
|
4054
|
+
{
|
|
4055
|
+
type: "button",
|
|
4056
|
+
onClick: clickable ? onClick : void 0,
|
|
4057
|
+
onFocusCapture: (e) => e.stopPropagation(),
|
|
4058
|
+
className: chunkS6A6FSG7_cjs.cn(rowClass, clickable && clickableClass, className),
|
|
4059
|
+
"data-testid": "user-entity-pill",
|
|
4060
|
+
children: row
|
|
4061
|
+
}
|
|
4062
|
+
),
|
|
4063
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { className: "p-2", children: resolvedTooltip })
|
|
4064
|
+
] });
|
|
4048
4065
|
}
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4066
|
+
if (clickable) {
|
|
4067
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4068
|
+
"button",
|
|
4069
|
+
{
|
|
4070
|
+
type: "button",
|
|
4071
|
+
onClick,
|
|
4072
|
+
className: chunkS6A6FSG7_cjs.cn(rowClass, clickableClass, className),
|
|
4073
|
+
"data-testid": "user-entity-pill",
|
|
4074
|
+
children: row
|
|
4075
|
+
}
|
|
4076
|
+
);
|
|
4057
4077
|
}
|
|
4078
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkS6A6FSG7_cjs.cn(rowClass, className), "data-testid": "user-entity-pill", children: row });
|
|
4058
4079
|
}
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4080
|
+
if (showTooltip) {
|
|
4081
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
4082
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4083
|
+
TooltipTrigger,
|
|
4084
|
+
{
|
|
4085
|
+
onFocusCapture: (e) => e.stopPropagation(),
|
|
4086
|
+
className: "touch-hit inline-flex",
|
|
4087
|
+
children: avatarElement
|
|
4088
|
+
}
|
|
4089
|
+
),
|
|
4090
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { className: "p-2", children: tooltipContent })
|
|
4091
|
+
] });
|
|
4066
4092
|
}
|
|
4093
|
+
return avatarElement;
|
|
4094
|
+
});
|
|
4095
|
+
function AgentBadge({ className }) {
|
|
4096
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4097
|
+
"span",
|
|
4098
|
+
{
|
|
4099
|
+
"data-testid": "agent-badge",
|
|
4100
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
4101
|
+
"inline-flex shrink-0 items-center gap-1 rounded-full border border-ai-accent/50",
|
|
4102
|
+
"bg-ai-accent-soft px-2 py-0.5 text-xs font-bold uppercase tracking-wider text-ai-accent",
|
|
4103
|
+
className
|
|
4104
|
+
),
|
|
4105
|
+
children: [
|
|
4106
|
+
/* @__PURE__ */ jsxRuntime.jsx(ArbiBotHeadIcon, { size: 14, className: "text-ai-accent" }),
|
|
4107
|
+
"Agent"
|
|
4108
|
+
]
|
|
4109
|
+
}
|
|
4110
|
+
);
|
|
4067
4111
|
}
|
|
4068
|
-
var
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
if (!entityMapping) return "";
|
|
4075
|
-
const names = entityMapping.NAMES;
|
|
4076
|
-
const singularName = names.SINGULAR || "";
|
|
4077
|
-
if (form === "NEW") return names.NEW !== void 0 ? names.NEW : "New " + singularName;
|
|
4078
|
-
if (form === "SHORT")
|
|
4079
|
-
return names.SHORT !== void 0 ? names.SHORT : singularName.substring(0, 3) + ".";
|
|
4080
|
-
if (form === "PLURAL") return names.PLURAL !== void 0 ? names.PLURAL : singularName + "s";
|
|
4081
|
-
return singularName;
|
|
4082
|
-
};
|
|
4083
|
-
var EntityIcon = ({ entityType, variant = "DEFAULT", ...props }) => {
|
|
4084
|
-
const IconComponent = getEntityIcon(entityType, variant);
|
|
4085
|
-
return IconComponent ? React__namespace.default.createElement(IconComponent, props) : null;
|
|
4086
|
-
};
|
|
4087
|
-
var VISIBILITY_ICONS = {
|
|
4088
|
-
PRIVATE: lucideReact.MessageSquareLock,
|
|
4089
|
-
SHARED: lucideReact.Users
|
|
4112
|
+
var PRESENCE_WORDS = {
|
|
4113
|
+
connected: "Online",
|
|
4114
|
+
connecting: "Connecting",
|
|
4115
|
+
disconnected: "Offline",
|
|
4116
|
+
error: "Connection problem",
|
|
4117
|
+
hidden: null
|
|
4090
4118
|
};
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
className
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
const
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4119
|
+
function PresenceLabel({
|
|
4120
|
+
status,
|
|
4121
|
+
className
|
|
4122
|
+
}) {
|
|
4123
|
+
if (!status) return null;
|
|
4124
|
+
const word = PRESENCE_WORDS[status];
|
|
4125
|
+
if (!word) return null;
|
|
4126
|
+
const online = status === "connected";
|
|
4127
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4128
|
+
"span",
|
|
4129
|
+
{
|
|
4130
|
+
"data-testid": "presence-label",
|
|
4131
|
+
className: chunkS6A6FSG7_cjs.cn("inline-flex shrink-0 items-center gap-1 text-xs", className),
|
|
4132
|
+
children: [
|
|
4133
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4134
|
+
"span",
|
|
4135
|
+
{
|
|
4136
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
4137
|
+
"size-1.5 rounded-full",
|
|
4138
|
+
online ? "bg-status-online" : "bg-muted-foreground/50"
|
|
4139
|
+
),
|
|
4140
|
+
"aria-hidden": "true"
|
|
4141
|
+
}
|
|
4142
|
+
),
|
|
4143
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: online ? "font-medium text-status-online" : "text-muted-foreground", children: word })
|
|
4144
|
+
]
|
|
4145
|
+
}
|
|
4146
|
+
);
|
|
4147
|
+
}
|
|
4148
|
+
var PACKAGE_BADGE_VARIANTS = [
|
|
4149
|
+
"default",
|
|
4150
|
+
"accent",
|
|
4151
|
+
"secondary",
|
|
4152
|
+
"destructive",
|
|
4153
|
+
"outline"
|
|
4154
|
+
];
|
|
4155
|
+
function isPackageBadgeVariant(v) {
|
|
4156
|
+
return PACKAGE_BADGE_VARIANTS.some((known) => known === v);
|
|
4157
|
+
}
|
|
4158
|
+
function PackageStatusBadge({ variant, ...rest }) {
|
|
4159
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: isPackageBadgeVariant(variant) ? variant : "outline", ...rest });
|
|
4160
|
+
}
|
|
4161
|
+
var registry = {
|
|
4162
|
+
variants: {},
|
|
4163
|
+
fallback: "outline",
|
|
4164
|
+
Badge: PackageStatusBadge
|
|
4101
4165
|
};
|
|
4166
|
+
function configureStatusRegistry(map, opts) {
|
|
4167
|
+
Object.assign(registry.variants, map);
|
|
4168
|
+
if (opts?.fallback) registry.fallback = opts.fallback;
|
|
4169
|
+
if (opts?.Badge) registry.Badge = opts.Badge;
|
|
4170
|
+
}
|
|
4171
|
+
function getStatusVariant(status) {
|
|
4172
|
+
return registry.variants[status] ?? registry.fallback;
|
|
4173
|
+
}
|
|
4174
|
+
function StatusPill({ status, label, variant, className, testId }) {
|
|
4175
|
+
const Badge2 = registry.Badge;
|
|
4176
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Badge2, { variant: variant ?? getStatusVariant(status), className, "data-testid": testId, children: label ?? status });
|
|
4177
|
+
}
|
|
4178
|
+
var RAG_LABELS = { red: "At risk", amber: "Attention", green: "On track" };
|
|
4179
|
+
function configureRagLabels(labels) {
|
|
4180
|
+
RAG_LABELS = { ...RAG_LABELS, ...labels };
|
|
4181
|
+
}
|
|
4182
|
+
function RagDot({
|
|
4183
|
+
rag,
|
|
4184
|
+
withLabel,
|
|
4185
|
+
className
|
|
4186
|
+
}) {
|
|
4187
|
+
const color = rag === "red" ? "bg-destructive" : rag === "amber" ? "bg-warning" : "bg-success";
|
|
4188
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: chunkS6A6FSG7_cjs.cn("inline-flex items-center gap-1.5", className), "data-testid": `rag-${rag}`, children: [
|
|
4189
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkS6A6FSG7_cjs.cn("size-2 rounded-full", color) }),
|
|
4190
|
+
withLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: RAG_LABELS[rag] })
|
|
4191
|
+
] });
|
|
4192
|
+
}
|
|
4102
4193
|
|
|
4103
4194
|
// src/entities/colors.ts
|
|
4104
4195
|
var OPACITY_LIGHT = 0.15;
|
|
@@ -4224,6 +4315,209 @@ function agentAvatarColors(bgColorClass) {
|
|
|
4224
4315
|
const color = BG_TO_COLOR[bgColorClass] || "#047857";
|
|
4225
4316
|
return { borderColor: color, color };
|
|
4226
4317
|
}
|
|
4318
|
+
|
|
4319
|
+
// src/entities/media-type.ts
|
|
4320
|
+
function getDottedExtension(fileName) {
|
|
4321
|
+
if (!fileName) return "";
|
|
4322
|
+
return fileName.substring(fileName.lastIndexOf(".")).toLowerCase();
|
|
4323
|
+
}
|
|
4324
|
+
var DOWNLOAD_ONLY_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
4325
|
+
".zip",
|
|
4326
|
+
".rar",
|
|
4327
|
+
".7z",
|
|
4328
|
+
".tar",
|
|
4329
|
+
".gz",
|
|
4330
|
+
".exe",
|
|
4331
|
+
".bin",
|
|
4332
|
+
".dmg",
|
|
4333
|
+
".iso",
|
|
4334
|
+
".apk",
|
|
4335
|
+
".msi",
|
|
4336
|
+
".dll",
|
|
4337
|
+
".so",
|
|
4338
|
+
".psd",
|
|
4339
|
+
".ai",
|
|
4340
|
+
".sketch"
|
|
4341
|
+
]);
|
|
4342
|
+
var IMAGE_EXTENSIONS2 = /* @__PURE__ */ new Set([
|
|
4343
|
+
".jpg",
|
|
4344
|
+
".jpeg",
|
|
4345
|
+
".png",
|
|
4346
|
+
".gif",
|
|
4347
|
+
".bmp",
|
|
4348
|
+
".tiff",
|
|
4349
|
+
".tif",
|
|
4350
|
+
".webp"
|
|
4351
|
+
]);
|
|
4352
|
+
var VIDEO_EXTENSIONS2 = /* @__PURE__ */ new Set([".mp4", ".mpeg", ".mpg", ".webm", ".mov", ".avi", ".mkv"]);
|
|
4353
|
+
var AUDIO_EXTENSIONS2 = /* @__PURE__ */ new Set([".mp3", ".wav", ".m4a", ".aac", ".ogg", ".flac"]);
|
|
4354
|
+
function isImageFile(fileName) {
|
|
4355
|
+
return IMAGE_EXTENSIONS2.has(getDottedExtension(fileName));
|
|
4356
|
+
}
|
|
4357
|
+
function isVideoFile(fileName) {
|
|
4358
|
+
return VIDEO_EXTENSIONS2.has(getDottedExtension(fileName));
|
|
4359
|
+
}
|
|
4360
|
+
function isAudioFile(fileName) {
|
|
4361
|
+
return AUDIO_EXTENSIONS2.has(getDottedExtension(fileName));
|
|
4362
|
+
}
|
|
4363
|
+
function isMediaFile(fileName) {
|
|
4364
|
+
return isImageFile(fileName) || isVideoFile(fileName) || isAudioFile(fileName);
|
|
4365
|
+
}
|
|
4366
|
+
function usesOriginalBytesForViewer(fileName) {
|
|
4367
|
+
return isMediaFile(fileName);
|
|
4368
|
+
}
|
|
4369
|
+
function isDownloadOnlyFile(fileName) {
|
|
4370
|
+
return DOWNLOAD_ONLY_EXTENSIONS.has(getDottedExtension(fileName));
|
|
4371
|
+
}
|
|
4372
|
+
|
|
4373
|
+
// src/entities/file-type.ts
|
|
4374
|
+
var EXT_LABELS = {
|
|
4375
|
+
pdf: "PDF",
|
|
4376
|
+
// Word / docs
|
|
4377
|
+
doc: "Word",
|
|
4378
|
+
docx: "Word",
|
|
4379
|
+
rtf: "Word",
|
|
4380
|
+
odt: "Word",
|
|
4381
|
+
// Spreadsheets
|
|
4382
|
+
xls: "Excel",
|
|
4383
|
+
xlsx: "Excel",
|
|
4384
|
+
ods: "Excel",
|
|
4385
|
+
csv: "CSV",
|
|
4386
|
+
tsv: "CSV",
|
|
4387
|
+
// Slides
|
|
4388
|
+
ppt: "PowerPoint",
|
|
4389
|
+
pptx: "PowerPoint",
|
|
4390
|
+
odp: "PowerPoint",
|
|
4391
|
+
// Plain text / markup
|
|
4392
|
+
txt: "Text",
|
|
4393
|
+
log: "Text",
|
|
4394
|
+
md: "Markdown",
|
|
4395
|
+
markdown: "Markdown",
|
|
4396
|
+
html: "HTML",
|
|
4397
|
+
htm: "HTML",
|
|
4398
|
+
xml: "XML",
|
|
4399
|
+
json: "JSON",
|
|
4400
|
+
yaml: "YAML",
|
|
4401
|
+
yml: "YAML",
|
|
4402
|
+
// Email
|
|
4403
|
+
eml: "Email",
|
|
4404
|
+
msg: "Email",
|
|
4405
|
+
mbox: "Email",
|
|
4406
|
+
pst: "Outlook",
|
|
4407
|
+
ost: "Outlook",
|
|
4408
|
+
// Images
|
|
4409
|
+
jpg: "Image",
|
|
4410
|
+
jpeg: "Image",
|
|
4411
|
+
png: "Image",
|
|
4412
|
+
gif: "Image",
|
|
4413
|
+
bmp: "Image",
|
|
4414
|
+
tif: "Image",
|
|
4415
|
+
tiff: "Image",
|
|
4416
|
+
webp: "Image",
|
|
4417
|
+
svg: "Image",
|
|
4418
|
+
heic: "Image",
|
|
4419
|
+
heif: "Image",
|
|
4420
|
+
// Audio
|
|
4421
|
+
mp3: "Audio",
|
|
4422
|
+
wav: "Audio",
|
|
4423
|
+
m4a: "Audio",
|
|
4424
|
+
aac: "Audio",
|
|
4425
|
+
ogg: "Audio",
|
|
4426
|
+
flac: "Audio",
|
|
4427
|
+
opus: "Audio",
|
|
4428
|
+
// Video
|
|
4429
|
+
mp4: "Video",
|
|
4430
|
+
webm: "Video",
|
|
4431
|
+
mov: "Video",
|
|
4432
|
+
avi: "Video",
|
|
4433
|
+
mkv: "Video",
|
|
4434
|
+
// Archives
|
|
4435
|
+
zip: "Archive",
|
|
4436
|
+
tar: "Archive",
|
|
4437
|
+
gz: "Archive",
|
|
4438
|
+
rar: "Archive",
|
|
4439
|
+
"7z": "Archive"
|
|
4440
|
+
};
|
|
4441
|
+
var MIME_SUBTYPE_LABELS = {
|
|
4442
|
+
// PDF
|
|
4443
|
+
pdf: "PDF",
|
|
4444
|
+
"x-pdf": "PDF",
|
|
4445
|
+
// Word
|
|
4446
|
+
msword: "Word",
|
|
4447
|
+
"vnd.openxmlformats-officedocument.wordprocessingml.document": "Word",
|
|
4448
|
+
"vnd.oasis.opendocument.text": "Word",
|
|
4449
|
+
rtf: "Word",
|
|
4450
|
+
// Excel
|
|
4451
|
+
"vnd.ms-excel": "Excel",
|
|
4452
|
+
"vnd.openxmlformats-officedocument.spreadsheetml.sheet": "Excel",
|
|
4453
|
+
"vnd.oasis.opendocument.spreadsheet": "Excel",
|
|
4454
|
+
csv: "CSV",
|
|
4455
|
+
"tab-separated-values": "CSV",
|
|
4456
|
+
// PowerPoint
|
|
4457
|
+
"vnd.ms-powerpoint": "PowerPoint",
|
|
4458
|
+
"vnd.openxmlformats-officedocument.presentationml.presentation": "PowerPoint",
|
|
4459
|
+
"vnd.oasis.opendocument.presentation": "PowerPoint",
|
|
4460
|
+
// Plain text / markup
|
|
4461
|
+
plain: "Text",
|
|
4462
|
+
html: "HTML",
|
|
4463
|
+
xml: "XML",
|
|
4464
|
+
json: "JSON",
|
|
4465
|
+
markdown: "Markdown",
|
|
4466
|
+
"x-markdown": "Markdown",
|
|
4467
|
+
yaml: "YAML",
|
|
4468
|
+
"x-yaml": "YAML",
|
|
4469
|
+
// Email
|
|
4470
|
+
rfc822: "Email",
|
|
4471
|
+
"vnd.ms-outlook": "Email",
|
|
4472
|
+
// Archives
|
|
4473
|
+
zip: "Archive",
|
|
4474
|
+
"x-zip-compressed": "Archive",
|
|
4475
|
+
"x-tar": "Archive",
|
|
4476
|
+
gzip: "Archive",
|
|
4477
|
+
"x-7z-compressed": "Archive",
|
|
4478
|
+
"x-rar-compressed": "Archive"
|
|
4479
|
+
};
|
|
4480
|
+
var MIME_TYPE_LABELS = {
|
|
4481
|
+
image: "Image",
|
|
4482
|
+
audio: "Audio",
|
|
4483
|
+
video: "Video",
|
|
4484
|
+
text: "Text"
|
|
4485
|
+
};
|
|
4486
|
+
function lookupExt(ext) {
|
|
4487
|
+
return EXT_LABELS[ext.toLowerCase().replace(/^\./, "")];
|
|
4488
|
+
}
|
|
4489
|
+
function lookupMime(mime) {
|
|
4490
|
+
const base = mime.toLowerCase().split(";")[0].trim();
|
|
4491
|
+
const slash = base.indexOf("/");
|
|
4492
|
+
if (slash <= 0) return void 0;
|
|
4493
|
+
const top = base.slice(0, slash);
|
|
4494
|
+
const sub = base.slice(slash + 1);
|
|
4495
|
+
return MIME_SUBTYPE_LABELS[sub] ?? MIME_TYPE_LABELS[top];
|
|
4496
|
+
}
|
|
4497
|
+
function extFromFileName(fileName) {
|
|
4498
|
+
if (!fileName) return void 0;
|
|
4499
|
+
const dot = fileName.lastIndexOf(".");
|
|
4500
|
+
if (dot <= 0 || dot === fileName.length - 1) return void 0;
|
|
4501
|
+
return fileName.slice(dot + 1);
|
|
4502
|
+
}
|
|
4503
|
+
function friendlyFileType(fileType, fileName) {
|
|
4504
|
+
if (fileType) {
|
|
4505
|
+
const trimmed = fileType.trim();
|
|
4506
|
+
if (trimmed.includes("/")) {
|
|
4507
|
+
const fromMime = lookupMime(trimmed);
|
|
4508
|
+
if (fromMime) return fromMime;
|
|
4509
|
+
} else {
|
|
4510
|
+
const fromExt = lookupExt(trimmed);
|
|
4511
|
+
if (fromExt) return fromExt;
|
|
4512
|
+
}
|
|
4513
|
+
}
|
|
4514
|
+
const fnExt = extFromFileName(fileName);
|
|
4515
|
+
if (fnExt) {
|
|
4516
|
+
const fromExt = lookupExt(fnExt);
|
|
4517
|
+
if (fromExt) return fromExt;
|
|
4518
|
+
}
|
|
4519
|
+
return "Other";
|
|
4520
|
+
}
|
|
4227
4521
|
function nameInitials(name) {
|
|
4228
4522
|
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
4229
4523
|
if (!parts.length) return "?";
|
|
@@ -4412,15 +4706,15 @@ var STATUS_LABEL = {
|
|
|
4412
4706
|
indexing: "Indexing",
|
|
4413
4707
|
analysing: "Analysing"
|
|
4414
4708
|
};
|
|
4415
|
-
var
|
|
4416
|
-
var
|
|
4417
|
-
var
|
|
4709
|
+
var IMAGE_EXTENSIONS3 = /* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "bmp", "tiff", "tif", "webp"]);
|
|
4710
|
+
var VIDEO_EXTENSIONS3 = /* @__PURE__ */ new Set(["mp4", "mpeg", "mpg", "webm", "mov", "avi", "mkv"]);
|
|
4711
|
+
var AUDIO_EXTENSIONS3 = /* @__PURE__ */ new Set(["mp3", "wav", "m4a", "aac", "ogg", "flac"]);
|
|
4418
4712
|
var EMAIL_EXTENSIONS2 = /* @__PURE__ */ new Set(["eml", "msg"]);
|
|
4419
4713
|
function fileIcon(fileName, size) {
|
|
4420
4714
|
const ext = fileName?.split(".").pop()?.toLowerCase();
|
|
4421
|
-
if (ext &&
|
|
4422
|
-
if (ext &&
|
|
4423
|
-
if (ext &&
|
|
4715
|
+
if (ext && VIDEO_EXTENSIONS3.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(VidIcon, { size });
|
|
4716
|
+
if (ext && AUDIO_EXTENSIONS3.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(AudIcon, { size });
|
|
4717
|
+
if (ext && IMAGE_EXTENSIONS3.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(ImgIcon, { size });
|
|
4424
4718
|
if (ext && EMAIL_EXTENSIONS2.has(ext)) return /* @__PURE__ */ jsxRuntime.jsx(EmlIcon, { size });
|
|
4425
4719
|
return /* @__PURE__ */ jsxRuntime.jsx(PdfIcon, { size });
|
|
4426
4720
|
}
|
|
@@ -4723,6 +5017,7 @@ exports.UserMenu = UserMenu;
|
|
|
4723
5017
|
exports.VIDEO_MIME_PREFERENCE = VIDEO_MIME_PREFERENCE;
|
|
4724
5018
|
exports.VISIBILITY_ICONS = VISIBILITY_ICONS;
|
|
4725
5019
|
exports.VerifiedBadge = VerifiedBadge;
|
|
5020
|
+
exports.VerifiedToggle = VerifiedToggle;
|
|
4726
5021
|
exports.VidIcon = VidIcon;
|
|
4727
5022
|
exports.VisibilityIcon = VisibilityIcon;
|
|
4728
5023
|
exports.VisibilityToggle = VisibilityToggle;
|
|
@@ -4737,7 +5032,10 @@ exports.configureStatusRegistry = configureStatusRegistry;
|
|
|
4737
5032
|
exports.createChunkedRecorder = createChunkedRecorder;
|
|
4738
5033
|
exports.flushSegmenter = flushSegmenter;
|
|
4739
5034
|
exports.formatElapsed = formatElapsed;
|
|
5035
|
+
exports.formatFriendlyDate = formatFriendlyDate;
|
|
5036
|
+
exports.friendlyFileType = friendlyFileType;
|
|
4740
5037
|
exports.getDocIcon = getDocIcon;
|
|
5038
|
+
exports.getDocumentTitle = getDocumentTitle;
|
|
4741
5039
|
exports.getEntityColor = getEntityColor2;
|
|
4742
5040
|
exports.getEntityColorStyles = getEntityColorStyles;
|
|
4743
5041
|
exports.getEntityIcon = getEntityIcon;
|
|
@@ -4746,11 +5044,21 @@ exports.getStatusVariant = getStatusVariant;
|
|
|
4746
5044
|
exports.getTagTypeIcon = getTagTypeIcon;
|
|
4747
5045
|
exports.getTagTypeLabel = getTagTypeLabel;
|
|
4748
5046
|
exports.getWorkspaceColor = getWorkspaceColor;
|
|
5047
|
+
exports.isAudioFile = isAudioFile;
|
|
5048
|
+
exports.isDownloadOnlyFile = isDownloadOnlyFile;
|
|
5049
|
+
exports.isImageDocument = isImageDocument;
|
|
5050
|
+
exports.isImageFile = isImageFile;
|
|
5051
|
+
exports.isMediaFile = isMediaFile;
|
|
5052
|
+
exports.isVideoFile = isVideoFile;
|
|
4749
5053
|
exports.levelFromRms = levelFromRms;
|
|
4750
5054
|
exports.pickRecorderMimeType = pickRecorderMimeType;
|
|
4751
5055
|
exports.returnFocusToMark = returnFocusToMark;
|
|
4752
5056
|
exports.stepSegmenter = stepSegmenter;
|
|
5057
|
+
exports.tagKindNouns = tagKindNouns;
|
|
5058
|
+
exports.tagKindTitle = tagKindTitle;
|
|
4753
5059
|
exports.toggleVariants = toggleVariants;
|
|
4754
5060
|
exports.useAudioRecorder = useAudioRecorder;
|
|
4755
|
-
|
|
4756
|
-
|
|
5061
|
+
exports.useDictateContext = useDictateContext;
|
|
5062
|
+
exports.usesOriginalBytesForViewer = usesOriginalBytesForViewer;
|
|
5063
|
+
//# sourceMappingURL=chunk-L66ZJ2UI.cjs.map
|
|
5064
|
+
//# sourceMappingURL=chunk-L66ZJ2UI.cjs.map
|