@multiplayer-app/ai-agent-react 0.1.0-beta.97 → 0.1.0-beta.99
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/ai-agent-react.cjs.js +54 -54
- package/dist/ai-agent-react.cjs.js.map +1 -1
- package/dist/ai-agent-react.es.js +493 -434
- package/dist/ai-agent-react.es.js.map +1 -1
- package/dist/components/ChatWindow/MessageList/Message/ReasoningPanel.d.ts.map +1 -1
- package/dist/components/ChatWindow/MessageList/MessageGroup.d.ts.map +1 -1
- package/dist/components/ChatWindow/MessageList/ToolCallCard/ToolCallCard.d.ts +1 -1
- package/dist/components/ChatWindow/MessageList/ToolCallCard/ToolCallCard.d.ts.map +1 -1
- package/dist/config/types.d.ts +26 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useChatMetadata.d.ts +20 -0
- package/dist/hooks/useChatMetadata.d.ts.map +1 -0
- package/dist/hooks/useChatSendController.d.ts.map +1 -1
- package/dist/runtime/AgentRuntime.d.ts +16 -1
- package/dist/runtime/AgentRuntime.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as B } from "zod";
|
|
2
2
|
import { jsx as C, Fragment as en, jsxs as oe } from "react/jsx-runtime";
|
|
3
3
|
import * as ee from "react";
|
|
4
|
-
import rr, { forwardRef as co, createElement as id, useMemo as lt, useState as et, useEffect as $e, useLayoutEffect as uo, memo as Rt, useCallback as
|
|
4
|
+
import rr, { forwardRef as co, createElement as id, useMemo as lt, useState as et, useEffect as $e, useLayoutEffect as uo, memo as Rt, useCallback as Ye, useRef as ze, createContext as Zd, useContext as Xd, useImperativeHandle as E7, isValidElement as x5 } from "react";
|
|
5
5
|
import { useInfiniteQuery as Qd, useQuery as fr, useQueryClient as E5, useMutation as Gh, QueryClient as M7, QueryClientProvider as S7 } from "@tanstack/react-query";
|
|
6
6
|
import { create as N7, useStore as A7 } from "zustand";
|
|
7
7
|
import { nanoid as At } from "nanoid";
|
|
@@ -106,6 +106,8 @@ const C7 = B.object({
|
|
|
106
106
|
includeTitle: B.boolean().optional(),
|
|
107
107
|
name: B.string().optional()
|
|
108
108
|
}).optional(),
|
|
109
|
+
// getMetadata is a function, stripped by Zod and re-attached in AgentRuntime.
|
|
110
|
+
chatMetadata: B.object({}).optional(),
|
|
109
111
|
defaultContextKey: B.string().optional(),
|
|
110
112
|
messagesPageSize: B.number().int().positive().max(200).optional(),
|
|
111
113
|
translations: B.object({
|
|
@@ -221,10 +223,10 @@ var qi;
|
|
|
221
223
|
(function(e) {
|
|
222
224
|
e.Asc = "asc", e.Desc = "desc";
|
|
223
225
|
})(qi || (qi = {}));
|
|
224
|
-
var
|
|
226
|
+
var Ze;
|
|
225
227
|
(function(e) {
|
|
226
228
|
e.System = "system", e.User = "user", e.Assistant = "assistant", e.Tool = "tool", e.Reasoning = "reasoning", e.Error = "error";
|
|
227
|
-
})(
|
|
229
|
+
})(Ze || (Ze = {}));
|
|
228
230
|
var kt;
|
|
229
231
|
(function(e) {
|
|
230
232
|
e.File = "file", e.Link = "link", e.Artifact = "artifact", e.Context = "context";
|
|
@@ -949,7 +951,7 @@ class Zo {
|
|
|
949
951
|
const n = await xt.getMessages(t);
|
|
950
952
|
if (!n.length)
|
|
951
953
|
return;
|
|
952
|
-
const r = n.filter((a) => a.role !==
|
|
954
|
+
const r = n.filter((a) => a.role !== Ze.Error);
|
|
953
955
|
r.length !== n.length && await xt.saveMessages(t, r);
|
|
954
956
|
}
|
|
955
957
|
async appendErrorMessage(t, n) {
|
|
@@ -957,7 +959,7 @@ class Zo {
|
|
|
957
959
|
id: At(),
|
|
958
960
|
chat: t,
|
|
959
961
|
content: n,
|
|
960
|
-
role:
|
|
962
|
+
role: Ze.Error,
|
|
961
963
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
962
964
|
reasoning: "",
|
|
963
965
|
toolCalls: [],
|
|
@@ -1007,7 +1009,7 @@ class Zo {
|
|
|
1007
1009
|
}
|
|
1008
1010
|
toOpenAIMessage(t) {
|
|
1009
1011
|
return {
|
|
1010
|
-
role: t.role ===
|
|
1012
|
+
role: t.role === Ze.Reasoning ? Ze.Assistant : t.role,
|
|
1011
1013
|
content: t.content
|
|
1012
1014
|
};
|
|
1013
1015
|
}
|
|
@@ -1074,7 +1076,7 @@ class Zo {
|
|
|
1074
1076
|
const r = await xt.getMessages(n.id), a = {
|
|
1075
1077
|
id: At(),
|
|
1076
1078
|
chat: n.id,
|
|
1077
|
-
role:
|
|
1079
|
+
role: Ze.User,
|
|
1078
1080
|
content: t.content,
|
|
1079
1081
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1080
1082
|
attachments: t.attachments ?? [],
|
|
@@ -1085,7 +1087,7 @@ class Zo {
|
|
|
1085
1087
|
const o = await this.callModel(i, t.model, t.contextKey), s = {
|
|
1086
1088
|
id: At(),
|
|
1087
1089
|
chat: n.id,
|
|
1088
|
-
role:
|
|
1090
|
+
role: Ze.Assistant,
|
|
1089
1091
|
content: o,
|
|
1090
1092
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1091
1093
|
reasoning: "",
|
|
@@ -1107,7 +1109,7 @@ class Zo {
|
|
|
1107
1109
|
const s = {
|
|
1108
1110
|
id: At(),
|
|
1109
1111
|
chat: i.id,
|
|
1110
|
-
role:
|
|
1112
|
+
role: Ze.User,
|
|
1111
1113
|
content: t.content,
|
|
1112
1114
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1113
1115
|
attachments: t.attachments
|
|
@@ -1150,7 +1152,7 @@ class Zo {
|
|
|
1150
1152
|
const w = {
|
|
1151
1153
|
id: At(),
|
|
1152
1154
|
chat: i.id,
|
|
1153
|
-
role:
|
|
1155
|
+
role: Ze.Assistant,
|
|
1154
1156
|
content: "",
|
|
1155
1157
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1156
1158
|
};
|
|
@@ -29897,8 +29899,8 @@ function pp(e, t) {
|
|
|
29897
29899
|
Array.from(N).every((fe) => !Nr(K, fe)))
|
|
29898
29900
|
return;
|
|
29899
29901
|
if (Ct(D) && Q) {
|
|
29900
|
-
const fe = Hn(D), ke = mn(D), Ce = /auto|scroll/,
|
|
29901
|
-
if (He ||
|
|
29902
|
+
const fe = Hn(D), ke = mn(D), Ce = /auto|scroll/, qe = fe || Ce.test(ke.overflowX), ot = fe || Ce.test(ke.overflowY), We = qe && D.clientWidth > 0 && D.scrollWidth > D.clientWidth, re = ot && D.clientHeight > 0 && D.scrollHeight > D.clientHeight, Se = ke.direction === "rtl", He = re && (Se ? W.offsetX <= D.offsetWidth - D.clientWidth : W.offsetX > D.clientWidth), Xe = We && W.offsetY > D.clientHeight;
|
|
29903
|
+
if (He || Xe)
|
|
29902
29904
|
return;
|
|
29903
29905
|
}
|
|
29904
29906
|
const J = (R = i.current.floatingContext) == null ? void 0 : R.nodeId, O = f && ka(f.nodesRef.current, J).some((fe) => {
|
|
@@ -30287,7 +30289,7 @@ function t7e(e, t) {
|
|
|
30287
30289
|
}, [e, E]);
|
|
30288
30290
|
const R = Qt(() => {
|
|
30289
30291
|
l(D.current === -1 ? null : D.current);
|
|
30290
|
-
}), H = U6e(a.domReference), V = ee.useRef(w), D = ee.useRef(d ?? -1), j = ee.useRef(null), N = ee.useRef(!0), K = ee.useRef(R), J = ee.useRef(!!a.floating), O = ee.useRef(n), le = ee.useRef(!1), fe = ee.useRef(!1), ke = Bn(v), Ce = Bn(n),
|
|
30292
|
+
}), H = U6e(a.domReference), V = ee.useRef(w), D = ee.useRef(d ?? -1), j = ee.useRef(null), N = ee.useRef(!0), K = ee.useRef(R), J = ee.useRef(!!a.floating), O = ee.useRef(n), le = ee.useRef(!1), fe = ee.useRef(!1), ke = Bn(v), Ce = Bn(n), qe = Bn(z), ot = Bn(d), [We, re] = ee.useState(), [Se, He] = ee.useState(), Xe = Qt(() => {
|
|
30291
30293
|
function ce(q) {
|
|
30292
30294
|
if (f) {
|
|
30293
30295
|
var Z;
|
|
@@ -30298,13 +30300,13 @@ function t7e(e, t) {
|
|
|
30298
30300
|
preventScroll: !0
|
|
30299
30301
|
});
|
|
30300
30302
|
}
|
|
30301
|
-
const
|
|
30302
|
-
|
|
30303
|
-
const q = o.current[D.current] ||
|
|
30303
|
+
const we = o.current[D.current], be = fe.current;
|
|
30304
|
+
we && ce(we), (le.current ? (q) => q() : requestAnimationFrame)(() => {
|
|
30305
|
+
const q = o.current[D.current] || we;
|
|
30304
30306
|
if (!q)
|
|
30305
30307
|
return;
|
|
30306
|
-
|
|
30307
|
-
const Z =
|
|
30308
|
+
we || ce(q);
|
|
30309
|
+
const Z = qe.current;
|
|
30308
30310
|
Z && ve && (be || !N.current) && (q.scrollIntoView == null || q.scrollIntoView(typeof Z == "boolean" ? {
|
|
30309
30311
|
block: "nearest",
|
|
30310
30312
|
inline: "nearest"
|
|
@@ -30318,28 +30320,28 @@ function t7e(e, t) {
|
|
|
30318
30320
|
if (s == null) {
|
|
30319
30321
|
if (le.current = !1, ot.current != null)
|
|
30320
30322
|
return;
|
|
30321
|
-
if (J.current && (D.current = -1,
|
|
30323
|
+
if (J.current && (D.current = -1, Xe()), (!O.current || !J.current) && V.current && (j.current != null || V.current === !0 && j.current == null)) {
|
|
30322
30324
|
let ce = 0;
|
|
30323
|
-
const
|
|
30324
|
-
o.current[0] == null ? (ce < 2 && (ce ? requestAnimationFrame : queueMicrotask)(
|
|
30325
|
+
const we = () => {
|
|
30326
|
+
o.current[0] == null ? (ce < 2 && (ce ? requestAnimationFrame : queueMicrotask)(we), ce++) : (D.current = j.current == null || cs(j.current, E, g) || h ? es(o, ke.current) : i2(o, ke.current), j.current = null, R());
|
|
30325
30327
|
};
|
|
30326
|
-
|
|
30328
|
+
we();
|
|
30327
30329
|
}
|
|
30328
30330
|
} else
|
|
30329
|
-
va(o, s) || (D.current = s,
|
|
30330
|
-
}, [u, n, a.floating, s, ot, h, o, E, g, R,
|
|
30331
|
+
va(o, s) || (D.current = s, Xe(), fe.current = !1);
|
|
30332
|
+
}, [u, n, a.floating, s, ot, h, o, E, g, R, Xe, ke]), Et(() => {
|
|
30331
30333
|
var ce;
|
|
30332
30334
|
if (!u || a.floating || !W || f || !J.current)
|
|
30333
30335
|
return;
|
|
30334
|
-
const
|
|
30336
|
+
const we = W.nodesRef.current, be = (ce = we.find((Z) => Z.id === Q)) == null || (ce = ce.context) == null ? void 0 : ce.elements.floating, Be = Na(_n(a.floating)), q = we.some((Z) => Z.context && Nr(Z.context.elements.floating, Be));
|
|
30335
30337
|
be && !q && N.current && be.focus({
|
|
30336
30338
|
preventScroll: !0
|
|
30337
30339
|
});
|
|
30338
30340
|
}, [u, a.floating, W, Q, f]), Et(() => {
|
|
30339
30341
|
if (!u || !W || !f || Q)
|
|
30340
30342
|
return;
|
|
30341
|
-
function ce(
|
|
30342
|
-
He(
|
|
30343
|
+
function ce(we) {
|
|
30344
|
+
He(we.id), P && (P.current = we);
|
|
30343
30345
|
}
|
|
30344
30346
|
return W.events.on("virtualfocus", ce), () => {
|
|
30345
30347
|
W.events.off("virtualfocus", ce);
|
|
@@ -30353,36 +30355,36 @@ function t7e(e, t) {
|
|
|
30353
30355
|
function ce(be) {
|
|
30354
30356
|
if (!Ce.current)
|
|
30355
30357
|
return;
|
|
30356
|
-
const
|
|
30357
|
-
|
|
30358
|
+
const Be = o.current.indexOf(be);
|
|
30359
|
+
Be !== -1 && D.current !== Be && (D.current = Be, R());
|
|
30358
30360
|
}
|
|
30359
30361
|
return {
|
|
30360
30362
|
onFocus(be) {
|
|
30361
30363
|
let {
|
|
30362
|
-
currentTarget:
|
|
30364
|
+
currentTarget: Be
|
|
30363
30365
|
} = be;
|
|
30364
|
-
le.current = !0, ce(
|
|
30366
|
+
le.current = !0, ce(Be);
|
|
30365
30367
|
},
|
|
30366
30368
|
onClick: (be) => {
|
|
30367
30369
|
let {
|
|
30368
|
-
currentTarget:
|
|
30370
|
+
currentTarget: Be
|
|
30369
30371
|
} = be;
|
|
30370
|
-
return
|
|
30372
|
+
return Be.focus({
|
|
30371
30373
|
preventScroll: !0
|
|
30372
30374
|
});
|
|
30373
30375
|
},
|
|
30374
30376
|
// Safari
|
|
30375
30377
|
onMouseMove(be) {
|
|
30376
30378
|
let {
|
|
30377
|
-
currentTarget:
|
|
30379
|
+
currentTarget: Be
|
|
30378
30380
|
} = be;
|
|
30379
|
-
le.current = !0, fe.current = !1, _ && ce(
|
|
30381
|
+
le.current = !0, fe.current = !1, _ && ce(Be);
|
|
30380
30382
|
},
|
|
30381
30383
|
onPointerLeave(be) {
|
|
30382
30384
|
let {
|
|
30383
|
-
pointerType:
|
|
30385
|
+
pointerType: Be
|
|
30384
30386
|
} = be;
|
|
30385
|
-
if (!(!N.current ||
|
|
30387
|
+
if (!(!N.current || Be === "touch") && (le.current = !0, !!_ && (D.current = -1, R(), !f))) {
|
|
30386
30388
|
var q;
|
|
30387
30389
|
(q = Y.current) == null || q.focus({
|
|
30388
30390
|
preventScroll: !0
|
|
@@ -30392,7 +30394,7 @@ function t7e(e, t) {
|
|
|
30392
30394
|
};
|
|
30393
30395
|
}, [Ce, Y, _, o, R, f]), Ke = ee.useCallback(() => {
|
|
30394
30396
|
var ce;
|
|
30395
|
-
return S ?? (W == null || (ce = W.nodesRef.current.find((
|
|
30397
|
+
return S ?? (W == null || (ce = W.nodesRef.current.find((we) => we.id === Q)) == null || (ce = ce.context) == null || (ce = ce.dataRef) == null ? void 0 : ce.current.orientation);
|
|
30396
30398
|
}, [Q, W, S]), de = Qt((ce) => {
|
|
30397
30399
|
if (N.current = !1, le.current = !0, ce.which === 229 || !Ce.current && ce.currentTarget === Y.current)
|
|
30398
30400
|
return;
|
|
@@ -30400,14 +30402,14 @@ function t7e(e, t) {
|
|
|
30400
30402
|
ri(ce.key, Ke()) || an(ce), r(!1, ce.nativeEvent, "list-navigation"), Ct(a.domReference) && (f ? W?.events.emit("virtualfocus", a.domReference) : a.domReference.focus());
|
|
30401
30403
|
return;
|
|
30402
30404
|
}
|
|
30403
|
-
const
|
|
30404
|
-
if (H || (ce.key === "Home" && (an(ce), D.current = be, R()), ce.key === "End" && (an(ce), D.current =
|
|
30405
|
+
const we = D.current, be = es(o, v), Be = i2(o, v);
|
|
30406
|
+
if (H || (ce.key === "Home" && (an(ce), D.current = be, R()), ce.key === "End" && (an(ce), D.current = Be, R())), x > 1) {
|
|
30405
30407
|
const q = T || Array.from({
|
|
30406
30408
|
length: o.current.length
|
|
30407
30409
|
}, () => ({
|
|
30408
30410
|
width: 1,
|
|
30409
30411
|
height: 1
|
|
30410
|
-
})), Z = e8e(q, x, L), te = Z.findIndex((Le) => Le != null && !Ti(o, Le, v)), pe = Z.reduce((Le, wt, St) => wt != null && !Ti(o, wt, v) ? St : Le, -1),
|
|
30412
|
+
})), Z = e8e(q, x, L), te = Z.findIndex((Le) => Le != null && !Ti(o, Le, v)), pe = Z.reduce((Le, wt, St) => wt != null && !Ti(o, wt, v) ? St : Le, -1), Me = Z[J6e({
|
|
30411
30413
|
current: Z.map((Le) => Le != null ? o.current[Le] : null)
|
|
30412
30414
|
}, {
|
|
30413
30415
|
event: ce,
|
|
@@ -30421,7 +30423,7 @@ function t7e(e, t) {
|
|
|
30421
30423
|
minIndex: te,
|
|
30422
30424
|
maxIndex: pe,
|
|
30423
30425
|
prevIndex: t8e(
|
|
30424
|
-
D.current >
|
|
30426
|
+
D.current > Be ? be : D.current,
|
|
30425
30427
|
q,
|
|
30426
30428
|
Z,
|
|
30427
30429
|
x,
|
|
@@ -30432,33 +30434,33 @@ function t7e(e, t) {
|
|
|
30432
30434
|
),
|
|
30433
30435
|
stopEvent: !0
|
|
30434
30436
|
})];
|
|
30435
|
-
if (
|
|
30437
|
+
if (Me != null && (D.current = Me, R()), E === "both")
|
|
30436
30438
|
return;
|
|
30437
30439
|
}
|
|
30438
30440
|
if (ri(ce.key, E)) {
|
|
30439
30441
|
if (an(ce), n && !f && Na(ce.currentTarget.ownerDocument) === ce.currentTarget) {
|
|
30440
|
-
D.current = cs(ce.key, E, g) ? be :
|
|
30442
|
+
D.current = cs(ce.key, E, g) ? be : Be, R();
|
|
30441
30443
|
return;
|
|
30442
30444
|
}
|
|
30443
|
-
cs(ce.key, E, g) ? m ? D.current =
|
|
30444
|
-
startingIndex:
|
|
30445
|
+
cs(ce.key, E, g) ? m ? D.current = we >= Be ? p && we !== o.current.length ? -1 : be : Nt(o, {
|
|
30446
|
+
startingIndex: we,
|
|
30445
30447
|
disabledIndices: v
|
|
30446
|
-
}) : D.current = Math.min(
|
|
30447
|
-
startingIndex:
|
|
30448
|
+
}) : D.current = Math.min(Be, Nt(o, {
|
|
30449
|
+
startingIndex: we,
|
|
30448
30450
|
disabledIndices: v
|
|
30449
|
-
})) : m ? D.current =
|
|
30450
|
-
startingIndex:
|
|
30451
|
+
})) : m ? D.current = we <= be ? p && we !== -1 ? o.current.length : Be : Nt(o, {
|
|
30452
|
+
startingIndex: we,
|
|
30451
30453
|
decrement: !0,
|
|
30452
30454
|
disabledIndices: v
|
|
30453
30455
|
}) : D.current = Math.max(be, Nt(o, {
|
|
30454
|
-
startingIndex:
|
|
30456
|
+
startingIndex: we,
|
|
30455
30457
|
decrement: !0,
|
|
30456
30458
|
disabledIndices: v
|
|
30457
30459
|
})), va(o, D.current) && (D.current = -1), R();
|
|
30458
30460
|
}
|
|
30459
30461
|
}), tt = ee.useMemo(() => f && n && Ae && {
|
|
30460
30462
|
"aria-activedescendant": Se || We
|
|
30461
|
-
}, [f, n, Ae, Se, We]),
|
|
30463
|
+
}, [f, n, Ae, Se, We]), Qe = ee.useMemo(() => ({
|
|
30462
30464
|
"aria-orientation": E === "both" ? void 0 : E,
|
|
30463
30465
|
...H ? {} : tt,
|
|
30464
30466
|
onKeyDown: de,
|
|
@@ -30469,14 +30471,14 @@ function t7e(e, t) {
|
|
|
30469
30471
|
function ce(be) {
|
|
30470
30472
|
w === "auto" && G6e(be.nativeEvent) && (V.current = !0);
|
|
30471
30473
|
}
|
|
30472
|
-
function
|
|
30474
|
+
function we(be) {
|
|
30473
30475
|
V.current = w, w === "auto" && W6e(be.nativeEvent) && (V.current = !0);
|
|
30474
30476
|
}
|
|
30475
30477
|
return {
|
|
30476
30478
|
...tt,
|
|
30477
30479
|
onKeyDown(be) {
|
|
30478
30480
|
N.current = !1;
|
|
30479
|
-
const
|
|
30481
|
+
const Be = be.key.startsWith("Arrow"), q = ["Home", "End"].includes(be.key), Z = Be || q, te = x2(be.key, E, g), pe = E2(be.key, E, g, x), Me = x2(be.key, Ke(), g), Le = ri(be.key, E), wt = (h ? Me : Le) || be.key === "Enter" || be.key.trim() === "";
|
|
30480
30482
|
if (f && n) {
|
|
30481
30483
|
const _t = W?.nodesRef.current.find((qt) => qt.parentId == null), Ot = W && _t ? V6e(W.nodesRef.current, _t.id) : null;
|
|
30482
30484
|
if (Z && Ot && P) {
|
|
@@ -30497,13 +30499,13 @@ function t7e(e, t) {
|
|
|
30497
30499
|
}
|
|
30498
30500
|
return de(be);
|
|
30499
30501
|
}
|
|
30500
|
-
if (!(!n && !b &&
|
|
30502
|
+
if (!(!n && !b && Be)) {
|
|
30501
30503
|
if (wt) {
|
|
30502
30504
|
const _t = ri(be.key, Ke());
|
|
30503
30505
|
j.current = h && _t ? null : be.key;
|
|
30504
30506
|
}
|
|
30505
30507
|
if (h) {
|
|
30506
|
-
|
|
30508
|
+
Me && (an(be), n ? (D.current = es(o, ke.current), R()) : r(!0, be.nativeEvent, "list-navigation"));
|
|
30507
30509
|
return;
|
|
30508
30510
|
}
|
|
30509
30511
|
Le && (d != null && (D.current = d), an(be), !n && b ? r(!0, be.nativeEvent, "list-navigation") : de(be), n && R());
|
|
@@ -30512,17 +30514,17 @@ function t7e(e, t) {
|
|
|
30512
30514
|
onFocus() {
|
|
30513
30515
|
n && !f && (D.current = -1, R());
|
|
30514
30516
|
},
|
|
30515
|
-
onPointerDown:
|
|
30516
|
-
onPointerEnter:
|
|
30517
|
+
onPointerDown: we,
|
|
30518
|
+
onPointerEnter: we,
|
|
30517
30519
|
onMouseDown: ce,
|
|
30518
30520
|
onClick: ce
|
|
30519
30521
|
};
|
|
30520
30522
|
}, [We, tt, x, de, ke, w, o, h, R, r, n, b, E, Ke, g, d, W, f, P]);
|
|
30521
30523
|
return ee.useMemo(() => u ? {
|
|
30522
30524
|
reference: je,
|
|
30523
|
-
floating:
|
|
30525
|
+
floating: Qe,
|
|
30524
30526
|
item: ve
|
|
30525
|
-
} : {}, [u, je,
|
|
30527
|
+
} : {}, [u, je, Qe, ve]);
|
|
30526
30528
|
}
|
|
30527
30529
|
const n7e = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
30528
30530
|
function fp(e, t) {
|
|
@@ -30675,12 +30677,12 @@ const An = ({
|
|
|
30675
30677
|
}
|
|
30676
30678
|
}, "aria-label": "Copy message", size: "sm" }) });
|
|
30677
30679
|
}, yn = () => {
|
|
30678
|
-
const e =
|
|
30680
|
+
const e = Pe();
|
|
30679
30681
|
return { ...od, ...e.config.translations ?? {} };
|
|
30680
30682
|
}, M2 = 300, d3 = Rt(({ field: e, isExpanded: t, canApply: n, onToggleExpand: r, onApply: a }) => {
|
|
30681
|
-
const i = yn(), o = e.value.length > M2, s = o && !t ? `${e.value.slice(0, M2)}...` : e.value, l =
|
|
30683
|
+
const i = yn(), o = e.value.length > M2, s = o && !t ? `${e.value.slice(0, M2)}...` : e.value, l = Ye(() => {
|
|
30682
30684
|
r(e.name);
|
|
30683
|
-
}, [e.name, r]), u =
|
|
30685
|
+
}, [e.name, r]), u = Ye(() => {
|
|
30684
30686
|
a(e);
|
|
30685
30687
|
}, [e, a]);
|
|
30686
30688
|
return /* @__PURE__ */ oe("div", { className: "mp-agent-form-proposal-row", children: [
|
|
@@ -30733,7 +30735,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
|
|
|
30733
30735
|
data: [],
|
|
30734
30736
|
cursor: { total: 0, skip: 0, limit: e }
|
|
30735
30737
|
}), CVe = (e) => {
|
|
30736
|
-
const t =
|
|
30738
|
+
const t = Pe(), {
|
|
30737
30739
|
groupId: n,
|
|
30738
30740
|
parentId: r,
|
|
30739
30741
|
sourceType: a,
|
|
@@ -30776,7 +30778,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
|
|
|
30776
30778
|
gcTime: ja
|
|
30777
30779
|
});
|
|
30778
30780
|
}, RVe = (e) => {
|
|
30779
|
-
const t =
|
|
30781
|
+
const t = Pe(), {
|
|
30780
30782
|
groupId: n,
|
|
30781
30783
|
parentId: r,
|
|
30782
30784
|
sourceType: a,
|
|
@@ -30820,7 +30822,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
|
|
|
30820
30822
|
hasPreviousPage: i > 1
|
|
30821
30823
|
};
|
|
30822
30824
|
}, IVe = (e) => {
|
|
30823
|
-
const t =
|
|
30825
|
+
const t = Pe();
|
|
30824
30826
|
return fr({
|
|
30825
30827
|
queryKey: on.detail(e),
|
|
30826
30828
|
queryFn: async () => !e || !t.transport.getActivity ? null : t.transport.getActivity(e),
|
|
@@ -30829,7 +30831,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
|
|
|
30829
30831
|
gcTime: ja
|
|
30830
30832
|
});
|
|
30831
30833
|
}, OVe = (e) => {
|
|
30832
|
-
const t =
|
|
30834
|
+
const t = Pe(), { enabled: n = !0, ...r } = e ?? {};
|
|
30833
30835
|
return fr({
|
|
30834
30836
|
queryKey: on.summary(r),
|
|
30835
30837
|
queryFn: async () => t.transport.getActivitySummary ? t.transport.getActivitySummary(r) : [],
|
|
@@ -30838,7 +30840,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
|
|
|
30838
30840
|
gcTime: ja
|
|
30839
30841
|
});
|
|
30840
30842
|
}, LVe = (e) => {
|
|
30841
|
-
const t =
|
|
30843
|
+
const t = Pe(), { enabled: n = !0, groupId: r, parentId: a, from: i, to: o, tenant: s, ownerId: l } = e ?? {}, u = i instanceof Date ? i.toISOString() : i, d = o instanceof Date ? o.toISOString() : o;
|
|
30842
30844
|
return fr({
|
|
30843
30845
|
queryKey: on.sourceTypes({ groupId: r, parentId: a, from: u, to: d, tenant: s, ownerId: l }),
|
|
30844
30846
|
queryFn: async () => t.transport.listActivitySourceTypes ? t.transport.listActivitySourceTypes({
|
|
@@ -30871,7 +30873,7 @@ const f3 = 30 * 1e3, g3 = 5 * 60 * 1e3, yp = 20, ar = {
|
|
|
30871
30873
|
infinite: (e) => [...ar.infinites(), e],
|
|
30872
30874
|
detail: (e) => [...ar.all, "detail", e]
|
|
30873
30875
|
}, r7e = (e) => e?.pages.flatMap((t) => t.data) ?? [], y3 = (e) => {
|
|
30874
|
-
const t =
|
|
30876
|
+
const t = Pe(), n = t.config.user?.id ?? na(), r = t.config.appId, {
|
|
30875
30877
|
pageSize: a = yp,
|
|
30876
30878
|
sortOrder: i = "desc",
|
|
30877
30879
|
sortField: o = "updatedAt",
|
|
@@ -30898,7 +30900,7 @@ const f3 = 30 * 1e3, g3 = 5 * 60 * 1e3, yp = 20, ar = {
|
|
|
30898
30900
|
gcTime: g3
|
|
30899
30901
|
});
|
|
30900
30902
|
}, a7e = y3, DVe = (e) => {
|
|
30901
|
-
const t =
|
|
30903
|
+
const t = Pe(), n = t.config.user?.id ?? na(), r = t.config.appId, {
|
|
30902
30904
|
page: a,
|
|
30903
30905
|
pageSize: i = yp,
|
|
30904
30906
|
sortOrder: o = "desc",
|
|
@@ -30937,16 +30939,16 @@ const f3 = 30 * 1e3, g3 = 5 * 60 * 1e3, yp = 20, ar = {
|
|
|
30937
30939
|
}
|
|
30938
30940
|
}, [t.data, n]), t;
|
|
30939
30941
|
}, $Ve = (e = {}, t = []) => {
|
|
30940
|
-
const { threshold: n = 50, scrollOnMount: r = !0, observeMutations: a = !0 } = e, i =
|
|
30942
|
+
const { threshold: n = 50, scrollOnMount: r = !0, observeMutations: a = !0 } = e, i = ze(null), o = ze(null), [s, l] = et(!0), u = ze(!1), d = ze(!1), p = ze(), m = Ye(() => {
|
|
30941
30943
|
const f = i.current;
|
|
30942
30944
|
if (!f)
|
|
30943
30945
|
return !1;
|
|
30944
30946
|
const { scrollTop: w, scrollHeight: _, clientHeight: b } = f;
|
|
30945
30947
|
return _ - w - b <= n;
|
|
30946
|
-
}, [n]), h =
|
|
30948
|
+
}, [n]), h = Ye(() => {
|
|
30947
30949
|
const f = i.current, w = o.current;
|
|
30948
30950
|
!f || !w || w.scrollIntoView({ behavior: "auto", block: "end" });
|
|
30949
|
-
}, []), g =
|
|
30951
|
+
}, []), g = Ye(() => {
|
|
30950
30952
|
const f = m();
|
|
30951
30953
|
l(f), f && (u.current = !1);
|
|
30952
30954
|
}, [m]);
|
|
@@ -31014,7 +31016,7 @@ const f3 = 30 * 1e3, g3 = 5 * 60 * 1e3, yp = 20, ar = {
|
|
|
31014
31016
|
checkIsNearBottom: m
|
|
31015
31017
|
};
|
|
31016
31018
|
}, i7e = () => {
|
|
31017
|
-
const e =
|
|
31019
|
+
const e = Pe();
|
|
31018
31020
|
return fr({
|
|
31019
31021
|
queryKey: ["mp-agents", "models"],
|
|
31020
31022
|
queryFn: async () => e.transport.listModels ? await e.transport.listModels() : [],
|
|
@@ -31035,7 +31037,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31035
31037
|
pageContextDismissed: !1,
|
|
31036
31038
|
status: "idle"
|
|
31037
31039
|
/* Idle */
|
|
31038
|
-
}),
|
|
31040
|
+
}), Fe = (e, t) => e.chatState[t] ?? k3(), o7e = (e) => N7()((t, n) => ({
|
|
31039
31041
|
contextKey: e,
|
|
31040
31042
|
activeChatId: void 0,
|
|
31041
31043
|
draftChatKey: `draft-${At()}`,
|
|
@@ -31071,7 +31073,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31071
31073
|
};
|
|
31072
31074
|
}),
|
|
31073
31075
|
upsertChatState: (r, a) => t((i) => {
|
|
31074
|
-
const o =
|
|
31076
|
+
const o = Fe(i, r), s = typeof a == "function" ? a(o) : a, l = { ...o, ...s };
|
|
31075
31077
|
return {
|
|
31076
31078
|
chatState: { ...i.chatState, [r]: l }
|
|
31077
31079
|
};
|
|
@@ -31101,7 +31103,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31101
31103
|
};
|
|
31102
31104
|
}),
|
|
31103
31105
|
pushReasoning: (r, a) => t((i) => {
|
|
31104
|
-
const o =
|
|
31106
|
+
const o = Fe(i, r);
|
|
31105
31107
|
return {
|
|
31106
31108
|
chatState: {
|
|
31107
31109
|
...i.chatState,
|
|
@@ -31110,7 +31112,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31110
31112
|
};
|
|
31111
31113
|
}),
|
|
31112
31114
|
setArtifacts: (r, a) => t((i) => {
|
|
31113
|
-
const o =
|
|
31115
|
+
const o = Fe(i, r);
|
|
31114
31116
|
return {
|
|
31115
31117
|
chatState: {
|
|
31116
31118
|
...i.chatState,
|
|
@@ -31125,7 +31127,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31125
31127
|
}
|
|
31126
31128
|
})),
|
|
31127
31129
|
setComposerDraft: (r, a) => t((i) => {
|
|
31128
|
-
const o =
|
|
31130
|
+
const o = Fe(i, r);
|
|
31129
31131
|
return {
|
|
31130
31132
|
chatState: {
|
|
31131
31133
|
...i.chatState,
|
|
@@ -31137,7 +31139,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31137
31139
|
};
|
|
31138
31140
|
}),
|
|
31139
31141
|
setComposerValue: (r, a) => t((i) => {
|
|
31140
|
-
const o =
|
|
31142
|
+
const o = Fe(i, r);
|
|
31141
31143
|
return {
|
|
31142
31144
|
chatState: {
|
|
31143
31145
|
...i.chatState,
|
|
@@ -31149,7 +31151,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31149
31151
|
};
|
|
31150
31152
|
}),
|
|
31151
31153
|
addComposerAttachments: (r, a) => t((i) => {
|
|
31152
|
-
const o =
|
|
31154
|
+
const o = Fe(i, r), s = o.composerDraft.attachments ?? [];
|
|
31153
31155
|
if (!a || a.length === 0)
|
|
31154
31156
|
return i;
|
|
31155
31157
|
const l = s.find(ai), u = a.find(ai);
|
|
@@ -31181,7 +31183,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31181
31183
|
};
|
|
31182
31184
|
}),
|
|
31183
31185
|
removeComposerAttachment: (r, a) => t((i) => {
|
|
31184
|
-
const o =
|
|
31186
|
+
const o = Fe(i, r);
|
|
31185
31187
|
return {
|
|
31186
31188
|
chatState: {
|
|
31187
31189
|
...i.chatState,
|
|
@@ -31196,7 +31198,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31196
31198
|
};
|
|
31197
31199
|
}),
|
|
31198
31200
|
clearComposerDraft: (r) => t((a) => {
|
|
31199
|
-
const i =
|
|
31201
|
+
const i = Fe(a, r);
|
|
31200
31202
|
return {
|
|
31201
31203
|
chatState: {
|
|
31202
31204
|
...a.chatState,
|
|
@@ -31208,7 +31210,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31208
31210
|
};
|
|
31209
31211
|
}),
|
|
31210
31212
|
setComposerError: (r, a) => t((i) => {
|
|
31211
|
-
const o =
|
|
31213
|
+
const o = Fe(i, r);
|
|
31212
31214
|
return {
|
|
31213
31215
|
chatState: {
|
|
31214
31216
|
...i.chatState,
|
|
@@ -31217,7 +31219,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31217
31219
|
};
|
|
31218
31220
|
}),
|
|
31219
31221
|
setPageContextDismissed: (r, a) => t((i) => {
|
|
31220
|
-
const o =
|
|
31222
|
+
const o = Fe(i, r);
|
|
31221
31223
|
return {
|
|
31222
31224
|
chatState: {
|
|
31223
31225
|
...i.chatState,
|
|
@@ -31226,7 +31228,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31226
31228
|
};
|
|
31227
31229
|
}),
|
|
31228
31230
|
setChatStatus: (r, a) => t((i) => {
|
|
31229
|
-
const o =
|
|
31231
|
+
const o = Fe(i, r);
|
|
31230
31232
|
return {
|
|
31231
31233
|
chatState: {
|
|
31232
31234
|
...i.chatState,
|
|
@@ -31235,7 +31237,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31235
31237
|
};
|
|
31236
31238
|
}),
|
|
31237
31239
|
setPendingAssistant: (r, a) => t((i) => {
|
|
31238
|
-
const o =
|
|
31240
|
+
const o = Fe(i, r);
|
|
31239
31241
|
return {
|
|
31240
31242
|
chatState: {
|
|
31241
31243
|
...i.chatState,
|
|
@@ -31244,7 +31246,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31244
31246
|
};
|
|
31245
31247
|
}),
|
|
31246
31248
|
commitPendingAssistant: (r) => t((a) => {
|
|
31247
|
-
const i =
|
|
31249
|
+
const i = Fe(a, r), o = i.pendingAssistant;
|
|
31248
31250
|
if (!o)
|
|
31249
31251
|
return a;
|
|
31250
31252
|
if (!a.chats[r])
|
|
@@ -31272,7 +31274,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31272
31274
|
};
|
|
31273
31275
|
}),
|
|
31274
31276
|
enqueueQueuedMessage: (r, a, i) => t((o) => {
|
|
31275
|
-
const s =
|
|
31277
|
+
const s = Fe(o, r), l = {
|
|
31276
31278
|
id: At(),
|
|
31277
31279
|
content: a,
|
|
31278
31280
|
...i && i.length > 0 ? { attachments: i } : {},
|
|
@@ -31286,7 +31288,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31286
31288
|
};
|
|
31287
31289
|
}),
|
|
31288
31290
|
removeQueuedMessage: (r, a) => t((i) => {
|
|
31289
|
-
const o =
|
|
31291
|
+
const o = Fe(i, r);
|
|
31290
31292
|
if (o.messageQueue.length === 0)
|
|
31291
31293
|
return i;
|
|
31292
31294
|
const s = o.messageQueue.filter((l) => l.id !== a);
|
|
@@ -31297,7 +31299,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31297
31299
|
moveChatKeyState: (r, a) => t((i) => {
|
|
31298
31300
|
if (r === a)
|
|
31299
31301
|
return i;
|
|
31300
|
-
const o =
|
|
31302
|
+
const o = Fe(i, r), s = Fe(i, a);
|
|
31301
31303
|
if (!(o.messageQueue.length > 0 || !!o.pendingAssistant || o.status !== "idle" || o.composerDraft.value.length > 0 || o.composerDraft.attachments.length > 0 || !!o.composerError))
|
|
31302
31304
|
return i;
|
|
31303
31305
|
const u = o.composerDraft.value.length > 0 || o.composerDraft.attachments.length > 0, d = s.composerDraft.value.length > 0 || s.composerDraft.attachments.length > 0, p = {
|
|
@@ -31320,11 +31322,11 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31320
31322
|
};
|
|
31321
31323
|
}),
|
|
31322
31324
|
appendSystemMessage: (r, a) => t((i) => {
|
|
31323
|
-
const o =
|
|
31325
|
+
const o = Fe(i, r), s = {
|
|
31324
31326
|
id: At(),
|
|
31325
31327
|
chat: r,
|
|
31326
31328
|
content: a,
|
|
31327
|
-
role:
|
|
31329
|
+
role: Ze.System,
|
|
31328
31330
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
31329
31331
|
};
|
|
31330
31332
|
return {
|
|
@@ -31335,8 +31337,8 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31335
31337
|
};
|
|
31336
31338
|
}),
|
|
31337
31339
|
upsertToolCall: (r, a) => t((i) => {
|
|
31338
|
-
const o =
|
|
31339
|
-
(u) => u.role ===
|
|
31340
|
+
const o = Fe(i, r), s = [...o.messages], l = s.findIndex(
|
|
31341
|
+
(u) => u.role === Ze.Tool && u.toolCalls?.some((d) => d.id === a.id)
|
|
31340
31342
|
);
|
|
31341
31343
|
if (l >= 0) {
|
|
31342
31344
|
const u = s[l], d = (u.toolCalls ?? []).map((p) => p.id === a.id ? a : p);
|
|
@@ -31350,7 +31352,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31350
31352
|
content: "",
|
|
31351
31353
|
chat: r,
|
|
31352
31354
|
toolCalls: [a],
|
|
31353
|
-
role:
|
|
31355
|
+
role: Ze.Tool,
|
|
31354
31356
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
31355
31357
|
});
|
|
31356
31358
|
return {
|
|
@@ -31365,13 +31367,13 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31365
31367
|
isChatHistoryOpen: !r.isChatHistoryOpen
|
|
31366
31368
|
})),
|
|
31367
31369
|
setChatMessages: (r, a) => t((i) => {
|
|
31368
|
-
const o =
|
|
31370
|
+
const o = Fe(i, r), s = o.messages ?? [], l = typeof a == "function" ? a(s) : a;
|
|
31369
31371
|
return {
|
|
31370
31372
|
chatState: { ...i.chatState, [r]: { ...o, messages: l } }
|
|
31371
31373
|
};
|
|
31372
31374
|
}),
|
|
31373
31375
|
appendMessagesToChat: (r, a) => t((i) => {
|
|
31374
|
-
const o =
|
|
31376
|
+
const o = Fe(i, r);
|
|
31375
31377
|
if (a.length === 0)
|
|
31376
31378
|
return i;
|
|
31377
31379
|
const s = new Set(a.map((d) => d.id)), u = [...o.messages.filter((d) => !s.has(d.id)), ...a].sort((d, p) => d.createdAt.localeCompare(p.createdAt));
|
|
@@ -31383,7 +31385,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31383
31385
|
};
|
|
31384
31386
|
})
|
|
31385
31387
|
})), s7e = () => {
|
|
31386
|
-
const e = ge((s) => s.activeChatId ?? s.draftChatKey), t = ge((s) =>
|
|
31388
|
+
const e = ge((s) => s.activeChatId ?? s.draftChatKey), t = ge((s) => Fe(s, e).composerDraft), n = ge((s) => s.setComposerValue), r = ge((s) => s.setComposerDraft), a = ge((s) => s.clearComposerDraft), i = ge((s) => s.addComposerAttachments), o = ge((s) => s.removeComposerAttachment);
|
|
31387
31389
|
return {
|
|
31388
31390
|
chatKey: e,
|
|
31389
31391
|
draft: t,
|
|
@@ -31394,7 +31396,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31394
31396
|
removeAttachment: (s) => o(e, s)
|
|
31395
31397
|
};
|
|
31396
31398
|
}, l7e = (e) => {
|
|
31397
|
-
const t =
|
|
31399
|
+
const t = Pe();
|
|
31398
31400
|
return fr({
|
|
31399
31401
|
queryKey: ["mp-agents", "configurations", e ?? "all"],
|
|
31400
31402
|
queryFn: async () => t.transport.listAgentConfigurations ? t.transport.listAgentConfigurations(e) : [],
|
|
@@ -31402,13 +31404,18 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31402
31404
|
refetchOnWindowFocus: !1
|
|
31403
31405
|
});
|
|
31404
31406
|
}, zVe = (e, t = []) => {
|
|
31405
|
-
const n =
|
|
31407
|
+
const n = Pe(), r = ze(e), a = Ye(e, t);
|
|
31406
31408
|
r.current = a;
|
|
31407
|
-
const i =
|
|
31409
|
+
const i = Ye((o) => r.current(o), []);
|
|
31408
31410
|
$e(() => n.registerPageContextProvider(i), [n, i]);
|
|
31411
|
+
}, FVe = (e, t = []) => {
|
|
31412
|
+
const n = Pe(), r = ze(e), a = Ye(e, t);
|
|
31413
|
+
r.current = a;
|
|
31414
|
+
const i = Ye((o) => r.current(o), []);
|
|
31415
|
+
$e(() => n.registerChatMetadataProvider(i), [n, i]);
|
|
31409
31416
|
}, c7e = (e) => {
|
|
31410
|
-
const t =
|
|
31411
|
-
return
|
|
31417
|
+
const t = Pe();
|
|
31418
|
+
return Ye(
|
|
31412
31419
|
(r) => {
|
|
31413
31420
|
t.events.dispatchEvent(
|
|
31414
31421
|
new CustomEvent(e, {
|
|
@@ -31419,15 +31426,15 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31419
31426
|
[t, e]
|
|
31420
31427
|
);
|
|
31421
31428
|
}, u7e = (e, t, n = [], r) => {
|
|
31422
|
-
const a =
|
|
31429
|
+
const a = Pe(), i = ze(t), o = Ye(t, n);
|
|
31423
31430
|
i.current = o;
|
|
31424
|
-
const s =
|
|
31431
|
+
const s = Ye((u) => {
|
|
31425
31432
|
i.current(u);
|
|
31426
31433
|
}, []), l = typeof r == "boolean" ? r : r?.capture;
|
|
31427
31434
|
$e(() => (a.events.addEventListener(e, s, r), () => {
|
|
31428
31435
|
a.events.removeEventListener(e, s, l);
|
|
31429
31436
|
}), [a, e, s, l]);
|
|
31430
|
-
},
|
|
31437
|
+
}, PVe = ({ formId: e, onApply: t, enabled: n = !0 }) => {
|
|
31431
31438
|
u7e(
|
|
31432
31439
|
D5,
|
|
31433
31440
|
(r) => {
|
|
@@ -31436,7 +31443,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31436
31443
|
[n, e, t]
|
|
31437
31444
|
);
|
|
31438
31445
|
}, d7e = ["mp-agents", "configurations"], p7e = () => {
|
|
31439
|
-
const e =
|
|
31446
|
+
const e = Pe(), t = E5(), n = () => t.invalidateQueries({
|
|
31440
31447
|
queryKey: d7e
|
|
31441
31448
|
}), r = Gh({
|
|
31442
31449
|
mutationFn: async ({ agentName: i, input: o }) => {
|
|
@@ -31458,7 +31465,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31458
31465
|
upsertBatch: a
|
|
31459
31466
|
};
|
|
31460
31467
|
}, h7e = () => {
|
|
31461
|
-
const e =
|
|
31468
|
+
const e = Pe(), t = ge((s) => s.activeChatId), n = ge((s) => s.upsertChat), r = ge((s) => s.setActiveChat), a = ge((s) => s.setChatStatus), o = fr({
|
|
31462
31469
|
queryKey: ["mp-agents", "chat", t],
|
|
31463
31470
|
queryFn: () => e.transport.getChat(t),
|
|
31464
31471
|
enabled: !!t,
|
|
@@ -31471,7 +31478,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31471
31478
|
o.isError && t && r(void 0);
|
|
31472
31479
|
}, [o.isError, t, r]), o;
|
|
31473
31480
|
}, m7e = 20, v3 = (e) => {
|
|
31474
|
-
const t =
|
|
31481
|
+
const t = Pe(), n = t.config.messagesPageSize ?? m7e, r = ge((o) => o.setChatMessages), a = ge((o) => !!(e && o.chats[e])), i = Qd({
|
|
31475
31482
|
queryKey: ["mp-agents", "messages", e, n],
|
|
31476
31483
|
queryFn: async ({ pageParam: o }) => {
|
|
31477
31484
|
if (!e || !t.transport.getMessages)
|
|
@@ -31496,7 +31503,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31496
31503
|
});
|
|
31497
31504
|
}, [e, i.data, r]), i;
|
|
31498
31505
|
}, _3 = () => {
|
|
31499
|
-
const e =
|
|
31506
|
+
const e = Pe(), t = e.config.user?.id ?? na(), n = ge((u) => u.activeChatId), r = ge((u) => u.removeChat), a = ge((u) => u.setActiveChat), [i, o] = et(/* @__PURE__ */ new Set()), s = Ye(
|
|
31500
31507
|
async (u) => {
|
|
31501
31508
|
o((d) => new Set(d).add(u));
|
|
31502
31509
|
try {
|
|
@@ -31509,7 +31516,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31509
31516
|
}
|
|
31510
31517
|
},
|
|
31511
31518
|
[n, r, e.queryClient, e.transport, a, t]
|
|
31512
|
-
), l =
|
|
31519
|
+
), l = Ye((u) => i.has(u), [i]);
|
|
31513
31520
|
return { deleteChat: s, isDeleting: l };
|
|
31514
31521
|
}, f7e = (e) => {
|
|
31515
31522
|
if (e == null)
|
|
@@ -31545,7 +31552,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31545
31552
|
applyAllButtonText: n,
|
|
31546
31553
|
showStatus: r = !0
|
|
31547
31554
|
}) => {
|
|
31548
|
-
const a =
|
|
31555
|
+
const a = Pe(), i = c7e(D5), o = yn(), s = lt(() => g7e(e), [e]), [l, u] = et(/* @__PURE__ */ new Set()), d = lt(() => {
|
|
31549
31556
|
const x = (e.output ?? {})?._mp?.lastAction, z = typeof x?.action == "string" ? x.action : void 0, P = typeof x?.at == "string" ? x.at : void 0;
|
|
31550
31557
|
return { action: z, at: P };
|
|
31551
31558
|
}, [e.output]), p = lt(() => d.action === "apply", [d.action]), m = lt(() => d.action === "reject", [d.action]), h = lt(
|
|
@@ -31556,7 +31563,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31556
31563
|
() => e.status === Mt.Succeeded && !!s.formId && s.fields.length > 0 && !p && !m,
|
|
31557
31564
|
[e.status, s.formId, s.fields.length, p, m]
|
|
31558
31565
|
);
|
|
31559
|
-
const g =
|
|
31566
|
+
const g = Ye(
|
|
31560
31567
|
async (E) => {
|
|
31561
31568
|
s.formId && a.transport.recordToolCallAction && await a.transport.recordToolCallAction(
|
|
31562
31569
|
t,
|
|
@@ -31575,7 +31582,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31575
31582
|
);
|
|
31576
31583
|
},
|
|
31577
31584
|
[s.formId, s.formName, t, e.id, a.transport]
|
|
31578
|
-
), f =
|
|
31585
|
+
), f = Ye(
|
|
31579
31586
|
async (E) => {
|
|
31580
31587
|
if (s.formId) {
|
|
31581
31588
|
i({
|
|
@@ -31594,7 +31601,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31594
31601
|
},
|
|
31595
31602
|
[s.formId, s.formName, t, e.id, i, g]
|
|
31596
31603
|
);
|
|
31597
|
-
|
|
31604
|
+
Ye(async () => {
|
|
31598
31605
|
if (s.formId)
|
|
31599
31606
|
try {
|
|
31600
31607
|
await g({ action: "reject", fields: s.fields });
|
|
@@ -31602,7 +31609,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31602
31609
|
return;
|
|
31603
31610
|
}
|
|
31604
31611
|
}, [s.formId, s.fields, g]);
|
|
31605
|
-
const w =
|
|
31612
|
+
const w = Ye((E) => {
|
|
31606
31613
|
u((S) => {
|
|
31607
31614
|
if (S.has(E)) {
|
|
31608
31615
|
if (S.size === 1)
|
|
@@ -31614,12 +31621,12 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
|
|
|
31614
31621
|
return x.add(E), x;
|
|
31615
31622
|
}
|
|
31616
31623
|
});
|
|
31617
|
-
}, []), _ =
|
|
31624
|
+
}, []), _ = Ye(
|
|
31618
31625
|
(E) => {
|
|
31619
31626
|
f([E]);
|
|
31620
31627
|
},
|
|
31621
31628
|
[f]
|
|
31622
|
-
), b =
|
|
31629
|
+
), b = Ye(() => {
|
|
31623
31630
|
f(s.fields);
|
|
31624
31631
|
}, [f, s.fields]), v = s.formName ? `${o.formProposalHeaderPrefix} ${s.formName}` : `${o.formProposalHeaderPrefix} ${s.formId}`;
|
|
31625
31632
|
return e.status === Mt.Failed && e.error ? /* @__PURE__ */ C("div", { className: "mp-agent-tool-body", children: /* @__PURE__ */ C("div", { className: "mp-agent-tool-simple-message", children: o.formProposalFailed }) }) : e.status !== Mt.Succeeded ? /* @__PURE__ */ C("div", { className: "mp-agent-tool-simple-message", children: o.formProposalPreparing }) : !s.formId || s.fields.length === 0 ? /* @__PURE__ */ C("div", { className: "mp-agent-tool-simple-message", children: o.formProposalNone }) : /* @__PURE__ */ oe("div", { className: "mp-agent-tool-body", children: [
|
|
@@ -31779,6 +31786,8 @@ class w7e {
|
|
|
31779
31786
|
tools: t.tools,
|
|
31780
31787
|
// Preserve optional pageContext hooks which are functions and can't be validated by Zod
|
|
31781
31788
|
pageContext: t.pageContext ? { ...n.pageContext, ...t.pageContext } : n.pageContext,
|
|
31789
|
+
// getMetadata is a function stripped by Zod; re-attach from rawConfig.
|
|
31790
|
+
chatMetadata: t.chatMetadata ? { ...n.chatMetadata, ...t.chatMetadata } : n.chatMetadata,
|
|
31782
31791
|
// Merge user translations with defaults
|
|
31783
31792
|
translations: t.translations ? { ...od, ...t.translations } : od,
|
|
31784
31793
|
// Preserve onError callback from transport config (stripped by Zod since it's a function)
|
|
@@ -31811,6 +31820,7 @@ class w7e {
|
|
|
31811
31820
|
toolRendererMap = /* @__PURE__ */ new Map();
|
|
31812
31821
|
storeRef;
|
|
31813
31822
|
pageContextProviders = /* @__PURE__ */ new Set();
|
|
31823
|
+
chatMetadataProviders = /* @__PURE__ */ new Set();
|
|
31814
31824
|
createTransport(t) {
|
|
31815
31825
|
return t.mode === "proxy" ? new jr(t) : new Zo(t);
|
|
31816
31826
|
}
|
|
@@ -31920,6 +31930,41 @@ class w7e {
|
|
|
31920
31930
|
this.pageContextProviders.delete(t);
|
|
31921
31931
|
};
|
|
31922
31932
|
}
|
|
31933
|
+
/**
|
|
31934
|
+
* Register a provider contributing chat-level metadata, merged into a new
|
|
31935
|
+
* chat's `metadata` at creation time. Intended to be called by route/page
|
|
31936
|
+
* components (via the `useChatMetadata` hook).
|
|
31937
|
+
*
|
|
31938
|
+
* The returned cleanup function MUST be called (on unmount) to avoid leaks.
|
|
31939
|
+
*/
|
|
31940
|
+
registerChatMetadataProvider(t) {
|
|
31941
|
+
return this.chatMetadataProviders.add(t), () => {
|
|
31942
|
+
this.chatMetadataProviders.delete(t);
|
|
31943
|
+
};
|
|
31944
|
+
}
|
|
31945
|
+
/**
|
|
31946
|
+
* Resolve the metadata to persist on a newly created chat by merging the
|
|
31947
|
+
* config-level `chatMetadata.getMetadata` hook with all registered providers.
|
|
31948
|
+
* Returns undefined when nothing contributed (so callers can omit the field).
|
|
31949
|
+
*/
|
|
31950
|
+
getChatMetadata(t) {
|
|
31951
|
+
const n = {};
|
|
31952
|
+
let r = !1;
|
|
31953
|
+
const a = (o) => {
|
|
31954
|
+
o && typeof o == "object" && (Object.assign(n, o), r = !0);
|
|
31955
|
+
}, i = this.config.chatMetadata?.getMetadata;
|
|
31956
|
+
if (i)
|
|
31957
|
+
try {
|
|
31958
|
+
a(i(t));
|
|
31959
|
+
} catch {
|
|
31960
|
+
}
|
|
31961
|
+
for (const o of this.chatMetadataProviders)
|
|
31962
|
+
try {
|
|
31963
|
+
a(o(t));
|
|
31964
|
+
} catch {
|
|
31965
|
+
}
|
|
31966
|
+
return r ? n : void 0;
|
|
31967
|
+
}
|
|
31923
31968
|
getPageContextInput() {
|
|
31924
31969
|
if (typeof window > "u")
|
|
31925
31970
|
return {};
|
|
@@ -33328,10 +33373,10 @@ const k_e = [
|
|
|
33328
33373
|
"removeListener"
|
|
33329
33374
|
// used by the Node.js EventEmitter
|
|
33330
33375
|
], v_e = 5;
|
|
33331
|
-
var
|
|
33376
|
+
var Ue;
|
|
33332
33377
|
(function(e) {
|
|
33333
33378
|
e[e.CONNECT = 0] = "CONNECT", e[e.DISCONNECT = 1] = "DISCONNECT", e[e.EVENT = 2] = "EVENT", e[e.ACK = 3] = "ACK", e[e.CONNECT_ERROR = 4] = "CONNECT_ERROR", e[e.BINARY_EVENT = 5] = "BINARY_EVENT", e[e.BINARY_ACK = 6] = "BINARY_ACK";
|
|
33334
|
-
})(
|
|
33379
|
+
})(Ue || (Ue = {}));
|
|
33335
33380
|
class __e {
|
|
33336
33381
|
/**
|
|
33337
33382
|
* Encoder constructor
|
|
@@ -33348,8 +33393,8 @@ class __e {
|
|
|
33348
33393
|
* @param {Object} obj - packet object
|
|
33349
33394
|
*/
|
|
33350
33395
|
encode(t) {
|
|
33351
|
-
return (t.type ===
|
|
33352
|
-
type: t.type ===
|
|
33396
|
+
return (t.type === Ue.EVENT || t.type === Ue.ACK) && Oi(t) ? this.encodeAsBinary({
|
|
33397
|
+
type: t.type === Ue.EVENT ? Ue.BINARY_EVENT : Ue.BINARY_ACK,
|
|
33353
33398
|
nsp: t.nsp,
|
|
33354
33399
|
data: t.data,
|
|
33355
33400
|
id: t.id
|
|
@@ -33360,7 +33405,7 @@ class __e {
|
|
|
33360
33405
|
*/
|
|
33361
33406
|
encodeAsString(t) {
|
|
33362
33407
|
let n = "" + t.type;
|
|
33363
|
-
return (t.type ===
|
|
33408
|
+
return (t.type === Ue.BINARY_EVENT || t.type === Ue.BINARY_ACK) && (n += t.attachments + "-"), t.nsp && t.nsp !== "/" && (n += t.nsp + ","), t.id != null && (n += t.id), t.data != null && (n += JSON.stringify(t.data, this.replacer)), n;
|
|
33364
33409
|
}
|
|
33365
33410
|
/**
|
|
33366
33411
|
* Encode packet as 'buffer sequence' by removing blobs, and
|
|
@@ -33395,8 +33440,8 @@ class xp extends ft {
|
|
|
33395
33440
|
if (this.reconstructor)
|
|
33396
33441
|
throw new Error("got plaintext data when reconstructing a packet");
|
|
33397
33442
|
n = this.decodeString(t);
|
|
33398
|
-
const r = n.type ===
|
|
33399
|
-
r || n.type ===
|
|
33443
|
+
const r = n.type === Ue.BINARY_EVENT;
|
|
33444
|
+
r || n.type === Ue.BINARY_ACK ? (n.type = r ? Ue.EVENT : Ue.ACK, this.reconstructor = new w_e(n), n.attachments === 0 && super.emitReserved("decoded", n)) : super.emitReserved("decoded", n);
|
|
33400
33445
|
} else if (wp(t) || t.base64)
|
|
33401
33446
|
if (this.reconstructor)
|
|
33402
33447
|
n = this.reconstructor.takeBinaryData(t), n && (this.reconstructor = null, super.emitReserved("decoded", n));
|
|
@@ -33416,9 +33461,9 @@ class xp extends ft {
|
|
|
33416
33461
|
const r = {
|
|
33417
33462
|
type: Number(t.charAt(0))
|
|
33418
33463
|
};
|
|
33419
|
-
if (
|
|
33464
|
+
if (Ue[r.type] === void 0)
|
|
33420
33465
|
throw new Error("unknown packet type " + r.type);
|
|
33421
|
-
if (r.type ===
|
|
33466
|
+
if (r.type === Ue.BINARY_EVENT || r.type === Ue.BINARY_ACK) {
|
|
33422
33467
|
const i = n + 1;
|
|
33423
33468
|
for (; t.charAt(++n) !== "-" && n != t.length; )
|
|
33424
33469
|
;
|
|
@@ -33466,17 +33511,17 @@ class xp extends ft {
|
|
|
33466
33511
|
}
|
|
33467
33512
|
static isPayloadValid(t, n) {
|
|
33468
33513
|
switch (t) {
|
|
33469
|
-
case
|
|
33514
|
+
case Ue.CONNECT:
|
|
33470
33515
|
return L2(n);
|
|
33471
|
-
case
|
|
33516
|
+
case Ue.DISCONNECT:
|
|
33472
33517
|
return n === void 0;
|
|
33473
|
-
case
|
|
33518
|
+
case Ue.CONNECT_ERROR:
|
|
33474
33519
|
return typeof n == "string" || L2(n);
|
|
33475
|
-
case
|
|
33476
|
-
case
|
|
33520
|
+
case Ue.EVENT:
|
|
33521
|
+
case Ue.BINARY_EVENT:
|
|
33477
33522
|
return Array.isArray(n) && (typeof n[0] == "number" || typeof n[0] == "string" && k_e.indexOf(n[0]) === -1);
|
|
33478
|
-
case
|
|
33479
|
-
case
|
|
33523
|
+
case Ue.ACK:
|
|
33524
|
+
case Ue.BINARY_ACK:
|
|
33480
33525
|
return Array.isArray(n);
|
|
33481
33526
|
}
|
|
33482
33527
|
}
|
|
@@ -33518,7 +33563,7 @@ const x_e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
33518
33563
|
Decoder: xp,
|
|
33519
33564
|
Encoder: __e,
|
|
33520
33565
|
get PacketType() {
|
|
33521
|
-
return
|
|
33566
|
+
return Ue;
|
|
33522
33567
|
},
|
|
33523
33568
|
protocol: v_e
|
|
33524
33569
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -33657,7 +33702,7 @@ class q3 extends ft {
|
|
|
33657
33702
|
if (n.unshift(t), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
|
|
33658
33703
|
return this._addToQueue(n), this;
|
|
33659
33704
|
const o = {
|
|
33660
|
-
type:
|
|
33705
|
+
type: Ue.EVENT,
|
|
33661
33706
|
data: n
|
|
33662
33707
|
};
|
|
33663
33708
|
if (o.options = {}, o.options.compress = this.flags.compress !== !1, typeof n[n.length - 1] == "function") {
|
|
@@ -33765,7 +33810,7 @@ class q3 extends ft {
|
|
|
33765
33810
|
*/
|
|
33766
33811
|
_sendConnectPacket(t) {
|
|
33767
33812
|
this.packet({
|
|
33768
|
-
type:
|
|
33813
|
+
type: Ue.CONNECT,
|
|
33769
33814
|
data: this._pid ? Object.assign({ pid: this._pid, offset: this._lastOffset }, t) : t
|
|
33770
33815
|
});
|
|
33771
33816
|
}
|
|
@@ -33811,21 +33856,21 @@ class q3 extends ft {
|
|
|
33811
33856
|
onpacket(t) {
|
|
33812
33857
|
if (t.nsp === this.nsp)
|
|
33813
33858
|
switch (t.type) {
|
|
33814
|
-
case
|
|
33859
|
+
case Ue.CONNECT:
|
|
33815
33860
|
t.data && t.data.sid ? this.onconnect(t.data.sid, t.data.pid) : this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));
|
|
33816
33861
|
break;
|
|
33817
|
-
case
|
|
33818
|
-
case
|
|
33862
|
+
case Ue.EVENT:
|
|
33863
|
+
case Ue.BINARY_EVENT:
|
|
33819
33864
|
this.onevent(t);
|
|
33820
33865
|
break;
|
|
33821
|
-
case
|
|
33822
|
-
case
|
|
33866
|
+
case Ue.ACK:
|
|
33867
|
+
case Ue.BINARY_ACK:
|
|
33823
33868
|
this.onack(t);
|
|
33824
33869
|
break;
|
|
33825
|
-
case
|
|
33870
|
+
case Ue.DISCONNECT:
|
|
33826
33871
|
this.ondisconnect();
|
|
33827
33872
|
break;
|
|
33828
|
-
case
|
|
33873
|
+
case Ue.CONNECT_ERROR:
|
|
33829
33874
|
this.destroy();
|
|
33830
33875
|
const r = new Error(t.data.message);
|
|
33831
33876
|
r.data = t.data.data, this.emitReserved("connect_error", r);
|
|
@@ -33860,7 +33905,7 @@ class q3 extends ft {
|
|
|
33860
33905
|
let r = !1;
|
|
33861
33906
|
return function(...a) {
|
|
33862
33907
|
r || (r = !0, n.packet({
|
|
33863
|
-
type:
|
|
33908
|
+
type: Ue.ACK,
|
|
33864
33909
|
id: t,
|
|
33865
33910
|
data: a
|
|
33866
33911
|
}));
|
|
@@ -33929,7 +33974,7 @@ class q3 extends ft {
|
|
|
33929
33974
|
* @return self
|
|
33930
33975
|
*/
|
|
33931
33976
|
disconnect() {
|
|
33932
|
-
return this.connected && this.packet({ type:
|
|
33977
|
+
return this.connected && this.packet({ type: Ue.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
|
|
33933
33978
|
}
|
|
33934
33979
|
/**
|
|
33935
33980
|
* Alias for {@link disconnect()}.
|
|
@@ -34403,7 +34448,7 @@ Object.assign(Li, {
|
|
|
34403
34448
|
connect: Li
|
|
34404
34449
|
});
|
|
34405
34450
|
const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
34406
|
-
const t =
|
|
34451
|
+
const t = Pe(), n = ge((_) => _.upsertChat), r = ge((_) => _.upsertChatState), a = ge((_) => _.contextKey), i = ge((_) => _.activeChatId), o = lt(() => t.config.user?.id ?? na(), [t.config.user?.id]), s = t.config.transport, [l, u] = et(null), [d, p] = et(void 0), m = ze(a), h = ze(n), g = ze(r), f = ze(void 0);
|
|
34407
34452
|
$e(() => {
|
|
34408
34453
|
m.current = a, h.current = n, g.current = r;
|
|
34409
34454
|
}, [a, n, r]), $e(() => {
|
|
@@ -34430,14 +34475,14 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34430
34475
|
}, W = (V) => {
|
|
34431
34476
|
if (V.contextKey === m.current) {
|
|
34432
34477
|
h.current(V);
|
|
34433
|
-
const D = t.store.getState(), j =
|
|
34478
|
+
const D = t.store.getState(), j = Fe(D, V.id);
|
|
34434
34479
|
g.current(V.id, {
|
|
34435
34480
|
...j,
|
|
34436
34481
|
status: Ca(V.status)
|
|
34437
34482
|
});
|
|
34438
34483
|
}
|
|
34439
34484
|
}, R = (V) => {
|
|
34440
|
-
const D = t.store.getState(), j =
|
|
34485
|
+
const D = t.store.getState(), j = Fe(D, V.chat), N = j.messages.findIndex((K) => K.id === V.id);
|
|
34441
34486
|
if (N >= 0) {
|
|
34442
34487
|
const K = [...j.messages];
|
|
34443
34488
|
K[N] = V, g.current(V.chat, {
|
|
@@ -34452,7 +34497,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34452
34497
|
});
|
|
34453
34498
|
}, H = (V) => {
|
|
34454
34499
|
h.current(V);
|
|
34455
|
-
const D = t.store.getState(), j =
|
|
34500
|
+
const D = t.store.getState(), j = Fe(D, V.id);
|
|
34456
34501
|
g.current(V.id, {
|
|
34457
34502
|
...j,
|
|
34458
34503
|
status: Ca(V.status)
|
|
@@ -34481,8 +34526,8 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34481
34526
|
}, [l, i]);
|
|
34482
34527
|
const w = lt(() => ({ socket: l, socketId: d }), [l, d]);
|
|
34483
34528
|
return /* @__PURE__ */ C(M_e.Provider, { value: w, children: e });
|
|
34484
|
-
}, Ep = Zd(null),
|
|
34485
|
-
const n =
|
|
34529
|
+
}, Ep = Zd(null), BVe = ({ config: e, children: t }) => {
|
|
34530
|
+
const n = ze();
|
|
34486
34531
|
n.current || (n.current = new w7e(e));
|
|
34487
34532
|
const [, r] = et(0);
|
|
34488
34533
|
$e(() => {
|
|
@@ -34491,7 +34536,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34491
34536
|
o.events.removeEventListener("runtime:transport-config-changed", s);
|
|
34492
34537
|
};
|
|
34493
34538
|
}, []);
|
|
34494
|
-
const a =
|
|
34539
|
+
const a = ze();
|
|
34495
34540
|
if (!a.current) {
|
|
34496
34541
|
const o = n.current.defaultContextKey ?? n.current.config.contextKeys[0]?.key ?? "default";
|
|
34497
34542
|
a.current = o7e(o), n.current.attachStore(a.current);
|
|
@@ -34516,7 +34561,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34516
34561
|
R7e(u, l);
|
|
34517
34562
|
});
|
|
34518
34563
|
}, []), /* @__PURE__ */ C(Ep.Provider, { value: i, children: /* @__PURE__ */ C(S7, { client: i.runtime.queryClient, children: /* @__PURE__ */ C(M7e, { value: i.runtime.config.theme, children: /* @__PURE__ */ C(S_e, { children: t }) }) }) });
|
|
34519
|
-
},
|
|
34564
|
+
}, Pe = () => {
|
|
34520
34565
|
const e = Xd(Ep);
|
|
34521
34566
|
if (!e)
|
|
34522
34567
|
throw new Error("useAgentRuntime must be used inside <AgentProvider />");
|
|
@@ -34532,7 +34577,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34532
34577
|
multiUser: n = !1,
|
|
34533
34578
|
participantIds: r = []
|
|
34534
34579
|
}) => {
|
|
34535
|
-
const a =
|
|
34580
|
+
const a = Pe(), {
|
|
34536
34581
|
composer: i,
|
|
34537
34582
|
contextKey: o,
|
|
34538
34583
|
activeChatId: s,
|
|
@@ -34551,7 +34596,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34551
34596
|
commitPendingAssistant: E,
|
|
34552
34597
|
setPageContextDismissed: S
|
|
34553
34598
|
} = ge((j) => {
|
|
34554
|
-
const N = j.activeChatId ?? j.draftChatKey, K =
|
|
34599
|
+
const N = j.activeChatId ?? j.draftChatKey, K = Fe(j, N);
|
|
34555
34600
|
return {
|
|
34556
34601
|
composer: j.composer,
|
|
34557
34602
|
contextKey: j.contextKey,
|
|
@@ -34571,9 +34616,9 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34571
34616
|
commitPendingAssistant: j.commitPendingAssistant,
|
|
34572
34617
|
setPageContextDismissed: j.setPageContextDismissed
|
|
34573
34618
|
};
|
|
34574
|
-
}), x =
|
|
34619
|
+
}), x = Ye((j) => !j || j.length === 0 ? !1 : j.some(
|
|
34575
34620
|
(N) => N.type === kt.Context && N?.metadata?.kind === "pageContext"
|
|
34576
|
-
), []), z =
|
|
34621
|
+
), []), z = ze(!1), P = ze(!1), T = ze(void 0), L = ze(/* @__PURE__ */ new Set()), U = s ?? l, Y = Ye(
|
|
34577
34622
|
async (j, N) => {
|
|
34578
34623
|
if (!a.transport.generateTitle)
|
|
34579
34624
|
return;
|
|
@@ -34591,7 +34636,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34591
34636
|
return J;
|
|
34592
34637
|
},
|
|
34593
34638
|
[a.transport, a.config.features?.titleGeneration, o]
|
|
34594
|
-
), Q =
|
|
34639
|
+
), Q = Ye(
|
|
34595
34640
|
async (j, N = []) => {
|
|
34596
34641
|
const K = a.config.user?.id ?? "guest", J = !s, O = s ?? l, le = { current: O };
|
|
34597
34642
|
T.current = O;
|
|
@@ -34601,17 +34646,19 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34601
34646
|
if (J) {
|
|
34602
34647
|
const ce = await Y(j, K);
|
|
34603
34648
|
ce && ce.trim().length > 0 && (ke = { ...ke ?? {}, title: ce });
|
|
34649
|
+
const we = a.getChatMetadata({ contextKey: o });
|
|
34650
|
+
we && (ke = { ...ke ?? {}, ...we });
|
|
34604
34651
|
}
|
|
34605
|
-
const Ce = a.store.getState(),
|
|
34606
|
-
let
|
|
34607
|
-
He ? (
|
|
34652
|
+
const Ce = a.store.getState(), qe = s ? Ce.chats[s] : void 0, We = (s ? Ce.chatState[s] : void 0)?.messages ?? [], re = N.filter((ce) => B3(ce) ? !A_e(We, ce) : !0), Se = qe?.model, He = i.model !== Se;
|
|
34653
|
+
let Xe, Ae = !1;
|
|
34654
|
+
He ? (Xe = i.model, Ae = !0) : Se ? (Xe = Se, Ae = !1) : (Xe = void 0, Ae = !1);
|
|
34608
34655
|
const ve = T_e(j), Ke = {
|
|
34609
34656
|
userId: K,
|
|
34610
34657
|
content: j,
|
|
34611
34658
|
metadata: ke,
|
|
34612
34659
|
contextKey: o,
|
|
34613
34660
|
...J ? {} : { chatId: s },
|
|
34614
|
-
...Ae ? { model:
|
|
34661
|
+
...Ae ? { model: Xe ?? "" } : {},
|
|
34615
34662
|
...re.length > 0 ? { attachments: re } : {},
|
|
34616
34663
|
...n ? {
|
|
34617
34664
|
mentions: ve,
|
|
@@ -34623,11 +34670,11 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34623
34670
|
_(le.current, void 0);
|
|
34624
34671
|
}, tt = (ce) => {
|
|
34625
34672
|
if (ce?.name === "AbortError") {
|
|
34626
|
-
const
|
|
34627
|
-
return L.current.has(
|
|
34673
|
+
const we = T.current ?? le.current;
|
|
34674
|
+
return L.current.has(we) ? (E(le.current), L.current.delete(we)) : (de(), t.current?.setDraft(fe)), { type: "aborted" };
|
|
34628
34675
|
}
|
|
34629
34676
|
throw ce;
|
|
34630
|
-
},
|
|
34677
|
+
}, Qe = async () => {
|
|
34631
34678
|
m(le.current, bt.Sending);
|
|
34632
34679
|
try {
|
|
34633
34680
|
if (!a.transport.sendMultiUserMessage)
|
|
@@ -34638,7 +34685,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34638
34685
|
return tt(ce);
|
|
34639
34686
|
}
|
|
34640
34687
|
}, je = async () => {
|
|
34641
|
-
let ce = `pending-${Date.now()}`,
|
|
34688
|
+
let ce = `pending-${Date.now()}`, we = "", be;
|
|
34642
34689
|
m(le.current, bt.Streaming), _(le.current, {
|
|
34643
34690
|
id: ce,
|
|
34644
34691
|
content: "",
|
|
@@ -34646,35 +34693,35 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34646
34693
|
toolCalls: [],
|
|
34647
34694
|
attachments: [],
|
|
34648
34695
|
chat: s || "",
|
|
34649
|
-
role:
|
|
34696
|
+
role: Ze.Assistant,
|
|
34650
34697
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
34651
34698
|
});
|
|
34652
34699
|
try {
|
|
34653
|
-
let
|
|
34700
|
+
let Be = s;
|
|
34654
34701
|
const q = (te) => {
|
|
34655
34702
|
if (te.type === un.Chat && te.chat) {
|
|
34656
|
-
p(te.chat),
|
|
34703
|
+
p(te.chat), Be = te.chat.id, J && (T.current = te.chat.id, f(le.current, te.chat.id), le.current = te.chat.id, h(te.chat.id));
|
|
34657
34704
|
return;
|
|
34658
34705
|
}
|
|
34659
34706
|
if (te.type === un.Reasoning && te.reasoning) {
|
|
34660
|
-
|
|
34707
|
+
we += te.reasoning, be = { ...be ?? {
|
|
34661
34708
|
id: ce,
|
|
34662
|
-
chat:
|
|
34663
|
-
role:
|
|
34709
|
+
chat: Be,
|
|
34710
|
+
role: Ze.Assistant,
|
|
34664
34711
|
content: "",
|
|
34665
34712
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
34666
|
-
}, reasoning:
|
|
34713
|
+
}, reasoning: we }, _(le.current, be);
|
|
34667
34714
|
return;
|
|
34668
34715
|
}
|
|
34669
34716
|
if (te.type === un.Error && te.error)
|
|
34670
34717
|
throw new Error(te.error);
|
|
34671
|
-
if (te.message && te.message.role ===
|
|
34718
|
+
if (te.message && te.message.role === Ze.User) {
|
|
34672
34719
|
v(te.message.chat, [te.message]);
|
|
34673
34720
|
return;
|
|
34674
34721
|
}
|
|
34675
34722
|
te.message && (ce = te.message.id, be = {
|
|
34676
34723
|
...te.message,
|
|
34677
|
-
reasoning:
|
|
34724
|
+
reasoning: we || te.message.reasoning
|
|
34678
34725
|
}, _(le.current, be)), te.done && (be && v(le.current, [be]), m(le.current, bt.Idle), de());
|
|
34679
34726
|
}, Z = await a.transport.streamMessage(
|
|
34680
34727
|
Ke,
|
|
@@ -34683,24 +34730,24 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34683
34730
|
);
|
|
34684
34731
|
if (Z) {
|
|
34685
34732
|
const te = Z.messages.map(
|
|
34686
|
-
(Le) => be && Le.id === be.id && Le.role ===
|
|
34733
|
+
(Le) => be && Le.id === be.id && Le.role === Ze.Assistant ? { ...Le, reasoning: we } : Le
|
|
34687
34734
|
);
|
|
34688
34735
|
v(Z.id, te);
|
|
34689
34736
|
const pe = a.store.getState();
|
|
34690
34737
|
return (pe.activeChatId ?? pe.draftChatKey) === le.current && h(Z.id), de(), { type: "success" };
|
|
34691
34738
|
}
|
|
34692
34739
|
return de(), { type: "success" };
|
|
34693
|
-
} catch (
|
|
34694
|
-
return tt(
|
|
34740
|
+
} catch (Be) {
|
|
34741
|
+
return tt(Be);
|
|
34695
34742
|
}
|
|
34696
34743
|
};
|
|
34697
34744
|
try {
|
|
34698
|
-
const ce = await (n ?
|
|
34745
|
+
const ce = await (n ? Qe() : je());
|
|
34699
34746
|
return ce.type === "success" && (z.current = !1), ce;
|
|
34700
34747
|
} catch (ce) {
|
|
34701
34748
|
de();
|
|
34702
|
-
const
|
|
34703
|
-
|
|
34749
|
+
const we = ce?.chat;
|
|
34750
|
+
we && (p(we), h(we.id));
|
|
34704
34751
|
const be = ce instanceof Error ? ce : new Error("Failed to send message");
|
|
34705
34752
|
return g(le.current, be.message || "Failed to send message"), m(le.current, bt.Idle), t.current?.setDraft(fe), z.current = !1, { type: "error", error: be };
|
|
34706
34753
|
} finally {
|
|
@@ -34727,7 +34774,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34727
34774
|
t,
|
|
34728
34775
|
g
|
|
34729
34776
|
]
|
|
34730
|
-
), W =
|
|
34777
|
+
), W = Ye(async () => {
|
|
34731
34778
|
if (d !== bt.Idle || P.current || !u.length || z.current)
|
|
34732
34779
|
return;
|
|
34733
34780
|
const j = u[0];
|
|
@@ -34741,7 +34788,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34741
34788
|
$e(() => {
|
|
34742
34789
|
W();
|
|
34743
34790
|
}, [W]);
|
|
34744
|
-
const R =
|
|
34791
|
+
const R = Ye(
|
|
34745
34792
|
async (j) => {
|
|
34746
34793
|
if (P.current)
|
|
34747
34794
|
return;
|
|
@@ -34756,7 +34803,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34756
34803
|
}
|
|
34757
34804
|
},
|
|
34758
34805
|
[u, U, w, Q]
|
|
34759
|
-
), H =
|
|
34806
|
+
), H = Ye(
|
|
34760
34807
|
async (j) => {
|
|
34761
34808
|
const K = t.current.getDraft().attachments;
|
|
34762
34809
|
if (!n && d !== bt.Idle) {
|
|
@@ -34775,11 +34822,11 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
|
|
|
34775
34822
|
x,
|
|
34776
34823
|
S
|
|
34777
34824
|
]
|
|
34778
|
-
), V =
|
|
34825
|
+
), V = Ye(() => {
|
|
34779
34826
|
z.current = !0;
|
|
34780
34827
|
const j = T.current ?? U;
|
|
34781
34828
|
L.current.add(j), a.transport.cancelStream?.(j), E(j), m(j, bt.Idle);
|
|
34782
|
-
}, [U, a.transport, E, m]), D =
|
|
34829
|
+
}, [U, a.transport, E, m]), D = Ye(
|
|
34783
34830
|
async (j) => {
|
|
34784
34831
|
d === bt.Streaming && V(), await R(j);
|
|
34785
34832
|
},
|
|
@@ -34926,7 +34973,7 @@ const U3 = (e, t) => {
|
|
|
34926
34973
|
return /* @__PURE__ */ C(A5, { size: 12 });
|
|
34927
34974
|
}
|
|
34928
34975
|
}, L_e = ({ attachments: e }) => {
|
|
34929
|
-
const { config: t } =
|
|
34976
|
+
const { config: t } = Pe();
|
|
34930
34977
|
return !e || e.length === 0 ? null : /* @__PURE__ */ C("div", { className: "mp-agent-message-attachments", "aria-label": "Message attachments", children: e.map((n, r) => {
|
|
34931
34978
|
const a = /* @__PURE__ */ oe(en, { children: [
|
|
34932
34979
|
/* @__PURE__ */ C("span", { className: "mp-agent-message-attachment-icon", children: U3(n, t.contextAttachmentIcons) }),
|
|
@@ -34946,7 +34993,7 @@ const U3 = (e, t) => {
|
|
|
34946
34993
|
) : /* @__PURE__ */ C("span", { className: "mp-agent-message-attachment", title: n.mimeType ?? n.name, children: a }, n.id || r);
|
|
34947
34994
|
}) });
|
|
34948
34995
|
}, D_e = ({ attachments: e, onRemove: t, uploadProgress: n, uploadErrors: r }) => {
|
|
34949
|
-
const a = yn(), { config: i } =
|
|
34996
|
+
const a = yn(), { config: i } = Pe();
|
|
34950
34997
|
return !e || e.length === 0 ? null : /* @__PURE__ */ C("div", { className: "mp-agent-composer-attachments", "aria-label": a.attachments, children: e.map((o) => {
|
|
34951
34998
|
const s = n?.get(o.id), l = r?.get(o.name), u = o.metadata?.size || o.size, d = u ? ` (${Mp(u)})` : "";
|
|
34952
34999
|
return /* @__PURE__ */ oe(
|
|
@@ -35144,7 +35191,7 @@ const V_e = ({
|
|
|
35144
35191
|
searchPlaceholder: u = "Search...",
|
|
35145
35192
|
searchFilter: d
|
|
35146
35193
|
}) => {
|
|
35147
|
-
const [p, m] = et(!1), [h, g] = et(null), [f, w] = et(""), _ =
|
|
35194
|
+
const [p, m] = et(!1), [h, g] = et(null), [f, w] = et(""), _ = ze([]), b = ze(null), { refs: v, floatingStyles: E, context: S, isPositioned: x } = hp({
|
|
35148
35195
|
open: p,
|
|
35149
35196
|
onOpenChange: m,
|
|
35150
35197
|
placement: s,
|
|
@@ -35289,7 +35336,7 @@ const V_e = ({
|
|
|
35289
35336
|
)
|
|
35290
35337
|
] });
|
|
35291
35338
|
}, j_e = Rt(() => {
|
|
35292
|
-
const e =
|
|
35339
|
+
const e = Pe(), t = ge((p) => p.composer), n = ge((p) => p.contextKey), r = ge((p) => p.setComposerOptions), a = e.config.models, { data: i, isLoading: o } = i7e(), s = lt(() => {
|
|
35293
35340
|
const p = i && i.length > 0 ? i : a;
|
|
35294
35341
|
return M3(p, e.config.transport).filter((h) => !h.contexts?.length || h.contexts.includes(n));
|
|
35295
35342
|
}, [i, a, e.config.transport, n]), l = lt(() => {
|
|
@@ -35298,7 +35345,7 @@ const V_e = ({
|
|
|
35298
35345
|
}, [s]), u = lt(
|
|
35299
35346
|
() => t.model !== void 0 ? t.model : ma,
|
|
35300
35347
|
[t.model]
|
|
35301
|
-
), d =
|
|
35348
|
+
), d = Ye(
|
|
35302
35349
|
(p) => {
|
|
35303
35350
|
p === ma ? (r({ model: void 0 }), T2(e.config.transport, ma)) : (r({ model: p }), T2(e.config.transport, p));
|
|
35304
35351
|
},
|
|
@@ -35425,7 +35472,7 @@ function Y_e(e) {
|
|
|
35425
35472
|
});
|
|
35426
35473
|
}
|
|
35427
35474
|
const Z_e = () => {
|
|
35428
|
-
const e = yn(), t =
|
|
35475
|
+
const e = yn(), t = Pe(), n = ge((l) => l.contextKey), { data: r, isLoading: a, isError: i } = l7e(n), o = lt(() => Y_e(r ?? []), [r]), s = !!t.transport.upsertAgentPreferences && !!t.transport.upsertAgentPreferencesBatch;
|
|
35429
35476
|
return a ? /* @__PURE__ */ C(en, { children: e.agentSettingsLoading }) : i ? /* @__PURE__ */ C(en, { children: e.agentSettingsError }) : /* @__PURE__ */ C(K_e, { preferences: o, disabled: !s });
|
|
35430
35477
|
}, X_e = () => {
|
|
35431
35478
|
const [e, t] = et(!1), n = yn(), { refs: r, floatingStyles: a, context: i, isPositioned: o } = hp({
|
|
@@ -35472,7 +35519,7 @@ const Z_e = () => {
|
|
|
35472
35519
|
] });
|
|
35473
35520
|
}, Q_e = co(
|
|
35474
35521
|
({ autoFocus: e, activeChatId: t, status: n, onStop: r, onSubmit: a }, i) => {
|
|
35475
|
-
const o = yn(), s =
|
|
35522
|
+
const o = yn(), s = Pe(), l = ze(null), u = ze(null), d = ge((re) => re.activeChatId ?? re.draftChatKey), p = ge((re) => Fe(re, d).composerDraft), m = ge((re) => Fe(re, d).composerError), h = ge((re) => Fe(re, d).pageContextDismissed), g = ge((re) => re.setComposerValue), f = ge((re) => re.setComposerDraft), w = ge((re) => re.clearComposerDraft), _ = ge((re) => re.setComposerError), b = ge((re) => re.addComposerAttachments), v = ge((re) => re.removeComposerAttachment), E = ge((re) => re.setPageContextDismissed), S = p.value, x = p.attachments, [z, P] = et(/* @__PURE__ */ new Map()), [T, L] = et(/* @__PURE__ */ new Map()), U = ze(S), Y = ze(x), Q = ze(h), W = s.config.features?.pageContextAttachments !== !1, R = s.config.composerAttachmentActions, H = (re) => re.type === kt.Context && re?.metadata?.kind === "pageContext", V = x.some(H), D = () => {
|
|
35476
35523
|
if (W)
|
|
35477
35524
|
return s.buildPageContextAttachment();
|
|
35478
35525
|
};
|
|
@@ -35498,7 +35545,7 @@ const Z_e = () => {
|
|
|
35498
35545
|
const He = D();
|
|
35499
35546
|
if (!He)
|
|
35500
35547
|
return;
|
|
35501
|
-
const
|
|
35548
|
+
const Xe = { ...He, id: Se.id }, Ae = re.map((ve) => ve.id === Se.id ? Xe : ve);
|
|
35502
35549
|
f(d, { value: U.current, attachments: Ae });
|
|
35503
35550
|
});
|
|
35504
35551
|
}, [W, d, f]), E7(i, () => ({
|
|
@@ -35520,12 +35567,12 @@ const Z_e = () => {
|
|
|
35520
35567
|
const j = async (re) => {
|
|
35521
35568
|
if (!re || re.length === 0)
|
|
35522
35569
|
return;
|
|
35523
|
-
const Se = Array.from(re), He = O_e(),
|
|
35524
|
-
if (
|
|
35570
|
+
const Se = Array.from(re), He = O_e(), Xe = I_e(Se, x, He);
|
|
35571
|
+
if (Xe) {
|
|
35525
35572
|
L((Ae) => {
|
|
35526
35573
|
const ve = new Map(Ae);
|
|
35527
35574
|
return Se.forEach((Ke) => {
|
|
35528
|
-
ve.set(Ke.name,
|
|
35575
|
+
ve.set(Ke.name, Xe.message);
|
|
35529
35576
|
}), ve;
|
|
35530
35577
|
});
|
|
35531
35578
|
return;
|
|
@@ -35549,15 +35596,15 @@ const Z_e = () => {
|
|
|
35549
35596
|
userId: s.config.user?.id,
|
|
35550
35597
|
onProgress: (de) => {
|
|
35551
35598
|
P((tt) => {
|
|
35552
|
-
const
|
|
35553
|
-
return
|
|
35599
|
+
const Qe = new Map(tt);
|
|
35600
|
+
return Qe.set(de.fileId, de), Qe;
|
|
35554
35601
|
});
|
|
35555
35602
|
}
|
|
35556
35603
|
});
|
|
35557
35604
|
b(d, Ke), setTimeout(() => {
|
|
35558
35605
|
P((de) => {
|
|
35559
35606
|
const tt = new Map(de);
|
|
35560
|
-
return Ke.forEach((
|
|
35607
|
+
return Ke.forEach((Qe) => tt.delete(Qe.id)), tt;
|
|
35561
35608
|
});
|
|
35562
35609
|
}, 2e3);
|
|
35563
35610
|
} catch (Ae) {
|
|
@@ -35577,13 +35624,13 @@ const Z_e = () => {
|
|
|
35577
35624
|
return !1;
|
|
35578
35625
|
if (x.some((Ae) => Ae.type === kt.Link && Ae.url === Se))
|
|
35579
35626
|
return !0;
|
|
35580
|
-
const He = z_e(Se),
|
|
35627
|
+
const He = z_e(Se), Xe = {
|
|
35581
35628
|
id: At(),
|
|
35582
35629
|
url: Se,
|
|
35583
35630
|
name: He,
|
|
35584
35631
|
type: kt.Link
|
|
35585
35632
|
};
|
|
35586
|
-
return b(d, [
|
|
35633
|
+
return b(d, [Xe]), !0;
|
|
35587
35634
|
}, J = async (re) => {
|
|
35588
35635
|
await j(re.target.files), re.target.value = "";
|
|
35589
35636
|
}, O = (re) => {
|
|
@@ -35595,7 +35642,7 @@ const Z_e = () => {
|
|
|
35595
35642
|
const re = v7e(), Se = re?.selectedText ?? window.getSelection?.()?.toString()?.trim() ?? "";
|
|
35596
35643
|
if (!Se)
|
|
35597
35644
|
return !1;
|
|
35598
|
-
const He = window.location?.href,
|
|
35645
|
+
const He = window.location?.href, Xe = Se.slice(0, 20), Ae = Se.length > 20 ? Xe + "..." : Se, ve = bp({
|
|
35599
35646
|
kind: "webSnippet",
|
|
35600
35647
|
url: He,
|
|
35601
35648
|
title: Ae,
|
|
@@ -35612,7 +35659,7 @@ const Z_e = () => {
|
|
|
35612
35659
|
re.key === "Enter" && !re.shiftKey && (re.preventDefault(), fe(re));
|
|
35613
35660
|
}, Ce = (re) => {
|
|
35614
35661
|
m && _(d, void 0), g(d, re.target.value);
|
|
35615
|
-
},
|
|
35662
|
+
}, qe = (re) => {
|
|
35616
35663
|
if (re.nativeEvent.shiftKey)
|
|
35617
35664
|
return;
|
|
35618
35665
|
const Se = re.clipboardData?.getData("text/plain") ?? "";
|
|
@@ -35644,7 +35691,7 @@ const Z_e = () => {
|
|
|
35644
35691
|
placeholder: t ? o.followUp : o.newChat,
|
|
35645
35692
|
onChange: Ce,
|
|
35646
35693
|
onKeyDown: ke,
|
|
35647
|
-
onPaste:
|
|
35694
|
+
onPaste: qe
|
|
35648
35695
|
}
|
|
35649
35696
|
)
|
|
35650
35697
|
] }),
|
|
@@ -35723,7 +35770,7 @@ const Z_e = () => {
|
|
|
35723
35770
|
] });
|
|
35724
35771
|
}
|
|
35725
35772
|
), J_e = ({ autoFocus: e, multiUser: t = !1, participantIds: n }) => {
|
|
35726
|
-
const r =
|
|
35773
|
+
const r = ze({
|
|
35727
35774
|
setValue: () => {
|
|
35728
35775
|
},
|
|
35729
35776
|
getDraft: () => ({ value: "", attachments: [] }),
|
|
@@ -36397,7 +36444,7 @@ function dwe(e) {
|
|
|
36397
36444
|
});
|
|
36398
36445
|
}
|
|
36399
36446
|
const V3 = Rt(() => {
|
|
36400
|
-
const e = ge((n) => n.activeChatId ?? n.draftChatKey), t = ge((n) =>
|
|
36447
|
+
const e = ge((n) => n.activeChatId ?? n.draftChatKey), t = ge((n) => Fe(n, e).composerError);
|
|
36401
36448
|
return t ? /* @__PURE__ */ C("div", { className: "mp-agent-composer-error", children: t }) : null;
|
|
36402
36449
|
});
|
|
36403
36450
|
V3.displayName = "ComposerError";
|
|
@@ -36426,7 +36473,7 @@ const pwe = (e, t) => {
|
|
|
36426
36473
|
return "[unserializable]";
|
|
36427
36474
|
}
|
|
36428
36475
|
}
|
|
36429
|
-
}, H2 = ({ call: e }) =>
|
|
36476
|
+
}, H2 = ({ call: e }) => Pe().config.debug ? /* @__PURE__ */ oe("details", { className: "mp-agent-tool-debug-details", children: [
|
|
36430
36477
|
/* @__PURE__ */ C("summary", { className: "mp-agent-tool-debug-summary", children: "Details" }),
|
|
36431
36478
|
/* @__PURE__ */ oe("div", { className: "mp-agent-tool-debug-body", children: [
|
|
36432
36479
|
/* @__PURE__ */ oe("div", { className: "mp-agent-tool-debug-row", children: [
|
|
@@ -36451,7 +36498,7 @@ const pwe = (e, t) => {
|
|
|
36451
36498
|
] })
|
|
36452
36499
|
] })
|
|
36453
36500
|
] }) : null, V2 = ({ call: e, isExpandable: t = !1, isExpanded: n = !1, onToggleExpand: r }) => {
|
|
36454
|
-
const a =
|
|
36501
|
+
const a = Pe(), i = ze(!1), o = e.status === Mt.Succeeded || e.status === Mt.Failed, s = t || a.config.debug && !o, l = s || t;
|
|
36455
36502
|
if ($e(() => {
|
|
36456
36503
|
!t || o || n || i.current || (i.current = !0, r?.());
|
|
36457
36504
|
}, [t, o, n, r]), !l)
|
|
@@ -36581,7 +36628,7 @@ const j3 = ({ call: e }) => {
|
|
|
36581
36628
|
/* @__PURE__ */ C("div", { className: "mp-agent-tool-approval-actions", children: /* @__PURE__ */ C("button", { className: "mp-agent-tool-approve-button", onClick: m, disabled: n, children: n ? "Submitting..." : "Submit response" }) })
|
|
36582
36629
|
] }) : /* @__PURE__ */ C("div", { className: "mp-agent-tool-user-action-form", children: /* @__PURE__ */ C("div", { className: "mp-agent-tool-input-error", children: "Invalid user action input schema in tool call." }) });
|
|
36583
36630
|
}, gwe = ({ call: e, messageId: t, chatId: n, onApprovalSent: r }) => {
|
|
36584
|
-
const a =
|
|
36631
|
+
const a = Pe(), i = a.tools.get(e.name)?.label ?? e.name, o = ge((U) => U.appendMessagesToChat), s = ge((U) => U.setChatMessages), l = ge((U) => U.setChatStatus), u = ge((U) => U.setPendingAssistant), [d, p] = et(!1), [m, h] = et(!1), [g, f] = et(!1), [w, _] = et(JSON.stringify(e.input ?? {}, null, 2)), [b, v] = et(void 0), E = a.config.user?.id ?? "guest", S = e.requiresUserAction;
|
|
36585
36632
|
$e(() => {
|
|
36586
36633
|
m || (_(JSON.stringify(e.input ?? {}, null, 2)), v(void 0));
|
|
36587
36634
|
}, [e.id, e.input, m]);
|
|
@@ -36624,7 +36671,7 @@ const j3 = ({ call: e }) => {
|
|
|
36624
36671
|
p(!0), T({ approved: U, ...Y ? { userResponse: Y } : {} }), l(n, bt.Streaming), u(n, {
|
|
36625
36672
|
id: `pending-approval-${e.id}`,
|
|
36626
36673
|
chat: n,
|
|
36627
|
-
role:
|
|
36674
|
+
role: Ze.Assistant,
|
|
36628
36675
|
content: "",
|
|
36629
36676
|
reasoning: "",
|
|
36630
36677
|
toolCalls: [],
|
|
@@ -36735,7 +36782,7 @@ const j3 = ({ call: e }) => {
|
|
|
36735
36782
|
] })
|
|
36736
36783
|
] });
|
|
36737
36784
|
}, j2 = ({ call: e, messageId: t, chatId: n }) => {
|
|
36738
|
-
const r =
|
|
36785
|
+
const r = Pe(), a = ge((p) => p.upsertChat), i = ge((p) => p.setChatStatus), o = r.config.debug && !!e.approvalId, s = e.requiresConfirmation && e.approvalId || o, l = s && e.approved === void 0, u = s && e.approved !== void 0, d = async () => {
|
|
36739
36786
|
try {
|
|
36740
36787
|
const p = await r.transport.getChat(n);
|
|
36741
36788
|
a(p), i(n, Ca(p.status));
|
|
@@ -36748,11 +36795,11 @@ const j3 = ({ call: e }) => {
|
|
|
36748
36795
|
u && /* @__PURE__ */ C(j3, { call: e })
|
|
36749
36796
|
] });
|
|
36750
36797
|
}, G2 = ({ chatId: e, isExpanded: t }) => {
|
|
36751
|
-
const n =
|
|
36798
|
+
const n = Pe(), r = ge((l) => Fe(l, e).messages), a = ge((l) => Fe(l, e).pendingAssistant), i = ge((l) => l.chats[e]?.contextKey ?? l.contextKey), o = v3(e), s = lt(() => {
|
|
36752
36799
|
const l = [...r].sort((d, p) => d.createdAt.localeCompare(p.createdAt));
|
|
36753
36800
|
if (n.config.debug)
|
|
36754
36801
|
return l;
|
|
36755
|
-
const u = l.findIndex((d) => d.role ===
|
|
36802
|
+
const u = l.findIndex((d) => d.role === Ze.User);
|
|
36756
36803
|
return u === -1 ? l : l.filter((d, p) => p !== u);
|
|
36757
36804
|
}, [r, n.config.debug]);
|
|
36758
36805
|
return /* @__PURE__ */ C("div", { className: "mp-agent-subagent-preview", children: t && /* @__PURE__ */ C("div", { className: "mp-agent-subagent-preview-body", children: s.length === 0 && !a ? /* @__PURE__ */ C("div", { className: "mp-agent-subagent-preview-empty", children: o.isLoading ? "Loading subagent chat..." : "Subagent chat started." }) : /* @__PURE__ */ oe(en, { children: [
|
|
@@ -36760,8 +36807,25 @@ const j3 = ({ call: e }) => {
|
|
|
36760
36807
|
a && /* @__PURE__ */ C(lo, { message: a, contextKey: i, isStreaming: !0 })
|
|
36761
36808
|
] }) }) });
|
|
36762
36809
|
}, G3 = ({ call: e, contextKey: t, messageId: n, chatId: r }) => {
|
|
36763
|
-
const a =
|
|
36764
|
-
|
|
36810
|
+
const a = Pe(), i = e.subagentChatId || (typeof e.input?.subagentChatId == "string" ? e.input.subagentChatId : void 0), [o, s] = et(!1), l = lt(() => a.getToolRenderer(e), [a, e]);
|
|
36811
|
+
if (!l) {
|
|
36812
|
+
const u = !!(e.requiresConfirmation && e.approvalId);
|
|
36813
|
+
return !!i || a.config.debug || u ? /* @__PURE__ */ oe("div", { className: "mp-agent-tool-panel", children: [
|
|
36814
|
+
/* @__PURE__ */ C(
|
|
36815
|
+
V2,
|
|
36816
|
+
{
|
|
36817
|
+
call: e,
|
|
36818
|
+
isExpandable: !!i,
|
|
36819
|
+
isExpanded: o,
|
|
36820
|
+
onToggleExpand: () => s((p) => !p)
|
|
36821
|
+
}
|
|
36822
|
+
),
|
|
36823
|
+
/* @__PURE__ */ C(j2, { call: e, messageId: n, chatId: r }),
|
|
36824
|
+
i && /* @__PURE__ */ C(G2, { chatId: i, isExpanded: o }),
|
|
36825
|
+
!i && /* @__PURE__ */ C(H2, { call: e })
|
|
36826
|
+
] }) : null;
|
|
36827
|
+
}
|
|
36828
|
+
return /* @__PURE__ */ oe("div", { className: "mp-agent-tool-panel", children: [
|
|
36765
36829
|
i && /* @__PURE__ */ C(
|
|
36766
36830
|
V2,
|
|
36767
36831
|
{
|
|
@@ -36775,34 +36839,21 @@ const j3 = ({ call: e }) => {
|
|
|
36775
36839
|
/* @__PURE__ */ C(j2, { call: e, messageId: n, chatId: r }),
|
|
36776
36840
|
i && /* @__PURE__ */ C(G2, { chatId: i, isExpanded: o }),
|
|
36777
36841
|
!i && /* @__PURE__ */ C(H2, { call: e })
|
|
36778
|
-
] }) : /* @__PURE__ */ oe("div", { className: "mp-agent-tool-panel", children: [
|
|
36779
|
-
/* @__PURE__ */ C(
|
|
36780
|
-
V2,
|
|
36781
|
-
{
|
|
36782
|
-
call: e,
|
|
36783
|
-
isExpandable: !!i,
|
|
36784
|
-
isExpanded: o,
|
|
36785
|
-
onToggleExpand: () => s((u) => !u)
|
|
36786
|
-
}
|
|
36787
|
-
),
|
|
36788
|
-
/* @__PURE__ */ C(j2, { call: e, messageId: n, chatId: r }),
|
|
36789
|
-
i && /* @__PURE__ */ C(G2, { chatId: i, isExpanded: o }),
|
|
36790
|
-
!i && /* @__PURE__ */ C(H2, { call: e })
|
|
36791
36842
|
] });
|
|
36792
36843
|
}, ywe = (e) => {
|
|
36793
36844
|
const t = e.sender?.displayName || e.sender?.id || e.agentName;
|
|
36794
36845
|
if (!t)
|
|
36795
|
-
return e.role ===
|
|
36846
|
+
return e.role === Ze.User ? "You" : "AI";
|
|
36796
36847
|
const n = t.split(/\s+/).filter(Boolean);
|
|
36797
36848
|
return n.length >= 2 ? `${n[0][0]}${n[1][0]}`.toUpperCase() : t.slice(0, 2).toUpperCase();
|
|
36798
36849
|
}, W3 = Rt(({ message: e, isGrouped: t }) => {
|
|
36799
36850
|
if (t)
|
|
36800
36851
|
return /* @__PURE__ */ C("div", { className: "mp-agent-message-avatar-spacer" });
|
|
36801
|
-
const n = e.role ===
|
|
36852
|
+
const n = e.role === Ze.User;
|
|
36802
36853
|
return /* @__PURE__ */ C("div", { className: `mp-agent-message-avatar ${n ? "mp-agent-message-avatar-user" : ""}`, children: e.sender?.avatarUrl ? /* @__PURE__ */ C("img", { className: "mp-agent-message-avatar-image", src: e.sender.avatarUrl, alt: "" }) : /* @__PURE__ */ C("div", { className: "mp-agent-message-avatar-icon", children: ywe(e) }) });
|
|
36803
36854
|
});
|
|
36804
36855
|
W3.displayName = "MessageAvatar";
|
|
36805
|
-
const bwe = (e) => e ? new Date(e).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" }) : "", kwe = (e) => e.sender?.displayName ? e.sender.displayName : e.sender?.id && e.sender.id !== "guest" ? e.sender.id : e.agentName ? e.agentName : e.role ===
|
|
36856
|
+
const bwe = (e) => e ? new Date(e).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" }) : "", kwe = (e) => e.sender?.displayName ? e.sender.displayName : e.sender?.id && e.sender.id !== "guest" ? e.sender.id : e.agentName ? e.agentName : e.role === Ze.User ? "You" : "Assistant", K3 = Rt(({ message: e, isGrouped: t }) => {
|
|
36806
36857
|
if (t)
|
|
36807
36858
|
return null;
|
|
36808
36859
|
const n = kwe(e);
|
|
@@ -40659,14 +40710,14 @@ function kEe(e, t, n) {
|
|
|
40659
40710
|
) : K(W);
|
|
40660
40711
|
function K(ke) {
|
|
40661
40712
|
return Ce;
|
|
40662
|
-
function Ce(
|
|
40663
|
-
const ot =
|
|
40713
|
+
function Ce(qe) {
|
|
40714
|
+
const ot = qe !== null && ke[qe], We = qe !== null && ke.null, re = [
|
|
40664
40715
|
// To do: add more extension tests.
|
|
40665
40716
|
/* c8 ignore next 2 */
|
|
40666
40717
|
...Array.isArray(ot) ? ot : ot ? [ot] : [],
|
|
40667
40718
|
...Array.isArray(We) ? We : We ? [We] : []
|
|
40668
40719
|
];
|
|
40669
|
-
return J(re)(
|
|
40720
|
+
return J(re)(qe);
|
|
40670
40721
|
}
|
|
40671
40722
|
}
|
|
40672
40723
|
function J(ke) {
|
|
@@ -40674,7 +40725,7 @@ function kEe(e, t, n) {
|
|
|
40674
40725
|
}
|
|
40675
40726
|
function O(ke) {
|
|
40676
40727
|
return Ce;
|
|
40677
|
-
function Ce(
|
|
40728
|
+
function Ce(qe) {
|
|
40678
40729
|
return N = T(), j = ke, ke.partial || (u.currentConstruct = ke), ke.name && u.parser.constructs.disable.null.includes(ke.name) ? fe() : ke.tokenize.call(
|
|
40679
40730
|
// If we do have fields, create an object w/ `context` as its
|
|
40680
40731
|
// prototype.
|
|
@@ -40683,7 +40734,7 @@ function kEe(e, t, n) {
|
|
|
40683
40734
|
l,
|
|
40684
40735
|
le,
|
|
40685
40736
|
fe
|
|
40686
|
-
)(
|
|
40737
|
+
)(qe);
|
|
40687
40738
|
}
|
|
40688
40739
|
}
|
|
40689
40740
|
function le(ke) {
|
|
@@ -40872,7 +40923,7 @@ function TEe(e) {
|
|
|
40872
40923
|
definitionDestinationString: o,
|
|
40873
40924
|
definitionLabelString: o,
|
|
40874
40925
|
definitionTitleString: o,
|
|
40875
|
-
emphasis: i(
|
|
40926
|
+
emphasis: i(Xe),
|
|
40876
40927
|
hardBreakEscape: i(ve),
|
|
40877
40928
|
hardBreakTrailing: i(ve),
|
|
40878
40929
|
htmlFlow: i(Ke, o),
|
|
@@ -40884,23 +40935,23 @@ function TEe(e) {
|
|
|
40884
40935
|
link: i(tt),
|
|
40885
40936
|
listItem: i(je),
|
|
40886
40937
|
listItemValue: m,
|
|
40887
|
-
listOrdered: i(
|
|
40888
|
-
listUnordered: i(
|
|
40938
|
+
listOrdered: i(Qe, p),
|
|
40939
|
+
listUnordered: i(Qe),
|
|
40889
40940
|
paragraph: i(ce),
|
|
40890
40941
|
reference: O,
|
|
40891
40942
|
referenceString: o,
|
|
40892
40943
|
resourceDestinationString: o,
|
|
40893
40944
|
resourceTitleString: o,
|
|
40894
40945
|
setextHeading: i(Ae),
|
|
40895
|
-
strong: i(
|
|
40896
|
-
thematicBreak: i(
|
|
40946
|
+
strong: i(we),
|
|
40947
|
+
thematicBreak: i(Be)
|
|
40897
40948
|
},
|
|
40898
40949
|
exit: {
|
|
40899
40950
|
atxHeading: l(),
|
|
40900
40951
|
atxHeadingSequence: S,
|
|
40901
40952
|
autolink: l(),
|
|
40902
40953
|
autolinkEmail: ot,
|
|
40903
|
-
autolinkProtocol:
|
|
40954
|
+
autolinkProtocol: qe,
|
|
40904
40955
|
blockQuote: l(),
|
|
40905
40956
|
characterEscapeValue: L,
|
|
40906
40957
|
characterReferenceMarkerHexadecimal: fe,
|
|
@@ -40965,20 +41016,20 @@ function TEe(e) {
|
|
|
40965
41016
|
resume: d,
|
|
40966
41017
|
data: n
|
|
40967
41018
|
}, pe = [];
|
|
40968
|
-
let
|
|
40969
|
-
for (; ++
|
|
40970
|
-
if (q[
|
|
40971
|
-
if (q[
|
|
40972
|
-
pe.push(
|
|
41019
|
+
let Me = -1;
|
|
41020
|
+
for (; ++Me < q.length; )
|
|
41021
|
+
if (q[Me][1].type === "listOrdered" || q[Me][1].type === "listUnordered")
|
|
41022
|
+
if (q[Me][0] === "enter")
|
|
41023
|
+
pe.push(Me);
|
|
40973
41024
|
else {
|
|
40974
41025
|
const Le = pe.pop();
|
|
40975
|
-
|
|
41026
|
+
Me = a(q, Le, Me);
|
|
40976
41027
|
}
|
|
40977
|
-
for (
|
|
40978
|
-
const Le = t[q[
|
|
40979
|
-
wv.call(Le, q[
|
|
40980
|
-
sliceSerialize: q[
|
|
40981
|
-
}, te), q[
|
|
41028
|
+
for (Me = -1; ++Me < q.length; ) {
|
|
41029
|
+
const Le = t[q[Me][0]];
|
|
41030
|
+
wv.call(Le, q[Me][1].type) && Le[q[Me][1].type].call(Object.assign({
|
|
41031
|
+
sliceSerialize: q[Me][2].sliceSerialize
|
|
41032
|
+
}, te), q[Me][1]);
|
|
40982
41033
|
}
|
|
40983
41034
|
if (te.tokenStack.length > 0) {
|
|
40984
41035
|
const Le = te.tokenStack[te.tokenStack.length - 1];
|
|
@@ -40995,23 +41046,23 @@ function TEe(e) {
|
|
|
40995
41046
|
column: 1,
|
|
40996
41047
|
offset: 0
|
|
40997
41048
|
})
|
|
40998
|
-
},
|
|
40999
|
-
Z = t.transforms[
|
|
41049
|
+
}, Me = -1; ++Me < t.transforms.length; )
|
|
41050
|
+
Z = t.transforms[Me](Z) || Z;
|
|
41000
41051
|
return Z;
|
|
41001
41052
|
}
|
|
41002
41053
|
function a(q, Z, te) {
|
|
41003
|
-
let pe = Z - 1,
|
|
41054
|
+
let pe = Z - 1, Me = -1, Le = !1, wt, St, Qn, Jn;
|
|
41004
41055
|
for (; ++pe <= te; ) {
|
|
41005
41056
|
const _t = q[pe];
|
|
41006
41057
|
switch (_t[1].type) {
|
|
41007
41058
|
case "listUnordered":
|
|
41008
41059
|
case "listOrdered":
|
|
41009
41060
|
case "blockQuote": {
|
|
41010
|
-
_t[0] === "enter" ?
|
|
41061
|
+
_t[0] === "enter" ? Me++ : Me--, Jn = void 0;
|
|
41011
41062
|
break;
|
|
41012
41063
|
}
|
|
41013
41064
|
case "lineEndingBlank": {
|
|
41014
|
-
_t[0] === "enter" && (wt && !Jn && !
|
|
41065
|
+
_t[0] === "enter" && (wt && !Jn && !Me && !Qn && (Qn = pe), Jn = void 0);
|
|
41015
41066
|
break;
|
|
41016
41067
|
}
|
|
41017
41068
|
case "linePrefix":
|
|
@@ -41023,7 +41074,7 @@ function TEe(e) {
|
|
|
41023
41074
|
default:
|
|
41024
41075
|
Jn = void 0;
|
|
41025
41076
|
}
|
|
41026
|
-
if (!
|
|
41077
|
+
if (!Me && _t[0] === "enter" && _t[1].type === "listItemPrefix" || Me === -1 && _t[0] === "exit" && (_t[1].type === "listUnordered" || _t[1].type === "listOrdered")) {
|
|
41027
41078
|
if (wt) {
|
|
41028
41079
|
let Ot = pe;
|
|
41029
41080
|
for (St = void 0; Ot--; ) {
|
|
@@ -41239,14 +41290,14 @@ function TEe(e) {
|
|
|
41239
41290
|
const Z = this.sliceSerialize(q), te = this.data.characterReferenceType;
|
|
41240
41291
|
let pe;
|
|
41241
41292
|
te ? (pe = pv(Z, te === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : pe = Oa(Z);
|
|
41242
|
-
const
|
|
41243
|
-
|
|
41293
|
+
const Me = this.stack[this.stack.length - 1];
|
|
41294
|
+
Me.value += pe;
|
|
41244
41295
|
}
|
|
41245
41296
|
function Ce(q) {
|
|
41246
41297
|
const Z = this.stack.pop();
|
|
41247
41298
|
Z.position.end = er(q.end);
|
|
41248
41299
|
}
|
|
41249
|
-
function
|
|
41300
|
+
function qe(q) {
|
|
41250
41301
|
L.call(this, q);
|
|
41251
41302
|
const Z = this.stack[this.stack.length - 1];
|
|
41252
41303
|
Z.url = this.sliceSerialize(q);
|
|
@@ -41285,7 +41336,7 @@ function TEe(e) {
|
|
|
41285
41336
|
url: ""
|
|
41286
41337
|
};
|
|
41287
41338
|
}
|
|
41288
|
-
function
|
|
41339
|
+
function Xe() {
|
|
41289
41340
|
return {
|
|
41290
41341
|
type: "emphasis",
|
|
41291
41342
|
children: []
|
|
@@ -41326,7 +41377,7 @@ function TEe(e) {
|
|
|
41326
41377
|
children: []
|
|
41327
41378
|
};
|
|
41328
41379
|
}
|
|
41329
|
-
function
|
|
41380
|
+
function Qe(q) {
|
|
41330
41381
|
return {
|
|
41331
41382
|
type: "list",
|
|
41332
41383
|
ordered: q.type === "listOrdered",
|
|
@@ -41349,7 +41400,7 @@ function TEe(e) {
|
|
|
41349
41400
|
children: []
|
|
41350
41401
|
};
|
|
41351
41402
|
}
|
|
41352
|
-
function
|
|
41403
|
+
function we() {
|
|
41353
41404
|
return {
|
|
41354
41405
|
type: "strong",
|
|
41355
41406
|
children: []
|
|
@@ -41361,7 +41412,7 @@ function TEe(e) {
|
|
|
41361
41412
|
value: ""
|
|
41362
41413
|
};
|
|
41363
41414
|
}
|
|
41364
|
-
function
|
|
41415
|
+
function Be() {
|
|
41365
41416
|
return {
|
|
41366
41417
|
type: "thematicBreak"
|
|
41367
41418
|
};
|
|
@@ -46063,7 +46114,7 @@ class tr {
|
|
|
46063
46114
|
return this.size >= 2;
|
|
46064
46115
|
}
|
|
46065
46116
|
}
|
|
46066
|
-
var Hp = 0, Ji = 1, Xr = 2, Vn = 3, Da = 4, dn = 5, Jr = 6, Ft = 7, Sn = [new tr(Hp, 0, !1), new tr(Ji, 0, !0), new tr(Xr, 1, !1), new tr(Vn, 1, !0), new tr(Da, 2, !1), new tr(dn, 2, !0), new tr(Jr, 3, !1), new tr(Ft, 3, !0)], EAe = [Da, dn, Da, dn, Jr, Ft, Jr, Ft], MAe = [dn, dn, dn, dn, Ft, Ft, Ft, Ft], SAe = [Xr, Vn, Da, dn, Jr, Ft, Jr, Ft], NAe = [Vn, Vn, dn, dn, Ft, Ft, Ft, Ft], AAe = [Ji, Ji, Vn, Vn, dn, dn, Ft, Ft], TAe = [Hp, Ji, Xr, Vn, Xr, Vn, Xr, Vn],
|
|
46117
|
+
var Hp = 0, Ji = 1, Xr = 2, Vn = 3, Da = 4, dn = 5, Jr = 6, Ft = 7, Sn = [new tr(Hp, 0, !1), new tr(Ji, 0, !0), new tr(Xr, 1, !1), new tr(Vn, 1, !0), new tr(Da, 2, !1), new tr(dn, 2, !0), new tr(Jr, 3, !1), new tr(Ft, 3, !0)], EAe = [Da, dn, Da, dn, Jr, Ft, Jr, Ft], MAe = [dn, dn, dn, dn, Ft, Ft, Ft, Ft], SAe = [Xr, Vn, Da, dn, Jr, Ft, Jr, Ft], NAe = [Vn, Vn, dn, dn, Ft, Ft, Ft, Ft], AAe = [Ji, Ji, Vn, Vn, dn, dn, Ft, Ft], TAe = [Hp, Ji, Xr, Vn, Xr, Vn, Xr, Vn], Ee = {
|
|
46067
46118
|
DISPLAY: Sn[Hp],
|
|
46068
46119
|
TEXT: Sn[Xr],
|
|
46069
46120
|
SCRIPT: Sn[Da],
|
|
@@ -49341,7 +49392,7 @@ function y(e, t, n, r, a, i) {
|
|
|
49341
49392
|
replace: r
|
|
49342
49393
|
}, i && r && (it[e][r] = it[e][a]);
|
|
49343
49394
|
}
|
|
49344
|
-
var k = "math", ne = "text", M = "main", $ = "ams", ct = "accent-token", ye = "bin", Pt = "close", oa = "inner",
|
|
49395
|
+
var k = "math", ne = "text", M = "main", $ = "ams", ct = "accent-token", ye = "bin", Pt = "close", oa = "inner", xe = "mathord", yt = "op-token", tn = "open", Do = "punct", F = "rel", Xn = "spacing", G = "textord";
|
|
49345
49396
|
y(k, M, F, "≡", "\\equiv", !0);
|
|
49346
49397
|
y(k, M, F, "≺", "\\prec", !0);
|
|
49347
49398
|
y(k, M, F, "≻", "\\succ", !0);
|
|
@@ -49706,36 +49757,36 @@ y(k, M, G, "⊤", "\\top");
|
|
|
49706
49757
|
y(k, M, G, "⊥", "\\bot");
|
|
49707
49758
|
y(k, M, G, "∅", "\\emptyset");
|
|
49708
49759
|
y(k, $, G, "∅", "\\varnothing");
|
|
49709
|
-
y(k, M,
|
|
49710
|
-
y(k, M,
|
|
49711
|
-
y(k, M,
|
|
49712
|
-
y(k, M,
|
|
49713
|
-
y(k, M,
|
|
49714
|
-
y(k, M,
|
|
49715
|
-
y(k, M,
|
|
49716
|
-
y(k, M,
|
|
49717
|
-
y(k, M,
|
|
49718
|
-
y(k, M,
|
|
49719
|
-
y(k, M,
|
|
49720
|
-
y(k, M,
|
|
49721
|
-
y(k, M,
|
|
49722
|
-
y(k, M,
|
|
49723
|
-
y(k, M,
|
|
49724
|
-
y(k, M,
|
|
49725
|
-
y(k, M,
|
|
49726
|
-
y(k, M,
|
|
49727
|
-
y(k, M,
|
|
49728
|
-
y(k, M,
|
|
49729
|
-
y(k, M,
|
|
49730
|
-
y(k, M,
|
|
49731
|
-
y(k, M,
|
|
49732
|
-
y(k, M,
|
|
49733
|
-
y(k, M,
|
|
49734
|
-
y(k, M,
|
|
49735
|
-
y(k, M,
|
|
49736
|
-
y(k, M,
|
|
49737
|
-
y(k, M,
|
|
49738
|
-
y(k, M,
|
|
49760
|
+
y(k, M, xe, "α", "\\alpha", !0);
|
|
49761
|
+
y(k, M, xe, "β", "\\beta", !0);
|
|
49762
|
+
y(k, M, xe, "γ", "\\gamma", !0);
|
|
49763
|
+
y(k, M, xe, "δ", "\\delta", !0);
|
|
49764
|
+
y(k, M, xe, "ϵ", "\\epsilon", !0);
|
|
49765
|
+
y(k, M, xe, "ζ", "\\zeta", !0);
|
|
49766
|
+
y(k, M, xe, "η", "\\eta", !0);
|
|
49767
|
+
y(k, M, xe, "θ", "\\theta", !0);
|
|
49768
|
+
y(k, M, xe, "ι", "\\iota", !0);
|
|
49769
|
+
y(k, M, xe, "κ", "\\kappa", !0);
|
|
49770
|
+
y(k, M, xe, "λ", "\\lambda", !0);
|
|
49771
|
+
y(k, M, xe, "μ", "\\mu", !0);
|
|
49772
|
+
y(k, M, xe, "ν", "\\nu", !0);
|
|
49773
|
+
y(k, M, xe, "ξ", "\\xi", !0);
|
|
49774
|
+
y(k, M, xe, "ο", "\\omicron", !0);
|
|
49775
|
+
y(k, M, xe, "π", "\\pi", !0);
|
|
49776
|
+
y(k, M, xe, "ρ", "\\rho", !0);
|
|
49777
|
+
y(k, M, xe, "σ", "\\sigma", !0);
|
|
49778
|
+
y(k, M, xe, "τ", "\\tau", !0);
|
|
49779
|
+
y(k, M, xe, "υ", "\\upsilon", !0);
|
|
49780
|
+
y(k, M, xe, "ϕ", "\\phi", !0);
|
|
49781
|
+
y(k, M, xe, "χ", "\\chi", !0);
|
|
49782
|
+
y(k, M, xe, "ψ", "\\psi", !0);
|
|
49783
|
+
y(k, M, xe, "ω", "\\omega", !0);
|
|
49784
|
+
y(k, M, xe, "ε", "\\varepsilon", !0);
|
|
49785
|
+
y(k, M, xe, "ϑ", "\\vartheta", !0);
|
|
49786
|
+
y(k, M, xe, "ϖ", "\\varpi", !0);
|
|
49787
|
+
y(k, M, xe, "ϱ", "\\varrho", !0);
|
|
49788
|
+
y(k, M, xe, "ς", "\\varsigma", !0);
|
|
49789
|
+
y(k, M, xe, "φ", "\\varphi", !0);
|
|
49739
49790
|
y(k, M, ye, "∗", "*", !0);
|
|
49740
49791
|
y(k, M, ye, "+", "+");
|
|
49741
49792
|
y(k, M, ye, "−", "-", !0);
|
|
@@ -49886,8 +49937,8 @@ y(k, M, ct, "^", "\\hat");
|
|
|
49886
49937
|
y(k, M, ct, "⃗", "\\vec");
|
|
49887
49938
|
y(k, M, ct, "˙", "\\dot");
|
|
49888
49939
|
y(k, M, ct, "˚", "\\mathring");
|
|
49889
|
-
y(k, M,
|
|
49890
|
-
y(k, M,
|
|
49940
|
+
y(k, M, xe, "", "\\@imath");
|
|
49941
|
+
y(k, M, xe, "", "\\@jmath");
|
|
49891
49942
|
y(k, M, G, "ı", "ı");
|
|
49892
49943
|
y(k, M, G, "ȷ", "ȷ");
|
|
49893
49944
|
y(ne, M, G, "ı", "\\i", !0);
|
|
@@ -49952,7 +50003,7 @@ for (var Rs = 0; Rs < Xm.length; Rs++) {
|
|
|
49952
50003
|
var eo = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
49953
50004
|
for (var Is = 0; Is < eo.length; Is++) {
|
|
49954
50005
|
var pi = eo.charAt(Is);
|
|
49955
|
-
y(k, M,
|
|
50006
|
+
y(k, M, xe, pi, pi), y(ne, M, G, pi, pi);
|
|
49956
50007
|
}
|
|
49957
50008
|
y(k, $, G, "C", "ℂ");
|
|
49958
50009
|
y(ne, $, G, "C", "ℂ");
|
|
@@ -49968,24 +50019,24 @@ y(k, $, G, "R", "ℝ");
|
|
|
49968
50019
|
y(ne, $, G, "R", "ℝ");
|
|
49969
50020
|
y(k, $, G, "Z", "ℤ");
|
|
49970
50021
|
y(ne, $, G, "Z", "ℤ");
|
|
49971
|
-
y(k, M,
|
|
49972
|
-
y(ne, M,
|
|
50022
|
+
y(k, M, xe, "h", "ℎ");
|
|
50023
|
+
y(ne, M, xe, "h", "ℎ");
|
|
49973
50024
|
var Ne = "";
|
|
49974
50025
|
for (var Lt = 0; Lt < eo.length; Lt++) {
|
|
49975
50026
|
var pt = eo.charAt(Lt);
|
|
49976
|
-
Ne = String.fromCharCode(55349, 56320 + Lt), y(k, M,
|
|
50027
|
+
Ne = String.fromCharCode(55349, 56320 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56372 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56424 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56580 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56684 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56736 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56788 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56840 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56944 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Lt < 26 && (Ne = String.fromCharCode(55349, 56632 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56476 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne));
|
|
49977
50028
|
}
|
|
49978
50029
|
Ne = "𝕜";
|
|
49979
|
-
y(k, M,
|
|
50030
|
+
y(k, M, xe, "k", Ne);
|
|
49980
50031
|
y(ne, M, G, "k", Ne);
|
|
49981
50032
|
for (var vr = 0; vr < 10; vr++) {
|
|
49982
50033
|
var nr = vr.toString();
|
|
49983
|
-
Ne = String.fromCharCode(55349, 57294 + vr), y(k, M,
|
|
50034
|
+
Ne = String.fromCharCode(55349, 57294 + vr), y(k, M, xe, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57314 + vr), y(k, M, xe, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57324 + vr), y(k, M, xe, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57334 + vr), y(k, M, xe, nr, Ne), y(ne, M, G, nr, Ne);
|
|
49984
50035
|
}
|
|
49985
50036
|
var $d = "ÐÞþ";
|
|
49986
50037
|
for (var Os = 0; Os < $d.length; Os++) {
|
|
49987
50038
|
var hi = $d.charAt(Os);
|
|
49988
|
-
y(k, M,
|
|
50039
|
+
y(k, M, xe, hi, hi), y(ne, M, G, hi, hi);
|
|
49989
50040
|
}
|
|
49990
50041
|
var mi = [
|
|
49991
50042
|
["mathbf", "textbf", "Main-Bold"],
|
|
@@ -50482,10 +50533,10 @@ var ro = function(t) {
|
|
|
50482
50533
|
}, ht = function(t) {
|
|
50483
50534
|
return t.type === "ordgroup" ? t.body : [t];
|
|
50484
50535
|
}, Kn = X.makeSpan, dTe = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], pTe = ["rightmost", "mrel", "mclose", "mpunct"], hTe = {
|
|
50485
|
-
display:
|
|
50486
|
-
text:
|
|
50487
|
-
script:
|
|
50488
|
-
scriptscript:
|
|
50536
|
+
display: Ee.DISPLAY,
|
|
50537
|
+
text: Ee.TEXT,
|
|
50538
|
+
script: Ee.SCRIPT,
|
|
50539
|
+
scriptscript: Ee.SCRIPTSCRIPT
|
|
50489
50540
|
}, mTe = {
|
|
50490
50541
|
mord: "mord",
|
|
50491
50542
|
mop: "mop",
|
|
@@ -50807,7 +50858,7 @@ function tf(e, t, n, r, a) {
|
|
|
50807
50858
|
}
|
|
50808
50859
|
var y6 = function(t) {
|
|
50809
50860
|
return new qn({
|
|
50810
|
-
style: t.displayMode ?
|
|
50861
|
+
style: t.displayMode ? Ee.DISPLAY : Ee.TEXT,
|
|
50811
50862
|
maxSize: t.maxSize,
|
|
50812
50863
|
minRuleThickness: t.minRuleThickness
|
|
50813
50864
|
});
|
|
@@ -51865,8 +51916,8 @@ var ga = function(t, n, r) {
|
|
|
51865
51916
|
}, OTe = function(t, n, r, a) {
|
|
51866
51917
|
return X.makeSymbol(t, "Size" + n + "-Regular", r, a);
|
|
51867
51918
|
}, N6 = function(t, n, r, a, i, o) {
|
|
51868
|
-
var s = OTe(t, n, i, a), l = Xp(X.makeSpan(["delimsizing", "size" + n], [s], a),
|
|
51869
|
-
return r && S6(l, a,
|
|
51919
|
+
var s = OTe(t, n, i, a), l = Xp(X.makeSpan(["delimsizing", "size" + n], [s], a), Ee.TEXT, a, o);
|
|
51920
|
+
return r && S6(l, a, Ee.TEXT), l;
|
|
51870
51921
|
}, Ls = function(t, n, r) {
|
|
51871
51922
|
var a;
|
|
51872
51923
|
n === "Size1-Regular" ? a = "delim-size1" : a = "delim-size4";
|
|
@@ -51924,12 +51975,12 @@ var ga = function(t, n, r) {
|
|
|
51924
51975
|
}
|
|
51925
51976
|
Y.push(bi), Y.push(Ls(s, h, i));
|
|
51926
51977
|
}
|
|
51927
|
-
var O = a.havingBaseStyle(
|
|
51978
|
+
var O = a.havingBaseStyle(Ee.TEXT), le = X.makeVList({
|
|
51928
51979
|
positionType: "bottom",
|
|
51929
51980
|
positionData: U,
|
|
51930
51981
|
children: Y
|
|
51931
51982
|
}, O);
|
|
51932
|
-
return Xp(X.makeSpan(["delimsizing", "mult"], [le], O),
|
|
51983
|
+
return Xp(X.makeSpan(["delimsizing", "mult"], [le], O), Ee.TEXT, a, o);
|
|
51933
51984
|
}, $s = 80, zs = 0.08, Fs = function(t, n, r, a, i) {
|
|
51934
51985
|
var o = FAe(t, a, r), s = new hr(t, o), l = new Wn([s], {
|
|
51935
51986
|
// Note: 1000:1 ratio of viewBox to document em width.
|
|
@@ -51958,13 +52009,13 @@ var ga = function(t, n, r) {
|
|
|
51958
52009
|
throw new ie("Illegal delimiter: '" + t + "'");
|
|
51959
52010
|
}, PTe = [{
|
|
51960
52011
|
type: "small",
|
|
51961
|
-
style:
|
|
52012
|
+
style: Ee.SCRIPTSCRIPT
|
|
51962
52013
|
}, {
|
|
51963
52014
|
type: "small",
|
|
51964
|
-
style:
|
|
52015
|
+
style: Ee.SCRIPT
|
|
51965
52016
|
}, {
|
|
51966
52017
|
type: "small",
|
|
51967
|
-
style:
|
|
52018
|
+
style: Ee.TEXT
|
|
51968
52019
|
}, {
|
|
51969
52020
|
type: "large",
|
|
51970
52021
|
size: 1
|
|
@@ -51979,24 +52030,24 @@ var ga = function(t, n, r) {
|
|
|
51979
52030
|
size: 4
|
|
51980
52031
|
}], qTe = [{
|
|
51981
52032
|
type: "small",
|
|
51982
|
-
style:
|
|
52033
|
+
style: Ee.SCRIPTSCRIPT
|
|
51983
52034
|
}, {
|
|
51984
52035
|
type: "small",
|
|
51985
|
-
style:
|
|
52036
|
+
style: Ee.SCRIPT
|
|
51986
52037
|
}, {
|
|
51987
52038
|
type: "small",
|
|
51988
|
-
style:
|
|
52039
|
+
style: Ee.TEXT
|
|
51989
52040
|
}, {
|
|
51990
52041
|
type: "stack"
|
|
51991
52042
|
}], R6 = [{
|
|
51992
52043
|
type: "small",
|
|
51993
|
-
style:
|
|
52044
|
+
style: Ee.SCRIPTSCRIPT
|
|
51994
52045
|
}, {
|
|
51995
52046
|
type: "small",
|
|
51996
|
-
style:
|
|
52047
|
+
style: Ee.SCRIPT
|
|
51997
52048
|
}, {
|
|
51998
52049
|
type: "small",
|
|
51999
|
-
style:
|
|
52050
|
+
style: Ee.TEXT
|
|
52000
52051
|
}, {
|
|
52001
52052
|
type: "large",
|
|
52002
52053
|
size: 1
|
|
@@ -52616,7 +52667,7 @@ var $n = function(t, n) {
|
|
|
52616
52667
|
// User override.
|
|
52617
52668
|
), p = 1 / n.fontMetrics().ptPerEm, m = 5 * p;
|
|
52618
52669
|
if (t.colSeparationType && t.colSeparationType === "small") {
|
|
52619
|
-
var h = n.havingStyle(
|
|
52670
|
+
var h = n.havingStyle(Ee.SCRIPT).sizeMultiplier;
|
|
52620
52671
|
m = 0.2778 * (h / n.sizeMultiplier);
|
|
52621
52672
|
}
|
|
52622
52673
|
var g = t.colSeparationType === "CD" ? dt({
|
|
@@ -52671,36 +52722,36 @@ var $n = function(t, n) {
|
|
|
52671
52722
|
if (!(a >= s)) {
|
|
52672
52723
|
var Ce = void 0;
|
|
52673
52724
|
(a > 0 || t.hskipBeforeAndAfter) && (Ce = _e.deflt(J.pregap, m), Ce !== 0 && (R = X.makeSpan(["arraycolsep"], []), R.style.width = ue(Ce), W.push(R)));
|
|
52674
|
-
var
|
|
52725
|
+
var qe = [];
|
|
52675
52726
|
for (r = 0; r < i; ++r) {
|
|
52676
52727
|
var ot = l[r], We = ot[a];
|
|
52677
52728
|
if (We) {
|
|
52678
52729
|
var re = ot.pos - Y;
|
|
52679
|
-
We.depth = ot.depth, We.height = ot.height,
|
|
52730
|
+
We.depth = ot.depth, We.height = ot.height, qe.push({
|
|
52680
52731
|
type: "elem",
|
|
52681
52732
|
elem: We,
|
|
52682
52733
|
shift: re
|
|
52683
52734
|
});
|
|
52684
52735
|
}
|
|
52685
52736
|
}
|
|
52686
|
-
|
|
52737
|
+
qe = X.makeVList({
|
|
52687
52738
|
positionType: "individualShift",
|
|
52688
|
-
children:
|
|
52689
|
-
}, n),
|
|
52739
|
+
children: qe
|
|
52740
|
+
}, n), qe = X.makeSpan(["col-align-" + (J.align || "c")], [qe]), W.push(qe), (a < s - 1 || t.hskipBeforeAndAfter) && (Ce = _e.deflt(J.postgap, m), Ce !== 0 && (R = X.makeSpan(["arraycolsep"], []), R.style.width = ue(Ce), W.push(R)));
|
|
52690
52741
|
}
|
|
52691
52742
|
}
|
|
52692
52743
|
if (l = X.makeSpan(["mtable"], W), u.length > 0) {
|
|
52693
|
-
for (var Se = X.makeLineSpan("hline", n, d), He = X.makeLineSpan("hdashline", n, d),
|
|
52744
|
+
for (var Se = X.makeLineSpan("hline", n, d), He = X.makeLineSpan("hdashline", n, d), Xe = [{
|
|
52694
52745
|
type: "elem",
|
|
52695
52746
|
elem: l,
|
|
52696
52747
|
shift: 0
|
|
52697
52748
|
}]; u.length > 0; ) {
|
|
52698
52749
|
var Ae = u.pop(), ve = Ae.pos - Y;
|
|
52699
|
-
Ae.isDashed ?
|
|
52750
|
+
Ae.isDashed ? Xe.push({
|
|
52700
52751
|
type: "elem",
|
|
52701
52752
|
elem: He,
|
|
52702
52753
|
shift: ve
|
|
52703
|
-
}) :
|
|
52754
|
+
}) : Xe.push({
|
|
52704
52755
|
type: "elem",
|
|
52705
52756
|
elem: Se,
|
|
52706
52757
|
shift: ve
|
|
@@ -52708,7 +52759,7 @@ var $n = function(t, n) {
|
|
|
52708
52759
|
}
|
|
52709
52760
|
l = X.makeVList({
|
|
52710
52761
|
positionType: "individualShift",
|
|
52711
|
-
children:
|
|
52762
|
+
children: Xe
|
|
52712
52763
|
}, n);
|
|
52713
52764
|
}
|
|
52714
52765
|
if (V.length === 0)
|
|
@@ -53203,7 +53254,7 @@ me({
|
|
|
53203
53254
|
});
|
|
53204
53255
|
var P6 = (e, t) => {
|
|
53205
53256
|
var n = t;
|
|
53206
|
-
return e === "display" ? n = n.id >=
|
|
53257
|
+
return e === "display" ? n = n.id >= Ee.SCRIPT.id ? n.text() : Ee.DISPLAY : e === "text" && n.size === Ee.DISPLAY.size ? n = Ee.TEXT : e === "script" ? n = Ee.SCRIPT : e === "scriptscript" && (n = Ee.SCRIPTSCRIPT), n;
|
|
53207
53258
|
}, nh = (e, t) => {
|
|
53208
53259
|
var n = P6(e.size, t.style), r = n.fracNum(), a = n.fracDen(), i;
|
|
53209
53260
|
i = t.havingStyle(r);
|
|
@@ -53216,7 +53267,7 @@ var P6 = (e, t) => {
|
|
|
53216
53267
|
var u = Ge(e.denom, i, t), d, p, m;
|
|
53217
53268
|
e.hasBarLine ? (e.barSize ? (p = dt(e.barSize, t), d = X.makeLineSpan("frac-line", t, p)) : d = X.makeLineSpan("frac-line", t), p = d.height, m = d.height) : (d = null, p = 0, m = t.fontMetrics().defaultRuleThickness);
|
|
53218
53269
|
var h, g, f;
|
|
53219
|
-
n.size ===
|
|
53270
|
+
n.size === Ee.DISPLAY.size || e.size === "display" ? (h = t.fontMetrics().num1, p > 0 ? g = 3 * m : g = 7 * m, f = t.fontMetrics().denom1) : (p > 0 ? (h = t.fontMetrics().num2, g = m) : (h = t.fontMetrics().num3, g = 3 * m), f = t.fontMetrics().denom2);
|
|
53220
53271
|
var w;
|
|
53221
53272
|
if (d) {
|
|
53222
53273
|
var b = t.fontMetrics().axisHeight;
|
|
@@ -53255,7 +53306,7 @@ var P6 = (e, t) => {
|
|
|
53255
53306
|
}
|
|
53256
53307
|
i = t.havingStyle(n), w.height *= i.sizeMultiplier / t.sizeMultiplier, w.depth *= i.sizeMultiplier / t.sizeMultiplier;
|
|
53257
53308
|
var E;
|
|
53258
|
-
n.size ===
|
|
53309
|
+
n.size === Ee.DISPLAY.size ? E = t.fontMetrics().delim1 : n.size === Ee.SCRIPTSCRIPT.size ? E = t.havingStyle(Ee.SCRIPT).fontMetrics().delim2 : E = t.fontMetrics().delim2;
|
|
53259
53310
|
var S, x;
|
|
53260
53311
|
return e.leftDelim == null ? S = $a(t, ["mopen"]) : S = jn.customSizedDelim(e.leftDelim, E, !0, t.havingStyle(n), e.mode, ["mopen"]), e.continued ? x = X.makeSpan([]) : e.rightDelim == null ? x = $a(t, ["mclose"]) : x = jn.customSizedDelim(e.rightDelim, E, !0, t.havingStyle(n), e.mode, ["mclose"]), X.makeSpan(["mord"].concat(i.sizingClasses(t)), [S, X.makeSpan(["mfrac"], [w]), x], t);
|
|
53261
53312
|
}, rh = (e, t) => {
|
|
@@ -53269,7 +53320,7 @@ var P6 = (e, t) => {
|
|
|
53269
53320
|
var a = P6(e.size, t.style);
|
|
53270
53321
|
if (a.size !== t.style.size) {
|
|
53271
53322
|
n = new ae.MathNode("mstyle", [n]);
|
|
53272
|
-
var i = a.size ===
|
|
53323
|
+
var i = a.size === Ee.DISPLAY.size ? "true" : "false";
|
|
53273
53324
|
n.setAttribute("displaystyle", i), n.setAttribute("scriptlevel", "0");
|
|
53274
53325
|
}
|
|
53275
53326
|
if (e.leftDelim != null || e.rightDelim != null) {
|
|
@@ -53519,7 +53570,7 @@ me({
|
|
|
53519
53570
|
var q6 = (e, t) => {
|
|
53520
53571
|
var n = t.style, r, a;
|
|
53521
53572
|
e.type === "supsub" ? (r = e.sup ? Ge(e.sup, t.havingStyle(n.sup()), t) : Ge(e.sub, t.havingStyle(n.sub()), t), a = Ie(e.base, "horizBrace")) : a = Ie(e, "horizBrace");
|
|
53522
|
-
var i = Ge(a.base, t.havingBaseStyle(
|
|
53573
|
+
var i = Ge(a.base, t.havingBaseStyle(Ee.DISPLAY)), o = Yn.svgSpan(a, t), s;
|
|
53523
53574
|
if (a.isOver ? (s = X.makeVList({
|
|
53524
53575
|
positionType: "firstBaseline",
|
|
53525
53576
|
children: [{
|
|
@@ -53994,13 +54045,13 @@ me({
|
|
|
53994
54045
|
});
|
|
53995
54046
|
var pf = (e, t) => {
|
|
53996
54047
|
switch (t.style.size) {
|
|
53997
|
-
case
|
|
54048
|
+
case Ee.DISPLAY.size:
|
|
53998
54049
|
return e.display;
|
|
53999
|
-
case
|
|
54050
|
+
case Ee.TEXT.size:
|
|
54000
54051
|
return e.text;
|
|
54001
|
-
case
|
|
54052
|
+
case Ee.SCRIPT.size:
|
|
54002
54053
|
return e.script;
|
|
54003
|
-
case
|
|
54054
|
+
case Ee.SCRIPTSCRIPT.size:
|
|
54004
54055
|
return e.scriptscript;
|
|
54005
54056
|
default:
|
|
54006
54057
|
return e.text;
|
|
@@ -54135,7 +54186,7 @@ var B6 = (e, t, n, r, a, i, o) => {
|
|
|
54135
54186
|
var n, r, a = !1, i;
|
|
54136
54187
|
e.type === "supsub" ? (n = e.sup, r = e.sub, i = Ie(e.base, "op"), a = !0) : i = Ie(e, "op");
|
|
54137
54188
|
var o = t.style, s = !1;
|
|
54138
|
-
o.size ===
|
|
54189
|
+
o.size === Ee.DISPLAY.size && i.symbol && !_e.contains(U6, i.name) && (s = !0);
|
|
54139
54190
|
var l;
|
|
54140
54191
|
if (i.symbol) {
|
|
54141
54192
|
var u = s ? "Size2-Regular" : "Size1-Regular", d = "";
|
|
@@ -54729,7 +54780,7 @@ me({
|
|
|
54729
54780
|
var n = Ge(e.body, t.havingCrampedStyle());
|
|
54730
54781
|
n.height === 0 && (n.height = t.fontMetrics().xHeight), n = X.wrapFragment(n, t);
|
|
54731
54782
|
var r = t.fontMetrics(), a = r.defaultRuleThickness, i = a;
|
|
54732
|
-
t.style.id <
|
|
54783
|
+
t.style.id < Ee.TEXT.id && (i = t.fontMetrics().xHeight);
|
|
54733
54784
|
var o = a + i / 4, s = n.height + n.depth + o + a, {
|
|
54734
54785
|
span: l,
|
|
54735
54786
|
ruleWidth: u,
|
|
@@ -54756,7 +54807,7 @@ me({
|
|
|
54756
54807
|
}]
|
|
54757
54808
|
}, t);
|
|
54758
54809
|
if (e.index) {
|
|
54759
|
-
var g = t.havingStyle(
|
|
54810
|
+
var g = t.havingStyle(Ee.SCRIPTSCRIPT), f = Ge(e.index, g, t), w = 0.6 * (h.height - h.depth), _ = X.makeVList({
|
|
54760
54811
|
positionType: "shift",
|
|
54761
54812
|
positionData: -w,
|
|
54762
54813
|
children: [{
|
|
@@ -54777,10 +54828,10 @@ me({
|
|
|
54777
54828
|
}
|
|
54778
54829
|
});
|
|
54779
54830
|
var mf = {
|
|
54780
|
-
display:
|
|
54781
|
-
text:
|
|
54782
|
-
script:
|
|
54783
|
-
scriptscript:
|
|
54831
|
+
display: Ee.DISPLAY,
|
|
54832
|
+
text: Ee.TEXT,
|
|
54833
|
+
script: Ee.SCRIPT,
|
|
54834
|
+
scriptscript: Ee.SCRIPTSCRIPT
|
|
54784
54835
|
};
|
|
54785
54836
|
me({
|
|
54786
54837
|
type: "styling",
|
|
@@ -54823,10 +54874,10 @@ var ZTe = function(t, n) {
|
|
|
54823
54874
|
var r = t.base;
|
|
54824
54875
|
if (r)
|
|
54825
54876
|
if (r.type === "op") {
|
|
54826
|
-
var a = r.limits && (n.style.size ===
|
|
54877
|
+
var a = r.limits && (n.style.size === Ee.DISPLAY.size || r.alwaysHandleSupSub);
|
|
54827
54878
|
return a ? sa : null;
|
|
54828
54879
|
} else if (r.type === "operatorname") {
|
|
54829
|
-
var i = r.alwaysHandleSupSub && (n.style.size ===
|
|
54880
|
+
var i = r.alwaysHandleSupSub && (n.style.size === Ee.DISPLAY.size || r.limits);
|
|
54830
54881
|
return i ? H6 : null;
|
|
54831
54882
|
} else {
|
|
54832
54883
|
if (r.type === "accent")
|
|
@@ -54860,7 +54911,7 @@ Cr({
|
|
|
54860
54911
|
l = Ge(i, g, t), m || (p = o.depth + g.fontMetrics().subDrop * g.sizeMultiplier / t.sizeMultiplier);
|
|
54861
54912
|
}
|
|
54862
54913
|
var f;
|
|
54863
|
-
t.style ===
|
|
54914
|
+
t.style === Ee.DISPLAY ? f = u.sup1 : t.style.cramped ? f = u.sup3 : f = u.sup2;
|
|
54864
54915
|
var w = t.sizeMultiplier, _ = ue(0.5 / u.ptPerEm / w), b = null;
|
|
54865
54916
|
if (l) {
|
|
54866
54917
|
var v = e.base && e.base.type === "op" && e.base.name && (e.base.name === "\\oiint" || e.base.name === "\\oiiint");
|
|
@@ -54930,14 +54981,14 @@ Cr({
|
|
|
54930
54981
|
else if (e.sub)
|
|
54931
54982
|
if (e.sup) {
|
|
54932
54983
|
var u = e.base;
|
|
54933
|
-
u && u.type === "op" && u.limits && t.style ===
|
|
54984
|
+
u && u.type === "op" && u.limits && t.style === Ee.DISPLAY || u && u.type === "operatorname" && u.alwaysHandleSupSub && (t.style === Ee.DISPLAY || u.limits) ? o = "munderover" : o = "msubsup";
|
|
54934
54985
|
} else {
|
|
54935
54986
|
var l = e.base;
|
|
54936
|
-
l && l.type === "op" && l.limits && (t.style ===
|
|
54987
|
+
l && l.type === "op" && l.limits && (t.style === Ee.DISPLAY || l.alwaysHandleSupSub) || l && l.type === "operatorname" && l.alwaysHandleSupSub && (l.limits || t.style === Ee.DISPLAY) ? o = "munder" : o = "msub";
|
|
54937
54988
|
}
|
|
54938
54989
|
else {
|
|
54939
54990
|
var s = e.base;
|
|
54940
|
-
s && s.type === "op" && s.limits && (t.style ===
|
|
54991
|
+
s && s.type === "op" && s.limits && (t.style === Ee.DISPLAY || s.alwaysHandleSupSub) || s && s.type === "operatorname" && s.alwaysHandleSupSub && (s.limits || t.style === Ee.DISPLAY) ? o = "mover" : o = "msup";
|
|
54941
54992
|
}
|
|
54942
54993
|
return new ae.MathNode(o, i);
|
|
54943
54994
|
}
|
|
@@ -70053,7 +70104,7 @@ function oOe(e) {
|
|
|
70053
70104
|
match: En
|
|
70054
70105
|
}
|
|
70055
70106
|
]
|
|
70056
|
-
},
|
|
70107
|
+
}, qe = {
|
|
70057
70108
|
begin: /\(/,
|
|
70058
70109
|
end: /\)/,
|
|
70059
70110
|
keywords: u,
|
|
@@ -70082,7 +70133,7 @@ function oOe(e) {
|
|
|
70082
70133
|
},
|
|
70083
70134
|
contains: [
|
|
70084
70135
|
ke,
|
|
70085
|
-
|
|
70136
|
+
qe,
|
|
70086
70137
|
t
|
|
70087
70138
|
],
|
|
70088
70139
|
illegal: [
|
|
@@ -70097,7 +70148,7 @@ function oOe(e) {
|
|
|
70097
70148
|
className: { 1: "keyword" },
|
|
70098
70149
|
contains: [
|
|
70099
70150
|
ke,
|
|
70100
|
-
|
|
70151
|
+
qe,
|
|
70101
70152
|
t
|
|
70102
70153
|
],
|
|
70103
70154
|
illegal: /\[|%/
|
|
@@ -70140,7 +70191,7 @@ function oOe(e) {
|
|
|
70140
70191
|
3: "keyword",
|
|
70141
70192
|
5: "title.function"
|
|
70142
70193
|
}
|
|
70143
|
-
},
|
|
70194
|
+
}, Xe = {
|
|
70144
70195
|
match: [
|
|
70145
70196
|
/class\b/,
|
|
70146
70197
|
/\s+/,
|
|
@@ -70211,7 +70262,7 @@ function oOe(e) {
|
|
|
70211
70262
|
ot,
|
|
70212
70263
|
We,
|
|
70213
70264
|
He,
|
|
70214
|
-
|
|
70265
|
+
Xe,
|
|
70215
70266
|
Ae,
|
|
70216
70267
|
re,
|
|
70217
70268
|
Se,
|
|
@@ -72348,7 +72399,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72348
72399
|
}
|
|
72349
72400
|
function J() {
|
|
72350
72401
|
if (!de.keywords) {
|
|
72351
|
-
|
|
72402
|
+
Qe.addText(je);
|
|
72352
72403
|
return;
|
|
72353
72404
|
}
|
|
72354
72405
|
let q = 0;
|
|
@@ -72356,10 +72407,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72356
72407
|
let Z = de.keywordPatternRe.exec(je), te = "";
|
|
72357
72408
|
for (; Z; ) {
|
|
72358
72409
|
te += je.substring(q, Z.index);
|
|
72359
|
-
const pe = Ae.case_insensitive ? Z[0].toLowerCase() : Z[0],
|
|
72360
|
-
if (
|
|
72361
|
-
const [Le, wt] =
|
|
72362
|
-
if (
|
|
72410
|
+
const pe = Ae.case_insensitive ? Z[0].toLowerCase() : Z[0], Me = K(de, pe);
|
|
72411
|
+
if (Me) {
|
|
72412
|
+
const [Le, wt] = Me;
|
|
72413
|
+
if (Qe.addText(te), te = "", N[pe] = (N[pe] || 0) + 1, N[pe] <= iLe && (ce += wt), Le.startsWith("_"))
|
|
72363
72414
|
te += Z[0];
|
|
72364
72415
|
else {
|
|
72365
72416
|
const St = Ae.classNameAliases[Le] || Le;
|
|
@@ -72369,7 +72420,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72369
72420
|
te += Z[0];
|
|
72370
72421
|
q = de.keywordPatternRe.lastIndex, Z = de.keywordPatternRe.exec(je);
|
|
72371
72422
|
}
|
|
72372
|
-
te += je.substring(q),
|
|
72423
|
+
te += je.substring(q), Qe.addText(te);
|
|
72373
72424
|
}
|
|
72374
72425
|
function O() {
|
|
72375
72426
|
if (je === "")
|
|
@@ -72377,20 +72428,20 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72377
72428
|
let q = null;
|
|
72378
72429
|
if (typeof de.subLanguage == "string") {
|
|
72379
72430
|
if (!t[de.subLanguage]) {
|
|
72380
|
-
|
|
72431
|
+
Qe.addText(je);
|
|
72381
72432
|
return;
|
|
72382
72433
|
}
|
|
72383
72434
|
q = p(de.subLanguage, je, !0, tt[de.subLanguage]), tt[de.subLanguage] = /** @type {CompiledMode} */
|
|
72384
72435
|
q._top;
|
|
72385
72436
|
} else
|
|
72386
72437
|
q = h(je, de.subLanguage.length ? de.subLanguage : null);
|
|
72387
|
-
de.relevance > 0 && (ce += q.relevance),
|
|
72438
|
+
de.relevance > 0 && (ce += q.relevance), Qe.__addSublanguage(q._emitter, q.language);
|
|
72388
72439
|
}
|
|
72389
72440
|
function le() {
|
|
72390
72441
|
de.subLanguage != null ? O() : J(), je = "";
|
|
72391
72442
|
}
|
|
72392
72443
|
function fe(q, Z) {
|
|
72393
|
-
q !== "" && (
|
|
72444
|
+
q !== "" && (Qe.startScope(Z), Qe.addText(q), Qe.endScope());
|
|
72394
72445
|
}
|
|
72395
72446
|
function ke(q, Z) {
|
|
72396
72447
|
let te = 1;
|
|
@@ -72400,19 +72451,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72400
72451
|
te++;
|
|
72401
72452
|
continue;
|
|
72402
72453
|
}
|
|
72403
|
-
const
|
|
72404
|
-
|
|
72454
|
+
const Me = Ae.classNameAliases[q[te]] || q[te], Le = Z[te];
|
|
72455
|
+
Me ? fe(Le, Me) : (je = Le, J(), je = ""), te++;
|
|
72405
72456
|
}
|
|
72406
72457
|
}
|
|
72407
72458
|
function Ce(q, Z) {
|
|
72408
|
-
return q.scope && typeof q.scope == "string" &&
|
|
72459
|
+
return q.scope && typeof q.scope == "string" && Qe.openNode(Ae.classNameAliases[q.scope] || q.scope), q.beginScope && (q.beginScope._wrap ? (fe(je, Ae.classNameAliases[q.beginScope._wrap] || q.beginScope._wrap), je = "") : q.beginScope._multi && (ke(q.beginScope, Z), je = "")), de = Object.create(q, { parent: { value: de } }), de;
|
|
72409
72460
|
}
|
|
72410
|
-
function
|
|
72461
|
+
function qe(q, Z, te) {
|
|
72411
72462
|
let pe = _Oe(q.endRe, te);
|
|
72412
72463
|
if (pe) {
|
|
72413
72464
|
if (q["on:end"]) {
|
|
72414
|
-
const
|
|
72415
|
-
q["on:end"](Z,
|
|
72465
|
+
const Me = new Gf(q);
|
|
72466
|
+
q["on:end"](Z, Me), Me.isMatchIgnored && (pe = !1);
|
|
72416
72467
|
}
|
|
72417
72468
|
if (pe) {
|
|
72418
72469
|
for (; q.endsParent && q.parent; )
|
|
@@ -72421,37 +72472,37 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72421
72472
|
}
|
|
72422
72473
|
}
|
|
72423
72474
|
if (q.endsWithParent)
|
|
72424
|
-
return
|
|
72475
|
+
return qe(q.parent, Z, te);
|
|
72425
72476
|
}
|
|
72426
72477
|
function ot(q) {
|
|
72427
|
-
return de.matcher.regexIndex === 0 ? (je += q[0], 1) : (
|
|
72478
|
+
return de.matcher.regexIndex === 0 ? (je += q[0], 1) : (Be = !0, 0);
|
|
72428
72479
|
}
|
|
72429
72480
|
function We(q) {
|
|
72430
|
-
const Z = q[0], te = q.rule, pe = new Gf(te),
|
|
72431
|
-
for (const Le of
|
|
72481
|
+
const Z = q[0], te = q.rule, pe = new Gf(te), Me = [te.__beforeBegin, te["on:begin"]];
|
|
72482
|
+
for (const Le of Me)
|
|
72432
72483
|
if (Le && (Le(q, pe), pe.isMatchIgnored))
|
|
72433
72484
|
return ot(Z);
|
|
72434
72485
|
return te.skip ? je += Z : (te.excludeBegin && (je += Z), le(), !te.returnBegin && !te.excludeBegin && (je = Z)), Ce(te, q), te.returnBegin ? 0 : Z.length;
|
|
72435
72486
|
}
|
|
72436
72487
|
function re(q) {
|
|
72437
|
-
const Z = q[0], te = V.substring(q.index), pe =
|
|
72488
|
+
const Z = q[0], te = V.substring(q.index), pe = qe(de, q, te);
|
|
72438
72489
|
if (!pe)
|
|
72439
72490
|
return Qf;
|
|
72440
|
-
const
|
|
72441
|
-
de.endScope && de.endScope._wrap ? (le(), fe(Z, de.endScope._wrap)) : de.endScope && de.endScope._multi ? (le(), ke(de.endScope, q)) :
|
|
72491
|
+
const Me = de;
|
|
72492
|
+
de.endScope && de.endScope._wrap ? (le(), fe(Z, de.endScope._wrap)) : de.endScope && de.endScope._multi ? (le(), ke(de.endScope, q)) : Me.skip ? je += Z : (Me.returnEnd || Me.excludeEnd || (je += Z), le(), Me.excludeEnd && (je = Z));
|
|
72442
72493
|
do
|
|
72443
|
-
de.scope &&
|
|
72494
|
+
de.scope && Qe.closeNode(), !de.skip && !de.subLanguage && (ce += de.relevance), de = de.parent;
|
|
72444
72495
|
while (de !== pe.parent);
|
|
72445
|
-
return pe.starts && Ce(pe.starts, q),
|
|
72496
|
+
return pe.starts && Ce(pe.starts, q), Me.returnEnd ? 0 : Z.length;
|
|
72446
72497
|
}
|
|
72447
72498
|
function Se() {
|
|
72448
72499
|
const q = [];
|
|
72449
72500
|
for (let Z = de; Z !== Ae; Z = Z.parent)
|
|
72450
72501
|
Z.scope && q.unshift(Z.scope);
|
|
72451
|
-
q.forEach((Z) =>
|
|
72502
|
+
q.forEach((Z) => Qe.openNode(Z));
|
|
72452
72503
|
}
|
|
72453
72504
|
let He = {};
|
|
72454
|
-
function
|
|
72505
|
+
function Xe(q, Z) {
|
|
72455
72506
|
const te = Z && Z[0];
|
|
72456
72507
|
if (je += q, te == null)
|
|
72457
72508
|
return le(), 0;
|
|
@@ -72484,29 +72535,29 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72484
72535
|
throw Mr(i.replace("{}", H)), new Error('Unknown language: "' + H + '"');
|
|
72485
72536
|
const ve = tLe(Ae);
|
|
72486
72537
|
let Ke = "", de = j || ve;
|
|
72487
|
-
const tt = {},
|
|
72538
|
+
const tt = {}, Qe = new s.__emitter(s);
|
|
72488
72539
|
Se();
|
|
72489
|
-
let je = "", ce = 0,
|
|
72540
|
+
let je = "", ce = 0, we = 0, be = 0, Be = !1;
|
|
72490
72541
|
try {
|
|
72491
72542
|
if (Ae.__emitTokens)
|
|
72492
|
-
Ae.__emitTokens(V,
|
|
72543
|
+
Ae.__emitTokens(V, Qe);
|
|
72493
72544
|
else {
|
|
72494
72545
|
for (de.matcher.considerAll(); ; ) {
|
|
72495
|
-
be++,
|
|
72546
|
+
be++, Be ? Be = !1 : de.matcher.considerAll(), de.matcher.lastIndex = we;
|
|
72496
72547
|
const q = de.matcher.exec(V);
|
|
72497
72548
|
if (!q)
|
|
72498
72549
|
break;
|
|
72499
|
-
const Z = V.substring(
|
|
72500
|
-
|
|
72550
|
+
const Z = V.substring(we, q.index), te = Xe(Z, q);
|
|
72551
|
+
we = q.index + te;
|
|
72501
72552
|
}
|
|
72502
|
-
|
|
72553
|
+
Xe(V.substring(we));
|
|
72503
72554
|
}
|
|
72504
|
-
return
|
|
72555
|
+
return Qe.finalize(), Ke = Qe.toHTML(), {
|
|
72505
72556
|
language: H,
|
|
72506
72557
|
value: Ke,
|
|
72507
72558
|
relevance: ce,
|
|
72508
72559
|
illegal: !1,
|
|
72509
|
-
_emitter:
|
|
72560
|
+
_emitter: Qe,
|
|
72510
72561
|
_top: de
|
|
72511
72562
|
};
|
|
72512
72563
|
} catch (q) {
|
|
@@ -72518,12 +72569,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72518
72569
|
relevance: 0,
|
|
72519
72570
|
_illegalBy: {
|
|
72520
72571
|
message: q.message,
|
|
72521
|
-
index:
|
|
72522
|
-
context: V.slice(
|
|
72572
|
+
index: we,
|
|
72573
|
+
context: V.slice(we - 100, we + 100),
|
|
72523
72574
|
mode: q.mode,
|
|
72524
72575
|
resultSoFar: Ke
|
|
72525
72576
|
},
|
|
72526
|
-
_emitter:
|
|
72577
|
+
_emitter: Qe
|
|
72527
72578
|
};
|
|
72528
72579
|
if (a)
|
|
72529
72580
|
return {
|
|
@@ -72532,7 +72583,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
|
|
|
72532
72583
|
illegal: !1,
|
|
72533
72584
|
relevance: 0,
|
|
72534
72585
|
errorRaised: q,
|
|
72535
|
-
_emitter:
|
|
72586
|
+
_emitter: Qe,
|
|
72536
72587
|
_top: de
|
|
72537
72588
|
};
|
|
72538
72589
|
throw q;
|
|
@@ -73414,9 +73465,9 @@ function zLe(e, t) {
|
|
|
73414
73465
|
defaultCodeValue: fe
|
|
73415
73466
|
});
|
|
73416
73467
|
ke.language === null && (ke.value = fe);
|
|
73417
|
-
var Ce = ke.value.length + v,
|
|
73468
|
+
var Ce = ke.value.length + v, qe = LLe(ke, z, U, f, _, v, Ce, x, T);
|
|
73418
73469
|
return /* @__PURE__ */ rr.createElement(W, le, /* @__PURE__ */ rr.createElement(H, p, !_ && K, Y({
|
|
73419
|
-
rows:
|
|
73470
|
+
rows: qe,
|
|
73420
73471
|
stylesheet: s,
|
|
73421
73472
|
useInlineStyles: h
|
|
73422
73473
|
})));
|
|
@@ -74956,10 +75007,10 @@ var l7 = { exports: {} };
|
|
|
74956
75007
|
K--, N = b.slice(j, le), J.index -= j;
|
|
74957
75008
|
} else if (J = u(V, 0, N, Q), !J)
|
|
74958
75009
|
continue;
|
|
74959
|
-
var ke = J.index, Ce = J[0],
|
|
75010
|
+
var ke = J.index, Ce = J[0], qe = N.slice(0, ke), ot = N.slice(ke + Ce.length), We = j + N.length;
|
|
74960
75011
|
z && We > z.reach && (z.reach = We);
|
|
74961
75012
|
var re = D.prev;
|
|
74962
|
-
|
|
75013
|
+
qe && (re = m(v, re, qe), j += qe.length), h(v, re, K);
|
|
74963
75014
|
var Se = new l(P, Y ? s.tokenize(Ce, Y) : Ce, R, Ce);
|
|
74964
75015
|
if (D = m(v, re, Se), ot && m(v, D, ot), K > 1) {
|
|
74965
75016
|
var He = {
|
|
@@ -96322,7 +96373,7 @@ const YHe = {
|
|
|
96322
96373
|
);
|
|
96323
96374
|
k7.displayName = "CodeContent";
|
|
96324
96375
|
const v7 = Rt(({ lang: e = "text", codeChildren: t, allowExecution: n = !1 }) => {
|
|
96325
|
-
const { colorMode: r } = S7e(), a = Yd(t).replace(/\n$/, ""), i = r === "light" ? HHe : UHe, { truncated: o, isTruncated: s, totalLines: l } = lt(() => KHe(a), [a]), [u, d] = et(!1), p =
|
|
96376
|
+
const { colorMode: r } = S7e(), a = Yd(t).replace(/\n$/, ""), i = r === "light" ? HHe : UHe, { truncated: o, isTruncated: s, totalLines: l } = lt(() => KHe(a), [a]), [u, d] = et(!1), p = Ye(() => d((g) => !g), []), m = u ? a : o, h = lt(() => WHe(m), [m]);
|
|
96326
96377
|
return /* @__PURE__ */ oe("div", { className: "mp-agent-code-block-wrapper", children: [
|
|
96327
96378
|
/* @__PURE__ */ oe("div", { className: "mp-agent-code-block-header", children: [
|
|
96328
96379
|
/* @__PURE__ */ C("span", { className: "mp-agent-code-block-language", children: e }),
|
|
@@ -96411,10 +96462,10 @@ const ZHe = (e) => x5(e) ? e.key?.startsWith("code-") ?? !1 : !1, XHe = Rt(({ cl
|
|
|
96411
96462
|
));
|
|
96412
96463
|
Uh.displayName = "MarkdownMessage";
|
|
96413
96464
|
const iVe = ({ content: e, role: t }) => {
|
|
96414
|
-
const n = t ===
|
|
96465
|
+
const n = t === Ze.User, r = t === Ze.Error, a = t === Ze.Reasoning;
|
|
96415
96466
|
return n ? /* @__PURE__ */ C("p", { style: { margin: 0, whiteSpace: "pre-wrap" }, children: e }) : r ? /* @__PURE__ */ C("p", { style: { margin: 0, whiteSpace: "pre-wrap" }, children: e }) : a ? /* @__PURE__ */ C("pre", { style: { margin: 0, fontSize: "13px", opacity: 0.8 }, children: e }) : /* @__PURE__ */ C(Uh, { text: e });
|
|
96416
96467
|
}, oVe = ({ text: e, isReasoning: t }) => t ? null : /* @__PURE__ */ C("div", { className: "mp-agent-message-actions", children: /* @__PURE__ */ C(gp, { text: e }) }), _7 = ({ message: e, showParticipantChrome: t = !1 }) => {
|
|
96417
|
-
const n = e.role ===
|
|
96468
|
+
const n = e.role === Ze.User, r = e.role === Ze.Error, a = e.role === Ze.Reasoning, i = !!e.content, o = (e.attachments?.length ?? 0) > 0, s = t && !!(e.sender || e.agentName);
|
|
96418
96469
|
return /* @__PURE__ */ oe(
|
|
96419
96470
|
"div",
|
|
96420
96471
|
{
|
|
@@ -96441,10 +96492,8 @@ const iVe = ({ content: e, role: t }) => {
|
|
|
96441
96492
|
}
|
|
96442
96493
|
);
|
|
96443
96494
|
}, Hh = Rt(({ reasoning: e, isStreaming: t }) => {
|
|
96444
|
-
const [n, r] = et(!
|
|
96495
|
+
const [n, r] = et(!0), a = ze(null);
|
|
96445
96496
|
return $e(() => {
|
|
96446
|
-
r(!t);
|
|
96447
|
-
}, [t]), $e(() => {
|
|
96448
96497
|
if (n)
|
|
96449
96498
|
return;
|
|
96450
96499
|
const o = a.current;
|
|
@@ -96495,7 +96544,16 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96495
96544
|
l
|
|
96496
96545
|
) : null;
|
|
96497
96546
|
const u = i.get(s.toolCallId);
|
|
96498
|
-
return u ? /* @__PURE__ */ C(
|
|
96547
|
+
return u ? /* @__PURE__ */ C(
|
|
96548
|
+
G3,
|
|
96549
|
+
{
|
|
96550
|
+
call: u,
|
|
96551
|
+
contextKey: t,
|
|
96552
|
+
messageId: e.id,
|
|
96553
|
+
chatId: e.chat
|
|
96554
|
+
},
|
|
96555
|
+
l
|
|
96556
|
+
) : null;
|
|
96499
96557
|
}),
|
|
96500
96558
|
n && (e.parts?.length ?? 0) === 0 && /* @__PURE__ */ C(w7, {})
|
|
96501
96559
|
] });
|
|
@@ -96505,8 +96563,8 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96505
96563
|
isStreaming: n,
|
|
96506
96564
|
showParticipantChrome: r = !1
|
|
96507
96565
|
}) => {
|
|
96508
|
-
const i =
|
|
96509
|
-
if (e.role ===
|
|
96566
|
+
const i = Pe().config.features?.reasoning !== !1;
|
|
96567
|
+
if (e.role === Ze.Assistant && (e.parts?.length ?? 0) > 0)
|
|
96510
96568
|
return /* @__PURE__ */ C(
|
|
96511
96569
|
lVe,
|
|
96512
96570
|
{
|
|
@@ -96517,7 +96575,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96517
96575
|
showParticipantChrome: r
|
|
96518
96576
|
}
|
|
96519
96577
|
);
|
|
96520
|
-
const o = i && e.role ===
|
|
96578
|
+
const o = i && e.role === Ze.Assistant && !!e.reasoning, s = e.role === Ze.Assistant && typeof e.content == "string" && e.content.trim().length > 0, l = !!(n && !o && !s), u = typeof e.content == "string" && e.content.trim().length > 0 || (e.attachments?.length ?? 0) > 0, d = sVe(e.toolCalls ?? []);
|
|
96521
96579
|
return /* @__PURE__ */ oe("div", { className: "mp-agent-message-group", children: [
|
|
96522
96580
|
o && /* @__PURE__ */ C(Hh, { reasoning: e.reasoning, isStreaming: n }),
|
|
96523
96581
|
l && /* @__PURE__ */ C(w7, {}),
|
|
@@ -96538,15 +96596,15 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96538
96596
|
return t ? e.chatState[t]?.messages ?? w5 : w5;
|
|
96539
96597
|
}, pVe = ({ showParticipantChrome: e = !1 }) => {
|
|
96540
96598
|
const t = yn(), n = ge((S) => S.contextKey), r = ge((S) => S.draftChatKey), a = ge((S) => S.activeChatId), i = ge(dVe), o = a ?? r, s = v3(a), l = ge(
|
|
96541
|
-
(S) =>
|
|
96542
|
-
), u = ge((S) =>
|
|
96599
|
+
(S) => Fe(S, o).pendingAssistant?.content?.length
|
|
96600
|
+
), u = ge((S) => Fe(S, o).pendingAssistant?.id), d = ge((S) => Fe(S, o).status), p = d === bt.Sending || d === bt.Streaming, m = ze(null), h = ze(!0), g = ze(!1), f = ze(!1), w = ze(null), _ = dwe({
|
|
96543
96601
|
count: i.length,
|
|
96544
96602
|
getScrollElement: () => m.current,
|
|
96545
96603
|
estimateSize: () => uVe,
|
|
96546
96604
|
overscan: 8,
|
|
96547
96605
|
gap: 16,
|
|
96548
96606
|
getItemKey: (S) => i[S]?.id ?? S
|
|
96549
|
-
}), b = _.getVirtualItems(), v =
|
|
96607
|
+
}), b = _.getVirtualItems(), v = Ye(() => {
|
|
96550
96608
|
const S = m.current;
|
|
96551
96609
|
S && (S.scrollTop = S.scrollHeight);
|
|
96552
96610
|
}, []);
|
|
@@ -96633,7 +96691,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96633
96691
|
contextKey: t,
|
|
96634
96692
|
showParticipantChrome: n
|
|
96635
96693
|
}) => {
|
|
96636
|
-
const r = ge((s) =>
|
|
96694
|
+
const r = ge((s) => Fe(s, e)), a = r.pendingAssistant, i = r.status;
|
|
96637
96695
|
if (!a)
|
|
96638
96696
|
return null;
|
|
96639
96697
|
const o = i === bt.Sending || i === bt.Streaming;
|
|
@@ -96649,7 +96707,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96649
96707
|
);
|
|
96650
96708
|
}
|
|
96651
96709
|
), mVe = ({ onClose: e, agentLogo: t }) => {
|
|
96652
|
-
const n = yn(), a =
|
|
96710
|
+
const n = yn(), a = Pe().config.features?.historySidebar !== !1, i = ge((u) => u.isChatHistoryOpen), o = ge((u) => u.setChatHistoryOpen), s = ge((u) => u.setActiveChat), l = () => {
|
|
96653
96711
|
s(void 0);
|
|
96654
96712
|
};
|
|
96655
96713
|
return /* @__PURE__ */ oe("div", { className: "mp-agent-agent-controls", children: [
|
|
@@ -96675,7 +96733,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96675
96733
|
isFetchingNextPage: n,
|
|
96676
96734
|
itemRenderer: r
|
|
96677
96735
|
} = {}) => {
|
|
96678
|
-
const a = yn(), { deleteChat: i, isDeleting: o } = _3(), s = ge((h) => h.chats), l = ge((h) => h.activeChatId), u = ge((h) => h.setActiveChat), d =
|
|
96736
|
+
const a = yn(), { deleteChat: i, isDeleting: o } = _3(), s = ge((h) => h.chats), l = ge((h) => h.activeChatId), u = ge((h) => h.setActiveChat), d = ze(null), p = ze(null), m = lt(
|
|
96679
96737
|
() => Object.values(s).filter((h) => h.sessionKind !== Bi.SUBAGENT).sort((h, g) => h.updatedAt === g.updatedAt ? 0 : h.updatedAt < g.updatedAt ? 1 : -1),
|
|
96680
96738
|
[s]
|
|
96681
96739
|
);
|
|
@@ -96742,7 +96800,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96742
96800
|
] })
|
|
96743
96801
|
] });
|
|
96744
96802
|
}, gVe = ({ loadChats: e = !0, multiUser: t = !1 }) => {
|
|
96745
|
-
const n =
|
|
96803
|
+
const n = Pe(), r = ge((o) => o.isChatHistoryOpen), a = n.config.features?.historySidebar !== !1, i = b3({ enabled: e && a, multiUser: t });
|
|
96746
96804
|
return !a || !r ? null : /* @__PURE__ */ C("div", { className: "mp-agent-chat-history-panel", children: /* @__PURE__ */ C(
|
|
96747
96805
|
fVe,
|
|
96748
96806
|
{
|
|
@@ -96763,7 +96821,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96763
96821
|
loadChats: i = !0,
|
|
96764
96822
|
restoreLastActiveChat: o = !0
|
|
96765
96823
|
}) => {
|
|
96766
|
-
const s = yn(), l =
|
|
96824
|
+
const s = yn(), l = Pe(), u = ge((g) => g.activeChatId), d = ge((g) => g.setActiveChat), { isLoading: p } = h7e(), { isLoading: m, error: h } = b3({ enabled: i, multiUser: r });
|
|
96767
96825
|
return uo(() => {
|
|
96768
96826
|
if (!o)
|
|
96769
96827
|
return;
|
|
@@ -96777,7 +96835,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96777
96835
|
/* @__PURE__ */ C(J_e, { onToolSelected: e, multiUser: r, participantIds: a })
|
|
96778
96836
|
] })
|
|
96779
96837
|
] });
|
|
96780
|
-
},
|
|
96838
|
+
}, jVe = (e) => /* @__PURE__ */ C(bVe, { ...e, multiUser: !0 }), GVe = ({
|
|
96781
96839
|
enabled: e = !0,
|
|
96782
96840
|
className: t,
|
|
96783
96841
|
pageSize: n = yp,
|
|
@@ -96787,7 +96845,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
|
|
|
96787
96845
|
const i = yn(), o = E5(), { deleteChat: s, isDeleting: l } = _3(), u = ge((v) => v.upsertChat), d = ge((v) => v.activeChatId), p = ge((v) => v.setActiveChat), m = y3({ enabled: e, multiUser: !0, pageSize: n }), h = lt(
|
|
96788
96846
|
() => r7e(m.data).filter((v) => v.sessionKind !== Bi.SUBAGENT),
|
|
96789
96847
|
[m.data]
|
|
96790
|
-
), g =
|
|
96848
|
+
), g = ze(null), f = ze(null);
|
|
96791
96849
|
$e(() => {
|
|
96792
96850
|
const v = g.current, E = f.current, { fetchNextPage: S, hasNextPage: x, isFetchingNextPage: z } = m;
|
|
96793
96851
|
if (!v || !E || !S || !x)
|
|
@@ -96877,7 +96935,7 @@ export {
|
|
|
96877
96935
|
mVe as AgentControls,
|
|
96878
96936
|
K_e as AgentPreferencesPanel,
|
|
96879
96937
|
Yh as AgentProcessStatus,
|
|
96880
|
-
|
|
96938
|
+
BVe as AgentProvider,
|
|
96881
96939
|
w7e as AgentRuntime,
|
|
96882
96940
|
Bi as AgentSessionKind,
|
|
96883
96941
|
Kr as AgentStatus,
|
|
@@ -96904,10 +96962,10 @@ export {
|
|
|
96904
96962
|
iVe as MessageContent,
|
|
96905
96963
|
K3 as MessageHeader,
|
|
96906
96964
|
pVe as MessageList,
|
|
96907
|
-
|
|
96965
|
+
Ze as MessageRole,
|
|
96908
96966
|
w7 as MessageTypingAnimation,
|
|
96909
|
-
|
|
96910
|
-
|
|
96967
|
+
GVe as MultiUserChatList,
|
|
96968
|
+
jVe as MultiUserChatWindow,
|
|
96911
96969
|
Hh as ReasoningPanel,
|
|
96912
96970
|
AVe as SendMessagePayloadSchema,
|
|
96913
96971
|
ld as SocketIOConfig,
|
|
@@ -96933,11 +96991,12 @@ export {
|
|
|
96933
96991
|
OVe as useActivitySummary,
|
|
96934
96992
|
l7e as useAgentConfigurations,
|
|
96935
96993
|
p7e as useAgentPreferences,
|
|
96936
|
-
|
|
96994
|
+
Pe as useAgentRuntime,
|
|
96937
96995
|
ge as useAgentStore,
|
|
96938
96996
|
S7e as useAgentTheme,
|
|
96939
96997
|
$Ve as useAutoScroll,
|
|
96940
96998
|
b3 as useChatBootstrap,
|
|
96999
|
+
FVe as useChatMetadata,
|
|
96941
97000
|
a7e as useChats,
|
|
96942
97001
|
y3 as useChatsInfiniteList,
|
|
96943
97002
|
DVe as useChatsList,
|
|
@@ -96947,7 +97006,7 @@ export {
|
|
|
96947
97006
|
v3 as useMessagesInfinite,
|
|
96948
97007
|
i7e as useModels,
|
|
96949
97008
|
zVe as usePageContext,
|
|
96950
|
-
|
|
97009
|
+
PVe as useProposeFormValues,
|
|
96951
97010
|
c7e as useRuntimeEventEmitter,
|
|
96952
97011
|
u7e as useRuntimeEventListener,
|
|
96953
97012
|
yn as useTranslations
|