@flamingo-stack/openframe-frontend-core 0.0.445-snapshot.20260717185124 → 0.0.445
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-YLMD4UFA.js → chunk-22NSWMI6.js} +2 -2
- package/dist/{chunk-MAB4TQCO.js → chunk-3BHV2QAH.js} +206 -187
- package/dist/{chunk-MAB4TQCO.js.map → chunk-3BHV2QAH.js.map} +1 -1
- package/dist/{chunk-GTHA2SYB.js → chunk-3DQ5BFPM.js} +4 -4
- package/dist/{chunk-N3Y6JYH5.cjs → chunk-3HYSD7NR.cjs} +15 -15
- package/dist/{chunk-N3Y6JYH5.cjs.map → chunk-3HYSD7NR.cjs.map} +1 -1
- package/dist/{chunk-L276GOMD.cjs → chunk-5DWPXK37.cjs} +31 -31
- package/dist/{chunk-L276GOMD.cjs.map → chunk-5DWPXK37.cjs.map} +1 -1
- package/dist/{chunk-6XZNIPXP.cjs → chunk-5FUQTSTT.cjs} +11 -11
- package/dist/{chunk-6XZNIPXP.cjs.map → chunk-5FUQTSTT.cjs.map} +1 -1
- package/dist/{chunk-I7IOEXRJ.js → chunk-7R256DKK.js} +2 -2
- package/dist/{chunk-DH3DUY6Q.cjs → chunk-DTLNCOSG.cjs} +26 -26
- package/dist/{chunk-DH3DUY6Q.cjs.map → chunk-DTLNCOSG.cjs.map} +1 -1
- package/dist/{chunk-SCKAD2MY.js → chunk-FIAXFNAA.js} +4 -4
- package/dist/{chunk-K6JIBV3X.js → chunk-H2DYCT6M.js} +2 -2
- package/dist/{chunk-5YQSRQHP.js → chunk-H352AZJN.js} +4 -4
- package/dist/{chunk-N4CCB33C.js → chunk-K4RASNQM.js} +2 -2
- package/dist/{chunk-NQLY27GH.cjs → chunk-KISQUH33.cjs} +62 -62
- package/dist/{chunk-NQLY27GH.cjs.map → chunk-KISQUH33.cjs.map} +1 -1
- package/dist/{chunk-3AFV2YIC.cjs → chunk-MPSA6YAM.cjs} +37 -37
- package/dist/{chunk-3AFV2YIC.cjs.map → chunk-MPSA6YAM.cjs.map} +1 -1
- package/dist/{chunk-MR7BMJHI.js → chunk-MQUS6BFR.js} +4 -4
- package/dist/{chunk-SA7AHDS6.cjs → chunk-N64VTHZ5.cjs} +7 -7
- package/dist/{chunk-SA7AHDS6.cjs.map → chunk-N64VTHZ5.cjs.map} +1 -1
- package/dist/{chunk-ZKYEMGMD.cjs → chunk-P3FN4NAE.cjs} +26 -26
- package/dist/{chunk-ZKYEMGMD.cjs.map → chunk-P3FN4NAE.cjs.map} +1 -1
- package/dist/{chunk-BAUWT7PV.cjs → chunk-QL2EI56X.cjs} +505 -486
- package/dist/chunk-QL2EI56X.cjs.map +1 -0
- package/dist/{chunk-7IC2QCOL.cjs → chunk-R6WGCJBB.cjs} +59 -59
- package/dist/{chunk-7IC2QCOL.cjs.map → chunk-R6WGCJBB.cjs.map} +1 -1
- package/dist/{chunk-5WX2V6CY.cjs → chunk-RXLMN6B5.cjs} +9 -9
- package/dist/{chunk-5WX2V6CY.cjs.map → chunk-RXLMN6B5.cjs.map} +1 -1
- package/dist/{chunk-SAV4U37G.js → chunk-TCEBFMLQ.js} +2 -2
- package/dist/{chunk-BNYI2FVM.js → chunk-XPZLIONZ.js} +2 -2
- package/dist/{chunk-MS5CEBBQ.cjs → chunk-YCLSV2H6.cjs} +5 -5
- package/dist/{chunk-MS5CEBBQ.cjs.map → chunk-YCLSV2H6.cjs.map} +1 -1
- package/dist/{chunk-XB6D7B3I.js → chunk-Z4N7XLFG.js} +2 -2
- 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/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +129 -129
- package/dist/components/index.js +9 -9
- 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 +5 -5
- package/dist/components/tickets/index.js +4 -4
- 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/components/features/policy-configuration-panel.tsx +49 -34
- package/src/stories/PolicyConfigurationPanel.stories.tsx +6 -8
- package/dist/chunk-BAUWT7PV.cjs.map +0 -1
- /package/dist/{chunk-YLMD4UFA.js.map → chunk-22NSWMI6.js.map} +0 -0
- /package/dist/{chunk-GTHA2SYB.js.map → chunk-3DQ5BFPM.js.map} +0 -0
- /package/dist/{chunk-I7IOEXRJ.js.map → chunk-7R256DKK.js.map} +0 -0
- /package/dist/{chunk-SCKAD2MY.js.map → chunk-FIAXFNAA.js.map} +0 -0
- /package/dist/{chunk-K6JIBV3X.js.map → chunk-H2DYCT6M.js.map} +0 -0
- /package/dist/{chunk-5YQSRQHP.js.map → chunk-H352AZJN.js.map} +0 -0
- /package/dist/{chunk-N4CCB33C.js.map → chunk-K4RASNQM.js.map} +0 -0
- /package/dist/{chunk-MR7BMJHI.js.map → chunk-MQUS6BFR.js.map} +0 -0
- /package/dist/{chunk-SAV4U37G.js.map → chunk-TCEBFMLQ.js.map} +0 -0
- /package/dist/{chunk-BNYI2FVM.js.map → chunk-XPZLIONZ.js.map} +0 -0
- /package/dist/{chunk-XB6D7B3I.js.map → chunk-Z4N7XLFG.js.map} +0 -0
|
@@ -31939,22 +31939,23 @@ function ViewToggle({
|
|
|
31939
31939
|
|
|
31940
31940
|
// src/components/features/policy-configuration-panel.tsx
|
|
31941
31941
|
init_cn();
|
|
31942
|
-
import { useEffect as useEffect52, useState as useState71 } from "react";
|
|
31942
|
+
import { useRef as useRef37, useEffect as useEffect52, useState as useState71 } from "react";
|
|
31943
31943
|
import { ChevronDown as ChevronDown8, Shield as Shield2 } from "lucide-react";
|
|
31944
31944
|
init_button2();
|
|
31945
31945
|
import { Fragment as Fragment43, jsx as jsx253, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
31946
|
-
var
|
|
31947
|
-
ALLOW: "Allow",
|
|
31948
|
-
ASK_USER: "Ask User",
|
|
31949
|
-
ASK_TECHNICIAN: "Ask Technician",
|
|
31950
|
-
DENY: "Restrict"
|
|
31946
|
+
var approvalLevelOptions = [
|
|
31947
|
+
{ value: "ALLOW", label: "Allow" },
|
|
31948
|
+
{ value: "ASK_USER", label: "Ask User" },
|
|
31949
|
+
{ value: "ASK_TECHNICIAN", label: "Ask Technician" },
|
|
31950
|
+
{ value: "DENY", label: "Restrict" }
|
|
31951
|
+
];
|
|
31952
|
+
var getApprovalLevelLabel = (level, editMode = false) => {
|
|
31953
|
+
if (!level) {
|
|
31954
|
+
return editMode ? "Set Global Permission" : "";
|
|
31955
|
+
}
|
|
31956
|
+
const option = approvalLevelOptions.find((opt) => opt.value === level);
|
|
31957
|
+
return option?.label || level;
|
|
31951
31958
|
};
|
|
31952
|
-
var approvalLevelOptions = Object.keys(approvalLevelLabels).map(
|
|
31953
|
-
(value) => ({ value, label: approvalLevelLabels[value] })
|
|
31954
|
-
);
|
|
31955
|
-
var POLICY_LEVEL_WIDTH = "w-[180px]";
|
|
31956
|
-
var CATEGORY_LEVEL_WIDTH = "w-[256px]";
|
|
31957
|
-
var getApprovalLevelLabel = (level) => approvalLevelLabels[level] ?? level;
|
|
31958
31959
|
var ApprovalLevelDropdown = ({ value, onChange, allowClear = false, triggerClassName, contentClassName }) => /* @__PURE__ */ jsxs197(DropdownMenu, { children: [
|
|
31959
31960
|
/* @__PURE__ */ jsx253(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx253(
|
|
31960
31961
|
Button,
|
|
@@ -31966,7 +31967,7 @@ var ApprovalLevelDropdown = ({ value, onChange, allowClear = false, triggerClass
|
|
|
31966
31967
|
value ? "text-ods-text-primary" : "text-ods-text-secondary",
|
|
31967
31968
|
triggerClassName
|
|
31968
31969
|
),
|
|
31969
|
-
children:
|
|
31970
|
+
children: getApprovalLevelLabel(value, true)
|
|
31970
31971
|
}
|
|
31971
31972
|
) }),
|
|
31972
31973
|
/* @__PURE__ */ jsxs197(DropdownMenuContent, { align: "end", className: contentClassName, children: [
|
|
@@ -31997,7 +31998,7 @@ var PolicyRow = ({ policy, categoryId, editMode, onPermissionChange }) => {
|
|
|
31997
31998
|
value: policy.approvalLevel,
|
|
31998
31999
|
onChange: handleChange,
|
|
31999
32000
|
triggerClassName: "w-full",
|
|
32000
|
-
contentClassName:
|
|
32001
|
+
contentClassName: "w-[180px]"
|
|
32001
32002
|
}
|
|
32002
32003
|
) }) : policy.approvalLevel ? /* @__PURE__ */ jsx253("span", { className: "md:hidden text-h4 text-ods-text-primary", children: getApprovalLevelLabel(policy.approvalLevel) }) : null
|
|
32003
32004
|
] }),
|
|
@@ -32006,12 +32007,23 @@ var PolicyRow = ({ policy, categoryId, editMode, onPermissionChange }) => {
|
|
|
32006
32007
|
{
|
|
32007
32008
|
value: policy.approvalLevel,
|
|
32008
32009
|
onChange: handleChange,
|
|
32009
|
-
triggerClassName:
|
|
32010
|
-
contentClassName:
|
|
32010
|
+
triggerClassName: "w-[180px]",
|
|
32011
|
+
contentClassName: "w-[180px]"
|
|
32011
32012
|
}
|
|
32012
|
-
) : /* @__PURE__ */ jsx253("div", { className:
|
|
32013
|
+
) : /* @__PURE__ */ jsx253("div", { className: "px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)] w-[180px]", children: policy.approvalLevel && /* @__PURE__ */ jsx253("span", { className: "text-h4 text-ods-text-primary", children: getApprovalLevelLabel(policy.approvalLevel) }) }) })
|
|
32013
32014
|
] });
|
|
32014
32015
|
};
|
|
32016
|
+
var useAnimatedHeight = (isExpanded) => {
|
|
32017
|
+
const [height, setHeight] = useState71(0);
|
|
32018
|
+
const contentRef = useRef37(null);
|
|
32019
|
+
useEffect52(() => {
|
|
32020
|
+
if (contentRef.current) {
|
|
32021
|
+
const contentHeight = contentRef.current.scrollHeight;
|
|
32022
|
+
setHeight(isExpanded ? contentHeight : 0);
|
|
32023
|
+
}
|
|
32024
|
+
}, [isExpanded]);
|
|
32025
|
+
return { contentRef, height };
|
|
32026
|
+
};
|
|
32015
32027
|
var CategorySection = ({
|
|
32016
32028
|
category,
|
|
32017
32029
|
editMode,
|
|
@@ -32021,7 +32033,7 @@ var CategorySection = ({
|
|
|
32021
32033
|
onBulkLevelChange,
|
|
32022
32034
|
onPolicyPermissionChange
|
|
32023
32035
|
}) => {
|
|
32024
|
-
const {
|
|
32036
|
+
const { contentRef, height } = useAnimatedHeight(isExpanded);
|
|
32025
32037
|
const handleBulkChange = (level) => onBulkLevelChange(category.id, level);
|
|
32026
32038
|
return /* @__PURE__ */ jsxs197(Fragment43, { children: [
|
|
32027
32039
|
/* @__PURE__ */ jsxs197(
|
|
@@ -32044,7 +32056,7 @@ var CategorySection = ({
|
|
|
32044
32056
|
onChange: handleBulkChange,
|
|
32045
32057
|
allowClear: true,
|
|
32046
32058
|
triggerClassName: "w-full",
|
|
32047
|
-
contentClassName:
|
|
32059
|
+
contentClassName: "w-[256px]"
|
|
32048
32060
|
}
|
|
32049
32061
|
) })
|
|
32050
32062
|
] }),
|
|
@@ -32054,10 +32066,16 @@ var CategorySection = ({
|
|
|
32054
32066
|
value: bulkLevel,
|
|
32055
32067
|
onChange: handleBulkChange,
|
|
32056
32068
|
allowClear: true,
|
|
32057
|
-
triggerClassName:
|
|
32058
|
-
contentClassName:
|
|
32069
|
+
triggerClassName: "w-[256px]",
|
|
32070
|
+
contentClassName: "w-[256px]"
|
|
32059
32071
|
}
|
|
32060
|
-
) }) : /* @__PURE__ */ jsx253(
|
|
32072
|
+
) }) : /* @__PURE__ */ jsx253(
|
|
32073
|
+
"div",
|
|
32074
|
+
{
|
|
32075
|
+
className: "hidden md:block px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)] w-[256px] shrink-0",
|
|
32076
|
+
onClick: (e) => e.stopPropagation()
|
|
32077
|
+
}
|
|
32078
|
+
),
|
|
32061
32079
|
/* @__PURE__ */ jsx253(
|
|
32062
32080
|
Button,
|
|
32063
32081
|
{
|
|
@@ -32086,15 +32104,16 @@ var CategorySection = ({
|
|
|
32086
32104
|
/* @__PURE__ */ jsx253(
|
|
32087
32105
|
"div",
|
|
32088
32106
|
{
|
|
32107
|
+
ref: contentRef,
|
|
32089
32108
|
style: {
|
|
32090
|
-
|
|
32091
|
-
transition:
|
|
32092
|
-
// visibility drops collapsed content from the tab order and a11y
|
|
32093
|
-
// tree; its discrete transition delays hiding until the fade ends.
|
|
32094
|
-
visibility: isExpanded ? "visible" : "hidden"
|
|
32109
|
+
height: height === "auto" ? "auto" : `${height}px`,
|
|
32110
|
+
transition: "height 300ms ease-in-out, opacity 300ms ease-in-out"
|
|
32095
32111
|
},
|
|
32096
|
-
className:
|
|
32097
|
-
|
|
32112
|
+
className: cn(
|
|
32113
|
+
"overflow-hidden",
|
|
32114
|
+
isExpanded ? "opacity-100" : "opacity-0"
|
|
32115
|
+
),
|
|
32116
|
+
children: /* @__PURE__ */ jsx253("div", { className: "px-[var(--spacing-system-mf)] pb-[var(--spacing-system-mf)] pt-0", children: /* @__PURE__ */ jsx253("div", { className: "border border-ods-border rounded-md overflow-hidden", children: category.policies.map((policy) => /* @__PURE__ */ jsx253(
|
|
32098
32117
|
PolicyRow,
|
|
32099
32118
|
{
|
|
32100
32119
|
policy,
|
|
@@ -32157,7 +32176,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
|
|
|
32157
32176
|
init_button2();
|
|
32158
32177
|
|
|
32159
32178
|
// src/components/ui/phone-input.tsx
|
|
32160
|
-
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as useMemo27, useRef as
|
|
32179
|
+
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as useMemo27, useRef as useRef38, useState as useState72 } from "react";
|
|
32161
32180
|
import { jsx as jsx254, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
32162
32181
|
function PhoneInput({
|
|
32163
32182
|
value,
|
|
@@ -32175,7 +32194,7 @@ function PhoneInput({
|
|
|
32175
32194
|
[countryCode, priority, others]
|
|
32176
32195
|
);
|
|
32177
32196
|
const [isInvalid, setIsInvalid] = useState72(false);
|
|
32178
|
-
const debounceRef =
|
|
32197
|
+
const debounceRef = useRef38(null);
|
|
32179
32198
|
const digitCount = useCallback28((val) => val.replace(/[^0-9]/g, "").length, []);
|
|
32180
32199
|
const runValidation = useCallback28((phone) => {
|
|
32181
32200
|
if (!phone || digitCount(phone) === 0) {
|
|
@@ -32681,7 +32700,7 @@ function useOptionalNotifications() {
|
|
|
32681
32700
|
}
|
|
32682
32701
|
|
|
32683
32702
|
// src/components/features/notifications/notification-drawer.tsx
|
|
32684
|
-
import { useEffect as useEffect58, useRef as
|
|
32703
|
+
import { useEffect as useEffect58, useRef as useRef41 } from "react";
|
|
32685
32704
|
|
|
32686
32705
|
// src/components/navigation/app-layout-context.ts
|
|
32687
32706
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -33449,9 +33468,9 @@ function DrawerScrollList({
|
|
|
33449
33468
|
loadMoreRootMargin,
|
|
33450
33469
|
renderTile
|
|
33451
33470
|
}) {
|
|
33452
|
-
const scrollRef =
|
|
33453
|
-
const sentinelRef =
|
|
33454
|
-
const loadMoreRef =
|
|
33471
|
+
const scrollRef = useRef41(null);
|
|
33472
|
+
const sentinelRef = useRef41(null);
|
|
33473
|
+
const loadMoreRef = useRef41(loadMore);
|
|
33455
33474
|
loadMoreRef.current = loadMore;
|
|
33456
33475
|
useEffect58(() => {
|
|
33457
33476
|
if (!loadMore || !hasMore || isLoadingMore) return;
|
|
@@ -34320,7 +34339,7 @@ function LastEntryRow({ entry, onClick }) {
|
|
|
34320
34339
|
// src/components/features/time-tracker/time-tracker-header-button.tsx
|
|
34321
34340
|
init_cn();
|
|
34322
34341
|
import * as PopoverPrimitive5 from "@radix-ui/react-popover";
|
|
34323
|
-
import { useEffect as useEffect61, useRef as
|
|
34342
|
+
import { useEffect as useEffect61, useRef as useRef42 } from "react";
|
|
34324
34343
|
|
|
34325
34344
|
// src/components/navigation/header-button.tsx
|
|
34326
34345
|
init_cn();
|
|
@@ -34359,11 +34378,11 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
34359
34378
|
const layoutContainer = useAppLayoutDrawerContainer();
|
|
34360
34379
|
const coordination = useAppLayoutDrawerCoordination();
|
|
34361
34380
|
const isOpen = ctx?.isOpen ?? false;
|
|
34362
|
-
const isOpenRef =
|
|
34381
|
+
const isOpenRef = useRef42(isOpen);
|
|
34363
34382
|
isOpenRef.current = isOpen;
|
|
34364
|
-
const closeRef =
|
|
34383
|
+
const closeRef = useRef42(ctx?.close);
|
|
34365
34384
|
closeRef.current = ctx?.close;
|
|
34366
|
-
const selfHandleRef =
|
|
34385
|
+
const selfHandleRef = useRef42(null);
|
|
34367
34386
|
if (!selfHandleRef.current) {
|
|
34368
34387
|
selfHandleRef.current = {
|
|
34369
34388
|
close: () => {
|
|
@@ -35388,18 +35407,18 @@ function SortableRow({
|
|
|
35388
35407
|
|
|
35389
35408
|
// src/components/navigation/header.tsx
|
|
35390
35409
|
init_next_link();
|
|
35391
|
-
import React108, { useEffect as useEffect64, useRef as
|
|
35410
|
+
import React108, { useEffect as useEffect64, useRef as useRef46, useState as useState84 } from "react";
|
|
35392
35411
|
init_button2();
|
|
35393
35412
|
|
|
35394
35413
|
// src/components/navigation/mobile-nav-panel.tsx
|
|
35395
|
-
import { useRef as
|
|
35414
|
+
import { useRef as useRef45 } from "react";
|
|
35396
35415
|
import { usePreventScroll as usePreventScroll3 } from "@react-aria/overlays";
|
|
35397
35416
|
init_button2();
|
|
35398
35417
|
import { X as X10 } from "lucide-react";
|
|
35399
35418
|
import { Fragment as Fragment51, jsx as jsx273, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
35400
35419
|
var MOBILE_NAV_PANEL_ID = "mobile-nav-panel";
|
|
35401
35420
|
function MobileNavPanel({ isOpen, config }) {
|
|
35402
|
-
const panelRef =
|
|
35421
|
+
const panelRef = useRef45(null);
|
|
35403
35422
|
usePreventScroll3({ isDisabled: !isOpen });
|
|
35404
35423
|
useFocusTrap(panelRef, isOpen, { onEscape: config.onClose });
|
|
35405
35424
|
const headerHeight = useHeaderHeight(64, { enabled: isOpen });
|
|
@@ -35560,8 +35579,8 @@ function Header2({ config, platform }) {
|
|
|
35560
35579
|
const [show, setShow] = useState84(true);
|
|
35561
35580
|
const [lastScrollY, setLastScrollY] = useState84(0);
|
|
35562
35581
|
const [openDropdowns, setOpenDropdowns] = useState84({});
|
|
35563
|
-
const dropdownRefs =
|
|
35564
|
-
const triggerRefs =
|
|
35582
|
+
const dropdownRefs = useRef46({});
|
|
35583
|
+
const triggerRefs = useRef46({});
|
|
35565
35584
|
useEffect64(() => {
|
|
35566
35585
|
const handleClickOutside = (event) => {
|
|
35567
35586
|
const target = event.target;
|
|
@@ -35887,7 +35906,7 @@ function ClientOnlyHeader({ config, skeleton }) {
|
|
|
35887
35906
|
}
|
|
35888
35907
|
|
|
35889
35908
|
// src/components/navigation/sliding-sidebar.tsx
|
|
35890
|
-
import { useState as useState86, useEffect as useEffect66, useRef as
|
|
35909
|
+
import { useState as useState86, useEffect as useEffect66, useRef as useRef47 } from "react";
|
|
35891
35910
|
import { motion as motion2, AnimatePresence, useReducedMotion } from "framer-motion";
|
|
35892
35911
|
import { usePreventScroll as usePreventScroll4 } from "@react-aria/overlays";
|
|
35893
35912
|
init_button2();
|
|
@@ -35896,7 +35915,7 @@ function SlidingSidebar({ config }) {
|
|
|
35896
35915
|
const [expandedItems, setExpandedItems] = useState86(/* @__PURE__ */ new Set());
|
|
35897
35916
|
const [mounted, setMounted] = useState86(false);
|
|
35898
35917
|
const headerHeight = useHeaderHeight();
|
|
35899
|
-
const asideRef =
|
|
35918
|
+
const asideRef = useRef47(null);
|
|
35900
35919
|
const prefersReducedMotion2 = useReducedMotion();
|
|
35901
35920
|
usePreventScroll4({ isDisabled: !config.isOpen });
|
|
35902
35921
|
useFocusTrap(asideRef, config.isOpen, { onEscape: config.onClose, contain: false });
|
|
@@ -36068,7 +36087,7 @@ function SlidingSidebar({ config }) {
|
|
|
36068
36087
|
}
|
|
36069
36088
|
|
|
36070
36089
|
// src/components/navigation/sticky-section-nav.tsx
|
|
36071
|
-
import { useEffect as useEffect67, useState as useState87, useCallback as useCallback35, useRef as
|
|
36090
|
+
import { useEffect as useEffect67, useState as useState87, useCallback as useCallback35, useRef as useRef48 } from "react";
|
|
36072
36091
|
import { jsx as jsx279, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
36073
36092
|
function StickySectionNav({
|
|
36074
36093
|
sections,
|
|
@@ -36130,7 +36149,7 @@ function StickySectionNav({
|
|
|
36130
36149
|
}
|
|
36131
36150
|
function useSectionNavigation(sections, options) {
|
|
36132
36151
|
const [activeSection, setActiveSection] = useState87(sections[0]?.id || "");
|
|
36133
|
-
const isScrollingFromClick =
|
|
36152
|
+
const isScrollingFromClick = useRef48(false);
|
|
36134
36153
|
const { offset: offset2 = 100 } = options || {};
|
|
36135
36154
|
const handleSectionClick = useCallback35((sectionId) => {
|
|
36136
36155
|
const targetElement = document.getElementById(sectionId);
|
|
@@ -36830,10 +36849,10 @@ function NotificationsHeaderButton({
|
|
|
36830
36849
|
}
|
|
36831
36850
|
|
|
36832
36851
|
// src/components/navigation/app-layout.tsx
|
|
36833
|
-
import { Suspense as Suspense2, useCallback as useCallback38, useMemo as useMemo35, useRef as
|
|
36852
|
+
import { Suspense as Suspense2, useCallback as useCallback38, useMemo as useMemo35, useRef as useRef50, useState as useState89 } from "react";
|
|
36834
36853
|
|
|
36835
36854
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
36836
|
-
import React113, { useCallback as useCallback37, useRef as
|
|
36855
|
+
import React113, { useCallback as useCallback37, useRef as useRef49 } from "react";
|
|
36837
36856
|
import { usePreventScroll as usePreventScroll5 } from "@react-aria/overlays";
|
|
36838
36857
|
import { Fragment as Fragment55, jsx as jsx288, jsxs as jsxs226 } from "react/jsx-runtime";
|
|
36839
36858
|
var HEADER_HEIGHT = 48;
|
|
@@ -36847,7 +36866,7 @@ var MobileBurgerMenu = React113.memo(function MobileBurgerMenu2({
|
|
|
36847
36866
|
onLogout,
|
|
36848
36867
|
disabled = false
|
|
36849
36868
|
}) {
|
|
36850
|
-
const panelRef =
|
|
36869
|
+
const panelRef = useRef49(null);
|
|
36851
36870
|
usePreventScroll5({ isDisabled: !isOpen });
|
|
36852
36871
|
useFocusTrap(panelRef, isOpen, { onEscape: onClose });
|
|
36853
36872
|
const handleItemClick = useCallback37((item) => {
|
|
@@ -37032,9 +37051,9 @@ function AppLayout({
|
|
|
37032
37051
|
}) {
|
|
37033
37052
|
const [mobileMenuOpen, setMobileMenuOpen] = useState89(false);
|
|
37034
37053
|
const [drawerContainer, setDrawerContainer] = useState89(null);
|
|
37035
|
-
const mobileMenuOpenRef =
|
|
37054
|
+
const mobileMenuOpenRef = useRef50(mobileMenuOpen);
|
|
37036
37055
|
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
37037
|
-
const drawerHandlesRef =
|
|
37056
|
+
const drawerHandlesRef = useRef50(/* @__PURE__ */ new Set());
|
|
37038
37057
|
const handleToggleMobileMenu = useCallback38(() => {
|
|
37039
37058
|
const opening = !mobileMenuOpenRef.current;
|
|
37040
37059
|
if (opening) {
|
|
@@ -37661,7 +37680,7 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
37661
37680
|
|
|
37662
37681
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
37663
37682
|
init_button2();
|
|
37664
|
-
import React115, { useRef as
|
|
37683
|
+
import React115, { useRef as useRef51, useCallback as useCallback39 } from "react";
|
|
37665
37684
|
|
|
37666
37685
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
37667
37686
|
import React114 from "react";
|
|
@@ -37785,10 +37804,10 @@ function OnboardingWalkthrough({
|
|
|
37785
37804
|
allStepsComplete,
|
|
37786
37805
|
markMultipleComplete
|
|
37787
37806
|
} = useOnboardingState(storageKey);
|
|
37788
|
-
const hasAutoMarkedRef =
|
|
37789
|
-
const autoMarkingInProgressRef =
|
|
37790
|
-
const lastCompletionStatusRef =
|
|
37791
|
-
const actionInProgressRef =
|
|
37807
|
+
const hasAutoMarkedRef = useRef51(false);
|
|
37808
|
+
const autoMarkingInProgressRef = useRef51(false);
|
|
37809
|
+
const lastCompletionStatusRef = useRef51(null);
|
|
37810
|
+
const actionInProgressRef = useRef51(/* @__PURE__ */ new Set());
|
|
37792
37811
|
React115.useEffect(() => {
|
|
37793
37812
|
if (isLoadingCompletion) {
|
|
37794
37813
|
hasAutoMarkedRef.current = false;
|
|
@@ -38476,7 +38495,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx307(ContentLoader, { ...props, va
|
|
|
38476
38495
|
|
|
38477
38496
|
// src/components/ui/table/table.tsx
|
|
38478
38497
|
init_cn();
|
|
38479
|
-
import { useEffect as useEffect70, useRef as
|
|
38498
|
+
import { useEffect as useEffect70, useRef as useRef53 } from "react";
|
|
38480
38499
|
init_pagination();
|
|
38481
38500
|
init_button2();
|
|
38482
38501
|
|
|
@@ -39236,8 +39255,8 @@ function Table({
|
|
|
39236
39255
|
};
|
|
39237
39256
|
const allSelected = selectedRows.length > 0 && selectedRows.length === data.length;
|
|
39238
39257
|
const someSelected = selectedRows.length > 0 && selectedRows.length < data.length;
|
|
39239
|
-
const sentinelRef =
|
|
39240
|
-
const onLoadMoreRef =
|
|
39258
|
+
const sentinelRef = useRef53(null);
|
|
39259
|
+
const onLoadMoreRef = useRef53(infiniteScroll?.onLoadMore);
|
|
39241
39260
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
39242
39261
|
useEffect70(() => {
|
|
39243
39262
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
@@ -39457,7 +39476,7 @@ import { useMemo as useMemo37 } from "react";
|
|
|
39457
39476
|
|
|
39458
39477
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
39459
39478
|
init_cn();
|
|
39460
|
-
import { useRef as
|
|
39479
|
+
import { useRef as useRef54, useState as useState92, useCallback as useCallback40 } from "react";
|
|
39461
39480
|
import { jsx as jsx319, jsxs as jsxs252 } from "react/jsx-runtime";
|
|
39462
39481
|
function QueryReportTableHeader({
|
|
39463
39482
|
columns,
|
|
@@ -39486,7 +39505,7 @@ function QueryReportTableHeader({
|
|
|
39486
39505
|
);
|
|
39487
39506
|
}
|
|
39488
39507
|
function TruncatedHeaderCell({ value, width }) {
|
|
39489
|
-
const textRef =
|
|
39508
|
+
const textRef = useRef54(null);
|
|
39490
39509
|
const [isTruncated, setIsTruncated] = useState92(false);
|
|
39491
39510
|
const checkTruncation = useCallback40(() => {
|
|
39492
39511
|
const el = textRef.current;
|
|
@@ -39516,7 +39535,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
39516
39535
|
|
|
39517
39536
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
39518
39537
|
init_cn();
|
|
39519
|
-
import { useRef as
|
|
39538
|
+
import { useRef as useRef55, useState as useState93, useCallback as useCallback41 } from "react";
|
|
39520
39539
|
import { jsx as jsx320, jsxs as jsxs253 } from "react/jsx-runtime";
|
|
39521
39540
|
function QueryReportTableRow({
|
|
39522
39541
|
row,
|
|
@@ -39562,7 +39581,7 @@ function QueryReportTableRow({
|
|
|
39562
39581
|
);
|
|
39563
39582
|
}
|
|
39564
39583
|
function TruncatedCell({ value, className }) {
|
|
39565
|
-
const textRef =
|
|
39584
|
+
const textRef = useRef55(null);
|
|
39566
39585
|
const [isTruncated, setIsTruncated] = useState93(false);
|
|
39567
39586
|
const checkTruncation = useCallback41(() => {
|
|
39568
39587
|
const el = textRef.current;
|
|
@@ -40064,7 +40083,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
40064
40083
|
// src/components/ui/data-table/data-table-row.tsx
|
|
40065
40084
|
init_next_link();
|
|
40066
40085
|
init_cn();
|
|
40067
|
-
import { memo as memo5, useCallback as useCallback43, useRef as
|
|
40086
|
+
import { memo as memo5, useCallback as useCallback43, useRef as useRef56 } from "react";
|
|
40068
40087
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
40069
40088
|
|
|
40070
40089
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -40149,7 +40168,7 @@ function DataTableRowImpl({
|
|
|
40149
40168
|
const hasSubRow = subRow != null && subRow !== false;
|
|
40150
40169
|
const isLinkMode = Boolean(href) && !onClick;
|
|
40151
40170
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
40152
|
-
const containerRef =
|
|
40171
|
+
const containerRef = useRef56(null);
|
|
40153
40172
|
const handleClick = useCallback43(
|
|
40154
40173
|
(e) => {
|
|
40155
40174
|
const target = e.target;
|
|
@@ -40317,7 +40336,7 @@ function DataTableBody({
|
|
|
40317
40336
|
}
|
|
40318
40337
|
|
|
40319
40338
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
40320
|
-
import { useEffect as useEffect71, useRef as
|
|
40339
|
+
import { useEffect as useEffect71, useRef as useRef57 } from "react";
|
|
40321
40340
|
import { Fragment as Fragment63, jsx as jsx330, jsxs as jsxs261 } from "react/jsx-runtime";
|
|
40322
40341
|
function DataTableInfiniteFooter({
|
|
40323
40342
|
hasNextPage,
|
|
@@ -40326,8 +40345,8 @@ function DataTableInfiniteFooter({
|
|
|
40326
40345
|
skeletonRows = 3,
|
|
40327
40346
|
rootMargin = "200px"
|
|
40328
40347
|
}) {
|
|
40329
|
-
const sentinelRef =
|
|
40330
|
-
const onLoadMoreRef =
|
|
40348
|
+
const sentinelRef = useRef57(null);
|
|
40349
|
+
const onLoadMoreRef = useRef57(onLoadMore);
|
|
40331
40350
|
onLoadMoreRef.current = onLoadMore;
|
|
40332
40351
|
useEffect71(() => {
|
|
40333
40352
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
@@ -40964,7 +40983,7 @@ function FilterList({
|
|
|
40964
40983
|
// src/components/ui/tag-search-input.tsx
|
|
40965
40984
|
import {
|
|
40966
40985
|
useEffect as useEffect73,
|
|
40967
|
-
useRef as
|
|
40986
|
+
useRef as useRef59,
|
|
40968
40987
|
useState as useState95
|
|
40969
40988
|
} from "react";
|
|
40970
40989
|
init_cn();
|
|
@@ -40999,9 +41018,9 @@ function TagSearchInput({
|
|
|
40999
41018
|
limitTags,
|
|
41000
41019
|
placeholder: currentPlaceholder
|
|
41001
41020
|
});
|
|
41002
|
-
const wrapperRef =
|
|
41003
|
-
const hiddenTagsRef =
|
|
41004
|
-
const hiddenTagsPopupRef =
|
|
41021
|
+
const wrapperRef = useRef59(null);
|
|
41022
|
+
const hiddenTagsRef = useRef59(null);
|
|
41023
|
+
const hiddenTagsPopupRef = useRef59(null);
|
|
41005
41024
|
const [showHiddenTags, setShowHiddenTags] = useState95(false);
|
|
41006
41025
|
useEffect73(() => {
|
|
41007
41026
|
if (!showHiddenTags) return;
|
|
@@ -41158,7 +41177,7 @@ function TagSearchInput({
|
|
|
41158
41177
|
}
|
|
41159
41178
|
|
|
41160
41179
|
// src/components/ui/markdown-editor.tsx
|
|
41161
|
-
import { useRef as
|
|
41180
|
+
import { useRef as useRef60, useCallback as useCallback44, useState as useState96, useEffect as useEffect74 } from "react";
|
|
41162
41181
|
init_cn();
|
|
41163
41182
|
import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
|
|
41164
41183
|
import { jsx as jsx335, jsxs as jsxs266 } from "react/jsx-runtime";
|
|
@@ -41213,7 +41232,7 @@ function MarkdownEditor({
|
|
|
41213
41232
|
onFileUploaded,
|
|
41214
41233
|
renderPreview
|
|
41215
41234
|
}) {
|
|
41216
|
-
const fileInputRef =
|
|
41235
|
+
const fileInputRef = useRef60(null);
|
|
41217
41236
|
const [isUploading, setIsUploading] = useState96(false);
|
|
41218
41237
|
const [uploadProgress, setUploadProgress] = useState96("");
|
|
41219
41238
|
const [defaultExtraCommands, setDefaultExtraCommands] = useState96([]);
|
|
@@ -41306,11 +41325,11 @@ function MarkdownEditor({
|
|
|
41306
41325
|
}
|
|
41307
41326
|
} : null;
|
|
41308
41327
|
const extraCommands = uploadCommand ? [...defaultExtraCommands, uploadCommand] : defaultExtraCommands;
|
|
41309
|
-
const wrapperRef =
|
|
41310
|
-
const isDraggingRef =
|
|
41311
|
-
const mouseYRef =
|
|
41312
|
-
const rafRef =
|
|
41313
|
-
const scrollParentRef =
|
|
41328
|
+
const wrapperRef = useRef60(null);
|
|
41329
|
+
const isDraggingRef = useRef60(false);
|
|
41330
|
+
const mouseYRef = useRef60(0);
|
|
41331
|
+
const rafRef = useRef60(0);
|
|
41332
|
+
const scrollParentRef = useRef60(window);
|
|
41314
41333
|
const EDGE_ZONE = 60;
|
|
41315
41334
|
const MAX_SCROLL_SPEED = 15;
|
|
41316
41335
|
const findScrollParent = useCallback44((el) => {
|
|
@@ -46913,7 +46932,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
46913
46932
|
}
|
|
46914
46933
|
|
|
46915
46934
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
46916
|
-
import { useCallback as useCallback46, useRef as
|
|
46935
|
+
import { useCallback as useCallback46, useRef as useRef64 } from "react";
|
|
46917
46936
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
46918
46937
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
46919
46938
|
}
|
|
@@ -46935,22 +46954,22 @@ function useChunkCatchup({
|
|
|
46935
46954
|
chatTypes = [CHAT_TYPE.CLIENT],
|
|
46936
46955
|
fetchChunks
|
|
46937
46956
|
}) {
|
|
46938
|
-
const processedSequenceKeys =
|
|
46939
|
-
const lastSequenceId =
|
|
46940
|
-
const lastSequenceIdByType =
|
|
46941
|
-
const fetchingInProgress =
|
|
46942
|
-
const lastFetchParams =
|
|
46943
|
-
const pendingCatchupRef =
|
|
46944
|
-
const chunkBuffer =
|
|
46945
|
-
const bufferUntilInitialCatchupComplete =
|
|
46946
|
-
const hasCompletedInitialCatchup =
|
|
46947
|
-
const dialogIdRef =
|
|
46957
|
+
const processedSequenceKeys = useRef64(/* @__PURE__ */ new Set());
|
|
46958
|
+
const lastSequenceId = useRef64(null);
|
|
46959
|
+
const lastSequenceIdByType = useRef64(/* @__PURE__ */ new Map());
|
|
46960
|
+
const fetchingInProgress = useRef64(false);
|
|
46961
|
+
const lastFetchParams = useRef64(null);
|
|
46962
|
+
const pendingCatchupRef = useRef64(null);
|
|
46963
|
+
const chunkBuffer = useRef64([]);
|
|
46964
|
+
const bufferUntilInitialCatchupComplete = useRef64(false);
|
|
46965
|
+
const hasCompletedInitialCatchup = useRef64(false);
|
|
46966
|
+
const dialogIdRef = useRef64(dialogId);
|
|
46948
46967
|
dialogIdRef.current = dialogId;
|
|
46949
|
-
const chatTypesRef =
|
|
46968
|
+
const chatTypesRef = useRef64(chatTypes);
|
|
46950
46969
|
chatTypesRef.current = chatTypes;
|
|
46951
|
-
const fetchChunksRef =
|
|
46970
|
+
const fetchChunksRef = useRef64(fetchChunks);
|
|
46952
46971
|
fetchChunksRef.current = fetchChunks;
|
|
46953
|
-
const onChunkReceivedRef =
|
|
46972
|
+
const onChunkReceivedRef = useRef64(onChunkReceived);
|
|
46954
46973
|
onChunkReceivedRef.current = onChunkReceived;
|
|
46955
46974
|
const processChunk = useCallback46((chunk, messageType, forceProcess = false) => {
|
|
46956
46975
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
@@ -47147,7 +47166,7 @@ function useChunkCatchup({
|
|
|
47147
47166
|
}
|
|
47148
47167
|
}
|
|
47149
47168
|
}, [flushBufferedRealtimeChunks]);
|
|
47150
|
-
const catchUpChunksRef =
|
|
47169
|
+
const catchUpChunksRef = useRef64(null);
|
|
47151
47170
|
catchUpChunksRef.current = catchUpChunks;
|
|
47152
47171
|
const resetChunkTracking = useCallback46(() => {
|
|
47153
47172
|
processedSequenceKeys.current.clear();
|
|
@@ -47226,7 +47245,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47226
47245
|
}
|
|
47227
47246
|
|
|
47228
47247
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
47229
|
-
import { useEffect as useEffect79, useRef as
|
|
47248
|
+
import { useEffect as useEffect79, useRef as useRef65, useState as useState107 } from "react";
|
|
47230
47249
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
47231
47250
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
47232
47251
|
function useJetStreamDialogSubscription({
|
|
@@ -47249,51 +47268,51 @@ function useJetStreamDialogSubscription({
|
|
|
47249
47268
|
const [isSubscribed, setIsSubscribed] = useState107(false);
|
|
47250
47269
|
const [reconnectionCount, setReconnectionCount] = useState107(0);
|
|
47251
47270
|
const [currentStreamSeq, setCurrentStreamSeq] = useState107(null);
|
|
47252
|
-
const clientRef =
|
|
47253
|
-
const subscriptionRef =
|
|
47254
|
-
const highestStreamSeqRef =
|
|
47255
|
-
const onEventRef =
|
|
47271
|
+
const clientRef = useRef65(null);
|
|
47272
|
+
const subscriptionRef = useRef65(null);
|
|
47273
|
+
const highestStreamSeqRef = useRef65(null);
|
|
47274
|
+
const onEventRef = useRef65(onEvent);
|
|
47256
47275
|
useEffect79(() => {
|
|
47257
47276
|
onEventRef.current = onEvent;
|
|
47258
47277
|
}, [onEvent]);
|
|
47259
|
-
const onConnectRef =
|
|
47278
|
+
const onConnectRef = useRef65(onConnect);
|
|
47260
47279
|
useEffect79(() => {
|
|
47261
47280
|
onConnectRef.current = onConnect;
|
|
47262
47281
|
}, [onConnect]);
|
|
47263
|
-
const onDisconnectRef =
|
|
47282
|
+
const onDisconnectRef = useRef65(onDisconnect);
|
|
47264
47283
|
useEffect79(() => {
|
|
47265
47284
|
onDisconnectRef.current = onDisconnect;
|
|
47266
47285
|
}, [onDisconnect]);
|
|
47267
|
-
const onSubscribedRef =
|
|
47286
|
+
const onSubscribedRef = useRef65(onSubscribed);
|
|
47268
47287
|
useEffect79(() => {
|
|
47269
47288
|
onSubscribedRef.current = onSubscribed;
|
|
47270
47289
|
}, [onSubscribed]);
|
|
47271
|
-
const onBeforeReconnectRef =
|
|
47290
|
+
const onBeforeReconnectRef = useRef65(onBeforeReconnect);
|
|
47272
47291
|
useEffect79(() => {
|
|
47273
47292
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47274
47293
|
}, [onBeforeReconnect]);
|
|
47275
|
-
const getNatsWsUrlRef =
|
|
47294
|
+
const getNatsWsUrlRef = useRef65(getNatsWsUrl);
|
|
47276
47295
|
useEffect79(() => {
|
|
47277
47296
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47278
47297
|
}, [getNatsWsUrl]);
|
|
47279
|
-
const reconnectionBackoffRef =
|
|
47298
|
+
const reconnectionBackoffRef = useRef65(reconnectionBackoff);
|
|
47280
47299
|
useEffect79(() => {
|
|
47281
47300
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47282
47301
|
}, [reconnectionBackoff]);
|
|
47283
|
-
const optStartSeqRef =
|
|
47302
|
+
const optStartSeqRef = useRef65(optStartSeq);
|
|
47284
47303
|
useEffect79(() => {
|
|
47285
47304
|
optStartSeqRef.current = optStartSeq;
|
|
47286
47305
|
}, [optStartSeq]);
|
|
47287
|
-
const inactiveThresholdRef =
|
|
47306
|
+
const inactiveThresholdRef = useRef65(inactiveThresholdMs);
|
|
47288
47307
|
useEffect79(() => {
|
|
47289
47308
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
47290
47309
|
}, [inactiveThresholdMs]);
|
|
47291
|
-
const hadConnectionBeforeRef =
|
|
47292
|
-
const clientConfigRef =
|
|
47310
|
+
const hadConnectionBeforeRef = useRef65(false);
|
|
47311
|
+
const clientConfigRef = useRef65(clientConfig);
|
|
47293
47312
|
useEffect79(() => {
|
|
47294
47313
|
clientConfigRef.current = clientConfig;
|
|
47295
47314
|
}, [clientConfig]);
|
|
47296
|
-
const currentWsUrlRef =
|
|
47315
|
+
const currentWsUrlRef = useRef65("");
|
|
47297
47316
|
const wsUrl = getNatsWsUrl();
|
|
47298
47317
|
useEffect79(() => {
|
|
47299
47318
|
if (!enabled || !wsUrl) {
|
|
@@ -47467,7 +47486,7 @@ function useJetStreamDialogSubscription({
|
|
|
47467
47486
|
}
|
|
47468
47487
|
|
|
47469
47488
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
47470
|
-
import { useEffect as useEffect80, useRef as
|
|
47489
|
+
import { useEffect as useEffect80, useRef as useRef66, useState as useState108 } from "react";
|
|
47471
47490
|
function useNatsDialogSubscription({
|
|
47472
47491
|
enabled,
|
|
47473
47492
|
dialogId,
|
|
@@ -47484,42 +47503,42 @@ function useNatsDialogSubscription({
|
|
|
47484
47503
|
const [isConnected, setIsConnected] = useState108(false);
|
|
47485
47504
|
const [isSubscribed, setIsSubscribed] = useState108(false);
|
|
47486
47505
|
const [reconnectionCount, setReconnectionCount] = useState108(0);
|
|
47487
|
-
const clientRef =
|
|
47488
|
-
const subscriptionRefs =
|
|
47489
|
-
const onEventRef =
|
|
47506
|
+
const clientRef = useRef66(null);
|
|
47507
|
+
const subscriptionRefs = useRef66(/* @__PURE__ */ new Map());
|
|
47508
|
+
const onEventRef = useRef66(onEvent);
|
|
47490
47509
|
useEffect80(() => {
|
|
47491
47510
|
onEventRef.current = onEvent;
|
|
47492
47511
|
}, [onEvent]);
|
|
47493
|
-
const onConnectRef =
|
|
47512
|
+
const onConnectRef = useRef66(onConnect);
|
|
47494
47513
|
useEffect80(() => {
|
|
47495
47514
|
onConnectRef.current = onConnect;
|
|
47496
47515
|
}, [onConnect]);
|
|
47497
|
-
const onDisconnectRef =
|
|
47516
|
+
const onDisconnectRef = useRef66(onDisconnect);
|
|
47498
47517
|
useEffect80(() => {
|
|
47499
47518
|
onDisconnectRef.current = onDisconnect;
|
|
47500
47519
|
}, [onDisconnect]);
|
|
47501
|
-
const onSubscribedRef =
|
|
47520
|
+
const onSubscribedRef = useRef66(onSubscribed);
|
|
47502
47521
|
useEffect80(() => {
|
|
47503
47522
|
onSubscribedRef.current = onSubscribed;
|
|
47504
47523
|
}, [onSubscribed]);
|
|
47505
|
-
const onBeforeReconnectRef =
|
|
47524
|
+
const onBeforeReconnectRef = useRef66(onBeforeReconnect);
|
|
47506
47525
|
useEffect80(() => {
|
|
47507
47526
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47508
47527
|
}, [onBeforeReconnect]);
|
|
47509
|
-
const hadConnectionBeforeRef =
|
|
47510
|
-
const getNatsWsUrlRef =
|
|
47528
|
+
const hadConnectionBeforeRef = useRef66(false);
|
|
47529
|
+
const getNatsWsUrlRef = useRef66(getNatsWsUrl);
|
|
47511
47530
|
useEffect80(() => {
|
|
47512
47531
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47513
47532
|
}, [getNatsWsUrl]);
|
|
47514
|
-
const reconnectionBackoffRef =
|
|
47533
|
+
const reconnectionBackoffRef = useRef66(reconnectionBackoff);
|
|
47515
47534
|
useEffect80(() => {
|
|
47516
47535
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47517
47536
|
}, [reconnectionBackoff]);
|
|
47518
|
-
const clientConfigRef =
|
|
47537
|
+
const clientConfigRef = useRef66(clientConfig);
|
|
47519
47538
|
useEffect80(() => {
|
|
47520
47539
|
clientConfigRef.current = clientConfig;
|
|
47521
47540
|
}, [clientConfig]);
|
|
47522
|
-
const currentWsUrlRef =
|
|
47541
|
+
const currentWsUrlRef = useRef66("");
|
|
47523
47542
|
const wsUrl = getNatsWsUrl();
|
|
47524
47543
|
useEffect80(() => {
|
|
47525
47544
|
if (!enabled || !wsUrl) {
|
|
@@ -47603,15 +47622,15 @@ function useNatsDialogSubscription({
|
|
|
47603
47622
|
};
|
|
47604
47623
|
}, [enabled, wsUrl]);
|
|
47605
47624
|
const topicsKey = topics.join(",");
|
|
47606
|
-
const topicsRef =
|
|
47625
|
+
const topicsRef = useRef66(topics);
|
|
47607
47626
|
topicsRef.current = topics;
|
|
47608
|
-
const lastSubscribedDialogIdRef =
|
|
47609
|
-
const isConnectedRef =
|
|
47627
|
+
const lastSubscribedDialogIdRef = useRef66(null);
|
|
47628
|
+
const isConnectedRef = useRef66(isConnected);
|
|
47610
47629
|
useEffect80(() => {
|
|
47611
47630
|
isConnectedRef.current = isConnected;
|
|
47612
47631
|
}, [isConnected]);
|
|
47613
|
-
const currentDialogIdRef =
|
|
47614
|
-
const abortControllerRef =
|
|
47632
|
+
const currentDialogIdRef = useRef66(null);
|
|
47633
|
+
const abortControllerRef = useRef66(null);
|
|
47615
47634
|
useEffect80(() => {
|
|
47616
47635
|
currentDialogIdRef.current = dialogId;
|
|
47617
47636
|
if (!enabled || !dialogId) {
|
|
@@ -47743,7 +47762,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
47743
47762
|
}
|
|
47744
47763
|
|
|
47745
47764
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
47746
|
-
import { useCallback as useCallback47, useRef as
|
|
47765
|
+
import { useCallback as useCallback47, useRef as useRef67, useEffect as useEffect81 } from "react";
|
|
47747
47766
|
|
|
47748
47767
|
// src/components/chat/utils/chunk-parser.ts
|
|
47749
47768
|
function normalizeToolCalls(raw) {
|
|
@@ -48398,13 +48417,13 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48398
48417
|
batchApprovalsEnabled = true,
|
|
48399
48418
|
isDirectMode = false
|
|
48400
48419
|
} = options;
|
|
48401
|
-
const accumulatorRef =
|
|
48420
|
+
const accumulatorRef = useRef67(
|
|
48402
48421
|
createMessageSegmentAccumulator({
|
|
48403
48422
|
onApprove: callbacks.onApprove,
|
|
48404
48423
|
onReject: callbacks.onReject
|
|
48405
48424
|
})
|
|
48406
48425
|
);
|
|
48407
|
-
const hasInitializedWithData =
|
|
48426
|
+
const hasInitializedWithData = useRef67(false);
|
|
48408
48427
|
useEffect81(() => {
|
|
48409
48428
|
if (initialState && !hasInitializedWithData.current) {
|
|
48410
48429
|
accumulatorRef.current.initializeWithState(initialState);
|
|
@@ -48418,15 +48437,15 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48418
48437
|
hasInitializedWithData.current = true;
|
|
48419
48438
|
}
|
|
48420
48439
|
}, [initialState, callbacks]);
|
|
48421
|
-
const isInStreamRef =
|
|
48422
|
-
const hasEverStreamedRef =
|
|
48423
|
-
const directModeFlagRef =
|
|
48424
|
-
const sawDirectMessageRef =
|
|
48425
|
-
const directTeardownFiredRef =
|
|
48440
|
+
const isInStreamRef = useRef67(false);
|
|
48441
|
+
const hasEverStreamedRef = useRef67(false);
|
|
48442
|
+
const directModeFlagRef = useRef67(isDirectMode);
|
|
48443
|
+
const sawDirectMessageRef = useRef67(false);
|
|
48444
|
+
const directTeardownFiredRef = useRef67(false);
|
|
48426
48445
|
useEffect81(() => {
|
|
48427
48446
|
directModeFlagRef.current = isDirectMode;
|
|
48428
48447
|
}, [isDirectMode]);
|
|
48429
|
-
const pendingEscalatedRef =
|
|
48448
|
+
const pendingEscalatedRef = useRef67(/* @__PURE__ */ new Map());
|
|
48430
48449
|
const processChunk = useCallback47(
|
|
48431
48450
|
(chunk) => {
|
|
48432
48451
|
const action = parseChunkToAction(chunk);
|
|
@@ -48827,7 +48846,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
48827
48846
|
}
|
|
48828
48847
|
|
|
48829
48848
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
48830
|
-
import { useCallback as useCallback48, useMemo as useMemo41, useRef as
|
|
48849
|
+
import { useCallback as useCallback48, useMemo as useMemo41, useRef as useRef68, useState as useState110 } from "react";
|
|
48831
48850
|
import { fileTypeFromBlob } from "file-type";
|
|
48832
48851
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
48833
48852
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -48904,7 +48923,7 @@ function useChatAttachments() {
|
|
|
48904
48923
|
const runtime = useRequiredChatRuntime();
|
|
48905
48924
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
48906
48925
|
const [attachments, setAttachments] = useState110([]);
|
|
48907
|
-
const controllersRef =
|
|
48926
|
+
const controllersRef = useRef68(/* @__PURE__ */ new Map());
|
|
48908
48927
|
const updateOne = useCallback48((id, patch) => {
|
|
48909
48928
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
48910
48929
|
}, []);
|
|
@@ -48993,7 +49012,7 @@ function useChatAttachments() {
|
|
|
48993
49012
|
},
|
|
48994
49013
|
[uploadUrlEndpoint, updateOne]
|
|
48995
49014
|
);
|
|
48996
|
-
const attachmentsRef =
|
|
49015
|
+
const attachmentsRef = useRef68([]);
|
|
48997
49016
|
attachmentsRef.current = attachments;
|
|
48998
49017
|
const addFiles = useCallback48(
|
|
48999
49018
|
(files) => {
|
|
@@ -49070,13 +49089,13 @@ function useChatAttachments() {
|
|
|
49070
49089
|
}
|
|
49071
49090
|
|
|
49072
49091
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
49073
|
-
import { useCallback as useCallback49, useEffect as useEffect83, useRef as
|
|
49092
|
+
import { useCallback as useCallback49, useEffect as useEffect83, useRef as useRef69, useState as useState111 } from "react";
|
|
49074
49093
|
import { jsx as jsx359 } from "react/jsx-runtime";
|
|
49075
49094
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
49076
49095
|
function useChatAttachmentImageGallery() {
|
|
49077
49096
|
const runtime = useRequiredChatRuntime();
|
|
49078
49097
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
49079
|
-
const panelRef =
|
|
49098
|
+
const panelRef = useRef69(null);
|
|
49080
49099
|
const [state, setState] = useState111(CLOSED);
|
|
49081
49100
|
const handleClose = useCallback49(() => setState(CLOSED), []);
|
|
49082
49101
|
useEffect83(() => {
|
|
@@ -49180,10 +49199,10 @@ function useChatIdentity() {
|
|
|
49180
49199
|
}
|
|
49181
49200
|
|
|
49182
49201
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
49183
|
-
import { useEffect as useEffect85, useRef as
|
|
49202
|
+
import { useEffect as useEffect85, useRef as useRef70 } from "react";
|
|
49184
49203
|
function useCloseOnNavigation(close, pathname) {
|
|
49185
|
-
const prevPathnameRef =
|
|
49186
|
-
const initializedRef =
|
|
49204
|
+
const prevPathnameRef = useRef70(null);
|
|
49205
|
+
const initializedRef = useRef70(false);
|
|
49187
49206
|
useEffect85(() => {
|
|
49188
49207
|
if (!initializedRef.current) {
|
|
49189
49208
|
initializedRef.current = true;
|
|
@@ -49198,14 +49217,14 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
49198
49217
|
}
|
|
49199
49218
|
|
|
49200
49219
|
// src/components/chat/hooks/use-chat.ts
|
|
49201
|
-
import { useState as useState114, useCallback as useCallback51, useEffect as useEffect86, useRef as
|
|
49220
|
+
import { useState as useState114, useCallback as useCallback51, useEffect as useEffect86, useRef as useRef72 } from "react";
|
|
49202
49221
|
|
|
49203
49222
|
// src/components/chat/hooks/use-sse.ts
|
|
49204
|
-
import { useState as useState113, useCallback as useCallback50, useRef as
|
|
49223
|
+
import { useState as useState113, useCallback as useCallback50, useRef as useRef71 } from "react";
|
|
49205
49224
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
49206
49225
|
const [isStreaming, setIsStreaming] = useState113(false);
|
|
49207
49226
|
const [error, setError] = useState113(null);
|
|
49208
|
-
const abortControllerRef =
|
|
49227
|
+
const abortControllerRef = useRef71(null);
|
|
49209
49228
|
const fallbackStream = useCallback50(async function* () {
|
|
49210
49229
|
throw new Error(
|
|
49211
49230
|
"[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."
|
|
@@ -49273,8 +49292,8 @@ function useChat({
|
|
|
49273
49292
|
} = {}) {
|
|
49274
49293
|
const [messages, setMessages] = useState114(() => initialMessages ?? []);
|
|
49275
49294
|
const [isTyping, setIsTyping] = useState114(false);
|
|
49276
|
-
const currentAssistantSegmentsRef =
|
|
49277
|
-
const onMessagesChangeRef =
|
|
49295
|
+
const currentAssistantSegmentsRef = useRef72([]);
|
|
49296
|
+
const onMessagesChangeRef = useRef72(onMessagesChange);
|
|
49278
49297
|
onMessagesChangeRef.current = onMessagesChange;
|
|
49279
49298
|
useEffect86(() => {
|
|
49280
49299
|
onMessagesChangeRef.current?.(messages);
|
|
@@ -49565,7 +49584,7 @@ function useChat({
|
|
|
49565
49584
|
}
|
|
49566
49585
|
|
|
49567
49586
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
49568
|
-
import { useState as useState115, useEffect as useEffect87, useCallback as useCallback52, useMemo as useMemo42, useRef as
|
|
49587
|
+
import { useState as useState115, useEffect as useEffect87, useCallback as useCallback52, useMemo as useMemo42, useRef as useRef73 } from "react";
|
|
49569
49588
|
function createEmptyTurnMeta() {
|
|
49570
49589
|
return {
|
|
49571
49590
|
provider: null,
|
|
@@ -49886,20 +49905,20 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
49886
49905
|
const runtime = useRequiredChatRuntime();
|
|
49887
49906
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
49888
49907
|
const tableIdForDocumentType = options?.tableIdForDocumentType ?? defaultTableIdForDocumentType;
|
|
49889
|
-
const persistedRef =
|
|
49908
|
+
const persistedRef = useRef73(null);
|
|
49890
49909
|
if (persistedRef.current === null) {
|
|
49891
49910
|
pruneStaleChatStorage(source);
|
|
49892
49911
|
persistedRef.current = loadPersistedChat(source) || { messages: [], sources: [], sendCount: 0 };
|
|
49893
49912
|
}
|
|
49894
|
-
const sourcesMapRef =
|
|
49913
|
+
const sourcesMapRef = useRef73(
|
|
49895
49914
|
new Map(persistedRef.current.sources)
|
|
49896
49915
|
);
|
|
49897
|
-
const refsMapRef =
|
|
49916
|
+
const refsMapRef = useRef73(
|
|
49898
49917
|
new Map(persistedRef.current.refs ?? [])
|
|
49899
49918
|
);
|
|
49900
|
-
const metaMapRef =
|
|
49901
|
-
const messagesRef =
|
|
49902
|
-
const sendCountRef =
|
|
49919
|
+
const metaMapRef = useRef73(/* @__PURE__ */ new Map());
|
|
49920
|
+
const messagesRef = useRef73(persistedRef.current.messages);
|
|
49921
|
+
const sendCountRef = useRef73(persistedRef.current.sendCount);
|
|
49903
49922
|
const [streamingPhase, setStreamingPhase] = useState115("idle");
|
|
49904
49923
|
const [metaTick, setMetaTick] = useState115(0);
|
|
49905
49924
|
const bumpMetaTick = useCallback52(() => setMetaTick((t) => t + 1), []);
|
|
@@ -50173,7 +50192,7 @@ import {
|
|
|
50173
50192
|
useCallback as useCallback53,
|
|
50174
50193
|
useEffect as useEffect88,
|
|
50175
50194
|
useMemo as useMemo43,
|
|
50176
|
-
useRef as
|
|
50195
|
+
useRef as useRef74,
|
|
50177
50196
|
useState as useState116
|
|
50178
50197
|
} from "react";
|
|
50179
50198
|
|
|
@@ -50858,17 +50877,17 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50858
50877
|
const isManagedMode = fetchDialogs !== void 0;
|
|
50859
50878
|
const [internalDialogId, setInternalDialogId] = useState116(null);
|
|
50860
50879
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
50861
|
-
const currentDialogIdRef =
|
|
50880
|
+
const currentDialogIdRef = useRef74(dialogId);
|
|
50862
50881
|
currentDialogIdRef.current = dialogId;
|
|
50863
50882
|
const [messages, setMessages] = useState116([]);
|
|
50864
50883
|
const [streamingPhase, setStreamingPhase] = useState116("idle");
|
|
50865
|
-
const streamingPhaseRef =
|
|
50884
|
+
const streamingPhaseRef = useRef74(streamingPhase);
|
|
50866
50885
|
streamingPhaseRef.current = streamingPhase;
|
|
50867
|
-
const suppressAgentBusyRef =
|
|
50868
|
-
const adoptTrailingAssistantRef =
|
|
50869
|
-
const hasConnectedOnceRef =
|
|
50870
|
-
const seenParticipantSeqsRef =
|
|
50871
|
-
const pendingEchoTextsRef =
|
|
50886
|
+
const suppressAgentBusyRef = useRef74(0);
|
|
50887
|
+
const adoptTrailingAssistantRef = useRef74(false);
|
|
50888
|
+
const hasConnectedOnceRef = useRef74(false);
|
|
50889
|
+
const seenParticipantSeqsRef = useRef74(/* @__PURE__ */ new Set());
|
|
50890
|
+
const pendingEchoTextsRef = useRef74([]);
|
|
50872
50891
|
const [approvalStatuses, setApprovalStatuses] = useState116({});
|
|
50873
50892
|
const [dialogs, setDialogs] = useState116([]);
|
|
50874
50893
|
const [dialogsNextCursor, setDialogsNextCursor] = useState116(null);
|
|
@@ -50921,9 +50940,9 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50921
50940
|
},
|
|
50922
50941
|
[rejectRequestCallback]
|
|
50923
50942
|
);
|
|
50924
|
-
const handleApproveRef =
|
|
50943
|
+
const handleApproveRef = useRef74(handleApprove);
|
|
50925
50944
|
handleApproveRef.current = handleApprove;
|
|
50926
|
-
const handleRejectRef =
|
|
50945
|
+
const handleRejectRef = useRef74(handleReject);
|
|
50927
50946
|
handleRejectRef.current = handleReject;
|
|
50928
50947
|
const accumApprove = useCallback53((requestId) => {
|
|
50929
50948
|
if (!requestId) return;
|
|
@@ -50933,7 +50952,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50933
50952
|
if (!requestId) return;
|
|
50934
50953
|
return handleRejectRef.current(requestId);
|
|
50935
50954
|
}, []);
|
|
50936
|
-
const callbacksRef =
|
|
50955
|
+
const callbacksRef = useRef74({
|
|
50937
50956
|
onSegmentsUpdate: (segments, meta) => {
|
|
50938
50957
|
if (meta?.append && meta.isCompacting) {
|
|
50939
50958
|
setMessages((prev) => upsertTrailingCompaction(prev, segments));
|
|
@@ -51151,7 +51170,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51151
51170
|
onChunkReceived: (chunk) => processChunk(chunk),
|
|
51152
51171
|
fetchChunks
|
|
51153
51172
|
});
|
|
51154
|
-
const historyLoadSeqRef =
|
|
51173
|
+
const historyLoadSeqRef = useRef74(0);
|
|
51155
51174
|
const loadDialogHistory = useCallback53(
|
|
51156
51175
|
async (id, cursor) => {
|
|
51157
51176
|
if (!fetchDialogMessages) return;
|
|
@@ -51210,7 +51229,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51210
51229
|
isBufferingActive
|
|
51211
51230
|
]
|
|
51212
51231
|
);
|
|
51213
|
-
const prevDialogIdRef =
|
|
51232
|
+
const prevDialogIdRef = useRef74(void 0);
|
|
51214
51233
|
useEffect88(() => {
|
|
51215
51234
|
if (prevDialogIdRef.current === dialogId) return;
|
|
51216
51235
|
prevDialogIdRef.current = dialogId;
|
|
@@ -51287,7 +51306,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51287
51306
|
}
|
|
51288
51307
|
setConnectionState("connecting");
|
|
51289
51308
|
}, [active, dialogId]);
|
|
51290
|
-
const initialDialogsLoadedRef =
|
|
51309
|
+
const initialDialogsLoadedRef = useRef74(false);
|
|
51291
51310
|
const loadDialogsPage = useCallback53(
|
|
51292
51311
|
async (cursor) => {
|
|
51293
51312
|
if (!fetchDialogs) return;
|
|
@@ -51562,7 +51581,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51562
51581
|
}
|
|
51563
51582
|
|
|
51564
51583
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
51565
|
-
import { useCallback as useCallback54, useMemo as useMemo44, useRef as
|
|
51584
|
+
import { useCallback as useCallback54, useMemo as useMemo44, useRef as useRef75 } from "react";
|
|
51566
51585
|
var EMPTY_SSE_OPTIONS = {};
|
|
51567
51586
|
function createDisabledNatsConfig() {
|
|
51568
51587
|
return {
|
|
@@ -51577,7 +51596,7 @@ function createDisabledNatsConfig() {
|
|
|
51577
51596
|
}
|
|
51578
51597
|
function useUnifiedChat(options) {
|
|
51579
51598
|
const { modes, activeMode, mingoStateOverride } = options;
|
|
51580
|
-
const disabledNatsRef =
|
|
51599
|
+
const disabledNatsRef = useRef75(null);
|
|
51581
51600
|
if (disabledNatsRef.current === null) {
|
|
51582
51601
|
disabledNatsRef.current = createDisabledNatsConfig();
|
|
51583
51602
|
}
|
|
@@ -51591,7 +51610,7 @@ function useUnifiedChat(options) {
|
|
|
51591
51610
|
{ active: natsActive }
|
|
51592
51611
|
);
|
|
51593
51612
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
51594
|
-
const activeStateRef =
|
|
51613
|
+
const activeStateRef = useRef75(activeState);
|
|
51595
51614
|
activeStateRef.current = activeState;
|
|
51596
51615
|
const stopMessage = useCallback54(() => activeStateRef.current.stopMessage(), []);
|
|
51597
51616
|
const clearMessages = useCallback54(
|
|
@@ -51901,7 +51920,7 @@ function buildStreamFrames(messages) {
|
|
|
51901
51920
|
|
|
51902
51921
|
// src/components/chat/embeddable-chat.tsx
|
|
51903
51922
|
init_cn();
|
|
51904
|
-
import { useCallback as useCallback56, useEffect as useEffect89, useMemo as useMemo46, useRef as
|
|
51923
|
+
import { useCallback as useCallback56, useEffect as useEffect89, useMemo as useMemo46, useRef as useRef77, useState as useState118 } from "react";
|
|
51905
51924
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
51906
51925
|
import { usePreventScroll as usePreventScroll6 } from "@react-aria/overlays";
|
|
51907
51926
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -51982,7 +52001,7 @@ init_button2();
|
|
|
51982
52001
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
51983
52002
|
|
|
51984
52003
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
51985
|
-
import { useCallback as useCallback55, useMemo as useMemo45, useRef as
|
|
52004
|
+
import { useCallback as useCallback55, useMemo as useMemo45, useRef as useRef76, useState as useState117 } from "react";
|
|
51986
52005
|
function useChatDialogManager({
|
|
51987
52006
|
dialogs,
|
|
51988
52007
|
activeDialogId,
|
|
@@ -52022,7 +52041,7 @@ function useChatDialogManager({
|
|
|
52022
52041
|
const [archivedCursor, setArchivedCursor] = useState117(null);
|
|
52023
52042
|
const [archivedLoading, setArchivedLoading] = useState117(false);
|
|
52024
52043
|
const [archivedPending, setArchivedPending] = useState117(false);
|
|
52025
|
-
const archivedRequestIdRef =
|
|
52044
|
+
const archivedRequestIdRef = useRef76(0);
|
|
52026
52045
|
const loadArchivedPage = useCallback55(
|
|
52027
52046
|
async (cursor) => {
|
|
52028
52047
|
if (!fetchArchivedDialogs) return;
|
|
@@ -52519,7 +52538,7 @@ function EmbeddableChatInner({
|
|
|
52519
52538
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
52520
52539
|
});
|
|
52521
52540
|
usePreventScroll6({ isDisabled: !isOpen || shellLess });
|
|
52522
|
-
const navigatingAwayRef =
|
|
52541
|
+
const navigatingAwayRef = useRef77(false);
|
|
52523
52542
|
useEffect89(() => {
|
|
52524
52543
|
if (!isOpen) return;
|
|
52525
52544
|
if (shellLess) return;
|
|
@@ -52546,7 +52565,7 @@ function EmbeddableChatInner({
|
|
|
52546
52565
|
window.scrollTo(0, scrollY);
|
|
52547
52566
|
};
|
|
52548
52567
|
}, [isOpen, shellLess]);
|
|
52549
|
-
const chatInputRef =
|
|
52568
|
+
const chatInputRef = useRef77(null);
|
|
52550
52569
|
const [quickActionPreview, setQuickActionPreview] = useState118(null);
|
|
52551
52570
|
const slashCommandsProp = useMemo46(
|
|
52552
52571
|
() => ({
|
|
@@ -52650,7 +52669,7 @@ function EmbeddableChatInner({
|
|
|
52650
52669
|
hasMoreMessages,
|
|
52651
52670
|
loadMoreMessages
|
|
52652
52671
|
} = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
|
|
52653
|
-
const guidePromptSentRef =
|
|
52672
|
+
const guidePromptSentRef = useRef77(false);
|
|
52654
52673
|
useEffect89(() => {
|
|
52655
52674
|
if (!guidePendingPrompt) {
|
|
52656
52675
|
guidePromptSentRef.current = false;
|
|
@@ -52675,11 +52694,11 @@ function EmbeddableChatInner({
|
|
|
52675
52694
|
const [contextItems, setContextItems] = useState118([]);
|
|
52676
52695
|
const [contextPickerOpen, setContextPickerOpen] = useState118(false);
|
|
52677
52696
|
const [mentionQuery, setMentionQuery] = useState118(null);
|
|
52678
|
-
const mentionActiveRef =
|
|
52697
|
+
const mentionActiveRef = useRef77(false);
|
|
52679
52698
|
useEffect89(() => {
|
|
52680
52699
|
mentionActiveRef.current = mentionQuery !== null;
|
|
52681
52700
|
}, [mentionQuery]);
|
|
52682
|
-
const mentionKeysRef =
|
|
52701
|
+
const mentionKeysRef = useRef77(/* @__PURE__ */ new Set());
|
|
52683
52702
|
useEffect89(() => {
|
|
52684
52703
|
setContextItems([]);
|
|
52685
52704
|
setMentionQuery(null);
|
|
@@ -52776,7 +52795,7 @@ function EmbeddableChatInner({
|
|
|
52776
52795
|
() => effectiveAssistantIcon ? /* @__PURE__ */ jsx362(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx362(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
52777
52796
|
[effectiveAssistantIcon]
|
|
52778
52797
|
);
|
|
52779
|
-
const timestampCacheRef =
|
|
52798
|
+
const timestampCacheRef = useRef77(/* @__PURE__ */ new Map());
|
|
52780
52799
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
52781
52800
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
52782
52801
|
const messages = useMemo46(() => {
|
|
@@ -52974,7 +52993,7 @@ function EmbeddableChatInner({
|
|
|
52974
52993
|
}, [lastAssistantMsg, chatLoading]);
|
|
52975
52994
|
const [portalHost, setPortalHost] = useState118(null);
|
|
52976
52995
|
const [panelWidth, setPanelWidth] = useState118(0);
|
|
52977
|
-
const panelMeasureRef =
|
|
52996
|
+
const panelMeasureRef = useRef77(null);
|
|
52978
52997
|
useEffect89(() => {
|
|
52979
52998
|
const el = panelMeasureRef.current;
|
|
52980
52999
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -54519,4 +54538,4 @@ export {
|
|
|
54519
54538
|
LogsList,
|
|
54520
54539
|
assets
|
|
54521
54540
|
};
|
|
54522
|
-
//# sourceMappingURL=chunk-
|
|
54541
|
+
//# sourceMappingURL=chunk-3BHV2QAH.js.map
|