teodor-new-chat-ui 4.0.21 → 4.0.23
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 +625 -631
- package/dist/index.umd.js +14 -14
- package/dist/lib/chat-api.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,14 +2,14 @@ var Ap = Object.defineProperty;
|
|
|
2
2
|
var _p = (e, t, n) => t in e ? Ap(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Ba = (e, t, n) => _p(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as p from "react";
|
|
5
|
-
import z, { createContext as ir, useContext as ar, useReducer as
|
|
6
|
-
import { Square as Pp, Send as Op, X as Jn, ExternalLink as Mp, Download as Dp, Image as Lp, FileText as Ha, Loader as
|
|
5
|
+
import z, { createContext as ir, useContext as ar, useReducer as Cc, useState as fe, useRef as Qe, useEffect as ot, useCallback as _e, useMemo as vt, createElement as go, useLayoutEffect as jp } from "react";
|
|
6
|
+
import { Square as Pp, Send as Op, X as Jn, ExternalLink as Mp, Download as Dp, Image as Lp, FileText as Ha, Loader as Tc, Bot as Ua, Wrench as $p, User as Fp, ChevronUp as Cr, ChevronDown as Xn, Paperclip as ui, Copy as Wa, Edit as Va, RotateCcw as di, ChevronRight as zp, Check as Wi, Circle as Bp, Loader2 as fi, Edit3 as Rc, Plus as Hp, FileSpreadsheet as Up, MessageSquarePlus as Wp, MessageSquare as Vp, Calendar as Kp, Trash2 as qp, Settings as Gp, Server as Yp, EyeOff as Xp, Eye as Jp, Layout as Zp, MessageCircle as Qp, Save as em } from "lucide-react";
|
|
7
7
|
import { Slot as tm, createSlot as nr } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as Xo } from "class-variance-authority";
|
|
9
9
|
import { clsx as nm } from "clsx";
|
|
10
10
|
import { twMerge as rm } from "tailwind-merge";
|
|
11
11
|
import * as Jo from "react-dom";
|
|
12
|
-
import
|
|
12
|
+
import Ec from "react-dom";
|
|
13
13
|
var hi = { exports: {} }, br = {};
|
|
14
14
|
/**
|
|
15
15
|
* @license React
|
|
@@ -74,14 +74,14 @@ function sm() {
|
|
|
74
74
|
}
|
|
75
75
|
var R = !1, S = !1, C = !1, E = !1, k = !1, N;
|
|
76
76
|
N = Symbol.for("react.module.reference");
|
|
77
|
-
function
|
|
77
|
+
function _(T) {
|
|
78
78
|
return !!(typeof T == "string" || typeof T == "function" || T === r || T === s || k || T === o || T === u || T === d || E || T === m || R || S || C || typeof T == "object" && T !== null && (T.$$typeof === h || T.$$typeof === f || T.$$typeof === i || T.$$typeof === a || T.$$typeof === c || // This needs to include all possible module reference object
|
|
79
79
|
// types supported by any Flight configuration anywhere since
|
|
80
80
|
// we don't know which Flight build this will end up being used
|
|
81
81
|
// with.
|
|
82
82
|
T.$$typeof === N || T.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function A(T, U, ne) {
|
|
85
85
|
var ye = T.displayName;
|
|
86
86
|
if (ye)
|
|
87
87
|
return ye;
|
|
@@ -121,7 +121,7 @@ function sm() {
|
|
|
121
121
|
var ne = T;
|
|
122
122
|
return L(ne._context) + ".Provider";
|
|
123
123
|
case c:
|
|
124
|
-
return
|
|
124
|
+
return A(T, T.render, "ForwardRef");
|
|
125
125
|
case f:
|
|
126
126
|
var ye = T.displayName || null;
|
|
127
127
|
return ye !== null ? ye : F(T.type) || "Memo";
|
|
@@ -137,9 +137,9 @@ function sm() {
|
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
139
|
var j = Object.assign, V = 0, B, K, D, I, M, H, Y;
|
|
140
|
-
function
|
|
140
|
+
function Z() {
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
Z.__reactDisabledLog = !0;
|
|
143
143
|
function ie() {
|
|
144
144
|
{
|
|
145
145
|
if (V === 0) {
|
|
@@ -147,7 +147,7 @@ function sm() {
|
|
|
147
147
|
var T = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
150
|
-
value:
|
|
150
|
+
value: Z,
|
|
151
151
|
writable: !0
|
|
152
152
|
};
|
|
153
153
|
Object.defineProperties(console, {
|
|
@@ -324,13 +324,13 @@ function sm() {
|
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var je = Object.prototype.hasOwnProperty, Ue = {},
|
|
327
|
+
var je = Object.prototype.hasOwnProperty, Ue = {}, Q = x.ReactDebugCurrentFrame;
|
|
328
328
|
function X(T) {
|
|
329
329
|
if (T) {
|
|
330
330
|
var U = T._owner, ne = Ie(T.type, T._source, U ? U.type : null);
|
|
331
|
-
|
|
331
|
+
Q.setExtraStackFrame(ne);
|
|
332
332
|
} else
|
|
333
|
-
|
|
333
|
+
Q.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
335
|
function Ee(T, U, ne, ye, We) {
|
|
336
336
|
{
|
|
@@ -582,7 +582,7 @@ Check the top-level render call using <` + ne + ">.");
|
|
|
582
582
|
var Et = {};
|
|
583
583
|
function Gt(T, U, ne, ye, We, Xe) {
|
|
584
584
|
{
|
|
585
|
-
var Fe =
|
|
585
|
+
var Fe = _(T);
|
|
586
586
|
if (!Fe) {
|
|
587
587
|
var Pe = "";
|
|
588
588
|
(T === void 0 || typeof T == "object" && T !== null && Object.keys(T).length === 0) && (Pe += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
@@ -636,28 +636,28 @@ React keys must be passed directly to JSX without using spread:
|
|
|
636
636
|
}
|
|
637
637
|
process.env.NODE_ENV === "production" ? hi.exports = om() : hi.exports = sm();
|
|
638
638
|
var l = hi.exports;
|
|
639
|
-
function
|
|
639
|
+
function kc(e, t) {
|
|
640
640
|
return function() {
|
|
641
641
|
return e.apply(t, arguments);
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
const { toString: im } = Object.prototype, { getPrototypeOf: Vi } = Object, { iterator: Zo, toStringTag:
|
|
644
|
+
const { toString: im } = Object.prototype, { getPrototypeOf: Vi } = Object, { iterator: Zo, toStringTag: Ic } = Symbol, Qo = /* @__PURE__ */ ((e) => (t) => {
|
|
645
645
|
const n = im.call(t);
|
|
646
646
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
647
647
|
})(/* @__PURE__ */ Object.create(null)), Kt = (e) => (e = e.toLowerCase(), (t) => Qo(t) === e), es = (e) => (t) => typeof t === e, { isArray: lr } = Array, rr = es("undefined");
|
|
648
648
|
function Hr(e) {
|
|
649
649
|
return e !== null && !rr(e) && e.constructor !== null && !rr(e.constructor) && Ct(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
650
650
|
}
|
|
651
|
-
const
|
|
651
|
+
const Nc = Kt("ArrayBuffer");
|
|
652
652
|
function am(e) {
|
|
653
653
|
let t;
|
|
654
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
654
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Nc(e.buffer), t;
|
|
655
655
|
}
|
|
656
|
-
const lm = es("string"), Ct = es("function"),
|
|
656
|
+
const lm = es("string"), Ct = es("function"), Ac = es("number"), Ur = (e) => e !== null && typeof e == "object", cm = (e) => e === !0 || e === !1, xo = (e) => {
|
|
657
657
|
if (Qo(e) !== "object")
|
|
658
658
|
return !1;
|
|
659
659
|
const t = Vi(e);
|
|
660
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(
|
|
660
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Ic in e) && !(Zo in e);
|
|
661
661
|
}, um = (e) => {
|
|
662
662
|
if (!Ur(e) || Hr(e))
|
|
663
663
|
return !1;
|
|
@@ -687,7 +687,7 @@ function Wr(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
687
687
|
a = s[r], t.call(null, e[a], a, e);
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function _c(e, t) {
|
|
691
691
|
if (Hr(e))
|
|
692
692
|
return null;
|
|
693
693
|
t = t.toLowerCase();
|
|
@@ -698,10 +698,10 @@ function jc(e, t) {
|
|
|
698
698
|
return o;
|
|
699
699
|
return null;
|
|
700
700
|
}
|
|
701
|
-
const Nn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global,
|
|
701
|
+
const Nn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, jc = (e) => !rr(e) && e !== Nn;
|
|
702
702
|
function pi() {
|
|
703
|
-
const { caseless: e, skipUndefined: t } =
|
|
704
|
-
const i = e &&
|
|
703
|
+
const { caseless: e, skipUndefined: t } = jc(this) && this || {}, n = {}, r = (o, s) => {
|
|
704
|
+
const i = e && _c(n, s) || s;
|
|
705
705
|
xo(n[i]) && xo(o) ? n[i] = pi(n[i], o) : xo(o) ? n[i] = pi({}, o) : lr(o) ? n[i] = o.slice() : (!t || !rr(o)) && (n[i] = o);
|
|
706
706
|
};
|
|
707
707
|
for (let o = 0, s = arguments.length; o < s; o++)
|
|
@@ -709,7 +709,7 @@ function pi() {
|
|
|
709
709
|
return n;
|
|
710
710
|
}
|
|
711
711
|
const Cm = (e, t, n, { allOwnKeys: r } = {}) => (Wr(t, (o, s) => {
|
|
712
|
-
n && Ct(o) ? e[s] =
|
|
712
|
+
n && Ct(o) ? e[s] = kc(o, n) : e[s] = o;
|
|
713
713
|
}, { allOwnKeys: r }), e), Tm = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Rm = (e, t, n, r) => {
|
|
714
714
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
715
715
|
value: t.prototype
|
|
@@ -732,7 +732,7 @@ const Cm = (e, t, n, { allOwnKeys: r } = {}) => (Wr(t, (o, s) => {
|
|
|
732
732
|
if (!e) return null;
|
|
733
733
|
if (lr(e)) return e;
|
|
734
734
|
let t = e.length;
|
|
735
|
-
if (!
|
|
735
|
+
if (!Ac(t)) return null;
|
|
736
736
|
const n = new Array(t);
|
|
737
737
|
for (; t-- > 0; )
|
|
738
738
|
n[t] = e[t];
|
|
@@ -755,14 +755,14 @@ const Cm = (e, t, n, { allOwnKeys: r } = {}) => (Wr(t, (o, s) => {
|
|
|
755
755
|
function(n, r, o) {
|
|
756
756
|
return r.toUpperCase() + o;
|
|
757
757
|
}
|
|
758
|
-
), Ga = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Om = Kt("RegExp"),
|
|
758
|
+
), Ga = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Om = Kt("RegExp"), Pc = (e, t) => {
|
|
759
759
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
760
760
|
Wr(n, (o, s) => {
|
|
761
761
|
let i;
|
|
762
762
|
(i = t(o, s, e)) !== !1 && (r[s] = i || o);
|
|
763
763
|
}), Object.defineProperties(e, r);
|
|
764
764
|
}, Mm = (e) => {
|
|
765
|
-
|
|
765
|
+
Pc(e, (t, n) => {
|
|
766
766
|
if (Ct(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
767
767
|
return !1;
|
|
768
768
|
const r = e[n];
|
|
@@ -786,7 +786,7 @@ const Cm = (e, t, n, { allOwnKeys: r } = {}) => (Wr(t, (o, s) => {
|
|
|
786
786
|
}, Lm = () => {
|
|
787
787
|
}, $m = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
788
788
|
function Fm(e) {
|
|
789
|
-
return !!(e && Ct(e.append) && e[
|
|
789
|
+
return !!(e && Ct(e.append) && e[Ic] === "FormData" && e[Zo]);
|
|
790
790
|
}
|
|
791
791
|
const zm = (e) => {
|
|
792
792
|
const t = new Array(10), n = (r, o) => {
|
|
@@ -807,21 +807,21 @@ const zm = (e) => {
|
|
|
807
807
|
return r;
|
|
808
808
|
};
|
|
809
809
|
return n(e, 0);
|
|
810
|
-
}, Bm = Kt("AsyncFunction"), Hm = (e) => e && (Ur(e) || Ct(e)) && Ct(e.then) && Ct(e.catch),
|
|
810
|
+
}, Bm = Kt("AsyncFunction"), Hm = (e) => e && (Ur(e) || Ct(e)) && Ct(e.then) && Ct(e.catch), Oc = ((e, t) => e ? setImmediate : t ? ((n, r) => (Nn.addEventListener("message", ({ source: o, data: s }) => {
|
|
811
811
|
o === Nn && s === n && r.length && r.shift()();
|
|
812
812
|
}, !1), (o) => {
|
|
813
813
|
r.push(o), Nn.postMessage(n, "*");
|
|
814
814
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
815
815
|
typeof setImmediate == "function",
|
|
816
816
|
Ct(Nn.postMessage)
|
|
817
|
-
), Um = typeof queueMicrotask < "u" ? queueMicrotask.bind(Nn) : typeof process < "u" && process.nextTick ||
|
|
817
|
+
), Um = typeof queueMicrotask < "u" ? queueMicrotask.bind(Nn) : typeof process < "u" && process.nextTick || Oc, Wm = (e) => e != null && Ct(e[Zo]), P = {
|
|
818
818
|
isArray: lr,
|
|
819
|
-
isArrayBuffer:
|
|
819
|
+
isArrayBuffer: Nc,
|
|
820
820
|
isBuffer: Hr,
|
|
821
821
|
isFormData: gm,
|
|
822
822
|
isArrayBufferView: am,
|
|
823
823
|
isString: lm,
|
|
824
|
-
isNumber:
|
|
824
|
+
isNumber: Ac,
|
|
825
825
|
isBoolean: cm,
|
|
826
826
|
isObject: Ur,
|
|
827
827
|
isPlainObject: xo,
|
|
@@ -857,20 +857,20 @@ const zm = (e) => {
|
|
|
857
857
|
hasOwnProperty: Ga,
|
|
858
858
|
hasOwnProp: Ga,
|
|
859
859
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
860
|
-
reduceDescriptors:
|
|
860
|
+
reduceDescriptors: Pc,
|
|
861
861
|
freezeMethods: Mm,
|
|
862
862
|
toObjectSet: Dm,
|
|
863
863
|
toCamelCase: Pm,
|
|
864
864
|
noop: Lm,
|
|
865
865
|
toFiniteNumber: $m,
|
|
866
|
-
findKey:
|
|
866
|
+
findKey: _c,
|
|
867
867
|
global: Nn,
|
|
868
|
-
isContextDefined:
|
|
868
|
+
isContextDefined: jc,
|
|
869
869
|
isSpecCompliantForm: Fm,
|
|
870
870
|
toJSONObject: zm,
|
|
871
871
|
isAsyncFn: Bm,
|
|
872
872
|
isThenable: Hm,
|
|
873
|
-
setImmediate:
|
|
873
|
+
setImmediate: Oc,
|
|
874
874
|
asap: Um,
|
|
875
875
|
isIterable: Wm
|
|
876
876
|
};
|
|
@@ -898,7 +898,7 @@ P.inherits(ke, Error, {
|
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
900
|
});
|
|
901
|
-
const
|
|
901
|
+
const Mc = ke.prototype, Dc = {};
|
|
902
902
|
[
|
|
903
903
|
"ERR_BAD_OPTION_VALUE",
|
|
904
904
|
"ERR_BAD_OPTION",
|
|
@@ -914,12 +914,12 @@ const Dc = ke.prototype, Lc = {};
|
|
|
914
914
|
"ERR_INVALID_URL"
|
|
915
915
|
// eslint-disable-next-line func-names
|
|
916
916
|
].forEach((e) => {
|
|
917
|
-
|
|
917
|
+
Dc[e] = { value: e };
|
|
918
918
|
});
|
|
919
|
-
Object.defineProperties(ke,
|
|
920
|
-
Object.defineProperty(
|
|
919
|
+
Object.defineProperties(ke, Dc);
|
|
920
|
+
Object.defineProperty(Mc, "isAxiosError", { value: !0 });
|
|
921
921
|
ke.from = (e, t, n, r, o, s) => {
|
|
922
|
-
const i = Object.create(
|
|
922
|
+
const i = Object.create(Mc);
|
|
923
923
|
P.toFlatObject(e, i, function(d) {
|
|
924
924
|
return d !== Error.prototype;
|
|
925
925
|
}, (u) => u !== "isAxiosError");
|
|
@@ -930,12 +930,12 @@ const Vm = null;
|
|
|
930
930
|
function mi(e) {
|
|
931
931
|
return P.isPlainObject(e) || P.isArray(e);
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function Lc(e) {
|
|
934
934
|
return P.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
935
935
|
}
|
|
936
936
|
function Ya(e, t, n) {
|
|
937
937
|
return e ? e.concat(t).map(function(o, s) {
|
|
938
|
-
return o =
|
|
938
|
+
return o = Lc(o), !n && s ? "[" + o + "]" : o;
|
|
939
939
|
}).join(n ? "." : "") : t;
|
|
940
940
|
}
|
|
941
941
|
function Km(e) {
|
|
@@ -973,7 +973,7 @@ function ts(e, t, n) {
|
|
|
973
973
|
if (P.endsWith(v, "{}"))
|
|
974
974
|
v = r ? v : v.slice(0, -2), w = JSON.stringify(w);
|
|
975
975
|
else if (P.isArray(w) && Km(w) || (P.isFileList(w) || P.endsWith(v, "[]")) && (x = P.toArray(w)))
|
|
976
|
-
return v =
|
|
976
|
+
return v = Lc(v), x.forEach(function(y, R) {
|
|
977
977
|
!(P.isUndefined(y) || y === null) && t.append(
|
|
978
978
|
// eslint-disable-next-line no-nested-ternary
|
|
979
979
|
i === !0 ? Ya([v], R, s) : i === null ? v : v + "[]",
|
|
@@ -1024,11 +1024,11 @@ function Xa(e) {
|
|
|
1024
1024
|
function Ki(e, t) {
|
|
1025
1025
|
this._pairs = [], e && ts(e, this, t);
|
|
1026
1026
|
}
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1027
|
+
const $c = Ki.prototype;
|
|
1028
|
+
$c.append = function(t, n) {
|
|
1029
1029
|
this._pairs.push([t, n]);
|
|
1030
1030
|
};
|
|
1031
|
-
|
|
1031
|
+
$c.toString = function(t) {
|
|
1032
1032
|
const n = t ? function(r) {
|
|
1033
1033
|
return t.call(this, r, Xa);
|
|
1034
1034
|
} : Xa;
|
|
@@ -1039,7 +1039,7 @@ Fc.toString = function(t) {
|
|
|
1039
1039
|
function Gm(e) {
|
|
1040
1040
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function Fc(e, t, n) {
|
|
1043
1043
|
if (!t)
|
|
1044
1044
|
return e;
|
|
1045
1045
|
const r = n && n.encode || Gm;
|
|
@@ -1108,7 +1108,7 @@ class Ja {
|
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
const
|
|
1111
|
+
const zc = {
|
|
1112
1112
|
silentJSONParsing: !0,
|
|
1113
1113
|
forcedJSONParsing: !0,
|
|
1114
1114
|
clarifyTimeoutError: !1
|
|
@@ -1152,7 +1152,7 @@ function sg(e) {
|
|
|
1152
1152
|
s = n[r], t[s] = e[s];
|
|
1153
1153
|
return t;
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function Bc(e) {
|
|
1156
1156
|
function t(n, r, o, s) {
|
|
1157
1157
|
let i = n[s++];
|
|
1158
1158
|
if (i === "__proto__") return !0;
|
|
@@ -1178,12 +1178,12 @@ function ig(e, t, n) {
|
|
|
1178
1178
|
return (n || JSON.stringify)(e);
|
|
1179
1179
|
}
|
|
1180
1180
|
const Vr = {
|
|
1181
|
-
transitional:
|
|
1181
|
+
transitional: zc,
|
|
1182
1182
|
adapter: ["xhr", "http", "fetch"],
|
|
1183
1183
|
transformRequest: [function(t, n) {
|
|
1184
1184
|
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = P.isObject(t);
|
|
1185
1185
|
if (s && P.isHTMLForm(t) && (t = new FormData(t)), P.isFormData(t))
|
|
1186
|
-
return o ? JSON.stringify(
|
|
1186
|
+
return o ? JSON.stringify(Bc(t)) : t;
|
|
1187
1187
|
if (P.isArrayBuffer(t) || P.isBuffer(t) || P.isStream(t) || P.isFile(t) || P.isBlob(t) || P.isReadableStream(t))
|
|
1188
1188
|
return t;
|
|
1189
1189
|
if (P.isArrayBufferView(t))
|
|
@@ -1454,7 +1454,7 @@ function zs(e, t) {
|
|
|
1454
1454
|
s = a.call(n, s, o.normalize(), t ? t.status : void 0);
|
|
1455
1455
|
}), o.normalize(), s;
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1457
|
+
function Hc(e) {
|
|
1458
1458
|
return !!(e && e.__CANCEL__);
|
|
1459
1459
|
}
|
|
1460
1460
|
function cr(e, t, n) {
|
|
@@ -1463,7 +1463,7 @@ function cr(e, t, n) {
|
|
|
1463
1463
|
P.inherits(cr, ke, {
|
|
1464
1464
|
__CANCEL__: !0
|
|
1465
1465
|
});
|
|
1466
|
-
function
|
|
1466
|
+
function Uc(e, t, n) {
|
|
1467
1467
|
const r = n.config.validateStatus;
|
|
1468
1468
|
!n.status || !r || r(n.status) ? e(n) : t(new ke(
|
|
1469
1469
|
"Request failed with status code " + n.status,
|
|
@@ -1567,7 +1567,7 @@ function vg(e) {
|
|
|
1567
1567
|
function wg(e, t) {
|
|
1568
1568
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1569
1569
|
}
|
|
1570
|
-
function
|
|
1570
|
+
function Wc(e, t, n) {
|
|
1571
1571
|
let r = !vg(t);
|
|
1572
1572
|
return e && (r || n == !1) ? wg(e, t) : t;
|
|
1573
1573
|
}
|
|
@@ -1636,10 +1636,10 @@ function Pn(e, t) {
|
|
|
1636
1636
|
P.isUndefined(h) && f !== a || (n[d] = h);
|
|
1637
1637
|
}), n;
|
|
1638
1638
|
}
|
|
1639
|
-
const
|
|
1639
|
+
const Vc = (e) => {
|
|
1640
1640
|
const t = Pn({}, e);
|
|
1641
1641
|
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
|
|
1642
|
-
if (t.headers = i = Tt.from(i), t.url =
|
|
1642
|
+
if (t.headers = i = Tt.from(i), t.url = Fc(Wc(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
|
|
1643
1643
|
"Authorization",
|
|
1644
1644
|
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
|
|
1645
1645
|
), P.isFormData(n)) {
|
|
@@ -1659,7 +1659,7 @@ const Kc = (e) => {
|
|
|
1659
1659
|
return t;
|
|
1660
1660
|
}, bg = typeof XMLHttpRequest < "u", yg = bg && function(e) {
|
|
1661
1661
|
return new Promise(function(n, r) {
|
|
1662
|
-
const o =
|
|
1662
|
+
const o = Vc(e);
|
|
1663
1663
|
let s = o.data;
|
|
1664
1664
|
const i = Tt.from(o.headers).normalize();
|
|
1665
1665
|
let { responseType: a, onUploadProgress: c, onDownloadProgress: u } = o, d, f, h, m, w;
|
|
@@ -1681,7 +1681,7 @@ const Kc = (e) => {
|
|
|
1681
1681
|
config: e,
|
|
1682
1682
|
request: g
|
|
1683
1683
|
};
|
|
1684
|
-
|
|
1684
|
+
Uc(function(E) {
|
|
1685
1685
|
n(E), v();
|
|
1686
1686
|
}, function(E) {
|
|
1687
1687
|
r(E), v();
|
|
@@ -1696,7 +1696,7 @@ const Kc = (e) => {
|
|
|
1696
1696
|
C.event = R || null, r(C), g = null;
|
|
1697
1697
|
}, g.ontimeout = function() {
|
|
1698
1698
|
let R = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1699
|
-
const S = o.transitional ||
|
|
1699
|
+
const S = o.transitional || zc;
|
|
1700
1700
|
o.timeoutErrorMessage && (R = o.timeoutErrorMessage), r(new ke(
|
|
1701
1701
|
R,
|
|
1702
1702
|
S.clarifyTimeoutError ? ke.ETIMEDOUT : ke.ECONNABORTED,
|
|
@@ -1866,8 +1866,8 @@ const Kc = (e) => {
|
|
|
1866
1866
|
responseType: E,
|
|
1867
1867
|
headers: k,
|
|
1868
1868
|
withCredentials: N = "same-origin",
|
|
1869
|
-
fetchOptions:
|
|
1870
|
-
} =
|
|
1869
|
+
fetchOptions: _
|
|
1870
|
+
} = Vc(w), A = t || fetch;
|
|
1871
1871
|
E = E ? (E + "").toLowerCase() : "text";
|
|
1872
1872
|
let L = Sg([b, y && y.toAbortSignal()], R), F = null;
|
|
1873
1873
|
const j = L && L.unsubscribe && (() => {
|
|
@@ -1882,16 +1882,16 @@ const Kc = (e) => {
|
|
|
1882
1882
|
duplex: "half"
|
|
1883
1883
|
}), Y;
|
|
1884
1884
|
if (P.isFormData(x) && (Y = H.headers.get("content-type")) && k.setContentType(Y), H.body) {
|
|
1885
|
-
const [
|
|
1885
|
+
const [Z, ie] = Qa(
|
|
1886
1886
|
V,
|
|
1887
1887
|
_o(el(C))
|
|
1888
1888
|
);
|
|
1889
|
-
x = nl(H.body, rl,
|
|
1889
|
+
x = nl(H.body, rl, Z, ie);
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
1892
|
P.isString(N) || (N = N ? "include" : "omit");
|
|
1893
1893
|
const B = s && "credentials" in n.prototype, K = {
|
|
1894
|
-
...
|
|
1894
|
+
..._,
|
|
1895
1895
|
signal: L,
|
|
1896
1896
|
method: g.toUpperCase(),
|
|
1897
1897
|
headers: k.normalize().toJSON(),
|
|
@@ -1900,19 +1900,19 @@ const Kc = (e) => {
|
|
|
1900
1900
|
credentials: B ? N : void 0
|
|
1901
1901
|
};
|
|
1902
1902
|
F = s && new n(v, K);
|
|
1903
|
-
let D = await (s ?
|
|
1903
|
+
let D = await (s ? A(F, _) : A(v, K));
|
|
1904
1904
|
const I = d && (E === "stream" || E === "response");
|
|
1905
1905
|
if (d && (S || I && j)) {
|
|
1906
1906
|
const H = {};
|
|
1907
1907
|
["status", "statusText", "headers"].forEach((xe) => {
|
|
1908
1908
|
H[xe] = D[xe];
|
|
1909
1909
|
});
|
|
1910
|
-
const Y = P.toFiniteNumber(D.headers.get("content-length")), [
|
|
1910
|
+
const Y = P.toFiniteNumber(D.headers.get("content-length")), [Z, ie] = S && Qa(
|
|
1911
1911
|
Y,
|
|
1912
1912
|
_o(el(S), !0)
|
|
1913
1913
|
) || [];
|
|
1914
1914
|
D = new r(
|
|
1915
|
-
nl(D.body, rl,
|
|
1915
|
+
nl(D.body, rl, Z, () => {
|
|
1916
1916
|
ie && ie(), j && j();
|
|
1917
1917
|
}),
|
|
1918
1918
|
H
|
|
@@ -1921,7 +1921,7 @@ const Kc = (e) => {
|
|
|
1921
1921
|
E = E || "text";
|
|
1922
1922
|
let M = await f[P.findKey(f, E) || "text"](D, w);
|
|
1923
1923
|
return !I && j && j(), await new Promise((H, Y) => {
|
|
1924
|
-
|
|
1924
|
+
Uc(H, Y, {
|
|
1925
1925
|
data: M,
|
|
1926
1926
|
headers: Tt.from(D.headers),
|
|
1927
1927
|
status: D.status,
|
|
@@ -1939,7 +1939,7 @@ const Kc = (e) => {
|
|
|
1939
1939
|
) : ke.from(B, B && B.code, w, F);
|
|
1940
1940
|
}
|
|
1941
1941
|
};
|
|
1942
|
-
}, Ig = /* @__PURE__ */ new Map(),
|
|
1942
|
+
}, Ig = /* @__PURE__ */ new Map(), Kc = (e) => {
|
|
1943
1943
|
let t = e ? e.env : {};
|
|
1944
1944
|
const { fetch: n, Request: r, Response: o } = t, s = [
|
|
1945
1945
|
r,
|
|
@@ -1951,12 +1951,12 @@ const Kc = (e) => {
|
|
|
1951
1951
|
c = s[a], u = d.get(c), u === void 0 && d.set(c, u = a ? /* @__PURE__ */ new Map() : kg(t)), d = u;
|
|
1952
1952
|
return u;
|
|
1953
1953
|
};
|
|
1954
|
-
|
|
1954
|
+
Kc();
|
|
1955
1955
|
const xi = {
|
|
1956
1956
|
http: Vm,
|
|
1957
1957
|
xhr: yg,
|
|
1958
1958
|
fetch: {
|
|
1959
|
-
get:
|
|
1959
|
+
get: Kc
|
|
1960
1960
|
}
|
|
1961
1961
|
};
|
|
1962
1962
|
P.forEach(xi, (e, t) => {
|
|
@@ -1968,7 +1968,7 @@ P.forEach(xi, (e, t) => {
|
|
|
1968
1968
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1969
1969
|
}
|
|
1970
1970
|
});
|
|
1971
|
-
const al = (e) => `- ${e}`, Ng = (e) => P.isFunction(e) || e === null || e === !1,
|
|
1971
|
+
const al = (e) => `- ${e}`, Ng = (e) => P.isFunction(e) || e === null || e === !1, qc = {
|
|
1972
1972
|
getAdapter: (e, t) => {
|
|
1973
1973
|
e = P.isArray(e) ? e : [e];
|
|
1974
1974
|
const { length: n } = e;
|
|
@@ -2007,21 +2007,21 @@ function ll(e) {
|
|
|
2007
2007
|
return Bs(e), e.headers = Tt.from(e.headers), e.data = zs.call(
|
|
2008
2008
|
e,
|
|
2009
2009
|
e.transformRequest
|
|
2010
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
2010
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), qc.getAdapter(e.adapter || Vr.adapter, e)(e).then(function(r) {
|
|
2011
2011
|
return Bs(e), r.data = zs.call(
|
|
2012
2012
|
e,
|
|
2013
2013
|
e.transformResponse,
|
|
2014
2014
|
r
|
|
2015
2015
|
), r.headers = Tt.from(r.headers), r;
|
|
2016
2016
|
}, function(r) {
|
|
2017
|
-
return
|
|
2017
|
+
return Hc(r) || (Bs(e), r && r.response && (r.response.data = zs.call(
|
|
2018
2018
|
e,
|
|
2019
2019
|
e.transformResponse,
|
|
2020
2020
|
r.response
|
|
2021
2021
|
), r.response.headers = Tt.from(r.response.headers))), Promise.reject(r);
|
|
2022
2022
|
});
|
|
2023
2023
|
}
|
|
2024
|
-
const
|
|
2024
|
+
const Gc = "1.12.2", ns = {};
|
|
2025
2025
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
2026
2026
|
ns[e] = function(r) {
|
|
2027
2027
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
@@ -2030,7 +2030,7 @@ const Yc = "1.12.2", ns = {};
|
|
|
2030
2030
|
const cl = {};
|
|
2031
2031
|
ns.transitional = function(t, n, r) {
|
|
2032
2032
|
function o(s, i) {
|
|
2033
|
-
return "[Axios v" +
|
|
2033
|
+
return "[Axios v" + Gc + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
|
|
2034
2034
|
}
|
|
2035
2035
|
return (s, i, a) => {
|
|
2036
2036
|
if (t === !1)
|
|
@@ -2166,8 +2166,8 @@ let _n = class {
|
|
|
2166
2166
|
}
|
|
2167
2167
|
getUri(t) {
|
|
2168
2168
|
t = Pn(this.defaults, t);
|
|
2169
|
-
const n =
|
|
2170
|
-
return
|
|
2169
|
+
const n = Wc(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
2170
|
+
return Fc(n, t.params, t.paramsSerializer);
|
|
2171
2171
|
}
|
|
2172
2172
|
};
|
|
2173
2173
|
P.forEach(["delete", "get", "head", "options"], function(t) {
|
|
@@ -2194,7 +2194,7 @@ P.forEach(["post", "put", "patch"], function(t) {
|
|
|
2194
2194
|
}
|
|
2195
2195
|
_n.prototype[t] = n(), _n.prototype[t + "Form"] = n(!0);
|
|
2196
2196
|
});
|
|
2197
|
-
let _g = class
|
|
2197
|
+
let _g = class Yc {
|
|
2198
2198
|
constructor(t) {
|
|
2199
2199
|
if (typeof t != "function")
|
|
2200
2200
|
throw new TypeError("executor must be a function.");
|
|
@@ -2260,7 +2260,7 @@ let _g = class Xc {
|
|
|
2260
2260
|
static source() {
|
|
2261
2261
|
let t;
|
|
2262
2262
|
return {
|
|
2263
|
-
token: new
|
|
2263
|
+
token: new Yc(function(o) {
|
|
2264
2264
|
t = o;
|
|
2265
2265
|
}),
|
|
2266
2266
|
cancel: t
|
|
@@ -2343,18 +2343,18 @@ const vi = {
|
|
|
2343
2343
|
Object.entries(vi).forEach(([e, t]) => {
|
|
2344
2344
|
vi[t] = e;
|
|
2345
2345
|
});
|
|
2346
|
-
function
|
|
2347
|
-
const t = new _n(e), n =
|
|
2346
|
+
function Xc(e) {
|
|
2347
|
+
const t = new _n(e), n = kc(_n.prototype.request, t);
|
|
2348
2348
|
return P.extend(n, _n.prototype, t, { allOwnKeys: !0 }), P.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
2349
|
-
return
|
|
2349
|
+
return Xc(Pn(e, o));
|
|
2350
2350
|
}, n;
|
|
2351
2351
|
}
|
|
2352
|
-
const at =
|
|
2352
|
+
const at = Xc(Vr);
|
|
2353
2353
|
at.Axios = _n;
|
|
2354
2354
|
at.CanceledError = cr;
|
|
2355
2355
|
at.CancelToken = _g;
|
|
2356
|
-
at.isCancel =
|
|
2357
|
-
at.VERSION =
|
|
2356
|
+
at.isCancel = Hc;
|
|
2357
|
+
at.VERSION = Gc;
|
|
2358
2358
|
at.toFormData = ts;
|
|
2359
2359
|
at.AxiosError = ke;
|
|
2360
2360
|
at.Cancel = at.CanceledError;
|
|
@@ -2365,8 +2365,8 @@ at.spread = jg;
|
|
|
2365
2365
|
at.isAxiosError = Pg;
|
|
2366
2366
|
at.mergeConfig = Pn;
|
|
2367
2367
|
at.AxiosHeaders = Tt;
|
|
2368
|
-
at.formToJSON = (e) =>
|
|
2369
|
-
at.getAdapter =
|
|
2368
|
+
at.formToJSON = (e) => Bc(P.isHTMLForm(e) ? new FormData(e) : e);
|
|
2369
|
+
at.getAdapter = qc.getAdapter;
|
|
2370
2370
|
at.HttpStatusCode = vi;
|
|
2371
2371
|
at.default = at;
|
|
2372
2372
|
const {
|
|
@@ -2387,6 +2387,10 @@ const {
|
|
|
2387
2387
|
getAdapter: DT,
|
|
2388
2388
|
mergeConfig: LT
|
|
2389
2389
|
} = at, ul = typeof window < "u" ? window.__API_BASE_URL__ : void 0, dl = ul ? ul.replace(/\/+$/, "") : void 0;
|
|
2390
|
+
function Jc(e) {
|
|
2391
|
+
const n = (e != null && e.trim() ? e.trim() : "/api/chat").replace(/\/+$/, "");
|
|
2392
|
+
return n ? n.endsWith("/chat") ? n : `${n}/chat` : "/api/chat";
|
|
2393
|
+
}
|
|
2390
2394
|
let jo = null;
|
|
2391
2395
|
const wi = /* @__PURE__ */ new Set();
|
|
2392
2396
|
function Og() {
|
|
@@ -2601,7 +2605,7 @@ const Bg = {
|
|
|
2601
2605
|
lastCheckpointNs: null
|
|
2602
2606
|
};
|
|
2603
2607
|
function Hg({ children: e }) {
|
|
2604
|
-
const [t, n] =
|
|
2608
|
+
const [t, n] = Cc(zg, Bg);
|
|
2605
2609
|
return /* @__PURE__ */ l.jsx(eu.Provider, { value: n, children: /* @__PURE__ */ l.jsx(Qc.Provider, { value: t, children: e }) });
|
|
2606
2610
|
}
|
|
2607
2611
|
function Ug() {
|
|
@@ -2678,13 +2682,13 @@ function Gg({
|
|
|
2678
2682
|
E.current = u;
|
|
2679
2683
|
}, [u]);
|
|
2680
2684
|
const k = ar(nu), N = _e(
|
|
2681
|
-
(M, H) => new Promise((Y,
|
|
2685
|
+
(M, H) => new Promise((Y, Z) => {
|
|
2682
2686
|
const ie = async () => {
|
|
2683
2687
|
y.current = !0;
|
|
2684
2688
|
try {
|
|
2685
2689
|
console.log(`[ThreadProvider] Executing operation: ${H || "unnamed"}`), await M(), Y();
|
|
2686
2690
|
} catch (xe) {
|
|
2687
|
-
console.error(`[ThreadProvider] Operation "${H}" failed:`, xe),
|
|
2691
|
+
console.error(`[ThreadProvider] Operation "${H}" failed:`, xe), Z(xe);
|
|
2688
2692
|
} finally {
|
|
2689
2693
|
y.current = !1;
|
|
2690
2694
|
const xe = R.current.shift();
|
|
@@ -2693,11 +2697,11 @@ function Gg({
|
|
|
2693
2697
|
}
|
|
2694
2698
|
};
|
|
2695
2699
|
y.current ? (R.current.push(ie), console.log(`[ThreadProvider] Queued operation: ${H || "unnamed"}`)) : ie().catch((xe) => {
|
|
2696
|
-
|
|
2700
|
+
Z(xe);
|
|
2697
2701
|
});
|
|
2698
2702
|
}),
|
|
2699
2703
|
[]
|
|
2700
|
-
),
|
|
2704
|
+
), _ = _e(async () => {
|
|
2701
2705
|
h(!0);
|
|
2702
2706
|
try {
|
|
2703
2707
|
const M = await i.listThreads();
|
|
@@ -2707,38 +2711,38 @@ function Gg({
|
|
|
2707
2711
|
} finally {
|
|
2708
2712
|
h(!1);
|
|
2709
2713
|
}
|
|
2710
|
-
}, [i, s]),
|
|
2714
|
+
}, [i, s]), A = _e(
|
|
2711
2715
|
async (M) => {
|
|
2712
2716
|
const H = await i.createThread(M), Y = typeof H == "string" ? H : H.threadId;
|
|
2713
|
-
return await
|
|
2717
|
+
return await _(), d(Y), Y;
|
|
2714
2718
|
},
|
|
2715
|
-
[i,
|
|
2719
|
+
[i, _]
|
|
2716
2720
|
), L = _e(
|
|
2717
2721
|
async (M) => {
|
|
2718
|
-
await i.deleteThread(M), u === M && (d(null), k == null || k.onThreadCleared()), await
|
|
2722
|
+
await i.deleteThread(M), u === M && (d(null), k == null || k.onThreadCleared()), await _();
|
|
2719
2723
|
},
|
|
2720
|
-
[i, u,
|
|
2724
|
+
[i, u, _, k]
|
|
2721
2725
|
), F = _e(
|
|
2722
2726
|
async (M, H) => {
|
|
2723
2727
|
try {
|
|
2724
2728
|
await i.updateThread(M, H), c(
|
|
2725
2729
|
(Y) => Y.map(
|
|
2726
|
-
(
|
|
2730
|
+
(Z) => Z.threadId === M ? { ...Z, title: H } : Z
|
|
2727
2731
|
)
|
|
2728
2732
|
);
|
|
2729
2733
|
} catch (Y) {
|
|
2730
|
-
throw await
|
|
2734
|
+
throw await _(), Y;
|
|
2731
2735
|
}
|
|
2732
2736
|
},
|
|
2733
|
-
[i,
|
|
2737
|
+
[i, _]
|
|
2734
2738
|
), j = _e(
|
|
2735
|
-
async (M, H, Y,
|
|
2739
|
+
async (M, H, Y, Z = !1) => {
|
|
2736
2740
|
await N(async () => {
|
|
2737
|
-
if (C.current === M && !
|
|
2741
|
+
if (C.current === M && !Z) {
|
|
2738
2742
|
console.log("[ThreadProvider] Skipping load for thread:", M), C.current = null;
|
|
2739
2743
|
return;
|
|
2740
2744
|
}
|
|
2741
|
-
if (S.current === M && !
|
|
2745
|
+
if (S.current === M && !Z) {
|
|
2742
2746
|
console.log("[ThreadProvider] Load already in progress for thread:", M);
|
|
2743
2747
|
return;
|
|
2744
2748
|
}
|
|
@@ -2792,7 +2796,7 @@ function Gg({
|
|
|
2792
2796
|
let M = !0;
|
|
2793
2797
|
return (async () => {
|
|
2794
2798
|
try {
|
|
2795
|
-
if (await
|
|
2799
|
+
if (await _(), !M) return;
|
|
2796
2800
|
if (!r && !t)
|
|
2797
2801
|
try {
|
|
2798
2802
|
const Y = localStorage.getItem("lastThreadId");
|
|
@@ -2814,10 +2818,10 @@ function Gg({
|
|
|
2814
2818
|
isLoadingThreads: f,
|
|
2815
2819
|
isLoadingThread: m,
|
|
2816
2820
|
setCurrentThreadId: d,
|
|
2817
|
-
createThread:
|
|
2821
|
+
createThread: A,
|
|
2818
2822
|
deleteThread: L,
|
|
2819
2823
|
renameThread: F,
|
|
2820
|
-
refreshThreads:
|
|
2824
|
+
refreshThreads: _,
|
|
2821
2825
|
loadThread: j,
|
|
2822
2826
|
clearCurrentThread: V,
|
|
2823
2827
|
listCheckpoints: B,
|
|
@@ -2913,7 +2917,7 @@ function Zg(e, t) {
|
|
|
2913
2917
|
}
|
|
2914
2918
|
}
|
|
2915
2919
|
function Qg(e = []) {
|
|
2916
|
-
const [t, n] =
|
|
2920
|
+
const [t, n] = Cc(Zg, { ...Jg, messages: e }), r = Qe([]), o = Qe(null), s = Qe(null), i = _e(() => {
|
|
2917
2921
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
|
|
2918
2922
|
const d = r.current;
|
|
2919
2923
|
d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
|
|
@@ -3087,13 +3091,21 @@ function nx(e, t) {
|
|
|
3087
3091
|
const o = n[n.length - 1], s = r.text ?? "";
|
|
3088
3092
|
if (!s) continue;
|
|
3089
3093
|
if ((o == null ? void 0 : o.type) === "text") {
|
|
3090
|
-
const i = o, a = i.text ?? ""
|
|
3091
|
-
if (!
|
|
3092
|
-
|
|
3094
|
+
const i = o, a = i.text ?? "";
|
|
3095
|
+
if (!a) {
|
|
3096
|
+
i.text = s;
|
|
3093
3097
|
continue;
|
|
3094
3098
|
}
|
|
3095
|
-
|
|
3096
|
-
|
|
3099
|
+
if (s.startsWith(a)) {
|
|
3100
|
+
i.text = s;
|
|
3101
|
+
continue;
|
|
3102
|
+
}
|
|
3103
|
+
if (a.startsWith(s)) {
|
|
3104
|
+
i.text = s;
|
|
3105
|
+
continue;
|
|
3106
|
+
}
|
|
3107
|
+
const c = rx(a, s);
|
|
3108
|
+
c ? i.text = a + c : s.length !== a.length && (i.text = s);
|
|
3097
3109
|
} else
|
|
3098
3110
|
n.push({ type: "text", text: s });
|
|
3099
3111
|
} else
|
|
@@ -3103,25 +3115,13 @@ function nx(e, t) {
|
|
|
3103
3115
|
function rx(e, t) {
|
|
3104
3116
|
if (!t) return "";
|
|
3105
3117
|
if (!e) return t;
|
|
3106
|
-
if (
|
|
3107
|
-
const n =
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
const o = t.slice(n + e.length);
|
|
3112
|
-
if (o) return o;
|
|
3113
|
-
}
|
|
3114
|
-
if (e.endsWith(t) || e.includes(t))
|
|
3115
|
-
return "";
|
|
3116
|
-
const r = Math.min(e.length, t.length);
|
|
3117
|
-
for (let o = r; o > 0; o--)
|
|
3118
|
-
if (e.slice(-o) === t.slice(0, o))
|
|
3119
|
-
return t.slice(o);
|
|
3118
|
+
if (e === t) return "";
|
|
3119
|
+
const n = Math.min(e.length, t.length);
|
|
3120
|
+
for (let r = n; r > 0; r--)
|
|
3121
|
+
if (e.slice(-r) === t.slice(0, r))
|
|
3122
|
+
return t.slice(r);
|
|
3120
3123
|
return t;
|
|
3121
3124
|
}
|
|
3122
|
-
function ml(e) {
|
|
3123
|
-
return e.replace(/[\s\.,;:!?"'`-]/g, "").toLowerCase();
|
|
3124
|
-
}
|
|
3125
3125
|
function ox(e, t, n) {
|
|
3126
3126
|
for (let r = e.length - 1; r >= 0; r--)
|
|
3127
3127
|
if (e[r].role === "assistant") {
|
|
@@ -3187,10 +3187,7 @@ function cx({
|
|
|
3187
3187
|
return { handleEvent: s, reset: i };
|
|
3188
3188
|
}
|
|
3189
3189
|
function ux(e = {}) {
|
|
3190
|
-
const t = vt(() => {
|
|
3191
|
-
const A = (e.baseUrl ?? "/api/chat").replace(/\/+$/, "");
|
|
3192
|
-
return A.endsWith("/chat") ? A : `${A}/chat`;
|
|
3193
|
-
}, [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = fe(e.token ?? null), s = Qe(e.headers ?? {}), [i, a] = fe(!1), [c, u] = fe(null), [d, f] = fe(""), [h, m] = fe(null), [w, v] = fe(0), [g, x] = fe(!1), b = Qe(null), y = Qe(!0), R = Qe(0), S = _e((N) => {
|
|
3190
|
+
const t = vt(() => Jc(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = fe(e.token ?? null), s = Qe(e.headers ?? {}), [i, a] = fe(!1), [c, u] = fe(null), [d, f] = fe(""), [h, m] = fe(null), [w, v] = fe(0), [g, x] = fe(!1), b = Qe(null), y = Qe(!0), R = Qe(0), S = _e((N) => {
|
|
3194
3191
|
o(N);
|
|
3195
3192
|
}, []), C = _e(() => {
|
|
3196
3193
|
var N;
|
|
@@ -3198,16 +3195,16 @@ function ux(e = {}) {
|
|
|
3198
3195
|
}, []), E = _e(() => {
|
|
3199
3196
|
f(""), m(null), u(null);
|
|
3200
3197
|
}, []), k = _e(
|
|
3201
|
-
(N,
|
|
3198
|
+
(N, _, A) => {
|
|
3202
3199
|
b.current && (b.current.abort(), b.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && f("");
|
|
3203
3200
|
const L = new AbortController();
|
|
3204
3201
|
return b.current = L, (async () => {
|
|
3205
3202
|
var j, V, B, K, D, I, M, H;
|
|
3206
3203
|
const F = (Y) => {
|
|
3207
|
-
var
|
|
3204
|
+
var Z;
|
|
3208
3205
|
try {
|
|
3209
3206
|
const ie = JSON.parse(JSON.stringify(Y));
|
|
3210
|
-
return (
|
|
3207
|
+
return (Z = ie == null ? void 0 : ie.payload) != null && Z.files_info && Array.isArray(ie.payload.files_info) && (ie.payload.files_info = ie.payload.files_info.map((xe) => ({
|
|
3211
3208
|
...xe,
|
|
3212
3209
|
data: xe != null && xe.data ? `<base64 ${String(xe.data).length} chars>` : xe == null ? void 0 : xe.data
|
|
3213
3210
|
}))), ie;
|
|
@@ -3222,13 +3219,13 @@ function ux(e = {}) {
|
|
|
3222
3219
|
Y = { Authorization: `Bearer ${r}` };
|
|
3223
3220
|
else if (typeof window < "u") {
|
|
3224
3221
|
const je = window.__AUTH_TOKEN__, Ue = ((j = window.localStorage) == null ? void 0 : j.getItem("authToken")) || null;
|
|
3225
|
-
let
|
|
3222
|
+
let Q = null;
|
|
3226
3223
|
try {
|
|
3227
3224
|
const Ee = (V = window.localStorage) == null ? void 0 : V.getItem("chat-settings");
|
|
3228
|
-
Ee && (
|
|
3225
|
+
Ee && (Q = ((B = JSON.parse(Ee)) == null ? void 0 : B.apiKey) || null);
|
|
3229
3226
|
} catch {
|
|
3230
3227
|
}
|
|
3231
|
-
const X = je || Ue ||
|
|
3228
|
+
const X = je || Ue || Q || null;
|
|
3232
3229
|
X && (Y = { Authorization: `Bearer ${X}` });
|
|
3233
3230
|
}
|
|
3234
3231
|
} catch {
|
|
@@ -3238,7 +3235,7 @@ function ux(e = {}) {
|
|
|
3238
3235
|
t + n,
|
|
3239
3236
|
F(N)
|
|
3240
3237
|
);
|
|
3241
|
-
const
|
|
3238
|
+
const Z = await fetch(t + n, {
|
|
3242
3239
|
method: "POST",
|
|
3243
3240
|
headers: {
|
|
3244
3241
|
"Content-Type": "application/json",
|
|
@@ -3249,18 +3246,18 @@ function ux(e = {}) {
|
|
|
3249
3246
|
body: JSON.stringify(N),
|
|
3250
3247
|
signal: L.signal
|
|
3251
3248
|
});
|
|
3252
|
-
if (!
|
|
3253
|
-
const Ie = await
|
|
3249
|
+
if (!Z.ok || !Z.body) {
|
|
3250
|
+
const Ie = await Z.text().catch(() => "");
|
|
3254
3251
|
throw console.debug(
|
|
3255
3252
|
"[use-chat] non-OK response",
|
|
3256
|
-
|
|
3253
|
+
Z.status,
|
|
3257
3254
|
Ie == null ? void 0 : Ie.slice(0, 500)
|
|
3258
3255
|
), new Error(
|
|
3259
|
-
`stream ${
|
|
3256
|
+
`stream ${Z.status}${Ie ? ": " + Ie : ""}`
|
|
3260
3257
|
);
|
|
3261
3258
|
}
|
|
3262
3259
|
x(!0);
|
|
3263
|
-
const ie =
|
|
3260
|
+
const ie = Z.body.getReader(), xe = new TextDecoder();
|
|
3264
3261
|
let Te = "", W = [], O = R.current, G = null;
|
|
3265
3262
|
const te = () => {
|
|
3266
3263
|
if (W.length) {
|
|
@@ -3276,12 +3273,12 @@ function ux(e = {}) {
|
|
|
3276
3273
|
var Ie;
|
|
3277
3274
|
if (Date.now() - ae > 2e4) {
|
|
3278
3275
|
const je = "Stream idle timeout";
|
|
3279
|
-
u(je), L.abort(), (Ie =
|
|
3276
|
+
u(je), L.abort(), (Ie = A == null ? void 0 : A.onError) == null || Ie.call(A, je);
|
|
3280
3277
|
}
|
|
3281
3278
|
}, 5e3), Ke = 1024 * 1024;
|
|
3282
3279
|
try {
|
|
3283
|
-
const Ie =
|
|
3284
|
-
for ((K =
|
|
3280
|
+
const Ie = Z.headers.get("X-Thread-Id") || Z.headers.get("x-thread-id"), je = Z.headers.get("X-Thread-Created") || Z.headers.get("x-thread-created"), Ue = Ie ?? null, Q = String(je ?? "").toLowerCase() === "true";
|
|
3281
|
+
for ((K = A == null ? void 0 : A.onOpen) == null || K.call(A, { threadId: Ue, created: Q }); ; ) {
|
|
3285
3282
|
const { value: X, done: Ee } = await ie.read();
|
|
3286
3283
|
if (Ee) break;
|
|
3287
3284
|
Te += xe.decode(X, { stream: !0 }), Te.length > Ke && (Te = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
@@ -3308,9 +3305,9 @@ function ux(e = {}) {
|
|
|
3308
3305
|
console.debug("[use-chat] drop duplicate/out-of-order event", { seq: Re, lastProcessedSeq: O, type: pe.type });
|
|
3309
3306
|
continue;
|
|
3310
3307
|
}
|
|
3311
|
-
O > 0 && Re > O + 1 && ((D =
|
|
3308
|
+
O > 0 && Re > O + 1 && ((D = A == null ? void 0 : A.onGap) == null || D.call(A, { from: O, to: Re })), O = Re, R.current = Re, v(Re);
|
|
3312
3309
|
}
|
|
3313
|
-
if (
|
|
3310
|
+
if (_ == null || _(pe), pe.type === "token" && e.autoAppendAssistant !== !1)
|
|
3314
3311
|
W.push(pe.content), ue();
|
|
3315
3312
|
else if (pe.type === "message_delta") {
|
|
3316
3313
|
const Me = pe.delta.filter((qe) => qe.type === "text").map((qe) => qe.text).join("");
|
|
@@ -3323,7 +3320,7 @@ function ux(e = {}) {
|
|
|
3323
3320
|
} catch (Ie) {
|
|
3324
3321
|
if (Ie.name !== "AbortError") {
|
|
3325
3322
|
const je = Ie.message || String(Ie);
|
|
3326
|
-
u(je), (I =
|
|
3323
|
+
u(je), (I = A == null ? void 0 : A.onError) == null || I.call(A, je);
|
|
3327
3324
|
}
|
|
3328
3325
|
} finally {
|
|
3329
3326
|
try {
|
|
@@ -3336,8 +3333,8 @@ function ux(e = {}) {
|
|
|
3336
3333
|
}
|
|
3337
3334
|
} catch (Y) {
|
|
3338
3335
|
if (Y.name !== "AbortError") {
|
|
3339
|
-
const
|
|
3340
|
-
u(
|
|
3336
|
+
const Z = Y.message || String(Y);
|
|
3337
|
+
u(Z), (H = A == null ? void 0 : A.onError) == null || H.call(A, Z);
|
|
3341
3338
|
}
|
|
3342
3339
|
} finally {
|
|
3343
3340
|
a(!1), x(!1), b.current = null;
|
|
@@ -3382,10 +3379,7 @@ function hx({
|
|
|
3382
3379
|
fileAgentId: n = "invoice_reader",
|
|
3383
3380
|
onRegisterThreadCallbacks: r
|
|
3384
3381
|
}) {
|
|
3385
|
-
const { api: o, baseUrl: s } = Gi(), i = z.useMemo(() => {
|
|
3386
|
-
const J = (s ?? "").replace(/\/+$/, "");
|
|
3387
|
-
return J ? J.endsWith("/chat") ? J : `${J}/chat` : "/api/chat";
|
|
3388
|
-
}, [s]), { currentThreadId: a, setCurrentThreadId: c, isLoadingThread: u, refreshThreads: d } = rs(), f = Wg(), { state: h, dispatch: m, seed: w, prepend: v, pushUser: g, onEvent: x, reset: b } = Qg(), [y, R] = fe(!1), [S, C] = fe(!1), [E, k] = fe(null), [N, A] = fe(void 0), [_, L] = fe(void 0), F = 20, j = Qe(a);
|
|
3382
|
+
const { api: o, baseUrl: s } = Gi(), i = z.useMemo(() => Jc(s), [s]), { currentThreadId: a, setCurrentThreadId: c, isLoadingThread: u, refreshThreads: d } = rs(), f = Wg(), { state: h, dispatch: m, seed: w, prepend: v, pushUser: g, onEvent: x, reset: b } = Qg(), [y, R] = fe(!1), [S, C] = fe(!1), [E, k] = fe(null), [N, _] = fe(void 0), [A, L] = fe(void 0), F = 20, j = Qe(a);
|
|
3389
3383
|
ot(() => {
|
|
3390
3384
|
j.current = a;
|
|
3391
3385
|
}, [a]);
|
|
@@ -3394,24 +3388,24 @@ function hx({
|
|
|
3394
3388
|
B.current = !1;
|
|
3395
3389
|
try {
|
|
3396
3390
|
await d();
|
|
3397
|
-
} catch (
|
|
3398
|
-
console.error("[MessagesProvider] Failed to refresh threads:",
|
|
3391
|
+
} catch (Q) {
|
|
3392
|
+
console.error("[MessagesProvider] Failed to refresh threads:", Q);
|
|
3399
3393
|
}
|
|
3400
3394
|
}
|
|
3401
3395
|
}, [d]), { isStreaming: D, error: I, stream: M, stop: H, setToken: Y } = ux({
|
|
3402
3396
|
baseUrl: i,
|
|
3403
3397
|
token: null
|
|
3404
|
-
}),
|
|
3398
|
+
}), Z = Qe(D);
|
|
3405
3399
|
ot(() => {
|
|
3406
|
-
|
|
3400
|
+
Z.current = D, D || K();
|
|
3407
3401
|
}, [D, K]);
|
|
3408
3402
|
const ie = _e(() => {
|
|
3409
|
-
B.current = !0,
|
|
3403
|
+
B.current = !0, Z.current || K();
|
|
3410
3404
|
}, [K]);
|
|
3411
3405
|
ot(() => {
|
|
3412
3406
|
var Ee;
|
|
3413
|
-
const
|
|
3414
|
-
Y(
|
|
3407
|
+
const Q = o.getAuthToken();
|
|
3408
|
+
Y(Q);
|
|
3415
3409
|
const X = (Ee = o.onTokenChange) == null ? void 0 : Ee.call(o, (He) => {
|
|
3416
3410
|
Y(He);
|
|
3417
3411
|
});
|
|
@@ -3435,17 +3429,17 @@ function hx({
|
|
|
3435
3429
|
});
|
|
3436
3430
|
}, [h.assemblingId, f]);
|
|
3437
3431
|
const xe = _e(
|
|
3438
|
-
(
|
|
3439
|
-
const Ee = Array.isArray(
|
|
3432
|
+
(Q, X) => {
|
|
3433
|
+
const Ee = Array.isArray(Q == null ? void 0 : Q.messages) ? Q.messages : [];
|
|
3440
3434
|
X === "replace" ? (console.log("[MessagesProvider] Replacing messages, count:", Ee.length), w(Ee, {
|
|
3441
|
-
checkpointId: (
|
|
3442
|
-
checkpointNs: (
|
|
3443
|
-
})) : X === "prepend" && Ee.length && (console.log("[MessagesProvider] Prepending messages, count:", Ee.length), v(Ee)), k((
|
|
3435
|
+
checkpointId: (Q == null ? void 0 : Q.checkpointId) ?? null,
|
|
3436
|
+
checkpointNs: (Q == null ? void 0 : Q.checkpointNs) ?? null
|
|
3437
|
+
})) : X === "prepend" && Ee.length && (console.log("[MessagesProvider] Prepending messages, count:", Ee.length), v(Ee)), k((Q == null ? void 0 : Q.nextCursor) ?? null), R(!!(Q != null && Q.hasMore)), _((He) => (Q == null ? void 0 : Q.checkpointId) ?? He ?? void 0), L((He) => (Q == null ? void 0 : Q.checkpointNs) ?? He ?? void 0);
|
|
3444
3438
|
},
|
|
3445
3439
|
[w, v]
|
|
3446
3440
|
), Te = _e(
|
|
3447
|
-
(
|
|
3448
|
-
const X =
|
|
3441
|
+
(Q) => {
|
|
3442
|
+
const X = Q.threadId, Ee = !!Q.created, He = !!Q.ready;
|
|
3449
3443
|
if (a !== X) {
|
|
3450
3444
|
const ee = !a && h.messages.length <= 1;
|
|
3451
3445
|
ee && (V.current = X), c(X), (He || Ee || ee) && ie();
|
|
@@ -3455,22 +3449,22 @@ function hx({
|
|
|
3455
3449
|
},
|
|
3456
3450
|
[a, h.messages.length, c, ie]
|
|
3457
3451
|
), W = _e(
|
|
3458
|
-
({ from:
|
|
3452
|
+
({ from: Q, to: X }) => {
|
|
3459
3453
|
const Ee = j.current;
|
|
3460
3454
|
Ee && console.warn(
|
|
3461
|
-
`[MessagesProvider] Stream sequence gap detected (${
|
|
3455
|
+
`[MessagesProvider] Stream sequence gap detected (${Q} -> ${X}) for thread ${Ee}`
|
|
3462
3456
|
);
|
|
3463
3457
|
},
|
|
3464
3458
|
[]
|
|
3465
3459
|
), { handleEvent: O, reset: G } = cx({
|
|
3466
3460
|
onThreadInfo: Te,
|
|
3467
3461
|
onMessageEvent: x,
|
|
3468
|
-
onUnhandledEvent: (
|
|
3469
|
-
console.warn(`[MessagesProvider] Unhandled stream event type: ${
|
|
3462
|
+
onUnhandledEvent: (Q) => {
|
|
3463
|
+
console.warn(`[MessagesProvider] Unhandled stream event type: ${Q.type}`, Q);
|
|
3470
3464
|
},
|
|
3471
3465
|
onSequenceGap: W
|
|
3472
3466
|
}), te = _e(
|
|
3473
|
-
async (
|
|
3467
|
+
async (Q) => {
|
|
3474
3468
|
if (!a) throw new Error("No active thread");
|
|
3475
3469
|
if (S || !y) return;
|
|
3476
3470
|
const X = E;
|
|
@@ -3480,8 +3474,8 @@ function hx({
|
|
|
3480
3474
|
const Ee = await o.getMessages({
|
|
3481
3475
|
threadId: a,
|
|
3482
3476
|
checkpointId: N,
|
|
3483
|
-
checkpointNs:
|
|
3484
|
-
limit: (
|
|
3477
|
+
checkpointNs: A,
|
|
3478
|
+
limit: (Q == null ? void 0 : Q.limit) ?? F,
|
|
3485
3479
|
beforeId: X
|
|
3486
3480
|
});
|
|
3487
3481
|
xe(Ee, "prepend");
|
|
@@ -3494,7 +3488,7 @@ function hx({
|
|
|
3494
3488
|
o,
|
|
3495
3489
|
a,
|
|
3496
3490
|
N,
|
|
3497
|
-
|
|
3491
|
+
A,
|
|
3498
3492
|
E,
|
|
3499
3493
|
y,
|
|
3500
3494
|
S,
|
|
@@ -3502,10 +3496,10 @@ function hx({
|
|
|
3502
3496
|
F
|
|
3503
3497
|
]
|
|
3504
3498
|
), ue = _e(() => {
|
|
3505
|
-
console.log("[MessagesProvider] Clearing messages"), b([]), R(!1), C(!1), k(null),
|
|
3499
|
+
console.log("[MessagesProvider] Clearing messages"), b([]), R(!1), C(!1), k(null), _(void 0), L(void 0);
|
|
3506
3500
|
}, [b]), ae = _e(
|
|
3507
|
-
(
|
|
3508
|
-
console.log("[MessagesProvider] Handling thread load for",
|
|
3501
|
+
(Q, X) => {
|
|
3502
|
+
console.log("[MessagesProvider] Handling thread load for", Q), B.current = !1, xe(X, "replace");
|
|
3509
3503
|
},
|
|
3510
3504
|
[xe]
|
|
3511
3505
|
), $e = _e(() => {
|
|
@@ -3529,14 +3523,14 @@ function hx({
|
|
|
3529
3523
|
};
|
|
3530
3524
|
}, [r, Ke]);
|
|
3531
3525
|
const Ie = _e(
|
|
3532
|
-
async (
|
|
3526
|
+
async (Q, X) => {
|
|
3533
3527
|
var Ge;
|
|
3534
3528
|
!a && !(X != null && X.payloadExtras) && console.warn("[MessagesProvider] No thread ID - message will create new thread");
|
|
3535
3529
|
const Ee = (X == null ? void 0 : X.attachments) || [], { contentParts: He, filesInfo: ee } = await qg(
|
|
3536
3530
|
o,
|
|
3537
3531
|
Ee
|
|
3538
3532
|
), re = [...He];
|
|
3539
|
-
|
|
3533
|
+
Q && Q.trim() && re.push({ type: "text", text: Q.trim() });
|
|
3540
3534
|
const he = {
|
|
3541
3535
|
id: ((Ge = crypto.randomUUID) == null ? void 0 : Ge.call(crypto)) || `user-${Date.now()}`,
|
|
3542
3536
|
role: "user",
|
|
@@ -3593,19 +3587,19 @@ function hx({
|
|
|
3593
3587
|
n
|
|
3594
3588
|
]
|
|
3595
3589
|
), je = _e(
|
|
3596
|
-
async (
|
|
3590
|
+
async (Q, X, Ee) => {
|
|
3597
3591
|
const He = j.current;
|
|
3598
3592
|
if (!He)
|
|
3599
3593
|
throw new Error("No active thread to handle interrupt");
|
|
3600
3594
|
try {
|
|
3601
|
-
console.log(`[MessagesProvider] Handling interrupt ${
|
|
3595
|
+
console.log(`[MessagesProvider] Handling interrupt ${Q}: ${X ? "approved" : "rejected"}`);
|
|
3602
3596
|
const ee = X ? Ee ?? !0 : !1;
|
|
3603
3597
|
await o.resume({
|
|
3604
3598
|
threadId: He,
|
|
3605
3599
|
value: ee
|
|
3606
|
-
}), console.log(`[MessagesProvider] Interrupt ${
|
|
3600
|
+
}), console.log(`[MessagesProvider] Interrupt ${Q} handled successfully`);
|
|
3607
3601
|
} catch (ee) {
|
|
3608
|
-
throw console.error(`[MessagesProvider] Failed to handle interrupt ${
|
|
3602
|
+
throw console.error(`[MessagesProvider] Failed to handle interrupt ${Q}:`, ee), ee;
|
|
3609
3603
|
}
|
|
3610
3604
|
},
|
|
3611
3605
|
[o]
|
|
@@ -3680,7 +3674,7 @@ function Vs({
|
|
|
3680
3674
|
}
|
|
3681
3675
|
) }) });
|
|
3682
3676
|
}
|
|
3683
|
-
function
|
|
3677
|
+
function J(...e) {
|
|
3684
3678
|
return rm(nm(e));
|
|
3685
3679
|
}
|
|
3686
3680
|
const mx = Xo(
|
|
@@ -3713,7 +3707,7 @@ const mx = Xo(
|
|
|
3713
3707
|
return /* @__PURE__ */ l.jsx(
|
|
3714
3708
|
i,
|
|
3715
3709
|
{
|
|
3716
|
-
className:
|
|
3710
|
+
className: J(mx({ variant: t, size: n, className: e })),
|
|
3717
3711
|
ref: s,
|
|
3718
3712
|
...o
|
|
3719
3713
|
}
|
|
@@ -3725,7 +3719,7 @@ const su = p.forwardRef(
|
|
|
3725
3719
|
({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
3726
3720
|
"textarea",
|
|
3727
3721
|
{
|
|
3728
|
-
className:
|
|
3722
|
+
className: J(
|
|
3729
3723
|
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
3730
3724
|
e
|
|
3731
3725
|
),
|
|
@@ -3766,8 +3760,8 @@ function gx({
|
|
|
3766
3760
|
const N = (h ?? "").trim();
|
|
3767
3761
|
!N && !f || v(() => {
|
|
3768
3762
|
try {
|
|
3769
|
-
const
|
|
3770
|
-
|
|
3763
|
+
const _ = i(N);
|
|
3764
|
+
_ && typeof _.then == "function" ? _.then(() => {
|
|
3771
3765
|
m(""), g.current && (g.current.style.height = "auto");
|
|
3772
3766
|
}).catch(() => {
|
|
3773
3767
|
}) : (m(""), g.current && (g.current.style.height = "auto"));
|
|
@@ -3829,7 +3823,7 @@ function gx({
|
|
|
3829
3823
|
] }) });
|
|
3830
3824
|
}
|
|
3831
3825
|
const xx = z.memo(gx), os = 0, yn = 1, ur = 2, iu = 4;
|
|
3832
|
-
function
|
|
3826
|
+
function ml(e) {
|
|
3833
3827
|
return () => e;
|
|
3834
3828
|
}
|
|
3835
3829
|
function vx(e) {
|
|
@@ -3838,7 +3832,7 @@ function vx(e) {
|
|
|
3838
3832
|
function au(e, t) {
|
|
3839
3833
|
return (n) => e(t(n));
|
|
3840
3834
|
}
|
|
3841
|
-
function
|
|
3835
|
+
function gl(e, t) {
|
|
3842
3836
|
return () => e(t);
|
|
3843
3837
|
}
|
|
3844
3838
|
function wx(e, t) {
|
|
@@ -3884,7 +3878,7 @@ function Ht(e, t) {
|
|
|
3884
3878
|
});
|
|
3885
3879
|
return n;
|
|
3886
3880
|
}
|
|
3887
|
-
function
|
|
3881
|
+
function xl(e) {
|
|
3888
3882
|
let t, n;
|
|
3889
3883
|
return (r) => (o) => {
|
|
3890
3884
|
t = o, n && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -4136,7 +4130,7 @@ function Ix(e, t, n, r, o, s, i, a, c) {
|
|
|
4136
4130
|
scrollTop: Math.max(v, 0),
|
|
4137
4131
|
viewportHeight: x
|
|
4138
4132
|
}), s == null || s(
|
|
4139
|
-
a ?
|
|
4133
|
+
a ? vl("column-gap", getComputedStyle(d).columnGap, o) : vl("row-gap", getComputedStyle(d).rowGap, o)
|
|
4140
4134
|
), f !== null && e(f);
|
|
4141
4135
|
},
|
|
4142
4136
|
[e, t, o, s, i, r, a]
|
|
@@ -4160,7 +4154,7 @@ function Nx(e, t, n, r) {
|
|
|
4160
4154
|
}
|
|
4161
4155
|
return s;
|
|
4162
4156
|
}
|
|
4163
|
-
function
|
|
4157
|
+
function vl(e, t, n) {
|
|
4164
4158
|
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Rt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
4165
4159
|
}
|
|
4166
4160
|
function cu(e, t, n) {
|
|
@@ -4277,7 +4271,7 @@ function Ut(e, t, n = "k") {
|
|
|
4277
4271
|
return Ut(e.l, t, n);
|
|
4278
4272
|
}
|
|
4279
4273
|
function Nt(e, t, n) {
|
|
4280
|
-
return Je(e) ? hu(t, n, 1) : t === e.k ? ut(e, { k: t, v: n }) : t < e.k ?
|
|
4274
|
+
return Je(e) ? hu(t, n, 1) : t === e.k ? ut(e, { k: t, v: n }) : t < e.k ? wl(ut(e, { l: Nt(e.l, t, n) })) : wl(ut(e, { r: Nt(e.r, t, n) }));
|
|
4281
4275
|
}
|
|
4282
4276
|
function Zn() {
|
|
4283
4277
|
return jr;
|
|
@@ -4367,7 +4361,7 @@ function fu(e) {
|
|
|
4367
4361
|
function hu(e, t, n, r = jr, o = jr) {
|
|
4368
4362
|
return { k: e, l: r, lvl: n, r: o, v: t };
|
|
4369
4363
|
}
|
|
4370
|
-
function
|
|
4364
|
+
function wl(e) {
|
|
4371
4365
|
return Ci(pu(e));
|
|
4372
4366
|
}
|
|
4373
4367
|
function pu(e) {
|
|
@@ -4515,7 +4509,7 @@ function $x(e) {
|
|
|
4515
4509
|
return { endIndex: s ? s.k - 1 : 1 / 0, size: n, startIndex: t };
|
|
4516
4510
|
});
|
|
4517
4511
|
}
|
|
4518
|
-
function
|
|
4512
|
+
function bl(e, t) {
|
|
4519
4513
|
let n = 0, r = 0;
|
|
4520
4514
|
for (; n < e; )
|
|
4521
4515
|
n += t[r + 1] - t[r] - 1, r++;
|
|
@@ -4577,7 +4571,7 @@ const Bx = {
|
|
|
4577
4571
|
be((S) => S.length > 0),
|
|
4578
4572
|
Ae(v, m),
|
|
4579
4573
|
oe(([S, C, E]) => {
|
|
4580
|
-
const k = S.reduce((N,
|
|
4574
|
+
const k = S.reduce((N, _, A) => Nt(N, _, Mr(_, C.offsetTree, E) || A), Zn());
|
|
4581
4575
|
return {
|
|
4582
4576
|
...C,
|
|
4583
4577
|
groupIndices: S,
|
|
@@ -4642,10 +4636,10 @@ const Bx = {
|
|
|
4642
4636
|
(S) => {
|
|
4643
4637
|
const { groupIndices: C } = it(v);
|
|
4644
4638
|
if (S > 0)
|
|
4645
|
-
Ne(t, !0), Ne(s, S +
|
|
4639
|
+
Ne(t, !0), Ne(s, S + bl(S, C));
|
|
4646
4640
|
else if (S < 0) {
|
|
4647
4641
|
const E = it(g);
|
|
4648
|
-
E.length > 0 && (S -=
|
|
4642
|
+
E.length > 0 && (S -= bl(-S, E)), Ne(i, S);
|
|
4649
4643
|
}
|
|
4650
4644
|
}
|
|
4651
4645
|
), Ve($(a, Ae(e)), ([S, C]) => {
|
|
@@ -4663,22 +4657,22 @@ const Bx = {
|
|
|
4663
4657
|
oe(([S, C]) => {
|
|
4664
4658
|
const E = C.groupIndices.length > 0, k = [], N = C.lastSize;
|
|
4665
4659
|
if (E) {
|
|
4666
|
-
const
|
|
4667
|
-
let
|
|
4668
|
-
for (;
|
|
4660
|
+
const _ = Pr(C.sizeTree, 0);
|
|
4661
|
+
let A = 0, L = 0;
|
|
4662
|
+
for (; A < S; ) {
|
|
4669
4663
|
const j = C.groupIndices[L], V = C.groupIndices.length === L + 1 ? 1 / 0 : C.groupIndices[L + 1] - j - 1;
|
|
4670
4664
|
k.push({
|
|
4671
4665
|
endIndex: j,
|
|
4672
|
-
size:
|
|
4666
|
+
size: _,
|
|
4673
4667
|
startIndex: j
|
|
4674
4668
|
}), k.push({
|
|
4675
4669
|
endIndex: j + 1 + V - 1,
|
|
4676
4670
|
size: N,
|
|
4677
4671
|
startIndex: j + 1
|
|
4678
|
-
}), L++,
|
|
4672
|
+
}), L++, A += V + 1;
|
|
4679
4673
|
}
|
|
4680
4674
|
const F = An(C.sizeTree);
|
|
4681
|
-
return
|
|
4675
|
+
return A !== S && F.shift(), F.reduce(
|
|
4682
4676
|
(j, { k: V, v: B }) => {
|
|
4683
4677
|
let K = j.ranges;
|
|
4684
4678
|
return j.prevSize !== 0 && (K = [
|
|
@@ -4702,10 +4696,10 @@ const Bx = {
|
|
|
4702
4696
|
).ranges;
|
|
4703
4697
|
}
|
|
4704
4698
|
return An(C.sizeTree).reduce(
|
|
4705
|
-
(
|
|
4706
|
-
prevIndex:
|
|
4699
|
+
(_, { k: A, v: L }) => ({
|
|
4700
|
+
prevIndex: A + S,
|
|
4707
4701
|
prevSize: L,
|
|
4708
|
-
ranges: [...
|
|
4702
|
+
ranges: [..._.ranges, { endIndex: A + S - 1, size: _.prevSize, startIndex: _.prevIndex }]
|
|
4709
4703
|
}),
|
|
4710
4704
|
{
|
|
4711
4705
|
prevIndex: 0,
|
|
@@ -4737,13 +4731,13 @@ const Bx = {
|
|
|
4737
4731
|
return C;
|
|
4738
4732
|
let k = Zn();
|
|
4739
4733
|
const N = it(g);
|
|
4740
|
-
let
|
|
4741
|
-
for (;
|
|
4742
|
-
L = N[
|
|
4743
|
-
const F = N[
|
|
4744
|
-
|
|
4734
|
+
let _ = 0, A = 0, L = 0;
|
|
4735
|
+
for (; _ < -S; ) {
|
|
4736
|
+
L = N[A];
|
|
4737
|
+
const F = N[A + 1] - L - 1;
|
|
4738
|
+
A++, _ += F + 1;
|
|
4745
4739
|
}
|
|
4746
|
-
if (k = An(C.sizeTree).reduce((F, { k: j, v: V }) => Nt(F, Math.max(0, j + S), V), k),
|
|
4740
|
+
if (k = An(C.sizeTree).reduce((F, { k: j, v: V }) => Nt(F, Math.max(0, j + S), V), k), _ !== -S) {
|
|
4747
4741
|
const F = Pr(C.sizeTree, L);
|
|
4748
4742
|
k = Nt(k, 0, F);
|
|
4749
4743
|
const j = Ut(C.sizeTree, -S + 1)[1];
|
|
@@ -4755,7 +4749,7 @@ const Bx = {
|
|
|
4755
4749
|
...Ti(C.offsetTree, 0, k, E)
|
|
4756
4750
|
};
|
|
4757
4751
|
} else {
|
|
4758
|
-
const k = An(C.sizeTree).reduce((N, { k:
|
|
4752
|
+
const k = An(C.sizeTree).reduce((N, { k: _, v: A }) => Nt(N, Math.max(0, _ + S), A), Zn());
|
|
4759
4753
|
return {
|
|
4760
4754
|
...C,
|
|
4761
4755
|
sizeTree: k,
|
|
@@ -4873,29 +4867,29 @@ const Kr = Be(
|
|
|
4873
4867
|
Ae(e, s, o),
|
|
4874
4868
|
oe(
|
|
4875
4869
|
([
|
|
4876
|
-
[R, S, C, E, k, N,
|
|
4870
|
+
[R, S, C, E, k, N, _, A],
|
|
4877
4871
|
L,
|
|
4878
4872
|
F,
|
|
4879
4873
|
j
|
|
4880
4874
|
]) => {
|
|
4881
4875
|
const V = bu(R), { align: B, behavior: K, offset: D } = V, I = E - 1, M = vu(V, S, I);
|
|
4882
4876
|
let H = Mr(M, S.offsetTree, L) + N;
|
|
4883
|
-
B === "end" ? (H += F + Ut(S.sizeTree, M)[1] - C + j, M === I && (H +=
|
|
4884
|
-
const Y = (
|
|
4885
|
-
y(),
|
|
4877
|
+
B === "end" ? (H += F + Ut(S.sizeTree, M)[1] - C + j, M === I && (H += _)) : B === "center" ? H += (F + Ut(S.sizeTree, M)[1] - C + j) / 2 : H -= k, D && (H += D);
|
|
4878
|
+
const Y = (Z) => {
|
|
4879
|
+
y(), Z ? (A("retrying to scroll to", { location: R }, Rt.DEBUG), Ne(m, R)) : (Ne(w, !0), A("list did not change, scroll successful", {}, Rt.DEBUG));
|
|
4886
4880
|
};
|
|
4887
4881
|
if (y(), K === "smooth") {
|
|
4888
|
-
let
|
|
4882
|
+
let Z = !1;
|
|
4889
4883
|
b = Ve(t, (ie) => {
|
|
4890
|
-
|
|
4884
|
+
Z = Z || ie;
|
|
4891
4885
|
}), g = Ht(d, () => {
|
|
4892
|
-
Y(
|
|
4886
|
+
Y(Z);
|
|
4893
4887
|
});
|
|
4894
4888
|
} else
|
|
4895
4889
|
g = Ht($(t, Wx(150)), Y);
|
|
4896
4890
|
return x = setTimeout(() => {
|
|
4897
4891
|
y();
|
|
4898
|
-
}, 1200), Ne(c, !0),
|
|
4892
|
+
}, 1200), Ne(c, !0), A("scrolling from index to", { behavior: K, index: M, top: H }, Rt.DEBUG), { behavior: K, top: H };
|
|
4899
4893
|
}
|
|
4900
4894
|
)
|
|
4901
4895
|
),
|
|
@@ -4987,12 +4981,12 @@ const Dr = "up", Er = "down", Vx = "none", Kx = {
|
|
|
4987
4981
|
}, qx = 0, Gr = Be(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
4988
4982
|
const i = q(!1), a = q(!0), c = Le(), u = Le(), d = q(4), f = q(qx), h = gt(
|
|
4989
4983
|
$(
|
|
4990
|
-
bi($(we(o), Mn(1), Xt(!0)), $(we(o), Mn(1), Xt(!1),
|
|
4984
|
+
bi($(we(o), Mn(1), Xt(!0)), $(we(o), Mn(1), Xt(!1), xl(100))),
|
|
4991
4985
|
et()
|
|
4992
4986
|
),
|
|
4993
4987
|
!1
|
|
4994
4988
|
), m = gt(
|
|
4995
|
-
$(bi($(n, Xt(!0)), $(n, Xt(!1),
|
|
4989
|
+
$(bi($(n, Xt(!0)), $(n, Xt(!1), xl(200))), et()),
|
|
4996
4990
|
!1
|
|
4997
4991
|
);
|
|
4998
4992
|
de(
|
|
@@ -5007,7 +5001,7 @@ const Dr = "up", Er = "down", Vx = "none", Kx = {
|
|
|
5007
5001
|
$(
|
|
5008
5002
|
ct(r, we(s), we(t), we(e), we(d)),
|
|
5009
5003
|
Zt((b, [{ scrollHeight: y, scrollTop: R }, S, C, E, k]) => {
|
|
5010
|
-
const N = R + S - y > -k,
|
|
5004
|
+
const N = R + S - y > -k, _ = {
|
|
5011
5005
|
scrollHeight: y,
|
|
5012
5006
|
scrollTop: R,
|
|
5013
5007
|
viewportHeight: S
|
|
@@ -5018,14 +5012,14 @@ const Dr = "up", Er = "down", Vx = "none", Kx = {
|
|
|
5018
5012
|
atBottom: !0,
|
|
5019
5013
|
atBottomBecause: L,
|
|
5020
5014
|
scrollTopDelta: F,
|
|
5021
|
-
state:
|
|
5015
|
+
state: _
|
|
5022
5016
|
};
|
|
5023
5017
|
}
|
|
5024
|
-
let
|
|
5025
|
-
return
|
|
5018
|
+
let A;
|
|
5019
|
+
return _.scrollHeight > b.state.scrollHeight ? A = "SIZE_INCREASED" : S < b.state.viewportHeight ? A = "VIEWPORT_HEIGHT_DECREASING" : R < b.state.scrollTop ? A = "SCROLLING_UPWARDS" : A = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
5026
5020
|
atBottom: !1,
|
|
5027
|
-
notAtBottomBecause:
|
|
5028
|
-
state:
|
|
5021
|
+
notAtBottomBecause: A,
|
|
5022
|
+
state: _
|
|
5029
5023
|
};
|
|
5030
5024
|
}, Kx),
|
|
5031
5025
|
et((b, y) => b && b.atBottom === y.atBottom)
|
|
@@ -5116,11 +5110,11 @@ const Dr = "up", Er = "down", Vx = "none", Kx = {
|
|
|
5116
5110
|
scrollDirection: g,
|
|
5117
5111
|
scrollVelocity: x
|
|
5118
5112
|
};
|
|
5119
|
-
}, tt(wt)), Oo = "top", Mo = "bottom",
|
|
5120
|
-
function
|
|
5113
|
+
}, tt(wt)), Oo = "top", Mo = "bottom", yl = "none";
|
|
5114
|
+
function Sl(e, t, n) {
|
|
5121
5115
|
return typeof e == "number" ? n === Dr && t === Oo || n === Er && t === Mo ? e : 0 : n === Dr ? t === Oo ? e.main : e.reverse : t === Mo ? e.main : e.reverse;
|
|
5122
5116
|
}
|
|
5123
|
-
function
|
|
5117
|
+
function Cl(e, t) {
|
|
5124
5118
|
var n;
|
|
5125
5119
|
return typeof e == "number" ? e : (n = e[t]) != null ? n : 0;
|
|
5126
5120
|
}
|
|
@@ -5152,11 +5146,11 @@ const na = Be(
|
|
|
5152
5146
|
y
|
|
5153
5147
|
]) => {
|
|
5154
5148
|
const R = d - b, S = g + x, C = Math.max(h - R, 0);
|
|
5155
|
-
let E =
|
|
5156
|
-
const k =
|
|
5157
|
-
return m -= b, m += h + x, w += h + x, w -= b, m > d + S - k && (E = Dr), w < d - C + f + N && (E = Er), E !==
|
|
5158
|
-
Math.max(R - h -
|
|
5159
|
-
R - C - x + f +
|
|
5149
|
+
let E = yl;
|
|
5150
|
+
const k = Cl(y, Oo), N = Cl(y, Mo);
|
|
5151
|
+
return m -= b, m += h + x, w += h + x, w -= b, m > d + S - k && (E = Dr), w < d - C + f + N && (E = Er), E !== yl ? [
|
|
5152
|
+
Math.max(R - h - Sl(v, Oo, E) - k, 0),
|
|
5153
|
+
R - C - x + f + Sl(v, Mo, E) + N
|
|
5160
5154
|
] : null;
|
|
5161
5155
|
}
|
|
5162
5156
|
),
|
|
@@ -5211,11 +5205,11 @@ function yo(e, t, n, r, o, s) {
|
|
|
5211
5205
|
return {
|
|
5212
5206
|
bottom: d,
|
|
5213
5207
|
firstItemIndex: s,
|
|
5214
|
-
items:
|
|
5208
|
+
items: Tl(e, o, s),
|
|
5215
5209
|
offsetBottom: w,
|
|
5216
5210
|
offsetTop: u,
|
|
5217
5211
|
top: m,
|
|
5218
|
-
topItems:
|
|
5212
|
+
topItems: Tl(t, o, s),
|
|
5219
5213
|
topListHeight: t.reduce((v, g) => g.size + v, 0),
|
|
5220
5214
|
totalCount: n
|
|
5221
5215
|
};
|
|
@@ -5236,7 +5230,7 @@ function Su(e, t, n, r, o, s) {
|
|
|
5236
5230
|
}));
|
|
5237
5231
|
return yo(u, [], a, o, n, r);
|
|
5238
5232
|
}
|
|
5239
|
-
function
|
|
5233
|
+
function Tl(e, t, n) {
|
|
5240
5234
|
if (e.length === 0)
|
|
5241
5235
|
return [];
|
|
5242
5236
|
if (!as(t))
|
|
@@ -5291,8 +5285,8 @@ const Hn = Be(
|
|
|
5291
5285
|
e
|
|
5292
5286
|
),
|
|
5293
5287
|
be(([C, E, , k, , , , , , , N]) => {
|
|
5294
|
-
const
|
|
5295
|
-
return C && !E && !
|
|
5288
|
+
const _ = N && N.length !== k;
|
|
5289
|
+
return C && !E && !_;
|
|
5296
5290
|
}),
|
|
5297
5291
|
oe(
|
|
5298
5292
|
([
|
|
@@ -5301,8 +5295,8 @@ const Hn = Be(
|
|
|
5301
5295
|
[C, E],
|
|
5302
5296
|
k,
|
|
5303
5297
|
N,
|
|
5304
|
-
A,
|
|
5305
5298
|
_,
|
|
5299
|
+
A,
|
|
5306
5300
|
L,
|
|
5307
5301
|
F,
|
|
5308
5302
|
j,
|
|
@@ -5312,10 +5306,10 @@ const Hn = Be(
|
|
|
5312
5306
|
if (k === 0)
|
|
5313
5307
|
return { ...qs, totalCount: k };
|
|
5314
5308
|
if (C === 0 && E === 0)
|
|
5315
|
-
return I === 0 ? { ...qs, totalCount: k } : Su(I,
|
|
5309
|
+
return I === 0 ? { ...qs, totalCount: k } : Su(I, _, N, F, j, V || []);
|
|
5316
5310
|
if (Je(D))
|
|
5317
5311
|
return I > 0 ? null : yo(
|
|
5318
|
-
Gx(ta(
|
|
5312
|
+
Gx(ta(_, k), B, V),
|
|
5319
5313
|
[],
|
|
5320
5314
|
k,
|
|
5321
5315
|
j,
|
|
@@ -5332,12 +5326,12 @@ const Hn = Be(
|
|
|
5332
5326
|
M.push({ data: V == null ? void 0 : V[ae], index: ae, offset: W, size: G }), W += G;
|
|
5333
5327
|
}
|
|
5334
5328
|
}
|
|
5335
|
-
if (!
|
|
5329
|
+
if (!A)
|
|
5336
5330
|
return yo([], M, k, j, B, F);
|
|
5337
5331
|
const H = L.length > 0 ? L[L.length - 1] + 1 : 0, Y = Dx(K, C, E, H);
|
|
5338
5332
|
if (Y.length === 0)
|
|
5339
5333
|
return null;
|
|
5340
|
-
const
|
|
5334
|
+
const Z = k - 1, ie = ss([], (xe) => {
|
|
5341
5335
|
for (const Te of Y) {
|
|
5342
5336
|
const W = Te.value;
|
|
5343
5337
|
let O = W.offset, G = Te.start;
|
|
@@ -5348,7 +5342,7 @@ const Hn = Be(
|
|
|
5348
5342
|
O += ae * te + ae * j;
|
|
5349
5343
|
}
|
|
5350
5344
|
G < H && (O += (H - G) * te, G = H);
|
|
5351
|
-
const ue = Math.min(Te.end,
|
|
5345
|
+
const ue = Math.min(Te.end, Z);
|
|
5352
5346
|
for (let ae = G; ae <= ue && !(O >= E); ae++)
|
|
5353
5347
|
xe.push({ data: V == null ? void 0 : V[ae], index: ae, offset: O, size: te }), O += te + j;
|
|
5354
5348
|
}
|
|
@@ -5487,9 +5481,9 @@ const Hn = Be(
|
|
|
5487
5481
|
Ae(t, c, n, s, o, r, a),
|
|
5488
5482
|
Ae(e),
|
|
5489
5483
|
oe(([[f, h, m, w, v, g, x, b], y]) => {
|
|
5490
|
-
const { align: R, behavior: S, calculateViewLocation: C = Xx, done: E, ...k } = f, N = vu(f, h, w - 1),
|
|
5491
|
-
itemBottom:
|
|
5492
|
-
itemTop:
|
|
5484
|
+
const { align: R, behavior: S, calculateViewLocation: C = Xx, done: E, ...k } = f, N = vu(f, h, w - 1), _ = Mr(N, h.offsetTree, y) + v + g, A = _ + Ut(h.sizeTree, N)[1], L = b + g, F = b + m - x, j = C({
|
|
5485
|
+
itemBottom: A,
|
|
5486
|
+
itemTop: _,
|
|
5493
5487
|
locationParams: { align: R, behavior: S, ...k },
|
|
5494
5488
|
viewportBottom: F,
|
|
5495
5489
|
viewportTop: L
|
|
@@ -5515,10 +5509,10 @@ const Hn = Be(
|
|
|
5515
5509
|
tt(rn, wt, Kr, Hn, Sn),
|
|
5516
5510
|
{ singleton: !0 }
|
|
5517
5511
|
);
|
|
5518
|
-
function
|
|
5512
|
+
function Rl(e) {
|
|
5519
5513
|
return e ? e === "smooth" ? "smooth" : "auto" : !1;
|
|
5520
5514
|
}
|
|
5521
|
-
const Jx = (e, t) => typeof e == "function" ?
|
|
5515
|
+
const Jx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Zx = Be(
|
|
5522
5516
|
([
|
|
5523
5517
|
{ listRefresh: e, totalCount: t, fixedItemSize: n, data: r },
|
|
5524
5518
|
{ atBottomState: o, isAtBottom: s },
|
|
@@ -5543,9 +5537,9 @@ const Jx = (e, t) => typeof e == "function" ? El(e(t)) : t && El(e), Zx = Be(
|
|
|
5543
5537
|
$(
|
|
5544
5538
|
ct($(we(t), Mn(1)), c),
|
|
5545
5539
|
Ae(we(w), s, a, f),
|
|
5546
|
-
oe(([[S, C], E, k, N,
|
|
5547
|
-
let
|
|
5548
|
-
return
|
|
5540
|
+
oe(([[S, C], E, k, N, _]) => {
|
|
5541
|
+
let A = C && N, L = "auto";
|
|
5542
|
+
return A && (L = Jx(E, k || _), A = A && !!L), { followOutputBehavior: L, shouldFollow: A, totalCount: S };
|
|
5549
5543
|
}),
|
|
5550
5544
|
be(({ shouldFollow: S }) => S)
|
|
5551
5545
|
),
|
|
@@ -5599,7 +5593,7 @@ const Jx = (e, t) => typeof e == "function" ? El(e(t)) : t && El(e), Zx = Be(
|
|
|
5599
5593
|
$(
|
|
5600
5594
|
ct($(R, Mn(1)), c),
|
|
5601
5595
|
Ae(we(y), a, f, h),
|
|
5602
|
-
oe(([[S, C], E, k, N,
|
|
5596
|
+
oe(([[S, C], E, k, N, _]) => C && k && (E == null ? void 0 : E({ context: _, totalCount: S, scrollingInProgress: N }))),
|
|
5603
5597
|
be((S) => !!S),
|
|
5604
5598
|
un(0)
|
|
5605
5599
|
),
|
|
@@ -5795,8 +5789,8 @@ const ov = ku(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5795
5789
|
Zt(
|
|
5796
5790
|
([, x, b, y], [{ bottom: R, items: S, offsetBottom: C, totalCount: E }, k]) => {
|
|
5797
5791
|
const N = R + C;
|
|
5798
|
-
let
|
|
5799
|
-
return b === E && x.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && x[0].originalIndex === 0 || (
|
|
5792
|
+
let _ = 0;
|
|
5793
|
+
return b === E && x.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && x[0].originalIndex === 0 || (_ = N - y, _ !== 0 && (_ += k))), [_, S, E, N];
|
|
5800
5794
|
},
|
|
5801
5795
|
[0, [], 0, 0]
|
|
5802
5796
|
),
|
|
@@ -5838,11 +5832,11 @@ const ov = ku(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5838
5832
|
{
|
|
5839
5833
|
let E = 0;
|
|
5840
5834
|
const k = Pr(R, 0);
|
|
5841
|
-
let N = 0,
|
|
5835
|
+
let N = 0, _ = 0;
|
|
5842
5836
|
for (; N < x; ) {
|
|
5843
5837
|
N++, E += k;
|
|
5844
|
-
let
|
|
5845
|
-
N +
|
|
5838
|
+
let A = b.length === _ + 1 ? 1 / 0 : b[_ + 1] - b[_] - 1;
|
|
5839
|
+
N + A > x && (E -= k, A = x - N + 1), N += A, E += C(A), _++;
|
|
5846
5840
|
}
|
|
5847
5841
|
return E;
|
|
5848
5842
|
}
|
|
@@ -5926,7 +5920,7 @@ const ov = ku(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5926
5920
|
]) => (de(R.rangeChanged, N.scrollSeekRangeChanged), de(
|
|
5927
5921
|
$(
|
|
5928
5922
|
N.windowViewportRect,
|
|
5929
|
-
oe((
|
|
5923
|
+
oe((_) => _.visibleHeight)
|
|
5930
5924
|
),
|
|
5931
5925
|
v.viewportHeight
|
|
5932
5926
|
), {
|
|
@@ -6012,7 +6006,7 @@ function Nu(e, t, n) {
|
|
|
6012
6006
|
const f = z.forwardRef((g, x) => {
|
|
6013
6007
|
const { children: b, ...y } = g, [R] = z.useState(() => ss(Rx(e), (E) => {
|
|
6014
6008
|
c(E, y);
|
|
6015
|
-
})), [S] = z.useState(
|
|
6009
|
+
})), [S] = z.useState(gl(d, R));
|
|
6016
6010
|
io(() => {
|
|
6017
6011
|
for (const E of i)
|
|
6018
6012
|
E in y && Ve(S[E], y[E]);
|
|
@@ -6021,7 +6015,7 @@ function Nu(e, t, n) {
|
|
|
6021
6015
|
};
|
|
6022
6016
|
}, [y, S, R]), io(() => {
|
|
6023
6017
|
c(R, y);
|
|
6024
|
-
}), z.useImperativeHandle(x,
|
|
6018
|
+
}), z.useImperativeHandle(x, ml(u(R)));
|
|
6025
6019
|
const C = n;
|
|
6026
6020
|
return /* @__PURE__ */ l.jsx(a.Provider, { value: R, children: n ? /* @__PURE__ */ l.jsx(C, { ...av([...r, ...o, ...i], y), children: b }) : b });
|
|
6027
6021
|
}), h = (g) => {
|
|
@@ -6043,10 +6037,10 @@ function Nu(e, t, n) {
|
|
|
6043
6037
|
() => it(x)
|
|
6044
6038
|
);
|
|
6045
6039
|
}, w = (g) => {
|
|
6046
|
-
const x = z.useContext(a)[g], [b, y] = z.useState(
|
|
6040
|
+
const x = z.useContext(a)[g], [b, y] = z.useState(gl(it, x));
|
|
6047
6041
|
return io(
|
|
6048
6042
|
() => Ve(x, (R) => {
|
|
6049
|
-
R !== b && y(
|
|
6043
|
+
R !== b && y(ml(R));
|
|
6050
6044
|
}),
|
|
6051
6045
|
[x, b]
|
|
6052
6046
|
), b;
|
|
@@ -6085,7 +6079,7 @@ function Pu(e, t, n, r = dr, o, s) {
|
|
|
6085
6079
|
viewportHeight: w
|
|
6086
6080
|
});
|
|
6087
6081
|
};
|
|
6088
|
-
h.suppressFlushSync ? x() :
|
|
6082
|
+
h.suppressFlushSync ? x() : Ec.flushSync(x), a.current !== null && (v === a.current || v <= 0 || v === m - w) && (a.current = null, t(!0), c.current && (clearTimeout(c.current), c.current = null));
|
|
6089
6083
|
},
|
|
6090
6084
|
[e, t, s]
|
|
6091
6085
|
);
|
|
@@ -6119,11 +6113,11 @@ function Pu(e, t, n, r = dr, o, s) {
|
|
|
6119
6113
|
}
|
|
6120
6114
|
return { scrollByCallback: f, scrollerRef: i, scrollToCallback: d };
|
|
6121
6115
|
}
|
|
6122
|
-
const Ys = "-webkit-sticky",
|
|
6116
|
+
const Ys = "-webkit-sticky", El = "sticky", oa = ku(() => {
|
|
6123
6117
|
if (typeof document > "u")
|
|
6124
|
-
return
|
|
6118
|
+
return El;
|
|
6125
6119
|
const e = document.createElement("div");
|
|
6126
|
-
return e.style.position = Ys, e.style.position === Ys ? Ys :
|
|
6120
|
+
return e.style.position = Ys, e.style.position === Ys ? Ys : El;
|
|
6127
6121
|
});
|
|
6128
6122
|
function sa(e) {
|
|
6129
6123
|
return e;
|
|
@@ -6157,7 +6151,7 @@ const cv = /* @__PURE__ */ Be(() => {
|
|
|
6157
6151
|
}), uv = /* @__PURE__ */ Be(
|
|
6158
6152
|
([e, t]) => ({ ...e, ...t }),
|
|
6159
6153
|
tt(Iu, cv)
|
|
6160
|
-
), dv = ({ height: e }) => /* @__PURE__ */ l.jsx("div", { style: { height: e } }), fv = { overflowAnchor: "none", position: oa(), zIndex: 1 }, Ou = { overflowAnchor: "none" }, hv = { ...Ou, display: "inline-block", height: "100%" },
|
|
6154
|
+
), dv = ({ height: e }) => /* @__PURE__ */ l.jsx("div", { style: { height: e } }), fv = { overflowAnchor: "none", position: oa(), zIndex: 1 }, Ou = { overflowAnchor: "none" }, hv = { ...Ou, display: "inline-block", height: "100%" }, kl = /* @__PURE__ */ z.memo(function({ showTopList: e = !1 }) {
|
|
6161
6155
|
const t = Ce("listState"), n = Dt("sizeRanges"), r = Ce("useWindowScroll"), o = Ce("customScrollParent"), s = Dt("windowScrollContainerState"), i = Dt("scrollContainerState"), a = o || r ? s : i, c = Ce("itemContent"), u = Ce("context"), d = Ce("groupContent"), f = Ce("trackItemSizes"), h = Ce("itemSize"), m = Ce("log"), w = Dt("gap"), v = Ce("horizontalDirection"), { callbackRef: g } = Ix(
|
|
6162
6156
|
n,
|
|
6163
6157
|
h,
|
|
@@ -6172,17 +6166,17 @@ const cv = /* @__PURE__ */ Be(() => {
|
|
|
6172
6166
|
ia("deviation", (j) => {
|
|
6173
6167
|
x !== j && b(j);
|
|
6174
6168
|
});
|
|
6175
|
-
const y = Ce("EmptyPlaceholder"), R = Ce("ScrollSeekPlaceholder") || dv, S = Ce("ListComponent"), C = Ce("ItemComponent"), E = Ce("GroupComponent"), k = Ce("computeItemKey"), N = Ce("isSeeking"),
|
|
6169
|
+
const y = Ce("EmptyPlaceholder"), R = Ce("ScrollSeekPlaceholder") || dv, S = Ce("ListComponent"), C = Ce("ItemComponent"), E = Ce("GroupComponent"), k = Ce("computeItemKey"), N = Ce("isSeeking"), _ = Ce("groupIndices").length > 0, A = Ce("alignToBottom"), L = Ce("initialItemFinalLocationReached"), F = e ? {} : {
|
|
6176
6170
|
boxSizing: "border-box",
|
|
6177
6171
|
...v ? {
|
|
6178
6172
|
display: "inline-block",
|
|
6179
6173
|
height: "100%",
|
|
6180
|
-
marginLeft: x !== 0 ? x :
|
|
6174
|
+
marginLeft: x !== 0 ? x : A ? "auto" : 0,
|
|
6181
6175
|
paddingLeft: t.offsetTop,
|
|
6182
6176
|
paddingRight: t.offsetBottom,
|
|
6183
6177
|
whiteSpace: "nowrap"
|
|
6184
6178
|
} : {
|
|
6185
|
-
marginTop: x !== 0 ? x :
|
|
6179
|
+
marginTop: x !== 0 ? x : A ? "auto" : 0,
|
|
6186
6180
|
paddingBottom: t.offsetBottom,
|
|
6187
6181
|
paddingTop: t.offsetTop
|
|
6188
6182
|
},
|
|
@@ -6230,7 +6224,7 @@ const cv = /* @__PURE__ */ Be(() => {
|
|
|
6230
6224
|
key: B,
|
|
6231
6225
|
style: v ? hv : Ou
|
|
6232
6226
|
},
|
|
6233
|
-
|
|
6227
|
+
_ ? c(j.index, j.groupIndex, j.data, u) : c(j.index, j.data, u)
|
|
6234
6228
|
);
|
|
6235
6229
|
})
|
|
6236
6230
|
}
|
|
@@ -6364,10 +6358,10 @@ const bv = ({ children: e }) => {
|
|
|
6364
6358
|
}, Cv = /* @__PURE__ */ z.memo(function(e) {
|
|
6365
6359
|
const t = Ce("useWindowScroll"), n = Ce("topItemsIndexes").length > 0, r = Ce("customScrollParent"), o = Ce("context");
|
|
6366
6360
|
return /* @__PURE__ */ l.jsxs(r || t ? Ev : Rv, { ...e, context: o, children: [
|
|
6367
|
-
n && /* @__PURE__ */ l.jsx(Sv, { children: /* @__PURE__ */ l.jsx(
|
|
6361
|
+
n && /* @__PURE__ */ l.jsx(Sv, { children: /* @__PURE__ */ l.jsx(kl, { showTopList: !0 }) }),
|
|
6368
6362
|
/* @__PURE__ */ l.jsxs(r || t ? yv : bv, { children: [
|
|
6369
6363
|
/* @__PURE__ */ l.jsx(vv, {}),
|
|
6370
|
-
/* @__PURE__ */ l.jsx(
|
|
6364
|
+
/* @__PURE__ */ l.jsx(kl, {}),
|
|
6371
6365
|
/* @__PURE__ */ l.jsx(wv, {})
|
|
6372
6366
|
] })
|
|
6373
6367
|
] });
|
|
@@ -6473,7 +6467,7 @@ const bv = ({ children: e }) => {
|
|
|
6473
6467
|
});
|
|
6474
6468
|
tt(Iu, Iv);
|
|
6475
6469
|
oa();
|
|
6476
|
-
const
|
|
6470
|
+
const Il = {
|
|
6477
6471
|
bottom: 0,
|
|
6478
6472
|
itemHeight: 0,
|
|
6479
6473
|
items: [],
|
|
@@ -6489,8 +6483,8 @@ const Nl = {
|
|
|
6489
6483
|
offsetBottom: 0,
|
|
6490
6484
|
offsetTop: 0,
|
|
6491
6485
|
top: 0
|
|
6492
|
-
}, { ceil:
|
|
6493
|
-
function
|
|
6486
|
+
}, { ceil: Nl, floor: Do, max: kr, min: Xs, round: Al } = Math;
|
|
6487
|
+
function _l(e, t, n) {
|
|
6494
6488
|
return Array.from({ length: t - e + 1 }).map((r, o) => ({ data: n === null ? null : n[o + e], index: o + e }));
|
|
6495
6489
|
}
|
|
6496
6490
|
function Av(e) {
|
|
@@ -6515,7 +6509,7 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6515
6509
|
{ customScrollParent: g, useWindowScroll: x, windowScrollContainerState: b, windowScrollTo: y, windowViewportRect: R },
|
|
6516
6510
|
S
|
|
6517
6511
|
]) => {
|
|
6518
|
-
const C = q(0), E = q(0), k = q(
|
|
6512
|
+
const C = q(0), E = q(0), k = q(Il), N = q({ height: 0, width: 0 }), _ = q({ height: 0, width: 0 }), A = Le(), L = Le(), F = q(0), j = q(null), V = q({ column: 0, row: 0 }), B = Le(), K = Le(), D = q(!1), I = q(0), M = q(!0), H = q(!1), Y = q(!1);
|
|
6519
6513
|
Ve(
|
|
6520
6514
|
$(
|
|
6521
6515
|
w,
|
|
@@ -6527,12 +6521,12 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6527
6521
|
}
|
|
6528
6522
|
), Ve(
|
|
6529
6523
|
$(
|
|
6530
|
-
ct(w, M,
|
|
6524
|
+
ct(w, M, _, N, I, H),
|
|
6531
6525
|
be(([O, G, te, ue, , ae]) => O && !G && te.height !== 0 && ue.height !== 0 && !ae)
|
|
6532
6526
|
),
|
|
6533
6527
|
([, , , , O]) => {
|
|
6534
6528
|
Ne(H, !0), ea(1, () => {
|
|
6535
|
-
Ne(
|
|
6529
|
+
Ne(A, O);
|
|
6536
6530
|
}), Ht($(u), () => {
|
|
6537
6531
|
Ne(t, [0, 0]), Ne(M, !0);
|
|
6538
6532
|
});
|
|
@@ -6551,7 +6545,7 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6551
6545
|
be(([, O]) => O != null)
|
|
6552
6546
|
),
|
|
6553
6547
|
([, O]) => {
|
|
6554
|
-
O && (Ne(N, O.viewport), Ne(
|
|
6548
|
+
O && (Ne(N, O.viewport), Ne(_, O.item), Ne(V, O.gap), O.scrollTop > 0 && (Ne(D, !0), Ht($(u, Mn(1)), (G) => {
|
|
6555
6549
|
Ne(D, !1);
|
|
6556
6550
|
}), Ne(c, { top: O.scrollTop })));
|
|
6557
6551
|
}
|
|
@@ -6565,7 +6559,7 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6565
6559
|
$(
|
|
6566
6560
|
ct(
|
|
6567
6561
|
we(N, ao),
|
|
6568
|
-
we(
|
|
6562
|
+
we(_, ao),
|
|
6569
6563
|
we(V, (O, G) => O && O.column === G.column && O.row === G.row),
|
|
6570
6564
|
we(u)
|
|
6571
6565
|
),
|
|
@@ -6583,7 +6577,7 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6583
6577
|
we(C),
|
|
6584
6578
|
r,
|
|
6585
6579
|
we(V, _v),
|
|
6586
|
-
we(
|
|
6580
|
+
we(_, ao),
|
|
6587
6581
|
we(N, ao),
|
|
6588
6582
|
we(j),
|
|
6589
6583
|
we(E),
|
|
@@ -6605,17 +6599,17 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6605
6599
|
je,
|
|
6606
6600
|
Ue
|
|
6607
6601
|
]) => {
|
|
6608
|
-
const { column:
|
|
6602
|
+
const { column: Q, row: X } = ue, { height: Ee, width: He } = ae, { width: ee } = $e;
|
|
6609
6603
|
if (Ie === 0 && (O === 0 || ee === 0))
|
|
6610
|
-
return
|
|
6604
|
+
return Il;
|
|
6611
6605
|
if (He === 0) {
|
|
6612
6606
|
const yt = ta(Ue, O), ln = yt + Math.max(Ie - 1, 0);
|
|
6613
|
-
return Av(
|
|
6607
|
+
return Av(_l(yt, ln, Ke));
|
|
6614
6608
|
}
|
|
6615
|
-
const re = Lu(ee, He,
|
|
6609
|
+
const re = Lu(ee, He, Q);
|
|
6616
6610
|
let he, pe;
|
|
6617
|
-
je ? G === 0 && te === 0 && Ie > 0 ? (he = 0, pe = Ie - 1) : (he = re * Do((G + X) / (Ee + X)), pe = re *
|
|
6618
|
-
const Re =
|
|
6611
|
+
je ? G === 0 && te === 0 && Ie > 0 ? (he = 0, pe = Ie - 1) : (he = re * Do((G + X) / (Ee + X)), pe = re * Nl((te + X) / (Ee + X)) - 1, pe = Xs(O - 1, kr(pe, re - 1)), he = Xs(pe, kr(0, he))) : (he = 0, pe = -1);
|
|
6612
|
+
const Re = _l(he, pe, Ke), { bottom: Me, top: qe } = jl($e, ue, ae, Re), Ge = Nl(O / re), Ye = Ge * Ee + (Ge - 1) * X - Me;
|
|
6619
6613
|
return { bottom: Me, itemHeight: Ee, items: Re, itemWidth: He, offsetBottom: Ye, offsetTop: qe, top: qe };
|
|
6620
6614
|
}
|
|
6621
6615
|
)
|
|
@@ -6630,30 +6624,30 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6630
6624
|
C
|
|
6631
6625
|
), de(
|
|
6632
6626
|
$(
|
|
6633
|
-
ct(N,
|
|
6627
|
+
ct(N, _, k, V),
|
|
6634
6628
|
be(([O, G, { items: te }]) => te.length > 0 && G.height !== 0 && O.height !== 0),
|
|
6635
6629
|
oe(([O, G, { items: te }, ue]) => {
|
|
6636
|
-
const { bottom: ae, top: $e } =
|
|
6630
|
+
const { bottom: ae, top: $e } = jl(O, ue, G, te);
|
|
6637
6631
|
return [$e, ae];
|
|
6638
6632
|
}),
|
|
6639
6633
|
et(Or)
|
|
6640
6634
|
),
|
|
6641
6635
|
t
|
|
6642
6636
|
);
|
|
6643
|
-
const
|
|
6637
|
+
const Z = q(!1);
|
|
6644
6638
|
de(
|
|
6645
6639
|
$(
|
|
6646
6640
|
u,
|
|
6647
|
-
Ae(
|
|
6641
|
+
Ae(Z),
|
|
6648
6642
|
oe(([O, G]) => G || O !== 0)
|
|
6649
6643
|
),
|
|
6650
|
-
|
|
6644
|
+
Z
|
|
6651
6645
|
);
|
|
6652
6646
|
const ie = At(
|
|
6653
6647
|
$(
|
|
6654
6648
|
ct(k, C),
|
|
6655
6649
|
be(([{ items: O }]) => O.length > 0),
|
|
6656
|
-
Ae(
|
|
6650
|
+
Ae(Z),
|
|
6657
6651
|
be(([[O, G], te]) => {
|
|
6658
6652
|
const ue = O.items[O.items.length - 1].index === G - 1;
|
|
6659
6653
|
return (te || O.bottom > 0 && O.itemHeight > 0 && O.offsetBottom === 0 && O.items.length === G) && ue;
|
|
@@ -6683,14 +6677,14 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6683
6677
|
);
|
|
6684
6678
|
de(Te, m.scrollSeekRangeChanged), de(
|
|
6685
6679
|
$(
|
|
6686
|
-
|
|
6687
|
-
Ae(N,
|
|
6680
|
+
A,
|
|
6681
|
+
Ae(N, _, C, V),
|
|
6688
6682
|
oe(([O, G, te, ue, ae]) => {
|
|
6689
6683
|
const $e = bu(O), { align: Ke, behavior: Ie, offset: je } = $e;
|
|
6690
6684
|
let Ue = $e.index;
|
|
6691
6685
|
Ue === "LAST" && (Ue = ue - 1), Ue = kr(0, Ue, Xs(ue - 1, Ue));
|
|
6692
|
-
let
|
|
6693
|
-
return Ke === "end" ?
|
|
6686
|
+
let Q = Ri(G, ae, te, Ue);
|
|
6687
|
+
return Ke === "end" ? Q = Al(Q - G.height + te.height) : Ke === "center" && (Q = Al(Q - G.height / 2 + te.height / 2)), je && (Q += je), { behavior: Ie, top: Q };
|
|
6694
6688
|
})
|
|
6695
6689
|
),
|
|
6696
6690
|
c
|
|
@@ -6718,14 +6712,14 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6718
6712
|
headerHeight: s,
|
|
6719
6713
|
increaseViewportBy: e,
|
|
6720
6714
|
initialItemCount: E,
|
|
6721
|
-
itemDimensions:
|
|
6715
|
+
itemDimensions: _,
|
|
6722
6716
|
overscan: n,
|
|
6723
6717
|
restoreStateFrom: K,
|
|
6724
6718
|
scrollBy: i,
|
|
6725
6719
|
scrollContainerState: a,
|
|
6726
6720
|
scrollHeight: L,
|
|
6727
6721
|
scrollTo: c,
|
|
6728
|
-
scrollToIndex:
|
|
6722
|
+
scrollToIndex: A,
|
|
6729
6723
|
scrollTop: u,
|
|
6730
6724
|
smoothScrollTargetReached: d,
|
|
6731
6725
|
totalCount: C,
|
|
@@ -6755,7 +6749,7 @@ const jv = /* @__PURE__ */ Be(
|
|
|
6755
6749
|
function Lu(e, t, n) {
|
|
6756
6750
|
return kr(1, Do((e + n) / (Do(t) + n)));
|
|
6757
6751
|
}
|
|
6758
|
-
function
|
|
6752
|
+
function jl(e, t, n, r) {
|
|
6759
6753
|
const { height: o } = n;
|
|
6760
6754
|
if (o === void 0 || r.length === 0)
|
|
6761
6755
|
return { bottom: 0, top: 0 };
|
|
@@ -6808,8 +6802,8 @@ const Pv = /* @__PURE__ */ Be(() => {
|
|
|
6808
6802
|
f({ height: R, width: S });
|
|
6809
6803
|
}
|
|
6810
6804
|
h({
|
|
6811
|
-
column:
|
|
6812
|
-
row:
|
|
6805
|
+
column: Pl("column-gap", getComputedStyle(x).columnGap, m),
|
|
6806
|
+
row: Pl("row-gap", getComputedStyle(x).rowGap, m)
|
|
6813
6807
|
});
|
|
6814
6808
|
},
|
|
6815
6809
|
[i, f, h, m]
|
|
@@ -6947,7 +6941,7 @@ const Pv = /* @__PURE__ */ Be(() => {
|
|
|
6947
6941
|
},
|
|
6948
6942
|
zv
|
|
6949
6943
|
), Bv = /* @__PURE__ */ Mu({ useEmitter: $u, useEmitterValue: rt, usePublisher: Lt }), Hv = /* @__PURE__ */ Du({ useEmitter: $u, useEmitterValue: rt, usePublisher: Lt });
|
|
6950
|
-
function
|
|
6944
|
+
function Pl(e, t, n) {
|
|
6951
6945
|
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Rt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
6952
6946
|
}
|
|
6953
6947
|
const Uv = Xo(
|
|
@@ -6967,7 +6961,7 @@ const Uv = Xo(
|
|
|
6967
6961
|
}
|
|
6968
6962
|
);
|
|
6969
6963
|
function Ei({ className: e, variant: t, ...n }) {
|
|
6970
|
-
return /* @__PURE__ */ l.jsx("div", { className:
|
|
6964
|
+
return /* @__PURE__ */ l.jsx("div", { className: J(Uv({ variant: t }), e), ...n });
|
|
6971
6965
|
}
|
|
6972
6966
|
function ce(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
6973
6967
|
return function(o) {
|
|
@@ -7089,7 +7083,7 @@ function qv({
|
|
|
7089
7083
|
function Gv(e) {
|
|
7090
7084
|
return typeof e == "function";
|
|
7091
7085
|
}
|
|
7092
|
-
function
|
|
7086
|
+
function Ol(e, t) {
|
|
7093
7087
|
if (typeof e == "function")
|
|
7094
7088
|
return e(t);
|
|
7095
7089
|
e != null && (e.current = t);
|
|
@@ -7098,14 +7092,14 @@ function aa(...e) {
|
|
|
7098
7092
|
return (t) => {
|
|
7099
7093
|
let n = !1;
|
|
7100
7094
|
const r = e.map((o) => {
|
|
7101
|
-
const s =
|
|
7095
|
+
const s = Ol(o, t);
|
|
7102
7096
|
return !n && typeof s == "function" && (n = !0), s;
|
|
7103
7097
|
});
|
|
7104
7098
|
if (n)
|
|
7105
7099
|
return () => {
|
|
7106
7100
|
for (let o = 0; o < r.length; o++) {
|
|
7107
7101
|
const s = r[o];
|
|
7108
|
-
typeof s == "function" ? s() :
|
|
7102
|
+
typeof s == "function" ? s() : Ol(e[o], null);
|
|
7109
7103
|
}
|
|
7110
7104
|
};
|
|
7111
7105
|
};
|
|
@@ -7315,11 +7309,11 @@ function ua(e) {
|
|
|
7315
7309
|
return e ? "open" : "closed";
|
|
7316
7310
|
}
|
|
7317
7311
|
var sw = zu;
|
|
7318
|
-
const
|
|
7312
|
+
const Ml = sw, Dl = Hu, Ir = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
7319
7313
|
"div",
|
|
7320
7314
|
{
|
|
7321
7315
|
ref: n,
|
|
7322
|
-
className:
|
|
7316
|
+
className: J(
|
|
7323
7317
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
7324
7318
|
e
|
|
7325
7319
|
),
|
|
@@ -7331,7 +7325,7 @@ const Nr = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
7331
7325
|
"div",
|
|
7332
7326
|
{
|
|
7333
7327
|
ref: n,
|
|
7334
|
-
className:
|
|
7328
|
+
className: J("flex flex-col space-y-1.5 p-6", e),
|
|
7335
7329
|
...t
|
|
7336
7330
|
}
|
|
7337
7331
|
));
|
|
@@ -7340,7 +7334,7 @@ const Ar = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
7340
7334
|
"h3",
|
|
7341
7335
|
{
|
|
7342
7336
|
ref: n,
|
|
7343
|
-
className:
|
|
7337
|
+
className: J(
|
|
7344
7338
|
"text-2xl font-semibold leading-none tracking-tight",
|
|
7345
7339
|
e
|
|
7346
7340
|
),
|
|
@@ -7352,18 +7346,18 @@ const Uu = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
7352
7346
|
"p",
|
|
7353
7347
|
{
|
|
7354
7348
|
ref: n,
|
|
7355
|
-
className:
|
|
7349
|
+
className: J("text-sm text-muted-foreground", e),
|
|
7356
7350
|
...t
|
|
7357
7351
|
}
|
|
7358
7352
|
));
|
|
7359
7353
|
Uu.displayName = "CardDescription";
|
|
7360
|
-
const So = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx("div", { ref: n, className:
|
|
7354
|
+
const So = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx("div", { ref: n, className: J("p-6 pt-0", e), ...t }));
|
|
7361
7355
|
So.displayName = "CardContent";
|
|
7362
7356
|
const Wu = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
7363
7357
|
"div",
|
|
7364
7358
|
{
|
|
7365
7359
|
ref: n,
|
|
7366
|
-
className:
|
|
7360
|
+
className: J("flex items-center p-6 pt-0", e),
|
|
7367
7361
|
...t
|
|
7368
7362
|
}
|
|
7369
7363
|
));
|
|
@@ -7402,13 +7396,13 @@ const Ku = /[&<>"']/, aw = new RegExp(Ku.source, "g"), qu = /[<>"']|&(?!(#\d{1,7
|
|
|
7402
7396
|
">": ">",
|
|
7403
7397
|
'"': """,
|
|
7404
7398
|
"'": "'"
|
|
7405
|
-
},
|
|
7399
|
+
}, Ll = (e) => cw[e];
|
|
7406
7400
|
function ht(e, t) {
|
|
7407
7401
|
if (t) {
|
|
7408
7402
|
if (Ku.test(e))
|
|
7409
|
-
return e.replace(aw,
|
|
7403
|
+
return e.replace(aw, Ll);
|
|
7410
7404
|
} else if (qu.test(e))
|
|
7411
|
-
return e.replace(lw,
|
|
7405
|
+
return e.replace(lw, Ll);
|
|
7412
7406
|
return e;
|
|
7413
7407
|
}
|
|
7414
7408
|
const uw = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
|
|
@@ -7425,7 +7419,7 @@ function Ze(e, t) {
|
|
|
7425
7419
|
return n;
|
|
7426
7420
|
}
|
|
7427
7421
|
const fw = /[^\w:]/g, hw = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
|
|
7428
|
-
function
|
|
7422
|
+
function $l(e, t, n) {
|
|
7429
7423
|
if (e) {
|
|
7430
7424
|
let r;
|
|
7431
7425
|
try {
|
|
@@ -7452,7 +7446,7 @@ function xw(e, t) {
|
|
|
7452
7446
|
}
|
|
7453
7447
|
const Lo = { exec: function() {
|
|
7454
7448
|
} };
|
|
7455
|
-
function
|
|
7449
|
+
function Fl(e, t) {
|
|
7456
7450
|
const n = e.replace(/\|/g, (s, i, a) => {
|
|
7457
7451
|
let c = !1, u = i;
|
|
7458
7452
|
for (; --u >= 0 && a[u] === "\\"; ) c = !c;
|
|
@@ -7500,7 +7494,7 @@ function vw(e, t) {
|
|
|
7500
7494
|
function ww(e) {
|
|
7501
7495
|
e && e.sanitize && !e.silent && console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options");
|
|
7502
7496
|
}
|
|
7503
|
-
function
|
|
7497
|
+
function zl(e, t) {
|
|
7504
7498
|
if (t < 1)
|
|
7505
7499
|
return "";
|
|
7506
7500
|
let n = "";
|
|
@@ -7508,7 +7502,7 @@ function Bl(e, t) {
|
|
|
7508
7502
|
t & 1 && (n += e), t >>= 1, e += e;
|
|
7509
7503
|
return n + e;
|
|
7510
7504
|
}
|
|
7511
|
-
function
|
|
7505
|
+
function Bl(e, t, n, r) {
|
|
7512
7506
|
const o = t.href, s = t.title ? ht(t.title) : null, i = e[1].replace(/\\([\[\]])/g, "$1");
|
|
7513
7507
|
if (e[0].charAt(0) !== "!") {
|
|
7514
7508
|
r.state.inLink = !0;
|
|
@@ -7712,7 +7706,7 @@ class da {
|
|
|
7712
7706
|
if (n) {
|
|
7713
7707
|
const r = {
|
|
7714
7708
|
type: "table",
|
|
7715
|
-
header:
|
|
7709
|
+
header: Fl(n[1]).map((o) => ({ text: o })),
|
|
7716
7710
|
align: n[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
|
|
7717
7711
|
rows: n[3] && n[3].trim() ? n[3].replace(/\n[ \t]*$/, "").split(`
|
|
7718
7712
|
`) : []
|
|
@@ -7723,7 +7717,7 @@ class da {
|
|
|
7723
7717
|
for (s = 0; s < o; s++)
|
|
7724
7718
|
/^ *-+: *$/.test(r.align[s]) ? r.align[s] = "right" : /^ *:-+: *$/.test(r.align[s]) ? r.align[s] = "center" : /^ *:-+ *$/.test(r.align[s]) ? r.align[s] = "left" : r.align[s] = null;
|
|
7725
7719
|
for (o = r.rows.length, s = 0; s < o; s++)
|
|
7726
|
-
r.rows[s] =
|
|
7720
|
+
r.rows[s] = Fl(r.rows[s], r.header.length).map((u) => ({ text: u }));
|
|
7727
7721
|
for (o = r.header.length, i = 0; i < o; i++)
|
|
7728
7722
|
r.header[i].tokens = this.lexer.inline(r.header[i].text);
|
|
7729
7723
|
for (o = r.rows.length, i = 0; i < o; i++)
|
|
@@ -7810,7 +7804,7 @@ class da {
|
|
|
7810
7804
|
i && (o = i[1], s = i[3]);
|
|
7811
7805
|
} else
|
|
7812
7806
|
s = n[3] ? n[3].slice(1, -1) : "";
|
|
7813
|
-
return o = o.trim(), /^</.test(o) && (this.options.pedantic && !/>$/.test(r) ? o = o.slice(1) : o = o.slice(1, -1)),
|
|
7807
|
+
return o = o.trim(), /^</.test(o) && (this.options.pedantic && !/>$/.test(r) ? o = o.slice(1) : o = o.slice(1, -1)), Bl(n, {
|
|
7814
7808
|
href: o && o.replace(this.rules.inline._escapes, "$1"),
|
|
7815
7809
|
title: s && s.replace(this.rules.inline._escapes, "$1")
|
|
7816
7810
|
}, n[0], this.lexer);
|
|
@@ -7828,7 +7822,7 @@ class da {
|
|
|
7828
7822
|
text: s
|
|
7829
7823
|
};
|
|
7830
7824
|
}
|
|
7831
|
-
return
|
|
7825
|
+
return Bl(r, o, r[0], this.lexer);
|
|
7832
7826
|
}
|
|
7833
7827
|
}
|
|
7834
7828
|
emStrong(t, n, r = "") {
|
|
@@ -8089,7 +8083,7 @@ se.breaks = {
|
|
|
8089
8083
|
function yw(e) {
|
|
8090
8084
|
return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
|
|
8091
8085
|
}
|
|
8092
|
-
function
|
|
8086
|
+
function Hl(e) {
|
|
8093
8087
|
let t = "", n, r;
|
|
8094
8088
|
const o = e.length;
|
|
8095
8089
|
for (n = 0; n < o; n++)
|
|
@@ -8244,10 +8238,10 @@ class xn {
|
|
|
8244
8238
|
const d = Object.keys(this.tokens.links);
|
|
8245
8239
|
if (d.length > 0)
|
|
8246
8240
|
for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(i)) != null; )
|
|
8247
|
-
d.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (i = i.slice(0, a.index) + "[" +
|
|
8241
|
+
d.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (i = i.slice(0, a.index) + "[" + zl("a", a[0].length - 2) + "]" + i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
8248
8242
|
}
|
|
8249
8243
|
for (; (a = this.tokenizer.rules.inline.blockSkip.exec(i)) != null; )
|
|
8250
|
-
i = i.slice(0, a.index) + "[" +
|
|
8244
|
+
i = i.slice(0, a.index) + "[" + zl("a", a[0].length - 2) + "]" + i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
8251
8245
|
for (; (a = this.tokenizer.rules.inline.escapedEmSt.exec(i)) != null; )
|
|
8252
8246
|
i = i.slice(0, a.index + a[0].length - 2) + "++" + i.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex), this.tokenizer.rules.inline.escapedEmSt.lastIndex--;
|
|
8253
8247
|
for (; t; )
|
|
@@ -8284,11 +8278,11 @@ class xn {
|
|
|
8284
8278
|
t = t.substring(r.raw.length), n.push(r);
|
|
8285
8279
|
continue;
|
|
8286
8280
|
}
|
|
8287
|
-
if (r = this.tokenizer.autolink(t,
|
|
8281
|
+
if (r = this.tokenizer.autolink(t, Hl)) {
|
|
8288
8282
|
t = t.substring(r.raw.length), n.push(r);
|
|
8289
8283
|
continue;
|
|
8290
8284
|
}
|
|
8291
|
-
if (!this.state.inLink && (r = this.tokenizer.url(t,
|
|
8285
|
+
if (!this.state.inLink && (r = this.tokenizer.url(t, Hl))) {
|
|
8292
8286
|
t = t.substring(r.raw.length), n.push(r);
|
|
8293
8287
|
continue;
|
|
8294
8288
|
}
|
|
@@ -8443,7 +8437,7 @@ ${t}</tr>
|
|
|
8443
8437
|
* @param {string} text
|
|
8444
8438
|
*/
|
|
8445
8439
|
link(t, n, r) {
|
|
8446
|
-
if (t =
|
|
8440
|
+
if (t = $l(this.options.sanitize, this.options.baseUrl, t), t === null)
|
|
8447
8441
|
return r;
|
|
8448
8442
|
let o = '<a href="' + t + '"';
|
|
8449
8443
|
return n && (o += ' title="' + n + '"'), o += ">" + r + "</a>", o;
|
|
@@ -8454,7 +8448,7 @@ ${t}</tr>
|
|
|
8454
8448
|
* @param {string} text
|
|
8455
8449
|
*/
|
|
8456
8450
|
image(t, n, r) {
|
|
8457
|
-
if (t =
|
|
8451
|
+
if (t = $l(this.options.sanitize, this.options.baseUrl, t), t === null)
|
|
8458
8452
|
return r;
|
|
8459
8453
|
let o = `<img src="${t}" alt="${r}"`;
|
|
8460
8454
|
return n && (o += ` title="${n}"`), o += this.options.xhtml ? "/>" : ">", o;
|
|
@@ -8917,7 +8911,7 @@ me.walkTokens;
|
|
|
8917
8911
|
me.parseInline;
|
|
8918
8912
|
vn.parse;
|
|
8919
8913
|
xn.lex;
|
|
8920
|
-
function
|
|
8914
|
+
function Ul({
|
|
8921
8915
|
content: e,
|
|
8922
8916
|
className: t = "",
|
|
8923
8917
|
allowHtml: n = !1
|
|
@@ -8936,7 +8930,7 @@ function Wl({
|
|
|
8936
8930
|
return /* @__PURE__ */ l.jsx(
|
|
8937
8931
|
"div",
|
|
8938
8932
|
{
|
|
8939
|
-
className:
|
|
8933
|
+
className: J("markdown prose max-w-none break-words dark:prose-invert", t),
|
|
8940
8934
|
dangerouslySetInnerHTML: { __html: r }
|
|
8941
8935
|
}
|
|
8942
8936
|
);
|
|
@@ -8954,7 +8948,7 @@ async function Zu(e, t) {
|
|
|
8954
8948
|
maxBodyLength: 1 / 0
|
|
8955
8949
|
});
|
|
8956
8950
|
}
|
|
8957
|
-
async function
|
|
8951
|
+
async function Wl(e, t) {
|
|
8958
8952
|
return await (await Zu(`/chat/files/${e}/view`, t)).text();
|
|
8959
8953
|
}
|
|
8960
8954
|
async function Cw(e, t) {
|
|
@@ -8977,7 +8971,7 @@ let Js = 0;
|
|
|
8977
8971
|
function kw() {
|
|
8978
8972
|
return Js = (Js + 1) % Number.MAX_SAFE_INTEGER, Js.toString();
|
|
8979
8973
|
}
|
|
8980
|
-
const Zs = /* @__PURE__ */ new Map(),
|
|
8974
|
+
const Zs = /* @__PURE__ */ new Map(), Vl = (e) => {
|
|
8981
8975
|
if (Zs.has(e))
|
|
8982
8976
|
return;
|
|
8983
8977
|
const t = setTimeout(() => {
|
|
@@ -9003,8 +8997,8 @@ const Zs = /* @__PURE__ */ new Map(), Kl = (e) => {
|
|
|
9003
8997
|
};
|
|
9004
8998
|
case "DISMISS_TOAST": {
|
|
9005
8999
|
const { toastId: n } = t;
|
|
9006
|
-
return n ?
|
|
9007
|
-
|
|
9000
|
+
return n ? Vl(n) : e.toasts.forEach((r) => {
|
|
9001
|
+
Vl(r.id);
|
|
9008
9002
|
}), {
|
|
9009
9003
|
...e,
|
|
9010
9004
|
toasts: e.toasts.map(
|
|
@@ -9081,7 +9075,7 @@ function Aw(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
9081
9075
|
return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
|
|
9082
9076
|
}, [n, t]);
|
|
9083
9077
|
}
|
|
9084
|
-
var _w = "DismissableLayer", ki = "dismissableLayer.update", jw = "dismissableLayer.pointerDownOutside", Pw = "dismissableLayer.focusOutside",
|
|
9078
|
+
var _w = "DismissableLayer", ki = "dismissableLayer.update", jw = "dismissableLayer.pointerDownOutside", Pw = "dismissableLayer.focusOutside", Kl, Qu = p.createContext({
|
|
9085
9079
|
layers: /* @__PURE__ */ new Set(),
|
|
9086
9080
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
9087
9081
|
branches: /* @__PURE__ */ new Set()
|
|
@@ -9096,21 +9090,21 @@ var _w = "DismissableLayer", ki = "dismissableLayer.update", jw = "dismissableLa
|
|
|
9096
9090
|
onDismiss: a,
|
|
9097
9091
|
...c
|
|
9098
9092
|
} = e, u = p.useContext(Qu), [d, f] = p.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, m] = p.useState({}), w = Oe(t, (E) => f(E)), v = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(g), b = d ? v.indexOf(d) : -1, y = u.layersWithOutsidePointerEventsDisabled.size > 0, R = b >= x, S = Dw((E) => {
|
|
9099
|
-
const k = E.target, N = [...u.branches].some((
|
|
9093
|
+
const k = E.target, N = [...u.branches].some((_) => _.contains(k));
|
|
9100
9094
|
!R || N || (o == null || o(E), i == null || i(E), E.defaultPrevented || a == null || a());
|
|
9101
9095
|
}, h), C = Lw((E) => {
|
|
9102
9096
|
const k = E.target;
|
|
9103
|
-
[...u.branches].some((
|
|
9097
|
+
[...u.branches].some((_) => _.contains(k)) || (s == null || s(E), i == null || i(E), E.defaultPrevented || a == null || a());
|
|
9104
9098
|
}, h);
|
|
9105
9099
|
return Aw((E) => {
|
|
9106
9100
|
b === u.layers.size - 1 && (r == null || r(E), !E.defaultPrevented && a && (E.preventDefault(), a()));
|
|
9107
9101
|
}, h), p.useEffect(() => {
|
|
9108
9102
|
if (d)
|
|
9109
|
-
return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
9110
|
-
n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents =
|
|
9103
|
+
return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (Kl = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), ql(), () => {
|
|
9104
|
+
n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = Kl);
|
|
9111
9105
|
};
|
|
9112
9106
|
}, [d, h, n, u]), p.useEffect(() => () => {
|
|
9113
|
-
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d),
|
|
9107
|
+
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), ql());
|
|
9114
9108
|
}, [d, u]), p.useEffect(() => {
|
|
9115
9109
|
const E = () => m({});
|
|
9116
9110
|
return document.addEventListener(ki, E), () => document.removeEventListener(ki, E);
|
|
@@ -9189,7 +9183,7 @@ function Lw(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
9189
9183
|
onBlurCapture: () => r.current = !1
|
|
9190
9184
|
};
|
|
9191
9185
|
}
|
|
9192
|
-
function
|
|
9186
|
+
function ql() {
|
|
9193
9187
|
const e = new CustomEvent(ki);
|
|
9194
9188
|
document.dispatchEvent(e);
|
|
9195
9189
|
}
|
|
@@ -9197,7 +9191,7 @@ function ed(e, t, n, { discrete: r }) {
|
|
|
9197
9191
|
const o = n.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
9198
9192
|
t && o.addEventListener(e, t, { once: !0 }), r ? Fu(o, s) : o.dispatchEvent(s);
|
|
9199
9193
|
}
|
|
9200
|
-
var Qs = "focusScope.autoFocusOnMount", ei = "focusScope.autoFocusOnUnmount",
|
|
9194
|
+
var Qs = "focusScope.autoFocusOnMount", ei = "focusScope.autoFocusOnUnmount", Gl = { bubbles: !1, cancelable: !0 }, $w = "FocusScope", ds = p.forwardRef((e, t) => {
|
|
9201
9195
|
const {
|
|
9202
9196
|
loop: n = !1,
|
|
9203
9197
|
trapped: r = !1,
|
|
@@ -9236,16 +9230,16 @@ var Qs = "focusScope.autoFocusOnMount", ei = "focusScope.autoFocusOnUnmount", Yl
|
|
|
9236
9230
|
}
|
|
9237
9231
|
}, [r, a, m.paused]), p.useEffect(() => {
|
|
9238
9232
|
if (a) {
|
|
9239
|
-
|
|
9233
|
+
Xl.add(m);
|
|
9240
9234
|
const v = document.activeElement;
|
|
9241
9235
|
if (!a.contains(v)) {
|
|
9242
|
-
const x = new CustomEvent(Qs,
|
|
9236
|
+
const x = new CustomEvent(Qs, Gl);
|
|
9243
9237
|
a.addEventListener(Qs, u), a.dispatchEvent(x), x.defaultPrevented || (Fw(Ww(td(a)), { select: !0 }), document.activeElement === v && pn(a));
|
|
9244
9238
|
}
|
|
9245
9239
|
return () => {
|
|
9246
9240
|
a.removeEventListener(Qs, u), setTimeout(() => {
|
|
9247
|
-
const x = new CustomEvent(ei,
|
|
9248
|
-
a.addEventListener(ei, d), a.dispatchEvent(x), x.defaultPrevented || pn(v ?? document.body, { select: !0 }), a.removeEventListener(ei, d),
|
|
9241
|
+
const x = new CustomEvent(ei, Gl);
|
|
9242
|
+
a.addEventListener(ei, d), a.dispatchEvent(x), x.defaultPrevented || pn(v ?? document.body, { select: !0 }), a.removeEventListener(ei, d), Xl.remove(m);
|
|
9249
9243
|
}, 0);
|
|
9250
9244
|
};
|
|
9251
9245
|
}
|
|
@@ -9270,7 +9264,7 @@ function Fw(e, { select: t = !1 } = {}) {
|
|
|
9270
9264
|
if (pn(r, { select: t }), document.activeElement !== n) return;
|
|
9271
9265
|
}
|
|
9272
9266
|
function zw(e) {
|
|
9273
|
-
const t = td(e), n =
|
|
9267
|
+
const t = td(e), n = Yl(t, e), r = Yl(t.reverse(), e);
|
|
9274
9268
|
return [n, r];
|
|
9275
9269
|
}
|
|
9276
9270
|
function td(e) {
|
|
@@ -9283,7 +9277,7 @@ function td(e) {
|
|
|
9283
9277
|
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
9284
9278
|
return t;
|
|
9285
9279
|
}
|
|
9286
|
-
function
|
|
9280
|
+
function Yl(e, t) {
|
|
9287
9281
|
for (const n of e)
|
|
9288
9282
|
if (!Bw(n, { upTo: t })) return n;
|
|
9289
9283
|
}
|
|
@@ -9305,21 +9299,21 @@ function pn(e, { select: t = !1 } = {}) {
|
|
|
9305
9299
|
e.focus({ preventScroll: !0 }), e !== n && Hw(e) && t && e.select();
|
|
9306
9300
|
}
|
|
9307
9301
|
}
|
|
9308
|
-
var
|
|
9302
|
+
var Xl = Uw();
|
|
9309
9303
|
function Uw() {
|
|
9310
9304
|
let e = [];
|
|
9311
9305
|
return {
|
|
9312
9306
|
add(t) {
|
|
9313
9307
|
const n = e[0];
|
|
9314
|
-
t !== n && (n == null || n.pause()), e =
|
|
9308
|
+
t !== n && (n == null || n.pause()), e = Jl(e, t), e.unshift(t);
|
|
9315
9309
|
},
|
|
9316
9310
|
remove(t) {
|
|
9317
9311
|
var n;
|
|
9318
|
-
e =
|
|
9312
|
+
e = Jl(e, t), (n = e[0]) == null || n.resume();
|
|
9319
9313
|
}
|
|
9320
9314
|
};
|
|
9321
9315
|
}
|
|
9322
|
-
function
|
|
9316
|
+
function Jl(e, t) {
|
|
9323
9317
|
const n = [...e], r = n.indexOf(t);
|
|
9324
9318
|
return r !== -1 && n.splice(r, 1), n;
|
|
9325
9319
|
}
|
|
@@ -9331,19 +9325,19 @@ var Vw = "Portal", fs = p.forwardRef((e, t) => {
|
|
|
9331
9325
|
const { container: n, ...r } = e, [o, s] = p.useState(!1);
|
|
9332
9326
|
dt(() => s(!0), []);
|
|
9333
9327
|
const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
|
|
9334
|
-
return i ?
|
|
9328
|
+
return i ? Ec.createPortal(/* @__PURE__ */ l.jsx(Se.div, { ...r, ref: t }), i) : null;
|
|
9335
9329
|
});
|
|
9336
9330
|
fs.displayName = Vw;
|
|
9337
9331
|
var ti = 0;
|
|
9338
9332
|
function pa() {
|
|
9339
9333
|
p.useEffect(() => {
|
|
9340
9334
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
9341
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ??
|
|
9335
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? Zl()), document.body.insertAdjacentElement("beforeend", e[1] ?? Zl()), ti++, () => {
|
|
9342
9336
|
ti === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), ti--;
|
|
9343
9337
|
};
|
|
9344
9338
|
}, []);
|
|
9345
9339
|
}
|
|
9346
|
-
function
|
|
9340
|
+
function Zl() {
|
|
9347
9341
|
const e = document.createElement("span");
|
|
9348
9342
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
9349
9343
|
}
|
|
@@ -9394,7 +9388,7 @@ function Yw(e, t) {
|
|
|
9394
9388
|
})[0];
|
|
9395
9389
|
return n.callback = t, n.facade;
|
|
9396
9390
|
}
|
|
9397
|
-
var Xw = typeof window < "u" ? p.useLayoutEffect : p.useEffect,
|
|
9391
|
+
var Xw = typeof window < "u" ? p.useLayoutEffect : p.useEffect, Ql = /* @__PURE__ */ new WeakMap();
|
|
9398
9392
|
function Jw(e, t) {
|
|
9399
9393
|
var n = Yw(null, function(r) {
|
|
9400
9394
|
return e.forEach(function(o) {
|
|
@@ -9402,7 +9396,7 @@ function Jw(e, t) {
|
|
|
9402
9396
|
});
|
|
9403
9397
|
});
|
|
9404
9398
|
return Xw(function() {
|
|
9405
|
-
var r =
|
|
9399
|
+
var r = Ql.get(n);
|
|
9406
9400
|
if (r) {
|
|
9407
9401
|
var o = new Set(r), s = new Set(e), i = n.current;
|
|
9408
9402
|
o.forEach(function(a) {
|
|
@@ -9411,7 +9405,7 @@ function Jw(e, t) {
|
|
|
9411
9405
|
o.has(a) || ni(a, i);
|
|
9412
9406
|
});
|
|
9413
9407
|
}
|
|
9414
|
-
|
|
9408
|
+
Ql.set(n, e);
|
|
9415
9409
|
}, [e]), n;
|
|
9416
9410
|
}
|
|
9417
9411
|
function Zw(e) {
|
|
@@ -9621,13 +9615,13 @@ var ib = function() {
|
|
|
9621
9615
|
`).concat(Gw, ": ").concat(a, `px;
|
|
9622
9616
|
}
|
|
9623
9617
|
`);
|
|
9624
|
-
},
|
|
9618
|
+
}, ec = function() {
|
|
9625
9619
|
var e = parseInt(document.body.getAttribute(Qn) || "0", 10);
|
|
9626
9620
|
return isFinite(e) ? e : 0;
|
|
9627
9621
|
}, hb = function() {
|
|
9628
9622
|
p.useEffect(function() {
|
|
9629
|
-
return document.body.setAttribute(Qn, (
|
|
9630
|
-
var e =
|
|
9623
|
+
return document.body.setAttribute(Qn, (ec() + 1).toString()), function() {
|
|
9624
|
+
var e = ec() - 1;
|
|
9631
9625
|
e <= 0 ? document.body.removeAttribute(Qn) : document.body.setAttribute(Qn, e.toString());
|
|
9632
9626
|
};
|
|
9633
9627
|
}, []);
|
|
@@ -9665,7 +9659,7 @@ var qn = Ii ? { passive: !1 } : !1, mb = function(e) {
|
|
|
9665
9659
|
return id(e, "overflowY");
|
|
9666
9660
|
}, xb = function(e) {
|
|
9667
9661
|
return id(e, "overflowX");
|
|
9668
|
-
},
|
|
9662
|
+
}, tc = function(e, t) {
|
|
9669
9663
|
var n = t.ownerDocument, r = t;
|
|
9670
9664
|
do {
|
|
9671
9665
|
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
@@ -9715,9 +9709,9 @@ var qn = Ii ? { passive: !1 } : !1, mb = function(e) {
|
|
|
9715
9709
|
return (d && Math.abs(f) < 1 || !d && Math.abs(h) < 1) && (u = !0), u;
|
|
9716
9710
|
}, fo = function(e) {
|
|
9717
9711
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
9718
|
-
},
|
|
9712
|
+
}, nc = function(e) {
|
|
9719
9713
|
return [e.deltaX, e.deltaY];
|
|
9720
|
-
},
|
|
9714
|
+
}, rc = function(e) {
|
|
9721
9715
|
return e && "current" in e ? e.current : e;
|
|
9722
9716
|
}, Sb = function(e, t) {
|
|
9723
9717
|
return e[0] === t[0] && e[1] === t[1];
|
|
@@ -9734,7 +9728,7 @@ function Rb(e) {
|
|
|
9734
9728
|
}, [e]), p.useEffect(function() {
|
|
9735
9729
|
if (e.inert) {
|
|
9736
9730
|
document.body.classList.add("block-interactivity-".concat(o));
|
|
9737
|
-
var v = Kw([e.lockRef.current], (e.shards || []).map(
|
|
9731
|
+
var v = Kw([e.lockRef.current], (e.shards || []).map(rc), !0).filter(Boolean);
|
|
9738
9732
|
return v.forEach(function(g) {
|
|
9739
9733
|
return g.classList.add("allow-interactivity-".concat(o));
|
|
9740
9734
|
}), function() {
|
|
@@ -9750,10 +9744,10 @@ function Rb(e) {
|
|
|
9750
9744
|
var x = fo(v), b = n.current, y = "deltaX" in v ? v.deltaX : b[0] - x[0], R = "deltaY" in v ? v.deltaY : b[1] - x[1], S, C = v.target, E = Math.abs(y) > Math.abs(R) ? "h" : "v";
|
|
9751
9745
|
if ("touches" in v && E === "h" && C.type === "range")
|
|
9752
9746
|
return !1;
|
|
9753
|
-
var k =
|
|
9747
|
+
var k = tc(E, C);
|
|
9754
9748
|
if (!k)
|
|
9755
9749
|
return !0;
|
|
9756
|
-
if (k ? S = E : (S = E === "v" ? "h" : "v", k =
|
|
9750
|
+
if (k ? S = E : (S = E === "v" ? "h" : "v", k = tc(E, C)), !k)
|
|
9757
9751
|
return !1;
|
|
9758
9752
|
if (!r.current && "changedTouches" in v && (y || R) && (r.current = S), !S)
|
|
9759
9753
|
return !0;
|
|
@@ -9762,7 +9756,7 @@ function Rb(e) {
|
|
|
9762
9756
|
}, []), c = p.useCallback(function(v) {
|
|
9763
9757
|
var g = v;
|
|
9764
9758
|
if (!(!Gn.length || Gn[Gn.length - 1] !== s)) {
|
|
9765
|
-
var x = "deltaY" in g ?
|
|
9759
|
+
var x = "deltaY" in g ? nc(g) : fo(g), b = t.current.filter(function(S) {
|
|
9766
9760
|
return S.name === g.type && (S.target === g.target || g.target === S.shadowParent) && Sb(S.delta, x);
|
|
9767
9761
|
})[0];
|
|
9768
9762
|
if (b && b.should) {
|
|
@@ -9770,7 +9764,7 @@ function Rb(e) {
|
|
|
9770
9764
|
return;
|
|
9771
9765
|
}
|
|
9772
9766
|
if (!b) {
|
|
9773
|
-
var y = (i.current.shards || []).map(
|
|
9767
|
+
var y = (i.current.shards || []).map(rc).filter(Boolean).filter(function(S) {
|
|
9774
9768
|
return S.contains(g.target);
|
|
9775
9769
|
}), R = y.length > 0 ? a(g, y[0]) : !i.current.noIsolation;
|
|
9776
9770
|
R && g.cancelable && g.preventDefault();
|
|
@@ -9786,7 +9780,7 @@ function Rb(e) {
|
|
|
9786
9780
|
}, []), d = p.useCallback(function(v) {
|
|
9787
9781
|
n.current = fo(v), r.current = void 0;
|
|
9788
9782
|
}, []), f = p.useCallback(function(v) {
|
|
9789
|
-
u(v.type,
|
|
9783
|
+
u(v.type, nc(v), v.target, a(v, e.lockRef.current));
|
|
9790
9784
|
}, []), h = p.useCallback(function(v) {
|
|
9791
9785
|
u(v.type, fo(v), v.target, a(v, e.lockRef.current));
|
|
9792
9786
|
}, []);
|
|
@@ -10097,7 +10091,7 @@ const Bb = Ed, Hb = kd, Nd = p.forwardRef(({ className: e, ...t }, n) => /* @__P
|
|
|
10097
10091
|
gs,
|
|
10098
10092
|
{
|
|
10099
10093
|
ref: n,
|
|
10100
|
-
className:
|
|
10094
|
+
className: J(
|
|
10101
10095
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
10102
10096
|
e
|
|
10103
10097
|
),
|
|
@@ -10127,7 +10121,7 @@ const Ad = p.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
|
10127
10121
|
xs,
|
|
10128
10122
|
{
|
|
10129
10123
|
ref: r,
|
|
10130
|
-
className:
|
|
10124
|
+
className: J(
|
|
10131
10125
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
10132
10126
|
e
|
|
10133
10127
|
),
|
|
@@ -10151,7 +10145,7 @@ const _d = ({
|
|
|
10151
10145
|
}) => /* @__PURE__ */ l.jsx(
|
|
10152
10146
|
"div",
|
|
10153
10147
|
{
|
|
10154
|
-
className:
|
|
10148
|
+
className: J(
|
|
10155
10149
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
10156
10150
|
e
|
|
10157
10151
|
),
|
|
@@ -10163,7 +10157,7 @@ const jd = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
10163
10157
|
jn,
|
|
10164
10158
|
{
|
|
10165
10159
|
ref: n,
|
|
10166
|
-
className:
|
|
10160
|
+
className: J(
|
|
10167
10161
|
"text-lg font-semibold leading-none tracking-tight",
|
|
10168
10162
|
e
|
|
10169
10163
|
),
|
|
@@ -10175,7 +10169,7 @@ const Ub = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
10175
10169
|
vs,
|
|
10176
10170
|
{
|
|
10177
10171
|
ref: n,
|
|
10178
|
-
className:
|
|
10172
|
+
className: J("text-sm text-muted-foreground", e),
|
|
10179
10173
|
...t
|
|
10180
10174
|
}
|
|
10181
10175
|
));
|
|
@@ -10185,7 +10179,7 @@ function Wb({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
10185
10179
|
if (n) {
|
|
10186
10180
|
i(!0), d(null), c(null);
|
|
10187
10181
|
try {
|
|
10188
|
-
const x = await
|
|
10182
|
+
const x = await Wl(n);
|
|
10189
10183
|
c(x);
|
|
10190
10184
|
} catch (x) {
|
|
10191
10185
|
console.error("Failed to load file:", x), d(x instanceof Error ? x.message : "Failed to load file");
|
|
@@ -10207,13 +10201,13 @@ function Wb({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
10207
10201
|
}, w = async () => {
|
|
10208
10202
|
if (n)
|
|
10209
10203
|
try {
|
|
10210
|
-
const x = await
|
|
10204
|
+
const x = await Wl(n), b = new Blob([x], { type: o }), y = URL.createObjectURL(b);
|
|
10211
10205
|
window.open(y, "_blank"), URL.revokeObjectURL(y);
|
|
10212
10206
|
} catch (x) {
|
|
10213
10207
|
console.error("Failed to open file externally:", x), f({ title: "Failed to open file", description: String(x), variant: "destructive" });
|
|
10214
10208
|
}
|
|
10215
10209
|
}, v = () => s ? /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-center py-12", children: [
|
|
10216
|
-
/* @__PURE__ */ l.jsx(
|
|
10210
|
+
/* @__PURE__ */ l.jsx(Tc, { className: "h-8 w-8 animate-spin mr-3" }),
|
|
10217
10211
|
/* @__PURE__ */ l.jsx("span", { children: "Loading file..." })
|
|
10218
10212
|
] }) : u ? /* @__PURE__ */ l.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
10219
10213
|
/* @__PURE__ */ l.jsx("div", { className: "text-red-500 mb-4", children: "⚠️" }),
|
|
@@ -10288,7 +10282,7 @@ function Wb({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
10288
10282
|
/* @__PURE__ */ l.jsx("div", { className: "flex-1 overflow-hidden", children: v() })
|
|
10289
10283
|
] }) });
|
|
10290
10284
|
}
|
|
10291
|
-
function
|
|
10285
|
+
function oc(e) {
|
|
10292
10286
|
const t = e == null ? void 0 : e.trim();
|
|
10293
10287
|
if (!t || !(t.startsWith("{") || t.startsWith("["))) return null;
|
|
10294
10288
|
try {
|
|
@@ -10422,7 +10416,7 @@ function Yb(e) {
|
|
|
10422
10416
|
function Xb(e) {
|
|
10423
10417
|
return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
|
|
10424
10418
|
}
|
|
10425
|
-
function
|
|
10419
|
+
function sc(e) {
|
|
10426
10420
|
const t = e.updatedAt ?? e.createdAt ?? "", n = Array.isArray(e.content) ? e.content.map((r) => {
|
|
10427
10421
|
switch (r.type) {
|
|
10428
10422
|
case "text":
|
|
@@ -10450,7 +10444,7 @@ function Jb({ className: e }) {
|
|
|
10450
10444
|
"span",
|
|
10451
10445
|
{
|
|
10452
10446
|
"aria-live": "polite",
|
|
10453
|
-
className:
|
|
10447
|
+
className: J("inline-block text-xs opacity-70 ml-1", e),
|
|
10454
10448
|
children: [
|
|
10455
10449
|
"Is thinking",
|
|
10456
10450
|
".".repeat(t)
|
|
@@ -10477,7 +10471,7 @@ const Zb = z.memo(function({
|
|
|
10477
10471
|
onCancelEdit: g,
|
|
10478
10472
|
onCopy: x
|
|
10479
10473
|
}) {
|
|
10480
|
-
const [b, y] = fe(!1), [R, S] = fe("collapsed"), [C, E] = fe(!1), { currentThreadId: k } = rs(), { handleInterrupt: N } = ou(), { toast:
|
|
10474
|
+
const [b, y] = fe(!1), [R, S] = fe("collapsed"), [C, E] = fe(!1), { currentThreadId: k } = rs(), { handleInterrupt: N } = ou(), { toast: _ } = ha(), [A, L] = fe({}), [F, j] = fe(!1), [V, B] = fe(null), K = c === "phone" || c === "half-screen", D = t.role, I = D === "tool", M = !(r && D !== "user"), H = z.useMemo(() => {
|
|
10481
10475
|
switch (D) {
|
|
10482
10476
|
case "user":
|
|
10483
10477
|
return "text-[hsl(var(--chat-bubble-user-text))]";
|
|
@@ -10490,7 +10484,7 @@ const Zb = z.memo(function({
|
|
|
10490
10484
|
default:
|
|
10491
10485
|
return "text-[hsl(var(--chat-bubble-ai-text))]";
|
|
10492
10486
|
}
|
|
10493
|
-
}, [D]), Y = vt(() => Vb(t.content), [t.content]),
|
|
10487
|
+
}, [D]), Y = vt(() => Vb(t.content), [t.content]), Z = vt(() => Kb(t.content), [t.content]), ie = vt(
|
|
10494
10488
|
() => t.content.filter((ee) => ee.type === "image_url"),
|
|
10495
10489
|
[t.content]
|
|
10496
10490
|
), xe = vt(
|
|
@@ -10532,7 +10526,7 @@ const Zb = z.memo(function({
|
|
|
10532
10526
|
ee.preventDefault();
|
|
10533
10527
|
return;
|
|
10534
10528
|
}
|
|
10535
|
-
if (
|
|
10529
|
+
if (A[he]) {
|
|
10536
10530
|
ee.preventDefault();
|
|
10537
10531
|
return;
|
|
10538
10532
|
}
|
|
@@ -10546,7 +10540,7 @@ const Zb = z.memo(function({
|
|
|
10546
10540
|
}
|
|
10547
10541
|
if (pe.startsWith("data:")) {
|
|
10548
10542
|
ee.preventDefault(), L((Ge) => ({ ...Ge, [he]: !0 }));
|
|
10549
|
-
const Me = `${re.name}_${re.size}_${Date.now()}`, qe =
|
|
10543
|
+
const Me = `${re.name}_${re.size}_${Date.now()}`, qe = _({ title: "Fetching file...", description: "", open: !0 });
|
|
10550
10544
|
try {
|
|
10551
10545
|
const Ge = await Tw(k ?? void 0);
|
|
10552
10546
|
if (!Ge || !Array.isArray(Ge))
|
|
@@ -10564,7 +10558,7 @@ const Zb = z.memo(function({
|
|
|
10564
10558
|
} catch (Ge) {
|
|
10565
10559
|
console.error("Failed to fetch server file:", Ge);
|
|
10566
10560
|
const Ye = Ge instanceof Error ? Ge.message : "Unknown error occurred";
|
|
10567
|
-
qe.update({ id: qe.id, title: "Failed", description: Ye }),
|
|
10561
|
+
qe.update({ id: qe.id, title: "Failed", description: Ye }), _({
|
|
10568
10562
|
title: "Failed to fetch file",
|
|
10569
10563
|
description: Ye,
|
|
10570
10564
|
open: !0
|
|
@@ -10576,8 +10570,8 @@ const Zb = z.memo(function({
|
|
|
10576
10570
|
} catch (pe) {
|
|
10577
10571
|
console.error("File click error:", pe), L((Re) => ({ ...Re, [he]: !1 }));
|
|
10578
10572
|
}
|
|
10579
|
-
}, [M,
|
|
10580
|
-
const re =
|
|
10573
|
+
}, [M, A, _, k]), $e = z.useCallback(() => {
|
|
10574
|
+
const re = J(K ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", H);
|
|
10581
10575
|
switch (D) {
|
|
10582
10576
|
case "user":
|
|
10583
10577
|
return /* @__PURE__ */ l.jsx(Fp, { className: re });
|
|
@@ -10592,40 +10586,40 @@ const Zb = z.memo(function({
|
|
|
10592
10586
|
const ee = "group relative mb-4 flex w-full";
|
|
10593
10587
|
switch (D) {
|
|
10594
10588
|
case "user":
|
|
10595
|
-
return
|
|
10589
|
+
return J(ee, "justify-end");
|
|
10596
10590
|
case "assistant":
|
|
10597
10591
|
case "tool":
|
|
10598
10592
|
case "system":
|
|
10599
|
-
return
|
|
10593
|
+
return J(ee, "justify-start");
|
|
10600
10594
|
default:
|
|
10601
10595
|
return ee;
|
|
10602
10596
|
}
|
|
10603
10597
|
}, [D]), Ie = z.useCallback(() => {
|
|
10604
|
-
const ee =
|
|
10598
|
+
const ee = J(
|
|
10605
10599
|
"rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
|
|
10606
10600
|
K && "px-3 py-2 text-sm"
|
|
10607
10601
|
);
|
|
10608
10602
|
switch (D) {
|
|
10609
10603
|
case "user":
|
|
10610
|
-
return
|
|
10604
|
+
return J(
|
|
10611
10605
|
ee,
|
|
10612
10606
|
"w-full md:max-w-[95%]",
|
|
10613
10607
|
"bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
|
|
10614
10608
|
"border border-transparent"
|
|
10615
10609
|
);
|
|
10616
10610
|
case "assistant":
|
|
10617
|
-
return
|
|
10611
|
+
return J(
|
|
10618
10612
|
ee,
|
|
10619
10613
|
"w-full md:max-w-[95%]",
|
|
10620
10614
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
10621
10615
|
"border border-border/60 dark:border-border/40"
|
|
10622
10616
|
);
|
|
10623
10617
|
case "tool":
|
|
10624
|
-
return
|
|
10618
|
+
return J(ee, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
|
|
10625
10619
|
case "system":
|
|
10626
|
-
return
|
|
10620
|
+
return J(ee, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
|
|
10627
10621
|
default:
|
|
10628
|
-
return
|
|
10622
|
+
return J(
|
|
10629
10623
|
ee,
|
|
10630
10624
|
"w-full md:max-w-[95%]",
|
|
10631
10625
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
@@ -10646,15 +10640,15 @@ const Zb = z.memo(function({
|
|
|
10646
10640
|
} catch (re) {
|
|
10647
10641
|
console.error("Failed to reject interrupt:", re);
|
|
10648
10642
|
}
|
|
10649
|
-
}, [N]),
|
|
10643
|
+
}, [N]), Q = z.useCallback(({ part: ee, i: re }) => {
|
|
10650
10644
|
if (ee.type === "text") {
|
|
10651
|
-
const he = ee.text ?? "", pe = he.trim(), Re =
|
|
10652
|
-
return Re && D !== "tool" ? /* @__PURE__ */ l.jsx(Qb, { data: Re }, re) : D === "user" && f && pe.length > h ? /* @__PURE__ */ l.jsxs(
|
|
10653
|
-
/* @__PURE__ */ l.jsx("div", { className:
|
|
10645
|
+
const he = ee.text ?? "", pe = he.trim(), Re = oc(pe);
|
|
10646
|
+
return Re && D !== "tool" ? /* @__PURE__ */ l.jsx(Qb, { data: Re }, re) : D === "user" && f && pe.length > h ? /* @__PURE__ */ l.jsxs(Ml, { open: C, onOpenChange: E, children: [
|
|
10647
|
+
/* @__PURE__ */ l.jsx("div", { className: J("text-sm text-[hsl(var(--chat-bubble-user-text))]", K && "text-xs"), children: C ? /* @__PURE__ */ l.jsx(Ul, { content: pe, allowHtml: !1 }) : /* @__PURE__ */ l.jsxs("pre", { className: J("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", K && "text-xs"), children: [
|
|
10654
10648
|
pe.substring(0, h),
|
|
10655
10649
|
"..."
|
|
10656
10650
|
] }) }),
|
|
10657
|
-
/* @__PURE__ */ l.jsx(
|
|
10651
|
+
/* @__PURE__ */ l.jsx(Dl, { asChild: !0, children: /* @__PURE__ */ l.jsx(
|
|
10658
10652
|
ze,
|
|
10659
10653
|
{
|
|
10660
10654
|
variant: "ghost",
|
|
@@ -10671,7 +10665,7 @@ const Zb = z.memo(function({
|
|
|
10671
10665
|
] })
|
|
10672
10666
|
}
|
|
10673
10667
|
) })
|
|
10674
|
-
] }, re) : /* @__PURE__ */ l.jsx(
|
|
10668
|
+
] }, re) : /* @__PURE__ */ l.jsx(Ul, { content: he, allowHtml: !1 }, re);
|
|
10675
10669
|
}
|
|
10676
10670
|
if (ee.type === "image_url") {
|
|
10677
10671
|
const he = ee;
|
|
@@ -10695,10 +10689,10 @@ const Zb = z.memo(function({
|
|
|
10695
10689
|
className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
10696
10690
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
|
|
10697
10691
|
children: [
|
|
10698
|
-
|
|
10692
|
+
A[re] ? /* @__PURE__ */ l.jsx(Tc, { className: "h-4 w-4 animate-spin" }) : null,
|
|
10699
10693
|
/* @__PURE__ */ l.jsxs("span", { className: "truncate max-w-[180px]", children: [
|
|
10700
10694
|
pe,
|
|
10701
|
-
|
|
10695
|
+
A[re] ? " (processing)" : ""
|
|
10702
10696
|
] })
|
|
10703
10697
|
]
|
|
10704
10698
|
},
|
|
@@ -10716,7 +10710,7 @@ const Zb = z.memo(function({
|
|
|
10716
10710
|
) : null;
|
|
10717
10711
|
}, [
|
|
10718
10712
|
ae,
|
|
10719
|
-
|
|
10713
|
+
A,
|
|
10720
10714
|
je,
|
|
10721
10715
|
Ue,
|
|
10722
10716
|
D,
|
|
@@ -10732,11 +10726,11 @@ const Zb = z.memo(function({
|
|
|
10732
10726
|
if (!I && !ee && !r)
|
|
10733
10727
|
return X();
|
|
10734
10728
|
if (t.model === "reflection") {
|
|
10735
|
-
const re = Y.trim(), he =
|
|
10729
|
+
const re = Y.trim(), he = oc(re);
|
|
10736
10730
|
if (he && typeof he == "object")
|
|
10737
10731
|
return /* @__PURE__ */ l.jsx(ny, { data: he });
|
|
10738
10732
|
}
|
|
10739
|
-
if (I &&
|
|
10733
|
+
if (I && Z.name === "get_issues") {
|
|
10740
10734
|
const re = t.content.find((Re) => Re.type === "tool_end"), he = (re == null ? void 0 : re.output) ?? W, pe = Od(he);
|
|
10741
10735
|
if (pe) return /* @__PURE__ */ l.jsx(ry, { issues: pe });
|
|
10742
10736
|
}
|
|
@@ -10746,10 +10740,10 @@ const Zb = z.memo(function({
|
|
|
10746
10740
|
return /* @__PURE__ */ l.jsx("div", { className: "space-y-2", children: re.map((he, pe) => {
|
|
10747
10741
|
const Re = typeof he.output == "string" ? he.output : Ni(he.output), Me = Re.length > kn ? `${Re.slice(0, kn)}
|
|
10748
10742
|
… [truncated ${Re.length - kn} chars]` : Re, qe = R === "expanded";
|
|
10749
|
-
return /* @__PURE__ */ l.jsxs(
|
|
10743
|
+
return /* @__PURE__ */ l.jsxs(Ml, { open: qe, onOpenChange: (Ge) => S(Ge ? "expanded" : "preview"), children: [
|
|
10750
10744
|
/* @__PURE__ */ l.jsx("div", { className: "flex items-center gap-2 text-xs", children: /* @__PURE__ */ l.jsx(Ei, { variant: "outline", children: (he.name ?? "tool") + (he.toolCallId ? ` • ${he.toolCallId.slice(0, 8)}` : "") }) }),
|
|
10751
10745
|
/* @__PURE__ */ l.jsx("div", { className: "font-mono text-sm mt-1", children: /* @__PURE__ */ l.jsx("pre", { className: "whitespace-pre-wrap break-words", children: qe ? Me : Me.slice(0, d) + (Me.length > d ? "..." : "") }) }),
|
|
10752
|
-
/* @__PURE__ */ l.jsx(
|
|
10746
|
+
/* @__PURE__ */ l.jsx(Dl, { asChild: !0, children: /* @__PURE__ */ l.jsx(ze, { variant: "ghost", size: "sm", className: "h-6 text-xs", children: qe ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
10753
10747
|
" ",
|
|
10754
10748
|
/* @__PURE__ */ l.jsx(Cr, { className: "h-3 w-3 mr-1" }),
|
|
10755
10749
|
" Show less"
|
|
@@ -10761,7 +10755,7 @@ const Zb = z.memo(function({
|
|
|
10761
10755
|
}) });
|
|
10762
10756
|
}
|
|
10763
10757
|
if (!I) {
|
|
10764
|
-
const re = /* @__PURE__ */ l.jsx("div", { className: "space-y-2", children: t.content.map((he, pe) => /* @__PURE__ */ l.jsx(
|
|
10758
|
+
const re = /* @__PURE__ */ l.jsx("div", { className: "space-y-2", children: t.content.map((he, pe) => /* @__PURE__ */ l.jsx(Q, { part: he, i: pe }, pe)) });
|
|
10765
10759
|
return r ? /* @__PURE__ */ l.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
10766
10760
|
re,
|
|
10767
10761
|
/* @__PURE__ */ l.jsx(Jb, { className: H })
|
|
@@ -10775,7 +10769,7 @@ const Zb = z.memo(function({
|
|
|
10775
10769
|
r,
|
|
10776
10770
|
t.model,
|
|
10777
10771
|
I,
|
|
10778
|
-
|
|
10772
|
+
Z.name,
|
|
10779
10773
|
W,
|
|
10780
10774
|
R,
|
|
10781
10775
|
u,
|
|
@@ -10783,11 +10777,11 @@ const Zb = z.memo(function({
|
|
|
10783
10777
|
H
|
|
10784
10778
|
]), He = vt(() => Xb(t), [t]);
|
|
10785
10779
|
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
10786
|
-
/* @__PURE__ */ l.jsx("div", { className:
|
|
10780
|
+
/* @__PURE__ */ l.jsx("div", { className: J(Ke(), m.container), children: /* @__PURE__ */ l.jsxs("div", { className: J(Ie(), m.content), children: [
|
|
10787
10781
|
(i || a || I) && /* @__PURE__ */ l.jsxs(
|
|
10788
10782
|
"div",
|
|
10789
10783
|
{
|
|
10790
|
-
className:
|
|
10784
|
+
className: J(
|
|
10791
10785
|
"flex items-center justify-between mb-2 pb-2 border-b border-current/10",
|
|
10792
10786
|
K && "mb-1 pb-1",
|
|
10793
10787
|
H,
|
|
@@ -10796,12 +10790,12 @@ const Zb = z.memo(function({
|
|
|
10796
10790
|
children: [
|
|
10797
10791
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10798
10792
|
$e(),
|
|
10799
|
-
a && He && /* @__PURE__ */ l.jsx("span", { className:
|
|
10800
|
-
I &&
|
|
10793
|
+
a && He && /* @__PURE__ */ l.jsx("span", { className: J("font-medium", K ? "text-xs" : "text-sm"), children: He }),
|
|
10794
|
+
I && Z.name && /* @__PURE__ */ l.jsxs(
|
|
10801
10795
|
Ei,
|
|
10802
10796
|
{
|
|
10803
10797
|
variant: "outline",
|
|
10804
|
-
className:
|
|
10798
|
+
className: J(
|
|
10805
10799
|
"text-xs flex items-center gap-1 cursor-pointer",
|
|
10806
10800
|
H,
|
|
10807
10801
|
"border border-current/40",
|
|
@@ -10815,17 +10809,17 @@ const Zb = z.memo(function({
|
|
|
10815
10809
|
},
|
|
10816
10810
|
onClick: () => S((ee) => ee === "collapsed" ? "preview" : "collapsed"),
|
|
10817
10811
|
children: [
|
|
10818
|
-
/* @__PURE__ */ l.jsx("span", { children:
|
|
10812
|
+
/* @__PURE__ */ l.jsx("span", { children: Z.name }),
|
|
10819
10813
|
/* @__PURE__ */ l.jsx("span", { className: "inline-flex items-center", children: R !== "collapsed" ? /* @__PURE__ */ l.jsx(Cr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(Xn, { className: "h-3 w-3" }) })
|
|
10820
10814
|
]
|
|
10821
10815
|
}
|
|
10822
10816
|
),
|
|
10823
|
-
I && !
|
|
10817
|
+
I && !Z.name && /* @__PURE__ */ l.jsx(
|
|
10824
10818
|
ze,
|
|
10825
10819
|
{
|
|
10826
10820
|
variant: "ghost",
|
|
10827
10821
|
size: "sm",
|
|
10828
|
-
className:
|
|
10822
|
+
className: J("h-6 px-1", H, "hover:bg-foreground/10"),
|
|
10829
10823
|
onClick: () => S((ee) => ee === "collapsed" ? "preview" : "collapsed"),
|
|
10830
10824
|
children: /* @__PURE__ */ l.jsxs("span", { className: "text-xs flex items-center gap-1", children: [
|
|
10831
10825
|
"Tool Output ",
|
|
@@ -10838,7 +10832,7 @@ const Zb = z.memo(function({
|
|
|
10838
10832
|
i && t.createdAt && /* @__PURE__ */ l.jsx(
|
|
10839
10833
|
"time",
|
|
10840
10834
|
{
|
|
10841
|
-
className:
|
|
10835
|
+
className: J("text-xs opacity-60", H, K && "text-xs"),
|
|
10842
10836
|
dateTime: new Date(t.createdAt).toISOString(),
|
|
10843
10837
|
title: new Date(t.createdAt).toLocaleString(),
|
|
10844
10838
|
children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(t.createdAt))
|
|
@@ -10847,7 +10841,7 @@ const Zb = z.memo(function({
|
|
|
10847
10841
|
s && !o && /* @__PURE__ */ l.jsxs(
|
|
10848
10842
|
"div",
|
|
10849
10843
|
{
|
|
10850
|
-
className:
|
|
10844
|
+
className: J(
|
|
10851
10845
|
"opacity-0 group-hover:opacity-100 transition-opacity",
|
|
10852
10846
|
"flex items-center gap-1",
|
|
10853
10847
|
m.actions
|
|
@@ -10860,10 +10854,10 @@ const Zb = z.memo(function({
|
|
|
10860
10854
|
variant: "ghost",
|
|
10861
10855
|
size: "sm",
|
|
10862
10856
|
onClick: () => G(I ? "visible" : "all"),
|
|
10863
|
-
className:
|
|
10857
|
+
className: J("h-6 w-6 p-0 hover:bg-foreground/10", H, K && "h-5 w-5"),
|
|
10864
10858
|
"aria-label": I ? "Copy visible" : "Copy message",
|
|
10865
10859
|
title: I ? "Copy visible portion" : "Copy message",
|
|
10866
|
-
children: /* @__PURE__ */ l.jsx(Wa, { className:
|
|
10860
|
+
children: /* @__PURE__ */ l.jsx(Wa, { className: J(b ? "text-success" : H, K ? "h-3 w-3" : "h-4 w-4") })
|
|
10867
10861
|
}
|
|
10868
10862
|
),
|
|
10869
10863
|
I && /* @__PURE__ */ l.jsx(
|
|
@@ -10872,7 +10866,7 @@ const Zb = z.memo(function({
|
|
|
10872
10866
|
variant: "ghost",
|
|
10873
10867
|
size: "sm",
|
|
10874
10868
|
onClick: () => G("all"),
|
|
10875
|
-
className:
|
|
10869
|
+
className: J("h-6 px-1 text-xs hover:bg-foreground/10", H),
|
|
10876
10870
|
"aria-label": "Copy all (may be large)",
|
|
10877
10871
|
title: "Copy all (may be large)",
|
|
10878
10872
|
children: "all"
|
|
@@ -10885,9 +10879,9 @@ const Zb = z.memo(function({
|
|
|
10885
10879
|
variant: "ghost",
|
|
10886
10880
|
size: "sm",
|
|
10887
10881
|
onClick: te,
|
|
10888
|
-
className:
|
|
10882
|
+
className: J("h-6 w-6 p-0 hover:bg-foreground/10", H, K && "h-5 w-5"),
|
|
10889
10883
|
"aria-label": "Edit message",
|
|
10890
|
-
children: /* @__PURE__ */ l.jsx(Va, { className:
|
|
10884
|
+
children: /* @__PURE__ */ l.jsx(Va, { className: J(H, K ? "h-3 w-3" : "h-4 w-4") })
|
|
10891
10885
|
}
|
|
10892
10886
|
),
|
|
10893
10887
|
D === "assistant" && v && /* @__PURE__ */ l.jsx(
|
|
@@ -10896,9 +10890,9 @@ const Zb = z.memo(function({
|
|
|
10896
10890
|
variant: "ghost",
|
|
10897
10891
|
size: "sm",
|
|
10898
10892
|
onClick: ue,
|
|
10899
|
-
className:
|
|
10893
|
+
className: J("h-6 w-6 p-0 hover:bg-foreground/10", H, K && "h-5 w-5"),
|
|
10900
10894
|
"aria-label": "Regenerate response",
|
|
10901
|
-
children: /* @__PURE__ */ l.jsx(di, { className:
|
|
10895
|
+
children: /* @__PURE__ */ l.jsx(di, { className: J(H, K ? "h-3 w-3" : "h-4 w-4") })
|
|
10902
10896
|
}
|
|
10903
10897
|
)
|
|
10904
10898
|
]
|
|
@@ -10909,20 +10903,20 @@ const Zb = z.memo(function({
|
|
|
10909
10903
|
}
|
|
10910
10904
|
),
|
|
10911
10905
|
/* @__PURE__ */ l.jsx("div", { className: "relative", children: Ee() }),
|
|
10912
|
-
I && R === "expanded" && (
|
|
10913
|
-
|
|
10906
|
+
I && R === "expanded" && (Z.toolCallId || Z.name) && /* @__PURE__ */ l.jsxs("div", { className: J("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", K && "text-xs"), children: [
|
|
10907
|
+
Z.name && /* @__PURE__ */ l.jsxs("div", { children: [
|
|
10914
10908
|
"Function: ",
|
|
10915
|
-
|
|
10909
|
+
Z.name
|
|
10916
10910
|
] }),
|
|
10917
|
-
|
|
10911
|
+
Z.toolCallId && /* @__PURE__ */ l.jsxs("div", { children: [
|
|
10918
10912
|
"Call ID: ",
|
|
10919
|
-
|
|
10913
|
+
Z.toolCallId
|
|
10920
10914
|
] })
|
|
10921
10915
|
] }),
|
|
10922
10916
|
!(i || a || I) && s && !o && /* @__PURE__ */ l.jsxs(
|
|
10923
10917
|
"div",
|
|
10924
10918
|
{
|
|
10925
|
-
className:
|
|
10919
|
+
className: J(
|
|
10926
10920
|
"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
10927
10921
|
"flex items-center gap-1",
|
|
10928
10922
|
m.actions
|
|
@@ -10934,8 +10928,8 @@ const Zb = z.memo(function({
|
|
|
10934
10928
|
variant: "ghost",
|
|
10935
10929
|
size: "sm",
|
|
10936
10930
|
onClick: () => G(),
|
|
10937
|
-
className:
|
|
10938
|
-
children: /* @__PURE__ */ l.jsx(Wa, { className:
|
|
10931
|
+
className: J("h-6 w-6 p-0 hover:bg-background/50 text-current", K && "h-5 w-5"),
|
|
10932
|
+
children: /* @__PURE__ */ l.jsx(Wa, { className: J(b ? "text-success" : "text-current", K ? "h-3 w-3" : "h-4 w-4") })
|
|
10939
10933
|
}
|
|
10940
10934
|
),
|
|
10941
10935
|
D === "user" && w && /* @__PURE__ */ l.jsx(
|
|
@@ -10944,8 +10938,8 @@ const Zb = z.memo(function({
|
|
|
10944
10938
|
variant: "ghost",
|
|
10945
10939
|
size: "sm",
|
|
10946
10940
|
onClick: te,
|
|
10947
|
-
className:
|
|
10948
|
-
children: /* @__PURE__ */ l.jsx(Va, { className:
|
|
10941
|
+
className: J("h-6 w-6 p-0 hover:bg-background/50 text-current", K && "h-5 w-5"),
|
|
10942
|
+
children: /* @__PURE__ */ l.jsx(Va, { className: J("text-current", K ? "h-3 w-3" : "h-4 w-4") })
|
|
10949
10943
|
}
|
|
10950
10944
|
),
|
|
10951
10945
|
D === "assistant" && v && /* @__PURE__ */ l.jsx(
|
|
@@ -10954,8 +10948,8 @@ const Zb = z.memo(function({
|
|
|
10954
10948
|
variant: "ghost",
|
|
10955
10949
|
size: "sm",
|
|
10956
10950
|
onClick: ue,
|
|
10957
|
-
className:
|
|
10958
|
-
children: /* @__PURE__ */ l.jsx(di, { className:
|
|
10951
|
+
className: J("h-6 w-6 p-0 hover:bg-background/50 text-current", K && "h-5 w-5"),
|
|
10952
|
+
children: /* @__PURE__ */ l.jsx(di, { className: J("text-current", K ? "h-3 w-3" : "h-4 w-4") })
|
|
10959
10953
|
}
|
|
10960
10954
|
)
|
|
10961
10955
|
]
|
|
@@ -10977,7 +10971,7 @@ const Zb = z.memo(function({
|
|
|
10977
10971
|
] });
|
|
10978
10972
|
}, (e, t) => {
|
|
10979
10973
|
var i, a, c, u, d, f, h, m;
|
|
10980
|
-
if (t.isStreamingMessage || e.isStreamingMessage || !(e.message.id === t.message.id &&
|
|
10974
|
+
if (t.isStreamingMessage || e.isStreamingMessage || !(e.message.id === t.message.id && sc(e.message) === sc(t.message))) return !1;
|
|
10981
10975
|
const o = [
|
|
10982
10976
|
"isEditing",
|
|
10983
10977
|
"showActions",
|
|
@@ -11104,7 +11098,7 @@ function ry({ issues: e }) {
|
|
|
11104
11098
|
] }, n.key);
|
|
11105
11099
|
}) });
|
|
11106
11100
|
}
|
|
11107
|
-
const
|
|
11101
|
+
const ic = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Md = z.forwardRef(({
|
|
11108
11102
|
messages: e,
|
|
11109
11103
|
isStreaming: t,
|
|
11110
11104
|
streamingAssistantId: n,
|
|
@@ -11124,8 +11118,8 @@ const ac = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Md = z.forwa
|
|
|
11124
11118
|
onScrollAway: g,
|
|
11125
11119
|
onAtBottom: x
|
|
11126
11120
|
}, b) => {
|
|
11127
|
-
const y = Qe(null), R = Qe(null), S = Qe(!1), [C, E] = fe(!0), k = _e((
|
|
11128
|
-
E(
|
|
11121
|
+
const y = Qe(null), R = Qe(null), S = Qe(!1), [C, E] = fe(!0), k = _e((A) => {
|
|
11122
|
+
E(A), g && g(!A), x && x(A);
|
|
11129
11123
|
}, [g, x]), N = vt(() => {
|
|
11130
11124
|
if (a)
|
|
11131
11125
|
return async () => {
|
|
@@ -11138,18 +11132,18 @@ const ac = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Md = z.forwa
|
|
|
11138
11132
|
}
|
|
11139
11133
|
}
|
|
11140
11134
|
};
|
|
11141
|
-
}, [a]),
|
|
11135
|
+
}, [a]), _ = vt(() => !w || v ? !1 : C ? "auto" : !1, [C, w, v]);
|
|
11142
11136
|
return e.length === 0 ? /* @__PURE__ */ l.jsx("div", { className: f, style: h, children: /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center py-8 text-muted-foreground text-center max-w-md mx-auto", children: m || "No messages yet. Start a conversation!" }) }) : /* @__PURE__ */ l.jsx("div", { className: f, style: h, children: /* @__PURE__ */ l.jsx(
|
|
11143
11137
|
kv,
|
|
11144
11138
|
{
|
|
11145
|
-
ref: (
|
|
11146
|
-
y.current =
|
|
11139
|
+
ref: (A) => {
|
|
11140
|
+
y.current = A;
|
|
11147
11141
|
},
|
|
11148
|
-
scrollerRef: (
|
|
11149
|
-
R.current =
|
|
11142
|
+
scrollerRef: (A) => {
|
|
11143
|
+
R.current = A instanceof HTMLDivElement ? A : null;
|
|
11150
11144
|
},
|
|
11151
11145
|
data: e,
|
|
11152
|
-
followOutput:
|
|
11146
|
+
followOutput: _,
|
|
11153
11147
|
overscan: 200,
|
|
11154
11148
|
increaseViewportBy: { top: 100, bottom: 200 },
|
|
11155
11149
|
defaultItemHeight: 80,
|
|
@@ -11160,9 +11154,9 @@ const ac = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Md = z.forwa
|
|
|
11160
11154
|
},
|
|
11161
11155
|
atBottomStateChange: k,
|
|
11162
11156
|
style: { height: "100%", overscrollBehavior: "contain" },
|
|
11163
|
-
computeItemKey: (
|
|
11164
|
-
itemContent: (
|
|
11165
|
-
const F =
|
|
11157
|
+
computeItemKey: (A, L) => ic(L, A),
|
|
11158
|
+
itemContent: (A, L) => {
|
|
11159
|
+
const F = ic(L, A);
|
|
11166
11160
|
return /* @__PURE__ */ l.jsx(
|
|
11167
11161
|
"div",
|
|
11168
11162
|
{
|
|
@@ -11176,7 +11170,7 @@ const ac = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Md = z.forwa
|
|
|
11176
11170
|
Zb,
|
|
11177
11171
|
{
|
|
11178
11172
|
message: L,
|
|
11179
|
-
messageIndex:
|
|
11173
|
+
messageIndex: A,
|
|
11180
11174
|
isStreamingMessage: t && n === L.id,
|
|
11181
11175
|
streamingDebounceMs: r,
|
|
11182
11176
|
isEditing: i === L.id,
|
|
@@ -11187,7 +11181,7 @@ const ac = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Md = z.forwa
|
|
|
11187
11181
|
truncateToolMessages: !1,
|
|
11188
11182
|
toolMessagePreviewLength: 200,
|
|
11189
11183
|
onEdit: c,
|
|
11190
|
-
onRegenerate: () => u(
|
|
11184
|
+
onRegenerate: () => u(A),
|
|
11191
11185
|
onCancelEdit: d
|
|
11192
11186
|
}
|
|
11193
11187
|
)
|
|
@@ -11332,12 +11326,12 @@ function hy(e) {
|
|
|
11332
11326
|
function _i(e) {
|
|
11333
11327
|
return e.replace(/start|end/g, (t) => uy[t]);
|
|
11334
11328
|
}
|
|
11335
|
-
const
|
|
11329
|
+
const ac = ["left", "right"], lc = ["right", "left"], py = ["top", "bottom"], my = ["bottom", "top"];
|
|
11336
11330
|
function gy(e, t, n) {
|
|
11337
11331
|
switch (e) {
|
|
11338
11332
|
case "top":
|
|
11339
11333
|
case "bottom":
|
|
11340
|
-
return n ? t ?
|
|
11334
|
+
return n ? t ? lc : ac : t ? ac : lc;
|
|
11341
11335
|
case "left":
|
|
11342
11336
|
case "right":
|
|
11343
11337
|
return t ? py : my;
|
|
@@ -11388,7 +11382,7 @@ function Ho(e) {
|
|
|
11388
11382
|
y: n
|
|
11389
11383
|
};
|
|
11390
11384
|
}
|
|
11391
|
-
function
|
|
11385
|
+
function cc(e, t, n) {
|
|
11392
11386
|
let {
|
|
11393
11387
|
reference: r,
|
|
11394
11388
|
floating: o
|
|
@@ -11450,7 +11444,7 @@ const wy = async (e, t, n) => {
|
|
|
11450
11444
|
}), {
|
|
11451
11445
|
x: d,
|
|
11452
11446
|
y: f
|
|
11453
|
-
} =
|
|
11447
|
+
} = cc(u, r, c), h = r, m = {}, w = 0;
|
|
11454
11448
|
for (let v = 0; v < a.length; v++) {
|
|
11455
11449
|
const {
|
|
11456
11450
|
name: g,
|
|
@@ -11487,7 +11481,7 @@ const wy = async (e, t, n) => {
|
|
|
11487
11481
|
}) : S.rects), {
|
|
11488
11482
|
x: d,
|
|
11489
11483
|
y: f
|
|
11490
|
-
} =
|
|
11484
|
+
} = cc(u, h, c)), v = -1);
|
|
11491
11485
|
}
|
|
11492
11486
|
return {
|
|
11493
11487
|
x: d,
|
|
@@ -11566,7 +11560,7 @@ const by = (e) => ({
|
|
|
11566
11560
|
}, m = Sa(o), w = ya(m), v = await i.getDimensions(u), g = m === "y", x = g ? "top" : "left", b = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", R = s.reference[w] + s.reference[m] - h[m] - s.floating[w], S = h[m] - s.reference[m], C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
|
|
11567
11561
|
let E = C ? C[y] : 0;
|
|
11568
11562
|
(!E || !await (i.isElement == null ? void 0 : i.isElement(C))) && (E = a.floating[y] || s.floating[w]);
|
|
11569
|
-
const k = R / 2 - S / 2, N = E / 2 - v[w] / 2 - 1,
|
|
11563
|
+
const k = R / 2 - S / 2, N = E / 2 - v[w] / 2 - 1, _ = wn(f[x], N), A = wn(f[b], N), L = _, F = E - v[w] - A, j = E / 2 - v[w] / 2 + k, V = Ai(L, j, F), B = !c.arrow && fr(o) != null && j !== V && s.reference[w] / 2 - (j < L ? _ : A) - v[w] / 2 < 0, K = B ? j < L ? j - L : j - F : 0;
|
|
11570
11564
|
return {
|
|
11571
11565
|
[m]: h[m] + K,
|
|
11572
11566
|
data: {
|
|
@@ -11606,35 +11600,35 @@ const by = (e) => ({
|
|
|
11606
11600
|
const x = fn(o), b = Qt(a), y = fn(a) === a, R = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), S = h || (y || !v ? [Bo(a)] : hy(a)), C = w !== "none";
|
|
11607
11601
|
!h && C && S.push(...xy(a, v, w, R));
|
|
11608
11602
|
const E = [a, ...S], k = await $r(t, g), N = [];
|
|
11609
|
-
let
|
|
11603
|
+
let _ = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
11610
11604
|
if (d && N.push(k[x]), f) {
|
|
11611
11605
|
const j = fy(o, i, R);
|
|
11612
11606
|
N.push(k[j[0]], k[j[1]]);
|
|
11613
11607
|
}
|
|
11614
|
-
if (
|
|
11608
|
+
if (_ = [..._, {
|
|
11615
11609
|
placement: o,
|
|
11616
11610
|
overflows: N
|
|
11617
11611
|
}], !N.every((j) => j <= 0)) {
|
|
11618
|
-
var
|
|
11619
|
-
const j = (((
|
|
11612
|
+
var A, L;
|
|
11613
|
+
const j = (((A = s.flip) == null ? void 0 : A.index) || 0) + 1, V = E[j];
|
|
11620
11614
|
if (V && (!(f === "alignment" ? b !== Qt(V) : !1) || // We leave the current main axis only if every placement on that axis
|
|
11621
11615
|
// overflows the main axis.
|
|
11622
|
-
|
|
11616
|
+
_.every((D) => Qt(D.placement) === b ? D.overflows[0] > 0 : !0)))
|
|
11623
11617
|
return {
|
|
11624
11618
|
data: {
|
|
11625
11619
|
index: j,
|
|
11626
|
-
overflows:
|
|
11620
|
+
overflows: _
|
|
11627
11621
|
},
|
|
11628
11622
|
reset: {
|
|
11629
11623
|
placement: V
|
|
11630
11624
|
}
|
|
11631
11625
|
};
|
|
11632
|
-
let B = (L =
|
|
11626
|
+
let B = (L = _.filter((K) => K.overflows[0] <= 0).sort((K, D) => K.overflows[1] - D.overflows[1])[0]) == null ? void 0 : L.placement;
|
|
11633
11627
|
if (!B)
|
|
11634
11628
|
switch (m) {
|
|
11635
11629
|
case "bestFit": {
|
|
11636
11630
|
var F;
|
|
11637
|
-
const K = (F =
|
|
11631
|
+
const K = (F = _.filter((D) => {
|
|
11638
11632
|
if (C) {
|
|
11639
11633
|
const I = Qt(D.placement);
|
|
11640
11634
|
return I === b || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -11661,7 +11655,7 @@ const by = (e) => ({
|
|
|
11661
11655
|
}
|
|
11662
11656
|
};
|
|
11663
11657
|
};
|
|
11664
|
-
function
|
|
11658
|
+
function uc(e, t) {
|
|
11665
11659
|
return {
|
|
11666
11660
|
top: e.top - t.height,
|
|
11667
11661
|
right: e.right - t.width,
|
|
@@ -11669,7 +11663,7 @@ function dc(e, t) {
|
|
|
11669
11663
|
left: e.left - t.width
|
|
11670
11664
|
};
|
|
11671
11665
|
}
|
|
11672
|
-
function
|
|
11666
|
+
function dc(e) {
|
|
11673
11667
|
return ly.some((t) => e[t] >= 0);
|
|
11674
11668
|
}
|
|
11675
11669
|
const Sy = function(e) {
|
|
@@ -11688,11 +11682,11 @@ const Sy = function(e) {
|
|
|
11688
11682
|
const s = await $r(t, {
|
|
11689
11683
|
...o,
|
|
11690
11684
|
elementContext: "reference"
|
|
11691
|
-
}), i =
|
|
11685
|
+
}), i = uc(s, n.reference);
|
|
11692
11686
|
return {
|
|
11693
11687
|
data: {
|
|
11694
11688
|
referenceHiddenOffsets: i,
|
|
11695
|
-
referenceHidden:
|
|
11689
|
+
referenceHidden: dc(i)
|
|
11696
11690
|
}
|
|
11697
11691
|
};
|
|
11698
11692
|
}
|
|
@@ -11700,11 +11694,11 @@ const Sy = function(e) {
|
|
|
11700
11694
|
const s = await $r(t, {
|
|
11701
11695
|
...o,
|
|
11702
11696
|
altBoundary: !0
|
|
11703
|
-
}), i =
|
|
11697
|
+
}), i = uc(s, n.floating);
|
|
11704
11698
|
return {
|
|
11705
11699
|
data: {
|
|
11706
11700
|
escapedOffsets: i,
|
|
11707
|
-
escaped:
|
|
11701
|
+
escaped: dc(i)
|
|
11708
11702
|
}
|
|
11709
11703
|
};
|
|
11710
11704
|
}
|
|
@@ -11885,8 +11879,8 @@ const Ty = function(e) {
|
|
|
11885
11879
|
const b = v - d.top - d.bottom, y = w - d.left - d.right, R = wn(v - d[g], b), S = wn(w - d[x], y), C = !t.middlewareData.shift;
|
|
11886
11880
|
let E = R, k = S;
|
|
11887
11881
|
if ((n = t.middlewareData.shift) != null && n.enabled.x && (k = y), (r = t.middlewareData.shift) != null && r.enabled.y && (E = b), C && !h) {
|
|
11888
|
-
const
|
|
11889
|
-
m ? k = w - 2 * (
|
|
11882
|
+
const _ = It(d.left, 0), A = It(d.right, 0), L = It(d.top, 0), F = It(d.bottom, 0);
|
|
11883
|
+
m ? k = w - 2 * (_ !== 0 || A !== 0 ? _ + A : It(d.left, d.right)) : E = v - 2 * (L !== 0 || F !== 0 ? L + F : It(d.top, d.bottom));
|
|
11890
11884
|
}
|
|
11891
11885
|
await c({
|
|
11892
11886
|
...t,
|
|
@@ -11925,7 +11919,7 @@ function Wt(e) {
|
|
|
11925
11919
|
function nn(e) {
|
|
11926
11920
|
return bs() ? e instanceof HTMLElement || e instanceof _t(e).HTMLElement : !1;
|
|
11927
11921
|
}
|
|
11928
|
-
function
|
|
11922
|
+
function fc(e) {
|
|
11929
11923
|
return !bs() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof _t(e).ShadowRoot;
|
|
11930
11924
|
}
|
|
11931
11925
|
const Iy = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
@@ -11994,10 +11988,10 @@ function bn(e) {
|
|
|
11994
11988
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
11995
11989
|
e.assignedSlot || // DOM Element detected.
|
|
11996
11990
|
e.parentNode || // ShadowRoot detected.
|
|
11997
|
-
|
|
11991
|
+
fc(e) && e.host || // Fallback.
|
|
11998
11992
|
sn(e)
|
|
11999
11993
|
);
|
|
12000
|
-
return
|
|
11994
|
+
return fc(t) ? t.host : t;
|
|
12001
11995
|
}
|
|
12002
11996
|
function Fd(e) {
|
|
12003
11997
|
const t = bn(e);
|
|
@@ -12158,7 +12152,7 @@ function Wy(e, t) {
|
|
|
12158
12152
|
y: u
|
|
12159
12153
|
};
|
|
12160
12154
|
}
|
|
12161
|
-
function
|
|
12155
|
+
function hc(e, t, n) {
|
|
12162
12156
|
let r;
|
|
12163
12157
|
if (t === "viewport")
|
|
12164
12158
|
r = Hy(e, n);
|
|
@@ -12202,9 +12196,9 @@ function Ky(e) {
|
|
|
12202
12196
|
strategy: o
|
|
12203
12197
|
} = e;
|
|
12204
12198
|
const i = [...n === "clippingAncestors" ? ys(t) ? [] : Vy(t, this._c) : [].concat(n), r], a = i[0], c = i.reduce((u, d) => {
|
|
12205
|
-
const f =
|
|
12199
|
+
const f = hc(t, d, o);
|
|
12206
12200
|
return u.top = It(f.top, u.top), u.right = wn(f.right, u.right), u.bottom = wn(f.bottom, u.bottom), u.left = It(f.left, u.left), u;
|
|
12207
|
-
},
|
|
12201
|
+
}, hc(t, a, o));
|
|
12208
12202
|
return {
|
|
12209
12203
|
width: c.right - c.left,
|
|
12210
12204
|
height: c.bottom - c.top,
|
|
@@ -12249,7 +12243,7 @@ function Gy(e, t, n) {
|
|
|
12249
12243
|
function ii(e) {
|
|
12250
12244
|
return Vt(e).position === "static";
|
|
12251
12245
|
}
|
|
12252
|
-
function
|
|
12246
|
+
function pc(e, t) {
|
|
12253
12247
|
if (!nn(e) || Vt(e).position === "fixed")
|
|
12254
12248
|
return null;
|
|
12255
12249
|
if (t)
|
|
@@ -12270,9 +12264,9 @@ function Wd(e, t) {
|
|
|
12270
12264
|
}
|
|
12271
12265
|
return n;
|
|
12272
12266
|
}
|
|
12273
|
-
let r =
|
|
12267
|
+
let r = pc(e, t);
|
|
12274
12268
|
for (; r && Ay(r) && ii(r); )
|
|
12275
|
-
r =
|
|
12269
|
+
r = pc(r, t);
|
|
12276
12270
|
return r && or(r) && ii(r) && !Ca(r) ? n : r || My(e) || n;
|
|
12277
12271
|
}
|
|
12278
12272
|
const Yy = async function(e) {
|
|
@@ -12387,7 +12381,7 @@ function Qy(e, t, n, r) {
|
|
|
12387
12381
|
}), f == null || f(), (x = m) == null || x.disconnect(), m = null, c && cancelAnimationFrame(w);
|
|
12388
12382
|
};
|
|
12389
12383
|
}
|
|
12390
|
-
const e0 = Ty, t0 = Ry, n0 = yy, r0 = ky, o0 = Sy,
|
|
12384
|
+
const e0 = Ty, t0 = Ry, n0 = yy, r0 = ky, o0 = Sy, mc = by, s0 = Ey, i0 = (e, t, n) => {
|
|
12391
12385
|
const r = /* @__PURE__ */ new Map(), o = {
|
|
12392
12386
|
platform: Jy,
|
|
12393
12387
|
...n
|
|
@@ -12435,7 +12429,7 @@ function Uo(e, t) {
|
|
|
12435
12429
|
function Kd(e) {
|
|
12436
12430
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
12437
12431
|
}
|
|
12438
|
-
function
|
|
12432
|
+
function gc(e, t) {
|
|
12439
12433
|
const n = Kd(e);
|
|
12440
12434
|
return Math.round(t * n) / n;
|
|
12441
12435
|
}
|
|
@@ -12472,7 +12466,7 @@ function c0(e) {
|
|
|
12472
12466
|
D !== C.current && (C.current = D, v(D));
|
|
12473
12467
|
}, []), y = p.useCallback((D) => {
|
|
12474
12468
|
D !== E.current && (E.current = D, x(D));
|
|
12475
|
-
}, []), R = s || w, S = i || g, C = p.useRef(null), E = p.useRef(null), k = p.useRef(d), N = c != null,
|
|
12469
|
+
}, []), R = s || w, S = i || g, C = p.useRef(null), E = p.useRef(null), k = p.useRef(d), N = c != null, _ = ai(c), A = ai(o), L = ai(u), F = p.useCallback(() => {
|
|
12476
12470
|
if (!C.current || !E.current)
|
|
12477
12471
|
return;
|
|
12478
12472
|
const D = {
|
|
@@ -12480,7 +12474,7 @@ function c0(e) {
|
|
|
12480
12474
|
strategy: n,
|
|
12481
12475
|
middleware: h
|
|
12482
12476
|
};
|
|
12483
|
-
|
|
12477
|
+
A.current && (D.platform = A.current), i0(C.current, E.current, D).then((I) => {
|
|
12484
12478
|
const M = {
|
|
12485
12479
|
...I,
|
|
12486
12480
|
// The floating element's position may be recomputed while it's closed
|
|
@@ -12493,7 +12487,7 @@ function c0(e) {
|
|
|
12493
12487
|
f(M);
|
|
12494
12488
|
}));
|
|
12495
12489
|
});
|
|
12496
|
-
}, [h, t, n,
|
|
12490
|
+
}, [h, t, n, A, L]);
|
|
12497
12491
|
Ao(() => {
|
|
12498
12492
|
u === !1 && k.current.isPositioned && (k.current.isPositioned = !1, f((D) => ({
|
|
12499
12493
|
...D,
|
|
@@ -12505,11 +12499,11 @@ function c0(e) {
|
|
|
12505
12499
|
j.current = !1;
|
|
12506
12500
|
}), []), Ao(() => {
|
|
12507
12501
|
if (R && (C.current = R), S && (E.current = S), R && S) {
|
|
12508
|
-
if (
|
|
12509
|
-
return
|
|
12502
|
+
if (_.current)
|
|
12503
|
+
return _.current(R, S, F);
|
|
12510
12504
|
F();
|
|
12511
12505
|
}
|
|
12512
|
-
}, [R, S, F,
|
|
12506
|
+
}, [R, S, F, _, N]);
|
|
12513
12507
|
const V = p.useMemo(() => ({
|
|
12514
12508
|
reference: C,
|
|
12515
12509
|
floating: E,
|
|
@@ -12526,7 +12520,7 @@ function c0(e) {
|
|
|
12526
12520
|
};
|
|
12527
12521
|
if (!B.floating)
|
|
12528
12522
|
return D;
|
|
12529
|
-
const I =
|
|
12523
|
+
const I = gc(B.floating, d.x), M = gc(B.floating, d.y);
|
|
12530
12524
|
return a ? {
|
|
12531
12525
|
...D,
|
|
12532
12526
|
transform: "translate(" + I + "px, " + M + "px)",
|
|
@@ -12559,10 +12553,10 @@ const u0 = (e) => {
|
|
|
12559
12553
|
element: r,
|
|
12560
12554
|
padding: o
|
|
12561
12555
|
} = typeof e == "function" ? e(n) : e;
|
|
12562
|
-
return r && t(r) ? r.current != null ?
|
|
12556
|
+
return r && t(r) ? r.current != null ? mc({
|
|
12563
12557
|
element: r.current,
|
|
12564
12558
|
padding: o
|
|
12565
|
-
}).fn(n) : {} : r ?
|
|
12559
|
+
}).fn(n) : {} : r ? mc({
|
|
12566
12560
|
element: r,
|
|
12567
12561
|
padding: o
|
|
12568
12562
|
}).fn(n) : {};
|
|
@@ -12662,9 +12656,9 @@ var Ia = "PopperContent", [y0, S0] = Yd(Ia), ef = p.forwardRef(
|
|
|
12662
12656
|
updatePositionStrategy: m = "optimized",
|
|
12663
12657
|
onPlaced: w,
|
|
12664
12658
|
...v
|
|
12665
|
-
} = e, g = Xd(Ia, n), [x, b] = p.useState(null), y = Oe(t, ($e) => b($e)), [R, S] = p.useState(null), C = Gd(R), E = (C == null ? void 0 : C.width) ?? 0, k = (C == null ? void 0 : C.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""),
|
|
12666
|
-
padding:
|
|
12667
|
-
boundary:
|
|
12659
|
+
} = e, g = Xd(Ia, n), [x, b] = p.useState(null), y = Oe(t, ($e) => b($e)), [R, S] = p.useState(null), C = Gd(R), E = (C == null ? void 0 : C.width) ?? 0, k = (C == null ? void 0 : C.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, A = Array.isArray(u) ? u : [u], L = A.length > 0, F = {
|
|
12660
|
+
padding: _,
|
|
12661
|
+
boundary: A.filter(T0),
|
|
12668
12662
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
12669
12663
|
altBoundary: L
|
|
12670
12664
|
}, { refs: j, floatingStyles: V, placement: B, isPositioned: K, middlewareData: D } = c0({
|
|
@@ -12689,8 +12683,8 @@ var Ia = "PopperContent", [y0, S0] = Yd(Ia), ef = p.forwardRef(
|
|
|
12689
12683
|
m0({
|
|
12690
12684
|
...F,
|
|
12691
12685
|
apply: ({ elements: $e, rects: Ke, availableWidth: Ie, availableHeight: je }) => {
|
|
12692
|
-
const { width: Ue, height:
|
|
12693
|
-
X.setProperty("--radix-popper-available-width", `${Ie}px`), X.setProperty("--radix-popper-available-height", `${je}px`), X.setProperty("--radix-popper-anchor-width", `${Ue}px`), X.setProperty("--radix-popper-anchor-height", `${
|
|
12686
|
+
const { width: Ue, height: Q } = Ke.reference, X = $e.floating.style;
|
|
12687
|
+
X.setProperty("--radix-popper-available-width", `${Ie}px`), X.setProperty("--radix-popper-available-height", `${je}px`), X.setProperty("--radix-popper-anchor-width", `${Ue}px`), X.setProperty("--radix-popper-anchor-height", `${Q}px`);
|
|
12694
12688
|
}
|
|
12695
12689
|
}),
|
|
12696
12690
|
R && x0({ element: R, padding: a }),
|
|
@@ -12701,7 +12695,7 @@ var Ia = "PopperContent", [y0, S0] = Yd(Ia), ef = p.forwardRef(
|
|
|
12701
12695
|
dt(() => {
|
|
12702
12696
|
K && (H == null || H());
|
|
12703
12697
|
}, [K, H]);
|
|
12704
|
-
const Y = (W = D.arrow) == null ? void 0 : W.x,
|
|
12698
|
+
const Y = (W = D.arrow) == null ? void 0 : W.x, Z = (O = D.arrow) == null ? void 0 : O.y, ie = ((G = D.arrow) == null ? void 0 : G.centerOffset) !== 0, [xe, Te] = p.useState();
|
|
12705
12699
|
return dt(() => {
|
|
12706
12700
|
x && Te(window.getComputedStyle(x).zIndex);
|
|
12707
12701
|
}, [x]), /* @__PURE__ */ l.jsx(
|
|
@@ -12735,7 +12729,7 @@ var Ia = "PopperContent", [y0, S0] = Yd(Ia), ef = p.forwardRef(
|
|
|
12735
12729
|
placedSide: I,
|
|
12736
12730
|
onArrowChange: S,
|
|
12737
12731
|
arrowX: Y,
|
|
12738
|
-
arrowY:
|
|
12732
|
+
arrowY: Z,
|
|
12739
12733
|
shouldHideArrow: ie,
|
|
12740
12734
|
children: /* @__PURE__ */ l.jsx(
|
|
12741
12735
|
Se.div,
|
|
@@ -12891,9 +12885,9 @@ var _0 = p.forwardRef((e, t) => {
|
|
|
12891
12885
|
onFocus: ce(e.onFocus, (k) => {
|
|
12892
12886
|
const N = !S.current;
|
|
12893
12887
|
if (k.target === k.currentTarget && N && !x) {
|
|
12894
|
-
const
|
|
12895
|
-
if (k.currentTarget.dispatchEvent(
|
|
12896
|
-
const
|
|
12888
|
+
const _ = new CustomEvent(li, E0);
|
|
12889
|
+
if (k.currentTarget.dispatchEvent(_), !_.defaultPrevented) {
|
|
12890
|
+
const A = R().filter((B) => B.focusable), L = A.find((B) => B.active), F = A.find((B) => B.id === v), V = [L, F, ...A].filter(
|
|
12897
12891
|
Boolean
|
|
12898
12892
|
).map((B) => B.ref.current);
|
|
12899
12893
|
pf(V, d);
|
|
@@ -13105,11 +13099,11 @@ var $t = "MenuContent", [G0, _a] = Wn($t), yf = p.forwardRef(
|
|
|
13105
13099
|
onDismiss: m,
|
|
13106
13100
|
disableOutsideScroll: w,
|
|
13107
13101
|
...v
|
|
13108
|
-
} = e, g = Vn($t, n), x = Zr($t, n), b = Ts(n), y = xf(n), R = H0(n), [S, C] = p.useState(null), E = p.useRef(null), k = Oe(t, E, g.onContentChange), N = p.useRef(0),
|
|
13102
|
+
} = e, g = Vn($t, n), x = Zr($t, n), b = Ts(n), y = xf(n), R = H0(n), [S, C] = p.useState(null), E = p.useRef(null), k = Oe(t, E, g.onContentChange), N = p.useRef(0), _ = p.useRef(""), A = p.useRef(0), L = p.useRef(null), F = p.useRef("right"), j = p.useRef(0), V = w ? ps : p.Fragment, B = w ? { as: J0, allowPinchZoom: !0 } : void 0, K = (I) => {
|
|
13109
13103
|
var W, O;
|
|
13110
|
-
const M =
|
|
13104
|
+
const M = _.current + I, H = R().filter((G) => !G.disabled), Y = document.activeElement, Z = (W = H.find((G) => G.ref.current === Y)) == null ? void 0 : W.textValue, ie = H.map((G) => G.textValue), xe = cS(ie, M, Z), Te = (O = H.find((G) => G.textValue === xe)) == null ? void 0 : O.ref.current;
|
|
13111
13105
|
(function G(te) {
|
|
13112
|
-
|
|
13106
|
+
_.current = te, window.clearTimeout(N.current), te !== "" && (N.current = window.setTimeout(() => G(""), 1e3));
|
|
13113
13107
|
})(M), Te && setTimeout(() => Te.focus());
|
|
13114
13108
|
};
|
|
13115
13109
|
p.useEffect(() => () => window.clearTimeout(N.current), []), pa();
|
|
@@ -13121,7 +13115,7 @@ var $t = "MenuContent", [G0, _a] = Wn($t), yf = p.forwardRef(
|
|
|
13121
13115
|
G0,
|
|
13122
13116
|
{
|
|
13123
13117
|
scope: n,
|
|
13124
|
-
searchRef:
|
|
13118
|
+
searchRef: _,
|
|
13125
13119
|
onItemEnter: p.useCallback(
|
|
13126
13120
|
(I) => {
|
|
13127
13121
|
D(I) && I.preventDefault();
|
|
@@ -13141,7 +13135,7 @@ var $t = "MenuContent", [G0, _a] = Wn($t), yf = p.forwardRef(
|
|
|
13141
13135
|
},
|
|
13142
13136
|
[D]
|
|
13143
13137
|
),
|
|
13144
|
-
pointerGraceTimerRef:
|
|
13138
|
+
pointerGraceTimerRef: A,
|
|
13145
13139
|
onPointerGraceIntentChange: p.useCallback((I) => {
|
|
13146
13140
|
L.current = I;
|
|
13147
13141
|
}, []),
|
|
@@ -13192,8 +13186,8 @@ var $t = "MenuContent", [G0, _a] = Wn($t), yf = p.forwardRef(
|
|
|
13192
13186
|
ref: k,
|
|
13193
13187
|
style: { outline: "none", ...v.style },
|
|
13194
13188
|
onKeyDown: ce(v.onKeyDown, (I) => {
|
|
13195
|
-
const H = I.target.closest("[data-radix-menu-content]") === I.currentTarget, Y = I.ctrlKey || I.altKey || I.metaKey,
|
|
13196
|
-
H && (I.key === "Tab" && I.preventDefault(), !Y &&
|
|
13189
|
+
const H = I.target.closest("[data-radix-menu-content]") === I.currentTarget, Y = I.ctrlKey || I.altKey || I.metaKey, Z = I.key.length === 1;
|
|
13190
|
+
H && (I.key === "Tab" && I.preventDefault(), !Y && Z && K(I.key));
|
|
13197
13191
|
const ie = E.current;
|
|
13198
13192
|
if (I.target !== ie || !F0.includes(I.key)) return;
|
|
13199
13193
|
I.preventDefault();
|
|
@@ -13201,7 +13195,7 @@ var $t = "MenuContent", [G0, _a] = Wn($t), yf = p.forwardRef(
|
|
|
13201
13195
|
mf.includes(I.key) && Te.reverse(), aS(Te);
|
|
13202
13196
|
}),
|
|
13203
13197
|
onBlur: ce(e.onBlur, (I) => {
|
|
13204
|
-
I.currentTarget.contains(I.target) || (window.clearTimeout(N.current),
|
|
13198
|
+
I.currentTarget.contains(I.target) || (window.clearTimeout(N.current), _.current = "");
|
|
13205
13199
|
}),
|
|
13206
13200
|
onPointerMove: ce(
|
|
13207
13201
|
e.onPointerMove,
|
|
@@ -13240,13 +13234,13 @@ var Q0 = "MenuLabel", Sf = p.forwardRef(
|
|
|
13240
13234
|
}
|
|
13241
13235
|
);
|
|
13242
13236
|
Sf.displayName = Q0;
|
|
13243
|
-
var Wo = "MenuItem",
|
|
13237
|
+
var Wo = "MenuItem", xc = "menu.itemSelect", Rs = p.forwardRef(
|
|
13244
13238
|
(e, t) => {
|
|
13245
13239
|
const { disabled: n = !1, onSelect: r, ...o } = e, s = p.useRef(null), i = Zr(Wo, e.__scopeMenu), a = _a(Wo, e.__scopeMenu), c = Oe(t, s), u = p.useRef(!1), d = () => {
|
|
13246
13240
|
const f = s.current;
|
|
13247
13241
|
if (!n && f) {
|
|
13248
|
-
const h = new CustomEvent(
|
|
13249
|
-
f.addEventListener(
|
|
13242
|
+
const h = new CustomEvent(xc, { bubbles: !0, cancelable: !0 });
|
|
13243
|
+
f.addEventListener(xc, (m) => r == null ? void 0 : r(m), { once: !0 }), Fu(f, h), h.defaultPrevented ? u.current = !1 : i.onClose();
|
|
13250
13244
|
}
|
|
13251
13245
|
};
|
|
13252
13246
|
return /* @__PURE__ */ l.jsx(
|
|
@@ -13743,7 +13737,7 @@ const qS = WS, GS = VS, YS = p.forwardRef(({ className: e, inset: t, children: n
|
|
|
13743
13737
|
ih,
|
|
13744
13738
|
{
|
|
13745
13739
|
ref: o,
|
|
13746
|
-
className:
|
|
13740
|
+
className: J(
|
|
13747
13741
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
13748
13742
|
t && "pl-8",
|
|
13749
13743
|
e
|
|
@@ -13760,7 +13754,7 @@ const XS = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
13760
13754
|
ah,
|
|
13761
13755
|
{
|
|
13762
13756
|
ref: n,
|
|
13763
|
-
className:
|
|
13757
|
+
className: J(
|
|
13764
13758
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
13765
13759
|
e
|
|
13766
13760
|
),
|
|
@@ -13773,7 +13767,7 @@ const lh = p.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
|
|
|
13773
13767
|
{
|
|
13774
13768
|
ref: r,
|
|
13775
13769
|
sideOffset: t,
|
|
13776
|
-
className:
|
|
13770
|
+
className: J(
|
|
13777
13771
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
13778
13772
|
e
|
|
13779
13773
|
),
|
|
@@ -13785,7 +13779,7 @@ const Mi = p.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
13785
13779
|
th,
|
|
13786
13780
|
{
|
|
13787
13781
|
ref: r,
|
|
13788
|
-
className:
|
|
13782
|
+
className: J(
|
|
13789
13783
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
13790
13784
|
t && "pl-8",
|
|
13791
13785
|
e
|
|
@@ -13798,7 +13792,7 @@ const JS = p.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
|
|
|
13798
13792
|
nh,
|
|
13799
13793
|
{
|
|
13800
13794
|
ref: o,
|
|
13801
|
-
className:
|
|
13795
|
+
className: J(
|
|
13802
13796
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
13803
13797
|
e
|
|
13804
13798
|
),
|
|
@@ -13815,7 +13809,7 @@ const ZS = p.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
13815
13809
|
rh,
|
|
13816
13810
|
{
|
|
13817
13811
|
ref: r,
|
|
13818
|
-
className:
|
|
13812
|
+
className: J(
|
|
13819
13813
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
13820
13814
|
e
|
|
13821
13815
|
),
|
|
@@ -13831,7 +13825,7 @@ const QS = p.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
13831
13825
|
eh,
|
|
13832
13826
|
{
|
|
13833
13827
|
ref: r,
|
|
13834
|
-
className:
|
|
13828
|
+
className: J(
|
|
13835
13829
|
"px-2 py-1.5 text-sm font-semibold",
|
|
13836
13830
|
t && "pl-8",
|
|
13837
13831
|
e
|
|
@@ -13844,7 +13838,7 @@ const eC = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
13844
13838
|
sh,
|
|
13845
13839
|
{
|
|
13846
13840
|
ref: n,
|
|
13847
|
-
className:
|
|
13841
|
+
className: J("-mx-1 my-1 h-px bg-muted", e),
|
|
13848
13842
|
...t
|
|
13849
13843
|
}
|
|
13850
13844
|
));
|
|
@@ -13879,17 +13873,17 @@ function ci({
|
|
|
13879
13873
|
stop: k,
|
|
13880
13874
|
loadOlderMessages: N
|
|
13881
13875
|
} = ou(), {
|
|
13882
|
-
isStreaming:
|
|
13883
|
-
error:
|
|
13876
|
+
isStreaming: _,
|
|
13877
|
+
error: A,
|
|
13884
13878
|
streamingAssistantId: L,
|
|
13885
13879
|
lastCheckpointId: F,
|
|
13886
13880
|
lastCheckpointNs: j
|
|
13887
|
-
} = Ug(), [V, B] = fe(null), [K, D] = fe(""), [I, M] = fe(null), [H, Y] = fe([]), [
|
|
13881
|
+
} = Ug(), [V, B] = fe(null), [K, D] = fe(""), [I, M] = fe(null), [H, Y] = fe([]), [Z, ie] = fe(0), [xe, Te] = fe(0), [W, O] = fe(!1), [G, te] = fe(null), [ue, ae] = fe(null), [$e, Ke] = fe(!1), [Ie, je] = fe(null), [Ue, Q] = fe([]), [X, Ee] = fe(null), [He, ee] = fe(null), [re, he] = fe(!1), pe = Qe(null), Re = Qe(null), Me = Qe(null), qe = _e(() => {
|
|
13888
13882
|
pe.current && (pe.current.value = ""), Re.current && (Re.current.value = ""), ie((le) => le + 1), Te((le) => le + 1);
|
|
13889
13883
|
}, []), Ge = Qe(!1);
|
|
13890
13884
|
ot(() => {
|
|
13891
|
-
Ge.current && !
|
|
13892
|
-
}, [
|
|
13885
|
+
Ge.current && !_ && (Y([]), qe()), Ge.current = _;
|
|
13886
|
+
}, [_, qe]);
|
|
13893
13887
|
const [Ye, yt] = fe("desktop");
|
|
13894
13888
|
ot(() => {
|
|
13895
13889
|
const le = () => {
|
|
@@ -13900,7 +13894,7 @@ function ci({
|
|
|
13900
13894
|
}, []), ot(() => {
|
|
13901
13895
|
let le = !1;
|
|
13902
13896
|
if (!v) {
|
|
13903
|
-
|
|
13897
|
+
Q([]), Ee(null), ee(null), Me.current = null;
|
|
13904
13898
|
return;
|
|
13905
13899
|
}
|
|
13906
13900
|
const ve = {
|
|
@@ -13913,7 +13907,7 @@ function ci({
|
|
|
13913
13907
|
var oo;
|
|
13914
13908
|
if (le) return;
|
|
13915
13909
|
const Et = ((nt == null ? void 0 : nt.checkpoints) ?? []).slice().sort((cn, T) => new Date(T.createdAt).getTime() - new Date(cn.createdAt).getTime());
|
|
13916
|
-
|
|
13910
|
+
Q(Et);
|
|
13917
13911
|
const Gt = X, wr = Gt && Et.some((cn) => cn.checkpointId === Gt) ? Gt : ((oo = Et[0]) == null ? void 0 : oo.checkpointId) ?? null;
|
|
13918
13912
|
let ro = null;
|
|
13919
13913
|
if (wr) {
|
|
@@ -13922,7 +13916,7 @@ function ci({
|
|
|
13922
13916
|
}
|
|
13923
13917
|
Ee(wr), ee(ro), Me.current = ve;
|
|
13924
13918
|
}).catch((nt) => {
|
|
13925
|
-
console.error("ChatInterface - listCheckpoints error:", nt), le || (
|
|
13919
|
+
console.error("ChatInterface - listCheckpoints error:", nt), le || (Q([]), Me.current = null);
|
|
13926
13920
|
}), () => {
|
|
13927
13921
|
le = !0;
|
|
13928
13922
|
};
|
|
@@ -13951,8 +13945,8 @@ function ci({
|
|
|
13951
13945
|
}
|
|
13952
13946
|
})();
|
|
13953
13947
|
}, [w]), ot(() => {
|
|
13954
|
-
|
|
13955
|
-
}, [
|
|
13948
|
+
A && !$e && (m == null || m(A));
|
|
13949
|
+
}, [A, $e, m]);
|
|
13956
13950
|
const Ps = (le) => {
|
|
13957
13951
|
if (le.length > No)
|
|
13958
13952
|
return `Message too long (${le.length}/${No} characters)`;
|
|
@@ -14055,8 +14049,8 @@ function ci({
|
|
|
14055
14049
|
}
|
|
14056
14050
|
}, Ds = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${d.container || ""}`, no = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${d.messagesArea || ""}`, Ls = `flex-shrink-0 w-full border-t p-4 bg-transparent ${d.inputArea || ""}`;
|
|
14057
14051
|
return /* @__PURE__ */ l.jsxs("div", { className: Ds, children: [
|
|
14058
|
-
!!
|
|
14059
|
-
/* @__PURE__ */ l.jsx("span", { children:
|
|
14052
|
+
!!A && !$e && /* @__PURE__ */ l.jsxs("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
|
|
14053
|
+
/* @__PURE__ */ l.jsx("span", { children: A }),
|
|
14060
14054
|
/* @__PURE__ */ l.jsx(
|
|
14061
14055
|
ze,
|
|
14062
14056
|
{
|
|
@@ -14102,7 +14096,7 @@ function ci({
|
|
|
14102
14096
|
className: "h-full",
|
|
14103
14097
|
style: { height: "100%" },
|
|
14104
14098
|
messages: R,
|
|
14105
|
-
isStreaming:
|
|
14099
|
+
isStreaming: _,
|
|
14106
14100
|
streamingAssistantId: L,
|
|
14107
14101
|
streamingDebounceMs: typeof s == "number" ? s : o,
|
|
14108
14102
|
followNewMessages: i,
|
|
@@ -14129,7 +14123,7 @@ function ci({
|
|
|
14129
14123
|
/* @__PURE__ */ l.jsxs("div", { className: Ls, children: [
|
|
14130
14124
|
V && /* @__PURE__ */ l.jsx("div", { className: "mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
14131
14125
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
14132
|
-
/* @__PURE__ */ l.jsx(
|
|
14126
|
+
/* @__PURE__ */ l.jsx(Rc, { size: 16, className: "text-blue-600" }),
|
|
14133
14127
|
/* @__PURE__ */ l.jsx("span", { className: "text-sm font-medium text-blue-800", children: "Editing message" })
|
|
14134
14128
|
] }),
|
|
14135
14129
|
/* @__PURE__ */ l.jsx(
|
|
@@ -14154,7 +14148,7 @@ function ci({
|
|
|
14154
14148
|
onChange: (le) => eo(le),
|
|
14155
14149
|
className: "hidden"
|
|
14156
14150
|
},
|
|
14157
|
-
|
|
14151
|
+
Z
|
|
14158
14152
|
),
|
|
14159
14153
|
H.length > 0 && /* @__PURE__ */ l.jsx("div", { className: "flex flex-wrap gap-2", children: H.map((le, ve) => /* @__PURE__ */ l.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: [
|
|
14160
14154
|
/* @__PURE__ */ l.jsx(ui, { size: 14 }),
|
|
@@ -14201,7 +14195,7 @@ function ci({
|
|
|
14201
14195
|
type: "button",
|
|
14202
14196
|
size: "icon",
|
|
14203
14197
|
variant: "outline",
|
|
14204
|
-
disabled:
|
|
14198
|
+
disabled: _,
|
|
14205
14199
|
title: "More input actions",
|
|
14206
14200
|
className: d.moreButton || "",
|
|
14207
14201
|
children: /* @__PURE__ */ l.jsx(Hp, { size: 16 })
|
|
@@ -14237,7 +14231,7 @@ function ci({
|
|
|
14237
14231
|
initialValue: K,
|
|
14238
14232
|
editingMessageId: V,
|
|
14239
14233
|
placeholder: V ? "Edit your message..." : t,
|
|
14240
|
-
isStreaming:
|
|
14234
|
+
isStreaming: _,
|
|
14241
14235
|
disabled: !1,
|
|
14242
14236
|
maxLength: No,
|
|
14243
14237
|
onSend: Os,
|
|
@@ -14256,7 +14250,7 @@ const Ko = p.forwardRef(
|
|
|
14256
14250
|
"input",
|
|
14257
14251
|
{
|
|
14258
14252
|
type: t,
|
|
14259
|
-
className:
|
|
14253
|
+
className: J(
|
|
14260
14254
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
14261
14255
|
e
|
|
14262
14256
|
),
|
|
@@ -14280,13 +14274,13 @@ var Da = "ScrollArea", [ch, UT] = on(Da), [nC, zt] = ch(Da), uh = p.forwardRef(
|
|
|
14280
14274
|
dir: o,
|
|
14281
14275
|
scrollHideDelay: s = 600,
|
|
14282
14276
|
...i
|
|
14283
|
-
} = e, [a, c] = p.useState(null), [u, d] = p.useState(null), [f, h] = p.useState(null), [m, w] = p.useState(null), [v, g] = p.useState(null), [x, b] = p.useState(0), [y, R] = p.useState(0), [S, C] = p.useState(!1), [E, k] = p.useState(!1), N = Oe(t, (
|
|
14277
|
+
} = e, [a, c] = p.useState(null), [u, d] = p.useState(null), [f, h] = p.useState(null), [m, w] = p.useState(null), [v, g] = p.useState(null), [x, b] = p.useState(0), [y, R] = p.useState(0), [S, C] = p.useState(!1), [E, k] = p.useState(!1), N = Oe(t, (A) => c(A)), _ = ws(o);
|
|
14284
14278
|
return /* @__PURE__ */ l.jsx(
|
|
14285
14279
|
nC,
|
|
14286
14280
|
{
|
|
14287
14281
|
scope: n,
|
|
14288
14282
|
type: r,
|
|
14289
|
-
dir:
|
|
14283
|
+
dir: _,
|
|
14290
14284
|
scrollHideDelay: s,
|
|
14291
14285
|
scrollArea: a,
|
|
14292
14286
|
viewport: u,
|
|
@@ -14306,7 +14300,7 @@ var Da = "ScrollArea", [ch, UT] = on(Da), [nC, zt] = ch(Da), uh = p.forwardRef(
|
|
|
14306
14300
|
children: /* @__PURE__ */ l.jsx(
|
|
14307
14301
|
Se.div,
|
|
14308
14302
|
{
|
|
14309
|
-
dir:
|
|
14303
|
+
dir: _,
|
|
14310
14304
|
...i,
|
|
14311
14305
|
ref: N,
|
|
14312
14306
|
style: {
|
|
@@ -14480,7 +14474,7 @@ var rC = p.forwardRef((e, t) => {
|
|
|
14480
14474
|
ref: t,
|
|
14481
14475
|
onThumbPositionChange: () => {
|
|
14482
14476
|
if (o.viewport && s.current) {
|
|
14483
|
-
const h = o.viewport.scrollLeft, m =
|
|
14477
|
+
const h = o.viewport.scrollLeft, m = vc(h, a, o.dir);
|
|
14484
14478
|
s.current.style.transform = `translate3d(${m}px, 0, 0)`;
|
|
14485
14479
|
}
|
|
14486
14480
|
},
|
|
@@ -14498,7 +14492,7 @@ var rC = p.forwardRef((e, t) => {
|
|
|
14498
14492
|
ref: t,
|
|
14499
14493
|
onThumbPositionChange: () => {
|
|
14500
14494
|
if (o.viewport && s.current) {
|
|
14501
|
-
const h = o.viewport.scrollTop, m =
|
|
14495
|
+
const h = o.viewport.scrollTop, m = vc(h, a);
|
|
14502
14496
|
s.current.style.transform = `translate3d(0, ${m}px, 0)`;
|
|
14503
14497
|
}
|
|
14504
14498
|
},
|
|
@@ -14605,14 +14599,14 @@ var rC = p.forwardRef((e, t) => {
|
|
|
14605
14599
|
} = e, m = zt(an, n), [w, v] = p.useState(null), g = Oe(t, (N) => v(N)), x = p.useRef(null), b = p.useRef(""), y = m.viewport, R = r.content - r.viewport, S = ft(d), C = ft(c), E = Is(f, 10);
|
|
14606
14600
|
function k(N) {
|
|
14607
14601
|
if (x.current) {
|
|
14608
|
-
const
|
|
14609
|
-
u({ x:
|
|
14602
|
+
const _ = N.clientX - x.current.left, A = N.clientY - x.current.top;
|
|
14603
|
+
u({ x: _, y: A });
|
|
14610
14604
|
}
|
|
14611
14605
|
}
|
|
14612
14606
|
return p.useEffect(() => {
|
|
14613
|
-
const N = (
|
|
14614
|
-
const
|
|
14615
|
-
(w == null ? void 0 : w.contains(
|
|
14607
|
+
const N = (_) => {
|
|
14608
|
+
const A = _.target;
|
|
14609
|
+
(w == null ? void 0 : w.contains(A)) && S(_, R);
|
|
14616
14610
|
};
|
|
14617
14611
|
return document.addEventListener("wheel", N, { passive: !1 }), () => document.removeEventListener("wheel", N, { passive: !1 });
|
|
14618
14612
|
}, [y, w, R, S]), p.useEffect(C, [r, C]), sr(w, E), sr(m.content, E), /* @__PURE__ */ l.jsx(
|
|
@@ -14636,8 +14630,8 @@ var rC = p.forwardRef((e, t) => {
|
|
|
14636
14630
|
}),
|
|
14637
14631
|
onPointerMove: ce(e.onPointerMove, k),
|
|
14638
14632
|
onPointerUp: ce(e.onPointerUp, (N) => {
|
|
14639
|
-
const
|
|
14640
|
-
|
|
14633
|
+
const _ = N.target;
|
|
14634
|
+
_.hasPointerCapture(N.pointerId) && _.releasePointerCapture(N.pointerId), document.body.style.webkitUserSelect = b.current, m.viewport && (m.viewport.style.scrollBehavior = ""), x.current = null;
|
|
14641
14635
|
})
|
|
14642
14636
|
}
|
|
14643
14637
|
)
|
|
@@ -14737,7 +14731,7 @@ function uC(e, t, n, r = "ltr") {
|
|
|
14737
14731
|
const o = ks(n), s = o / 2, i = t || s, a = o - i, c = n.scrollbar.paddingStart + i, u = n.scrollbar.size - n.scrollbar.paddingEnd - a, d = n.content - n.viewport, f = r === "ltr" ? [0, d] : [d * -1, 0];
|
|
14738
14732
|
return wh([c, u], f)(e);
|
|
14739
14733
|
}
|
|
14740
|
-
function
|
|
14734
|
+
function vc(e, t, n = "ltr") {
|
|
14741
14735
|
const r = ks(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - o, i = t.content - t.viewport, a = s - r, c = n === "ltr" ? [0, i] : [i * -1, 0], u = Di(e, c);
|
|
14742
14736
|
return wh([0, i], [0, a])(u);
|
|
14743
14737
|
}
|
|
@@ -14784,7 +14778,7 @@ const Sh = p.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
14784
14778
|
yh,
|
|
14785
14779
|
{
|
|
14786
14780
|
ref: r,
|
|
14787
|
-
className:
|
|
14781
|
+
className: J("relative overflow-hidden", e),
|
|
14788
14782
|
...n,
|
|
14789
14783
|
children: [
|
|
14790
14784
|
/* @__PURE__ */ l.jsx(fC, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
|
|
@@ -14799,7 +14793,7 @@ const Ch = p.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
|
|
|
14799
14793
|
{
|
|
14800
14794
|
ref: r,
|
|
14801
14795
|
orientation: t,
|
|
14802
|
-
className:
|
|
14796
|
+
className: J(
|
|
14803
14797
|
"flex touch-none select-none transition-colors",
|
|
14804
14798
|
t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
14805
14799
|
t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -14810,7 +14804,7 @@ const Ch = p.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
|
|
|
14810
14804
|
}
|
|
14811
14805
|
));
|
|
14812
14806
|
Ch.displayName = La.displayName;
|
|
14813
|
-
function
|
|
14807
|
+
function wc({
|
|
14814
14808
|
className: e = "",
|
|
14815
14809
|
showCreateButton: t = !0,
|
|
14816
14810
|
showDeleteButton: n = !0,
|
|
@@ -14835,13 +14829,13 @@ function bc({
|
|
|
14835
14829
|
ot(() => {
|
|
14836
14830
|
y(h ?? []);
|
|
14837
14831
|
}, [h]);
|
|
14838
|
-
const
|
|
14832
|
+
const _ = async (I) => {
|
|
14839
14833
|
try {
|
|
14840
14834
|
await f(I), a == null || a(I), c == null || c(I);
|
|
14841
14835
|
} catch (M) {
|
|
14842
14836
|
console.error("Failed to select thread:", M);
|
|
14843
14837
|
}
|
|
14844
|
-
},
|
|
14838
|
+
}, A = async () => {
|
|
14845
14839
|
try {
|
|
14846
14840
|
N(!0);
|
|
14847
14841
|
const I = await w();
|
|
@@ -14874,8 +14868,8 @@ function bc({
|
|
|
14874
14868
|
}, K = (I) => {
|
|
14875
14869
|
if (!I) return "";
|
|
14876
14870
|
try {
|
|
14877
|
-
const M = new Date(I), Y = (/* @__PURE__ */ new Date()).getTime() - M.getTime(),
|
|
14878
|
-
return
|
|
14871
|
+
const M = new Date(I), Y = (/* @__PURE__ */ new Date()).getTime() - M.getTime(), Z = Math.floor(Y / (1e3 * 60 * 60 * 24));
|
|
14872
|
+
return Z === 0 ? M.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : Z === 1 ? "Yesterday" : Z < 7 ? `${Z} days ago` : M.toLocaleDateString();
|
|
14879
14873
|
} catch {
|
|
14880
14874
|
return "";
|
|
14881
14875
|
}
|
|
@@ -14884,7 +14878,7 @@ function bc({
|
|
|
14884
14878
|
t && /* @__PURE__ */ l.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__ */ l.jsx(
|
|
14885
14879
|
ze,
|
|
14886
14880
|
{
|
|
14887
|
-
onClick:
|
|
14881
|
+
onClick: A,
|
|
14888
14882
|
disabled: k || x,
|
|
14889
14883
|
className: s.createButton || "p-2",
|
|
14890
14884
|
size: "sm",
|
|
@@ -14907,7 +14901,7 @@ function bc({
|
|
|
14907
14901
|
] }) : b.slice().sort((I, M) => new Date(M.updatedAt || M.createdAt || "").getTime() - new Date(I.updatedAt || I.createdAt || "").getTime()).map((I) => /* @__PURE__ */ l.jsxs(
|
|
14908
14902
|
"div",
|
|
14909
14903
|
{
|
|
14910
|
-
onClick: () =>
|
|
14904
|
+
onClick: () => _(I.threadId),
|
|
14911
14905
|
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? m) === I.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`,
|
|
14912
14906
|
children: [
|
|
14913
14907
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -14923,7 +14917,7 @@ function bc({
|
|
|
14923
14917
|
] })
|
|
14924
14918
|
] }) }),
|
|
14925
14919
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
14926
|
-
r && R !== I.threadId && /* @__PURE__ */ l.jsx(ze, { variant: "ghost", size: "sm", onClick: (M) => F(I, M), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(
|
|
14920
|
+
r && R !== I.threadId && /* @__PURE__ */ l.jsx(ze, { variant: "ghost", size: "sm", onClick: (M) => F(I, M), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(Rc, { size: 12 }) }),
|
|
14927
14921
|
n && /* @__PURE__ */ l.jsx(
|
|
14928
14922
|
ze,
|
|
14929
14923
|
{
|
|
@@ -15048,7 +15042,7 @@ const bC = Xo(
|
|
|
15048
15042
|
Ih,
|
|
15049
15043
|
{
|
|
15050
15044
|
ref: n,
|
|
15051
|
-
className:
|
|
15045
|
+
className: J(bC(), e),
|
|
15052
15046
|
...t
|
|
15053
15047
|
}
|
|
15054
15048
|
));
|
|
@@ -15177,7 +15171,7 @@ var Mh = Ah, RC = jh;
|
|
|
15177
15171
|
const mn = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
15178
15172
|
Mh,
|
|
15179
15173
|
{
|
|
15180
|
-
className:
|
|
15174
|
+
className: J(
|
|
15181
15175
|
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
15182
15176
|
e
|
|
15183
15177
|
),
|
|
@@ -15186,7 +15180,7 @@ const mn = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
15186
15180
|
children: /* @__PURE__ */ l.jsx(
|
|
15187
15181
|
RC,
|
|
15188
15182
|
{
|
|
15189
|
-
className:
|
|
15183
|
+
className: J(
|
|
15190
15184
|
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
15191
15185
|
)
|
|
15192
15186
|
}
|
|
@@ -15241,12 +15235,12 @@ var IC = [" ", "Enter", "ArrowUp", "ArrowDown"], NC = [" ", "Enter"], Fn = "Sele
|
|
|
15241
15235
|
defaultProp: o ?? !1,
|
|
15242
15236
|
onChange: s,
|
|
15243
15237
|
caller: Fn
|
|
15244
|
-
}), [N,
|
|
15238
|
+
}), [N, _] = Dn({
|
|
15245
15239
|
prop: i,
|
|
15246
15240
|
defaultProp: a,
|
|
15247
15241
|
onChange: c,
|
|
15248
15242
|
caller: Fn
|
|
15249
|
-
}),
|
|
15243
|
+
}), A = p.useRef(null), L = g ? w || !!g.closest("form") : !0, [F, j] = p.useState(/* @__PURE__ */ new Set()), V = Array.from(F).map((B) => B.props.value).join(";");
|
|
15250
15244
|
return /* @__PURE__ */ l.jsx(of, { ...v, children: /* @__PURE__ */ l.jsxs(
|
|
15251
15245
|
_C,
|
|
15252
15246
|
{
|
|
@@ -15260,11 +15254,11 @@ var IC = [" ", "Enter", "ArrowUp", "ArrowDown"], NC = [" ", "Enter"], Fn = "Sele
|
|
|
15260
15254
|
onValueNodeHasChildrenChange: S,
|
|
15261
15255
|
contentId: en(),
|
|
15262
15256
|
value: N,
|
|
15263
|
-
onValueChange:
|
|
15257
|
+
onValueChange: _,
|
|
15264
15258
|
open: E,
|
|
15265
15259
|
onOpenChange: k,
|
|
15266
15260
|
dir: C,
|
|
15267
|
-
triggerPointerDownPosRef:
|
|
15261
|
+
triggerPointerDownPosRef: A,
|
|
15268
15262
|
disabled: h,
|
|
15269
15263
|
children: [
|
|
15270
15264
|
/* @__PURE__ */ l.jsx(As.Provider, { scope: t, children: /* @__PURE__ */ l.jsx(
|
|
@@ -15292,7 +15286,7 @@ var IC = [" ", "Enter", "ArrowUp", "ArrowDown"], NC = [" ", "Enter"], Fn = "Sele
|
|
|
15292
15286
|
name: d,
|
|
15293
15287
|
autoComplete: f,
|
|
15294
15288
|
value: N,
|
|
15295
|
-
onChange: (B) =>
|
|
15289
|
+
onChange: (B) => _(B.target.value),
|
|
15296
15290
|
disabled: h,
|
|
15297
15291
|
form: w,
|
|
15298
15292
|
children: [
|
|
@@ -15415,7 +15409,7 @@ var Bt = 10, [Vh, Rn] = pr(zn), DC = "SelectContentImpl", LC = nr("SelectContent
|
|
|
15415
15409
|
avoidCollisions: g,
|
|
15416
15410
|
//
|
|
15417
15411
|
...x
|
|
15418
|
-
} = e, b = Tn(zn, n), [y, R] = p.useState(null), [S, C] = p.useState(null), E = Oe(t, (W) => R(W)), [k, N] = p.useState(null), [
|
|
15412
|
+
} = e, b = Tn(zn, n), [y, R] = p.useState(null), [S, C] = p.useState(null), E = Oe(t, (W) => R(W)), [k, N] = p.useState(null), [_, A] = p.useState(
|
|
15419
15413
|
null
|
|
15420
15414
|
), L = _s(n), [F, j] = p.useState(!1), V = p.useRef(!1);
|
|
15421
15415
|
p.useEffect(() => {
|
|
@@ -15467,10 +15461,10 @@ var Bt = 10, [Vh, Rn] = pr(zn), DC = "SelectContentImpl", LC = nr("SelectContent
|
|
|
15467
15461
|
(b.value !== void 0 && b.value === O || te) && (N(W), te && (V.current = !0));
|
|
15468
15462
|
},
|
|
15469
15463
|
[b.value]
|
|
15470
|
-
),
|
|
15464
|
+
), Z = p.useCallback(() => y == null ? void 0 : y.focus(), [y]), ie = p.useCallback(
|
|
15471
15465
|
(W, O, G) => {
|
|
15472
15466
|
const te = !V.current && !G;
|
|
15473
|
-
(b.value !== void 0 && b.value === O || te) &&
|
|
15467
|
+
(b.value !== void 0 && b.value === O || te) && A(W);
|
|
15474
15468
|
},
|
|
15475
15469
|
[b.value]
|
|
15476
15470
|
), xe = r === "popper" ? Li : qh, Te = xe === Li ? {
|
|
@@ -15494,10 +15488,10 @@ var Bt = 10, [Vh, Rn] = pr(zn), DC = "SelectContentImpl", LC = nr("SelectContent
|
|
|
15494
15488
|
onViewportChange: C,
|
|
15495
15489
|
itemRefCallback: Y,
|
|
15496
15490
|
selectedItem: k,
|
|
15497
|
-
onItemLeave:
|
|
15491
|
+
onItemLeave: Z,
|
|
15498
15492
|
itemTextRefCallback: ie,
|
|
15499
15493
|
focusSelectedItem: K,
|
|
15500
|
-
selectedItemText:
|
|
15494
|
+
selectedItemText: _,
|
|
15501
15495
|
position: r,
|
|
15502
15496
|
isPositioned: F,
|
|
15503
15497
|
searchRef: M,
|
|
@@ -15567,9 +15561,9 @@ Kh.displayName = DC;
|
|
|
15567
15561
|
var $C = "SelectItemAlignedPosition", qh = p.forwardRef((e, t) => {
|
|
15568
15562
|
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Tn(zn, n), i = Rn(zn, n), [a, c] = p.useState(null), [u, d] = p.useState(null), f = Oe(t, (E) => d(E)), h = _s(n), m = p.useRef(!1), w = p.useRef(!0), { viewport: v, selectedItem: g, selectedItemText: x, focusSelectedItem: b } = i, y = p.useCallback(() => {
|
|
15569
15563
|
if (s.trigger && s.valueNode && a && u && v && g && x) {
|
|
15570
|
-
const E = s.trigger.getBoundingClientRect(), k = u.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(),
|
|
15564
|
+
const E = s.trigger.getBoundingClientRect(), k = u.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
|
|
15571
15565
|
if (s.dir !== "rtl") {
|
|
15572
|
-
const ue =
|
|
15566
|
+
const ue = _.left - k.left, ae = N.left - ue, $e = E.left - ae, Ke = E.width + $e, Ie = Math.max(Ke, k.width), je = window.innerWidth - Bt, Ue = Di(ae, [
|
|
15573
15567
|
Bt,
|
|
15574
15568
|
// Prevents the content from going off the starting edge of the
|
|
15575
15569
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -15580,24 +15574,24 @@ var $C = "SelectItemAlignedPosition", qh = p.forwardRef((e, t) => {
|
|
|
15580
15574
|
]);
|
|
15581
15575
|
a.style.minWidth = Ke + "px", a.style.left = Ue + "px";
|
|
15582
15576
|
} else {
|
|
15583
|
-
const ue = k.right -
|
|
15577
|
+
const ue = k.right - _.right, ae = window.innerWidth - N.right - ue, $e = window.innerWidth - E.right - ae, Ke = E.width + $e, Ie = Math.max(Ke, k.width), je = window.innerWidth - Bt, Ue = Di(ae, [
|
|
15584
15578
|
Bt,
|
|
15585
15579
|
Math.max(Bt, je - Ie)
|
|
15586
15580
|
]);
|
|
15587
15581
|
a.style.minWidth = Ke + "px", a.style.right = Ue + "px";
|
|
15588
15582
|
}
|
|
15589
|
-
const
|
|
15583
|
+
const A = h(), L = window.innerHeight - Bt * 2, F = v.scrollHeight, j = window.getComputedStyle(u), V = parseInt(j.borderTopWidth, 10), B = parseInt(j.paddingTop, 10), K = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), I = V + B + F + D + K, M = Math.min(g.offsetHeight * 5, I), H = window.getComputedStyle(v), Y = parseInt(H.paddingTop, 10), Z = parseInt(H.paddingBottom, 10), ie = E.top + E.height / 2 - Bt, xe = L - ie, Te = g.offsetHeight / 2, W = g.offsetTop + Te, O = V + B + W, G = I - O;
|
|
15590
15584
|
if (O <= ie) {
|
|
15591
|
-
const ue =
|
|
15585
|
+
const ue = A.length > 0 && g === A[A.length - 1].ref.current;
|
|
15592
15586
|
a.style.bottom = "0px";
|
|
15593
15587
|
const ae = u.clientHeight - v.offsetTop - v.offsetHeight, $e = Math.max(
|
|
15594
15588
|
xe,
|
|
15595
15589
|
Te + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
15596
|
-
(ue ?
|
|
15590
|
+
(ue ? Z : 0) + ae + K
|
|
15597
15591
|
), Ke = O + $e;
|
|
15598
15592
|
a.style.height = Ke + "px";
|
|
15599
15593
|
} else {
|
|
15600
|
-
const ue =
|
|
15594
|
+
const ue = A.length > 0 && g === A[0].ref.current;
|
|
15601
15595
|
a.style.top = "0px";
|
|
15602
15596
|
const $e = Math.max(
|
|
15603
15597
|
ie,
|
|
@@ -16022,11 +16016,11 @@ function GC(e, t) {
|
|
|
16022
16016
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
16023
16017
|
}
|
|
16024
16018
|
var YC = Lh, dp = Fh, XC = Bh, JC = Hh, ZC = Uh, fp = Wh, QC = Gh, hp = Jh, pp = Qh, eT = ep, tT = np, mp = rp, gp = op, xp = ip;
|
|
16025
|
-
const
|
|
16019
|
+
const bc = YC, yc = XC, Hi = p.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ l.jsxs(
|
|
16026
16020
|
dp,
|
|
16027
16021
|
{
|
|
16028
16022
|
ref: r,
|
|
16029
|
-
className:
|
|
16023
|
+
className: J(
|
|
16030
16024
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
16031
16025
|
e
|
|
16032
16026
|
),
|
|
@@ -16042,7 +16036,7 @@ const vp = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
16042
16036
|
mp,
|
|
16043
16037
|
{
|
|
16044
16038
|
ref: n,
|
|
16045
|
-
className:
|
|
16039
|
+
className: J(
|
|
16046
16040
|
"flex cursor-default items-center justify-center py-1",
|
|
16047
16041
|
e
|
|
16048
16042
|
),
|
|
@@ -16055,7 +16049,7 @@ const wp = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
16055
16049
|
gp,
|
|
16056
16050
|
{
|
|
16057
16051
|
ref: n,
|
|
16058
|
-
className:
|
|
16052
|
+
className: J(
|
|
16059
16053
|
"flex cursor-default items-center justify-center py-1",
|
|
16060
16054
|
e
|
|
16061
16055
|
),
|
|
@@ -16068,7 +16062,7 @@ const Ui = p.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
16068
16062
|
fp,
|
|
16069
16063
|
{
|
|
16070
16064
|
ref: o,
|
|
16071
|
-
className:
|
|
16065
|
+
className: J(
|
|
16072
16066
|
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
16073
16067
|
n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
16074
16068
|
e
|
|
@@ -16080,7 +16074,7 @@ const Ui = p.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
16080
16074
|
/* @__PURE__ */ l.jsx(
|
|
16081
16075
|
QC,
|
|
16082
16076
|
{
|
|
16083
|
-
className:
|
|
16077
|
+
className: J(
|
|
16084
16078
|
"p-1",
|
|
16085
16079
|
n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
16086
16080
|
),
|
|
@@ -16096,7 +16090,7 @@ const nT = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
16096
16090
|
hp,
|
|
16097
16091
|
{
|
|
16098
16092
|
ref: n,
|
|
16099
|
-
className:
|
|
16093
|
+
className: J("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
16100
16094
|
...t
|
|
16101
16095
|
}
|
|
16102
16096
|
));
|
|
@@ -16105,7 +16099,7 @@ const In = p.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
16105
16099
|
pp,
|
|
16106
16100
|
{
|
|
16107
16101
|
ref: r,
|
|
16108
|
-
className:
|
|
16102
|
+
className: J(
|
|
16109
16103
|
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
16110
16104
|
e
|
|
16111
16105
|
),
|
|
@@ -16121,13 +16115,13 @@ const rT = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
16121
16115
|
xp,
|
|
16122
16116
|
{
|
|
16123
16117
|
ref: n,
|
|
16124
|
-
className:
|
|
16118
|
+
className: J("-mx-1 my-1 h-px bg-muted", e),
|
|
16125
16119
|
...t
|
|
16126
16120
|
}
|
|
16127
16121
|
));
|
|
16128
16122
|
rT.displayName = xp.displayName;
|
|
16129
|
-
var oT = "Separator",
|
|
16130
|
-
const { decorative: n, orientation: r =
|
|
16123
|
+
var oT = "Separator", Sc = "horizontal", sT = ["horizontal", "vertical"], bp = p.forwardRef((e, t) => {
|
|
16124
|
+
const { decorative: n, orientation: r = Sc, ...o } = e, s = iT(r) ? r : Sc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
|
|
16131
16125
|
return /* @__PURE__ */ l.jsx(
|
|
16132
16126
|
Se.div,
|
|
16133
16127
|
{
|
|
@@ -16150,7 +16144,7 @@ const Sp = p.forwardRef(
|
|
|
16150
16144
|
ref: o,
|
|
16151
16145
|
decorative: n,
|
|
16152
16146
|
orientation: t,
|
|
16153
|
-
className:
|
|
16147
|
+
className: J(
|
|
16154
16148
|
"shrink-0 bg-border",
|
|
16155
16149
|
t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
16156
16150
|
e
|
|
@@ -16163,7 +16157,7 @@ Sp.displayName = yp.displayName;
|
|
|
16163
16157
|
const aT = Ed, lT = zb, cT = kd, Cp = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
16164
16158
|
gs,
|
|
16165
16159
|
{
|
|
16166
|
-
className:
|
|
16160
|
+
className: J(
|
|
16167
16161
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
16168
16162
|
e
|
|
16169
16163
|
),
|
|
@@ -16193,7 +16187,7 @@ const uT = Xo(
|
|
|
16193
16187
|
xs,
|
|
16194
16188
|
{
|
|
16195
16189
|
ref: o,
|
|
16196
|
-
className:
|
|
16190
|
+
className: J(uT({ side: e }), t),
|
|
16197
16191
|
...r,
|
|
16198
16192
|
children: [
|
|
16199
16193
|
n,
|
|
@@ -16212,7 +16206,7 @@ const Rp = ({
|
|
|
16212
16206
|
}) => /* @__PURE__ */ l.jsx(
|
|
16213
16207
|
"div",
|
|
16214
16208
|
{
|
|
16215
|
-
className:
|
|
16209
|
+
className: J(
|
|
16216
16210
|
"flex flex-col space-y-2 text-center sm:text-left",
|
|
16217
16211
|
e
|
|
16218
16212
|
),
|
|
@@ -16224,7 +16218,7 @@ const Ep = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
16224
16218
|
jn,
|
|
16225
16219
|
{
|
|
16226
16220
|
ref: n,
|
|
16227
|
-
className:
|
|
16221
|
+
className: J("text-lg font-semibold text-foreground", e),
|
|
16228
16222
|
...t
|
|
16229
16223
|
}
|
|
16230
16224
|
));
|
|
@@ -16233,7 +16227,7 @@ const kp = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
16233
16227
|
vs,
|
|
16234
16228
|
{
|
|
16235
16229
|
ref: n,
|
|
16236
|
-
className:
|
|
16230
|
+
className: J("text-sm text-muted-foreground", e),
|
|
16237
16231
|
...t
|
|
16238
16232
|
}
|
|
16239
16233
|
));
|
|
@@ -16380,7 +16374,7 @@ function GT({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
16380
16374
|
/* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
|
|
16381
16375
|
/* @__PURE__ */ l.jsx(Ot, { htmlFor: "layout", children: "Layout Style" }),
|
|
16382
16376
|
/* @__PURE__ */ l.jsxs(
|
|
16383
|
-
|
|
16377
|
+
bc,
|
|
16384
16378
|
{
|
|
16385
16379
|
value: a.ui.layout,
|
|
16386
16380
|
onValueChange: (g) => c((x) => ({
|
|
@@ -16388,7 +16382,7 @@ function GT({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
16388
16382
|
ui: { ...x.ui, layout: g }
|
|
16389
16383
|
})),
|
|
16390
16384
|
children: [
|
|
16391
|
-
/* @__PURE__ */ l.jsx(Hi, { children: /* @__PURE__ */ l.jsx(
|
|
16385
|
+
/* @__PURE__ */ l.jsx(Hi, { children: /* @__PURE__ */ l.jsx(yc, {}) }),
|
|
16392
16386
|
/* @__PURE__ */ l.jsxs(Ui, { children: [
|
|
16393
16387
|
/* @__PURE__ */ l.jsx(In, { value: "sidebar", children: "Sidebar Layout" }),
|
|
16394
16388
|
/* @__PURE__ */ l.jsx(In, { value: "fullscreen", children: "Fullscreen" }),
|
|
@@ -16401,7 +16395,7 @@ function GT({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
16401
16395
|
/* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
|
|
16402
16396
|
/* @__PURE__ */ l.jsx(Ot, { htmlFor: "theme", children: "Theme" }),
|
|
16403
16397
|
/* @__PURE__ */ l.jsxs(
|
|
16404
|
-
|
|
16398
|
+
bc,
|
|
16405
16399
|
{
|
|
16406
16400
|
value: a.ui.theme,
|
|
16407
16401
|
onValueChange: (g) => c((x) => ({
|
|
@@ -16409,7 +16403,7 @@ function GT({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
16409
16403
|
ui: { ...x.ui, theme: g }
|
|
16410
16404
|
})),
|
|
16411
16405
|
children: [
|
|
16412
|
-
/* @__PURE__ */ l.jsx(Hi, { children: /* @__PURE__ */ l.jsx(
|
|
16406
|
+
/* @__PURE__ */ l.jsx(Hi, { children: /* @__PURE__ */ l.jsx(yc, {}) }),
|
|
16413
16407
|
/* @__PURE__ */ l.jsxs(Ui, { children: [
|
|
16414
16408
|
/* @__PURE__ */ l.jsx(In, { value: "light", children: "Light" }),
|
|
16415
16409
|
/* @__PURE__ */ l.jsx(In, { value: "dark", children: "Dark" }),
|
|
@@ -16585,7 +16579,7 @@ function YT({
|
|
|
16585
16579
|
style: a(t),
|
|
16586
16580
|
children: /* @__PURE__ */ l.jsxs("div", { className: "flex-1 flex min-h-0 overflow-hidden", children: [
|
|
16587
16581
|
n && /* @__PURE__ */ l.jsx("div", { className: `w-80 border-r flex-shrink-0 overflow-hidden ${o.sidebar || ""}`, children: /* @__PURE__ */ l.jsx(
|
|
16588
|
-
|
|
16582
|
+
wc,
|
|
16589
16583
|
{
|
|
16590
16584
|
showCreateButton: !0,
|
|
16591
16585
|
showDeleteButton: !0,
|
|
@@ -16603,7 +16597,7 @@ function YT({
|
|
|
16603
16597
|
style: a(t),
|
|
16604
16598
|
children: [
|
|
16605
16599
|
n && /* @__PURE__ */ l.jsx("div", { className: `w-80 border-r bg-gray-50 flex-shrink-0 overflow-hidden ${o.sidebar || ""}`, children: /* @__PURE__ */ l.jsx(
|
|
16606
|
-
|
|
16600
|
+
wc,
|
|
16607
16601
|
{
|
|
16608
16602
|
showCreateButton: !0,
|
|
16609
16603
|
showDeleteButton: !0,
|
|
@@ -16621,10 +16615,10 @@ export {
|
|
|
16621
16615
|
ci as ChatInterface,
|
|
16622
16616
|
Vs as ChatProviders,
|
|
16623
16617
|
GT as ChatSettings,
|
|
16624
|
-
|
|
16618
|
+
Ul as MarkdownContent,
|
|
16625
16619
|
Zb as MessageComponent,
|
|
16626
16620
|
Md as MessageList,
|
|
16627
|
-
|
|
16621
|
+
wc as ThreadManager,
|
|
16628
16622
|
VT as applySettings,
|
|
16629
16623
|
On as chatApiClient,
|
|
16630
16624
|
YT as default,
|