@fencyai/react 0.1.173 → 0.1.174
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/AgentTaskProgressVerbose.d.ts.map +1 -1
- package/dist/agent-task/data-types/MemoryChatGoogleSearch.d.ts +14 -0
- package/dist/agent-task/data-types/MemoryChatGoogleSearch.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatGoogleSearchResult.d.ts +14 -0
- package/dist/agent-task/data-types/MemoryChatGoogleSearchResult.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatScrape.d.ts +14 -0
- package/dist/agent-task/data-types/MemoryChatScrape.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatScrapeResult.d.ts +14 -0
- package/dist/agent-task/data-types/MemoryChatScrapeResult.d.ts.map +1 -0
- package/dist/agent-task/translations.d.ts +11 -0
- package/dist/agent-task/translations.d.ts.map +1 -1
- package/dist/index.js +1198 -674
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createStream as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { motion as C, useInView as
|
|
5
|
-
import
|
|
6
|
-
import { Prism as
|
|
7
|
-
import
|
|
8
|
-
import './assets/index.css';const
|
|
1
|
+
import { jsxs as y, jsx as o, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { createStream as ue, isStreamTimeoutEvent as me, isStreamNotFoundEvent as pe, isAgentTaskProgressItemUpdatedEvent as ye, createAgentTask as ge } from "@fencyai/js";
|
|
3
|
+
import { createContext as he, useState as I, useRef as A, useEffect as F, useCallback as z, useContext as fe, useMemo as P } from "react";
|
|
4
|
+
import { motion as C, useInView as Se, AnimatePresence as xe } from "motion/react";
|
|
5
|
+
import ke from "react-markdown";
|
|
6
|
+
import { Prism as ae } from "react-syntax-highlighter";
|
|
7
|
+
import be from "remark-gfm";
|
|
8
|
+
import './assets/index.css';const se = he(
|
|
9
9
|
void 0
|
|
10
10
|
);
|
|
11
|
-
async function
|
|
11
|
+
async function ve(e, r) {
|
|
12
12
|
const t = e.getReader();
|
|
13
13
|
let n;
|
|
14
14
|
for (; !(n = await t.read()).done; )
|
|
15
15
|
r(n.value);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Te(e) {
|
|
18
18
|
let r, t, n, i = !1;
|
|
19
19
|
return function(a) {
|
|
20
|
-
r === void 0 ? (r = a, t = 0, n = -1) : r =
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
for (; t <
|
|
24
|
-
i && (r[t] === 10 && (
|
|
25
|
-
let
|
|
26
|
-
for (; t <
|
|
20
|
+
r === void 0 ? (r = a, t = 0, n = -1) : r = Ce(r, a);
|
|
21
|
+
const s = r.length;
|
|
22
|
+
let m = 0;
|
|
23
|
+
for (; t < s; ) {
|
|
24
|
+
i && (r[t] === 10 && (m = ++t), i = !1);
|
|
25
|
+
let p = -1;
|
|
26
|
+
for (; t < s && p === -1; ++t)
|
|
27
27
|
switch (r[t]) {
|
|
28
28
|
case 58:
|
|
29
|
-
n === -1 && (n = t -
|
|
29
|
+
n === -1 && (n = t - m);
|
|
30
30
|
break;
|
|
31
31
|
case 13:
|
|
32
32
|
i = !0;
|
|
33
33
|
case 10:
|
|
34
|
-
|
|
34
|
+
p = t;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
if (
|
|
37
|
+
if (p === -1)
|
|
38
38
|
break;
|
|
39
|
-
e(r.subarray(
|
|
39
|
+
e(r.subarray(m, p), n), m = t, n = -1;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
m === s ? r = void 0 : m !== 0 && (r = r.subarray(m), t -= m);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function we(e, r, t) {
|
|
45
45
|
let n = J();
|
|
46
46
|
const i = new TextDecoder();
|
|
47
|
-
return function(a,
|
|
47
|
+
return function(a, s) {
|
|
48
48
|
if (a.length === 0)
|
|
49
49
|
t == null || t(n), n = J();
|
|
50
|
-
else if (
|
|
51
|
-
const
|
|
52
|
-
switch (
|
|
50
|
+
else if (s > 0) {
|
|
51
|
+
const m = i.decode(a.subarray(0, s)), p = s + (a[s + 1] === 32 ? 2 : 1), c = i.decode(a.subarray(p));
|
|
52
|
+
switch (m) {
|
|
53
53
|
case "data":
|
|
54
54
|
n.data = n.data ? n.data + `
|
|
55
|
-
` +
|
|
55
|
+
` + c : c;
|
|
56
56
|
break;
|
|
57
57
|
case "event":
|
|
58
|
-
n.event =
|
|
58
|
+
n.event = c;
|
|
59
59
|
break;
|
|
60
60
|
case "id":
|
|
61
|
-
e(n.id =
|
|
61
|
+
e(n.id = c);
|
|
62
62
|
break;
|
|
63
63
|
case "retry":
|
|
64
|
-
const d = parseInt(
|
|
64
|
+
const d = parseInt(c, 10);
|
|
65
65
|
isNaN(d) || r(n.retry = d);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Ce(e, r) {
|
|
72
72
|
const t = new Uint8Array(e.length + r.length);
|
|
73
73
|
return t.set(e), t.set(r, e.length), t;
|
|
74
74
|
}
|
|
@@ -80,7 +80,7 @@ function J() {
|
|
|
80
80
|
retry: void 0
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var Ie = function(e, r) {
|
|
84
84
|
var t = {};
|
|
85
85
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
86
86
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -88,52 +88,52 @@ var we = function(e, r) {
|
|
|
88
88
|
r.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (t[n[i]] = e[n[i]]);
|
|
89
89
|
return t;
|
|
90
90
|
};
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
var { signal: t, headers: n, onopen: i, onmessage: l, onclose: a, onerror:
|
|
94
|
-
return new Promise((d,
|
|
91
|
+
const O = "text/event-stream", Ee = 1e3, Y = "last-event-id";
|
|
92
|
+
function Me(e, r) {
|
|
93
|
+
var { signal: t, headers: n, onopen: i, onmessage: l, onclose: a, onerror: s, openWhenHidden: m, fetch: p } = r, c = Ie(r, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
94
|
+
return new Promise((d, u) => {
|
|
95
95
|
const g = Object.assign({}, n);
|
|
96
|
-
g.accept || (g.accept =
|
|
97
|
-
let
|
|
96
|
+
g.accept || (g.accept = O);
|
|
97
|
+
let h;
|
|
98
98
|
function f() {
|
|
99
|
-
|
|
99
|
+
h.abort(), document.hidden || x();
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
let
|
|
103
|
-
function
|
|
104
|
-
document.removeEventListener("visibilitychange", f), window.clearTimeout(
|
|
101
|
+
m || document.addEventListener("visibilitychange", f);
|
|
102
|
+
let k = Ee, b = 0;
|
|
103
|
+
function v() {
|
|
104
|
+
document.removeEventListener("visibilitychange", f), window.clearTimeout(b), h.abort();
|
|
105
105
|
}
|
|
106
106
|
t == null || t.addEventListener("abort", () => {
|
|
107
|
-
|
|
107
|
+
v(), d();
|
|
108
108
|
});
|
|
109
|
-
const
|
|
110
|
-
async function
|
|
111
|
-
var
|
|
112
|
-
|
|
109
|
+
const T = p ?? window.fetch, w = i ?? Re;
|
|
110
|
+
async function x() {
|
|
111
|
+
var D;
|
|
112
|
+
h = new AbortController();
|
|
113
113
|
try {
|
|
114
|
-
const
|
|
115
|
-
await w(
|
|
114
|
+
const W = await T(e, Object.assign(Object.assign({}, c), { headers: g, signal: h.signal }));
|
|
115
|
+
await w(W), await ve(W.body, Te(we((R) => {
|
|
116
116
|
R ? g[Y] = R : delete g[Y];
|
|
117
117
|
}, (R) => {
|
|
118
|
-
|
|
119
|
-
}, l))), a == null || a(),
|
|
120
|
-
} catch (
|
|
121
|
-
if (!
|
|
118
|
+
k = R;
|
|
119
|
+
}, l))), a == null || a(), v(), d();
|
|
120
|
+
} catch (W) {
|
|
121
|
+
if (!h.signal.aborted)
|
|
122
122
|
try {
|
|
123
|
-
const R = (
|
|
124
|
-
window.clearTimeout(
|
|
123
|
+
const R = (D = s == null ? void 0 : s(W)) !== null && D !== void 0 ? D : k;
|
|
124
|
+
window.clearTimeout(b), b = window.setTimeout(x, R);
|
|
125
125
|
} catch (R) {
|
|
126
|
-
|
|
126
|
+
v(), u(R);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
x();
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Re(e) {
|
|
134
134
|
const r = e.headers.get("content-type");
|
|
135
|
-
if (!(r != null && r.startsWith(
|
|
136
|
-
throw new Error(`Expected content-type to be ${
|
|
135
|
+
if (!(r != null && r.startsWith(O)))
|
|
136
|
+
throw new Error(`Expected content-type to be ${O}, Actual: ${r}`);
|
|
137
137
|
}
|
|
138
138
|
function Z(e) {
|
|
139
139
|
const r = atob(e), t = new Uint8Array(r.length);
|
|
@@ -141,7 +141,7 @@ function Z(e) {
|
|
|
141
141
|
t[n] = r.charCodeAt(n);
|
|
142
142
|
return new TextDecoder("utf-8").decode(t);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function Fe() {
|
|
145
145
|
return `
|
|
146
146
|
var connections = new Map();
|
|
147
147
|
|
|
@@ -290,7 +290,7 @@ self.onmessage = function (e) {
|
|
|
290
290
|
function ee(e) {
|
|
291
291
|
return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown stream error";
|
|
292
292
|
}
|
|
293
|
-
class
|
|
293
|
+
class Ae {
|
|
294
294
|
constructor(r) {
|
|
295
295
|
this.activeConnections = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.worker = null, this.workerBlobUrl = null, this.workerSupported = !1, this.fency = r, this.tryInitWorker();
|
|
296
296
|
}
|
|
@@ -298,7 +298,7 @@ class Re {
|
|
|
298
298
|
try {
|
|
299
299
|
if (typeof Worker > "u" || typeof Blob > "u" || typeof URL > "u" || typeof URL.createObjectURL != "function" || typeof ReadableStream > "u")
|
|
300
300
|
return;
|
|
301
|
-
const r =
|
|
301
|
+
const r = Fe(), t = new Blob([r], { type: "application/javascript" }), n = URL.createObjectURL(t), i = new Worker(n);
|
|
302
302
|
i.onmessage = (l) => {
|
|
303
303
|
this.handleWorkerMessage(l.data);
|
|
304
304
|
}, i.onerror = (l) => {
|
|
@@ -342,7 +342,7 @@ class Re {
|
|
|
342
342
|
}
|
|
343
343
|
connectStreamInWorker(r) {
|
|
344
344
|
const t = r.stream.id, n = `${this.fency.baseUrl}/sse/streams/${t}`, i = new AbortController(), l = {
|
|
345
|
-
accept:
|
|
345
|
+
accept: O,
|
|
346
346
|
"X-Fency-Publishable-Key": this.fency.publishableKey,
|
|
347
347
|
"X-Fency-Stream-Token": r.stream.token
|
|
348
348
|
};
|
|
@@ -356,36 +356,36 @@ class Re {
|
|
|
356
356
|
async startWorkerStream(r, t, n, i) {
|
|
357
357
|
const l = this.worker;
|
|
358
358
|
if (!l) return;
|
|
359
|
-
const a = (
|
|
360
|
-
i.signal.aborted || (this.activeConnections.delete(r), this.broadcastError(r,
|
|
359
|
+
const a = (s) => {
|
|
360
|
+
i.signal.aborted || (this.activeConnections.delete(r), this.broadcastError(r, s));
|
|
361
361
|
};
|
|
362
362
|
try {
|
|
363
|
-
const
|
|
363
|
+
const s = await fetch(t, {
|
|
364
364
|
method: "GET",
|
|
365
365
|
headers: n,
|
|
366
366
|
signal: i.signal
|
|
367
367
|
});
|
|
368
|
-
if (!
|
|
369
|
-
|
|
368
|
+
if (!s.ok) {
|
|
369
|
+
s.status >= 400 && s.status < 500 && s.status !== 429 ? a(`Client error ${s.status}`) : a(`HTTP ${s.status}`);
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
|
-
const
|
|
373
|
-
if (!
|
|
372
|
+
const m = s.body;
|
|
373
|
+
if (!m) {
|
|
374
374
|
a("No response body");
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
377
377
|
if (!this.activeConnections.has(r)) {
|
|
378
|
-
await
|
|
378
|
+
await m.cancel().catch(() => {
|
|
379
379
|
});
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
382
|
l.postMessage(
|
|
383
|
-
{ command: "start", streamId: r, readableStream:
|
|
384
|
-
[
|
|
383
|
+
{ command: "start", streamId: r, readableStream: m },
|
|
384
|
+
[m]
|
|
385
385
|
);
|
|
386
|
-
} catch (
|
|
386
|
+
} catch (s) {
|
|
387
387
|
if (i.signal.aborted) return;
|
|
388
|
-
a(ee(
|
|
388
|
+
a(ee(s));
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
connectStreamOnMainThread(r) {
|
|
@@ -397,7 +397,7 @@ class Re {
|
|
|
397
397
|
"X-Fency-Publishable-Key": this.fency.publishableKey,
|
|
398
398
|
"X-Fency-Stream-Token": r.stream.token
|
|
399
399
|
};
|
|
400
|
-
|
|
400
|
+
Me(i, {
|
|
401
401
|
headers: l,
|
|
402
402
|
signal: n.signal,
|
|
403
403
|
openWhenHidden: !0,
|
|
@@ -407,8 +407,8 @@ class Re {
|
|
|
407
407
|
},
|
|
408
408
|
onmessage: (a) => {
|
|
409
409
|
if (a.data) {
|
|
410
|
-
const
|
|
411
|
-
this.broadcast(
|
|
410
|
+
const s = Z(a.data);
|
|
411
|
+
this.broadcast(s, t);
|
|
412
412
|
}
|
|
413
413
|
},
|
|
414
414
|
onerror: (a) => {
|
|
@@ -451,99 +451,99 @@ class Re {
|
|
|
451
451
|
this.workerBlobUrl && (URL.revokeObjectURL(this.workerBlobUrl), this.workerBlobUrl = null), this.workerSupported = !1, this.subscribers.clear();
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
const
|
|
454
|
+
const Le = 48e4, Pe = 3e5, re = (e) => {
|
|
455
455
|
const r = Date.now();
|
|
456
|
-
return e.filter((t) => r - t.createdAt <
|
|
456
|
+
return e.filter((t) => r - t.createdAt < Le);
|
|
457
457
|
};
|
|
458
|
-
function
|
|
458
|
+
function Ur({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
|
|
459
459
|
const [n, i] = I(
|
|
460
460
|
null
|
|
461
|
-
), [l, a] = I(!0), [
|
|
462
|
-
|
|
463
|
-
e.then((
|
|
464
|
-
i(
|
|
465
|
-
}).catch((
|
|
466
|
-
|
|
461
|
+
), [l, a] = I(!0), [s, m] = I(null), [p, c] = I([]), d = A(null), u = A(null);
|
|
462
|
+
F(() => {
|
|
463
|
+
e.then((k) => {
|
|
464
|
+
i(k), a(!1);
|
|
465
|
+
}).catch((k) => {
|
|
466
|
+
m(k), a(!1);
|
|
467
467
|
});
|
|
468
|
-
}, [e]),
|
|
469
|
-
n && !
|
|
470
|
-
}, [n]),
|
|
471
|
-
|
|
472
|
-
}, [
|
|
473
|
-
var
|
|
474
|
-
(
|
|
475
|
-
}, []),
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
return
|
|
468
|
+
}, [e]), F(() => {
|
|
469
|
+
n && !u.current && (u.current = new Ae(n));
|
|
470
|
+
}, [n]), F(() => {
|
|
471
|
+
u.current && u.current.updateStreams(p);
|
|
472
|
+
}, [p]), F(() => () => {
|
|
473
|
+
var k;
|
|
474
|
+
(k = u.current) == null || k.cleanup();
|
|
475
|
+
}, []), F(() => {
|
|
476
|
+
const k = setInterval(() => {
|
|
477
|
+
c((b) => {
|
|
478
|
+
const v = re(b);
|
|
479
|
+
return v.length !== b.length ? v : b;
|
|
480
480
|
});
|
|
481
481
|
}, 6e4);
|
|
482
|
-
return () => clearInterval(
|
|
482
|
+
return () => clearInterval(k);
|
|
483
483
|
}, []);
|
|
484
|
-
const g =
|
|
485
|
-
async (
|
|
484
|
+
const g = z(
|
|
485
|
+
async (k = Pe) => {
|
|
486
486
|
if (d.current)
|
|
487
487
|
return d.current;
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
return
|
|
491
|
-
const
|
|
488
|
+
const b = Date.now(), v = p.length > 0 ? p[p.length - 1] : null;
|
|
489
|
+
if (v && b - v.createdAt < k)
|
|
490
|
+
return v.stream;
|
|
491
|
+
const T = (async () => {
|
|
492
492
|
if (!n)
|
|
493
493
|
throw new Error("Fency instance not initialized");
|
|
494
|
-
const w = await r(),
|
|
494
|
+
const w = await r(), x = await ue({
|
|
495
495
|
pk: n.publishableKey,
|
|
496
496
|
baseUrl: n.baseUrl,
|
|
497
497
|
clientToken: (w == null ? void 0 : w.clientToken) ?? ""
|
|
498
498
|
});
|
|
499
|
-
if (
|
|
500
|
-
const
|
|
501
|
-
stream:
|
|
499
|
+
if (x.type === "success") {
|
|
500
|
+
const D = {
|
|
501
|
+
stream: x.stream,
|
|
502
502
|
createdAt: Date.now()
|
|
503
503
|
};
|
|
504
|
-
return
|
|
505
|
-
const R = [...
|
|
504
|
+
return c((W) => {
|
|
505
|
+
const R = [...W, D];
|
|
506
506
|
return re(R);
|
|
507
|
-
}), d.current = null,
|
|
507
|
+
}), d.current = null, x.stream;
|
|
508
508
|
} else
|
|
509
509
|
throw d.current = null, new Error("Failed to create stream");
|
|
510
510
|
})();
|
|
511
|
-
return d.current =
|
|
511
|
+
return d.current = T, T;
|
|
512
512
|
},
|
|
513
|
-
[n,
|
|
513
|
+
[n, p]
|
|
514
514
|
);
|
|
515
|
-
if (
|
|
516
|
-
return /* @__PURE__ */
|
|
515
|
+
if (s)
|
|
516
|
+
return /* @__PURE__ */ y("div", { children: [
|
|
517
517
|
"Fency error: ",
|
|
518
|
-
|
|
518
|
+
s.message
|
|
519
519
|
] });
|
|
520
520
|
if (!n)
|
|
521
521
|
return null;
|
|
522
|
-
const
|
|
522
|
+
const h = p.length > 0 ? p[p.length - 1] : null, f = {
|
|
523
523
|
fency: n,
|
|
524
524
|
loading: l,
|
|
525
|
-
error:
|
|
526
|
-
activeStreams:
|
|
527
|
-
latestStream:
|
|
528
|
-
eventManager:
|
|
525
|
+
error: s,
|
|
526
|
+
activeStreams: p,
|
|
527
|
+
latestStream: h,
|
|
528
|
+
eventManager: u.current,
|
|
529
529
|
getOrCreateStream: g
|
|
530
530
|
};
|
|
531
|
-
return /* @__PURE__ */ o(
|
|
531
|
+
return /* @__PURE__ */ o(se.Provider, { value: f, children: t });
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const e =
|
|
533
|
+
function le() {
|
|
534
|
+
const e = fe(se);
|
|
535
535
|
if (e === void 0)
|
|
536
536
|
throw new Error("useFencyContext must be used within a FencyProvider");
|
|
537
537
|
return e;
|
|
538
538
|
}
|
|
539
|
-
const
|
|
539
|
+
const De = (e) => {
|
|
540
540
|
try {
|
|
541
541
|
const r = JSON.parse(e);
|
|
542
|
-
return
|
|
542
|
+
return We(r);
|
|
543
543
|
} catch (r) {
|
|
544
544
|
return console.error("Error parsing message:", r), null;
|
|
545
545
|
}
|
|
546
|
-
},
|
|
546
|
+
}, We = (e) => me(e) ? ze(e) : pe(e) ? Be(e) : ye(e) ? Oe(e) : null, ze = (e) => ({
|
|
547
547
|
type: "STREAM_TIMEOUT",
|
|
548
548
|
streamId: e.streamId,
|
|
549
549
|
timestamp: e.timestamp
|
|
@@ -559,34 +559,34 @@ const Le = (e) => {
|
|
|
559
559
|
timestamp: e.timestamp,
|
|
560
560
|
createdAt: e.createdAt,
|
|
561
561
|
data: JSON.parse(e.data)
|
|
562
|
-
}),
|
|
563
|
-
const r =
|
|
564
|
-
return
|
|
562
|
+
}), $e = (e) => {
|
|
563
|
+
const r = le(), [t, n] = I(null), i = A(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
|
|
564
|
+
return F(() => {
|
|
565
565
|
if (!r.eventManager) return;
|
|
566
566
|
const a = {
|
|
567
|
-
onMessage: (
|
|
568
|
-
var d,
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
-
switch (
|
|
567
|
+
onMessage: (m, p) => {
|
|
568
|
+
var d, u, g;
|
|
569
|
+
const c = De(m);
|
|
570
|
+
if (c)
|
|
571
|
+
switch (c.type) {
|
|
572
572
|
case "STREAM_TIMEOUT":
|
|
573
|
-
(d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e,
|
|
573
|
+
(d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e, c);
|
|
574
574
|
break;
|
|
575
575
|
case "STREAM_NOT_FOUND":
|
|
576
|
-
(
|
|
576
|
+
(u = e == null ? void 0 : e.onStreamNotFound) == null || u.call(e, c);
|
|
577
577
|
break;
|
|
578
578
|
case "AGENT_TASK_PROGRESS_ITEM_UPDATED":
|
|
579
|
-
(g = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || g.call(e,
|
|
579
|
+
(g = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || g.call(e, c);
|
|
580
580
|
break;
|
|
581
581
|
}
|
|
582
582
|
},
|
|
583
|
-
onError: (
|
|
584
|
-
var
|
|
585
|
-
(
|
|
586
|
-
streamId:
|
|
583
|
+
onError: (m, p) => {
|
|
584
|
+
var c;
|
|
585
|
+
(c = e == null ? void 0 : e.onStreamError) == null || c.call(e, {
|
|
586
|
+
streamId: m,
|
|
587
587
|
error: {
|
|
588
588
|
code: "UnknownError",
|
|
589
|
-
message:
|
|
589
|
+
message: p ?? "Unknown error in useStream"
|
|
590
590
|
}
|
|
591
591
|
});
|
|
592
592
|
}
|
|
@@ -615,200 +615,200 @@ const Le = (e) => {
|
|
|
615
615
|
},
|
|
616
616
|
stream: t
|
|
617
617
|
};
|
|
618
|
-
},
|
|
619
|
-
const r =
|
|
620
|
-
(
|
|
621
|
-
n((
|
|
622
|
-
const g = [],
|
|
623
|
-
var
|
|
624
|
-
if (f.streamId !==
|
|
625
|
-
const
|
|
626
|
-
return
|
|
618
|
+
}, _r = (e) => {
|
|
619
|
+
const r = le(), [t, n] = I([]), i = A(/* @__PURE__ */ new Set()), l = A(/* @__PURE__ */ new Map()), a = z(
|
|
620
|
+
(c, d) => {
|
|
621
|
+
n((u) => {
|
|
622
|
+
const g = [], h = u.map((f) => {
|
|
623
|
+
var b;
|
|
624
|
+
if (f.streamId !== c || !f.loading) return f;
|
|
625
|
+
const k = (b = f.confirmedData) == null ? void 0 : b.taskId;
|
|
626
|
+
return k && g.push(k), { ...f, loading: !1, error: d };
|
|
627
627
|
});
|
|
628
628
|
for (const f of g) {
|
|
629
629
|
i.current.delete(f);
|
|
630
|
-
const
|
|
631
|
-
|
|
630
|
+
const k = l.current.get(f);
|
|
631
|
+
k && (l.current.delete(f), k({ type: "error", error: d }));
|
|
632
632
|
}
|
|
633
|
-
return
|
|
633
|
+
return h;
|
|
634
634
|
});
|
|
635
635
|
},
|
|
636
636
|
[]
|
|
637
|
-
), { createStream:
|
|
638
|
-
onAgentTaskProgressItemUpdated: (
|
|
637
|
+
), { createStream: s } = $e({
|
|
638
|
+
onAgentTaskProgressItemUpdated: (c) => {
|
|
639
639
|
var g;
|
|
640
|
-
if (!i.current.has(
|
|
641
|
-
const d =
|
|
640
|
+
if (!i.current.has(c.agentTaskId)) return;
|
|
641
|
+
const d = c.data;
|
|
642
642
|
if (d.taskType === "StreamingChatCompletion" && d.eventType === "Completed" || d.taskType === "StructuredChatCompletion" && d.eventType === "Completed" || d.taskType === "MemoryChat" && d.eventType === "Completed" || d.taskType === "MemorySearch" && d.eventType === "Completed") {
|
|
643
|
-
const
|
|
643
|
+
const h = d.taskType === "MemorySearch" && d.eventType === "Completed" || d.taskType === "StructuredChatCompletion" && d.eventType === "Completed";
|
|
644
644
|
n(
|
|
645
|
-
|
|
645
|
+
h ? (k) => k.map((b) => {
|
|
646
646
|
var w;
|
|
647
|
-
if (((w =
|
|
648
|
-
return
|
|
649
|
-
const
|
|
650
|
-
(
|
|
651
|
-
) ?
|
|
652
|
-
(
|
|
653
|
-
) : [...
|
|
647
|
+
if (((w = b.confirmedData) == null ? void 0 : w.taskId) !== c.agentTaskId)
|
|
648
|
+
return b;
|
|
649
|
+
const T = b.progressItems.some(
|
|
650
|
+
(x) => x.progressItemId === c.progressItemId
|
|
651
|
+
) ? b.progressItems.map(
|
|
652
|
+
(x) => x.progressItemId === c.progressItemId ? c : x
|
|
653
|
+
) : [...b.progressItems, c];
|
|
654
654
|
return {
|
|
655
|
-
...
|
|
656
|
-
progressItems:
|
|
655
|
+
...b,
|
|
656
|
+
progressItems: T,
|
|
657
657
|
loading: !1
|
|
658
658
|
};
|
|
659
|
-
}) : (
|
|
660
|
-
(
|
|
661
|
-
var
|
|
662
|
-
return ((
|
|
659
|
+
}) : (k) => k.map(
|
|
660
|
+
(b) => {
|
|
661
|
+
var v;
|
|
662
|
+
return ((v = b.confirmedData) == null ? void 0 : v.taskId) === c.agentTaskId ? { ...b, loading: !1 } : b;
|
|
663
663
|
}
|
|
664
664
|
)
|
|
665
665
|
);
|
|
666
666
|
const f = l.current.get(
|
|
667
|
-
|
|
667
|
+
c.agentTaskId
|
|
668
668
|
);
|
|
669
|
-
f && (l.current.delete(
|
|
669
|
+
f && (l.current.delete(c.agentTaskId), f({
|
|
670
670
|
type: "success",
|
|
671
|
-
streamId:
|
|
672
|
-
agentTaskId:
|
|
671
|
+
streamId: c.streamId,
|
|
672
|
+
agentTaskId: c.agentTaskId,
|
|
673
673
|
response: d
|
|
674
674
|
}));
|
|
675
675
|
return;
|
|
676
676
|
}
|
|
677
|
-
(g = e.onAgentTaskProgressItemUpdated) == null || g.call(e,
|
|
678
|
-
(
|
|
679
|
-
var
|
|
680
|
-
if (((
|
|
677
|
+
(g = e.onAgentTaskProgressItemUpdated) == null || g.call(e, c), n(
|
|
678
|
+
(h) => h.map((f) => {
|
|
679
|
+
var v;
|
|
680
|
+
if (((v = f.confirmedData) == null ? void 0 : v.taskId) !== c.agentTaskId)
|
|
681
681
|
return f;
|
|
682
|
-
const
|
|
683
|
-
(
|
|
682
|
+
const b = f.progressItems.some(
|
|
683
|
+
(T) => T.progressItemId === c.progressItemId
|
|
684
684
|
) ? f.progressItems.map(
|
|
685
|
-
(
|
|
686
|
-
) : [...f.progressItems,
|
|
687
|
-
return { ...f, progressItems:
|
|
685
|
+
(T) => T.progressItemId === c.progressItemId ? c : T
|
|
686
|
+
) : [...f.progressItems, c];
|
|
687
|
+
return { ...f, progressItems: b };
|
|
688
688
|
})
|
|
689
689
|
);
|
|
690
690
|
},
|
|
691
|
-
onStreamError: (
|
|
691
|
+
onStreamError: (c) => {
|
|
692
692
|
var d;
|
|
693
|
-
(d = e == null ? void 0 : e.onStreamError) == null || d.call(e,
|
|
693
|
+
(d = e == null ? void 0 : e.onStreamError) == null || d.call(e, c), a(c.streamId, c.error);
|
|
694
694
|
},
|
|
695
|
-
onStreamNotFound: (
|
|
695
|
+
onStreamNotFound: (c) => {
|
|
696
696
|
var d;
|
|
697
|
-
(d = e == null ? void 0 : e.onStreamNotFound) == null || d.call(e,
|
|
697
|
+
(d = e == null ? void 0 : e.onStreamNotFound) == null || d.call(e, c), a(c.streamId, {
|
|
698
698
|
code: "StreamNotFound",
|
|
699
699
|
message: "Stream not found"
|
|
700
700
|
});
|
|
701
701
|
},
|
|
702
|
-
onStreamTimeout: (
|
|
702
|
+
onStreamTimeout: (c) => {
|
|
703
703
|
var d;
|
|
704
|
-
(d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e,
|
|
704
|
+
(d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e, c), a(c.streamId, {
|
|
705
705
|
code: "StreamTimeout",
|
|
706
706
|
message: "Stream timed out"
|
|
707
707
|
});
|
|
708
708
|
}
|
|
709
|
-
}),
|
|
710
|
-
async (
|
|
709
|
+
}), m = z(
|
|
710
|
+
async (c, d) => {
|
|
711
711
|
var f;
|
|
712
|
-
const
|
|
712
|
+
const u = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, g = (d == null ? void 0 : d.fetchCreateAgentTaskClientToken) ?? e.fetchCreateAgentTaskClientToken;
|
|
713
713
|
if (g === void 0)
|
|
714
714
|
throw new Error(
|
|
715
715
|
"fetchCreateAgentTaskClientToken must be provided either in useAgentTasks props or in createAgentTask options"
|
|
716
716
|
);
|
|
717
|
-
const
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
720
|
-
taskKey:
|
|
721
|
-
streamId:
|
|
722
|
-
triggeredAt:
|
|
717
|
+
const h = await s();
|
|
718
|
+
if (h.type === "success") {
|
|
719
|
+
const k = (/* @__PURE__ */ new Date()).toISOString(), b = {
|
|
720
|
+
taskKey: u,
|
|
721
|
+
streamId: h.stream.id,
|
|
722
|
+
triggeredAt: k,
|
|
723
723
|
confirmedData: null,
|
|
724
724
|
error: null,
|
|
725
|
-
params:
|
|
725
|
+
params: c,
|
|
726
726
|
progressItems: [],
|
|
727
727
|
loading: !0,
|
|
728
728
|
loadingText: d == null ? void 0 : d.loadingText
|
|
729
729
|
};
|
|
730
|
-
n((
|
|
730
|
+
n((v) => [...v, b]), (f = d == null ? void 0 : d.onTaskRegistered) == null || f.call(d, b);
|
|
731
731
|
try {
|
|
732
|
-
const { clientToken:
|
|
732
|
+
const { clientToken: v } = await g(), T = await ge({
|
|
733
733
|
pk: r.fency.publishableKey,
|
|
734
734
|
baseUrl: r.fency.baseUrl,
|
|
735
|
-
clientToken:
|
|
736
|
-
streamToken:
|
|
735
|
+
clientToken: v,
|
|
736
|
+
streamToken: h.stream.token,
|
|
737
737
|
request: {
|
|
738
|
-
streamingChatCompletionTask:
|
|
739
|
-
messages:
|
|
740
|
-
model:
|
|
741
|
-
...
|
|
742
|
-
temperature:
|
|
738
|
+
streamingChatCompletionTask: c.type === "StreamingChatCompletion" ? {
|
|
739
|
+
messages: c.messages,
|
|
740
|
+
model: c.model,
|
|
741
|
+
...c.temperature !== void 0 ? {
|
|
742
|
+
temperature: c.temperature
|
|
743
743
|
} : {},
|
|
744
|
-
...
|
|
744
|
+
...c.topP !== void 0 ? { topP: c.topP } : {}
|
|
745
745
|
} : void 0,
|
|
746
|
-
structuredChatCompletionTask:
|
|
747
|
-
messages:
|
|
748
|
-
jsonSchema:
|
|
749
|
-
model:
|
|
750
|
-
...
|
|
751
|
-
temperature:
|
|
746
|
+
structuredChatCompletionTask: c.type === "StructuredChatCompletion" ? {
|
|
747
|
+
messages: c.messages,
|
|
748
|
+
jsonSchema: c.jsonSchema,
|
|
749
|
+
model: c.model,
|
|
750
|
+
...c.temperature !== void 0 ? {
|
|
751
|
+
temperature: c.temperature
|
|
752
752
|
} : {},
|
|
753
|
-
...
|
|
753
|
+
...c.topP !== void 0 ? { topP: c.topP } : {}
|
|
754
754
|
} : void 0,
|
|
755
|
-
memoryChatTask:
|
|
756
|
-
messages:
|
|
757
|
-
model:
|
|
758
|
-
language:
|
|
759
|
-
chunkLimit:
|
|
760
|
-
memoryScanLimit:
|
|
755
|
+
memoryChatTask: c.type === "MemoryChat" ? {
|
|
756
|
+
messages: c.messages,
|
|
757
|
+
model: c.model,
|
|
758
|
+
language: c.language ?? "en",
|
|
759
|
+
chunkLimit: c.chunkLimit ?? 10,
|
|
760
|
+
memoryScanLimit: c.memoryScanLimit ?? 3
|
|
761
761
|
} : void 0,
|
|
762
|
-
memorySearchTask:
|
|
763
|
-
query:
|
|
764
|
-
model:
|
|
765
|
-
language:
|
|
766
|
-
chunkLimit:
|
|
767
|
-
contextExpansion:
|
|
768
|
-
...
|
|
769
|
-
queryExpansion:
|
|
762
|
+
memorySearchTask: c.type === "MemorySearch" ? {
|
|
763
|
+
query: c.query,
|
|
764
|
+
model: c.model,
|
|
765
|
+
language: c.language ?? "en",
|
|
766
|
+
chunkLimit: c.chunkLimit ?? 10,
|
|
767
|
+
contextExpansion: c.contextExpansion,
|
|
768
|
+
...c.queryExpansion != null ? {
|
|
769
|
+
queryExpansion: c.queryExpansion
|
|
770
770
|
} : {}
|
|
771
771
|
} : void 0
|
|
772
772
|
}
|
|
773
773
|
});
|
|
774
|
-
if (
|
|
774
|
+
if (T.type === "success" && T.agentTask)
|
|
775
775
|
return i.current.add(
|
|
776
|
-
|
|
776
|
+
T.agentTask.id
|
|
777
777
|
), n((w) => [
|
|
778
|
-
...w.filter((
|
|
778
|
+
...w.filter((x) => x.taskKey !== u),
|
|
779
779
|
{
|
|
780
|
-
taskKey:
|
|
781
|
-
streamId:
|
|
780
|
+
taskKey: u,
|
|
781
|
+
streamId: h.stream.id,
|
|
782
782
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
783
|
-
taskId:
|
|
784
|
-
createdAt:
|
|
783
|
+
taskId: T.agentTask.id,
|
|
784
|
+
createdAt: T.agentTask.createdAt,
|
|
785
785
|
error: null,
|
|
786
|
-
params:
|
|
786
|
+
params: c,
|
|
787
787
|
progressItems: [],
|
|
788
788
|
loading: !0,
|
|
789
789
|
loadingText: d == null ? void 0 : d.loadingText,
|
|
790
790
|
confirmedData: {
|
|
791
|
-
taskId:
|
|
792
|
-
createdAt:
|
|
791
|
+
taskId: T.agentTask.id,
|
|
792
|
+
createdAt: T.agentTask.createdAt
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
]), await new Promise(
|
|
796
796
|
(w) => {
|
|
797
797
|
l.current.set(
|
|
798
|
-
|
|
798
|
+
T.agentTask.id,
|
|
799
799
|
w
|
|
800
800
|
);
|
|
801
801
|
}
|
|
802
802
|
);
|
|
803
|
-
if (
|
|
803
|
+
if (T.type === "error")
|
|
804
804
|
return n((w) => [
|
|
805
|
-
...w.filter((
|
|
805
|
+
...w.filter((x) => x.taskKey !== u),
|
|
806
806
|
{
|
|
807
|
-
taskKey:
|
|
807
|
+
taskKey: u,
|
|
808
808
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
809
|
-
streamId:
|
|
810
|
-
params:
|
|
811
|
-
error:
|
|
809
|
+
streamId: h.stream.id,
|
|
810
|
+
params: c,
|
|
811
|
+
error: T.error,
|
|
812
812
|
progressItems: [],
|
|
813
813
|
loading: !1,
|
|
814
814
|
loadingText: d == null ? void 0 : d.loadingText,
|
|
@@ -816,21 +816,21 @@ const Le = (e) => {
|
|
|
816
816
|
}
|
|
817
817
|
]), {
|
|
818
818
|
type: "error",
|
|
819
|
-
error:
|
|
819
|
+
error: T.error
|
|
820
820
|
};
|
|
821
821
|
{
|
|
822
822
|
const w = {
|
|
823
823
|
message: "No response received",
|
|
824
824
|
code: "UnknownError"
|
|
825
825
|
};
|
|
826
|
-
return n((
|
|
827
|
-
...
|
|
826
|
+
return n((x) => [
|
|
827
|
+
...x.filter((D) => D.taskKey !== u),
|
|
828
828
|
{
|
|
829
|
-
taskKey:
|
|
829
|
+
taskKey: u,
|
|
830
830
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
831
|
-
streamId:
|
|
831
|
+
streamId: h.stream.id,
|
|
832
832
|
error: w,
|
|
833
|
-
params:
|
|
833
|
+
params: c,
|
|
834
834
|
progressItems: [],
|
|
835
835
|
loading: !1,
|
|
836
836
|
loadingText: d == null ? void 0 : d.loadingText,
|
|
@@ -841,19 +841,19 @@ const Le = (e) => {
|
|
|
841
841
|
error: w
|
|
842
842
|
};
|
|
843
843
|
}
|
|
844
|
-
} catch (
|
|
845
|
-
const
|
|
844
|
+
} catch (v) {
|
|
845
|
+
const T = {
|
|
846
846
|
code: "UnknownError",
|
|
847
|
-
message:
|
|
847
|
+
message: v instanceof Error ? v.message : "Unknown error during agent task creation"
|
|
848
848
|
};
|
|
849
849
|
return n((w) => [
|
|
850
|
-
...w.filter((
|
|
850
|
+
...w.filter((x) => x.taskKey !== u),
|
|
851
851
|
{
|
|
852
|
-
taskKey:
|
|
852
|
+
taskKey: u,
|
|
853
853
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
854
|
-
streamId:
|
|
855
|
-
params:
|
|
856
|
-
error:
|
|
854
|
+
streamId: h.stream.id,
|
|
855
|
+
params: c,
|
|
856
|
+
error: T,
|
|
857
857
|
progressItems: [],
|
|
858
858
|
loading: !1,
|
|
859
859
|
loadingText: d == null ? void 0 : d.loadingText,
|
|
@@ -861,37 +861,37 @@ const Le = (e) => {
|
|
|
861
861
|
}
|
|
862
862
|
]), {
|
|
863
863
|
type: "error",
|
|
864
|
-
error:
|
|
864
|
+
error: T
|
|
865
865
|
};
|
|
866
866
|
}
|
|
867
867
|
} else
|
|
868
|
-
return console.error(
|
|
868
|
+
return console.error(h.error), h;
|
|
869
869
|
},
|
|
870
870
|
[
|
|
871
871
|
r,
|
|
872
|
-
|
|
872
|
+
s,
|
|
873
873
|
e.fetchCreateAgentTaskClientToken,
|
|
874
874
|
a
|
|
875
875
|
]
|
|
876
|
-
),
|
|
876
|
+
), p = P(() => {
|
|
877
877
|
if (t.length !== 0)
|
|
878
|
-
return [...t].sort((
|
|
878
|
+
return [...t].sort((c, d) => new Date(d.triggeredAt).getTime() - new Date(c.triggeredAt).getTime())[0];
|
|
879
879
|
}, [t]);
|
|
880
|
-
return
|
|
880
|
+
return F(() => () => {
|
|
881
881
|
i.current.clear(), l.current.clear();
|
|
882
882
|
}, []), {
|
|
883
883
|
agentTasks: t,
|
|
884
|
-
createAgentTask:
|
|
885
|
-
latest:
|
|
884
|
+
createAgentTask: m,
|
|
885
|
+
latest: p
|
|
886
886
|
};
|
|
887
887
|
};
|
|
888
|
-
function
|
|
888
|
+
function Ne(e) {
|
|
889
889
|
return e.progressItems.map((r, t) => {
|
|
890
890
|
const n = e.progressItems[t + 1], i = n != null;
|
|
891
891
|
let l;
|
|
892
892
|
if (n != null && n.createdAt) {
|
|
893
|
-
const a = new Date(r.createdAt).getTime(),
|
|
894
|
-
l = Math.round((
|
|
893
|
+
const a = new Date(r.createdAt).getTime(), s = new Date(n.createdAt).getTime();
|
|
894
|
+
l = Math.round((s - a) / 1e3);
|
|
895
895
|
}
|
|
896
896
|
return {
|
|
897
897
|
item: r,
|
|
@@ -901,7 +901,7 @@ function ze(e) {
|
|
|
901
901
|
};
|
|
902
902
|
});
|
|
903
903
|
}
|
|
904
|
-
const
|
|
904
|
+
const ce = {
|
|
905
905
|
'code[class*="language-"]': {
|
|
906
906
|
color: "#f8f8f2",
|
|
907
907
|
background: "none",
|
|
@@ -1062,22 +1062,22 @@ const se = {
|
|
|
1062
1062
|
animate: { opacity: 1, y: 0 },
|
|
1063
1063
|
transition: { duration: 0.3, delay: 0 },
|
|
1064
1064
|
children: /* @__PURE__ */ o(
|
|
1065
|
-
|
|
1065
|
+
ke,
|
|
1066
1066
|
{
|
|
1067
|
-
remarkPlugins: [
|
|
1067
|
+
remarkPlugins: [be],
|
|
1068
1068
|
components: {
|
|
1069
1069
|
code(r) {
|
|
1070
|
-
const { children: t, className: n, node: i, ref: l, ...a } = r,
|
|
1071
|
-
return
|
|
1070
|
+
const { children: t, className: n, node: i, ref: l, ...a } = r, s = /language-(\w+)/.exec(n || "");
|
|
1071
|
+
return s ? (
|
|
1072
1072
|
// @ts-expect-error react-syntax-highlighter types incompatible with @types/react 18
|
|
1073
1073
|
/* @__PURE__ */ o(
|
|
1074
|
-
|
|
1074
|
+
ae,
|
|
1075
1075
|
{
|
|
1076
1076
|
...a,
|
|
1077
1077
|
PreTag: "div",
|
|
1078
1078
|
children: String(t).replace(/\n$/, ""),
|
|
1079
|
-
language:
|
|
1080
|
-
style:
|
|
1079
|
+
language: s[1],
|
|
1080
|
+
style: ce
|
|
1081
1081
|
}
|
|
1082
1082
|
)
|
|
1083
1083
|
) : /* @__PURE__ */ o("code", { ...a, className: n, children: String(t) });
|
|
@@ -1087,7 +1087,7 @@ const se = {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
)
|
|
1089
1089
|
}
|
|
1090
|
-
) }),
|
|
1090
|
+
) }), He = ({ data: e }) => {
|
|
1091
1091
|
const r = JSON.stringify(
|
|
1092
1092
|
JSON.parse(e.response.jsonResponse),
|
|
1093
1093
|
null,
|
|
@@ -1099,10 +1099,10 @@ const se = {
|
|
|
1099
1099
|
initial: { opacity: 0, y: -10 },
|
|
1100
1100
|
animate: { opacity: 1, y: 0 },
|
|
1101
1101
|
transition: { duration: 0.3, delay: 0 },
|
|
1102
|
-
children: /* @__PURE__ */ o(
|
|
1102
|
+
children: /* @__PURE__ */ o(ae, { language: "json", style: ce, PreTag: "div", children: r })
|
|
1103
1103
|
}
|
|
1104
1104
|
) });
|
|
1105
|
-
},
|
|
1105
|
+
}, Ge = {
|
|
1106
1106
|
en: {
|
|
1107
1107
|
error: "Error",
|
|
1108
1108
|
streaming: "Streaming...",
|
|
@@ -1162,7 +1162,18 @@ const se = {
|
|
|
1162
1162
|
memorySearchHideExploreResults: "Hide results",
|
|
1163
1163
|
memorySearchExploreNoResults: "No results found",
|
|
1164
1164
|
memoryChatChunkResultsInMemories: "in {n} memories",
|
|
1165
|
-
memoryChatChunkResultsInOneMemory: "in 1 memory"
|
|
1165
|
+
memoryChatChunkResultsInOneMemory: "in 1 memory",
|
|
1166
|
+
googleSearchingFor: "Searching Google for '{query}'",
|
|
1167
|
+
googleSearchingForWithCountry: "Searching Google ({country}) for '{query}'",
|
|
1168
|
+
googleResultsFound: "{n} Google results found",
|
|
1169
|
+
googleResultFound: "1 Google result found",
|
|
1170
|
+
scrapingPages: "Scraping {n} pages for '{query}'",
|
|
1171
|
+
scrapingPage: "Scraping 1 page for '{query}'",
|
|
1172
|
+
scrapedPages: "Scraped {n} pages",
|
|
1173
|
+
scrapedPage: "Scraped 1 page",
|
|
1174
|
+
scrapeFailedSuffix: " — {n} failed",
|
|
1175
|
+
scrapeOkCount: "{n} ok",
|
|
1176
|
+
scrapeFailedCount: "{n} failed"
|
|
1166
1177
|
},
|
|
1167
1178
|
no: {
|
|
1168
1179
|
error: "Feil",
|
|
@@ -1223,19 +1234,30 @@ const se = {
|
|
|
1223
1234
|
memorySearchHideExploreResults: "Skjul resultater",
|
|
1224
1235
|
memorySearchExploreNoResults: "Ingen resultater funnet",
|
|
1225
1236
|
memoryChatChunkResultsInMemories: "i {n} minner",
|
|
1226
|
-
memoryChatChunkResultsInOneMemory: "i 1 minne"
|
|
1237
|
+
memoryChatChunkResultsInOneMemory: "i 1 minne",
|
|
1238
|
+
googleSearchingFor: "Søker på Google etter '{query}'",
|
|
1239
|
+
googleSearchingForWithCountry: "Søker på Google ({country}) etter '{query}'",
|
|
1240
|
+
googleResultsFound: "{n} Google-resultater funnet",
|
|
1241
|
+
googleResultFound: "1 Google-resultat funnet",
|
|
1242
|
+
scrapingPages: "Skraper {n} sider for '{query}'",
|
|
1243
|
+
scrapingPage: "Skraper 1 side for '{query}'",
|
|
1244
|
+
scrapedPages: "Skrapet {n} sider",
|
|
1245
|
+
scrapedPage: "Skrapet 1 side",
|
|
1246
|
+
scrapeFailedSuffix: " — {n} feilet",
|
|
1247
|
+
scrapeOkCount: "{n} ok",
|
|
1248
|
+
scrapeFailedCount: "{n} feilet"
|
|
1227
1249
|
}
|
|
1228
1250
|
};
|
|
1229
|
-
function
|
|
1230
|
-
return
|
|
1251
|
+
function Ue(e) {
|
|
1252
|
+
return Ge[e];
|
|
1231
1253
|
}
|
|
1232
|
-
function
|
|
1254
|
+
function S(e, r) {
|
|
1233
1255
|
return Object.entries(r).reduce(
|
|
1234
1256
|
(t, [n, i]) => t.replace(`{${n}}`, String(i)),
|
|
1235
1257
|
e
|
|
1236
1258
|
);
|
|
1237
1259
|
}
|
|
1238
|
-
function
|
|
1260
|
+
function q(e, r) {
|
|
1239
1261
|
const t = e.map((n) => `'${n}'`);
|
|
1240
1262
|
if (r != null && t.length >= 2) {
|
|
1241
1263
|
const n = t.pop();
|
|
@@ -1251,14 +1273,14 @@ function M({
|
|
|
1251
1273
|
repeatDelay: i = 0.5,
|
|
1252
1274
|
className: l,
|
|
1253
1275
|
startOnView: a = !1,
|
|
1254
|
-
once:
|
|
1255
|
-
inViewMargin:
|
|
1256
|
-
spread:
|
|
1257
|
-
color:
|
|
1276
|
+
once: s = !1,
|
|
1277
|
+
inViewMargin: m,
|
|
1278
|
+
spread: p = 2,
|
|
1279
|
+
color: c = "#999",
|
|
1258
1280
|
shimmerColor: d = "#000",
|
|
1259
|
-
direction:
|
|
1281
|
+
direction: u = "fromBottom"
|
|
1260
1282
|
}) {
|
|
1261
|
-
const g =
|
|
1283
|
+
const g = A(null), h = Se(g, { once: s, margin: m }), f = P(() => e.length * p, [e, p]), k = !a || h, b = u === "fromBottom" ? "100% center" : "-100% center", v = u === "fromBottom" ? "0% center" : "200% center";
|
|
1262
1284
|
return /* @__PURE__ */ o(
|
|
1263
1285
|
C.span,
|
|
1264
1286
|
{
|
|
@@ -1274,17 +1296,17 @@ function M({
|
|
|
1274
1296
|
WebkitTextFillColor: "transparent",
|
|
1275
1297
|
backgroundRepeat: "no-repeat, padding-box",
|
|
1276
1298
|
"--spread": `${f}px`,
|
|
1277
|
-
"--base-color":
|
|
1299
|
+
"--base-color": c,
|
|
1278
1300
|
"--shimmer-color": d,
|
|
1279
1301
|
"--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
|
|
1280
1302
|
backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
|
|
1281
1303
|
},
|
|
1282
1304
|
initial: {
|
|
1283
|
-
backgroundPosition:
|
|
1305
|
+
backgroundPosition: b,
|
|
1284
1306
|
opacity: 0
|
|
1285
1307
|
},
|
|
1286
|
-
animate:
|
|
1287
|
-
backgroundPosition:
|
|
1308
|
+
animate: k ? {
|
|
1309
|
+
backgroundPosition: v,
|
|
1288
1310
|
opacity: 1
|
|
1289
1311
|
} : {},
|
|
1290
1312
|
transition: {
|
|
@@ -1304,12 +1326,12 @@ function M({
|
|
|
1304
1326
|
}
|
|
1305
1327
|
);
|
|
1306
1328
|
}
|
|
1307
|
-
const
|
|
1308
|
-
const [i, l] = I(!1),
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
)}` : "", f =
|
|
1312
|
-
return /* @__PURE__ */
|
|
1329
|
+
const G = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
1330
|
+
const [i, l] = I(!1), s = (e.memories ?? []).map((k) => k.memoryTitle), m = s.length > 0, p = m && s.length > G, c = p && !i ? s.slice(0, G) : s, d = s.length - G, u = !p || i, g = `${n.searchingFor}'${e.queryDescription}'`, h = m ? `${n.searchingIn}${q(
|
|
1331
|
+
c,
|
|
1332
|
+
u ? n.and : void 0
|
|
1333
|
+
)}` : "", f = m ? `${g}${h}` : `${n.searchingPrefix}${e.queryDescription}`;
|
|
1334
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1313
1335
|
/* @__PURE__ */ o(
|
|
1314
1336
|
C.div,
|
|
1315
1337
|
{
|
|
@@ -1317,7 +1339,7 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1317
1339
|
initial: { opacity: 0, y: -10 },
|
|
1318
1340
|
animate: { opacity: 1, y: 0 },
|
|
1319
1341
|
transition: { duration: 0.3, delay: 0 },
|
|
1320
|
-
children: r && !t && !
|
|
1342
|
+
children: r && !t && !p ? /* @__PURE__ */ o(
|
|
1321
1343
|
M,
|
|
1322
1344
|
{
|
|
1323
1345
|
text: f,
|
|
@@ -1326,17 +1348,17 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1326
1348
|
color: "#999",
|
|
1327
1349
|
shimmerColor: "#000"
|
|
1328
1350
|
}
|
|
1329
|
-
) : /* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */ o("span", { style: { color: "#666" }, children:
|
|
1351
|
+
) : /* @__PURE__ */ y(E, { children: [
|
|
1352
|
+
/* @__PURE__ */ o("span", { style: { color: "#666" }, children: m ? /* @__PURE__ */ y(E, { children: [
|
|
1331
1353
|
n.searchingFor,
|
|
1332
|
-
/* @__PURE__ */
|
|
1354
|
+
/* @__PURE__ */ y("span", { style: { fontWeight: 600 }, children: [
|
|
1333
1355
|
"'",
|
|
1334
1356
|
e.queryDescription,
|
|
1335
1357
|
"'"
|
|
1336
1358
|
] }),
|
|
1337
|
-
|
|
1359
|
+
h
|
|
1338
1360
|
] }) : `${n.searchingPrefix}${e.queryDescription}` }),
|
|
1339
|
-
|
|
1361
|
+
p && !i && /* @__PURE__ */ y(E, { children: [
|
|
1340
1362
|
" ",
|
|
1341
1363
|
/* @__PURE__ */ o(
|
|
1342
1364
|
"button",
|
|
@@ -1354,13 +1376,13 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1354
1376
|
textDecoration: "underline",
|
|
1355
1377
|
fontFamily: "inherit"
|
|
1356
1378
|
},
|
|
1357
|
-
children:
|
|
1379
|
+
children: S(n.moreMemories, {
|
|
1358
1380
|
n: d
|
|
1359
1381
|
})
|
|
1360
1382
|
}
|
|
1361
1383
|
)
|
|
1362
1384
|
] }),
|
|
1363
|
-
|
|
1385
|
+
p && i && /* @__PURE__ */ y(E, { children: [
|
|
1364
1386
|
" ",
|
|
1365
1387
|
/* @__PURE__ */ o(
|
|
1366
1388
|
"button",
|
|
@@ -1394,16 +1416,16 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1394
1416
|
marginTop: "4px",
|
|
1395
1417
|
fontStyle: "italic"
|
|
1396
1418
|
},
|
|
1397
|
-
children:
|
|
1419
|
+
children: S(n.tookSeconds, { n: t })
|
|
1398
1420
|
}
|
|
1399
1421
|
)
|
|
1400
1422
|
] });
|
|
1401
|
-
}, U = 5,
|
|
1402
|
-
const [i, l] = I(!1), a = e.titles,
|
|
1403
|
-
|
|
1423
|
+
}, U = 5, je = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
1424
|
+
const [i, l] = I(!1), a = e.titles, s = a.length > 0, m = s && a.length > U, p = m && !i ? a.slice(0, U) : a, c = a.length - U, d = !m || i, u = s ? `${n.findingMemoriesIn}${q(
|
|
1425
|
+
p,
|
|
1404
1426
|
d ? n.and : void 0
|
|
1405
1427
|
)}` : n.findingMemories;
|
|
1406
|
-
return /* @__PURE__ */
|
|
1428
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1407
1429
|
/* @__PURE__ */ o(
|
|
1408
1430
|
C.div,
|
|
1409
1431
|
{
|
|
@@ -1413,18 +1435,18 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1413
1435
|
initial: { opacity: 0, y: -10 },
|
|
1414
1436
|
animate: { opacity: 1, y: 0 },
|
|
1415
1437
|
transition: { duration: 0.3, delay: 0 },
|
|
1416
|
-
children: r && !t && !
|
|
1438
|
+
children: r && !t && !m ? /* @__PURE__ */ o(
|
|
1417
1439
|
M,
|
|
1418
1440
|
{
|
|
1419
|
-
text:
|
|
1441
|
+
text: u,
|
|
1420
1442
|
duration: 2.5,
|
|
1421
1443
|
repeat: !0,
|
|
1422
1444
|
color: "#999",
|
|
1423
1445
|
shimmerColor: "#000"
|
|
1424
1446
|
}
|
|
1425
|
-
) : /* @__PURE__ */
|
|
1426
|
-
/* @__PURE__ */ o("span", { style: { color: "#666" }, children:
|
|
1427
|
-
|
|
1447
|
+
) : /* @__PURE__ */ y(E, { children: [
|
|
1448
|
+
/* @__PURE__ */ o("span", { style: { color: "#666" }, children: u }),
|
|
1449
|
+
m && !i && /* @__PURE__ */ y(E, { children: [
|
|
1428
1450
|
" ",
|
|
1429
1451
|
/* @__PURE__ */ o(
|
|
1430
1452
|
"button",
|
|
@@ -1442,13 +1464,13 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1442
1464
|
textDecoration: "underline",
|
|
1443
1465
|
fontFamily: "inherit"
|
|
1444
1466
|
},
|
|
1445
|
-
children:
|
|
1446
|
-
n:
|
|
1467
|
+
children: S(n.moreMemories, {
|
|
1468
|
+
n: c
|
|
1447
1469
|
})
|
|
1448
1470
|
}
|
|
1449
1471
|
)
|
|
1450
1472
|
] }),
|
|
1451
|
-
|
|
1473
|
+
m && i && /* @__PURE__ */ y(E, { children: [
|
|
1452
1474
|
" ",
|
|
1453
1475
|
/* @__PURE__ */ o(
|
|
1454
1476
|
"button",
|
|
@@ -1482,14 +1504,14 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1482
1504
|
marginTop: "4px",
|
|
1483
1505
|
fontStyle: "italic"
|
|
1484
1506
|
},
|
|
1485
|
-
children:
|
|
1507
|
+
children: S(n.tookSeconds, { n: t })
|
|
1486
1508
|
}
|
|
1487
1509
|
)
|
|
1488
1510
|
] });
|
|
1489
|
-
}, _ = 5,
|
|
1490
|
-
const [t, n] = I(!1), l = e.memories.map((g) => g.memoryTitle), a = l.length > 0,
|
|
1491
|
-
|
|
1492
|
-
|
|
1511
|
+
}, _ = 5, qe = ({ data: e, t: r }) => {
|
|
1512
|
+
const [t, n] = I(!1), l = e.memories.map((g) => g.memoryTitle), a = l.length > 0, s = a && l.length > _, m = s && !t ? l.slice(0, _) : l, p = l.length - _, c = !s || t, d = l.length === 1 ? r.memoryFound : r.memoriesFoundPrefix, u = a ? `${d}${q(
|
|
1513
|
+
m,
|
|
1514
|
+
c ? r.and : void 0
|
|
1493
1515
|
)}` : r.memoriesFound;
|
|
1494
1516
|
return /* @__PURE__ */ o("div", { style: { padding: "16px" }, children: /* @__PURE__ */ o(
|
|
1495
1517
|
C.div,
|
|
@@ -1498,9 +1520,9 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1498
1520
|
initial: { opacity: 0, y: -10 },
|
|
1499
1521
|
animate: { opacity: 1, y: 0 },
|
|
1500
1522
|
transition: { duration: 0.3, delay: 0 },
|
|
1501
|
-
children: /* @__PURE__ */
|
|
1502
|
-
/* @__PURE__ */ o("span", { style: { color: "#666" }, children:
|
|
1503
|
-
|
|
1523
|
+
children: /* @__PURE__ */ y(E, { children: [
|
|
1524
|
+
/* @__PURE__ */ o("span", { style: { color: "#666" }, children: u }),
|
|
1525
|
+
s && !t && /* @__PURE__ */ y(E, { children: [
|
|
1504
1526
|
" ",
|
|
1505
1527
|
/* @__PURE__ */ o(
|
|
1506
1528
|
"button",
|
|
@@ -1518,13 +1540,13 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1518
1540
|
textDecoration: "underline",
|
|
1519
1541
|
fontFamily: "inherit"
|
|
1520
1542
|
},
|
|
1521
|
-
children:
|
|
1522
|
-
n:
|
|
1543
|
+
children: S(r.moreMemories, {
|
|
1544
|
+
n: p
|
|
1523
1545
|
})
|
|
1524
1546
|
}
|
|
1525
1547
|
)
|
|
1526
1548
|
] }),
|
|
1527
|
-
|
|
1549
|
+
s && t && /* @__PURE__ */ y(E, { children: [
|
|
1528
1550
|
" ",
|
|
1529
1551
|
/* @__PURE__ */ o(
|
|
1530
1552
|
"button",
|
|
@@ -1549,9 +1571,9 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1549
1571
|
] })
|
|
1550
1572
|
}
|
|
1551
1573
|
) });
|
|
1552
|
-
},
|
|
1574
|
+
}, Qe = ({ isLatest: e = !1, durationSeconds: r, t }) => {
|
|
1553
1575
|
const n = t.addingSources;
|
|
1554
|
-
return /* @__PURE__ */
|
|
1576
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1555
1577
|
/* @__PURE__ */ o(
|
|
1556
1578
|
C.div,
|
|
1557
1579
|
{
|
|
@@ -1585,26 +1607,26 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1585
1607
|
marginTop: "4px",
|
|
1586
1608
|
fontStyle: "italic"
|
|
1587
1609
|
},
|
|
1588
|
-
children:
|
|
1610
|
+
children: S(t.tookSeconds, { n: r })
|
|
1589
1611
|
}
|
|
1590
1612
|
)
|
|
1591
1613
|
] });
|
|
1592
1614
|
};
|
|
1593
|
-
function
|
|
1615
|
+
function Ke(e, r) {
|
|
1594
1616
|
if (e.length === 0) return "";
|
|
1595
1617
|
if (e.length === 1)
|
|
1596
|
-
return
|
|
1618
|
+
return S(r.pageSingle, { n: e[0] });
|
|
1597
1619
|
if (e.length === 2)
|
|
1598
|
-
return
|
|
1620
|
+
return S(r.pageTwo, {
|
|
1599
1621
|
a: e[0],
|
|
1600
1622
|
b: e[1]
|
|
1601
1623
|
});
|
|
1602
1624
|
const t = e[e.length - 1], n = e.slice(0, -1).join(", ");
|
|
1603
|
-
return
|
|
1625
|
+
return S(r.pageMultiple, { list: n, n: t });
|
|
1604
1626
|
}
|
|
1605
|
-
const
|
|
1627
|
+
const Ve = ({ data: e, onSourceClick: r, t }) => {
|
|
1606
1628
|
const [n, i] = I(null);
|
|
1607
|
-
return /* @__PURE__ */
|
|
1629
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1608
1630
|
/* @__PURE__ */ o(
|
|
1609
1631
|
C.div,
|
|
1610
1632
|
{
|
|
@@ -1623,7 +1645,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1623
1645
|
}
|
|
1624
1646
|
),
|
|
1625
1647
|
/* @__PURE__ */ o("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ o("span", { style: { fontSize: "13px", color: "#888" }, children: t.noSources }) : e.sources.map((l, a) => /* @__PURE__ */ o(
|
|
1626
|
-
|
|
1648
|
+
Xe,
|
|
1627
1649
|
{
|
|
1628
1650
|
source: l,
|
|
1629
1651
|
index: a,
|
|
@@ -1635,7 +1657,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1635
1657
|
l.memoryId
|
|
1636
1658
|
)) })
|
|
1637
1659
|
] });
|
|
1638
|
-
},
|
|
1660
|
+
}, Xe = ({
|
|
1639
1661
|
source: e,
|
|
1640
1662
|
index: r,
|
|
1641
1663
|
loadingMemoryId: t,
|
|
@@ -1643,15 +1665,15 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1643
1665
|
onSourceClick: i,
|
|
1644
1666
|
t: l
|
|
1645
1667
|
}) => {
|
|
1646
|
-
const [a,
|
|
1647
|
-
return /* @__PURE__ */
|
|
1668
|
+
const [a, s] = I(!1), m = !!i, p = t === e.memoryId, c = e.pageNumbers ?? [], d = Ke(c, l);
|
|
1669
|
+
return /* @__PURE__ */ y(
|
|
1648
1670
|
C.div,
|
|
1649
1671
|
{
|
|
1650
|
-
"aria-busy":
|
|
1672
|
+
"aria-busy": p,
|
|
1651
1673
|
initial: { opacity: 0, scale: 0.9 },
|
|
1652
1674
|
animate: { opacity: 1, scale: 1 },
|
|
1653
1675
|
transition: { duration: 0.25, delay: r * 0.05 },
|
|
1654
|
-
onClick:
|
|
1676
|
+
onClick: m && !p ? async () => {
|
|
1655
1677
|
n(e.memoryId);
|
|
1656
1678
|
try {
|
|
1657
1679
|
await i({
|
|
@@ -1659,14 +1681,14 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1659
1681
|
memoryTitle: e.memoryTitle,
|
|
1660
1682
|
memoryTypeId: e.memoryTypeId,
|
|
1661
1683
|
memoryTypeName: e.memoryTypeName,
|
|
1662
|
-
pageNumbers: [...
|
|
1684
|
+
pageNumbers: [...c]
|
|
1663
1685
|
});
|
|
1664
1686
|
} finally {
|
|
1665
1687
|
n(null);
|
|
1666
1688
|
}
|
|
1667
1689
|
} : void 0,
|
|
1668
|
-
onMouseEnter:
|
|
1669
|
-
onMouseLeave:
|
|
1690
|
+
onMouseEnter: m && !p ? () => s(!0) : void 0,
|
|
1691
|
+
onMouseLeave: m && !p ? () => s(!1) : void 0,
|
|
1670
1692
|
style: {
|
|
1671
1693
|
display: "inline-flex",
|
|
1672
1694
|
flexDirection: "column",
|
|
@@ -1675,13 +1697,13 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1675
1697
|
borderRadius: "6px",
|
|
1676
1698
|
border: "1px solid #e0e0e0",
|
|
1677
1699
|
backgroundColor: a ? "#f5f5f5" : "transparent",
|
|
1678
|
-
cursor:
|
|
1700
|
+
cursor: m && !p ? "pointer" : p ? "wait" : "default",
|
|
1679
1701
|
transition: "background-color 0.15s ease",
|
|
1680
1702
|
userSelect: "none",
|
|
1681
|
-
pointerEvents:
|
|
1703
|
+
pointerEvents: p ? "none" : void 0
|
|
1682
1704
|
},
|
|
1683
1705
|
children: [
|
|
1684
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ y(
|
|
1685
1707
|
"span",
|
|
1686
1708
|
{
|
|
1687
1709
|
style: {
|
|
@@ -1693,7 +1715,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1693
1715
|
gap: 8
|
|
1694
1716
|
},
|
|
1695
1717
|
children: [
|
|
1696
|
-
|
|
1718
|
+
p && /* @__PURE__ */ o(
|
|
1697
1719
|
"span",
|
|
1698
1720
|
{
|
|
1699
1721
|
className: "explore-memory-loader explore-memory-loader--callback",
|
|
@@ -1708,7 +1730,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1708
1730
|
]
|
|
1709
1731
|
}
|
|
1710
1732
|
);
|
|
1711
|
-
},
|
|
1733
|
+
}, L = ({
|
|
1712
1734
|
color: e = "#78b13f",
|
|
1713
1735
|
size: r = 24,
|
|
1714
1736
|
borderWidth: t = 7
|
|
@@ -1727,7 +1749,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1727
1749
|
}
|
|
1728
1750
|
}
|
|
1729
1751
|
);
|
|
1730
|
-
},
|
|
1752
|
+
}, H = ({
|
|
1731
1753
|
color: e = "#333",
|
|
1732
1754
|
size: r = 32,
|
|
1733
1755
|
lineWidth: t = 2
|
|
@@ -1740,7 +1762,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1740
1762
|
height: n,
|
|
1741
1763
|
backgroundColor: e
|
|
1742
1764
|
};
|
|
1743
|
-
return /* @__PURE__ */
|
|
1765
|
+
return /* @__PURE__ */ y(
|
|
1744
1766
|
"span",
|
|
1745
1767
|
{
|
|
1746
1768
|
style: {
|
|
@@ -1772,26 +1794,26 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1772
1794
|
}
|
|
1773
1795
|
);
|
|
1774
1796
|
};
|
|
1775
|
-
function
|
|
1797
|
+
function Je({
|
|
1776
1798
|
memory: e,
|
|
1777
1799
|
completed: r
|
|
1778
1800
|
}) {
|
|
1779
|
-
return e.error != null ? /* @__PURE__ */ o(
|
|
1801
|
+
return e.error != null ? /* @__PURE__ */ o(H, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : r ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
1780
1802
|
}
|
|
1781
1803
|
const te = 80;
|
|
1782
|
-
function
|
|
1804
|
+
function Ye({
|
|
1783
1805
|
memory: e,
|
|
1784
1806
|
completed: r,
|
|
1785
1807
|
t
|
|
1786
1808
|
}) {
|
|
1787
|
-
const [n, i] = I(!1), l = e.result ?? e.error, a = l != null && l.length > te,
|
|
1788
|
-
return /* @__PURE__ */
|
|
1809
|
+
const [n, i] = I(!1), l = e.result ?? e.error, a = l != null && l.length > te, s = l != null ? n || !a ? l : `${l.slice(0, te)}...` : void 0, m = a, p = e.error != null;
|
|
1810
|
+
return /* @__PURE__ */ y(
|
|
1789
1811
|
C.div,
|
|
1790
1812
|
{
|
|
1791
1813
|
initial: { opacity: 0 },
|
|
1792
1814
|
animate: { opacity: 1 },
|
|
1793
1815
|
transition: { duration: 0.25 },
|
|
1794
|
-
onClick:
|
|
1816
|
+
onClick: m ? () => i((c) => !c) : void 0,
|
|
1795
1817
|
style: {
|
|
1796
1818
|
paddingTop: "12px",
|
|
1797
1819
|
paddingBottom: "12px",
|
|
@@ -1801,7 +1823,7 @@ function Xe({
|
|
|
1801
1823
|
alignItems: "center",
|
|
1802
1824
|
gap: "10px",
|
|
1803
1825
|
minWidth: 0,
|
|
1804
|
-
cursor:
|
|
1826
|
+
cursor: m ? "pointer" : "default"
|
|
1805
1827
|
},
|
|
1806
1828
|
children: [
|
|
1807
1829
|
/* @__PURE__ */ o(
|
|
@@ -1814,10 +1836,10 @@ function Xe({
|
|
|
1814
1836
|
flexShrink: 0,
|
|
1815
1837
|
width: 32
|
|
1816
1838
|
},
|
|
1817
|
-
children: /* @__PURE__ */ o(
|
|
1839
|
+
children: /* @__PURE__ */ o(Je, { memory: e, completed: r })
|
|
1818
1840
|
}
|
|
1819
1841
|
),
|
|
1820
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ y(
|
|
1821
1843
|
"div",
|
|
1822
1844
|
{
|
|
1823
1845
|
style: {
|
|
@@ -1834,19 +1856,19 @@ function Xe({
|
|
|
1834
1856
|
children: e.memoryTitle
|
|
1835
1857
|
}
|
|
1836
1858
|
),
|
|
1837
|
-
|
|
1859
|
+
s != null && /* @__PURE__ */ o(
|
|
1838
1860
|
"span",
|
|
1839
1861
|
{
|
|
1840
1862
|
style: {
|
|
1841
1863
|
fontSize: 12,
|
|
1842
|
-
color:
|
|
1864
|
+
color: p ? "#c62828" : "#666",
|
|
1843
1865
|
lineHeight: 1.4,
|
|
1844
1866
|
whiteSpace: n ? "pre-wrap" : void 0
|
|
1845
1867
|
},
|
|
1846
|
-
children:
|
|
1868
|
+
children: s
|
|
1847
1869
|
}
|
|
1848
1870
|
),
|
|
1849
|
-
|
|
1871
|
+
m && /* @__PURE__ */ o(
|
|
1850
1872
|
"span",
|
|
1851
1873
|
{
|
|
1852
1874
|
style: {
|
|
@@ -1864,8 +1886,8 @@ function Xe({
|
|
|
1864
1886
|
}
|
|
1865
1887
|
);
|
|
1866
1888
|
}
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1889
|
+
const Ze = ({ data: e, completed: r, t }) => /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: e.memories.map((n) => /* @__PURE__ */ o(
|
|
1890
|
+
Ye,
|
|
1869
1891
|
{
|
|
1870
1892
|
memory: n,
|
|
1871
1893
|
completed: r,
|
|
@@ -1873,16 +1895,16 @@ const Je = ({ data: e, completed: r, t }) => /* @__PURE__ */ o("div", { style: {
|
|
|
1873
1895
|
},
|
|
1874
1896
|
n.memoryId
|
|
1875
1897
|
)) });
|
|
1876
|
-
function
|
|
1898
|
+
function er(e, r) {
|
|
1877
1899
|
const t = Math.min(e.length, r.length);
|
|
1878
1900
|
for (let n = t; n >= 0; n--)
|
|
1879
1901
|
if (e.slice(-n) === r.slice(0, n)) return n;
|
|
1880
1902
|
return 0;
|
|
1881
1903
|
}
|
|
1882
|
-
const
|
|
1904
|
+
const rr = `
|
|
1883
1905
|
|
|
1884
1906
|
`;
|
|
1885
|
-
function
|
|
1907
|
+
function Q(e) {
|
|
1886
1908
|
var t, n;
|
|
1887
1909
|
if (e.length === 0) return "";
|
|
1888
1910
|
let r = ((t = e[0]) == null ? void 0 : t.content) ?? "";
|
|
@@ -1893,24 +1915,24 @@ function q(e) {
|
|
|
1893
1915
|
r = l;
|
|
1894
1916
|
continue;
|
|
1895
1917
|
}
|
|
1896
|
-
const a =
|
|
1897
|
-
a === 0 ? r +=
|
|
1918
|
+
const a = er(r, l);
|
|
1919
|
+
a === 0 ? r += rr + l : r += l.slice(a);
|
|
1898
1920
|
}
|
|
1899
1921
|
return r;
|
|
1900
1922
|
}
|
|
1901
1923
|
function K(e, r) {
|
|
1902
1924
|
if (e.length === 0) return "";
|
|
1903
1925
|
if (e.length === 1)
|
|
1904
|
-
return
|
|
1926
|
+
return S(r.memorySearchPagesSingle, {
|
|
1905
1927
|
n: e[0]
|
|
1906
1928
|
});
|
|
1907
1929
|
if (e.length === 2)
|
|
1908
|
-
return
|
|
1930
|
+
return S(r.memorySearchPagesTwo, {
|
|
1909
1931
|
a: e[0],
|
|
1910
1932
|
b: e[1]
|
|
1911
1933
|
});
|
|
1912
1934
|
const t = e[e.length - 1], n = e.slice(0, -1).join(", ");
|
|
1913
|
-
return
|
|
1935
|
+
return S(r.memorySearchPagesMultiple, {
|
|
1914
1936
|
list: n,
|
|
1915
1937
|
n: t
|
|
1916
1938
|
});
|
|
@@ -1926,19 +1948,19 @@ function X(e) {
|
|
|
1926
1948
|
if (r !== "") return r;
|
|
1927
1949
|
if (e.memoryTypeId !== "") return e.memoryTypeId;
|
|
1928
1950
|
}
|
|
1929
|
-
function
|
|
1951
|
+
function de(e) {
|
|
1930
1952
|
return e.chunks.filter((r) => r.relation === "MATCH").length;
|
|
1931
1953
|
}
|
|
1932
|
-
function
|
|
1954
|
+
function nr(e, r) {
|
|
1933
1955
|
let t = 0, n = 0;
|
|
1934
1956
|
for (const a of e)
|
|
1935
|
-
t +=
|
|
1936
|
-
const i = t === 1 ? r.chunkFound :
|
|
1957
|
+
t += de(a), a.matchingChunkScore > n && (n = a.matchingChunkScore);
|
|
1958
|
+
const i = t === 1 ? r.chunkFound : S(r.chunksFound, { n: t }), l = S(r.scoreLabel, {
|
|
1937
1959
|
n: n.toFixed(2)
|
|
1938
1960
|
});
|
|
1939
1961
|
return `${i} - ${l}`;
|
|
1940
1962
|
}
|
|
1941
|
-
function
|
|
1963
|
+
function tr(e) {
|
|
1942
1964
|
const r = [], t = /* @__PURE__ */ new Map();
|
|
1943
1965
|
return e.forEach((n, i) => {
|
|
1944
1966
|
let l = t.get(n.memoryId);
|
|
@@ -1954,7 +1976,7 @@ function rr(e) {
|
|
|
1954
1976
|
l.items.push({ item: n, flatIndex: i });
|
|
1955
1977
|
}), r.map((n) => t.get(n));
|
|
1956
1978
|
}
|
|
1957
|
-
function
|
|
1979
|
+
function or({
|
|
1958
1980
|
items: e,
|
|
1959
1981
|
onSearchResultClick: r,
|
|
1960
1982
|
t
|
|
@@ -1971,25 +1993,25 @@ function nr({
|
|
|
1971
1993
|
paddingTop: 8,
|
|
1972
1994
|
borderTop: "1px solid #f0f0f0"
|
|
1973
1995
|
},
|
|
1974
|
-
children: e.map((a,
|
|
1975
|
-
const
|
|
1996
|
+
children: e.map((a, s) => {
|
|
1997
|
+
const m = V(
|
|
1976
1998
|
a.chunks
|
|
1977
|
-
),
|
|
1999
|
+
), p = [
|
|
1978
2000
|
X(a),
|
|
1979
|
-
|
|
2001
|
+
S(t.scoreLabel, {
|
|
1980
2002
|
n: a.matchingChunkScore.toFixed(2)
|
|
1981
2003
|
}),
|
|
1982
|
-
|
|
2004
|
+
m.length > 0 ? K(m, t) : t.pagesNotAvailable
|
|
1983
2005
|
].filter(
|
|
1984
2006
|
(g) => g != null && g !== ""
|
|
1985
|
-
),
|
|
2007
|
+
), c = {
|
|
1986
2008
|
memoryId: a.memoryId,
|
|
1987
2009
|
memoryTitle: a.memoryTitle,
|
|
1988
2010
|
memoryTypeId: a.memoryTypeId,
|
|
1989
2011
|
memoryTypeName: a.memoryTypeName,
|
|
1990
|
-
pageNumbers:
|
|
1991
|
-
}, d = `${a.memoryId}-${
|
|
1992
|
-
return /* @__PURE__ */
|
|
2012
|
+
pageNumbers: m
|
|
2013
|
+
}, d = `${a.memoryId}-${s}`, u = n === d;
|
|
2014
|
+
return /* @__PURE__ */ y(
|
|
1993
2015
|
"div",
|
|
1994
2016
|
{
|
|
1995
2017
|
style: {
|
|
@@ -1997,13 +2019,13 @@ function nr({
|
|
|
1997
2019
|
flexDirection: "row",
|
|
1998
2020
|
alignItems: "flex-start",
|
|
1999
2021
|
gap: "12px",
|
|
2000
|
-
paddingTop:
|
|
2001
|
-
paddingBottom:
|
|
2002
|
-
borderBottom:
|
|
2022
|
+
paddingTop: s > 0 ? 12 : 0,
|
|
2023
|
+
paddingBottom: s < e.length - 1 ? 12 : 0,
|
|
2024
|
+
borderBottom: s < e.length - 1 ? "1px solid #eee" : void 0,
|
|
2003
2025
|
minWidth: 0
|
|
2004
2026
|
},
|
|
2005
2027
|
children: [
|
|
2006
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ y(
|
|
2007
2029
|
"div",
|
|
2008
2030
|
{
|
|
2009
2031
|
style: {
|
|
@@ -2024,7 +2046,7 @@ function nr({
|
|
|
2024
2046
|
whiteSpace: "pre-wrap",
|
|
2025
2047
|
wordBreak: "break-word"
|
|
2026
2048
|
},
|
|
2027
|
-
children:
|
|
2049
|
+
children: Q(a.chunks)
|
|
2028
2050
|
}
|
|
2029
2051
|
),
|
|
2030
2052
|
/* @__PURE__ */ o(
|
|
@@ -2036,23 +2058,23 @@ function nr({
|
|
|
2036
2058
|
color: "#94a3b8",
|
|
2037
2059
|
lineHeight: 1.35
|
|
2038
2060
|
},
|
|
2039
|
-
children:
|
|
2061
|
+
children: p.join(" · ")
|
|
2040
2062
|
}
|
|
2041
2063
|
)
|
|
2042
2064
|
]
|
|
2043
2065
|
}
|
|
2044
2066
|
),
|
|
2045
|
-
l && /* @__PURE__ */
|
|
2067
|
+
l && /* @__PURE__ */ y(
|
|
2046
2068
|
"button",
|
|
2047
2069
|
{
|
|
2048
2070
|
type: "button",
|
|
2049
|
-
"aria-busy":
|
|
2050
|
-
disabled:
|
|
2071
|
+
"aria-busy": u,
|
|
2072
|
+
disabled: u,
|
|
2051
2073
|
onClick: async () => {
|
|
2052
2074
|
i(d);
|
|
2053
2075
|
try {
|
|
2054
2076
|
await r(
|
|
2055
|
-
|
|
2077
|
+
c
|
|
2056
2078
|
);
|
|
2057
2079
|
} finally {
|
|
2058
2080
|
i(null);
|
|
@@ -2068,14 +2090,14 @@ function nr({
|
|
|
2068
2090
|
background: "#eff6ff",
|
|
2069
2091
|
border: "1px solid #bfdbfe",
|
|
2070
2092
|
borderRadius: 6,
|
|
2071
|
-
cursor:
|
|
2093
|
+
cursor: u ? "wait" : "pointer",
|
|
2072
2094
|
fontFamily: "inherit",
|
|
2073
2095
|
display: "inline-flex",
|
|
2074
2096
|
alignItems: "center",
|
|
2075
2097
|
gap: 8
|
|
2076
2098
|
},
|
|
2077
2099
|
children: [
|
|
2078
|
-
|
|
2100
|
+
u && /* @__PURE__ */ o(
|
|
2079
2101
|
"span",
|
|
2080
2102
|
{
|
|
2081
2103
|
className: "explore-memory-loader explore-memory-loader--callback",
|
|
@@ -2094,15 +2116,15 @@ function nr({
|
|
|
2094
2116
|
}
|
|
2095
2117
|
);
|
|
2096
2118
|
}
|
|
2097
|
-
function
|
|
2119
|
+
function ir({
|
|
2098
2120
|
group: e,
|
|
2099
2121
|
t: r,
|
|
2100
2122
|
expanded: t,
|
|
2101
2123
|
onToggle: n,
|
|
2102
2124
|
onSearchResultClick: i
|
|
2103
2125
|
}) {
|
|
2104
|
-
const l = e.items.map((
|
|
2105
|
-
return /* @__PURE__ */
|
|
2126
|
+
const l = e.items.map((s) => s.item), a = l.some((s) => s.chunks.length > 0);
|
|
2127
|
+
return /* @__PURE__ */ y(
|
|
2106
2128
|
C.div,
|
|
2107
2129
|
{
|
|
2108
2130
|
initial: { opacity: 0 },
|
|
@@ -2130,10 +2152,10 @@ function tr({
|
|
|
2130
2152
|
width: 32,
|
|
2131
2153
|
paddingTop: 2
|
|
2132
2154
|
},
|
|
2133
|
-
children: /* @__PURE__ */ o(
|
|
2155
|
+
children: /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 })
|
|
2134
2156
|
}
|
|
2135
2157
|
),
|
|
2136
|
-
/* @__PURE__ */
|
|
2158
|
+
/* @__PURE__ */ y(
|
|
2137
2159
|
"div",
|
|
2138
2160
|
{
|
|
2139
2161
|
style: {
|
|
@@ -2156,7 +2178,7 @@ function tr({
|
|
|
2156
2178
|
children: e.memoryTitle
|
|
2157
2179
|
}
|
|
2158
2180
|
),
|
|
2159
|
-
/* @__PURE__ */
|
|
2181
|
+
/* @__PURE__ */ y(
|
|
2160
2182
|
"div",
|
|
2161
2183
|
{
|
|
2162
2184
|
style: {
|
|
@@ -2176,7 +2198,7 @@ function tr({
|
|
|
2176
2198
|
color: "#666",
|
|
2177
2199
|
whiteSpace: "nowrap"
|
|
2178
2200
|
},
|
|
2179
|
-
children:
|
|
2201
|
+
children: nr(l, r)
|
|
2180
2202
|
}
|
|
2181
2203
|
),
|
|
2182
2204
|
a && /* @__PURE__ */ o(
|
|
@@ -2201,7 +2223,7 @@ function tr({
|
|
|
2201
2223
|
}
|
|
2202
2224
|
),
|
|
2203
2225
|
t && a && /* @__PURE__ */ o(
|
|
2204
|
-
|
|
2226
|
+
or,
|
|
2205
2227
|
{
|
|
2206
2228
|
items: l,
|
|
2207
2229
|
onSearchResultClick: i,
|
|
@@ -2215,25 +2237,25 @@ function tr({
|
|
|
2215
2237
|
}
|
|
2216
2238
|
);
|
|
2217
2239
|
}
|
|
2218
|
-
function
|
|
2219
|
-
return e === 1 ? r.chunkFound :
|
|
2240
|
+
function ar(e, r) {
|
|
2241
|
+
return e === 1 ? r.chunkFound : S(r.chunksFound, { n: e });
|
|
2220
2242
|
}
|
|
2221
|
-
const
|
|
2243
|
+
const sr = ({
|
|
2222
2244
|
data: e,
|
|
2223
2245
|
onSearchResultClick: r,
|
|
2224
2246
|
t
|
|
2225
2247
|
}) => {
|
|
2226
2248
|
const n = e.items, i = n.reduce(
|
|
2227
|
-
(
|
|
2249
|
+
(u, g) => u + de(g),
|
|
2228
2250
|
0
|
|
2229
|
-
), l = new Set(n.map((
|
|
2230
|
-
|
|
2251
|
+
), l = new Set(n.map((u) => u.memoryId)).size, [a, s] = I({}), m = z((u) => {
|
|
2252
|
+
s((g) => ({
|
|
2231
2253
|
...g,
|
|
2232
|
-
[
|
|
2254
|
+
[u]: !g[u]
|
|
2233
2255
|
}));
|
|
2234
|
-
}, []),
|
|
2256
|
+
}, []), p = P(() => tr(n), [n]), c = l === 1 ? t.memoryChatChunkResultsInOneMemory : S(t.memoryChatChunkResultsInMemories, {
|
|
2235
2257
|
n: l
|
|
2236
|
-
}), d = `${
|
|
2258
|
+
}), d = `${ar(i, t)} ${c}`;
|
|
2237
2259
|
return n.length === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
2238
2260
|
"div",
|
|
2239
2261
|
{
|
|
@@ -2244,17 +2266,17 @@ const ir = ({
|
|
|
2244
2266
|
},
|
|
2245
2267
|
children: t.memorySearchExploreNoResults
|
|
2246
2268
|
}
|
|
2247
|
-
) }) : /* @__PURE__ */
|
|
2248
|
-
|
|
2249
|
-
|
|
2269
|
+
) }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2270
|
+
p.map((u) => /* @__PURE__ */ o(
|
|
2271
|
+
ir,
|
|
2250
2272
|
{
|
|
2251
|
-
group:
|
|
2273
|
+
group: u,
|
|
2252
2274
|
t,
|
|
2253
|
-
expanded: a[
|
|
2254
|
-
onToggle: () => u
|
|
2275
|
+
expanded: a[u.memoryId] === !0,
|
|
2276
|
+
onToggle: () => m(u.memoryId),
|
|
2255
2277
|
onSearchResultClick: r
|
|
2256
2278
|
},
|
|
2257
|
-
|
|
2279
|
+
u.memoryId
|
|
2258
2280
|
)),
|
|
2259
2281
|
/* @__PURE__ */ o(
|
|
2260
2282
|
"div",
|
|
@@ -2269,22 +2291,496 @@ const ir = ({
|
|
|
2269
2291
|
}
|
|
2270
2292
|
)
|
|
2271
2293
|
] });
|
|
2294
|
+
}, lr = ({
|
|
2295
|
+
data: e,
|
|
2296
|
+
isLatest: r = !1,
|
|
2297
|
+
durationSeconds: t,
|
|
2298
|
+
t: n
|
|
2299
|
+
}) => {
|
|
2300
|
+
const i = e.countryCode != null && e.countryCode !== "" ? S(n.googleSearchingForWithCountry, {
|
|
2301
|
+
query: e.query,
|
|
2302
|
+
country: e.countryCode
|
|
2303
|
+
}) : S(n.googleSearchingFor, {
|
|
2304
|
+
query: e.query
|
|
2305
|
+
});
|
|
2306
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
2307
|
+
/* @__PURE__ */ o(
|
|
2308
|
+
C.div,
|
|
2309
|
+
{
|
|
2310
|
+
style: { color: "#666" },
|
|
2311
|
+
initial: { opacity: 0, y: -10 },
|
|
2312
|
+
animate: { opacity: 1, y: 0 },
|
|
2313
|
+
transition: { duration: 0.3, delay: 0 },
|
|
2314
|
+
children: r && !t ? /* @__PURE__ */ o(
|
|
2315
|
+
M,
|
|
2316
|
+
{
|
|
2317
|
+
text: i,
|
|
2318
|
+
duration: 2.5,
|
|
2319
|
+
repeat: !0,
|
|
2320
|
+
color: "#999",
|
|
2321
|
+
shimmerColor: "#000"
|
|
2322
|
+
}
|
|
2323
|
+
) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: i })
|
|
2324
|
+
}
|
|
2325
|
+
),
|
|
2326
|
+
t !== void 0 && /* @__PURE__ */ o(
|
|
2327
|
+
"div",
|
|
2328
|
+
{
|
|
2329
|
+
style: {
|
|
2330
|
+
fontSize: "12px",
|
|
2331
|
+
color: "#999",
|
|
2332
|
+
marginTop: "4px",
|
|
2333
|
+
fontStyle: "italic"
|
|
2334
|
+
},
|
|
2335
|
+
children: S(n.tookSeconds, { n: t })
|
|
2336
|
+
}
|
|
2337
|
+
)
|
|
2338
|
+
] });
|
|
2339
|
+
}, oe = 80;
|
|
2340
|
+
function cr(e) {
|
|
2341
|
+
try {
|
|
2342
|
+
return new URL(e).hostname;
|
|
2343
|
+
} catch {
|
|
2344
|
+
return e;
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
function dr({
|
|
2348
|
+
item: e,
|
|
2349
|
+
t: r
|
|
2350
|
+
}) {
|
|
2351
|
+
const [t, n] = I(!1), i = e.description ?? "", l = i.length > oe, a = i.length === 0 ? void 0 : t || !l ? i : `${i.slice(0, oe)}...`;
|
|
2352
|
+
return /* @__PURE__ */ y(
|
|
2353
|
+
"div",
|
|
2354
|
+
{
|
|
2355
|
+
style: {
|
|
2356
|
+
display: "flex",
|
|
2357
|
+
flexDirection: "column",
|
|
2358
|
+
gap: "6px",
|
|
2359
|
+
minWidth: 0
|
|
2360
|
+
},
|
|
2361
|
+
children: [
|
|
2362
|
+
/* @__PURE__ */ o(
|
|
2363
|
+
"a",
|
|
2364
|
+
{
|
|
2365
|
+
href: e.link,
|
|
2366
|
+
target: "_blank",
|
|
2367
|
+
rel: "noopener noreferrer",
|
|
2368
|
+
style: {
|
|
2369
|
+
fontSize: 13,
|
|
2370
|
+
fontWeight: 600,
|
|
2371
|
+
color: "#1f2937",
|
|
2372
|
+
textDecoration: "none",
|
|
2373
|
+
wordBreak: "break-word"
|
|
2374
|
+
},
|
|
2375
|
+
onMouseEnter: (s) => {
|
|
2376
|
+
s.currentTarget.style.color = "#2563eb";
|
|
2377
|
+
},
|
|
2378
|
+
onMouseLeave: (s) => {
|
|
2379
|
+
s.currentTarget.style.color = "#1f2937";
|
|
2380
|
+
},
|
|
2381
|
+
children: e.title
|
|
2382
|
+
}
|
|
2383
|
+
),
|
|
2384
|
+
/* @__PURE__ */ y(
|
|
2385
|
+
"span",
|
|
2386
|
+
{
|
|
2387
|
+
style: {
|
|
2388
|
+
fontSize: 11,
|
|
2389
|
+
color: "#94a3b8",
|
|
2390
|
+
lineHeight: 1.35
|
|
2391
|
+
},
|
|
2392
|
+
children: [
|
|
2393
|
+
e.rank,
|
|
2394
|
+
". ",
|
|
2395
|
+
cr(e.link)
|
|
2396
|
+
]
|
|
2397
|
+
}
|
|
2398
|
+
),
|
|
2399
|
+
a != null && /* @__PURE__ */ y(E, { children: [
|
|
2400
|
+
/* @__PURE__ */ o(
|
|
2401
|
+
"span",
|
|
2402
|
+
{
|
|
2403
|
+
onClick: l ? () => n((s) => !s) : void 0,
|
|
2404
|
+
style: {
|
|
2405
|
+
fontSize: 13,
|
|
2406
|
+
color: "#666",
|
|
2407
|
+
lineHeight: 1.5,
|
|
2408
|
+
whiteSpace: t ? "pre-wrap" : void 0,
|
|
2409
|
+
wordBreak: "break-word",
|
|
2410
|
+
cursor: l ? "pointer" : "default"
|
|
2411
|
+
},
|
|
2412
|
+
children: a
|
|
2413
|
+
}
|
|
2414
|
+
),
|
|
2415
|
+
l && /* @__PURE__ */ o(
|
|
2416
|
+
"span",
|
|
2417
|
+
{
|
|
2418
|
+
style: {
|
|
2419
|
+
fontSize: 11,
|
|
2420
|
+
color: "#999",
|
|
2421
|
+
marginTop: 2
|
|
2422
|
+
},
|
|
2423
|
+
children: t ? r.clickToCollapse : r.clickToExpand
|
|
2424
|
+
}
|
|
2425
|
+
)
|
|
2426
|
+
] })
|
|
2427
|
+
]
|
|
2428
|
+
}
|
|
2429
|
+
);
|
|
2430
|
+
}
|
|
2431
|
+
const ur = ({ data: e, t: r }) => {
|
|
2432
|
+
const [t, n] = I(!1), i = P(
|
|
2433
|
+
() => [...e.items].sort((s, m) => s.rank - m.rank),
|
|
2434
|
+
[e.items]
|
|
2435
|
+
), l = i.length, a = l === 1 ? r.googleResultFound : S(r.googleResultsFound, { n: l });
|
|
2436
|
+
return l === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
2437
|
+
"div",
|
|
2438
|
+
{
|
|
2439
|
+
style: {
|
|
2440
|
+
fontSize: 12,
|
|
2441
|
+
color: "#94a3b8",
|
|
2442
|
+
paddingTop: 4
|
|
2443
|
+
},
|
|
2444
|
+
children: r.memorySearchExploreNoResults
|
|
2445
|
+
}
|
|
2446
|
+
) }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2447
|
+
/* @__PURE__ */ y(
|
|
2448
|
+
C.div,
|
|
2449
|
+
{
|
|
2450
|
+
initial: { opacity: 0 },
|
|
2451
|
+
animate: { opacity: 1 },
|
|
2452
|
+
transition: { duration: 0.25 },
|
|
2453
|
+
style: {
|
|
2454
|
+
display: "flex",
|
|
2455
|
+
flexDirection: "row",
|
|
2456
|
+
flexWrap: "wrap",
|
|
2457
|
+
alignItems: "baseline",
|
|
2458
|
+
gap: "6px 12px",
|
|
2459
|
+
minWidth: 0
|
|
2460
|
+
},
|
|
2461
|
+
children: [
|
|
2462
|
+
/* @__PURE__ */ o(
|
|
2463
|
+
"span",
|
|
2464
|
+
{
|
|
2465
|
+
style: {
|
|
2466
|
+
fontSize: 12,
|
|
2467
|
+
color: "#666",
|
|
2468
|
+
whiteSpace: "nowrap"
|
|
2469
|
+
},
|
|
2470
|
+
children: a
|
|
2471
|
+
}
|
|
2472
|
+
),
|
|
2473
|
+
/* @__PURE__ */ o(
|
|
2474
|
+
"button",
|
|
2475
|
+
{
|
|
2476
|
+
type: "button",
|
|
2477
|
+
onClick: () => n((s) => !s),
|
|
2478
|
+
style: {
|
|
2479
|
+
border: "none",
|
|
2480
|
+
background: "none",
|
|
2481
|
+
padding: 0,
|
|
2482
|
+
cursor: "pointer",
|
|
2483
|
+
fontSize: 12,
|
|
2484
|
+
color: "#666",
|
|
2485
|
+
textDecoration: "underline",
|
|
2486
|
+
fontFamily: "inherit"
|
|
2487
|
+
},
|
|
2488
|
+
children: t ? r.memorySearchHideExploreResults : r.memorySearchViewExploreResults
|
|
2489
|
+
}
|
|
2490
|
+
)
|
|
2491
|
+
]
|
|
2492
|
+
}
|
|
2493
|
+
),
|
|
2494
|
+
t && /* @__PURE__ */ o(
|
|
2495
|
+
"div",
|
|
2496
|
+
{
|
|
2497
|
+
style: {
|
|
2498
|
+
display: "flex",
|
|
2499
|
+
flexDirection: "column",
|
|
2500
|
+
gap: 0,
|
|
2501
|
+
marginTop: 8,
|
|
2502
|
+
paddingTop: 8,
|
|
2503
|
+
borderTop: "1px solid #f0f0f0"
|
|
2504
|
+
},
|
|
2505
|
+
children: i.map((s, m) => /* @__PURE__ */ o(
|
|
2506
|
+
"div",
|
|
2507
|
+
{
|
|
2508
|
+
style: {
|
|
2509
|
+
paddingTop: m > 0 ? 12 : 0,
|
|
2510
|
+
paddingBottom: m < i.length - 1 ? 12 : 0,
|
|
2511
|
+
borderBottom: m < i.length - 1 ? "1px solid #eee" : void 0,
|
|
2512
|
+
minWidth: 0
|
|
2513
|
+
},
|
|
2514
|
+
children: /* @__PURE__ */ o(dr, { item: s, t: r })
|
|
2515
|
+
},
|
|
2516
|
+
`${s.link}-${s.rank}-${m}`
|
|
2517
|
+
))
|
|
2518
|
+
}
|
|
2519
|
+
)
|
|
2520
|
+
] });
|
|
2521
|
+
}, mr = ({
|
|
2522
|
+
data: e,
|
|
2523
|
+
isLatest: r = !1,
|
|
2524
|
+
durationSeconds: t,
|
|
2525
|
+
t: n
|
|
2526
|
+
}) => {
|
|
2527
|
+
const i = e.urls.length, l = i === 1 ? S(n.scrapingPage, { query: e.query }) : S(n.scrapingPages, { n: i, query: e.query });
|
|
2528
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
2529
|
+
/* @__PURE__ */ o(
|
|
2530
|
+
C.div,
|
|
2531
|
+
{
|
|
2532
|
+
style: { color: "#666" },
|
|
2533
|
+
initial: { opacity: 0, y: -10 },
|
|
2534
|
+
animate: { opacity: 1, y: 0 },
|
|
2535
|
+
transition: { duration: 0.3, delay: 0 },
|
|
2536
|
+
children: r && !t ? /* @__PURE__ */ o(
|
|
2537
|
+
M,
|
|
2538
|
+
{
|
|
2539
|
+
text: l,
|
|
2540
|
+
duration: 2.5,
|
|
2541
|
+
repeat: !0,
|
|
2542
|
+
color: "#999",
|
|
2543
|
+
shimmerColor: "#000"
|
|
2544
|
+
}
|
|
2545
|
+
) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: l })
|
|
2546
|
+
}
|
|
2547
|
+
),
|
|
2548
|
+
t !== void 0 && /* @__PURE__ */ o(
|
|
2549
|
+
"div",
|
|
2550
|
+
{
|
|
2551
|
+
style: {
|
|
2552
|
+
fontSize: "12px",
|
|
2553
|
+
color: "#999",
|
|
2554
|
+
marginTop: "4px",
|
|
2555
|
+
fontStyle: "italic"
|
|
2556
|
+
},
|
|
2557
|
+
children: S(n.tookSeconds, { n: t })
|
|
2558
|
+
}
|
|
2559
|
+
)
|
|
2560
|
+
] });
|
|
2561
|
+
}, ie = 80;
|
|
2562
|
+
function pr(e, r = 48) {
|
|
2563
|
+
try {
|
|
2564
|
+
const t = new URL(e), n = t.pathname.length > r ? `${t.pathname.slice(0, r)}…` : t.pathname, i = n === "/" ? "" : n;
|
|
2565
|
+
return `${t.hostname}${i}${t.search ? "…" : ""}`;
|
|
2566
|
+
} catch {
|
|
2567
|
+
return e.length > 64 ? `${e.slice(0, 64)}…` : e;
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
function yr({ item: e }) {
|
|
2571
|
+
return e.error != null ? /* @__PURE__ */ o(H, { color: "#c62828", size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 });
|
|
2572
|
+
}
|
|
2573
|
+
function gr({
|
|
2574
|
+
item: e,
|
|
2575
|
+
t: r
|
|
2576
|
+
}) {
|
|
2577
|
+
const [t, n] = I(!1), i = e.error ?? e.summary ?? "", l = e.error != null, a = i.length > ie, s = i.length === 0 ? void 0 : t || !a ? i : `${i.slice(0, ie)}...`;
|
|
2578
|
+
return /* @__PURE__ */ y(
|
|
2579
|
+
C.div,
|
|
2580
|
+
{
|
|
2581
|
+
initial: { opacity: 0 },
|
|
2582
|
+
animate: { opacity: 1 },
|
|
2583
|
+
transition: { duration: 0.25 },
|
|
2584
|
+
style: {
|
|
2585
|
+
display: "flex",
|
|
2586
|
+
flexDirection: "row",
|
|
2587
|
+
alignItems: "flex-start",
|
|
2588
|
+
gap: "10px",
|
|
2589
|
+
minWidth: 0
|
|
2590
|
+
},
|
|
2591
|
+
children: [
|
|
2592
|
+
/* @__PURE__ */ o(
|
|
2593
|
+
"div",
|
|
2594
|
+
{
|
|
2595
|
+
style: {
|
|
2596
|
+
display: "flex",
|
|
2597
|
+
alignItems: "center",
|
|
2598
|
+
justifyContent: "center",
|
|
2599
|
+
flexShrink: 0,
|
|
2600
|
+
width: 32,
|
|
2601
|
+
paddingTop: 2
|
|
2602
|
+
},
|
|
2603
|
+
children: /* @__PURE__ */ o(yr, { item: e })
|
|
2604
|
+
}
|
|
2605
|
+
),
|
|
2606
|
+
/* @__PURE__ */ y(
|
|
2607
|
+
"div",
|
|
2608
|
+
{
|
|
2609
|
+
style: {
|
|
2610
|
+
display: "flex",
|
|
2611
|
+
flexDirection: "column",
|
|
2612
|
+
gap: "4px",
|
|
2613
|
+
minWidth: 0,
|
|
2614
|
+
flex: 1
|
|
2615
|
+
},
|
|
2616
|
+
children: [
|
|
2617
|
+
/* @__PURE__ */ o(
|
|
2618
|
+
"a",
|
|
2619
|
+
{
|
|
2620
|
+
href: e.url,
|
|
2621
|
+
target: "_blank",
|
|
2622
|
+
rel: "noopener noreferrer",
|
|
2623
|
+
style: {
|
|
2624
|
+
fontSize: 13,
|
|
2625
|
+
fontWeight: 500,
|
|
2626
|
+
color: "#2563eb",
|
|
2627
|
+
textDecoration: "none",
|
|
2628
|
+
wordBreak: "break-all"
|
|
2629
|
+
},
|
|
2630
|
+
onMouseEnter: (m) => {
|
|
2631
|
+
m.currentTarget.style.textDecoration = "underline";
|
|
2632
|
+
},
|
|
2633
|
+
onMouseLeave: (m) => {
|
|
2634
|
+
m.currentTarget.style.textDecoration = "none";
|
|
2635
|
+
},
|
|
2636
|
+
children: pr(e.url)
|
|
2637
|
+
}
|
|
2638
|
+
),
|
|
2639
|
+
s != null && /* @__PURE__ */ y(E, { children: [
|
|
2640
|
+
/* @__PURE__ */ o(
|
|
2641
|
+
"span",
|
|
2642
|
+
{
|
|
2643
|
+
onClick: a ? () => n((m) => !m) : void 0,
|
|
2644
|
+
style: {
|
|
2645
|
+
fontSize: 12,
|
|
2646
|
+
color: l ? "#c62828" : "#666",
|
|
2647
|
+
lineHeight: 1.4,
|
|
2648
|
+
whiteSpace: t ? "pre-wrap" : void 0,
|
|
2649
|
+
wordBreak: "break-word",
|
|
2650
|
+
cursor: a ? "pointer" : "default"
|
|
2651
|
+
},
|
|
2652
|
+
children: s
|
|
2653
|
+
}
|
|
2654
|
+
),
|
|
2655
|
+
a && /* @__PURE__ */ o(
|
|
2656
|
+
"span",
|
|
2657
|
+
{
|
|
2658
|
+
style: {
|
|
2659
|
+
fontSize: 11,
|
|
2660
|
+
color: "#999",
|
|
2661
|
+
marginTop: 2
|
|
2662
|
+
},
|
|
2663
|
+
children: t ? r.clickToCollapse : r.clickToExpand
|
|
2664
|
+
}
|
|
2665
|
+
)
|
|
2666
|
+
] })
|
|
2667
|
+
]
|
|
2668
|
+
}
|
|
2669
|
+
)
|
|
2670
|
+
]
|
|
2671
|
+
}
|
|
2672
|
+
);
|
|
2673
|
+
}
|
|
2674
|
+
const hr = ({
|
|
2675
|
+
data: e,
|
|
2676
|
+
t: r
|
|
2677
|
+
}) => {
|
|
2678
|
+
const [t, n] = I(!1), i = e.items, { successCount: l, errorCount: a } = P(() => {
|
|
2679
|
+
let d = 0, u = 0;
|
|
2680
|
+
for (const g of i)
|
|
2681
|
+
g.error != null ? u += 1 : d += 1;
|
|
2682
|
+
return { successCount: d, errorCount: u };
|
|
2683
|
+
}, [i]), s = i.length, m = s === 1 ? r.scrapedPage : S(r.scrapedPages, { n: s }), p = S(r.scrapeOkCount, { n: l }), c = a > 0 ? `${m} - ${p}, ${S(r.scrapeFailedCount, { n: a })}` : `${m} - ${p}`;
|
|
2684
|
+
return s === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
2685
|
+
"div",
|
|
2686
|
+
{
|
|
2687
|
+
style: {
|
|
2688
|
+
fontSize: 12,
|
|
2689
|
+
color: "#94a3b8",
|
|
2690
|
+
paddingTop: 4
|
|
2691
|
+
},
|
|
2692
|
+
children: r.memorySearchExploreNoResults
|
|
2693
|
+
}
|
|
2694
|
+
) }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2695
|
+
/* @__PURE__ */ y(
|
|
2696
|
+
C.div,
|
|
2697
|
+
{
|
|
2698
|
+
initial: { opacity: 0 },
|
|
2699
|
+
animate: { opacity: 1 },
|
|
2700
|
+
transition: { duration: 0.25 },
|
|
2701
|
+
style: {
|
|
2702
|
+
display: "flex",
|
|
2703
|
+
flexDirection: "row",
|
|
2704
|
+
flexWrap: "wrap",
|
|
2705
|
+
alignItems: "baseline",
|
|
2706
|
+
gap: "6px 12px",
|
|
2707
|
+
minWidth: 0
|
|
2708
|
+
},
|
|
2709
|
+
children: [
|
|
2710
|
+
/* @__PURE__ */ o(
|
|
2711
|
+
"span",
|
|
2712
|
+
{
|
|
2713
|
+
style: {
|
|
2714
|
+
fontSize: 12,
|
|
2715
|
+
color: "#666"
|
|
2716
|
+
},
|
|
2717
|
+
children: c
|
|
2718
|
+
}
|
|
2719
|
+
),
|
|
2720
|
+
/* @__PURE__ */ o(
|
|
2721
|
+
"button",
|
|
2722
|
+
{
|
|
2723
|
+
type: "button",
|
|
2724
|
+
onClick: () => n((d) => !d),
|
|
2725
|
+
style: {
|
|
2726
|
+
border: "none",
|
|
2727
|
+
background: "none",
|
|
2728
|
+
padding: 0,
|
|
2729
|
+
cursor: "pointer",
|
|
2730
|
+
fontSize: 12,
|
|
2731
|
+
color: "#666",
|
|
2732
|
+
textDecoration: "underline",
|
|
2733
|
+
fontFamily: "inherit"
|
|
2734
|
+
},
|
|
2735
|
+
children: t ? r.memorySearchHideExploreResults : r.memorySearchViewExploreResults
|
|
2736
|
+
}
|
|
2737
|
+
)
|
|
2738
|
+
]
|
|
2739
|
+
}
|
|
2740
|
+
),
|
|
2741
|
+
t && /* @__PURE__ */ o(
|
|
2742
|
+
"div",
|
|
2743
|
+
{
|
|
2744
|
+
style: {
|
|
2745
|
+
display: "flex",
|
|
2746
|
+
flexDirection: "column",
|
|
2747
|
+
gap: 0,
|
|
2748
|
+
marginTop: 8,
|
|
2749
|
+
paddingTop: 8,
|
|
2750
|
+
borderTop: "1px solid #f0f0f0"
|
|
2751
|
+
},
|
|
2752
|
+
children: i.map((d, u) => /* @__PURE__ */ o(
|
|
2753
|
+
"div",
|
|
2754
|
+
{
|
|
2755
|
+
style: {
|
|
2756
|
+
paddingTop: u > 0 ? 12 : 0,
|
|
2757
|
+
paddingBottom: u < i.length - 1 ? 12 : 0,
|
|
2758
|
+
borderBottom: u < i.length - 1 ? "1px solid #eee" : void 0,
|
|
2759
|
+
minWidth: 0
|
|
2760
|
+
},
|
|
2761
|
+
children: /* @__PURE__ */ o(gr, { item: d, t: r })
|
|
2762
|
+
},
|
|
2763
|
+
`${d.url}-${u}`
|
|
2764
|
+
))
|
|
2765
|
+
}
|
|
2766
|
+
)
|
|
2767
|
+
] });
|
|
2272
2768
|
};
|
|
2273
|
-
function
|
|
2274
|
-
return e.error != null ? /* @__PURE__ */ o(
|
|
2769
|
+
function fr({ item: e }) {
|
|
2770
|
+
return e.error != null ? /* @__PURE__ */ o(H, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
2275
2771
|
}
|
|
2276
|
-
function
|
|
2277
|
-
return
|
|
2772
|
+
function Sr(e, r) {
|
|
2773
|
+
return S(r.searchingInMemoriesOfType, {
|
|
2278
2774
|
name: e.memoryTypeName
|
|
2279
2775
|
});
|
|
2280
2776
|
}
|
|
2281
|
-
function
|
|
2777
|
+
function xr({
|
|
2282
2778
|
item: e,
|
|
2283
2779
|
t: r,
|
|
2284
2780
|
showShimmerForPrimary: t
|
|
2285
2781
|
}) {
|
|
2286
|
-
const n = e.result != null, i = e.error != null, l =
|
|
2287
|
-
return /* @__PURE__ */
|
|
2782
|
+
const n = e.result != null, i = e.error != null, l = Sr(e, r);
|
|
2783
|
+
return /* @__PURE__ */ y(
|
|
2288
2784
|
C.div,
|
|
2289
2785
|
{
|
|
2290
2786
|
initial: { opacity: 0 },
|
|
@@ -2311,10 +2807,10 @@ function lr({
|
|
|
2311
2807
|
flexShrink: 0,
|
|
2312
2808
|
width: 32
|
|
2313
2809
|
},
|
|
2314
|
-
children: /* @__PURE__ */ o(
|
|
2810
|
+
children: /* @__PURE__ */ o(fr, { item: e })
|
|
2315
2811
|
}
|
|
2316
2812
|
),
|
|
2317
|
-
/* @__PURE__ */
|
|
2813
|
+
/* @__PURE__ */ y(
|
|
2318
2814
|
"div",
|
|
2319
2815
|
{
|
|
2320
2816
|
style: {
|
|
@@ -2335,14 +2831,14 @@ function lr({
|
|
|
2335
2831
|
shimmerColor: "#000"
|
|
2336
2832
|
}
|
|
2337
2833
|
) : l }),
|
|
2338
|
-
n && /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#666" }, children: e.result.numberOfChunks === 1 ?
|
|
2834
|
+
n && /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#666" }, children: e.result.numberOfChunks === 1 ? S(
|
|
2339
2835
|
r.memorySearchTypeResultSummaryOne,
|
|
2340
2836
|
{
|
|
2341
2837
|
score: e.result.highestChunkScore.toFixed(
|
|
2342
2838
|
2
|
|
2343
2839
|
)
|
|
2344
2840
|
}
|
|
2345
|
-
) :
|
|
2841
|
+
) : S(
|
|
2346
2842
|
r.memorySearchTypeResultSummary,
|
|
2347
2843
|
{
|
|
2348
2844
|
count: e.result.numberOfChunks,
|
|
@@ -2359,14 +2855,14 @@ function lr({
|
|
|
2359
2855
|
}
|
|
2360
2856
|
);
|
|
2361
2857
|
}
|
|
2362
|
-
const
|
|
2363
|
-
const i =
|
|
2858
|
+
const kr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
2859
|
+
const i = P(() => {
|
|
2364
2860
|
let l = -1;
|
|
2365
|
-
return e.memoryTypes.forEach((a,
|
|
2366
|
-
a.result == null && a.error == null && (l =
|
|
2861
|
+
return e.memoryTypes.forEach((a, s) => {
|
|
2862
|
+
a.result == null && a.error == null && (l = s);
|
|
2367
2863
|
}), l;
|
|
2368
2864
|
}, [e.memoryTypes]);
|
|
2369
|
-
return /* @__PURE__ */
|
|
2865
|
+
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2370
2866
|
r && !t && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(
|
|
2371
2867
|
M,
|
|
2372
2868
|
{
|
|
@@ -2377,7 +2873,7 @@ const cr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
2377
2873
|
shimmerColor: "#000"
|
|
2378
2874
|
}
|
|
2379
2875
|
) : e.memoryTypes.map((l, a) => /* @__PURE__ */ o(
|
|
2380
|
-
|
|
2876
|
+
xr,
|
|
2381
2877
|
{
|
|
2382
2878
|
item: l,
|
|
2383
2879
|
t: n,
|
|
@@ -2394,44 +2890,44 @@ const cr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
2394
2890
|
marginTop: "4px",
|
|
2395
2891
|
fontStyle: "italic"
|
|
2396
2892
|
},
|
|
2397
|
-
children:
|
|
2893
|
+
children: S(n.tookSeconds, { n: t })
|
|
2398
2894
|
}
|
|
2399
2895
|
)
|
|
2400
2896
|
] });
|
|
2401
|
-
},
|
|
2402
|
-
|
|
2403
|
-
),
|
|
2404
|
-
5 *
|
|
2897
|
+
}, $ = 12, N = 1.45, br = Math.ceil(
|
|
2898
|
+
$ * N
|
|
2899
|
+
), vr = Math.ceil(
|
|
2900
|
+
5 * $ * N
|
|
2405
2901
|
);
|
|
2406
|
-
function
|
|
2902
|
+
function B(e) {
|
|
2407
2903
|
return e.queries != null && e.queries.length > 0;
|
|
2408
2904
|
}
|
|
2409
|
-
function
|
|
2905
|
+
function Tr(e) {
|
|
2410
2906
|
const r = e.reasoning;
|
|
2411
|
-
return (r == null || r === "") && !
|
|
2907
|
+
return (r == null || r === "") && !B(e);
|
|
2412
2908
|
}
|
|
2413
|
-
function
|
|
2414
|
-
if (
|
|
2909
|
+
function wr(e) {
|
|
2910
|
+
if (B(e)) return 3;
|
|
2415
2911
|
const r = e.reasoning;
|
|
2416
2912
|
return r == null || r === "" ? 1 : e.reasoningCompleted === !0 ? 2 : 1;
|
|
2417
2913
|
}
|
|
2418
|
-
function
|
|
2419
|
-
return e === 3 ? /* @__PURE__ */ o(
|
|
2914
|
+
function Cr({ phase: e }) {
|
|
2915
|
+
return e === 3 ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
2420
2916
|
}
|
|
2421
|
-
function
|
|
2917
|
+
function Ir({
|
|
2422
2918
|
item: e,
|
|
2423
2919
|
t: r,
|
|
2424
2920
|
isActiveRow: t
|
|
2425
2921
|
}) {
|
|
2426
|
-
const n =
|
|
2427
|
-
|
|
2428
|
-
const
|
|
2429
|
-
|
|
2922
|
+
const n = Tr(e), i = wr(e), l = e.reasoning, a = l != null && l.length > 0, s = A(null), [m, p] = I(!1), c = n && t, d = i === 2 && t && !B(e);
|
|
2923
|
+
F(() => {
|
|
2924
|
+
const h = s.current;
|
|
2925
|
+
h != null && i === 1 && a && (h.scrollTop = h.scrollHeight);
|
|
2430
2926
|
}, [l, i, a]);
|
|
2431
|
-
const
|
|
2927
|
+
const u = S(r.searchingInMemoriesOfType, {
|
|
2432
2928
|
name: e.memoryTypeName
|
|
2433
2929
|
}), g = !n && i === 3;
|
|
2434
|
-
return /* @__PURE__ */
|
|
2930
|
+
return /* @__PURE__ */ y(
|
|
2435
2931
|
C.div,
|
|
2436
2932
|
{
|
|
2437
2933
|
initial: { opacity: 0 },
|
|
@@ -2459,10 +2955,10 @@ function hr({
|
|
|
2459
2955
|
width: 32,
|
|
2460
2956
|
...g ? { paddingTop: 2 } : {}
|
|
2461
2957
|
},
|
|
2462
|
-
children: /* @__PURE__ */ o(
|
|
2958
|
+
children: /* @__PURE__ */ o(Cr, { phase: n ? 1 : i })
|
|
2463
2959
|
}
|
|
2464
2960
|
),
|
|
2465
|
-
/* @__PURE__ */
|
|
2961
|
+
/* @__PURE__ */ y(
|
|
2466
2962
|
"div",
|
|
2467
2963
|
{
|
|
2468
2964
|
style: {
|
|
@@ -2473,17 +2969,17 @@ function hr({
|
|
|
2473
2969
|
flex: 1
|
|
2474
2970
|
},
|
|
2475
2971
|
children: [
|
|
2476
|
-
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children:
|
|
2972
|
+
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: c ? /* @__PURE__ */ o(
|
|
2477
2973
|
M,
|
|
2478
2974
|
{
|
|
2479
|
-
text:
|
|
2975
|
+
text: u,
|
|
2480
2976
|
duration: 2.5,
|
|
2481
2977
|
repeat: !0,
|
|
2482
2978
|
color: "#999",
|
|
2483
2979
|
shimmerColor: "#000"
|
|
2484
2980
|
}
|
|
2485
2981
|
) : e.memoryTypeName }),
|
|
2486
|
-
i === 1 && a && !
|
|
2982
|
+
i === 1 && a && !B(e) && /* @__PURE__ */ y("div", { style: { minWidth: 0 }, children: [
|
|
2487
2983
|
/* @__PURE__ */ o(
|
|
2488
2984
|
"span",
|
|
2489
2985
|
{
|
|
@@ -2509,16 +3005,16 @@ function hr({
|
|
|
2509
3005
|
children: /* @__PURE__ */ o(
|
|
2510
3006
|
"div",
|
|
2511
3007
|
{
|
|
2512
|
-
ref:
|
|
3008
|
+
ref: s,
|
|
2513
3009
|
className: "memory-search-generating-reasoning-viewport",
|
|
2514
3010
|
style: {
|
|
2515
|
-
minHeight:
|
|
2516
|
-
maxHeight:
|
|
3011
|
+
minHeight: br,
|
|
3012
|
+
maxHeight: vr,
|
|
2517
3013
|
height: "auto",
|
|
2518
3014
|
overflowY: "auto",
|
|
2519
3015
|
overflowX: "hidden",
|
|
2520
|
-
fontSize:
|
|
2521
|
-
lineHeight:
|
|
3016
|
+
fontSize: $,
|
|
3017
|
+
lineHeight: N,
|
|
2522
3018
|
whiteSpace: "pre-wrap",
|
|
2523
3019
|
wordBreak: "break-word",
|
|
2524
3020
|
color: "#888"
|
|
@@ -2539,8 +3035,8 @@ function hr({
|
|
|
2539
3035
|
shimmerColor: "#000"
|
|
2540
3036
|
}
|
|
2541
3037
|
) }),
|
|
2542
|
-
i === 3 && /* @__PURE__ */
|
|
2543
|
-
/* @__PURE__ */
|
|
3038
|
+
i === 3 && /* @__PURE__ */ y(E, { children: [
|
|
3039
|
+
/* @__PURE__ */ y("div", { style: { minWidth: 0 }, children: [
|
|
2544
3040
|
/* @__PURE__ */ o(
|
|
2545
3041
|
"span",
|
|
2546
3042
|
{
|
|
@@ -2562,7 +3058,7 @@ function hr({
|
|
|
2562
3058
|
flexDirection: "column",
|
|
2563
3059
|
gap: 6
|
|
2564
3060
|
},
|
|
2565
|
-
children: e.queries.map((
|
|
3061
|
+
children: e.queries.map((h, f) => /* @__PURE__ */ o(
|
|
2566
3062
|
"div",
|
|
2567
3063
|
{
|
|
2568
3064
|
style: {
|
|
@@ -2571,19 +3067,19 @@ function hr({
|
|
|
2571
3067
|
lineHeight: 1.5,
|
|
2572
3068
|
wordBreak: "break-word"
|
|
2573
3069
|
},
|
|
2574
|
-
children:
|
|
3070
|
+
children: h.query
|
|
2575
3071
|
},
|
|
2576
3072
|
f
|
|
2577
3073
|
))
|
|
2578
3074
|
}
|
|
2579
3075
|
)
|
|
2580
3076
|
] }),
|
|
2581
|
-
a && /* @__PURE__ */
|
|
3077
|
+
a && /* @__PURE__ */ y(E, { children: [
|
|
2582
3078
|
/* @__PURE__ */ o(
|
|
2583
3079
|
"button",
|
|
2584
3080
|
{
|
|
2585
3081
|
type: "button",
|
|
2586
|
-
onClick: () =>
|
|
3082
|
+
onClick: () => p((h) => !h),
|
|
2587
3083
|
style: {
|
|
2588
3084
|
alignSelf: "flex-start",
|
|
2589
3085
|
border: "none",
|
|
@@ -2594,15 +3090,15 @@ function hr({
|
|
|
2594
3090
|
color: "#666",
|
|
2595
3091
|
textDecoration: "underline"
|
|
2596
3092
|
},
|
|
2597
|
-
children:
|
|
3093
|
+
children: m ? r.memorySearchHideReasoning : r.memorySearchViewReasoning
|
|
2598
3094
|
}
|
|
2599
3095
|
),
|
|
2600
|
-
|
|
3096
|
+
m && /* @__PURE__ */ o(
|
|
2601
3097
|
"div",
|
|
2602
3098
|
{
|
|
2603
3099
|
style: {
|
|
2604
|
-
fontSize:
|
|
2605
|
-
lineHeight:
|
|
3100
|
+
fontSize: $,
|
|
3101
|
+
lineHeight: N,
|
|
2606
3102
|
whiteSpace: "pre-wrap",
|
|
2607
3103
|
wordBreak: "break-word",
|
|
2608
3104
|
color: "#888",
|
|
@@ -2622,14 +3118,14 @@ function hr({
|
|
|
2622
3118
|
}
|
|
2623
3119
|
);
|
|
2624
3120
|
}
|
|
2625
|
-
const
|
|
2626
|
-
const i =
|
|
3121
|
+
const Er = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
3122
|
+
const i = P(() => {
|
|
2627
3123
|
let l = -1;
|
|
2628
|
-
return e.memoryTypes.forEach((a,
|
|
2629
|
-
|
|
3124
|
+
return e.memoryTypes.forEach((a, s) => {
|
|
3125
|
+
B(a) || (l = s);
|
|
2630
3126
|
}), l;
|
|
2631
3127
|
}, [e.memoryTypes]);
|
|
2632
|
-
return /* @__PURE__ */
|
|
3128
|
+
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2633
3129
|
r && !t && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(
|
|
2634
3130
|
M,
|
|
2635
3131
|
{
|
|
@@ -2640,7 +3136,7 @@ const pr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
2640
3136
|
shimmerColor: "#000"
|
|
2641
3137
|
}
|
|
2642
3138
|
) : e.memoryTypes.map((l, a) => /* @__PURE__ */ o(
|
|
2643
|
-
|
|
3139
|
+
Ir,
|
|
2644
3140
|
{
|
|
2645
3141
|
item: l,
|
|
2646
3142
|
t: n,
|
|
@@ -2657,15 +3153,15 @@ const pr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
2657
3153
|
marginTop: "4px",
|
|
2658
3154
|
fontStyle: "italic"
|
|
2659
3155
|
},
|
|
2660
|
-
children:
|
|
3156
|
+
children: S(n.tookSeconds, { n: t })
|
|
2661
3157
|
}
|
|
2662
3158
|
)
|
|
2663
3159
|
] });
|
|
2664
3160
|
};
|
|
2665
|
-
function
|
|
2666
|
-
return e.some((n) => n.result == null && n.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((n) => n.error != null) ? /* @__PURE__ */ o(
|
|
3161
|
+
function Mr(e) {
|
|
3162
|
+
return e.some((n) => n.result == null && n.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((n) => n.error != null) ? /* @__PURE__ */ o(H, { color: "#c62828", size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 });
|
|
2667
3163
|
}
|
|
2668
|
-
function
|
|
3164
|
+
function Rr(e, r) {
|
|
2669
3165
|
if (e.error != null)
|
|
2670
3166
|
return /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#c62828", whiteSpace: "nowrap" }, children: e.error });
|
|
2671
3167
|
if (e.result == null)
|
|
@@ -2679,16 +3175,16 @@ function Sr(e, r) {
|
|
|
2679
3175
|
shimmerColor: "#000"
|
|
2680
3176
|
}
|
|
2681
3177
|
) });
|
|
2682
|
-
const t = e.result, n = t.numberOfChunks === 1 ? r.chunkFound :
|
|
3178
|
+
const t = e.result, n = t.numberOfChunks === 1 ? r.chunkFound : S(r.chunksFound, { n: t.numberOfChunks }), i = S(r.scoreLabel, {
|
|
2683
3179
|
n: t.highestChunkScore.toFixed(2)
|
|
2684
3180
|
});
|
|
2685
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ y("span", { style: { fontSize: 12, color: "#666", whiteSpace: "nowrap" }, children: [
|
|
2686
3182
|
n,
|
|
2687
3183
|
" · ",
|
|
2688
3184
|
i
|
|
2689
3185
|
] });
|
|
2690
3186
|
}
|
|
2691
|
-
function
|
|
3187
|
+
function Fr({
|
|
2692
3188
|
items: e,
|
|
2693
3189
|
queryRow: r,
|
|
2694
3190
|
onExploreQueryResultClick: t,
|
|
@@ -2719,26 +3215,26 @@ function xr({
|
|
|
2719
3215
|
paddingTop: 8,
|
|
2720
3216
|
borderTop: "1px solid #f0f0f0"
|
|
2721
3217
|
},
|
|
2722
|
-
children: e.map((
|
|
2723
|
-
const
|
|
2724
|
-
|
|
3218
|
+
children: e.map((s, m) => {
|
|
3219
|
+
const p = s.memoryTitle !== "" ? s.memoryTitle : s.memoryId, c = V(
|
|
3220
|
+
s.chunks
|
|
2725
3221
|
), d = [
|
|
2726
|
-
X(
|
|
2727
|
-
|
|
2728
|
-
n:
|
|
3222
|
+
X(s),
|
|
3223
|
+
S(n.scoreLabel, {
|
|
3224
|
+
n: s.matchingChunkScore.toFixed(2)
|
|
2729
3225
|
}),
|
|
2730
|
-
|
|
3226
|
+
c.length > 0 ? K(c, n) : n.pagesNotAvailable
|
|
2731
3227
|
].filter(
|
|
2732
3228
|
(f) => f != null && f !== ""
|
|
2733
|
-
),
|
|
2734
|
-
memoryId:
|
|
2735
|
-
memoryTitle:
|
|
2736
|
-
pageNumbers:
|
|
3229
|
+
), u = {
|
|
3230
|
+
memoryId: s.memoryId,
|
|
3231
|
+
memoryTitle: s.memoryTitle,
|
|
3232
|
+
pageNumbers: c,
|
|
2737
3233
|
memoryTypeId: r.memoryTypeId,
|
|
2738
3234
|
memoryTypeName: r.memoryTypeName,
|
|
2739
3235
|
query: r.query
|
|
2740
|
-
}, g = `${r.query}::${
|
|
2741
|
-
return /* @__PURE__ */
|
|
3236
|
+
}, g = `${r.query}::${s.memoryId}::${m}`, h = i === g;
|
|
3237
|
+
return /* @__PURE__ */ y(
|
|
2742
3238
|
"div",
|
|
2743
3239
|
{
|
|
2744
3240
|
style: {
|
|
@@ -2746,13 +3242,13 @@ function xr({
|
|
|
2746
3242
|
flexDirection: "row",
|
|
2747
3243
|
alignItems: "flex-start",
|
|
2748
3244
|
gap: "12px",
|
|
2749
|
-
paddingTop:
|
|
2750
|
-
paddingBottom:
|
|
2751
|
-
borderBottom:
|
|
3245
|
+
paddingTop: m > 0 ? 12 : 0,
|
|
3246
|
+
paddingBottom: m < e.length - 1 ? 12 : 0,
|
|
3247
|
+
borderBottom: m < e.length - 1 ? "1px solid #eee" : void 0,
|
|
2752
3248
|
minWidth: 0
|
|
2753
3249
|
},
|
|
2754
3250
|
children: [
|
|
2755
|
-
/* @__PURE__ */
|
|
3251
|
+
/* @__PURE__ */ y(
|
|
2756
3252
|
"div",
|
|
2757
3253
|
{
|
|
2758
3254
|
style: {
|
|
@@ -2771,7 +3267,7 @@ function xr({
|
|
|
2771
3267
|
fontWeight: 600,
|
|
2772
3268
|
color: "#333"
|
|
2773
3269
|
},
|
|
2774
|
-
children:
|
|
3270
|
+
children: p
|
|
2775
3271
|
}
|
|
2776
3272
|
),
|
|
2777
3273
|
/* @__PURE__ */ o(
|
|
@@ -2784,8 +3280,8 @@ function xr({
|
|
|
2784
3280
|
whiteSpace: "pre-wrap",
|
|
2785
3281
|
wordBreak: "break-word"
|
|
2786
3282
|
},
|
|
2787
|
-
children:
|
|
2788
|
-
|
|
3283
|
+
children: Q(
|
|
3284
|
+
s.chunks
|
|
2789
3285
|
)
|
|
2790
3286
|
}
|
|
2791
3287
|
),
|
|
@@ -2804,17 +3300,17 @@ function xr({
|
|
|
2804
3300
|
]
|
|
2805
3301
|
}
|
|
2806
3302
|
),
|
|
2807
|
-
a && /* @__PURE__ */
|
|
3303
|
+
a && /* @__PURE__ */ y(
|
|
2808
3304
|
"button",
|
|
2809
3305
|
{
|
|
2810
3306
|
type: "button",
|
|
2811
|
-
"aria-busy":
|
|
2812
|
-
disabled:
|
|
3307
|
+
"aria-busy": h,
|
|
3308
|
+
disabled: h,
|
|
2813
3309
|
onClick: async () => {
|
|
2814
3310
|
l(g);
|
|
2815
3311
|
try {
|
|
2816
3312
|
await t(
|
|
2817
|
-
|
|
3313
|
+
u
|
|
2818
3314
|
);
|
|
2819
3315
|
} finally {
|
|
2820
3316
|
l(null);
|
|
@@ -2830,14 +3326,14 @@ function xr({
|
|
|
2830
3326
|
background: "#eff6ff",
|
|
2831
3327
|
border: "1px solid #bfdbfe",
|
|
2832
3328
|
borderRadius: 6,
|
|
2833
|
-
cursor:
|
|
3329
|
+
cursor: h ? "wait" : "pointer",
|
|
2834
3330
|
fontFamily: "inherit",
|
|
2835
3331
|
display: "inline-flex",
|
|
2836
3332
|
alignItems: "center",
|
|
2837
3333
|
gap: 8
|
|
2838
3334
|
},
|
|
2839
3335
|
children: [
|
|
2840
|
-
|
|
3336
|
+
h && /* @__PURE__ */ o(
|
|
2841
3337
|
"span",
|
|
2842
3338
|
{
|
|
2843
3339
|
className: "explore-memory-loader explore-memory-loader--callback",
|
|
@@ -2850,13 +3346,13 @@ function xr({
|
|
|
2850
3346
|
)
|
|
2851
3347
|
]
|
|
2852
3348
|
},
|
|
2853
|
-
`${
|
|
3349
|
+
`${s.memoryId}-${m}`
|
|
2854
3350
|
);
|
|
2855
3351
|
})
|
|
2856
3352
|
}
|
|
2857
3353
|
);
|
|
2858
3354
|
}
|
|
2859
|
-
function
|
|
3355
|
+
function Ar(e) {
|
|
2860
3356
|
const r = [], t = /* @__PURE__ */ new Map();
|
|
2861
3357
|
return e.forEach((n, i) => {
|
|
2862
3358
|
let l = t.get(n.memoryTypeId);
|
|
@@ -2867,7 +3363,7 @@ function kr(e) {
|
|
|
2867
3363
|
}, t.set(n.memoryTypeId, l)), l.items.push({ item: n, flatIndex: i });
|
|
2868
3364
|
}), r.map((n) => t.get(n));
|
|
2869
3365
|
}
|
|
2870
|
-
function
|
|
3366
|
+
function Lr({
|
|
2871
3367
|
group: e,
|
|
2872
3368
|
t: r,
|
|
2873
3369
|
isLatest: t,
|
|
@@ -2875,10 +3371,10 @@ function br({
|
|
|
2875
3371
|
toggleExpanded: i,
|
|
2876
3372
|
onExploreQueryResultClick: l
|
|
2877
3373
|
}) {
|
|
2878
|
-
const a = e.items.map((
|
|
2879
|
-
(
|
|
3374
|
+
const a = e.items.map((m) => m.item), s = a.some(
|
|
3375
|
+
(m) => m.result == null && m.error == null
|
|
2880
3376
|
);
|
|
2881
|
-
return /* @__PURE__ */
|
|
3377
|
+
return /* @__PURE__ */ y(
|
|
2882
3378
|
C.div,
|
|
2883
3379
|
{
|
|
2884
3380
|
initial: { opacity: 0 },
|
|
@@ -2890,7 +3386,7 @@ function br({
|
|
|
2890
3386
|
borderBottom: "1px solid #eee",
|
|
2891
3387
|
display: "flex",
|
|
2892
3388
|
flexDirection: "row",
|
|
2893
|
-
alignItems:
|
|
3389
|
+
alignItems: s ? "center" : "flex-start",
|
|
2894
3390
|
gap: "10px",
|
|
2895
3391
|
minWidth: 0
|
|
2896
3392
|
},
|
|
@@ -2904,12 +3400,12 @@ function br({
|
|
|
2904
3400
|
justifyContent: "center",
|
|
2905
3401
|
flexShrink: 0,
|
|
2906
3402
|
width: 32,
|
|
2907
|
-
...
|
|
3403
|
+
...s ? {} : { paddingTop: 2 }
|
|
2908
3404
|
},
|
|
2909
|
-
children:
|
|
3405
|
+
children: Mr(a)
|
|
2910
3406
|
}
|
|
2911
3407
|
),
|
|
2912
|
-
/* @__PURE__ */
|
|
3408
|
+
/* @__PURE__ */ y(
|
|
2913
3409
|
"div",
|
|
2914
3410
|
{
|
|
2915
3411
|
style: {
|
|
@@ -2927,15 +3423,15 @@ function br({
|
|
|
2927
3423
|
fontSize: 12,
|
|
2928
3424
|
color: "#888"
|
|
2929
3425
|
},
|
|
2930
|
-
children:
|
|
3426
|
+
children: S(r.memorySearchExploreQueryTypeLabel, {
|
|
2931
3427
|
name: e.memoryTypeName
|
|
2932
3428
|
})
|
|
2933
3429
|
}
|
|
2934
3430
|
),
|
|
2935
|
-
e.items.map(({ item:
|
|
3431
|
+
e.items.map(({ item: m, flatIndex: p }) => {
|
|
2936
3432
|
var f;
|
|
2937
|
-
const
|
|
2938
|
-
return /* @__PURE__ */
|
|
3433
|
+
const c = m.result != null, d = m.error != null, u = t && !c && !d, g = n[p] === !0, h = ((f = m.result) == null ? void 0 : f.items) ?? [];
|
|
3434
|
+
return /* @__PURE__ */ y(
|
|
2939
3435
|
"div",
|
|
2940
3436
|
{
|
|
2941
3437
|
style: {
|
|
@@ -2945,7 +3441,7 @@ function br({
|
|
|
2945
3441
|
minWidth: 0
|
|
2946
3442
|
},
|
|
2947
3443
|
children: [
|
|
2948
|
-
/* @__PURE__ */
|
|
3444
|
+
/* @__PURE__ */ y(
|
|
2949
3445
|
"div",
|
|
2950
3446
|
{
|
|
2951
3447
|
style: {
|
|
@@ -2968,19 +3464,19 @@ function br({
|
|
|
2968
3464
|
flex: "1 1 12rem",
|
|
2969
3465
|
minWidth: 0
|
|
2970
3466
|
},
|
|
2971
|
-
children:
|
|
3467
|
+
children: u ? /* @__PURE__ */ o(
|
|
2972
3468
|
M,
|
|
2973
3469
|
{
|
|
2974
|
-
text:
|
|
3470
|
+
text: m.query,
|
|
2975
3471
|
duration: 2.5,
|
|
2976
3472
|
repeat: !0,
|
|
2977
3473
|
color: "#999",
|
|
2978
3474
|
shimmerColor: "#000"
|
|
2979
3475
|
}
|
|
2980
|
-
) :
|
|
3476
|
+
) : m.query
|
|
2981
3477
|
}
|
|
2982
3478
|
),
|
|
2983
|
-
/* @__PURE__ */
|
|
3479
|
+
/* @__PURE__ */ y(
|
|
2984
3480
|
"div",
|
|
2985
3481
|
{
|
|
2986
3482
|
style: {
|
|
@@ -2991,12 +3487,12 @@ function br({
|
|
|
2991
3487
|
flexShrink: 0
|
|
2992
3488
|
},
|
|
2993
3489
|
children: [
|
|
2994
|
-
|
|
2995
|
-
|
|
3490
|
+
Rr(m, r),
|
|
3491
|
+
c && /* @__PURE__ */ o(
|
|
2996
3492
|
"button",
|
|
2997
3493
|
{
|
|
2998
3494
|
type: "button",
|
|
2999
|
-
onClick: () => i(
|
|
3495
|
+
onClick: () => i(p),
|
|
3000
3496
|
style: {
|
|
3001
3497
|
border: "none",
|
|
3002
3498
|
background: "none",
|
|
@@ -3016,18 +3512,18 @@ function br({
|
|
|
3016
3512
|
]
|
|
3017
3513
|
}
|
|
3018
3514
|
),
|
|
3019
|
-
|
|
3020
|
-
|
|
3515
|
+
c && g && /* @__PURE__ */ o(
|
|
3516
|
+
Fr,
|
|
3021
3517
|
{
|
|
3022
|
-
items:
|
|
3023
|
-
queryRow:
|
|
3518
|
+
items: h,
|
|
3519
|
+
queryRow: m,
|
|
3024
3520
|
onExploreQueryResultClick: l,
|
|
3025
3521
|
t: r
|
|
3026
3522
|
}
|
|
3027
3523
|
)
|
|
3028
3524
|
]
|
|
3029
3525
|
},
|
|
3030
|
-
`${e.memoryTypeId}-${
|
|
3526
|
+
`${e.memoryTypeId}-${p}-${m.query}`
|
|
3031
3527
|
);
|
|
3032
3528
|
})
|
|
3033
3529
|
]
|
|
@@ -3037,7 +3533,7 @@ function br({
|
|
|
3037
3533
|
}
|
|
3038
3534
|
);
|
|
3039
3535
|
}
|
|
3040
|
-
const
|
|
3536
|
+
const Pr = ({
|
|
3041
3537
|
data: e,
|
|
3042
3538
|
isLatest: r = !1,
|
|
3043
3539
|
durationSeconds: t,
|
|
@@ -3046,16 +3542,16 @@ const vr = ({
|
|
|
3046
3542
|
}) => {
|
|
3047
3543
|
const [l, a] = I(
|
|
3048
3544
|
{}
|
|
3049
|
-
),
|
|
3050
|
-
a((
|
|
3051
|
-
...
|
|
3052
|
-
[
|
|
3545
|
+
), s = z((p) => {
|
|
3546
|
+
a((c) => ({
|
|
3547
|
+
...c,
|
|
3548
|
+
[p]: !c[p]
|
|
3053
3549
|
}));
|
|
3054
|
-
}, []),
|
|
3055
|
-
() =>
|
|
3550
|
+
}, []), m = P(
|
|
3551
|
+
() => Ar(e.queries),
|
|
3056
3552
|
[e.queries]
|
|
3057
3553
|
);
|
|
3058
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
3059
3555
|
r && !t && e.queries.length === 0 ? /* @__PURE__ */ o(
|
|
3060
3556
|
M,
|
|
3061
3557
|
{
|
|
@@ -3065,17 +3561,17 @@ const vr = ({
|
|
|
3065
3561
|
color: "#999",
|
|
3066
3562
|
shimmerColor: "#000"
|
|
3067
3563
|
}
|
|
3068
|
-
) :
|
|
3069
|
-
|
|
3564
|
+
) : m.map((p) => /* @__PURE__ */ o(
|
|
3565
|
+
Lr,
|
|
3070
3566
|
{
|
|
3071
|
-
group:
|
|
3567
|
+
group: p,
|
|
3072
3568
|
t: i,
|
|
3073
3569
|
isLatest: r,
|
|
3074
3570
|
expandedRows: l,
|
|
3075
|
-
toggleExpanded:
|
|
3571
|
+
toggleExpanded: s,
|
|
3076
3572
|
onExploreQueryResultClick: n
|
|
3077
3573
|
},
|
|
3078
|
-
|
|
3574
|
+
p.memoryTypeId
|
|
3079
3575
|
)),
|
|
3080
3576
|
t !== void 0 && /* @__PURE__ */ o(
|
|
3081
3577
|
"div",
|
|
@@ -3086,13 +3582,13 @@ const vr = ({
|
|
|
3086
3582
|
marginTop: "4px",
|
|
3087
3583
|
fontStyle: "italic"
|
|
3088
3584
|
},
|
|
3089
|
-
children:
|
|
3585
|
+
children: S(i.tookSeconds, { n: t })
|
|
3090
3586
|
}
|
|
3091
3587
|
)
|
|
3092
3588
|
] });
|
|
3093
|
-
},
|
|
3589
|
+
}, Dr = ({ data: e, onSearchResultClick: r, t }) => {
|
|
3094
3590
|
const n = e.response.items, i = !!r, [l, a] = I(null);
|
|
3095
|
-
return /* @__PURE__ */
|
|
3591
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
3096
3592
|
/* @__PURE__ */ o(
|
|
3097
3593
|
C.div,
|
|
3098
3594
|
{
|
|
@@ -3116,30 +3612,30 @@ const vr = ({
|
|
|
3116
3612
|
flexDirection: "column",
|
|
3117
3613
|
gap: 0
|
|
3118
3614
|
},
|
|
3119
|
-
children: n.map((
|
|
3120
|
-
const
|
|
3121
|
-
|
|
3615
|
+
children: n.map((s, m) => {
|
|
3616
|
+
const p = s.memoryTitle !== "" ? s.memoryTitle : s.memoryId, c = V(
|
|
3617
|
+
s.chunks
|
|
3122
3618
|
), d = [
|
|
3123
|
-
X(
|
|
3124
|
-
|
|
3125
|
-
n:
|
|
3619
|
+
X(s),
|
|
3620
|
+
S(t.scoreLabel, {
|
|
3621
|
+
n: s.matchingChunkScore.toFixed(2)
|
|
3126
3622
|
}),
|
|
3127
|
-
|
|
3623
|
+
c.length > 0 ? K(c, t) : t.pagesNotAvailable
|
|
3128
3624
|
].filter(
|
|
3129
3625
|
(f) => f != null && f !== ""
|
|
3130
|
-
),
|
|
3131
|
-
memoryId:
|
|
3132
|
-
memoryTitle:
|
|
3133
|
-
memoryTypeId:
|
|
3134
|
-
memoryTypeName:
|
|
3135
|
-
pageNumbers:
|
|
3136
|
-
}, g = `${
|
|
3137
|
-
return /* @__PURE__ */
|
|
3626
|
+
), u = {
|
|
3627
|
+
memoryId: s.memoryId,
|
|
3628
|
+
memoryTitle: s.memoryTitle,
|
|
3629
|
+
memoryTypeId: s.memoryTypeId,
|
|
3630
|
+
memoryTypeName: s.memoryTypeName,
|
|
3631
|
+
pageNumbers: c
|
|
3632
|
+
}, g = `${s.memoryId}-${m}`, h = l === g;
|
|
3633
|
+
return /* @__PURE__ */ y(
|
|
3138
3634
|
C.div,
|
|
3139
3635
|
{
|
|
3140
3636
|
initial: { opacity: 0 },
|
|
3141
3637
|
animate: { opacity: 1 },
|
|
3142
|
-
transition: { duration: 0.2, delay:
|
|
3638
|
+
transition: { duration: 0.2, delay: m * 0.04 },
|
|
3143
3639
|
style: {
|
|
3144
3640
|
display: "flex",
|
|
3145
3641
|
flexDirection: "row",
|
|
@@ -3147,11 +3643,11 @@ const vr = ({
|
|
|
3147
3643
|
gap: "12px",
|
|
3148
3644
|
paddingTop: "12px",
|
|
3149
3645
|
paddingBottom: "12px",
|
|
3150
|
-
borderBottom:
|
|
3646
|
+
borderBottom: m < n.length - 1 ? "1px solid #eee" : void 0,
|
|
3151
3647
|
minWidth: 0
|
|
3152
3648
|
},
|
|
3153
3649
|
children: [
|
|
3154
|
-
/* @__PURE__ */
|
|
3650
|
+
/* @__PURE__ */ y(
|
|
3155
3651
|
"div",
|
|
3156
3652
|
{
|
|
3157
3653
|
style: {
|
|
@@ -3170,7 +3666,7 @@ const vr = ({
|
|
|
3170
3666
|
fontWeight: 600,
|
|
3171
3667
|
color: "#333"
|
|
3172
3668
|
},
|
|
3173
|
-
children:
|
|
3669
|
+
children: p
|
|
3174
3670
|
}
|
|
3175
3671
|
),
|
|
3176
3672
|
/* @__PURE__ */ o(
|
|
@@ -3183,7 +3679,7 @@ const vr = ({
|
|
|
3183
3679
|
whiteSpace: "pre-wrap",
|
|
3184
3680
|
wordBreak: "break-word"
|
|
3185
3681
|
},
|
|
3186
|
-
children:
|
|
3682
|
+
children: Q(s.chunks)
|
|
3187
3683
|
}
|
|
3188
3684
|
),
|
|
3189
3685
|
/* @__PURE__ */ o(
|
|
@@ -3201,16 +3697,16 @@ const vr = ({
|
|
|
3201
3697
|
]
|
|
3202
3698
|
}
|
|
3203
3699
|
),
|
|
3204
|
-
i && /* @__PURE__ */
|
|
3700
|
+
i && /* @__PURE__ */ y(
|
|
3205
3701
|
"button",
|
|
3206
3702
|
{
|
|
3207
3703
|
type: "button",
|
|
3208
|
-
"aria-busy":
|
|
3209
|
-
disabled:
|
|
3704
|
+
"aria-busy": h,
|
|
3705
|
+
disabled: h,
|
|
3210
3706
|
onClick: async () => {
|
|
3211
3707
|
a(g);
|
|
3212
3708
|
try {
|
|
3213
|
-
await r(
|
|
3709
|
+
await r(u);
|
|
3214
3710
|
} finally {
|
|
3215
3711
|
a(null);
|
|
3216
3712
|
}
|
|
@@ -3225,14 +3721,14 @@ const vr = ({
|
|
|
3225
3721
|
background: "#eff6ff",
|
|
3226
3722
|
border: "1px solid #bfdbfe",
|
|
3227
3723
|
borderRadius: 6,
|
|
3228
|
-
cursor:
|
|
3724
|
+
cursor: h ? "wait" : "pointer",
|
|
3229
3725
|
fontFamily: "inherit",
|
|
3230
3726
|
display: "inline-flex",
|
|
3231
3727
|
alignItems: "center",
|
|
3232
3728
|
gap: 8
|
|
3233
3729
|
},
|
|
3234
3730
|
children: [
|
|
3235
|
-
|
|
3731
|
+
h && /* @__PURE__ */ o(
|
|
3236
3732
|
"span",
|
|
3237
3733
|
{
|
|
3238
3734
|
className: "explore-memory-loader explore-memory-loader--callback",
|
|
@@ -3245,7 +3741,7 @@ const vr = ({
|
|
|
3245
3741
|
)
|
|
3246
3742
|
]
|
|
3247
3743
|
},
|
|
3248
|
-
`${
|
|
3744
|
+
`${s.memoryId}-${m}`
|
|
3249
3745
|
);
|
|
3250
3746
|
})
|
|
3251
3747
|
}
|
|
@@ -3274,7 +3770,7 @@ const vr = ({
|
|
|
3274
3770
|
}
|
|
3275
3771
|
)
|
|
3276
3772
|
}
|
|
3277
|
-
) }),
|
|
3773
|
+
) }), Wr = ({
|
|
3278
3774
|
progressViewItems: e,
|
|
3279
3775
|
loading: r,
|
|
3280
3776
|
error: t,
|
|
@@ -3282,27 +3778,27 @@ const vr = ({
|
|
|
3282
3778
|
t: i,
|
|
3283
3779
|
onSourceClick: l,
|
|
3284
3780
|
onSearchResultClick: a,
|
|
3285
|
-
onExploreQueryResultClick:
|
|
3781
|
+
onExploreQueryResultClick: s
|
|
3286
3782
|
}) => {
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3289
|
-
|
|
3783
|
+
const m = A(null);
|
|
3784
|
+
F(() => {
|
|
3785
|
+
m.current && (m.current.scrollTop = m.current.scrollHeight);
|
|
3290
3786
|
}, [e.length]);
|
|
3291
|
-
const
|
|
3292
|
-
const
|
|
3293
|
-
if (
|
|
3294
|
-
return /* @__PURE__ */ o(ne, { text:
|
|
3295
|
-
if (
|
|
3296
|
-
return /* @__PURE__ */ o(
|
|
3297
|
-
if (
|
|
3298
|
-
switch (
|
|
3787
|
+
const p = (d) => {
|
|
3788
|
+
const u = d.item.data;
|
|
3789
|
+
if (u.taskType === "StreamingChatCompletion" && u.eventType === "Text")
|
|
3790
|
+
return /* @__PURE__ */ o(ne, { text: u.text });
|
|
3791
|
+
if (u.taskType === "StructuredChatCompletion" && u.eventType === "Completed")
|
|
3792
|
+
return /* @__PURE__ */ o(He, { data: u });
|
|
3793
|
+
if (u.taskType === "MemoryChat")
|
|
3794
|
+
switch (u.eventType) {
|
|
3299
3795
|
case "Text":
|
|
3300
|
-
return /* @__PURE__ */ o(ne, { text:
|
|
3796
|
+
return /* @__PURE__ */ o(ne, { text: u.text });
|
|
3301
3797
|
case "FindMemories":
|
|
3302
3798
|
return /* @__PURE__ */ o(
|
|
3303
|
-
|
|
3799
|
+
je,
|
|
3304
3800
|
{
|
|
3305
|
-
data:
|
|
3801
|
+
data: u,
|
|
3306
3802
|
isLatest: d.isLatest,
|
|
3307
3803
|
durationSeconds: d.durationSeconds,
|
|
3308
3804
|
t: i
|
|
@@ -3310,17 +3806,17 @@ const vr = ({
|
|
|
3310
3806
|
);
|
|
3311
3807
|
case "FindMemoriesResult":
|
|
3312
3808
|
return /* @__PURE__ */ o(
|
|
3313
|
-
|
|
3809
|
+
qe,
|
|
3314
3810
|
{
|
|
3315
|
-
data:
|
|
3811
|
+
data: u,
|
|
3316
3812
|
t: i
|
|
3317
3813
|
}
|
|
3318
3814
|
);
|
|
3319
3815
|
case "Search":
|
|
3320
3816
|
return /* @__PURE__ */ o(
|
|
3321
|
-
|
|
3817
|
+
_e,
|
|
3322
3818
|
{
|
|
3323
|
-
data:
|
|
3819
|
+
data: u,
|
|
3324
3820
|
isLatest: d.isLatest,
|
|
3325
3821
|
durationSeconds: d.durationSeconds,
|
|
3326
3822
|
t: i
|
|
@@ -3328,9 +3824,9 @@ const vr = ({
|
|
|
3328
3824
|
);
|
|
3329
3825
|
case "FindSources":
|
|
3330
3826
|
return /* @__PURE__ */ o(
|
|
3331
|
-
|
|
3827
|
+
Qe,
|
|
3332
3828
|
{
|
|
3333
|
-
data:
|
|
3829
|
+
data: u,
|
|
3334
3830
|
isLatest: d.isLatest,
|
|
3335
3831
|
durationSeconds: d.durationSeconds,
|
|
3336
3832
|
t: i
|
|
@@ -3338,18 +3834,18 @@ const vr = ({
|
|
|
3338
3834
|
);
|
|
3339
3835
|
case "SourcesResult":
|
|
3340
3836
|
return /* @__PURE__ */ o(
|
|
3341
|
-
|
|
3837
|
+
Ve,
|
|
3342
3838
|
{
|
|
3343
|
-
data:
|
|
3839
|
+
data: u,
|
|
3344
3840
|
onSourceClick: l,
|
|
3345
3841
|
t: i
|
|
3346
3842
|
}
|
|
3347
3843
|
);
|
|
3348
3844
|
case "ExploreMemories":
|
|
3349
3845
|
return /* @__PURE__ */ o(
|
|
3350
|
-
|
|
3846
|
+
Ze,
|
|
3351
3847
|
{
|
|
3352
|
-
data:
|
|
3848
|
+
data: u,
|
|
3353
3849
|
completed: d.completed,
|
|
3354
3850
|
isLatest: d.isLatest,
|
|
3355
3851
|
t: i
|
|
@@ -3357,23 +3853,47 @@ const vr = ({
|
|
|
3357
3853
|
);
|
|
3358
3854
|
case "ChunkResults":
|
|
3359
3855
|
return /* @__PURE__ */ o(
|
|
3360
|
-
|
|
3856
|
+
sr,
|
|
3361
3857
|
{
|
|
3362
|
-
data:
|
|
3858
|
+
data: u,
|
|
3363
3859
|
onSearchResultClick: a,
|
|
3364
3860
|
t: i
|
|
3365
3861
|
}
|
|
3366
3862
|
);
|
|
3863
|
+
case "GoogleSearch":
|
|
3864
|
+
return /* @__PURE__ */ o(
|
|
3865
|
+
lr,
|
|
3866
|
+
{
|
|
3867
|
+
data: u,
|
|
3868
|
+
isLatest: d.isLatest,
|
|
3869
|
+
durationSeconds: d.durationSeconds,
|
|
3870
|
+
t: i
|
|
3871
|
+
}
|
|
3872
|
+
);
|
|
3873
|
+
case "GoogleSearchResult":
|
|
3874
|
+
return /* @__PURE__ */ o(ur, { data: u, t: i });
|
|
3875
|
+
case "Scrape":
|
|
3876
|
+
return /* @__PURE__ */ o(
|
|
3877
|
+
mr,
|
|
3878
|
+
{
|
|
3879
|
+
data: u,
|
|
3880
|
+
isLatest: d.isLatest,
|
|
3881
|
+
durationSeconds: d.durationSeconds,
|
|
3882
|
+
t: i
|
|
3883
|
+
}
|
|
3884
|
+
);
|
|
3885
|
+
case "ScrapeResult":
|
|
3886
|
+
return /* @__PURE__ */ o(hr, { data: u, t: i });
|
|
3367
3887
|
case "Completed":
|
|
3368
3888
|
return null;
|
|
3369
3889
|
}
|
|
3370
|
-
if (
|
|
3371
|
-
switch (
|
|
3890
|
+
if (u.taskType === "MemorySearch")
|
|
3891
|
+
switch (u.eventType) {
|
|
3372
3892
|
case "GeneratingQueries":
|
|
3373
3893
|
return /* @__PURE__ */ o(
|
|
3374
|
-
|
|
3894
|
+
Er,
|
|
3375
3895
|
{
|
|
3376
|
-
data:
|
|
3896
|
+
data: u,
|
|
3377
3897
|
isLatest: d.isLatest,
|
|
3378
3898
|
durationSeconds: d.durationSeconds,
|
|
3379
3899
|
t: i
|
|
@@ -3381,20 +3901,20 @@ const vr = ({
|
|
|
3381
3901
|
);
|
|
3382
3902
|
case "ExploreQueries":
|
|
3383
3903
|
return /* @__PURE__ */ o(
|
|
3384
|
-
|
|
3904
|
+
Pr,
|
|
3385
3905
|
{
|
|
3386
|
-
data:
|
|
3906
|
+
data: u,
|
|
3387
3907
|
isLatest: d.isLatest,
|
|
3388
3908
|
durationSeconds: d.durationSeconds,
|
|
3389
|
-
onExploreQueryResultClick:
|
|
3909
|
+
onExploreQueryResultClick: s,
|
|
3390
3910
|
t: i
|
|
3391
3911
|
}
|
|
3392
3912
|
);
|
|
3393
3913
|
case "SearchMemoryTypes":
|
|
3394
3914
|
return /* @__PURE__ */ o(
|
|
3395
|
-
|
|
3915
|
+
kr,
|
|
3396
3916
|
{
|
|
3397
|
-
data:
|
|
3917
|
+
data: u,
|
|
3398
3918
|
isLatest: d.isLatest,
|
|
3399
3919
|
durationSeconds: d.durationSeconds,
|
|
3400
3920
|
t: i
|
|
@@ -3402,15 +3922,15 @@ const vr = ({
|
|
|
3402
3922
|
);
|
|
3403
3923
|
case "Completed":
|
|
3404
3924
|
return /* @__PURE__ */ o(
|
|
3405
|
-
|
|
3925
|
+
Dr,
|
|
3406
3926
|
{
|
|
3407
|
-
data:
|
|
3927
|
+
data: u,
|
|
3408
3928
|
onSearchResultClick: a,
|
|
3409
3929
|
t: i
|
|
3410
3930
|
}
|
|
3411
3931
|
);
|
|
3412
3932
|
}
|
|
3413
|
-
return
|
|
3933
|
+
return u.taskType === "StreamingChatCompletion" && u.eventType === "Completed" ? null : u.eventType === "Error" && "message" in u ? /* @__PURE__ */ o(j, { message: u.message }) : null;
|
|
3414
3934
|
};
|
|
3415
3935
|
if (e.length === 0)
|
|
3416
3936
|
return t ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(j, { message: t.message }) }) : r ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(
|
|
@@ -3424,20 +3944,24 @@ const vr = ({
|
|
|
3424
3944
|
shimmerColor: "#000"
|
|
3425
3945
|
}
|
|
3426
3946
|
) }) : null;
|
|
3427
|
-
const
|
|
3947
|
+
const c = e.filter((d, u) => {
|
|
3428
3948
|
const g = d.item.data;
|
|
3429
|
-
return g.taskType === "MemoryChat" && g.eventType === "ExploreMemories" ? !e.slice(
|
|
3430
|
-
(
|
|
3431
|
-
) : g.taskType === "MemorySearch" && g.eventType === "GeneratingQueries" ? !e.slice(
|
|
3432
|
-
(
|
|
3433
|
-
) : g.taskType === "MemorySearch" && g.eventType === "ExploreQueries" ? !e.slice(
|
|
3434
|
-
(
|
|
3435
|
-
) : g.taskType === "MemoryChat" && g.eventType === "ChunkResults" ? !e.slice(
|
|
3436
|
-
(
|
|
3949
|
+
return g.taskType === "MemoryChat" && g.eventType === "ExploreMemories" ? !e.slice(u + 1).some(
|
|
3950
|
+
(x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "ExploreMemories"
|
|
3951
|
+
) : g.taskType === "MemorySearch" && g.eventType === "GeneratingQueries" ? !e.slice(u + 1).some(
|
|
3952
|
+
(x) => x.item.data.taskType === "MemorySearch" && x.item.data.eventType === "GeneratingQueries"
|
|
3953
|
+
) : g.taskType === "MemorySearch" && g.eventType === "ExploreQueries" ? !e.slice(u + 1).some(
|
|
3954
|
+
(x) => x.item.data.taskType === "MemorySearch" && x.item.data.eventType === "ExploreQueries"
|
|
3955
|
+
) : g.taskType === "MemoryChat" && g.eventType === "ChunkResults" ? !e.slice(u + 1).some(
|
|
3956
|
+
(x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "ChunkResults"
|
|
3957
|
+
) : g.taskType === "MemoryChat" && g.eventType === "GoogleSearch" ? !e.slice(u + 1).some(
|
|
3958
|
+
(x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "GoogleSearch"
|
|
3959
|
+
) : g.taskType === "MemoryChat" && g.eventType === "Scrape" ? !e.slice(u + 1).some(
|
|
3960
|
+
(x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "Scrape"
|
|
3437
3961
|
) : !0;
|
|
3438
3962
|
});
|
|
3439
|
-
return /* @__PURE__ */
|
|
3440
|
-
/* @__PURE__ */ o(
|
|
3963
|
+
return /* @__PURE__ */ y("div", { id: "agent-task-progress-verbose", ref: m, children: [
|
|
3964
|
+
/* @__PURE__ */ o(xe, { children: c.map((d, u) => /* @__PURE__ */ o(
|
|
3441
3965
|
C.div,
|
|
3442
3966
|
{
|
|
3443
3967
|
id: `agent-task-progress-item-${d.item.progressItemId}`,
|
|
@@ -3445,31 +3969,31 @@ const vr = ({
|
|
|
3445
3969
|
animate: { opacity: 1, y: 0 },
|
|
3446
3970
|
transition: {
|
|
3447
3971
|
duration: 0.4,
|
|
3448
|
-
delay:
|
|
3972
|
+
delay: u * 0.1,
|
|
3449
3973
|
ease: "easeOut"
|
|
3450
3974
|
},
|
|
3451
|
-
children:
|
|
3975
|
+
children: p(d)
|
|
3452
3976
|
},
|
|
3453
3977
|
d.item.progressItemId
|
|
3454
3978
|
)) }),
|
|
3455
3979
|
t ? /* @__PURE__ */ o("div", { style: { marginTop: 8 }, children: /* @__PURE__ */ o(j, { message: t.message }) }) : null
|
|
3456
3980
|
] });
|
|
3457
|
-
},
|
|
3981
|
+
}, jr = ({
|
|
3458
3982
|
agentTask: e,
|
|
3459
3983
|
language: r,
|
|
3460
3984
|
onSourceClick: t,
|
|
3461
3985
|
onSearchResultClick: n,
|
|
3462
3986
|
onExploreQueryResultClick: i
|
|
3463
3987
|
}) => {
|
|
3464
|
-
const l =
|
|
3988
|
+
const l = Ne(e), a = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : r ?? "en", s = Ue(a);
|
|
3465
3989
|
return /* @__PURE__ */ o(
|
|
3466
|
-
|
|
3990
|
+
Wr,
|
|
3467
3991
|
{
|
|
3468
3992
|
progressViewItems: l,
|
|
3469
3993
|
loading: e.loading,
|
|
3470
3994
|
error: e.error,
|
|
3471
3995
|
loadingText: e.loadingText,
|
|
3472
|
-
t:
|
|
3996
|
+
t: s,
|
|
3473
3997
|
onSourceClick: t,
|
|
3474
3998
|
onSearchResultClick: n,
|
|
3475
3999
|
onExploreQueryResultClick: i
|
|
@@ -3477,11 +4001,11 @@ const vr = ({
|
|
|
3477
4001
|
);
|
|
3478
4002
|
};
|
|
3479
4003
|
export {
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
4004
|
+
jr as AgentTaskProgress,
|
|
4005
|
+
L as Checkmark,
|
|
4006
|
+
Ur as FencyProvider,
|
|
4007
|
+
Dr as MemorySearchCompletedResults,
|
|
4008
|
+
Ae as StreamEventManager,
|
|
4009
|
+
H as XMark,
|
|
4010
|
+
_r as useAgentTasks
|
|
3487
4011
|
};
|