teodor-new-chat-ui 4.3.341 → 4.3.342
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/index.esm.js +361 -357
- package/dist/index.umd.js +10 -10
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Xh = Object.defineProperty;
|
|
|
2
2
|
var Jh = (e, t, n) => t in e ? Xh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var el = (e, t, n) => Jh(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as v from "react";
|
|
5
|
-
import
|
|
5
|
+
import Q, { createContext as oo, useContext as fs, useMemo as Fe, useState as xe, useRef as De, useCallback as ye, useEffect as vt, useReducer as Zh, useLayoutEffect as Qh, createElement as No, memo as em, useImperativeHandle as tm } from "react";
|
|
6
6
|
import { Square as nm, Send as rm, ChevronRight as Bc, Check as ea, Circle as om, X as mr, ExternalLink as sm, Download as im, Image as am, FileText as tl, Loader as ta, ChevronUp as na, ChevronDown as ps, Bot as Xs, Wrench as lm, User as cm, Paperclip as Si, ChevronLeft as um, Copy as nl, Edit as rl, RotateCcw as Ci, Loader2 as Dr, Edit3 as zc, Plus as dm, FileSpreadsheet as fm, MessageSquarePlus as pm, MessageSquare as hm, Calendar as mm, Trash2 as gm, Settings as xm, Server as ym, EyeOff as vm, Eye as wm, Layout as bm, MessageCircle as Sm, Save as Cm } from "lucide-react";
|
|
7
7
|
import { Slot as Tm, createSlot as wr } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as hs } from "class-variance-authority";
|
|
@@ -24,7 +24,7 @@ var ol;
|
|
|
24
24
|
function Rm() {
|
|
25
25
|
if (ol) return Pr;
|
|
26
26
|
ol = 1;
|
|
27
|
-
var e =
|
|
27
|
+
var e = Q, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
28
28
|
function i(a, l, c) {
|
|
29
29
|
var d, f = {}, h = null, p = null;
|
|
30
30
|
c !== void 0 && (h = "" + c), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (p = l.ref);
|
|
@@ -47,7 +47,7 @@ var Mr = {};
|
|
|
47
47
|
var sl;
|
|
48
48
|
function Em() {
|
|
49
49
|
return sl || (sl = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
-
var e =
|
|
50
|
+
var e = Q, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), x = Symbol.iterator, m = "@@iterator";
|
|
51
51
|
function y(k) {
|
|
52
52
|
if (k === null || typeof k != "object")
|
|
53
53
|
return null;
|
|
@@ -198,7 +198,7 @@ function Em() {
|
|
|
198
198
|
F < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
var
|
|
201
|
+
var J = g.ReactCurrentDispatcher, X;
|
|
202
202
|
function L(k, U, ie) {
|
|
203
203
|
{
|
|
204
204
|
if (X === void 0)
|
|
@@ -212,16 +212,16 @@ function Em() {
|
|
|
212
212
|
` + X + k;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
var V = !1,
|
|
215
|
+
var V = !1, Z;
|
|
216
216
|
{
|
|
217
217
|
var le = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
-
|
|
218
|
+
Z = new le();
|
|
219
219
|
}
|
|
220
220
|
function oe(k, U) {
|
|
221
221
|
if (!k || V)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var ie =
|
|
224
|
+
var ie = Z.get(k);
|
|
225
225
|
if (ie !== void 0)
|
|
226
226
|
return ie;
|
|
227
227
|
}
|
|
@@ -230,7 +230,7 @@ function Em() {
|
|
|
230
230
|
var Ye = Error.prepareStackTrace;
|
|
231
231
|
Error.prepareStackTrace = void 0;
|
|
232
232
|
var ot;
|
|
233
|
-
ot =
|
|
233
|
+
ot = J.current, J.current = null, Ee();
|
|
234
234
|
try {
|
|
235
235
|
if (U) {
|
|
236
236
|
var Be = function() {
|
|
@@ -276,22 +276,22 @@ function Em() {
|
|
|
276
276
|
if (xt--, yt--, yt < 0 || $e[xt] !== At[yt]) {
|
|
277
277
|
var fe = `
|
|
278
278
|
` + $e[xt].replace(" at new ", " at ");
|
|
279
|
-
return k.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", k.displayName)), typeof k == "function" &&
|
|
279
|
+
return k.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", k.displayName)), typeof k == "function" && Z.set(k, fe), fe;
|
|
280
280
|
}
|
|
281
281
|
while (xt >= 1 && yt >= 0);
|
|
282
282
|
break;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
|
-
V = !1,
|
|
286
|
+
V = !1, J.current = ot, z(), Error.prepareStackTrace = Ye;
|
|
287
287
|
}
|
|
288
288
|
var Ce = k ? k.displayName || k.name : "", Re = Ce ? L(Ce) : "";
|
|
289
|
-
return typeof k == "function" &&
|
|
289
|
+
return typeof k == "function" && Z.set(k, Re), Re;
|
|
290
290
|
}
|
|
291
291
|
function Ne(k, U, ie) {
|
|
292
292
|
return oe(k, !1);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Oe(k) {
|
|
295
295
|
var U = k.prototype;
|
|
296
296
|
return !!(U && U.isReactComponent);
|
|
297
297
|
}
|
|
@@ -299,7 +299,7 @@ function Em() {
|
|
|
299
299
|
if (k == null)
|
|
300
300
|
return "";
|
|
301
301
|
if (typeof k == "function")
|
|
302
|
-
return oe(k,
|
|
302
|
+
return oe(k, Oe(k));
|
|
303
303
|
if (typeof k == "string")
|
|
304
304
|
return L(k);
|
|
305
305
|
switch (k) {
|
|
@@ -324,7 +324,7 @@ function Em() {
|
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var we = Object.prototype.hasOwnProperty,
|
|
327
|
+
var we = Object.prototype.hasOwnProperty, je = {}, Ue = g.ReactDebugCurrentFrame;
|
|
328
328
|
function Ze(k) {
|
|
329
329
|
if (k) {
|
|
330
330
|
var U = k._owner, ie = ae(k.type, k._source, U ? U.type : null);
|
|
@@ -347,7 +347,7 @@ function Em() {
|
|
|
347
347
|
} catch (xt) {
|
|
348
348
|
$e = xt;
|
|
349
349
|
}
|
|
350
|
-
$e && !($e instanceof Error) && (Ze(Ye), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Te || "React class", ie, Be, typeof $e), Ze(null)), $e instanceof Error && !($e.message in
|
|
350
|
+
$e && !($e instanceof Error) && (Ze(Ye), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Te || "React class", ie, Be, typeof $e), Ze(null)), $e instanceof Error && !($e.message in je) && (je[$e.message] = !0, Ze(Ye), w("Failed %s type: %s", ie, $e.message), Ze(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
@@ -874,10 +874,10 @@ const cg = (e) => {
|
|
|
874
874
|
asap: fg,
|
|
875
875
|
isIterable: pg
|
|
876
876
|
};
|
|
877
|
-
function
|
|
877
|
+
function Pe(e, t, n, r, o) {
|
|
878
878
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
879
879
|
}
|
|
880
|
-
M.inherits(
|
|
880
|
+
M.inherits(Pe, Error, {
|
|
881
881
|
toJSON: function() {
|
|
882
882
|
return {
|
|
883
883
|
// Standard
|
|
@@ -898,7 +898,7 @@ M.inherits(je, Error, {
|
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
900
|
});
|
|
901
|
-
const Jc =
|
|
901
|
+
const Jc = Pe.prototype, Zc = {};
|
|
902
902
|
[
|
|
903
903
|
"ERR_BAD_OPTION_VALUE",
|
|
904
904
|
"ERR_BAD_OPTION",
|
|
@@ -916,15 +916,15 @@ const Jc = je.prototype, Zc = {};
|
|
|
916
916
|
].forEach((e) => {
|
|
917
917
|
Zc[e] = { value: e };
|
|
918
918
|
});
|
|
919
|
-
Object.defineProperties(
|
|
919
|
+
Object.defineProperties(Pe, Zc);
|
|
920
920
|
Object.defineProperty(Jc, "isAxiosError", { value: !0 });
|
|
921
|
-
|
|
921
|
+
Pe.from = (e, t, n, r, o, s) => {
|
|
922
922
|
const i = Object.create(Jc);
|
|
923
923
|
M.toFlatObject(e, i, function(d) {
|
|
924
924
|
return d !== Error.prototype;
|
|
925
925
|
}, (c) => c !== "isAxiosError");
|
|
926
926
|
const a = e && e.message ? e.message : "Error", l = t == null && e ? e.code : t;
|
|
927
|
-
return
|
|
927
|
+
return Pe.call(i, a, l, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
|
|
928
928
|
};
|
|
929
929
|
const hg = null;
|
|
930
930
|
function ki(e) {
|
|
@@ -964,7 +964,7 @@ function vs(e, t, n) {
|
|
|
964
964
|
if (M.isBoolean(x))
|
|
965
965
|
return x.toString();
|
|
966
966
|
if (!l && M.isBlob(x))
|
|
967
|
-
throw new
|
|
967
|
+
throw new Pe("Blob is not supported. Use a Buffer instead.");
|
|
968
968
|
return M.isArrayBuffer(x) || M.isTypedArray(x) ? l && typeof Blob == "function" ? new Blob([x]) : Buffer.from(x) : x;
|
|
969
969
|
}
|
|
970
970
|
function d(x, m, y) {
|
|
@@ -1215,7 +1215,7 @@ const lo = {
|
|
|
1215
1215
|
return JSON.parse(t, this.parseReviver);
|
|
1216
1216
|
} catch (a) {
|
|
1217
1217
|
if (i)
|
|
1218
|
-
throw a.name === "SyntaxError" ?
|
|
1218
|
+
throw a.name === "SyntaxError" ? Pe.from(a, Pe.ERR_BAD_RESPONSE, this, null, this.response) : a;
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
1221
|
return t;
|
|
@@ -1458,16 +1458,16 @@ function ou(e) {
|
|
|
1458
1458
|
return !!(e && e.__CANCEL__);
|
|
1459
1459
|
}
|
|
1460
1460
|
function kr(e, t, n) {
|
|
1461
|
-
|
|
1461
|
+
Pe.call(this, e ?? "canceled", Pe.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1462
1462
|
}
|
|
1463
|
-
M.inherits(kr,
|
|
1463
|
+
M.inherits(kr, Pe, {
|
|
1464
1464
|
__CANCEL__: !0
|
|
1465
1465
|
});
|
|
1466
1466
|
function su(e, t, n) {
|
|
1467
1467
|
const r = n.config.validateStatus;
|
|
1468
|
-
!n.status || !r || r(n.status) ? e(n) : t(new
|
|
1468
|
+
!n.status || !r || r(n.status) ? e(n) : t(new Pe(
|
|
1469
1469
|
"Request failed with status code " + n.status,
|
|
1470
|
-
[
|
|
1470
|
+
[Pe.ERR_BAD_REQUEST, Pe.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
1471
1471
|
n.config,
|
|
1472
1472
|
n.request,
|
|
1473
1473
|
n
|
|
@@ -1690,16 +1690,16 @@ const au = (e) => {
|
|
|
1690
1690
|
"onloadend" in y ? y.onloadend = g : y.onreadystatechange = function() {
|
|
1691
1691
|
!y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.indexOf("file:") === 0) || setTimeout(g);
|
|
1692
1692
|
}, y.onabort = function() {
|
|
1693
|
-
y && (r(new
|
|
1693
|
+
y && (r(new Pe("Request aborted", Pe.ECONNABORTED, e, y)), y = null);
|
|
1694
1694
|
}, y.onerror = function(T) {
|
|
1695
|
-
const S = T && T.message ? T.message : "Network Error", C = new
|
|
1695
|
+
const S = T && T.message ? T.message : "Network Error", C = new Pe(S, Pe.ERR_NETWORK, e, y);
|
|
1696
1696
|
C.event = T || null, r(C), y = null;
|
|
1697
1697
|
}, y.ontimeout = function() {
|
|
1698
1698
|
let T = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1699
1699
|
const S = o.transitional || nu;
|
|
1700
|
-
o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new
|
|
1700
|
+
o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new Pe(
|
|
1701
1701
|
T,
|
|
1702
|
-
S.clarifyTimeoutError ?
|
|
1702
|
+
S.clarifyTimeoutError ? Pe.ETIMEDOUT : Pe.ECONNABORTED,
|
|
1703
1703
|
e,
|
|
1704
1704
|
y
|
|
1705
1705
|
)), y = null;
|
|
@@ -1710,7 +1710,7 @@ const au = (e) => {
|
|
|
1710
1710
|
}, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
|
|
1711
1711
|
const w = Dg(o.url);
|
|
1712
1712
|
if (w && Mt.protocols.indexOf(w) === -1) {
|
|
1713
|
-
r(new
|
|
1713
|
+
r(new Pe("Unsupported protocol " + w + ":", Pe.ERR_BAD_REQUEST, e));
|
|
1714
1714
|
return;
|
|
1715
1715
|
}
|
|
1716
1716
|
y.send(s || null);
|
|
@@ -1723,11 +1723,11 @@ const au = (e) => {
|
|
|
1723
1723
|
if (!o) {
|
|
1724
1724
|
o = !0, a();
|
|
1725
1725
|
const d = c instanceof Error ? c : this.reason;
|
|
1726
|
-
r.abort(d instanceof
|
|
1726
|
+
r.abort(d instanceof Pe ? d : new kr(d instanceof Error ? d.message : d));
|
|
1727
1727
|
}
|
|
1728
1728
|
};
|
|
1729
1729
|
let i = t && setTimeout(() => {
|
|
1730
|
-
i = null, s(new
|
|
1730
|
+
i = null, s(new Pe(`timeout ${t} of ms exceeded`, Pe.ETIMEDOUT));
|
|
1731
1731
|
}, t);
|
|
1732
1732
|
const a = () => {
|
|
1733
1733
|
e && (i && clearTimeout(i), i = null, e.forEach((c) => {
|
|
@@ -1832,7 +1832,7 @@ const au = (e) => {
|
|
|
1832
1832
|
let g = m && m[x];
|
|
1833
1833
|
if (g)
|
|
1834
1834
|
return g.call(m);
|
|
1835
|
-
throw new
|
|
1835
|
+
throw new Pe(`Response type '${x}' is not supported`, Pe.ERR_NOT_SUPPORT, y);
|
|
1836
1836
|
});
|
|
1837
1837
|
});
|
|
1838
1838
|
const h = async (x) => {
|
|
@@ -1932,11 +1932,11 @@ const au = (e) => {
|
|
|
1932
1932
|
});
|
|
1933
1933
|
} catch (A) {
|
|
1934
1934
|
throw E && E(), A && A.name === "TypeError" && /Load failed|fetch/i.test(A.message) ? Object.assign(
|
|
1935
|
-
new
|
|
1935
|
+
new Pe("Network Error", Pe.ERR_NETWORK, x, $),
|
|
1936
1936
|
{
|
|
1937
1937
|
cause: A.cause || A
|
|
1938
1938
|
}
|
|
1939
|
-
) :
|
|
1939
|
+
) : Pe.from(A, A && A.code, x, $);
|
|
1940
1940
|
}
|
|
1941
1941
|
};
|
|
1942
1942
|
}, Jg = /* @__PURE__ */ new Map(), lu = (e) => {
|
|
@@ -1978,7 +1978,7 @@ const vl = (e) => `- ${e}`, Zg = (e) => M.isFunction(e) || e === null || e === !
|
|
|
1978
1978
|
r = e[i];
|
|
1979
1979
|
let a;
|
|
1980
1980
|
if (o = r, !Zg(r) && (o = Ei[(a = String(r)).toLowerCase()], o === void 0))
|
|
1981
|
-
throw new
|
|
1981
|
+
throw new Pe(`Unknown adapter '${a}'`);
|
|
1982
1982
|
if (o && (M.isFunction(o) || (o = o.get(t))))
|
|
1983
1983
|
break;
|
|
1984
1984
|
s[a || "#" + i] = o;
|
|
@@ -1990,7 +1990,7 @@ const vl = (e) => `- ${e}`, Zg = (e) => M.isFunction(e) || e === null || e === !
|
|
|
1990
1990
|
let a = n ? i.length > 1 ? `since :
|
|
1991
1991
|
` + i.map(vl).join(`
|
|
1992
1992
|
`) : " " + vl(i[0]) : "as no adapter specified";
|
|
1993
|
-
throw new
|
|
1993
|
+
throw new Pe(
|
|
1994
1994
|
"There is no suitable adapter to dispatch the request " + a,
|
|
1995
1995
|
"ERR_NOT_SUPPORT"
|
|
1996
1996
|
);
|
|
@@ -2034,9 +2034,9 @@ ws.transitional = function(t, n, r) {
|
|
|
2034
2034
|
}
|
|
2035
2035
|
return (s, i, a) => {
|
|
2036
2036
|
if (t === !1)
|
|
2037
|
-
throw new
|
|
2037
|
+
throw new Pe(
|
|
2038
2038
|
o(i, " has been removed" + (n ? " in " + n : "")),
|
|
2039
|
-
|
|
2039
|
+
Pe.ERR_DEPRECATED
|
|
2040
2040
|
);
|
|
2041
2041
|
return n && !bl[i] && (bl[i] = !0, console.warn(
|
|
2042
2042
|
o(
|
|
@@ -2051,7 +2051,7 @@ ws.spelling = function(t) {
|
|
|
2051
2051
|
};
|
|
2052
2052
|
function Qg(e, t, n) {
|
|
2053
2053
|
if (typeof e != "object")
|
|
2054
|
-
throw new
|
|
2054
|
+
throw new Pe("options must be an object", Pe.ERR_BAD_OPTION_VALUE);
|
|
2055
2055
|
const r = Object.keys(e);
|
|
2056
2056
|
let o = r.length;
|
|
2057
2057
|
for (; o-- > 0; ) {
|
|
@@ -2059,11 +2059,11 @@ function Qg(e, t, n) {
|
|
|
2059
2059
|
if (i) {
|
|
2060
2060
|
const a = e[s], l = a === void 0 || i(a, s, e);
|
|
2061
2061
|
if (l !== !0)
|
|
2062
|
-
throw new
|
|
2062
|
+
throw new Pe("option " + s + " must be " + l, Pe.ERR_BAD_OPTION_VALUE);
|
|
2063
2063
|
continue;
|
|
2064
2064
|
}
|
|
2065
2065
|
if (n !== !0)
|
|
2066
|
-
throw new
|
|
2066
|
+
throw new Pe("Unknown option " + s, Pe.ERR_BAD_OPTION);
|
|
2067
2067
|
}
|
|
2068
2068
|
}
|
|
2069
2069
|
const Po = {
|
|
@@ -2356,7 +2356,7 @@ St.CancelToken = ex;
|
|
|
2356
2356
|
St.isCancel = ou;
|
|
2357
2357
|
St.VERSION = uu;
|
|
2358
2358
|
St.toFormData = vs;
|
|
2359
|
-
St.AxiosError =
|
|
2359
|
+
St.AxiosError = Pe;
|
|
2360
2360
|
St.Cancel = St.CanceledError;
|
|
2361
2361
|
St.all = function(t) {
|
|
2362
2362
|
return Promise.all(t);
|
|
@@ -3071,7 +3071,7 @@ function Lx(e = {}) {
|
|
|
3071
3071
|
threadId: E.threadId ?? null,
|
|
3072
3072
|
headers: {}
|
|
3073
3073
|
}, (async () => {
|
|
3074
|
-
var se, ve, Ee, z,
|
|
3074
|
+
var se, ve, Ee, z, J, X, L, V, Z, le, oe, Ne, Oe, ae, we, je, Ue, Ze;
|
|
3075
3075
|
const Y = (We) => {
|
|
3076
3076
|
var ut;
|
|
3077
3077
|
try {
|
|
@@ -3137,7 +3137,7 @@ function Lx(e = {}) {
|
|
|
3137
3137
|
Ge == null ? void 0 : Ge.slice(0, 500)
|
|
3138
3138
|
);
|
|
3139
3139
|
const Qe = `stream ${nt.status}${Ge ? ": " + Ge : ""}`;
|
|
3140
|
-
throw (
|
|
3140
|
+
throw (J = A == null ? void 0 : A.onConnectionError) == null || J.call(A, Qe), q = !0, B = "error", _ = Qe, new Error(Qe);
|
|
3141
3141
|
}
|
|
3142
3142
|
w(!0);
|
|
3143
3143
|
const it = nt.body.getReader(), jt = new TextDecoder();
|
|
@@ -3238,10 +3238,10 @@ function Lx(e = {}) {
|
|
|
3238
3238
|
x(he.checkpointId);
|
|
3239
3239
|
else if (he.type === "error") {
|
|
3240
3240
|
const Se = he;
|
|
3241
|
-
if (d(Se.message), B = "error", _ = Se.message, Se.error_type === "auth_error" || Se.code === "TOKEN_EXPIRED" || ((
|
|
3241
|
+
if (d(Se.message), B = "error", _ = Se.message, Se.error_type === "auth_error" || Se.code === "TOKEN_EXPIRED" || ((Z = Se.message) == null ? void 0 : Z.includes("token")) || ((le = Se.message) == null ? void 0 : le.includes("401")) || ((oe = Se.message) == null ? void 0 : oe.includes("unauthorized")) || ((Ne = Se.message) == null ? void 0 : Ne.includes("Unauthorized"))) {
|
|
3242
3242
|
console.error("[use-chat] Auth error detected:", Se.message);
|
|
3243
3243
|
try {
|
|
3244
|
-
(
|
|
3244
|
+
(Oe = A == null ? void 0 : A.onAuthError) == null || Oe.call(A, Se.message);
|
|
3245
3245
|
} catch (Sn) {
|
|
3246
3246
|
console.warn("[use-chat] onAuthError handler failed", Sn);
|
|
3247
3247
|
}
|
|
@@ -3272,7 +3272,7 @@ function Lx(e = {}) {
|
|
|
3272
3272
|
B = B ?? "aborted";
|
|
3273
3273
|
else {
|
|
3274
3274
|
const ut = We.message || String(We);
|
|
3275
|
-
B = "error", _ = ut, d(ut), (
|
|
3275
|
+
B = "error", _ = ut, d(ut), (je = A == null ? void 0 : A.onError) == null || je.call(A, ut), q || ((Ue = A == null ? void 0 : A.onConnectionError) == null || Ue.call(A, ut), q = !0);
|
|
3276
3276
|
}
|
|
3277
3277
|
} finally {
|
|
3278
3278
|
const We = S.current, ut = I.current, st = R.current, Je = N.current, nt = B ?? (K.signal.aborted ? "aborted" : _ ? "error" : "complete");
|
|
@@ -3949,11 +3949,11 @@ function Yx({
|
|
|
3949
3949
|
onAuthError: i,
|
|
3950
3950
|
onThreadChange: a
|
|
3951
3951
|
}) {
|
|
3952
|
-
const { api: l, baseUrl: c } = hu(), d = Fe(() => kn(c), [c]), [f, h] = xe([]), [p, x] = xe(t), [m, y] = xe(!1), [g, w] = xe(null), [b, T] = xe(!1), [S, C] = xe(null), { state: I, seed: R, prepend: N, pushUser: D, onEvent: j } = Ux(), [P, $] = xe(!1), [E, F] = xe(!1), [A, K] = xe(null), [B, _] = xe([]), [q, Y] = xe([]), [se, ve] = xe(!1), Ee = Fe(() => Dx(B), [B]), z = De(p),
|
|
3952
|
+
const { api: l, baseUrl: c } = hu(), d = Fe(() => kn(c), [c]), [f, h] = xe([]), [p, x] = xe(t), [m, y] = xe(!1), [g, w] = xe(null), [b, T] = xe(!1), [S, C] = xe(null), { state: I, seed: R, prepend: N, pushUser: D, onEvent: j } = Ux(), [P, $] = xe(!1), [E, F] = xe(!1), [A, K] = xe(null), [B, _] = xe([]), [q, Y] = xe([]), [se, ve] = xe(!1), Ee = Fe(() => Dx(B), [B]), z = De(p), J = De(null), X = De(null), L = De(null), V = De(null), Z = De(!1), le = De(null), oe = De(/* @__PURE__ */ new Map()), Ne = De(/* @__PURE__ */ new Map());
|
|
3953
3953
|
vt(() => {
|
|
3954
3954
|
z.current = p;
|
|
3955
3955
|
}, [p]);
|
|
3956
|
-
const
|
|
3956
|
+
const Oe = ye(async () => {
|
|
3957
3957
|
y(!0), w(null);
|
|
3958
3958
|
try {
|
|
3959
3959
|
const H = await l.listThreads();
|
|
@@ -3998,11 +3998,11 @@ function Yx({
|
|
|
3998
3998
|
}), Y(G), _(O), $(!!(re != null && re.nextCursor)), K((re == null ? void 0 : re.nextCursor) ?? null), le.current = `${ne}:latest`, X.current = null, L.current = null;
|
|
3999
3999
|
},
|
|
4000
4000
|
[R]
|
|
4001
|
-
),
|
|
4001
|
+
), je = ye((H) => {
|
|
4002
4002
|
console.log("[ChatSessionProvider] 🎯 Received thread_info:", H.threadId), ae(H), z.current !== H.threadId && ((H.created ?? !z.current) && (X.current = H.threadId), L.current = H.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), x(H.threadId));
|
|
4003
4003
|
}, [ae]), { startStream: Ue, stop: Ze, isStreaming: We, error: ut, setAuthToken: st } = Gx({
|
|
4004
4004
|
baseUrl: d,
|
|
4005
|
-
onThreadInfo:
|
|
4005
|
+
onThreadInfo: je,
|
|
4006
4006
|
onMessageEvent: j,
|
|
4007
4007
|
onStateHistory: we,
|
|
4008
4008
|
onUnhandledEvent: (H) => {
|
|
@@ -4013,12 +4013,12 @@ function Yx({
|
|
|
4013
4013
|
async (H) => {
|
|
4014
4014
|
try {
|
|
4015
4015
|
const ne = await l.createThread(H);
|
|
4016
|
-
return x(ne.threadId), await
|
|
4016
|
+
return x(ne.threadId), await Oe(), ne.threadId;
|
|
4017
4017
|
} catch (ne) {
|
|
4018
4018
|
return s == null || s(String(ne)), null;
|
|
4019
4019
|
}
|
|
4020
4020
|
},
|
|
4021
|
-
[l,
|
|
4021
|
+
[l, Oe, s]
|
|
4022
4022
|
), nt = ye(
|
|
4023
4023
|
async (H) => {
|
|
4024
4024
|
const ne = f;
|
|
@@ -4037,12 +4037,12 @@ function Yx({
|
|
|
4037
4037
|
), it = ye(
|
|
4038
4038
|
async (H, ne) => {
|
|
4039
4039
|
try {
|
|
4040
|
-
await l.updateThread(H, ne), await
|
|
4040
|
+
await l.updateThread(H, ne), await Oe();
|
|
4041
4041
|
} catch (O) {
|
|
4042
4042
|
s == null || s(String(O));
|
|
4043
4043
|
}
|
|
4044
4044
|
},
|
|
4045
|
-
[l,
|
|
4045
|
+
[l, Oe, s]
|
|
4046
4046
|
), jt = ye(
|
|
4047
4047
|
async (H, ne) => {
|
|
4048
4048
|
if (!H) return;
|
|
@@ -4099,23 +4099,23 @@ function Yx({
|
|
|
4099
4099
|
if (!o || !p || b || We)
|
|
4100
4100
|
return;
|
|
4101
4101
|
if (X.current === p) {
|
|
4102
|
-
X.current = null,
|
|
4102
|
+
X.current = null, J.current = p;
|
|
4103
4103
|
return;
|
|
4104
4104
|
}
|
|
4105
4105
|
if (L.current === p) {
|
|
4106
|
-
|
|
4106
|
+
J.current = p;
|
|
4107
4107
|
return;
|
|
4108
4108
|
}
|
|
4109
4109
|
if (V.current === p) {
|
|
4110
|
-
V.current = null,
|
|
4110
|
+
V.current = null, J.current = p;
|
|
4111
4111
|
return;
|
|
4112
4112
|
}
|
|
4113
|
-
if (
|
|
4113
|
+
if (J.current === p)
|
|
4114
4114
|
return;
|
|
4115
|
-
|
|
4116
|
-
const H = !
|
|
4115
|
+
J.current = p;
|
|
4116
|
+
const H = !Z.current && !!n && p === t;
|
|
4117
4117
|
let ne;
|
|
4118
|
-
H && n ? (ne = n,
|
|
4118
|
+
H && n ? (ne = n, Z.current = !0, console.log(
|
|
4119
4119
|
"[ChatSessionProvider] Loading thread with checkpoint:",
|
|
4120
4120
|
ne,
|
|
4121
4121
|
r ? `(ns: ${r})` : ""
|
|
@@ -4226,8 +4226,8 @@ function Yx({
|
|
|
4226
4226
|
[I.lastCheckpointId, I.lastCheckpointNs, Ue]
|
|
4227
4227
|
);
|
|
4228
4228
|
vt(() => {
|
|
4229
|
-
|
|
4230
|
-
}, [
|
|
4229
|
+
Oe();
|
|
4230
|
+
}, [Oe]), vt(() => {
|
|
4231
4231
|
a == null || a(p);
|
|
4232
4232
|
}, [p, a]);
|
|
4233
4233
|
const Rt = ye(
|
|
@@ -4284,10 +4284,10 @@ function Yx({
|
|
|
4284
4284
|
createThread: Je,
|
|
4285
4285
|
deleteThread: nt,
|
|
4286
4286
|
renameThread: it,
|
|
4287
|
-
refreshThreads:
|
|
4287
|
+
refreshThreads: Oe
|
|
4288
4288
|
}
|
|
4289
4289
|
}),
|
|
4290
|
-
[f, p, m, g, Je, nt, it,
|
|
4290
|
+
[f, p, m, g, Je, nt, it, Oe]
|
|
4291
4291
|
), Ge = Fe(() => {
|
|
4292
4292
|
const H = I.assemblingId ?? null;
|
|
4293
4293
|
return H ? { assemblingMessageId: H } : null;
|
|
@@ -4463,23 +4463,23 @@ function Zx({
|
|
|
4463
4463
|
textareaClassName: h = "",
|
|
4464
4464
|
allowEmptySend: p = !1
|
|
4465
4465
|
}) {
|
|
4466
|
-
const x = i !== void 0, [m, y] =
|
|
4467
|
-
|
|
4466
|
+
const x = i !== void 0, [m, y] = Q.useState(e), g = (x ? i : m) ?? "", [w, b] = Q.useTransition(), T = Q.useRef(null), S = Q.useRef(0), C = Q.useRef(null);
|
|
4467
|
+
Q.useEffect(() => {
|
|
4468
4468
|
x || (y(e ?? ""), C.current = null, T.current && (T.current.style.height = "auto", T.current.style.height = `${T.current.scrollHeight}px`));
|
|
4469
4469
|
}, [e, t, x]);
|
|
4470
|
-
const I =
|
|
4470
|
+
const I = Q.useCallback(() => {
|
|
4471
4471
|
const F = T.current;
|
|
4472
4472
|
F && (F.style.height = "auto", F.style.height = `${F.scrollHeight}px`);
|
|
4473
4473
|
}, []);
|
|
4474
|
-
|
|
4474
|
+
Q.useEffect(() => {
|
|
4475
4475
|
I();
|
|
4476
4476
|
}, [I, g]);
|
|
4477
|
-
const R =
|
|
4477
|
+
const R = Q.useCallback(
|
|
4478
4478
|
(F, { fromUser: A }) => {
|
|
4479
4479
|
x || y(F), A && (a == null || a(F));
|
|
4480
4480
|
},
|
|
4481
4481
|
[x, a]
|
|
4482
|
-
), N =
|
|
4482
|
+
), N = Q.useCallback(
|
|
4483
4483
|
async (F) => {
|
|
4484
4484
|
F && F.preventDefault();
|
|
4485
4485
|
const A = (g ?? "").trim();
|
|
@@ -4506,10 +4506,10 @@ function Zx({
|
|
|
4506
4506
|
});
|
|
4507
4507
|
},
|
|
4508
4508
|
[g, l, p, x, a]
|
|
4509
|
-
), D =
|
|
4509
|
+
), D = Q.useCallback((F) => {
|
|
4510
4510
|
const A = F.target.value;
|
|
4511
4511
|
R(A, { fromUser: !0 }), C.current && (C.current.shouldClear = !1), T.current && (T.current.style.height = "auto", T.current.style.height = `${T.current.scrollHeight}px`);
|
|
4512
|
-
}, [R]), j =
|
|
4512
|
+
}, [R]), j = Q.useCallback(
|
|
4513
4513
|
(F) => {
|
|
4514
4514
|
F.key === "Enter" && !F.shiftKey ? (F.preventDefault(), N()) : F.key === "Escape" && t && (F.preventDefault(), c == null || c());
|
|
4515
4515
|
},
|
|
@@ -4559,7 +4559,7 @@ function Zx({
|
|
|
4559
4559
|
) })
|
|
4560
4560
|
] }) });
|
|
4561
4561
|
}
|
|
4562
|
-
const Qx =
|
|
4562
|
+
const Qx = Q.memo(Zx);
|
|
4563
4563
|
function de(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
4564
4564
|
return function(o) {
|
|
4565
4565
|
if (e == null || e(o), n === !1 || !o.defaultPrevented)
|
|
@@ -4737,27 +4737,27 @@ function da(e) {
|
|
|
4737
4737
|
t,
|
|
4738
4738
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
4739
4739
|
), i = (m) => {
|
|
4740
|
-
const { scope: y, children: g } = m, w =
|
|
4740
|
+
const { scope: y, children: g } = m, w = Q.useRef(null), b = Q.useRef(/* @__PURE__ */ new Map()).current;
|
|
4741
4741
|
return /* @__PURE__ */ u.jsx(o, { scope: y, itemMap: b, collectionRef: w, children: g });
|
|
4742
4742
|
};
|
|
4743
4743
|
i.displayName = t;
|
|
4744
|
-
const a = e + "CollectionSlot", l = wr(a), c =
|
|
4744
|
+
const a = e + "CollectionSlot", l = wr(a), c = Q.forwardRef(
|
|
4745
4745
|
(m, y) => {
|
|
4746
4746
|
const { scope: g, children: w } = m, b = s(a, g), T = He(y, b.collectionRef);
|
|
4747
4747
|
return /* @__PURE__ */ u.jsx(l, { ref: T, children: w });
|
|
4748
4748
|
}
|
|
4749
4749
|
);
|
|
4750
4750
|
c.displayName = a;
|
|
4751
|
-
const d = e + "CollectionItemSlot", f = "data-radix-collection-item", h = wr(d), p =
|
|
4751
|
+
const d = e + "CollectionItemSlot", f = "data-radix-collection-item", h = wr(d), p = Q.forwardRef(
|
|
4752
4752
|
(m, y) => {
|
|
4753
|
-
const { scope: g, children: w, ...b } = m, T =
|
|
4754
|
-
return
|
|
4753
|
+
const { scope: g, children: w, ...b } = m, T = Q.useRef(null), S = He(y, T), C = s(d, g);
|
|
4754
|
+
return Q.useEffect(() => (C.itemMap.set(T, { ref: T, ...b }), () => void C.itemMap.delete(T))), /* @__PURE__ */ u.jsx(h, { [f]: "", ref: S, children: w });
|
|
4755
4755
|
}
|
|
4756
4756
|
);
|
|
4757
4757
|
p.displayName = d;
|
|
4758
4758
|
function x(m) {
|
|
4759
4759
|
const y = s(e + "CollectionConsumer", m);
|
|
4760
|
-
return
|
|
4760
|
+
return Q.useCallback(() => {
|
|
4761
4761
|
const w = y.collectionRef.current;
|
|
4762
4762
|
if (!w) return [];
|
|
4763
4763
|
const b = Array.from(w.querySelectorAll(`[${f}]`));
|
|
@@ -6427,7 +6427,7 @@ var Vu = "PopperAnchor", Ku = v.forwardRef(
|
|
|
6427
6427
|
Ku.displayName = Vu;
|
|
6428
6428
|
var wa = "PopperContent", [Lv, $v] = Hu(wa), qu = v.forwardRef(
|
|
6429
6429
|
(e, t) => {
|
|
6430
|
-
var X, L, V,
|
|
6430
|
+
var X, L, V, Z, le, oe;
|
|
6431
6431
|
const {
|
|
6432
6432
|
__scopePopper: n,
|
|
6433
6433
|
side: r = "bottom",
|
|
@@ -6469,9 +6469,9 @@ var wa = "PopperContent", [Lv, $v] = Hu(wa), qu = v.forwardRef(
|
|
|
6469
6469
|
l && Nv({ ...$ }),
|
|
6470
6470
|
_v({
|
|
6471
6471
|
...$,
|
|
6472
|
-
apply: ({ elements: Ne, rects:
|
|
6473
|
-
const { width:
|
|
6474
|
-
Ze.setProperty("--radix-popper-available-width", `${ae}px`), Ze.setProperty("--radix-popper-available-height", `${we}px`), Ze.setProperty("--radix-popper-anchor-width", `${
|
|
6472
|
+
apply: ({ elements: Ne, rects: Oe, availableWidth: ae, availableHeight: we }) => {
|
|
6473
|
+
const { width: je, height: Ue } = Oe.reference, Ze = Ne.floating.style;
|
|
6474
|
+
Ze.setProperty("--radix-popper-available-width", `${ae}px`), Ze.setProperty("--radix-popper-available-height", `${we}px`), Ze.setProperty("--radix-popper-anchor-width", `${je}px`), Ze.setProperty("--radix-popper-anchor-height", `${Ue}px`);
|
|
6475
6475
|
}
|
|
6476
6476
|
}),
|
|
6477
6477
|
T && Pv({ element: T, padding: a }),
|
|
@@ -6482,9 +6482,9 @@ var wa = "PopperContent", [Lv, $v] = Hu(wa), qu = v.forwardRef(
|
|
|
6482
6482
|
_t(() => {
|
|
6483
6483
|
K && (Y == null || Y());
|
|
6484
6484
|
}, [K, Y]);
|
|
6485
|
-
const se = (X = B.arrow) == null ? void 0 : X.x, ve = (L = B.arrow) == null ? void 0 : L.y, Ee = ((V = B.arrow) == null ? void 0 : V.centerOffset) !== 0, [z,
|
|
6485
|
+
const se = (X = B.arrow) == null ? void 0 : X.x, ve = (L = B.arrow) == null ? void 0 : L.y, Ee = ((V = B.arrow) == null ? void 0 : V.centerOffset) !== 0, [z, J] = v.useState();
|
|
6486
6486
|
return _t(() => {
|
|
6487
|
-
g &&
|
|
6487
|
+
g && J(window.getComputedStyle(g).zIndex);
|
|
6488
6488
|
}, [g]), /* @__PURE__ */ u.jsx(
|
|
6489
6489
|
"div",
|
|
6490
6490
|
{
|
|
@@ -6497,7 +6497,7 @@ var wa = "PopperContent", [Lv, $v] = Hu(wa), qu = v.forwardRef(
|
|
|
6497
6497
|
minWidth: "max-content",
|
|
6498
6498
|
zIndex: z,
|
|
6499
6499
|
"--radix-popper-transform-origin": [
|
|
6500
|
-
(
|
|
6500
|
+
(Z = B.transformOrigin) == null ? void 0 : Z.x,
|
|
6501
6501
|
(le = B.transformOrigin) == null ? void 0 : le.y
|
|
6502
6502
|
].join(" "),
|
|
6503
6503
|
// hide the content if using the hide middleware and should be hidden
|
|
@@ -7481,10 +7481,10 @@ var Qt = "MenuContent", [Qw, Ta] = sr(Qt), bd = v.forwardRef(
|
|
|
7481
7481
|
...m
|
|
7482
7482
|
} = e, y = ir(Qt, n), g = po(Qt, n), w = js(n), b = xd(n), T = qw(n), [S, C] = v.useState(null), I = v.useRef(null), R = He(t, I, y.onContentChange), N = v.useRef(0), D = v.useRef(""), j = v.useRef(0), P = v.useRef(null), $ = v.useRef("right"), E = v.useRef(0), F = x ? _s : v.Fragment, A = x ? { as: nb, allowPinchZoom: !0 } : void 0, K = (_) => {
|
|
7483
7483
|
var X, L;
|
|
7484
|
-
const q = D.current + _, Y = T().filter((V) => !V.disabled), se = document.activeElement, ve = (X = Y.find((V) => V.ref.current === se)) == null ? void 0 : X.textValue, Ee = Y.map((V) => V.textValue), z = hb(Ee, q, ve),
|
|
7485
|
-
(function V(
|
|
7486
|
-
D.current =
|
|
7487
|
-
})(q),
|
|
7484
|
+
const q = D.current + _, Y = T().filter((V) => !V.disabled), se = document.activeElement, ve = (X = Y.find((V) => V.ref.current === se)) == null ? void 0 : X.textValue, Ee = Y.map((V) => V.textValue), z = hb(Ee, q, ve), J = (L = Y.find((V) => V.textValue === z)) == null ? void 0 : L.ref.current;
|
|
7485
|
+
(function V(Z) {
|
|
7486
|
+
D.current = Z, window.clearTimeout(N.current), Z !== "" && (N.current = window.setTimeout(() => V(""), 1e3));
|
|
7487
|
+
})(q), J && setTimeout(() => J.focus());
|
|
7488
7488
|
};
|
|
7489
7489
|
v.useEffect(() => () => window.clearTimeout(N.current), []), fa();
|
|
7490
7490
|
const B = v.useCallback((_) => {
|
|
@@ -7571,8 +7571,8 @@ var Qt = "MenuContent", [Qw, Ta] = sr(Qt), bd = v.forwardRef(
|
|
|
7571
7571
|
const Ee = I.current;
|
|
7572
7572
|
if (_.target !== Ee || !Ww.includes(_.key)) return;
|
|
7573
7573
|
_.preventDefault();
|
|
7574
|
-
const
|
|
7575
|
-
md.includes(_.key) &&
|
|
7574
|
+
const J = T().filter((X) => !X.disabled).map((X) => X.ref.current);
|
|
7575
|
+
md.includes(_.key) && J.reverse(), fb(J);
|
|
7576
7576
|
}),
|
|
7577
7577
|
onBlur: de(e.onBlur, (_) => {
|
|
7578
7578
|
_.currentTarget.contains(_.target) || (window.clearTimeout(N.current), D.current = "");
|
|
@@ -8490,7 +8490,7 @@ function pt(...e) {
|
|
|
8490
8490
|
function tt(e, t) {
|
|
8491
8491
|
return e(zn, t);
|
|
8492
8492
|
}
|
|
8493
|
-
function
|
|
8493
|
+
function Me(e, t) {
|
|
8494
8494
|
e(Os, t);
|
|
8495
8495
|
}
|
|
8496
8496
|
function Na(e) {
|
|
@@ -8601,7 +8601,7 @@ function b0(e) {
|
|
|
8601
8601
|
}
|
|
8602
8602
|
};
|
|
8603
8603
|
}
|
|
8604
|
-
function
|
|
8604
|
+
function ee(e) {
|
|
8605
8605
|
let t = e;
|
|
8606
8606
|
const n = ze();
|
|
8607
8607
|
return (r, o) => {
|
|
@@ -8620,7 +8620,7 @@ function Q(e) {
|
|
|
8620
8620
|
};
|
|
8621
8621
|
}
|
|
8622
8622
|
function Dt(e, t) {
|
|
8623
|
-
return Ds(
|
|
8623
|
+
return Ds(ee(t), (n) => pe(e, n));
|
|
8624
8624
|
}
|
|
8625
8625
|
function ze() {
|
|
8626
8626
|
const e = [];
|
|
@@ -8670,7 +8670,7 @@ function Tt(...e) {
|
|
|
8670
8670
|
return e.forEach((s, i) => {
|
|
8671
8671
|
const a = Math.pow(2, i);
|
|
8672
8672
|
tt(s, (l) => {
|
|
8673
|
-
n[i] = l, r = r | a, r === o &&
|
|
8673
|
+
n[i] = l, r = r | a, r === o && Me(t, n);
|
|
8674
8674
|
});
|
|
8675
8675
|
}), function(s, i) {
|
|
8676
8676
|
switch (s) {
|
|
@@ -8704,12 +8704,12 @@ const T0 = {
|
|
|
8704
8704
|
2: "warn"
|
|
8705
8705
|
}, I0 = () => typeof globalThis > "u" ? window : globalThis, Hn = Xe(
|
|
8706
8706
|
() => {
|
|
8707
|
-
const e =
|
|
8707
|
+
const e = ee(
|
|
8708
8708
|
3
|
|
8709
8709
|
/* ERROR */
|
|
8710
8710
|
);
|
|
8711
8711
|
return {
|
|
8712
|
-
log:
|
|
8712
|
+
log: ee((t, n, r = 1) => {
|
|
8713
8713
|
var o;
|
|
8714
8714
|
const s = (o = I0().VIRTUOSO_LOG_LEVEL) != null ? o : bt(e);
|
|
8715
8715
|
r >= s && console[T0[r]](
|
|
@@ -8730,10 +8730,10 @@ function ar(e, t, n) {
|
|
|
8730
8730
|
return _a(e, t, n).callbackRef;
|
|
8731
8731
|
}
|
|
8732
8732
|
function _a(e, t, n) {
|
|
8733
|
-
const r =
|
|
8733
|
+
const r = Q.useRef(null);
|
|
8734
8734
|
let o = (i) => {
|
|
8735
8735
|
};
|
|
8736
|
-
const s =
|
|
8736
|
+
const s = Q.useMemo(() => typeof ResizeObserver < "u" ? new ResizeObserver((i) => {
|
|
8737
8737
|
const a = () => {
|
|
8738
8738
|
const l = i[0].target;
|
|
8739
8739
|
l.offsetParent !== null && e(l);
|
|
@@ -8745,7 +8745,7 @@ function _a(e, t, n) {
|
|
|
8745
8745
|
}, { callbackRef: o, ref: r };
|
|
8746
8746
|
}
|
|
8747
8747
|
function k0(e, t, n, r, o, s, i, a, l) {
|
|
8748
|
-
const c =
|
|
8748
|
+
const c = Q.useCallback(
|
|
8749
8749
|
(d) => {
|
|
8750
8750
|
const f = R0(d.children, t, a ? "offsetWidth" : "offsetHeight", o);
|
|
8751
8751
|
let h = d.parentElement;
|
|
@@ -8788,7 +8788,7 @@ function lc(e, t, n) {
|
|
|
8788
8788
|
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Ut.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
8789
8789
|
}
|
|
8790
8790
|
function pf(e, t, n) {
|
|
8791
|
-
const r =
|
|
8791
|
+
const r = Q.useRef(null), o = Q.useCallback(
|
|
8792
8792
|
(l) => {
|
|
8793
8793
|
if (!(l != null && l.offsetParent))
|
|
8794
8794
|
return;
|
|
@@ -8809,10 +8809,10 @@ function pf(e, t, n) {
|
|
|
8809
8809
|
},
|
|
8810
8810
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8811
8811
|
[e, t]
|
|
8812
|
-
), { callbackRef: s, ref: i } = _a(o, !0, n), a =
|
|
8812
|
+
), { callbackRef: s, ref: i } = _a(o, !0, n), a = Q.useCallback(() => {
|
|
8813
8813
|
o(i.current);
|
|
8814
8814
|
}, [o, i]);
|
|
8815
|
-
return
|
|
8815
|
+
return Q.useEffect(() => {
|
|
8816
8816
|
var l;
|
|
8817
8817
|
if (t) {
|
|
8818
8818
|
t.addEventListener("scroll", a);
|
|
@@ -8832,7 +8832,7 @@ function pf(e, t, n) {
|
|
|
8832
8832
|
}
|
|
8833
8833
|
const Bt = Xe(
|
|
8834
8834
|
() => {
|
|
8835
|
-
const e = ze(), t = ze(), n =
|
|
8835
|
+
const e = ze(), t = ze(), n = ee(0), r = ze(), o = ee(0), s = ze(), i = ze(), a = ee(0), l = ee(0), c = ee(0), d = ee(0), f = ze(), h = ze(), p = ee(!1), x = ee(!1), m = ee(!1);
|
|
8836
8836
|
return pe(
|
|
8837
8837
|
W(
|
|
8838
8838
|
e,
|
|
@@ -9012,7 +9012,7 @@ function Qr(e, t) {
|
|
|
9012
9012
|
return !!(e && e[0] === t[0] && e[1] === t[1]);
|
|
9013
9013
|
}
|
|
9014
9014
|
const ja = Xe(
|
|
9015
|
-
() => ({ recalcInProgress:
|
|
9015
|
+
() => ({ recalcInProgress: ee(!1) }),
|
|
9016
9016
|
[],
|
|
9017
9017
|
{ singleton: !0 }
|
|
9018
9018
|
);
|
|
@@ -9180,7 +9180,7 @@ const F0 = {
|
|
|
9180
9180
|
offsetWidth: "width"
|
|
9181
9181
|
}, wn = Xe(
|
|
9182
9182
|
([{ log: e }, { recalcInProgress: t }]) => {
|
|
9183
|
-
const n = ze(), r = ze(), o = Dt(r, 0), s = ze(), i = ze(), a =
|
|
9183
|
+
const n = ze(), r = ze(), o = Dt(r, 0), s = ze(), i = ze(), a = ee(0), l = ee([]), c = ee(void 0), d = ee(void 0), f = ee((S, C) => $n(S, F0[C])), h = ee(void 0), p = ee(0), x = N0(), m = Dt(
|
|
9184
9184
|
W(n, Le(l, e, p), gn(O0, x), ft()),
|
|
9185
9185
|
x
|
|
9186
9186
|
), y = Dt(
|
|
@@ -9266,10 +9266,10 @@ const F0 = {
|
|
|
9266
9266
|
(S) => {
|
|
9267
9267
|
const { groupIndices: C } = bt(m);
|
|
9268
9268
|
if (S > 0)
|
|
9269
|
-
|
|
9269
|
+
Me(t, !0), Me(s, S + uc(S, C));
|
|
9270
9270
|
else if (S < 0) {
|
|
9271
9271
|
const I = bt(y);
|
|
9272
|
-
I.length > 0 && (S -= uc(-S, I)),
|
|
9272
|
+
I.length > 0 && (S -= uc(-S, I)), Me(i, S);
|
|
9273
9273
|
}
|
|
9274
9274
|
}
|
|
9275
9275
|
), tt(W(a, Le(e)), ([S, C]) => {
|
|
@@ -9452,7 +9452,7 @@ const Cf = Xe(
|
|
|
9452
9452
|
pt(wn, Bt)
|
|
9453
9453
|
), Un = Xe(
|
|
9454
9454
|
([{ log: e }]) => {
|
|
9455
|
-
const t =
|
|
9455
|
+
const t = ee(!1), n = qt(
|
|
9456
9456
|
W(
|
|
9457
9457
|
t,
|
|
9458
9458
|
ke((r) => r),
|
|
@@ -9485,10 +9485,10 @@ const ho = Xe(
|
|
|
9485
9485
|
},
|
|
9486
9486
|
{ log: h }
|
|
9487
9487
|
]) => {
|
|
9488
|
-
const p = ze(), x = ze(), m =
|
|
9488
|
+
const p = ze(), x = ze(), m = ee(0);
|
|
9489
9489
|
let y = null, g = null, w = null;
|
|
9490
9490
|
function b() {
|
|
9491
|
-
y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null),
|
|
9491
|
+
y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), Me(l, !1);
|
|
9492
9492
|
}
|
|
9493
9493
|
return pe(
|
|
9494
9494
|
W(
|
|
@@ -9506,7 +9506,7 @@ const ho = Xe(
|
|
|
9506
9506
|
let Y = eo(q, S.offsetTree, P) + N;
|
|
9507
9507
|
A === "end" ? (Y += $ + cn(S.sizeTree, q)[1] - C + E, q === _ && (Y += D)) : A === "center" ? Y += ($ + cn(S.sizeTree, q)[1] - C + E) / 2 : Y -= R, B && (Y += B);
|
|
9508
9508
|
const se = (ve) => {
|
|
9509
|
-
b(), ve ? (j("retrying to scroll to", { location: T }, Ut.DEBUG),
|
|
9509
|
+
b(), ve ? (j("retrying to scroll to", { location: T }, Ut.DEBUG), Me(p, T)) : (Me(x, !0), j("list did not change, scroll successful", {}, Ut.DEBUG));
|
|
9510
9510
|
};
|
|
9511
9511
|
if (b(), K === "smooth") {
|
|
9512
9512
|
let ve = !1;
|
|
@@ -9519,7 +9519,7 @@ const ho = Xe(
|
|
|
9519
9519
|
y = sn(W(t, H0(150)), se);
|
|
9520
9520
|
return g = setTimeout(() => {
|
|
9521
9521
|
b();
|
|
9522
|
-
}, 1200),
|
|
9522
|
+
}, 1200), Me(l, !0), j("scrolling from index to", { behavior: K, index: q, top: Y }, Ut.DEBUG), { behavior: K, top: Y };
|
|
9523
9523
|
}
|
|
9524
9524
|
)
|
|
9525
9525
|
),
|
|
@@ -9554,7 +9554,7 @@ function Oa(e, t) {
|
|
|
9554
9554
|
}
|
|
9555
9555
|
const mo = Xe(
|
|
9556
9556
|
([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
|
|
9557
|
-
const a =
|
|
9557
|
+
const a = ee(!0), l = ee(0), c = ee(!0);
|
|
9558
9558
|
return pe(
|
|
9559
9559
|
W(
|
|
9560
9560
|
i,
|
|
@@ -9580,11 +9580,11 @@ const mo = Xe(
|
|
|
9580
9580
|
),
|
|
9581
9581
|
([, d]) => {
|
|
9582
9582
|
sn(o, () => {
|
|
9583
|
-
|
|
9583
|
+
Me(c, !0);
|
|
9584
9584
|
}), Ma(4, () => {
|
|
9585
9585
|
sn(r, () => {
|
|
9586
|
-
|
|
9587
|
-
}),
|
|
9586
|
+
Me(a, !0);
|
|
9587
|
+
}), Me(s, d);
|
|
9588
9588
|
});
|
|
9589
9589
|
}
|
|
9590
9590
|
), {
|
|
@@ -9609,7 +9609,7 @@ const to = "up", Br = "down", U0 = "none", W0 = {
|
|
|
9609
9609
|
viewportHeight: 0
|
|
9610
9610
|
}
|
|
9611
9611
|
}, V0 = 0, go = Xe(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
9612
|
-
const i =
|
|
9612
|
+
const i = ee(!1), a = ee(!0), l = ze(), c = ze(), d = ee(4), f = ee(V0), h = Dt(
|
|
9613
9613
|
W(
|
|
9614
9614
|
Bi(W(Ie(o), tr(1), pn(!0)), W(Ie(o), tr(1), pn(!1), ac(100))),
|
|
9615
9615
|
ft()
|
|
@@ -9695,7 +9695,7 @@ const to = "up", Br = "down", U0 = "none", W0 = {
|
|
|
9695
9695
|
),
|
|
9696
9696
|
i
|
|
9697
9697
|
), pe(W(i, Tn(50)), l);
|
|
9698
|
-
const y =
|
|
9698
|
+
const y = ee(Br);
|
|
9699
9699
|
pe(
|
|
9700
9700
|
W(
|
|
9701
9701
|
r,
|
|
@@ -9709,7 +9709,7 @@ const to = "up", Br = "down", U0 = "none", W0 = {
|
|
|
9709
9709
|
),
|
|
9710
9710
|
y
|
|
9711
9711
|
), pe(W(r, Tn(50), pn(U0)), y);
|
|
9712
|
-
const g =
|
|
9712
|
+
const g = ee(0);
|
|
9713
9713
|
return pe(
|
|
9714
9714
|
W(
|
|
9715
9715
|
h,
|
|
@@ -9750,7 +9750,7 @@ function pc(e, t) {
|
|
|
9750
9750
|
}
|
|
9751
9751
|
const Da = Xe(
|
|
9752
9752
|
([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
|
|
9753
|
-
const s = ze(), i =
|
|
9753
|
+
const s = ze(), i = ee(0), a = ee(0), l = ee(0), c = Dt(
|
|
9754
9754
|
W(
|
|
9755
9755
|
Tt(
|
|
9756
9756
|
Ie(r),
|
|
@@ -9897,7 +9897,7 @@ const lr = Xe(
|
|
|
9897
9897
|
{ didMount: p },
|
|
9898
9898
|
{ recalcInProgress: x }
|
|
9899
9899
|
]) => {
|
|
9900
|
-
const m =
|
|
9900
|
+
const m = ee([]), y = ee(0), g = ze();
|
|
9901
9901
|
pe(s.topItemsIndexes, m);
|
|
9902
9902
|
const w = Dt(
|
|
9903
9903
|
W(
|
|
@@ -9948,11 +9948,11 @@ const lr = Xe(
|
|
|
9948
9948
|
);
|
|
9949
9949
|
const q = [];
|
|
9950
9950
|
if (P.length > 0) {
|
|
9951
|
-
const z = P[0],
|
|
9951
|
+
const z = P[0], J = P[P.length - 1];
|
|
9952
9952
|
let X = 0;
|
|
9953
|
-
for (const L of Ls(B, z,
|
|
9954
|
-
const V = L.value,
|
|
9955
|
-
for (let oe =
|
|
9953
|
+
for (const L of Ls(B, z, J)) {
|
|
9954
|
+
const V = L.value, Z = Math.max(L.start, z), le = Math.min(L.end, J);
|
|
9955
|
+
for (let oe = Z; oe <= le; oe++)
|
|
9956
9956
|
q.push({ data: F == null ? void 0 : F[oe], index: oe, offset: X, size: V }), X += V;
|
|
9957
9957
|
}
|
|
9958
9958
|
}
|
|
@@ -9962,19 +9962,19 @@ const lr = Xe(
|
|
|
9962
9962
|
if (se.length === 0)
|
|
9963
9963
|
return null;
|
|
9964
9964
|
const ve = R - 1, Ee = Ds([], (z) => {
|
|
9965
|
-
for (const
|
|
9966
|
-
const X =
|
|
9967
|
-
let L = X.offset, V =
|
|
9968
|
-
const
|
|
9965
|
+
for (const J of se) {
|
|
9966
|
+
const X = J.value;
|
|
9967
|
+
let L = X.offset, V = J.start;
|
|
9968
|
+
const Z = X.size;
|
|
9969
9969
|
if (X.offset < C) {
|
|
9970
|
-
V += Math.floor((C - X.offset + E) / (
|
|
9971
|
-
const oe = V -
|
|
9972
|
-
L += oe *
|
|
9970
|
+
V += Math.floor((C - X.offset + E) / (Z + E));
|
|
9971
|
+
const oe = V - J.start;
|
|
9972
|
+
L += oe * Z + oe * E;
|
|
9973
9973
|
}
|
|
9974
|
-
V < Y && (L += (Y - V) *
|
|
9975
|
-
const le = Math.min(
|
|
9974
|
+
V < Y && (L += (Y - V) * Z, V = Y);
|
|
9975
|
+
const le = Math.min(J.end, ve);
|
|
9976
9976
|
for (let oe = V; oe <= le && !(L >= I); oe++)
|
|
9977
|
-
z.push({ data: F == null ? void 0 : F[oe], index: oe, offset: L, size:
|
|
9977
|
+
z.push({ data: F == null ? void 0 : F[oe], index: oe, offset: L, size: Z }), L += Z + E;
|
|
9978
9978
|
}
|
|
9979
9979
|
});
|
|
9980
9980
|
return zo(Ee, q, R, E, A, $);
|
|
@@ -10076,7 +10076,7 @@ const lr = Xe(
|
|
|
10076
10076
|
{ singleton: !0 }
|
|
10077
10077
|
), q0 = Xe(
|
|
10078
10078
|
([{ viewportHeight: e }, { totalListHeight: t }]) => {
|
|
10079
|
-
const n =
|
|
10079
|
+
const n = ee(!1), r = Dt(
|
|
10080
10080
|
W(
|
|
10081
10081
|
Tt(n, e, t),
|
|
10082
10082
|
ke(([o]) => o),
|
|
@@ -10091,7 +10091,7 @@ const lr = Xe(
|
|
|
10091
10091
|
pt(Bt, Rf),
|
|
10092
10092
|
{ singleton: !0 }
|
|
10093
10093
|
), Ef = Xe(() => ({
|
|
10094
|
-
context:
|
|
10094
|
+
context: ee(null)
|
|
10095
10095
|
})), G0 = ({
|
|
10096
10096
|
itemBottom: e,
|
|
10097
10097
|
itemTop: t,
|
|
@@ -10154,10 +10154,10 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Xe(
|
|
|
10154
10154
|
{ context: h },
|
|
10155
10155
|
{ scrollIntoView: p }
|
|
10156
10156
|
]) => {
|
|
10157
|
-
const x =
|
|
10157
|
+
const x = ee(!1), m = ze();
|
|
10158
10158
|
let y = null;
|
|
10159
10159
|
function g(S) {
|
|
10160
|
-
|
|
10160
|
+
Me(i, {
|
|
10161
10161
|
align: "end",
|
|
10162
10162
|
behavior: S,
|
|
10163
10163
|
index: "LAST"
|
|
@@ -10206,7 +10206,7 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Xe(
|
|
|
10206
10206
|
}), tt(Tt(Ie(x), o), ([S, C]) => {
|
|
10207
10207
|
S && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
|
|
10208
10208
|
});
|
|
10209
|
-
const b =
|
|
10209
|
+
const b = ee(null), T = ze();
|
|
10210
10210
|
return pe(
|
|
10211
10211
|
Bi(
|
|
10212
10212
|
W(
|
|
@@ -10229,9 +10229,9 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Xe(
|
|
|
10229
10229
|
),
|
|
10230
10230
|
(S) => {
|
|
10231
10231
|
y && (y(), y = null), bt(n) ? requestAnimationFrame(() => {
|
|
10232
|
-
bt(d)("scrolling into view", {}),
|
|
10232
|
+
bt(d)("scrolling into view", {}), Me(p, S);
|
|
10233
10233
|
}) : y = sn(e, () => {
|
|
10234
|
-
bt(d)("scrolling into view", {}),
|
|
10234
|
+
bt(d)("scrolling into view", {}), Me(p, S), y = null;
|
|
10235
10235
|
});
|
|
10236
10236
|
}
|
|
10237
10237
|
), { autoscrollToBottom: m, followOutput: x, scrollIntoViewOnChange: b };
|
|
@@ -10262,7 +10262,7 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Xe(
|
|
|
10262
10262
|
{ singleton: !0 }
|
|
10263
10263
|
), Z0 = Xe(
|
|
10264
10264
|
([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
|
|
10265
|
-
const r =
|
|
10265
|
+
const r = ee(0);
|
|
10266
10266
|
return tt(
|
|
10267
10267
|
W(
|
|
10268
10268
|
e,
|
|
@@ -10279,7 +10279,7 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Xe(
|
|
|
10279
10279
|
),
|
|
10280
10280
|
() => {
|
|
10281
10281
|
requestAnimationFrame(() => {
|
|
10282
|
-
|
|
10282
|
+
Me(t, o);
|
|
10283
10283
|
});
|
|
10284
10284
|
}
|
|
10285
10285
|
);
|
|
@@ -10292,7 +10292,7 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Xe(
|
|
|
10292
10292
|
{ singleton: !0 }
|
|
10293
10293
|
), Nf = Xe(
|
|
10294
10294
|
([{ scrollVelocity: e }]) => {
|
|
10295
|
-
const t =
|
|
10295
|
+
const t = ee(!1), n = ze(), r = ee(!1);
|
|
10296
10296
|
return pe(
|
|
10297
10297
|
W(
|
|
10298
10298
|
e,
|
|
@@ -10320,7 +10320,7 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Xe(
|
|
|
10320
10320
|
pt(go),
|
|
10321
10321
|
{ singleton: !0 }
|
|
10322
10322
|
), La = Xe(([{ scrollContainerState: e, scrollTo: t }]) => {
|
|
10323
|
-
const n = ze(), r = ze(), o = ze(), s =
|
|
10323
|
+
const n = ze(), r = ze(), o = ze(), s = ee(!1), i = ee(void 0);
|
|
10324
10324
|
return pe(
|
|
10325
10325
|
W(
|
|
10326
10326
|
Tt(n, r),
|
|
@@ -10359,7 +10359,7 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Xe(
|
|
|
10359
10359
|
{ didMount: s },
|
|
10360
10360
|
{ useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
|
|
10361
10361
|
]) => {
|
|
10362
|
-
const c = ze(), d =
|
|
10362
|
+
const c = ze(), d = ee(void 0), f = ee(null), h = ee(null);
|
|
10363
10363
|
return pe(a, f), pe(l, h), tt(
|
|
10364
10364
|
W(
|
|
10365
10365
|
c,
|
|
@@ -10389,7 +10389,7 @@ function eS(e) {
|
|
|
10389
10389
|
return { align: "start", index: 0, offset: e.scrollTop };
|
|
10390
10390
|
}
|
|
10391
10391
|
const tS = Xe(([{ topItemsIndexes: e }]) => {
|
|
10392
|
-
const t =
|
|
10392
|
+
const t = ee(0);
|
|
10393
10393
|
return pe(
|
|
10394
10394
|
W(
|
|
10395
10395
|
t,
|
|
@@ -10431,10 +10431,10 @@ const nS = _f(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10431
10431
|
)
|
|
10432
10432
|
);
|
|
10433
10433
|
function y(g) {
|
|
10434
|
-
g > 0 ? (
|
|
10434
|
+
g > 0 ? (Me(t, { behavior: "auto", top: -g }), Me(e, 0)) : (Me(e, 0), Me(t, { behavior: "auto", top: -g }));
|
|
10435
10435
|
}
|
|
10436
10436
|
return tt(W(m, Le(e, s)), ([g, w, b]) => {
|
|
10437
|
-
b && nS() ?
|
|
10437
|
+
b && nS() ? Me(e, w - g) : y(-g);
|
|
10438
10438
|
}), tt(
|
|
10439
10439
|
W(
|
|
10440
10440
|
Tt(Dt(s, !1), e, x),
|
|
@@ -10473,9 +10473,9 @@ const nS = _f(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10473
10473
|
})
|
|
10474
10474
|
),
|
|
10475
10475
|
(g) => {
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10476
|
+
Me(e, g), requestAnimationFrame(() => {
|
|
10477
|
+
Me(t, { top: g }), requestAnimationFrame(() => {
|
|
10478
|
+
Me(e, 0), Me(x, !1);
|
|
10479
10479
|
});
|
|
10480
10480
|
});
|
|
10481
10481
|
}
|
|
@@ -10608,35 +10608,35 @@ function sS(e, t) {
|
|
|
10608
10608
|
Object.hasOwn(r, i) || (n[i] = t[i]);
|
|
10609
10609
|
return n;
|
|
10610
10610
|
}
|
|
10611
|
-
const ko = typeof document < "u" ?
|
|
10611
|
+
const ko = typeof document < "u" ? Q.useLayoutEffect : Q.useEffect;
|
|
10612
10612
|
function Pf(e, t, n) {
|
|
10613
|
-
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a =
|
|
10613
|
+
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = Q.createContext({});
|
|
10614
10614
|
function l(y, g) {
|
|
10615
|
-
y.propsReady &&
|
|
10615
|
+
y.propsReady && Me(y.propsReady, !1);
|
|
10616
10616
|
for (const w of r) {
|
|
10617
10617
|
const b = y[t.required[w]];
|
|
10618
|
-
|
|
10618
|
+
Me(b, g[w]);
|
|
10619
10619
|
}
|
|
10620
10620
|
for (const w of o)
|
|
10621
10621
|
if (w in g) {
|
|
10622
10622
|
const b = y[t.optional[w]];
|
|
10623
|
-
|
|
10623
|
+
Me(b, g[w]);
|
|
10624
10624
|
}
|
|
10625
|
-
y.propsReady &&
|
|
10625
|
+
y.propsReady && Me(y.propsReady, !0);
|
|
10626
10626
|
}
|
|
10627
10627
|
function c(y) {
|
|
10628
10628
|
return s.reduce((g, w) => (g[w] = (b) => {
|
|
10629
10629
|
const T = y[t.methods[w]];
|
|
10630
|
-
|
|
10630
|
+
Me(T, b);
|
|
10631
10631
|
}, g), {});
|
|
10632
10632
|
}
|
|
10633
10633
|
function d(y) {
|
|
10634
10634
|
return i.reduce((g, w) => (g[w] = b0(y[t.events[w]]), g), {});
|
|
10635
10635
|
}
|
|
10636
|
-
const f =
|
|
10637
|
-
const { children: w, ...b } = y, [T] =
|
|
10636
|
+
const f = Q.forwardRef((y, g) => {
|
|
10637
|
+
const { children: w, ...b } = y, [T] = Q.useState(() => Ds(C0(e), (I) => {
|
|
10638
10638
|
l(I, b);
|
|
10639
|
-
})), [S] =
|
|
10639
|
+
})), [S] = Q.useState(ic(d, T));
|
|
10640
10640
|
ko(() => {
|
|
10641
10641
|
for (const I of i)
|
|
10642
10642
|
I in b && tt(S[I], b[I]);
|
|
@@ -10645,47 +10645,47 @@ function Pf(e, t, n) {
|
|
|
10645
10645
|
};
|
|
10646
10646
|
}, [b, S, T]), ko(() => {
|
|
10647
10647
|
l(T, b);
|
|
10648
|
-
}),
|
|
10648
|
+
}), Q.useImperativeHandle(g, sc(c(T)));
|
|
10649
10649
|
const C = n;
|
|
10650
10650
|
return /* @__PURE__ */ u.jsx(a.Provider, { value: T, children: n ? /* @__PURE__ */ u.jsx(C, { ...sS([...r, ...o, ...i], b), children: w }) : w });
|
|
10651
10651
|
}), h = (y) => {
|
|
10652
|
-
const g =
|
|
10653
|
-
return
|
|
10652
|
+
const g = Q.useContext(a);
|
|
10653
|
+
return Q.useCallback(
|
|
10654
10654
|
(w) => {
|
|
10655
|
-
|
|
10655
|
+
Me(g[y], w);
|
|
10656
10656
|
},
|
|
10657
10657
|
[g, y]
|
|
10658
10658
|
);
|
|
10659
10659
|
}, p = (y) => {
|
|
10660
|
-
const g =
|
|
10660
|
+
const g = Q.useContext(a)[y], w = Q.useCallback(
|
|
10661
10661
|
(b) => tt(g, b),
|
|
10662
10662
|
[g]
|
|
10663
10663
|
);
|
|
10664
|
-
return
|
|
10664
|
+
return Q.useSyncExternalStore(
|
|
10665
10665
|
w,
|
|
10666
10666
|
() => bt(g),
|
|
10667
10667
|
() => bt(g)
|
|
10668
10668
|
);
|
|
10669
10669
|
}, x = (y) => {
|
|
10670
|
-
const g =
|
|
10670
|
+
const g = Q.useContext(a)[y], [w, b] = Q.useState(ic(bt, g));
|
|
10671
10671
|
return ko(
|
|
10672
10672
|
() => tt(g, (T) => {
|
|
10673
10673
|
T !== w && b(sc(T));
|
|
10674
10674
|
}),
|
|
10675
10675
|
[g, w]
|
|
10676
10676
|
), w;
|
|
10677
|
-
}, m =
|
|
10677
|
+
}, m = Q.version.startsWith("18") ? p : x;
|
|
10678
10678
|
return {
|
|
10679
10679
|
Component: f,
|
|
10680
10680
|
useEmitter: (y, g) => {
|
|
10681
|
-
const w =
|
|
10681
|
+
const w = Q.useContext(a)[y];
|
|
10682
10682
|
ko(() => tt(w, g), [g, w]);
|
|
10683
10683
|
},
|
|
10684
10684
|
useEmitterValue: m,
|
|
10685
10685
|
usePublisher: h
|
|
10686
10686
|
};
|
|
10687
10687
|
}
|
|
10688
|
-
const Mf =
|
|
10688
|
+
const Mf = Q.createContext(void 0), Of = Q.createContext(void 0), Df = typeof document < "u" ? Q.useLayoutEffect : Q.useEffect;
|
|
10689
10689
|
function gi(e) {
|
|
10690
10690
|
return "self" in e;
|
|
10691
10691
|
}
|
|
@@ -10693,7 +10693,7 @@ function iS(e) {
|
|
|
10693
10693
|
return "body" in e;
|
|
10694
10694
|
}
|
|
10695
10695
|
function Lf(e, t, n, r = Nr, o, s) {
|
|
10696
|
-
const i =
|
|
10696
|
+
const i = Q.useRef(null), a = Q.useRef(null), l = Q.useRef(null), c = Q.useCallback(
|
|
10697
10697
|
(h) => {
|
|
10698
10698
|
let p, x, m;
|
|
10699
10699
|
const y = h.target;
|
|
@@ -10713,7 +10713,7 @@ function Lf(e, t, n, r = Nr, o, s) {
|
|
|
10713
10713
|
},
|
|
10714
10714
|
[e, t, s]
|
|
10715
10715
|
);
|
|
10716
|
-
|
|
10716
|
+
Q.useEffect(() => {
|
|
10717
10717
|
const h = o || i.current;
|
|
10718
10718
|
return r(o || i.current), c({ suppressFlushSync: !0, target: h }), h.addEventListener("scroll", c, { passive: !0 }), () => {
|
|
10719
10719
|
r(null), h.removeEventListener("scroll", c);
|
|
@@ -10753,7 +10753,7 @@ function Fa(e) {
|
|
|
10753
10753
|
return e;
|
|
10754
10754
|
}
|
|
10755
10755
|
const aS = /* @__PURE__ */ Xe(() => {
|
|
10756
|
-
const e =
|
|
10756
|
+
const e = ee((a) => `Item ${a}`), t = ee((a) => `Group ${a}`), n = ee({}), r = ee(Fa), o = ee("div"), s = ee(Nr), i = (a, l = null) => Dt(
|
|
10757
10757
|
W(
|
|
10758
10758
|
n,
|
|
10759
10759
|
ce((c) => c[a]),
|
|
@@ -10781,7 +10781,7 @@ const aS = /* @__PURE__ */ Xe(() => {
|
|
|
10781
10781
|
}), lS = /* @__PURE__ */ Xe(
|
|
10782
10782
|
([e, t]) => ({ ...e, ...t }),
|
|
10783
10783
|
pt(jf, aS)
|
|
10784
|
-
), cS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), uS = { overflowAnchor: "none", position: $a(), zIndex: 1 }, $f = { overflowAnchor: "none" }, dS = { ...$f, display: "inline-block", height: "100%" }, xc = /* @__PURE__ */
|
|
10784
|
+
), cS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), uS = { overflowAnchor: "none", position: $a(), zIndex: 1 }, $f = { overflowAnchor: "none" }, dS = { ...$f, display: "inline-block", height: "100%" }, xc = /* @__PURE__ */ Q.memo(function({ showTopList: e = !1 }) {
|
|
10785
10785
|
const t = Ae("listState"), n = Jt("sizeRanges"), r = Ae("useWindowScroll"), o = Ae("customScrollParent"), s = Jt("windowScrollContainerState"), i = Jt("scrollContainerState"), a = o || r ? s : i, l = Ae("itemContent"), c = Ae("context"), d = Ae("groupContent"), f = Ae("trackItemSizes"), h = Ae("itemSize"), p = Ae("log"), x = Jt("gap"), m = Ae("horizontalDirection"), { callbackRef: y } = k0(
|
|
10786
10786
|
n,
|
|
10787
10787
|
h,
|
|
@@ -10792,7 +10792,7 @@ const aS = /* @__PURE__ */ Xe(() => {
|
|
|
10792
10792
|
o,
|
|
10793
10793
|
m,
|
|
10794
10794
|
Ae("skipAnimationFrameInResizeObserver")
|
|
10795
|
-
), [g, w] =
|
|
10795
|
+
), [g, w] = Q.useState(0);
|
|
10796
10796
|
Ba("deviation", (E) => {
|
|
10797
10797
|
g !== E && w(E);
|
|
10798
10798
|
});
|
|
@@ -10888,9 +10888,9 @@ function Ot(e, t) {
|
|
|
10888
10888
|
function mS(e, t) {
|
|
10889
10889
|
return { item: typeof e == "string" ? void 0 : t };
|
|
10890
10890
|
}
|
|
10891
|
-
const gS = /* @__PURE__ */
|
|
10891
|
+
const gS = /* @__PURE__ */ Q.memo(function() {
|
|
10892
10892
|
const e = Ae("HeaderComponent"), t = Jt("headerHeight"), n = Ae("HeaderFooterTag"), r = ar(
|
|
10893
|
-
|
|
10893
|
+
Q.useMemo(
|
|
10894
10894
|
() => (s) => {
|
|
10895
10895
|
t($n(s, "height"));
|
|
10896
10896
|
},
|
|
@@ -10900,9 +10900,9 @@ const gS = /* @__PURE__ */ Z.memo(function() {
|
|
|
10900
10900
|
Ae("skipAnimationFrameInResizeObserver")
|
|
10901
10901
|
), o = Ae("context");
|
|
10902
10902
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
|
|
10903
|
-
}), xS = /* @__PURE__ */
|
|
10903
|
+
}), xS = /* @__PURE__ */ Q.memo(function() {
|
|
10904
10904
|
const e = Ae("FooterComponent"), t = Jt("footerHeight"), n = Ae("HeaderFooterTag"), r = ar(
|
|
10905
|
-
|
|
10905
|
+
Q.useMemo(
|
|
10906
10906
|
() => (s) => {
|
|
10907
10907
|
t($n(s, "height"));
|
|
10908
10908
|
},
|
|
@@ -10914,7 +10914,7 @@ const gS = /* @__PURE__ */ Z.memo(function() {
|
|
|
10914
10914
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
|
|
10915
10915
|
});
|
|
10916
10916
|
function Ff({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
10917
|
-
return
|
|
10917
|
+
return Q.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
10918
10918
|
const a = n("scrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("scrollerRef"), f = t("horizontalDirection") || !1, { scrollByCallback: h, scrollerRef: p, scrollToCallback: x } = Lf(
|
|
10919
10919
|
a,
|
|
10920
10920
|
c,
|
|
@@ -10939,8 +10939,8 @@ function Ff({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10939
10939
|
});
|
|
10940
10940
|
}
|
|
10941
10941
|
function Bf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
10942
|
-
return
|
|
10943
|
-
const a = n("windowScrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("totalListHeight"), f = t("deviation"), h = t("customScrollParent"), p =
|
|
10942
|
+
return Q.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
10943
|
+
const a = n("windowScrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("totalListHeight"), f = t("deviation"), h = t("customScrollParent"), p = Q.useRef(null), x = t("scrollerRef"), { scrollByCallback: m, scrollerRef: y, scrollToCallback: g } = Lf(
|
|
10944
10944
|
a,
|
|
10945
10945
|
c,
|
|
10946
10946
|
l,
|
|
@@ -10966,26 +10966,26 @@ function Bf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10966
10966
|
});
|
|
10967
10967
|
}
|
|
10968
10968
|
const yS = ({ children: e }) => {
|
|
10969
|
-
const t =
|
|
10969
|
+
const t = Q.useContext(Mf), n = Jt("viewportHeight"), r = Jt("fixedItemHeight"), o = Ae("alignToBottom"), s = Ae("horizontalDirection"), i = Q.useMemo(
|
|
10970
10970
|
() => df(n, (l) => $n(l, s ? "width" : "height")),
|
|
10971
10971
|
[n, s]
|
|
10972
10972
|
), a = ar(i, !0, Ae("skipAnimationFrameInResizeObserver"));
|
|
10973
|
-
return
|
|
10973
|
+
return Q.useEffect(() => {
|
|
10974
10974
|
t && (n(t.viewportHeight), r(t.itemHeight));
|
|
10975
10975
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: Fs(o), children: e });
|
|
10976
10976
|
}, vS = ({ children: e }) => {
|
|
10977
|
-
const t =
|
|
10977
|
+
const t = Q.useContext(Mf), n = Jt("windowViewportRect"), r = Jt("fixedItemHeight"), o = Ae("customScrollParent"), s = pf(
|
|
10978
10978
|
n,
|
|
10979
10979
|
o,
|
|
10980
10980
|
Ae("skipAnimationFrameInResizeObserver")
|
|
10981
10981
|
), i = Ae("alignToBottom");
|
|
10982
|
-
return
|
|
10982
|
+
return Q.useEffect(() => {
|
|
10983
10983
|
t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
|
|
10984
10984
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: Fs(i), children: e });
|
|
10985
10985
|
}, wS = ({ children: e }) => {
|
|
10986
10986
|
const t = Ae("TopItemListComponent") || "div", n = Ae("headerHeight"), r = { ...hS, marginTop: `${n}px` }, o = Ae("context");
|
|
10987
10987
|
return /* @__PURE__ */ u.jsx(t, { style: r, ...Ot(t, o), children: e });
|
|
10988
|
-
}, bS = /* @__PURE__ */
|
|
10988
|
+
}, bS = /* @__PURE__ */ Q.memo(function(e) {
|
|
10989
10989
|
const t = Ae("useWindowScroll"), n = Ae("topItemsIndexes").length > 0, r = Ae("customScrollParent"), o = Ae("context");
|
|
10990
10990
|
return /* @__PURE__ */ u.jsxs(r || t ? TS : CS, { ...e, context: o, children: [
|
|
10991
10991
|
n && /* @__PURE__ */ u.jsx(wS, { children: /* @__PURE__ */ u.jsx(xc, { showTopList: !0 }) }),
|
|
@@ -11060,13 +11060,13 @@ const yS = ({ children: e }) => {
|
|
|
11060
11060
|
},
|
|
11061
11061
|
bS
|
|
11062
11062
|
), CS = /* @__PURE__ */ Ff({ useEmitter: Ba, useEmitterValue: Ae, usePublisher: Jt }), TS = /* @__PURE__ */ Bf({ useEmitter: Ba, useEmitterValue: Ae, usePublisher: Jt }), IS = SS, kS = /* @__PURE__ */ Xe(() => {
|
|
11063
|
-
const e =
|
|
11063
|
+
const e = ee((c) => /* @__PURE__ */ u.jsxs("td", { children: [
|
|
11064
11064
|
"Item $",
|
|
11065
11065
|
c
|
|
11066
|
-
] })), t =
|
|
11066
|
+
] })), t = ee(null), n = ee((c) => /* @__PURE__ */ u.jsxs("td", { colSpan: 1e3, children: [
|
|
11067
11067
|
"Group ",
|
|
11068
11068
|
c
|
|
11069
|
-
] })), r =
|
|
11069
|
+
] })), r = ee(null), o = ee(null), s = ee({}), i = ee(Fa), a = ee(Nr), l = (c, d = null) => Dt(
|
|
11070
11070
|
W(
|
|
11071
11071
|
s,
|
|
11072
11072
|
ce((f) => f[c]),
|
|
@@ -11139,7 +11139,7 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11139
11139
|
{ customScrollParent: y, useWindowScroll: g, windowScrollContainerState: w, windowScrollTo: b, windowViewportRect: T },
|
|
11140
11140
|
S
|
|
11141
11141
|
]) => {
|
|
11142
|
-
const C =
|
|
11142
|
+
const C = ee(0), I = ee(0), R = ee(yc), N = ee({ height: 0, width: 0 }), D = ee({ height: 0, width: 0 }), j = ze(), P = ze(), $ = ee(0), E = ee(null), F = ee({ column: 0, row: 0 }), A = ze(), K = ze(), B = ee(!1), _ = ee(0), q = ee(!0), Y = ee(!1), se = ee(!1);
|
|
11143
11143
|
tt(
|
|
11144
11144
|
W(
|
|
11145
11145
|
x,
|
|
@@ -11147,18 +11147,18 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11147
11147
|
ke(([L, V]) => !!V)
|
|
11148
11148
|
),
|
|
11149
11149
|
() => {
|
|
11150
|
-
|
|
11150
|
+
Me(q, !1);
|
|
11151
11151
|
}
|
|
11152
11152
|
), tt(
|
|
11153
11153
|
W(
|
|
11154
11154
|
Tt(x, q, D, N, _, Y),
|
|
11155
|
-
ke(([L, V,
|
|
11155
|
+
ke(([L, V, Z, le, , oe]) => L && !V && Z.height !== 0 && le.height !== 0 && !oe)
|
|
11156
11156
|
),
|
|
11157
11157
|
([, , , , L]) => {
|
|
11158
|
-
|
|
11159
|
-
|
|
11158
|
+
Me(Y, !0), Ma(1, () => {
|
|
11159
|
+
Me(j, L);
|
|
11160
11160
|
}), sn(W(c), () => {
|
|
11161
|
-
|
|
11161
|
+
Me(t, [0, 0]), Me(q, !0);
|
|
11162
11162
|
});
|
|
11163
11163
|
}
|
|
11164
11164
|
), pe(
|
|
@@ -11175,9 +11175,9 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11175
11175
|
ke(([, L]) => L != null)
|
|
11176
11176
|
),
|
|
11177
11177
|
([, L]) => {
|
|
11178
|
-
L && (
|
|
11179
|
-
|
|
11180
|
-
}),
|
|
11178
|
+
L && (Me(N, L.viewport), Me(D, L.item), Me(F, L.gap), L.scrollTop > 0 && (Me(B, !0), sn(W(c, tr(1)), (V) => {
|
|
11179
|
+
Me(B, !1);
|
|
11180
|
+
}), Me(l, { top: L.scrollTop })));
|
|
11181
11181
|
}
|
|
11182
11182
|
), pe(
|
|
11183
11183
|
W(
|
|
@@ -11193,8 +11193,8 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11193
11193
|
Ie(F, (L, V) => L && L.column === V.column && L.row === V.row),
|
|
11194
11194
|
Ie(c)
|
|
11195
11195
|
),
|
|
11196
|
-
ce(([L, V,
|
|
11197
|
-
gap:
|
|
11196
|
+
ce(([L, V, Z, le]) => ({
|
|
11197
|
+
gap: Z,
|
|
11198
11198
|
item: V,
|
|
11199
11199
|
scrollTop: le,
|
|
11200
11200
|
viewport: L
|
|
@@ -11219,27 +11219,27 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11219
11219
|
ce(
|
|
11220
11220
|
([
|
|
11221
11221
|
L,
|
|
11222
|
-
[V,
|
|
11222
|
+
[V, Z],
|
|
11223
11223
|
le,
|
|
11224
11224
|
oe,
|
|
11225
11225
|
Ne,
|
|
11226
|
-
|
|
11226
|
+
Oe,
|
|
11227
11227
|
ae,
|
|
11228
11228
|
,
|
|
11229
11229
|
we,
|
|
11230
|
-
|
|
11230
|
+
je
|
|
11231
11231
|
]) => {
|
|
11232
11232
|
const { column: Ue, row: Ze } = le, { height: We, width: ut } = oe, { width: st } = Ne;
|
|
11233
11233
|
if (ae === 0 && (L === 0 || st === 0))
|
|
11234
11234
|
return yc;
|
|
11235
11235
|
if (ut === 0) {
|
|
11236
|
-
const Lt = Oa(
|
|
11237
|
-
return ES(bc(Lt, Et,
|
|
11236
|
+
const Lt = Oa(je, L), Et = Lt + Math.max(ae - 1, 0);
|
|
11237
|
+
return ES(bc(Lt, Et, Oe));
|
|
11238
11238
|
}
|
|
11239
11239
|
const Je = zf(st, ut, Ue);
|
|
11240
11240
|
let nt, it;
|
|
11241
|
-
we ? V === 0 &&
|
|
11242
|
-
const jt = bc(nt, it,
|
|
11241
|
+
we ? V === 0 && Z === 0 && ae > 0 ? (nt = 0, it = ae - 1) : (nt = Je * ns((V + Ze) / (We + Ze)), it = Je * vc((Z + Ze) / (We + Ze)) - 1, it = yi(L - 1, zr(it, Je - 1)), nt = yi(it, zr(0, nt))) : (nt = 0, it = -1);
|
|
11242
|
+
const jt = bc(nt, it, Oe), { bottom: dt, top: It } = Sc(Ne, le, oe, jt), wt = vc(L / Je), Ct = wt * We + (wt - 1) * Ze - dt;
|
|
11243
11243
|
return { bottom: dt, itemHeight: We, items: jt, itemWidth: ut, offsetBottom: Ct, offsetTop: It, top: It };
|
|
11244
11244
|
}
|
|
11245
11245
|
)
|
|
@@ -11255,16 +11255,16 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11255
11255
|
), pe(
|
|
11256
11256
|
W(
|
|
11257
11257
|
Tt(N, D, R, F),
|
|
11258
|
-
ke(([L, V, { items:
|
|
11259
|
-
ce(([L, V, { items:
|
|
11260
|
-
const { bottom: oe, top: Ne } = Sc(L, le, V,
|
|
11258
|
+
ke(([L, V, { items: Z }]) => Z.length > 0 && V.height !== 0 && L.height !== 0),
|
|
11259
|
+
ce(([L, V, { items: Z }, le]) => {
|
|
11260
|
+
const { bottom: oe, top: Ne } = Sc(L, le, V, Z);
|
|
11261
11261
|
return [Ne, oe];
|
|
11262
11262
|
}),
|
|
11263
11263
|
ft(Qr)
|
|
11264
11264
|
),
|
|
11265
11265
|
t
|
|
11266
11266
|
);
|
|
11267
|
-
const ve =
|
|
11267
|
+
const ve = ee(!1);
|
|
11268
11268
|
pe(
|
|
11269
11269
|
W(
|
|
11270
11270
|
c,
|
|
@@ -11278,9 +11278,9 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11278
11278
|
Tt(R, C),
|
|
11279
11279
|
ke(([{ items: L }]) => L.length > 0),
|
|
11280
11280
|
Le(ve),
|
|
11281
|
-
ke(([[L, V],
|
|
11281
|
+
ke(([[L, V], Z]) => {
|
|
11282
11282
|
const le = L.items[L.items.length - 1].index === V - 1;
|
|
11283
|
-
return (
|
|
11283
|
+
return (Z || L.bottom > 0 && L.itemHeight > 0 && L.offsetBottom === 0 && L.items.length === V) && le;
|
|
11284
11284
|
}),
|
|
11285
11285
|
ce(([[, L]]) => L - 1),
|
|
11286
11286
|
ft()
|
|
@@ -11292,7 +11292,7 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11292
11292
|
pn(0),
|
|
11293
11293
|
ft()
|
|
11294
11294
|
)
|
|
11295
|
-
),
|
|
11295
|
+
), J = qt(
|
|
11296
11296
|
W(
|
|
11297
11297
|
Ie(R),
|
|
11298
11298
|
Le(B),
|
|
@@ -11305,16 +11305,16 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11305
11305
|
Tn(0)
|
|
11306
11306
|
)
|
|
11307
11307
|
);
|
|
11308
|
-
pe(
|
|
11308
|
+
pe(J, p.scrollSeekRangeChanged), pe(
|
|
11309
11309
|
W(
|
|
11310
11310
|
j,
|
|
11311
11311
|
Le(N, D, C, F),
|
|
11312
|
-
ce(([L, V,
|
|
11313
|
-
const Ne = Tf(L), { align:
|
|
11314
|
-
let
|
|
11315
|
-
|
|
11316
|
-
let Ue = Vi(V, oe,
|
|
11317
|
-
return
|
|
11312
|
+
ce(([L, V, Z, le, oe]) => {
|
|
11313
|
+
const Ne = Tf(L), { align: Oe, behavior: ae, offset: we } = Ne;
|
|
11314
|
+
let je = Ne.index;
|
|
11315
|
+
je === "LAST" && (je = le - 1), je = zr(0, je, yi(le - 1, je));
|
|
11316
|
+
let Ue = Vi(V, oe, Z, je);
|
|
11317
|
+
return Oe === "end" ? Ue = wc(Ue - V.height + Z.height) : Oe === "center" && (Ue = wc(Ue - V.height / 2 + Z.height / 2)), we && (Ue += we), { behavior: ae, top: Ue };
|
|
11318
11318
|
})
|
|
11319
11319
|
),
|
|
11320
11320
|
l
|
|
@@ -11367,7 +11367,7 @@ const NS = /* @__PURE__ */ Xe(
|
|
|
11367
11367
|
...h,
|
|
11368
11368
|
endReached: Ee,
|
|
11369
11369
|
propsReady: m,
|
|
11370
|
-
rangeChanged:
|
|
11370
|
+
rangeChanged: J,
|
|
11371
11371
|
startReached: z,
|
|
11372
11372
|
stateChanged: A,
|
|
11373
11373
|
stateRestoreInProgress: B,
|
|
@@ -11391,14 +11391,14 @@ function Vi(e, t, n, r) {
|
|
|
11391
11391
|
return i > 0 ? i + t.row : i;
|
|
11392
11392
|
}
|
|
11393
11393
|
const _S = /* @__PURE__ */ Xe(() => {
|
|
11394
|
-
const e =
|
|
11394
|
+
const e = ee((f) => `Item ${f}`), t = ee({}), n = ee(null), r = ee("virtuoso-grid-item"), o = ee("virtuoso-grid-list"), s = ee(Fa), i = ee("div"), a = ee(Nr), l = (f, h = null) => Dt(
|
|
11395
11395
|
W(
|
|
11396
11396
|
t,
|
|
11397
11397
|
ce((p) => p[f]),
|
|
11398
11398
|
ft()
|
|
11399
11399
|
),
|
|
11400
11400
|
h
|
|
11401
|
-
), c =
|
|
11401
|
+
), c = ee(!1), d = ee(!1);
|
|
11402
11402
|
return pe(Ie(d), c), {
|
|
11403
11403
|
components: t,
|
|
11404
11404
|
computeItemKey: s,
|
|
@@ -11420,9 +11420,9 @@ const _S = /* @__PURE__ */ Xe(() => {
|
|
|
11420
11420
|
}), jS = /* @__PURE__ */ Xe(
|
|
11421
11421
|
([e, t]) => ({ ...e, ...t }),
|
|
11422
11422
|
pt(NS, _S)
|
|
11423
|
-
), PS = /* @__PURE__ */
|
|
11423
|
+
), PS = /* @__PURE__ */ Q.memo(function() {
|
|
11424
11424
|
const e = mt("gridState"), t = mt("listClassName"), n = mt("itemClassName"), r = mt("itemContent"), o = mt("computeItemKey"), s = mt("isSeeking"), i = Zt("scrollHeight"), a = mt("ItemComponent"), l = mt("ListComponent"), c = mt("ScrollSeekPlaceholder"), d = mt("context"), f = Zt("itemDimensions"), h = Zt("gap"), p = mt("log"), x = mt("stateRestoreInProgress"), m = Zt("reportReadyState"), y = ar(
|
|
11425
|
-
|
|
11425
|
+
Q.useMemo(
|
|
11426
11426
|
() => (g) => {
|
|
11427
11427
|
const w = g.parentElement.parentElement.scrollHeight;
|
|
11428
11428
|
i(w);
|
|
@@ -11475,9 +11475,9 @@ const _S = /* @__PURE__ */ Xe(() => {
|
|
|
11475
11475
|
})
|
|
11476
11476
|
}
|
|
11477
11477
|
);
|
|
11478
|
-
}), MS =
|
|
11478
|
+
}), MS = Q.memo(function() {
|
|
11479
11479
|
const e = mt("HeaderComponent"), t = Zt("headerHeight"), n = mt("headerFooterTag"), r = ar(
|
|
11480
|
-
|
|
11480
|
+
Q.useMemo(
|
|
11481
11481
|
() => (s) => {
|
|
11482
11482
|
t($n(s, "height"));
|
|
11483
11483
|
},
|
|
@@ -11487,9 +11487,9 @@ const _S = /* @__PURE__ */ Xe(() => {
|
|
|
11487
11487
|
!1
|
|
11488
11488
|
), o = mt("context");
|
|
11489
11489
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
|
|
11490
|
-
}), OS =
|
|
11490
|
+
}), OS = Q.memo(function() {
|
|
11491
11491
|
const e = mt("FooterComponent"), t = Zt("footerHeight"), n = mt("headerFooterTag"), r = ar(
|
|
11492
|
-
|
|
11492
|
+
Q.useMemo(
|
|
11493
11493
|
() => (s) => {
|
|
11494
11494
|
t($n(s, "height"));
|
|
11495
11495
|
},
|
|
@@ -11500,8 +11500,8 @@ const _S = /* @__PURE__ */ Xe(() => {
|
|
|
11500
11500
|
), o = mt("context");
|
|
11501
11501
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
|
|
11502
11502
|
}), DS = ({ children: e }) => {
|
|
11503
|
-
const t =
|
|
11504
|
-
|
|
11503
|
+
const t = Q.useContext(Of), n = Zt("itemDimensions"), r = Zt("viewportDimensions"), o = ar(
|
|
11504
|
+
Q.useMemo(
|
|
11505
11505
|
() => (s) => {
|
|
11506
11506
|
r(s.getBoundingClientRect());
|
|
11507
11507
|
},
|
|
@@ -11510,15 +11510,15 @@ const _S = /* @__PURE__ */ Xe(() => {
|
|
|
11510
11510
|
!0,
|
|
11511
11511
|
!1
|
|
11512
11512
|
);
|
|
11513
|
-
return
|
|
11513
|
+
return Q.useEffect(() => {
|
|
11514
11514
|
t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
|
|
11515
11515
|
}, [t, r, n]), /* @__PURE__ */ u.jsx("div", { ref: o, style: Fs(!1), children: e });
|
|
11516
11516
|
}, LS = ({ children: e }) => {
|
|
11517
|
-
const t =
|
|
11518
|
-
return
|
|
11517
|
+
const t = Q.useContext(Of), n = Zt("windowViewportRect"), r = Zt("itemDimensions"), o = mt("customScrollParent"), s = pf(n, o, !1);
|
|
11518
|
+
return Q.useEffect(() => {
|
|
11519
11519
|
t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
|
|
11520
11520
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { ref: s, style: Fs(!1), children: e });
|
|
11521
|
-
}, $S = /* @__PURE__ */
|
|
11521
|
+
}, $S = /* @__PURE__ */ Q.memo(function({ ...e }) {
|
|
11522
11522
|
const t = mt("useWindowScroll"), n = mt("customScrollParent"), r = n || t ? BS : FS, o = n || t ? LS : DS, s = mt("context");
|
|
11523
11523
|
return /* @__PURE__ */ u.jsx(r, { ...e, ...Ot(r, s), children: /* @__PURE__ */ u.jsxs(o, { children: [
|
|
11524
11524
|
/* @__PURE__ */ u.jsx(MS, {}),
|
|
@@ -12200,7 +12200,7 @@ function Va() {
|
|
|
12200
12200
|
};
|
|
12201
12201
|
}
|
|
12202
12202
|
function xC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
12203
|
-
const [s, i] = xe(!1), [a, l] = xe(null), [c, d] = xe(null), { toast: f } = Va(), h =
|
|
12203
|
+
const [s, i] = xe(!1), [a, l] = xe(null), [c, d] = xe(null), { toast: f } = Va(), h = Q.useCallback(async () => {
|
|
12204
12204
|
if (n) {
|
|
12205
12205
|
i(!0), d(null), l(null);
|
|
12206
12206
|
try {
|
|
@@ -14289,11 +14289,11 @@ const Ga = em(function({
|
|
|
14289
14289
|
}) {
|
|
14290
14290
|
const [j, P] = xe(!1), [$, E] = xe("preview"), [F, A] = xe(!1), { currentThreadId: K } = la(), { respondToInterrupt: B } = ca(), _ = l === "phone" || l === "half-screen", q = t.role, Y = q === "tool", se = Fe(() => "type" in t && t.type === "default_message" ? t : null, [t]), ve = !!se, Ee = !(r && q !== "user"), {
|
|
14291
14291
|
uploadingFiles: z,
|
|
14292
|
-
handleFileClick:
|
|
14292
|
+
handleFileClick: J,
|
|
14293
14293
|
fileViewerOpen: X,
|
|
14294
14294
|
currentFileInfo: L,
|
|
14295
14295
|
closeFileViewer: V
|
|
14296
|
-
} = UC({ allowFileOpen: Ee, currentThreadId: K }),
|
|
14296
|
+
} = UC({ allowFileOpen: Ee, currentThreadId: K }), Z = Fe(() => {
|
|
14297
14297
|
switch (q) {
|
|
14298
14298
|
case "user":
|
|
14299
14299
|
return "text-[hsl(var(--chat-bubble-user-text))]";
|
|
@@ -14324,7 +14324,7 @@ const Ga = em(function({
|
|
|
14324
14324
|
return Array.isArray(O) ? O.filter((G) => G.type === "image_url") : [];
|
|
14325
14325
|
},
|
|
14326
14326
|
[se, t]
|
|
14327
|
-
),
|
|
14327
|
+
), Oe = Fe(
|
|
14328
14328
|
() => {
|
|
14329
14329
|
if (se)
|
|
14330
14330
|
return [];
|
|
@@ -14340,7 +14340,7 @@ const Ga = em(function({
|
|
|
14340
14340
|
return Array.isArray(O) ? O.filter((G) => G.type === "interrupt") : [];
|
|
14341
14341
|
},
|
|
14342
14342
|
[se, t]
|
|
14343
|
-
), we = (w == null ? void 0 : w.id) ?? (w == null ? void 0 : w.interrupt_id),
|
|
14343
|
+
), we = (w == null ? void 0 : w.id) ?? (w == null ? void 0 : w.interrupt_id), je = Eo(we), Ue = w == null ? void 0 : w.value, Ze = Fe(() => {
|
|
14344
14344
|
if (se)
|
|
14345
14345
|
return "";
|
|
14346
14346
|
const O = t.content;
|
|
@@ -14390,7 +14390,7 @@ const Ga = em(function({
|
|
|
14390
14390
|
}, [x, t.id, Y, Ze, le, t]), Je = ye(() => {
|
|
14391
14391
|
m == null || m(n);
|
|
14392
14392
|
}, [m, n]), nt = ye(() => {
|
|
14393
|
-
const G = te(_ ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0",
|
|
14393
|
+
const G = te(_ ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", Z);
|
|
14394
14394
|
switch (q) {
|
|
14395
14395
|
case "user":
|
|
14396
14396
|
return /* @__PURE__ */ u.jsx(cm, { className: G });
|
|
@@ -14401,7 +14401,7 @@ const Ga = em(function({
|
|
|
14401
14401
|
default:
|
|
14402
14402
|
return /* @__PURE__ */ u.jsx(Xs, { className: G });
|
|
14403
14403
|
}
|
|
14404
|
-
}, [_,
|
|
14404
|
+
}, [_, Z, q]), it = ye(() => {
|
|
14405
14405
|
const O = "group relative mb-4 flex w-full";
|
|
14406
14406
|
switch (q) {
|
|
14407
14407
|
case "user":
|
|
@@ -14519,7 +14519,7 @@ const Ga = em(function({
|
|
|
14519
14519
|
"a",
|
|
14520
14520
|
{
|
|
14521
14521
|
href: re.url,
|
|
14522
|
-
onClick: (Ve) =>
|
|
14522
|
+
onClick: (Ve) => J(Ve.nativeEvent, re, G),
|
|
14523
14523
|
className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
14524
14524
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
|
|
14525
14525
|
children: [
|
|
@@ -14536,7 +14536,7 @@ const Ga = em(function({
|
|
|
14536
14536
|
if (O.type === "interrupt") {
|
|
14537
14537
|
const re = O, ge = Eo(
|
|
14538
14538
|
(re == null ? void 0 : re.id) ?? (re == null ? void 0 : re.interrupt_id)
|
|
14539
|
-
), Ve = !!(
|
|
14539
|
+
), Ve = !!(je && ge && ge === je), he = Ve ? Ue ?? (re == null ? void 0 : re.value) : re == null ? void 0 : re.value, at = ge ? { ...re, id: ge, interrupt_id: ge } : re;
|
|
14540
14540
|
return /* @__PURE__ */ u.jsx(
|
|
14541
14541
|
HC,
|
|
14542
14542
|
{
|
|
@@ -14552,7 +14552,7 @@ const Ga = em(function({
|
|
|
14552
14552
|
}
|
|
14553
14553
|
return null;
|
|
14554
14554
|
}, [
|
|
14555
|
-
|
|
14555
|
+
J,
|
|
14556
14556
|
z,
|
|
14557
14557
|
dt,
|
|
14558
14558
|
It,
|
|
@@ -14561,7 +14561,7 @@ const Ga = em(function({
|
|
|
14561
14561
|
d,
|
|
14562
14562
|
F,
|
|
14563
14563
|
_,
|
|
14564
|
-
|
|
14564
|
+
je,
|
|
14565
14565
|
Ue,
|
|
14566
14566
|
w,
|
|
14567
14567
|
b,
|
|
@@ -14570,8 +14570,8 @@ const Ga = em(function({
|
|
|
14570
14570
|
/* @__PURE__ */ u.jsx(Si, { className: "h-4 w-4 text-muted-foreground" }),
|
|
14571
14571
|
/* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
|
|
14572
14572
|
] }), []), Lt = ye(() => {
|
|
14573
|
-
const O = le.trim().length > 0 || Ne.length > 0 ||
|
|
14574
|
-
if (!Y &&
|
|
14573
|
+
const O = le.trim().length > 0 || Ne.length > 0 || Oe.length > 0 || ae.length > 0;
|
|
14574
|
+
if (!Y && Oe.length > 0 && !r)
|
|
14575
14575
|
return Ct();
|
|
14576
14576
|
if (!Y && !O && !r)
|
|
14577
14577
|
return null;
|
|
@@ -14588,13 +14588,13 @@ const Ga = em(function({
|
|
|
14588
14588
|
const G = t, re = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: G.content.map((ge, Ve) => /* @__PURE__ */ u.jsx(wt, { part: ge, i: Ve }, Ve)) });
|
|
14589
14589
|
return r ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
14590
14590
|
re,
|
|
14591
|
-
/* @__PURE__ */ u.jsx(KC, { className:
|
|
14591
|
+
/* @__PURE__ */ u.jsx(KC, { className: Z })
|
|
14592
14592
|
] }) : re;
|
|
14593
14593
|
}
|
|
14594
14594
|
}, [
|
|
14595
14595
|
le,
|
|
14596
14596
|
Ne.length,
|
|
14597
|
-
|
|
14597
|
+
Oe.length,
|
|
14598
14598
|
ae.length,
|
|
14599
14599
|
r,
|
|
14600
14600
|
Y,
|
|
@@ -14602,7 +14602,7 @@ const Ga = em(function({
|
|
|
14602
14602
|
f,
|
|
14603
14603
|
We.length,
|
|
14604
14604
|
Ct,
|
|
14605
|
-
|
|
14605
|
+
Z
|
|
14606
14606
|
]), Et = Fe(() => se ? "Assistant" : KS(t), [se, t]), rt = Fe(() => se ? [] : Array.isArray(C) ? C : [], [C, se]), Rt = Fe(() => {
|
|
14607
14607
|
var O;
|
|
14608
14608
|
return rt.length ? N && rt.some((G) => G.id === N) ? N : ((O = rt[0]) == null ? void 0 : O.id) ?? null : null;
|
|
@@ -14616,7 +14616,7 @@ const Ga = em(function({
|
|
|
14616
14616
|
), H = Fe(() => Ge ? rt.findIndex((O) => O.id === Ge) : -1, [Ge, rt]), ne = Fe(() => H < 0 ? null : rt[H] ?? null, [H, rt]);
|
|
14617
14617
|
return Y && !f && We.length === 0 ? null : ve && se ? /* @__PURE__ */ u.jsx("div", { className: te(it(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(jt(), p.content), children: [
|
|
14618
14618
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
|
|
14619
|
-
/* @__PURE__ */ u.jsx(Xs, { className: te("h-4 w-4",
|
|
14619
|
+
/* @__PURE__ */ u.jsx(Xs, { className: te("h-4 w-4", Z) }),
|
|
14620
14620
|
a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
|
|
14621
14621
|
] }),
|
|
14622
14622
|
/* @__PURE__ */ u.jsx(
|
|
@@ -14634,7 +14634,7 @@ const Ga = em(function({
|
|
|
14634
14634
|
className: te(
|
|
14635
14635
|
"flex items-center justify-between mb-2 pb-2 border-b border-current/10",
|
|
14636
14636
|
_ && "mb-1 pb-1",
|
|
14637
|
-
|
|
14637
|
+
Z,
|
|
14638
14638
|
p.header
|
|
14639
14639
|
),
|
|
14640
14640
|
children: [
|
|
@@ -14647,7 +14647,7 @@ const Ga = em(function({
|
|
|
14647
14647
|
variant: "outline",
|
|
14648
14648
|
className: te(
|
|
14649
14649
|
"text-xs flex items-center gap-1 cursor-pointer select-none",
|
|
14650
|
-
|
|
14650
|
+
Z,
|
|
14651
14651
|
"border border-current/40",
|
|
14652
14652
|
_ && "text-xs h-4"
|
|
14653
14653
|
),
|
|
@@ -14717,7 +14717,7 @@ const Ga = em(function({
|
|
|
14717
14717
|
i && t.createdAt && /* @__PURE__ */ u.jsx(
|
|
14718
14718
|
"time",
|
|
14719
14719
|
{
|
|
14720
|
-
className: te("text-xs opacity-60",
|
|
14720
|
+
className: te("text-xs opacity-60", Z, _ && "text-xs"),
|
|
14721
14721
|
dateTime: new Date(t.createdAt).toISOString(),
|
|
14722
14722
|
title: new Date(t.createdAt).toLocaleString(),
|
|
14723
14723
|
children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(t.createdAt))
|
|
@@ -14738,10 +14738,10 @@ const Ga = em(function({
|
|
|
14738
14738
|
variant: "ghost",
|
|
14739
14739
|
size: "sm",
|
|
14740
14740
|
onClick: () => ut(),
|
|
14741
|
-
className: te("h-6 w-6 p-0 hover:bg-foreground/10",
|
|
14741
|
+
className: te("h-6 w-6 p-0 hover:bg-foreground/10", Z, _ && "h-5 w-5"),
|
|
14742
14742
|
"aria-label": "Copy message",
|
|
14743
14743
|
title: "Copy message",
|
|
14744
|
-
children: /* @__PURE__ */ u.jsx(nl, { className: te(j ? "text-success" :
|
|
14744
|
+
children: /* @__PURE__ */ u.jsx(nl, { className: te(j ? "text-success" : Z, _ ? "h-3 w-3" : "h-4 w-4") })
|
|
14745
14745
|
}
|
|
14746
14746
|
) }),
|
|
14747
14747
|
q === "user" && x && /* @__PURE__ */ u.jsx(
|
|
@@ -14750,9 +14750,9 @@ const Ga = em(function({
|
|
|
14750
14750
|
variant: "ghost",
|
|
14751
14751
|
size: "sm",
|
|
14752
14752
|
onClick: st,
|
|
14753
|
-
className: te("h-6 w-6 p-0 hover:bg-foreground/10",
|
|
14753
|
+
className: te("h-6 w-6 p-0 hover:bg-foreground/10", Z, _ && "h-5 w-5"),
|
|
14754
14754
|
"aria-label": "Edit message",
|
|
14755
|
-
children: /* @__PURE__ */ u.jsx(rl, { className: te(
|
|
14755
|
+
children: /* @__PURE__ */ u.jsx(rl, { className: te(Z, _ ? "h-3 w-3" : "h-4 w-4") })
|
|
14756
14756
|
}
|
|
14757
14757
|
),
|
|
14758
14758
|
q === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
@@ -14761,9 +14761,9 @@ const Ga = em(function({
|
|
|
14761
14761
|
variant: "ghost",
|
|
14762
14762
|
size: "sm",
|
|
14763
14763
|
onClick: Je,
|
|
14764
|
-
className: te("h-6 w-6 p-0 hover:bg-foreground/10",
|
|
14764
|
+
className: te("h-6 w-6 p-0 hover:bg-foreground/10", Z, _ && "h-5 w-5"),
|
|
14765
14765
|
"aria-label": "Regenerate response",
|
|
14766
|
-
children: /* @__PURE__ */ u.jsx(Ci, { className: te(
|
|
14766
|
+
children: /* @__PURE__ */ u.jsx(Ci, { className: te(Z, _ ? "h-3 w-3" : "h-4 w-4") })
|
|
14767
14767
|
}
|
|
14768
14768
|
)
|
|
14769
14769
|
]
|
|
@@ -14925,7 +14925,7 @@ function qC(e, t) {
|
|
|
14925
14925
|
t.userMessageIdToAttempts
|
|
14926
14926
|
]);
|
|
14927
14927
|
}
|
|
14928
|
-
const kp = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Rp =
|
|
14928
|
+
const kp = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Rp = Q.memo(function({
|
|
14929
14929
|
message: t,
|
|
14930
14930
|
index: n,
|
|
14931
14931
|
isStreaming: r,
|
|
@@ -15003,7 +15003,7 @@ const kp = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Rp = Z.memo(
|
|
|
15003
15003
|
);
|
|
15004
15004
|
});
|
|
15005
15005
|
Rp.displayName = "MessageRow";
|
|
15006
|
-
const Ep =
|
|
15006
|
+
const Ep = Q.forwardRef(({
|
|
15007
15007
|
messages: e,
|
|
15008
15008
|
isStreaming: t,
|
|
15009
15009
|
streamingAssistantId: n,
|
|
@@ -15043,9 +15043,9 @@ const Ep = Z.forwardRef(({
|
|
|
15043
15043
|
return null;
|
|
15044
15044
|
const ae = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
|
|
15045
15045
|
let we;
|
|
15046
|
-
const
|
|
15047
|
-
if (
|
|
15048
|
-
const Ue =
|
|
15046
|
+
const je = w.value;
|
|
15047
|
+
if (je && typeof je == "object" && !Array.isArray(je)) {
|
|
15048
|
+
const Ue = je.title;
|
|
15049
15049
|
typeof Ue == "string" && Ue.trim() && (we = Ue.trim());
|
|
15050
15050
|
}
|
|
15051
15051
|
return {
|
|
@@ -15056,7 +15056,7 @@ const Ep = Z.forwardRef(({
|
|
|
15056
15056
|
{
|
|
15057
15057
|
type: "interrupt",
|
|
15058
15058
|
id: ae,
|
|
15059
|
-
value:
|
|
15059
|
+
value: je,
|
|
15060
15060
|
title: we
|
|
15061
15061
|
}
|
|
15062
15062
|
]
|
|
@@ -15069,7 +15069,7 @@ const Ep = Z.forwardRef(({
|
|
|
15069
15069
|
content: [],
|
|
15070
15070
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
15071
15071
|
}
|
|
15072
|
-
] : Ee, [Ee, t, E]),
|
|
15072
|
+
] : Ee, [Ee, t, E]), J = Fe(() => C ? z : z.filter((ae) => (ae == null ? void 0 : ae.role) !== "tool"), [z, C]), X = ye((ae) => {
|
|
15073
15073
|
Y(ae), y && y(!ae), g && g(ae);
|
|
15074
15074
|
}, [y, g]), L = Fe(() => {
|
|
15075
15075
|
if (a)
|
|
@@ -15083,7 +15083,7 @@ const Ep = Z.forwardRef(({
|
|
|
15083
15083
|
}
|
|
15084
15084
|
}
|
|
15085
15085
|
};
|
|
15086
|
-
}, [a]), V = Fe(() => !x || m ? !1 : q ? "auto" : !1, [q, x, m]),
|
|
15086
|
+
}, [a]), V = Fe(() => !x || m ? !1 : q ? "auto" : !1, [q, x, m]), Z = Fe(() => {
|
|
15087
15087
|
if (typeof p != "string") return null;
|
|
15088
15088
|
const ae = p.trim();
|
|
15089
15089
|
return ae ? {
|
|
@@ -15093,10 +15093,10 @@ const Ep = Z.forwardRef(({
|
|
|
15093
15093
|
content: ae,
|
|
15094
15094
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
15095
15095
|
} : null;
|
|
15096
|
-
}, [p]), le = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), oe = () =>
|
|
15096
|
+
}, [p]), le = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), oe = () => Z ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
|
|
15097
15097
|
Ga,
|
|
15098
15098
|
{
|
|
15099
|
-
message:
|
|
15099
|
+
message: Z,
|
|
15100
15100
|
messageIndex: 0,
|
|
15101
15101
|
isStreamingMessage: !1,
|
|
15102
15102
|
showActions: !1,
|
|
@@ -15111,23 +15111,27 @@ const Ep = Z.forwardRef(({
|
|
|
15111
15111
|
},
|
|
15112
15112
|
showArtifactPreviews: I
|
|
15113
15113
|
}
|
|
15114
|
-
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: p ?? "No messages yet. Start a conversation!" }), Ne =
|
|
15114
|
+
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: p ?? "No messages yet. Start a conversation!" }), Ne = J.length, Oe = Ne > 0;
|
|
15115
15115
|
return vt(() => {
|
|
15116
15116
|
var ae, we;
|
|
15117
15117
|
if (Ne === 0) {
|
|
15118
15118
|
_.current = !1;
|
|
15119
15119
|
return;
|
|
15120
15120
|
}
|
|
15121
|
-
|
|
15122
|
-
|
|
15121
|
+
if (!_.current)
|
|
15122
|
+
if (_.current = !0, A.current && J.length > 0) {
|
|
15123
|
+
const je = J.length - 1;
|
|
15124
|
+
(we = (ae = A.current).scrollToIndex) == null || we.call(ae, { index: je, align: "end", behavior: "auto" });
|
|
15125
|
+
} else K.current && (K.current.scrollTop = K.current.scrollHeight);
|
|
15126
|
+
}, [Ne, J.length]), tm(
|
|
15123
15127
|
F,
|
|
15124
15128
|
() => ({
|
|
15125
15129
|
scrollToLatest: () => {
|
|
15126
15130
|
var ae, we;
|
|
15127
|
-
if (A.current &&
|
|
15128
|
-
const
|
|
15131
|
+
if (A.current && J.length > 0) {
|
|
15132
|
+
const je = J.length - 1;
|
|
15129
15133
|
(we = (ae = A.current).scrollToIndex) == null || we.call(ae, {
|
|
15130
|
-
index:
|
|
15134
|
+
index: je,
|
|
15131
15135
|
align: "end",
|
|
15132
15136
|
behavior: "auto"
|
|
15133
15137
|
});
|
|
@@ -15135,15 +15139,15 @@ const Ep = Z.forwardRef(({
|
|
|
15135
15139
|
},
|
|
15136
15140
|
scrollToTop: () => {
|
|
15137
15141
|
var ae, we;
|
|
15138
|
-
A.current &&
|
|
15142
|
+
A.current && J.length > 0 ? (we = (ae = A.current).scrollToIndex) == null || we.call(ae, {
|
|
15139
15143
|
index: 0,
|
|
15140
15144
|
align: "start",
|
|
15141
15145
|
behavior: "auto"
|
|
15142
15146
|
}) : K.current && (K.current.scrollTop = 0);
|
|
15143
15147
|
}
|
|
15144
15148
|
}),
|
|
15145
|
-
[
|
|
15146
|
-
), /* @__PURE__ */ u.jsx("div", { className: le, style: h, children: /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children:
|
|
15149
|
+
[J]
|
|
15150
|
+
), /* @__PURE__ */ u.jsx("div", { className: le, style: h, children: /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Oe ? /* @__PURE__ */ u.jsx(
|
|
15147
15151
|
IS,
|
|
15148
15152
|
{
|
|
15149
15153
|
ref: (ae) => {
|
|
@@ -15152,7 +15156,7 @@ const Ep = Z.forwardRef(({
|
|
|
15152
15156
|
scrollerRef: (ae) => {
|
|
15153
15157
|
K.current = ae instanceof HTMLDivElement ? ae : null;
|
|
15154
15158
|
},
|
|
15155
|
-
data:
|
|
15159
|
+
data: J,
|
|
15156
15160
|
followOutput: V,
|
|
15157
15161
|
overscan: 200,
|
|
15158
15162
|
increaseViewportBy: { top: 100, bottom: 200 },
|
|
@@ -15234,11 +15238,11 @@ function bi({
|
|
|
15234
15238
|
vt(() => {
|
|
15235
15239
|
ve || z(!1);
|
|
15236
15240
|
}, [ve]);
|
|
15237
|
-
const
|
|
15241
|
+
const J = ye(() => {
|
|
15238
15242
|
z(!0);
|
|
15239
15243
|
}, []), X = ye(() => {
|
|
15240
15244
|
z(!1);
|
|
15241
|
-
}, []), L = !!ve || Ee, [V,
|
|
15245
|
+
}, []), L = !!ve || Ee, [V, Z] = xe(null), [le, oe] = xe(""), [Ne, Oe] = xe(null), [ae, we] = xe(null), [je, Ue] = xe([]), [Ze, We] = xe(0), [ut, st] = xe(0), [Je, nt] = xe(!1), [it, jt] = xe(null), [dt, It] = xe(null), [wt, Ct] = xe(!1), [Lt, Et] = xe(null), rt = De(!1), [Rt, Nn] = xe(() => Pc.value), Ge = De(Rt), Qe = De(null), ht = ye((fe) => {
|
|
15242
15246
|
Pc.value = fe, Nn(fe);
|
|
15243
15247
|
}, []), [H, ne] = xe(!1), O = De(null), { checkpointMetaById: G, checkpointIndexByKey: re, attemptMetaById: ge, userMessageIdToAttempts: Ve } = f0(N), he = P ?? [], at = De(null), Se = De(null), Ke = ye(() => {
|
|
15244
15248
|
at.current && (at.current.value = ""), Se.current && (Se.current.value = ""), We((fe) => fe + 1), st((fe) => fe + 1);
|
|
@@ -15294,7 +15298,7 @@ function bi({
|
|
|
15294
15298
|
}
|
|
15295
15299
|
}, ur = async (fe) => {
|
|
15296
15300
|
const Ce = fe.trim();
|
|
15297
|
-
if (!(!Ce &&
|
|
15301
|
+
if (!(!Ce && je.length === 0)) {
|
|
15298
15302
|
if (Ce) {
|
|
15299
15303
|
const Re = jn(Ce);
|
|
15300
15304
|
if (Re) {
|
|
@@ -15307,7 +15311,7 @@ function bi({
|
|
|
15307
15311
|
await K(
|
|
15308
15312
|
{
|
|
15309
15313
|
text: Ce || "",
|
|
15310
|
-
attachments:
|
|
15314
|
+
attachments: je
|
|
15311
15315
|
},
|
|
15312
15316
|
{
|
|
15313
15317
|
checkpointId: Re,
|
|
@@ -15315,22 +15319,22 @@ function bi({
|
|
|
15315
15319
|
edit: !!V,
|
|
15316
15320
|
originalMessageId: V ?? void 0
|
|
15317
15321
|
}
|
|
15318
|
-
), p == null || p(Ce), ht(""), we(null), Ue([]), Ke(),
|
|
15322
|
+
), p == null || p(Ce), ht(""), we(null), Ue([]), Ke(), Z(null), oe(""), Oe(null);
|
|
15319
15323
|
} catch (Re) {
|
|
15320
15324
|
const qe = (Re == null ? void 0 : Re.message) || "Failed to send message";
|
|
15321
15325
|
we(qe), m == null || m(qe);
|
|
15322
15326
|
}
|
|
15323
15327
|
}
|
|
15324
|
-
}, Cn =
|
|
15328
|
+
}, Cn = Q.useCallback(
|
|
15325
15329
|
(fe, Ce, Re) => {
|
|
15326
|
-
c && (Qe.current = Rt,
|
|
15330
|
+
c && (Qe.current = Rt, Z(fe), oe(Ce), ht(Ce), we(null), Oe({
|
|
15327
15331
|
checkpointId: (Re == null ? void 0 : Re.checkpointId) ?? null,
|
|
15328
15332
|
checkpointNs: (Re == null ? void 0 : Re.checkpointNs) ?? null
|
|
15329
15333
|
}));
|
|
15330
15334
|
},
|
|
15331
15335
|
[Rt, c, ht]
|
|
15332
|
-
), k =
|
|
15333
|
-
|
|
15336
|
+
), k = Q.useCallback(() => {
|
|
15337
|
+
Z(null), oe(""), Oe(null), we(null), ht(Qe.current ?? Rt), Qe.current = null;
|
|
15334
15338
|
}, [Rt, ht]), U = ye(
|
|
15335
15339
|
(fe, Ce, Re) => {
|
|
15336
15340
|
Cn(fe, Ce, Re);
|
|
@@ -15457,7 +15461,7 @@ function bi({
|
|
|
15457
15461
|
isNavigatingCheckpoint: H,
|
|
15458
15462
|
activeInterrupt: ve,
|
|
15459
15463
|
disableInterruptActions: Ee,
|
|
15460
|
-
onInterruptActionStart:
|
|
15464
|
+
onInterruptActionStart: J,
|
|
15461
15465
|
onInterruptActionEnd: X,
|
|
15462
15466
|
showToolMessages: d,
|
|
15463
15467
|
showArtifactPreviews: f,
|
|
@@ -15517,7 +15521,7 @@ function bi({
|
|
|
15517
15521
|
},
|
|
15518
15522
|
Ze
|
|
15519
15523
|
),
|
|
15520
|
-
|
|
15524
|
+
je.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: je.map((fe, Ce) => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
|
|
15521
15525
|
/* @__PURE__ */ u.jsx(Si, { size: 14 }),
|
|
15522
15526
|
/* @__PURE__ */ u.jsx("span", { className: "truncate max-w-[150px]", children: fe.name }),
|
|
15523
15527
|
/* @__PURE__ */ u.jsx(
|
|
@@ -15606,7 +15610,7 @@ function bi({
|
|
|
15606
15610
|
onSend: ur,
|
|
15607
15611
|
onCancelEdit: k,
|
|
15608
15612
|
onStop: B,
|
|
15609
|
-
allowEmptySend:
|
|
15613
|
+
allowEmptySend: je.length > 0,
|
|
15610
15614
|
textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${V ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${ae ? "border-red-400" : ""} ${h.textarea || ""}`
|
|
15611
15615
|
}
|
|
15612
15616
|
) })
|
|
@@ -16207,20 +16211,20 @@ function Dc({
|
|
|
16207
16211
|
"[data-radix-scroll-area-viewport]"
|
|
16208
16212
|
);
|
|
16209
16213
|
if (!z) return;
|
|
16210
|
-
let
|
|
16211
|
-
return
|
|
16214
|
+
let J = null, X = null;
|
|
16215
|
+
return J = requestAnimationFrame(() => {
|
|
16212
16216
|
X = requestAnimationFrame(() => {
|
|
16213
16217
|
z.scrollTop = R.current;
|
|
16214
16218
|
});
|
|
16215
16219
|
}), () => {
|
|
16216
|
-
|
|
16220
|
+
J !== null && cancelAnimationFrame(J), X !== null && cancelAnimationFrame(X);
|
|
16217
16221
|
};
|
|
16218
16222
|
}, [T]);
|
|
16219
16223
|
const F = async (z) => {
|
|
16220
16224
|
try {
|
|
16221
16225
|
p(z), await y(z), a == null || a(z), l == null || l(z);
|
|
16222
|
-
} catch (
|
|
16223
|
-
console.error("Failed to select thread:",
|
|
16226
|
+
} catch (J) {
|
|
16227
|
+
console.error("Failed to select thread:", J);
|
|
16224
16228
|
}
|
|
16225
16229
|
}, A = async () => {
|
|
16226
16230
|
try {
|
|
@@ -16232,8 +16236,8 @@ function Dc({
|
|
|
16232
16236
|
} finally {
|
|
16233
16237
|
E(!1);
|
|
16234
16238
|
}
|
|
16235
|
-
}, K = async (z,
|
|
16236
|
-
if (
|
|
16239
|
+
}, K = async (z, J) => {
|
|
16240
|
+
if (J.stopPropagation(), !!confirm("Delete this thread?")) {
|
|
16237
16241
|
if (I.current) {
|
|
16238
16242
|
const X = I.current.querySelector("[data-radix-scroll-area-viewport]");
|
|
16239
16243
|
X && (R.current = X.scrollTop);
|
|
@@ -16244,30 +16248,30 @@ function Dc({
|
|
|
16244
16248
|
console.error("Failed to delete thread:", X);
|
|
16245
16249
|
}
|
|
16246
16250
|
}
|
|
16247
|
-
}, B = (z,
|
|
16248
|
-
|
|
16251
|
+
}, B = (z, J) => {
|
|
16252
|
+
J.stopPropagation(), D(z.threadId), P(z.title || `Thread ${z.threadId.slice(0, 8)}`);
|
|
16249
16253
|
}, _ = async (z) => {
|
|
16250
16254
|
if (j.trim())
|
|
16251
16255
|
try {
|
|
16252
16256
|
await b(z, j.trim()), D(null), P("");
|
|
16253
|
-
} catch (
|
|
16254
|
-
console.error("Failed to update title:",
|
|
16257
|
+
} catch (J) {
|
|
16258
|
+
console.error("Failed to update title:", J);
|
|
16255
16259
|
}
|
|
16256
16260
|
}, q = () => {
|
|
16257
16261
|
D(null), P("");
|
|
16258
|
-
}, Y = (z,
|
|
16259
|
-
z.key === "Enter" ? _(
|
|
16262
|
+
}, Y = (z, J) => {
|
|
16263
|
+
z.key === "Enter" ? _(J) : z.key === "Escape" && q();
|
|
16260
16264
|
}, se = (z) => {
|
|
16261
16265
|
if (!z) return "";
|
|
16262
16266
|
try {
|
|
16263
|
-
const
|
|
16264
|
-
return V === 0 ?
|
|
16267
|
+
const J = new Date(z), L = (/* @__PURE__ */ new Date()).getTime() - J.getTime(), V = Math.floor(L / (1e3 * 60 * 60 * 24));
|
|
16268
|
+
return V === 0 ? J.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : V === 1 ? "Yesterday" : V < 7 ? `${V} days ago` : J.toLocaleDateString();
|
|
16265
16269
|
} catch {
|
|
16266
16270
|
return "";
|
|
16267
16271
|
}
|
|
16268
16272
|
}, ve = (z) => z.title || `Thread ${z.threadId.slice(0, 8)}`, Ee = (z) => {
|
|
16269
|
-
const
|
|
16270
|
-
return
|
|
16273
|
+
const J = ve(z);
|
|
16274
|
+
return J.length <= Oc ? J : `${J.slice(0, Oc)}...`;
|
|
16271
16275
|
};
|
|
16272
16276
|
return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
16273
16277
|
t && /* @__PURE__ */ u.jsx("div", { className: s.header || "flex-shrink-0 p-2 border-b bg-slate-800 border-slate-700 text-slate-100 flex justify-end", children: /* @__PURE__ */ u.jsx(
|
|
@@ -16294,15 +16298,15 @@ function Dc({
|
|
|
16294
16298
|
] }) : T.length === 0 ? /* @__PURE__ */ u.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
|
|
16295
16299
|
/* @__PURE__ */ u.jsx(hm, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
|
|
16296
16300
|
/* @__PURE__ */ u.jsx("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
|
|
16297
|
-
] }) : T.slice().sort((z,
|
|
16301
|
+
] }) : T.slice().sort((z, J) => new Date(J.updatedAt || J.createdAt || "").getTime() - new Date(z.updatedAt || z.createdAt || "").getTime()).map((z) => /* @__PURE__ */ u.jsxs(
|
|
16298
16302
|
"div",
|
|
16299
16303
|
{
|
|
16300
16304
|
onClick: () => F(z.threadId),
|
|
16301
16305
|
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? h) === z.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
|
|
16302
16306
|
children: [
|
|
16303
16307
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
16304
|
-
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: N === z.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (
|
|
16305
|
-
/* @__PURE__ */ u.jsx(ls, { value: j, onChange: (
|
|
16308
|
+
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: N === z.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (J) => J.stopPropagation(), children: [
|
|
16309
|
+
/* @__PURE__ */ u.jsx(ls, { value: j, onChange: (J) => P(J.target.value), onKeyDown: (J) => Y(J, z.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
16306
16310
|
/* @__PURE__ */ u.jsx(et, { variant: "ghost", size: "sm", onClick: () => _(z.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ea, { size: 12 }) }),
|
|
16307
16311
|
/* @__PURE__ */ u.jsx(et, { variant: "ghost", size: "sm", onClick: q, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(mr, { size: 12 }) })
|
|
16308
16312
|
] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
@@ -16313,13 +16317,13 @@ function Dc({
|
|
|
16313
16317
|
] })
|
|
16314
16318
|
] }) }),
|
|
16315
16319
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
16316
|
-
r && N !== z.threadId && /* @__PURE__ */ u.jsx(et, { variant: "ghost", size: "sm", onClick: (
|
|
16320
|
+
r && N !== z.threadId && /* @__PURE__ */ u.jsx(et, { variant: "ghost", size: "sm", onClick: (J) => B(z, J), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(zc, { size: 12 }) }),
|
|
16317
16321
|
n && /* @__PURE__ */ u.jsx(
|
|
16318
16322
|
et,
|
|
16319
16323
|
{
|
|
16320
16324
|
variant: "ghost",
|
|
16321
16325
|
size: "sm",
|
|
16322
|
-
onClick: (
|
|
16326
|
+
onClick: (J) => K(z.threadId, J),
|
|
16323
16327
|
className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
|
|
16324
16328
|
title: "Delete thread",
|
|
16325
16329
|
children: /* @__PURE__ */ u.jsx(gm, { size: 12 })
|
|
@@ -16769,9 +16773,9 @@ var rn = 10, [ih, Vn] = _r(or), TT = "SelectContentImpl", IT = wr("SelectContent
|
|
|
16769
16773
|
}, [b]), fa();
|
|
16770
16774
|
const A = v.useCallback(
|
|
16771
16775
|
(X) => {
|
|
16772
|
-
const [L, ...V] = P().map((oe) => oe.ref.current), [
|
|
16776
|
+
const [L, ...V] = P().map((oe) => oe.ref.current), [Z] = V.slice(-1), le = document.activeElement;
|
|
16773
16777
|
for (const oe of X)
|
|
16774
|
-
if (oe === le || (oe == null || oe.scrollIntoView({ block: "nearest" }), oe === L && S && (S.scrollTop = 0), oe ===
|
|
16778
|
+
if (oe === le || (oe == null || oe.scrollIntoView({ block: "nearest" }), oe === L && S && (S.scrollTop = 0), oe === Z && S && (S.scrollTop = S.scrollHeight), oe == null || oe.focus(), document.activeElement !== le)) return;
|
|
16775
16779
|
},
|
|
16776
16780
|
[P, S]
|
|
16777
16781
|
), K = v.useCallback(
|
|
@@ -16785,14 +16789,14 @@ var rn = 10, [ih, Vn] = _r(or), TT = "SelectContentImpl", IT = wr("SelectContent
|
|
|
16785
16789
|
v.useEffect(() => {
|
|
16786
16790
|
if (b) {
|
|
16787
16791
|
let X = { x: 0, y: 0 };
|
|
16788
|
-
const L = (
|
|
16792
|
+
const L = (Z) => {
|
|
16789
16793
|
var le, oe;
|
|
16790
16794
|
X = {
|
|
16791
|
-
x: Math.abs(Math.round(
|
|
16792
|
-
y: Math.abs(Math.round(
|
|
16795
|
+
x: Math.abs(Math.round(Z.pageX) - (((le = _.current) == null ? void 0 : le.x) ?? 0)),
|
|
16796
|
+
y: Math.abs(Math.round(Z.pageY) - (((oe = _.current) == null ? void 0 : oe.y) ?? 0))
|
|
16793
16797
|
};
|
|
16794
|
-
}, V = (
|
|
16795
|
-
X.x <= 10 && X.y <= 10 ?
|
|
16798
|
+
}, V = (Z) => {
|
|
16799
|
+
X.x <= 10 && X.y <= 10 ? Z.preventDefault() : b.contains(Z.target) || B(!1), document.removeEventListener("pointermove", L), _.current = null;
|
|
16796
16800
|
};
|
|
16797
16801
|
return _.current !== null && (document.addEventListener("pointermove", L), document.addEventListener("pointerup", V, { capture: !0, once: !0 })), () => {
|
|
16798
16802
|
document.removeEventListener("pointermove", L), document.removeEventListener("pointerup", V, { capture: !0 });
|
|
@@ -16805,21 +16809,21 @@ var rn = 10, [ih, Vn] = _r(or), TT = "SelectContentImpl", IT = wr("SelectContent
|
|
|
16805
16809
|
};
|
|
16806
16810
|
}, [B]);
|
|
16807
16811
|
const [q, Y] = Th((X) => {
|
|
16808
|
-
const L = P().filter((le) => !le.disabled), V = L.find((le) => le.ref.current === document.activeElement),
|
|
16809
|
-
|
|
16812
|
+
const L = P().filter((le) => !le.disabled), V = L.find((le) => le.ref.current === document.activeElement), Z = Ih(L, X, V);
|
|
16813
|
+
Z && setTimeout(() => Z.ref.current.focus());
|
|
16810
16814
|
}), se = v.useCallback(
|
|
16811
16815
|
(X, L, V) => {
|
|
16812
|
-
const
|
|
16813
|
-
(w.value !== void 0 && w.value === L ||
|
|
16816
|
+
const Z = !F.current && !V;
|
|
16817
|
+
(w.value !== void 0 && w.value === L || Z) && (N(X), Z && (F.current = !0));
|
|
16814
16818
|
},
|
|
16815
16819
|
[w.value]
|
|
16816
16820
|
), ve = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ee = v.useCallback(
|
|
16817
16821
|
(X, L, V) => {
|
|
16818
|
-
const
|
|
16819
|
-
(w.value !== void 0 && w.value === L ||
|
|
16822
|
+
const Z = !F.current && !V;
|
|
16823
|
+
(w.value !== void 0 && w.value === L || Z) && j(X);
|
|
16820
16824
|
},
|
|
16821
16825
|
[w.value]
|
|
16822
|
-
), z = r === "popper" ? qi : lh,
|
|
16826
|
+
), z = r === "popper" ? qi : lh, J = z === qi ? {
|
|
16823
16827
|
side: a,
|
|
16824
16828
|
sideOffset: l,
|
|
16825
16829
|
align: c,
|
|
@@ -16877,7 +16881,7 @@ var rn = 10, [ih, Vn] = _r(or), TT = "SelectContentImpl", IT = wr("SelectContent
|
|
|
16877
16881
|
dir: w.dir,
|
|
16878
16882
|
onContextMenu: (X) => X.preventDefault(),
|
|
16879
16883
|
...g,
|
|
16880
|
-
...
|
|
16884
|
+
...J,
|
|
16881
16885
|
onPlaced: () => E(!0),
|
|
16882
16886
|
ref: I,
|
|
16883
16887
|
style: {
|
|
@@ -16891,12 +16895,12 @@ var rn = 10, [ih, Vn] = _r(or), TT = "SelectContentImpl", IT = wr("SelectContent
|
|
|
16891
16895
|
onKeyDown: de(g.onKeyDown, (X) => {
|
|
16892
16896
|
const L = X.ctrlKey || X.altKey || X.metaKey;
|
|
16893
16897
|
if (X.key === "Tab" && X.preventDefault(), !L && X.key.length === 1 && Y(X.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(X.key)) {
|
|
16894
|
-
let
|
|
16895
|
-
if (["ArrowUp", "End"].includes(X.key) && (
|
|
16896
|
-
const le = X.target, oe =
|
|
16897
|
-
|
|
16898
|
+
let Z = P().filter((le) => !le.disabled).map((le) => le.ref.current);
|
|
16899
|
+
if (["ArrowUp", "End"].includes(X.key) && (Z = Z.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(X.key)) {
|
|
16900
|
+
const le = X.target, oe = Z.indexOf(le);
|
|
16901
|
+
Z = Z.slice(oe + 1);
|
|
16898
16902
|
}
|
|
16899
|
-
setTimeout(() => A(
|
|
16903
|
+
setTimeout(() => A(Z)), X.preventDefault();
|
|
16900
16904
|
}
|
|
16901
16905
|
})
|
|
16902
16906
|
}
|
|
@@ -16915,7 +16919,7 @@ var kT = "SelectItemAlignedPosition", lh = v.forwardRef((e, t) => {
|
|
|
16915
16919
|
if (s.trigger && s.valueNode && a && c && m && y && g) {
|
|
16916
16920
|
const I = s.trigger.getBoundingClientRect(), R = c.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), D = g.getBoundingClientRect();
|
|
16917
16921
|
if (s.dir !== "rtl") {
|
|
16918
|
-
const le = D.left - R.left, oe = N.left - le, Ne = I.left - oe,
|
|
16922
|
+
const le = D.left - R.left, oe = N.left - le, Ne = I.left - oe, Oe = I.width + Ne, ae = Math.max(Oe, R.width), we = window.innerWidth - rn, je = Ki(oe, [
|
|
16919
16923
|
rn,
|
|
16920
16924
|
// Prevents the content from going off the starting edge of the
|
|
16921
16925
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -16924,31 +16928,31 @@ var kT = "SelectItemAlignedPosition", lh = v.forwardRef((e, t) => {
|
|
|
16924
16928
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
16925
16929
|
Math.max(rn, we - ae)
|
|
16926
16930
|
]);
|
|
16927
|
-
a.style.minWidth =
|
|
16931
|
+
a.style.minWidth = Oe + "px", a.style.left = je + "px";
|
|
16928
16932
|
} else {
|
|
16929
|
-
const le = R.right - D.right, oe = window.innerWidth - N.right - le, Ne = window.innerWidth - I.right - oe,
|
|
16933
|
+
const le = R.right - D.right, oe = window.innerWidth - N.right - le, Ne = window.innerWidth - I.right - oe, Oe = I.width + Ne, ae = Math.max(Oe, R.width), we = window.innerWidth - rn, je = Ki(oe, [
|
|
16930
16934
|
rn,
|
|
16931
16935
|
Math.max(rn, we - ae)
|
|
16932
16936
|
]);
|
|
16933
|
-
a.style.minWidth =
|
|
16937
|
+
a.style.minWidth = Oe + "px", a.style.right = je + "px";
|
|
16934
16938
|
}
|
|
16935
|
-
const j = h(), P = window.innerHeight - rn * 2, $ = m.scrollHeight, E = window.getComputedStyle(c), F = parseInt(E.borderTopWidth, 10), A = parseInt(E.paddingTop, 10), K = parseInt(E.borderBottomWidth, 10), B = parseInt(E.paddingBottom, 10), _ = F + A + $ + B + K, q = Math.min(y.offsetHeight * 5, _), Y = window.getComputedStyle(m), se = parseInt(Y.paddingTop, 10), ve = parseInt(Y.paddingBottom, 10), Ee = I.top + I.height / 2 - rn, z = P - Ee,
|
|
16939
|
+
const j = h(), P = window.innerHeight - rn * 2, $ = m.scrollHeight, E = window.getComputedStyle(c), F = parseInt(E.borderTopWidth, 10), A = parseInt(E.paddingTop, 10), K = parseInt(E.borderBottomWidth, 10), B = parseInt(E.paddingBottom, 10), _ = F + A + $ + B + K, q = Math.min(y.offsetHeight * 5, _), Y = window.getComputedStyle(m), se = parseInt(Y.paddingTop, 10), ve = parseInt(Y.paddingBottom, 10), Ee = I.top + I.height / 2 - rn, z = P - Ee, J = y.offsetHeight / 2, X = y.offsetTop + J, L = F + A + X, V = _ - L;
|
|
16936
16940
|
if (L <= Ee) {
|
|
16937
16941
|
const le = j.length > 0 && y === j[j.length - 1].ref.current;
|
|
16938
16942
|
a.style.bottom = "0px";
|
|
16939
16943
|
const oe = c.clientHeight - m.offsetTop - m.offsetHeight, Ne = Math.max(
|
|
16940
16944
|
z,
|
|
16941
|
-
|
|
16945
|
+
J + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
16942
16946
|
(le ? ve : 0) + oe + K
|
|
16943
|
-
),
|
|
16944
|
-
a.style.height =
|
|
16947
|
+
), Oe = L + Ne;
|
|
16948
|
+
a.style.height = Oe + "px";
|
|
16945
16949
|
} else {
|
|
16946
16950
|
const le = j.length > 0 && y === j[0].ref.current;
|
|
16947
16951
|
a.style.top = "0px";
|
|
16948
16952
|
const Ne = Math.max(
|
|
16949
16953
|
Ee,
|
|
16950
16954
|
F + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
16951
|
-
(le ? se : 0) +
|
|
16955
|
+
(le ? se : 0) + J
|
|
16952
16956
|
) + V;
|
|
16953
16957
|
a.style.height = Ne + "px", m.scrollTop = L - Ee + m.offsetTop;
|
|
16954
16958
|
}
|
|
@@ -18050,7 +18054,7 @@ function UI({
|
|
|
18050
18054
|
"--chat-sidebar-width": c === "phone" ? "100%" : c === "tablet" ? "280px" : c === "half-screen" ? "240px" : "320px",
|
|
18051
18055
|
"--chat-message-max-width": c === "phone" ? "95%" : c === "tablet" ? "90%" : c === "half-screen" ? "85%" : "80%",
|
|
18052
18056
|
"--chat-input-height": c === "phone" ? "120px" : "100px"
|
|
18053
|
-
}), l =
|
|
18057
|
+
}), l = Q.useCallback((c) => {
|
|
18054
18058
|
var d;
|
|
18055
18059
|
(d = s.onThreadChange) == null || d.call(s, c);
|
|
18056
18060
|
}, [s]);
|