@flamingo-stack/openframe-frontend-core 0.0.726 → 0.0.727
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-3XDVGHL4.js → chunk-33AFAVBF.js} +2 -2
- package/dist/{chunk-R3BOJNZI.cjs → chunk-3D2SCG2E.cjs} +16 -16
- package/dist/{chunk-RSE3MU4G.cjs → chunk-3N3QA47Y.cjs} +11 -11
- package/dist/{chunk-COFT3YPA.js → chunk-3Q7ZNY4B.js} +5 -5
- package/dist/{chunk-3UZET2G7.js → chunk-4FQ5ZICE.js} +2 -2
- package/dist/{chunk-Q2G7NVFH.cjs → chunk-AM2RHT3H.cjs} +280 -280
- package/dist/{chunk-NZYMMYWN.js → chunk-AU4WWLFP.js} +1 -1
- package/dist/{chunk-RVSNXG6J.cjs → chunk-BKTV3VOD.cjs} +483 -418
- package/dist/{chunk-4ND65E2B.cjs → chunk-BMOEUIFI.cjs} +35 -35
- package/dist/{chunk-JYJBL7GD.js → chunk-C6Y22J32.js} +1 -1
- package/dist/{chunk-DXDLCYCM.cjs → chunk-CGL3TJ2A.cjs} +3 -3
- package/dist/{chunk-SBPPM65Y.js → chunk-CIAAU44V.js} +257 -192
- package/dist/{chunk-X2PG6XWF.cjs → chunk-CNBGSWLN.cjs} +9 -9
- package/dist/{chunk-4VRHDFF2.js → chunk-FIKAJKPE.js} +1 -1
- package/dist/{chunk-MZ3TMXIX.cjs → chunk-FLCYWEEB.cjs} +3 -3
- package/dist/{chunk-YVWJ3TRY.js → chunk-GKJFSE72.js} +5 -5
- package/dist/{chunk-NLWIBA55.js → chunk-HVMH67Z7.js} +3 -3
- package/dist/{chunk-MQ3ZM7FJ.js → chunk-J274GOBJ.js} +1 -1
- package/dist/{chunk-5SWQ2ZU5.cjs → chunk-MAGVU2HZ.cjs} +26 -26
- package/dist/{chunk-VPABPC2M.cjs → chunk-MGVT5RT6.cjs} +29 -56
- package/dist/{chunk-C5KMQLJP.js → chunk-N27CSEDR.js} +1 -1
- package/dist/{chunk-MZY6LBM5.cjs → chunk-N2PHC6RX.cjs} +3 -3
- package/dist/{chunk-AZKVHJA5.js → chunk-NQRFGXDG.js} +2 -2
- package/dist/{chunk-XEIDJ6SL.cjs → chunk-QJVG5V46.cjs} +65 -65
- package/dist/{chunk-Z3VAFLYK.cjs → chunk-RZFTEUV4.cjs} +9 -9
- package/dist/{chunk-EHYAOIE4.cjs → chunk-U6HOC7JD.cjs} +8 -8
- package/dist/{chunk-SCTS3EMJ.js → chunk-URDJXB75.js} +3 -3
- package/dist/{chunk-MM66P4X4.js → chunk-VTXIY33G.js} +22 -49
- package/dist/{chunk-FMFCPX3R.cjs → chunk-WWJOQGSH.cjs} +33 -33
- package/dist/{chunk-VKR56R3U.js → chunk-WXL5G7WC.js} +3 -3
- package/dist/{cloud-tenants-NH7VE7KE.js → cloud-tenants-65EUPGVC.js} +2 -2
- package/dist/{cloud-tenants-5JTQ2ENQ.cjs → cloud-tenants-PT5QPWWU.cjs} +3 -3
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/assistant-ask-prompts.d.ts +34 -14
- package/dist/components/chat/assistant-ask-prompts.d.ts.map +1 -1
- package/dist/components/chat/hooks/index.d.ts +1 -1
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-ask-prompts.d.ts +34 -7
- package/dist/components/chat/hooks/use-ask-prompts.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -4
- package/dist/components/chat/index.js +3 -5
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/faq-ask-card.d.ts +8 -11
- package/dist/components/faq/faq-ask-card.d.ts.map +1 -1
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +71 -71
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +35 -37
- package/dist/components/index.js +14 -16
- package/dist/components/meeting-scheduler/index.cjs +19 -19
- package/dist/components/meeting-scheduler/index.js +2 -2
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/product-demo/index.cjs +6 -6
- package/dist/components/product-demo/index.js +6 -6
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/index.cjs +3 -5
- package/dist/components/ui/index.js +4 -6
- package/dist/{devices-OC7JEI6U.js → devices-J253LQNQ.js} +2 -2
- package/dist/{devices-PV76NGQO.cjs → devices-ZPVLATZA.cjs} +4 -4
- package/dist/index.cjs +7 -9
- package/dist/index.js +8 -10
- package/dist/{knowledge-5AYFIVKD.cjs → knowledge-3FAF5T7Q.cjs} +4 -4
- package/dist/{knowledge-L7WQ7IEP.js → knowledge-IMTMYURI.js} +2 -2
- package/dist/{logs-MGFHGVIE.js → logs-55GOSGVE.js} +2 -2
- package/dist/{logs-4F77RJXJ.cjs → logs-UL7BQEXP.cjs} +11 -11
- package/dist/{policies-WRDZFNIB.js → policies-KRDF563O.js} +2 -2
- package/dist/{policies-VCGM3C5Z.cjs → policies-O5F2XSCY.cjs} +7 -7
- package/dist/{software-update-WVG2GDZO.js → software-update-NXSC4OVM.js} +2 -2
- package/dist/{software-update-YD2MNL3K.cjs → software-update-R2ASCRWP.cjs} +6 -6
- package/package.json +1 -1
- package/src/components/chat/assistant-ask-prompts.tsx +84 -39
- package/src/components/chat/hooks/index.ts +3 -2
- package/src/components/chat/hooks/use-ask-prompts.ts +140 -56
- package/src/components/faq/faq-ask-card.tsx +22 -67
|
@@ -8892,11 +8892,8 @@ function AskCard({
|
|
|
8892
8892
|
);
|
|
8893
8893
|
}
|
|
8894
8894
|
|
|
8895
|
-
// src/components/chat/assistant-ask-prompts.tsx
|
|
8896
|
-
import { useMemo as useMemo9 } from "react";
|
|
8897
|
-
|
|
8898
8895
|
// src/components/chat/hooks/use-ask-prompts.ts
|
|
8899
|
-
import { useCallback as useCallback6, useId as useId2, useLayoutEffect as useLayoutEffect5, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
8896
|
+
import { useCallback as useCallback6, useId as useId2, useLayoutEffect as useLayoutEffect5, useMemo as useMemo9, useState as useState13, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
8900
8897
|
var ASK_PROMPTS_DEFAULT_COUNT = 3;
|
|
8901
8898
|
function buildAskPromptsUrl(base, { count, topic, exclude = [] }) {
|
|
8902
8899
|
const params = new URLSearchParams({ count: String(count) });
|
|
@@ -8916,8 +8913,9 @@ function useAskPrompts({
|
|
|
8916
8913
|
const assistant = useAssistantRuntime();
|
|
8917
8914
|
const base = assistantAvailable(assistant) ? assistant.askPromptsUrl : void 0;
|
|
8918
8915
|
const url = base && enabled ? buildAskPromptsUrl(base, { count, topic, exclude }) : null;
|
|
8919
|
-
const { data,
|
|
8920
|
-
|
|
8916
|
+
const { data, dataUrl, error } = useSelfFetch(url);
|
|
8917
|
+
const landed = url !== null && (dataUrl === url || error);
|
|
8918
|
+
return { prompts: landed ? data?.prompts ?? [] : [], isLoading: !!base && !landed, supported: !!base };
|
|
8921
8919
|
}
|
|
8922
8920
|
function useAssistantOpen(topic, onOpen) {
|
|
8923
8921
|
const assistant = useAssistantRuntime();
|
|
@@ -8933,90 +8931,158 @@ function useAssistantOpen(topic, onOpen) {
|
|
|
8933
8931
|
[onOpen, runtimeOpen, source, topic]
|
|
8934
8932
|
);
|
|
8935
8933
|
}
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
const bySurface = /* @__PURE__ */ new Map();
|
|
8934
|
+
function createAskQueue() {
|
|
8935
|
+
const entries = /* @__PURE__ */ new Map();
|
|
8939
8936
|
const listeners = /* @__PURE__ */ new Set();
|
|
8940
|
-
let
|
|
8937
|
+
let next = 0;
|
|
8941
8938
|
const publish = () => {
|
|
8942
|
-
const lists = [...bySurface.values()];
|
|
8943
|
-
const next = lists.some((list) => list === null) ? null : lists.flatMap((list) => list ?? []);
|
|
8944
|
-
const same = next === null ? snapshot === null : snapshot !== null && next.join(",") === snapshot.join(",");
|
|
8945
|
-
if (same) return;
|
|
8946
|
-
snapshot = next === null ? null : next.length > 0 ? next : NO_IDS;
|
|
8947
8939
|
for (const listener of listeners) listener();
|
|
8948
8940
|
};
|
|
8949
8941
|
return {
|
|
8950
|
-
|
|
8951
|
-
|
|
8942
|
+
enter(surface) {
|
|
8943
|
+
if (entries.has(surface)) return;
|
|
8944
|
+
entries.set(surface, { turn: next++, ids: null });
|
|
8952
8945
|
publish();
|
|
8953
8946
|
},
|
|
8954
|
-
|
|
8955
|
-
|
|
8947
|
+
settle(surface, ids) {
|
|
8948
|
+
const entry = entries.get(surface);
|
|
8949
|
+
if (!entry || (entry.ids?.join(",") ?? null) === (ids?.join(",") ?? null)) return;
|
|
8950
|
+
entry.ids = ids;
|
|
8956
8951
|
publish();
|
|
8957
8952
|
},
|
|
8953
|
+
leave(surface) {
|
|
8954
|
+
if (entries.delete(surface)) publish();
|
|
8955
|
+
},
|
|
8958
8956
|
subscribe(listener) {
|
|
8959
8957
|
listeners.add(listener);
|
|
8960
8958
|
return () => listeners.delete(listener);
|
|
8961
8959
|
},
|
|
8962
|
-
|
|
8960
|
+
turnOf(surface) {
|
|
8961
|
+
const own = entries.get(surface);
|
|
8962
|
+
if (!own) return null;
|
|
8963
|
+
const shown = [];
|
|
8964
|
+
for (const [other, entry] of entries) {
|
|
8965
|
+
if (other === surface) continue;
|
|
8966
|
+
if (entry.ids === null) {
|
|
8967
|
+
if (entry.turn < own.turn) return null;
|
|
8968
|
+
continue;
|
|
8969
|
+
}
|
|
8970
|
+
shown.push(...entry.ids);
|
|
8971
|
+
}
|
|
8972
|
+
return shown.join(",");
|
|
8973
|
+
}
|
|
8963
8974
|
};
|
|
8964
8975
|
}
|
|
8965
|
-
var
|
|
8966
|
-
function
|
|
8976
|
+
var askQueues = /* @__PURE__ */ new Map();
|
|
8977
|
+
function useAskQueue() {
|
|
8967
8978
|
const scope = useAssistantRuntime()?.askPromptsUrl ?? "";
|
|
8968
|
-
let
|
|
8969
|
-
if (!
|
|
8970
|
-
|
|
8971
|
-
|
|
8979
|
+
let queue = askQueues.get(scope);
|
|
8980
|
+
if (!queue) {
|
|
8981
|
+
queue = createAskQueue();
|
|
8982
|
+
askQueues.set(scope, queue);
|
|
8972
8983
|
}
|
|
8973
|
-
return
|
|
8984
|
+
return queue;
|
|
8974
8985
|
}
|
|
8975
|
-
function
|
|
8986
|
+
function useAskSurface({
|
|
8987
|
+
topic,
|
|
8988
|
+
count = ASK_PROMPTS_DEFAULT_COUNT,
|
|
8989
|
+
exclude,
|
|
8990
|
+
enabled = true,
|
|
8991
|
+
onOpen
|
|
8992
|
+
} = {}) {
|
|
8993
|
+
const assistant = useAssistantRuntime();
|
|
8976
8994
|
const surface = useId2();
|
|
8977
|
-
const
|
|
8978
|
-
const
|
|
8995
|
+
const queue = useAskQueue();
|
|
8996
|
+
const picks = assistantAvailable(assistant) && !!assistant.askPromptsUrl && enabled && exclude !== null;
|
|
8979
8997
|
useLayoutEffect5(() => {
|
|
8980
|
-
if (
|
|
8981
|
-
|
|
8982
|
-
return () =>
|
|
8983
|
-
}, [
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8998
|
+
if (!picks) return void 0;
|
|
8999
|
+
queue.enter(surface);
|
|
9000
|
+
return () => queue.leave(surface);
|
|
9001
|
+
}, [queue, surface, picks]);
|
|
9002
|
+
const turn = useSyncExternalStore2(
|
|
9003
|
+
queue.subscribe,
|
|
9004
|
+
() => queue.turnOf(surface),
|
|
9005
|
+
() => null
|
|
9006
|
+
);
|
|
9007
|
+
const [shownAtTurn, setShownAtTurn] = useState13(null);
|
|
9008
|
+
if (picks && turn !== null && shownAtTurn === null) setShownAtTurn(turn);
|
|
9009
|
+
const leftOut = useMemo9(() => exclude ?? (shownAtTurn ? shownAtTurn.split(",") : void 0), [exclude, shownAtTurn]);
|
|
9010
|
+
const { prompts, isLoading, supported } = useAskPrompts({
|
|
9011
|
+
topic,
|
|
9012
|
+
count,
|
|
9013
|
+
exclude: leftOut,
|
|
9014
|
+
// Told exactly what to leave out, a surface needs nobody's pick: it never waits for a turn.
|
|
9015
|
+
enabled: picks && (exclude !== void 0 || shownAtTurn !== null)
|
|
9016
|
+
});
|
|
9017
|
+
const settled = picks && !isLoading ? prompts.map((prompt) => prompt.id).join(",") : null;
|
|
9018
|
+
useLayoutEffect5(() => {
|
|
9019
|
+
queue.settle(surface, settled === null ? null : settled ? settled.split(",") : []);
|
|
9020
|
+
}, [queue, surface, settled]);
|
|
9021
|
+
const open = useAssistantOpen(topic, onOpen);
|
|
9022
|
+
const scoped = useMemo9(() => assistant ? { ...assistant, open } : null, [assistant, open]);
|
|
9023
|
+
const onAsk = assistant?.onAsk;
|
|
9024
|
+
const reportAsk = useCallback6((prompt) => onAsk?.({ promptId: prompt.id, topic }), [onAsk, topic]);
|
|
9025
|
+
return { assistant, scoped, prompts, isLoading: supported && (!picks || isLoading), supported, open, reportAsk };
|
|
8988
9026
|
}
|
|
8989
9027
|
|
|
8990
9028
|
// src/components/chat/assistant-ask-prompts.tsx
|
|
8991
9029
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
9030
|
+
var DEFAULT_ASK_CARD = {
|
|
9031
|
+
title: "Still deciding?",
|
|
9032
|
+
description: "{assistant} answers from our docs and customer stories."
|
|
9033
|
+
};
|
|
9034
|
+
var fillAssistant = (text2, name) => text2.split("{assistant}").join(name);
|
|
8992
9035
|
function AssistantAskPrompts({
|
|
9036
|
+
variant = "row",
|
|
8993
9037
|
topic,
|
|
8994
|
-
count
|
|
9038
|
+
count,
|
|
9039
|
+
exclude,
|
|
9040
|
+
enabled,
|
|
8995
9041
|
label,
|
|
8996
9042
|
loading = false,
|
|
9043
|
+
title,
|
|
9044
|
+
description,
|
|
8997
9045
|
onOpen,
|
|
8998
9046
|
align,
|
|
8999
9047
|
fadeColor,
|
|
9000
9048
|
className
|
|
9001
9049
|
}) {
|
|
9050
|
+
const card = variant === "card";
|
|
9002
9051
|
const assistant = useAssistantRuntime();
|
|
9003
|
-
const
|
|
9004
|
-
const
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9052
|
+
const slots = count ?? (card ? assistant?.askCard?.count : void 0) ?? ASK_PROMPTS_DEFAULT_COUNT;
|
|
9053
|
+
const ask = useAskSurface({ topic, count: slots, exclude, enabled, onOpen });
|
|
9054
|
+
if (!assistantAvailable(assistant)) return null;
|
|
9055
|
+
const shared = {
|
|
9056
|
+
prompts: ask.prompts,
|
|
9057
|
+
loading: ask.isLoading || loading,
|
|
9058
|
+
source: assistant.source,
|
|
9059
|
+
icon: assistant.icon,
|
|
9060
|
+
onOpen: ask.open,
|
|
9061
|
+
onAsk: ask.reportAsk
|
|
9062
|
+
};
|
|
9063
|
+
if (card) {
|
|
9064
|
+
const name = label ?? assistant.name;
|
|
9065
|
+
if (!name) return null;
|
|
9066
|
+
const words2 = description ?? assistant.askCard?.description ?? DEFAULT_ASK_CARD.description;
|
|
9067
|
+
return /* @__PURE__ */ jsx30(AssistantRuntimeContext.Provider, { value: ask.scoped, children: /* @__PURE__ */ jsx30(
|
|
9068
|
+
AskCard,
|
|
9069
|
+
{
|
|
9070
|
+
...shared,
|
|
9071
|
+
title: fillAssistant(title ?? assistant.askCard?.title ?? DEFAULT_ASK_CARD.title, name),
|
|
9072
|
+
description: words2 ? fillAssistant(words2, name) : void 0,
|
|
9073
|
+
count: ask.supported ? slots : 0,
|
|
9074
|
+
label: name,
|
|
9075
|
+
className
|
|
9076
|
+
}
|
|
9077
|
+
) });
|
|
9078
|
+
}
|
|
9079
|
+
if (!ask.supported) return null;
|
|
9080
|
+
return /* @__PURE__ */ jsx30(AssistantRuntimeContext.Provider, { value: ask.scoped, children: /* @__PURE__ */ jsx30(
|
|
9010
9081
|
AskPrompts,
|
|
9011
9082
|
{
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
count,
|
|
9015
|
-
source: assistant.source,
|
|
9083
|
+
...shared,
|
|
9084
|
+
count: slots,
|
|
9016
9085
|
label: label ?? assistant.name ?? void 0,
|
|
9017
|
-
icon: assistant.icon,
|
|
9018
|
-
onOpen: open,
|
|
9019
|
-
onAsk: (prompt) => assistant.onAsk?.({ promptId: prompt.id, topic }),
|
|
9020
9086
|
align,
|
|
9021
9087
|
fadeColor,
|
|
9022
9088
|
className
|
|
@@ -9028,7 +9094,7 @@ function AssistantAskPrompts({
|
|
|
9028
9094
|
import { useMemo as useMemo12 } from "react";
|
|
9029
9095
|
|
|
9030
9096
|
// src/components/chat/quick-action-wall.tsx
|
|
9031
|
-
import { useRef as useRef8, useState as
|
|
9097
|
+
import { useRef as useRef8, useState as useState15, useEffect as useEffect9, useMemo as useMemo11 } from "react";
|
|
9032
9098
|
|
|
9033
9099
|
// src/components/ui/marquee-wall.tsx
|
|
9034
9100
|
import {
|
|
@@ -9037,7 +9103,7 @@ import {
|
|
|
9037
9103
|
useLayoutEffect as useLayoutEffect6,
|
|
9038
9104
|
useMemo as useMemo10,
|
|
9039
9105
|
useRef as useRef7,
|
|
9040
|
-
useState as
|
|
9106
|
+
useState as useState14,
|
|
9041
9107
|
useSyncExternalStore as useSyncExternalStore3
|
|
9042
9108
|
} from "react";
|
|
9043
9109
|
import { Fragment as Fragment11, jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
@@ -9088,7 +9154,7 @@ var subscribeNever = () => () => {
|
|
|
9088
9154
|
};
|
|
9089
9155
|
var alwaysDriver = () => true;
|
|
9090
9156
|
function useMarqueeSync() {
|
|
9091
|
-
const [controller] =
|
|
9157
|
+
const [controller] = useState14(createMarqueeSyncController);
|
|
9092
9158
|
return controller;
|
|
9093
9159
|
}
|
|
9094
9160
|
var MARQUEE_TRACK_OFFSETS = /* @__PURE__ */ new Map();
|
|
@@ -9176,7 +9242,7 @@ function MarqueeWall({
|
|
|
9176
9242
|
const trackRef = useRef7(null);
|
|
9177
9243
|
const copyRef = useRef7(null);
|
|
9178
9244
|
const reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)") ?? false;
|
|
9179
|
-
const [overflows, setOverflows] =
|
|
9245
|
+
const [overflows, setOverflows] = useState14(false);
|
|
9180
9246
|
const copySizeRef = useRef7(0);
|
|
9181
9247
|
const wrapSizeRef = useRef7(0);
|
|
9182
9248
|
const measure = useCallback7(() => {
|
|
@@ -9262,7 +9328,7 @@ function MarqueeWall({
|
|
|
9262
9328
|
useEffect8(() => {
|
|
9263
9329
|
applyTransformRef.current = applyTransform;
|
|
9264
9330
|
});
|
|
9265
|
-
const [member] =
|
|
9331
|
+
const [member] = useState14(() => ({
|
|
9266
9332
|
apply: (pos) => {
|
|
9267
9333
|
applyTransformRef.current(pos);
|
|
9268
9334
|
}
|
|
@@ -9464,8 +9530,8 @@ function QuickActionWall({
|
|
|
9464
9530
|
sync
|
|
9465
9531
|
}) {
|
|
9466
9532
|
const brickRef = useRef8(null);
|
|
9467
|
-
const [brickWidth, setBrickWidth] =
|
|
9468
|
-
const [chipWidth, setChipWidth] =
|
|
9533
|
+
const [brickWidth, setBrickWidth] = useState15(0);
|
|
9534
|
+
const [chipWidth, setChipWidth] = useState15(0);
|
|
9469
9535
|
useEffect9(() => {
|
|
9470
9536
|
const el = brickRef.current;
|
|
9471
9537
|
if (!el) return void 0;
|
|
@@ -9832,10 +9898,10 @@ function MingoOnboardingListSkeleton({ rows = 6, className }) {
|
|
|
9832
9898
|
}
|
|
9833
9899
|
|
|
9834
9900
|
// src/components/chat/mingo-welcome.tsx
|
|
9835
|
-
import { useCallback as useCallback8, useMemo as useMemo14, useState as
|
|
9901
|
+
import { useCallback as useCallback8, useMemo as useMemo14, useState as useState17 } from "react";
|
|
9836
9902
|
|
|
9837
9903
|
// src/components/chat/mingo-chat-history.tsx
|
|
9838
|
-
import { useState as
|
|
9904
|
+
import { useState as useState16, useMemo as useMemo13, useRef as useRef9, useEffect as useEffect10 } from "react";
|
|
9839
9905
|
|
|
9840
9906
|
// src/components/chat/chat-dialog-menu-items.tsx
|
|
9841
9907
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
@@ -9936,7 +10002,7 @@ function MingoChatHistoryRow({
|
|
|
9936
10002
|
const hasMenu = !!onRequestRename || !!onRequestArchive || !!onRequestCopyLink || !!onRequestCompact;
|
|
9937
10003
|
const owner = dialog.owner;
|
|
9938
10004
|
const hasAvatar = !!(owner?.name || owner?.avatarUrl);
|
|
9939
|
-
const [menuOpen, setMenuOpen] =
|
|
10005
|
+
const [menuOpen, setMenuOpen] = useState16(false);
|
|
9940
10006
|
const menuItems = chatDialogMenuItems({
|
|
9941
10007
|
onCopyLink: onRequestCopyLink && (() => onRequestCopyLink(dialog)),
|
|
9942
10008
|
onRename: onRequestRename && (() => onRequestRename(dialog)),
|
|
@@ -10194,7 +10260,7 @@ function MingoWelcome({
|
|
|
10194
10260
|
const heading = title ?? "Hey, I'm Mingo";
|
|
10195
10261
|
const resolvedPromo = hasExistingChats ? null : promo === void 0 ? onStartGuideChat ? DEFAULT_PROMO : null : promo;
|
|
10196
10262
|
const hydrated = useIsHydrated();
|
|
10197
|
-
const [dismissedThisSession, setPromoDismissed] =
|
|
10263
|
+
const [dismissedThisSession, setPromoDismissed] = useState17(false);
|
|
10198
10264
|
const storedDismissed = useMemo14(() => {
|
|
10199
10265
|
if (!hydrated || !resolvedPromo) return false;
|
|
10200
10266
|
try {
|
|
@@ -10695,10 +10761,10 @@ function MingoChatHeader({
|
|
|
10695
10761
|
}
|
|
10696
10762
|
|
|
10697
10763
|
// src/components/chat/mingo-chat-rail.tsx
|
|
10698
|
-
import { useEffect as useEffect13, useRef as useRef12, useState as
|
|
10764
|
+
import { useEffect as useEffect13, useRef as useRef12, useState as useState19 } from "react";
|
|
10699
10765
|
|
|
10700
10766
|
// src/components/chat/chat-header-search-field.tsx
|
|
10701
|
-
import { useState as
|
|
10767
|
+
import { useState as useState18, useRef as useRef11, useEffect as useEffect12, useCallback as useCallback9 } from "react";
|
|
10702
10768
|
import { jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10703
10769
|
function ChatHeaderSearchField({
|
|
10704
10770
|
initialValue,
|
|
@@ -10707,10 +10773,10 @@ function ChatHeaderSearchField({
|
|
|
10707
10773
|
autoFocus = true,
|
|
10708
10774
|
className
|
|
10709
10775
|
}) {
|
|
10710
|
-
const [value, setValue] =
|
|
10776
|
+
const [value, setValue] = useState18(initialValue ?? "");
|
|
10711
10777
|
const debounced = useDebounce(value, 300);
|
|
10712
10778
|
const lastEmitted = useRef11(initialValue ?? "");
|
|
10713
|
-
const [exiting, setExiting] =
|
|
10779
|
+
const [exiting, setExiting] = useState18(false);
|
|
10714
10780
|
const collapsedRef = useRef11(false);
|
|
10715
10781
|
useEffect12(() => {
|
|
10716
10782
|
if (exiting) return;
|
|
@@ -10831,7 +10897,7 @@ function MingoChatRail({
|
|
|
10831
10897
|
onExpand,
|
|
10832
10898
|
className
|
|
10833
10899
|
}) {
|
|
10834
|
-
const [searchOpen, setSearchOpen] =
|
|
10900
|
+
const [searchOpen, setSearchOpen] = useState19(!!searchQuery?.trim());
|
|
10835
10901
|
const hasSearch = !!searchQuery?.trim();
|
|
10836
10902
|
const items = [];
|
|
10837
10903
|
if (onNewChat) items.push({ id: "new", label: "Start New Chat", icon: /* @__PURE__ */ jsx48(ChatPlusIcon, {}), onClick: onNewChat });
|
|
@@ -11002,7 +11068,7 @@ function MingoChatRail({
|
|
|
11002
11068
|
);
|
|
11003
11069
|
}
|
|
11004
11070
|
function MingoChatRailRow({ dialog, active, status, onSelect, menuItems }) {
|
|
11005
|
-
const [menuOpen, setMenuOpen] =
|
|
11071
|
+
const [menuOpen, setMenuOpen] = useState19(false);
|
|
11006
11072
|
const hasMenu = menuItems.length > 0;
|
|
11007
11073
|
const glyph = status ? STATUS_GLYPHS[status] : void 0;
|
|
11008
11074
|
const title = dialog.title || "Untitled Chat";
|
|
@@ -11218,15 +11284,15 @@ function MingoHistoryRail({
|
|
|
11218
11284
|
}
|
|
11219
11285
|
|
|
11220
11286
|
// src/components/chat/mingo-chat-modals.tsx
|
|
11221
|
-
import { useState as
|
|
11287
|
+
import { useState as useState20 } from "react";
|
|
11222
11288
|
import { Fragment as Fragment15, jsx as jsx51, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
11223
11289
|
var footerBtn = "flex-1 min-w-0 rounded-md px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)] text-h3 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ods-accent disabled:opacity-50 disabled:cursor-not-allowed";
|
|
11224
11290
|
var cancelBtn = cn(footerBtn, "border border-ods-border bg-transparent text-ods-text-primary hover:bg-ods-bg-hover");
|
|
11225
11291
|
var saveBtn = cn(footerBtn, "bg-ods-accent text-ods-text-on-accent hover:bg-ods-accent-hover");
|
|
11226
11292
|
var dangerBtn = cn(footerBtn, "bg-ods-error text-ods-text-on-accent hover:opacity-90");
|
|
11227
11293
|
function RenameChatModal({ isOpen, initialName = "", onClose, onSave }) {
|
|
11228
|
-
const [name, setName] =
|
|
11229
|
-
const [seededWith, setSeededWith] =
|
|
11294
|
+
const [name, setName] = useState20(initialName);
|
|
11295
|
+
const [seededWith, setSeededWith] = useState20({ isOpen, initialName });
|
|
11230
11296
|
if (seededWith.isOpen !== isOpen || seededWith.initialName !== initialName) {
|
|
11231
11297
|
setSeededWith({ isOpen, initialName });
|
|
11232
11298
|
if (isOpen) setName(initialName);
|
|
@@ -11659,7 +11725,7 @@ function useObjectUrl(file) {
|
|
|
11659
11725
|
}
|
|
11660
11726
|
|
|
11661
11727
|
// src/components/chat/chat-context-memory-bar.tsx
|
|
11662
|
-
import { useEffect as useEffect15, useRef as useRef14, useState as
|
|
11728
|
+
import { useEffect as useEffect15, useRef as useRef14, useState as useState21 } from "react";
|
|
11663
11729
|
import { jsx as jsx55, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
11664
11730
|
var itemKey3 = (item) => `${item.type}:${item.id}`;
|
|
11665
11731
|
function ChatContextMemoryBar({
|
|
@@ -11669,7 +11735,7 @@ function ChatContextMemoryBar({
|
|
|
11669
11735
|
disabled = false,
|
|
11670
11736
|
className
|
|
11671
11737
|
}) {
|
|
11672
|
-
const [open, setOpen] =
|
|
11738
|
+
const [open, setOpen] = useState21(false);
|
|
11673
11739
|
const rootRef = useRef14(null);
|
|
11674
11740
|
if (items.length === 0 && open) setOpen(false);
|
|
11675
11741
|
useEffect15(() => {
|
|
@@ -12416,7 +12482,7 @@ var ChatTopNavigation = forwardRef22(
|
|
|
12416
12482
|
ChatTopNavigation.displayName = "ChatTopNavigation";
|
|
12417
12483
|
|
|
12418
12484
|
// src/components/chat/onboarding-carousel.tsx
|
|
12419
|
-
import { useState as
|
|
12485
|
+
import { useState as useState22 } from "react";
|
|
12420
12486
|
import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
12421
12487
|
function OnboardingCarousel({
|
|
12422
12488
|
steps,
|
|
@@ -12427,7 +12493,7 @@ function OnboardingCarousel({
|
|
|
12427
12493
|
label = "Introduction",
|
|
12428
12494
|
className
|
|
12429
12495
|
}) {
|
|
12430
|
-
const [index, setIndex] =
|
|
12496
|
+
const [index, setIndex] = useState22(0);
|
|
12431
12497
|
const lastIndex = steps.length - 1;
|
|
12432
12498
|
const isFirst = index === 0;
|
|
12433
12499
|
const isLast = index === lastIndex;
|
|
@@ -12859,7 +12925,7 @@ function useCaptions() {
|
|
|
12859
12925
|
}
|
|
12860
12926
|
|
|
12861
12927
|
// src/components/features/video-bites-strip.tsx
|
|
12862
|
-
import { useMemo as useMemo20, useRef as useRef17, useState as
|
|
12928
|
+
import { useMemo as useMemo20, useRef as useRef17, useState as useState24 } from "react";
|
|
12863
12929
|
|
|
12864
12930
|
// src/components/user-display.tsx
|
|
12865
12931
|
import { jsx as jsx67, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
@@ -12927,7 +12993,7 @@ function CardHitLayer({
|
|
|
12927
12993
|
}
|
|
12928
12994
|
|
|
12929
12995
|
// src/components/features/cards-strip.tsx
|
|
12930
|
-
import React3, { useCallback as useCallback11, useEffect as useEffect17, useMemo as useMemo19, useRef as useRef16, useState as
|
|
12996
|
+
import React3, { useCallback as useCallback11, useEffect as useEffect17, useMemo as useMemo19, useRef as useRef16, useState as useState23 } from "react";
|
|
12931
12997
|
import { Fragment as Fragment21, jsx as jsx69, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
12932
12998
|
var TRACK_GAP_PX = 16;
|
|
12933
12999
|
var CHEVRON_SUPPRESS_MS = 4e3;
|
|
@@ -13044,9 +13110,9 @@ function CardsStrip(props) {
|
|
|
13044
13110
|
const wrapperRef = useRef16(null);
|
|
13045
13111
|
const scrollerRef = useRef16(null);
|
|
13046
13112
|
const trackRef = useRef16(null);
|
|
13047
|
-
const [reducedMotion, setReducedMotion] =
|
|
13048
|
-
const [isTouch, setIsTouch] =
|
|
13049
|
-
const [isMobile, setIsMobile] =
|
|
13113
|
+
const [reducedMotion, setReducedMotion] = useState23(false);
|
|
13114
|
+
const [isTouch, setIsTouch] = useState23(false);
|
|
13115
|
+
const [isMobile, setIsMobile] = useState23(false);
|
|
13050
13116
|
useEffect17(() => {
|
|
13051
13117
|
const subs = [];
|
|
13052
13118
|
const watch = (query, set) => {
|
|
@@ -13065,11 +13131,11 @@ function CardsStrip(props) {
|
|
|
13065
13131
|
});
|
|
13066
13132
|
};
|
|
13067
13133
|
}, []);
|
|
13068
|
-
const [overflows, setOverflows] =
|
|
13069
|
-
const [marqueeEligible, setMarqueeEligible] =
|
|
13134
|
+
const [overflows, setOverflows] = useState23(false);
|
|
13135
|
+
const [marqueeEligible, setMarqueeEligible] = useState23(false);
|
|
13070
13136
|
const singleCopyWidthRef = useRef16(0);
|
|
13071
13137
|
const marqueeActive = autoScroll && !reducedMotion && marqueeEligible && items.length > 0;
|
|
13072
|
-
const [insets, setInsets] =
|
|
13138
|
+
const [insets, setInsets] = useState23(NO_BLEED);
|
|
13073
13139
|
const measure = useCallback11(() => {
|
|
13074
13140
|
const wrapper = wrapperRef.current;
|
|
13075
13141
|
const track = trackRef.current;
|
|
@@ -13106,7 +13172,7 @@ function CardsStrip(props) {
|
|
|
13106
13172
|
return () => observe(null);
|
|
13107
13173
|
}, [observe]);
|
|
13108
13174
|
const autoplay = useAutoplay(nearViewport);
|
|
13109
|
-
const [activeKey, setActiveKey] =
|
|
13175
|
+
const [activeKey, setActiveKey] = useState23(null);
|
|
13110
13176
|
const activeKeyRef = useRef16(null);
|
|
13111
13177
|
const activate = useCallback11((key) => {
|
|
13112
13178
|
activeKeyRef.current = key;
|
|
@@ -13189,7 +13255,7 @@ function CardsStrip(props) {
|
|
|
13189
13255
|
readBack: () => mirror(scrollerRef.current?.scrollLeft ?? 0),
|
|
13190
13256
|
onAfterFrame: syncHoverIfScrolled
|
|
13191
13257
|
});
|
|
13192
|
-
const [mountedIdx, setMountedIdx] =
|
|
13258
|
+
const [mountedIdx, setMountedIdx] = useState23(() => /* @__PURE__ */ new Set());
|
|
13193
13259
|
const cardObserverRef = useRef16(null);
|
|
13194
13260
|
const cardElIdxRef = useRef16(/* @__PURE__ */ new Map());
|
|
13195
13261
|
const cardElNearRef = useRef16(/* @__PURE__ */ new Map());
|
|
@@ -13226,7 +13292,7 @@ function CardsStrip(props) {
|
|
|
13226
13292
|
cardObserverRef.current = null;
|
|
13227
13293
|
};
|
|
13228
13294
|
}, []);
|
|
13229
|
-
const [cardRefFns] =
|
|
13295
|
+
const [cardRefFns] = useState23(() => /* @__PURE__ */ new Map());
|
|
13230
13296
|
const getCardRef = useCallback11(
|
|
13231
13297
|
(idx) => {
|
|
13232
13298
|
let fn = cardRefFns.get(idx);
|
|
@@ -13558,7 +13624,7 @@ function VideoBiteCard({
|
|
|
13558
13624
|
const hasTarget = !!(targetHref || bite.onNavigate || onBiteNavigate);
|
|
13559
13625
|
const key = cardKey ?? `${bite.url}__${index}`;
|
|
13560
13626
|
const controlled = active !== void 0;
|
|
13561
|
-
const [selfActive, setSelfActive] =
|
|
13627
|
+
const [selfActive, setSelfActive] = useState24(false);
|
|
13562
13628
|
const isActive = controlled ? !!active : selfActive;
|
|
13563
13629
|
const activate = () => controlled ? onActivate?.(key) : setSelfActive(true);
|
|
13564
13630
|
const deactivate = () => controlled ? onDeactivate?.(key) : setSelfActive(false);
|
|
@@ -16695,15 +16761,15 @@ function useChunkCatchup({
|
|
|
16695
16761
|
}
|
|
16696
16762
|
|
|
16697
16763
|
// src/components/chat/hooks/use-scripted-stream.ts
|
|
16698
|
-
import { useEffect as useEffect19, useState as
|
|
16764
|
+
import { useEffect as useEffect19, useState as useState25 } from "react";
|
|
16699
16765
|
var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
|
|
16700
16766
|
function prefersReducedMotion() {
|
|
16701
16767
|
return typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
|
|
16702
16768
|
}
|
|
16703
16769
|
function useScriptedStream(frames, resetKey, enabled = true) {
|
|
16704
|
-
const [index, setIndex] =
|
|
16705
|
-
const [reducedMotion, setReducedMotion] =
|
|
16706
|
-
const [prevKey, setPrevKey] =
|
|
16770
|
+
const [index, setIndex] = useState25(0);
|
|
16771
|
+
const [reducedMotion, setReducedMotion] = useState25(false);
|
|
16772
|
+
const [prevKey, setPrevKey] = useState25(resetKey);
|
|
16707
16773
|
if (resetKey !== prevKey) {
|
|
16708
16774
|
setPrevKey(resetKey);
|
|
16709
16775
|
setIndex(0);
|
|
@@ -16730,7 +16796,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
16730
16796
|
}
|
|
16731
16797
|
|
|
16732
16798
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
16733
|
-
import { useCallback as useCallback13, useEffect as useEffect20, useRef as useRef19, useState as
|
|
16799
|
+
import { useCallback as useCallback13, useEffect as useEffect20, useRef as useRef19, useState as useState26 } from "react";
|
|
16734
16800
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
16735
16801
|
var RESYNC_AFTER_HIDDEN_MS = 1e4;
|
|
16736
16802
|
var RESYNC_COALESCE_MS = 1e3;
|
|
@@ -16752,11 +16818,11 @@ function useJetStreamDialogSubscription({
|
|
|
16752
16818
|
inactiveThresholdMs,
|
|
16753
16819
|
resyncSignal = 0
|
|
16754
16820
|
}) {
|
|
16755
|
-
const [isConnected, setIsConnected] =
|
|
16756
|
-
const [subscriptionLive, setIsSubscribed] =
|
|
16757
|
-
const [reconnectionCount, setReconnectionCount] =
|
|
16758
|
-
const [recoveryCount, setRecoveryCount] =
|
|
16759
|
-
const [seqEntry, setSeqEntry] =
|
|
16821
|
+
const [isConnected, setIsConnected] = useState26(false);
|
|
16822
|
+
const [subscriptionLive, setIsSubscribed] = useState26(false);
|
|
16823
|
+
const [reconnectionCount, setReconnectionCount] = useState26(0);
|
|
16824
|
+
const [recoveryCount, setRecoveryCount] = useState26(0);
|
|
16825
|
+
const [seqEntry, setSeqEntry] = useState26(null);
|
|
16760
16826
|
const currentStreamSeq = seqEntry && seqEntry.dialogId === dialogId ? seqEntry.seq : null;
|
|
16761
16827
|
const isSubscribed = subscriptionLive && enabled && Boolean(dialogId) && isConnected;
|
|
16762
16828
|
const lastRecoveryReportRef = useRef19(0);
|
|
@@ -17032,7 +17098,7 @@ function useJetStreamDialogSubscription({
|
|
|
17032
17098
|
}
|
|
17033
17099
|
|
|
17034
17100
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
17035
|
-
import { useEffect as useEffect21, useRef as useRef20, useState as
|
|
17101
|
+
import { useEffect as useEffect21, useRef as useRef20, useState as useState27 } from "react";
|
|
17036
17102
|
function useNatsDialogSubscription({
|
|
17037
17103
|
enabled,
|
|
17038
17104
|
dialogId,
|
|
@@ -17046,9 +17112,9 @@ function useNatsDialogSubscription({
|
|
|
17046
17112
|
clientConfig = {},
|
|
17047
17113
|
reconnectionBackoff
|
|
17048
17114
|
}) {
|
|
17049
|
-
const [isConnected, setIsConnected] =
|
|
17050
|
-
const [isSubscribed, setIsSubscribed] =
|
|
17051
|
-
const [reconnectionCount, setReconnectionCount] =
|
|
17115
|
+
const [isConnected, setIsConnected] = useState27(false);
|
|
17116
|
+
const [isSubscribed, setIsSubscribed] = useState27(false);
|
|
17117
|
+
const [reconnectionCount, setReconnectionCount] = useState27(0);
|
|
17052
17118
|
const clientRef = useRef20(null);
|
|
17053
17119
|
const subscriptionRefs = useRef20(/* @__PURE__ */ new Map());
|
|
17054
17120
|
const onEventRef = useRef20(onEvent);
|
|
@@ -17306,7 +17372,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
17306
17372
|
|
|
17307
17373
|
// src/components/chat/hooks/use-slash-commands.ts
|
|
17308
17374
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
17309
|
-
import { useEffect as useEffect22, useState as
|
|
17375
|
+
import { useEffect as useEffect22, useState as useState28 } from "react";
|
|
17310
17376
|
async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
17311
17377
|
try {
|
|
17312
17378
|
const url = new URL(commandsUrl, window.location.origin);
|
|
@@ -17323,7 +17389,7 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
17323
17389
|
}
|
|
17324
17390
|
var NO_COMMANDS = [];
|
|
17325
17391
|
function useSlashCommands(prefix, commandsUrl) {
|
|
17326
|
-
const [answered, setAnswered] =
|
|
17392
|
+
const [answered, setAnswered] = useState28(null);
|
|
17327
17393
|
const commands = prefix != null && answered?.prefix === prefix ? answered.commands : NO_COMMANDS;
|
|
17328
17394
|
const loading = prefix != null && answered?.prefix !== prefix;
|
|
17329
17395
|
useEffect22(() => {
|
|
@@ -17433,7 +17499,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
17433
17499
|
|
|
17434
17500
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
17435
17501
|
import { fileTypeFromBlob } from "file-type";
|
|
17436
|
-
import { useCallback as useCallback14, useEffect as useEffect23, useMemo as useMemo21, useRef as useRef21, useState as
|
|
17502
|
+
import { useCallback as useCallback14, useEffect as useEffect23, useMemo as useMemo21, useRef as useRef21, useState as useState29 } from "react";
|
|
17437
17503
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
17438
17504
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
17439
17505
|
var CHAT_ATTACHMENT_MAX_SIZE_BYTES = 25 * 1024 * 1024;
|
|
@@ -17500,7 +17566,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
|
|
|
17500
17566
|
function useChatAttachments() {
|
|
17501
17567
|
const runtime = useRequiredChatRuntime();
|
|
17502
17568
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
17503
|
-
const [attachments, setAttachments] =
|
|
17569
|
+
const [attachments, setAttachments] = useState29([]);
|
|
17504
17570
|
const controllersRef = useRef21(/* @__PURE__ */ new Map());
|
|
17505
17571
|
const updateOne = useCallback14((id, patch) => {
|
|
17506
17572
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
@@ -17666,14 +17732,14 @@ function useChatAttachments() {
|
|
|
17666
17732
|
}
|
|
17667
17733
|
|
|
17668
17734
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
17669
|
-
import { useCallback as useCallback15, useEffect as useEffect24, useRef as useRef22, useState as
|
|
17735
|
+
import { useCallback as useCallback15, useEffect as useEffect24, useRef as useRef22, useState as useState30 } from "react";
|
|
17670
17736
|
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
17671
17737
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
17672
17738
|
function useChatAttachmentImageGallery() {
|
|
17673
17739
|
const runtime = useRequiredChatRuntime();
|
|
17674
17740
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
17675
17741
|
const panelRef = useRef22(null);
|
|
17676
|
-
const [state, setState] =
|
|
17742
|
+
const [state, setState] = useState30(CLOSED);
|
|
17677
17743
|
const handleClose = useCallback15(() => setState(CLOSED), []);
|
|
17678
17744
|
useEffect24(() => {
|
|
17679
17745
|
const root = panelRef.current;
|
|
@@ -17721,7 +17787,7 @@ function absolutize(prefix) {
|
|
|
17721
17787
|
}
|
|
17722
17788
|
|
|
17723
17789
|
// src/components/chat/hooks/use-chat-identity.ts
|
|
17724
|
-
import { createContext as createContext4, createElement, useContext as useContext4, useEffect as useEffect25, useState as
|
|
17790
|
+
import { createContext as createContext4, createElement, useContext as useContext4, useEffect as useEffect25, useState as useState31 } from "react";
|
|
17725
17791
|
var ANON_DEFAULTS = {
|
|
17726
17792
|
authTier: "anon",
|
|
17727
17793
|
source: null,
|
|
@@ -17733,7 +17799,7 @@ function useResolveChatIdentity(enabled) {
|
|
|
17733
17799
|
const url = runtime.endpoints.identityUrl;
|
|
17734
17800
|
const proxyEmail = getEmbedProxyAuth()?.email ?? null;
|
|
17735
17801
|
const requestKey = enabled ? `${url}\0${proxyEmail ?? ""}` : null;
|
|
17736
|
-
const [resolved, setResolved] =
|
|
17802
|
+
const [resolved, setResolved] = useState31(null);
|
|
17737
17803
|
const data = resolved?.key === requestKey ? resolved.data : ANON_DEFAULTS;
|
|
17738
17804
|
const isLoading = requestKey !== null && resolved?.key !== requestKey;
|
|
17739
17805
|
useEffect25(() => {
|
|
@@ -17798,13 +17864,13 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
17798
17864
|
}
|
|
17799
17865
|
|
|
17800
17866
|
// src/components/chat/hooks/use-chat.ts
|
|
17801
|
-
import { useState as
|
|
17867
|
+
import { useState as useState33, useCallback as useCallback17, useEffect as useEffect27, useRef as useRef25 } from "react";
|
|
17802
17868
|
|
|
17803
17869
|
// src/components/chat/hooks/use-sse.ts
|
|
17804
|
-
import { useState as
|
|
17870
|
+
import { useState as useState32, useCallback as useCallback16, useRef as useRef24 } from "react";
|
|
17805
17871
|
function useSSE({ streamFn } = {}) {
|
|
17806
|
-
const [isStreaming, setIsStreaming] =
|
|
17807
|
-
const [error, setError] =
|
|
17872
|
+
const [isStreaming, setIsStreaming] = useState32(false);
|
|
17873
|
+
const [error, setError] = useState32(null);
|
|
17808
17874
|
const abortControllerRef = useRef24(null);
|
|
17809
17875
|
const streamMessage = useCallback16(
|
|
17810
17876
|
async function* (message, extra) {
|
|
@@ -17874,8 +17940,8 @@ function useChat({
|
|
|
17874
17940
|
initialMessages,
|
|
17875
17941
|
onMessagesChange
|
|
17876
17942
|
} = {}) {
|
|
17877
|
-
const [messages, setMessages] =
|
|
17878
|
-
const [isTyping, setIsTyping] =
|
|
17943
|
+
const [messages, setMessages] = useState33(() => initialMessages ?? []);
|
|
17944
|
+
const [isTyping, setIsTyping] = useState33(false);
|
|
17879
17945
|
const currentAssistantSegmentsRef = useRef25([]);
|
|
17880
17946
|
const onMessagesChangeRef = useRef25(onMessagesChange);
|
|
17881
17947
|
useEffect27(() => {
|
|
@@ -18120,7 +18186,7 @@ function useChat({
|
|
|
18120
18186
|
}
|
|
18121
18187
|
|
|
18122
18188
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
18123
|
-
import { useCallback as useCallback20, useMemo as useMemo24, useRef as useRef28, useState as
|
|
18189
|
+
import { useCallback as useCallback20, useMemo as useMemo24, useRef as useRef28, useState as useState37 } from "react";
|
|
18124
18190
|
|
|
18125
18191
|
// src/chat-protocol/confirm-tool.ts
|
|
18126
18192
|
function buildConfirmToolBody(request) {
|
|
@@ -20704,7 +20770,7 @@ function createChatDialogStore(options = {}) {
|
|
|
20704
20770
|
}
|
|
20705
20771
|
|
|
20706
20772
|
// src/components/chat/stream/use-chat-stream-reducer.ts
|
|
20707
|
-
import { useCallback as useCallback18, useEffect as useEffect28, useMemo as useMemo22, useState as
|
|
20773
|
+
import { useCallback as useCallback18, useEffect as useEffect28, useMemo as useMemo22, useState as useState34, useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
20708
20774
|
|
|
20709
20775
|
// src/components/chat/stream/delta-batcher.ts
|
|
20710
20776
|
var DELTA_FLUSH_FALLBACK_MS = 50;
|
|
@@ -20800,7 +20866,7 @@ function useChatStreamReducer({
|
|
|
20800
20866
|
const state = useSyncExternalStore4(subscribe2, getSnapshot2, getServerSnapshot2);
|
|
20801
20867
|
useEffect28(() => store.retain(dialogId, side), [store, dialogId, side]);
|
|
20802
20868
|
const key = useMemo22(() => ({ store, dialogId, side }), [store, dialogId, side]);
|
|
20803
|
-
const [batcher] =
|
|
20869
|
+
const [batcher] = useState34(
|
|
20804
20870
|
() => createDeltaBatcher({
|
|
20805
20871
|
applyOne: (event, k) => {
|
|
20806
20872
|
if (k) k.store.apply(k.dialogId, k.side, event);
|
|
@@ -20923,7 +20989,7 @@ function buildDiscussPrompt(reference, options = {}) {
|
|
|
20923
20989
|
}
|
|
20924
20990
|
|
|
20925
20991
|
// src/components/chat/hooks/use-chat-history-hydration.ts
|
|
20926
|
-
import { useEffect as useEffect29, useRef as useRef26, useState as
|
|
20992
|
+
import { useEffect as useEffect29, useRef as useRef26, useState as useState35 } from "react";
|
|
20927
20993
|
function useChatHistoryHydration({
|
|
20928
20994
|
active,
|
|
20929
20995
|
source,
|
|
@@ -20934,7 +21000,7 @@ function useChatHistoryHydration({
|
|
|
20934
21000
|
bumpMetaTick,
|
|
20935
21001
|
onOrphanedConversation
|
|
20936
21002
|
}) {
|
|
20937
|
-
const [isHydratingHistory, setIsHydratingHistory] =
|
|
21003
|
+
const [isHydratingHistory, setIsHydratingHistory] = useState35(false);
|
|
20938
21004
|
const hydratedKeyRef = useRef26(null);
|
|
20939
21005
|
const runIdRef = useRef26(0);
|
|
20940
21006
|
useEffect29(() => {
|
|
@@ -21009,7 +21075,7 @@ function useChatHistoryHydration({
|
|
|
21009
21075
|
}
|
|
21010
21076
|
|
|
21011
21077
|
// src/components/chat/hooks/use-managed-dialog-list.ts
|
|
21012
|
-
import { useCallback as useCallback19, useEffect as useEffect30, useMemo as useMemo23, useRef as useRef27, useState as
|
|
21078
|
+
import { useCallback as useCallback19, useEffect as useEffect30, useMemo as useMemo23, useRef as useRef27, useState as useState36 } from "react";
|
|
21013
21079
|
function useManagedDialogList({
|
|
21014
21080
|
autoLoad,
|
|
21015
21081
|
fetchDialogs,
|
|
@@ -21021,19 +21087,19 @@ function useManagedDialogList({
|
|
|
21021
21087
|
onDialogRemoved,
|
|
21022
21088
|
logTag
|
|
21023
21089
|
}) {
|
|
21024
|
-
const [dialogs, setDialogs] =
|
|
21025
|
-
const [dialogsNextCursor, setDialogsNextCursor] =
|
|
21026
|
-
const [isDialogsLoading, setIsDialogsLoading] =
|
|
21027
|
-
const [settledSearch, setSettledSearch] =
|
|
21090
|
+
const [dialogs, setDialogs] = useState36([]);
|
|
21091
|
+
const [dialogsNextCursor, setDialogsNextCursor] = useState36(null);
|
|
21092
|
+
const [isDialogsLoading, setIsDialogsLoading] = useState36(false);
|
|
21093
|
+
const [settledSearch, setSettledSearch] = useState36(
|
|
21028
21094
|
autoLoad && fetchDialogs ? void 0 : null
|
|
21029
21095
|
);
|
|
21030
|
-
const [autoLoadWas, setAutoLoadWas] =
|
|
21096
|
+
const [autoLoadWas, setAutoLoadWas] = useState36(autoLoad);
|
|
21031
21097
|
if (autoLoad !== autoLoadWas) {
|
|
21032
21098
|
setAutoLoadWas(autoLoad);
|
|
21033
21099
|
if (autoLoad && fetchDialogs) setSettledSearch(void 0);
|
|
21034
21100
|
}
|
|
21035
21101
|
const pendingRef = useRef27(false);
|
|
21036
|
-
const [dialogsError, setDialogsError] =
|
|
21102
|
+
const [dialogsError, setDialogsError] = useState36(false);
|
|
21037
21103
|
const dialogsRef = useRef27(dialogs);
|
|
21038
21104
|
useEffect30(() => {
|
|
21039
21105
|
dialogsRef.current = dialogs;
|
|
@@ -21267,7 +21333,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21267
21333
|
pruneStaleChatConversationStorage(source);
|
|
21268
21334
|
conversationIdRef.current = conversationStorage.load()?.conversationId ?? null;
|
|
21269
21335
|
}
|
|
21270
|
-
const [conversationId, setConversationId] =
|
|
21336
|
+
const [conversationId, setConversationId] = useState37(() => conversationIdRef.current);
|
|
21271
21337
|
const commitConversationId = useCallback20(
|
|
21272
21338
|
(id) => {
|
|
21273
21339
|
conversationIdRef.current = id;
|
|
@@ -21370,7 +21436,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21370
21436
|
() => conversationsUrl ? createChatConversationsApi(conversationsUrl) : null,
|
|
21371
21437
|
[conversationsUrl]
|
|
21372
21438
|
);
|
|
21373
|
-
const [dialogSearch, setDialogSearch] =
|
|
21439
|
+
const [dialogSearch, setDialogSearch] = useState37("");
|
|
21374
21440
|
const fetchActiveDialogs = useMemo24(
|
|
21375
21441
|
() => conversationsApi ? (params) => conversationsApi.fetchDialogs({ ...params, status: "active" }) : void 0,
|
|
21376
21442
|
[conversationsApi]
|
|
@@ -21688,7 +21754,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21688
21754
|
}
|
|
21689
21755
|
|
|
21690
21756
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
21691
|
-
import { useCallback as useCallback21, useEffect as useEffect31, useMemo as useMemo25, useRef as useRef29, useState as
|
|
21757
|
+
import { useCallback as useCallback21, useEffect as useEffect31, useMemo as useMemo25, useRef as useRef29, useState as useState38 } from "react";
|
|
21692
21758
|
|
|
21693
21759
|
// src/chat-protocol/nats-decoder.ts
|
|
21694
21760
|
function str(value) {
|
|
@@ -22702,7 +22768,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
22702
22768
|
modelLabel = null
|
|
22703
22769
|
} = config;
|
|
22704
22770
|
const isManagedMode = fetchDialogs !== void 0;
|
|
22705
|
-
const [internalDialogId, setInternalDialogId] =
|
|
22771
|
+
const [internalDialogId, setInternalDialogId] = useState38(null);
|
|
22706
22772
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
22707
22773
|
const currentDialogIdRef = useRef29(dialogId);
|
|
22708
22774
|
useEffect31(() => {
|
|
@@ -22720,8 +22786,8 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
22720
22786
|
if (!requestId) return void 0;
|
|
22721
22787
|
return handleRejectRef.current(requestId);
|
|
22722
22788
|
}, []);
|
|
22723
|
-
const [dialogStore] =
|
|
22724
|
-
const [globalApprovalStatuses] =
|
|
22789
|
+
const [dialogStore] = useState38(() => createChatDialogStore());
|
|
22790
|
+
const [globalApprovalStatuses] = useState38(() => ({}));
|
|
22725
22791
|
const dialogKey = dialogId ?? DRAFT_DIALOG_KEY;
|
|
22726
22792
|
const { state, applyEvent, mutate } = useChatStreamReducer({
|
|
22727
22793
|
store: dialogStore,
|
|
@@ -22776,7 +22842,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
22776
22842
|
},
|
|
22777
22843
|
[applyEvent]
|
|
22778
22844
|
);
|
|
22779
|
-
const [isCreatingDialog, setIsCreatingDialog] =
|
|
22845
|
+
const [isCreatingDialog, setIsCreatingDialog] = useState38(false);
|
|
22780
22846
|
const {
|
|
22781
22847
|
dialogs,
|
|
22782
22848
|
isDialogsLoading,
|
|
@@ -22803,9 +22869,9 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
22803
22869
|
}
|
|
22804
22870
|
}
|
|
22805
22871
|
});
|
|
22806
|
-
const [messagesNextCursor, setMessagesNextCursor] =
|
|
22807
|
-
const [isMessagesLoading, setIsMessagesLoading] =
|
|
22808
|
-
const [connectedForDialog, setConnectedForDialog] =
|
|
22872
|
+
const [messagesNextCursor, setMessagesNextCursor] = useState38(null);
|
|
22873
|
+
const [isMessagesLoading, setIsMessagesLoading] = useState38(false);
|
|
22874
|
+
const [connectedForDialog, setConnectedForDialog] = useState38(null);
|
|
22809
22875
|
const hasConnectedOnceRef = useRef29(false);
|
|
22810
22876
|
const {
|
|
22811
22877
|
processChunk: catchupProcessChunk,
|
|
@@ -23116,7 +23182,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
23116
23182
|
}
|
|
23117
23183
|
|
|
23118
23184
|
// src/components/chat/hooks/use-stable-shallow.ts
|
|
23119
|
-
import { useState as
|
|
23185
|
+
import { useState as useState39 } from "react";
|
|
23120
23186
|
function shallowEqual(a, b) {
|
|
23121
23187
|
const aKeys = Object.keys(a);
|
|
23122
23188
|
if (aKeys.length !== Object.keys(b).length) return false;
|
|
@@ -23125,14 +23191,14 @@ function shallowEqual(a, b) {
|
|
|
23125
23191
|
return aKeys.every((key) => key in b && Object.is(aRec[key], bRec[key]));
|
|
23126
23192
|
}
|
|
23127
23193
|
function useStableShallow(value) {
|
|
23128
|
-
const [cached, setCached] =
|
|
23194
|
+
const [cached, setCached] = useState39(value);
|
|
23129
23195
|
const same = cached === value || cached !== void 0 && value !== void 0 && shallowEqual(cached, value);
|
|
23130
23196
|
if (!same) setCached(value);
|
|
23131
23197
|
return same ? cached : value;
|
|
23132
23198
|
}
|
|
23133
23199
|
|
|
23134
23200
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
23135
|
-
import { useCallback as useCallback22, useEffect as useEffect32, useMemo as useMemo26, useRef as useRef30, useState as
|
|
23201
|
+
import { useCallback as useCallback22, useEffect as useEffect32, useMemo as useMemo26, useRef as useRef30, useState as useState40 } from "react";
|
|
23136
23202
|
var EMPTY_SSE_OPTIONS = {};
|
|
23137
23203
|
function createDisabledNatsConfig() {
|
|
23138
23204
|
return {
|
|
@@ -23147,7 +23213,7 @@ function createDisabledNatsConfig() {
|
|
|
23147
23213
|
}
|
|
23148
23214
|
function useUnifiedChat(options) {
|
|
23149
23215
|
const { modes, activeMode, mingoStateOverride, injectedDialogCapabilities } = options;
|
|
23150
|
-
const [disabledNatsConfig] =
|
|
23216
|
+
const [disabledNatsConfig] = useState40(createDisabledNatsConfig);
|
|
23151
23217
|
const sseActive = activeMode === "guide" && modes.guide !== void 0;
|
|
23152
23218
|
const natsActive = activeMode === "mingo" && modes.mingo !== void 0;
|
|
23153
23219
|
const sseState = useSseChatAdapter(modes.guide ?? EMPTY_SSE_OPTIONS, {
|
|
@@ -23657,7 +23723,7 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
|
23657
23723
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
23658
23724
|
import { isIOS } from "@react-aria/utils";
|
|
23659
23725
|
import { MessageSquare as MessageSquare2 } from "lucide-react";
|
|
23660
|
-
import React7, { useCallback as useCallback26, useEffect as useEffect35, useImperativeHandle as useImperativeHandle2, useMemo as useMemo29, useRef as useRef35, useState as
|
|
23726
|
+
import React7, { useCallback as useCallback26, useEffect as useEffect35, useImperativeHandle as useImperativeHandle2, useMemo as useMemo29, useRef as useRef35, useState as useState45 } from "react";
|
|
23661
23727
|
|
|
23662
23728
|
// src/components/ui/drawer.tsx
|
|
23663
23729
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
@@ -23667,12 +23733,12 @@ import {
|
|
|
23667
23733
|
forwardRef as forwardRef24,
|
|
23668
23734
|
useEffect as useEffect34,
|
|
23669
23735
|
useRef as useRef32,
|
|
23670
|
-
useState as
|
|
23736
|
+
useState as useState42,
|
|
23671
23737
|
useSyncExternalStore as useSyncExternalStore5
|
|
23672
23738
|
} from "react";
|
|
23673
23739
|
|
|
23674
23740
|
// src/hooks/ui/use-resizable-panel-size.ts
|
|
23675
|
-
import { useCallback as useCallback23, useMemo as useMemo27, useState as
|
|
23741
|
+
import { useCallback as useCallback23, useMemo as useMemo27, useState as useState41 } from "react";
|
|
23676
23742
|
var CHOSEN_SIZE_KEY_SUFFIX = ":chosen";
|
|
23677
23743
|
function isStoredPanelSize(value) {
|
|
23678
23744
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -23696,7 +23762,7 @@ function useResizablePanelSize({
|
|
|
23696
23762
|
}) : null,
|
|
23697
23763
|
[enabled, storageKey]
|
|
23698
23764
|
);
|
|
23699
|
-
const [held, setChosen] =
|
|
23765
|
+
const [held, setChosen] = useState41(() => ({ storage, size: storage?.load()?.size ?? null }));
|
|
23700
23766
|
const chosen = held.storage === storage ? held : { storage, size: storage?.load()?.size ?? null };
|
|
23701
23767
|
if (chosen !== held) setChosen(chosen);
|
|
23702
23768
|
const chosenSize = chosen.size;
|
|
@@ -23980,7 +24046,7 @@ var DrawerContent = forwardRef24(
|
|
|
23980
24046
|
const resolvedSide = side ?? "right";
|
|
23981
24047
|
const isHorizontal = HORIZONTAL_SIDES2.has(resolvedSide);
|
|
23982
24048
|
const headerHeight = useHeaderHeight();
|
|
23983
|
-
const [isMobile, setIsMobile] =
|
|
24049
|
+
const [isMobile, setIsMobile] = useState42(false);
|
|
23984
24050
|
useEffect34(() => {
|
|
23985
24051
|
if (typeof window === "undefined") return void 0;
|
|
23986
24052
|
const mq = window.matchMedia(`(max-width: ${mobileBreakpoint - 1}px)`);
|
|
@@ -24082,7 +24148,7 @@ var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx88("div", { c
|
|
|
24082
24148
|
DrawerFooter.displayName = "DrawerFooter";
|
|
24083
24149
|
|
|
24084
24150
|
// src/components/ui/hover-dropdown.tsx
|
|
24085
|
-
import { useState as
|
|
24151
|
+
import { useState as useState43, useRef as useRef33, useCallback as useCallback24 } from "react";
|
|
24086
24152
|
import { Fragment as Fragment34, jsx as jsx89, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
24087
24153
|
function DefaultAnchor({ href, className, children }) {
|
|
24088
24154
|
return /* @__PURE__ */ jsx89("a", { href, className, children });
|
|
@@ -24095,7 +24161,7 @@ function HoverDropdown({
|
|
|
24095
24161
|
className,
|
|
24096
24162
|
renderAnchor
|
|
24097
24163
|
}) {
|
|
24098
|
-
const [open, setOpen] =
|
|
24164
|
+
const [open, setOpen] = useState43(false);
|
|
24099
24165
|
const timeoutRef = useRef33(void 0);
|
|
24100
24166
|
const containerRef = useRef33(null);
|
|
24101
24167
|
const panelRef = useRef33(null);
|
|
@@ -24199,7 +24265,7 @@ function HoverDropdown({
|
|
|
24199
24265
|
}
|
|
24200
24266
|
|
|
24201
24267
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
24202
|
-
import { useCallback as useCallback25, useMemo as useMemo28, useRef as useRef34, useState as
|
|
24268
|
+
import { useCallback as useCallback25, useMemo as useMemo28, useRef as useRef34, useState as useState44 } from "react";
|
|
24203
24269
|
function useChatDialogManager({
|
|
24204
24270
|
dialogs,
|
|
24205
24271
|
activeDialogId,
|
|
@@ -24211,8 +24277,8 @@ function useChatDialogManager({
|
|
|
24211
24277
|
fetchArchivedDialogs,
|
|
24212
24278
|
unarchiveDialog
|
|
24213
24279
|
}) {
|
|
24214
|
-
const [renameTarget, setRenameTarget] =
|
|
24215
|
-
const [archiveTarget, setArchiveTarget] =
|
|
24280
|
+
const [renameTarget, setRenameTarget] = useState44(null);
|
|
24281
|
+
const [archiveTarget, setArchiveTarget] = useState44(null);
|
|
24216
24282
|
const handleConfirmRename = useCallback25(
|
|
24217
24283
|
(name) => {
|
|
24218
24284
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
@@ -24220,7 +24286,7 @@ function useChatDialogManager({
|
|
|
24220
24286
|
},
|
|
24221
24287
|
[renameTarget, renameDialog]
|
|
24222
24288
|
);
|
|
24223
|
-
const [openingDialogId, setOpeningDialogId] =
|
|
24289
|
+
const [openingDialogId, setOpeningDialogId] = useState44(null);
|
|
24224
24290
|
const handleConfirmArchive = useCallback25(async () => {
|
|
24225
24291
|
if (archiveTarget) {
|
|
24226
24292
|
try {
|
|
@@ -24236,11 +24302,11 @@ function useChatDialogManager({
|
|
|
24236
24302
|
}
|
|
24237
24303
|
setArchiveTarget(null);
|
|
24238
24304
|
}, [archiveTarget, archiveDialog, activeDialogId, clearMessages]);
|
|
24239
|
-
const [archiveOpen, setArchiveOpen] =
|
|
24240
|
-
const [archivedDialogs, setArchivedDialogs] =
|
|
24241
|
-
const [archivedCursor, setArchivedCursor] =
|
|
24242
|
-
const [archivedLoading, setArchivedLoading] =
|
|
24243
|
-
const [archivedPending, setArchivedPending] =
|
|
24305
|
+
const [archiveOpen, setArchiveOpen] = useState44(false);
|
|
24306
|
+
const [archivedDialogs, setArchivedDialogs] = useState44([]);
|
|
24307
|
+
const [archivedCursor, setArchivedCursor] = useState44(null);
|
|
24308
|
+
const [archivedLoading, setArchivedLoading] = useState44(false);
|
|
24309
|
+
const [archivedPending, setArchivedPending] = useState44(false);
|
|
24244
24310
|
const archivedRequestIdRef = useRef34(0);
|
|
24245
24311
|
const loadArchivedPage = useCallback25(
|
|
24246
24312
|
async (cursor) => {
|
|
@@ -24280,7 +24346,7 @@ function useChatDialogManager({
|
|
|
24280
24346
|
void loadArchivedPage();
|
|
24281
24347
|
}, [loadArchivedPage]);
|
|
24282
24348
|
const closeArchive = useCallback25(() => setArchiveOpen(false), []);
|
|
24283
|
-
const [viewingArchivedId, setViewingArchivedId] =
|
|
24349
|
+
const [viewingArchivedId, setViewingArchivedId] = useState44(null);
|
|
24284
24350
|
const handleSelectDialog = useCallback25(
|
|
24285
24351
|
(id) => {
|
|
24286
24352
|
setViewingArchivedId(null);
|
|
@@ -24299,7 +24365,7 @@ function useChatDialogManager({
|
|
|
24299
24365
|
},
|
|
24300
24366
|
[selectDialog]
|
|
24301
24367
|
);
|
|
24302
|
-
const [restoreTarget, setRestoreTarget] =
|
|
24368
|
+
const [restoreTarget, setRestoreTarget] = useState44(null);
|
|
24303
24369
|
const handleConfirmRestore = useCallback25(async () => {
|
|
24304
24370
|
if (restoreTarget) {
|
|
24305
24371
|
try {
|
|
@@ -24463,8 +24529,8 @@ var RAIL_COLLAPSED_STORAGE_KEY = "mingo-chat-history-collapsed";
|
|
|
24463
24529
|
var NO_CONTEXT_ITEMS = [];
|
|
24464
24530
|
var RAIL_ANIM_MS = 320;
|
|
24465
24531
|
function useRailPresence(open) {
|
|
24466
|
-
const [mounted, setMounted] =
|
|
24467
|
-
const [active, setActive] =
|
|
24532
|
+
const [mounted, setMounted] = useState45(open);
|
|
24533
|
+
const [active, setActive] = useState45(false);
|
|
24468
24534
|
if (open && !mounted) setMounted(true);
|
|
24469
24535
|
if (!open && active) setActive(false);
|
|
24470
24536
|
useEffect35(() => {
|
|
@@ -24691,7 +24757,7 @@ function SourceChips({
|
|
|
24691
24757
|
onClose,
|
|
24692
24758
|
onDiscuss
|
|
24693
24759
|
}) {
|
|
24694
|
-
const [expanded, setExpanded] =
|
|
24760
|
+
const [expanded, setExpanded] = useState45(false);
|
|
24695
24761
|
if (cited.length === 0) {
|
|
24696
24762
|
const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
|
|
24697
24763
|
if (fallback.length === 0) return null;
|
|
@@ -24822,7 +24888,7 @@ function EmbeddableChatInner({
|
|
|
24822
24888
|
defaultProp: defaultOpen ?? false,
|
|
24823
24889
|
onChange: onOpenChange
|
|
24824
24890
|
});
|
|
24825
|
-
const [autoFocusInput] =
|
|
24891
|
+
const [autoFocusInput] = useState45(() => {
|
|
24826
24892
|
if (typeof window === "undefined") return false;
|
|
24827
24893
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
24828
24894
|
});
|
|
@@ -24855,7 +24921,7 @@ function EmbeddableChatInner({
|
|
|
24855
24921
|
};
|
|
24856
24922
|
}, [isOpen, shellLess]);
|
|
24857
24923
|
const chatInputRef = useRef35(null);
|
|
24858
|
-
const [quickActionPreview, setQuickActionPreview] =
|
|
24924
|
+
const [quickActionPreview, setQuickActionPreview] = useState45(null);
|
|
24859
24925
|
const slashCommandsProp = useMemo29(
|
|
24860
24926
|
() => ({
|
|
24861
24927
|
fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
|
|
@@ -24878,7 +24944,7 @@ function EmbeddableChatInner({
|
|
|
24878
24944
|
}, [modes, tableIdForDocumentType]);
|
|
24879
24945
|
const hasMingoMode = !!effectiveModes.mingo || !!mingoState;
|
|
24880
24946
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
24881
|
-
const [uncontrolledActiveMode, setUncontrolledActiveMode] =
|
|
24947
|
+
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState45(initialActiveMode);
|
|
24882
24948
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
24883
24949
|
const handleActiveModeChange = useCallback26(
|
|
24884
24950
|
(next) => {
|
|
@@ -24954,7 +25020,7 @@ function EmbeddableChatInner({
|
|
|
24954
25020
|
injectedDialogCapabilities: mingoDialogCapabilities
|
|
24955
25021
|
});
|
|
24956
25022
|
const historyListMode = dialogCapabilities !== void 0;
|
|
24957
|
-
const [namingNewChat, setNamingNewChat] =
|
|
25023
|
+
const [namingNewChat, setNamingNewChat] = useState45(false);
|
|
24958
25024
|
const sendMessage = useCallback26(
|
|
24959
25025
|
async (text2, options) => {
|
|
24960
25026
|
if (activeDialogId == null) setNamingNewChat(true);
|
|
@@ -24998,17 +25064,17 @@ function EmbeddableChatInner({
|
|
|
24998
25064
|
const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
|
|
24999
25065
|
const contextMaxItems = contextPicker?.maxItems ?? 10;
|
|
25000
25066
|
const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
|
|
25001
|
-
const [contextItems, setContextItems] =
|
|
25002
|
-
const [contextPickerOpen, setContextPickerOpen] =
|
|
25003
|
-
const [mentionQuery, setMentionQuery] =
|
|
25067
|
+
const [contextItems, setContextItems] = useState45(NO_CONTEXT_ITEMS);
|
|
25068
|
+
const [contextPickerOpen, setContextPickerOpen] = useState45(false);
|
|
25069
|
+
const [mentionQuery, setMentionQuery] = useState45(null);
|
|
25004
25070
|
const mentionActiveRef = useRef35(false);
|
|
25005
25071
|
useEffect35(() => {
|
|
25006
25072
|
mentionActiveRef.current = mentionQuery !== null;
|
|
25007
25073
|
}, [mentionQuery]);
|
|
25008
25074
|
const mentionKeysRef = useRef35(/* @__PURE__ */ new Set());
|
|
25009
25075
|
const scopeDialogId = activeDialogId ?? null;
|
|
25010
|
-
const [composerScope, setComposerScope] =
|
|
25011
|
-
const [composerKey, setComposerKey] =
|
|
25076
|
+
const [composerScope, setComposerScope] = useState45({ dialogId: scopeDialogId, mode: activeMode });
|
|
25077
|
+
const [composerKey, setComposerKey] = useState45(0);
|
|
25012
25078
|
if (composerScope.dialogId !== scopeDialogId || composerScope.mode !== activeMode) {
|
|
25013
25079
|
const named = namingNewChat && composerScope.dialogId == null && scopeDialogId != null && composerScope.mode === activeMode;
|
|
25014
25080
|
setComposerScope({ dialogId: scopeDialogId, mode: activeMode });
|
|
@@ -25123,7 +25189,7 @@ function EmbeddableChatInner({
|
|
|
25123
25189
|
() => effectiveAssistantIcon ? /* @__PURE__ */ jsx90(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx90(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
25124
25190
|
[effectiveAssistantIcon]
|
|
25125
25191
|
);
|
|
25126
|
-
const [timestampCache] =
|
|
25192
|
+
const [timestampCache] = useState45(() => /* @__PURE__ */ new Map());
|
|
25127
25193
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
25128
25194
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
25129
25195
|
const messages = useMemo29(() => {
|
|
@@ -25321,10 +25387,10 @@ function EmbeddableChatInner({
|
|
|
25321
25387
|
},
|
|
25322
25388
|
[chatLoading, messages.length, resolvedBaseRoute, chipBasePlatform, handleNavigationClose, askAbout]
|
|
25323
25389
|
);
|
|
25324
|
-
const [portalHost, setPortalHost] =
|
|
25325
|
-
const [panelBoundary, setPanelBoundary] =
|
|
25390
|
+
const [portalHost, setPortalHost] = useState45(null);
|
|
25391
|
+
const [panelBoundary, setPanelBoundary] = useState45(null);
|
|
25326
25392
|
const splitMinWidth = (isV2 ? MINGO_V2_RAIL_WIDTH : HISTORY_RAIL_WIDTH) + CHAT_BLOCK_MIN_WIDTH;
|
|
25327
|
-
const [canSplit, setCanSplit] =
|
|
25393
|
+
const [canSplit, setCanSplit] = useState45(false);
|
|
25328
25394
|
useEffect35(() => {
|
|
25329
25395
|
if (!panelBoundary || typeof ResizeObserver === "undefined") return void 0;
|
|
25330
25396
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -25341,9 +25407,9 @@ function EmbeddableChatInner({
|
|
|
25341
25407
|
},
|
|
25342
25408
|
[splitMinWidth]
|
|
25343
25409
|
);
|
|
25344
|
-
const [railCollapsed, setRailCollapsed] =
|
|
25410
|
+
const [railCollapsed, setRailCollapsed] = useState45(false);
|
|
25345
25411
|
const railStorageHydrated = useIsHydrated();
|
|
25346
|
-
const [railStorageRead, setRailStorageRead] =
|
|
25412
|
+
const [railStorageRead, setRailStorageRead] = useState45(false);
|
|
25347
25413
|
if (railStorageHydrated && !railStorageRead) {
|
|
25348
25414
|
setRailStorageRead(true);
|
|
25349
25415
|
try {
|
|
@@ -25361,13 +25427,13 @@ function EmbeddableChatInner({
|
|
|
25361
25427
|
return next;
|
|
25362
25428
|
});
|
|
25363
25429
|
}, []);
|
|
25364
|
-
const [railSearchOpen, setRailSearchOpen] =
|
|
25430
|
+
const [railSearchOpen, setRailSearchOpen] = useState45(false);
|
|
25365
25431
|
const splitEligible = historyListMode;
|
|
25366
25432
|
const wideMingo = splitEligible && canSplit && !previewMode;
|
|
25367
25433
|
const splitActive = wideMingo && !railCollapsed;
|
|
25368
25434
|
const railPresence = useRailPresence(splitActive);
|
|
25369
25435
|
const showWideHeader = wideMingo || railPresence.mounted;
|
|
25370
|
-
const [composeOpen, setComposeOpen] =
|
|
25436
|
+
const [composeOpen, setComposeOpen] = useState45(false);
|
|
25371
25437
|
if (hasConversation && composeOpen) setComposeOpen(false);
|
|
25372
25438
|
const isMingoMode = historyListMode;
|
|
25373
25439
|
const emptyListSkipped = mingoCaps.emptyListSkipsToCompose === true && dialogs.length === 0 && !dialogsInitialLoading && !mingoCaps.searchQuery;
|
|
@@ -25413,8 +25479,8 @@ function EmbeddableChatInner({
|
|
|
25413
25479
|
useEffect35(() => {
|
|
25414
25480
|
if (activeDialogId && !isViewingArchived) lastDialogIdRef.current = activeDialogId;
|
|
25415
25481
|
}, [activeDialogId, isViewingArchived]);
|
|
25416
|
-
const [pendingDraft, setPendingDraft] =
|
|
25417
|
-
const [seededDraft, setSeededDraft] =
|
|
25482
|
+
const [pendingDraft, setPendingDraft] = useState45(null);
|
|
25483
|
+
const [seededDraft, setSeededDraft] = useState45(null);
|
|
25418
25484
|
if (pendingDraft && seededDraft !== pendingDraft) {
|
|
25419
25485
|
setSeededDraft(pendingDraft);
|
|
25420
25486
|
setContextItems(pendingDraft.mentions);
|
|
@@ -26047,7 +26113,7 @@ function EmbeddableChatInner({
|
|
|
26047
26113
|
}
|
|
26048
26114
|
|
|
26049
26115
|
// src/components/chat/proxy-credentials-panel.tsx
|
|
26050
|
-
import { useMemo as useMemo30, useState as
|
|
26116
|
+
import { useMemo as useMemo30, useState as useState46 } from "react";
|
|
26051
26117
|
|
|
26052
26118
|
// src/components/ui/field.tsx
|
|
26053
26119
|
import { useId as useId4 } from "react";
|
|
@@ -26190,12 +26256,12 @@ function ProxyCredentialsPanel({ description }) {
|
|
|
26190
26256
|
}
|
|
26191
26257
|
function ProxyCredentialsForm({ description, saved }) {
|
|
26192
26258
|
const { secret: savedSecret, email: savedEmail, ...savedOptional } = saved ?? { email: "", secret: "" };
|
|
26193
|
-
const [secret, setSecret] =
|
|
26194
|
-
const [email, setEmail] =
|
|
26195
|
-
const [optional, setOptional] =
|
|
26196
|
-
const [savedKeyTail, setSavedKeyTail] =
|
|
26197
|
-
const [activeEmail, setActiveEmail] =
|
|
26198
|
-
const [status, setStatus] =
|
|
26259
|
+
const [secret, setSecret] = useState46("");
|
|
26260
|
+
const [email, setEmail] = useState46(savedEmail);
|
|
26261
|
+
const [optional, setOptional] = useState46(savedOptional);
|
|
26262
|
+
const [savedKeyTail, setSavedKeyTail] = useState46(savedSecret ? maskKey(savedSecret) : null);
|
|
26263
|
+
const [activeEmail, setActiveEmail] = useState46(savedEmail || null);
|
|
26264
|
+
const [status, setStatus] = useState46("");
|
|
26199
26265
|
const errors = useMemo30(() => {
|
|
26200
26266
|
const out = {};
|
|
26201
26267
|
for (const { field } of EMBED_PROXY_OPTIONAL_HEADERS) {
|
|
@@ -26655,8 +26721,7 @@ export {
|
|
|
26655
26721
|
assistantAvailable,
|
|
26656
26722
|
useAskPrompts,
|
|
26657
26723
|
useAssistantOpen,
|
|
26658
|
-
|
|
26659
|
-
useShownAskPromptIds,
|
|
26724
|
+
useAskSurface,
|
|
26660
26725
|
AssistantAskPrompts,
|
|
26661
26726
|
useMarqueeSync,
|
|
26662
26727
|
getMarqueeTrackOffset,
|