teodor-new-chat-ui 4.3.176 → 4.3.177
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 +141 -141
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2619,7 +2619,7 @@ function So(e) {
|
|
|
2619
2619
|
function _d(e, t) {
|
|
2620
2620
|
if (!il(e)) return null;
|
|
2621
2621
|
const n = e.values ?? { messages: [] }, r = Array.isArray(n == null ? void 0 : n.messages) ? n.messages : [];
|
|
2622
|
-
console.debug(`[historyUtils] normalizeSnapshot - Found ${r.length} raw messages`);
|
|
2622
|
+
console.debug(`[historyUtils] normalizeSnapshot - Found ${r.length} raw messages (${r.length === 0 ? "empty checkpoint (expected for non-latest)" : "has data"})`);
|
|
2623
2623
|
const { messages: o, ...s } = n, i = Object.keys(s).length ? s : null, a = e.tasks, l = Array.isArray(a) ? a.filter((N) => !!N && typeof N == "object").map((N) => ({ ...N })) : a === null ? null : void 0, c = r.map((N, _) => $y(N, _)).filter((N) => !!N);
|
|
2624
2624
|
console.debug(`[historyUtils] normalizeSnapshot - Converted to ${c.length} messages after filtering`), c.length === 0 && r.length > 0 && console.warn("[historyUtils] All messages were filtered out. First raw message:", r[0]);
|
|
2625
2625
|
const d = gn(e.config), f = gn(d == null ? void 0 : d.configurable), h = Wt(f, ["checkpoint_id", "checkpointId"]), p = Wt(f, ["checkpoint_ns", "checkpointNs"]), m = gn(e == null ? void 0 : e.parentConfig), g = gn(m == null ? void 0 : m.configurable), x = Wt(g, ["checkpoint_id", "checkpointId"]) ?? null, y = Wt(g, ["checkpoint_ns", "checkpointNs"]) ?? null, w = e == null ? void 0 : e.createdAt, S = typeof w == "string" && w.trim() ? w : new Date(Date.now() - t).toISOString(), T = c[c.length - 1] ?? null, C = gn(e == null ? void 0 : e.metadata), b = Wt(C, ["branch_label", "branchLabel"]), k = Wt(g, ["checkpoint_id", "checkpointId"]), A = Array.isArray(e.next) ? [...e.next] : (e == null ? void 0 : e.next) === null ? null : void 0;
|
|
@@ -4271,9 +4271,9 @@ function kv({
|
|
|
4271
4271
|
var q;
|
|
4272
4272
|
const E = wt.current;
|
|
4273
4273
|
if (E.size <= Wc) return;
|
|
4274
|
-
const I = Array.from(E.entries()).sort((
|
|
4275
|
-
for (let
|
|
4276
|
-
const ae = (q = I[
|
|
4274
|
+
const I = Array.from(E.entries()).sort((oe, ae) => oe[1].timestamp - ae[1].timestamp), U = E.size - Wc;
|
|
4275
|
+
for (let oe = 0; oe < U; oe++) {
|
|
4276
|
+
const ae = (q = I[oe]) == null ? void 0 : q[0];
|
|
4277
4277
|
ae && E.delete(ae);
|
|
4278
4278
|
}
|
|
4279
4279
|
}, []), Y = fe(
|
|
@@ -4290,7 +4290,7 @@ function kv({
|
|
|
4290
4290
|
[]
|
|
4291
4291
|
), Re = fe(
|
|
4292
4292
|
(E, I) => {
|
|
4293
|
-
const { threadId: U, checkpointId: q = null, checkpointNs:
|
|
4293
|
+
const { threadId: U, checkpointId: q = null, checkpointNs: oe = null } = E, ae = qc(U, q, oe);
|
|
4294
4294
|
if (I != null && I.force)
|
|
4295
4295
|
et.current.delete(ae), wt.current.delete(ae);
|
|
4296
4296
|
else {
|
|
@@ -4308,7 +4308,7 @@ function kv({
|
|
|
4308
4308
|
const De = await c.getStateHistory({
|
|
4309
4309
|
threadId: U,
|
|
4310
4310
|
checkpointId: q ?? void 0,
|
|
4311
|
-
checkpointNs:
|
|
4311
|
+
checkpointNs: oe ?? void 0
|
|
4312
4312
|
}), St = Y(De, U);
|
|
4313
4313
|
if (St)
|
|
4314
4314
|
return { payload: St, usedHistoryApi: !0 };
|
|
@@ -4318,7 +4318,7 @@ function kv({
|
|
|
4318
4318
|
const St = await c.getState({
|
|
4319
4319
|
threadId: U,
|
|
4320
4320
|
checkpointId: q ?? void 0,
|
|
4321
|
-
checkpointNs:
|
|
4321
|
+
checkpointNs: oe ?? void 0
|
|
4322
4322
|
});
|
|
4323
4323
|
return {
|
|
4324
4324
|
payload: {
|
|
@@ -4336,7 +4336,7 @@ function kv({
|
|
|
4336
4336
|
},
|
|
4337
4337
|
[c, Y, Ft]
|
|
4338
4338
|
), ve = fe((E, I) => new Promise((U, q) => {
|
|
4339
|
-
const
|
|
4339
|
+
const oe = async () => {
|
|
4340
4340
|
Xe.current = !0;
|
|
4341
4341
|
try {
|
|
4342
4342
|
await E(), U();
|
|
@@ -4349,7 +4349,7 @@ function kv({
|
|
|
4349
4349
|
});
|
|
4350
4350
|
}
|
|
4351
4351
|
};
|
|
4352
|
-
Xe.current ? st.current.push(
|
|
4352
|
+
Xe.current ? st.current.push(oe) : oe().catch((ae) => {
|
|
4353
4353
|
q(ae);
|
|
4354
4354
|
});
|
|
4355
4355
|
}), []), gt = be(b.length), xt = be(!1), Pt = be(T);
|
|
@@ -4372,15 +4372,15 @@ function kv({
|
|
|
4372
4372
|
const I = (q = c.getAuthToken) == null ? void 0 : q.call(c), U = gt.current > 0;
|
|
4373
4373
|
U || _(!0);
|
|
4374
4374
|
try {
|
|
4375
|
-
const
|
|
4375
|
+
const oe = await c.listThreads();
|
|
4376
4376
|
es(() => {
|
|
4377
4377
|
C((ae) => {
|
|
4378
4378
|
const tt = (St) => St.map((Lt) => `${Lt.threadId}:${Lt.updatedAt ?? ""}:${Lt.messageCount ?? ""}`).join("|"), ft = Zi(ae);
|
|
4379
|
-
return tt(ft) === tt(
|
|
4379
|
+
return tt(ft) === tt(oe) || oe.length === 0 && ft.length > 0 && !xt.current ? ae : os(oe);
|
|
4380
4380
|
});
|
|
4381
4381
|
}), _t.current = I ?? null, P(null), xt.current || (xt.current = !0);
|
|
4382
|
-
} catch (
|
|
4383
|
-
i == null || i(String(
|
|
4382
|
+
} catch (oe) {
|
|
4383
|
+
i == null || i(String(oe)), console.error("[ChatSessionProvider] Failed to refresh threads:", oe), P(String(oe));
|
|
4384
4384
|
} finally {
|
|
4385
4385
|
at.current = !1, U || _(!1);
|
|
4386
4386
|
}
|
|
@@ -4405,7 +4405,7 @@ function kv({
|
|
|
4405
4405
|
(E, I) => {
|
|
4406
4406
|
if (!Or()) return;
|
|
4407
4407
|
qt.current !== null && (window.clearTimeout(qt.current), qt.current = null);
|
|
4408
|
-
const U = E.map((
|
|
4408
|
+
const U = E.map((oe) => `${oe.threadId}:${oe.updatedAt ?? ""}:${oe.messageCount ?? ""}`).join("|");
|
|
4409
4409
|
if (E.length === 0) {
|
|
4410
4410
|
try {
|
|
4411
4411
|
Na(w);
|
|
@@ -4418,8 +4418,8 @@ function kv({
|
|
|
4418
4418
|
return;
|
|
4419
4419
|
const q = () => {
|
|
4420
4420
|
try {
|
|
4421
|
-
const
|
|
4422
|
-
_a(w,
|
|
4421
|
+
const oe = E.slice(0, Aa);
|
|
4422
|
+
_a(w, oe), Kn.current = U;
|
|
4423
4423
|
} catch {
|
|
4424
4424
|
} finally {
|
|
4425
4425
|
qt.current = null;
|
|
@@ -4439,17 +4439,17 @@ function kv({
|
|
|
4439
4439
|
}, [yt, b]), Mt = fe(
|
|
4440
4440
|
(E, I, U, q) => {
|
|
4441
4441
|
var $i;
|
|
4442
|
-
const
|
|
4443
|
-
if (!
|
|
4442
|
+
const oe = U ?? ke.current;
|
|
4443
|
+
if (!oe)
|
|
4444
4444
|
return;
|
|
4445
|
-
const ae = mn(E), tt =
|
|
4445
|
+
const ae = mn(E), tt = oe === ke.current, ft = (q == null ? void 0 : q.persist) !== !1;
|
|
4446
4446
|
if (I === "replace") {
|
|
4447
4447
|
if (ft) {
|
|
4448
4448
|
const Xt = {
|
|
4449
|
-
threadId:
|
|
4449
|
+
threadId: oe,
|
|
4450
4450
|
snapshot: mn(E, { cloneMessages: !0 })
|
|
4451
4451
|
};
|
|
4452
|
-
Ge.current.set(
|
|
4452
|
+
Ge.current.set(oe, Xt), Qe.current = oe;
|
|
4453
4453
|
}
|
|
4454
4454
|
if (!tt)
|
|
4455
4455
|
return;
|
|
@@ -4460,7 +4460,7 @@ function kv({
|
|
|
4460
4460
|
}), D(ae.interrupt ?? null), ue(ae.nextCursor ?? null), Q(!!ae.nextCursor), ee(ae.checkpointId ?? void 0), G(ae.checkpointNs ?? void 0), ce(ae.nextCursorNs ?? void 0);
|
|
4461
4461
|
return;
|
|
4462
4462
|
}
|
|
4463
|
-
const De = Ge.current.get(
|
|
4463
|
+
const De = Ge.current.get(oe), St = (De == null ? void 0 : De.snapshot) ?? null, Lt = Array.isArray(St == null ? void 0 : St.messages) ? St.messages : [], hn = mn(St), Gn = Array.isArray(E == null ? void 0 : E.messages) ? E.messages : [], Yt = /* @__PURE__ */ new Set(), $t = [...Gn, ...Lt].filter((Xt) => {
|
|
4464
4464
|
const zi = Xt == null ? void 0 : Xt.id;
|
|
4465
4465
|
return zi ? Yt.has(zi) ? !1 : (Yt.add(zi), !0) : !0;
|
|
4466
4466
|
}), pn = Dd(hn, ae), Rr = {
|
|
@@ -4478,8 +4478,8 @@ function kv({
|
|
|
4478
4478
|
interrupt: hn.interrupt ?? ae.interrupt ?? null,
|
|
4479
4479
|
...pn
|
|
4480
4480
|
};
|
|
4481
|
-
if (Ge.current.set(
|
|
4482
|
-
threadId:
|
|
4481
|
+
if (Ge.current.set(oe, {
|
|
4482
|
+
threadId: oe,
|
|
4483
4483
|
snapshot: mn(Rr, { cloneMessages: !0 })
|
|
4484
4484
|
}), !tt)
|
|
4485
4485
|
return;
|
|
@@ -4545,8 +4545,8 @@ function kv({
|
|
|
4545
4545
|
};
|
|
4546
4546
|
ke.current !== I && (!ke.current && H.messages.length <= 1 && (Je.current = I), A(I)), es(() => {
|
|
4547
4547
|
C((q) => {
|
|
4548
|
-
const
|
|
4549
|
-
return
|
|
4548
|
+
const oe = q.byId[I];
|
|
4549
|
+
return oe ? oe.title === U.title && oe.updatedAt === U.updatedAt && oe.messageCount === U.messageCount ? q : {
|
|
4550
4550
|
byId: { ...q.byId, [I]: U },
|
|
4551
4551
|
order: q.order
|
|
4552
4552
|
} : {
|
|
@@ -4609,12 +4609,12 @@ function kv({
|
|
|
4609
4609
|
const E = ke.current;
|
|
4610
4610
|
if (!E)
|
|
4611
4611
|
return null;
|
|
4612
|
-
const I = he.current, U = H.lastCheckpointId ?? (I == null ? void 0 : I.lastCheckpointId) ?? null, q = H.lastCheckpointNs ?? (I == null ? void 0 : I.lastCheckpointNs) ?? null,
|
|
4613
|
-
return U && (
|
|
4612
|
+
const I = he.current, U = H.lastCheckpointId ?? (I == null ? void 0 : I.lastCheckpointId) ?? null, q = H.lastCheckpointNs ?? (I == null ? void 0 : I.lastCheckpointNs) ?? null, oe = {};
|
|
4613
|
+
return U && (oe.checkpointId = U), q && (oe.checkpointNs = q), {
|
|
4614
4614
|
threadId: E,
|
|
4615
4615
|
checkpointId: U,
|
|
4616
4616
|
checkpointNs: q,
|
|
4617
|
-
command: { kind: "resume", value:
|
|
4617
|
+
command: { kind: "resume", value: oe }
|
|
4618
4618
|
};
|
|
4619
4619
|
}, [H.lastCheckpointId, H.lastCheckpointNs]), kr = fe(
|
|
4620
4620
|
(E) => {
|
|
@@ -4714,26 +4714,26 @@ function kv({
|
|
|
4714
4714
|
var q;
|
|
4715
4715
|
const E = c.getAuthToken();
|
|
4716
4716
|
Me(E);
|
|
4717
|
-
const I = (
|
|
4718
|
-
const tt = Xi(h,
|
|
4717
|
+
const I = (oe, ae = !1) => {
|
|
4718
|
+
const tt = Xi(h, oe), ft = Rt.current !== tt;
|
|
4719
4719
|
ft && (Rt.current = tt, zt.current = !1), S(tt);
|
|
4720
4720
|
const De = Ji(tt);
|
|
4721
4721
|
es(() => {
|
|
4722
4722
|
ae && ft || C(os(De));
|
|
4723
|
-
}),
|
|
4723
|
+
}), oe && !zt.current && (zt.current = !0);
|
|
4724
4724
|
};
|
|
4725
4725
|
I(E);
|
|
4726
|
-
const U = (q = c.onTokenChange) == null ? void 0 : q.call(c, (
|
|
4727
|
-
if (
|
|
4726
|
+
const U = (q = c.onTokenChange) == null ? void 0 : q.call(c, (oe) => {
|
|
4727
|
+
if (oe !== E) {
|
|
4728
4728
|
const ae = _t.current;
|
|
4729
|
-
if (at.current ||
|
|
4729
|
+
if (at.current || oe === ae) {
|
|
4730
4730
|
console.debug(
|
|
4731
4731
|
"[ChatSessionProvider] Skipping refresh on token from listThreads (in-flight or just completed)",
|
|
4732
|
-
{ isRefreshing: at.current, isKnownToken:
|
|
4733
|
-
), Me(
|
|
4732
|
+
{ isRefreshing: at.current, isKnownToken: oe === ae }
|
|
4733
|
+
), Me(oe);
|
|
4734
4734
|
return;
|
|
4735
4735
|
}
|
|
4736
|
-
Me(
|
|
4736
|
+
Me(oe), y(), et.current.clear(), wt.current.clear(), I(oe, !0), Et.current !== null && window.clearTimeout(Et.current), Et.current = window.setTimeout(() => {
|
|
4737
4737
|
Et.current = null, Kt().catch((ft) => {
|
|
4738
4738
|
console.warn("[ChatSessionProvider] Background thread refresh after token rotation failed:", ft);
|
|
4739
4739
|
});
|
|
@@ -4754,12 +4754,12 @@ function kv({
|
|
|
4754
4754
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4755
4755
|
messageCount: 0
|
|
4756
4756
|
};
|
|
4757
|
-
C((
|
|
4758
|
-
byId: { ...
|
|
4759
|
-
order: [I, ...
|
|
4757
|
+
C((oe) => ({
|
|
4758
|
+
byId: { ...oe.byId, [I]: U },
|
|
4759
|
+
order: [I, ...oe.order]
|
|
4760
4760
|
})), A(I);
|
|
4761
4761
|
try {
|
|
4762
|
-
const
|
|
4762
|
+
const oe = await c.createThread(E), ae = typeof oe == "string" ? oe : oe.threadId;
|
|
4763
4763
|
return C((tt) => {
|
|
4764
4764
|
const ft = tt.byId[I];
|
|
4765
4765
|
if (!ft) return tt;
|
|
@@ -4768,14 +4768,14 @@ function kv({
|
|
|
4768
4768
|
const St = tt.order.map((Lt) => Lt === I ? ae : Lt);
|
|
4769
4769
|
return { byId: De, order: St };
|
|
4770
4770
|
}), A(ae), setTimeout(() => Kt(), 10), P(null), ae;
|
|
4771
|
-
} catch (
|
|
4771
|
+
} catch (oe) {
|
|
4772
4772
|
throw C((ae) => {
|
|
4773
4773
|
if (!ae.byId[I]) return ae;
|
|
4774
4774
|
const tt = { ...ae.byId };
|
|
4775
4775
|
delete tt[I];
|
|
4776
4776
|
const ft = ae.order.filter((De) => De !== I);
|
|
4777
4777
|
return { byId: tt, order: ft };
|
|
4778
|
-
}), A(null), P(String(
|
|
4778
|
+
}), A(null), P(String(oe)), oe;
|
|
4779
4779
|
}
|
|
4780
4780
|
},
|
|
4781
4781
|
[c, Kt]
|
|
@@ -4788,7 +4788,7 @@ function kv({
|
|
|
4788
4788
|
if (!U.byId[E]) return U;
|
|
4789
4789
|
const q = { ...U.byId };
|
|
4790
4790
|
delete q[E];
|
|
4791
|
-
const
|
|
4791
|
+
const oe = U.order.filter((tt) => tt !== E), ae = { byId: q, order: oe };
|
|
4792
4792
|
return I = Zi(ae), ae;
|
|
4793
4793
|
}), I && yt(I, { immediate: !0 }), on(E), ke.current === E && (Je.current = E, A(null), ke.current = null, Qe.current = null, Dt()), await Kt(), P(null);
|
|
4794
4794
|
} catch (I) {
|
|
@@ -4908,14 +4908,14 @@ function kv({
|
|
|
4908
4908
|
async (E, I) => {
|
|
4909
4909
|
const U = ke.current;
|
|
4910
4910
|
if (!U) throw new Error("No active thread");
|
|
4911
|
-
const q = Jr(E, I ?? null),
|
|
4912
|
-
if (
|
|
4913
|
-
await ve(async () => {
|
|
4914
|
-
Mt(
|
|
4911
|
+
const q = Jr(E, I ?? null), oe = Bt(U, q);
|
|
4912
|
+
if (oe && oe.hasMessages) {
|
|
4913
|
+
console.debug(`[ChatSessionProvider] Using cached snapshot for checkpoint ${E} (has ${oe.messagesLen} messages)`), await ve(async () => {
|
|
4914
|
+
Mt(oe, "replace", U, { persist: !1 });
|
|
4915
4915
|
}, `navigateToCheckpoint-${U}-${q}`);
|
|
4916
4916
|
return;
|
|
4917
4917
|
}
|
|
4918
|
-
await dr(U, E, I ?? void 0, !0);
|
|
4918
|
+
console.debug(`[ChatSessionProvider] Checkpoint ${E} not in cache or empty, fetching full data...`), await dr(U, E, I ?? void 0, !0);
|
|
4919
4919
|
},
|
|
4920
4920
|
[Mt, ve, Bt, dr]
|
|
4921
4921
|
), ac = fe(async () => {
|
|
@@ -4933,9 +4933,9 @@ function kv({
|
|
|
4933
4933
|
threadId: I,
|
|
4934
4934
|
checkpointId: E ?? Ee ?? null,
|
|
4935
4935
|
checkpointNs: ie ?? L ?? null
|
|
4936
|
-
}), { latest: q, checkpoints:
|
|
4937
|
-
let ft =
|
|
4938
|
-
if (ft && tt && tt.size > 0 && (ft =
|
|
4936
|
+
}), { latest: q, checkpoints: oe, snapshots: ae } = So(U.payload), tt = Ke(I);
|
|
4937
|
+
let ft = oe.length > 0;
|
|
4938
|
+
if (ft && tt && tt.size > 0 && (ft = oe.some((De) => {
|
|
4939
4939
|
if (!(De != null && De.checkpointId))
|
|
4940
4940
|
return !1;
|
|
4941
4941
|
const St = Jr(De.checkpointId, De.checkpointNs ?? null);
|
|
@@ -4944,7 +4944,7 @@ function kv({
|
|
|
4944
4944
|
ue(null), ce(void 0), Q(!1), j(null);
|
|
4945
4945
|
return;
|
|
4946
4946
|
}
|
|
4947
|
-
if (Mt(q, "prepend", I ?? void 0), I && (Jt(I,
|
|
4947
|
+
if (Mt(q, "prepend", I ?? void 0), I && (Jt(I, oe, "prepend"), Zt(I, ae, "prepend"), !U.usedHistoryApi))
|
|
4948
4948
|
try {
|
|
4949
4949
|
const De = await Ot(I);
|
|
4950
4950
|
Qt(I, De);
|
|
@@ -4994,7 +4994,7 @@ function kv({
|
|
|
4994
4994
|
), go = fe(
|
|
4995
4995
|
async (E, I) => {
|
|
4996
4996
|
var un;
|
|
4997
|
-
const U = ke.current, q = (E == null ? void 0 : E.text) ?? "",
|
|
4997
|
+
const U = ke.current, q = (E == null ? void 0 : E.text) ?? "", oe = (E == null ? void 0 : E.attachments) ?? [], ae = oe.length ? oe : (I == null ? void 0 : I.attachments) ?? [], tt = E == null ? void 0 : E.messageAdditionalKwargs, ft = {
|
|
4998
4998
|
...(I == null ? void 0 : I.payloadExtras) ?? {},
|
|
4999
4999
|
...(E == null ? void 0 : E.payload) ?? {}
|
|
5000
5000
|
};
|
|
@@ -5062,7 +5062,7 @@ function kv({
|
|
|
5062
5062
|
async (E, I, U) => {
|
|
5063
5063
|
if (!ke.current)
|
|
5064
5064
|
throw new Error("No active thread to handle interrupt");
|
|
5065
|
-
const
|
|
5065
|
+
const oe = I ? U ?? !0 : !1;
|
|
5066
5066
|
try {
|
|
5067
5067
|
try {
|
|
5068
5068
|
Ve({ type: "interrupt_response", payload: { interruptId: E } });
|
|
@@ -5074,7 +5074,7 @@ function kv({
|
|
|
5074
5074
|
{
|
|
5075
5075
|
checkpointId: H.lastCheckpointId ?? void 0,
|
|
5076
5076
|
checkpointNs: H.lastCheckpointNs ?? void 0,
|
|
5077
|
-
command: { kind: "resume", value:
|
|
5077
|
+
command: { kind: "resume", value: oe }
|
|
5078
5078
|
}
|
|
5079
5079
|
), D(null);
|
|
5080
5080
|
} catch (ae) {
|
|
@@ -5117,14 +5117,14 @@ function kv({
|
|
|
5117
5117
|
nextCursor: Z ?? null,
|
|
5118
5118
|
nextCursorNs: ie ?? null,
|
|
5119
5119
|
interrupt: H.pendingInterrupt ?? W ?? null
|
|
5120
|
-
}), U = Ge.current.get(E), q = U == null ? void 0 : U.snapshot,
|
|
5120
|
+
}), U = Ge.current.get(E), q = U == null ? void 0 : U.snapshot, oe = !q || q.messages.length !== I.messages.length || q.messages.some((De, St) => {
|
|
5121
5121
|
var Lt;
|
|
5122
5122
|
return (De == null ? void 0 : De.id) !== ((Lt = I.messages[St]) == null ? void 0 : Lt.id);
|
|
5123
5123
|
}), ae = ((q == null ? void 0 : q.checkpointId) ?? null) !== I.checkpointId || ((q == null ? void 0 : q.checkpointNs) ?? null) !== I.checkpointNs, tt = ((q == null ? void 0 : q.nextCursor) ?? null) !== I.nextCursor || ((q == null ? void 0 : q.nextCursorNs) ?? null) !== I.nextCursorNs, ft = !Kc(
|
|
5124
5124
|
(q == null ? void 0 : q.interrupt) ?? null,
|
|
5125
5125
|
I.interrupt ?? null
|
|
5126
5126
|
);
|
|
5127
|
-
if (
|
|
5127
|
+
if (oe || ae || tt || ft) {
|
|
5128
5128
|
const De = {
|
|
5129
5129
|
threadId: E,
|
|
5130
5130
|
snapshot: I
|
|
@@ -5285,7 +5285,7 @@ function Qi({
|
|
|
5285
5285
|
}
|
|
5286
5286
|
) });
|
|
5287
5287
|
}
|
|
5288
|
-
function
|
|
5288
|
+
function se(...e) {
|
|
5289
5289
|
return Ug(Hg(e));
|
|
5290
5290
|
}
|
|
5291
5291
|
const Ev = ti(
|
|
@@ -5318,7 +5318,7 @@ const Ev = ti(
|
|
|
5318
5318
|
return /* @__PURE__ */ u.jsx(
|
|
5319
5319
|
i,
|
|
5320
5320
|
{
|
|
5321
|
-
className:
|
|
5321
|
+
className: se(Ev({ variant: t, size: n, className: e })),
|
|
5322
5322
|
ref: s,
|
|
5323
5323
|
...o
|
|
5324
5324
|
}
|
|
@@ -5330,7 +5330,7 @@ const Bd = v.forwardRef(
|
|
|
5330
5330
|
({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
5331
5331
|
"textarea",
|
|
5332
5332
|
{
|
|
5333
|
-
className:
|
|
5333
|
+
className: se(
|
|
5334
5334
|
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
5335
5335
|
e
|
|
5336
5336
|
),
|
|
@@ -9010,7 +9010,7 @@ const IS = kS, NS = RS, AS = v.forwardRef(({ className: e, inset: t, children: n
|
|
|
9010
9010
|
Th,
|
|
9011
9011
|
{
|
|
9012
9012
|
ref: o,
|
|
9013
|
-
className:
|
|
9013
|
+
className: se(
|
|
9014
9014
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
9015
9015
|
t && "pl-8",
|
|
9016
9016
|
e
|
|
@@ -9027,7 +9027,7 @@ const _S = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
9027
9027
|
kh,
|
|
9028
9028
|
{
|
|
9029
9029
|
ref: n,
|
|
9030
|
-
className:
|
|
9030
|
+
className: se(
|
|
9031
9031
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
9032
9032
|
e
|
|
9033
9033
|
),
|
|
@@ -9040,7 +9040,7 @@ const Rh = v.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
|
|
|
9040
9040
|
{
|
|
9041
9041
|
ref: r,
|
|
9042
9042
|
sideOffset: t,
|
|
9043
|
-
className:
|
|
9043
|
+
className: se(
|
|
9044
9044
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
9045
9045
|
e
|
|
9046
9046
|
),
|
|
@@ -9052,7 +9052,7 @@ const $a = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
9052
9052
|
vh,
|
|
9053
9053
|
{
|
|
9054
9054
|
ref: r,
|
|
9055
|
-
className:
|
|
9055
|
+
className: se(
|
|
9056
9056
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
9057
9057
|
t && "pl-8",
|
|
9058
9058
|
e
|
|
@@ -9065,7 +9065,7 @@ const jS = v.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
|
|
|
9065
9065
|
wh,
|
|
9066
9066
|
{
|
|
9067
9067
|
ref: o,
|
|
9068
|
-
className:
|
|
9068
|
+
className: se(
|
|
9069
9069
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
9070
9070
|
e
|
|
9071
9071
|
),
|
|
@@ -9082,7 +9082,7 @@ const PS = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
9082
9082
|
bh,
|
|
9083
9083
|
{
|
|
9084
9084
|
ref: r,
|
|
9085
|
-
className:
|
|
9085
|
+
className: se(
|
|
9086
9086
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
9087
9087
|
e
|
|
9088
9088
|
),
|
|
@@ -9098,7 +9098,7 @@ const OS = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
9098
9098
|
yh,
|
|
9099
9099
|
{
|
|
9100
9100
|
ref: r,
|
|
9101
|
-
className:
|
|
9101
|
+
className: se(
|
|
9102
9102
|
"px-2 py-1.5 text-sm font-semibold",
|
|
9103
9103
|
t && "pl-8",
|
|
9104
9104
|
e
|
|
@@ -9111,7 +9111,7 @@ const MS = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
9111
9111
|
Ch,
|
|
9112
9112
|
{
|
|
9113
9113
|
ref: n,
|
|
9114
|
-
className:
|
|
9114
|
+
className: se("-mx-1 my-1 h-px bg-muted", e),
|
|
9115
9115
|
...t
|
|
9116
9116
|
}
|
|
9117
9117
|
));
|
|
@@ -12294,13 +12294,13 @@ const uT = ti(
|
|
|
12294
12294
|
}
|
|
12295
12295
|
);
|
|
12296
12296
|
function ip({ className: e, variant: t, ...n }) {
|
|
12297
|
-
return /* @__PURE__ */ u.jsx("div", { className:
|
|
12297
|
+
return /* @__PURE__ */ u.jsx("div", { className: se(uT({ variant: t }), e), ...n });
|
|
12298
12298
|
}
|
|
12299
12299
|
const Ro = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
12300
12300
|
"div",
|
|
12301
12301
|
{
|
|
12302
12302
|
ref: n,
|
|
12303
|
-
className:
|
|
12303
|
+
className: se(
|
|
12304
12304
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
12305
12305
|
e
|
|
12306
12306
|
),
|
|
@@ -12312,7 +12312,7 @@ const Eo = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12312
12312
|
"div",
|
|
12313
12313
|
{
|
|
12314
12314
|
ref: n,
|
|
12315
|
-
className:
|
|
12315
|
+
className: se("flex flex-col space-y-1.5 p-6", e),
|
|
12316
12316
|
...t
|
|
12317
12317
|
}
|
|
12318
12318
|
));
|
|
@@ -12321,7 +12321,7 @@ const Io = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12321
12321
|
"h3",
|
|
12322
12322
|
{
|
|
12323
12323
|
ref: n,
|
|
12324
|
-
className:
|
|
12324
|
+
className: se(
|
|
12325
12325
|
"text-2xl font-semibold leading-none tracking-tight",
|
|
12326
12326
|
e
|
|
12327
12327
|
),
|
|
@@ -12333,18 +12333,18 @@ const ap = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12333
12333
|
"p",
|
|
12334
12334
|
{
|
|
12335
12335
|
ref: n,
|
|
12336
|
-
className:
|
|
12336
|
+
className: se("text-sm text-muted-foreground", e),
|
|
12337
12337
|
...t
|
|
12338
12338
|
}
|
|
12339
12339
|
));
|
|
12340
12340
|
ap.displayName = "CardDescription";
|
|
12341
|
-
const No = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className:
|
|
12341
|
+
const No = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className: se("p-6 pt-0", e), ...t }));
|
|
12342
12342
|
No.displayName = "CardContent";
|
|
12343
12343
|
const lp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
12344
12344
|
"div",
|
|
12345
12345
|
{
|
|
12346
12346
|
ref: n,
|
|
12347
|
-
className:
|
|
12347
|
+
className: se("flex items-center p-6 pt-0", e),
|
|
12348
12348
|
...t
|
|
12349
12349
|
}
|
|
12350
12350
|
));
|
|
@@ -12787,7 +12787,7 @@ const AT = Ep, _T = Ip, Ap = v.forwardRef(({ className: e, ...t }, n) => /* @__P
|
|
|
12787
12787
|
Ii,
|
|
12788
12788
|
{
|
|
12789
12789
|
ref: n,
|
|
12790
|
-
className:
|
|
12790
|
+
className: se(
|
|
12791
12791
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
12792
12792
|
e
|
|
12793
12793
|
),
|
|
@@ -12817,7 +12817,7 @@ const _p = v.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
|
12817
12817
|
Ni,
|
|
12818
12818
|
{
|
|
12819
12819
|
ref: r,
|
|
12820
|
-
className:
|
|
12820
|
+
className: se(
|
|
12821
12821
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
12822
12822
|
e
|
|
12823
12823
|
),
|
|
@@ -12841,7 +12841,7 @@ const jp = ({
|
|
|
12841
12841
|
}) => /* @__PURE__ */ u.jsx(
|
|
12842
12842
|
"div",
|
|
12843
12843
|
{
|
|
12844
|
-
className:
|
|
12844
|
+
className: se(
|
|
12845
12845
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
12846
12846
|
e
|
|
12847
12847
|
),
|
|
@@ -12853,7 +12853,7 @@ const Pp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12853
12853
|
_r,
|
|
12854
12854
|
{
|
|
12855
12855
|
ref: n,
|
|
12856
|
-
className:
|
|
12856
|
+
className: se(
|
|
12857
12857
|
"text-lg font-semibold leading-none tracking-tight",
|
|
12858
12858
|
e
|
|
12859
12859
|
),
|
|
@@ -12865,7 +12865,7 @@ const jT = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
12865
12865
|
Ai,
|
|
12866
12866
|
{
|
|
12867
12867
|
ref: n,
|
|
12868
|
-
className:
|
|
12868
|
+
className: se("text-sm text-muted-foreground", e),
|
|
12869
12869
|
...t
|
|
12870
12870
|
}
|
|
12871
12871
|
));
|
|
@@ -14574,7 +14574,7 @@ function Gs({
|
|
|
14574
14574
|
return /* @__PURE__ */ u.jsx(
|
|
14575
14575
|
"div",
|
|
14576
14576
|
{
|
|
14577
|
-
className:
|
|
14577
|
+
className: se(
|
|
14578
14578
|
"markdown prose prose-sm max-w-none break-words",
|
|
14579
14579
|
// In dark mode, use prose-invert for better contrast in dark bubbles
|
|
14580
14580
|
"dark:prose-invert",
|
|
@@ -14653,7 +14653,7 @@ function tk({ className: e }) {
|
|
|
14653
14653
|
"span",
|
|
14654
14654
|
{
|
|
14655
14655
|
"aria-live": "polite",
|
|
14656
|
-
className:
|
|
14656
|
+
className: se("inline-block text-xs opacity-70 ml-1", e),
|
|
14657
14657
|
children: [
|
|
14658
14658
|
"Is thinking",
|
|
14659
14659
|
".".repeat(t)
|
|
@@ -14749,7 +14749,7 @@ const qu = V.memo(function({
|
|
|
14749
14749
|
}, [p, t.id, ne, ot, ie, t]), st = V.useCallback(() => {
|
|
14750
14750
|
m == null || m(n);
|
|
14751
14751
|
}, [m, n]), Ze = V.useCallback(() => {
|
|
14752
|
-
const Re =
|
|
14752
|
+
const Re = se(D ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", G);
|
|
14753
14753
|
switch (F) {
|
|
14754
14754
|
case "user":
|
|
14755
14755
|
return /* @__PURE__ */ u.jsx(kg, { className: Re });
|
|
@@ -14764,21 +14764,21 @@ const qu = V.memo(function({
|
|
|
14764
14764
|
const Y = "group relative mb-4 flex w-full";
|
|
14765
14765
|
switch (F) {
|
|
14766
14766
|
case "user":
|
|
14767
|
-
return
|
|
14767
|
+
return se(Y, "justify-end");
|
|
14768
14768
|
case "assistant":
|
|
14769
14769
|
case "tool":
|
|
14770
14770
|
case "system":
|
|
14771
|
-
return
|
|
14771
|
+
return se(Y, "justify-start");
|
|
14772
14772
|
default:
|
|
14773
14773
|
return Y;
|
|
14774
14774
|
}
|
|
14775
14775
|
}, [F]), Ge = V.useCallback(() => {
|
|
14776
|
-
const Y =
|
|
14776
|
+
const Y = se(
|
|
14777
14777
|
"rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
|
|
14778
14778
|
D && "px-3 py-2 text-sm"
|
|
14779
14779
|
);
|
|
14780
14780
|
if (ge)
|
|
14781
|
-
return
|
|
14781
|
+
return se(
|
|
14782
14782
|
Y,
|
|
14783
14783
|
"w-full",
|
|
14784
14784
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
@@ -14786,25 +14786,25 @@ const qu = V.memo(function({
|
|
|
14786
14786
|
);
|
|
14787
14787
|
switch (F) {
|
|
14788
14788
|
case "user":
|
|
14789
|
-
return
|
|
14789
|
+
return se(
|
|
14790
14790
|
Y,
|
|
14791
14791
|
"w-full md:max-w-[95%]",
|
|
14792
14792
|
"bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
|
|
14793
14793
|
"border border-transparent"
|
|
14794
14794
|
);
|
|
14795
14795
|
case "assistant":
|
|
14796
|
-
return
|
|
14796
|
+
return se(
|
|
14797
14797
|
Y,
|
|
14798
14798
|
"w-full md:max-w-[95%]",
|
|
14799
14799
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
14800
14800
|
"border border-border/60 dark:border-border/40"
|
|
14801
14801
|
);
|
|
14802
14802
|
case "tool":
|
|
14803
|
-
return
|
|
14803
|
+
return se(Y, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
|
|
14804
14804
|
case "system":
|
|
14805
|
-
return
|
|
14805
|
+
return se(Y, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
|
|
14806
14806
|
default:
|
|
14807
|
-
return
|
|
14807
|
+
return se(
|
|
14808
14808
|
Y,
|
|
14809
14809
|
"w-full md:max-w-[95%]",
|
|
14810
14810
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
@@ -14813,9 +14813,9 @@ const qu = V.memo(function({
|
|
|
14813
14813
|
}
|
|
14814
14814
|
}, [D, ge, F]);
|
|
14815
14815
|
if (ge && Q)
|
|
14816
|
-
return /* @__PURE__ */ u.jsx("div", { className:
|
|
14816
|
+
return /* @__PURE__ */ u.jsx("div", { className: se(Je(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: se(Ge(), h.content), children: [
|
|
14817
14817
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
|
|
14818
|
-
/* @__PURE__ */ u.jsx(Bi, { className:
|
|
14818
|
+
/* @__PURE__ */ u.jsx(Bi, { className: se("h-4 w-4", G) }),
|
|
14819
14819
|
a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
|
|
14820
14820
|
] }),
|
|
14821
14821
|
/* @__PURE__ */ u.jsx(
|
|
@@ -15002,11 +15002,11 @@ const qu = V.memo(function({
|
|
|
15002
15002
|
return `${ve}`;
|
|
15003
15003
|
}, []);
|
|
15004
15004
|
return ne && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
15005
|
-
/* @__PURE__ */ u.jsx("div", { className:
|
|
15005
|
+
/* @__PURE__ */ u.jsx("div", { className: se(Je(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: se(Ge(), h.content), children: [
|
|
15006
15006
|
(i || a || ne) && /* @__PURE__ */ u.jsxs(
|
|
15007
15007
|
"div",
|
|
15008
15008
|
{
|
|
15009
|
-
className:
|
|
15009
|
+
className: se(
|
|
15010
15010
|
"flex items-center justify-between mb-2 pb-2 border-b border-current/10",
|
|
15011
15011
|
D && "mb-1 pb-1",
|
|
15012
15012
|
G,
|
|
@@ -15015,12 +15015,12 @@ const qu = V.memo(function({
|
|
|
15015
15015
|
children: [
|
|
15016
15016
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
15017
15017
|
Ze(),
|
|
15018
|
-
a && At && /* @__PURE__ */ u.jsx("span", { className:
|
|
15018
|
+
a && At && /* @__PURE__ */ u.jsx("span", { className: se("font-medium", D ? "text-xs" : "text-sm"), children: At }),
|
|
15019
15019
|
ne && /* @__PURE__ */ u.jsxs(
|
|
15020
15020
|
ip,
|
|
15021
15021
|
{
|
|
15022
15022
|
variant: "outline",
|
|
15023
|
-
className:
|
|
15023
|
+
className: se(
|
|
15024
15024
|
"text-xs flex items-center gap-1 cursor-pointer select-none",
|
|
15025
15025
|
G,
|
|
15026
15026
|
"border border-current/40",
|
|
@@ -15047,7 +15047,7 @@ const qu = V.memo(function({
|
|
|
15047
15047
|
"button",
|
|
15048
15048
|
{
|
|
15049
15049
|
type: "button",
|
|
15050
|
-
className:
|
|
15050
|
+
className: se(
|
|
15051
15051
|
"flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
|
|
15052
15052
|
Ke > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
15053
15053
|
),
|
|
@@ -15073,7 +15073,7 @@ const qu = V.memo(function({
|
|
|
15073
15073
|
"button",
|
|
15074
15074
|
{
|
|
15075
15075
|
type: "button",
|
|
15076
|
-
className:
|
|
15076
|
+
className: se(
|
|
15077
15077
|
"flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
|
|
15078
15078
|
Ke < it.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
15079
15079
|
),
|
|
@@ -15091,7 +15091,7 @@ const qu = V.memo(function({
|
|
|
15091
15091
|
i && t.createdAt && /* @__PURE__ */ u.jsx(
|
|
15092
15092
|
"time",
|
|
15093
15093
|
{
|
|
15094
|
-
className:
|
|
15094
|
+
className: se("text-xs opacity-60", G, D && "text-xs"),
|
|
15095
15095
|
dateTime: new Date(t.createdAt).toISOString(),
|
|
15096
15096
|
title: new Date(t.createdAt).toLocaleString(),
|
|
15097
15097
|
children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(t.createdAt))
|
|
@@ -15100,7 +15100,7 @@ const qu = V.memo(function({
|
|
|
15100
15100
|
s && !o && /* @__PURE__ */ u.jsxs(
|
|
15101
15101
|
"div",
|
|
15102
15102
|
{
|
|
15103
|
-
className:
|
|
15103
|
+
className: se(
|
|
15104
15104
|
"opacity-0 group-hover:opacity-100 transition-opacity",
|
|
15105
15105
|
"flex items-center gap-1",
|
|
15106
15106
|
h.actions
|
|
@@ -15112,10 +15112,10 @@ const qu = V.memo(function({
|
|
|
15112
15112
|
variant: "ghost",
|
|
15113
15113
|
size: "sm",
|
|
15114
15114
|
onClick: () => ke(),
|
|
15115
|
-
className:
|
|
15115
|
+
className: se("h-6 w-6 p-0 hover:bg-foreground/10", G, D && "h-5 w-5"),
|
|
15116
15116
|
"aria-label": "Copy message",
|
|
15117
15117
|
title: "Copy message",
|
|
15118
|
-
children: /* @__PURE__ */ u.jsx(hc, { className:
|
|
15118
|
+
children: /* @__PURE__ */ u.jsx(hc, { className: se(_ ? "text-success" : G, D ? "h-3 w-3" : "h-4 w-4") })
|
|
15119
15119
|
}
|
|
15120
15120
|
) }),
|
|
15121
15121
|
F === "user" && p && /* @__PURE__ */ u.jsx(
|
|
@@ -15124,9 +15124,9 @@ const qu = V.memo(function({
|
|
|
15124
15124
|
variant: "ghost",
|
|
15125
15125
|
size: "sm",
|
|
15126
15126
|
onClick: Xe,
|
|
15127
|
-
className:
|
|
15127
|
+
className: se("h-6 w-6 p-0 hover:bg-foreground/10", G, D && "h-5 w-5"),
|
|
15128
15128
|
"aria-label": "Edit message",
|
|
15129
|
-
children: /* @__PURE__ */ u.jsx(pc, { className:
|
|
15129
|
+
children: /* @__PURE__ */ u.jsx(pc, { className: se(G, D ? "h-3 w-3" : "h-4 w-4") })
|
|
15130
15130
|
}
|
|
15131
15131
|
),
|
|
15132
15132
|
F === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
@@ -15135,9 +15135,9 @@ const qu = V.memo(function({
|
|
|
15135
15135
|
variant: "ghost",
|
|
15136
15136
|
size: "sm",
|
|
15137
15137
|
onClick: st,
|
|
15138
|
-
className:
|
|
15138
|
+
className: se("h-6 w-6 p-0 hover:bg-foreground/10", G, D && "h-5 w-5"),
|
|
15139
15139
|
"aria-label": "Regenerate response",
|
|
15140
|
-
children: /* @__PURE__ */ u.jsx(va, { className:
|
|
15140
|
+
children: /* @__PURE__ */ u.jsx(va, { className: se(G, D ? "h-3 w-3" : "h-4 w-4") })
|
|
15141
15141
|
}
|
|
15142
15142
|
)
|
|
15143
15143
|
]
|
|
@@ -15148,7 +15148,7 @@ const qu = V.memo(function({
|
|
|
15148
15148
|
}
|
|
15149
15149
|
),
|
|
15150
15150
|
/* @__PURE__ */ u.jsx("div", { className: "relative", children: wt() }),
|
|
15151
|
-
ne && $ === "expanded" && (ce.toolCallId || ce.name) && /* @__PURE__ */ u.jsxs("div", { className:
|
|
15151
|
+
ne && $ === "expanded" && (ce.toolCallId || ce.name) && /* @__PURE__ */ u.jsxs("div", { className: se("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", D && "text-xs"), children: [
|
|
15152
15152
|
ce.name && /* @__PURE__ */ u.jsxs("div", { children: [
|
|
15153
15153
|
"Function: ",
|
|
15154
15154
|
ce.name
|
|
@@ -15161,7 +15161,7 @@ const qu = V.memo(function({
|
|
|
15161
15161
|
!(i || a || ne) && s && !o && /* @__PURE__ */ u.jsxs(
|
|
15162
15162
|
"div",
|
|
15163
15163
|
{
|
|
15164
|
-
className:
|
|
15164
|
+
className: se(
|
|
15165
15165
|
"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
15166
15166
|
"flex items-center gap-1",
|
|
15167
15167
|
h.actions
|
|
@@ -15173,8 +15173,8 @@ const qu = V.memo(function({
|
|
|
15173
15173
|
variant: "ghost",
|
|
15174
15174
|
size: "sm",
|
|
15175
15175
|
onClick: () => ke(),
|
|
15176
|
-
className:
|
|
15177
|
-
children: /* @__PURE__ */ u.jsx(hc, { className:
|
|
15176
|
+
className: se("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
|
|
15177
|
+
children: /* @__PURE__ */ u.jsx(hc, { className: se(_ ? "text-success" : "text-current", D ? "h-3 w-3" : "h-4 w-4") })
|
|
15178
15178
|
}
|
|
15179
15179
|
),
|
|
15180
15180
|
F === "user" && p && /* @__PURE__ */ u.jsx(
|
|
@@ -15183,8 +15183,8 @@ const qu = V.memo(function({
|
|
|
15183
15183
|
variant: "ghost",
|
|
15184
15184
|
size: "sm",
|
|
15185
15185
|
onClick: Xe,
|
|
15186
|
-
className:
|
|
15187
|
-
children: /* @__PURE__ */ u.jsx(pc, { className:
|
|
15186
|
+
className: se("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
|
|
15187
|
+
children: /* @__PURE__ */ u.jsx(pc, { className: se("text-current", D ? "h-3 w-3" : "h-4 w-4") })
|
|
15188
15188
|
}
|
|
15189
15189
|
),
|
|
15190
15190
|
F === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
@@ -15193,8 +15193,8 @@ const qu = V.memo(function({
|
|
|
15193
15193
|
variant: "ghost",
|
|
15194
15194
|
size: "sm",
|
|
15195
15195
|
onClick: st,
|
|
15196
|
-
className:
|
|
15197
|
-
children: /* @__PURE__ */ u.jsx(va, { className:
|
|
15196
|
+
className: se("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
|
|
15197
|
+
children: /* @__PURE__ */ u.jsx(va, { className: se("text-current", D ? "h-3 w-3" : "h-4 w-4") })
|
|
15198
15198
|
}
|
|
15199
15199
|
)
|
|
15200
15200
|
]
|
|
@@ -15251,7 +15251,7 @@ function nk({
|
|
|
15251
15251
|
return /* @__PURE__ */ u.jsxs(
|
|
15252
15252
|
Ro,
|
|
15253
15253
|
{
|
|
15254
|
-
className:
|
|
15254
|
+
className: se(
|
|
15255
15255
|
"border-blue-200 dark:border-blue-800 bg-blue-50/50 dark:bg-blue-950/10 transition-shadow",
|
|
15256
15256
|
o ? "shadow-md ring-1 ring-blue-300 dark:ring-blue-500/70" : "opacity-80"
|
|
15257
15257
|
),
|
|
@@ -15369,10 +15369,10 @@ function ok({
|
|
|
15369
15369
|
}) {
|
|
15370
15370
|
const s = Math.max(e.length - r, 0), i = e.substring(0, r);
|
|
15371
15371
|
return /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
15372
|
-
/* @__PURE__ */ u.jsx("div", { className:
|
|
15372
|
+
/* @__PURE__ */ u.jsx("div", { className: se("text-sm text-[hsl(var(--chat-bubble-user-text))]", o && "text-xs"), children: t ? /* @__PURE__ */ u.jsx(Gs, { content: e, allowHtml: !1 }) : /* @__PURE__ */ u.jsxs(
|
|
15373
15373
|
"pre",
|
|
15374
15374
|
{
|
|
15375
|
-
className:
|
|
15375
|
+
className: se(
|
|
15376
15376
|
"font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]",
|
|
15377
15377
|
o && "text-xs"
|
|
15378
15378
|
),
|
|
@@ -16318,7 +16318,7 @@ const Ys = v.forwardRef(
|
|
|
16318
16318
|
"input",
|
|
16319
16319
|
{
|
|
16320
16320
|
type: t,
|
|
16321
|
-
className:
|
|
16321
|
+
className: se(
|
|
16322
16322
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
16323
16323
|
e
|
|
16324
16324
|
),
|
|
@@ -16846,7 +16846,7 @@ const rm = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
16846
16846
|
nm,
|
|
16847
16847
|
{
|
|
16848
16848
|
ref: r,
|
|
16849
|
-
className:
|
|
16849
|
+
className: se("relative overflow-hidden", e),
|
|
16850
16850
|
...n,
|
|
16851
16851
|
children: [
|
|
16852
16852
|
/* @__PURE__ */ u.jsx(yk, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
|
|
@@ -16861,7 +16861,7 @@ const om = v.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
|
|
|
16861
16861
|
{
|
|
16862
16862
|
ref: r,
|
|
16863
16863
|
orientation: t,
|
|
16864
|
-
className:
|
|
16864
|
+
className: se(
|
|
16865
16865
|
"flex touch-none select-none transition-colors",
|
|
16866
16866
|
t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
16867
16867
|
t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -17155,7 +17155,7 @@ const Rk = ti(
|
|
|
17155
17155
|
um,
|
|
17156
17156
|
{
|
|
17157
17157
|
ref: n,
|
|
17158
|
-
className:
|
|
17158
|
+
className: se(Rk(), e),
|
|
17159
17159
|
...t
|
|
17160
17160
|
}
|
|
17161
17161
|
));
|
|
@@ -17284,7 +17284,7 @@ var xm = fm, _k = pm;
|
|
|
17284
17284
|
const hr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
17285
17285
|
xm,
|
|
17286
17286
|
{
|
|
17287
|
-
className:
|
|
17287
|
+
className: se(
|
|
17288
17288
|
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
17289
17289
|
e
|
|
17290
17290
|
),
|
|
@@ -17293,7 +17293,7 @@ const hr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17293
17293
|
children: /* @__PURE__ */ u.jsx(
|
|
17294
17294
|
_k,
|
|
17295
17295
|
{
|
|
17296
|
-
className:
|
|
17296
|
+
className: se(
|
|
17297
17297
|
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
17298
17298
|
)
|
|
17299
17299
|
}
|
|
@@ -18133,7 +18133,7 @@ const Qu = tR, ed = nR, Za = v.forwardRef(({ className: e, children: t, ...n },
|
|
|
18133
18133
|
qm,
|
|
18134
18134
|
{
|
|
18135
18135
|
ref: r,
|
|
18136
|
-
className:
|
|
18136
|
+
className: se(
|
|
18137
18137
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
18138
18138
|
e
|
|
18139
18139
|
),
|
|
@@ -18149,7 +18149,7 @@ const eg = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18149
18149
|
Jm,
|
|
18150
18150
|
{
|
|
18151
18151
|
ref: n,
|
|
18152
|
-
className:
|
|
18152
|
+
className: se(
|
|
18153
18153
|
"flex cursor-default items-center justify-center py-1",
|
|
18154
18154
|
e
|
|
18155
18155
|
),
|
|
@@ -18162,7 +18162,7 @@ const tg = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18162
18162
|
Zm,
|
|
18163
18163
|
{
|
|
18164
18164
|
ref: n,
|
|
18165
|
-
className:
|
|
18165
|
+
className: se(
|
|
18166
18166
|
"flex cursor-default items-center justify-center py-1",
|
|
18167
18167
|
e
|
|
18168
18168
|
),
|
|
@@ -18175,7 +18175,7 @@ const Qa = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
18175
18175
|
Gm,
|
|
18176
18176
|
{
|
|
18177
18177
|
ref: o,
|
|
18178
|
-
className:
|
|
18178
|
+
className: se(
|
|
18179
18179
|
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
18180
18180
|
n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
18181
18181
|
e
|
|
@@ -18187,7 +18187,7 @@ const Qa = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
18187
18187
|
/* @__PURE__ */ u.jsx(
|
|
18188
18188
|
sR,
|
|
18189
18189
|
{
|
|
18190
|
-
className:
|
|
18190
|
+
className: se(
|
|
18191
18191
|
"p-1",
|
|
18192
18192
|
n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
18193
18193
|
),
|
|
@@ -18203,7 +18203,7 @@ const lR = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18203
18203
|
Ym,
|
|
18204
18204
|
{
|
|
18205
18205
|
ref: n,
|
|
18206
|
-
className:
|
|
18206
|
+
className: se("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
18207
18207
|
...t
|
|
18208
18208
|
}
|
|
18209
18209
|
));
|
|
@@ -18212,7 +18212,7 @@ const Er = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
18212
18212
|
Xm,
|
|
18213
18213
|
{
|
|
18214
18214
|
ref: r,
|
|
18215
|
-
className:
|
|
18215
|
+
className: se(
|
|
18216
18216
|
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
18217
18217
|
e
|
|
18218
18218
|
),
|
|
@@ -18228,7 +18228,7 @@ const cR = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18228
18228
|
Qm,
|
|
18229
18229
|
{
|
|
18230
18230
|
ref: n,
|
|
18231
|
-
className:
|
|
18231
|
+
className: se("-mx-1 my-1 h-px bg-muted", e),
|
|
18232
18232
|
...t
|
|
18233
18233
|
}
|
|
18234
18234
|
));
|
|
@@ -18257,7 +18257,7 @@ const og = v.forwardRef(
|
|
|
18257
18257
|
ref: o,
|
|
18258
18258
|
decorative: n,
|
|
18259
18259
|
orientation: t,
|
|
18260
|
-
className:
|
|
18260
|
+
className: se(
|
|
18261
18261
|
"shrink-0 bg-border",
|
|
18262
18262
|
t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
18263
18263
|
e
|
|
@@ -18270,7 +18270,7 @@ og.displayName = rg.displayName;
|
|
|
18270
18270
|
const hR = Ep, pR = NT, mR = Ip, sg = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
18271
18271
|
Ii,
|
|
18272
18272
|
{
|
|
18273
|
-
className:
|
|
18273
|
+
className: se(
|
|
18274
18274
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
18275
18275
|
e
|
|
18276
18276
|
),
|
|
@@ -18300,7 +18300,7 @@ const gR = ti(
|
|
|
18300
18300
|
Ni,
|
|
18301
18301
|
{
|
|
18302
18302
|
ref: o,
|
|
18303
|
-
className:
|
|
18303
|
+
className: se(gR({ side: e }), t),
|
|
18304
18304
|
...r,
|
|
18305
18305
|
children: [
|
|
18306
18306
|
n,
|
|
@@ -18319,7 +18319,7 @@ const ag = ({
|
|
|
18319
18319
|
}) => /* @__PURE__ */ u.jsx(
|
|
18320
18320
|
"div",
|
|
18321
18321
|
{
|
|
18322
|
-
className:
|
|
18322
|
+
className: se(
|
|
18323
18323
|
"flex flex-col space-y-2 text-center sm:text-left",
|
|
18324
18324
|
e
|
|
18325
18325
|
),
|
|
@@ -18331,7 +18331,7 @@ const lg = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18331
18331
|
_r,
|
|
18332
18332
|
{
|
|
18333
18333
|
ref: n,
|
|
18334
|
-
className:
|
|
18334
|
+
className: se("text-lg font-semibold text-foreground", e),
|
|
18335
18335
|
...t
|
|
18336
18336
|
}
|
|
18337
18337
|
));
|
|
@@ -18340,7 +18340,7 @@ const cg = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
18340
18340
|
Ai,
|
|
18341
18341
|
{
|
|
18342
18342
|
ref: n,
|
|
18343
|
-
className:
|
|
18343
|
+
className: se("text-sm text-muted-foreground", e),
|
|
18344
18344
|
...t
|
|
18345
18345
|
}
|
|
18346
18346
|
));
|