teodor-new-chat-ui 3.0.8 → 3.0.10
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 +685 -682
- package/dist/index.umd.js +10 -10
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -18,11 +18,11 @@ function Ma(e, t) {
|
|
|
18
18
|
const { toString: Pd } = Object.prototype, { getPrototypeOf: Uo } = Object, { iterator: fr, toStringTag: Da } = Symbol, pr = /* @__PURE__ */ ((e) => (t) => {
|
|
19
19
|
const n = Pd.call(t);
|
|
20
20
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
21
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
21
|
+
})(/* @__PURE__ */ Object.create(null)), je = (e) => (e = e.toLowerCase(), (t) => pr(t) === e), hr = (e) => (t) => typeof t === e, { isArray: Wt } = Array, $t = hr("undefined");
|
|
22
22
|
function pn(e) {
|
|
23
23
|
return e !== null && !$t(e) && e.constructor !== null && !$t(e.constructor) && Pe(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
24
24
|
}
|
|
25
|
-
const La =
|
|
25
|
+
const La = je("ArrayBuffer");
|
|
26
26
|
function Id(e) {
|
|
27
27
|
let t;
|
|
28
28
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && La(e.buffer), t;
|
|
@@ -40,11 +40,11 @@ const _d = hr("string"), Pe = hr("function"), Fa = hr("number"), hn = (e) => e !
|
|
|
40
40
|
} catch {
|
|
41
41
|
return !1;
|
|
42
42
|
}
|
|
43
|
-
}, Md =
|
|
43
|
+
}, Md = je("Date"), Dd = je("File"), Ld = je("Blob"), Fd = je("FileList"), $d = (e) => hn(e) && Pe(e.pipe), Bd = (e) => {
|
|
44
44
|
let t;
|
|
45
45
|
return e && (typeof FormData == "function" && e instanceof FormData || Pe(e.append) && ((t = pr(e)) === "formdata" || // detect form-data instance
|
|
46
46
|
t === "object" && Pe(e.toString) && e.toString() === "[object FormData]"));
|
|
47
|
-
}, Ud =
|
|
47
|
+
}, Ud = je("URLSearchParams"), [Hd, zd, Wd, jd] = ["ReadableStream", "Request", "Response", "Headers"].map(je), Vd = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
48
48
|
function mn(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
49
49
|
if (e === null || typeof e > "u")
|
|
50
50
|
return;
|
|
@@ -124,12 +124,12 @@ const Kd = (e, t, n, { allOwnKeys: r } = {}) => (mn(t, (o, s) => {
|
|
|
124
124
|
for (; (n = e.exec(t)) !== null; )
|
|
125
125
|
r.push(n);
|
|
126
126
|
return r;
|
|
127
|
-
}, tf =
|
|
127
|
+
}, tf = je("HTMLFormElement"), nf = (e) => e.toLowerCase().replace(
|
|
128
128
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
129
129
|
function(n, r, o) {
|
|
130
130
|
return r.toUpperCase() + o;
|
|
131
131
|
}
|
|
132
|
-
), _s = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), rf =
|
|
132
|
+
), _s = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), rf = je("RegExp"), Ua = (e, t) => {
|
|
133
133
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
134
134
|
mn(n, (o, s) => {
|
|
135
135
|
let a;
|
|
@@ -181,7 +181,7 @@ const uf = (e) => {
|
|
|
181
181
|
return r;
|
|
182
182
|
};
|
|
183
183
|
return n(e, 0);
|
|
184
|
-
}, df =
|
|
184
|
+
}, df = je("AsyncFunction"), ff = (e) => e && (hn(e) || Pe(e)) && Pe(e.then) && Pe(e.catch), Ha = ((e, t) => e ? setImmediate : t ? ((n, r) => (bt.addEventListener("message", ({ source: o, data: s }) => {
|
|
185
185
|
o === bt && s === n && r.length && r.shift()();
|
|
186
186
|
}, !1), (o) => {
|
|
187
187
|
r.push(o), bt.postMessage(n, "*");
|
|
@@ -203,7 +203,7 @@ const uf = (e) => {
|
|
|
203
203
|
isReadableStream: Hd,
|
|
204
204
|
isRequest: zd,
|
|
205
205
|
isResponse: Wd,
|
|
206
|
-
isHeaders:
|
|
206
|
+
isHeaders: jd,
|
|
207
207
|
isUndefined: $t,
|
|
208
208
|
isDate: Md,
|
|
209
209
|
isFile: Dd,
|
|
@@ -217,12 +217,12 @@ const uf = (e) => {
|
|
|
217
217
|
forEach: mn,
|
|
218
218
|
merge: ho,
|
|
219
219
|
extend: Kd,
|
|
220
|
-
trim:
|
|
220
|
+
trim: Vd,
|
|
221
221
|
stripBOM: Gd,
|
|
222
222
|
inherits: qd,
|
|
223
223
|
toFlatObject: Xd,
|
|
224
224
|
kindOf: pr,
|
|
225
|
-
kindOfTest:
|
|
225
|
+
kindOfTest: je,
|
|
226
226
|
endsWith: Yd,
|
|
227
227
|
toArray: Jd,
|
|
228
228
|
forEachEntry: Qd,
|
|
@@ -304,12 +304,12 @@ const mf = null;
|
|
|
304
304
|
function mo(e) {
|
|
305
305
|
return S.isPlainObject(e) || S.isArray(e);
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function ja(e) {
|
|
308
308
|
return S.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
309
309
|
}
|
|
310
310
|
function Os(e, t, n) {
|
|
311
311
|
return e ? e.concat(t).map(function(o, s) {
|
|
312
|
-
return o =
|
|
312
|
+
return o = ja(o), !n && s ? "[" + o + "]" : o;
|
|
313
313
|
}).join(n ? "." : "") : t;
|
|
314
314
|
}
|
|
315
315
|
function gf(e) {
|
|
@@ -325,8 +325,8 @@ function mr(e, t, n) {
|
|
|
325
325
|
metaTokens: !0,
|
|
326
326
|
dots: !1,
|
|
327
327
|
indexes: !1
|
|
328
|
-
}, !1, function(
|
|
329
|
-
return !S.isUndefined(b[
|
|
328
|
+
}, !1, function(m, b) {
|
|
329
|
+
return !S.isUndefined(b[m]);
|
|
330
330
|
});
|
|
331
331
|
const r = n.metaTokens, o = n.visitor || d, s = n.dots, a = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && S.isSpecCompliantForm(t);
|
|
332
332
|
if (!S.isFunction(o))
|
|
@@ -341,39 +341,39 @@ function mr(e, t, n) {
|
|
|
341
341
|
throw new ne("Blob is not supported. Use a Buffer instead.");
|
|
342
342
|
return S.isArrayBuffer(g) || S.isTypedArray(g) ? l && typeof Blob == "function" ? new Blob([g]) : Buffer.from(g) : g;
|
|
343
343
|
}
|
|
344
|
-
function d(g,
|
|
344
|
+
function d(g, m, b) {
|
|
345
345
|
let w = g;
|
|
346
346
|
if (g && !b && typeof g == "object") {
|
|
347
|
-
if (S.endsWith(
|
|
348
|
-
|
|
349
|
-
else if (S.isArray(g) && gf(g) || (S.isFileList(g) || S.endsWith(
|
|
350
|
-
return
|
|
347
|
+
if (S.endsWith(m, "{}"))
|
|
348
|
+
m = r ? m : m.slice(0, -2), g = JSON.stringify(g);
|
|
349
|
+
else if (S.isArray(g) && gf(g) || (S.isFileList(g) || S.endsWith(m, "[]")) && (w = S.toArray(g)))
|
|
350
|
+
return m = ja(m), w.forEach(function(y, C) {
|
|
351
351
|
!(S.isUndefined(y) || y === null) && t.append(
|
|
352
352
|
// eslint-disable-next-line no-nested-ternary
|
|
353
|
-
a === !0 ? Os([
|
|
353
|
+
a === !0 ? Os([m], C, s) : a === null ? m : m + "[]",
|
|
354
354
|
f(y)
|
|
355
355
|
);
|
|
356
356
|
}), !1;
|
|
357
357
|
}
|
|
358
|
-
return mo(g) ? !0 : (t.append(Os(b,
|
|
358
|
+
return mo(g) ? !0 : (t.append(Os(b, m, s), f(g)), !1);
|
|
359
359
|
}
|
|
360
|
-
const p = [],
|
|
360
|
+
const p = [], h = Object.assign(bf, {
|
|
361
361
|
defaultVisitor: d,
|
|
362
362
|
convertValue: f,
|
|
363
363
|
isVisitable: mo
|
|
364
364
|
});
|
|
365
|
-
function v(g,
|
|
365
|
+
function v(g, m) {
|
|
366
366
|
if (!S.isUndefined(g)) {
|
|
367
367
|
if (p.indexOf(g) !== -1)
|
|
368
|
-
throw Error("Circular reference detected in " +
|
|
368
|
+
throw Error("Circular reference detected in " + m.join("."));
|
|
369
369
|
p.push(g), S.forEach(g, function(w, x) {
|
|
370
370
|
(!(S.isUndefined(w) || w === null) && o.call(
|
|
371
371
|
t,
|
|
372
372
|
w,
|
|
373
373
|
S.isString(x) ? x.trim() : x,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
)) === !0 && v(w,
|
|
374
|
+
m,
|
|
375
|
+
h
|
|
376
|
+
)) === !0 && v(w, m ? m.concat(x) : [x]);
|
|
377
377
|
}), p.pop();
|
|
378
378
|
}
|
|
379
379
|
}
|
|
@@ -398,11 +398,11 @@ function ks(e) {
|
|
|
398
398
|
function Ho(e, t) {
|
|
399
399
|
this._pairs = [], e && mr(e, this, t);
|
|
400
400
|
}
|
|
401
|
-
const
|
|
402
|
-
|
|
401
|
+
const Va = Ho.prototype;
|
|
402
|
+
Va.append = function(t, n) {
|
|
403
403
|
this._pairs.push([t, n]);
|
|
404
404
|
};
|
|
405
|
-
|
|
405
|
+
Va.toString = function(t) {
|
|
406
406
|
const n = t ? function(r) {
|
|
407
407
|
return t.call(this, r, ks);
|
|
408
408
|
} : ks;
|
|
@@ -660,7 +660,7 @@ function kf(e) {
|
|
|
660
660
|
return t;
|
|
661
661
|
}
|
|
662
662
|
const Mf = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
663
|
-
function
|
|
663
|
+
function Vr(e, t, n, r, o) {
|
|
664
664
|
if (S.isFunction(r))
|
|
665
665
|
return r.call(this, t, n);
|
|
666
666
|
if (o && (t = n), !!S.isString(t)) {
|
|
@@ -734,7 +734,7 @@ let Ie = class {
|
|
|
734
734
|
has(t, n) {
|
|
735
735
|
if (t = Jt(t), t) {
|
|
736
736
|
const r = S.findKey(this, t);
|
|
737
|
-
return !!(r && this[r] !== void 0 && (!n ||
|
|
737
|
+
return !!(r && this[r] !== void 0 && (!n || Vr(this, this[r], r, n)));
|
|
738
738
|
}
|
|
739
739
|
return !1;
|
|
740
740
|
}
|
|
@@ -744,7 +744,7 @@ let Ie = class {
|
|
|
744
744
|
function s(a) {
|
|
745
745
|
if (a = Jt(a), a) {
|
|
746
746
|
const i = S.findKey(r, a);
|
|
747
|
-
i && (!n ||
|
|
747
|
+
i && (!n || Vr(r, r[i], i, n)) && (delete r[i], o = !0);
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
return S.isArray(t) ? t.forEach(s) : s(t), o;
|
|
@@ -754,7 +754,7 @@ let Ie = class {
|
|
|
754
754
|
let r = n.length, o = !1;
|
|
755
755
|
for (; r--; ) {
|
|
756
756
|
const s = n[r];
|
|
757
|
-
(!t ||
|
|
757
|
+
(!t || Vr(this, this[s], s, t, !0)) && (delete this[s], o = !0);
|
|
758
758
|
}
|
|
759
759
|
return o;
|
|
760
760
|
}
|
|
@@ -831,10 +831,10 @@ function Kr(e, t) {
|
|
|
831
831
|
function Xa(e) {
|
|
832
832
|
return !!(e && e.__CANCEL__);
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function jt(e, t, n) {
|
|
835
835
|
ne.call(this, e ?? "canceled", ne.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
836
836
|
}
|
|
837
|
-
S.inherits(
|
|
837
|
+
S.inherits(jt, ne, {
|
|
838
838
|
__CANCEL__: !0
|
|
839
839
|
});
|
|
840
840
|
function Ya(e, t, n) {
|
|
@@ -858,13 +858,13 @@ function $f(e, t) {
|
|
|
858
858
|
return t = t !== void 0 ? t : 1e3, function(l) {
|
|
859
859
|
const f = Date.now(), d = r[s];
|
|
860
860
|
a || (a = f), n[o] = l, r[o] = f;
|
|
861
|
-
let p = s,
|
|
861
|
+
let p = s, h = 0;
|
|
862
862
|
for (; p !== o; )
|
|
863
|
-
|
|
863
|
+
h += n[p++], p = p % e;
|
|
864
864
|
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), f - a < t)
|
|
865
865
|
return;
|
|
866
866
|
const v = d && f - d;
|
|
867
|
-
return v ? Math.round(
|
|
867
|
+
return v ? Math.round(h * 1e3 / v) : void 0;
|
|
868
868
|
};
|
|
869
869
|
}
|
|
870
870
|
function Bf(e, t) {
|
|
@@ -949,14 +949,14 @@ const $s = (e) => e instanceof Ie ? { ...e } : e;
|
|
|
949
949
|
function wt(e, t) {
|
|
950
950
|
t = t || {};
|
|
951
951
|
const n = {};
|
|
952
|
-
function r(f, d, p,
|
|
953
|
-
return S.isPlainObject(f) && S.isPlainObject(d) ? S.merge.call({ caseless:
|
|
952
|
+
function r(f, d, p, h) {
|
|
953
|
+
return S.isPlainObject(f) && S.isPlainObject(d) ? S.merge.call({ caseless: h }, f, d) : S.isPlainObject(d) ? S.merge({}, d) : S.isArray(d) ? d.slice() : d;
|
|
954
954
|
}
|
|
955
|
-
function o(f, d, p,
|
|
955
|
+
function o(f, d, p, h) {
|
|
956
956
|
if (S.isUndefined(d)) {
|
|
957
957
|
if (!S.isUndefined(f))
|
|
958
|
-
return r(void 0, f, p,
|
|
959
|
-
} else return r(f, d, p,
|
|
958
|
+
return r(void 0, f, p, h);
|
|
959
|
+
} else return r(f, d, p, h);
|
|
960
960
|
}
|
|
961
961
|
function s(f, d) {
|
|
962
962
|
if (!S.isUndefined(d))
|
|
@@ -1006,8 +1006,8 @@ function wt(e, t) {
|
|
|
1006
1006
|
headers: (f, d, p) => o($s(f), $s(d), p, !0)
|
|
1007
1007
|
};
|
|
1008
1008
|
return S.forEach(Object.keys({ ...e, ...t }), function(d) {
|
|
1009
|
-
const p = l[d] || o,
|
|
1010
|
-
S.isUndefined(
|
|
1009
|
+
const p = l[d] || o, h = p(e[d], t[d], d);
|
|
1010
|
+
S.isUndefined(h) && p !== i || (n[d] = h);
|
|
1011
1011
|
}), n;
|
|
1012
1012
|
}
|
|
1013
1013
|
const Za = (e) => {
|
|
@@ -1031,13 +1031,13 @@ const Za = (e) => {
|
|
|
1031
1031
|
l && a.set(o, l);
|
|
1032
1032
|
}
|
|
1033
1033
|
return t;
|
|
1034
|
-
},
|
|
1034
|
+
}, jf = typeof XMLHttpRequest < "u", Vf = jf && function(e) {
|
|
1035
1035
|
return new Promise(function(n, r) {
|
|
1036
1036
|
const o = Za(e);
|
|
1037
1037
|
let s = o.data;
|
|
1038
1038
|
const a = Ie.from(o.headers).normalize();
|
|
1039
|
-
let { responseType: i, onUploadProgress: l, onDownloadProgress: f } = o, d, p,
|
|
1040
|
-
function
|
|
1039
|
+
let { responseType: i, onUploadProgress: l, onDownloadProgress: f } = o, d, p, h, v, g;
|
|
1040
|
+
function m() {
|
|
1041
1041
|
v && v(), g && g(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
|
|
1042
1042
|
}
|
|
1043
1043
|
let b = new XMLHttpRequest();
|
|
@@ -1056,9 +1056,9 @@ const Za = (e) => {
|
|
|
1056
1056
|
request: b
|
|
1057
1057
|
};
|
|
1058
1058
|
Ya(function(N) {
|
|
1059
|
-
n(N),
|
|
1059
|
+
n(N), m();
|
|
1060
1060
|
}, function(N) {
|
|
1061
|
-
r(N),
|
|
1061
|
+
r(N), m();
|
|
1062
1062
|
}, R), b = null;
|
|
1063
1063
|
}
|
|
1064
1064
|
"onloadend" in b ? b.onloadend = w : b.onreadystatechange = function() {
|
|
@@ -1079,8 +1079,8 @@ const Za = (e) => {
|
|
|
1079
1079
|
)), b = null;
|
|
1080
1080
|
}, s === void 0 && a.setContentType(null), "setRequestHeader" in b && S.forEach(a.toJSON(), function(C, R) {
|
|
1081
1081
|
b.setRequestHeader(R, C);
|
|
1082
|
-
}), S.isUndefined(o.withCredentials) || (b.withCredentials = !!o.withCredentials), i && i !== "json" && (b.responseType = o.responseType), f && ([
|
|
1083
|
-
b && (r(!y || y.type ? new
|
|
1082
|
+
}), S.isUndefined(o.withCredentials) || (b.withCredentials = !!o.withCredentials), i && i !== "json" && (b.responseType = o.responseType), f && ([h, g] = Zn(f, !0), b.addEventListener("progress", h)), l && b.upload && ([p, v] = Zn(l), b.upload.addEventListener("progress", p), b.upload.addEventListener("loadend", v)), (o.cancelToken || o.signal) && (d = (y) => {
|
|
1083
|
+
b && (r(!y || y.type ? new jt(null, e, b) : y), b.abort(), b = null);
|
|
1084
1084
|
}, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
|
|
1085
1085
|
const x = Ff(o.url);
|
|
1086
1086
|
if (x && Se.protocols.indexOf(x) === -1) {
|
|
@@ -1097,7 +1097,7 @@ const Za = (e) => {
|
|
|
1097
1097
|
if (!o) {
|
|
1098
1098
|
o = !0, i();
|
|
1099
1099
|
const d = f instanceof Error ? f : this.reason;
|
|
1100
|
-
r.abort(d instanceof ne ? d : new
|
|
1100
|
+
r.abort(d instanceof ne ? d : new jt(d instanceof Error ? d.message : d));
|
|
1101
1101
|
}
|
|
1102
1102
|
};
|
|
1103
1103
|
let a = t && setTimeout(() => {
|
|
@@ -1155,8 +1155,8 @@ const Za = (e) => {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
let p = d.byteLength;
|
|
1157
1157
|
if (n) {
|
|
1158
|
-
let
|
|
1159
|
-
n(
|
|
1158
|
+
let h = s += p;
|
|
1159
|
+
n(h);
|
|
1160
1160
|
}
|
|
1161
1161
|
l.enqueue(new Uint8Array(d));
|
|
1162
1162
|
} catch (f) {
|
|
@@ -1188,28 +1188,28 @@ const Za = (e) => {
|
|
|
1188
1188
|
const { fetch: t, Request: n, Response: r } = e, o = t ? An(t) : typeof fetch == "function", s = An(n), a = An(r);
|
|
1189
1189
|
if (!o)
|
|
1190
1190
|
return !1;
|
|
1191
|
-
const i = o && An(Hs), l = o && (typeof zs == "function" ? /* @__PURE__ */ ((g) => (
|
|
1191
|
+
const i = o && An(Hs), l = o && (typeof zs == "function" ? /* @__PURE__ */ ((g) => (m) => g.encode(m))(new zs()) : async (g) => new Uint8Array(await new n(g).arrayBuffer())), f = s && i && Ws(() => {
|
|
1192
1192
|
let g = !1;
|
|
1193
|
-
const
|
|
1193
|
+
const m = new n(Se.origin, {
|
|
1194
1194
|
body: new Hs(),
|
|
1195
1195
|
method: "POST",
|
|
1196
1196
|
get duplex() {
|
|
1197
1197
|
return g = !0, "half";
|
|
1198
1198
|
}
|
|
1199
1199
|
}).headers.has("Content-Type");
|
|
1200
|
-
return g && !
|
|
1200
|
+
return g && !m;
|
|
1201
1201
|
}), d = a && i && Ws(() => S.isReadableStream(new r("").body)), p = {
|
|
1202
1202
|
stream: d && ((g) => g.body)
|
|
1203
1203
|
};
|
|
1204
1204
|
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((g) => {
|
|
1205
|
-
!p[g] && (p[g] = (
|
|
1206
|
-
let w =
|
|
1205
|
+
!p[g] && (p[g] = (m, b) => {
|
|
1206
|
+
let w = m && m[g];
|
|
1207
1207
|
if (w)
|
|
1208
|
-
return w.call(
|
|
1208
|
+
return w.call(m);
|
|
1209
1209
|
throw new ne(`Response type '${g}' is not supported`, ne.ERR_NOT_SUPPORT, b);
|
|
1210
1210
|
});
|
|
1211
1211
|
});
|
|
1212
|
-
const
|
|
1212
|
+
const h = async (g) => {
|
|
1213
1213
|
if (g == null)
|
|
1214
1214
|
return 0;
|
|
1215
1215
|
if (S.isBlob(g))
|
|
@@ -1223,13 +1223,13 @@ const Za = (e) => {
|
|
|
1223
1223
|
return g.byteLength;
|
|
1224
1224
|
if (S.isURLSearchParams(g) && (g = g + ""), S.isString(g))
|
|
1225
1225
|
return (await l(g)).byteLength;
|
|
1226
|
-
}, v = async (g,
|
|
1226
|
+
}, v = async (g, m) => {
|
|
1227
1227
|
const b = S.toFiniteNumber(g.getContentLength());
|
|
1228
|
-
return b ?? m
|
|
1228
|
+
return b ?? h(m);
|
|
1229
1229
|
};
|
|
1230
1230
|
return async (g) => {
|
|
1231
1231
|
let {
|
|
1232
|
-
url:
|
|
1232
|
+
url: m,
|
|
1233
1233
|
method: b,
|
|
1234
1234
|
data: w,
|
|
1235
1235
|
signal: x,
|
|
@@ -1250,17 +1250,17 @@ const Za = (e) => {
|
|
|
1250
1250
|
let H;
|
|
1251
1251
|
try {
|
|
1252
1252
|
if (_ && f && b !== "get" && b !== "head" && (H = await v(k, w)) !== 0) {
|
|
1253
|
-
let q = new n(
|
|
1253
|
+
let q = new n(m, {
|
|
1254
1254
|
method: "POST",
|
|
1255
1255
|
body: w,
|
|
1256
1256
|
duplex: "half"
|
|
1257
|
-
}),
|
|
1258
|
-
if (S.isFormData(w) && (
|
|
1259
|
-
const [F,
|
|
1257
|
+
}), ae;
|
|
1258
|
+
if (S.isFormData(w) && (ae = q.headers.get("content-type")) && k.setContentType(ae), q.body) {
|
|
1259
|
+
const [F, j] = Ls(
|
|
1260
1260
|
H,
|
|
1261
1261
|
Zn(Fs(_))
|
|
1262
1262
|
);
|
|
1263
|
-
w = Bs(q.body, Us, F,
|
|
1263
|
+
w = Bs(q.body, Us, F, j);
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
1266
|
S.isString(L) || (L = L ? "include" : "omit");
|
|
@@ -1273,29 +1273,29 @@ const Za = (e) => {
|
|
|
1273
1273
|
duplex: "half",
|
|
1274
1274
|
credentials: O ? L : void 0
|
|
1275
1275
|
};
|
|
1276
|
-
B = s && new n(
|
|
1277
|
-
let D = await (s ? $(B, I) : $(
|
|
1276
|
+
B = s && new n(m, G);
|
|
1277
|
+
let D = await (s ? $(B, I) : $(m, G));
|
|
1278
1278
|
const T = d && (N === "stream" || N === "response");
|
|
1279
1279
|
if (d && (R || T && M)) {
|
|
1280
1280
|
const q = {};
|
|
1281
1281
|
["status", "statusText", "headers"].forEach((ce) => {
|
|
1282
1282
|
q[ce] = D[ce];
|
|
1283
1283
|
});
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1284
|
+
const ae = S.toFiniteNumber(D.headers.get("content-length")), [F, j] = R && Ls(
|
|
1285
|
+
ae,
|
|
1286
1286
|
Zn(Fs(R), !0)
|
|
1287
1287
|
) || [];
|
|
1288
1288
|
D = new r(
|
|
1289
1289
|
Bs(D.body, Us, F, () => {
|
|
1290
|
-
|
|
1290
|
+
j && j(), M && M();
|
|
1291
1291
|
}),
|
|
1292
1292
|
q
|
|
1293
1293
|
);
|
|
1294
1294
|
}
|
|
1295
1295
|
N = N || "text";
|
|
1296
1296
|
let Q = await p[S.findKey(p, N) || "text"](D, g);
|
|
1297
|
-
return !T && M && M(), await new Promise((q,
|
|
1298
|
-
Ya(q,
|
|
1297
|
+
return !T && M && M(), await new Promise((q, ae) => {
|
|
1298
|
+
Ya(q, ae, {
|
|
1299
1299
|
data: Q,
|
|
1300
1300
|
headers: Ie.from(D.headers),
|
|
1301
1301
|
status: D.status,
|
|
@@ -1328,7 +1328,7 @@ const Za = (e) => {
|
|
|
1328
1328
|
Qa();
|
|
1329
1329
|
const bo = {
|
|
1330
1330
|
http: mf,
|
|
1331
|
-
xhr:
|
|
1331
|
+
xhr: Vf,
|
|
1332
1332
|
fetch: {
|
|
1333
1333
|
get: Qa
|
|
1334
1334
|
}
|
|
@@ -1342,7 +1342,7 @@ S.forEach(bo, (e, t) => {
|
|
|
1342
1342
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1343
1343
|
}
|
|
1344
1344
|
});
|
|
1345
|
-
const
|
|
1345
|
+
const js = (e) => `- ${e}`, Qf = (e) => S.isFunction(e) || e === null || e === !1, ei = {
|
|
1346
1346
|
getAdapter: (e, t) => {
|
|
1347
1347
|
e = S.isArray(e) ? e : [e];
|
|
1348
1348
|
const { length: n } = e;
|
|
@@ -1362,8 +1362,8 @@ const Vs = (e) => `- ${e}`, Qf = (e) => S.isFunction(e) || e === null || e === !
|
|
|
1362
1362
|
([l, f]) => `adapter ${l} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1363
1363
|
);
|
|
1364
1364
|
let i = n ? a.length > 1 ? `since :
|
|
1365
|
-
` + a.map(
|
|
1366
|
-
`) : " " +
|
|
1365
|
+
` + a.map(js).join(`
|
|
1366
|
+
`) : " " + js(a[0]) : "as no adapter specified";
|
|
1367
1367
|
throw new ne(
|
|
1368
1368
|
"There is no suitable adapter to dispatch the request " + i,
|
|
1369
1369
|
"ERR_NOT_SUPPORT"
|
|
@@ -1375,9 +1375,9 @@ const Vs = (e) => `- ${e}`, Qf = (e) => S.isFunction(e) || e === null || e === !
|
|
|
1375
1375
|
};
|
|
1376
1376
|
function Gr(e) {
|
|
1377
1377
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1378
|
-
throw new
|
|
1378
|
+
throw new jt(null, e);
|
|
1379
1379
|
}
|
|
1380
|
-
function
|
|
1380
|
+
function Vs(e) {
|
|
1381
1381
|
return Gr(e), e.headers = Ie.from(e.headers), e.data = Kr.call(
|
|
1382
1382
|
e,
|
|
1383
1383
|
e.transformRequest
|
|
@@ -1504,37 +1504,37 @@ let vt = class {
|
|
|
1504
1504
|
), n.headers = Ie.concat(a, s);
|
|
1505
1505
|
const i = [];
|
|
1506
1506
|
let l = !0;
|
|
1507
|
-
this.interceptors.request.forEach(function(
|
|
1508
|
-
typeof
|
|
1507
|
+
this.interceptors.request.forEach(function(m) {
|
|
1508
|
+
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (l = l && m.synchronous, i.unshift(m.fulfilled, m.rejected));
|
|
1509
1509
|
});
|
|
1510
1510
|
const f = [];
|
|
1511
|
-
this.interceptors.response.forEach(function(
|
|
1512
|
-
f.push(
|
|
1511
|
+
this.interceptors.response.forEach(function(m) {
|
|
1512
|
+
f.push(m.fulfilled, m.rejected);
|
|
1513
1513
|
});
|
|
1514
|
-
let d, p = 0,
|
|
1514
|
+
let d, p = 0, h;
|
|
1515
1515
|
if (!l) {
|
|
1516
|
-
const g = [
|
|
1517
|
-
for (g.unshift(...i), g.push(...f),
|
|
1516
|
+
const g = [Vs.bind(this), void 0];
|
|
1517
|
+
for (g.unshift(...i), g.push(...f), h = g.length, d = Promise.resolve(n); p < h; )
|
|
1518
1518
|
d = d.then(g[p++], g[p++]);
|
|
1519
1519
|
return d;
|
|
1520
1520
|
}
|
|
1521
|
-
|
|
1521
|
+
h = i.length;
|
|
1522
1522
|
let v = n;
|
|
1523
|
-
for (; p <
|
|
1524
|
-
const g = i[p++],
|
|
1523
|
+
for (; p < h; ) {
|
|
1524
|
+
const g = i[p++], m = i[p++];
|
|
1525
1525
|
try {
|
|
1526
1526
|
v = g(v);
|
|
1527
1527
|
} catch (b) {
|
|
1528
|
-
|
|
1528
|
+
m.call(this, b);
|
|
1529
1529
|
break;
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
try {
|
|
1533
|
-
d =
|
|
1533
|
+
d = Vs.call(this, v);
|
|
1534
1534
|
} catch (g) {
|
|
1535
1535
|
return Promise.reject(g);
|
|
1536
1536
|
}
|
|
1537
|
-
for (p = 0,
|
|
1537
|
+
for (p = 0, h = f.length; p < h; )
|
|
1538
1538
|
d = d.then(f[p++], f[p++]);
|
|
1539
1539
|
return d;
|
|
1540
1540
|
}
|
|
@@ -1592,7 +1592,7 @@ let tp = class ni {
|
|
|
1592
1592
|
r.unsubscribe(s);
|
|
1593
1593
|
}, a;
|
|
1594
1594
|
}, t(function(s, a, i) {
|
|
1595
|
-
r.reason || (r.reason = new
|
|
1595
|
+
r.reason || (r.reason = new jt(s, a, i), n(r.reason));
|
|
1596
1596
|
});
|
|
1597
1597
|
}
|
|
1598
1598
|
/**
|
|
@@ -1725,7 +1725,7 @@ function ri(e) {
|
|
|
1725
1725
|
}
|
|
1726
1726
|
const be = ri(gn);
|
|
1727
1727
|
be.Axios = vt;
|
|
1728
|
-
be.CanceledError =
|
|
1728
|
+
be.CanceledError = jt;
|
|
1729
1729
|
be.CancelToken = tp;
|
|
1730
1730
|
be.isCancel = Xa;
|
|
1731
1731
|
be.VERSION = ti;
|
|
@@ -1931,7 +1931,7 @@ class cp {
|
|
|
1931
1931
|
}
|
|
1932
1932
|
const yt = new cp();
|
|
1933
1933
|
function lp(e = {}) {
|
|
1934
|
-
const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = re(e.token ?? null), s = Te(e.headers ?? {}), [a, i] = re(!1), [l, f] = re(null), [d, p] = re(""), [
|
|
1934
|
+
const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = re(e.token ?? null), s = Te(e.headers ?? {}), [a, i] = re(!1), [l, f] = re(null), [d, p] = re(""), [h, v] = re(null), g = Te(null), m = ve((y) => {
|
|
1935
1935
|
o(y);
|
|
1936
1936
|
}, []), b = ve(() => {
|
|
1937
1937
|
var y;
|
|
@@ -1970,13 +1970,13 @@ function lp(e = {}) {
|
|
|
1970
1970
|
M = { Authorization: `Bearer ${r}` };
|
|
1971
1971
|
else if (typeof window < "u") {
|
|
1972
1972
|
const Q = window.__AUTH_TOKEN__, q = ((L = window.localStorage) == null ? void 0 : L.getItem("authToken")) || null;
|
|
1973
|
-
let
|
|
1973
|
+
let ae = null;
|
|
1974
1974
|
try {
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1975
|
+
const j = (I = window.localStorage) == null ? void 0 : I.getItem("chat-settings");
|
|
1976
|
+
j && (ae = (($ = JSON.parse(j)) == null ? void 0 : $.apiKey) || null);
|
|
1977
1977
|
} catch {
|
|
1978
1978
|
}
|
|
1979
|
-
const F = Q || q ||
|
|
1979
|
+
const F = Q || q || ae || null;
|
|
1980
1980
|
F && (M = { Authorization: `Bearer ${F}` });
|
|
1981
1981
|
}
|
|
1982
1982
|
} catch {
|
|
@@ -1998,9 +1998,9 @@ function lp(e = {}) {
|
|
|
1998
1998
|
throw N && console.debug("[use-chat] non-OK response", H.status, T == null ? void 0 : T.slice(0, 500)), new Error(`stream ${H.status}${T ? ": " + T : ""}`);
|
|
1999
1999
|
}
|
|
2000
2000
|
try {
|
|
2001
|
-
const T = H.headers.get("X-Thread-Id") || H.headers.get("x-thread-id"), Q = H.headers.get("X-Thread-Created") || H.headers.get("x-thread-created"), q = T ?? null,
|
|
2001
|
+
const T = H.headers.get("X-Thread-Id") || H.headers.get("x-thread-id"), Q = H.headers.get("X-Thread-Created") || H.headers.get("x-thread-created"), q = T ?? null, ae = String(Q ?? "").toLowerCase() === "true";
|
|
2002
2002
|
try {
|
|
2003
|
-
(K = R == null ? void 0 : R.onOpen) == null || K.call(R, { threadId: q, created:
|
|
2003
|
+
(K = R == null ? void 0 : R.onOpen) == null || K.call(R, { threadId: q, created: ae });
|
|
2004
2004
|
} catch (F) {
|
|
2005
2005
|
N && console.debug("[use-chat] onOpen handler threw:", F);
|
|
2006
2006
|
}
|
|
@@ -2017,18 +2017,18 @@ function lp(e = {}) {
|
|
|
2017
2017
|
for (; (q = D.indexOf(`
|
|
2018
2018
|
|
|
2019
2019
|
`)) >= 0; ) {
|
|
2020
|
-
const
|
|
2020
|
+
const ae = D.slice(0, q);
|
|
2021
2021
|
D = D.slice(q + 2);
|
|
2022
|
-
const F = dp(
|
|
2022
|
+
const F = dp(ae);
|
|
2023
2023
|
if (!F) continue;
|
|
2024
|
-
let
|
|
2024
|
+
let j;
|
|
2025
2025
|
try {
|
|
2026
|
-
|
|
2026
|
+
j = JSON.parse(F);
|
|
2027
2027
|
} catch {
|
|
2028
2028
|
N && console.debug("[use-chat] skip malformed SSE data:", F == null ? void 0 : F.slice(0, 200));
|
|
2029
2029
|
continue;
|
|
2030
2030
|
}
|
|
2031
|
-
const ce = up(
|
|
2031
|
+
const ce = up(j) ? j.data : j;
|
|
2032
2032
|
if (N && console.debug("[use-chat] event:", ce == null ? void 0 : ce.type, ce), C == null || C(ce), ce.type === "token")
|
|
2033
2033
|
e.autoAppendAssistant !== !1 && p((pe) => pe + ce.content);
|
|
2034
2034
|
else if (ce.type === "message_delta") {
|
|
@@ -2055,11 +2055,11 @@ function lp(e = {}) {
|
|
|
2055
2055
|
isStreaming: a,
|
|
2056
2056
|
error: l,
|
|
2057
2057
|
assistantText: d,
|
|
2058
|
-
lastCheckpointId:
|
|
2058
|
+
lastCheckpointId: h,
|
|
2059
2059
|
stream: x,
|
|
2060
2060
|
stop: b,
|
|
2061
2061
|
clear: w,
|
|
2062
|
-
setToken:
|
|
2062
|
+
setToken: m
|
|
2063
2063
|
};
|
|
2064
2064
|
}
|
|
2065
2065
|
function up(e) {
|
|
@@ -2258,7 +2258,7 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2258
2258
|
authToken: t.apiKey
|
|
2259
2259
|
});
|
|
2260
2260
|
}, [l, t]);
|
|
2261
|
-
const { isStreaming: f, error: d, stream: p, stop:
|
|
2261
|
+
const { isStreaming: f, error: d, stream: p, stop: h, setToken: v } = lp({
|
|
2262
2262
|
baseUrl: l.baseUrl,
|
|
2263
2263
|
token: null,
|
|
2264
2264
|
// we update with setStreamToken below when the API tells us the token
|
|
@@ -2266,11 +2266,11 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2266
2266
|
// any extra headers caller wants
|
|
2267
2267
|
// Ensure the path matches the chat endpoint
|
|
2268
2268
|
streamPath: "/chat/runs/stream"
|
|
2269
|
-
}), [g,
|
|
2269
|
+
}), [g, m] = re(() => typeof l.getAuthToken == "function" ? l.getAuthToken() : null);
|
|
2270
2270
|
ge(() => {
|
|
2271
2271
|
v(typeof l.getAuthToken == "function" ? l.getAuthToken() : null);
|
|
2272
2272
|
const Z = l.onTokenChange((Y) => {
|
|
2273
|
-
|
|
2273
|
+
m(Y), v(Y);
|
|
2274
2274
|
});
|
|
2275
2275
|
return () => {
|
|
2276
2276
|
Z();
|
|
@@ -2294,12 +2294,12 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2294
2294
|
}, [q]), ge(() => {
|
|
2295
2295
|
r == null || r(T);
|
|
2296
2296
|
}, [T, r]);
|
|
2297
|
-
const
|
|
2297
|
+
const ae = Te(null);
|
|
2298
2298
|
ge(() => {
|
|
2299
|
-
o &&
|
|
2299
|
+
o && ae.current !== o && (ae.current = o, j(o).catch(() => {
|
|
2300
2300
|
}));
|
|
2301
2301
|
}, [o]);
|
|
2302
|
-
const F = Te(null),
|
|
2302
|
+
const F = Te(null), j = ve(
|
|
2303
2303
|
async (Z, Y, he) => {
|
|
2304
2304
|
if (F.current !== Z) {
|
|
2305
2305
|
F.current = Z;
|
|
@@ -2329,8 +2329,8 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2329
2329
|
O(Y, "replace");
|
|
2330
2330
|
}, [l, T, O, N]), z = ve(async () => {
|
|
2331
2331
|
if (!T) throw new Error("No active thread");
|
|
2332
|
-
await
|
|
2333
|
-
}, [T,
|
|
2332
|
+
await j(T);
|
|
2333
|
+
}, [T, j]), W = Te(!1);
|
|
2334
2334
|
ge(() => {
|
|
2335
2335
|
const Z = W.current;
|
|
2336
2336
|
if (W.current = f, Z && !f && T) {
|
|
@@ -2352,35 +2352,35 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2352
2352
|
})();
|
|
2353
2353
|
}
|
|
2354
2354
|
}, [f, T, w.lastCheckpointId, l, O, q]);
|
|
2355
|
-
const
|
|
2355
|
+
const oe = ve(async (Z) => {
|
|
2356
2356
|
const Y = await l.createThread(Z);
|
|
2357
|
-
return await q(), await
|
|
2358
|
-
}, [l, q,
|
|
2357
|
+
return await q(), await j(Y.threadId), Y.threadId;
|
|
2358
|
+
}, [l, q, j]), V = ve(async (Z) => {
|
|
2359
2359
|
await l.deleteThread(Z), await q(), T === Z && (Q(null), _([]), L(!1), B(null), H(void 0));
|
|
2360
2360
|
}, [l, q, T, _]), X = ve(async (Z, Y) => {
|
|
2361
2361
|
await l.updateThread(Z, Y), await q();
|
|
2362
2362
|
}, [l, q]), te = ve(async (Z, Y) => {
|
|
2363
2363
|
var En;
|
|
2364
|
-
async function he(
|
|
2364
|
+
async function he(se) {
|
|
2365
2365
|
return await new Promise((xe, Ne) => {
|
|
2366
2366
|
const Be = new FileReader();
|
|
2367
|
-
Be.onload = () => xe(String(Be.result)), Be.onerror = (tt) => Ne(tt), Be.readAsDataURL(
|
|
2367
|
+
Be.onload = () => xe(String(Be.result)), Be.onerror = (tt) => Ne(tt), Be.readAsDataURL(se);
|
|
2368
2368
|
});
|
|
2369
2369
|
}
|
|
2370
|
-
async function Oe(
|
|
2370
|
+
async function Oe(se) {
|
|
2371
2371
|
return await new Promise((xe, Ne) => {
|
|
2372
2372
|
const Be = new FileReader();
|
|
2373
2373
|
Be.onload = () => {
|
|
2374
2374
|
try {
|
|
2375
2375
|
const tt = Be.result;
|
|
2376
2376
|
let Nn = "";
|
|
2377
|
-
const Rn = new Uint8Array(tt),
|
|
2378
|
-
for (let P = 0; P <
|
|
2377
|
+
const Rn = new Uint8Array(tt), jr = Rn.byteLength;
|
|
2378
|
+
for (let P = 0; P < jr; P++) Nn += String.fromCharCode(Rn[P]);
|
|
2379
2379
|
xe(btoa(Nn));
|
|
2380
2380
|
} catch (tt) {
|
|
2381
2381
|
Ne(tt);
|
|
2382
2382
|
}
|
|
2383
|
-
}, Be.onerror = (tt) => Ne(tt), Be.readAsArrayBuffer(
|
|
2383
|
+
}, Be.onerror = (tt) => Ne(tt), Be.readAsArrayBuffer(se);
|
|
2384
2384
|
});
|
|
2385
2385
|
}
|
|
2386
2386
|
const Ce = [];
|
|
@@ -2388,33 +2388,33 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2388
2388
|
const Xt = (Y == null ? void 0 : Y.attachments) || [];
|
|
2389
2389
|
let st = [];
|
|
2390
2390
|
if (Xt.length > 0)
|
|
2391
|
-
for (const
|
|
2392
|
-
if (
|
|
2391
|
+
for (const se of Xt)
|
|
2392
|
+
if (se.type && se.type.startsWith("image/")) {
|
|
2393
2393
|
let xe = null;
|
|
2394
2394
|
try {
|
|
2395
|
-
const Ne = await l.uploadImage(
|
|
2395
|
+
const Ne = await l.uploadImage(se, (t == null ? void 0 : t.uploadPath) || "/upload").catch(() => null);
|
|
2396
2396
|
xe = (Ne == null ? void 0 : Ne.url) || null;
|
|
2397
2397
|
} catch {
|
|
2398
2398
|
}
|
|
2399
2399
|
if (!xe)
|
|
2400
2400
|
try {
|
|
2401
|
-
xe = await he(
|
|
2401
|
+
xe = await he(se);
|
|
2402
2402
|
} catch {
|
|
2403
2403
|
xe = null;
|
|
2404
2404
|
}
|
|
2405
2405
|
if (xe) {
|
|
2406
|
-
const Ne = { type: "image_url", url: xe, mimeType:
|
|
2406
|
+
const Ne = { type: "image_url", url: xe, mimeType: se.type, alt: se.name };
|
|
2407
2407
|
Ce.push(Ne);
|
|
2408
2408
|
}
|
|
2409
2409
|
try {
|
|
2410
|
-
st.push({ filename:
|
|
2410
|
+
st.push({ filename: se.name, data: await Oe(se), mime_type: se.type || "application/octet-stream" });
|
|
2411
2411
|
} catch {
|
|
2412
2412
|
}
|
|
2413
2413
|
} else {
|
|
2414
|
-
const xe = await he(
|
|
2414
|
+
const xe = await he(se).catch(() => null), Ne = { type: "file", url: String(xe), mimeType: se.type || void 0, name: se.name, size: se.size };
|
|
2415
2415
|
Ce.push(Ne);
|
|
2416
2416
|
try {
|
|
2417
|
-
st.push({ filename:
|
|
2417
|
+
st.push({ filename: se.name, data: await Oe(se), mime_type: se.type || "application/octet-stream" });
|
|
2418
2418
|
} catch {
|
|
2419
2419
|
}
|
|
2420
2420
|
}
|
|
@@ -2428,12 +2428,12 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2428
2428
|
C(Tt);
|
|
2429
2429
|
const Hr = {
|
|
2430
2430
|
...Tt,
|
|
2431
|
-
content: Tt.content.filter((
|
|
2431
|
+
content: Tt.content.filter((se) => se.type === "text" || se.type === "image_url")
|
|
2432
2432
|
}, At = { ...(Y == null ? void 0 : Y.payloadExtras) ?? {} }, zr = !!At.edit, Sn = At.originalMessageId, Cn = typeof Sn == "string" ? Sn : void 0, Wr = (Y == null ? void 0 : Y.attachments) && Y.attachments.length > 0, Yt = {
|
|
2433
2433
|
...T ? { threadId: T } : {},
|
|
2434
2434
|
payload: {
|
|
2435
2435
|
messages: [Hr],
|
|
2436
|
-
attachments: Tt.content.filter((
|
|
2436
|
+
attachments: Tt.content.filter((se) => se.type === "file").map((se) => ({ type: "file", url: se.url, mimeType: se.mimeType, name: se.name, size: se.size })),
|
|
2437
2437
|
files_info: st,
|
|
2438
2438
|
...a && Wr && i ? { agent_id: i } : {},
|
|
2439
2439
|
...At
|
|
@@ -2447,11 +2447,11 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2447
2447
|
};
|
|
2448
2448
|
p(
|
|
2449
2449
|
Yt,
|
|
2450
|
-
(
|
|
2450
|
+
(se) => R(se),
|
|
2451
2451
|
{
|
|
2452
|
-
onError: (
|
|
2453
|
-
onOpen: ({ threadId:
|
|
2454
|
-
!T &&
|
|
2452
|
+
onError: (se) => console.warn("stream error", se),
|
|
2453
|
+
onOpen: ({ threadId: se, created: xe }) => {
|
|
2454
|
+
!T && se && (Q(se), xe && q().catch(() => {
|
|
2455
2455
|
}));
|
|
2456
2456
|
}
|
|
2457
2457
|
}
|
|
@@ -2498,12 +2498,12 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2498
2498
|
navigateToCheckpoint: pe,
|
|
2499
2499
|
returnToLatest: z,
|
|
2500
2500
|
refreshThreads: q,
|
|
2501
|
-
createThread:
|
|
2502
|
-
deleteThread:
|
|
2501
|
+
createThread: oe,
|
|
2502
|
+
deleteThread: V,
|
|
2503
2503
|
renameThread: X,
|
|
2504
|
-
loadThread:
|
|
2504
|
+
loadThread: j,
|
|
2505
2505
|
send: te,
|
|
2506
|
-
stop:
|
|
2506
|
+
stop: h
|
|
2507
2507
|
};
|
|
2508
2508
|
return /* @__PURE__ */ c(si.Provider, { value: de, children: e });
|
|
2509
2509
|
}
|
|
@@ -2603,20 +2603,20 @@ function xp(e, t) {
|
|
|
2603
2603
|
}
|
|
2604
2604
|
return [r, o];
|
|
2605
2605
|
}
|
|
2606
|
-
function
|
|
2606
|
+
function Ve(e, t = []) {
|
|
2607
2607
|
let n = [];
|
|
2608
2608
|
function r(s, a) {
|
|
2609
2609
|
const i = u.createContext(a), l = n.length;
|
|
2610
2610
|
n = [...n, a];
|
|
2611
2611
|
const f = (p) => {
|
|
2612
2612
|
var w;
|
|
2613
|
-
const { scope:
|
|
2614
|
-
return /* @__PURE__ */ c(
|
|
2613
|
+
const { scope: h, children: v, ...g } = p, m = ((w = h == null ? void 0 : h[e]) == null ? void 0 : w[l]) || i, b = u.useMemo(() => g, Object.values(g));
|
|
2614
|
+
return /* @__PURE__ */ c(m.Provider, { value: b, children: v });
|
|
2615
2615
|
};
|
|
2616
2616
|
f.displayName = s + "Provider";
|
|
2617
|
-
function d(p,
|
|
2618
|
-
var
|
|
2619
|
-
const v = ((
|
|
2617
|
+
function d(p, h) {
|
|
2618
|
+
var m;
|
|
2619
|
+
const v = ((m = h == null ? void 0 : h[e]) == null ? void 0 : m[l]) || i, g = u.useContext(v);
|
|
2620
2620
|
if (g) return g;
|
|
2621
2621
|
if (a !== void 0) return a;
|
|
2622
2622
|
throw new Error(`\`${p}\` must be used within \`${s}\``);
|
|
@@ -2679,8 +2679,8 @@ function ut({
|
|
|
2679
2679
|
(d) => {
|
|
2680
2680
|
var p;
|
|
2681
2681
|
if (i) {
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2682
|
+
const h = Np(d) ? d(e) : d;
|
|
2683
|
+
h !== e && ((p = a.current) == null || p.call(a, h));
|
|
2684
2684
|
} else
|
|
2685
2685
|
s(d);
|
|
2686
2686
|
},
|
|
@@ -2783,25 +2783,25 @@ function Ap(e) {
|
|
|
2783
2783
|
}, [i]), we(() => {
|
|
2784
2784
|
const f = r.current, d = o.current;
|
|
2785
2785
|
if (d !== e) {
|
|
2786
|
-
const
|
|
2787
|
-
e ? l("MOUNT") : v === "none" || (f == null ? void 0 : f.display) === "none" ? l("UNMOUNT") : l(d &&
|
|
2786
|
+
const h = s.current, v = In(f);
|
|
2787
|
+
e ? l("MOUNT") : v === "none" || (f == null ? void 0 : f.display) === "none" ? l("UNMOUNT") : l(d && h !== v ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
2788
2788
|
}
|
|
2789
2789
|
}, [e, l]), we(() => {
|
|
2790
2790
|
if (t) {
|
|
2791
2791
|
let f;
|
|
2792
2792
|
const d = t.ownerDocument.defaultView ?? window, p = (v) => {
|
|
2793
|
-
const
|
|
2794
|
-
if (v.target === t &&
|
|
2793
|
+
const m = In(r.current).includes(CSS.escape(v.animationName));
|
|
2794
|
+
if (v.target === t && m && (l("ANIMATION_END"), !o.current)) {
|
|
2795
2795
|
const b = t.style.animationFillMode;
|
|
2796
2796
|
t.style.animationFillMode = "forwards", f = d.setTimeout(() => {
|
|
2797
2797
|
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = b);
|
|
2798
2798
|
});
|
|
2799
2799
|
}
|
|
2800
|
-
},
|
|
2800
|
+
}, h = (v) => {
|
|
2801
2801
|
v.target === t && (s.current = In(r.current));
|
|
2802
2802
|
};
|
|
2803
|
-
return t.addEventListener("animationstart",
|
|
2804
|
-
d.clearTimeout(f), t.removeEventListener("animationstart",
|
|
2803
|
+
return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", p), t.addEventListener("animationend", p), () => {
|
|
2804
|
+
d.clearTimeout(f), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", p), t.removeEventListener("animationend", p);
|
|
2805
2805
|
};
|
|
2806
2806
|
} else
|
|
2807
2807
|
l("ANIMATION_END");
|
|
@@ -2828,7 +2828,7 @@ function He(e) {
|
|
|
2828
2828
|
n((r) => r ?? String(_p++));
|
|
2829
2829
|
}, [e]), t ? `radix-${t}` : "";
|
|
2830
2830
|
}
|
|
2831
|
-
var br = "Collapsible", [Op, Hy] =
|
|
2831
|
+
var br = "Collapsible", [Op, Hy] = Ve(br), [kp, jo] = Op(br), ui = u.forwardRef(
|
|
2832
2832
|
(e, t) => {
|
|
2833
2833
|
const {
|
|
2834
2834
|
__scopeCollapsible: n,
|
|
@@ -2867,7 +2867,7 @@ var br = "Collapsible", [Op, Hy] = je(br), [kp, Vo] = Op(br), ui = u.forwardRef(
|
|
|
2867
2867
|
ui.displayName = br;
|
|
2868
2868
|
var di = "CollapsibleTrigger", fi = u.forwardRef(
|
|
2869
2869
|
(e, t) => {
|
|
2870
|
-
const { __scopeCollapsible: n, ...r } = e, o =
|
|
2870
|
+
const { __scopeCollapsible: n, ...r } = e, o = jo(di, n);
|
|
2871
2871
|
return /* @__PURE__ */ c(
|
|
2872
2872
|
ee.button,
|
|
2873
2873
|
{
|
|
@@ -2885,15 +2885,15 @@ var di = "CollapsibleTrigger", fi = u.forwardRef(
|
|
|
2885
2885
|
}
|
|
2886
2886
|
);
|
|
2887
2887
|
fi.displayName = di;
|
|
2888
|
-
var
|
|
2888
|
+
var Vo = "CollapsibleContent", Mp = u.forwardRef(
|
|
2889
2889
|
(e, t) => {
|
|
2890
|
-
const { forceMount: n, ...r } = e, o = Vo
|
|
2890
|
+
const { forceMount: n, ...r } = e, o = jo(Vo, e.__scopeCollapsible);
|
|
2891
2891
|
return /* @__PURE__ */ c(_e, { present: n || o.open, children: ({ present: s }) => /* @__PURE__ */ c(Dp, { ...r, ref: t, present: s }) });
|
|
2892
2892
|
}
|
|
2893
2893
|
);
|
|
2894
|
-
Mp.displayName =
|
|
2894
|
+
Mp.displayName = Vo;
|
|
2895
2895
|
var Dp = u.forwardRef((e, t) => {
|
|
2896
|
-
const { __scopeCollapsible: n, present: r, children: o, ...s } = e, a = Vo
|
|
2896
|
+
const { __scopeCollapsible: n, present: r, children: o, ...s } = e, a = jo(Vo, n), [i, l] = u.useState(r), f = u.useRef(null), d = ie(t, f), p = u.useRef(0), h = p.current, v = u.useRef(0), g = v.current, m = a.open || i, b = u.useRef(m), w = u.useRef(void 0);
|
|
2897
2897
|
return u.useEffect(() => {
|
|
2898
2898
|
const x = requestAnimationFrame(() => b.current = !1);
|
|
2899
2899
|
return () => cancelAnimationFrame(x);
|
|
@@ -2913,15 +2913,15 @@ var Dp = u.forwardRef((e, t) => {
|
|
|
2913
2913
|
"data-state": Ko(a.open),
|
|
2914
2914
|
"data-disabled": a.disabled ? "" : void 0,
|
|
2915
2915
|
id: a.contentId,
|
|
2916
|
-
hidden: !
|
|
2916
|
+
hidden: !m,
|
|
2917
2917
|
...s,
|
|
2918
2918
|
ref: d,
|
|
2919
2919
|
style: {
|
|
2920
|
-
"--radix-collapsible-content-height":
|
|
2920
|
+
"--radix-collapsible-content-height": h ? `${h}px` : void 0,
|
|
2921
2921
|
"--radix-collapsible-content-width": g ? `${g}px` : void 0,
|
|
2922
2922
|
...e.style
|
|
2923
2923
|
},
|
|
2924
|
-
children:
|
|
2924
|
+
children: m && o
|
|
2925
2925
|
}
|
|
2926
2926
|
);
|
|
2927
2927
|
});
|
|
@@ -2965,9 +2965,9 @@ function _n({ content: e, className: t = "" }) {
|
|
|
2965
2965
|
node: f,
|
|
2966
2966
|
className: d,
|
|
2967
2967
|
children: p,
|
|
2968
|
-
...
|
|
2968
|
+
...h
|
|
2969
2969
|
}) => {
|
|
2970
|
-
const { inline: v, ...g } =
|
|
2970
|
+
const { inline: v, ...g } = h;
|
|
2971
2971
|
return v ? /* @__PURE__ */ c(
|
|
2972
2972
|
"code",
|
|
2973
2973
|
{
|
|
@@ -3024,10 +3024,10 @@ function $p({
|
|
|
3024
3024
|
truncateToolMessages: f = !0,
|
|
3025
3025
|
toolMessagePreviewLength: d = 200,
|
|
3026
3026
|
truncateUserMessages: p = !0,
|
|
3027
|
-
userMessagePreviewLength:
|
|
3027
|
+
userMessagePreviewLength: h = 200,
|
|
3028
3028
|
customStyles: v = {},
|
|
3029
3029
|
onEdit: g,
|
|
3030
|
-
onRegenerate:
|
|
3030
|
+
onRegenerate: m,
|
|
3031
3031
|
onCancelEdit: b,
|
|
3032
3032
|
onCopy: w
|
|
3033
3033
|
}) {
|
|
@@ -3044,7 +3044,7 @@ function $p({
|
|
|
3044
3044
|
default:
|
|
3045
3045
|
return "text-foreground";
|
|
3046
3046
|
}
|
|
3047
|
-
}, [$]), M = gt(() => Bp(e.content), [e.content]), H = gt(() =>
|
|
3047
|
+
}, [$]), M = gt(() => Bp(e.content), [e.content]), H = gt(() => jp(e.content), [e.content]), O = gt(() => e.content.filter((W) => W.type === "image_url"), [e.content]), G = gt(() => e.content.filter((W) => W.type === "file"), [e.content]), D = Kp(M, n ? r : 0), T = async () => {
|
|
3048
3048
|
try {
|
|
3049
3049
|
const W = K ? Pt(e.content) : M;
|
|
3050
3050
|
await navigator.clipboard.writeText(W), y(!0), setTimeout(() => y(!1), 2e3), w == null || w(W);
|
|
@@ -3055,17 +3055,17 @@ function $p({
|
|
|
3055
3055
|
if (!g) return;
|
|
3056
3056
|
const W = K ? Pt(e.content) : M;
|
|
3057
3057
|
g(e.id, W);
|
|
3058
|
-
}, q = () =>
|
|
3059
|
-
const
|
|
3058
|
+
}, q = () => m == null ? void 0 : m(t), ae = () => {
|
|
3059
|
+
const oe = A(I ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", B);
|
|
3060
3060
|
switch ($) {
|
|
3061
3061
|
case "user":
|
|
3062
|
-
return /* @__PURE__ */ c(rd, { className:
|
|
3062
|
+
return /* @__PURE__ */ c(rd, { className: oe });
|
|
3063
3063
|
case "assistant":
|
|
3064
|
-
return /* @__PURE__ */ c(As, { className:
|
|
3064
|
+
return /* @__PURE__ */ c(As, { className: oe });
|
|
3065
3065
|
case "tool":
|
|
3066
|
-
return /* @__PURE__ */ c(nd, { className:
|
|
3066
|
+
return /* @__PURE__ */ c(nd, { className: oe });
|
|
3067
3067
|
default:
|
|
3068
|
-
return /* @__PURE__ */ c(As, { className:
|
|
3068
|
+
return /* @__PURE__ */ c(As, { className: oe });
|
|
3069
3069
|
}
|
|
3070
3070
|
}, F = () => {
|
|
3071
3071
|
const W = "group relative mb-4 flex w-full";
|
|
@@ -3079,7 +3079,7 @@ function $p({
|
|
|
3079
3079
|
default:
|
|
3080
3080
|
return W;
|
|
3081
3081
|
}
|
|
3082
|
-
},
|
|
3082
|
+
}, j = () => {
|
|
3083
3083
|
const W = A(
|
|
3084
3084
|
"rounded-lg px-4 py-3 relative transition-all duration-200 min-w-0 max-w-full break-words",
|
|
3085
3085
|
I && "px-3 py-2 text-sm"
|
|
@@ -3115,60 +3115,60 @@ function $p({
|
|
|
3115
3115
|
}
|
|
3116
3116
|
}, pe = () => {
|
|
3117
3117
|
if (e.model === "reflection") {
|
|
3118
|
-
const
|
|
3118
|
+
const V = M.trim(), X = Zr(V);
|
|
3119
3119
|
if (X && typeof X == "object")
|
|
3120
3120
|
return /* @__PURE__ */ c(Gp, { data: X });
|
|
3121
3121
|
}
|
|
3122
3122
|
if (K && H.name === "get_issues") {
|
|
3123
|
-
const
|
|
3123
|
+
const V = e.content.find((me) => me.type === "tool_result"), X = (V == null ? void 0 : V.output) ?? Pt(e.content), te = hi(X);
|
|
3124
3124
|
if (te) return /* @__PURE__ */ c(qp, { issues: te });
|
|
3125
3125
|
}
|
|
3126
3126
|
if (K && !_) {
|
|
3127
|
-
const
|
|
3127
|
+
const V = Pt(e.content).slice(0, 80).replace(/\s+/g, " ");
|
|
3128
3128
|
return /* @__PURE__ */ c("div", { className: A("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", I && "text-[10px]"), children: /* @__PURE__ */ E("span", { className: "truncate max-w-full text-current", children: [
|
|
3129
|
-
|
|
3130
|
-
|
|
3129
|
+
V,
|
|
3130
|
+
V.length >= 80 ? "…" : ""
|
|
3131
3131
|
] }) });
|
|
3132
3132
|
}
|
|
3133
3133
|
if (K && f) {
|
|
3134
|
-
const
|
|
3134
|
+
const V = Pt(e.content), X = V.length > d;
|
|
3135
3135
|
return /* @__PURE__ */ c(Js, { open: C, onOpenChange: R, children: /* @__PURE__ */ E("div", { className: "font-mono text-sm text-current", children: [
|
|
3136
|
-
/* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words text-current", I && "text-xs"), children: X && !C ?
|
|
3136
|
+
/* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words text-current", I && "text-xs"), children: X && !C ? V.substring(0, d) + "..." : V }),
|
|
3137
3137
|
X && /* @__PURE__ */ c(Zs, { asChild: !0, children: /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children: C ? /* @__PURE__ */ E(Ae, { children: [
|
|
3138
3138
|
/* @__PURE__ */ c(Zt, { className: "h-3 w-3 mr-1" }),
|
|
3139
3139
|
"Show less"
|
|
3140
3140
|
] }) : /* @__PURE__ */ E(Ae, { children: [
|
|
3141
3141
|
/* @__PURE__ */ c(Mt, { className: "h-3 w-3 mr-1" }),
|
|
3142
3142
|
"Show more (",
|
|
3143
|
-
|
|
3143
|
+
V.length - d,
|
|
3144
3144
|
" chars)"
|
|
3145
3145
|
] }) }) })
|
|
3146
3146
|
] }) });
|
|
3147
3147
|
}
|
|
3148
3148
|
if (K && _ && !f) {
|
|
3149
|
-
const
|
|
3150
|
-
if (
|
|
3151
|
-
return /* @__PURE__ */ c(_n, { content:
|
|
3149
|
+
const V = Xp(e.content);
|
|
3150
|
+
if (V && Up(V))
|
|
3151
|
+
return /* @__PURE__ */ c(_n, { content: V.trim() });
|
|
3152
3152
|
const X = Pt(e.content);
|
|
3153
3153
|
return /* @__PURE__ */ c("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words text-current", I && "text-xs"), children: X }) });
|
|
3154
3154
|
}
|
|
3155
|
-
const W = O.length > 0 && $ !== "tool",
|
|
3155
|
+
const W = O.length > 0 && $ !== "tool", oe = G.length > 0 && $ !== "tool";
|
|
3156
3156
|
return /* @__PURE__ */ E("div", { children: [
|
|
3157
3157
|
n ? /* @__PURE__ */ E("div", { className: "relative", children: [
|
|
3158
3158
|
(() => {
|
|
3159
|
-
const
|
|
3160
|
-
return
|
|
3159
|
+
const V = Zr(D);
|
|
3160
|
+
return V !== null ? /* @__PURE__ */ c(Qs, { data: V }) : /* @__PURE__ */ c(_n, { content: zp(Hp(D)) });
|
|
3161
3161
|
})(),
|
|
3162
3162
|
/* @__PURE__ */ c(Fp, { className: A(B, I ? "text-xs" : "text-sm") })
|
|
3163
3163
|
] }) : (() => {
|
|
3164
|
-
const
|
|
3165
|
-
if (
|
|
3164
|
+
const V = Zr(M.trim());
|
|
3165
|
+
if (V !== null) return /* @__PURE__ */ c(Qs, { data: V });
|
|
3166
3166
|
if ($ === "user" && p) {
|
|
3167
3167
|
const X = M.trim();
|
|
3168
|
-
if (X.length >
|
|
3168
|
+
if (X.length > h)
|
|
3169
3169
|
return /* @__PURE__ */ E(Js, { open: k, onOpenChange: L, children: [
|
|
3170
3170
|
/* @__PURE__ */ c("div", { className: A("text-sm text-[hsl(var(--chat-bubble-user-text))]", I && "text-xs"), children: k ? /* @__PURE__ */ c(_n, { content: X }) : /* @__PURE__ */ E("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", I && "text-xs"), children: [
|
|
3171
|
-
X.substring(0,
|
|
3171
|
+
X.substring(0, h),
|
|
3172
3172
|
"..."
|
|
3173
3173
|
] }) }),
|
|
3174
3174
|
/* @__PURE__ */ c(Zs, { asChild: !0, children: /* @__PURE__ */ c(
|
|
@@ -3183,7 +3183,7 @@ function $p({
|
|
|
3183
3183
|
] }) : /* @__PURE__ */ E(Ae, { children: [
|
|
3184
3184
|
/* @__PURE__ */ c(Mt, { className: "h-3 w-3 mr-1" }),
|
|
3185
3185
|
" Show more (",
|
|
3186
|
-
X.length -
|
|
3186
|
+
X.length - h,
|
|
3187
3187
|
" chars)"
|
|
3188
3188
|
] })
|
|
3189
3189
|
}
|
|
@@ -3192,15 +3192,15 @@ function $p({
|
|
|
3192
3192
|
}
|
|
3193
3193
|
return /* @__PURE__ */ c(_n, { content: M.trim() });
|
|
3194
3194
|
})(),
|
|
3195
|
-
W && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-2 gap-2", children: O.map((
|
|
3196
|
-
/* @__PURE__ */ c("img", { src:
|
|
3195
|
+
W && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-2 gap-2", children: O.map((V, X) => /* @__PURE__ */ E("div", { className: "relative border rounded overflow-hidden", children: [
|
|
3196
|
+
/* @__PURE__ */ c("img", { src: V.url, alt: V.alt ?? "image", className: "w-full h-auto" }),
|
|
3197
3197
|
/* @__PURE__ */ E("div", { className: "absolute top-1 right-1 bg-background/70 rounded px-1 py-0.5 text-[10px] flex items-center gap-1", children: [
|
|
3198
3198
|
/* @__PURE__ */ c(od, { className: "h-3 w-3" }),
|
|
3199
3199
|
/* @__PURE__ */ c("span", { children: "image" })
|
|
3200
3200
|
] })
|
|
3201
3201
|
] }, X)) }),
|
|
3202
|
-
|
|
3203
|
-
const te =
|
|
3202
|
+
oe && /* @__PURE__ */ c("div", { className: "mt-2 flex flex-wrap gap-2", children: G.map((V, X) => {
|
|
3203
|
+
const te = V, me = te.name || "file";
|
|
3204
3204
|
return /* @__PURE__ */ E(
|
|
3205
3205
|
"a",
|
|
3206
3206
|
{
|
|
@@ -3224,8 +3224,8 @@ function $p({
|
|
|
3224
3224
|
);
|
|
3225
3225
|
}) })
|
|
3226
3226
|
] });
|
|
3227
|
-
}, z = gt(() =>
|
|
3228
|
-
return /* @__PURE__ */ c("div", { className: A(F(), v.container), children: /* @__PURE__ */ E("div", { className: A(
|
|
3227
|
+
}, z = gt(() => Vp(e), [e]);
|
|
3228
|
+
return /* @__PURE__ */ c("div", { className: A(F(), v.container), children: /* @__PURE__ */ E("div", { className: A(j(), v.content), children: [
|
|
3229
3229
|
(a || i || K) && /* @__PURE__ */ E(
|
|
3230
3230
|
"div",
|
|
3231
3231
|
{
|
|
@@ -3237,7 +3237,7 @@ function $p({
|
|
|
3237
3237
|
),
|
|
3238
3238
|
children: [
|
|
3239
3239
|
/* @__PURE__ */ E("div", { className: "flex items-center gap-2", children: [
|
|
3240
|
-
|
|
3240
|
+
ae(),
|
|
3241
3241
|
i && z && /* @__PURE__ */ c("span", { className: A("font-medium", I ? "text-xs" : "text-sm"), children: z }),
|
|
3242
3242
|
K && H.name && /* @__PURE__ */ E(
|
|
3243
3243
|
ci,
|
|
@@ -3309,7 +3309,7 @@ function $p({
|
|
|
3309
3309
|
children: /* @__PURE__ */ c(Ts, { className: A(B, I ? "h-3 w-3" : "h-4 w-4") })
|
|
3310
3310
|
}
|
|
3311
3311
|
),
|
|
3312
|
-
$ === "assistant" &&
|
|
3312
|
+
$ === "assistant" && m && /* @__PURE__ */ c(
|
|
3313
3313
|
fe,
|
|
3314
3314
|
{
|
|
3315
3315
|
variant: "ghost",
|
|
@@ -3366,7 +3366,7 @@ function $p({
|
|
|
3366
3366
|
children: /* @__PURE__ */ c(Ts, { className: A("text-current", I ? "h-3 w-3" : "h-4 w-4") })
|
|
3367
3367
|
}
|
|
3368
3368
|
),
|
|
3369
|
-
$ === "assistant" &&
|
|
3369
|
+
$ === "assistant" && m && /* @__PURE__ */ c(
|
|
3370
3370
|
fe,
|
|
3371
3371
|
{
|
|
3372
3372
|
variant: "ghost",
|
|
@@ -3467,9 +3467,11 @@ function er(e) {
|
|
|
3467
3467
|
if (typeof e == "string")
|
|
3468
3468
|
return e.length > 2e3 ? e.slice(0, 2e3) + "... [truncated]" : e;
|
|
3469
3469
|
if (e && typeof e == "object") {
|
|
3470
|
-
if (Array.isArray(e))
|
|
3471
|
-
|
|
3472
|
-
return;
|
|
3470
|
+
if (Array.isArray(e)) {
|
|
3471
|
+
const n = e.map(er).filter((r) => r !== void 0);
|
|
3472
|
+
return n.length ? n : void 0;
|
|
3473
|
+
}
|
|
3474
|
+
if (pi(e)) return;
|
|
3473
3475
|
const t = {};
|
|
3474
3476
|
for (const n of Object.keys(e)) {
|
|
3475
3477
|
const r = e[n];
|
|
@@ -3480,7 +3482,7 @@ function er(e) {
|
|
|
3480
3482
|
o !== void 0 && (t[n] = o);
|
|
3481
3483
|
}
|
|
3482
3484
|
}
|
|
3483
|
-
return t;
|
|
3485
|
+
return Object.keys(t).length ? t : void 0;
|
|
3484
3486
|
}
|
|
3485
3487
|
return e;
|
|
3486
3488
|
}
|
|
@@ -3489,19 +3491,19 @@ function nn(e) {
|
|
|
3489
3491
|
if (pi(e)) return "";
|
|
3490
3492
|
try {
|
|
3491
3493
|
const t = er(e);
|
|
3492
|
-
return JSON.stringify(t, null, 2)
|
|
3494
|
+
return t === void 0 ? "" : typeof t == "string" ? t : JSON.stringify(t, null, 2);
|
|
3493
3495
|
} catch {
|
|
3494
3496
|
return "";
|
|
3495
3497
|
}
|
|
3496
3498
|
}
|
|
3497
|
-
function
|
|
3499
|
+
function jp(e) {
|
|
3498
3500
|
const t = e.find((r) => r.type === "tool_call"), n = e.find((r) => r.type === "tool_result");
|
|
3499
3501
|
return {
|
|
3500
3502
|
name: t == null ? void 0 : t.name,
|
|
3501
3503
|
toolCallId: (n == null ? void 0 : n.toolCallId) ?? (t == null ? void 0 : t.id)
|
|
3502
3504
|
};
|
|
3503
3505
|
}
|
|
3504
|
-
function
|
|
3506
|
+
function Vp(e) {
|
|
3505
3507
|
return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
|
|
3506
3508
|
}
|
|
3507
3509
|
function Kp(e, t) {
|
|
@@ -3562,8 +3564,8 @@ function hi(e) {
|
|
|
3562
3564
|
const f = l[1], d = /Issue\(([\s\S]*?)\)(?:,|$)/g;
|
|
3563
3565
|
let p = null;
|
|
3564
3566
|
for (; (p = d.exec(f)) !== null; ) {
|
|
3565
|
-
const
|
|
3566
|
-
n[a].push({ title:
|
|
3567
|
+
const h = p[1], v = /title\s*=\s*(['"])([\s\S]*?)\1/.exec(h), g = /description\s*=\s*(['"])([\s\S]*?)\1/.exec(h), m = v ? v[2].trim() : "", b = g ? g[2].trim() : "";
|
|
3568
|
+
n[a].push({ title: m, description: b });
|
|
3567
3569
|
}
|
|
3568
3570
|
}
|
|
3569
3571
|
return Object.values(n).some((a) => a.length > 0) ? n : null;
|
|
@@ -3645,30 +3647,30 @@ function Zp(e) {
|
|
|
3645
3647
|
return typeof e == "string" ? t = e : typeof e == "object" && e !== null ? t = JSON.stringify(e) : t = String(e), Jp(t), Yp(t);
|
|
3646
3648
|
}
|
|
3647
3649
|
function Go(e) {
|
|
3648
|
-
const t = e + "CollectionProvider", [n, r] =
|
|
3650
|
+
const t = e + "CollectionProvider", [n, r] = Ve(t), [o, s] = n(
|
|
3649
3651
|
t,
|
|
3650
3652
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
3651
|
-
), a = (
|
|
3652
|
-
const { scope: b, children: w } =
|
|
3653
|
+
), a = (m) => {
|
|
3654
|
+
const { scope: b, children: w } = m, x = qe.useRef(null), y = qe.useRef(/* @__PURE__ */ new Map()).current;
|
|
3653
3655
|
return /* @__PURE__ */ c(o, { scope: b, itemMap: y, collectionRef: x, children: w });
|
|
3654
3656
|
};
|
|
3655
3657
|
a.displayName = t;
|
|
3656
3658
|
const i = e + "CollectionSlot", l = Ft(i), f = qe.forwardRef(
|
|
3657
|
-
(
|
|
3658
|
-
const { scope: w, children: x } =
|
|
3659
|
+
(m, b) => {
|
|
3660
|
+
const { scope: w, children: x } = m, y = s(i, w), C = ie(b, y.collectionRef);
|
|
3659
3661
|
return /* @__PURE__ */ c(l, { ref: C, children: x });
|
|
3660
3662
|
}
|
|
3661
3663
|
);
|
|
3662
3664
|
f.displayName = i;
|
|
3663
|
-
const d = e + "CollectionItemSlot", p = "data-radix-collection-item",
|
|
3664
|
-
(
|
|
3665
|
-
const { scope: w, children: x, ...y } =
|
|
3666
|
-
return qe.useEffect(() => (_.itemMap.set(C, { ref: C, ...y }), () => void _.itemMap.delete(C))), /* @__PURE__ */ c(
|
|
3665
|
+
const d = e + "CollectionItemSlot", p = "data-radix-collection-item", h = Ft(d), v = qe.forwardRef(
|
|
3666
|
+
(m, b) => {
|
|
3667
|
+
const { scope: w, children: x, ...y } = m, C = qe.useRef(null), R = ie(b, C), _ = s(d, w);
|
|
3668
|
+
return qe.useEffect(() => (_.itemMap.set(C, { ref: C, ...y }), () => void _.itemMap.delete(C))), /* @__PURE__ */ c(h, { [p]: "", ref: R, children: x });
|
|
3667
3669
|
}
|
|
3668
3670
|
);
|
|
3669
3671
|
v.displayName = d;
|
|
3670
|
-
function g(
|
|
3671
|
-
const b = s(e + "CollectionConsumer",
|
|
3672
|
+
function g(m) {
|
|
3673
|
+
const b = s(e + "CollectionConsumer", m);
|
|
3672
3674
|
return qe.useCallback(() => {
|
|
3673
3675
|
const x = b.collectionRef.current;
|
|
3674
3676
|
if (!x) return [];
|
|
@@ -3721,21 +3723,21 @@ var th = "DismissableLayer", yo = "dismissableLayer.update", nh = "dismissableLa
|
|
|
3721
3723
|
onInteractOutside: a,
|
|
3722
3724
|
onDismiss: i,
|
|
3723
3725
|
...l
|
|
3724
|
-
} = e, f = u.useContext(mi), [d, p] = u.useState(null),
|
|
3726
|
+
} = e, f = u.useContext(mi), [d, p] = u.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = u.useState({}), g = ie(t, (N) => p(N)), m = Array.from(f.layers), [b] = [...f.layersWithOutsidePointerEventsDisabled].slice(-1), w = m.indexOf(b), x = d ? m.indexOf(d) : -1, y = f.layersWithOutsidePointerEventsDisabled.size > 0, C = x >= w, R = ah((N) => {
|
|
3725
3727
|
const k = N.target, L = [...f.branches].some((I) => I.contains(k));
|
|
3726
3728
|
!C || L || (o == null || o(N), a == null || a(N), N.defaultPrevented || i == null || i());
|
|
3727
|
-
},
|
|
3729
|
+
}, h), _ = ih((N) => {
|
|
3728
3730
|
const k = N.target;
|
|
3729
3731
|
[...f.branches].some((I) => I.contains(k)) || (s == null || s(N), a == null || a(N), N.defaultPrevented || i == null || i());
|
|
3730
|
-
},
|
|
3732
|
+
}, h);
|
|
3731
3733
|
return eh((N) => {
|
|
3732
3734
|
x === f.layers.size - 1 && (r == null || r(N), !N.defaultPrevented && i && (N.preventDefault(), i()));
|
|
3733
|
-
},
|
|
3735
|
+
}, h), u.useEffect(() => {
|
|
3734
3736
|
if (d)
|
|
3735
|
-
return n && (f.layersWithOutsidePointerEventsDisabled.size === 0 && (ea =
|
|
3736
|
-
n && f.layersWithOutsidePointerEventsDisabled.size === 1 && (
|
|
3737
|
+
return n && (f.layersWithOutsidePointerEventsDisabled.size === 0 && (ea = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), f.layersWithOutsidePointerEventsDisabled.add(d)), f.layers.add(d), ta(), () => {
|
|
3738
|
+
n && f.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = ea);
|
|
3737
3739
|
};
|
|
3738
|
-
}, [d,
|
|
3740
|
+
}, [d, h, n, f]), u.useEffect(() => () => {
|
|
3739
3741
|
d && (f.layers.delete(d), f.layersWithOutsidePointerEventsDisabled.delete(d), ta());
|
|
3740
3742
|
}, [d, f]), u.useEffect(() => {
|
|
3741
3743
|
const N = () => v({});
|
|
@@ -3843,7 +3845,7 @@ var eo = "focusScope.autoFocusOnMount", to = "focusScope.autoFocusOnUnmount", ra
|
|
|
3843
3845
|
onMountAutoFocus: o,
|
|
3844
3846
|
onUnmountAutoFocus: s,
|
|
3845
3847
|
...a
|
|
3846
|
-
} = e, [i, l] = u.useState(null), f = ye(o), d = ye(s), p = u.useRef(null),
|
|
3848
|
+
} = e, [i, l] = u.useState(null), f = ye(o), d = ye(s), p = u.useRef(null), h = ie(t, (m) => l(m)), v = u.useRef({
|
|
3847
3849
|
paused: !1,
|
|
3848
3850
|
pause() {
|
|
3849
3851
|
this.paused = !0;
|
|
@@ -3854,7 +3856,7 @@ var eo = "focusScope.autoFocusOnMount", to = "focusScope.autoFocusOnUnmount", ra
|
|
|
3854
3856
|
}).current;
|
|
3855
3857
|
u.useEffect(() => {
|
|
3856
3858
|
if (r) {
|
|
3857
|
-
let
|
|
3859
|
+
let m = function(y) {
|
|
3858
3860
|
if (v.paused || !i) return;
|
|
3859
3861
|
const C = y.target;
|
|
3860
3862
|
i.contains(C) ? p.current = C : it(p.current, { select: !0 });
|
|
@@ -3867,40 +3869,40 @@ var eo = "focusScope.autoFocusOnMount", to = "focusScope.autoFocusOnUnmount", ra
|
|
|
3867
3869
|
for (const R of y)
|
|
3868
3870
|
R.removedNodes.length > 0 && it(i);
|
|
3869
3871
|
};
|
|
3870
|
-
document.addEventListener("focusin",
|
|
3872
|
+
document.addEventListener("focusin", m), document.addEventListener("focusout", b);
|
|
3871
3873
|
const x = new MutationObserver(w);
|
|
3872
3874
|
return i && x.observe(i, { childList: !0, subtree: !0 }), () => {
|
|
3873
|
-
document.removeEventListener("focusin",
|
|
3875
|
+
document.removeEventListener("focusin", m), document.removeEventListener("focusout", b), x.disconnect();
|
|
3874
3876
|
};
|
|
3875
3877
|
}
|
|
3876
3878
|
}, [r, i, v.paused]), u.useEffect(() => {
|
|
3877
3879
|
if (i) {
|
|
3878
3880
|
sa.add(v);
|
|
3879
|
-
const
|
|
3880
|
-
if (!i.contains(
|
|
3881
|
+
const m = document.activeElement;
|
|
3882
|
+
if (!i.contains(m)) {
|
|
3881
3883
|
const w = new CustomEvent(eo, ra);
|
|
3882
|
-
i.addEventListener(eo, f), i.dispatchEvent(w), w.defaultPrevented || (lh(hh(bi(i)), { select: !0 }), document.activeElement ===
|
|
3884
|
+
i.addEventListener(eo, f), i.dispatchEvent(w), w.defaultPrevented || (lh(hh(bi(i)), { select: !0 }), document.activeElement === m && it(i));
|
|
3883
3885
|
}
|
|
3884
3886
|
return () => {
|
|
3885
3887
|
i.removeEventListener(eo, f), setTimeout(() => {
|
|
3886
3888
|
const w = new CustomEvent(to, ra);
|
|
3887
|
-
i.addEventListener(to, d), i.dispatchEvent(w), w.defaultPrevented || it(
|
|
3889
|
+
i.addEventListener(to, d), i.dispatchEvent(w), w.defaultPrevented || it(m ?? document.body, { select: !0 }), i.removeEventListener(to, d), sa.remove(v);
|
|
3888
3890
|
}, 0);
|
|
3889
3891
|
};
|
|
3890
3892
|
}
|
|
3891
3893
|
}, [i, f, d, v]);
|
|
3892
3894
|
const g = u.useCallback(
|
|
3893
|
-
(
|
|
3895
|
+
(m) => {
|
|
3894
3896
|
if (!n && !r || v.paused) return;
|
|
3895
|
-
const b =
|
|
3897
|
+
const b = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, w = document.activeElement;
|
|
3896
3898
|
if (b && w) {
|
|
3897
|
-
const x =
|
|
3898
|
-
y && C ? !
|
|
3899
|
+
const x = m.currentTarget, [y, C] = uh(x);
|
|
3900
|
+
y && C ? !m.shiftKey && w === C ? (m.preventDefault(), n && it(y, { select: !0 })) : m.shiftKey && w === y && (m.preventDefault(), n && it(C, { select: !0 })) : w === x && m.preventDefault();
|
|
3899
3901
|
}
|
|
3900
3902
|
},
|
|
3901
3903
|
[n, r, v.paused]
|
|
3902
3904
|
);
|
|
3903
|
-
return /* @__PURE__ */ c(ee.div, { tabIndex: -1, ...a, ref:
|
|
3905
|
+
return /* @__PURE__ */ c(ee.div, { tabIndex: -1, ...a, ref: h, onKeyDown: g });
|
|
3904
3906
|
});
|
|
3905
3907
|
wr.displayName = ch;
|
|
3906
3908
|
function lh(e, { select: t = !1 } = {}) {
|
|
@@ -3986,7 +3988,7 @@ function rt(e, t) {
|
|
|
3986
3988
|
function ot(e) {
|
|
3987
3989
|
return e.split("-")[0];
|
|
3988
3990
|
}
|
|
3989
|
-
function
|
|
3991
|
+
function Vt(e) {
|
|
3990
3992
|
return e.split("-")[1];
|
|
3991
3993
|
}
|
|
3992
3994
|
function Xo(e) {
|
|
@@ -4004,7 +4006,7 @@ function Jo(e) {
|
|
|
4004
4006
|
}
|
|
4005
4007
|
function wh(e, t, n) {
|
|
4006
4008
|
n === void 0 && (n = !1);
|
|
4007
|
-
const r =
|
|
4009
|
+
const r = Vt(e), o = Jo(e), s = Yo(o);
|
|
4008
4010
|
let a = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
4009
4011
|
return t.reference[s] > t.floating[s] && (a = nr(a)), [a, nr(a)];
|
|
4010
4012
|
}
|
|
@@ -4029,7 +4031,7 @@ function Ch(e, t, n) {
|
|
|
4029
4031
|
}
|
|
4030
4032
|
}
|
|
4031
4033
|
function Eh(e, t, n, r) {
|
|
4032
|
-
const o =
|
|
4034
|
+
const o = Vt(e);
|
|
4033
4035
|
let s = Ch(ot(e), n === "start", r);
|
|
4034
4036
|
return o && (s = s.map((a) => a + "-" + o), t && (s = s.concat(s.map(So)))), s;
|
|
4035
4037
|
}
|
|
@@ -4076,7 +4078,7 @@ function la(e, t, n) {
|
|
|
4076
4078
|
reference: r,
|
|
4077
4079
|
floating: o
|
|
4078
4080
|
} = e;
|
|
4079
|
-
const s = Ye(t), a = Jo(t), i = Yo(a), l = ot(t), f = s === "y", d = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2,
|
|
4081
|
+
const s = Ye(t), a = Jo(t), i = Yo(a), l = ot(t), f = s === "y", d = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, h = r[i] / 2 - o[i] / 2;
|
|
4080
4082
|
let v;
|
|
4081
4083
|
switch (l) {
|
|
4082
4084
|
case "top":
|
|
@@ -4109,12 +4111,12 @@ function la(e, t, n) {
|
|
|
4109
4111
|
y: r.y
|
|
4110
4112
|
};
|
|
4111
4113
|
}
|
|
4112
|
-
switch (
|
|
4114
|
+
switch (Vt(t)) {
|
|
4113
4115
|
case "start":
|
|
4114
|
-
v[a] -=
|
|
4116
|
+
v[a] -= h * (n && f ? -1 : 1);
|
|
4115
4117
|
break;
|
|
4116
4118
|
case "end":
|
|
4117
|
-
v[a] +=
|
|
4119
|
+
v[a] += h * (n && f ? -1 : 1);
|
|
4118
4120
|
break;
|
|
4119
4121
|
}
|
|
4120
4122
|
return v;
|
|
@@ -4133,12 +4135,12 @@ const Rh = async (e, t, n) => {
|
|
|
4133
4135
|
}), {
|
|
4134
4136
|
x: d,
|
|
4135
4137
|
y: p
|
|
4136
|
-
} = la(f, r, l),
|
|
4137
|
-
for (let
|
|
4138
|
+
} = la(f, r, l), h = r, v = {}, g = 0;
|
|
4139
|
+
for (let m = 0; m < i.length; m++) {
|
|
4138
4140
|
const {
|
|
4139
4141
|
name: b,
|
|
4140
4142
|
fn: w
|
|
4141
|
-
} = i[
|
|
4143
|
+
} = i[m], {
|
|
4142
4144
|
x,
|
|
4143
4145
|
y,
|
|
4144
4146
|
data: C,
|
|
@@ -4147,7 +4149,7 @@ const Rh = async (e, t, n) => {
|
|
|
4147
4149
|
x: d,
|
|
4148
4150
|
y: p,
|
|
4149
4151
|
initialPlacement: r,
|
|
4150
|
-
placement:
|
|
4152
|
+
placement: h,
|
|
4151
4153
|
strategy: o,
|
|
4152
4154
|
middlewareData: v,
|
|
4153
4155
|
rects: f,
|
|
@@ -4163,19 +4165,19 @@ const Rh = async (e, t, n) => {
|
|
|
4163
4165
|
...v[b],
|
|
4164
4166
|
...C
|
|
4165
4167
|
}
|
|
4166
|
-
}, R && g <= 50 && (g++, typeof R == "object" && (R.placement && (
|
|
4168
|
+
}, R && g <= 50 && (g++, typeof R == "object" && (R.placement && (h = R.placement), R.rects && (f = R.rects === !0 ? await a.getElementRects({
|
|
4167
4169
|
reference: e,
|
|
4168
4170
|
floating: t,
|
|
4169
4171
|
strategy: o
|
|
4170
4172
|
}) : R.rects), {
|
|
4171
4173
|
x: d,
|
|
4172
4174
|
y: p
|
|
4173
|
-
} = la(f,
|
|
4175
|
+
} = la(f, h, l)), m = -1);
|
|
4174
4176
|
}
|
|
4175
4177
|
return {
|
|
4176
4178
|
x: d,
|
|
4177
4179
|
y: p,
|
|
4178
|
-
placement:
|
|
4180
|
+
placement: h,
|
|
4179
4181
|
strategy: o,
|
|
4180
4182
|
middlewareData: v
|
|
4181
4183
|
};
|
|
@@ -4194,9 +4196,9 @@ async function sn(e, t) {
|
|
|
4194
4196
|
boundary: f = "clippingAncestors",
|
|
4195
4197
|
rootBoundary: d = "viewport",
|
|
4196
4198
|
elementContext: p = "floating",
|
|
4197
|
-
altBoundary:
|
|
4199
|
+
altBoundary: h = !1,
|
|
4198
4200
|
padding: v = 0
|
|
4199
|
-
} = rt(t, e), g = vi(v), b = i[
|
|
4201
|
+
} = rt(t, e), g = vi(v), b = i[h ? p === "floating" ? "reference" : "floating" : p], w = rr(await s.getClippingRect({
|
|
4200
4202
|
element: (n = await (s.isElement == null ? void 0 : s.isElement(b))) == null || n ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(i.floating)),
|
|
4201
4203
|
boundary: f,
|
|
4202
4204
|
rootBoundary: d,
|
|
@@ -4243,15 +4245,15 @@ const Th = (e) => ({
|
|
|
4243
4245
|
} = rt(e, t) || {};
|
|
4244
4246
|
if (f == null)
|
|
4245
4247
|
return {};
|
|
4246
|
-
const p = vi(d),
|
|
4248
|
+
const p = vi(d), h = {
|
|
4247
4249
|
x: n,
|
|
4248
4250
|
y: r
|
|
4249
|
-
}, v = Jo(o), g = Yo(v),
|
|
4251
|
+
}, v = Jo(o), g = Yo(v), m = await a.getDimensions(f), b = v === "y", w = b ? "top" : "left", x = b ? "bottom" : "right", y = b ? "clientHeight" : "clientWidth", C = s.reference[g] + s.reference[v] - h[v] - s.floating[g], R = h[v] - s.reference[v], _ = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(f));
|
|
4250
4252
|
let N = _ ? _[y] : 0;
|
|
4251
4253
|
(!N || !await (a.isElement == null ? void 0 : a.isElement(_))) && (N = i.floating[y] || s.floating[g]);
|
|
4252
|
-
const k = C / 2 - R / 2, L = N / 2 -
|
|
4254
|
+
const k = C / 2 - R / 2, L = N / 2 - m[g] / 2 - 1, I = dt(p[w], L), $ = dt(p[x], L), K = I, B = N - m[g] - $, M = N / 2 - m[g] / 2 + k, H = xo(K, M, B), O = !l.arrow && Vt(o) != null && M !== H && s.reference[g] / 2 - (M < K ? I : $) - m[g] / 2 < 0, G = O ? M < K ? M - K : M - B : 0;
|
|
4253
4255
|
return {
|
|
4254
|
-
[v]:
|
|
4256
|
+
[v]: h[v] + G,
|
|
4255
4257
|
data: {
|
|
4256
4258
|
[v]: H,
|
|
4257
4259
|
centerOffset: M - H - G,
|
|
@@ -4278,16 +4280,16 @@ const Th = (e) => ({
|
|
|
4278
4280
|
} = t, {
|
|
4279
4281
|
mainAxis: d = !0,
|
|
4280
4282
|
crossAxis: p = !0,
|
|
4281
|
-
fallbackPlacements:
|
|
4283
|
+
fallbackPlacements: h,
|
|
4282
4284
|
fallbackStrategy: v = "bestFit",
|
|
4283
4285
|
fallbackAxisSideDirection: g = "none",
|
|
4284
|
-
flipAlignment:
|
|
4286
|
+
flipAlignment: m = !0,
|
|
4285
4287
|
...b
|
|
4286
4288
|
} = rt(e, t);
|
|
4287
4289
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
4288
4290
|
return {};
|
|
4289
|
-
const w = ot(o), x = Ye(i), y = ot(i) === i, C = await (l.isRTL == null ? void 0 : l.isRTL(f.floating)), R =
|
|
4290
|
-
!
|
|
4291
|
+
const w = ot(o), x = Ye(i), y = ot(i) === i, C = await (l.isRTL == null ? void 0 : l.isRTL(f.floating)), R = h || (y || !m ? [nr(i)] : yh(i)), _ = g !== "none";
|
|
4292
|
+
!h && _ && R.push(...Eh(i, m, g, C));
|
|
4291
4293
|
const N = [i, ...R], k = await sn(t, b), L = [];
|
|
4292
4294
|
let I = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
4293
4295
|
if (d && L.push(k[w]), p) {
|
|
@@ -4402,9 +4404,9 @@ async function Ih(e, t) {
|
|
|
4402
4404
|
placement: n,
|
|
4403
4405
|
platform: r,
|
|
4404
4406
|
elements: o
|
|
4405
|
-
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), a = ot(n), i =
|
|
4407
|
+
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), a = ot(n), i = Vt(n), l = Ye(n) === "y", f = wi.has(a) ? -1 : 1, d = s && l ? -1 : 1, p = rt(t, e);
|
|
4406
4408
|
let {
|
|
4407
|
-
mainAxis:
|
|
4409
|
+
mainAxis: h,
|
|
4408
4410
|
crossAxis: v,
|
|
4409
4411
|
alignmentAxis: g
|
|
4410
4412
|
} = typeof p == "number" ? {
|
|
@@ -4418,9 +4420,9 @@ async function Ih(e, t) {
|
|
|
4418
4420
|
};
|
|
4419
4421
|
return i && typeof g == "number" && (v = i === "end" ? g * -1 : g), l ? {
|
|
4420
4422
|
x: v * d,
|
|
4421
|
-
y:
|
|
4423
|
+
y: h * f
|
|
4422
4424
|
} : {
|
|
4423
|
-
x:
|
|
4425
|
+
x: h * f,
|
|
4424
4426
|
y: v * d
|
|
4425
4427
|
};
|
|
4426
4428
|
}
|
|
@@ -4474,28 +4476,28 @@ const _h = function(e) {
|
|
|
4474
4476
|
} = rt(e, t), f = {
|
|
4475
4477
|
x: n,
|
|
4476
4478
|
y: r
|
|
4477
|
-
}, d = await sn(t, l), p = Ye(ot(o)),
|
|
4478
|
-
let v = f[
|
|
4479
|
+
}, d = await sn(t, l), p = Ye(ot(o)), h = Xo(p);
|
|
4480
|
+
let v = f[h], g = f[p];
|
|
4479
4481
|
if (s) {
|
|
4480
|
-
const b =
|
|
4482
|
+
const b = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", x = v + d[b], y = v - d[w];
|
|
4481
4483
|
v = xo(x, v, y);
|
|
4482
4484
|
}
|
|
4483
4485
|
if (a) {
|
|
4484
4486
|
const b = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", x = g + d[b], y = g - d[w];
|
|
4485
4487
|
g = xo(x, g, y);
|
|
4486
4488
|
}
|
|
4487
|
-
const
|
|
4489
|
+
const m = i.fn({
|
|
4488
4490
|
...t,
|
|
4489
|
-
[
|
|
4491
|
+
[h]: v,
|
|
4490
4492
|
[p]: g
|
|
4491
4493
|
});
|
|
4492
4494
|
return {
|
|
4493
|
-
...
|
|
4495
|
+
...m,
|
|
4494
4496
|
data: {
|
|
4495
|
-
x:
|
|
4496
|
-
y:
|
|
4497
|
+
x: m.x - n,
|
|
4498
|
+
y: m.y - r,
|
|
4497
4499
|
enabled: {
|
|
4498
|
-
[
|
|
4500
|
+
[h]: s,
|
|
4499
4501
|
[p]: a
|
|
4500
4502
|
}
|
|
4501
4503
|
}
|
|
@@ -4519,27 +4521,27 @@ const _h = function(e) {
|
|
|
4519
4521
|
} = rt(e, t), d = {
|
|
4520
4522
|
x: n,
|
|
4521
4523
|
y: r
|
|
4522
|
-
}, p = Ye(o),
|
|
4523
|
-
let v = d[
|
|
4524
|
-
const
|
|
4525
|
-
mainAxis:
|
|
4524
|
+
}, p = Ye(o), h = Xo(p);
|
|
4525
|
+
let v = d[h], g = d[p];
|
|
4526
|
+
const m = rt(i, t), b = typeof m == "number" ? {
|
|
4527
|
+
mainAxis: m,
|
|
4526
4528
|
crossAxis: 0
|
|
4527
4529
|
} : {
|
|
4528
4530
|
mainAxis: 0,
|
|
4529
4531
|
crossAxis: 0,
|
|
4530
|
-
...
|
|
4532
|
+
...m
|
|
4531
4533
|
};
|
|
4532
4534
|
if (l) {
|
|
4533
|
-
const y =
|
|
4535
|
+
const y = h === "y" ? "height" : "width", C = s.reference[h] - s.floating[y] + b.mainAxis, R = s.reference[h] + s.reference[y] - b.mainAxis;
|
|
4534
4536
|
v < C ? v = C : v > R && (v = R);
|
|
4535
4537
|
}
|
|
4536
4538
|
if (f) {
|
|
4537
4539
|
var w, x;
|
|
4538
|
-
const y =
|
|
4540
|
+
const y = h === "y" ? "width" : "height", C = wi.has(ot(o)), R = s.reference[p] - s.floating[y] + (C && ((w = a.offset) == null ? void 0 : w[p]) || 0) + (C ? 0 : b.crossAxis), _ = s.reference[p] + s.reference[y] + (C ? 0 : ((x = a.offset) == null ? void 0 : x[p]) || 0) - (C ? b.crossAxis : 0);
|
|
4539
4541
|
g < R ? g = R : g > _ && (g = _);
|
|
4540
4542
|
}
|
|
4541
4543
|
return {
|
|
4542
|
-
[
|
|
4544
|
+
[h]: v,
|
|
4543
4545
|
[p]: g
|
|
4544
4546
|
};
|
|
4545
4547
|
}
|
|
@@ -4559,17 +4561,17 @@ const _h = function(e) {
|
|
|
4559
4561
|
apply: l = () => {
|
|
4560
4562
|
},
|
|
4561
4563
|
...f
|
|
4562
|
-
} = rt(e, t), d = await sn(t, f), p = ot(o),
|
|
4564
|
+
} = rt(e, t), d = await sn(t, f), p = ot(o), h = Vt(o), v = Ye(o) === "y", {
|
|
4563
4565
|
width: g,
|
|
4564
|
-
height:
|
|
4566
|
+
height: m
|
|
4565
4567
|
} = s.floating;
|
|
4566
4568
|
let b, w;
|
|
4567
|
-
p === "top" || p === "bottom" ? (b = p, w =
|
|
4568
|
-
const x =
|
|
4569
|
+
p === "top" || p === "bottom" ? (b = p, w = h === (await (a.isRTL == null ? void 0 : a.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (w = p, b = h === "end" ? "top" : "bottom");
|
|
4570
|
+
const x = m - d.top - d.bottom, y = g - d.left - d.right, C = dt(m - d[b], x), R = dt(g - d[w], y), _ = !t.middlewareData.shift;
|
|
4569
4571
|
let N = C, k = R;
|
|
4570
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (k = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !
|
|
4572
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (k = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !h) {
|
|
4571
4573
|
const I = ke(d.left, 0), $ = ke(d.right, 0), K = ke(d.top, 0), B = ke(d.bottom, 0);
|
|
4572
|
-
v ? k = g - 2 * (I !== 0 || $ !== 0 ? I + $ : ke(d.left, d.right)) : N =
|
|
4574
|
+
v ? k = g - 2 * (I !== 0 || $ !== 0 ? I + $ : ke(d.left, d.right)) : N = m - 2 * (K !== 0 || B !== 0 ? K + B : ke(d.top, d.bottom));
|
|
4573
4575
|
}
|
|
4574
4576
|
await l({
|
|
4575
4577
|
...t,
|
|
@@ -4577,7 +4579,7 @@ const _h = function(e) {
|
|
|
4577
4579
|
availableHeight: N
|
|
4578
4580
|
});
|
|
4579
4581
|
const L = await a.getDimensions(i.floating);
|
|
4580
|
-
return g !== L.width ||
|
|
4582
|
+
return g !== L.width || m !== L.height ? {
|
|
4581
4583
|
reset: {
|
|
4582
4584
|
rects: !0
|
|
4583
4585
|
}
|
|
@@ -4727,15 +4729,15 @@ function Dt(e) {
|
|
|
4727
4729
|
y: i
|
|
4728
4730
|
};
|
|
4729
4731
|
}
|
|
4730
|
-
const
|
|
4732
|
+
const jh = /* @__PURE__ */ Je(0);
|
|
4731
4733
|
function Ci(e) {
|
|
4732
4734
|
const t = Me(e);
|
|
4733
|
-
return !Qo() || !t.visualViewport ?
|
|
4735
|
+
return !Qo() || !t.visualViewport ? jh : {
|
|
4734
4736
|
x: t.visualViewport.offsetLeft,
|
|
4735
4737
|
y: t.visualViewport.offsetTop
|
|
4736
4738
|
};
|
|
4737
4739
|
}
|
|
4738
|
-
function
|
|
4740
|
+
function Vh(e, t, n) {
|
|
4739
4741
|
return t === void 0 && (t = !1), !n || t && n !== Me(e) ? !1 : t;
|
|
4740
4742
|
}
|
|
4741
4743
|
function xt(e, t, n, r) {
|
|
@@ -4743,14 +4745,14 @@ function xt(e, t, n, r) {
|
|
|
4743
4745
|
const o = e.getBoundingClientRect(), s = es(e);
|
|
4744
4746
|
let a = Je(1);
|
|
4745
4747
|
t && (r ? ze(r) && (a = Dt(r)) : a = Dt(e));
|
|
4746
|
-
const i =
|
|
4748
|
+
const i = Vh(s, n, r) ? Ci(s) : Je(0);
|
|
4747
4749
|
let l = (o.left + i.x) / a.x, f = (o.top + i.y) / a.y, d = o.width / a.x, p = o.height / a.y;
|
|
4748
4750
|
if (s) {
|
|
4749
|
-
const
|
|
4750
|
-
let g =
|
|
4751
|
-
for (;
|
|
4752
|
-
const b = Dt(
|
|
4753
|
-
l *= b.x, f *= b.y, d *= b.x, p *= b.y, l += y, f += C, g = Me(
|
|
4751
|
+
const h = Me(s), v = r && ze(r) ? Me(r) : r;
|
|
4752
|
+
let g = h, m = Co(g);
|
|
4753
|
+
for (; m && r && v !== g; ) {
|
|
4754
|
+
const b = Dt(m), w = m.getBoundingClientRect(), x = We(m), y = w.left + (m.clientLeft + parseFloat(x.paddingLeft)) * b.x, C = w.top + (m.clientTop + parseFloat(x.paddingTop)) * b.y;
|
|
4755
|
+
l *= b.x, f *= b.y, d *= b.x, p *= b.y, l += y, f += C, g = Me(m), m = Co(g);
|
|
4754
4756
|
}
|
|
4755
4757
|
}
|
|
4756
4758
|
return rr({
|
|
@@ -4790,12 +4792,12 @@ function Kh(e) {
|
|
|
4790
4792
|
const v = xt(r);
|
|
4791
4793
|
f = Dt(r), d.x = v.x + r.clientLeft, d.y = v.y + r.clientTop;
|
|
4792
4794
|
}
|
|
4793
|
-
const
|
|
4795
|
+
const h = a && !p && !s ? Ei(a, l) : Je(0);
|
|
4794
4796
|
return {
|
|
4795
4797
|
width: n.width * f.x,
|
|
4796
4798
|
height: n.height * f.y,
|
|
4797
|
-
x: n.x * f.x - l.scrollLeft * f.x + d.x +
|
|
4798
|
-
y: n.y * f.y - l.scrollTop * f.y + d.y +
|
|
4799
|
+
x: n.x * f.x - l.scrollLeft * f.x + d.x + h.x,
|
|
4800
|
+
y: n.y * f.y - l.scrollTop * f.y + d.y + h.y
|
|
4799
4801
|
};
|
|
4800
4802
|
}
|
|
4801
4803
|
function Gh(e) {
|
|
@@ -4823,7 +4825,7 @@ function Xh(e, t) {
|
|
|
4823
4825
|
}
|
|
4824
4826
|
const f = Cr(r);
|
|
4825
4827
|
if (f <= 0) {
|
|
4826
|
-
const d = r.ownerDocument, p = d.body,
|
|
4828
|
+
const d = r.ownerDocument, p = d.body, h = getComputedStyle(p), v = d.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, g = Math.abs(r.clientWidth - p.clientWidth - v);
|
|
4827
4829
|
g <= pa && (s -= g);
|
|
4828
4830
|
} else f <= pa && (s += f);
|
|
4829
4831
|
return {
|
|
@@ -4923,10 +4925,10 @@ function tm(e, t, n) {
|
|
|
4923
4925
|
l.x = v.x + t.clientLeft, l.y = v.y + t.clientTop;
|
|
4924
4926
|
} else o && f();
|
|
4925
4927
|
s && !r && o && f();
|
|
4926
|
-
const d = o && !r && !s ? Ei(o, i) : Je(0), p = a.left + i.scrollLeft - l.x - d.x,
|
|
4928
|
+
const d = o && !r && !s ? Ei(o, i) : Je(0), p = a.left + i.scrollLeft - l.x - d.x, h = a.top + i.scrollTop - l.y - d.y;
|
|
4927
4929
|
return {
|
|
4928
4930
|
x: p,
|
|
4929
|
-
y:
|
|
4931
|
+
y: h,
|
|
4930
4932
|
width: a.width,
|
|
4931
4933
|
height: a.height
|
|
4932
4934
|
};
|
|
@@ -5002,13 +5004,13 @@ function sm(e, t) {
|
|
|
5002
5004
|
const f = e.getBoundingClientRect(), {
|
|
5003
5005
|
left: d,
|
|
5004
5006
|
top: p,
|
|
5005
|
-
width:
|
|
5007
|
+
width: h,
|
|
5006
5008
|
height: v
|
|
5007
5009
|
} = f;
|
|
5008
|
-
if (i || t(), !
|
|
5010
|
+
if (i || t(), !h || !v)
|
|
5009
5011
|
return;
|
|
5010
|
-
const g = On(p),
|
|
5011
|
-
rootMargin: -g + "px " + -
|
|
5012
|
+
const g = On(p), m = On(o.clientWidth - (d + h)), b = On(o.clientHeight - (p + v)), w = On(d), y = {
|
|
5013
|
+
rootMargin: -g + "px " + -m + "px " + -b + "px " + -w + "px",
|
|
5012
5014
|
threshold: ke(0, dt(1, l)) || 1
|
|
5013
5015
|
};
|
|
5014
5016
|
let C = !0;
|
|
@@ -5051,19 +5053,19 @@ function am(e, t, n, r) {
|
|
|
5051
5053
|
}), s && w.addEventListener("resize", n);
|
|
5052
5054
|
});
|
|
5053
5055
|
const p = f && i ? sm(f, n) : null;
|
|
5054
|
-
let
|
|
5056
|
+
let h = -1, v = null;
|
|
5055
5057
|
a && (v = new ResizeObserver((w) => {
|
|
5056
5058
|
let [x] = w;
|
|
5057
|
-
x && x.target === f && v && (v.unobserve(t), cancelAnimationFrame(
|
|
5059
|
+
x && x.target === f && v && (v.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
5058
5060
|
var y;
|
|
5059
5061
|
(y = v) == null || y.observe(t);
|
|
5060
5062
|
})), n();
|
|
5061
5063
|
}), f && !l && v.observe(f), v.observe(t));
|
|
5062
|
-
let g,
|
|
5064
|
+
let g, m = l ? xt(e) : null;
|
|
5063
5065
|
l && b();
|
|
5064
5066
|
function b() {
|
|
5065
5067
|
const w = xt(e);
|
|
5066
|
-
|
|
5068
|
+
m && !Ti(m, w) && n(), m = w, g = requestAnimationFrame(b);
|
|
5067
5069
|
}
|
|
5068
5070
|
return n(), () => {
|
|
5069
5071
|
var w;
|
|
@@ -5151,10 +5153,10 @@ function gm(e) {
|
|
|
5151
5153
|
placement: t,
|
|
5152
5154
|
middlewareData: {},
|
|
5153
5155
|
isPositioned: !1
|
|
5154
|
-
}), [
|
|
5155
|
-
or(
|
|
5156
|
-
const [g,
|
|
5157
|
-
D !== _.current && (_.current = D,
|
|
5156
|
+
}), [h, v] = u.useState(r);
|
|
5157
|
+
or(h, r) || v(r);
|
|
5158
|
+
const [g, m] = u.useState(null), [b, w] = u.useState(null), x = u.useCallback((D) => {
|
|
5159
|
+
D !== _.current && (_.current = D, m(D));
|
|
5158
5160
|
}, []), y = u.useCallback((D) => {
|
|
5159
5161
|
D !== N.current && (N.current = D, w(D));
|
|
5160
5162
|
}, []), C = s || g, R = a || b, _ = u.useRef(null), N = u.useRef(null), k = u.useRef(d), L = l != null, I = ro(l), $ = ro(o), K = ro(f), B = u.useCallback(() => {
|
|
@@ -5163,7 +5165,7 @@ function gm(e) {
|
|
|
5163
5165
|
const D = {
|
|
5164
5166
|
placement: t,
|
|
5165
5167
|
strategy: n,
|
|
5166
|
-
middleware:
|
|
5168
|
+
middleware: h
|
|
5167
5169
|
};
|
|
5168
5170
|
$.current && (D.platform = $.current), pm(_.current, N.current, D).then((T) => {
|
|
5169
5171
|
const Q = {
|
|
@@ -5178,7 +5180,7 @@ function gm(e) {
|
|
|
5178
5180
|
p(Q);
|
|
5179
5181
|
}));
|
|
5180
5182
|
});
|
|
5181
|
-
}, [
|
|
5183
|
+
}, [h, t, n, $, K]);
|
|
5182
5184
|
zn(() => {
|
|
5183
5185
|
f === !1 && k.current.isPositioned && (k.current.isPositioned = !1, p((D) => ({
|
|
5184
5186
|
...D,
|
|
@@ -5314,7 +5316,7 @@ function Ii(e) {
|
|
|
5314
5316
|
n(void 0);
|
|
5315
5317
|
}, [e]), t;
|
|
5316
5318
|
}
|
|
5317
|
-
var ts = "Popper", [_i, Gt] =
|
|
5319
|
+
var ts = "Popper", [_i, Gt] = Ve(ts), [Tm, Oi] = _i(ts), ki = (e) => {
|
|
5318
5320
|
const { __scopePopper: t, children: n } = e, [r, o] = u.useState(null);
|
|
5319
5321
|
return /* @__PURE__ */ c(Tm, { scope: t, anchor: r, onAnchorChange: o, children: n });
|
|
5320
5322
|
};
|
|
@@ -5331,7 +5333,7 @@ var Mi = "PopperAnchor", Di = u.forwardRef(
|
|
|
5331
5333
|
Di.displayName = Mi;
|
|
5332
5334
|
var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
5333
5335
|
(e, t) => {
|
|
5334
|
-
var z, W,
|
|
5336
|
+
var z, W, oe, V, X, te;
|
|
5335
5337
|
const {
|
|
5336
5338
|
__scopePopper: n,
|
|
5337
5339
|
side: r = "bottom",
|
|
@@ -5343,10 +5345,10 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
|
5343
5345
|
collisionBoundary: f = [],
|
|
5344
5346
|
collisionPadding: d = 0,
|
|
5345
5347
|
sticky: p = "partial",
|
|
5346
|
-
hideWhenDetached:
|
|
5348
|
+
hideWhenDetached: h = !1,
|
|
5347
5349
|
updatePositionStrategy: v = "optimized",
|
|
5348
5350
|
onPlaced: g,
|
|
5349
|
-
...
|
|
5351
|
+
...m
|
|
5350
5352
|
} = e, b = Oi(ns, n), [w, x] = u.useState(null), y = ie(t, (me) => x(me)), [C, R] = u.useState(null), _ = Ii(C), N = (_ == null ? void 0 : _.width) ?? 0, k = (_ == null ? void 0 : _.height) ?? 0, L = r + (s !== "center" ? "-" + s : ""), I = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, $ = Array.isArray(f) ? f : [f], K = $.length > 0, B = {
|
|
5351
5353
|
padding: I,
|
|
5352
5354
|
boundary: $.filter(_m),
|
|
@@ -5380,13 +5382,13 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
|
5380
5382
|
}),
|
|
5381
5383
|
C && Em({ element: C, padding: i }),
|
|
5382
5384
|
Om({ arrowWidth: N, arrowHeight: k }),
|
|
5383
|
-
|
|
5385
|
+
h && Cm({ strategy: "referenceHidden", ...B })
|
|
5384
5386
|
]
|
|
5385
5387
|
}), [T, Q] = Bi(O), q = ye(g);
|
|
5386
5388
|
we(() => {
|
|
5387
5389
|
G && (q == null || q());
|
|
5388
5390
|
}, [G, q]);
|
|
5389
|
-
const
|
|
5391
|
+
const ae = (z = D.arrow) == null ? void 0 : z.x, F = (W = D.arrow) == null ? void 0 : W.y, j = ((oe = D.arrow) == null ? void 0 : oe.centerOffset) !== 0, [ce, pe] = u.useState();
|
|
5390
5392
|
return we(() => {
|
|
5391
5393
|
w && pe(window.getComputedStyle(w).zIndex);
|
|
5392
5394
|
}, [w]), /* @__PURE__ */ c(
|
|
@@ -5401,7 +5403,7 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
|
5401
5403
|
minWidth: "max-content",
|
|
5402
5404
|
zIndex: ce,
|
|
5403
5405
|
"--radix-popper-transform-origin": [
|
|
5404
|
-
(
|
|
5406
|
+
(V = D.transformOrigin) == null ? void 0 : V.x,
|
|
5405
5407
|
(X = D.transformOrigin) == null ? void 0 : X.y
|
|
5406
5408
|
].join(" "),
|
|
5407
5409
|
// hide the content if using the hide middleware and should be hidden
|
|
@@ -5419,18 +5421,18 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
|
5419
5421
|
scope: n,
|
|
5420
5422
|
placedSide: T,
|
|
5421
5423
|
onArrowChange: R,
|
|
5422
|
-
arrowX:
|
|
5424
|
+
arrowX: ae,
|
|
5423
5425
|
arrowY: F,
|
|
5424
|
-
shouldHideArrow:
|
|
5426
|
+
shouldHideArrow: j,
|
|
5425
5427
|
children: /* @__PURE__ */ c(
|
|
5426
5428
|
ee.div,
|
|
5427
5429
|
{
|
|
5428
5430
|
"data-side": T,
|
|
5429
5431
|
"data-align": Q,
|
|
5430
|
-
...
|
|
5432
|
+
...m,
|
|
5431
5433
|
ref: y,
|
|
5432
5434
|
style: {
|
|
5433
|
-
...
|
|
5435
|
+
...m.style,
|
|
5434
5436
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
5435
5437
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
5436
5438
|
animation: G ? void 0 : "none"
|
|
@@ -5503,9 +5505,9 @@ var Om = (e) => ({
|
|
|
5503
5505
|
options: e,
|
|
5504
5506
|
fn(t) {
|
|
5505
5507
|
var b, w, x;
|
|
5506
|
-
const { placement: n, rects: r, middlewareData: o } = t, a = ((b = o.arrow) == null ? void 0 : b.centerOffset) !== 0, i = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [f, d] = Bi(n), p = { start: "0%", center: "50%", end: "100%" }[d],
|
|
5507
|
-
let g = "",
|
|
5508
|
-
return f === "bottom" ? (g = a ? p : `${
|
|
5508
|
+
const { placement: n, rects: r, middlewareData: o } = t, a = ((b = o.arrow) == null ? void 0 : b.centerOffset) !== 0, i = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [f, d] = Bi(n), p = { start: "0%", center: "50%", end: "100%" }[d], h = (((w = o.arrow) == null ? void 0 : w.x) ?? 0) + i / 2, v = (((x = o.arrow) == null ? void 0 : x.y) ?? 0) + l / 2;
|
|
5509
|
+
let g = "", m = "";
|
|
5510
|
+
return f === "bottom" ? (g = a ? p : `${h}px`, m = `${-l}px`) : f === "top" ? (g = a ? p : `${h}px`, m = `${r.floating.height + l}px`) : f === "right" ? (g = `${-l}px`, m = a ? p : `${v}px`) : f === "left" && (g = `${r.floating.width + l}px`, m = a ? p : `${v}px`), { data: { x: g, y: m } };
|
|
5509
5511
|
}
|
|
5510
5512
|
});
|
|
5511
5513
|
function Bi(e) {
|
|
@@ -5520,7 +5522,7 @@ var rs = ki, os = Di, ss = Li, as = $i, km = "Portal", Er = u.forwardRef((e, t)
|
|
|
5520
5522
|
return a ? Rd.createPortal(/* @__PURE__ */ c(ee.div, { ...r, ref: t }), a) : null;
|
|
5521
5523
|
});
|
|
5522
5524
|
Er.displayName = km;
|
|
5523
|
-
var oo = "rovingFocusGroup.onEntryFocus", Mm = { bubbles: !1, cancelable: !0 }, wn = "RovingFocusGroup", [Eo, Ui, Dm] = Go(wn), [Lm, Hi] =
|
|
5525
|
+
var oo = "rovingFocusGroup.onEntryFocus", Mm = { bubbles: !1, cancelable: !0 }, wn = "RovingFocusGroup", [Eo, Ui, Dm] = Go(wn), [Lm, Hi] = Ve(
|
|
5524
5526
|
wn,
|
|
5525
5527
|
[Dm]
|
|
5526
5528
|
), [Fm, $m] = Lm(wn), zi = u.forwardRef(
|
|
@@ -5539,14 +5541,14 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5539
5541
|
onEntryFocus: f,
|
|
5540
5542
|
preventScrollOnEntryFocus: d = !1,
|
|
5541
5543
|
...p
|
|
5542
|
-
} = e,
|
|
5544
|
+
} = e, h = u.useRef(null), v = ie(t, h), g = vr(s), [m, b] = ut({
|
|
5543
5545
|
prop: a,
|
|
5544
5546
|
defaultProp: i ?? null,
|
|
5545
5547
|
onChange: l,
|
|
5546
5548
|
caller: wn
|
|
5547
5549
|
}), [w, x] = u.useState(!1), y = ye(f), C = Ui(n), R = u.useRef(!1), [_, N] = u.useState(0);
|
|
5548
5550
|
return u.useEffect(() => {
|
|
5549
|
-
const k =
|
|
5551
|
+
const k = h.current;
|
|
5550
5552
|
if (k)
|
|
5551
5553
|
return k.addEventListener(oo, y), () => k.removeEventListener(oo, y);
|
|
5552
5554
|
}, [y]), /* @__PURE__ */ c(
|
|
@@ -5556,7 +5558,7 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5556
5558
|
orientation: r,
|
|
5557
5559
|
dir: g,
|
|
5558
5560
|
loop: o,
|
|
5559
|
-
currentTabStopId:
|
|
5561
|
+
currentTabStopId: m,
|
|
5560
5562
|
onItemFocus: u.useCallback(
|
|
5561
5563
|
(k) => b(k),
|
|
5562
5564
|
[b]
|
|
@@ -5586,10 +5588,10 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5586
5588
|
if (k.target === k.currentTarget && L && !w) {
|
|
5587
5589
|
const I = new CustomEvent(oo, Mm);
|
|
5588
5590
|
if (k.currentTarget.dispatchEvent(I), !I.defaultPrevented) {
|
|
5589
|
-
const $ = C().filter((O) => O.focusable), K = $.find((O) => O.active), B = $.find((O) => O.id ===
|
|
5591
|
+
const $ = C().filter((O) => O.focusable), K = $.find((O) => O.active), B = $.find((O) => O.id === m), H = [K, B, ...$].filter(
|
|
5590
5592
|
Boolean
|
|
5591
5593
|
).map((O) => O.ref.current);
|
|
5592
|
-
|
|
5594
|
+
Vi(H, d);
|
|
5593
5595
|
}
|
|
5594
5596
|
}
|
|
5595
5597
|
R.current = !1;
|
|
@@ -5599,7 +5601,7 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5599
5601
|
)
|
|
5600
5602
|
}
|
|
5601
5603
|
);
|
|
5602
|
-
}), Wi = "RovingFocusGroupItem",
|
|
5604
|
+
}), Wi = "RovingFocusGroupItem", ji = u.forwardRef(
|
|
5603
5605
|
(e, t) => {
|
|
5604
5606
|
const {
|
|
5605
5607
|
__scopeRovingFocusGroup: n,
|
|
@@ -5608,7 +5610,7 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5608
5610
|
tabStopId: s,
|
|
5609
5611
|
children: a,
|
|
5610
5612
|
...i
|
|
5611
|
-
} = e, l = He(), f = s || l, d = $m(Wi, n), p = d.currentTabStopId === f,
|
|
5613
|
+
} = e, l = He(), f = s || l, d = $m(Wi, n), p = d.currentTabStopId === f, h = Ui(n), { onFocusableItemAdd: v, onFocusableItemRemove: g, currentTabStopId: m } = d;
|
|
5612
5614
|
return u.useEffect(() => {
|
|
5613
5615
|
if (r)
|
|
5614
5616
|
return v(), () => g();
|
|
@@ -5640,24 +5642,24 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5640
5642
|
if (w !== void 0) {
|
|
5641
5643
|
if (b.metaKey || b.ctrlKey || b.altKey || b.shiftKey) return;
|
|
5642
5644
|
b.preventDefault();
|
|
5643
|
-
let y =
|
|
5645
|
+
let y = h().filter((C) => C.focusable).map((C) => C.ref.current);
|
|
5644
5646
|
if (w === "last") y.reverse();
|
|
5645
5647
|
else if (w === "prev" || w === "next") {
|
|
5646
5648
|
w === "prev" && y.reverse();
|
|
5647
5649
|
const C = y.indexOf(b.currentTarget);
|
|
5648
5650
|
y = d.loop ? Wm(y, C + 1) : y.slice(C + 1);
|
|
5649
5651
|
}
|
|
5650
|
-
setTimeout(() =>
|
|
5652
|
+
setTimeout(() => Vi(y));
|
|
5651
5653
|
}
|
|
5652
5654
|
}),
|
|
5653
|
-
children: typeof a == "function" ? a({ isCurrentTabStop: p, hasTabStop:
|
|
5655
|
+
children: typeof a == "function" ? a({ isCurrentTabStop: p, hasTabStop: m != null }) : a
|
|
5654
5656
|
}
|
|
5655
5657
|
)
|
|
5656
5658
|
}
|
|
5657
5659
|
);
|
|
5658
5660
|
}
|
|
5659
5661
|
);
|
|
5660
|
-
|
|
5662
|
+
ji.displayName = Wi;
|
|
5661
5663
|
var Um = {
|
|
5662
5664
|
ArrowLeft: "prev",
|
|
5663
5665
|
ArrowUp: "prev",
|
|
@@ -5676,7 +5678,7 @@ function zm(e, t, n) {
|
|
|
5676
5678
|
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
|
|
5677
5679
|
return Um[r];
|
|
5678
5680
|
}
|
|
5679
|
-
function
|
|
5681
|
+
function Vi(e, t = !1) {
|
|
5680
5682
|
const n = document.activeElement;
|
|
5681
5683
|
for (const r of e)
|
|
5682
5684
|
if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
@@ -5684,7 +5686,7 @@ function ji(e, t = !1) {
|
|
|
5684
5686
|
function Wm(e, t) {
|
|
5685
5687
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
5686
5688
|
}
|
|
5687
|
-
var
|
|
5689
|
+
var jm = zi, Vm = ji, Km = function(e) {
|
|
5688
5690
|
if (typeof document > "u")
|
|
5689
5691
|
return null;
|
|
5690
5692
|
var t = Array.isArray(e) ? e[0] : e;
|
|
@@ -5708,22 +5710,22 @@ var Vm = zi, jm = Vi, Km = function(e) {
|
|
|
5708
5710
|
};
|
|
5709
5711
|
o.forEach(f);
|
|
5710
5712
|
var d = function(p) {
|
|
5711
|
-
!p || l.has(p) || Array.prototype.forEach.call(p.children, function(
|
|
5712
|
-
if (i.has(
|
|
5713
|
-
d(
|
|
5713
|
+
!p || l.has(p) || Array.prototype.forEach.call(p.children, function(h) {
|
|
5714
|
+
if (i.has(h))
|
|
5715
|
+
d(h);
|
|
5714
5716
|
else
|
|
5715
5717
|
try {
|
|
5716
|
-
var v =
|
|
5717
|
-
It.set(
|
|
5718
|
+
var v = h.getAttribute(r), g = v !== null && v !== "false", m = (It.get(h) || 0) + 1, b = (s.get(h) || 0) + 1;
|
|
5719
|
+
It.set(h, m), s.set(h, b), a.push(h), m === 1 && g && kn.set(h, !0), b === 1 && h.setAttribute(n, "true"), g || h.setAttribute(r, "true");
|
|
5718
5720
|
} catch (w) {
|
|
5719
|
-
console.error("aria-hidden: cannot operate on ",
|
|
5721
|
+
console.error("aria-hidden: cannot operate on ", h, w);
|
|
5720
5722
|
}
|
|
5721
5723
|
});
|
|
5722
5724
|
};
|
|
5723
5725
|
return d(t), i.clear(), so++, function() {
|
|
5724
5726
|
a.forEach(function(p) {
|
|
5725
|
-
var
|
|
5726
|
-
It.set(p,
|
|
5727
|
+
var h = It.get(p) - 1, v = s.get(p) - 1;
|
|
5728
|
+
It.set(p, h), s.set(p, v), h || (kn.has(p) || p.removeAttribute(r), kn.delete(p)), v || p.removeAttribute(n);
|
|
5727
5729
|
}), so--, so || (It = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), Mn = {});
|
|
5728
5730
|
};
|
|
5729
5731
|
}, is = function(e, t, n) {
|
|
@@ -5754,7 +5756,7 @@ function Xm(e, t, n) {
|
|
|
5754
5756
|
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
|
|
5755
5757
|
return e.concat(s || Array.prototype.slice.call(t));
|
|
5756
5758
|
}
|
|
5757
|
-
var Wn = "right-scroll-bar-position",
|
|
5759
|
+
var Wn = "right-scroll-bar-position", jn = "width-before-scroll-bar", Ym = "with-scroll-bars-hidden", Jm = "--removed-body-scroll-bar-size";
|
|
5758
5760
|
function ao(e, t) {
|
|
5759
5761
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
5760
5762
|
}
|
|
@@ -5881,11 +5883,11 @@ var Xi = rg(), io = function() {
|
|
|
5881
5883
|
onScrollCapture: io,
|
|
5882
5884
|
onWheelCapture: io,
|
|
5883
5885
|
onTouchMoveCapture: io
|
|
5884
|
-
}), o = r[0], s = r[1], a = e.forwardProps, i = e.children, l = e.className, f = e.removeScrollBar, d = e.enabled, p = e.shards,
|
|
5886
|
+
}), o = r[0], s = r[1], a = e.forwardProps, i = e.children, l = e.className, f = e.removeScrollBar, d = e.enabled, p = e.shards, h = e.sideCar, v = e.noRelative, g = e.noIsolation, m = e.inert, b = e.allowPinchZoom, w = e.as, x = w === void 0 ? "div" : w, y = e.gapMode, C = Gi(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), R = h, _ = eg([n, t]), N = Xe(Xe({}, C), o);
|
|
5885
5887
|
return u.createElement(
|
|
5886
5888
|
u.Fragment,
|
|
5887
5889
|
null,
|
|
5888
|
-
d && u.createElement(R, { sideCar: Xi, removeScrollBar: f, shards: p, noRelative: v, noIsolation: g, inert:
|
|
5890
|
+
d && u.createElement(R, { sideCar: Xi, removeScrollBar: f, shards: p, noRelative: v, noIsolation: g, inert: m, setCallbacks: s, allowPinchZoom: !!b, lockRef: n, gapMode: y }),
|
|
5889
5891
|
a ? u.cloneElement(u.Children.only(i), Xe(Xe({}, N), { ref: _ })) : u.createElement(x, Xe({}, N, { className: l, ref: _ }), i)
|
|
5890
5892
|
);
|
|
5891
5893
|
});
|
|
@@ -5895,7 +5897,7 @@ Nr.defaultProps = {
|
|
|
5895
5897
|
inert: !1
|
|
5896
5898
|
};
|
|
5897
5899
|
Nr.classNames = {
|
|
5898
|
-
fullWidth:
|
|
5900
|
+
fullWidth: jn,
|
|
5899
5901
|
zeroRight: Wn
|
|
5900
5902
|
};
|
|
5901
5903
|
var sg = function() {
|
|
@@ -5990,7 +5992,7 @@ var lg = function() {
|
|
|
5990
5992
|
right: `).concat(i, "px ").concat(r, `;
|
|
5991
5993
|
}
|
|
5992
5994
|
|
|
5993
|
-
.`).concat(
|
|
5995
|
+
.`).concat(jn, ` {
|
|
5994
5996
|
margin-right: `).concat(i, "px ").concat(r, `;
|
|
5995
5997
|
}
|
|
5996
5998
|
|
|
@@ -5998,7 +6000,7 @@ var lg = function() {
|
|
|
5998
6000
|
right: 0 `).concat(r, `;
|
|
5999
6001
|
}
|
|
6000
6002
|
|
|
6001
|
-
.`).concat(
|
|
6003
|
+
.`).concat(jn, " .").concat(jn, ` {
|
|
6002
6004
|
margin-right: 0 `).concat(r, `;
|
|
6003
6005
|
}
|
|
6004
6006
|
|
|
@@ -6084,12 +6086,12 @@ var _t = No ? { passive: !1 } : !1, vg = function(e) {
|
|
|
6084
6086
|
}, Cg = function(e, t) {
|
|
6085
6087
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
6086
6088
|
}, Eg = function(e, t, n, r, o) {
|
|
6087
|
-
var s = Cg(e, window.getComputedStyle(t).direction), a = s * r, i = n.target, l = t.contains(i), f = !1, d = a > 0, p = 0,
|
|
6089
|
+
var s = Cg(e, window.getComputedStyle(t).direction), a = s * r, i = n.target, l = t.contains(i), f = !1, d = a > 0, p = 0, h = 0;
|
|
6088
6090
|
do {
|
|
6089
6091
|
if (!i)
|
|
6090
6092
|
break;
|
|
6091
|
-
var v = Qi(e, i), g = v[0],
|
|
6092
|
-
(g || w) && Zi(e, i) && (p += w,
|
|
6093
|
+
var v = Qi(e, i), g = v[0], m = v[1], b = v[2], w = m - b - s * g;
|
|
6094
|
+
(g || w) && Zi(e, i) && (p += w, h += g);
|
|
6093
6095
|
var x = i.parentNode;
|
|
6094
6096
|
i = x && x.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? x.host : x;
|
|
6095
6097
|
} while (
|
|
@@ -6097,7 +6099,7 @@ var _t = No ? { passive: !1 } : !1, vg = function(e) {
|
|
|
6097
6099
|
!l && i !== document.body || // self content
|
|
6098
6100
|
l && (t.contains(i) || t === i)
|
|
6099
6101
|
);
|
|
6100
|
-
return (d && Math.abs(p) < 1 || !d && Math.abs(
|
|
6102
|
+
return (d && Math.abs(p) < 1 || !d && Math.abs(h) < 1) && (f = !0), f;
|
|
6101
6103
|
}, Ln = function(e) {
|
|
6102
6104
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
6103
6105
|
}, xa = function(e) {
|
|
@@ -6119,33 +6121,33 @@ function Ag(e) {
|
|
|
6119
6121
|
}, [e]), u.useEffect(function() {
|
|
6120
6122
|
if (e.inert) {
|
|
6121
6123
|
document.body.classList.add("block-interactivity-".concat(o));
|
|
6122
|
-
var
|
|
6123
|
-
return
|
|
6124
|
+
var m = Xm([e.lockRef.current], (e.shards || []).map(Sa), !0).filter(Boolean);
|
|
6125
|
+
return m.forEach(function(b) {
|
|
6124
6126
|
return b.classList.add("allow-interactivity-".concat(o));
|
|
6125
6127
|
}), function() {
|
|
6126
|
-
document.body.classList.remove("block-interactivity-".concat(o)),
|
|
6128
|
+
document.body.classList.remove("block-interactivity-".concat(o)), m.forEach(function(b) {
|
|
6127
6129
|
return b.classList.remove("allow-interactivity-".concat(o));
|
|
6128
6130
|
});
|
|
6129
6131
|
};
|
|
6130
6132
|
}
|
|
6131
6133
|
}, [e.inert, e.lockRef.current, e.shards]);
|
|
6132
|
-
var i = u.useCallback(function(
|
|
6133
|
-
if ("touches" in
|
|
6134
|
+
var i = u.useCallback(function(m, b) {
|
|
6135
|
+
if ("touches" in m && m.touches.length === 2 || m.type === "wheel" && m.ctrlKey)
|
|
6134
6136
|
return !a.current.allowPinchZoom;
|
|
6135
|
-
var w = Ln(
|
|
6136
|
-
if ("touches" in
|
|
6137
|
+
var w = Ln(m), x = n.current, y = "deltaX" in m ? m.deltaX : x[0] - w[0], C = "deltaY" in m ? m.deltaY : x[1] - w[1], R, _ = m.target, N = Math.abs(y) > Math.abs(C) ? "h" : "v";
|
|
6138
|
+
if ("touches" in m && N === "h" && _.type === "range")
|
|
6137
6139
|
return !1;
|
|
6138
6140
|
var k = ya(N, _);
|
|
6139
6141
|
if (!k)
|
|
6140
6142
|
return !0;
|
|
6141
6143
|
if (k ? R = N : (R = N === "v" ? "h" : "v", k = ya(N, _)), !k)
|
|
6142
6144
|
return !1;
|
|
6143
|
-
if (!r.current && "changedTouches" in
|
|
6145
|
+
if (!r.current && "changedTouches" in m && (y || C) && (r.current = R), !R)
|
|
6144
6146
|
return !0;
|
|
6145
6147
|
var L = r.current || R;
|
|
6146
|
-
return Eg(L, b,
|
|
6147
|
-
}, []), l = u.useCallback(function(
|
|
6148
|
-
var b =
|
|
6148
|
+
return Eg(L, b, m, L === "h" ? y : C);
|
|
6149
|
+
}, []), l = u.useCallback(function(m) {
|
|
6150
|
+
var b = m;
|
|
6149
6151
|
if (!(!Ot.length || Ot[Ot.length - 1] !== s)) {
|
|
6150
6152
|
var w = "deltaY" in b ? xa(b) : Ln(b), x = t.current.filter(function(R) {
|
|
6151
6153
|
return R.name === b.type && (R.target === b.target || b.target === R.shadowParent) && Ng(R.delta, w);
|
|
@@ -6161,28 +6163,28 @@ function Ag(e) {
|
|
|
6161
6163
|
C && b.cancelable && b.preventDefault();
|
|
6162
6164
|
}
|
|
6163
6165
|
}
|
|
6164
|
-
}, []), f = u.useCallback(function(
|
|
6165
|
-
var y = { name:
|
|
6166
|
+
}, []), f = u.useCallback(function(m, b, w, x) {
|
|
6167
|
+
var y = { name: m, delta: b, target: w, should: x, shadowParent: Pg(w) };
|
|
6166
6168
|
t.current.push(y), setTimeout(function() {
|
|
6167
6169
|
t.current = t.current.filter(function(C) {
|
|
6168
6170
|
return C !== y;
|
|
6169
6171
|
});
|
|
6170
6172
|
}, 1);
|
|
6171
|
-
}, []), d = u.useCallback(function(
|
|
6172
|
-
n.current = Ln(
|
|
6173
|
-
}, []), p = u.useCallback(function(
|
|
6174
|
-
f(
|
|
6175
|
-
}, []),
|
|
6176
|
-
f(
|
|
6173
|
+
}, []), d = u.useCallback(function(m) {
|
|
6174
|
+
n.current = Ln(m), r.current = void 0;
|
|
6175
|
+
}, []), p = u.useCallback(function(m) {
|
|
6176
|
+
f(m.type, xa(m), m.target, i(m, e.lockRef.current));
|
|
6177
|
+
}, []), h = u.useCallback(function(m) {
|
|
6178
|
+
f(m.type, Ln(m), m.target, i(m, e.lockRef.current));
|
|
6177
6179
|
}, []);
|
|
6178
6180
|
u.useEffect(function() {
|
|
6179
6181
|
return Ot.push(s), e.setCallbacks({
|
|
6180
6182
|
onScrollCapture: p,
|
|
6181
6183
|
onWheelCapture: p,
|
|
6182
|
-
onTouchMoveCapture:
|
|
6184
|
+
onTouchMoveCapture: h
|
|
6183
6185
|
}), document.addEventListener("wheel", l, _t), document.addEventListener("touchmove", l, _t), document.addEventListener("touchstart", d, _t), function() {
|
|
6184
|
-
Ot = Ot.filter(function(
|
|
6185
|
-
return
|
|
6186
|
+
Ot = Ot.filter(function(m) {
|
|
6187
|
+
return m !== s;
|
|
6186
6188
|
}), document.removeEventListener("wheel", l, _t), document.removeEventListener("touchmove", l, _t), document.removeEventListener("touchstart", d, _t);
|
|
6187
6189
|
};
|
|
6188
6190
|
}, []);
|
|
@@ -6210,12 +6212,12 @@ var Ro = ["Enter", " "], _g = ["ArrowDown", "PageUp", "Home"], ec = ["ArrowUp",
|
|
|
6210
6212
|
}, Mg = {
|
|
6211
6213
|
ltr: ["ArrowLeft"],
|
|
6212
6214
|
rtl: ["ArrowRight"]
|
|
6213
|
-
}, yn = "Menu", [cn, Dg, Lg] = Go(yn), [Nt, tc] =
|
|
6215
|
+
}, yn = "Menu", [cn, Dg, Lg] = Go(yn), [Nt, tc] = Ve(yn, [
|
|
6214
6216
|
Lg,
|
|
6215
6217
|
Gt,
|
|
6216
6218
|
Hi
|
|
6217
6219
|
]), Tr = Gt(), nc = Hi(), [Fg, Rt] = Nt(yn), [$g, xn] = Nt(yn), rc = (e) => {
|
|
6218
|
-
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: a = !0 } = e, i = Tr(t), [l, f] = u.useState(null), d = u.useRef(!1), p = ye(s),
|
|
6220
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: a = !0 } = e, i = Tr(t), [l, f] = u.useState(null), d = u.useRef(!1), p = ye(s), h = vr(o);
|
|
6219
6221
|
return u.useEffect(() => {
|
|
6220
6222
|
const v = () => {
|
|
6221
6223
|
d.current = !0, document.addEventListener("pointerdown", g, { capture: !0, once: !0 }), document.addEventListener("pointermove", g, { capture: !0, once: !0 });
|
|
@@ -6237,7 +6239,7 @@ var Ro = ["Enter", " "], _g = ["ArrowDown", "PageUp", "Home"], ec = ["ArrowUp",
|
|
|
6237
6239
|
scope: t,
|
|
6238
6240
|
onClose: u.useCallback(() => p(!1), [p]),
|
|
6239
6241
|
isUsingKeyboardRef: d,
|
|
6240
|
-
dir:
|
|
6242
|
+
dir: h,
|
|
6241
6243
|
modal: a,
|
|
6242
6244
|
children: r
|
|
6243
6245
|
}
|
|
@@ -6301,7 +6303,7 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6301
6303
|
onDismiss: () => n.onOpenChange(!1)
|
|
6302
6304
|
}
|
|
6303
6305
|
);
|
|
6304
|
-
}),
|
|
6306
|
+
}), jg = Ft("MenuContent.ScrollLock"), ds = u.forwardRef(
|
|
6305
6307
|
(e, t) => {
|
|
6306
6308
|
const {
|
|
6307
6309
|
__scopeMenu: n,
|
|
@@ -6314,21 +6316,21 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6314
6316
|
onEscapeKeyDown: f,
|
|
6315
6317
|
onPointerDownOutside: d,
|
|
6316
6318
|
onFocusOutside: p,
|
|
6317
|
-
onInteractOutside:
|
|
6319
|
+
onInteractOutside: h,
|
|
6318
6320
|
onDismiss: v,
|
|
6319
6321
|
disableOutsideScroll: g,
|
|
6320
|
-
...
|
|
6321
|
-
} = e, b = Rt(Fe, n), w = xn(Fe, n), x = Tr(n), y = nc(n), C = Dg(n), [R, _] = u.useState(null), N = u.useRef(null), k = ie(t, N, b.onContentChange), L = u.useRef(0), I = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), M = u.useRef(0), H = g ? Rr : u.Fragment, O = g ? { as:
|
|
6322
|
+
...m
|
|
6323
|
+
} = e, b = Rt(Fe, n), w = xn(Fe, n), x = Tr(n), y = nc(n), C = Dg(n), [R, _] = u.useState(null), N = u.useRef(null), k = ie(t, N, b.onContentChange), L = u.useRef(0), I = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), M = u.useRef(0), H = g ? Rr : u.Fragment, O = g ? { as: jg, allowPinchZoom: !0 } : void 0, G = (T) => {
|
|
6322
6324
|
var z, W;
|
|
6323
|
-
const Q = I.current + T, q = C().filter((
|
|
6324
|
-
(function
|
|
6325
|
-
I.current =
|
|
6325
|
+
const Q = I.current + T, q = C().filter((oe) => !oe.disabled), ae = document.activeElement, F = (z = q.find((oe) => oe.ref.current === ae)) == null ? void 0 : z.textValue, j = q.map((oe) => oe.textValue), ce = nb(j, Q, F), pe = (W = q.find((oe) => oe.textValue === ce)) == null ? void 0 : W.ref.current;
|
|
6326
|
+
(function oe(V) {
|
|
6327
|
+
I.current = V, window.clearTimeout(L.current), V !== "" && (L.current = window.setTimeout(() => oe(""), 1e3));
|
|
6326
6328
|
})(Q), pe && setTimeout(() => pe.focus());
|
|
6327
6329
|
};
|
|
6328
6330
|
u.useEffect(() => () => window.clearTimeout(L.current), []), qo();
|
|
6329
6331
|
const D = u.useCallback((T) => {
|
|
6330
|
-
var q,
|
|
6331
|
-
return B.current === ((q = K.current) == null ? void 0 : q.side) && ob(T, (
|
|
6332
|
+
var q, ae;
|
|
6333
|
+
return B.current === ((q = K.current) == null ? void 0 : q.side) && ob(T, (ae = K.current) == null ? void 0 : ae.area);
|
|
6332
6334
|
}, []);
|
|
6333
6335
|
return /* @__PURE__ */ c(
|
|
6334
6336
|
Hg,
|
|
@@ -6376,10 +6378,10 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6376
6378
|
onEscapeKeyDown: f,
|
|
6377
6379
|
onPointerDownOutside: d,
|
|
6378
6380
|
onFocusOutside: p,
|
|
6379
|
-
onInteractOutside:
|
|
6381
|
+
onInteractOutside: h,
|
|
6380
6382
|
onDismiss: v,
|
|
6381
6383
|
children: /* @__PURE__ */ c(
|
|
6382
|
-
|
|
6384
|
+
jm,
|
|
6383
6385
|
{
|
|
6384
6386
|
asChild: !0,
|
|
6385
6387
|
...y,
|
|
@@ -6401,14 +6403,14 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6401
6403
|
"data-radix-menu-content": "",
|
|
6402
6404
|
dir: w.dir,
|
|
6403
6405
|
...x,
|
|
6404
|
-
...
|
|
6406
|
+
...m,
|
|
6405
6407
|
ref: k,
|
|
6406
|
-
style: { outline: "none", ...
|
|
6407
|
-
onKeyDown: U(
|
|
6408
|
-
const q = T.target.closest("[data-radix-menu-content]") === T.currentTarget,
|
|
6409
|
-
q && (T.key === "Tab" && T.preventDefault(), !
|
|
6410
|
-
const
|
|
6411
|
-
if (T.target !==
|
|
6408
|
+
style: { outline: "none", ...m.style },
|
|
6409
|
+
onKeyDown: U(m.onKeyDown, (T) => {
|
|
6410
|
+
const q = T.target.closest("[data-radix-menu-content]") === T.currentTarget, ae = T.ctrlKey || T.altKey || T.metaKey, F = T.key.length === 1;
|
|
6411
|
+
q && (T.key === "Tab" && T.preventDefault(), !ae && F && G(T.key));
|
|
6412
|
+
const j = N.current;
|
|
6413
|
+
if (T.target !== j || !Og.includes(T.key)) return;
|
|
6412
6414
|
T.preventDefault();
|
|
6413
6415
|
const pe = C().filter((z) => !z.disabled).map((z) => z.ref.current);
|
|
6414
6416
|
ec.includes(T.key) && pe.reverse(), eb(pe);
|
|
@@ -6421,8 +6423,8 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6421
6423
|
ln((T) => {
|
|
6422
6424
|
const Q = T.target, q = M.current !== T.clientX;
|
|
6423
6425
|
if (T.currentTarget.contains(Q) && q) {
|
|
6424
|
-
const
|
|
6425
|
-
B.current =
|
|
6426
|
+
const ae = T.clientX > M.current ? "right" : "left";
|
|
6427
|
+
B.current = ae, M.current = T.clientX;
|
|
6426
6428
|
}
|
|
6427
6429
|
})
|
|
6428
6430
|
)
|
|
@@ -6439,13 +6441,13 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6439
6441
|
}
|
|
6440
6442
|
);
|
|
6441
6443
|
ac.displayName = Fe;
|
|
6442
|
-
var
|
|
6444
|
+
var Vg = "MenuGroup", fs = u.forwardRef(
|
|
6443
6445
|
(e, t) => {
|
|
6444
6446
|
const { __scopeMenu: n, ...r } = e;
|
|
6445
6447
|
return /* @__PURE__ */ c(ee.div, { role: "group", ...r, ref: t });
|
|
6446
6448
|
}
|
|
6447
6449
|
);
|
|
6448
|
-
fs.displayName =
|
|
6450
|
+
fs.displayName = Vg;
|
|
6449
6451
|
var Kg = "MenuLabel", ic = u.forwardRef(
|
|
6450
6452
|
(e, t) => {
|
|
6451
6453
|
const { __scopeMenu: n, ...r } = e;
|
|
@@ -6458,8 +6460,8 @@ var sr = "MenuItem", Ca = "menu.itemSelect", Ar = u.forwardRef(
|
|
|
6458
6460
|
const { disabled: n = !1, onSelect: r, ...o } = e, s = u.useRef(null), a = xn(sr, e.__scopeMenu), i = us(sr, e.__scopeMenu), l = ie(t, s), f = u.useRef(!1), d = () => {
|
|
6459
6461
|
const p = s.current;
|
|
6460
6462
|
if (!n && p) {
|
|
6461
|
-
const
|
|
6462
|
-
p.addEventListener(Ca, (v) => r == null ? void 0 : r(v), { once: !0 }), li(p,
|
|
6463
|
+
const h = new CustomEvent(Ca, { bubbles: !0, cancelable: !0 });
|
|
6464
|
+
p.addEventListener(Ca, (v) => r == null ? void 0 : r(v), { once: !0 }), li(p, h), h.defaultPrevented ? f.current = !1 : a.onClose();
|
|
6463
6465
|
}
|
|
6464
6466
|
};
|
|
6465
6467
|
return /* @__PURE__ */ c(
|
|
@@ -6470,16 +6472,16 @@ var sr = "MenuItem", Ca = "menu.itemSelect", Ar = u.forwardRef(
|
|
|
6470
6472
|
disabled: n,
|
|
6471
6473
|
onClick: U(e.onClick, d),
|
|
6472
6474
|
onPointerDown: (p) => {
|
|
6473
|
-
var
|
|
6474
|
-
(
|
|
6475
|
+
var h;
|
|
6476
|
+
(h = e.onPointerDown) == null || h.call(e, p), f.current = !0;
|
|
6475
6477
|
},
|
|
6476
6478
|
onPointerUp: U(e.onPointerUp, (p) => {
|
|
6477
|
-
var
|
|
6478
|
-
f.current || (
|
|
6479
|
+
var h;
|
|
6480
|
+
f.current || (h = p.currentTarget) == null || h.click();
|
|
6479
6481
|
}),
|
|
6480
6482
|
onKeyDown: U(e.onKeyDown, (p) => {
|
|
6481
|
-
const
|
|
6482
|
-
n ||
|
|
6483
|
+
const h = i.searchRef.current !== "";
|
|
6484
|
+
n || h && p.key === " " || Ro.includes(p.key) && (p.currentTarget.click(), p.preventDefault());
|
|
6483
6485
|
})
|
|
6484
6486
|
}
|
|
6485
6487
|
);
|
|
@@ -6488,7 +6490,7 @@ var sr = "MenuItem", Ca = "menu.itemSelect", Ar = u.forwardRef(
|
|
|
6488
6490
|
Ar.displayName = sr;
|
|
6489
6491
|
var cc = u.forwardRef(
|
|
6490
6492
|
(e, t) => {
|
|
6491
|
-
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, a = us(sr, n), i = nc(n), l = u.useRef(null), f = ie(t, l), [d, p] = u.useState(!1), [
|
|
6493
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, a = us(sr, n), i = nc(n), l = u.useRef(null), f = ie(t, l), [d, p] = u.useState(!1), [h, v] = u.useState("");
|
|
6492
6494
|
return u.useEffect(() => {
|
|
6493
6495
|
const g = l.current;
|
|
6494
6496
|
g && v((g.textContent ?? "").trim());
|
|
@@ -6497,8 +6499,8 @@ var cc = u.forwardRef(
|
|
|
6497
6499
|
{
|
|
6498
6500
|
scope: n,
|
|
6499
6501
|
disabled: r,
|
|
6500
|
-
textValue: o ??
|
|
6501
|
-
children: /* @__PURE__ */ c(
|
|
6502
|
+
textValue: o ?? h,
|
|
6503
|
+
children: /* @__PURE__ */ c(Vm, { asChild: !0, ...i, focusable: !r, children: /* @__PURE__ */ c(
|
|
6502
6504
|
ee.div,
|
|
6503
6505
|
{
|
|
6504
6506
|
role: "menuitem",
|
|
@@ -6646,8 +6648,8 @@ var Qg = "MenuSub", [zy, vc] = Nt(Qg), Qt = "MenuSubTrigger", wc = u.forwardRef(
|
|
|
6646
6648
|
...e,
|
|
6647
6649
|
ref: Wo(t, o.onTriggerChange),
|
|
6648
6650
|
onClick: (p) => {
|
|
6649
|
-
var
|
|
6650
|
-
(
|
|
6651
|
+
var h;
|
|
6652
|
+
(h = e.onClick) == null || h.call(e, p), !(e.disabled || p.defaultPrevented) && (p.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
6651
6653
|
},
|
|
6652
6654
|
onPointerMove: U(
|
|
6653
6655
|
e.onPointerMove,
|
|
@@ -6662,20 +6664,20 @@ var Qg = "MenuSub", [zy, vc] = Nt(Qg), Qt = "MenuSubTrigger", wc = u.forwardRef(
|
|
|
6662
6664
|
ln((p) => {
|
|
6663
6665
|
var v, g;
|
|
6664
6666
|
d();
|
|
6665
|
-
const
|
|
6666
|
-
if (
|
|
6667
|
-
const
|
|
6667
|
+
const h = (v = n.content) == null ? void 0 : v.getBoundingClientRect();
|
|
6668
|
+
if (h) {
|
|
6669
|
+
const m = (g = n.content) == null ? void 0 : g.dataset.side, b = m === "right", w = b ? -5 : 5, x = h[b ? "left" : "right"], y = h[b ? "right" : "left"];
|
|
6668
6670
|
s.onPointerGraceIntentChange({
|
|
6669
6671
|
area: [
|
|
6670
6672
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
6671
6673
|
// consistently within polygon bounds
|
|
6672
6674
|
{ x: p.clientX + w, y: p.clientY },
|
|
6673
|
-
{ x, y:
|
|
6674
|
-
{ x: y, y:
|
|
6675
|
-
{ x: y, y:
|
|
6676
|
-
{ x, y:
|
|
6675
|
+
{ x, y: h.top },
|
|
6676
|
+
{ x: y, y: h.top },
|
|
6677
|
+
{ x: y, y: h.bottom },
|
|
6678
|
+
{ x, y: h.bottom }
|
|
6677
6679
|
],
|
|
6678
|
-
side:
|
|
6680
|
+
side: m
|
|
6679
6681
|
}), window.clearTimeout(i.current), i.current = window.setTimeout(
|
|
6680
6682
|
() => s.onPointerGraceIntentChange(null),
|
|
6681
6683
|
300
|
|
@@ -6688,8 +6690,8 @@ var Qg = "MenuSub", [zy, vc] = Nt(Qg), Qt = "MenuSubTrigger", wc = u.forwardRef(
|
|
|
6688
6690
|
),
|
|
6689
6691
|
onKeyDown: U(e.onKeyDown, (p) => {
|
|
6690
6692
|
var v;
|
|
6691
|
-
const
|
|
6692
|
-
e.disabled ||
|
|
6693
|
+
const h = s.searchRef.current !== "";
|
|
6694
|
+
e.disabled || h && p.key === " " || kg[r.dir].includes(p.key) && (n.onOpenChange(!0), (v = n.content) == null || v.focus(), p.preventDefault());
|
|
6693
6695
|
})
|
|
6694
6696
|
}
|
|
6695
6697
|
) });
|
|
@@ -6724,8 +6726,8 @@ var yc = "MenuSubContent", xc = u.forwardRef(
|
|
|
6724
6726
|
}),
|
|
6725
6727
|
onKeyDown: U(e.onKeyDown, (d) => {
|
|
6726
6728
|
var v;
|
|
6727
|
-
const p = d.currentTarget.contains(d.target),
|
|
6728
|
-
p &&
|
|
6729
|
+
const p = d.currentTarget.contains(d.target), h = Mg[a.dir].includes(d.key);
|
|
6730
|
+
p && h && (s.onOpenChange(!1), (v = i.trigger) == null || v.focus(), d.preventDefault());
|
|
6729
6731
|
})
|
|
6730
6732
|
}
|
|
6731
6733
|
) }) }) });
|
|
@@ -6762,8 +6764,8 @@ function rb(e, t) {
|
|
|
6762
6764
|
const { x: n, y: r } = e;
|
|
6763
6765
|
let o = !1;
|
|
6764
6766
|
for (let s = 0, a = t.length - 1; s < t.length; a = s++) {
|
|
6765
|
-
const i = t[s], l = t[a], f = i.x, d = i.y, p = l.x,
|
|
6766
|
-
d > r !=
|
|
6767
|
+
const i = t[s], l = t[a], f = i.x, d = i.y, p = l.x, h = l.y;
|
|
6768
|
+
d > r != h > r && n < (p - f) * (r - d) / (h - d) + f && (o = !o);
|
|
6767
6769
|
}
|
|
6768
6770
|
return o;
|
|
6769
6771
|
}
|
|
@@ -6775,7 +6777,7 @@ function ob(e, t) {
|
|
|
6775
6777
|
function ln(e) {
|
|
6776
6778
|
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
6777
6779
|
}
|
|
6778
|
-
var sb = rc, ab = cs, ib = sc, cb = ac, lb = fs, ub = ic, db = Ar, fb = lc, pb = dc, hb = pc, mb = mc, gb = gc, bb = bc, vb = wc, wb = xc, Pr = "DropdownMenu", [yb, Wy] =
|
|
6780
|
+
var sb = rc, ab = cs, ib = sc, cb = ac, lb = fs, ub = ic, db = Ar, fb = lc, pb = dc, hb = pc, mb = mc, gb = gc, bb = bc, vb = wc, wb = xc, Pr = "DropdownMenu", [yb, Wy] = Ve(
|
|
6779
6781
|
Pr,
|
|
6780
6782
|
[tc]
|
|
6781
6783
|
), Ee = tc(), [xb, Cc] = yb(Pr), Ec = (e) => {
|
|
@@ -6802,7 +6804,7 @@ var sb = rc, ab = cs, ib = sc, cb = ac, lb = fs, ub = ic, db = Ar, fb = lc, pb =
|
|
|
6802
6804
|
contentId: He(),
|
|
6803
6805
|
open: d,
|
|
6804
6806
|
onOpenChange: p,
|
|
6805
|
-
onOpenToggle: u.useCallback(() => p((
|
|
6807
|
+
onOpenToggle: u.useCallback(() => p((h) => !h), [p]),
|
|
6806
6808
|
modal: i,
|
|
6807
6809
|
children: /* @__PURE__ */ c(sb, { ...l, open: d, onOpenChange: p, dir: r, modal: i, children: n })
|
|
6808
6810
|
}
|
|
@@ -6951,9 +6953,9 @@ var Lb = "DropdownMenuSubContent", Fc = u.forwardRef((e, t) => {
|
|
|
6951
6953
|
);
|
|
6952
6954
|
});
|
|
6953
6955
|
Fc.displayName = Lb;
|
|
6954
|
-
var Fb = Ec, $b = Rc, Bb = Tc, $c = Pc, Bc = Ic, Uc = _c, Hc = Oc, zc = kc, Wc = Mc,
|
|
6956
|
+
var Fb = Ec, $b = Rc, Bb = Tc, $c = Pc, Bc = Ic, Uc = _c, Hc = Oc, zc = kc, Wc = Mc, jc = Dc, Vc = Lc, Kc = Fc;
|
|
6955
6957
|
const Ub = Fb, Hb = $b, zb = u.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ E(
|
|
6956
|
-
|
|
6958
|
+
Vc,
|
|
6957
6959
|
{
|
|
6958
6960
|
ref: o,
|
|
6959
6961
|
className: A(
|
|
@@ -6968,7 +6970,7 @@ const Ub = Fb, Hb = $b, zb = u.forwardRef(({ className: e, inset: t, children: n
|
|
|
6968
6970
|
]
|
|
6969
6971
|
}
|
|
6970
6972
|
));
|
|
6971
|
-
zb.displayName =
|
|
6973
|
+
zb.displayName = Vc.displayName;
|
|
6972
6974
|
const Wb = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
6973
6975
|
Kc,
|
|
6974
6976
|
{
|
|
@@ -7007,7 +7009,7 @@ const To = u.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
7007
7009
|
}
|
|
7008
7010
|
));
|
|
7009
7011
|
To.displayName = Uc.displayName;
|
|
7010
|
-
const
|
|
7012
|
+
const jb = u.forwardRef(({ className: e, children: t, checked: n, ...r }, o) => /* @__PURE__ */ E(
|
|
7011
7013
|
Hc,
|
|
7012
7014
|
{
|
|
7013
7015
|
ref: o,
|
|
@@ -7023,8 +7025,8 @@ const Vb = u.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
|
|
|
7023
7025
|
]
|
|
7024
7026
|
}
|
|
7025
7027
|
));
|
|
7026
|
-
|
|
7027
|
-
const
|
|
7028
|
+
jb.displayName = Hc.displayName;
|
|
7029
|
+
const Vb = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
|
|
7028
7030
|
zc,
|
|
7029
7031
|
{
|
|
7030
7032
|
ref: r,
|
|
@@ -7039,7 +7041,7 @@ const jb = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
7039
7041
|
]
|
|
7040
7042
|
}
|
|
7041
7043
|
));
|
|
7042
|
-
|
|
7044
|
+
Vb.displayName = zc.displayName;
|
|
7043
7045
|
const Kb = u.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ c(
|
|
7044
7046
|
Bc,
|
|
7045
7047
|
{
|
|
@@ -7054,15 +7056,15 @@ const Kb = u.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
7054
7056
|
));
|
|
7055
7057
|
Kb.displayName = Bc.displayName;
|
|
7056
7058
|
const Gb = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
7057
|
-
|
|
7059
|
+
jc,
|
|
7058
7060
|
{
|
|
7059
7061
|
ref: n,
|
|
7060
7062
|
className: A("-mx-1 my-1 h-px bg-muted", e),
|
|
7061
7063
|
...t
|
|
7062
7064
|
}
|
|
7063
7065
|
));
|
|
7064
|
-
Gb.displayName =
|
|
7065
|
-
function
|
|
7066
|
+
Gb.displayName = jc.displayName;
|
|
7067
|
+
function Vn({
|
|
7066
7068
|
className: e = "",
|
|
7067
7069
|
placeholder: t = "Type your message...",
|
|
7068
7070
|
autoFocus: n = !0,
|
|
@@ -7077,10 +7079,10 @@ function jn({
|
|
|
7077
7079
|
onError: p
|
|
7078
7080
|
}) {
|
|
7079
7081
|
const {
|
|
7080
|
-
currentThreadId:
|
|
7082
|
+
currentThreadId: h,
|
|
7081
7083
|
messages: v,
|
|
7082
7084
|
isStreaming: g,
|
|
7083
|
-
streamingAssistantId:
|
|
7085
|
+
streamingAssistantId: m,
|
|
7084
7086
|
error: b,
|
|
7085
7087
|
send: w,
|
|
7086
7088
|
stop: x,
|
|
@@ -7095,11 +7097,11 @@ function jn({
|
|
|
7095
7097
|
} = ai();
|
|
7096
7098
|
try {
|
|
7097
7099
|
const P = typeof window < "u" ? localStorage.getItem("currentThreadId") : null;
|
|
7098
|
-
console.log("ChatInterface debug - useChat()", { currentThreadId:
|
|
7100
|
+
console.log("ChatInterface debug - useChat()", { currentThreadId: h, lastCheckpointId: y, lsThread: P });
|
|
7099
7101
|
} catch (P) {
|
|
7100
7102
|
console.log("ChatInterface debug - localStorage not available", P);
|
|
7101
7103
|
}
|
|
7102
|
-
const [$, K] = re(""), [B, M] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q,
|
|
7104
|
+
const [$, K] = re(""), [B, M] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q, ae] = re(null), [F, j] = re(null), [ce, pe] = re(!1), [z, W] = re(null), [oe, V] = re([]), [X, te] = re(null), me = Te(null), de = Te(null), Z = Te(null), Y = Te(null), he = Te(null), Oe = Te(!1), Ce = Te(!0), Xt = Te(0), st = Te(null), [Tt, Hr] = re("desktop");
|
|
7103
7105
|
ge(() => {
|
|
7104
7106
|
const P = () => {
|
|
7105
7107
|
const J = window.innerWidth;
|
|
@@ -7108,28 +7110,28 @@ function jn({
|
|
|
7108
7110
|
return P(), window.addEventListener("resize", P), () => window.removeEventListener("resize", P);
|
|
7109
7111
|
}, []), ge(() => {
|
|
7110
7112
|
let P = !1;
|
|
7111
|
-
if (!
|
|
7112
|
-
|
|
7113
|
+
if (!h) {
|
|
7114
|
+
V([]), te(null), st.current = null;
|
|
7113
7115
|
return;
|
|
7114
7116
|
}
|
|
7115
7117
|
const J = {
|
|
7116
|
-
threadId:
|
|
7118
|
+
threadId: h,
|
|
7117
7119
|
checkpointId: y ?? null
|
|
7118
7120
|
}, le = st.current;
|
|
7119
7121
|
if (!(le && le.threadId === J.threadId && le.checkpointId === J.checkpointId))
|
|
7120
|
-
return st.current = J, C(
|
|
7122
|
+
return st.current = J, C(h).then((ue) => {
|
|
7121
7123
|
if (console.log("ChatInterface debug - listCheckpoints response:", ue), P) return;
|
|
7122
7124
|
const De = ((ue == null ? void 0 : ue.checkpoints) ?? []).slice().sort((at, Tn) => new Date(Tn.createdAt).getTime() - new Date(at.createdAt).getTime());
|
|
7123
|
-
console.log("ChatInterface debug - computed checkpoints:", De),
|
|
7125
|
+
console.log("ChatInterface debug - computed checkpoints:", De), V(De), te((at) => {
|
|
7124
7126
|
var Tn;
|
|
7125
7127
|
return at ?? ((Tn = De[0]) == null ? void 0 : Tn.checkpointId) ?? null;
|
|
7126
7128
|
});
|
|
7127
7129
|
}).catch(() => {
|
|
7128
|
-
P || (
|
|
7130
|
+
P || (V([]), st.current = null);
|
|
7129
7131
|
}), () => {
|
|
7130
7132
|
P = !0;
|
|
7131
7133
|
};
|
|
7132
|
-
}, [
|
|
7134
|
+
}, [h, y, C]), ge(() => {
|
|
7133
7135
|
y && te(y);
|
|
7134
7136
|
}, [y]);
|
|
7135
7137
|
const At = ve(async () => {
|
|
@@ -7226,19 +7228,19 @@ function jn({
|
|
|
7226
7228
|
M(null), K(""), O(null), de.current && (de.current.style.height = "auto");
|
|
7227
7229
|
}, En = (P) => {
|
|
7228
7230
|
P.key === "Enter" && !P.shiftKey ? (P.preventDefault(), Cn()) : P.key === "Escape" && B && (P.preventDefault(), Yt());
|
|
7229
|
-
},
|
|
7231
|
+
}, se = (P) => {
|
|
7230
7232
|
const J = Array.from(P.target.files || []);
|
|
7231
7233
|
D((le) => [...le, ...J]);
|
|
7232
7234
|
}, xe = (P) => D((J) => J.filter((le, ue) => P !== ue)), Ne = async (P) => {
|
|
7233
7235
|
const J = (P.target.files || [])[0];
|
|
7234
7236
|
if (J) {
|
|
7235
|
-
|
|
7237
|
+
ae(null), j(null), Q(!0);
|
|
7236
7238
|
try {
|
|
7237
7239
|
const le = await I.uploadExcel(J), ue = le.sheets.map((at) => `${at.sheetName} -> ${at.tableName}`).join(", "), De = ue ? `Uploaded ${J.name} (${le.sheets.length} sheet${le.sheets.length === 1 ? "" : "s"}: ${ue})` : `Uploaded ${J.name}`;
|
|
7238
|
-
|
|
7240
|
+
j(De), d == null || d({ file: J, response: le });
|
|
7239
7241
|
} catch (le) {
|
|
7240
7242
|
const ue = le instanceof Error ? le.message : "Failed to upload Excel file";
|
|
7241
|
-
console.error("Excel upload failed", le),
|
|
7243
|
+
console.error("Excel upload failed", le), ae(ue), p == null || p(ue);
|
|
7242
7244
|
} finally {
|
|
7243
7245
|
Q(!1), P.target.value = "";
|
|
7244
7246
|
}
|
|
@@ -7248,14 +7250,14 @@ function jn({
|
|
|
7248
7250
|
const J = Date.parse(P);
|
|
7249
7251
|
return Number.isNaN(J) ? P : new Date(J).toLocaleString();
|
|
7250
7252
|
}, tt = async (P) => {
|
|
7251
|
-
if (
|
|
7253
|
+
if (h) {
|
|
7252
7254
|
if (!P) {
|
|
7253
7255
|
await _(), te(null);
|
|
7254
7256
|
return;
|
|
7255
7257
|
}
|
|
7256
7258
|
await R(P), te(P);
|
|
7257
7259
|
}
|
|
7258
|
-
}, Nn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${l.container || ""}`, Rn = `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 space-y-4 bg-transparent ${l.messagesArea || ""}`,
|
|
7260
|
+
}, Nn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${l.container || ""}`, Rn = `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 space-y-4 bg-transparent ${l.messagesArea || ""}`, jr = `flex-shrink-0 w-full border-t p-4 bg-transparent ${l.inputArea || ""}`;
|
|
7259
7261
|
return /* @__PURE__ */ E("div", { className: Nn, children: [
|
|
7260
7262
|
!!b && !ce && /* @__PURE__ */ E("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
|
|
7261
7263
|
/* @__PURE__ */ c("span", { children: b }),
|
|
@@ -7271,7 +7273,8 @@ function jn({
|
|
|
7271
7273
|
}
|
|
7272
7274
|
)
|
|
7273
7275
|
] }),
|
|
7274
|
-
|
|
7276
|
+
(console.log("Checkpoint toolbar render", { currentThreadId: h, checkpoints: oe, activeCheckpointId: X }), null),
|
|
7277
|
+
h && oe.length > 0 && /* @__PURE__ */ E("div", { className: "flex-shrink-0 flex items-center gap-2 px-4 py-2 border-b border-border bg-muted/60 text-xs dark:bg-muted/50", children: [
|
|
7275
7278
|
/* @__PURE__ */ c("span", { className: "opacity-70", children: "Checkpoint:" }),
|
|
7276
7279
|
/* @__PURE__ */ E(
|
|
7277
7280
|
"select",
|
|
@@ -7284,7 +7287,7 @@ function jn({
|
|
|
7284
7287
|
},
|
|
7285
7288
|
children: [
|
|
7286
7289
|
/* @__PURE__ */ c("option", { value: "", children: "Latest" }),
|
|
7287
|
-
|
|
7290
|
+
oe.map((P) => /* @__PURE__ */ E("option", { value: P.checkpointId, children: [
|
|
7288
7291
|
Be(P.createdAt),
|
|
7289
7292
|
P.preview ? ` — ${P.preview.slice(0, 40)}` : ""
|
|
7290
7293
|
] }, P.checkpointId))
|
|
@@ -7306,7 +7309,7 @@ function jn({
|
|
|
7306
7309
|
{
|
|
7307
7310
|
message: P,
|
|
7308
7311
|
messageIndex: J,
|
|
7309
|
-
isStreamingMessage: g &&
|
|
7312
|
+
isStreamingMessage: g && m === P.id,
|
|
7310
7313
|
streamingDebounceMs: o,
|
|
7311
7314
|
isEditing: B === P.id,
|
|
7312
7315
|
showActions: i,
|
|
@@ -7329,7 +7332,7 @@ function jn({
|
|
|
7329
7332
|
]
|
|
7330
7333
|
}
|
|
7331
7334
|
),
|
|
7332
|
-
/* @__PURE__ */ E("div", { className:
|
|
7335
|
+
/* @__PURE__ */ E("div", { className: jr, children: [
|
|
7333
7336
|
B && /* @__PURE__ */ c("div", { className: "mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
|
|
7334
7337
|
/* @__PURE__ */ E("div", { className: "flex items-center gap-2", children: [
|
|
7335
7338
|
/* @__PURE__ */ c(ka, { size: 16, className: "text-blue-600" }),
|
|
@@ -7354,7 +7357,7 @@ function jn({
|
|
|
7354
7357
|
ref: Z,
|
|
7355
7358
|
type: "file",
|
|
7356
7359
|
multiple: !0,
|
|
7357
|
-
onChange: (P) =>
|
|
7360
|
+
onChange: (P) => se(P),
|
|
7358
7361
|
className: "hidden"
|
|
7359
7362
|
}
|
|
7360
7363
|
),
|
|
@@ -7501,7 +7504,7 @@ function Ao(e, [t, n]) {
|
|
|
7501
7504
|
function qb(e, t) {
|
|
7502
7505
|
return u.useReducer((n, r) => t[n][r] ?? n, e);
|
|
7503
7506
|
}
|
|
7504
|
-
var ms = "ScrollArea", [qc,
|
|
7507
|
+
var ms = "ScrollArea", [qc, jy] = Ve(ms), [Xb, $e] = qc(ms), Xc = u.forwardRef(
|
|
7505
7508
|
(e, t) => {
|
|
7506
7509
|
const {
|
|
7507
7510
|
__scopeScrollArea: n,
|
|
@@ -7509,7 +7512,7 @@ var ms = "ScrollArea", [qc, Vy] = je(ms), [Xb, $e] = qc(ms), Xc = u.forwardRef(
|
|
|
7509
7512
|
dir: o,
|
|
7510
7513
|
scrollHideDelay: s = 600,
|
|
7511
7514
|
...a
|
|
7512
|
-
} = e, [i, l] = u.useState(null), [f, d] = u.useState(null), [p,
|
|
7515
|
+
} = e, [i, l] = u.useState(null), [f, d] = u.useState(null), [p, h] = u.useState(null), [v, g] = u.useState(null), [m, b] = u.useState(null), [w, x] = u.useState(0), [y, C] = u.useState(0), [R, _] = u.useState(!1), [N, k] = u.useState(!1), L = ie(t, ($) => l($)), I = vr(o);
|
|
7513
7516
|
return /* @__PURE__ */ c(
|
|
7514
7517
|
Xb,
|
|
7515
7518
|
{
|
|
@@ -7521,12 +7524,12 @@ var ms = "ScrollArea", [qc, Vy] = je(ms), [Xb, $e] = qc(ms), Xc = u.forwardRef(
|
|
|
7521
7524
|
viewport: f,
|
|
7522
7525
|
onViewportChange: d,
|
|
7523
7526
|
content: p,
|
|
7524
|
-
onContentChange:
|
|
7527
|
+
onContentChange: h,
|
|
7525
7528
|
scrollbarX: v,
|
|
7526
7529
|
onScrollbarXChange: g,
|
|
7527
7530
|
scrollbarXEnabled: R,
|
|
7528
7531
|
onScrollbarXEnabledChange: _,
|
|
7529
|
-
scrollbarY:
|
|
7532
|
+
scrollbarY: m,
|
|
7530
7533
|
onScrollbarYChange: b,
|
|
7531
7534
|
scrollbarYEnabled: N,
|
|
7532
7535
|
onScrollbarYEnabledChange: k,
|
|
@@ -7654,11 +7657,11 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7654
7657
|
const f = o.viewport, d = s ? "scrollLeft" : "scrollTop";
|
|
7655
7658
|
if (f) {
|
|
7656
7659
|
let p = f[d];
|
|
7657
|
-
const
|
|
7660
|
+
const h = () => {
|
|
7658
7661
|
const v = f[d];
|
|
7659
7662
|
p !== v && (l("SCROLL"), a()), p = v;
|
|
7660
7663
|
};
|
|
7661
|
-
return f.addEventListener("scroll",
|
|
7664
|
+
return f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
|
|
7662
7665
|
}
|
|
7663
7666
|
}, [o.viewport, s, l, a]), /* @__PURE__ */ c(_e, { present: n || i !== "hidden", children: /* @__PURE__ */ c(
|
|
7664
7667
|
bs,
|
|
@@ -7695,12 +7698,12 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7695
7698
|
sizes: i,
|
|
7696
7699
|
onSizesChange: l,
|
|
7697
7700
|
hasThumb: f > 0 && f < 1,
|
|
7698
|
-
onThumbChange: (
|
|
7701
|
+
onThumbChange: (h) => s.current = h,
|
|
7699
7702
|
onThumbPointerUp: () => a.current = 0,
|
|
7700
|
-
onThumbPointerDown: (
|
|
7703
|
+
onThumbPointerDown: (h) => a.current = h
|
|
7701
7704
|
};
|
|
7702
|
-
function p(
|
|
7703
|
-
return rv(
|
|
7705
|
+
function p(h, v) {
|
|
7706
|
+
return rv(h, a.current, i, v);
|
|
7704
7707
|
}
|
|
7705
7708
|
return n === "horizontal" ? /* @__PURE__ */ c(
|
|
7706
7709
|
Zb,
|
|
@@ -7709,15 +7712,15 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7709
7712
|
ref: t,
|
|
7710
7713
|
onThumbPositionChange: () => {
|
|
7711
7714
|
if (o.viewport && s.current) {
|
|
7712
|
-
const
|
|
7715
|
+
const h = o.viewport.scrollLeft, v = Ea(h, i, o.dir);
|
|
7713
7716
|
s.current.style.transform = `translate3d(${v}px, 0, 0)`;
|
|
7714
7717
|
}
|
|
7715
7718
|
},
|
|
7716
|
-
onWheelScroll: (
|
|
7717
|
-
o.viewport && (o.viewport.scrollLeft =
|
|
7719
|
+
onWheelScroll: (h) => {
|
|
7720
|
+
o.viewport && (o.viewport.scrollLeft = h);
|
|
7718
7721
|
},
|
|
7719
|
-
onDragScroll: (
|
|
7720
|
-
o.viewport && (o.viewport.scrollLeft = p(
|
|
7722
|
+
onDragScroll: (h) => {
|
|
7723
|
+
o.viewport && (o.viewport.scrollLeft = p(h, o.dir));
|
|
7721
7724
|
}
|
|
7722
7725
|
}
|
|
7723
7726
|
) : n === "vertical" ? /* @__PURE__ */ c(
|
|
@@ -7727,15 +7730,15 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7727
7730
|
ref: t,
|
|
7728
7731
|
onThumbPositionChange: () => {
|
|
7729
7732
|
if (o.viewport && s.current) {
|
|
7730
|
-
const
|
|
7733
|
+
const h = o.viewport.scrollTop, v = Ea(h, i);
|
|
7731
7734
|
s.current.style.transform = `translate3d(0, ${v}px, 0)`;
|
|
7732
7735
|
}
|
|
7733
7736
|
},
|
|
7734
|
-
onWheelScroll: (
|
|
7735
|
-
o.viewport && (o.viewport.scrollTop =
|
|
7737
|
+
onWheelScroll: (h) => {
|
|
7738
|
+
o.viewport && (o.viewport.scrollTop = h);
|
|
7736
7739
|
},
|
|
7737
|
-
onDragScroll: (
|
|
7738
|
-
o.viewport && (o.viewport.scrollTop = p(
|
|
7740
|
+
onDragScroll: (h) => {
|
|
7741
|
+
o.viewport && (o.viewport.scrollTop = p(h));
|
|
7739
7742
|
}
|
|
7740
7743
|
}
|
|
7741
7744
|
) : null;
|
|
@@ -7761,8 +7764,8 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7761
7764
|
onDragScroll: (d) => e.onDragScroll(d.x),
|
|
7762
7765
|
onWheelScroll: (d, p) => {
|
|
7763
7766
|
if (s.viewport) {
|
|
7764
|
-
const
|
|
7765
|
-
e.onWheelScroll(
|
|
7767
|
+
const h = s.viewport.scrollLeft + d.deltaX;
|
|
7768
|
+
e.onWheelScroll(h), sl(h, p) && d.preventDefault();
|
|
7766
7769
|
}
|
|
7767
7770
|
},
|
|
7768
7771
|
onResize: () => {
|
|
@@ -7801,8 +7804,8 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7801
7804
|
onDragScroll: (d) => e.onDragScroll(d.y),
|
|
7802
7805
|
onWheelScroll: (d, p) => {
|
|
7803
7806
|
if (s.viewport) {
|
|
7804
|
-
const
|
|
7805
|
-
e.onWheelScroll(
|
|
7807
|
+
const h = s.viewport.scrollTop + d.deltaY;
|
|
7808
|
+
e.onWheelScroll(h), sl(h, p) && d.preventDefault();
|
|
7806
7809
|
}
|
|
7807
7810
|
},
|
|
7808
7811
|
onResize: () => {
|
|
@@ -7830,8 +7833,8 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7830
7833
|
onDragScroll: f,
|
|
7831
7834
|
onWheelScroll: d,
|
|
7832
7835
|
onResize: p,
|
|
7833
|
-
...
|
|
7834
|
-
} = e, v = $e(et, n), [g,
|
|
7836
|
+
...h
|
|
7837
|
+
} = e, v = $e(et, n), [g, m] = u.useState(null), b = ie(t, (L) => m(L)), w = u.useRef(null), x = u.useRef(""), y = v.viewport, C = r.content - r.viewport, R = ye(d), _ = ye(l), N = _r(p, 10);
|
|
7835
7838
|
function k(L) {
|
|
7836
7839
|
if (w.current) {
|
|
7837
7840
|
const I = L.clientX - w.current.left, $ = L.clientY - w.current.top;
|
|
@@ -7857,9 +7860,9 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7857
7860
|
children: /* @__PURE__ */ c(
|
|
7858
7861
|
ee.div,
|
|
7859
7862
|
{
|
|
7860
|
-
...
|
|
7863
|
+
...h,
|
|
7861
7864
|
ref: b,
|
|
7862
|
-
style: { position: "absolute", ...
|
|
7865
|
+
style: { position: "absolute", ...h.style },
|
|
7863
7866
|
onPointerDown: U(e.onPointerDown, (L) => {
|
|
7864
7867
|
L.button === 0 && (L.target.setPointerCapture(L.pointerId), w.current = g.getBoundingClientRect(), x.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), k(L));
|
|
7865
7868
|
}),
|
|
@@ -7888,13 +7891,13 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7888
7891
|
return u.useEffect(() => {
|
|
7889
7892
|
const p = s.viewport;
|
|
7890
7893
|
if (p) {
|
|
7891
|
-
const
|
|
7894
|
+
const h = () => {
|
|
7892
7895
|
if (d(), !f.current) {
|
|
7893
7896
|
const v = ov(p, i);
|
|
7894
7897
|
f.current = v, i();
|
|
7895
7898
|
}
|
|
7896
7899
|
};
|
|
7897
|
-
return i(), p.addEventListener("scroll",
|
|
7900
|
+
return i(), p.addEventListener("scroll", h), () => p.removeEventListener("scroll", h);
|
|
7898
7901
|
}
|
|
7899
7902
|
}, [s.viewport, d, i]), /* @__PURE__ */ c(
|
|
7900
7903
|
ee.div,
|
|
@@ -7908,8 +7911,8 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7908
7911
|
...r
|
|
7909
7912
|
},
|
|
7910
7913
|
onPointerDownCapture: U(e.onPointerDownCapture, (p) => {
|
|
7911
|
-
const v = p.target.getBoundingClientRect(), g = p.clientX - v.left,
|
|
7912
|
-
a.onThumbPointerDown({ x: g, y:
|
|
7914
|
+
const v = p.target.getBoundingClientRect(), g = p.clientX - v.left, m = p.clientY - v.top;
|
|
7915
|
+
a.onThumbPointerDown({ x: g, y: m });
|
|
7913
7916
|
}),
|
|
7914
7917
|
onPointerUp: U(e.onPointerUp, a.onThumbPointerUp)
|
|
7915
7918
|
}
|
|
@@ -8054,61 +8057,61 @@ function Po({
|
|
|
8054
8057
|
}) {
|
|
8055
8058
|
const {
|
|
8056
8059
|
loadThread: p,
|
|
8057
|
-
threads:
|
|
8060
|
+
threads: h,
|
|
8058
8061
|
refreshThreads: v,
|
|
8059
8062
|
currentThreadId: g,
|
|
8060
|
-
createThread:
|
|
8063
|
+
createThread: m,
|
|
8061
8064
|
deleteThread: b,
|
|
8062
8065
|
renameThread: w
|
|
8063
|
-
} = ai(), [x, y] = re(
|
|
8066
|
+
} = ai(), [x, y] = re(h ?? []), [C, R] = re(!1), [_, N] = re(null), [k, L] = re(null), [I, $] = re(""), [K, B] = re(!1);
|
|
8064
8067
|
ge(() => {
|
|
8065
|
-
y(
|
|
8066
|
-
}, [
|
|
8068
|
+
y(h ?? []);
|
|
8069
|
+
}, [h]);
|
|
8067
8070
|
const M = async (F) => {
|
|
8068
8071
|
try {
|
|
8069
8072
|
await p(F), i == null || i(F), l == null || l(F);
|
|
8070
|
-
} catch (
|
|
8071
|
-
console.error("Failed to select thread:",
|
|
8073
|
+
} catch (j) {
|
|
8074
|
+
console.error("Failed to select thread:", j);
|
|
8072
8075
|
}
|
|
8073
8076
|
}, H = async () => {
|
|
8074
8077
|
try {
|
|
8075
8078
|
B(!0);
|
|
8076
|
-
const F = await
|
|
8079
|
+
const F = await m();
|
|
8077
8080
|
f == null || f(F), i == null || i(F);
|
|
8078
8081
|
} catch (F) {
|
|
8079
8082
|
console.error("Failed to create thread:", F);
|
|
8080
8083
|
} finally {
|
|
8081
8084
|
B(!1);
|
|
8082
8085
|
}
|
|
8083
|
-
}, O = async (F,
|
|
8084
|
-
if (
|
|
8086
|
+
}, O = async (F, j) => {
|
|
8087
|
+
if (j.stopPropagation(), !!confirm("Delete this thread?"))
|
|
8085
8088
|
try {
|
|
8086
8089
|
await b(F), d == null || d(F);
|
|
8087
8090
|
} catch (ce) {
|
|
8088
8091
|
console.error("Failed to delete thread:", ce);
|
|
8089
8092
|
}
|
|
8090
|
-
}, G = (F,
|
|
8091
|
-
|
|
8093
|
+
}, G = (F, j) => {
|
|
8094
|
+
j.stopPropagation(), L(F.threadId), $(F.title || `Thread ${F.threadId.slice(0, 8)}`);
|
|
8092
8095
|
}, D = async (F) => {
|
|
8093
8096
|
if (I.trim())
|
|
8094
8097
|
try {
|
|
8095
8098
|
await w(F, I.trim()), L(null), $("");
|
|
8096
|
-
} catch (
|
|
8097
|
-
console.error("Failed to update title:",
|
|
8099
|
+
} catch (j) {
|
|
8100
|
+
console.error("Failed to update title:", j);
|
|
8098
8101
|
}
|
|
8099
8102
|
}, T = () => {
|
|
8100
8103
|
L(null), $("");
|
|
8101
|
-
}, Q = (F,
|
|
8102
|
-
F.key === "Enter" ? D(
|
|
8104
|
+
}, Q = (F, j) => {
|
|
8105
|
+
F.key === "Enter" ? D(j) : F.key === "Escape" && T();
|
|
8103
8106
|
}, q = (F) => {
|
|
8104
8107
|
if (!F) return "";
|
|
8105
8108
|
try {
|
|
8106
|
-
const
|
|
8107
|
-
return z === 0 ?
|
|
8109
|
+
const j = new Date(F), pe = (/* @__PURE__ */ new Date()).getTime() - j.getTime(), z = Math.floor(pe / (1e3 * 60 * 60 * 24));
|
|
8110
|
+
return z === 0 ? j.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : z === 1 ? "Yesterday" : z < 7 ? `${z} days ago` : j.toLocaleDateString();
|
|
8108
8111
|
} catch {
|
|
8109
8112
|
return "";
|
|
8110
8113
|
}
|
|
8111
|
-
},
|
|
8114
|
+
}, ae = (F) => F.title || `Thread ${F.threadId.slice(0, 8)}`;
|
|
8112
8115
|
return /* @__PURE__ */ E("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
8113
8116
|
t && /* @__PURE__ */ c("div", { className: s.header || "flex-shrink-0 p-2 border-b bg-slate-800 border-slate-700 text-slate-100 flex justify-end", children: /* @__PURE__ */ c(
|
|
8114
8117
|
fe,
|
|
@@ -8130,32 +8133,32 @@ function Po({
|
|
|
8130
8133
|
children: /* @__PURE__ */ c("div", { className: "p-2 space-y-1 pb-4", children: C ? /* @__PURE__ */ c("div", { className: "text-center py-8 text-slate-400", children: "Loading…" }) : x.length === 0 ? /* @__PURE__ */ E("div", { className: "text-center py-8 text-slate-400", children: [
|
|
8131
8134
|
/* @__PURE__ */ c(fd, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
|
|
8132
8135
|
/* @__PURE__ */ c("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
|
|
8133
|
-
] }) : x.slice().sort((F,
|
|
8136
|
+
] }) : x.slice().sort((F, j) => new Date(j.updatedAt || j.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ E(
|
|
8134
8137
|
"div",
|
|
8135
8138
|
{
|
|
8136
8139
|
onClick: () => M(F.threadId),
|
|
8137
8140
|
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(a ?? g) === 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`,
|
|
8138
8141
|
children: [
|
|
8139
8142
|
/* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
|
|
8140
|
-
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: k === F.threadId ? /* @__PURE__ */ E("div", { className: "flex items-center gap-2", onClick: (
|
|
8141
|
-
/* @__PURE__ */ c(un, { value: I, onChange: (
|
|
8143
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: k === F.threadId ? /* @__PURE__ */ E("div", { className: "flex items-center gap-2", onClick: (j) => j.stopPropagation(), children: [
|
|
8144
|
+
/* @__PURE__ */ c(un, { value: I, onChange: (j) => $(j.target.value), onKeyDown: (j) => Q(j, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
8142
8145
|
/* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: () => D(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(Bo, { size: 12 }) }),
|
|
8143
8146
|
/* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: T, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(tn, { size: 12 }) })
|
|
8144
8147
|
] }) : /* @__PURE__ */ E(Ae, { children: [
|
|
8145
|
-
/* @__PURE__ */ c("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children:
|
|
8148
|
+
/* @__PURE__ */ c("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: ae(F) }),
|
|
8146
8149
|
/* @__PURE__ */ E("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
|
|
8147
8150
|
/* @__PURE__ */ c(pd, { size: 10 }),
|
|
8148
8151
|
/* @__PURE__ */ c("span", { children: q(F.updatedAt || F.createdAt) })
|
|
8149
8152
|
] })
|
|
8150
8153
|
] }) }),
|
|
8151
8154
|
/* @__PURE__ */ E("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
8152
|
-
r && k !== F.threadId && /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: (
|
|
8155
|
+
r && k !== F.threadId && /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: (j) => G(F, j), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c(ka, { size: 12 }) }),
|
|
8153
8156
|
n && /* @__PURE__ */ c(
|
|
8154
8157
|
fe,
|
|
8155
8158
|
{
|
|
8156
8159
|
variant: "ghost",
|
|
8157
8160
|
size: "sm",
|
|
8158
|
-
onClick: (
|
|
8161
|
+
onClick: (j) => O(F.threadId, j),
|
|
8159
8162
|
className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
|
|
8160
8163
|
title: "Delete thread",
|
|
8161
8164
|
children: /* @__PURE__ */ c(hd, { size: 12 })
|
|
@@ -8173,7 +8176,7 @@ function Po({
|
|
|
8173
8176
|
] });
|
|
8174
8177
|
}
|
|
8175
8178
|
const ll = _a(null);
|
|
8176
|
-
function
|
|
8179
|
+
function Vy({ children: e, basePath: t = "/chat" }) {
|
|
8177
8180
|
const n = gt(() => t ? t === "/" ? "" : t.endsWith("/") ? t.slice(0, -1) : t : "/chat", [t]), r = {
|
|
8178
8181
|
basePath: n,
|
|
8179
8182
|
buildThreadPath: (o) => `${n}/${o}`,
|
|
@@ -8297,7 +8300,7 @@ const ws = u.forwardRef(
|
|
|
8297
8300
|
)
|
|
8298
8301
|
);
|
|
8299
8302
|
ws.displayName = fl.displayName;
|
|
8300
|
-
var Or = "Dialog", [pl, Xy] =
|
|
8303
|
+
var Or = "Dialog", [pl, Xy] = Ve(Or), [bv, Ke] = pl(Or), hl = (e) => {
|
|
8301
8304
|
const {
|
|
8302
8305
|
__scopeDialog: t,
|
|
8303
8306
|
children: n,
|
|
@@ -8636,7 +8639,7 @@ var $l = Object.freeze({
|
|
|
8636
8639
|
)
|
|
8637
8640
|
);
|
|
8638
8641
|
Bl.displayName = kv;
|
|
8639
|
-
var Mv = Bl, [kr, Jy] =
|
|
8642
|
+
var Mv = Bl, [kr, Jy] = Ve("Tooltip", [
|
|
8640
8643
|
Gt
|
|
8641
8644
|
]), Mr = Gt(), Ul = "TooltipProvider", Dv = 700, Io = "tooltip.open", [Lv, Es] = kr(Ul), Hl = (e) => {
|
|
8642
8645
|
const {
|
|
@@ -8683,7 +8686,7 @@ var dn = "Tooltip", [Fv, Dr] = kr(dn), zl = (e) => {
|
|
|
8683
8686
|
onOpenChange: s,
|
|
8684
8687
|
disableHoverableContent: a,
|
|
8685
8688
|
delayDuration: i
|
|
8686
|
-
} = e, l = Es(dn, e.__scopeTooltip), f = Mr(t), [d, p] = u.useState(null),
|
|
8689
|
+
} = e, l = Es(dn, e.__scopeTooltip), f = Mr(t), [d, p] = u.useState(null), h = He(), v = u.useRef(0), g = a ?? l.disableHoverableContent, m = i ?? l.delayDuration, b = u.useRef(!1), [w, x] = ut({
|
|
8687
8690
|
prop: r,
|
|
8688
8691
|
defaultProp: o ?? !1,
|
|
8689
8692
|
onChange: (N) => {
|
|
@@ -8697,15 +8700,15 @@ var dn = "Tooltip", [Fv, Dr] = kr(dn), zl = (e) => {
|
|
|
8697
8700
|
}, [x]), _ = u.useCallback(() => {
|
|
8698
8701
|
window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
8699
8702
|
b.current = !0, x(!0), v.current = 0;
|
|
8700
|
-
},
|
|
8701
|
-
}, [
|
|
8703
|
+
}, m);
|
|
8704
|
+
}, [m, x]);
|
|
8702
8705
|
return u.useEffect(() => () => {
|
|
8703
8706
|
v.current && (window.clearTimeout(v.current), v.current = 0);
|
|
8704
8707
|
}, []), /* @__PURE__ */ c(rs, { ...f, children: /* @__PURE__ */ c(
|
|
8705
8708
|
Fv,
|
|
8706
8709
|
{
|
|
8707
8710
|
scope: t,
|
|
8708
|
-
contentId:
|
|
8711
|
+
contentId: h,
|
|
8709
8712
|
open: w,
|
|
8710
8713
|
stateAttribute: y,
|
|
8711
8714
|
trigger: d,
|
|
@@ -8734,8 +8737,8 @@ var _o = "TooltipTrigger", Wl = u.forwardRef(
|
|
|
8734
8737
|
"data-state": o.stateAttribute,
|
|
8735
8738
|
...r,
|
|
8736
8739
|
ref: l,
|
|
8737
|
-
onPointerMove: U(e.onPointerMove, (
|
|
8738
|
-
|
|
8740
|
+
onPointerMove: U(e.onPointerMove, (h) => {
|
|
8741
|
+
h.pointerType !== "touch" && !d.current && !s.isPointerInTransitRef.current && (o.onTriggerEnter(), d.current = !0);
|
|
8739
8742
|
}),
|
|
8740
8743
|
onPointerLeave: U(e.onPointerLeave, () => {
|
|
8741
8744
|
o.onTriggerLeave(), d.current = !1;
|
|
@@ -8755,38 +8758,38 @@ var _o = "TooltipTrigger", Wl = u.forwardRef(
|
|
|
8755
8758
|
Wl.displayName = _o;
|
|
8756
8759
|
var $v = "TooltipPortal", [Zy, Bv] = kr($v, {
|
|
8757
8760
|
forceMount: void 0
|
|
8758
|
-
}), Ht = "TooltipContent",
|
|
8761
|
+
}), Ht = "TooltipContent", jl = u.forwardRef(
|
|
8759
8762
|
(e, t) => {
|
|
8760
8763
|
const n = Bv(Ht, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = Dr(Ht, e.__scopeTooltip);
|
|
8761
|
-
return /* @__PURE__ */ c(_e, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(
|
|
8764
|
+
return /* @__PURE__ */ c(_e, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(Vl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c(Uv, { side: o, ...s, ref: t }) });
|
|
8762
8765
|
}
|
|
8763
8766
|
), Uv = u.forwardRef((e, t) => {
|
|
8764
|
-
const n = Dr(Ht, e.__scopeTooltip), r = Es(Ht, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r,
|
|
8767
|
+
const n = Dr(Ht, e.__scopeTooltip), r = Es(Ht, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, h = u.useCallback(() => {
|
|
8765
8768
|
i(null), p(!1);
|
|
8766
8769
|
}, [p]), v = u.useCallback(
|
|
8767
|
-
(g,
|
|
8768
|
-
const b = g.currentTarget, w = { x: g.clientX, y: g.clientY }, x =
|
|
8770
|
+
(g, m) => {
|
|
8771
|
+
const b = g.currentTarget, w = { x: g.clientX, y: g.clientY }, x = Vv(w, b.getBoundingClientRect()), y = Kv(w, x), C = Gv(m.getBoundingClientRect()), R = Xv([...y, ...C]);
|
|
8769
8772
|
i(R), p(!0);
|
|
8770
8773
|
},
|
|
8771
8774
|
[p]
|
|
8772
8775
|
);
|
|
8773
|
-
return u.useEffect(() => () =>
|
|
8776
|
+
return u.useEffect(() => () => h(), [h]), u.useEffect(() => {
|
|
8774
8777
|
if (l && d) {
|
|
8775
|
-
const g = (b) => v(b, d),
|
|
8776
|
-
return l.addEventListener("pointerleave", g), d.addEventListener("pointerleave",
|
|
8777
|
-
l.removeEventListener("pointerleave", g), d.removeEventListener("pointerleave",
|
|
8778
|
+
const g = (b) => v(b, d), m = (b) => v(b, l);
|
|
8779
|
+
return l.addEventListener("pointerleave", g), d.addEventListener("pointerleave", m), () => {
|
|
8780
|
+
l.removeEventListener("pointerleave", g), d.removeEventListener("pointerleave", m);
|
|
8778
8781
|
};
|
|
8779
8782
|
}
|
|
8780
|
-
}, [l, d, v,
|
|
8783
|
+
}, [l, d, v, h]), u.useEffect(() => {
|
|
8781
8784
|
if (a) {
|
|
8782
|
-
const g = (
|
|
8783
|
-
const b =
|
|
8784
|
-
x ?
|
|
8785
|
+
const g = (m) => {
|
|
8786
|
+
const b = m.target, w = { x: m.clientX, y: m.clientY }, x = (l == null ? void 0 : l.contains(b)) || (d == null ? void 0 : d.contains(b)), y = !qv(w, a);
|
|
8787
|
+
x ? h() : y && (h(), f());
|
|
8785
8788
|
};
|
|
8786
8789
|
return document.addEventListener("pointermove", g), () => document.removeEventListener("pointermove", g);
|
|
8787
8790
|
}
|
|
8788
|
-
}, [l, d, a, f,
|
|
8789
|
-
}), [Hv, zv] = kr(dn, { isInside: !1 }), Wv = Cd("TooltipContent"),
|
|
8791
|
+
}, [l, d, a, f, h]), /* @__PURE__ */ c(Vl, { ...e, ref: s });
|
|
8792
|
+
}), [Hv, zv] = kr(dn, { isInside: !1 }), Wv = Cd("TooltipContent"), Vl = u.forwardRef(
|
|
8790
8793
|
(e, t) => {
|
|
8791
8794
|
const {
|
|
8792
8795
|
__scopeTooltip: n,
|
|
@@ -8798,8 +8801,8 @@ var $v = "TooltipPortal", [Zy, Bv] = kr($v, {
|
|
|
8798
8801
|
} = e, l = Dr(Ht, n), f = Mr(n), { onClose: d } = l;
|
|
8799
8802
|
return u.useEffect(() => (document.addEventListener(Io, d), () => document.removeEventListener(Io, d)), [d]), u.useEffect(() => {
|
|
8800
8803
|
if (l.trigger) {
|
|
8801
|
-
const p = (
|
|
8802
|
-
const v =
|
|
8804
|
+
const p = (h) => {
|
|
8805
|
+
const v = h.target;
|
|
8803
8806
|
v != null && v.contains(l.trigger) && d();
|
|
8804
8807
|
};
|
|
8805
8808
|
return window.addEventListener("scroll", p, { capture: !0 }), () => window.removeEventListener("scroll", p, { capture: !0 });
|
|
@@ -8838,8 +8841,8 @@ var $v = "TooltipPortal", [Zy, Bv] = kr($v, {
|
|
|
8838
8841
|
);
|
|
8839
8842
|
}
|
|
8840
8843
|
);
|
|
8841
|
-
|
|
8842
|
-
var Kl = "TooltipArrow",
|
|
8844
|
+
jl.displayName = Ht;
|
|
8845
|
+
var Kl = "TooltipArrow", jv = u.forwardRef(
|
|
8843
8846
|
(e, t) => {
|
|
8844
8847
|
const { __scopeTooltip: n, ...r } = e, o = Mr(n);
|
|
8845
8848
|
return zv(
|
|
@@ -8848,8 +8851,8 @@ var Kl = "TooltipArrow", Vv = u.forwardRef(
|
|
|
8848
8851
|
).isInside ? null : /* @__PURE__ */ c(as, { ...o, ...r, ref: t });
|
|
8849
8852
|
}
|
|
8850
8853
|
);
|
|
8851
|
-
|
|
8852
|
-
function
|
|
8854
|
+
jv.displayName = Kl;
|
|
8855
|
+
function Vv(e, t) {
|
|
8853
8856
|
const n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), s = Math.abs(t.left - e.x);
|
|
8854
8857
|
switch (Math.min(n, r, o, s)) {
|
|
8855
8858
|
case s:
|
|
@@ -8907,8 +8910,8 @@ function qv(e, t) {
|
|
|
8907
8910
|
const { x: n, y: r } = e;
|
|
8908
8911
|
let o = !1;
|
|
8909
8912
|
for (let s = 0, a = t.length - 1; s < t.length; a = s++) {
|
|
8910
|
-
const i = t[s], l = t[a], f = i.x, d = i.y, p = l.x,
|
|
8911
|
-
d > r !=
|
|
8913
|
+
const i = t[s], l = t[a], f = i.x, d = i.y, p = l.x, h = l.y;
|
|
8914
|
+
d > r != h > r && n < (p - f) * (r - d) / (h - d) + f && (o = !o);
|
|
8912
8915
|
}
|
|
8913
8916
|
return o;
|
|
8914
8917
|
}
|
|
@@ -8941,7 +8944,7 @@ function Yv(e) {
|
|
|
8941
8944
|
}
|
|
8942
8945
|
return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
|
|
8943
8946
|
}
|
|
8944
|
-
var Jv = Hl, Zv = zl, Qv = Wl, Gl =
|
|
8947
|
+
var Jv = Hl, Zv = zl, Qv = Wl, Gl = jl;
|
|
8945
8948
|
const ew = Jv, tw = Zv, nw = Qv, ql = u.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ c(
|
|
8946
8949
|
Gl,
|
|
8947
8950
|
{
|
|
@@ -8972,19 +8975,19 @@ const Yl = u.forwardRef(
|
|
|
8972
8975
|
children: s,
|
|
8973
8976
|
...a
|
|
8974
8977
|
}, i) => {
|
|
8975
|
-
const l = pv(), [f, d] = u.useState(!1), [p,
|
|
8978
|
+
const l = pv(), [f, d] = u.useState(!1), [p, h] = u.useState(e), v = t ?? p, g = u.useCallback(
|
|
8976
8979
|
(x) => {
|
|
8977
8980
|
const y = typeof x == "function" ? x(v) : x;
|
|
8978
|
-
n ? n(y) :
|
|
8981
|
+
n ? n(y) : h(y), document.cookie = `${rw}=${y}; path=/; max-age=${ow}`;
|
|
8979
8982
|
},
|
|
8980
8983
|
[n, v]
|
|
8981
|
-
),
|
|
8984
|
+
), m = u.useCallback(() => l ? d((x) => !x) : g((x) => !x), [l, g, d]);
|
|
8982
8985
|
u.useEffect(() => {
|
|
8983
8986
|
const x = (y) => {
|
|
8984
|
-
y.key === cw && (y.metaKey || y.ctrlKey) && (y.preventDefault(),
|
|
8987
|
+
y.key === cw && (y.metaKey || y.ctrlKey) && (y.preventDefault(), m());
|
|
8985
8988
|
};
|
|
8986
8989
|
return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
|
|
8987
|
-
}, [
|
|
8990
|
+
}, [m]);
|
|
8988
8991
|
const b = v ? "expanded" : "collapsed", w = u.useMemo(
|
|
8989
8992
|
() => ({
|
|
8990
8993
|
state: b,
|
|
@@ -8993,9 +8996,9 @@ const Yl = u.forwardRef(
|
|
|
8993
8996
|
isMobile: l,
|
|
8994
8997
|
openMobile: f,
|
|
8995
8998
|
setOpenMobile: d,
|
|
8996
|
-
toggleSidebar:
|
|
8999
|
+
toggleSidebar: m
|
|
8997
9000
|
}),
|
|
8998
|
-
[b, v, g, l, f, d,
|
|
9001
|
+
[b, v, g, l, f, d, m]
|
|
8999
9002
|
);
|
|
9000
9003
|
return /* @__PURE__ */ c(Xl.Provider, { value: w, children: /* @__PURE__ */ c(ew, { delayDuration: 0, children: /* @__PURE__ */ c(
|
|
9001
9004
|
"div",
|
|
@@ -9477,7 +9480,7 @@ function Qy({
|
|
|
9477
9480
|
/* @__PURE__ */ c("div", { className: "flex-1" }),
|
|
9478
9481
|
e
|
|
9479
9482
|
] }),
|
|
9480
|
-
/* @__PURE__ */ c("main", { className: `flex-1 min-h-0 overflow-hidden ${s}`, children: /* @__PURE__ */ c(
|
|
9483
|
+
/* @__PURE__ */ c("main", { className: `flex-1 min-h-0 overflow-hidden ${s}`, children: /* @__PURE__ */ c(Vn, {}) })
|
|
9481
9484
|
] })
|
|
9482
9485
|
] }) });
|
|
9483
9486
|
}
|
|
@@ -9509,7 +9512,7 @@ function uu(e) {
|
|
|
9509
9512
|
const t = u.useRef({ value: e, previous: e });
|
|
9510
9513
|
return u.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
9511
9514
|
}
|
|
9512
|
-
var Fr = "Switch", [Cw, ex] =
|
|
9515
|
+
var Fr = "Switch", [Cw, ex] = Ve(Fr), [Ew, Nw] = Cw(Fr), du = u.forwardRef(
|
|
9513
9516
|
(e, t) => {
|
|
9514
9517
|
const {
|
|
9515
9518
|
__scopeSwitch: n,
|
|
@@ -9522,7 +9525,7 @@ var Fr = "Switch", [Cw, ex] = je(Fr), [Ew, Nw] = Cw(Fr), du = u.forwardRef(
|
|
|
9522
9525
|
onCheckedChange: f,
|
|
9523
9526
|
form: d,
|
|
9524
9527
|
...p
|
|
9525
|
-
} = e, [
|
|
9528
|
+
} = e, [h, v] = u.useState(null), g = ie(t, (y) => v(y)), m = u.useRef(!1), b = h ? d || !!h.closest("form") : !0, [w, x] = ut({
|
|
9526
9529
|
prop: o,
|
|
9527
9530
|
defaultProp: s ?? !1,
|
|
9528
9531
|
onChange: f,
|
|
@@ -9543,15 +9546,15 @@ var Fr = "Switch", [Cw, ex] = je(Fr), [Ew, Nw] = Cw(Fr), du = u.forwardRef(
|
|
|
9543
9546
|
...p,
|
|
9544
9547
|
ref: g,
|
|
9545
9548
|
onClick: U(e.onClick, (y) => {
|
|
9546
|
-
x((C) => !C), b && (
|
|
9549
|
+
x((C) => !C), b && (m.current = y.isPropagationStopped(), m.current || y.stopPropagation());
|
|
9547
9550
|
})
|
|
9548
9551
|
}
|
|
9549
9552
|
),
|
|
9550
9553
|
b && /* @__PURE__ */ c(
|
|
9551
9554
|
hu,
|
|
9552
9555
|
{
|
|
9553
|
-
control:
|
|
9554
|
-
bubbles: !
|
|
9556
|
+
control: h,
|
|
9557
|
+
bubbles: !m.current,
|
|
9555
9558
|
name: r,
|
|
9556
9559
|
value: l,
|
|
9557
9560
|
checked: w,
|
|
@@ -9646,7 +9649,7 @@ const ct = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
9646
9649
|
}
|
|
9647
9650
|
));
|
|
9648
9651
|
ct.displayName = gu.displayName;
|
|
9649
|
-
var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Select", [$r, Br, Iw] = Go(Ct), [qt, tx] =
|
|
9652
|
+
var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Select", [$r, Br, Iw] = Go(Ct), [qt, tx] = Ve(Ct, [
|
|
9650
9653
|
Iw,
|
|
9651
9654
|
Gt
|
|
9652
9655
|
]), Ur = Gt(), [_w, pt] = qt(Ct), [Ow, kw] = qt(Ct), bu = (e) => {
|
|
@@ -9662,10 +9665,10 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9662
9665
|
dir: f,
|
|
9663
9666
|
name: d,
|
|
9664
9667
|
autoComplete: p,
|
|
9665
|
-
disabled:
|
|
9668
|
+
disabled: h,
|
|
9666
9669
|
required: v,
|
|
9667
9670
|
form: g
|
|
9668
|
-
} = e,
|
|
9671
|
+
} = e, m = Ur(t), [b, w] = u.useState(null), [x, y] = u.useState(null), [C, R] = u.useState(!1), _ = vr(f), [N, k] = ut({
|
|
9669
9672
|
prop: r,
|
|
9670
9673
|
defaultProp: o ?? !1,
|
|
9671
9674
|
onChange: s,
|
|
@@ -9676,7 +9679,7 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9676
9679
|
onChange: l,
|
|
9677
9680
|
caller: Ct
|
|
9678
9681
|
}), $ = u.useRef(null), K = b ? g || !!b.closest("form") : !0, [B, M] = u.useState(/* @__PURE__ */ new Set()), H = Array.from(B).map((O) => O.props.value).join(";");
|
|
9679
|
-
return /* @__PURE__ */ c(rs, { ...
|
|
9682
|
+
return /* @__PURE__ */ c(rs, { ...m, children: /* @__PURE__ */ E(
|
|
9680
9683
|
_w,
|
|
9681
9684
|
{
|
|
9682
9685
|
required: v,
|
|
@@ -9694,7 +9697,7 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9694
9697
|
onOpenChange: k,
|
|
9695
9698
|
dir: _,
|
|
9696
9699
|
triggerPointerDownPosRef: $,
|
|
9697
|
-
disabled:
|
|
9700
|
+
disabled: h,
|
|
9698
9701
|
children: [
|
|
9699
9702
|
/* @__PURE__ */ c($r.Provider, { scope: t, children: /* @__PURE__ */ c(
|
|
9700
9703
|
Ow,
|
|
@@ -9722,7 +9725,7 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9722
9725
|
autoComplete: p,
|
|
9723
9726
|
value: L,
|
|
9724
9727
|
onChange: (O) => I(O.target.value),
|
|
9725
|
-
disabled:
|
|
9728
|
+
disabled: h,
|
|
9726
9729
|
form: g,
|
|
9727
9730
|
children: [
|
|
9728
9731
|
L === void 0 ? /* @__PURE__ */ c("option", { value: "" }) : null,
|
|
@@ -9738,13 +9741,13 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9738
9741
|
bu.displayName = Ct;
|
|
9739
9742
|
var vu = "SelectTrigger", wu = u.forwardRef(
|
|
9740
9743
|
(e, t) => {
|
|
9741
|
-
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ur(n), a = pt(vu, n), i = a.disabled || r, l = ie(t, a.onTriggerChange), f = Br(n), d = u.useRef("touch"), [p,
|
|
9742
|
-
const b = f().filter((y) => !y.disabled), w = b.find((y) => y.value === a.value), x =
|
|
9744
|
+
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ur(n), a = pt(vu, n), i = a.disabled || r, l = ie(t, a.onTriggerChange), f = Br(n), d = u.useRef("touch"), [p, h, v] = Wu((m) => {
|
|
9745
|
+
const b = f().filter((y) => !y.disabled), w = b.find((y) => y.value === a.value), x = ju(b, m, w);
|
|
9743
9746
|
x !== void 0 && a.onValueChange(x.value);
|
|
9744
|
-
}), g = (
|
|
9745
|
-
i || (a.onOpenChange(!0), v()),
|
|
9746
|
-
x: Math.round(
|
|
9747
|
-
y: Math.round(
|
|
9747
|
+
}), g = (m) => {
|
|
9748
|
+
i || (a.onOpenChange(!0), v()), m && (a.triggerPointerDownPosRef.current = {
|
|
9749
|
+
x: Math.round(m.pageX),
|
|
9750
|
+
y: Math.round(m.pageY)
|
|
9748
9751
|
});
|
|
9749
9752
|
};
|
|
9750
9753
|
return /* @__PURE__ */ c(os, { asChild: !0, ...s, children: /* @__PURE__ */ c(
|
|
@@ -9763,17 +9766,17 @@ var vu = "SelectTrigger", wu = u.forwardRef(
|
|
|
9763
9766
|
"data-placeholder": zu(a.value) ? "" : void 0,
|
|
9764
9767
|
...o,
|
|
9765
9768
|
ref: l,
|
|
9766
|
-
onClick: U(o.onClick, (
|
|
9767
|
-
|
|
9769
|
+
onClick: U(o.onClick, (m) => {
|
|
9770
|
+
m.currentTarget.focus(), d.current !== "mouse" && g(m);
|
|
9768
9771
|
}),
|
|
9769
|
-
onPointerDown: U(o.onPointerDown, (
|
|
9770
|
-
d.current =
|
|
9771
|
-
const b =
|
|
9772
|
-
b.hasPointerCapture(
|
|
9772
|
+
onPointerDown: U(o.onPointerDown, (m) => {
|
|
9773
|
+
d.current = m.pointerType;
|
|
9774
|
+
const b = m.target;
|
|
9775
|
+
b.hasPointerCapture(m.pointerId) && b.releasePointerCapture(m.pointerId), m.button === 0 && m.ctrlKey === !1 && m.pointerType === "mouse" && (g(m), m.preventDefault());
|
|
9773
9776
|
}),
|
|
9774
|
-
onKeyDown: U(o.onKeyDown, (
|
|
9777
|
+
onKeyDown: U(o.onKeyDown, (m) => {
|
|
9775
9778
|
const b = p.current !== "";
|
|
9776
|
-
!(
|
|
9779
|
+
!(m.ctrlKey || m.altKey || m.metaKey) && m.key.length === 1 && h(m.key), !(b && m.key === " ") && Aw.includes(m.key) && (g(), m.preventDefault());
|
|
9777
9780
|
})
|
|
9778
9781
|
}
|
|
9779
9782
|
) });
|
|
@@ -9837,10 +9840,10 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9837
9840
|
align: f,
|
|
9838
9841
|
alignOffset: d,
|
|
9839
9842
|
arrowPadding: p,
|
|
9840
|
-
collisionBoundary:
|
|
9843
|
+
collisionBoundary: h,
|
|
9841
9844
|
collisionPadding: v,
|
|
9842
9845
|
sticky: g,
|
|
9843
|
-
hideWhenDetached:
|
|
9846
|
+
hideWhenDetached: m,
|
|
9844
9847
|
avoidCollisions: b,
|
|
9845
9848
|
//
|
|
9846
9849
|
...w
|
|
@@ -9852,9 +9855,9 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9852
9855
|
}, [y]), qo();
|
|
9853
9856
|
const O = u.useCallback(
|
|
9854
9857
|
(z) => {
|
|
9855
|
-
const [W, ...
|
|
9858
|
+
const [W, ...oe] = K().map((te) => te.ref.current), [V] = oe.slice(-1), X = document.activeElement;
|
|
9856
9859
|
for (const te of z)
|
|
9857
|
-
if (te === X || (te == null || te.scrollIntoView({ block: "nearest" }), te === W && R && (R.scrollTop = 0), te ===
|
|
9860
|
+
if (te === X || (te == null || te.scrollIntoView({ block: "nearest" }), te === W && R && (R.scrollTop = 0), te === V && R && (R.scrollTop = R.scrollHeight), te == null || te.focus(), document.activeElement !== X)) return;
|
|
9858
9861
|
},
|
|
9859
9862
|
[K, R]
|
|
9860
9863
|
), G = u.useCallback(
|
|
@@ -9868,17 +9871,17 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9868
9871
|
u.useEffect(() => {
|
|
9869
9872
|
if (y) {
|
|
9870
9873
|
let z = { x: 0, y: 0 };
|
|
9871
|
-
const W = (
|
|
9874
|
+
const W = (V) => {
|
|
9872
9875
|
var X, te;
|
|
9873
9876
|
z = {
|
|
9874
|
-
x: Math.abs(Math.round(
|
|
9875
|
-
y: Math.abs(Math.round(
|
|
9877
|
+
x: Math.abs(Math.round(V.pageX) - (((X = T.current) == null ? void 0 : X.x) ?? 0)),
|
|
9878
|
+
y: Math.abs(Math.round(V.pageY) - (((te = T.current) == null ? void 0 : te.y) ?? 0))
|
|
9876
9879
|
};
|
|
9877
|
-
},
|
|
9878
|
-
z.x <= 10 && z.y <= 10 ?
|
|
9880
|
+
}, oe = (V) => {
|
|
9881
|
+
z.x <= 10 && z.y <= 10 ? V.preventDefault() : y.contains(V.target) || D(!1), document.removeEventListener("pointermove", W), T.current = null;
|
|
9879
9882
|
};
|
|
9880
|
-
return T.current !== null && (document.addEventListener("pointermove", W), document.addEventListener("pointerup",
|
|
9881
|
-
document.removeEventListener("pointermove", W), document.removeEventListener("pointerup",
|
|
9883
|
+
return T.current !== null && (document.addEventListener("pointermove", W), document.addEventListener("pointerup", oe, { capture: !0, once: !0 })), () => {
|
|
9884
|
+
document.removeEventListener("pointermove", W), document.removeEventListener("pointerup", oe, { capture: !0 });
|
|
9882
9885
|
};
|
|
9883
9886
|
}
|
|
9884
9887
|
}, [y, D, T]), u.useEffect(() => {
|
|
@@ -9888,18 +9891,18 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9888
9891
|
};
|
|
9889
9892
|
}, [D]);
|
|
9890
9893
|
const [Q, q] = Wu((z) => {
|
|
9891
|
-
const W = K().filter((X) => !X.disabled),
|
|
9892
|
-
|
|
9893
|
-
}),
|
|
9894
|
-
(z, W,
|
|
9895
|
-
const
|
|
9896
|
-
(x.value !== void 0 && x.value === W ||
|
|
9894
|
+
const W = K().filter((X) => !X.disabled), oe = W.find((X) => X.ref.current === document.activeElement), V = ju(W, z, oe);
|
|
9895
|
+
V && setTimeout(() => V.ref.current.focus());
|
|
9896
|
+
}), ae = u.useCallback(
|
|
9897
|
+
(z, W, oe) => {
|
|
9898
|
+
const V = !H.current && !oe;
|
|
9899
|
+
(x.value !== void 0 && x.value === W || V) && (L(z), V && (H.current = !0));
|
|
9897
9900
|
},
|
|
9898
9901
|
[x.value]
|
|
9899
|
-
), F = u.useCallback(() => y == null ? void 0 : y.focus(), [y]),
|
|
9900
|
-
(z, W,
|
|
9901
|
-
const
|
|
9902
|
-
(x.value !== void 0 && x.value === W ||
|
|
9902
|
+
), F = u.useCallback(() => y == null ? void 0 : y.focus(), [y]), j = u.useCallback(
|
|
9903
|
+
(z, W, oe) => {
|
|
9904
|
+
const V = !H.current && !oe;
|
|
9905
|
+
(x.value !== void 0 && x.value === W || V) && $(z);
|
|
9903
9906
|
},
|
|
9904
9907
|
[x.value]
|
|
9905
9908
|
), ce = r === "popper" ? Oo : Tu, pe = ce === Oo ? {
|
|
@@ -9908,10 +9911,10 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9908
9911
|
align: f,
|
|
9909
9912
|
alignOffset: d,
|
|
9910
9913
|
arrowPadding: p,
|
|
9911
|
-
collisionBoundary:
|
|
9914
|
+
collisionBoundary: h,
|
|
9912
9915
|
collisionPadding: v,
|
|
9913
9916
|
sticky: g,
|
|
9914
|
-
hideWhenDetached:
|
|
9917
|
+
hideWhenDetached: m,
|
|
9915
9918
|
avoidCollisions: b
|
|
9916
9919
|
} : {};
|
|
9917
9920
|
return /* @__PURE__ */ c(
|
|
@@ -9921,10 +9924,10 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9921
9924
|
content: y,
|
|
9922
9925
|
viewport: R,
|
|
9923
9926
|
onViewportChange: _,
|
|
9924
|
-
itemRefCallback:
|
|
9927
|
+
itemRefCallback: ae,
|
|
9925
9928
|
selectedItem: k,
|
|
9926
9929
|
onItemLeave: F,
|
|
9927
|
-
itemTextRefCallback:
|
|
9930
|
+
itemTextRefCallback: j,
|
|
9928
9931
|
focusSelectedItem: G,
|
|
9929
9932
|
selectedItemText: I,
|
|
9930
9933
|
position: r,
|
|
@@ -9974,12 +9977,12 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9974
9977
|
onKeyDown: U(w.onKeyDown, (z) => {
|
|
9975
9978
|
const W = z.ctrlKey || z.altKey || z.metaKey;
|
|
9976
9979
|
if (z.key === "Tab" && z.preventDefault(), !W && z.key.length === 1 && q(z.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(z.key)) {
|
|
9977
|
-
let
|
|
9978
|
-
if (["ArrowUp", "End"].includes(z.key) && (
|
|
9979
|
-
const X = z.target, te =
|
|
9980
|
-
|
|
9980
|
+
let V = K().filter((X) => !X.disabled).map((X) => X.ref.current);
|
|
9981
|
+
if (["ArrowUp", "End"].includes(z.key) && (V = V.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(z.key)) {
|
|
9982
|
+
const X = z.target, te = V.indexOf(X);
|
|
9983
|
+
V = V.slice(te + 1);
|
|
9981
9984
|
}
|
|
9982
|
-
setTimeout(() => O(
|
|
9985
|
+
setTimeout(() => O(V)), z.preventDefault();
|
|
9983
9986
|
}
|
|
9984
9987
|
})
|
|
9985
9988
|
}
|
|
@@ -9994,8 +9997,8 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9994
9997
|
);
|
|
9995
9998
|
Ru.displayName = Lw;
|
|
9996
9999
|
var $w = "SelectItemAlignedPosition", Tu = u.forwardRef((e, t) => {
|
|
9997
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = pt(Et, n), a = ht(Et, n), [i, l] = u.useState(null), [f, d] = u.useState(null), p = ie(t, (N) => d(N)),
|
|
9998
|
-
if (s.trigger && s.valueNode && i && f &&
|
|
10000
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = pt(Et, n), a = ht(Et, n), [i, l] = u.useState(null), [f, d] = u.useState(null), p = ie(t, (N) => d(N)), h = Br(n), v = u.useRef(!1), g = u.useRef(!0), { viewport: m, selectedItem: b, selectedItemText: w, focusSelectedItem: x } = a, y = u.useCallback(() => {
|
|
10001
|
+
if (s.trigger && s.valueNode && i && f && m && b && w) {
|
|
9999
10002
|
const N = s.trigger.getBoundingClientRect(), k = f.getBoundingClientRect(), L = s.valueNode.getBoundingClientRect(), I = w.getBoundingClientRect();
|
|
10000
10003
|
if (s.dir !== "rtl") {
|
|
10001
10004
|
const X = I.left - k.left, te = L.left - X, me = N.left - te, de = N.width + me, Z = Math.max(de, k.width), Y = window.innerWidth - Ue, he = Ao(te, [
|
|
@@ -10015,11 +10018,11 @@ var $w = "SelectItemAlignedPosition", Tu = u.forwardRef((e, t) => {
|
|
|
10015
10018
|
]);
|
|
10016
10019
|
i.style.minWidth = de + "px", i.style.right = he + "px";
|
|
10017
10020
|
}
|
|
10018
|
-
const $ =
|
|
10019
|
-
if (W <=
|
|
10021
|
+
const $ = h(), K = window.innerHeight - Ue * 2, B = m.scrollHeight, M = window.getComputedStyle(f), H = parseInt(M.borderTopWidth, 10), O = parseInt(M.paddingTop, 10), G = parseInt(M.borderBottomWidth, 10), D = parseInt(M.paddingBottom, 10), T = H + O + B + D + G, Q = Math.min(b.offsetHeight * 5, T), q = window.getComputedStyle(m), ae = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), j = N.top + N.height / 2 - Ue, ce = K - j, pe = b.offsetHeight / 2, z = b.offsetTop + pe, W = H + O + z, oe = T - W;
|
|
10022
|
+
if (W <= j) {
|
|
10020
10023
|
const X = $.length > 0 && b === $[$.length - 1].ref.current;
|
|
10021
10024
|
i.style.bottom = "0px";
|
|
10022
|
-
const te = f.clientHeight -
|
|
10025
|
+
const te = f.clientHeight - m.offsetTop - m.offsetHeight, me = Math.max(
|
|
10023
10026
|
ce,
|
|
10024
10027
|
pe + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
10025
10028
|
(X ? F : 0) + te + G
|
|
@@ -10029,21 +10032,21 @@ var $w = "SelectItemAlignedPosition", Tu = u.forwardRef((e, t) => {
|
|
|
10029
10032
|
const X = $.length > 0 && b === $[0].ref.current;
|
|
10030
10033
|
i.style.top = "0px";
|
|
10031
10034
|
const me = Math.max(
|
|
10032
|
-
|
|
10033
|
-
H +
|
|
10034
|
-
(X ?
|
|
10035
|
-
) +
|
|
10036
|
-
i.style.height = me + "px",
|
|
10035
|
+
j,
|
|
10036
|
+
H + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
10037
|
+
(X ? ae : 0) + pe
|
|
10038
|
+
) + oe;
|
|
10039
|
+
i.style.height = me + "px", m.scrollTop = W - j + m.offsetTop;
|
|
10037
10040
|
}
|
|
10038
10041
|
i.style.margin = `${Ue}px 0`, i.style.minHeight = Q + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
|
|
10039
10042
|
}
|
|
10040
10043
|
}, [
|
|
10041
|
-
|
|
10044
|
+
h,
|
|
10042
10045
|
s.trigger,
|
|
10043
10046
|
s.valueNode,
|
|
10044
10047
|
i,
|
|
10045
10048
|
f,
|
|
10046
|
-
|
|
10049
|
+
m,
|
|
10047
10050
|
b,
|
|
10048
10051
|
w,
|
|
10049
10052
|
s.dir,
|
|
@@ -10161,11 +10164,11 @@ var [Uw, Ns] = qt(Et, {}), ko = "SelectViewport", Au = u.forwardRef(
|
|
|
10161
10164
|
...o.style
|
|
10162
10165
|
},
|
|
10163
10166
|
onScroll: U(o.onScroll, (f) => {
|
|
10164
|
-
const d = f.currentTarget, { contentWrapper: p, shouldExpandOnScrollRef:
|
|
10165
|
-
if (
|
|
10167
|
+
const d = f.currentTarget, { contentWrapper: p, shouldExpandOnScrollRef: h } = a;
|
|
10168
|
+
if (h != null && h.current && p) {
|
|
10166
10169
|
const v = Math.abs(l.current - d.scrollTop);
|
|
10167
10170
|
if (v > 0) {
|
|
10168
|
-
const g = window.innerHeight - Ue * 2,
|
|
10171
|
+
const g = window.innerHeight - Ue * 2, m = parseFloat(p.style.minHeight), b = parseFloat(p.style.height), w = Math.max(m, b);
|
|
10169
10172
|
if (w < g) {
|
|
10170
10173
|
const x = w + v, y = Math.min(g, x), C = x - y;
|
|
10171
10174
|
p.style.height = y + "px", p.style.bottom === "0px" && (d.scrollTop = C > 0 ? C : 0, p.style.justifyContent = "flex-end");
|
|
@@ -10194,7 +10197,7 @@ var Iu = "SelectLabel", _u = u.forwardRef(
|
|
|
10194
10197
|
}
|
|
10195
10198
|
);
|
|
10196
10199
|
_u.displayName = Iu;
|
|
10197
|
-
var ur = "SelectItem", [
|
|
10200
|
+
var ur = "SelectItem", [jw, Ou] = qt(ur), ku = u.forwardRef(
|
|
10198
10201
|
(e, t) => {
|
|
10199
10202
|
const {
|
|
10200
10203
|
__scopeSelect: n,
|
|
@@ -10202,13 +10205,13 @@ var ur = "SelectItem", [Vw, Ou] = qt(ur), ku = u.forwardRef(
|
|
|
10202
10205
|
disabled: o = !1,
|
|
10203
10206
|
textValue: s,
|
|
10204
10207
|
...a
|
|
10205
|
-
} = e, i = pt(ur, n), l = ht(ur, n), f = i.value === r, [d, p] = u.useState(s ?? ""), [
|
|
10208
|
+
} = e, i = pt(ur, n), l = ht(ur, n), f = i.value === r, [d, p] = u.useState(s ?? ""), [h, v] = u.useState(!1), g = ie(
|
|
10206
10209
|
t,
|
|
10207
10210
|
(x) => {
|
|
10208
10211
|
var y;
|
|
10209
10212
|
return (y = l.itemRefCallback) == null ? void 0 : y.call(l, x, r, o);
|
|
10210
10213
|
}
|
|
10211
|
-
),
|
|
10214
|
+
), m = He(), b = u.useRef("touch"), w = () => {
|
|
10212
10215
|
o || (i.onValueChange(r), i.onOpenChange(!1));
|
|
10213
10216
|
};
|
|
10214
10217
|
if (r === "")
|
|
@@ -10216,12 +10219,12 @@ var ur = "SelectItem", [Vw, Ou] = qt(ur), ku = u.forwardRef(
|
|
|
10216
10219
|
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
10217
10220
|
);
|
|
10218
10221
|
return /* @__PURE__ */ c(
|
|
10219
|
-
|
|
10222
|
+
jw,
|
|
10220
10223
|
{
|
|
10221
10224
|
scope: n,
|
|
10222
10225
|
value: r,
|
|
10223
10226
|
disabled: o,
|
|
10224
|
-
textId:
|
|
10227
|
+
textId: m,
|
|
10225
10228
|
isSelected: f,
|
|
10226
10229
|
onItemTextChange: u.useCallback((x) => {
|
|
10227
10230
|
p((y) => y || ((x == null ? void 0 : x.textContent) ?? "").trim());
|
|
@@ -10237,9 +10240,9 @@ var ur = "SelectItem", [Vw, Ou] = qt(ur), ku = u.forwardRef(
|
|
|
10237
10240
|
ee.div,
|
|
10238
10241
|
{
|
|
10239
10242
|
role: "option",
|
|
10240
|
-
"aria-labelledby":
|
|
10241
|
-
"data-highlighted":
|
|
10242
|
-
"aria-selected": f &&
|
|
10243
|
+
"aria-labelledby": m,
|
|
10244
|
+
"data-highlighted": h ? "" : void 0,
|
|
10245
|
+
"aria-selected": f && h,
|
|
10243
10246
|
"data-state": f ? "checked" : "unchecked",
|
|
10244
10247
|
"aria-disabled": o || void 0,
|
|
10245
10248
|
"data-disabled": o ? "" : void 0,
|
|
@@ -10280,7 +10283,7 @@ var ur = "SelectItem", [Vw, Ou] = qt(ur), ku = u.forwardRef(
|
|
|
10280
10283
|
ku.displayName = ur;
|
|
10281
10284
|
var en = "SelectItemText", Mu = u.forwardRef(
|
|
10282
10285
|
(e, t) => {
|
|
10283
|
-
const { __scopeSelect: n, className: r, style: o, ...s } = e, a = pt(en, n), i = ht(en, n), l = Ou(en, n), f = kw(en, n), [d, p] = u.useState(null),
|
|
10286
|
+
const { __scopeSelect: n, className: r, style: o, ...s } = e, a = pt(en, n), i = ht(en, n), l = Ou(en, n), f = kw(en, n), [d, p] = u.useState(null), h = ie(
|
|
10284
10287
|
t,
|
|
10285
10288
|
(w) => p(w),
|
|
10286
10289
|
l.onItemTextChange,
|
|
@@ -10291,9 +10294,9 @@ var en = "SelectItemText", Mu = u.forwardRef(
|
|
|
10291
10294
|
), v = d == null ? void 0 : d.textContent, g = u.useMemo(
|
|
10292
10295
|
() => /* @__PURE__ */ c("option", { value: l.value, disabled: l.disabled, children: v }, l.value),
|
|
10293
10296
|
[l.disabled, l.value, v]
|
|
10294
|
-
), { onNativeOptionAdd:
|
|
10295
|
-
return we(() => (
|
|
10296
|
-
/* @__PURE__ */ c(ee.span, { id: l.textId, ...s, ref:
|
|
10297
|
+
), { onNativeOptionAdd: m, onNativeOptionRemove: b } = f;
|
|
10298
|
+
return we(() => (m(g), () => b(g)), [m, b, g]), /* @__PURE__ */ E(Ae, { children: [
|
|
10299
|
+
/* @__PURE__ */ c(ee.span, { id: l.textId, ...s, ref: h }),
|
|
10297
10300
|
l.isSelected && a.valueNode && !a.valueNodeHasChildren ? dr.createPortal(s.children, a.valueNode) : null
|
|
10298
10301
|
] });
|
|
10299
10302
|
}
|
|
@@ -10381,13 +10384,13 @@ var Bu = u.forwardRef((e, t) => {
|
|
|
10381
10384
|
})
|
|
10382
10385
|
}
|
|
10383
10386
|
);
|
|
10384
|
-
}),
|
|
10387
|
+
}), Vw = "SelectSeparator", Uu = u.forwardRef(
|
|
10385
10388
|
(e, t) => {
|
|
10386
10389
|
const { __scopeSelect: n, ...r } = e;
|
|
10387
10390
|
return /* @__PURE__ */ c(ee.div, { "aria-hidden": !0, ...r, ref: t });
|
|
10388
10391
|
}
|
|
10389
10392
|
);
|
|
10390
|
-
Uu.displayName =
|
|
10393
|
+
Uu.displayName = Vw;
|
|
10391
10394
|
var Lo = "SelectArrow", Kw = u.forwardRef(
|
|
10392
10395
|
(e, t) => {
|
|
10393
10396
|
const { __scopeSelect: n, ...r } = e, o = Ur(n), s = pt(Lo, n), a = ht(Lo, n);
|
|
@@ -10438,7 +10441,7 @@ function Wu(e) {
|
|
|
10438
10441
|
}, []);
|
|
10439
10442
|
return u.useEffect(() => () => window.clearTimeout(r.current), []), [n, o, s];
|
|
10440
10443
|
}
|
|
10441
|
-
function
|
|
10444
|
+
function ju(e, t, n) {
|
|
10442
10445
|
const o = t.length > 1 && Array.from(t).every((f) => f === t[0]) ? t[0] : t, s = n ? e.indexOf(n) : -1;
|
|
10443
10446
|
let a = qw(e, Math.max(s, 0));
|
|
10444
10447
|
o.length === 1 && (a = a.filter((f) => f !== n));
|
|
@@ -10450,9 +10453,9 @@ function Vu(e, t, n) {
|
|
|
10450
10453
|
function qw(e, t) {
|
|
10451
10454
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
10452
10455
|
}
|
|
10453
|
-
var Xw = bu,
|
|
10456
|
+
var Xw = bu, Vu = wu, Yw = xu, Jw = Su, Zw = Cu, Ku = Eu, Qw = Au, Gu = _u, qu = ku, ey = Mu, ty = Lu, Xu = Fu, Yu = $u, Ju = Uu;
|
|
10454
10457
|
const Aa = Xw, Pa = Yw, Fo = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
|
|
10455
|
-
|
|
10458
|
+
Vu,
|
|
10456
10459
|
{
|
|
10457
10460
|
ref: r,
|
|
10458
10461
|
className: A(
|
|
@@ -10466,7 +10469,7 @@ const Aa = Xw, Pa = Yw, Fo = u.forwardRef(({ className: e, children: t, ...n },
|
|
|
10466
10469
|
]
|
|
10467
10470
|
}
|
|
10468
10471
|
));
|
|
10469
|
-
Fo.displayName =
|
|
10472
|
+
Fo.displayName = Vu.displayName;
|
|
10470
10473
|
const Zu = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
10471
10474
|
Xu,
|
|
10472
10475
|
{
|
|
@@ -10726,7 +10729,7 @@ function nx({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10726
10729
|
}, [i, e]), ge(() => {
|
|
10727
10730
|
l(e);
|
|
10728
10731
|
}, [e]);
|
|
10729
|
-
const
|
|
10732
|
+
const h = () => {
|
|
10730
10733
|
t(i), d(!1), p({
|
|
10731
10734
|
title: "Settings saved",
|
|
10732
10735
|
description: "Your chat configuration has been updated successfully."
|
|
@@ -10738,7 +10741,7 @@ function nx({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10738
10741
|
});
|
|
10739
10742
|
}, g = () => {
|
|
10740
10743
|
l(e), d(!1), o(!1);
|
|
10741
|
-
},
|
|
10744
|
+
}, m = async () => {
|
|
10742
10745
|
try {
|
|
10743
10746
|
const w = await (await fetch(`${i.api.baseUrl}/health`)).json();
|
|
10744
10747
|
p({
|
|
@@ -10786,7 +10789,7 @@ function nx({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10786
10789
|
placeholder: "http://localhost:8000/api"
|
|
10787
10790
|
}
|
|
10788
10791
|
),
|
|
10789
|
-
/* @__PURE__ */ c(fe, { variant: "outline", onClick:
|
|
10792
|
+
/* @__PURE__ */ c(fe, { variant: "outline", onClick: m, children: "Test" })
|
|
10790
10793
|
] })
|
|
10791
10794
|
] }),
|
|
10792
10795
|
/* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
|
|
@@ -10994,7 +10997,7 @@ function nx({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10994
10997
|
] }),
|
|
10995
10998
|
/* @__PURE__ */ E("div", { className: "flex gap-2", children: [
|
|
10996
10999
|
/* @__PURE__ */ c(fe, { variant: "outline", onClick: g, children: "Cancel" }),
|
|
10997
|
-
/* @__PURE__ */ E(fe, { onClick:
|
|
11000
|
+
/* @__PURE__ */ E(fe, { onClick: h, disabled: !f, children: [
|
|
10998
11001
|
/* @__PURE__ */ c(Sd, { className: "h-4 w-4 mr-2" }),
|
|
10999
11002
|
"Save Changes"
|
|
11000
11003
|
] })
|
|
@@ -11037,7 +11040,7 @@ function rx({
|
|
|
11037
11040
|
{
|
|
11038
11041
|
className: `${a(t)} flex flex-col overflow-hidden ${r} ${o.container || ""}`,
|
|
11039
11042
|
style: i(t),
|
|
11040
|
-
children: /* @__PURE__ */ c(
|
|
11043
|
+
children: /* @__PURE__ */ c(Vn, { className: "flex-1", onError: s.onError, enableFileUpload: !0 })
|
|
11041
11044
|
}
|
|
11042
11045
|
) }) : e === "tabs" ? /* @__PURE__ */ c(Un, { ...s, onThreadChange: l, children: /* @__PURE__ */ c(
|
|
11043
11046
|
"div",
|
|
@@ -11054,7 +11057,7 @@ function rx({
|
|
|
11054
11057
|
className: "h-full"
|
|
11055
11058
|
}
|
|
11056
11059
|
) }),
|
|
11057
|
-
/* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(
|
|
11060
|
+
/* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(Vn, { onError: s.onError, enableFileUpload: !0 }) })
|
|
11058
11061
|
] })
|
|
11059
11062
|
}
|
|
11060
11063
|
) }) : /* @__PURE__ */ c(Un, { ...s, onThreadChange: l, children: /* @__PURE__ */ E(
|
|
@@ -11072,7 +11075,7 @@ function rx({
|
|
|
11072
11075
|
className: "h-full"
|
|
11073
11076
|
}
|
|
11074
11077
|
) }),
|
|
11075
|
-
/* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(
|
|
11078
|
+
/* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(Vn, { onError: s.onError, enableFileUpload: !0 }) })
|
|
11076
11079
|
]
|
|
11077
11080
|
}
|
|
11078
11081
|
) });
|
|
@@ -11081,10 +11084,10 @@ export {
|
|
|
11081
11084
|
cp as Api,
|
|
11082
11085
|
cp as ApiClient,
|
|
11083
11086
|
cp as ChatApi,
|
|
11084
|
-
|
|
11087
|
+
Vn as ChatInterface,
|
|
11085
11088
|
Qy as ChatMainLayout,
|
|
11086
11089
|
Un as ChatProvider,
|
|
11087
|
-
|
|
11090
|
+
Vy as ChatRoutingProvider,
|
|
11088
11091
|
nx as ChatSettings,
|
|
11089
11092
|
_n as MarkdownContent,
|
|
11090
11093
|
$p as MessageComponent,
|