@flamingo-stack/openframe-frontend-core 0.0.445 → 0.0.446-snapshot.20260717214810
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-R6WGCJBB.cjs → chunk-2PNWAAU4.cjs} +73 -73
- package/dist/{chunk-R6WGCJBB.cjs.map → chunk-2PNWAAU4.cjs.map} +1 -1
- package/dist/{chunk-H352AZJN.js → chunk-3GBLPPSW.js} +6 -6
- package/dist/{chunk-TCEBFMLQ.js → chunk-4ONE3HQP.js} +2 -2
- package/dist/{chunk-K4RASNQM.js → chunk-5BJJRPDH.js} +3 -3
- package/dist/{chunk-H2DYCT6M.js → chunk-6TAIXSF5.js} +2 -2
- package/dist/{chunk-VIJARDBM.cjs → chunk-AN7MCJTV.cjs} +5 -3
- package/dist/chunk-AN7MCJTV.cjs.map +1 -0
- package/dist/{chunk-7R256DKK.js → chunk-D2NLNBLH.js} +2 -2
- package/dist/{chunk-N64VTHZ5.cjs → chunk-E6HKLQ3Q.cjs} +7 -7
- package/dist/{chunk-N64VTHZ5.cjs.map → chunk-E6HKLQ3Q.cjs.map} +1 -1
- package/dist/{chunk-DTLNCOSG.cjs → chunk-EZMM2OMP.cjs} +32 -32
- package/dist/{chunk-DTLNCOSG.cjs.map → chunk-EZMM2OMP.cjs.map} +1 -1
- package/dist/{chunk-5FUQTSTT.cjs → chunk-FR6NVZVM.cjs} +18 -18
- package/dist/{chunk-5FUQTSTT.cjs.map → chunk-FR6NVZVM.cjs.map} +1 -1
- package/dist/{chunk-Z4N7XLFG.js → chunk-G7QSLGMI.js} +3 -3
- package/dist/{chunk-5DWPXK37.cjs → chunk-ITJMUH4Q.cjs} +40 -40
- package/dist/{chunk-5DWPXK37.cjs.map → chunk-ITJMUH4Q.cjs.map} +1 -1
- package/dist/{chunk-P3FN4NAE.cjs → chunk-KYLOPUIH.cjs} +29 -29
- package/dist/{chunk-P3FN4NAE.cjs.map → chunk-KYLOPUIH.cjs.map} +1 -1
- package/dist/{chunk-YCLSV2H6.cjs → chunk-PF6CKZIH.cjs} +5 -5
- package/dist/{chunk-YCLSV2H6.cjs.map → chunk-PF6CKZIH.cjs.map} +1 -1
- package/dist/{chunk-QL2EI56X.cjs → chunk-RNXMP7GB.cjs} +1014 -988
- package/dist/chunk-RNXMP7GB.cjs.map +1 -0
- package/dist/{chunk-PTT4J5GF.cjs → chunk-ROCJMSJI.cjs} +3 -3
- package/dist/{chunk-PTT4J5GF.cjs.map → chunk-ROCJMSJI.cjs.map} +1 -1
- package/dist/{chunk-RXLMN6B5.cjs → chunk-S7VMUDUB.cjs} +12 -12
- package/dist/{chunk-RXLMN6B5.cjs.map → chunk-S7VMUDUB.cjs.map} +1 -1
- package/dist/{chunk-22NSWMI6.js → chunk-SHC5NFOH.js} +3 -3
- package/dist/{chunk-5NYXGWBN.js → chunk-TKGCTDQY.js} +4 -2
- package/dist/{chunk-5NYXGWBN.js.map → chunk-TKGCTDQY.js.map} +1 -1
- package/dist/{chunk-3DQ5BFPM.js → chunk-TMZYFYSS.js} +5 -5
- package/dist/{chunk-KISQUH33.cjs → chunk-WLU37UZO.cjs} +73 -73
- package/dist/{chunk-KISQUH33.cjs.map → chunk-WLU37UZO.cjs.map} +1 -1
- package/dist/{chunk-FIAXFNAA.js → chunk-WMOF3WQT.js} +5 -5
- package/dist/{chunk-MPSA6YAM.cjs → chunk-X4XHW3OV.cjs} +40 -40
- package/dist/{chunk-MPSA6YAM.cjs.map → chunk-X4XHW3OV.cjs.map} +1 -1
- package/dist/{chunk-3HYSD7NR.cjs → chunk-XUS75SQW.cjs} +15 -15
- package/dist/{chunk-3HYSD7NR.cjs.map → chunk-XUS75SQW.cjs.map} +1 -1
- package/dist/{chunk-3BHV2QAH.js → chunk-YCSNDUDE.js} +510 -484
- package/dist/chunk-YCSNDUDE.js.map +1 -0
- package/dist/{chunk-G2KXNMFQ.js → chunk-YHNBJ3F3.js} +2 -2
- package/dist/{chunk-MQUS6BFR.js → chunk-ZQVEB6KT.js} +6 -6
- package/dist/{chunk-XPZLIONZ.js → chunk-ZYB3BYBA.js} +4 -4
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/cards-strip.d.ts.map +1 -1
- package/dist/components/features/highlight-video-section.d.ts.map +1 -1
- package/dist/components/features/index.cjs +5 -3
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +4 -2
- package/dist/components/features/media-gallery-manager.d.ts.map +1 -1
- package/dist/components/features/mux-origins.cjs +14 -0
- package/dist/components/features/mux-origins.cjs.map +1 -1
- package/dist/components/features/mux-origins.d.ts +26 -2
- package/dist/components/features/mux-origins.d.ts.map +1 -1
- package/dist/components/features/mux-origins.js +14 -1
- package/dist/components/features/mux-origins.js.map +1 -1
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/features/release-media-manager.d.ts.map +1 -1
- package/dist/components/features/use-video-warmup.d.ts +12 -0
- package/dist/components/features/use-video-warmup.d.ts.map +1 -1
- package/dist/components/features/video-bites-strip.d.ts.map +1 -1
- package/dist/components/features/video-source-selector.d.ts +1 -11
- package/dist/components/features/video-source-selector.d.ts.map +1 -1
- package/dist/components/features/video.d.ts +14 -1
- package/dist/components/features/video.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +137 -135
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +13 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/onboarding-guides/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.js +6 -6
- package/dist/components/related-content/index.cjs +5 -5
- package/dist/components/related-content/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/use-near-viewport.d.ts +7 -0
- package/dist/hooks/use-near-viewport.d.ts.map +1 -1
- package/dist/index.cjs +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -2
- package/package.json +1 -1
- package/src/components/features/cards-strip.tsx +2 -1
- package/src/components/features/highlight-video-section.tsx +10 -7
- package/src/components/features/media-gallery-manager.tsx +6 -8
- package/src/components/features/mux-origins.ts +40 -2
- package/src/components/features/policy-configuration-panel.tsx +34 -49
- package/src/components/features/release-media-manager.tsx +6 -8
- package/src/components/features/use-video-warmup.ts +19 -3
- package/src/components/features/video-bites-strip.tsx +24 -4
- package/src/components/features/video-source-selector.tsx +16 -56
- package/src/components/features/video.tsx +103 -8
- package/src/components/ui/rich-markdown-renderer.tsx +20 -0
- package/src/components/ui/simple-markdown-renderer.tsx +9 -5
- package/src/hooks/use-near-viewport.ts +9 -1
- package/src/stories/PolicyConfigurationPanel.stories.tsx +8 -6
- package/dist/chunk-3BHV2QAH.js.map +0 -1
- package/dist/chunk-QL2EI56X.cjs.map +0 -1
- package/dist/chunk-VIJARDBM.cjs.map +0 -1
- /package/dist/{chunk-H352AZJN.js.map → chunk-3GBLPPSW.js.map} +0 -0
- /package/dist/{chunk-TCEBFMLQ.js.map → chunk-4ONE3HQP.js.map} +0 -0
- /package/dist/{chunk-K4RASNQM.js.map → chunk-5BJJRPDH.js.map} +0 -0
- /package/dist/{chunk-H2DYCT6M.js.map → chunk-6TAIXSF5.js.map} +0 -0
- /package/dist/{chunk-7R256DKK.js.map → chunk-D2NLNBLH.js.map} +0 -0
- /package/dist/{chunk-Z4N7XLFG.js.map → chunk-G7QSLGMI.js.map} +0 -0
- /package/dist/{chunk-22NSWMI6.js.map → chunk-SHC5NFOH.js.map} +0 -0
- /package/dist/{chunk-3DQ5BFPM.js.map → chunk-TMZYFYSS.js.map} +0 -0
- /package/dist/{chunk-FIAXFNAA.js.map → chunk-WMOF3WQT.js.map} +0 -0
- /package/dist/{chunk-G2KXNMFQ.js.map → chunk-YHNBJ3F3.js.map} +0 -0
- /package/dist/{chunk-MQUS6BFR.js.map → chunk-ZQVEB6KT.js.map} +0 -0
- /package/dist/{chunk-XPZLIONZ.js.map → chunk-ZYB3BYBA.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
NEAR_VIEWPORT_ROOT_MARGIN,
|
|
3
4
|
STICKY_HEADER_OFFSET_PX,
|
|
4
5
|
ToolIcon,
|
|
5
6
|
dotColorByVariant,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
useOgPlaceholderUrl,
|
|
28
29
|
useOnboardingState,
|
|
29
30
|
useToast
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TKGCTDQY.js";
|
|
31
32
|
import {
|
|
32
33
|
AlertCircleIcon,
|
|
33
34
|
AnthropicLogoGreyIcon,
|
|
@@ -1284,12 +1285,11 @@ var SAFE_HTML_TAGS = /* @__PURE__ */ new Set([
|
|
|
1284
1285
|
"ul",
|
|
1285
1286
|
"var",
|
|
1286
1287
|
"wbr",
|
|
1287
|
-
// Media
|
|
1288
|
+
// Media ('video' intentionally excluded — see the header comment)
|
|
1288
1289
|
"img",
|
|
1289
1290
|
"picture",
|
|
1290
1291
|
"source",
|
|
1291
1292
|
"audio",
|
|
1292
|
-
"video",
|
|
1293
1293
|
"iframe",
|
|
1294
1294
|
"track",
|
|
1295
1295
|
// Forms (rehype-raw allows them; mostly harmless for chat output)
|
|
@@ -10170,7 +10170,7 @@ var TabsContent = React32.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10170
10170
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
10171
10171
|
|
|
10172
10172
|
// src/components/features/video.tsx
|
|
10173
|
-
import { useCallback as useCallback13, useEffect as
|
|
10173
|
+
import { useCallback as useCallback13, useEffect as useEffect18, useMemo as useMemo12, useRef as useRef13, useState as useState23 } from "react";
|
|
10174
10174
|
import MuxPlayer from "@mux/mux-player-react";
|
|
10175
10175
|
|
|
10176
10176
|
// src/components/features/video-center-badge.tsx
|
|
@@ -10216,8 +10216,96 @@ function fetchPriorityProp(priority) {
|
|
|
10216
10216
|
return USE_CAMEL_CASE_FETCH_PRIORITY ? { fetchPriority: value } : { fetchpriority: value };
|
|
10217
10217
|
}
|
|
10218
10218
|
|
|
10219
|
+
// src/components/features/use-video-warmup.ts
|
|
10220
|
+
import { useEffect as useEffect17 } from "react";
|
|
10221
|
+
import ReactDOM from "react-dom";
|
|
10222
|
+
|
|
10223
|
+
// src/components/features/mux-origins.ts
|
|
10224
|
+
var MUX_STREAM_ORIGIN = "https://stream.mux.com";
|
|
10225
|
+
var MUX_IMAGE_ORIGIN = "https://image.mux.com";
|
|
10226
|
+
function toMuxPreviewUrl(url, maxResolution = "720p") {
|
|
10227
|
+
let parsed;
|
|
10228
|
+
try {
|
|
10229
|
+
parsed = new URL(url);
|
|
10230
|
+
} catch {
|
|
10231
|
+
return url;
|
|
10232
|
+
}
|
|
10233
|
+
if (parsed.origin !== MUX_STREAM_ORIGIN) return url;
|
|
10234
|
+
if (!parsed.pathname.endsWith(".m3u8")) return url;
|
|
10235
|
+
if (parsed.searchParams.has("token")) return url;
|
|
10236
|
+
parsed.searchParams.set("max_resolution", maxResolution);
|
|
10237
|
+
return parsed.toString();
|
|
10238
|
+
}
|
|
10239
|
+
|
|
10240
|
+
// src/components/features/use-video-warmup.ts
|
|
10241
|
+
function saveDataEnabled() {
|
|
10242
|
+
if (typeof navigator === "undefined") return false;
|
|
10243
|
+
const conn = navigator.connection;
|
|
10244
|
+
return conn?.saveData === true;
|
|
10245
|
+
}
|
|
10246
|
+
function useVideoOriginPreconnect({
|
|
10247
|
+
supabaseStorageOrigin
|
|
10248
|
+
} = {}) {
|
|
10249
|
+
const runtime = useChatRuntime();
|
|
10250
|
+
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10251
|
+
try {
|
|
10252
|
+
ReactDOM.preconnect(MUX_STREAM_ORIGIN, { crossOrigin: "anonymous" });
|
|
10253
|
+
ReactDOM.preconnect(MUX_IMAGE_ORIGIN, { crossOrigin: "anonymous" });
|
|
10254
|
+
if (resolvedOrigin) {
|
|
10255
|
+
ReactDOM.preconnect(resolvedOrigin, { crossOrigin: "anonymous" });
|
|
10256
|
+
}
|
|
10257
|
+
} catch (err) {
|
|
10258
|
+
if (process.env.NODE_ENV !== "production") {
|
|
10259
|
+
console.warn("[useVideoOriginPreconnect] preconnect failed:", err);
|
|
10260
|
+
}
|
|
10261
|
+
}
|
|
10262
|
+
}
|
|
10263
|
+
function useVideoWarmup({
|
|
10264
|
+
videoUrl,
|
|
10265
|
+
supabaseStorageOrigin,
|
|
10266
|
+
nearMargin = "1000px"
|
|
10267
|
+
} = {}) {
|
|
10268
|
+
const runtime = useChatRuntime();
|
|
10269
|
+
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10270
|
+
useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
|
|
10271
|
+
const { ref, isNear } = useNearViewport(nearMargin);
|
|
10272
|
+
useEffect17(() => {
|
|
10273
|
+
if (!isNear || !videoUrl || !resolvedOrigin) return;
|
|
10274
|
+
if (saveDataEnabled()) return;
|
|
10275
|
+
let videoOrigin;
|
|
10276
|
+
try {
|
|
10277
|
+
videoOrigin = new URL(videoUrl, "http://placeholder.local").origin;
|
|
10278
|
+
} catch {
|
|
10279
|
+
return;
|
|
10280
|
+
}
|
|
10281
|
+
if (videoOrigin !== resolvedOrigin) return;
|
|
10282
|
+
const link = document.createElement("link");
|
|
10283
|
+
link.rel = "preload";
|
|
10284
|
+
link.as = "video";
|
|
10285
|
+
link.href = videoUrl;
|
|
10286
|
+
link.crossOrigin = "anonymous";
|
|
10287
|
+
if ("fetchPriority" in link) {
|
|
10288
|
+
;
|
|
10289
|
+
link.fetchPriority = "low";
|
|
10290
|
+
}
|
|
10291
|
+
document.head.appendChild(link);
|
|
10292
|
+
return () => {
|
|
10293
|
+
link.remove();
|
|
10294
|
+
};
|
|
10295
|
+
}, [isNear, videoUrl, resolvedOrigin]);
|
|
10296
|
+
return { ref, isNear };
|
|
10297
|
+
}
|
|
10298
|
+
|
|
10219
10299
|
// src/components/features/video.tsx
|
|
10220
10300
|
import { jsx as jsx75, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
10301
|
+
function videoPerfDebugEnabled() {
|
|
10302
|
+
if (process.env.NODE_ENV !== "production") return true;
|
|
10303
|
+
try {
|
|
10304
|
+
return typeof localStorage !== "undefined" && localStorage.getItem("VIDEO_PERF_DEBUG") !== null;
|
|
10305
|
+
} catch {
|
|
10306
|
+
return false;
|
|
10307
|
+
}
|
|
10308
|
+
}
|
|
10221
10309
|
if (typeof window !== "undefined") {
|
|
10222
10310
|
const w = window;
|
|
10223
10311
|
if (!w.chrome?.cast) {
|
|
@@ -10309,7 +10397,15 @@ function Video2(props) {
|
|
|
10309
10397
|
className: props.className,
|
|
10310
10398
|
minimalControls: props.minimalControls
|
|
10311
10399
|
}
|
|
10312
|
-
) : "firstFrameOnly" in props && props.firstFrameOnly ? /* @__PURE__ */ jsx75(
|
|
10400
|
+
) : "firstFrameOnly" in props && props.firstFrameOnly ? /* @__PURE__ */ jsx75(
|
|
10401
|
+
FirstFramePreview,
|
|
10402
|
+
{
|
|
10403
|
+
url,
|
|
10404
|
+
poster: props.poster,
|
|
10405
|
+
fit: "fit" in props ? props.fit : void 0,
|
|
10406
|
+
className: props.className
|
|
10407
|
+
}
|
|
10408
|
+
) : /* @__PURE__ */ jsx75(
|
|
10313
10409
|
FilePlayer,
|
|
10314
10410
|
{
|
|
10315
10411
|
url,
|
|
@@ -10322,6 +10418,8 @@ function Video2(props) {
|
|
|
10322
10418
|
chromeless: "chromeless" in props ? props.chromeless : void 0,
|
|
10323
10419
|
playOnHover: "playOnHover" in props ? props.playOnHover : void 0,
|
|
10324
10420
|
playWhenHovered: "playWhenHovered" in props ? props.playWhenHovered : void 0,
|
|
10421
|
+
preload: "preload" in props ? props.preload : void 0,
|
|
10422
|
+
fit: "fit" in props ? props.fit : void 0,
|
|
10325
10423
|
className: props.className
|
|
10326
10424
|
}
|
|
10327
10425
|
);
|
|
@@ -10346,7 +10444,12 @@ function wrapWithLayout(inner, layout) {
|
|
|
10346
10444
|
return inner;
|
|
10347
10445
|
}
|
|
10348
10446
|
}
|
|
10349
|
-
function FirstFramePreview({
|
|
10447
|
+
function FirstFramePreview({
|
|
10448
|
+
url,
|
|
10449
|
+
poster,
|
|
10450
|
+
fit,
|
|
10451
|
+
className
|
|
10452
|
+
}) {
|
|
10350
10453
|
return /* @__PURE__ */ jsx75(
|
|
10351
10454
|
"div",
|
|
10352
10455
|
{
|
|
@@ -10357,7 +10460,8 @@ function FirstFramePreview({ url, className }) {
|
|
|
10357
10460
|
FilePlayer,
|
|
10358
10461
|
{
|
|
10359
10462
|
url: `${url}#t=0.1`,
|
|
10360
|
-
|
|
10463
|
+
poster,
|
|
10464
|
+
fit,
|
|
10361
10465
|
muted: true,
|
|
10362
10466
|
chromeless: true,
|
|
10363
10467
|
className
|
|
@@ -10378,10 +10482,23 @@ function FilePlayer({
|
|
|
10378
10482
|
playOnHover,
|
|
10379
10483
|
playWhenHovered,
|
|
10380
10484
|
preload,
|
|
10485
|
+
fit,
|
|
10381
10486
|
className
|
|
10382
10487
|
}) {
|
|
10488
|
+
const effectivePreload = preload ?? (saveDataEnabled() ? "none" : "metadata");
|
|
10383
10489
|
const [hoverMutedFallback, setHoverMutedFallback] = useState23(false);
|
|
10384
10490
|
const hoverPlayerRef = useRef13(null);
|
|
10491
|
+
const perfListenerRef = useRef13(null);
|
|
10492
|
+
const clearPerfListener = useCallback13(() => {
|
|
10493
|
+
if (perfListenerRef.current) {
|
|
10494
|
+
try {
|
|
10495
|
+
hoverPlayerRef.current?.removeEventListener?.("playing", perfListenerRef.current);
|
|
10496
|
+
} catch {
|
|
10497
|
+
}
|
|
10498
|
+
perfListenerRef.current = null;
|
|
10499
|
+
}
|
|
10500
|
+
}, []);
|
|
10501
|
+
useEffect18(() => clearPerfListener, [clearPerfListener]);
|
|
10385
10502
|
const hoverActiveRef = useRef13(false);
|
|
10386
10503
|
const hoverGenerationRef = useRef13(0);
|
|
10387
10504
|
const activationWaiterRef = useRef13(null);
|
|
@@ -10391,12 +10508,25 @@ function FilePlayer({
|
|
|
10391
10508
|
activationWaiterRef.current = null;
|
|
10392
10509
|
}
|
|
10393
10510
|
}, []);
|
|
10394
|
-
|
|
10511
|
+
useEffect18(() => clearActivationWaiter, [clearActivationWaiter]);
|
|
10395
10512
|
const startHoverPlayback = useCallback13(() => {
|
|
10396
10513
|
hoverActiveRef.current = true;
|
|
10397
10514
|
const generation = ++hoverGenerationRef.current;
|
|
10398
10515
|
const el = hoverPlayerRef.current;
|
|
10399
10516
|
if (!el) return;
|
|
10517
|
+
if (videoPerfDebugEnabled()) {
|
|
10518
|
+
clearPerfListener();
|
|
10519
|
+
const startedAt = performance.now();
|
|
10520
|
+
const onPlaying = () => {
|
|
10521
|
+
clearPerfListener();
|
|
10522
|
+
console.debug("[Video] hover\u2192playing %dms", Math.round(performance.now() - startedAt));
|
|
10523
|
+
};
|
|
10524
|
+
perfListenerRef.current = onPlaying;
|
|
10525
|
+
try {
|
|
10526
|
+
el.addEventListener?.("playing", onPlaying);
|
|
10527
|
+
} catch {
|
|
10528
|
+
}
|
|
10529
|
+
}
|
|
10400
10530
|
try {
|
|
10401
10531
|
el.volume = 0.5;
|
|
10402
10532
|
if (userHasInteracted) {
|
|
@@ -10435,16 +10565,17 @@ function FilePlayer({
|
|
|
10435
10565
|
}
|
|
10436
10566
|
} catch {
|
|
10437
10567
|
}
|
|
10438
|
-
}, []);
|
|
10568
|
+
}, [clearActivationWaiter, clearPerfListener]);
|
|
10439
10569
|
const stopHoverPlayback = useCallback13(() => {
|
|
10440
10570
|
hoverActiveRef.current = false;
|
|
10441
10571
|
setHoverMutedFallback(false);
|
|
10442
10572
|
clearActivationWaiter();
|
|
10573
|
+
clearPerfListener();
|
|
10443
10574
|
try {
|
|
10444
10575
|
hoverPlayerRef.current?.pause?.();
|
|
10445
10576
|
} catch {
|
|
10446
10577
|
}
|
|
10447
|
-
}, [clearActivationWaiter]);
|
|
10578
|
+
}, [clearActivationWaiter, clearPerfListener]);
|
|
10448
10579
|
const unmuteNow = useCallback13((e) => {
|
|
10449
10580
|
e.stopPropagation();
|
|
10450
10581
|
e.preventDefault();
|
|
@@ -10461,7 +10592,7 @@ function FilePlayer({
|
|
|
10461
10592
|
setHoverMutedFallback(false);
|
|
10462
10593
|
}, []);
|
|
10463
10594
|
const hoverControlled = typeof playWhenHovered === "boolean";
|
|
10464
|
-
|
|
10595
|
+
useEffect18(() => {
|
|
10465
10596
|
if (!hoverControlled) return;
|
|
10466
10597
|
if (playWhenHovered) startHoverPlayback();
|
|
10467
10598
|
else stopHoverPlayback();
|
|
@@ -10480,7 +10611,7 @@ function FilePlayer({
|
|
|
10480
10611
|
src: url,
|
|
10481
10612
|
poster: poster || void 0,
|
|
10482
10613
|
streamType: "on-demand",
|
|
10483
|
-
preload,
|
|
10614
|
+
preload: effectivePreload,
|
|
10484
10615
|
playsInline: true,
|
|
10485
10616
|
muted,
|
|
10486
10617
|
preferCmcd: "header",
|
|
@@ -10491,7 +10622,8 @@ function FilePlayer({
|
|
|
10491
10622
|
style: {
|
|
10492
10623
|
width: "100%",
|
|
10493
10624
|
height: "100%",
|
|
10494
|
-
...chromeless ? { "--controls": "none" } : {}
|
|
10625
|
+
...chromeless ? { "--controls": "none" } : {},
|
|
10626
|
+
...fit === "cover" ? { "--media-object-fit": "cover" } : {}
|
|
10495
10627
|
},
|
|
10496
10628
|
children: captionsUrl ? /* @__PURE__ */ jsx75(
|
|
10497
10629
|
"track",
|
|
@@ -10584,14 +10716,14 @@ function YouTubeFacadeInner({
|
|
|
10584
10716
|
return `${YT_NOCOOKIE_ORIGIN}/embed/${videoId}?${params.toString()}`;
|
|
10585
10717
|
}, [videoId, minimalControls]);
|
|
10586
10718
|
const [posterTier, setPosterTier] = useState23(0);
|
|
10587
|
-
|
|
10719
|
+
useEffect18(() => {
|
|
10588
10720
|
setPosterTier(0);
|
|
10589
10721
|
}, [videoId]);
|
|
10590
10722
|
const posterQuality = YT_POSTER_TIERS[posterTier];
|
|
10591
10723
|
const posterJpg = `https://i.ytimg.com/vi/${videoId}/${posterQuality}.jpg`;
|
|
10592
10724
|
const posterWebp = `https://i.ytimg.com/vi_webp/${videoId}/${posterQuality}.webp`;
|
|
10593
10725
|
const handlePosterError = () => setPosterTier((tier) => Math.min(tier + 1, YT_POSTER_TIERS.length - 1));
|
|
10594
|
-
|
|
10726
|
+
useEffect18(() => {
|
|
10595
10727
|
if (!activated) return;
|
|
10596
10728
|
const iframe = iframeRef.current;
|
|
10597
10729
|
if (!iframe) return;
|
|
@@ -10684,69 +10816,6 @@ function YouTubeFacadeInner({
|
|
|
10684
10816
|
init_cn();
|
|
10685
10817
|
import { useMemo as useMemo14, useRef as useRef15, useState as useState25, useEffect as useEffect20 } from "react";
|
|
10686
10818
|
|
|
10687
|
-
// src/components/features/use-video-warmup.ts
|
|
10688
|
-
import { useEffect as useEffect18 } from "react";
|
|
10689
|
-
import ReactDOM from "react-dom";
|
|
10690
|
-
|
|
10691
|
-
// src/components/features/mux-origins.ts
|
|
10692
|
-
var MUX_STREAM_ORIGIN = "https://stream.mux.com";
|
|
10693
|
-
var MUX_IMAGE_ORIGIN = "https://image.mux.com";
|
|
10694
|
-
|
|
10695
|
-
// src/components/features/use-video-warmup.ts
|
|
10696
|
-
function useVideoOriginPreconnect({
|
|
10697
|
-
supabaseStorageOrigin
|
|
10698
|
-
} = {}) {
|
|
10699
|
-
const runtime = useChatRuntime();
|
|
10700
|
-
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10701
|
-
try {
|
|
10702
|
-
ReactDOM.preconnect(MUX_STREAM_ORIGIN, { crossOrigin: "anonymous" });
|
|
10703
|
-
ReactDOM.preconnect(MUX_IMAGE_ORIGIN, { crossOrigin: "anonymous" });
|
|
10704
|
-
if (resolvedOrigin) {
|
|
10705
|
-
ReactDOM.preconnect(resolvedOrigin, { crossOrigin: "anonymous" });
|
|
10706
|
-
}
|
|
10707
|
-
} catch (err) {
|
|
10708
|
-
if (process.env.NODE_ENV !== "production") {
|
|
10709
|
-
console.warn("[useVideoOriginPreconnect] preconnect failed:", err);
|
|
10710
|
-
}
|
|
10711
|
-
}
|
|
10712
|
-
}
|
|
10713
|
-
function useVideoWarmup({
|
|
10714
|
-
videoUrl,
|
|
10715
|
-
supabaseStorageOrigin,
|
|
10716
|
-
nearMargin = "1000px"
|
|
10717
|
-
} = {}) {
|
|
10718
|
-
const runtime = useChatRuntime();
|
|
10719
|
-
const resolvedOrigin = supabaseStorageOrigin ?? runtime?.endpoints.supabaseStorageOrigin;
|
|
10720
|
-
useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
|
|
10721
|
-
const { ref, isNear } = useNearViewport(nearMargin);
|
|
10722
|
-
useEffect18(() => {
|
|
10723
|
-
if (!isNear || !videoUrl || !resolvedOrigin) return;
|
|
10724
|
-
const conn = navigator.connection;
|
|
10725
|
-
if (conn?.saveData === true) return;
|
|
10726
|
-
let videoOrigin;
|
|
10727
|
-
try {
|
|
10728
|
-
videoOrigin = new URL(videoUrl, "http://placeholder.local").origin;
|
|
10729
|
-
} catch {
|
|
10730
|
-
return;
|
|
10731
|
-
}
|
|
10732
|
-
if (videoOrigin !== resolvedOrigin) return;
|
|
10733
|
-
const link = document.createElement("link");
|
|
10734
|
-
link.rel = "preload";
|
|
10735
|
-
link.as = "video";
|
|
10736
|
-
link.href = videoUrl;
|
|
10737
|
-
link.crossOrigin = "anonymous";
|
|
10738
|
-
if ("fetchPriority" in link) {
|
|
10739
|
-
;
|
|
10740
|
-
link.fetchPriority = "low";
|
|
10741
|
-
}
|
|
10742
|
-
document.head.appendChild(link);
|
|
10743
|
-
return () => {
|
|
10744
|
-
link.remove();
|
|
10745
|
-
};
|
|
10746
|
-
}, [isNear, videoUrl, resolvedOrigin]);
|
|
10747
|
-
return { ref, isNear };
|
|
10748
|
-
}
|
|
10749
|
-
|
|
10750
10819
|
// src/components/features/video-ratio-tabs.tsx
|
|
10751
10820
|
import { Fragment as Fragment17, jsx as jsx76, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
10752
10821
|
var TAB_TRIGGER_CLASS = "rounded-none border-b-2 border-transparent data-[state=active]:border-ods-accent data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 py-2 text-h6 text-ods-text-secondary data-[state=active]:text-ods-text-primary";
|
|
@@ -10843,8 +10912,8 @@ function sortBitesByCreatedAtDesc(a, b) {
|
|
|
10843
10912
|
|
|
10844
10913
|
// src/components/features/cards-strip.tsx
|
|
10845
10914
|
init_cn();
|
|
10846
|
-
init_button2();
|
|
10847
10915
|
import React35, { useCallback as useCallback14, useEffect as useEffect19, useMemo as useMemo13, useRef as useRef14, useState as useState24 } from "react";
|
|
10916
|
+
init_button2();
|
|
10848
10917
|
|
|
10849
10918
|
// src/components/layout/page-heading.tsx
|
|
10850
10919
|
import { Fragment as Fragment18, jsx as jsx77, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
@@ -11086,7 +11155,7 @@ function CardsStrip(props) {
|
|
|
11086
11155
|
}
|
|
11087
11156
|
return next;
|
|
11088
11157
|
});
|
|
11089
|
-
}, { rootMargin:
|
|
11158
|
+
}, { rootMargin: NEAR_VIEWPORT_ROOT_MARGIN });
|
|
11090
11159
|
cardObserverRef.current = io;
|
|
11091
11160
|
cardElIdxRef.current.forEach((_idx, el) => io.observe(el));
|
|
11092
11161
|
return () => {
|
|
@@ -11392,6 +11461,7 @@ function VideoBiteCard({
|
|
|
11392
11461
|
const targetHref = bite.href ?? sectionHref;
|
|
11393
11462
|
const hasTarget = !!(targetHref || bite.onNavigate || onBiteNavigate);
|
|
11394
11463
|
const key = cardKey ?? `${bite.url}__${index}`;
|
|
11464
|
+
const previewUrl = toMuxPreviewUrl(bite.url);
|
|
11395
11465
|
const controlled = active !== void 0;
|
|
11396
11466
|
const [selfActive, setSelfActive] = useState25(false);
|
|
11397
11467
|
const isActive = controlled ? !!active : selfActive;
|
|
@@ -11406,7 +11476,7 @@ function VideoBiteCard({
|
|
|
11406
11476
|
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
11407
11477
|
const io = new IntersectionObserver(
|
|
11408
11478
|
(entries) => setIsNear(entries[0]?.isIntersecting ?? false),
|
|
11409
|
-
{ rootMargin:
|
|
11479
|
+
{ rootMargin: NEAR_VIEWPORT_ROOT_MARGIN }
|
|
11410
11480
|
);
|
|
11411
11481
|
io.observe(el);
|
|
11412
11482
|
return () => io.disconnect();
|
|
@@ -11510,7 +11580,7 @@ function VideoBiteCard({
|
|
|
11510
11580
|
onError: onPosterError,
|
|
11511
11581
|
className: "object-cover"
|
|
11512
11582
|
}
|
|
11513
|
-
) : /* @__PURE__ */ jsx80(Video2, { kind: "file", url:
|
|
11583
|
+
) : /* @__PURE__ */ jsx80(Video2, { kind: "file", url: previewUrl, firstFrameOnly: true, layout: "fill" }),
|
|
11514
11584
|
!isActive && /* @__PURE__ */ jsx80(VideoPlayBadge, { className: "absolute inset-0 z-10 m-auto" }),
|
|
11515
11585
|
showPlayer && // `--media-background-color: transparent` (inherited into
|
|
11516
11586
|
// media-chrome) — the freshly-mounted player must not blank the
|
|
@@ -11524,7 +11594,7 @@ function VideoBiteCard({
|
|
|
11524
11594
|
Video2,
|
|
11525
11595
|
{
|
|
11526
11596
|
kind: "file",
|
|
11527
|
-
url:
|
|
11597
|
+
url: previewUrl,
|
|
11528
11598
|
poster: bite.thumbnail_url,
|
|
11529
11599
|
playWhenHovered: isActive,
|
|
11530
11600
|
chromeless: true,
|
|
@@ -13277,7 +13347,7 @@ function RoadmapVoteButton({
|
|
|
13277
13347
|
init_button();
|
|
13278
13348
|
|
|
13279
13349
|
// src/components/ui/image-gallery-modal.tsx
|
|
13280
|
-
import { useState as useState103, useEffect as
|
|
13350
|
+
import { useState as useState103, useEffect as useEffect76 } from "react";
|
|
13281
13351
|
|
|
13282
13352
|
// src/components/ui/allowed-domains-input.tsx
|
|
13283
13353
|
init_cn();
|
|
@@ -21224,6 +21294,19 @@ var RichMarkdownInner = ({
|
|
|
21224
21294
|
}
|
|
21225
21295
|
return /* @__PURE__ */ jsx147(MarkdownImage, { src: src.trim(), alt });
|
|
21226
21296
|
},
|
|
21297
|
+
// Raw <video> tags in stored content (e.g. the hub's blog publisher
|
|
21298
|
+
// injects `<video src class="w-full my-8 rounded-lg" controls>` via
|
|
21299
|
+
// injectVideoInBlogContent) pass through rehypeRaw — route them to the
|
|
21300
|
+
// <Video> SSOT (MuxPlayer) instead of a native element so Mux HLS
|
|
21301
|
+
// manifests play on every browser and playback UX is unified. The
|
|
21302
|
+
// incoming className is forwarded so existing embeds keep their
|
|
21303
|
+
// width/margin/rounding.
|
|
21304
|
+
video: ({ src, poster, className: className2 }) => {
|
|
21305
|
+
if (!src || typeof src !== "string" || src.trim() === "") {
|
|
21306
|
+
return null;
|
|
21307
|
+
}
|
|
21308
|
+
return /* @__PURE__ */ jsx147("div", { className: `overflow-hidden ${className2 || "w-full my-8 rounded-lg"}`, children: /* @__PURE__ */ jsx147("div", { className: "w-full aspect-video", children: /* @__PURE__ */ jsx147(Video2, { kind: "file", url: src.trim(), poster: typeof poster === "string" ? poster : void 0 }) }) });
|
|
21309
|
+
},
|
|
21227
21310
|
// Style lists
|
|
21228
21311
|
ul: ({ children }) => /* @__PURE__ */ jsx147("ul", { className: `list-disc list-outside my-4 ml-8 space-y-2 ${isDarkMode ? "text-ods-text-primary" : "text-[#374151]"}`, children }),
|
|
21229
21312
|
ol: ({ children }) => /* @__PURE__ */ jsx147("ol", { className: `list-decimal list-outside my-4 ml-8 space-y-2 ${isDarkMode ? "text-ods-text-primary" : "text-[#374151]"}`, children }),
|
|
@@ -28599,7 +28682,7 @@ import { useState as useState64, useRef as useRef34, useCallback as useCallback2
|
|
|
28599
28682
|
import {
|
|
28600
28683
|
Upload,
|
|
28601
28684
|
Image as ImageIcon2,
|
|
28602
|
-
Video as
|
|
28685
|
+
Video as VideoIcon,
|
|
28603
28686
|
Trash2 as Trash23,
|
|
28604
28687
|
Loader2 as Loader23,
|
|
28605
28688
|
GripVertical,
|
|
@@ -28691,14 +28774,10 @@ function MediaGalleryManager({
|
|
|
28691
28774
|
children: isDeleting ? /* @__PURE__ */ jsx219(Loader23, { className: "h-4 w-4 animate-spin text-ods-text-on-dark" }) : /* @__PURE__ */ jsx219(Trash23, { className: "h-4 w-4 text-ods-text-on-dark" })
|
|
28692
28775
|
}
|
|
28693
28776
|
) }),
|
|
28694
|
-
/* @__PURE__ */ jsx219("div", { className: "aspect-video relative bg-ods-bg rounded-lg overflow-hidden", children: mediaItem.media_type === "video" || mediaItem.media_type === "demo" ?
|
|
28695
|
-
|
|
28696
|
-
|
|
28697
|
-
|
|
28698
|
-
className: "w-full h-full object-cover",
|
|
28699
|
-
controls: true,
|
|
28700
|
-
preload: "metadata"
|
|
28701
|
-
}
|
|
28777
|
+
/* @__PURE__ */ jsx219("div", { className: "aspect-video relative bg-ods-bg rounded-lg overflow-hidden", children: mediaItem.media_type === "video" || mediaItem.media_type === "demo" ? (
|
|
28778
|
+
// <Video> SSOT (MuxPlayer) — plays Mux HLS + MP4 alike;
|
|
28779
|
+
// fit="cover" crops to the aspect-video cell.
|
|
28780
|
+
/* @__PURE__ */ jsx219(Video2, { kind: "file", url: mediaItem.media_url, fit: "cover", className: "w-full h-full" })
|
|
28702
28781
|
) : /* @__PURE__ */ jsx219(
|
|
28703
28782
|
next_image_default,
|
|
28704
28783
|
{
|
|
@@ -28711,7 +28790,7 @@ function MediaGalleryManager({
|
|
|
28711
28790
|
) }),
|
|
28712
28791
|
/* @__PURE__ */ jsxs170("div", { className: "p-3", children: [
|
|
28713
28792
|
/* @__PURE__ */ jsxs170("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
28714
|
-
mediaItem.media_type === "video" || mediaItem.media_type === "demo" ? /* @__PURE__ */ jsx219(
|
|
28793
|
+
mediaItem.media_type === "video" || mediaItem.media_type === "demo" ? /* @__PURE__ */ jsx219(VideoIcon, { className: "h-4 w-4 text-ods-text-secondary" }) : /* @__PURE__ */ jsx219(ImageIcon2, { className: "h-4 w-4 text-ods-text-secondary" }),
|
|
28715
28794
|
/* @__PURE__ */ jsx219("span", { className: "text-h6 text-ods-text-primary capitalize", children: mediaItem.media_type })
|
|
28716
28795
|
] }),
|
|
28717
28796
|
mediaItem.title && /* @__PURE__ */ jsx219("p", { className: "text-h6 text-ods-text-secondary truncate", children: mediaItem.title })
|
|
@@ -29387,7 +29466,7 @@ function PushButtonSelector({
|
|
|
29387
29466
|
|
|
29388
29467
|
// src/components/features/release-media-manager.tsx
|
|
29389
29468
|
import { useState as useState66, useRef as useRef36 } from "react";
|
|
29390
|
-
import { Trash2 as Trash24, Plus as Plus5, Image as ImageIcon3, Video as
|
|
29469
|
+
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";
|
|
29391
29470
|
import { jsx as jsx226, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
29392
29471
|
function ReleaseMediaManager({
|
|
29393
29472
|
media,
|
|
@@ -29460,7 +29539,7 @@ function ReleaseMediaManager({
|
|
|
29460
29539
|
switch (type) {
|
|
29461
29540
|
case "video":
|
|
29462
29541
|
case "demo":
|
|
29463
|
-
return /* @__PURE__ */ jsx226(
|
|
29542
|
+
return /* @__PURE__ */ jsx226(VideoIcon2, { className: "w-5 h-5 text-ods-text-secondary" });
|
|
29464
29543
|
default:
|
|
29465
29544
|
return /* @__PURE__ */ jsx226(ImageIcon3, { className: "w-5 h-5 text-ods-text-secondary" });
|
|
29466
29545
|
}
|
|
@@ -29528,14 +29607,10 @@ function ReleaseMediaManager({
|
|
|
29528
29607
|
children: /* @__PURE__ */ jsx226(Trash24, { className: "h-4 w-4 text-ods-text-on-dark" })
|
|
29529
29608
|
}
|
|
29530
29609
|
) }),
|
|
29531
|
-
item.media_url && /* @__PURE__ */ jsx226("div", { className: "aspect-video relative bg-ods-bg", children: item.media_type === "video" || item.media_type === "demo" ?
|
|
29532
|
-
|
|
29533
|
-
|
|
29534
|
-
|
|
29535
|
-
className: "w-full h-full object-cover",
|
|
29536
|
-
controls: true,
|
|
29537
|
-
preload: "metadata"
|
|
29538
|
-
}
|
|
29610
|
+
item.media_url && /* @__PURE__ */ jsx226("div", { className: "aspect-video relative bg-ods-bg", children: item.media_type === "video" || item.media_type === "demo" ? (
|
|
29611
|
+
// <Video> SSOT (MuxPlayer) — plays Mux HLS + MP4 alike;
|
|
29612
|
+
// fit="cover" crops to the aspect-video cell.
|
|
29613
|
+
/* @__PURE__ */ jsx226(Video2, { kind: "file", url: item.media_url, fit: "cover", className: "w-full h-full" })
|
|
29539
29614
|
) : /* @__PURE__ */ jsx226(
|
|
29540
29615
|
next_image_default,
|
|
29541
29616
|
{
|
|
@@ -30409,8 +30484,8 @@ function getCaptionsUrl(entityType, entityId, srtContent) {
|
|
|
30409
30484
|
}
|
|
30410
30485
|
|
|
30411
30486
|
// src/components/features/video-source-selector.tsx
|
|
30412
|
-
import { useState as useState69, useCallback as useCallback27
|
|
30413
|
-
import { Upload as Upload4, X as X8, Video as
|
|
30487
|
+
import { useState as useState69, useCallback as useCallback27 } from "react";
|
|
30488
|
+
import { Upload as Upload4, X as X8, Video as VideoIcon3 } from "lucide-react";
|
|
30414
30489
|
init_button2();
|
|
30415
30490
|
import { jsx as jsx235, jsxs as jsxs183 } from "react/jsx-runtime";
|
|
30416
30491
|
function VideoSourceSelector({
|
|
@@ -30430,7 +30505,6 @@ function VideoSourceSelector({
|
|
|
30430
30505
|
uploadEmptyText = 'No video uploaded yet. Click "Upload Video" to add one.',
|
|
30431
30506
|
disabled = false,
|
|
30432
30507
|
VideoPreviewComponent,
|
|
30433
|
-
resolveVideoUrl,
|
|
30434
30508
|
UploadProgressComponent,
|
|
30435
30509
|
title = "Video",
|
|
30436
30510
|
showTitle = true,
|
|
@@ -30476,7 +30550,7 @@ function VideoSourceSelector({
|
|
|
30476
30550
|
}, [onMainVideoUrlChange]);
|
|
30477
30551
|
return /* @__PURE__ */ jsxs183("div", { className: `space-y-4 p-6 bg-ods-card border border-ods-border rounded-lg ${className}`, children: [
|
|
30478
30552
|
showTitle && /* @__PURE__ */ jsxs183("h3", { className: "text-h5 text-ods-text-primary flex items-center gap-2", children: [
|
|
30479
|
-
/* @__PURE__ */ jsx235(
|
|
30553
|
+
/* @__PURE__ */ jsx235(VideoIcon3, { className: "h-5 w-5" }),
|
|
30480
30554
|
title
|
|
30481
30555
|
] }),
|
|
30482
30556
|
/* @__PURE__ */ jsxs183("div", { className: "flex gap-2", children: [
|
|
@@ -30568,50 +30642,20 @@ function VideoSourceSelector({
|
|
|
30568
30642
|
onDelete: handleDeleteVideo,
|
|
30569
30643
|
isAIGenerated
|
|
30570
30644
|
}
|
|
30571
|
-
) : (
|
|
30572
|
-
|
|
30573
|
-
|
|
30574
|
-
|
|
30575
|
-
|
|
30576
|
-
|
|
30577
|
-
|
|
30578
|
-
onDelete: handleDeleteVideo,
|
|
30579
|
-
disabled
|
|
30580
|
-
}
|
|
30581
|
-
)
|
|
30645
|
+
) : /* @__PURE__ */ jsx235(
|
|
30646
|
+
DefaultVideoPreview,
|
|
30647
|
+
{
|
|
30648
|
+
videoUrl: mainVideoUrl,
|
|
30649
|
+
onDelete: handleDeleteVideo,
|
|
30650
|
+
disabled
|
|
30651
|
+
}
|
|
30582
30652
|
) : /* @__PURE__ */ jsx235("p", { className: "text-h6 text-ods-text-secondary italic", children: uploadEmptyText })
|
|
30583
30653
|
] })
|
|
30584
30654
|
] });
|
|
30585
30655
|
}
|
|
30586
|
-
function DefaultVideoPreview({ videoUrl,
|
|
30587
|
-
const [resolvedUrl, setResolvedUrl] = useState69(
|
|
30588
|
-
resolveVideoUrl ? void 0 : videoUrl
|
|
30589
|
-
);
|
|
30590
|
-
useEffect51(() => {
|
|
30591
|
-
if (!resolveVideoUrl) {
|
|
30592
|
-
setResolvedUrl(videoUrl);
|
|
30593
|
-
return;
|
|
30594
|
-
}
|
|
30595
|
-
let active = true;
|
|
30596
|
-
setResolvedUrl(void 0);
|
|
30597
|
-
resolveVideoUrl(videoUrl).then((url) => {
|
|
30598
|
-
if (active) setResolvedUrl(url);
|
|
30599
|
-
}).catch(() => {
|
|
30600
|
-
if (active) setResolvedUrl(videoUrl);
|
|
30601
|
-
});
|
|
30602
|
-
return () => {
|
|
30603
|
-
active = false;
|
|
30604
|
-
};
|
|
30605
|
-
}, [videoUrl, resolveVideoUrl]);
|
|
30656
|
+
function DefaultVideoPreview({ videoUrl, onDelete, disabled }) {
|
|
30606
30657
|
return /* @__PURE__ */ jsxs183("div", { className: "relative rounded-lg border border-ods-border overflow-hidden", children: [
|
|
30607
|
-
|
|
30608
|
-
"video",
|
|
30609
|
-
{
|
|
30610
|
-
src: resolvedUrl,
|
|
30611
|
-
className: "w-full h-auto max-h-[300px] object-contain bg-black",
|
|
30612
|
-
controls: true
|
|
30613
|
-
}
|
|
30614
|
-
),
|
|
30658
|
+
/* @__PURE__ */ jsx235("div", { className: "w-full aspect-video max-h-[300px]", children: /* @__PURE__ */ jsx235(Video2, { kind: "file", url: videoUrl }) }),
|
|
30615
30659
|
/* @__PURE__ */ jsx235(
|
|
30616
30660
|
"button",
|
|
30617
30661
|
{
|
|
@@ -30810,7 +30854,7 @@ function TranscriptSummaryEditor({
|
|
|
30810
30854
|
|
|
30811
30855
|
// src/components/features/highlight-video-section.tsx
|
|
30812
30856
|
import { useState as useState70 } from "react";
|
|
30813
|
-
import { Sparkles as
|
|
30857
|
+
import { Sparkles as Sparkles4, Upload as Upload5 } from "lucide-react";
|
|
30814
30858
|
init_button2();
|
|
30815
30859
|
|
|
30816
30860
|
// src/components/features/ai-enrich/AIEnrichSection.tsx
|
|
@@ -30911,7 +30955,7 @@ var AIWarningsSection = ({
|
|
|
30911
30955
|
|
|
30912
30956
|
// src/components/features/ai-enrich/AIEnrichSection.tsx
|
|
30913
30957
|
init_button2();
|
|
30914
|
-
import { CheckCircle as CheckCircle2, AlertCircle, Loader2 as
|
|
30958
|
+
import { CheckCircle as CheckCircle2, AlertCircle, Loader2 as Loader27, X as X9 } from "lucide-react";
|
|
30915
30959
|
import { jsx as jsx240, jsxs as jsxs187 } from "react/jsx-runtime";
|
|
30916
30960
|
var AIEnrichSection = ({
|
|
30917
30961
|
onEnrich,
|
|
@@ -31023,7 +31067,7 @@ var AIEnrichSection = ({
|
|
|
31023
31067
|
size: "small-legacy",
|
|
31024
31068
|
onClick: onCancel,
|
|
31025
31069
|
disabled: isCancelling,
|
|
31026
|
-
leftIcon: isCancelling ? /* @__PURE__ */ jsx240(
|
|
31070
|
+
leftIcon: isCancelling ? /* @__PURE__ */ jsx240(Loader27, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx240(X9, { className: "h-4 w-4" }),
|
|
31027
31071
|
className: "!w-full",
|
|
31028
31072
|
children: isCancelling ? "Cancelling..." : "Cancel Processing"
|
|
31029
31073
|
}
|
|
@@ -31044,7 +31088,7 @@ var AIEnrichSection = ({
|
|
|
31044
31088
|
)) })
|
|
31045
31089
|
] }),
|
|
31046
31090
|
loading && statusMessage && /* @__PURE__ */ jsxs187("div", { className: "flex items-center gap-3 p-3 rounded-lg bg-ods-bg-surface", children: [
|
|
31047
|
-
/* @__PURE__ */ jsx240(
|
|
31091
|
+
/* @__PURE__ */ jsx240(Loader27, { className: "h-5 w-5 text-ods-accent animate-spin" }),
|
|
31048
31092
|
/* @__PURE__ */ jsx240("span", { className: "text-h6 text-ods-text-primary", children: statusMessage })
|
|
31049
31093
|
] }),
|
|
31050
31094
|
hasResults && /* @__PURE__ */ jsxs187("div", { className: "space-y-4", children: [
|
|
@@ -31174,7 +31218,7 @@ function HighlightVideoSection({
|
|
|
31174
31218
|
{
|
|
31175
31219
|
title: "Highlight Video",
|
|
31176
31220
|
description: `Generate a ${Math.floor(targetDurationSeconds / 60)}-minute summary video using Claude AI + Shotstack`,
|
|
31177
|
-
icon: /* @__PURE__ */ jsx241(
|
|
31221
|
+
icon: /* @__PURE__ */ jsx241(Sparkles4, { className: "h-5 w-5" }),
|
|
31178
31222
|
buttonLabel: hasExistingHighlight ? "Regenerate Highlight" : "Generate Highlight",
|
|
31179
31223
|
loadingLabel: "Generating highlight...",
|
|
31180
31224
|
onEnrich: onGenerateHighlight,
|
|
@@ -31218,17 +31262,17 @@ function HighlightVideoSection({
|
|
|
31218
31262
|
onDelete: onDeleteHighlight
|
|
31219
31263
|
}
|
|
31220
31264
|
) : (
|
|
31221
|
-
// Default simple preview
|
|
31265
|
+
// Default simple preview — the <Video> SSOT (MuxPlayer) plays
|
|
31266
|
+
// MP4 and Mux HLS alike; aspect-video box reserves the height.
|
|
31222
31267
|
/* @__PURE__ */ jsxs188("div", { className: "relative rounded-lg border border-ods-border overflow-hidden bg-black", children: [
|
|
31223
|
-
/* @__PURE__ */ jsx241(
|
|
31224
|
-
|
|
31268
|
+
/* @__PURE__ */ jsx241("div", { className: "w-full aspect-video max-h-[300px]", children: /* @__PURE__ */ jsx241(
|
|
31269
|
+
Video2,
|
|
31225
31270
|
{
|
|
31226
|
-
|
|
31227
|
-
|
|
31228
|
-
|
|
31229
|
-
controls: true
|
|
31271
|
+
kind: "file",
|
|
31272
|
+
url: highlightVideoUrl,
|
|
31273
|
+
poster: highlightVideoThumbnail || void 0
|
|
31230
31274
|
}
|
|
31231
|
-
),
|
|
31275
|
+
) }),
|
|
31232
31276
|
onDeleteHighlight && /* @__PURE__ */ jsxs188(
|
|
31233
31277
|
"button",
|
|
31234
31278
|
{
|
|
@@ -31350,7 +31394,7 @@ function EntitySummaryEditor({
|
|
|
31350
31394
|
}
|
|
31351
31395
|
|
|
31352
31396
|
// src/components/features/transcribe-summarize-section.tsx
|
|
31353
|
-
import { Sparkles as
|
|
31397
|
+
import { Sparkles as Sparkles5 } from "lucide-react";
|
|
31354
31398
|
|
|
31355
31399
|
// src/components/features/ai-enrich/AIStatusIndicator.tsx
|
|
31356
31400
|
init_cn();
|
|
@@ -31482,7 +31526,7 @@ function TranscribeSummarizeSection({
|
|
|
31482
31526
|
{
|
|
31483
31527
|
title,
|
|
31484
31528
|
description,
|
|
31485
|
-
icon: /* @__PURE__ */ jsx246(
|
|
31529
|
+
icon: /* @__PURE__ */ jsx246(Sparkles5, { className: "h-5 w-5" }),
|
|
31486
31530
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31487
31531
|
loadingLabel,
|
|
31488
31532
|
onEnrich: onTranscribe,
|
|
@@ -31500,7 +31544,7 @@ function TranscribeSummarizeSection({
|
|
|
31500
31544
|
}
|
|
31501
31545
|
|
|
31502
31546
|
// src/components/features/video-clips-section.tsx
|
|
31503
|
-
import { Sparkles as
|
|
31547
|
+
import { Sparkles as Sparkles6 } from "lucide-react";
|
|
31504
31548
|
import { jsx as jsx247 } from "react/jsx-runtime";
|
|
31505
31549
|
function VideoClipsSection({
|
|
31506
31550
|
onExtractClips,
|
|
@@ -31525,7 +31569,7 @@ function VideoClipsSection({
|
|
|
31525
31569
|
{
|
|
31526
31570
|
title,
|
|
31527
31571
|
description,
|
|
31528
|
-
icon: /* @__PURE__ */ jsx247(
|
|
31572
|
+
icon: /* @__PURE__ */ jsx247(Sparkles6, { className: "h-5 w-5" }),
|
|
31529
31573
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31530
31574
|
loadingLabel,
|
|
31531
31575
|
onEnrich: onExtractClips,
|
|
@@ -31543,7 +31587,7 @@ function VideoClipsSection({
|
|
|
31543
31587
|
}
|
|
31544
31588
|
|
|
31545
31589
|
// src/components/features/highlight-generation-section.tsx
|
|
31546
|
-
import { Sparkles as
|
|
31590
|
+
import { Sparkles as Sparkles7 } from "lucide-react";
|
|
31547
31591
|
import { jsx as jsx248 } from "react/jsx-runtime";
|
|
31548
31592
|
function HighlightGenerationSection({
|
|
31549
31593
|
onGenerateHighlight,
|
|
@@ -31570,7 +31614,7 @@ function HighlightGenerationSection({
|
|
|
31570
31614
|
{
|
|
31571
31615
|
title,
|
|
31572
31616
|
description: description || defaultDescription,
|
|
31573
|
-
icon: /* @__PURE__ */ jsx248(
|
|
31617
|
+
icon: /* @__PURE__ */ jsx248(Sparkles7, { className: "h-5 w-5" }),
|
|
31574
31618
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31575
31619
|
loadingLabel,
|
|
31576
31620
|
onEnrich: onGenerateHighlight,
|
|
@@ -31652,7 +31696,7 @@ function HighlightVideoPreview({
|
|
|
31652
31696
|
}
|
|
31653
31697
|
|
|
31654
31698
|
// src/components/features/transcribe-and-summarize-combined-section.tsx
|
|
31655
|
-
import { Sparkles as
|
|
31699
|
+
import { Sparkles as Sparkles9 } from "lucide-react";
|
|
31656
31700
|
import { jsx as jsx250, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
31657
31701
|
function TranscribeAndSummarizeCombinedSection({
|
|
31658
31702
|
// AIEnrichSection props
|
|
@@ -31699,7 +31743,7 @@ function TranscribeAndSummarizeCombinedSection({
|
|
|
31699
31743
|
{
|
|
31700
31744
|
title,
|
|
31701
31745
|
description,
|
|
31702
|
-
icon: /* @__PURE__ */ jsx250(
|
|
31746
|
+
icon: /* @__PURE__ */ jsx250(Sparkles9, { className: "h-5 w-5" }),
|
|
31703
31747
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31704
31748
|
loadingLabel,
|
|
31705
31749
|
onEnrich: onTranscribe,
|
|
@@ -31740,7 +31784,7 @@ function TranscribeAndSummarizeCombinedSection({
|
|
|
31740
31784
|
}
|
|
31741
31785
|
|
|
31742
31786
|
// src/components/features/highlight-video-combined-section.tsx
|
|
31743
|
-
import { Sparkles as
|
|
31787
|
+
import { Sparkles as Sparkles10, Upload as Upload7 } from "lucide-react";
|
|
31744
31788
|
init_button2();
|
|
31745
31789
|
import { jsx as jsx251, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
31746
31790
|
function HighlightVideoCombinedSection({
|
|
@@ -31816,7 +31860,7 @@ function HighlightVideoCombinedSection({
|
|
|
31816
31860
|
{
|
|
31817
31861
|
title,
|
|
31818
31862
|
description: description || defaultDescription,
|
|
31819
|
-
icon: /* @__PURE__ */ jsx251(
|
|
31863
|
+
icon: /* @__PURE__ */ jsx251(Sparkles10, { className: "h-5 w-5" }),
|
|
31820
31864
|
buttonLabel: buttonLabel || defaultButtonLabel,
|
|
31821
31865
|
loadingLabel,
|
|
31822
31866
|
onEnrich: onGenerateHighlight,
|
|
@@ -31939,23 +31983,22 @@ function ViewToggle({
|
|
|
31939
31983
|
|
|
31940
31984
|
// src/components/features/policy-configuration-panel.tsx
|
|
31941
31985
|
init_cn();
|
|
31942
|
-
import {
|
|
31986
|
+
import { useEffect as useEffect51, useState as useState71 } from "react";
|
|
31943
31987
|
import { ChevronDown as ChevronDown8, Shield as Shield2 } from "lucide-react";
|
|
31944
31988
|
init_button2();
|
|
31945
31989
|
import { Fragment as Fragment43, jsx as jsx253, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
31946
|
-
var
|
|
31947
|
-
|
|
31948
|
-
|
|
31949
|
-
|
|
31950
|
-
|
|
31951
|
-
];
|
|
31952
|
-
var getApprovalLevelLabel = (level, editMode = false) => {
|
|
31953
|
-
if (!level) {
|
|
31954
|
-
return editMode ? "Set Global Permission" : "";
|
|
31955
|
-
}
|
|
31956
|
-
const option = approvalLevelOptions.find((opt) => opt.value === level);
|
|
31957
|
-
return option?.label || level;
|
|
31990
|
+
var approvalLevelLabels = {
|
|
31991
|
+
ALLOW: "Allow",
|
|
31992
|
+
ASK_USER: "Ask User",
|
|
31993
|
+
ASK_TECHNICIAN: "Ask Technician",
|
|
31994
|
+
DENY: "Restrict"
|
|
31958
31995
|
};
|
|
31996
|
+
var approvalLevelOptions = Object.keys(approvalLevelLabels).map(
|
|
31997
|
+
(value) => ({ value, label: approvalLevelLabels[value] })
|
|
31998
|
+
);
|
|
31999
|
+
var POLICY_LEVEL_WIDTH = "w-[180px]";
|
|
32000
|
+
var CATEGORY_LEVEL_WIDTH = "w-[256px]";
|
|
32001
|
+
var getApprovalLevelLabel = (level) => approvalLevelLabels[level] ?? level;
|
|
31959
32002
|
var ApprovalLevelDropdown = ({ value, onChange, allowClear = false, triggerClassName, contentClassName }) => /* @__PURE__ */ jsxs197(DropdownMenu, { children: [
|
|
31960
32003
|
/* @__PURE__ */ jsx253(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx253(
|
|
31961
32004
|
Button,
|
|
@@ -31967,7 +32010,7 @@ var ApprovalLevelDropdown = ({ value, onChange, allowClear = false, triggerClass
|
|
|
31967
32010
|
value ? "text-ods-text-primary" : "text-ods-text-secondary",
|
|
31968
32011
|
triggerClassName
|
|
31969
32012
|
),
|
|
31970
|
-
children: getApprovalLevelLabel(value
|
|
32013
|
+
children: value ? getApprovalLevelLabel(value) : "Set Global Permission"
|
|
31971
32014
|
}
|
|
31972
32015
|
) }),
|
|
31973
32016
|
/* @__PURE__ */ jsxs197(DropdownMenuContent, { align: "end", className: contentClassName, children: [
|
|
@@ -31998,7 +32041,7 @@ var PolicyRow = ({ policy, categoryId, editMode, onPermissionChange }) => {
|
|
|
31998
32041
|
value: policy.approvalLevel,
|
|
31999
32042
|
onChange: handleChange,
|
|
32000
32043
|
triggerClassName: "w-full",
|
|
32001
|
-
contentClassName:
|
|
32044
|
+
contentClassName: POLICY_LEVEL_WIDTH
|
|
32002
32045
|
}
|
|
32003
32046
|
) }) : policy.approvalLevel ? /* @__PURE__ */ jsx253("span", { className: "md:hidden text-h4 text-ods-text-primary", children: getApprovalLevelLabel(policy.approvalLevel) }) : null
|
|
32004
32047
|
] }),
|
|
@@ -32007,23 +32050,12 @@ var PolicyRow = ({ policy, categoryId, editMode, onPermissionChange }) => {
|
|
|
32007
32050
|
{
|
|
32008
32051
|
value: policy.approvalLevel,
|
|
32009
32052
|
onChange: handleChange,
|
|
32010
|
-
triggerClassName:
|
|
32011
|
-
contentClassName:
|
|
32053
|
+
triggerClassName: POLICY_LEVEL_WIDTH,
|
|
32054
|
+
contentClassName: POLICY_LEVEL_WIDTH
|
|
32012
32055
|
}
|
|
32013
|
-
) : /* @__PURE__ */ jsx253("div", { className: "px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)]
|
|
32056
|
+
) : /* @__PURE__ */ jsx253("div", { className: cn("px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)]", POLICY_LEVEL_WIDTH), children: policy.approvalLevel && /* @__PURE__ */ jsx253("span", { className: "text-h4 text-ods-text-primary", children: getApprovalLevelLabel(policy.approvalLevel) }) }) })
|
|
32014
32057
|
] });
|
|
32015
32058
|
};
|
|
32016
|
-
var useAnimatedHeight = (isExpanded) => {
|
|
32017
|
-
const [height, setHeight] = useState71(0);
|
|
32018
|
-
const contentRef = useRef37(null);
|
|
32019
|
-
useEffect52(() => {
|
|
32020
|
-
if (contentRef.current) {
|
|
32021
|
-
const contentHeight = contentRef.current.scrollHeight;
|
|
32022
|
-
setHeight(isExpanded ? contentHeight : 0);
|
|
32023
|
-
}
|
|
32024
|
-
}, [isExpanded]);
|
|
32025
|
-
return { contentRef, height };
|
|
32026
|
-
};
|
|
32027
32059
|
var CategorySection = ({
|
|
32028
32060
|
category,
|
|
32029
32061
|
editMode,
|
|
@@ -32033,7 +32065,7 @@ var CategorySection = ({
|
|
|
32033
32065
|
onBulkLevelChange,
|
|
32034
32066
|
onPolicyPermissionChange
|
|
32035
32067
|
}) => {
|
|
32036
|
-
const {
|
|
32068
|
+
const { innerRef, containerStyle } = useCollapsible({ expanded: isExpanded, durationMs: 300 });
|
|
32037
32069
|
const handleBulkChange = (level) => onBulkLevelChange(category.id, level);
|
|
32038
32070
|
return /* @__PURE__ */ jsxs197(Fragment43, { children: [
|
|
32039
32071
|
/* @__PURE__ */ jsxs197(
|
|
@@ -32056,7 +32088,7 @@ var CategorySection = ({
|
|
|
32056
32088
|
onChange: handleBulkChange,
|
|
32057
32089
|
allowClear: true,
|
|
32058
32090
|
triggerClassName: "w-full",
|
|
32059
|
-
contentClassName:
|
|
32091
|
+
contentClassName: CATEGORY_LEVEL_WIDTH
|
|
32060
32092
|
}
|
|
32061
32093
|
) })
|
|
32062
32094
|
] }),
|
|
@@ -32066,16 +32098,10 @@ var CategorySection = ({
|
|
|
32066
32098
|
value: bulkLevel,
|
|
32067
32099
|
onChange: handleBulkChange,
|
|
32068
32100
|
allowClear: true,
|
|
32069
|
-
triggerClassName:
|
|
32070
|
-
contentClassName:
|
|
32071
|
-
}
|
|
32072
|
-
) }) : /* @__PURE__ */ jsx253(
|
|
32073
|
-
"div",
|
|
32074
|
-
{
|
|
32075
|
-
className: "hidden md:block px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)] w-[256px] shrink-0",
|
|
32076
|
-
onClick: (e) => e.stopPropagation()
|
|
32101
|
+
triggerClassName: CATEGORY_LEVEL_WIDTH,
|
|
32102
|
+
contentClassName: CATEGORY_LEVEL_WIDTH
|
|
32077
32103
|
}
|
|
32078
|
-
),
|
|
32104
|
+
) }) : /* @__PURE__ */ jsx253("div", { className: cn("hidden md:block px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)] shrink-0", CATEGORY_LEVEL_WIDTH) }),
|
|
32079
32105
|
/* @__PURE__ */ jsx253(
|
|
32080
32106
|
Button,
|
|
32081
32107
|
{
|
|
@@ -32104,16 +32130,15 @@ var CategorySection = ({
|
|
|
32104
32130
|
/* @__PURE__ */ jsx253(
|
|
32105
32131
|
"div",
|
|
32106
32132
|
{
|
|
32107
|
-
ref: contentRef,
|
|
32108
32133
|
style: {
|
|
32109
|
-
|
|
32110
|
-
transition:
|
|
32134
|
+
...containerStyle,
|
|
32135
|
+
transition: `${containerStyle.transition}, opacity 300ms ease-in-out, visibility 300ms`,
|
|
32136
|
+
// visibility drops collapsed content from the tab order and a11y
|
|
32137
|
+
// tree; its discrete transition delays hiding until the fade ends.
|
|
32138
|
+
visibility: isExpanded ? "visible" : "hidden"
|
|
32111
32139
|
},
|
|
32112
|
-
className:
|
|
32113
|
-
|
|
32114
|
-
isExpanded ? "opacity-100" : "opacity-0"
|
|
32115
|
-
),
|
|
32116
|
-
children: /* @__PURE__ */ jsx253("div", { className: "px-[var(--spacing-system-mf)] pb-[var(--spacing-system-mf)] pt-0", children: /* @__PURE__ */ jsx253("div", { className: "border border-ods-border rounded-md overflow-hidden", children: category.policies.map((policy) => /* @__PURE__ */ jsx253(
|
|
32140
|
+
className: isExpanded ? "opacity-100" : "opacity-0",
|
|
32141
|
+
children: /* @__PURE__ */ jsx253("div", { ref: innerRef, className: "px-[var(--spacing-system-mf)] pb-[var(--spacing-system-mf)] pt-0", children: /* @__PURE__ */ jsx253("div", { className: "border border-ods-border rounded-md overflow-hidden", children: category.policies.map((policy) => /* @__PURE__ */ jsx253(
|
|
32117
32142
|
PolicyRow,
|
|
32118
32143
|
{
|
|
32119
32144
|
policy,
|
|
@@ -32136,7 +32161,7 @@ var PolicyConfigurationPanel = ({
|
|
|
32136
32161
|
}) => {
|
|
32137
32162
|
const [expandedIds, setExpandedIds] = useState71(/* @__PURE__ */ new Set());
|
|
32138
32163
|
const [bulkLevels, setBulkLevels] = useState71({});
|
|
32139
|
-
|
|
32164
|
+
useEffect51(() => {
|
|
32140
32165
|
setBulkLevels({});
|
|
32141
32166
|
}, [editMode]);
|
|
32142
32167
|
const handleToggle = (categoryId) => {
|
|
@@ -32176,7 +32201,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
|
|
|
32176
32201
|
init_button2();
|
|
32177
32202
|
|
|
32178
32203
|
// src/components/ui/phone-input.tsx
|
|
32179
|
-
import { useCallback as useCallback28, useEffect as
|
|
32204
|
+
import { useCallback as useCallback28, useEffect as useEffect52, useMemo as useMemo27, useRef as useRef37, useState as useState72 } from "react";
|
|
32180
32205
|
import { jsx as jsx254, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
32181
32206
|
function PhoneInput({
|
|
32182
32207
|
value,
|
|
@@ -32194,7 +32219,7 @@ function PhoneInput({
|
|
|
32194
32219
|
[countryCode, priority, others]
|
|
32195
32220
|
);
|
|
32196
32221
|
const [isInvalid, setIsInvalid] = useState72(false);
|
|
32197
|
-
const debounceRef =
|
|
32222
|
+
const debounceRef = useRef37(null);
|
|
32198
32223
|
const digitCount = useCallback28((val) => val.replace(/[^0-9]/g, "").length, []);
|
|
32199
32224
|
const runValidation = useCallback28((phone) => {
|
|
32200
32225
|
if (!phone || digitCount(phone) === 0) {
|
|
@@ -32210,7 +32235,7 @@ function PhoneInput({
|
|
|
32210
32235
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
32211
32236
|
debounceRef.current = setTimeout(() => runValidation(phone), 300);
|
|
32212
32237
|
}, [runValidation]);
|
|
32213
|
-
|
|
32238
|
+
useEffect52(() => {
|
|
32214
32239
|
return () => {
|
|
32215
32240
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
32216
32241
|
};
|
|
@@ -32277,7 +32302,7 @@ function CountryOption({ country }) {
|
|
|
32277
32302
|
// src/components/features/waitlist-form.tsx
|
|
32278
32303
|
init_cn();
|
|
32279
32304
|
import { getCountries as getCountries2 } from "libphonenumber-js";
|
|
32280
|
-
import { useEffect as
|
|
32305
|
+
import { useEffect as useEffect53, useState as useState73 } from "react";
|
|
32281
32306
|
import { Fragment as Fragment44, jsx as jsx255, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
32282
32307
|
function WaitlistForm({
|
|
32283
32308
|
id = "waitlist-form",
|
|
@@ -32307,12 +32332,12 @@ function WaitlistForm({
|
|
|
32307
32332
|
const [isPhoneInvalid, setIsPhoneInvalid] = useState73(false);
|
|
32308
32333
|
const [showConsentError, setShowConsentError] = useState73(false);
|
|
32309
32334
|
const isMailDomainGeneric = hasGenericEmailDomain(email);
|
|
32310
|
-
|
|
32335
|
+
useEffect53(() => {
|
|
32311
32336
|
if (defaultEmail) {
|
|
32312
32337
|
setEmail(defaultEmail);
|
|
32313
32338
|
}
|
|
32314
32339
|
}, [defaultEmail]);
|
|
32315
|
-
|
|
32340
|
+
useEffect53(() => {
|
|
32316
32341
|
setIsClient(true);
|
|
32317
32342
|
if (!geoApiUrl) return;
|
|
32318
32343
|
const supportedCountries = new Set(getCountries2());
|
|
@@ -32700,7 +32725,7 @@ function useOptionalNotifications() {
|
|
|
32700
32725
|
}
|
|
32701
32726
|
|
|
32702
32727
|
// src/components/features/notifications/notification-drawer.tsx
|
|
32703
|
-
import { useEffect as
|
|
32728
|
+
import { useEffect as useEffect57, useRef as useRef40 } from "react";
|
|
32704
32729
|
|
|
32705
32730
|
// src/components/navigation/app-layout-context.ts
|
|
32706
32731
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -33195,7 +33220,7 @@ init_button2();
|
|
|
33195
33220
|
init_cn();
|
|
33196
33221
|
|
|
33197
33222
|
// src/components/features/notifications/notification-tile.tsx
|
|
33198
|
-
import { useMemo as useMemo29, useEffect as
|
|
33223
|
+
import { useMemo as useMemo29, useEffect as useEffect56, useState as useState76 } from "react";
|
|
33199
33224
|
init_cn();
|
|
33200
33225
|
import { jsx as jsx258, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
33201
33226
|
var variantBySeverity = {
|
|
@@ -33243,7 +33268,7 @@ function NotificationTile({
|
|
|
33243
33268
|
const initialElapsed = useMemo29(() => Date.now() - createdAt, [createdAt]);
|
|
33244
33269
|
const isLive = !read && !settled && initialElapsed < liveDurationMs;
|
|
33245
33270
|
const counting = isLive && !paused;
|
|
33246
|
-
|
|
33271
|
+
useEffect56(() => {
|
|
33247
33272
|
if (!counting) return;
|
|
33248
33273
|
const remaining = Math.max(0, liveDurationMs - initialElapsed);
|
|
33249
33274
|
const timer = window.setTimeout(() => {
|
|
@@ -33468,11 +33493,11 @@ function DrawerScrollList({
|
|
|
33468
33493
|
loadMoreRootMargin,
|
|
33469
33494
|
renderTile
|
|
33470
33495
|
}) {
|
|
33471
|
-
const scrollRef =
|
|
33472
|
-
const sentinelRef =
|
|
33473
|
-
const loadMoreRef =
|
|
33496
|
+
const scrollRef = useRef40(null);
|
|
33497
|
+
const sentinelRef = useRef40(null);
|
|
33498
|
+
const loadMoreRef = useRef40(loadMore);
|
|
33474
33499
|
loadMoreRef.current = loadMore;
|
|
33475
|
-
|
|
33500
|
+
useEffect57(() => {
|
|
33476
33501
|
if (!loadMore || !hasMore || isLoadingMore) return;
|
|
33477
33502
|
const sentinel = sentinelRef.current;
|
|
33478
33503
|
const root = scrollRef.current;
|
|
@@ -34012,12 +34037,12 @@ function useOptionalTimeTracker() {
|
|
|
34012
34037
|
|
|
34013
34038
|
// src/components/features/time-tracker/time-tracker-panel.tsx
|
|
34014
34039
|
init_cn();
|
|
34015
|
-
import { useEffect as
|
|
34040
|
+
import { useEffect as useEffect59, useState as useState80 } from "react";
|
|
34016
34041
|
init_button();
|
|
34017
34042
|
init_split_button();
|
|
34018
34043
|
|
|
34019
34044
|
// src/components/features/time-tracker/use-tracker-clock.ts
|
|
34020
|
-
import { useEffect as
|
|
34045
|
+
import { useEffect as useEffect58, useState as useState79 } from "react";
|
|
34021
34046
|
function formatElapsed(totalMs) {
|
|
34022
34047
|
const totalSeconds = Math.max(0, Math.floor(totalMs / 1e3));
|
|
34023
34048
|
const hours = Math.floor(totalSeconds / 3600);
|
|
@@ -34028,7 +34053,7 @@ function formatElapsed(totalMs) {
|
|
|
34028
34053
|
}
|
|
34029
34054
|
function useTrackerClock({ status, runningSince, accumulatedMs = 0 }) {
|
|
34030
34055
|
const [now, setNow] = useState79(() => Date.now());
|
|
34031
|
-
|
|
34056
|
+
useEffect58(() => {
|
|
34032
34057
|
if (status !== "tracking") return;
|
|
34033
34058
|
setNow(Date.now());
|
|
34034
34059
|
const id = setInterval(() => setNow(Date.now()), 1e3);
|
|
@@ -34088,7 +34113,7 @@ function TimeTrackerPanel({
|
|
|
34088
34113
|
const isActive = status !== "ready";
|
|
34089
34114
|
const hasContent = selectedTicketId != null || notes.trim() !== "";
|
|
34090
34115
|
const showFieldError = isActive && showValidationError && !hasContent;
|
|
34091
|
-
|
|
34116
|
+
useEffect59(() => {
|
|
34092
34117
|
if (status === "ready") setShowValidationError(false);
|
|
34093
34118
|
}, [status]);
|
|
34094
34119
|
const handleSubmit = () => {
|
|
@@ -34339,7 +34364,7 @@ function LastEntryRow({ entry, onClick }) {
|
|
|
34339
34364
|
// src/components/features/time-tracker/time-tracker-header-button.tsx
|
|
34340
34365
|
init_cn();
|
|
34341
34366
|
import * as PopoverPrimitive5 from "@radix-ui/react-popover";
|
|
34342
|
-
import { useEffect as
|
|
34367
|
+
import { useEffect as useEffect60, useRef as useRef41 } from "react";
|
|
34343
34368
|
|
|
34344
34369
|
// src/components/navigation/header-button.tsx
|
|
34345
34370
|
init_cn();
|
|
@@ -34378,11 +34403,11 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
34378
34403
|
const layoutContainer = useAppLayoutDrawerContainer();
|
|
34379
34404
|
const coordination = useAppLayoutDrawerCoordination();
|
|
34380
34405
|
const isOpen = ctx?.isOpen ?? false;
|
|
34381
|
-
const isOpenRef =
|
|
34406
|
+
const isOpenRef = useRef41(isOpen);
|
|
34382
34407
|
isOpenRef.current = isOpen;
|
|
34383
|
-
const closeRef =
|
|
34408
|
+
const closeRef = useRef41(ctx?.close);
|
|
34384
34409
|
closeRef.current = ctx?.close;
|
|
34385
|
-
const selfHandleRef =
|
|
34410
|
+
const selfHandleRef = useRef41(null);
|
|
34386
34411
|
if (!selfHandleRef.current) {
|
|
34387
34412
|
selfHandleRef.current = {
|
|
34388
34413
|
close: () => {
|
|
@@ -34390,10 +34415,10 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
34390
34415
|
}
|
|
34391
34416
|
};
|
|
34392
34417
|
}
|
|
34393
|
-
|
|
34418
|
+
useEffect60(() => {
|
|
34394
34419
|
if (isOpen) coordination?.notifyDrawerDidOpen(selfHandleRef.current ?? void 0);
|
|
34395
34420
|
}, [isOpen, coordination]);
|
|
34396
|
-
|
|
34421
|
+
useEffect60(() => {
|
|
34397
34422
|
if (!selfHandleRef.current) return;
|
|
34398
34423
|
return coordination?.registerDrawer(selfHandleRef.current);
|
|
34399
34424
|
}, [coordination]);
|
|
@@ -35407,18 +35432,18 @@ function SortableRow({
|
|
|
35407
35432
|
|
|
35408
35433
|
// src/components/navigation/header.tsx
|
|
35409
35434
|
init_next_link();
|
|
35410
|
-
import React108, { useEffect as
|
|
35435
|
+
import React108, { useEffect as useEffect63, useRef as useRef45, useState as useState84 } from "react";
|
|
35411
35436
|
init_button2();
|
|
35412
35437
|
|
|
35413
35438
|
// src/components/navigation/mobile-nav-panel.tsx
|
|
35414
|
-
import { useRef as
|
|
35439
|
+
import { useRef as useRef44 } from "react";
|
|
35415
35440
|
import { usePreventScroll as usePreventScroll3 } from "@react-aria/overlays";
|
|
35416
35441
|
init_button2();
|
|
35417
35442
|
import { X as X10 } from "lucide-react";
|
|
35418
35443
|
import { Fragment as Fragment51, jsx as jsx273, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
35419
35444
|
var MOBILE_NAV_PANEL_ID = "mobile-nav-panel";
|
|
35420
35445
|
function MobileNavPanel({ isOpen, config }) {
|
|
35421
|
-
const panelRef =
|
|
35446
|
+
const panelRef = useRef44(null);
|
|
35422
35447
|
usePreventScroll3({ isDisabled: !isOpen });
|
|
35423
35448
|
useFocusTrap(panelRef, isOpen, { onEscape: config.onClose });
|
|
35424
35449
|
const headerHeight = useHeaderHeight(64, { enabled: isOpen });
|
|
@@ -35579,9 +35604,9 @@ function Header2({ config, platform }) {
|
|
|
35579
35604
|
const [show, setShow] = useState84(true);
|
|
35580
35605
|
const [lastScrollY, setLastScrollY] = useState84(0);
|
|
35581
35606
|
const [openDropdowns, setOpenDropdowns] = useState84({});
|
|
35582
|
-
const dropdownRefs =
|
|
35583
|
-
const triggerRefs =
|
|
35584
|
-
|
|
35607
|
+
const dropdownRefs = useRef45({});
|
|
35608
|
+
const triggerRefs = useRef45({});
|
|
35609
|
+
useEffect63(() => {
|
|
35585
35610
|
const handleClickOutside = (event) => {
|
|
35586
35611
|
const target = event.target;
|
|
35587
35612
|
if (!target) return;
|
|
@@ -35610,14 +35635,14 @@ function Header2({ config, platform }) {
|
|
|
35610
35635
|
document.removeEventListener("keydown", handleEscapeKey);
|
|
35611
35636
|
};
|
|
35612
35637
|
}, [openDropdowns]);
|
|
35613
|
-
|
|
35638
|
+
useEffect63(() => {
|
|
35614
35639
|
return () => {
|
|
35615
35640
|
setOpenDropdowns({});
|
|
35616
35641
|
dropdownRefs.current = {};
|
|
35617
35642
|
triggerRefs.current = {};
|
|
35618
35643
|
};
|
|
35619
35644
|
}, []);
|
|
35620
|
-
|
|
35645
|
+
useEffect63(() => {
|
|
35621
35646
|
if (!config.autoHide) {
|
|
35622
35647
|
setShow(true);
|
|
35623
35648
|
return;
|
|
@@ -35847,7 +35872,7 @@ function Header2({ config, platform }) {
|
|
|
35847
35872
|
}
|
|
35848
35873
|
|
|
35849
35874
|
// src/components/navigation/client-only-header.tsx
|
|
35850
|
-
import { useState as useState85, useEffect as
|
|
35875
|
+
import { useState as useState85, useEffect as useEffect64 } from "react";
|
|
35851
35876
|
|
|
35852
35877
|
// src/components/navigation/header-skeleton.tsx
|
|
35853
35878
|
import { jsx as jsx276, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
@@ -35896,7 +35921,7 @@ function HeaderSkeleton({ config }) {
|
|
|
35896
35921
|
import { jsx as jsx277 } from "react/jsx-runtime";
|
|
35897
35922
|
function ClientOnlyHeader({ config, skeleton }) {
|
|
35898
35923
|
const [isClient, setIsClient] = useState85(false);
|
|
35899
|
-
|
|
35924
|
+
useEffect64(() => {
|
|
35900
35925
|
setIsClient(true);
|
|
35901
35926
|
}, []);
|
|
35902
35927
|
if (!isClient) {
|
|
@@ -35906,7 +35931,7 @@ function ClientOnlyHeader({ config, skeleton }) {
|
|
|
35906
35931
|
}
|
|
35907
35932
|
|
|
35908
35933
|
// src/components/navigation/sliding-sidebar.tsx
|
|
35909
|
-
import { useState as useState86, useEffect as
|
|
35934
|
+
import { useState as useState86, useEffect as useEffect65, useRef as useRef46 } from "react";
|
|
35910
35935
|
import { motion as motion2, AnimatePresence, useReducedMotion } from "framer-motion";
|
|
35911
35936
|
import { usePreventScroll as usePreventScroll4 } from "@react-aria/overlays";
|
|
35912
35937
|
init_button2();
|
|
@@ -35915,11 +35940,11 @@ function SlidingSidebar({ config }) {
|
|
|
35915
35940
|
const [expandedItems, setExpandedItems] = useState86(/* @__PURE__ */ new Set());
|
|
35916
35941
|
const [mounted, setMounted] = useState86(false);
|
|
35917
35942
|
const headerHeight = useHeaderHeight();
|
|
35918
|
-
const asideRef =
|
|
35943
|
+
const asideRef = useRef46(null);
|
|
35919
35944
|
const prefersReducedMotion2 = useReducedMotion();
|
|
35920
35945
|
usePreventScroll4({ isDisabled: !config.isOpen });
|
|
35921
35946
|
useFocusTrap(asideRef, config.isOpen, { onEscape: config.onClose, contain: false });
|
|
35922
|
-
|
|
35947
|
+
useEffect65(() => {
|
|
35923
35948
|
setMounted(true);
|
|
35924
35949
|
}, []);
|
|
35925
35950
|
const toggleExpanded = (itemId) => {
|
|
@@ -36087,7 +36112,7 @@ function SlidingSidebar({ config }) {
|
|
|
36087
36112
|
}
|
|
36088
36113
|
|
|
36089
36114
|
// src/components/navigation/sticky-section-nav.tsx
|
|
36090
|
-
import { useEffect as
|
|
36115
|
+
import { useEffect as useEffect66, useState as useState87, useCallback as useCallback35, useRef as useRef47 } from "react";
|
|
36091
36116
|
import { jsx as jsx279, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
36092
36117
|
function StickySectionNav({
|
|
36093
36118
|
sections,
|
|
@@ -36149,7 +36174,7 @@ function StickySectionNav({
|
|
|
36149
36174
|
}
|
|
36150
36175
|
function useSectionNavigation(sections, options) {
|
|
36151
36176
|
const [activeSection, setActiveSection] = useState87(sections[0]?.id || "");
|
|
36152
|
-
const isScrollingFromClick =
|
|
36177
|
+
const isScrollingFromClick = useRef47(false);
|
|
36153
36178
|
const { offset: offset2 = 100 } = options || {};
|
|
36154
36179
|
const handleSectionClick = useCallback35((sectionId) => {
|
|
36155
36180
|
const targetElement = document.getElementById(sectionId);
|
|
@@ -36161,14 +36186,14 @@ function useSectionNavigation(sections, options) {
|
|
|
36161
36186
|
isScrollingFromClick.current = false;
|
|
36162
36187
|
}, 500);
|
|
36163
36188
|
}, [offset2]);
|
|
36164
|
-
|
|
36189
|
+
useEffect66(() => {
|
|
36165
36190
|
sections.forEach((section) => {
|
|
36166
36191
|
if (section.ref.current && !section.ref.current.id) {
|
|
36167
36192
|
section.ref.current.id = section.id;
|
|
36168
36193
|
}
|
|
36169
36194
|
});
|
|
36170
36195
|
}, [sections]);
|
|
36171
|
-
|
|
36196
|
+
useEffect66(() => {
|
|
36172
36197
|
const handleScroll = () => {
|
|
36173
36198
|
if (isScrollingFromClick.current) return;
|
|
36174
36199
|
const scrollPosition = window.scrollY + offset2 + 50;
|
|
@@ -36201,7 +36226,7 @@ function useSectionNavigation(sections, options) {
|
|
|
36201
36226
|
}
|
|
36202
36227
|
|
|
36203
36228
|
// src/components/navigation/navigation-sidebar.tsx
|
|
36204
|
-
import { useCallback as useCallback36, useEffect as
|
|
36229
|
+
import { useCallback as useCallback36, useEffect as useEffect67, useLayoutEffect as useLayoutEffect6, useMemo as useMemo34, useState as useState88 } from "react";
|
|
36205
36230
|
|
|
36206
36231
|
// src/components/navigation/navigation-sidebar-header.tsx
|
|
36207
36232
|
import { jsx as jsx280, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
@@ -36350,7 +36375,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
36350
36375
|
config.minimized ?? false
|
|
36351
36376
|
);
|
|
36352
36377
|
const [tabletMinimized, setTabletMinimized] = useState88(true);
|
|
36353
|
-
|
|
36378
|
+
useEffect67(() => {
|
|
36354
36379
|
if (isTablet) setTabletMinimized(true);
|
|
36355
36380
|
}, [isTablet]);
|
|
36356
36381
|
const minimized = isTablet ? tabletMinimized : desktopMinimized;
|
|
@@ -36368,7 +36393,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
36368
36393
|
const closeOverlay = useCallback36(() => {
|
|
36369
36394
|
setTabletMinimized(true);
|
|
36370
36395
|
}, []);
|
|
36371
|
-
|
|
36396
|
+
useEffect67(() => {
|
|
36372
36397
|
if (!isOverlayOpen) return;
|
|
36373
36398
|
const handleKeyDown = (e) => {
|
|
36374
36399
|
if (e.key === "Escape") closeOverlay();
|
|
@@ -36849,10 +36874,10 @@ function NotificationsHeaderButton({
|
|
|
36849
36874
|
}
|
|
36850
36875
|
|
|
36851
36876
|
// src/components/navigation/app-layout.tsx
|
|
36852
|
-
import { Suspense as Suspense2, useCallback as useCallback38, useMemo as useMemo35, useRef as
|
|
36877
|
+
import { Suspense as Suspense2, useCallback as useCallback38, useMemo as useMemo35, useRef as useRef49, useState as useState89 } from "react";
|
|
36853
36878
|
|
|
36854
36879
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
36855
|
-
import React113, { useCallback as useCallback37, useRef as
|
|
36880
|
+
import React113, { useCallback as useCallback37, useRef as useRef48 } from "react";
|
|
36856
36881
|
import { usePreventScroll as usePreventScroll5 } from "@react-aria/overlays";
|
|
36857
36882
|
import { Fragment as Fragment55, jsx as jsx288, jsxs as jsxs226 } from "react/jsx-runtime";
|
|
36858
36883
|
var HEADER_HEIGHT = 48;
|
|
@@ -36866,7 +36891,7 @@ var MobileBurgerMenu = React113.memo(function MobileBurgerMenu2({
|
|
|
36866
36891
|
onLogout,
|
|
36867
36892
|
disabled = false
|
|
36868
36893
|
}) {
|
|
36869
|
-
const panelRef =
|
|
36894
|
+
const panelRef = useRef48(null);
|
|
36870
36895
|
usePreventScroll5({ isDisabled: !isOpen });
|
|
36871
36896
|
useFocusTrap(panelRef, isOpen, { onEscape: onClose });
|
|
36872
36897
|
const handleItemClick = useCallback37((item) => {
|
|
@@ -37051,9 +37076,9 @@ function AppLayout({
|
|
|
37051
37076
|
}) {
|
|
37052
37077
|
const [mobileMenuOpen, setMobileMenuOpen] = useState89(false);
|
|
37053
37078
|
const [drawerContainer, setDrawerContainer] = useState89(null);
|
|
37054
|
-
const mobileMenuOpenRef =
|
|
37079
|
+
const mobileMenuOpenRef = useRef49(mobileMenuOpen);
|
|
37055
37080
|
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
37056
|
-
const drawerHandlesRef =
|
|
37081
|
+
const drawerHandlesRef = useRef49(/* @__PURE__ */ new Set());
|
|
37057
37082
|
const handleToggleMobileMenu = useCallback38(() => {
|
|
37058
37083
|
const opening = !mobileMenuOpenRef.current;
|
|
37059
37084
|
if (opening) {
|
|
@@ -37680,7 +37705,7 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
37680
37705
|
|
|
37681
37706
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
37682
37707
|
init_button2();
|
|
37683
|
-
import React115, { useRef as
|
|
37708
|
+
import React115, { useRef as useRef50, useCallback as useCallback39 } from "react";
|
|
37684
37709
|
|
|
37685
37710
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
37686
37711
|
import React114 from "react";
|
|
@@ -37804,10 +37829,10 @@ function OnboardingWalkthrough({
|
|
|
37804
37829
|
allStepsComplete,
|
|
37805
37830
|
markMultipleComplete
|
|
37806
37831
|
} = useOnboardingState(storageKey);
|
|
37807
|
-
const hasAutoMarkedRef =
|
|
37808
|
-
const autoMarkingInProgressRef =
|
|
37809
|
-
const lastCompletionStatusRef =
|
|
37810
|
-
const actionInProgressRef =
|
|
37832
|
+
const hasAutoMarkedRef = useRef50(false);
|
|
37833
|
+
const autoMarkingInProgressRef = useRef50(false);
|
|
37834
|
+
const lastCompletionStatusRef = useRef50(null);
|
|
37835
|
+
const actionInProgressRef = useRef50(/* @__PURE__ */ new Set());
|
|
37811
37836
|
React115.useEffect(() => {
|
|
37812
37837
|
if (isLoadingCompletion) {
|
|
37813
37838
|
hasAutoMarkedRef.current = false;
|
|
@@ -38495,7 +38520,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx307(ContentLoader, { ...props, va
|
|
|
38495
38520
|
|
|
38496
38521
|
// src/components/ui/table/table.tsx
|
|
38497
38522
|
init_cn();
|
|
38498
|
-
import { useEffect as
|
|
38523
|
+
import { useEffect as useEffect69, useRef as useRef52 } from "react";
|
|
38499
38524
|
init_pagination();
|
|
38500
38525
|
init_button2();
|
|
38501
38526
|
|
|
@@ -39106,10 +39131,10 @@ function TableRow({
|
|
|
39106
39131
|
}
|
|
39107
39132
|
|
|
39108
39133
|
// src/components/ui/table/use-table-motion.ts
|
|
39109
|
-
import { useEffect as
|
|
39134
|
+
import { useEffect as useEffect68, useState as useState91 } from "react";
|
|
39110
39135
|
function useTableMotion(enabled) {
|
|
39111
39136
|
const [runtime, setRuntime] = useState91(null);
|
|
39112
|
-
|
|
39137
|
+
useEffect68(() => {
|
|
39113
39138
|
if (!enabled || runtime) return;
|
|
39114
39139
|
let active = true;
|
|
39115
39140
|
import("framer-motion").then((m) => {
|
|
@@ -39255,10 +39280,10 @@ function Table({
|
|
|
39255
39280
|
};
|
|
39256
39281
|
const allSelected = selectedRows.length > 0 && selectedRows.length === data.length;
|
|
39257
39282
|
const someSelected = selectedRows.length > 0 && selectedRows.length < data.length;
|
|
39258
|
-
const sentinelRef =
|
|
39259
|
-
const onLoadMoreRef =
|
|
39283
|
+
const sentinelRef = useRef52(null);
|
|
39284
|
+
const onLoadMoreRef = useRef52(infiniteScroll?.onLoadMore);
|
|
39260
39285
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
39261
|
-
|
|
39286
|
+
useEffect69(() => {
|
|
39262
39287
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
39263
39288
|
const sentinel = sentinelRef.current;
|
|
39264
39289
|
if (!sentinel) return;
|
|
@@ -39476,7 +39501,7 @@ import { useMemo as useMemo37 } from "react";
|
|
|
39476
39501
|
|
|
39477
39502
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
39478
39503
|
init_cn();
|
|
39479
|
-
import { useRef as
|
|
39504
|
+
import { useRef as useRef53, useState as useState92, useCallback as useCallback40 } from "react";
|
|
39480
39505
|
import { jsx as jsx319, jsxs as jsxs252 } from "react/jsx-runtime";
|
|
39481
39506
|
function QueryReportTableHeader({
|
|
39482
39507
|
columns,
|
|
@@ -39505,7 +39530,7 @@ function QueryReportTableHeader({
|
|
|
39505
39530
|
);
|
|
39506
39531
|
}
|
|
39507
39532
|
function TruncatedHeaderCell({ value, width }) {
|
|
39508
|
-
const textRef =
|
|
39533
|
+
const textRef = useRef53(null);
|
|
39509
39534
|
const [isTruncated, setIsTruncated] = useState92(false);
|
|
39510
39535
|
const checkTruncation = useCallback40(() => {
|
|
39511
39536
|
const el = textRef.current;
|
|
@@ -39535,7 +39560,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
39535
39560
|
|
|
39536
39561
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
39537
39562
|
init_cn();
|
|
39538
|
-
import { useRef as
|
|
39563
|
+
import { useRef as useRef54, useState as useState93, useCallback as useCallback41 } from "react";
|
|
39539
39564
|
import { jsx as jsx320, jsxs as jsxs253 } from "react/jsx-runtime";
|
|
39540
39565
|
function QueryReportTableRow({
|
|
39541
39566
|
row,
|
|
@@ -39581,7 +39606,7 @@ function QueryReportTableRow({
|
|
|
39581
39606
|
);
|
|
39582
39607
|
}
|
|
39583
39608
|
function TruncatedCell({ value, className }) {
|
|
39584
|
-
const textRef =
|
|
39609
|
+
const textRef = useRef54(null);
|
|
39585
39610
|
const [isTruncated, setIsTruncated] = useState93(false);
|
|
39586
39611
|
const checkTruncation = useCallback41(() => {
|
|
39587
39612
|
const el = textRef.current;
|
|
@@ -40083,7 +40108,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
40083
40108
|
// src/components/ui/data-table/data-table-row.tsx
|
|
40084
40109
|
init_next_link();
|
|
40085
40110
|
init_cn();
|
|
40086
|
-
import { memo as memo5, useCallback as useCallback43, useRef as
|
|
40111
|
+
import { memo as memo5, useCallback as useCallback43, useRef as useRef55 } from "react";
|
|
40087
40112
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
40088
40113
|
|
|
40089
40114
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -40168,7 +40193,7 @@ function DataTableRowImpl({
|
|
|
40168
40193
|
const hasSubRow = subRow != null && subRow !== false;
|
|
40169
40194
|
const isLinkMode = Boolean(href) && !onClick;
|
|
40170
40195
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
40171
|
-
const containerRef =
|
|
40196
|
+
const containerRef = useRef55(null);
|
|
40172
40197
|
const handleClick = useCallback43(
|
|
40173
40198
|
(e) => {
|
|
40174
40199
|
const target = e.target;
|
|
@@ -40336,7 +40361,7 @@ function DataTableBody({
|
|
|
40336
40361
|
}
|
|
40337
40362
|
|
|
40338
40363
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
40339
|
-
import { useEffect as
|
|
40364
|
+
import { useEffect as useEffect70, useRef as useRef56 } from "react";
|
|
40340
40365
|
import { Fragment as Fragment63, jsx as jsx330, jsxs as jsxs261 } from "react/jsx-runtime";
|
|
40341
40366
|
function DataTableInfiniteFooter({
|
|
40342
40367
|
hasNextPage,
|
|
@@ -40345,10 +40370,10 @@ function DataTableInfiniteFooter({
|
|
|
40345
40370
|
skeletonRows = 3,
|
|
40346
40371
|
rootMargin = "200px"
|
|
40347
40372
|
}) {
|
|
40348
|
-
const sentinelRef =
|
|
40349
|
-
const onLoadMoreRef =
|
|
40373
|
+
const sentinelRef = useRef56(null);
|
|
40374
|
+
const onLoadMoreRef = useRef56(onLoadMore);
|
|
40350
40375
|
onLoadMoreRef.current = onLoadMore;
|
|
40351
|
-
|
|
40376
|
+
useEffect70(() => {
|
|
40352
40377
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
40353
40378
|
const sentinel = sentinelRef.current;
|
|
40354
40379
|
if (!sentinel) return;
|
|
@@ -40982,8 +41007,8 @@ function FilterList({
|
|
|
40982
41007
|
|
|
40983
41008
|
// src/components/ui/tag-search-input.tsx
|
|
40984
41009
|
import {
|
|
40985
|
-
useEffect as
|
|
40986
|
-
useRef as
|
|
41010
|
+
useEffect as useEffect72,
|
|
41011
|
+
useRef as useRef58,
|
|
40987
41012
|
useState as useState95
|
|
40988
41013
|
} from "react";
|
|
40989
41014
|
init_cn();
|
|
@@ -41018,11 +41043,11 @@ function TagSearchInput({
|
|
|
41018
41043
|
limitTags,
|
|
41019
41044
|
placeholder: currentPlaceholder
|
|
41020
41045
|
});
|
|
41021
|
-
const wrapperRef =
|
|
41022
|
-
const hiddenTagsRef =
|
|
41023
|
-
const hiddenTagsPopupRef =
|
|
41046
|
+
const wrapperRef = useRef58(null);
|
|
41047
|
+
const hiddenTagsRef = useRef58(null);
|
|
41048
|
+
const hiddenTagsPopupRef = useRef58(null);
|
|
41024
41049
|
const [showHiddenTags, setShowHiddenTags] = useState95(false);
|
|
41025
|
-
|
|
41050
|
+
useEffect72(() => {
|
|
41026
41051
|
if (!showHiddenTags) return;
|
|
41027
41052
|
const handleClick = (e) => {
|
|
41028
41053
|
const target = e.target;
|
|
@@ -41177,9 +41202,9 @@ function TagSearchInput({
|
|
|
41177
41202
|
}
|
|
41178
41203
|
|
|
41179
41204
|
// src/components/ui/markdown-editor.tsx
|
|
41180
|
-
import { useRef as
|
|
41205
|
+
import { useRef as useRef59, useCallback as useCallback44, useState as useState96, useEffect as useEffect73 } from "react";
|
|
41181
41206
|
init_cn();
|
|
41182
|
-
import { Loader2 as
|
|
41207
|
+
import { Loader2 as Loader28, Upload as Upload8 } from "lucide-react";
|
|
41183
41208
|
import { jsx as jsx335, jsxs as jsxs266 } from "react/jsx-runtime";
|
|
41184
41209
|
var MDEditor = dynamic(() => import("@uiw/react-md-editor"), { ssr: false });
|
|
41185
41210
|
var MARKDOWN_EDITOR_STYLE_ID = "ods-markdown-editor-styles";
|
|
@@ -41208,7 +41233,7 @@ body .w-md-editor .w-md-editor-bar::after { content: '' !important; display: blo
|
|
|
41208
41233
|
body .w-md-editor .w-md-editor-bar:hover::after { border-color: var(--color-text-secondary) !important; }
|
|
41209
41234
|
`;
|
|
41210
41235
|
function MarkdownEditorStyles() {
|
|
41211
|
-
|
|
41236
|
+
useEffect73(() => {
|
|
41212
41237
|
if (document.getElementById(MARKDOWN_EDITOR_STYLE_ID)) return;
|
|
41213
41238
|
const style = document.createElement("style");
|
|
41214
41239
|
style.id = MARKDOWN_EDITOR_STYLE_ID;
|
|
@@ -41232,11 +41257,11 @@ function MarkdownEditor({
|
|
|
41232
41257
|
onFileUploaded,
|
|
41233
41258
|
renderPreview
|
|
41234
41259
|
}) {
|
|
41235
|
-
const fileInputRef =
|
|
41260
|
+
const fileInputRef = useRef59(null);
|
|
41236
41261
|
const [isUploading, setIsUploading] = useState96(false);
|
|
41237
41262
|
const [uploadProgress, setUploadProgress] = useState96("");
|
|
41238
41263
|
const [defaultExtraCommands, setDefaultExtraCommands] = useState96([]);
|
|
41239
|
-
|
|
41264
|
+
useEffect73(() => {
|
|
41240
41265
|
import("@uiw/react-md-editor").then((mod) => {
|
|
41241
41266
|
if (mod.commands?.getExtraCommands) {
|
|
41242
41267
|
setDefaultExtraCommands(mod.commands.getExtraCommands());
|
|
@@ -41319,17 +41344,17 @@ function MarkdownEditor({
|
|
|
41319
41344
|
name: "upload",
|
|
41320
41345
|
keyCommand: "upload",
|
|
41321
41346
|
buttonProps: { "aria-label": "Upload file", title: "Upload file" },
|
|
41322
|
-
icon: isUploading ? /* @__PURE__ */ jsx335(
|
|
41347
|
+
icon: isUploading ? /* @__PURE__ */ jsx335(Loader28, { className: "w-3 h-3 animate-spin" }) : /* @__PURE__ */ jsx335(Upload8, { className: "w-3 h-3" }),
|
|
41323
41348
|
execute: () => {
|
|
41324
41349
|
fileInputRef.current?.click();
|
|
41325
41350
|
}
|
|
41326
41351
|
} : null;
|
|
41327
41352
|
const extraCommands = uploadCommand ? [...defaultExtraCommands, uploadCommand] : defaultExtraCommands;
|
|
41328
|
-
const wrapperRef =
|
|
41329
|
-
const isDraggingRef =
|
|
41330
|
-
const mouseYRef =
|
|
41331
|
-
const rafRef =
|
|
41332
|
-
const scrollParentRef =
|
|
41353
|
+
const wrapperRef = useRef59(null);
|
|
41354
|
+
const isDraggingRef = useRef59(false);
|
|
41355
|
+
const mouseYRef = useRef59(0);
|
|
41356
|
+
const rafRef = useRef59(0);
|
|
41357
|
+
const scrollParentRef = useRef59(window);
|
|
41333
41358
|
const EDGE_ZONE = 60;
|
|
41334
41359
|
const MAX_SCROLL_SPEED = 15;
|
|
41335
41360
|
const findScrollParent = useCallback44((el) => {
|
|
@@ -41359,7 +41384,7 @@ function MarkdownEditor({
|
|
|
41359
41384
|
}
|
|
41360
41385
|
rafRef.current = requestAnimationFrame(scrollLoop);
|
|
41361
41386
|
}, []);
|
|
41362
|
-
|
|
41387
|
+
useEffect73(() => {
|
|
41363
41388
|
const wrapper = wrapperRef.current;
|
|
41364
41389
|
if (!wrapper) return;
|
|
41365
41390
|
const onMouseMove = (e) => {
|
|
@@ -41407,7 +41432,7 @@ function MarkdownEditor({
|
|
|
41407
41432
|
accept: "image/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.zip,.txt"
|
|
41408
41433
|
}
|
|
41409
41434
|
),
|
|
41410
|
-
!MDEditor && /* @__PURE__ */ jsx335("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx335(
|
|
41435
|
+
!MDEditor && /* @__PURE__ */ jsx335("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx335(Loader28, { className: "h-8 w-8 animate-spin" }) }),
|
|
41411
41436
|
MDEditor && /* @__PURE__ */ jsx335(
|
|
41412
41437
|
MDEditor,
|
|
41413
41438
|
{
|
|
@@ -41453,7 +41478,7 @@ function MarkdownEditor({
|
|
|
41453
41478
|
|
|
41454
41479
|
// src/components/ui/file-upload.tsx
|
|
41455
41480
|
import * as React125 from "react";
|
|
41456
|
-
import { Loader2 as
|
|
41481
|
+
import { Loader2 as Loader29 } from "lucide-react";
|
|
41457
41482
|
init_cn();
|
|
41458
41483
|
import { jsx as jsx336, jsxs as jsxs267 } from "react/jsx-runtime";
|
|
41459
41484
|
function formatFileSize2(bytes) {
|
|
@@ -41681,7 +41706,7 @@ function FileUpload({
|
|
|
41681
41706
|
/* @__PURE__ */ jsxs267("div", { className: "flex items-center gap-[var(--spacing-system-xsf)]", children: [
|
|
41682
41707
|
/* @__PURE__ */ jsx336("span", { className: "text-h6 text-ods-text-secondary", children: formatFileSize2(entry.fileSize) }),
|
|
41683
41708
|
entry.status === "uploading" && /* @__PURE__ */ jsxs267("span", { className: "flex items-center gap-[var(--spacing-system-xxs)] text-h6 text-ods-text-secondary", children: [
|
|
41684
|
-
/* @__PURE__ */ jsx336(
|
|
41709
|
+
/* @__PURE__ */ jsx336(Loader29, { className: "size-3 animate-spin" }),
|
|
41685
41710
|
"Uploading..."
|
|
41686
41711
|
] }),
|
|
41687
41712
|
entry.status === "error" && /* @__PURE__ */ jsx336("span", { className: "text-h6 text-ods-error", children: entry.error || "Upload failed" })
|
|
@@ -41769,7 +41794,7 @@ function FileUpload({
|
|
|
41769
41794
|
|
|
41770
41795
|
// src/components/ui/image-uploader.tsx
|
|
41771
41796
|
import * as React126 from "react";
|
|
41772
|
-
import { Loader2 as
|
|
41797
|
+
import { Loader2 as Loader210 } from "lucide-react";
|
|
41773
41798
|
init_cn();
|
|
41774
41799
|
import { Fragment as Fragment65, jsx as jsx337, jsxs as jsxs268 } from "react/jsx-runtime";
|
|
41775
41800
|
var DEFAULT_MAX_SIZE = 25 * 1024 * 1024;
|
|
@@ -41935,8 +41960,8 @@ function ImageUploader({
|
|
|
41935
41960
|
}
|
|
41936
41961
|
)
|
|
41937
41962
|
] }),
|
|
41938
|
-
loading && /* @__PURE__ */ jsx337("div", { className: "absolute inset-0 flex items-center justify-center rounded-md bg-ods-overlay", children: /* @__PURE__ */ jsx337(
|
|
41939
|
-
] }) : loading ? /* @__PURE__ */ jsx337(
|
|
41963
|
+
loading && /* @__PURE__ */ jsx337("div", { className: "absolute inset-0 flex items-center justify-center rounded-md bg-ods-overlay", children: /* @__PURE__ */ jsx337(Loader210, { className: "size-8 animate-spin text-ods-text-on-dark" }) })
|
|
41964
|
+
] }) : loading ? /* @__PURE__ */ jsx337(Loader210, { className: "size-8 animate-spin text-ods-accent" }) : /* @__PURE__ */ jsxs268(Fragment65, { children: [
|
|
41940
41965
|
/* @__PURE__ */ jsx337("div", { className: "flex shrink-0 items-center justify-center rounded-full border border-ods-border bg-ods-card p-[var(--spacing-system-s)]", children: /* @__PURE__ */ jsx337(ImagePlusIcon, { className: "size-6 text-ods-text-primary" }) }),
|
|
41941
41966
|
/* @__PURE__ */ jsxs268("div", { className: "flex w-full flex-col items-center text-center", children: [
|
|
41942
41967
|
/* @__PURE__ */ jsx337("p", { className: "text-h4 text-ods-text-primary", children: label }),
|
|
@@ -42842,7 +42867,7 @@ function ImageGalleryModal({
|
|
|
42842
42867
|
initialIndex = 0
|
|
42843
42868
|
}) {
|
|
42844
42869
|
const [selectedImageIndex, setSelectedImageIndex] = useState103(initialIndex);
|
|
42845
|
-
|
|
42870
|
+
useEffect76(() => {
|
|
42846
42871
|
if (isOpen) {
|
|
42847
42872
|
setSelectedImageIndex(initialIndex);
|
|
42848
42873
|
}
|
|
@@ -42857,7 +42882,7 @@ function ImageGalleryModal({
|
|
|
42857
42882
|
setSelectedImageIndex(selectedImageIndex + 1);
|
|
42858
42883
|
}
|
|
42859
42884
|
};
|
|
42860
|
-
|
|
42885
|
+
useEffect76(() => {
|
|
42861
42886
|
const handleKeyPress = (event) => {
|
|
42862
42887
|
if (!isOpen) return;
|
|
42863
42888
|
switch (event.key) {
|
|
@@ -42956,7 +42981,7 @@ function ImageGalleryModal({
|
|
|
42956
42981
|
import {
|
|
42957
42982
|
Bug,
|
|
42958
42983
|
Inbox,
|
|
42959
|
-
Sparkles as
|
|
42984
|
+
Sparkles as Sparkles11,
|
|
42960
42985
|
BookOpen as BookOpen3,
|
|
42961
42986
|
Trophy,
|
|
42962
42987
|
Component as Component4,
|
|
@@ -42976,7 +43001,7 @@ function iconFor(customItemId) {
|
|
|
42976
43001
|
case CUSTOM_ITEM_ID.REQUEST:
|
|
42977
43002
|
return Inbox;
|
|
42978
43003
|
case CUSTOM_ITEM_ID.FEATURE:
|
|
42979
|
-
return
|
|
43004
|
+
return Sparkles11;
|
|
42980
43005
|
case CUSTOM_ITEM_ID.STORY:
|
|
42981
43006
|
return BookOpen3;
|
|
42982
43007
|
case CUSTOM_ITEM_ID.EPIC:
|
|
@@ -45267,7 +45292,7 @@ function cleanEscapedString(input) {
|
|
|
45267
45292
|
|
|
45268
45293
|
// src/components/chat/entity-cards/program-card.tsx
|
|
45269
45294
|
init_button();
|
|
45270
|
-
import { ExternalLink as ExternalLink12, Clock as Clock2, Play as Play4, Video as
|
|
45295
|
+
import { ExternalLink as ExternalLink12, Clock as Clock2, Play as Play4, Video as Video5 } from "lucide-react";
|
|
45271
45296
|
init_cn();
|
|
45272
45297
|
import { Fragment as Fragment75, jsx as jsx354, jsxs as jsxs283 } from "react/jsx-runtime";
|
|
45273
45298
|
function formatUtc(date, fmt) {
|
|
@@ -45471,7 +45496,7 @@ function ProgramCard({
|
|
|
45471
45496
|
className: "object-contain",
|
|
45472
45497
|
unoptimized: true
|
|
45473
45498
|
}
|
|
45474
|
-
) : /* @__PURE__ */ jsx354("span", { className: "flex h-full w-full items-center justify-center text-ods-accent", children: config.type === "podcast" ? /* @__PURE__ */ jsx354(Play4, { className: "w-4 h-4" }) : config.type === "webinar" ? /* @__PURE__ */ jsx354(
|
|
45499
|
+
) : /* @__PURE__ */ jsx354("span", { className: "flex h-full w-full items-center justify-center text-ods-accent", children: config.type === "podcast" ? /* @__PURE__ */ jsx354(Play4, { className: "w-4 h-4" }) : config.type === "webinar" ? /* @__PURE__ */ jsx354(Video5, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx354(Clock2, { className: "w-4 h-4" }) }),
|
|
45475
45500
|
config.type === "podcast" && !isScheduled && compactCover && /* @__PURE__ */ jsx354("span", { className: "absolute inset-0 flex items-center justify-center bg-black/30", children: /* @__PURE__ */ jsx354(Play4, { className: "w-4 h-4 text-ods-text-on-dark", fill: "white" }) })
|
|
45476
45501
|
] }),
|
|
45477
45502
|
/* @__PURE__ */ jsxs283("span", { className: COMPACT_CARD_TEXT_COL, children: [
|
|
@@ -45498,7 +45523,7 @@ function ProgramCard({
|
|
|
45498
45523
|
const webinarItem = item;
|
|
45499
45524
|
const duration = formatDurationFromRange(webinarItem.start_at, webinarItem.end_at);
|
|
45500
45525
|
return /* @__PURE__ */ jsxs283(Fragment75, { children: [
|
|
45501
|
-
/* @__PURE__ */ jsx354(
|
|
45526
|
+
/* @__PURE__ */ jsx354(Video5, { className: "w-4 h-4 text-ods-text-secondary" }),
|
|
45502
45527
|
/* @__PURE__ */ jsxs283("span", { className: "font-body text-ods-text-secondary", children: [
|
|
45503
45528
|
formatTimeWithTimezone(webinarItem.start_at, webinarItem.timezone ?? null),
|
|
45504
45529
|
duration && ` \xB7 ${duration}`
|
|
@@ -46932,7 +46957,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
46932
46957
|
}
|
|
46933
46958
|
|
|
46934
46959
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
46935
|
-
import { useCallback as useCallback46, useRef as
|
|
46960
|
+
import { useCallback as useCallback46, useRef as useRef63 } from "react";
|
|
46936
46961
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
46937
46962
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
46938
46963
|
}
|
|
@@ -46954,22 +46979,22 @@ function useChunkCatchup({
|
|
|
46954
46979
|
chatTypes = [CHAT_TYPE.CLIENT],
|
|
46955
46980
|
fetchChunks
|
|
46956
46981
|
}) {
|
|
46957
|
-
const processedSequenceKeys =
|
|
46958
|
-
const lastSequenceId =
|
|
46959
|
-
const lastSequenceIdByType =
|
|
46960
|
-
const fetchingInProgress =
|
|
46961
|
-
const lastFetchParams =
|
|
46962
|
-
const pendingCatchupRef =
|
|
46963
|
-
const chunkBuffer =
|
|
46964
|
-
const bufferUntilInitialCatchupComplete =
|
|
46965
|
-
const hasCompletedInitialCatchup =
|
|
46966
|
-
const dialogIdRef =
|
|
46982
|
+
const processedSequenceKeys = useRef63(/* @__PURE__ */ new Set());
|
|
46983
|
+
const lastSequenceId = useRef63(null);
|
|
46984
|
+
const lastSequenceIdByType = useRef63(/* @__PURE__ */ new Map());
|
|
46985
|
+
const fetchingInProgress = useRef63(false);
|
|
46986
|
+
const lastFetchParams = useRef63(null);
|
|
46987
|
+
const pendingCatchupRef = useRef63(null);
|
|
46988
|
+
const chunkBuffer = useRef63([]);
|
|
46989
|
+
const bufferUntilInitialCatchupComplete = useRef63(false);
|
|
46990
|
+
const hasCompletedInitialCatchup = useRef63(false);
|
|
46991
|
+
const dialogIdRef = useRef63(dialogId);
|
|
46967
46992
|
dialogIdRef.current = dialogId;
|
|
46968
|
-
const chatTypesRef =
|
|
46993
|
+
const chatTypesRef = useRef63(chatTypes);
|
|
46969
46994
|
chatTypesRef.current = chatTypes;
|
|
46970
|
-
const fetchChunksRef =
|
|
46995
|
+
const fetchChunksRef = useRef63(fetchChunks);
|
|
46971
46996
|
fetchChunksRef.current = fetchChunks;
|
|
46972
|
-
const onChunkReceivedRef =
|
|
46997
|
+
const onChunkReceivedRef = useRef63(onChunkReceived);
|
|
46973
46998
|
onChunkReceivedRef.current = onChunkReceived;
|
|
46974
46999
|
const processChunk = useCallback46((chunk, messageType, forceProcess = false) => {
|
|
46975
47000
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
@@ -47166,7 +47191,7 @@ function useChunkCatchup({
|
|
|
47166
47191
|
}
|
|
47167
47192
|
}
|
|
47168
47193
|
}, [flushBufferedRealtimeChunks]);
|
|
47169
|
-
const catchUpChunksRef =
|
|
47194
|
+
const catchUpChunksRef = useRef63(null);
|
|
47170
47195
|
catchUpChunksRef.current = catchUpChunks;
|
|
47171
47196
|
const resetChunkTracking = useCallback46(() => {
|
|
47172
47197
|
processedSequenceKeys.current.clear();
|
|
@@ -47210,7 +47235,7 @@ function useChunkCatchup({
|
|
|
47210
47235
|
}
|
|
47211
47236
|
|
|
47212
47237
|
// src/components/chat/hooks/use-scripted-stream.ts
|
|
47213
|
-
import { useEffect as
|
|
47238
|
+
import { useEffect as useEffect77, useState as useState106 } from "react";
|
|
47214
47239
|
var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
|
|
47215
47240
|
function prefersReducedMotion() {
|
|
47216
47241
|
return typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
|
|
@@ -47223,7 +47248,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47223
47248
|
setPrevKey(resetKey);
|
|
47224
47249
|
setIndex(0);
|
|
47225
47250
|
}
|
|
47226
|
-
|
|
47251
|
+
useEffect77(() => {
|
|
47227
47252
|
setReducedMotion(prefersReducedMotion());
|
|
47228
47253
|
const mq = window.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
47229
47254
|
if (!mq) return;
|
|
@@ -47233,7 +47258,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47233
47258
|
}, []);
|
|
47234
47259
|
const playing = enabled && !reducedMotion && frames.length > 0;
|
|
47235
47260
|
const lastIndex = Math.max(0, frames.length - 1);
|
|
47236
|
-
|
|
47261
|
+
useEffect77(() => {
|
|
47237
47262
|
if (!playing || index >= lastIndex) return;
|
|
47238
47263
|
const current = frames[Math.min(index, lastIndex)] ?? EMPTY_FRAME;
|
|
47239
47264
|
const t = setTimeout(() => setIndex((i) => Math.min(i + 1, lastIndex)), current.delayMs);
|
|
@@ -47245,7 +47270,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47245
47270
|
}
|
|
47246
47271
|
|
|
47247
47272
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
47248
|
-
import { useEffect as
|
|
47273
|
+
import { useEffect as useEffect78, useRef as useRef64, useState as useState107 } from "react";
|
|
47249
47274
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
47250
47275
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
47251
47276
|
function useJetStreamDialogSubscription({
|
|
@@ -47268,53 +47293,53 @@ function useJetStreamDialogSubscription({
|
|
|
47268
47293
|
const [isSubscribed, setIsSubscribed] = useState107(false);
|
|
47269
47294
|
const [reconnectionCount, setReconnectionCount] = useState107(0);
|
|
47270
47295
|
const [currentStreamSeq, setCurrentStreamSeq] = useState107(null);
|
|
47271
|
-
const clientRef =
|
|
47272
|
-
const subscriptionRef =
|
|
47273
|
-
const highestStreamSeqRef =
|
|
47274
|
-
const onEventRef =
|
|
47275
|
-
|
|
47296
|
+
const clientRef = useRef64(null);
|
|
47297
|
+
const subscriptionRef = useRef64(null);
|
|
47298
|
+
const highestStreamSeqRef = useRef64(null);
|
|
47299
|
+
const onEventRef = useRef64(onEvent);
|
|
47300
|
+
useEffect78(() => {
|
|
47276
47301
|
onEventRef.current = onEvent;
|
|
47277
47302
|
}, [onEvent]);
|
|
47278
|
-
const onConnectRef =
|
|
47279
|
-
|
|
47303
|
+
const onConnectRef = useRef64(onConnect);
|
|
47304
|
+
useEffect78(() => {
|
|
47280
47305
|
onConnectRef.current = onConnect;
|
|
47281
47306
|
}, [onConnect]);
|
|
47282
|
-
const onDisconnectRef =
|
|
47283
|
-
|
|
47307
|
+
const onDisconnectRef = useRef64(onDisconnect);
|
|
47308
|
+
useEffect78(() => {
|
|
47284
47309
|
onDisconnectRef.current = onDisconnect;
|
|
47285
47310
|
}, [onDisconnect]);
|
|
47286
|
-
const onSubscribedRef =
|
|
47287
|
-
|
|
47311
|
+
const onSubscribedRef = useRef64(onSubscribed);
|
|
47312
|
+
useEffect78(() => {
|
|
47288
47313
|
onSubscribedRef.current = onSubscribed;
|
|
47289
47314
|
}, [onSubscribed]);
|
|
47290
|
-
const onBeforeReconnectRef =
|
|
47291
|
-
|
|
47315
|
+
const onBeforeReconnectRef = useRef64(onBeforeReconnect);
|
|
47316
|
+
useEffect78(() => {
|
|
47292
47317
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47293
47318
|
}, [onBeforeReconnect]);
|
|
47294
|
-
const getNatsWsUrlRef =
|
|
47295
|
-
|
|
47319
|
+
const getNatsWsUrlRef = useRef64(getNatsWsUrl);
|
|
47320
|
+
useEffect78(() => {
|
|
47296
47321
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47297
47322
|
}, [getNatsWsUrl]);
|
|
47298
|
-
const reconnectionBackoffRef =
|
|
47299
|
-
|
|
47323
|
+
const reconnectionBackoffRef = useRef64(reconnectionBackoff);
|
|
47324
|
+
useEffect78(() => {
|
|
47300
47325
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47301
47326
|
}, [reconnectionBackoff]);
|
|
47302
|
-
const optStartSeqRef =
|
|
47303
|
-
|
|
47327
|
+
const optStartSeqRef = useRef64(optStartSeq);
|
|
47328
|
+
useEffect78(() => {
|
|
47304
47329
|
optStartSeqRef.current = optStartSeq;
|
|
47305
47330
|
}, [optStartSeq]);
|
|
47306
|
-
const inactiveThresholdRef =
|
|
47307
|
-
|
|
47331
|
+
const inactiveThresholdRef = useRef64(inactiveThresholdMs);
|
|
47332
|
+
useEffect78(() => {
|
|
47308
47333
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
47309
47334
|
}, [inactiveThresholdMs]);
|
|
47310
|
-
const hadConnectionBeforeRef =
|
|
47311
|
-
const clientConfigRef =
|
|
47312
|
-
|
|
47335
|
+
const hadConnectionBeforeRef = useRef64(false);
|
|
47336
|
+
const clientConfigRef = useRef64(clientConfig);
|
|
47337
|
+
useEffect78(() => {
|
|
47313
47338
|
clientConfigRef.current = clientConfig;
|
|
47314
47339
|
}, [clientConfig]);
|
|
47315
|
-
const currentWsUrlRef =
|
|
47340
|
+
const currentWsUrlRef = useRef64("");
|
|
47316
47341
|
const wsUrl = getNatsWsUrl();
|
|
47317
|
-
|
|
47342
|
+
useEffect78(() => {
|
|
47318
47343
|
if (!enabled || !wsUrl) {
|
|
47319
47344
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
47320
47345
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -47395,11 +47420,11 @@ function useJetStreamDialogSubscription({
|
|
|
47395
47420
|
}
|
|
47396
47421
|
};
|
|
47397
47422
|
}, [enabled, wsUrl]);
|
|
47398
|
-
|
|
47423
|
+
useEffect78(() => {
|
|
47399
47424
|
highestStreamSeqRef.current = null;
|
|
47400
47425
|
setCurrentStreamSeq(null);
|
|
47401
47426
|
}, [dialogId]);
|
|
47402
|
-
|
|
47427
|
+
useEffect78(() => {
|
|
47403
47428
|
if (!enabled || !dialogId || !isConnected) {
|
|
47404
47429
|
if (subscriptionRef.current) {
|
|
47405
47430
|
try {
|
|
@@ -47486,7 +47511,7 @@ function useJetStreamDialogSubscription({
|
|
|
47486
47511
|
}
|
|
47487
47512
|
|
|
47488
47513
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
47489
|
-
import { useEffect as
|
|
47514
|
+
import { useEffect as useEffect79, useRef as useRef65, useState as useState108 } from "react";
|
|
47490
47515
|
function useNatsDialogSubscription({
|
|
47491
47516
|
enabled,
|
|
47492
47517
|
dialogId,
|
|
@@ -47503,44 +47528,44 @@ function useNatsDialogSubscription({
|
|
|
47503
47528
|
const [isConnected, setIsConnected] = useState108(false);
|
|
47504
47529
|
const [isSubscribed, setIsSubscribed] = useState108(false);
|
|
47505
47530
|
const [reconnectionCount, setReconnectionCount] = useState108(0);
|
|
47506
|
-
const clientRef =
|
|
47507
|
-
const subscriptionRefs =
|
|
47508
|
-
const onEventRef =
|
|
47509
|
-
|
|
47531
|
+
const clientRef = useRef65(null);
|
|
47532
|
+
const subscriptionRefs = useRef65(/* @__PURE__ */ new Map());
|
|
47533
|
+
const onEventRef = useRef65(onEvent);
|
|
47534
|
+
useEffect79(() => {
|
|
47510
47535
|
onEventRef.current = onEvent;
|
|
47511
47536
|
}, [onEvent]);
|
|
47512
|
-
const onConnectRef =
|
|
47513
|
-
|
|
47537
|
+
const onConnectRef = useRef65(onConnect);
|
|
47538
|
+
useEffect79(() => {
|
|
47514
47539
|
onConnectRef.current = onConnect;
|
|
47515
47540
|
}, [onConnect]);
|
|
47516
|
-
const onDisconnectRef =
|
|
47517
|
-
|
|
47541
|
+
const onDisconnectRef = useRef65(onDisconnect);
|
|
47542
|
+
useEffect79(() => {
|
|
47518
47543
|
onDisconnectRef.current = onDisconnect;
|
|
47519
47544
|
}, [onDisconnect]);
|
|
47520
|
-
const onSubscribedRef =
|
|
47521
|
-
|
|
47545
|
+
const onSubscribedRef = useRef65(onSubscribed);
|
|
47546
|
+
useEffect79(() => {
|
|
47522
47547
|
onSubscribedRef.current = onSubscribed;
|
|
47523
47548
|
}, [onSubscribed]);
|
|
47524
|
-
const onBeforeReconnectRef =
|
|
47525
|
-
|
|
47549
|
+
const onBeforeReconnectRef = useRef65(onBeforeReconnect);
|
|
47550
|
+
useEffect79(() => {
|
|
47526
47551
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47527
47552
|
}, [onBeforeReconnect]);
|
|
47528
|
-
const hadConnectionBeforeRef =
|
|
47529
|
-
const getNatsWsUrlRef =
|
|
47530
|
-
|
|
47553
|
+
const hadConnectionBeforeRef = useRef65(false);
|
|
47554
|
+
const getNatsWsUrlRef = useRef65(getNatsWsUrl);
|
|
47555
|
+
useEffect79(() => {
|
|
47531
47556
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47532
47557
|
}, [getNatsWsUrl]);
|
|
47533
|
-
const reconnectionBackoffRef =
|
|
47534
|
-
|
|
47558
|
+
const reconnectionBackoffRef = useRef65(reconnectionBackoff);
|
|
47559
|
+
useEffect79(() => {
|
|
47535
47560
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47536
47561
|
}, [reconnectionBackoff]);
|
|
47537
|
-
const clientConfigRef =
|
|
47538
|
-
|
|
47562
|
+
const clientConfigRef = useRef65(clientConfig);
|
|
47563
|
+
useEffect79(() => {
|
|
47539
47564
|
clientConfigRef.current = clientConfig;
|
|
47540
47565
|
}, [clientConfig]);
|
|
47541
|
-
const currentWsUrlRef =
|
|
47566
|
+
const currentWsUrlRef = useRef65("");
|
|
47542
47567
|
const wsUrl = getNatsWsUrl();
|
|
47543
|
-
|
|
47568
|
+
useEffect79(() => {
|
|
47544
47569
|
if (!enabled || !wsUrl) {
|
|
47545
47570
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
47546
47571
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -47622,16 +47647,16 @@ function useNatsDialogSubscription({
|
|
|
47622
47647
|
};
|
|
47623
47648
|
}, [enabled, wsUrl]);
|
|
47624
47649
|
const topicsKey = topics.join(",");
|
|
47625
|
-
const topicsRef =
|
|
47650
|
+
const topicsRef = useRef65(topics);
|
|
47626
47651
|
topicsRef.current = topics;
|
|
47627
|
-
const lastSubscribedDialogIdRef =
|
|
47628
|
-
const isConnectedRef =
|
|
47629
|
-
|
|
47652
|
+
const lastSubscribedDialogIdRef = useRef65(null);
|
|
47653
|
+
const isConnectedRef = useRef65(isConnected);
|
|
47654
|
+
useEffect79(() => {
|
|
47630
47655
|
isConnectedRef.current = isConnected;
|
|
47631
47656
|
}, [isConnected]);
|
|
47632
|
-
const currentDialogIdRef =
|
|
47633
|
-
const abortControllerRef =
|
|
47634
|
-
|
|
47657
|
+
const currentDialogIdRef = useRef65(null);
|
|
47658
|
+
const abortControllerRef = useRef65(null);
|
|
47659
|
+
useEffect79(() => {
|
|
47635
47660
|
currentDialogIdRef.current = dialogId;
|
|
47636
47661
|
if (!enabled || !dialogId) {
|
|
47637
47662
|
if (subscriptionRefs.current.size > 0) {
|
|
@@ -47712,7 +47737,7 @@ function useNatsDialogSubscription({
|
|
|
47712
47737
|
abortControllerRef.current = null;
|
|
47713
47738
|
};
|
|
47714
47739
|
}, [enabled, dialogId, topicsKey]);
|
|
47715
|
-
|
|
47740
|
+
useEffect79(() => {
|
|
47716
47741
|
if (!enabled || !currentDialogIdRef.current || !isConnected) {
|
|
47717
47742
|
return;
|
|
47718
47743
|
}
|
|
@@ -47762,7 +47787,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
47762
47787
|
}
|
|
47763
47788
|
|
|
47764
47789
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
47765
|
-
import { useCallback as useCallback47, useRef as
|
|
47790
|
+
import { useCallback as useCallback47, useRef as useRef66, useEffect as useEffect80 } from "react";
|
|
47766
47791
|
|
|
47767
47792
|
// src/components/chat/utils/chunk-parser.ts
|
|
47768
47793
|
function normalizeToolCalls(raw) {
|
|
@@ -48417,14 +48442,14 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48417
48442
|
batchApprovalsEnabled = true,
|
|
48418
48443
|
isDirectMode = false
|
|
48419
48444
|
} = options;
|
|
48420
|
-
const accumulatorRef =
|
|
48445
|
+
const accumulatorRef = useRef66(
|
|
48421
48446
|
createMessageSegmentAccumulator({
|
|
48422
48447
|
onApprove: callbacks.onApprove,
|
|
48423
48448
|
onReject: callbacks.onReject
|
|
48424
48449
|
})
|
|
48425
48450
|
);
|
|
48426
|
-
const hasInitializedWithData =
|
|
48427
|
-
|
|
48451
|
+
const hasInitializedWithData = useRef66(false);
|
|
48452
|
+
useEffect80(() => {
|
|
48428
48453
|
if (initialState && !hasInitializedWithData.current) {
|
|
48429
48454
|
accumulatorRef.current.initializeWithState(initialState);
|
|
48430
48455
|
if (initialState.escalatedApprovals) {
|
|
@@ -48437,15 +48462,15 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48437
48462
|
hasInitializedWithData.current = true;
|
|
48438
48463
|
}
|
|
48439
48464
|
}, [initialState, callbacks]);
|
|
48440
|
-
const isInStreamRef =
|
|
48441
|
-
const hasEverStreamedRef =
|
|
48442
|
-
const directModeFlagRef =
|
|
48443
|
-
const sawDirectMessageRef =
|
|
48444
|
-
const directTeardownFiredRef =
|
|
48445
|
-
|
|
48465
|
+
const isInStreamRef = useRef66(false);
|
|
48466
|
+
const hasEverStreamedRef = useRef66(false);
|
|
48467
|
+
const directModeFlagRef = useRef66(isDirectMode);
|
|
48468
|
+
const sawDirectMessageRef = useRef66(false);
|
|
48469
|
+
const directTeardownFiredRef = useRef66(false);
|
|
48470
|
+
useEffect80(() => {
|
|
48446
48471
|
directModeFlagRef.current = isDirectMode;
|
|
48447
48472
|
}, [isDirectMode]);
|
|
48448
|
-
const pendingEscalatedRef =
|
|
48473
|
+
const pendingEscalatedRef = useRef66(/* @__PURE__ */ new Map());
|
|
48449
48474
|
const processChunk = useCallback47(
|
|
48450
48475
|
(chunk) => {
|
|
48451
48476
|
const action = parseChunkToAction(chunk);
|
|
@@ -48721,7 +48746,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48721
48746
|
}
|
|
48722
48747
|
|
|
48723
48748
|
// src/components/chat/hooks/use-slash-commands.ts
|
|
48724
|
-
import { useEffect as
|
|
48749
|
+
import { useEffect as useEffect81, useState as useState109 } from "react";
|
|
48725
48750
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
48726
48751
|
async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
48727
48752
|
try {
|
|
@@ -48740,7 +48765,7 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
48740
48765
|
function useSlashCommands(prefix, commandsUrl) {
|
|
48741
48766
|
const [commands, setCommands] = useState109([]);
|
|
48742
48767
|
const [loading, setLoading] = useState109(false);
|
|
48743
|
-
|
|
48768
|
+
useEffect81(() => {
|
|
48744
48769
|
if (prefix == null) {
|
|
48745
48770
|
setCommands([]);
|
|
48746
48771
|
return;
|
|
@@ -48846,7 +48871,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
48846
48871
|
}
|
|
48847
48872
|
|
|
48848
48873
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
48849
|
-
import { useCallback as useCallback48, useMemo as useMemo41, useRef as
|
|
48874
|
+
import { useCallback as useCallback48, useMemo as useMemo41, useRef as useRef67, useState as useState110 } from "react";
|
|
48850
48875
|
import { fileTypeFromBlob } from "file-type";
|
|
48851
48876
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
48852
48877
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -48923,7 +48948,7 @@ function useChatAttachments() {
|
|
|
48923
48948
|
const runtime = useRequiredChatRuntime();
|
|
48924
48949
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
48925
48950
|
const [attachments, setAttachments] = useState110([]);
|
|
48926
|
-
const controllersRef =
|
|
48951
|
+
const controllersRef = useRef67(/* @__PURE__ */ new Map());
|
|
48927
48952
|
const updateOne = useCallback48((id, patch) => {
|
|
48928
48953
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
48929
48954
|
}, []);
|
|
@@ -49012,7 +49037,7 @@ function useChatAttachments() {
|
|
|
49012
49037
|
},
|
|
49013
49038
|
[uploadUrlEndpoint, updateOne]
|
|
49014
49039
|
);
|
|
49015
|
-
const attachmentsRef =
|
|
49040
|
+
const attachmentsRef = useRef67([]);
|
|
49016
49041
|
attachmentsRef.current = attachments;
|
|
49017
49042
|
const addFiles = useCallback48(
|
|
49018
49043
|
(files) => {
|
|
@@ -49089,16 +49114,16 @@ function useChatAttachments() {
|
|
|
49089
49114
|
}
|
|
49090
49115
|
|
|
49091
49116
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
49092
|
-
import { useCallback as useCallback49, useEffect as
|
|
49117
|
+
import { useCallback as useCallback49, useEffect as useEffect82, useRef as useRef68, useState as useState111 } from "react";
|
|
49093
49118
|
import { jsx as jsx359 } from "react/jsx-runtime";
|
|
49094
49119
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
49095
49120
|
function useChatAttachmentImageGallery() {
|
|
49096
49121
|
const runtime = useRequiredChatRuntime();
|
|
49097
49122
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
49098
|
-
const panelRef =
|
|
49123
|
+
const panelRef = useRef68(null);
|
|
49099
49124
|
const [state, setState] = useState111(CLOSED);
|
|
49100
49125
|
const handleClose = useCallback49(() => setState(CLOSED), []);
|
|
49101
|
-
|
|
49126
|
+
useEffect82(() => {
|
|
49102
49127
|
const root = panelRef.current;
|
|
49103
49128
|
if (!root) return;
|
|
49104
49129
|
const onClick = (ev) => {
|
|
@@ -49144,7 +49169,7 @@ function absolutize(prefix) {
|
|
|
49144
49169
|
}
|
|
49145
49170
|
|
|
49146
49171
|
// src/components/chat/hooks/use-chat-identity.ts
|
|
49147
|
-
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as
|
|
49172
|
+
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as useEffect83, useState as useState112 } from "react";
|
|
49148
49173
|
var ANON_DEFAULTS = {
|
|
49149
49174
|
authTier: "anon",
|
|
49150
49175
|
source: null,
|
|
@@ -49157,7 +49182,7 @@ function useResolveChatIdentity(enabled) {
|
|
|
49157
49182
|
const proxyEmail = getEmbedProxyAuth()?.email ?? null;
|
|
49158
49183
|
const [data, setData] = useState112(ANON_DEFAULTS);
|
|
49159
49184
|
const [isLoading, setIsLoading] = useState112(enabled);
|
|
49160
|
-
|
|
49185
|
+
useEffect83(() => {
|
|
49161
49186
|
if (!enabled) return;
|
|
49162
49187
|
let cancelled = false;
|
|
49163
49188
|
const ctrl = new AbortController();
|
|
@@ -49199,11 +49224,11 @@ function useChatIdentity() {
|
|
|
49199
49224
|
}
|
|
49200
49225
|
|
|
49201
49226
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
49202
|
-
import { useEffect as
|
|
49227
|
+
import { useEffect as useEffect84, useRef as useRef69 } from "react";
|
|
49203
49228
|
function useCloseOnNavigation(close, pathname) {
|
|
49204
|
-
const prevPathnameRef =
|
|
49205
|
-
const initializedRef =
|
|
49206
|
-
|
|
49229
|
+
const prevPathnameRef = useRef69(null);
|
|
49230
|
+
const initializedRef = useRef69(false);
|
|
49231
|
+
useEffect84(() => {
|
|
49207
49232
|
if (!initializedRef.current) {
|
|
49208
49233
|
initializedRef.current = true;
|
|
49209
49234
|
prevPathnameRef.current = pathname;
|
|
@@ -49217,14 +49242,14 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
49217
49242
|
}
|
|
49218
49243
|
|
|
49219
49244
|
// src/components/chat/hooks/use-chat.ts
|
|
49220
|
-
import { useState as useState114, useCallback as useCallback51, useEffect as
|
|
49245
|
+
import { useState as useState114, useCallback as useCallback51, useEffect as useEffect85, useRef as useRef71 } from "react";
|
|
49221
49246
|
|
|
49222
49247
|
// src/components/chat/hooks/use-sse.ts
|
|
49223
|
-
import { useState as useState113, useCallback as useCallback50, useRef as
|
|
49248
|
+
import { useState as useState113, useCallback as useCallback50, useRef as useRef70 } from "react";
|
|
49224
49249
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
49225
49250
|
const [isStreaming, setIsStreaming] = useState113(false);
|
|
49226
49251
|
const [error, setError] = useState113(null);
|
|
49227
|
-
const abortControllerRef =
|
|
49252
|
+
const abortControllerRef = useRef70(null);
|
|
49228
49253
|
const fallbackStream = useCallback50(async function* () {
|
|
49229
49254
|
throw new Error(
|
|
49230
49255
|
"[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."
|
|
@@ -49292,10 +49317,10 @@ function useChat({
|
|
|
49292
49317
|
} = {}) {
|
|
49293
49318
|
const [messages, setMessages] = useState114(() => initialMessages ?? []);
|
|
49294
49319
|
const [isTyping, setIsTyping] = useState114(false);
|
|
49295
|
-
const currentAssistantSegmentsRef =
|
|
49296
|
-
const onMessagesChangeRef =
|
|
49320
|
+
const currentAssistantSegmentsRef = useRef71([]);
|
|
49321
|
+
const onMessagesChangeRef = useRef71(onMessagesChange);
|
|
49297
49322
|
onMessagesChangeRef.current = onMessagesChange;
|
|
49298
|
-
|
|
49323
|
+
useEffect85(() => {
|
|
49299
49324
|
onMessagesChangeRef.current?.(messages);
|
|
49300
49325
|
}, [messages]);
|
|
49301
49326
|
const {
|
|
@@ -49584,7 +49609,7 @@ function useChat({
|
|
|
49584
49609
|
}
|
|
49585
49610
|
|
|
49586
49611
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
49587
|
-
import { useState as useState115, useEffect as
|
|
49612
|
+
import { useState as useState115, useEffect as useEffect86, useCallback as useCallback52, useMemo as useMemo42, useRef as useRef72 } from "react";
|
|
49588
49613
|
function createEmptyTurnMeta() {
|
|
49589
49614
|
return {
|
|
49590
49615
|
provider: null,
|
|
@@ -49905,20 +49930,20 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
49905
49930
|
const runtime = useRequiredChatRuntime();
|
|
49906
49931
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
49907
49932
|
const tableIdForDocumentType = options?.tableIdForDocumentType ?? defaultTableIdForDocumentType;
|
|
49908
|
-
const persistedRef =
|
|
49933
|
+
const persistedRef = useRef72(null);
|
|
49909
49934
|
if (persistedRef.current === null) {
|
|
49910
49935
|
pruneStaleChatStorage(source);
|
|
49911
49936
|
persistedRef.current = loadPersistedChat(source) || { messages: [], sources: [], sendCount: 0 };
|
|
49912
49937
|
}
|
|
49913
|
-
const sourcesMapRef =
|
|
49938
|
+
const sourcesMapRef = useRef72(
|
|
49914
49939
|
new Map(persistedRef.current.sources)
|
|
49915
49940
|
);
|
|
49916
|
-
const refsMapRef =
|
|
49941
|
+
const refsMapRef = useRef72(
|
|
49917
49942
|
new Map(persistedRef.current.refs ?? [])
|
|
49918
49943
|
);
|
|
49919
|
-
const metaMapRef =
|
|
49920
|
-
const messagesRef =
|
|
49921
|
-
const sendCountRef =
|
|
49944
|
+
const metaMapRef = useRef72(/* @__PURE__ */ new Map());
|
|
49945
|
+
const messagesRef = useRef72(persistedRef.current.messages);
|
|
49946
|
+
const sendCountRef = useRef72(persistedRef.current.sendCount);
|
|
49922
49947
|
const [streamingPhase, setStreamingPhase] = useState115("idle");
|
|
49923
49948
|
const [metaTick, setMetaTick] = useState115(0);
|
|
49924
49949
|
const bumpMetaTick = useCallback52(() => setMetaTick((t) => t + 1), []);
|
|
@@ -50108,7 +50133,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
50108
50133
|
}
|
|
50109
50134
|
}
|
|
50110
50135
|
}, [chatClearMessages, source, bumpMetaTick]);
|
|
50111
|
-
|
|
50136
|
+
useEffect86(() => {
|
|
50112
50137
|
if (!isTyping && !isStreaming && streamingPhase !== "idle") {
|
|
50113
50138
|
setStreamingPhase("idle");
|
|
50114
50139
|
}
|
|
@@ -50190,9 +50215,9 @@ var noopRejectRequest = async (_id, _reason) => {
|
|
|
50190
50215
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
50191
50216
|
import {
|
|
50192
50217
|
useCallback as useCallback53,
|
|
50193
|
-
useEffect as
|
|
50218
|
+
useEffect as useEffect87,
|
|
50194
50219
|
useMemo as useMemo43,
|
|
50195
|
-
useRef as
|
|
50220
|
+
useRef as useRef73,
|
|
50196
50221
|
useState as useState116
|
|
50197
50222
|
} from "react";
|
|
50198
50223
|
|
|
@@ -50877,17 +50902,17 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50877
50902
|
const isManagedMode = fetchDialogs !== void 0;
|
|
50878
50903
|
const [internalDialogId, setInternalDialogId] = useState116(null);
|
|
50879
50904
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
50880
|
-
const currentDialogIdRef =
|
|
50905
|
+
const currentDialogIdRef = useRef73(dialogId);
|
|
50881
50906
|
currentDialogIdRef.current = dialogId;
|
|
50882
50907
|
const [messages, setMessages] = useState116([]);
|
|
50883
50908
|
const [streamingPhase, setStreamingPhase] = useState116("idle");
|
|
50884
|
-
const streamingPhaseRef =
|
|
50909
|
+
const streamingPhaseRef = useRef73(streamingPhase);
|
|
50885
50910
|
streamingPhaseRef.current = streamingPhase;
|
|
50886
|
-
const suppressAgentBusyRef =
|
|
50887
|
-
const adoptTrailingAssistantRef =
|
|
50888
|
-
const hasConnectedOnceRef =
|
|
50889
|
-
const seenParticipantSeqsRef =
|
|
50890
|
-
const pendingEchoTextsRef =
|
|
50911
|
+
const suppressAgentBusyRef = useRef73(0);
|
|
50912
|
+
const adoptTrailingAssistantRef = useRef73(false);
|
|
50913
|
+
const hasConnectedOnceRef = useRef73(false);
|
|
50914
|
+
const seenParticipantSeqsRef = useRef73(/* @__PURE__ */ new Set());
|
|
50915
|
+
const pendingEchoTextsRef = useRef73([]);
|
|
50891
50916
|
const [approvalStatuses, setApprovalStatuses] = useState116({});
|
|
50892
50917
|
const [dialogs, setDialogs] = useState116([]);
|
|
50893
50918
|
const [dialogsNextCursor, setDialogsNextCursor] = useState116(null);
|
|
@@ -50940,9 +50965,9 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50940
50965
|
},
|
|
50941
50966
|
[rejectRequestCallback]
|
|
50942
50967
|
);
|
|
50943
|
-
const handleApproveRef =
|
|
50968
|
+
const handleApproveRef = useRef73(handleApprove);
|
|
50944
50969
|
handleApproveRef.current = handleApprove;
|
|
50945
|
-
const handleRejectRef =
|
|
50970
|
+
const handleRejectRef = useRef73(handleReject);
|
|
50946
50971
|
handleRejectRef.current = handleReject;
|
|
50947
50972
|
const accumApprove = useCallback53((requestId) => {
|
|
50948
50973
|
if (!requestId) return;
|
|
@@ -50952,7 +50977,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50952
50977
|
if (!requestId) return;
|
|
50953
50978
|
return handleRejectRef.current(requestId);
|
|
50954
50979
|
}, []);
|
|
50955
|
-
const callbacksRef =
|
|
50980
|
+
const callbacksRef = useRef73({
|
|
50956
50981
|
onSegmentsUpdate: (segments, meta) => {
|
|
50957
50982
|
if (meta?.append && meta.isCompacting) {
|
|
50958
50983
|
setMessages((prev) => upsertTrailingCompaction(prev, segments));
|
|
@@ -51170,7 +51195,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51170
51195
|
onChunkReceived: (chunk) => processChunk(chunk),
|
|
51171
51196
|
fetchChunks
|
|
51172
51197
|
});
|
|
51173
|
-
const historyLoadSeqRef =
|
|
51198
|
+
const historyLoadSeqRef = useRef73(0);
|
|
51174
51199
|
const loadDialogHistory = useCallback53(
|
|
51175
51200
|
async (id, cursor) => {
|
|
51176
51201
|
if (!fetchDialogMessages) return;
|
|
@@ -51229,8 +51254,8 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51229
51254
|
isBufferingActive
|
|
51230
51255
|
]
|
|
51231
51256
|
);
|
|
51232
|
-
const prevDialogIdRef =
|
|
51233
|
-
|
|
51257
|
+
const prevDialogIdRef = useRef73(void 0);
|
|
51258
|
+
useEffect87(() => {
|
|
51234
51259
|
if (prevDialogIdRef.current === dialogId) return;
|
|
51235
51260
|
prevDialogIdRef.current = dialogId;
|
|
51236
51261
|
historyLoadSeqRef.current += 1;
|
|
@@ -51247,7 +51272,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51247
51272
|
if (!active || !dialogId) return;
|
|
51248
51273
|
void loadDialogHistory(dialogId);
|
|
51249
51274
|
}, [active, dialogId, loadDialogHistory, resetAccumulator]);
|
|
51250
|
-
|
|
51275
|
+
useEffect87(() => {
|
|
51251
51276
|
if (!active || !dialogId) return;
|
|
51252
51277
|
suppressAgentBusyRef.current += 1;
|
|
51253
51278
|
resetChunkTracking();
|
|
@@ -51299,14 +51324,14 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51299
51324
|
})();
|
|
51300
51325
|
}
|
|
51301
51326
|
});
|
|
51302
|
-
|
|
51327
|
+
useEffect87(() => {
|
|
51303
51328
|
if (!active || !dialogId) {
|
|
51304
51329
|
setConnectionState("connected");
|
|
51305
51330
|
return;
|
|
51306
51331
|
}
|
|
51307
51332
|
setConnectionState("connecting");
|
|
51308
51333
|
}, [active, dialogId]);
|
|
51309
|
-
const initialDialogsLoadedRef =
|
|
51334
|
+
const initialDialogsLoadedRef = useRef73(false);
|
|
51310
51335
|
const loadDialogsPage = useCallback53(
|
|
51311
51336
|
async (cursor) => {
|
|
51312
51337
|
if (!fetchDialogs) return;
|
|
@@ -51338,7 +51363,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51338
51363
|
const reloadDialogs = useCallback53(() => {
|
|
51339
51364
|
void loadDialogsPage();
|
|
51340
51365
|
}, [loadDialogsPage]);
|
|
51341
|
-
|
|
51366
|
+
useEffect87(() => {
|
|
51342
51367
|
if (!fetchDialogs) return;
|
|
51343
51368
|
if (!active) return;
|
|
51344
51369
|
if (initialDialogsLoadedRef.current) return;
|
|
@@ -51581,7 +51606,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51581
51606
|
}
|
|
51582
51607
|
|
|
51583
51608
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
51584
|
-
import { useCallback as useCallback54, useMemo as useMemo44, useRef as
|
|
51609
|
+
import { useCallback as useCallback54, useMemo as useMemo44, useRef as useRef74 } from "react";
|
|
51585
51610
|
var EMPTY_SSE_OPTIONS = {};
|
|
51586
51611
|
function createDisabledNatsConfig() {
|
|
51587
51612
|
return {
|
|
@@ -51596,7 +51621,7 @@ function createDisabledNatsConfig() {
|
|
|
51596
51621
|
}
|
|
51597
51622
|
function useUnifiedChat(options) {
|
|
51598
51623
|
const { modes, activeMode, mingoStateOverride } = options;
|
|
51599
|
-
const disabledNatsRef =
|
|
51624
|
+
const disabledNatsRef = useRef74(null);
|
|
51600
51625
|
if (disabledNatsRef.current === null) {
|
|
51601
51626
|
disabledNatsRef.current = createDisabledNatsConfig();
|
|
51602
51627
|
}
|
|
@@ -51610,7 +51635,7 @@ function useUnifiedChat(options) {
|
|
|
51610
51635
|
{ active: natsActive }
|
|
51611
51636
|
);
|
|
51612
51637
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
51613
|
-
const activeStateRef =
|
|
51638
|
+
const activeStateRef = useRef74(activeState);
|
|
51614
51639
|
activeStateRef.current = activeState;
|
|
51615
51640
|
const stopMessage = useCallback54(() => activeStateRef.current.stopMessage(), []);
|
|
51616
51641
|
const clearMessages = useCallback54(
|
|
@@ -51920,7 +51945,7 @@ function buildStreamFrames(messages) {
|
|
|
51920
51945
|
|
|
51921
51946
|
// src/components/chat/embeddable-chat.tsx
|
|
51922
51947
|
init_cn();
|
|
51923
|
-
import { useCallback as useCallback56, useEffect as
|
|
51948
|
+
import { useCallback as useCallback56, useEffect as useEffect88, useMemo as useMemo46, useRef as useRef76, useState as useState118 } from "react";
|
|
51924
51949
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
51925
51950
|
import { usePreventScroll as usePreventScroll6 } from "@react-aria/overlays";
|
|
51926
51951
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -52001,7 +52026,7 @@ init_button2();
|
|
|
52001
52026
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
52002
52027
|
|
|
52003
52028
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
52004
|
-
import { useCallback as useCallback55, useMemo as useMemo45, useRef as
|
|
52029
|
+
import { useCallback as useCallback55, useMemo as useMemo45, useRef as useRef75, useState as useState117 } from "react";
|
|
52005
52030
|
function useChatDialogManager({
|
|
52006
52031
|
dialogs,
|
|
52007
52032
|
activeDialogId,
|
|
@@ -52041,7 +52066,7 @@ function useChatDialogManager({
|
|
|
52041
52066
|
const [archivedCursor, setArchivedCursor] = useState117(null);
|
|
52042
52067
|
const [archivedLoading, setArchivedLoading] = useState117(false);
|
|
52043
52068
|
const [archivedPending, setArchivedPending] = useState117(false);
|
|
52044
|
-
const archivedRequestIdRef =
|
|
52069
|
+
const archivedRequestIdRef = useRef75(0);
|
|
52045
52070
|
const loadArchivedPage = useCallback55(
|
|
52046
52071
|
async (cursor) => {
|
|
52047
52072
|
if (!fetchArchivedDialogs) return;
|
|
@@ -52192,7 +52217,7 @@ var RAIL_ANIM_MS = 320;
|
|
|
52192
52217
|
function useRailPresence(open) {
|
|
52193
52218
|
const [mounted, setMounted] = useState118(open);
|
|
52194
52219
|
const [active, setActive] = useState118(false);
|
|
52195
|
-
|
|
52220
|
+
useEffect88(() => {
|
|
52196
52221
|
if (open) {
|
|
52197
52222
|
setMounted(true);
|
|
52198
52223
|
let raf2 = 0;
|
|
@@ -52517,7 +52542,7 @@ function EmbeddableChatInner({
|
|
|
52517
52542
|
const commandsUrl = runtime.endpoints.commandsUrl;
|
|
52518
52543
|
const { attachmentsEnabled, user: identityUser } = useChatIdentity();
|
|
52519
52544
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
52520
|
-
|
|
52545
|
+
useEffect88(() => {
|
|
52521
52546
|
if (process.env.NODE_ENV !== "production") {
|
|
52522
52547
|
const hasOpen = open !== void 0;
|
|
52523
52548
|
const hasHandler = onOpenChange !== void 0;
|
|
@@ -52538,8 +52563,8 @@ function EmbeddableChatInner({
|
|
|
52538
52563
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
52539
52564
|
});
|
|
52540
52565
|
usePreventScroll6({ isDisabled: !isOpen || shellLess });
|
|
52541
|
-
const navigatingAwayRef =
|
|
52542
|
-
|
|
52566
|
+
const navigatingAwayRef = useRef76(false);
|
|
52567
|
+
useEffect88(() => {
|
|
52543
52568
|
if (!isOpen) return;
|
|
52544
52569
|
if (shellLess) return;
|
|
52545
52570
|
if (typeof window === "undefined") return;
|
|
@@ -52565,7 +52590,7 @@ function EmbeddableChatInner({
|
|
|
52565
52590
|
window.scrollTo(0, scrollY);
|
|
52566
52591
|
};
|
|
52567
52592
|
}, [isOpen, shellLess]);
|
|
52568
|
-
const chatInputRef =
|
|
52593
|
+
const chatInputRef = useRef76(null);
|
|
52569
52594
|
const [quickActionPreview, setQuickActionPreview] = useState118(null);
|
|
52570
52595
|
const slashCommandsProp = useMemo46(
|
|
52571
52596
|
() => ({
|
|
@@ -52669,8 +52694,8 @@ function EmbeddableChatInner({
|
|
|
52669
52694
|
hasMoreMessages,
|
|
52670
52695
|
loadMoreMessages
|
|
52671
52696
|
} = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
|
|
52672
|
-
const guidePromptSentRef =
|
|
52673
|
-
|
|
52697
|
+
const guidePromptSentRef = useRef76(false);
|
|
52698
|
+
useEffect88(() => {
|
|
52674
52699
|
if (!guidePendingPrompt) {
|
|
52675
52700
|
guidePromptSentRef.current = false;
|
|
52676
52701
|
return;
|
|
@@ -52694,12 +52719,12 @@ function EmbeddableChatInner({
|
|
|
52694
52719
|
const [contextItems, setContextItems] = useState118([]);
|
|
52695
52720
|
const [contextPickerOpen, setContextPickerOpen] = useState118(false);
|
|
52696
52721
|
const [mentionQuery, setMentionQuery] = useState118(null);
|
|
52697
|
-
const mentionActiveRef =
|
|
52698
|
-
|
|
52722
|
+
const mentionActiveRef = useRef76(false);
|
|
52723
|
+
useEffect88(() => {
|
|
52699
52724
|
mentionActiveRef.current = mentionQuery !== null;
|
|
52700
52725
|
}, [mentionQuery]);
|
|
52701
|
-
const mentionKeysRef =
|
|
52702
|
-
|
|
52726
|
+
const mentionKeysRef = useRef76(/* @__PURE__ */ new Set());
|
|
52727
|
+
useEffect88(() => {
|
|
52703
52728
|
setContextItems([]);
|
|
52704
52729
|
setMentionQuery(null);
|
|
52705
52730
|
mentionKeysRef.current.clear();
|
|
@@ -52795,7 +52820,7 @@ function EmbeddableChatInner({
|
|
|
52795
52820
|
() => effectiveAssistantIcon ? /* @__PURE__ */ jsx362(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx362(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
52796
52821
|
[effectiveAssistantIcon]
|
|
52797
52822
|
);
|
|
52798
|
-
const timestampCacheRef =
|
|
52823
|
+
const timestampCacheRef = useRef76(/* @__PURE__ */ new Map());
|
|
52799
52824
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
52800
52825
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
52801
52826
|
const messages = useMemo46(() => {
|
|
@@ -52922,7 +52947,7 @@ function EmbeddableChatInner({
|
|
|
52922
52947
|
});
|
|
52923
52948
|
const handleOpen = useCallback56(() => setIsOpen(true), [setIsOpen]);
|
|
52924
52949
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
52925
|
-
|
|
52950
|
+
useEffect88(() => {
|
|
52926
52951
|
const handler = (e) => {
|
|
52927
52952
|
const detail = e.detail;
|
|
52928
52953
|
if (!detail || detail.source !== source) return;
|
|
@@ -52932,7 +52957,7 @@ function EmbeddableChatInner({
|
|
|
52932
52957
|
window.addEventListener("ask-ai:open-with-ref", handler);
|
|
52933
52958
|
return () => window.removeEventListener("ask-ai:open-with-ref", handler);
|
|
52934
52959
|
}, [source, discussRef, setIsOpen]);
|
|
52935
|
-
|
|
52960
|
+
useEffect88(() => {
|
|
52936
52961
|
const handler = (e) => {
|
|
52937
52962
|
const detail = e.detail;
|
|
52938
52963
|
if (!detail || detail.source !== source) return;
|
|
@@ -52949,7 +52974,7 @@ function EmbeddableChatInner({
|
|
|
52949
52974
|
const contentViewKey = hasConversation ? "conversation" : activeMode;
|
|
52950
52975
|
const isGuideEmpty = !hasConversation && activeMode === "guide";
|
|
52951
52976
|
const isQuickActionEmpty = !hasConversation && (activeMode === "guide" || activeMode === "mingo");
|
|
52952
|
-
|
|
52977
|
+
useEffect88(() => {
|
|
52953
52978
|
if (!isQuickActionEmpty) setQuickActionPreview(null);
|
|
52954
52979
|
}, [isQuickActionEmpty]);
|
|
52955
52980
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
@@ -52993,8 +53018,8 @@ function EmbeddableChatInner({
|
|
|
52993
53018
|
}, [lastAssistantMsg, chatLoading]);
|
|
52994
53019
|
const [portalHost, setPortalHost] = useState118(null);
|
|
52995
53020
|
const [panelWidth, setPanelWidth] = useState118(0);
|
|
52996
|
-
const panelMeasureRef =
|
|
52997
|
-
|
|
53021
|
+
const panelMeasureRef = useRef76(null);
|
|
53022
|
+
useEffect88(() => {
|
|
52998
53023
|
const el = panelMeasureRef.current;
|
|
52999
53024
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
53000
53025
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -53006,7 +53031,7 @@ function EmbeddableChatInner({
|
|
|
53006
53031
|
return () => ro.disconnect();
|
|
53007
53032
|
}, []);
|
|
53008
53033
|
const [railCollapsed, setRailCollapsed] = useState118(false);
|
|
53009
|
-
|
|
53034
|
+
useEffect88(() => {
|
|
53010
53035
|
try {
|
|
53011
53036
|
if (window.localStorage.getItem(RAIL_COLLAPSED_STORAGE_KEY) === "1")
|
|
53012
53037
|
setRailCollapsed(true);
|
|
@@ -53031,7 +53056,7 @@ function EmbeddableChatInner({
|
|
|
53031
53056
|
const railPresence = useRailPresence(splitActive);
|
|
53032
53057
|
const showWideHeader = wideMingo || railPresence.mounted;
|
|
53033
53058
|
const [composeOpen, setComposeOpen] = useState118(false);
|
|
53034
|
-
|
|
53059
|
+
useEffect88(() => {
|
|
53035
53060
|
if (hasConversation) setComposeOpen(false);
|
|
53036
53061
|
}, [hasConversation]);
|
|
53037
53062
|
const isMingoMode = activeMode === "mingo";
|
|
@@ -53779,6 +53804,11 @@ export {
|
|
|
53779
53804
|
VideoPlayBadge,
|
|
53780
53805
|
VideoUnmuteGlyph,
|
|
53781
53806
|
fetchPriorityProp,
|
|
53807
|
+
MUX_STREAM_ORIGIN,
|
|
53808
|
+
MUX_IMAGE_ORIGIN,
|
|
53809
|
+
saveDataEnabled,
|
|
53810
|
+
useVideoOriginPreconnect,
|
|
53811
|
+
useVideoWarmup,
|
|
53782
53812
|
extractYouTubeId,
|
|
53783
53813
|
Video2 as Video,
|
|
53784
53814
|
MediaCarousel,
|
|
@@ -53966,10 +53996,6 @@ export {
|
|
|
53966
53996
|
getProxiedImageUrl2,
|
|
53967
53997
|
WhatIShippedCard,
|
|
53968
53998
|
WhatIShippedCardSkeleton,
|
|
53969
|
-
MUX_STREAM_ORIGIN,
|
|
53970
|
-
MUX_IMAGE_ORIGIN,
|
|
53971
|
-
useVideoOriginPreconnect,
|
|
53972
|
-
useVideoWarmup,
|
|
53973
53999
|
RATIO_GRID_CLASS,
|
|
53974
54000
|
RATIO_TO_CSS_ASPECT,
|
|
53975
54001
|
RatioTabs,
|
|
@@ -54538,4 +54564,4 @@ export {
|
|
|
54538
54564
|
LogsList,
|
|
54539
54565
|
assets
|
|
54540
54566
|
};
|
|
54541
|
-
//# sourceMappingURL=chunk-
|
|
54567
|
+
//# sourceMappingURL=chunk-YCSNDUDE.js.map
|