@flamingo-stack/openframe-frontend-core 0.0.552 → 0.0.553-1815.4815.1
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/{chunk-RMWLUKTC.cjs → chunk-2EOL4GLM.cjs} +11 -11
- package/dist/{chunk-RMWLUKTC.cjs.map → chunk-2EOL4GLM.cjs.map} +1 -1
- package/dist/{chunk-4XG7TG7B.cjs → chunk-2JWKBJIP.cjs} +7 -7
- package/dist/{chunk-4XG7TG7B.cjs.map → chunk-2JWKBJIP.cjs.map} +1 -1
- package/dist/{chunk-PVPXI5V6.cjs → chunk-2T5ZC2RO.cjs} +31 -31
- package/dist/{chunk-PVPXI5V6.cjs.map → chunk-2T5ZC2RO.cjs.map} +1 -1
- package/dist/{chunk-RMTTW7LG.cjs → chunk-5FMWTAX5.cjs} +27 -27
- package/dist/{chunk-RMTTW7LG.cjs.map → chunk-5FMWTAX5.cjs.map} +1 -1
- package/dist/{chunk-MVE2YQVG.cjs → chunk-6746LTZC.cjs} +20 -20
- package/dist/{chunk-MVE2YQVG.cjs.map → chunk-6746LTZC.cjs.map} +1 -1
- package/dist/{chunk-6MHMEF5W.cjs → chunk-6POBPMSN.cjs} +39 -39
- package/dist/{chunk-6MHMEF5W.cjs.map → chunk-6POBPMSN.cjs.map} +1 -1
- package/dist/{chunk-6J6Q5QEM.cjs → chunk-7BUY7VKW.cjs} +4 -4
- package/dist/{chunk-6J6Q5QEM.cjs.map → chunk-7BUY7VKW.cjs.map} +1 -1
- package/dist/{chunk-Z5UK7SKC.js → chunk-7FWRJBNW.js} +4 -4
- package/dist/{chunk-KSGQG6WU.js → chunk-AADAEOJA.js} +2 -2
- package/dist/{chunk-SIXNMDYY.js → chunk-AXUS7Y7N.js} +2 -2
- package/dist/{chunk-7TRIUG7Q.js → chunk-CM75WCSO.js} +5 -5
- package/dist/{chunk-SXXIV7IL.cjs → chunk-DG5D5XCS.cjs} +86 -86
- package/dist/{chunk-SXXIV7IL.cjs.map → chunk-DG5D5XCS.cjs.map} +1 -1
- package/dist/{chunk-RJSDYOFD.js → chunk-HECGJFP4.js} +2 -2
- package/dist/{chunk-X4RCWYYF.cjs → chunk-HUZD2MJC.cjs} +807 -695
- package/dist/chunk-HUZD2MJC.cjs.map +1 -0
- package/dist/{chunk-HK5YRHEN.cjs → chunk-I7Y2S3DR.cjs} +9 -9
- package/dist/{chunk-HK5YRHEN.cjs.map → chunk-I7Y2S3DR.cjs.map} +1 -1
- package/dist/{chunk-TI75367M.js → chunk-K5SQ625X.js} +660 -548
- package/dist/chunk-K5SQ625X.js.map +1 -0
- package/dist/{chunk-DOPZ5LCH.cjs → chunk-LXLAVFK3.cjs} +14 -14
- package/dist/{chunk-DOPZ5LCH.cjs.map → chunk-LXLAVFK3.cjs.map} +1 -1
- package/dist/{chunk-6XOJTTWY.js → chunk-M2XQSLNS.js} +2 -2
- package/dist/{chunk-XEOZB5DX.cjs → chunk-PNNO5CMG.cjs} +3 -3
- package/dist/{chunk-XEOZB5DX.cjs.map → chunk-PNNO5CMG.cjs.map} +1 -1
- package/dist/{chunk-OVQ3O66O.cjs → chunk-QD7WBLQ7.cjs} +5 -5
- package/dist/{chunk-OVQ3O66O.cjs.map → chunk-QD7WBLQ7.cjs.map} +1 -1
- package/dist/{chunk-CMDPARDV.js → chunk-QJ4KTTJB.js} +2 -2
- package/dist/{chunk-7MPOW46J.js → chunk-RXMDOLDH.js} +2 -2
- package/dist/{chunk-Y64725GI.cjs → chunk-SQADRYGF.cjs} +61 -61
- package/dist/{chunk-Y64725GI.cjs.map → chunk-SQADRYGF.cjs.map} +1 -1
- package/dist/{chunk-Y6PD76R6.js → chunk-SUGA42SR.js} +2 -2
- package/dist/{chunk-WXDDPK7T.js → chunk-VW5KSRGZ.js} +4 -4
- package/dist/{chunk-BFOXIIM4.js → chunk-Y7SI6UU5.js} +2 -2
- package/dist/{chunk-RJEP74Z4.js → chunk-YHMRC24T.js} +2 -2
- package/dist/{chunk-4DD3223G.js → chunk-ZK2UHBEH.js} +6 -6
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/board/board-column.d.ts +6 -3
- package/dist/components/features/board/board-column.d.ts.map +1 -1
- package/dist/components/features/board/board.d.ts +3 -3
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/drop-target.d.ts +79 -0
- package/dist/components/features/board/drop-target.d.ts.map +1 -0
- package/dist/components/features/board/ticket-card.d.ts +11 -6
- package/dist/components/features/board/ticket-card.d.ts.map +1 -1
- package/dist/components/features/board/use-lane-scroll-anchor.d.ts +24 -0
- package/dist/components/features/board/use-lane-scroll-anchor.d.ts.map +1 -0
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +131 -131
- package/dist/components/index.js +11 -11
- package/dist/components/meeting-scheduler/index.cjs +28 -28
- package/dist/components/meeting-scheduler/index.js +3 -3
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/__tests__/board-drag-guard.test.tsx +146 -0
- package/src/__tests__/board-drop-target.test.ts +262 -0
- package/src/components/features/board/board-column.tsx +50 -40
- package/src/components/features/board/board.tsx +48 -40
- package/src/components/features/board/drop-target.ts +188 -0
- package/src/components/features/board/ticket-card.tsx +36 -16
- package/src/components/features/board/use-lane-scroll-anchor.ts +75 -0
- package/src/stories/Board.stories.tsx +16 -7
- package/dist/chunk-TI75367M.js.map +0 -1
- package/dist/chunk-X4RCWYYF.cjs.map +0 -1
- /package/dist/{chunk-Z5UK7SKC.js.map → chunk-7FWRJBNW.js.map} +0 -0
- /package/dist/{chunk-KSGQG6WU.js.map → chunk-AADAEOJA.js.map} +0 -0
- /package/dist/{chunk-SIXNMDYY.js.map → chunk-AXUS7Y7N.js.map} +0 -0
- /package/dist/{chunk-7TRIUG7Q.js.map → chunk-CM75WCSO.js.map} +0 -0
- /package/dist/{chunk-RJSDYOFD.js.map → chunk-HECGJFP4.js.map} +0 -0
- /package/dist/{chunk-6XOJTTWY.js.map → chunk-M2XQSLNS.js.map} +0 -0
- /package/dist/{chunk-CMDPARDV.js.map → chunk-QJ4KTTJB.js.map} +0 -0
- /package/dist/{chunk-7MPOW46J.js.map → chunk-RXMDOLDH.js.map} +0 -0
- /package/dist/{chunk-Y6PD76R6.js.map → chunk-SUGA42SR.js.map} +0 -0
- /package/dist/{chunk-WXDDPK7T.js.map → chunk-VW5KSRGZ.js.map} +0 -0
- /package/dist/{chunk-BFOXIIM4.js.map → chunk-Y7SI6UU5.js.map} +0 -0
- /package/dist/{chunk-RJEP74Z4.js.map → chunk-YHMRC24T.js.map} +0 -0
- /package/dist/{chunk-4DD3223G.js.map → chunk-ZK2UHBEH.js.map} +0 -0
|
@@ -292,7 +292,7 @@ import {
|
|
|
292
292
|
|
|
293
293
|
// src/components/pagination.tsx
|
|
294
294
|
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight6, MoreHorizontal as MoreHorizontal2 } from "lucide-react";
|
|
295
|
-
import * as
|
|
295
|
+
import * as React126 from "react";
|
|
296
296
|
import { jsx as jsx339, jsxs as jsxs265 } from "react/jsx-runtime";
|
|
297
297
|
var Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationEllipsis, PaginationPrevious, PaginationNext;
|
|
298
298
|
var init_pagination = __esm({
|
|
@@ -384,19 +384,19 @@ var init_pagination = __esm({
|
|
|
384
384
|
) })
|
|
385
385
|
] }) });
|
|
386
386
|
};
|
|
387
|
-
PaginationContent =
|
|
387
|
+
PaginationContent = React126.forwardRef(
|
|
388
388
|
({ className, ...props }, ref) => {
|
|
389
389
|
return /* @__PURE__ */ jsx339("ul", { ref, className: cn("flex items-center justify-center", className), ...props });
|
|
390
390
|
}
|
|
391
391
|
);
|
|
392
392
|
PaginationContent.displayName = "PaginationContent";
|
|
393
|
-
PaginationItem =
|
|
393
|
+
PaginationItem = React126.forwardRef(
|
|
394
394
|
({ className, ...props }, ref) => {
|
|
395
395
|
return /* @__PURE__ */ jsx339("li", { ref, className: cn("", className), ...props });
|
|
396
396
|
}
|
|
397
397
|
);
|
|
398
398
|
PaginationItem.displayName = "PaginationItem";
|
|
399
|
-
PaginationLink =
|
|
399
|
+
PaginationLink = React126.forwardRef(
|
|
400
400
|
({ className, ...props }, ref) => {
|
|
401
401
|
return /* @__PURE__ */ jsx339(
|
|
402
402
|
"button",
|
|
@@ -412,7 +412,7 @@ var init_pagination = __esm({
|
|
|
412
412
|
}
|
|
413
413
|
);
|
|
414
414
|
PaginationLink.displayName = "PaginationLink";
|
|
415
|
-
PaginationEllipsis =
|
|
415
|
+
PaginationEllipsis = React126.forwardRef(
|
|
416
416
|
({ className, ...props }, ref) => {
|
|
417
417
|
return /* @__PURE__ */ jsxs265(
|
|
418
418
|
"span",
|
|
@@ -429,7 +429,7 @@ var init_pagination = __esm({
|
|
|
429
429
|
}
|
|
430
430
|
);
|
|
431
431
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
432
|
-
PaginationPrevious =
|
|
432
|
+
PaginationPrevious = React126.forwardRef(
|
|
433
433
|
({ className, ...props }, ref) => {
|
|
434
434
|
return /* @__PURE__ */ jsxs265(Button, { ref, variant: "outline", size: "icon", className: cn("h-10 w-10", className), ...props, children: [
|
|
435
435
|
/* @__PURE__ */ jsx339(ChevronLeft2, { className: "h-4 w-4" }),
|
|
@@ -438,7 +438,7 @@ var init_pagination = __esm({
|
|
|
438
438
|
}
|
|
439
439
|
);
|
|
440
440
|
PaginationPrevious.displayName = "PaginationPrevious";
|
|
441
|
-
PaginationNext =
|
|
441
|
+
PaginationNext = React126.forwardRef(
|
|
442
442
|
({ className, ...props }, ref) => {
|
|
443
443
|
return /* @__PURE__ */ jsxs265(Button, { ref, variant: "outline", size: "icon", className: cn("h-10 w-10", className), ...props, children: [
|
|
444
444
|
/* @__PURE__ */ jsx339(ChevronRight6, { className: "h-4 w-4" }),
|
|
@@ -30246,7 +30246,7 @@ function OrganizationCard({
|
|
|
30246
30246
|
|
|
30247
30247
|
// src/components/ui/service-card.tsx
|
|
30248
30248
|
init_cn();
|
|
30249
|
-
import { useMemo as
|
|
30249
|
+
import { useMemo as useMemo45, useState as useState98 } from "react";
|
|
30250
30250
|
import { ExternalLink as ExternalLink8 } from "lucide-react";
|
|
30251
30251
|
|
|
30252
30252
|
// src/components/providers/dynamic-theme-provider.tsx
|
|
@@ -39526,15 +39526,12 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
39526
39526
|
}
|
|
39527
39527
|
|
|
39528
39528
|
// src/components/features/board/board.tsx
|
|
39529
|
-
import
|
|
39529
|
+
import { Fragment as Fragment56, useCallback as useCallback35, useEffect as useEffect69, useMemo as useMemo41, useRef as useRef50, useState as useState90 } from "react";
|
|
39530
39530
|
import {
|
|
39531
39531
|
DndContext,
|
|
39532
39532
|
DragOverlay,
|
|
39533
39533
|
KeyboardSensor,
|
|
39534
39534
|
PointerSensor,
|
|
39535
|
-
closestCorners,
|
|
39536
|
-
pointerWithin,
|
|
39537
|
-
rectIntersection,
|
|
39538
39535
|
useSensor,
|
|
39539
39536
|
useSensors
|
|
39540
39537
|
} from "@dnd-kit/core";
|
|
@@ -39544,7 +39541,7 @@ init_cn();
|
|
|
39544
39541
|
// src/components/features/board/board-column.tsx
|
|
39545
39542
|
import { useDroppable } from "@dnd-kit/core";
|
|
39546
39543
|
import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
39547
|
-
import
|
|
39544
|
+
import { memo as memo8, useEffect as useEffect68, useMemo as useMemo40, useRef as useRef49 } from "react";
|
|
39548
39545
|
init_cn();
|
|
39549
39546
|
|
|
39550
39547
|
// src/components/features/board/board-column-header.tsx
|
|
@@ -39657,7 +39654,7 @@ function tintOnDark(hex) {
|
|
|
39657
39654
|
init_next_link();
|
|
39658
39655
|
import { useSortable } from "@dnd-kit/sortable";
|
|
39659
39656
|
import { CSS } from "@dnd-kit/utilities";
|
|
39660
|
-
import
|
|
39657
|
+
import { memo as memo7, useMemo as useMemo39 } from "react";
|
|
39661
39658
|
init_cn();
|
|
39662
39659
|
|
|
39663
39660
|
// src/components/features/board/board-ticket-approval.tsx
|
|
@@ -39712,6 +39709,35 @@ function BoardTicketApproval({ pendingApproval, onApprove, onReject }) {
|
|
|
39712
39709
|
] });
|
|
39713
39710
|
}
|
|
39714
39711
|
|
|
39712
|
+
// src/components/features/board/use-lane-scroll-anchor.ts
|
|
39713
|
+
import { useRef as useRef48 } from "react";
|
|
39714
|
+
var TICKET_ID_ATTRIBUTE = "data-ticket-id";
|
|
39715
|
+
function cardPositions(root) {
|
|
39716
|
+
return Array.from(root.querySelectorAll(`[${TICKET_ID_ATTRIBUTE}]`)).map((element) => ({
|
|
39717
|
+
id: element.getAttribute(TICKET_ID_ATTRIBUTE) ?? "",
|
|
39718
|
+
offsetTop: element.offsetTop
|
|
39719
|
+
}));
|
|
39720
|
+
}
|
|
39721
|
+
function useLaneScrollAnchor(scrollRef, tickets) {
|
|
39722
|
+
const positionsRef = useRef48([]);
|
|
39723
|
+
useIsomorphicLayoutEffect(() => {
|
|
39724
|
+
const root = scrollRef.current;
|
|
39725
|
+
if (!root) return;
|
|
39726
|
+
const previous = positionsRef.current;
|
|
39727
|
+
const scrollTop = root.scrollTop;
|
|
39728
|
+
const current = cardPositions(root);
|
|
39729
|
+
if (previous.length > 0 && scrollTop > 0) {
|
|
39730
|
+
const anchor = previous.find((card) => card.offsetTop >= scrollTop) ?? previous[previous.length - 1];
|
|
39731
|
+
const moved = current.find((card) => card.id === anchor.id);
|
|
39732
|
+
if (moved) {
|
|
39733
|
+
const drift = moved.offsetTop - anchor.offsetTop;
|
|
39734
|
+
if (Math.abs(drift) >= 1) root.scrollTop = scrollTop + drift;
|
|
39735
|
+
}
|
|
39736
|
+
}
|
|
39737
|
+
positionsRef.current = current;
|
|
39738
|
+
}, [tickets]);
|
|
39739
|
+
}
|
|
39740
|
+
|
|
39715
39741
|
// src/components/features/board/ticket-card.tsx
|
|
39716
39742
|
import { Fragment as Fragment54, jsx as jsx297, jsxs as jsxs228 } from "react/jsx-runtime";
|
|
39717
39743
|
var PRIORITY_COLOR_CLASS = {
|
|
@@ -39822,7 +39848,7 @@ function TicketCardView({ className, ...bodyProps }) {
|
|
|
39822
39848
|
}
|
|
39823
39849
|
);
|
|
39824
39850
|
}
|
|
39825
|
-
|
|
39851
|
+
var TicketCard = memo7(function TicketCard2({
|
|
39826
39852
|
ticket,
|
|
39827
39853
|
columnId,
|
|
39828
39854
|
columnColor,
|
|
@@ -39833,7 +39859,7 @@ function TicketCard({
|
|
|
39833
39859
|
onApprove,
|
|
39834
39860
|
onReject
|
|
39835
39861
|
}) {
|
|
39836
|
-
const sortableData =
|
|
39862
|
+
const sortableData = useMemo39(() => ({ columnId, type: "ticket" }), [columnId]);
|
|
39837
39863
|
const sortable = useSortable({ id: ticket.id, data: sortableData, disabled: dragDisabled });
|
|
39838
39864
|
const showNewMessage = !!ticket.hasNewMessage && !!columnColor;
|
|
39839
39865
|
const style = isOverlay ? {} : {
|
|
@@ -39844,15 +39870,18 @@ function TicketCard({
|
|
|
39844
39870
|
const handleClick = (e) => {
|
|
39845
39871
|
if (sortable.isDragging) e.preventDefault();
|
|
39846
39872
|
};
|
|
39847
|
-
const body =
|
|
39848
|
-
|
|
39849
|
-
|
|
39850
|
-
|
|
39851
|
-
|
|
39852
|
-
|
|
39853
|
-
|
|
39854
|
-
|
|
39855
|
-
|
|
39873
|
+
const body = useMemo39(
|
|
39874
|
+
() => /* @__PURE__ */ jsx297(
|
|
39875
|
+
TicketCardBody,
|
|
39876
|
+
{
|
|
39877
|
+
ticket,
|
|
39878
|
+
columnColor,
|
|
39879
|
+
renderAssignSlot,
|
|
39880
|
+
onApprove: onApprove ? (requestId) => onApprove(ticket.id, requestId) : void 0,
|
|
39881
|
+
onReject: onReject ? (requestId) => onReject(ticket.id, requestId) : void 0
|
|
39882
|
+
}
|
|
39883
|
+
),
|
|
39884
|
+
[ticket, columnColor, renderAssignSlot, onApprove, onReject]
|
|
39856
39885
|
);
|
|
39857
39886
|
const cardClasses = cn(
|
|
39858
39887
|
TICKET_CARD_SHELL,
|
|
@@ -39864,6 +39893,9 @@ function TicketCard({
|
|
|
39864
39893
|
ref: isOverlay ? void 0 : sortable.setNodeRef,
|
|
39865
39894
|
style,
|
|
39866
39895
|
className: cardClasses,
|
|
39896
|
+
// Read by the lane's scroll anchor to keep the list still when tickets are
|
|
39897
|
+
// inserted above the viewport — see `use-lane-scroll-anchor.ts`.
|
|
39898
|
+
...isOverlay ? {} : { [TICKET_ID_ATTRIBUTE]: ticket.id },
|
|
39867
39899
|
...isOverlay ? {} : sortable.attributes,
|
|
39868
39900
|
...isOverlay ? {} : sortable.listeners
|
|
39869
39901
|
};
|
|
@@ -39899,7 +39931,7 @@ function TicketCard({
|
|
|
39899
39931
|
),
|
|
39900
39932
|
/* @__PURE__ */ jsx297("div", { className: cn("pointer-events-none", innerWrapperClass), children: body })
|
|
39901
39933
|
] });
|
|
39902
|
-
}
|
|
39934
|
+
});
|
|
39903
39935
|
function TicketTagRow({ tags }) {
|
|
39904
39936
|
const visible = tags.slice(0, MAX_VISIBLE_TAGS);
|
|
39905
39937
|
const hidden = tags.length - visible.length;
|
|
@@ -39910,10 +39942,10 @@ function TicketTagRow({ tags }) {
|
|
|
39910
39942
|
}
|
|
39911
39943
|
|
|
39912
39944
|
// src/components/features/board/ticket-card-skeleton.tsx
|
|
39913
|
-
import * as
|
|
39945
|
+
import * as React110 from "react";
|
|
39914
39946
|
init_cn();
|
|
39915
39947
|
import { jsx as jsx298, jsxs as jsxs229 } from "react/jsx-runtime";
|
|
39916
|
-
var TicketCardSkeleton =
|
|
39948
|
+
var TicketCardSkeleton = React110.forwardRef(
|
|
39917
39949
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxs229(
|
|
39918
39950
|
"div",
|
|
39919
39951
|
{
|
|
@@ -39949,7 +39981,7 @@ TicketCardSkeleton.displayName = "TicketCardSkeleton";
|
|
|
39949
39981
|
|
|
39950
39982
|
// src/components/features/board/board-column.tsx
|
|
39951
39983
|
import { Fragment as Fragment55, jsx as jsx299, jsxs as jsxs230 } from "react/jsx-runtime";
|
|
39952
|
-
|
|
39984
|
+
var BoardColumn = memo8(function BoardColumn2({
|
|
39953
39985
|
column,
|
|
39954
39986
|
collapsed = false,
|
|
39955
39987
|
onToggleCollapse,
|
|
@@ -39964,16 +39996,24 @@ function BoardColumn({
|
|
|
39964
39996
|
joinLeft = false,
|
|
39965
39997
|
joinRight = false
|
|
39966
39998
|
}) {
|
|
39999
|
+
const droppableData = useMemo40(() => ({ columnId: column.id, type: "column" }), [column.id]);
|
|
40000
|
+
const { setNodeRef: setLaneRef, isOver } = useDroppable({
|
|
40001
|
+
id: `column:${column.id}`,
|
|
40002
|
+
data: droppableData,
|
|
40003
|
+
disabled: column.dropDisabled || collapsed
|
|
40004
|
+
});
|
|
39967
40005
|
return /* @__PURE__ */ jsxs230(
|
|
39968
40006
|
"div",
|
|
39969
40007
|
{
|
|
40008
|
+
ref: setLaneRef,
|
|
39970
40009
|
className: cn(
|
|
39971
40010
|
"flex h-full shrink-0 flex-col gap-[var(--spacing-system-sf)] overflow-hidden rounded-md border border-ods-border p-[var(--spacing-system-sf)]",
|
|
39972
40011
|
"transition-[width] duration-300 ease-out",
|
|
39973
40012
|
collapsed ? "w-14" : "w-[400px]",
|
|
39974
40013
|
column.system && "bg-ods-card",
|
|
39975
40014
|
joinLeft && "rounded-l-none border-l-0",
|
|
39976
|
-
joinRight && "rounded-r-none"
|
|
40015
|
+
joinRight && "rounded-r-none",
|
|
40016
|
+
isOver && "outline outline-2 -outline-offset-2 outline-ods-focus"
|
|
39977
40017
|
),
|
|
39978
40018
|
style: column.system ? void 0 : { backgroundColor: tintOnDark(column.color) },
|
|
39979
40019
|
children: [
|
|
@@ -40005,25 +40045,25 @@ function BoardColumn({
|
|
|
40005
40045
|
]
|
|
40006
40046
|
}
|
|
40007
40047
|
);
|
|
40008
|
-
}
|
|
40009
|
-
function ColumnBody({
|
|
40010
|
-
|
|
40011
|
-
|
|
40012
|
-
|
|
40013
|
-
|
|
40014
|
-
|
|
40015
|
-
|
|
40016
|
-
|
|
40017
|
-
|
|
40018
|
-
|
|
40019
|
-
|
|
40020
|
-
const
|
|
40021
|
-
|
|
40022
|
-
const loadMoreRef =
|
|
40048
|
+
});
|
|
40049
|
+
function ColumnBody({
|
|
40050
|
+
column,
|
|
40051
|
+
getTicketHref,
|
|
40052
|
+
renderAssignSlot,
|
|
40053
|
+
onApprove,
|
|
40054
|
+
onReject,
|
|
40055
|
+
onLoadMore,
|
|
40056
|
+
loadMoreRootMargin
|
|
40057
|
+
}) {
|
|
40058
|
+
const ticketIds = useMemo40(() => column.tickets.map((t) => t.id), [column.tickets]);
|
|
40059
|
+
const scrollRef = useRef49(null);
|
|
40060
|
+
const sentinelRef = useRef49(null);
|
|
40061
|
+
useLaneScrollAnchor(scrollRef, column.tickets);
|
|
40062
|
+
const loadMoreRef = useRef49(onLoadMore);
|
|
40023
40063
|
loadMoreRef.current = onLoadMore;
|
|
40024
|
-
const columnIdRef =
|
|
40064
|
+
const columnIdRef = useRef49(column.id);
|
|
40025
40065
|
columnIdRef.current = column.id;
|
|
40026
|
-
|
|
40066
|
+
useEffect68(() => {
|
|
40027
40067
|
if (!column.hasMore || column.isLoadingMore) return;
|
|
40028
40068
|
const sentinel = sentinelRef.current;
|
|
40029
40069
|
const root = scrollRef.current;
|
|
@@ -40039,48 +40079,40 @@ function ColumnBody({ column, getTicketHref, renderAssignSlot, onApprove, onReje
|
|
|
40039
40079
|
observer.observe(sentinel);
|
|
40040
40080
|
return () => observer.disconnect();
|
|
40041
40081
|
}, [column.hasMore, column.isLoadingMore, loadMoreRootMargin]);
|
|
40042
|
-
|
|
40043
|
-
|
|
40044
|
-
|
|
40045
|
-
|
|
40046
|
-
|
|
40047
|
-
|
|
40048
|
-
|
|
40049
|
-
|
|
40050
|
-
|
|
40051
|
-
|
|
40052
|
-
|
|
40053
|
-
|
|
40054
|
-
|
|
40055
|
-
|
|
40056
|
-
|
|
40057
|
-
|
|
40058
|
-
|
|
40059
|
-
|
|
40060
|
-
|
|
40061
|
-
|
|
40062
|
-
|
|
40063
|
-
|
|
40064
|
-
|
|
40065
|
-
|
|
40066
|
-
|
|
40067
|
-
|
|
40068
|
-
|
|
40069
|
-
|
|
40070
|
-
|
|
40071
|
-
|
|
40072
|
-
column.isLoadingMore && !column.isLoading && /* @__PURE__ */ jsx299(TicketCardSkeleton, {}),
|
|
40073
|
-
column.hasMore && /* @__PURE__ */ jsx299("div", { ref: sentinelRef, "aria-hidden": true, className: "h-1 shrink-0" })
|
|
40074
|
-
]
|
|
40075
|
-
}
|
|
40082
|
+
return (
|
|
40083
|
+
// `overflow-anchor:none` hands scroll anchoring to `useLaneScrollAnchor`
|
|
40084
|
+
// wholesale. The browser's own anchoring is unusable here — it silently
|
|
40085
|
+
// skips transformed elements, so it works between drags and does nothing
|
|
40086
|
+
// during one — and leaving both on double-corrects every insertion.
|
|
40087
|
+
/* @__PURE__ */ jsxs230(
|
|
40088
|
+
"div",
|
|
40089
|
+
{
|
|
40090
|
+
ref: scrollRef,
|
|
40091
|
+
className: "flex min-h-0 flex-1 flex-col gap-[var(--spacing-system-xs)] overflow-y-auto [overflow-anchor:none]",
|
|
40092
|
+
children: [
|
|
40093
|
+
/* @__PURE__ */ jsx299(SortableContext, { items: ticketIds, strategy: verticalListSortingStrategy, children: column.isLoading ? /* @__PURE__ */ jsx299(SkeletonStack, {}) : column.tickets.length === 0 ? /* @__PURE__ */ jsx299(EmptyState2, {}) : column.tickets.map((t) => /* @__PURE__ */ jsx299(
|
|
40094
|
+
TicketCard,
|
|
40095
|
+
{
|
|
40096
|
+
ticket: t,
|
|
40097
|
+
columnId: column.id,
|
|
40098
|
+
columnColor: column.color,
|
|
40099
|
+
href: getTicketHref?.(t.id),
|
|
40100
|
+
renderAssignSlot,
|
|
40101
|
+
onApprove,
|
|
40102
|
+
onReject,
|
|
40103
|
+
dragDisabled: column.dragDisabled
|
|
40104
|
+
},
|
|
40105
|
+
t.id
|
|
40106
|
+
)) }),
|
|
40107
|
+
column.isLoadingMore && !column.isLoading && /* @__PURE__ */ jsx299(TicketCardSkeleton, {}),
|
|
40108
|
+
column.hasMore && /* @__PURE__ */ jsx299("div", { ref: sentinelRef, "aria-hidden": true, className: "h-1 shrink-0" })
|
|
40109
|
+
]
|
|
40110
|
+
}
|
|
40111
|
+
)
|
|
40076
40112
|
);
|
|
40077
40113
|
}
|
|
40078
40114
|
function SkeletonStack({ count = 4 }) {
|
|
40079
|
-
|
|
40080
|
-
() => Array.from({ length: count }, () => Math.random().toString(36).slice(2)),
|
|
40081
|
-
[count]
|
|
40082
|
-
);
|
|
40083
|
-
return /* @__PURE__ */ jsx299(Fragment55, { children: keys.map((k) => /* @__PURE__ */ jsx299(TicketCardSkeleton, {}, k)) });
|
|
40115
|
+
return /* @__PURE__ */ jsx299(Fragment55, { children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx299(TicketCardSkeleton, {}, `skeleton-${i}`)) });
|
|
40084
40116
|
}
|
|
40085
40117
|
function EmptyState2() {
|
|
40086
40118
|
return /* @__PURE__ */ jsxs230("div", { className: "flex flex-1 flex-col items-center justify-center gap-[var(--spacing-system-lf)] p-[var(--spacing-system-lf)] text-center text-ods-text-secondary", children: [
|
|
@@ -40092,8 +40124,92 @@ function EmptyState2() {
|
|
|
40092
40124
|
] });
|
|
40093
40125
|
}
|
|
40094
40126
|
|
|
40127
|
+
// src/components/features/board/drop-target.ts
|
|
40128
|
+
import {
|
|
40129
|
+
closestCorners,
|
|
40130
|
+
pointerWithin,
|
|
40131
|
+
rectIntersection
|
|
40132
|
+
} from "@dnd-kit/core";
|
|
40133
|
+
function droppableDataOf(collision) {
|
|
40134
|
+
return collision.data?.droppableContainer?.data?.current;
|
|
40135
|
+
}
|
|
40136
|
+
function detectCollisions(args, pointerHits) {
|
|
40137
|
+
const intersections = pointerHits.length > 0 ? pointerHits : rectIntersection(args);
|
|
40138
|
+
const ticketHit = intersections.find((c) => droppableDataOf(c)?.type === "ticket");
|
|
40139
|
+
if (ticketHit) return [ticketHit];
|
|
40140
|
+
const columnHit = intersections.find((c) => droppableDataOf(c)?.type === "column");
|
|
40141
|
+
if (columnHit) {
|
|
40142
|
+
const { columnId } = droppableDataOf(columnHit) ?? {};
|
|
40143
|
+
const ticketsInColumn = args.droppableContainers.filter((container) => {
|
|
40144
|
+
if (container.id === args.active.id) return false;
|
|
40145
|
+
const data = container.data.current;
|
|
40146
|
+
return data?.type === "ticket" && data.columnId === columnId;
|
|
40147
|
+
});
|
|
40148
|
+
if (ticketsInColumn.length > 0) {
|
|
40149
|
+
const closest = closestCorners({ ...args, droppableContainers: ticketsInColumn });
|
|
40150
|
+
if (closest.length > 0) return closest;
|
|
40151
|
+
}
|
|
40152
|
+
return [columnHit];
|
|
40153
|
+
}
|
|
40154
|
+
return closestCorners(args);
|
|
40155
|
+
}
|
|
40156
|
+
var animationFrameScheduler = (callback) => {
|
|
40157
|
+
const id = requestAnimationFrame(callback);
|
|
40158
|
+
return () => cancelAnimationFrame(id);
|
|
40159
|
+
};
|
|
40160
|
+
function createDropTargetResolver(scheduleFrame = animationFrameScheduler) {
|
|
40161
|
+
let settling = false;
|
|
40162
|
+
let cancelFrame = null;
|
|
40163
|
+
let lastOverId = null;
|
|
40164
|
+
const clearFrame = () => {
|
|
40165
|
+
cancelFrame?.();
|
|
40166
|
+
cancelFrame = null;
|
|
40167
|
+
};
|
|
40168
|
+
const scheduleRelease = () => {
|
|
40169
|
+
clearFrame();
|
|
40170
|
+
cancelFrame = scheduleFrame(() => {
|
|
40171
|
+
cancelFrame = null;
|
|
40172
|
+
settling = false;
|
|
40173
|
+
});
|
|
40174
|
+
};
|
|
40175
|
+
const keepLastTarget = (args) => {
|
|
40176
|
+
if (lastOverId === null) return null;
|
|
40177
|
+
const last = args.droppableContainers.find((c) => c.id === lastOverId);
|
|
40178
|
+
return last ? [{ id: last.id, data: { droppableContainer: last, value: 0 } }] : null;
|
|
40179
|
+
};
|
|
40180
|
+
return {
|
|
40181
|
+
detect: (args) => {
|
|
40182
|
+
if (settling) {
|
|
40183
|
+
const frozen = keepLastTarget(args);
|
|
40184
|
+
if (frozen) return frozen;
|
|
40185
|
+
}
|
|
40186
|
+
const pointerHits = args.pointerCoordinates ? pointerWithin(args) : [];
|
|
40187
|
+
if (args.pointerCoordinates && pointerHits.length === 0) {
|
|
40188
|
+
const held = keepLastTarget(args);
|
|
40189
|
+
if (held) return held;
|
|
40190
|
+
}
|
|
40191
|
+
const collisions = detectCollisions(args, pointerHits);
|
|
40192
|
+
if (collisions.length > 0) lastOverId = collisions[0].id;
|
|
40193
|
+
return collisions;
|
|
40194
|
+
},
|
|
40195
|
+
freeze: () => {
|
|
40196
|
+
settling = true;
|
|
40197
|
+
scheduleRelease();
|
|
40198
|
+
},
|
|
40199
|
+
settle: () => {
|
|
40200
|
+
if (settling) scheduleRelease();
|
|
40201
|
+
},
|
|
40202
|
+
release: () => {
|
|
40203
|
+
clearFrame();
|
|
40204
|
+
settling = false;
|
|
40205
|
+
lastOverId = null;
|
|
40206
|
+
},
|
|
40207
|
+
dispose: clearFrame
|
|
40208
|
+
};
|
|
40209
|
+
}
|
|
40210
|
+
|
|
40095
40211
|
// src/components/features/board/use-board-collapse.ts
|
|
40096
|
-
import { useCallback as
|
|
40212
|
+
import { useCallback as useCallback34, useState as useState89 } from "react";
|
|
40097
40213
|
function useBoardCollapse(storageKey) {
|
|
40098
40214
|
const [persisted, setPersisted] = useLocalStorage(
|
|
40099
40215
|
storageKey ?? "__board_collapse_unused__",
|
|
@@ -40102,13 +40218,13 @@ function useBoardCollapse(storageKey) {
|
|
|
40102
40218
|
const [memory, setMemory] = useState89({});
|
|
40103
40219
|
const collapsed = storageKey ? persisted : memory;
|
|
40104
40220
|
const setMap = storageKey ? setPersisted : setMemory;
|
|
40105
|
-
const toggle =
|
|
40221
|
+
const toggle = useCallback34(
|
|
40106
40222
|
(columnId) => {
|
|
40107
40223
|
setMap((prev) => ({ ...prev, [columnId]: !prev[columnId] }));
|
|
40108
40224
|
},
|
|
40109
40225
|
[setMap]
|
|
40110
40226
|
);
|
|
40111
|
-
const setCollapsed =
|
|
40227
|
+
const setCollapsed = useCallback34(
|
|
40112
40228
|
(columnId, value) => {
|
|
40113
40229
|
setMap((prev) => ({ ...prev, [columnId]: value }));
|
|
40114
40230
|
},
|
|
@@ -40146,45 +40262,38 @@ function Board({
|
|
|
40146
40262
|
onThumbPointerMove,
|
|
40147
40263
|
onThumbPointerUp
|
|
40148
40264
|
} = useHorizontalScrollbar();
|
|
40149
|
-
const [items, setItems] =
|
|
40150
|
-
const isDraggingRef =
|
|
40151
|
-
|
|
40265
|
+
const [items, setItems] = useState90(columns);
|
|
40266
|
+
const isDraggingRef = useRef50(false);
|
|
40267
|
+
useEffect69(() => {
|
|
40152
40268
|
if (!isDraggingRef.current) setItems(columns);
|
|
40153
40269
|
}, [columns]);
|
|
40154
|
-
const dragOriginRef =
|
|
40155
|
-
const [activeTicket, setActiveTicket] =
|
|
40270
|
+
const dragOriginRef = useRef50(null);
|
|
40271
|
+
const [activeTicket, setActiveTicket] = useState90(null);
|
|
40156
40272
|
const sensors = useSensors(
|
|
40157
40273
|
useSensor(PointerSensor, { activationConstraint: { distance: 6 } }),
|
|
40158
40274
|
useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
40159
40275
|
);
|
|
40160
|
-
const
|
|
40161
|
-
|
|
40162
|
-
|
|
40163
|
-
|
|
40164
|
-
|
|
40165
|
-
|
|
40166
|
-
|
|
40167
|
-
|
|
40168
|
-
|
|
40169
|
-
);
|
|
40170
|
-
if (
|
|
40171
|
-
|
|
40172
|
-
|
|
40173
|
-
|
|
40174
|
-
|
|
40175
|
-
});
|
|
40176
|
-
if (ticketsInColumn.length > 0) {
|
|
40177
|
-
const closest = closestCorners({ ...args, droppableContainers: ticketsInColumn });
|
|
40178
|
-
if (closest.length > 0) return closest;
|
|
40179
|
-
}
|
|
40180
|
-
return [columnHit];
|
|
40181
|
-
}
|
|
40182
|
-
return closestCorners(args);
|
|
40276
|
+
const dropTarget = useMemo41(() => createDropTargetResolver(), []);
|
|
40277
|
+
useEffect69(() => dropTarget.dispose, [dropTarget]);
|
|
40278
|
+
useEffect69(() => {
|
|
40279
|
+
dropTarget.settle();
|
|
40280
|
+
}, [items, dropTarget]);
|
|
40281
|
+
const toggleRef = useRef50(toggle);
|
|
40282
|
+
toggleRef.current = toggle;
|
|
40283
|
+
const collapseHandlers = useRef50(/* @__PURE__ */ new Map());
|
|
40284
|
+
const collapseHandlerFor = useCallback35((columnId) => {
|
|
40285
|
+
let handler = collapseHandlers.current.get(columnId);
|
|
40286
|
+
if (!handler) {
|
|
40287
|
+
handler = () => toggleRef.current(columnId);
|
|
40288
|
+
collapseHandlers.current.set(columnId, handler);
|
|
40289
|
+
}
|
|
40290
|
+
return handler;
|
|
40183
40291
|
}, []);
|
|
40184
40292
|
const handleDragStart = (e) => {
|
|
40185
40293
|
const id = String(e.active.id);
|
|
40186
40294
|
const located = locate(items, id);
|
|
40187
40295
|
if (!located) return;
|
|
40296
|
+
dropTarget.release();
|
|
40188
40297
|
isDraggingRef.current = true;
|
|
40189
40298
|
dragOriginRef.current = { ticketId: id, fromColumnId: located.columnId };
|
|
40190
40299
|
setActiveTicket({ ticket: located.ticket, columnId: located.columnId });
|
|
@@ -40204,6 +40313,7 @@ function Board({
|
|
|
40204
40313
|
const targetCol = items.find((c) => c.id === toColumnId);
|
|
40205
40314
|
const blockedBySource = !isReturnToOrigin && !!targetCol?.allowedFromColumns && !!origin && !targetCol.allowedFromColumns.includes(origin.fromColumnId);
|
|
40206
40315
|
if (targetCol?.dropDisabled && !isReturnToOrigin || blockedBySource) return;
|
|
40316
|
+
dropTarget.freeze();
|
|
40207
40317
|
setItems((prev) => {
|
|
40208
40318
|
const fromIndex = findIndexInColumn(prev, fromColumnId, activeId);
|
|
40209
40319
|
const toCol = prev.find((c) => c.id === toColumnId);
|
|
@@ -40238,6 +40348,7 @@ function Board({
|
|
|
40238
40348
|
dragOriginRef.current = null;
|
|
40239
40349
|
setActiveTicket(null);
|
|
40240
40350
|
isDraggingRef.current = false;
|
|
40351
|
+
dropTarget.release();
|
|
40241
40352
|
const { over } = e;
|
|
40242
40353
|
if (!over || !origin) {
|
|
40243
40354
|
setItems(columns);
|
|
@@ -40286,13 +40397,14 @@ function Board({
|
|
|
40286
40397
|
dragOriginRef.current = null;
|
|
40287
40398
|
setActiveTicket(null);
|
|
40288
40399
|
isDraggingRef.current = false;
|
|
40400
|
+
dropTarget.release();
|
|
40289
40401
|
setItems(columns);
|
|
40290
40402
|
};
|
|
40291
40403
|
return /* @__PURE__ */ jsxs231(
|
|
40292
40404
|
DndContext,
|
|
40293
40405
|
{
|
|
40294
40406
|
sensors,
|
|
40295
|
-
collisionDetection,
|
|
40407
|
+
collisionDetection: dropTarget.detect,
|
|
40296
40408
|
onDragStart: handleDragStart,
|
|
40297
40409
|
onDragOver: handleDragOver,
|
|
40298
40410
|
onDragEnd: handleDragEnd,
|
|
@@ -40311,14 +40423,14 @@ function Board({
|
|
|
40311
40423
|
const joinLeft = !!(column.system && prev?.system);
|
|
40312
40424
|
const joinRight = !!(column.system && next?.system);
|
|
40313
40425
|
const showGap = i > 0 && !joinLeft;
|
|
40314
|
-
return /* @__PURE__ */ jsxs231(
|
|
40426
|
+
return /* @__PURE__ */ jsxs231(Fragment56, { children: [
|
|
40315
40427
|
showGap && /* @__PURE__ */ jsx300("div", { "aria-hidden": true, className: "w-[var(--spacing-system-mf)] shrink-0" }),
|
|
40316
40428
|
/* @__PURE__ */ jsx300(
|
|
40317
40429
|
BoardColumn,
|
|
40318
40430
|
{
|
|
40319
40431
|
column,
|
|
40320
40432
|
collapsed: !!collapsed[column.id],
|
|
40321
|
-
onToggleCollapse: (
|
|
40433
|
+
onToggleCollapse: collapseHandlerFor(column.id),
|
|
40322
40434
|
onAddTicket,
|
|
40323
40435
|
onArchive: onArchiveColumn,
|
|
40324
40436
|
getTicketHref,
|
|
@@ -40449,7 +40561,7 @@ import {
|
|
|
40449
40561
|
verticalListSortingStrategy as verticalListSortingStrategy2
|
|
40450
40562
|
} from "@dnd-kit/sortable";
|
|
40451
40563
|
import { CSS as CSS2 } from "@dnd-kit/utilities";
|
|
40452
|
-
import * as
|
|
40564
|
+
import * as React111 from "react";
|
|
40453
40565
|
import { jsx as jsx301 } from "react/jsx-runtime";
|
|
40454
40566
|
function TicketStatusConfigList({
|
|
40455
40567
|
items,
|
|
@@ -40469,7 +40581,7 @@ function TicketStatusConfigList({
|
|
|
40469
40581
|
if (oldIndex === -1 || newIndex === -1) return;
|
|
40470
40582
|
onReorder(oldIndex, newIndex);
|
|
40471
40583
|
};
|
|
40472
|
-
const sortableIds =
|
|
40584
|
+
const sortableIds = React111.useMemo(() => items.map((i) => i.id), [items]);
|
|
40473
40585
|
return /* @__PURE__ */ jsx301(DndContext2, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, children: /* @__PURE__ */ jsx301(SortableContext2, { items: sortableIds, strategy: verticalListSortingStrategy2, children: /* @__PURE__ */ jsx301("div", { className: cn("flex w-full flex-col gap-[var(--spacing-system-xs)]", className), children: items.map((item) => /* @__PURE__ */ jsx301(SortableRow, { id: item.id, children: (args) => renderRow(item, args) }, item.id)) }) }) });
|
|
40474
40586
|
}
|
|
40475
40587
|
function SortableRow({
|
|
@@ -40494,7 +40606,7 @@ function SortableRow({
|
|
|
40494
40606
|
|
|
40495
40607
|
// src/components/navigation/header.tsx
|
|
40496
40608
|
init_next_link();
|
|
40497
|
-
import
|
|
40609
|
+
import React114, { useEffect as useEffect71, useRef as useRef52, useState as useState92 } from "react";
|
|
40498
40610
|
init_button2();
|
|
40499
40611
|
|
|
40500
40612
|
// src/components/navigation/mingo-ai-button.tsx
|
|
@@ -40548,14 +40660,14 @@ function MingoAiButton({ source, icon, label = "Mingo AI", className, onClick, .
|
|
|
40548
40660
|
}
|
|
40549
40661
|
|
|
40550
40662
|
// src/components/navigation/mobile-nav-panel.tsx
|
|
40551
|
-
import { useRef as
|
|
40663
|
+
import { useRef as useRef51 } from "react";
|
|
40552
40664
|
import { usePreventScroll as usePreventScroll2 } from "@react-aria/overlays";
|
|
40553
40665
|
init_button2();
|
|
40554
40666
|
import { X as X10 } from "lucide-react";
|
|
40555
40667
|
import { Fragment as Fragment57, jsx as jsx303, jsxs as jsxs233 } from "react/jsx-runtime";
|
|
40556
40668
|
var MOBILE_NAV_PANEL_ID = "mobile-nav-panel";
|
|
40557
40669
|
function MobileNavPanel({ isOpen, config }) {
|
|
40558
|
-
const panelRef =
|
|
40670
|
+
const panelRef = useRef51(null);
|
|
40559
40671
|
usePreventScroll2({ isDisabled: !isOpen });
|
|
40560
40672
|
useFocusTrap(panelRef, isOpen, { onEscape: config.onClose });
|
|
40561
40673
|
const headerHeight = useHeaderHeight(64, { enabled: isOpen });
|
|
@@ -40671,7 +40783,7 @@ function MobileNavPanel({ isOpen, config }) {
|
|
|
40671
40783
|
init_cn();
|
|
40672
40784
|
|
|
40673
40785
|
// src/components/tickets/ticket-live-provider.tsx
|
|
40674
|
-
import
|
|
40786
|
+
import React113 from "react";
|
|
40675
40787
|
import { useQueryClient } from "@tanstack/react-query";
|
|
40676
40788
|
|
|
40677
40789
|
// src/components/chat/hooks/use-chat-identity.ts
|
|
@@ -40740,12 +40852,12 @@ var stampMs = (stamp) => {
|
|
|
40740
40852
|
return Number.isNaN(ms) ? 0 : ms;
|
|
40741
40853
|
};
|
|
40742
40854
|
var INVALIDATE_DEBOUNCE_MS = 1500;
|
|
40743
|
-
var TicketLiveContext =
|
|
40855
|
+
var TicketLiveContext = React113.createContext(null);
|
|
40744
40856
|
function useOptionalTicketLive() {
|
|
40745
|
-
return
|
|
40857
|
+
return React113.useContext(TicketLiveContext);
|
|
40746
40858
|
}
|
|
40747
40859
|
function useTicketLive() {
|
|
40748
|
-
const ctx =
|
|
40860
|
+
const ctx = React113.useContext(TicketLiveContext);
|
|
40749
40861
|
if (!ctx) {
|
|
40750
40862
|
throw new Error("useTicketLive must be used within <TicketLiveProvider>");
|
|
40751
40863
|
}
|
|
@@ -40764,13 +40876,13 @@ function TicketLiveProvider({ children }) {
|
|
|
40764
40876
|
const streamUrl = runtime?.endpoints.ticketStreamUrl ?? TICKET_STREAM_ENDPOINT;
|
|
40765
40877
|
const readUrl = runtime?.endpoints.ticketReadUrl ?? TICKET_READ_ENDPOINT;
|
|
40766
40878
|
const authed = identity.authTier !== "anon" && !!identity.user?.email;
|
|
40767
|
-
const [connected, setConnected] =
|
|
40768
|
-
const [summary, setSummary] =
|
|
40769
|
-
const [openTicketIdState, setOpenTicketIdState] =
|
|
40770
|
-
const openTicketIdRef =
|
|
40771
|
-
const pendingTicketIdsRef =
|
|
40772
|
-
const invalidateTimerRef =
|
|
40773
|
-
const flushInvalidations =
|
|
40879
|
+
const [connected, setConnected] = React113.useState(false);
|
|
40880
|
+
const [summary, setSummary] = React113.useState(EMPTY_SUMMARY);
|
|
40881
|
+
const [openTicketIdState, setOpenTicketIdState] = React113.useState(null);
|
|
40882
|
+
const openTicketIdRef = React113.useRef(null);
|
|
40883
|
+
const pendingTicketIdsRef = React113.useRef(/* @__PURE__ */ new Set());
|
|
40884
|
+
const invalidateTimerRef = React113.useRef(null);
|
|
40885
|
+
const flushInvalidations = React113.useCallback(() => {
|
|
40774
40886
|
invalidateTimerRef.current = null;
|
|
40775
40887
|
const ids = Array.from(pendingTicketIdsRef.current);
|
|
40776
40888
|
pendingTicketIdsRef.current.clear();
|
|
@@ -40779,7 +40891,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40779
40891
|
void queryClient.invalidateQueries({ queryKey: ["ticket-engagements", id] });
|
|
40780
40892
|
}
|
|
40781
40893
|
}, [queryClient]);
|
|
40782
|
-
const scheduleInvalidation =
|
|
40894
|
+
const scheduleInvalidation = React113.useCallback(
|
|
40783
40895
|
(ticketId) => {
|
|
40784
40896
|
if (ticketId) pendingTicketIdsRef.current.add(ticketId);
|
|
40785
40897
|
if (invalidateTimerRef.current) return;
|
|
@@ -40787,7 +40899,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40787
40899
|
},
|
|
40788
40900
|
[flushInvalidations]
|
|
40789
40901
|
);
|
|
40790
|
-
const bumpUnread =
|
|
40902
|
+
const bumpUnread = React113.useCallback((ticketId, createdAt) => {
|
|
40791
40903
|
setSummary((prev) => {
|
|
40792
40904
|
const stamp = createdAt ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
40793
40905
|
const existing = prev.latestUnreadAt[ticketId];
|
|
@@ -40801,7 +40913,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40801
40913
|
};
|
|
40802
40914
|
});
|
|
40803
40915
|
}, []);
|
|
40804
|
-
const zeroUnread =
|
|
40916
|
+
const zeroUnread = React113.useCallback((ticketId) => {
|
|
40805
40917
|
setSummary((prev) => {
|
|
40806
40918
|
const current = prev.tickets[ticketId] ?? 0;
|
|
40807
40919
|
if (current === 0) return prev;
|
|
@@ -40812,9 +40924,9 @@ function TicketLiveProvider({ children }) {
|
|
|
40812
40924
|
return { totalUnread: Math.max(0, prev.totalUnread - current), tickets, latestUnreadAt };
|
|
40813
40925
|
});
|
|
40814
40926
|
}, []);
|
|
40815
|
-
const subscriptionRef =
|
|
40816
|
-
const noStreamRef =
|
|
40817
|
-
const handlersRef =
|
|
40927
|
+
const subscriptionRef = React113.useRef(null);
|
|
40928
|
+
const noStreamRef = React113.useRef(false);
|
|
40929
|
+
const handlersRef = React113.useRef({ onEvent: () => {
|
|
40818
40930
|
}, onStatus: () => {
|
|
40819
40931
|
}, onConnected: () => {
|
|
40820
40932
|
} });
|
|
@@ -40867,7 +40979,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40867
40979
|
if (status === "no-stream") noStreamRef.current = true;
|
|
40868
40980
|
};
|
|
40869
40981
|
const streamEnabled = authed && !!streamUrl;
|
|
40870
|
-
|
|
40982
|
+
React113.useEffect(() => {
|
|
40871
40983
|
if (!streamEnabled) return;
|
|
40872
40984
|
if (typeof window === "undefined") return;
|
|
40873
40985
|
subscriptionRef.current = createSseSubscription({
|
|
@@ -40898,7 +41010,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40898
41010
|
setSummary(EMPTY_SUMMARY);
|
|
40899
41011
|
};
|
|
40900
41012
|
}, [streamEnabled, streamUrl]);
|
|
40901
|
-
const markRead =
|
|
41013
|
+
const markRead = React113.useCallback(
|
|
40902
41014
|
async (ticketExternalId) => {
|
|
40903
41015
|
try {
|
|
40904
41016
|
const response = await embedAuthedFetch(readUrl, {
|
|
@@ -40920,15 +41032,15 @@ function TicketLiveProvider({ children }) {
|
|
|
40920
41032
|
},
|
|
40921
41033
|
[readUrl, zeroUnread]
|
|
40922
41034
|
);
|
|
40923
|
-
const setOpenTicketId =
|
|
41035
|
+
const setOpenTicketId = React113.useCallback((ticketExternalId) => {
|
|
40924
41036
|
openTicketIdRef.current = ticketExternalId;
|
|
40925
41037
|
setOpenTicketIdState(ticketExternalId);
|
|
40926
41038
|
}, []);
|
|
40927
|
-
const notifyTicketCreated =
|
|
41039
|
+
const notifyTicketCreated = React113.useCallback(() => {
|
|
40928
41040
|
noStreamRef.current = false;
|
|
40929
41041
|
subscriptionRef.current?.reconnectNow();
|
|
40930
41042
|
}, []);
|
|
40931
|
-
const value =
|
|
41043
|
+
const value = React113.useMemo(() => {
|
|
40932
41044
|
let unreadByTicket = summary.tickets;
|
|
40933
41045
|
let unreadTotal = summary.totalUnread;
|
|
40934
41046
|
if (openTicketIdState && unreadByTicket[openTicketIdState]) {
|
|
@@ -41101,8 +41213,8 @@ function Header2({ config, platform }) {
|
|
|
41101
41213
|
const [show, setShow] = useState92(true);
|
|
41102
41214
|
const [lastScrollY, setLastScrollY] = useState92(0);
|
|
41103
41215
|
const [openDropdowns, setOpenDropdowns] = useState92({});
|
|
41104
|
-
const dropdownRefs =
|
|
41105
|
-
const triggerRefs =
|
|
41216
|
+
const dropdownRefs = useRef52({});
|
|
41217
|
+
const triggerRefs = useRef52({});
|
|
41106
41218
|
useEffect71(() => {
|
|
41107
41219
|
const handleClickOutside = (event) => {
|
|
41108
41220
|
const target = event.target;
|
|
@@ -41164,7 +41276,7 @@ function Header2({ config, platform }) {
|
|
|
41164
41276
|
}, [config.autoHide]);
|
|
41165
41277
|
const renderNavigationItem = (item) => {
|
|
41166
41278
|
if (item.element) {
|
|
41167
|
-
return /* @__PURE__ */ jsx307(
|
|
41279
|
+
return /* @__PURE__ */ jsx307(React114.Fragment, { children: item.element }, item.id);
|
|
41168
41280
|
}
|
|
41169
41281
|
if (item.children && item.children.length > 0) {
|
|
41170
41282
|
const isOpen = openDropdowns[item.id] || false;
|
|
@@ -41443,7 +41555,7 @@ function ClientOnlyHeader({ config, skeleton }) {
|
|
|
41443
41555
|
}
|
|
41444
41556
|
|
|
41445
41557
|
// src/components/navigation/sliding-sidebar.tsx
|
|
41446
|
-
import { useState as useState94, useEffect as useEffect73, useRef as
|
|
41558
|
+
import { useState as useState94, useEffect as useEffect73, useRef as useRef53 } from "react";
|
|
41447
41559
|
import { motion as motion2, AnimatePresence, useReducedMotion } from "framer-motion";
|
|
41448
41560
|
import { usePreventScroll as usePreventScroll3 } from "@react-aria/overlays";
|
|
41449
41561
|
init_button2();
|
|
@@ -41452,7 +41564,7 @@ function SlidingSidebar({ config }) {
|
|
|
41452
41564
|
const [expandedItems, setExpandedItems] = useState94(/* @__PURE__ */ new Set());
|
|
41453
41565
|
const [mounted, setMounted] = useState94(false);
|
|
41454
41566
|
const headerHeight = useHeaderHeight();
|
|
41455
|
-
const asideRef =
|
|
41567
|
+
const asideRef = useRef53(null);
|
|
41456
41568
|
const prefersReducedMotion2 = useReducedMotion();
|
|
41457
41569
|
usePreventScroll3({ isDisabled: !config.isOpen });
|
|
41458
41570
|
useFocusTrap(asideRef, config.isOpen, { onEscape: config.onClose, contain: false });
|
|
@@ -41624,7 +41736,7 @@ function SlidingSidebar({ config }) {
|
|
|
41624
41736
|
}
|
|
41625
41737
|
|
|
41626
41738
|
// src/components/navigation/sticky-section-nav.tsx
|
|
41627
|
-
import { useEffect as useEffect74, useState as useState95, useCallback as
|
|
41739
|
+
import { useEffect as useEffect74, useState as useState95, useCallback as useCallback36, useRef as useRef54 } from "react";
|
|
41628
41740
|
import { jsx as jsx311, jsxs as jsxs239 } from "react/jsx-runtime";
|
|
41629
41741
|
function StickySectionNav({
|
|
41630
41742
|
sections,
|
|
@@ -41686,9 +41798,9 @@ function StickySectionNav({
|
|
|
41686
41798
|
}
|
|
41687
41799
|
function useSectionNavigation(sections, options) {
|
|
41688
41800
|
const [activeSection, setActiveSection] = useState95(sections[0]?.id || "");
|
|
41689
|
-
const isScrollingFromClick =
|
|
41801
|
+
const isScrollingFromClick = useRef54(false);
|
|
41690
41802
|
const { offset: offset2 = 100 } = options || {};
|
|
41691
|
-
const handleSectionClick =
|
|
41803
|
+
const handleSectionClick = useCallback36((sectionId) => {
|
|
41692
41804
|
const targetElement = document.getElementById(sectionId);
|
|
41693
41805
|
if (!targetElement) return;
|
|
41694
41806
|
isScrollingFromClick.current = true;
|
|
@@ -41738,7 +41850,7 @@ function useSectionNavigation(sections, options) {
|
|
|
41738
41850
|
}
|
|
41739
41851
|
|
|
41740
41852
|
// src/components/navigation/navigation-sidebar.tsx
|
|
41741
|
-
import { useCallback as
|
|
41853
|
+
import { useCallback as useCallback37, useEffect as useEffect75, useMemo as useMemo43, useState as useState96 } from "react";
|
|
41742
41854
|
|
|
41743
41855
|
// src/components/navigation/navigation-sidebar-header.tsx
|
|
41744
41856
|
import { jsx as jsx312, jsxs as jsxs240 } from "react/jsx-runtime";
|
|
@@ -41768,9 +41880,9 @@ function NavigationSidebarHeader({ minimized }) {
|
|
|
41768
41880
|
|
|
41769
41881
|
// src/components/navigation/navigation-sidebar-item.tsx
|
|
41770
41882
|
init_next_link();
|
|
41771
|
-
import { cloneElement, memo as
|
|
41883
|
+
import { cloneElement, memo as memo9 } from "react";
|
|
41772
41884
|
import { Fragment as Fragment61, jsx as jsx313, jsxs as jsxs241 } from "react/jsx-runtime";
|
|
41773
|
-
var NavigationSidebarItemButton =
|
|
41885
|
+
var NavigationSidebarItemButton = memo9(function NavigationSidebarItemButton2({
|
|
41774
41886
|
item,
|
|
41775
41887
|
isActive,
|
|
41776
41888
|
isPending,
|
|
@@ -41919,7 +42031,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41919
42031
|
const [transitionsEnabled, setTransitionsEnabled] = useState96(false);
|
|
41920
42032
|
const isOverlayOpen = isTablet && !minimized;
|
|
41921
42033
|
const showLabel = !minimized;
|
|
41922
|
-
const handleToggle =
|
|
42034
|
+
const handleToggle = useCallback37(() => {
|
|
41923
42035
|
if (isTablet) {
|
|
41924
42036
|
setTabletMinimized((prev) => !prev);
|
|
41925
42037
|
} else {
|
|
@@ -41927,7 +42039,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41927
42039
|
}
|
|
41928
42040
|
config.onToggleMinimized?.();
|
|
41929
42041
|
}, [isTablet, setDesktopMinimized, config]);
|
|
41930
|
-
const closeOverlay =
|
|
42042
|
+
const closeOverlay = useCallback37(() => {
|
|
41931
42043
|
setTabletMinimized(true);
|
|
41932
42044
|
}, []);
|
|
41933
42045
|
useEffect75(() => {
|
|
@@ -41939,14 +42051,14 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41939
42051
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
41940
42052
|
}, [isOverlayOpen, closeOverlay]);
|
|
41941
42053
|
const [pendingItemId, setPendingItemId] = useState96(null);
|
|
41942
|
-
const committedActiveId =
|
|
42054
|
+
const committedActiveId = useMemo43(
|
|
41943
42055
|
() => config.items.find((item) => item.isActive)?.id ?? null,
|
|
41944
42056
|
[config.items]
|
|
41945
42057
|
);
|
|
41946
42058
|
useEffect75(() => {
|
|
41947
42059
|
setPendingItemId(null);
|
|
41948
42060
|
}, [committedActiveId]);
|
|
41949
|
-
const handleItemClick =
|
|
42061
|
+
const handleItemClick = useCallback37((item, event) => {
|
|
41950
42062
|
event?.stopPropagation();
|
|
41951
42063
|
if (item.onClick) {
|
|
41952
42064
|
item.onClick();
|
|
@@ -41962,11 +42074,11 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41962
42074
|
}
|
|
41963
42075
|
if (isTablet) setTabletMinimized(true);
|
|
41964
42076
|
}, [config, isTablet, committedActiveId]);
|
|
41965
|
-
const { primaryItems, secondaryItems } =
|
|
42077
|
+
const { primaryItems, secondaryItems } = useMemo43(() => ({
|
|
41966
42078
|
primaryItems: config.items.filter((item) => item.section !== "secondary"),
|
|
41967
42079
|
secondaryItems: config.items.filter((item) => item.section === "secondary")
|
|
41968
42080
|
}), [config.items]);
|
|
41969
|
-
const loadingRows =
|
|
42081
|
+
const loadingRows = useMemo43(() => {
|
|
41970
42082
|
if (!config.loading) return null;
|
|
41971
42083
|
const primary = config.loadingRows?.primary ?? 7;
|
|
41972
42084
|
const secondary = config.loadingRows?.secondary ?? 2;
|
|
@@ -41975,7 +42087,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41975
42087
|
secondary: Array.from({ length: Math.max(0, secondary) }, (_, i) => `secondary-${i}`)
|
|
41976
42088
|
};
|
|
41977
42089
|
}, [config.loading, config.loadingRows?.primary, config.loadingRows?.secondary]);
|
|
41978
|
-
const sidebarWidth =
|
|
42090
|
+
const sidebarWidth = useMemo43(
|
|
41979
42091
|
() => minimized ? `${MINIMIZED_WIDTH}px` : `${EXPANDED_WIDTH}px`,
|
|
41980
42092
|
[minimized]
|
|
41981
42093
|
);
|
|
@@ -42067,12 +42179,12 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
42067
42179
|
}
|
|
42068
42180
|
|
|
42069
42181
|
// src/components/navigation/app-header.tsx
|
|
42070
|
-
import
|
|
42182
|
+
import React118 from "react";
|
|
42071
42183
|
init_cn();
|
|
42072
42184
|
|
|
42073
42185
|
// src/components/navigation/header-global-search.tsx
|
|
42074
42186
|
init_cn();
|
|
42075
|
-
import
|
|
42187
|
+
import React117 from "react";
|
|
42076
42188
|
import { jsx as jsx316, jsxs as jsxs244 } from "react/jsx-runtime";
|
|
42077
42189
|
function HeaderGlobalSearch({
|
|
42078
42190
|
value = "",
|
|
@@ -42081,7 +42193,7 @@ function HeaderGlobalSearch({
|
|
|
42081
42193
|
placeholder = "Global Search",
|
|
42082
42194
|
className
|
|
42083
42195
|
}) {
|
|
42084
|
-
const [internalValue, setInternalValue] =
|
|
42196
|
+
const [internalValue, setInternalValue] = React117.useState(value);
|
|
42085
42197
|
const currentValue = onChange ? value : internalValue;
|
|
42086
42198
|
const handleChange = (e) => {
|
|
42087
42199
|
const newValue = e.target.value;
|
|
@@ -42242,7 +42354,7 @@ function HeaderOrganizationFilter({
|
|
|
42242
42354
|
|
|
42243
42355
|
// src/components/navigation/app-header.tsx
|
|
42244
42356
|
import { Fragment as Fragment63, jsx as jsx319, jsxs as jsxs247 } from "react/jsx-runtime";
|
|
42245
|
-
var AppHeader =
|
|
42357
|
+
var AppHeader = React118.memo(function AppHeader2({
|
|
42246
42358
|
showSearch,
|
|
42247
42359
|
onSearch,
|
|
42248
42360
|
showOrganizations,
|
|
@@ -42524,14 +42636,14 @@ function AppHeaderSkeleton({
|
|
|
42524
42636
|
}
|
|
42525
42637
|
|
|
42526
42638
|
// src/components/navigation/app-layout.tsx
|
|
42527
|
-
import { useCallback as
|
|
42639
|
+
import { useCallback as useCallback39, useMemo as useMemo44, useRef as useRef56, useState as useState97 } from "react";
|
|
42528
42640
|
|
|
42529
42641
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
42530
|
-
import
|
|
42642
|
+
import React119, { useCallback as useCallback38, useRef as useRef55 } from "react";
|
|
42531
42643
|
import { usePreventScroll as usePreventScroll4 } from "@react-aria/overlays";
|
|
42532
42644
|
import { Fragment as Fragment64, jsx as jsx320, jsxs as jsxs248 } from "react/jsx-runtime";
|
|
42533
42645
|
var HEADER_HEIGHT = 56;
|
|
42534
|
-
var MobileBurgerMenu =
|
|
42646
|
+
var MobileBurgerMenu = React119.memo(function MobileBurgerMenu2({
|
|
42535
42647
|
isOpen,
|
|
42536
42648
|
onClose,
|
|
42537
42649
|
config,
|
|
@@ -42541,10 +42653,10 @@ var MobileBurgerMenu = React122.memo(function MobileBurgerMenu2({
|
|
|
42541
42653
|
onLogout,
|
|
42542
42654
|
disabled = false
|
|
42543
42655
|
}) {
|
|
42544
|
-
const panelRef =
|
|
42656
|
+
const panelRef = useRef55(null);
|
|
42545
42657
|
usePreventScroll4({ isDisabled: !isOpen });
|
|
42546
42658
|
useFocusTrap(panelRef, isOpen, { onEscape: onClose });
|
|
42547
|
-
const handleItemClick =
|
|
42659
|
+
const handleItemClick = useCallback38((item) => {
|
|
42548
42660
|
if (item.onClick) {
|
|
42549
42661
|
item.onClick();
|
|
42550
42662
|
} else if (item.path) {
|
|
@@ -42575,7 +42687,7 @@ var MobileBurgerMenu = React122.memo(function MobileBurgerMenu2({
|
|
|
42575
42687
|
),
|
|
42576
42688
|
"aria-current": isActive ? "page" : void 0,
|
|
42577
42689
|
children: [
|
|
42578
|
-
item.icon && /* @__PURE__ */ jsx320("div", { className: "flex-shrink-0 size-4 flex items-center justify-center", children:
|
|
42690
|
+
item.icon && /* @__PURE__ */ jsx320("div", { className: "flex-shrink-0 size-4 flex items-center justify-center", children: React119.cloneElement(item.icon, {
|
|
42579
42691
|
size: 16,
|
|
42580
42692
|
color: isActive && !disabled ? "var(--color-accent-primary)" : "var(--color-text-secondary)"
|
|
42581
42693
|
}) }),
|
|
@@ -42588,7 +42700,7 @@ var MobileBurgerMenu = React122.memo(function MobileBurgerMenu2({
|
|
|
42588
42700
|
item.id
|
|
42589
42701
|
);
|
|
42590
42702
|
};
|
|
42591
|
-
const renderNavigationGrid = (items) => /* @__PURE__ */ jsx320("div", { className: "grid grid-cols-2 gap-3", children: items.map((item) => /* @__PURE__ */ jsx320(
|
|
42703
|
+
const renderNavigationGrid = (items) => /* @__PURE__ */ jsx320("div", { className: "grid grid-cols-2 gap-3", children: items.map((item) => /* @__PURE__ */ jsx320(React119.Fragment, { children: renderNavigationItem(item, true) }, item.id)) });
|
|
42592
42704
|
return /* @__PURE__ */ jsxs248(Fragment64, { children: [
|
|
42593
42705
|
/* @__PURE__ */ jsx320(
|
|
42594
42706
|
"div",
|
|
@@ -42680,7 +42792,7 @@ var MobileBurgerMenu = React122.memo(function MobileBurgerMenu2({
|
|
|
42680
42792
|
),
|
|
42681
42793
|
config.topSlot?.({ minimized: false }),
|
|
42682
42794
|
/* @__PURE__ */ jsx320("nav", { "aria-label": "Primary navigation", children: renderNavigationGrid(primaryItems) }),
|
|
42683
|
-
secondaryItems.length > 0 && /* @__PURE__ */ jsx320("nav", { "aria-label": "Secondary navigation", className: "flex flex-col gap-3", children: secondaryItems.map((item) => /* @__PURE__ */ jsx320(
|
|
42795
|
+
secondaryItems.length > 0 && /* @__PURE__ */ jsx320("nav", { "aria-label": "Secondary navigation", className: "flex flex-col gap-3", children: secondaryItems.map((item) => /* @__PURE__ */ jsx320(React119.Fragment, { children: renderNavigationItem(item, false) }, item.id)) }),
|
|
42684
42796
|
onLogout && /* @__PURE__ */ jsxs248(
|
|
42685
42797
|
"button",
|
|
42686
42798
|
{
|
|
@@ -42718,20 +42830,20 @@ function AppLayout({
|
|
|
42718
42830
|
}) {
|
|
42719
42831
|
const [mobileMenuOpen, setMobileMenuOpen] = useState97(false);
|
|
42720
42832
|
const [drawerContainer, setDrawerContainer] = useState97(null);
|
|
42721
|
-
const mobileMenuOpenRef =
|
|
42833
|
+
const mobileMenuOpenRef = useRef56(mobileMenuOpen);
|
|
42722
42834
|
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
42723
|
-
const drawerHandlesRef =
|
|
42724
|
-
const handleToggleMobileMenu =
|
|
42835
|
+
const drawerHandlesRef = useRef56(/* @__PURE__ */ new Set());
|
|
42836
|
+
const handleToggleMobileMenu = useCallback39(() => {
|
|
42725
42837
|
const opening = !mobileMenuOpenRef.current;
|
|
42726
42838
|
if (opening) {
|
|
42727
42839
|
for (const handle of drawerHandlesRef.current) handle.close();
|
|
42728
42840
|
}
|
|
42729
42841
|
setMobileMenuOpen(opening);
|
|
42730
42842
|
}, []);
|
|
42731
|
-
const handleCloseMobileMenu =
|
|
42843
|
+
const handleCloseMobileMenu = useCallback39(() => {
|
|
42732
42844
|
setMobileMenuOpen(false);
|
|
42733
42845
|
}, []);
|
|
42734
|
-
const drawerCoordination =
|
|
42846
|
+
const drawerCoordination = useMemo44(() => ({
|
|
42735
42847
|
notifyDrawerDidOpen: (self) => {
|
|
42736
42848
|
setMobileMenuOpen(false);
|
|
42737
42849
|
for (const handle of drawerHandlesRef.current) {
|
|
@@ -43347,10 +43459,10 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
43347
43459
|
|
|
43348
43460
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
43349
43461
|
init_button2();
|
|
43350
|
-
import
|
|
43462
|
+
import React121, { useRef as useRef57, useCallback as useCallback40 } from "react";
|
|
43351
43463
|
|
|
43352
43464
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
43353
|
-
import
|
|
43465
|
+
import React120 from "react";
|
|
43354
43466
|
init_button2();
|
|
43355
43467
|
init_cn();
|
|
43356
43468
|
import { Fragment as Fragment65, jsx as jsx330, jsxs as jsxs258 } from "react/jsx-runtime";
|
|
@@ -43363,7 +43475,7 @@ function OnboardingStepCard({
|
|
|
43363
43475
|
onSkip,
|
|
43364
43476
|
className
|
|
43365
43477
|
}) {
|
|
43366
|
-
const [isProcessing, setIsProcessing] =
|
|
43478
|
+
const [isProcessing, setIsProcessing] = React120.useState(false);
|
|
43367
43479
|
const handleAction = async (e) => {
|
|
43368
43480
|
e.stopPropagation();
|
|
43369
43481
|
setIsProcessing(true);
|
|
@@ -43471,11 +43583,11 @@ function OnboardingWalkthrough({
|
|
|
43471
43583
|
allStepsComplete,
|
|
43472
43584
|
markMultipleComplete
|
|
43473
43585
|
} = useOnboardingState(storageKey);
|
|
43474
|
-
const hasAutoMarkedRef =
|
|
43475
|
-
const autoMarkingInProgressRef =
|
|
43476
|
-
const lastCompletionStatusRef =
|
|
43477
|
-
const actionInProgressRef =
|
|
43478
|
-
|
|
43586
|
+
const hasAutoMarkedRef = useRef57(false);
|
|
43587
|
+
const autoMarkingInProgressRef = useRef57(false);
|
|
43588
|
+
const lastCompletionStatusRef = useRef57(null);
|
|
43589
|
+
const actionInProgressRef = useRef57(/* @__PURE__ */ new Set());
|
|
43590
|
+
React121.useEffect(() => {
|
|
43479
43591
|
if (isLoadingCompletion) {
|
|
43480
43592
|
hasAutoMarkedRef.current = false;
|
|
43481
43593
|
return;
|
|
@@ -43500,7 +43612,7 @@ function OnboardingWalkthrough({
|
|
|
43500
43612
|
lastCompletionStatusRef.current = statusKey;
|
|
43501
43613
|
}
|
|
43502
43614
|
}, [completionStatus, isLoadingCompletion, state.completedSteps, markMultipleComplete]);
|
|
43503
|
-
const handleStepAction =
|
|
43615
|
+
const handleStepAction = useCallback40(async (step) => {
|
|
43504
43616
|
if (actionInProgressRef.current.has(step.id)) {
|
|
43505
43617
|
console.log(`\u23F3 Action already in progress for "${step.id}", skipping`);
|
|
43506
43618
|
return;
|
|
@@ -43582,11 +43694,11 @@ function OnboardingWalkthrough({
|
|
|
43582
43694
|
|
|
43583
43695
|
// src/components/logs-list.tsx
|
|
43584
43696
|
init_cn();
|
|
43585
|
-
import * as
|
|
43697
|
+
import * as React123 from "react";
|
|
43586
43698
|
|
|
43587
43699
|
// src/components/log-severity-dot.tsx
|
|
43588
43700
|
init_cn();
|
|
43589
|
-
import * as
|
|
43701
|
+
import * as React122 from "react";
|
|
43590
43702
|
|
|
43591
43703
|
// src/types/logs.types.ts
|
|
43592
43704
|
var LOG_SEVERITY_COLORS = {
|
|
@@ -43606,7 +43718,7 @@ var LOG_SEVERITY_LABELS = {
|
|
|
43606
43718
|
|
|
43607
43719
|
// src/components/log-severity-dot.tsx
|
|
43608
43720
|
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
43609
|
-
var LogSeverityDot =
|
|
43721
|
+
var LogSeverityDot = React122.forwardRef(({ severity, size: size2 = "md", className }, ref) => {
|
|
43610
43722
|
const sizeClasses2 = {
|
|
43611
43723
|
sm: "w-4 h-4",
|
|
43612
43724
|
md: "w-6 h-6",
|
|
@@ -43696,7 +43808,7 @@ var LogCard = ({ log, isLast, showConnector, onClick }) => {
|
|
|
43696
43808
|
)
|
|
43697
43809
|
] });
|
|
43698
43810
|
};
|
|
43699
|
-
var LogsList =
|
|
43811
|
+
var LogsList = React123.forwardRef(({
|
|
43700
43812
|
logs,
|
|
43701
43813
|
maxHeight = "400px",
|
|
43702
43814
|
showConnector = true,
|
|
@@ -43705,7 +43817,7 @@ var LogsList = React126.forwardRef(({
|
|
|
43705
43817
|
emptyMessage = "No logs to display",
|
|
43706
43818
|
className
|
|
43707
43819
|
}, ref) => {
|
|
43708
|
-
const containerRef =
|
|
43820
|
+
const containerRef = React123.useRef(null);
|
|
43709
43821
|
const isFullHeight = maxHeight === "100%";
|
|
43710
43822
|
const getContainerStyles = () => {
|
|
43711
43823
|
if (isFullHeight) return void 0;
|
|
@@ -43816,7 +43928,7 @@ function ServiceCardRowItem({ row }) {
|
|
|
43816
43928
|
const [revealed, setRevealed] = useState98(false);
|
|
43817
43929
|
const { copy, copied } = useCopyToClipboard();
|
|
43818
43930
|
const { ref: valueRef, isTruncated: valueTruncated } = useIsTruncated(row.value);
|
|
43819
|
-
const actions =
|
|
43931
|
+
const actions = useMemo45(() => ({ copy: true, open: !!row.href, reveal: !!row.isSecret, ...row.actions }), [row]);
|
|
43820
43932
|
const displayValue = row.isSecret ? /* @__PURE__ */ jsx334(MaskedValue, { value: row.value, isRevealed: revealed }) : /* @__PURE__ */ jsx334("span", { children: row.value });
|
|
43821
43933
|
const handleCopy = () => copy(row.copyValue ?? row.value);
|
|
43822
43934
|
const openInNewTab = () => {
|
|
@@ -43875,9 +43987,9 @@ function ServiceCardRowItem({ row }) {
|
|
|
43875
43987
|
|
|
43876
43988
|
// src/components/ui/slider.tsx
|
|
43877
43989
|
init_cn();
|
|
43878
|
-
import * as
|
|
43990
|
+
import * as React125 from "react";
|
|
43879
43991
|
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
43880
|
-
var Slider =
|
|
43992
|
+
var Slider = React125.forwardRef(
|
|
43881
43993
|
({ className, value = [0], onValueChange, min = 0, max = 100, step = 1, ...props }, ref) => {
|
|
43882
43994
|
const handleChange = (e) => {
|
|
43883
43995
|
const newValue = [Number(e.target.value)];
|
|
@@ -44126,7 +44238,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx338(ContentLoader, { ...props, va
|
|
|
44126
44238
|
|
|
44127
44239
|
// src/components/ui/table/table.tsx
|
|
44128
44240
|
init_cn();
|
|
44129
|
-
import { useEffect as useEffect77, useRef as
|
|
44241
|
+
import { useEffect as useEffect77, useRef as useRef59 } from "react";
|
|
44130
44242
|
init_pagination();
|
|
44131
44243
|
init_button2();
|
|
44132
44244
|
|
|
@@ -44886,8 +44998,8 @@ function Table({
|
|
|
44886
44998
|
};
|
|
44887
44999
|
const allSelected = selectedRows.length > 0 && selectedRows.length === data.length;
|
|
44888
45000
|
const someSelected = selectedRows.length > 0 && selectedRows.length < data.length;
|
|
44889
|
-
const sentinelRef =
|
|
44890
|
-
const onLoadMoreRef =
|
|
45001
|
+
const sentinelRef = useRef59(null);
|
|
45002
|
+
const onLoadMoreRef = useRef59(infiniteScroll?.onLoadMore);
|
|
44891
45003
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
44892
45004
|
useEffect77(() => {
|
|
44893
45005
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
@@ -45103,11 +45215,11 @@ function TableTimestampCell({
|
|
|
45103
45215
|
// src/components/ui/query-report-table/query-report-table.tsx
|
|
45104
45216
|
init_cn();
|
|
45105
45217
|
init_button2();
|
|
45106
|
-
import { useMemo as
|
|
45218
|
+
import { useMemo as useMemo46 } from "react";
|
|
45107
45219
|
|
|
45108
45220
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
45109
45221
|
init_cn();
|
|
45110
|
-
import { useRef as
|
|
45222
|
+
import { useRef as useRef60, useState as useState100, useCallback as useCallback41 } from "react";
|
|
45111
45223
|
import { jsx as jsx350, jsxs as jsxs273 } from "react/jsx-runtime";
|
|
45112
45224
|
function QueryReportTableHeader({
|
|
45113
45225
|
columns,
|
|
@@ -45136,9 +45248,9 @@ function QueryReportTableHeader({
|
|
|
45136
45248
|
);
|
|
45137
45249
|
}
|
|
45138
45250
|
function TruncatedHeaderCell({ value, width }) {
|
|
45139
|
-
const textRef =
|
|
45251
|
+
const textRef = useRef60(null);
|
|
45140
45252
|
const [isTruncated, setIsTruncated] = useState100(false);
|
|
45141
|
-
const checkTruncation =
|
|
45253
|
+
const checkTruncation = useCallback41(() => {
|
|
45142
45254
|
const el = textRef.current;
|
|
45143
45255
|
if (el) {
|
|
45144
45256
|
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
@@ -45166,7 +45278,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
45166
45278
|
|
|
45167
45279
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
45168
45280
|
init_cn();
|
|
45169
|
-
import { useRef as
|
|
45281
|
+
import { useRef as useRef61, useState as useState101, useCallback as useCallback42 } from "react";
|
|
45170
45282
|
import { jsx as jsx351, jsxs as jsxs274 } from "react/jsx-runtime";
|
|
45171
45283
|
function QueryReportTableRow({
|
|
45172
45284
|
row,
|
|
@@ -45212,9 +45324,9 @@ function QueryReportTableRow({
|
|
|
45212
45324
|
);
|
|
45213
45325
|
}
|
|
45214
45326
|
function TruncatedCell({ value, className }) {
|
|
45215
|
-
const textRef =
|
|
45327
|
+
const textRef = useRef61(null);
|
|
45216
45328
|
const [isTruncated, setIsTruncated] = useState101(false);
|
|
45217
|
-
const checkTruncation =
|
|
45329
|
+
const checkTruncation = useCallback42(() => {
|
|
45218
45330
|
const el = textRef.current;
|
|
45219
45331
|
if (el) {
|
|
45220
45332
|
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
@@ -45341,7 +45453,7 @@ function QueryReportTable({
|
|
|
45341
45453
|
tableClassName
|
|
45342
45454
|
}) {
|
|
45343
45455
|
const isCompact = variant === "compact";
|
|
45344
|
-
const columns =
|
|
45456
|
+
const columns = useMemo46(
|
|
45345
45457
|
() => deriveColumns(data, columnOrder),
|
|
45346
45458
|
[data, columnOrder]
|
|
45347
45459
|
);
|
|
@@ -45476,7 +45588,7 @@ import { flexRender } from "@tanstack/react-table";
|
|
|
45476
45588
|
|
|
45477
45589
|
// src/components/ui/data-table/data-table-column-filter.tsx
|
|
45478
45590
|
init_cn();
|
|
45479
|
-
import { useCallback as
|
|
45591
|
+
import { useCallback as useCallback43, useMemo as useMemo47 } from "react";
|
|
45480
45592
|
|
|
45481
45593
|
// src/components/ui/data-table/utils.ts
|
|
45482
45594
|
var BREAKPOINT_ORDER = ["md", "lg", "xl", "2xl"];
|
|
@@ -45540,7 +45652,7 @@ function DataTableColumnFilter({
|
|
|
45540
45652
|
}) {
|
|
45541
45653
|
const currentValue = column.getFilterValue();
|
|
45542
45654
|
const activeCount = currentValue?.length ?? 0;
|
|
45543
|
-
const sections =
|
|
45655
|
+
const sections = useMemo47(
|
|
45544
45656
|
() => [
|
|
45545
45657
|
{
|
|
45546
45658
|
id: column.id,
|
|
@@ -45552,18 +45664,18 @@ function DataTableColumnFilter({
|
|
|
45552
45664
|
],
|
|
45553
45665
|
[column.id, label, options]
|
|
45554
45666
|
);
|
|
45555
|
-
const currentFilters =
|
|
45667
|
+
const currentFilters = useMemo47(
|
|
45556
45668
|
() => ({ [column.id]: currentValue ?? EMPTY_ARRAY }),
|
|
45557
45669
|
[column.id, currentValue]
|
|
45558
45670
|
);
|
|
45559
|
-
const handleApply =
|
|
45671
|
+
const handleApply = useCallback43(
|
|
45560
45672
|
(applied) => {
|
|
45561
45673
|
const next = applied[column.id] ?? [];
|
|
45562
45674
|
column.setFilterValue(next.length > 0 ? next : void 0);
|
|
45563
45675
|
},
|
|
45564
45676
|
[column]
|
|
45565
45677
|
);
|
|
45566
|
-
const handleReset =
|
|
45678
|
+
const handleReset = useCallback43(() => {
|
|
45567
45679
|
column.setFilterValue(void 0);
|
|
45568
45680
|
}, [column]);
|
|
45569
45681
|
const isEmpty = options.length === 0;
|
|
@@ -45818,7 +45930,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
45818
45930
|
// src/components/ui/data-table/data-table-row.tsx
|
|
45819
45931
|
init_next_link();
|
|
45820
45932
|
init_cn();
|
|
45821
|
-
import { memo as
|
|
45933
|
+
import { memo as memo10, useCallback as useCallback44, useRef as useRef62 } from "react";
|
|
45822
45934
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
45823
45935
|
|
|
45824
45936
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -45912,8 +46024,8 @@ function DataTableRowImpl({
|
|
|
45912
46024
|
const hasSubRow = subRow != null && subRow !== false;
|
|
45913
46025
|
const isLinkMode = Boolean(href) && !onClick;
|
|
45914
46026
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
45915
|
-
const containerRef =
|
|
45916
|
-
const handleClick =
|
|
46027
|
+
const containerRef = useRef62(null);
|
|
46028
|
+
const handleClick = useCallback44(
|
|
45917
46029
|
(e) => {
|
|
45918
46030
|
const target = e.target;
|
|
45919
46031
|
if (!containerRef.current?.contains(target)) {
|
|
@@ -45997,7 +46109,7 @@ function DataTableRowImpl({
|
|
|
45997
46109
|
}
|
|
45998
46110
|
);
|
|
45999
46111
|
}
|
|
46000
|
-
var DataTableRow =
|
|
46112
|
+
var DataTableRow = memo10(DataTableRowImpl);
|
|
46001
46113
|
function CellContent({ children }) {
|
|
46002
46114
|
if (typeof children === "string" || typeof children === "number") {
|
|
46003
46115
|
return /* @__PURE__ */ jsx359("span", { className: "text-h4 text-ods-text-primary truncate", title: String(children), children });
|
|
@@ -46083,7 +46195,7 @@ function DataTableBody({
|
|
|
46083
46195
|
}
|
|
46084
46196
|
|
|
46085
46197
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
46086
|
-
import { useEffect as useEffect78, useRef as
|
|
46198
|
+
import { useEffect as useEffect78, useRef as useRef63 } from "react";
|
|
46087
46199
|
import { Fragment as Fragment72, jsx as jsx361, jsxs as jsxs282 } from "react/jsx-runtime";
|
|
46088
46200
|
function DataTableInfiniteFooter({
|
|
46089
46201
|
hasNextPage,
|
|
@@ -46092,8 +46204,8 @@ function DataTableInfiniteFooter({
|
|
|
46092
46204
|
skeletonRows = 3,
|
|
46093
46205
|
rootMargin = "200px"
|
|
46094
46206
|
}) {
|
|
46095
|
-
const sentinelRef =
|
|
46096
|
-
const onLoadMoreRef =
|
|
46207
|
+
const sentinelRef = useRef63(null);
|
|
46208
|
+
const onLoadMoreRef = useRef63(onLoadMore);
|
|
46097
46209
|
onLoadMoreRef.current = onLoadMore;
|
|
46098
46210
|
useEffect78(() => {
|
|
46099
46211
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
@@ -46223,7 +46335,7 @@ var DataTable = Object.assign(DataTableRoot, {
|
|
|
46223
46335
|
init_cn();
|
|
46224
46336
|
import * as PopoverPrimitive6 from "@radix-ui/react-popover";
|
|
46225
46337
|
import * as ScrollAreaPrimitive3 from "@radix-ui/react-scroll-area";
|
|
46226
|
-
import * as
|
|
46338
|
+
import * as React128 from "react";
|
|
46227
46339
|
import { jsx as jsx363, jsxs as jsxs284 } from "react/jsx-runtime";
|
|
46228
46340
|
var containerStyles = cn(
|
|
46229
46341
|
// Layout & spacing — matches lib Input component
|
|
@@ -46280,13 +46392,13 @@ function SearchInput({
|
|
|
46280
46392
|
limitTags = "auto",
|
|
46281
46393
|
getLimitTagsText = (more) => `+${more}`
|
|
46282
46394
|
}) {
|
|
46283
|
-
const [internalValue, setInternalValue] =
|
|
46395
|
+
const [internalValue, setInternalValue] = React128.useState(defaultValue);
|
|
46284
46396
|
const currentValue = onChange ? value ?? "" : internalValue;
|
|
46285
46397
|
const debouncedValue = useDebounce(currentValue, debounceMs);
|
|
46286
|
-
const [isOpen, setIsOpen] =
|
|
46287
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
46398
|
+
const [isOpen, setIsOpen] = React128.useState(false);
|
|
46399
|
+
const [highlightedIndex, setHighlightedIndex] = React128.useState(-1);
|
|
46288
46400
|
const keyboardPadding = useKeyboardCollisionPadding();
|
|
46289
|
-
const containerRef =
|
|
46401
|
+
const containerRef = React128.useRef(null);
|
|
46290
46402
|
const currentPlaceholder = filterChips.length > 0 ? "Add filter..." : placeholder;
|
|
46291
46403
|
const {
|
|
46292
46404
|
visibleCount: rawVisibleCount,
|
|
@@ -46303,10 +46415,10 @@ function SearchInput({
|
|
|
46303
46415
|
placeholder: filterChips.length > 0 ? "" : placeholder
|
|
46304
46416
|
});
|
|
46305
46417
|
const visibleCount = filterChips.length > 0 ? Math.max(1, rawVisibleCount) : rawVisibleCount;
|
|
46306
|
-
const hiddenTagsRef =
|
|
46307
|
-
const hiddenTagsPopupRef =
|
|
46308
|
-
const [showHiddenTags, setShowHiddenTags] =
|
|
46309
|
-
|
|
46418
|
+
const hiddenTagsRef = React128.useRef(null);
|
|
46419
|
+
const hiddenTagsPopupRef = React128.useRef(null);
|
|
46420
|
+
const [showHiddenTags, setShowHiddenTags] = React128.useState(false);
|
|
46421
|
+
React128.useEffect(() => {
|
|
46310
46422
|
if (!showHiddenTags) return;
|
|
46311
46423
|
const handleClick = (e) => {
|
|
46312
46424
|
const target = e.target;
|
|
@@ -46320,7 +46432,7 @@ function SearchInput({
|
|
|
46320
46432
|
const hiddenCount = filterChips.length - visibleCount;
|
|
46321
46433
|
const visibleChips = filterChips.slice(0, visibleCount);
|
|
46322
46434
|
const hiddenChips = filterChips.slice(visibleCount);
|
|
46323
|
-
const { flatResults, groups } =
|
|
46435
|
+
const { flatResults, groups } = React128.useMemo(() => {
|
|
46324
46436
|
if (!groupBy) return { flatResults: results, groups: null };
|
|
46325
46437
|
const grouped = /* @__PURE__ */ new Map();
|
|
46326
46438
|
for (const r of results) {
|
|
@@ -46337,7 +46449,7 @@ function SearchInput({
|
|
|
46337
46449
|
const meetsMinQuery = debouncedValue.length >= minQueryLength;
|
|
46338
46450
|
const autoShow = meetsMinQuery;
|
|
46339
46451
|
const dropdownVisible = showDropdownProp ?? (isOpen && autoShow);
|
|
46340
|
-
|
|
46452
|
+
React128.useEffect(() => {
|
|
46341
46453
|
setHighlightedIndex(-1);
|
|
46342
46454
|
}, [flatResults.length]);
|
|
46343
46455
|
const handleChange = (e) => {
|
|
@@ -46618,7 +46730,7 @@ function SearchInput({
|
|
|
46618
46730
|
|
|
46619
46731
|
// src/components/ui/filter-list.tsx
|
|
46620
46732
|
init_cn();
|
|
46621
|
-
import * as
|
|
46733
|
+
import * as React129 from "react";
|
|
46622
46734
|
import * as CheckboxPrimitive4 from "@radix-ui/react-checkbox";
|
|
46623
46735
|
import { jsx as jsx364, jsxs as jsxs285 } from "react/jsx-runtime";
|
|
46624
46736
|
function FilterListItem({
|
|
@@ -46667,7 +46779,7 @@ function FilterListItem({
|
|
|
46667
46779
|
"flex items-start gap-[var(--spacing-system-xxs)] text-h6",
|
|
46668
46780
|
selected ? "text-ods-accent" : "text-ods-text-secondary"
|
|
46669
46781
|
),
|
|
46670
|
-
children: meta.map((item, index) => /* @__PURE__ */ jsxs285(
|
|
46782
|
+
children: meta.map((item, index) => /* @__PURE__ */ jsxs285(React129.Fragment, { children: [
|
|
46671
46783
|
index > 0 && /* @__PURE__ */ jsx364("span", { "aria-hidden": "true", children: "\u2022" }),
|
|
46672
46784
|
/* @__PURE__ */ jsx364("span", { children: item })
|
|
46673
46785
|
] }, index))
|
|
@@ -46734,7 +46846,7 @@ function FilterList({
|
|
|
46734
46846
|
// src/components/ui/tag-search-input.tsx
|
|
46735
46847
|
import {
|
|
46736
46848
|
useEffect as useEffect80,
|
|
46737
|
-
useRef as
|
|
46849
|
+
useRef as useRef65,
|
|
46738
46850
|
useState as useState103
|
|
46739
46851
|
} from "react";
|
|
46740
46852
|
init_cn();
|
|
@@ -46769,9 +46881,9 @@ function TagSearchInput({
|
|
|
46769
46881
|
limitTags,
|
|
46770
46882
|
placeholder: currentPlaceholder
|
|
46771
46883
|
});
|
|
46772
|
-
const wrapperRef =
|
|
46773
|
-
const hiddenTagsRef =
|
|
46774
|
-
const hiddenTagsPopupRef =
|
|
46884
|
+
const wrapperRef = useRef65(null);
|
|
46885
|
+
const hiddenTagsRef = useRef65(null);
|
|
46886
|
+
const hiddenTagsPopupRef = useRef65(null);
|
|
46775
46887
|
const [showHiddenTags, setShowHiddenTags] = useState103(false);
|
|
46776
46888
|
useEffect80(() => {
|
|
46777
46889
|
if (!showHiddenTags) return;
|
|
@@ -46935,7 +47047,7 @@ function TagSearchInput({
|
|
|
46935
47047
|
}
|
|
46936
47048
|
|
|
46937
47049
|
// src/components/ui/markdown-editor.tsx
|
|
46938
|
-
import { useRef as
|
|
47050
|
+
import { useRef as useRef66, useCallback as useCallback45, useState as useState104, useEffect as useEffect81 } from "react";
|
|
46939
47051
|
init_cn();
|
|
46940
47052
|
import { Loader2 as Loader28, Upload as Upload8 } from "lucide-react";
|
|
46941
47053
|
import { jsx as jsx366, jsxs as jsxs287 } from "react/jsx-runtime";
|
|
@@ -46990,7 +47102,7 @@ function MarkdownEditor({
|
|
|
46990
47102
|
onFileUploaded,
|
|
46991
47103
|
renderPreview
|
|
46992
47104
|
}) {
|
|
46993
|
-
const fileInputRef =
|
|
47105
|
+
const fileInputRef = useRef66(null);
|
|
46994
47106
|
const [isUploading, setIsUploading] = useState104(false);
|
|
46995
47107
|
const [uploadProgress, setUploadProgress] = useState104("");
|
|
46996
47108
|
const [defaultExtraCommands, setDefaultExtraCommands] = useState104([]);
|
|
@@ -47004,7 +47116,7 @@ function MarkdownEditor({
|
|
|
47004
47116
|
const handleChange = (val) => {
|
|
47005
47117
|
onChange(val || "");
|
|
47006
47118
|
};
|
|
47007
|
-
const insertTextAtCursor =
|
|
47119
|
+
const insertTextAtCursor = useCallback45(
|
|
47008
47120
|
(text) => {
|
|
47009
47121
|
const textarea = document.querySelector(
|
|
47010
47122
|
".w-md-editor-text-textarea"
|
|
@@ -47020,7 +47132,7 @@ function MarkdownEditor({
|
|
|
47020
47132
|
},
|
|
47021
47133
|
[value, onChange]
|
|
47022
47134
|
);
|
|
47023
|
-
const handleFileUpload =
|
|
47135
|
+
const handleFileUpload = useCallback45(
|
|
47024
47136
|
async (file) => {
|
|
47025
47137
|
if (!onUploadFile) return;
|
|
47026
47138
|
setIsUploading(true);
|
|
@@ -47041,7 +47153,7 @@ function MarkdownEditor({
|
|
|
47041
47153
|
},
|
|
47042
47154
|
[onUploadFile, insertTextAtCursor, onFileUploaded]
|
|
47043
47155
|
);
|
|
47044
|
-
const handleFileInputChange =
|
|
47156
|
+
const handleFileInputChange = useCallback45(
|
|
47045
47157
|
(e) => {
|
|
47046
47158
|
const file = e.target.files?.[0];
|
|
47047
47159
|
if (file) {
|
|
@@ -47051,7 +47163,7 @@ function MarkdownEditor({
|
|
|
47051
47163
|
},
|
|
47052
47164
|
[handleFileUpload]
|
|
47053
47165
|
);
|
|
47054
|
-
const handlePaste =
|
|
47166
|
+
const handlePaste = useCallback45(
|
|
47055
47167
|
(e) => {
|
|
47056
47168
|
if (!onUploadFile) return;
|
|
47057
47169
|
const items = e.clipboardData?.items;
|
|
@@ -47083,14 +47195,14 @@ function MarkdownEditor({
|
|
|
47083
47195
|
}
|
|
47084
47196
|
} : null;
|
|
47085
47197
|
const extraCommands = uploadCommand ? [...defaultExtraCommands, uploadCommand] : defaultExtraCommands;
|
|
47086
|
-
const wrapperRef =
|
|
47087
|
-
const isDraggingRef =
|
|
47088
|
-
const mouseYRef =
|
|
47089
|
-
const rafRef =
|
|
47090
|
-
const scrollParentRef =
|
|
47198
|
+
const wrapperRef = useRef66(null);
|
|
47199
|
+
const isDraggingRef = useRef66(false);
|
|
47200
|
+
const mouseYRef = useRef66(0);
|
|
47201
|
+
const rafRef = useRef66(0);
|
|
47202
|
+
const scrollParentRef = useRef66(window);
|
|
47091
47203
|
const EDGE_ZONE = 60;
|
|
47092
47204
|
const MAX_SCROLL_SPEED = 15;
|
|
47093
|
-
const findScrollParent =
|
|
47205
|
+
const findScrollParent = useCallback45((el) => {
|
|
47094
47206
|
let node = el?.parentElement;
|
|
47095
47207
|
while (node && node !== document.documentElement) {
|
|
47096
47208
|
const { overflowY } = window.getComputedStyle(node);
|
|
@@ -47101,7 +47213,7 @@ function MarkdownEditor({
|
|
|
47101
47213
|
}
|
|
47102
47214
|
return window;
|
|
47103
47215
|
}, []);
|
|
47104
|
-
const scrollLoop =
|
|
47216
|
+
const scrollLoop = useCallback45(() => {
|
|
47105
47217
|
if (!isDraggingRef.current) return;
|
|
47106
47218
|
const parent = scrollParentRef.current;
|
|
47107
47219
|
const isWindow = parent === window;
|
|
@@ -47210,7 +47322,7 @@ function MarkdownEditor({
|
|
|
47210
47322
|
}
|
|
47211
47323
|
|
|
47212
47324
|
// src/components/ui/file-upload.tsx
|
|
47213
|
-
import * as
|
|
47325
|
+
import * as React131 from "react";
|
|
47214
47326
|
import { Loader2 as Loader29 } from "lucide-react";
|
|
47215
47327
|
init_cn();
|
|
47216
47328
|
import { jsx as jsx367, jsxs as jsxs288 } from "react/jsx-runtime";
|
|
@@ -47262,11 +47374,11 @@ function FileUpload({
|
|
|
47262
47374
|
acceptWindowDrops = false,
|
|
47263
47375
|
pickFiles
|
|
47264
47376
|
}) {
|
|
47265
|
-
const [dragActive, setDragActive] =
|
|
47266
|
-
const [validationError, setValidationError] =
|
|
47267
|
-
const fileInputRef =
|
|
47377
|
+
const [dragActive, setDragActive] = React131.useState(false);
|
|
47378
|
+
const [validationError, setValidationError] = React131.useState(null);
|
|
47379
|
+
const fileInputRef = React131.useRef(null);
|
|
47268
47380
|
const isManaged = managedFiles !== void 0;
|
|
47269
|
-
const files =
|
|
47381
|
+
const files = React131.useMemo(() => {
|
|
47270
47382
|
if (!value) return [];
|
|
47271
47383
|
return Array.isArray(value) ? value : [value];
|
|
47272
47384
|
}, [value]);
|
|
@@ -47314,7 +47426,7 @@ function FileUpload({
|
|
|
47314
47426
|
fileInputRef.current.value = "";
|
|
47315
47427
|
}
|
|
47316
47428
|
};
|
|
47317
|
-
const handleFilesRef =
|
|
47429
|
+
const handleFilesRef = React131.useRef(handleFiles);
|
|
47318
47430
|
handleFilesRef.current = handleFiles;
|
|
47319
47431
|
const handleDrag = (e) => {
|
|
47320
47432
|
e.preventDefault();
|
|
@@ -47335,7 +47447,7 @@ function FileUpload({
|
|
|
47335
47447
|
handleFiles(e.dataTransfer.files);
|
|
47336
47448
|
}
|
|
47337
47449
|
};
|
|
47338
|
-
|
|
47450
|
+
React131.useEffect(() => {
|
|
47339
47451
|
if (!acceptWindowDrops || disabled) return;
|
|
47340
47452
|
let dragCounter = 0;
|
|
47341
47453
|
const onWindowDragEnter = (e) => {
|
|
@@ -47536,7 +47648,7 @@ function FileUpload({
|
|
|
47536
47648
|
}
|
|
47537
47649
|
|
|
47538
47650
|
// src/components/ui/image-uploader.tsx
|
|
47539
|
-
import * as
|
|
47651
|
+
import * as React132 from "react";
|
|
47540
47652
|
import { Loader2 as Loader210 } from "lucide-react";
|
|
47541
47653
|
init_cn();
|
|
47542
47654
|
import { Fragment as Fragment74, jsx as jsx368, jsxs as jsxs289 } from "react/jsx-runtime";
|
|
@@ -47578,10 +47690,10 @@ function ImageUploader({
|
|
|
47578
47690
|
className,
|
|
47579
47691
|
dropzoneClassName
|
|
47580
47692
|
}) {
|
|
47581
|
-
const inputRef =
|
|
47582
|
-
const [dragActive, setDragActive] =
|
|
47583
|
-
const [pressed, setPressed] =
|
|
47584
|
-
const [validationError, setValidationError] =
|
|
47693
|
+
const inputRef = React132.useRef(null);
|
|
47694
|
+
const [dragActive, setDragActive] = React132.useState(false);
|
|
47695
|
+
const [pressed, setPressed] = React132.useState(false);
|
|
47696
|
+
const [validationError, setValidationError] = React132.useState(null);
|
|
47585
47697
|
const interactive = !disabled && !loading;
|
|
47586
47698
|
const resolvedValue = useAuthedImageSrc(value);
|
|
47587
47699
|
const hasImage = Boolean(value);
|
|
@@ -47744,21 +47856,21 @@ function ActionIconButton({ onClick, disabled, ariaLabel, children }) {
|
|
|
47744
47856
|
|
|
47745
47857
|
// src/components/ui/ticket-status-config-row.tsx
|
|
47746
47858
|
init_cn();
|
|
47747
|
-
import * as
|
|
47859
|
+
import * as React135 from "react";
|
|
47748
47860
|
init_button2();
|
|
47749
47861
|
|
|
47750
47862
|
// src/components/ui/color-preset-select.tsx
|
|
47751
|
-
import * as
|
|
47863
|
+
import * as React134 from "react";
|
|
47752
47864
|
import { HexColorPicker } from "react-colorful";
|
|
47753
47865
|
|
|
47754
47866
|
// src/components/popover.tsx
|
|
47755
47867
|
init_cn();
|
|
47756
|
-
import * as
|
|
47868
|
+
import * as React133 from "react";
|
|
47757
47869
|
import * as PopoverPrimitive7 from "@radix-ui/react-popover";
|
|
47758
47870
|
import { jsx as jsx369 } from "react/jsx-runtime";
|
|
47759
47871
|
var Popover2 = PopoverPrimitive7.Root;
|
|
47760
47872
|
var PopoverTrigger = PopoverPrimitive7.Trigger;
|
|
47761
|
-
var PopoverContent =
|
|
47873
|
+
var PopoverContent = React133.forwardRef(({ className, align = "center", sideOffset = 4, collisionPadding, ...props }, ref) => {
|
|
47762
47874
|
const keyboardPadding = useKeyboardCollisionPadding();
|
|
47763
47875
|
return /* @__PURE__ */ jsx369(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ jsx369(
|
|
47764
47876
|
PopoverPrimitive7.Content,
|
|
@@ -47859,8 +47971,8 @@ var FORMATS = ["HEX", "RGB", "HSL"];
|
|
|
47859
47971
|
var channelInputClass = "flex-1 min-w-0 [&_input]:text-center [&_input]:tabular-nums";
|
|
47860
47972
|
var hexInputClass = "flex-1 min-w-0 [&_input]:uppercase";
|
|
47861
47973
|
function HexInputs({ value, onChange }) {
|
|
47862
|
-
const [draft, setDraft] =
|
|
47863
|
-
|
|
47974
|
+
const [draft, setDraft] = React134.useState(value);
|
|
47975
|
+
React134.useEffect(() => setDraft(value), [value]);
|
|
47864
47976
|
const commit = () => {
|
|
47865
47977
|
const candidate = (draft.startsWith("#") ? draft : `#${draft}`).toLowerCase();
|
|
47866
47978
|
if (HEX_PATTERN.test(candidate)) onChange(candidate);
|
|
@@ -47892,8 +48004,8 @@ function ChannelInput({
|
|
|
47892
48004
|
ariaLabel,
|
|
47893
48005
|
onCommit
|
|
47894
48006
|
}) {
|
|
47895
|
-
const [draft, setDraft] =
|
|
47896
|
-
|
|
48007
|
+
const [draft, setDraft] = React134.useState(String(value));
|
|
48008
|
+
React134.useEffect(() => setDraft(String(value)), [value]);
|
|
47897
48009
|
const commit = () => {
|
|
47898
48010
|
const parsed = Number.parseInt(draft, 10);
|
|
47899
48011
|
if (!Number.isFinite(parsed)) {
|
|
@@ -47953,8 +48065,8 @@ function HslInputs({ value, onChange }) {
|
|
|
47953
48065
|
] });
|
|
47954
48066
|
}
|
|
47955
48067
|
function ColorPickerInput({ value, onChange, disabled, className }) {
|
|
47956
|
-
const [open, setOpen] =
|
|
47957
|
-
const [format3, setFormat] =
|
|
48068
|
+
const [open, setOpen] = React134.useState(false);
|
|
48069
|
+
const [format3, setFormat] = React134.useState("HEX");
|
|
47958
48070
|
const formatGroups = [
|
|
47959
48071
|
{
|
|
47960
48072
|
items: FORMATS.map((f) => ({
|
|
@@ -48019,9 +48131,9 @@ function ColorPickerInput({ value, onChange, disabled, className }) {
|
|
|
48019
48131
|
import { jsx as jsx371, jsxs as jsxs291 } from "react/jsx-runtime";
|
|
48020
48132
|
var dismissOpenTooltip = null;
|
|
48021
48133
|
function WithLeftTooltip({ content, children }) {
|
|
48022
|
-
const [open, setOpen] =
|
|
48023
|
-
const isTouchRef =
|
|
48024
|
-
const close =
|
|
48134
|
+
const [open, setOpen] = React135.useState(false);
|
|
48135
|
+
const isTouchRef = React135.useRef(false);
|
|
48136
|
+
const close = React135.useCallback(() => setOpen(false), []);
|
|
48025
48137
|
if (!content) return children;
|
|
48026
48138
|
const toggleFromTouch = () => {
|
|
48027
48139
|
setOpen((prev) => {
|
|
@@ -48154,7 +48266,7 @@ function TicketStatusConfigRow({
|
|
|
48154
48266
|
}
|
|
48155
48267
|
|
|
48156
48268
|
// src/components/ui/test-run.tsx
|
|
48157
|
-
import * as
|
|
48269
|
+
import * as React136 from "react";
|
|
48158
48270
|
init_cn();
|
|
48159
48271
|
import { jsx as jsx372, jsxs as jsxs292 } from "react/jsx-runtime";
|
|
48160
48272
|
function formatTestRunDuration(ms) {
|
|
@@ -48173,8 +48285,8 @@ function TestResultsSkeleton() {
|
|
|
48173
48285
|
] }) });
|
|
48174
48286
|
}
|
|
48175
48287
|
function TestResultsTable({ rows, loading }) {
|
|
48176
|
-
const columnKeys =
|
|
48177
|
-
const columns =
|
|
48288
|
+
const columnKeys = React136.useMemo(() => rows.length > 0 ? Object.keys(rows[0]) : [], [rows]);
|
|
48289
|
+
const columns = React136.useMemo(() => {
|
|
48178
48290
|
return columnKeys.map((key) => ({
|
|
48179
48291
|
id: key,
|
|
48180
48292
|
accessorFn: (row) => row[key],
|
|
@@ -48267,10 +48379,10 @@ function TestRunStatusStat({ status, className }) {
|
|
|
48267
48379
|
] });
|
|
48268
48380
|
}
|
|
48269
48381
|
function useTestRunState(campaign) {
|
|
48270
|
-
const [hasRun, setHasRun] =
|
|
48271
|
-
const [isStarting, setIsStarting] =
|
|
48272
|
-
const [durationMs, setDurationMs] =
|
|
48273
|
-
|
|
48382
|
+
const [hasRun, setHasRun] = React136.useState(false);
|
|
48383
|
+
const [isStarting, setIsStarting] = React136.useState(false);
|
|
48384
|
+
const [durationMs, setDurationMs] = React136.useState(0);
|
|
48385
|
+
React136.useEffect(() => {
|
|
48274
48386
|
if (!campaign.startedAt || !campaign.isRunning) {
|
|
48275
48387
|
if (campaign.startedAt && !campaign.isRunning) {
|
|
48276
48388
|
setDurationMs(Date.now() - campaign.startedAt.getTime());
|
|
@@ -48283,7 +48395,7 @@ function useTestRunState(campaign) {
|
|
|
48283
48395
|
}, 1e3);
|
|
48284
48396
|
return () => clearInterval(interval);
|
|
48285
48397
|
}, [campaign.startedAt, campaign.isRunning]);
|
|
48286
|
-
const run =
|
|
48398
|
+
const run = React136.useCallback(async (start) => {
|
|
48287
48399
|
setHasRun(true);
|
|
48288
48400
|
setDurationMs(0);
|
|
48289
48401
|
setIsStarting(true);
|
|
@@ -48293,11 +48405,11 @@ function useTestRunState(campaign) {
|
|
|
48293
48405
|
setIsStarting(false);
|
|
48294
48406
|
}
|
|
48295
48407
|
}, []);
|
|
48296
|
-
const stop =
|
|
48408
|
+
const stop = React136.useCallback(() => {
|
|
48297
48409
|
setIsStarting(false);
|
|
48298
48410
|
campaign.stopCampaign();
|
|
48299
48411
|
}, [campaign.stopCampaign]);
|
|
48300
|
-
const reset =
|
|
48412
|
+
const reset = React136.useCallback(() => {
|
|
48301
48413
|
setIsStarting(false);
|
|
48302
48414
|
campaign.stopCampaign();
|
|
48303
48415
|
setDurationMs(0);
|
|
@@ -48311,7 +48423,7 @@ function useTestRunState(campaign) {
|
|
|
48311
48423
|
const showTiming = hasRun && campaign.startedAt !== null && (campaign.isRunning || isFinished);
|
|
48312
48424
|
const startedLabel = showTiming && campaign.startedAt ? formatTime(campaign.startedAt) : "00:00 PM";
|
|
48313
48425
|
const durationLabel = showTiming ? formatTestRunDuration(durationMs) : "00:00:00";
|
|
48314
|
-
const displayRows =
|
|
48426
|
+
const displayRows = React136.useMemo(
|
|
48315
48427
|
() => campaign.results.map(
|
|
48316
48428
|
(row) => Object.fromEntries(Object.entries(row).map(([key, value]) => [key.replace(/_/g, " "), value]))
|
|
48317
48429
|
),
|
|
@@ -48417,16 +48529,16 @@ function TicketAttachmentsList({ attachments, className, size: size2 = "default"
|
|
|
48417
48529
|
}
|
|
48418
48530
|
|
|
48419
48531
|
// src/components/ui/ticket-notes-section.tsx
|
|
48420
|
-
import * as
|
|
48532
|
+
import * as React138 from "react";
|
|
48421
48533
|
init_cn();
|
|
48422
48534
|
|
|
48423
48535
|
// src/components/ui/ticket-note-card.tsx
|
|
48424
|
-
import * as
|
|
48536
|
+
import * as React137 from "react";
|
|
48425
48537
|
init_cn();
|
|
48426
48538
|
import { Fragment as Fragment76, jsx as jsx375, jsxs as jsxs295 } from "react/jsx-runtime";
|
|
48427
48539
|
function TicketNoteCard({ note, onEdit, onDelete, className }) {
|
|
48428
|
-
const [isEditing, setIsEditing] =
|
|
48429
|
-
const [editText, setEditText] =
|
|
48540
|
+
const [isEditing, setIsEditing] = React137.useState(false);
|
|
48541
|
+
const [editText, setEditText] = React137.useState(note.text);
|
|
48430
48542
|
const handleSave = () => {
|
|
48431
48543
|
const trimmed = editText.trim();
|
|
48432
48544
|
if (!trimmed || !onEdit) return;
|
|
@@ -48549,7 +48661,7 @@ function TicketNotesSection({
|
|
|
48549
48661
|
isAddingNote,
|
|
48550
48662
|
className
|
|
48551
48663
|
}) {
|
|
48552
|
-
const [noteText, setNoteText] =
|
|
48664
|
+
const [noteText, setNoteText] = React138.useState("");
|
|
48553
48665
|
const handleSend = () => {
|
|
48554
48666
|
const trimmed = noteText.trim();
|
|
48555
48667
|
if (!trimmed || !onAddNote || isAddingNote) return;
|
|
@@ -48753,7 +48865,7 @@ function TicketInfoSection({
|
|
|
48753
48865
|
}
|
|
48754
48866
|
|
|
48755
48867
|
// src/components/ui/take-over-ticket-modal.tsx
|
|
48756
|
-
import * as
|
|
48868
|
+
import * as React139 from "react";
|
|
48757
48869
|
init_button2();
|
|
48758
48870
|
import { jsx as jsx378, jsxs as jsxs298 } from "react/jsx-runtime";
|
|
48759
48871
|
function renderTicketStatusOption(option, isSelected) {
|
|
@@ -48788,9 +48900,9 @@ function TakeOverTicketModal({
|
|
|
48788
48900
|
isPending = false,
|
|
48789
48901
|
onConfirm
|
|
48790
48902
|
}) {
|
|
48791
|
-
const [statusId, setStatusId] =
|
|
48792
|
-
const [assigneeId, setAssigneeId] =
|
|
48793
|
-
|
|
48903
|
+
const [statusId, setStatusId] = React139.useState(null);
|
|
48904
|
+
const [assigneeId, setAssigneeId] = React139.useState(null);
|
|
48905
|
+
React139.useEffect(() => {
|
|
48794
48906
|
if (!isOpen) return;
|
|
48795
48907
|
setStatusId(initialStatusId ?? null);
|
|
48796
48908
|
setAssigneeId(initialAssigneeId ?? null);
|
|
@@ -48866,7 +48978,7 @@ function TakeOverTicketModal({
|
|
|
48866
48978
|
}
|
|
48867
48979
|
|
|
48868
48980
|
// src/components/ui/reopen-ticket-modal.tsx
|
|
48869
|
-
import * as
|
|
48981
|
+
import * as React140 from "react";
|
|
48870
48982
|
init_button2();
|
|
48871
48983
|
import { jsx as jsx379, jsxs as jsxs299 } from "react/jsx-runtime";
|
|
48872
48984
|
var REASON_MAX_LENGTH = 1e3;
|
|
@@ -48882,10 +48994,10 @@ function ReopenTicketModal({
|
|
|
48882
48994
|
isPending = false,
|
|
48883
48995
|
onConfirm
|
|
48884
48996
|
}) {
|
|
48885
|
-
const [statusId, setStatusId] =
|
|
48886
|
-
const [assigneeId, setAssigneeId] =
|
|
48887
|
-
const [reason, setReason] =
|
|
48888
|
-
|
|
48997
|
+
const [statusId, setStatusId] = React140.useState(null);
|
|
48998
|
+
const [assigneeId, setAssigneeId] = React140.useState(null);
|
|
48999
|
+
const [reason, setReason] = React140.useState("");
|
|
49000
|
+
React140.useEffect(() => {
|
|
48889
49001
|
if (!isOpen) return;
|
|
48890
49002
|
setStatusId(initialStatusId ?? null);
|
|
48891
49003
|
setAssigneeId(initialAssigneeId ?? null);
|
|
@@ -48979,7 +49091,7 @@ function ReopenTicketModal({
|
|
|
48979
49091
|
|
|
48980
49092
|
// src/components/ui/reopen-ticket-request-modal.tsx
|
|
48981
49093
|
init_button2();
|
|
48982
|
-
import * as
|
|
49094
|
+
import * as React141 from "react";
|
|
48983
49095
|
import { jsx as jsx380, jsxs as jsxs300 } from "react/jsx-runtime";
|
|
48984
49096
|
var REASON_MAX_LENGTH2 = 1e3;
|
|
48985
49097
|
function ReopenTicketRequestModal({
|
|
@@ -48989,9 +49101,9 @@ function ReopenTicketRequestModal({
|
|
|
48989
49101
|
isPending = false,
|
|
48990
49102
|
onConfirm
|
|
48991
49103
|
}) {
|
|
48992
|
-
const [reason, setReason] =
|
|
48993
|
-
const [handoff, setHandoff] =
|
|
48994
|
-
|
|
49104
|
+
const [reason, setReason] = React141.useState("");
|
|
49105
|
+
const [handoff, setHandoff] = React141.useState(false);
|
|
49106
|
+
React141.useEffect(() => {
|
|
48995
49107
|
if (!isOpen) return;
|
|
48996
49108
|
setReason("");
|
|
48997
49109
|
setHandoff(false);
|
|
@@ -49511,7 +49623,7 @@ function RoadmapCard({
|
|
|
49511
49623
|
}
|
|
49512
49624
|
|
|
49513
49625
|
// src/components/chat/entity-cards/github-activity-card.tsx
|
|
49514
|
-
import
|
|
49626
|
+
import React143 from "react";
|
|
49515
49627
|
import { GitPullRequest, Eye as Eye4, ExternalLink as ExternalLink9 } from "lucide-react";
|
|
49516
49628
|
import { Fragment as Fragment80, jsx as jsx385, jsxs as jsxs304 } from "react/jsx-runtime";
|
|
49517
49629
|
function parseRepoFromUrl(url) {
|
|
@@ -49652,7 +49764,7 @@ function GitHubActivityCard({ item, variant = "compact", className, anchorProps
|
|
|
49652
49764
|
reviewState ? /* @__PURE__ */ jsx385(ReviewStateBadge, { state: reviewState }) : null,
|
|
49653
49765
|
/* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_TITLE, children: primaryText })
|
|
49654
49766
|
] }),
|
|
49655
|
-
/* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_META_ROW, children: metaParts.map((part, i) => /* @__PURE__ */ jsxs304(
|
|
49767
|
+
/* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_META_ROW, children: metaParts.map((part, i) => /* @__PURE__ */ jsxs304(React143.Fragment, { children: [
|
|
49656
49768
|
i > 0 ? /* @__PURE__ */ jsx385("span", { className: "text-ods-text-secondary/40 shrink-0", children: "\xB7" }) : null,
|
|
49657
49769
|
/* @__PURE__ */ jsx385("span", { className: "min-w-0 truncate", children: part })
|
|
49658
49770
|
] }, i)) }) }),
|
|
@@ -49698,7 +49810,7 @@ function GitHubActivityCardSkeleton({ variant = "compact", className }) {
|
|
|
49698
49810
|
}
|
|
49699
49811
|
|
|
49700
49812
|
// src/components/chat/entity-cards/slack-message-card.tsx
|
|
49701
|
-
import
|
|
49813
|
+
import React144 from "react";
|
|
49702
49814
|
import { ExternalLink as ExternalLink10, Hash } from "lucide-react";
|
|
49703
49815
|
import { Fragment as Fragment81, jsx as jsx386, jsxs as jsxs305 } from "react/jsx-runtime";
|
|
49704
49816
|
function parseChannelFromUrl(url) {
|
|
@@ -49744,7 +49856,7 @@ function SlackMessageCard({ item, variant = "compact", className, anchorProps })
|
|
|
49744
49856
|
/* @__PURE__ */ jsxs305("span", { className: COMPACT_CARD_TEXT_COL, children: [
|
|
49745
49857
|
/* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_TITLE_ROW, children: /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_TITLE, children: item.title }) }),
|
|
49746
49858
|
/* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_SUMMARY, children: item.preview || COMPACT_CARD_ROW_FILLER }) }),
|
|
49747
|
-
/* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW, children: metaParts.length > 0 ? metaParts.map((part, i) => /* @__PURE__ */ jsxs305(
|
|
49859
|
+
/* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW, children: metaParts.length > 0 ? metaParts.map((part, i) => /* @__PURE__ */ jsxs305(React144.Fragment, { children: [
|
|
49748
49860
|
i > 0 ? /* @__PURE__ */ jsx386("span", { className: "text-ods-text-secondary/40 shrink-0", children: "\xB7" }) : null,
|
|
49749
49861
|
/* @__PURE__ */ jsx386("span", { className: "min-w-0 truncate", children: part })
|
|
49750
49862
|
] }, i)) : /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_SUMMARY, children: COMPACT_CARD_ROW_FILLER }) }) })
|
|
@@ -49787,7 +49899,7 @@ function SlackMessageCardSkeleton({ variant = "compact", className }) {
|
|
|
49787
49899
|
}
|
|
49788
49900
|
|
|
49789
49901
|
// src/components/chat/entity-cards/hubspot-ticket-card.tsx
|
|
49790
|
-
import
|
|
49902
|
+
import React145 from "react";
|
|
49791
49903
|
import { ExternalLink as ExternalLink11 } from "lucide-react";
|
|
49792
49904
|
import { Fragment as Fragment82, jsx as jsx387, jsxs as jsxs306 } from "react/jsx-runtime";
|
|
49793
49905
|
function formatToken(token) {
|
|
@@ -49856,7 +49968,7 @@ function HubspotTicketCard({ item, variant = "compact", className, anchorProps }
|
|
|
49856
49968
|
/* @__PURE__ */ jsx387("span", { className: "min-w-0 truncate", children: item.customerEmail })
|
|
49857
49969
|
] }) : null,
|
|
49858
49970
|
/* @__PURE__ */ jsx387("span", { className: "flex min-w-0", children: /* @__PURE__ */ jsx387("span", { className: "line-clamp-4 whitespace-pre-wrap break-words text-h6 text-ods-text-secondary", children: item.preview || /* @__PURE__ */ jsx387("span", { className: "italic text-ods-text-secondary/60", children: "No description provided." }) }) }),
|
|
49859
|
-
metaParts.length > 0 ? /* @__PURE__ */ jsx387("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx387("span", { className: COMPACT_CARD_META_ROW, children: metaParts.map((part, i) => /* @__PURE__ */ jsxs306(
|
|
49971
|
+
metaParts.length > 0 ? /* @__PURE__ */ jsx387("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx387("span", { className: COMPACT_CARD_META_ROW, children: metaParts.map((part, i) => /* @__PURE__ */ jsxs306(React145.Fragment, { children: [
|
|
49860
49972
|
i > 0 ? /* @__PURE__ */ jsx387("span", { className: "text-ods-text-secondary/40 shrink-0", children: "\xB7" }) : null,
|
|
49861
49973
|
/* @__PURE__ */ jsx387("span", { className: "min-w-0 truncate", children: part })
|
|
49862
49974
|
] }, i)) }) }) : null
|
|
@@ -51950,7 +52062,7 @@ function GenericEntityCardSkeleton({ className }) {
|
|
|
51950
52062
|
}
|
|
51951
52063
|
|
|
51952
52064
|
// src/components/chat/entity-cards/dispatch.tsx
|
|
51953
|
-
import
|
|
52065
|
+
import React147 from "react";
|
|
51954
52066
|
init_next_navigation();
|
|
51955
52067
|
|
|
51956
52068
|
// src/components/chat/hooks/use-chat-card-item.ts
|
|
@@ -53257,7 +53369,7 @@ function ChatCardLoader({
|
|
|
53257
53369
|
extras
|
|
53258
53370
|
}) {
|
|
53259
53371
|
const runtime = useRequiredChatRuntime();
|
|
53260
|
-
const resolvedChatRef =
|
|
53372
|
+
const resolvedChatRef = React147.useMemo(() => {
|
|
53261
53373
|
const cta = resolveSourceRowCTA(
|
|
53262
53374
|
{
|
|
53263
53375
|
sourceRepo: chatRef.sourceRepo,
|
|
@@ -53405,7 +53517,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
53405
53517
|
}
|
|
53406
53518
|
|
|
53407
53519
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
53408
|
-
import { useCallback as
|
|
53520
|
+
import { useCallback as useCallback48, useRef as useRef70 } from "react";
|
|
53409
53521
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
53410
53522
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
53411
53523
|
}
|
|
@@ -53427,24 +53539,24 @@ function useChunkCatchup({
|
|
|
53427
53539
|
chatTypes = [CHAT_TYPE.CLIENT],
|
|
53428
53540
|
fetchChunks
|
|
53429
53541
|
}) {
|
|
53430
|
-
const processedSequenceKeys =
|
|
53431
|
-
const lastSequenceId =
|
|
53432
|
-
const lastSequenceIdByType =
|
|
53433
|
-
const fetchingInProgress =
|
|
53434
|
-
const lastFetchParams =
|
|
53435
|
-
const pendingCatchupRef =
|
|
53436
|
-
const chunkBuffer =
|
|
53437
|
-
const bufferUntilInitialCatchupComplete =
|
|
53438
|
-
const hasCompletedInitialCatchup =
|
|
53439
|
-
const dialogIdRef =
|
|
53542
|
+
const processedSequenceKeys = useRef70(/* @__PURE__ */ new Set());
|
|
53543
|
+
const lastSequenceId = useRef70(null);
|
|
53544
|
+
const lastSequenceIdByType = useRef70(/* @__PURE__ */ new Map());
|
|
53545
|
+
const fetchingInProgress = useRef70(false);
|
|
53546
|
+
const lastFetchParams = useRef70(null);
|
|
53547
|
+
const pendingCatchupRef = useRef70(null);
|
|
53548
|
+
const chunkBuffer = useRef70([]);
|
|
53549
|
+
const bufferUntilInitialCatchupComplete = useRef70(false);
|
|
53550
|
+
const hasCompletedInitialCatchup = useRef70(false);
|
|
53551
|
+
const dialogIdRef = useRef70(dialogId);
|
|
53440
53552
|
dialogIdRef.current = dialogId;
|
|
53441
|
-
const chatTypesRef =
|
|
53553
|
+
const chatTypesRef = useRef70(chatTypes);
|
|
53442
53554
|
chatTypesRef.current = chatTypes;
|
|
53443
|
-
const fetchChunksRef =
|
|
53555
|
+
const fetchChunksRef = useRef70(fetchChunks);
|
|
53444
53556
|
fetchChunksRef.current = fetchChunks;
|
|
53445
|
-
const onChunkReceivedRef =
|
|
53557
|
+
const onChunkReceivedRef = useRef70(onChunkReceived);
|
|
53446
53558
|
onChunkReceivedRef.current = onChunkReceived;
|
|
53447
|
-
const processChunk =
|
|
53559
|
+
const processChunk = useCallback48((chunk, messageType, forceProcess = false) => {
|
|
53448
53560
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
53449
53561
|
chunkBuffer.current.push({ chunk, messageType });
|
|
53450
53562
|
return true;
|
|
@@ -53463,7 +53575,7 @@ function useChunkCatchup({
|
|
|
53463
53575
|
onChunkReceivedRef.current(chunk, messageType);
|
|
53464
53576
|
return true;
|
|
53465
53577
|
}, []);
|
|
53466
|
-
const flushBufferedRealtimeChunks =
|
|
53578
|
+
const flushBufferedRealtimeChunks = useCallback48(() => {
|
|
53467
53579
|
if (chunkBuffer.current.length === 0) return;
|
|
53468
53580
|
const buffered = [...chunkBuffer.current];
|
|
53469
53581
|
chunkBuffer.current = [];
|
|
@@ -53476,7 +53588,7 @@ function useChunkCatchup({
|
|
|
53476
53588
|
processChunk(chunk, messageType, true);
|
|
53477
53589
|
});
|
|
53478
53590
|
}, [processChunk]);
|
|
53479
|
-
const catchUpChunks =
|
|
53591
|
+
const catchUpChunks = useCallback48(async (fromSequenceId) => {
|
|
53480
53592
|
const dialogId2 = dialogIdRef.current;
|
|
53481
53593
|
const chatTypes2 = chatTypesRef.current;
|
|
53482
53594
|
const fetchChunks2 = fetchChunksRef.current;
|
|
@@ -53640,9 +53752,9 @@ function useChunkCatchup({
|
|
|
53640
53752
|
}
|
|
53641
53753
|
}
|
|
53642
53754
|
}, [flushBufferedRealtimeChunks]);
|
|
53643
|
-
const catchUpChunksRef =
|
|
53755
|
+
const catchUpChunksRef = useRef70(null);
|
|
53644
53756
|
catchUpChunksRef.current = catchUpChunks;
|
|
53645
|
-
const resetChunkTracking =
|
|
53757
|
+
const resetChunkTracking = useCallback48(() => {
|
|
53646
53758
|
processedSequenceKeys.current.clear();
|
|
53647
53759
|
lastSequenceId.current = null;
|
|
53648
53760
|
lastSequenceIdByType.current.clear();
|
|
@@ -53653,15 +53765,15 @@ function useChunkCatchup({
|
|
|
53653
53765
|
bufferUntilInitialCatchupComplete.current = false;
|
|
53654
53766
|
hasCompletedInitialCatchup.current = false;
|
|
53655
53767
|
}, []);
|
|
53656
|
-
const startInitialBuffering =
|
|
53768
|
+
const startInitialBuffering = useCallback48(() => {
|
|
53657
53769
|
if (!bufferUntilInitialCatchupComplete.current) {
|
|
53658
53770
|
chunkBuffer.current = [];
|
|
53659
53771
|
bufferUntilInitialCatchupComplete.current = true;
|
|
53660
53772
|
}
|
|
53661
53773
|
hasCompletedInitialCatchup.current = false;
|
|
53662
53774
|
}, []);
|
|
53663
|
-
const isBufferingActive =
|
|
53664
|
-
const resetAndCatchUp =
|
|
53775
|
+
const isBufferingActive = useCallback48(() => bufferUntilInitialCatchupComplete.current, []);
|
|
53776
|
+
const resetAndCatchUp = useCallback48(async () => {
|
|
53665
53777
|
if (!dialogIdRef.current) return;
|
|
53666
53778
|
const fromSeq = lastSequenceId.current;
|
|
53667
53779
|
hasCompletedInitialCatchup.current = false;
|
|
@@ -53719,7 +53831,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
53719
53831
|
}
|
|
53720
53832
|
|
|
53721
53833
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
53722
|
-
import { useCallback as
|
|
53834
|
+
import { useCallback as useCallback49, useEffect as useEffect90, useRef as useRef71, useState as useState119 } from "react";
|
|
53723
53835
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
53724
53836
|
var RESYNC_AFTER_HIDDEN_MS = 1e4;
|
|
53725
53837
|
var RESYNC_COALESCE_MS = 1e3;
|
|
@@ -53746,54 +53858,54 @@ function useJetStreamDialogSubscription({
|
|
|
53746
53858
|
const [reconnectionCount, setReconnectionCount] = useState119(0);
|
|
53747
53859
|
const [recoveryCount, setRecoveryCount] = useState119(0);
|
|
53748
53860
|
const [currentStreamSeq, setCurrentStreamSeq] = useState119(null);
|
|
53749
|
-
const lastRecoveryReportRef =
|
|
53750
|
-
const resyncTimerRef =
|
|
53751
|
-
const lastResyncSignalRef =
|
|
53752
|
-
const clientRef =
|
|
53753
|
-
const subscriptionRef =
|
|
53754
|
-
const highestStreamSeqRef =
|
|
53755
|
-
const onEventRef =
|
|
53861
|
+
const lastRecoveryReportRef = useRef71(0);
|
|
53862
|
+
const resyncTimerRef = useRef71(null);
|
|
53863
|
+
const lastResyncSignalRef = useRef71(resyncSignal);
|
|
53864
|
+
const clientRef = useRef71(null);
|
|
53865
|
+
const subscriptionRef = useRef71(null);
|
|
53866
|
+
const highestStreamSeqRef = useRef71(null);
|
|
53867
|
+
const onEventRef = useRef71(onEvent);
|
|
53756
53868
|
useEffect90(() => {
|
|
53757
53869
|
onEventRef.current = onEvent;
|
|
53758
53870
|
}, [onEvent]);
|
|
53759
|
-
const onConnectRef =
|
|
53871
|
+
const onConnectRef = useRef71(onConnect);
|
|
53760
53872
|
useEffect90(() => {
|
|
53761
53873
|
onConnectRef.current = onConnect;
|
|
53762
53874
|
}, [onConnect]);
|
|
53763
|
-
const onDisconnectRef =
|
|
53875
|
+
const onDisconnectRef = useRef71(onDisconnect);
|
|
53764
53876
|
useEffect90(() => {
|
|
53765
53877
|
onDisconnectRef.current = onDisconnect;
|
|
53766
53878
|
}, [onDisconnect]);
|
|
53767
|
-
const onSubscribedRef =
|
|
53879
|
+
const onSubscribedRef = useRef71(onSubscribed);
|
|
53768
53880
|
useEffect90(() => {
|
|
53769
53881
|
onSubscribedRef.current = onSubscribed;
|
|
53770
53882
|
}, [onSubscribed]);
|
|
53771
|
-
const onBeforeReconnectRef =
|
|
53883
|
+
const onBeforeReconnectRef = useRef71(onBeforeReconnect);
|
|
53772
53884
|
useEffect90(() => {
|
|
53773
53885
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
53774
53886
|
}, [onBeforeReconnect]);
|
|
53775
|
-
const getNatsWsUrlRef =
|
|
53887
|
+
const getNatsWsUrlRef = useRef71(getNatsWsUrl);
|
|
53776
53888
|
useEffect90(() => {
|
|
53777
53889
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
53778
53890
|
}, [getNatsWsUrl]);
|
|
53779
|
-
const reconnectionBackoffRef =
|
|
53891
|
+
const reconnectionBackoffRef = useRef71(reconnectionBackoff);
|
|
53780
53892
|
useEffect90(() => {
|
|
53781
53893
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
53782
53894
|
}, [reconnectionBackoff]);
|
|
53783
|
-
const optStartSeqRef =
|
|
53895
|
+
const optStartSeqRef = useRef71(optStartSeq);
|
|
53784
53896
|
useEffect90(() => {
|
|
53785
53897
|
optStartSeqRef.current = optStartSeq;
|
|
53786
53898
|
}, [optStartSeq]);
|
|
53787
|
-
const inactiveThresholdRef =
|
|
53899
|
+
const inactiveThresholdRef = useRef71(inactiveThresholdMs);
|
|
53788
53900
|
useEffect90(() => {
|
|
53789
53901
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
53790
53902
|
}, [inactiveThresholdMs]);
|
|
53791
|
-
const hadConnectionBeforeRef =
|
|
53792
|
-
const clientConfigRef =
|
|
53903
|
+
const hadConnectionBeforeRef = useRef71(false);
|
|
53904
|
+
const clientConfigRef = useRef71(clientConfig);
|
|
53793
53905
|
useEffect90(() => {
|
|
53794
53906
|
clientConfigRef.current = clientConfig;
|
|
53795
53907
|
}, [clientConfig]);
|
|
53796
|
-
const currentWsUrlRef =
|
|
53908
|
+
const currentWsUrlRef = useRef71("");
|
|
53797
53909
|
const wsUrl = getNatsWsUrl();
|
|
53798
53910
|
useEffect90(() => {
|
|
53799
53911
|
if (!enabled || !wsUrl) {
|
|
@@ -53887,7 +53999,7 @@ function useJetStreamDialogSubscription({
|
|
|
53887
53999
|
}
|
|
53888
54000
|
};
|
|
53889
54001
|
}, [dialogId]);
|
|
53890
|
-
const requestResync =
|
|
54002
|
+
const requestResync = useCallback49(() => {
|
|
53891
54003
|
if (resyncTimerRef.current !== null) clearTimeout(resyncTimerRef.current);
|
|
53892
54004
|
resyncTimerRef.current = setTimeout(() => {
|
|
53893
54005
|
resyncTimerRef.current = null;
|
|
@@ -54018,7 +54130,7 @@ function useJetStreamDialogSubscription({
|
|
|
54018
54130
|
}
|
|
54019
54131
|
|
|
54020
54132
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
54021
|
-
import { useEffect as useEffect91, useRef as
|
|
54133
|
+
import { useEffect as useEffect91, useRef as useRef72, useState as useState120 } from "react";
|
|
54022
54134
|
function useNatsDialogSubscription({
|
|
54023
54135
|
enabled,
|
|
54024
54136
|
dialogId,
|
|
@@ -54035,42 +54147,42 @@ function useNatsDialogSubscription({
|
|
|
54035
54147
|
const [isConnected, setIsConnected] = useState120(false);
|
|
54036
54148
|
const [isSubscribed, setIsSubscribed] = useState120(false);
|
|
54037
54149
|
const [reconnectionCount, setReconnectionCount] = useState120(0);
|
|
54038
|
-
const clientRef =
|
|
54039
|
-
const subscriptionRefs =
|
|
54040
|
-
const onEventRef =
|
|
54150
|
+
const clientRef = useRef72(null);
|
|
54151
|
+
const subscriptionRefs = useRef72(/* @__PURE__ */ new Map());
|
|
54152
|
+
const onEventRef = useRef72(onEvent);
|
|
54041
54153
|
useEffect91(() => {
|
|
54042
54154
|
onEventRef.current = onEvent;
|
|
54043
54155
|
}, [onEvent]);
|
|
54044
|
-
const onConnectRef =
|
|
54156
|
+
const onConnectRef = useRef72(onConnect);
|
|
54045
54157
|
useEffect91(() => {
|
|
54046
54158
|
onConnectRef.current = onConnect;
|
|
54047
54159
|
}, [onConnect]);
|
|
54048
|
-
const onDisconnectRef =
|
|
54160
|
+
const onDisconnectRef = useRef72(onDisconnect);
|
|
54049
54161
|
useEffect91(() => {
|
|
54050
54162
|
onDisconnectRef.current = onDisconnect;
|
|
54051
54163
|
}, [onDisconnect]);
|
|
54052
|
-
const onSubscribedRef =
|
|
54164
|
+
const onSubscribedRef = useRef72(onSubscribed);
|
|
54053
54165
|
useEffect91(() => {
|
|
54054
54166
|
onSubscribedRef.current = onSubscribed;
|
|
54055
54167
|
}, [onSubscribed]);
|
|
54056
|
-
const onBeforeReconnectRef =
|
|
54168
|
+
const onBeforeReconnectRef = useRef72(onBeforeReconnect);
|
|
54057
54169
|
useEffect91(() => {
|
|
54058
54170
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
54059
54171
|
}, [onBeforeReconnect]);
|
|
54060
|
-
const hadConnectionBeforeRef =
|
|
54061
|
-
const getNatsWsUrlRef =
|
|
54172
|
+
const hadConnectionBeforeRef = useRef72(false);
|
|
54173
|
+
const getNatsWsUrlRef = useRef72(getNatsWsUrl);
|
|
54062
54174
|
useEffect91(() => {
|
|
54063
54175
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
54064
54176
|
}, [getNatsWsUrl]);
|
|
54065
|
-
const reconnectionBackoffRef =
|
|
54177
|
+
const reconnectionBackoffRef = useRef72(reconnectionBackoff);
|
|
54066
54178
|
useEffect91(() => {
|
|
54067
54179
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
54068
54180
|
}, [reconnectionBackoff]);
|
|
54069
|
-
const clientConfigRef =
|
|
54181
|
+
const clientConfigRef = useRef72(clientConfig);
|
|
54070
54182
|
useEffect91(() => {
|
|
54071
54183
|
clientConfigRef.current = clientConfig;
|
|
54072
54184
|
}, [clientConfig]);
|
|
54073
|
-
const currentWsUrlRef =
|
|
54185
|
+
const currentWsUrlRef = useRef72("");
|
|
54074
54186
|
const wsUrl = getNatsWsUrl();
|
|
54075
54187
|
useEffect91(() => {
|
|
54076
54188
|
if (!enabled || !wsUrl) {
|
|
@@ -54154,15 +54266,15 @@ function useNatsDialogSubscription({
|
|
|
54154
54266
|
};
|
|
54155
54267
|
}, [enabled, wsUrl]);
|
|
54156
54268
|
const topicsKey = topics.join(",");
|
|
54157
|
-
const topicsRef =
|
|
54269
|
+
const topicsRef = useRef72(topics);
|
|
54158
54270
|
topicsRef.current = topics;
|
|
54159
|
-
const lastSubscribedDialogIdRef =
|
|
54160
|
-
const isConnectedRef =
|
|
54271
|
+
const lastSubscribedDialogIdRef = useRef72(null);
|
|
54272
|
+
const isConnectedRef = useRef72(isConnected);
|
|
54161
54273
|
useEffect91(() => {
|
|
54162
54274
|
isConnectedRef.current = isConnected;
|
|
54163
54275
|
}, [isConnected]);
|
|
54164
|
-
const currentDialogIdRef =
|
|
54165
|
-
const abortControllerRef =
|
|
54276
|
+
const currentDialogIdRef = useRef72(null);
|
|
54277
|
+
const abortControllerRef = useRef72(null);
|
|
54166
54278
|
useEffect91(() => {
|
|
54167
54279
|
currentDialogIdRef.current = dialogId;
|
|
54168
54280
|
if (!enabled || !dialogId) {
|
|
@@ -54419,7 +54531,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
54419
54531
|
}
|
|
54420
54532
|
|
|
54421
54533
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
54422
|
-
import { useCallback as
|
|
54534
|
+
import { useCallback as useCallback50, useMemo as useMemo51, useRef as useRef73, useState as useState122 } from "react";
|
|
54423
54535
|
import { fileTypeFromBlob } from "file-type";
|
|
54424
54536
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
54425
54537
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -54496,11 +54608,11 @@ function useChatAttachments() {
|
|
|
54496
54608
|
const runtime = useRequiredChatRuntime();
|
|
54497
54609
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
54498
54610
|
const [attachments, setAttachments] = useState122([]);
|
|
54499
|
-
const controllersRef =
|
|
54500
|
-
const updateOne =
|
|
54611
|
+
const controllersRef = useRef73(/* @__PURE__ */ new Map());
|
|
54612
|
+
const updateOne = useCallback50((id, patch) => {
|
|
54501
54613
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
54502
54614
|
}, []);
|
|
54503
|
-
const removeAttachment =
|
|
54615
|
+
const removeAttachment = useCallback50((id) => {
|
|
54504
54616
|
const ctrl = controllersRef.current.get(id);
|
|
54505
54617
|
if (ctrl) {
|
|
54506
54618
|
ctrl.abort();
|
|
@@ -54508,12 +54620,12 @@ function useChatAttachments() {
|
|
|
54508
54620
|
}
|
|
54509
54621
|
setAttachments((prev) => prev.filter((a) => a.id !== id));
|
|
54510
54622
|
}, []);
|
|
54511
|
-
const clear =
|
|
54623
|
+
const clear = useCallback50(() => {
|
|
54512
54624
|
for (const ctrl of controllersRef.current.values()) ctrl.abort();
|
|
54513
54625
|
controllersRef.current.clear();
|
|
54514
54626
|
setAttachments([]);
|
|
54515
54627
|
}, []);
|
|
54516
|
-
const uploadOne =
|
|
54628
|
+
const uploadOne = useCallback50(
|
|
54517
54629
|
async (att) => {
|
|
54518
54630
|
const ctrl = controllersRef.current.get(att.id);
|
|
54519
54631
|
try {
|
|
@@ -54585,9 +54697,9 @@ function useChatAttachments() {
|
|
|
54585
54697
|
},
|
|
54586
54698
|
[uploadUrlEndpoint, updateOne]
|
|
54587
54699
|
);
|
|
54588
|
-
const attachmentsRef =
|
|
54700
|
+
const attachmentsRef = useRef73([]);
|
|
54589
54701
|
attachmentsRef.current = attachments;
|
|
54590
|
-
const addFiles =
|
|
54702
|
+
const addFiles = useCallback50(
|
|
54591
54703
|
(files) => {
|
|
54592
54704
|
const arr = Array.from(files);
|
|
54593
54705
|
if (arr.length === 0) return;
|
|
@@ -54636,7 +54748,7 @@ function useChatAttachments() {
|
|
|
54636
54748
|
},
|
|
54637
54749
|
[uploadOne]
|
|
54638
54750
|
);
|
|
54639
|
-
const readyAttachments =
|
|
54751
|
+
const readyAttachments = useMemo51(
|
|
54640
54752
|
() => attachments.filter(
|
|
54641
54753
|
(a) => a.status === "ready" && !!a.storagePath && !!a.viewToken
|
|
54642
54754
|
).map((a) => ({
|
|
@@ -54662,15 +54774,15 @@ function useChatAttachments() {
|
|
|
54662
54774
|
}
|
|
54663
54775
|
|
|
54664
54776
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
54665
|
-
import { useCallback as
|
|
54777
|
+
import { useCallback as useCallback51, useEffect as useEffect93, useRef as useRef74, useState as useState123 } from "react";
|
|
54666
54778
|
import { jsx as jsx395 } from "react/jsx-runtime";
|
|
54667
54779
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
54668
54780
|
function useChatAttachmentImageGallery() {
|
|
54669
54781
|
const runtime = useRequiredChatRuntime();
|
|
54670
54782
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
54671
|
-
const panelRef =
|
|
54783
|
+
const panelRef = useRef74(null);
|
|
54672
54784
|
const [state, setState] = useState123(CLOSED);
|
|
54673
|
-
const handleClose =
|
|
54785
|
+
const handleClose = useCallback51(() => setState(CLOSED), []);
|
|
54674
54786
|
useEffect93(() => {
|
|
54675
54787
|
const root = panelRef.current;
|
|
54676
54788
|
if (!root) return;
|
|
@@ -54717,10 +54829,10 @@ function absolutize(prefix) {
|
|
|
54717
54829
|
}
|
|
54718
54830
|
|
|
54719
54831
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
54720
|
-
import { useEffect as useEffect94, useRef as
|
|
54832
|
+
import { useEffect as useEffect94, useRef as useRef75 } from "react";
|
|
54721
54833
|
function useCloseOnNavigation(close, pathname) {
|
|
54722
|
-
const prevPathnameRef =
|
|
54723
|
-
const initializedRef =
|
|
54834
|
+
const prevPathnameRef = useRef75(null);
|
|
54835
|
+
const initializedRef = useRef75(false);
|
|
54724
54836
|
useEffect94(() => {
|
|
54725
54837
|
if (!initializedRef.current) {
|
|
54726
54838
|
initializedRef.current = true;
|
|
@@ -54735,20 +54847,20 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
54735
54847
|
}
|
|
54736
54848
|
|
|
54737
54849
|
// src/components/chat/hooks/use-chat.ts
|
|
54738
|
-
import { useState as useState125, useCallback as
|
|
54850
|
+
import { useState as useState125, useCallback as useCallback53, useEffect as useEffect95, useRef as useRef77 } from "react";
|
|
54739
54851
|
|
|
54740
54852
|
// src/components/chat/hooks/use-sse.ts
|
|
54741
|
-
import { useState as useState124, useCallback as
|
|
54853
|
+
import { useState as useState124, useCallback as useCallback52, useRef as useRef76 } from "react";
|
|
54742
54854
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
54743
54855
|
const [isStreaming, setIsStreaming] = useState124(false);
|
|
54744
54856
|
const [error, setError] = useState124(null);
|
|
54745
|
-
const abortControllerRef =
|
|
54746
|
-
const fallbackStream =
|
|
54857
|
+
const abortControllerRef = useRef76(null);
|
|
54858
|
+
const fallbackStream = useCallback52(async function* () {
|
|
54747
54859
|
throw new Error(
|
|
54748
54860
|
"[useSSE] No streamFn provided and `useMock: true` is no longer wired into the lib. Supply a `streamFn` (see `createDocStreamFn` in use-embedded-chat) or migrate the mock to your host code."
|
|
54749
54861
|
);
|
|
54750
54862
|
}, []);
|
|
54751
|
-
const streamMessage =
|
|
54863
|
+
const streamMessage = useCallback52(
|
|
54752
54864
|
async function* (message2, extra) {
|
|
54753
54865
|
setIsStreaming(true);
|
|
54754
54866
|
setError(null);
|
|
@@ -54778,13 +54890,13 @@ function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
|
54778
54890
|
},
|
|
54779
54891
|
[streamFn, fallbackStream]
|
|
54780
54892
|
);
|
|
54781
|
-
const abort =
|
|
54893
|
+
const abort = useCallback52(() => {
|
|
54782
54894
|
if (abortControllerRef.current) {
|
|
54783
54895
|
abortControllerRef.current.abort();
|
|
54784
54896
|
}
|
|
54785
54897
|
setIsStreaming(false);
|
|
54786
54898
|
}, []);
|
|
54787
|
-
const reset =
|
|
54899
|
+
const reset = useCallback52(() => {
|
|
54788
54900
|
}, []);
|
|
54789
54901
|
return {
|
|
54790
54902
|
streamMessage,
|
|
@@ -54810,8 +54922,8 @@ function useChat({
|
|
|
54810
54922
|
} = {}) {
|
|
54811
54923
|
const [messages, setMessages] = useState125(() => initialMessages ?? []);
|
|
54812
54924
|
const [isTyping, setIsTyping] = useState125(false);
|
|
54813
|
-
const currentAssistantSegmentsRef =
|
|
54814
|
-
const onMessagesChangeRef =
|
|
54925
|
+
const currentAssistantSegmentsRef = useRef77([]);
|
|
54926
|
+
const onMessagesChangeRef = useRef77(onMessagesChange);
|
|
54815
54927
|
onMessagesChangeRef.current = onMessagesChange;
|
|
54816
54928
|
useEffect95(() => {
|
|
54817
54929
|
onMessagesChangeRef.current?.(messages);
|
|
@@ -54827,10 +54939,10 @@ function useChat({
|
|
|
54827
54939
|
debugMode,
|
|
54828
54940
|
streamFn
|
|
54829
54941
|
});
|
|
54830
|
-
const addMessage =
|
|
54942
|
+
const addMessage = useCallback53((message2) => {
|
|
54831
54943
|
setMessages((prev) => [...prev, message2]);
|
|
54832
54944
|
}, []);
|
|
54833
|
-
const updateLastAssistantMessage =
|
|
54945
|
+
const updateLastAssistantMessage = useCallback53((segments) => {
|
|
54834
54946
|
setMessages((prev) => {
|
|
54835
54947
|
const newMessages = [...prev];
|
|
54836
54948
|
const lastMessage = newMessages[newMessages.length - 1];
|
|
@@ -54843,7 +54955,7 @@ function useChat({
|
|
|
54843
54955
|
return newMessages;
|
|
54844
54956
|
});
|
|
54845
54957
|
}, []);
|
|
54846
|
-
const sendMessage =
|
|
54958
|
+
const sendMessage = useCallback53(
|
|
54847
54959
|
async (text, extra, options) => {
|
|
54848
54960
|
const userMessage = {
|
|
54849
54961
|
id: `user-${Date.now()}`,
|
|
@@ -55050,21 +55162,21 @@ function useChat({
|
|
|
55050
55162
|
},
|
|
55051
55163
|
[streamMessage, addMessage, updateLastAssistantMessage, assistantName, assistantAvatar]
|
|
55052
55164
|
);
|
|
55053
|
-
const handleQuickAction =
|
|
55165
|
+
const handleQuickAction = useCallback53(
|
|
55054
55166
|
(actionText) => {
|
|
55055
55167
|
sendMessage(actionText);
|
|
55056
55168
|
},
|
|
55057
55169
|
[sendMessage]
|
|
55058
55170
|
);
|
|
55059
|
-
const clearMessages =
|
|
55171
|
+
const clearMessages = useCallback53(() => {
|
|
55060
55172
|
setMessages([]);
|
|
55061
55173
|
setIsTyping(false);
|
|
55062
55174
|
reset();
|
|
55063
55175
|
}, [reset]);
|
|
55064
|
-
const hydrateMessages =
|
|
55176
|
+
const hydrateMessages = useCallback53((history) => {
|
|
55065
55177
|
setMessages((prev) => prev.length === 0 ? history : [...history, ...prev]);
|
|
55066
55178
|
}, []);
|
|
55067
|
-
const stopMessage =
|
|
55179
|
+
const stopMessage = useCallback53(() => {
|
|
55068
55180
|
abort();
|
|
55069
55181
|
setIsTyping(false);
|
|
55070
55182
|
}, [abort]);
|
|
@@ -55083,7 +55195,7 @@ function useChat({
|
|
|
55083
55195
|
}
|
|
55084
55196
|
|
|
55085
55197
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
55086
|
-
import { useCallback as
|
|
55198
|
+
import { useCallback as useCallback55, useMemo as useMemo53, useRef as useRef80 } from "react";
|
|
55087
55199
|
|
|
55088
55200
|
// src/chat-protocol/confirm-tool.ts
|
|
55089
55201
|
function buildConfirmToolBody(request) {
|
|
@@ -55350,7 +55462,7 @@ function pruneStaleChatConversationStorage(source) {
|
|
|
55350
55462
|
}
|
|
55351
55463
|
|
|
55352
55464
|
// src/components/chat/hooks/use-chat-history-hydration.ts
|
|
55353
|
-
import { useEffect as useEffect96, useRef as
|
|
55465
|
+
import { useEffect as useEffect96, useRef as useRef78, useState as useState126 } from "react";
|
|
55354
55466
|
function useChatHistoryHydration({
|
|
55355
55467
|
active,
|
|
55356
55468
|
source,
|
|
@@ -55361,7 +55473,7 @@ function useChatHistoryHydration({
|
|
|
55361
55473
|
bumpMetaTick
|
|
55362
55474
|
}) {
|
|
55363
55475
|
const [isHydratingHistory, setIsHydratingHistory] = useState126(false);
|
|
55364
|
-
const hydratedKeyRef =
|
|
55476
|
+
const hydratedKeyRef = useRef78(null);
|
|
55365
55477
|
useEffect96(() => {
|
|
55366
55478
|
if (!active) return;
|
|
55367
55479
|
const conversationId = conversationIdRef.current;
|
|
@@ -57548,7 +57660,7 @@ function createChatDialogStore(options = {}) {
|
|
|
57548
57660
|
}
|
|
57549
57661
|
|
|
57550
57662
|
// src/components/chat/stream/use-chat-stream-reducer.ts
|
|
57551
|
-
import { useCallback as
|
|
57663
|
+
import { useCallback as useCallback54, useEffect as useEffect97, useMemo as useMemo52, useRef as useRef79, useSyncExternalStore } from "react";
|
|
57552
57664
|
|
|
57553
57665
|
// src/components/chat/stream/delta-batcher.ts
|
|
57554
57666
|
var DELTA_FLUSH_FALLBACK_MS = 50;
|
|
@@ -57637,21 +57749,21 @@ function useChatStreamReducer({
|
|
|
57637
57749
|
side = DEFAULT_DIALOG_SIDE,
|
|
57638
57750
|
createReducerOptions
|
|
57639
57751
|
}) {
|
|
57640
|
-
const optionsRef =
|
|
57752
|
+
const optionsRef = useRef79(createReducerOptions);
|
|
57641
57753
|
optionsRef.current = createReducerOptions;
|
|
57642
57754
|
const reducer2 = store.getReducer(dialogId, side, () => optionsRef.current?.() ?? {});
|
|
57643
|
-
const getSnapshot =
|
|
57644
|
-
const getServerSnapshot =
|
|
57645
|
-
const subscribe =
|
|
57755
|
+
const getSnapshot = useCallback54(() => store.getSnapshot(dialogId, side), [store, dialogId, side]);
|
|
57756
|
+
const getServerSnapshot = useCallback54(() => store.getServerSnapshot(), [store]);
|
|
57757
|
+
const subscribe = useCallback54((listener) => store.subscribe(listener), [store]);
|
|
57646
57758
|
const state = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
57647
57759
|
useEffect97(() => store.retain(dialogId, side), [store, dialogId, side]);
|
|
57648
|
-
const keyRef =
|
|
57760
|
+
const keyRef = useRef79({ dialogId, side });
|
|
57649
57761
|
if (keyRef.current.dialogId !== dialogId || keyRef.current.side !== side) {
|
|
57650
57762
|
keyRef.current = { dialogId, side };
|
|
57651
57763
|
}
|
|
57652
|
-
const storeRef =
|
|
57764
|
+
const storeRef = useRef79(store);
|
|
57653
57765
|
storeRef.current = store;
|
|
57654
|
-
const batcherRef =
|
|
57766
|
+
const batcherRef = useRef79(null);
|
|
57655
57767
|
if (batcherRef.current === null) {
|
|
57656
57768
|
batcherRef.current = createDeltaBatcher({
|
|
57657
57769
|
applyOne: (event, key) => {
|
|
@@ -57660,8 +57772,8 @@ function useChatStreamReducer({
|
|
|
57660
57772
|
});
|
|
57661
57773
|
}
|
|
57662
57774
|
const batcher = batcherRef.current;
|
|
57663
|
-
const flushDeltas =
|
|
57664
|
-
const applyEvent =
|
|
57775
|
+
const flushDeltas = useCallback54(() => batcher.flush(), [batcher]);
|
|
57776
|
+
const applyEvent = useCallback54(
|
|
57665
57777
|
(event) => {
|
|
57666
57778
|
if (batcher.push(event, keyRef.current)) return;
|
|
57667
57779
|
batcher.flush();
|
|
@@ -57670,11 +57782,11 @@ function useChatStreamReducer({
|
|
|
57670
57782
|
[batcher, store, dialogId, side]
|
|
57671
57783
|
);
|
|
57672
57784
|
useEffect97(() => () => batcher.dispose(), [batcher]);
|
|
57673
|
-
const mutate =
|
|
57785
|
+
const mutate = useCallback54(
|
|
57674
57786
|
(fn) => store.mutate(dialogId, side, fn),
|
|
57675
57787
|
[store, dialogId, side]
|
|
57676
57788
|
);
|
|
57677
|
-
return
|
|
57789
|
+
return useMemo52(
|
|
57678
57790
|
() => ({ state, applyEvent, flushDeltas, mutate, reducer: reducer2 }),
|
|
57679
57791
|
[state, applyEvent, flushDeltas, mutate, reducer2]
|
|
57680
57792
|
);
|
|
@@ -57700,8 +57812,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57700
57812
|
const runtime = useRequiredChatRuntime();
|
|
57701
57813
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
57702
57814
|
const tableIdForDocumentType = options?.tableIdForDocumentType ?? defaultTableIdForDocumentType;
|
|
57703
|
-
const sendMessageRef =
|
|
57704
|
-
const cardResolve =
|
|
57815
|
+
const sendMessageRef = useRef80(async () => true);
|
|
57816
|
+
const cardResolve = useCallback55(
|
|
57705
57817
|
(action) => (reqId) => {
|
|
57706
57818
|
if (!reqId) return;
|
|
57707
57819
|
return sendMessageRef.current("", {
|
|
@@ -57711,26 +57823,26 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57711
57823
|
},
|
|
57712
57824
|
[]
|
|
57713
57825
|
);
|
|
57714
|
-
const cardApprove =
|
|
57715
|
-
const cardReject =
|
|
57716
|
-
const createReducerOptions =
|
|
57826
|
+
const cardApprove = useMemo53(() => cardResolve("approve"), [cardResolve]);
|
|
57827
|
+
const cardReject = useMemo53(() => cardResolve("reject"), [cardResolve]);
|
|
57828
|
+
const createReducerOptions = useCallback55(
|
|
57717
57829
|
() => ({
|
|
57718
57830
|
transport: "sse",
|
|
57719
57831
|
callbacks: { onApprove: cardApprove, onReject: cardReject }
|
|
57720
57832
|
}),
|
|
57721
57833
|
[cardApprove, cardReject]
|
|
57722
57834
|
);
|
|
57723
|
-
const storeRef =
|
|
57835
|
+
const storeRef = useRef80(null);
|
|
57724
57836
|
if (storeRef.current === null) storeRef.current = createChatDialogStore();
|
|
57725
57837
|
const { state, applyEvent, flushDeltas, mutate, reducer: reducer2 } = useChatStreamReducer({
|
|
57726
57838
|
store: storeRef.current,
|
|
57727
57839
|
dialogId: source,
|
|
57728
57840
|
createReducerOptions
|
|
57729
57841
|
});
|
|
57730
|
-
const abortControllerRef =
|
|
57731
|
-
const conversationStorage =
|
|
57732
|
-
const conversationIdRef =
|
|
57733
|
-
const restoredConversationRef =
|
|
57842
|
+
const abortControllerRef = useRef80(null);
|
|
57843
|
+
const conversationStorage = useMemo53(() => createChatConversationStorage(source), [source]);
|
|
57844
|
+
const conversationIdRef = useRef80(null);
|
|
57845
|
+
const restoredConversationRef = useRef80(false);
|
|
57734
57846
|
if (!restoredConversationRef.current) {
|
|
57735
57847
|
restoredConversationRef.current = true;
|
|
57736
57848
|
pruneStaleChatConversationStorage(source);
|
|
@@ -57740,7 +57852,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57740
57852
|
const { commands: slashCommands } = useSlashCommandRegistry(commandsUrl, {
|
|
57741
57853
|
enabled: active
|
|
57742
57854
|
});
|
|
57743
|
-
const cmdIdByTableId =
|
|
57855
|
+
const cmdIdByTableId = useMemo53(() => {
|
|
57744
57856
|
const buckets = /* @__PURE__ */ new Map();
|
|
57745
57857
|
for (const cmd of slashCommands) {
|
|
57746
57858
|
if (!cmd.primarySourceId) continue;
|
|
@@ -57761,8 +57873,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57761
57873
|
return map;
|
|
57762
57874
|
}, [slashCommands]);
|
|
57763
57875
|
const historyUrl = runtime.endpoints.chatHistoryUrl ?? `${runtime.endpoints.chatStreamUrl.replace(/\/+$/, "")}/history`;
|
|
57764
|
-
const hydrationSendCountRef =
|
|
57765
|
-
const hydrateMessages =
|
|
57876
|
+
const hydrationSendCountRef = useRef80(0);
|
|
57877
|
+
const hydrateMessages = useCallback55(
|
|
57766
57878
|
(history, sourcesSeed) => {
|
|
57767
57879
|
mutate((r) => {
|
|
57768
57880
|
const mapped = history.map(historyMessageToReducerMessage);
|
|
@@ -57794,9 +57906,9 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57794
57906
|
// `hydrateMessages` above) already invalidates the snapshot.
|
|
57795
57907
|
bumpMetaTick: noopBumpMetaTick
|
|
57796
57908
|
});
|
|
57797
|
-
const endpointsRef =
|
|
57909
|
+
const endpointsRef = useRef80(runtime.endpoints);
|
|
57798
57910
|
endpointsRef.current = runtime.endpoints;
|
|
57799
|
-
const captureConversationId =
|
|
57911
|
+
const captureConversationId = useCallback55(
|
|
57800
57912
|
(event) => {
|
|
57801
57913
|
if (event.type !== "metadata") return;
|
|
57802
57914
|
const id = event.conversationId;
|
|
@@ -57807,7 +57919,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57807
57919
|
},
|
|
57808
57920
|
[conversationStorage]
|
|
57809
57921
|
);
|
|
57810
|
-
const sendMessage =
|
|
57922
|
+
const sendMessage = useCallback55(
|
|
57811
57923
|
// Resolves `true` on a clean turn, `false` when the request failed
|
|
57812
57924
|
// (surfaced to batch approve-all loops via the card callbacks).
|
|
57813
57925
|
async (text, sendOptions) => {
|
|
@@ -57885,19 +57997,19 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57885
57997
|
[mutate, applyEvent, flushDeltas, captureConversationId]
|
|
57886
57998
|
);
|
|
57887
57999
|
sendMessageRef.current = sendMessage;
|
|
57888
|
-
const stopMessage =
|
|
58000
|
+
const stopMessage = useCallback55(() => {
|
|
57889
58001
|
abortControllerRef.current?.abort();
|
|
57890
58002
|
flushDeltas();
|
|
57891
58003
|
mutate((r) => r.setPhase("idle"));
|
|
57892
58004
|
}, [mutate, flushDeltas]);
|
|
57893
|
-
const clearMessages =
|
|
58005
|
+
const clearMessages = useCallback55(() => {
|
|
57894
58006
|
mutate((r) => r.reset());
|
|
57895
58007
|
conversationIdRef.current = null;
|
|
57896
58008
|
conversationStorage.clear();
|
|
57897
58009
|
hydrationSendCountRef.current = 0;
|
|
57898
58010
|
hydratedKeyRef.current = null;
|
|
57899
58011
|
}, [mutate, conversationStorage, hydratedKeyRef]);
|
|
57900
|
-
const docMessages =
|
|
58012
|
+
const docMessages = useMemo53(() => {
|
|
57901
58013
|
const { meta, sources: sourcesMap } = state.turnMeta;
|
|
57902
58014
|
let sendIdx = -1;
|
|
57903
58015
|
return state.messages.map((m) => {
|
|
@@ -57924,7 +58036,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57924
58036
|
};
|
|
57925
58037
|
});
|
|
57926
58038
|
}, [state.messages, state.turnMeta]);
|
|
57927
|
-
const displayRef =
|
|
58039
|
+
const displayRef = useCallback55(
|
|
57928
58040
|
(reference) => {
|
|
57929
58041
|
const tableId = tableIdForDocumentType(reference.type);
|
|
57930
58042
|
if (!tableId) {
|
|
@@ -57948,7 +58060,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57948
58060
|
},
|
|
57949
58061
|
[sendMessage, source, cmdIdByTableId, tableIdForDocumentType]
|
|
57950
58062
|
);
|
|
57951
|
-
const discussRef =
|
|
58063
|
+
const discussRef = useCallback55(
|
|
57952
58064
|
(reference) => {
|
|
57953
58065
|
const tableId = tableIdForDocumentType(reference.type);
|
|
57954
58066
|
if (!tableId) {
|
|
@@ -57971,7 +58083,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57971
58083
|
},
|
|
57972
58084
|
[sendMessage, tableIdForDocumentType]
|
|
57973
58085
|
);
|
|
57974
|
-
const latestMeta =
|
|
58086
|
+
const latestMeta = useMemo53(() => {
|
|
57975
58087
|
const { meta, sendCount } = state.turnMeta;
|
|
57976
58088
|
return meta.get(sendCount - 1) ?? meta.get(sendCount - 2) ?? null;
|
|
57977
58089
|
}, [state]);
|
|
@@ -58050,7 +58162,7 @@ var noopBumpMetaTick = () => {
|
|
|
58050
58162
|
};
|
|
58051
58163
|
|
|
58052
58164
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
58053
|
-
import { useCallback as
|
|
58165
|
+
import { useCallback as useCallback56, useEffect as useEffect98, useMemo as useMemo54, useRef as useRef81, useState as useState127 } from "react";
|
|
58054
58166
|
|
|
58055
58167
|
// src/chat-protocol/nats-decoder.ts
|
|
58056
58168
|
function normalizeToolCalls(raw) {
|
|
@@ -59077,24 +59189,24 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59077
59189
|
const isManagedMode = fetchDialogs !== void 0;
|
|
59078
59190
|
const [internalDialogId, setInternalDialogId] = useState127(null);
|
|
59079
59191
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
59080
|
-
const currentDialogIdRef =
|
|
59192
|
+
const currentDialogIdRef = useRef81(dialogId);
|
|
59081
59193
|
currentDialogIdRef.current = dialogId;
|
|
59082
|
-
const handleApproveRef =
|
|
59194
|
+
const handleApproveRef = useRef81(async () => {
|
|
59083
59195
|
});
|
|
59084
|
-
const handleRejectRef =
|
|
59196
|
+
const handleRejectRef = useRef81(
|
|
59085
59197
|
async () => {
|
|
59086
59198
|
}
|
|
59087
59199
|
);
|
|
59088
|
-
const accumApprove =
|
|
59200
|
+
const accumApprove = useCallback56((requestId) => {
|
|
59089
59201
|
if (!requestId) return;
|
|
59090
59202
|
return handleApproveRef.current(requestId);
|
|
59091
59203
|
}, []);
|
|
59092
|
-
const accumReject =
|
|
59204
|
+
const accumReject = useCallback56((requestId) => {
|
|
59093
59205
|
if (!requestId) return;
|
|
59094
59206
|
return handleRejectRef.current(requestId);
|
|
59095
59207
|
}, []);
|
|
59096
|
-
const storeRef =
|
|
59097
|
-
const globalApprovalStatusesRef =
|
|
59208
|
+
const storeRef = useRef81(createChatDialogStore());
|
|
59209
|
+
const globalApprovalStatusesRef = useRef81({});
|
|
59098
59210
|
const dialogKey = dialogId ?? DRAFT_DIALOG_KEY;
|
|
59099
59211
|
const { state, applyEvent, mutate } = useChatStreamReducer({
|
|
59100
59212
|
store: storeRef.current,
|
|
@@ -59143,7 +59255,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59143
59255
|
console.error("[useNatsChatAdapter] rejectRequest failed:", err);
|
|
59144
59256
|
}
|
|
59145
59257
|
};
|
|
59146
|
-
const processChunk =
|
|
59258
|
+
const processChunk = useCallback56(
|
|
59147
59259
|
(chunk) => {
|
|
59148
59260
|
const event = decodeNatsChunk(chunk);
|
|
59149
59261
|
if (event) applyEvent(event);
|
|
@@ -59158,7 +59270,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59158
59270
|
const [messagesNextCursor, setMessagesNextCursor] = useState127(null);
|
|
59159
59271
|
const [isMessagesLoading, setIsMessagesLoading] = useState127(false);
|
|
59160
59272
|
const [connectionState, setConnectionState] = useState127("connecting");
|
|
59161
|
-
const hasConnectedOnceRef =
|
|
59273
|
+
const hasConnectedOnceRef = useRef81(false);
|
|
59162
59274
|
const {
|
|
59163
59275
|
processChunk: catchupProcessChunk,
|
|
59164
59276
|
catchUpChunks,
|
|
@@ -59171,8 +59283,8 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59171
59283
|
onChunkReceived: (chunk) => processChunk(chunk),
|
|
59172
59284
|
fetchChunks
|
|
59173
59285
|
});
|
|
59174
|
-
const historyLoadSeqRef =
|
|
59175
|
-
const loadDialogHistory =
|
|
59286
|
+
const historyLoadSeqRef = useRef81(0);
|
|
59287
|
+
const loadDialogHistory = useCallback56(
|
|
59176
59288
|
async (id, cursor) => {
|
|
59177
59289
|
if (!fetchDialogMessages) return;
|
|
59178
59290
|
historyLoadSeqRef.current += 1;
|
|
@@ -59234,7 +59346,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59234
59346
|
isBufferingActive
|
|
59235
59347
|
]
|
|
59236
59348
|
);
|
|
59237
|
-
const prevDialogIdRef =
|
|
59349
|
+
const prevDialogIdRef = useRef81(void 0);
|
|
59238
59350
|
useEffect98(() => {
|
|
59239
59351
|
if (prevDialogIdRef.current === dialogId) return;
|
|
59240
59352
|
prevDialogIdRef.current = dialogId;
|
|
@@ -59318,8 +59430,8 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59318
59430
|
}
|
|
59319
59431
|
setConnectionState("connecting");
|
|
59320
59432
|
}, [active, dialogId]);
|
|
59321
|
-
const initialDialogsLoadedRef =
|
|
59322
|
-
const loadDialogsPage =
|
|
59433
|
+
const initialDialogsLoadedRef = useRef81(false);
|
|
59434
|
+
const loadDialogsPage = useCallback56(
|
|
59323
59435
|
async (cursor) => {
|
|
59324
59436
|
if (!fetchDialogs) return;
|
|
59325
59437
|
setIsDialogsLoading(true);
|
|
@@ -59347,7 +59459,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59347
59459
|
},
|
|
59348
59460
|
[fetchDialogs, dialogsPageSize]
|
|
59349
59461
|
);
|
|
59350
|
-
const reloadDialogs =
|
|
59462
|
+
const reloadDialogs = useCallback56(() => {
|
|
59351
59463
|
void loadDialogsPage();
|
|
59352
59464
|
}, [loadDialogsPage]);
|
|
59353
59465
|
useEffect98(() => {
|
|
@@ -59357,7 +59469,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59357
59469
|
initialDialogsLoadedRef.current = true;
|
|
59358
59470
|
void loadDialogsPage();
|
|
59359
59471
|
}, [active, fetchDialogs, loadDialogsPage]);
|
|
59360
|
-
const sendMessage =
|
|
59472
|
+
const sendMessage = useCallback56(
|
|
59361
59473
|
async (text, sendOptions) => {
|
|
59362
59474
|
const hidden = sendOptions?.hidden ?? false;
|
|
59363
59475
|
mutate((r) => r.pushOptimisticSend(text, hidden));
|
|
@@ -59365,7 +59477,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59365
59477
|
},
|
|
59366
59478
|
[mutate, publishUserMessage, dialogId]
|
|
59367
59479
|
);
|
|
59368
|
-
const stopMessage =
|
|
59480
|
+
const stopMessage = useCallback56(() => {
|
|
59369
59481
|
mutate((r) => r.setPhase("idle"));
|
|
59370
59482
|
if (stopGenerationCallback && dialogId) {
|
|
59371
59483
|
void stopGenerationCallback(dialogId).catch((err) => {
|
|
@@ -59373,10 +59485,10 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59373
59485
|
});
|
|
59374
59486
|
}
|
|
59375
59487
|
}, [mutate, stopGenerationCallback, dialogId]);
|
|
59376
|
-
const clearMessages =
|
|
59488
|
+
const clearMessages = useCallback56(() => {
|
|
59377
59489
|
mutate((r) => r.clearThread());
|
|
59378
59490
|
}, [mutate]);
|
|
59379
|
-
const selectDialog =
|
|
59491
|
+
const selectDialog = useCallback56(
|
|
59380
59492
|
(id) => {
|
|
59381
59493
|
if (!isManagedMode) {
|
|
59382
59494
|
return;
|
|
@@ -59385,7 +59497,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59385
59497
|
},
|
|
59386
59498
|
[isManagedMode]
|
|
59387
59499
|
);
|
|
59388
|
-
const startNewDialog =
|
|
59500
|
+
const startNewDialog = useCallback56(async () => {
|
|
59389
59501
|
if (!createDialogCallback) return null;
|
|
59390
59502
|
if (isCreatingDialog) return null;
|
|
59391
59503
|
try {
|
|
@@ -59410,7 +59522,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59410
59522
|
setIsCreatingDialog(false);
|
|
59411
59523
|
}
|
|
59412
59524
|
}, [createDialogCallback, isCreatingDialog, isManagedMode]);
|
|
59413
|
-
const deleteDialog =
|
|
59525
|
+
const deleteDialog = useCallback56(
|
|
59414
59526
|
async (id) => {
|
|
59415
59527
|
if (!deleteDialogCallback) return;
|
|
59416
59528
|
try {
|
|
@@ -59426,7 +59538,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59426
59538
|
},
|
|
59427
59539
|
[deleteDialogCallback, internalDialogId, isManagedMode]
|
|
59428
59540
|
);
|
|
59429
|
-
const renameDialog =
|
|
59541
|
+
const renameDialog = useCallback56(
|
|
59430
59542
|
async (id, title) => {
|
|
59431
59543
|
if (!renameDialogCallback) return;
|
|
59432
59544
|
let previous;
|
|
@@ -59450,7 +59562,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59450
59562
|
},
|
|
59451
59563
|
[renameDialogCallback]
|
|
59452
59564
|
);
|
|
59453
|
-
const archiveDialog =
|
|
59565
|
+
const archiveDialog = useCallback56(
|
|
59454
59566
|
async (id) => {
|
|
59455
59567
|
if (!archiveDialogCallback) return;
|
|
59456
59568
|
try {
|
|
@@ -59465,27 +59577,27 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59465
59577
|
},
|
|
59466
59578
|
[archiveDialogCallback, internalDialogId, isManagedMode]
|
|
59467
59579
|
);
|
|
59468
|
-
const loadMoreDialogs =
|
|
59580
|
+
const loadMoreDialogs = useCallback56(async () => {
|
|
59469
59581
|
if (!dialogsNextCursor) return;
|
|
59470
59582
|
await loadDialogsPage(dialogsNextCursor);
|
|
59471
59583
|
}, [dialogsNextCursor, loadDialogsPage]);
|
|
59472
|
-
const loadMoreMessages =
|
|
59584
|
+
const loadMoreMessages = useCallback56(async () => {
|
|
59473
59585
|
if (!dialogId || !messagesNextCursor) return;
|
|
59474
59586
|
await loadDialogHistory(dialogId, messagesNextCursor);
|
|
59475
59587
|
}, [dialogId, messagesNextCursor, loadDialogHistory]);
|
|
59476
|
-
const approveRequest =
|
|
59588
|
+
const approveRequest = useCallback56(
|
|
59477
59589
|
async (requestId) => {
|
|
59478
59590
|
await handleApproveRef.current(requestId);
|
|
59479
59591
|
},
|
|
59480
59592
|
[]
|
|
59481
59593
|
);
|
|
59482
|
-
const rejectRequest =
|
|
59594
|
+
const rejectRequest = useCallback56(
|
|
59483
59595
|
async (requestId, reason) => {
|
|
59484
59596
|
await handleRejectRef.current(requestId, reason);
|
|
59485
59597
|
},
|
|
59486
59598
|
[]
|
|
59487
59599
|
);
|
|
59488
|
-
const discussRef =
|
|
59600
|
+
const discussRef = useCallback56(
|
|
59489
59601
|
(reference) => {
|
|
59490
59602
|
const prompt = buildDiscussPrompt(reference, { includeReference: true });
|
|
59491
59603
|
void sendMessage(prompt).catch((err) => {
|
|
@@ -59494,13 +59606,13 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59494
59606
|
},
|
|
59495
59607
|
[sendMessage]
|
|
59496
59608
|
);
|
|
59497
|
-
const displayRef =
|
|
59609
|
+
const displayRef = useCallback56((_ref) => {
|
|
59498
59610
|
}, []);
|
|
59499
59611
|
const { messages, streamingPhase, dialogTokenUsage = null, liveModel = null } = state;
|
|
59500
59612
|
const isLoading = streamingPhase !== "idle";
|
|
59501
59613
|
const hasMoreDialogs = dialogsNextCursor != null;
|
|
59502
59614
|
const hasMoreMessages = messagesNextCursor != null;
|
|
59503
|
-
return
|
|
59615
|
+
return useMemo54(
|
|
59504
59616
|
() => ({
|
|
59505
59617
|
messages,
|
|
59506
59618
|
isLoading,
|
|
@@ -59583,7 +59695,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59583
59695
|
}
|
|
59584
59696
|
|
|
59585
59697
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
59586
|
-
import { useCallback as
|
|
59698
|
+
import { useCallback as useCallback57, useMemo as useMemo55, useRef as useRef82 } from "react";
|
|
59587
59699
|
var EMPTY_SSE_OPTIONS = {};
|
|
59588
59700
|
function createDisabledNatsConfig() {
|
|
59589
59701
|
return {
|
|
@@ -59598,7 +59710,7 @@ function createDisabledNatsConfig() {
|
|
|
59598
59710
|
}
|
|
59599
59711
|
function useUnifiedChat(options) {
|
|
59600
59712
|
const { modes, activeMode, mingoStateOverride } = options;
|
|
59601
|
-
const disabledNatsRef =
|
|
59713
|
+
const disabledNatsRef = useRef82(null);
|
|
59602
59714
|
if (disabledNatsRef.current === null) {
|
|
59603
59715
|
disabledNatsRef.current = createDisabledNatsConfig();
|
|
59604
59716
|
}
|
|
@@ -59612,70 +59724,70 @@ function useUnifiedChat(options) {
|
|
|
59612
59724
|
{ active: natsActive }
|
|
59613
59725
|
);
|
|
59614
59726
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
59615
|
-
const activeStateRef =
|
|
59727
|
+
const activeStateRef = useRef82(activeState);
|
|
59616
59728
|
activeStateRef.current = activeState;
|
|
59617
|
-
const stopMessage =
|
|
59618
|
-
const clearMessages =
|
|
59729
|
+
const stopMessage = useCallback57(() => activeStateRef.current.stopMessage(), []);
|
|
59730
|
+
const clearMessages = useCallback57(
|
|
59619
59731
|
() => activeStateRef.current.clearMessages(),
|
|
59620
59732
|
[]
|
|
59621
59733
|
);
|
|
59622
|
-
const sendMessage =
|
|
59734
|
+
const sendMessage = useCallback57(
|
|
59623
59735
|
(text, opts) => activeStateRef.current.sendMessage(text, opts),
|
|
59624
59736
|
[]
|
|
59625
59737
|
);
|
|
59626
|
-
const discussRef =
|
|
59738
|
+
const discussRef = useCallback57(
|
|
59627
59739
|
(ref) => activeStateRef.current.discussRef(ref),
|
|
59628
59740
|
[]
|
|
59629
59741
|
);
|
|
59630
|
-
const displayRef =
|
|
59742
|
+
const displayRef = useCallback57(
|
|
59631
59743
|
(ref) => activeStateRef.current.displayRef(ref),
|
|
59632
59744
|
[]
|
|
59633
59745
|
);
|
|
59634
|
-
const selectDialog =
|
|
59746
|
+
const selectDialog = useCallback57(
|
|
59635
59747
|
(id) => activeStateRef.current.selectDialog(id),
|
|
59636
59748
|
[]
|
|
59637
59749
|
);
|
|
59638
|
-
const startNewDialog =
|
|
59750
|
+
const startNewDialog = useCallback57(
|
|
59639
59751
|
() => activeStateRef.current.startNewDialog(),
|
|
59640
59752
|
[]
|
|
59641
59753
|
);
|
|
59642
|
-
const deleteDialog =
|
|
59754
|
+
const deleteDialog = useCallback57(
|
|
59643
59755
|
(id) => activeStateRef.current.deleteDialog(id),
|
|
59644
59756
|
[]
|
|
59645
59757
|
);
|
|
59646
|
-
const renameDialog =
|
|
59758
|
+
const renameDialog = useCallback57(
|
|
59647
59759
|
(id, title) => activeStateRef.current.renameDialog(id, title),
|
|
59648
59760
|
[]
|
|
59649
59761
|
);
|
|
59650
|
-
const archiveDialog =
|
|
59762
|
+
const archiveDialog = useCallback57(
|
|
59651
59763
|
(id) => activeStateRef.current.archiveDialog(id),
|
|
59652
59764
|
[]
|
|
59653
59765
|
);
|
|
59654
|
-
const loadMoreDialogs =
|
|
59766
|
+
const loadMoreDialogs = useCallback57(
|
|
59655
59767
|
() => activeStateRef.current.loadMoreDialogs(),
|
|
59656
59768
|
[]
|
|
59657
59769
|
);
|
|
59658
|
-
const setDialogScope =
|
|
59770
|
+
const setDialogScope = useCallback57(
|
|
59659
59771
|
(scope) => activeStateRef.current.setDialogScope?.(scope),
|
|
59660
59772
|
[]
|
|
59661
59773
|
);
|
|
59662
|
-
const reloadDialogs =
|
|
59774
|
+
const reloadDialogs = useCallback57(
|
|
59663
59775
|
() => activeStateRef.current.reloadDialogs(),
|
|
59664
59776
|
[]
|
|
59665
59777
|
);
|
|
59666
|
-
const loadMoreMessages =
|
|
59778
|
+
const loadMoreMessages = useCallback57(
|
|
59667
59779
|
() => activeStateRef.current.loadMoreMessages(),
|
|
59668
59780
|
[]
|
|
59669
59781
|
);
|
|
59670
|
-
const approveRequest =
|
|
59782
|
+
const approveRequest = useCallback57(
|
|
59671
59783
|
(requestId) => activeStateRef.current.approveRequest(requestId),
|
|
59672
59784
|
[]
|
|
59673
59785
|
);
|
|
59674
|
-
const rejectRequest =
|
|
59786
|
+
const rejectRequest = useCallback57(
|
|
59675
59787
|
(requestId, reason) => activeStateRef.current.rejectRequest(requestId, reason),
|
|
59676
59788
|
[]
|
|
59677
59789
|
);
|
|
59678
|
-
return
|
|
59790
|
+
return useMemo55(
|
|
59679
59791
|
() => ({
|
|
59680
59792
|
messages: activeState.messages,
|
|
59681
59793
|
isLoading: activeState.isLoading,
|
|
@@ -60014,16 +60126,16 @@ function buildStreamFrames(messages) {
|
|
|
60014
60126
|
|
|
60015
60127
|
// src/components/chat/embeddable-chat.tsx
|
|
60016
60128
|
init_cn();
|
|
60017
|
-
import { useCallback as
|
|
60129
|
+
import { useCallback as useCallback59, useEffect as useEffect99, useMemo as useMemo57, useRef as useRef84, useState as useState129 } from "react";
|
|
60018
60130
|
import * as DialogPrimitive5 from "@radix-ui/react-dialog";
|
|
60019
60131
|
import { usePreventScroll as usePreventScroll5 } from "@react-aria/overlays";
|
|
60020
60132
|
import { isIOS } from "@react-aria/utils";
|
|
60021
60133
|
|
|
60022
60134
|
// node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
60023
|
-
import * as
|
|
60135
|
+
import * as React149 from "react";
|
|
60024
60136
|
|
|
60025
60137
|
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
60026
|
-
import * as
|
|
60138
|
+
import * as React148 from "react";
|
|
60027
60139
|
import * as ReactDOM2 from "react-dom";
|
|
60028
60140
|
import { createSlot } from "@radix-ui/react-slot";
|
|
60029
60141
|
import { jsx as jsx396 } from "react/jsx-runtime";
|
|
@@ -60050,7 +60162,7 @@ var NODES = [
|
|
|
60050
60162
|
];
|
|
60051
60163
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
60052
60164
|
const Slot2 = createSlot(`Primitive.${node}`);
|
|
60053
|
-
const Node2 =
|
|
60165
|
+
const Node2 = React148.forwardRef((props, forwardedRef) => {
|
|
60054
60166
|
const { asChild, ...primitiveProps } = props;
|
|
60055
60167
|
const Comp = asChild ? Slot2 : node;
|
|
60056
60168
|
if (typeof window !== "undefined") {
|
|
@@ -60083,7 +60195,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
60083
60195
|
whiteSpace: "nowrap",
|
|
60084
60196
|
wordWrap: "normal"
|
|
60085
60197
|
});
|
|
60086
|
-
var VisuallyHidden = /* @__PURE__ */
|
|
60198
|
+
var VisuallyHidden = /* @__PURE__ */ React149.forwardRef(
|
|
60087
60199
|
/* @__PURE__ */ __name4(function VisuallyHidden2(props, forwardedRef) {
|
|
60088
60200
|
return /* @__PURE__ */ jsx397(
|
|
60089
60201
|
Primitive.span,
|
|
@@ -60101,7 +60213,7 @@ init_button2();
|
|
|
60101
60213
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
60102
60214
|
|
|
60103
60215
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
60104
|
-
import { useCallback as
|
|
60216
|
+
import { useCallback as useCallback58, useMemo as useMemo56, useRef as useRef83, useState as useState128 } from "react";
|
|
60105
60217
|
function useChatDialogManager({
|
|
60106
60218
|
dialogs,
|
|
60107
60219
|
activeDialogId,
|
|
@@ -60114,14 +60226,14 @@ function useChatDialogManager({
|
|
|
60114
60226
|
}) {
|
|
60115
60227
|
const [renameTarget, setRenameTarget] = useState128(null);
|
|
60116
60228
|
const [archiveTarget, setArchiveTarget] = useState128(null);
|
|
60117
|
-
const handleConfirmRename =
|
|
60229
|
+
const handleConfirmRename = useCallback58(
|
|
60118
60230
|
(name) => {
|
|
60119
60231
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
60120
60232
|
setRenameTarget(null);
|
|
60121
60233
|
},
|
|
60122
60234
|
[renameTarget, renameDialog]
|
|
60123
60235
|
);
|
|
60124
|
-
const handleConfirmArchive =
|
|
60236
|
+
const handleConfirmArchive = useCallback58(async () => {
|
|
60125
60237
|
if (archiveTarget) {
|
|
60126
60238
|
try {
|
|
60127
60239
|
await archiveDialog(archiveTarget.id);
|
|
@@ -60141,8 +60253,8 @@ function useChatDialogManager({
|
|
|
60141
60253
|
const [archivedCursor, setArchivedCursor] = useState128(null);
|
|
60142
60254
|
const [archivedLoading, setArchivedLoading] = useState128(false);
|
|
60143
60255
|
const [archivedPending, setArchivedPending] = useState128(false);
|
|
60144
|
-
const archivedRequestIdRef =
|
|
60145
|
-
const loadArchivedPage =
|
|
60256
|
+
const archivedRequestIdRef = useRef83(0);
|
|
60257
|
+
const loadArchivedPage = useCallback58(
|
|
60146
60258
|
async (cursor) => {
|
|
60147
60259
|
if (!fetchArchivedDialogs) return;
|
|
60148
60260
|
const requestId = ++archivedRequestIdRef.current;
|
|
@@ -60177,16 +60289,16 @@ function useChatDialogManager({
|
|
|
60177
60289
|
},
|
|
60178
60290
|
[fetchArchivedDialogs]
|
|
60179
60291
|
);
|
|
60180
|
-
const openArchive =
|
|
60292
|
+
const openArchive = useCallback58(() => {
|
|
60181
60293
|
setArchiveOpen(true);
|
|
60182
60294
|
void loadArchivedPage();
|
|
60183
60295
|
}, [loadArchivedPage]);
|
|
60184
|
-
const closeArchive =
|
|
60296
|
+
const closeArchive = useCallback58(() => setArchiveOpen(false), []);
|
|
60185
60297
|
const [viewingArchivedId, setViewingArchivedId] = useState128(
|
|
60186
60298
|
null
|
|
60187
60299
|
);
|
|
60188
60300
|
const [openingDialogId, setOpeningDialogId] = useState128(null);
|
|
60189
|
-
const handleSelectDialog =
|
|
60301
|
+
const handleSelectDialog = useCallback58(
|
|
60190
60302
|
(id) => {
|
|
60191
60303
|
setViewingArchivedId(null);
|
|
60192
60304
|
setOpeningDialogId(id);
|
|
@@ -60195,7 +60307,7 @@ function useChatDialogManager({
|
|
|
60195
60307
|
[selectDialog]
|
|
60196
60308
|
);
|
|
60197
60309
|
const isOpeningDialog = openingDialogId != null && openingDialogId === activeDialogId;
|
|
60198
|
-
const handleArchivedSelect =
|
|
60310
|
+
const handleArchivedSelect = useCallback58(
|
|
60199
60311
|
(id) => {
|
|
60200
60312
|
setArchiveOpen(false);
|
|
60201
60313
|
setOpeningDialogId(null);
|
|
@@ -60205,7 +60317,7 @@ function useChatDialogManager({
|
|
|
60205
60317
|
[selectDialog]
|
|
60206
60318
|
);
|
|
60207
60319
|
const [restoreTarget, setRestoreTarget] = useState128(null);
|
|
60208
|
-
const handleConfirmRestore =
|
|
60320
|
+
const handleConfirmRestore = useCallback58(async () => {
|
|
60209
60321
|
if (restoreTarget) {
|
|
60210
60322
|
try {
|
|
60211
60323
|
await unarchiveDialog?.(restoreTarget.id);
|
|
@@ -60219,7 +60331,7 @@ function useChatDialogManager({
|
|
|
60219
60331
|
setRestoreTarget(null);
|
|
60220
60332
|
}, [restoreTarget, unarchiveDialog]);
|
|
60221
60333
|
const isViewingArchived = viewingArchivedId != null && viewingArchivedId === activeDialogId;
|
|
60222
|
-
const handleBack =
|
|
60334
|
+
const handleBack = useCallback58(() => {
|
|
60223
60335
|
const wasArchived = isViewingArchived;
|
|
60224
60336
|
setViewingArchivedId(null);
|
|
60225
60337
|
setOpeningDialogId(null);
|
|
@@ -60227,14 +60339,14 @@ function useChatDialogManager({
|
|
|
60227
60339
|
clearMessages();
|
|
60228
60340
|
if (wasArchived) setArchiveOpen(true);
|
|
60229
60341
|
}, [isViewingArchived, selectDialog, clearMessages]);
|
|
60230
|
-
const resetToNewChat =
|
|
60342
|
+
const resetToNewChat = useCallback58(() => {
|
|
60231
60343
|
setViewingArchivedId(null);
|
|
60232
60344
|
setOpeningDialogId(null);
|
|
60233
60345
|
selectDialog(null);
|
|
60234
60346
|
clearMessages();
|
|
60235
60347
|
setArchiveOpen(false);
|
|
60236
60348
|
}, [selectDialog, clearMessages]);
|
|
60237
|
-
const activeDialog =
|
|
60349
|
+
const activeDialog = useMemo56(
|
|
60238
60350
|
() => dialogs.find((d) => d.id === activeDialogId) ?? archivedDialogs.find((d) => d.id === activeDialogId),
|
|
60239
60351
|
[dialogs, archivedDialogs, activeDialogId]
|
|
60240
60352
|
);
|
|
@@ -60647,7 +60759,7 @@ function EmbeddableChatInner({
|
|
|
60647
60759
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
60648
60760
|
});
|
|
60649
60761
|
usePreventScroll5({ isDisabled: !isOpen || shellLess });
|
|
60650
|
-
const navigatingAwayRef =
|
|
60762
|
+
const navigatingAwayRef = useRef84(false);
|
|
60651
60763
|
useEffect99(() => {
|
|
60652
60764
|
if (!isOpen) return;
|
|
60653
60765
|
if (shellLess) return;
|
|
@@ -60674,9 +60786,9 @@ function EmbeddableChatInner({
|
|
|
60674
60786
|
window.scrollTo(0, scrollY);
|
|
60675
60787
|
};
|
|
60676
60788
|
}, [isOpen, shellLess]);
|
|
60677
|
-
const chatInputRef =
|
|
60789
|
+
const chatInputRef = useRef84(null);
|
|
60678
60790
|
const [quickActionPreview, setQuickActionPreview] = useState129(null);
|
|
60679
|
-
const slashCommandsProp =
|
|
60791
|
+
const slashCommandsProp = useMemo57(
|
|
60680
60792
|
() => ({
|
|
60681
60793
|
fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
|
|
60682
60794
|
resolveSourceIcon: (sourceId) => {
|
|
@@ -60691,12 +60803,12 @@ function EmbeddableChatInner({
|
|
|
60691
60803
|
[commandsUrl]
|
|
60692
60804
|
);
|
|
60693
60805
|
const headerUserName = identityUser?.name?.trim() || [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || userDisplayName?.trim() || void 0;
|
|
60694
|
-
const effectiveModes =
|
|
60806
|
+
const effectiveModes = useMemo57(() => {
|
|
60695
60807
|
if (modes) return modes;
|
|
60696
60808
|
const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
|
|
60697
60809
|
return { guide: guideOptions };
|
|
60698
60810
|
}, [modes, tableIdForDocumentType]);
|
|
60699
|
-
const mingoCaps =
|
|
60811
|
+
const mingoCaps = useMemo57(() => {
|
|
60700
60812
|
if (mingoState) {
|
|
60701
60813
|
return {
|
|
60702
60814
|
canRename: mingoDialogCapabilities?.canRename ?? false,
|
|
@@ -60720,7 +60832,7 @@ function EmbeddableChatInner({
|
|
|
60720
60832
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
60721
60833
|
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState129(initialActiveMode);
|
|
60722
60834
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
60723
|
-
const handleActiveModeChange =
|
|
60835
|
+
const handleActiveModeChange = useCallback59(
|
|
60724
60836
|
(next) => {
|
|
60725
60837
|
if (controlledActiveMode === void 0) {
|
|
60726
60838
|
setUncontrolledActiveMode(next);
|
|
@@ -60730,7 +60842,7 @@ function EmbeddableChatInner({
|
|
|
60730
60842
|
[controlledActiveMode, onActiveModeChange]
|
|
60731
60843
|
);
|
|
60732
60844
|
const { commands: commandsList, loaded: commandsLoaded } = useSlashCommandRegistry(commandsUrl, { enabled: activeMode === "guide" });
|
|
60733
|
-
const commandsById =
|
|
60845
|
+
const commandsById = useMemo57(() => {
|
|
60734
60846
|
const map = /* @__PURE__ */ new Map();
|
|
60735
60847
|
for (const cmd of commandsList) map.set(cmd.id, cmd);
|
|
60736
60848
|
return map;
|
|
@@ -60780,7 +60892,7 @@ function EmbeddableChatInner({
|
|
|
60780
60892
|
hasMoreMessages,
|
|
60781
60893
|
loadMoreMessages
|
|
60782
60894
|
} = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
|
|
60783
|
-
const guidePromptSentRef =
|
|
60895
|
+
const guidePromptSentRef = useRef84(false);
|
|
60784
60896
|
useEffect99(() => {
|
|
60785
60897
|
if (!guidePendingPrompt) {
|
|
60786
60898
|
guidePromptSentRef.current = false;
|
|
@@ -60805,28 +60917,28 @@ function EmbeddableChatInner({
|
|
|
60805
60917
|
const [contextItems, setContextItems] = useState129([]);
|
|
60806
60918
|
const [contextPickerOpen, setContextPickerOpen] = useState129(false);
|
|
60807
60919
|
const [mentionQuery, setMentionQuery] = useState129(null);
|
|
60808
|
-
const mentionActiveRef =
|
|
60920
|
+
const mentionActiveRef = useRef84(false);
|
|
60809
60921
|
useEffect99(() => {
|
|
60810
60922
|
mentionActiveRef.current = mentionQuery !== null;
|
|
60811
60923
|
}, [mentionQuery]);
|
|
60812
|
-
const mentionKeysRef =
|
|
60924
|
+
const mentionKeysRef = useRef84(/* @__PURE__ */ new Set());
|
|
60813
60925
|
useEffect99(() => {
|
|
60814
60926
|
setContextItems([]);
|
|
60815
60927
|
setMentionQuery(null);
|
|
60816
60928
|
mentionKeysRef.current.clear();
|
|
60817
60929
|
}, [activeDialogId, activeMode]);
|
|
60818
|
-
const mentionMarkerByType =
|
|
60930
|
+
const mentionMarkerByType = useMemo57(() => {
|
|
60819
60931
|
const m = /* @__PURE__ */ new Map();
|
|
60820
60932
|
for (const t of contextPicker?.entityTypes ?? []) if (t.marker) m.set(t.type, t.marker);
|
|
60821
60933
|
return m;
|
|
60822
60934
|
}, [contextPicker?.entityTypes]);
|
|
60823
60935
|
const contextEntityTypes = contextPicker?.entityTypes;
|
|
60824
|
-
const resolveContextIcon =
|
|
60936
|
+
const resolveContextIcon = useMemo57(() => {
|
|
60825
60937
|
const byType = /* @__PURE__ */ new Map();
|
|
60826
60938
|
for (const t of contextEntityTypes ?? []) byType.set(t.type, t.icon);
|
|
60827
60939
|
return (item) => byType.get(item.type);
|
|
60828
60940
|
}, [contextEntityTypes]);
|
|
60829
|
-
const toggleContextItem =
|
|
60941
|
+
const toggleContextItem = useCallback59(
|
|
60830
60942
|
(item) => {
|
|
60831
60943
|
const key = `${item.type}:${item.id}`;
|
|
60832
60944
|
if (mentionActiveRef.current) {
|
|
@@ -60849,7 +60961,7 @@ function EmbeddableChatInner({
|
|
|
60849
60961
|
},
|
|
60850
60962
|
[contextMaxItems, contextItems, mentionMarkerByType, resolveContextIcon]
|
|
60851
60963
|
);
|
|
60852
|
-
const removeContextItem =
|
|
60964
|
+
const removeContextItem = useCallback59((item) => {
|
|
60853
60965
|
const key = `${item.type}:${item.id}`;
|
|
60854
60966
|
setContextItems((prev) => prev.filter((p) => `${p.type}:${p.id}` !== key));
|
|
60855
60967
|
if (mentionKeysRef.current.has(key)) {
|
|
@@ -60859,7 +60971,7 @@ function EmbeddableChatInner({
|
|
|
60859
60971
|
chatInputRef.current?.setValue(next);
|
|
60860
60972
|
}
|
|
60861
60973
|
}, [mentionMarkerByType]);
|
|
60862
|
-
const handleContextValueChange =
|
|
60974
|
+
const handleContextValueChange = useCallback59((value) => {
|
|
60863
60975
|
for (const key of Array.from(mentionKeysRef.current)) {
|
|
60864
60976
|
if (!value.includes(`@${mentionTokenOf(key, mentionMarkerByType)}`)) {
|
|
60865
60977
|
mentionKeysRef.current.delete(key);
|
|
@@ -60867,32 +60979,32 @@ function EmbeddableChatInner({
|
|
|
60867
60979
|
}
|
|
60868
60980
|
}
|
|
60869
60981
|
}, [mentionMarkerByType]);
|
|
60870
|
-
const openContextPicker =
|
|
60982
|
+
const openContextPicker = useCallback59(() => {
|
|
60871
60983
|
setMentionQuery(null);
|
|
60872
60984
|
setContextPickerOpen(true);
|
|
60873
60985
|
}, []);
|
|
60874
|
-
const closeContextPicker =
|
|
60986
|
+
const closeContextPicker = useCallback59(() => {
|
|
60875
60987
|
if (mentionActiveRef.current) {
|
|
60876
60988
|
chatInputRef.current?.removeMentionTrigger();
|
|
60877
60989
|
}
|
|
60878
60990
|
setContextPickerOpen(false);
|
|
60879
60991
|
setMentionQuery(null);
|
|
60880
60992
|
}, []);
|
|
60881
|
-
const handleMentionQueryChange =
|
|
60993
|
+
const handleMentionQueryChange = useCallback59((query) => {
|
|
60882
60994
|
setMentionQuery(query);
|
|
60883
60995
|
setContextPickerOpen(query !== null);
|
|
60884
60996
|
}, []);
|
|
60885
60997
|
const resolvedBaseRoute = baseRoute || (source === "flamingo" ? "/knowledge-base" : "/data-room");
|
|
60886
|
-
const handleClose =
|
|
60887
|
-
const handleNavigationClose =
|
|
60998
|
+
const handleClose = useCallback59(() => setIsOpen(false), [setIsOpen]);
|
|
60999
|
+
const handleNavigationClose = useCallback59(() => {
|
|
60888
61000
|
navigatingAwayRef.current = true;
|
|
60889
61001
|
setIsOpen(false);
|
|
60890
61002
|
}, [setIsOpen]);
|
|
60891
|
-
const chatPanelHandle =
|
|
61003
|
+
const chatPanelHandle = useMemo57(
|
|
60892
61004
|
() => ({ closeChat: handleNavigationClose }),
|
|
60893
61005
|
[handleNavigationClose]
|
|
60894
61006
|
);
|
|
60895
|
-
const renderEntityCard =
|
|
61007
|
+
const renderEntityCard = useCallback59(
|
|
60896
61008
|
(reference) => renderChatInlineEntityCard(reference, {
|
|
60897
61009
|
onDiscuss: discussRef,
|
|
60898
61010
|
onDisplay: displayRef,
|
|
@@ -60902,14 +61014,14 @@ function EmbeddableChatInner({
|
|
|
60902
61014
|
}),
|
|
60903
61015
|
[discussRef, displayRef, resolvedBaseRoute, chipBasePlatform, extras]
|
|
60904
61016
|
);
|
|
60905
|
-
const mingoAssistantIcon =
|
|
61017
|
+
const mingoAssistantIcon = useMemo57(
|
|
60906
61018
|
() => effectiveAssistantIcon ? /* @__PURE__ */ jsx398(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx398(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
60907
61019
|
[effectiveAssistantIcon]
|
|
60908
61020
|
);
|
|
60909
|
-
const timestampCacheRef =
|
|
61021
|
+
const timestampCacheRef = useRef84(/* @__PURE__ */ new Map());
|
|
60910
61022
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
60911
61023
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
60912
|
-
const messages =
|
|
61024
|
+
const messages = useMemo57(() => {
|
|
60913
61025
|
const cache = timestampCacheRef.current;
|
|
60914
61026
|
const seenIds = /* @__PURE__ */ new Set();
|
|
60915
61027
|
const mapped = rawMessages.map((m) => {
|
|
@@ -60954,7 +61066,7 @@ function EmbeddableChatInner({
|
|
|
60954
61066
|
}
|
|
60955
61067
|
return mapped;
|
|
60956
61068
|
}, [rawMessages, guideUserName, guideUserAvatar]);
|
|
60957
|
-
const handleSend =
|
|
61069
|
+
const handleSend = useCallback59(
|
|
60958
61070
|
(text) => {
|
|
60959
61071
|
let augmentedText = text;
|
|
60960
61072
|
if (readyAttachments.length > 0) {
|
|
@@ -60974,13 +61086,13 @@ function EmbeddableChatInner({
|
|
|
60974
61086
|
},
|
|
60975
61087
|
[sendMessage, readyAttachments, viewUrlPrefix, clearAttachments, contextItems]
|
|
60976
61088
|
);
|
|
60977
|
-
const handleAskSelect =
|
|
61089
|
+
const handleAskSelect = useCallback59(
|
|
60978
61090
|
(label) => {
|
|
60979
61091
|
sendMessage(label);
|
|
60980
61092
|
},
|
|
60981
61093
|
[sendMessage]
|
|
60982
61094
|
);
|
|
60983
|
-
const guideSuggestedActions =
|
|
61095
|
+
const guideSuggestedActions = useMemo57(
|
|
60984
61096
|
() => {
|
|
60985
61097
|
if (effectiveQuickActions.length > 0) {
|
|
60986
61098
|
return effectiveQuickActions.map((qa) => ({
|
|
@@ -61042,7 +61154,7 @@ function EmbeddableChatInner({
|
|
|
61042
61154
|
fetchArchivedDialogs: mingoCaps.fetchArchivedDialogs,
|
|
61043
61155
|
unarchiveDialog: mingoCaps.unarchiveDialog
|
|
61044
61156
|
});
|
|
61045
|
-
const handleOpen =
|
|
61157
|
+
const handleOpen = useCallback59(() => setIsOpen(true), [setIsOpen]);
|
|
61046
61158
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
61047
61159
|
useEffect99(() => {
|
|
61048
61160
|
const handler = (e) => {
|
|
@@ -61076,11 +61188,11 @@ function EmbeddableChatInner({
|
|
|
61076
61188
|
}, [isQuickActionEmpty]);
|
|
61077
61189
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
61078
61190
|
const sourceLabel = source === "flamingo" ? "Knowledge Base" : "Data Room";
|
|
61079
|
-
const enabledSet =
|
|
61191
|
+
const enabledSet = useMemo57(
|
|
61080
61192
|
() => effectiveEnabledRagTableIds ? new Set(effectiveEnabledRagTableIds) : null,
|
|
61081
61193
|
[effectiveEnabledRagTableIds]
|
|
61082
61194
|
);
|
|
61083
|
-
const chipCommands =
|
|
61195
|
+
const chipCommands = useMemo57(() => {
|
|
61084
61196
|
const out = [];
|
|
61085
61197
|
for (const cmd of commandsById.values()) {
|
|
61086
61198
|
if (cmd.displayOrder === void 0) continue;
|
|
@@ -61097,7 +61209,7 @@ function EmbeddableChatInner({
|
|
|
61097
61209
|
return out;
|
|
61098
61210
|
}, [commandsById, enabledSet]);
|
|
61099
61211
|
const lastAssistantMsg = [...rawMessages].reverse().find((m) => m.role === "assistant");
|
|
61100
|
-
const lastSources =
|
|
61212
|
+
const lastSources = useMemo57(() => {
|
|
61101
61213
|
if (chatLoading) return void 0;
|
|
61102
61214
|
const sources = lastAssistantMsg?.sources;
|
|
61103
61215
|
if (!sources || sources.length === 0) return void 0;
|
|
@@ -61116,7 +61228,7 @@ function EmbeddableChatInner({
|
|
|
61116
61228
|
const [portalHost, setPortalHost] = useState129(null);
|
|
61117
61229
|
const [panelBoundary, setPanelBoundary] = useState129(null);
|
|
61118
61230
|
const [panelWidth, setPanelWidth] = useState129(0);
|
|
61119
|
-
const panelMeasureRef =
|
|
61231
|
+
const panelMeasureRef = useRef84(null);
|
|
61120
61232
|
useEffect99(() => {
|
|
61121
61233
|
const el = panelMeasureRef.current;
|
|
61122
61234
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -61128,7 +61240,7 @@ function EmbeddableChatInner({
|
|
|
61128
61240
|
setPanelWidth(el.clientWidth);
|
|
61129
61241
|
return () => ro.disconnect();
|
|
61130
61242
|
}, []);
|
|
61131
|
-
const setPanelNode =
|
|
61243
|
+
const setPanelNode = useCallback59((node) => {
|
|
61132
61244
|
panelMeasureRef.current = node;
|
|
61133
61245
|
setPanelBoundary(node);
|
|
61134
61246
|
}, []);
|
|
@@ -61140,7 +61252,7 @@ function EmbeddableChatInner({
|
|
|
61140
61252
|
} catch {
|
|
61141
61253
|
}
|
|
61142
61254
|
}, []);
|
|
61143
|
-
const toggleRailCollapsed =
|
|
61255
|
+
const toggleRailCollapsed = useCallback59(() => {
|
|
61144
61256
|
setRailCollapsed((prev) => {
|
|
61145
61257
|
const next = !prev;
|
|
61146
61258
|
try {
|
|
@@ -61175,7 +61287,7 @@ function EmbeddableChatInner({
|
|
|
61175
61287
|
const headerPersonName = headerOwner?.name?.trim() || headerUserName;
|
|
61176
61288
|
const headerPersonAvatarUrl = headerOwner ? headerOwner.avatarUrl?.trim() || void 0 : identityUser?.avatarUrl?.trim() || userAvatarUrl?.trim() || void 0;
|
|
61177
61289
|
const headerAvatar = headerPersonName || headerPersonAvatarUrl ? { name: headerPersonName, avatarUrl: headerPersonAvatarUrl } : void 0;
|
|
61178
|
-
const handleNewChat =
|
|
61290
|
+
const handleNewChat = useCallback59(() => {
|
|
61179
61291
|
resetToNewChat();
|
|
61180
61292
|
}, [resetToNewChat]);
|
|
61181
61293
|
const splitHeaderMenuItems = [
|
|
@@ -62822,4 +62934,4 @@ export {
|
|
|
62822
62934
|
LogsList,
|
|
62823
62935
|
assets
|
|
62824
62936
|
};
|
|
62825
|
-
//# sourceMappingURL=chunk-
|
|
62937
|
+
//# sourceMappingURL=chunk-K5SQ625X.js.map
|