@flamingo-stack/openframe-frontend-core 0.0.609-snapshot.20260908170120 → 0.0.609
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/chat-protocol/events.d.ts +2 -21
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +9 -211
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.js +9 -211
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/{chunk-2YMDDD5V.cjs → chunk-3N4FXBVJ.cjs} +3 -3
- package/dist/{chunk-2YMDDD5V.cjs.map → chunk-3N4FXBVJ.cjs.map} +1 -1
- package/dist/{chunk-THCB7NHV.cjs → chunk-3XNMDLGB.cjs} +9 -9
- package/dist/{chunk-THCB7NHV.cjs.map → chunk-3XNMDLGB.cjs.map} +1 -1
- package/dist/{chunk-GFAHCXIL.cjs → chunk-45XXK2VU.cjs} +10 -10
- package/dist/{chunk-GFAHCXIL.cjs.map → chunk-45XXK2VU.cjs.map} +1 -1
- package/dist/{chunk-2QBXG74C.js → chunk-6MLRFM3T.js} +5 -5
- package/dist/{chunk-IBMHEOBV.js → chunk-B3UXNGVM.js} +3 -3
- package/dist/{chunk-O6PO5BHE.js → chunk-B7LYKBCD.js} +5 -5
- package/dist/{chunk-F2C2U7CP.js → chunk-BSMPCPOZ.js} +299 -590
- package/dist/chunk-BSMPCPOZ.js.map +1 -0
- package/dist/{chunk-MGXSJI23.js → chunk-BUXGWBTF.js} +2 -2
- package/dist/{chunk-OIKZDXNW.js → chunk-C7CTEUU7.js} +2 -2
- package/dist/{chunk-EANAFFAD.cjs → chunk-CZTOSG7Q.cjs} +22 -22
- package/dist/{chunk-EANAFFAD.cjs.map → chunk-CZTOSG7Q.cjs.map} +1 -1
- package/dist/{chunk-C4KQ2XPK.cjs → chunk-D3DTC7SZ.cjs} +15 -15
- package/dist/{chunk-C4KQ2XPK.cjs.map → chunk-D3DTC7SZ.cjs.map} +1 -1
- package/dist/{chunk-HKJ3WKGW.cjs → chunk-DKNXAJMP.cjs} +159 -159
- package/dist/{chunk-HKJ3WKGW.cjs.map → chunk-DKNXAJMP.cjs.map} +1 -1
- package/dist/{chunk-UFFVMZDL.cjs → chunk-FYG7QNAO.cjs} +5 -5
- package/dist/{chunk-UFFVMZDL.cjs.map → chunk-FYG7QNAO.cjs.map} +1 -1
- package/dist/{chunk-THCSSPXU.cjs → chunk-GMOBT5NP.cjs} +70 -70
- package/dist/{chunk-THCSSPXU.cjs.map → chunk-GMOBT5NP.cjs.map} +1 -1
- package/dist/{chunk-HQSCJYCF.js → chunk-HGVW7OHI.js} +2 -2
- package/dist/{chunk-FS3CTGIR.js → chunk-JKM5FH63.js} +3 -3
- package/dist/{chunk-37CAZTLP.js → chunk-JOCVQZGT.js} +5 -5
- package/dist/{chunk-ROOIHDLS.js → chunk-JR7I2AGL.js} +3 -3
- package/dist/{chunk-OVVKVIMH.cjs → chunk-L2JWC5VS.cjs} +43 -43
- package/dist/{chunk-OVVKVIMH.cjs.map → chunk-L2JWC5VS.cjs.map} +1 -1
- package/dist/{chunk-25YIHMZ6.js → chunk-LA2W5L6K.js} +2 -2
- package/dist/{chunk-V6TINNLD.js → chunk-MVBRMQGU.js} +2 -2
- package/dist/{chunk-Q3APHZK5.cjs → chunk-NJUSDREV.cjs} +22 -22
- package/dist/{chunk-Q3APHZK5.cjs.map → chunk-NJUSDREV.cjs.map} +1 -1
- package/dist/{chunk-FASOANK7.cjs → chunk-O2M4T34Q.cjs} +4 -4
- package/dist/{chunk-FASOANK7.cjs.map → chunk-O2M4T34Q.cjs.map} +1 -1
- package/dist/{chunk-R2UDEMKK.js → chunk-OTYV6SDN.js} +3 -3
- package/dist/{chunk-HZS4TV34.js → chunk-QX4ANESW.js} +6 -6
- package/dist/{chunk-ZDLCWNM6.cjs → chunk-RZM6FPOT.cjs} +25 -25
- package/dist/{chunk-ZDLCWNM6.cjs.map → chunk-RZM6FPOT.cjs.map} +1 -1
- package/dist/{chunk-GNLV326I.cjs → chunk-SEW25Y2W.cjs} +10 -10
- package/dist/{chunk-GNLV326I.cjs.map → chunk-SEW25Y2W.cjs.map} +1 -1
- package/dist/{chunk-QE2Z6WME.cjs → chunk-TCEALWE3.cjs} +33 -33
- package/dist/{chunk-QE2Z6WME.cjs.map → chunk-TCEALWE3.cjs.map} +1 -1
- package/dist/{chunk-OJZW3GE2.js → chunk-TJ3GFULR.js} +3 -3
- package/dist/{chunk-Q2CNCBMK.js → chunk-VCYRJY7J.js} +4 -4
- package/dist/{chunk-YXTAV2E3.cjs → chunk-XNDTYTVT.cjs} +683 -974
- package/dist/chunk-XNDTYTVT.cjs.map +1 -0
- package/dist/{chunk-WJQOYSR3.cjs → chunk-ZRLFBLME.cjs} +3 -3
- package/dist/{chunk-WJQOYSR3.cjs.map → chunk-ZRLFBLME.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +28 -5
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/remark-card-links.d.ts +4 -5
- package/dist/components/chat/remark-card-links.d.ts.map +1 -1
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/types/component.types.d.ts +0 -27
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/types/message.types.d.ts +1 -81
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +3 -12
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- 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/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 +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +38 -38
- package/dist/components/index.js +13 -13
- package/dist/components/meeting-scheduler/index.cjs +24 -24
- 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 +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.js +6 -6
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-protocol/events.ts +1 -22
- package/src/chat-protocol/nats-decoder.ts +0 -12
- package/src/components/chat/chat-message-enhanced.tsx +12 -37
- package/src/components/chat/chat-message-list.tsx +1 -14
- package/src/components/chat/embeddable-chat.tsx +87 -47
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +28 -5
- package/src/components/chat/remark-card-links.ts +12 -14
- package/src/components/chat/stream/chat-stream-reducer.ts +3 -48
- package/src/components/chat/tool-execution-display.tsx +4 -18
- package/src/components/chat/types/component.types.ts +0 -27
- package/src/components/chat/types/message.types.ts +0 -83
- package/src/components/chat/types/unified-chat-state.types.ts +3 -12
- package/src/components/chat/utils/process-historical-messages.ts +0 -25
- package/dist/chat-protocol/card-marker.d.ts +0 -31
- package/dist/chat-protocol/card-marker.d.ts.map +0 -1
- package/dist/chat-protocol/source-metadata.d.ts +0 -56
- package/dist/chat-protocol/source-metadata.d.ts.map +0 -1
- package/dist/chunk-F2C2U7CP.js.map +0 -1
- package/dist/chunk-YXTAV2E3.cjs.map +0 -1
- package/dist/components/chat/utils/cited-sources.d.ts +0 -24
- package/dist/components/chat/utils/cited-sources.d.ts.map +0 -1
- package/dist/components/chat/utils/host-message.d.ts +0 -41
- package/dist/components/chat/utils/host-message.d.ts.map +0 -1
- package/src/chat-protocol/__tests__/card-marker.test.ts +0 -63
- package/src/chat-protocol/__tests__/source-metadata.test.ts +0 -243
- package/src/chat-protocol/card-marker.ts +0 -40
- package/src/chat-protocol/source-metadata.ts +0 -336
- package/src/components/chat/__tests__/tool-execution-display.test.tsx +0 -70
- package/src/components/chat/utils/__tests__/cited-sources.test.ts +0 -80
- package/src/components/chat/utils/__tests__/host-message.test.ts +0 -92
- package/src/components/chat/utils/__tests__/process-historical-messages-sources.test.ts +0 -138
- package/src/components/chat/utils/cited-sources.ts +0 -61
- package/src/components/chat/utils/host-message.ts +0 -87
- /package/dist/{chunk-2QBXG74C.js.map → chunk-6MLRFM3T.js.map} +0 -0
- /package/dist/{chunk-IBMHEOBV.js.map → chunk-B3UXNGVM.js.map} +0 -0
- /package/dist/{chunk-O6PO5BHE.js.map → chunk-B7LYKBCD.js.map} +0 -0
- /package/dist/{chunk-MGXSJI23.js.map → chunk-BUXGWBTF.js.map} +0 -0
- /package/dist/{chunk-OIKZDXNW.js.map → chunk-C7CTEUU7.js.map} +0 -0
- /package/dist/{chunk-HQSCJYCF.js.map → chunk-HGVW7OHI.js.map} +0 -0
- /package/dist/{chunk-FS3CTGIR.js.map → chunk-JKM5FH63.js.map} +0 -0
- /package/dist/{chunk-37CAZTLP.js.map → chunk-JOCVQZGT.js.map} +0 -0
- /package/dist/{chunk-ROOIHDLS.js.map → chunk-JR7I2AGL.js.map} +0 -0
- /package/dist/{chunk-25YIHMZ6.js.map → chunk-LA2W5L6K.js.map} +0 -0
- /package/dist/{chunk-V6TINNLD.js.map → chunk-MVBRMQGU.js.map} +0 -0
- /package/dist/{chunk-R2UDEMKK.js.map → chunk-OTYV6SDN.js.map} +0 -0
- /package/dist/{chunk-HZS4TV34.js.map → chunk-QX4ANESW.js.map} +0 -0
- /package/dist/{chunk-OJZW3GE2.js.map → chunk-TJ3GFULR.js.map} +0 -0
- /package/dist/{chunk-Q2CNCBMK.js.map → chunk-VCYRJY7J.js.map} +0 -0
|
@@ -247,16 +247,16 @@ var _classvarianceauthority = require('class-variance-authority');
|
|
|
247
247
|
var _react3 = require('@floating-ui/react');
|
|
248
248
|
|
|
249
249
|
var _jsxruntime = require('react/jsx-runtime');
|
|
250
|
-
function parseColoredText(
|
|
251
|
-
if (typeof
|
|
250
|
+
function parseColoredText(text) {
|
|
251
|
+
if (typeof text !== "string") return text;
|
|
252
252
|
const parts = [];
|
|
253
253
|
let lastIndex = 0;
|
|
254
254
|
const colorRegex = /\[([A-Z]+)\](.*?)\[\/\1\]/g;
|
|
255
255
|
let match;
|
|
256
256
|
let keyIndex = 0;
|
|
257
|
-
while ((match = colorRegex.exec(
|
|
257
|
+
while ((match = colorRegex.exec(text)) !== null) {
|
|
258
258
|
if (match.index > lastIndex) {
|
|
259
|
-
const beforeText =
|
|
259
|
+
const beforeText = text.slice(lastIndex, match.index);
|
|
260
260
|
parts.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: beforeText }, `text-${keyIndex++}`));
|
|
261
261
|
}
|
|
262
262
|
const color = match[1].toLowerCase();
|
|
@@ -267,11 +267,11 @@ function parseColoredText(text2) {
|
|
|
267
267
|
);
|
|
268
268
|
lastIndex = match.index + match[0].length;
|
|
269
269
|
}
|
|
270
|
-
if (lastIndex <
|
|
271
|
-
const remainingText =
|
|
270
|
+
if (lastIndex < text.length) {
|
|
271
|
+
const remainingText = text.slice(lastIndex);
|
|
272
272
|
parts.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: remainingText }, `text-${keyIndex++}`));
|
|
273
273
|
}
|
|
274
|
-
return parts.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: parts }) :
|
|
274
|
+
return parts.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: parts }) : text;
|
|
275
275
|
}
|
|
276
276
|
function FloatingTooltip({
|
|
277
277
|
content,
|
|
@@ -1163,15 +1163,6 @@ var MESSAGE_TYPE = {
|
|
|
1163
1163
|
TEXT: "TEXT",
|
|
1164
1164
|
THINKING: "THINKING",
|
|
1165
1165
|
ASK: "ASK",
|
|
1166
|
-
/** Per-answer source metadata (documents, videos, entity cards).
|
|
1167
|
-
*
|
|
1168
|
-
* TWO names for ONE payload, on purpose. `SOURCES` is the contract the
|
|
1169
|
-
* backend is moving to; `GUIDE` is the envelope it ships in today, reused
|
|
1170
|
-
* from Guide Mode v2 so a released frontend keeps working during the v2→v3
|
|
1171
|
-
* rollout. Both decode through the same path, so dropping `GUIDE` later is a
|
|
1172
|
-
* deletion here and nothing else. */
|
|
1173
|
-
GUIDE: "GUIDE",
|
|
1174
|
-
SOURCES: "SOURCES",
|
|
1175
1166
|
EXECUTING_TOOL: "EXECUTING_TOOL",
|
|
1176
1167
|
EXECUTED_TOOL: "EXECUTED_TOOL",
|
|
1177
1168
|
APPROVAL_REQUEST: "APPROVAL_REQUEST",
|
|
@@ -1310,16 +1301,16 @@ function buildHeadingIdMap(content, sectionIds) {
|
|
|
1310
1301
|
let sectionOrdinal = 0;
|
|
1311
1302
|
let headingOrdinal = 0;
|
|
1312
1303
|
for (const { line, level, text: rawText } of _chunkYXWGSDK4cjs.scanHeadings.call(void 0, content)) {
|
|
1313
|
-
const
|
|
1304
|
+
const text = stripInlineMarkdown(rawText).trim();
|
|
1314
1305
|
headingOrdinal++;
|
|
1315
1306
|
if (level <= EXTRACTOR_MAX_LEVEL) sectionOrdinal++;
|
|
1316
1307
|
let assigned;
|
|
1317
1308
|
if (sectionIds && level <= EXTRACTOR_MAX_LEVEL) {
|
|
1318
1309
|
for (const variation of [
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
_chunkYXWGSDK4cjs.stripHeadingEmojis.call(void 0,
|
|
1322
|
-
_chunkYXWGSDK4cjs.stripHeadingEmojis.call(void 0,
|
|
1310
|
+
text,
|
|
1311
|
+
text.toLowerCase(),
|
|
1312
|
+
_chunkYXWGSDK4cjs.stripHeadingEmojis.call(void 0, text),
|
|
1313
|
+
_chunkYXWGSDK4cjs.stripHeadingEmojis.call(void 0, text).toLowerCase()
|
|
1323
1314
|
]) {
|
|
1324
1315
|
const id = sectionIdMap.get(variation);
|
|
1325
1316
|
if (id) {
|
|
@@ -1329,7 +1320,7 @@ function buildHeadingIdMap(content, sectionIds) {
|
|
|
1329
1320
|
}
|
|
1330
1321
|
}
|
|
1331
1322
|
if (assigned === void 0) {
|
|
1332
|
-
const baseId = _chunkYXWGSDK4cjs.slugifyHeadingText.call(void 0,
|
|
1323
|
+
const baseId = _chunkYXWGSDK4cjs.slugifyHeadingText.call(void 0, text);
|
|
1333
1324
|
assigned = dedupe(
|
|
1334
1325
|
baseId || (level <= EXTRACTOR_MAX_LEVEL ? `section-${sectionOrdinal}` : `heading-${headingOrdinal}`)
|
|
1335
1326
|
);
|
|
@@ -2320,8 +2311,8 @@ function findInlineCodeRanges(source) {
|
|
|
2320
2311
|
}
|
|
2321
2312
|
return ranges;
|
|
2322
2313
|
}
|
|
2323
|
-
function foldAsciiCase(
|
|
2324
|
-
return
|
|
2314
|
+
function foldAsciiCase(text) {
|
|
2315
|
+
return text.replace(/[A-Z]/g, (c) => String.fromCharCode(c.charCodeAt(0) + 32));
|
|
2325
2316
|
}
|
|
2326
2317
|
function blankRanges(masked, ranges) {
|
|
2327
2318
|
if (ranges.length === 0) return masked;
|
|
@@ -2563,13 +2554,13 @@ function footnoteLabelEnd(c, open) {
|
|
|
2563
2554
|
}
|
|
2564
2555
|
function blankUnreferencedFootnotes(masked, lines, folded) {
|
|
2565
2556
|
if (masked.indexOf("[^") === -1) return masked;
|
|
2566
|
-
const
|
|
2557
|
+
const text = (line) => stripCr(masked.slice(line.contentStart, line.contentStart + line.content.length));
|
|
2567
2558
|
const refMask = footnoteReferenceMask(masked, folded);
|
|
2568
2559
|
const refText = (line) => stripCr(refMask.slice(line.contentStart, line.contentStart + line.content.length));
|
|
2569
2560
|
const referenced = /* @__PURE__ */ new Set();
|
|
2570
2561
|
const defAt = [];
|
|
2571
2562
|
for (const line of lines) {
|
|
2572
|
-
const c =
|
|
2563
|
+
const c = text(line);
|
|
2573
2564
|
let isDef = null;
|
|
2574
2565
|
if (c.indexOf("[^") !== -1) {
|
|
2575
2566
|
const open = FOOTNOTE_DEF_OPEN_RE.exec(c);
|
|
@@ -2598,13 +2589,13 @@ function blankUnreferencedFootnotes(masked, lines, folded) {
|
|
|
2598
2589
|
for (let i = 0; i < lines.length; i++) {
|
|
2599
2590
|
const at = defAt[i];
|
|
2600
2591
|
if (at === null) continue;
|
|
2601
|
-
const head =
|
|
2592
|
+
const head = text(lines[i]);
|
|
2602
2593
|
const end = footnoteLabelEnd(head, at);
|
|
2603
2594
|
if (referenced.has(normalizeFootnoteLabel(head.slice(at + 2, end)))) continue;
|
|
2604
2595
|
let j = i;
|
|
2605
2596
|
let sawBlank = false;
|
|
2606
2597
|
for (let k = i + 1; k < lines.length; k++) {
|
|
2607
|
-
const c =
|
|
2598
|
+
const c = text(lines[k]);
|
|
2608
2599
|
if (_chunkYXWGSDK4cjs.isBlankLine.call(void 0, c)) {
|
|
2609
2600
|
sawBlank = true;
|
|
2610
2601
|
continue;
|
|
@@ -2787,9 +2778,9 @@ function spliceWindows(masked, edits) {
|
|
|
2787
2778
|
if (edits.length === 0) return masked;
|
|
2788
2779
|
const parts = [];
|
|
2789
2780
|
let cursor = 0;
|
|
2790
|
-
for (const [from, to,
|
|
2781
|
+
for (const [from, to, text] of edits) {
|
|
2791
2782
|
if (from > cursor) parts.push(masked.slice(cursor, from));
|
|
2792
|
-
parts.push(
|
|
2783
|
+
parts.push(text);
|
|
2793
2784
|
cursor = to;
|
|
2794
2785
|
}
|
|
2795
2786
|
parts.push(masked.slice(cursor));
|
|
@@ -2893,8 +2884,8 @@ function blankListItemCode(masked, lines, depth = 0) {
|
|
|
2893
2884
|
flush();
|
|
2894
2885
|
return spliceWindows(masked, edits);
|
|
2895
2886
|
}
|
|
2896
|
-
function buildCloserHaystack(
|
|
2897
|
-
const folded = foldAsciiCase(
|
|
2887
|
+
function buildCloserHaystack(text) {
|
|
2888
|
+
const folded = foldAsciiCase(text);
|
|
2898
2889
|
const lines = toMaskLines(folded);
|
|
2899
2890
|
let masked = blankRanges(folded, findInlineCodeRanges(folded));
|
|
2900
2891
|
masked = blankFencedRegions(masked, lines);
|
|
@@ -3081,8 +3072,8 @@ function htmlBlockStartKind(line, inParagraph) {
|
|
|
3081
3072
|
if (!inParagraph && HTML_BLOCK_START_7.test(line)) return 7;
|
|
3082
3073
|
return null;
|
|
3083
3074
|
}
|
|
3084
|
-
function computeHtmlBlockRanges(
|
|
3085
|
-
if (
|
|
3075
|
+
function computeHtmlBlockRanges(text) {
|
|
3076
|
+
if (text.indexOf("<") === -1) return [];
|
|
3086
3077
|
const ranges = [];
|
|
3087
3078
|
const fences = _chunkYXWGSDK4cjs.createFenceTracker.call(void 0, );
|
|
3088
3079
|
let kind = null;
|
|
@@ -3092,7 +3083,7 @@ function computeHtmlBlockRanges(text2) {
|
|
|
3092
3083
|
let offset2 = 0;
|
|
3093
3084
|
let listContentCol = 0;
|
|
3094
3085
|
let openPrefixLen = 0;
|
|
3095
|
-
for (const line of
|
|
3086
|
+
for (const line of text.split("\n")) {
|
|
3096
3087
|
const lineStart = offset2;
|
|
3097
3088
|
const lineEnd = offset2 + line.length;
|
|
3098
3089
|
offset2 = lineEnd + 1;
|
|
@@ -3154,21 +3145,21 @@ function escapeLeftoverTagStarts(gap, lowerSource, gapOffset) {
|
|
|
3154
3145
|
(m, slash, tag, at) => isMaskedBlank(lowerSource, gapOffset + at, gapOffset + at + m.length) ? m : `<${slash}${tag}`
|
|
3155
3146
|
);
|
|
3156
3147
|
}
|
|
3157
|
-
function escapeUnknownHtmlTags(
|
|
3158
|
-
if (!
|
|
3159
|
-
const lowerSource = buildCloserHaystack(
|
|
3148
|
+
function escapeUnknownHtmlTags(text, allowedTags = SAFE_HTML_TAGS) {
|
|
3149
|
+
if (!text || text.indexOf("<") === -1) return text;
|
|
3150
|
+
const lowerSource = buildCloserHaystack(text);
|
|
3160
3151
|
let htmlBlocks = null;
|
|
3161
3152
|
const spanInsideHtmlBlock = (from, to) => {
|
|
3162
|
-
_nullishCoalesce(htmlBlocks, () => ( (htmlBlocks = computeHtmlBlockRanges(
|
|
3153
|
+
_nullishCoalesce(htmlBlocks, () => ( (htmlBlocks = computeHtmlBlockRanges(text))));
|
|
3163
3154
|
return htmlBlocks.some((r) => r.start < to && r.end > from);
|
|
3164
3155
|
};
|
|
3165
3156
|
const parts = [];
|
|
3166
3157
|
let cursor = 0;
|
|
3167
3158
|
PROTECTED_SPAN_RE.lastIndex = 0;
|
|
3168
3159
|
let span;
|
|
3169
|
-
while ((span = PROTECTED_SPAN_RE.exec(
|
|
3160
|
+
while ((span = PROTECTED_SPAN_RE.exec(text)) !== null) {
|
|
3170
3161
|
if (span.index > cursor) {
|
|
3171
|
-
parts.push(escapeOutsideFences(
|
|
3162
|
+
parts.push(escapeOutsideFences(text.slice(cursor, span.index), allowedTags, lowerSource, cursor));
|
|
3172
3163
|
}
|
|
3173
3164
|
const isFence = span[1] !== void 0;
|
|
3174
3165
|
const spanEnd = span.index + span[0].length;
|
|
@@ -3177,8 +3168,8 @@ function escapeUnknownHtmlTags(text2, allowedTags = SAFE_HTML_TAGS) {
|
|
|
3177
3168
|
);
|
|
3178
3169
|
cursor = span.index + span[0].length;
|
|
3179
3170
|
}
|
|
3180
|
-
if (cursor <
|
|
3181
|
-
parts.push(escapeOutsideFences(
|
|
3171
|
+
if (cursor < text.length) {
|
|
3172
|
+
parts.push(escapeOutsideFences(text.slice(cursor), allowedTags, lowerSource, cursor));
|
|
3182
3173
|
}
|
|
3183
3174
|
return parts.join("");
|
|
3184
3175
|
}
|
|
@@ -3361,12 +3352,12 @@ function splitStreamingBlocks(content) {
|
|
|
3361
3352
|
}
|
|
3362
3353
|
let cursorLine = 1;
|
|
3363
3354
|
return units.map((unitLines, idx) => {
|
|
3364
|
-
const
|
|
3355
|
+
const text = unitLines.join("\n");
|
|
3365
3356
|
const isTail = idx === units.length - 1;
|
|
3366
3357
|
const startLine = cursorLine;
|
|
3367
3358
|
cursorLine += unitLines.length;
|
|
3368
3359
|
return {
|
|
3369
|
-
text
|
|
3360
|
+
text,
|
|
3370
3361
|
index: idx,
|
|
3371
3362
|
startLine,
|
|
3372
3363
|
// Units carrying UNBALANCED raw HTML are never cached: an open
|
|
@@ -3376,7 +3367,7 @@ function splitStreamingBlocks(content) {
|
|
|
3376
3367
|
// opens AND closes within the unit (`<div>x</div>`) leaves the
|
|
3377
3368
|
// scanner's depth unchanged, so it stays memoizable — correctly: its
|
|
3378
3369
|
// parse cannot be invalidated by later tokens.
|
|
3379
|
-
memoizable: !isTail && !unitTouchedHtml[idx] && !NON_MEMOIZABLE_RE.test(
|
|
3370
|
+
memoizable: !isTail && !unitTouchedHtml[idx] && !NON_MEMOIZABLE_RE.test(text)
|
|
3380
3371
|
};
|
|
3381
3372
|
});
|
|
3382
3373
|
}
|
|
@@ -3465,7 +3456,7 @@ function resolveTextSizeConfig(config) {
|
|
|
3465
3456
|
|
|
3466
3457
|
var NO_BROKEN_LINKS = [];
|
|
3467
3458
|
var StreamingBlockRenderer = _react.memo.call(void 0, function StreamingBlockRendererImpl({
|
|
3468
|
-
text
|
|
3459
|
+
text,
|
|
3469
3460
|
remarkPlugins,
|
|
3470
3461
|
rehypePlugins,
|
|
3471
3462
|
components
|
|
@@ -3477,7 +3468,7 @@ var StreamingBlockRenderer = _react.memo.call(void 0, function StreamingBlockRen
|
|
|
3477
3468
|
rehypePlugins,
|
|
3478
3469
|
urlTransform: cardAwareUrlTransform,
|
|
3479
3470
|
components,
|
|
3480
|
-
children:
|
|
3471
|
+
children: text
|
|
3481
3472
|
}
|
|
3482
3473
|
);
|
|
3483
3474
|
});
|
|
@@ -3625,7 +3616,7 @@ var thoughtMdClasses = [
|
|
|
3625
3616
|
"[&_.code-block-container_>div:last-child]:!p-3"
|
|
3626
3617
|
].join(" ");
|
|
3627
3618
|
var ThinkingDisplay = _react.forwardRef.call(void 0,
|
|
3628
|
-
({ className, text
|
|
3619
|
+
({ className, text, isStreaming = false, ...props }, ref) => {
|
|
3629
3620
|
const [expanded, setExpanded] = _react.useState.call(void 0, false);
|
|
3630
3621
|
const { innerRef, isOverflowing, containerStyle } = useCollapsible({
|
|
3631
3622
|
expanded,
|
|
@@ -3659,7 +3650,7 @@ var ThinkingDisplay = _react.forwardRef.call(void 0,
|
|
|
3659
3650
|
] }),
|
|
3660
3651
|
isStreaming && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.DotsLoaderIcon, { size: 16, className: "text-ods-text-secondary" })
|
|
3661
3652
|
] }),
|
|
3662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 flex-1", style: containerStyle, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: innerRef, className: _chunk23V5BSHDcjs.cn.call(void 0, "text-sm leading-snug text-ods-text-secondary", thoughtMdClasses), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SimpleMarkdownRenderer, { content:
|
|
3653
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 flex-1", style: containerStyle, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: innerRef, className: _chunk23V5BSHDcjs.cn.call(void 0, "text-sm leading-snug text-ods-text-secondary", thoughtMdClasses), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SimpleMarkdownRenderer, { content: text, textSize: "compact" }) }) }),
|
|
3663
3654
|
canToggle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-[19px] shrink-0 items-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandChevron, { expanded }) })
|
|
3664
3655
|
]
|
|
3665
3656
|
}
|
|
@@ -3672,15 +3663,15 @@ ThinkingDisplay.displayName = "ThinkingDisplay";
|
|
|
3672
3663
|
|
|
3673
3664
|
|
|
3674
3665
|
var LOCKED_HINT = "This question was already answered";
|
|
3675
|
-
var AskDisplay = _react.forwardRef.call(void 0, ({ className, cards
|
|
3666
|
+
var AskDisplay = _react.forwardRef.call(void 0, ({ className, cards, onSelect, ...props }, ref) => {
|
|
3676
3667
|
const [index, setIndex] = _react.useState.call(void 0, 0);
|
|
3677
3668
|
const lockedHintId = _react.useId.call(void 0, );
|
|
3678
3669
|
_react.useEffect.call(void 0, () => {
|
|
3679
|
-
setIndex((current) => current <
|
|
3680
|
-
}, [
|
|
3681
|
-
const active =
|
|
3670
|
+
setIndex((current) => current < cards.length ? current : Math.max(0, cards.length - 1));
|
|
3671
|
+
}, [cards.length]);
|
|
3672
|
+
const active = cards[Math.min(index, cards.length - 1)];
|
|
3682
3673
|
if (!active) return null;
|
|
3683
|
-
const showPager =
|
|
3674
|
+
const showPager = cards.length > 1;
|
|
3684
3675
|
const isInteractive = !!onSelect;
|
|
3685
3676
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3686
3677
|
"div",
|
|
@@ -3712,15 +3703,15 @@ var AskDisplay = _react.forwardRef.call(void 0, ({ className, cards: cards2, onS
|
|
|
3712
3703
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "whitespace-nowrap text-ods-text-secondary text-h6", children: [
|
|
3713
3704
|
index + 1,
|
|
3714
3705
|
" of ",
|
|
3715
|
-
|
|
3706
|
+
cards.length
|
|
3716
3707
|
] }),
|
|
3717
3708
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3718
3709
|
"button",
|
|
3719
3710
|
{
|
|
3720
3711
|
type: "button",
|
|
3721
3712
|
"aria-label": "Next question",
|
|
3722
|
-
disabled: index ===
|
|
3723
|
-
onClick: () => setIndex((current) => Math.min(
|
|
3713
|
+
disabled: index === cards.length - 1,
|
|
3714
|
+
onClick: () => setIndex((current) => Math.min(cards.length - 1, current + 1)),
|
|
3724
3715
|
className: "text-ods-text-secondary transition-colors hover:text-ods-text-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:text-ods-text-secondary",
|
|
3725
3716
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Chevron02RightIcon, { size: 16 })
|
|
3726
3717
|
}
|
|
@@ -5787,12 +5778,12 @@ function placeCaretAtOffset(el, offset2) {
|
|
|
5787
5778
|
sel.removeAllRanges();
|
|
5788
5779
|
sel.addRange(range);
|
|
5789
5780
|
}
|
|
5790
|
-
function insertTextAtCaret(
|
|
5781
|
+
function insertTextAtCaret(text) {
|
|
5791
5782
|
const sel = typeof window !== "undefined" ? window.getSelection() : null;
|
|
5792
5783
|
if (!sel || sel.rangeCount === 0) return;
|
|
5793
5784
|
const range = sel.getRangeAt(0);
|
|
5794
5785
|
range.deleteContents();
|
|
5795
|
-
const tn = document.createTextNode(
|
|
5786
|
+
const tn = document.createTextNode(text);
|
|
5796
5787
|
range.insertNode(tn);
|
|
5797
5788
|
range.setStartAfter(tn);
|
|
5798
5789
|
range.collapse(true);
|
|
@@ -5994,9 +5985,9 @@ var ChatInput = _react.forwardRef.call(void 0, (allProps, ref) => {
|
|
|
5994
5985
|
const handlePaste = _react.useCallback.call(void 0,
|
|
5995
5986
|
(e) => {
|
|
5996
5987
|
e.preventDefault();
|
|
5997
|
-
const
|
|
5998
|
-
if (!
|
|
5999
|
-
insertTextAtCaret(
|
|
5988
|
+
const text = e.clipboardData.getData("text/plain");
|
|
5989
|
+
if (!text) return;
|
|
5990
|
+
insertTextAtCaret(text);
|
|
6000
5991
|
syncFromDom();
|
|
6001
5992
|
},
|
|
6002
5993
|
[syncFromDom]
|
|
@@ -6253,14 +6244,6 @@ ChatInput.displayName = "ChatInput";
|
|
|
6253
6244
|
// src/components/chat/chat-message-enhanced.tsx
|
|
6254
6245
|
|
|
6255
6246
|
|
|
6256
|
-
// src/chat-protocol/card-marker.ts
|
|
6257
|
-
var CARD_TYPE = "[a-zA-Z0-9_-]+";
|
|
6258
|
-
var CARD_ID = "[^\\]\\r\\n)]+";
|
|
6259
|
-
var CARD_REFERENCE = new RegExp(`^\\[card://(${CARD_TYPE}):(${CARD_ID})\\]$`);
|
|
6260
|
-
function createCardMarkerScanner() {
|
|
6261
|
-
return new RegExp(`\\[card://(${CARD_TYPE}):(${CARD_ID})[\\])]`, "g");
|
|
6262
|
-
}
|
|
6263
|
-
|
|
6264
6247
|
// src/utils/date-utils.ts
|
|
6265
6248
|
function formatTicketRelativeTime(iso) {
|
|
6266
6249
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -6814,21 +6797,21 @@ function BlockCard(_props) {
|
|
|
6814
6797
|
|
|
6815
6798
|
// src/components/chat/remark-card-links.ts
|
|
6816
6799
|
var _unistutilvisit = require('unist-util-visit');
|
|
6817
|
-
var CARD_REGEX =
|
|
6800
|
+
var CARD_REGEX = /\[card:\/\/([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)[\])]/g;
|
|
6818
6801
|
var remarkCardLinks = () => {
|
|
6819
6802
|
return (tree) => {
|
|
6820
6803
|
_unistutilvisit.visit.call(void 0, tree, "text", (node, index, parent) => {
|
|
6821
6804
|
if (!parent || typeof index !== "number") return void 0;
|
|
6822
|
-
const
|
|
6823
|
-
if (!
|
|
6805
|
+
const text = node.value;
|
|
6806
|
+
if (!text || !text.includes("[card://")) return void 0;
|
|
6824
6807
|
const parts = [];
|
|
6825
6808
|
let lastIndex = 0;
|
|
6826
6809
|
CARD_REGEX.lastIndex = 0;
|
|
6827
6810
|
let match;
|
|
6828
|
-
while ((match = CARD_REGEX.exec(
|
|
6811
|
+
while ((match = CARD_REGEX.exec(text)) !== null) {
|
|
6829
6812
|
const matchStart = match.index;
|
|
6830
6813
|
if (matchStart > lastIndex) {
|
|
6831
|
-
parts.push({ type: "text", value:
|
|
6814
|
+
parts.push({ type: "text", value: text.slice(lastIndex, matchStart) });
|
|
6832
6815
|
}
|
|
6833
6816
|
const cardType = match[1];
|
|
6834
6817
|
const cardId = match[2];
|
|
@@ -6843,8 +6826,8 @@ var remarkCardLinks = () => {
|
|
|
6843
6826
|
lastIndex = matchStart + match[0].length;
|
|
6844
6827
|
}
|
|
6845
6828
|
if (lastIndex === 0) return void 0;
|
|
6846
|
-
if (lastIndex <
|
|
6847
|
-
parts.push({ type: "text", value:
|
|
6829
|
+
if (lastIndex < text.length) {
|
|
6830
|
+
parts.push({ type: "text", value: text.slice(lastIndex) });
|
|
6848
6831
|
}
|
|
6849
6832
|
parent.children.splice(index, 1, ...parts);
|
|
6850
6833
|
return [_unistutilvisit.SKIP, index + parts.length];
|
|
@@ -6859,19 +6842,19 @@ var remarkMentionChips = () => {
|
|
|
6859
6842
|
return (tree) => {
|
|
6860
6843
|
_unistutilvisit.visit.call(void 0, tree, "text", (node, index, parent) => {
|
|
6861
6844
|
if (!parent || typeof index !== "number") return void 0;
|
|
6862
|
-
const
|
|
6863
|
-
if (!
|
|
6845
|
+
const text = node.value;
|
|
6846
|
+
if (!text || !text.includes("@")) return void 0;
|
|
6864
6847
|
const parts = [];
|
|
6865
6848
|
let lastIndex = 0;
|
|
6866
6849
|
MENTION_REGEX.lastIndex = 0;
|
|
6867
6850
|
let match;
|
|
6868
|
-
while ((match = MENTION_REGEX.exec(
|
|
6851
|
+
while ((match = MENTION_REGEX.exec(text)) !== null) {
|
|
6869
6852
|
const lead = match[1];
|
|
6870
6853
|
const marker = match[2];
|
|
6871
6854
|
const id = match[3];
|
|
6872
6855
|
const tokenStart = match.index + lead.length;
|
|
6873
6856
|
if (tokenStart > lastIndex) {
|
|
6874
|
-
parts.push({ type: "text", value:
|
|
6857
|
+
parts.push({ type: "text", value: text.slice(lastIndex, tokenStart) });
|
|
6875
6858
|
}
|
|
6876
6859
|
parts.push({
|
|
6877
6860
|
type: "link",
|
|
@@ -6883,8 +6866,8 @@ var remarkMentionChips = () => {
|
|
|
6883
6866
|
lastIndex = match.index + match[0].length;
|
|
6884
6867
|
}
|
|
6885
6868
|
if (lastIndex === 0) return void 0;
|
|
6886
|
-
if (lastIndex <
|
|
6887
|
-
parts.push({ type: "text", value:
|
|
6869
|
+
if (lastIndex < text.length) {
|
|
6870
|
+
parts.push({ type: "text", value: text.slice(lastIndex) });
|
|
6888
6871
|
}
|
|
6889
6872
|
parent.children.splice(index, 1, ...parts);
|
|
6890
6873
|
return [_unistutilvisit.SKIP, index + parts.length];
|
|
@@ -6936,8 +6919,6 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
|
|
|
6936
6919
|
return [...commandEntries, ...otherEntries];
|
|
6937
6920
|
}, [message.parameters, variant]);
|
|
6938
6921
|
const hasResult = isExecuted && typeof message.result === "string" && message.result.length > 0;
|
|
6939
|
-
const isConciseRemoteRead = !message.integratedToolType && !!previewText && argEntries.length === 0 && !hasResult;
|
|
6940
|
-
const isStaticRow = isClientView || isConciseRemoteRead;
|
|
6941
6922
|
const hasBody = argEntries.length > 0 || hasResult || isExecuting;
|
|
6942
6923
|
const renderStatusIcon = () => {
|
|
6943
6924
|
if (isExecuting) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.DotsLoaderIcon, { size: 16, className: "text-ods-text-secondary" });
|
|
@@ -6958,7 +6939,7 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
|
|
|
6958
6939
|
}
|
|
6959
6940
|
),
|
|
6960
6941
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: renderStatusIcon() }),
|
|
6961
|
-
!
|
|
6942
|
+
!isClientView && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandChevron, { expanded }) })
|
|
6962
6943
|
] });
|
|
6963
6944
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6964
6945
|
"div",
|
|
@@ -6971,10 +6952,9 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
|
|
|
6971
6952
|
className
|
|
6972
6953
|
),
|
|
6973
6954
|
...props,
|
|
6974
|
-
children:
|
|
6975
|
-
//
|
|
6976
|
-
//
|
|
6977
|
-
// detail) and a remote read-only tool (there IS no detail).
|
|
6955
|
+
children: isClientView ? (
|
|
6956
|
+
// Client (Fae end-user): static, non-expandable row — no chevron, no
|
|
6957
|
+
// body. Just the explanation + status; command/args/result are hidden.
|
|
6978
6958
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full items-start gap-[var(--spacing-system-xs)] p-[var(--spacing-system-s)] text-left", children: headerContent })
|
|
6979
6959
|
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
6980
6960
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7019,7 +6999,7 @@ ToolExecutionDisplay.displayName = "ToolExecutionDisplay";
|
|
|
7019
6999
|
// src/components/chat/chat-message-enhanced.tsx
|
|
7020
7000
|
|
|
7021
7001
|
var MENTION_MARKER_REGEX = /(^|[^\w@])@[a-zA-Z]+:([A-Za-z0-9_.+/=-]*[A-Za-z0-9_+/=])/g;
|
|
7022
|
-
var CARD_MARKER_REGEX =
|
|
7002
|
+
var CARD_MARKER_REGEX = /\[card:\/\/([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)[\])]/g;
|
|
7023
7003
|
function formatMessageTimestamp(timestamp) {
|
|
7024
7004
|
const time = formatTime(timestamp);
|
|
7025
7005
|
return isToday(timestamp) ? time : `${formatDate(timestamp)} ${time}`;
|
|
@@ -7066,7 +7046,6 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7066
7046
|
renderContextItem,
|
|
7067
7047
|
renderMention,
|
|
7068
7048
|
renderEntityCard,
|
|
7069
|
-
refs,
|
|
7070
7049
|
onAskSelect,
|
|
7071
7050
|
NavLinkAnchor,
|
|
7072
7051
|
...props
|
|
@@ -7101,11 +7080,6 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7101
7080
|
const renderedCardNodeCache = _react.useRef.call(void 0,
|
|
7102
7081
|
/* @__PURE__ */ new Map()
|
|
7103
7082
|
);
|
|
7104
|
-
const refByKey = _react.useMemo.call(void 0, () => {
|
|
7105
|
-
const byKey = /* @__PURE__ */ new Map();
|
|
7106
|
-
for (const described of _nullishCoalesce(refs, () => ( []))) byKey.set(`${described.type}:${described.id}`, described);
|
|
7107
|
-
return byKey;
|
|
7108
|
-
}, [refs]);
|
|
7109
7083
|
const renderingPlan = _react.useMemo.call(void 0, () => {
|
|
7110
7084
|
if (!hasMarkerSupport) return null;
|
|
7111
7085
|
const render = renderEntityCard;
|
|
@@ -7117,33 +7091,32 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7117
7091
|
const emittedBlockKeys = /* @__PURE__ */ new Set();
|
|
7118
7092
|
segments.forEach((segment, segIdx) => {
|
|
7119
7093
|
if (segment.type !== "text") return;
|
|
7120
|
-
const
|
|
7094
|
+
const text = segment.text;
|
|
7121
7095
|
const parts = [];
|
|
7122
7096
|
let cursor = 0;
|
|
7123
7097
|
CARD_MARKER_REGEX.lastIndex = 0;
|
|
7124
7098
|
let match;
|
|
7125
|
-
while ((match = CARD_MARKER_REGEX.exec(
|
|
7099
|
+
while ((match = CARD_MARKER_REGEX.exec(text)) !== null) {
|
|
7126
7100
|
const cardType = match[1];
|
|
7127
7101
|
const cardId = match[2];
|
|
7128
7102
|
const key = `${cardType}:${cardId}`;
|
|
7129
7103
|
usedKeys.add(key);
|
|
7130
|
-
const describedRef = refByKey.get(key);
|
|
7131
7104
|
let entry = cache.get(key);
|
|
7132
|
-
if (!entry || entry.render !== render
|
|
7133
|
-
const refForRender =
|
|
7105
|
+
if (!entry || entry.render !== render) {
|
|
7106
|
+
const refForRender = {
|
|
7134
7107
|
type: cardType,
|
|
7135
7108
|
id: cardId,
|
|
7136
7109
|
title: cardId,
|
|
7137
7110
|
url: null
|
|
7138
|
-
}
|
|
7139
|
-
entry = { render,
|
|
7111
|
+
};
|
|
7112
|
+
entry = { render, node: render(refForRender) };
|
|
7140
7113
|
cache.set(key, entry);
|
|
7141
7114
|
}
|
|
7142
7115
|
const rendered = entry.node;
|
|
7143
7116
|
if (_react2.default.isValidElement(rendered) && rendered.type === BlockCard) {
|
|
7144
7117
|
const cardProps = rendered.props;
|
|
7145
7118
|
const markerEnd = match.index + match[0].length;
|
|
7146
|
-
parts.push({ kind: "text", text:
|
|
7119
|
+
parts.push({ kind: "text", text: text.slice(cursor, markerEnd) });
|
|
7147
7120
|
if (!emittedBlockKeys.has(key)) {
|
|
7148
7121
|
emittedBlockKeys.add(key);
|
|
7149
7122
|
parts.push({ kind: "block", key, node: cardProps.children });
|
|
@@ -7154,7 +7127,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7154
7127
|
cardProps.inline != null ? cardProps.inline : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "font-medium text-ods-text-primary", children: cardId })
|
|
7155
7128
|
);
|
|
7156
7129
|
} else if (rendered != null) {
|
|
7157
|
-
parts.push({ kind: "text", text:
|
|
7130
|
+
parts.push({ kind: "text", text: text.slice(cursor, match.index) });
|
|
7158
7131
|
if (!emittedBlockKeys.has(key)) {
|
|
7159
7132
|
emittedBlockKeys.add(key);
|
|
7160
7133
|
parts.push({ kind: "block", key, node: rendered });
|
|
@@ -7162,15 +7135,15 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7162
7135
|
cursor = match.index + match[0].length;
|
|
7163
7136
|
}
|
|
7164
7137
|
}
|
|
7165
|
-
if (cursor <
|
|
7166
|
-
parts.push({ kind: "text", text:
|
|
7138
|
+
if (cursor < text.length) {
|
|
7139
|
+
parts.push({ kind: "text", text: text.slice(cursor) });
|
|
7167
7140
|
}
|
|
7168
7141
|
if (parts.some((p) => p.kind === "block")) {
|
|
7169
7142
|
partsBySegment.set(segIdx, parts);
|
|
7170
7143
|
}
|
|
7171
7144
|
});
|
|
7172
7145
|
return { inlineByKey, partsBySegment, usedKeys };
|
|
7173
|
-
}, [hasMarkerSupport, renderEntityCard,
|
|
7146
|
+
}, [hasMarkerSupport, renderEntityCard, segments]);
|
|
7174
7147
|
_react.useEffect.call(void 0, () => {
|
|
7175
7148
|
const cache = renderedCardNodeCache.current;
|
|
7176
7149
|
const usedKeys = _optionalChain([renderingPlan, 'optionalAccess', _115 => _115.usedKeys]);
|
|
@@ -7219,13 +7192,13 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
|
|
|
7219
7192
|
}
|
|
7220
7193
|
};
|
|
7221
7194
|
}, [hasMarkerSupport, hasMentionSupport, renderMention, NavLinkAnchor]);
|
|
7222
|
-
const renderSegmentBody = (segIndex,
|
|
7195
|
+
const renderSegmentBody = (segIndex, text, isStreaming) => {
|
|
7223
7196
|
const parts = _optionalChain([renderingPlan, 'optionalAccess', _121 => _121.partsBySegment, 'access', _122 => _122.get, 'call', _123 => _123(segIndex)]);
|
|
7224
7197
|
if (!parts || parts.length === 0) {
|
|
7225
7198
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7226
7199
|
SimpleMarkdownRenderer,
|
|
7227
7200
|
{
|
|
7228
|
-
content:
|
|
7201
|
+
content: text,
|
|
7229
7202
|
textSize: "compact",
|
|
7230
7203
|
additionalRemarkPlugins: cardRemarkPlugins,
|
|
7231
7204
|
componentOverrides: cardComponentOverrides,
|
|
@@ -7397,9 +7370,7 @@ var MemoizedChatMessageEnhanced = _react.memo.call(void 0, ChatMessageEnhanced,
|
|
|
7397
7370
|
// message (it's set once on the optimistic send and never mutated).
|
|
7398
7371
|
prevProps.contextItems === nextProps.contextItems && prevProps.resolveContextIcon === nextProps.resolveContextIcon && prevProps.renderContextItem === nextProps.renderContextItem && // Host keeps this stable (module const / useCallback), so reference
|
|
7399
7372
|
// equality holds across streaming chunks.
|
|
7400
|
-
prevProps.renderMention === nextProps.renderMention && prevProps.renderEntityCard === nextProps.renderEntityCard && //
|
|
7401
|
-
// forwards the same array instance, so it holds across streaming chunks.
|
|
7402
|
-
prevProps.refs === nextProps.refs && // Same stability contract as the renderers above: hosts pass a `useCallback`
|
|
7373
|
+
prevProps.renderMention === nextProps.renderMention && prevProps.renderEntityCard === nextProps.renderEntityCard && // Same stability contract as the renderers above: hosts pass a `useCallback`
|
|
7403
7374
|
// (EmbeddableChat passes its memoized `handleSend`), so this holds across
|
|
7404
7375
|
// streaming chunks instead of re-rendering every ask card per chunk.
|
|
7405
7376
|
prevProps.onAskSelect === nextProps.onAskSelect && prevProps.NavLinkAnchor === nextProps.NavLinkAnchor;
|
|
@@ -7496,11 +7467,11 @@ var BLINK_KEYFRAMES = `
|
|
|
7496
7467
|
`;
|
|
7497
7468
|
function CyclingPhrase({ words, className, charMs = 60, holdMs = 4500 }) {
|
|
7498
7469
|
const [wordIndex, setWordIndex] = _react.useState.call(void 0, 0);
|
|
7499
|
-
const [
|
|
7470
|
+
const [text, setText] = _react.useState.call(void 0, "");
|
|
7500
7471
|
const [cursor, setCursor] = _react.useState.call(void 0, 0);
|
|
7501
7472
|
const target = _nullishCoalesce(words[wordIndex], () => ( ""));
|
|
7502
|
-
const holding = words.length > 0 && cursor >= Math.max(
|
|
7503
|
-
const shownText = holding ? target :
|
|
7473
|
+
const holding = words.length > 0 && cursor >= Math.max(text.length, target.length);
|
|
7474
|
+
const shownText = holding ? target : text;
|
|
7504
7475
|
const placeholder = _react.useMemo.call(void 0,
|
|
7505
7476
|
() => words.reduce((longest, w) => w.length > longest.length ? w : longest, ""),
|
|
7506
7477
|
[words]
|
|
@@ -7526,7 +7497,7 @@ function CyclingPhrase({ words, className, charMs = 60, holdMs = 4500 }) {
|
|
|
7526
7497
|
setCursor((c) => c + 1);
|
|
7527
7498
|
}, charMs);
|
|
7528
7499
|
return () => clearTimeout(timeoutId);
|
|
7529
|
-
}, [wordIndex, cursor,
|
|
7500
|
+
}, [wordIndex, cursor, text, holding, target, words, charMs, holdMs]);
|
|
7530
7501
|
if (words.length === 0) return null;
|
|
7531
7502
|
const before = shownText.slice(0, cursor);
|
|
7532
7503
|
const after = shownText.slice(cursor);
|
|
@@ -7610,7 +7581,6 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7610
7581
|
resolveContextIcon,
|
|
7611
7582
|
renderContextItem,
|
|
7612
7583
|
renderMention,
|
|
7613
|
-
renderAfterMessage,
|
|
7614
7584
|
onAskSelect,
|
|
7615
7585
|
NavLinkAnchor,
|
|
7616
7586
|
...props
|
|
@@ -7968,8 +7938,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7968
7938
|
if (message.hidden) return null;
|
|
7969
7939
|
const isEmptyPendingTurn = index === messages.length - 1 && isTyping && message.role === "assistant" && !hasNonEmptyContent(message.content) && (!Array.isArray(message.content) || message.content.every((s) => s.type === "text"));
|
|
7970
7940
|
if (isEmptyPendingTurn) return null;
|
|
7971
|
-
|
|
7972
|
-
const row = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7941
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7973
7942
|
MemoizedChatMessageEnhanced,
|
|
7974
7943
|
{
|
|
7975
7944
|
ref: getRegisterMessageEl(message.id),
|
|
@@ -7989,17 +7958,11 @@ var ChatMessageList = _react.forwardRef.call(void 0,
|
|
|
7989
7958
|
renderContextItem,
|
|
7990
7959
|
renderMention,
|
|
7991
7960
|
renderEntityCard,
|
|
7992
|
-
refs: message.refs,
|
|
7993
7961
|
onAskSelect: index > lastUserMessageIndex ? onAskSelect : void 0,
|
|
7994
7962
|
NavLinkAnchor
|
|
7995
7963
|
},
|
|
7996
7964
|
message.id
|
|
7997
7965
|
);
|
|
7998
|
-
if (!ownedContent) return row;
|
|
7999
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full min-w-0 flex-col", children: [
|
|
8000
|
-
row,
|
|
8001
|
-
ownedContent
|
|
8002
|
-
] }, message.id);
|
|
8003
7966
|
})
|
|
8004
7967
|
]
|
|
8005
7968
|
}
|
|
@@ -8148,7 +8111,7 @@ function EntityIcon({
|
|
|
8148
8111
|
size: size2 = 20,
|
|
8149
8112
|
className
|
|
8150
8113
|
}) {
|
|
8151
|
-
if (_optionalChain([icon, 'optionalAccess',
|
|
8114
|
+
if (_optionalChain([icon, 'optionalAccess', _144 => _144.url])) {
|
|
8152
8115
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8153
8116
|
_chunkWLSFBRT5cjs.next_image_default,
|
|
8154
8117
|
{
|
|
@@ -8162,7 +8125,7 @@ function EntityIcon({
|
|
|
8162
8125
|
}
|
|
8163
8126
|
);
|
|
8164
8127
|
}
|
|
8165
|
-
if (_optionalChain([icon, 'optionalAccess',
|
|
8128
|
+
if (_optionalChain([icon, 'optionalAccess', _145 => _145.name]) && BRAND_MARK_NAMES.has(icon.name)) {
|
|
8166
8129
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8167
8130
|
"span",
|
|
8168
8131
|
{
|
|
@@ -8172,8 +8135,8 @@ function EntityIcon({
|
|
|
8172
8135
|
}
|
|
8173
8136
|
);
|
|
8174
8137
|
}
|
|
8175
|
-
const Glyph = resolveIcon(_nullishCoalesce(_optionalChain([icon, 'optionalAccess',
|
|
8176
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Glyph, { size: size2, className, ..._nullishCoalesce(_optionalChain([icon, 'optionalAccess',
|
|
8138
|
+
const Glyph = resolveIcon(_nullishCoalesce(_optionalChain([icon, 'optionalAccess', _146 => _146.name]), () => ( void 0)));
|
|
8139
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Glyph, { size: size2, className, ..._nullishCoalesce(_optionalChain([icon, 'optionalAccess', _147 => _147.props]), () => ( {})) });
|
|
8177
8140
|
}
|
|
8178
8141
|
|
|
8179
8142
|
// src/components/chat/quick-action-chip.tsx
|
|
@@ -8183,7 +8146,7 @@ function getAgentAccent(slug) {
|
|
|
8183
8146
|
return slug === "fae" || slug === "mingo" ? AGENT_ACCENTS[slug] : void 0;
|
|
8184
8147
|
}
|
|
8185
8148
|
function accentFromIdentityIcon(icon) {
|
|
8186
|
-
const color = _optionalChain([icon, 'optionalAccess',
|
|
8149
|
+
const color = _optionalChain([icon, 'optionalAccess', _148 => _148.props, 'optionalAccess', _149 => _149.color]);
|
|
8187
8150
|
return typeof color === "string" && color.length > 0 ? color : void 0;
|
|
8188
8151
|
}
|
|
8189
8152
|
var ACCENT_CLASS = {
|
|
@@ -8265,7 +8228,7 @@ function QuickActionChipButton({
|
|
|
8265
8228
|
className
|
|
8266
8229
|
}) {
|
|
8267
8230
|
const themedIcon = theme && isQuickActionIconSpec(icon) && !icon.accent ? { ...icon, accent: theme.accent } : icon;
|
|
8268
|
-
const resolvedLozenge = lozenge === true ? _optionalChain([theme, 'optionalAccess',
|
|
8231
|
+
const resolvedLozenge = lozenge === true ? _optionalChain([theme, 'optionalAccess', _150 => _150.lozenge]) : lozenge === false ? void 0 : lozenge;
|
|
8269
8232
|
const resolvedIcon = renderQuickActionIcon(themedIcon);
|
|
8270
8233
|
const resolvedLabel = composeChipLabel(label, resolvedLozenge);
|
|
8271
8234
|
const tagVariant = selected ? selectedAccent === "cyan" ? "selectedCyan" : "selected" : variant;
|
|
@@ -8477,7 +8440,7 @@ function MarqueeWall({
|
|
|
8477
8440
|
if (!container || !copy) return;
|
|
8478
8441
|
const size2 = axis === "y" ? copy.offsetHeight : copy.offsetWidth;
|
|
8479
8442
|
copySizeRef.current = size2;
|
|
8480
|
-
const clone = _optionalChain([trackRef, 'access',
|
|
8443
|
+
const clone = _optionalChain([trackRef, 'access', _151 => _151.current, 'optionalAccess', _152 => _152.querySelector, 'call', _153 => _153('[data-marquee-copy="clone"]')]);
|
|
8481
8444
|
wrapSizeRef.current = clone ? axis === "y" ? clone.offsetTop - copy.offsetTop : clone.offsetLeft - copy.offsetLeft : size2 + (typeof copyGap === "number" ? copyGap : 0);
|
|
8482
8445
|
const avail = axis === "y" ? container.clientHeight : container.clientWidth;
|
|
8483
8446
|
setOverflows(size2 > avail + 1);
|
|
@@ -8498,7 +8461,7 @@ function MarqueeWall({
|
|
|
8498
8461
|
_react.useEffect.call(void 0, () => {
|
|
8499
8462
|
const el = containerRef.current;
|
|
8500
8463
|
if (!el || typeof IntersectionObserver === "undefined") return void 0;
|
|
8501
|
-
const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access',
|
|
8464
|
+
const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _154 => _154[0], 'optionalAccess', _155 => _155.isIntersecting]), () => ( true))), {
|
|
8502
8465
|
rootMargin: _chunkYXWGSDK4cjs.NEAR_VIEWPORT_ROOT_MARGIN
|
|
8503
8466
|
});
|
|
8504
8467
|
io.observe(el);
|
|
@@ -8609,7 +8572,7 @@ function MarqueeWall({
|
|
|
8609
8572
|
if (Math.abs(delta) > 3 && !dragMovedRef.current) {
|
|
8610
8573
|
dragMovedRef.current = true;
|
|
8611
8574
|
try {
|
|
8612
|
-
_optionalChain([containerRef, 'access',
|
|
8575
|
+
_optionalChain([containerRef, 'access', _156 => _156.current, 'optionalAccess', _157 => _157.setPointerCapture, 'call', _158 => _158(e.pointerId)]);
|
|
8613
8576
|
} catch (e7) {
|
|
8614
8577
|
}
|
|
8615
8578
|
}
|
|
@@ -8626,7 +8589,7 @@ function MarqueeWall({
|
|
|
8626
8589
|
dragSuppressUntilRef.current = performance.now() + DRAG_RESUME_MS;
|
|
8627
8590
|
if (dragMovedRef.current) {
|
|
8628
8591
|
try {
|
|
8629
|
-
_optionalChain([containerRef, 'access',
|
|
8592
|
+
_optionalChain([containerRef, 'access', _159 => _159.current, 'optionalAccess', _160 => _160.releasePointerCapture, 'call', _161 => _161(e.pointerId)]);
|
|
8630
8593
|
} catch (e8) {
|
|
8631
8594
|
}
|
|
8632
8595
|
}
|
|
@@ -9062,7 +9025,7 @@ var ChatTicketItem = _react.forwardRef.call(void 0,
|
|
|
9062
9025
|
{
|
|
9063
9026
|
ref,
|
|
9064
9027
|
type: "button",
|
|
9065
|
-
onClick: () => _optionalChain([onClick, 'optionalCall',
|
|
9028
|
+
onClick: () => _optionalChain([onClick, 'optionalCall', _162 => _162(ticket.id)]),
|
|
9066
9029
|
className: _chunk23V5BSHDcjs.cn.call(void 0,
|
|
9067
9030
|
"flex h-20 w-full items-center gap-4 px-4",
|
|
9068
9031
|
"border-b border-ods-border bg-ods-card",
|
|
@@ -9293,7 +9256,7 @@ function MingoChatHistoryRow({
|
|
|
9293
9256
|
const unread = _nullishCoalesce(dialog.unreadMessagesCount, () => ( 0));
|
|
9294
9257
|
const hasMenu = !!onRequestRename || !!onRequestArchive || !!onRequestCopyLink;
|
|
9295
9258
|
const owner = dialog.owner;
|
|
9296
|
-
const hasAvatar = !!(_optionalChain([owner, 'optionalAccess',
|
|
9259
|
+
const hasAvatar = !!(_optionalChain([owner, 'optionalAccess', _163 => _163.name]) || _optionalChain([owner, 'optionalAccess', _164 => _164.avatarUrl]));
|
|
9297
9260
|
const [menuOpen, setMenuOpen] = _react.useState.call(void 0, false);
|
|
9298
9261
|
const menuItems = [
|
|
9299
9262
|
onRequestCopyLink && {
|
|
@@ -9329,11 +9292,11 @@ function MingoChatHistoryRow({
|
|
|
9329
9292
|
{
|
|
9330
9293
|
role: "button",
|
|
9331
9294
|
tabIndex: 0,
|
|
9332
|
-
onClick: () => _optionalChain([onSelect, 'optionalCall',
|
|
9295
|
+
onClick: () => _optionalChain([onSelect, 'optionalCall', _165 => _165(dialog.id)]),
|
|
9333
9296
|
onKeyDown: (e) => {
|
|
9334
9297
|
if (e.key === "Enter" || e.key === " ") {
|
|
9335
9298
|
e.preventDefault();
|
|
9336
|
-
_optionalChain([onSelect, 'optionalCall',
|
|
9299
|
+
_optionalChain([onSelect, 'optionalCall', _166 => _166(dialog.id)]);
|
|
9337
9300
|
}
|
|
9338
9301
|
},
|
|
9339
9302
|
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-[var(--spacing-system-xsf)] p-[var(--spacing-system-s)] focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-accent",
|
|
@@ -9400,8 +9363,8 @@ function MingoChatHistoryRow({
|
|
|
9400
9363
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9401
9364
|
"span",
|
|
9402
9365
|
{
|
|
9403
|
-
onClick: () => _optionalChain([onSelect, 'optionalCall',
|
|
9404
|
-
title: _optionalChain([owner, 'optionalAccess',
|
|
9366
|
+
onClick: () => _optionalChain([onSelect, 'optionalCall', _167 => _167(dialog.id)]),
|
|
9367
|
+
title: _optionalChain([owner, 'optionalAccess', _168 => _168.name]) || void 0,
|
|
9405
9368
|
className: _chunk23V5BSHDcjs.cn.call(void 0,
|
|
9406
9369
|
"absolute inset-0 flex cursor-pointer items-center justify-center transition-opacity",
|
|
9407
9370
|
hasMenu && (menuOpen ? "pointer-events-none opacity-0" : "md:group-hover/row:pointer-events-none md:group-hover/row:opacity-0 md:peer-[:focus-within]/menu:pointer-events-none md:peer-[:focus-within]/menu:opacity-0")
|
|
@@ -9411,9 +9374,9 @@ function MingoChatHistoryRow({
|
|
|
9411
9374
|
{
|
|
9412
9375
|
variant: "round",
|
|
9413
9376
|
sizePx: 24,
|
|
9414
|
-
src: _optionalChain([owner, 'optionalAccess',
|
|
9415
|
-
alt: _optionalChain([owner, 'optionalAccess',
|
|
9416
|
-
fallback: _optionalChain([owner, 'optionalAccess',
|
|
9377
|
+
src: _optionalChain([owner, 'optionalAccess', _169 => _169.avatarUrl]) || void 0,
|
|
9378
|
+
alt: _optionalChain([owner, 'optionalAccess', _170 => _170.name]) || void 0,
|
|
9379
|
+
fallback: _optionalChain([owner, 'optionalAccess', _171 => _171.name]) || void 0,
|
|
9417
9380
|
initialsClassName: "text-[10px] text-ods-text-secondary"
|
|
9418
9381
|
}
|
|
9419
9382
|
)
|
|
@@ -9464,7 +9427,7 @@ function MingoChatHistory({
|
|
|
9464
9427
|
className
|
|
9465
9428
|
}) {
|
|
9466
9429
|
const groups = _react.useMemo.call(void 0, () => groupDialogs(dialogs), [dialogs]);
|
|
9467
|
-
const noSearchResults = groups.length === 0 && !!_optionalChain([searchQuery, 'optionalAccess',
|
|
9430
|
+
const noSearchResults = groups.length === 0 && !!_optionalChain([searchQuery, 'optionalAccess', _172 => _172.trim, 'call', _173 => _173()]);
|
|
9468
9431
|
const { scrollRef, fadeTop, fadeBottom, update: updateFade } = useScrollFade();
|
|
9469
9432
|
const sentinelRef = _react.useRef.call(void 0, null);
|
|
9470
9433
|
const onLoadMoreRef = _react.useRef.call(void 0, onLoadMore);
|
|
@@ -9481,7 +9444,7 @@ function MingoChatHistory({
|
|
|
9481
9444
|
const io = new IntersectionObserver(
|
|
9482
9445
|
([entry]) => {
|
|
9483
9446
|
if (entry.isIntersecting && !isLoadingMoreRef.current) {
|
|
9484
|
-
_optionalChain([onLoadMoreRef, 'access',
|
|
9447
|
+
_optionalChain([onLoadMoreRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175()]);
|
|
9485
9448
|
}
|
|
9486
9449
|
},
|
|
9487
9450
|
{ root, rootMargin: "120px", threshold: 0.1 }
|
|
@@ -9665,8 +9628,8 @@ function MingoWelcome({
|
|
|
9665
9628
|
icon: action.icon,
|
|
9666
9629
|
variant: action.variant,
|
|
9667
9630
|
onSelect: action.onClick,
|
|
9668
|
-
onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall',
|
|
9669
|
-
onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall',
|
|
9631
|
+
onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _176 => _176(action)]),
|
|
9632
|
+
onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _177 => _177()])
|
|
9670
9633
|
})),
|
|
9671
9634
|
agentSlug,
|
|
9672
9635
|
rows: 4,
|
|
@@ -9719,9 +9682,9 @@ function GuideWelcome({
|
|
|
9719
9682
|
props: action.iconProps,
|
|
9720
9683
|
accent: _nullishCoalesce(_nullishCoalesce(action.accent, () => ( accentFromIdentityIcon(icon))), () => ( "cyan"))
|
|
9721
9684
|
},
|
|
9722
|
-
onSelect: () => _optionalChain([onQuickAction, 'optionalCall',
|
|
9723
|
-
onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall',
|
|
9724
|
-
onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall',
|
|
9685
|
+
onSelect: () => _optionalChain([onQuickAction, 'optionalCall', _178 => _178(action)]),
|
|
9686
|
+
onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _179 => _179(action)]),
|
|
9687
|
+
onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _180 => _180()])
|
|
9725
9688
|
})),
|
|
9726
9689
|
[quickActions, icon, onQuickAction, onQuickActionHover, onQuickActionHoverEnd]
|
|
9727
9690
|
);
|
|
@@ -9897,7 +9860,7 @@ function MingoHistoryRail({
|
|
|
9897
9860
|
onRetry,
|
|
9898
9861
|
className
|
|
9899
9862
|
}) {
|
|
9900
|
-
const hasSearch = !!_optionalChain([searchQuery, 'optionalAccess',
|
|
9863
|
+
const hasSearch = !!_optionalChain([searchQuery, 'optionalAccess', _181 => _181.trim, 'call', _182 => _182()]);
|
|
9901
9864
|
const hasList = dialogs.length > 0 || hasSearch;
|
|
9902
9865
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
9903
9866
|
"div",
|
|
@@ -10023,7 +9986,7 @@ var Modal = _react.forwardRef.call(void 0,
|
|
|
10023
9986
|
document.removeEventListener("focusin", containFocus);
|
|
10024
9987
|
const idx = modalStack.lastIndexOf(stackId);
|
|
10025
9988
|
if (idx !== -1) modalStack.splice(idx, 1);
|
|
10026
|
-
_optionalChain([restoreFocusRef, 'access',
|
|
9989
|
+
_optionalChain([restoreFocusRef, 'access', _183 => _183.current, 'optionalAccess', _184 => _184.focus, 'optionalCall', _185 => _185()]);
|
|
10027
9990
|
};
|
|
10028
9991
|
}, [isOpen]);
|
|
10029
9992
|
_react.useEffect.call(void 0, () => {
|
|
@@ -10273,7 +10236,7 @@ function ChatDialogModals({
|
|
|
10273
10236
|
RenameChatModal,
|
|
10274
10237
|
{
|
|
10275
10238
|
isOpen: renameTarget != null,
|
|
10276
|
-
initialName: _nullishCoalesce(_optionalChain([renameTarget, 'optionalAccess',
|
|
10239
|
+
initialName: _nullishCoalesce(_optionalChain([renameTarget, 'optionalAccess', _186 => _186.title]), () => ( "")),
|
|
10277
10240
|
onClose: () => setRenameTarget(null),
|
|
10278
10241
|
onSave: onConfirmRename
|
|
10279
10242
|
}
|
|
@@ -10345,7 +10308,7 @@ function ChatHeaderSearchField({
|
|
|
10345
10308
|
const finishCollapse = _react.useCallback.call(void 0, () => {
|
|
10346
10309
|
if (collapsedRef.current) return;
|
|
10347
10310
|
collapsedRef.current = true;
|
|
10348
|
-
_optionalChain([onCollapse, 'optionalCall',
|
|
10311
|
+
_optionalChain([onCollapse, 'optionalCall', _187 => _187()]);
|
|
10349
10312
|
}, [onCollapse]);
|
|
10350
10313
|
const beginCollapse = _react.useCallback.call(void 0, () => {
|
|
10351
10314
|
setExiting(true);
|
|
@@ -10594,8 +10557,8 @@ var ANTHROPIC_SUPPORTED_IMAGE_MIME = ["image/jpeg", "image/png", "image/webp", "
|
|
|
10594
10557
|
function buildChatAttachmentViewUrl(viewUrlPrefix, storagePath, viewToken) {
|
|
10595
10558
|
return `${viewUrlPrefix}${storagePath}?${CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM}=${encodeURIComponent(viewToken)}`;
|
|
10596
10559
|
}
|
|
10597
|
-
function escapeMarkdownInline(
|
|
10598
|
-
return
|
|
10560
|
+
function escapeMarkdownInline(text) {
|
|
10561
|
+
return text.replace(/[[\]()\\\n\r<>"]/g, (ch) => {
|
|
10599
10562
|
switch (ch) {
|
|
10600
10563
|
case "\n":
|
|
10601
10564
|
return " ";
|
|
@@ -10624,10 +10587,10 @@ var CHAT_ATTACHMENT_MARKDOWN_PATTERN = new RegExp(
|
|
|
10624
10587
|
`^\\s*!?\\[[^\\]]*\\]\\(${CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED}[^)]+\\)\\s*$`,
|
|
10625
10588
|
"gm"
|
|
10626
10589
|
);
|
|
10627
|
-
function stripChatAttachmentMarkdown(
|
|
10590
|
+
function stripChatAttachmentMarkdown(text) {
|
|
10628
10591
|
const storagePaths = [];
|
|
10629
10592
|
const pathExtract = new RegExp(`\\(${CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED}([^?)]+)`);
|
|
10630
|
-
const stripped =
|
|
10593
|
+
const stripped = text.replace(CHAT_ATTACHMENT_MARKDOWN_PATTERN, (match) => {
|
|
10631
10594
|
const m = match.match(pathExtract);
|
|
10632
10595
|
if (m && m[1]) storagePaths.push(m[1]);
|
|
10633
10596
|
return "";
|
|
@@ -10667,7 +10630,7 @@ function ChatAttachmentAddButton({
|
|
|
10667
10630
|
const canAddMore = slotsAvailable > 0 && !disabled;
|
|
10668
10631
|
const handlePick = () => {
|
|
10669
10632
|
if (!canAddMore) return;
|
|
10670
|
-
_optionalChain([fileInputRef, 'access',
|
|
10633
|
+
_optionalChain([fileInputRef, 'access', _188 => _188.current, 'optionalAccess', _189 => _189.click, 'call', _190 => _190()]);
|
|
10671
10634
|
};
|
|
10672
10635
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
10673
10636
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -10830,7 +10793,7 @@ function ChatContextMemoryBar({
|
|
|
10830
10793
|
_react.useEffect.call(void 0, () => {
|
|
10831
10794
|
if (!open) return void 0;
|
|
10832
10795
|
const onOutside = (e) => {
|
|
10833
|
-
if (_optionalChain([rootRef, 'access',
|
|
10796
|
+
if (_optionalChain([rootRef, 'access', _191 => _191.current, 'optionalAccess', _192 => _192.contains, 'call', _193 => _193(e.target)])) return;
|
|
10834
10797
|
setOpen(false);
|
|
10835
10798
|
};
|
|
10836
10799
|
document.addEventListener("mousedown", onOutside, true);
|
|
@@ -11129,7 +11092,7 @@ function ChatComposer({
|
|
|
11129
11092
|
const contextEnabled = !!contextPicker && !archived;
|
|
11130
11093
|
const selected = _nullishCoalesce(selectedContextItems, () => ( []));
|
|
11131
11094
|
const memory = _nullishCoalesce(contextMemoryItems, () => ( []));
|
|
11132
|
-
const entityTypes = _optionalChain([contextPicker, 'optionalAccess',
|
|
11095
|
+
const entityTypes = _optionalChain([contextPicker, 'optionalAccess', _194 => _194.entityTypes]);
|
|
11133
11096
|
const iconByType = _react.useMemo.call(void 0, () => {
|
|
11134
11097
|
const map = /* @__PURE__ */ new Map();
|
|
11135
11098
|
for (const t of _nullishCoalesce(entityTypes, () => ( []))) map.set(t.type, t.icon);
|
|
@@ -11156,7 +11119,7 @@ function ChatComposer({
|
|
|
11156
11119
|
startIcon: contextEnabled ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
11157
11120
|
ChatComposerPlusMenu,
|
|
11158
11121
|
{
|
|
11159
|
-
onToggle: () => contextPickerOpen ? _optionalChain([onCloseContextPicker, 'optionalCall',
|
|
11122
|
+
onToggle: () => contextPickerOpen ? _optionalChain([onCloseContextPicker, 'optionalCall', _195 => _195()]) : _optionalChain([onOpenContextPicker, 'optionalCall', _196 => _196()]),
|
|
11160
11123
|
open: contextPickerOpen,
|
|
11161
11124
|
disabled: attachmentsDisabled,
|
|
11162
11125
|
dropdown: contextPicker ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -11165,8 +11128,8 @@ function ChatComposer({
|
|
|
11165
11128
|
open: contextPickerOpen,
|
|
11166
11129
|
config: contextPicker,
|
|
11167
11130
|
selectedItems: selected,
|
|
11168
|
-
onToggleItem: (item) => _optionalChain([onToggleContextItem, 'optionalCall',
|
|
11169
|
-
onClose: () => _optionalChain([onCloseContextPicker, 'optionalCall',
|
|
11131
|
+
onToggleItem: (item) => _optionalChain([onToggleContextItem, 'optionalCall', _197 => _197(item)]),
|
|
11132
|
+
onClose: () => _optionalChain([onCloseContextPicker, 'optionalCall', _198 => _198()]),
|
|
11170
11133
|
mentionQuery
|
|
11171
11134
|
}
|
|
11172
11135
|
) : void 0
|
|
@@ -11357,8 +11320,8 @@ ChatSidebarSkeleton.displayName = "ChatSidebarSkeleton";
|
|
|
11357
11320
|
var DialogListItem = _react.forwardRef.call(void 0,
|
|
11358
11321
|
({ className, dialog, isActive, onDialogSelect, onClick, ...props }, ref) => {
|
|
11359
11322
|
const handleClick = (e) => {
|
|
11360
|
-
_optionalChain([onDialogSelect, 'optionalCall',
|
|
11361
|
-
_optionalChain([onClick, 'optionalCall',
|
|
11323
|
+
_optionalChain([onDialogSelect, 'optionalCall', _199 => _199(dialog.id)]);
|
|
11324
|
+
_optionalChain([onClick, 'optionalCall', _200 => _200(e)]);
|
|
11362
11325
|
};
|
|
11363
11326
|
const formatTimestamp = (timestamp) => {
|
|
11364
11327
|
if (!timestamp) return "";
|
|
@@ -11437,7 +11400,7 @@ var ChatSidebar = _react.forwardRef.call(void 0,
|
|
|
11437
11400
|
(entries) => {
|
|
11438
11401
|
const [entry] = entries;
|
|
11439
11402
|
if (entry.isIntersecting && !isFetchingRef.current) {
|
|
11440
|
-
_optionalChain([onLoadMoreRef, 'access',
|
|
11403
|
+
_optionalChain([onLoadMoreRef, 'access', _201 => _201.current, 'optionalCall', _202 => _202()]);
|
|
11441
11404
|
}
|
|
11442
11405
|
},
|
|
11443
11406
|
{ root: scrollContainer, rootMargin: "100px", threshold: 0.1 }
|
|
@@ -11565,7 +11528,7 @@ function isForeignOriginHref(href) {
|
|
|
11565
11528
|
function runNavigation(runtime, href, path, targetPlatform, fallbackNavigate) {
|
|
11566
11529
|
const isNewTab = runtime ? _chunkUQEOAPAIcjs.computeIsNewTab.call(void 0, runtime, href, _nullishCoalesce(targetPlatform, () => ( null))) : false;
|
|
11567
11530
|
if (isNewTab) {
|
|
11568
|
-
if (_optionalChain([runtime, 'optionalAccess',
|
|
11531
|
+
if (_optionalChain([runtime, 'optionalAccess', _203 => _203.navigation, 'access', _204 => _204.openExternal])) runtime.navigation.openExternal(href);
|
|
11569
11532
|
else window.open(href, "_blank", NEW_TAB_FEATURES);
|
|
11570
11533
|
return;
|
|
11571
11534
|
}
|
|
@@ -11573,7 +11536,7 @@ function runNavigation(runtime, href, path, targetPlatform, fallbackNavigate) {
|
|
|
11573
11536
|
if (target.includes("#") && _chunkYXWGSDK4cjs.navigateSamePageHash.call(void 0, target, { headerOffset: _chunkYXWGSDK4cjs.STICKY_HEADER_OFFSET_PX })) {
|
|
11574
11537
|
return;
|
|
11575
11538
|
}
|
|
11576
|
-
const handled = _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
|
11539
|
+
const handled = _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _205 => _205.navigation, 'access', _206 => _206.navigate, 'optionalCall', _207 => _207({ href, path, targetPlatform })]), () => ( false));
|
|
11577
11540
|
if (!handled) {
|
|
11578
11541
|
if (fallbackNavigate) fallbackNavigate(target);
|
|
11579
11542
|
else window.location.assign(target);
|
|
@@ -11632,7 +11595,7 @@ function NavLinkAnchorViaRuntime({
|
|
|
11632
11595
|
targetPlatform,
|
|
11633
11596
|
fallbackNavigate: router.push
|
|
11634
11597
|
});
|
|
11635
|
-
if (handled && !isNewTab && _optionalChain([panel, 'optionalAccess',
|
|
11598
|
+
if (handled && !isNewTab && _optionalChain([panel, 'optionalAccess', _208 => _208.closeChat])) panel.closeChat();
|
|
11636
11599
|
};
|
|
11637
11600
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: resolvedHref, ..._chunkUQEOAPAIcjs.newTabAnchorAttrs.call(void 0, isNewTab), onClick, className, children });
|
|
11638
11601
|
}
|
|
@@ -11698,11 +11661,11 @@ var DEFAULT_CAPTIONS_PATH = "/api/captions";
|
|
|
11698
11661
|
function getCaptionsUrl(entityType, entityId, srtContent, options) {
|
|
11699
11662
|
if (!srtContent) return void 0;
|
|
11700
11663
|
const hash = `${srtContent.length}-${srtContent.slice(0, 8).replace(/\s/g, "")}`;
|
|
11701
|
-
const variant = _optionalChain([options, 'optionalAccess',
|
|
11664
|
+
const variant = _optionalChain([options, 'optionalAccess', _209 => _209.variant]) ? `&variant=${options.variant}` : "";
|
|
11702
11665
|
return `${DEFAULT_CAPTIONS_PATH}/${entityType}/${entityId}?v=${hash}${variant}`;
|
|
11703
11666
|
}
|
|
11704
11667
|
function resolveCaptionsBase(endpoints) {
|
|
11705
|
-
return _optionalChain([endpoints, 'optionalAccess',
|
|
11668
|
+
return _optionalChain([endpoints, 'optionalAccess', _210 => _210.captionsUrlPrefix]) || DEFAULT_CAPTIONS_PATH;
|
|
11706
11669
|
}
|
|
11707
11670
|
function rebaseCaptionsUrl(endpoints, url) {
|
|
11708
11671
|
if (!url || !url.startsWith(`${DEFAULT_CAPTIONS_PATH}/`)) return url;
|
|
@@ -11812,7 +11775,7 @@ TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
|
11812
11775
|
// src/components/features/use-captions.ts
|
|
11813
11776
|
|
|
11814
11777
|
function useCaptions() {
|
|
11815
|
-
const endpoints = _nullishCoalesce(_optionalChain([_chunkUPKZU6QUcjs.useChatRuntime.call(void 0, ), 'optionalAccess',
|
|
11778
|
+
const endpoints = _nullishCoalesce(_optionalChain([_chunkUPKZU6QUcjs.useChatRuntime.call(void 0, ), 'optionalAccess', _211 => _211.endpoints]), () => ( null));
|
|
11816
11779
|
return _react.useMemo.call(void 0,
|
|
11817
11780
|
() => ({
|
|
11818
11781
|
forEntity: (entityType, entity) => getEntityCaptionUrls(endpoints, entityType, entity),
|
|
@@ -11841,11 +11804,11 @@ function fetchPriorityProp(priority) {
|
|
|
11841
11804
|
var ENTER_FULLSCREEN_REQUEST = "mediaenterfullscreenrequest";
|
|
11842
11805
|
function isIosAppShell() {
|
|
11843
11806
|
const capacitor = globalThis.Capacitor;
|
|
11844
|
-
return _optionalChain([capacitor, 'optionalAccess',
|
|
11807
|
+
return _optionalChain([capacitor, 'optionalAccess', _212 => _212.isNativePlatform, 'optionalCall', _213 => _213()]) === true && _optionalChain([capacitor, 'access', _214 => _214.getPlatform, 'optionalCall', _215 => _215()]) === "ios";
|
|
11845
11808
|
}
|
|
11846
11809
|
function nativeVideoElement(player) {
|
|
11847
11810
|
const media = player.media;
|
|
11848
|
-
const element = _nullishCoalesce(_optionalChain([media, 'optionalAccess',
|
|
11811
|
+
const element = _nullishCoalesce(_optionalChain([media, 'optionalAccess', _216 => _216.nativeEl]), () => ( media));
|
|
11849
11812
|
return element instanceof HTMLVideoElement ? element : null;
|
|
11850
11813
|
}
|
|
11851
11814
|
function useIosNativeVideoFullscreen(playerRef) {
|
|
@@ -11855,7 +11818,7 @@ function useIosNativeVideoFullscreen(playerRef) {
|
|
|
11855
11818
|
if (!(player instanceof EventTarget)) return void 0;
|
|
11856
11819
|
const takeOver = (event) => {
|
|
11857
11820
|
const video = nativeVideoElement(player);
|
|
11858
|
-
if (!_optionalChain([video, 'optionalAccess',
|
|
11821
|
+
if (!_optionalChain([video, 'optionalAccess', _217 => _217.webkitSupportsFullscreen]) || typeof video.webkitEnterFullscreen !== "function") return;
|
|
11859
11822
|
event.stopImmediatePropagation();
|
|
11860
11823
|
video.webkitEnterFullscreen();
|
|
11861
11824
|
};
|
|
@@ -11889,11 +11852,11 @@ function toMuxPreviewUrl(url, maxResolution = "720p") {
|
|
|
11889
11852
|
function saveDataEnabled() {
|
|
11890
11853
|
if (typeof navigator === "undefined") return false;
|
|
11891
11854
|
const conn = navigator.connection;
|
|
11892
|
-
return _optionalChain([conn, 'optionalAccess',
|
|
11855
|
+
return _optionalChain([conn, 'optionalAccess', _218 => _218.saveData]) === true;
|
|
11893
11856
|
}
|
|
11894
11857
|
function useVideoOriginPreconnect({ supabaseStorageOrigin } = {}) {
|
|
11895
11858
|
const runtime = _chunkUPKZU6QUcjs.useChatRuntime.call(void 0, );
|
|
11896
|
-
const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess',
|
|
11859
|
+
const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _219 => _219.endpoints, 'access', _220 => _220.supabaseStorageOrigin])));
|
|
11897
11860
|
try {
|
|
11898
11861
|
_reactdom2.default.preconnect(MUX_STREAM_ORIGIN, { crossOrigin: "anonymous" });
|
|
11899
11862
|
_reactdom2.default.preconnect(MUX_IMAGE_ORIGIN, { crossOrigin: "anonymous" });
|
|
@@ -11912,7 +11875,7 @@ function useVideoWarmup({
|
|
|
11912
11875
|
nearMargin = "1000px"
|
|
11913
11876
|
} = {}) {
|
|
11914
11877
|
const runtime = _chunkUPKZU6QUcjs.useChatRuntime.call(void 0, );
|
|
11915
|
-
const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess',
|
|
11878
|
+
const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _221 => _221.endpoints, 'access', _222 => _222.supabaseStorageOrigin])));
|
|
11916
11879
|
useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
|
|
11917
11880
|
const { ref, isNear } = _chunkYXWGSDK4cjs.useNearViewport.call(void 0, nearMargin);
|
|
11918
11881
|
_react.useEffect.call(void 0, () => {
|
|
@@ -12014,7 +11977,7 @@ if (typeof document !== "undefined") {
|
|
|
12014
11977
|
}
|
|
12015
11978
|
if (typeof window !== "undefined") {
|
|
12016
11979
|
const w = window;
|
|
12017
|
-
if (!_optionalChain([w, 'access',
|
|
11980
|
+
if (!_optionalChain([w, 'access', _223 => _223.chrome, 'optionalAccess', _224 => _224.cast])) {
|
|
12018
11981
|
w.chrome = { ..._nullishCoalesce(w.chrome, () => ( {})), cast: { isAvailable: false } };
|
|
12019
11982
|
}
|
|
12020
11983
|
}
|
|
@@ -12270,7 +12233,7 @@ function FilePlayer({
|
|
|
12270
12233
|
const clearPerfListener = _react.useCallback.call(void 0, () => {
|
|
12271
12234
|
if (perfListenerRef.current) {
|
|
12272
12235
|
try {
|
|
12273
|
-
_optionalChain([hoverPlayerRef, 'access',
|
|
12236
|
+
_optionalChain([hoverPlayerRef, 'access', _225 => _225.current, 'optionalAccess', _226 => _226.removeEventListener, 'optionalCall', _227 => _227("playing", perfListenerRef.current)]);
|
|
12274
12237
|
} catch (e21) {
|
|
12275
12238
|
}
|
|
12276
12239
|
perfListenerRef.current = null;
|
|
@@ -12305,7 +12268,7 @@ function FilePlayer({
|
|
|
12305
12268
|
};
|
|
12306
12269
|
perfListenerRef.current = onPlaying;
|
|
12307
12270
|
try {
|
|
12308
|
-
_optionalChain([el, 'access',
|
|
12271
|
+
_optionalChain([el, 'access', _228 => _228.addEventListener, 'optionalCall', _229 => _229("playing", onPlaying)]);
|
|
12309
12272
|
} catch (e22) {
|
|
12310
12273
|
}
|
|
12311
12274
|
}
|
|
@@ -12313,12 +12276,12 @@ function FilePlayer({
|
|
|
12313
12276
|
el.volume = 0.5;
|
|
12314
12277
|
if (userHasInteracted) {
|
|
12315
12278
|
el.muted = mutedIntentRef.current;
|
|
12316
|
-
_optionalChain([el, 'access',
|
|
12317
|
-
const name = _optionalChain([err, 'optionalAccess',
|
|
12279
|
+
_optionalChain([el, 'access', _230 => _230.play, 'optionalCall', _231 => _231(), 'optionalAccess', _232 => _232.catch, 'optionalCall', _233 => _233((err) => {
|
|
12280
|
+
const name = _optionalChain([err, 'optionalAccess', _234 => _234.name]);
|
|
12318
12281
|
if (name === "NotAllowedError" && hoverActiveRef.current && generation === hoverGenerationRef.current) {
|
|
12319
12282
|
try {
|
|
12320
12283
|
el.muted = true;
|
|
12321
|
-
_optionalChain([el, 'access',
|
|
12284
|
+
_optionalChain([el, 'access', _235 => _235.play, 'optionalCall', _236 => _236(), 'optionalAccess', _237 => _237.catch, 'optionalCall', _238 => _238(() => {
|
|
12322
12285
|
if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
|
|
12323
12286
|
setMutedFallbackBlocked(true);
|
|
12324
12287
|
}
|
|
@@ -12330,7 +12293,7 @@ function FilePlayer({
|
|
|
12330
12293
|
})]);
|
|
12331
12294
|
} else {
|
|
12332
12295
|
el.muted = true;
|
|
12333
|
-
_optionalChain([el, 'access',
|
|
12296
|
+
_optionalChain([el, 'access', _239 => _239.play, 'optionalCall', _240 => _240(), 'optionalAccess', _241 => _241.catch, 'optionalCall', _242 => _242(() => {
|
|
12334
12297
|
if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
|
|
12335
12298
|
setMutedFallbackBlocked(true);
|
|
12336
12299
|
}
|
|
@@ -12360,7 +12323,7 @@ function FilePlayer({
|
|
|
12360
12323
|
clearActivationWaiter();
|
|
12361
12324
|
clearPerfListener();
|
|
12362
12325
|
try {
|
|
12363
|
-
_optionalChain([hoverPlayerRef, 'access',
|
|
12326
|
+
_optionalChain([hoverPlayerRef, 'access', _243 => _243.current, 'optionalAccess', _244 => _244.pause, 'optionalCall', _245 => _245()]);
|
|
12364
12327
|
} catch (e26) {
|
|
12365
12328
|
}
|
|
12366
12329
|
}, [clearActivationWaiter, clearPerfListener]);
|
|
@@ -12372,7 +12335,7 @@ function FilePlayer({
|
|
|
12372
12335
|
if (el) {
|
|
12373
12336
|
el.muted = false;
|
|
12374
12337
|
el.volume = 0.5;
|
|
12375
|
-
_optionalChain([el, 'access',
|
|
12338
|
+
_optionalChain([el, 'access', _246 => _246.play, 'optionalCall', _247 => _247(), 'optionalAccess', _248 => _248.catch, 'optionalCall', _249 => _249(() => {
|
|
12376
12339
|
})]);
|
|
12377
12340
|
}
|
|
12378
12341
|
} catch (e27) {
|
|
@@ -12392,7 +12355,7 @@ function FilePlayer({
|
|
|
12392
12355
|
onMutedFallbackChangeRef.current = onMutedFallbackChange;
|
|
12393
12356
|
});
|
|
12394
12357
|
_react.useEffect.call(void 0, () => {
|
|
12395
|
-
_optionalChain([onMutedFallbackChangeRef, 'access',
|
|
12358
|
+
_optionalChain([onMutedFallbackChangeRef, 'access', _250 => _250.current, 'optionalCall', _251 => _251({
|
|
12396
12359
|
muted: hoverMutedFallback,
|
|
12397
12360
|
blocked: hoverMutedFallback && mutedFallbackBlocked
|
|
12398
12361
|
})]);
|
|
@@ -12411,7 +12374,7 @@ function FilePlayer({
|
|
|
12411
12374
|
if (autoPlay) {
|
|
12412
12375
|
const reportBlocked = () => setMutedFallbackBlocked(true);
|
|
12413
12376
|
try {
|
|
12414
|
-
_optionalChain([mutedEl, 'access',
|
|
12377
|
+
_optionalChain([mutedEl, 'access', _252 => _252.play, 'optionalCall', _253 => _253(), 'optionalAccess', _254 => _254.catch, 'optionalCall', _255 => _255(reportBlocked)]);
|
|
12415
12378
|
} catch (e29) {
|
|
12416
12379
|
reportBlocked();
|
|
12417
12380
|
}
|
|
@@ -12425,12 +12388,12 @@ function FilePlayer({
|
|
|
12425
12388
|
try {
|
|
12426
12389
|
el.muted = false;
|
|
12427
12390
|
el.volume = typeof el.volume === "number" ? el.volume : 1;
|
|
12428
|
-
_optionalChain([el, 'access',
|
|
12429
|
-
const name = _optionalChain([err, 'optionalAccess',
|
|
12391
|
+
_optionalChain([el, 'access', _256 => _256.play, 'optionalCall', _257 => _257(), 'optionalAccess', _258 => _258.catch, 'optionalCall', _259 => _259((err) => {
|
|
12392
|
+
const name = _optionalChain([err, 'optionalAccess', _260 => _260.name]);
|
|
12430
12393
|
if (name !== "NotAllowedError") return;
|
|
12431
12394
|
try {
|
|
12432
12395
|
el.muted = true;
|
|
12433
|
-
_optionalChain([el, 'access',
|
|
12396
|
+
_optionalChain([el, 'access', _261 => _261.play, 'optionalCall', _262 => _262(), 'optionalAccess', _263 => _263.catch, 'optionalCall', _264 => _264(() => {
|
|
12434
12397
|
setMutedFallbackBlocked(true);
|
|
12435
12398
|
setHoverMutedFallback(true);
|
|
12436
12399
|
})]);
|
|
@@ -12446,7 +12409,7 @@ function FilePlayer({
|
|
|
12446
12409
|
}, [autoPlayUnmuted, startMuted, autoPlay]);
|
|
12447
12410
|
_react.useEffect.call(void 0, () => {
|
|
12448
12411
|
const el = hoverPlayerRef.current;
|
|
12449
|
-
if (!_optionalChain([el, 'optionalAccess',
|
|
12412
|
+
if (!_optionalChain([el, 'optionalAccess', _265 => _265.addEventListener])) return void 0;
|
|
12450
12413
|
const onVolumeChange = () => {
|
|
12451
12414
|
if (el.muted === false) {
|
|
12452
12415
|
setMutedFallbackBlocked(false);
|
|
@@ -12459,14 +12422,14 @@ function FilePlayer({
|
|
|
12459
12422
|
}
|
|
12460
12423
|
return () => {
|
|
12461
12424
|
try {
|
|
12462
|
-
_optionalChain([el, 'access',
|
|
12425
|
+
_optionalChain([el, 'access', _266 => _266.removeEventListener, 'optionalCall', _267 => _267("volumechange", onVolumeChange)]);
|
|
12463
12426
|
} catch (e33) {
|
|
12464
12427
|
}
|
|
12465
12428
|
};
|
|
12466
12429
|
}, []);
|
|
12467
12430
|
_react.useEffect.call(void 0, () => {
|
|
12468
12431
|
const el = hoverPlayerRef.current;
|
|
12469
|
-
if (!_optionalChain([el, 'optionalAccess',
|
|
12432
|
+
if (!_optionalChain([el, 'optionalAccess', _268 => _268.addEventListener])) return void 0;
|
|
12470
12433
|
const onPlaying = () => setMutedFallbackBlocked(false);
|
|
12471
12434
|
try {
|
|
12472
12435
|
el.addEventListener("playing", onPlaying);
|
|
@@ -12474,7 +12437,7 @@ function FilePlayer({
|
|
|
12474
12437
|
}
|
|
12475
12438
|
return () => {
|
|
12476
12439
|
try {
|
|
12477
|
-
_optionalChain([el, 'access',
|
|
12440
|
+
_optionalChain([el, 'access', _269 => _269.removeEventListener, 'optionalCall', _270 => _270("playing", onPlaying)]);
|
|
12478
12441
|
} catch (e35) {
|
|
12479
12442
|
}
|
|
12480
12443
|
};
|
|
@@ -12485,15 +12448,15 @@ function FilePlayer({
|
|
|
12485
12448
|
});
|
|
12486
12449
|
_react.useEffect.call(void 0, () => {
|
|
12487
12450
|
const el = hoverPlayerRef.current;
|
|
12488
|
-
if (!_optionalChain([el, 'optionalAccess',
|
|
12489
|
-
const handler = () => _optionalChain([onEndedRef, 'access',
|
|
12451
|
+
if (!_optionalChain([el, 'optionalAccess', _271 => _271.addEventListener])) return void 0;
|
|
12452
|
+
const handler = () => _optionalChain([onEndedRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273()]);
|
|
12490
12453
|
try {
|
|
12491
12454
|
el.addEventListener("ended", handler);
|
|
12492
12455
|
} catch (e36) {
|
|
12493
12456
|
}
|
|
12494
12457
|
return () => {
|
|
12495
12458
|
try {
|
|
12496
|
-
_optionalChain([el, 'access',
|
|
12459
|
+
_optionalChain([el, 'access', _274 => _274.removeEventListener, 'optionalCall', _275 => _275("ended", handler)]);
|
|
12497
12460
|
} catch (e37) {
|
|
12498
12461
|
}
|
|
12499
12462
|
};
|
|
@@ -12502,19 +12465,19 @@ function FilePlayer({
|
|
|
12502
12465
|
_react.useImperativeHandle.call(void 0,
|
|
12503
12466
|
playerHandleRef,
|
|
12504
12467
|
() => ({
|
|
12505
|
-
getCurrentTime: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access',
|
|
12468
|
+
getCurrentTime: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _276 => _276.current, 'optionalAccess', _277 => _277.currentTime]), () => ( 0)),
|
|
12506
12469
|
getDuration: () => {
|
|
12507
|
-
const d = _optionalChain([hoverPlayerRef, 'access',
|
|
12470
|
+
const d = _optionalChain([hoverPlayerRef, 'access', _278 => _278.current, 'optionalAccess', _279 => _279.duration]);
|
|
12508
12471
|
return typeof d === "number" && isFinite(d) ? d : 0;
|
|
12509
12472
|
},
|
|
12510
|
-
getPaused: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access',
|
|
12511
|
-
getMuted: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access',
|
|
12473
|
+
getPaused: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _280 => _280.current, 'optionalAccess', _281 => _281.paused]), () => ( true)),
|
|
12474
|
+
getMuted: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _282 => _282.current, 'optionalAccess', _283 => _283.muted]), () => ( false)),
|
|
12512
12475
|
play: async () => {
|
|
12513
|
-
await _optionalChain([hoverPlayerRef, 'access',
|
|
12476
|
+
await _optionalChain([hoverPlayerRef, 'access', _284 => _284.current, 'optionalAccess', _285 => _285.play, 'optionalCall', _286 => _286()]);
|
|
12514
12477
|
},
|
|
12515
12478
|
pause: () => {
|
|
12516
12479
|
try {
|
|
12517
|
-
_optionalChain([hoverPlayerRef, 'access',
|
|
12480
|
+
_optionalChain([hoverPlayerRef, 'access', _287 => _287.current, 'optionalAccess', _288 => _288.pause, 'optionalCall', _289 => _289()]);
|
|
12518
12481
|
} catch (e38) {
|
|
12519
12482
|
}
|
|
12520
12483
|
},
|
|
@@ -12581,10 +12544,10 @@ function FilePlayer({
|
|
|
12581
12544
|
if (!el) return;
|
|
12582
12545
|
const resumeAt = typeof el.currentTime === "number" ? el.currentTime : 0;
|
|
12583
12546
|
try {
|
|
12584
|
-
_optionalChain([el, 'access',
|
|
12547
|
+
_optionalChain([el, 'access', _290 => _290.load, 'optionalCall', _291 => _291()]);
|
|
12585
12548
|
if (resumeAt > 0 && el.addEventListener && el.removeEventListener) {
|
|
12586
12549
|
const seekBack = () => {
|
|
12587
|
-
_optionalChain([el, 'access',
|
|
12550
|
+
_optionalChain([el, 'access', _292 => _292.removeEventListener, 'optionalCall', _293 => _293("loadedmetadata", seekBack)]);
|
|
12588
12551
|
try {
|
|
12589
12552
|
el.currentTime = resumeAt;
|
|
12590
12553
|
} catch (e40) {
|
|
@@ -12592,7 +12555,7 @@ function FilePlayer({
|
|
|
12592
12555
|
};
|
|
12593
12556
|
el.addEventListener("loadedmetadata", seekBack);
|
|
12594
12557
|
}
|
|
12595
|
-
_optionalChain([el, 'access',
|
|
12558
|
+
_optionalChain([el, 'access', _294 => _294.play, 'optionalCall', _295 => _295(), 'optionalAccess', _296 => _296.catch, 'optionalCall', _297 => _297(() => {
|
|
12596
12559
|
})]);
|
|
12597
12560
|
} catch (e41) {
|
|
12598
12561
|
}
|
|
@@ -12751,7 +12714,7 @@ function YouTubeFacadeInner({
|
|
|
12751
12714
|
const iframe = iframeRef.current;
|
|
12752
12715
|
if (!iframe) return void 0;
|
|
12753
12716
|
function subscribe2() {
|
|
12754
|
-
_optionalChain([iframe, 'optionalAccess',
|
|
12717
|
+
_optionalChain([iframe, 'optionalAccess', _298 => _298.contentWindow, 'optionalAccess', _299 => _299.postMessage, 'call', _300 => _300('{"event":"listening"}', YT_NOCOOKIE_ORIGIN)]);
|
|
12755
12718
|
}
|
|
12756
12719
|
iframe.addEventListener("load", subscribe2);
|
|
12757
12720
|
subscribe2();
|
|
@@ -12772,13 +12735,13 @@ function YouTubeFacadeInner({
|
|
|
12772
12735
|
return;
|
|
12773
12736
|
}
|
|
12774
12737
|
if (payload.event !== "infoDelivery") return;
|
|
12775
|
-
const state = _optionalChain([payload, 'access',
|
|
12738
|
+
const state = _optionalChain([payload, 'access', _301 => _301.info, 'optionalAccess', _302 => _302.playerState]);
|
|
12776
12739
|
if (typeof state !== "number") return;
|
|
12777
12740
|
if (state === YT_STATE_PLAYING) {
|
|
12778
12741
|
if (blurTimer !== null) return;
|
|
12779
12742
|
blurTimer = setTimeout(() => {
|
|
12780
12743
|
blurTimer = null;
|
|
12781
|
-
_optionalChain([iframeRef, 'access',
|
|
12744
|
+
_optionalChain([iframeRef, 'access', _303 => _303.current, 'optionalAccess', _304 => _304.blur, 'call', _305 => _305()]);
|
|
12782
12745
|
}, YT_PLAYING_BLUR_DELAY_MS);
|
|
12783
12746
|
return;
|
|
12784
12747
|
}
|
|
@@ -12799,7 +12762,7 @@ function YouTubeFacadeInner({
|
|
|
12799
12762
|
prevSuspendedRef.current = Boolean(suspended);
|
|
12800
12763
|
if (!activated) return;
|
|
12801
12764
|
if (suspended && !wasSuspended) {
|
|
12802
|
-
_optionalChain([iframeRef, 'access',
|
|
12765
|
+
_optionalChain([iframeRef, 'access', _306 => _306.current, 'optionalAccess', _307 => _307.contentWindow, 'optionalAccess', _308 => _308.postMessage, 'call', _309 => _309(
|
|
12803
12766
|
'{"event":"command","func":"pauseVideo","args":[]}',
|
|
12804
12767
|
YT_NOCOOKIE_ORIGIN
|
|
12805
12768
|
)]);
|
|
@@ -13053,7 +13016,7 @@ function CardsStrip(props) {
|
|
|
13053
13016
|
_react.useEffect.call(void 0, () => {
|
|
13054
13017
|
const el = wrapperRef.current;
|
|
13055
13018
|
if (!el || typeof IntersectionObserver === "undefined") return void 0;
|
|
13056
|
-
const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access',
|
|
13019
|
+
const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _310 => _310[0], 'optionalAccess', _311 => _311.isIntersecting]), () => ( true))), {
|
|
13057
13020
|
rootMargin: "200px"
|
|
13058
13021
|
});
|
|
13059
13022
|
io.observe(el);
|
|
@@ -13075,9 +13038,9 @@ function CardsStrip(props) {
|
|
|
13075
13038
|
const p = hoverPointerRef.current;
|
|
13076
13039
|
if (!p.inside) return;
|
|
13077
13040
|
const el = typeof document !== "undefined" ? document.elementFromPoint(p.x, p.y) : null;
|
|
13078
|
-
const cardEl = _optionalChain([el, 'optionalAccess',
|
|
13079
|
-
const scoped = cardEl && _optionalChain([scrollerRef, 'access',
|
|
13080
|
-
const key = _nullishCoalesce(_optionalChain([scoped, 'optionalAccess',
|
|
13041
|
+
const cardEl = _optionalChain([el, 'optionalAccess', _312 => _312.closest, 'optionalCall', _313 => _313("[data-strip-card-key]")]);
|
|
13042
|
+
const scoped = cardEl && _optionalChain([scrollerRef, 'access', _314 => _314.current, 'optionalAccess', _315 => _315.contains, 'call', _316 => _316(cardEl)]) ? cardEl : null;
|
|
13043
|
+
const key = _nullishCoalesce(_optionalChain([scoped, 'optionalAccess', _317 => _317.getAttribute, 'call', _318 => _318("data-strip-card-key")]), () => ( null));
|
|
13081
13044
|
const current = activeKeyRef.current;
|
|
13082
13045
|
if (key === current) return;
|
|
13083
13046
|
if (current !== null) deactivate(current);
|
|
@@ -13115,7 +13078,7 @@ function CardsStrip(props) {
|
|
|
13115
13078
|
}, [syncHoverToPointer]);
|
|
13116
13079
|
const seamBuffer = _react.useCallback.call(void 0, () => {
|
|
13117
13080
|
const half = singleCopyWidthRef.current;
|
|
13118
|
-
const viewport = _nullishCoalesce(_optionalChain([scrollerRef, 'access',
|
|
13081
|
+
const viewport = _nullishCoalesce(_optionalChain([scrollerRef, 'access', _319 => _319.current, 'optionalAccess', _320 => _320.clientWidth]), () => ( 0));
|
|
13119
13082
|
return Math.max(0, Math.min(200, half / 4, half - viewport - TRACK_GAP_PX - 1));
|
|
13120
13083
|
}, []);
|
|
13121
13084
|
const { posRef: marqueePosRef, glideBy } = _chunkYXWGSDK4cjs.useMarqueeEngine.call(void 0, {
|
|
@@ -13131,7 +13094,7 @@ function CardsStrip(props) {
|
|
|
13131
13094
|
const scroller = scrollerRef.current;
|
|
13132
13095
|
if (scroller) scroller.scrollLeft = pos;
|
|
13133
13096
|
},
|
|
13134
|
-
readBack: () => _nullishCoalesce(_optionalChain([scrollerRef, 'access',
|
|
13097
|
+
readBack: () => _nullishCoalesce(_optionalChain([scrollerRef, 'access', _321 => _321.current, 'optionalAccess', _322 => _322.scrollLeft]), () => ( 0)),
|
|
13135
13098
|
onAfterFrame: syncHoverIfScrolled
|
|
13136
13099
|
});
|
|
13137
13100
|
const [mountedIdx, setMountedIdx] = _react.useState.call(void 0, () => /* @__PURE__ */ new Set());
|
|
@@ -13179,11 +13142,11 @@ function CardsStrip(props) {
|
|
|
13179
13142
|
fn = (el) => {
|
|
13180
13143
|
if (!el) return void 0;
|
|
13181
13144
|
cardElIdxRef.current.set(el, idx);
|
|
13182
|
-
_optionalChain([cardObserverRef, 'access',
|
|
13145
|
+
_optionalChain([cardObserverRef, 'access', _323 => _323.current, 'optionalAccess', _324 => _324.observe, 'call', _325 => _325(el)]);
|
|
13183
13146
|
return () => {
|
|
13184
13147
|
cardElIdxRef.current.delete(el);
|
|
13185
13148
|
cardElNearRef.current.delete(el);
|
|
13186
|
-
_optionalChain([cardObserverRef, 'access',
|
|
13149
|
+
_optionalChain([cardObserverRef, 'access', _326 => _326.current, 'optionalAccess', _327 => _327.unobserve, 'call', _328 => _328(el)]);
|
|
13187
13150
|
};
|
|
13188
13151
|
};
|
|
13189
13152
|
cardRefFns.set(idx, fn);
|
|
@@ -13202,7 +13165,7 @@ function CardsStrip(props) {
|
|
|
13202
13165
|
const track = trackRef.current;
|
|
13203
13166
|
if (!scroller || !track) return;
|
|
13204
13167
|
const firstCard = track.firstElementChild;
|
|
13205
|
-
const step = (_nullishCoalesce(_optionalChain([firstCard, 'optionalAccess',
|
|
13168
|
+
const step = (_nullishCoalesce(_optionalChain([firstCard, 'optionalAccess', _329 => _329.offsetWidth]), () => ( 320))) + TRACK_GAP_PX;
|
|
13206
13169
|
chevronSuppressUntilRef.current = performance.now() + CHEVRON_SUPPRESS_MS;
|
|
13207
13170
|
if (marqueeActiveRef.current) {
|
|
13208
13171
|
glideBy(dir * step);
|
|
@@ -13259,7 +13222,7 @@ function CardsStrip(props) {
|
|
|
13259
13222
|
{
|
|
13260
13223
|
ref: (node) => {
|
|
13261
13224
|
wrapperRef.current = node;
|
|
13262
|
-
_optionalChain([rootRef, 'optionalCall',
|
|
13225
|
+
_optionalChain([rootRef, 'optionalCall', _330 => _330(node)]);
|
|
13263
13226
|
},
|
|
13264
13227
|
className: _chunk23V5BSHDcjs.cn.call(void 0, "flex w-full min-w-0 flex-col gap-6", className),
|
|
13265
13228
|
children: [
|
|
@@ -13371,7 +13334,7 @@ function VideoHoverPreviewSurface({
|
|
|
13371
13334
|
if (gateControlled) return void 0;
|
|
13372
13335
|
const el = rootElRef.current;
|
|
13373
13336
|
if (!el || typeof IntersectionObserver === "undefined") return void 0;
|
|
13374
|
-
const io = new IntersectionObserver((entries) => setIsNear(_nullishCoalesce(_optionalChain([entries, 'access',
|
|
13337
|
+
const io = new IntersectionObserver((entries) => setIsNear(_nullishCoalesce(_optionalChain([entries, 'access', _331 => _331[0], 'optionalAccess', _332 => _332.isIntersecting]), () => ( false))), {
|
|
13375
13338
|
rootMargin: _chunkYXWGSDK4cjs.NEAR_VIEWPORT_ROOT_MARGIN
|
|
13376
13339
|
});
|
|
13377
13340
|
io.observe(el);
|
|
@@ -13516,7 +13479,7 @@ function VideoBitesStrip({
|
|
|
13516
13479
|
const filtered = filterPublished ? bites.filter((b) => b.published) : [...bites];
|
|
13517
13480
|
return filtered.sort(sortComparator);
|
|
13518
13481
|
}, [bites, filterPublished, sortComparator]);
|
|
13519
|
-
const warmup = useVideoWarmup({ videoUrl: _optionalChain([items, 'access',
|
|
13482
|
+
const warmup = useVideoWarmup({ videoUrl: _optionalChain([items, 'access', _333 => _333[0], 'optionalAccess', _334 => _334.url]) || null });
|
|
13520
13483
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
13521
13484
|
CardsStrip,
|
|
13522
13485
|
{
|
|
@@ -13583,8 +13546,8 @@ function VideoBiteCard({
|
|
|
13583
13546
|
const controlled = active !== void 0;
|
|
13584
13547
|
const [selfActive, setSelfActive] = _react.useState.call(void 0, false);
|
|
13585
13548
|
const isActive = controlled ? !!active : selfActive;
|
|
13586
|
-
const activate = () => controlled ? _optionalChain([onActivate, 'optionalCall',
|
|
13587
|
-
const deactivate = () => controlled ? _optionalChain([onDeactivate, 'optionalCall',
|
|
13549
|
+
const activate = () => controlled ? _optionalChain([onActivate, 'optionalCall', _335 => _335(key)]) : setSelfActive(true);
|
|
13550
|
+
const deactivate = () => controlled ? _optionalChain([onDeactivate, 'optionalCall', _336 => _336(key)]) : setSelfActive(false);
|
|
13588
13551
|
const titleInputRef = _react.useRef.call(void 0, null);
|
|
13589
13552
|
_chunkYXWGSDK4cjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
13590
13553
|
const el = titleInputRef.current;
|
|
@@ -13594,7 +13557,7 @@ function VideoBiteCard({
|
|
|
13594
13557
|
});
|
|
13595
13558
|
const navigate = () => {
|
|
13596
13559
|
if (bite.onNavigate) bite.onNavigate();
|
|
13597
|
-
else _optionalChain([onBiteNavigate, 'optionalCall',
|
|
13560
|
+
else _optionalChain([onBiteNavigate, 'optionalCall', _337 => _337(bite, index)]);
|
|
13598
13561
|
};
|
|
13599
13562
|
const handlePointerEnter = () => {
|
|
13600
13563
|
if (!isTouch) activate();
|
|
@@ -13619,9 +13582,9 @@ function VideoBiteCard({
|
|
|
13619
13582
|
placeholder: "Title (optional)",
|
|
13620
13583
|
"aria-label": "Bite title",
|
|
13621
13584
|
rows: 1,
|
|
13622
|
-
onChange: (e) => _optionalChain([onTitleChange, 'optionalCall',
|
|
13585
|
+
onChange: (e) => _optionalChain([onTitleChange, 'optionalCall', _338 => _338(e.target.value)]),
|
|
13623
13586
|
ref: titleInputRef,
|
|
13624
|
-
onBlur: (e) => _optionalChain([onTitleCommit, 'optionalCall',
|
|
13587
|
+
onBlur: (e) => _optionalChain([onTitleCommit, 'optionalCall', _339 => _339(e.target.value)]),
|
|
13625
13588
|
onClick: (e) => e.stopPropagation(),
|
|
13626
13589
|
className: _chunk23V5BSHDcjs.cn.call(void 0,
|
|
13627
13590
|
titleClass,
|
|
@@ -13698,7 +13661,7 @@ function VideoBiteCard({
|
|
|
13698
13661
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
13699
13662
|
"div",
|
|
13700
13663
|
{
|
|
13701
|
-
ref: (node) => _optionalChain([rootRef, 'optionalCall',
|
|
13664
|
+
ref: (node) => _optionalChain([rootRef, 'optionalCall', _340 => _340(node)]),
|
|
13702
13665
|
"aria-hidden": isClone || void 0,
|
|
13703
13666
|
"data-strip-card-key": key,
|
|
13704
13667
|
className: _chunk23V5BSHDcjs.cn.call(void 0,
|
|
@@ -13753,8 +13716,8 @@ function EntityVideoSection({
|
|
|
13753
13716
|
const hasHighlight = !!highlightVideoUrl;
|
|
13754
13717
|
const hasVideo = hasFullVideo || hasHighlight;
|
|
13755
13718
|
const derivedCaptions = captionsEntity ? captions.forEntityId(captionsEntity.type, captionsEntity.id) : null;
|
|
13756
|
-
const captionsUrl = _nullishCoalesce(captionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess',
|
|
13757
|
-
const highlightCaptionsUrl = _nullishCoalesce(highlightCaptionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess',
|
|
13719
|
+
const captionsUrl = _nullishCoalesce(captionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _341 => _341.captionsUrl])));
|
|
13720
|
+
const highlightCaptionsUrl = _nullishCoalesce(highlightCaptionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _342 => _342.highlightCaptionsUrl])));
|
|
13758
13721
|
if (!hasVideo && !videoSummary && (!videoBites || videoBites.length === 0)) {
|
|
13759
13722
|
return null;
|
|
13760
13723
|
}
|
|
@@ -14273,7 +14236,7 @@ function DataRoomDocCard({ item, className, badgeText, anchorProps }) {
|
|
|
14273
14236
|
] }) : null,
|
|
14274
14237
|
item.preview ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex min-w-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-clamp-2 whitespace-pre-wrap break-words text-ods-text-secondary text-h6", children: item.preview }) }) : null
|
|
14275
14238
|
] }),
|
|
14276
|
-
_optionalChain([anchorProps, 'optionalAccess',
|
|
14239
|
+
_optionalChain([anchorProps, 'optionalAccess', _343 => _343.href]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex h-5 shrink-0 items-center self-start text-ods-text-secondary", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-3.5 w-3.5" }) }) : null
|
|
14277
14240
|
] });
|
|
14278
14241
|
if (!anchorProps) {
|
|
14279
14242
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${_chunkUQEOAPAIcjs.COMPACT_CARD_OUTER_STATIC} ${_nullishCoalesce(className, () => ( ""))}`, "aria-label": "No link available", children: body });
|
|
@@ -14301,7 +14264,7 @@ function DataRoomDocCardSkeleton({ className }) {
|
|
|
14301
14264
|
|
|
14302
14265
|
|
|
14303
14266
|
function CampaignCardAdmin({ campaign, className, anchorProps }) {
|
|
14304
|
-
const goalsCount = _optionalChain([campaign, 'access',
|
|
14267
|
+
const goalsCount = _optionalChain([campaign, 'access', _344 => _344.goals, 'optionalAccess', _345 => _345.length]) || 0;
|
|
14305
14268
|
const innerChildren = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
14306
14269
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunkUQEOAPAIcjs.COMPACT_CARD_ICON_SLOT, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Megaphone, { className: "h-5 w-5" }) }),
|
|
14307
14270
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _chunkUQEOAPAIcjs.COMPACT_CARD_TEXT_COL, children: [
|
|
@@ -14595,7 +14558,7 @@ function pickFetchedCardHref({
|
|
|
14595
14558
|
itemHref,
|
|
14596
14559
|
allowComposed
|
|
14597
14560
|
}) {
|
|
14598
|
-
if (_optionalChain([composed, 'optionalAccess',
|
|
14561
|
+
if (_optionalChain([composed, 'optionalAccess', _346 => _346.hostOverride])) {
|
|
14599
14562
|
return { source: "hostOverride", href: composed.href, targetPlatform: composed.targetPlatform };
|
|
14600
14563
|
}
|
|
14601
14564
|
if (itemHref) return { source: "item", href: itemHref };
|
|
@@ -14811,7 +14774,7 @@ function resolveSourceRowCTA(row, ctx = {}) {
|
|
|
14811
14774
|
if (row.path && shouldFallbackToPathNav(row) && !row.externalUrl) {
|
|
14812
14775
|
const safePath = sanitizePath(row.path);
|
|
14813
14776
|
if (safePath) {
|
|
14814
|
-
const docTarget = row.documentType ? _optionalChain([ctx, 'access',
|
|
14777
|
+
const docTarget = row.documentType ? _optionalChain([ctx, 'access', _347 => _347.docPlatformTargets, 'optionalAccess', _348 => _348[row.documentType]]) : void 0;
|
|
14815
14778
|
if (docTarget) {
|
|
14816
14779
|
const seg = docTarget.basePath.split("/").filter(Boolean).join("/");
|
|
14817
14780
|
const base = `${_chunk23V5BSHDcjs.getBaseUrl.call(void 0, docTarget.platform)}${seg ? `/${seg}` : ""}/`;
|
|
@@ -14954,8 +14917,8 @@ function cardMenuGroups(href, discuss, openDetails, externalLink) {
|
|
|
14954
14917
|
if (href) {
|
|
14955
14918
|
items.push({
|
|
14956
14919
|
id: "open-details",
|
|
14957
|
-
label: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess',
|
|
14958
|
-
icon: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess',
|
|
14920
|
+
label: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _349 => _349.label]), () => ( "Open Details")),
|
|
14921
|
+
icon: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _350 => _350.icon]), () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.EyeIcon, { size: 20 }))),
|
|
14959
14922
|
// Main row → open the entity (same tab, soft Link nav).
|
|
14960
14923
|
href,
|
|
14961
14924
|
// Trailing 40px ↗ side-button → open in a new tab.
|
|
@@ -15015,18 +14978,18 @@ function itemVideoMetadata(item) {
|
|
|
15015
14978
|
for (const v of vals) if (typeof v === "string" && v.length > 0) return v;
|
|
15016
14979
|
return void 0;
|
|
15017
14980
|
};
|
|
15018
|
-
const m = _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
14981
|
+
const m = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _351 => _351.metadata]), () => ( {}));
|
|
15019
14982
|
const out = {};
|
|
15020
|
-
const videoUrl = pick(m.videoUrl, _optionalChain([item, 'optionalAccess',
|
|
15021
|
-
const youtubeUrl = pick(m.youtubeUrl, _optionalChain([item, 'optionalAccess',
|
|
15022
|
-
const highlightVideoUrl = pick(m.highlightVideoUrl, _optionalChain([item, 'optionalAccess',
|
|
14983
|
+
const videoUrl = pick(m.videoUrl, _optionalChain([item, 'optionalAccess', _352 => _352.custom_video_url]), _optionalChain([item, 'optionalAccess', _353 => _353.main_video_url]));
|
|
14984
|
+
const youtubeUrl = pick(m.youtubeUrl, _optionalChain([item, 'optionalAccess', _354 => _354.youtube_url]), _optionalChain([item, 'optionalAccess', _355 => _355.testimonial_video_url]));
|
|
14985
|
+
const highlightVideoUrl = pick(m.highlightVideoUrl, _optionalChain([item, 'optionalAccess', _356 => _356.highlight_video_url]));
|
|
15023
14986
|
const videoPoster = pick(
|
|
15024
14987
|
m.videoPoster,
|
|
15025
|
-
_optionalChain([item, 'optionalAccess',
|
|
15026
|
-
_optionalChain([item, 'optionalAccess',
|
|
15027
|
-
_optionalChain([item, 'optionalAccess',
|
|
14988
|
+
_optionalChain([item, 'optionalAccess', _357 => _357.main_video_thumbnail]),
|
|
14989
|
+
_optionalChain([item, 'optionalAccess', _358 => _358.highlight_video_thumbnail]),
|
|
14990
|
+
_optionalChain([item, 'optionalAccess', _359 => _359.featured_image])
|
|
15028
14991
|
);
|
|
15029
|
-
const highlightVideoPoster = pick(m.highlightVideoPoster, _optionalChain([item, 'optionalAccess',
|
|
14992
|
+
const highlightVideoPoster = pick(m.highlightVideoPoster, _optionalChain([item, 'optionalAccess', _360 => _360.highlight_video_thumbnail]));
|
|
15030
14993
|
if (videoUrl) out.videoUrl = videoUrl;
|
|
15031
14994
|
if (youtubeUrl) out.youtubeUrl = youtubeUrl;
|
|
15032
14995
|
if (highlightVideoUrl) out.highlightVideoUrl = highlightVideoUrl;
|
|
@@ -15056,15 +15019,15 @@ function fetchedItemDisplayRef(item, chatRef) {
|
|
|
15056
15019
|
}
|
|
15057
15020
|
function fetchedFaqDisplayRef(item, chatRef) {
|
|
15058
15021
|
const it = item;
|
|
15059
|
-
const answer = typeof _optionalChain([it, 'optionalAccess',
|
|
15022
|
+
const answer = typeof _optionalChain([it, 'optionalAccess', _361 => _361.answer]) === "string" && it.answer.trim().length > 0 ? it.answer.trim() : null;
|
|
15060
15023
|
return {
|
|
15061
15024
|
type: "faq",
|
|
15062
15025
|
id: chatRef.id,
|
|
15063
15026
|
sourceRepo: chatRef.sourceRepo,
|
|
15064
|
-
title: typeof _optionalChain([it, 'optionalAccess',
|
|
15027
|
+
title: typeof _optionalChain([it, 'optionalAccess', _362 => _362.question]) === "string" && it.question ? it.question : chatRef.id,
|
|
15065
15028
|
url: _nullishCoalesce(chatRef.url, () => ( null)),
|
|
15066
15029
|
...answer ? { preview: answer.length > 400 ? `${answer.slice(0, 397)}\u2026` : answer } : {},
|
|
15067
|
-
metadata: typeof _optionalChain([it, 'optionalAccess',
|
|
15030
|
+
metadata: typeof _optionalChain([it, 'optionalAccess', _363 => _363.section]) === "string" && it.section ? { section: it.section } : {}
|
|
15068
15031
|
};
|
|
15069
15032
|
}
|
|
15070
15033
|
function HubspotTicketChatCard({
|
|
@@ -15072,8 +15035,8 @@ function HubspotTicketChatCard({
|
|
|
15072
15035
|
isNewTab,
|
|
15073
15036
|
discuss
|
|
15074
15037
|
}) {
|
|
15075
|
-
const status = typeof _optionalChain([chatRef, 'access',
|
|
15076
|
-
const statusLabel = typeof _optionalChain([chatRef, 'access',
|
|
15038
|
+
const status = typeof _optionalChain([chatRef, 'access', _364 => _364.metadata, 'optionalAccess', _365 => _365.status]) === "string" ? chatRef.metadata.status : void 0;
|
|
15039
|
+
const statusLabel = typeof _optionalChain([chatRef, 'access', _366 => _366.metadata, 'optionalAccess', _367 => _367.statusLabel]) === "string" ? chatRef.metadata.statusLabel : void 0;
|
|
15077
15040
|
const statusText = _nullishCoalesce(statusLabel, () => ( formatStatusToken(status)));
|
|
15078
15041
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15079
15042
|
MingoInfoCard,
|
|
@@ -15096,7 +15059,7 @@ function FaqChatCard({
|
|
|
15096
15059
|
isNewTab,
|
|
15097
15060
|
discuss
|
|
15098
15061
|
}) {
|
|
15099
|
-
const section = typeof _optionalChain([chatRef, 'access',
|
|
15062
|
+
const section = typeof _optionalChain([chatRef, 'access', _368 => _368.metadata, 'optionalAccess', _369 => _369.section]) === "string" ? chatRef.metadata.section.trim() : void 0;
|
|
15100
15063
|
const statusLabel = section && section.length > 0 ? section : "FAQ";
|
|
15101
15064
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15102
15065
|
MingoInfoCard,
|
|
@@ -15116,7 +15079,7 @@ function SlackChatCard({
|
|
|
15116
15079
|
isNewTab,
|
|
15117
15080
|
discuss
|
|
15118
15081
|
}) {
|
|
15119
|
-
const channelName = typeof _optionalChain([chatRef, 'access',
|
|
15082
|
+
const channelName = typeof _optionalChain([chatRef, 'access', _370 => _370.metadata, 'optionalAccess', _371 => _371.channelName]) === "string" ? chatRef.metadata.channelName.trim() : void 0;
|
|
15120
15083
|
const channelPretty = channelName ? channelName.startsWith("#") ? channelName : `#${channelName}` : void 0;
|
|
15121
15084
|
const title = channelPretty ? `${chatRef.title} \xB7 ${channelPretty}` : chatRef.title;
|
|
15122
15085
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -15174,7 +15137,7 @@ function GenericFinancialChatCard({
|
|
|
15174
15137
|
isNewTab,
|
|
15175
15138
|
discuss
|
|
15176
15139
|
}) {
|
|
15177
|
-
const subtitle = typeof _optionalChain([chatRef, 'access',
|
|
15140
|
+
const subtitle = typeof _optionalChain([chatRef, 'access', _372 => _372.metadata, 'optionalAccess', _373 => _373.subtitle]) === "string" ? chatRef.metadata.subtitle : void 0;
|
|
15178
15141
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15179
15142
|
MingoInfoCard,
|
|
15180
15143
|
{
|
|
@@ -15243,12 +15206,12 @@ function ProductReleaseChatCard({
|
|
|
15243
15206
|
discuss
|
|
15244
15207
|
}) {
|
|
15245
15208
|
const releaseProps = buildProps(item);
|
|
15246
|
-
const status = _optionalChain([item, 'optionalAccess',
|
|
15209
|
+
const status = _optionalChain([item, 'optionalAccess', _374 => _374.version]) ? { label: String(item.version), variant: "grey" } : { label: "Release", variant: "grey" };
|
|
15247
15210
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15248
15211
|
EntityMingoCard,
|
|
15249
15212
|
{
|
|
15250
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15251
|
-
description: _optionalChain([item, 'optionalAccess',
|
|
15213
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _375 => _375.title]), () => ( "")),
|
|
15214
|
+
description: _optionalChain([item, 'optionalAccess', _376 => _376.summary]) || releaseProps.formattedDate || void 0,
|
|
15252
15215
|
cover: releaseProps.coverImage || void 0,
|
|
15253
15216
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Rocket02Icon, { size: 24 }),
|
|
15254
15217
|
status,
|
|
@@ -15265,17 +15228,17 @@ function CampaignChatCard({
|
|
|
15265
15228
|
isNewTab,
|
|
15266
15229
|
discuss
|
|
15267
15230
|
}) {
|
|
15268
|
-
const goalsCount = Array.isArray(_optionalChain([item, 'optionalAccess',
|
|
15231
|
+
const goalsCount = Array.isArray(_optionalChain([item, 'optionalAccess', _377 => _377.goals])) ? item.goals.length : 0;
|
|
15269
15232
|
const meta = [
|
|
15270
|
-
_optionalChain([item, 'optionalAccess',
|
|
15233
|
+
_optionalChain([item, 'optionalAccess', _378 => _378.start_date]) ? _chunkUQEOAPAIcjs.formatDateShort.call(void 0, item.start_date) : null,
|
|
15271
15234
|
goalsCount > 0 ? `${goalsCount} goal${goalsCount !== 1 ? "s" : ""}` : null,
|
|
15272
15235
|
"Marketing campaign"
|
|
15273
15236
|
].filter(Boolean).join(" \xB7 ");
|
|
15274
15237
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15275
15238
|
EntityMingoCard,
|
|
15276
15239
|
{
|
|
15277
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15278
|
-
description: meta || _optionalChain([item, 'optionalAccess',
|
|
15240
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _379 => _379.name]), () => ( "")),
|
|
15241
|
+
description: meta || _optionalChain([item, 'optionalAccess', _380 => _380.description]) || void 0,
|
|
15279
15242
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Megaphone01Icon, { size: 24 }),
|
|
15280
15243
|
chatRef,
|
|
15281
15244
|
isNewTab,
|
|
@@ -15330,14 +15293,14 @@ function BlogChatCard({
|
|
|
15330
15293
|
hasEmbeddedVideo,
|
|
15331
15294
|
discuss
|
|
15332
15295
|
}) {
|
|
15333
|
-
const category = Array.isArray(_optionalChain([item, 'optionalAccess',
|
|
15296
|
+
const category = Array.isArray(_optionalChain([item, 'optionalAccess', _381 => _381.categories])) ? _nullishCoalesce(_optionalChain([item, 'access', _382 => _382.categories, 'access', _383 => _383.find, 'call', _384 => _384((c) => _optionalChain([c, 'optionalAccess', _385 => _385.name])), 'optionalAccess', _386 => _386.name]), () => ( void 0)) : void 0;
|
|
15334
15297
|
const status = hasEmbeddedVideo ? { label: "Video", variant: "primary" } : category ? { label: category, variant: "grey" } : void 0;
|
|
15335
15298
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15336
15299
|
EntityMingoCard,
|
|
15337
15300
|
{
|
|
15338
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15339
|
-
description: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15340
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15301
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _387 => _387.title]), () => ( "")),
|
|
15302
|
+
description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _388 => _388.summary]), () => ( void 0)),
|
|
15303
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _389 => _389.featured_image]), ogPlaceholder),
|
|
15341
15304
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.NewspaperIcon, { size: 24 }),
|
|
15342
15305
|
status,
|
|
15343
15306
|
chatRef,
|
|
@@ -15354,13 +15317,13 @@ function CaseStudyChatCard({
|
|
|
15354
15317
|
ogPlaceholder,
|
|
15355
15318
|
discuss
|
|
15356
15319
|
}) {
|
|
15357
|
-
const meta = [_optionalChain([item, 'optionalAccess',
|
|
15320
|
+
const meta = [_optionalChain([item, 'optionalAccess', _390 => _390.msp, 'optionalAccess', _391 => _391.name]), _optionalChain([item, 'optionalAccess', _392 => _392.user, 'optionalAccess', _393 => _393.full_name])].filter(Boolean).join(" \xB7 ");
|
|
15358
15321
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15359
15322
|
EntityMingoCard,
|
|
15360
15323
|
{
|
|
15361
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15362
|
-
description: _optionalChain([item, 'optionalAccess',
|
|
15363
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15324
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _394 => _394.title]), () => ( "")),
|
|
15325
|
+
description: _optionalChain([item, 'optionalAccess', _395 => _395.summary]) || meta || void 0,
|
|
15326
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _396 => _396.featured_image]), ogPlaceholder),
|
|
15364
15327
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.TrophyIcon, { size: 24 }),
|
|
15365
15328
|
status: { label: "Case study", variant: "grey" },
|
|
15366
15329
|
chatRef,
|
|
@@ -15377,13 +15340,13 @@ function CustomerInterviewChatCard({
|
|
|
15377
15340
|
ogPlaceholder,
|
|
15378
15341
|
discuss
|
|
15379
15342
|
}) {
|
|
15380
|
-
const meta = [_optionalChain([item, 'optionalAccess',
|
|
15343
|
+
const meta = [_optionalChain([item, 'optionalAccess', _397 => _397.user, 'optionalAccess', _398 => _398.full_name]), _optionalChain([item, 'optionalAccess', _399 => _399.msp, 'optionalAccess', _400 => _400.name])].filter(Boolean).join(" \xB7 ");
|
|
15381
15344
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15382
15345
|
EntityMingoCard,
|
|
15383
15346
|
{
|
|
15384
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15385
|
-
description: _optionalChain([item, 'optionalAccess',
|
|
15386
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15347
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _401 => _401.title]), () => ( "")),
|
|
15348
|
+
description: _optionalChain([item, 'optionalAccess', _402 => _402.video_summary]) || meta || void 0,
|
|
15349
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _403 => _403.featured_image]), ogPlaceholder),
|
|
15387
15350
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MicrophoneIcon, { size: 24 }),
|
|
15388
15351
|
status: { label: "Interview", variant: "grey" },
|
|
15389
15352
|
chatRef,
|
|
@@ -15400,13 +15363,13 @@ function InvestorUpdateChatCard({
|
|
|
15400
15363
|
ogPlaceholder,
|
|
15401
15364
|
discuss
|
|
15402
15365
|
}) {
|
|
15403
|
-
const title = _optionalChain([item, 'optionalAccess',
|
|
15366
|
+
const title = _optionalChain([item, 'optionalAccess', _404 => _404.title]) || `Update #${_nullishCoalesce(_optionalChain([item, 'optionalAccess', _405 => _405.update_number]), () => ( "?"))}`;
|
|
15404
15367
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15405
15368
|
EntityMingoCard,
|
|
15406
15369
|
{
|
|
15407
15370
|
title,
|
|
15408
|
-
description: _optionalChain([item, 'optionalAccess',
|
|
15409
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15371
|
+
description: _optionalChain([item, 'optionalAccess', _406 => _406.strategic_update]) || _optionalChain([item, 'optionalAccess', _407 => _407.content]) || _chunkUQEOAPAIcjs.formatInvestorUpdatePeriod.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _408 => _408.period_start]), () => ( null)), _nullishCoalesce(_optionalChain([item, 'optionalAccess', _409 => _409.period_end]), () => ( null))) || void 0,
|
|
15372
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _410 => _410.featured_image]), ogPlaceholder),
|
|
15410
15373
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.PresentationLineIcon, { size: 24 }),
|
|
15411
15374
|
status: { label: "Investor update", variant: "grey" },
|
|
15412
15375
|
chatRef,
|
|
@@ -15423,12 +15386,12 @@ function OnboardingGuideChatCard({
|
|
|
15423
15386
|
ogPlaceholder,
|
|
15424
15387
|
discuss
|
|
15425
15388
|
}) {
|
|
15426
|
-
const cover = _nullishCoalesce(_nullishCoalesce(entityCover(_optionalChain([item, 'optionalAccess',
|
|
15389
|
+
const cover = _nullishCoalesce(_nullishCoalesce(entityCover(_optionalChain([item, 'optionalAccess', _411 => _411.featured_image])), () => ( entityCover(_optionalChain([item, 'optionalAccess', _412 => _412.main_video_thumbnail])))), () => ( entityCover(_optionalChain([item, 'optionalAccess', _413 => _413.og_image_url]), ogPlaceholder)));
|
|
15427
15390
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15428
15391
|
EntityMingoCard,
|
|
15429
15392
|
{
|
|
15430
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15431
|
-
description: _nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15393
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _414 => _414.title]), () => ( "")),
|
|
15394
|
+
description: _nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _415 => _415.summary]), () => ( _optionalChain([item, 'optionalAccess', _416 => _416.description]))), () => ( void 0)),
|
|
15432
15395
|
cover,
|
|
15433
15396
|
fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CompassIcon, { size: 24 }),
|
|
15434
15397
|
status: { label: "Guide", variant: "grey" },
|
|
@@ -15449,25 +15412,25 @@ function ProgramChatCard({
|
|
|
15449
15412
|
discuss
|
|
15450
15413
|
}) {
|
|
15451
15414
|
const icon = configKey === "webinar" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.PresentationBarIcon, { size: 24 }) : configKey === "event" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CalendarIcon, { size: 24 }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MicrophoneIcon, { size: 24 });
|
|
15452
|
-
const isScheduled = _optionalChain([item, 'optionalAccess',
|
|
15415
|
+
const isScheduled = _optionalChain([item, 'optionalAccess', _417 => _417.status]) === "scheduled";
|
|
15453
15416
|
let typeMeta;
|
|
15454
|
-
if (configKey === "podcast" && typeof _optionalChain([item, 'optionalAccess',
|
|
15417
|
+
if (configKey === "podcast" && typeof _optionalChain([item, 'optionalAccess', _418 => _418.duration_seconds]) === "number" && item.duration_seconds > 0 && !isScheduled) {
|
|
15455
15418
|
typeMeta = _chunkUQEOAPAIcjs.formatDurationCompact.call(void 0, item.duration_seconds);
|
|
15456
|
-
} else if (configKey === "event" && typeof _optionalChain([item, 'optionalAccess',
|
|
15419
|
+
} else if (configKey === "event" && typeof _optionalChain([item, 'optionalAccess', _419 => _419.location_name]) === "string" && item.location_name.trim().length > 0) {
|
|
15457
15420
|
typeMeta = item.location_name;
|
|
15458
|
-
} else if (configKey === "webinar" && _optionalChain([item, 'optionalAccess',
|
|
15421
|
+
} else if (configKey === "webinar" && _optionalChain([item, 'optionalAccess', _420 => _420.start_at])) {
|
|
15459
15422
|
const time = _chunkUQEOAPAIcjs.formatTimeWithTimezone.call(void 0, item.start_at, _nullishCoalesce(item.timezone, () => ( null)));
|
|
15460
15423
|
const dur = _chunkUQEOAPAIcjs.formatDurationFromRange.call(void 0, item.start_at, item.end_at);
|
|
15461
15424
|
typeMeta = dur ? `${time} \xB7 ${dur}` : time;
|
|
15462
15425
|
}
|
|
15463
|
-
const itemDate = _chunkUQEOAPAIcjs.formatDateUTC.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15426
|
+
const itemDate = _chunkUQEOAPAIcjs.formatDateUTC.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _421 => _421.date]), () => ( null)), { fallback: "", timezone: "local" });
|
|
15464
15427
|
const meta = [itemDate, typeMeta].filter(Boolean).join(" \xB7 ");
|
|
15465
15428
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15466
15429
|
EntityMingoCard,
|
|
15467
15430
|
{
|
|
15468
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15469
|
-
description: meta || _optionalChain([item, 'optionalAccess',
|
|
15470
|
-
cover: entityCover(_optionalChain([item, 'optionalAccess',
|
|
15431
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _422 => _422.title]), () => ( "")),
|
|
15432
|
+
description: meta || _optionalChain([item, 'optionalAccess', _423 => _423.description]) || void 0,
|
|
15433
|
+
cover: entityCover(_optionalChain([item, 'optionalAccess', _424 => _424.cover_url]), ogPlaceholder),
|
|
15471
15434
|
fallbackIcon: icon,
|
|
15472
15435
|
status: { label, variant: "grey" },
|
|
15473
15436
|
chatRef,
|
|
@@ -15484,10 +15447,10 @@ function RoadmapChatCard({
|
|
|
15484
15447
|
cardType,
|
|
15485
15448
|
discuss
|
|
15486
15449
|
}) {
|
|
15487
|
-
const logoUrl = typeof _optionalChain([item, 'optionalAccess',
|
|
15488
|
-
const useTypeIcon = cardType === "internal_task" || !logoUrl && _optionalChain([item, 'optionalAccess',
|
|
15450
|
+
const logoUrl = typeof _optionalChain([item, 'optionalAccess', _425 => _425.icon]) === "string" && item.icon.startsWith("http") ? item.icon : void 0;
|
|
15451
|
+
const useTypeIcon = cardType === "internal_task" || !logoUrl && _optionalChain([item, 'optionalAccess', _426 => _426.customItemId]) != null;
|
|
15489
15452
|
const defaultIcon = cardType === "delivery_item" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.TruckFastIcon, { size: 24 }) : cardType === "internal_task" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CheckSquareIcon, { size: 24 }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MapIcon, { size: 24 });
|
|
15490
|
-
const icon = useTypeIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUQEOAPAIcjs.TaskTypeIcon, { customItemId: _optionalChain([item, 'optionalAccess',
|
|
15453
|
+
const icon = useTypeIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUQEOAPAIcjs.TaskTypeIcon, { customItemId: _optionalChain([item, 'optionalAccess', _427 => _427.customItemId]), className: "size-6" }) : logoUrl ? (
|
|
15491
15454
|
// Contained (not full-bleed) so the integration logo keeps its aspect
|
|
15492
15455
|
// ratio inside the bordered icon box — matches RoadmapCard.
|
|
15493
15456
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWLSFBRT5cjs.next_image_default, { src: logoUrl, alt: "", className: "size-6 object-contain", width: 24, height: 24, unoptimized: true })
|
|
@@ -15498,10 +15461,10 @@ function RoadmapChatCard({
|
|
|
15498
15461
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15499
15462
|
EntityMingoCard,
|
|
15500
15463
|
{
|
|
15501
|
-
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15502
|
-
description: _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15464
|
+
title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _428 => _428.title]), () => ( "")),
|
|
15465
|
+
description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _429 => _429.description]), () => ( void 0)),
|
|
15503
15466
|
fallbackIcon: icon,
|
|
15504
|
-
status: statusPill(_optionalChain([item, 'optionalAccess',
|
|
15467
|
+
status: statusPill(_optionalChain([item, 'optionalAccess', _430 => _430.status])),
|
|
15505
15468
|
chatRef,
|
|
15506
15469
|
isNewTab,
|
|
15507
15470
|
discuss,
|
|
@@ -15517,7 +15480,7 @@ function refHydratedEntry(docType, label, renderRef) {
|
|
|
15517
15480
|
bareInline: true,
|
|
15518
15481
|
contentRefType: docType,
|
|
15519
15482
|
noComposedHref: true,
|
|
15520
|
-
fallbackHref: (item) => _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
15483
|
+
fallbackHref: (item) => _nullishCoalesce(_optionalChain([item, 'optionalAccess', _431 => _431.url]), () => ( null)),
|
|
15521
15484
|
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MingoInfoCardSkeleton, {}),
|
|
15522
15485
|
render: (item, chatRef, opts) => renderRef(fetchedItemDisplayRef(item, chatRef), opts)
|
|
15523
15486
|
};
|
|
@@ -15568,9 +15531,9 @@ function refGlyphRegistryEntries() {
|
|
|
15568
15531
|
}
|
|
15569
15532
|
function fetchedEmployeeEntryDisplayRef(item, chatRef) {
|
|
15570
15533
|
const it = item;
|
|
15571
|
-
const title = typeof _optionalChain([it, 'optionalAccess',
|
|
15572
|
-
const author = typeof _optionalChain([it, 'optionalAccess',
|
|
15573
|
-
const summary = typeof _optionalChain([it, 'optionalAccess',
|
|
15534
|
+
const title = typeof _optionalChain([it, 'optionalAccess', _432 => _432.title]) === "string" && it.title.trim().length > 0 ? it.title.trim() : chatRef.title;
|
|
15535
|
+
const author = typeof _optionalChain([it, 'optionalAccess', _433 => _433.author, 'optionalAccess', _434 => _434.full_name]) === "string" ? it.author.full_name.trim() : "";
|
|
15536
|
+
const summary = typeof _optionalChain([it, 'optionalAccess', _435 => _435.summary]) === "string" ? it.summary.trim() : "";
|
|
15574
15537
|
const preview = [author, summary].filter((x) => x.length > 0).join(" \xB7 ");
|
|
15575
15538
|
return { ...chatRef, title, preview: preview.length > 0 ? preview : chatRef.preview };
|
|
15576
15539
|
}
|
|
@@ -15621,7 +15584,7 @@ function programRegistryEntries() {
|
|
|
15621
15584
|
discuss: opts.discuss,
|
|
15622
15585
|
configKey: cfg.configKey,
|
|
15623
15586
|
label: cfg.configKey.charAt(0).toUpperCase() + cfg.configKey.slice(1),
|
|
15624
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15587
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _436 => _436.extras, 'optionalAccess', _437 => _437.buildOgPlaceholderUrl, 'optionalCall', _438 => _438(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _439 => _439.title]), () => ( "")))]), () => ( null))
|
|
15625
15588
|
}
|
|
15626
15589
|
)
|
|
15627
15590
|
}));
|
|
@@ -15642,7 +15605,7 @@ var ROADMAP_CARD_CONFIGS = {
|
|
|
15642
15605
|
// The card's destination IS the ClickUp deep link, derived from the
|
|
15643
15606
|
// task id post-fetch (the refs frame used to carry it).
|
|
15644
15607
|
noComposedHref: true,
|
|
15645
|
-
fallbackHref: (item) => _optionalChain([item, 'optionalAccess',
|
|
15608
|
+
fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _440 => _440.id]) != null ? clickupTaskUrl(String(item.id)) : null
|
|
15646
15609
|
}
|
|
15647
15610
|
};
|
|
15648
15611
|
function roadmapRegistryEntries() {
|
|
@@ -15684,8 +15647,8 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15684
15647
|
DeletedDataCard,
|
|
15685
15648
|
{
|
|
15686
15649
|
title: chatRef.title && chatRef.title !== chatRef.id ? chatRef.title : null,
|
|
15687
|
-
entityLabel: _nullishCoalesce(_optionalChain([chatRef, 'access',
|
|
15688
|
-
recoveryNote: _nullishCoalesce(_optionalChain([chatRef, 'access',
|
|
15650
|
+
entityLabel: _nullishCoalesce(_optionalChain([chatRef, 'access', _441 => _441.metadata, 'optionalAccess', _442 => _442.entity_label]), () => ( null)),
|
|
15651
|
+
recoveryNote: _nullishCoalesce(_optionalChain([chatRef, 'access', _443 => _443.metadata, 'optionalAccess', _444 => _444.recovery_note]), () => ( null))
|
|
15689
15652
|
}
|
|
15690
15653
|
)
|
|
15691
15654
|
},
|
|
@@ -15702,7 +15665,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15702
15665
|
bareInline: true,
|
|
15703
15666
|
contentRefType: "faq",
|
|
15704
15667
|
noComposedHref: true,
|
|
15705
|
-
fallbackHref: (item) => _optionalChain([item, 'optionalAccess',
|
|
15668
|
+
fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _445 => _445.id]) != null ? `/faqs#${faqItemAnchor(item.id)}` : null,
|
|
15706
15669
|
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MingoInfoCardSkeleton, {}),
|
|
15707
15670
|
render: (item, chatRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FaqChatCard, { chatRef: fetchedFaqDisplayRef(item, chatRef), isNewTab: opts.isNewTab, discuss: opts.discuss })
|
|
15708
15671
|
},
|
|
@@ -15736,8 +15699,8 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15736
15699
|
chatRef,
|
|
15737
15700
|
isNewTab: opts.isNewTab,
|
|
15738
15701
|
discuss: opts.discuss,
|
|
15739
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15740
|
-
hasEmbeddedVideo: _optionalChain([chatRef, 'access',
|
|
15702
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _446 => _446.extras, 'optionalAccess', _447 => _447.buildOgPlaceholderUrl, 'optionalCall', _448 => _448(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _449 => _449.title]), () => ( "")))]), () => ( null)),
|
|
15703
|
+
hasEmbeddedVideo: _optionalChain([chatRef, 'access', _450 => _450.metadata, 'optionalAccess', _451 => _451.hasEmbeddedVideo]) === true
|
|
15741
15704
|
}
|
|
15742
15705
|
)
|
|
15743
15706
|
},
|
|
@@ -15753,7 +15716,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15753
15716
|
chatRef,
|
|
15754
15717
|
isNewTab: opts.isNewTab,
|
|
15755
15718
|
discuss: opts.discuss,
|
|
15756
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15719
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _452 => _452.extras, 'optionalAccess', _453 => _453.buildOgPlaceholderUrl, 'optionalCall', _454 => _454(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _455 => _455.title]), () => ( "")))]), () => ( null))
|
|
15757
15720
|
}
|
|
15758
15721
|
)
|
|
15759
15722
|
},
|
|
@@ -15769,7 +15732,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15769
15732
|
chatRef,
|
|
15770
15733
|
isNewTab: opts.isNewTab,
|
|
15771
15734
|
discuss: opts.discuss,
|
|
15772
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15735
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _456 => _456.extras, 'optionalAccess', _457 => _457.buildOgPlaceholderUrl, 'optionalCall', _458 => _458(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _459 => _459.title]), () => ( "")))]), () => ( null))
|
|
15773
15736
|
}
|
|
15774
15737
|
)
|
|
15775
15738
|
},
|
|
@@ -15779,7 +15742,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15779
15742
|
bareInline: true,
|
|
15780
15743
|
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUQEOAPAIcjs.ProductReleaseCardSkeleton, { size: "sm" }),
|
|
15781
15744
|
render: (item, chatRef, opts) => {
|
|
15782
|
-
const builder = _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15745
|
+
const builder = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _460 => _460.extras, 'optionalAccess', _461 => _461.buildProductReleaseCardProps]), () => ( _chunkUQEOAPAIcjs.defaultBuildProductReleaseCardProps));
|
|
15783
15746
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15784
15747
|
ProductReleaseChatCard,
|
|
15785
15748
|
{
|
|
@@ -15805,7 +15768,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15805
15768
|
chatRef,
|
|
15806
15769
|
isNewTab: opts.isNewTab,
|
|
15807
15770
|
discuss: opts.discuss,
|
|
15808
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15771
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _462 => _462.extras, 'optionalAccess', _463 => _463.buildOgPlaceholderUrl, 'optionalCall', _464 => _464(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _465 => _465.title]), () => ( "")))]), () => ( null))
|
|
15809
15772
|
}
|
|
15810
15773
|
)
|
|
15811
15774
|
},
|
|
@@ -15823,7 +15786,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15823
15786
|
chatRef,
|
|
15824
15787
|
isNewTab: opts.isNewTab,
|
|
15825
15788
|
discuss: opts.discuss,
|
|
15826
|
-
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
15789
|
+
ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _466 => _466.extras, 'optionalAccess', _467 => _467.buildOgPlaceholderUrl, 'optionalCall', _468 => _468(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _469 => _469.title]), () => ( "")))]), () => ( null))
|
|
15827
15790
|
}
|
|
15828
15791
|
)
|
|
15829
15792
|
},
|
|
@@ -15834,7 +15797,7 @@ var CHAT_CARD_REGISTRY = {
|
|
|
15834
15797
|
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CampaignCardAdminSkeleton, {}),
|
|
15835
15798
|
// No public viewer — synthesize the hub-internal admin URL post-fetch
|
|
15836
15799
|
// so the wrapper + isNewTab computation see the actual destination.
|
|
15837
|
-
fallbackHref: (item) => _optionalChain([item, 'optionalAccess',
|
|
15800
|
+
fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _470 => _470.id]) ? `/admin/campaigns/${encodeURIComponent(String(item.id))}` : null,
|
|
15838
15801
|
render: (item, chatRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CampaignChatCard, { item, chatRef, isNewTab: opts.isNewTab, discuss: opts.discuss })
|
|
15839
15802
|
},
|
|
15840
15803
|
...roadmapRegistryEntries()
|
|
@@ -15853,13 +15816,13 @@ function ChatCardNavWrap({
|
|
|
15853
15816
|
if (!href) return;
|
|
15854
15817
|
const targetEl = e.target;
|
|
15855
15818
|
const host = e.currentTarget;
|
|
15856
|
-
if (!_optionalChain([host, 'optionalAccess',
|
|
15857
|
-
if (_optionalChain([targetEl, 'optionalAccess',
|
|
15858
|
-
if (!_optionalChain([targetEl, 'optionalAccess',
|
|
15819
|
+
if (!_optionalChain([host, 'optionalAccess', _471 => _471.contains, 'call', _472 => _472(targetEl)])) return;
|
|
15820
|
+
if (_optionalChain([targetEl, 'optionalAccess', _473 => _473.closest, 'optionalCall', _474 => _474("button")])) return;
|
|
15821
|
+
if (!_optionalChain([targetEl, 'optionalAccess', _475 => _475.closest, 'optionalCall', _476 => _476("a")])) return;
|
|
15859
15822
|
const handled = executeNavigation({ event: e, runtime, href, path, targetPlatform, fallbackNavigate: router.push });
|
|
15860
15823
|
if (!handled) return;
|
|
15861
15824
|
e.stopPropagation();
|
|
15862
|
-
if (!isNewTab && _optionalChain([panel, 'optionalAccess',
|
|
15825
|
+
if (!isNewTab && _optionalChain([panel, 'optionalAccess', _477 => _477.closeChat])) panel.closeChat();
|
|
15863
15826
|
};
|
|
15864
15827
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "contents", onClickCapture, children });
|
|
15865
15828
|
}
|
|
@@ -15881,7 +15844,7 @@ function ChatCardLoader({
|
|
|
15881
15844
|
title: chatRef.title,
|
|
15882
15845
|
externalUrl: chatRef.url,
|
|
15883
15846
|
targetPlatform: chatRef.targetPlatform,
|
|
15884
|
-
path: typeof _optionalChain([chatRef, 'access',
|
|
15847
|
+
path: typeof _optionalChain([chatRef, 'access', _478 => _478.metadata, 'optionalAccess', _479 => _479.path]) === "string" ? chatRef.metadata.path : null
|
|
15885
15848
|
},
|
|
15886
15849
|
sourceRowCtxFromRuntime(runtime, { baseRoute, chipBasePlatform })
|
|
15887
15850
|
);
|
|
@@ -15895,11 +15858,11 @@ function ChatCardLoader({
|
|
|
15895
15858
|
const entry = CHAT_CARD_REGISTRY[resolvedChatRef.type];
|
|
15896
15859
|
const fetchEntry = entry && entry.contentRefType ? entry : null;
|
|
15897
15860
|
const { item, isLoading, isError, isFetched } = useChatCardItem(
|
|
15898
|
-
_nullishCoalesce(_optionalChain([fetchEntry, 'optionalAccess',
|
|
15861
|
+
_nullishCoalesce(_optionalChain([fetchEntry, 'optionalAccess', _480 => _480.contentRefType]), () => ( "")),
|
|
15899
15862
|
fetchEntry ? resolvedChatRef.id : ""
|
|
15900
15863
|
);
|
|
15901
15864
|
if (!entry) return null;
|
|
15902
|
-
const composedHref = _optionalChain([fetchEntry, 'optionalAccess',
|
|
15865
|
+
const composedHref = _optionalChain([fetchEntry, 'optionalAccess', _481 => _481.contentRefType]) && !resolvedChatRef.url && item ? resolveFetchedCardHref({
|
|
15903
15866
|
contentRefType: fetchEntry.contentRefType,
|
|
15904
15867
|
id: resolvedChatRef.id,
|
|
15905
15868
|
item,
|
|
@@ -15907,7 +15870,7 @@ function ChatCardLoader({
|
|
|
15907
15870
|
}) : null;
|
|
15908
15871
|
const hrefChoice = fetchEntry && !resolvedChatRef.url && item ? pickFetchedCardHref({
|
|
15909
15872
|
composed: composedHref,
|
|
15910
|
-
itemHref: _nullishCoalesce(_optionalChain([fetchEntry, 'access',
|
|
15873
|
+
itemHref: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _482 => _482.fallbackHref, 'optionalCall', _483 => _483(item)]), () => ( null)),
|
|
15911
15874
|
allowComposed: !fetchEntry.noComposedHref
|
|
15912
15875
|
}) : null;
|
|
15913
15876
|
const hrefResolvedChatRef = hrefChoice ? {
|
|
@@ -15941,7 +15904,7 @@ function ChatCardLoader({
|
|
|
15941
15904
|
isNewTab,
|
|
15942
15905
|
discuss
|
|
15943
15906
|
};
|
|
15944
|
-
const path = typeof _optionalChain([finalChatRef, 'access',
|
|
15907
|
+
const path = typeof _optionalChain([finalChatRef, 'access', _484 => _484.metadata, 'optionalAccess', _485 => _485.path]) === "string" ? finalChatRef.metadata.path : null;
|
|
15945
15908
|
const navWrap = (children) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15946
15909
|
ChatCardNavWrap,
|
|
15947
15910
|
{
|
|
@@ -15965,7 +15928,7 @@ function ChatCardLoader({
|
|
|
15965
15928
|
if (!fetchEntry) {
|
|
15966
15929
|
return finish(entry.render(void 0, finalChatRef, renderOpts));
|
|
15967
15930
|
}
|
|
15968
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([fetchEntry, 'access',
|
|
15931
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _486 => _486.skeleton, 'optionalCall', _487 => _487()]), () => ( null)) });
|
|
15969
15932
|
if (!item) {
|
|
15970
15933
|
if (isError) {
|
|
15971
15934
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardLoadFailure, { label: entry.label, id: finalChatRef.id, detail: "Failed to load" });
|
|
@@ -16102,11 +16065,11 @@ function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
|
16102
16065
|
function makeBatchDedupKey(item) {
|
|
16103
16066
|
const seq = _nullishCoalesce(item.chunk.sequenceId, () => ( "na"));
|
|
16104
16067
|
const type = typeof item.chunk.type === "string" ? item.chunk.type : "na";
|
|
16105
|
-
const
|
|
16068
|
+
const text = typeof item.chunk.text === "string" ? item.chunk.text : "";
|
|
16106
16069
|
const integratedToolType = typeof item.chunk.integratedToolType === "string" ? item.chunk.integratedToolType : "";
|
|
16107
16070
|
const toolFunction = typeof item.chunk.toolFunction === "string" ? item.chunk.toolFunction : "";
|
|
16108
16071
|
const approvalRequestId = typeof item.chunk.approvalRequestId === "string" ? item.chunk.approvalRequestId : typeof item.chunk.approval_request_id === "string" ? item.chunk.approval_request_id : "";
|
|
16109
|
-
return `${item.messageType}:${seq}:${type}:${
|
|
16072
|
+
return `${item.messageType}:${seq}:${type}:${text}:${integratedToolType}:${toolFunction}:${approvalRequestId}`;
|
|
16110
16073
|
}
|
|
16111
16074
|
function getChatTypeMessageType(chatType) {
|
|
16112
16075
|
return chatType === CHAT_TYPE.ADMIN ? "admin-message" : "message";
|
|
@@ -16328,7 +16291,7 @@ function useChunkCatchup({
|
|
|
16328
16291
|
if (catchupRun.current === run) {
|
|
16329
16292
|
if (currentDialogId !== dialogIdRef.current) {
|
|
16330
16293
|
catchupRun.current = null;
|
|
16331
|
-
if (_optionalChain([pendingCatchupRef, 'access',
|
|
16294
|
+
if (_optionalChain([pendingCatchupRef, 'access', _488 => _488.current, 'optionalAccess', _489 => _489.dialogId]) === currentDialogId) {
|
|
16332
16295
|
pendingCatchupRef.current = null;
|
|
16333
16296
|
}
|
|
16334
16297
|
} else {
|
|
@@ -16339,7 +16302,7 @@ function useChunkCatchup({
|
|
|
16339
16302
|
if (pending.dialogId === currentDialogId) {
|
|
16340
16303
|
rearmForQueuedCatchup();
|
|
16341
16304
|
try {
|
|
16342
|
-
await _optionalChain([catchUpChunksRef, 'access',
|
|
16305
|
+
await _optionalChain([catchUpChunksRef, 'access', _490 => _490.current, 'optionalCall', _491 => _491(pending.fromSequenceId)]);
|
|
16343
16306
|
} catch (rerunError) {
|
|
16344
16307
|
console.error("Queued catch-up re-run failed:", rerunError);
|
|
16345
16308
|
}
|
|
@@ -16406,7 +16369,7 @@ function useChunkCatchup({
|
|
|
16406
16369
|
|
|
16407
16370
|
var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
|
|
16408
16371
|
function prefersReducedMotion() {
|
|
16409
|
-
return typeof window !== "undefined" && _optionalChain([window, 'access',
|
|
16372
|
+
return typeof window !== "undefined" && _optionalChain([window, 'access', _492 => _492.matchMedia, 'optionalCall', _493 => _493("(prefers-reduced-motion: reduce)"), 'access', _494 => _494.matches]) === true;
|
|
16410
16373
|
}
|
|
16411
16374
|
function useScriptedStream(frames, resetKey, enabled = true) {
|
|
16412
16375
|
const [index, setIndex] = _react.useState.call(void 0, 0);
|
|
@@ -16417,7 +16380,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
16417
16380
|
setIndex(0);
|
|
16418
16381
|
}
|
|
16419
16382
|
_react.useEffect.call(void 0, () => {
|
|
16420
|
-
const mq = _optionalChain([window, 'access',
|
|
16383
|
+
const mq = _optionalChain([window, 'access', _495 => _495.matchMedia, 'optionalCall', _496 => _496("(prefers-reduced-motion: reduce)")]);
|
|
16421
16384
|
const sync = () => setReducedMotion(mq ? mq.matches : prefersReducedMotion());
|
|
16422
16385
|
sync();
|
|
16423
16386
|
if (!mq) return void 0;
|
|
@@ -16560,7 +16523,7 @@ function useJetStreamDialogSubscription({
|
|
|
16560
16523
|
const lifecycle = _chunkI5JVSFNVcjs.startConnectionLifecycle.call(void 0, {
|
|
16561
16524
|
conn: sharedConn,
|
|
16562
16525
|
wsUrl,
|
|
16563
|
-
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access',
|
|
16526
|
+
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _497 => _497.current, 'optionalCall', _498 => _498()]),
|
|
16564
16527
|
backoff: reconnectionBackoffRef.current,
|
|
16565
16528
|
getFreshUrl: () => getNatsWsUrlRef.current(),
|
|
16566
16529
|
// JetStream emits 'error' for protocol-level failures (e.g. -ERR Permissions
|
|
@@ -16575,7 +16538,7 @@ function useJetStreamDialogSubscription({
|
|
|
16575
16538
|
setReconnectionCount((c) => c + 1);
|
|
16576
16539
|
}
|
|
16577
16540
|
hadConnectionBeforeRef.current = true;
|
|
16578
|
-
_optionalChain([onConnectRef, 'access',
|
|
16541
|
+
_optionalChain([onConnectRef, 'access', _499 => _499.current, 'optionalCall', _500 => _500()]);
|
|
16579
16542
|
}
|
|
16580
16543
|
if (status === "error") {
|
|
16581
16544
|
console.warn("[JetStream] NATS protocol error:", evt.data);
|
|
@@ -16585,7 +16548,7 @@ function useJetStreamDialogSubscription({
|
|
|
16585
16548
|
setIsConnected(false);
|
|
16586
16549
|
setIsSubscribed(false);
|
|
16587
16550
|
tearDownSubscription();
|
|
16588
|
-
_optionalChain([onDisconnectRef, 'access',
|
|
16551
|
+
_optionalChain([onDisconnectRef, 'access', _501 => _501.current, 'optionalCall', _502 => _502()]);
|
|
16589
16552
|
}
|
|
16590
16553
|
}
|
|
16591
16554
|
});
|
|
@@ -16711,7 +16674,7 @@ function useJetStreamDialogSubscription({
|
|
|
16711
16674
|
}
|
|
16712
16675
|
subscriptionRef.current = handle;
|
|
16713
16676
|
setIsSubscribed(true);
|
|
16714
|
-
_optionalChain([onSubscribedRef, 'access',
|
|
16677
|
+
_optionalChain([onSubscribedRef, 'access', _503 => _503.current, 'optionalCall', _504 => _504()]);
|
|
16715
16678
|
} catch (e50) {
|
|
16716
16679
|
if (!cancelled) {
|
|
16717
16680
|
setIsSubscribed(false);
|
|
@@ -16827,20 +16790,20 @@ function useNatsDialogSubscription({
|
|
|
16827
16790
|
const tearDownSubscriptions = () => {
|
|
16828
16791
|
subscriptionRefs.current.forEach((sub) => {
|
|
16829
16792
|
try {
|
|
16830
|
-
_optionalChain([sub, 'optionalAccess',
|
|
16793
|
+
_optionalChain([sub, 'optionalAccess', _505 => _505.unsubscribe, 'call', _506 => _506()]);
|
|
16831
16794
|
} catch (e52) {
|
|
16832
16795
|
}
|
|
16833
16796
|
});
|
|
16834
16797
|
subscriptionRefs.current.clear();
|
|
16835
16798
|
lastSubscribedDialogIdRef.current = null;
|
|
16836
|
-
_optionalChain([abortControllerRef, 'access',
|
|
16799
|
+
_optionalChain([abortControllerRef, 'access', _507 => _507.current, 'optionalAccess', _508 => _508.abort, 'call', _509 => _509()]);
|
|
16837
16800
|
abortControllerRef.current = null;
|
|
16838
16801
|
};
|
|
16839
16802
|
const isDisconnectStatus = (status) => status === "closed" || status === "disconnected";
|
|
16840
16803
|
const lifecycle = _chunkI5JVSFNVcjs.startConnectionLifecycle.call(void 0, {
|
|
16841
16804
|
conn: sharedConn,
|
|
16842
16805
|
wsUrl,
|
|
16843
|
-
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access',
|
|
16806
|
+
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _510 => _510.current, 'optionalCall', _511 => _511()]),
|
|
16844
16807
|
backoff: reconnectionBackoffRef.current,
|
|
16845
16808
|
getFreshUrl: () => getNatsWsUrlRef.current(),
|
|
16846
16809
|
shouldRetryOn: isDisconnectStatus,
|
|
@@ -16851,7 +16814,7 @@ function useNatsDialogSubscription({
|
|
|
16851
16814
|
setReconnectionCount((c) => c + 1);
|
|
16852
16815
|
}
|
|
16853
16816
|
hadConnectionBeforeRef.current = true;
|
|
16854
|
-
_optionalChain([onConnectRef, 'access',
|
|
16817
|
+
_optionalChain([onConnectRef, 'access', _512 => _512.current, 'optionalCall', _513 => _513()]);
|
|
16855
16818
|
}
|
|
16856
16819
|
if (status === "error") {
|
|
16857
16820
|
console.warn("[NATS] protocol error:", evt.data);
|
|
@@ -16861,7 +16824,7 @@ function useNatsDialogSubscription({
|
|
|
16861
16824
|
setIsConnected(false);
|
|
16862
16825
|
setIsSubscribed(false);
|
|
16863
16826
|
tearDownSubscriptions();
|
|
16864
|
-
_optionalChain([onDisconnectRef, 'access',
|
|
16827
|
+
_optionalChain([onDisconnectRef, 'access', _514 => _514.current, 'optionalCall', _515 => _515()]);
|
|
16865
16828
|
}
|
|
16866
16829
|
}
|
|
16867
16830
|
});
|
|
@@ -16892,13 +16855,13 @@ function useNatsDialogSubscription({
|
|
|
16892
16855
|
setIsSubscribed(false);
|
|
16893
16856
|
subscriptionRefs.current.forEach((sub) => {
|
|
16894
16857
|
try {
|
|
16895
|
-
_optionalChain([sub, 'optionalAccess',
|
|
16858
|
+
_optionalChain([sub, 'optionalAccess', _516 => _516.unsubscribe, 'call', _517 => _517()]);
|
|
16896
16859
|
} catch (e53) {
|
|
16897
16860
|
}
|
|
16898
16861
|
});
|
|
16899
16862
|
subscriptionRefs.current.clear();
|
|
16900
16863
|
lastSubscribedDialogIdRef.current = null;
|
|
16901
|
-
_optionalChain([abortControllerRef, 'access',
|
|
16864
|
+
_optionalChain([abortControllerRef, 'access', _518 => _518.current, 'optionalAccess', _519 => _519.abort, 'call', _520 => _520()]);
|
|
16902
16865
|
abortControllerRef.current = null;
|
|
16903
16866
|
}
|
|
16904
16867
|
return void 0;
|
|
@@ -16910,12 +16873,12 @@ function useNatsDialogSubscription({
|
|
|
16910
16873
|
if (subscriptionRefs.current.size > 0) {
|
|
16911
16874
|
subscriptionRefs.current.forEach((sub) => {
|
|
16912
16875
|
try {
|
|
16913
|
-
_optionalChain([sub, 'optionalAccess',
|
|
16876
|
+
_optionalChain([sub, 'optionalAccess', _521 => _521.unsubscribe, 'call', _522 => _522()]);
|
|
16914
16877
|
} catch (e54) {
|
|
16915
16878
|
}
|
|
16916
16879
|
});
|
|
16917
16880
|
subscriptionRefs.current.clear();
|
|
16918
|
-
_optionalChain([abortControllerRef, 'access',
|
|
16881
|
+
_optionalChain([abortControllerRef, 'access', _523 => _523.current, 'optionalAccess', _524 => _524.abort, 'call', _525 => _525()]);
|
|
16919
16882
|
}
|
|
16920
16883
|
abortControllerRef.current = new AbortController();
|
|
16921
16884
|
const abort = abortControllerRef.current;
|
|
@@ -16945,7 +16908,7 @@ function useNatsDialogSubscription({
|
|
|
16945
16908
|
});
|
|
16946
16909
|
lastSubscribedDialogIdRef.current = dialogId;
|
|
16947
16910
|
setIsSubscribed(true);
|
|
16948
|
-
_optionalChain([onSubscribedRef, 'access',
|
|
16911
|
+
_optionalChain([onSubscribedRef, 'access', _526 => _526.current, 'optionalCall', _527 => _527()]);
|
|
16949
16912
|
};
|
|
16950
16913
|
if (isConnectedRef.current) {
|
|
16951
16914
|
createSubscriptions();
|
|
@@ -16956,7 +16919,7 @@ function useNatsDialogSubscription({
|
|
|
16956
16919
|
abort.abort();
|
|
16957
16920
|
subscriptions.forEach((sub) => {
|
|
16958
16921
|
try {
|
|
16959
|
-
_optionalChain([sub, 'optionalAccess',
|
|
16922
|
+
_optionalChain([sub, 'optionalAccess', _528 => _528.unsubscribe, 'call', _529 => _529()]);
|
|
16960
16923
|
} catch (e56) {
|
|
16961
16924
|
}
|
|
16962
16925
|
});
|
|
@@ -16995,7 +16958,7 @@ function useNatsDialogSubscription({
|
|
|
16995
16958
|
});
|
|
16996
16959
|
lastSubscribedDialogIdRef.current = currentDialogId;
|
|
16997
16960
|
setIsSubscribed(true);
|
|
16998
|
-
_optionalChain([onSubscribedRef, 'access',
|
|
16961
|
+
_optionalChain([onSubscribedRef, 'access', _530 => _530.current, 'optionalCall', _531 => _531()]);
|
|
16999
16962
|
} else if (subscriptionRefs.current.size > 0) {
|
|
17000
16963
|
setIsSubscribed(true);
|
|
17001
16964
|
}
|
|
@@ -17003,10 +16966,10 @@ function useNatsDialogSubscription({
|
|
|
17003
16966
|
return { isConnected, isSubscribed, reconnectionCount };
|
|
17004
16967
|
}
|
|
17005
16968
|
function buildNatsWsUrl(apiBaseUrl, options) {
|
|
17006
|
-
const path = _optionalChain([options, 'optionalAccess',
|
|
16969
|
+
const path = _optionalChain([options, 'optionalAccess', _532 => _532.source]) === "dashboard" ? "/ws/nats-api" : "/ws/nats";
|
|
17007
16970
|
const u = new URL(path, apiBaseUrl);
|
|
17008
16971
|
u.protocol = u.protocol === "https:" ? "wss:" : "ws:";
|
|
17009
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
16972
|
+
if (_optionalChain([options, 'optionalAccess', _533 => _533.includeAuthParam]) && _optionalChain([options, 'optionalAccess', _534 => _534.token])) {
|
|
17010
16973
|
u.searchParams.set("authorization", options.token);
|
|
17011
16974
|
}
|
|
17012
16975
|
return u.toString();
|
|
@@ -17024,7 +16987,7 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
17024
16987
|
const data = await res.json();
|
|
17025
16988
|
return _nullishCoalesce(data.commands, () => ( []));
|
|
17026
16989
|
} catch (err) {
|
|
17027
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
16990
|
+
if (_optionalChain([err, 'optionalAccess', _535 => _535.name]) === "AbortError") throw err;
|
|
17028
16991
|
console.warn("[chat] slash-commands fetch failed, showing none:", err);
|
|
17029
16992
|
return [];
|
|
17030
16993
|
}
|
|
@@ -17032,8 +16995,8 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
17032
16995
|
var NO_COMMANDS = [];
|
|
17033
16996
|
function useSlashCommands(prefix, commandsUrl) {
|
|
17034
16997
|
const [answered, setAnswered] = _react.useState.call(void 0, null);
|
|
17035
|
-
const commands = prefix != null && _optionalChain([answered, 'optionalAccess',
|
|
17036
|
-
const loading = prefix != null && _optionalChain([answered, 'optionalAccess',
|
|
16998
|
+
const commands = prefix != null && _optionalChain([answered, 'optionalAccess', _536 => _536.prefix]) === prefix ? answered.commands : NO_COMMANDS;
|
|
16999
|
+
const loading = prefix != null && _optionalChain([answered, 'optionalAccess', _537 => _537.prefix]) !== prefix;
|
|
17037
17000
|
_react.useEffect.call(void 0, () => {
|
|
17038
17001
|
if (prefix == null) return void 0;
|
|
17039
17002
|
let cancelled = false;
|
|
@@ -17043,7 +17006,7 @@ function useSlashCommands(prefix, commandsUrl) {
|
|
|
17043
17006
|
const next = await fetchSlashCommands(prefix, ctrl.signal, commandsUrl);
|
|
17044
17007
|
if (!cancelled) setAnswered({ prefix, commands: next });
|
|
17045
17008
|
} catch (err) {
|
|
17046
|
-
if (!cancelled && _optionalChain([err, 'optionalAccess',
|
|
17009
|
+
if (!cancelled && _optionalChain([err, 'optionalAccess', _538 => _538.name]) !== "AbortError") {
|
|
17047
17010
|
console.warn("[use-slash-commands] fetch failed:", err);
|
|
17048
17011
|
setAnswered({ prefix, commands: NO_COMMANDS });
|
|
17049
17012
|
}
|
|
@@ -17066,7 +17029,7 @@ function useSlashCommandRegistry(commandsUrl, options) {
|
|
|
17066
17029
|
const query = _reactquery.useQuery.call(void 0, {
|
|
17067
17030
|
queryKey: ["chat-slash-commands", commandsUrl],
|
|
17068
17031
|
queryFn: ({ signal }) => fetchSlashCommands("", signal, commandsUrl),
|
|
17069
|
-
enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
17032
|
+
enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _539 => _539.enabled]), () => ( true)),
|
|
17070
17033
|
staleTime: Infinity,
|
|
17071
17034
|
gcTime: Infinity,
|
|
17072
17035
|
// The commands registry is non-critical chrome — a failure degrades to an
|
|
@@ -17105,21 +17068,21 @@ async function fetchEmptyStateConfig(signal, emptyStateUrl) {
|
|
|
17105
17068
|
}
|
|
17106
17069
|
const data = await res.json();
|
|
17107
17070
|
return {
|
|
17108
|
-
name: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17109
|
-
icon: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17110
|
-
greeting: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17111
|
-
enabledRagTableIds: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17112
|
-
quickActions: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17113
|
-
suggestedQueries: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
17071
|
+
name: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _540 => _540.name]), () => ( null)),
|
|
17072
|
+
icon: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _541 => _541.icon]), () => ( null)),
|
|
17073
|
+
greeting: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _542 => _542.greeting]), () => ( null)),
|
|
17074
|
+
enabledRagTableIds: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _543 => _543.enabledRagTableIds]), () => ( [])),
|
|
17075
|
+
quickActions: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _544 => _544.quickActions]), () => ( [])),
|
|
17076
|
+
suggestedQueries: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _545 => _545.suggestedQueries]), () => ( []))
|
|
17114
17077
|
};
|
|
17115
17078
|
} catch (err) {
|
|
17116
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
17079
|
+
if (_optionalChain([err, 'optionalAccess', _546 => _546.name]) === "AbortError") throw err;
|
|
17117
17080
|
console.warn("[chat] empty-state config fetch failed, using neutral defaults:", err);
|
|
17118
17081
|
return EMPTY_STATE_FALLBACK;
|
|
17119
17082
|
}
|
|
17120
17083
|
}
|
|
17121
17084
|
function useEmptyStateConfig(emptyStateUrl, options) {
|
|
17122
|
-
const enabled = (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
17085
|
+
const enabled = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _547 => _547.enabled]), () => ( true))) && !!emptyStateUrl;
|
|
17123
17086
|
const query = _reactquery.useQuery.call(void 0, {
|
|
17124
17087
|
queryKey: ["chat-empty-state", emptyStateUrl],
|
|
17125
17088
|
queryFn: ({ signal }) => fetchEmptyStateConfig(signal, emptyStateUrl),
|
|
@@ -17148,7 +17111,7 @@ var CHAT_ATTACHMENT_MAX_SIZE_BYTES = 25 * 1024 * 1024;
|
|
|
17148
17111
|
var STORAGE_CACHE_CONTROL_IMMUTABLE = "public, max-age=31536000, immutable";
|
|
17149
17112
|
function uploadWithProgress(url, file, token, onProgress, signal) {
|
|
17150
17113
|
return new Promise((resolve, reject) => {
|
|
17151
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
17114
|
+
if (_optionalChain([signal, 'optionalAccess', _548 => _548.aborted])) {
|
|
17152
17115
|
reject(new Error("Upload cancelled"));
|
|
17153
17116
|
return;
|
|
17154
17117
|
}
|
|
@@ -17190,7 +17153,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
|
|
|
17190
17153
|
const handleSignalAbort = () => {
|
|
17191
17154
|
xhr.abort();
|
|
17192
17155
|
};
|
|
17193
|
-
_optionalChain([signal, 'optionalAccess',
|
|
17156
|
+
_optionalChain([signal, 'optionalAccess', _549 => _549.addEventListener, 'call', _550 => _550("abort", handleSignalAbort, { once: true, signal: listeners.signal })]);
|
|
17194
17157
|
xhr.upload.addEventListener("progress", handleProgress, { signal: listeners.signal });
|
|
17195
17158
|
xhr.addEventListener("load", handleLoad, { signal: listeners.signal });
|
|
17196
17159
|
xhr.addEventListener("error", handleError, { signal: listeners.signal });
|
|
@@ -17234,10 +17197,10 @@ function useChatAttachments() {
|
|
|
17234
17197
|
try {
|
|
17235
17198
|
sniffed = await _filetype.fileTypeFromBlob.call(void 0, att.file);
|
|
17236
17199
|
} catch (err) {
|
|
17237
|
-
if (_optionalChain([ctrl, 'optionalAccess',
|
|
17200
|
+
if (_optionalChain([ctrl, 'optionalAccess', _551 => _551.signal, 'access', _552 => _552.aborted])) return;
|
|
17238
17201
|
throw new Error(`Could not read file content: ${err instanceof Error ? err.message : String(err)}`);
|
|
17239
17202
|
}
|
|
17240
|
-
if (_optionalChain([ctrl, 'optionalAccess',
|
|
17203
|
+
if (_optionalChain([ctrl, 'optionalAccess', _553 => _553.signal, 'access', _554 => _554.aborted])) return;
|
|
17241
17204
|
if (!sniffed) {
|
|
17242
17205
|
throw new Error("Unrecognized file format");
|
|
17243
17206
|
}
|
|
@@ -17251,7 +17214,7 @@ function useChatAttachments() {
|
|
|
17251
17214
|
const urlResp = await _chunkEHAYNUOLcjs.embedAuthedFetch.call(void 0, uploadUrlEndpoint, {
|
|
17252
17215
|
method: "POST",
|
|
17253
17216
|
headers: { "Content-Type": "application/json" },
|
|
17254
|
-
signal: _optionalChain([ctrl, 'optionalAccess',
|
|
17217
|
+
signal: _optionalChain([ctrl, 'optionalAccess', _555 => _555.signal]),
|
|
17255
17218
|
body: JSON.stringify({
|
|
17256
17219
|
fileName: att.file.name,
|
|
17257
17220
|
// Pass the SNIFFED MIME (not `file.type`, which can be a
|
|
@@ -17280,9 +17243,9 @@ function useChatAttachments() {
|
|
|
17280
17243
|
(pct) => {
|
|
17281
17244
|
updateOne(att.id, { progress: pct });
|
|
17282
17245
|
},
|
|
17283
|
-
_optionalChain([ctrl, 'optionalAccess',
|
|
17246
|
+
_optionalChain([ctrl, 'optionalAccess', _556 => _556.signal])
|
|
17284
17247
|
);
|
|
17285
|
-
if (_optionalChain([ctrl, 'optionalAccess',
|
|
17248
|
+
if (_optionalChain([ctrl, 'optionalAccess', _557 => _557.signal, 'access', _558 => _558.aborted])) return;
|
|
17286
17249
|
updateOne(att.id, {
|
|
17287
17250
|
status: "ready",
|
|
17288
17251
|
progress: 100,
|
|
@@ -17290,7 +17253,7 @@ function useChatAttachments() {
|
|
|
17290
17253
|
viewToken: mintData.viewToken
|
|
17291
17254
|
});
|
|
17292
17255
|
} catch (err) {
|
|
17293
|
-
if (_optionalChain([ctrl, 'optionalAccess',
|
|
17256
|
+
if (_optionalChain([ctrl, 'optionalAccess', _559 => _559.signal, 'access', _560 => _560.aborted])) return;
|
|
17294
17257
|
const message = err instanceof Error ? err.message : String(err);
|
|
17295
17258
|
updateOne(att.id, { status: "error", progress: 0, errorMessage: message });
|
|
17296
17259
|
} finally {
|
|
@@ -17439,11 +17402,11 @@ var ANON_DEFAULTS = {
|
|
|
17439
17402
|
function useResolveChatIdentity(enabled) {
|
|
17440
17403
|
const runtime = _chunkUPKZU6QUcjs.useRequiredChatRuntime.call(void 0, );
|
|
17441
17404
|
const url = runtime.endpoints.identityUrl;
|
|
17442
|
-
const proxyEmail = _nullishCoalesce(_optionalChain([_chunkEHAYNUOLcjs.getEmbedProxyAuth.call(void 0, ), 'optionalAccess',
|
|
17405
|
+
const proxyEmail = _nullishCoalesce(_optionalChain([_chunkEHAYNUOLcjs.getEmbedProxyAuth.call(void 0, ), 'optionalAccess', _561 => _561.email]), () => ( null));
|
|
17443
17406
|
const requestKey = enabled ? `${url}\0${_nullishCoalesce(proxyEmail, () => ( ""))}` : null;
|
|
17444
17407
|
const [resolved, setResolved] = _react.useState.call(void 0, null);
|
|
17445
|
-
const data = _optionalChain([resolved, 'optionalAccess',
|
|
17446
|
-
const isLoading = requestKey !== null && _optionalChain([resolved, 'optionalAccess',
|
|
17408
|
+
const data = _optionalChain([resolved, 'optionalAccess', _562 => _562.key]) === requestKey ? resolved.data : ANON_DEFAULTS;
|
|
17409
|
+
const isLoading = requestKey !== null && _optionalChain([resolved, 'optionalAccess', _563 => _563.key]) !== requestKey;
|
|
17447
17410
|
_react.useEffect.call(void 0, () => {
|
|
17448
17411
|
if (requestKey === null) return void 0;
|
|
17449
17412
|
let cancelled = false;
|
|
@@ -17590,7 +17553,7 @@ function useChat({
|
|
|
17590
17553
|
onMessagesChangeRef.current = onMessagesChange;
|
|
17591
17554
|
});
|
|
17592
17555
|
_react.useEffect.call(void 0, () => {
|
|
17593
|
-
_optionalChain([onMessagesChangeRef, 'access',
|
|
17556
|
+
_optionalChain([onMessagesChangeRef, 'access', _564 => _564.current, 'optionalCall', _565 => _565(messages)]);
|
|
17594
17557
|
}, [messages]);
|
|
17595
17558
|
const {
|
|
17596
17559
|
streamMessage,
|
|
@@ -17620,14 +17583,14 @@ function useChat({
|
|
|
17620
17583
|
});
|
|
17621
17584
|
}, []);
|
|
17622
17585
|
const sendMessage = _react.useCallback.call(void 0,
|
|
17623
|
-
async (
|
|
17586
|
+
async (text, extra, options) => {
|
|
17624
17587
|
const userMessage = {
|
|
17625
17588
|
id: `user-${Date.now()}`,
|
|
17626
17589
|
role: "user",
|
|
17627
17590
|
name: "You",
|
|
17628
|
-
content:
|
|
17591
|
+
content: text,
|
|
17629
17592
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17630
|
-
..._optionalChain([options, 'optionalAccess',
|
|
17593
|
+
..._optionalChain([options, 'optionalAccess', _566 => _566.hidden]) ? { hidden: true } : {}
|
|
17631
17594
|
};
|
|
17632
17595
|
addMessage(userMessage);
|
|
17633
17596
|
setIsTyping(true);
|
|
@@ -17644,7 +17607,7 @@ function useChat({
|
|
|
17644
17607
|
try {
|
|
17645
17608
|
let receivedFirstTextChunk = false;
|
|
17646
17609
|
let currentTextSegment = "";
|
|
17647
|
-
for await (const rawSegment of streamMessage(
|
|
17610
|
+
for await (const rawSegment of streamMessage(text, extra)) {
|
|
17648
17611
|
const segment = asStreamFrame(rawSegment);
|
|
17649
17612
|
if (!receivedFirstTextChunk && segment.type === "text") {
|
|
17650
17613
|
setIsTyping(false);
|
|
@@ -17841,7 +17804,7 @@ function buildConfirmToolBody(request) {
|
|
|
17841
17804
|
async function readServerErrorMessage(response) {
|
|
17842
17805
|
try {
|
|
17843
17806
|
const body = await response.json();
|
|
17844
|
-
if (typeof _optionalChain([body, 'optionalAccess',
|
|
17807
|
+
if (typeof _optionalChain([body, 'optionalAccess', _567 => _567.error]) === "string" && body.error.length > 0) return body.error;
|
|
17845
17808
|
} catch (e58) {
|
|
17846
17809
|
}
|
|
17847
17810
|
return null;
|
|
@@ -17853,8 +17816,8 @@ var END_OF_LEADING = "";
|
|
|
17853
17816
|
var TRAILER_SENTINEL = "";
|
|
17854
17817
|
|
|
17855
17818
|
// src/chat-protocol/leading-frames.ts
|
|
17856
|
-
function escapeThinkingTags(
|
|
17857
|
-
return
|
|
17819
|
+
function escapeThinkingTags(text) {
|
|
17820
|
+
return text.replace(/</g, "<");
|
|
17858
17821
|
}
|
|
17859
17822
|
function frameStr(value) {
|
|
17860
17823
|
return typeof value === "string" ? value : void 0;
|
|
@@ -17965,11 +17928,11 @@ function isFrameObject(value) {
|
|
|
17965
17928
|
}
|
|
17966
17929
|
function frameTelemetry(value) {
|
|
17967
17930
|
if (!isFrameObject(value)) return void 0;
|
|
17968
|
-
const { cards
|
|
17969
|
-
if (typeof
|
|
17931
|
+
const { cards, chips, sentences, answerLen } = value;
|
|
17932
|
+
if (typeof cards !== "number" || typeof chips !== "number" || typeof sentences !== "number" || typeof answerLen !== "number") {
|
|
17970
17933
|
return void 0;
|
|
17971
17934
|
}
|
|
17972
|
-
return { cards
|
|
17935
|
+
return { cards, chips, sentences, answerLen };
|
|
17973
17936
|
}
|
|
17974
17937
|
function createSseFrameDecoder() {
|
|
17975
17938
|
const textDecoder = new TextDecoder();
|
|
@@ -18110,207 +18073,6 @@ function errorDetailsMessage(details) {
|
|
|
18110
18073
|
}
|
|
18111
18074
|
var CHAT_OWNER_ADMIN = "ADMIN";
|
|
18112
18075
|
|
|
18113
|
-
// src/chat-protocol/wire-narrow.ts
|
|
18114
|
-
function isRecord(value) {
|
|
18115
|
-
return typeof value === "object" && value !== null;
|
|
18116
|
-
}
|
|
18117
|
-
function unwrapEnvelope(payload) {
|
|
18118
|
-
return isRecord(payload) && "data" in payload ? payload.data : payload;
|
|
18119
|
-
}
|
|
18120
|
-
|
|
18121
|
-
// src/chat-protocol/source-metadata.ts
|
|
18122
|
-
var YOUTUBE_ID = /^[A-Za-z0-9_-]{11}$/;
|
|
18123
|
-
var VIDEO_URL_KEYS = ["videoUrl", "highlightVideoUrl", "videoPoster", "highlightVideoPoster"];
|
|
18124
|
-
function text(value) {
|
|
18125
|
-
if (typeof value !== "string") return void 0;
|
|
18126
|
-
const trimmed = value.trim();
|
|
18127
|
-
return trimmed || void 0;
|
|
18128
|
-
}
|
|
18129
|
-
function nullableText(value) {
|
|
18130
|
-
return value === null ? null : text(value);
|
|
18131
|
-
}
|
|
18132
|
-
function httpsUrl(value) {
|
|
18133
|
-
const candidate = text(value);
|
|
18134
|
-
if (!candidate) return void 0;
|
|
18135
|
-
try {
|
|
18136
|
-
return new URL(candidate).protocol === "https:" ? candidate : void 0;
|
|
18137
|
-
} catch (e62) {
|
|
18138
|
-
return void 0;
|
|
18139
|
-
}
|
|
18140
|
-
}
|
|
18141
|
-
function youtubeVideoId(value) {
|
|
18142
|
-
const candidate = text(value);
|
|
18143
|
-
if (!candidate) return void 0;
|
|
18144
|
-
if (YOUTUBE_ID.test(candidate)) return candidate;
|
|
18145
|
-
const url = httpsUrl(candidate);
|
|
18146
|
-
if (!url) return void 0;
|
|
18147
|
-
const parsed = new URL(url);
|
|
18148
|
-
const hostname = parsed.hostname.toLowerCase();
|
|
18149
|
-
const isYoutubeHost = hostname === "youtu.be" || hostname === "youtube.com" || hostname.endsWith(".youtube.com");
|
|
18150
|
-
if (!isYoutubeHost) return void 0;
|
|
18151
|
-
const fromPath = hostname === "youtu.be" ? parsed.pathname.split("/").filter(Boolean)[0] : _optionalChain([/^\/(?:embed|v|shorts)\/([A-Za-z0-9_-]{11})(?:\/|$)/, 'access', _569 => _569.exec, 'call', _570 => _570(parsed.pathname), 'optionalAccess', _571 => _571[1]]);
|
|
18152
|
-
const id = _nullishCoalesce(_nullishCoalesce(fromPath, () => ( parsed.searchParams.get("v"))), () => ( void 0));
|
|
18153
|
-
return id && YOUTUBE_ID.test(id) ? id : void 0;
|
|
18154
|
-
}
|
|
18155
|
-
function sourceItems(value) {
|
|
18156
|
-
if (!Array.isArray(value)) return void 0;
|
|
18157
|
-
const items = value.filter(isRecord).flatMap((item) => {
|
|
18158
|
-
const id = text(item.id);
|
|
18159
|
-
const documentType = text(item.documentType);
|
|
18160
|
-
const name = text(item.name);
|
|
18161
|
-
if (!id || !documentType || !name) return [];
|
|
18162
|
-
const externalUrl = httpsUrl(item.externalUrl);
|
|
18163
|
-
const targetPlatform = nullableText(item.targetPlatform);
|
|
18164
|
-
const path = nullableText(item.path);
|
|
18165
|
-
return [
|
|
18166
|
-
{
|
|
18167
|
-
id,
|
|
18168
|
-
documentType,
|
|
18169
|
-
name,
|
|
18170
|
-
...externalUrl ? { externalUrl } : {},
|
|
18171
|
-
...targetPlatform !== void 0 ? { targetPlatform } : {},
|
|
18172
|
-
...path !== void 0 ? { path } : {}
|
|
18173
|
-
}
|
|
18174
|
-
];
|
|
18175
|
-
});
|
|
18176
|
-
return items.length > 0 ? items : void 0;
|
|
18177
|
-
}
|
|
18178
|
-
function sources(value) {
|
|
18179
|
-
if (!Array.isArray(value)) return [];
|
|
18180
|
-
const claimed = /* @__PURE__ */ new Set();
|
|
18181
|
-
const decoded = [];
|
|
18182
|
-
for (const candidate of value) {
|
|
18183
|
-
if (!isRecord(candidate)) continue;
|
|
18184
|
-
const index = candidate.index;
|
|
18185
|
-
const name = text(candidate.name);
|
|
18186
|
-
const isUsableIndex = typeof index === "number" && Number.isInteger(index) && index > 0 && !claimed.has(index);
|
|
18187
|
-
if (!isUsableIndex || !name) continue;
|
|
18188
|
-
claimed.add(index);
|
|
18189
|
-
const path = text(candidate.path);
|
|
18190
|
-
const documentType = text(candidate.documentType);
|
|
18191
|
-
const externalUrl = httpsUrl(candidate.externalUrl);
|
|
18192
|
-
const targetPlatform = nullableText(candidate.targetPlatform);
|
|
18193
|
-
const id = text(candidate.id);
|
|
18194
|
-
const sourceRepo = text(candidate.sourceRepo);
|
|
18195
|
-
const label = text(candidate.label);
|
|
18196
|
-
const items = sourceItems(candidate.items);
|
|
18197
|
-
decoded.push({
|
|
18198
|
-
index,
|
|
18199
|
-
name,
|
|
18200
|
-
// Both are typed non-optional on `ChatSource` and predate this decoder;
|
|
18201
|
-
// '' is the established "no value" for them across the SSE path.
|
|
18202
|
-
path: _nullishCoalesce(path, () => ( "")),
|
|
18203
|
-
documentType: _nullishCoalesce(documentType, () => ( "")),
|
|
18204
|
-
...externalUrl ? { externalUrl } : {},
|
|
18205
|
-
...targetPlatform !== void 0 ? { targetPlatform } : {},
|
|
18206
|
-
...id ? { id } : {},
|
|
18207
|
-
...sourceRepo ? { sourceRepo } : {},
|
|
18208
|
-
...label ? { label } : {},
|
|
18209
|
-
...items ? { items } : {}
|
|
18210
|
-
});
|
|
18211
|
-
}
|
|
18212
|
-
return decoded;
|
|
18213
|
-
}
|
|
18214
|
-
function videoMetadata(value, url) {
|
|
18215
|
-
const metadata = {};
|
|
18216
|
-
if (isRecord(value)) {
|
|
18217
|
-
for (const key of VIDEO_URL_KEYS) {
|
|
18218
|
-
const validated = httpsUrl(value[key]);
|
|
18219
|
-
if (validated) metadata[key] = validated;
|
|
18220
|
-
}
|
|
18221
|
-
const declaredId = youtubeVideoId(value.youtubeUrl);
|
|
18222
|
-
if (declaredId) metadata.youtubeUrl = declaredId;
|
|
18223
|
-
}
|
|
18224
|
-
if (url) {
|
|
18225
|
-
const idFromUrl = youtubeVideoId(url);
|
|
18226
|
-
if (idFromUrl) {
|
|
18227
|
-
metadata.youtubeUrl = idFromUrl;
|
|
18228
|
-
delete metadata.videoUrl;
|
|
18229
|
-
} else {
|
|
18230
|
-
metadata.videoUrl = url;
|
|
18231
|
-
delete metadata.youtubeUrl;
|
|
18232
|
-
}
|
|
18233
|
-
}
|
|
18234
|
-
return metadata;
|
|
18235
|
-
}
|
|
18236
|
-
function videos(value) {
|
|
18237
|
-
if (!Array.isArray(value)) return [];
|
|
18238
|
-
return value.filter(isRecord).flatMap((video) => {
|
|
18239
|
-
const match = typeof video.ref === "string" ? CARD_REFERENCE.exec(video.ref) : null;
|
|
18240
|
-
if (!match || match[1] !== "video") return [];
|
|
18241
|
-
const id = match[2];
|
|
18242
|
-
const url = _nullishCoalesce(httpsUrl(video.url), () => ( null));
|
|
18243
|
-
const sourceRepo = text(video.sourceRepo);
|
|
18244
|
-
const metadata = videoMetadata(video.metadata, url);
|
|
18245
|
-
return [
|
|
18246
|
-
{
|
|
18247
|
-
type: "video",
|
|
18248
|
-
id,
|
|
18249
|
-
title: _nullishCoalesce(text(video.title), () => ( id)),
|
|
18250
|
-
url,
|
|
18251
|
-
...sourceRepo ? { sourceRepo } : {},
|
|
18252
|
-
...Object.keys(metadata).length > 0 ? { metadata } : {}
|
|
18253
|
-
}
|
|
18254
|
-
];
|
|
18255
|
-
});
|
|
18256
|
-
}
|
|
18257
|
-
function cards(value, decodedSources) {
|
|
18258
|
-
if (!Array.isArray(value)) return [];
|
|
18259
|
-
return value.filter(isRecord).flatMap((card) => {
|
|
18260
|
-
const match = typeof card.ref === "string" ? CARD_REFERENCE.exec(card.ref) : null;
|
|
18261
|
-
if (!match || match[1] === "video") return [];
|
|
18262
|
-
const type = text(card.entityType);
|
|
18263
|
-
const id = text(card.entityId);
|
|
18264
|
-
if (!type || !id || type !== match[1] || id !== match[2]) return [];
|
|
18265
|
-
const source = decodedSources.find((candidate) => candidate.id === id && candidate.documentType === type);
|
|
18266
|
-
return [
|
|
18267
|
-
{
|
|
18268
|
-
type,
|
|
18269
|
-
id,
|
|
18270
|
-
title: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _572 => _572.name]), () => ( id)),
|
|
18271
|
-
url: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _573 => _573.externalUrl]), () => ( null)),
|
|
18272
|
-
..._optionalChain([source, 'optionalAccess', _574 => _574.sourceRepo]) ? { sourceRepo: source.sourceRepo } : {},
|
|
18273
|
-
..._optionalChain([source, 'optionalAccess', _575 => _575.targetPlatform]) !== void 0 ? { targetPlatform: source.targetPlatform } : {},
|
|
18274
|
-
..._optionalChain([source, 'optionalAccess', _576 => _576.path]) ? { metadata: { path: source.path } } : {}
|
|
18275
|
-
}
|
|
18276
|
-
];
|
|
18277
|
-
});
|
|
18278
|
-
}
|
|
18279
|
-
function deduplicateRefs(refs) {
|
|
18280
|
-
const byIdentity = /* @__PURE__ */ new Map();
|
|
18281
|
-
for (const ref of refs) {
|
|
18282
|
-
const identity = `${ref.type}:${ref.id}`;
|
|
18283
|
-
if (!byIdentity.has(identity)) byIdentity.set(identity, ref);
|
|
18284
|
-
}
|
|
18285
|
-
return [...byIdentity.values()];
|
|
18286
|
-
}
|
|
18287
|
-
function sourceMetadataEvent(payload) {
|
|
18288
|
-
if (!isRecord(payload)) return null;
|
|
18289
|
-
const decodedSources = sources(payload.sources);
|
|
18290
|
-
const refs = deduplicateRefs([...videos(payload.videos), ...cards(payload.cards, decodedSources)]);
|
|
18291
|
-
if (decodedSources.length === 0 && refs.length === 0) return null;
|
|
18292
|
-
return {
|
|
18293
|
-
type: "sources",
|
|
18294
|
-
...decodedSources.length > 0 ? { sources: decodedSources } : {},
|
|
18295
|
-
...refs.length > 0 ? { refs } : {}
|
|
18296
|
-
};
|
|
18297
|
-
}
|
|
18298
|
-
function mergeSourceMetadata(previous, event) {
|
|
18299
|
-
const byIndex = /* @__PURE__ */ new Map();
|
|
18300
|
-
for (const source of [..._nullishCoalesce(_optionalChain([previous, 'optionalAccess', _577 => _577.sources]), () => ( [])), ..._nullishCoalesce(event.sources, () => ( []))]) {
|
|
18301
|
-
if (!byIndex.has(source.index)) byIndex.set(source.index, source);
|
|
18302
|
-
}
|
|
18303
|
-
const byIdentity = /* @__PURE__ */ new Map();
|
|
18304
|
-
for (const ref of [..._nullishCoalesce(_optionalChain([previous, 'optionalAccess', _578 => _578.refs]), () => ( [])), ..._nullishCoalesce(event.refs, () => ( []))]) {
|
|
18305
|
-
const identity = `${ref.type}:${ref.id}`;
|
|
18306
|
-
if (!byIdentity.has(identity)) byIdentity.set(identity, ref);
|
|
18307
|
-
}
|
|
18308
|
-
return {
|
|
18309
|
-
...byIndex.size > 0 ? { sources: [...byIndex.values()] } : {},
|
|
18310
|
-
...byIdentity.size > 0 ? { refs: [...byIdentity.values()] } : {}
|
|
18311
|
-
};
|
|
18312
|
-
}
|
|
18313
|
-
|
|
18314
18076
|
// src/components/chat/utils/approval-display.ts
|
|
18315
18077
|
function approvalDisplaysInline(approvalType, displayApprovalTypes) {
|
|
18316
18078
|
return !displayApprovalTypes || displayApprovalTypes.includes(approvalType);
|
|
@@ -18387,9 +18149,9 @@ function appendToTrailingAssistant(prev, segments) {
|
|
|
18387
18149
|
for (const seg of segments) {
|
|
18388
18150
|
const tail = merged[merged.length - 1];
|
|
18389
18151
|
const key = upsertKey(seg);
|
|
18390
|
-
if (seg.type === "text" && _optionalChain([tail, 'optionalAccess',
|
|
18152
|
+
if (seg.type === "text" && _optionalChain([tail, 'optionalAccess', _568 => _568.type]) === "text") {
|
|
18391
18153
|
merged[merged.length - 1] = { type: "text", text: tail.text + seg.text };
|
|
18392
|
-
} else if (seg.type === "thinking" && _optionalChain([tail, 'optionalAccess',
|
|
18154
|
+
} else if (seg.type === "thinking" && _optionalChain([tail, 'optionalAccess', _569 => _569.type]) === "thinking") {
|
|
18393
18155
|
merged[merged.length - 1] = { type: "thinking", text: tail.text + seg.text };
|
|
18394
18156
|
} else if (key) {
|
|
18395
18157
|
let idx = merged.findIndex((m) => upsertKey(m) === key);
|
|
@@ -18430,7 +18192,7 @@ function applyApprovalStatusToSegment(s, requestId, status, resolvedByName) {
|
|
|
18430
18192
|
}
|
|
18431
18193
|
if (s.type !== "approval_batch") return s;
|
|
18432
18194
|
const isAnchor = s.data.approvalRequestId === requestId;
|
|
18433
|
-
const hasRow = _optionalChain([s, 'access',
|
|
18195
|
+
const hasRow = _optionalChain([s, 'access', _570 => _570.data, 'access', _571 => _571.toolCalls, 'optionalAccess', _572 => _572.some, 'call', _573 => _573((c) => c.toolExecutionRequestId === requestId)]);
|
|
18434
18196
|
if (!isAnchor && !hasRow) return s;
|
|
18435
18197
|
const nextResolvedBy = _nullishCoalesce(resolvedByName, () => ( s.resolvedByName));
|
|
18436
18198
|
const nextExecutions = hasRow ? {
|
|
@@ -18452,8 +18214,8 @@ function applyApprovalStatusToSegment(s, requestId, status, resolvedByName) {
|
|
|
18452
18214
|
};
|
|
18453
18215
|
}
|
|
18454
18216
|
function nextBatchExecution(prevExec, toolData) {
|
|
18455
|
-
if (toolData.type === "EXECUTING_TOOL" && _optionalChain([prevExec, 'optionalAccess',
|
|
18456
|
-
return toolData.type === "EXECUTED_TOOL" ? { status: "done", result: toolData.result, success: toolData.success } : { status: "executing", result: _optionalChain([prevExec, 'optionalAccess',
|
|
18217
|
+
if (toolData.type === "EXECUTING_TOOL" && _optionalChain([prevExec, 'optionalAccess', _574 => _574.status]) === "done") return null;
|
|
18218
|
+
return toolData.type === "EXECUTED_TOOL" ? { status: "done", result: toolData.result, success: toolData.success } : { status: "executing", result: _optionalChain([prevExec, 'optionalAccess', _575 => _575.result]), success: _optionalChain([prevExec, 'optionalAccess', _576 => _576.success]) };
|
|
18457
18219
|
}
|
|
18458
18220
|
function withBatchExecution(seg, execId, state) {
|
|
18459
18221
|
return {
|
|
@@ -18470,11 +18232,11 @@ function projectBatchStatusToMessages(prev, anchorId, status) {
|
|
|
18470
18232
|
}
|
|
18471
18233
|
function projectBatchRowFailureToMessages(prev, rowRequestId) {
|
|
18472
18234
|
return mapSegments(prev, (s) => {
|
|
18473
|
-
if (s.type !== "approval_batch" || !_optionalChain([s, 'access',
|
|
18235
|
+
if (s.type !== "approval_batch" || !_optionalChain([s, 'access', _577 => _577.data, 'access', _578 => _578.toolCalls, 'optionalAccess', _579 => _579.some, 'call', _580 => _580((c) => c.toolExecutionRequestId === rowRequestId)])) {
|
|
18474
18236
|
return s;
|
|
18475
18237
|
}
|
|
18476
|
-
const existing = _optionalChain([s, 'access',
|
|
18477
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
18238
|
+
const existing = _optionalChain([s, 'access', _581 => _581.data, 'access', _582 => _582.executions, 'optionalAccess', _583 => _583[rowRequestId]]);
|
|
18239
|
+
if (_optionalChain([existing, 'optionalAccess', _584 => _584.status]) === "done") return s;
|
|
18478
18240
|
return withBatchExecution(s, rowRequestId, { status: "done", success: false });
|
|
18479
18241
|
});
|
|
18480
18242
|
}
|
|
@@ -18510,7 +18272,7 @@ function mergeToolExecutionIfPresent(prev, segment) {
|
|
|
18510
18272
|
for (let j = message.segments.length - 1; j >= 0; j--) {
|
|
18511
18273
|
const seg = message.segments[j];
|
|
18512
18274
|
if (execId && seg.type === "approval_batch" && seg.data.toolCalls.some((c) => c.toolExecutionRequestId === execId)) {
|
|
18513
|
-
const prevExec = _optionalChain([seg, 'access',
|
|
18275
|
+
const prevExec = _optionalChain([seg, 'access', _585 => _585.data, 'access', _586 => _586.executions, 'optionalAccess', _587 => _587[execId]]);
|
|
18514
18276
|
const nextExec = nextBatchExecution(prevExec, toolData);
|
|
18515
18277
|
if (nextExec === null) return prev;
|
|
18516
18278
|
if (sameExecutionState(prevExec, nextExec)) return prev;
|
|
@@ -18612,12 +18374,12 @@ var MessageSegmentAccumulator = class {
|
|
|
18612
18374
|
* Append text to the current message
|
|
18613
18375
|
* If the last segment is text, append to it; otherwise create a new text segment
|
|
18614
18376
|
*/
|
|
18615
|
-
appendText(
|
|
18377
|
+
appendText(text) {
|
|
18616
18378
|
const lastSegment = this.segments[this.segments.length - 1];
|
|
18617
18379
|
if (lastSegment && lastSegment.type === "text") {
|
|
18618
|
-
this.segments[this.segments.length - 1] = { type: "text", text: lastSegment.text +
|
|
18380
|
+
this.segments[this.segments.length - 1] = { type: "text", text: lastSegment.text + text };
|
|
18619
18381
|
} else {
|
|
18620
|
-
this.segments.push({ type: "text", text
|
|
18382
|
+
this.segments.push({ type: "text", text });
|
|
18621
18383
|
}
|
|
18622
18384
|
return this.getSegments();
|
|
18623
18385
|
}
|
|
@@ -18625,12 +18387,12 @@ var MessageSegmentAccumulator = class {
|
|
|
18625
18387
|
* Append thinking text to the current message.
|
|
18626
18388
|
* If the last segment is thinking, append to it; otherwise start a new thinking segment.
|
|
18627
18389
|
*/
|
|
18628
|
-
appendThinking(
|
|
18390
|
+
appendThinking(text) {
|
|
18629
18391
|
const lastSegment = this.segments[this.segments.length - 1];
|
|
18630
18392
|
if (lastSegment && lastSegment.type === "thinking") {
|
|
18631
|
-
this.segments[this.segments.length - 1] = { type: "thinking", text: lastSegment.text +
|
|
18393
|
+
this.segments[this.segments.length - 1] = { type: "thinking", text: lastSegment.text + text };
|
|
18632
18394
|
} else {
|
|
18633
|
-
this.segments.push({ type: "thinking", text
|
|
18395
|
+
this.segments.push({ type: "thinking", text });
|
|
18634
18396
|
}
|
|
18635
18397
|
return this.getSegments();
|
|
18636
18398
|
}
|
|
@@ -18683,9 +18445,9 @@ var MessageSegmentAccumulator = class {
|
|
|
18683
18445
|
type: "tool_execution",
|
|
18684
18446
|
data: {
|
|
18685
18447
|
...toolData,
|
|
18686
|
-
toolTitle: _nullishCoalesce(_nullishCoalesce(toolData.toolTitle, () => ( _optionalChain([existingExecuting, 'optionalAccess',
|
|
18687
|
-
toolExplanation: _nullishCoalesce(_nullishCoalesce(toolData.toolExplanation, () => ( _optionalChain([existingExecuting, 'optionalAccess',
|
|
18688
|
-
parameters: toolData.parameters || _optionalChain([executingTool, 'optionalAccess',
|
|
18448
|
+
toolTitle: _nullishCoalesce(_nullishCoalesce(toolData.toolTitle, () => ( _optionalChain([existingExecuting, 'optionalAccess', _588 => _588.data, 'access', _589 => _589.toolTitle]))), () => ( _optionalChain([executingTool, 'optionalAccess', _590 => _590.toolTitle]))),
|
|
18449
|
+
toolExplanation: _nullishCoalesce(_nullishCoalesce(toolData.toolExplanation, () => ( _optionalChain([existingExecuting, 'optionalAccess', _591 => _591.data, 'access', _592 => _592.toolExplanation]))), () => ( _optionalChain([executingTool, 'optionalAccess', _593 => _593.toolExplanation]))),
|
|
18450
|
+
parameters: toolData.parameters || _optionalChain([executingTool, 'optionalAccess', _594 => _594.parameters])
|
|
18689
18451
|
}
|
|
18690
18452
|
};
|
|
18691
18453
|
if (existingIndex !== -1) {
|
|
@@ -18709,7 +18471,7 @@ var MessageSegmentAccumulator = class {
|
|
|
18709
18471
|
if (seg.type !== "approval_batch") return seg;
|
|
18710
18472
|
const hasCall = seg.data.toolCalls.some((c) => c.toolExecutionRequestId === execId);
|
|
18711
18473
|
if (!hasCall) return seg;
|
|
18712
|
-
const prev = _optionalChain([seg, 'access',
|
|
18474
|
+
const prev = _optionalChain([seg, 'access', _595 => _595.data, 'access', _596 => _596.executions, 'optionalAccess', _597 => _597[execId]]);
|
|
18713
18475
|
const next = nextBatchExecution(prev, toolData);
|
|
18714
18476
|
matched = true;
|
|
18715
18477
|
if (next === null) return seg;
|
|
@@ -18843,8 +18605,8 @@ var MessageSegmentAccumulator = class {
|
|
|
18843
18605
|
requestId,
|
|
18844
18606
|
{
|
|
18845
18607
|
...pendingApproval,
|
|
18846
|
-
command: _optionalChain([pendingApproval, 'optionalAccess',
|
|
18847
|
-
approvalType: _optionalChain([pendingApproval, 'optionalAccess',
|
|
18608
|
+
command: _optionalChain([pendingApproval, 'optionalAccess', _598 => _598.command]) || "",
|
|
18609
|
+
approvalType: _optionalChain([pendingApproval, 'optionalAccess', _599 => _599.approvalType]) || approvalType
|
|
18848
18610
|
},
|
|
18849
18611
|
status
|
|
18850
18612
|
);
|
|
@@ -18860,7 +18622,7 @@ var MessageSegmentAccumulator = class {
|
|
|
18860
18622
|
* `[existing..., new...]` back through `replaySegments`, which would
|
|
18861
18623
|
* otherwise yield two cards for one offer.
|
|
18862
18624
|
*/
|
|
18863
|
-
addEscalationOffer(offerId,
|
|
18625
|
+
addEscalationOffer(offerId, text, origin, status = "pending", resolvedByName) {
|
|
18864
18626
|
const existingIndex = this.segments.findIndex(
|
|
18865
18627
|
(s) => s.type === "escalation_offer" && s.data.offerId === offerId
|
|
18866
18628
|
);
|
|
@@ -18869,9 +18631,9 @@ var MessageSegmentAccumulator = class {
|
|
|
18869
18631
|
type: "escalation_offer",
|
|
18870
18632
|
// The resolved chunk carries no text/origin — a redelivered offer must
|
|
18871
18633
|
// not blank the card the PENDING chunk already painted.
|
|
18872
|
-
data: { offerId, text:
|
|
18634
|
+
data: { offerId, text: text || _optionalChain([existing, 'optionalAccess', _600 => _600.data, 'access', _601 => _601.text]) || "", origin: _nullishCoalesce(origin, () => ( _optionalChain([existing, 'optionalAccess', _602 => _602.data, 'access', _603 => _603.origin]))) },
|
|
18873
18635
|
status,
|
|
18874
|
-
resolvedByName: _nullishCoalesce(resolvedByName, () => ( _optionalChain([existing, 'optionalAccess',
|
|
18636
|
+
resolvedByName: _nullishCoalesce(resolvedByName, () => ( _optionalChain([existing, 'optionalAccess', _604 => _604.resolvedByName]))),
|
|
18875
18637
|
onApprove: this.callbacks.onEscalationApprove,
|
|
18876
18638
|
onReject: this.callbacks.onEscalationReject
|
|
18877
18639
|
};
|
|
@@ -19160,12 +18922,12 @@ function createChatStreamReducer(options = {}) {
|
|
|
19160
18922
|
let lastAppliedSeq = Number.NEGATIVE_INFINITY;
|
|
19161
18923
|
let pendingEchoTexts = [];
|
|
19162
18924
|
let turnStartedAt = 0;
|
|
19163
|
-
function consumeOwnEcho(
|
|
18925
|
+
function consumeOwnEcho(text, authorMatched = false) {
|
|
19164
18926
|
if (pendingEchoTexts.length === 0) return false;
|
|
19165
18927
|
const now = Date.now();
|
|
19166
18928
|
pendingEchoTexts = pendingEchoTexts.filter((e) => now - e.at < OWN_ECHO_AUTHOR_TTL_MS);
|
|
19167
18929
|
const ttl = authorMatched ? OWN_ECHO_AUTHOR_TTL_MS : OWN_ECHO_TTL_MS;
|
|
19168
|
-
const idx = pendingEchoTexts.findIndex((e) => e.text ===
|
|
18930
|
+
const idx = pendingEchoTexts.findIndex((e) => e.text === text && now - e.at < ttl);
|
|
19169
18931
|
if (idx === -1) return false;
|
|
19170
18932
|
pendingEchoTexts.splice(idx, 1);
|
|
19171
18933
|
return true;
|
|
@@ -19196,7 +18958,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19196
18958
|
let stateCache = null;
|
|
19197
18959
|
function invalidate() {
|
|
19198
18960
|
stateCache = null;
|
|
19199
|
-
_optionalChain([onChange, 'optionalCall',
|
|
18961
|
+
_optionalChain([onChange, 'optionalCall', _605 => _605()]);
|
|
19200
18962
|
}
|
|
19201
18963
|
function getState() {
|
|
19202
18964
|
if (!stateCache) {
|
|
@@ -19212,7 +18974,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19212
18974
|
return stateCache;
|
|
19213
18975
|
}
|
|
19214
18976
|
function emit(name, ...args) {
|
|
19215
|
-
_optionalChain([onEffect, 'optionalCall',
|
|
18977
|
+
_optionalChain([onEffect, 'optionalCall', _606 => _606({ name, args })]);
|
|
19216
18978
|
}
|
|
19217
18979
|
function setMessagesInternal(next) {
|
|
19218
18980
|
if (next !== messages) {
|
|
@@ -19242,29 +19004,17 @@ function createChatStreamReducer(options = {}) {
|
|
|
19242
19004
|
if (typeof last.streamSeq === "number" && last.streamSeq >= seq) return next;
|
|
19243
19005
|
return [...next.slice(0, -1), { ...last, streamSeq: seq }];
|
|
19244
19006
|
}
|
|
19245
|
-
let turnSourceMetadata = null;
|
|
19246
|
-
function stampTrailingAssistantSourceMetadata(next) {
|
|
19247
|
-
const metadata = turnSourceMetadata;
|
|
19248
|
-
if (!metadata) return next;
|
|
19249
|
-
const last = next[next.length - 1];
|
|
19250
|
-
if (!last || last.role !== "assistant") return next;
|
|
19251
|
-
if (last.sources === metadata.sources && last.refs === metadata.refs) return next;
|
|
19252
|
-
return [...next.slice(0, -1), { ...last, ...metadata }];
|
|
19253
|
-
}
|
|
19254
|
-
function commitTrailingAssistant(next, seq) {
|
|
19255
|
-
return stampTrailingAssistantSourceMetadata(stampTrailingAssistantSeq(next, seq));
|
|
19256
|
-
}
|
|
19257
19007
|
function applySegmentsToState(segments, meta) {
|
|
19258
|
-
const seq = _optionalChain([meta, 'optionalAccess',
|
|
19259
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
19260
|
-
setMessagesInternal(
|
|
19008
|
+
const seq = _optionalChain([meta, 'optionalAccess', _607 => _607.streamSeq]);
|
|
19009
|
+
if (_optionalChain([meta, 'optionalAccess', _608 => _608.append]) && meta.isCompacting) {
|
|
19010
|
+
setMessagesInternal(stampTrailingAssistantSeq(upsertTrailingCompaction(messages, segments), seq));
|
|
19261
19011
|
return;
|
|
19262
19012
|
}
|
|
19263
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
19264
|
-
setMessagesInternal(
|
|
19013
|
+
if (_optionalChain([meta, 'optionalAccess', _609 => _609.append])) {
|
|
19014
|
+
setMessagesInternal(stampTrailingAssistantSeq(appendToTrailingAssistant(messages, segments), seq));
|
|
19265
19015
|
return;
|
|
19266
19016
|
}
|
|
19267
|
-
setMessagesInternal(
|
|
19017
|
+
setMessagesInternal(stampTrailingAssistantSeq(updateTrailingAssistant(messages, segments), seq));
|
|
19268
19018
|
}
|
|
19269
19019
|
function applyStreamStartToState() {
|
|
19270
19020
|
setPhaseInternal("streaming");
|
|
@@ -19272,13 +19022,13 @@ function createChatStreamReducer(options = {}) {
|
|
|
19272
19022
|
adoptTrailingAssistant = false;
|
|
19273
19023
|
const last = messages[messages.length - 1];
|
|
19274
19024
|
if (!last || last.role !== "assistant" || adoptTail) return;
|
|
19275
|
-
const hasContent = (_nullishCoalesce(_optionalChain([last, 'access',
|
|
19025
|
+
const hasContent = (_nullishCoalesce(_optionalChain([last, 'access', _610 => _610.segments, 'optionalAccess', _611 => _611.length]), () => ( 0))) > 0 || last.content !== "";
|
|
19276
19026
|
if (!hasContent) return;
|
|
19277
19027
|
setMessagesInternal([...messages, { id: nextId("assistant"), role: "assistant", content: "", segments: [] }]);
|
|
19278
19028
|
}
|
|
19279
19029
|
function applyUserMessageToState(ev) {
|
|
19280
|
-
const
|
|
19281
|
-
if (!
|
|
19030
|
+
const text = ev.text;
|
|
19031
|
+
if (!text) return;
|
|
19282
19032
|
const seq = ev.seq;
|
|
19283
19033
|
const adminEchoAllowed = ev.ownerType !== CHAT_OWNER_ADMIN || options.ownEchoIncludesAdmin === true;
|
|
19284
19034
|
const selfUserId = resolveSelfUserId();
|
|
@@ -19286,11 +19036,11 @@ function createChatStreamReducer(options = {}) {
|
|
|
19286
19036
|
if (selfUserId !== void 0 && !authorDeclared) warnIdLessAuthor();
|
|
19287
19037
|
const authorMatched = selfUserId !== void 0 && authorDeclared && ev.userId === selfUserId;
|
|
19288
19038
|
const authorEchoAllowed = selfUserId === void 0 || !authorDeclared || authorMatched;
|
|
19289
|
-
if (adminEchoAllowed && authorEchoAllowed && consumeOwnEcho(
|
|
19039
|
+
if (adminEchoAllowed && authorEchoAllowed && consumeOwnEcho(text, authorMatched)) return;
|
|
19290
19040
|
const authorType = ev.ownerType === CHAT_OWNER_ADMIN ? "admin" : "user";
|
|
19291
19041
|
if (typeof seq !== "number" && hasRecentMessage(
|
|
19292
19042
|
messages,
|
|
19293
|
-
(m) => m.role === "user" && (_nullishCoalesce(m.authorType, () => ( "user"))) === authorType && m.content ===
|
|
19043
|
+
(m) => m.role === "user" && (_nullishCoalesce(m.authorType, () => ( "user"))) === authorType && m.content === text,
|
|
19294
19044
|
CONTENT_DEDUP_WINDOW
|
|
19295
19045
|
)) {
|
|
19296
19046
|
return;
|
|
@@ -19300,7 +19050,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19300
19050
|
{
|
|
19301
19051
|
id: nextId("user"),
|
|
19302
19052
|
role: "user",
|
|
19303
|
-
content:
|
|
19053
|
+
content: text,
|
|
19304
19054
|
// Coverage signal for the history merge — see `streamSeq` on
|
|
19305
19055
|
// `UnifiedChatMessage`. For `user-` rows it is also what tells a
|
|
19306
19056
|
// REPLAYED echo (history already has its row) apart from a genuine new
|
|
@@ -19313,12 +19063,12 @@ function createChatStreamReducer(options = {}) {
|
|
|
19313
19063
|
]);
|
|
19314
19064
|
}
|
|
19315
19065
|
function applyDirectMessageToState(ev) {
|
|
19316
|
-
const
|
|
19317
|
-
if (!
|
|
19066
|
+
const text = ev.text;
|
|
19067
|
+
if (!text) return;
|
|
19318
19068
|
const seq = ev.seq;
|
|
19319
19069
|
if (typeof seq !== "number" && hasRecentMessage(
|
|
19320
19070
|
messages,
|
|
19321
|
-
(m) => m.role === "user" && m.authorType === "admin" && m.content ===
|
|
19071
|
+
(m) => m.role === "user" && m.authorType === "admin" && m.content === text,
|
|
19322
19072
|
CONTENT_DEDUP_WINDOW
|
|
19323
19073
|
)) {
|
|
19324
19074
|
return;
|
|
@@ -19328,7 +19078,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19328
19078
|
{
|
|
19329
19079
|
id: `direct-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
|
19330
19080
|
role: "user",
|
|
19331
|
-
content:
|
|
19081
|
+
content: text,
|
|
19332
19082
|
...typeof seq === "number" ? { streamSeq: seq } : {},
|
|
19333
19083
|
name: _nullishCoalesce(ev.displayName, () => ( "Admin")),
|
|
19334
19084
|
authorType: "admin"
|
|
@@ -19336,10 +19086,10 @@ function createChatStreamReducer(options = {}) {
|
|
|
19336
19086
|
]);
|
|
19337
19087
|
}
|
|
19338
19088
|
function applySystemMessageToState(ev) {
|
|
19339
|
-
const
|
|
19340
|
-
if (!
|
|
19089
|
+
const text = ev.text;
|
|
19090
|
+
if (!text) return;
|
|
19341
19091
|
const seq = ev.seq;
|
|
19342
|
-
if (typeof seq !== "number" && hasRecentMessage(messages, (m) => m.authorType === "system" && m.name ===
|
|
19092
|
+
if (typeof seq !== "number" && hasRecentMessage(messages, (m) => m.authorType === "system" && m.name === text, SYSTEM_DEDUP_WINDOW)) {
|
|
19343
19093
|
return;
|
|
19344
19094
|
}
|
|
19345
19095
|
setMessagesInternal([
|
|
@@ -19349,7 +19099,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19349
19099
|
role: "user",
|
|
19350
19100
|
content: "",
|
|
19351
19101
|
...typeof seq === "number" ? { streamSeq: seq } : {},
|
|
19352
|
-
name:
|
|
19102
|
+
name: text,
|
|
19353
19103
|
authorType: "system"
|
|
19354
19104
|
}
|
|
19355
19105
|
]);
|
|
@@ -19387,7 +19137,6 @@ function createChatStreamReducer(options = {}) {
|
|
|
19387
19137
|
isInStream = true;
|
|
19388
19138
|
hasEverStreamed = true;
|
|
19389
19139
|
turnStartedAt = Date.now();
|
|
19390
|
-
turnSourceMetadata = null;
|
|
19391
19140
|
emit("onStreamStart");
|
|
19392
19141
|
applyStreamStartToState();
|
|
19393
19142
|
accumulator.resetSegments();
|
|
@@ -19401,14 +19150,6 @@ function createChatStreamReducer(options = {}) {
|
|
|
19401
19150
|
accumulator.resetSegments();
|
|
19402
19151
|
break;
|
|
19403
19152
|
}
|
|
19404
|
-
// Per-answer source metadata. Applied to the trailing assistant bubble
|
|
19405
|
-
// immediately when there is one, and held for the next write when the
|
|
19406
|
-
// chunk beat the answer text to the reducer.
|
|
19407
|
-
case "sources": {
|
|
19408
|
-
turnSourceMetadata = mergeSourceMetadata(turnSourceMetadata, event);
|
|
19409
|
-
setMessagesInternal(stampTrailingAssistantSourceMetadata(messages));
|
|
19410
|
-
break;
|
|
19411
|
-
}
|
|
19412
19153
|
case "metadata": {
|
|
19413
19154
|
emit("onMetadata", {
|
|
19414
19155
|
action: "metadata",
|
|
@@ -19491,13 +19232,13 @@ function createChatStreamReducer(options = {}) {
|
|
|
19491
19232
|
const summary = required ? getCommandText(required) : `Batch of ${toolCalls.length} tool calls`;
|
|
19492
19233
|
pendingEscalated.set(requestId, {
|
|
19493
19234
|
command: summary,
|
|
19494
|
-
explanation: _optionalChain([required, 'optionalAccess',
|
|
19235
|
+
explanation: _optionalChain([required, 'optionalAccess', _612 => _612.toolExplanation]),
|
|
19495
19236
|
approvalType,
|
|
19496
19237
|
toolCalls
|
|
19497
19238
|
});
|
|
19498
19239
|
emit("onEscalatedApproval", requestId, {
|
|
19499
19240
|
command: summary,
|
|
19500
|
-
explanation: _optionalChain([required, 'optionalAccess',
|
|
19241
|
+
explanation: _optionalChain([required, 'optionalAccess', _613 => _613.toolExplanation]),
|
|
19501
19242
|
approvalType
|
|
19502
19243
|
});
|
|
19503
19244
|
break;
|
|
@@ -19730,20 +19471,20 @@ function createChatStreamReducer(options = {}) {
|
|
|
19730
19471
|
break;
|
|
19731
19472
|
}
|
|
19732
19473
|
}
|
|
19733
|
-
function sseWriteTrailingText(
|
|
19474
|
+
function sseWriteTrailingText(text) {
|
|
19734
19475
|
const last = messages[messages.length - 1];
|
|
19735
19476
|
if (!last || last.role !== "assistant") return;
|
|
19736
19477
|
const segments = [..._nullishCoalesce(last.segments, () => ( []))];
|
|
19737
19478
|
const tail = segments[segments.length - 1];
|
|
19738
19479
|
if (tail && tail.type === "text") {
|
|
19739
|
-
segments[segments.length - 1] = { type: "text", text
|
|
19480
|
+
segments[segments.length - 1] = { type: "text", text };
|
|
19740
19481
|
} else {
|
|
19741
|
-
segments.push({ type: "text", text
|
|
19482
|
+
segments.push({ type: "text", text });
|
|
19742
19483
|
}
|
|
19743
19484
|
setMessagesInternal([...messages.slice(0, -1), { ...last, segments }]);
|
|
19744
19485
|
}
|
|
19745
|
-
function sseAppendText(
|
|
19746
|
-
sseCurrentText +=
|
|
19486
|
+
function sseAppendText(text) {
|
|
19487
|
+
sseCurrentText += text;
|
|
19747
19488
|
sseWriteTrailingText(sseCurrentText);
|
|
19748
19489
|
}
|
|
19749
19490
|
function sseAppendThinking(escapedDelta) {
|
|
@@ -19881,7 +19622,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
19881
19622
|
const resolveBatch = (status, confirm) => async () => {
|
|
19882
19623
|
setMessagesInternal(projectBatchStatusToMessages(messages, anchorId, status));
|
|
19883
19624
|
for (const id of ids) {
|
|
19884
|
-
const ok = await _optionalChain([confirm, 'optionalCall',
|
|
19625
|
+
const ok = await _optionalChain([confirm, 'optionalCall', _614 => _614(id)]);
|
|
19885
19626
|
if (ok === false) {
|
|
19886
19627
|
setMessagesInternal(projectBatchRowFailureToMessages(messages, id));
|
|
19887
19628
|
}
|
|
@@ -20017,8 +19758,8 @@ function createChatStreamReducer(options = {}) {
|
|
|
20017
19758
|
}
|
|
20018
19759
|
}
|
|
20019
19760
|
}
|
|
20020
|
-
hasEverStreamed = hasEverStreamed || (_nullishCoalesce(_optionalChain([extras, 'optionalAccess',
|
|
20021
|
-
if (_optionalChain([extras, 'optionalAccess',
|
|
19761
|
+
hasEverStreamed = hasEverStreamed || (_nullishCoalesce(_optionalChain([extras, 'optionalAccess', _615 => _615.resumed]), () => ( messages.length > 0)));
|
|
19762
|
+
if (_optionalChain([extras, 'optionalAccess', _616 => _616.agentBusy])) agentBusyState();
|
|
20022
19763
|
invalidate();
|
|
20023
19764
|
}
|
|
20024
19765
|
return {
|
|
@@ -20036,19 +19777,19 @@ function createChatStreamReducer(options = {}) {
|
|
|
20036
19777
|
messages = [...older, ...messages];
|
|
20037
19778
|
invalidate();
|
|
20038
19779
|
},
|
|
20039
|
-
pushOptimisticSend(
|
|
20040
|
-
pendingEchoTexts.push({ text
|
|
19780
|
+
pushOptimisticSend(text, hidden = false) {
|
|
19781
|
+
pendingEchoTexts.push({ text, at: Date.now() });
|
|
20041
19782
|
if (pendingEchoTexts.length > MAX_PENDING_ECHOES) pendingEchoTexts.shift();
|
|
20042
19783
|
messages = [
|
|
20043
19784
|
...messages,
|
|
20044
19785
|
// An EMPTY-text send is out-of-band metadata (an approval decision),
|
|
20045
19786
|
// not something the user said — see `beginSseSend` for the full
|
|
20046
19787
|
// rationale. Never materialize a row for it.
|
|
20047
|
-
...
|
|
19788
|
+
...text.length > 0 ? [
|
|
20048
19789
|
{
|
|
20049
19790
|
id: nextId("user"),
|
|
20050
19791
|
role: "user",
|
|
20051
|
-
content:
|
|
19792
|
+
content: text,
|
|
20052
19793
|
...hidden ? { hidden: true } : {}
|
|
20053
19794
|
}
|
|
20054
19795
|
] : [],
|
|
@@ -20064,7 +19805,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
20064
19805
|
invalidate();
|
|
20065
19806
|
},
|
|
20066
19807
|
resetForDialogSwitch,
|
|
20067
|
-
beginSseSend({ text
|
|
19808
|
+
beginSseSend({ text, hidden, userName = "You", assistantName, assistantAvatar }) {
|
|
20068
19809
|
const now = Date.now();
|
|
20069
19810
|
messages = [
|
|
20070
19811
|
...messages,
|
|
@@ -20076,12 +19817,12 @@ function createChatStreamReducer(options = {}) {
|
|
|
20076
19817
|
// label with no body). So we never mint it. Hidden sends that DO carry
|
|
20077
19818
|
// text (e.g. an auto-continuation directive) still become real state:
|
|
20078
19819
|
// the LLM must see them, `Message.hidden` keeps them off screen.
|
|
20079
|
-
...
|
|
19820
|
+
...text.length > 0 ? [
|
|
20080
19821
|
{
|
|
20081
19822
|
id: `user-${now}`,
|
|
20082
19823
|
role: "user",
|
|
20083
19824
|
name: userName,
|
|
20084
|
-
content:
|
|
19825
|
+
content: text,
|
|
20085
19826
|
timestamp: new Date(now),
|
|
20086
19827
|
...hidden ? { hidden: true } : {}
|
|
20087
19828
|
}
|
|
@@ -20103,7 +19844,7 @@ function createChatStreamReducer(options = {}) {
|
|
|
20103
19844
|
},
|
|
20104
19845
|
endSseTurn() {
|
|
20105
19846
|
const last = messages[messages.length - 1];
|
|
20106
|
-
if (last && last.role === "assistant" && (_nullishCoalesce(_optionalChain([last, 'access',
|
|
19847
|
+
if (last && last.role === "assistant" && (_nullishCoalesce(_optionalChain([last, 'access', _617 => _617.segments, 'optionalAccess', _618 => _618.length]), () => ( 0))) === 0 && last.content === "") {
|
|
20107
19848
|
messages = messages.slice(0, -1);
|
|
20108
19849
|
}
|
|
20109
19850
|
sseCurrentText = "";
|
|
@@ -20124,8 +19865,8 @@ function createChatStreamReducer(options = {}) {
|
|
|
20124
19865
|
streamingPhase = "idle";
|
|
20125
19866
|
invalidate();
|
|
20126
19867
|
},
|
|
20127
|
-
seedSseMaps({ sources
|
|
20128
|
-
if (
|
|
19868
|
+
seedSseMaps({ sources, sendCount: seedSendCount }) {
|
|
19869
|
+
if (sources) for (const [k, v] of sources) sourcesMap.set(k, v);
|
|
20129
19870
|
if (typeof seedSendCount === "number") sendCount = seedSendCount;
|
|
20130
19871
|
invalidate();
|
|
20131
19872
|
},
|
|
@@ -20256,10 +19997,10 @@ function createChatDialogStore(options = {}) {
|
|
|
20256
19997
|
if (onEvict) {
|
|
20257
19998
|
const sep = key.indexOf(KEY_SEP);
|
|
20258
19999
|
onEvict(key.slice(0, sep), key.slice(sep + 1), {
|
|
20259
|
-
messages: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess',
|
|
20260
|
-
approvalStatuses: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess',
|
|
20261
|
-
lastAppliedSeq: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess',
|
|
20262
|
-
pendingEchoes: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess',
|
|
20000
|
+
messages: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _619 => _619.state, 'access', _620 => _620.messages]), () => ( EMPTY_STATE.messages)),
|
|
20001
|
+
approvalStatuses: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _621 => _621.state, 'access', _622 => _622.approvalStatuses]), () => ( EMPTY_STATE.approvalStatuses)),
|
|
20002
|
+
lastAppliedSeq: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _623 => _623.getLastAppliedSeq, 'call', _624 => _624()]), () => ( Number.NEGATIVE_INFINITY)),
|
|
20003
|
+
pendingEchoes: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _625 => _625.getPendingEchoes, 'call', _626 => _626()]), () => ( EMPTY_PENDING_ECHOES))
|
|
20263
20004
|
});
|
|
20264
20005
|
}
|
|
20265
20006
|
}
|
|
@@ -20269,12 +20010,12 @@ function createChatDialogStore(options = {}) {
|
|
|
20269
20010
|
const key = keyOf(dialogId, side);
|
|
20270
20011
|
let reducer = reducers.get(key);
|
|
20271
20012
|
if (!reducer) {
|
|
20272
|
-
const base = _nullishCoalesce(_optionalChain([(_nullishCoalesce(createOptions, () => ( defaultCreateOptions))), 'optionalCall',
|
|
20013
|
+
const base = _nullishCoalesce(_optionalChain([(_nullishCoalesce(createOptions, () => ( defaultCreateOptions))), 'optionalCall', _627 => _627(dialogId, side)]), () => ( {}));
|
|
20273
20014
|
const userOnChange = base.onChange;
|
|
20274
20015
|
reducer = createChatStreamReducer({
|
|
20275
20016
|
...base,
|
|
20276
20017
|
onChange: () => {
|
|
20277
|
-
_optionalChain([userOnChange, 'optionalCall',
|
|
20018
|
+
_optionalChain([userOnChange, 'optionalCall', _628 => _628()]);
|
|
20278
20019
|
notify();
|
|
20279
20020
|
}
|
|
20280
20021
|
});
|
|
@@ -20319,7 +20060,7 @@ function createChatDialogStore(options = {}) {
|
|
|
20319
20060
|
};
|
|
20320
20061
|
}
|
|
20321
20062
|
function getSnapshot2(dialogId, side = DEFAULT_DIALOG_SIDE) {
|
|
20322
|
-
return _nullishCoalesce(_optionalChain([reducers, 'access',
|
|
20063
|
+
return _nullishCoalesce(_optionalChain([reducers, 'access', _629 => _629.get, 'call', _630 => _630(keyOf(dialogId, side)), 'optionalAccess', _631 => _631.state]), () => ( EMPTY_STATE));
|
|
20323
20064
|
}
|
|
20324
20065
|
function getServerSnapshot2() {
|
|
20325
20066
|
return EMPTY_STATE;
|
|
@@ -20411,7 +20152,7 @@ function createDeltaBatcher({
|
|
|
20411
20152
|
pending = [];
|
|
20412
20153
|
const key = pendingKey;
|
|
20413
20154
|
for (const delta of batch) applyOne(delta, key);
|
|
20414
|
-
_optionalChain([onFlushed, 'optionalCall',
|
|
20155
|
+
_optionalChain([onFlushed, 'optionalCall', _632 => _632(batch.length)]);
|
|
20415
20156
|
}
|
|
20416
20157
|
function schedule() {
|
|
20417
20158
|
if (raf !== null || timer !== null) return;
|
|
@@ -20435,7 +20176,7 @@ function createDeltaBatcher({
|
|
|
20435
20176
|
}
|
|
20436
20177
|
if (!isDeltaEvent(event)) return false;
|
|
20437
20178
|
const tail = pending[pending.length - 1];
|
|
20438
|
-
const seqAdvances = _optionalChain([tail, 'optionalAccess',
|
|
20179
|
+
const seqAdvances = _optionalChain([tail, 'optionalAccess', _633 => _633.seq]) == null ? event.seq == null : event.seq != null && event.seq > tail.seq;
|
|
20439
20180
|
if (tail && seqAdvances && tail.type === event.type && (tail.type !== "text-delta" || tail.leading === event.leading)) {
|
|
20440
20181
|
pending[pending.length - 1] = {
|
|
20441
20182
|
...tail,
|
|
@@ -20466,7 +20207,7 @@ function useChatStreamReducer({
|
|
|
20466
20207
|
side = DEFAULT_DIALOG_SIDE,
|
|
20467
20208
|
createReducerOptions
|
|
20468
20209
|
}) {
|
|
20469
|
-
const reducer = store.getReducer(dialogId, side, () => _nullishCoalesce(_optionalChain([createReducerOptions, 'optionalCall',
|
|
20210
|
+
const reducer = store.getReducer(dialogId, side, () => _nullishCoalesce(_optionalChain([createReducerOptions, 'optionalCall', _634 => _634()]), () => ( {})));
|
|
20470
20211
|
const getSnapshot2 = _react.useCallback.call(void 0, () => store.getSnapshot(dialogId, side), [store, dialogId, side]);
|
|
20471
20212
|
const getServerSnapshot2 = _react.useCallback.call(void 0, () => store.getServerSnapshot(), [store]);
|
|
20472
20213
|
const subscribe2 = _react.useCallback.call(void 0, (listener) => store.subscribe(listener), [store]);
|
|
@@ -20505,7 +20246,7 @@ var STORAGE_KEY = "conversation";
|
|
|
20505
20246
|
var namespaceFor = (source) => {
|
|
20506
20247
|
const base = `mingo-chat-${source}`;
|
|
20507
20248
|
const auth = _chunkEHAYNUOLcjs.getEmbedProxyAuth.call(void 0, );
|
|
20508
|
-
return _optionalChain([auth, 'optionalAccess',
|
|
20249
|
+
return _optionalChain([auth, 'optionalAccess', _635 => _635.email]) ? `${base}-u-${encodeURIComponent(auth.email.toLowerCase())}` : base;
|
|
20509
20250
|
};
|
|
20510
20251
|
function createChatConversationStorage(source) {
|
|
20511
20252
|
return _chunkEHAYNUOLcjs.createLocalStorageAdapter.call(void 0, {
|
|
@@ -20533,10 +20274,18 @@ function pruneStaleChatConversationStorage(source) {
|
|
|
20533
20274
|
for (const k of toRemove) {
|
|
20534
20275
|
window.localStorage.removeItem(k);
|
|
20535
20276
|
}
|
|
20536
|
-
} catch (
|
|
20277
|
+
} catch (e62) {
|
|
20537
20278
|
}
|
|
20538
20279
|
}
|
|
20539
20280
|
|
|
20281
|
+
// src/chat-protocol/wire-narrow.ts
|
|
20282
|
+
function isRecord(value) {
|
|
20283
|
+
return typeof value === "object" && value !== null;
|
|
20284
|
+
}
|
|
20285
|
+
function unwrapEnvelope(payload) {
|
|
20286
|
+
return isRecord(payload) && "data" in payload ? payload.data : payload;
|
|
20287
|
+
}
|
|
20288
|
+
|
|
20540
20289
|
// src/components/chat/utils/chat-conversations-api.ts
|
|
20541
20290
|
function toDialogItem(row) {
|
|
20542
20291
|
if (!isRecord(row)) return null;
|
|
@@ -20617,7 +20366,7 @@ function formatSingularLookupInvocation(cmdId, value) {
|
|
|
20617
20366
|
return safe ? `/${cmdId} "${safe}"` : `/${cmdId}`;
|
|
20618
20367
|
}
|
|
20619
20368
|
function extractEntityIdFilter(override, expectedTableId) {
|
|
20620
|
-
const f = _optionalChain([override, 'optionalAccess',
|
|
20369
|
+
const f = _optionalChain([override, 'optionalAccess', _636 => _636.entityIdFilter]);
|
|
20621
20370
|
if (!f) return null;
|
|
20622
20371
|
const tableId = typeof f.tableId === "string" ? f.tableId : "";
|
|
20623
20372
|
const id = typeof f.id === "string" ? f.id : "";
|
|
@@ -20656,7 +20405,7 @@ var AUTO_CONTINUATION_DIRECTIVE_PREFIX = "[internal-auto-continuation]";
|
|
|
20656
20405
|
function buildAutoContinuationDirective(toolName, opts = {}) {
|
|
20657
20406
|
const ticketRef = opts.ticketId ? ` (ticket #${opts.ticketId})` : "";
|
|
20658
20407
|
const ticketHash = opts.ticketId ? ` #${opts.ticketId}` : "";
|
|
20659
|
-
const isClose = toolName === "update_ticket" && _optionalChain([opts, 'access',
|
|
20408
|
+
const isClose = toolName === "update_ticket" && _optionalChain([opts, 'access', _637 => _637.status, 'optionalAccess', _638 => _638.toUpperCase, 'call', _639 => _639()]) === "CLOSED";
|
|
20660
20409
|
if (toolName === "create_ticket") {
|
|
20661
20410
|
return `${AUTO_CONTINUATION_DIRECTIVE_PREFIX} The user just approved create_ticket${ticketRef}. Per ticket-protocol \xA71a, ask 2-4 SHORT, issue-specific diagnostic follow-up questions tailored to the symptom they reported in their original message. When they answer, propose an update_ticket with content_addendum carrying a clean Q&A digest. Do NOT call any tool in this turn \u2014 just write the questions as prose.`;
|
|
20662
20411
|
}
|
|
@@ -20706,7 +20455,7 @@ function useChatHistoryHydration({
|
|
|
20706
20455
|
if (cancelled) return;
|
|
20707
20456
|
if (rows.length === 0) {
|
|
20708
20457
|
const found = isRecord(body) ? body.found : void 0;
|
|
20709
|
-
if (found === false) _optionalChain([onOrphanedConversation, 'optionalCall',
|
|
20458
|
+
if (found === false) _optionalChain([onOrphanedConversation, 'optionalCall', _640 => _640(conversationId)]);
|
|
20710
20459
|
return;
|
|
20711
20460
|
}
|
|
20712
20461
|
const hydrated = [];
|
|
@@ -20735,7 +20484,7 @@ function useChatHistoryHydration({
|
|
|
20735
20484
|
sendCountRef.current = userTurns;
|
|
20736
20485
|
hydrateMessages(hydrated, Array.from(sourcesSeed.entries()));
|
|
20737
20486
|
bumpMetaTick();
|
|
20738
|
-
} catch (
|
|
20487
|
+
} catch (e63) {
|
|
20739
20488
|
if (isCurrentRun() && hydratedKeyRef.current === key) hydratedKeyRef.current = null;
|
|
20740
20489
|
} finally {
|
|
20741
20490
|
completed = true;
|
|
@@ -20850,7 +20599,7 @@ function useManagedDialogList({
|
|
|
20850
20599
|
try {
|
|
20851
20600
|
await deleteDialogCallback(id);
|
|
20852
20601
|
removeLocal(id);
|
|
20853
|
-
_optionalChain([onDialogRemovedRef, 'access',
|
|
20602
|
+
_optionalChain([onDialogRemovedRef, 'access', _641 => _641.current, 'optionalCall', _642 => _642(id, "deleted")]);
|
|
20854
20603
|
} catch (err) {
|
|
20855
20604
|
console.error(`${logTag} deleteDialog failed:`, err);
|
|
20856
20605
|
throw err;
|
|
@@ -20861,7 +20610,7 @@ function useManagedDialogList({
|
|
|
20861
20610
|
const renameDialog = _react.useCallback.call(void 0,
|
|
20862
20611
|
async (id, title) => {
|
|
20863
20612
|
if (!renameDialogCallback) return;
|
|
20864
|
-
const previous = _optionalChain([dialogsRef, 'access',
|
|
20613
|
+
const previous = _optionalChain([dialogsRef, 'access', _643 => _643.current, 'access', _644 => _644.find, 'call', _645 => _645((d) => d.id === id), 'optionalAccess', _646 => _646.title]);
|
|
20865
20614
|
setDialogs((prev) => prev.map((d) => d.id === id ? { ...d, title } : d));
|
|
20866
20615
|
try {
|
|
20867
20616
|
await renameDialogCallback(id, title);
|
|
@@ -20880,7 +20629,7 @@ function useManagedDialogList({
|
|
|
20880
20629
|
try {
|
|
20881
20630
|
await archiveDialogCallback(id);
|
|
20882
20631
|
removeLocal(id);
|
|
20883
|
-
_optionalChain([onDialogRemovedRef, 'access',
|
|
20632
|
+
_optionalChain([onDialogRemovedRef, 'access', _647 => _647.current, 'optionalCall', _648 => _648(id, "archived")]);
|
|
20884
20633
|
} catch (err) {
|
|
20885
20634
|
console.error(`${logTag} archiveDialog failed:`, err);
|
|
20886
20635
|
throw err;
|
|
@@ -20972,7 +20721,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
20972
20721
|
const { active = true } = runtimeOptions;
|
|
20973
20722
|
const runtime = _chunkUPKZU6QUcjs.useRequiredChatRuntime.call(void 0, );
|
|
20974
20723
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
20975
|
-
const tableIdForDocumentType = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
20724
|
+
const tableIdForDocumentType = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _649 => _649.tableIdForDocumentType]), () => ( defaultTableIdForDocumentType));
|
|
20976
20725
|
const sendMessageRef = _react.useRef.call(void 0,
|
|
20977
20726
|
() => Promise.resolve(true)
|
|
20978
20727
|
);
|
|
@@ -21008,7 +20757,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21008
20757
|
if (!restoredConversationRef.current) {
|
|
21009
20758
|
restoredConversationRef.current = true;
|
|
21010
20759
|
pruneStaleChatConversationStorage(source);
|
|
21011
|
-
conversationIdRef.current = _nullishCoalesce(_optionalChain([conversationStorage, 'access',
|
|
20760
|
+
conversationIdRef.current = _nullishCoalesce(_optionalChain([conversationStorage, 'access', _650 => _650.load, 'call', _651 => _651(), 'optionalAccess', _652 => _652.conversationId]), () => ( null));
|
|
21012
20761
|
}
|
|
21013
20762
|
const [conversationId, setConversationId] = _react.useState.call(void 0, () => conversationIdRef.current);
|
|
21014
20763
|
const commitConversationId = _react.useCallback.call(void 0,
|
|
@@ -21099,7 +20848,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21099
20848
|
const abortControllerRef = _react.useRef.call(void 0, null);
|
|
21100
20849
|
const switchConversation = _react.useCallback.call(void 0,
|
|
21101
20850
|
(id) => {
|
|
21102
|
-
_optionalChain([abortControllerRef, 'access',
|
|
20851
|
+
_optionalChain([abortControllerRef, 'access', _653 => _653.current, 'optionalAccess', _654 => _654.abort, 'call', _655 => _655()]);
|
|
21103
20852
|
flushDeltas();
|
|
21104
20853
|
mutate((r) => r.reset());
|
|
21105
20854
|
hydrationSendCountRef.current = 0;
|
|
@@ -21136,8 +20885,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21136
20885
|
} = useManagedDialogList({
|
|
21137
20886
|
autoLoad: active,
|
|
21138
20887
|
fetchDialogs: fetchActiveDialogs,
|
|
21139
|
-
renameDialog: _optionalChain([conversationsApi, 'optionalAccess',
|
|
21140
|
-
archiveDialog: _optionalChain([conversationsApi, 'optionalAccess',
|
|
20888
|
+
renameDialog: _optionalChain([conversationsApi, 'optionalAccess', _656 => _656.renameDialog]),
|
|
20889
|
+
archiveDialog: _optionalChain([conversationsApi, 'optionalAccess', _657 => _657.archiveDialog]),
|
|
21141
20890
|
pageSize: 20,
|
|
21142
20891
|
search: conversationsApi ? dialogSearch : void 0,
|
|
21143
20892
|
logTag: "[useSseChatAdapter]",
|
|
@@ -21171,7 +20920,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21171
20920
|
const sendMessage = _react.useCallback.call(void 0,
|
|
21172
20921
|
// Resolves `true` on a clean turn, `false` when the request failed
|
|
21173
20922
|
// (surfaced to batch approve-all loops via the card callbacks).
|
|
21174
|
-
async (
|
|
20923
|
+
async (text, sendOptions) => {
|
|
21175
20924
|
const { hidden, attachments, commandOverride, approvalAction } = _nullishCoalesce(sendOptions, () => ( {}));
|
|
21176
20925
|
const echoedConversationId = conversationIdRef.current;
|
|
21177
20926
|
const targetPath = approvalAction ? endpointsRef.current.approvalToolUrl : endpointsRef.current.chatStreamUrl;
|
|
@@ -21182,12 +20931,12 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21182
20931
|
// established conversation (the proposal turn captured the id).
|
|
21183
20932
|
buildConfirmToolBody({ ...approvalAction, conversationId: echoedConversationId })
|
|
21184
20933
|
) : {
|
|
21185
|
-
messages: [{ role: "user", content:
|
|
20934
|
+
messages: [{ role: "user", content: text }],
|
|
21186
20935
|
...commandOverride ? { commandOverride } : {},
|
|
21187
20936
|
...attachments && attachments.length > 0 ? { pendingAttachments: attachments } : {},
|
|
21188
20937
|
...echoedConversationId ? { conversationId: echoedConversationId } : {}
|
|
21189
20938
|
};
|
|
21190
|
-
mutate((r) => r.beginSseSend({ text
|
|
20939
|
+
mutate((r) => r.beginSseSend({ text, hidden, userName: "You", assistantName: "Mingo AI" }));
|
|
21191
20940
|
const ctrl = new AbortController();
|
|
21192
20941
|
abortControllerRef.current = ctrl;
|
|
21193
20942
|
let mintedThisTurn = false;
|
|
@@ -21201,7 +20950,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21201
20950
|
const serverMessage = await readServerErrorMessage(response);
|
|
21202
20951
|
throw new Error(_nullishCoalesce(serverMessage, () => ( `Chat request failed: ${response.status}`)));
|
|
21203
20952
|
}
|
|
21204
|
-
const reader = _optionalChain([response, 'access',
|
|
20953
|
+
const reader = _optionalChain([response, 'access', _658 => _658.body, 'optionalAccess', _659 => _659.getReader, 'call', _660 => _660()]);
|
|
21205
20954
|
if (!reader) throw new Error("No response body");
|
|
21206
20955
|
const frameDecoder = createSseFrameDecoder();
|
|
21207
20956
|
let finished = false;
|
|
@@ -21230,7 +20979,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21230
20979
|
}
|
|
21231
20980
|
return true;
|
|
21232
20981
|
} catch (err) {
|
|
21233
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
20982
|
+
if (_optionalChain([err, 'optionalAccess', _661 => _661.name]) === "AbortError" || ctrl.signal.aborted) {
|
|
21234
20983
|
return true;
|
|
21235
20984
|
}
|
|
21236
20985
|
flushDeltas();
|
|
@@ -21266,7 +21015,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21266
21015
|
);
|
|
21267
21016
|
sendMessageRef.current = sendMessage;
|
|
21268
21017
|
const stopMessage = _react.useCallback.call(void 0, () => {
|
|
21269
|
-
_optionalChain([abortControllerRef, 'access',
|
|
21018
|
+
_optionalChain([abortControllerRef, 'access', _662 => _662.current, 'optionalAccess', _663 => _663.abort, 'call', _664 => _664()]);
|
|
21270
21019
|
flushDeltas();
|
|
21271
21020
|
mutate((r) => r.setPhase("idle"));
|
|
21272
21021
|
}, [mutate, flushDeltas]);
|
|
@@ -21302,23 +21051,23 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21302
21051
|
let sendIdx = -1;
|
|
21303
21052
|
return state.messages.map((m) => {
|
|
21304
21053
|
const segments = m.segments;
|
|
21305
|
-
const content = typeof m.content === "string" && !segments ? m.content : _nullishCoalesce(_optionalChain([segments, 'optionalAccess',
|
|
21306
|
-
let
|
|
21054
|
+
const content = typeof m.content === "string" && !segments ? m.content : _nullishCoalesce(_optionalChain([segments, 'optionalAccess', _665 => _665.filter, 'call', _666 => _666((s) => s.type === "text"), 'access', _667 => _667.map, 'call', _668 => _668((s) => s.text), 'access', _669 => _669.join, 'call', _670 => _670("")]), () => ( ""));
|
|
21055
|
+
let sources;
|
|
21307
21056
|
let scrollAnchor;
|
|
21308
21057
|
if (m.role === "user" && !m.hidden) {
|
|
21309
21058
|
sendIdx++;
|
|
21310
21059
|
}
|
|
21311
21060
|
if (m.role === "assistant") {
|
|
21312
21061
|
const lookupIdx = sendIdx >= 0 ? sendIdx : 0;
|
|
21313
|
-
|
|
21314
|
-
scrollAnchor = _nullishCoalesce(_optionalChain([meta, 'access',
|
|
21062
|
+
sources = sourcesMap.get(lookupIdx);
|
|
21063
|
+
scrollAnchor = _nullishCoalesce(_optionalChain([meta, 'access', _671 => _671.get, 'call', _672 => _672(lookupIdx), 'optionalAccess', _673 => _673.scrollAnchor]), () => ( void 0));
|
|
21315
21064
|
}
|
|
21316
21065
|
return {
|
|
21317
21066
|
id: m.id,
|
|
21318
21067
|
role: m.role,
|
|
21319
21068
|
content,
|
|
21320
21069
|
...segments ? { segments } : {},
|
|
21321
|
-
...
|
|
21070
|
+
...sources ? { sources } : {},
|
|
21322
21071
|
...scrollAnchor ? { scrollAnchor } : {},
|
|
21323
21072
|
...m.hidden ? { hidden: true } : {}
|
|
21324
21073
|
};
|
|
@@ -21338,11 +21087,11 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21338
21087
|
);
|
|
21339
21088
|
return;
|
|
21340
21089
|
}
|
|
21341
|
-
const refSlug = typeof _optionalChain([reference, 'access',
|
|
21090
|
+
const refSlug = typeof _optionalChain([reference, 'access', _674 => _674.metadata, 'optionalAccess', _675 => _675.slug]) === "string" && reference.metadata.slug.length > 0 ? reference.metadata.slug : "";
|
|
21342
21091
|
const queryValue = refSlug || sanitizeTitleForChat(reference.title) || reference.id;
|
|
21343
21092
|
const escaped = queryValue.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
21344
|
-
const
|
|
21345
|
-
void sendMessage(
|
|
21093
|
+
const text = `/${cmdId} display "${escaped}"`;
|
|
21094
|
+
void sendMessage(text);
|
|
21346
21095
|
},
|
|
21347
21096
|
[sendMessage, source, cmdIdByTableId, tableIdForDocumentType]
|
|
21348
21097
|
);
|
|
@@ -21384,18 +21133,18 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
21384
21133
|
/** True while the mount-time rebuild from the server transcript runs. */
|
|
21385
21134
|
isHydratingHistory,
|
|
21386
21135
|
/** Provider key for the lib's `<ModelDisplay>` icon. */
|
|
21387
|
-
currentProvider: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
21388
|
-
currentModelLabel: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
21389
|
-
currentContextWindowMaxTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
21136
|
+
currentProvider: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _676 => _676.provider]), () => ( null)),
|
|
21137
|
+
currentModelLabel: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _677 => _677.modelLabel]), () => ( null)),
|
|
21138
|
+
currentContextWindowMaxTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _678 => _678.contextWindowMaxTokens]), () => ( null)),
|
|
21390
21139
|
/** Input tokens (known after server's message_start frame; null until). */
|
|
21391
|
-
currentInputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
21140
|
+
currentInputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _679 => _679.inputTokens]), () => ( null)),
|
|
21392
21141
|
/** Output tokens (known only after server's trailing usage frame). */
|
|
21393
|
-
currentOutputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
21142
|
+
currentOutputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _680 => _680.outputTokens]), () => ( null)),
|
|
21394
21143
|
/** Cache hit % (read / total-input × 100). null during streaming. */
|
|
21395
|
-
currentCacheHitRatePct: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
21144
|
+
currentCacheHitRatePct: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _681 => _681.cacheHitRatePct]), () => ( null)),
|
|
21396
21145
|
/** Cross-call usage breakdown (Haiku rewriter/classifier/summarizer
|
|
21397
21146
|
* token counts). null until the trailing usage frame lands. */
|
|
21398
|
-
currentUsageBreakdown: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess',
|
|
21147
|
+
currentUsageBreakdown: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _682 => _682.breakdown]), () => ( null)),
|
|
21399
21148
|
// ─── Dialog management ───────────────────────────────────────────────
|
|
21400
21149
|
// With `chatConversationsUrl` the server transcript store IS the dialog
|
|
21401
21150
|
// list (shared `useManagedDialogList`); selecting a row re-hydrates through
|
|
@@ -21496,16 +21245,6 @@ function decodeNatsChunk(chunk) {
|
|
|
21496
21245
|
return { type: "thinking-delta", text: data.text, ...seq };
|
|
21497
21246
|
}
|
|
21498
21247
|
return null;
|
|
21499
|
-
// Two chunk names, one payload and one decoder. `SOURCES` is the contract
|
|
21500
|
-
// the backend is moving to; `GUIDE` is the v2 envelope it ships in during
|
|
21501
|
-
// the rollout (see `MESSAGE_TYPE.GUIDE`). The chunk arrives BEFORE or
|
|
21502
|
-
// between the answer's text deltas, so the reducer — not this decoder —
|
|
21503
|
-
// owns attaching it to the right turn.
|
|
21504
|
-
case MESSAGE_TYPE.GUIDE:
|
|
21505
|
-
case MESSAGE_TYPE.SOURCES: {
|
|
21506
|
-
const event = sourceMetadataEvent(data.payload);
|
|
21507
|
-
return event ? { ...event, ...seq } : null;
|
|
21508
|
-
}
|
|
21509
21248
|
// An ask card is only an ask card with something to pick: a question and at
|
|
21510
21249
|
// least one option. Anything less is dropped rather than rendered as an
|
|
21511
21250
|
// empty card the user can't answer — the backend already falls back to a
|
|
@@ -21650,7 +21389,7 @@ function decodeNatsChunk(chunk) {
|
|
|
21650
21389
|
userId: typeof data.userId === "string" ? data.userId : void 0,
|
|
21651
21390
|
// Wire shape carries no label; fall back to the id (parity with
|
|
21652
21391
|
// the history path in `process-historical-messages.ts`).
|
|
21653
|
-
contextItems: Array.isArray(data.contextItems) ? data.contextItems.filter((it) => typeof _optionalChain([it, 'optionalAccess',
|
|
21392
|
+
contextItems: Array.isArray(data.contextItems) ? data.contextItems.filter((it) => typeof _optionalChain([it, 'optionalAccess', _683 => _683.type]) === "string" && typeof _optionalChain([it, 'optionalAccess', _684 => _684.id]) === "string").map((it) => ({
|
|
21654
21393
|
type: it.type,
|
|
21655
21394
|
id: it.id,
|
|
21656
21395
|
label: it.id
|
|
@@ -21741,7 +21480,7 @@ function extractIncompleteMessageState(lastMessage) {
|
|
|
21741
21480
|
}
|
|
21742
21481
|
break;
|
|
21743
21482
|
case "approval_batch": {
|
|
21744
|
-
const allDone = !!segment.data.executions && segment.data.toolCalls.every((c) => _optionalChain([segment, 'access',
|
|
21483
|
+
const allDone = !!segment.data.executions && segment.data.toolCalls.every((c) => _optionalChain([segment, 'access', _685 => _685.data, 'access', _686 => _686.executions, 'optionalAccess', _687 => _687[c.toolExecutionRequestId], 'optionalAccess', _688 => _688.status]) === "done");
|
|
21745
21484
|
if (segment.status !== "rejected" && !allDone) {
|
|
21746
21485
|
hasIncompleteState = true;
|
|
21747
21486
|
}
|
|
@@ -21803,11 +21542,11 @@ function extractIncompleteMessageState(lastMessage) {
|
|
|
21803
21542
|
function extractIncompleteTailState(messages) {
|
|
21804
21543
|
if (!messages || messages.length === 0) return void 0;
|
|
21805
21544
|
let start = messages.length;
|
|
21806
|
-
while (start > 0 && _optionalChain([messages, 'access',
|
|
21545
|
+
while (start > 0 && _optionalChain([messages, 'access', _689 => _689[start - 1], 'optionalAccess', _690 => _690.role]) === "assistant") start -= 1;
|
|
21807
21546
|
if (start === messages.length) return void 0;
|
|
21808
21547
|
const segments = [];
|
|
21809
21548
|
for (let i = start; i < messages.length; i += 1) {
|
|
21810
|
-
const content = _optionalChain([messages, 'access',
|
|
21549
|
+
const content = _optionalChain([messages, 'access', _691 => _691[i], 'optionalAccess', _692 => _692.content]);
|
|
21811
21550
|
if (Array.isArray(content)) segments.push(...content);
|
|
21812
21551
|
}
|
|
21813
21552
|
if (segments.length === 0) return void 0;
|
|
@@ -21820,15 +21559,15 @@ function extractIncompleteTailState(messages) {
|
|
|
21820
21559
|
|
|
21821
21560
|
// src/components/chat/utils/process-historical-messages.ts
|
|
21822
21561
|
function getOwnerDisplayName(owner) {
|
|
21823
|
-
if (_optionalChain([owner, 'optionalAccess',
|
|
21562
|
+
if (_optionalChain([owner, 'optionalAccess', _693 => _693.type]) === OWNER_TYPE.ADMIN && owner.user) {
|
|
21824
21563
|
const { firstName, lastName } = owner.user;
|
|
21825
21564
|
const name = [firstName, lastName].filter(Boolean).join(" ");
|
|
21826
21565
|
if (name) return name;
|
|
21827
21566
|
}
|
|
21828
|
-
return _optionalChain([owner, 'optionalAccess',
|
|
21567
|
+
return _optionalChain([owner, 'optionalAccess', _694 => _694.type]) === OWNER_TYPE.ADMIN ? "Admin" : "You";
|
|
21829
21568
|
}
|
|
21830
21569
|
function getOwnerAvatar(owner) {
|
|
21831
|
-
return _nullishCoalesce(_optionalChain([owner, 'optionalAccess',
|
|
21570
|
+
return _nullishCoalesce(_optionalChain([owner, 'optionalAccess', _695 => _695.user, 'optionalAccess', _696 => _696.image, 'optionalAccess', _697 => _697.imageUrl]), () => ( void 0));
|
|
21832
21571
|
}
|
|
21833
21572
|
function pushStandaloneMessages(processedMessages, msg, messageDataArray) {
|
|
21834
21573
|
messageDataArray.forEach((data) => {
|
|
@@ -21857,12 +21596,6 @@ function decodeHistoricalMessageData(data) {
|
|
|
21857
21596
|
return { type: "thinking-delta", text: data.text };
|
|
21858
21597
|
}
|
|
21859
21598
|
return null;
|
|
21860
|
-
// Persisted source metadata, through the SAME decoder the live chunk uses
|
|
21861
|
-
// (`sourceMetadataEvent`). That shared parse is the whole reason a reloaded
|
|
21862
|
-
// answer renders identically to the one the reader watched arrive.
|
|
21863
|
-
case MESSAGE_TYPE.GUIDE:
|
|
21864
|
-
case MESSAGE_TYPE.SOURCES:
|
|
21865
|
-
return "payload" in data ? sourceMetadataEvent(data.payload) : null;
|
|
21866
21599
|
// Same completeness gate as the live decoder (`decodeNatsChunk`): a
|
|
21867
21600
|
// persisted row without a question or without options is not a card the
|
|
21868
21601
|
// user can answer, so it replays as nothing rather than as empty chrome.
|
|
@@ -22018,7 +21751,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
22018
21751
|
event.offerId,
|
|
22019
21752
|
event.text,
|
|
22020
21753
|
event.origin,
|
|
22021
|
-
_nullishCoalesce(_optionalChain([escalationOfferStates, 'optionalAccess',
|
|
21754
|
+
_nullishCoalesce(_optionalChain([escalationOfferStates, 'optionalAccess', _698 => _698[event.offerId]]), () => ( "pending"))
|
|
22022
21755
|
);
|
|
22023
21756
|
break;
|
|
22024
21757
|
case "ticket-escalated":
|
|
@@ -22052,7 +21785,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
22052
21785
|
);
|
|
22053
21786
|
break;
|
|
22054
21787
|
case "escalation-offer-resolved":
|
|
22055
|
-
_optionalChain([offerResolutions, 'optionalAccess',
|
|
21788
|
+
_optionalChain([offerResolutions, 'optionalAccess', _699 => _699.set, 'call', _700 => _700(event.offerId, {
|
|
22056
21789
|
status: event.status,
|
|
22057
21790
|
resolvedByName: event.resolvedByName
|
|
22058
21791
|
})]);
|
|
@@ -22116,7 +21849,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
22116
21849
|
}
|
|
22117
21850
|
}
|
|
22118
21851
|
} else {
|
|
22119
|
-
_optionalChain([escalatedApprovals, 'optionalAccess',
|
|
21852
|
+
_optionalChain([escalatedApprovals, 'optionalAccess', _701 => _701.set, 'call', _702 => _702(event.requestId, {
|
|
22120
21853
|
command: event.command || "",
|
|
22121
21854
|
explanation: event.explanation,
|
|
22122
21855
|
approvalType,
|
|
@@ -22131,8 +21864,8 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
22131
21864
|
const existingStatus = approvalStatuses[requestId];
|
|
22132
21865
|
const status = existingStatus || event.status;
|
|
22133
21866
|
const resolvedByName = event.resolvedByName;
|
|
22134
|
-
const escalatedData = _optionalChain([escalatedApprovals, 'optionalAccess',
|
|
22135
|
-
if (_optionalChain([escalatedData, 'optionalAccess',
|
|
21867
|
+
const escalatedData = _optionalChain([escalatedApprovals, 'optionalAccess', _703 => _703.get, 'call', _704 => _704(requestId)]);
|
|
21868
|
+
if (_optionalChain([escalatedData, 'optionalAccess', _705 => _705.toolCalls]) && escalatedData.toolCalls.length > 0) {
|
|
22136
21869
|
if (batchApprovalsEnabled) {
|
|
22137
21870
|
accumulator.addApprovalBatch(
|
|
22138
21871
|
requestId,
|
|
@@ -22154,7 +21887,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
22154
21887
|
);
|
|
22155
21888
|
}
|
|
22156
21889
|
}
|
|
22157
|
-
_optionalChain([escalatedApprovals, 'optionalAccess',
|
|
21890
|
+
_optionalChain([escalatedApprovals, 'optionalAccess', _706 => _706.delete, 'call', _707 => _707(requestId)]);
|
|
22158
21891
|
break;
|
|
22159
21892
|
}
|
|
22160
21893
|
if (escalatedData) {
|
|
@@ -22163,7 +21896,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
|
|
|
22163
21896
|
explanation: escalatedData.explanation,
|
|
22164
21897
|
approvalType: escalatedData.approvalType
|
|
22165
21898
|
});
|
|
22166
|
-
_optionalChain([escalatedApprovals, 'optionalAccess',
|
|
21899
|
+
_optionalChain([escalatedApprovals, 'optionalAccess', _708 => _708.delete, 'call', _709 => _709(requestId)]);
|
|
22167
21900
|
}
|
|
22168
21901
|
const before = accumulator.getSegments();
|
|
22169
21902
|
const after = accumulator.updateApprovalStatus(requestId, status, resolvedByName);
|
|
@@ -22222,7 +21955,6 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
22222
21955
|
let currentAssistantTimestamp = null;
|
|
22223
21956
|
let lastAssistantId = null;
|
|
22224
21957
|
let currentAssistantStreamSeq;
|
|
22225
|
-
let currentAssistantSourceMetadata = null;
|
|
22226
21958
|
const flushAssistantMessage = () => {
|
|
22227
21959
|
const idToUse = lastAssistantId || currentAssistantId;
|
|
22228
21960
|
if (idToUse && accumulator.hasContent()) {
|
|
@@ -22235,8 +21967,7 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
22235
21967
|
authorType: assistantType,
|
|
22236
21968
|
timestamp: currentAssistantTimestamp || /* @__PURE__ */ new Date(),
|
|
22237
21969
|
avatar: assistantAvatar,
|
|
22238
|
-
...currentAssistantStreamSeq !== void 0 ? { streamSeq: currentAssistantStreamSeq } : {}
|
|
22239
|
-
..._nullishCoalesce(currentAssistantSourceMetadata, () => ( {}))
|
|
21970
|
+
...currentAssistantStreamSeq !== void 0 ? { streamSeq: currentAssistantStreamSeq } : {}
|
|
22240
21971
|
});
|
|
22241
21972
|
accumulator.resetSegments();
|
|
22242
21973
|
}
|
|
@@ -22244,7 +21975,6 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
22244
21975
|
currentAssistantTimestamp = null;
|
|
22245
21976
|
lastAssistantId = null;
|
|
22246
21977
|
currentAssistantStreamSeq = void 0;
|
|
22247
|
-
currentAssistantSourceMetadata = null;
|
|
22248
21978
|
};
|
|
22249
21979
|
messages.forEach((msg, index) => {
|
|
22250
21980
|
if (chatTypeFilter && msg.chatType !== chatTypeFilter) return;
|
|
@@ -22255,14 +21985,14 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
22255
21985
|
pushStandaloneMessages(processedMessages, msg, messageDataArray);
|
|
22256
21986
|
return;
|
|
22257
21987
|
}
|
|
22258
|
-
const isUserMessage = _optionalChain([msg, 'access',
|
|
21988
|
+
const isUserMessage = _optionalChain([msg, 'access', _710 => _710.owner, 'optionalAccess', _711 => _711.type]) === OWNER_TYPE.CLIENT || _optionalChain([msg, 'access', _712 => _712.owner, 'optionalAccess', _713 => _713.type]) === OWNER_TYPE.ADMIN;
|
|
22259
21989
|
if (isUserMessage) {
|
|
22260
21990
|
flushAssistantMessage();
|
|
22261
|
-
const userAuthorType = _optionalChain([msg, 'access',
|
|
21991
|
+
const userAuthorType = _optionalChain([msg, 'access', _714 => _714.owner, 'optionalAccess', _715 => _715.type]) === OWNER_TYPE.ADMIN ? "admin" : "user";
|
|
22262
21992
|
messageDataArray.forEach((data) => {
|
|
22263
21993
|
if (data.type === MESSAGE_TYPE.TEXT && "text" in data && data.text) {
|
|
22264
21994
|
const rawContext = data.contextItems;
|
|
22265
|
-
const contextItems = Array.isArray(rawContext) ? rawContext.filter((c) => typeof _optionalChain([c, 'optionalAccess',
|
|
21995
|
+
const contextItems = Array.isArray(rawContext) ? rawContext.filter((c) => typeof _optionalChain([c, 'optionalAccess', _716 => _716.type]) === "string" && typeof _optionalChain([c, 'optionalAccess', _717 => _717.id]) === "string").map((c) => ({ type: c.type, id: c.id, label: c.id })) : void 0;
|
|
22266
21996
|
processedMessages.push({
|
|
22267
21997
|
id: msg.id,
|
|
22268
21998
|
role: "user",
|
|
@@ -22288,10 +22018,6 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
22288
22018
|
messageDataArray.forEach((data) => {
|
|
22289
22019
|
const event = decodeHistoricalMessageData(data);
|
|
22290
22020
|
if (!event) return;
|
|
22291
|
-
if (event.type === "sources") {
|
|
22292
|
-
currentAssistantSourceMetadata = mergeSourceMetadata(currentAssistantSourceMetadata, event);
|
|
22293
|
-
return;
|
|
22294
|
-
}
|
|
22295
22021
|
applyHistoryEvent(
|
|
22296
22022
|
event,
|
|
22297
22023
|
accumulator,
|
|
@@ -22309,7 +22035,7 @@ function processHistoricalMessages(messages, options = {}) {
|
|
|
22309
22035
|
});
|
|
22310
22036
|
const nextMsg = messages[index + 1];
|
|
22311
22037
|
const isLastMessage = index === messages.length - 1;
|
|
22312
|
-
const nextIsFromUser = nextMsg && (_optionalChain([nextMsg, 'access',
|
|
22038
|
+
const nextIsFromUser = nextMsg && (_optionalChain([nextMsg, 'access', _718 => _718.owner, 'optionalAccess', _719 => _719.type]) === OWNER_TYPE.CLIENT || _optionalChain([nextMsg, 'access', _720 => _720.owner, 'optionalAccess', _721 => _721.type]) === OWNER_TYPE.ADMIN);
|
|
22313
22039
|
if (isLastMessage || nextIsFromUser) {
|
|
22314
22040
|
flushAssistantMessage();
|
|
22315
22041
|
}
|
|
@@ -22691,10 +22417,10 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
22691
22417
|
});
|
|
22692
22418
|
const connectionState = !active || !dialogId ? "connected" : connectedForDialog === dialogId ? "connected" : "connecting";
|
|
22693
22419
|
const sendMessage = _react.useCallback.call(void 0,
|
|
22694
|
-
async (
|
|
22695
|
-
const hidden = _nullishCoalesce(_optionalChain([sendOptions, 'optionalAccess',
|
|
22696
|
-
mutate((r) => r.pushOptimisticSend(
|
|
22697
|
-
await publishUserMessage(
|
|
22420
|
+
async (text, sendOptions) => {
|
|
22421
|
+
const hidden = _nullishCoalesce(_optionalChain([sendOptions, 'optionalAccess', _722 => _722.hidden]), () => ( false));
|
|
22422
|
+
mutate((r) => r.pushOptimisticSend(text, hidden));
|
|
22423
|
+
await publishUserMessage(text, { hidden, dialogId });
|
|
22698
22424
|
},
|
|
22699
22425
|
[mutate, publishUserMessage, dialogId]
|
|
22700
22426
|
);
|
|
@@ -22785,11 +22511,11 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
22785
22511
|
// Tokens: live `token_usage` frame / dialog snapshot (`dialogTokenUsage`).
|
|
22786
22512
|
// contextWindow uses the dialog's `contextSize` (the "X / Y" denominator,
|
|
22787
22513
|
// matching the /mingo page). cacheHitRate/breakdown are SSE-only → null.
|
|
22788
|
-
currentProvider: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess',
|
|
22789
|
-
currentModelLabel: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess',
|
|
22790
|
-
currentContextWindowMaxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess',
|
|
22791
|
-
currentInputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess',
|
|
22792
|
-
currentOutputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess',
|
|
22514
|
+
currentProvider: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _723 => _723.provider]), () => ( modelProvider)), () => ( null)),
|
|
22515
|
+
currentModelLabel: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _724 => _724.modelLabel]), () => ( modelLabel)), () => ( null)),
|
|
22516
|
+
currentContextWindowMaxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _725 => _725.contextSize]), () => ( _optionalChain([liveModel, 'optionalAccess', _726 => _726.contextWindowMaxTokens]))), () => ( null)),
|
|
22517
|
+
currentInputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _727 => _727.inputTokensSize]), () => ( null)),
|
|
22518
|
+
currentOutputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _728 => _728.outputTokensSize]), () => ( null)),
|
|
22793
22519
|
currentCacheHitRatePct: null,
|
|
22794
22520
|
currentUsageBreakdown: null,
|
|
22795
22521
|
// Dialog management
|
|
@@ -22903,7 +22629,7 @@ function useUnifiedChat(options) {
|
|
|
22903
22629
|
const stopMessage = _react.useCallback.call(void 0, () => activeStateRef.current.stopMessage(), []);
|
|
22904
22630
|
const clearMessages = _react.useCallback.call(void 0, () => activeStateRef.current.clearMessages(), []);
|
|
22905
22631
|
const sendMessage = _react.useCallback.call(void 0,
|
|
22906
|
-
(
|
|
22632
|
+
(text, opts) => activeStateRef.current.sendMessage(text, opts),
|
|
22907
22633
|
[]
|
|
22908
22634
|
);
|
|
22909
22635
|
const discussRef = _react.useCallback.call(void 0,
|
|
@@ -22911,7 +22637,7 @@ function useUnifiedChat(options) {
|
|
|
22911
22637
|
[]
|
|
22912
22638
|
);
|
|
22913
22639
|
const displayRefForward = _react.useCallback.call(void 0,
|
|
22914
|
-
(ref) => _optionalChain([activeStateRef, 'access',
|
|
22640
|
+
(ref) => _optionalChain([activeStateRef, 'access', _729 => _729.current, 'access', _730 => _730.displayRef, 'optionalCall', _731 => _731(ref)]),
|
|
22915
22641
|
[]
|
|
22916
22642
|
);
|
|
22917
22643
|
const displayRef = activeState.displayRef ? displayRefForward : void 0;
|
|
@@ -22921,7 +22647,7 @@ function useUnifiedChat(options) {
|
|
|
22921
22647
|
const renameDialog = _react.useCallback.call(void 0, (id, title) => activeStateRef.current.renameDialog(id, title), []);
|
|
22922
22648
|
const archiveDialog = _react.useCallback.call(void 0, (id) => activeStateRef.current.archiveDialog(id), []);
|
|
22923
22649
|
const loadMoreDialogs = _react.useCallback.call(void 0, () => activeStateRef.current.loadMoreDialogs(), []);
|
|
22924
|
-
const setDialogScope = _react.useCallback.call(void 0, (scope) => _optionalChain([activeStateRef, 'access',
|
|
22650
|
+
const setDialogScope = _react.useCallback.call(void 0, (scope) => _optionalChain([activeStateRef, 'access', _732 => _732.current, 'access', _733 => _733.setDialogScope, 'optionalCall', _734 => _734(scope)]), []);
|
|
22925
22651
|
const reloadDialogs = _react.useCallback.call(void 0, () => activeStateRef.current.reloadDialogs(), []);
|
|
22926
22652
|
const loadMoreMessages = _react.useCallback.call(void 0, () => activeStateRef.current.loadMoreMessages(), []);
|
|
22927
22653
|
const approveRequest = _react.useCallback.call(void 0, (requestId) => activeStateRef.current.approveRequest(requestId), []);
|
|
@@ -23029,19 +22755,19 @@ function turnRequestKeys(content) {
|
|
|
23029
22755
|
if (!Array.isArray(content)) return keys;
|
|
23030
22756
|
for (const seg of content) {
|
|
23031
22757
|
if (seg.type === "tool_execution") {
|
|
23032
|
-
const id = _optionalChain([seg, 'access',
|
|
22758
|
+
const id = _optionalChain([seg, 'access', _735 => _735.data, 'optionalAccess', _736 => _736.toolExecutionRequestId]);
|
|
23033
22759
|
if (id) keys.add(id);
|
|
23034
22760
|
} else if (seg.type === "approval_request") {
|
|
23035
|
-
const id = _optionalChain([seg, 'access',
|
|
22761
|
+
const id = _optionalChain([seg, 'access', _737 => _737.data, 'optionalAccess', _738 => _738.requestId]);
|
|
23036
22762
|
if (id) keys.add(id);
|
|
23037
22763
|
} else if (seg.type === "escalation_offer") {
|
|
23038
|
-
const id = _optionalChain([seg, 'access',
|
|
22764
|
+
const id = _optionalChain([seg, 'access', _739 => _739.data, 'optionalAccess', _740 => _740.offerId]);
|
|
23039
22765
|
if (id) keys.add(id);
|
|
23040
22766
|
} else if (seg.type === "approval_batch") {
|
|
23041
22767
|
const data = seg.data;
|
|
23042
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
23043
|
-
for (const call of _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
23044
|
-
if (_optionalChain([call, 'optionalAccess',
|
|
22768
|
+
if (_optionalChain([data, 'optionalAccess', _741 => _741.approvalRequestId])) keys.add(data.approvalRequestId);
|
|
22769
|
+
for (const call of _nullishCoalesce(_optionalChain([data, 'optionalAccess', _742 => _742.toolCalls]), () => ( []))) {
|
|
22770
|
+
if (_optionalChain([call, 'optionalAccess', _743 => _743.toolExecutionRequestId])) keys.add(call.toolExecutionRequestId);
|
|
23045
22771
|
}
|
|
23046
22772
|
}
|
|
23047
22773
|
}
|
|
@@ -23062,27 +22788,27 @@ function collectTwinSignals(rows) {
|
|
|
23062
22788
|
for (const row of rows) {
|
|
23063
22789
|
for (const key of turnRequestKeys(row.content)) signals.requestKeys.add(key);
|
|
23064
22790
|
if (row.role === "assistant") {
|
|
23065
|
-
const
|
|
23066
|
-
if (
|
|
22791
|
+
const text2 = assistantAnswerText(row.content);
|
|
22792
|
+
if (text2 !== "") signals.assistantTexts.set(text2, (_nullishCoalesce(signals.assistantTexts.get(text2), () => ( 0))) + 1);
|
|
23067
22793
|
continue;
|
|
23068
22794
|
}
|
|
23069
|
-
const
|
|
23070
|
-
if (
|
|
22795
|
+
const text = userText(row);
|
|
22796
|
+
if (text !== "") signals.userContents.set(text, (_nullishCoalesce(signals.userContents.get(text), () => ( 0))) + 1);
|
|
23071
22797
|
}
|
|
23072
22798
|
return signals;
|
|
23073
22799
|
}
|
|
23074
22800
|
function twinVerdict(signals, m) {
|
|
23075
22801
|
if (m.role !== "assistant") {
|
|
23076
|
-
const
|
|
23077
|
-
if (
|
|
23078
|
-
return signals.userContents.has(
|
|
22802
|
+
const text2 = userText(m);
|
|
22803
|
+
if (text2 === "") return "unknown";
|
|
22804
|
+
return signals.userContents.has(text2) ? "twin" : "distinct";
|
|
23079
22805
|
}
|
|
23080
22806
|
const keys = turnRequestKeys(m.content);
|
|
23081
22807
|
if (keys.size > 0) return sharesRequestKey(keys, signals.requestKeys) ? "twin" : "distinct";
|
|
23082
|
-
const
|
|
23083
|
-
if (
|
|
22808
|
+
const text = assistantAnswerText(m.content);
|
|
22809
|
+
if (text === "") return "unknown";
|
|
23084
22810
|
for (const other of signals.assistantTexts.keys()) {
|
|
23085
|
-
if (other.startsWith(
|
|
22811
|
+
if (other.startsWith(text) || text.startsWith(other)) return "twin";
|
|
23086
22812
|
}
|
|
23087
22813
|
return "distinct";
|
|
23088
22814
|
}
|
|
@@ -23125,18 +22851,18 @@ function mergeHistoryWithRealtime(input) {
|
|
|
23125
22851
|
}
|
|
23126
22852
|
}
|
|
23127
22853
|
const trailing = processedHistory[processedHistory.length - 1];
|
|
23128
|
-
const historyTrailingAssistant = _optionalChain([trailing, 'optionalAccess',
|
|
23129
|
-
const historyBatchId = historyTrailingAssistant && Array.isArray(historyTrailingAssistant.content) ? _nullishCoalesce(_optionalChain([historyTrailingAssistant, 'access',
|
|
22854
|
+
const historyTrailingAssistant = _optionalChain([trailing, 'optionalAccess', _744 => _744.role]) === "assistant" ? trailing : null;
|
|
22855
|
+
const historyBatchId = historyTrailingAssistant && Array.isArray(historyTrailingAssistant.content) ? _nullishCoalesce(_optionalChain([historyTrailingAssistant, 'access', _745 => _745.content, 'access', _746 => _746.find, 'call', _747 => _747((s) => s.type === "approval_batch"), 'optionalAccess', _748 => _748.data, 'optionalAccess', _749 => _749.approvalRequestId]), () => ( null)) : null;
|
|
23130
22856
|
let processedToUse = processedHistory;
|
|
23131
22857
|
const pinnedSyntheticIds = /* @__PURE__ */ new Set();
|
|
23132
22858
|
const droppedSyntheticIds = /* @__PURE__ */ new Set();
|
|
23133
22859
|
if (historyBatchId) {
|
|
23134
22860
|
const batchTwins = existingMessages.filter(
|
|
23135
|
-
(m) => m.role === "assistant" && Array.isArray(m.content) && m.content.some((s) => s.type === "approval_batch" && _optionalChain([s, 'access',
|
|
22861
|
+
(m) => m.role === "assistant" && Array.isArray(m.content) && m.content.some((s) => s.type === "approval_batch" && _optionalChain([s, 'access', _750 => _750.data, 'optionalAccess', _751 => _751.approvalRequestId]) === historyBatchId)
|
|
23136
22862
|
);
|
|
23137
22863
|
const existingWithSameBatch = _nullishCoalesce(batchTwins.find((m) => m.id === streamingMessageId), () => ( batchTwins[batchTwins.length - 1]));
|
|
23138
22864
|
if (existingWithSameBatch && Array.isArray(existingWithSameBatch.content)) {
|
|
23139
|
-
const histSize = Array.isArray(_optionalChain([historyTrailingAssistant, 'optionalAccess',
|
|
22865
|
+
const histSize = Array.isArray(_optionalChain([historyTrailingAssistant, 'optionalAccess', _752 => _752.content])) ? historyTrailingAssistant.content.length : 0;
|
|
23140
22866
|
const realtimeSize = existingWithSameBatch.content.length;
|
|
23141
22867
|
if (existingWithSameBatch.id === streamingMessageId || realtimeSize > histSize) {
|
|
23142
22868
|
processedToUse = processedHistory.slice(0, -1);
|
|
@@ -23169,9 +22895,9 @@ function mergeHistoryWithRealtime(input) {
|
|
|
23169
22895
|
const trailingAssistantText = lastProcessed && lastProcessed.role === "assistant" ? assistantAnswerText(lastProcessed.content) : "";
|
|
23170
22896
|
const windowSignals = collectTwinSignals(processedToUse);
|
|
23171
22897
|
const seenUserSyntheticByContent = /* @__PURE__ */ new Map();
|
|
23172
|
-
const isInWindow = (m) => processedIds.has(m.id) || (_nullishCoalesce(_optionalChain([rawHistoryIds, 'optionalAccess',
|
|
22898
|
+
const isInWindow = (m) => processedIds.has(m.id) || (_nullishCoalesce(_optionalChain([rawHistoryIds, 'optionalAccess', _753 => _753.has, 'call', _754 => _754(m.id)]), () => ( false)));
|
|
23173
22899
|
const firstWindowIndex = existingMessages.findIndex(isInWindow);
|
|
23174
|
-
const isPersistedOlder = (m) => !isClientMintedId(m.id) && (_nullishCoalesce(_optionalChain([m, 'access',
|
|
22900
|
+
const isPersistedOlder = (m) => !isClientMintedId(m.id) && (_nullishCoalesce(_optionalChain([m, 'access', _755 => _755.timestamp, 'optionalAccess', _756 => _756.getTime, 'call', _757 => _757()]), () => ( 0))) <= historyFetchedAt;
|
|
23175
22901
|
let lastOlderPersistedIndex = -1;
|
|
23176
22902
|
if (firstWindowIndex < 0) {
|
|
23177
22903
|
for (const [index, m] of existingMessages.entries()) {
|
|
@@ -23189,7 +22915,7 @@ function mergeHistoryWithRealtime(input) {
|
|
|
23189
22915
|
} else if (pm.role === "assistant") {
|
|
23190
22916
|
windowHasUnstampedAssistant = true;
|
|
23191
22917
|
}
|
|
23192
|
-
const time = _optionalChain([pm, 'access',
|
|
22918
|
+
const time = _optionalChain([pm, 'access', _758 => _758.timestamp, 'optionalAccess', _759 => _759.getTime, 'call', _760 => _760()]);
|
|
23193
22919
|
if (typeof time === "number" && time < windowMinTime) windowMinTime = time;
|
|
23194
22920
|
}
|
|
23195
22921
|
const threadHasClientMintedRow = existingMessages.some((m) => isClientMintedId(m.id));
|
|
@@ -23207,14 +22933,14 @@ function mergeHistoryWithRealtime(input) {
|
|
|
23207
22933
|
const verdict = twinVerdict(windowSignals, m);
|
|
23208
22934
|
return verdict === "unknown" ? !seqCanMislead(m) : verdict === "distinct";
|
|
23209
22935
|
}
|
|
23210
|
-
const time = _optionalChain([m, 'access',
|
|
22936
|
+
const time = _optionalChain([m, 'access', _761 => _761.timestamp, 'optionalAccess', _762 => _762.getTime, 'call', _763 => _763()]);
|
|
23211
22937
|
if (typeof time !== "number" || time > historyFetchedAt) return false;
|
|
23212
22938
|
if (!Number.isFinite(windowMinTime) || time >= windowMinTime) return false;
|
|
23213
22939
|
return twinVerdict(windowSignals, m) === "distinct";
|
|
23214
22940
|
};
|
|
23215
22941
|
const keepRealtime = (m) => {
|
|
23216
22942
|
if (m.role === "user" && isOptimisticId(m.id) && typeof m.content === "string") {
|
|
23217
|
-
const canBeInSnapshot = (_nullishCoalesce(_optionalChain([m, 'access',
|
|
22943
|
+
const canBeInSnapshot = (_nullishCoalesce(_optionalChain([m, 'access', _764 => _764.timestamp, 'optionalAccess', _765 => _765.getTime, 'call', _766 => _766()]), () => ( 0))) <= historyFetchedAt;
|
|
23218
22944
|
return !(canBeInSnapshot && windowSignals.userContents.has(m.content));
|
|
23219
22945
|
}
|
|
23220
22946
|
if (isSyntheticRealtimeId(m.id) && m.id !== streamingMessageId) {
|
|
@@ -23238,7 +22964,7 @@ function mergeHistoryWithRealtime(input) {
|
|
|
23238
22964
|
} else if (typeof m.streamSeq === "number") {
|
|
23239
22965
|
covered = historyMaxStreamSeq > 0 && historyMaxStreamSeq >= m.streamSeq;
|
|
23240
22966
|
} else {
|
|
23241
|
-
covered = historyCoversRealtime !== null ? historyCoversRealtime : (_nullishCoalesce(_optionalChain([m, 'access',
|
|
22967
|
+
covered = historyCoversRealtime !== null ? historyCoversRealtime : (_nullishCoalesce(_optionalChain([m, 'access', _767 => _767.timestamp, 'optionalAccess', _768 => _768.getTime, 'call', _769 => _769()]), () => ( 0))) <= historyFetchedAt;
|
|
23242
22968
|
}
|
|
23243
22969
|
if (covered) return false;
|
|
23244
22970
|
}
|
|
@@ -23275,10 +23001,10 @@ function computeHistoryPrepend(processedHistory, existingMessages) {
|
|
|
23275
23001
|
for (let i = newEnd - 1; i >= 0; i--) {
|
|
23276
23002
|
const pm = processedHistory[i];
|
|
23277
23003
|
if (pm.role === "user") {
|
|
23278
|
-
const
|
|
23279
|
-
const left =
|
|
23004
|
+
const text = userText(pm);
|
|
23005
|
+
const left = text === "" ? 0 : _nullishCoalesce(userTwinsLeft.get(text), () => ( 0));
|
|
23280
23006
|
if (left === 0) continue;
|
|
23281
|
-
userTwinsLeft.set(
|
|
23007
|
+
userTwinsLeft.set(text, left - 1);
|
|
23282
23008
|
twinIndices.add(i);
|
|
23283
23009
|
} else if (pm.role === "assistant") {
|
|
23284
23010
|
const keys = turnRequestKeys(pm.content);
|
|
@@ -23286,10 +23012,10 @@ function computeHistoryPrepend(processedHistory, existingMessages) {
|
|
|
23286
23012
|
if (sharesRequestKey(keys, liveSignals.requestKeys)) twinIndices.add(i);
|
|
23287
23013
|
continue;
|
|
23288
23014
|
}
|
|
23289
|
-
const
|
|
23290
|
-
if (
|
|
23015
|
+
const text = assistantAnswerText(pm.content);
|
|
23016
|
+
if (text === "") continue;
|
|
23291
23017
|
for (const [liveText, left] of assistantTwinsLeft) {
|
|
23292
|
-
if (left === 0 || !
|
|
23018
|
+
if (left === 0 || !text.startsWith(liveText)) continue;
|
|
23293
23019
|
assistantTwinsLeft.set(liveText, left - 1);
|
|
23294
23020
|
twinIndices.add(i);
|
|
23295
23021
|
break;
|
|
@@ -23347,14 +23073,14 @@ function normalizeHistoricalMessageData(md) {
|
|
|
23347
23073
|
function isHistoricalUserTurn(m) {
|
|
23348
23074
|
return !!m.owner;
|
|
23349
23075
|
}
|
|
23350
|
-
var isTextSegment = (d) => _optionalChain([d, 'optionalAccess',
|
|
23076
|
+
var isTextSegment = (d) => _optionalChain([d, 'optionalAccess', _770 => _770.type]) === "TEXT" && typeof d.text === "string";
|
|
23351
23077
|
var THINK_MS = 550;
|
|
23352
23078
|
var TOKEN_MS = 55;
|
|
23353
23079
|
var USER_MS = 480;
|
|
23354
23080
|
var SEGMENT_MS = 340;
|
|
23355
23081
|
var POST_MS = 240;
|
|
23356
|
-
function tokenize(
|
|
23357
|
-
return _nullishCoalesce(
|
|
23082
|
+
function tokenize(text) {
|
|
23083
|
+
return _nullishCoalesce(text.match(/\s*\S+\s*/g), () => ( (text ? [text] : [])));
|
|
23358
23084
|
}
|
|
23359
23085
|
function buildStreamFrames(messages) {
|
|
23360
23086
|
const frames = [];
|
|
@@ -23528,7 +23254,7 @@ function useResizableSize({ enabled, isHorizontal, minSize, maxSize, defaultSize
|
|
|
23528
23254
|
const parsed = parseFloat(raw);
|
|
23529
23255
|
if (!Number.isFinite(parsed)) return clampToViewport(defaultSize);
|
|
23530
23256
|
return clampToViewport(parsed);
|
|
23531
|
-
} catch (
|
|
23257
|
+
} catch (e64) {
|
|
23532
23258
|
return clampToViewport(defaultSize);
|
|
23533
23259
|
}
|
|
23534
23260
|
}, [enabled, storageKey, defaultSize, clampToViewport]);
|
|
@@ -23538,7 +23264,7 @@ function useResizableSize({ enabled, isHorizontal, minSize, maxSize, defaultSize
|
|
|
23538
23264
|
if (!enabled || !storageKey || typeof window === "undefined") return;
|
|
23539
23265
|
try {
|
|
23540
23266
|
window.localStorage.setItem(storageKey, String(Math.round(size2)));
|
|
23541
|
-
} catch (
|
|
23267
|
+
} catch (e65) {
|
|
23542
23268
|
}
|
|
23543
23269
|
}, [enabled, size2, storageKey]);
|
|
23544
23270
|
_react.useEffect.call(void 0, () => {
|
|
@@ -23572,7 +23298,7 @@ function DrawerResizeHandle({ side, size: size2, minSize, maxSize, onSize, ariaL
|
|
|
23572
23298
|
startRef.current = null;
|
|
23573
23299
|
try {
|
|
23574
23300
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
23575
|
-
} catch (
|
|
23301
|
+
} catch (e66) {
|
|
23576
23302
|
}
|
|
23577
23303
|
document.body.style.cursor = "";
|
|
23578
23304
|
document.body.style.userSelect = "";
|
|
@@ -23967,7 +23693,7 @@ function useChatDialogManager({
|
|
|
23967
23693
|
const handleConfirmRestore = _react.useCallback.call(void 0, async () => {
|
|
23968
23694
|
if (restoreTarget) {
|
|
23969
23695
|
try {
|
|
23970
|
-
await _optionalChain([unarchiveDialog, 'optionalCall',
|
|
23696
|
+
await _optionalChain([unarchiveDialog, 'optionalCall', _771 => _771(restoreTarget.id)]);
|
|
23971
23697
|
} catch (err) {
|
|
23972
23698
|
console.error("[useChatDialogManager] unarchive failed:", err);
|
|
23973
23699
|
return;
|
|
@@ -24032,70 +23758,6 @@ function useChatDialogManager({
|
|
|
24032
23758
|
};
|
|
24033
23759
|
}
|
|
24034
23760
|
|
|
24035
|
-
// src/components/chat/utils/cited-sources.ts
|
|
24036
|
-
var FALLBACK_TOP_RETRIEVED = 3;
|
|
24037
|
-
var CITATION = /\[(\d+)\]/g;
|
|
24038
|
-
var CODE = /```[\s\S]*?```|~~~[\s\S]*?~~~|`[^`\n]*`/g;
|
|
24039
|
-
function withoutCode(content) {
|
|
24040
|
-
return content.replace(CODE, (block) => " ".repeat(block.length));
|
|
24041
|
-
}
|
|
24042
|
-
function splitCitedSources(sources2, content) {
|
|
24043
|
-
if (!sources2 || sources2.length === 0) return { cited: [], uncited: [] };
|
|
24044
|
-
const firstMentionAt = /* @__PURE__ */ new Map();
|
|
24045
|
-
for (const match of withoutCode(content).matchAll(CITATION)) {
|
|
24046
|
-
const index = Number.parseInt(match[1], 10);
|
|
24047
|
-
if (!firstMentionAt.has(index)) firstMentionAt.set(index, firstMentionAt.size);
|
|
24048
|
-
}
|
|
24049
|
-
const cited = sources2.filter((source) => firstMentionAt.has(source.index)).sort((a, b) => (_nullishCoalesce(firstMentionAt.get(a.index), () => ( 0))) - (_nullishCoalesce(firstMentionAt.get(b.index), () => ( 0))));
|
|
24050
|
-
const uncited = sources2.filter((source) => !firstMentionAt.has(source.index));
|
|
24051
|
-
return { cited, uncited };
|
|
24052
|
-
}
|
|
24053
|
-
|
|
24054
|
-
// src/components/chat/utils/host-message.ts
|
|
24055
|
-
function mapHostMessage(m, options) {
|
|
24056
|
-
const { userName, userAvatar, timestampCache } = options;
|
|
24057
|
-
let timestamp;
|
|
24058
|
-
if (m.timestamp != null) {
|
|
24059
|
-
timestamp = new Date(m.timestamp);
|
|
24060
|
-
} else {
|
|
24061
|
-
const cached = timestampCache.get(m.id);
|
|
24062
|
-
timestamp = _nullishCoalesce(cached, () => ( /* @__PURE__ */ new Date()));
|
|
24063
|
-
if (!cached) timestampCache.set(m.id, timestamp);
|
|
24064
|
-
}
|
|
24065
|
-
return {
|
|
24066
|
-
id: m.id,
|
|
24067
|
-
role: m.role,
|
|
24068
|
-
// Host-supplied per-message name/avatar win (e.g. the signed-in user's
|
|
24069
|
-
// full name + photo on a `user` bubble); fall back to the role default
|
|
24070
|
-
// when the host doesn't provide them.
|
|
24071
|
-
name: _nullishCoalesce(m.name, () => ( (m.role === "assistant" ? "Mingo" : _nullishCoalesce(userName, () => ( "You"))))),
|
|
24072
|
-
avatar: _nullishCoalesce(m.avatar, () => ( (m.role === "user" ? _nullishCoalesce(userAvatar, () => ( null)) : null))),
|
|
24073
|
-
// Forward the host's authorType so user bubbles get the same accent
|
|
24074
|
-
// name color as the standalone /mingo page (user → 'admin').
|
|
24075
|
-
...m.authorType ? { authorType: m.authorType } : {},
|
|
24076
|
-
content: m.segments && m.segments.length > 0 ? m.segments : m.content,
|
|
24077
|
-
timestamp,
|
|
24078
|
-
assistantType: m.role === "assistant" ? "mingo" : void 0,
|
|
24079
|
-
// `hidden` is load-bearing, NOT cosmetic: it carries synthetic rows
|
|
24080
|
-
// (e.g. an auto-continuation directive) that the LLM must see but the
|
|
24081
|
-
// reader must not. See the module note above.
|
|
24082
|
-
...m.hidden ? { hidden: true } : {},
|
|
24083
|
-
...m.scrollAnchor ? { scrollAnchor: m.scrollAnchor } : {},
|
|
24084
|
-
// Forward attached context items so the user bubble renders its chips.
|
|
24085
|
-
...m.contextItems && m.contextItems.length > 0 ? { contextItems: m.contextItems } : {},
|
|
24086
|
-
// Per-answer source metadata: the citation strip under the answer, and the
|
|
24087
|
-
// descriptions the `[card://…]` markers in its body expand into.
|
|
24088
|
-
...m.sources && m.sources.length > 0 ? { sources: m.sources } : {},
|
|
24089
|
-
...m.refs && m.refs.length > 0 ? { refs: m.refs } : {}
|
|
24090
|
-
};
|
|
24091
|
-
}
|
|
24092
|
-
function pruneTimestampCache(timestampCache, liveIds) {
|
|
24093
|
-
if (timestampCache.size <= liveIds.size) return;
|
|
24094
|
-
for (const id of timestampCache.keys()) {
|
|
24095
|
-
if (!liveIds.has(id)) timestampCache.delete(id);
|
|
24096
|
-
}
|
|
24097
|
-
}
|
|
24098
|
-
|
|
24099
23761
|
// src/components/chat/embeddable-chat.tsx
|
|
24100
23762
|
|
|
24101
23763
|
var HISTORY_RAIL_WIDTH = 320;
|
|
@@ -24118,6 +23780,7 @@ var mentionTokenOf = (key, markerByType) => {
|
|
|
24118
23780
|
const id = ci === -1 ? "" : key.slice(ci + 1);
|
|
24119
23781
|
return `${_nullishCoalesce(markerByType.get(type), () => ( type.toLowerCase()))}:${id}`;
|
|
24120
23782
|
};
|
|
23783
|
+
var FALLBACK_TOP_RETRIEVED = 3;
|
|
24121
23784
|
var RAIL_COLLAPSED_STORAGE_KEY = "mingo-chat-history-collapsed";
|
|
24122
23785
|
var NO_CONTEXT_ITEMS = [];
|
|
24123
23786
|
var RAIL_ANIM_MS = 320;
|
|
@@ -24181,13 +23844,13 @@ function dispatchSlashCommandAction(actionId, cmdId, ref) {
|
|
|
24181
23844
|
input.setValue(`/${cmdId} `);
|
|
24182
23845
|
return;
|
|
24183
23846
|
case "find": {
|
|
24184
|
-
const
|
|
24185
|
-
input.setValueAndCursor(
|
|
23847
|
+
const text = `/${cmdId} ""`;
|
|
23848
|
+
input.setValueAndCursor(text, text.length - 1);
|
|
24186
23849
|
return;
|
|
24187
23850
|
}
|
|
24188
23851
|
case "display": {
|
|
24189
|
-
const
|
|
24190
|
-
input.setValueAndCursor(
|
|
23852
|
+
const text = `/${cmdId} display ""`;
|
|
23853
|
+
input.setValueAndCursor(text, text.length - 1);
|
|
24191
23854
|
return;
|
|
24192
23855
|
}
|
|
24193
23856
|
}
|
|
@@ -24513,7 +24176,7 @@ function EmbeddableChatInner({
|
|
|
24513
24176
|
}),
|
|
24514
24177
|
[commandsUrl]
|
|
24515
24178
|
);
|
|
24516
|
-
const headerUserName = _optionalChain([identityUser, 'optionalAccess',
|
|
24179
|
+
const headerUserName = _optionalChain([identityUser, 'optionalAccess', _772 => _772.name, 'optionalAccess', _773 => _773.trim, 'call', _774 => _774()]) || [_optionalChain([identityUser, 'optionalAccess', _775 => _775.firstName]), _optionalChain([identityUser, 'optionalAccess', _776 => _776.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([userDisplayName, 'optionalAccess', _777 => _777.trim, 'call', _778 => _778()]) || void 0;
|
|
24517
24180
|
const effectiveModes = _react.useMemo.call(void 0, () => {
|
|
24518
24181
|
if (modes) return modes;
|
|
24519
24182
|
const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
|
|
@@ -24528,7 +24191,7 @@ function EmbeddableChatInner({
|
|
|
24528
24191
|
if (controlledActiveMode === void 0) {
|
|
24529
24192
|
setUncontrolledActiveMode(next);
|
|
24530
24193
|
}
|
|
24531
|
-
_optionalChain([onActiveModeChange, 'optionalCall',
|
|
24194
|
+
_optionalChain([onActiveModeChange, 'optionalCall', _779 => _779(next)]);
|
|
24532
24195
|
},
|
|
24533
24196
|
[controlledActiveMode, onActiveModeChange]
|
|
24534
24197
|
);
|
|
@@ -24555,7 +24218,7 @@ function EmbeddableChatInner({
|
|
|
24555
24218
|
);
|
|
24556
24219
|
const effectiveAssistantName = emptyStateConfig.name;
|
|
24557
24220
|
const effectiveAssistantIcon = emptyStateConfig.icon;
|
|
24558
|
-
const headerAssistantName = _nullishCoalesce(effectiveAssistantName, () => ( (typeof _optionalChain([guideWelcome, 'optionalAccess',
|
|
24221
|
+
const headerAssistantName = _nullishCoalesce(effectiveAssistantName, () => ( (typeof _optionalChain([guideWelcome, 'optionalAccess', _780 => _780.title]) === "string" ? guideWelcome.title : null)));
|
|
24559
24222
|
const {
|
|
24560
24223
|
messages: rawMessages,
|
|
24561
24224
|
isLoading: chatLoading,
|
|
@@ -24598,8 +24261,8 @@ function EmbeddableChatInner({
|
|
|
24598
24261
|
const mingoCaps = _react.useMemo.call(void 0,
|
|
24599
24262
|
() => ({
|
|
24600
24263
|
...dialogCapabilities,
|
|
24601
|
-
canRename: _nullishCoalesce(_optionalChain([dialogCapabilities, 'optionalAccess',
|
|
24602
|
-
canArchive: _nullishCoalesce(_optionalChain([dialogCapabilities, 'optionalAccess',
|
|
24264
|
+
canRename: _nullishCoalesce(_optionalChain([dialogCapabilities, 'optionalAccess', _781 => _781.canRename]), () => ( false)),
|
|
24265
|
+
canArchive: _nullishCoalesce(_optionalChain([dialogCapabilities, 'optionalAccess', _782 => _782.canArchive]), () => ( false))
|
|
24603
24266
|
}),
|
|
24604
24267
|
[dialogCapabilities]
|
|
24605
24268
|
);
|
|
@@ -24614,7 +24277,7 @@ function EmbeddableChatInner({
|
|
|
24614
24277
|
void sendMessage(guidePendingPrompt).catch((err) => {
|
|
24615
24278
|
console.error("[EmbeddableChat] guide launcher prompt failed:", err);
|
|
24616
24279
|
});
|
|
24617
|
-
_optionalChain([onGuidePromptConsumed, 'optionalCall',
|
|
24280
|
+
_optionalChain([onGuidePromptConsumed, 'optionalCall', _783 => _783()]);
|
|
24618
24281
|
}, [guidePendingPrompt, activeMode, sendMessage, onGuidePromptConsumed]);
|
|
24619
24282
|
const {
|
|
24620
24283
|
attachments: stagedAttachments,
|
|
@@ -24625,7 +24288,7 @@ function EmbeddableChatInner({
|
|
|
24625
24288
|
clear: clearAttachments
|
|
24626
24289
|
} = useChatAttachments();
|
|
24627
24290
|
const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
|
|
24628
|
-
const contextMaxItems = _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess',
|
|
24291
|
+
const contextMaxItems = _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _784 => _784.maxItems]), () => ( 10));
|
|
24629
24292
|
const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
|
|
24630
24293
|
const [contextItems, setContextItems] = _react.useState.call(void 0, NO_CONTEXT_ITEMS);
|
|
24631
24294
|
const [contextPickerOpen, setContextPickerOpen] = _react.useState.call(void 0, false);
|
|
@@ -24646,10 +24309,10 @@ function EmbeddableChatInner({
|
|
|
24646
24309
|
}, [activeDialogId, activeMode]);
|
|
24647
24310
|
const mentionMarkerByType = _react.useMemo.call(void 0, () => {
|
|
24648
24311
|
const m = /* @__PURE__ */ new Map();
|
|
24649
|
-
for (const t of _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess',
|
|
24312
|
+
for (const t of _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _785 => _785.entityTypes]), () => ( []))) if (t.marker) m.set(t.type, t.marker);
|
|
24650
24313
|
return m;
|
|
24651
|
-
}, [_optionalChain([contextPicker, 'optionalAccess',
|
|
24652
|
-
const contextEntityTypes = _optionalChain([contextPicker, 'optionalAccess',
|
|
24314
|
+
}, [_optionalChain([contextPicker, 'optionalAccess', _786 => _786.entityTypes])]);
|
|
24315
|
+
const contextEntityTypes = _optionalChain([contextPicker, 'optionalAccess', _787 => _787.entityTypes]);
|
|
24653
24316
|
const resolveContextIcon = _react.useMemo.call(void 0, () => {
|
|
24654
24317
|
const byType = /* @__PURE__ */ new Map();
|
|
24655
24318
|
for (const t of _nullishCoalesce(contextEntityTypes, () => ( []))) byType.set(t.type, t.icon);
|
|
@@ -24661,7 +24324,7 @@ function EmbeddableChatInner({
|
|
|
24661
24324
|
if (mentionActiveRef.current) {
|
|
24662
24325
|
if (contextItems.some((p) => `${p.type}:${p.id}` === key)) return;
|
|
24663
24326
|
if (contextItems.length >= contextMaxItems) return;
|
|
24664
|
-
_optionalChain([chatInputRef, 'access',
|
|
24327
|
+
_optionalChain([chatInputRef, 'access', _788 => _788.current, 'optionalAccess', _789 => _789.commitMention, 'call', _790 => _790(mentionTokenOf(key, mentionMarkerByType), {
|
|
24665
24328
|
label: item.label,
|
|
24666
24329
|
icon: resolveContextIcon(item)
|
|
24667
24330
|
})]);
|
|
@@ -24684,9 +24347,9 @@ function EmbeddableChatInner({
|
|
|
24684
24347
|
setContextItems((prev) => prev.filter((p) => `${p.type}:${p.id}` !== key));
|
|
24685
24348
|
if (mentionKeysRef.current.has(key)) {
|
|
24686
24349
|
mentionKeysRef.current.delete(key);
|
|
24687
|
-
const cur = _nullishCoalesce(_optionalChain([chatInputRef, 'access',
|
|
24350
|
+
const cur = _nullishCoalesce(_optionalChain([chatInputRef, 'access', _791 => _791.current, 'optionalAccess', _792 => _792.getValue, 'call', _793 => _793()]), () => ( ""));
|
|
24688
24351
|
const next = cur.replace(`@${mentionTokenOf(key, mentionMarkerByType)}`, "").replace(/\s{2,}/g, " ").trimStart();
|
|
24689
|
-
_optionalChain([chatInputRef, 'access',
|
|
24352
|
+
_optionalChain([chatInputRef, 'access', _794 => _794.current, 'optionalAccess', _795 => _795.setValue, 'call', _796 => _796(next)]);
|
|
24690
24353
|
}
|
|
24691
24354
|
},
|
|
24692
24355
|
[mentionMarkerByType]
|
|
@@ -24708,7 +24371,7 @@ function EmbeddableChatInner({
|
|
|
24708
24371
|
}, []);
|
|
24709
24372
|
const closeContextPicker = _react.useCallback.call(void 0, () => {
|
|
24710
24373
|
if (mentionActiveRef.current) {
|
|
24711
|
-
_optionalChain([chatInputRef, 'access',
|
|
24374
|
+
_optionalChain([chatInputRef, 'access', _797 => _797.current, 'optionalAccess', _798 => _798.removeMentionTrigger, 'call', _799 => _799()]);
|
|
24712
24375
|
}
|
|
24713
24376
|
setContextPickerOpen(false);
|
|
24714
24377
|
setMentionQuery(null);
|
|
@@ -24742,20 +24405,59 @@ function EmbeddableChatInner({
|
|
|
24742
24405
|
[effectiveAssistantIcon]
|
|
24743
24406
|
);
|
|
24744
24407
|
const [timestampCache] = _react.useState.call(void 0, () => /* @__PURE__ */ new Map());
|
|
24745
|
-
const guideUserName = activeMode === "guide" ? [_optionalChain([identityUser, 'optionalAccess',
|
|
24746
|
-
const guideUserAvatar = activeMode === "guide" ? _optionalChain([identityUser, 'optionalAccess',
|
|
24408
|
+
const guideUserName = activeMode === "guide" ? [_optionalChain([identityUser, 'optionalAccess', _800 => _800.firstName]), _optionalChain([identityUser, 'optionalAccess', _801 => _801.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([identityUser, 'optionalAccess', _802 => _802.name, 'optionalAccess', _803 => _803.trim, 'call', _804 => _804()]) || void 0 : void 0;
|
|
24409
|
+
const guideUserAvatar = activeMode === "guide" ? _optionalChain([identityUser, 'optionalAccess', _805 => _805.avatarUrl, 'optionalAccess', _806 => _806.trim, 'call', _807 => _807()]) || void 0 : void 0;
|
|
24747
24410
|
const messages = _react.useMemo.call(void 0, () => {
|
|
24748
|
-
const
|
|
24749
|
-
const
|
|
24750
|
-
|
|
24411
|
+
const cache = timestampCache;
|
|
24412
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
24413
|
+
const mapped = rawMessages.map((m) => {
|
|
24414
|
+
seenIds.add(m.id);
|
|
24415
|
+
let timestamp;
|
|
24416
|
+
if (m.timestamp != null) {
|
|
24417
|
+
timestamp = new Date(m.timestamp);
|
|
24418
|
+
} else {
|
|
24419
|
+
const cached = cache.get(m.id);
|
|
24420
|
+
timestamp = _nullishCoalesce(cached, () => ( /* @__PURE__ */ new Date()));
|
|
24421
|
+
if (!cached) cache.set(m.id, timestamp);
|
|
24422
|
+
}
|
|
24423
|
+
return {
|
|
24424
|
+
id: m.id,
|
|
24425
|
+
role: m.role,
|
|
24426
|
+
// Host-supplied per-message name/avatar win (e.g. the signed-in user's
|
|
24427
|
+
// full name + photo on a `user` bubble); fall back to the role default
|
|
24428
|
+
// when the host doesn't provide them.
|
|
24429
|
+
name: _nullishCoalesce(m.name, () => ( (m.role === "assistant" ? "Mingo" : _nullishCoalesce(guideUserName, () => ( "You"))))),
|
|
24430
|
+
avatar: _nullishCoalesce(m.avatar, () => ( (m.role === "user" ? _nullishCoalesce(guideUserAvatar, () => ( null)) : null))),
|
|
24431
|
+
// Forward the host's authorType so user bubbles get the same accent
|
|
24432
|
+
// name color as the standalone /mingo page (user → 'admin').
|
|
24433
|
+
...m.authorType ? { authorType: m.authorType } : {},
|
|
24434
|
+
content: m.segments && m.segments.length > 0 ? m.segments : m.content,
|
|
24435
|
+
timestamp,
|
|
24436
|
+
assistantType: m.role === "assistant" ? "mingo" : void 0,
|
|
24437
|
+
// `hidden` is load-bearing, NOT cosmetic: it carries synthetic rows
|
|
24438
|
+
// (e.g. an auto-continuation directive) that the LLM must see but the
|
|
24439
|
+
// reader must not. Dropping it here made the raw directive text render
|
|
24440
|
+
// as an ordinary bubble. This field-by-field rebuild has to forward it
|
|
24441
|
+
// explicitly — see `Message.hidden` and `chat-message-list`'s skip.
|
|
24442
|
+
...m.hidden ? { hidden: true } : {},
|
|
24443
|
+
...m.scrollAnchor ? { scrollAnchor: m.scrollAnchor } : {},
|
|
24444
|
+
// Forward attached context items so the user bubble renders its chips.
|
|
24445
|
+
...m.contextItems && m.contextItems.length > 0 ? { contextItems: m.contextItems } : {}
|
|
24446
|
+
};
|
|
24447
|
+
});
|
|
24448
|
+
if (cache.size > seenIds.size) {
|
|
24449
|
+
for (const id of cache.keys()) {
|
|
24450
|
+
if (!seenIds.has(id)) cache.delete(id);
|
|
24451
|
+
}
|
|
24452
|
+
}
|
|
24751
24453
|
return mapped;
|
|
24752
24454
|
}, [rawMessages, guideUserName, guideUserAvatar, timestampCache]);
|
|
24753
24455
|
const handleSend = _react.useCallback.call(void 0,
|
|
24754
|
-
(
|
|
24755
|
-
let augmentedText =
|
|
24456
|
+
(text) => {
|
|
24457
|
+
let augmentedText = text;
|
|
24756
24458
|
if (readyAttachments.length > 0) {
|
|
24757
24459
|
const markdown = readyAttachments.map((att) => formatChatAttachmentMarkdownForBubble(att, viewUrlPrefix)).join("");
|
|
24758
|
-
augmentedText = `${
|
|
24460
|
+
augmentedText = `${text}${markdown}`;
|
|
24759
24461
|
}
|
|
24760
24462
|
void sendMessage(augmentedText, {
|
|
24761
24463
|
...readyAttachments.length > 0 ? { attachments: readyAttachments } : {},
|
|
@@ -24891,33 +24593,28 @@ function EmbeddableChatInner({
|
|
|
24891
24593
|
});
|
|
24892
24594
|
return out;
|
|
24893
24595
|
}, [commandsById, enabledSet]);
|
|
24894
|
-
const
|
|
24895
|
-
|
|
24896
|
-
|
|
24897
|
-
|
|
24898
|
-
|
|
24899
|
-
|
|
24900
|
-
|
|
24901
|
-
|
|
24902
|
-
|
|
24903
|
-
|
|
24904
|
-
|
|
24905
|
-
|
|
24906
|
-
|
|
24907
|
-
|
|
24908
|
-
|
|
24909
|
-
}
|
|
24910
|
-
) });
|
|
24911
|
-
},
|
|
24912
|
-
[chatLoading, messages.length, resolvedBaseRoute, chipBasePlatform, handleNavigationClose, discussRef]
|
|
24913
|
-
);
|
|
24596
|
+
const lastAssistantMsg = [...rawMessages].reverse().find((m) => m.role === "assistant");
|
|
24597
|
+
const lastSources = _react.useMemo.call(void 0, () => {
|
|
24598
|
+
if (chatLoading) return void 0;
|
|
24599
|
+
const sources = _optionalChain([lastAssistantMsg, 'optionalAccess', _808 => _808.sources]);
|
|
24600
|
+
if (!sources || sources.length === 0) return void 0;
|
|
24601
|
+
const content = _optionalChain([lastAssistantMsg, 'optionalAccess', _809 => _809.content]) || "";
|
|
24602
|
+
const citationOrder = [...content.matchAll(/\[(\d+)\]/g)].map((m) => parseInt(m[1], 10));
|
|
24603
|
+
const seenOrder = /* @__PURE__ */ new Map();
|
|
24604
|
+
citationOrder.forEach((idx) => {
|
|
24605
|
+
if (!seenOrder.has(idx)) seenOrder.set(idx, seenOrder.size);
|
|
24606
|
+
});
|
|
24607
|
+
const cited = sources.filter((s) => seenOrder.has(s.index)).sort((a, b) => (_nullishCoalesce(seenOrder.get(a.index), () => ( 0))) - (_nullishCoalesce(seenOrder.get(b.index), () => ( 0))));
|
|
24608
|
+
const uncited = sources.filter((s) => !seenOrder.has(s.index));
|
|
24609
|
+
return { cited, uncited };
|
|
24610
|
+
}, [lastAssistantMsg, chatLoading]);
|
|
24914
24611
|
const [portalHost, setPortalHost] = _react.useState.call(void 0, null);
|
|
24915
24612
|
const [panelBoundary, setPanelBoundary] = _react.useState.call(void 0, null);
|
|
24916
24613
|
const [panelWidth, setPanelWidth] = _react.useState.call(void 0, 0);
|
|
24917
24614
|
_react.useEffect.call(void 0, () => {
|
|
24918
24615
|
if (!panelBoundary || typeof ResizeObserver === "undefined") return void 0;
|
|
24919
24616
|
const ro = new ResizeObserver((entries) => {
|
|
24920
|
-
const w = _optionalChain([entries, 'access',
|
|
24617
|
+
const w = _optionalChain([entries, 'access', _810 => _810[0], 'optionalAccess', _811 => _811.contentRect, 'optionalAccess', _812 => _812.width]);
|
|
24921
24618
|
if (typeof w === "number") setPanelWidth(w);
|
|
24922
24619
|
});
|
|
24923
24620
|
ro.observe(panelBoundary);
|
|
@@ -24934,7 +24631,7 @@ function EmbeddableChatInner({
|
|
|
24934
24631
|
setRailStorageRead(true);
|
|
24935
24632
|
try {
|
|
24936
24633
|
if (window.localStorage.getItem(RAIL_COLLAPSED_STORAGE_KEY) === "1") setRailCollapsed(true);
|
|
24937
|
-
} catch (
|
|
24634
|
+
} catch (e67) {
|
|
24938
24635
|
}
|
|
24939
24636
|
}
|
|
24940
24637
|
const toggleRailCollapsed = _react.useCallback.call(void 0, () => {
|
|
@@ -24942,7 +24639,7 @@ function EmbeddableChatInner({
|
|
|
24942
24639
|
const next = !prev;
|
|
24943
24640
|
try {
|
|
24944
24641
|
window.localStorage.setItem(RAIL_COLLAPSED_STORAGE_KEY, next ? "1" : "0");
|
|
24945
|
-
} catch (
|
|
24642
|
+
} catch (e68) {
|
|
24946
24643
|
}
|
|
24947
24644
|
return next;
|
|
24948
24645
|
});
|
|
@@ -24961,17 +24658,17 @@ function EmbeddableChatInner({
|
|
|
24961
24658
|
const stackedListView = isMingoMode && !hasConversation && !archiveOpen && !wideMingo && !composeOpen && !emptyListSkipped;
|
|
24962
24659
|
const headerShowBack = hasConversation || guideCanReturnToMingo;
|
|
24963
24660
|
const freshConversationTitle = isGuideEmpty ? _nullishCoalesce(headerAssistantName, () => ( "Mingo Guide")) : "New Chat";
|
|
24964
|
-
const headerTitle = hasConversation ? _optionalChain([activeDialog, 'optionalAccess',
|
|
24661
|
+
const headerTitle = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _813 => _813.title]) || freshConversationTitle : isGuideEmpty ? freshConversationTitle : "Current Chats";
|
|
24965
24662
|
const headerBackAriaLabel = hasConversation ? isViewingArchived ? "Back to archive" : "Back" : "Back to Mingo";
|
|
24966
24663
|
const headerOnBack = hasConversation ? handleBack : () => handleActiveModeChange("mingo");
|
|
24967
24664
|
const headerOnRestore = isViewingArchived && unarchiveDialog && activeDialog ? () => setRestoreTarget(activeDialog) : void 0;
|
|
24968
24665
|
const headerOnRename = activeDialogId && activeDialog && mingoCaps.canRename ? () => setRenameTarget(activeDialog) : void 0;
|
|
24969
24666
|
const headerOnArchive = activeDialogId && activeDialog && mingoCaps.canArchive ? () => setArchiveTarget(activeDialog) : void 0;
|
|
24970
|
-
const headerOnCopyLink = activeDialogId && activeDialog && mingoCaps.onCopyLink ? () => _optionalChain([mingoCaps, 'access',
|
|
24667
|
+
const headerOnCopyLink = activeDialogId && activeDialog && mingoCaps.onCopyLink ? () => _optionalChain([mingoCaps, 'access', _814 => _814.onCopyLink, 'optionalCall', _815 => _815(activeDialog)]) : void 0;
|
|
24971
24668
|
const headerOnOpenArchive = fetchArchivedDialogs ? openArchive : void 0;
|
|
24972
|
-
const headerOwner = hasConversation ? _optionalChain([activeDialog, 'optionalAccess',
|
|
24973
|
-
const headerPersonName = _optionalChain([headerOwner, 'optionalAccess',
|
|
24974
|
-
const headerPersonAvatarUrl = headerOwner ? _optionalChain([headerOwner, 'access',
|
|
24669
|
+
const headerOwner = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _816 => _816.owner]) : void 0;
|
|
24670
|
+
const headerPersonName = _optionalChain([headerOwner, 'optionalAccess', _817 => _817.name, 'optionalAccess', _818 => _818.trim, 'call', _819 => _819()]) || headerUserName;
|
|
24671
|
+
const headerPersonAvatarUrl = headerOwner ? _optionalChain([headerOwner, 'access', _820 => _820.avatarUrl, 'optionalAccess', _821 => _821.trim, 'call', _822 => _822()]) || void 0 : _optionalChain([identityUser, 'optionalAccess', _823 => _823.avatarUrl, 'optionalAccess', _824 => _824.trim, 'call', _825 => _825()]) || _optionalChain([userAvatarUrl, 'optionalAccess', _826 => _826.trim, 'call', _827 => _827()]) || void 0;
|
|
24975
24672
|
const headerAvatar = headerPersonName || headerPersonAvatarUrl ? { name: headerPersonName, avatarUrl: headerPersonAvatarUrl } : void 0;
|
|
24976
24673
|
const handleNewChat = _react.useCallback.call(void 0, () => {
|
|
24977
24674
|
resetToNewChat();
|
|
@@ -25226,44 +24923,56 @@ function EmbeddableChatInner({
|
|
|
25226
24923
|
"div",
|
|
25227
24924
|
{
|
|
25228
24925
|
className: "flex min-h-0 flex-1 flex-col duration-200 animate-in fade-in-0",
|
|
25229
|
-
children: hasConversation ? /* @__PURE__ */ _jsxruntime.
|
|
25230
|
-
|
|
25231
|
-
|
|
25232
|
-
|
|
25233
|
-
|
|
25234
|
-
|
|
25235
|
-
|
|
25236
|
-
|
|
25237
|
-
|
|
25238
|
-
|
|
25239
|
-
|
|
25240
|
-
|
|
25241
|
-
|
|
25242
|
-
|
|
25243
|
-
|
|
25244
|
-
|
|
25245
|
-
|
|
25246
|
-
|
|
25247
|
-
|
|
25248
|
-
|
|
25249
|
-
|
|
25250
|
-
|
|
25251
|
-
|
|
25252
|
-
|
|
25253
|
-
|
|
25254
|
-
|
|
25255
|
-
|
|
25256
|
-
|
|
25257
|
-
|
|
25258
|
-
|
|
25259
|
-
|
|
25260
|
-
|
|
25261
|
-
|
|
25262
|
-
|
|
25263
|
-
|
|
25264
|
-
|
|
25265
|
-
|
|
25266
|
-
|
|
24926
|
+
children: hasConversation ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
24927
|
+
messagesInitialLoading ? (
|
|
24928
|
+
// Match the real list's `fullWidth` layout so swapping
|
|
24929
|
+
// skeleton → bubbles doesn't shift the column. The panel
|
|
24930
|
+
// wrapper above already pads (`p-[var(--spacing-system-m)]`),
|
|
24931
|
+
// so the skeleton sits flush (no inner px/pb).
|
|
24932
|
+
//
|
|
24933
|
+
// In `previewMode` the chat lives in a fixed-height host box
|
|
24934
|
+
// (e.g. the Mingo hero demo). The default bottom-anchored
|
|
24935
|
+
// skeleton overflows a short panel and grows its OWN
|
|
24936
|
+
// scrollbar — ugly. `fill` top-anchors + clips overflow so
|
|
24937
|
+
// it reads as "the whole panel is loading" and never scrolls.
|
|
24938
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatMessageListSkeleton, { fullWidth: true, fill: previewMode, className: "flex-1" })
|
|
24939
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
24940
|
+
ChatMessageList,
|
|
24941
|
+
{
|
|
24942
|
+
messages,
|
|
24943
|
+
isTyping: chatLoading,
|
|
24944
|
+
pendingApprovals,
|
|
24945
|
+
autoScroll: !previewMode,
|
|
24946
|
+
pinBottom: previewMode,
|
|
24947
|
+
overscrollContain: !previewMode,
|
|
24948
|
+
assistantType: "mingo",
|
|
24949
|
+
assistantIcon: mingoAssistantIcon,
|
|
24950
|
+
renderEntityCard,
|
|
24951
|
+
resolveContextIcon,
|
|
24952
|
+
renderContextItem,
|
|
24953
|
+
renderMention,
|
|
24954
|
+
onAskSelect: chatLoading || previewMode ? void 0 : handleAskSelect,
|
|
24955
|
+
NavLinkAnchor: NavLinkAnchorViaRuntime,
|
|
24956
|
+
className: previewMode ? "pointer-events-auto flex-1" : "flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
24957
|
+
contentClassName: "max-w-none pb-0",
|
|
24958
|
+
fullWidth: true,
|
|
24959
|
+
hasNextPage: hasMoreMessages,
|
|
24960
|
+
isFetchingNextPage: isMessagesLoading,
|
|
24961
|
+
onLoadMore: loadMoreMessages
|
|
24962
|
+
}
|
|
24963
|
+
),
|
|
24964
|
+
lastSources && (lastSources.cited.length > 0 || lastSources.uncited.length > 0) && !chatLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-shrink-0 pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
24965
|
+
SourceChips,
|
|
24966
|
+
{
|
|
24967
|
+
cited: lastSources.cited,
|
|
24968
|
+
uncited: lastSources.uncited,
|
|
24969
|
+
baseRoute: resolvedBaseRoute,
|
|
24970
|
+
chipBasePlatform,
|
|
24971
|
+
onClose: handleNavigationClose,
|
|
24972
|
+
onDiscuss: discussRef
|
|
24973
|
+
}
|
|
24974
|
+
) })
|
|
24975
|
+
] }) : activeMode === "mingo" ? (
|
|
25267
24976
|
/* Figma node 7532:222444 — default (Mingo-mode) empty state:
|
|
25268
24977
|
centred greeting + capability grid + Guide-chat promo +
|
|
25269
24978
|
quick-action chips. Guide mode keeps the slash-command
|
|
@@ -25289,9 +24998,9 @@ function EmbeddableChatInner({
|
|
|
25289
24998
|
subtitle: _nullishCoalesce(effectiveGreeting, () => ( void 0)),
|
|
25290
24999
|
subtitleLoading: emptyStateLoading,
|
|
25291
25000
|
...guideWelcome,
|
|
25292
|
-
title: _nullishCoalesce(effectiveAssistantName, () => ( _optionalChain([guideWelcome, 'optionalAccess',
|
|
25293
|
-
icon: _nullishCoalesce(effectiveAssistantIcon, () => ( _optionalChain([guideWelcome, 'optionalAccess',
|
|
25294
|
-
quickActions: agentConfigUrl && guideSuggestedActions.length > 0 ? guideSuggestedActions : _nullishCoalesce(_optionalChain([guideWelcome, 'optionalAccess',
|
|
25001
|
+
title: _nullishCoalesce(effectiveAssistantName, () => ( _optionalChain([guideWelcome, 'optionalAccess', _828 => _828.title]))),
|
|
25002
|
+
icon: _nullishCoalesce(effectiveAssistantIcon, () => ( _optionalChain([guideWelcome, 'optionalAccess', _829 => _829.icon]))),
|
|
25003
|
+
quickActions: agentConfigUrl && guideSuggestedActions.length > 0 ? guideSuggestedActions : _nullishCoalesce(_optionalChain([guideWelcome, 'optionalAccess', _830 => _830.quickActions]), () => ( guideSuggestedActions)),
|
|
25295
25004
|
onQuickAction: (action) => {
|
|
25296
25005
|
setQuickActionPreview(null);
|
|
25297
25006
|
handleSend(_nullishCoalesce(action.prompt, () => ( action.label)));
|
|
@@ -25365,8 +25074,8 @@ function EmbeddableChatInner({
|
|
|
25365
25074
|
selectedContextItems: contextItems,
|
|
25366
25075
|
onToggleContextItem: toggleContextItem,
|
|
25367
25076
|
onRemoveContextItem: removeContextItem,
|
|
25368
|
-
contextMemoryItems: _optionalChain([contextMemory, 'optionalAccess',
|
|
25369
|
-
onRemoveContextMemoryItem: _optionalChain([contextMemory, 'optionalAccess',
|
|
25077
|
+
contextMemoryItems: _optionalChain([contextMemory, 'optionalAccess', _831 => _831.items]),
|
|
25078
|
+
onRemoveContextMemoryItem: _optionalChain([contextMemory, 'optionalAccess', _832 => _832.onRemove]),
|
|
25370
25079
|
contextPickerOpen,
|
|
25371
25080
|
onOpenContextPicker: openContextPicker,
|
|
25372
25081
|
onCloseContextPicker: closeContextPicker,
|
|
@@ -25832,4 +25541,4 @@ function EmbeddableChatInner({
|
|
|
25832
25541
|
|
|
25833
25542
|
|
|
25834
25543
|
exports.FloatingTooltip = FloatingTooltip; exports.tagVariants = tagVariants; exports.Tag = Tag; exports.formatTicketRelativeTime = formatTicketRelativeTime; exports.formatTicketFullTimestamp = formatTicketFullTimestamp; exports.formatRelativeTime = formatRelativeTime; exports.formatAbsoluteDate = formatAbsoluteDate; exports.formatDateTime = formatDateTime; exports.getDetailedTimeDifference = getDetailedTimeDifference; exports.isToday = isToday; exports.isWithinMinutes = isWithinMinutes; exports.createUTCTimestamp = createUTCTimestamp; exports.DESIGN_PALETTE = DESIGN_PALETTE; exports.getContrastRatio = getContrastRatio; exports.pickReadableTextColor = pickReadableTextColor; exports.extractDominantColor = extractDominantColor; exports.getBestContrastColor = getBestContrastColor; exports.analyzeImageColor = analyzeImageColor; exports.extractImageEdgeColorAsync = extractImageEdgeColorAsync; exports.getCurrentPlatform = getCurrentPlatform; exports.switchPlatformTheme = switchPlatformTheme; exports.getSemanticColor = getSemanticColor; exports.getPlatformConfig = getPlatformConfig; exports.usePlatformColors = usePlatformColors; exports.getReadableTextColor = getReadableTextColor; exports.HEX_PATTERN = HEX_PATTERN; exports.hexToRgb = hexToRgb2; exports.rgbToHex = rgbToHex; exports.deriveHoverColor = deriveHoverColor; exports.deriveActiveColor = deriveActiveColor; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.ActionsMenu = ActionsMenu; exports.ActionsMenuDropdown = ActionsMenuDropdown; exports.ColorSwatch = ColorSwatch; exports.TooltipProvider = TooltipProvider; exports.Tooltip = Tooltip; exports.TooltipTrigger = TooltipTrigger; exports.TooltipContent = TooltipContent; exports.resolveTicketStatus = resolveTicketStatus; exports.getTicketStatusConfig = getTicketStatusConfig; exports.getTicketStatusTag = getTicketStatusTag; exports.kindToCanonicalStatus = kindToCanonicalStatus; exports.usesCanonicalStatusStyle = usesCanonicalStatusStyle; exports.resolveStatusTagProps = resolveStatusTagProps; exports.TicketStatusTag = TicketStatusTag; exports.useScrollFade = useScrollFade; exports.ScrollFadeOverlay = ScrollFadeOverlay; exports.ScrollShadow = ScrollShadow; exports.Modal = Modal; exports.ModalContent = ModalContent; exports.ModalTwoColumn = ModalTwoColumn; exports.ModalHeader = ModalHeader; exports.ModalTitle = ModalTitle; exports.ModalFooter = ModalFooter; exports.OVERLAY_BACKDROP_CLASS = OVERLAY_BACKDROP_CLASS; exports.Drawer = Drawer; exports.DrawerTrigger = DrawerTrigger; exports.DrawerClose = DrawerClose; exports.DrawerPortal = DrawerPortal; exports.DrawerOverlay = DrawerOverlay; exports.DrawerContent = DrawerContent; exports.DrawerHeader = DrawerHeader; exports.DrawerTitle = DrawerTitle; exports.DrawerDescription = DrawerDescription; exports.DrawerBody = DrawerBody; exports.DrawerFooter = DrawerFooter; exports.Tabs = Tabs; exports.TabsList = TabsList; exports.TabsTrigger = TabsTrigger; exports.TabsContent = TabsContent; exports.stripInlineMarkdown = stripInlineMarkdown; exports.markdownToPlainText = markdownToPlainText; exports.buildHeadingIdMap = buildHeadingIdMap; exports.useHeadingIdMap = useHeadingIdMap; exports.extractText = extractText; exports.useIsHydrated = useIsHydrated; exports.MermaidDiagram = MermaidDiagram; exports.hasRenderableSrc = hasRenderableSrc; exports.buildStandardLeafRenderers = buildStandardLeafRenderers; exports.SAFE_HTML_TAGS = SAFE_HTML_TAGS; exports.SVG_TAGS = SVG_TAGS; exports.buildEffectiveTagSet = buildEffectiveTagSet; exports.buildSanitizeSchema = buildSanitizeSchema; exports.rehypeStripUnsafe = rehypeStripUnsafe; exports.escapeUnknownHtmlTags = escapeUnknownHtmlTags; exports.cardAwareUrlTransform = cardAwareUrlTransform; exports.splitStreamingBlocks = splitStreamingBlocks; exports.completeStreamingTail = completeStreamingTail; exports.TEXT_SIZE_PRESETS = TEXT_SIZE_PRESETS; exports.resolveTextSizeConfig = resolveTextSizeConfig; exports.NO_BROKEN_LINKS = NO_BROKEN_LINKS; exports.MarkdownEngine = MarkdownEngine; exports.SimpleMarkdownRenderer = SimpleMarkdownRenderer; exports.fetchPriorityProp = fetchPriorityProp; exports.MUX_STREAM_ORIGIN = MUX_STREAM_ORIGIN; exports.MUX_IMAGE_ORIGIN = MUX_IMAGE_ORIGIN; exports.saveDataEnabled = saveDataEnabled; exports.useVideoOriginPreconnect = useVideoOriginPreconnect; exports.useVideoWarmup = useVideoWarmup; exports.VideoPlayBadge = VideoPlayBadge; exports.VideoUnmuteGlyph = VideoUnmuteGlyph; exports.extractYouTubeId = extractYouTubeId; exports.VIDEO_PLAYBACK_FAILED_EVENT = VIDEO_PLAYBACK_FAILED_EVENT; exports.Video = Video2; exports.HoverDropdown = HoverDropdown; exports.ExpandChevron = ExpandChevron; exports.useCollapsible = useCollapsible; exports.getCommandText = getCommandText; exports.ArgRow = ArgRow; exports.ResultBlock = ResultBlock; exports.CommandBlock = CommandBlock; exports.ApprovalStatusTag = ApprovalStatusTag; exports.ApprovalBatchMessage = ApprovalBatchMessage; exports.ApprovalRequestMessage = ApprovalRequestMessage; exports.EscalationOfferMessage = EscalationOfferMessage; exports.formatTime = formatTime; exports.AiAssistantInfo = AiAssistantInfo; exports.TicketEscalatedMessage = TicketEscalatedMessage; exports.MESSAGE_TYPE = MESSAGE_TYPE; exports.SCROLL_ANCHOR = SCROLL_ANCHOR; exports.TICKET_EVENT_KIND = TICKET_EVENT_KIND; exports.TicketEventMessage = TicketEventMessage; exports.ContextCompactionDisplay = ContextCompactionDisplay; exports.ThinkingDisplay = ThinkingDisplay; exports.AskDisplay = AskDisplay; exports.ErrorMessageDisplay = ErrorMessageDisplay; exports.MspOrganizationCard = MspOrganizationCard; exports.MspOrganizationCardSkeleton = MspOrganizationCardSkeleton; exports.ChatContainer = ChatContainer; exports.ChatHeader = ChatHeader; exports.ChatContent = ChatContent; exports.ChatFooter = ChatFooter; exports.ChatTypingIndicator = ChatTypingIndicator; exports.MingoOnboardingCard = MingoOnboardingCard; exports.ICON_REGISTRY = ICON_REGISTRY; exports.normalizeIconKey = normalizeIconKey; exports.getIconComponent = getIconComponent; exports.getDynamicIcon = getDynamicIcon; exports.ICON_ALIASES = ICON_ALIASES; exports.resolveIcon = resolveIcon; exports.ICON_OPTIONS = ICON_OPTIONS; exports.SlashCommandSuggestions = SlashCommandSuggestions; exports.ChatInput = ChatInput; exports.CONTEXT_ROW_CLASS = CONTEXT_ROW_CLASS; exports.CONTEXT_ICON_CLASS = CONTEXT_ICON_CLASS; exports.CONTEXT_LABEL_CLASS = CONTEXT_LABEL_CLASS; exports.CONTEXT_BACK_CLASS = CONTEXT_BACK_CLASS; exports.CONTEXT_STATE_CLASS = CONTEXT_STATE_CLASS; exports.ContextMenuRow = ContextMenuRow; exports.ContextItemsSkeleton = ContextItemsSkeleton; exports.ContextItemsList = ContextItemsList; exports.ContextErrorBoundary = ContextErrorBoundary; exports.CHAT_CONTEXT_ITEMS_DEFAULT_MAX = CHAT_CONTEXT_ITEMS_DEFAULT_MAX; exports.ChatComposerPlusMenu = ChatComposerPlusMenu; exports.ChatContextPicker = ChatContextPicker; exports.ChatContextChipStrip = ChatContextChipStrip; exports.BlockCard = BlockCard; exports.remarkCardLinks = remarkCardLinks; exports.remarkMentionChips = remarkMentionChips; exports.ToolExecutionDisplay = ToolExecutionDisplay; exports.MemoizedChatMessageEnhanced = MemoizedChatMessageEnhanced; exports.ChatMessageSkeleton = ChatMessageSkeleton; exports.ChatMessageListSkeleton = ChatMessageListSkeleton; exports.ChatMessageList = ChatMessageList; exports.useProxiedImageUrl = useProxiedImageUrl; exports.ChatMessageRow = ChatMessageRow; exports.ChatMessageRowSkeleton = ChatMessageRowSkeleton; exports.FAE_AVATAR_DATA_URI = FAE_AVATAR_DATA_URI; exports.AgentMark = AgentMark; exports.EntityIcon = EntityIcon; exports.getAgentAccent = getAgentAccent; exports.accentFromIdentityIcon = accentFromIdentityIcon; exports.isQuickActionIconSpec = isQuickActionIconSpec; exports.renderQuickActionIcon = renderQuickActionIcon; exports.QuickActionChipSkeleton = QuickActionChipSkeleton; exports.QuickActionChipButton = QuickActionChipButton; exports.QuickActionChipFromData = QuickActionChipFromData; exports.useMarqueeSync = useMarqueeSync; exports.getMarqueeTrackOffset = getMarqueeTrackOffset; exports.getMarqueeAppliedOffset = getMarqueeAppliedOffset; exports.getMarqueeCloneTwin = getMarqueeCloneTwin; exports.MarqueeWallFades = MarqueeWallFades; exports.MarqueeWall = MarqueeWall; exports.WALL_SKELETON_LABEL_CH = WALL_SKELETON_LABEL_CH; exports.interleave = interleave; exports.QuickActionWall = QuickActionWall; exports.QuickActionMarquee = QuickActionMarquee; exports.ChatTicketItem = ChatTicketItem; exports.ChatTicketList = ChatTicketList; exports.MingoOnboardingCardSkeleton = MingoOnboardingCardSkeleton; exports.MingoOnboardingListSkeleton = MingoOnboardingListSkeleton; exports.MingoChatHistorySkeleton = MingoChatHistorySkeleton; exports.MingoChatHistory = MingoChatHistory; exports.MingoWelcome = MingoWelcome; exports.GuideWelcome = GuideWelcome; exports.GuideModeBanner = GuideModeBanner; exports.TabSelector = TabSelector; exports.MingoHistoryRail = MingoHistoryRail; exports.RenameChatModal = RenameChatModal; exports.ArchiveChatModal = ArchiveChatModal; exports.UnarchiveChatModal = UnarchiveChatModal; exports.ChatDialogModals = ChatDialogModals; exports.ChatHeaderIconButton = ChatHeaderIconButton; exports.ChatHeaderSearchField = ChatHeaderSearchField; exports.ChatPanelHeader = ChatPanelHeader; exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX = CHAT_ATTACHMENT_VIEW_URL_PREFIX; exports.CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM = CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM; exports.ANTHROPIC_SUPPORTED_IMAGE_MIME = ANTHROPIC_SUPPORTED_IMAGE_MIME; exports.buildChatAttachmentViewUrl = buildChatAttachmentViewUrl; exports.escapeMarkdownInline = escapeMarkdownInline; exports.formatChatAttachmentMarkdownForBubble = formatChatAttachmentMarkdownForBubble; exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED = CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED; exports.CHAT_ATTACHMENT_MARKDOWN_PATTERN = CHAT_ATTACHMENT_MARKDOWN_PATTERN; exports.stripChatAttachmentMarkdown = stripChatAttachmentMarkdown; exports.CHAT_ATTACHMENT_MIME_TYPES = CHAT_ATTACHMENT_MIME_TYPES; exports.CHAT_ATTACHMENT_CONCURRENT_UPLOADS_PER_USER = CHAT_ATTACHMENT_CONCURRENT_UPLOADS_PER_USER; exports.ChatAttachmentAddButton = ChatAttachmentAddButton; exports.ChatAttachmentChipStrip = ChatAttachmentChipStrip; exports.ChatContextMemoryBar = ChatContextMemoryBar; exports.HoverCard = HoverCard; exports.HoverCardTrigger = HoverCardTrigger; exports.HoverCardContent = HoverCardContent; exports.ModelDisplay = ModelDisplay; exports.ModelDisplaySkeleton = ModelDisplaySkeleton; exports.ChatComposer = ChatComposer; exports.ChatArchivePage = ChatArchivePage; exports.DialogListItem = DialogListItem; exports.ChatSidebar = ChatSidebar; exports.NEW_TAB_FEATURES = NEW_TAB_FEATURES; exports.isModifierClick = isModifierClick; exports.stripSameOriginToPath = stripSameOriginToPath; exports.resolveExternalNavigation = resolveExternalNavigation; exports.executeNavigation = executeNavigation; exports.executeNavigationImperative = executeNavigationImperative; exports.handleChatNavClick = handleChatNavClick; exports.NavLinkAnchorViaRuntime = NavLinkAnchorViaRuntime; exports.SourceActionButton = SourceActionButton; exports.getCaptionsUrl = getCaptionsUrl; exports.rebaseCaptionsUrl = rebaseCaptionsUrl; exports.buildCaptionsUrl = buildCaptionsUrl; exports.getEntityCaptionUrls = getEntityCaptionUrls; exports.getEntityCaptionUrlsById = getEntityCaptionUrlsById; exports.captionsEntityTypeForDocType = captionsEntityTypeForDocType; exports.PAGE_HEADING_CLASS = PAGE_HEADING_CLASS; exports.SECTION_HEADING_CLASS = SECTION_HEADING_CLASS; exports.PageHeading = PageHeading; exports.useCaptions = useCaptions; exports.UserDisplay = UserDisplay; exports.CardHitLayer = CardHitLayer; exports.STRIP_CELL_MAX_WIDTH = STRIP_CELL_MAX_WIDTH; exports.CardsStrip = CardsStrip; exports.VideoHoverPreviewSurface = VideoHoverPreviewSurface; exports.RATIO_GRID_CLASS = RATIO_GRID_CLASS; exports.RATIO_TO_CSS_ASPECT = RATIO_TO_CSS_ASPECT; exports.RatioTabs = RatioTabs; exports.detectAspectRatio = detectAspectRatio; exports.ratioToCategory = ratioToCategory; exports.groupByAspectRatio = groupByAspectRatio; exports.VideoBitesStrip = VideoBitesStrip; exports.VideoBiteCard = VideoBiteCard; exports.EntityVideoSection = EntityVideoSection; exports.ChatVideoEntityCard = ChatVideoEntityCard; exports.GitHubActivityCard = GitHubActivityCard; exports.GitHubActivityCardSkeleton = GitHubActivityCardSkeleton; exports.SlackMessageCard = SlackMessageCard; exports.SlackMessageCardSkeleton = SlackMessageCardSkeleton; exports.HubspotTicketCard = HubspotTicketCard; exports.HubspotTicketCardSkeleton = HubspotTicketCardSkeleton; exports.DataRoomDocCard = DataRoomDocCard; exports.DataRoomDocCardSkeleton = DataRoomDocCardSkeleton; exports.CampaignCardAdmin = CampaignCardAdmin; exports.CampaignCardAdminSkeleton = CampaignCardAdminSkeleton; exports.GenericEntityCard = GenericEntityCard; exports.GenericEntityCardSkeleton = GenericEntityCardSkeleton; exports.faqSectionSlug = faqSectionSlug; exports.faqItemAnchor = faqItemAnchor; exports.parseFaqHash = parseFaqHash; exports.useChatCardItem = useChatCardItem; exports.clickupTaskUrl = clickupTaskUrl; exports.readFetchedCardTitle = readFetchedCardTitle; exports.resolveFetchedCardHref = resolveFetchedCardHref; exports.SOURCE_ICON_NAMES = SOURCE_ICON_NAMES; exports.getSourceIconName = getSourceIconName; exports.SOURCE_LABELS_BY_TABLE = SOURCE_LABELS_BY_TABLE; exports.getSourceLabel = getSourceLabel; exports.DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID = DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID; exports.defaultTableIdForDocumentType = defaultTableIdForDocumentType; exports.resolveSourceRowCTA = resolveSourceRowCTA; exports.resolveSourceIcon = resolveSourceIcon; exports.ChatCardLoader = ChatCardLoader; exports.renderChatInlineEntityCard = renderChatInlineEntityCard; exports.CHAT_TYPE = CHAT_TYPE; exports.OWNER_TYPE = OWNER_TYPE; exports.MESSAGE_ROLE = MESSAGE_ROLE; exports.ASSISTANT_TYPE = ASSISTANT_TYPE; exports.AUTHOR_TYPE = AUTHOR_TYPE; exports.APPROVAL_STATUS = APPROVAL_STATUS; exports.APPROVAL_BLOCK_VARIANT = APPROVAL_BLOCK_VARIANT; exports.CONNECTION_STATUS = CONNECTION_STATUS; exports.isStructuredContent = isStructuredContent; exports.normalizeContent = normalizeContent2; exports.NETWORK_CONFIG = NETWORK_CONFIG; exports.EMPTY_DIALOG_CAPABILITIES = EMPTY_DIALOG_CAPABILITIES; exports.useChunkCatchup = useChunkCatchup; exports.useScriptedStream = useScriptedStream; exports.RESYNC_AFTER_HIDDEN_MS = RESYNC_AFTER_HIDDEN_MS; exports.useJetStreamDialogSubscription = useJetStreamDialogSubscription; exports.useNatsDialogSubscription = useNatsDialogSubscription; exports.buildNatsWsUrl = buildNatsWsUrl; exports.fetchSlashCommands = fetchSlashCommands; exports.useSlashCommands = useSlashCommands; exports.useSlashCommandRegistry = useSlashCommandRegistry; exports.fetchEmptyStateConfig = fetchEmptyStateConfig; exports.useEmptyStateConfig = useEmptyStateConfig; exports.useChatAttachments = useChatAttachments; exports.useChatAttachmentImageGallery = useChatAttachmentImageGallery; exports.ChatIdentityProvider = ChatIdentityProvider; exports.useChatIdentity = useChatIdentity; exports.useCloseOnNavigation = useCloseOnNavigation; exports.useSSE = useSSE; exports.useChat = useChat; exports.approvalDisplaysInline = approvalDisplaysInline; exports.appendToTrailingAssistant = appendToTrailingAssistant; exports.upsertTrailingCompaction = upsertTrailingCompaction; exports.applyToolExecutionToMessages = applyToolExecutionToMessages; exports.MessageSegmentAccumulator = MessageSegmentAccumulator; exports.createMessageSegmentAccumulator = createMessageSegmentAccumulator; exports.SCROLL_ANCHOR_WIRE_KEY = SCROLL_ANCHOR_WIRE_KEY; exports.parseScrollAnchor = parseScrollAnchor; exports.createEmptyTurnMeta = createEmptyTurnMeta; exports.createChatStreamReducer = createChatStreamReducer; exports.DEFAULT_DIALOG_SIDE = DEFAULT_DIALOG_SIDE; exports.DEFAULT_MAX_REDUCERS = DEFAULT_MAX_REDUCERS; exports.MAX_PENDING_RETAIN_KEYS = MAX_PENDING_RETAIN_KEYS; exports.createChatDialogStore = createChatDialogStore; exports.createDeltaBatcher = createDeltaBatcher; exports.useChatStreamReducer = useChatStreamReducer; exports.createChatConversationsApi = createChatConversationsApi; exports.parseWireCommandOverride = parseWireCommandOverride; exports.sanitizeTitleForChat = sanitizeTitleForChat; exports.formatSingularLookupInvocation = formatSingularLookupInvocation; exports.extractEntityIdFilter = extractEntityIdFilter; exports.buildDiscussAddendum = buildDiscussAddendum; exports.buildDiscussPrompt = buildDiscussPrompt; exports.AUTO_CONTINUATION_DIRECTIVE_PREFIX = AUTO_CONTINUATION_DIRECTIVE_PREFIX; exports.buildAutoContinuationDirective = buildAutoContinuationDirective; exports.useManagedDialogList = useManagedDialogList; exports.useSseChatAdapter = useSseChatAdapter; exports.extractIncompleteMessageState = extractIncompleteMessageState; exports.extractIncompleteTailState = extractIncompleteTailState; exports.decodeHistoricalMessageData = decodeHistoricalMessageData; exports.processHistoricalMessages = processHistoricalMessages; exports.extractErrorMessages = extractErrorMessages; exports.processHistoricalMessagesWithErrors = processHistoricalMessagesWithErrors; exports.mapProcessedToUnified = mapProcessedToUnified; exports.historicalToUnified = historicalToUnified; exports.useNatsChatAdapter = useNatsChatAdapter; exports.useStableShallow = useStableShallow; exports.useUnifiedChat = useUnifiedChat; exports.SYNTHETIC_REALTIME_ID_PREFIXES = SYNTHETIC_REALTIME_ID_PREFIXES; exports.flattenMessagePagesChronological = flattenMessagePagesChronological; exports.maxPersistedStreamSeq = maxPersistedStreamSeq; exports.mergeHistoryWithRealtime = mergeHistoryWithRealtime; exports.computeHistoryPrepend = computeHistoryPrepend; exports.CHIP_ACTION_BUTTON_CLASS = CHIP_ACTION_BUTTON_CLASS; exports.chatChipClass = chatChipClass; exports.flattenAssistantContent = flattenAssistantContent; exports.normalizeHistoricalMessageData = normalizeHistoricalMessageData; exports.isHistoricalUserTurn = isHistoricalUserTurn; exports.buildStreamFrames = buildStreamFrames; exports.EmbeddableChat = EmbeddableChat;
|
|
25835
|
-
//# sourceMappingURL=chunk-
|
|
25544
|
+
//# sourceMappingURL=chunk-XNDTYTVT.cjs.map
|