@flamingo-stack/openframe-frontend-core 0.0.460 → 0.0.461-snapshot.20260721140205
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-6NACOLUM.cjs → chunk-4KD6NQDK.cjs} +37 -37
- package/dist/{chunk-6NACOLUM.cjs.map → chunk-4KD6NQDK.cjs.map} +1 -1
- package/dist/{chunk-BOPT23N4.js → chunk-4KKY7ZUY.js} +4 -4
- package/dist/{chunk-AQNZOW6H.js → chunk-66XFCYRE.js} +2 -2
- package/dist/{chunk-KG6VKWRF.cjs → chunk-BN5T3OP6.cjs} +9 -9
- package/dist/{chunk-KG6VKWRF.cjs.map → chunk-BN5T3OP6.cjs.map} +1 -1
- package/dist/{chunk-ZODNSYZC.cjs → chunk-CARCB5BE.cjs} +11 -11
- package/dist/{chunk-ZODNSYZC.cjs.map → chunk-CARCB5BE.cjs.map} +1 -1
- package/dist/{chunk-2KRAHL2J.cjs → chunk-DNUF7SJD.cjs} +31 -31
- package/dist/{chunk-2KRAHL2J.cjs.map → chunk-DNUF7SJD.cjs.map} +1 -1
- package/dist/{chunk-NWHCBXRQ.js → chunk-FRXDTBA2.js} +2 -2
- package/dist/{chunk-5AUOHZWP.js → chunk-GGPVPGIB.js} +4 -4
- package/dist/{chunk-32N6U2Z2.cjs → chunk-HJWJLRSU.cjs} +26 -26
- package/dist/{chunk-32N6U2Z2.cjs.map → chunk-HJWJLRSU.cjs.map} +1 -1
- package/dist/{chunk-HFTBMWAO.cjs → chunk-JCCVQ3PN.cjs} +32 -3
- package/dist/chunk-JCCVQ3PN.cjs.map +1 -0
- package/dist/{chunk-GTJJ4Y7Z.cjs → chunk-JOW3AEZZ.cjs} +15 -15
- package/dist/{chunk-GTJJ4Y7Z.cjs.map → chunk-JOW3AEZZ.cjs.map} +1 -1
- package/dist/{chunk-7VNAK2TM.cjs → chunk-LE7N2KEE.cjs} +7 -7
- package/dist/{chunk-7VNAK2TM.cjs.map → chunk-LE7N2KEE.cjs.map} +1 -1
- package/dist/{chunk-YWMHHI3V.js → chunk-MBHZJTZC.js} +4 -4
- package/dist/{chunk-OMY4PRE3.js → chunk-N27ZOEDU.js} +2 -2
- package/dist/{chunk-ITCV37Q2.js → chunk-OYYGSA3W.js} +2 -2
- package/dist/{chunk-722A62GL.js → chunk-QO2YQ7V4.js} +4 -4
- package/dist/{chunk-KJOM3JWD.cjs → chunk-RMYT3QCX.cjs} +62 -62
- package/dist/{chunk-KJOM3JWD.cjs.map → chunk-RMYT3QCX.cjs.map} +1 -1
- package/dist/{chunk-NZNF7RCQ.cjs → chunk-RQJGUEQF.cjs} +5 -5
- package/dist/{chunk-NZNF7RCQ.cjs.map → chunk-RQJGUEQF.cjs.map} +1 -1
- package/dist/{chunk-MK5PLTDE.cjs → chunk-WL4QJ7BD.cjs} +26 -26
- package/dist/{chunk-MK5PLTDE.cjs.map → chunk-WL4QJ7BD.cjs.map} +1 -1
- package/dist/{chunk-XFH7PMGS.js → chunk-WSPRJARS.js} +651 -622
- package/dist/chunk-WSPRJARS.js.map +1 -0
- package/dist/{chunk-5IX4BNIY.js → chunk-WUPS5YYG.js} +2 -2
- package/dist/{chunk-IMG46R5G.cjs → chunk-XM3WRNYR.cjs} +59 -59
- package/dist/{chunk-IMG46R5G.cjs.map → chunk-XM3WRNYR.cjs.map} +1 -1
- package/dist/{chunk-3SFYW3J7.js → chunk-ZST5WNYI.js} +2 -2
- package/dist/{chunk-6R3NA5WS.js → chunk-ZV3T47FO.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/chat/quick-action-wall.d.ts.map +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/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/chat/quick-action-wall.tsx +69 -6
- package/src/stories/QuickActionWall.stories.tsx +47 -0
- package/dist/chunk-HFTBMWAO.cjs.map +0 -1
- package/dist/chunk-XFH7PMGS.js.map +0 -1
- /package/dist/{chunk-BOPT23N4.js.map → chunk-4KKY7ZUY.js.map} +0 -0
- /package/dist/{chunk-AQNZOW6H.js.map → chunk-66XFCYRE.js.map} +0 -0
- /package/dist/{chunk-NWHCBXRQ.js.map → chunk-FRXDTBA2.js.map} +0 -0
- /package/dist/{chunk-5AUOHZWP.js.map → chunk-GGPVPGIB.js.map} +0 -0
- /package/dist/{chunk-YWMHHI3V.js.map → chunk-MBHZJTZC.js.map} +0 -0
- /package/dist/{chunk-OMY4PRE3.js.map → chunk-N27ZOEDU.js.map} +0 -0
- /package/dist/{chunk-ITCV37Q2.js.map → chunk-OYYGSA3W.js.map} +0 -0
- /package/dist/{chunk-722A62GL.js.map → chunk-QO2YQ7V4.js.map} +0 -0
- /package/dist/{chunk-5IX4BNIY.js.map → chunk-WUPS5YYG.js.map} +0 -0
- /package/dist/{chunk-3SFYW3J7.js.map → chunk-ZST5WNYI.js.map} +0 -0
- /package/dist/{chunk-6R3NA5WS.js.map → chunk-ZV3T47FO.js.map} +0 -0
|
@@ -7056,6 +7056,10 @@ function interleave(a, b) {
|
|
|
7056
7056
|
return out;
|
|
7057
7057
|
}
|
|
7058
7058
|
var DEFAULT_MIN_CHIPS_PER_ROW = 14;
|
|
7059
|
+
var ADAPTIVE_PAD_MARGIN = 2;
|
|
7060
|
+
var MIN_MEASURED_CHIP_PX = 12;
|
|
7061
|
+
var MIN_ADAPTIVE_PAD = 4;
|
|
7062
|
+
var MAX_ADAPTIVE_PAD = 60;
|
|
7059
7063
|
var AGENT_MAX_ROWS = 2;
|
|
7060
7064
|
function QuickActionWall({
|
|
7061
7065
|
chips,
|
|
@@ -7081,6 +7085,27 @@ function QuickActionWall({
|
|
|
7081
7085
|
contentClassName,
|
|
7082
7086
|
sync
|
|
7083
7087
|
}) {
|
|
7088
|
+
const brickRef = React13.useRef(null);
|
|
7089
|
+
const [brickWidth, setBrickWidth] = React13.useState(0);
|
|
7090
|
+
const [chipWidth, setChipWidth] = React13.useState(0);
|
|
7091
|
+
React13.useEffect(() => {
|
|
7092
|
+
const el = brickRef.current;
|
|
7093
|
+
if (!el) return;
|
|
7094
|
+
const measure = () => {
|
|
7095
|
+
const w = el.offsetWidth;
|
|
7096
|
+
if (w > 0) setBrickWidth((prev) => prev === w ? prev : w);
|
|
7097
|
+
const chips2 = [...el.querySelectorAll("button")].map((b) => b.offsetWidth).filter((x) => x > 0);
|
|
7098
|
+
if (chips2.length > 0) {
|
|
7099
|
+
const min = Math.max(Math.min(...chips2), MIN_MEASURED_CHIP_PX);
|
|
7100
|
+
setChipWidth((prev) => prev === min ? prev : min);
|
|
7101
|
+
}
|
|
7102
|
+
};
|
|
7103
|
+
measure();
|
|
7104
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
7105
|
+
const ro = new ResizeObserver(measure);
|
|
7106
|
+
ro.observe(el);
|
|
7107
|
+
return () => ro.disconnect();
|
|
7108
|
+
}, [chips]);
|
|
7084
7109
|
const padTarget = rows ? void 0 : minChips;
|
|
7085
7110
|
const track = React13.useMemo(() => {
|
|
7086
7111
|
if (!padTarget || chips.length === 0 || chips.length >= padTarget) return chips;
|
|
@@ -7116,7 +7141,11 @@ function QuickActionWall({
|
|
|
7116
7141
|
const rowCap = agentCapped ? Math.min(rows, AGENT_MAX_ROWS) : rows;
|
|
7117
7142
|
const dataRows = agentCapped ? Math.min(Math.max(1, Math.ceil(chips.length / DEFAULT_MIN_CHIPS_PER_ROW)), rowCap) : rows;
|
|
7118
7143
|
const stackRows = loading ? rowCap : dataRows;
|
|
7119
|
-
const
|
|
7144
|
+
const adaptivePerRow = brickWidth > 0 && chipWidth > 0 ? Math.min(
|
|
7145
|
+
Math.max(Math.ceil(brickWidth / chipWidth) + ADAPTIVE_PAD_MARGIN, MIN_ADAPTIVE_PAD),
|
|
7146
|
+
MAX_ADAPTIVE_PAD
|
|
7147
|
+
) : DEFAULT_MIN_CHIPS_PER_ROW;
|
|
7148
|
+
const perRowTarget = minChips ? Math.ceil(minChips / stackRows) : adaptivePerRow;
|
|
7120
7149
|
const rowLists = Array.from({ length: stackRows }, (_, r) => {
|
|
7121
7150
|
const base = chips.filter((_2, i) => i % stackRows === r);
|
|
7122
7151
|
if (base.length === 0 || base.length >= perRowTarget) return base;
|
|
@@ -7127,7 +7156,7 @@ function QuickActionWall({
|
|
|
7127
7156
|
).flat();
|
|
7128
7157
|
});
|
|
7129
7158
|
const skelPerRow = Math.ceil(skeletonCount / stackRows);
|
|
7130
|
-
return /* @__PURE__ */ jsxs29("div", { className: cn("relative flex flex-col overflow-hidden", className), style: { gap }, children: [
|
|
7159
|
+
return /* @__PURE__ */ jsxs29("div", { ref: brickRef, className: cn("relative flex flex-col overflow-hidden", className), style: { gap }, children: [
|
|
7131
7160
|
rowLists.map((list, r) => /* @__PURE__ */ jsx35(
|
|
7132
7161
|
MarqueeWall,
|
|
7133
7162
|
{
|
|
@@ -8206,7 +8235,7 @@ import * as React24 from "react";
|
|
|
8206
8235
|
|
|
8207
8236
|
// src/components/ui/modal-v2.tsx
|
|
8208
8237
|
import * as React23 from "react";
|
|
8209
|
-
import { useEffect as
|
|
8238
|
+
import { useEffect as useEffect12, useState as useState18 } from "react";
|
|
8210
8239
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
8211
8240
|
init_cn();
|
|
8212
8241
|
import { jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
@@ -8214,8 +8243,8 @@ var ANIMATION_DURATION = 200;
|
|
|
8214
8243
|
var ModalContext = React23.createContext({});
|
|
8215
8244
|
var Modal = React23.forwardRef(
|
|
8216
8245
|
({ isOpen, onClose, children, className }, ref) => {
|
|
8217
|
-
const [isMounted, setIsMounted] =
|
|
8218
|
-
|
|
8246
|
+
const [isMounted, setIsMounted] = useState18(isOpen);
|
|
8247
|
+
useEffect12(() => {
|
|
8219
8248
|
if (isOpen) {
|
|
8220
8249
|
setIsMounted(true);
|
|
8221
8250
|
return;
|
|
@@ -8224,7 +8253,7 @@ var Modal = React23.forwardRef(
|
|
|
8224
8253
|
return () => clearTimeout(timeout);
|
|
8225
8254
|
}, [isOpen]);
|
|
8226
8255
|
usePreventScroll({ isDisabled: !isOpen });
|
|
8227
|
-
|
|
8256
|
+
useEffect12(() => {
|
|
8228
8257
|
const handleKeyDown = (event) => {
|
|
8229
8258
|
if (event.key === "Escape") {
|
|
8230
8259
|
onClose();
|
|
@@ -8764,7 +8793,7 @@ function ChatPanelHeader({
|
|
|
8764
8793
|
import * as React29 from "react";
|
|
8765
8794
|
|
|
8766
8795
|
// src/components/chat/chat-attachment-bar.tsx
|
|
8767
|
-
import { useEffect as
|
|
8796
|
+
import { useEffect as useEffect15, useRef as useRef14, useState as useState21 } from "react";
|
|
8768
8797
|
init_button2();
|
|
8769
8798
|
init_cn();
|
|
8770
8799
|
|
|
@@ -8842,7 +8871,7 @@ function ChatAttachmentAddButton({
|
|
|
8842
8871
|
disabled = false,
|
|
8843
8872
|
size: size2 = "default"
|
|
8844
8873
|
}) {
|
|
8845
|
-
const fileInputRef =
|
|
8874
|
+
const fileInputRef = useRef14(null);
|
|
8846
8875
|
const compact = size2 === "compact";
|
|
8847
8876
|
const boxClass = compact ? "h-6 w-6" : "h-7 w-7";
|
|
8848
8877
|
if (!attachmentsEnabled) {
|
|
@@ -8981,8 +9010,8 @@ function extLabel(fileName) {
|
|
|
8981
9010
|
return fileName.slice(dot + 1, dot + 4).toLowerCase();
|
|
8982
9011
|
}
|
|
8983
9012
|
function useObjectUrl(file) {
|
|
8984
|
-
const [url, setUrl] =
|
|
8985
|
-
|
|
9013
|
+
const [url, setUrl] = useState21(null);
|
|
9014
|
+
useEffect15(() => {
|
|
8986
9015
|
if (!file) {
|
|
8987
9016
|
setUrl(null);
|
|
8988
9017
|
return;
|
|
@@ -9387,7 +9416,7 @@ function ChatArchivePage(props) {
|
|
|
9387
9416
|
// src/components/chat/chat-sidebar.tsx
|
|
9388
9417
|
init_cn();
|
|
9389
9418
|
init_button2();
|
|
9390
|
-
import { forwardRef as forwardRef20, useRef as
|
|
9419
|
+
import { forwardRef as forwardRef20, useRef as useRef15, useEffect as useEffect16 } from "react";
|
|
9391
9420
|
|
|
9392
9421
|
// src/components/chat/chat-sidebar-skeleton.tsx
|
|
9393
9422
|
init_cn();
|
|
@@ -9503,13 +9532,13 @@ DialogListItem.displayName = "DialogListItem";
|
|
|
9503
9532
|
var ChatSidebar = forwardRef20(
|
|
9504
9533
|
({ className, onNewChat, onDialogSelect, dialogs = [], activeDialogId, isLoading, isCreatingDialog, children, hasNextPage, isFetchingNextPage, onLoadMore, ...props }, ref) => {
|
|
9505
9534
|
const showEmptyState = dialogs.length === 0 && !children;
|
|
9506
|
-
const scrollContainerRef =
|
|
9507
|
-
const loadMoreRef =
|
|
9508
|
-
const onLoadMoreRef =
|
|
9535
|
+
const scrollContainerRef = useRef15(null);
|
|
9536
|
+
const loadMoreRef = useRef15(null);
|
|
9537
|
+
const onLoadMoreRef = useRef15(onLoadMore);
|
|
9509
9538
|
onLoadMoreRef.current = onLoadMore;
|
|
9510
|
-
const isFetchingRef =
|
|
9539
|
+
const isFetchingRef = useRef15(isFetchingNextPage);
|
|
9511
9540
|
isFetchingRef.current = isFetchingNextPage;
|
|
9512
|
-
|
|
9541
|
+
useEffect16(() => {
|
|
9513
9542
|
const scrollContainer = scrollContainerRef.current;
|
|
9514
9543
|
const loadMoreElement = loadMoreRef.current;
|
|
9515
9544
|
if (!scrollContainer || !loadMoreElement || !hasNextPage) return;
|
|
@@ -9959,7 +9988,7 @@ function BlogImagePlaceholder({
|
|
|
9959
9988
|
}
|
|
9960
9989
|
|
|
9961
9990
|
// src/components/chat/entity-cards/entity-portrait-card.tsx
|
|
9962
|
-
import { useEffect as
|
|
9991
|
+
import { useEffect as useEffect17, useState as useState23 } from "react";
|
|
9963
9992
|
|
|
9964
9993
|
// src/components/ui/card.tsx
|
|
9965
9994
|
init_cn();
|
|
@@ -10120,9 +10149,9 @@ function StatusBadge({
|
|
|
10120
10149
|
}
|
|
10121
10150
|
|
|
10122
10151
|
// src/components/chat/entity-cards/use-cover-image-fallback.ts
|
|
10123
|
-
import { useCallback as useCallback12, useState as
|
|
10152
|
+
import { useCallback as useCallback12, useState as useState22 } from "react";
|
|
10124
10153
|
function useCoverImageFallback(imageUrl, placeholderUrl) {
|
|
10125
|
-
const [failed, setFailed] =
|
|
10154
|
+
const [failed, setFailed] = useState22(() => /* @__PURE__ */ new Set());
|
|
10126
10155
|
const src = imageUrl && !failed.has(imageUrl) ? imageUrl : placeholderUrl && !failed.has(placeholderUrl) ? placeholderUrl : null;
|
|
10127
10156
|
const onError = useCallback12(() => {
|
|
10128
10157
|
if (!src) return;
|
|
@@ -10153,8 +10182,8 @@ function EntityPortraitCard({
|
|
|
10153
10182
|
className
|
|
10154
10183
|
}) {
|
|
10155
10184
|
const { src, onError: onMediaError } = useCoverImageFallback(imageUrl, placeholderUrl);
|
|
10156
|
-
const [isWide, setIsWide] =
|
|
10157
|
-
|
|
10185
|
+
const [isWide, setIsWide] = useState23(null);
|
|
10186
|
+
useEffect17(() => {
|
|
10158
10187
|
setIsWide(null);
|
|
10159
10188
|
}, [src]);
|
|
10160
10189
|
const onMediaLoad = (e) => {
|
|
@@ -10242,7 +10271,7 @@ function EntityPortraitCard({
|
|
|
10242
10271
|
}
|
|
10243
10272
|
|
|
10244
10273
|
// src/components/chat/entity-cards/admin-content-card.tsx
|
|
10245
|
-
import { useState as
|
|
10274
|
+
import { useState as useState24, useEffect as useEffect18 } from "react";
|
|
10246
10275
|
init_cn();
|
|
10247
10276
|
|
|
10248
10277
|
// src/components/features/platform-badge.tsx
|
|
@@ -10467,11 +10496,11 @@ function AdminContentCard({
|
|
|
10467
10496
|
actions,
|
|
10468
10497
|
className
|
|
10469
10498
|
}) {
|
|
10470
|
-
const [imageError, setImageError] =
|
|
10471
|
-
const [imageLoaded, setImageLoaded] =
|
|
10499
|
+
const [imageError, setImageError] = useState24(false);
|
|
10500
|
+
const [imageLoaded, setImageLoaded] = useState24(false);
|
|
10472
10501
|
const displayUrl = imageUrl && !imageError ? imageUrl : placeholderUrl;
|
|
10473
10502
|
const imageBgColor = useImageEdgeColor(displayUrl || null, "transparent");
|
|
10474
|
-
|
|
10503
|
+
useEffect18(() => {
|
|
10475
10504
|
setImageLoaded(false);
|
|
10476
10505
|
}, [displayUrl]);
|
|
10477
10506
|
return /* @__PURE__ */ jsxs55("article", { className: cn(
|
|
@@ -10642,7 +10671,7 @@ var TabsContent = React34.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10642
10671
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
10643
10672
|
|
|
10644
10673
|
// src/components/features/video.tsx
|
|
10645
|
-
import { useCallback as useCallback13, useEffect as
|
|
10674
|
+
import { useCallback as useCallback13, useEffect as useEffect20, useMemo as useMemo15, useRef as useRef16, useState as useState25 } from "react";
|
|
10646
10675
|
import MuxPlayer from "@mux/mux-player-react";
|
|
10647
10676
|
|
|
10648
10677
|
// src/components/features/video-center-badge.tsx
|
|
@@ -10689,7 +10718,7 @@ function fetchPriorityProp(priority) {
|
|
|
10689
10718
|
}
|
|
10690
10719
|
|
|
10691
10720
|
// src/components/features/use-video-warmup.ts
|
|
10692
|
-
import { useEffect as
|
|
10721
|
+
import { useEffect as useEffect19 } from "react";
|
|
10693
10722
|
import ReactDOM from "react-dom";
|
|
10694
10723
|
|
|
10695
10724
|
// src/components/features/mux-origins.ts
|
|
@@ -10741,7 +10770,7 @@ function useVideoWarmup({
|
|
|
10741
10770
|
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10742
10771
|
useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
|
|
10743
10772
|
const { ref, isNear } = useNearViewport(nearMargin);
|
|
10744
|
-
|
|
10773
|
+
useEffect19(() => {
|
|
10745
10774
|
if (!isNear || !videoUrl || !resolvedOrigin) return;
|
|
10746
10775
|
if (saveDataEnabled()) return;
|
|
10747
10776
|
let videoOrigin;
|
|
@@ -10958,9 +10987,9 @@ function FilePlayer({
|
|
|
10958
10987
|
className
|
|
10959
10988
|
}) {
|
|
10960
10989
|
const effectivePreload = preload ?? (saveDataEnabled() ? "none" : "metadata");
|
|
10961
|
-
const [hoverMutedFallback, setHoverMutedFallback] =
|
|
10962
|
-
const hoverPlayerRef =
|
|
10963
|
-
const perfListenerRef =
|
|
10990
|
+
const [hoverMutedFallback, setHoverMutedFallback] = useState25(false);
|
|
10991
|
+
const hoverPlayerRef = useRef16(null);
|
|
10992
|
+
const perfListenerRef = useRef16(null);
|
|
10964
10993
|
const clearPerfListener = useCallback13(() => {
|
|
10965
10994
|
if (perfListenerRef.current) {
|
|
10966
10995
|
try {
|
|
@@ -10970,17 +10999,17 @@ function FilePlayer({
|
|
|
10970
10999
|
perfListenerRef.current = null;
|
|
10971
11000
|
}
|
|
10972
11001
|
}, []);
|
|
10973
|
-
|
|
10974
|
-
const hoverActiveRef =
|
|
10975
|
-
const hoverGenerationRef =
|
|
10976
|
-
const activationWaiterRef =
|
|
11002
|
+
useEffect20(() => clearPerfListener, [clearPerfListener]);
|
|
11003
|
+
const hoverActiveRef = useRef16(false);
|
|
11004
|
+
const hoverGenerationRef = useRef16(0);
|
|
11005
|
+
const activationWaiterRef = useRef16(null);
|
|
10977
11006
|
const clearActivationWaiter = useCallback13(() => {
|
|
10978
11007
|
if (activationWaiterRef.current) {
|
|
10979
11008
|
activationWaiters.delete(activationWaiterRef.current);
|
|
10980
11009
|
activationWaiterRef.current = null;
|
|
10981
11010
|
}
|
|
10982
11011
|
}, []);
|
|
10983
|
-
|
|
11012
|
+
useEffect20(() => clearActivationWaiter, [clearActivationWaiter]);
|
|
10984
11013
|
const startHoverPlayback = useCallback13(() => {
|
|
10985
11014
|
hoverActiveRef.current = true;
|
|
10986
11015
|
const generation = ++hoverGenerationRef.current;
|
|
@@ -11064,7 +11093,7 @@ function FilePlayer({
|
|
|
11064
11093
|
setHoverMutedFallback(false);
|
|
11065
11094
|
}, []);
|
|
11066
11095
|
const hoverControlled = typeof playWhenHovered === "boolean";
|
|
11067
|
-
|
|
11096
|
+
useEffect20(() => {
|
|
11068
11097
|
if (!hoverControlled) return;
|
|
11069
11098
|
if (playWhenHovered) startHoverPlayback();
|
|
11070
11099
|
else stopHoverPlayback();
|
|
@@ -11165,8 +11194,8 @@ function YouTubeFacadeInner({
|
|
|
11165
11194
|
className,
|
|
11166
11195
|
minimalControls
|
|
11167
11196
|
}) {
|
|
11168
|
-
const [activated, setActivated] =
|
|
11169
|
-
const iframeRef =
|
|
11197
|
+
const [activated, setActivated] = useState25(false);
|
|
11198
|
+
const iframeRef = useRef16(null);
|
|
11170
11199
|
const embedUrl = useMemo15(() => {
|
|
11171
11200
|
const params = new URLSearchParams({
|
|
11172
11201
|
autoplay: "1",
|
|
@@ -11187,15 +11216,15 @@ function YouTubeFacadeInner({
|
|
|
11187
11216
|
}
|
|
11188
11217
|
return `${YT_NOCOOKIE_ORIGIN}/embed/${videoId}?${params.toString()}`;
|
|
11189
11218
|
}, [videoId, minimalControls]);
|
|
11190
|
-
const [posterTier, setPosterTier] =
|
|
11191
|
-
|
|
11219
|
+
const [posterTier, setPosterTier] = useState25(0);
|
|
11220
|
+
useEffect20(() => {
|
|
11192
11221
|
setPosterTier(0);
|
|
11193
11222
|
}, [videoId]);
|
|
11194
11223
|
const posterQuality = YT_POSTER_TIERS[posterTier];
|
|
11195
11224
|
const posterJpg = `https://i.ytimg.com/vi/${videoId}/${posterQuality}.jpg`;
|
|
11196
11225
|
const posterWebp = `https://i.ytimg.com/vi_webp/${videoId}/${posterQuality}.webp`;
|
|
11197
11226
|
const handlePosterError = () => setPosterTier((tier) => Math.min(tier + 1, YT_POSTER_TIERS.length - 1));
|
|
11198
|
-
|
|
11227
|
+
useEffect20(() => {
|
|
11199
11228
|
if (!activated) return;
|
|
11200
11229
|
const iframe = iframeRef.current;
|
|
11201
11230
|
if (!iframe) return;
|
|
@@ -11286,7 +11315,7 @@ function YouTubeFacadeInner({
|
|
|
11286
11315
|
|
|
11287
11316
|
// src/components/features/video-bites-strip.tsx
|
|
11288
11317
|
init_cn();
|
|
11289
|
-
import { useMemo as useMemo17, useRef as
|
|
11318
|
+
import { useMemo as useMemo17, useRef as useRef18, useState as useState27, useEffect as useEffect22 } from "react";
|
|
11290
11319
|
|
|
11291
11320
|
// src/components/features/video-ratio-tabs.tsx
|
|
11292
11321
|
import { Fragment as Fragment18, jsx as jsx76, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
@@ -11384,7 +11413,7 @@ function sortBitesByCreatedAtDesc(a, b) {
|
|
|
11384
11413
|
|
|
11385
11414
|
// src/components/features/cards-strip.tsx
|
|
11386
11415
|
init_cn();
|
|
11387
|
-
import React37, { useCallback as useCallback14, useEffect as
|
|
11416
|
+
import React37, { useCallback as useCallback14, useEffect as useEffect21, useMemo as useMemo16, useRef as useRef17, useState as useState26 } from "react";
|
|
11388
11417
|
init_button2();
|
|
11389
11418
|
|
|
11390
11419
|
// src/components/layout/page-heading.tsx
|
|
@@ -11471,7 +11500,7 @@ function CardsStrip(props) {
|
|
|
11471
11500
|
const items = childrenMode ? childItems : props.items;
|
|
11472
11501
|
const cardWidthDesktop = childrenMode ? props.cardWidthDesktop ?? 400 : 0;
|
|
11473
11502
|
const cardWidthMobile = childrenMode ? props.cardWidthMobile ?? 320 : 0;
|
|
11474
|
-
|
|
11503
|
+
useEffect21(() => {
|
|
11475
11504
|
if (process.env.NODE_ENV === "production" || !childrenMode) return;
|
|
11476
11505
|
const only = childItems.length === 1 ? childItems[0] : null;
|
|
11477
11506
|
if (React37.isValidElement(only) && only.type === React37.Fragment) {
|
|
@@ -11486,13 +11515,13 @@ function CardsStrip(props) {
|
|
|
11486
11515
|
}
|
|
11487
11516
|
return React37.isValidElement(item) && item.key != null ? String(item.key) : String(index);
|
|
11488
11517
|
};
|
|
11489
|
-
const wrapperRef =
|
|
11490
|
-
const scrollerRef =
|
|
11491
|
-
const trackRef =
|
|
11492
|
-
const [reducedMotion, setReducedMotion] =
|
|
11493
|
-
const [isTouch, setIsTouch] =
|
|
11494
|
-
const [isMobile, setIsMobile] =
|
|
11495
|
-
|
|
11518
|
+
const wrapperRef = useRef17(null);
|
|
11519
|
+
const scrollerRef = useRef17(null);
|
|
11520
|
+
const trackRef = useRef17(null);
|
|
11521
|
+
const [reducedMotion, setReducedMotion] = useState26(false);
|
|
11522
|
+
const [isTouch, setIsTouch] = useState26(false);
|
|
11523
|
+
const [isMobile, setIsMobile] = useState26(false);
|
|
11524
|
+
useEffect21(() => {
|
|
11496
11525
|
const subs = [];
|
|
11497
11526
|
const watch = (query, set) => {
|
|
11498
11527
|
const mq = window.matchMedia(query);
|
|
@@ -11506,9 +11535,9 @@ function CardsStrip(props) {
|
|
|
11506
11535
|
watch("(max-width: 767px)", setIsMobile);
|
|
11507
11536
|
return () => subs.forEach((fn) => fn());
|
|
11508
11537
|
}, []);
|
|
11509
|
-
const [overflows, setOverflows] =
|
|
11510
|
-
const [marqueeEligible, setMarqueeEligible] =
|
|
11511
|
-
const singleCopyWidthRef =
|
|
11538
|
+
const [overflows, setOverflows] = useState26(false);
|
|
11539
|
+
const [marqueeEligible, setMarqueeEligible] = useState26(false);
|
|
11540
|
+
const singleCopyWidthRef = useRef17(0);
|
|
11512
11541
|
const marqueeActive = autoScroll && !reducedMotion && marqueeEligible && items.length > 0;
|
|
11513
11542
|
const measure = useCallback14(() => {
|
|
11514
11543
|
const scroller = scrollerRef.current;
|
|
@@ -11520,7 +11549,7 @@ function CardsStrip(props) {
|
|
|
11520
11549
|
setOverflows(singleCopy > scroller.clientWidth + 1);
|
|
11521
11550
|
setMarqueeEligible(singleCopy > scroller.clientWidth + TRACK_GAP_PX);
|
|
11522
11551
|
}, []);
|
|
11523
|
-
|
|
11552
|
+
useEffect21(() => {
|
|
11524
11553
|
measure();
|
|
11525
11554
|
const scroller = scrollerRef.current;
|
|
11526
11555
|
const track = trackRef.current;
|
|
@@ -11530,10 +11559,10 @@ function CardsStrip(props) {
|
|
|
11530
11559
|
ro.observe(track);
|
|
11531
11560
|
return () => ro.disconnect();
|
|
11532
11561
|
}, [measure, items.length, marqueeActive, isMobile]);
|
|
11533
|
-
const chevronSuppressUntilRef =
|
|
11534
|
-
const userScrollSuppressUntilRef =
|
|
11535
|
-
const [nearViewport, setNearViewport] =
|
|
11536
|
-
|
|
11562
|
+
const chevronSuppressUntilRef = useRef17(0);
|
|
11563
|
+
const userScrollSuppressUntilRef = useRef17(0);
|
|
11564
|
+
const [nearViewport, setNearViewport] = useState26(true);
|
|
11565
|
+
useEffect21(() => {
|
|
11537
11566
|
const el = wrapperRef.current;
|
|
11538
11567
|
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
11539
11568
|
const io = new IntersectionObserver(
|
|
@@ -11543,8 +11572,8 @@ function CardsStrip(props) {
|
|
|
11543
11572
|
io.observe(el);
|
|
11544
11573
|
return () => io.disconnect();
|
|
11545
11574
|
}, []);
|
|
11546
|
-
const [activeKey, setActiveKey] =
|
|
11547
|
-
const activeKeyRef =
|
|
11575
|
+
const [activeKey, setActiveKey] = useState26(null);
|
|
11576
|
+
const activeKeyRef = useRef17(null);
|
|
11548
11577
|
const activate = useCallback14((key) => {
|
|
11549
11578
|
activeKeyRef.current = key;
|
|
11550
11579
|
setActiveKey(key);
|
|
@@ -11553,8 +11582,8 @@ function CardsStrip(props) {
|
|
|
11553
11582
|
if (activeKeyRef.current === key) activeKeyRef.current = null;
|
|
11554
11583
|
setActiveKey((current) => current === key ? null : current);
|
|
11555
11584
|
}, []);
|
|
11556
|
-
const hoverPointerRef =
|
|
11557
|
-
const lastHoverSyncScrollRef =
|
|
11585
|
+
const hoverPointerRef = useRef17({ x: 0, y: 0, inside: false });
|
|
11586
|
+
const lastHoverSyncScrollRef = useRef17(-1);
|
|
11558
11587
|
const syncHoverToPointer = useCallback14(() => {
|
|
11559
11588
|
const p = hoverPointerRef.current;
|
|
11560
11589
|
if (!p.inside) return;
|
|
@@ -11615,11 +11644,11 @@ function CardsStrip(props) {
|
|
|
11615
11644
|
readBack: () => scrollerRef.current?.scrollLeft ?? 0,
|
|
11616
11645
|
onAfterFrame: syncHoverIfScrolled
|
|
11617
11646
|
});
|
|
11618
|
-
const [mountedIdx, setMountedIdx] =
|
|
11619
|
-
const cardObserverRef =
|
|
11620
|
-
const cardElIdxRef =
|
|
11621
|
-
const cardElNearRef =
|
|
11622
|
-
|
|
11647
|
+
const [mountedIdx, setMountedIdx] = useState26(() => /* @__PURE__ */ new Set());
|
|
11648
|
+
const cardObserverRef = useRef17(null);
|
|
11649
|
+
const cardElIdxRef = useRef17(/* @__PURE__ */ new Map());
|
|
11650
|
+
const cardElNearRef = useRef17(/* @__PURE__ */ new Map());
|
|
11651
|
+
useEffect21(() => {
|
|
11623
11652
|
if (typeof IntersectionObserver === "undefined") return;
|
|
11624
11653
|
const io = new IntersectionObserver((entries) => {
|
|
11625
11654
|
for (const e of entries) cardElNearRef.current.set(e.target, e.isIntersecting);
|
|
@@ -11647,7 +11676,7 @@ function CardsStrip(props) {
|
|
|
11647
11676
|
cardObserverRef.current = null;
|
|
11648
11677
|
};
|
|
11649
11678
|
}, []);
|
|
11650
|
-
const cardRefFnsRef =
|
|
11679
|
+
const cardRefFnsRef = useRef17(/* @__PURE__ */ new Map());
|
|
11651
11680
|
const getCardRef = useCallback14((idx) => {
|
|
11652
11681
|
let fn = cardRefFnsRef.current.get(idx);
|
|
11653
11682
|
if (!fn) {
|
|
@@ -11687,7 +11716,7 @@ function CardsStrip(props) {
|
|
|
11687
11716
|
const onPointerDownIntent = useCallback14((e) => {
|
|
11688
11717
|
if (e.pointerType === "touch") onUserScrollIntent();
|
|
11689
11718
|
}, [onUserScrollIntent]);
|
|
11690
|
-
const marqueeActiveRef =
|
|
11719
|
+
const marqueeActiveRef = useRef17(false);
|
|
11691
11720
|
marqueeActiveRef.current = marqueeActive;
|
|
11692
11721
|
const onSeamWarp = useCallback14(() => {
|
|
11693
11722
|
const scroller = scrollerRef.current;
|
|
@@ -11925,14 +11954,14 @@ function VideoBiteCard({
|
|
|
11925
11954
|
const key = cardKey ?? `${bite.url}__${index}`;
|
|
11926
11955
|
const previewUrl = toMuxPreviewUrl(bite.url);
|
|
11927
11956
|
const controlled = active !== void 0;
|
|
11928
|
-
const [selfActive, setSelfActive] =
|
|
11957
|
+
const [selfActive, setSelfActive] = useState27(false);
|
|
11929
11958
|
const isActive = controlled ? !!active : selfActive;
|
|
11930
11959
|
const activate = () => controlled ? onActivate?.(key) : setSelfActive(true);
|
|
11931
11960
|
const deactivate = () => controlled ? onDeactivate?.(key) : setSelfActive(false);
|
|
11932
11961
|
const gateControlled = playerMounted !== void 0;
|
|
11933
|
-
const rootElRef =
|
|
11934
|
-
const [isNear, setIsNear] =
|
|
11935
|
-
|
|
11962
|
+
const rootElRef = useRef18(null);
|
|
11963
|
+
const [isNear, setIsNear] = useState27(false);
|
|
11964
|
+
useEffect22(() => {
|
|
11936
11965
|
if (gateControlled) return;
|
|
11937
11966
|
const el = rootElRef.current;
|
|
11938
11967
|
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
@@ -13768,7 +13797,7 @@ function OnboardingGuideCard({
|
|
|
13768
13797
|
}
|
|
13769
13798
|
|
|
13770
13799
|
// src/components/chat/entity-cards/roadmap-card.tsx
|
|
13771
|
-
import { useState as
|
|
13800
|
+
import { useState as useState106 } from "react";
|
|
13772
13801
|
import { ThumbsUp, ThumbsDown } from "lucide-react";
|
|
13773
13802
|
|
|
13774
13803
|
// src/components/chat/entity-cards/roadmap-vote-button.tsx
|
|
@@ -13809,7 +13838,7 @@ function RoadmapVoteButton({
|
|
|
13809
13838
|
init_button();
|
|
13810
13839
|
|
|
13811
13840
|
// src/components/ui/image-gallery-modal.tsx
|
|
13812
|
-
import { useState as
|
|
13841
|
+
import { useState as useState105, useEffect as useEffect78 } from "react";
|
|
13813
13842
|
|
|
13814
13843
|
// src/components/ui/allowed-domains-input.tsx
|
|
13815
13844
|
init_cn();
|
|
@@ -13970,11 +13999,11 @@ AllowedDomainsInput.displayName = "AllowedDomainsInput";
|
|
|
13970
13999
|
// src/components/ui/autocomplete.tsx
|
|
13971
14000
|
import {
|
|
13972
14001
|
forwardRef as forwardRef26,
|
|
13973
|
-
useEffect as
|
|
14002
|
+
useEffect as useEffect23,
|
|
13974
14003
|
useImperativeHandle as useImperativeHandle3,
|
|
13975
14004
|
useMemo as useMemo19,
|
|
13976
|
-
useRef as
|
|
13977
|
-
useState as
|
|
14005
|
+
useRef as useRef20,
|
|
14006
|
+
useState as useState29
|
|
13978
14007
|
} from "react";
|
|
13979
14008
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
13980
14009
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
@@ -14072,7 +14101,7 @@ function AutocompleteInner(props, ref) {
|
|
|
14072
14101
|
const limitTagsProp = multiple ? props.limitTags ?? "auto" : "auto";
|
|
14073
14102
|
const getLimitTagsText = multiple ? props.getLimitTagsText ?? ((more) => `+${more}`) : ((more) => `+${more}`);
|
|
14074
14103
|
const valueArray = multiple ? props.value : props.value != null ? [props.value] : [];
|
|
14075
|
-
const [internalInputValue, setInternalInputValue] =
|
|
14104
|
+
const [internalInputValue, setInternalInputValue] = useState29("");
|
|
14076
14105
|
const isInputControlled = inputValueProp !== void 0;
|
|
14077
14106
|
const inputValue = isInputControlled ? inputValueProp : internalInputValue;
|
|
14078
14107
|
const updateInputValue = (value, reason) => {
|
|
@@ -14081,10 +14110,10 @@ function AutocompleteInner(props, ref) {
|
|
|
14081
14110
|
}
|
|
14082
14111
|
onInputChange?.(value, reason);
|
|
14083
14112
|
};
|
|
14084
|
-
const [isOpen, setIsOpen] =
|
|
14085
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
14086
|
-
const containerRef =
|
|
14087
|
-
const hiddenTagsPopupRef =
|
|
14113
|
+
const [isOpen, setIsOpen] = useState29(false);
|
|
14114
|
+
const [highlightedIndex, setHighlightedIndex] = useState29(-1);
|
|
14115
|
+
const containerRef = useRef20(null);
|
|
14116
|
+
const hiddenTagsPopupRef = useRef20(null);
|
|
14088
14117
|
const isInvalid = invalid || !!error;
|
|
14089
14118
|
useImperativeHandle3(ref, () => containerRef.current);
|
|
14090
14119
|
const selectedOptions = useMemo19(() => {
|
|
@@ -14101,9 +14130,9 @@ function AutocompleteInner(props, ref) {
|
|
|
14101
14130
|
const visibleTags = multiple ? selectedOptions.slice(0, visibleCount) : [];
|
|
14102
14131
|
const hiddenTags = multiple ? selectedOptions.slice(visibleCount) : [];
|
|
14103
14132
|
const hiddenTagsCount = multiple ? selectedOptions.length - visibleCount : 0;
|
|
14104
|
-
const [showHiddenTags, setShowHiddenTags] =
|
|
14105
|
-
const hiddenTagsRef =
|
|
14106
|
-
|
|
14133
|
+
const [showHiddenTags, setShowHiddenTags] = useState29(false);
|
|
14134
|
+
const hiddenTagsRef = useRef20(null);
|
|
14135
|
+
useEffect23(() => {
|
|
14107
14136
|
if (!showHiddenTags) return;
|
|
14108
14137
|
const handleClick = (e) => {
|
|
14109
14138
|
const target = e.target;
|
|
@@ -14155,7 +14184,7 @@ function AutocompleteInner(props, ref) {
|
|
|
14155
14184
|
setIsOpen(false);
|
|
14156
14185
|
onCreateOption?.(trimmed);
|
|
14157
14186
|
};
|
|
14158
|
-
|
|
14187
|
+
useEffect23(() => {
|
|
14159
14188
|
setHighlightedIndex(-1);
|
|
14160
14189
|
}, [filteredOptions.length]);
|
|
14161
14190
|
const handleInputChange = (e) => {
|
|
@@ -15714,7 +15743,7 @@ function DateFilterMenu({
|
|
|
15714
15743
|
|
|
15715
15744
|
// src/components/ui/duration-input.tsx
|
|
15716
15745
|
init_cn();
|
|
15717
|
-
import { Fragment as Fragment27, useEffect as
|
|
15746
|
+
import { Fragment as Fragment27, useEffect as useEffect25, useRef as useRef21, useState as useState31 } from "react";
|
|
15718
15747
|
import { jsx as jsx100, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
15719
15748
|
var SEGMENT_META = [
|
|
15720
15749
|
{ label: "Hours", placeholder: "HH", max: 99 },
|
|
@@ -15728,9 +15757,9 @@ var split = (value) => {
|
|
|
15728
15757
|
return [parts[0] || "00", parts[1] || "00", parts[2] || "00"];
|
|
15729
15758
|
};
|
|
15730
15759
|
function DurationInput({ value, onChange, invalid, className }) {
|
|
15731
|
-
const [segments, setSegments] =
|
|
15732
|
-
const refs = [
|
|
15733
|
-
|
|
15760
|
+
const [segments, setSegments] = useState31(() => split(value));
|
|
15761
|
+
const refs = [useRef21(null), useRef21(null), useRef21(null)];
|
|
15762
|
+
useEffect25(() => {
|
|
15734
15763
|
setSegments((prev) => compose(prev) === value ? prev : split(value));
|
|
15735
15764
|
}, [value]);
|
|
15736
15765
|
const focusSegment = (i) => {
|
|
@@ -15847,7 +15876,7 @@ init_cn();
|
|
|
15847
15876
|
import React47 from "react";
|
|
15848
15877
|
|
|
15849
15878
|
// src/components/ui/progress-bar.tsx
|
|
15850
|
-
import { useEffect as
|
|
15879
|
+
import { useEffect as useEffect26, useRef as useRef22, useState as useState32 } from "react";
|
|
15851
15880
|
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
15852
15881
|
var ProgressBar = ({
|
|
15853
15882
|
progress,
|
|
@@ -15863,9 +15892,9 @@ var ProgressBar = ({
|
|
|
15863
15892
|
const isMdUp = useMdUp() ?? true;
|
|
15864
15893
|
const effectiveSegmentWidth = isMdUp ? segmentWidth : mobileSegmentWidth;
|
|
15865
15894
|
const effectiveHeight = isMdUp ? height : mobileHeight;
|
|
15866
|
-
const containerRef =
|
|
15867
|
-
const [segmentCount, setSegmentCount] =
|
|
15868
|
-
|
|
15895
|
+
const containerRef = useRef22(null);
|
|
15896
|
+
const [segmentCount, setSegmentCount] = useState32(0);
|
|
15897
|
+
useEffect26(() => {
|
|
15869
15898
|
if (!containerRef.current) return;
|
|
15870
15899
|
const resizeObserver = new ResizeObserver(() => {
|
|
15871
15900
|
if (containerRef.current) {
|
|
@@ -17798,13 +17827,13 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
17798
17827
|
// src/components/ui/modal.tsx
|
|
17799
17828
|
init_cn();
|
|
17800
17829
|
import * as React62 from "react";
|
|
17801
|
-
import { useEffect as
|
|
17830
|
+
import { useEffect as useEffect31 } from "react";
|
|
17802
17831
|
import { usePreventScroll as usePreventScroll2 } from "@react-aria/overlays";
|
|
17803
17832
|
import { jsx as jsx122, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
17804
17833
|
var Modal2 = React62.forwardRef(
|
|
17805
17834
|
({ isOpen, onClose, children, className }, ref) => {
|
|
17806
17835
|
usePreventScroll2({ isDisabled: !isOpen });
|
|
17807
|
-
|
|
17836
|
+
useEffect31(() => {
|
|
17808
17837
|
const handleKeyDown = (event) => {
|
|
17809
17838
|
if (event.key === "Escape") {
|
|
17810
17839
|
onClose();
|
|
@@ -18847,7 +18876,7 @@ function TabContent({
|
|
|
18847
18876
|
// src/components/ui/tab-navigation.tsx
|
|
18848
18877
|
init_next_navigation();
|
|
18849
18878
|
init_cn();
|
|
18850
|
-
import { useState as
|
|
18879
|
+
import { useState as useState40, useEffect as useEffect33, useMemo as useMemo23, useRef as useRef25, useCallback as useCallback19 } from "react";
|
|
18851
18880
|
import { Fragment as Fragment29, jsx as jsx132, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
18852
18881
|
function TabNavigation({
|
|
18853
18882
|
activeTab: controlledActiveTab,
|
|
@@ -18878,9 +18907,9 @@ function TabNavigation({
|
|
|
18878
18907
|
}
|
|
18879
18908
|
return defaultTab || tabs[0]?.id || "";
|
|
18880
18909
|
};
|
|
18881
|
-
const [internalActiveTab, setInternalActiveTab] =
|
|
18910
|
+
const [internalActiveTab, setInternalActiveTab] = useState40(getInitialTab);
|
|
18882
18911
|
const activeTab = isUrlSyncEnabled ? internalActiveTab : controlledActiveTab || "";
|
|
18883
|
-
|
|
18912
|
+
useEffect33(() => {
|
|
18884
18913
|
if (!isUrlSyncEnabled) return;
|
|
18885
18914
|
const fromUrl = searchParams?.get(paramName) || "";
|
|
18886
18915
|
const nextTab = validTabIds.has(fromUrl) ? fromUrl : defaultTab || tabs[0]?.id || "";
|
|
@@ -18900,18 +18929,18 @@ function TabNavigation({
|
|
|
18900
18929
|
controlledOnTabChange?.(tabId);
|
|
18901
18930
|
}
|
|
18902
18931
|
};
|
|
18903
|
-
const scrollRef =
|
|
18904
|
-
const activeTabRef =
|
|
18905
|
-
const isFirstActiveScrollRef =
|
|
18906
|
-
const [canScrollLeft, setCanScrollLeft] =
|
|
18907
|
-
const [canScrollRight, setCanScrollRight] =
|
|
18932
|
+
const scrollRef = useRef25(null);
|
|
18933
|
+
const activeTabRef = useRef25(null);
|
|
18934
|
+
const isFirstActiveScrollRef = useRef25(true);
|
|
18935
|
+
const [canScrollLeft, setCanScrollLeft] = useState40(false);
|
|
18936
|
+
const [canScrollRight, setCanScrollRight] = useState40(false);
|
|
18908
18937
|
const updateScrollShadows = useCallback19(() => {
|
|
18909
18938
|
const el = scrollRef.current;
|
|
18910
18939
|
if (!el) return;
|
|
18911
18940
|
setCanScrollLeft(el.scrollLeft > 0);
|
|
18912
18941
|
setCanScrollRight(el.scrollLeft + el.clientWidth < el.scrollWidth - 1);
|
|
18913
18942
|
}, []);
|
|
18914
|
-
|
|
18943
|
+
useEffect33(() => {
|
|
18915
18944
|
const el = scrollRef.current;
|
|
18916
18945
|
if (!el) return;
|
|
18917
18946
|
updateScrollShadows();
|
|
@@ -18935,7 +18964,7 @@ function TabNavigation({
|
|
|
18935
18964
|
ro.disconnect();
|
|
18936
18965
|
};
|
|
18937
18966
|
}, [updateScrollShadows]);
|
|
18938
|
-
|
|
18967
|
+
useEffect33(() => {
|
|
18939
18968
|
const el = scrollRef.current;
|
|
18940
18969
|
const active = activeTabRef.current;
|
|
18941
18970
|
if (!el || !active) return;
|
|
@@ -19090,7 +19119,7 @@ function AIGeneratedBadge({ className }) {
|
|
|
19090
19119
|
}
|
|
19091
19120
|
|
|
19092
19121
|
// src/components/ui/fade-preview.tsx
|
|
19093
|
-
import { useState as
|
|
19122
|
+
import { useState as useState41, useRef as useRef26, useEffect as useEffect34 } from "react";
|
|
19094
19123
|
import { ChevronDown as ChevronDown4 } from "lucide-react";
|
|
19095
19124
|
import { Fragment as Fragment30, jsx as jsx135, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
19096
19125
|
function FadePreview({
|
|
@@ -19099,9 +19128,9 @@ function FadePreview({
|
|
|
19099
19128
|
resetKey,
|
|
19100
19129
|
children
|
|
19101
19130
|
}) {
|
|
19102
|
-
const [expanded, setExpanded] =
|
|
19103
|
-
const contentRef =
|
|
19104
|
-
|
|
19131
|
+
const [expanded, setExpanded] = useState41(false);
|
|
19132
|
+
const contentRef = useRef26(null);
|
|
19133
|
+
useEffect34(() => {
|
|
19105
19134
|
setExpanded(false);
|
|
19106
19135
|
}, [resetKey]);
|
|
19107
19136
|
const needsFade = hiddenCount > 0;
|
|
@@ -19166,11 +19195,11 @@ var Progress = React73.forwardRef(({ className, value, indicatorClassName, ...pr
|
|
|
19166
19195
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
19167
19196
|
|
|
19168
19197
|
// src/components/ui/release-changelog-section.tsx
|
|
19169
|
-
import { useState as
|
|
19198
|
+
import { useState as useState51 } from "react";
|
|
19170
19199
|
import { ChevronDown as ChevronDown5 } from "lucide-react";
|
|
19171
19200
|
|
|
19172
19201
|
// src/components/ui/rich-markdown-renderer.tsx
|
|
19173
|
-
import { useEffect as
|
|
19202
|
+
import { useEffect as useEffect41, useState as useState50, useRef as useRef31, useMemo as useMemo26, useCallback as useCallback22 } from "react";
|
|
19174
19203
|
import ReactMarkdown2 from "react-markdown";
|
|
19175
19204
|
import remarkGfm2 from "remark-gfm";
|
|
19176
19205
|
import remarkBreaks2 from "remark-breaks";
|
|
@@ -19178,7 +19207,7 @@ import rehypeHighlight2 from "rehype-highlight";
|
|
|
19178
19207
|
import rehypeRaw2 from "rehype-raw";
|
|
19179
19208
|
|
|
19180
19209
|
// src/components/embeds/reddit-embed-client.tsx
|
|
19181
|
-
import { useState as
|
|
19210
|
+
import { useState as useState43, useEffect as useEffect36, useRef as useRef28 } from "react";
|
|
19182
19211
|
|
|
19183
19212
|
// src/utils/social-embed-cache.ts
|
|
19184
19213
|
var cachingRequests = /* @__PURE__ */ new Map();
|
|
@@ -19460,7 +19489,7 @@ var socialCache = SocialEmbedCache.getInstance();
|
|
|
19460
19489
|
|
|
19461
19490
|
// src/components/media-carousel.tsx
|
|
19462
19491
|
init_cn();
|
|
19463
|
-
import { useState as
|
|
19492
|
+
import { useState as useState42, useRef as useRef27, useEffect as useEffect35, memo as memo4, useCallback as useCallback20 } from "react";
|
|
19464
19493
|
init_button2();
|
|
19465
19494
|
import { Fragment as Fragment31, jsx as jsx137, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
19466
19495
|
var ChevronLeftIcon = () => /* @__PURE__ */ jsx137("svg", { width: "24", height: "24", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx137("polyline", { points: "15,18 9,12 15,6" }) });
|
|
@@ -19475,17 +19504,17 @@ var MediaCarousel = memo4(function MediaCarousel2({
|
|
|
19475
19504
|
transformImageSrc,
|
|
19476
19505
|
reserveDotRow = false
|
|
19477
19506
|
}) {
|
|
19478
|
-
const [currentIndex, setCurrentIndex] =
|
|
19479
|
-
const [touchStart, setTouchStart] =
|
|
19480
|
-
const [touchEnd, setTouchEnd] =
|
|
19481
|
-
const [brokenResourceUrls, setBrokenResourceUrls] =
|
|
19482
|
-
const [loadedImageSrc, setLoadedImageSrc] =
|
|
19483
|
-
const carouselRef =
|
|
19507
|
+
const [currentIndex, setCurrentIndex] = useState42(0);
|
|
19508
|
+
const [touchStart, setTouchStart] = useState42(null);
|
|
19509
|
+
const [touchEnd, setTouchEnd] = useState42(null);
|
|
19510
|
+
const [brokenResourceUrls, setBrokenResourceUrls] = useState42({});
|
|
19511
|
+
const [loadedImageSrc, setLoadedImageSrc] = useState42(null);
|
|
19512
|
+
const carouselRef = useRef27(null);
|
|
19484
19513
|
const onImageError = useCallback20((originalUrl) => {
|
|
19485
19514
|
const key = originalUrl.trim() || "__missing_src__";
|
|
19486
19515
|
setBrokenResourceUrls((b) => b[key] ? b : { ...b, [key]: true });
|
|
19487
19516
|
}, []);
|
|
19488
|
-
|
|
19517
|
+
useEffect35(() => {
|
|
19489
19518
|
if (currentIndex >= media.length && media.length > 0) {
|
|
19490
19519
|
setCurrentIndex(media.length - 1);
|
|
19491
19520
|
}
|
|
@@ -19802,11 +19831,11 @@ var RedditProfilePic = ({ username }) => {
|
|
|
19802
19831
|
};
|
|
19803
19832
|
function RedditEmbedClient({ url, maxWidth = 700 }) {
|
|
19804
19833
|
const { redditProxyUrl } = useRichMarkdownRuntime();
|
|
19805
|
-
const [redditData, setRedditData] =
|
|
19806
|
-
const [loading, setLoading] =
|
|
19807
|
-
const [error, setError] =
|
|
19808
|
-
const initializationDone =
|
|
19809
|
-
|
|
19834
|
+
const [redditData, setRedditData] = useState43(null);
|
|
19835
|
+
const [loading, setLoading] = useState43(true);
|
|
19836
|
+
const [error, setError] = useState43(null);
|
|
19837
|
+
const initializationDone = useRef28(false);
|
|
19838
|
+
useEffect36(() => {
|
|
19810
19839
|
if (initializationDone.current) return;
|
|
19811
19840
|
initializationDone.current = true;
|
|
19812
19841
|
const jsonUrl = url.endsWith(".json") ? url : `${url.replace(/\/$/, "")}.json`;
|
|
@@ -20112,7 +20141,7 @@ function RedditEmbedClient({ url, maxWidth = 700 }) {
|
|
|
20112
20141
|
}
|
|
20113
20142
|
|
|
20114
20143
|
// src/components/embeds/twitter-embed-client.tsx
|
|
20115
|
-
import { useState as
|
|
20144
|
+
import { useState as useState44, useEffect as useEffect37, useRef as useRef29 } from "react";
|
|
20116
20145
|
import { jsx as jsx141, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
20117
20146
|
var MessageCircleIcon2 = () => /* @__PURE__ */ jsx141("svg", { width: "16", height: "16", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx141("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) });
|
|
20118
20147
|
var ExternalLinkIcon3 = () => /* @__PURE__ */ jsxs109("svg", { width: "16", height: "16", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
@@ -20138,13 +20167,13 @@ var UserIcon4 = () => /* @__PURE__ */ jsxs109("svg", { width: "12", height: "12"
|
|
|
20138
20167
|
var XIcon = () => /* @__PURE__ */ jsx141(XLogo, { className: "w-5 h-5", color: "currentColor" });
|
|
20139
20168
|
function TwitterEmbedClient({ url, tweetId, maxWidth = 700 }) {
|
|
20140
20169
|
const { twitterProxyUrl } = useRichMarkdownRuntime();
|
|
20141
|
-
const [tweetData, setTweetData] =
|
|
20142
|
-
const [loading, setLoading] =
|
|
20143
|
-
const [error, setError] =
|
|
20144
|
-
const initializationDone =
|
|
20170
|
+
const [tweetData, setTweetData] = useState44(null);
|
|
20171
|
+
const [loading, setLoading] = useState44(true);
|
|
20172
|
+
const [error, setError] = useState44(null);
|
|
20173
|
+
const initializationDone = useRef29(false);
|
|
20145
20174
|
const extractedTweetId = tweetId || url.match(/status\/(\d+)/)?.[1];
|
|
20146
20175
|
const tweetUrl = url.includes("twitter.com") || url.includes("x.com") ? url : `https://twitter.com/twitter/status/${extractedTweetId}`;
|
|
20147
|
-
|
|
20176
|
+
useEffect37(() => {
|
|
20148
20177
|
if (initializationDone.current) return;
|
|
20149
20178
|
initializationDone.current = true;
|
|
20150
20179
|
if (!extractedTweetId) {
|
|
@@ -20309,7 +20338,7 @@ function TwitterEmbedClient({ url, tweetId, maxWidth = 700 }) {
|
|
|
20309
20338
|
}
|
|
20310
20339
|
|
|
20311
20340
|
// src/components/embeds/linkedin-embed-client.tsx
|
|
20312
|
-
import { useMemo as useMemo25, useState as
|
|
20341
|
+
import { useMemo as useMemo25, useState as useState45 } from "react";
|
|
20313
20342
|
import { ExternalLink as ExternalLink2 } from "lucide-react";
|
|
20314
20343
|
import { jsx as jsx142, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
20315
20344
|
function toLinkedInEmbedUrl(url) {
|
|
@@ -20325,7 +20354,7 @@ function toLinkedInEmbedUrl(url) {
|
|
|
20325
20354
|
}
|
|
20326
20355
|
function LinkedInEmbedClient({ url, height = 600 }) {
|
|
20327
20356
|
const embedUrl = useMemo25(() => toLinkedInEmbedUrl(url), [url]);
|
|
20328
|
-
const [loaded, setLoaded] =
|
|
20357
|
+
const [loaded, setLoaded] = useState45(false);
|
|
20329
20358
|
if (!embedUrl) {
|
|
20330
20359
|
return /* @__PURE__ */ jsx142(LinkedInContainer, { children: /* @__PURE__ */ jsxs110("div", { className: "p-6", children: [
|
|
20331
20360
|
/* @__PURE__ */ jsxs110("div", { className: "flex items-center space-x-3 text-ods-text-secondary mb-4", children: [
|
|
@@ -20392,7 +20421,7 @@ function LinkedInEmbedClient({ url, height = 600 }) {
|
|
|
20392
20421
|
}
|
|
20393
20422
|
|
|
20394
20423
|
// src/components/embeds/og-link-preview.tsx
|
|
20395
|
-
import { useState as
|
|
20424
|
+
import { useState as useState46, useEffect as useEffect38, Component as Component2 } from "react";
|
|
20396
20425
|
import { jsx as jsx143, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
20397
20426
|
var OGLinkErrorBoundary = class extends Component2 {
|
|
20398
20427
|
constructor(props) {
|
|
@@ -20437,12 +20466,12 @@ var OGLinkPreview = ({
|
|
|
20437
20466
|
variant = "default",
|
|
20438
20467
|
enablePlaceholder = true
|
|
20439
20468
|
}) => {
|
|
20440
|
-
const [ogData, setOgData] =
|
|
20441
|
-
const [loading, setLoading] =
|
|
20442
|
-
const [error, setError] =
|
|
20443
|
-
const [imageError, setImageError] =
|
|
20444
|
-
const [originalImageError, setOriginalImageError] =
|
|
20445
|
-
const [fallbackImageError, setFallbackImageError] =
|
|
20469
|
+
const [ogData, setOgData] = useState46(null);
|
|
20470
|
+
const [loading, setLoading] = useState46(true);
|
|
20471
|
+
const [error, setError] = useState46(false);
|
|
20472
|
+
const [imageError, setImageError] = useState46(false);
|
|
20473
|
+
const [originalImageError, setOriginalImageError] = useState46(false);
|
|
20474
|
+
const [fallbackImageError, setFallbackImageError] = useState46(false);
|
|
20446
20475
|
let isValidUrl = true;
|
|
20447
20476
|
let isLocalhost = false;
|
|
20448
20477
|
try {
|
|
@@ -20457,7 +20486,7 @@ var OGLinkPreview = ({
|
|
|
20457
20486
|
} catch {
|
|
20458
20487
|
isValidUrl = false;
|
|
20459
20488
|
}
|
|
20460
|
-
|
|
20489
|
+
useEffect38(() => {
|
|
20461
20490
|
if (!isValidUrl || isLocalhost) return;
|
|
20462
20491
|
const fetchOGData = async () => {
|
|
20463
20492
|
try {
|
|
@@ -20713,7 +20742,7 @@ var OGLinkPreview = ({
|
|
|
20713
20742
|
};
|
|
20714
20743
|
|
|
20715
20744
|
// src/components/embeds/figma-embed.tsx
|
|
20716
|
-
import { useState as
|
|
20745
|
+
import { useState as useState48 } from "react";
|
|
20717
20746
|
import { ExternalLink as ExternalLink3, Play as Play3, LayoutGrid } from "lucide-react";
|
|
20718
20747
|
|
|
20719
20748
|
// src/utils/embed-url-converters.ts
|
|
@@ -20767,7 +20796,7 @@ function toFigmaOriginalUrl(url) {
|
|
|
20767
20796
|
}
|
|
20768
20797
|
|
|
20769
20798
|
// src/components/embeds/embed-iframe.tsx
|
|
20770
|
-
import { useState as
|
|
20799
|
+
import { useState as useState47, useCallback as useCallback21, useRef as useRef30, useEffect as useEffect39 } from "react";
|
|
20771
20800
|
import { Fragment as Fragment32, jsx as jsx144, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
20772
20801
|
function EmbedLoadingSkeleton({ height }) {
|
|
20773
20802
|
return /* @__PURE__ */ jsx144(
|
|
@@ -20788,13 +20817,13 @@ function EmbedIframe({
|
|
|
20788
20817
|
loading,
|
|
20789
20818
|
allowFullScreen
|
|
20790
20819
|
}) {
|
|
20791
|
-
const [isLoaded, setIsLoaded] =
|
|
20792
|
-
const iframeRef =
|
|
20820
|
+
const [isLoaded, setIsLoaded] = useState47(false);
|
|
20821
|
+
const iframeRef = useRef30(null);
|
|
20793
20822
|
const handleLoad = useCallback21(() => setIsLoaded(true), []);
|
|
20794
|
-
|
|
20823
|
+
useEffect39(() => {
|
|
20795
20824
|
setIsLoaded(false);
|
|
20796
20825
|
}, [src]);
|
|
20797
|
-
|
|
20826
|
+
useEffect39(() => {
|
|
20798
20827
|
const iframe = iframeRef.current;
|
|
20799
20828
|
return () => {
|
|
20800
20829
|
if (iframe) {
|
|
@@ -20873,7 +20902,7 @@ function SlidesViewToggle({
|
|
|
20873
20902
|
);
|
|
20874
20903
|
}
|
|
20875
20904
|
function FigmaEmbed({ url, title, height, loading = "lazy" }) {
|
|
20876
|
-
const [view, setView] =
|
|
20905
|
+
const [view, setView] = useState48("present");
|
|
20877
20906
|
const isSlides = url ? isFigmaSlidesUrl(url) : false;
|
|
20878
20907
|
const embedSrc = url ? toFigmaEmbedUrl(url, { slidesView: view }) : null;
|
|
20879
20908
|
const originalUrl = (() => {
|
|
@@ -20930,14 +20959,14 @@ function FigmaEmbed({ url, title, height, loading = "lazy" }) {
|
|
|
20930
20959
|
}
|
|
20931
20960
|
|
|
20932
20961
|
// src/components/embeds/markdown-image.tsx
|
|
20933
|
-
import { useEffect as
|
|
20962
|
+
import { useEffect as useEffect40, useState as useState49 } from "react";
|
|
20934
20963
|
import { jsx as jsx146 } from "react/jsx-runtime";
|
|
20935
20964
|
var MAX_H_REM = 32;
|
|
20936
20965
|
var DISPLAY_W = 768;
|
|
20937
20966
|
function MarkdownImage({ src, alt }) {
|
|
20938
20967
|
const { transformImageSrc } = useRichMarkdownRuntime();
|
|
20939
|
-
const [ratio, setRatio] =
|
|
20940
|
-
|
|
20968
|
+
const [ratio, setRatio] = useState49(null);
|
|
20969
|
+
useEffect40(() => {
|
|
20941
20970
|
let cancelled = false;
|
|
20942
20971
|
setRatio(null);
|
|
20943
20972
|
const probeSrc = transformImageSrc(src, { width: 48, resize: "contain", quality: 20 }) ?? src;
|
|
@@ -21052,15 +21081,15 @@ var mermaidStyles2 = `
|
|
|
21052
21081
|
}
|
|
21053
21082
|
`;
|
|
21054
21083
|
var MermaidDiagram2 = ({ chart }) => {
|
|
21055
|
-
const [svg, setSvg] =
|
|
21056
|
-
const [error, setError] =
|
|
21057
|
-
const [isLoading, setIsLoading] =
|
|
21058
|
-
const [mounted, setMounted] =
|
|
21059
|
-
|
|
21084
|
+
const [svg, setSvg] = useState50("");
|
|
21085
|
+
const [error, setError] = useState50("");
|
|
21086
|
+
const [isLoading, setIsLoading] = useState50(true);
|
|
21087
|
+
const [mounted, setMounted] = useState50(false);
|
|
21088
|
+
useEffect41(() => {
|
|
21060
21089
|
setMounted(true);
|
|
21061
21090
|
}, []);
|
|
21062
21091
|
const isDarkMode = true;
|
|
21063
|
-
|
|
21092
|
+
useEffect41(() => {
|
|
21064
21093
|
const renderMermaid = async () => {
|
|
21065
21094
|
try {
|
|
21066
21095
|
setIsLoading(true);
|
|
@@ -21399,7 +21428,7 @@ var RichMarkdownInner = ({
|
|
|
21399
21428
|
resolveLinkEndpointUrl,
|
|
21400
21429
|
demoteMarkdownH1ToH2
|
|
21401
21430
|
}) => {
|
|
21402
|
-
const idCountsRef =
|
|
21431
|
+
const idCountsRef = useRef31({});
|
|
21403
21432
|
const { ogScraperUrl } = useRichMarkdownRuntime();
|
|
21404
21433
|
const { ogApiBaseUrl, ogEndpointPath } = useMemo26(() => {
|
|
21405
21434
|
try {
|
|
@@ -21826,7 +21855,7 @@ function ReleaseChangelogSection({
|
|
|
21826
21855
|
icon,
|
|
21827
21856
|
MarkdownRenderer = RichMarkdownRenderer
|
|
21828
21857
|
}) {
|
|
21829
|
-
const [collapsed, setCollapsed] =
|
|
21858
|
+
const [collapsed, setCollapsed] = useState51(collapsible ? defaultCollapsed : false);
|
|
21830
21859
|
if (!entries || entries.length === 0) return null;
|
|
21831
21860
|
const inPreviewMode = previewFirst && !collapsible;
|
|
21832
21861
|
const showEntries = !collapsible || !collapsed;
|
|
@@ -22022,7 +22051,7 @@ function StatusIndicator({ status, label, href }) {
|
|
|
22022
22051
|
}
|
|
22023
22052
|
|
|
22024
22053
|
// src/components/ui/hover-dropdown.tsx
|
|
22025
|
-
import { useState as
|
|
22054
|
+
import { useState as useState52, useRef as useRef32, useCallback as useCallback23 } from "react";
|
|
22026
22055
|
import { Fragment as Fragment34, jsx as jsx152, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
22027
22056
|
function DefaultAnchor({
|
|
22028
22057
|
href,
|
|
@@ -22039,9 +22068,9 @@ function HoverDropdown({
|
|
|
22039
22068
|
className,
|
|
22040
22069
|
renderAnchor
|
|
22041
22070
|
}) {
|
|
22042
|
-
const [open, setOpen] =
|
|
22043
|
-
const timeoutRef =
|
|
22044
|
-
const containerRef =
|
|
22071
|
+
const [open, setOpen] = useState52(false);
|
|
22072
|
+
const timeoutRef = useRef32(void 0);
|
|
22073
|
+
const containerRef = useRef32(null);
|
|
22045
22074
|
const show = useCallback23(() => {
|
|
22046
22075
|
clearTimeout(timeoutRef.current);
|
|
22047
22076
|
setOpen(true);
|
|
@@ -22149,11 +22178,11 @@ function HoverDropdown({
|
|
|
22149
22178
|
|
|
22150
22179
|
// src/components/layout/list-page-layout.tsx
|
|
22151
22180
|
init_cn();
|
|
22152
|
-
import { useEffect as
|
|
22181
|
+
import { useEffect as useEffect43, useState as useState54 } from "react";
|
|
22153
22182
|
|
|
22154
22183
|
// src/components/ui/filter-modal.tsx
|
|
22155
22184
|
init_cn();
|
|
22156
|
-
import { useEffect as
|
|
22185
|
+
import { useEffect as useEffect42, useState as useState53 } from "react";
|
|
22157
22186
|
init_button2();
|
|
22158
22187
|
|
|
22159
22188
|
// src/components/ui/filter-checkbox-item.tsx
|
|
@@ -22350,15 +22379,15 @@ function FilterModal({
|
|
|
22350
22379
|
emptyStateTitle = "No filters available",
|
|
22351
22380
|
emptyStateDescription = "There are no filter options to display at the moment"
|
|
22352
22381
|
}) {
|
|
22353
|
-
const [selectedFilters, setSelectedFilters] =
|
|
22382
|
+
const [selectedFilters, setSelectedFilters] = useState53(() => {
|
|
22354
22383
|
return { ...currentFilters };
|
|
22355
22384
|
});
|
|
22356
|
-
const [pendingTags, setPendingTags] =
|
|
22385
|
+
const [pendingTags, setPendingTags] = useState53(selectedTags ?? []);
|
|
22357
22386
|
const dateDefaultSort = dateFilter?.defaultSort ?? "desc";
|
|
22358
|
-
const [draftDateSort, setDraftDateSort] =
|
|
22359
|
-
const [draftDateRange, setDraftDateRange] =
|
|
22387
|
+
const [draftDateSort, setDraftDateSort] = useState53(dateFilter?.sort ?? dateDefaultSort);
|
|
22388
|
+
const [draftDateRange, setDraftDateRange] = useState53(dateFilter?.range);
|
|
22360
22389
|
const { scrollRef, fadeTop, fadeBottom, update: updateFade } = useScrollFade();
|
|
22361
|
-
|
|
22390
|
+
useEffect42(() => {
|
|
22362
22391
|
if (isOpen) {
|
|
22363
22392
|
setSelectedFilters({ ...currentFilters });
|
|
22364
22393
|
setPendingTags(selectedTags ?? []);
|
|
@@ -22961,13 +22990,13 @@ function ListPageLayout({
|
|
|
22961
22990
|
mobileFilterTitle,
|
|
22962
22991
|
stickyHeader = false
|
|
22963
22992
|
}) {
|
|
22964
|
-
const [mobileFilterOpen, setMobileFilterOpen] =
|
|
22965
|
-
const [localSearchValue, setLocalSearchValue] =
|
|
22993
|
+
const [mobileFilterOpen, setMobileFilterOpen] = useState54(false);
|
|
22994
|
+
const [localSearchValue, setLocalSearchValue] = useState54(searchValue);
|
|
22966
22995
|
const debouncedSearchValue = useDebounce(localSearchValue, 500);
|
|
22967
|
-
|
|
22996
|
+
useEffect43(() => {
|
|
22968
22997
|
setLocalSearchValue(searchValue);
|
|
22969
22998
|
}, [searchValue]);
|
|
22970
|
-
|
|
22999
|
+
useEffect43(() => {
|
|
22971
23000
|
if (debouncedSearchValue !== searchValue) {
|
|
22972
23001
|
onSearch(debouncedSearchValue);
|
|
22973
23002
|
}
|
|
@@ -25882,7 +25911,7 @@ function FeatureList({
|
|
|
25882
25911
|
|
|
25883
25912
|
// src/components/ui/truncate-text.tsx
|
|
25884
25913
|
init_cn();
|
|
25885
|
-
import { useEffect as
|
|
25914
|
+
import { useEffect as useEffect44, useRef as useRef34, useState as useState56 } from "react";
|
|
25886
25915
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
25887
25916
|
var VARIANT_CLASS = {
|
|
25888
25917
|
h1: "text-h1",
|
|
@@ -25913,10 +25942,10 @@ function TruncateText({
|
|
|
25913
25942
|
tone = "primary",
|
|
25914
25943
|
mono = false
|
|
25915
25944
|
}) {
|
|
25916
|
-
const ref =
|
|
25917
|
-
const [isTruncated, setIsTruncated] =
|
|
25945
|
+
const ref = useRef34(null);
|
|
25946
|
+
const [isTruncated, setIsTruncated] = useState56(false);
|
|
25918
25947
|
const isMultiLine = lines > 1;
|
|
25919
|
-
|
|
25948
|
+
useEffect44(() => {
|
|
25920
25949
|
const el = ref.current;
|
|
25921
25950
|
if (!el) return;
|
|
25922
25951
|
const check = () => {
|
|
@@ -26316,14 +26345,14 @@ function OrganizationCard({
|
|
|
26316
26345
|
|
|
26317
26346
|
// src/components/ui/service-card.tsx
|
|
26318
26347
|
init_cn();
|
|
26319
|
-
import { useMemo as useMemo39, useState as
|
|
26348
|
+
import { useMemo as useMemo39, useState as useState92 } from "react";
|
|
26320
26349
|
import { ExternalLink as ExternalLink7 } from "lucide-react";
|
|
26321
26350
|
|
|
26322
26351
|
// src/components/providers/dynamic-theme-provider.tsx
|
|
26323
26352
|
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
26324
26353
|
|
|
26325
26354
|
// src/hooks/use-dynamic-theming.ts
|
|
26326
|
-
import { useState as
|
|
26355
|
+
import { useState as useState57, useEffect as useEffect45 } from "react";
|
|
26327
26356
|
var defaultTheme = {
|
|
26328
26357
|
primaryColor: "#FFC008",
|
|
26329
26358
|
secondaryColor: "#161616",
|
|
@@ -26332,9 +26361,9 @@ var defaultTheme = {
|
|
|
26332
26361
|
textColor: "#161616"
|
|
26333
26362
|
};
|
|
26334
26363
|
function useDynamicTheming() {
|
|
26335
|
-
const [theme, setTheme] =
|
|
26336
|
-
const [isDark, setIsDark] =
|
|
26337
|
-
|
|
26364
|
+
const [theme, setTheme] = useState57(defaultTheme);
|
|
26365
|
+
const [isDark, setIsDark] = useState57(false);
|
|
26366
|
+
useEffect45(() => {
|
|
26338
26367
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
26339
26368
|
setIsDark(mediaQuery.matches);
|
|
26340
26369
|
const handleChange = (e) => {
|
|
@@ -26422,7 +26451,7 @@ function useThemeToggle() {
|
|
|
26422
26451
|
}
|
|
26423
26452
|
|
|
26424
26453
|
// src/components/features/array-entry-manager.tsx
|
|
26425
|
-
import { useState as
|
|
26454
|
+
import { useState as useState59, useEffect as useEffect47 } from "react";
|
|
26426
26455
|
import { Trash2, Plus as Plus2, Save, Loader2 as Loader22 } from "lucide-react";
|
|
26427
26456
|
import { jsx as jsx190, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
26428
26457
|
function ArrayEntryManager({
|
|
@@ -26441,14 +26470,14 @@ function ArrayEntryManager({
|
|
|
26441
26470
|
renderLabel,
|
|
26442
26471
|
isSaving = false
|
|
26443
26472
|
}) {
|
|
26444
|
-
const [draftItems, setDraftItems] =
|
|
26445
|
-
const [isDirty, setIsDirty] =
|
|
26446
|
-
|
|
26473
|
+
const [draftItems, setDraftItems] = useState59(items);
|
|
26474
|
+
const [isDirty, setIsDirty] = useState59(false);
|
|
26475
|
+
useEffect47(() => {
|
|
26447
26476
|
if (!isDirty && !isSaving) {
|
|
26448
26477
|
setDraftItems(items);
|
|
26449
26478
|
}
|
|
26450
26479
|
}, [items, isDirty, isSaving]);
|
|
26451
|
-
|
|
26480
|
+
useEffect47(() => {
|
|
26452
26481
|
if (onDirtyChange) {
|
|
26453
26482
|
onDirtyChange(isDirty);
|
|
26454
26483
|
}
|
|
@@ -27574,7 +27603,7 @@ function SsoAuthShell({ children, className }) {
|
|
|
27574
27603
|
|
|
27575
27604
|
// src/components/features/provider-button.tsx
|
|
27576
27605
|
init_button2();
|
|
27577
|
-
import { useState as
|
|
27606
|
+
import { useState as useState61 } from "react";
|
|
27578
27607
|
import { jsx as jsx206 } from "react/jsx-runtime";
|
|
27579
27608
|
var PROVIDER_CONFIG = {
|
|
27580
27609
|
microsoft: {
|
|
@@ -27595,7 +27624,7 @@ var PROVIDER_CONFIG = {
|
|
|
27595
27624
|
}
|
|
27596
27625
|
};
|
|
27597
27626
|
function ProviderButton({ provider, onClick, disabled = false, loading = false }) {
|
|
27598
|
-
const [internalLoading, setInternalLoading] =
|
|
27627
|
+
const [internalLoading, setInternalLoading] = useState61(false);
|
|
27599
27628
|
const config = PROVIDER_CONFIG[provider];
|
|
27600
27629
|
const IconComponent = config.icon;
|
|
27601
27630
|
const isLoading = loading || internalLoading;
|
|
@@ -27679,7 +27708,7 @@ function AuthProvidersList({
|
|
|
27679
27708
|
|
|
27680
27709
|
// src/components/features/changelog-manager.tsx
|
|
27681
27710
|
import { Trash2 as Trash22, Plus as Plus3, ChevronDown as ChevronDown7, ChevronUp as ChevronUp3, Eye as Eye3, EyeOff } from "lucide-react";
|
|
27682
|
-
import { useState as
|
|
27711
|
+
import { useState as useState62, useEffect as useEffect48 } from "react";
|
|
27683
27712
|
import { jsx as jsx208, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
27684
27713
|
function ChangelogManager({
|
|
27685
27714
|
title,
|
|
@@ -27689,8 +27718,8 @@ function ChangelogManager({
|
|
|
27689
27718
|
expandAll = false,
|
|
27690
27719
|
showVisibilityToggle = false
|
|
27691
27720
|
}) {
|
|
27692
|
-
const [expandedIndices, setExpandedIndices] =
|
|
27693
|
-
|
|
27721
|
+
const [expandedIndices, setExpandedIndices] = useState62(/* @__PURE__ */ new Set());
|
|
27722
|
+
useEffect48(() => {
|
|
27694
27723
|
if (expandAll && entries.length > 0) {
|
|
27695
27724
|
setExpandedIndices(new Set(entries.map((_, i) => i)));
|
|
27696
27725
|
}
|
|
@@ -28033,7 +28062,7 @@ var ErrorBoundary = class extends Component3 {
|
|
|
28033
28062
|
|
|
28034
28063
|
// src/components/features/figma-prototype-viewer.tsx
|
|
28035
28064
|
init_cn();
|
|
28036
|
-
import { useState as
|
|
28065
|
+
import { useState as useState63, useRef as useRef35, useEffect as useEffect49, useCallback as useCallback25, useMemo as useMemo29 } from "react";
|
|
28037
28066
|
|
|
28038
28067
|
// src/components/features/section-selector.tsx
|
|
28039
28068
|
init_cn();
|
|
@@ -28402,27 +28431,27 @@ var FigmaPrototypeViewer = ({
|
|
|
28402
28431
|
}) => {
|
|
28403
28432
|
const clientId = process.env.NEXT_PUBLIC_FIGMA_CLIENT_ID || "UTQPwZHR9OZp68TTGPFFi5";
|
|
28404
28433
|
const showDebugPanel = process.env.NEXT_PUBLIC_FIGMA_DEBUG === "true";
|
|
28405
|
-
const iframeRef =
|
|
28406
|
-
const containerRef =
|
|
28407
|
-
const navTimerRef =
|
|
28408
|
-
const touchTimerRef =
|
|
28409
|
-
const [screenWidth, setScreenWidth] =
|
|
28434
|
+
const iframeRef = useRef35(null);
|
|
28435
|
+
const containerRef = useRef35(null);
|
|
28436
|
+
const navTimerRef = useRef35(null);
|
|
28437
|
+
const touchTimerRef = useRef35(null);
|
|
28438
|
+
const [screenWidth, setScreenWidth] = useState63(
|
|
28410
28439
|
typeof window !== "undefined" ? window.innerWidth : DESKTOP_BREAKPOINT
|
|
28411
28440
|
);
|
|
28412
|
-
const [isTouchDevice, setIsTouchDevice] =
|
|
28441
|
+
const [isTouchDevice, setIsTouchDevice] = useState63(() => {
|
|
28413
28442
|
if (typeof window === "undefined") return false;
|
|
28414
28443
|
return "ontouchstart" in window;
|
|
28415
28444
|
});
|
|
28416
|
-
const [iframeState, setIframeState] =
|
|
28417
|
-
const [iframeKey, setIframeKey] =
|
|
28418
|
-
const [isInitialized, setIsInitialized] =
|
|
28419
|
-
const [currentNodeId, setCurrentNodeId] =
|
|
28420
|
-
const [internalActiveSection, setInternalActiveSection] =
|
|
28445
|
+
const [iframeState, setIframeState] = useState63("INITIAL");
|
|
28446
|
+
const [iframeKey, setIframeKey] = useState63(0);
|
|
28447
|
+
const [isInitialized, setIsInitialized] = useState63(false);
|
|
28448
|
+
const [currentNodeId, setCurrentNodeId] = useState63(null);
|
|
28449
|
+
const [internalActiveSection, setInternalActiveSection] = useState63(
|
|
28421
28450
|
config.defaultSectionId || config.sections[0]?.id || ""
|
|
28422
28451
|
);
|
|
28423
28452
|
const activeSection = externalActiveSection || internalActiveSection;
|
|
28424
|
-
const [isNavigating, setIsNavigating] =
|
|
28425
|
-
const [containerDimensions, setContainerDimensions] =
|
|
28453
|
+
const [isNavigating, setIsNavigating] = useState63(false);
|
|
28454
|
+
const [containerDimensions, setContainerDimensions] = useState63({ width: 1200, height: 800 });
|
|
28426
28455
|
const viewMode = useMemo29(
|
|
28427
28456
|
() => getViewMode(screenWidth, isTouchDevice),
|
|
28428
28457
|
[screenWidth, isTouchDevice]
|
|
@@ -28471,7 +28500,7 @@ var FigmaPrototypeViewer = ({
|
|
|
28471
28500
|
embedUrl,
|
|
28472
28501
|
iframeKey
|
|
28473
28502
|
]);
|
|
28474
|
-
|
|
28503
|
+
useEffect49(() => {
|
|
28475
28504
|
const handleResize = () => {
|
|
28476
28505
|
const newWidth = window.innerWidth;
|
|
28477
28506
|
setScreenWidth(newWidth);
|
|
@@ -28484,8 +28513,8 @@ var FigmaPrototypeViewer = ({
|
|
|
28484
28513
|
window.addEventListener("resize", handleResize);
|
|
28485
28514
|
return () => window.removeEventListener("resize", handleResize);
|
|
28486
28515
|
}, []);
|
|
28487
|
-
const [lastViewMode, setLastViewMode] =
|
|
28488
|
-
|
|
28516
|
+
const [lastViewMode, setLastViewMode] = useState63(viewMode);
|
|
28517
|
+
useEffect49(() => {
|
|
28489
28518
|
if (lastViewMode !== viewMode && iframeState === "READY") {
|
|
28490
28519
|
console.log("[ViewMode Change]", lastViewMode, "\u2192", viewMode);
|
|
28491
28520
|
setIframeState("RELOADING");
|
|
@@ -28493,7 +28522,7 @@ var FigmaPrototypeViewer = ({
|
|
|
28493
28522
|
}
|
|
28494
28523
|
setLastViewMode(viewMode);
|
|
28495
28524
|
}, [viewMode, lastViewMode, iframeState]);
|
|
28496
|
-
|
|
28525
|
+
useEffect49(() => {
|
|
28497
28526
|
const handleVisibilityChange = () => {
|
|
28498
28527
|
if (document.visibilityState === "visible" && iframeState === "READY") {
|
|
28499
28528
|
console.log("[Sleep Recovery] Reloading iframe after sleep");
|
|
@@ -28504,7 +28533,7 @@ var FigmaPrototypeViewer = ({
|
|
|
28504
28533
|
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
28505
28534
|
return () => document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
28506
28535
|
}, [iframeState]);
|
|
28507
|
-
|
|
28536
|
+
useEffect49(() => {
|
|
28508
28537
|
const handleMessage = (event) => {
|
|
28509
28538
|
if (event.origin !== "https://www.figma.com") return;
|
|
28510
28539
|
const validEvents = ["INITIAL_LOAD", "NEW_STATE", "PRESENTED_NODE_CHANGED"];
|
|
@@ -28588,12 +28617,12 @@ var FigmaPrototypeViewer = ({
|
|
|
28588
28617
|
}
|
|
28589
28618
|
}, 500);
|
|
28590
28619
|
}, []);
|
|
28591
|
-
|
|
28620
|
+
useEffect49(() => {
|
|
28592
28621
|
if (externalActiveSection && externalActiveSection !== activeSection && isInitialized) {
|
|
28593
28622
|
navigateToSection(externalActiveSection);
|
|
28594
28623
|
}
|
|
28595
28624
|
}, [externalActiveSection, activeSection, isInitialized, navigateToSection]);
|
|
28596
|
-
|
|
28625
|
+
useEffect49(() => {
|
|
28597
28626
|
return () => {
|
|
28598
28627
|
if (navTimerRef.current) clearTimeout(navTimerRef.current);
|
|
28599
28628
|
if (touchTimerRef.current) clearTimeout(touchTimerRef.current);
|
|
@@ -28696,7 +28725,7 @@ var FigmaPrototypeViewer = ({
|
|
|
28696
28725
|
|
|
28697
28726
|
// src/components/features/filters-dropdown.tsx
|
|
28698
28727
|
init_cn();
|
|
28699
|
-
import { useEffect as
|
|
28728
|
+
import { useEffect as useEffect50, useRef as useRef36, useState as useState64 } from "react";
|
|
28700
28729
|
import { jsx as jsx215, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
28701
28730
|
var FilterCheckbox = ({ checked, disabled = false, className }) => {
|
|
28702
28731
|
return /* @__PURE__ */ jsx215(
|
|
@@ -28728,15 +28757,15 @@ var FiltersDropdown = ({
|
|
|
28728
28757
|
placement = "bottom-start",
|
|
28729
28758
|
responsive = true
|
|
28730
28759
|
}) => {
|
|
28731
|
-
const [isOpen, setIsOpen] =
|
|
28732
|
-
const [shouldRender, setShouldRender] =
|
|
28733
|
-
const [isVisible, setIsVisible] =
|
|
28734
|
-
const [isMobile, setIsMobile] =
|
|
28735
|
-
const [actualPlacement, setActualPlacement] =
|
|
28736
|
-
const dropdownRef =
|
|
28737
|
-
const triggerRef =
|
|
28738
|
-
const containerRef =
|
|
28739
|
-
|
|
28760
|
+
const [isOpen, setIsOpen] = useState64(false);
|
|
28761
|
+
const [shouldRender, setShouldRender] = useState64(false);
|
|
28762
|
+
const [isVisible, setIsVisible] = useState64(false);
|
|
28763
|
+
const [isMobile, setIsMobile] = useState64(false);
|
|
28764
|
+
const [actualPlacement, setActualPlacement] = useState64(placement);
|
|
28765
|
+
const dropdownRef = useRef36(null);
|
|
28766
|
+
const triggerRef = useRef36(null);
|
|
28767
|
+
const containerRef = useRef36(null);
|
|
28768
|
+
useEffect50(() => {
|
|
28740
28769
|
if (isOpen) {
|
|
28741
28770
|
setShouldRender(true);
|
|
28742
28771
|
let id2 = 0;
|
|
@@ -28752,7 +28781,7 @@ var FiltersDropdown = ({
|
|
|
28752
28781
|
const t = setTimeout(() => setShouldRender(false), ANIMATION_MS);
|
|
28753
28782
|
return () => clearTimeout(t);
|
|
28754
28783
|
}, [isOpen]);
|
|
28755
|
-
|
|
28784
|
+
useEffect50(() => {
|
|
28756
28785
|
if (!responsive) {
|
|
28757
28786
|
setIsMobile(false);
|
|
28758
28787
|
return;
|
|
@@ -28764,7 +28793,7 @@ var FiltersDropdown = ({
|
|
|
28764
28793
|
window.addEventListener("resize", checkMobile);
|
|
28765
28794
|
return () => window.removeEventListener("resize", checkMobile);
|
|
28766
28795
|
}, [responsive]);
|
|
28767
|
-
|
|
28796
|
+
useEffect50(() => {
|
|
28768
28797
|
if (!isOpen || isMobile || !triggerRef.current) return;
|
|
28769
28798
|
const calculateOptimalPlacement = () => {
|
|
28770
28799
|
const trigger = triggerRef.current;
|
|
@@ -28790,7 +28819,7 @@ var FiltersDropdown = ({
|
|
|
28790
28819
|
window.addEventListener("resize", calculateOptimalPlacement);
|
|
28791
28820
|
return () => window.removeEventListener("resize", calculateOptimalPlacement);
|
|
28792
28821
|
}, [isOpen, isMobile, placement]);
|
|
28793
|
-
const [selectedFilters, setSelectedFilters] =
|
|
28822
|
+
const [selectedFilters, setSelectedFilters] = useState64(() => {
|
|
28794
28823
|
if (currentFilters) {
|
|
28795
28824
|
return { ...currentFilters };
|
|
28796
28825
|
}
|
|
@@ -28801,12 +28830,12 @@ var FiltersDropdown = ({
|
|
|
28801
28830
|
return initial;
|
|
28802
28831
|
});
|
|
28803
28832
|
const currentFiltersStr = currentFilters ? JSON.stringify(currentFilters) : "";
|
|
28804
|
-
|
|
28833
|
+
useEffect50(() => {
|
|
28805
28834
|
if (currentFilters) {
|
|
28806
28835
|
setSelectedFilters({ ...currentFilters });
|
|
28807
28836
|
}
|
|
28808
28837
|
}, [currentFiltersStr]);
|
|
28809
|
-
|
|
28838
|
+
useEffect50(() => {
|
|
28810
28839
|
const handleClickOutside = (event) => {
|
|
28811
28840
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
28812
28841
|
setIsOpen(false);
|
|
@@ -28823,7 +28852,7 @@ var FiltersDropdown = ({
|
|
|
28823
28852
|
};
|
|
28824
28853
|
}
|
|
28825
28854
|
}, [isOpen, placement]);
|
|
28826
|
-
|
|
28855
|
+
useEffect50(() => {
|
|
28827
28856
|
const handleEscape = (e) => {
|
|
28828
28857
|
if (e.key === "Escape" && isOpen) {
|
|
28829
28858
|
setIsOpen(false);
|
|
@@ -29010,7 +29039,7 @@ var FiltersDropdown = ({
|
|
|
29010
29039
|
] });
|
|
29011
29040
|
};
|
|
29012
29041
|
var useFiltersDropdown = (initialSections) => {
|
|
29013
|
-
const [appliedFilters, setAppliedFilters] =
|
|
29042
|
+
const [appliedFilters, setAppliedFilters] = useState64(() => {
|
|
29014
29043
|
const initial = {};
|
|
29015
29044
|
initialSections.forEach((section) => {
|
|
29016
29045
|
if (section.defaultSelected) {
|
|
@@ -29089,13 +29118,13 @@ function KnowledgeBaseLinksManager({
|
|
|
29089
29118
|
}
|
|
29090
29119
|
|
|
29091
29120
|
// src/components/features/loading-provider.tsx
|
|
29092
|
-
import { createContext as createContext6, useContext as useContext6, useState as
|
|
29121
|
+
import { createContext as createContext6, useContext as useContext6, useState as useState65, useEffect as useEffect51 } from "react";
|
|
29093
29122
|
import { jsx as jsx218, jsxs as jsxs169 } from "react/jsx-runtime";
|
|
29094
29123
|
var LoadingContext = createContext6(void 0);
|
|
29095
29124
|
function LoadingProvider({ children }) {
|
|
29096
|
-
const [isLoading, setIsLoading] =
|
|
29097
|
-
const [progress, setProgress] =
|
|
29098
|
-
|
|
29125
|
+
const [isLoading, setIsLoading] = useState65(false);
|
|
29126
|
+
const [progress, setProgress] = useState65(0);
|
|
29127
|
+
useEffect51(() => {
|
|
29099
29128
|
let interval;
|
|
29100
29129
|
if (isLoading) {
|
|
29101
29130
|
setProgress(10);
|
|
@@ -29140,7 +29169,7 @@ function useLoading() {
|
|
|
29140
29169
|
}
|
|
29141
29170
|
|
|
29142
29171
|
// src/components/features/media-gallery-manager.tsx
|
|
29143
|
-
import { useState as
|
|
29172
|
+
import { useState as useState66, useRef as useRef37, useCallback as useCallback26 } from "react";
|
|
29144
29173
|
import {
|
|
29145
29174
|
Upload,
|
|
29146
29175
|
Image as ImageIcon2,
|
|
@@ -29160,9 +29189,9 @@ function MediaGalleryManager({
|
|
|
29160
29189
|
modalTitle = "Media Gallery",
|
|
29161
29190
|
className = ""
|
|
29162
29191
|
}) {
|
|
29163
|
-
const fileInputRef =
|
|
29164
|
-
const [deletingIndex, setDeletingIndex] =
|
|
29165
|
-
const [draggedIndex, setDraggedIndex] =
|
|
29192
|
+
const fileInputRef = useRef37(null);
|
|
29193
|
+
const [deletingIndex, setDeletingIndex] = useState66(null);
|
|
29194
|
+
const [draggedIndex, setDraggedIndex] = useState66(null);
|
|
29166
29195
|
const handleFileSelect = useCallback26(async (event) => {
|
|
29167
29196
|
const file = event.target.files?.[0];
|
|
29168
29197
|
if (!file) return;
|
|
@@ -29368,7 +29397,7 @@ function OSTypeBadgeGroup({
|
|
|
29368
29397
|
}
|
|
29369
29398
|
|
|
29370
29399
|
// src/components/features/parallax-image-showcase.tsx
|
|
29371
|
-
import { useEffect as
|
|
29400
|
+
import { useEffect as useEffect52, useState as useState67, useRef as useRef38 } from "react";
|
|
29372
29401
|
import { motion, useScroll, useTransform, useMotionValue, useSpring } from "framer-motion";
|
|
29373
29402
|
import { jsx as jsx222, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
29374
29403
|
var ParallaxImageShowcase = ({
|
|
@@ -29386,9 +29415,9 @@ var ParallaxImageShowcase = ({
|
|
|
29386
29415
|
const springConfig = { stiffness: 100, damping: 30 };
|
|
29387
29416
|
const mouseXSpring = useSpring(mouseX, springConfig);
|
|
29388
29417
|
const mouseYSpring = useSpring(mouseY, springConfig);
|
|
29389
|
-
const [componentRect, setComponentRect] =
|
|
29390
|
-
const componentRef =
|
|
29391
|
-
|
|
29418
|
+
const [componentRect, setComponentRect] = useState67(null);
|
|
29419
|
+
const componentRef = useRef38(null);
|
|
29420
|
+
useEffect52(() => {
|
|
29392
29421
|
const updateRect = () => {
|
|
29393
29422
|
if (componentRef.current) {
|
|
29394
29423
|
setComponentRect(componentRef.current.getBoundingClientRect());
|
|
@@ -29402,7 +29431,7 @@ var ParallaxImageShowcase = ({
|
|
|
29402
29431
|
window.removeEventListener("scroll", updateRect);
|
|
29403
29432
|
};
|
|
29404
29433
|
}, []);
|
|
29405
|
-
|
|
29434
|
+
useEffect52(() => {
|
|
29406
29435
|
const handleGlobalMouseMove = (e) => {
|
|
29407
29436
|
if (!componentRect) return;
|
|
29408
29437
|
const centerX = componentRect.left + componentRect.width / 2;
|
|
@@ -29927,7 +29956,7 @@ function PushButtonSelector({
|
|
|
29927
29956
|
}
|
|
29928
29957
|
|
|
29929
29958
|
// src/components/features/release-media-manager.tsx
|
|
29930
|
-
import { useState as
|
|
29959
|
+
import { useState as useState68, useRef as useRef39 } from "react";
|
|
29931
29960
|
import { Trash2 as Trash24, Plus as Plus5, Image as ImageIcon3, Video as VideoIcon2, Upload as Upload2, Loader2 as Loader24, GripVertical as GripVertical2 } from "lucide-react";
|
|
29932
29961
|
import { jsx as jsx226, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
29933
29962
|
function ReleaseMediaManager({
|
|
@@ -29936,8 +29965,8 @@ function ReleaseMediaManager({
|
|
|
29936
29965
|
onUpload,
|
|
29937
29966
|
className = ""
|
|
29938
29967
|
}) {
|
|
29939
|
-
const fileInputRef =
|
|
29940
|
-
const [uploadingIndex, setUploadingIndex] =
|
|
29968
|
+
const fileInputRef = useRef39(null);
|
|
29969
|
+
const [uploadingIndex, setUploadingIndex] = useState68(null);
|
|
29941
29970
|
const handleFileSelect = async (event) => {
|
|
29942
29971
|
const file = event.target.files?.[0];
|
|
29943
29972
|
if (!file) return;
|
|
@@ -30195,7 +30224,7 @@ var SelectButton = React96.forwardRef(
|
|
|
30195
30224
|
SelectButton.displayName = "SelectButton";
|
|
30196
30225
|
|
|
30197
30226
|
// src/components/features/seo-editor-preview.tsx
|
|
30198
|
-
import { useState as
|
|
30227
|
+
import { useState as useState69 } from "react";
|
|
30199
30228
|
import { Globe as Globe3, ExternalLink as ExternalLink6, Upload as Upload3, X as X6, Loader2 as Loader25 } from "lucide-react";
|
|
30200
30229
|
import { Fragment as Fragment43, jsx as jsx228, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
30201
30230
|
function SEOEditorPreview({
|
|
@@ -30218,9 +30247,9 @@ function SEOEditorPreview({
|
|
|
30218
30247
|
disabled = false,
|
|
30219
30248
|
className = ""
|
|
30220
30249
|
}) {
|
|
30221
|
-
const [imageError, setImageError] =
|
|
30222
|
-
const [isUploading, setIsUploading] =
|
|
30223
|
-
const [fileInputRef, setFileInputRef] =
|
|
30250
|
+
const [imageError, setImageError] = useState69(false);
|
|
30251
|
+
const [isUploading, setIsUploading] = useState69(false);
|
|
30252
|
+
const [fileInputRef, setFileInputRef] = useState69(null);
|
|
30224
30253
|
const seoTitleLength = (seoTitle || "").length;
|
|
30225
30254
|
const seoTitleTooLong = seoTitleLength > SEO_TITLE_MAX_LENGTH;
|
|
30226
30255
|
const seoDescriptionLength = (seoDescription || "").length;
|
|
@@ -30716,7 +30745,7 @@ function StatusFilterComponent({
|
|
|
30716
30745
|
}
|
|
30717
30746
|
|
|
30718
30747
|
// src/components/features/tags-selector.tsx
|
|
30719
|
-
import { useState as
|
|
30748
|
+
import { useState as useState70 } from "react";
|
|
30720
30749
|
import { Search as Search2, X as X7, Plus as Plus6, Loader2 as Loader26 } from "lucide-react";
|
|
30721
30750
|
import { jsx as jsx232, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
30722
30751
|
function TagsSelector({
|
|
@@ -30730,9 +30759,9 @@ function TagsSelector({
|
|
|
30730
30759
|
disabled = false,
|
|
30731
30760
|
allowCreate = true
|
|
30732
30761
|
}) {
|
|
30733
|
-
const [searchQuery, setSearchQuery] =
|
|
30734
|
-
const [showDropdown, setShowDropdown] =
|
|
30735
|
-
const [isCreating, setIsCreating] =
|
|
30762
|
+
const [searchQuery, setSearchQuery] = useState70("");
|
|
30763
|
+
const [showDropdown, setShowDropdown] = useState70(false);
|
|
30764
|
+
const [isCreating, setIsCreating] = useState70(false);
|
|
30736
30765
|
const handleTagAdd = (tagId) => {
|
|
30737
30766
|
if (!selectedTagIds.includes(tagId) && selectedTagIds.length < maxTags) {
|
|
30738
30767
|
onTagsChange([...selectedTagIds, tagId]);
|
|
@@ -30946,7 +30975,7 @@ function getCaptionsUrl(entityType, entityId, srtContent) {
|
|
|
30946
30975
|
}
|
|
30947
30976
|
|
|
30948
30977
|
// src/components/features/video-source-selector.tsx
|
|
30949
|
-
import { useState as
|
|
30978
|
+
import { useState as useState71, useCallback as useCallback27 } from "react";
|
|
30950
30979
|
import { Upload as Upload4, X as X8, Video as VideoIcon3 } from "lucide-react";
|
|
30951
30980
|
init_button2();
|
|
30952
30981
|
import { jsx as jsx235, jsxs as jsxs183 } from "react/jsx-runtime";
|
|
@@ -30972,10 +31001,10 @@ function VideoSourceSelector({
|
|
|
30972
31001
|
showTitle = true,
|
|
30973
31002
|
className = ""
|
|
30974
31003
|
}) {
|
|
30975
|
-
const [isUploading, setIsUploading] =
|
|
30976
|
-
const [uploadProgress, setUploadProgress] =
|
|
30977
|
-
const [uploadMessage, setUploadMessage] =
|
|
30978
|
-
const [uploadError, setUploadError] =
|
|
31004
|
+
const [isUploading, setIsUploading] = useState71(false);
|
|
31005
|
+
const [uploadProgress, setUploadProgress] = useState71(0);
|
|
31006
|
+
const [uploadMessage, setUploadMessage] = useState71("");
|
|
31007
|
+
const [uploadError, setUploadError] = useState71(null);
|
|
30979
31008
|
const handleUploadClick = useCallback27(() => {
|
|
30980
31009
|
const input = document.createElement("input");
|
|
30981
31010
|
input.type = "file";
|
|
@@ -31315,7 +31344,7 @@ function TranscriptSummaryEditor({
|
|
|
31315
31344
|
}
|
|
31316
31345
|
|
|
31317
31346
|
// src/components/features/highlight-video-section.tsx
|
|
31318
|
-
import { useState as
|
|
31347
|
+
import { useState as useState72 } from "react";
|
|
31319
31348
|
import { Sparkles as Sparkles4, Upload as Upload5 } from "lucide-react";
|
|
31320
31349
|
init_button2();
|
|
31321
31350
|
|
|
@@ -31614,7 +31643,7 @@ function HighlightVideoSection({
|
|
|
31614
31643
|
disabled = false,
|
|
31615
31644
|
className = ""
|
|
31616
31645
|
}) {
|
|
31617
|
-
const [uploadError, setUploadError] =
|
|
31646
|
+
const [uploadError, setUploadError] = useState72(null);
|
|
31618
31647
|
const handleUploadClick = () => {
|
|
31619
31648
|
const input = document.createElement("input");
|
|
31620
31649
|
input.type = "file";
|
|
@@ -32445,7 +32474,7 @@ function ViewToggle({
|
|
|
32445
32474
|
|
|
32446
32475
|
// src/components/features/policy-configuration-panel.tsx
|
|
32447
32476
|
init_cn();
|
|
32448
|
-
import { useEffect as
|
|
32477
|
+
import { useEffect as useEffect53, useState as useState73 } from "react";
|
|
32449
32478
|
import { ChevronDown as ChevronDown8, Shield as Shield2 } from "lucide-react";
|
|
32450
32479
|
init_button2();
|
|
32451
32480
|
import { Fragment as Fragment44, jsx as jsx253, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
@@ -32621,9 +32650,9 @@ var PolicyConfigurationPanel = ({
|
|
|
32621
32650
|
onCategoryPermissionChange,
|
|
32622
32651
|
className
|
|
32623
32652
|
}) => {
|
|
32624
|
-
const [expandedIds, setExpandedIds] =
|
|
32625
|
-
const [bulkLevels, setBulkLevels] =
|
|
32626
|
-
|
|
32653
|
+
const [expandedIds, setExpandedIds] = useState73(/* @__PURE__ */ new Set());
|
|
32654
|
+
const [bulkLevels, setBulkLevels] = useState73({});
|
|
32655
|
+
useEffect53(() => {
|
|
32627
32656
|
setBulkLevels({});
|
|
32628
32657
|
}, [editMode]);
|
|
32629
32658
|
const handleToggle = (categoryId) => {
|
|
@@ -32663,7 +32692,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
|
|
|
32663
32692
|
init_button2();
|
|
32664
32693
|
|
|
32665
32694
|
// src/components/ui/phone-input.tsx
|
|
32666
|
-
import { useCallback as useCallback28, useEffect as
|
|
32695
|
+
import { useCallback as useCallback28, useEffect as useEffect54, useMemo as useMemo30, useRef as useRef40, useState as useState74 } from "react";
|
|
32667
32696
|
import { jsx as jsx254, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
32668
32697
|
function PhoneInput({
|
|
32669
32698
|
value,
|
|
@@ -32680,8 +32709,8 @@ function PhoneInput({
|
|
|
32680
32709
|
() => [...priority, ...others].find((c) => c.code === countryCode),
|
|
32681
32710
|
[countryCode, priority, others]
|
|
32682
32711
|
);
|
|
32683
|
-
const [isInvalid, setIsInvalid] =
|
|
32684
|
-
const debounceRef =
|
|
32712
|
+
const [isInvalid, setIsInvalid] = useState74(false);
|
|
32713
|
+
const debounceRef = useRef40(null);
|
|
32685
32714
|
const digitCount = useCallback28((val) => val.replace(/[^0-9]/g, "").length, []);
|
|
32686
32715
|
const runValidation = useCallback28((phone) => {
|
|
32687
32716
|
if (!phone || digitCount(phone) === 0) {
|
|
@@ -32697,7 +32726,7 @@ function PhoneInput({
|
|
|
32697
32726
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
32698
32727
|
debounceRef.current = setTimeout(() => runValidation(phone), 300);
|
|
32699
32728
|
}, [runValidation]);
|
|
32700
|
-
|
|
32729
|
+
useEffect54(() => {
|
|
32701
32730
|
return () => {
|
|
32702
32731
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
32703
32732
|
};
|
|
@@ -32764,7 +32793,7 @@ function CountryOption({ country }) {
|
|
|
32764
32793
|
// src/components/features/waitlist-form.tsx
|
|
32765
32794
|
init_cn();
|
|
32766
32795
|
import { getCountries as getCountries2 } from "libphonenumber-js";
|
|
32767
|
-
import { useEffect as
|
|
32796
|
+
import { useEffect as useEffect55, useState as useState75 } from "react";
|
|
32768
32797
|
import { Fragment as Fragment45, jsx as jsx255, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
32769
32798
|
function WaitlistForm({
|
|
32770
32799
|
id = "waitlist-form",
|
|
@@ -32784,22 +32813,22 @@ function WaitlistForm({
|
|
|
32784
32813
|
privacyPolicyUrl,
|
|
32785
32814
|
consentText = "I agree to receive recurring automated text messages at the phone number provided. Msg & data rates may apply. Msg frequency varies. Reply HELP for help and STOP to cancel."
|
|
32786
32815
|
}) {
|
|
32787
|
-
const [email, setEmail] =
|
|
32788
|
-
const [phone, setPhone] =
|
|
32789
|
-
const [countryCode, setCountryCode] =
|
|
32816
|
+
const [email, setEmail] = useState75(defaultEmail);
|
|
32817
|
+
const [phone, setPhone] = useState75(defaultPhone);
|
|
32818
|
+
const [countryCode, setCountryCode] = useState75("US");
|
|
32790
32819
|
const { toast } = useToast();
|
|
32791
32820
|
const { honeypotInputProps, getSignals, resetSignals } = useHumanitySignals();
|
|
32792
|
-
const [smsConsent, setSmsConsent] =
|
|
32793
|
-
const [isClient, setIsClient] =
|
|
32794
|
-
const [isPhoneInvalid, setIsPhoneInvalid] =
|
|
32795
|
-
const [showConsentError, setShowConsentError] =
|
|
32821
|
+
const [smsConsent, setSmsConsent] = useState75(false);
|
|
32822
|
+
const [isClient, setIsClient] = useState75(false);
|
|
32823
|
+
const [isPhoneInvalid, setIsPhoneInvalid] = useState75(false);
|
|
32824
|
+
const [showConsentError, setShowConsentError] = useState75(false);
|
|
32796
32825
|
const isMailDomainGeneric = hasGenericEmailDomain(email);
|
|
32797
|
-
|
|
32826
|
+
useEffect55(() => {
|
|
32798
32827
|
if (defaultEmail) {
|
|
32799
32828
|
setEmail(defaultEmail);
|
|
32800
32829
|
}
|
|
32801
32830
|
}, [defaultEmail]);
|
|
32802
|
-
|
|
32831
|
+
useEffect55(() => {
|
|
32803
32832
|
setIsClient(true);
|
|
32804
32833
|
if (!geoApiUrl) return;
|
|
32805
32834
|
const supportedCountries = new Set(getCountries2());
|
|
@@ -33187,7 +33216,7 @@ function useOptionalNotifications() {
|
|
|
33187
33216
|
}
|
|
33188
33217
|
|
|
33189
33218
|
// src/components/features/notifications/notification-drawer.tsx
|
|
33190
|
-
import { useEffect as
|
|
33219
|
+
import { useEffect as useEffect59, useRef as useRef43 } from "react";
|
|
33191
33220
|
|
|
33192
33221
|
// src/components/navigation/app-layout-context.ts
|
|
33193
33222
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -33682,7 +33711,7 @@ init_button2();
|
|
|
33682
33711
|
init_cn();
|
|
33683
33712
|
|
|
33684
33713
|
// src/components/features/notifications/notification-tile.tsx
|
|
33685
|
-
import { useMemo as useMemo32, useEffect as
|
|
33714
|
+
import { useMemo as useMemo32, useEffect as useEffect58, useState as useState78 } from "react";
|
|
33686
33715
|
init_cn();
|
|
33687
33716
|
import { jsx as jsx258, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
33688
33717
|
var variantBySeverity = {
|
|
@@ -33723,14 +33752,14 @@ function NotificationTile({
|
|
|
33723
33752
|
settled
|
|
33724
33753
|
} = notification;
|
|
33725
33754
|
const accentVariant = (severity ? variantBySeverity[severity] : void 0) ?? variant;
|
|
33726
|
-
const [failedImageUrl, setFailedImageUrl] =
|
|
33755
|
+
const [failedImageUrl, setFailedImageUrl] = useState78(null);
|
|
33727
33756
|
const image = imageUrl && imageUrl !== failedImageUrl ? imageUrl : void 0;
|
|
33728
33757
|
const createdAtDate = new Date(createdAt);
|
|
33729
33758
|
const createdAtIso = Number.isNaN(createdAtDate.getTime()) ? null : createdAtDate.toISOString();
|
|
33730
33759
|
const initialElapsed = useMemo32(() => Date.now() - createdAt, [createdAt]);
|
|
33731
33760
|
const isLive = !read && !settled && initialElapsed < liveDurationMs;
|
|
33732
33761
|
const counting = isLive && !paused;
|
|
33733
|
-
|
|
33762
|
+
useEffect58(() => {
|
|
33734
33763
|
if (!counting) return;
|
|
33735
33764
|
const remaining = Math.max(0, liveDurationMs - initialElapsed);
|
|
33736
33765
|
const timer = window.setTimeout(() => {
|
|
@@ -33955,11 +33984,11 @@ function DrawerScrollList({
|
|
|
33955
33984
|
loadMoreRootMargin,
|
|
33956
33985
|
renderTile
|
|
33957
33986
|
}) {
|
|
33958
|
-
const scrollRef =
|
|
33959
|
-
const sentinelRef =
|
|
33960
|
-
const loadMoreRef =
|
|
33987
|
+
const scrollRef = useRef43(null);
|
|
33988
|
+
const sentinelRef = useRef43(null);
|
|
33989
|
+
const loadMoreRef = useRef43(loadMore);
|
|
33961
33990
|
loadMoreRef.current = loadMore;
|
|
33962
|
-
|
|
33991
|
+
useEffect59(() => {
|
|
33963
33992
|
if (!loadMore || !hasMore || isLoadingMore) return;
|
|
33964
33993
|
const sentinel = sentinelRef.current;
|
|
33965
33994
|
const root = scrollRef.current;
|
|
@@ -34179,7 +34208,7 @@ function NotificationPopups({
|
|
|
34179
34208
|
|
|
34180
34209
|
// src/components/features/notifications/approval-request-notification-tile.tsx
|
|
34181
34210
|
init_button2();
|
|
34182
|
-
import { useMemo as useMemo33, useState as
|
|
34211
|
+
import { useMemo as useMemo33, useState as useState79 } from "react";
|
|
34183
34212
|
|
|
34184
34213
|
// src/components/chat/types/chat.types.ts
|
|
34185
34214
|
var CHAT_TYPE = {
|
|
@@ -34395,10 +34424,10 @@ function ApprovalRequestNotificationTile({
|
|
|
34395
34424
|
defaultExpanded = false,
|
|
34396
34425
|
className
|
|
34397
34426
|
}) {
|
|
34398
|
-
const [expanded, setExpanded] =
|
|
34399
|
-
const [pinned, setPinned] =
|
|
34400
|
-
const [processing, setProcessing] =
|
|
34401
|
-
const [localStatus, setLocalStatus] =
|
|
34427
|
+
const [expanded, setExpanded] = useState79(defaultExpanded);
|
|
34428
|
+
const [pinned, setPinned] = useState79(defaultExpanded);
|
|
34429
|
+
const [processing, setProcessing] = useState79(false);
|
|
34430
|
+
const [localStatus, setLocalStatus] = useState79(null);
|
|
34402
34431
|
const approval = getApprovalMeta(notification);
|
|
34403
34432
|
const resolvedStatus = resolutionToStatus(approval?.resolution);
|
|
34404
34433
|
const status = resolvedStatus !== "pending" ? resolvedStatus : localStatus ?? "pending";
|
|
@@ -34499,12 +34528,12 @@ function useOptionalTimeTracker() {
|
|
|
34499
34528
|
|
|
34500
34529
|
// src/components/features/time-tracker/time-tracker-panel.tsx
|
|
34501
34530
|
init_cn();
|
|
34502
|
-
import { useEffect as
|
|
34531
|
+
import { useEffect as useEffect61, useState as useState82 } from "react";
|
|
34503
34532
|
init_button();
|
|
34504
34533
|
init_split_button();
|
|
34505
34534
|
|
|
34506
34535
|
// src/components/features/time-tracker/use-tracker-clock.ts
|
|
34507
|
-
import { useEffect as
|
|
34536
|
+
import { useEffect as useEffect60, useState as useState81 } from "react";
|
|
34508
34537
|
function formatElapsed(totalMs) {
|
|
34509
34538
|
const totalSeconds = Math.max(0, Math.floor(totalMs / 1e3));
|
|
34510
34539
|
const hours = Math.floor(totalSeconds / 3600);
|
|
@@ -34514,8 +34543,8 @@ function formatElapsed(totalMs) {
|
|
|
34514
34543
|
return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
|
|
34515
34544
|
}
|
|
34516
34545
|
function useTrackerClock({ status, runningSince, accumulatedMs = 0 }) {
|
|
34517
|
-
const [now, setNow] =
|
|
34518
|
-
|
|
34546
|
+
const [now, setNow] = useState81(() => Date.now());
|
|
34547
|
+
useEffect60(() => {
|
|
34519
34548
|
if (status !== "tracking") return;
|
|
34520
34549
|
setNow(Date.now());
|
|
34521
34550
|
const id = setInterval(() => setNow(Date.now()), 1e3);
|
|
@@ -34570,12 +34599,12 @@ function TimeTrackerPanel({
|
|
|
34570
34599
|
className
|
|
34571
34600
|
}) {
|
|
34572
34601
|
const elapsedLabel = useTrackerClock({ status, runningSince, accumulatedMs });
|
|
34573
|
-
const [showValidationError, setShowValidationError] =
|
|
34602
|
+
const [showValidationError, setShowValidationError] = useState82(false);
|
|
34574
34603
|
const isRunning = status === "tracking";
|
|
34575
34604
|
const isActive = status !== "ready";
|
|
34576
34605
|
const hasContent = selectedTicketId != null || notes.trim() !== "";
|
|
34577
34606
|
const showFieldError = isActive && showValidationError && !hasContent;
|
|
34578
|
-
|
|
34607
|
+
useEffect61(() => {
|
|
34579
34608
|
if (status === "ready") setShowValidationError(false);
|
|
34580
34609
|
}, [status]);
|
|
34581
34610
|
const handleSubmit = () => {
|
|
@@ -34826,7 +34855,7 @@ function LastEntryRow({ entry, onClick }) {
|
|
|
34826
34855
|
// src/components/features/time-tracker/time-tracker-header-button.tsx
|
|
34827
34856
|
init_cn();
|
|
34828
34857
|
import * as PopoverPrimitive5 from "@radix-ui/react-popover";
|
|
34829
|
-
import { useEffect as
|
|
34858
|
+
import { useEffect as useEffect62, useRef as useRef44 } from "react";
|
|
34830
34859
|
|
|
34831
34860
|
// src/components/navigation/header-button.tsx
|
|
34832
34861
|
init_cn();
|
|
@@ -34865,11 +34894,11 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
34865
34894
|
const layoutContainer = useAppLayoutDrawerContainer();
|
|
34866
34895
|
const coordination = useAppLayoutDrawerCoordination();
|
|
34867
34896
|
const isOpen = ctx?.isOpen ?? false;
|
|
34868
|
-
const isOpenRef =
|
|
34897
|
+
const isOpenRef = useRef44(isOpen);
|
|
34869
34898
|
isOpenRef.current = isOpen;
|
|
34870
|
-
const closeRef =
|
|
34899
|
+
const closeRef = useRef44(ctx?.close);
|
|
34871
34900
|
closeRef.current = ctx?.close;
|
|
34872
|
-
const selfHandleRef =
|
|
34901
|
+
const selfHandleRef = useRef44(null);
|
|
34873
34902
|
if (!selfHandleRef.current) {
|
|
34874
34903
|
selfHandleRef.current = {
|
|
34875
34904
|
close: () => {
|
|
@@ -34877,10 +34906,10 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
34877
34906
|
}
|
|
34878
34907
|
};
|
|
34879
34908
|
}
|
|
34880
|
-
|
|
34909
|
+
useEffect62(() => {
|
|
34881
34910
|
if (isOpen) coordination?.notifyDrawerDidOpen(selfHandleRef.current ?? void 0);
|
|
34882
34911
|
}, [isOpen, coordination]);
|
|
34883
|
-
|
|
34912
|
+
useEffect62(() => {
|
|
34884
34913
|
if (!selfHandleRef.current) return;
|
|
34885
34914
|
return coordination?.registerDrawer(selfHandleRef.current);
|
|
34886
34915
|
}, [coordination]);
|
|
@@ -35497,13 +35526,13 @@ function EmptyState2() {
|
|
|
35497
35526
|
}
|
|
35498
35527
|
|
|
35499
35528
|
// src/components/features/board/use-board-collapse.ts
|
|
35500
|
-
import { useCallback as useCallback33, useState as
|
|
35529
|
+
import { useCallback as useCallback33, useState as useState84 } from "react";
|
|
35501
35530
|
function useBoardCollapse(storageKey) {
|
|
35502
35531
|
const [persisted, setPersisted] = useLocalStorage(
|
|
35503
35532
|
storageKey ?? "__board_collapse_unused__",
|
|
35504
35533
|
{}
|
|
35505
35534
|
);
|
|
35506
|
-
const [memory, setMemory] =
|
|
35535
|
+
const [memory, setMemory] = useState84({});
|
|
35507
35536
|
const collapsed = storageKey ? persisted : memory;
|
|
35508
35537
|
const setMap = storageKey ? setPersisted : setMemory;
|
|
35509
35538
|
const toggle = useCallback33(
|
|
@@ -35894,18 +35923,18 @@ function SortableRow({
|
|
|
35894
35923
|
|
|
35895
35924
|
// src/components/navigation/header.tsx
|
|
35896
35925
|
init_next_link();
|
|
35897
|
-
import React110, { useEffect as
|
|
35926
|
+
import React110, { useEffect as useEffect65, useRef as useRef48, useState as useState86 } from "react";
|
|
35898
35927
|
init_button2();
|
|
35899
35928
|
|
|
35900
35929
|
// src/components/navigation/mobile-nav-panel.tsx
|
|
35901
|
-
import { useRef as
|
|
35930
|
+
import { useRef as useRef47 } from "react";
|
|
35902
35931
|
import { usePreventScroll as usePreventScroll3 } from "@react-aria/overlays";
|
|
35903
35932
|
init_button2();
|
|
35904
35933
|
import { X as X10 } from "lucide-react";
|
|
35905
35934
|
import { Fragment as Fragment52, jsx as jsx273, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
35906
35935
|
var MOBILE_NAV_PANEL_ID = "mobile-nav-panel";
|
|
35907
35936
|
function MobileNavPanel({ isOpen, config }) {
|
|
35908
|
-
const panelRef =
|
|
35937
|
+
const panelRef = useRef47(null);
|
|
35909
35938
|
usePreventScroll3({ isDisabled: !isOpen });
|
|
35910
35939
|
useFocusTrap(panelRef, isOpen, { onEscape: config.onClose });
|
|
35911
35940
|
const headerHeight = useHeaderHeight(64, { enabled: isOpen });
|
|
@@ -36063,12 +36092,12 @@ function MingoAiButton({ source, icon, label = "Mingo AI", className, onClick, .
|
|
|
36063
36092
|
// src/components/navigation/header.tsx
|
|
36064
36093
|
import { Fragment as Fragment53, jsx as jsx275, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
36065
36094
|
function Header2({ config, platform }) {
|
|
36066
|
-
const [show, setShow] =
|
|
36067
|
-
const [lastScrollY, setLastScrollY] =
|
|
36068
|
-
const [openDropdowns, setOpenDropdowns] =
|
|
36069
|
-
const dropdownRefs =
|
|
36070
|
-
const triggerRefs =
|
|
36071
|
-
|
|
36095
|
+
const [show, setShow] = useState86(true);
|
|
36096
|
+
const [lastScrollY, setLastScrollY] = useState86(0);
|
|
36097
|
+
const [openDropdowns, setOpenDropdowns] = useState86({});
|
|
36098
|
+
const dropdownRefs = useRef48({});
|
|
36099
|
+
const triggerRefs = useRef48({});
|
|
36100
|
+
useEffect65(() => {
|
|
36072
36101
|
const handleClickOutside = (event) => {
|
|
36073
36102
|
const target = event.target;
|
|
36074
36103
|
if (!target) return;
|
|
@@ -36097,14 +36126,14 @@ function Header2({ config, platform }) {
|
|
|
36097
36126
|
document.removeEventListener("keydown", handleEscapeKey);
|
|
36098
36127
|
};
|
|
36099
36128
|
}, [openDropdowns]);
|
|
36100
|
-
|
|
36129
|
+
useEffect65(() => {
|
|
36101
36130
|
return () => {
|
|
36102
36131
|
setOpenDropdowns({});
|
|
36103
36132
|
dropdownRefs.current = {};
|
|
36104
36133
|
triggerRefs.current = {};
|
|
36105
36134
|
};
|
|
36106
36135
|
}, []);
|
|
36107
|
-
|
|
36136
|
+
useEffect65(() => {
|
|
36108
36137
|
if (!config.autoHide) {
|
|
36109
36138
|
setShow(true);
|
|
36110
36139
|
return;
|
|
@@ -36345,7 +36374,7 @@ function Header2({ config, platform }) {
|
|
|
36345
36374
|
}
|
|
36346
36375
|
|
|
36347
36376
|
// src/components/navigation/client-only-header.tsx
|
|
36348
|
-
import { useState as
|
|
36377
|
+
import { useState as useState87, useEffect as useEffect66 } from "react";
|
|
36349
36378
|
|
|
36350
36379
|
// src/components/navigation/header-skeleton.tsx
|
|
36351
36380
|
import { jsx as jsx276, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
@@ -36393,8 +36422,8 @@ function HeaderSkeleton({ config }) {
|
|
|
36393
36422
|
// src/components/navigation/client-only-header.tsx
|
|
36394
36423
|
import { jsx as jsx277 } from "react/jsx-runtime";
|
|
36395
36424
|
function ClientOnlyHeader({ config, skeleton }) {
|
|
36396
|
-
const [isClient, setIsClient] =
|
|
36397
|
-
|
|
36425
|
+
const [isClient, setIsClient] = useState87(false);
|
|
36426
|
+
useEffect66(() => {
|
|
36398
36427
|
setIsClient(true);
|
|
36399
36428
|
}, []);
|
|
36400
36429
|
if (!isClient) {
|
|
@@ -36404,20 +36433,20 @@ function ClientOnlyHeader({ config, skeleton }) {
|
|
|
36404
36433
|
}
|
|
36405
36434
|
|
|
36406
36435
|
// src/components/navigation/sliding-sidebar.tsx
|
|
36407
|
-
import { useState as
|
|
36436
|
+
import { useState as useState88, useEffect as useEffect67, useRef as useRef49 } from "react";
|
|
36408
36437
|
import { motion as motion2, AnimatePresence, useReducedMotion } from "framer-motion";
|
|
36409
36438
|
import { usePreventScroll as usePreventScroll4 } from "@react-aria/overlays";
|
|
36410
36439
|
init_button2();
|
|
36411
36440
|
import { Fragment as Fragment54, jsx as jsx278, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
36412
36441
|
function SlidingSidebar({ config }) {
|
|
36413
|
-
const [expandedItems, setExpandedItems] =
|
|
36414
|
-
const [mounted, setMounted] =
|
|
36442
|
+
const [expandedItems, setExpandedItems] = useState88(/* @__PURE__ */ new Set());
|
|
36443
|
+
const [mounted, setMounted] = useState88(false);
|
|
36415
36444
|
const headerHeight = useHeaderHeight();
|
|
36416
|
-
const asideRef =
|
|
36445
|
+
const asideRef = useRef49(null);
|
|
36417
36446
|
const prefersReducedMotion2 = useReducedMotion();
|
|
36418
36447
|
usePreventScroll4({ isDisabled: !config.isOpen });
|
|
36419
36448
|
useFocusTrap(asideRef, config.isOpen, { onEscape: config.onClose, contain: false });
|
|
36420
|
-
|
|
36449
|
+
useEffect67(() => {
|
|
36421
36450
|
setMounted(true);
|
|
36422
36451
|
}, []);
|
|
36423
36452
|
const toggleExpanded = (itemId) => {
|
|
@@ -36585,7 +36614,7 @@ function SlidingSidebar({ config }) {
|
|
|
36585
36614
|
}
|
|
36586
36615
|
|
|
36587
36616
|
// src/components/navigation/sticky-section-nav.tsx
|
|
36588
|
-
import { useEffect as
|
|
36617
|
+
import { useEffect as useEffect68, useState as useState89, useCallback as useCallback35, useRef as useRef50 } from "react";
|
|
36589
36618
|
import { jsx as jsx279, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
36590
36619
|
function StickySectionNav({
|
|
36591
36620
|
sections,
|
|
@@ -36646,8 +36675,8 @@ function StickySectionNav({
|
|
|
36646
36675
|
] });
|
|
36647
36676
|
}
|
|
36648
36677
|
function useSectionNavigation(sections, options) {
|
|
36649
|
-
const [activeSection, setActiveSection] =
|
|
36650
|
-
const isScrollingFromClick =
|
|
36678
|
+
const [activeSection, setActiveSection] = useState89(sections[0]?.id || "");
|
|
36679
|
+
const isScrollingFromClick = useRef50(false);
|
|
36651
36680
|
const { offset: offset2 = 100 } = options || {};
|
|
36652
36681
|
const handleSectionClick = useCallback35((sectionId) => {
|
|
36653
36682
|
const targetElement = document.getElementById(sectionId);
|
|
@@ -36659,14 +36688,14 @@ function useSectionNavigation(sections, options) {
|
|
|
36659
36688
|
isScrollingFromClick.current = false;
|
|
36660
36689
|
}, 500);
|
|
36661
36690
|
}, [offset2]);
|
|
36662
|
-
|
|
36691
|
+
useEffect68(() => {
|
|
36663
36692
|
sections.forEach((section) => {
|
|
36664
36693
|
if (section.ref.current && !section.ref.current.id) {
|
|
36665
36694
|
section.ref.current.id = section.id;
|
|
36666
36695
|
}
|
|
36667
36696
|
});
|
|
36668
36697
|
}, [sections]);
|
|
36669
|
-
|
|
36698
|
+
useEffect68(() => {
|
|
36670
36699
|
const handleScroll = () => {
|
|
36671
36700
|
if (isScrollingFromClick.current) return;
|
|
36672
36701
|
const scrollPosition = window.scrollY + offset2 + 50;
|
|
@@ -36699,7 +36728,7 @@ function useSectionNavigation(sections, options) {
|
|
|
36699
36728
|
}
|
|
36700
36729
|
|
|
36701
36730
|
// src/components/navigation/navigation-sidebar.tsx
|
|
36702
|
-
import { useCallback as useCallback36, useEffect as
|
|
36731
|
+
import { useCallback as useCallback36, useEffect as useEffect69, useLayoutEffect as useLayoutEffect7, useMemo as useMemo37, useState as useState90 } from "react";
|
|
36703
36732
|
|
|
36704
36733
|
// src/components/navigation/navigation-sidebar-header.tsx
|
|
36705
36734
|
import { jsx as jsx280, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
@@ -36847,12 +36876,12 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
36847
36876
|
STORAGE_KEY,
|
|
36848
36877
|
config.minimized ?? false
|
|
36849
36878
|
);
|
|
36850
|
-
const [tabletMinimized, setTabletMinimized] =
|
|
36851
|
-
|
|
36879
|
+
const [tabletMinimized, setTabletMinimized] = useState90(true);
|
|
36880
|
+
useEffect69(() => {
|
|
36852
36881
|
if (isTablet) setTabletMinimized(true);
|
|
36853
36882
|
}, [isTablet]);
|
|
36854
36883
|
const minimized = isTablet ? tabletMinimized : desktopMinimized;
|
|
36855
|
-
const [transitionsEnabled, setTransitionsEnabled] =
|
|
36884
|
+
const [transitionsEnabled, setTransitionsEnabled] = useState90(false);
|
|
36856
36885
|
const isOverlayOpen = isTablet && !minimized;
|
|
36857
36886
|
const showLabel = !minimized;
|
|
36858
36887
|
const handleToggle = useCallback36(() => {
|
|
@@ -36866,7 +36895,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
36866
36895
|
const closeOverlay = useCallback36(() => {
|
|
36867
36896
|
setTabletMinimized(true);
|
|
36868
36897
|
}, []);
|
|
36869
|
-
|
|
36898
|
+
useEffect69(() => {
|
|
36870
36899
|
if (!isOverlayOpen) return;
|
|
36871
36900
|
const handleKeyDown = (e) => {
|
|
36872
36901
|
if (e.key === "Escape") closeOverlay();
|
|
@@ -37347,10 +37376,10 @@ function NotificationsHeaderButton({
|
|
|
37347
37376
|
}
|
|
37348
37377
|
|
|
37349
37378
|
// src/components/navigation/app-layout.tsx
|
|
37350
|
-
import { Suspense as Suspense2, useCallback as useCallback38, useMemo as useMemo38, useRef as
|
|
37379
|
+
import { Suspense as Suspense2, useCallback as useCallback38, useMemo as useMemo38, useRef as useRef52, useState as useState91 } from "react";
|
|
37351
37380
|
|
|
37352
37381
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
37353
|
-
import React115, { useCallback as useCallback37, useRef as
|
|
37382
|
+
import React115, { useCallback as useCallback37, useRef as useRef51 } from "react";
|
|
37354
37383
|
import { usePreventScroll as usePreventScroll5 } from "@react-aria/overlays";
|
|
37355
37384
|
import { Fragment as Fragment56, jsx as jsx288, jsxs as jsxs226 } from "react/jsx-runtime";
|
|
37356
37385
|
var HEADER_HEIGHT = 48;
|
|
@@ -37364,7 +37393,7 @@ var MobileBurgerMenu = React115.memo(function MobileBurgerMenu2({
|
|
|
37364
37393
|
onLogout,
|
|
37365
37394
|
disabled = false
|
|
37366
37395
|
}) {
|
|
37367
|
-
const panelRef =
|
|
37396
|
+
const panelRef = useRef51(null);
|
|
37368
37397
|
usePreventScroll5({ isDisabled: !isOpen });
|
|
37369
37398
|
useFocusTrap(panelRef, isOpen, { onEscape: onClose });
|
|
37370
37399
|
const handleItemClick = useCallback37((item) => {
|
|
@@ -37547,11 +37576,11 @@ function AppLayout({
|
|
|
37547
37576
|
drawer,
|
|
37548
37577
|
topBar
|
|
37549
37578
|
}) {
|
|
37550
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
37551
|
-
const [drawerContainer, setDrawerContainer] =
|
|
37552
|
-
const mobileMenuOpenRef =
|
|
37579
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState91(false);
|
|
37580
|
+
const [drawerContainer, setDrawerContainer] = useState91(null);
|
|
37581
|
+
const mobileMenuOpenRef = useRef52(mobileMenuOpen);
|
|
37553
37582
|
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
37554
|
-
const drawerHandlesRef =
|
|
37583
|
+
const drawerHandlesRef = useRef52(/* @__PURE__ */ new Set());
|
|
37555
37584
|
const handleToggleMobileMenu = useCallback38(() => {
|
|
37556
37585
|
const opening = !mobileMenuOpenRef.current;
|
|
37557
37586
|
if (opening) {
|
|
@@ -38178,7 +38207,7 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
38178
38207
|
|
|
38179
38208
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
38180
38209
|
init_button2();
|
|
38181
|
-
import React117, { useRef as
|
|
38210
|
+
import React117, { useRef as useRef53, useCallback as useCallback39 } from "react";
|
|
38182
38211
|
|
|
38183
38212
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
38184
38213
|
import React116 from "react";
|
|
@@ -38302,10 +38331,10 @@ function OnboardingWalkthrough({
|
|
|
38302
38331
|
allStepsComplete,
|
|
38303
38332
|
markMultipleComplete
|
|
38304
38333
|
} = useOnboardingState(storageKey);
|
|
38305
|
-
const hasAutoMarkedRef =
|
|
38306
|
-
const autoMarkingInProgressRef =
|
|
38307
|
-
const lastCompletionStatusRef =
|
|
38308
|
-
const actionInProgressRef =
|
|
38334
|
+
const hasAutoMarkedRef = useRef53(false);
|
|
38335
|
+
const autoMarkingInProgressRef = useRef53(false);
|
|
38336
|
+
const lastCompletionStatusRef = useRef53(null);
|
|
38337
|
+
const actionInProgressRef = useRef53(/* @__PURE__ */ new Set());
|
|
38309
38338
|
React117.useEffect(() => {
|
|
38310
38339
|
if (isLoadingCompletion) {
|
|
38311
38340
|
hasAutoMarkedRef.current = false;
|
|
@@ -38644,7 +38673,7 @@ function ServiceCard({ title, subtitle, icon, tag, rows, className }) {
|
|
|
38644
38673
|
] });
|
|
38645
38674
|
}
|
|
38646
38675
|
function ServiceCardRowItem({ row }) {
|
|
38647
|
-
const [revealed, setRevealed] =
|
|
38676
|
+
const [revealed, setRevealed] = useState92(false);
|
|
38648
38677
|
const { copy, copied } = useCopyToClipboard();
|
|
38649
38678
|
const actions = useMemo39(() => ({ copy: true, open: !!row.href, reveal: !!row.isSecret, ...row.actions }), [row]);
|
|
38650
38679
|
const displayValue = row.isSecret ? /* @__PURE__ */ jsx302(MaskedValue, { value: row.value, isRevealed: revealed }) : /* @__PURE__ */ jsx302("span", { children: row.value });
|
|
@@ -38993,7 +39022,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx307(ContentLoader, { ...props, va
|
|
|
38993
39022
|
|
|
38994
39023
|
// src/components/ui/table/table.tsx
|
|
38995
39024
|
init_cn();
|
|
38996
|
-
import { useEffect as
|
|
39025
|
+
import { useEffect as useEffect71, useRef as useRef55 } from "react";
|
|
38997
39026
|
init_pagination();
|
|
38998
39027
|
init_button2();
|
|
38999
39028
|
|
|
@@ -39604,10 +39633,10 @@ function TableRow({
|
|
|
39604
39633
|
}
|
|
39605
39634
|
|
|
39606
39635
|
// src/components/ui/table/use-table-motion.ts
|
|
39607
|
-
import { useEffect as
|
|
39636
|
+
import { useEffect as useEffect70, useState as useState93 } from "react";
|
|
39608
39637
|
function useTableMotion(enabled) {
|
|
39609
|
-
const [runtime, setRuntime] =
|
|
39610
|
-
|
|
39638
|
+
const [runtime, setRuntime] = useState93(null);
|
|
39639
|
+
useEffect70(() => {
|
|
39611
39640
|
if (!enabled || runtime) return;
|
|
39612
39641
|
let active = true;
|
|
39613
39642
|
import("framer-motion").then((m) => {
|
|
@@ -39753,10 +39782,10 @@ function Table({
|
|
|
39753
39782
|
};
|
|
39754
39783
|
const allSelected = selectedRows.length > 0 && selectedRows.length === data.length;
|
|
39755
39784
|
const someSelected = selectedRows.length > 0 && selectedRows.length < data.length;
|
|
39756
|
-
const sentinelRef =
|
|
39757
|
-
const onLoadMoreRef =
|
|
39785
|
+
const sentinelRef = useRef55(null);
|
|
39786
|
+
const onLoadMoreRef = useRef55(infiniteScroll?.onLoadMore);
|
|
39758
39787
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
39759
|
-
|
|
39788
|
+
useEffect71(() => {
|
|
39760
39789
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
39761
39790
|
const sentinel = sentinelRef.current;
|
|
39762
39791
|
if (!sentinel) return;
|
|
@@ -39974,7 +40003,7 @@ import { useMemo as useMemo40 } from "react";
|
|
|
39974
40003
|
|
|
39975
40004
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
39976
40005
|
init_cn();
|
|
39977
|
-
import { useRef as
|
|
40006
|
+
import { useRef as useRef56, useState as useState94, useCallback as useCallback40 } from "react";
|
|
39978
40007
|
import { jsx as jsx319, jsxs as jsxs252 } from "react/jsx-runtime";
|
|
39979
40008
|
function QueryReportTableHeader({
|
|
39980
40009
|
columns,
|
|
@@ -40003,8 +40032,8 @@ function QueryReportTableHeader({
|
|
|
40003
40032
|
);
|
|
40004
40033
|
}
|
|
40005
40034
|
function TruncatedHeaderCell({ value, width }) {
|
|
40006
|
-
const textRef =
|
|
40007
|
-
const [isTruncated, setIsTruncated] =
|
|
40035
|
+
const textRef = useRef56(null);
|
|
40036
|
+
const [isTruncated, setIsTruncated] = useState94(false);
|
|
40008
40037
|
const checkTruncation = useCallback40(() => {
|
|
40009
40038
|
const el = textRef.current;
|
|
40010
40039
|
if (el) {
|
|
@@ -40033,7 +40062,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
40033
40062
|
|
|
40034
40063
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
40035
40064
|
init_cn();
|
|
40036
|
-
import { useRef as
|
|
40065
|
+
import { useRef as useRef57, useState as useState95, useCallback as useCallback41 } from "react";
|
|
40037
40066
|
import { jsx as jsx320, jsxs as jsxs253 } from "react/jsx-runtime";
|
|
40038
40067
|
function QueryReportTableRow({
|
|
40039
40068
|
row,
|
|
@@ -40079,8 +40108,8 @@ function QueryReportTableRow({
|
|
|
40079
40108
|
);
|
|
40080
40109
|
}
|
|
40081
40110
|
function TruncatedCell({ value, className }) {
|
|
40082
|
-
const textRef =
|
|
40083
|
-
const [isTruncated, setIsTruncated] =
|
|
40111
|
+
const textRef = useRef57(null);
|
|
40112
|
+
const [isTruncated, setIsTruncated] = useState95(false);
|
|
40084
40113
|
const checkTruncation = useCallback41(() => {
|
|
40085
40114
|
const el = textRef.current;
|
|
40086
40115
|
if (el) {
|
|
@@ -40581,7 +40610,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
40581
40610
|
// src/components/ui/data-table/data-table-row.tsx
|
|
40582
40611
|
init_next_link();
|
|
40583
40612
|
init_cn();
|
|
40584
|
-
import { memo as memo5, useCallback as useCallback43, useRef as
|
|
40613
|
+
import { memo as memo5, useCallback as useCallback43, useRef as useRef58 } from "react";
|
|
40585
40614
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
40586
40615
|
|
|
40587
40616
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -40666,7 +40695,7 @@ function DataTableRowImpl({
|
|
|
40666
40695
|
const hasSubRow = subRow != null && subRow !== false;
|
|
40667
40696
|
const isLinkMode = Boolean(href) && !onClick;
|
|
40668
40697
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
40669
|
-
const containerRef =
|
|
40698
|
+
const containerRef = useRef58(null);
|
|
40670
40699
|
const handleClick = useCallback43(
|
|
40671
40700
|
(e) => {
|
|
40672
40701
|
const target = e.target;
|
|
@@ -40834,7 +40863,7 @@ function DataTableBody({
|
|
|
40834
40863
|
}
|
|
40835
40864
|
|
|
40836
40865
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
40837
|
-
import { useEffect as
|
|
40866
|
+
import { useEffect as useEffect72, useRef as useRef59 } from "react";
|
|
40838
40867
|
import { Fragment as Fragment64, jsx as jsx330, jsxs as jsxs261 } from "react/jsx-runtime";
|
|
40839
40868
|
function DataTableInfiniteFooter({
|
|
40840
40869
|
hasNextPage,
|
|
@@ -40843,10 +40872,10 @@ function DataTableInfiniteFooter({
|
|
|
40843
40872
|
skeletonRows = 3,
|
|
40844
40873
|
rootMargin = "200px"
|
|
40845
40874
|
}) {
|
|
40846
|
-
const sentinelRef =
|
|
40847
|
-
const onLoadMoreRef =
|
|
40875
|
+
const sentinelRef = useRef59(null);
|
|
40876
|
+
const onLoadMoreRef = useRef59(onLoadMore);
|
|
40848
40877
|
onLoadMoreRef.current = onLoadMore;
|
|
40849
|
-
|
|
40878
|
+
useEffect72(() => {
|
|
40850
40879
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
40851
40880
|
const sentinel = sentinelRef.current;
|
|
40852
40881
|
if (!sentinel) return;
|
|
@@ -41480,9 +41509,9 @@ function FilterList({
|
|
|
41480
41509
|
|
|
41481
41510
|
// src/components/ui/tag-search-input.tsx
|
|
41482
41511
|
import {
|
|
41483
|
-
useEffect as
|
|
41484
|
-
useRef as
|
|
41485
|
-
useState as
|
|
41512
|
+
useEffect as useEffect74,
|
|
41513
|
+
useRef as useRef61,
|
|
41514
|
+
useState as useState97
|
|
41486
41515
|
} from "react";
|
|
41487
41516
|
init_cn();
|
|
41488
41517
|
import { jsx as jsx334, jsxs as jsxs265 } from "react/jsx-runtime";
|
|
@@ -41516,11 +41545,11 @@ function TagSearchInput({
|
|
|
41516
41545
|
limitTags,
|
|
41517
41546
|
placeholder: currentPlaceholder
|
|
41518
41547
|
});
|
|
41519
|
-
const wrapperRef =
|
|
41520
|
-
const hiddenTagsRef =
|
|
41521
|
-
const hiddenTagsPopupRef =
|
|
41522
|
-
const [showHiddenTags, setShowHiddenTags] =
|
|
41523
|
-
|
|
41548
|
+
const wrapperRef = useRef61(null);
|
|
41549
|
+
const hiddenTagsRef = useRef61(null);
|
|
41550
|
+
const hiddenTagsPopupRef = useRef61(null);
|
|
41551
|
+
const [showHiddenTags, setShowHiddenTags] = useState97(false);
|
|
41552
|
+
useEffect74(() => {
|
|
41524
41553
|
if (!showHiddenTags) return;
|
|
41525
41554
|
const handleClick = (e) => {
|
|
41526
41555
|
const target = e.target;
|
|
@@ -41675,7 +41704,7 @@ function TagSearchInput({
|
|
|
41675
41704
|
}
|
|
41676
41705
|
|
|
41677
41706
|
// src/components/ui/markdown-editor.tsx
|
|
41678
|
-
import { useRef as
|
|
41707
|
+
import { useRef as useRef62, useCallback as useCallback44, useState as useState98, useEffect as useEffect75 } from "react";
|
|
41679
41708
|
init_cn();
|
|
41680
41709
|
import { Loader2 as Loader28, Upload as Upload8 } from "lucide-react";
|
|
41681
41710
|
import { jsx as jsx335, jsxs as jsxs266 } from "react/jsx-runtime";
|
|
@@ -41706,7 +41735,7 @@ body .w-md-editor .w-md-editor-bar::after { content: '' !important; display: blo
|
|
|
41706
41735
|
body .w-md-editor .w-md-editor-bar:hover::after { border-color: var(--color-text-secondary) !important; }
|
|
41707
41736
|
`;
|
|
41708
41737
|
function MarkdownEditorStyles() {
|
|
41709
|
-
|
|
41738
|
+
useEffect75(() => {
|
|
41710
41739
|
if (document.getElementById(MARKDOWN_EDITOR_STYLE_ID)) return;
|
|
41711
41740
|
const style = document.createElement("style");
|
|
41712
41741
|
style.id = MARKDOWN_EDITOR_STYLE_ID;
|
|
@@ -41730,11 +41759,11 @@ function MarkdownEditor({
|
|
|
41730
41759
|
onFileUploaded,
|
|
41731
41760
|
renderPreview
|
|
41732
41761
|
}) {
|
|
41733
|
-
const fileInputRef =
|
|
41734
|
-
const [isUploading, setIsUploading] =
|
|
41735
|
-
const [uploadProgress, setUploadProgress] =
|
|
41736
|
-
const [defaultExtraCommands, setDefaultExtraCommands] =
|
|
41737
|
-
|
|
41762
|
+
const fileInputRef = useRef62(null);
|
|
41763
|
+
const [isUploading, setIsUploading] = useState98(false);
|
|
41764
|
+
const [uploadProgress, setUploadProgress] = useState98("");
|
|
41765
|
+
const [defaultExtraCommands, setDefaultExtraCommands] = useState98([]);
|
|
41766
|
+
useEffect75(() => {
|
|
41738
41767
|
import("@uiw/react-md-editor").then((mod) => {
|
|
41739
41768
|
if (mod.commands?.getExtraCommands) {
|
|
41740
41769
|
setDefaultExtraCommands(mod.commands.getExtraCommands());
|
|
@@ -41823,11 +41852,11 @@ function MarkdownEditor({
|
|
|
41823
41852
|
}
|
|
41824
41853
|
} : null;
|
|
41825
41854
|
const extraCommands = uploadCommand ? [...defaultExtraCommands, uploadCommand] : defaultExtraCommands;
|
|
41826
|
-
const wrapperRef =
|
|
41827
|
-
const isDraggingRef =
|
|
41828
|
-
const mouseYRef =
|
|
41829
|
-
const rafRef =
|
|
41830
|
-
const scrollParentRef =
|
|
41855
|
+
const wrapperRef = useRef62(null);
|
|
41856
|
+
const isDraggingRef = useRef62(false);
|
|
41857
|
+
const mouseYRef = useRef62(0);
|
|
41858
|
+
const rafRef = useRef62(0);
|
|
41859
|
+
const scrollParentRef = useRef62(window);
|
|
41831
41860
|
const EDGE_ZONE = 60;
|
|
41832
41861
|
const MAX_SCROLL_SPEED = 15;
|
|
41833
41862
|
const findScrollParent = useCallback44((el) => {
|
|
@@ -41857,7 +41886,7 @@ function MarkdownEditor({
|
|
|
41857
41886
|
}
|
|
41858
41887
|
rafRef.current = requestAnimationFrame(scrollLoop);
|
|
41859
41888
|
}, []);
|
|
41860
|
-
|
|
41889
|
+
useEffect75(() => {
|
|
41861
41890
|
const wrapper = wrapperRef.current;
|
|
41862
41891
|
if (!wrapper) return;
|
|
41863
41892
|
const onMouseMove = (e) => {
|
|
@@ -43339,8 +43368,8 @@ function ImageGalleryModal({
|
|
|
43339
43368
|
onClose,
|
|
43340
43369
|
initialIndex = 0
|
|
43341
43370
|
}) {
|
|
43342
|
-
const [selectedImageIndex, setSelectedImageIndex] =
|
|
43343
|
-
|
|
43371
|
+
const [selectedImageIndex, setSelectedImageIndex] = useState105(initialIndex);
|
|
43372
|
+
useEffect78(() => {
|
|
43344
43373
|
if (isOpen) {
|
|
43345
43374
|
setSelectedImageIndex(initialIndex);
|
|
43346
43375
|
}
|
|
@@ -43355,7 +43384,7 @@ function ImageGalleryModal({
|
|
|
43355
43384
|
setSelectedImageIndex(selectedImageIndex + 1);
|
|
43356
43385
|
}
|
|
43357
43386
|
};
|
|
43358
|
-
|
|
43387
|
+
useEffect78(() => {
|
|
43359
43388
|
const handleKeyPress = (event) => {
|
|
43360
43389
|
if (!isOpen) return;
|
|
43361
43390
|
switch (event.key) {
|
|
@@ -43558,7 +43587,7 @@ function RoadmapCard({
|
|
|
43558
43587
|
onVote,
|
|
43559
43588
|
isVoting = false
|
|
43560
43589
|
}) {
|
|
43561
|
-
const [showScreenshots, setShowScreenshots] =
|
|
43590
|
+
const [showScreenshots, setShowScreenshots] = useState106(false);
|
|
43562
43591
|
const logoUrl = item.icon && item.icon.startsWith("http") ? item.icon : null;
|
|
43563
43592
|
const iconSrc = logoUrl ? getProxiedImageUrl(logoUrl, { directHttps: true }) || logoUrl : null;
|
|
43564
43593
|
if (size2 === "sm") {
|
|
@@ -44194,7 +44223,7 @@ function DataRoomDocCardSkeleton({ className }) {
|
|
|
44194
44223
|
}
|
|
44195
44224
|
|
|
44196
44225
|
// src/components/chat/entity-cards/program-card.tsx
|
|
44197
|
-
import { useState as
|
|
44226
|
+
import { useState as useState107 } from "react";
|
|
44198
44227
|
|
|
44199
44228
|
// node_modules/date-fns/toDate.mjs
|
|
44200
44229
|
function toDate2(argument) {
|
|
@@ -45831,8 +45860,8 @@ function getHosts(hosts) {
|
|
|
45831
45860
|
return [];
|
|
45832
45861
|
}
|
|
45833
45862
|
function MediaGallery({ images, title }) {
|
|
45834
|
-
const [selectedImageIndex, setSelectedImageIndex] =
|
|
45835
|
-
const [isModalOpen, setIsModalOpen] =
|
|
45863
|
+
const [selectedImageIndex, setSelectedImageIndex] = useState107(null);
|
|
45864
|
+
const [isModalOpen, setIsModalOpen] = useState107(false);
|
|
45836
45865
|
const openImageModal = (index, event) => {
|
|
45837
45866
|
if (event) event.stopPropagation();
|
|
45838
45867
|
setSelectedImageIndex(index);
|
|
@@ -47430,7 +47459,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
47430
47459
|
}
|
|
47431
47460
|
|
|
47432
47461
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
47433
|
-
import { useCallback as useCallback46, useRef as
|
|
47462
|
+
import { useCallback as useCallback46, useRef as useRef66 } from "react";
|
|
47434
47463
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
47435
47464
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
47436
47465
|
}
|
|
@@ -47452,22 +47481,22 @@ function useChunkCatchup({
|
|
|
47452
47481
|
chatTypes = [CHAT_TYPE.CLIENT],
|
|
47453
47482
|
fetchChunks
|
|
47454
47483
|
}) {
|
|
47455
|
-
const processedSequenceKeys =
|
|
47456
|
-
const lastSequenceId =
|
|
47457
|
-
const lastSequenceIdByType =
|
|
47458
|
-
const fetchingInProgress =
|
|
47459
|
-
const lastFetchParams =
|
|
47460
|
-
const pendingCatchupRef =
|
|
47461
|
-
const chunkBuffer =
|
|
47462
|
-
const bufferUntilInitialCatchupComplete =
|
|
47463
|
-
const hasCompletedInitialCatchup =
|
|
47464
|
-
const dialogIdRef =
|
|
47484
|
+
const processedSequenceKeys = useRef66(/* @__PURE__ */ new Set());
|
|
47485
|
+
const lastSequenceId = useRef66(null);
|
|
47486
|
+
const lastSequenceIdByType = useRef66(/* @__PURE__ */ new Map());
|
|
47487
|
+
const fetchingInProgress = useRef66(false);
|
|
47488
|
+
const lastFetchParams = useRef66(null);
|
|
47489
|
+
const pendingCatchupRef = useRef66(null);
|
|
47490
|
+
const chunkBuffer = useRef66([]);
|
|
47491
|
+
const bufferUntilInitialCatchupComplete = useRef66(false);
|
|
47492
|
+
const hasCompletedInitialCatchup = useRef66(false);
|
|
47493
|
+
const dialogIdRef = useRef66(dialogId);
|
|
47465
47494
|
dialogIdRef.current = dialogId;
|
|
47466
|
-
const chatTypesRef =
|
|
47495
|
+
const chatTypesRef = useRef66(chatTypes);
|
|
47467
47496
|
chatTypesRef.current = chatTypes;
|
|
47468
|
-
const fetchChunksRef =
|
|
47497
|
+
const fetchChunksRef = useRef66(fetchChunks);
|
|
47469
47498
|
fetchChunksRef.current = fetchChunks;
|
|
47470
|
-
const onChunkReceivedRef =
|
|
47499
|
+
const onChunkReceivedRef = useRef66(onChunkReceived);
|
|
47471
47500
|
onChunkReceivedRef.current = onChunkReceived;
|
|
47472
47501
|
const processChunk = useCallback46((chunk, messageType, forceProcess = false) => {
|
|
47473
47502
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
@@ -47664,7 +47693,7 @@ function useChunkCatchup({
|
|
|
47664
47693
|
}
|
|
47665
47694
|
}
|
|
47666
47695
|
}, [flushBufferedRealtimeChunks]);
|
|
47667
|
-
const catchUpChunksRef =
|
|
47696
|
+
const catchUpChunksRef = useRef66(null);
|
|
47668
47697
|
catchUpChunksRef.current = catchUpChunks;
|
|
47669
47698
|
const resetChunkTracking = useCallback46(() => {
|
|
47670
47699
|
processedSequenceKeys.current.clear();
|
|
@@ -47708,20 +47737,20 @@ function useChunkCatchup({
|
|
|
47708
47737
|
}
|
|
47709
47738
|
|
|
47710
47739
|
// src/components/chat/hooks/use-scripted-stream.ts
|
|
47711
|
-
import { useEffect as
|
|
47740
|
+
import { useEffect as useEffect79, useState as useState108 } from "react";
|
|
47712
47741
|
var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
|
|
47713
47742
|
function prefersReducedMotion() {
|
|
47714
47743
|
return typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
|
|
47715
47744
|
}
|
|
47716
47745
|
function useScriptedStream(frames, resetKey, enabled = true) {
|
|
47717
|
-
const [index, setIndex] =
|
|
47718
|
-
const [reducedMotion, setReducedMotion] =
|
|
47719
|
-
const [prevKey, setPrevKey] =
|
|
47746
|
+
const [index, setIndex] = useState108(0);
|
|
47747
|
+
const [reducedMotion, setReducedMotion] = useState108(false);
|
|
47748
|
+
const [prevKey, setPrevKey] = useState108(resetKey);
|
|
47720
47749
|
if (resetKey !== prevKey) {
|
|
47721
47750
|
setPrevKey(resetKey);
|
|
47722
47751
|
setIndex(0);
|
|
47723
47752
|
}
|
|
47724
|
-
|
|
47753
|
+
useEffect79(() => {
|
|
47725
47754
|
setReducedMotion(prefersReducedMotion());
|
|
47726
47755
|
const mq = window.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
47727
47756
|
if (!mq) return;
|
|
@@ -47731,7 +47760,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47731
47760
|
}, []);
|
|
47732
47761
|
const playing = enabled && !reducedMotion && frames.length > 0;
|
|
47733
47762
|
const lastIndex = Math.max(0, frames.length - 1);
|
|
47734
|
-
|
|
47763
|
+
useEffect79(() => {
|
|
47735
47764
|
if (!playing || index >= lastIndex) return;
|
|
47736
47765
|
const current = frames[Math.min(index, lastIndex)] ?? EMPTY_FRAME;
|
|
47737
47766
|
const t = setTimeout(() => setIndex((i) => Math.min(i + 1, lastIndex)), current.delayMs);
|
|
@@ -47743,7 +47772,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47743
47772
|
}
|
|
47744
47773
|
|
|
47745
47774
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
47746
|
-
import { useEffect as
|
|
47775
|
+
import { useEffect as useEffect80, useRef as useRef67, useState as useState109 } from "react";
|
|
47747
47776
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
47748
47777
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
47749
47778
|
function useJetStreamDialogSubscription({
|
|
@@ -47762,57 +47791,57 @@ function useJetStreamDialogSubscription({
|
|
|
47762
47791
|
reconnectionBackoff,
|
|
47763
47792
|
inactiveThresholdMs
|
|
47764
47793
|
}) {
|
|
47765
|
-
const [isConnected, setIsConnected] =
|
|
47766
|
-
const [isSubscribed, setIsSubscribed] =
|
|
47767
|
-
const [reconnectionCount, setReconnectionCount] =
|
|
47768
|
-
const [currentStreamSeq, setCurrentStreamSeq] =
|
|
47769
|
-
const clientRef =
|
|
47770
|
-
const subscriptionRef =
|
|
47771
|
-
const highestStreamSeqRef =
|
|
47772
|
-
const onEventRef =
|
|
47773
|
-
|
|
47794
|
+
const [isConnected, setIsConnected] = useState109(false);
|
|
47795
|
+
const [isSubscribed, setIsSubscribed] = useState109(false);
|
|
47796
|
+
const [reconnectionCount, setReconnectionCount] = useState109(0);
|
|
47797
|
+
const [currentStreamSeq, setCurrentStreamSeq] = useState109(null);
|
|
47798
|
+
const clientRef = useRef67(null);
|
|
47799
|
+
const subscriptionRef = useRef67(null);
|
|
47800
|
+
const highestStreamSeqRef = useRef67(null);
|
|
47801
|
+
const onEventRef = useRef67(onEvent);
|
|
47802
|
+
useEffect80(() => {
|
|
47774
47803
|
onEventRef.current = onEvent;
|
|
47775
47804
|
}, [onEvent]);
|
|
47776
|
-
const onConnectRef =
|
|
47777
|
-
|
|
47805
|
+
const onConnectRef = useRef67(onConnect);
|
|
47806
|
+
useEffect80(() => {
|
|
47778
47807
|
onConnectRef.current = onConnect;
|
|
47779
47808
|
}, [onConnect]);
|
|
47780
|
-
const onDisconnectRef =
|
|
47781
|
-
|
|
47809
|
+
const onDisconnectRef = useRef67(onDisconnect);
|
|
47810
|
+
useEffect80(() => {
|
|
47782
47811
|
onDisconnectRef.current = onDisconnect;
|
|
47783
47812
|
}, [onDisconnect]);
|
|
47784
|
-
const onSubscribedRef =
|
|
47785
|
-
|
|
47813
|
+
const onSubscribedRef = useRef67(onSubscribed);
|
|
47814
|
+
useEffect80(() => {
|
|
47786
47815
|
onSubscribedRef.current = onSubscribed;
|
|
47787
47816
|
}, [onSubscribed]);
|
|
47788
|
-
const onBeforeReconnectRef =
|
|
47789
|
-
|
|
47817
|
+
const onBeforeReconnectRef = useRef67(onBeforeReconnect);
|
|
47818
|
+
useEffect80(() => {
|
|
47790
47819
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47791
47820
|
}, [onBeforeReconnect]);
|
|
47792
|
-
const getNatsWsUrlRef =
|
|
47793
|
-
|
|
47821
|
+
const getNatsWsUrlRef = useRef67(getNatsWsUrl);
|
|
47822
|
+
useEffect80(() => {
|
|
47794
47823
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47795
47824
|
}, [getNatsWsUrl]);
|
|
47796
|
-
const reconnectionBackoffRef =
|
|
47797
|
-
|
|
47825
|
+
const reconnectionBackoffRef = useRef67(reconnectionBackoff);
|
|
47826
|
+
useEffect80(() => {
|
|
47798
47827
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47799
47828
|
}, [reconnectionBackoff]);
|
|
47800
|
-
const optStartSeqRef =
|
|
47801
|
-
|
|
47829
|
+
const optStartSeqRef = useRef67(optStartSeq);
|
|
47830
|
+
useEffect80(() => {
|
|
47802
47831
|
optStartSeqRef.current = optStartSeq;
|
|
47803
47832
|
}, [optStartSeq]);
|
|
47804
|
-
const inactiveThresholdRef =
|
|
47805
|
-
|
|
47833
|
+
const inactiveThresholdRef = useRef67(inactiveThresholdMs);
|
|
47834
|
+
useEffect80(() => {
|
|
47806
47835
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
47807
47836
|
}, [inactiveThresholdMs]);
|
|
47808
|
-
const hadConnectionBeforeRef =
|
|
47809
|
-
const clientConfigRef =
|
|
47810
|
-
|
|
47837
|
+
const hadConnectionBeforeRef = useRef67(false);
|
|
47838
|
+
const clientConfigRef = useRef67(clientConfig);
|
|
47839
|
+
useEffect80(() => {
|
|
47811
47840
|
clientConfigRef.current = clientConfig;
|
|
47812
47841
|
}, [clientConfig]);
|
|
47813
|
-
const currentWsUrlRef =
|
|
47842
|
+
const currentWsUrlRef = useRef67("");
|
|
47814
47843
|
const wsUrl = getNatsWsUrl();
|
|
47815
|
-
|
|
47844
|
+
useEffect80(() => {
|
|
47816
47845
|
if (!enabled || !wsUrl) {
|
|
47817
47846
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
47818
47847
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -47893,11 +47922,11 @@ function useJetStreamDialogSubscription({
|
|
|
47893
47922
|
}
|
|
47894
47923
|
};
|
|
47895
47924
|
}, [enabled, wsUrl]);
|
|
47896
|
-
|
|
47925
|
+
useEffect80(() => {
|
|
47897
47926
|
highestStreamSeqRef.current = null;
|
|
47898
47927
|
setCurrentStreamSeq(null);
|
|
47899
47928
|
}, [dialogId]);
|
|
47900
|
-
|
|
47929
|
+
useEffect80(() => {
|
|
47901
47930
|
if (!enabled || !dialogId || !isConnected) {
|
|
47902
47931
|
if (subscriptionRef.current) {
|
|
47903
47932
|
try {
|
|
@@ -47984,7 +48013,7 @@ function useJetStreamDialogSubscription({
|
|
|
47984
48013
|
}
|
|
47985
48014
|
|
|
47986
48015
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
47987
|
-
import { useEffect as
|
|
48016
|
+
import { useEffect as useEffect81, useRef as useRef68, useState as useState110 } from "react";
|
|
47988
48017
|
function useNatsDialogSubscription({
|
|
47989
48018
|
enabled,
|
|
47990
48019
|
dialogId,
|
|
@@ -47998,47 +48027,47 @@ function useNatsDialogSubscription({
|
|
|
47998
48027
|
clientConfig = {},
|
|
47999
48028
|
reconnectionBackoff
|
|
48000
48029
|
}) {
|
|
48001
|
-
const [isConnected, setIsConnected] =
|
|
48002
|
-
const [isSubscribed, setIsSubscribed] =
|
|
48003
|
-
const [reconnectionCount, setReconnectionCount] =
|
|
48004
|
-
const clientRef =
|
|
48005
|
-
const subscriptionRefs =
|
|
48006
|
-
const onEventRef =
|
|
48007
|
-
|
|
48030
|
+
const [isConnected, setIsConnected] = useState110(false);
|
|
48031
|
+
const [isSubscribed, setIsSubscribed] = useState110(false);
|
|
48032
|
+
const [reconnectionCount, setReconnectionCount] = useState110(0);
|
|
48033
|
+
const clientRef = useRef68(null);
|
|
48034
|
+
const subscriptionRefs = useRef68(/* @__PURE__ */ new Map());
|
|
48035
|
+
const onEventRef = useRef68(onEvent);
|
|
48036
|
+
useEffect81(() => {
|
|
48008
48037
|
onEventRef.current = onEvent;
|
|
48009
48038
|
}, [onEvent]);
|
|
48010
|
-
const onConnectRef =
|
|
48011
|
-
|
|
48039
|
+
const onConnectRef = useRef68(onConnect);
|
|
48040
|
+
useEffect81(() => {
|
|
48012
48041
|
onConnectRef.current = onConnect;
|
|
48013
48042
|
}, [onConnect]);
|
|
48014
|
-
const onDisconnectRef =
|
|
48015
|
-
|
|
48043
|
+
const onDisconnectRef = useRef68(onDisconnect);
|
|
48044
|
+
useEffect81(() => {
|
|
48016
48045
|
onDisconnectRef.current = onDisconnect;
|
|
48017
48046
|
}, [onDisconnect]);
|
|
48018
|
-
const onSubscribedRef =
|
|
48019
|
-
|
|
48047
|
+
const onSubscribedRef = useRef68(onSubscribed);
|
|
48048
|
+
useEffect81(() => {
|
|
48020
48049
|
onSubscribedRef.current = onSubscribed;
|
|
48021
48050
|
}, [onSubscribed]);
|
|
48022
|
-
const onBeforeReconnectRef =
|
|
48023
|
-
|
|
48051
|
+
const onBeforeReconnectRef = useRef68(onBeforeReconnect);
|
|
48052
|
+
useEffect81(() => {
|
|
48024
48053
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
48025
48054
|
}, [onBeforeReconnect]);
|
|
48026
|
-
const hadConnectionBeforeRef =
|
|
48027
|
-
const getNatsWsUrlRef =
|
|
48028
|
-
|
|
48055
|
+
const hadConnectionBeforeRef = useRef68(false);
|
|
48056
|
+
const getNatsWsUrlRef = useRef68(getNatsWsUrl);
|
|
48057
|
+
useEffect81(() => {
|
|
48029
48058
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
48030
48059
|
}, [getNatsWsUrl]);
|
|
48031
|
-
const reconnectionBackoffRef =
|
|
48032
|
-
|
|
48060
|
+
const reconnectionBackoffRef = useRef68(reconnectionBackoff);
|
|
48061
|
+
useEffect81(() => {
|
|
48033
48062
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
48034
48063
|
}, [reconnectionBackoff]);
|
|
48035
|
-
const clientConfigRef =
|
|
48036
|
-
|
|
48064
|
+
const clientConfigRef = useRef68(clientConfig);
|
|
48065
|
+
useEffect81(() => {
|
|
48037
48066
|
clientConfigRef.current = clientConfig;
|
|
48038
48067
|
}, [clientConfig]);
|
|
48039
|
-
const currentWsUrlRef =
|
|
48068
|
+
const currentWsUrlRef = useRef68("");
|
|
48040
48069
|
const wsUrl = getNatsWsUrl();
|
|
48041
|
-
|
|
48070
|
+
useEffect81(() => {
|
|
48042
48071
|
if (!enabled || !wsUrl) {
|
|
48043
48072
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
48044
48073
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -48120,16 +48149,16 @@ function useNatsDialogSubscription({
|
|
|
48120
48149
|
};
|
|
48121
48150
|
}, [enabled, wsUrl]);
|
|
48122
48151
|
const topicsKey = topics.join(",");
|
|
48123
|
-
const topicsRef =
|
|
48152
|
+
const topicsRef = useRef68(topics);
|
|
48124
48153
|
topicsRef.current = topics;
|
|
48125
|
-
const lastSubscribedDialogIdRef =
|
|
48126
|
-
const isConnectedRef =
|
|
48127
|
-
|
|
48154
|
+
const lastSubscribedDialogIdRef = useRef68(null);
|
|
48155
|
+
const isConnectedRef = useRef68(isConnected);
|
|
48156
|
+
useEffect81(() => {
|
|
48128
48157
|
isConnectedRef.current = isConnected;
|
|
48129
48158
|
}, [isConnected]);
|
|
48130
|
-
const currentDialogIdRef =
|
|
48131
|
-
const abortControllerRef =
|
|
48132
|
-
|
|
48159
|
+
const currentDialogIdRef = useRef68(null);
|
|
48160
|
+
const abortControllerRef = useRef68(null);
|
|
48161
|
+
useEffect81(() => {
|
|
48133
48162
|
currentDialogIdRef.current = dialogId;
|
|
48134
48163
|
if (!enabled || !dialogId) {
|
|
48135
48164
|
if (subscriptionRefs.current.size > 0) {
|
|
@@ -48210,7 +48239,7 @@ function useNatsDialogSubscription({
|
|
|
48210
48239
|
abortControllerRef.current = null;
|
|
48211
48240
|
};
|
|
48212
48241
|
}, [enabled, dialogId, topicsKey]);
|
|
48213
|
-
|
|
48242
|
+
useEffect81(() => {
|
|
48214
48243
|
if (!enabled || !currentDialogIdRef.current || !isConnected) {
|
|
48215
48244
|
return;
|
|
48216
48245
|
}
|
|
@@ -48260,7 +48289,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
48260
48289
|
}
|
|
48261
48290
|
|
|
48262
48291
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
48263
|
-
import { useCallback as useCallback47, useRef as
|
|
48292
|
+
import { useCallback as useCallback47, useRef as useRef69, useEffect as useEffect82 } from "react";
|
|
48264
48293
|
|
|
48265
48294
|
// src/components/chat/utils/chunk-parser.ts
|
|
48266
48295
|
function normalizeToolCalls(raw) {
|
|
@@ -48915,14 +48944,14 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48915
48944
|
batchApprovalsEnabled = true,
|
|
48916
48945
|
isDirectMode = false
|
|
48917
48946
|
} = options;
|
|
48918
|
-
const accumulatorRef =
|
|
48947
|
+
const accumulatorRef = useRef69(
|
|
48919
48948
|
createMessageSegmentAccumulator({
|
|
48920
48949
|
onApprove: callbacks.onApprove,
|
|
48921
48950
|
onReject: callbacks.onReject
|
|
48922
48951
|
})
|
|
48923
48952
|
);
|
|
48924
|
-
const hasInitializedWithData =
|
|
48925
|
-
|
|
48953
|
+
const hasInitializedWithData = useRef69(false);
|
|
48954
|
+
useEffect82(() => {
|
|
48926
48955
|
if (initialState && !hasInitializedWithData.current) {
|
|
48927
48956
|
accumulatorRef.current.initializeWithState(initialState);
|
|
48928
48957
|
if (initialState.escalatedApprovals) {
|
|
@@ -48935,15 +48964,15 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48935
48964
|
hasInitializedWithData.current = true;
|
|
48936
48965
|
}
|
|
48937
48966
|
}, [initialState, callbacks]);
|
|
48938
|
-
const isInStreamRef =
|
|
48939
|
-
const hasEverStreamedRef =
|
|
48940
|
-
const directModeFlagRef =
|
|
48941
|
-
const sawDirectMessageRef =
|
|
48942
|
-
const directTeardownFiredRef =
|
|
48943
|
-
|
|
48967
|
+
const isInStreamRef = useRef69(false);
|
|
48968
|
+
const hasEverStreamedRef = useRef69(false);
|
|
48969
|
+
const directModeFlagRef = useRef69(isDirectMode);
|
|
48970
|
+
const sawDirectMessageRef = useRef69(false);
|
|
48971
|
+
const directTeardownFiredRef = useRef69(false);
|
|
48972
|
+
useEffect82(() => {
|
|
48944
48973
|
directModeFlagRef.current = isDirectMode;
|
|
48945
48974
|
}, [isDirectMode]);
|
|
48946
|
-
const pendingEscalatedRef =
|
|
48975
|
+
const pendingEscalatedRef = useRef69(/* @__PURE__ */ new Map());
|
|
48947
48976
|
const processChunk = useCallback47(
|
|
48948
48977
|
(chunk) => {
|
|
48949
48978
|
const action = parseChunkToAction(chunk);
|
|
@@ -49219,7 +49248,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
49219
49248
|
}
|
|
49220
49249
|
|
|
49221
49250
|
// src/components/chat/hooks/use-slash-commands.ts
|
|
49222
|
-
import { useEffect as
|
|
49251
|
+
import { useEffect as useEffect83, useState as useState111 } from "react";
|
|
49223
49252
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
49224
49253
|
async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
49225
49254
|
try {
|
|
@@ -49236,9 +49265,9 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
49236
49265
|
}
|
|
49237
49266
|
}
|
|
49238
49267
|
function useSlashCommands(prefix, commandsUrl) {
|
|
49239
|
-
const [commands, setCommands] =
|
|
49240
|
-
const [loading, setLoading] =
|
|
49241
|
-
|
|
49268
|
+
const [commands, setCommands] = useState111([]);
|
|
49269
|
+
const [loading, setLoading] = useState111(false);
|
|
49270
|
+
useEffect83(() => {
|
|
49242
49271
|
if (prefix == null) {
|
|
49243
49272
|
setCommands([]);
|
|
49244
49273
|
return;
|
|
@@ -49344,7 +49373,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
49344
49373
|
}
|
|
49345
49374
|
|
|
49346
49375
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
49347
|
-
import { useCallback as useCallback48, useMemo as useMemo44, useRef as
|
|
49376
|
+
import { useCallback as useCallback48, useMemo as useMemo44, useRef as useRef70, useState as useState112 } from "react";
|
|
49348
49377
|
import { fileTypeFromBlob } from "file-type";
|
|
49349
49378
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
49350
49379
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -49420,8 +49449,8 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
|
|
|
49420
49449
|
function useChatAttachments() {
|
|
49421
49450
|
const runtime = useRequiredChatRuntime();
|
|
49422
49451
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
49423
|
-
const [attachments, setAttachments] =
|
|
49424
|
-
const controllersRef =
|
|
49452
|
+
const [attachments, setAttachments] = useState112([]);
|
|
49453
|
+
const controllersRef = useRef70(/* @__PURE__ */ new Map());
|
|
49425
49454
|
const updateOne = useCallback48((id, patch) => {
|
|
49426
49455
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
49427
49456
|
}, []);
|
|
@@ -49510,7 +49539,7 @@ function useChatAttachments() {
|
|
|
49510
49539
|
},
|
|
49511
49540
|
[uploadUrlEndpoint, updateOne]
|
|
49512
49541
|
);
|
|
49513
|
-
const attachmentsRef =
|
|
49542
|
+
const attachmentsRef = useRef70([]);
|
|
49514
49543
|
attachmentsRef.current = attachments;
|
|
49515
49544
|
const addFiles = useCallback48(
|
|
49516
49545
|
(files) => {
|
|
@@ -49587,16 +49616,16 @@ function useChatAttachments() {
|
|
|
49587
49616
|
}
|
|
49588
49617
|
|
|
49589
49618
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
49590
|
-
import { useCallback as useCallback49, useEffect as
|
|
49619
|
+
import { useCallback as useCallback49, useEffect as useEffect84, useRef as useRef71, useState as useState113 } from "react";
|
|
49591
49620
|
import { jsx as jsx359 } from "react/jsx-runtime";
|
|
49592
49621
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
49593
49622
|
function useChatAttachmentImageGallery() {
|
|
49594
49623
|
const runtime = useRequiredChatRuntime();
|
|
49595
49624
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
49596
|
-
const panelRef =
|
|
49597
|
-
const [state, setState] =
|
|
49625
|
+
const panelRef = useRef71(null);
|
|
49626
|
+
const [state, setState] = useState113(CLOSED);
|
|
49598
49627
|
const handleClose = useCallback49(() => setState(CLOSED), []);
|
|
49599
|
-
|
|
49628
|
+
useEffect84(() => {
|
|
49600
49629
|
const root = panelRef.current;
|
|
49601
49630
|
if (!root) return;
|
|
49602
49631
|
const onClick = (ev) => {
|
|
@@ -49642,7 +49671,7 @@ function absolutize(prefix) {
|
|
|
49642
49671
|
}
|
|
49643
49672
|
|
|
49644
49673
|
// src/components/chat/hooks/use-chat-identity.ts
|
|
49645
|
-
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as
|
|
49674
|
+
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as useEffect85, useState as useState114 } from "react";
|
|
49646
49675
|
var ANON_DEFAULTS = {
|
|
49647
49676
|
authTier: "anon",
|
|
49648
49677
|
source: null,
|
|
@@ -49653,9 +49682,9 @@ function useResolveChatIdentity(enabled) {
|
|
|
49653
49682
|
const runtime = useRequiredChatRuntime();
|
|
49654
49683
|
const url = runtime.endpoints.identityUrl;
|
|
49655
49684
|
const proxyEmail = getEmbedProxyAuth()?.email ?? null;
|
|
49656
|
-
const [data, setData] =
|
|
49657
|
-
const [isLoading, setIsLoading] =
|
|
49658
|
-
|
|
49685
|
+
const [data, setData] = useState114(ANON_DEFAULTS);
|
|
49686
|
+
const [isLoading, setIsLoading] = useState114(enabled);
|
|
49687
|
+
useEffect85(() => {
|
|
49659
49688
|
if (!enabled) return;
|
|
49660
49689
|
let cancelled = false;
|
|
49661
49690
|
const ctrl = new AbortController();
|
|
@@ -49697,11 +49726,11 @@ function useChatIdentity() {
|
|
|
49697
49726
|
}
|
|
49698
49727
|
|
|
49699
49728
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
49700
|
-
import { useEffect as
|
|
49729
|
+
import { useEffect as useEffect86, useRef as useRef72 } from "react";
|
|
49701
49730
|
function useCloseOnNavigation(close, pathname) {
|
|
49702
|
-
const prevPathnameRef =
|
|
49703
|
-
const initializedRef =
|
|
49704
|
-
|
|
49731
|
+
const prevPathnameRef = useRef72(null);
|
|
49732
|
+
const initializedRef = useRef72(false);
|
|
49733
|
+
useEffect86(() => {
|
|
49705
49734
|
if (!initializedRef.current) {
|
|
49706
49735
|
initializedRef.current = true;
|
|
49707
49736
|
prevPathnameRef.current = pathname;
|
|
@@ -49715,14 +49744,14 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
49715
49744
|
}
|
|
49716
49745
|
|
|
49717
49746
|
// src/components/chat/hooks/use-chat.ts
|
|
49718
|
-
import { useState as
|
|
49747
|
+
import { useState as useState116, useCallback as useCallback51, useEffect as useEffect87, useRef as useRef74 } from "react";
|
|
49719
49748
|
|
|
49720
49749
|
// src/components/chat/hooks/use-sse.ts
|
|
49721
|
-
import { useState as
|
|
49750
|
+
import { useState as useState115, useCallback as useCallback50, useRef as useRef73 } from "react";
|
|
49722
49751
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
49723
|
-
const [isStreaming, setIsStreaming] =
|
|
49724
|
-
const [error, setError] =
|
|
49725
|
-
const abortControllerRef =
|
|
49752
|
+
const [isStreaming, setIsStreaming] = useState115(false);
|
|
49753
|
+
const [error, setError] = useState115(null);
|
|
49754
|
+
const abortControllerRef = useRef73(null);
|
|
49726
49755
|
const fallbackStream = useCallback50(async function* () {
|
|
49727
49756
|
throw new Error(
|
|
49728
49757
|
"[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."
|
|
@@ -49788,12 +49817,12 @@ function useChat({
|
|
|
49788
49817
|
initialMessages,
|
|
49789
49818
|
onMessagesChange
|
|
49790
49819
|
} = {}) {
|
|
49791
|
-
const [messages, setMessages] =
|
|
49792
|
-
const [isTyping, setIsTyping] =
|
|
49793
|
-
const currentAssistantSegmentsRef =
|
|
49794
|
-
const onMessagesChangeRef =
|
|
49820
|
+
const [messages, setMessages] = useState116(() => initialMessages ?? []);
|
|
49821
|
+
const [isTyping, setIsTyping] = useState116(false);
|
|
49822
|
+
const currentAssistantSegmentsRef = useRef74([]);
|
|
49823
|
+
const onMessagesChangeRef = useRef74(onMessagesChange);
|
|
49795
49824
|
onMessagesChangeRef.current = onMessagesChange;
|
|
49796
|
-
|
|
49825
|
+
useEffect87(() => {
|
|
49797
49826
|
onMessagesChangeRef.current?.(messages);
|
|
49798
49827
|
}, [messages]);
|
|
49799
49828
|
const {
|
|
@@ -50082,7 +50111,7 @@ function useChat({
|
|
|
50082
50111
|
}
|
|
50083
50112
|
|
|
50084
50113
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
50085
|
-
import { useState as
|
|
50114
|
+
import { useState as useState117, useEffect as useEffect88, useCallback as useCallback52, useMemo as useMemo45, useRef as useRef75 } from "react";
|
|
50086
50115
|
function createEmptyTurnMeta() {
|
|
50087
50116
|
return {
|
|
50088
50117
|
provider: null,
|
|
@@ -50403,22 +50432,22 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
50403
50432
|
const runtime = useRequiredChatRuntime();
|
|
50404
50433
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
50405
50434
|
const tableIdForDocumentType = options?.tableIdForDocumentType ?? defaultTableIdForDocumentType;
|
|
50406
|
-
const persistedRef =
|
|
50435
|
+
const persistedRef = useRef75(null);
|
|
50407
50436
|
if (persistedRef.current === null) {
|
|
50408
50437
|
pruneStaleChatStorage(source);
|
|
50409
50438
|
persistedRef.current = loadPersistedChat(source) || { messages: [], sources: [], sendCount: 0 };
|
|
50410
50439
|
}
|
|
50411
|
-
const sourcesMapRef =
|
|
50440
|
+
const sourcesMapRef = useRef75(
|
|
50412
50441
|
new Map(persistedRef.current.sources)
|
|
50413
50442
|
);
|
|
50414
|
-
const refsMapRef =
|
|
50443
|
+
const refsMapRef = useRef75(
|
|
50415
50444
|
new Map(persistedRef.current.refs ?? [])
|
|
50416
50445
|
);
|
|
50417
|
-
const metaMapRef =
|
|
50418
|
-
const messagesRef =
|
|
50419
|
-
const sendCountRef =
|
|
50420
|
-
const [streamingPhase, setStreamingPhase] =
|
|
50421
|
-
const [metaTick, setMetaTick] =
|
|
50446
|
+
const metaMapRef = useRef75(/* @__PURE__ */ new Map());
|
|
50447
|
+
const messagesRef = useRef75(persistedRef.current.messages);
|
|
50448
|
+
const sendCountRef = useRef75(persistedRef.current.sendCount);
|
|
50449
|
+
const [streamingPhase, setStreamingPhase] = useState117("idle");
|
|
50450
|
+
const [metaTick, setMetaTick] = useState117(0);
|
|
50422
50451
|
const bumpMetaTick = useCallback52(() => setMetaTick((t) => t + 1), []);
|
|
50423
50452
|
const streamFn = useMemo45(
|
|
50424
50453
|
() => createDocStreamFn(
|
|
@@ -50606,7 +50635,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
50606
50635
|
}
|
|
50607
50636
|
}
|
|
50608
50637
|
}, [chatClearMessages, source, bumpMetaTick]);
|
|
50609
|
-
|
|
50638
|
+
useEffect88(() => {
|
|
50610
50639
|
if (!isTyping && !isStreaming && streamingPhase !== "idle") {
|
|
50611
50640
|
setStreamingPhase("idle");
|
|
50612
50641
|
}
|
|
@@ -50688,10 +50717,10 @@ var noopRejectRequest = async (_id, _reason) => {
|
|
|
50688
50717
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
50689
50718
|
import {
|
|
50690
50719
|
useCallback as useCallback53,
|
|
50691
|
-
useEffect as
|
|
50720
|
+
useEffect as useEffect89,
|
|
50692
50721
|
useMemo as useMemo46,
|
|
50693
|
-
useRef as
|
|
50694
|
-
useState as
|
|
50722
|
+
useRef as useRef76,
|
|
50723
|
+
useState as useState118
|
|
50695
50724
|
} from "react";
|
|
50696
50725
|
|
|
50697
50726
|
// src/components/chat/utils/process-historical-messages.ts
|
|
@@ -51388,32 +51417,32 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51388
51417
|
modelLabel = null
|
|
51389
51418
|
} = config;
|
|
51390
51419
|
const isManagedMode = fetchDialogs !== void 0;
|
|
51391
|
-
const [internalDialogId, setInternalDialogId] =
|
|
51420
|
+
const [internalDialogId, setInternalDialogId] = useState118(null);
|
|
51392
51421
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
51393
|
-
const currentDialogIdRef =
|
|
51422
|
+
const currentDialogIdRef = useRef76(dialogId);
|
|
51394
51423
|
currentDialogIdRef.current = dialogId;
|
|
51395
|
-
const [messages, setMessages] =
|
|
51396
|
-
const [streamingPhase, setStreamingPhase] =
|
|
51397
|
-
const streamingPhaseRef =
|
|
51424
|
+
const [messages, setMessages] = useState118([]);
|
|
51425
|
+
const [streamingPhase, setStreamingPhase] = useState118("idle");
|
|
51426
|
+
const streamingPhaseRef = useRef76(streamingPhase);
|
|
51398
51427
|
streamingPhaseRef.current = streamingPhase;
|
|
51399
|
-
const suppressAgentBusyRef =
|
|
51400
|
-
const adoptTrailingAssistantRef =
|
|
51401
|
-
const hasConnectedOnceRef =
|
|
51402
|
-
const seenParticipantSeqsRef =
|
|
51403
|
-
const pendingEchoTextsRef =
|
|
51404
|
-
const [approvalStatuses, setApprovalStatuses] =
|
|
51405
|
-
const [dialogs, setDialogs] =
|
|
51406
|
-
const [dialogsNextCursor, setDialogsNextCursor] =
|
|
51407
|
-
const [isDialogsLoading, setIsDialogsLoading] =
|
|
51408
|
-
const [dialogsError, setDialogsError] =
|
|
51409
|
-
const [isCreatingDialog, setIsCreatingDialog] =
|
|
51410
|
-
const [messagesNextCursor, setMessagesNextCursor] =
|
|
51411
|
-
const [isMessagesLoading, setIsMessagesLoading] =
|
|
51412
|
-
const [dialogTokenUsage, setDialogTokenUsage] =
|
|
51428
|
+
const suppressAgentBusyRef = useRef76(0);
|
|
51429
|
+
const adoptTrailingAssistantRef = useRef76(false);
|
|
51430
|
+
const hasConnectedOnceRef = useRef76(false);
|
|
51431
|
+
const seenParticipantSeqsRef = useRef76(/* @__PURE__ */ new Set());
|
|
51432
|
+
const pendingEchoTextsRef = useRef76([]);
|
|
51433
|
+
const [approvalStatuses, setApprovalStatuses] = useState118({});
|
|
51434
|
+
const [dialogs, setDialogs] = useState118([]);
|
|
51435
|
+
const [dialogsNextCursor, setDialogsNextCursor] = useState118(null);
|
|
51436
|
+
const [isDialogsLoading, setIsDialogsLoading] = useState118(false);
|
|
51437
|
+
const [dialogsError, setDialogsError] = useState118(false);
|
|
51438
|
+
const [isCreatingDialog, setIsCreatingDialog] = useState118(false);
|
|
51439
|
+
const [messagesNextCursor, setMessagesNextCursor] = useState118(null);
|
|
51440
|
+
const [isMessagesLoading, setIsMessagesLoading] = useState118(false);
|
|
51441
|
+
const [dialogTokenUsage, setDialogTokenUsage] = useState118(
|
|
51413
51442
|
null
|
|
51414
51443
|
);
|
|
51415
|
-
const [liveModel, setLiveModel] =
|
|
51416
|
-
const [connectionState, setConnectionState] =
|
|
51444
|
+
const [liveModel, setLiveModel] = useState118(null);
|
|
51445
|
+
const [connectionState, setConnectionState] = useState118("connecting");
|
|
51417
51446
|
const handleApprove = useCallback53(
|
|
51418
51447
|
async (requestId) => {
|
|
51419
51448
|
if (!approveRequestCallback) return;
|
|
@@ -51453,9 +51482,9 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51453
51482
|
},
|
|
51454
51483
|
[rejectRequestCallback]
|
|
51455
51484
|
);
|
|
51456
|
-
const handleApproveRef =
|
|
51485
|
+
const handleApproveRef = useRef76(handleApprove);
|
|
51457
51486
|
handleApproveRef.current = handleApprove;
|
|
51458
|
-
const handleRejectRef =
|
|
51487
|
+
const handleRejectRef = useRef76(handleReject);
|
|
51459
51488
|
handleRejectRef.current = handleReject;
|
|
51460
51489
|
const accumApprove = useCallback53((requestId) => {
|
|
51461
51490
|
if (!requestId) return;
|
|
@@ -51465,7 +51494,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51465
51494
|
if (!requestId) return;
|
|
51466
51495
|
return handleRejectRef.current(requestId);
|
|
51467
51496
|
}, []);
|
|
51468
|
-
const callbacksRef =
|
|
51497
|
+
const callbacksRef = useRef76({
|
|
51469
51498
|
onSegmentsUpdate: (segments, meta) => {
|
|
51470
51499
|
if (meta?.append && meta.isCompacting) {
|
|
51471
51500
|
setMessages((prev) => upsertTrailingCompaction(prev, segments));
|
|
@@ -51683,7 +51712,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51683
51712
|
onChunkReceived: (chunk) => processChunk(chunk),
|
|
51684
51713
|
fetchChunks
|
|
51685
51714
|
});
|
|
51686
|
-
const historyLoadSeqRef =
|
|
51715
|
+
const historyLoadSeqRef = useRef76(0);
|
|
51687
51716
|
const loadDialogHistory = useCallback53(
|
|
51688
51717
|
async (id, cursor) => {
|
|
51689
51718
|
if (!fetchDialogMessages) return;
|
|
@@ -51742,8 +51771,8 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51742
51771
|
isBufferingActive
|
|
51743
51772
|
]
|
|
51744
51773
|
);
|
|
51745
|
-
const prevDialogIdRef =
|
|
51746
|
-
|
|
51774
|
+
const prevDialogIdRef = useRef76(void 0);
|
|
51775
|
+
useEffect89(() => {
|
|
51747
51776
|
if (prevDialogIdRef.current === dialogId) return;
|
|
51748
51777
|
prevDialogIdRef.current = dialogId;
|
|
51749
51778
|
historyLoadSeqRef.current += 1;
|
|
@@ -51760,7 +51789,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51760
51789
|
if (!active || !dialogId) return;
|
|
51761
51790
|
void loadDialogHistory(dialogId);
|
|
51762
51791
|
}, [active, dialogId, loadDialogHistory, resetAccumulator]);
|
|
51763
|
-
|
|
51792
|
+
useEffect89(() => {
|
|
51764
51793
|
if (!active || !dialogId) return;
|
|
51765
51794
|
suppressAgentBusyRef.current += 1;
|
|
51766
51795
|
resetChunkTracking();
|
|
@@ -51812,14 +51841,14 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51812
51841
|
})();
|
|
51813
51842
|
}
|
|
51814
51843
|
});
|
|
51815
|
-
|
|
51844
|
+
useEffect89(() => {
|
|
51816
51845
|
if (!active || !dialogId) {
|
|
51817
51846
|
setConnectionState("connected");
|
|
51818
51847
|
return;
|
|
51819
51848
|
}
|
|
51820
51849
|
setConnectionState("connecting");
|
|
51821
51850
|
}, [active, dialogId]);
|
|
51822
|
-
const initialDialogsLoadedRef =
|
|
51851
|
+
const initialDialogsLoadedRef = useRef76(false);
|
|
51823
51852
|
const loadDialogsPage = useCallback53(
|
|
51824
51853
|
async (cursor) => {
|
|
51825
51854
|
if (!fetchDialogs) return;
|
|
@@ -51851,7 +51880,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51851
51880
|
const reloadDialogs = useCallback53(() => {
|
|
51852
51881
|
void loadDialogsPage();
|
|
51853
51882
|
}, [loadDialogsPage]);
|
|
51854
|
-
|
|
51883
|
+
useEffect89(() => {
|
|
51855
51884
|
if (!fetchDialogs) return;
|
|
51856
51885
|
if (!active) return;
|
|
51857
51886
|
if (initialDialogsLoadedRef.current) return;
|
|
@@ -52094,7 +52123,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
52094
52123
|
}
|
|
52095
52124
|
|
|
52096
52125
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
52097
|
-
import { useCallback as useCallback54, useMemo as useMemo47, useRef as
|
|
52126
|
+
import { useCallback as useCallback54, useMemo as useMemo47, useRef as useRef77 } from "react";
|
|
52098
52127
|
var EMPTY_SSE_OPTIONS = {};
|
|
52099
52128
|
function createDisabledNatsConfig() {
|
|
52100
52129
|
return {
|
|
@@ -52109,7 +52138,7 @@ function createDisabledNatsConfig() {
|
|
|
52109
52138
|
}
|
|
52110
52139
|
function useUnifiedChat(options) {
|
|
52111
52140
|
const { modes, activeMode, mingoStateOverride } = options;
|
|
52112
|
-
const disabledNatsRef =
|
|
52141
|
+
const disabledNatsRef = useRef77(null);
|
|
52113
52142
|
if (disabledNatsRef.current === null) {
|
|
52114
52143
|
disabledNatsRef.current = createDisabledNatsConfig();
|
|
52115
52144
|
}
|
|
@@ -52123,7 +52152,7 @@ function useUnifiedChat(options) {
|
|
|
52123
52152
|
{ active: natsActive }
|
|
52124
52153
|
);
|
|
52125
52154
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
52126
|
-
const activeStateRef =
|
|
52155
|
+
const activeStateRef = useRef77(activeState);
|
|
52127
52156
|
activeStateRef.current = activeState;
|
|
52128
52157
|
const stopMessage = useCallback54(() => activeStateRef.current.stopMessage(), []);
|
|
52129
52158
|
const clearMessages = useCallback54(
|
|
@@ -52478,7 +52507,7 @@ function buildStreamFrames(messages) {
|
|
|
52478
52507
|
|
|
52479
52508
|
// src/components/chat/embeddable-chat.tsx
|
|
52480
52509
|
init_cn();
|
|
52481
|
-
import { useCallback as useCallback56, useEffect as
|
|
52510
|
+
import { useCallback as useCallback56, useEffect as useEffect90, useMemo as useMemo49, useRef as useRef79, useState as useState120 } from "react";
|
|
52482
52511
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
52483
52512
|
import { usePreventScroll as usePreventScroll6 } from "@react-aria/overlays";
|
|
52484
52513
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -52559,7 +52588,7 @@ init_button2();
|
|
|
52559
52588
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
52560
52589
|
|
|
52561
52590
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
52562
|
-
import { useCallback as useCallback55, useMemo as useMemo48, useRef as
|
|
52591
|
+
import { useCallback as useCallback55, useMemo as useMemo48, useRef as useRef78, useState as useState119 } from "react";
|
|
52563
52592
|
function useChatDialogManager({
|
|
52564
52593
|
dialogs,
|
|
52565
52594
|
activeDialogId,
|
|
@@ -52570,8 +52599,8 @@ function useChatDialogManager({
|
|
|
52570
52599
|
fetchArchivedDialogs,
|
|
52571
52600
|
unarchiveDialog
|
|
52572
52601
|
}) {
|
|
52573
|
-
const [renameTarget, setRenameTarget] =
|
|
52574
|
-
const [archiveTarget, setArchiveTarget] =
|
|
52602
|
+
const [renameTarget, setRenameTarget] = useState119(null);
|
|
52603
|
+
const [archiveTarget, setArchiveTarget] = useState119(null);
|
|
52575
52604
|
const handleConfirmRename = useCallback55(
|
|
52576
52605
|
(name) => {
|
|
52577
52606
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
@@ -52594,12 +52623,12 @@ function useChatDialogManager({
|
|
|
52594
52623
|
}
|
|
52595
52624
|
setArchiveTarget(null);
|
|
52596
52625
|
}, [archiveTarget, archiveDialog, activeDialogId, clearMessages]);
|
|
52597
|
-
const [archiveOpen, setArchiveOpen] =
|
|
52598
|
-
const [archivedDialogs, setArchivedDialogs] =
|
|
52599
|
-
const [archivedCursor, setArchivedCursor] =
|
|
52600
|
-
const [archivedLoading, setArchivedLoading] =
|
|
52601
|
-
const [archivedPending, setArchivedPending] =
|
|
52602
|
-
const archivedRequestIdRef =
|
|
52626
|
+
const [archiveOpen, setArchiveOpen] = useState119(false);
|
|
52627
|
+
const [archivedDialogs, setArchivedDialogs] = useState119([]);
|
|
52628
|
+
const [archivedCursor, setArchivedCursor] = useState119(null);
|
|
52629
|
+
const [archivedLoading, setArchivedLoading] = useState119(false);
|
|
52630
|
+
const [archivedPending, setArchivedPending] = useState119(false);
|
|
52631
|
+
const archivedRequestIdRef = useRef78(0);
|
|
52603
52632
|
const loadArchivedPage = useCallback55(
|
|
52604
52633
|
async (cursor) => {
|
|
52605
52634
|
if (!fetchArchivedDialogs) return;
|
|
@@ -52640,10 +52669,10 @@ function useChatDialogManager({
|
|
|
52640
52669
|
void loadArchivedPage();
|
|
52641
52670
|
}, [loadArchivedPage]);
|
|
52642
52671
|
const closeArchive = useCallback55(() => setArchiveOpen(false), []);
|
|
52643
|
-
const [viewingArchivedId, setViewingArchivedId] =
|
|
52672
|
+
const [viewingArchivedId, setViewingArchivedId] = useState119(
|
|
52644
52673
|
null
|
|
52645
52674
|
);
|
|
52646
|
-
const [openingDialogId, setOpeningDialogId] =
|
|
52675
|
+
const [openingDialogId, setOpeningDialogId] = useState119(null);
|
|
52647
52676
|
const handleSelectDialog = useCallback55(
|
|
52648
52677
|
(id) => {
|
|
52649
52678
|
setViewingArchivedId(null);
|
|
@@ -52662,7 +52691,7 @@ function useChatDialogManager({
|
|
|
52662
52691
|
},
|
|
52663
52692
|
[selectDialog]
|
|
52664
52693
|
);
|
|
52665
|
-
const [restoreTarget, setRestoreTarget] =
|
|
52694
|
+
const [restoreTarget, setRestoreTarget] = useState119(null);
|
|
52666
52695
|
const handleConfirmRestore = useCallback55(async () => {
|
|
52667
52696
|
if (restoreTarget) {
|
|
52668
52697
|
try {
|
|
@@ -52755,9 +52784,9 @@ var SPLIT_MIN_WIDTH = HISTORY_RAIL_WIDTH + CHAT_BLOCK_MIN_WIDTH;
|
|
|
52755
52784
|
var RAIL_COLLAPSED_STORAGE_KEY = "mingo-chat-history-collapsed";
|
|
52756
52785
|
var RAIL_ANIM_MS = 320;
|
|
52757
52786
|
function useRailPresence(open) {
|
|
52758
|
-
const [mounted, setMounted] =
|
|
52759
|
-
const [active, setActive] =
|
|
52760
|
-
|
|
52787
|
+
const [mounted, setMounted] = useState120(open);
|
|
52788
|
+
const [active, setActive] = useState120(false);
|
|
52789
|
+
useEffect90(() => {
|
|
52761
52790
|
if (open) {
|
|
52762
52791
|
setMounted(true);
|
|
52763
52792
|
let raf2 = 0;
|
|
@@ -52975,7 +53004,7 @@ function SourceChips({
|
|
|
52975
53004
|
onClose,
|
|
52976
53005
|
onDiscuss
|
|
52977
53006
|
}) {
|
|
52978
|
-
const [expanded, setExpanded] =
|
|
53007
|
+
const [expanded, setExpanded] = useState120(false);
|
|
52979
53008
|
if (cited.length === 0) {
|
|
52980
53009
|
const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
|
|
52981
53010
|
if (fallback.length === 0) return null;
|
|
@@ -53082,7 +53111,7 @@ function EmbeddableChatInner({
|
|
|
53082
53111
|
const commandsUrl = runtime.endpoints.commandsUrl;
|
|
53083
53112
|
const { attachmentsEnabled, user: identityUser } = useChatIdentity();
|
|
53084
53113
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
53085
|
-
|
|
53114
|
+
useEffect90(() => {
|
|
53086
53115
|
if (process.env.NODE_ENV !== "production") {
|
|
53087
53116
|
const hasOpen = open !== void 0;
|
|
53088
53117
|
const hasHandler = onOpenChange !== void 0;
|
|
@@ -53098,13 +53127,13 @@ function EmbeddableChatInner({
|
|
|
53098
53127
|
defaultProp: defaultOpen ?? false,
|
|
53099
53128
|
onChange: onOpenChange
|
|
53100
53129
|
});
|
|
53101
|
-
const [autoFocusInput] =
|
|
53130
|
+
const [autoFocusInput] = useState120(() => {
|
|
53102
53131
|
if (typeof window === "undefined") return false;
|
|
53103
53132
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
53104
53133
|
});
|
|
53105
53134
|
usePreventScroll6({ isDisabled: !isOpen || shellLess });
|
|
53106
|
-
const navigatingAwayRef =
|
|
53107
|
-
|
|
53135
|
+
const navigatingAwayRef = useRef79(false);
|
|
53136
|
+
useEffect90(() => {
|
|
53108
53137
|
if (!isOpen) return;
|
|
53109
53138
|
if (shellLess) return;
|
|
53110
53139
|
if (typeof window === "undefined") return;
|
|
@@ -53130,8 +53159,8 @@ function EmbeddableChatInner({
|
|
|
53130
53159
|
window.scrollTo(0, scrollY);
|
|
53131
53160
|
};
|
|
53132
53161
|
}, [isOpen, shellLess]);
|
|
53133
|
-
const chatInputRef =
|
|
53134
|
-
const [quickActionPreview, setQuickActionPreview] =
|
|
53162
|
+
const chatInputRef = useRef79(null);
|
|
53163
|
+
const [quickActionPreview, setQuickActionPreview] = useState120(null);
|
|
53135
53164
|
const slashCommandsProp = useMemo49(
|
|
53136
53165
|
() => ({
|
|
53137
53166
|
fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
|
|
@@ -53174,7 +53203,7 @@ function EmbeddableChatInner({
|
|
|
53174
53203
|
}, [mingoState, mingoDialogCapabilities, effectiveModes]);
|
|
53175
53204
|
const hasMingoMode = !!effectiveModes.mingo || !!mingoState;
|
|
53176
53205
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
53177
|
-
const [uncontrolledActiveMode, setUncontrolledActiveMode] =
|
|
53206
|
+
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState120(initialActiveMode);
|
|
53178
53207
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
53179
53208
|
const handleActiveModeChange = useCallback56(
|
|
53180
53209
|
(next) => {
|
|
@@ -53234,8 +53263,8 @@ function EmbeddableChatInner({
|
|
|
53234
53263
|
hasMoreMessages,
|
|
53235
53264
|
loadMoreMessages
|
|
53236
53265
|
} = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
|
|
53237
|
-
const guidePromptSentRef =
|
|
53238
|
-
|
|
53266
|
+
const guidePromptSentRef = useRef79(false);
|
|
53267
|
+
useEffect90(() => {
|
|
53239
53268
|
if (!guidePendingPrompt) {
|
|
53240
53269
|
guidePromptSentRef.current = false;
|
|
53241
53270
|
return;
|
|
@@ -53256,15 +53285,15 @@ function EmbeddableChatInner({
|
|
|
53256
53285
|
const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
|
|
53257
53286
|
const contextMaxItems = contextPicker?.maxItems ?? 10;
|
|
53258
53287
|
const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
|
|
53259
|
-
const [contextItems, setContextItems] =
|
|
53260
|
-
const [contextPickerOpen, setContextPickerOpen] =
|
|
53261
|
-
const [mentionQuery, setMentionQuery] =
|
|
53262
|
-
const mentionActiveRef =
|
|
53263
|
-
|
|
53288
|
+
const [contextItems, setContextItems] = useState120([]);
|
|
53289
|
+
const [contextPickerOpen, setContextPickerOpen] = useState120(false);
|
|
53290
|
+
const [mentionQuery, setMentionQuery] = useState120(null);
|
|
53291
|
+
const mentionActiveRef = useRef79(false);
|
|
53292
|
+
useEffect90(() => {
|
|
53264
53293
|
mentionActiveRef.current = mentionQuery !== null;
|
|
53265
53294
|
}, [mentionQuery]);
|
|
53266
|
-
const mentionKeysRef =
|
|
53267
|
-
|
|
53295
|
+
const mentionKeysRef = useRef79(/* @__PURE__ */ new Set());
|
|
53296
|
+
useEffect90(() => {
|
|
53268
53297
|
setContextItems([]);
|
|
53269
53298
|
setMentionQuery(null);
|
|
53270
53299
|
mentionKeysRef.current.clear();
|
|
@@ -53360,7 +53389,7 @@ function EmbeddableChatInner({
|
|
|
53360
53389
|
() => effectiveAssistantIcon ? /* @__PURE__ */ jsx362(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx362(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
53361
53390
|
[effectiveAssistantIcon]
|
|
53362
53391
|
);
|
|
53363
|
-
const timestampCacheRef =
|
|
53392
|
+
const timestampCacheRef = useRef79(/* @__PURE__ */ new Map());
|
|
53364
53393
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
53365
53394
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
53366
53395
|
const messages = useMemo49(() => {
|
|
@@ -53487,7 +53516,7 @@ function EmbeddableChatInner({
|
|
|
53487
53516
|
});
|
|
53488
53517
|
const handleOpen = useCallback56(() => setIsOpen(true), [setIsOpen]);
|
|
53489
53518
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
53490
|
-
|
|
53519
|
+
useEffect90(() => {
|
|
53491
53520
|
const handler = (e) => {
|
|
53492
53521
|
const detail = e.detail;
|
|
53493
53522
|
if (!detail || detail.source !== source) return;
|
|
@@ -53497,7 +53526,7 @@ function EmbeddableChatInner({
|
|
|
53497
53526
|
window.addEventListener("ask-ai:open-with-ref", handler);
|
|
53498
53527
|
return () => window.removeEventListener("ask-ai:open-with-ref", handler);
|
|
53499
53528
|
}, [source, discussRef, setIsOpen]);
|
|
53500
|
-
|
|
53529
|
+
useEffect90(() => {
|
|
53501
53530
|
const handler = (e) => {
|
|
53502
53531
|
const detail = e.detail;
|
|
53503
53532
|
if (!detail || detail.source !== source) return;
|
|
@@ -53514,7 +53543,7 @@ function EmbeddableChatInner({
|
|
|
53514
53543
|
const contentViewKey = hasConversation ? "conversation" : activeMode;
|
|
53515
53544
|
const isGuideEmpty = !hasConversation && activeMode === "guide";
|
|
53516
53545
|
const isQuickActionEmpty = !hasConversation && (activeMode === "guide" || activeMode === "mingo");
|
|
53517
|
-
|
|
53546
|
+
useEffect90(() => {
|
|
53518
53547
|
if (!isQuickActionEmpty) setQuickActionPreview(null);
|
|
53519
53548
|
}, [isQuickActionEmpty]);
|
|
53520
53549
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
@@ -53556,10 +53585,10 @@ function EmbeddableChatInner({
|
|
|
53556
53585
|
const uncited = sources.filter((s) => !seenOrder.has(s.index));
|
|
53557
53586
|
return { cited, uncited };
|
|
53558
53587
|
}, [lastAssistantMsg, chatLoading]);
|
|
53559
|
-
const [portalHost, setPortalHost] =
|
|
53560
|
-
const [panelWidth, setPanelWidth] =
|
|
53561
|
-
const panelMeasureRef =
|
|
53562
|
-
|
|
53588
|
+
const [portalHost, setPortalHost] = useState120(null);
|
|
53589
|
+
const [panelWidth, setPanelWidth] = useState120(0);
|
|
53590
|
+
const panelMeasureRef = useRef79(null);
|
|
53591
|
+
useEffect90(() => {
|
|
53563
53592
|
const el = panelMeasureRef.current;
|
|
53564
53593
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
53565
53594
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -53570,8 +53599,8 @@ function EmbeddableChatInner({
|
|
|
53570
53599
|
setPanelWidth(el.clientWidth);
|
|
53571
53600
|
return () => ro.disconnect();
|
|
53572
53601
|
}, []);
|
|
53573
|
-
const [railCollapsed, setRailCollapsed] =
|
|
53574
|
-
|
|
53602
|
+
const [railCollapsed, setRailCollapsed] = useState120(false);
|
|
53603
|
+
useEffect90(() => {
|
|
53575
53604
|
try {
|
|
53576
53605
|
if (window.localStorage.getItem(RAIL_COLLAPSED_STORAGE_KEY) === "1")
|
|
53577
53606
|
setRailCollapsed(true);
|
|
@@ -53588,15 +53617,15 @@ function EmbeddableChatInner({
|
|
|
53588
53617
|
return next;
|
|
53589
53618
|
});
|
|
53590
53619
|
}, []);
|
|
53591
|
-
const [railSearchOpen, setRailSearchOpen] =
|
|
53620
|
+
const [railSearchOpen, setRailSearchOpen] = useState120(false);
|
|
53592
53621
|
const splitEligible = activeMode === "mingo";
|
|
53593
53622
|
const canSplit = panelWidth >= SPLIT_MIN_WIDTH;
|
|
53594
53623
|
const wideMingo = splitEligible && canSplit && !previewMode;
|
|
53595
53624
|
const splitActive = wideMingo && !railCollapsed;
|
|
53596
53625
|
const railPresence = useRailPresence(splitActive);
|
|
53597
53626
|
const showWideHeader = wideMingo || railPresence.mounted;
|
|
53598
|
-
const [composeOpen, setComposeOpen] =
|
|
53599
|
-
|
|
53627
|
+
const [composeOpen, setComposeOpen] = useState120(false);
|
|
53628
|
+
useEffect90(() => {
|
|
53600
53629
|
if (hasConversation) setComposeOpen(false);
|
|
53601
53630
|
}, [hasConversation]);
|
|
53602
53631
|
const isMingoMode = activeMode === "mingo";
|
|
@@ -55116,4 +55145,4 @@ export {
|
|
|
55116
55145
|
LogsList,
|
|
55117
55146
|
assets
|
|
55118
55147
|
};
|
|
55119
|
-
//# sourceMappingURL=chunk-
|
|
55148
|
+
//# sourceMappingURL=chunk-WSPRJARS.js.map
|