@fencyai/react 0.1.156 → 0.1.158
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/agent-task/AgentTaskProgress.d.ts +3 -3
- package/dist/agent-task/AgentTaskProgress.d.ts.map +1 -1
- package/dist/agent-task/AgentTaskProgressVerbose.d.ts +3 -3
- package/dist/agent-task/AgentTaskProgressVerbose.d.ts.map +1 -1
- package/dist/agent-task/data-types/MemoryChatCompletionSourcesResult.d.ts +1 -1
- package/dist/agent-task/data-types/MemoryChatCompletionSourcesResult.d.ts.map +1 -1
- package/dist/agent-task/data-types/MemorySearchCompletedResults.d.ts +1 -1
- package/dist/agent-task/data-types/MemorySearchCompletedResults.d.ts.map +1 -1
- package/dist/agent-task/data-types/MemorySearchExploreQueries.d.ts +1 -1
- package/dist/agent-task/data-types/MemorySearchExploreQueries.d.ts.map +1 -1
- package/dist/index.js +753 -676
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { jsxs as y, jsx as
|
|
1
|
+
import { jsxs as y, jsx as i, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { createStream as ie, isStreamTimeoutEvent as ae, isStreamNotFoundEvent as se, isAgentTaskProgressItemUpdatedEvent as le, createAgentTask as ce } from "@fencyai/js";
|
|
3
|
-
import { createContext as de, useState as
|
|
4
|
-
import { useInView as
|
|
3
|
+
import { createContext as de, useState as b, useRef as A, useEffect as M, useCallback as G, useContext as me, useMemo as D } from "react";
|
|
4
|
+
import { useInView as ue, motion as T, AnimatePresence as X } from "motion/react";
|
|
5
5
|
import pe from "react-markdown";
|
|
6
6
|
import { Prism as J } from "react-syntax-highlighter";
|
|
7
|
-
import
|
|
7
|
+
import ye from "remark-gfm";
|
|
8
8
|
import './assets/index.css';const Y = de(
|
|
9
9
|
void 0
|
|
10
10
|
);
|
|
11
|
-
async function
|
|
11
|
+
async function ge(e, r) {
|
|
12
12
|
const n = e.getReader();
|
|
13
13
|
let t;
|
|
14
14
|
for (; !(t = await n.read()).done; )
|
|
15
15
|
r(t.value);
|
|
16
16
|
}
|
|
17
17
|
function he(e) {
|
|
18
|
-
let r, n, t,
|
|
19
|
-
return function(
|
|
20
|
-
r === void 0 ? (r =
|
|
18
|
+
let r, n, t, l = !1;
|
|
19
|
+
return function(s) {
|
|
20
|
+
r === void 0 ? (r = s, n = 0, t = -1) : r = Se(r, s);
|
|
21
21
|
const d = r.length;
|
|
22
|
-
let
|
|
22
|
+
let m = 0;
|
|
23
23
|
for (; n < d; ) {
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
for (; n < d &&
|
|
24
|
+
l && (r[n] === 10 && (m = ++n), l = !1);
|
|
25
|
+
let o = -1;
|
|
26
|
+
for (; n < d && o === -1; ++n)
|
|
27
27
|
switch (r[n]) {
|
|
28
28
|
case 58:
|
|
29
|
-
t === -1 && (t = n -
|
|
29
|
+
t === -1 && (t = n - m);
|
|
30
30
|
break;
|
|
31
31
|
case 13:
|
|
32
|
-
|
|
32
|
+
l = !0;
|
|
33
33
|
case 10:
|
|
34
|
-
|
|
34
|
+
o = n;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
if (
|
|
37
|
+
if (o === -1)
|
|
38
38
|
break;
|
|
39
|
-
e(r.subarray(
|
|
39
|
+
e(r.subarray(m, o), t), m = n, t = -1;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
m === d ? r = void 0 : m !== 0 && (r = r.subarray(m), n -= m);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
function fe(e, r, n) {
|
|
45
45
|
let t = q();
|
|
46
|
-
const
|
|
47
|
-
return function(
|
|
48
|
-
if (
|
|
46
|
+
const l = new TextDecoder();
|
|
47
|
+
return function(s, d) {
|
|
48
|
+
if (s.length === 0)
|
|
49
49
|
n == null || n(t), t = q();
|
|
50
50
|
else if (d > 0) {
|
|
51
|
-
const
|
|
52
|
-
switch (
|
|
51
|
+
const m = l.decode(s.subarray(0, d)), o = d + (s[d + 1] === 32 ? 2 : 1), a = l.decode(s.subarray(o));
|
|
52
|
+
switch (m) {
|
|
53
53
|
case "data":
|
|
54
54
|
t.data = t.data ? t.data + `
|
|
55
55
|
` + a : a;
|
|
@@ -61,8 +61,8 @@ function fe(e, r, n) {
|
|
|
61
61
|
e(t.id = a);
|
|
62
62
|
break;
|
|
63
63
|
case "retry":
|
|
64
|
-
const
|
|
65
|
-
isNaN(
|
|
64
|
+
const u = parseInt(a, 10);
|
|
65
|
+
isNaN(u) || r(t.retry = u);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -84,46 +84,46 @@ var xe = function(e, r) {
|
|
|
84
84
|
var n = {};
|
|
85
85
|
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && r.indexOf(t) < 0 && (n[t] = e[t]);
|
|
86
86
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
87
|
-
for (var
|
|
88
|
-
r.indexOf(t[
|
|
87
|
+
for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
|
|
88
|
+
r.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (n[t[l]] = e[t[l]]);
|
|
89
89
|
return n;
|
|
90
90
|
};
|
|
91
91
|
const _ = "text/event-stream", Te = 1e3, U = "last-event-id";
|
|
92
92
|
function ke(e, r) {
|
|
93
|
-
var { signal: n, headers: t, onopen:
|
|
94
|
-
return new Promise((
|
|
93
|
+
var { signal: n, headers: t, onopen: l, onmessage: c, onclose: s, onerror: d, openWhenHidden: m, fetch: o } = r, a = xe(r, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
94
|
+
return new Promise((u, g) => {
|
|
95
95
|
const f = Object.assign({}, t);
|
|
96
96
|
f.accept || (f.accept = _);
|
|
97
|
-
let
|
|
98
|
-
function
|
|
99
|
-
|
|
97
|
+
let p;
|
|
98
|
+
function S() {
|
|
99
|
+
p.abort(), document.hidden || R();
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
let
|
|
103
|
-
function
|
|
104
|
-
document.removeEventListener("visibilitychange",
|
|
101
|
+
m || document.addEventListener("visibilitychange", S);
|
|
102
|
+
let h = Te, k = 0;
|
|
103
|
+
function v() {
|
|
104
|
+
document.removeEventListener("visibilitychange", S), window.clearTimeout(k), p.abort();
|
|
105
105
|
}
|
|
106
106
|
n == null || n.addEventListener("abort", () => {
|
|
107
|
-
|
|
107
|
+
v(), u();
|
|
108
108
|
});
|
|
109
|
-
const F =
|
|
109
|
+
const F = o ?? window.fetch, w = l ?? be;
|
|
110
110
|
async function R() {
|
|
111
111
|
var L;
|
|
112
|
-
|
|
112
|
+
p = new AbortController();
|
|
113
113
|
try {
|
|
114
|
-
const P = await F(e, Object.assign(Object.assign({}, a), { headers: f, signal:
|
|
115
|
-
await w(P), await
|
|
116
|
-
|
|
117
|
-
}, (
|
|
118
|
-
|
|
119
|
-
},
|
|
114
|
+
const P = await F(e, Object.assign(Object.assign({}, a), { headers: f, signal: p.signal }));
|
|
115
|
+
await w(P), await ge(P.body, he(fe((I) => {
|
|
116
|
+
I ? f[U] = I : delete f[U];
|
|
117
|
+
}, (I) => {
|
|
118
|
+
h = I;
|
|
119
|
+
}, c))), s == null || s(), v(), u();
|
|
120
120
|
} catch (P) {
|
|
121
|
-
if (!
|
|
121
|
+
if (!p.signal.aborted)
|
|
122
122
|
try {
|
|
123
|
-
const
|
|
124
|
-
window.clearTimeout(k), k = window.setTimeout(R,
|
|
125
|
-
} catch (
|
|
126
|
-
|
|
123
|
+
const I = (L = d == null ? void 0 : d(P)) !== null && L !== void 0 ? L : h;
|
|
124
|
+
window.clearTimeout(k), k = window.setTimeout(R, I);
|
|
125
|
+
} catch (I) {
|
|
126
|
+
v(), g(I);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -151,36 +151,36 @@ class Ce {
|
|
|
151
151
|
*/
|
|
152
152
|
updateStreams(r) {
|
|
153
153
|
r.forEach((t) => {
|
|
154
|
-
const
|
|
155
|
-
this.eventSources.has(
|
|
154
|
+
const l = t.stream.id;
|
|
155
|
+
this.eventSources.has(l) || this.connectStream(t);
|
|
156
156
|
});
|
|
157
157
|
const n = new Set(r.map((t) => t.stream.id));
|
|
158
|
-
this.eventSources.forEach((t,
|
|
159
|
-
n.has(
|
|
158
|
+
this.eventSources.forEach((t, l) => {
|
|
159
|
+
n.has(l) || (t.abort(), this.eventSources.delete(l));
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
connectStream(r) {
|
|
163
163
|
const n = r.stream.id, t = new AbortController();
|
|
164
164
|
this.eventSources.set(n, t);
|
|
165
|
-
const
|
|
165
|
+
const l = `${this.fency.baseUrl}/sse/streams/${n}`, c = {
|
|
166
166
|
"X-Fency-Publishable-Key": this.fency.publishableKey,
|
|
167
167
|
"X-Fency-Stream-Token": r.stream.token
|
|
168
168
|
};
|
|
169
|
-
ke(
|
|
170
|
-
headers:
|
|
169
|
+
ke(l, {
|
|
170
|
+
headers: c,
|
|
171
171
|
signal: t.signal,
|
|
172
|
-
async onopen(
|
|
173
|
-
if (!
|
|
174
|
-
throw new Error(`Client error ${
|
|
172
|
+
async onopen(s) {
|
|
173
|
+
if (!s.ok && s.status >= 400 && s.status < 500 && s.status !== 429)
|
|
174
|
+
throw new Error(`Client error ${s.status}`);
|
|
175
175
|
},
|
|
176
|
-
onmessage: (
|
|
177
|
-
if (
|
|
178
|
-
const d = ve(
|
|
176
|
+
onmessage: (s) => {
|
|
177
|
+
if (s.data) {
|
|
178
|
+
const d = ve(s.data);
|
|
179
179
|
this.broadcast(d, n);
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
onerror: (
|
|
183
|
-
throw console.error("EventSource error for stream", n, ":",
|
|
182
|
+
onerror: (s) => {
|
|
183
|
+
throw console.error("EventSource error for stream", n, ":", s), this.broadcastError(n), s;
|
|
184
184
|
},
|
|
185
185
|
onclose() {
|
|
186
186
|
}
|
|
@@ -216,31 +216,31 @@ const Ee = 12e4, we = (e) => {
|
|
|
216
216
|
const r = Date.now();
|
|
217
217
|
return e.filter((n) => r - n.createdAt < Ee);
|
|
218
218
|
};
|
|
219
|
-
function
|
|
220
|
-
const [t,
|
|
219
|
+
function Ir({ fency: e, fetchCreateStreamClientToken: r, children: n }) {
|
|
220
|
+
const [t, l] = b(
|
|
221
221
|
null
|
|
222
|
-
), [
|
|
223
|
-
|
|
224
|
-
e.then((
|
|
225
|
-
|
|
226
|
-
}).catch((
|
|
227
|
-
|
|
222
|
+
), [c, s] = b(!0), [d, m] = b(null), [o, a] = b([]), u = A(null), g = A(null);
|
|
223
|
+
M(() => {
|
|
224
|
+
e.then((h) => {
|
|
225
|
+
l(h), s(!1);
|
|
226
|
+
}).catch((h) => {
|
|
227
|
+
m(h), s(!1);
|
|
228
228
|
});
|
|
229
|
-
}, [e]),
|
|
230
|
-
t && !
|
|
231
|
-
}, [t]),
|
|
232
|
-
|
|
233
|
-
}, [
|
|
234
|
-
var
|
|
235
|
-
(
|
|
229
|
+
}, [e]), M(() => {
|
|
230
|
+
t && !g.current && (g.current = new Ce(t));
|
|
231
|
+
}, [t]), M(() => {
|
|
232
|
+
g.current && g.current.updateStreams(o);
|
|
233
|
+
}, [o]), M(() => () => {
|
|
234
|
+
var h;
|
|
235
|
+
(h = g.current) == null || h.cleanup();
|
|
236
236
|
}, []);
|
|
237
237
|
const f = G(
|
|
238
|
-
async (
|
|
239
|
-
if (
|
|
240
|
-
return
|
|
241
|
-
const k = Date.now(),
|
|
242
|
-
if (
|
|
243
|
-
return
|
|
238
|
+
async (h = 3e4) => {
|
|
239
|
+
if (u.current)
|
|
240
|
+
return u.current;
|
|
241
|
+
const k = Date.now(), v = o.length > 0 ? o[o.length - 1] : null;
|
|
242
|
+
if (v && k - v.createdAt < h)
|
|
243
|
+
return v.stream;
|
|
244
244
|
const F = (async () => {
|
|
245
245
|
if (!t)
|
|
246
246
|
throw new Error("Fency instance not initialized");
|
|
@@ -255,15 +255,15 @@ function Mr({ fency: e, fetchCreateStreamClientToken: r, children: n }) {
|
|
|
255
255
|
createdAt: Date.now()
|
|
256
256
|
};
|
|
257
257
|
return a((P) => {
|
|
258
|
-
const
|
|
259
|
-
return we(
|
|
260
|
-
}),
|
|
258
|
+
const I = [...P, L];
|
|
259
|
+
return we(I);
|
|
260
|
+
}), u.current = null, R.stream;
|
|
261
261
|
} else
|
|
262
|
-
throw
|
|
262
|
+
throw u.current = null, new Error("Failed to create stream");
|
|
263
263
|
})();
|
|
264
|
-
return
|
|
264
|
+
return u.current = F, F;
|
|
265
265
|
},
|
|
266
|
-
[t,
|
|
266
|
+
[t, o]
|
|
267
267
|
);
|
|
268
268
|
if (d)
|
|
269
269
|
return /* @__PURE__ */ y("div", { children: [
|
|
@@ -272,31 +272,31 @@ function Mr({ fency: e, fetchCreateStreamClientToken: r, children: n }) {
|
|
|
272
272
|
] });
|
|
273
273
|
if (!t)
|
|
274
274
|
return null;
|
|
275
|
-
const
|
|
275
|
+
const p = o.length > 0 ? o[o.length - 1] : null, S = {
|
|
276
276
|
fency: t,
|
|
277
|
-
loading:
|
|
277
|
+
loading: c,
|
|
278
278
|
error: d,
|
|
279
|
-
activeStreams:
|
|
280
|
-
latestStream:
|
|
281
|
-
eventManager:
|
|
279
|
+
activeStreams: o,
|
|
280
|
+
latestStream: p,
|
|
281
|
+
eventManager: g.current,
|
|
282
282
|
getOrCreateStream: f
|
|
283
283
|
};
|
|
284
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ i(Y.Provider, { value: S, children: n });
|
|
285
285
|
}
|
|
286
286
|
function Z() {
|
|
287
|
-
const e =
|
|
287
|
+
const e = me(Y);
|
|
288
288
|
if (e === void 0)
|
|
289
289
|
throw new Error("useFencyContext must be used within a FencyProvider");
|
|
290
290
|
return e;
|
|
291
291
|
}
|
|
292
|
-
const
|
|
292
|
+
const Ie = (e) => {
|
|
293
293
|
try {
|
|
294
294
|
const r = JSON.parse(e);
|
|
295
|
-
return
|
|
295
|
+
return Me(r);
|
|
296
296
|
} catch (r) {
|
|
297
297
|
return console.error("Error parsing message:", r), null;
|
|
298
298
|
}
|
|
299
|
-
},
|
|
299
|
+
}, Me = (e) => ae(e) ? Ae(e) : se(e) ? Fe(e) : le(e) ? Re(e) : null, Ae = (e) => ({
|
|
300
300
|
type: "STREAM_TIMEOUT",
|
|
301
301
|
streamId: e.streamId,
|
|
302
302
|
timestamp: e.timestamp
|
|
@@ -313,30 +313,30 @@ const Me = (e) => {
|
|
|
313
313
|
createdAt: e.createdAt,
|
|
314
314
|
data: JSON.parse(e.data)
|
|
315
315
|
}), Pe = (e) => {
|
|
316
|
-
const r = Z(), [n, t] =
|
|
317
|
-
return
|
|
316
|
+
const r = Z(), [n, t] = b(null), l = A(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
|
|
317
|
+
return M(() => {
|
|
318
318
|
if (!r.eventManager) return;
|
|
319
|
-
const
|
|
320
|
-
onMessage: (
|
|
321
|
-
var
|
|
322
|
-
const a =
|
|
319
|
+
const s = {
|
|
320
|
+
onMessage: (m, o) => {
|
|
321
|
+
var u, g, f;
|
|
322
|
+
const a = Ie(m);
|
|
323
323
|
if (a)
|
|
324
324
|
switch (a.type) {
|
|
325
325
|
case "STREAM_TIMEOUT":
|
|
326
|
-
(
|
|
326
|
+
(u = e == null ? void 0 : e.onStreamTimeout) == null || u.call(e, a);
|
|
327
327
|
break;
|
|
328
328
|
case "STREAM_NOT_FOUND":
|
|
329
|
-
(
|
|
329
|
+
(g = e == null ? void 0 : e.onStreamNotFound) == null || g.call(e, a);
|
|
330
330
|
break;
|
|
331
331
|
case "AGENT_TASK_PROGRESS_ITEM_UPDATED":
|
|
332
332
|
(f = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || f.call(e, a);
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
335
335
|
},
|
|
336
|
-
onError: (
|
|
337
|
-
var
|
|
338
|
-
(
|
|
339
|
-
streamId:
|
|
336
|
+
onError: (m) => {
|
|
337
|
+
var o;
|
|
338
|
+
(o = e == null ? void 0 : e.onStreamError) == null || o.call(e, {
|
|
339
|
+
streamId: m,
|
|
340
340
|
error: {
|
|
341
341
|
code: "UnknownError",
|
|
342
342
|
message: "Unknown error in useStream"
|
|
@@ -345,197 +345,197 @@ const Me = (e) => {
|
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
347
|
return r.eventManager.subscribe(
|
|
348
|
-
|
|
349
|
-
|
|
348
|
+
l.current,
|
|
349
|
+
s
|
|
350
350
|
);
|
|
351
351
|
}, [r.eventManager, e]), {
|
|
352
352
|
createStream: async () => {
|
|
353
353
|
try {
|
|
354
|
-
const
|
|
355
|
-
return t(
|
|
354
|
+
const s = await r.getOrCreateStream(3e4);
|
|
355
|
+
return t(s), {
|
|
356
356
|
type: "success",
|
|
357
|
-
stream:
|
|
357
|
+
stream: s
|
|
358
358
|
};
|
|
359
|
-
} catch (
|
|
359
|
+
} catch (s) {
|
|
360
360
|
return {
|
|
361
361
|
type: "error",
|
|
362
362
|
error: {
|
|
363
363
|
code: "UnknownError",
|
|
364
|
-
message:
|
|
364
|
+
message: s instanceof Error ? s.message : "Failed to create stream"
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
368
|
},
|
|
369
369
|
stream: n
|
|
370
370
|
};
|
|
371
|
-
},
|
|
372
|
-
const r = Z(), [n, t] =
|
|
373
|
-
onAgentTaskProgressItemUpdated: (
|
|
374
|
-
var
|
|
375
|
-
if (!
|
|
376
|
-
const a =
|
|
371
|
+
}, Mr = (e) => {
|
|
372
|
+
const r = Z(), [n, t] = b([]), l = A(/* @__PURE__ */ new Set()), c = A(/* @__PURE__ */ new Map()), { createStream: s } = Pe({
|
|
373
|
+
onAgentTaskProgressItemUpdated: (o) => {
|
|
374
|
+
var g;
|
|
375
|
+
if (!l.current.has(o.agentTaskId)) return;
|
|
376
|
+
const a = o.data;
|
|
377
377
|
if (a.taskType === "StreamingChatCompletion" && a.eventType === "Completed" || a.taskType === "StructuredChatCompletion" && a.eventType === "Completed" || a.taskType === "MemoryChatCompletion" && a.eventType === "Completed" || a.taskType === "MemorySearch" && a.eventType === "Completed") {
|
|
378
378
|
const f = a.taskType === "MemorySearch" && a.eventType === "Completed" || a.taskType === "StructuredChatCompletion" && a.eventType === "Completed";
|
|
379
379
|
t(
|
|
380
|
-
f ? (
|
|
380
|
+
f ? (S) => S.map((h) => {
|
|
381
381
|
var F;
|
|
382
|
-
if (((F =
|
|
383
|
-
return
|
|
384
|
-
const
|
|
385
|
-
(w) => w.progressItemId ===
|
|
386
|
-
) ?
|
|
387
|
-
(w) => w.progressItemId ===
|
|
388
|
-
) : [...
|
|
382
|
+
if (((F = h.confirmedData) == null ? void 0 : F.taskId) !== o.agentTaskId)
|
|
383
|
+
return h;
|
|
384
|
+
const v = h.progressItems.some(
|
|
385
|
+
(w) => w.progressItemId === o.progressItemId
|
|
386
|
+
) ? h.progressItems.map(
|
|
387
|
+
(w) => w.progressItemId === o.progressItemId ? o : w
|
|
388
|
+
) : [...h.progressItems, o];
|
|
389
389
|
return {
|
|
390
|
-
...
|
|
391
|
-
progressItems:
|
|
390
|
+
...h,
|
|
391
|
+
progressItems: v,
|
|
392
392
|
loading: !1
|
|
393
393
|
};
|
|
394
|
-
}) : (
|
|
395
|
-
(
|
|
394
|
+
}) : (S) => S.map(
|
|
395
|
+
(h) => {
|
|
396
396
|
var k;
|
|
397
|
-
return ((k =
|
|
397
|
+
return ((k = h.confirmedData) == null ? void 0 : k.taskId) === o.agentTaskId ? { ...h, loading: !1 } : h;
|
|
398
398
|
}
|
|
399
399
|
)
|
|
400
400
|
);
|
|
401
|
-
const
|
|
402
|
-
|
|
401
|
+
const p = c.current.get(
|
|
402
|
+
o.agentTaskId
|
|
403
403
|
);
|
|
404
|
-
|
|
404
|
+
p && (c.current.delete(o.agentTaskId), p(a));
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
|
-
(
|
|
408
|
-
(f) => f.map((
|
|
407
|
+
(g = e.onAgentTaskProgressItemUpdated) == null || g.call(e, o), t(
|
|
408
|
+
(f) => f.map((p) => {
|
|
409
409
|
var k;
|
|
410
|
-
if (((k =
|
|
411
|
-
return
|
|
412
|
-
const
|
|
413
|
-
(
|
|
414
|
-
) ?
|
|
415
|
-
(
|
|
416
|
-
) : [...
|
|
417
|
-
return { ...
|
|
410
|
+
if (((k = p.confirmedData) == null ? void 0 : k.taskId) !== o.agentTaskId)
|
|
411
|
+
return p;
|
|
412
|
+
const h = p.progressItems.some(
|
|
413
|
+
(v) => v.progressItemId === o.progressItemId
|
|
414
|
+
) ? p.progressItems.map(
|
|
415
|
+
(v) => v.progressItemId === o.progressItemId ? o : v
|
|
416
|
+
) : [...p.progressItems, o];
|
|
417
|
+
return { ...p, progressItems: h };
|
|
418
418
|
})
|
|
419
419
|
);
|
|
420
420
|
},
|
|
421
|
-
onStreamError: (
|
|
421
|
+
onStreamError: (o) => {
|
|
422
422
|
var a;
|
|
423
|
-
(a = e == null ? void 0 : e.onStreamError) == null || a.call(e,
|
|
424
|
-
const
|
|
425
|
-
return
|
|
426
|
-
...
|
|
423
|
+
(a = e == null ? void 0 : e.onStreamError) == null || a.call(e, o), t((u) => {
|
|
424
|
+
const g = u.find((f) => f.streamId === o.streamId);
|
|
425
|
+
return g ? [
|
|
426
|
+
...u.filter((f) => f.streamId !== o.streamId),
|
|
427
427
|
{
|
|
428
|
-
...
|
|
428
|
+
...g,
|
|
429
429
|
loading: !1,
|
|
430
|
-
error:
|
|
430
|
+
error: o.error
|
|
431
431
|
}
|
|
432
|
-
] :
|
|
432
|
+
] : u;
|
|
433
433
|
});
|
|
434
434
|
},
|
|
435
|
-
onStreamNotFound: (
|
|
435
|
+
onStreamNotFound: (o) => {
|
|
436
436
|
var a;
|
|
437
|
-
(a = e == null ? void 0 : e.onStreamNotFound) == null || a.call(e,
|
|
437
|
+
(a = e == null ? void 0 : e.onStreamNotFound) == null || a.call(e, o);
|
|
438
438
|
},
|
|
439
|
-
onStreamTimeout: (
|
|
439
|
+
onStreamTimeout: (o) => {
|
|
440
440
|
var a;
|
|
441
|
-
(a = e == null ? void 0 : e.onStreamTimeout) == null || a.call(e,
|
|
441
|
+
(a = e == null ? void 0 : e.onStreamTimeout) == null || a.call(e, o);
|
|
442
442
|
}
|
|
443
443
|
}), d = G(
|
|
444
|
-
async (
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
444
|
+
async (o, a) => {
|
|
445
|
+
const u = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, g = await s();
|
|
446
|
+
if (g.type === "success") {
|
|
447
447
|
t([
|
|
448
448
|
...n,
|
|
449
449
|
{
|
|
450
|
-
taskKey:
|
|
451
|
-
streamId:
|
|
450
|
+
taskKey: u,
|
|
451
|
+
streamId: g.stream.id,
|
|
452
452
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
453
453
|
confirmedData: null,
|
|
454
454
|
error: null,
|
|
455
|
-
params:
|
|
455
|
+
params: o,
|
|
456
456
|
progressItems: [],
|
|
457
457
|
loading: !0,
|
|
458
458
|
loadingText: a == null ? void 0 : a.loadingText
|
|
459
459
|
}
|
|
460
460
|
]);
|
|
461
|
-
const { clientToken: f } = await e.fetchCreateAgentTaskClientToken(
|
|
461
|
+
const { clientToken: f } = await e.fetchCreateAgentTaskClientToken(o.type), p = await ce({
|
|
462
462
|
pk: r.fency.publishableKey,
|
|
463
463
|
baseUrl: r.fency.baseUrl,
|
|
464
464
|
clientToken: f,
|
|
465
|
-
streamToken:
|
|
465
|
+
streamToken: g.stream.token,
|
|
466
466
|
request: {
|
|
467
|
-
streamingChatCompletionTask:
|
|
468
|
-
messages:
|
|
469
|
-
model:
|
|
467
|
+
streamingChatCompletionTask: o.type === "StreamingChatCompletion" ? {
|
|
468
|
+
messages: o.messages,
|
|
469
|
+
model: o.model
|
|
470
470
|
} : void 0,
|
|
471
|
-
structuredChatCompletionTask:
|
|
472
|
-
messages:
|
|
473
|
-
jsonSchema:
|
|
474
|
-
model:
|
|
471
|
+
structuredChatCompletionTask: o.type === "StructuredChatCompletion" ? {
|
|
472
|
+
messages: o.messages,
|
|
473
|
+
jsonSchema: o.jsonSchema,
|
|
474
|
+
model: o.model
|
|
475
475
|
} : void 0,
|
|
476
|
-
memoryChatCompletionTask:
|
|
477
|
-
messages:
|
|
478
|
-
model:
|
|
479
|
-
language:
|
|
480
|
-
chunkLimit:
|
|
481
|
-
memoryScanLimit:
|
|
476
|
+
memoryChatCompletionTask: o.type === "MemoryChatCompletion" ? {
|
|
477
|
+
messages: o.messages,
|
|
478
|
+
model: o.model,
|
|
479
|
+
language: o.language ?? "en",
|
|
480
|
+
chunkLimit: o.chunkLimit ?? 10,
|
|
481
|
+
memoryScanLimit: o.memoryScanLimit ?? 3
|
|
482
482
|
} : void 0,
|
|
483
|
-
memorySearchTask:
|
|
484
|
-
query:
|
|
485
|
-
model:
|
|
486
|
-
language:
|
|
487
|
-
chunkLimit:
|
|
488
|
-
contextExpansion:
|
|
489
|
-
...
|
|
490
|
-
queryExpansion:
|
|
483
|
+
memorySearchTask: o.type === "MemorySearch" ? {
|
|
484
|
+
query: o.query,
|
|
485
|
+
model: o.model,
|
|
486
|
+
language: o.language ?? "en",
|
|
487
|
+
chunkLimit: o.chunkLimit ?? 10,
|
|
488
|
+
contextExpansion: o.contextExpansion,
|
|
489
|
+
...o.queryExpansion != null ? {
|
|
490
|
+
queryExpansion: o.queryExpansion
|
|
491
491
|
} : {}
|
|
492
492
|
} : void 0
|
|
493
493
|
}
|
|
494
494
|
});
|
|
495
|
-
if (
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
), t((
|
|
499
|
-
...
|
|
495
|
+
if (p.type === "success" && p.agentTask) {
|
|
496
|
+
l.current.add(
|
|
497
|
+
p.agentTask.id
|
|
498
|
+
), t((h) => [
|
|
499
|
+
...h.filter((k) => k.taskKey !== u),
|
|
500
500
|
{
|
|
501
|
-
taskKey:
|
|
502
|
-
streamId:
|
|
501
|
+
taskKey: u,
|
|
502
|
+
streamId: g.stream.id,
|
|
503
503
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
504
|
-
taskId:
|
|
505
|
-
createdAt:
|
|
504
|
+
taskId: p.agentTask.id,
|
|
505
|
+
createdAt: p.agentTask.createdAt,
|
|
506
506
|
error: null,
|
|
507
|
-
params:
|
|
507
|
+
params: o,
|
|
508
508
|
progressItems: [],
|
|
509
509
|
loading: !0,
|
|
510
510
|
loadingText: a == null ? void 0 : a.loadingText,
|
|
511
511
|
confirmedData: {
|
|
512
|
-
taskId:
|
|
513
|
-
createdAt:
|
|
512
|
+
taskId: p.agentTask.id,
|
|
513
|
+
createdAt: p.agentTask.createdAt
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
]);
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
517
|
+
const S = await new Promise((h) => {
|
|
518
|
+
c.current.set(
|
|
519
|
+
p.agentTask.id,
|
|
520
|
+
h
|
|
521
521
|
);
|
|
522
522
|
});
|
|
523
523
|
return {
|
|
524
524
|
type: "success",
|
|
525
|
-
streamId:
|
|
526
|
-
agentTaskId:
|
|
527
|
-
response:
|
|
525
|
+
streamId: g.stream.id,
|
|
526
|
+
agentTaskId: p.agentTask.id,
|
|
527
|
+
response: S
|
|
528
528
|
};
|
|
529
529
|
} else {
|
|
530
|
-
if (
|
|
531
|
-
return t((
|
|
532
|
-
...
|
|
530
|
+
if (p.type === "error")
|
|
531
|
+
return t((S) => [
|
|
532
|
+
...S.filter((h) => h.taskKey !== u),
|
|
533
533
|
{
|
|
534
|
-
taskKey:
|
|
534
|
+
taskKey: u,
|
|
535
535
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
536
|
-
streamId:
|
|
537
|
-
params:
|
|
538
|
-
error:
|
|
536
|
+
streamId: g.stream.id,
|
|
537
|
+
params: o,
|
|
538
|
+
error: p.error,
|
|
539
539
|
progressItems: [],
|
|
540
540
|
loading: !1,
|
|
541
541
|
loadingText: a == null ? void 0 : a.loadingText,
|
|
@@ -543,21 +543,21 @@ const Me = (e) => {
|
|
|
543
543
|
}
|
|
544
544
|
]), {
|
|
545
545
|
type: "error",
|
|
546
|
-
error:
|
|
546
|
+
error: p.error
|
|
547
547
|
};
|
|
548
548
|
{
|
|
549
|
-
const
|
|
549
|
+
const S = {
|
|
550
550
|
message: "No response received",
|
|
551
551
|
code: "UnknownError"
|
|
552
552
|
};
|
|
553
|
-
return t((
|
|
554
|
-
...
|
|
553
|
+
return t((h) => [
|
|
554
|
+
...h.filter((k) => k.taskKey !== u),
|
|
555
555
|
{
|
|
556
|
-
taskKey:
|
|
556
|
+
taskKey: u,
|
|
557
557
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
558
|
-
streamId:
|
|
559
|
-
error:
|
|
560
|
-
params:
|
|
558
|
+
streamId: g.stream.id,
|
|
559
|
+
error: S,
|
|
560
|
+
params: o,
|
|
561
561
|
progressItems: [],
|
|
562
562
|
loading: !1,
|
|
563
563
|
loadingText: a == null ? void 0 : a.loadingText,
|
|
@@ -565,39 +565,39 @@ const Me = (e) => {
|
|
|
565
565
|
}
|
|
566
566
|
]), {
|
|
567
567
|
type: "error",
|
|
568
|
-
error:
|
|
568
|
+
error: S
|
|
569
569
|
};
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
} else
|
|
573
|
-
return console.error(
|
|
573
|
+
return console.error(g.error), g;
|
|
574
574
|
},
|
|
575
|
-
[r, n,
|
|
576
|
-
),
|
|
575
|
+
[r, n, s]
|
|
576
|
+
), m = D(() => {
|
|
577
577
|
if (n.length !== 0)
|
|
578
|
-
return [...n].sort((
|
|
578
|
+
return [...n].sort((o, a) => new Date(a.triggeredAt).getTime() - new Date(o.triggeredAt).getTime())[0];
|
|
579
579
|
}, [n]);
|
|
580
|
-
return
|
|
581
|
-
|
|
580
|
+
return M(() => () => {
|
|
581
|
+
l.current.clear(), c.current.clear();
|
|
582
582
|
}, []), {
|
|
583
583
|
agentTasks: n,
|
|
584
584
|
createAgentTask: d,
|
|
585
|
-
latest:
|
|
585
|
+
latest: m
|
|
586
586
|
};
|
|
587
587
|
};
|
|
588
588
|
function De(e) {
|
|
589
589
|
return e.progressItems.map((r, n) => {
|
|
590
|
-
const t = e.progressItems[n + 1],
|
|
591
|
-
let
|
|
590
|
+
const t = e.progressItems[n + 1], l = t != null;
|
|
591
|
+
let c;
|
|
592
592
|
if (t != null && t.createdAt) {
|
|
593
|
-
const
|
|
594
|
-
|
|
593
|
+
const s = new Date(r.createdAt).getTime(), d = new Date(t.createdAt).getTime();
|
|
594
|
+
c = Math.round((d - s) / 1e3);
|
|
595
595
|
}
|
|
596
596
|
return {
|
|
597
597
|
item: r,
|
|
598
|
-
completed:
|
|
598
|
+
completed: l,
|
|
599
599
|
isLatest: n === e.progressItems.length - 1,
|
|
600
|
-
durationSeconds:
|
|
600
|
+
durationSeconds: c
|
|
601
601
|
};
|
|
602
602
|
});
|
|
603
603
|
}
|
|
@@ -606,22 +606,22 @@ function C({
|
|
|
606
606
|
duration: r = 2,
|
|
607
607
|
delay: n = 0,
|
|
608
608
|
repeat: t = !0,
|
|
609
|
-
repeatDelay:
|
|
610
|
-
className:
|
|
611
|
-
startOnView:
|
|
609
|
+
repeatDelay: l = 0.5,
|
|
610
|
+
className: c,
|
|
611
|
+
startOnView: s = !1,
|
|
612
612
|
once: d = !1,
|
|
613
|
-
inViewMargin:
|
|
614
|
-
spread:
|
|
613
|
+
inViewMargin: m,
|
|
614
|
+
spread: o = 2,
|
|
615
615
|
color: a = "#999",
|
|
616
|
-
shimmerColor:
|
|
617
|
-
direction:
|
|
616
|
+
shimmerColor: u = "#000",
|
|
617
|
+
direction: g = "fromBottom"
|
|
618
618
|
}) {
|
|
619
|
-
const f = A(null),
|
|
620
|
-
return /* @__PURE__ */
|
|
619
|
+
const f = A(null), p = ue(f, { once: d, margin: m }), S = D(() => e.length * o, [e, o]), h = !s || p, k = g === "fromBottom" ? "100% center" : "-100% center", v = g === "fromBottom" ? "0% center" : "200% center";
|
|
620
|
+
return /* @__PURE__ */ i(
|
|
621
621
|
T.span,
|
|
622
622
|
{
|
|
623
623
|
ref: f,
|
|
624
|
-
className:
|
|
624
|
+
className: c,
|
|
625
625
|
style: {
|
|
626
626
|
position: "relative",
|
|
627
627
|
display: "inline-block",
|
|
@@ -631,9 +631,9 @@ function C({
|
|
|
631
631
|
color: "transparent",
|
|
632
632
|
WebkitTextFillColor: "transparent",
|
|
633
633
|
backgroundRepeat: "no-repeat, padding-box",
|
|
634
|
-
"--spread": `${
|
|
634
|
+
"--spread": `${S}px`,
|
|
635
635
|
"--base-color": a,
|
|
636
|
-
"--shimmer-color":
|
|
636
|
+
"--shimmer-color": u,
|
|
637
637
|
"--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
|
|
638
638
|
backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
|
|
639
639
|
},
|
|
@@ -641,8 +641,8 @@ function C({
|
|
|
641
641
|
backgroundPosition: k,
|
|
642
642
|
opacity: 0
|
|
643
643
|
},
|
|
644
|
-
animate:
|
|
645
|
-
backgroundPosition:
|
|
644
|
+
animate: h ? {
|
|
645
|
+
backgroundPosition: v,
|
|
646
646
|
opacity: 1
|
|
647
647
|
} : {},
|
|
648
648
|
transition: {
|
|
@@ -650,7 +650,7 @@ function C({
|
|
|
650
650
|
repeat: t ? 1 / 0 : 0,
|
|
651
651
|
duration: r,
|
|
652
652
|
delay: n,
|
|
653
|
-
repeatDelay:
|
|
653
|
+
repeatDelay: l,
|
|
654
654
|
ease: "linear"
|
|
655
655
|
},
|
|
656
656
|
opacity: {
|
|
@@ -710,21 +710,21 @@ const ze = ({ progressViewItems: e, t: r }) => {
|
|
|
710
710
|
const n = e[e.length - 1];
|
|
711
711
|
if (!n) return null;
|
|
712
712
|
const t = Le(n, r);
|
|
713
|
-
return /* @__PURE__ */
|
|
713
|
+
return /* @__PURE__ */ i("div", { className: "simple-mode-container", children: /* @__PURE__ */ i(X, { mode: "wait", children: /* @__PURE__ */ i(
|
|
714
714
|
T.div,
|
|
715
715
|
{
|
|
716
716
|
initial: { opacity: 0, y: 10 },
|
|
717
717
|
animate: { opacity: 1, y: 0 },
|
|
718
718
|
exit: { opacity: 0, y: -10 },
|
|
719
719
|
transition: { duration: 0.3 },
|
|
720
|
-
children: n.completed ? /* @__PURE__ */
|
|
720
|
+
children: n.completed ? /* @__PURE__ */ i(
|
|
721
721
|
"div",
|
|
722
722
|
{
|
|
723
723
|
className: "simple-mode-title",
|
|
724
724
|
style: { color: "#666" },
|
|
725
725
|
children: t
|
|
726
726
|
}
|
|
727
|
-
) : /* @__PURE__ */
|
|
727
|
+
) : /* @__PURE__ */ i(
|
|
728
728
|
C,
|
|
729
729
|
{
|
|
730
730
|
text: t,
|
|
@@ -889,35 +889,35 @@ const ze = ({ progressViewItems: e, t: r }) => {
|
|
|
889
889
|
italic: {
|
|
890
890
|
fontStyle: "italic"
|
|
891
891
|
}
|
|
892
|
-
},
|
|
892
|
+
}, K = ({
|
|
893
893
|
text: e
|
|
894
|
-
}) => /* @__PURE__ */
|
|
894
|
+
}) => /* @__PURE__ */ i("div", { style: { padding: "16px" }, children: /* @__PURE__ */ i(
|
|
895
895
|
T.div,
|
|
896
896
|
{
|
|
897
897
|
className: "fency-markdown-body-raw",
|
|
898
898
|
initial: { opacity: 0, y: -10 },
|
|
899
899
|
animate: { opacity: 1, y: 0 },
|
|
900
900
|
transition: { duration: 0.3, delay: 0 },
|
|
901
|
-
children: /* @__PURE__ */
|
|
901
|
+
children: /* @__PURE__ */ i(
|
|
902
902
|
pe,
|
|
903
903
|
{
|
|
904
|
-
remarkPlugins: [
|
|
904
|
+
remarkPlugins: [ye],
|
|
905
905
|
components: {
|
|
906
906
|
code(r) {
|
|
907
|
-
const { children: n, className: t, node:
|
|
907
|
+
const { children: n, className: t, node: l, ref: c, ...s } = r, d = /language-(\w+)/.exec(t || "");
|
|
908
908
|
return d ? (
|
|
909
909
|
// @ts-expect-error react-syntax-highlighter types incompatible with @types/react 18
|
|
910
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ i(
|
|
911
911
|
J,
|
|
912
912
|
{
|
|
913
|
-
...
|
|
913
|
+
...s,
|
|
914
914
|
PreTag: "div",
|
|
915
915
|
children: String(n).replace(/\n$/, ""),
|
|
916
916
|
language: d[1],
|
|
917
917
|
style: ee
|
|
918
918
|
}
|
|
919
919
|
)
|
|
920
|
-
) : /* @__PURE__ */
|
|
920
|
+
) : /* @__PURE__ */ i("code", { ...s, className: t, children: String(n) });
|
|
921
921
|
}
|
|
922
922
|
},
|
|
923
923
|
children: e
|
|
@@ -930,13 +930,13 @@ const ze = ({ progressViewItems: e, t: r }) => {
|
|
|
930
930
|
null,
|
|
931
931
|
2
|
|
932
932
|
);
|
|
933
|
-
return /* @__PURE__ */
|
|
933
|
+
return /* @__PURE__ */ i("div", { id: "structured-chat-completion-response", children: /* @__PURE__ */ i(
|
|
934
934
|
T.div,
|
|
935
935
|
{
|
|
936
936
|
initial: { opacity: 0, y: -10 },
|
|
937
937
|
animate: { opacity: 1, y: 0 },
|
|
938
938
|
transition: { duration: 0.3, delay: 0 },
|
|
939
|
-
children: /* @__PURE__ */
|
|
939
|
+
children: /* @__PURE__ */ i(J, { language: "json", style: ee, PreTag: "div", children: r })
|
|
940
940
|
}
|
|
941
941
|
) });
|
|
942
942
|
}, Be = {
|
|
@@ -1059,12 +1059,12 @@ const ze = ({ progressViewItems: e, t: r }) => {
|
|
|
1059
1059
|
memorySearchExploreNoResults: "Ingen resultater funnet"
|
|
1060
1060
|
}
|
|
1061
1061
|
};
|
|
1062
|
-
function
|
|
1062
|
+
function Ne(e) {
|
|
1063
1063
|
return Be[e];
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function x(e, r) {
|
|
1066
1066
|
return Object.entries(r).reduce(
|
|
1067
|
-
(n, [t,
|
|
1067
|
+
(n, [t, l]) => n.replace(`{${t}}`, String(l)),
|
|
1068
1068
|
e
|
|
1069
1069
|
);
|
|
1070
1070
|
}
|
|
@@ -1076,45 +1076,45 @@ function Q(e, r) {
|
|
|
1076
1076
|
}
|
|
1077
1077
|
return n.join(", ");
|
|
1078
1078
|
}
|
|
1079
|
-
const
|
|
1080
|
-
const [
|
|
1079
|
+
const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
1080
|
+
const [l, c] = b(!1), d = (e.memories ?? []).map((h) => h.memoryTitle), m = d.length > 0, o = m && d.length > W, a = o && !l ? d.slice(0, W) : d, u = d.length - W, g = !o || l, f = `${t.searchingFor}'${e.queryDescription}'`, p = m ? `${t.searchingIn}${Q(
|
|
1081
1081
|
a,
|
|
1082
|
-
|
|
1083
|
-
)}` : "",
|
|
1082
|
+
g ? t.and : void 0
|
|
1083
|
+
)}` : "", S = m ? `${f}${p}` : `${t.searchingPrefix}${e.queryDescription}`;
|
|
1084
1084
|
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1085
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ i(
|
|
1086
1086
|
T.div,
|
|
1087
1087
|
{
|
|
1088
1088
|
style: { color: "#666" },
|
|
1089
1089
|
initial: { opacity: 0, y: -10 },
|
|
1090
1090
|
animate: { opacity: 1, y: 0 },
|
|
1091
1091
|
transition: { duration: 0.3, delay: 0 },
|
|
1092
|
-
children: r && !n && !
|
|
1092
|
+
children: r && !n && !o ? /* @__PURE__ */ i(
|
|
1093
1093
|
C,
|
|
1094
1094
|
{
|
|
1095
|
-
text:
|
|
1095
|
+
text: S,
|
|
1096
1096
|
duration: 2.5,
|
|
1097
1097
|
repeat: !0,
|
|
1098
1098
|
color: "#999",
|
|
1099
1099
|
shimmerColor: "#000"
|
|
1100
1100
|
}
|
|
1101
1101
|
) : /* @__PURE__ */ y(E, { children: [
|
|
1102
|
-
/* @__PURE__ */
|
|
1102
|
+
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: m ? /* @__PURE__ */ y(E, { children: [
|
|
1103
1103
|
t.searchingFor,
|
|
1104
1104
|
/* @__PURE__ */ y("span", { style: { fontWeight: 600 }, children: [
|
|
1105
1105
|
"'",
|
|
1106
1106
|
e.queryDescription,
|
|
1107
1107
|
"'"
|
|
1108
1108
|
] }),
|
|
1109
|
-
|
|
1109
|
+
p
|
|
1110
1110
|
] }) : `${t.searchingPrefix}${e.queryDescription}` }),
|
|
1111
|
-
|
|
1111
|
+
o && !l && /* @__PURE__ */ y(E, { children: [
|
|
1112
1112
|
" ",
|
|
1113
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ i(
|
|
1114
1114
|
"button",
|
|
1115
1115
|
{
|
|
1116
1116
|
type: "button",
|
|
1117
|
-
onClick: () =>
|
|
1117
|
+
onClick: () => c(!0),
|
|
1118
1118
|
style: {
|
|
1119
1119
|
background: "none",
|
|
1120
1120
|
border: "none",
|
|
@@ -1126,19 +1126,19 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1126
1126
|
textDecoration: "underline",
|
|
1127
1127
|
fontFamily: "inherit"
|
|
1128
1128
|
},
|
|
1129
|
-
children:
|
|
1130
|
-
n:
|
|
1129
|
+
children: x(t.moreMemories, {
|
|
1130
|
+
n: u
|
|
1131
1131
|
})
|
|
1132
1132
|
}
|
|
1133
1133
|
)
|
|
1134
1134
|
] }),
|
|
1135
|
-
|
|
1135
|
+
o && l && /* @__PURE__ */ y(E, { children: [
|
|
1136
1136
|
" ",
|
|
1137
|
-
/* @__PURE__ */
|
|
1137
|
+
/* @__PURE__ */ i(
|
|
1138
1138
|
"button",
|
|
1139
1139
|
{
|
|
1140
1140
|
type: "button",
|
|
1141
|
-
onClick: () =>
|
|
1141
|
+
onClick: () => c(!1),
|
|
1142
1142
|
style: {
|
|
1143
1143
|
background: "none",
|
|
1144
1144
|
border: "none",
|
|
@@ -1157,7 +1157,7 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1157
1157
|
] })
|
|
1158
1158
|
}
|
|
1159
1159
|
),
|
|
1160
|
-
n !== void 0 && /* @__PURE__ */
|
|
1160
|
+
n !== void 0 && /* @__PURE__ */ i(
|
|
1161
1161
|
"div",
|
|
1162
1162
|
{
|
|
1163
1163
|
style: {
|
|
@@ -1166,17 +1166,17 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1166
1166
|
marginTop: "4px",
|
|
1167
1167
|
fontStyle: "italic"
|
|
1168
1168
|
},
|
|
1169
|
-
children:
|
|
1169
|
+
children: x(t.tookSeconds, { n })
|
|
1170
1170
|
}
|
|
1171
1171
|
)
|
|
1172
1172
|
] });
|
|
1173
|
-
},
|
|
1174
|
-
const [
|
|
1175
|
-
|
|
1176
|
-
|
|
1173
|
+
}, $ = 5, $e = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
1174
|
+
const [l, c] = b(!1), s = e.titles, d = s.length > 0, m = d && s.length > $, o = m && !l ? s.slice(0, $) : s, a = s.length - $, u = !m || l, g = d ? `${t.findingMemoriesIn}${Q(
|
|
1175
|
+
o,
|
|
1176
|
+
u ? t.and : void 0
|
|
1177
1177
|
)}` : t.findingMemories;
|
|
1178
1178
|
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1179
|
-
/* @__PURE__ */
|
|
1179
|
+
/* @__PURE__ */ i(
|
|
1180
1180
|
T.div,
|
|
1181
1181
|
{
|
|
1182
1182
|
style: {
|
|
@@ -1185,24 +1185,24 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1185
1185
|
initial: { opacity: 0, y: -10 },
|
|
1186
1186
|
animate: { opacity: 1, y: 0 },
|
|
1187
1187
|
transition: { duration: 0.3, delay: 0 },
|
|
1188
|
-
children: r && !n && !
|
|
1188
|
+
children: r && !n && !m ? /* @__PURE__ */ i(
|
|
1189
1189
|
C,
|
|
1190
1190
|
{
|
|
1191
|
-
text:
|
|
1191
|
+
text: g,
|
|
1192
1192
|
duration: 2.5,
|
|
1193
1193
|
repeat: !0,
|
|
1194
1194
|
color: "#999",
|
|
1195
1195
|
shimmerColor: "#000"
|
|
1196
1196
|
}
|
|
1197
1197
|
) : /* @__PURE__ */ y(E, { children: [
|
|
1198
|
-
/* @__PURE__ */
|
|
1199
|
-
|
|
1198
|
+
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: g }),
|
|
1199
|
+
m && !l && /* @__PURE__ */ y(E, { children: [
|
|
1200
1200
|
" ",
|
|
1201
|
-
/* @__PURE__ */
|
|
1201
|
+
/* @__PURE__ */ i(
|
|
1202
1202
|
"button",
|
|
1203
1203
|
{
|
|
1204
1204
|
type: "button",
|
|
1205
|
-
onClick: () =>
|
|
1205
|
+
onClick: () => c(!0),
|
|
1206
1206
|
style: {
|
|
1207
1207
|
background: "none",
|
|
1208
1208
|
border: "none",
|
|
@@ -1214,19 +1214,19 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1214
1214
|
textDecoration: "underline",
|
|
1215
1215
|
fontFamily: "inherit"
|
|
1216
1216
|
},
|
|
1217
|
-
children:
|
|
1217
|
+
children: x(t.moreMemories, {
|
|
1218
1218
|
n: a
|
|
1219
1219
|
})
|
|
1220
1220
|
}
|
|
1221
1221
|
)
|
|
1222
1222
|
] }),
|
|
1223
|
-
|
|
1223
|
+
m && l && /* @__PURE__ */ y(E, { children: [
|
|
1224
1224
|
" ",
|
|
1225
|
-
/* @__PURE__ */
|
|
1225
|
+
/* @__PURE__ */ i(
|
|
1226
1226
|
"button",
|
|
1227
1227
|
{
|
|
1228
1228
|
type: "button",
|
|
1229
|
-
onClick: () =>
|
|
1229
|
+
onClick: () => c(!1),
|
|
1230
1230
|
style: {
|
|
1231
1231
|
background: "none",
|
|
1232
1232
|
border: "none",
|
|
@@ -1245,7 +1245,7 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1245
1245
|
] })
|
|
1246
1246
|
}
|
|
1247
1247
|
),
|
|
1248
|
-
n !== void 0 && /* @__PURE__ */
|
|
1248
|
+
n !== void 0 && /* @__PURE__ */ i(
|
|
1249
1249
|
"div",
|
|
1250
1250
|
{
|
|
1251
1251
|
style: {
|
|
@@ -1254,16 +1254,16 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1254
1254
|
marginTop: "4px",
|
|
1255
1255
|
fontStyle: "italic"
|
|
1256
1256
|
},
|
|
1257
|
-
children:
|
|
1257
|
+
children: x(t.tookSeconds, { n })
|
|
1258
1258
|
}
|
|
1259
1259
|
)
|
|
1260
1260
|
] });
|
|
1261
|
-
},
|
|
1262
|
-
const [n, t] =
|
|
1263
|
-
|
|
1261
|
+
}, H = 5, He = ({ data: e, t: r }) => {
|
|
1262
|
+
const [n, t] = b(!1), c = e.memories.map((f) => f.memoryTitle), s = c.length > 0, d = s && c.length > H, m = d && !n ? c.slice(0, H) : c, o = c.length - H, a = !d || n, u = c.length === 1 ? r.memoryFound : r.memoriesFoundPrefix, g = s ? `${u}${Q(
|
|
1263
|
+
m,
|
|
1264
1264
|
a ? r.and : void 0
|
|
1265
1265
|
)}` : r.memoriesFound;
|
|
1266
|
-
return /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ i("div", { style: { padding: "16px" }, children: /* @__PURE__ */ i(
|
|
1267
1267
|
T.div,
|
|
1268
1268
|
{
|
|
1269
1269
|
style: { color: "#666" },
|
|
@@ -1271,10 +1271,10 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1271
1271
|
animate: { opacity: 1, y: 0 },
|
|
1272
1272
|
transition: { duration: 0.3, delay: 0 },
|
|
1273
1273
|
children: /* @__PURE__ */ y(E, { children: [
|
|
1274
|
-
/* @__PURE__ */
|
|
1274
|
+
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: g }),
|
|
1275
1275
|
d && !n && /* @__PURE__ */ y(E, { children: [
|
|
1276
1276
|
" ",
|
|
1277
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ i(
|
|
1278
1278
|
"button",
|
|
1279
1279
|
{
|
|
1280
1280
|
type: "button",
|
|
@@ -1290,15 +1290,15 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1290
1290
|
textDecoration: "underline",
|
|
1291
1291
|
fontFamily: "inherit"
|
|
1292
1292
|
},
|
|
1293
|
-
children:
|
|
1294
|
-
n:
|
|
1293
|
+
children: x(r.moreMemories, {
|
|
1294
|
+
n: o
|
|
1295
1295
|
})
|
|
1296
1296
|
}
|
|
1297
1297
|
)
|
|
1298
1298
|
] }),
|
|
1299
1299
|
d && n && /* @__PURE__ */ y(E, { children: [
|
|
1300
1300
|
" ",
|
|
1301
|
-
/* @__PURE__ */
|
|
1301
|
+
/* @__PURE__ */ i(
|
|
1302
1302
|
"button",
|
|
1303
1303
|
{
|
|
1304
1304
|
type: "button",
|
|
@@ -1324,7 +1324,7 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1324
1324
|
}, _e = ({ isLatest: e = !1, durationSeconds: r, t: n }) => {
|
|
1325
1325
|
const t = n.addingSources;
|
|
1326
1326
|
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1327
|
-
/* @__PURE__ */
|
|
1327
|
+
/* @__PURE__ */ i(
|
|
1328
1328
|
T.div,
|
|
1329
1329
|
{
|
|
1330
1330
|
style: {
|
|
@@ -1336,7 +1336,7 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1336
1336
|
initial: { opacity: 0, y: -10 },
|
|
1337
1337
|
animate: { opacity: 1, y: 0 },
|
|
1338
1338
|
transition: { duration: 0.3, delay: 0 },
|
|
1339
|
-
children: e && !r ? /* @__PURE__ */
|
|
1339
|
+
children: e && !r ? /* @__PURE__ */ i(
|
|
1340
1340
|
C,
|
|
1341
1341
|
{
|
|
1342
1342
|
text: t,
|
|
@@ -1345,10 +1345,10 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1345
1345
|
color: "#999",
|
|
1346
1346
|
shimmerColor: "#000"
|
|
1347
1347
|
}
|
|
1348
|
-
) : /* @__PURE__ */
|
|
1348
|
+
) : /* @__PURE__ */ i("span", { style: { color: "#666" }, children: t })
|
|
1349
1349
|
}
|
|
1350
1350
|
),
|
|
1351
|
-
r !== void 0 && /* @__PURE__ */
|
|
1351
|
+
r !== void 0 && /* @__PURE__ */ i(
|
|
1352
1352
|
"div",
|
|
1353
1353
|
{
|
|
1354
1354
|
style: {
|
|
@@ -1357,7 +1357,7 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1357
1357
|
marginTop: "4px",
|
|
1358
1358
|
fontStyle: "italic"
|
|
1359
1359
|
},
|
|
1360
|
-
children:
|
|
1360
|
+
children: x(n.tookSeconds, { n: r })
|
|
1361
1361
|
}
|
|
1362
1362
|
)
|
|
1363
1363
|
] });
|
|
@@ -1365,62 +1365,77 @@ const N = 5, Ne = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1365
1365
|
function Ge(e, r) {
|
|
1366
1366
|
if (e.length === 0) return "";
|
|
1367
1367
|
if (e.length === 1)
|
|
1368
|
-
return
|
|
1368
|
+
return x(r.pageSingle, { n: e[0] });
|
|
1369
1369
|
if (e.length === 2)
|
|
1370
|
-
return
|
|
1370
|
+
return x(r.pageTwo, {
|
|
1371
1371
|
a: e[0],
|
|
1372
1372
|
b: e[1]
|
|
1373
1373
|
});
|
|
1374
1374
|
const n = e[e.length - 1], t = e.slice(0, -1).join(", ");
|
|
1375
|
-
return
|
|
1375
|
+
return x(r.pageMultiple, { list: t, n });
|
|
1376
1376
|
}
|
|
1377
|
-
const Qe = ({ data: e, onSourceClick: r, t: n }) =>
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1377
|
+
const Qe = ({ data: e, onSourceClick: r, t: n }) => {
|
|
1378
|
+
const [t, l] = b(null);
|
|
1379
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1380
|
+
/* @__PURE__ */ i(
|
|
1381
|
+
T.div,
|
|
1382
|
+
{
|
|
1383
|
+
style: {
|
|
1384
|
+
marginBottom: "10px",
|
|
1385
|
+
fontSize: "11px",
|
|
1386
|
+
fontWeight: 500,
|
|
1387
|
+
letterSpacing: "0.05em",
|
|
1388
|
+
textTransform: "uppercase",
|
|
1389
|
+
color: "#999"
|
|
1390
|
+
},
|
|
1391
|
+
initial: { opacity: 0, y: -10 },
|
|
1392
|
+
animate: { opacity: 1, y: 0 },
|
|
1393
|
+
transition: { duration: 0.3, delay: 0 },
|
|
1394
|
+
children: n.sources
|
|
1395
|
+
}
|
|
1396
|
+
),
|
|
1397
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ i("span", { style: { fontSize: "13px", color: "#888" }, children: n.noSources }) : e.sources.map((c, s) => /* @__PURE__ */ i(
|
|
1398
|
+
je,
|
|
1399
|
+
{
|
|
1400
|
+
source: c,
|
|
1401
|
+
index: s,
|
|
1402
|
+
loadingMemoryId: t,
|
|
1403
|
+
setLoadingMemoryId: l,
|
|
1404
|
+
onSourceClick: r,
|
|
1405
|
+
t: n
|
|
1388
1406
|
},
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
}
|
|
1394
|
-
),
|
|
1395
|
-
/* @__PURE__ */ o("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ o("span", { style: { fontSize: "13px", color: "#888" }, children: n.noSources }) : e.sources.map((t, c) => /* @__PURE__ */ o(
|
|
1396
|
-
je,
|
|
1397
|
-
{
|
|
1398
|
-
source: t,
|
|
1399
|
-
index: c,
|
|
1400
|
-
onSourceClick: r,
|
|
1401
|
-
t: n
|
|
1402
|
-
},
|
|
1403
|
-
t.memoryId
|
|
1404
|
-
)) })
|
|
1405
|
-
] }), je = ({
|
|
1407
|
+
c.memoryId
|
|
1408
|
+
)) })
|
|
1409
|
+
] });
|
|
1410
|
+
}, je = ({
|
|
1406
1411
|
source: e,
|
|
1407
1412
|
index: r,
|
|
1408
|
-
|
|
1409
|
-
t
|
|
1413
|
+
loadingMemoryId: n,
|
|
1414
|
+
setLoadingMemoryId: t,
|
|
1415
|
+
onSourceClick: l,
|
|
1416
|
+
t: c
|
|
1410
1417
|
}) => {
|
|
1411
|
-
const [
|
|
1418
|
+
const [s, d] = b(!1), m = !!l, o = n === e.memoryId, a = e.pageNumbers ?? [], u = Ge(a, c);
|
|
1412
1419
|
return /* @__PURE__ */ y(
|
|
1413
1420
|
T.div,
|
|
1414
1421
|
{
|
|
1422
|
+
"aria-busy": o,
|
|
1415
1423
|
initial: { opacity: 0, scale: 0.9 },
|
|
1416
1424
|
animate: { opacity: 1, scale: 1 },
|
|
1417
1425
|
transition: { duration: 0.25, delay: r * 0.05 },
|
|
1418
|
-
onClick:
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1426
|
+
onClick: m && !o ? async () => {
|
|
1427
|
+
t(e.memoryId);
|
|
1428
|
+
try {
|
|
1429
|
+
await l({
|
|
1430
|
+
memoryId: e.memoryId,
|
|
1431
|
+
pageNumbers: [...a]
|
|
1432
|
+
});
|
|
1433
|
+
} finally {
|
|
1434
|
+
t(null);
|
|
1435
|
+
}
|
|
1436
|
+
} : void 0,
|
|
1437
|
+
onMouseEnter: m && !o ? () => d(!0) : void 0,
|
|
1438
|
+
onMouseLeave: m && !o ? () => d(!1) : void 0,
|
|
1424
1439
|
style: {
|
|
1425
1440
|
display: "inline-flex",
|
|
1426
1441
|
flexDirection: "column",
|
|
@@ -1428,14 +1443,31 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => /* @__PURE__ */ y("div", { s
|
|
|
1428
1443
|
padding: "8px 12px",
|
|
1429
1444
|
borderRadius: "6px",
|
|
1430
1445
|
border: "1px solid #e0e0e0",
|
|
1431
|
-
backgroundColor:
|
|
1432
|
-
cursor:
|
|
1446
|
+
backgroundColor: s ? "#f5f5f5" : "transparent",
|
|
1447
|
+
cursor: m && !o ? "pointer" : o ? "wait" : "default",
|
|
1433
1448
|
transition: "background-color 0.15s ease",
|
|
1434
|
-
userSelect: "none"
|
|
1449
|
+
userSelect: "none",
|
|
1450
|
+
pointerEvents: o ? "none" : void 0
|
|
1435
1451
|
},
|
|
1436
1452
|
children: [
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
|
|
1453
|
+
/* @__PURE__ */ y(
|
|
1454
|
+
"span",
|
|
1455
|
+
{
|
|
1456
|
+
style: {
|
|
1457
|
+
fontSize: "13px",
|
|
1458
|
+
fontWeight: 500,
|
|
1459
|
+
color: "#333",
|
|
1460
|
+
display: "inline-flex",
|
|
1461
|
+
alignItems: "center",
|
|
1462
|
+
gap: 8
|
|
1463
|
+
},
|
|
1464
|
+
children: [
|
|
1465
|
+
o && /* @__PURE__ */ i("span", { className: "explore-memory-loader", "aria-hidden": !0 }),
|
|
1466
|
+
e.memoryTitle
|
|
1467
|
+
]
|
|
1468
|
+
}
|
|
1469
|
+
),
|
|
1470
|
+
u && /* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "#666" }, children: u })
|
|
1439
1471
|
]
|
|
1440
1472
|
}
|
|
1441
1473
|
);
|
|
@@ -1445,7 +1477,7 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => /* @__PURE__ */ y("div", { s
|
|
|
1445
1477
|
borderWidth: n = 7
|
|
1446
1478
|
}) => {
|
|
1447
1479
|
const t = r * 0.5;
|
|
1448
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ i(
|
|
1449
1481
|
"span",
|
|
1450
1482
|
{
|
|
1451
1483
|
style: {
|
|
@@ -1463,10 +1495,10 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => /* @__PURE__ */ y("div", { s
|
|
|
1463
1495
|
size: r = 32,
|
|
1464
1496
|
lineWidth: n = 2
|
|
1465
1497
|
}) => {
|
|
1466
|
-
const t = r + 1,
|
|
1498
|
+
const t = r + 1, l = (r - n) / 2, c = (r - t) / 2, s = {
|
|
1467
1499
|
position: "absolute",
|
|
1468
|
-
left:
|
|
1469
|
-
top:
|
|
1500
|
+
left: l,
|
|
1501
|
+
top: c,
|
|
1470
1502
|
width: n,
|
|
1471
1503
|
height: t,
|
|
1472
1504
|
backgroundColor: e
|
|
@@ -1481,20 +1513,20 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => /* @__PURE__ */ y("div", { s
|
|
|
1481
1513
|
height: r
|
|
1482
1514
|
},
|
|
1483
1515
|
children: [
|
|
1484
|
-
/* @__PURE__ */
|
|
1516
|
+
/* @__PURE__ */ i(
|
|
1485
1517
|
"span",
|
|
1486
1518
|
{
|
|
1487
1519
|
style: {
|
|
1488
|
-
...
|
|
1520
|
+
...s,
|
|
1489
1521
|
transform: "rotate(45deg)"
|
|
1490
1522
|
}
|
|
1491
1523
|
}
|
|
1492
1524
|
),
|
|
1493
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ i(
|
|
1494
1526
|
"span",
|
|
1495
1527
|
{
|
|
1496
1528
|
style: {
|
|
1497
|
-
...
|
|
1529
|
+
...s,
|
|
1498
1530
|
transform: "rotate(-45deg)"
|
|
1499
1531
|
}
|
|
1500
1532
|
}
|
|
@@ -1507,22 +1539,22 @@ function qe({
|
|
|
1507
1539
|
memory: e,
|
|
1508
1540
|
completed: r
|
|
1509
1541
|
}) {
|
|
1510
|
-
return e.error != null ? /* @__PURE__ */
|
|
1542
|
+
return e.error != null ? /* @__PURE__ */ i(j, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ i(z, { color: "#999", size: 15, borderWidth: 2 }) : r ? /* @__PURE__ */ i(z, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ i("span", { className: "explore-memory-loader" });
|
|
1511
1543
|
}
|
|
1512
|
-
const
|
|
1544
|
+
const V = 80;
|
|
1513
1545
|
function Ue({
|
|
1514
1546
|
memory: e,
|
|
1515
1547
|
completed: r,
|
|
1516
1548
|
t: n
|
|
1517
1549
|
}) {
|
|
1518
|
-
const [t,
|
|
1550
|
+
const [t, l] = b(!1), c = e.result ?? e.error, s = c != null && c.length > V, d = c != null ? t || !s ? c : `${c.slice(0, V)}...` : void 0, m = s, o = e.error != null;
|
|
1519
1551
|
return /* @__PURE__ */ y(
|
|
1520
1552
|
T.div,
|
|
1521
1553
|
{
|
|
1522
1554
|
initial: { opacity: 0 },
|
|
1523
1555
|
animate: { opacity: 1 },
|
|
1524
1556
|
transition: { duration: 0.25 },
|
|
1525
|
-
onClick:
|
|
1557
|
+
onClick: m ? () => l((a) => !a) : void 0,
|
|
1526
1558
|
style: {
|
|
1527
1559
|
paddingTop: "12px",
|
|
1528
1560
|
paddingBottom: "12px",
|
|
@@ -1532,10 +1564,10 @@ function Ue({
|
|
|
1532
1564
|
alignItems: "center",
|
|
1533
1565
|
gap: "10px",
|
|
1534
1566
|
minWidth: 0,
|
|
1535
|
-
cursor:
|
|
1567
|
+
cursor: m ? "pointer" : "default"
|
|
1536
1568
|
},
|
|
1537
1569
|
children: [
|
|
1538
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ i(
|
|
1539
1571
|
"div",
|
|
1540
1572
|
{
|
|
1541
1573
|
style: {
|
|
@@ -1545,7 +1577,7 @@ function Ue({
|
|
|
1545
1577
|
flexShrink: 0,
|
|
1546
1578
|
width: 32
|
|
1547
1579
|
},
|
|
1548
|
-
children: /* @__PURE__ */
|
|
1580
|
+
children: /* @__PURE__ */ i(qe, { memory: e, completed: r })
|
|
1549
1581
|
}
|
|
1550
1582
|
),
|
|
1551
1583
|
/* @__PURE__ */ y(
|
|
@@ -1558,26 +1590,26 @@ function Ue({
|
|
|
1558
1590
|
minWidth: 0
|
|
1559
1591
|
},
|
|
1560
1592
|
children: [
|
|
1561
|
-
/* @__PURE__ */
|
|
1593
|
+
/* @__PURE__ */ i(
|
|
1562
1594
|
"span",
|
|
1563
1595
|
{
|
|
1564
1596
|
style: { fontSize: 13, fontWeight: 500, color: "#333" },
|
|
1565
1597
|
children: e.memoryTitle
|
|
1566
1598
|
}
|
|
1567
1599
|
),
|
|
1568
|
-
d != null && /* @__PURE__ */
|
|
1600
|
+
d != null && /* @__PURE__ */ i(
|
|
1569
1601
|
"span",
|
|
1570
1602
|
{
|
|
1571
1603
|
style: {
|
|
1572
1604
|
fontSize: 12,
|
|
1573
|
-
color:
|
|
1605
|
+
color: o ? "#c62828" : "#666",
|
|
1574
1606
|
lineHeight: 1.4,
|
|
1575
1607
|
whiteSpace: t ? "pre-wrap" : void 0
|
|
1576
1608
|
},
|
|
1577
1609
|
children: d
|
|
1578
1610
|
}
|
|
1579
1611
|
),
|
|
1580
|
-
|
|
1612
|
+
m && /* @__PURE__ */ i(
|
|
1581
1613
|
"span",
|
|
1582
1614
|
{
|
|
1583
1615
|
style: {
|
|
@@ -1595,7 +1627,7 @@ function Ue({
|
|
|
1595
1627
|
}
|
|
1596
1628
|
);
|
|
1597
1629
|
}
|
|
1598
|
-
const
|
|
1630
|
+
const Ke = ({ data: e, completed: r, t: n }) => /* @__PURE__ */ i("div", { style: { padding: "10px" }, children: e.memories.map((t) => /* @__PURE__ */ i(
|
|
1599
1631
|
Ue,
|
|
1600
1632
|
{
|
|
1601
1633
|
memory: t,
|
|
@@ -1604,23 +1636,23 @@ const Ve = ({ data: e, completed: r, t: n }) => /* @__PURE__ */ o("div", { style
|
|
|
1604
1636
|
},
|
|
1605
1637
|
t.memoryId
|
|
1606
1638
|
)) });
|
|
1607
|
-
function
|
|
1639
|
+
function Ve(e, r) {
|
|
1608
1640
|
if (e.length === 0) return "";
|
|
1609
1641
|
if (e.length === 1)
|
|
1610
|
-
return
|
|
1642
|
+
return x(r.pageSingle, { n: e[0] });
|
|
1611
1643
|
if (e.length === 2)
|
|
1612
|
-
return
|
|
1644
|
+
return x(r.pageTwo, {
|
|
1613
1645
|
a: e[0],
|
|
1614
1646
|
b: e[1]
|
|
1615
1647
|
});
|
|
1616
1648
|
const n = e[e.length - 1], t = e.slice(0, -1).join(", ");
|
|
1617
|
-
return
|
|
1649
|
+
return x(r.pageMultiple, { list: t, n });
|
|
1618
1650
|
}
|
|
1619
1651
|
function Xe(e, r) {
|
|
1620
|
-
return e === 1 ? r.chunkFound :
|
|
1652
|
+
return e === 1 ? r.chunkFound : x(r.chunksFound, { n: e });
|
|
1621
1653
|
}
|
|
1622
1654
|
const Je = ({ data: e, t: r }) => {
|
|
1623
|
-
const [n, t] =
|
|
1655
|
+
const [n, t] = b(!1), l = e.chunks.length, c = l > 0;
|
|
1624
1656
|
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
1625
1657
|
/* @__PURE__ */ y(
|
|
1626
1658
|
T.div,
|
|
@@ -1628,7 +1660,7 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1628
1660
|
initial: { opacity: 0 },
|
|
1629
1661
|
animate: { opacity: 1 },
|
|
1630
1662
|
transition: { duration: 0.25 },
|
|
1631
|
-
onClick:
|
|
1663
|
+
onClick: c ? () => t((s) => !s) : void 0,
|
|
1632
1664
|
style: {
|
|
1633
1665
|
paddingBottom: n ? "12px" : 0,
|
|
1634
1666
|
borderBottom: n ? "1px solid #eee" : void 0,
|
|
@@ -1636,12 +1668,12 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1636
1668
|
flexDirection: "column",
|
|
1637
1669
|
gap: "4px",
|
|
1638
1670
|
minWidth: 0,
|
|
1639
|
-
cursor:
|
|
1671
|
+
cursor: c ? "pointer" : "default"
|
|
1640
1672
|
},
|
|
1641
1673
|
children: [
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1644
|
-
|
|
1674
|
+
/* @__PURE__ */ i("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: e.memoryTitle }),
|
|
1675
|
+
/* @__PURE__ */ i("span", { style: { fontSize: 12, color: "#666" }, children: Xe(l, r) }),
|
|
1676
|
+
c && /* @__PURE__ */ i(
|
|
1645
1677
|
"span",
|
|
1646
1678
|
{
|
|
1647
1679
|
style: {
|
|
@@ -1655,7 +1687,7 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1655
1687
|
]
|
|
1656
1688
|
}
|
|
1657
1689
|
),
|
|
1658
|
-
n &&
|
|
1690
|
+
n && c && /* @__PURE__ */ i(
|
|
1659
1691
|
T.div,
|
|
1660
1692
|
{
|
|
1661
1693
|
initial: { opacity: 0, height: 0 },
|
|
@@ -1669,8 +1701,8 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1669
1701
|
flexDirection: "column",
|
|
1670
1702
|
gap: 8
|
|
1671
1703
|
},
|
|
1672
|
-
children: e.chunks.map((
|
|
1673
|
-
const
|
|
1704
|
+
children: e.chunks.map((s, d) => {
|
|
1705
|
+
const m = s.pageNumbers ?? [], o = Ve(m, r);
|
|
1674
1706
|
return /* @__PURE__ */ y(
|
|
1675
1707
|
"div",
|
|
1676
1708
|
{
|
|
@@ -1681,7 +1713,7 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1681
1713
|
backgroundColor: "#fafafa"
|
|
1682
1714
|
},
|
|
1683
1715
|
children: [
|
|
1684
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ i(
|
|
1685
1717
|
"span",
|
|
1686
1718
|
{
|
|
1687
1719
|
style: {
|
|
@@ -1691,7 +1723,7 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1691
1723
|
display: "block",
|
|
1692
1724
|
marginBottom: 4
|
|
1693
1725
|
},
|
|
1694
|
-
children:
|
|
1726
|
+
children: s.content
|
|
1695
1727
|
}
|
|
1696
1728
|
),
|
|
1697
1729
|
/* @__PURE__ */ y(
|
|
@@ -1704,9 +1736,9 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1704
1736
|
color: "#666"
|
|
1705
1737
|
},
|
|
1706
1738
|
children: [
|
|
1707
|
-
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
n:
|
|
1739
|
+
o && /* @__PURE__ */ i("span", { children: o }),
|
|
1740
|
+
/* @__PURE__ */ i("span", { children: x(r.scoreLabel, {
|
|
1741
|
+
n: s.score
|
|
1710
1742
|
}) })
|
|
1711
1743
|
]
|
|
1712
1744
|
}
|
|
@@ -1721,10 +1753,10 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1721
1753
|
] });
|
|
1722
1754
|
};
|
|
1723
1755
|
function Ye({ item: e }) {
|
|
1724
|
-
return e.error != null ? /* @__PURE__ */
|
|
1756
|
+
return e.error != null ? /* @__PURE__ */ i(j, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ i(z, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ i("span", { className: "explore-memory-loader" });
|
|
1725
1757
|
}
|
|
1726
1758
|
function Ze(e, r) {
|
|
1727
|
-
return
|
|
1759
|
+
return x(r.searchingInMemoriesOfType, {
|
|
1728
1760
|
name: e.memoryTypeName
|
|
1729
1761
|
});
|
|
1730
1762
|
}
|
|
@@ -1733,7 +1765,7 @@ function er({
|
|
|
1733
1765
|
t: r,
|
|
1734
1766
|
showShimmerForPrimary: n
|
|
1735
1767
|
}) {
|
|
1736
|
-
const t = e.result != null,
|
|
1768
|
+
const t = e.result != null, l = e.error != null, c = Ze(e, r);
|
|
1737
1769
|
return /* @__PURE__ */ y(
|
|
1738
1770
|
T.div,
|
|
1739
1771
|
{
|
|
@@ -1751,7 +1783,7 @@ function er({
|
|
|
1751
1783
|
minWidth: 0
|
|
1752
1784
|
},
|
|
1753
1785
|
children: [
|
|
1754
|
-
/* @__PURE__ */
|
|
1786
|
+
/* @__PURE__ */ i(
|
|
1755
1787
|
"div",
|
|
1756
1788
|
{
|
|
1757
1789
|
style: {
|
|
@@ -1761,7 +1793,7 @@ function er({
|
|
|
1761
1793
|
flexShrink: 0,
|
|
1762
1794
|
width: 32
|
|
1763
1795
|
},
|
|
1764
|
-
children: /* @__PURE__ */
|
|
1796
|
+
children: /* @__PURE__ */ i(Ye, { item: e })
|
|
1765
1797
|
}
|
|
1766
1798
|
),
|
|
1767
1799
|
/* @__PURE__ */ y(
|
|
@@ -1775,24 +1807,24 @@ function er({
|
|
|
1775
1807
|
flex: 1
|
|
1776
1808
|
},
|
|
1777
1809
|
children: [
|
|
1778
|
-
/* @__PURE__ */
|
|
1810
|
+
/* @__PURE__ */ i("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: !t && !l && n ? /* @__PURE__ */ i(
|
|
1779
1811
|
C,
|
|
1780
1812
|
{
|
|
1781
|
-
text:
|
|
1813
|
+
text: c,
|
|
1782
1814
|
duration: 2.5,
|
|
1783
1815
|
repeat: !0,
|
|
1784
1816
|
color: "#999",
|
|
1785
1817
|
shimmerColor: "#000"
|
|
1786
1818
|
}
|
|
1787
|
-
) :
|
|
1788
|
-
t && /* @__PURE__ */
|
|
1819
|
+
) : c }),
|
|
1820
|
+
t && /* @__PURE__ */ i("span", { style: { fontSize: 12, color: "#666" }, children: e.result.numberOfChunks === 1 ? x(
|
|
1789
1821
|
r.memorySearchTypeResultSummaryOne,
|
|
1790
1822
|
{
|
|
1791
1823
|
score: e.result.highestChunkScore.toFixed(
|
|
1792
1824
|
2
|
|
1793
1825
|
)
|
|
1794
1826
|
}
|
|
1795
|
-
) :
|
|
1827
|
+
) : x(
|
|
1796
1828
|
r.memorySearchTypeResultSummary,
|
|
1797
1829
|
{
|
|
1798
1830
|
count: e.result.numberOfChunks,
|
|
@@ -1801,7 +1833,7 @@ function er({
|
|
|
1801
1833
|
)
|
|
1802
1834
|
}
|
|
1803
1835
|
) }),
|
|
1804
|
-
|
|
1836
|
+
l && /* @__PURE__ */ i("span", { style: { fontSize: 12, color: "#c62828" }, children: e.error })
|
|
1805
1837
|
]
|
|
1806
1838
|
}
|
|
1807
1839
|
)
|
|
@@ -1810,14 +1842,14 @@ function er({
|
|
|
1810
1842
|
);
|
|
1811
1843
|
}
|
|
1812
1844
|
const rr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
1813
|
-
const
|
|
1814
|
-
let
|
|
1815
|
-
return e.memoryTypes.forEach((
|
|
1816
|
-
|
|
1817
|
-
}),
|
|
1845
|
+
const l = D(() => {
|
|
1846
|
+
let c = -1;
|
|
1847
|
+
return e.memoryTypes.forEach((s, d) => {
|
|
1848
|
+
s.result == null && s.error == null && (c = d);
|
|
1849
|
+
}), c;
|
|
1818
1850
|
}, [e.memoryTypes]);
|
|
1819
1851
|
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
1820
|
-
r && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */
|
|
1852
|
+
r && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ i(
|
|
1821
1853
|
C,
|
|
1822
1854
|
{
|
|
1823
1855
|
text: t.searchingMemoryTypes,
|
|
@@ -1826,16 +1858,16 @@ const rr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1826
1858
|
color: "#999",
|
|
1827
1859
|
shimmerColor: "#000"
|
|
1828
1860
|
}
|
|
1829
|
-
) : e.memoryTypes.map((
|
|
1861
|
+
) : e.memoryTypes.map((c, s) => /* @__PURE__ */ i(
|
|
1830
1862
|
er,
|
|
1831
1863
|
{
|
|
1832
|
-
item:
|
|
1864
|
+
item: c,
|
|
1833
1865
|
t,
|
|
1834
|
-
showShimmerForPrimary:
|
|
1866
|
+
showShimmerForPrimary: s === l && r
|
|
1835
1867
|
},
|
|
1836
|
-
|
|
1868
|
+
c.memoryTypeId
|
|
1837
1869
|
)),
|
|
1838
|
-
n !== void 0 && /* @__PURE__ */
|
|
1870
|
+
n !== void 0 && /* @__PURE__ */ i(
|
|
1839
1871
|
"div",
|
|
1840
1872
|
{
|
|
1841
1873
|
style: {
|
|
@@ -1844,14 +1876,14 @@ const rr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1844
1876
|
marginTop: "4px",
|
|
1845
1877
|
fontStyle: "italic"
|
|
1846
1878
|
},
|
|
1847
|
-
children:
|
|
1879
|
+
children: x(t.tookSeconds, { n })
|
|
1848
1880
|
}
|
|
1849
1881
|
)
|
|
1850
1882
|
] });
|
|
1851
|
-
}, B = 12,
|
|
1852
|
-
B *
|
|
1883
|
+
}, B = 12, N = 1.45, nr = Math.ceil(
|
|
1884
|
+
B * N
|
|
1853
1885
|
), tr = Math.ceil(
|
|
1854
|
-
5 * B *
|
|
1886
|
+
5 * B * N
|
|
1855
1887
|
);
|
|
1856
1888
|
function O(e) {
|
|
1857
1889
|
return e.queries != null && e.queries.length > 0;
|
|
@@ -1866,21 +1898,21 @@ function ir(e) {
|
|
|
1866
1898
|
return r == null || r === "" ? 1 : e.reasoningCompleted === !0 ? 2 : 1;
|
|
1867
1899
|
}
|
|
1868
1900
|
function ar({ phase: e }) {
|
|
1869
|
-
return e === 3 ? /* @__PURE__ */
|
|
1901
|
+
return e === 3 ? /* @__PURE__ */ i(z, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ i("span", { className: "explore-memory-loader" });
|
|
1870
1902
|
}
|
|
1871
1903
|
function sr({
|
|
1872
1904
|
item: e,
|
|
1873
1905
|
t: r,
|
|
1874
1906
|
isActiveRow: n
|
|
1875
1907
|
}) {
|
|
1876
|
-
const t = or(e),
|
|
1877
|
-
|
|
1878
|
-
const
|
|
1879
|
-
|
|
1880
|
-
}, [
|
|
1881
|
-
const
|
|
1908
|
+
const t = or(e), l = ir(e), c = e.reasoning, s = c != null && c.length > 0, d = A(null), [m, o] = b(!1), a = t && n, u = l === 2 && n && !O(e);
|
|
1909
|
+
M(() => {
|
|
1910
|
+
const p = d.current;
|
|
1911
|
+
p != null && l === 1 && s && (p.scrollTop = p.scrollHeight);
|
|
1912
|
+
}, [c, l, s]);
|
|
1913
|
+
const g = x(r.searchingInMemoriesOfType, {
|
|
1882
1914
|
name: e.memoryTypeName
|
|
1883
|
-
}), f = !t &&
|
|
1915
|
+
}), f = !t && l === 3;
|
|
1884
1916
|
return /* @__PURE__ */ y(
|
|
1885
1917
|
T.div,
|
|
1886
1918
|
{
|
|
@@ -1898,7 +1930,7 @@ function sr({
|
|
|
1898
1930
|
minWidth: 0
|
|
1899
1931
|
},
|
|
1900
1932
|
children: [
|
|
1901
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ i(
|
|
1902
1934
|
"div",
|
|
1903
1935
|
{
|
|
1904
1936
|
style: {
|
|
@@ -1909,7 +1941,7 @@ function sr({
|
|
|
1909
1941
|
width: 32,
|
|
1910
1942
|
...f ? { paddingTop: 2 } : {}
|
|
1911
1943
|
},
|
|
1912
|
-
children: /* @__PURE__ */
|
|
1944
|
+
children: /* @__PURE__ */ i(ar, { phase: t ? 1 : l })
|
|
1913
1945
|
}
|
|
1914
1946
|
),
|
|
1915
1947
|
/* @__PURE__ */ y(
|
|
@@ -1923,18 +1955,18 @@ function sr({
|
|
|
1923
1955
|
flex: 1
|
|
1924
1956
|
},
|
|
1925
1957
|
children: [
|
|
1926
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ i("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: a ? /* @__PURE__ */ i(
|
|
1927
1959
|
C,
|
|
1928
1960
|
{
|
|
1929
|
-
text:
|
|
1961
|
+
text: g,
|
|
1930
1962
|
duration: 2.5,
|
|
1931
1963
|
repeat: !0,
|
|
1932
1964
|
color: "#999",
|
|
1933
1965
|
shimmerColor: "#000"
|
|
1934
1966
|
}
|
|
1935
1967
|
) : e.memoryTypeName }),
|
|
1936
|
-
|
|
1937
|
-
/* @__PURE__ */
|
|
1968
|
+
l === 1 && s && !O(e) && /* @__PURE__ */ y("div", { style: { minWidth: 0 }, children: [
|
|
1969
|
+
/* @__PURE__ */ i(
|
|
1938
1970
|
"span",
|
|
1939
1971
|
{
|
|
1940
1972
|
style: {
|
|
@@ -1947,7 +1979,7 @@ function sr({
|
|
|
1947
1979
|
children: r.memorySearchQueryReasoningLabel
|
|
1948
1980
|
}
|
|
1949
1981
|
),
|
|
1950
|
-
/* @__PURE__ */
|
|
1982
|
+
/* @__PURE__ */ i(
|
|
1951
1983
|
"div",
|
|
1952
1984
|
{
|
|
1953
1985
|
style: {
|
|
@@ -1956,7 +1988,7 @@ function sr({
|
|
|
1956
1988
|
padding: "8px 10px",
|
|
1957
1989
|
boxSizing: "border-box"
|
|
1958
1990
|
},
|
|
1959
|
-
children: /* @__PURE__ */
|
|
1991
|
+
children: /* @__PURE__ */ i(
|
|
1960
1992
|
"div",
|
|
1961
1993
|
{
|
|
1962
1994
|
ref: d,
|
|
@@ -1968,18 +2000,18 @@ function sr({
|
|
|
1968
2000
|
overflowY: "auto",
|
|
1969
2001
|
overflowX: "hidden",
|
|
1970
2002
|
fontSize: B,
|
|
1971
|
-
lineHeight:
|
|
2003
|
+
lineHeight: N,
|
|
1972
2004
|
whiteSpace: "pre-wrap",
|
|
1973
2005
|
wordBreak: "break-word",
|
|
1974
2006
|
color: "#888"
|
|
1975
2007
|
},
|
|
1976
|
-
children:
|
|
2008
|
+
children: c
|
|
1977
2009
|
}
|
|
1978
2010
|
)
|
|
1979
2011
|
}
|
|
1980
2012
|
)
|
|
1981
2013
|
] }),
|
|
1982
|
-
|
|
2014
|
+
l === 2 && u && /* @__PURE__ */ i("div", { style: { fontSize: 12 }, children: /* @__PURE__ */ i(
|
|
1983
2015
|
C,
|
|
1984
2016
|
{
|
|
1985
2017
|
text: r.memorySearchGeneratingQueriesPending,
|
|
@@ -1989,9 +2021,9 @@ function sr({
|
|
|
1989
2021
|
shimmerColor: "#000"
|
|
1990
2022
|
}
|
|
1991
2023
|
) }),
|
|
1992
|
-
|
|
2024
|
+
l === 3 && /* @__PURE__ */ y(E, { children: [
|
|
1993
2025
|
/* @__PURE__ */ y("div", { style: { minWidth: 0 }, children: [
|
|
1994
|
-
/* @__PURE__ */
|
|
2026
|
+
/* @__PURE__ */ i(
|
|
1995
2027
|
"span",
|
|
1996
2028
|
{
|
|
1997
2029
|
style: {
|
|
@@ -2004,7 +2036,7 @@ function sr({
|
|
|
2004
2036
|
children: r.memorySearchGeneratedQueriesHeading
|
|
2005
2037
|
}
|
|
2006
2038
|
),
|
|
2007
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ i(
|
|
2008
2040
|
"div",
|
|
2009
2041
|
{
|
|
2010
2042
|
style: {
|
|
@@ -2012,7 +2044,7 @@ function sr({
|
|
|
2012
2044
|
flexDirection: "column",
|
|
2013
2045
|
gap: 6
|
|
2014
2046
|
},
|
|
2015
|
-
children: e.queries.map((
|
|
2047
|
+
children: e.queries.map((p, S) => /* @__PURE__ */ i(
|
|
2016
2048
|
"div",
|
|
2017
2049
|
{
|
|
2018
2050
|
style: {
|
|
@@ -2021,19 +2053,19 @@ function sr({
|
|
|
2021
2053
|
lineHeight: 1.5,
|
|
2022
2054
|
wordBreak: "break-word"
|
|
2023
2055
|
},
|
|
2024
|
-
children:
|
|
2056
|
+
children: p.query
|
|
2025
2057
|
},
|
|
2026
|
-
|
|
2058
|
+
S
|
|
2027
2059
|
))
|
|
2028
2060
|
}
|
|
2029
2061
|
)
|
|
2030
2062
|
] }),
|
|
2031
|
-
|
|
2032
|
-
/* @__PURE__ */
|
|
2063
|
+
s && /* @__PURE__ */ y(E, { children: [
|
|
2064
|
+
/* @__PURE__ */ i(
|
|
2033
2065
|
"button",
|
|
2034
2066
|
{
|
|
2035
2067
|
type: "button",
|
|
2036
|
-
onClick: () =>
|
|
2068
|
+
onClick: () => o((p) => !p),
|
|
2037
2069
|
style: {
|
|
2038
2070
|
alignSelf: "flex-start",
|
|
2039
2071
|
border: "none",
|
|
@@ -2044,15 +2076,15 @@ function sr({
|
|
|
2044
2076
|
color: "#666",
|
|
2045
2077
|
textDecoration: "underline"
|
|
2046
2078
|
},
|
|
2047
|
-
children:
|
|
2079
|
+
children: m ? r.memorySearchHideReasoning : r.memorySearchViewReasoning
|
|
2048
2080
|
}
|
|
2049
2081
|
),
|
|
2050
|
-
|
|
2082
|
+
m && /* @__PURE__ */ i(
|
|
2051
2083
|
"div",
|
|
2052
2084
|
{
|
|
2053
2085
|
style: {
|
|
2054
2086
|
fontSize: B,
|
|
2055
|
-
lineHeight:
|
|
2087
|
+
lineHeight: N,
|
|
2056
2088
|
whiteSpace: "pre-wrap",
|
|
2057
2089
|
wordBreak: "break-word",
|
|
2058
2090
|
color: "#888",
|
|
@@ -2060,7 +2092,7 @@ function sr({
|
|
|
2060
2092
|
borderRadius: 6,
|
|
2061
2093
|
padding: "8px 10px"
|
|
2062
2094
|
},
|
|
2063
|
-
children:
|
|
2095
|
+
children: c
|
|
2064
2096
|
}
|
|
2065
2097
|
)
|
|
2066
2098
|
] })
|
|
@@ -2073,14 +2105,14 @@ function sr({
|
|
|
2073
2105
|
);
|
|
2074
2106
|
}
|
|
2075
2107
|
const lr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
2076
|
-
const
|
|
2077
|
-
let
|
|
2078
|
-
return e.memoryTypes.forEach((
|
|
2079
|
-
O(
|
|
2080
|
-
}),
|
|
2108
|
+
const l = D(() => {
|
|
2109
|
+
let c = -1;
|
|
2110
|
+
return e.memoryTypes.forEach((s, d) => {
|
|
2111
|
+
O(s) || (c = d);
|
|
2112
|
+
}), c;
|
|
2081
2113
|
}, [e.memoryTypes]);
|
|
2082
2114
|
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2083
|
-
r && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */
|
|
2115
|
+
r && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ i(
|
|
2084
2116
|
C,
|
|
2085
2117
|
{
|
|
2086
2118
|
text: t.memorySearchGeneratingQueries,
|
|
@@ -2089,16 +2121,16 @@ const lr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
2089
2121
|
color: "#999",
|
|
2090
2122
|
shimmerColor: "#000"
|
|
2091
2123
|
}
|
|
2092
|
-
) : e.memoryTypes.map((
|
|
2124
|
+
) : e.memoryTypes.map((c, s) => /* @__PURE__ */ i(
|
|
2093
2125
|
sr,
|
|
2094
2126
|
{
|
|
2095
|
-
item:
|
|
2127
|
+
item: c,
|
|
2096
2128
|
t,
|
|
2097
|
-
isActiveRow:
|
|
2129
|
+
isActiveRow: s === l && r
|
|
2098
2130
|
},
|
|
2099
|
-
|
|
2131
|
+
c.memoryTypeId
|
|
2100
2132
|
)),
|
|
2101
|
-
n !== void 0 && /* @__PURE__ */
|
|
2133
|
+
n !== void 0 && /* @__PURE__ */ i(
|
|
2102
2134
|
"div",
|
|
2103
2135
|
{
|
|
2104
2136
|
style: {
|
|
@@ -2107,7 +2139,7 @@ const lr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
2107
2139
|
marginTop: "4px",
|
|
2108
2140
|
fontStyle: "italic"
|
|
2109
2141
|
},
|
|
2110
|
-
children:
|
|
2142
|
+
children: x(t.tookSeconds, { n })
|
|
2111
2143
|
}
|
|
2112
2144
|
)
|
|
2113
2145
|
] });
|
|
@@ -2125,31 +2157,31 @@ function re(e) {
|
|
|
2125
2157
|
var n, t;
|
|
2126
2158
|
if (e.length === 0) return "";
|
|
2127
2159
|
let r = ((n = e[0]) == null ? void 0 : n.content) ?? "";
|
|
2128
|
-
for (let
|
|
2129
|
-
const
|
|
2130
|
-
if (
|
|
2160
|
+
for (let l = 1; l < e.length; l++) {
|
|
2161
|
+
const c = ((t = e[l]) == null ? void 0 : t.content) ?? "";
|
|
2162
|
+
if (c === "") continue;
|
|
2131
2163
|
if (r === "") {
|
|
2132
|
-
r =
|
|
2164
|
+
r = c;
|
|
2133
2165
|
continue;
|
|
2134
2166
|
}
|
|
2135
|
-
const
|
|
2136
|
-
|
|
2167
|
+
const s = cr(r, c);
|
|
2168
|
+
s === 0 ? r += dr + c : r += c.slice(s);
|
|
2137
2169
|
}
|
|
2138
2170
|
return r;
|
|
2139
2171
|
}
|
|
2140
2172
|
function ne(e, r) {
|
|
2141
2173
|
if (e.length === 0) return "";
|
|
2142
2174
|
if (e.length === 1)
|
|
2143
|
-
return
|
|
2175
|
+
return x(r.memorySearchPagesSingle, {
|
|
2144
2176
|
n: e[0]
|
|
2145
2177
|
});
|
|
2146
2178
|
if (e.length === 2)
|
|
2147
|
-
return
|
|
2179
|
+
return x(r.memorySearchPagesTwo, {
|
|
2148
2180
|
a: e[0],
|
|
2149
2181
|
b: e[1]
|
|
2150
2182
|
});
|
|
2151
2183
|
const n = e[e.length - 1], t = e.slice(0, -1).join(", ");
|
|
2152
|
-
return
|
|
2184
|
+
return x(r.memorySearchPagesMultiple, {
|
|
2153
2185
|
list: t,
|
|
2154
2186
|
n
|
|
2155
2187
|
});
|
|
@@ -2165,14 +2197,14 @@ function oe(e) {
|
|
|
2165
2197
|
if (r !== "") return r;
|
|
2166
2198
|
if (e.memoryTypeId !== "") return e.memoryTypeId;
|
|
2167
2199
|
}
|
|
2168
|
-
function
|
|
2169
|
-
return e.some((t) => t.result == null && t.error == null) ? /* @__PURE__ */
|
|
2200
|
+
function mr(e) {
|
|
2201
|
+
return e.some((t) => t.result == null && t.error == null) ? /* @__PURE__ */ i("span", { className: "explore-memory-loader" }) : e.some((t) => t.error != null) ? /* @__PURE__ */ i(j, { color: "#c62828", size: 15, lineWidth: 2 }) : /* @__PURE__ */ i(z, { color: "#999", size: 15, borderWidth: 2 });
|
|
2170
2202
|
}
|
|
2171
|
-
function
|
|
2203
|
+
function ur(e, r) {
|
|
2172
2204
|
if (e.error != null)
|
|
2173
|
-
return /* @__PURE__ */
|
|
2205
|
+
return /* @__PURE__ */ i("span", { style: { fontSize: 12, color: "#c62828", whiteSpace: "nowrap" }, children: e.error });
|
|
2174
2206
|
if (e.result == null)
|
|
2175
|
-
return /* @__PURE__ */
|
|
2207
|
+
return /* @__PURE__ */ i("span", { style: { flexShrink: 0, fontSize: 12 }, children: /* @__PURE__ */ i(
|
|
2176
2208
|
C,
|
|
2177
2209
|
{
|
|
2178
2210
|
text: r.searching,
|
|
@@ -2182,13 +2214,13 @@ function mr(e, r) {
|
|
|
2182
2214
|
shimmerColor: "#000"
|
|
2183
2215
|
}
|
|
2184
2216
|
) });
|
|
2185
|
-
const n = e.result, t = n.numberOfChunks === 1 ? r.chunkFound :
|
|
2217
|
+
const n = e.result, t = n.numberOfChunks === 1 ? r.chunkFound : x(r.chunksFound, { n: n.numberOfChunks }), l = x(r.scoreLabel, {
|
|
2186
2218
|
n: n.highestChunkScore.toFixed(2)
|
|
2187
2219
|
});
|
|
2188
2220
|
return /* @__PURE__ */ y("span", { style: { fontSize: 12, color: "#666", whiteSpace: "nowrap" }, children: [
|
|
2189
2221
|
t,
|
|
2190
2222
|
" · ",
|
|
2191
|
-
|
|
2223
|
+
l
|
|
2192
2224
|
] });
|
|
2193
2225
|
}
|
|
2194
2226
|
function pr({
|
|
@@ -2197,8 +2229,9 @@ function pr({
|
|
|
2197
2229
|
onExploreQueryResultClick: n,
|
|
2198
2230
|
t
|
|
2199
2231
|
}) {
|
|
2232
|
+
const [l, c] = b(null);
|
|
2200
2233
|
if (e.length === 0)
|
|
2201
|
-
return /* @__PURE__ */
|
|
2234
|
+
return /* @__PURE__ */ i(
|
|
2202
2235
|
"div",
|
|
2203
2236
|
{
|
|
2204
2237
|
style: {
|
|
@@ -2209,8 +2242,8 @@ function pr({
|
|
|
2209
2242
|
children: t.memorySearchExploreNoResults
|
|
2210
2243
|
}
|
|
2211
2244
|
);
|
|
2212
|
-
const
|
|
2213
|
-
return /* @__PURE__ */
|
|
2245
|
+
const s = !!n;
|
|
2246
|
+
return /* @__PURE__ */ i(
|
|
2214
2247
|
"div",
|
|
2215
2248
|
{
|
|
2216
2249
|
style: {
|
|
@@ -2221,24 +2254,24 @@ function pr({
|
|
|
2221
2254
|
paddingTop: 8,
|
|
2222
2255
|
borderTop: "1px solid #f0f0f0"
|
|
2223
2256
|
},
|
|
2224
|
-
children: e.map((
|
|
2225
|
-
const
|
|
2226
|
-
|
|
2227
|
-
),
|
|
2228
|
-
oe(
|
|
2229
|
-
|
|
2230
|
-
n:
|
|
2257
|
+
children: e.map((d, m) => {
|
|
2258
|
+
const o = d.memory.title != null && d.memory.title !== "" ? d.memory.title : d.memory.id, a = te(
|
|
2259
|
+
d.chunks
|
|
2260
|
+
), u = [
|
|
2261
|
+
oe(d.memory),
|
|
2262
|
+
x(t.scoreLabel, {
|
|
2263
|
+
n: d.score.toFixed(2)
|
|
2231
2264
|
}),
|
|
2232
|
-
|
|
2265
|
+
a.length > 0 ? ne(a, t) : t.pagesNotAvailable
|
|
2233
2266
|
].filter(
|
|
2234
|
-
(
|
|
2235
|
-
),
|
|
2236
|
-
memoryId:
|
|
2237
|
-
pageNumbers:
|
|
2267
|
+
(S) => S != null && S !== ""
|
|
2268
|
+
), g = {
|
|
2269
|
+
memoryId: d.memory.id,
|
|
2270
|
+
pageNumbers: a,
|
|
2238
2271
|
memoryTypeId: r.memoryTypeId,
|
|
2239
2272
|
memoryTypeName: r.memoryTypeName,
|
|
2240
2273
|
query: r.query
|
|
2241
|
-
};
|
|
2274
|
+
}, f = `${r.query}::${d.memory.id}::${m}`, p = l === f;
|
|
2242
2275
|
return /* @__PURE__ */ y(
|
|
2243
2276
|
"div",
|
|
2244
2277
|
{
|
|
@@ -2247,9 +2280,9 @@ function pr({
|
|
|
2247
2280
|
flexDirection: "row",
|
|
2248
2281
|
alignItems: "flex-start",
|
|
2249
2282
|
gap: "12px",
|
|
2250
|
-
paddingTop:
|
|
2251
|
-
paddingBottom:
|
|
2252
|
-
borderBottom:
|
|
2283
|
+
paddingTop: m > 0 ? 12 : 0,
|
|
2284
|
+
paddingBottom: m < e.length - 1 ? 12 : 0,
|
|
2285
|
+
borderBottom: m < e.length - 1 ? "1px solid #eee" : void 0,
|
|
2253
2286
|
minWidth: 0
|
|
2254
2287
|
},
|
|
2255
2288
|
children: [
|
|
@@ -2264,7 +2297,7 @@ function pr({
|
|
|
2264
2297
|
gap: "6px"
|
|
2265
2298
|
},
|
|
2266
2299
|
children: [
|
|
2267
|
-
/* @__PURE__ */
|
|
2300
|
+
/* @__PURE__ */ i(
|
|
2268
2301
|
"span",
|
|
2269
2302
|
{
|
|
2270
2303
|
style: {
|
|
@@ -2272,10 +2305,10 @@ function pr({
|
|
|
2272
2305
|
fontWeight: 600,
|
|
2273
2306
|
color: "#333"
|
|
2274
2307
|
},
|
|
2275
|
-
children:
|
|
2308
|
+
children: o
|
|
2276
2309
|
}
|
|
2277
2310
|
),
|
|
2278
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ i(
|
|
2279
2312
|
"span",
|
|
2280
2313
|
{
|
|
2281
2314
|
style: {
|
|
@@ -2286,11 +2319,11 @@ function pr({
|
|
|
2286
2319
|
wordBreak: "break-word"
|
|
2287
2320
|
},
|
|
2288
2321
|
children: re(
|
|
2289
|
-
|
|
2322
|
+
d.chunks
|
|
2290
2323
|
)
|
|
2291
2324
|
}
|
|
2292
2325
|
),
|
|
2293
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ i(
|
|
2294
2327
|
"div",
|
|
2295
2328
|
{
|
|
2296
2329
|
style: {
|
|
@@ -2299,17 +2332,28 @@ function pr({
|
|
|
2299
2332
|
color: "#94a3b8",
|
|
2300
2333
|
lineHeight: 1.35
|
|
2301
2334
|
},
|
|
2302
|
-
children:
|
|
2335
|
+
children: u.join(" · ")
|
|
2303
2336
|
}
|
|
2304
2337
|
)
|
|
2305
2338
|
]
|
|
2306
2339
|
}
|
|
2307
2340
|
),
|
|
2308
|
-
|
|
2341
|
+
s && /* @__PURE__ */ y(
|
|
2309
2342
|
"button",
|
|
2310
2343
|
{
|
|
2311
2344
|
type: "button",
|
|
2312
|
-
|
|
2345
|
+
"aria-busy": p,
|
|
2346
|
+
disabled: p,
|
|
2347
|
+
onClick: async () => {
|
|
2348
|
+
c(f);
|
|
2349
|
+
try {
|
|
2350
|
+
await n(
|
|
2351
|
+
g
|
|
2352
|
+
);
|
|
2353
|
+
} finally {
|
|
2354
|
+
c(null);
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2313
2357
|
style: {
|
|
2314
2358
|
flexShrink: 0,
|
|
2315
2359
|
alignSelf: "center",
|
|
@@ -2320,42 +2364,54 @@ function pr({
|
|
|
2320
2364
|
background: "#eff6ff",
|
|
2321
2365
|
border: "1px solid #bfdbfe",
|
|
2322
2366
|
borderRadius: 6,
|
|
2323
|
-
cursor: "pointer",
|
|
2324
|
-
fontFamily: "inherit"
|
|
2367
|
+
cursor: p ? "wait" : "pointer",
|
|
2368
|
+
fontFamily: "inherit",
|
|
2369
|
+
display: "inline-flex",
|
|
2370
|
+
alignItems: "center",
|
|
2371
|
+
gap: 8
|
|
2325
2372
|
},
|
|
2326
|
-
children:
|
|
2373
|
+
children: [
|
|
2374
|
+
p && /* @__PURE__ */ i(
|
|
2375
|
+
"span",
|
|
2376
|
+
{
|
|
2377
|
+
className: "explore-memory-loader",
|
|
2378
|
+
"aria-hidden": !0
|
|
2379
|
+
}
|
|
2380
|
+
),
|
|
2381
|
+
t.viewButton
|
|
2382
|
+
]
|
|
2327
2383
|
}
|
|
2328
2384
|
)
|
|
2329
2385
|
]
|
|
2330
2386
|
},
|
|
2331
|
-
`${
|
|
2387
|
+
`${d.memory.id}-${m}`
|
|
2332
2388
|
);
|
|
2333
2389
|
})
|
|
2334
2390
|
}
|
|
2335
2391
|
);
|
|
2336
2392
|
}
|
|
2337
|
-
function
|
|
2393
|
+
function yr(e) {
|
|
2338
2394
|
const r = [], n = /* @__PURE__ */ new Map();
|
|
2339
|
-
return e.forEach((t,
|
|
2340
|
-
let
|
|
2341
|
-
|
|
2395
|
+
return e.forEach((t, l) => {
|
|
2396
|
+
let c = n.get(t.memoryTypeId);
|
|
2397
|
+
c == null && (r.push(t.memoryTypeId), c = {
|
|
2342
2398
|
memoryTypeId: t.memoryTypeId,
|
|
2343
2399
|
memoryTypeName: t.memoryTypeName,
|
|
2344
2400
|
items: []
|
|
2345
|
-
}, n.set(t.memoryTypeId,
|
|
2401
|
+
}, n.set(t.memoryTypeId, c)), c.items.push({ item: t, flatIndex: l });
|
|
2346
2402
|
}), r.map((t) => n.get(t));
|
|
2347
2403
|
}
|
|
2348
|
-
function
|
|
2404
|
+
function gr({
|
|
2349
2405
|
group: e,
|
|
2350
2406
|
t: r,
|
|
2351
2407
|
lastInFlightIndex: n,
|
|
2352
2408
|
isLatest: t,
|
|
2353
|
-
expandedRows:
|
|
2354
|
-
toggleExpanded:
|
|
2355
|
-
onExploreQueryResultClick:
|
|
2409
|
+
expandedRows: l,
|
|
2410
|
+
toggleExpanded: c,
|
|
2411
|
+
onExploreQueryResultClick: s
|
|
2356
2412
|
}) {
|
|
2357
|
-
const d = e.items.map((
|
|
2358
|
-
(
|
|
2413
|
+
const d = e.items.map((o) => o.item), m = d.some(
|
|
2414
|
+
(o) => o.result == null && o.error == null
|
|
2359
2415
|
);
|
|
2360
2416
|
return /* @__PURE__ */ y(
|
|
2361
2417
|
T.div,
|
|
@@ -2369,12 +2425,12 @@ function yr({
|
|
|
2369
2425
|
borderBottom: "1px solid #eee",
|
|
2370
2426
|
display: "flex",
|
|
2371
2427
|
flexDirection: "row",
|
|
2372
|
-
alignItems:
|
|
2428
|
+
alignItems: m ? "center" : "flex-start",
|
|
2373
2429
|
gap: "10px",
|
|
2374
2430
|
minWidth: 0
|
|
2375
2431
|
},
|
|
2376
2432
|
children: [
|
|
2377
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ i(
|
|
2378
2434
|
"div",
|
|
2379
2435
|
{
|
|
2380
2436
|
style: {
|
|
@@ -2383,9 +2439,9 @@ function yr({
|
|
|
2383
2439
|
justifyContent: "center",
|
|
2384
2440
|
flexShrink: 0,
|
|
2385
2441
|
width: 32,
|
|
2386
|
-
...
|
|
2442
|
+
...m ? {} : { paddingTop: 2 }
|
|
2387
2443
|
},
|
|
2388
|
-
children:
|
|
2444
|
+
children: mr(d)
|
|
2389
2445
|
}
|
|
2390
2446
|
),
|
|
2391
2447
|
/* @__PURE__ */ y(
|
|
@@ -2399,21 +2455,21 @@ function yr({
|
|
|
2399
2455
|
flex: 1
|
|
2400
2456
|
},
|
|
2401
2457
|
children: [
|
|
2402
|
-
/* @__PURE__ */
|
|
2458
|
+
/* @__PURE__ */ i(
|
|
2403
2459
|
"span",
|
|
2404
2460
|
{
|
|
2405
2461
|
style: {
|
|
2406
2462
|
fontSize: 12,
|
|
2407
2463
|
color: "#888"
|
|
2408
2464
|
},
|
|
2409
|
-
children:
|
|
2465
|
+
children: x(r.memorySearchExploreQueryTypeLabel, {
|
|
2410
2466
|
name: e.memoryTypeName
|
|
2411
2467
|
})
|
|
2412
2468
|
}
|
|
2413
2469
|
),
|
|
2414
|
-
e.items.map(({ item:
|
|
2415
|
-
var
|
|
2416
|
-
const
|
|
2470
|
+
e.items.map(({ item: o, flatIndex: a }) => {
|
|
2471
|
+
var h;
|
|
2472
|
+
const u = o.result != null, g = o.error != null, f = a === n && t && !u && !g, p = l[a] === !0, S = ((h = o.result) == null ? void 0 : h.items) ?? [];
|
|
2417
2473
|
return /* @__PURE__ */ y(
|
|
2418
2474
|
"div",
|
|
2419
2475
|
{
|
|
@@ -2436,7 +2492,7 @@ function yr({
|
|
|
2436
2492
|
minWidth: 0
|
|
2437
2493
|
},
|
|
2438
2494
|
children: [
|
|
2439
|
-
/* @__PURE__ */
|
|
2495
|
+
/* @__PURE__ */ i(
|
|
2440
2496
|
"span",
|
|
2441
2497
|
{
|
|
2442
2498
|
style: {
|
|
@@ -2447,16 +2503,16 @@ function yr({
|
|
|
2447
2503
|
flex: "1 1 12rem",
|
|
2448
2504
|
minWidth: 0
|
|
2449
2505
|
},
|
|
2450
|
-
children: f ? /* @__PURE__ */
|
|
2506
|
+
children: f ? /* @__PURE__ */ i(
|
|
2451
2507
|
C,
|
|
2452
2508
|
{
|
|
2453
|
-
text:
|
|
2509
|
+
text: o.query,
|
|
2454
2510
|
duration: 2.5,
|
|
2455
2511
|
repeat: !0,
|
|
2456
2512
|
color: "#999",
|
|
2457
2513
|
shimmerColor: "#000"
|
|
2458
2514
|
}
|
|
2459
|
-
) :
|
|
2515
|
+
) : o.query
|
|
2460
2516
|
}
|
|
2461
2517
|
),
|
|
2462
2518
|
/* @__PURE__ */ y(
|
|
@@ -2470,12 +2526,12 @@ function yr({
|
|
|
2470
2526
|
flexShrink: 0
|
|
2471
2527
|
},
|
|
2472
2528
|
children: [
|
|
2473
|
-
|
|
2474
|
-
|
|
2529
|
+
ur(o, r),
|
|
2530
|
+
u && /* @__PURE__ */ i(
|
|
2475
2531
|
"button",
|
|
2476
2532
|
{
|
|
2477
2533
|
type: "button",
|
|
2478
|
-
onClick: () =>
|
|
2534
|
+
onClick: () => c(a),
|
|
2479
2535
|
style: {
|
|
2480
2536
|
border: "none",
|
|
2481
2537
|
background: "none",
|
|
@@ -2486,7 +2542,7 @@ function yr({
|
|
|
2486
2542
|
textDecoration: "underline",
|
|
2487
2543
|
fontFamily: "inherit"
|
|
2488
2544
|
},
|
|
2489
|
-
children:
|
|
2545
|
+
children: p ? r.memorySearchHideExploreResults : r.memorySearchViewExploreResults
|
|
2490
2546
|
}
|
|
2491
2547
|
)
|
|
2492
2548
|
]
|
|
@@ -2495,18 +2551,18 @@ function yr({
|
|
|
2495
2551
|
]
|
|
2496
2552
|
}
|
|
2497
2553
|
),
|
|
2498
|
-
|
|
2554
|
+
u && p && /* @__PURE__ */ i(
|
|
2499
2555
|
pr,
|
|
2500
2556
|
{
|
|
2501
|
-
items:
|
|
2502
|
-
queryRow:
|
|
2503
|
-
onExploreQueryResultClick:
|
|
2557
|
+
items: S,
|
|
2558
|
+
queryRow: o,
|
|
2559
|
+
onExploreQueryResultClick: s,
|
|
2504
2560
|
t: r
|
|
2505
2561
|
}
|
|
2506
2562
|
)
|
|
2507
2563
|
]
|
|
2508
2564
|
},
|
|
2509
|
-
`${e.memoryTypeId}-${a}-${
|
|
2565
|
+
`${e.memoryTypeId}-${a}-${o.query}`
|
|
2510
2566
|
);
|
|
2511
2567
|
})
|
|
2512
2568
|
]
|
|
@@ -2521,48 +2577,48 @@ const hr = ({
|
|
|
2521
2577
|
isLatest: r = !1,
|
|
2522
2578
|
durationSeconds: n,
|
|
2523
2579
|
onExploreQueryResultClick: t,
|
|
2524
|
-
t:
|
|
2580
|
+
t: l
|
|
2525
2581
|
}) => {
|
|
2526
|
-
const [
|
|
2582
|
+
const [c, s] = b(
|
|
2527
2583
|
{}
|
|
2528
2584
|
), d = G((a) => {
|
|
2529
|
-
|
|
2530
|
-
...
|
|
2531
|
-
[a]: !
|
|
2585
|
+
s((u) => ({
|
|
2586
|
+
...u,
|
|
2587
|
+
[a]: !u[a]
|
|
2532
2588
|
}));
|
|
2533
|
-
}, []),
|
|
2589
|
+
}, []), m = D(() => {
|
|
2534
2590
|
let a = -1;
|
|
2535
|
-
return e.queries.forEach((
|
|
2536
|
-
|
|
2591
|
+
return e.queries.forEach((u, g) => {
|
|
2592
|
+
u.result == null && u.error == null && (a = g);
|
|
2537
2593
|
}), a;
|
|
2538
|
-
}, [e.queries]),
|
|
2539
|
-
() =>
|
|
2594
|
+
}, [e.queries]), o = D(
|
|
2595
|
+
() => yr(e.queries),
|
|
2540
2596
|
[e.queries]
|
|
2541
2597
|
);
|
|
2542
2598
|
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2543
|
-
r && !n && e.queries.length === 0 ? /* @__PURE__ */
|
|
2599
|
+
r && !n && e.queries.length === 0 ? /* @__PURE__ */ i(
|
|
2544
2600
|
C,
|
|
2545
2601
|
{
|
|
2546
|
-
text:
|
|
2602
|
+
text: l.memorySearchExploringQueries,
|
|
2547
2603
|
duration: 2.5,
|
|
2548
2604
|
repeat: !0,
|
|
2549
2605
|
color: "#999",
|
|
2550
2606
|
shimmerColor: "#000"
|
|
2551
2607
|
}
|
|
2552
|
-
) :
|
|
2553
|
-
|
|
2608
|
+
) : o.map((a) => /* @__PURE__ */ i(
|
|
2609
|
+
gr,
|
|
2554
2610
|
{
|
|
2555
2611
|
group: a,
|
|
2556
|
-
t:
|
|
2557
|
-
lastInFlightIndex:
|
|
2612
|
+
t: l,
|
|
2613
|
+
lastInFlightIndex: m,
|
|
2558
2614
|
isLatest: r,
|
|
2559
|
-
expandedRows:
|
|
2615
|
+
expandedRows: c,
|
|
2560
2616
|
toggleExpanded: d,
|
|
2561
2617
|
onExploreQueryResultClick: t
|
|
2562
2618
|
},
|
|
2563
2619
|
a.memoryTypeId
|
|
2564
2620
|
)),
|
|
2565
|
-
n !== void 0 && /* @__PURE__ */
|
|
2621
|
+
n !== void 0 && /* @__PURE__ */ i(
|
|
2566
2622
|
"div",
|
|
2567
2623
|
{
|
|
2568
2624
|
style: {
|
|
@@ -2571,14 +2627,14 @@ const hr = ({
|
|
|
2571
2627
|
marginTop: "4px",
|
|
2572
2628
|
fontStyle: "italic"
|
|
2573
2629
|
},
|
|
2574
|
-
children:
|
|
2630
|
+
children: x(l.tookSeconds, { n })
|
|
2575
2631
|
}
|
|
2576
2632
|
)
|
|
2577
2633
|
] });
|
|
2578
2634
|
}, fr = ({ data: e, onSearchResultClick: r, t: n }) => {
|
|
2579
|
-
const t = e.response.items,
|
|
2635
|
+
const t = e.response.items, l = !!r, [c, s] = b(null);
|
|
2580
2636
|
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
2581
|
-
/* @__PURE__ */
|
|
2637
|
+
/* @__PURE__ */ i(
|
|
2582
2638
|
T.div,
|
|
2583
2639
|
{
|
|
2584
2640
|
style: {
|
|
@@ -2593,7 +2649,7 @@ const hr = ({
|
|
|
2593
2649
|
children: n.resultsHeading
|
|
2594
2650
|
}
|
|
2595
2651
|
),
|
|
2596
|
-
/* @__PURE__ */
|
|
2652
|
+
/* @__PURE__ */ i(
|
|
2597
2653
|
"div",
|
|
2598
2654
|
{
|
|
2599
2655
|
style: {
|
|
@@ -2601,27 +2657,27 @@ const hr = ({
|
|
|
2601
2657
|
flexDirection: "column",
|
|
2602
2658
|
gap: 0
|
|
2603
2659
|
},
|
|
2604
|
-
children: t.map((
|
|
2605
|
-
const
|
|
2606
|
-
|
|
2607
|
-
),
|
|
2608
|
-
oe(
|
|
2609
|
-
|
|
2610
|
-
n:
|
|
2660
|
+
children: t.map((d, m) => {
|
|
2661
|
+
const o = d.memory.title != null && d.memory.title !== "" ? d.memory.title : d.memory.id, a = te(
|
|
2662
|
+
d.chunks
|
|
2663
|
+
), u = [
|
|
2664
|
+
oe(d.memory),
|
|
2665
|
+
x(n.scoreLabel, {
|
|
2666
|
+
n: d.score.toFixed(2)
|
|
2611
2667
|
}),
|
|
2612
|
-
|
|
2668
|
+
a.length > 0 ? ne(a, n) : n.pagesNotAvailable
|
|
2613
2669
|
].filter(
|
|
2614
|
-
(
|
|
2615
|
-
),
|
|
2616
|
-
memoryId:
|
|
2617
|
-
pageNumbers:
|
|
2618
|
-
};
|
|
2670
|
+
(S) => S != null && S !== ""
|
|
2671
|
+
), g = {
|
|
2672
|
+
memoryId: d.memory.id,
|
|
2673
|
+
pageNumbers: a
|
|
2674
|
+
}, f = `${d.memory.id}-${m}`, p = c === f;
|
|
2619
2675
|
return /* @__PURE__ */ y(
|
|
2620
2676
|
T.div,
|
|
2621
2677
|
{
|
|
2622
2678
|
initial: { opacity: 0 },
|
|
2623
2679
|
animate: { opacity: 1 },
|
|
2624
|
-
transition: { duration: 0.2, delay:
|
|
2680
|
+
transition: { duration: 0.2, delay: m * 0.04 },
|
|
2625
2681
|
style: {
|
|
2626
2682
|
display: "flex",
|
|
2627
2683
|
flexDirection: "row",
|
|
@@ -2629,7 +2685,7 @@ const hr = ({
|
|
|
2629
2685
|
gap: "12px",
|
|
2630
2686
|
paddingTop: "12px",
|
|
2631
2687
|
paddingBottom: "12px",
|
|
2632
|
-
borderBottom:
|
|
2688
|
+
borderBottom: m < t.length - 1 ? "1px solid #eee" : void 0,
|
|
2633
2689
|
minWidth: 0
|
|
2634
2690
|
},
|
|
2635
2691
|
children: [
|
|
@@ -2644,7 +2700,7 @@ const hr = ({
|
|
|
2644
2700
|
gap: "6px"
|
|
2645
2701
|
},
|
|
2646
2702
|
children: [
|
|
2647
|
-
/* @__PURE__ */
|
|
2703
|
+
/* @__PURE__ */ i(
|
|
2648
2704
|
"span",
|
|
2649
2705
|
{
|
|
2650
2706
|
style: {
|
|
@@ -2652,10 +2708,10 @@ const hr = ({
|
|
|
2652
2708
|
fontWeight: 600,
|
|
2653
2709
|
color: "#333"
|
|
2654
2710
|
},
|
|
2655
|
-
children:
|
|
2711
|
+
children: o
|
|
2656
2712
|
}
|
|
2657
2713
|
),
|
|
2658
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ i(
|
|
2659
2715
|
"span",
|
|
2660
2716
|
{
|
|
2661
2717
|
style: {
|
|
@@ -2665,10 +2721,10 @@ const hr = ({
|
|
|
2665
2721
|
whiteSpace: "pre-wrap",
|
|
2666
2722
|
wordBreak: "break-word"
|
|
2667
2723
|
},
|
|
2668
|
-
children: re(
|
|
2724
|
+
children: re(d.chunks)
|
|
2669
2725
|
}
|
|
2670
2726
|
),
|
|
2671
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ i(
|
|
2672
2728
|
"div",
|
|
2673
2729
|
{
|
|
2674
2730
|
style: {
|
|
@@ -2677,17 +2733,26 @@ const hr = ({
|
|
|
2677
2733
|
color: "#94a3b8",
|
|
2678
2734
|
lineHeight: 1.35
|
|
2679
2735
|
},
|
|
2680
|
-
children:
|
|
2736
|
+
children: u.join(" · ")
|
|
2681
2737
|
}
|
|
2682
2738
|
)
|
|
2683
2739
|
]
|
|
2684
2740
|
}
|
|
2685
2741
|
),
|
|
2686
|
-
|
|
2742
|
+
l && /* @__PURE__ */ y(
|
|
2687
2743
|
"button",
|
|
2688
2744
|
{
|
|
2689
2745
|
type: "button",
|
|
2690
|
-
|
|
2746
|
+
"aria-busy": p,
|
|
2747
|
+
disabled: p,
|
|
2748
|
+
onClick: async () => {
|
|
2749
|
+
s(f);
|
|
2750
|
+
try {
|
|
2751
|
+
await r(g);
|
|
2752
|
+
} finally {
|
|
2753
|
+
s(null);
|
|
2754
|
+
}
|
|
2755
|
+
},
|
|
2691
2756
|
style: {
|
|
2692
2757
|
flexShrink: 0,
|
|
2693
2758
|
alignSelf: "center",
|
|
@@ -2698,21 +2763,33 @@ const hr = ({
|
|
|
2698
2763
|
background: "#eff6ff",
|
|
2699
2764
|
border: "1px solid #bfdbfe",
|
|
2700
2765
|
borderRadius: 6,
|
|
2701
|
-
cursor: "pointer",
|
|
2702
|
-
fontFamily: "inherit"
|
|
2766
|
+
cursor: p ? "wait" : "pointer",
|
|
2767
|
+
fontFamily: "inherit",
|
|
2768
|
+
display: "inline-flex",
|
|
2769
|
+
alignItems: "center",
|
|
2770
|
+
gap: 8
|
|
2703
2771
|
},
|
|
2704
|
-
children:
|
|
2772
|
+
children: [
|
|
2773
|
+
p && /* @__PURE__ */ i(
|
|
2774
|
+
"span",
|
|
2775
|
+
{
|
|
2776
|
+
className: "explore-memory-loader",
|
|
2777
|
+
"aria-hidden": !0
|
|
2778
|
+
}
|
|
2779
|
+
),
|
|
2780
|
+
n.viewButton
|
|
2781
|
+
]
|
|
2705
2782
|
}
|
|
2706
2783
|
)
|
|
2707
2784
|
]
|
|
2708
2785
|
},
|
|
2709
|
-
`${
|
|
2786
|
+
`${d.memory.id}-${m}`
|
|
2710
2787
|
);
|
|
2711
2788
|
})
|
|
2712
2789
|
}
|
|
2713
2790
|
)
|
|
2714
2791
|
] });
|
|
2715
|
-
}, Sr = ({ message: e }) => /* @__PURE__ */
|
|
2792
|
+
}, Sr = ({ message: e }) => /* @__PURE__ */ i("div", { style: { padding: "16px" }, children: /* @__PURE__ */ i(
|
|
2716
2793
|
T.div,
|
|
2717
2794
|
{
|
|
2718
2795
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2723,7 +2800,7 @@ const hr = ({
|
|
|
2723
2800
|
alignItems: "flex-start",
|
|
2724
2801
|
gap: "10px"
|
|
2725
2802
|
},
|
|
2726
|
-
children: /* @__PURE__ */
|
|
2803
|
+
children: /* @__PURE__ */ i(
|
|
2727
2804
|
"span",
|
|
2728
2805
|
{
|
|
2729
2806
|
style: {
|
|
@@ -2740,63 +2817,63 @@ const hr = ({
|
|
|
2740
2817
|
loadingText: r,
|
|
2741
2818
|
t: n,
|
|
2742
2819
|
onSourceClick: t,
|
|
2743
|
-
onSearchResultClick:
|
|
2744
|
-
onExploreQueryResultClick:
|
|
2820
|
+
onSearchResultClick: l,
|
|
2821
|
+
onExploreQueryResultClick: c
|
|
2745
2822
|
}) => {
|
|
2746
|
-
const
|
|
2747
|
-
|
|
2748
|
-
|
|
2823
|
+
const s = A(null);
|
|
2824
|
+
M(() => {
|
|
2825
|
+
s.current && (s.current.scrollTop = s.current.scrollHeight);
|
|
2749
2826
|
}, [e.length]);
|
|
2750
|
-
const d = (
|
|
2751
|
-
const a =
|
|
2827
|
+
const d = (o) => {
|
|
2828
|
+
const a = o.item.data;
|
|
2752
2829
|
if (a.taskType === "StreamingChatCompletion" && a.eventType === "Text")
|
|
2753
|
-
return /* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ i(K, { text: a.text });
|
|
2754
2831
|
if (a.taskType === "StructuredChatCompletion" && a.eventType === "Completed")
|
|
2755
|
-
return /* @__PURE__ */
|
|
2832
|
+
return /* @__PURE__ */ i(Oe, { data: a });
|
|
2756
2833
|
if (a.taskType === "MemoryChatCompletion")
|
|
2757
2834
|
switch (a.eventType) {
|
|
2758
2835
|
case "Text":
|
|
2759
|
-
return /* @__PURE__ */
|
|
2836
|
+
return /* @__PURE__ */ i(K, { text: a.text });
|
|
2760
2837
|
case "FindMemories":
|
|
2761
|
-
return /* @__PURE__ */
|
|
2762
|
-
|
|
2838
|
+
return /* @__PURE__ */ i(
|
|
2839
|
+
$e,
|
|
2763
2840
|
{
|
|
2764
2841
|
data: a,
|
|
2765
|
-
isLatest:
|
|
2766
|
-
durationSeconds:
|
|
2842
|
+
isLatest: o.isLatest,
|
|
2843
|
+
durationSeconds: o.durationSeconds,
|
|
2767
2844
|
t: n
|
|
2768
2845
|
}
|
|
2769
2846
|
);
|
|
2770
2847
|
case "FindMemoriesResult":
|
|
2771
|
-
return /* @__PURE__ */
|
|
2772
|
-
|
|
2848
|
+
return /* @__PURE__ */ i(
|
|
2849
|
+
He,
|
|
2773
2850
|
{
|
|
2774
2851
|
data: a,
|
|
2775
2852
|
t: n
|
|
2776
2853
|
}
|
|
2777
2854
|
);
|
|
2778
2855
|
case "Search":
|
|
2779
|
-
return /* @__PURE__ */
|
|
2780
|
-
|
|
2856
|
+
return /* @__PURE__ */ i(
|
|
2857
|
+
We,
|
|
2781
2858
|
{
|
|
2782
2859
|
data: a,
|
|
2783
|
-
isLatest:
|
|
2784
|
-
durationSeconds:
|
|
2860
|
+
isLatest: o.isLatest,
|
|
2861
|
+
durationSeconds: o.durationSeconds,
|
|
2785
2862
|
t: n
|
|
2786
2863
|
}
|
|
2787
2864
|
);
|
|
2788
2865
|
case "FindSources":
|
|
2789
|
-
return /* @__PURE__ */
|
|
2866
|
+
return /* @__PURE__ */ i(
|
|
2790
2867
|
_e,
|
|
2791
2868
|
{
|
|
2792
2869
|
data: a,
|
|
2793
|
-
isLatest:
|
|
2794
|
-
durationSeconds:
|
|
2870
|
+
isLatest: o.isLatest,
|
|
2871
|
+
durationSeconds: o.durationSeconds,
|
|
2795
2872
|
t: n
|
|
2796
2873
|
}
|
|
2797
2874
|
);
|
|
2798
2875
|
case "SourcesResult":
|
|
2799
|
-
return /* @__PURE__ */
|
|
2876
|
+
return /* @__PURE__ */ i(
|
|
2800
2877
|
Qe,
|
|
2801
2878
|
{
|
|
2802
2879
|
data: a,
|
|
@@ -2805,67 +2882,67 @@ const hr = ({
|
|
|
2805
2882
|
}
|
|
2806
2883
|
);
|
|
2807
2884
|
case "ExploreMemories":
|
|
2808
|
-
return /* @__PURE__ */
|
|
2809
|
-
|
|
2885
|
+
return /* @__PURE__ */ i(
|
|
2886
|
+
Ke,
|
|
2810
2887
|
{
|
|
2811
2888
|
data: a,
|
|
2812
|
-
completed:
|
|
2813
|
-
isLatest:
|
|
2889
|
+
completed: o.completed,
|
|
2890
|
+
isLatest: o.isLatest,
|
|
2814
2891
|
t: n
|
|
2815
2892
|
}
|
|
2816
2893
|
);
|
|
2817
2894
|
case "ChunkResult":
|
|
2818
|
-
return /* @__PURE__ */
|
|
2895
|
+
return /* @__PURE__ */ i(Je, { data: a, t: n });
|
|
2819
2896
|
case "Completed":
|
|
2820
2897
|
return null;
|
|
2821
2898
|
}
|
|
2822
2899
|
if (a.taskType === "MemorySearch")
|
|
2823
2900
|
switch (a.eventType) {
|
|
2824
2901
|
case "GeneratingQueries":
|
|
2825
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ i(
|
|
2826
2903
|
lr,
|
|
2827
2904
|
{
|
|
2828
2905
|
data: a,
|
|
2829
|
-
isLatest:
|
|
2830
|
-
durationSeconds:
|
|
2906
|
+
isLatest: o.isLatest,
|
|
2907
|
+
durationSeconds: o.durationSeconds,
|
|
2831
2908
|
t: n
|
|
2832
2909
|
}
|
|
2833
2910
|
);
|
|
2834
2911
|
case "ExploreQueries":
|
|
2835
|
-
return /* @__PURE__ */
|
|
2912
|
+
return /* @__PURE__ */ i(
|
|
2836
2913
|
hr,
|
|
2837
2914
|
{
|
|
2838
2915
|
data: a,
|
|
2839
|
-
isLatest:
|
|
2840
|
-
durationSeconds:
|
|
2841
|
-
onExploreQueryResultClick:
|
|
2916
|
+
isLatest: o.isLatest,
|
|
2917
|
+
durationSeconds: o.durationSeconds,
|
|
2918
|
+
onExploreQueryResultClick: c,
|
|
2842
2919
|
t: n
|
|
2843
2920
|
}
|
|
2844
2921
|
);
|
|
2845
2922
|
case "SearchMemoryTypes":
|
|
2846
|
-
return /* @__PURE__ */
|
|
2923
|
+
return /* @__PURE__ */ i(
|
|
2847
2924
|
rr,
|
|
2848
2925
|
{
|
|
2849
2926
|
data: a,
|
|
2850
|
-
isLatest:
|
|
2851
|
-
durationSeconds:
|
|
2927
|
+
isLatest: o.isLatest,
|
|
2928
|
+
durationSeconds: o.durationSeconds,
|
|
2852
2929
|
t: n
|
|
2853
2930
|
}
|
|
2854
2931
|
);
|
|
2855
2932
|
case "Completed":
|
|
2856
|
-
return /* @__PURE__ */
|
|
2933
|
+
return /* @__PURE__ */ i(
|
|
2857
2934
|
fr,
|
|
2858
2935
|
{
|
|
2859
2936
|
data: a,
|
|
2860
|
-
onSearchResultClick:
|
|
2937
|
+
onSearchResultClick: l,
|
|
2861
2938
|
t: n
|
|
2862
2939
|
}
|
|
2863
2940
|
);
|
|
2864
2941
|
}
|
|
2865
|
-
return a.taskType === "StreamingChatCompletion" && a.eventType === "Completed" ? null : a.eventType === "Error" && "message" in a ? /* @__PURE__ */
|
|
2942
|
+
return a.taskType === "StreamingChatCompletion" && a.eventType === "Completed" ? null : a.eventType === "Error" && "message" in a ? /* @__PURE__ */ i(Sr, { message: a.message }) : null;
|
|
2866
2943
|
};
|
|
2867
2944
|
if (e.length === 0)
|
|
2868
|
-
return /* @__PURE__ */
|
|
2945
|
+
return /* @__PURE__ */ i("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ i(
|
|
2869
2946
|
C,
|
|
2870
2947
|
{
|
|
2871
2948
|
text: r ?? n.processingYourTask,
|
|
@@ -2876,20 +2953,20 @@ const hr = ({
|
|
|
2876
2953
|
shimmerColor: "#000"
|
|
2877
2954
|
}
|
|
2878
2955
|
) });
|
|
2879
|
-
const
|
|
2880
|
-
const
|
|
2881
|
-
return
|
|
2882
|
-
(
|
|
2883
|
-
) :
|
|
2884
|
-
(
|
|
2885
|
-
) :
|
|
2886
|
-
(
|
|
2956
|
+
const m = e.filter((o, a) => {
|
|
2957
|
+
const u = o.item.data;
|
|
2958
|
+
return u.taskType === "MemoryChatCompletion" && u.eventType === "ExploreMemories" ? !e.slice(a + 1).some(
|
|
2959
|
+
(h) => h.item.data.taskType === "MemoryChatCompletion" && h.item.data.eventType === "ExploreMemories"
|
|
2960
|
+
) : u.taskType === "MemorySearch" && u.eventType === "GeneratingQueries" ? !e.slice(a + 1).some(
|
|
2961
|
+
(h) => h.item.data.taskType === "MemorySearch" && h.item.data.eventType === "GeneratingQueries"
|
|
2962
|
+
) : u.taskType === "MemorySearch" && u.eventType === "ExploreQueries" ? !e.slice(a + 1).some(
|
|
2963
|
+
(h) => h.item.data.taskType === "MemorySearch" && h.item.data.eventType === "ExploreQueries"
|
|
2887
2964
|
) : !0;
|
|
2888
2965
|
});
|
|
2889
|
-
return /* @__PURE__ */
|
|
2966
|
+
return /* @__PURE__ */ i("div", { id: "agent-task-progress-verbose", ref: s, children: /* @__PURE__ */ i(X, { children: m.map((o, a) => /* @__PURE__ */ i(
|
|
2890
2967
|
T.div,
|
|
2891
2968
|
{
|
|
2892
|
-
id: `agent-task-progress-item-${
|
|
2969
|
+
id: `agent-task-progress-item-${o.item.progressItemId}`,
|
|
2893
2970
|
initial: { opacity: 0, y: -20 },
|
|
2894
2971
|
animate: { opacity: 1, y: 0 },
|
|
2895
2972
|
transition: {
|
|
@@ -2897,42 +2974,42 @@ const hr = ({
|
|
|
2897
2974
|
delay: a * 0.1,
|
|
2898
2975
|
ease: "easeOut"
|
|
2899
2976
|
},
|
|
2900
|
-
children: d(
|
|
2977
|
+
children: d(o)
|
|
2901
2978
|
},
|
|
2902
|
-
|
|
2979
|
+
o.item.progressItemId
|
|
2903
2980
|
)) }) });
|
|
2904
2981
|
}, Ar = ({
|
|
2905
2982
|
agentTask: e,
|
|
2906
2983
|
mode: r = "verbose",
|
|
2907
2984
|
language: n,
|
|
2908
2985
|
onSourceClick: t,
|
|
2909
|
-
onSearchResultClick:
|
|
2910
|
-
onExploreQueryResultClick:
|
|
2986
|
+
onSearchResultClick: l,
|
|
2987
|
+
onExploreQueryResultClick: c
|
|
2911
2988
|
}) => {
|
|
2912
|
-
const
|
|
2913
|
-
return r === "simple" ? /* @__PURE__ */
|
|
2989
|
+
const s = De(e), d = (e.params.type === "MemoryChatCompletion" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : n ?? "en", m = Ne(d);
|
|
2990
|
+
return r === "simple" ? /* @__PURE__ */ i(
|
|
2914
2991
|
ze,
|
|
2915
2992
|
{
|
|
2916
|
-
progressViewItems:
|
|
2917
|
-
t:
|
|
2993
|
+
progressViewItems: s,
|
|
2994
|
+
t: m
|
|
2918
2995
|
}
|
|
2919
|
-
) : /* @__PURE__ */
|
|
2996
|
+
) : /* @__PURE__ */ i(
|
|
2920
2997
|
xr,
|
|
2921
2998
|
{
|
|
2922
|
-
progressViewItems:
|
|
2999
|
+
progressViewItems: s,
|
|
2923
3000
|
loadingText: e.loadingText,
|
|
2924
|
-
t:
|
|
3001
|
+
t: m,
|
|
2925
3002
|
onSourceClick: t,
|
|
2926
|
-
onSearchResultClick:
|
|
2927
|
-
onExploreQueryResultClick:
|
|
3003
|
+
onSearchResultClick: l,
|
|
3004
|
+
onExploreQueryResultClick: c
|
|
2928
3005
|
}
|
|
2929
3006
|
);
|
|
2930
3007
|
};
|
|
2931
3008
|
export {
|
|
2932
3009
|
Ar as AgentTaskProgress,
|
|
2933
3010
|
z as Checkmark,
|
|
2934
|
-
|
|
3011
|
+
Ir as FencyProvider,
|
|
2935
3012
|
fr as MemorySearchCompletedResults,
|
|
2936
3013
|
j as XMark,
|
|
2937
|
-
|
|
3014
|
+
Mr as useAgentTasks
|
|
2938
3015
|
};
|