teodor-new-chat-ui 4.3.58 → 4.3.59
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 +214 -215
- package/dist/index.umd.js +14 -14
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -57,16 +57,16 @@ function sg() {
|
|
|
57
57
|
var x = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
58
58
|
function w(R) {
|
|
59
59
|
{
|
|
60
|
-
for (var H = arguments.length,
|
|
61
|
-
|
|
62
|
-
b("error", R,
|
|
60
|
+
for (var H = arguments.length, ue = new Array(H > 1 ? H - 1 : 0), Te = 1; Te < H; Te++)
|
|
61
|
+
ue[Te - 1] = arguments[Te];
|
|
62
|
+
b("error", R, ue);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function b(R, H,
|
|
65
|
+
function b(R, H, ue) {
|
|
66
66
|
{
|
|
67
67
|
var Te = x.ReactDebugCurrentFrame, Ke = Te.getStackAddendum();
|
|
68
|
-
Ke !== "" && (H += "%s",
|
|
69
|
-
var He =
|
|
68
|
+
Ke !== "" && (H += "%s", ue = ue.concat([Ke]));
|
|
69
|
+
var He = ue.map(function($e) {
|
|
70
70
|
return String($e);
|
|
71
71
|
});
|
|
72
72
|
He.unshift("Warning: " + H), Function.prototype.apply.call(console[R], console, He);
|
|
@@ -81,12 +81,12 @@ function sg() {
|
|
|
81
81
|
// with.
|
|
82
82
|
R.$$typeof === N || R.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
|
-
function $(R, H,
|
|
84
|
+
function $(R, H, ue) {
|
|
85
85
|
var Te = R.displayName;
|
|
86
86
|
if (Te)
|
|
87
87
|
return Te;
|
|
88
88
|
var Ke = H.displayName || H.name || "";
|
|
89
|
-
return Ke !== "" ?
|
|
89
|
+
return Ke !== "" ? ue + "(" + Ke + ")" : ue;
|
|
90
90
|
}
|
|
91
91
|
function L(R) {
|
|
92
92
|
return R.displayName || "Context";
|
|
@@ -118,8 +118,8 @@ function sg() {
|
|
|
118
118
|
var H = R;
|
|
119
119
|
return L(H) + ".Consumer";
|
|
120
120
|
case i:
|
|
121
|
-
var
|
|
122
|
-
return L(
|
|
121
|
+
var ue = R;
|
|
122
|
+
return L(ue._context) + ".Provider";
|
|
123
123
|
case l:
|
|
124
124
|
return $(R, R.render, "ForwardRef");
|
|
125
125
|
case f:
|
|
@@ -199,7 +199,7 @@ function sg() {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
var xe = x.ReactCurrentDispatcher, W;
|
|
202
|
-
function M(R, H,
|
|
202
|
+
function M(R, H, ue) {
|
|
203
203
|
{
|
|
204
204
|
if (W === void 0)
|
|
205
205
|
try {
|
|
@@ -221,9 +221,9 @@ function sg() {
|
|
|
221
221
|
if (!R || X)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var
|
|
225
|
-
if (
|
|
226
|
-
return
|
|
224
|
+
var ue = re.get(R);
|
|
225
|
+
if (ue !== void 0)
|
|
226
|
+
return ue;
|
|
227
227
|
}
|
|
228
228
|
var Te;
|
|
229
229
|
X = !0;
|
|
@@ -288,14 +288,14 @@ function sg() {
|
|
|
288
288
|
var Ot = R ? R.displayName || R.name : "", en = Ot ? M(Ot) : "";
|
|
289
289
|
return typeof R == "function" && re.set(R, en), en;
|
|
290
290
|
}
|
|
291
|
-
function le(R, H,
|
|
291
|
+
function le(R, H, ue) {
|
|
292
292
|
return oe(R, !1);
|
|
293
293
|
}
|
|
294
294
|
function Ye(R) {
|
|
295
295
|
var H = R.prototype;
|
|
296
296
|
return !!(H && H.isReactComponent);
|
|
297
297
|
}
|
|
298
|
-
function et(R, H,
|
|
298
|
+
function et(R, H, ue) {
|
|
299
299
|
if (R == null)
|
|
300
300
|
return "";
|
|
301
301
|
if (typeof R == "function")
|
|
@@ -313,11 +313,11 @@ function sg() {
|
|
|
313
313
|
case l:
|
|
314
314
|
return le(R.render);
|
|
315
315
|
case f:
|
|
316
|
-
return et(R.type, H,
|
|
316
|
+
return et(R.type, H, ue);
|
|
317
317
|
case p: {
|
|
318
318
|
var Te = R, Ke = Te._payload, He = Te._init;
|
|
319
319
|
try {
|
|
320
|
-
return et(He(Ke), H,
|
|
320
|
+
return et(He(Ke), H, ue);
|
|
321
321
|
} catch {
|
|
322
322
|
}
|
|
323
323
|
}
|
|
@@ -327,12 +327,12 @@ function sg() {
|
|
|
327
327
|
var ct = Object.prototype.hasOwnProperty, it = {}, Pe = x.ReactDebugCurrentFrame;
|
|
328
328
|
function Le(R) {
|
|
329
329
|
if (R) {
|
|
330
|
-
var H = R._owner,
|
|
331
|
-
Pe.setExtraStackFrame(
|
|
330
|
+
var H = R._owner, ue = et(R.type, R._source, H ? H.type : null);
|
|
331
|
+
Pe.setExtraStackFrame(ue);
|
|
332
332
|
} else
|
|
333
333
|
Pe.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
|
-
function Oe(R, H,
|
|
335
|
+
function Oe(R, H, ue, Te, Ke) {
|
|
336
336
|
{
|
|
337
337
|
var He = Function.call.bind(ct);
|
|
338
338
|
for (var $e in R)
|
|
@@ -340,14 +340,14 @@ function sg() {
|
|
|
340
340
|
var F = void 0;
|
|
341
341
|
try {
|
|
342
342
|
if (typeof R[$e] != "function") {
|
|
343
|
-
var de = Error((Te || "React class") + ": " +
|
|
343
|
+
var de = Error((Te || "React class") + ": " + ue + " type `" + $e + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[$e] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
344
|
throw de.name = "Invariant Violation", de;
|
|
345
345
|
}
|
|
346
|
-
F = R[$e](H, $e, Te,
|
|
346
|
+
F = R[$e](H, $e, Te, ue, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
347
|
} catch (pe) {
|
|
348
348
|
F = pe;
|
|
349
349
|
}
|
|
350
|
-
F && !(F instanceof Error) && (Le(Ke), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Te || "React class",
|
|
350
|
+
F && !(F instanceof Error) && (Le(Ke), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Te || "React class", ue, $e, typeof F), Le(null)), F instanceof Error && !(F.message in it) && (it[F.message] = !0, Le(Ke), w("Failed %s type: %s", ue, F.message), Le(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
@@ -357,8 +357,8 @@ function sg() {
|
|
|
357
357
|
}
|
|
358
358
|
function mt(R) {
|
|
359
359
|
{
|
|
360
|
-
var H = typeof Symbol == "function" && Symbol.toStringTag,
|
|
361
|
-
return
|
|
360
|
+
var H = typeof Symbol == "function" && Symbol.toStringTag, ue = H && R[Symbol.toStringTag] || R.constructor.name || "Object";
|
|
361
|
+
return ue;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
function se(R) {
|
|
@@ -402,34 +402,34 @@ function sg() {
|
|
|
402
402
|
}
|
|
403
403
|
function ir(R, H) {
|
|
404
404
|
{
|
|
405
|
-
var
|
|
405
|
+
var ue = function() {
|
|
406
406
|
rt || (rt = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", H));
|
|
407
407
|
};
|
|
408
|
-
|
|
409
|
-
get:
|
|
408
|
+
ue.isReactWarning = !0, Object.defineProperty(R, "key", {
|
|
409
|
+
get: ue,
|
|
410
410
|
configurable: !0
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
function Vt(R, H) {
|
|
415
415
|
{
|
|
416
|
-
var
|
|
416
|
+
var ue = function() {
|
|
417
417
|
gt || (gt = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", H));
|
|
418
418
|
};
|
|
419
|
-
|
|
420
|
-
get:
|
|
419
|
+
ue.isReactWarning = !0, Object.defineProperty(R, "ref", {
|
|
420
|
+
get: ue,
|
|
421
421
|
configurable: !0
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
var Rt = function(R, H,
|
|
425
|
+
var Rt = function(R, H, ue, Te, Ke, He, $e) {
|
|
426
426
|
var F = {
|
|
427
427
|
// This tag allows us to uniquely identify this as a React Element
|
|
428
428
|
$$typeof: t,
|
|
429
429
|
// Built-in properties that belong on the element
|
|
430
430
|
type: R,
|
|
431
431
|
key: H,
|
|
432
|
-
ref:
|
|
432
|
+
ref: ue,
|
|
433
433
|
props: $e,
|
|
434
434
|
// Record the component responsible for creating this element.
|
|
435
435
|
_owner: He
|
|
@@ -451,10 +451,10 @@ function sg() {
|
|
|
451
451
|
value: Ke
|
|
452
452
|
}), Object.freeze && (Object.freeze(F.props), Object.freeze(F)), F;
|
|
453
453
|
};
|
|
454
|
-
function Kn(R, H,
|
|
454
|
+
function Kn(R, H, ue, Te, Ke) {
|
|
455
455
|
{
|
|
456
456
|
var He, $e = {}, F = null, de = null;
|
|
457
|
-
|
|
457
|
+
ue !== void 0 && (we(ue), F = "" + ue), xt(H) && (we(H.key), F = "" + H.key), tt(H) && (de = H.ref, wn(H, Ke));
|
|
458
458
|
for (He in H)
|
|
459
459
|
ct.call(H, He) && !Fe.hasOwnProperty(He) && ($e[He] = H[He]);
|
|
460
460
|
if (R && R.defaultProps) {
|
|
@@ -472,13 +472,13 @@ function sg() {
|
|
|
472
472
|
var Kt = x.ReactCurrentOwner, cn = x.ReactDebugCurrentFrame;
|
|
473
473
|
function Qt(R) {
|
|
474
474
|
if (R) {
|
|
475
|
-
var H = R._owner,
|
|
476
|
-
cn.setExtraStackFrame(
|
|
475
|
+
var H = R._owner, ue = et(R.type, R._source, H ? H.type : null);
|
|
476
|
+
cn.setExtraStackFrame(ue);
|
|
477
477
|
} else
|
|
478
478
|
cn.setExtraStackFrame(null);
|
|
479
479
|
}
|
|
480
|
-
var
|
|
481
|
-
|
|
480
|
+
var Pt;
|
|
481
|
+
Pt = !1;
|
|
482
482
|
function bn(R) {
|
|
483
483
|
return typeof R == "object" && R !== null && R.$$typeof === t;
|
|
484
484
|
}
|
|
@@ -502,10 +502,10 @@ Check the render method of \`` + R + "`.";
|
|
|
502
502
|
{
|
|
503
503
|
var H = un();
|
|
504
504
|
if (!H) {
|
|
505
|
-
var
|
|
506
|
-
|
|
505
|
+
var ue = typeof R == "string" ? R : R.displayName || R.name;
|
|
506
|
+
ue && (H = `
|
|
507
507
|
|
|
508
|
-
Check the top-level render call using <` +
|
|
508
|
+
Check the top-level render call using <` + ue + ">.");
|
|
509
509
|
}
|
|
510
510
|
return H;
|
|
511
511
|
}
|
|
@@ -515,12 +515,12 @@ Check the top-level render call using <` + ce + ">.");
|
|
|
515
515
|
if (!R._store || R._store.validated || R.key != null)
|
|
516
516
|
return;
|
|
517
517
|
R._store.validated = !0;
|
|
518
|
-
var
|
|
519
|
-
if (dn[
|
|
518
|
+
var ue = Sn(H);
|
|
519
|
+
if (dn[ue])
|
|
520
520
|
return;
|
|
521
|
-
dn[
|
|
521
|
+
dn[ue] = !0;
|
|
522
522
|
var Te = "";
|
|
523
|
-
R && R._owner && R._owner !== Kt.current && (Te = " It was passed a child from " + O(R._owner.type) + "."), Qt(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',
|
|
523
|
+
R && R._owner && R._owner !== Kt.current && (Te = " It was passed a child from " + O(R._owner.type) + "."), Qt(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ue, Te), Qt(null);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
function qt(R, H) {
|
|
@@ -528,8 +528,8 @@ Check the top-level render call using <` + ce + ">.");
|
|
|
528
528
|
if (typeof R != "object")
|
|
529
529
|
return;
|
|
530
530
|
if (Ct(R))
|
|
531
|
-
for (var
|
|
532
|
-
var Te = R[
|
|
531
|
+
for (var ue = 0; ue < R.length; ue++) {
|
|
532
|
+
var Te = R[ue];
|
|
533
533
|
bn(Te) && ar(Te, H);
|
|
534
534
|
}
|
|
535
535
|
else if (bn(R))
|
|
@@ -547,20 +547,20 @@ Check the top-level render call using <` + ce + ">.");
|
|
|
547
547
|
var H = R.type;
|
|
548
548
|
if (H == null || typeof H == "string")
|
|
549
549
|
return;
|
|
550
|
-
var
|
|
550
|
+
var ue;
|
|
551
551
|
if (typeof H == "function")
|
|
552
|
-
|
|
552
|
+
ue = H.propTypes;
|
|
553
553
|
else if (typeof H == "object" && (H.$$typeof === l || // Note: Memo only checks outer props here.
|
|
554
554
|
// Inner props are checked in the reconciler.
|
|
555
555
|
H.$$typeof === f))
|
|
556
|
-
|
|
556
|
+
ue = H.propTypes;
|
|
557
557
|
else
|
|
558
558
|
return;
|
|
559
|
-
if (
|
|
559
|
+
if (ue) {
|
|
560
560
|
var Te = O(H);
|
|
561
|
-
Oe(
|
|
562
|
-
} else if (H.PropTypes !== void 0 && !
|
|
563
|
-
|
|
561
|
+
Oe(ue, R.props, "prop", Te, R);
|
|
562
|
+
} else if (H.PropTypes !== void 0 && !Pt) {
|
|
563
|
+
Pt = !0;
|
|
564
564
|
var Ke = O(H);
|
|
565
565
|
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Ke || "Unknown");
|
|
566
566
|
}
|
|
@@ -569,8 +569,8 @@ Check the top-level render call using <` + ce + ">.");
|
|
|
569
569
|
}
|
|
570
570
|
function Cn(R) {
|
|
571
571
|
{
|
|
572
|
-
for (var H = Object.keys(R.props),
|
|
573
|
-
var Te = H[
|
|
572
|
+
for (var H = Object.keys(R.props), ue = 0; ue < H.length; ue++) {
|
|
573
|
+
var Te = H[ue];
|
|
574
574
|
if (Te !== "children" && Te !== "key") {
|
|
575
575
|
Qt(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Te), Qt(null);
|
|
576
576
|
break;
|
|
@@ -580,7 +580,7 @@ Check the top-level render call using <` + ce + ">.");
|
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
var fn = {};
|
|
583
|
-
function Bn(R, H,
|
|
583
|
+
function Bn(R, H, ue, Te, Ke, He) {
|
|
584
584
|
{
|
|
585
585
|
var $e = j(R);
|
|
586
586
|
if (!$e) {
|
|
@@ -591,7 +591,7 @@ Check the top-level render call using <` + ce + ">.");
|
|
|
591
591
|
var pe;
|
|
592
592
|
R === null ? pe = "null" : Ct(R) ? pe = "array" : R !== void 0 && R.$$typeof === t ? (pe = "<" + (O(R.type) || "Unknown") + " />", F = " Did you accidentally export a JSX literal instead of a component?") : pe = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", pe, F);
|
|
593
593
|
}
|
|
594
|
-
var Ee = Kn(R, H,
|
|
594
|
+
var Ee = Kn(R, H, ue, Ke, He);
|
|
595
595
|
if (Ee == null)
|
|
596
596
|
return Ee;
|
|
597
597
|
if ($e) {
|
|
@@ -624,11 +624,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
624
624
|
return R === r ? Cn(Ee) : lr(Ee), Ee;
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function cr(R, H,
|
|
628
|
-
return Bn(R, H,
|
|
627
|
+
function cr(R, H, ue) {
|
|
628
|
+
return Bn(R, H, ue, !0);
|
|
629
629
|
}
|
|
630
|
-
function Ar(R, H,
|
|
631
|
-
return Bn(R, H,
|
|
630
|
+
function Ar(R, H, ue) {
|
|
631
|
+
return Bn(R, H, ue, !1);
|
|
632
632
|
}
|
|
633
633
|
var Nr = Ar, qn = cr;
|
|
634
634
|
to.Fragment = r, to.jsx = Nr, to.jsxs = qn;
|
|
@@ -3894,29 +3894,29 @@ function Ly({
|
|
|
3894
3894
|
var te;
|
|
3895
3895
|
const E = xt.current;
|
|
3896
3896
|
if (E.size <= uc) return;
|
|
3897
|
-
const I = Array.from(E.entries()).sort((
|
|
3898
|
-
for (let
|
|
3899
|
-
const Z = (te = I[
|
|
3897
|
+
const I = Array.from(E.entries()).sort((ce, Z) => ce[1].timestamp - Z[1].timestamp), Y = E.size - uc;
|
|
3898
|
+
for (let ce = 0; ce < Y; ce++) {
|
|
3899
|
+
const Z = (te = I[ce]) == null ? void 0 : te[0];
|
|
3900
3900
|
Z && E.delete(Z);
|
|
3901
3901
|
}
|
|
3902
3902
|
}, []), Vt = ke(
|
|
3903
3903
|
(E, I, Y) => {
|
|
3904
3904
|
if (!E) return;
|
|
3905
|
-
const te = Y === "replace" ? [] : rt.current.get(E) ?? [],
|
|
3906
|
-
if (!
|
|
3905
|
+
const te = Y === "replace" ? [] : rt.current.get(E) ?? [], ce = Y === "replace" ? I : [...I, ...te];
|
|
3906
|
+
if (!ce.length) {
|
|
3907
3907
|
Y === "replace" && rt.current.set(E, []);
|
|
3908
3908
|
return;
|
|
3909
3909
|
}
|
|
3910
3910
|
const Z = /* @__PURE__ */ new Map();
|
|
3911
|
-
for (const We of
|
|
3911
|
+
for (const We of ce) {
|
|
3912
3912
|
if (!(We != null && We.checkpointId)) continue;
|
|
3913
3913
|
const De = `${We.checkpointId}::${We.checkpointNs ?? ""}`, Je = nn(We, { cloneMessages: !0 }), yt = Z.get(De);
|
|
3914
3914
|
if (!yt) {
|
|
3915
3915
|
Z.set(De, Je);
|
|
3916
3916
|
continue;
|
|
3917
3917
|
}
|
|
3918
|
-
const
|
|
3919
|
-
Z.set(De, { ...yt, ...
|
|
3918
|
+
const At = fc(yt, Je);
|
|
3919
|
+
Z.set(De, { ...yt, ...At });
|
|
3920
3920
|
}
|
|
3921
3921
|
const Ue = Array.from(Z.values()).sort((We, De) => {
|
|
3922
3922
|
const Je = Number.isFinite(Date.parse(We.createdAt ?? "")) ? Date.parse(We.createdAt ?? "") : 0;
|
|
@@ -3928,19 +3928,19 @@ function Ly({
|
|
|
3928
3928
|
), Rt = ke(
|
|
3929
3929
|
(E, I, Y) => {
|
|
3930
3930
|
if (!E) return;
|
|
3931
|
-
const te = gt.current.get(E),
|
|
3931
|
+
const te = gt.current.get(E), ce = Y === "replace" || !te ? /* @__PURE__ */ new Map() : new Map(te);
|
|
3932
3932
|
if (I && typeof I == "object")
|
|
3933
3933
|
for (const [Z, Ue] of Object.entries(I)) {
|
|
3934
3934
|
if (!(Ue != null && Ue.checkpointId)) continue;
|
|
3935
3935
|
const We = Z || ro(Ue.checkpointId, Ue.checkpointNs ?? null);
|
|
3936
|
-
|
|
3936
|
+
ce.set(We, nn(Ue, { cloneMessages: !0 }));
|
|
3937
3937
|
}
|
|
3938
|
-
gt.current.set(E,
|
|
3938
|
+
gt.current.set(E, ce);
|
|
3939
3939
|
},
|
|
3940
3940
|
[]
|
|
3941
3941
|
), Kn = ke(
|
|
3942
3942
|
(E, I) => {
|
|
3943
|
-
const { threadId: Y, checkpointId: te = null, checkpointNs:
|
|
3943
|
+
const { threadId: Y, checkpointId: te = null, checkpointNs: ce = null } = E, Z = dc(Y, te, ce);
|
|
3944
3944
|
if (I != null && I.force)
|
|
3945
3945
|
tt.current.delete(Z), xt.current.delete(Z);
|
|
3946
3946
|
else {
|
|
@@ -3956,7 +3956,7 @@ function Ly({
|
|
|
3956
3956
|
const We = l.getStateHistory({
|
|
3957
3957
|
threadId: Y,
|
|
3958
3958
|
checkpointId: te ?? void 0,
|
|
3959
|
-
checkpointNs:
|
|
3959
|
+
checkpointNs: ce ?? void 0
|
|
3960
3960
|
}).then((De) => (xt.current.set(Z, { payload: De, timestamp: Date.now() }), ir(), De)).finally(() => {
|
|
3961
3961
|
tt.current.get(Z) === We && tt.current.delete(Z);
|
|
3962
3962
|
});
|
|
@@ -3964,7 +3964,7 @@ function Ly({
|
|
|
3964
3964
|
},
|
|
3965
3965
|
[l, ir]
|
|
3966
3966
|
), Kt = ke((E, I) => new Promise((Y, te) => {
|
|
3967
|
-
const
|
|
3967
|
+
const ce = async () => {
|
|
3968
3968
|
bt.current = !0;
|
|
3969
3969
|
try {
|
|
3970
3970
|
await E(), Y();
|
|
@@ -3977,7 +3977,7 @@ function Ly({
|
|
|
3977
3977
|
});
|
|
3978
3978
|
}
|
|
3979
3979
|
};
|
|
3980
|
-
bt.current ? Ct.current.push(
|
|
3980
|
+
bt.current ? Ct.current.push(ce) : ce().catch((Z) => {
|
|
3981
3981
|
te(Z);
|
|
3982
3982
|
});
|
|
3983
3983
|
}), []), cn = ze(C.length), Qt = ze(!1);
|
|
@@ -3987,15 +3987,15 @@ function Ly({
|
|
|
3987
3987
|
const E = le.pendingInterrupt ?? Sy(le.messages);
|
|
3988
3988
|
lc(U, E) || ne(E ?? null);
|
|
3989
3989
|
}, [U, le.messages, le.pendingInterrupt]);
|
|
3990
|
-
const
|
|
3990
|
+
const Pt = ke(async () => {
|
|
3991
3991
|
const E = cn.current > 0;
|
|
3992
3992
|
E || N(!0);
|
|
3993
3993
|
try {
|
|
3994
3994
|
const I = await l.listThreads();
|
|
3995
3995
|
Do(() => {
|
|
3996
3996
|
T((Y) => {
|
|
3997
|
-
const te = (Ue) => Ue.map((We) => `${We.threadId}:${We.updatedAt ?? ""}:${We.messageCount ?? ""}`).join("|"),
|
|
3998
|
-
return te(
|
|
3997
|
+
const te = (Ue) => Ue.map((We) => `${We.threadId}:${We.updatedAt ?? ""}:${We.messageCount ?? ""}`).join("|"), ce = Ri(Y);
|
|
3998
|
+
return te(ce) === te(I) || I.length === 0 && ce.length > 0 && !Qt.current ? Y : $o(I);
|
|
3999
3999
|
});
|
|
4000
4000
|
}), O(null), Qt.current || (Qt.current = !0);
|
|
4001
4001
|
} catch (I) {
|
|
@@ -4007,7 +4007,7 @@ function Ly({
|
|
|
4007
4007
|
(E, I) => {
|
|
4008
4008
|
if (!xr()) return;
|
|
4009
4009
|
pt.current !== null && (window.clearTimeout(pt.current), pt.current = null);
|
|
4010
|
-
const Y = E.map((
|
|
4010
|
+
const Y = E.map((ce) => `${ce.threadId}:${ce.updatedAt ?? ""}:${ce.messageCount ?? ""}`).join("|");
|
|
4011
4011
|
if (E.length === 0) {
|
|
4012
4012
|
try {
|
|
4013
4013
|
oa(x);
|
|
@@ -4020,8 +4020,8 @@ function Ly({
|
|
|
4020
4020
|
return;
|
|
4021
4021
|
const te = () => {
|
|
4022
4022
|
try {
|
|
4023
|
-
const
|
|
4024
|
-
ia(x,
|
|
4023
|
+
const ce = E.slice(0, sa);
|
|
4024
|
+
ia(x, ce), dn.current = Y;
|
|
4025
4025
|
} catch {
|
|
4026
4026
|
} finally {
|
|
4027
4027
|
pt.current = null;
|
|
@@ -4041,17 +4041,17 @@ function Ly({
|
|
|
4041
4041
|
}, [Sn, C]), qt = ke(
|
|
4042
4042
|
(E, I, Y, te) => {
|
|
4043
4043
|
var Nl;
|
|
4044
|
-
const
|
|
4045
|
-
if (!
|
|
4044
|
+
const ce = Y ?? Oe.current;
|
|
4045
|
+
if (!ce)
|
|
4046
4046
|
return;
|
|
4047
|
-
const Z = nn(E), Ue =
|
|
4047
|
+
const Z = nn(E), Ue = ce === Oe.current, We = (te == null ? void 0 : te.persist) !== !1;
|
|
4048
4048
|
if (I === "replace") {
|
|
4049
4049
|
if (We) {
|
|
4050
|
-
const
|
|
4051
|
-
threadId:
|
|
4050
|
+
const Et = {
|
|
4051
|
+
threadId: ce,
|
|
4052
4052
|
snapshot: nn(E, { cloneMessages: !0 })
|
|
4053
4053
|
};
|
|
4054
|
-
be.current.set(
|
|
4054
|
+
be.current.set(ce, Et), we.current = ce;
|
|
4055
4055
|
}
|
|
4056
4056
|
if (!Ue)
|
|
4057
4057
|
return;
|
|
@@ -4062,41 +4062,41 @@ function Ly({
|
|
|
4062
4062
|
}), ne(Z.interrupt ?? null), xe(Z.nextCursor ?? null), ae(!!Z.nextCursor), M(Z.checkpointId ?? void 0), re(Z.checkpointNs ?? void 0), oe(Z.nextCursorNs ?? void 0);
|
|
4063
4063
|
return;
|
|
4064
4064
|
}
|
|
4065
|
-
const De = be.current.get(
|
|
4066
|
-
const yi =
|
|
4067
|
-
return yi ?
|
|
4068
|
-
}), Jr = fc(
|
|
4069
|
-
checkpointId:
|
|
4070
|
-
checkpointNs:
|
|
4071
|
-
createdAt: Z.createdAt ??
|
|
4072
|
-
parentId: Z.parentId ??
|
|
4073
|
-
branchLabel: Z.branchLabel ??
|
|
4074
|
-
lastMessageId: ((Nl =
|
|
4075
|
-
messagesLen:
|
|
4076
|
-
hasMessages:
|
|
4077
|
-
messages:
|
|
4078
|
-
nextCursor: Z.nextCursor ??
|
|
4079
|
-
nextCursorNs: Z.nextCursorNs ??
|
|
4080
|
-
interrupt:
|
|
4065
|
+
const De = be.current.get(ce), Je = (De == null ? void 0 : De.snapshot) ?? null, yt = Array.isArray(Je == null ? void 0 : Je.messages) ? Je.messages : [], At = nn(Je), Tn = Array.isArray(E == null ? void 0 : E.messages) ? E.messages : [], Nt = /* @__PURE__ */ new Set(), _t = [...Tn, ...yt].filter((Et) => {
|
|
4066
|
+
const yi = Et == null ? void 0 : Et.id;
|
|
4067
|
+
return yi ? Nt.has(yi) ? !1 : (Nt.add(yi), !0) : !0;
|
|
4068
|
+
}), Jr = fc(At, Z), Zr = {
|
|
4069
|
+
checkpointId: At.checkpointId ?? Z.checkpointId ?? null,
|
|
4070
|
+
checkpointNs: At.checkpointNs ?? Z.checkpointNs ?? null,
|
|
4071
|
+
createdAt: Z.createdAt ?? At.createdAt ?? null,
|
|
4072
|
+
parentId: Z.parentId ?? At.parentId ?? null,
|
|
4073
|
+
branchLabel: Z.branchLabel ?? At.branchLabel ?? null,
|
|
4074
|
+
lastMessageId: ((Nl = _t[_t.length - 1]) == null ? void 0 : Nl.id) ?? null,
|
|
4075
|
+
messagesLen: _t.length,
|
|
4076
|
+
hasMessages: _t.length > 0,
|
|
4077
|
+
messages: _t,
|
|
4078
|
+
nextCursor: Z.nextCursor ?? At.nextCursor ?? null,
|
|
4079
|
+
nextCursorNs: Z.nextCursorNs ?? At.nextCursorNs ?? null,
|
|
4080
|
+
interrupt: At.interrupt ?? Z.interrupt ?? null,
|
|
4081
4081
|
...Jr
|
|
4082
4082
|
};
|
|
4083
|
-
if (be.current.set(
|
|
4084
|
-
threadId:
|
|
4083
|
+
if (be.current.set(ce, {
|
|
4084
|
+
threadId: ce,
|
|
4085
4085
|
snapshot: nn(Zr, { cloneMessages: !0 })
|
|
4086
4086
|
}), !Ue)
|
|
4087
4087
|
return;
|
|
4088
4088
|
Tn.length && ct(Tn);
|
|
4089
4089
|
const kn = E && Object.prototype.hasOwnProperty.call(E, "checkpointId") ? E.checkpointId : void 0, Qr = E && Object.prototype.hasOwnProperty.call(E, "checkpointNs") ? E.checkpointNs : void 0, Rn = E && Object.prototype.hasOwnProperty.call(E, "nextCursor") ? E.nextCursor : void 0, xi = E && Object.prototype.hasOwnProperty.call(E, "nextCursorNs") ? E.nextCursorNs : void 0;
|
|
4090
4090
|
xe(
|
|
4091
|
-
(
|
|
4091
|
+
(Et) => Rn !== void 0 ? Rn ?? Et ?? null : Et ?? null
|
|
4092
4092
|
), ae(
|
|
4093
|
-
(
|
|
4093
|
+
(Et) => Rn !== void 0 ? !!Rn : Et
|
|
4094
4094
|
), M(
|
|
4095
|
-
(
|
|
4095
|
+
(Et) => kn !== void 0 ? kn ?? Et ?? void 0 : Et ?? void 0
|
|
4096
4096
|
), re(
|
|
4097
|
-
(
|
|
4097
|
+
(Et) => Qr !== void 0 ? Qr ?? Et ?? void 0 : Et ?? void 0
|
|
4098
4098
|
), oe(
|
|
4099
|
-
(
|
|
4099
|
+
(Et) => xi !== void 0 ? xi ?? void 0 : Et
|
|
4100
4100
|
);
|
|
4101
4101
|
},
|
|
4102
4102
|
[ct, et, ne]
|
|
@@ -4147,8 +4147,8 @@ function Ly({
|
|
|
4147
4147
|
};
|
|
4148
4148
|
Oe.current !== I && (!Oe.current && le.messages.length <= 1 && (se.current = I), k(I)), Do(() => {
|
|
4149
4149
|
T((te) => {
|
|
4150
|
-
const
|
|
4151
|
-
return
|
|
4150
|
+
const ce = te.byId[I];
|
|
4151
|
+
return ce ? ce.title === Y.title && ce.updatedAt === Y.updatedAt && ce.messageCount === Y.messageCount ? te : {
|
|
4152
4152
|
byId: { ...te.byId, [I]: Y },
|
|
4153
4153
|
order: te.order
|
|
4154
4154
|
} : {
|
|
@@ -4202,24 +4202,23 @@ function Ly({
|
|
|
4202
4202
|
var te;
|
|
4203
4203
|
const E = l.getAuthToken();
|
|
4204
4204
|
H(E);
|
|
4205
|
-
const I = (
|
|
4206
|
-
const Z = Ti(f,
|
|
4205
|
+
const I = (ce) => {
|
|
4206
|
+
const Z = Ti(f, ce);
|
|
4207
4207
|
Fe.current !== Z && (Fe.current = Z, Ge.current = !1), w(Z);
|
|
4208
4208
|
const Ue = ki(Z);
|
|
4209
4209
|
Do(() => {
|
|
4210
4210
|
T($o(Ue));
|
|
4211
|
-
}), Ge.current
|
|
4212
|
-
}));
|
|
4211
|
+
}), ce && !Ge.current && (Ge.current = !0);
|
|
4213
4212
|
};
|
|
4214
4213
|
I(E);
|
|
4215
|
-
const Y = (te = l.onTokenChange) == null ? void 0 : te.call(l, (
|
|
4216
|
-
H(
|
|
4214
|
+
const Y = (te = l.onTokenChange) == null ? void 0 : te.call(l, (ce) => {
|
|
4215
|
+
ce !== E && (H(ce), y(), tt.current.clear(), xt.current.clear(), I(ce));
|
|
4217
4216
|
});
|
|
4218
4217
|
return () => {
|
|
4219
4218
|
Y == null || Y();
|
|
4220
4219
|
};
|
|
4221
|
-
}, [l, f, H, y
|
|
4222
|
-
const
|
|
4220
|
+
}, [l, f, H, y]);
|
|
4221
|
+
const ue = ke(
|
|
4223
4222
|
async (E) => {
|
|
4224
4223
|
var te;
|
|
4225
4224
|
const I = `Thread ${(te = crypto.randomUUID) == null ? void 0 : te.call(crypto)}`, Y = {
|
|
@@ -4229,12 +4228,12 @@ function Ly({
|
|
|
4229
4228
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4230
4229
|
messageCount: 0
|
|
4231
4230
|
};
|
|
4232
|
-
T((
|
|
4233
|
-
byId: { ...
|
|
4234
|
-
order: [I, ...
|
|
4231
|
+
T((ce) => ({
|
|
4232
|
+
byId: { ...ce.byId, [I]: Y },
|
|
4233
|
+
order: [I, ...ce.order]
|
|
4235
4234
|
})), k(I);
|
|
4236
4235
|
try {
|
|
4237
|
-
const
|
|
4236
|
+
const ce = await l.createThread(E), Z = typeof ce == "string" ? ce : ce.threadId;
|
|
4238
4237
|
return T((Ue) => {
|
|
4239
4238
|
const We = Ue.byId[I];
|
|
4240
4239
|
if (!We) return Ue;
|
|
@@ -4242,18 +4241,18 @@ function Ly({
|
|
|
4242
4241
|
delete De[I], De[Z] = { ...We, threadId: Z };
|
|
4243
4242
|
const Je = Ue.order.map((yt) => yt === I ? Z : yt);
|
|
4244
4243
|
return { byId: De, order: Je };
|
|
4245
|
-
}), k(Z), setTimeout(() =>
|
|
4246
|
-
} catch (
|
|
4244
|
+
}), k(Z), setTimeout(() => Pt(), 10), O(null), Z;
|
|
4245
|
+
} catch (ce) {
|
|
4247
4246
|
throw T((Z) => {
|
|
4248
4247
|
if (!Z.byId[I]) return Z;
|
|
4249
4248
|
const Ue = { ...Z.byId };
|
|
4250
4249
|
delete Ue[I];
|
|
4251
4250
|
const We = Z.order.filter((De) => De !== I);
|
|
4252
4251
|
return { byId: Ue, order: We };
|
|
4253
|
-
}), k(null), O(String(
|
|
4252
|
+
}), k(null), O(String(ce)), ce;
|
|
4254
4253
|
}
|
|
4255
4254
|
},
|
|
4256
|
-
[l,
|
|
4255
|
+
[l, Pt]
|
|
4257
4256
|
), Te = ke(
|
|
4258
4257
|
async (E) => {
|
|
4259
4258
|
try {
|
|
@@ -4263,14 +4262,14 @@ function Ly({
|
|
|
4263
4262
|
if (!Y.byId[E]) return Y;
|
|
4264
4263
|
const te = { ...Y.byId };
|
|
4265
4264
|
delete te[E];
|
|
4266
|
-
const
|
|
4265
|
+
const ce = Y.order.filter((Ue) => Ue !== E), Z = { byId: te, order: ce };
|
|
4267
4266
|
return I = Ri(Z), Z;
|
|
4268
|
-
}), I && Sn(I, { immediate: !0 }), Cn(E), Oe.current === E && (se.current = E, k(null), Oe.current = null, we.current = null, fn()), await
|
|
4267
|
+
}), I && Sn(I, { immediate: !0 }), Cn(E), Oe.current === E && (se.current = E, k(null), Oe.current = null, we.current = null, fn()), await Pt(), O(null);
|
|
4269
4268
|
} catch (I) {
|
|
4270
4269
|
throw O(String(I)), I;
|
|
4271
4270
|
}
|
|
4272
4271
|
},
|
|
4273
|
-
[l, fn, Cn,
|
|
4272
|
+
[l, fn, Cn, Pt, Sn]
|
|
4274
4273
|
), Ke = ke(
|
|
4275
4274
|
async (E, I) => {
|
|
4276
4275
|
try {
|
|
@@ -4282,10 +4281,10 @@ function Ly({
|
|
|
4282
4281
|
} : Y;
|
|
4283
4282
|
}), O(null);
|
|
4284
4283
|
} catch (Y) {
|
|
4285
|
-
throw await
|
|
4284
|
+
throw await Pt(), O(String(Y)), Y;
|
|
4286
4285
|
}
|
|
4287
4286
|
},
|
|
4288
|
-
[l,
|
|
4287
|
+
[l, Pt]
|
|
4289
4288
|
), He = ke(
|
|
4290
4289
|
async (E, I, Y, te = !1) => {
|
|
4291
4290
|
await Kt(async () => {
|
|
@@ -4295,7 +4294,7 @@ function Ly({
|
|
|
4295
4294
|
}
|
|
4296
4295
|
if (mt.current === E && !te)
|
|
4297
4296
|
return;
|
|
4298
|
-
k((
|
|
4297
|
+
k((Nt) => Nt === E ? Nt : E), Oe.current = E;
|
|
4299
4298
|
const Ue = dc(
|
|
4300
4299
|
E,
|
|
4301
4300
|
I ?? null,
|
|
@@ -4303,30 +4302,30 @@ function Ly({
|
|
|
4303
4302
|
), We = xt.current.get(Ue), De = !te && !I && !Y && We && Date.now() - We.timestamp < Py, Je = !te && !I && !Y;
|
|
4304
4303
|
let yt = !1;
|
|
4305
4304
|
if (Je) {
|
|
4306
|
-
const
|
|
4307
|
-
if (
|
|
4308
|
-
lr(
|
|
4305
|
+
const Nt = be.current.get(E);
|
|
4306
|
+
if (Nt)
|
|
4307
|
+
lr(Nt), yt = !0;
|
|
4309
4308
|
else {
|
|
4310
|
-
const
|
|
4311
|
-
|
|
4309
|
+
const _t = h(E);
|
|
4310
|
+
_t && (be.current.set(E, _t), lr(_t), yt = !0);
|
|
4312
4311
|
}
|
|
4313
4312
|
}
|
|
4314
|
-
const
|
|
4315
|
-
|
|
4313
|
+
const At = te || !yt || !!I || !!Y, Tn = async (Nt) => {
|
|
4314
|
+
Nt && $(!0), mt.current = E;
|
|
4316
4315
|
try {
|
|
4317
|
-
const
|
|
4316
|
+
const _t = await Kn(
|
|
4318
4317
|
{ threadId: E, checkpointId: I, checkpointNs: Y },
|
|
4319
4318
|
{ force: te }
|
|
4320
|
-
), { latest: Jr, checkpoints: Zr, snapshots: kn } = na(
|
|
4319
|
+
), { latest: Jr, checkpoints: Zr, snapshots: kn } = na(_t);
|
|
4321
4320
|
qt(Jr, "replace", E), Vt(E, Zr, "replace"), Rt(E, kn, "replace"), D(null);
|
|
4322
|
-
} catch (
|
|
4323
|
-
throw (!yt || te ||
|
|
4321
|
+
} catch (_t) {
|
|
4322
|
+
throw (!yt || te || Nt) && (i == null || i(String(_t))), D(String(_t)), _t;
|
|
4324
4323
|
} finally {
|
|
4325
|
-
mt.current = null,
|
|
4324
|
+
mt.current = null, Nt && $(!1);
|
|
4326
4325
|
}
|
|
4327
4326
|
};
|
|
4328
|
-
|
|
4329
|
-
console.warn("[ChatSessionProvider] Background refresh failed:",
|
|
4327
|
+
At ? await Tn(!0) : Je && yt && !De && Tn(!1).catch((Nt) => {
|
|
4328
|
+
console.warn("[ChatSessionProvider] Background refresh failed:", Nt);
|
|
4330
4329
|
});
|
|
4331
4330
|
}, `loadThread-${E}`);
|
|
4332
4331
|
},
|
|
@@ -4354,10 +4353,10 @@ function Ly({
|
|
|
4354
4353
|
var Z;
|
|
4355
4354
|
const Y = Oe.current;
|
|
4356
4355
|
if (!Y) throw new Error("No active thread");
|
|
4357
|
-
const te = ro(E, I ?? null),
|
|
4358
|
-
if (
|
|
4356
|
+
const te = ro(E, I ?? null), ce = (Z = gt.current.get(Y)) == null ? void 0 : Z.get(te);
|
|
4357
|
+
if (ce) {
|
|
4359
4358
|
await Kt(async () => {
|
|
4360
|
-
qt(
|
|
4359
|
+
qt(ce, "replace", Y, { persist: !1 });
|
|
4361
4360
|
}, `navigateToCheckpoint-${Y}-${te}`);
|
|
4362
4361
|
return;
|
|
4363
4362
|
}
|
|
@@ -4379,9 +4378,9 @@ function Ly({
|
|
|
4379
4378
|
threadId: I,
|
|
4380
4379
|
checkpointId: E ?? W ?? null,
|
|
4381
4380
|
checkpointNs: fe ?? X ?? null
|
|
4382
|
-
}), { latest: te, checkpoints:
|
|
4383
|
-
let We =
|
|
4384
|
-
if (We && Ue && Ue.size > 0 && (We =
|
|
4381
|
+
}), { latest: te, checkpoints: ce, snapshots: Z } = na(Y), Ue = I ? gt.current.get(I) : null;
|
|
4382
|
+
let We = ce.length > 0;
|
|
4383
|
+
if (We && Ue && Ue.size > 0 && (We = ce.some((De) => {
|
|
4385
4384
|
if (!(De != null && De.checkpointId))
|
|
4386
4385
|
return !1;
|
|
4387
4386
|
const Je = ro(De.checkpointId, De.checkpointNs ?? null);
|
|
@@ -4390,7 +4389,7 @@ function Ly({
|
|
|
4390
4389
|
xe(null), oe(void 0), ae(!1), D(null);
|
|
4391
4390
|
return;
|
|
4392
4391
|
}
|
|
4393
|
-
qt(te, "prepend", I ?? void 0), I && (Vt(I,
|
|
4392
|
+
qt(te, "prepend", I ?? void 0), I && (Vt(I, ce, "prepend"), Rt(I, Z, "prepend")), D(null);
|
|
4394
4393
|
} catch (I) {
|
|
4395
4394
|
throw D(String(I)), I;
|
|
4396
4395
|
} finally {
|
|
@@ -4430,7 +4429,7 @@ function Ly({
|
|
|
4430
4429
|
), nt = ke(
|
|
4431
4430
|
async (E, I) => {
|
|
4432
4431
|
var Qr;
|
|
4433
|
-
const Y = Oe.current, te = (E == null ? void 0 : E.text) ?? "",
|
|
4432
|
+
const Y = Oe.current, te = (E == null ? void 0 : E.text) ?? "", ce = (E == null ? void 0 : E.attachments) ?? [], Z = ce.length ? ce : (I == null ? void 0 : I.attachments) ?? [], Ue = {
|
|
4434
4433
|
...(I == null ? void 0 : I.payloadExtras) ?? {},
|
|
4435
4434
|
...(E == null ? void 0 : E.payload) ?? {}
|
|
4436
4435
|
};
|
|
@@ -4444,24 +4443,24 @@ function Ly({
|
|
|
4444
4443
|
Z
|
|
4445
4444
|
), Je = [...We];
|
|
4446
4445
|
te && te.trim() && Je.push({ type: "text", text: te.trim() });
|
|
4447
|
-
const yt = !!Y,
|
|
4446
|
+
const yt = !!Y, At = yt ? (I == null ? void 0 : I.checkpointId) ?? le.lastCheckpointId ?? void 0 : void 0, Tn = yt ? (I == null ? void 0 : I.checkpointNs) ?? le.lastCheckpointNs ?? void 0 : void 0, Nt = {
|
|
4448
4447
|
id: ((Qr = crypto.randomUUID) == null ? void 0 : Qr.call(crypto)) || `user-${Date.now()}`,
|
|
4449
4448
|
role: "user",
|
|
4450
4449
|
content: Je,
|
|
4451
4450
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4452
|
-
...
|
|
4451
|
+
...At != null ? { checkpointId: At } : {},
|
|
4453
4452
|
...Tn != null ? { checkpointNs: Tn } : {}
|
|
4454
4453
|
};
|
|
4455
|
-
Je.length > 0 && it(
|
|
4456
|
-
const
|
|
4457
|
-
messages: Je.length > 0 ? [
|
|
4454
|
+
Je.length > 0 && it(Nt);
|
|
4455
|
+
const _t = { ...Nt, content: Je }, Jr = Z.length > 0, Zr = {
|
|
4456
|
+
messages: Je.length > 0 ? [_t] : [],
|
|
4458
4457
|
files_info: De,
|
|
4459
4458
|
...o && Jr && s ? { active_agent: s } : {},
|
|
4460
4459
|
...Ue
|
|
4461
4460
|
}, kn = {
|
|
4462
4461
|
threadId: Y ?? null,
|
|
4463
4462
|
payload: Zr,
|
|
4464
|
-
checkpointId:
|
|
4463
|
+
checkpointId: At ?? null,
|
|
4465
4464
|
checkpointNs: Tn ?? null,
|
|
4466
4465
|
nodeFilter: (I == null ? void 0 : I.nodeFilter) ?? null,
|
|
4467
4466
|
config: I == null ? void 0 : I.config,
|
|
@@ -4495,7 +4494,7 @@ function Ly({
|
|
|
4495
4494
|
async (E, I, Y) => {
|
|
4496
4495
|
if (!Oe.current)
|
|
4497
4496
|
throw new Error("No active thread to handle interrupt");
|
|
4498
|
-
const
|
|
4497
|
+
const ce = I ? Y ?? !0 : !1;
|
|
4499
4498
|
try {
|
|
4500
4499
|
try {
|
|
4501
4500
|
Ye({ type: "interrupt_response", payload: { interruptId: E } });
|
|
@@ -4507,7 +4506,7 @@ function Ly({
|
|
|
4507
4506
|
{
|
|
4508
4507
|
checkpointId: le.lastCheckpointId ?? void 0,
|
|
4509
4508
|
checkpointNs: le.lastCheckpointNs ?? void 0,
|
|
4510
|
-
command: { kind: "resume", value:
|
|
4509
|
+
command: { kind: "resume", value: ce }
|
|
4511
4510
|
}
|
|
4512
4511
|
), ne(null);
|
|
4513
4512
|
} catch (Z) {
|
|
@@ -4525,7 +4524,7 @@ function Ly({
|
|
|
4525
4524
|
}
|
|
4526
4525
|
}, [S, a]), at(() => ((async () => {
|
|
4527
4526
|
try {
|
|
4528
|
-
if (
|
|
4527
|
+
if (Pt().catch((I) => {
|
|
4529
4528
|
console.error("[ChatSessionProvider] Failed to refresh threads (background):", I), i == null || i(String(I));
|
|
4530
4529
|
}), !r && !t)
|
|
4531
4530
|
try {
|
|
@@ -4550,14 +4549,14 @@ function Ly({
|
|
|
4550
4549
|
nextCursor: Re ?? null,
|
|
4551
4550
|
nextCursorNs: fe ?? null,
|
|
4552
4551
|
interrupt: le.pendingInterrupt ?? U ?? null
|
|
4553
|
-
}), Y = be.current.get(E), te = Y == null ? void 0 : Y.snapshot,
|
|
4552
|
+
}), Y = be.current.get(E), te = Y == null ? void 0 : Y.snapshot, ce = !te || te.messages.length !== I.messages.length || te.messages.some((De, Je) => {
|
|
4554
4553
|
var yt;
|
|
4555
4554
|
return (De == null ? void 0 : De.id) !== ((yt = I.messages[Je]) == null ? void 0 : yt.id);
|
|
4556
4555
|
}), Z = ((te == null ? void 0 : te.checkpointId) ?? null) !== I.checkpointId || ((te == null ? void 0 : te.checkpointNs) ?? null) !== I.checkpointNs, Ue = ((te == null ? void 0 : te.nextCursor) ?? null) !== I.nextCursor || ((te == null ? void 0 : te.nextCursorNs) ?? null) !== I.nextCursorNs, We = !lc(
|
|
4557
4556
|
(te == null ? void 0 : te.interrupt) ?? null,
|
|
4558
4557
|
I.interrupt ?? null
|
|
4559
4558
|
);
|
|
4560
|
-
if (
|
|
4559
|
+
if (ce || Z || Ue || We) {
|
|
4561
4560
|
const De = {
|
|
4562
4561
|
threadId: E,
|
|
4563
4562
|
snapshot: I
|
|
@@ -4588,10 +4587,10 @@ function Ly({
|
|
|
4588
4587
|
isLoading: A,
|
|
4589
4588
|
error: L,
|
|
4590
4589
|
actions: {
|
|
4591
|
-
createThread:
|
|
4590
|
+
createThread: ue,
|
|
4592
4591
|
deleteThread: Te,
|
|
4593
4592
|
renameThread: Ke,
|
|
4594
|
-
refreshThreads: () =>
|
|
4593
|
+
refreshThreads: () => Pt()
|
|
4595
4594
|
},
|
|
4596
4595
|
persistThreadsCache: ar,
|
|
4597
4596
|
hydrateFromCache: G
|
|
@@ -4601,10 +4600,10 @@ function Ly({
|
|
|
4601
4600
|
S,
|
|
4602
4601
|
A,
|
|
4603
4602
|
L,
|
|
4604
|
-
|
|
4603
|
+
ue,
|
|
4605
4604
|
Te,
|
|
4606
4605
|
Ke,
|
|
4607
|
-
|
|
4606
|
+
Pt,
|
|
4608
4607
|
ar,
|
|
4609
4608
|
G,
|
|
4610
4609
|
k
|
|
@@ -8093,8 +8092,8 @@ function mw(...e) {
|
|
|
8093
8092
|
};
|
|
8094
8093
|
return n.scopeName = t.scopeName, n;
|
|
8095
8094
|
}
|
|
8096
|
-
var
|
|
8097
|
-
}, gw = g[" useInsertionEffect ".trim().toString()] ||
|
|
8095
|
+
var It = globalThis != null && globalThis.document ? g.useLayoutEffect : () => {
|
|
8096
|
+
}, gw = g[" useInsertionEffect ".trim().toString()] || It;
|
|
8098
8097
|
function vr({
|
|
8099
8098
|
prop: e,
|
|
8100
8099
|
defaultProp: t,
|
|
@@ -8220,13 +8219,13 @@ function bw(e) {
|
|
|
8220
8219
|
return g.useEffect(() => {
|
|
8221
8220
|
const c = Ho(r.current);
|
|
8222
8221
|
s.current = a === "mounted" ? c : "none";
|
|
8223
|
-
}, [a]),
|
|
8222
|
+
}, [a]), It(() => {
|
|
8224
8223
|
const c = r.current, d = o.current;
|
|
8225
8224
|
if (d !== e) {
|
|
8226
8225
|
const p = s.current, h = Ho(c);
|
|
8227
8226
|
e ? l("MOUNT") : h === "none" || (c == null ? void 0 : c.display) === "none" ? l("UNMOUNT") : l(d && p !== h ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
8228
8227
|
}
|
|
8229
|
-
}, [e, l]),
|
|
8228
|
+
}, [e, l]), It(() => {
|
|
8230
8229
|
if (t) {
|
|
8231
8230
|
let c;
|
|
8232
8231
|
const d = t.ownerDocument.defaultView ?? window, f = (h) => {
|
|
@@ -8264,7 +8263,7 @@ var Cw = g[" useId ".trim().toString()] || (() => {
|
|
|
8264
8263
|
}), Tw = 0;
|
|
8265
8264
|
function On(e) {
|
|
8266
8265
|
const [t, n] = g.useState(Cw());
|
|
8267
|
-
return
|
|
8266
|
+
return It(() => {
|
|
8268
8267
|
n((r) => r ?? String(Tw++));
|
|
8269
8268
|
}, [e]), e || (t ? `radix-${t}` : "");
|
|
8270
8269
|
}
|
|
@@ -8337,7 +8336,7 @@ var Iw = g.forwardRef((e, t) => {
|
|
|
8337
8336
|
return g.useEffect(() => {
|
|
8338
8337
|
const w = requestAnimationFrame(() => y.current = !1);
|
|
8339
8338
|
return () => cancelAnimationFrame(w);
|
|
8340
|
-
}, []),
|
|
8339
|
+
}, []), It(() => {
|
|
8341
8340
|
const w = c.current;
|
|
8342
8341
|
if (w) {
|
|
8343
8342
|
x.current = x.current || {
|
|
@@ -10148,7 +10147,7 @@ function rl() {
|
|
|
10148
10147
|
dismiss: (n) => ho({ type: "DISMISS_TOAST", toastId: n })
|
|
10149
10148
|
};
|
|
10150
10149
|
}
|
|
10151
|
-
function
|
|
10150
|
+
function jt(e) {
|
|
10152
10151
|
const t = g.useRef(e);
|
|
10153
10152
|
return g.useEffect(() => {
|
|
10154
10153
|
t.current = e;
|
|
@@ -10158,7 +10157,7 @@ function Pt(e) {
|
|
|
10158
10157
|
}, []);
|
|
10159
10158
|
}
|
|
10160
10159
|
function nb(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
10161
|
-
const n =
|
|
10160
|
+
const n = jt(e);
|
|
10162
10161
|
g.useEffect(() => {
|
|
10163
10162
|
const r = (o) => {
|
|
10164
10163
|
o.key === "Escape" && n(o);
|
|
@@ -10231,7 +10230,7 @@ var ib = "DismissableLayerBranch", ab = g.forwardRef((e, t) => {
|
|
|
10231
10230
|
});
|
|
10232
10231
|
ab.displayName = ib;
|
|
10233
10232
|
function lb(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
10234
|
-
const n =
|
|
10233
|
+
const n = jt(e), r = g.useRef(!1), o = g.useRef(() => {
|
|
10235
10234
|
});
|
|
10236
10235
|
return g.useEffect(() => {
|
|
10237
10236
|
const s = (a) => {
|
|
@@ -10261,7 +10260,7 @@ function lb(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
10261
10260
|
};
|
|
10262
10261
|
}
|
|
10263
10262
|
function cb(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
10264
|
-
const n =
|
|
10263
|
+
const n = jt(e), r = g.useRef(!1);
|
|
10265
10264
|
return g.useEffect(() => {
|
|
10266
10265
|
const o = (s) => {
|
|
10267
10266
|
s.target && !r.current && tf(sb, n, { originalEvent: s }, {
|
|
@@ -10289,7 +10288,7 @@ var Mi = "focusScope.autoFocusOnMount", Di = "focusScope.autoFocusOnUnmount", Uc
|
|
|
10289
10288
|
onMountAutoFocus: o,
|
|
10290
10289
|
onUnmountAutoFocus: s,
|
|
10291
10290
|
...i
|
|
10292
|
-
} = e, [a, l] = g.useState(null), c =
|
|
10291
|
+
} = e, [a, l] = g.useState(null), c = jt(o), d = jt(s), f = g.useRef(null), p = Ve(t, (v) => l(v)), h = g.useRef({
|
|
10293
10292
|
paused: !1,
|
|
10294
10293
|
pause() {
|
|
10295
10294
|
this.paused = !0;
|
|
@@ -10414,7 +10413,7 @@ function gb(e) {
|
|
|
10414
10413
|
var xb = "Portal", Ys = g.forwardRef((e, t) => {
|
|
10415
10414
|
var a;
|
|
10416
10415
|
const { container: n, ...r } = e, [o, s] = g.useState(!1);
|
|
10417
|
-
|
|
10416
|
+
It(() => s(!0), []);
|
|
10418
10417
|
const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
|
|
10419
10418
|
return i ? bu.createPortal(/* @__PURE__ */ u.jsx(Ne.div, { ...r, ref: t }), i) : null;
|
|
10420
10419
|
});
|
|
@@ -13702,7 +13701,7 @@ Gf.displayName = VS;
|
|
|
13702
13701
|
var KS = Gf;
|
|
13703
13702
|
function Yf(e) {
|
|
13704
13703
|
const [t, n] = g.useState(void 0);
|
|
13705
|
-
return
|
|
13704
|
+
return It(() => {
|
|
13706
13705
|
if (e) {
|
|
13707
13706
|
n({ width: e.offsetWidth, height: e.offsetHeight });
|
|
13708
13707
|
const r = new ResizeObserver((o) => {
|
|
@@ -13790,12 +13789,12 @@ var xl = "PopperContent", [GS, YS] = Xf(xl), tp = g.forwardRef(
|
|
|
13790
13789
|
ZS({ arrowWidth: k, arrowHeight: A }),
|
|
13791
13790
|
p && US({ strategy: "referenceHidden", ...O })
|
|
13792
13791
|
]
|
|
13793
|
-
}), [z, G] = op(U), Q =
|
|
13794
|
-
|
|
13792
|
+
}), [z, G] = op(U), Q = jt(m);
|
|
13793
|
+
It(() => {
|
|
13795
13794
|
ne && (Q == null || Q());
|
|
13796
13795
|
}, [ne, Q]);
|
|
13797
13796
|
const ae = (W = K.arrow) == null ? void 0 : W.x, B = (M = K.arrow) == null ? void 0 : M.y, ee = ((X = K.arrow) == null ? void 0 : X.centerOffset) !== 0, [Re, xe] = g.useState();
|
|
13798
|
-
return
|
|
13797
|
+
return It(() => {
|
|
13799
13798
|
x && xe(window.getComputedStyle(x).zIndex);
|
|
13800
13799
|
}, [x]), /* @__PURE__ */ u.jsx(
|
|
13801
13800
|
"div",
|
|
@@ -13944,7 +13943,7 @@ var oC = g.forwardRef((e, t) => {
|
|
|
13944
13943
|
defaultProp: a ?? null,
|
|
13945
13944
|
onChange: l,
|
|
13946
13945
|
caller: Po
|
|
13947
|
-
}), [x, w] = g.useState(!1), b =
|
|
13946
|
+
}), [x, w] = g.useState(!1), b = jt(c), T = cp(n), C = g.useRef(!1), [S, k] = g.useState(0);
|
|
13948
13947
|
return g.useEffect(() => {
|
|
13949
13948
|
const A = p.current;
|
|
13950
13949
|
if (A)
|
|
@@ -14095,7 +14094,7 @@ var cC = dp, uC = pp, va = ["Enter", " "], dC = ["ArrowDown", "PageUp", "Home"],
|
|
|
14095
14094
|
ai,
|
|
14096
14095
|
up
|
|
14097
14096
|
]), li = ai(), xp = up(), [xC, Ir] = Er(Oo), [yC, Mo] = Er(Oo), yp = (e) => {
|
|
14098
|
-
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = li(t), [l, c] = g.useState(null), d = g.useRef(!1), f =
|
|
14097
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = li(t), [l, c] = g.useState(null), d = g.useRef(!1), f = jt(s), p = ni(o);
|
|
14099
14098
|
return g.useEffect(() => {
|
|
14100
14099
|
const h = () => {
|
|
14101
14100
|
d.current = !0, document.addEventListener("pointerdown", m, { capture: !0, once: !0 }), document.addEventListener("pointermove", m, { capture: !0, once: !0 });
|
|
@@ -14431,7 +14430,7 @@ var kp = "MenuRadioGroup", [IC, AC] = Er(
|
|
|
14431
14430
|
} }
|
|
14432
14431
|
), Rp = g.forwardRef(
|
|
14433
14432
|
(e, t) => {
|
|
14434
|
-
const { value: n, onValueChange: r, ...o } = e, s =
|
|
14433
|
+
const { value: n, onValueChange: r, ...o } = e, s = jt(r);
|
|
14435
14434
|
return /* @__PURE__ */ u.jsx(IC, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ u.jsx(Sl, { ...o, ref: t }) });
|
|
14436
14435
|
}
|
|
14437
14436
|
);
|
|
@@ -14999,7 +14998,7 @@ function Vi({
|
|
|
14999
14998
|
return typeof pe == "string" && pe.trim() ? pe : null;
|
|
15000
14999
|
},
|
|
15001
15000
|
[]
|
|
15002
|
-
),
|
|
15001
|
+
), Pt = lt(() => {
|
|
15003
15002
|
const F = Array.isArray(j) ? [...j] : [];
|
|
15004
15003
|
return F.some((pe) => cn(pe.metadata, "step") !== null) && F.sort((pe, Ee) => {
|
|
15005
15004
|
const nt = cn(pe.metadata, "step"), Ot = cn(Ee.metadata, "step");
|
|
@@ -15156,7 +15155,7 @@ function Vi({
|
|
|
15156
15155
|
Oe(!1), F.target.value = "", pt();
|
|
15157
15156
|
}
|
|
15158
15157
|
}
|
|
15159
|
-
},
|
|
15158
|
+
}, ue = (F) => {
|
|
15160
15159
|
if (!F) return "Unknown";
|
|
15161
15160
|
const de = Date.parse(F);
|
|
15162
15161
|
return Number.isNaN(de) ? F : new Date(de).toLocaleString();
|
|
@@ -15168,7 +15167,7 @@ function Vi({
|
|
|
15168
15167
|
await A();
|
|
15169
15168
|
return;
|
|
15170
15169
|
}
|
|
15171
|
-
const de =
|
|
15170
|
+
const de = Pt.find((Ee) => Ee.checkpointId === F), pe = (de == null ? void 0 : de.checkpointNs) ?? null;
|
|
15172
15171
|
await k(F, pe);
|
|
15173
15172
|
} finally {
|
|
15174
15173
|
Kt(!1);
|
|
@@ -15203,12 +15202,12 @@ function Vi({
|
|
|
15203
15202
|
},
|
|
15204
15203
|
children: [
|
|
15205
15204
|
/* @__PURE__ */ u.jsx("option", { value: "", children: "Latest" }),
|
|
15206
|
-
|
|
15205
|
+
Pt.map((F) => {
|
|
15207
15206
|
const de = cn(F.metadata, "step"), pe = Qt(F.metadata, "source"), Ee = [];
|
|
15208
15207
|
de !== null && Ee.push(`Step ${de}`), pe && Ee.push(pe);
|
|
15209
15208
|
const nt = Ee.length ? ` — ${Ee.join(" • ")}` : "";
|
|
15210
15209
|
return /* @__PURE__ */ u.jsxs("option", { value: F.checkpointId, children: [
|
|
15211
|
-
|
|
15210
|
+
ue(F.createdAt),
|
|
15212
15211
|
nt
|
|
15213
15212
|
] }, F.checkpointId);
|
|
15214
15213
|
})
|
|
@@ -15742,7 +15741,7 @@ var NT = g.forwardRef((e, t) => {
|
|
|
15742
15741
|
onWheelScroll: d,
|
|
15743
15742
|
onResize: f,
|
|
15744
15743
|
...p
|
|
15745
|
-
} = e, h = ln(zn, n), [m, v] = g.useState(null), y = Ve(t, (N) => v(N)), x = g.useRef(null), w = g.useRef(""), b = h.viewport, T = r.content - r.viewport, C =
|
|
15744
|
+
} = e, h = ln(zn, n), [m, v] = g.useState(null), y = Ve(t, (N) => v(N)), x = g.useRef(null), w = g.useRef(""), b = h.viewport, T = r.content - r.viewport, C = jt(d), S = jt(l), k = fi(f, 10);
|
|
15746
15745
|
function A(N) {
|
|
15747
15746
|
if (x.current) {
|
|
15748
15747
|
const j = N.clientX - x.current.left, $ = N.clientY - x.current.top;
|
|
@@ -15761,10 +15760,10 @@ var NT = g.forwardRef((e, t) => {
|
|
|
15761
15760
|
scope: n,
|
|
15762
15761
|
scrollbar: m,
|
|
15763
15762
|
hasThumb: o,
|
|
15764
|
-
onThumbChange:
|
|
15765
|
-
onThumbPointerUp:
|
|
15763
|
+
onThumbChange: jt(s),
|
|
15764
|
+
onThumbPointerUp: jt(i),
|
|
15766
15765
|
onThumbPositionChange: S,
|
|
15767
|
-
onThumbPointerDown:
|
|
15766
|
+
onThumbPointerDown: jt(a),
|
|
15768
15767
|
children: /* @__PURE__ */ u.jsx(
|
|
15769
15768
|
Ne.div,
|
|
15770
15769
|
{
|
|
@@ -15900,14 +15899,14 @@ var FT = (e, t = () => {
|
|
|
15900
15899
|
}(), () => window.cancelAnimationFrame(r);
|
|
15901
15900
|
};
|
|
15902
15901
|
function fi(e, t) {
|
|
15903
|
-
const n =
|
|
15902
|
+
const n = jt(e), r = g.useRef(0);
|
|
15904
15903
|
return g.useEffect(() => () => window.clearTimeout(r.current), []), g.useCallback(() => {
|
|
15905
15904
|
window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
|
|
15906
15905
|
}, [n, t]);
|
|
15907
15906
|
}
|
|
15908
15907
|
function Hr(e, t) {
|
|
15909
|
-
const n =
|
|
15910
|
-
|
|
15908
|
+
const n = jt(t);
|
|
15909
|
+
It(() => {
|
|
15911
15910
|
let r = 0;
|
|
15912
15911
|
if (e) {
|
|
15913
15912
|
const o = new ResizeObserver(() => {
|
|
@@ -16535,7 +16534,7 @@ zh.displayName = $h;
|
|
|
16535
16534
|
var Bh = "SelectValue", Hh = g.forwardRef(
|
|
16536
16535
|
(e, t) => {
|
|
16537
16536
|
const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, l = or(Bh, n), { onValueNodeHasChildrenChange: c } = l, d = s !== void 0, f = Ve(t, l.onValueNodeChange);
|
|
16538
|
-
return
|
|
16537
|
+
return It(() => {
|
|
16539
16538
|
c(d);
|
|
16540
16539
|
}, [c, d]), /* @__PURE__ */ u.jsx(
|
|
16541
16540
|
Ne.span,
|
|
@@ -16561,7 +16560,7 @@ Wh.displayName = lk;
|
|
|
16561
16560
|
var Cr = "SelectContent", Vh = g.forwardRef(
|
|
16562
16561
|
(e, t) => {
|
|
16563
16562
|
const n = or(Cr, e.__scopeSelect), [r, o] = g.useState();
|
|
16564
|
-
if (
|
|
16563
|
+
if (It(() => {
|
|
16565
16564
|
o(new DocumentFragment());
|
|
16566
16565
|
}, []), !n.open) {
|
|
16567
16566
|
const s = r;
|
|
@@ -16801,9 +16800,9 @@ var dk = "SelectItemAlignedPosition", Gh = g.forwardRef((e, t) => {
|
|
|
16801
16800
|
s.dir,
|
|
16802
16801
|
r
|
|
16803
16802
|
]);
|
|
16804
|
-
|
|
16803
|
+
It(() => b(), [b]);
|
|
16805
16804
|
const [T, C] = g.useState();
|
|
16806
|
-
|
|
16805
|
+
It(() => {
|
|
16807
16806
|
c && C(window.getComputedStyle(c).zIndex);
|
|
16808
16807
|
}, [c]);
|
|
16809
16808
|
const S = g.useCallback(
|
|
@@ -17044,7 +17043,7 @@ var so = "SelectItemText", tm = g.forwardRef(
|
|
|
17044
17043
|
() => /* @__PURE__ */ u.jsx("option", { value: l.value, disabled: l.disabled, children: h }, l.value),
|
|
17045
17044
|
[l.disabled, l.value, h]
|
|
17046
17045
|
), { onNativeOptionAdd: v, onNativeOptionRemove: y } = c;
|
|
17047
|
-
return
|
|
17046
|
+
return It(() => (v(m), () => y(m)), [v, y, m]), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
17048
17047
|
/* @__PURE__ */ u.jsx(Ne.span, { id: l.textId, ...s, ref: p }),
|
|
17049
17048
|
l.isSelected && i.valueNode && !i.valueNodeHasChildren ? Ms.createPortal(s.children, i.valueNode) : null
|
|
17050
17049
|
] });
|
|
@@ -17060,7 +17059,7 @@ var nm = "SelectItemIndicator", rm = g.forwardRef(
|
|
|
17060
17059
|
rm.displayName = nm;
|
|
17061
17060
|
var Ta = "SelectScrollUpButton", om = g.forwardRef((e, t) => {
|
|
17062
17061
|
const n = sr(Ta, e.__scopeSelect), r = Al(Ta, e.__scopeSelect), [o, s] = g.useState(!1), i = Ve(t, r.onScrollButtonChange);
|
|
17063
|
-
return
|
|
17062
|
+
return It(() => {
|
|
17064
17063
|
if (n.viewport && n.isPositioned) {
|
|
17065
17064
|
let a = function() {
|
|
17066
17065
|
const c = l.scrollTop > 0;
|
|
@@ -17084,7 +17083,7 @@ var Ta = "SelectScrollUpButton", om = g.forwardRef((e, t) => {
|
|
|
17084
17083
|
om.displayName = Ta;
|
|
17085
17084
|
var ka = "SelectScrollDownButton", sm = g.forwardRef((e, t) => {
|
|
17086
17085
|
const n = sr(ka, e.__scopeSelect), r = Al(ka, e.__scopeSelect), [o, s] = g.useState(!1), i = Ve(t, r.onScrollButtonChange);
|
|
17087
|
-
return
|
|
17086
|
+
return It(() => {
|
|
17088
17087
|
if (n.viewport && n.isPositioned) {
|
|
17089
17088
|
let a = function() {
|
|
17090
17089
|
const c = l.scrollHeight - l.clientHeight, d = Math.ceil(l.scrollTop) < c;
|
|
@@ -17110,7 +17109,7 @@ var im = g.forwardRef((e, t) => {
|
|
|
17110
17109
|
const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = sr("SelectScrollButton", n), i = g.useRef(null), a = mi(n), l = g.useCallback(() => {
|
|
17111
17110
|
i.current !== null && (window.clearInterval(i.current), i.current = null);
|
|
17112
17111
|
}, []);
|
|
17113
|
-
return g.useEffect(() => () => l(), [l]),
|
|
17112
|
+
return g.useEffect(() => () => l(), [l]), It(() => {
|
|
17114
17113
|
var d;
|
|
17115
17114
|
const c = a().find((f) => f.ref.current === document.activeElement);
|
|
17116
17115
|
(d = c == null ? void 0 : c.ref.current) == null || d.scrollIntoView({ block: "nearest" });
|
|
@@ -17177,7 +17176,7 @@ function cm(e) {
|
|
|
17177
17176
|
return e === "" || e === void 0;
|
|
17178
17177
|
}
|
|
17179
17178
|
function um(e) {
|
|
17180
|
-
const t =
|
|
17179
|
+
const t = jt(e), n = g.useRef(""), r = g.useRef(0), o = g.useCallback(
|
|
17181
17180
|
(i) => {
|
|
17182
17181
|
const a = n.current + i;
|
|
17183
17182
|
t(a), function l(c) {
|