teodor-new-chat-ui 3.0.84 → 3.0.85
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 +692 -708
- package/dist/index.umd.js +19 -19
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as f from "react";
|
|
2
|
-
import K, { useState as de, useRef as
|
|
2
|
+
import K, { useState as de, useRef as We, useCallback as Ue, useEffect as ze, useReducer as Dp, useMemo as sn, createContext as xc, useContext as vc, createElement as to, useLayoutEffect as Lp } from "react";
|
|
3
3
|
import { Square as Fp, Send as Bp, X as Un, ExternalLink as $p, Download as Hp, Image as bc, FileText as za, Loader as zp, ChevronUp as fr, ChevronDown as zn, Copy as Ua, Edit as Wa, RotateCcw as Zs, Bot as Va, Wrench as Up, User as Wp, ChevronRight as Vp, Check as Oi, Circle as Gp, Edit3 as wc, Paperclip as Ga, Loader2 as Kp, Plus as Yp, FileSpreadsheet as qp, MessageSquarePlus as Xp, MessageSquare as Jp, Calendar as Zp, Trash2 as Qp, PanelLeft as em, Settings as tm, Server as nm, EyeOff as rm, Eye as om, Layout as sm, MessageCircle as im, Save as am } from "lucide-react";
|
|
4
4
|
import { Slot as Qn, createSlot as Yn, createSlottable as lm } from "@radix-ui/react-slot";
|
|
5
5
|
import { cva as Pr } from "class-variance-authority";
|
|
@@ -69,10 +69,10 @@ function fm() {
|
|
|
69
69
|
Me.unshift("Warning: " + U), Function.prototype.apply.call(console[R], console, Me);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
var E = !1,
|
|
72
|
+
var E = !1, S = !1, T = !1, C = !1, I = !1, N;
|
|
73
73
|
N = Symbol.for("react.module.reference");
|
|
74
|
-
function
|
|
75
|
-
return !!(typeof R == "string" || typeof R == "function" || R === r || R === s || I || R === o || R === u || R === d ||
|
|
74
|
+
function k(R) {
|
|
75
|
+
return !!(typeof R == "string" || typeof R == "function" || R === r || R === s || I || R === o || R === u || R === d || C || R === v || E || S || T || typeof R == "object" && R !== null && (R.$$typeof === m || R.$$typeof === h || R.$$typeof === i || R.$$typeof === a || R.$$typeof === c || // This needs to include all possible module reference object
|
|
76
76
|
// types supported by any Flight configuration anywhere since
|
|
77
77
|
// we don't know which Flight build this will end up being used
|
|
78
78
|
// with.
|
|
@@ -133,7 +133,7 @@ function fm() {
|
|
|
133
133
|
}
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
|
-
var
|
|
136
|
+
var j = Object.assign, $ = 0, L, q, O, _, z, X, oe;
|
|
137
137
|
function F() {
|
|
138
138
|
}
|
|
139
139
|
F.__reactDisabledLog = !0;
|
|
@@ -169,25 +169,25 @@ function fm() {
|
|
|
169
169
|
writable: !0
|
|
170
170
|
};
|
|
171
171
|
Object.defineProperties(console, {
|
|
172
|
-
log:
|
|
172
|
+
log: j({}, R, {
|
|
173
173
|
value: L
|
|
174
174
|
}),
|
|
175
|
-
info:
|
|
175
|
+
info: j({}, R, {
|
|
176
176
|
value: q
|
|
177
177
|
}),
|
|
178
|
-
warn:
|
|
178
|
+
warn: j({}, R, {
|
|
179
179
|
value: O
|
|
180
180
|
}),
|
|
181
|
-
error:
|
|
181
|
+
error: j({}, R, {
|
|
182
182
|
value: _
|
|
183
183
|
}),
|
|
184
|
-
group:
|
|
184
|
+
group: j({}, R, {
|
|
185
185
|
value: z
|
|
186
186
|
}),
|
|
187
|
-
groupCollapsed:
|
|
187
|
+
groupCollapsed: j({}, R, {
|
|
188
188
|
value: X
|
|
189
189
|
}),
|
|
190
|
-
groupEnd:
|
|
190
|
+
groupEnd: j({}, R, {
|
|
191
191
|
value: oe
|
|
192
192
|
})
|
|
193
193
|
});
|
|
@@ -578,7 +578,7 @@ Check the top-level render call using <` + te + ">.");
|
|
|
578
578
|
}
|
|
579
579
|
function $a(R, U, te, ge, Ae, Me) {
|
|
580
580
|
{
|
|
581
|
-
var Ee =
|
|
581
|
+
var Ee = k(R);
|
|
582
582
|
if (!Ee) {
|
|
583
583
|
var Te = "";
|
|
584
584
|
(R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (Te += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
@@ -796,7 +796,7 @@ const Km = (e) => {
|
|
|
796
796
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
797
797
|
typeof setImmediate == "function",
|
|
798
798
|
pt(bn.postMessage)
|
|
799
|
-
), Xm = typeof queueMicrotask < "u" ? queueMicrotask.bind(bn) : typeof process < "u" && process.nextTick || jc, Jm = (e) => e != null && pt(e[$o]),
|
|
799
|
+
), Xm = typeof queueMicrotask < "u" ? queueMicrotask.bind(bn) : typeof process < "u" && process.nextTick || jc, Jm = (e) => e != null && pt(e[$o]), A = {
|
|
800
800
|
isArray: er,
|
|
801
801
|
isArrayBuffer: Tc,
|
|
802
802
|
isBuffer: _r,
|
|
@@ -859,7 +859,7 @@ const Km = (e) => {
|
|
|
859
859
|
function we(e, t, n, r, o) {
|
|
860
860
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
861
861
|
}
|
|
862
|
-
|
|
862
|
+
A.inherits(we, Error, {
|
|
863
863
|
toJSON: function() {
|
|
864
864
|
return {
|
|
865
865
|
// Standard
|
|
@@ -874,7 +874,7 @@ k.inherits(we, Error, {
|
|
|
874
874
|
columnNumber: this.columnNumber,
|
|
875
875
|
stack: this.stack,
|
|
876
876
|
// Axios
|
|
877
|
-
config:
|
|
877
|
+
config: A.toJSONObject(this.config),
|
|
878
878
|
code: this.code,
|
|
879
879
|
status: this.status
|
|
880
880
|
};
|
|
@@ -902,7 +902,7 @@ Object.defineProperties(we, kc);
|
|
|
902
902
|
Object.defineProperty(Ac, "isAxiosError", { value: !0 });
|
|
903
903
|
we.from = (e, t, n, r, o, s) => {
|
|
904
904
|
const i = Object.create(Ac);
|
|
905
|
-
|
|
905
|
+
A.toFlatObject(e, i, function(d) {
|
|
906
906
|
return d !== Error.prototype;
|
|
907
907
|
}, (u) => u !== "isAxiosError");
|
|
908
908
|
const a = e && e.message ? e.message : "Error", c = t == null && e ? e.code : t;
|
|
@@ -910,10 +910,10 @@ we.from = (e, t, n, r, o, s) => {
|
|
|
910
910
|
};
|
|
911
911
|
const Zm = null;
|
|
912
912
|
function ti(e) {
|
|
913
|
-
return
|
|
913
|
+
return A.isPlainObject(e) || A.isArray(e);
|
|
914
914
|
}
|
|
915
915
|
function Pc(e) {
|
|
916
|
-
return
|
|
916
|
+
return A.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
917
917
|
}
|
|
918
918
|
function Xa(e, t, n) {
|
|
919
919
|
return e ? e.concat(t).map(function(o, s) {
|
|
@@ -921,42 +921,42 @@ function Xa(e, t, n) {
|
|
|
921
921
|
}).join(n ? "." : "") : t;
|
|
922
922
|
}
|
|
923
923
|
function Qm(e) {
|
|
924
|
-
return
|
|
924
|
+
return A.isArray(e) && !e.some(ti);
|
|
925
925
|
}
|
|
926
|
-
const eg =
|
|
926
|
+
const eg = A.toFlatObject(A, {}, null, function(t) {
|
|
927
927
|
return /^is[A-Z]/.test(t);
|
|
928
928
|
});
|
|
929
929
|
function Uo(e, t, n) {
|
|
930
|
-
if (!
|
|
930
|
+
if (!A.isObject(e))
|
|
931
931
|
throw new TypeError("target must be an object");
|
|
932
|
-
t = t || new FormData(), n =
|
|
932
|
+
t = t || new FormData(), n = A.toFlatObject(n, {
|
|
933
933
|
metaTokens: !0,
|
|
934
934
|
dots: !1,
|
|
935
935
|
indexes: !1
|
|
936
936
|
}, !1, function(g, p) {
|
|
937
|
-
return !
|
|
937
|
+
return !A.isUndefined(p[g]);
|
|
938
938
|
});
|
|
939
|
-
const r = n.metaTokens, o = n.visitor || d, s = n.dots, i = n.indexes, c = (n.Blob || typeof Blob < "u" && Blob) &&
|
|
940
|
-
if (!
|
|
939
|
+
const r = n.metaTokens, o = n.visitor || d, s = n.dots, i = n.indexes, c = (n.Blob || typeof Blob < "u" && Blob) && A.isSpecCompliantForm(t);
|
|
940
|
+
if (!A.isFunction(o))
|
|
941
941
|
throw new TypeError("visitor must be a function");
|
|
942
942
|
function u(x) {
|
|
943
943
|
if (x === null) return "";
|
|
944
|
-
if (
|
|
944
|
+
if (A.isDate(x))
|
|
945
945
|
return x.toISOString();
|
|
946
|
-
if (
|
|
946
|
+
if (A.isBoolean(x))
|
|
947
947
|
return x.toString();
|
|
948
|
-
if (!c &&
|
|
948
|
+
if (!c && A.isBlob(x))
|
|
949
949
|
throw new we("Blob is not supported. Use a Buffer instead.");
|
|
950
|
-
return
|
|
950
|
+
return A.isArrayBuffer(x) || A.isTypedArray(x) ? c && typeof Blob == "function" ? new Blob([x]) : Buffer.from(x) : x;
|
|
951
951
|
}
|
|
952
952
|
function d(x, g, p) {
|
|
953
953
|
let b = x;
|
|
954
954
|
if (x && !p && typeof x == "object") {
|
|
955
|
-
if (
|
|
955
|
+
if (A.endsWith(g, "{}"))
|
|
956
956
|
g = r ? g : g.slice(0, -2), x = JSON.stringify(x);
|
|
957
|
-
else if (
|
|
957
|
+
else if (A.isArray(x) && Qm(x) || (A.isFileList(x) || A.endsWith(g, "[]")) && (b = A.toArray(x)))
|
|
958
958
|
return g = Pc(g), b.forEach(function(y, E) {
|
|
959
|
-
!(
|
|
959
|
+
!(A.isUndefined(y) || y === null) && t.append(
|
|
960
960
|
// eslint-disable-next-line no-nested-ternary
|
|
961
961
|
i === !0 ? Xa([g], E, s) : i === null ? g : g + "[]",
|
|
962
962
|
u(y)
|
|
@@ -971,21 +971,21 @@ function Uo(e, t, n) {
|
|
|
971
971
|
isVisitable: ti
|
|
972
972
|
});
|
|
973
973
|
function v(x, g) {
|
|
974
|
-
if (!
|
|
974
|
+
if (!A.isUndefined(x)) {
|
|
975
975
|
if (h.indexOf(x) !== -1)
|
|
976
976
|
throw Error("Circular reference detected in " + g.join("."));
|
|
977
|
-
h.push(x),
|
|
978
|
-
(!(
|
|
977
|
+
h.push(x), A.forEach(x, function(b, w) {
|
|
978
|
+
(!(A.isUndefined(b) || b === null) && o.call(
|
|
979
979
|
t,
|
|
980
980
|
b,
|
|
981
|
-
|
|
981
|
+
A.isString(w) ? w.trim() : w,
|
|
982
982
|
g,
|
|
983
983
|
m
|
|
984
984
|
)) === !0 && v(b, g ? g.concat(w) : [w]);
|
|
985
985
|
}), h.pop();
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
|
-
if (!
|
|
988
|
+
if (!A.isObject(e))
|
|
989
989
|
throw new TypeError("data must be an object");
|
|
990
990
|
return v(e), t;
|
|
991
991
|
}
|
|
@@ -1025,12 +1025,12 @@ function Oc(e, t, n) {
|
|
|
1025
1025
|
if (!t)
|
|
1026
1026
|
return e;
|
|
1027
1027
|
const r = n && n.encode || tg;
|
|
1028
|
-
|
|
1028
|
+
A.isFunction(n) && (n = {
|
|
1029
1029
|
serialize: n
|
|
1030
1030
|
});
|
|
1031
1031
|
const o = n && n.serialize;
|
|
1032
1032
|
let s;
|
|
1033
|
-
if (o ? s = o(t, n) : s =
|
|
1033
|
+
if (o ? s = o(t, n) : s = A.isURLSearchParams(t) ? t.toString() : new Di(t, n).toString(r), s) {
|
|
1034
1034
|
const i = e.indexOf("#");
|
|
1035
1035
|
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
|
1036
1036
|
}
|
|
@@ -1085,7 +1085,7 @@ class Za {
|
|
|
1085
1085
|
* @returns {void}
|
|
1086
1086
|
*/
|
|
1087
1087
|
forEach(t) {
|
|
1088
|
-
|
|
1088
|
+
A.forEach(this.handlers, function(r) {
|
|
1089
1089
|
r !== null && t(r);
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
@@ -1117,13 +1117,13 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", lg
|
|
|
1117
1117
|
function ug(e, t) {
|
|
1118
1118
|
return Uo(e, new lt.classes.URLSearchParams(), {
|
|
1119
1119
|
visitor: function(n, r, o, s) {
|
|
1120
|
-
return lt.isNode &&
|
|
1120
|
+
return lt.isNode && A.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
1121
1121
|
},
|
|
1122
1122
|
...t
|
|
1123
1123
|
});
|
|
1124
1124
|
}
|
|
1125
1125
|
function dg(e) {
|
|
1126
|
-
return
|
|
1126
|
+
return A.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
1127
1127
|
}
|
|
1128
1128
|
function fg(e) {
|
|
1129
1129
|
const t = {}, n = Object.keys(e);
|
|
@@ -1139,20 +1139,20 @@ function Dc(e) {
|
|
|
1139
1139
|
let i = n[s++];
|
|
1140
1140
|
if (i === "__proto__") return !0;
|
|
1141
1141
|
const a = Number.isFinite(+i), c = s >= n.length;
|
|
1142
|
-
return i = !i &&
|
|
1142
|
+
return i = !i && A.isArray(o) ? o.length : i, c ? (A.hasOwnProp(o, i) ? o[i] = [o[i], r] : o[i] = r, !a) : ((!o[i] || !A.isObject(o[i])) && (o[i] = []), t(n, r, o[i], s) && A.isArray(o[i]) && (o[i] = fg(o[i])), !a);
|
|
1143
1143
|
}
|
|
1144
|
-
if (
|
|
1144
|
+
if (A.isFormData(e) && A.isFunction(e.entries)) {
|
|
1145
1145
|
const n = {};
|
|
1146
|
-
return
|
|
1146
|
+
return A.forEachEntry(e, (r, o) => {
|
|
1147
1147
|
t(dg(r), o, n, 0);
|
|
1148
1148
|
}), n;
|
|
1149
1149
|
}
|
|
1150
1150
|
return null;
|
|
1151
1151
|
}
|
|
1152
1152
|
function hg(e, t, n) {
|
|
1153
|
-
if (
|
|
1153
|
+
if (A.isString(e))
|
|
1154
1154
|
try {
|
|
1155
|
-
return (t || JSON.parse)(e),
|
|
1155
|
+
return (t || JSON.parse)(e), A.trim(e);
|
|
1156
1156
|
} catch (r) {
|
|
1157
1157
|
if (r.name !== "SyntaxError")
|
|
1158
1158
|
throw r;
|
|
@@ -1163,20 +1163,20 @@ const Dr = {
|
|
|
1163
1163
|
transitional: Mc,
|
|
1164
1164
|
adapter: ["xhr", "http", "fetch"],
|
|
1165
1165
|
transformRequest: [function(t, n) {
|
|
1166
|
-
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s =
|
|
1167
|
-
if (s &&
|
|
1166
|
+
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = A.isObject(t);
|
|
1167
|
+
if (s && A.isHTMLForm(t) && (t = new FormData(t)), A.isFormData(t))
|
|
1168
1168
|
return o ? JSON.stringify(Dc(t)) : t;
|
|
1169
|
-
if (
|
|
1169
|
+
if (A.isArrayBuffer(t) || A.isBuffer(t) || A.isStream(t) || A.isFile(t) || A.isBlob(t) || A.isReadableStream(t))
|
|
1170
1170
|
return t;
|
|
1171
|
-
if (
|
|
1171
|
+
if (A.isArrayBufferView(t))
|
|
1172
1172
|
return t.buffer;
|
|
1173
|
-
if (
|
|
1173
|
+
if (A.isURLSearchParams(t))
|
|
1174
1174
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
1175
1175
|
let a;
|
|
1176
1176
|
if (s) {
|
|
1177
1177
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
1178
1178
|
return ug(t, this.formSerializer).toString();
|
|
1179
|
-
if ((a =
|
|
1179
|
+
if ((a = A.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
1180
1180
|
const c = this.env && this.env.FormData;
|
|
1181
1181
|
return Uo(
|
|
1182
1182
|
a ? { "files[]": t } : t,
|
|
@@ -1189,9 +1189,9 @@ const Dr = {
|
|
|
1189
1189
|
}],
|
|
1190
1190
|
transformResponse: [function(t) {
|
|
1191
1191
|
const n = this.transitional || Dr.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
|
|
1192
|
-
if (
|
|
1192
|
+
if (A.isResponse(t) || A.isReadableStream(t))
|
|
1193
1193
|
return t;
|
|
1194
|
-
if (t &&
|
|
1194
|
+
if (t && A.isString(t) && (r && !this.responseType || o)) {
|
|
1195
1195
|
const i = !(n && n.silentJSONParsing) && o;
|
|
1196
1196
|
try {
|
|
1197
1197
|
return JSON.parse(t, this.parseReviver);
|
|
@@ -1225,10 +1225,10 @@ const Dr = {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
1227
|
};
|
|
1228
|
-
|
|
1228
|
+
A.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
1229
1229
|
Dr.headers[e] = {};
|
|
1230
1230
|
});
|
|
1231
|
-
const pg =
|
|
1231
|
+
const pg = A.toObjectSet([
|
|
1232
1232
|
"age",
|
|
1233
1233
|
"authorization",
|
|
1234
1234
|
"content-length",
|
|
@@ -1258,7 +1258,7 @@ function ur(e) {
|
|
|
1258
1258
|
return e && String(e).trim().toLowerCase();
|
|
1259
1259
|
}
|
|
1260
1260
|
function ro(e) {
|
|
1261
|
-
return e === !1 || e == null ? e :
|
|
1261
|
+
return e === !1 || e == null ? e : A.isArray(e) ? e.map(ro) : String(e);
|
|
1262
1262
|
}
|
|
1263
1263
|
function gg(e) {
|
|
1264
1264
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -1269,12 +1269,12 @@ function gg(e) {
|
|
|
1269
1269
|
}
|
|
1270
1270
|
const xg = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1271
1271
|
function Es(e, t, n, r, o) {
|
|
1272
|
-
if (
|
|
1272
|
+
if (A.isFunction(r))
|
|
1273
1273
|
return r.call(this, t, n);
|
|
1274
|
-
if (o && (t = n), !!
|
|
1275
|
-
if (
|
|
1274
|
+
if (o && (t = n), !!A.isString(t)) {
|
|
1275
|
+
if (A.isString(r))
|
|
1276
1276
|
return t.indexOf(r) !== -1;
|
|
1277
|
-
if (
|
|
1277
|
+
if (A.isRegExp(r))
|
|
1278
1278
|
return r.test(t);
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
@@ -1282,7 +1282,7 @@ function vg(e) {
|
|
|
1282
1282
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
1283
1283
|
}
|
|
1284
1284
|
function bg(e, t) {
|
|
1285
|
-
const n =
|
|
1285
|
+
const n = A.toCamelCase(" " + t);
|
|
1286
1286
|
["get", "set", "has"].forEach((r) => {
|
|
1287
1287
|
Object.defineProperty(e, r + n, {
|
|
1288
1288
|
value: function(o, s, i) {
|
|
@@ -1302,20 +1302,20 @@ let mt = class {
|
|
|
1302
1302
|
const d = ur(c);
|
|
1303
1303
|
if (!d)
|
|
1304
1304
|
throw new Error("header name must be a non-empty string");
|
|
1305
|
-
const h =
|
|
1305
|
+
const h = A.findKey(o, d);
|
|
1306
1306
|
(!h || o[h] === void 0 || u === !0 || u === void 0 && o[h] !== !1) && (o[h || c] = ro(a));
|
|
1307
1307
|
}
|
|
1308
|
-
const i = (a, c) =>
|
|
1309
|
-
if (
|
|
1308
|
+
const i = (a, c) => A.forEach(a, (u, d) => s(u, d, c));
|
|
1309
|
+
if (A.isPlainObject(t) || t instanceof this.constructor)
|
|
1310
1310
|
i(t, n);
|
|
1311
|
-
else if (
|
|
1311
|
+
else if (A.isString(t) && (t = t.trim()) && !xg(t))
|
|
1312
1312
|
i(mg(t), n);
|
|
1313
|
-
else if (
|
|
1313
|
+
else if (A.isObject(t) && A.isIterable(t)) {
|
|
1314
1314
|
let a = {}, c, u;
|
|
1315
1315
|
for (const d of t) {
|
|
1316
|
-
if (!
|
|
1316
|
+
if (!A.isArray(d))
|
|
1317
1317
|
throw TypeError("Object iterator must return a key-value pair");
|
|
1318
|
-
a[u = d[0]] = (c = a[u]) ?
|
|
1318
|
+
a[u = d[0]] = (c = a[u]) ? A.isArray(c) ? [...c, d[1]] : [c, d[1]] : d[1];
|
|
1319
1319
|
}
|
|
1320
1320
|
i(a, n);
|
|
1321
1321
|
} else
|
|
@@ -1324,16 +1324,16 @@ let mt = class {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
get(t, n) {
|
|
1326
1326
|
if (t = ur(t), t) {
|
|
1327
|
-
const r =
|
|
1327
|
+
const r = A.findKey(this, t);
|
|
1328
1328
|
if (r) {
|
|
1329
1329
|
const o = this[r];
|
|
1330
1330
|
if (!n)
|
|
1331
1331
|
return o;
|
|
1332
1332
|
if (n === !0)
|
|
1333
1333
|
return gg(o);
|
|
1334
|
-
if (
|
|
1334
|
+
if (A.isFunction(n))
|
|
1335
1335
|
return n.call(this, o, r);
|
|
1336
|
-
if (
|
|
1336
|
+
if (A.isRegExp(n))
|
|
1337
1337
|
return n.exec(o);
|
|
1338
1338
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
1339
1339
|
}
|
|
@@ -1341,7 +1341,7 @@ let mt = class {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
has(t, n) {
|
|
1343
1343
|
if (t = ur(t), t) {
|
|
1344
|
-
const r =
|
|
1344
|
+
const r = A.findKey(this, t);
|
|
1345
1345
|
return !!(r && this[r] !== void 0 && (!n || Es(this, this[r], r, n)));
|
|
1346
1346
|
}
|
|
1347
1347
|
return !1;
|
|
@@ -1351,11 +1351,11 @@ let mt = class {
|
|
|
1351
1351
|
let o = !1;
|
|
1352
1352
|
function s(i) {
|
|
1353
1353
|
if (i = ur(i), i) {
|
|
1354
|
-
const a =
|
|
1354
|
+
const a = A.findKey(r, i);
|
|
1355
1355
|
a && (!n || Es(r, r[a], a, n)) && (delete r[a], o = !0);
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
|
-
return
|
|
1358
|
+
return A.isArray(t) ? t.forEach(s) : s(t), o;
|
|
1359
1359
|
}
|
|
1360
1360
|
clear(t) {
|
|
1361
1361
|
const n = Object.keys(this);
|
|
@@ -1368,8 +1368,8 @@ let mt = class {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
normalize(t) {
|
|
1370
1370
|
const n = this, r = {};
|
|
1371
|
-
return
|
|
1372
|
-
const i =
|
|
1371
|
+
return A.forEach(this, (o, s) => {
|
|
1372
|
+
const i = A.findKey(r, s);
|
|
1373
1373
|
if (i) {
|
|
1374
1374
|
n[i] = ro(o), delete n[s];
|
|
1375
1375
|
return;
|
|
@@ -1383,8 +1383,8 @@ let mt = class {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
toJSON(t) {
|
|
1385
1385
|
const n = /* @__PURE__ */ Object.create(null);
|
|
1386
|
-
return
|
|
1387
|
-
r != null && r !== !1 && (n[o] = t &&
|
|
1386
|
+
return A.forEach(this, (r, o) => {
|
|
1387
|
+
r != null && r !== !1 && (n[o] = t && A.isArray(r) ? r.join(", ") : r);
|
|
1388
1388
|
}), n;
|
|
1389
1389
|
}
|
|
1390
1390
|
[Symbol.iterator]() {
|
|
@@ -1415,11 +1415,11 @@ let mt = class {
|
|
|
1415
1415
|
const a = ur(i);
|
|
1416
1416
|
r[a] || (bg(o, i), r[a] = !0);
|
|
1417
1417
|
}
|
|
1418
|
-
return
|
|
1418
|
+
return A.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
1421
|
mt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1422
|
-
|
|
1422
|
+
A.reduceDescriptors(mt.prototype, ({ value: e }, t) => {
|
|
1423
1423
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
1424
1424
|
return {
|
|
1425
1425
|
get: () => e,
|
|
@@ -1428,11 +1428,11 @@ k.reduceDescriptors(mt.prototype, ({ value: e }, t) => {
|
|
|
1428
1428
|
}
|
|
1429
1429
|
};
|
|
1430
1430
|
});
|
|
1431
|
-
|
|
1431
|
+
A.freezeMethods(mt);
|
|
1432
1432
|
function Is(e, t) {
|
|
1433
1433
|
const n = this || Dr, r = t || n, o = mt.from(r.headers);
|
|
1434
1434
|
let s = r.data;
|
|
1435
|
-
return
|
|
1435
|
+
return A.forEach(e, function(a) {
|
|
1436
1436
|
s = a.call(n, s, o.normalize(), t ? t.status : void 0);
|
|
1437
1437
|
}), o.normalize(), s;
|
|
1438
1438
|
}
|
|
@@ -1442,7 +1442,7 @@ function Lc(e) {
|
|
|
1442
1442
|
function tr(e, t, n) {
|
|
1443
1443
|
we.call(this, e ?? "canceled", we.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1444
1444
|
}
|
|
1445
|
-
|
|
1445
|
+
A.inherits(tr, we, {
|
|
1446
1446
|
__CANCEL__: !0
|
|
1447
1447
|
});
|
|
1448
1448
|
function Fc(e, t, n) {
|
|
@@ -1513,7 +1513,7 @@ const So = (e, t, n = 3) => {
|
|
|
1513
1513
|
total: e,
|
|
1514
1514
|
loaded: r
|
|
1515
1515
|
}), t[1]];
|
|
1516
|
-
}, tl = (e) => (...t) =>
|
|
1516
|
+
}, tl = (e) => (...t) => A.asap(() => e(...t)), Cg = lt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, lt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1517
1517
|
new URL(lt.origin),
|
|
1518
1518
|
lt.navigator && /(msie|trident)/i.test(lt.navigator.userAgent)
|
|
1519
1519
|
) : () => !0, Tg = lt.hasStandardBrowserEnv ? (
|
|
@@ -1521,7 +1521,7 @@ const So = (e, t, n = 3) => {
|
|
|
1521
1521
|
{
|
|
1522
1522
|
write(e, t, n, r, o, s) {
|
|
1523
1523
|
const i = [e + "=" + encodeURIComponent(t)];
|
|
1524
|
-
|
|
1524
|
+
A.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), A.isString(r) && i.push("path=" + r), A.isString(o) && i.push("domain=" + o), s === !0 && i.push("secure"), document.cookie = i.join("; ");
|
|
1525
1525
|
},
|
|
1526
1526
|
read(e) {
|
|
1527
1527
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1558,21 +1558,21 @@ function Cn(e, t) {
|
|
|
1558
1558
|
t = t || {};
|
|
1559
1559
|
const n = {};
|
|
1560
1560
|
function r(u, d, h, m) {
|
|
1561
|
-
return
|
|
1561
|
+
return A.isPlainObject(u) && A.isPlainObject(d) ? A.merge.call({ caseless: m }, u, d) : A.isPlainObject(d) ? A.merge({}, d) : A.isArray(d) ? d.slice() : d;
|
|
1562
1562
|
}
|
|
1563
1563
|
function o(u, d, h, m) {
|
|
1564
|
-
if (
|
|
1565
|
-
if (!
|
|
1564
|
+
if (A.isUndefined(d)) {
|
|
1565
|
+
if (!A.isUndefined(u))
|
|
1566
1566
|
return r(void 0, u, h, m);
|
|
1567
1567
|
} else return r(u, d, h, m);
|
|
1568
1568
|
}
|
|
1569
1569
|
function s(u, d) {
|
|
1570
|
-
if (!
|
|
1570
|
+
if (!A.isUndefined(d))
|
|
1571
1571
|
return r(void 0, d);
|
|
1572
1572
|
}
|
|
1573
1573
|
function i(u, d) {
|
|
1574
|
-
if (
|
|
1575
|
-
if (!
|
|
1574
|
+
if (A.isUndefined(d)) {
|
|
1575
|
+
if (!A.isUndefined(u))
|
|
1576
1576
|
return r(void 0, u);
|
|
1577
1577
|
} else return r(void 0, d);
|
|
1578
1578
|
}
|
|
@@ -1613,9 +1613,9 @@ function Cn(e, t) {
|
|
|
1613
1613
|
validateStatus: a,
|
|
1614
1614
|
headers: (u, d, h) => o(nl(u), nl(d), h, !0)
|
|
1615
1615
|
};
|
|
1616
|
-
return
|
|
1616
|
+
return A.forEach(Object.keys({ ...e, ...t }), function(d) {
|
|
1617
1617
|
const h = c[d] || o, m = h(e[d], t[d], d);
|
|
1618
|
-
|
|
1618
|
+
A.isUndefined(m) && h !== a || (n[d] = m);
|
|
1619
1619
|
}), n;
|
|
1620
1620
|
}
|
|
1621
1621
|
const $c = (e) => {
|
|
@@ -1624,17 +1624,17 @@ const $c = (e) => {
|
|
|
1624
1624
|
if (t.headers = i = mt.from(i), t.url = Oc(Bc(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
|
|
1625
1625
|
"Authorization",
|
|
1626
1626
|
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
|
|
1627
|
-
),
|
|
1627
|
+
), A.isFormData(n)) {
|
|
1628
1628
|
if (lt.hasStandardBrowserEnv || lt.hasStandardBrowserWebWorkerEnv)
|
|
1629
1629
|
i.setContentType(void 0);
|
|
1630
|
-
else if (
|
|
1630
|
+
else if (A.isFunction(n.getHeaders)) {
|
|
1631
1631
|
const c = n.getHeaders(), u = ["content-type", "content-length"];
|
|
1632
1632
|
Object.entries(c).forEach(([d, h]) => {
|
|
1633
1633
|
u.includes(d.toLowerCase()) && i.set(d, h);
|
|
1634
1634
|
});
|
|
1635
1635
|
}
|
|
1636
1636
|
}
|
|
1637
|
-
if (lt.hasStandardBrowserEnv && (r &&
|
|
1637
|
+
if (lt.hasStandardBrowserEnv && (r && A.isFunction(r) && (r = r(t)), r || r !== !1 && Cg(t.url))) {
|
|
1638
1638
|
const c = o && s && Tg.read(s);
|
|
1639
1639
|
c && i.set(o, c);
|
|
1640
1640
|
}
|
|
@@ -1655,7 +1655,7 @@ const $c = (e) => {
|
|
|
1655
1655
|
return;
|
|
1656
1656
|
const y = mt.from(
|
|
1657
1657
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1658
|
-
),
|
|
1658
|
+
), S = {
|
|
1659
1659
|
data: !a || a === "text" || a === "json" ? p.responseText : p.response,
|
|
1660
1660
|
status: p.status,
|
|
1661
1661
|
statusText: p.statusText,
|
|
@@ -1663,31 +1663,31 @@ const $c = (e) => {
|
|
|
1663
1663
|
config: e,
|
|
1664
1664
|
request: p
|
|
1665
1665
|
};
|
|
1666
|
-
Fc(function(
|
|
1667
|
-
n(
|
|
1668
|
-
}, function(
|
|
1669
|
-
r(
|
|
1670
|
-
},
|
|
1666
|
+
Fc(function(C) {
|
|
1667
|
+
n(C), g();
|
|
1668
|
+
}, function(C) {
|
|
1669
|
+
r(C), g();
|
|
1670
|
+
}, S), p = null;
|
|
1671
1671
|
}
|
|
1672
1672
|
"onloadend" in p ? p.onloadend = b : p.onreadystatechange = function() {
|
|
1673
1673
|
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(b);
|
|
1674
1674
|
}, p.onabort = function() {
|
|
1675
1675
|
p && (r(new we("Request aborted", we.ECONNABORTED, e, p)), p = null);
|
|
1676
1676
|
}, p.onerror = function(E) {
|
|
1677
|
-
const
|
|
1677
|
+
const S = E && E.message ? E.message : "Network Error", T = new we(S, we.ERR_NETWORK, e, p);
|
|
1678
1678
|
T.event = E || null, r(T), p = null;
|
|
1679
1679
|
}, p.ontimeout = function() {
|
|
1680
1680
|
let E = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1681
|
-
const
|
|
1681
|
+
const S = o.transitional || Mc;
|
|
1682
1682
|
o.timeoutErrorMessage && (E = o.timeoutErrorMessage), r(new we(
|
|
1683
1683
|
E,
|
|
1684
|
-
|
|
1684
|
+
S.clarifyTimeoutError ? we.ETIMEDOUT : we.ECONNABORTED,
|
|
1685
1685
|
e,
|
|
1686
1686
|
p
|
|
1687
1687
|
)), p = null;
|
|
1688
|
-
}, s === void 0 && i.setContentType(null), "setRequestHeader" in p &&
|
|
1689
|
-
p.setRequestHeader(
|
|
1690
|
-
}),
|
|
1688
|
+
}, s === void 0 && i.setContentType(null), "setRequestHeader" in p && A.forEach(i.toJSON(), function(E, S) {
|
|
1689
|
+
p.setRequestHeader(S, E);
|
|
1690
|
+
}), A.isUndefined(o.withCredentials) || (p.withCredentials = !!o.withCredentials), a && a !== "json" && (p.responseType = o.responseType), u && ([m, x] = So(u, !0), p.addEventListener("progress", m)), c && p.upload && ([h, v] = So(c), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", v)), (o.cancelToken || o.signal) && (d = (y) => {
|
|
1691
1691
|
p && (r(!y || y.type ? new tr(null, e, p) : y), p.abort(), p = null);
|
|
1692
1692
|
}, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
|
|
1693
1693
|
const w = wg(o.url);
|
|
@@ -1718,7 +1718,7 @@ const $c = (e) => {
|
|
|
1718
1718
|
};
|
|
1719
1719
|
e.forEach((u) => u.addEventListener("abort", s));
|
|
1720
1720
|
const { signal: c } = r;
|
|
1721
|
-
return c.unsubscribe = () =>
|
|
1721
|
+
return c.unsubscribe = () => A.asap(a), c;
|
|
1722
1722
|
}
|
|
1723
1723
|
}, Ag = function* (e, t) {
|
|
1724
1724
|
let n = e.byteLength;
|
|
@@ -1777,20 +1777,20 @@ const $c = (e) => {
|
|
|
1777
1777
|
}, {
|
|
1778
1778
|
highWaterMark: 2
|
|
1779
1779
|
});
|
|
1780
|
-
}, ol = 64 * 1024, { isFunction: Vr } =
|
|
1780
|
+
}, ol = 64 * 1024, { isFunction: Vr } = A, _g = (({ Request: e, Response: t }) => ({
|
|
1781
1781
|
Request: e,
|
|
1782
1782
|
Response: t
|
|
1783
|
-
}))(
|
|
1783
|
+
}))(A.global), {
|
|
1784
1784
|
ReadableStream: sl,
|
|
1785
1785
|
TextEncoder: il
|
|
1786
|
-
} =
|
|
1786
|
+
} = A.global, al = (e, ...t) => {
|
|
1787
1787
|
try {
|
|
1788
1788
|
return !!e(...t);
|
|
1789
1789
|
} catch {
|
|
1790
1790
|
return !1;
|
|
1791
1791
|
}
|
|
1792
1792
|
}, Og = (e) => {
|
|
1793
|
-
e =
|
|
1793
|
+
e = A.merge.call({
|
|
1794
1794
|
skipUndefined: !0
|
|
1795
1795
|
}, _g, e);
|
|
1796
1796
|
const { fetch: t, Request: n, Response: r } = e, o = t ? Vr(t) : typeof fetch == "function", s = Vr(n), i = Vr(r);
|
|
@@ -1806,7 +1806,7 @@ const $c = (e) => {
|
|
|
1806
1806
|
}
|
|
1807
1807
|
}).headers.has("Content-Type");
|
|
1808
1808
|
return x && !g;
|
|
1809
|
-
}), d = i && a && al(() =>
|
|
1809
|
+
}), d = i && a && al(() => A.isReadableStream(new r("").body)), h = {
|
|
1810
1810
|
stream: d && ((x) => x.body)
|
|
1811
1811
|
};
|
|
1812
1812
|
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((x) => {
|
|
@@ -1820,19 +1820,19 @@ const $c = (e) => {
|
|
|
1820
1820
|
const m = async (x) => {
|
|
1821
1821
|
if (x == null)
|
|
1822
1822
|
return 0;
|
|
1823
|
-
if (
|
|
1823
|
+
if (A.isBlob(x))
|
|
1824
1824
|
return x.size;
|
|
1825
|
-
if (
|
|
1825
|
+
if (A.isSpecCompliantForm(x))
|
|
1826
1826
|
return (await new n(lt.origin, {
|
|
1827
1827
|
method: "POST",
|
|
1828
1828
|
body: x
|
|
1829
1829
|
}).arrayBuffer()).byteLength;
|
|
1830
|
-
if (
|
|
1830
|
+
if (A.isArrayBufferView(x) || A.isArrayBuffer(x))
|
|
1831
1831
|
return x.byteLength;
|
|
1832
|
-
if (
|
|
1832
|
+
if (A.isURLSearchParams(x) && (x = x + ""), A.isString(x))
|
|
1833
1833
|
return (await c(x)).byteLength;
|
|
1834
1834
|
}, v = async (x, g) => {
|
|
1835
|
-
const p =
|
|
1835
|
+
const p = A.toFiniteNumber(x.getContentLength());
|
|
1836
1836
|
return p ?? m(g);
|
|
1837
1837
|
};
|
|
1838
1838
|
return async (x) => {
|
|
@@ -1843,16 +1843,16 @@ const $c = (e) => {
|
|
|
1843
1843
|
signal: w,
|
|
1844
1844
|
cancelToken: y,
|
|
1845
1845
|
timeout: E,
|
|
1846
|
-
onDownloadProgress:
|
|
1846
|
+
onDownloadProgress: S,
|
|
1847
1847
|
onUploadProgress: T,
|
|
1848
|
-
responseType:
|
|
1848
|
+
responseType: C,
|
|
1849
1849
|
headers: I,
|
|
1850
1850
|
withCredentials: N = "same-origin",
|
|
1851
|
-
fetchOptions:
|
|
1851
|
+
fetchOptions: k
|
|
1852
1852
|
} = $c(x), M = t || fetch;
|
|
1853
|
-
|
|
1853
|
+
C = C ? (C + "").toLowerCase() : "text";
|
|
1854
1854
|
let W = jg([w, y && y.toAbortSignal()], E), G = null;
|
|
1855
|
-
const
|
|
1855
|
+
const j = W && W.unsubscribe && (() => {
|
|
1856
1856
|
W.unsubscribe();
|
|
1857
1857
|
});
|
|
1858
1858
|
let $;
|
|
@@ -1863,7 +1863,7 @@ const $c = (e) => {
|
|
|
1863
1863
|
body: b,
|
|
1864
1864
|
duplex: "half"
|
|
1865
1865
|
}), oe;
|
|
1866
|
-
if (
|
|
1866
|
+
if (A.isFormData(b) && (oe = X.headers.get("content-type")) && I.setContentType(oe), X.body) {
|
|
1867
1867
|
const [F, ee] = el(
|
|
1868
1868
|
$,
|
|
1869
1869
|
So(tl(T))
|
|
@@ -1871,9 +1871,9 @@ const $c = (e) => {
|
|
|
1871
1871
|
b = rl(X.body, ol, F, ee);
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
|
-
|
|
1874
|
+
A.isString(N) || (N = N ? "include" : "omit");
|
|
1875
1875
|
const L = s && "credentials" in n.prototype, q = {
|
|
1876
|
-
...
|
|
1876
|
+
...k,
|
|
1877
1877
|
signal: W,
|
|
1878
1878
|
method: p.toUpperCase(),
|
|
1879
1879
|
headers: I.normalize().toJSON(),
|
|
@@ -1882,27 +1882,27 @@ const $c = (e) => {
|
|
|
1882
1882
|
credentials: L ? N : void 0
|
|
1883
1883
|
};
|
|
1884
1884
|
G = s && new n(g, q);
|
|
1885
|
-
let O = await (s ? M(G,
|
|
1886
|
-
const _ = d && (
|
|
1887
|
-
if (d && (
|
|
1885
|
+
let O = await (s ? M(G, k) : M(g, q));
|
|
1886
|
+
const _ = d && (C === "stream" || C === "response");
|
|
1887
|
+
if (d && (S || _ && j)) {
|
|
1888
1888
|
const X = {};
|
|
1889
1889
|
["status", "statusText", "headers"].forEach((he) => {
|
|
1890
1890
|
X[he] = O[he];
|
|
1891
1891
|
});
|
|
1892
|
-
const oe =
|
|
1892
|
+
const oe = A.toFiniteNumber(O.headers.get("content-length")), [F, ee] = S && el(
|
|
1893
1893
|
oe,
|
|
1894
|
-
So(tl(
|
|
1894
|
+
So(tl(S), !0)
|
|
1895
1895
|
) || [];
|
|
1896
1896
|
O = new r(
|
|
1897
1897
|
rl(O.body, ol, F, () => {
|
|
1898
|
-
ee && ee(),
|
|
1898
|
+
ee && ee(), j && j();
|
|
1899
1899
|
}),
|
|
1900
1900
|
X
|
|
1901
1901
|
);
|
|
1902
1902
|
}
|
|
1903
|
-
|
|
1904
|
-
let z = await h[
|
|
1905
|
-
return !_ &&
|
|
1903
|
+
C = C || "text";
|
|
1904
|
+
let z = await h[A.findKey(h, C) || "text"](O, x);
|
|
1905
|
+
return !_ && j && j(), await new Promise((X, oe) => {
|
|
1906
1906
|
Fc(X, oe, {
|
|
1907
1907
|
data: z,
|
|
1908
1908
|
headers: mt.from(O.headers),
|
|
@@ -1913,7 +1913,7 @@ const $c = (e) => {
|
|
|
1913
1913
|
});
|
|
1914
1914
|
});
|
|
1915
1915
|
} catch (L) {
|
|
1916
|
-
throw
|
|
1916
|
+
throw j && j(), L && L.name === "TypeError" && /Load failed|fetch/i.test(L.message) ? Object.assign(
|
|
1917
1917
|
new we("Network Error", we.ERR_NETWORK, x, G),
|
|
1918
1918
|
{
|
|
1919
1919
|
cause: L.cause || L
|
|
@@ -1941,7 +1941,7 @@ const ri = {
|
|
|
1941
1941
|
get: Hc
|
|
1942
1942
|
}
|
|
1943
1943
|
};
|
|
1944
|
-
|
|
1944
|
+
A.forEach(ri, (e, t) => {
|
|
1945
1945
|
if (e) {
|
|
1946
1946
|
try {
|
|
1947
1947
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1950,9 +1950,9 @@ k.forEach(ri, (e, t) => {
|
|
|
1950
1950
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1951
1951
|
}
|
|
1952
1952
|
});
|
|
1953
|
-
const ll = (e) => `- ${e}`, Dg = (e) =>
|
|
1953
|
+
const ll = (e) => `- ${e}`, Dg = (e) => A.isFunction(e) || e === null || e === !1, zc = {
|
|
1954
1954
|
getAdapter: (e, t) => {
|
|
1955
|
-
e =
|
|
1955
|
+
e = A.isArray(e) ? e : [e];
|
|
1956
1956
|
const { length: n } = e;
|
|
1957
1957
|
let r, o;
|
|
1958
1958
|
const s = {};
|
|
@@ -1961,7 +1961,7 @@ const ll = (e) => `- ${e}`, Dg = (e) => k.isFunction(e) || e === null || e === !
|
|
|
1961
1961
|
let a;
|
|
1962
1962
|
if (o = r, !Dg(r) && (o = ri[(a = String(r)).toLowerCase()], o === void 0))
|
|
1963
1963
|
throw new we(`Unknown adapter '${a}'`);
|
|
1964
|
-
if (o && (
|
|
1964
|
+
if (o && (A.isFunction(o) || (o = o.get(t))))
|
|
1965
1965
|
break;
|
|
1966
1966
|
s[a || "#" + i] = o;
|
|
1967
1967
|
}
|
|
@@ -2091,7 +2091,7 @@ let yn = class {
|
|
|
2091
2091
|
silentJSONParsing: Ut.transitional(Ut.boolean),
|
|
2092
2092
|
forcedJSONParsing: Ut.transitional(Ut.boolean),
|
|
2093
2093
|
clarifyTimeoutError: Ut.transitional(Ut.boolean)
|
|
2094
|
-
}, !1), o != null && (
|
|
2094
|
+
}, !1), o != null && (A.isFunction(o) ? n.paramsSerializer = {
|
|
2095
2095
|
serialize: o
|
|
2096
2096
|
} : oo.assertOptions(o, {
|
|
2097
2097
|
encode: Ut.function,
|
|
@@ -2100,11 +2100,11 @@ let yn = class {
|
|
|
2100
2100
|
baseUrl: Ut.spelling("baseURL"),
|
|
2101
2101
|
withXsrfToken: Ut.spelling("withXSRFToken")
|
|
2102
2102
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
2103
|
-
let i = s &&
|
|
2103
|
+
let i = s && A.merge(
|
|
2104
2104
|
s.common,
|
|
2105
2105
|
s[n.method]
|
|
2106
2106
|
);
|
|
2107
|
-
s &&
|
|
2107
|
+
s && A.forEach(
|
|
2108
2108
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2109
2109
|
(x) => {
|
|
2110
2110
|
delete s[x];
|
|
@@ -2152,7 +2152,7 @@ let yn = class {
|
|
|
2152
2152
|
return Oc(n, t.params, t.paramsSerializer);
|
|
2153
2153
|
}
|
|
2154
2154
|
};
|
|
2155
|
-
|
|
2155
|
+
A.forEach(["delete", "get", "head", "options"], function(t) {
|
|
2156
2156
|
yn.prototype[t] = function(n, r) {
|
|
2157
2157
|
return this.request(Cn(r || {}, {
|
|
2158
2158
|
method: t,
|
|
@@ -2161,7 +2161,7 @@ k.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
2161
2161
|
}));
|
|
2162
2162
|
};
|
|
2163
2163
|
});
|
|
2164
|
-
|
|
2164
|
+
A.forEach(["post", "put", "patch"], function(t) {
|
|
2165
2165
|
function n(r) {
|
|
2166
2166
|
return function(s, i, a) {
|
|
2167
2167
|
return this.request(Cn(a || {}, {
|
|
@@ -2255,7 +2255,7 @@ function Bg(e) {
|
|
|
2255
2255
|
};
|
|
2256
2256
|
}
|
|
2257
2257
|
function $g(e) {
|
|
2258
|
-
return
|
|
2258
|
+
return A.isObject(e) && e.isAxiosError === !0;
|
|
2259
2259
|
}
|
|
2260
2260
|
const oi = {
|
|
2261
2261
|
Continue: 100,
|
|
@@ -2327,7 +2327,7 @@ Object.entries(oi).forEach(([e, t]) => {
|
|
|
2327
2327
|
});
|
|
2328
2328
|
function Vc(e) {
|
|
2329
2329
|
const t = new yn(e), n = Sc(yn.prototype.request, t);
|
|
2330
|
-
return
|
|
2330
|
+
return A.extend(n, yn.prototype, t, { allOwnKeys: !0 }), A.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
2331
2331
|
return Vc(Cn(e, o));
|
|
2332
2332
|
}, n;
|
|
2333
2333
|
}
|
|
@@ -2347,7 +2347,7 @@ Ye.spread = Bg;
|
|
|
2347
2347
|
Ye.isAxiosError = $g;
|
|
2348
2348
|
Ye.mergeConfig = Cn;
|
|
2349
2349
|
Ye.AxiosHeaders = mt;
|
|
2350
|
-
Ye.formToJSON = (e) => Dc(
|
|
2350
|
+
Ye.formToJSON = (e) => Dc(A.isHTMLForm(e) ? new FormData(e) : e);
|
|
2351
2351
|
Ye.getAdapter = zc.getAdapter;
|
|
2352
2352
|
Ye.HttpStatusCode = oi;
|
|
2353
2353
|
Ye.default = Ye;
|
|
@@ -2504,63 +2504,63 @@ class Gg {
|
|
|
2504
2504
|
}
|
|
2505
2505
|
const Tn = new Gg();
|
|
2506
2506
|
function Kg(e = {}) {
|
|
2507
|
-
const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = de(e.token ?? null), s =
|
|
2507
|
+
const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = de(e.token ?? null), s = We(e.headers ?? {}), [i, a] = de(!1), [c, u] = de(null), [d, h] = de(""), [m, v] = de(null), x = We(null), g = Ue((y) => {
|
|
2508
2508
|
o(y);
|
|
2509
|
-
}, []), p =
|
|
2509
|
+
}, []), p = Ue(() => {
|
|
2510
2510
|
var y;
|
|
2511
2511
|
(y = x.current) == null || y.abort(), x.current = null, a(!1);
|
|
2512
|
-
}, []), b =
|
|
2512
|
+
}, []), b = Ue(() => {
|
|
2513
2513
|
h(""), v(null), u(null);
|
|
2514
|
-
}, []), w =
|
|
2515
|
-
(y, E,
|
|
2514
|
+
}, []), w = Ue(
|
|
2515
|
+
(y, E, S) => {
|
|
2516
2516
|
x.current && (x.current.abort(), x.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && h("");
|
|
2517
2517
|
const T = new AbortController();
|
|
2518
2518
|
return x.current = T, (async () => {
|
|
2519
|
-
var N,
|
|
2520
|
-
const
|
|
2521
|
-
var
|
|
2519
|
+
var N, k, M, W, G;
|
|
2520
|
+
const C = (() => {
|
|
2521
|
+
var j;
|
|
2522
2522
|
try {
|
|
2523
|
-
return typeof window < "u" && ((
|
|
2523
|
+
return typeof window < "u" && ((j = window.localStorage) == null ? void 0 : j.getItem("chat-debug")) === "1";
|
|
2524
2524
|
} catch {
|
|
2525
2525
|
return !1;
|
|
2526
2526
|
}
|
|
2527
|
-
})(), I = (
|
|
2527
|
+
})(), I = (j) => {
|
|
2528
2528
|
var $;
|
|
2529
2529
|
try {
|
|
2530
|
-
const L = JSON.parse(JSON.stringify(
|
|
2530
|
+
const L = JSON.parse(JSON.stringify(j));
|
|
2531
2531
|
return ($ = L == null ? void 0 : L.payload) != null && $.files_info && Array.isArray(L.payload.files_info) && (L.payload.files_info = L.payload.files_info.map((q) => ({
|
|
2532
2532
|
...q,
|
|
2533
2533
|
data: q != null && q.data ? `<base64 ${String(q.data).length} chars>` : q == null ? void 0 : q.data
|
|
2534
2534
|
}))), L;
|
|
2535
2535
|
} catch {
|
|
2536
|
-
return
|
|
2536
|
+
return j;
|
|
2537
2537
|
}
|
|
2538
2538
|
};
|
|
2539
2539
|
try {
|
|
2540
|
-
let
|
|
2540
|
+
let j = {};
|
|
2541
2541
|
try {
|
|
2542
2542
|
if (r)
|
|
2543
|
-
|
|
2543
|
+
j = { Authorization: `Bearer ${r}` };
|
|
2544
2544
|
else if (typeof window < "u") {
|
|
2545
2545
|
const z = window.__AUTH_TOKEN__, X = ((N = window.localStorage) == null ? void 0 : N.getItem("authToken")) || null;
|
|
2546
2546
|
let oe = null;
|
|
2547
2547
|
try {
|
|
2548
|
-
const ee = (
|
|
2548
|
+
const ee = (k = window.localStorage) == null ? void 0 : k.getItem("chat-settings");
|
|
2549
2549
|
ee && (oe = ((M = JSON.parse(ee)) == null ? void 0 : M.apiKey) || null);
|
|
2550
2550
|
} catch {
|
|
2551
2551
|
}
|
|
2552
2552
|
const F = z || X || oe || null;
|
|
2553
|
-
F && (
|
|
2553
|
+
F && (j = { Authorization: `Bearer ${F}` });
|
|
2554
2554
|
}
|
|
2555
2555
|
} catch {
|
|
2556
2556
|
}
|
|
2557
|
-
|
|
2557
|
+
C && console.debug("[use-chat] POST", t + n, I(y));
|
|
2558
2558
|
const $ = await fetch(t + n, {
|
|
2559
2559
|
method: "POST",
|
|
2560
2560
|
headers: {
|
|
2561
2561
|
"Content-Type": "application/json",
|
|
2562
2562
|
Accept: "text/event-stream",
|
|
2563
|
-
...
|
|
2563
|
+
...j,
|
|
2564
2564
|
...s.current
|
|
2565
2565
|
},
|
|
2566
2566
|
body: JSON.stringify(y),
|
|
@@ -2568,17 +2568,17 @@ function Kg(e = {}) {
|
|
|
2568
2568
|
});
|
|
2569
2569
|
if (!$.ok || !$.body) {
|
|
2570
2570
|
const _ = await $.text().catch(() => "");
|
|
2571
|
-
throw
|
|
2571
|
+
throw C && console.debug("[use-chat] non-OK response", $.status, _ == null ? void 0 : _.slice(0, 500)), new Error(`stream ${$.status}${_ ? ": " + _ : ""}`);
|
|
2572
2572
|
}
|
|
2573
2573
|
try {
|
|
2574
2574
|
const _ = $.headers.get("X-Thread-Id") || $.headers.get("x-thread-id"), z = $.headers.get("X-Thread-Created") || $.headers.get("x-thread-created"), X = _ ?? null, oe = String(z ?? "").toLowerCase() === "true";
|
|
2575
2575
|
try {
|
|
2576
|
-
(W =
|
|
2576
|
+
(W = S == null ? void 0 : S.onOpen) == null || W.call(S, { threadId: X, created: oe });
|
|
2577
2577
|
} catch (F) {
|
|
2578
|
-
|
|
2578
|
+
C && console.debug("[use-chat] onOpen handler threw:", F);
|
|
2579
2579
|
}
|
|
2580
2580
|
} catch (_) {
|
|
2581
|
-
|
|
2581
|
+
C && console.debug("[use-chat] failed to read headers:", _);
|
|
2582
2582
|
}
|
|
2583
2583
|
const L = $.body.getReader(), q = new TextDecoder();
|
|
2584
2584
|
let O = "";
|
|
@@ -2598,11 +2598,11 @@ function Kg(e = {}) {
|
|
|
2598
2598
|
try {
|
|
2599
2599
|
ee = JSON.parse(F);
|
|
2600
2600
|
} catch {
|
|
2601
|
-
|
|
2601
|
+
C && console.debug("[use-chat] skip malformed SSE data:", F == null ? void 0 : F.slice(0, 200));
|
|
2602
2602
|
continue;
|
|
2603
2603
|
}
|
|
2604
2604
|
const he = Yg(ee) ? ee.data : ee;
|
|
2605
|
-
if (
|
|
2605
|
+
if (C && console.debug("[use-chat] event:", he == null ? void 0 : he.type, he), E == null || E(he), he.type === "token")
|
|
2606
2606
|
e.autoAppendAssistant !== !1 && h((be) => be + he.content);
|
|
2607
2607
|
else if (he.type === "message_delta") {
|
|
2608
2608
|
const be = he.delta.filter((Y) => Y.type === "text").map((Y) => Y.text).join("");
|
|
@@ -2610,10 +2610,10 @@ function Kg(e = {}) {
|
|
|
2610
2610
|
} else he.type === "checkpoint" ? v(he.checkpointId) : he.type === "error" && u(he.message);
|
|
2611
2611
|
}
|
|
2612
2612
|
}
|
|
2613
|
-
} catch (
|
|
2614
|
-
if ((
|
|
2615
|
-
const $ = (
|
|
2616
|
-
|
|
2613
|
+
} catch (j) {
|
|
2614
|
+
if ((j == null ? void 0 : j.name) === "AbortError") return;
|
|
2615
|
+
const $ = (j == null ? void 0 : j.message) || String(j);
|
|
2616
|
+
C && console.debug("[use-chat] error:", $), u($), (G = S == null ? void 0 : S.onError) == null || G.call(S, $);
|
|
2617
2617
|
} finally {
|
|
2618
2618
|
a(!1), x.current = null;
|
|
2619
2619
|
}
|
|
@@ -2621,7 +2621,7 @@ function Kg(e = {}) {
|
|
|
2621
2621
|
},
|
|
2622
2622
|
[t, r, e.autoAppendAssistant]
|
|
2623
2623
|
);
|
|
2624
|
-
return
|
|
2624
|
+
return ze(() => () => {
|
|
2625
2625
|
var y;
|
|
2626
2626
|
return (y = x.current) == null ? void 0 : y.abort();
|
|
2627
2627
|
}, []), {
|
|
@@ -2696,16 +2696,16 @@ function Jg(e, t) {
|
|
|
2696
2696
|
}
|
|
2697
2697
|
}
|
|
2698
2698
|
function Zg(e = []) {
|
|
2699
|
-
const [t, n] = Dp(Jg, { ...Xg, messages: e }), r =
|
|
2699
|
+
const [t, n] = Dp(Jg, { ...Xg, messages: e }), r = We([]), o = We(null), s = We(null), i = Ue(() => {
|
|
2700
2700
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
|
|
2701
2701
|
const d = r.current;
|
|
2702
2702
|
d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
|
|
2703
|
-
}, []), a =
|
|
2703
|
+
}, []), a = Ue(() => {
|
|
2704
2704
|
typeof window < "u" && typeof window.requestAnimationFrame == "function" ? o.current === null && (o.current = window.requestAnimationFrame(() => i())) : s.current === null && (s.current = setTimeout(i, 16));
|
|
2705
|
-
}, [i]), c =
|
|
2705
|
+
}, [i]), c = Ue((d) => {
|
|
2706
2706
|
r.current.push(d), a();
|
|
2707
2707
|
}, [a]);
|
|
2708
|
-
|
|
2708
|
+
ze(() => () => {
|
|
2709
2709
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
|
|
2710
2710
|
}, []);
|
|
2711
2711
|
const u = sn(() => ({
|
|
@@ -2923,7 +2923,7 @@ async function ix(e, t = [], n, r, o, s) {
|
|
|
2923
2923
|
const Gc = xc(null);
|
|
2924
2924
|
function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialThreadId: o = null, historyPageSize: s, autoLoadInitial: i = !0, enableFileAgentRouting: a = !1, fileAgentId: c = "invoice_reader" }) {
|
|
2925
2925
|
const u = Tn;
|
|
2926
|
-
|
|
2926
|
+
ze(() => {
|
|
2927
2927
|
t && u.updateConfig({
|
|
2928
2928
|
baseUrl: t.baseUrl,
|
|
2929
2929
|
authToken: t.apiKey
|
|
@@ -2938,7 +2938,7 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2938
2938
|
// Ensure the path matches the chat endpoint
|
|
2939
2939
|
streamPath: "/chat/runs/stream"
|
|
2940
2940
|
}), [g, p] = de(() => typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
|
|
2941
|
-
|
|
2941
|
+
ze(() => {
|
|
2942
2942
|
x(typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
|
|
2943
2943
|
const H = u.onTokenChange((ie) => {
|
|
2944
2944
|
p(ie), x(ie);
|
|
@@ -2947,18 +2947,18 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2947
2947
|
H();
|
|
2948
2948
|
};
|
|
2949
2949
|
}, [u, x]);
|
|
2950
|
-
const b =
|
|
2950
|
+
const b = Ue((H) => {
|
|
2951
2951
|
u.setAuthToken(H);
|
|
2952
|
-
}, [u]), { state: w, seed: y, prepend: E, pushUser:
|
|
2952
|
+
}, [u]), { state: w, seed: y, prepend: E, pushUser: S, onEvent: T, reset: C } = Zg(), I = s && s > 0 ? s : 6, [N, k] = de(!1), [M, W] = de(!1), [G, j] = de(null), [$, L] = de(void 0), q = Ue(
|
|
2953
2953
|
(H, ie) => {
|
|
2954
2954
|
const Fe = Array.isArray(H == null ? void 0 : H.messages) ? H.messages : [];
|
|
2955
|
-
ie === "replace" ? y(Fe) : ie === "prepend" && Fe.length && E(Fe),
|
|
2955
|
+
ie === "replace" ? y(Fe) : ie === "prepend" && Fe.length && E(Fe), j((H == null ? void 0 : H.nextCursor) ?? null), k(!!(H != null && H.hasMore)), L((tt) => (H == null ? void 0 : H.checkpointId) ?? tt ?? void 0);
|
|
2956
2956
|
},
|
|
2957
2957
|
[y, E]
|
|
2958
|
-
), [O, _] = de([]), [z, X] = de(null), oe =
|
|
2958
|
+
), [O, _] = de([]), [z, X] = de(null), oe = Ue(async () => {
|
|
2959
2959
|
const H = await u.listThreads();
|
|
2960
2960
|
_(H);
|
|
2961
|
-
}, [u]), [F, ee] = de(!1), he =
|
|
2961
|
+
}, [u]), [F, ee] = de(!1), he = Ue(
|
|
2962
2962
|
async (H) => {
|
|
2963
2963
|
const ie = (H == null ? void 0 : H.maxAttempts) ?? 5, Fe = (H == null ? void 0 : H.baseDelayMs) ?? 500, tt = (H == null ? void 0 : H.timeoutMs) ?? 2e3;
|
|
2964
2964
|
if (!u.baseUrl) return !1;
|
|
@@ -3000,7 +3000,7 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3000
3000
|
},
|
|
3001
3001
|
[u.baseUrl]
|
|
3002
3002
|
);
|
|
3003
|
-
|
|
3003
|
+
ze(() => {
|
|
3004
3004
|
let H = !0;
|
|
3005
3005
|
if (!u.baseUrl) {
|
|
3006
3006
|
console.debug("[ChatProvider] skipping initial refreshThreads: api.baseUrl not configured");
|
|
@@ -3017,11 +3017,11 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3017
3017
|
})(), () => {
|
|
3018
3018
|
H = !1;
|
|
3019
3019
|
};
|
|
3020
|
-
}, [oe, u.baseUrl, he]),
|
|
3020
|
+
}, [oe, u.baseUrl, he]), ze(() => {
|
|
3021
3021
|
r == null || r(z);
|
|
3022
3022
|
}, [z, r]);
|
|
3023
|
-
const be =
|
|
3024
|
-
|
|
3023
|
+
const be = We(null);
|
|
3024
|
+
ze(() => {
|
|
3025
3025
|
if (o && i) {
|
|
3026
3026
|
if (!u.baseUrl) {
|
|
3027
3027
|
console.debug("[ChatProvider] skipping initial load: api.baseUrl not configured");
|
|
@@ -3035,7 +3035,7 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3035
3035
|
}));
|
|
3036
3036
|
}
|
|
3037
3037
|
}, [o, i, u.baseUrl, F]);
|
|
3038
|
-
const Y =
|
|
3038
|
+
const Y = We(null), P = Ue(
|
|
3039
3039
|
async (H, ie, Fe) => {
|
|
3040
3040
|
if (!u.baseUrl) {
|
|
3041
3041
|
console.debug("[ChatProvider] skipping loadThread: api.baseUrl not configured");
|
|
@@ -3044,7 +3044,7 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3044
3044
|
if (Y.current !== H) {
|
|
3045
3045
|
Y.current = H;
|
|
3046
3046
|
try {
|
|
3047
|
-
|
|
3047
|
+
k(!1), j(null), L(void 0);
|
|
3048
3048
|
const tt = await u.getMessages({
|
|
3049
3049
|
threadId: H,
|
|
3050
3050
|
checkpointId: ie,
|
|
@@ -3058,23 +3058,23 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3058
3058
|
}
|
|
3059
3059
|
},
|
|
3060
3060
|
[u, q]
|
|
3061
|
-
), Z =
|
|
3061
|
+
), Z = Ue(async (H) => {
|
|
3062
3062
|
const ie = await u.listCheckpoints(H);
|
|
3063
3063
|
return rx(ie, H);
|
|
3064
|
-
}, [u]), ne =
|
|
3064
|
+
}, [u]), ne = Ue(async (H) => {
|
|
3065
3065
|
if (!z) throw new Error("No active thread");
|
|
3066
|
-
|
|
3066
|
+
k(!1), j(null), L(void 0);
|
|
3067
3067
|
const ie = await u.getMessages({
|
|
3068
3068
|
threadId: z,
|
|
3069
3069
|
checkpointId: H,
|
|
3070
3070
|
limit: I
|
|
3071
3071
|
});
|
|
3072
3072
|
q(ie, "replace");
|
|
3073
|
-
}, [u, z, q, I]), ae =
|
|
3073
|
+
}, [u, z, q, I]), ae = Ue(async () => {
|
|
3074
3074
|
if (!z) throw new Error("No active thread");
|
|
3075
3075
|
await P(z);
|
|
3076
|
-
}, [z, P]), se =
|
|
3077
|
-
|
|
3076
|
+
}, [z, P]), se = We(!1);
|
|
3077
|
+
ze(() => {
|
|
3078
3078
|
const H = se.current;
|
|
3079
3079
|
if (se.current = d, H && !d && z) {
|
|
3080
3080
|
const ie = w.lastCheckpointId ?? void 0;
|
|
@@ -3095,14 +3095,14 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3095
3095
|
})();
|
|
3096
3096
|
}
|
|
3097
3097
|
}, [d, z, w.lastCheckpointId, u, q, oe]);
|
|
3098
|
-
const je =
|
|
3098
|
+
const je = Ue(async (H) => {
|
|
3099
3099
|
const ie = await u.createThread(H);
|
|
3100
3100
|
return await oe(), await P(ie.threadId), ie.threadId;
|
|
3101
|
-
}, [u, oe, P]), Le =
|
|
3102
|
-
await u.deleteThread(H), await oe(), z === H && (X(null),
|
|
3103
|
-
}, [u, oe, z,
|
|
3101
|
+
}, [u, oe, P]), Le = Ue(async (H) => {
|
|
3102
|
+
await u.deleteThread(H), await oe(), z === H && (X(null), C([]), k(!1), j(null), L(void 0));
|
|
3103
|
+
}, [u, oe, z, C]), Oe = Ue(async (H, ie) => {
|
|
3104
3104
|
await u.updateThread(H, ie), await oe();
|
|
3105
|
-
}, [u, oe]), ue =
|
|
3105
|
+
}, [u, oe]), ue = Ue(async (H, ie) => {
|
|
3106
3106
|
var On;
|
|
3107
3107
|
const Fe = (ie == null ? void 0 : ie.attachments) || [], { contentParts: tt, filesInfo: rt } = await ix(
|
|
3108
3108
|
u,
|
|
@@ -3121,7 +3121,7 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3121
3121
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3122
3122
|
checkpointId: (ie == null ? void 0 : ie.checkpointId) ?? w.lastCheckpointId ?? void 0
|
|
3123
3123
|
};
|
|
3124
|
-
|
|
3124
|
+
S(Qe);
|
|
3125
3125
|
const At = {
|
|
3126
3126
|
...Qe,
|
|
3127
3127
|
content: Qe.content.filter((J) => J.type === "text" || J.type === "image_url" || J.type === "file")
|
|
@@ -3152,7 +3152,7 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3152
3152
|
}
|
|
3153
3153
|
}
|
|
3154
3154
|
);
|
|
3155
|
-
}, [z,
|
|
3155
|
+
}, [z, S, m, T, w.lastCheckpointId, u, t == null ? void 0 : t.uploadPath, oe, X, a, c]), Pe = Ue(
|
|
3156
3156
|
async (H) => {
|
|
3157
3157
|
if (!z) throw new Error("No active thread");
|
|
3158
3158
|
if (M || !N) return;
|
|
@@ -3294,8 +3294,8 @@ function lx({
|
|
|
3294
3294
|
const N = (m ?? "").trim();
|
|
3295
3295
|
!N && !h || g(() => {
|
|
3296
3296
|
try {
|
|
3297
|
-
const
|
|
3298
|
-
|
|
3297
|
+
const k = i(N);
|
|
3298
|
+
k && typeof k.then == "function" ? k.then(() => {
|
|
3299
3299
|
v(""), p.current && (p.current.style.height = "auto");
|
|
3300
3300
|
}).catch(() => {
|
|
3301
3301
|
}) : (v(""), p.current && (p.current.style.height = "auto"));
|
|
@@ -3311,7 +3311,7 @@ function lx({
|
|
|
3311
3311
|
I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), w()) : I.key === "Escape" && t && (I.preventDefault(), a == null || a());
|
|
3312
3312
|
},
|
|
3313
3313
|
[w, t, a]
|
|
3314
|
-
),
|
|
3314
|
+
), C = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
|
|
3315
3315
|
return /* @__PURE__ */ l.jsx("form", { onSubmit: (I) => void w(I), className: `w-full ${u}`, children: /* @__PURE__ */ l.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
3316
3316
|
/* @__PURE__ */ l.jsx("div", { className: "flex-1", children: /* @__PURE__ */ l.jsx(
|
|
3317
3317
|
Kc,
|
|
@@ -3321,7 +3321,7 @@ function lx({
|
|
|
3321
3321
|
onChange: y,
|
|
3322
3322
|
onKeyDown: E,
|
|
3323
3323
|
placeholder: t ? "Edit your message..." : n,
|
|
3324
|
-
className:
|
|
3324
|
+
className: C,
|
|
3325
3325
|
disabled: o,
|
|
3326
3326
|
maxLength: s,
|
|
3327
3327
|
rows: 1,
|
|
@@ -4084,31 +4084,31 @@ const _x = {
|
|
|
4084
4084
|
offsetWidth: "width"
|
|
4085
4085
|
}, Xt = Ie(
|
|
4086
4086
|
([{ log: e }, { recalcInProgress: t }]) => {
|
|
4087
|
-
const n = Re(), r = Re(), o = ut(r, 0), s = Re(), i = Re(), a = V(0), c = V([]), u = V(void 0), d = V(void 0), h = V((
|
|
4087
|
+
const n = Re(), r = Re(), o = ut(r, 0), s = Re(), i = Re(), a = V(0), c = V([]), u = V(void 0), d = V(void 0), h = V((S, T) => ln(S, _x[T])), m = V(void 0), v = V(0), x = Tx(), g = ut(
|
|
4088
4088
|
B(n, Se(c, e, v), Gt(jx, x), Be()),
|
|
4089
4089
|
x
|
|
4090
4090
|
), p = ut(
|
|
4091
4091
|
B(
|
|
4092
4092
|
c,
|
|
4093
4093
|
Be(),
|
|
4094
|
-
Gt((
|
|
4094
|
+
Gt((S, T) => ({ current: T, prev: S.current }), {
|
|
4095
4095
|
current: [],
|
|
4096
4096
|
prev: []
|
|
4097
4097
|
}),
|
|
4098
|
-
re(({ prev:
|
|
4098
|
+
re(({ prev: S }) => S)
|
|
4099
4099
|
),
|
|
4100
4100
|
[]
|
|
4101
4101
|
);
|
|
4102
4102
|
le(
|
|
4103
4103
|
B(
|
|
4104
4104
|
c,
|
|
4105
|
-
pe((
|
|
4105
|
+
pe((S) => S.length > 0),
|
|
4106
4106
|
Se(g, v),
|
|
4107
|
-
re(([
|
|
4108
|
-
const I =
|
|
4107
|
+
re(([S, T, C]) => {
|
|
4108
|
+
const I = S.reduce((N, k, M) => bt(N, k, Tr(k, T.offsetTree, C) || M), Wn());
|
|
4109
4109
|
return {
|
|
4110
4110
|
...T,
|
|
4111
|
-
groupIndices:
|
|
4111
|
+
groupIndices: S,
|
|
4112
4112
|
groupOffsetTree: I
|
|
4113
4113
|
};
|
|
4114
4114
|
})
|
|
@@ -4118,12 +4118,12 @@ const _x = {
|
|
|
4118
4118
|
B(
|
|
4119
4119
|
r,
|
|
4120
4120
|
Se(g),
|
|
4121
|
-
pe(([
|
|
4122
|
-
re(([
|
|
4121
|
+
pe(([S, { lastIndex: T }]) => S < T),
|
|
4122
|
+
re(([S, { lastIndex: T, lastSize: C }]) => [
|
|
4123
4123
|
{
|
|
4124
4124
|
endIndex: T,
|
|
4125
|
-
size:
|
|
4126
|
-
startIndex:
|
|
4125
|
+
size: C,
|
|
4126
|
+
startIndex: S
|
|
4127
4127
|
}
|
|
4128
4128
|
])
|
|
4129
4129
|
),
|
|
@@ -4132,15 +4132,15 @@ const _x = {
|
|
|
4132
4132
|
const b = ut(
|
|
4133
4133
|
B(
|
|
4134
4134
|
u,
|
|
4135
|
-
re((
|
|
4135
|
+
re((S) => S === void 0)
|
|
4136
4136
|
),
|
|
4137
4137
|
!0
|
|
4138
4138
|
);
|
|
4139
4139
|
le(
|
|
4140
4140
|
B(
|
|
4141
4141
|
d,
|
|
4142
|
-
pe((
|
|
4143
|
-
re((
|
|
4142
|
+
pe((S) => S !== void 0 && De(Ke(g).sizeTree)),
|
|
4143
|
+
re((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
|
|
4144
4144
|
),
|
|
4145
4145
|
n
|
|
4146
4146
|
);
|
|
@@ -4149,35 +4149,35 @@ const _x = {
|
|
|
4149
4149
|
n,
|
|
4150
4150
|
Se(g),
|
|
4151
4151
|
Gt(
|
|
4152
|
-
({ sizes:
|
|
4153
|
-
changed:
|
|
4154
|
-
sizes:
|
|
4152
|
+
({ sizes: S }, [T, C]) => ({
|
|
4153
|
+
changed: C !== S,
|
|
4154
|
+
sizes: C
|
|
4155
4155
|
}),
|
|
4156
4156
|
{ changed: !1, sizes: x }
|
|
4157
4157
|
),
|
|
4158
|
-
re((
|
|
4158
|
+
re((S) => S.changed)
|
|
4159
4159
|
)
|
|
4160
4160
|
);
|
|
4161
4161
|
ke(
|
|
4162
4162
|
B(
|
|
4163
4163
|
a,
|
|
4164
4164
|
Gt(
|
|
4165
|
-
(
|
|
4165
|
+
(S, T) => ({ diff: S.prev - T, prev: T }),
|
|
4166
4166
|
{ diff: 0, prev: 0 }
|
|
4167
4167
|
),
|
|
4168
|
-
re((
|
|
4168
|
+
re((S) => S.diff)
|
|
4169
4169
|
),
|
|
4170
|
-
(
|
|
4170
|
+
(S) => {
|
|
4171
4171
|
const { groupIndices: T } = Ke(g);
|
|
4172
|
-
if (
|
|
4173
|
-
ye(t, !0), ye(s,
|
|
4174
|
-
else if (
|
|
4175
|
-
const
|
|
4176
|
-
|
|
4172
|
+
if (S > 0)
|
|
4173
|
+
ye(t, !0), ye(s, S + wl(S, T));
|
|
4174
|
+
else if (S < 0) {
|
|
4175
|
+
const C = Ke(p);
|
|
4176
|
+
C.length > 0 && (S -= wl(-S, C)), ye(i, S);
|
|
4177
4177
|
}
|
|
4178
4178
|
}
|
|
4179
|
-
), ke(B(a, Se(e)), ([
|
|
4180
|
-
|
|
4179
|
+
), ke(B(a, Se(e)), ([S, T]) => {
|
|
4180
|
+
S < 0 && T(
|
|
4181
4181
|
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
|
|
4182
4182
|
{ firstItemIndex: a },
|
|
4183
4183
|
gt.ERROR
|
|
@@ -4188,52 +4188,52 @@ const _x = {
|
|
|
4188
4188
|
B(
|
|
4189
4189
|
s,
|
|
4190
4190
|
Se(g),
|
|
4191
|
-
re(([
|
|
4192
|
-
const
|
|
4193
|
-
if (
|
|
4194
|
-
const
|
|
4191
|
+
re(([S, T]) => {
|
|
4192
|
+
const C = T.groupIndices.length > 0, I = [], N = T.lastSize;
|
|
4193
|
+
if (C) {
|
|
4194
|
+
const k = Sr(T.sizeTree, 0);
|
|
4195
4195
|
let M = 0, W = 0;
|
|
4196
|
-
for (; M <
|
|
4197
|
-
const
|
|
4196
|
+
for (; M < S; ) {
|
|
4197
|
+
const j = T.groupIndices[W], $ = T.groupIndices.length === W + 1 ? 1 / 0 : T.groupIndices[W + 1] - j - 1;
|
|
4198
4198
|
I.push({
|
|
4199
|
-
endIndex:
|
|
4200
|
-
size:
|
|
4201
|
-
startIndex:
|
|
4199
|
+
endIndex: j,
|
|
4200
|
+
size: k,
|
|
4201
|
+
startIndex: j
|
|
4202
4202
|
}), I.push({
|
|
4203
|
-
endIndex:
|
|
4203
|
+
endIndex: j + 1 + $ - 1,
|
|
4204
4204
|
size: N,
|
|
4205
|
-
startIndex:
|
|
4205
|
+
startIndex: j + 1
|
|
4206
4206
|
}), W++, M += $ + 1;
|
|
4207
4207
|
}
|
|
4208
4208
|
const G = wn(T.sizeTree);
|
|
4209
|
-
return M !==
|
|
4210
|
-
(
|
|
4211
|
-
let q =
|
|
4212
|
-
return
|
|
4213
|
-
...
|
|
4209
|
+
return M !== S && G.shift(), G.reduce(
|
|
4210
|
+
(j, { k: $, v: L }) => {
|
|
4211
|
+
let q = j.ranges;
|
|
4212
|
+
return j.prevSize !== 0 && (q = [
|
|
4213
|
+
...j.ranges,
|
|
4214
4214
|
{
|
|
4215
|
-
endIndex: $ +
|
|
4216
|
-
size:
|
|
4217
|
-
startIndex:
|
|
4215
|
+
endIndex: $ + S - 1,
|
|
4216
|
+
size: j.prevSize,
|
|
4217
|
+
startIndex: j.prevIndex
|
|
4218
4218
|
}
|
|
4219
4219
|
]), {
|
|
4220
|
-
prevIndex: $ +
|
|
4220
|
+
prevIndex: $ + S,
|
|
4221
4221
|
prevSize: L,
|
|
4222
4222
|
ranges: q
|
|
4223
4223
|
};
|
|
4224
4224
|
},
|
|
4225
4225
|
{
|
|
4226
|
-
prevIndex:
|
|
4226
|
+
prevIndex: S,
|
|
4227
4227
|
prevSize: 0,
|
|
4228
4228
|
ranges: I
|
|
4229
4229
|
}
|
|
4230
4230
|
).ranges;
|
|
4231
4231
|
}
|
|
4232
4232
|
return wn(T.sizeTree).reduce(
|
|
4233
|
-
(
|
|
4234
|
-
prevIndex: M +
|
|
4233
|
+
(k, { k: M, v: W }) => ({
|
|
4234
|
+
prevIndex: M + S,
|
|
4235
4235
|
prevSize: W,
|
|
4236
|
-
ranges: [...
|
|
4236
|
+
ranges: [...k.ranges, { endIndex: M + S - 1, size: k.prevSize, startIndex: k.prevIndex }]
|
|
4237
4237
|
}),
|
|
4238
4238
|
{
|
|
4239
4239
|
prevIndex: 0,
|
|
@@ -4249,9 +4249,9 @@ const _x = {
|
|
|
4249
4249
|
B(
|
|
4250
4250
|
i,
|
|
4251
4251
|
Se(g, v),
|
|
4252
|
-
re(([
|
|
4253
|
-
const I = -
|
|
4254
|
-
return Tr(I, T,
|
|
4252
|
+
re(([S, { offsetTree: T }, C]) => {
|
|
4253
|
+
const I = -S;
|
|
4254
|
+
return Tr(I, T, C);
|
|
4255
4255
|
})
|
|
4256
4256
|
)
|
|
4257
4257
|
);
|
|
@@ -4259,35 +4259,35 @@ const _x = {
|
|
|
4259
4259
|
B(
|
|
4260
4260
|
i,
|
|
4261
4261
|
Se(g, v),
|
|
4262
|
-
re(([
|
|
4262
|
+
re(([S, T, C]) => {
|
|
4263
4263
|
if (T.groupIndices.length > 0) {
|
|
4264
4264
|
if (De(T.sizeTree))
|
|
4265
4265
|
return T;
|
|
4266
4266
|
let I = Wn();
|
|
4267
4267
|
const N = Ke(p);
|
|
4268
|
-
let
|
|
4269
|
-
for (;
|
|
4268
|
+
let k = 0, M = 0, W = 0;
|
|
4269
|
+
for (; k < -S; ) {
|
|
4270
4270
|
W = N[M];
|
|
4271
4271
|
const G = N[M + 1] - W - 1;
|
|
4272
|
-
M++,
|
|
4272
|
+
M++, k += G + 1;
|
|
4273
4273
|
}
|
|
4274
|
-
if (I = wn(T.sizeTree).reduce((G, { k:
|
|
4274
|
+
if (I = wn(T.sizeTree).reduce((G, { k: j, v: $ }) => bt(G, Math.max(0, j + S), $), I), k !== -S) {
|
|
4275
4275
|
const G = Sr(T.sizeTree, W);
|
|
4276
4276
|
I = bt(I, 0, G);
|
|
4277
|
-
const
|
|
4278
|
-
I = bt(I, 1,
|
|
4277
|
+
const j = Lt(T.sizeTree, -S + 1)[1];
|
|
4278
|
+
I = bt(I, 1, j);
|
|
4279
4279
|
}
|
|
4280
4280
|
return {
|
|
4281
4281
|
...T,
|
|
4282
4282
|
sizeTree: I,
|
|
4283
|
-
...fi(T.offsetTree, 0, I,
|
|
4283
|
+
...fi(T.offsetTree, 0, I, C)
|
|
4284
4284
|
};
|
|
4285
4285
|
} else {
|
|
4286
|
-
const I = wn(T.sizeTree).reduce((N, { k
|
|
4286
|
+
const I = wn(T.sizeTree).reduce((N, { k, v: M }) => bt(N, Math.max(0, k + S), M), Wn());
|
|
4287
4287
|
return {
|
|
4288
4288
|
...T,
|
|
4289
4289
|
sizeTree: I,
|
|
4290
|
-
...fi(T.offsetTree, 0, I,
|
|
4290
|
+
...fi(T.offsetTree, 0, I, C)
|
|
4291
4291
|
};
|
|
4292
4292
|
}
|
|
4293
4293
|
})
|
|
@@ -4401,14 +4401,14 @@ const Lr = Ie(
|
|
|
4401
4401
|
Se(e, s, o),
|
|
4402
4402
|
re(
|
|
4403
4403
|
([
|
|
4404
|
-
[E,
|
|
4404
|
+
[E, S, T, C, I, N, k, M],
|
|
4405
4405
|
W,
|
|
4406
4406
|
G,
|
|
4407
|
-
|
|
4407
|
+
j
|
|
4408
4408
|
]) => {
|
|
4409
|
-
const $ = lu(E), { align: L, behavior: q, offset: O } = $, _ =
|
|
4410
|
-
let X = Tr(z,
|
|
4411
|
-
L === "end" ? (X += G + Lt(
|
|
4409
|
+
const $ = lu(E), { align: L, behavior: q, offset: O } = $, _ = C - 1, z = iu($, S, _);
|
|
4410
|
+
let X = Tr(z, S.offsetTree, W) + N;
|
|
4411
|
+
L === "end" ? (X += G + Lt(S.sizeTree, z)[1] - T + j, z === _ && (X += k)) : L === "center" ? X += (G + Lt(S.sizeTree, z)[1] - T + j) / 2 : X -= I, O && (X += O);
|
|
4412
4412
|
const oe = (F) => {
|
|
4413
4413
|
y(), F ? (M("retrying to scroll to", { location: E }, gt.DEBUG), ye(v, E)) : (ye(x, !0), M("list did not change, scroll successful", {}, gt.DEBUG));
|
|
4414
4414
|
};
|
|
@@ -4534,11 +4534,11 @@ const Rr = "up", mr = "down", Lx = "none", Fx = {
|
|
|
4534
4534
|
const x = wt(
|
|
4535
4535
|
B(
|
|
4536
4536
|
Ze(r, fe(s), fe(t), fe(e), fe(d)),
|
|
4537
|
-
Gt((w, [{ scrollHeight: y, scrollTop: E },
|
|
4538
|
-
const N = E +
|
|
4537
|
+
Gt((w, [{ scrollHeight: y, scrollTop: E }, S, T, C, I]) => {
|
|
4538
|
+
const N = E + S - y > -I, k = {
|
|
4539
4539
|
scrollHeight: y,
|
|
4540
4540
|
scrollTop: E,
|
|
4541
|
-
viewportHeight:
|
|
4541
|
+
viewportHeight: S
|
|
4542
4542
|
};
|
|
4543
4543
|
if (N) {
|
|
4544
4544
|
let W, G;
|
|
@@ -4546,14 +4546,14 @@ const Rr = "up", mr = "down", Lx = "none", Fx = {
|
|
|
4546
4546
|
atBottom: !0,
|
|
4547
4547
|
atBottomBecause: W,
|
|
4548
4548
|
scrollTopDelta: G,
|
|
4549
|
-
state:
|
|
4549
|
+
state: k
|
|
4550
4550
|
};
|
|
4551
4551
|
}
|
|
4552
4552
|
let M;
|
|
4553
|
-
return
|
|
4553
|
+
return k.scrollHeight > w.state.scrollHeight ? M = "SIZE_INCREASED" : S < w.state.viewportHeight ? M = "VIEWPORT_HEIGHT_DECREASING" : E < w.state.scrollTop ? M = "SCROLLING_UPWARDS" : M = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
4554
4554
|
atBottom: !1,
|
|
4555
4555
|
notAtBottomBecause: M,
|
|
4556
|
-
state:
|
|
4556
|
+
state: k
|
|
4557
4557
|
};
|
|
4558
4558
|
}, Fx),
|
|
4559
4559
|
Be((w, y) => w && w.atBottom === y.atBottom)
|
|
@@ -4562,7 +4562,7 @@ const Rr = "up", mr = "down", Lx = "none", Fx = {
|
|
|
4562
4562
|
B(
|
|
4563
4563
|
r,
|
|
4564
4564
|
Gt(
|
|
4565
|
-
(w, { scrollHeight: y, scrollTop: E, viewportHeight:
|
|
4565
|
+
(w, { scrollHeight: y, scrollTop: E, viewportHeight: S }) => {
|
|
4566
4566
|
if (cu(w.scrollHeight, y))
|
|
4567
4567
|
return {
|
|
4568
4568
|
changed: !1,
|
|
@@ -4571,7 +4571,7 @@ const Rr = "up", mr = "down", Lx = "none", Fx = {
|
|
|
4571
4571
|
scrollTop: E
|
|
4572
4572
|
};
|
|
4573
4573
|
{
|
|
4574
|
-
const T = y - (E +
|
|
4574
|
+
const T = y - (E + S) < 1;
|
|
4575
4575
|
return w.scrollTop !== E && T ? {
|
|
4576
4576
|
changed: !0,
|
|
4577
4577
|
jump: w.scrollTop - E,
|
|
@@ -4679,12 +4679,12 @@ const Gi = Ie(
|
|
|
4679
4679
|
w,
|
|
4680
4680
|
y
|
|
4681
4681
|
]) => {
|
|
4682
|
-
const E = d - w,
|
|
4683
|
-
let
|
|
4682
|
+
const E = d - w, S = p + b, T = Math.max(m - E, 0);
|
|
4683
|
+
let C = yl;
|
|
4684
4684
|
const I = Cl(y, Ro), N = Cl(y, Eo);
|
|
4685
|
-
return v -= w, v += m + b, x += m + b, x -= w, v > d +
|
|
4686
|
-
Math.max(E - m - Sl(g, Ro,
|
|
4687
|
-
E - T - b + h + Sl(g, Eo,
|
|
4685
|
+
return v -= w, v += m + b, x += m + b, x -= w, v > d + S - I && (C = Rr), x < d - T + h + N && (C = mr), C !== yl ? [
|
|
4686
|
+
Math.max(E - m - Sl(g, Ro, C) - I, 0),
|
|
4687
|
+
E - T - b + h + Sl(g, Eo, C) + N
|
|
4688
4688
|
] : null;
|
|
4689
4689
|
}
|
|
4690
4690
|
),
|
|
@@ -4818,35 +4818,35 @@ const kn = Ie(
|
|
|
4818
4818
|
fe(n),
|
|
4819
4819
|
e
|
|
4820
4820
|
),
|
|
4821
|
-
pe(([T,
|
|
4822
|
-
const
|
|
4823
|
-
return T && !
|
|
4821
|
+
pe(([T, C, , I, , , , , , , N]) => {
|
|
4822
|
+
const k = N && N.length !== I;
|
|
4823
|
+
return T && !C && !k;
|
|
4824
4824
|
}),
|
|
4825
4825
|
re(
|
|
4826
4826
|
([
|
|
4827
4827
|
,
|
|
4828
4828
|
,
|
|
4829
|
-
[T,
|
|
4829
|
+
[T, C],
|
|
4830
4830
|
I,
|
|
4831
4831
|
N,
|
|
4832
|
-
|
|
4832
|
+
k,
|
|
4833
4833
|
M,
|
|
4834
4834
|
W,
|
|
4835
4835
|
G,
|
|
4836
|
-
|
|
4836
|
+
j,
|
|
4837
4837
|
$
|
|
4838
4838
|
]) => {
|
|
4839
4839
|
const L = N, { offsetTree: q, sizeTree: O } = L, _ = Ke(p);
|
|
4840
4840
|
if (I === 0)
|
|
4841
4841
|
return { ...Ps, totalCount: I };
|
|
4842
|
-
if (T === 0 &&
|
|
4843
|
-
return _ === 0 ? { ...Ps, totalCount: I } : uu(_,
|
|
4842
|
+
if (T === 0 && C === 0)
|
|
4843
|
+
return _ === 0 ? { ...Ps, totalCount: I } : uu(_, k, N, G, j, $ || []);
|
|
4844
4844
|
if (De(O))
|
|
4845
4845
|
return _ > 0 ? null : ao(
|
|
4846
|
-
$x(Vi(
|
|
4846
|
+
$x(Vi(k, I), L, $),
|
|
4847
4847
|
[],
|
|
4848
4848
|
I,
|
|
4849
|
-
|
|
4849
|
+
j,
|
|
4850
4850
|
L,
|
|
4851
4851
|
G
|
|
4852
4852
|
);
|
|
@@ -4861,8 +4861,8 @@ const kn = Ie(
|
|
|
4861
4861
|
}
|
|
4862
4862
|
}
|
|
4863
4863
|
if (!M)
|
|
4864
|
-
return ao([], z, I,
|
|
4865
|
-
const X = W.length > 0 ? W[W.length - 1] + 1 : 0, oe = Nx(q, T,
|
|
4864
|
+
return ao([], z, I, j, L, G);
|
|
4865
|
+
const X = W.length > 0 ? W[W.length - 1] + 1 : 0, oe = Nx(q, T, C, X);
|
|
4866
4866
|
if (oe.length === 0)
|
|
4867
4867
|
return null;
|
|
4868
4868
|
const F = I - 1, ee = Go([], (he) => {
|
|
@@ -4871,17 +4871,17 @@ const kn = Ie(
|
|
|
4871
4871
|
let P = Y.offset, Z = be.start;
|
|
4872
4872
|
const ne = Y.size;
|
|
4873
4873
|
if (Y.offset < T) {
|
|
4874
|
-
Z += Math.floor((T - Y.offset +
|
|
4874
|
+
Z += Math.floor((T - Y.offset + j) / (ne + j));
|
|
4875
4875
|
const se = Z - be.start;
|
|
4876
|
-
P += se * ne + se *
|
|
4876
|
+
P += se * ne + se * j;
|
|
4877
4877
|
}
|
|
4878
4878
|
Z < X && (P += (X - Z) * ne, Z = X);
|
|
4879
4879
|
const ae = Math.min(be.end, F);
|
|
4880
|
-
for (let se = Z; se <= ae && !(P >=
|
|
4881
|
-
he.push({ data: $ == null ? void 0 : $[se], index: se, offset: P, size: ne }), P += ne +
|
|
4880
|
+
for (let se = Z; se <= ae && !(P >= C); se++)
|
|
4881
|
+
he.push({ data: $ == null ? void 0 : $[se], index: se, offset: P, size: ne }), P += ne + j;
|
|
4882
4882
|
}
|
|
4883
4883
|
});
|
|
4884
|
-
return ao(ee, z, I,
|
|
4884
|
+
return ao(ee, z, I, j, L, G);
|
|
4885
4885
|
}
|
|
4886
4886
|
),
|
|
4887
4887
|
//@ts-expect-error filter needs to be fixed
|
|
@@ -4921,8 +4921,8 @@ const kn = Ie(
|
|
|
4921
4921
|
w,
|
|
4922
4922
|
pe(({ items: T }) => T.length > 0),
|
|
4923
4923
|
Se(o, e),
|
|
4924
|
-
pe(([{ items: T },
|
|
4925
|
-
re(([, T,
|
|
4924
|
+
pe(([{ items: T }, C]) => T[T.length - 1].originalIndex === C - 1),
|
|
4925
|
+
re(([, T, C]) => [T - 1, C]),
|
|
4926
4926
|
Be(Cr),
|
|
4927
4927
|
re(([T]) => T)
|
|
4928
4928
|
)
|
|
@@ -4930,29 +4930,29 @@ const kn = Ie(
|
|
|
4930
4930
|
B(
|
|
4931
4931
|
w,
|
|
4932
4932
|
en(200),
|
|
4933
|
-
pe(({ items: T, topItems:
|
|
4933
|
+
pe(({ items: T, topItems: C }) => T.length > 0 && T[0].originalIndex === C.length),
|
|
4934
4934
|
re(({ items: T }) => T[0].index),
|
|
4935
4935
|
Be()
|
|
4936
4936
|
)
|
|
4937
|
-
),
|
|
4937
|
+
), S = wt(
|
|
4938
4938
|
B(
|
|
4939
4939
|
w,
|
|
4940
4940
|
pe(({ items: T }) => T.length > 0),
|
|
4941
4941
|
re(({ items: T }) => {
|
|
4942
|
-
let
|
|
4943
|
-
for (; T[
|
|
4944
|
-
|
|
4945
|
-
for (; T[I].type === "group" && I >
|
|
4942
|
+
let C = 0, I = T.length - 1;
|
|
4943
|
+
for (; T[C].type === "group" && C < I; )
|
|
4944
|
+
C++;
|
|
4945
|
+
for (; T[I].type === "group" && I > C; )
|
|
4946
4946
|
I--;
|
|
4947
4947
|
return {
|
|
4948
4948
|
endIndex: T[I].index,
|
|
4949
|
-
startIndex: T[
|
|
4949
|
+
startIndex: T[C].index
|
|
4950
4950
|
};
|
|
4951
4951
|
}),
|
|
4952
4952
|
Be(ru)
|
|
4953
4953
|
)
|
|
4954
4954
|
);
|
|
4955
|
-
return { endReached: y, initialItemCount: p, itemsRendered: b, listState: w, rangeChanged:
|
|
4955
|
+
return { endReached: y, initialItemCount: p, itemsRendered: b, listState: w, rangeChanged: S, startReached: E, topItemsIndexes: g, ...m };
|
|
4956
4956
|
},
|
|
4957
4957
|
$e(
|
|
4958
4958
|
Xt,
|
|
@@ -5015,14 +5015,14 @@ const kn = Ie(
|
|
|
5015
5015
|
Se(t, c, n, s, o, r, a),
|
|
5016
5016
|
Se(e),
|
|
5017
5017
|
re(([[h, m, v, x, g, p, b, w], y]) => {
|
|
5018
|
-
const { align: E, behavior:
|
|
5018
|
+
const { align: E, behavior: S, calculateViewLocation: T = zx, done: C, ...I } = h, N = iu(h, m, x - 1), k = Tr(N, m.offsetTree, y) + g + p, M = k + Lt(m.sizeTree, N)[1], W = w + p, G = w + v - b, j = T({
|
|
5019
5019
|
itemBottom: M,
|
|
5020
|
-
itemTop:
|
|
5021
|
-
locationParams: { align: E, behavior:
|
|
5020
|
+
itemTop: k,
|
|
5021
|
+
locationParams: { align: E, behavior: S, ...I },
|
|
5022
5022
|
viewportBottom: G,
|
|
5023
5023
|
viewportTop: W
|
|
5024
5024
|
});
|
|
5025
|
-
return
|
|
5025
|
+
return j ? C && Mt(
|
|
5026
5026
|
B(
|
|
5027
5027
|
i,
|
|
5028
5028
|
pe(($) => !$),
|
|
@@ -5030,8 +5030,8 @@ const kn = Ie(
|
|
|
5030
5030
|
// but if scrollingInProgress is true, we skip the initial publish.
|
|
5031
5031
|
Rn(Ke(i) ? 1 : 2)
|
|
5032
5032
|
),
|
|
5033
|
-
|
|
5034
|
-
) :
|
|
5033
|
+
C
|
|
5034
|
+
) : C && C(), j;
|
|
5035
5035
|
}),
|
|
5036
5036
|
pe((h) => h !== null)
|
|
5037
5037
|
),
|
|
@@ -5060,10 +5060,10 @@ const Ux = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Wx = Ie(
|
|
|
5060
5060
|
]) => {
|
|
5061
5061
|
const x = V(!1), g = Re();
|
|
5062
5062
|
let p = null;
|
|
5063
|
-
function b(
|
|
5063
|
+
function b(S) {
|
|
5064
5064
|
ye(i, {
|
|
5065
5065
|
align: "end",
|
|
5066
|
-
behavior:
|
|
5066
|
+
behavior: S,
|
|
5067
5067
|
index: "LAST"
|
|
5068
5068
|
});
|
|
5069
5069
|
}
|
|
@@ -5071,53 +5071,53 @@ const Ux = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Wx = Ie(
|
|
|
5071
5071
|
B(
|
|
5072
5072
|
Ze(B(fe(t), Rn(1)), c),
|
|
5073
5073
|
Se(fe(x), s, a, h),
|
|
5074
|
-
re(([[
|
|
5074
|
+
re(([[S, T], C, I, N, k]) => {
|
|
5075
5075
|
let M = T && N, W = "auto";
|
|
5076
|
-
return M && (W = Ux(
|
|
5076
|
+
return M && (W = Ux(C, I || k), M = M && !!W), { followOutputBehavior: W, shouldFollow: M, totalCount: S };
|
|
5077
5077
|
}),
|
|
5078
|
-
pe(({ shouldFollow:
|
|
5078
|
+
pe(({ shouldFollow: S }) => S)
|
|
5079
5079
|
),
|
|
5080
|
-
({ followOutputBehavior:
|
|
5080
|
+
({ followOutputBehavior: S, totalCount: T }) => {
|
|
5081
5081
|
p && (p(), p = null), Ke(n) ? requestAnimationFrame(() => {
|
|
5082
|
-
Ke(d)("following output to ", { totalCount: T }, gt.DEBUG), b(
|
|
5082
|
+
Ke(d)("following output to ", { totalCount: T }, gt.DEBUG), b(S);
|
|
5083
5083
|
}) : p = Mt(e, () => {
|
|
5084
|
-
Ke(d)("following output to ", { totalCount: T }, gt.DEBUG), b(
|
|
5084
|
+
Ke(d)("following output to ", { totalCount: T }, gt.DEBUG), b(S), p = null;
|
|
5085
5085
|
});
|
|
5086
5086
|
}
|
|
5087
5087
|
);
|
|
5088
|
-
function w(
|
|
5089
|
-
const T = Mt(o, (
|
|
5090
|
-
|
|
5088
|
+
function w(S) {
|
|
5089
|
+
const T = Mt(o, (C) => {
|
|
5090
|
+
S && !C.atBottom && C.notAtBottomBecause === "SIZE_INCREASED" && !p && (Ke(d)("scrolling to bottom due to increased size", {}, gt.DEBUG), b("auto"));
|
|
5091
5091
|
});
|
|
5092
5092
|
setTimeout(T, 100);
|
|
5093
5093
|
}
|
|
5094
5094
|
ke(
|
|
5095
5095
|
B(
|
|
5096
5096
|
Ze(fe(x), t, u),
|
|
5097
|
-
pe(([
|
|
5097
|
+
pe(([S, , T]) => S && T),
|
|
5098
5098
|
Gt(
|
|
5099
|
-
({ value:
|
|
5099
|
+
({ value: S }, [, T]) => ({ refreshed: S === T, value: T }),
|
|
5100
5100
|
{ refreshed: !1, value: 0 }
|
|
5101
5101
|
),
|
|
5102
|
-
pe(({ refreshed:
|
|
5102
|
+
pe(({ refreshed: S }) => S),
|
|
5103
5103
|
Se(x, t)
|
|
5104
5104
|
),
|
|
5105
|
-
([,
|
|
5106
|
-
Ke(a) && w(
|
|
5105
|
+
([, S]) => {
|
|
5106
|
+
Ke(a) && w(S !== !1);
|
|
5107
5107
|
}
|
|
5108
5108
|
), ke(g, () => {
|
|
5109
5109
|
w(Ke(x) !== !1);
|
|
5110
|
-
}), ke(Ze(fe(x), o), ([
|
|
5111
|
-
|
|
5110
|
+
}), ke(Ze(fe(x), o), ([S, T]) => {
|
|
5111
|
+
S && !T.atBottom && T.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && b("auto");
|
|
5112
5112
|
});
|
|
5113
5113
|
const y = V(null), E = Re();
|
|
5114
5114
|
return le(
|
|
5115
5115
|
li(
|
|
5116
5116
|
B(
|
|
5117
5117
|
fe(r),
|
|
5118
|
-
re((
|
|
5118
|
+
re((S) => {
|
|
5119
5119
|
var T;
|
|
5120
|
-
return (T =
|
|
5120
|
+
return (T = S == null ? void 0 : S.length) != null ? T : 0;
|
|
5121
5121
|
})
|
|
5122
5122
|
),
|
|
5123
5123
|
B(fe(t))
|
|
@@ -5127,15 +5127,15 @@ const Ux = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Wx = Ie(
|
|
|
5127
5127
|
B(
|
|
5128
5128
|
Ze(B(E, Rn(1)), c),
|
|
5129
5129
|
Se(fe(y), a, h, m),
|
|
5130
|
-
re(([[
|
|
5131
|
-
pe((
|
|
5130
|
+
re(([[S, T], C, I, N, k]) => T && I && (C == null ? void 0 : C({ context: k, totalCount: S, scrollingInProgress: N }))),
|
|
5131
|
+
pe((S) => !!S),
|
|
5132
5132
|
en(0)
|
|
5133
5133
|
),
|
|
5134
|
-
(
|
|
5134
|
+
(S) => {
|
|
5135
5135
|
p && (p(), p = null), Ke(n) ? requestAnimationFrame(() => {
|
|
5136
|
-
Ke(d)("scrolling into view", {}), ye(v,
|
|
5136
|
+
Ke(d)("scrolling into view", {}), ye(v, S);
|
|
5137
5137
|
}) : p = Mt(e, () => {
|
|
5138
|
-
Ke(d)("scrolling into view", {}), ye(v,
|
|
5138
|
+
Ke(d)("scrolling into view", {}), ye(v, S), p = null;
|
|
5139
5139
|
});
|
|
5140
5140
|
}
|
|
5141
5141
|
), { autoscrollToBottom: g, followOutput: x, scrollIntoViewOnChange: y };
|
|
@@ -5321,10 +5321,10 @@ const Xx = mu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5321
5321
|
c,
|
|
5322
5322
|
Se(i),
|
|
5323
5323
|
Gt(
|
|
5324
|
-
([, b, w, y], [{ bottom: E, items:
|
|
5324
|
+
([, b, w, y], [{ bottom: E, items: S, offsetBottom: T, totalCount: C }, I]) => {
|
|
5325
5325
|
const N = E + T;
|
|
5326
|
-
let
|
|
5327
|
-
return w ===
|
|
5326
|
+
let k = 0;
|
|
5327
|
+
return w === C && b.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && b[0].originalIndex === 0 || (k = N - y, k !== 0 && (k += I))), [k, S, C, N];
|
|
5328
5328
|
},
|
|
5329
5329
|
[0, [], 0, 0]
|
|
5330
5330
|
),
|
|
@@ -5357,22 +5357,22 @@ const Xx = mu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5357
5357
|
B(
|
|
5358
5358
|
u,
|
|
5359
5359
|
Se(m, d),
|
|
5360
|
-
re(([b, { groupIndices: w, lastSize: y, sizeTree: E },
|
|
5361
|
-
function T(
|
|
5362
|
-
return
|
|
5360
|
+
re(([b, { groupIndices: w, lastSize: y, sizeTree: E }, S]) => {
|
|
5361
|
+
function T(C) {
|
|
5362
|
+
return C * (y + S);
|
|
5363
5363
|
}
|
|
5364
5364
|
if (w.length === 0)
|
|
5365
5365
|
return T(b);
|
|
5366
5366
|
{
|
|
5367
|
-
let
|
|
5367
|
+
let C = 0;
|
|
5368
5368
|
const I = Sr(E, 0);
|
|
5369
|
-
let N = 0,
|
|
5369
|
+
let N = 0, k = 0;
|
|
5370
5370
|
for (; N < b; ) {
|
|
5371
|
-
N++,
|
|
5372
|
-
let M = w.length ===
|
|
5373
|
-
N + M > b && (
|
|
5371
|
+
N++, C += I;
|
|
5372
|
+
let M = w.length === k + 1 ? 1 / 0 : w[k + 1] - w[k] - 1;
|
|
5373
|
+
N + M > b && (C -= I, M = b - N + 1), N += M, C += T(M), k++;
|
|
5374
5374
|
}
|
|
5375
|
-
return
|
|
5375
|
+
return C;
|
|
5376
5376
|
}
|
|
5377
5377
|
})
|
|
5378
5378
|
),
|
|
@@ -5446,15 +5446,15 @@ const Xx = mu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5446
5446
|
p,
|
|
5447
5447
|
b,
|
|
5448
5448
|
{ listState: w, topItemsIndexes: y, ...E },
|
|
5449
|
-
{ scrollToIndex:
|
|
5449
|
+
{ scrollToIndex: S },
|
|
5450
5450
|
T,
|
|
5451
|
-
{ topItemCount:
|
|
5451
|
+
{ topItemCount: C },
|
|
5452
5452
|
{ groupCounts: I },
|
|
5453
5453
|
N
|
|
5454
5454
|
]) => (le(E.rangeChanged, N.scrollSeekRangeChanged), le(
|
|
5455
5455
|
B(
|
|
5456
5456
|
N.windowViewportRect,
|
|
5457
|
-
re((
|
|
5457
|
+
re((k) => k.visibleHeight)
|
|
5458
5458
|
),
|
|
5459
5459
|
g.viewportHeight
|
|
5460
5460
|
), {
|
|
@@ -5468,7 +5468,7 @@ const Xx = mu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5468
5468
|
initialTopMostItemIndex: v,
|
|
5469
5469
|
scrolledToInitialItem: x,
|
|
5470
5470
|
sizeRanges: a,
|
|
5471
|
-
topItemCount:
|
|
5471
|
+
topItemCount: C,
|
|
5472
5472
|
topItemsIndexes: y,
|
|
5473
5473
|
// input
|
|
5474
5474
|
totalCount: d,
|
|
@@ -5476,7 +5476,7 @@ const Xx = mu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5476
5476
|
groupIndices: s,
|
|
5477
5477
|
itemSize: i,
|
|
5478
5478
|
listState: w,
|
|
5479
|
-
scrollToIndex:
|
|
5479
|
+
scrollToIndex: S,
|
|
5480
5480
|
// output
|
|
5481
5481
|
statefulTotalCount: u,
|
|
5482
5482
|
trackItemSizes: h,
|
|
@@ -5538,16 +5538,16 @@ function xu(e, t, n) {
|
|
|
5538
5538
|
return i.reduce((b, w) => (b[w] = mx(p[t.events[w]]), b), {});
|
|
5539
5539
|
}
|
|
5540
5540
|
const h = K.forwardRef((p, b) => {
|
|
5541
|
-
const { children: w, ...y } = p, [E] = K.useState(() => Go(xx(e), (
|
|
5542
|
-
c(
|
|
5543
|
-
})), [
|
|
5541
|
+
const { children: w, ...y } = p, [E] = K.useState(() => Go(xx(e), (C) => {
|
|
5542
|
+
c(C, y);
|
|
5543
|
+
})), [S] = K.useState(gl(d, E));
|
|
5544
5544
|
Gr(() => {
|
|
5545
|
-
for (const
|
|
5546
|
-
|
|
5545
|
+
for (const C of i)
|
|
5546
|
+
C in y && ke(S[C], y[C]);
|
|
5547
5547
|
return () => {
|
|
5548
|
-
Object.values(
|
|
5548
|
+
Object.values(S).map($i);
|
|
5549
5549
|
};
|
|
5550
|
-
}, [y,
|
|
5550
|
+
}, [y, S, E]), Gr(() => {
|
|
5551
5551
|
c(E, y);
|
|
5552
5552
|
}), K.useImperativeHandle(b, ml(u(E)));
|
|
5553
5553
|
const T = n;
|
|
@@ -5697,10 +5697,10 @@ const tv = /* @__PURE__ */ Ie(() => {
|
|
|
5697
5697
|
g,
|
|
5698
5698
|
ve("skipAnimationFrameInResizeObserver")
|
|
5699
5699
|
), [b, w] = K.useState(0);
|
|
5700
|
-
Xi("deviation", (
|
|
5701
|
-
b !==
|
|
5700
|
+
Xi("deviation", (j) => {
|
|
5701
|
+
b !== j && w(j);
|
|
5702
5702
|
});
|
|
5703
|
-
const y = ve("EmptyPlaceholder"), E = ve("ScrollSeekPlaceholder") || rv,
|
|
5703
|
+
const y = ve("EmptyPlaceholder"), E = ve("ScrollSeekPlaceholder") || rv, S = ve("ListComponent"), T = ve("ItemComponent"), C = ve("GroupComponent"), I = ve("computeItemKey"), N = ve("isSeeking"), k = ve("groupIndices").length > 0, M = ve("alignToBottom"), W = ve("initialItemFinalLocationReached"), G = e ? {} : {
|
|
5704
5704
|
boxSizing: "border-box",
|
|
5705
5705
|
...g ? {
|
|
5706
5706
|
display: "inline-block",
|
|
@@ -5717,48 +5717,48 @@ const tv = /* @__PURE__ */ Ie(() => {
|
|
|
5717
5717
|
...W ? {} : { visibility: "hidden" }
|
|
5718
5718
|
};
|
|
5719
5719
|
return !e && t.totalCount === 0 && y ? /* @__PURE__ */ l.jsx(y, { ...ct(y, u) }) : /* @__PURE__ */ l.jsx(
|
|
5720
|
-
|
|
5720
|
+
S,
|
|
5721
5721
|
{
|
|
5722
|
-
...ct(
|
|
5722
|
+
...ct(S, u),
|
|
5723
5723
|
"data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
|
|
5724
5724
|
ref: p,
|
|
5725
5725
|
style: G,
|
|
5726
|
-
children: (e ? t.topItems : t.items).map((
|
|
5727
|
-
const $ =
|
|
5726
|
+
children: (e ? t.topItems : t.items).map((j) => {
|
|
5727
|
+
const $ = j.originalIndex, L = I($ + t.firstItemIndex, j.data, u);
|
|
5728
5728
|
return N ? /* @__PURE__ */ to(
|
|
5729
5729
|
E,
|
|
5730
5730
|
{
|
|
5731
5731
|
...ct(E, u),
|
|
5732
|
-
height:
|
|
5733
|
-
index:
|
|
5732
|
+
height: j.size,
|
|
5733
|
+
index: j.index,
|
|
5734
5734
|
key: L,
|
|
5735
|
-
type:
|
|
5736
|
-
...
|
|
5735
|
+
type: j.type || "item",
|
|
5736
|
+
...j.type === "group" ? {} : { groupIndex: j.groupIndex }
|
|
5737
5737
|
}
|
|
5738
|
-
) :
|
|
5739
|
-
|
|
5738
|
+
) : j.type === "group" ? /* @__PURE__ */ to(
|
|
5739
|
+
C,
|
|
5740
5740
|
{
|
|
5741
|
-
...ct(
|
|
5741
|
+
...ct(C, u),
|
|
5742
5742
|
"data-index": $,
|
|
5743
|
-
"data-item-index":
|
|
5744
|
-
"data-known-size":
|
|
5743
|
+
"data-item-index": j.index,
|
|
5744
|
+
"data-known-size": j.size,
|
|
5745
5745
|
key: L,
|
|
5746
5746
|
style: ov
|
|
5747
5747
|
},
|
|
5748
|
-
d(
|
|
5748
|
+
d(j.index, u)
|
|
5749
5749
|
) : /* @__PURE__ */ to(
|
|
5750
5750
|
T,
|
|
5751
5751
|
{
|
|
5752
5752
|
...ct(T, u),
|
|
5753
|
-
...cv(T,
|
|
5753
|
+
...cv(T, j.data),
|
|
5754
5754
|
"data-index": $,
|
|
5755
|
-
"data-item-group-index":
|
|
5756
|
-
"data-item-index":
|
|
5757
|
-
"data-known-size":
|
|
5755
|
+
"data-item-group-index": j.groupIndex,
|
|
5756
|
+
"data-item-index": j.index,
|
|
5757
|
+
"data-known-size": j.size,
|
|
5758
5758
|
key: L,
|
|
5759
5759
|
style: g ? sv : Su
|
|
5760
5760
|
},
|
|
5761
|
-
|
|
5761
|
+
k ? c(j.index, j.groupIndex, j.data, u) : c(j.index, j.data, u)
|
|
5762
5762
|
);
|
|
5763
5763
|
})
|
|
5764
5764
|
}
|
|
@@ -6041,9 +6041,9 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6041
6041
|
v,
|
|
6042
6042
|
{ didMount: x, propsReady: g },
|
|
6043
6043
|
{ customScrollParent: p, useWindowScroll: b, windowScrollContainerState: w, windowScrollTo: y, windowViewportRect: E },
|
|
6044
|
-
|
|
6044
|
+
S
|
|
6045
6045
|
]) => {
|
|
6046
|
-
const T = V(0),
|
|
6046
|
+
const T = V(0), C = V(0), I = V(Nl), N = V({ height: 0, width: 0 }), k = V({ height: 0, width: 0 }), M = Re(), W = Re(), G = V(0), j = V(null), $ = V({ column: 0, row: 0 }), L = Re(), q = Re(), O = V(!1), _ = V(0), z = V(!0), X = V(!1), oe = V(!1);
|
|
6047
6047
|
ke(
|
|
6048
6048
|
B(
|
|
6049
6049
|
x,
|
|
@@ -6055,7 +6055,7 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6055
6055
|
}
|
|
6056
6056
|
), ke(
|
|
6057
6057
|
B(
|
|
6058
|
-
Ze(x, z,
|
|
6058
|
+
Ze(x, z, k, N, _, X),
|
|
6059
6059
|
pe(([P, Z, ne, ae, , se]) => P && !Z && ne.height !== 0 && ae.height !== 0 && !se)
|
|
6060
6060
|
),
|
|
6061
6061
|
([, , , , P]) => {
|
|
@@ -6071,7 +6071,7 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6071
6071
|
pe((P) => P != null && P.scrollTop > 0),
|
|
6072
6072
|
Wt(0)
|
|
6073
6073
|
),
|
|
6074
|
-
|
|
6074
|
+
C
|
|
6075
6075
|
), ke(
|
|
6076
6076
|
B(
|
|
6077
6077
|
x,
|
|
@@ -6079,7 +6079,7 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6079
6079
|
pe(([, P]) => P != null)
|
|
6080
6080
|
),
|
|
6081
6081
|
([, P]) => {
|
|
6082
|
-
P && (ye(N, P.viewport), ye(
|
|
6082
|
+
P && (ye(N, P.viewport), ye(k, P.item), ye($, P.gap), P.scrollTop > 0 && (ye(O, !0), Mt(B(u, Rn(1)), (Z) => {
|
|
6083
6083
|
ye(O, !1);
|
|
6084
6084
|
}), ye(c, { top: P.scrollTop })));
|
|
6085
6085
|
}
|
|
@@ -6093,7 +6093,7 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6093
6093
|
B(
|
|
6094
6094
|
Ze(
|
|
6095
6095
|
fe(N, Kr),
|
|
6096
|
-
fe(
|
|
6096
|
+
fe(k, Kr),
|
|
6097
6097
|
fe($, (P, Z) => P && P.column === Z.column && P.row === Z.row),
|
|
6098
6098
|
fe(u)
|
|
6099
6099
|
),
|
|
@@ -6111,10 +6111,10 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6111
6111
|
fe(T),
|
|
6112
6112
|
r,
|
|
6113
6113
|
fe($, Cv),
|
|
6114
|
-
fe(
|
|
6114
|
+
fe(k, Kr),
|
|
6115
6115
|
fe(N, Kr),
|
|
6116
|
-
fe(
|
|
6117
|
-
fe(
|
|
6116
|
+
fe(j),
|
|
6117
|
+
fe(C),
|
|
6118
6118
|
fe(O),
|
|
6119
6119
|
fe(z),
|
|
6120
6120
|
fe(_)
|
|
@@ -6151,14 +6151,14 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6151
6151
|
I
|
|
6152
6152
|
), le(
|
|
6153
6153
|
B(
|
|
6154
|
-
|
|
6154
|
+
j,
|
|
6155
6155
|
pe((P) => P !== null),
|
|
6156
6156
|
re((P) => P.length)
|
|
6157
6157
|
),
|
|
6158
6158
|
T
|
|
6159
6159
|
), le(
|
|
6160
6160
|
B(
|
|
6161
|
-
Ze(N,
|
|
6161
|
+
Ze(N, k, I, $),
|
|
6162
6162
|
pe(([P, Z, { items: ne }]) => ne.length > 0 && Z.height !== 0 && P.height !== 0),
|
|
6163
6163
|
re(([P, Z, { items: ne }, ae]) => {
|
|
6164
6164
|
const { bottom: se, top: je } = Pl(P, ae, Z, ne);
|
|
@@ -6212,7 +6212,7 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6212
6212
|
le(be, v.scrollSeekRangeChanged), le(
|
|
6213
6213
|
B(
|
|
6214
6214
|
M,
|
|
6215
|
-
Se(N,
|
|
6215
|
+
Se(N, k, T, $),
|
|
6216
6216
|
re(([P, Z, ne, ae, se]) => {
|
|
6217
6217
|
const je = lu(P), { align: Le, behavior: Oe, offset: ue } = je;
|
|
6218
6218
|
let Pe = je.index;
|
|
@@ -6239,14 +6239,14 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6239
6239
|
), {
|
|
6240
6240
|
customScrollParent: p,
|
|
6241
6241
|
// input
|
|
6242
|
-
data:
|
|
6242
|
+
data: j,
|
|
6243
6243
|
deviation: G,
|
|
6244
6244
|
footerHeight: o,
|
|
6245
6245
|
gap: $,
|
|
6246
6246
|
headerHeight: s,
|
|
6247
6247
|
increaseViewportBy: e,
|
|
6248
|
-
initialItemCount:
|
|
6249
|
-
itemDimensions:
|
|
6248
|
+
initialItemCount: C,
|
|
6249
|
+
itemDimensions: k,
|
|
6250
6250
|
overscan: n,
|
|
6251
6251
|
restoreStateFrom: q,
|
|
6252
6252
|
scrollBy: i,
|
|
@@ -6275,7 +6275,7 @@ const Tv = /* @__PURE__ */ Ie(
|
|
|
6275
6275
|
startReached: he,
|
|
6276
6276
|
stateChanged: L,
|
|
6277
6277
|
stateRestoreInProgress: O,
|
|
6278
|
-
...
|
|
6278
|
+
...S
|
|
6279
6279
|
};
|
|
6280
6280
|
},
|
|
6281
6281
|
$e(Gi, ft, Br, pu, pn, Ki, hn)
|
|
@@ -6332,8 +6332,8 @@ const Rv = /* @__PURE__ */ Ie(() => {
|
|
|
6332
6332
|
i(w);
|
|
6333
6333
|
const y = b.firstChild;
|
|
6334
6334
|
if (y) {
|
|
6335
|
-
const { height: E, width:
|
|
6336
|
-
h({ height: E, width:
|
|
6335
|
+
const { height: E, width: S } = y.getBoundingClientRect();
|
|
6336
|
+
h({ height: E, width: S });
|
|
6337
6337
|
}
|
|
6338
6338
|
m({
|
|
6339
6339
|
column: _l("column-gap", getComputedStyle(b).columnGap, v),
|
|
@@ -6985,8 +6985,8 @@ function sb(e, t = !1) {
|
|
|
6985
6985
|
return `${e.length}:${n}:${r}`;
|
|
6986
6986
|
}
|
|
6987
6987
|
function ib(e, t) {
|
|
6988
|
-
const [n, r] = de(e), o =
|
|
6989
|
-
return
|
|
6988
|
+
const [n, r] = de(e), o = We(e), s = We(null);
|
|
6989
|
+
return ze(() => {
|
|
6990
6990
|
if (!t) {
|
|
6991
6991
|
r(e);
|
|
6992
6992
|
return;
|
|
@@ -7009,8 +7009,8 @@ function Ls({
|
|
|
7009
7009
|
const i = ib(e, r), a = sb(i, r), [c, u] = de(() => {
|
|
7010
7010
|
var v;
|
|
7011
7011
|
return ((v = dr.get(a)) == null ? void 0 : v.html) ?? null;
|
|
7012
|
-
}), d =
|
|
7013
|
-
|
|
7012
|
+
}), d = We(null), h = We([]);
|
|
7013
|
+
ze(() => {
|
|
7014
7014
|
h.current = [];
|
|
7015
7015
|
const v = dr.get(a);
|
|
7016
7016
|
if (v && v.source === i) {
|
|
@@ -7018,23 +7018,23 @@ function Ls({
|
|
|
7018
7018
|
return;
|
|
7019
7019
|
}
|
|
7020
7020
|
if (v && v.html !== c && u(v.html), !Jo) {
|
|
7021
|
-
let
|
|
7021
|
+
let C = !1;
|
|
7022
7022
|
return (async () => {
|
|
7023
7023
|
try {
|
|
7024
7024
|
const I = await Ll(i);
|
|
7025
|
-
dr.set(a, { html: I, source: i }),
|
|
7025
|
+
dr.set(a, { html: I, source: i }), C || u(I);
|
|
7026
7026
|
} catch (I) {
|
|
7027
7027
|
console.error("[MarkdownContent] fallback parse failed", I);
|
|
7028
7028
|
}
|
|
7029
7029
|
})(), () => {
|
|
7030
|
-
|
|
7030
|
+
C = !0;
|
|
7031
7031
|
};
|
|
7032
7032
|
}
|
|
7033
7033
|
let x = !0, g = !1;
|
|
7034
7034
|
const p = `${a}::${Date.now().toString(36)}::${Math.random().toString(36).slice(2)}`;
|
|
7035
7035
|
d.current = p;
|
|
7036
|
-
const b = (
|
|
7037
|
-
const I =
|
|
7036
|
+
const b = (C) => {
|
|
7037
|
+
const I = C.data;
|
|
7038
7038
|
if (!I || I.id !== p || I.key && I.key !== a || !x) return;
|
|
7039
7039
|
g = !0;
|
|
7040
7040
|
const N = I.html ?? "";
|
|
@@ -7044,8 +7044,8 @@ function Ls({
|
|
|
7044
7044
|
const w = () => {
|
|
7045
7045
|
try {
|
|
7046
7046
|
an.postMessage({ id: p, key: a, source: i });
|
|
7047
|
-
} catch (
|
|
7048
|
-
console.error("[MarkdownContent] worker.postMessage threw",
|
|
7047
|
+
} catch (C) {
|
|
7048
|
+
console.error("[MarkdownContent] worker.postMessage threw", C);
|
|
7049
7049
|
}
|
|
7050
7050
|
}, y = () => {
|
|
7051
7051
|
if (!r || s <= 0) {
|
|
@@ -7056,7 +7056,7 @@ function Ls({
|
|
|
7056
7056
|
w();
|
|
7057
7057
|
return;
|
|
7058
7058
|
}
|
|
7059
|
-
const
|
|
7059
|
+
const C = window.setTimeout(() => {
|
|
7060
7060
|
if (typeof window.requestAnimationFrame == "function") {
|
|
7061
7061
|
const I = window.requestAnimationFrame(() => {
|
|
7062
7062
|
w();
|
|
@@ -7065,27 +7065,27 @@ function Ls({
|
|
|
7065
7065
|
} else
|
|
7066
7066
|
w();
|
|
7067
7067
|
}, s);
|
|
7068
|
-
h.current.push({ type: "timeout", id:
|
|
7068
|
+
h.current.push({ type: "timeout", id: C });
|
|
7069
7069
|
};
|
|
7070
7070
|
lo ? y() : vr.push(y);
|
|
7071
|
-
const
|
|
7071
|
+
const S = ((C, I, N) => I ? N ? C > 2e4 ? 15e3 : C > 8e3 ? 8e3 : C > 2e3 ? 3e3 : 1e3 : C > 2e4 ? 1e4 : C > 8e3 ? 5e3 : C > 2e3 ? 2e3 : 600 : Math.min(15e3, 2e3 + Math.floor(C * 0.5)))(i.length, lo, r), T = window.setTimeout(async () => {
|
|
7072
7072
|
if (!g) {
|
|
7073
|
-
console.warn("[MarkdownContent] worker timeout (ms=" +
|
|
7073
|
+
console.warn("[MarkdownContent] worker timeout (ms=" + S + "), falling back to main-thread parse for", a);
|
|
7074
7074
|
try {
|
|
7075
|
-
const
|
|
7076
|
-
dr.set(a, { html:
|
|
7077
|
-
} catch (
|
|
7078
|
-
console.error("[MarkdownContent] fallback parse failed",
|
|
7075
|
+
const C = await Ll(i);
|
|
7076
|
+
dr.set(a, { html: C, source: i }), x && d.current === p && u(C);
|
|
7077
|
+
} catch (C) {
|
|
7078
|
+
console.error("[MarkdownContent] fallback parse failed", C);
|
|
7079
7079
|
}
|
|
7080
7080
|
}
|
|
7081
|
-
},
|
|
7081
|
+
}, S);
|
|
7082
7082
|
return () => {
|
|
7083
7083
|
if (x = !1, clearTimeout(T), an.removeEventListener("message", b), d.current === p && (d.current = null), !lo) {
|
|
7084
|
-
const
|
|
7085
|
-
|
|
7084
|
+
const C = vr.indexOf(y);
|
|
7085
|
+
C >= 0 && vr.splice(C, 1);
|
|
7086
7086
|
}
|
|
7087
|
-
h.current.forEach((
|
|
7088
|
-
|
|
7087
|
+
h.current.forEach((C) => {
|
|
7088
|
+
C.type === "timeout" ? clearTimeout(C.id) : C.type === "raf" && cancelAnimationFrame(C.id);
|
|
7089
7089
|
}), h.current = [];
|
|
7090
7090
|
};
|
|
7091
7091
|
}, [i, c, r, a, s]);
|
|
@@ -7098,13 +7098,13 @@ function Ls({
|
|
|
7098
7098
|
if (!x.length) return;
|
|
7099
7099
|
let g = null, p = !1;
|
|
7100
7100
|
const b = (y, E) => {
|
|
7101
|
-
for (const
|
|
7102
|
-
if (!
|
|
7103
|
-
const T =
|
|
7101
|
+
for (const S of y) {
|
|
7102
|
+
if (!S.isIntersecting) continue;
|
|
7103
|
+
const T = S.target;
|
|
7104
7104
|
if (!g)
|
|
7105
|
-
import("./index-BixObhJB.js").then((
|
|
7105
|
+
import("./index-BixObhJB.js").then((C) => {
|
|
7106
7106
|
if (p) return;
|
|
7107
|
-
const I = tb(
|
|
7107
|
+
const I = tb(C.default ?? C);
|
|
7108
7108
|
if (I) {
|
|
7109
7109
|
g = I;
|
|
7110
7110
|
try {
|
|
@@ -7279,15 +7279,15 @@ var pb = "DismissableLayer", mi = "dismissableLayer.update", mb = "dismissableLa
|
|
|
7279
7279
|
onInteractOutside: i,
|
|
7280
7280
|
onDismiss: a,
|
|
7281
7281
|
...c
|
|
7282
|
-
} = e, u = f.useContext(Mu), [d, h] = f.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = f.useState({}), x = Ce(t, (
|
|
7283
|
-
const I =
|
|
7284
|
-
!E || N || (o == null || o(
|
|
7285
|
-
}, m), T = wb((
|
|
7286
|
-
const I =
|
|
7287
|
-
[...u.branches].some((
|
|
7282
|
+
} = e, u = f.useContext(Mu), [d, h] = f.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = f.useState({}), x = Ce(t, (C) => h(C)), g = Array.from(u.layers), [p] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), b = g.indexOf(p), w = d ? g.indexOf(d) : -1, y = u.layersWithOutsidePointerEventsDisabled.size > 0, E = w >= b, S = bb((C) => {
|
|
7283
|
+
const I = C.target, N = [...u.branches].some((k) => k.contains(I));
|
|
7284
|
+
!E || N || (o == null || o(C), i == null || i(C), C.defaultPrevented || a == null || a());
|
|
7285
|
+
}, m), T = wb((C) => {
|
|
7286
|
+
const I = C.target;
|
|
7287
|
+
[...u.branches].some((k) => k.contains(I)) || (s == null || s(C), i == null || i(C), C.defaultPrevented || a == null || a());
|
|
7288
7288
|
}, m);
|
|
7289
|
-
return hb((
|
|
7290
|
-
w === u.layers.size - 1 && (r == null || r(
|
|
7289
|
+
return hb((C) => {
|
|
7290
|
+
w === u.layers.size - 1 && (r == null || r(C), !C.defaultPrevented && a && (C.preventDefault(), a()));
|
|
7291
7291
|
}, m), f.useEffect(() => {
|
|
7292
7292
|
if (d)
|
|
7293
7293
|
return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (Hl = m.body.style.pointerEvents, m.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), zl(), () => {
|
|
@@ -7296,8 +7296,8 @@ var pb = "DismissableLayer", mi = "dismissableLayer.update", mb = "dismissableLa
|
|
|
7296
7296
|
}, [d, m, n, u]), f.useEffect(() => () => {
|
|
7297
7297
|
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), zl());
|
|
7298
7298
|
}, [d, u]), f.useEffect(() => {
|
|
7299
|
-
const
|
|
7300
|
-
return document.addEventListener(mi,
|
|
7299
|
+
const C = () => v({});
|
|
7300
|
+
return document.addEventListener(mi, C), () => document.removeEventListener(mi, C);
|
|
7301
7301
|
}, []), /* @__PURE__ */ l.jsx(
|
|
7302
7302
|
me.div,
|
|
7303
7303
|
{
|
|
@@ -7311,7 +7311,7 @@ var pb = "DismissableLayer", mi = "dismissableLayer.update", mb = "dismissableLa
|
|
|
7311
7311
|
onBlurCapture: Q(e.onBlurCapture, T.onBlurCapture),
|
|
7312
7312
|
onPointerDownCapture: Q(
|
|
7313
7313
|
e.onPointerDownCapture,
|
|
7314
|
-
|
|
7314
|
+
S.onPointerDownCapture
|
|
7315
7315
|
)
|
|
7316
7316
|
}
|
|
7317
7317
|
);
|
|
@@ -7409,8 +7409,8 @@ var $s = "focusScope.autoFocusOnMount", Hs = "focusScope.autoFocusOnUnmount", Ul
|
|
|
7409
7409
|
E !== null && (a.contains(E) || rn(h.current, { select: !0 }));
|
|
7410
7410
|
}, b = function(y) {
|
|
7411
7411
|
if (document.activeElement === document.body)
|
|
7412
|
-
for (const
|
|
7413
|
-
|
|
7412
|
+
for (const S of y)
|
|
7413
|
+
S.removedNodes.length > 0 && rn(a);
|
|
7414
7414
|
};
|
|
7415
7415
|
document.addEventListener("focusin", g), document.addEventListener("focusout", p);
|
|
7416
7416
|
const w = new MutationObserver(b);
|
|
@@ -7680,12 +7680,12 @@ var $u = Lb(), Ws = function() {
|
|
|
7680
7680
|
onScrollCapture: Ws,
|
|
7681
7681
|
onWheelCapture: Ws,
|
|
7682
7682
|
onTouchMoveCapture: Ws
|
|
7683
|
-
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, c = e.className, u = e.removeScrollBar, d = e.enabled, h = e.shards, m = e.sideCar, v = e.noRelative, x = e.noIsolation, g = e.inert, p = e.allowPinchZoom, b = e.as, w = b === void 0 ? "div" : b, y = e.gapMode, E = Fu(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]),
|
|
7683
|
+
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, c = e.className, u = e.removeScrollBar, d = e.enabled, h = e.shards, m = e.sideCar, v = e.noRelative, x = e.noIsolation, g = e.inert, p = e.allowPinchZoom, b = e.as, w = b === void 0 ? "div" : b, y = e.gapMode, E = Fu(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = m, T = Ob([n, t]), C = Vt(Vt({}, E), o);
|
|
7684
7684
|
return f.createElement(
|
|
7685
7685
|
f.Fragment,
|
|
7686
7686
|
null,
|
|
7687
|
-
d && f.createElement(
|
|
7688
|
-
i ? f.cloneElement(f.Children.only(a), Vt(Vt({},
|
|
7687
|
+
d && f.createElement(S, { sideCar: $u, removeScrollBar: u, shards: h, noRelative: v, noIsolation: x, inert: g, setCallbacks: s, allowPinchZoom: !!p, lockRef: n, gapMode: y }),
|
|
7688
|
+
i ? f.cloneElement(f.Children.only(a), Vt(Vt({}, C), { ref: T })) : f.createElement(w, Vt({}, C, { className: c, ref: T }), a)
|
|
7689
7689
|
);
|
|
7690
7690
|
});
|
|
7691
7691
|
es.defaultProps = {
|
|
@@ -7931,31 +7931,31 @@ function lw(e) {
|
|
|
7931
7931
|
var a = f.useCallback(function(g, p) {
|
|
7932
7932
|
if ("touches" in g && g.touches.length === 2 || g.type === "wheel" && g.ctrlKey)
|
|
7933
7933
|
return !i.current.allowPinchZoom;
|
|
7934
|
-
var b = Jr(g), w = n.current, y = "deltaX" in g ? g.deltaX : w[0] - b[0], E = "deltaY" in g ? g.deltaY : w[1] - b[1],
|
|
7935
|
-
if ("touches" in g &&
|
|
7934
|
+
var b = Jr(g), w = n.current, y = "deltaX" in g ? g.deltaX : w[0] - b[0], E = "deltaY" in g ? g.deltaY : w[1] - b[1], S, T = g.target, C = Math.abs(y) > Math.abs(E) ? "h" : "v";
|
|
7935
|
+
if ("touches" in g && C === "h" && T.type === "range")
|
|
7936
7936
|
return !1;
|
|
7937
|
-
var I = Xl(
|
|
7937
|
+
var I = Xl(C, T);
|
|
7938
7938
|
if (!I)
|
|
7939
7939
|
return !0;
|
|
7940
|
-
if (I ?
|
|
7940
|
+
if (I ? S = C : (S = C === "v" ? "h" : "v", I = Xl(C, T)), !I)
|
|
7941
7941
|
return !1;
|
|
7942
|
-
if (!r.current && "changedTouches" in g && (y || E) && (r.current =
|
|
7942
|
+
if (!r.current && "changedTouches" in g && (y || E) && (r.current = S), !S)
|
|
7943
7943
|
return !0;
|
|
7944
|
-
var N = r.current ||
|
|
7944
|
+
var N = r.current || S;
|
|
7945
7945
|
return ow(N, p, g, N === "h" ? y : E);
|
|
7946
7946
|
}, []), c = f.useCallback(function(g) {
|
|
7947
7947
|
var p = g;
|
|
7948
7948
|
if (!(!Bn.length || Bn[Bn.length - 1] !== s)) {
|
|
7949
|
-
var b = "deltaY" in p ? Jl(p) : Jr(p), w = t.current.filter(function(
|
|
7950
|
-
return
|
|
7949
|
+
var b = "deltaY" in p ? Jl(p) : Jr(p), w = t.current.filter(function(S) {
|
|
7950
|
+
return S.name === p.type && (S.target === p.target || p.target === S.shadowParent) && sw(S.delta, b);
|
|
7951
7951
|
})[0];
|
|
7952
7952
|
if (w && w.should) {
|
|
7953
7953
|
p.cancelable && p.preventDefault();
|
|
7954
7954
|
return;
|
|
7955
7955
|
}
|
|
7956
7956
|
if (!w) {
|
|
7957
|
-
var y = (i.current.shards || []).map(Zl).filter(Boolean).filter(function(
|
|
7958
|
-
return
|
|
7957
|
+
var y = (i.current.shards || []).map(Zl).filter(Boolean).filter(function(S) {
|
|
7958
|
+
return S.contains(p.target);
|
|
7959
7959
|
}), E = y.length > 0 ? a(p, y[0]) : !i.current.noIsolation;
|
|
7960
7960
|
E && p.cancelable && p.preventDefault();
|
|
7961
7961
|
}
|
|
@@ -8366,7 +8366,7 @@ const Ew = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
8366
8366
|
Ew.displayName = ss.displayName;
|
|
8367
8367
|
function Iw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
8368
8368
|
const [s, i] = de(!1), [a, c] = de(null), [u, d] = de(null), { toast: h } = na();
|
|
8369
|
-
|
|
8369
|
+
ze(() => {
|
|
8370
8370
|
e && n && m();
|
|
8371
8371
|
}, [e, n]);
|
|
8372
8372
|
const m = async () => {
|
|
@@ -8475,7 +8475,7 @@ function Iw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
8475
8475
|
const po = "prose prose-sm max-w-none break-words dark:prose-invert prose-headings:break-words prose-p:break-words prose-li:break-words prose-td:break-words prose-th:break-words prose-a:break-all prose-code:break-words prose-blockquote:break-words";
|
|
8476
8476
|
function Nw({ className: e }) {
|
|
8477
8477
|
const [t, n] = de(0);
|
|
8478
|
-
return
|
|
8478
|
+
return ze(() => {
|
|
8479
8479
|
const r = setInterval(() => n((o) => (o + 1) % 4), 500);
|
|
8480
8480
|
return () => clearInterval(r);
|
|
8481
8481
|
}, []), /* @__PURE__ */ l.jsxs(
|
|
@@ -8510,9 +8510,9 @@ const jw = K.memo(function({
|
|
|
8510
8510
|
onCancelEdit: b,
|
|
8511
8511
|
onCopy: w
|
|
8512
8512
|
}) {
|
|
8513
|
-
const [y, E] = de(!1), [
|
|
8513
|
+
const [y, E] = de(!1), [S, T] = de(!1), [C, I] = de(!1), [N, k] = de(!1), { currentThreadId: M } = Fi();
|
|
8514
8514
|
na();
|
|
8515
|
-
const [W, G] = de({}), [
|
|
8515
|
+
const [W, G] = de({}), [j, $] = de(!1), [L, q] = de(null), O = u === "phone" || u === "half-screen", _ = t.role, z = _ === "tool", X = K.useMemo(() => {
|
|
8516
8516
|
switch (_) {
|
|
8517
8517
|
case "user":
|
|
8518
8518
|
return "text-[hsl(var(--chat-bubble-user-text))]";
|
|
@@ -8609,7 +8609,7 @@ const jw = K.memo(function({
|
|
|
8609
8609
|
const xe = t.content.find((Fe) => Fe.type === "tool_result"), H = (xe == null ? void 0 : xe.output) ?? Hn(t.content), ie = gd(H);
|
|
8610
8610
|
if (ie) return /* @__PURE__ */ l.jsx(Bw, { issues: ie });
|
|
8611
8611
|
}
|
|
8612
|
-
if (z && !
|
|
8612
|
+
if (z && !C) {
|
|
8613
8613
|
const xe = Hn(t.content).slice(0, 80).replace(/\s+/g, " ");
|
|
8614
8614
|
return /* @__PURE__ */ l.jsx("div", { className: D("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", O && "text-[10px]"), children: /* @__PURE__ */ l.jsxs("span", { className: "truncate max-w-full text-current", children: [
|
|
8615
8615
|
xe,
|
|
@@ -8618,9 +8618,9 @@ const jw = K.memo(function({
|
|
|
8618
8618
|
}
|
|
8619
8619
|
if (z && d) {
|
|
8620
8620
|
const xe = Hn(t.content), H = xe.length > h;
|
|
8621
|
-
return /* @__PURE__ */ l.jsx(Ml, { open:
|
|
8622
|
-
/* @__PURE__ */ l.jsx("pre", { className: D("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: H && !
|
|
8623
|
-
H && /* @__PURE__ */ l.jsx(Dl, { asChild: !0, children: /* @__PURE__ */ l.jsx(Ne, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children:
|
|
8621
|
+
return /* @__PURE__ */ l.jsx(Ml, { open: S, onOpenChange: T, children: /* @__PURE__ */ l.jsxs("div", { className: "font-mono text-sm text-current", children: [
|
|
8622
|
+
/* @__PURE__ */ l.jsx("pre", { className: D("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: H && !S ? xe.substring(0, h) + "..." : xe }),
|
|
8623
|
+
H && /* @__PURE__ */ l.jsx(Dl, { asChild: !0, children: /* @__PURE__ */ l.jsx(Ne, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children: S ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
8624
8624
|
/* @__PURE__ */ l.jsx(fr, { className: "h-3 w-3 mr-1" }),
|
|
8625
8625
|
"Show less"
|
|
8626
8626
|
] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
@@ -8631,7 +8631,7 @@ const jw = K.memo(function({
|
|
|
8631
8631
|
] }) }) })
|
|
8632
8632
|
] }) });
|
|
8633
8633
|
}
|
|
8634
|
-
if (z &&
|
|
8634
|
+
if (z && C && !d) {
|
|
8635
8635
|
const xe = $w(t.content);
|
|
8636
8636
|
if (xe && kw(xe))
|
|
8637
8637
|
return /* @__PURE__ */ l.jsx(Ls, { content: xe.trim(), hideFallbackDuringStreaming: !0 });
|
|
@@ -8664,7 +8664,7 @@ const jw = K.memo(function({
|
|
|
8664
8664
|
if (_ === "user" && m) {
|
|
8665
8665
|
const H = oe.trim();
|
|
8666
8666
|
if (H.length > v)
|
|
8667
|
-
return /* @__PURE__ */ l.jsxs(Ml, { open: N, onOpenChange:
|
|
8667
|
+
return /* @__PURE__ */ l.jsxs(Ml, { open: N, onOpenChange: k, children: [
|
|
8668
8668
|
/* @__PURE__ */ l.jsx("div", { className: D("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: N ? /* @__PURE__ */ l.jsx(Ls, { content: H, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ l.jsxs("pre", { className: D("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
|
|
8669
8669
|
H.substring(0, v),
|
|
8670
8670
|
"..."
|
|
@@ -8736,7 +8736,7 @@ const jw = K.memo(function({
|
|
|
8736
8736
|
onClick: () => I((ue) => !ue),
|
|
8737
8737
|
children: [
|
|
8738
8738
|
/* @__PURE__ */ l.jsx("span", { children: F.name }),
|
|
8739
|
-
/* @__PURE__ */ l.jsx("span", { className: "inline-flex items-center", children:
|
|
8739
|
+
/* @__PURE__ */ l.jsx("span", { className: "inline-flex items-center", children: C ? /* @__PURE__ */ l.jsx(fr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(zn, { className: "h-3 w-3" }) })
|
|
8740
8740
|
]
|
|
8741
8741
|
}
|
|
8742
8742
|
),
|
|
@@ -8749,7 +8749,7 @@ const jw = K.memo(function({
|
|
|
8749
8749
|
onClick: () => I((ue) => !ue),
|
|
8750
8750
|
children: /* @__PURE__ */ l.jsxs("span", { className: "text-xs flex items-center gap-1", children: [
|
|
8751
8751
|
"Tool Output ",
|
|
8752
|
-
|
|
8752
|
+
C ? /* @__PURE__ */ l.jsx(fr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(zn, { className: "h-3 w-3" })
|
|
8753
8753
|
] })
|
|
8754
8754
|
}
|
|
8755
8755
|
)
|
|
@@ -8811,7 +8811,7 @@ const jw = K.memo(function({
|
|
|
8811
8811
|
}
|
|
8812
8812
|
),
|
|
8813
8813
|
/* @__PURE__ */ l.jsx("div", { className: "relative", children: Le() }),
|
|
8814
|
-
z &&
|
|
8814
|
+
z && C && (F.toolCallId || F.name) && /* @__PURE__ */ l.jsxs("div", { className: D("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", O && "text-xs"), children: [
|
|
8815
8815
|
F.name && /* @__PURE__ */ l.jsxs("div", { children: [
|
|
8816
8816
|
"Function: ",
|
|
8817
8817
|
F.name
|
|
@@ -8867,7 +8867,7 @@ const jw = K.memo(function({
|
|
|
8867
8867
|
L && /* @__PURE__ */ l.jsx(
|
|
8868
8868
|
Iw,
|
|
8869
8869
|
{
|
|
8870
|
-
isOpen:
|
|
8870
|
+
isOpen: j,
|
|
8871
8871
|
onClose: () => {
|
|
8872
8872
|
$(!1), q(null);
|
|
8873
8873
|
},
|
|
@@ -9004,8 +9004,8 @@ function Dw(e) {
|
|
|
9004
9004
|
return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
|
|
9005
9005
|
}
|
|
9006
9006
|
function Lw(e, t) {
|
|
9007
|
-
const [n, r] = de(e), o =
|
|
9008
|
-
return
|
|
9007
|
+
const [n, r] = de(e), o = We(e), s = We(null);
|
|
9008
|
+
return ze(() => {
|
|
9009
9009
|
if (!t) {
|
|
9010
9010
|
r(e);
|
|
9011
9011
|
return;
|
|
@@ -9124,47 +9124,31 @@ function Hw({
|
|
|
9124
9124
|
style: m,
|
|
9125
9125
|
emptyMessage: v
|
|
9126
9126
|
}) {
|
|
9127
|
-
const x =
|
|
9128
|
-
|
|
9127
|
+
const x = We(null), g = We(null), p = We(!1), b = We(!0), w = We(e.length);
|
|
9128
|
+
ze(() => {
|
|
9129
9129
|
const S = x.current;
|
|
9130
9130
|
if (!S) return;
|
|
9131
|
-
let
|
|
9132
|
-
const
|
|
9133
|
-
|
|
9134
|
-
const
|
|
9135
|
-
b.current =
|
|
9136
|
-
}),
|
|
9131
|
+
let T = !1;
|
|
9132
|
+
const C = () => {
|
|
9133
|
+
T || (window.requestAnimationFrame(() => {
|
|
9134
|
+
const I = S.scrollHeight - S.scrollTop - S.clientHeight;
|
|
9135
|
+
b.current = I <= 32, T = !1;
|
|
9136
|
+
}), T = !0);
|
|
9137
9137
|
};
|
|
9138
|
-
return S.addEventListener("scroll",
|
|
9139
|
-
S.removeEventListener("scroll",
|
|
9138
|
+
return S.addEventListener("scroll", C, { passive: !0 }), C(), () => {
|
|
9139
|
+
S.removeEventListener("scroll", C);
|
|
9140
9140
|
};
|
|
9141
|
-
}, []),
|
|
9141
|
+
}, []), ze(() => {
|
|
9142
9142
|
e.length < w.current && (b.current = !0), w.current = e.length;
|
|
9143
|
-
}, [e.length]),
|
|
9143
|
+
}, [e.length]), ze(() => {
|
|
9144
9144
|
var S;
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
behavior: "auto",
|
|
9153
|
-
align: "end"
|
|
9154
|
-
}), E.current = Date.now(), y.current = null;
|
|
9155
|
-
});
|
|
9156
|
-
} else
|
|
9157
|
-
(S = g.current) == null || S.scrollToIndex({
|
|
9158
|
-
index: Math.max(0, e.length - 1),
|
|
9159
|
-
behavior: "auto",
|
|
9160
|
-
align: "end"
|
|
9161
|
-
});
|
|
9162
|
-
return () => {
|
|
9163
|
-
y.current && cancelAnimationFrame(y.current);
|
|
9164
|
-
};
|
|
9165
|
-
}
|
|
9166
|
-
}, [e, t]);
|
|
9167
|
-
const C = sn(() => {
|
|
9145
|
+
t || p.current || b.current && ((S = g.current) == null || S.scrollToIndex({
|
|
9146
|
+
index: Math.max(0, e.length - 1),
|
|
9147
|
+
behavior: "auto",
|
|
9148
|
+
align: "end"
|
|
9149
|
+
}));
|
|
9150
|
+
}, [e.length, t]);
|
|
9151
|
+
const y = sn(() => {
|
|
9168
9152
|
if (a)
|
|
9169
9153
|
return async () => {
|
|
9170
9154
|
if (p.current) return;
|
|
@@ -9173,26 +9157,26 @@ function Hw({
|
|
|
9173
9157
|
await (a == null ? void 0 : a());
|
|
9174
9158
|
return;
|
|
9175
9159
|
}
|
|
9176
|
-
const
|
|
9160
|
+
const T = S.scrollHeight, C = S.scrollTop;
|
|
9177
9161
|
p.current = !0;
|
|
9178
9162
|
try {
|
|
9179
9163
|
await a();
|
|
9180
9164
|
} finally {
|
|
9181
9165
|
requestAnimationFrame(() => {
|
|
9182
|
-
const
|
|
9183
|
-
if (!
|
|
9166
|
+
const I = x.current;
|
|
9167
|
+
if (!I) {
|
|
9184
9168
|
p.current = !1;
|
|
9185
9169
|
return;
|
|
9186
9170
|
}
|
|
9187
|
-
const
|
|
9188
|
-
|
|
9189
|
-
const
|
|
9190
|
-
b.current =
|
|
9171
|
+
const N = I.scrollHeight;
|
|
9172
|
+
I.scrollTop = C + (N - T);
|
|
9173
|
+
const k = N - I.scrollTop - I.clientHeight;
|
|
9174
|
+
b.current = k <= 32, p.current = !1;
|
|
9191
9175
|
});
|
|
9192
9176
|
}
|
|
9193
9177
|
};
|
|
9194
|
-
}, [a]),
|
|
9195
|
-
x.current = S,
|
|
9178
|
+
}, [a]), E = (S, T) => {
|
|
9179
|
+
x.current = S, T && (typeof T == "function" ? T(S) : T.current = S);
|
|
9196
9180
|
};
|
|
9197
9181
|
return e.length === 0 ? /* @__PURE__ */ l.jsx("div", { className: h, style: m, children: /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center py-8 text-muted-foreground text-center max-w-md mx-auto", children: v || "No messages yet. Start a conversation!" }) }) : /* @__PURE__ */ l.jsx("div", { className: h, style: m, children: /* @__PURE__ */ l.jsx(
|
|
9198
9182
|
bv,
|
|
@@ -9206,19 +9190,19 @@ function Hw({
|
|
|
9206
9190
|
increaseViewportBy: { top: 600, bottom: 600 },
|
|
9207
9191
|
defaultItemHeight: 100,
|
|
9208
9192
|
startReached: () => {
|
|
9209
|
-
|
|
9193
|
+
y && y();
|
|
9210
9194
|
},
|
|
9211
9195
|
atBottomStateChange: (S) => {
|
|
9212
9196
|
b.current = S;
|
|
9213
9197
|
},
|
|
9214
9198
|
style: { height: "100%", overscrollBehavior: "contain" },
|
|
9215
|
-
computeItemKey: (S,
|
|
9199
|
+
computeItemKey: (S, T) => T.id ?? `message-${S}`,
|
|
9216
9200
|
components: {
|
|
9217
|
-
Scroller: K.forwardRef((S,
|
|
9201
|
+
Scroller: K.forwardRef((S, T) => /* @__PURE__ */ l.jsx(
|
|
9218
9202
|
"div",
|
|
9219
9203
|
{
|
|
9220
9204
|
...S,
|
|
9221
|
-
ref: (
|
|
9205
|
+
ref: (C) => E(C, T),
|
|
9222
9206
|
style: {
|
|
9223
9207
|
overflowAnchor: "none",
|
|
9224
9208
|
willChange: t ? "scroll-position" : "transform",
|
|
@@ -9228,7 +9212,7 @@ function Hw({
|
|
|
9228
9212
|
}
|
|
9229
9213
|
))
|
|
9230
9214
|
},
|
|
9231
|
-
itemContent: (S,
|
|
9215
|
+
itemContent: (S, T) => /* @__PURE__ */ l.jsx(
|
|
9232
9216
|
"div",
|
|
9233
9217
|
{
|
|
9234
9218
|
className: "mb-4 last:mb-0",
|
|
@@ -9241,11 +9225,11 @@ function Hw({
|
|
|
9241
9225
|
children: /* @__PURE__ */ l.jsx(
|
|
9242
9226
|
jw,
|
|
9243
9227
|
{
|
|
9244
|
-
message:
|
|
9228
|
+
message: T,
|
|
9245
9229
|
messageIndex: S,
|
|
9246
|
-
isStreamingMessage: t && n ===
|
|
9230
|
+
isStreamingMessage: t && n === T.id,
|
|
9247
9231
|
streamingDebounceMs: r,
|
|
9248
|
-
isEditing: i ===
|
|
9232
|
+
isEditing: i === T.id,
|
|
9249
9233
|
showActions: s,
|
|
9250
9234
|
showTimestamp: !1,
|
|
9251
9235
|
showAgentName: !0,
|
|
@@ -9256,7 +9240,7 @@ function Hw({
|
|
|
9256
9240
|
onRegenerate: () => u(S),
|
|
9257
9241
|
onCancelEdit: d
|
|
9258
9242
|
},
|
|
9259
|
-
|
|
9243
|
+
T.id ?? `msg-${T.role}-${S}-${T.createdAt ?? ""}`
|
|
9260
9244
|
)
|
|
9261
9245
|
}
|
|
9262
9246
|
)
|
|
@@ -9320,8 +9304,8 @@ function la(e) {
|
|
|
9320
9304
|
u.displayName = a;
|
|
9321
9305
|
const d = e + "CollectionItemSlot", h = "data-radix-collection-item", m = Yn(d), v = K.forwardRef(
|
|
9322
9306
|
(g, p) => {
|
|
9323
|
-
const { scope: b, children: w, ...y } = g, E = K.useRef(null),
|
|
9324
|
-
return K.useEffect(() => (T.itemMap.set(E, { ref: E, ...y }), () => void T.itemMap.delete(E))), /* @__PURE__ */ l.jsx(m, { [h]: "", ref:
|
|
9307
|
+
const { scope: b, children: w, ...y } = g, E = K.useRef(null), S = Ce(p, E), T = s(d, b);
|
|
9308
|
+
return K.useEffect(() => (T.itemMap.set(E, { ref: E, ...y }), () => void T.itemMap.delete(E))), /* @__PURE__ */ l.jsx(m, { [h]: "", ref: S, children: w });
|
|
9325
9309
|
}
|
|
9326
9310
|
);
|
|
9327
9311
|
v.displayName = d;
|
|
@@ -9332,7 +9316,7 @@ function la(e) {
|
|
|
9332
9316
|
if (!w) return [];
|
|
9333
9317
|
const y = Array.from(w.querySelectorAll(`[${h}]`));
|
|
9334
9318
|
return Array.from(p.itemMap.values()).sort(
|
|
9335
|
-
(T,
|
|
9319
|
+
(T, C) => y.indexOf(T.ref.current) - y.indexOf(C.ref.current)
|
|
9336
9320
|
);
|
|
9337
9321
|
}, [p.collectionRef, p.itemMap]);
|
|
9338
9322
|
}
|
|
@@ -9524,7 +9508,7 @@ const ry = async (e, t, n) => {
|
|
|
9524
9508
|
x: w,
|
|
9525
9509
|
y,
|
|
9526
9510
|
data: E,
|
|
9527
|
-
reset:
|
|
9511
|
+
reset: S
|
|
9528
9512
|
} = await b({
|
|
9529
9513
|
x: d,
|
|
9530
9514
|
y: h,
|
|
@@ -9545,11 +9529,11 @@ const ry = async (e, t, n) => {
|
|
|
9545
9529
|
...v[p],
|
|
9546
9530
|
...E
|
|
9547
9531
|
}
|
|
9548
|
-
},
|
|
9532
|
+
}, S && x <= 50 && (x++, typeof S == "object" && (S.placement && (m = S.placement), S.rects && (u = S.rects === !0 ? await i.getElementRects({
|
|
9549
9533
|
reference: e,
|
|
9550
9534
|
floating: t,
|
|
9551
9535
|
strategy: o
|
|
9552
|
-
}) :
|
|
9536
|
+
}) : S.rects), {
|
|
9553
9537
|
x: d,
|
|
9554
9538
|
y: h
|
|
9555
9539
|
} = nc(u, m, c)), g = -1);
|
|
@@ -9594,17 +9578,17 @@ async function Er(e, t) {
|
|
|
9594
9578
|
} : {
|
|
9595
9579
|
x: 1,
|
|
9596
9580
|
y: 1
|
|
9597
|
-
},
|
|
9581
|
+
}, S = Po(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
9598
9582
|
elements: a,
|
|
9599
9583
|
rect: w,
|
|
9600
9584
|
offsetParent: y,
|
|
9601
9585
|
strategy: c
|
|
9602
9586
|
}) : w);
|
|
9603
9587
|
return {
|
|
9604
|
-
top: (b.top -
|
|
9605
|
-
bottom: (
|
|
9606
|
-
left: (b.left -
|
|
9607
|
-
right: (
|
|
9588
|
+
top: (b.top - S.top + x.top) / E.y,
|
|
9589
|
+
bottom: (S.bottom - b.bottom + x.bottom) / E.y,
|
|
9590
|
+
left: (b.left - S.left + x.left) / E.x,
|
|
9591
|
+
right: (S.right - b.right + x.right) / E.x
|
|
9608
9592
|
};
|
|
9609
9593
|
}
|
|
9610
9594
|
const oy = (e) => ({
|
|
@@ -9628,15 +9612,15 @@ const oy = (e) => ({
|
|
|
9628
9612
|
const h = xd(d), m = {
|
|
9629
9613
|
x: n,
|
|
9630
9614
|
y: r
|
|
9631
|
-
}, v = da(o), x = ua(v), g = await i.getDimensions(u), p = v === "y", b = p ? "top" : "left", w = p ? "bottom" : "right", y = p ? "clientHeight" : "clientWidth", E = s.reference[x] + s.reference[v] - m[v] - s.floating[x],
|
|
9632
|
-
let
|
|
9633
|
-
(!
|
|
9634
|
-
const I = E / 2 -
|
|
9615
|
+
}, v = da(o), x = ua(v), g = await i.getDimensions(u), p = v === "y", b = p ? "top" : "left", w = p ? "bottom" : "right", y = p ? "clientHeight" : "clientWidth", E = s.reference[x] + s.reference[v] - m[v] - s.floating[x], S = m[v] - s.reference[v], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
|
|
9616
|
+
let C = T ? T[y] : 0;
|
|
9617
|
+
(!C || !await (i.isElement == null ? void 0 : i.isElement(T))) && (C = a.floating[y] || s.floating[x]);
|
|
9618
|
+
const I = E / 2 - S / 2, N = C / 2 - g[x] / 2 - 1, k = un(h[b], N), M = un(h[w], N), W = k, G = C - g[x] - M, j = C / 2 - g[x] / 2 + I, $ = xi(W, j, G), L = !c.arrow && or(o) != null && j !== $ && s.reference[x] / 2 - (j < W ? k : M) - g[x] / 2 < 0, q = L ? j < W ? j - W : j - G : 0;
|
|
9635
9619
|
return {
|
|
9636
9620
|
[v]: m[v] + q,
|
|
9637
9621
|
data: {
|
|
9638
9622
|
[v]: $,
|
|
9639
|
-
centerOffset:
|
|
9623
|
+
centerOffset: j - $ - q,
|
|
9640
9624
|
...L && {
|
|
9641
9625
|
alignmentOffset: q
|
|
9642
9626
|
}
|
|
@@ -9668,38 +9652,38 @@ const oy = (e) => ({
|
|
|
9668
9652
|
} = tn(e, t);
|
|
9669
9653
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
9670
9654
|
return {};
|
|
9671
|
-
const b = nn(o), w = Kt(a), y = nn(a) === a, E = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)),
|
|
9672
|
-
!m && T &&
|
|
9673
|
-
const
|
|
9674
|
-
let
|
|
9655
|
+
const b = nn(o), w = Kt(a), y = nn(a) === a, E = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), S = m || (y || !g ? [ko(a)] : Jw(a)), T = x !== "none";
|
|
9656
|
+
!m && T && S.push(...ty(a, g, x, E));
|
|
9657
|
+
const C = [a, ...S], I = await Er(t, p), N = [];
|
|
9658
|
+
let k = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
9675
9659
|
if (d && N.push(I[b]), h) {
|
|
9676
|
-
const
|
|
9677
|
-
N.push(I[
|
|
9660
|
+
const j = Xw(o, i, E);
|
|
9661
|
+
N.push(I[j[0]], I[j[1]]);
|
|
9678
9662
|
}
|
|
9679
|
-
if (
|
|
9663
|
+
if (k = [...k, {
|
|
9680
9664
|
placement: o,
|
|
9681
9665
|
overflows: N
|
|
9682
|
-
}], !N.every((
|
|
9666
|
+
}], !N.every((j) => j <= 0)) {
|
|
9683
9667
|
var M, W;
|
|
9684
|
-
const
|
|
9668
|
+
const j = (((M = s.flip) == null ? void 0 : M.index) || 0) + 1, $ = C[j];
|
|
9685
9669
|
if ($ && (!(h === "alignment" ? w !== Kt($) : !1) || // We leave the current main axis only if every placement on that axis
|
|
9686
9670
|
// overflows the main axis.
|
|
9687
|
-
|
|
9671
|
+
k.every((O) => Kt(O.placement) === w ? O.overflows[0] > 0 : !0)))
|
|
9688
9672
|
return {
|
|
9689
9673
|
data: {
|
|
9690
|
-
index:
|
|
9691
|
-
overflows:
|
|
9674
|
+
index: j,
|
|
9675
|
+
overflows: k
|
|
9692
9676
|
},
|
|
9693
9677
|
reset: {
|
|
9694
9678
|
placement: $
|
|
9695
9679
|
}
|
|
9696
9680
|
};
|
|
9697
|
-
let L = (W =
|
|
9681
|
+
let L = (W = k.filter((q) => q.overflows[0] <= 0).sort((q, O) => q.overflows[1] - O.overflows[1])[0]) == null ? void 0 : W.placement;
|
|
9698
9682
|
if (!L)
|
|
9699
9683
|
switch (v) {
|
|
9700
9684
|
case "bestFit": {
|
|
9701
9685
|
var G;
|
|
9702
|
-
const q = (G =
|
|
9686
|
+
const q = (G = k.filter((O) => {
|
|
9703
9687
|
if (T) {
|
|
9704
9688
|
const _ = Kt(O.placement);
|
|
9705
9689
|
return _ === w || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -9912,13 +9896,13 @@ const ly = function(e) {
|
|
|
9912
9896
|
...g
|
|
9913
9897
|
};
|
|
9914
9898
|
if (c) {
|
|
9915
|
-
const y = m === "y" ? "height" : "width", E = s.reference[m] - s.floating[y] + p.mainAxis,
|
|
9916
|
-
v < E ? v = E : v >
|
|
9899
|
+
const y = m === "y" ? "height" : "width", E = s.reference[m] - s.floating[y] + p.mainAxis, S = s.reference[m] + s.reference[y] - p.mainAxis;
|
|
9900
|
+
v < E ? v = E : v > S && (v = S);
|
|
9917
9901
|
}
|
|
9918
9902
|
if (u) {
|
|
9919
9903
|
var b, w;
|
|
9920
|
-
const y = m === "y" ? "width" : "height", E = vd.has(nn(o)),
|
|
9921
|
-
x <
|
|
9904
|
+
const y = m === "y" ? "width" : "height", E = vd.has(nn(o)), S = s.reference[h] - s.floating[y] + (E && ((b = i.offset) == null ? void 0 : b[h]) || 0) + (E ? 0 : p.crossAxis), T = s.reference[h] + s.reference[y] + (E ? 0 : ((w = i.offset) == null ? void 0 : w[h]) || 0) - (E ? p.crossAxis : 0);
|
|
9905
|
+
x < S ? x = S : x > T && (x = T);
|
|
9922
9906
|
}
|
|
9923
9907
|
return {
|
|
9924
9908
|
[m]: v,
|
|
@@ -9947,16 +9931,16 @@ const ly = function(e) {
|
|
|
9947
9931
|
} = s.floating;
|
|
9948
9932
|
let p, b;
|
|
9949
9933
|
h === "top" || h === "bottom" ? (p = h, b = m === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (b = h, p = m === "end" ? "top" : "bottom");
|
|
9950
|
-
const w = g - d.top - d.bottom, y = x - d.left - d.right, E = un(g - d[p], w),
|
|
9951
|
-
let
|
|
9952
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = y), (r = t.middlewareData.shift) != null && r.enabled.y && (
|
|
9953
|
-
const
|
|
9954
|
-
v ? I = x - 2 * (
|
|
9934
|
+
const w = g - d.top - d.bottom, y = x - d.left - d.right, E = un(g - d[p], w), S = un(x - d[b], y), T = !t.middlewareData.shift;
|
|
9935
|
+
let C = E, I = S;
|
|
9936
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = y), (r = t.middlewareData.shift) != null && r.enabled.y && (C = w), T && !m) {
|
|
9937
|
+
const k = vt(d.left, 0), M = vt(d.right, 0), W = vt(d.top, 0), G = vt(d.bottom, 0);
|
|
9938
|
+
v ? I = x - 2 * (k !== 0 || M !== 0 ? k + M : vt(d.left, d.right)) : C = g - 2 * (W !== 0 || G !== 0 ? W + G : vt(d.top, d.bottom));
|
|
9955
9939
|
}
|
|
9956
9940
|
await c({
|
|
9957
9941
|
...t,
|
|
9958
9942
|
availableWidth: I,
|
|
9959
|
-
availableHeight:
|
|
9943
|
+
availableHeight: C
|
|
9960
9944
|
});
|
|
9961
9945
|
const N = await i.getDimensions(a.floating);
|
|
9962
9946
|
return x !== N.width || g !== N.height ? {
|
|
@@ -10394,25 +10378,25 @@ function Dy(e, t) {
|
|
|
10394
10378
|
threshold: vt(0, un(1, c)) || 1
|
|
10395
10379
|
};
|
|
10396
10380
|
let E = !0;
|
|
10397
|
-
function
|
|
10398
|
-
const
|
|
10399
|
-
if (
|
|
10381
|
+
function S(T) {
|
|
10382
|
+
const C = T[0].intersectionRatio;
|
|
10383
|
+
if (C !== c) {
|
|
10400
10384
|
if (!E)
|
|
10401
10385
|
return i();
|
|
10402
|
-
|
|
10386
|
+
C ? i(!1, C) : r = setTimeout(() => {
|
|
10403
10387
|
i(!1, 1e-7);
|
|
10404
10388
|
}, 1e3);
|
|
10405
10389
|
}
|
|
10406
|
-
|
|
10390
|
+
C === 1 && !Ed(u, e.getBoundingClientRect()) && i(), E = !1;
|
|
10407
10391
|
}
|
|
10408
10392
|
try {
|
|
10409
|
-
n = new IntersectionObserver(
|
|
10393
|
+
n = new IntersectionObserver(S, {
|
|
10410
10394
|
...y,
|
|
10411
10395
|
// Handle <iframe>s
|
|
10412
10396
|
root: o.ownerDocument
|
|
10413
10397
|
});
|
|
10414
10398
|
} catch {
|
|
10415
|
-
n = new IntersectionObserver(
|
|
10399
|
+
n = new IntersectionObserver(S, y);
|
|
10416
10400
|
}
|
|
10417
10401
|
n.observe(e);
|
|
10418
10402
|
}
|
|
@@ -10538,16 +10522,16 @@ function Ky(e) {
|
|
|
10538
10522
|
const [x, g] = f.useState(null), [p, b] = f.useState(null), w = f.useCallback((O) => {
|
|
10539
10523
|
O !== T.current && (T.current = O, g(O));
|
|
10540
10524
|
}, []), y = f.useCallback((O) => {
|
|
10541
|
-
O !==
|
|
10542
|
-
}, []), E = s || x,
|
|
10543
|
-
if (!T.current || !
|
|
10525
|
+
O !== C.current && (C.current = O, b(O));
|
|
10526
|
+
}, []), E = s || x, S = i || p, T = f.useRef(null), C = f.useRef(null), I = f.useRef(d), N = c != null, k = qs(c), M = qs(o), W = qs(u), G = f.useCallback(() => {
|
|
10527
|
+
if (!T.current || !C.current)
|
|
10544
10528
|
return;
|
|
10545
10529
|
const O = {
|
|
10546
10530
|
placement: t,
|
|
10547
10531
|
strategy: n,
|
|
10548
10532
|
middleware: m
|
|
10549
10533
|
};
|
|
10550
|
-
M.current && (O.platform = M.current), Wy(T.current,
|
|
10534
|
+
M.current && (O.platform = M.current), Wy(T.current, C.current, O).then((_) => {
|
|
10551
10535
|
const z = {
|
|
10552
10536
|
..._,
|
|
10553
10537
|
// The floating element's position may be recomputed while it's closed
|
|
@@ -10556,7 +10540,7 @@ function Ky(e) {
|
|
|
10556
10540
|
// setting it to `true` when `open === false` (must be specified).
|
|
10557
10541
|
isPositioned: W.current !== !1
|
|
10558
10542
|
};
|
|
10559
|
-
|
|
10543
|
+
j.current && !_o(I.current, z) && (I.current = z, Bo.flushSync(() => {
|
|
10560
10544
|
h(z);
|
|
10561
10545
|
}));
|
|
10562
10546
|
});
|
|
@@ -10567,25 +10551,25 @@ function Ky(e) {
|
|
|
10567
10551
|
isPositioned: !1
|
|
10568
10552
|
})));
|
|
10569
10553
|
}, [u]);
|
|
10570
|
-
const
|
|
10571
|
-
go(() => (
|
|
10572
|
-
|
|
10554
|
+
const j = f.useRef(!1);
|
|
10555
|
+
go(() => (j.current = !0, () => {
|
|
10556
|
+
j.current = !1;
|
|
10573
10557
|
}), []), go(() => {
|
|
10574
|
-
if (E && (T.current = E),
|
|
10575
|
-
if (
|
|
10576
|
-
return
|
|
10558
|
+
if (E && (T.current = E), S && (C.current = S), E && S) {
|
|
10559
|
+
if (k.current)
|
|
10560
|
+
return k.current(E, S, G);
|
|
10577
10561
|
G();
|
|
10578
10562
|
}
|
|
10579
|
-
}, [E,
|
|
10563
|
+
}, [E, S, G, k, N]);
|
|
10580
10564
|
const $ = f.useMemo(() => ({
|
|
10581
10565
|
reference: T,
|
|
10582
|
-
floating:
|
|
10566
|
+
floating: C,
|
|
10583
10567
|
setReference: w,
|
|
10584
10568
|
setFloating: y
|
|
10585
10569
|
}), [w, y]), L = f.useMemo(() => ({
|
|
10586
10570
|
reference: E,
|
|
10587
|
-
floating:
|
|
10588
|
-
}), [E,
|
|
10571
|
+
floating: S
|
|
10572
|
+
}), [E, S]), q = f.useMemo(() => {
|
|
10589
10573
|
const O = {
|
|
10590
10574
|
position: n,
|
|
10591
10575
|
left: 0,
|
|
@@ -10729,12 +10713,12 @@ var ga = "PopperContent", [sS, iS] = Ad(ga), Md = f.forwardRef(
|
|
|
10729
10713
|
updatePositionStrategy: v = "optimized",
|
|
10730
10714
|
onPlaced: x,
|
|
10731
10715
|
...g
|
|
10732
|
-
} = e, p = kd(ga, n), [b, w] = f.useState(null), y = Ce(t, (je) => w(je)), [E,
|
|
10733
|
-
padding:
|
|
10716
|
+
} = e, p = kd(ga, n), [b, w] = f.useState(null), y = Ce(t, (je) => w(je)), [E, S] = f.useState(null), T = jd(E), C = (T == null ? void 0 : T.width) ?? 0, I = (T == null ? void 0 : T.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""), k = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, M = Array.isArray(u) ? u : [u], W = M.length > 0, G = {
|
|
10717
|
+
padding: k,
|
|
10734
10718
|
boundary: M.filter(lS),
|
|
10735
10719
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
10736
10720
|
altBoundary: W
|
|
10737
|
-
}, { refs:
|
|
10721
|
+
}, { refs: j, floatingStyles: $, placement: L, isPositioned: q, middlewareData: O } = Ky({
|
|
10738
10722
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
10739
10723
|
strategy: "fixed",
|
|
10740
10724
|
placement: N,
|
|
@@ -10761,7 +10745,7 @@ var ga = "PopperContent", [sS, iS] = Ad(ga), Md = f.forwardRef(
|
|
|
10761
10745
|
}
|
|
10762
10746
|
}),
|
|
10763
10747
|
E && tS({ element: E, padding: a }),
|
|
10764
|
-
cS({ arrowWidth:
|
|
10748
|
+
cS({ arrowWidth: C, arrowHeight: I }),
|
|
10765
10749
|
m && eS({ strategy: "referenceHidden", ...G })
|
|
10766
10750
|
]
|
|
10767
10751
|
}), [_, z] = Fd(L), X = ot(x);
|
|
@@ -10774,7 +10758,7 @@ var ga = "PopperContent", [sS, iS] = Ad(ga), Md = f.forwardRef(
|
|
|
10774
10758
|
}, [b]), /* @__PURE__ */ l.jsx(
|
|
10775
10759
|
"div",
|
|
10776
10760
|
{
|
|
10777
|
-
ref:
|
|
10761
|
+
ref: j.setFloating,
|
|
10778
10762
|
"data-radix-popper-content-wrapper": "",
|
|
10779
10763
|
style: {
|
|
10780
10764
|
...$,
|
|
@@ -10800,7 +10784,7 @@ var ga = "PopperContent", [sS, iS] = Ad(ga), Md = f.forwardRef(
|
|
|
10800
10784
|
{
|
|
10801
10785
|
scope: n,
|
|
10802
10786
|
placedSide: _,
|
|
10803
|
-
onArrowChange:
|
|
10787
|
+
onArrowChange: S,
|
|
10804
10788
|
arrowX: oe,
|
|
10805
10789
|
arrowY: F,
|
|
10806
10790
|
shouldHideArrow: ee,
|
|
@@ -10918,7 +10902,7 @@ var mS = f.forwardRef((e, t) => {
|
|
|
10918
10902
|
defaultProp: a ?? null,
|
|
10919
10903
|
onChange: c,
|
|
10920
10904
|
caller: zr
|
|
10921
|
-
}), [b, w] = f.useState(!1), y = ot(u), E = Bd(n),
|
|
10905
|
+
}), [b, w] = f.useState(!1), y = ot(u), E = Bd(n), S = f.useRef(!1), [T, C] = f.useState(0);
|
|
10922
10906
|
return f.useEffect(() => {
|
|
10923
10907
|
const I = m.current;
|
|
10924
10908
|
if (I)
|
|
@@ -10937,11 +10921,11 @@ var mS = f.forwardRef((e, t) => {
|
|
|
10937
10921
|
),
|
|
10938
10922
|
onItemShiftTab: f.useCallback(() => w(!0), []),
|
|
10939
10923
|
onFocusableItemAdd: f.useCallback(
|
|
10940
|
-
() =>
|
|
10924
|
+
() => C((I) => I + 1),
|
|
10941
10925
|
[]
|
|
10942
10926
|
),
|
|
10943
10927
|
onFocusableItemRemove: f.useCallback(
|
|
10944
|
-
() =>
|
|
10928
|
+
() => C((I) => I - 1),
|
|
10945
10929
|
[]
|
|
10946
10930
|
),
|
|
10947
10931
|
children: /* @__PURE__ */ l.jsx(
|
|
@@ -10953,20 +10937,20 @@ var mS = f.forwardRef((e, t) => {
|
|
|
10953
10937
|
ref: v,
|
|
10954
10938
|
style: { outline: "none", ...e.style },
|
|
10955
10939
|
onMouseDown: Q(e.onMouseDown, () => {
|
|
10956
|
-
|
|
10940
|
+
S.current = !0;
|
|
10957
10941
|
}),
|
|
10958
10942
|
onFocus: Q(e.onFocus, (I) => {
|
|
10959
|
-
const N = !
|
|
10943
|
+
const N = !S.current;
|
|
10960
10944
|
if (I.target === I.currentTarget && N && !b) {
|
|
10961
|
-
const
|
|
10962
|
-
if (I.currentTarget.dispatchEvent(
|
|
10945
|
+
const k = new CustomEvent(Xs, uS);
|
|
10946
|
+
if (I.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
|
|
10963
10947
|
const M = E().filter((L) => L.focusable), W = M.find((L) => L.active), G = M.find((L) => L.id === g), $ = [W, G, ...M].filter(
|
|
10964
10948
|
Boolean
|
|
10965
10949
|
).map((L) => L.ref.current);
|
|
10966
10950
|
Wd($, d);
|
|
10967
10951
|
}
|
|
10968
10952
|
}
|
|
10969
|
-
|
|
10953
|
+
S.current = !1;
|
|
10970
10954
|
}),
|
|
10971
10955
|
onBlur: Q(e.onBlur, () => w(!1))
|
|
10972
10956
|
}
|
|
@@ -11172,11 +11156,11 @@ var It = "MenuContent", [PS, Ca] = Pn(It), Jd = f.forwardRef(
|
|
|
11172
11156
|
onDismiss: v,
|
|
11173
11157
|
disableOutsideScroll: x,
|
|
11174
11158
|
...g
|
|
11175
|
-
} = e, p = _n(It, n), b = Wr(It, n), w = ds(n), y = Kd(n), E = ES(n), [
|
|
11159
|
+
} = e, p = _n(It, n), b = Wr(It, n), w = ds(n), y = Kd(n), E = ES(n), [S, T] = f.useState(null), C = f.useRef(null), I = Ce(t, C, p.onContentChange), N = f.useRef(0), k = f.useRef(""), M = f.useRef(0), W = f.useRef(null), G = f.useRef("right"), j = f.useRef(0), $ = x ? ts : f.Fragment, L = x ? { as: MS, allowPinchZoom: !0 } : void 0, q = (_) => {
|
|
11176
11160
|
var Y, P;
|
|
11177
|
-
const z =
|
|
11161
|
+
const z = k.current + _, X = E().filter((Z) => !Z.disabled), oe = document.activeElement, F = (Y = X.find((Z) => Z.ref.current === oe)) == null ? void 0 : Y.textValue, ee = X.map((Z) => Z.textValue), he = KS(ee, z, F), be = (P = X.find((Z) => Z.textValue === he)) == null ? void 0 : P.ref.current;
|
|
11178
11162
|
(function Z(ne) {
|
|
11179
|
-
|
|
11163
|
+
k.current = ne, window.clearTimeout(N.current), ne !== "" && (N.current = window.setTimeout(() => Z(""), 1e3));
|
|
11180
11164
|
})(z), be && setTimeout(() => be.focus());
|
|
11181
11165
|
};
|
|
11182
11166
|
f.useEffect(() => () => window.clearTimeout(N.current), []), ra();
|
|
@@ -11188,7 +11172,7 @@ var It = "MenuContent", [PS, Ca] = Pn(It), Jd = f.forwardRef(
|
|
|
11188
11172
|
PS,
|
|
11189
11173
|
{
|
|
11190
11174
|
scope: n,
|
|
11191
|
-
searchRef:
|
|
11175
|
+
searchRef: k,
|
|
11192
11176
|
onItemEnter: f.useCallback(
|
|
11193
11177
|
(_) => {
|
|
11194
11178
|
O(_) && _.preventDefault();
|
|
@@ -11198,7 +11182,7 @@ var It = "MenuContent", [PS, Ca] = Pn(It), Jd = f.forwardRef(
|
|
|
11198
11182
|
onItemLeave: f.useCallback(
|
|
11199
11183
|
(_) => {
|
|
11200
11184
|
var z;
|
|
11201
|
-
O(_) || ((z =
|
|
11185
|
+
O(_) || ((z = C.current) == null || z.focus(), T(null));
|
|
11202
11186
|
},
|
|
11203
11187
|
[O]
|
|
11204
11188
|
),
|
|
@@ -11219,7 +11203,7 @@ var It = "MenuContent", [PS, Ca] = Pn(It), Jd = f.forwardRef(
|
|
|
11219
11203
|
trapped: o,
|
|
11220
11204
|
onMountAutoFocus: Q(s, (_) => {
|
|
11221
11205
|
var z;
|
|
11222
|
-
_.preventDefault(), (z =
|
|
11206
|
+
_.preventDefault(), (z = C.current) == null || z.focus({ preventScroll: !0 });
|
|
11223
11207
|
}),
|
|
11224
11208
|
onUnmountAutoFocus: i,
|
|
11225
11209
|
children: /* @__PURE__ */ l.jsx(
|
|
@@ -11240,7 +11224,7 @@ var It = "MenuContent", [PS, Ca] = Pn(It), Jd = f.forwardRef(
|
|
|
11240
11224
|
dir: b.dir,
|
|
11241
11225
|
orientation: "vertical",
|
|
11242
11226
|
loop: r,
|
|
11243
|
-
currentTabStopId:
|
|
11227
|
+
currentTabStopId: S,
|
|
11244
11228
|
onCurrentTabStopIdChange: T,
|
|
11245
11229
|
onEntryFocus: Q(c, (_) => {
|
|
11246
11230
|
b.isUsingKeyboardRef.current || _.preventDefault();
|
|
@@ -11261,22 +11245,22 @@ var It = "MenuContent", [PS, Ca] = Pn(It), Jd = f.forwardRef(
|
|
|
11261
11245
|
onKeyDown: Q(g.onKeyDown, (_) => {
|
|
11262
11246
|
const X = _.target.closest("[data-radix-menu-content]") === _.currentTarget, oe = _.ctrlKey || _.altKey || _.metaKey, F = _.key.length === 1;
|
|
11263
11247
|
X && (_.key === "Tab" && _.preventDefault(), !oe && F && q(_.key));
|
|
11264
|
-
const ee =
|
|
11248
|
+
const ee = C.current;
|
|
11265
11249
|
if (_.target !== ee || !CS.includes(_.key)) return;
|
|
11266
11250
|
_.preventDefault();
|
|
11267
11251
|
const be = E().filter((Y) => !Y.disabled).map((Y) => Y.ref.current);
|
|
11268
11252
|
Vd.includes(_.key) && be.reverse(), VS(be);
|
|
11269
11253
|
}),
|
|
11270
11254
|
onBlur: Q(e.onBlur, (_) => {
|
|
11271
|
-
_.currentTarget.contains(_.target) || (window.clearTimeout(N.current),
|
|
11255
|
+
_.currentTarget.contains(_.target) || (window.clearTimeout(N.current), k.current = "");
|
|
11272
11256
|
}),
|
|
11273
11257
|
onPointerMove: Q(
|
|
11274
11258
|
e.onPointerMove,
|
|
11275
11259
|
jr((_) => {
|
|
11276
|
-
const z = _.target, X =
|
|
11260
|
+
const z = _.target, X = j.current !== _.clientX;
|
|
11277
11261
|
if (_.currentTarget.contains(z) && X) {
|
|
11278
|
-
const oe = _.clientX >
|
|
11279
|
-
G.current = oe,
|
|
11262
|
+
const oe = _.clientX > j.current ? "right" : "left";
|
|
11263
|
+
G.current = oe, j.current = _.clientX;
|
|
11280
11264
|
}
|
|
11281
11265
|
})
|
|
11282
11266
|
)
|
|
@@ -11940,20 +11924,20 @@ function xo({
|
|
|
11940
11924
|
stop: w,
|
|
11941
11925
|
lastCheckpointId: y,
|
|
11942
11926
|
listCheckpoints: E,
|
|
11943
|
-
navigateToCheckpoint:
|
|
11927
|
+
navigateToCheckpoint: S,
|
|
11944
11928
|
returnToLatest: T,
|
|
11945
|
-
hasMoreHistory:
|
|
11929
|
+
hasMoreHistory: C,
|
|
11946
11930
|
isLoadingHistory: I,
|
|
11947
11931
|
loadOlderMessages: N,
|
|
11948
|
-
api:
|
|
11949
|
-
} = Fi(), [M, W] = de(null), [G,
|
|
11950
|
-
|
|
11932
|
+
api: k
|
|
11933
|
+
} = Fi(), [M, W] = de(null), [G, j] = de(""), [$, L] = de(null), [q, O] = de([]), [_, z] = de(!1), [X, oe] = de(null), [F, ee] = de(null), [he, be] = de(!1), [Y, P] = de(null), [Z, ne] = de([]), [ae, se] = de(null), je = We(null), Le = We(null), Oe = We(null), [ue, Pe] = de("desktop");
|
|
11934
|
+
ze(() => {
|
|
11951
11935
|
const J = () => {
|
|
11952
11936
|
const ce = window.innerWidth;
|
|
11953
11937
|
Pe(ce < 640 ? "phone" : ce < 1024 ? "tablet" : "desktop");
|
|
11954
11938
|
};
|
|
11955
11939
|
return J(), window.addEventListener("resize", J), () => window.removeEventListener("resize", J);
|
|
11956
|
-
}, []),
|
|
11940
|
+
}, []), ze(() => {
|
|
11957
11941
|
let J = !1;
|
|
11958
11942
|
if (!m) {
|
|
11959
11943
|
ne([]), se(null), Oe.current = null;
|
|
@@ -11976,27 +11960,27 @@ function xo({
|
|
|
11976
11960
|
}), () => {
|
|
11977
11961
|
J = !0;
|
|
11978
11962
|
};
|
|
11979
|
-
}, [m, y, E]),
|
|
11963
|
+
}, [m, y, E]), ze(() => {
|
|
11980
11964
|
y && se(y);
|
|
11981
11965
|
}, [y]);
|
|
11982
|
-
const xe =
|
|
11983
|
-
if (!(!
|
|
11966
|
+
const xe = Ue(async () => {
|
|
11967
|
+
if (!(!C || I))
|
|
11984
11968
|
try {
|
|
11985
11969
|
await N();
|
|
11986
11970
|
} catch (J) {
|
|
11987
11971
|
console.warn("loadOlderMessages failed", J);
|
|
11988
11972
|
}
|
|
11989
|
-
}, [
|
|
11990
|
-
|
|
11973
|
+
}, [C, I, N]);
|
|
11974
|
+
ze(() => {
|
|
11991
11975
|
(async () => {
|
|
11992
11976
|
try {
|
|
11993
|
-
const ce = await
|
|
11977
|
+
const ce = await k.getAgent("default");
|
|
11994
11978
|
P(ce.uiDefaultMessage || null);
|
|
11995
11979
|
} catch (ce) {
|
|
11996
11980
|
console.warn("Failed to fetch default message:", ce), P(null);
|
|
11997
11981
|
}
|
|
11998
11982
|
})();
|
|
11999
|
-
}, [
|
|
11983
|
+
}, [k]), ze(() => {
|
|
12000
11984
|
p && !he && (h == null || h(p));
|
|
12001
11985
|
}, [p, he, h]);
|
|
12002
11986
|
const H = (J) => {
|
|
@@ -12026,19 +12010,19 @@ function xo({
|
|
|
12026
12010
|
}
|
|
12027
12011
|
}
|
|
12028
12012
|
try {
|
|
12029
|
-
await b(ce, { checkpointId: ae || y || void 0, payloadExtras: M ? { edit: !0, originalMessageId: M } : void 0, attachments: q }), u == null || u(ce), L(null), O([]), W(null),
|
|
12013
|
+
await b(ce, { checkpointId: ae || y || void 0, payloadExtras: M ? { edit: !0, originalMessageId: M } : void 0, attachments: q }), u == null || u(ce), L(null), O([]), W(null), j("");
|
|
12030
12014
|
} catch (_e) {
|
|
12031
12015
|
const Xe = (_e == null ? void 0 : _e.message) || "Failed to send message";
|
|
12032
12016
|
L(Xe), h == null || h(Xe);
|
|
12033
12017
|
}
|
|
12034
12018
|
}
|
|
12035
12019
|
}, tt = K.useCallback((J, ce) => {
|
|
12036
|
-
a && (W(J),
|
|
12020
|
+
a && (W(J), j(ce), L(null));
|
|
12037
12021
|
}, [a]), rt = K.useCallback(() => {
|
|
12038
|
-
W(null),
|
|
12039
|
-
}, []), st =
|
|
12022
|
+
W(null), j(""), L(null);
|
|
12023
|
+
}, []), st = Ue((J, ce) => {
|
|
12040
12024
|
tt(J, ce);
|
|
12041
|
-
}, [tt]), Qe =
|
|
12025
|
+
}, [tt]), Qe = Ue((J) => {
|
|
12042
12026
|
for (let ce = J - 1; ce >= 0; ce--)
|
|
12043
12027
|
if (v[ce].role === "user") {
|
|
12044
12028
|
const _e = ie(v[ce]);
|
|
@@ -12076,7 +12060,7 @@ function xo({
|
|
|
12076
12060
|
await T(), se(null);
|
|
12077
12061
|
return;
|
|
12078
12062
|
}
|
|
12079
|
-
await
|
|
12063
|
+
await S(J), se(J);
|
|
12080
12064
|
}
|
|
12081
12065
|
}, kt = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${c.container || ""}`, xn = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-y-auto overflow-x-auto overscroll-contain break-words break-anywhere p-4 bg-transparent ${c.messagesArea || ""}`, On = `flex-shrink-0 w-full border-t p-4 bg-transparent ${c.inputArea || ""}`;
|
|
12082
12066
|
return /* @__PURE__ */ l.jsxs("div", { className: kt, children: [
|
|
@@ -12288,13 +12272,13 @@ var Na = "ScrollArea", [$f, pR] = Ht(Na), [$0, jt] = $f(Na), Hf = f.forwardRef(
|
|
|
12288
12272
|
dir: o,
|
|
12289
12273
|
scrollHideDelay: s = 600,
|
|
12290
12274
|
...i
|
|
12291
|
-
} = e, [a, c] = f.useState(null), [u, d] = f.useState(null), [h, m] = f.useState(null), [v, x] = f.useState(null), [g, p] = f.useState(null), [b, w] = f.useState(0), [y, E] = f.useState(0), [
|
|
12275
|
+
} = e, [a, c] = f.useState(null), [u, d] = f.useState(null), [h, m] = f.useState(null), [v, x] = f.useState(null), [g, p] = f.useState(null), [b, w] = f.useState(0), [y, E] = f.useState(0), [S, T] = f.useState(!1), [C, I] = f.useState(!1), N = Ce(t, (M) => c(M)), k = is(o);
|
|
12292
12276
|
return /* @__PURE__ */ l.jsx(
|
|
12293
12277
|
$0,
|
|
12294
12278
|
{
|
|
12295
12279
|
scope: n,
|
|
12296
12280
|
type: r,
|
|
12297
|
-
dir:
|
|
12281
|
+
dir: k,
|
|
12298
12282
|
scrollHideDelay: s,
|
|
12299
12283
|
scrollArea: a,
|
|
12300
12284
|
viewport: u,
|
|
@@ -12303,18 +12287,18 @@ var Na = "ScrollArea", [$f, pR] = Ht(Na), [$0, jt] = $f(Na), Hf = f.forwardRef(
|
|
|
12303
12287
|
onContentChange: m,
|
|
12304
12288
|
scrollbarX: v,
|
|
12305
12289
|
onScrollbarXChange: x,
|
|
12306
|
-
scrollbarXEnabled:
|
|
12290
|
+
scrollbarXEnabled: S,
|
|
12307
12291
|
onScrollbarXEnabledChange: T,
|
|
12308
12292
|
scrollbarY: g,
|
|
12309
12293
|
onScrollbarYChange: p,
|
|
12310
|
-
scrollbarYEnabled:
|
|
12294
|
+
scrollbarYEnabled: C,
|
|
12311
12295
|
onScrollbarYEnabledChange: I,
|
|
12312
12296
|
onCornerWidthChange: w,
|
|
12313
12297
|
onCornerHeightChange: E,
|
|
12314
12298
|
children: /* @__PURE__ */ l.jsx(
|
|
12315
12299
|
me.div,
|
|
12316
12300
|
{
|
|
12317
|
-
dir:
|
|
12301
|
+
dir: k,
|
|
12318
12302
|
...i,
|
|
12319
12303
|
ref: N,
|
|
12320
12304
|
style: {
|
|
@@ -12610,20 +12594,20 @@ var H0 = f.forwardRef((e, t) => {
|
|
|
12610
12594
|
onWheelScroll: d,
|
|
12611
12595
|
onResize: h,
|
|
12612
12596
|
...m
|
|
12613
|
-
} = e, v = jt(Zt, n), [x, g] = f.useState(null), p = Ce(t, (N) => g(N)), b = f.useRef(null), w = f.useRef(""), y = v.viewport, E = r.content - r.viewport,
|
|
12597
|
+
} = e, v = jt(Zt, n), [x, g] = f.useState(null), p = Ce(t, (N) => g(N)), b = f.useRef(null), w = f.useRef(""), y = v.viewport, E = r.content - r.viewport, S = ot(d), T = ot(c), C = ms(h, 10);
|
|
12614
12598
|
function I(N) {
|
|
12615
12599
|
if (b.current) {
|
|
12616
|
-
const
|
|
12617
|
-
u({ x:
|
|
12600
|
+
const k = N.clientX - b.current.left, M = N.clientY - b.current.top;
|
|
12601
|
+
u({ x: k, y: M });
|
|
12618
12602
|
}
|
|
12619
12603
|
}
|
|
12620
12604
|
return f.useEffect(() => {
|
|
12621
|
-
const N = (
|
|
12622
|
-
const M =
|
|
12623
|
-
(x == null ? void 0 : x.contains(M)) &&
|
|
12605
|
+
const N = (k) => {
|
|
12606
|
+
const M = k.target;
|
|
12607
|
+
(x == null ? void 0 : x.contains(M)) && S(k, E);
|
|
12624
12608
|
};
|
|
12625
12609
|
return document.addEventListener("wheel", N, { passive: !1 }), () => document.removeEventListener("wheel", N, { passive: !1 });
|
|
12626
|
-
}, [y, x, E,
|
|
12610
|
+
}, [y, x, E, S]), f.useEffect(T, [r, T]), Jn(x, C), Jn(v.content, C), /* @__PURE__ */ l.jsx(
|
|
12627
12611
|
V0,
|
|
12628
12612
|
{
|
|
12629
12613
|
scope: n,
|
|
@@ -12644,8 +12628,8 @@ var H0 = f.forwardRef((e, t) => {
|
|
|
12644
12628
|
}),
|
|
12645
12629
|
onPointerMove: Q(e.onPointerMove, I),
|
|
12646
12630
|
onPointerUp: Q(e.onPointerUp, (N) => {
|
|
12647
|
-
const
|
|
12648
|
-
|
|
12631
|
+
const k = N.target;
|
|
12632
|
+
k.hasPointerCapture(N.pointerId) && k.releasePointerCapture(N.pointerId), document.body.style.webkitUserSelect = w.current, v.viewport && (v.viewport.style.scrollBehavior = ""), b.current = null;
|
|
12649
12633
|
})
|
|
12650
12634
|
}
|
|
12651
12635
|
)
|
|
@@ -12839,11 +12823,11 @@ function Ti({
|
|
|
12839
12823
|
createThread: g,
|
|
12840
12824
|
deleteThread: p,
|
|
12841
12825
|
renameThread: b
|
|
12842
|
-
} = Fi(), [w, y] = de(m ?? []), [E,
|
|
12843
|
-
|
|
12826
|
+
} = Fi(), [w, y] = de(m ?? []), [E, S] = de(!1), [T, C] = de(null), [I, N] = de(null), [k, M] = de(""), [W, G] = de(!1);
|
|
12827
|
+
ze(() => {
|
|
12844
12828
|
y(m ?? []);
|
|
12845
12829
|
}, [m]);
|
|
12846
|
-
const
|
|
12830
|
+
const j = async (F) => {
|
|
12847
12831
|
try {
|
|
12848
12832
|
await h(F), a == null || a(F), c == null || c(F);
|
|
12849
12833
|
} catch (ee) {
|
|
@@ -12869,9 +12853,9 @@ function Ti({
|
|
|
12869
12853
|
}, q = (F, ee) => {
|
|
12870
12854
|
ee.stopPropagation(), N(F.threadId), M(F.title || `Thread ${F.threadId.slice(0, 8)}`);
|
|
12871
12855
|
}, O = async (F) => {
|
|
12872
|
-
if (
|
|
12856
|
+
if (k.trim())
|
|
12873
12857
|
try {
|
|
12874
|
-
await b(F,
|
|
12858
|
+
await b(F, k.trim()), N(null), M("");
|
|
12875
12859
|
} catch (ee) {
|
|
12876
12860
|
console.error("Failed to update title:", ee);
|
|
12877
12861
|
}
|
|
@@ -12912,12 +12896,12 @@ function Ti({
|
|
|
12912
12896
|
] }) : w.slice().sort((F, ee) => new Date(ee.updatedAt || ee.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ l.jsxs(
|
|
12913
12897
|
"div",
|
|
12914
12898
|
{
|
|
12915
|
-
onClick: () =>
|
|
12899
|
+
onClick: () => j(F.threadId),
|
|
12916
12900
|
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? x) === F.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`,
|
|
12917
12901
|
children: [
|
|
12918
12902
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
12919
12903
|
/* @__PURE__ */ l.jsx("div", { className: "flex-1 min-w-0", children: I === F.threadId ? /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", onClick: (ee) => ee.stopPropagation(), children: [
|
|
12920
|
-
/* @__PURE__ */ l.jsx(Ar, { value:
|
|
12904
|
+
/* @__PURE__ */ l.jsx(Ar, { value: k, onChange: (ee) => M(ee.target.value), onKeyDown: (ee) => z(ee, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
12921
12905
|
/* @__PURE__ */ l.jsx(Ne, { variant: "ghost", size: "sm", onClick: () => O(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Oi, { size: 12 }) }),
|
|
12922
12906
|
/* @__PURE__ */ l.jsx(Ne, { variant: "ghost", size: "sm", onClick: _, className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Un, { size: 12 }) })
|
|
12923
12907
|
] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
@@ -13258,13 +13242,13 @@ var kr = "Tooltip", [pC, vs] = gs(kr), gh = (e) => {
|
|
|
13258
13242
|
} = e, c = Oa(kr, e.__scopeTooltip), u = xs(t), [d, h] = f.useState(null), m = Dt(), v = f.useRef(0), x = i ?? c.disableHoverableContent, g = a ?? c.delayDuration, p = f.useRef(!1), [b, w] = cn({
|
|
13259
13243
|
prop: r,
|
|
13260
13244
|
defaultProp: o ?? !1,
|
|
13261
|
-
onChange: (
|
|
13262
|
-
|
|
13245
|
+
onChange: (C) => {
|
|
13246
|
+
C ? (c.onOpen(), document.dispatchEvent(new CustomEvent(Ri))) : c.onClose(), s == null || s(C);
|
|
13263
13247
|
},
|
|
13264
13248
|
caller: kr
|
|
13265
13249
|
}), y = f.useMemo(() => b ? p.current ? "delayed-open" : "instant-open" : "closed", [b]), E = f.useCallback(() => {
|
|
13266
13250
|
window.clearTimeout(v.current), v.current = 0, p.current = !1, w(!0);
|
|
13267
|
-
}, [w]),
|
|
13251
|
+
}, [w]), S = f.useCallback(() => {
|
|
13268
13252
|
window.clearTimeout(v.current), v.current = 0, w(!1);
|
|
13269
13253
|
}, [w]), T = f.useCallback(() => {
|
|
13270
13254
|
window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
@@ -13286,10 +13270,10 @@ var kr = "Tooltip", [pC, vs] = gs(kr), gh = (e) => {
|
|
|
13286
13270
|
c.isOpenDelayedRef.current ? T() : E();
|
|
13287
13271
|
}, [c.isOpenDelayedRef, T, E]),
|
|
13288
13272
|
onTriggerLeave: f.useCallback(() => {
|
|
13289
|
-
x ?
|
|
13290
|
-
}, [
|
|
13273
|
+
x ? S() : (window.clearTimeout(v.current), v.current = 0);
|
|
13274
|
+
}, [S, x]),
|
|
13291
13275
|
onOpen: E,
|
|
13292
|
-
onClose:
|
|
13276
|
+
onClose: S,
|
|
13293
13277
|
disableHoverableContent: x,
|
|
13294
13278
|
children: n
|
|
13295
13279
|
}
|
|
@@ -13337,8 +13321,8 @@ var mC = "TooltipPortal", [wR, gC] = gs(mC, {
|
|
|
13337
13321
|
a(null), h(!1);
|
|
13338
13322
|
}, [h]), v = f.useCallback(
|
|
13339
13323
|
(x, g) => {
|
|
13340
|
-
const p = x.currentTarget, b = { x: x.clientX, y: x.clientY }, w = SC(b, p.getBoundingClientRect()), y = CC(b, w), E = TC(g.getBoundingClientRect()),
|
|
13341
|
-
a(
|
|
13324
|
+
const p = x.currentTarget, b = { x: x.clientX, y: x.clientY }, w = SC(b, p.getBoundingClientRect()), y = CC(b, w), E = TC(g.getBoundingClientRect()), S = EC([...y, ...E]);
|
|
13325
|
+
a(S), h(!0);
|
|
13342
13326
|
},
|
|
13343
13327
|
[h]
|
|
13344
13328
|
);
|
|
@@ -14249,17 +14233,17 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], Nn = "Sele
|
|
|
14249
14233
|
disabled: m,
|
|
14250
14234
|
required: v,
|
|
14251
14235
|
form: x
|
|
14252
|
-
} = e, g = Cs(t), [p, b] = f.useState(null), [w, y] = f.useState(null), [E,
|
|
14236
|
+
} = e, g = Cs(t), [p, b] = f.useState(null), [w, y] = f.useState(null), [E, S] = f.useState(!1), T = is(u), [C, I] = cn({
|
|
14253
14237
|
prop: r,
|
|
14254
14238
|
defaultProp: o ?? !1,
|
|
14255
14239
|
onChange: s,
|
|
14256
14240
|
caller: Nn
|
|
14257
|
-
}), [N,
|
|
14241
|
+
}), [N, k] = cn({
|
|
14258
14242
|
prop: i,
|
|
14259
14243
|
defaultProp: a,
|
|
14260
14244
|
onChange: c,
|
|
14261
14245
|
caller: Nn
|
|
14262
|
-
}), M = f.useRef(null), W = p ? x || !!p.closest("form") : !0, [G,
|
|
14246
|
+
}), M = f.useRef(null), W = p ? x || !!p.closest("form") : !0, [G, j] = f.useState(/* @__PURE__ */ new Set()), $ = Array.from(G).map((L) => L.props.value).join(";");
|
|
14263
14247
|
return /* @__PURE__ */ l.jsx(xa, { ...g, children: /* @__PURE__ */ l.jsxs(
|
|
14264
14248
|
lT,
|
|
14265
14249
|
{
|
|
@@ -14270,11 +14254,11 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], Nn = "Sele
|
|
|
14270
14254
|
valueNode: w,
|
|
14271
14255
|
onValueNodeChange: y,
|
|
14272
14256
|
valueNodeHasChildren: E,
|
|
14273
|
-
onValueNodeHasChildrenChange:
|
|
14257
|
+
onValueNodeHasChildrenChange: S,
|
|
14274
14258
|
contentId: Dt(),
|
|
14275
14259
|
value: N,
|
|
14276
|
-
onValueChange:
|
|
14277
|
-
open:
|
|
14260
|
+
onValueChange: k,
|
|
14261
|
+
open: C,
|
|
14278
14262
|
onOpenChange: I,
|
|
14279
14263
|
dir: T,
|
|
14280
14264
|
triggerPointerDownPosRef: M,
|
|
@@ -14285,10 +14269,10 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], Nn = "Sele
|
|
|
14285
14269
|
{
|
|
14286
14270
|
scope: e.__scopeSelect,
|
|
14287
14271
|
onNativeOptionAdd: f.useCallback((L) => {
|
|
14288
|
-
|
|
14272
|
+
j((q) => new Set(q).add(L));
|
|
14289
14273
|
}, []),
|
|
14290
14274
|
onNativeOptionRemove: f.useCallback((L) => {
|
|
14291
|
-
|
|
14275
|
+
j((q) => {
|
|
14292
14276
|
const O = new Set(q);
|
|
14293
14277
|
return O.delete(L), O;
|
|
14294
14278
|
});
|
|
@@ -14305,7 +14289,7 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], Nn = "Sele
|
|
|
14305
14289
|
name: d,
|
|
14306
14290
|
autoComplete: h,
|
|
14307
14291
|
value: N,
|
|
14308
|
-
onChange: (L) =>
|
|
14292
|
+
onChange: (L) => k(L.target.value),
|
|
14309
14293
|
disabled: m,
|
|
14310
14294
|
form: x,
|
|
14311
14295
|
children: [
|
|
@@ -14428,9 +14412,9 @@ var Ot = 10, [Qh, gn] = ar(jn), hT = "SelectContentImpl", pT = Yn("SelectContent
|
|
|
14428
14412
|
avoidCollisions: p,
|
|
14429
14413
|
//
|
|
14430
14414
|
...b
|
|
14431
|
-
} = e, w = mn(jn, n), [y, E] = f.useState(null), [
|
|
14415
|
+
} = e, w = mn(jn, n), [y, E] = f.useState(null), [S, T] = f.useState(null), C = Ce(t, (Y) => E(Y)), [I, N] = f.useState(null), [k, M] = f.useState(
|
|
14432
14416
|
null
|
|
14433
|
-
), W = Ss(n), [G,
|
|
14417
|
+
), W = Ss(n), [G, j] = f.useState(!1), $ = f.useRef(!1);
|
|
14434
14418
|
f.useEffect(() => {
|
|
14435
14419
|
if (y) return oa(y);
|
|
14436
14420
|
}, [y]), ra();
|
|
@@ -14438,9 +14422,9 @@ var Ot = 10, [Qh, gn] = ar(jn), hT = "SelectContentImpl", pT = Yn("SelectContent
|
|
|
14438
14422
|
(Y) => {
|
|
14439
14423
|
const [P, ...Z] = W().map((se) => se.ref.current), [ne] = Z.slice(-1), ae = document.activeElement;
|
|
14440
14424
|
for (const se of Y)
|
|
14441
|
-
if (se === ae || (se == null || se.scrollIntoView({ block: "nearest" }), se === P &&
|
|
14425
|
+
if (se === ae || (se == null || se.scrollIntoView({ block: "nearest" }), se === P && S && (S.scrollTop = 0), se === ne && S && (S.scrollTop = S.scrollHeight), se == null || se.focus(), document.activeElement !== ae)) return;
|
|
14442
14426
|
},
|
|
14443
|
-
[W,
|
|
14427
|
+
[W, S]
|
|
14444
14428
|
), q = f.useCallback(
|
|
14445
14429
|
() => L([I, y]),
|
|
14446
14430
|
[L, I, y]
|
|
@@ -14503,14 +14487,14 @@ var Ot = 10, [Qh, gn] = ar(jn), hT = "SelectContentImpl", pT = Yn("SelectContent
|
|
|
14503
14487
|
{
|
|
14504
14488
|
scope: n,
|
|
14505
14489
|
content: y,
|
|
14506
|
-
viewport:
|
|
14490
|
+
viewport: S,
|
|
14507
14491
|
onViewportChange: T,
|
|
14508
14492
|
itemRefCallback: oe,
|
|
14509
14493
|
selectedItem: I,
|
|
14510
14494
|
onItemLeave: F,
|
|
14511
14495
|
itemTextRefCallback: ee,
|
|
14512
14496
|
focusSelectedItem: q,
|
|
14513
|
-
selectedItemText:
|
|
14497
|
+
selectedItemText: k,
|
|
14514
14498
|
position: r,
|
|
14515
14499
|
isPositioned: G,
|
|
14516
14500
|
searchRef: z,
|
|
@@ -14545,8 +14529,8 @@ var Ot = 10, [Qh, gn] = ar(jn), hT = "SelectContentImpl", pT = Yn("SelectContent
|
|
|
14545
14529
|
onContextMenu: (Y) => Y.preventDefault(),
|
|
14546
14530
|
...b,
|
|
14547
14531
|
...be,
|
|
14548
|
-
onPlaced: () =>
|
|
14549
|
-
ref:
|
|
14532
|
+
onPlaced: () => j(!0),
|
|
14533
|
+
ref: C,
|
|
14550
14534
|
style: {
|
|
14551
14535
|
// flex layout so we can place the scroll buttons properly
|
|
14552
14536
|
display: "flex",
|
|
@@ -14578,11 +14562,11 @@ var Ot = 10, [Qh, gn] = ar(jn), hT = "SelectContentImpl", pT = Yn("SelectContent
|
|
|
14578
14562
|
);
|
|
14579
14563
|
ep.displayName = hT;
|
|
14580
14564
|
var mT = "SelectItemAlignedPosition", tp = f.forwardRef((e, t) => {
|
|
14581
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = mn(jn, n), i = gn(jn, n), [a, c] = f.useState(null), [u, d] = f.useState(null), h = Ce(t, (
|
|
14565
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = mn(jn, n), i = gn(jn, n), [a, c] = f.useState(null), [u, d] = f.useState(null), h = Ce(t, (C) => d(C)), m = Ss(n), v = f.useRef(!1), x = f.useRef(!0), { viewport: g, selectedItem: p, selectedItemText: b, focusSelectedItem: w } = i, y = f.useCallback(() => {
|
|
14582
14566
|
if (s.trigger && s.valueNode && a && u && g && p && b) {
|
|
14583
|
-
const
|
|
14567
|
+
const C = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), k = b.getBoundingClientRect();
|
|
14584
14568
|
if (s.dir !== "rtl") {
|
|
14585
|
-
const ae =
|
|
14569
|
+
const ae = k.left - I.left, se = N.left - ae, je = C.left - se, Le = C.width + je, Oe = Math.max(Le, I.width), ue = window.innerWidth - Ot, Pe = Ci(se, [
|
|
14586
14570
|
Ot,
|
|
14587
14571
|
// Prevents the content from going off the starting edge of the
|
|
14588
14572
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -14593,13 +14577,13 @@ var mT = "SelectItemAlignedPosition", tp = f.forwardRef((e, t) => {
|
|
|
14593
14577
|
]);
|
|
14594
14578
|
a.style.minWidth = Le + "px", a.style.left = Pe + "px";
|
|
14595
14579
|
} else {
|
|
14596
|
-
const ae = I.right -
|
|
14580
|
+
const ae = I.right - k.right, se = window.innerWidth - N.right - ae, je = window.innerWidth - C.right - se, Le = C.width + je, Oe = Math.max(Le, I.width), ue = window.innerWidth - Ot, Pe = Ci(se, [
|
|
14597
14581
|
Ot,
|
|
14598
14582
|
Math.max(Ot, ue - Oe)
|
|
14599
14583
|
]);
|
|
14600
14584
|
a.style.minWidth = Le + "px", a.style.right = Pe + "px";
|
|
14601
14585
|
}
|
|
14602
|
-
const M = m(), W = window.innerHeight - Ot * 2, G = g.scrollHeight,
|
|
14586
|
+
const M = m(), W = window.innerHeight - Ot * 2, G = g.scrollHeight, j = window.getComputedStyle(u), $ = parseInt(j.borderTopWidth, 10), L = parseInt(j.paddingTop, 10), q = parseInt(j.borderBottomWidth, 10), O = parseInt(j.paddingBottom, 10), _ = $ + L + G + O + q, z = Math.min(p.offsetHeight * 5, _), X = window.getComputedStyle(g), oe = parseInt(X.paddingTop, 10), F = parseInt(X.paddingBottom, 10), ee = C.top + C.height / 2 - Ot, he = W - ee, be = p.offsetHeight / 2, Y = p.offsetTop + be, P = $ + L + Y, Z = _ - P;
|
|
14603
14587
|
if (P <= ee) {
|
|
14604
14588
|
const ae = M.length > 0 && p === M[M.length - 1].ref.current;
|
|
14605
14589
|
a.style.bottom = "0px";
|
|
@@ -14634,13 +14618,13 @@ var mT = "SelectItemAlignedPosition", tp = f.forwardRef((e, t) => {
|
|
|
14634
14618
|
r
|
|
14635
14619
|
]);
|
|
14636
14620
|
nt(() => y(), [y]);
|
|
14637
|
-
const [E,
|
|
14621
|
+
const [E, S] = f.useState();
|
|
14638
14622
|
nt(() => {
|
|
14639
|
-
u &&
|
|
14623
|
+
u && S(window.getComputedStyle(u).zIndex);
|
|
14640
14624
|
}, [u]);
|
|
14641
14625
|
const T = f.useCallback(
|
|
14642
|
-
(
|
|
14643
|
-
|
|
14626
|
+
(C) => {
|
|
14627
|
+
C && x.current === !0 && (y(), w == null || w(), x.current = !1);
|
|
14644
14628
|
},
|
|
14645
14629
|
[y, w]
|
|
14646
14630
|
);
|
|
@@ -15213,10 +15197,10 @@ const LT = {
|
|
|
15213
15197
|
};
|
|
15214
15198
|
function TR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
15215
15199
|
const [r, o] = de(!1), [s, i] = de(!1), [a, c] = de(e), [u, d] = de(!1), { toast: h } = na();
|
|
15216
|
-
|
|
15200
|
+
ze(() => {
|
|
15217
15201
|
const p = JSON.stringify(a) !== JSON.stringify(e);
|
|
15218
15202
|
d(p);
|
|
15219
|
-
}, [a, e]),
|
|
15203
|
+
}, [a, e]), ze(() => {
|
|
15220
15204
|
c(e);
|
|
15221
15205
|
}, [e]);
|
|
15222
15206
|
const m = () => {
|