teodor-new-chat-ui 4.3.431 → 4.3.432
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 +394 -392
- package/dist/index.umd.js +13 -13
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -270,14 +270,14 @@ function dx() {
|
|
|
270
270
|
var b = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
271
271
|
function w(I) {
|
|
272
272
|
{
|
|
273
|
-
for (var Z = arguments.length, de = new Array(Z > 1 ? Z - 1 : 0),
|
|
274
|
-
de[
|
|
273
|
+
for (var Z = arguments.length, de = new Array(Z > 1 ? Z - 1 : 0), ke = 1; ke < Z; ke++)
|
|
274
|
+
de[ke - 1] = arguments[ke];
|
|
275
275
|
y("error", I, de);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
function y(I, Z, de) {
|
|
279
279
|
{
|
|
280
|
-
var
|
|
280
|
+
var ke = b.ReactDebugCurrentFrame, Je = ke.getStackAddendum();
|
|
281
281
|
Je !== "" && (Z += "%s", de = de.concat([Je]));
|
|
282
282
|
var ot = de.map(function(se) {
|
|
283
283
|
return String(se);
|
|
@@ -295,9 +295,9 @@ function dx() {
|
|
|
295
295
|
I.$$typeof === P || I.getModuleId !== void 0));
|
|
296
296
|
}
|
|
297
297
|
function B(I, Z, de) {
|
|
298
|
-
var
|
|
299
|
-
if (
|
|
300
|
-
return
|
|
298
|
+
var ke = I.displayName;
|
|
299
|
+
if (ke)
|
|
300
|
+
return ke;
|
|
301
301
|
var Je = Z.displayName || Z.name || "";
|
|
302
302
|
return Je !== "" ? de + "(" + Je + ")" : de;
|
|
303
303
|
}
|
|
@@ -336,8 +336,8 @@ function dx() {
|
|
|
336
336
|
case l:
|
|
337
337
|
return B(I, I.render, "ForwardRef");
|
|
338
338
|
case p:
|
|
339
|
-
var
|
|
340
|
-
return
|
|
339
|
+
var ke = I.displayName || null;
|
|
340
|
+
return ke !== null ? ke : L(I.type) || "Memo";
|
|
341
341
|
case m: {
|
|
342
342
|
var Je = I, ot = Je._payload, se = Je._init;
|
|
343
343
|
try {
|
|
@@ -418,8 +418,8 @@ function dx() {
|
|
|
418
418
|
try {
|
|
419
419
|
throw Error();
|
|
420
420
|
} catch (Je) {
|
|
421
|
-
var
|
|
422
|
-
U =
|
|
421
|
+
var ke = Je.stack.trim().match(/\n( *(at )?)/);
|
|
422
|
+
U = ke && ke[1] || "";
|
|
423
423
|
}
|
|
424
424
|
return `
|
|
425
425
|
` + U + I;
|
|
@@ -438,7 +438,7 @@ function dx() {
|
|
|
438
438
|
if (de !== void 0)
|
|
439
439
|
return de;
|
|
440
440
|
}
|
|
441
|
-
var
|
|
441
|
+
var ke;
|
|
442
442
|
Y = !0;
|
|
443
443
|
var Je = Error.prepareStackTrace;
|
|
444
444
|
Error.prepareStackTrace = void 0;
|
|
@@ -457,14 +457,14 @@ function dx() {
|
|
|
457
457
|
try {
|
|
458
458
|
Reflect.construct(se, []);
|
|
459
459
|
} catch (Wt) {
|
|
460
|
-
|
|
460
|
+
ke = Wt;
|
|
461
461
|
}
|
|
462
462
|
Reflect.construct(I, [], se);
|
|
463
463
|
} else {
|
|
464
464
|
try {
|
|
465
465
|
se.call();
|
|
466
466
|
} catch (Wt) {
|
|
467
|
-
|
|
467
|
+
ke = Wt;
|
|
468
468
|
}
|
|
469
469
|
I.call(se.prototype);
|
|
470
470
|
}
|
|
@@ -472,21 +472,21 @@ function dx() {
|
|
|
472
472
|
try {
|
|
473
473
|
throw Error();
|
|
474
474
|
} catch (Wt) {
|
|
475
|
-
|
|
475
|
+
ke = Wt;
|
|
476
476
|
}
|
|
477
477
|
I();
|
|
478
478
|
}
|
|
479
479
|
} catch (Wt) {
|
|
480
|
-
if (Wt &&
|
|
480
|
+
if (Wt && ke && typeof Wt.stack == "string") {
|
|
481
481
|
for (var ue = Wt.stack.split(`
|
|
482
|
-
`),
|
|
483
|
-
`), Me = ue.length - 1, tt =
|
|
482
|
+
`), Re = ke.stack.split(`
|
|
483
|
+
`), Me = ue.length - 1, tt = Re.length - 1; Me >= 1 && tt >= 0 && ue[Me] !== Re[tt]; )
|
|
484
484
|
tt--;
|
|
485
485
|
for (; Me >= 1 && tt >= 0; Me--, tt--)
|
|
486
|
-
if (ue[Me] !==
|
|
486
|
+
if (ue[Me] !== Re[tt]) {
|
|
487
487
|
if (Me !== 1 || tt !== 1)
|
|
488
488
|
do
|
|
489
|
-
if (Me--, tt--, tt < 0 || ue[Me] !==
|
|
489
|
+
if (Me--, tt--, tt < 0 || ue[Me] !== Re[tt]) {
|
|
490
490
|
var xt = `
|
|
491
491
|
` + ue[Me].replace(" at new ", " at ");
|
|
492
492
|
return I.displayName && xt.includes("<anonymous>") && (xt = xt.replace("<anonymous>", I.displayName)), typeof I == "function" && J.set(I, xt), xt;
|
|
@@ -501,7 +501,7 @@ function dx() {
|
|
|
501
501
|
var xr = I ? I.displayName || I.name : "", qn = xr ? O(xr) : "";
|
|
502
502
|
return typeof I == "function" && J.set(I, qn), qn;
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function te(I, Z, de) {
|
|
505
505
|
return F(I, !1);
|
|
506
506
|
}
|
|
507
507
|
function ce(I) {
|
|
@@ -524,11 +524,11 @@ function dx() {
|
|
|
524
524
|
if (typeof I == "object")
|
|
525
525
|
switch (I.$$typeof) {
|
|
526
526
|
case l:
|
|
527
|
-
return
|
|
527
|
+
return te(I.render);
|
|
528
528
|
case p:
|
|
529
529
|
return ie(I.type, Z, de);
|
|
530
530
|
case m: {
|
|
531
|
-
var
|
|
531
|
+
var ke = I, Je = ke._payload, ot = ke._init;
|
|
532
532
|
try {
|
|
533
533
|
return ie(ot(Je), Z, de);
|
|
534
534
|
} catch {
|
|
@@ -537,7 +537,7 @@ function dx() {
|
|
|
537
537
|
}
|
|
538
538
|
return "";
|
|
539
539
|
}
|
|
540
|
-
var ge = Object.prototype.hasOwnProperty,
|
|
540
|
+
var ge = Object.prototype.hasOwnProperty, Te = {}, je = b.ReactDebugCurrentFrame;
|
|
541
541
|
function De(I) {
|
|
542
542
|
if (I) {
|
|
543
543
|
var Z = I._owner, de = ie(I.type, I._source, Z ? Z.type : null);
|
|
@@ -545,7 +545,7 @@ function dx() {
|
|
|
545
545
|
} else
|
|
546
546
|
je.setExtraStackFrame(null);
|
|
547
547
|
}
|
|
548
|
-
function He(I, Z, de,
|
|
548
|
+
function He(I, Z, de, ke, Je) {
|
|
549
549
|
{
|
|
550
550
|
var ot = Function.call.bind(ge);
|
|
551
551
|
for (var se in I)
|
|
@@ -553,14 +553,14 @@ function dx() {
|
|
|
553
553
|
var ue = void 0;
|
|
554
554
|
try {
|
|
555
555
|
if (typeof I[se] != "function") {
|
|
556
|
-
var
|
|
557
|
-
throw
|
|
556
|
+
var Re = Error((ke || "React class") + ": " + de + " type `" + se + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof I[se] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
557
|
+
throw Re.name = "Invariant Violation", Re;
|
|
558
558
|
}
|
|
559
|
-
ue = I[se](Z, se,
|
|
559
|
+
ue = I[se](Z, se, ke, de, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
560
560
|
} catch (Me) {
|
|
561
561
|
ue = Me;
|
|
562
562
|
}
|
|
563
|
-
ue && !(ue instanceof Error) && (De(Je), 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).",
|
|
563
|
+
ue && !(ue instanceof Error) && (De(Je), 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).", ke || "React class", de, se, typeof ue), De(null)), ue instanceof Error && !(ue.message in Te) && (Te[ue.message] = !0, De(Je), w("Failed %s type: %s", de, ue.message), De(null));
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
566
|
}
|
|
@@ -635,7 +635,7 @@ function dx() {
|
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
var Pt = function(I, Z, de,
|
|
638
|
+
var Pt = function(I, Z, de, ke, Je, ot, se) {
|
|
639
639
|
var ue = {
|
|
640
640
|
// This tag allows us to uniquely identify this as a React Element
|
|
641
641
|
$$typeof: t,
|
|
@@ -656,7 +656,7 @@ function dx() {
|
|
|
656
656
|
configurable: !1,
|
|
657
657
|
enumerable: !1,
|
|
658
658
|
writable: !1,
|
|
659
|
-
value:
|
|
659
|
+
value: ke
|
|
660
660
|
}), Object.defineProperty(ue, "_source", {
|
|
661
661
|
configurable: !1,
|
|
662
662
|
enumerable: !1,
|
|
@@ -664,10 +664,10 @@ function dx() {
|
|
|
664
664
|
value: Je
|
|
665
665
|
}), Object.freeze && (Object.freeze(ue.props), Object.freeze(ue)), ue;
|
|
666
666
|
};
|
|
667
|
-
function
|
|
667
|
+
function Ce(I, Z, de, ke, Je) {
|
|
668
668
|
{
|
|
669
|
-
var ot, se = {}, ue = null,
|
|
670
|
-
de !== void 0 && (Le(de), ue = "" + de), wt(Z) && (Le(Z.key), ue = "" + Z.key), _t(Z) && (
|
|
669
|
+
var ot, se = {}, ue = null, Re = null;
|
|
670
|
+
de !== void 0 && (Le(de), ue = "" + de), wt(Z) && (Le(Z.key), ue = "" + Z.key), _t(Z) && (Re = Z.ref, pt(Z, Je));
|
|
671
671
|
for (ot in Z)
|
|
672
672
|
ge.call(Z, ot) && !vt.hasOwnProperty(ot) && (se[ot] = Z[ot]);
|
|
673
673
|
if (I && I.defaultProps) {
|
|
@@ -675,24 +675,24 @@ function dx() {
|
|
|
675
675
|
for (ot in Me)
|
|
676
676
|
se[ot] === void 0 && (se[ot] = Me[ot]);
|
|
677
677
|
}
|
|
678
|
-
if (ue ||
|
|
678
|
+
if (ue || Re) {
|
|
679
679
|
var tt = typeof I == "function" ? I.displayName || I.name || "Unknown" : I;
|
|
680
|
-
ue && bt(se, tt),
|
|
680
|
+
ue && bt(se, tt), Re && kt(se, tt);
|
|
681
681
|
}
|
|
682
|
-
return Pt(I, ue,
|
|
682
|
+
return Pt(I, ue, Re, Je, ke, We.current, se);
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
|
-
var Ge = b.ReactCurrentOwner,
|
|
685
|
+
var Ge = b.ReactCurrentOwner, Ee = b.ReactDebugCurrentFrame;
|
|
686
686
|
function qe(I) {
|
|
687
687
|
if (I) {
|
|
688
688
|
var Z = I._owner, de = ie(I.type, I._source, Z ? Z.type : null);
|
|
689
|
-
|
|
689
|
+
Ee.setExtraStackFrame(de);
|
|
690
690
|
} else
|
|
691
|
-
|
|
691
|
+
Ee.setExtraStackFrame(null);
|
|
692
692
|
}
|
|
693
693
|
var zt;
|
|
694
694
|
zt = !1;
|
|
695
|
-
function
|
|
695
|
+
function ne(I) {
|
|
696
696
|
return typeof I == "object" && I !== null && I.$$typeof === t;
|
|
697
697
|
}
|
|
698
698
|
function we() {
|
|
@@ -732,8 +732,8 @@ Check the top-level render call using <` + de + ">.");
|
|
|
732
732
|
if (xe[de])
|
|
733
733
|
return;
|
|
734
734
|
xe[de] = !0;
|
|
735
|
-
var
|
|
736
|
-
I && I._owner && I._owner !== Ge.current && (
|
|
735
|
+
var ke = "";
|
|
736
|
+
I && I._owner && I._owner !== Ge.current && (ke = " It was passed a child from " + L(I._owner.type) + "."), qe(I), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', de, ke), qe(null);
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
function Rt(I, Z) {
|
|
@@ -742,16 +742,16 @@ Check the top-level render call using <` + de + ">.");
|
|
|
742
742
|
return;
|
|
743
743
|
if (Et(I))
|
|
744
744
|
for (var de = 0; de < I.length; de++) {
|
|
745
|
-
var
|
|
746
|
-
|
|
745
|
+
var ke = I[de];
|
|
746
|
+
ne(ke) && Xe(ke, Z);
|
|
747
747
|
}
|
|
748
|
-
else if (
|
|
748
|
+
else if (ne(I))
|
|
749
749
|
I._store && (I._store.validated = !0);
|
|
750
750
|
else if (I) {
|
|
751
751
|
var Je = x(I);
|
|
752
752
|
if (typeof Je == "function" && Je !== I.entries)
|
|
753
753
|
for (var ot = Je.call(I), se; !(se = ot.next()).done; )
|
|
754
|
-
|
|
754
|
+
ne(se.value) && Xe(se.value, Z);
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
}
|
|
@@ -770,8 +770,8 @@ Check the top-level render call using <` + de + ">.");
|
|
|
770
770
|
else
|
|
771
771
|
return;
|
|
772
772
|
if (de) {
|
|
773
|
-
var
|
|
774
|
-
He(de, I.props, "prop",
|
|
773
|
+
var ke = L(Z);
|
|
774
|
+
He(de, I.props, "prop", ke, I);
|
|
775
775
|
} else if (Z.PropTypes !== void 0 && !zt) {
|
|
776
776
|
zt = !0;
|
|
777
777
|
var Je = L(Z);
|
|
@@ -783,9 +783,9 @@ Check the top-level render call using <` + de + ">.");
|
|
|
783
783
|
function At(I) {
|
|
784
784
|
{
|
|
785
785
|
for (var Z = Object.keys(I.props), de = 0; de < Z.length; de++) {
|
|
786
|
-
var
|
|
787
|
-
if (
|
|
788
|
-
qe(I), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
786
|
+
var ke = Z[de];
|
|
787
|
+
if (ke !== "children" && ke !== "key") {
|
|
788
|
+
qe(I), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", ke), qe(null);
|
|
789
789
|
break;
|
|
790
790
|
}
|
|
791
791
|
}
|
|
@@ -793,24 +793,24 @@ Check the top-level render call using <` + de + ">.");
|
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
var Ot = {};
|
|
796
|
-
function Ae(I, Z, de,
|
|
796
|
+
function Ae(I, Z, de, ke, Je, ot) {
|
|
797
797
|
{
|
|
798
798
|
var se = D(I);
|
|
799
799
|
if (!se) {
|
|
800
800
|
var ue = "";
|
|
801
801
|
(I === void 0 || typeof I == "object" && I !== null && Object.keys(I).length === 0) && (ue += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
802
|
-
var
|
|
803
|
-
|
|
802
|
+
var Re = at();
|
|
803
|
+
Re ? ue += Re : ue += we();
|
|
804
804
|
var Me;
|
|
805
805
|
I === null ? Me = "null" : Et(I) ? Me = "array" : I !== void 0 && I.$$typeof === t ? (Me = "<" + (L(I.type) || "Unknown") + " />", ue = " Did you accidentally export a JSX literal instead of a component?") : Me = typeof I, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Me, ue);
|
|
806
806
|
}
|
|
807
|
-
var tt =
|
|
807
|
+
var tt = Ce(I, Z, de, Je, ot);
|
|
808
808
|
if (tt == null)
|
|
809
809
|
return tt;
|
|
810
810
|
if (se) {
|
|
811
811
|
var xt = Z.children;
|
|
812
812
|
if (xt !== void 0)
|
|
813
|
-
if (
|
|
813
|
+
if (ke)
|
|
814
814
|
if (Et(xt)) {
|
|
815
815
|
for (var xr = 0; xr < xt.length; xr++)
|
|
816
816
|
Rt(xt[xr], I);
|
|
@@ -3042,7 +3042,7 @@ function ew(e = {}) {
|
|
|
3042
3042
|
threadId: $.threadId ?? null,
|
|
3043
3043
|
headers: {}
|
|
3044
3044
|
}, (async () => {
|
|
3045
|
-
var X, re, U, O, Y, J, le, F,
|
|
3045
|
+
var X, re, U, O, Y, J, le, F, te, ce, ie, ge, Te, je, De, He, st, Et;
|
|
3046
3046
|
const q = (Ke) => {
|
|
3047
3047
|
var Ue;
|
|
3048
3048
|
try {
|
|
@@ -3062,13 +3062,13 @@ function ew(e = {}) {
|
|
|
3062
3062
|
Ke = { Authorization: `Bearer ${r}` };
|
|
3063
3063
|
else if (typeof window < "u") {
|
|
3064
3064
|
const qe = window.__AUTH_TOKEN__, zt = ((X = window.localStorage) == null ? void 0 : X.getItem("authToken")) || null;
|
|
3065
|
-
let
|
|
3065
|
+
let ne = null;
|
|
3066
3066
|
try {
|
|
3067
3067
|
const at = (re = window.localStorage) == null ? void 0 : re.getItem("chat-settings");
|
|
3068
|
-
at && (
|
|
3068
|
+
at && (ne = ((U = JSON.parse(at)) == null ? void 0 : U.apiKey) || null);
|
|
3069
3069
|
} catch {
|
|
3070
3070
|
}
|
|
3071
|
-
const we = qe || zt ||
|
|
3071
|
+
const we = qe || zt || ne || null;
|
|
3072
3072
|
we && (Ke = { Authorization: `Bearer ${we}` });
|
|
3073
3073
|
}
|
|
3074
3074
|
} catch {
|
|
@@ -3081,8 +3081,8 @@ function ew(e = {}) {
|
|
|
3081
3081
|
let Ue = {};
|
|
3082
3082
|
if (typeof window < "u")
|
|
3083
3083
|
try {
|
|
3084
|
-
const
|
|
3085
|
-
|
|
3084
|
+
const Ee = (O = window.localStorage) == null ? void 0 : O.getItem("authSessionId");
|
|
3085
|
+
Ee && (Ue = { "X-Session-Id": Ee });
|
|
3086
3086
|
} catch {
|
|
3087
3087
|
}
|
|
3088
3088
|
const Ye = {
|
|
@@ -3101,13 +3101,13 @@ function ew(e = {}) {
|
|
|
3101
3101
|
credentials: a
|
|
3102
3102
|
});
|
|
3103
3103
|
if (R.current && (R.current.headers = Ye), !We.ok || !We.body) {
|
|
3104
|
-
const
|
|
3104
|
+
const Ee = await We.text().catch(() => "");
|
|
3105
3105
|
console.debug(
|
|
3106
3106
|
"[use-chat] non-OK response",
|
|
3107
3107
|
We.status,
|
|
3108
|
-
|
|
3108
|
+
Ee == null ? void 0 : Ee.slice(0, 500)
|
|
3109
3109
|
);
|
|
3110
|
-
const qe = `stream ${We.status}${
|
|
3110
|
+
const qe = `stream ${We.status}${Ee ? ": " + Ee : ""}`;
|
|
3111
3111
|
throw (Y = k == null ? void 0 : k.onConnectionError) == null || Y.call(k, qe), _ = !0, G = "error", A = qe, new Error(qe);
|
|
3112
3112
|
}
|
|
3113
3113
|
w(!0);
|
|
@@ -3117,27 +3117,27 @@ function ew(e = {}) {
|
|
|
3117
3117
|
let wt = 0, pt = null;
|
|
3118
3118
|
const bt = () => {
|
|
3119
3119
|
if (_t.length) {
|
|
3120
|
-
const
|
|
3121
|
-
_t = [], T.current && m((qe) => qe +
|
|
3120
|
+
const Ee = _t.join("");
|
|
3121
|
+
_t = [], T.current && m((qe) => qe + Ee);
|
|
3122
3122
|
}
|
|
3123
3123
|
pt = null;
|
|
3124
3124
|
}, kt = () => {
|
|
3125
3125
|
typeof window < "u" && pt == null && (pt = requestAnimationFrame(bt));
|
|
3126
3126
|
};
|
|
3127
3127
|
let Pt = Date.now();
|
|
3128
|
-
const
|
|
3129
|
-
var
|
|
3128
|
+
const Ce = setInterval(() => {
|
|
3129
|
+
var Ee;
|
|
3130
3130
|
if (Date.now() - Pt > 18e5) {
|
|
3131
3131
|
const qe = "Stream idle timeout";
|
|
3132
|
-
d(qe), G = "error", A = qe, K.abort(), (
|
|
3132
|
+
d(qe), G = "error", A = qe, K.abort(), (Ee = k == null ? void 0 : k.onError) == null || Ee.call(k, qe);
|
|
3133
3133
|
}
|
|
3134
3134
|
}, 5e3), Ge = 1024 * 1024;
|
|
3135
3135
|
try {
|
|
3136
|
-
const
|
|
3136
|
+
const Ee = We.headers.get("X-Thread-Id") || We.headers.get("x-thread-id"), qe = We.headers.get("X-Thread-Created") || We.headers.get("x-thread-created"), zt = Ee ?? null, ne = String(qe ?? "").toLowerCase() === "true";
|
|
3137
3137
|
for (R.current && !R.current.threadId && (R.current = {
|
|
3138
3138
|
...R.current,
|
|
3139
3139
|
threadId: zt
|
|
3140
|
-
}), (J = k == null ? void 0 : k.onOpen) == null || J.call(k, { threadId: zt, created:
|
|
3140
|
+
}), (J = k == null ? void 0 : k.onOpen) == null || J.call(k, { threadId: zt, created: ne }); ; ) {
|
|
3141
3141
|
const { value: we, done: at } = await vt.read();
|
|
3142
3142
|
if (at) break;
|
|
3143
3143
|
ut += Mt.decode(we, { stream: !0 }), ut.length > Ge && (ut = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
@@ -3238,10 +3238,10 @@ function ew(e = {}) {
|
|
|
3238
3238
|
v(Ae.checkpointId);
|
|
3239
3239
|
else if (Ae.type === "error") {
|
|
3240
3240
|
const et = Ae;
|
|
3241
|
-
if (d(et.message), G = "error", A = et.message, et.error_type === "auth_error" || et.code === "TOKEN_EXPIRED" || ((
|
|
3241
|
+
if (d(et.message), G = "error", A = et.message, et.error_type === "auth_error" || et.code === "TOKEN_EXPIRED" || ((te = et.message) == null ? void 0 : te.includes("token")) || ((ce = et.message) == null ? void 0 : ce.includes("401")) || ((ie = et.message) == null ? void 0 : ie.includes("unauthorized")) || ((ge = et.message) == null ? void 0 : ge.includes("Unauthorized"))) {
|
|
3242
3242
|
console.error("[use-chat] Auth error detected:", et.message);
|
|
3243
3243
|
try {
|
|
3244
|
-
(
|
|
3244
|
+
(Te = k == null ? void 0 : k.onAuthError) == null || Te.call(k, et.message);
|
|
3245
3245
|
} catch (nn) {
|
|
3246
3246
|
console.warn("[use-chat] onAuthError handler failed", nn);
|
|
3247
3247
|
}
|
|
@@ -3251,11 +3251,11 @@ function ew(e = {}) {
|
|
|
3251
3251
|
}
|
|
3252
3252
|
}
|
|
3253
3253
|
bt(), G === null && !K.signal.aborted && (G = "complete");
|
|
3254
|
-
} catch (
|
|
3255
|
-
if (
|
|
3254
|
+
} catch (Ee) {
|
|
3255
|
+
if (Ee.name === "AbortError")
|
|
3256
3256
|
G = G ?? "aborted";
|
|
3257
3257
|
else {
|
|
3258
|
-
const qe =
|
|
3258
|
+
const qe = Ee.message || String(Ee);
|
|
3259
3259
|
G = "error", A = qe, d(qe), (je = k == null ? void 0 : k.onError) == null || je.call(k, qe);
|
|
3260
3260
|
}
|
|
3261
3261
|
} finally {
|
|
@@ -3265,7 +3265,7 @@ function ew(e = {}) {
|
|
|
3265
3265
|
} finally {
|
|
3266
3266
|
(De = vt.releaseLock) == null || De.call(vt);
|
|
3267
3267
|
}
|
|
3268
|
-
pt !== null && typeof window < "u" && window.cancelAnimationFrame(pt), clearInterval(
|
|
3268
|
+
pt !== null && typeof window < "u" && window.cancelAnimationFrame(pt), clearInterval(Ce);
|
|
3269
3269
|
}
|
|
3270
3270
|
} catch (Ke) {
|
|
3271
3271
|
if (Ke.name === "AbortError")
|
|
@@ -4060,14 +4060,14 @@ function yw({
|
|
|
4060
4060
|
async (F) => {
|
|
4061
4061
|
var ce, ie;
|
|
4062
4062
|
if (!F.threadId) return;
|
|
4063
|
-
const
|
|
4063
|
+
const te = F.threadId;
|
|
4064
4064
|
(ce = F.onStart) == null || ce.call(F), F.setLoading(!0);
|
|
4065
4065
|
try {
|
|
4066
|
-
await F.action(
|
|
4066
|
+
await F.action(te);
|
|
4067
4067
|
} catch (ge) {
|
|
4068
|
-
if (L.current ===
|
|
4069
|
-
const
|
|
4070
|
-
(ie = F.handleError) == null || ie.call(F,
|
|
4068
|
+
if (L.current === te) {
|
|
4069
|
+
const Te = String(ge);
|
|
4070
|
+
(ie = F.handleError) == null || ie.call(F, Te), r == null || r(Te);
|
|
4071
4071
|
}
|
|
4072
4072
|
throw ge;
|
|
4073
4073
|
} finally {
|
|
@@ -4076,28 +4076,28 @@ function yw({
|
|
|
4076
4076
|
},
|
|
4077
4077
|
[r]
|
|
4078
4078
|
), A = me(
|
|
4079
|
-
async (F,
|
|
4079
|
+
async (F, te) => {
|
|
4080
4080
|
if (!F) return;
|
|
4081
|
-
const ce = `${F}:${
|
|
4081
|
+
const ce = `${F}:${te ?? "latest"}`, ie = K.current.get(ce);
|
|
4082
4082
|
if (ie)
|
|
4083
4083
|
return ie;
|
|
4084
4084
|
const ge = G({
|
|
4085
4085
|
threadId: F,
|
|
4086
4086
|
setLoading: T,
|
|
4087
4087
|
onStart: () => z(null),
|
|
4088
|
-
handleError: (
|
|
4089
|
-
action: async (
|
|
4088
|
+
handleError: (Te) => z(Te),
|
|
4089
|
+
action: async (Te) => {
|
|
4090
4090
|
const je = await e.getStateHistory({
|
|
4091
|
-
threadId:
|
|
4092
|
-
checkpointId:
|
|
4091
|
+
threadId: Te,
|
|
4092
|
+
checkpointId: te ?? void 0
|
|
4093
4093
|
});
|
|
4094
|
-
if (L.current !==
|
|
4094
|
+
if (L.current !== Te) {
|
|
4095
4095
|
console.log(
|
|
4096
|
-
`[useThreadHistoryState] Thread changed during load (was ${
|
|
4096
|
+
`[useThreadHistoryState] Thread changed during load (was ${Te}, now ${L.current}), discarding stale data`
|
|
4097
4097
|
);
|
|
4098
4098
|
return;
|
|
4099
4099
|
}
|
|
4100
|
-
const { checkpoints: De } = Yn(je), He = De.find((st) => st.messages && st.messages.length > 0) ?? (
|
|
4100
|
+
const { checkpoints: De } = Yn(je), He = De.find((st) => st.messages && st.messages.length > 0) ?? (te ? De.find((st) => st.checkpointId === te) : null) ?? De[0];
|
|
4101
4101
|
t((He == null ? void 0 : He.messages) ?? [], {
|
|
4102
4102
|
checkpointId: (He == null ? void 0 : He.checkpointId) ?? null,
|
|
4103
4103
|
checkpointNs: (He == null ? void 0 : He.checkpointNs) ?? null
|
|
@@ -4114,10 +4114,10 @@ function yw({
|
|
|
4114
4114
|
},
|
|
4115
4115
|
[e, t, G]
|
|
4116
4116
|
), _ = me(
|
|
4117
|
-
async (F,
|
|
4117
|
+
async (F, te) => {
|
|
4118
4118
|
$.current = F;
|
|
4119
4119
|
try {
|
|
4120
|
-
await A(F,
|
|
4120
|
+
await A(F, te);
|
|
4121
4121
|
} finally {
|
|
4122
4122
|
$.current === F && ($.current = null);
|
|
4123
4123
|
}
|
|
@@ -4129,21 +4129,21 @@ function yw({
|
|
|
4129
4129
|
W.current = F;
|
|
4130
4130
|
}, []), re = me(
|
|
4131
4131
|
(F) => {
|
|
4132
|
-
const
|
|
4133
|
-
if (!
|
|
4132
|
+
const te = F.threadId ?? L.current;
|
|
4133
|
+
if (!te || L.current && L.current !== te)
|
|
4134
4134
|
return;
|
|
4135
4135
|
const { checkpoints: ce } = Yn(F);
|
|
4136
4136
|
if (!ce.length)
|
|
4137
4137
|
return;
|
|
4138
|
-
const ie = ce.find((
|
|
4139
|
-
t((ie == null ? void 0 : ie.messages) ?? [], {
|
|
4138
|
+
const ie = ce.find((Te) => Te.messages && Te.messages.length > 0) ?? ce.find((Te) => !!Te.checkpointId) ?? ce[0], ge = W.current === te;
|
|
4139
|
+
!c && !ge && t((ie == null ? void 0 : ie.messages) ?? [], {
|
|
4140
4140
|
checkpointId: (ie == null ? void 0 : ie.checkpointId) ?? null,
|
|
4141
4141
|
checkpointNs: (ie == null ? void 0 : ie.checkpointNs) ?? null
|
|
4142
|
-
}), m(F), w(!!(ie != null && ie.nextCursor)), C((ie == null ? void 0 : ie.nextCursor) ?? null), k.current = `${
|
|
4142
|
+
}), m(F), w(!!(ie != null && ie.nextCursor)), C((ie == null ? void 0 : ie.nextCursor) ?? null), k.current = `${te}:latest`, V.current = null, W.current === te && (W.current = null);
|
|
4143
4143
|
},
|
|
4144
|
-
[t]
|
|
4144
|
+
[t, c]
|
|
4145
4145
|
), U = me(
|
|
4146
|
-
async (F,
|
|
4146
|
+
async (F, te) => {
|
|
4147
4147
|
const ce = L.current;
|
|
4148
4148
|
await G({
|
|
4149
4149
|
threadId: ce,
|
|
@@ -4152,7 +4152,7 @@ function yw({
|
|
|
4152
4152
|
const ge = await e.getStateHistory({
|
|
4153
4153
|
threadId: ie,
|
|
4154
4154
|
checkpointId: F,
|
|
4155
|
-
checkpointNs:
|
|
4155
|
+
checkpointNs: te ?? void 0
|
|
4156
4156
|
});
|
|
4157
4157
|
if (L.current !== ie) {
|
|
4158
4158
|
console.log(
|
|
@@ -4160,11 +4160,11 @@ function yw({
|
|
|
4160
4160
|
);
|
|
4161
4161
|
return;
|
|
4162
4162
|
}
|
|
4163
|
-
const { checkpoints:
|
|
4164
|
-
(De) => De.checkpointId === F && (
|
|
4163
|
+
const { checkpoints: Te } = Yn(ge), je = Te.find(
|
|
4164
|
+
(De) => De.checkpointId === F && (te ? De.checkpointNs === te : !0)
|
|
4165
4165
|
);
|
|
4166
4166
|
if (!je) {
|
|
4167
|
-
console.warn("[useThreadHistoryState] Requested checkpoint not found:", { checkpointId: F, checkpointNs:
|
|
4167
|
+
console.warn("[useThreadHistoryState] Requested checkpoint not found:", { checkpointId: F, checkpointNs: te });
|
|
4168
4168
|
return;
|
|
4169
4169
|
}
|
|
4170
4170
|
m(ge), t(je.messages ?? [], {
|
|
@@ -4177,10 +4177,10 @@ function yw({
|
|
|
4177
4177
|
},
|
|
4178
4178
|
[e, t, G]
|
|
4179
4179
|
), O = me(
|
|
4180
|
-
(F,
|
|
4180
|
+
(F, te) => {
|
|
4181
4181
|
t(d(), {
|
|
4182
4182
|
checkpointId: F ?? null,
|
|
4183
|
-
checkpointNs:
|
|
4183
|
+
checkpointNs: te ?? null
|
|
4184
4184
|
});
|
|
4185
4185
|
},
|
|
4186
4186
|
[d, t]
|
|
@@ -4191,12 +4191,12 @@ function yw({
|
|
|
4191
4191
|
!F || !y || await G({
|
|
4192
4192
|
threadId: F,
|
|
4193
4193
|
setLoading: R,
|
|
4194
|
-
action: async (
|
|
4194
|
+
action: async (te) => {
|
|
4195
4195
|
const ce = await e.getStateHistory({
|
|
4196
|
-
threadId:
|
|
4196
|
+
threadId: te,
|
|
4197
4197
|
checkpointId: y
|
|
4198
4198
|
});
|
|
4199
|
-
if (L.current !==
|
|
4199
|
+
if (L.current !== te)
|
|
4200
4200
|
return;
|
|
4201
4201
|
const { checkpoints: ie } = Yn(ce);
|
|
4202
4202
|
if (ie.length > 0) {
|
|
@@ -4226,14 +4226,14 @@ function yw({
|
|
|
4226
4226
|
return;
|
|
4227
4227
|
N.current = o;
|
|
4228
4228
|
const F = !j.current && !!a && o === s;
|
|
4229
|
-
let
|
|
4230
|
-
F && a ? (
|
|
4229
|
+
let te;
|
|
4230
|
+
F && a ? (te = a, j.current = !0, console.log(
|
|
4231
4231
|
"[useThreadHistoryState] Loading thread with checkpoint:",
|
|
4232
|
-
|
|
4232
|
+
te,
|
|
4233
4233
|
i ? `(ns: ${i})` : ""
|
|
4234
4234
|
)) : console.log("[useThreadHistoryState] Loading thread with latest checkpoint");
|
|
4235
|
-
const ce = `${o}:${
|
|
4236
|
-
k.current !== ce && _(o,
|
|
4235
|
+
const ce = `${o}:${te ?? "latest"}`;
|
|
4236
|
+
k.current !== ce && _(o, te);
|
|
4237
4237
|
}, [
|
|
4238
4238
|
l,
|
|
4239
4239
|
o,
|
|
@@ -4584,24 +4584,24 @@ function Iw({
|
|
|
4584
4584
|
content: O,
|
|
4585
4585
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4586
4586
|
}, J ? S(F, Y) : S(F));
|
|
4587
|
-
const
|
|
4587
|
+
const te = X ? q : F ? [F] : [], ce = {
|
|
4588
4588
|
..._,
|
|
4589
4589
|
...U.length ? { files_info: U } : {}
|
|
4590
4590
|
};
|
|
4591
|
-
|
|
4591
|
+
te.length ? ce.messages = te : "messages" in ce || (ce.messages = []);
|
|
4592
4592
|
let ie = (j == null ? void 0 : j.checkpointId) ?? g.id ?? void 0, ge = (j == null ? void 0 : j.checkpointNs) ?? g.namespace ?? void 0;
|
|
4593
4593
|
if (J && Y) {
|
|
4594
4594
|
const je = kw(x, Y);
|
|
4595
4595
|
ie = je.checkpointId, ge = je.checkpointNs ?? void 0;
|
|
4596
4596
|
}
|
|
4597
|
-
const
|
|
4597
|
+
const Te = {
|
|
4598
4598
|
threadId: k,
|
|
4599
4599
|
payload: ce,
|
|
4600
4600
|
checkpointId: ie,
|
|
4601
4601
|
checkpointNs: ge,
|
|
4602
4602
|
edit: !!(j != null && j.edit)
|
|
4603
4603
|
};
|
|
4604
|
-
B(
|
|
4604
|
+
B(Te);
|
|
4605
4605
|
},
|
|
4606
4606
|
[g, f, w, S, B, x]
|
|
4607
4607
|
), W = Ze(
|
|
@@ -6719,7 +6719,7 @@ var Gi = "PopperContent", [Sy, Ty] = Ud(Gi), Gd = h.forwardRef(
|
|
|
6719
6719
|
updatePositionStrategy: f = "optimized",
|
|
6720
6720
|
onPlaced: v,
|
|
6721
6721
|
...g
|
|
6722
|
-
} = e, x = Wd(Gi, n), [b, w] = h.useState(null), y = ze(t, (
|
|
6722
|
+
} = e, x = Wd(Gi, n), [b, w] = h.useState(null), y = ze(t, (te) => w(te)), [C, S] = h.useState(null), T = Hd(C), E = (T == null ? void 0 : T.width) ?? 0, R = (T == null ? void 0 : T.height) ?? 0, P = r + (s !== "center" ? "-" + s : ""), D = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, B = Array.isArray(c) ? c : [c], z = B.length > 0, L = {
|
|
6723
6723
|
padding: D,
|
|
6724
6724
|
boundary: B.filter(Ey),
|
|
6725
6725
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
@@ -6728,7 +6728,7 @@ var Gi = "PopperContent", [Sy, Ty] = Ud(Gi), Gd = h.forwardRef(
|
|
|
6728
6728
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
6729
6729
|
strategy: "fixed",
|
|
6730
6730
|
placement: P,
|
|
6731
|
-
whileElementsMounted: (...
|
|
6731
|
+
whileElementsMounted: (...te) => ey(...te, {
|
|
6732
6732
|
animationFrame: f === "always"
|
|
6733
6733
|
}),
|
|
6734
6734
|
elements: {
|
|
@@ -6745,9 +6745,9 @@ var Gi = "PopperContent", [Sy, Ty] = Ud(Gi), Gd = h.forwardRef(
|
|
|
6745
6745
|
l && my({ ...L }),
|
|
6746
6746
|
gy({
|
|
6747
6747
|
...L,
|
|
6748
|
-
apply: ({ elements:
|
|
6749
|
-
const { width:
|
|
6750
|
-
De.setProperty("--radix-popper-available-width", `${ie}px`), De.setProperty("--radix-popper-available-height", `${ge}px`), De.setProperty("--radix-popper-anchor-width", `${
|
|
6748
|
+
apply: ({ elements: te, rects: ce, availableWidth: ie, availableHeight: ge }) => {
|
|
6749
|
+
const { width: Te, height: je } = ce.reference, De = te.floating.style;
|
|
6750
|
+
De.setProperty("--radix-popper-available-width", `${ie}px`), De.setProperty("--radix-popper-available-height", `${ge}px`), De.setProperty("--radix-popper-anchor-width", `${Te}px`), De.setProperty("--radix-popper-anchor-height", `${je}px`);
|
|
6751
6751
|
}
|
|
6752
6752
|
}),
|
|
6753
6753
|
C && vy({ element: C, padding: i }),
|
|
@@ -8718,7 +8718,7 @@ function dt(e = cp) {
|
|
|
8718
8718
|
e(t, r) || (t = r, n(r));
|
|
8719
8719
|
};
|
|
8720
8720
|
}
|
|
8721
|
-
function
|
|
8721
|
+
function Ne(e) {
|
|
8722
8722
|
return (t) => (n) => {
|
|
8723
8723
|
e(n) && t(n);
|
|
8724
8724
|
};
|
|
@@ -8876,7 +8876,7 @@ function Ct(...e) {
|
|
|
8876
8876
|
}
|
|
8877
8877
|
};
|
|
8878
8878
|
}
|
|
8879
|
-
function
|
|
8879
|
+
function Ie(e, t = cp) {
|
|
8880
8880
|
return Q(e, dt(t));
|
|
8881
8881
|
}
|
|
8882
8882
|
function ii(...e) {
|
|
@@ -9391,7 +9391,7 @@ const mT = {
|
|
|
9391
9391
|
be(
|
|
9392
9392
|
Q(
|
|
9393
9393
|
l,
|
|
9394
|
-
|
|
9394
|
+
Ne((S) => S.length > 0),
|
|
9395
9395
|
Be(g, f),
|
|
9396
9396
|
pe(([S, T, E]) => {
|
|
9397
9397
|
const R = S.reduce((P, D, B) => Qt(P, D, fo(D, T.offsetTree, E) || B), kr());
|
|
@@ -9407,7 +9407,7 @@ const mT = {
|
|
|
9407
9407
|
Q(
|
|
9408
9408
|
r,
|
|
9409
9409
|
Be(g),
|
|
9410
|
-
|
|
9410
|
+
Ne(([S, { lastIndex: T }]) => S < T),
|
|
9411
9411
|
pe(([S, { lastIndex: T, lastSize: E }]) => [
|
|
9412
9412
|
{
|
|
9413
9413
|
endIndex: T,
|
|
@@ -9428,7 +9428,7 @@ const mT = {
|
|
|
9428
9428
|
be(
|
|
9429
9429
|
Q(
|
|
9430
9430
|
d,
|
|
9431
|
-
|
|
9431
|
+
Ne((S) => S !== void 0 && lt(yt(g).sizeTree)),
|
|
9432
9432
|
pe((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
|
|
9433
9433
|
),
|
|
9434
9434
|
n
|
|
@@ -9634,7 +9634,7 @@ const bp = Qe(
|
|
|
9634
9634
|
), be(
|
|
9635
9635
|
Q(
|
|
9636
9636
|
Ct(o, t, r),
|
|
9637
|
-
|
|
9637
|
+
Ne(([l, c]) => Zs(c)),
|
|
9638
9638
|
pe(([l, c, d]) => mn(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
|
|
9639
9639
|
dt(),
|
|
9640
9640
|
pe((l) => [l])
|
|
@@ -9648,7 +9648,7 @@ const bp = Qe(
|
|
|
9648
9648
|
const t = oe(!1), n = tn(
|
|
9649
9649
|
Q(
|
|
9650
9650
|
t,
|
|
9651
|
-
|
|
9651
|
+
Ne((r) => r),
|
|
9652
9652
|
dt()
|
|
9653
9653
|
)
|
|
9654
9654
|
);
|
|
@@ -9752,7 +9752,7 @@ const Ao = Qe(
|
|
|
9752
9752
|
Q(
|
|
9753
9753
|
a,
|
|
9754
9754
|
Be(l),
|
|
9755
|
-
|
|
9755
|
+
Ne(([d, p]) => !!p),
|
|
9756
9756
|
bn(!1)
|
|
9757
9757
|
),
|
|
9758
9758
|
i
|
|
@@ -9760,7 +9760,7 @@ const Ao = Qe(
|
|
|
9760
9760
|
Q(
|
|
9761
9761
|
a,
|
|
9762
9762
|
Be(l),
|
|
9763
|
-
|
|
9763
|
+
Ne(([d, p]) => !!p),
|
|
9764
9764
|
bn(!1)
|
|
9765
9765
|
),
|
|
9766
9766
|
c
|
|
@@ -9768,7 +9768,7 @@ const Ao = Qe(
|
|
|
9768
9768
|
Q(
|
|
9769
9769
|
Ct(t, a),
|
|
9770
9770
|
Be(i, n, e, c),
|
|
9771
|
-
|
|
9771
|
+
Ne(([[, d], p, { sizeTree: m }, f, v]) => d && (!lt(m) || cl(f)) && !p && !v),
|
|
9772
9772
|
Be(l)
|
|
9773
9773
|
),
|
|
9774
9774
|
([, d]) => {
|
|
@@ -9804,7 +9804,7 @@ const po = "up", Zr = "down", wT = "none", bT = {
|
|
|
9804
9804
|
}, yT = 0, jo = Qe(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
9805
9805
|
const a = oe(!1), i = oe(!0), l = Ve(), c = Ve(), d = oe(4), p = oe(yT), m = Ft(
|
|
9806
9806
|
Q(
|
|
9807
|
-
ii(Q(
|
|
9807
|
+
ii(Q(Ie(o), ir(1), bn(!0)), Q(Ie(o), ir(1), bn(!1), Qc(100))),
|
|
9808
9808
|
dt()
|
|
9809
9809
|
),
|
|
9810
9810
|
!1
|
|
@@ -9814,7 +9814,7 @@ const po = "up", Zr = "down", wT = "none", bT = {
|
|
|
9814
9814
|
);
|
|
9815
9815
|
be(
|
|
9816
9816
|
Q(
|
|
9817
|
-
Ct(
|
|
9817
|
+
Ct(Ie(o), Ie(p)),
|
|
9818
9818
|
pe(([w, y]) => w <= y),
|
|
9819
9819
|
dt()
|
|
9820
9820
|
),
|
|
@@ -9822,7 +9822,7 @@ const po = "up", Zr = "down", wT = "none", bT = {
|
|
|
9822
9822
|
), be(Q(i, Nn(50)), c);
|
|
9823
9823
|
const v = tn(
|
|
9824
9824
|
Q(
|
|
9825
|
-
Ct(r,
|
|
9825
|
+
Ct(r, Ie(s), Ie(t), Ie(e), Ie(d)),
|
|
9826
9826
|
Tn((w, [{ scrollHeight: y, scrollTop: C }, S, T, E, R]) => {
|
|
9827
9827
|
const P = C + S - y > -R, D = {
|
|
9828
9828
|
scrollHeight: y,
|
|
@@ -9876,7 +9876,7 @@ const po = "up", Zr = "down", wT = "none", bT = {
|
|
|
9876
9876
|
},
|
|
9877
9877
|
{ changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
|
|
9878
9878
|
),
|
|
9879
|
-
|
|
9879
|
+
Ne((w) => w.changed),
|
|
9880
9880
|
pe((w) => w.jump)
|
|
9881
9881
|
),
|
|
9882
9882
|
0
|
|
@@ -9906,7 +9906,7 @@ const po = "up", Zr = "down", wT = "none", bT = {
|
|
|
9906
9906
|
return be(
|
|
9907
9907
|
Q(
|
|
9908
9908
|
m,
|
|
9909
|
-
|
|
9909
|
+
Ne((w) => !w),
|
|
9910
9910
|
bn(0)
|
|
9911
9911
|
),
|
|
9912
9912
|
b
|
|
@@ -9915,7 +9915,7 @@ const po = "up", Zr = "down", wT = "none", bT = {
|
|
|
9915
9915
|
o,
|
|
9916
9916
|
Nn(100),
|
|
9917
9917
|
Be(m),
|
|
9918
|
-
|
|
9918
|
+
Ne(([w, y]) => !!y),
|
|
9919
9919
|
Tn(([w, y], [C]) => [y, C], [0, 0]),
|
|
9920
9920
|
pe(([w, y]) => y - w)
|
|
9921
9921
|
),
|
|
@@ -9946,15 +9946,15 @@ const gl = Qe(
|
|
|
9946
9946
|
const s = Ve(), a = oe(0), i = oe(0), l = oe(0), c = Ft(
|
|
9947
9947
|
Q(
|
|
9948
9948
|
Ct(
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9949
|
+
Ie(r),
|
|
9950
|
+
Ie(o),
|
|
9951
|
+
Ie(n),
|
|
9952
|
+
Ie(s, uo),
|
|
9953
|
+
Ie(l),
|
|
9954
|
+
Ie(a),
|
|
9955
|
+
Ie(t),
|
|
9956
|
+
Ie(e),
|
|
9957
|
+
Ie(i)
|
|
9958
9958
|
),
|
|
9959
9959
|
pe(
|
|
9960
9960
|
([
|
|
@@ -9977,7 +9977,7 @@ const gl = Qe(
|
|
|
9977
9977
|
] : null;
|
|
9978
9978
|
}
|
|
9979
9979
|
),
|
|
9980
|
-
|
|
9980
|
+
Ne((d) => d != null),
|
|
9981
9981
|
dt(uo)
|
|
9982
9982
|
),
|
|
9983
9983
|
[0, 0]
|
|
@@ -10097,17 +10097,17 @@ const mr = Qe(
|
|
|
10097
10097
|
Ct(
|
|
10098
10098
|
f,
|
|
10099
10099
|
v,
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10100
|
+
Ie(l, uo),
|
|
10101
|
+
Ie(o),
|
|
10102
|
+
Ie(r),
|
|
10103
|
+
Ie(c),
|
|
10104
10104
|
d,
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10105
|
+
Ie(g),
|
|
10106
|
+
Ie(t),
|
|
10107
|
+
Ie(n),
|
|
10108
10108
|
e
|
|
10109
10109
|
),
|
|
10110
|
-
|
|
10110
|
+
Ne(([T, E, , R, , , , , , , P]) => {
|
|
10111
10111
|
const D = P && P.length !== R;
|
|
10112
10112
|
return T && !E && !D;
|
|
10113
10113
|
}),
|
|
@@ -10174,7 +10174,7 @@ const mr = Qe(
|
|
|
10174
10174
|
}
|
|
10175
10175
|
),
|
|
10176
10176
|
//@ts-expect-error filter needs to be fixed
|
|
10177
|
-
|
|
10177
|
+
Ne((T) => T !== null),
|
|
10178
10178
|
dt()
|
|
10179
10179
|
),
|
|
10180
10180
|
Ma
|
|
@@ -10182,7 +10182,7 @@ const mr = Qe(
|
|
|
10182
10182
|
be(
|
|
10183
10183
|
Q(
|
|
10184
10184
|
e,
|
|
10185
|
-
|
|
10185
|
+
Ne(cl),
|
|
10186
10186
|
pe((T) => T == null ? void 0 : T.length)
|
|
10187
10187
|
),
|
|
10188
10188
|
o
|
|
@@ -10208,9 +10208,9 @@ const mr = Qe(
|
|
|
10208
10208
|
const y = tn(
|
|
10209
10209
|
Q(
|
|
10210
10210
|
w,
|
|
10211
|
-
|
|
10211
|
+
Ne(({ items: T }) => T.length > 0),
|
|
10212
10212
|
Be(o, e),
|
|
10213
|
-
|
|
10213
|
+
Ne(([{ items: T }, E]) => T[T.length - 1].originalIndex === E - 1),
|
|
10214
10214
|
pe(([, T, E]) => [T - 1, E]),
|
|
10215
10215
|
dt(uo),
|
|
10216
10216
|
pe(([T]) => T)
|
|
@@ -10219,14 +10219,14 @@ const mr = Qe(
|
|
|
10219
10219
|
Q(
|
|
10220
10220
|
w,
|
|
10221
10221
|
Nn(200),
|
|
10222
|
-
|
|
10222
|
+
Ne(({ items: T, topItems: E }) => T.length > 0 && T[0].originalIndex === E.length),
|
|
10223
10223
|
pe(({ items: T }) => T[0].index),
|
|
10224
10224
|
dt()
|
|
10225
10225
|
)
|
|
10226
10226
|
), S = tn(
|
|
10227
10227
|
Q(
|
|
10228
10228
|
w,
|
|
10229
|
-
|
|
10229
|
+
Ne(({ items: T }) => T.length > 0),
|
|
10230
10230
|
pe(({ items: T }) => {
|
|
10231
10231
|
let E = 0, R = T.length - 1;
|
|
10232
10232
|
for (; T[E].type === "group" && E < R; )
|
|
@@ -10263,7 +10263,7 @@ const mr = Qe(
|
|
|
10263
10263
|
),
|
|
10264
10264
|
0
|
|
10265
10265
|
);
|
|
10266
|
-
return be(
|
|
10266
|
+
return be(Ie(a), s), { totalListHeight: a, totalListHeightChanged: s };
|
|
10267
10267
|
},
|
|
10268
10268
|
ft(Ut, mr),
|
|
10269
10269
|
{ singleton: !0 }
|
|
@@ -10272,7 +10272,7 @@ const mr = Qe(
|
|
|
10272
10272
|
const n = oe(!1), r = Ft(
|
|
10273
10273
|
Q(
|
|
10274
10274
|
Ct(n, e, t),
|
|
10275
|
-
|
|
10275
|
+
Ne(([o]) => o),
|
|
10276
10276
|
pe(([, o, s]) => Math.max(0, o - s)),
|
|
10277
10277
|
Nn(0),
|
|
10278
10278
|
dt()
|
|
@@ -10314,7 +10314,7 @@ const mr = Qe(
|
|
|
10314
10314
|
return N ? E && fn(
|
|
10315
10315
|
Q(
|
|
10316
10316
|
a,
|
|
10317
|
-
|
|
10317
|
+
Ne((V) => !V),
|
|
10318
10318
|
// skips the initial publish of false, and the cleanup call.
|
|
10319
10319
|
// but if scrollingInProgress is true, we skip the initial publish.
|
|
10320
10320
|
ir(yt(a) ? 1 : 2)
|
|
@@ -10322,7 +10322,7 @@ const mr = Qe(
|
|
|
10322
10322
|
E
|
|
10323
10323
|
) : E && E(), N;
|
|
10324
10324
|
}),
|
|
10325
|
-
|
|
10325
|
+
Ne((p) => p !== null)
|
|
10326
10326
|
),
|
|
10327
10327
|
c
|
|
10328
10328
|
), {
|
|
@@ -10358,13 +10358,13 @@ const ET = (e, t) => typeof e == "function" ? iu(e(t)) : t && iu(e), kT = Qe(
|
|
|
10358
10358
|
}
|
|
10359
10359
|
rt(
|
|
10360
10360
|
Q(
|
|
10361
|
-
Ct(Q(
|
|
10362
|
-
Be(
|
|
10361
|
+
Ct(Q(Ie(t), ir(1)), l),
|
|
10362
|
+
Be(Ie(v), s, i, p),
|
|
10363
10363
|
pe(([[S, T], E, R, P, D]) => {
|
|
10364
10364
|
let B = T && P, z = "auto";
|
|
10365
10365
|
return B && (z = ET(E, R || D), B = B && !!z), { followOutputBehavior: z, shouldFollow: B, totalCount: S };
|
|
10366
10366
|
}),
|
|
10367
|
-
|
|
10367
|
+
Ne(({ shouldFollow: S }) => S)
|
|
10368
10368
|
),
|
|
10369
10369
|
({ followOutputBehavior: S, totalCount: T }) => {
|
|
10370
10370
|
x && (x(), x = null), yt(n) ? requestAnimationFrame(() => {
|
|
@@ -10382,13 +10382,13 @@ const ET = (e, t) => typeof e == "function" ? iu(e(t)) : t && iu(e), kT = Qe(
|
|
|
10382
10382
|
}
|
|
10383
10383
|
rt(
|
|
10384
10384
|
Q(
|
|
10385
|
-
Ct(
|
|
10386
|
-
|
|
10385
|
+
Ct(Ie(v), t, c),
|
|
10386
|
+
Ne(([S, , T]) => S && T),
|
|
10387
10387
|
Tn(
|
|
10388
10388
|
({ value: S }, [, T]) => ({ refreshed: S === T, value: T }),
|
|
10389
10389
|
{ refreshed: !1, value: 0 }
|
|
10390
10390
|
),
|
|
10391
|
-
|
|
10391
|
+
Ne(({ refreshed: S }) => S),
|
|
10392
10392
|
Be(v, t)
|
|
10393
10393
|
),
|
|
10394
10394
|
([, S]) => {
|
|
@@ -10396,28 +10396,28 @@ const ET = (e, t) => typeof e == "function" ? iu(e(t)) : t && iu(e), kT = Qe(
|
|
|
10396
10396
|
}
|
|
10397
10397
|
), rt(g, () => {
|
|
10398
10398
|
w(yt(v) !== !1);
|
|
10399
|
-
}), rt(Ct(
|
|
10399
|
+
}), rt(Ct(Ie(v), o), ([S, T]) => {
|
|
10400
10400
|
S && !T.atBottom && T.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && b("auto");
|
|
10401
10401
|
});
|
|
10402
10402
|
const y = oe(null), C = Ve();
|
|
10403
10403
|
return be(
|
|
10404
10404
|
ii(
|
|
10405
10405
|
Q(
|
|
10406
|
-
|
|
10406
|
+
Ie(r),
|
|
10407
10407
|
pe((S) => {
|
|
10408
10408
|
var T;
|
|
10409
10409
|
return (T = S == null ? void 0 : S.length) != null ? T : 0;
|
|
10410
10410
|
})
|
|
10411
10411
|
),
|
|
10412
|
-
Q(
|
|
10412
|
+
Q(Ie(t))
|
|
10413
10413
|
),
|
|
10414
10414
|
C
|
|
10415
10415
|
), rt(
|
|
10416
10416
|
Q(
|
|
10417
10417
|
Ct(Q(C, ir(1)), l),
|
|
10418
|
-
Be(
|
|
10418
|
+
Be(Ie(y), i, p, m),
|
|
10419
10419
|
pe(([[S, T], E, R, P, D]) => T && R && (E == null ? void 0 : E({ context: D, totalCount: S, scrollingInProgress: P }))),
|
|
10420
|
-
|
|
10420
|
+
Ne((S) => !!S),
|
|
10421
10421
|
Nn(0)
|
|
10422
10422
|
),
|
|
10423
10423
|
(S) => {
|
|
@@ -10445,7 +10445,7 @@ const ET = (e, t) => typeof e == "function" ? iu(e(t)) : t && iu(e), kT = Qe(
|
|
|
10445
10445
|
Q(
|
|
10446
10446
|
i,
|
|
10447
10447
|
Be(s),
|
|
10448
|
-
|
|
10448
|
+
Ne(([, l]) => l !== 0),
|
|
10449
10449
|
Be(o, r, t, n, e),
|
|
10450
10450
|
pe(([[, l], c, d, p, m, f = []]) => Tp(l, c, d, p, m, f))
|
|
10451
10451
|
),
|
|
@@ -10460,7 +10460,7 @@ const ET = (e, t) => typeof e == "function" ? iu(e(t)) : t && iu(e), kT = Qe(
|
|
|
10460
10460
|
Q(
|
|
10461
10461
|
e,
|
|
10462
10462
|
Be(r),
|
|
10463
|
-
|
|
10463
|
+
Ne(([, o]) => o !== 0),
|
|
10464
10464
|
pe(([, o]) => ({ top: o }))
|
|
10465
10465
|
),
|
|
10466
10466
|
(o) => {
|
|
@@ -10468,7 +10468,7 @@ const ET = (e, t) => typeof e == "function" ? iu(e(t)) : t && iu(e), kT = Qe(
|
|
|
10468
10468
|
Q(
|
|
10469
10469
|
n,
|
|
10470
10470
|
ir(1),
|
|
10471
|
-
|
|
10471
|
+
Ne((s) => s.items.length > 1)
|
|
10472
10472
|
),
|
|
10473
10473
|
() => {
|
|
10474
10474
|
requestAnimationFrame(() => {
|
|
@@ -10490,7 +10490,7 @@ const ET = (e, t) => typeof e == "function" ? iu(e(t)) : t && iu(e), kT = Qe(
|
|
|
10490
10490
|
Q(
|
|
10491
10491
|
e,
|
|
10492
10492
|
Be(r, t, n),
|
|
10493
|
-
|
|
10493
|
+
Ne(([o, s]) => !!s),
|
|
10494
10494
|
pe(([o, s, a, i]) => {
|
|
10495
10495
|
const { enter: l, exit: c } = s;
|
|
10496
10496
|
if (a) {
|
|
@@ -10562,11 +10562,11 @@ const ET = (e, t) => typeof e == "function" ? iu(e(t)) : t && iu(e), kT = Qe(
|
|
|
10562
10562
|
const C = fT(v.sizeTree);
|
|
10563
10563
|
x && b !== null && w !== null && (g = b.scrollTop - w.offsetTop), g -= y, f({ ranges: C, scrollTop: g });
|
|
10564
10564
|
}
|
|
10565
|
-
), be(Q(d,
|
|
10565
|
+
), be(Q(d, Ne(cl), pe(AT)), o), be(
|
|
10566
10566
|
Q(
|
|
10567
10567
|
s,
|
|
10568
10568
|
Be(d),
|
|
10569
|
-
|
|
10569
|
+
Ne(([, f]) => f !== void 0),
|
|
10570
10570
|
dt(),
|
|
10571
10571
|
pe(([, f]) => f.ranges)
|
|
10572
10572
|
),
|
|
@@ -10586,7 +10586,7 @@ const jT = Qe(([{ topItemsIndexes: e }]) => {
|
|
|
10586
10586
|
return be(
|
|
10587
10587
|
Q(
|
|
10588
10588
|
t,
|
|
10589
|
-
|
|
10589
|
+
Ne((n) => n >= 0),
|
|
10590
10590
|
pe((n) => Array.from({ length: n }).map((r, o) => o))
|
|
10591
10591
|
),
|
|
10592
10592
|
e
|
|
@@ -10617,9 +10617,9 @@ const _T = Ip(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10617
10617
|
},
|
|
10618
10618
|
[0, [], 0, 0]
|
|
10619
10619
|
),
|
|
10620
|
-
|
|
10620
|
+
Ne(([b]) => b !== 0),
|
|
10621
10621
|
Be(r, i, n, o, f, v),
|
|
10622
|
-
|
|
10622
|
+
Ne(([, b, w, y, , , C]) => !C && !y && b !== 0 && w === po),
|
|
10623
10623
|
pe(([[b], , , , , w]) => (w("Upward scrolling compensation", { amount: b }, Yt.DEBUG), b))
|
|
10624
10624
|
)
|
|
10625
10625
|
);
|
|
@@ -10631,7 +10631,7 @@ const _T = Ip(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10631
10631
|
}), rt(
|
|
10632
10632
|
Q(
|
|
10633
10633
|
Ct(Ft(s, !1), e, v),
|
|
10634
|
-
|
|
10634
|
+
Ne(([b, w, y]) => !b && !y && w !== 0),
|
|
10635
10635
|
pe(([b, w]) => w),
|
|
10636
10636
|
Nn(1)
|
|
10637
10637
|
),
|
|
@@ -11337,7 +11337,7 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11337
11337
|
Q(
|
|
11338
11338
|
v,
|
|
11339
11339
|
Be(k),
|
|
11340
|
-
|
|
11340
|
+
Ne(([O, Y]) => !!Y)
|
|
11341
11341
|
),
|
|
11342
11342
|
() => {
|
|
11343
11343
|
Oe(K, !1);
|
|
@@ -11345,7 +11345,7 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11345
11345
|
), rt(
|
|
11346
11346
|
Q(
|
|
11347
11347
|
Ct(v, K, D, P, k, G),
|
|
11348
|
-
|
|
11348
|
+
Ne(([O, Y, J, le, , F]) => O && !Y && J.height !== 0 && le.height !== 0 && !F)
|
|
11349
11349
|
),
|
|
11350
11350
|
([, , , , O]) => {
|
|
11351
11351
|
Oe(G, !0), hl(1, () => {
|
|
@@ -11357,7 +11357,7 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11357
11357
|
), be(
|
|
11358
11358
|
Q(
|
|
11359
11359
|
$,
|
|
11360
|
-
|
|
11360
|
+
Ne((O) => O != null && O.scrollTop > 0),
|
|
11361
11361
|
bn(0)
|
|
11362
11362
|
),
|
|
11363
11363
|
E
|
|
@@ -11365,7 +11365,7 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11365
11365
|
Q(
|
|
11366
11366
|
v,
|
|
11367
11367
|
Be($),
|
|
11368
|
-
|
|
11368
|
+
Ne(([, O]) => O != null)
|
|
11369
11369
|
),
|
|
11370
11370
|
([, O]) => {
|
|
11371
11371
|
O && (Oe(P, O.viewport), Oe(D, O.item), Oe(V, O.gap), O.scrollTop > 0 && (Oe(j, !0), fn(Q(c, ir(1)), (Y) => {
|
|
@@ -11381,10 +11381,10 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11381
11381
|
), be(
|
|
11382
11382
|
Q(
|
|
11383
11383
|
Ct(
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11384
|
+
Ie(P, Vo),
|
|
11385
|
+
Ie(D, Vo),
|
|
11386
|
+
Ie(V, (O, Y) => O && O.column === Y.column && O.row === Y.row),
|
|
11387
|
+
Ie(c)
|
|
11388
11388
|
),
|
|
11389
11389
|
pe(([O, Y, J, le]) => ({
|
|
11390
11390
|
gap: J,
|
|
@@ -11397,42 +11397,42 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11397
11397
|
), be(
|
|
11398
11398
|
Q(
|
|
11399
11399
|
Ct(
|
|
11400
|
-
|
|
11400
|
+
Ie(T),
|
|
11401
11401
|
r,
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11402
|
+
Ie(V, sC),
|
|
11403
|
+
Ie(D, Vo),
|
|
11404
|
+
Ie(P, Vo),
|
|
11405
|
+
Ie(N),
|
|
11406
|
+
Ie(E),
|
|
11407
|
+
Ie(j),
|
|
11408
|
+
Ie(K),
|
|
11409
|
+
Ie(k)
|
|
11410
11410
|
),
|
|
11411
|
-
|
|
11411
|
+
Ne(([, , , , , , , O]) => !O),
|
|
11412
11412
|
pe(
|
|
11413
11413
|
([
|
|
11414
11414
|
O,
|
|
11415
11415
|
[Y, J],
|
|
11416
11416
|
le,
|
|
11417
11417
|
F,
|
|
11418
|
-
|
|
11418
|
+
te,
|
|
11419
11419
|
ce,
|
|
11420
11420
|
ie,
|
|
11421
11421
|
,
|
|
11422
11422
|
ge,
|
|
11423
|
-
|
|
11423
|
+
Te
|
|
11424
11424
|
]) => {
|
|
11425
|
-
const { column: je, row: De } = le, { height: He, width: st } = F, { width: Et } =
|
|
11425
|
+
const { column: je, row: De } = le, { height: He, width: st } = F, { width: Et } = te;
|
|
11426
11426
|
if (ie === 0 && (O === 0 || Et === 0))
|
|
11427
11427
|
return uu;
|
|
11428
11428
|
if (st === 0) {
|
|
11429
|
-
const _t = ml(
|
|
11429
|
+
const _t = ml(Te, O), wt = _t + Math.max(ie - 1, 0);
|
|
11430
11430
|
return oC(pu(_t, wt, ce));
|
|
11431
11431
|
}
|
|
11432
11432
|
const Ke = $p(Et, st, je);
|
|
11433
11433
|
let Ue, Ye;
|
|
11434
11434
|
ge ? Y === 0 && J === 0 && ie > 0 ? (Ue = 0, Ye = ie - 1) : (Ue = Ke * bs((Y + De) / (He + De)), Ye = Ke * du((J + De) / (He + De)) - 1, Ye = La(O - 1, Qr(Ye, Ke - 1)), Ue = La(Ye, Qr(0, Ue))) : (Ue = 0, Ye = -1);
|
|
11435
|
-
const Le = pu(Ue, Ye, ce), { bottom: We, top: vt } = hu(
|
|
11435
|
+
const Le = pu(Ue, Ye, ce), { bottom: We, top: vt } = hu(te, le, F, Le), Mt = du(O / Ke), ut = Mt * He + (Mt - 1) * De - We;
|
|
11436
11436
|
return { bottom: We, itemHeight: He, items: Le, itemWidth: st, offsetBottom: ut, offsetTop: vt, top: vt };
|
|
11437
11437
|
}
|
|
11438
11438
|
)
|
|
@@ -11441,17 +11441,17 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11441
11441
|
), be(
|
|
11442
11442
|
Q(
|
|
11443
11443
|
N,
|
|
11444
|
-
|
|
11444
|
+
Ne((O) => O !== null),
|
|
11445
11445
|
pe((O) => O.length)
|
|
11446
11446
|
),
|
|
11447
11447
|
T
|
|
11448
11448
|
), be(
|
|
11449
11449
|
Q(
|
|
11450
11450
|
Ct(P, D, R, V),
|
|
11451
|
-
|
|
11451
|
+
Ne(([O, Y, { items: J }]) => J.length > 0 && Y.height !== 0 && O.height !== 0),
|
|
11452
11452
|
pe(([O, Y, { items: J }, le]) => {
|
|
11453
|
-
const { bottom: F, top:
|
|
11454
|
-
return [
|
|
11453
|
+
const { bottom: F, top: te } = hu(O, le, Y, J);
|
|
11454
|
+
return [te, F];
|
|
11455
11455
|
}),
|
|
11456
11456
|
dt(uo)
|
|
11457
11457
|
),
|
|
@@ -11469,9 +11469,9 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11469
11469
|
const q = tn(
|
|
11470
11470
|
Q(
|
|
11471
11471
|
Ct(R, T),
|
|
11472
|
-
|
|
11472
|
+
Ne(([{ items: O }]) => O.length > 0),
|
|
11473
11473
|
Be(_),
|
|
11474
|
-
|
|
11474
|
+
Ne(([[O, Y], J]) => {
|
|
11475
11475
|
const le = O.items[O.items.length - 1].index === Y - 1;
|
|
11476
11476
|
return (J || O.bottom > 0 && O.itemHeight > 0 && O.offsetBottom === 0 && O.items.length === Y) && le;
|
|
11477
11477
|
}),
|
|
@@ -11480,16 +11480,16 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11480
11480
|
)
|
|
11481
11481
|
), X = tn(
|
|
11482
11482
|
Q(
|
|
11483
|
-
|
|
11484
|
-
|
|
11483
|
+
Ie(R),
|
|
11484
|
+
Ne(({ items: O }) => O.length > 0 && O[0].index === 0),
|
|
11485
11485
|
bn(0),
|
|
11486
11486
|
dt()
|
|
11487
11487
|
)
|
|
11488
11488
|
), re = tn(
|
|
11489
11489
|
Q(
|
|
11490
|
-
|
|
11490
|
+
Ie(R),
|
|
11491
11491
|
Be(j),
|
|
11492
|
-
|
|
11492
|
+
Ne(([{ items: O }, Y]) => O.length > 0 && !Y),
|
|
11493
11493
|
pe(([{ items: O }]) => ({
|
|
11494
11494
|
endIndex: O[O.length - 1].index,
|
|
11495
11495
|
startIndex: O[0].index
|
|
@@ -11503,10 +11503,10 @@ const aC = /* @__PURE__ */ Qe(
|
|
|
11503
11503
|
B,
|
|
11504
11504
|
Be(P, D, T, V),
|
|
11505
11505
|
pe(([O, Y, J, le, F]) => {
|
|
11506
|
-
const
|
|
11507
|
-
let
|
|
11508
|
-
|
|
11509
|
-
let je = fi(Y, F, J,
|
|
11506
|
+
const te = yp(O), { align: ce, behavior: ie, offset: ge } = te;
|
|
11507
|
+
let Te = te.index;
|
|
11508
|
+
Te === "LAST" && (Te = le - 1), Te = Qr(0, Te, La(le - 1, Te));
|
|
11509
|
+
let je = fi(Y, F, J, Te);
|
|
11510
11510
|
return ce === "end" ? je = fu(je - Y.height + J.height) : ce === "center" && (je = fu(je - Y.height / 2 + J.height / 2)), ge && (je += ge), { behavior: ie, top: je };
|
|
11511
11511
|
})
|
|
11512
11512
|
),
|
|
@@ -11592,7 +11592,7 @@ const iC = /* @__PURE__ */ Qe(() => {
|
|
|
11592
11592
|
),
|
|
11593
11593
|
m
|
|
11594
11594
|
), c = oe(!1), d = oe(!1);
|
|
11595
|
-
return be(
|
|
11595
|
+
return be(Ie(d), c), {
|
|
11596
11596
|
components: t,
|
|
11597
11597
|
computeItemKey: s,
|
|
11598
11598
|
context: n,
|
|
@@ -13854,6 +13854,8 @@ function Mo({
|
|
|
13854
13854
|
style: r
|
|
13855
13855
|
}) {
|
|
13856
13856
|
const o = Ze(() => {
|
|
13857
|
+
if (!e || typeof e != "string" || e.trim().length === 0)
|
|
13858
|
+
return "";
|
|
13857
13859
|
try {
|
|
13858
13860
|
if (!n) {
|
|
13859
13861
|
const a = e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, "").replace(/javascript:/gi, "").replace(/on\w+\s*=/gi, "");
|
|
@@ -14544,20 +14546,20 @@ const _l = _g(function({
|
|
|
14544
14546
|
contentParts: J,
|
|
14545
14547
|
imageParts: le,
|
|
14546
14548
|
fileParts: F,
|
|
14547
|
-
interruptParts:
|
|
14549
|
+
interruptParts: te,
|
|
14548
14550
|
textContent: ce,
|
|
14549
14551
|
toolMeta: ie,
|
|
14550
14552
|
toolRaw: ge,
|
|
14551
|
-
isToolStreaming:
|
|
14553
|
+
isToolStreaming: Te
|
|
14552
14554
|
} = Y, je = (b == null ? void 0 : b.id) ?? (b == null ? void 0 : b.interrupt_id), De = es(je), He = b == null ? void 0 : b.value, st = Ze(() => K || !m ? null : t.artifact || null, [K, t, m]), Et = me(async () => {
|
|
14553
|
-
const
|
|
14554
|
-
async function Ge(
|
|
14555
|
+
const Ce = k ? ge : ce;
|
|
14556
|
+
async function Ge(Ee) {
|
|
14555
14557
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
|
|
14556
|
-
await navigator.clipboard.writeText(
|
|
14558
|
+
await navigator.clipboard.writeText(Ee);
|
|
14557
14559
|
return;
|
|
14558
14560
|
}
|
|
14559
14561
|
if (navigator.clipboard && typeof navigator.clipboard.write == "function" && typeof ClipboardItem < "u") {
|
|
14560
|
-
const qe = new Blob([
|
|
14562
|
+
const qe = new Blob([Ee], { type: "text/plain" });
|
|
14561
14563
|
await navigator.clipboard.write([
|
|
14562
14564
|
new ClipboardItem({
|
|
14563
14565
|
"text/plain": qe
|
|
@@ -14568,17 +14570,17 @@ const _l = _g(function({
|
|
|
14568
14570
|
throw new Error("Clipboard API not supported in this context.");
|
|
14569
14571
|
}
|
|
14570
14572
|
try {
|
|
14571
|
-
await Ge(
|
|
14572
|
-
} catch (
|
|
14573
|
-
console.error("Failed to copy:",
|
|
14573
|
+
await Ge(Ce), D(!0), setTimeout(() => D(!1), 2e3), x == null || x(Ce);
|
|
14574
|
+
} catch (Ee) {
|
|
14575
|
+
console.error("Failed to copy:", Ee);
|
|
14574
14576
|
}
|
|
14575
14577
|
}, [k, ge, ce, x]), Ke = me(() => {
|
|
14576
14578
|
if (!v || !t.id) return;
|
|
14577
|
-
const
|
|
14579
|
+
const Ce = (k ? ge : ce) ?? "", Ge = "type" in t && t.type === "default_message" ? void 0 : {
|
|
14578
14580
|
checkpointId: t.checkpointId ?? null,
|
|
14579
14581
|
checkpointNs: t.checkpointNs ?? null
|
|
14580
14582
|
};
|
|
14581
|
-
v(t.id,
|
|
14583
|
+
v(t.id, Ce, Ge);
|
|
14582
14584
|
}, [v, t.id, k, ge, ce, t]), Ue = me(() => {
|
|
14583
14585
|
g == null || g(n);
|
|
14584
14586
|
}, [g, n]), Ye = me(() => {
|
|
@@ -14594,25 +14596,25 @@ const _l = _g(function({
|
|
|
14594
14596
|
return /* @__PURE__ */ u.jsx(xa, { className: Ge });
|
|
14595
14597
|
}
|
|
14596
14598
|
}, [$, O, j]), Le = me(() => {
|
|
14597
|
-
const
|
|
14599
|
+
const Ce = "group relative mb-4 flex w-full";
|
|
14598
14600
|
switch (j) {
|
|
14599
14601
|
case "user":
|
|
14600
|
-
return ee(
|
|
14602
|
+
return ee(Ce, "justify-end");
|
|
14601
14603
|
case "assistant":
|
|
14602
14604
|
case "tool":
|
|
14603
14605
|
case "system":
|
|
14604
|
-
return ee(
|
|
14606
|
+
return ee(Ce, "justify-start");
|
|
14605
14607
|
default:
|
|
14606
|
-
return
|
|
14608
|
+
return Ce;
|
|
14607
14609
|
}
|
|
14608
14610
|
}, [j]), We = me(() => {
|
|
14609
|
-
const
|
|
14611
|
+
const Ce = ee(
|
|
14610
14612
|
"rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
|
|
14611
14613
|
$ && "px-3 py-2 text-sm"
|
|
14612
14614
|
);
|
|
14613
14615
|
if (G)
|
|
14614
14616
|
return ee(
|
|
14615
|
-
|
|
14617
|
+
Ce,
|
|
14616
14618
|
"w-full",
|
|
14617
14619
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
14618
14620
|
"border border-border/60 dark:border-border/40 shadow-sm"
|
|
@@ -14620,61 +14622,61 @@ const _l = _g(function({
|
|
|
14620
14622
|
switch (j) {
|
|
14621
14623
|
case "user":
|
|
14622
14624
|
return ee(
|
|
14623
|
-
|
|
14625
|
+
Ce,
|
|
14624
14626
|
"w-full md:max-w-[95%]",
|
|
14625
14627
|
"bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
|
|
14626
14628
|
"border border-transparent"
|
|
14627
14629
|
);
|
|
14628
14630
|
case "assistant":
|
|
14629
14631
|
return ee(
|
|
14630
|
-
|
|
14632
|
+
Ce,
|
|
14631
14633
|
"w-full md:max-w-[95%]",
|
|
14632
14634
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
14633
14635
|
"border border-border/60 dark:border-border/40"
|
|
14634
14636
|
);
|
|
14635
14637
|
case "tool":
|
|
14636
|
-
return ee(
|
|
14638
|
+
return ee(Ce, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
|
|
14637
14639
|
case "system":
|
|
14638
|
-
return ee(
|
|
14640
|
+
return ee(Ce, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
|
|
14639
14641
|
default:
|
|
14640
14642
|
return ee(
|
|
14641
|
-
|
|
14643
|
+
Ce,
|
|
14642
14644
|
"w-full md:max-w-[95%]",
|
|
14643
14645
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
14644
14646
|
"border border-border/60 dark:border-border/40"
|
|
14645
14647
|
);
|
|
14646
14648
|
}
|
|
14647
|
-
}, [$, G, j]), vt = me(async (
|
|
14649
|
+
}, [$, G, j]), vt = me(async (Ce) => {
|
|
14648
14650
|
if (w)
|
|
14649
14651
|
return;
|
|
14650
14652
|
const Ge = es(
|
|
14651
|
-
(
|
|
14653
|
+
(Ce == null ? void 0 : Ce.id) ?? (Ce == null ? void 0 : Ce.interrupt_id)
|
|
14652
14654
|
);
|
|
14653
14655
|
if (!Ge) {
|
|
14654
|
-
console.warn("Interrupt part missing id",
|
|
14656
|
+
console.warn("Interrupt part missing id", Ce);
|
|
14655
14657
|
return;
|
|
14656
14658
|
}
|
|
14657
14659
|
try {
|
|
14658
14660
|
y == null || y(), await W(Ge, !0);
|
|
14659
|
-
} catch (
|
|
14660
|
-
console.error("Failed to approve interrupt:",
|
|
14661
|
+
} catch (Ee) {
|
|
14662
|
+
console.error("Failed to approve interrupt:", Ee);
|
|
14661
14663
|
} finally {
|
|
14662
14664
|
C == null || C();
|
|
14663
14665
|
}
|
|
14664
|
-
}, [w, C, y, W]), Mt = me(async (
|
|
14666
|
+
}, [w, C, y, W]), Mt = me(async (Ce) => {
|
|
14665
14667
|
if (w)
|
|
14666
14668
|
return;
|
|
14667
14669
|
const Ge = es(
|
|
14668
|
-
(
|
|
14670
|
+
(Ce == null ? void 0 : Ce.id) ?? (Ce == null ? void 0 : Ce.interrupt_id)
|
|
14669
14671
|
);
|
|
14670
14672
|
if (!Ge) {
|
|
14671
|
-
console.warn("Interrupt part missing id",
|
|
14673
|
+
console.warn("Interrupt part missing id", Ce);
|
|
14672
14674
|
return;
|
|
14673
14675
|
}
|
|
14674
14676
|
try {
|
|
14675
14677
|
y == null || y(), await W(Ge, !1);
|
|
14676
|
-
} catch (
|
|
14677
|
-
console.error("Failed to reject interrupt:",
|
|
14678
|
+
} catch (Ee) {
|
|
14679
|
+
console.error("Failed to reject interrupt:", Ee);
|
|
14678
14680
|
} finally {
|
|
14679
14681
|
C == null || C();
|
|
14680
14682
|
}
|
|
@@ -14723,9 +14725,9 @@ const _l = _g(function({
|
|
|
14723
14725
|
role: "button",
|
|
14724
14726
|
tabIndex: 0,
|
|
14725
14727
|
"aria-expanded": B === "expanded",
|
|
14726
|
-
onClick: () => z((
|
|
14727
|
-
onKeyDown: (
|
|
14728
|
-
(
|
|
14728
|
+
onClick: () => z((Ce) => Ce === "expanded" ? "preview" : "expanded"),
|
|
14729
|
+
onKeyDown: (Ce) => {
|
|
14730
|
+
(Ce.key === "Enter" || Ce.key === " ") && (Ce.preventDefault(), z((Ge) => Ge === "expanded" ? "preview" : "expanded"));
|
|
14729
14731
|
},
|
|
14730
14732
|
children: [
|
|
14731
14733
|
/* @__PURE__ */ u.jsx("span", { children: ie.name ?? "Tool Output" }),
|
|
@@ -14843,12 +14845,12 @@ const _l = _g(function({
|
|
|
14843
14845
|
showToolMessages: p,
|
|
14844
14846
|
artifactToRender: st,
|
|
14845
14847
|
toolViewMode: B,
|
|
14846
|
-
isToolStreaming:
|
|
14848
|
+
isToolStreaming: Te,
|
|
14847
14849
|
contentParts: J,
|
|
14848
14850
|
textContent: ce,
|
|
14849
14851
|
imageParts: le,
|
|
14850
14852
|
fileParts: F,
|
|
14851
|
-
interruptParts:
|
|
14853
|
+
interruptParts: te,
|
|
14852
14854
|
isStreamingMessage: r,
|
|
14853
14855
|
handleFileClick: q,
|
|
14854
14856
|
uploadingFiles: _,
|
|
@@ -15052,16 +15054,16 @@ const bh = M.forwardRef(({
|
|
|
15052
15054
|
createSyntheticThinkingMessage: B = !0
|
|
15053
15055
|
}, z) => {
|
|
15054
15056
|
const L = $e(null), N = $e(null), V = $e(!1), W = $e(!1), [$, j] = fe(!0), k = Ze(() => w ? e.some((F) => "type" in F && F.type === "default_message" ? !1 : Array.isArray(F == null ? void 0 : F.content) && F.content.some(
|
|
15055
|
-
(
|
|
15057
|
+
(te) => te && te.type === "interrupt" && (te.id ?? te.interrupt_id) === w.id
|
|
15056
15058
|
)) : !1, [w, e]), K = Ze(() => {
|
|
15057
15059
|
if (!w || k)
|
|
15058
15060
|
return null;
|
|
15059
15061
|
const F = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
|
|
15060
|
-
let
|
|
15062
|
+
let te;
|
|
15061
15063
|
const ce = w.value;
|
|
15062
15064
|
if (ce && typeof ce == "object" && !Array.isArray(ce)) {
|
|
15063
15065
|
const ie = ce.title;
|
|
15064
|
-
typeof ie == "string" && ie.trim() && (
|
|
15066
|
+
typeof ie == "string" && ie.trim() && (te = ie.trim());
|
|
15065
15067
|
}
|
|
15066
15068
|
return {
|
|
15067
15069
|
id: `interrupt-${F}`,
|
|
@@ -15072,11 +15074,11 @@ const bh = M.forwardRef(({
|
|
|
15072
15074
|
type: "interrupt",
|
|
15073
15075
|
id: F,
|
|
15074
15076
|
value: ce,
|
|
15075
|
-
title:
|
|
15077
|
+
title: te
|
|
15076
15078
|
}
|
|
15077
15079
|
]
|
|
15078
15080
|
};
|
|
15079
|
-
}, [w, k]), G = Ze(() => K ? [...e, K] : e, [e, K]), A = Ze(() => !B || !t ? G : !G.some((
|
|
15081
|
+
}, [w, k]), G = Ze(() => K ? [...e, K] : e, [e, K]), A = Ze(() => !B || !t ? G : !G.some((te) => te.role === "assistant") && G.length > 0 ? [
|
|
15080
15082
|
...G,
|
|
15081
15083
|
{
|
|
15082
15084
|
id: "thinking-assistant",
|
|
@@ -15129,7 +15131,7 @@ const bh = M.forwardRef(({
|
|
|
15129
15131
|
}
|
|
15130
15132
|
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: f ?? "No messages yet. Start a conversation!" }), J = _.length, le = J > 0;
|
|
15131
15133
|
return nt(() => {
|
|
15132
|
-
var F,
|
|
15134
|
+
var F, te;
|
|
15133
15135
|
if (J === 0) {
|
|
15134
15136
|
W.current = !1;
|
|
15135
15137
|
return;
|
|
@@ -15137,16 +15139,16 @@ const bh = M.forwardRef(({
|
|
|
15137
15139
|
if (!W.current)
|
|
15138
15140
|
if (W.current = !0, L.current && _.length > 0) {
|
|
15139
15141
|
const ce = _.length - 1;
|
|
15140
|
-
(
|
|
15142
|
+
(te = (F = L.current).scrollToIndex) == null || te.call(F, { index: ce, align: "end", behavior: "auto" });
|
|
15141
15143
|
} else N.current && (N.current.scrollTop = N.current.scrollHeight);
|
|
15142
15144
|
}, [J, _.length]), Pg(
|
|
15143
15145
|
z,
|
|
15144
15146
|
() => ({
|
|
15145
15147
|
scrollToLatest: () => {
|
|
15146
|
-
var F,
|
|
15148
|
+
var F, te;
|
|
15147
15149
|
if (L.current && _.length > 0) {
|
|
15148
15150
|
const ce = _.length - 1;
|
|
15149
|
-
(
|
|
15151
|
+
(te = (F = L.current).scrollToIndex) == null || te.call(F, {
|
|
15150
15152
|
index: ce,
|
|
15151
15153
|
align: "end",
|
|
15152
15154
|
behavior: "auto"
|
|
@@ -15154,8 +15156,8 @@ const bh = M.forwardRef(({
|
|
|
15154
15156
|
} else N.current && (N.current.scrollTop = N.current.scrollHeight);
|
|
15155
15157
|
},
|
|
15156
15158
|
scrollToTop: () => {
|
|
15157
|
-
var F,
|
|
15158
|
-
L.current && _.length > 0 ? (
|
|
15159
|
+
var F, te;
|
|
15160
|
+
L.current && _.length > 0 ? (te = (F = L.current).scrollToIndex) == null || te.call(F, {
|
|
15159
15161
|
index: 0,
|
|
15160
15162
|
align: "start",
|
|
15161
15163
|
behavior: "auto"
|
|
@@ -15183,11 +15185,11 @@ const bh = M.forwardRef(({
|
|
|
15183
15185
|
},
|
|
15184
15186
|
atBottomStateChange: q,
|
|
15185
15187
|
style: { height: "100%", overscrollBehavior: "contain" },
|
|
15186
|
-
computeItemKey: (F,
|
|
15187
|
-
itemContent: (F,
|
|
15188
|
+
computeItemKey: (F, te) => vh(te, F),
|
|
15189
|
+
itemContent: (F, te) => /* @__PURE__ */ u.jsx(
|
|
15188
15190
|
wh,
|
|
15189
15191
|
{
|
|
15190
|
-
message:
|
|
15192
|
+
message: te,
|
|
15191
15193
|
index: F,
|
|
15192
15194
|
isStreaming: t,
|
|
15193
15195
|
streamingAssistantId: n,
|
|
@@ -15254,15 +15256,15 @@ function to({
|
|
|
15254
15256
|
re(!0);
|
|
15255
15257
|
}, []), O = me(() => {
|
|
15256
15258
|
re(!1);
|
|
15257
|
-
}, []), Y = !!q || X, [J, le] = fe(null), [F,
|
|
15259
|
+
}, []), Y = !!q || X, [J, le] = fe(null), [F, te] = fe(""), [ce, ie] = fe(null), [ge, Te] = fe(null), [je, De] = fe([]), [He, st] = fe(0), [Et, Ke] = fe(0), [Ue, Ye] = fe(!1), [Le, We] = fe(null), [vt, Mt] = fe(null), [ut, _t] = fe(!1), [wt, pt] = fe(null), bt = $e(!1), [kt, Pt] = fe(() => Tu.value), Ce = $e(kt), Ge = $e(null), Ee = me((se) => {
|
|
15258
15260
|
Tu.value = se, Pt(se);
|
|
15259
|
-
}, []), [qe, zt] = fe(!1),
|
|
15261
|
+
}, []), [qe, zt] = fe(!1), ne = $e(null), we = $e(null), at = $e(null), xe = me(() => {
|
|
15260
15262
|
we.current && (we.current.value = ""), at.current && (at.current.value = ""), st((se) => se + 1), Ke((se) => se + 1);
|
|
15261
15263
|
}, []), Fe = me(
|
|
15262
15264
|
(se) => {
|
|
15263
|
-
|
|
15265
|
+
Ee(se);
|
|
15264
15266
|
},
|
|
15265
|
-
[
|
|
15267
|
+
[Ee]
|
|
15266
15268
|
), Xe = $e(!1);
|
|
15267
15269
|
nt(() => {
|
|
15268
15270
|
Xe.current && !L && (De([]), xe()), Xe.current = L;
|
|
@@ -15279,22 +15281,22 @@ function to({
|
|
|
15279
15281
|
}, []), nt(() => {
|
|
15280
15282
|
bt.current = !1;
|
|
15281
15283
|
}, [j]), nt(() => {
|
|
15282
|
-
|
|
15284
|
+
Ce.current = kt;
|
|
15283
15285
|
}, [kt]), nt(() => {
|
|
15284
15286
|
if (!J) {
|
|
15285
15287
|
Ge.current = null;
|
|
15286
15288
|
return;
|
|
15287
15289
|
}
|
|
15288
|
-
Ge.current === null && (Ge.current =
|
|
15289
|
-
}, [F, J,
|
|
15290
|
+
Ge.current === null && (Ge.current = Ce.current), Ee(F ?? "");
|
|
15291
|
+
}, [F, J, Ee]), nt(() => {
|
|
15290
15292
|
(async () => {
|
|
15291
15293
|
if (!x.baseUrl) {
|
|
15292
15294
|
pt(null);
|
|
15293
15295
|
return;
|
|
15294
15296
|
}
|
|
15295
15297
|
try {
|
|
15296
|
-
const
|
|
15297
|
-
pt(
|
|
15298
|
+
const Re = (await x.getAgent("default")).uiDefaultMessage || "";
|
|
15299
|
+
pt(Re || null);
|
|
15298
15300
|
} catch (ue) {
|
|
15299
15301
|
console.warn("Failed to fetch default message:", ue), pt(null);
|
|
15300
15302
|
}
|
|
@@ -15305,7 +15307,7 @@ function to({
|
|
|
15305
15307
|
const At = async (se) => {
|
|
15306
15308
|
const ue = se.trim();
|
|
15307
15309
|
if (!ue && je.length === 0) return;
|
|
15308
|
-
const
|
|
15310
|
+
const Re = J;
|
|
15309
15311
|
try {
|
|
15310
15312
|
const Me = J ? (ce == null ? void 0 : ce.checkpointId) ?? k ?? void 0 : k ?? void 0, tt = J ? (ce == null ? void 0 : ce.checkpointNs) ?? K ?? void 0 : K ?? void 0;
|
|
15311
15313
|
await W(
|
|
@@ -15319,24 +15321,24 @@ function to({
|
|
|
15319
15321
|
edit: !!J,
|
|
15320
15322
|
originalMessageId: J ?? void 0
|
|
15321
15323
|
}
|
|
15322
|
-
), f == null || f(ue),
|
|
15324
|
+
), f == null || f(ue), Re && A(Re), Ee(""), Te(null), De([]), xe(), le(null), te(""), ie(null);
|
|
15323
15325
|
} catch (Me) {
|
|
15324
15326
|
const tt = (Me == null ? void 0 : Me.message) || "Failed to send message";
|
|
15325
|
-
|
|
15327
|
+
Te(tt), g == null || g(tt);
|
|
15326
15328
|
}
|
|
15327
15329
|
}, Ot = M.useCallback(
|
|
15328
|
-
(se, ue,
|
|
15329
|
-
c && (Ge.current = kt, le(se),
|
|
15330
|
-
checkpointId: (
|
|
15331
|
-
checkpointNs: (
|
|
15330
|
+
(se, ue, Re) => {
|
|
15331
|
+
c && (Ge.current = kt, le(se), te(ue), Ee(ue), Te(null), ie({
|
|
15332
|
+
checkpointId: (Re == null ? void 0 : Re.checkpointId) ?? null,
|
|
15333
|
+
checkpointNs: (Re == null ? void 0 : Re.checkpointNs) ?? null
|
|
15332
15334
|
}));
|
|
15333
15335
|
},
|
|
15334
|
-
[kt, c,
|
|
15336
|
+
[kt, c, Ee]
|
|
15335
15337
|
), Ae = M.useCallback(() => {
|
|
15336
|
-
le(null),
|
|
15337
|
-
}, [kt,
|
|
15338
|
-
(se, ue,
|
|
15339
|
-
Ot(se, ue,
|
|
15338
|
+
le(null), te(""), ie(null), Te(null), Ee(Ge.current ?? kt), Ge.current = null, A(null);
|
|
15339
|
+
}, [kt, Ee]), gt = me(
|
|
15340
|
+
(se, ue, Re) => {
|
|
15341
|
+
Ot(se, ue, Re);
|
|
15340
15342
|
},
|
|
15341
15343
|
[Ot]
|
|
15342
15344
|
), et = me((se) => {
|
|
@@ -15347,11 +15349,11 @@ function to({
|
|
|
15347
15349
|
break;
|
|
15348
15350
|
}
|
|
15349
15351
|
if (!ue) return;
|
|
15350
|
-
const
|
|
15352
|
+
const Re = Array.isArray(ue.content) ? ue.content : [], tt = Re.filter((xt) => (xt == null ? void 0 : xt.type) === "text").map((xt) => xt.text).join("") || (() => {
|
|
15351
15353
|
try {
|
|
15352
|
-
return JSON.stringify(
|
|
15354
|
+
return JSON.stringify(Re, null, 2);
|
|
15353
15355
|
} catch {
|
|
15354
|
-
return String(
|
|
15356
|
+
return String(Re);
|
|
15355
15357
|
}
|
|
15356
15358
|
})();
|
|
15357
15359
|
tt && W(
|
|
@@ -15365,11 +15367,11 @@ function to({
|
|
|
15365
15367
|
);
|
|
15366
15368
|
}, [y, W, k, K]), ht = (se) => {
|
|
15367
15369
|
const ue = Array.from(se.target.files || []);
|
|
15368
|
-
De((
|
|
15370
|
+
De((Re) => [...Re, ...ue]), se.target.value = "";
|
|
15369
15371
|
}, nn = (se) => {
|
|
15370
15372
|
De((ue) => {
|
|
15371
|
-
const
|
|
15372
|
-
return
|
|
15373
|
+
const Re = ue.filter((Me, tt) => se !== tt);
|
|
15374
|
+
return Re.length === 0 && xe(), Re;
|
|
15373
15375
|
});
|
|
15374
15376
|
}, I = async (se) => {
|
|
15375
15377
|
const ue = (se.target.files || [])[0];
|
|
@@ -15383,11 +15385,11 @@ function to({
|
|
|
15383
15385
|
checkpointNs: K ?? void 0
|
|
15384
15386
|
}
|
|
15385
15387
|
);
|
|
15386
|
-
const
|
|
15387
|
-
Mt(
|
|
15388
|
-
} catch (
|
|
15389
|
-
const Me =
|
|
15390
|
-
console.error("Excel upload failed",
|
|
15388
|
+
const Re = `Uploaded ${ue.name} - processing through chat stream`;
|
|
15389
|
+
Mt(Re);
|
|
15390
|
+
} catch (Re) {
|
|
15391
|
+
const Me = Re instanceof Error ? Re.message : "Failed to upload Excel file";
|
|
15392
|
+
console.error("Excel upload failed", Re), We(Me), g == null || g(Me);
|
|
15391
15393
|
} finally {
|
|
15392
15394
|
Ye(!1), se.target.value = "", xe();
|
|
15393
15395
|
}
|
|
@@ -15399,26 +15401,26 @@ function to({
|
|
|
15399
15401
|
if (!se) {
|
|
15400
15402
|
await E(), requestAnimationFrame(() => {
|
|
15401
15403
|
var Me;
|
|
15402
|
-
(Me =
|
|
15404
|
+
(Me = ne.current) == null || Me.scrollToLatest();
|
|
15403
15405
|
});
|
|
15404
15406
|
return;
|
|
15405
15407
|
}
|
|
15406
|
-
const ue = P.find((Me) => Me.checkpointId === se),
|
|
15407
|
-
await T(se,
|
|
15408
|
+
const ue = P.find((Me) => Me.checkpointId === se), Re = (ue == null ? void 0 : ue.checkpointNs) ?? null;
|
|
15409
|
+
await T(se, Re), requestAnimationFrame(() => {
|
|
15408
15410
|
var Me;
|
|
15409
|
-
(Me =
|
|
15411
|
+
(Me = ne.current) == null || Me.scrollToTop();
|
|
15410
15412
|
});
|
|
15411
15413
|
} finally {
|
|
15412
15414
|
zt(!1);
|
|
15413
15415
|
}
|
|
15414
15416
|
}
|
|
15415
15417
|
}, de = me(
|
|
15416
|
-
async (se, ue,
|
|
15417
|
-
await Z(
|
|
15418
|
+
async (se, ue, Re) => {
|
|
15419
|
+
await Z(Re ? null : se);
|
|
15418
15420
|
},
|
|
15419
15421
|
[Z]
|
|
15420
|
-
),
|
|
15421
|
-
return /* @__PURE__ */ u.jsxs("div", { className:
|
|
15422
|
+
), ke = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${m.container || ""}`, Je = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${m.messagesArea || ""}`, ot = `relative flex-shrink-0 w-full border-t p-4 bg-transparent ${m.inputArea || ""}`;
|
|
15423
|
+
return /* @__PURE__ */ u.jsxs("div", { className: ke, children: [
|
|
15422
15424
|
!!N && !ut && /* @__PURE__ */ u.jsxs("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
|
|
15423
15425
|
/* @__PURE__ */ u.jsx("span", { children: N }),
|
|
15424
15426
|
/* @__PURE__ */ u.jsx(
|
|
@@ -15442,7 +15444,7 @@ function to({
|
|
|
15442
15444
|
/* @__PURE__ */ u.jsx(
|
|
15443
15445
|
bh,
|
|
15444
15446
|
{
|
|
15445
|
-
ref:
|
|
15447
|
+
ref: ne,
|
|
15446
15448
|
className: "h-full",
|
|
15447
15449
|
style: { height: "100%" },
|
|
15448
15450
|
messages: y,
|
|
@@ -16730,103 +16732,103 @@ function gi({
|
|
|
16730
16732
|
shareInFlight: B,
|
|
16731
16733
|
shareStatus: z,
|
|
16732
16734
|
clearShareStatus: L
|
|
16733
|
-
} = To(), { createThread: N, deleteThread: V, renameThread: W, shareThread: $ } = D, { loadThread: j } = Os(), k = a ?? T, [K, G] = fe(Array.isArray(C) ? C : []), A = $e(K.length > 0), _ = $e(null), q = $e(0), [X, re] = fe(null), [U, O] = fe(""), [Y, J] = fe(!1), [le, F] = fe(!1), [
|
|
16734
|
-
(
|
|
16735
|
-
p || De.setView(
|
|
16735
|
+
} = To(), { createThread: N, deleteThread: V, renameThread: W, shareThread: $ } = D, { loadThread: j } = Os(), k = a ?? T, [K, G] = fe(Array.isArray(C) ? C : []), A = $e(K.length > 0), _ = $e(null), q = $e(0), [X, re] = fe(null), [U, O] = fe(""), [Y, J] = fe(!1), [le, F] = fe(!1), [te, ce] = fe(null), [ie, ge] = fe(""), Te = v && v.length > 0 ? v : ok, je = rk({ defaultView: m }), De = g ?? je, He = p ?? De.view, st = me(
|
|
16736
|
+
(ne) => {
|
|
16737
|
+
p || De.setView(ne), f == null || f(ne);
|
|
16736
16738
|
},
|
|
16737
16739
|
[p, f, De]
|
|
16738
|
-
), Et =
|
|
16739
|
-
ce(
|
|
16740
|
+
), Et = Te.find((ne) => ne.key === He) ?? Te[0], Ke = (ne) => {
|
|
16741
|
+
ce(ne), ge(""), F(!0);
|
|
16740
16742
|
}, Ue = () => {
|
|
16741
16743
|
F(!1), ce(null), ge(""), L();
|
|
16742
16744
|
}, Ye = me(
|
|
16743
|
-
async (
|
|
16744
|
-
if (!(!
|
|
16745
|
+
async (ne) => {
|
|
16746
|
+
if (!(!te || B) && ne.id)
|
|
16745
16747
|
try {
|
|
16746
|
-
await $(
|
|
16748
|
+
await $(te, ne.id), setTimeout(() => Ue(), 600);
|
|
16747
16749
|
} catch (we) {
|
|
16748
16750
|
console.error("Failed to share thread:", we);
|
|
16749
16751
|
}
|
|
16750
16752
|
},
|
|
16751
|
-
[Ue, B,
|
|
16753
|
+
[Ue, B, te, $]
|
|
16752
16754
|
), Le = Ze(() => {
|
|
16753
|
-
const
|
|
16754
|
-
return we ? y ?
|
|
16755
|
-
}, [b, ie, y]), We = He === "shared", vt = We ? S : K, Mt = We ? P : R, ut = We ? "No shared conversations yet" : "No conversations yet", _t = (
|
|
16756
|
-
const we =
|
|
16757
|
-
return `Shared by ${
|
|
16758
|
-
}, wt = (
|
|
16755
|
+
const ne = b ?? [], we = ie.trim().toLowerCase();
|
|
16756
|
+
return we ? y ? ne.filter((at) => y(at, we)) : ne.filter((at) => `${at.label} ${at.secondaryLabel ?? ""}`.toLowerCase().includes(we)) : ne;
|
|
16757
|
+
}, [b, ie, y]), We = He === "shared", vt = We ? S : K, Mt = We ? P : R, ut = We ? "No shared conversations yet" : "No conversations yet", _t = (ne) => {
|
|
16758
|
+
const we = ne.sharedAt ? ` • ${Ee(ne.sharedAt)}` : "";
|
|
16759
|
+
return `Shared by ${ne.sharedByUserId}${we}`;
|
|
16760
|
+
}, wt = (ne) => "sharedByUserId" in ne;
|
|
16759
16761
|
nt(() => {
|
|
16760
|
-
const
|
|
16761
|
-
if (
|
|
16762
|
-
A.current = !0, G(
|
|
16762
|
+
const ne = Array.isArray(C) ? C : [];
|
|
16763
|
+
if (ne.length > 0) {
|
|
16764
|
+
A.current = !0, G(ne);
|
|
16763
16765
|
return;
|
|
16764
16766
|
}
|
|
16765
|
-
R || (A.current = !1, G(
|
|
16767
|
+
R || (A.current = !1, G(ne));
|
|
16766
16768
|
}, [C, R]), nt(() => {
|
|
16767
16769
|
if (!_.current) return;
|
|
16768
|
-
const
|
|
16770
|
+
const ne = _.current.querySelector(
|
|
16769
16771
|
"[data-radix-scroll-area-viewport]"
|
|
16770
16772
|
);
|
|
16771
|
-
if (!
|
|
16773
|
+
if (!ne) return;
|
|
16772
16774
|
let we = null, at = null;
|
|
16773
16775
|
return we = requestAnimationFrame(() => {
|
|
16774
16776
|
at = requestAnimationFrame(() => {
|
|
16775
|
-
|
|
16777
|
+
ne.scrollTop = q.current;
|
|
16776
16778
|
});
|
|
16777
16779
|
}), () => {
|
|
16778
16780
|
we !== null && cancelAnimationFrame(we), at !== null && cancelAnimationFrame(at);
|
|
16779
16781
|
};
|
|
16780
16782
|
}, [K]);
|
|
16781
|
-
const pt = async (
|
|
16783
|
+
const pt = async (ne) => {
|
|
16782
16784
|
try {
|
|
16783
|
-
E(
|
|
16785
|
+
E(ne), await j(ne), i == null || i(ne), l == null || l(ne);
|
|
16784
16786
|
} catch (we) {
|
|
16785
16787
|
console.error("Failed to select thread:", we);
|
|
16786
16788
|
}
|
|
16787
16789
|
}, bt = async () => {
|
|
16788
16790
|
try {
|
|
16789
16791
|
J(!0);
|
|
16790
|
-
const
|
|
16791
|
-
|
|
16792
|
-
} catch (
|
|
16793
|
-
console.error("Failed to create thread:",
|
|
16792
|
+
const ne = await N();
|
|
16793
|
+
ne && (c == null || c(ne), i == null || i(ne));
|
|
16794
|
+
} catch (ne) {
|
|
16795
|
+
console.error("Failed to create thread:", ne);
|
|
16794
16796
|
} finally {
|
|
16795
16797
|
J(!1);
|
|
16796
16798
|
}
|
|
16797
|
-
}, kt = async (
|
|
16799
|
+
}, kt = async (ne, we) => {
|
|
16798
16800
|
if (we.stopPropagation(), !!confirm("Delete this thread?")) {
|
|
16799
16801
|
if (_.current) {
|
|
16800
16802
|
const at = _.current.querySelector("[data-radix-scroll-area-viewport]");
|
|
16801
16803
|
at && (q.current = at.scrollTop);
|
|
16802
16804
|
}
|
|
16803
16805
|
try {
|
|
16804
|
-
await V(
|
|
16806
|
+
await V(ne), d == null || d(ne);
|
|
16805
16807
|
} catch (at) {
|
|
16806
16808
|
console.error("Failed to delete thread:", at);
|
|
16807
16809
|
}
|
|
16808
16810
|
}
|
|
16809
|
-
}, Pt = (
|
|
16810
|
-
we.stopPropagation(), re(
|
|
16811
|
-
},
|
|
16811
|
+
}, Pt = (ne, we) => {
|
|
16812
|
+
we.stopPropagation(), re(ne.threadId), O(ne.title || `Thread ${ne.threadId.slice(0, 8)}`);
|
|
16813
|
+
}, Ce = async (ne) => {
|
|
16812
16814
|
if (U.trim())
|
|
16813
16815
|
try {
|
|
16814
|
-
await W(
|
|
16816
|
+
await W(ne, U.trim()), re(null), O("");
|
|
16815
16817
|
} catch (we) {
|
|
16816
16818
|
console.error("Failed to update title:", we);
|
|
16817
16819
|
}
|
|
16818
16820
|
}, Ge = () => {
|
|
16819
16821
|
re(null), O("");
|
|
16820
|
-
},
|
|
16821
|
-
if (!
|
|
16822
|
+
}, Ee = (ne) => {
|
|
16823
|
+
if (!ne) return "";
|
|
16822
16824
|
try {
|
|
16823
|
-
const we = new Date(
|
|
16825
|
+
const we = new Date(ne), xe = (/* @__PURE__ */ new Date()).getTime() - we.getTime(), Fe = Math.floor(xe / (1e3 * 60 * 60 * 24));
|
|
16824
16826
|
return Fe === 0 ? we.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : Fe === 1 ? "Yesterday" : Fe < 7 ? `${Fe} days ago` : we.toLocaleDateString();
|
|
16825
16827
|
} catch {
|
|
16826
16828
|
return "";
|
|
16827
16829
|
}
|
|
16828
|
-
}, qe = (
|
|
16829
|
-
const we = qe(
|
|
16830
|
+
}, qe = (ne) => ne.title || `Thread ${ne.threadId.slice(0, 8)}`, zt = (ne) => {
|
|
16831
|
+
const we = qe(ne);
|
|
16830
16832
|
return we.length <= Iu ? we : `${we.slice(0, Iu)}...`;
|
|
16831
16833
|
};
|
|
16832
16834
|
return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
@@ -16862,19 +16864,19 @@ function gi({
|
|
|
16862
16864
|
children: Et.label
|
|
16863
16865
|
}
|
|
16864
16866
|
) }),
|
|
16865
|
-
/* @__PURE__ */ u.jsx(Gs, { align: "start", sideOffset: 6, className: "w-40", children:
|
|
16867
|
+
/* @__PURE__ */ u.jsx(Gs, { align: "start", sideOffset: 6, className: "w-40", children: Te.map((ne) => /* @__PURE__ */ u.jsxs(
|
|
16866
16868
|
nr,
|
|
16867
16869
|
{
|
|
16868
16870
|
className: "justify-between text-[12px]",
|
|
16869
16871
|
onClick: (we) => {
|
|
16870
|
-
we.preventDefault(), st(
|
|
16872
|
+
we.preventDefault(), st(ne.key);
|
|
16871
16873
|
},
|
|
16872
16874
|
children: [
|
|
16873
|
-
/* @__PURE__ */ u.jsx("span", { children:
|
|
16874
|
-
He ===
|
|
16875
|
+
/* @__PURE__ */ u.jsx("span", { children: ne.label }),
|
|
16876
|
+
He === ne.key && /* @__PURE__ */ u.jsx(Rs, { className: "h-3 w-3" })
|
|
16875
16877
|
]
|
|
16876
16878
|
},
|
|
16877
|
-
|
|
16879
|
+
ne.key
|
|
16878
16880
|
)) })
|
|
16879
16881
|
] })
|
|
16880
16882
|
] })
|
|
@@ -16893,33 +16895,33 @@ function gi({
|
|
|
16893
16895
|
] }) : vt.length === 0 ? /* @__PURE__ */ u.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
|
|
16894
16896
|
/* @__PURE__ */ u.jsx(Du, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
|
|
16895
16897
|
/* @__PURE__ */ u.jsx("p", { className: "text-sm text-slate-500", children: ut })
|
|
16896
|
-
] }) : vt.slice().sort((
|
|
16898
|
+
] }) : vt.slice().sort((ne, we) => new Date(we.updatedAt || we.createdAt || "").getTime() - new Date(ne.updatedAt || ne.createdAt || "").getTime()).map((ne) => /* @__PURE__ */ u.jsx(
|
|
16897
16899
|
ek,
|
|
16898
16900
|
{
|
|
16899
|
-
thread:
|
|
16900
|
-
isActive: k ===
|
|
16901
|
+
thread: ne,
|
|
16902
|
+
isActive: k === ne.threadId,
|
|
16901
16903
|
editingThreadId: X,
|
|
16902
16904
|
editingTitle: U,
|
|
16903
16905
|
onSelect: pt,
|
|
16904
16906
|
onStartEditing: Pt,
|
|
16905
16907
|
onEditingTitleChange: (we) => O(we),
|
|
16906
|
-
onSaveEditing:
|
|
16908
|
+
onSaveEditing: Ce,
|
|
16907
16909
|
onCancelEditing: Ge,
|
|
16908
|
-
onShare: () => Ke(
|
|
16910
|
+
onShare: () => Ke(ne.threadId),
|
|
16909
16911
|
onDelete: kt,
|
|
16910
16912
|
showEditTitle: r,
|
|
16911
16913
|
showDeleteButton: n,
|
|
16912
|
-
formatDate:
|
|
16914
|
+
formatDate: Ee,
|
|
16913
16915
|
getDisplayThreadTitle: zt,
|
|
16914
|
-
secondaryLine: We && wt(
|
|
16916
|
+
secondaryLine: We && wt(ne) ? _t(ne) : void 0,
|
|
16915
16917
|
itemClassName: s.threadItem,
|
|
16916
16918
|
activeItemClassName: s.activeThread
|
|
16917
16919
|
},
|
|
16918
|
-
|
|
16920
|
+
ne.threadId
|
|
16919
16921
|
)) })
|
|
16920
16922
|
}
|
|
16921
16923
|
),
|
|
16922
|
-
/* @__PURE__ */ u.jsx(rh, { open: le, onOpenChange: (
|
|
16924
|
+
/* @__PURE__ */ u.jsx(rh, { open: le, onOpenChange: (ne) => !ne && Ue(), children: /* @__PURE__ */ u.jsxs(kl, { className: "max-w-md p-0", children: [
|
|
16923
16925
|
/* @__PURE__ */ u.jsx(Rl, { children: /* @__PURE__ */ u.jsx(Il, { children: "Share thread" }) }),
|
|
16924
16926
|
/* @__PURE__ */ u.jsxs(Nh, { children: [
|
|
16925
16927
|
/* @__PURE__ */ u.jsx(
|
|
@@ -16927,7 +16929,7 @@ function gi({
|
|
|
16927
16929
|
{
|
|
16928
16930
|
autoFocus: !0,
|
|
16929
16931
|
value: ie,
|
|
16930
|
-
onValueChange: (
|
|
16932
|
+
onValueChange: (ne) => ge(ne),
|
|
16931
16933
|
placeholder: "Search for recipients..."
|
|
16932
16934
|
}
|
|
16933
16935
|
),
|
|
@@ -16946,10 +16948,10 @@ function gi({
|
|
|
16946
16948
|
/* @__PURE__ */ u.jsx(Xn, { className: "h-4 w-4 animate-spin" }),
|
|
16947
16949
|
"Loading recipients…"
|
|
16948
16950
|
] }) : "No matching recipients found" }),
|
|
16949
|
-
Le.length > 0 && /* @__PURE__ */ u.jsx(Ph, { heading: "Recipients", children: Le.map((
|
|
16950
|
-
/* @__PURE__ */ u.jsx("span", { className: "font-medium", children:
|
|
16951
|
-
|
|
16952
|
-
] }) },
|
|
16951
|
+
Le.length > 0 && /* @__PURE__ */ u.jsx(Ph, { heading: "Recipients", children: Le.map((ne) => /* @__PURE__ */ u.jsx(Mh, { onSelect: () => Ye(ne), children: /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-start text-sm", children: [
|
|
16952
|
+
/* @__PURE__ */ u.jsx("span", { className: "font-medium", children: ne.label }),
|
|
16953
|
+
ne.secondaryLabel && /* @__PURE__ */ u.jsx("span", { className: "text-xs text-muted-foreground", children: ne.secondaryLabel })
|
|
16954
|
+
] }) }, ne.id)) })
|
|
16953
16955
|
] })
|
|
16954
16956
|
] })
|
|
16955
16957
|
] }) })
|
|
@@ -17579,7 +17581,7 @@ var yk = "SelectItemAlignedPosition", fm = h.forwardRef((e, t) => {
|
|
|
17579
17581
|
if (s.trigger && s.valueNode && i && c && g && x && b) {
|
|
17580
17582
|
const E = s.trigger.getBoundingClientRect(), R = c.getBoundingClientRect(), P = s.valueNode.getBoundingClientRect(), D = b.getBoundingClientRect();
|
|
17581
17583
|
if (s.dir !== "rtl") {
|
|
17582
|
-
const le = D.left - R.left, F = P.left - le,
|
|
17584
|
+
const le = D.left - R.left, F = P.left - le, te = E.left - F, ce = E.width + te, ie = Math.max(ce, R.width), ge = window.innerWidth - dn, Te = mi(F, [
|
|
17583
17585
|
dn,
|
|
17584
17586
|
// Prevents the content from going off the starting edge of the
|
|
17585
17587
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -17588,33 +17590,33 @@ var yk = "SelectItemAlignedPosition", fm = h.forwardRef((e, t) => {
|
|
|
17588
17590
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
17589
17591
|
Math.max(dn, ge - ie)
|
|
17590
17592
|
]);
|
|
17591
|
-
i.style.minWidth = ce + "px", i.style.left =
|
|
17593
|
+
i.style.minWidth = ce + "px", i.style.left = Te + "px";
|
|
17592
17594
|
} else {
|
|
17593
|
-
const le = R.right - D.right, F = window.innerWidth - P.right - le,
|
|
17595
|
+
const le = R.right - D.right, F = window.innerWidth - P.right - le, te = window.innerWidth - E.right - F, ce = E.width + te, ie = Math.max(ce, R.width), ge = window.innerWidth - dn, Te = mi(F, [
|
|
17594
17596
|
dn,
|
|
17595
17597
|
Math.max(dn, ge - ie)
|
|
17596
17598
|
]);
|
|
17597
|
-
i.style.minWidth = ce + "px", i.style.right =
|
|
17599
|
+
i.style.minWidth = ce + "px", i.style.right = Te + "px";
|
|
17598
17600
|
}
|
|
17599
17601
|
const B = m(), z = window.innerHeight - dn * 2, L = g.scrollHeight, N = window.getComputedStyle(c), V = parseInt(N.borderTopWidth, 10), W = parseInt(N.paddingTop, 10), $ = parseInt(N.borderBottomWidth, 10), j = parseInt(N.paddingBottom, 10), k = V + W + L + j + $, K = Math.min(x.offsetHeight * 5, k), G = window.getComputedStyle(g), A = parseInt(G.paddingTop, 10), _ = parseInt(G.paddingBottom, 10), q = E.top + E.height / 2 - dn, X = z - q, re = x.offsetHeight / 2, U = x.offsetTop + re, O = V + W + U, Y = k - O;
|
|
17600
17602
|
if (O <= q) {
|
|
17601
17603
|
const le = B.length > 0 && x === B[B.length - 1].ref.current;
|
|
17602
17604
|
i.style.bottom = "0px";
|
|
17603
|
-
const F = c.clientHeight - g.offsetTop - g.offsetHeight,
|
|
17605
|
+
const F = c.clientHeight - g.offsetTop - g.offsetHeight, te = Math.max(
|
|
17604
17606
|
X,
|
|
17605
17607
|
re + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
17606
17608
|
(le ? _ : 0) + F + $
|
|
17607
|
-
), ce = O +
|
|
17609
|
+
), ce = O + te;
|
|
17608
17610
|
i.style.height = ce + "px";
|
|
17609
17611
|
} else {
|
|
17610
17612
|
const le = B.length > 0 && x === B[0].ref.current;
|
|
17611
17613
|
i.style.top = "0px";
|
|
17612
|
-
const
|
|
17614
|
+
const te = Math.max(
|
|
17613
17615
|
q,
|
|
17614
17616
|
V + g.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
17615
17617
|
(le ? A : 0) + re
|
|
17616
17618
|
) + Y;
|
|
17617
|
-
i.style.height =
|
|
17619
|
+
i.style.height = te + "px", g.scrollTop = O - q + g.offsetTop;
|
|
17618
17620
|
}
|
|
17619
17621
|
i.style.margin = `${dn}px 0`, i.style.minHeight = K + "px", i.style.maxHeight = z + "px", r == null || r(), requestAnimationFrame(() => f.current = !0);
|
|
17620
17622
|
}
|
|
@@ -19334,11 +19336,11 @@ function bI(e) {
|
|
|
19334
19336
|
}
|
|
19335
19337
|
var yI = (e) => {
|
|
19336
19338
|
var t, n, r, o, s, a, i, l, c, d, p;
|
|
19337
|
-
let { invert: m, toast: f, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: y, toasts: C, expanded: S, removeToast: T, defaultRichColors: E, closeButton: R, style: P, cancelButtonStyle: D, actionButtonStyle: B, className: z = "", descriptionClassName: L = "", duration: N, position: V, gap: W, loadingIcon: $, expandByDefault: j, classNames: k, icons: K, closeButtonAriaLabel: G = "Close toast", pauseWhenPageIsHidden: A } = e, [_, q] = M.useState(null), [X, re] = M.useState(null), [U, O] = M.useState(!1), [Y, J] = M.useState(!1), [le, F] = M.useState(!1), [
|
|
19339
|
+
let { invert: m, toast: f, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: y, toasts: C, expanded: S, removeToast: T, defaultRichColors: E, closeButton: R, style: P, cancelButtonStyle: D, actionButtonStyle: B, className: z = "", descriptionClassName: L = "", duration: N, position: V, gap: W, loadingIcon: $, expandByDefault: j, classNames: k, icons: K, closeButtonAriaLabel: G = "Close toast", pauseWhenPageIsHidden: A } = e, [_, q] = M.useState(null), [X, re] = M.useState(null), [U, O] = M.useState(!1), [Y, J] = M.useState(!1), [le, F] = M.useState(!1), [te, ce] = M.useState(!1), [ie, ge] = M.useState(!1), [Te, je] = M.useState(0), [De, He] = M.useState(0), st = M.useRef(f.duration || N || ju), Et = M.useRef(null), Ke = M.useRef(null), Ue = y === 0, Ye = y + 1 <= b, Le = f.type, We = f.dismissible !== !1, vt = f.className || "", Mt = f.descriptionClassName || "", ut = M.useMemo(() => w.findIndex((xe) => xe.toastId === f.id) || 0, [w, f.id]), _t = M.useMemo(() => {
|
|
19338
19340
|
var xe;
|
|
19339
19341
|
return (xe = f.closeButton) != null ? xe : R;
|
|
19340
|
-
}, [f.closeButton, R]), wt = M.useMemo(() => f.duration || N || ju, [f.duration, N]), pt = M.useRef(0), bt = M.useRef(0), kt = M.useRef(0), Pt = M.useRef(null), [
|
|
19341
|
-
bt.current = M.useMemo(() => ut * W +
|
|
19342
|
+
}, [f.closeButton, R]), wt = M.useMemo(() => f.duration || N || ju, [f.duration, N]), pt = M.useRef(0), bt = M.useRef(0), kt = M.useRef(0), Pt = M.useRef(null), [Ce, Ge] = V.split("-"), Ee = M.useMemo(() => w.reduce((xe, Fe, Xe) => Xe >= ut ? xe : xe + Fe.height, 0), [w, ut]), qe = sI(), zt = f.invert || m, ne = Le === "loading";
|
|
19343
|
+
bt.current = M.useMemo(() => ut * W + Ee, [ut, Ee]), M.useEffect(() => {
|
|
19342
19344
|
st.current = wt;
|
|
19343
19345
|
}, [wt]), M.useEffect(() => {
|
|
19344
19346
|
O(!0);
|
|
@@ -19380,13 +19382,13 @@ var yI = (e) => {
|
|
|
19380
19382
|
var xe, Fe, Xe;
|
|
19381
19383
|
return K != null && K.loading ? M.createElement("div", { className: un(k == null ? void 0 : k.loader, (xe = f == null ? void 0 : f.classNames) == null ? void 0 : xe.loader, "sonner-loader"), "data-visible": Le === "loading" }, K.loading) : $ ? M.createElement("div", { className: un(k == null ? void 0 : k.loader, (Fe = f == null ? void 0 : f.classNames) == null ? void 0 : Fe.loader, "sonner-loader"), "data-visible": Le === "loading" }, $) : M.createElement(QR, { className: un(k == null ? void 0 : k.loader, (Xe = f == null ? void 0 : f.classNames) == null ? void 0 : Xe.loader), visible: Le === "loading" });
|
|
19382
19384
|
}
|
|
19383
|
-
return M.createElement("li", { tabIndex: 0, ref: Ke, className: un(z, vt, k == null ? void 0 : k.toast, (t = f == null ? void 0 : f.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[Le], (n = f == null ? void 0 : f.classNames) == null ? void 0 : n[Le]), "data-sonner-toast": "", "data-rich-colors": (r = f.richColors) != null ? r : E, "data-styled": !(f.jsx || f.unstyled || v), "data-mounted": U, "data-promise": !!f.promise, "data-swiped": ie, "data-removed": Y, "data-visible": Ye, "data-y-position":
|
|
19385
|
+
return M.createElement("li", { tabIndex: 0, ref: Ke, className: un(z, vt, k == null ? void 0 : k.toast, (t = f == null ? void 0 : f.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[Le], (n = f == null ? void 0 : f.classNames) == null ? void 0 : n[Le]), "data-sonner-toast": "", "data-rich-colors": (r = f.richColors) != null ? r : E, "data-styled": !(f.jsx || f.unstyled || v), "data-mounted": U, "data-promise": !!f.promise, "data-swiped": ie, "data-removed": Y, "data-visible": Ye, "data-y-position": Ce, "data-x-position": Ge, "data-index": y, "data-front": Ue, "data-swiping": le, "data-dismissible": We, "data-type": Le, "data-invert": zt, "data-swipe-out": te, "data-swipe-direction": X, "data-expanded": !!(S || j && U), style: { "--index": y, "--toasts-before": y, "--z-index": C.length - y, "--offset": `${Y ? Te : bt.current}px`, "--initial-height": j ? "auto" : `${De}px`, ...P, ...f.style }, onDragEnd: () => {
|
|
19384
19386
|
F(!1), q(null), Pt.current = null;
|
|
19385
19387
|
}, onPointerDown: (xe) => {
|
|
19386
|
-
|
|
19388
|
+
ne || !We || (Et.current = /* @__PURE__ */ new Date(), je(bt.current), xe.target.setPointerCapture(xe.pointerId), xe.target.tagName !== "BUTTON" && (F(!0), Pt.current = { x: xe.clientX, y: xe.clientY }));
|
|
19387
19389
|
}, onPointerUp: () => {
|
|
19388
19390
|
var xe, Fe, Xe, Rt;
|
|
19389
|
-
if (
|
|
19391
|
+
if (te || !We) return;
|
|
19390
19392
|
Pt.current = null;
|
|
19391
19393
|
let It = Number(((xe = Ke.current) == null ? void 0 : xe.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), At = Number(((Fe = Ke.current) == null ? void 0 : Fe.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), Ot = (/* @__PURE__ */ new Date()).getTime() - ((Xe = Et.current) == null ? void 0 : Xe.getTime()), Ae = _ === "x" ? It : At, gt = Math.abs(Ae) / Ot;
|
|
19392
19394
|
if (Math.abs(Ae) >= vI || gt > 0.11) {
|
|
@@ -19401,7 +19403,7 @@ var yI = (e) => {
|
|
|
19401
19403
|
!_ && (Math.abs(Ot) > 1 || Math.abs(At) > 1) && q(Math.abs(Ot) > Math.abs(At) ? "x" : "y");
|
|
19402
19404
|
let gt = { x: 0, y: 0 };
|
|
19403
19405
|
_ === "y" ? (Ae.includes("top") || Ae.includes("bottom")) && (Ae.includes("top") && At < 0 || Ae.includes("bottom") && At > 0) && (gt.y = At) : _ === "x" && (Ae.includes("left") || Ae.includes("right")) && (Ae.includes("left") && Ot < 0 || Ae.includes("right") && Ot > 0) && (gt.x = Ot), (Math.abs(gt.x) > 0 || Math.abs(gt.y) > 0) && ge(!0), (Rt = Ke.current) == null || Rt.style.setProperty("--swipe-amount-x", `${gt.x}px`), (It = Ke.current) == null || It.style.setProperty("--swipe-amount-y", `${gt.y}px`);
|
|
19404
|
-
} }, _t && !f.jsx ? M.createElement("button", { "aria-label": G, "data-disabled":
|
|
19406
|
+
} }, _t && !f.jsx ? M.createElement("button", { "aria-label": G, "data-disabled": ne, "data-close-button": !0, onClick: ne || !We ? () => {
|
|
19405
19407
|
} : () => {
|
|
19406
19408
|
var xe;
|
|
19407
19409
|
we(), (xe = f.onDismiss) == null || xe.call(f, f);
|