@factorialco/f0-react 6.90.0 → 6.90.1
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/{ChatPdfThumbnail-fgWjO4FR.js → ChatPdfThumbnail-BBLoNRzx.js} +1 -1
- package/dist/{CoachmarkProvider-DapfXmFz.js → CoachmarkProvider-BihrzJrI.js} +9258 -9216
- package/dist/{DocumentToolbar-HaFkdnUm.js → DocumentToolbar-BPU7u7xp.js} +2 -2
- package/dist/{DocxViewer-B9t0m281.js → DocxViewer-5nxhV65q.js} +2 -2
- package/dist/{F0AiProcessingOverlay-osUG6362.js → F0AiProcessingOverlay-CIBXF0aA.js} +356 -353
- package/dist/{F0CanvasPanel-Dtc7dfno.js → F0CanvasPanel-BYk37H3S.js} +6782 -6770
- package/dist/{F0VideoPlayer-Bo3mtwsY.js → F0VideoPlayer-ivv-8jRS.js} +1 -1
- package/dist/{LocationMap-DL8tH3eN.js → LocationMap-CbpTo6lL.js} +1 -1
- package/dist/{SheetViewer-D9vdb9iE.js → SheetViewer-CV0Ent0I.js} +2 -2
- package/dist/{TextViewer-BF2KFkTF.js → TextViewer-BEga3Kzi.js} +2 -2
- package/dist/ai.d.ts +1 -0
- package/dist/ai.js +2 -2
- package/dist/component-status.js +1 -1
- package/dist/{experimental-CdbvaHnA.js → experimental-pTgiu7wP.js} +14136 -14080
- package/dist/experimental.d.ts +24 -11
- package/dist/experimental.js +3 -3
- package/dist/f0.d.ts +42 -37
- package/dist/f0.js +4236 -4188
- package/dist/i18n-provider-defaults.d.ts +1 -0
- package/dist/i18n-provider-defaults.js +1 -0
- package/dist/index-Bl4ay97j.js +4 -0
- package/dist/{index-Dk9HOdOi.js → index-Dlhnh5G9.js} +3 -3
- package/dist/{pdfWorker-B06lOcCa.js → pdfWorker-v27ENNlj.js} +2 -2
- package/package.json +2 -2
- package/dist/index-BtYreoci.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t, Fragment as F1 } from "react/jsx-runtime";
|
|
2
2
|
import { useInsertionEffect as _r, forwardRef as m, useRef as $, useEffect as z, useLayoutEffect as re, useState as I, useMemo as X, useId as U1, useCallback as _, createContext as z1, useContext as $1, createElement as jr, memo as Or } from "react";
|
|
3
|
-
import { X as Zr, Y as Ur, Z as zr, _ as ft, $ as Gr, a0 as Wr, a1 as qr, a2 as Xr, a3 as Yr, a4 as Kr, a5 as ht, a6 as Qr, a7 as Jr, a8 as ne, a9 as en, aa as tn, ab as rn, ac as nn, ad as on, ae as sn, af as an, ag as ln, y as Ct, ah as cn, ai as dn, aj as un, o as oe, ak as pt, al as G1, n as mt, am as fn, an as hn, ao as Cn, ap as pn, aq as mn, ar as gn, as as N1, at as wn, au as gt, av as vn, aw as Ln, l as R1, ax as xn, ay as bn, az as wt, aA as kn, aB as yn, aC as Mn, aD as Rn, aE as Fn, aF as Nn, aG as vt, aH as Sn, aI as Vn, aJ as Tn, aK as Hn, aL as An, aM as En, aN as $n, aO as Bn, aP as In, aQ as Pn, aR as Dn, aS as _n, E as jn, aT as On, aU as Zn, aV as Un, aW as zn, aX as Gn, aY as Wn, aZ as qn, a_ as Xn, a$ as Yn, b0 as Kn, b1 as Qn, b2 as Jn, b3 as eo, b4 as to, b5 as ro, b6 as no, b7 as oo, b8 as so, U as Lt, b9 as ao, ba as io, bb as lo, bc as co, bd as xt, R as bt, be as uo, i as fo, bf as ho, bg as Co, bh as po, bi as mo, bj as go, bk as kt, bl as wo, bm as vo, bn as Lo, bo as xo, bp as bo, bq as ko, j as yo, br as yt, bs as Mt, bt as Mo, bu as Rt, bv as Ro, bw as se, q as Fo, bx as ae, by as No, bz as So, bA as ie, O as Vo, Q as To, bB as Ft, bC as Ho, bD as Ao, bE as Eo, bF as $o, bG as Bo, bH as Io, bI as Po, bJ as Do, bK as _o, bL as jo, bM as Nt, bN as Oo, bO as Zo, bP as Uo, bQ as zo, u as G, bR as r1, bS as Go, S as u1, bT as St, V as n1, bU as Wo, m as w1, bV as qo, bW as o1, bX as C1, bY as L1, bZ as Y, b_ as Vt, t as le, b$ as Xo, x as ce, b as y1, c0 as Yo, c1 as Ko, c2 as Qo, d as Tt, c3 as Jo, c4 as es, c5 as de, c6 as ts, c7 as rs, c8 as ns, c9 as He, ca as os, cb as Ht, cc as At, cd as ss, ce as as, cf as is, cg as ls, ch as cs, ci as Et, cj as ds, ck as us, cl as fs, cm as E1, cn as $t, co as Bt, cp as It, c as J1, cq as Ae, cr as Pt, cs as hs, ct as Cs, cu as B1, cv as ps, cw as ms, cx as gs, cy as ue, cz as ws, cA as vs, cB as Ls, cC as xs, cD as bs, cE as ks, w as ys, s as Ms, cF as K1, v as Dt, cG as Rs, cH as Fs, cI as Ee, cJ as _t, cK as jt, cL as Ns, cM as Ss, cN as Vs, cO as Ts, cP as Hs, cQ as As } from "./F0CanvasPanel-
|
|
3
|
+
import { X as Zr, Y as Ur, Z as zr, _ as ft, $ as Gr, a0 as Wr, a1 as qr, a2 as Xr, a3 as Yr, a4 as Kr, a5 as ht, a6 as Qr, a7 as Jr, a8 as ne, a9 as en, aa as tn, ab as rn, ac as nn, ad as on, ae as sn, af as an, ag as ln, y as Ct, ah as cn, ai as dn, aj as un, o as oe, ak as pt, al as G1, n as mt, am as fn, an as hn, ao as Cn, ap as pn, aq as mn, ar as gn, as as N1, at as wn, au as gt, av as vn, aw as Ln, l as R1, ax as xn, ay as bn, az as wt, aA as kn, aB as yn, aC as Mn, aD as Rn, aE as Fn, aF as Nn, aG as vt, aH as Sn, aI as Vn, aJ as Tn, aK as Hn, aL as An, aM as En, aN as $n, aO as Bn, aP as In, aQ as Pn, aR as Dn, aS as _n, E as jn, aT as On, aU as Zn, aV as Un, aW as zn, aX as Gn, aY as Wn, aZ as qn, a_ as Xn, a$ as Yn, b0 as Kn, b1 as Qn, b2 as Jn, b3 as eo, b4 as to, b5 as ro, b6 as no, b7 as oo, b8 as so, U as Lt, b9 as ao, ba as io, bb as lo, bc as co, bd as xt, R as bt, be as uo, i as fo, bf as ho, bg as Co, bh as po, bi as mo, bj as go, bk as kt, bl as wo, bm as vo, bn as Lo, bo as xo, bp as bo, bq as ko, j as yo, br as yt, bs as Mt, bt as Mo, bu as Rt, bv as Ro, bw as se, q as Fo, bx as ae, by as No, bz as So, bA as ie, O as Vo, Q as To, bB as Ft, bC as Ho, bD as Ao, bE as Eo, bF as $o, bG as Bo, bH as Io, bI as Po, bJ as Do, bK as _o, bL as jo, bM as Nt, bN as Oo, bO as Zo, bP as Uo, bQ as zo, u as G, bR as r1, bS as Go, S as u1, bT as St, V as n1, bU as Wo, m as w1, bV as qo, bW as o1, bX as C1, bY as L1, bZ as Y, b_ as Vt, t as le, b$ as Xo, x as ce, b as y1, c0 as Yo, c1 as Ko, c2 as Qo, d as Tt, c3 as Jo, c4 as es, c5 as de, c6 as ts, c7 as rs, c8 as ns, c9 as He, ca as os, cb as Ht, cc as At, cd as ss, ce as as, cf as is, cg as ls, ch as cs, ci as Et, cj as ds, ck as us, cl as fs, cm as E1, cn as $t, co as Bt, cp as It, c as J1, cq as Ae, cr as Pt, cs as hs, ct as Cs, cu as B1, cv as ps, cw as ms, cx as gs, cy as ue, cz as ws, cA as vs, cB as Ls, cC as xs, cD as bs, cE as ks, w as ys, s as Ms, cF as K1, v as Dt, cG as Rs, cH as Fs, cI as Ee, cJ as _t, cK as jt, cL as Ns, cM as Ss, cN as Vs, cO as Ts, cP as Hs, cQ as As } from "./F0CanvasPanel-BYk37H3S.js";
|
|
4
4
|
import { d as b, f as f1, u as Es } from "./tooltip-CMBdJvJA.js";
|
|
5
5
|
import { createPortal as Ot } from "react-dom";
|
|
6
6
|
import { defaultTranslations as $s } from "./i18n-provider-defaults.js";
|
|
@@ -4108,8 +4108,8 @@ const D0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4108
4108
|
variant: "outline",
|
|
4109
4109
|
size: "md",
|
|
4110
4110
|
disabled: o || g === "transcribing",
|
|
4111
|
-
onClick: (
|
|
4112
|
-
|
|
4111
|
+
onClick: (R) => {
|
|
4112
|
+
R.preventDefault(), c.current?.click();
|
|
4113
4113
|
}
|
|
4114
4114
|
}
|
|
4115
4115
|
),
|
|
@@ -4133,7 +4133,7 @@ const D0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4133
4133
|
"div",
|
|
4134
4134
|
{
|
|
4135
4135
|
className: "min-w-0 cursor-default",
|
|
4136
|
-
onClick: (
|
|
4136
|
+
onClick: (R) => R.stopPropagation(),
|
|
4137
4137
|
children: r
|
|
4138
4138
|
}
|
|
4139
4139
|
)
|
|
@@ -4427,23 +4427,26 @@ const R2 = ({
|
|
|
4427
4427
|
}
|
|
4428
4428
|
if (s)
|
|
4429
4429
|
return u(!1), c(w), v(), C.current = setTimeout(() => {
|
|
4430
|
-
const
|
|
4431
|
-
l(
|
|
4430
|
+
const L = (d + 1) % Math.max(e.length, 1);
|
|
4431
|
+
l(L);
|
|
4432
4432
|
}, 4e3), () => {
|
|
4433
4433
|
v();
|
|
4434
4434
|
};
|
|
4435
4435
|
u(!0), c("");
|
|
4436
4436
|
let p = 0;
|
|
4437
|
-
const k = 50,
|
|
4437
|
+
const k = 50, R = 30, H = 2e3, T = 1e3, S = () => {
|
|
4438
|
+
h.current = setInterval(() => {
|
|
4439
|
+
p > 0 ? (p--, c(w.slice(0, p))) : (h.current && (clearInterval(h.current), h.current = null), C.current = setTimeout(() => {
|
|
4440
|
+
const L = (d + 1) % Math.max(e.length, 1);
|
|
4441
|
+
l(L);
|
|
4442
|
+
}, T));
|
|
4443
|
+
}, R);
|
|
4444
|
+
};
|
|
4438
4445
|
return g.current = setInterval(() => {
|
|
4439
|
-
p < w.length ? (c(w.slice(0, p + 1)), p++) : (g.current && (clearInterval(g.current), g.current = null), C.current = setTimeout(
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
l(R);
|
|
4444
|
-
}, T));
|
|
4445
|
-
}, F);
|
|
4446
|
-
}, H));
|
|
4446
|
+
p < w.length ? (c(w.slice(0, p + 1)), p++) : (g.current && (clearInterval(g.current), g.current = null), C.current = setTimeout(
|
|
4447
|
+
S,
|
|
4448
|
+
H
|
|
4449
|
+
));
|
|
4447
4450
|
}, k), () => {
|
|
4448
4451
|
v();
|
|
4449
4452
|
};
|
|
@@ -4711,8 +4714,8 @@ const D2 = ({
|
|
|
4711
4714
|
"aria-haspopup": "dialog",
|
|
4712
4715
|
"aria-expanded": c === k,
|
|
4713
4716
|
"aria-controls": c === k ? h : void 0,
|
|
4714
|
-
onClick: (
|
|
4715
|
-
C.current =
|
|
4717
|
+
onClick: (R) => {
|
|
4718
|
+
C.current = R.currentTarget, g.current = !1, d((H) => H === k ? null : k), n?.(null);
|
|
4716
4719
|
}
|
|
4717
4720
|
},
|
|
4718
4721
|
`${p.label}-${k}`
|
|
@@ -4761,8 +4764,8 @@ const D2 = ({
|
|
|
4761
4764
|
{
|
|
4762
4765
|
item: p,
|
|
4763
4766
|
onHover: n,
|
|
4764
|
-
onSelect: (
|
|
4765
|
-
r(p, v), g.current = document.activeElement ===
|
|
4767
|
+
onSelect: (R) => {
|
|
4768
|
+
r(p, v), g.current = document.activeElement === R.currentTarget, d(null), n?.(null);
|
|
4766
4769
|
}
|
|
4767
4770
|
},
|
|
4768
4771
|
k
|
|
@@ -4913,15 +4916,15 @@ function z2(e) {
|
|
|
4913
4916
|
);
|
|
4914
4917
|
return;
|
|
4915
4918
|
}
|
|
4916
|
-
const
|
|
4919
|
+
const S = T.map((V) => ({
|
|
4917
4920
|
id: crypto.randomUUID(),
|
|
4918
4921
|
file: V,
|
|
4919
4922
|
status: "uploading"
|
|
4920
|
-
})),
|
|
4921
|
-
n((V) => [...V, ...
|
|
4923
|
+
})), L = new Set(S.map((V) => V.id));
|
|
4924
|
+
n((V) => [...V, ...S]);
|
|
4922
4925
|
const E = (V) => n(
|
|
4923
4926
|
(P) => P.map(
|
|
4924
|
-
(
|
|
4927
|
+
(F) => L.has(F.id) ? { ...F, status: "error", errorMessage: V } : F
|
|
4925
4928
|
)
|
|
4926
4929
|
);
|
|
4927
4930
|
try {
|
|
@@ -4931,14 +4934,14 @@ function z2(e) {
|
|
|
4931
4934
|
return;
|
|
4932
4935
|
}
|
|
4933
4936
|
n(
|
|
4934
|
-
(P) => P.map((
|
|
4935
|
-
const
|
|
4936
|
-
return
|
|
4937
|
-
...
|
|
4937
|
+
(P) => P.map((F) => {
|
|
4938
|
+
const N = S.findIndex((B) => B.id === F.id);
|
|
4939
|
+
return N === -1 ? F : V[N] ? {
|
|
4940
|
+
...F,
|
|
4938
4941
|
status: "uploaded",
|
|
4939
|
-
uploadedFile: V[
|
|
4942
|
+
uploadedFile: V[N]
|
|
4940
4943
|
} : {
|
|
4941
|
-
...
|
|
4944
|
+
...F,
|
|
4942
4945
|
status: "error",
|
|
4943
4946
|
errorMessage: d.ai.fileUploadError
|
|
4944
4947
|
};
|
|
@@ -4963,8 +4966,8 @@ function z2(e) {
|
|
|
4963
4966
|
},
|
|
4964
4967
|
[v]
|
|
4965
4968
|
), k = _((H) => {
|
|
4966
|
-
n((T) => T.filter((
|
|
4967
|
-
}, []),
|
|
4969
|
+
n((T) => T.filter((S) => S.id !== H));
|
|
4970
|
+
}, []), R = _(() => {
|
|
4968
4971
|
n([]);
|
|
4969
4972
|
}, []);
|
|
4970
4973
|
return {
|
|
@@ -4977,7 +4980,7 @@ function z2(e) {
|
|
|
4977
4980
|
processFiles: v,
|
|
4978
4981
|
handleFileSelect: p,
|
|
4979
4982
|
handleRemoveFile: k,
|
|
4980
|
-
clearFiles:
|
|
4983
|
+
clearFiles: R,
|
|
4981
4984
|
transientError: o,
|
|
4982
4985
|
showTransientError: w
|
|
4983
4986
|
};
|
|
@@ -5062,60 +5065,60 @@ function Y2({
|
|
|
5062
5065
|
searchPersons: o,
|
|
5063
5066
|
textareaRef: s
|
|
5064
5067
|
}) {
|
|
5065
|
-
const [a, c] = I(!1), [d, l] = I(""), [f, u] = I([]), [C, g] = I(!1), [h, w] = I(0), [v, p] = I([]), k = $(-1),
|
|
5068
|
+
const [a, c] = I(!1), [d, l] = I(""), [f, u] = I([]), [C, g] = I(!1), [h, w] = I(0), [v, p] = I([]), k = $(-1), R = $(null), H = $(0), T = $(-1);
|
|
5066
5069
|
z(() => {
|
|
5067
5070
|
if (!o) {
|
|
5068
5071
|
c(!1);
|
|
5069
5072
|
return;
|
|
5070
5073
|
}
|
|
5071
|
-
const
|
|
5072
|
-
if (!
|
|
5074
|
+
const N = G2(e, n, v);
|
|
5075
|
+
if (!N) {
|
|
5073
5076
|
c(!1), l(""), u([]), w(0), k.current = -1, T.current = -1;
|
|
5074
5077
|
return;
|
|
5075
5078
|
}
|
|
5076
|
-
if (
|
|
5079
|
+
if (N.atIndex === T.current)
|
|
5077
5080
|
return;
|
|
5078
|
-
k.current =
|
|
5081
|
+
k.current = N.atIndex, l(N.query), c(!0), w(0), g(!0), R.current && clearTimeout(R.current);
|
|
5079
5082
|
const B = ++H.current;
|
|
5080
|
-
return
|
|
5081
|
-
o(
|
|
5082
|
-
B === H.current && (u(j), w(0), j.length === 0 &&
|
|
5083
|
+
return R.current = setTimeout(() => {
|
|
5084
|
+
o(N.query).then((j) => {
|
|
5085
|
+
B === H.current && (u(j), w(0), j.length === 0 && N.query.length > 0 && (T.current = N.atIndex, c(!1)));
|
|
5083
5086
|
}).catch(() => {
|
|
5084
5087
|
B === H.current && u([]);
|
|
5085
5088
|
}).finally(() => {
|
|
5086
5089
|
B === H.current && g(!1);
|
|
5087
5090
|
});
|
|
5088
5091
|
}, X2), () => {
|
|
5089
|
-
|
|
5092
|
+
R.current && clearTimeout(R.current);
|
|
5090
5093
|
};
|
|
5091
5094
|
}, [e, n, o, v]);
|
|
5092
|
-
const
|
|
5095
|
+
const S = _(() => {
|
|
5093
5096
|
c(!1), l(""), u([]), w(0), k.current = -1;
|
|
5094
|
-
}, []),
|
|
5095
|
-
(
|
|
5097
|
+
}, []), L = _(
|
|
5098
|
+
(N) => {
|
|
5096
5099
|
const B = k.current;
|
|
5097
5100
|
if (B === -1)
|
|
5098
5101
|
return;
|
|
5099
|
-
const j = `${
|
|
5100
|
-
r(K), p((s1) => [...s1.filter((c1) => !(c1.id === O && c1.name === j)), { id: O, name: j }]),
|
|
5102
|
+
const j = `${N.firstName} ${N.lastName}`.trim(), O = String(N.id), W = e.slice(0, B), e1 = e.slice(n), t1 = `@${j} `, K = W + t1 + e1, Q = W.length + t1.length;
|
|
5103
|
+
r(K), p((s1) => [...s1.filter((c1) => !(c1.id === O && c1.name === j)), { id: O, name: j }]), S(), requestAnimationFrame(() => {
|
|
5101
5104
|
const s1 = s.current;
|
|
5102
5105
|
s1 && (s1.focus(), s1.setSelectionRange(Q, Q));
|
|
5103
5106
|
});
|
|
5104
5107
|
},
|
|
5105
|
-
[e, n, r, s,
|
|
5108
|
+
[e, n, r, s, S]
|
|
5106
5109
|
), E = _(
|
|
5107
|
-
(
|
|
5110
|
+
(N) => {
|
|
5108
5111
|
if (!a)
|
|
5109
5112
|
return !1;
|
|
5110
|
-
if (
|
|
5111
|
-
return
|
|
5113
|
+
if (N.key === "Escape")
|
|
5114
|
+
return N.preventDefault(), S(), !0;
|
|
5112
5115
|
if (f.length === 0)
|
|
5113
5116
|
return !1;
|
|
5114
|
-
switch (
|
|
5117
|
+
switch (N.key) {
|
|
5115
5118
|
case "ArrowDown":
|
|
5116
|
-
return
|
|
5119
|
+
return N.preventDefault(), w((B) => (B + 1) % f.length), !0;
|
|
5117
5120
|
case "ArrowUp":
|
|
5118
|
-
return
|
|
5121
|
+
return N.preventDefault(), w(
|
|
5119
5122
|
(B) => (B + f.length - 1) % f.length
|
|
5120
5123
|
), !0;
|
|
5121
5124
|
case "Tab": {
|
|
@@ -5123,22 +5126,22 @@ function Y2({
|
|
|
5123
5126
|
if (B) {
|
|
5124
5127
|
const j = `${B.firstName} ${B.lastName}`.trim();
|
|
5125
5128
|
if (d.length === 0 || j.toLowerCase().startsWith(d.toLowerCase()))
|
|
5126
|
-
return
|
|
5129
|
+
return N.preventDefault(), L(B), !0;
|
|
5127
5130
|
}
|
|
5128
5131
|
return !1;
|
|
5129
5132
|
}
|
|
5130
5133
|
case "Enter":
|
|
5131
|
-
return
|
|
5134
|
+
return N.preventDefault(), f[h] && L(f[h]), !0;
|
|
5132
5135
|
default:
|
|
5133
5136
|
return !1;
|
|
5134
5137
|
}
|
|
5135
5138
|
},
|
|
5136
|
-
[a, f, h, d,
|
|
5139
|
+
[a, f, h, d, L, S]
|
|
5137
5140
|
), V = _(
|
|
5138
|
-
(
|
|
5141
|
+
(N) => {
|
|
5139
5142
|
if (v.length === 0)
|
|
5140
|
-
return
|
|
5141
|
-
let B =
|
|
5143
|
+
return N;
|
|
5144
|
+
let B = N;
|
|
5142
5145
|
const j = [...v].sort((O, W) => W.name.length - O.name.length);
|
|
5143
5146
|
for (const O of j) {
|
|
5144
5147
|
const W = `@${O.name}`, e1 = `<entity-ref type="person" id="${$e(O.id)}">${$e(O.name)}</entity-ref>`;
|
|
@@ -5151,7 +5154,7 @@ function Y2({
|
|
|
5151
5154
|
);
|
|
5152
5155
|
z(() => {
|
|
5153
5156
|
p(
|
|
5154
|
-
(
|
|
5157
|
+
(N) => N.filter((B) => {
|
|
5155
5158
|
const j = `@${B.name}`, O = e.indexOf(j);
|
|
5156
5159
|
if (O === -1)
|
|
5157
5160
|
return !1;
|
|
@@ -5164,18 +5167,18 @@ function Y2({
|
|
|
5164
5167
|
const P = X(() => {
|
|
5165
5168
|
if (!a || k.current === -1)
|
|
5166
5169
|
return null;
|
|
5167
|
-
const
|
|
5168
|
-
if (!
|
|
5170
|
+
const N = s.current;
|
|
5171
|
+
if (!N)
|
|
5169
5172
|
return null;
|
|
5170
|
-
const B = q2(
|
|
5173
|
+
const B = q2(N, k.current), j = N.offsetLeft + B.left, W = (N.offsetParent ? N.offsetParent.offsetHeight : 0) - (N.offsetTop + B.top);
|
|
5171
5174
|
return { left: j, bottom: W };
|
|
5172
|
-
}, [a, e, n, s]),
|
|
5175
|
+
}, [a, e, n, s]), F = X(() => {
|
|
5173
5176
|
if (!a || f.length === 0)
|
|
5174
5177
|
return null;
|
|
5175
|
-
const
|
|
5176
|
-
if (!
|
|
5178
|
+
const N = f[h];
|
|
5179
|
+
if (!N)
|
|
5177
5180
|
return null;
|
|
5178
|
-
const B = `${
|
|
5181
|
+
const B = `${N.firstName} ${N.lastName}`.trim();
|
|
5179
5182
|
return d.length === 0 ? B : B.toLowerCase().startsWith(d.toLowerCase()) ? B.slice(d.length) : null;
|
|
5180
5183
|
}, [a, f, h, d]);
|
|
5181
5184
|
return {
|
|
@@ -5186,11 +5189,11 @@ function Y2({
|
|
|
5186
5189
|
selectedIndex: h,
|
|
5187
5190
|
mentions: v,
|
|
5188
5191
|
popoverPosition: P,
|
|
5189
|
-
inlineCompletion:
|
|
5192
|
+
inlineCompletion: F,
|
|
5190
5193
|
handleKeyDown: E,
|
|
5191
|
-
selectPerson:
|
|
5194
|
+
selectPerson: L,
|
|
5192
5195
|
transformMentions: V,
|
|
5193
|
-
close:
|
|
5196
|
+
close: S
|
|
5194
5197
|
};
|
|
5195
5198
|
}
|
|
5196
5199
|
const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>[\s\S]*?<\/entity-ref>)/g).map((r, n) => n % 2 === 1 ? r : r.replace(/&/g, "&").replace(/</g, "<").replace(K2, "\\$&")).join(""), $4 = ({
|
|
@@ -5212,32 +5215,32 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5212
5215
|
onProcessFilesRef: v,
|
|
5213
5216
|
disclaimer: p,
|
|
5214
5217
|
footer: k,
|
|
5215
|
-
isWelcomeScreen:
|
|
5218
|
+
isWelcomeScreen: R = !1,
|
|
5216
5219
|
fullscreen: H = !1,
|
|
5217
5220
|
welcomeScreenSuggestions: T,
|
|
5218
|
-
onSuggestionClick:
|
|
5219
|
-
welcomeScreenSuggestionsPlacement:
|
|
5221
|
+
onSuggestionClick: S,
|
|
5222
|
+
welcomeScreenSuggestionsPlacement: L = "above",
|
|
5220
5223
|
welcomeScreenSuggestionsCollapsedByDefault: E = !1,
|
|
5221
5224
|
welcomeScreenCards: V,
|
|
5222
5225
|
padding: P = "default",
|
|
5223
|
-
ref:
|
|
5226
|
+
ref: F
|
|
5224
5227
|
}) => {
|
|
5225
|
-
const
|
|
5228
|
+
const N = G(), B = C1(), [j, O] = I(""), [W, e1] = I(0), [t1, K] = I(!1), [Q, s1] = I(!1), [p1, c1] = I(null), [q, d1] = I(!1), a1 = $(null), J = $(null), x1 = $(null), b1 = $(null);
|
|
5226
5229
|
z(
|
|
5227
5230
|
() => () => {
|
|
5228
5231
|
b1.current && clearTimeout(b1.current);
|
|
5229
5232
|
},
|
|
5230
5233
|
[]
|
|
5231
5234
|
);
|
|
5232
|
-
const
|
|
5235
|
+
const x = c != null, { tracking: y, setFocusChatInputFunction: M } = y1(), D = _(
|
|
5233
5236
|
(Z, v1) => {
|
|
5234
5237
|
y?.onWelcomeSuggestionClick?.({
|
|
5235
5238
|
item: Z,
|
|
5236
5239
|
group: v1,
|
|
5237
5240
|
prompt: Z.prompt || Z.title
|
|
5238
|
-
}),
|
|
5241
|
+
}), S?.(Z, v1);
|
|
5239
5242
|
},
|
|
5240
|
-
[y,
|
|
5243
|
+
[y, S]
|
|
5241
5244
|
), {
|
|
5242
5245
|
attachedFiles: A,
|
|
5243
5246
|
fileInputRef: U,
|
|
@@ -5261,9 +5264,9 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5261
5264
|
const v1 = pe.current, Y1 = v1 && !/\s$/.test(v1) ? " " : "", j1 = `${v1}${Y1}${Z}`;
|
|
5262
5265
|
O(j1), e1(j1.length);
|
|
5263
5266
|
}, []), Mr = {
|
|
5264
|
-
"permission-denied":
|
|
5265
|
-
"device-error":
|
|
5266
|
-
"transcription-failed":
|
|
5267
|
+
"permission-denied": N.ai.micPermissionDenied,
|
|
5268
|
+
"device-error": N.ai.micError,
|
|
5269
|
+
"transcription-failed": N.ai.transcriptionError
|
|
5267
5270
|
}, g1 = Yo({
|
|
5268
5271
|
onTranscribe: h,
|
|
5269
5272
|
onPartial: me,
|
|
@@ -5279,14 +5282,14 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5279
5282
|
z(() => {
|
|
5280
5283
|
E || typeof window < "u" && window.location.hash.length === 0 && J.current?.focus();
|
|
5281
5284
|
}, []), z(() => {
|
|
5282
|
-
if (
|
|
5285
|
+
if (x) {
|
|
5283
5286
|
M(null);
|
|
5284
5287
|
return;
|
|
5285
5288
|
}
|
|
5286
5289
|
return M(() => {
|
|
5287
5290
|
J.current?.focus();
|
|
5288
5291
|
}), () => M(null);
|
|
5289
|
-
}, [
|
|
5292
|
+
}, [x, M]), z(() => {
|
|
5290
5293
|
if (v)
|
|
5291
5294
|
return v((Z) => {
|
|
5292
5295
|
I1(Z);
|
|
@@ -5294,11 +5297,11 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5294
5297
|
v(null);
|
|
5295
5298
|
};
|
|
5296
5299
|
}, [v, I1]);
|
|
5297
|
-
const ve = g1.status === "recording", Fr = ve ?
|
|
5300
|
+
const ve = g1.status === "recording", Fr = ve ? N.ai.listening : N.ai.inputPlaceholder, Le = A.filter((Z) => Z.status === "uploaded"), P1 = A.some((Z) => Z.status === "uploading"), xe = A.some((Z) => Z.status === "error"), D1 = j.trim().length > 0 || Le.length > 0;
|
|
5298
5301
|
z(() => {
|
|
5299
5302
|
if (!(!Q || P1)) {
|
|
5300
5303
|
if (s1(!1), xe) {
|
|
5301
|
-
q1(
|
|
5304
|
+
q1(N.ai.fileUploadBlockedSubmit);
|
|
5302
5305
|
return;
|
|
5303
5306
|
}
|
|
5304
5307
|
a1.current?.requestSubmit();
|
|
@@ -5308,10 +5311,10 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5308
5311
|
P1,
|
|
5309
5312
|
xe,
|
|
5310
5313
|
q1,
|
|
5311
|
-
|
|
5314
|
+
N.ai.fileUploadBlockedSubmit
|
|
5312
5315
|
]);
|
|
5313
5316
|
const Nr = async (Z) => {
|
|
5314
|
-
if (Z.preventDefault(), !
|
|
5317
|
+
if (Z.preventDefault(), !x) {
|
|
5315
5318
|
if (l1.close(), n)
|
|
5316
5319
|
r?.();
|
|
5317
5320
|
else if (D1 && !t1) {
|
|
@@ -5343,15 +5346,15 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5343
5346
|
J.current?.focus();
|
|
5344
5347
|
}
|
|
5345
5348
|
}, Sr = (Z) => {
|
|
5346
|
-
|
|
5349
|
+
x || l1.handleKeyDown(Z) || Z.key === "Enter" && !Z.shiftKey && (Z.preventDefault(), n || a1.current?.requestSubmit());
|
|
5347
5350
|
}, Vr = () => {
|
|
5348
5351
|
e1(J.current?.selectionStart ?? 0);
|
|
5349
5352
|
}, Tr = () => {
|
|
5350
5353
|
x1.current && J.current && (x1.current.scrollTop = J.current.scrollTop);
|
|
5351
|
-
}, be = p1 ? p1.prompt ?? p1.title : null, ke = ve ? [
|
|
5354
|
+
}, be = p1 ? p1.prompt ?? p1.title : null, ke = ve ? [N.ai.listening] : be ? [be] : s ?? [], Hr = ke.length > 1, Ar = X(() => j2(j, l1.mentions, {
|
|
5352
5355
|
cursorPosition: W,
|
|
5353
5356
|
inlineCompletion: l1.inlineCompletion
|
|
5354
|
-
}), [j, l1.mentions, W, l1.inlineCompletion]), Er = l1.mentions.length > 0 || l1.inlineCompletion !== null, T1 =
|
|
5357
|
+
}), [j, l1.mentions, W, l1.inlineCompletion]), Er = l1.mentions.length > 0 || l1.inlineCompletion !== null, T1 = L === "inside", H1 = R && !!T && T.length > 0 && !!S ? /* @__PURE__ */ t(
|
|
5355
5358
|
D2,
|
|
5356
5359
|
{
|
|
5357
5360
|
suggestions: T,
|
|
@@ -5395,15 +5398,15 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5395
5398
|
onStopRecording: g1.stop,
|
|
5396
5399
|
onCancelRecording: Rr
|
|
5397
5400
|
}
|
|
5398
|
-
), Pr =
|
|
5399
|
-
|
|
5401
|
+
), Pr = R && H && !!V && V.length > 0, Ne = H && R, { motionProps: Dr } = Ko(
|
|
5402
|
+
R,
|
|
5400
5403
|
160,
|
|
5401
5404
|
0.5
|
|
5402
5405
|
);
|
|
5403
5406
|
return /* @__PURE__ */ i(
|
|
5404
5407
|
Y.div,
|
|
5405
5408
|
{
|
|
5406
|
-
ref:
|
|
5409
|
+
ref: F,
|
|
5407
5410
|
className: b(
|
|
5408
5411
|
"flex flex-col items-center gap-2",
|
|
5409
5412
|
// The chat window's gutter. `padding="none"` hands it to the host —
|
|
@@ -5456,12 +5459,12 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5456
5459
|
"from-[#E55619] via-[#A1ADE5] to-[#E51943]",
|
|
5457
5460
|
"after:transition-opacity after:delay-200 after:duration-300",
|
|
5458
5461
|
"has-[textarea:focus]:after:opacity-100",
|
|
5459
|
-
!B && !
|
|
5460
|
-
!B &&
|
|
5461
|
-
|
|
5462
|
+
!B && !x && "after:[animation:rotate-gradient_6s_linear_infinite_paused] has-[textarea:focus]:after:[animation:rotate-gradient_6s_linear_infinite_running]",
|
|
5463
|
+
!B && x && "after:[animation:rotate-gradient_6s_linear_infinite_running]",
|
|
5464
|
+
x && "after:opacity-100 border-f1-background-tertiary"
|
|
5462
5465
|
),
|
|
5463
5466
|
onClick: () => {
|
|
5464
|
-
|
|
5467
|
+
x || J.current?.focus();
|
|
5465
5468
|
},
|
|
5466
5469
|
onFocus: () => d1(!0),
|
|
5467
5470
|
onBlur: Br,
|
|
@@ -5478,7 +5481,7 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5478
5481
|
onSelect: l1.selectPerson
|
|
5479
5482
|
}
|
|
5480
5483
|
),
|
|
5481
|
-
/* @__PURE__ */ t(L1, { initial: !1, children:
|
|
5484
|
+
/* @__PURE__ */ t(L1, { initial: !1, children: x ? /* @__PURE__ */ t(
|
|
5482
5485
|
Y.div,
|
|
5483
5486
|
{
|
|
5484
5487
|
className: "overflow-hidden",
|
|
@@ -5560,7 +5563,7 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5560
5563
|
attachedFiles: A,
|
|
5561
5564
|
isUploading: P1,
|
|
5562
5565
|
onRemove: kr,
|
|
5563
|
-
removeLabel:
|
|
5566
|
+
removeLabel: N.ai.removeFile
|
|
5564
5567
|
}
|
|
5565
5568
|
),
|
|
5566
5569
|
/* @__PURE__ */ i(
|
|
@@ -5660,8 +5663,8 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5660
5663
|
) })
|
|
5661
5664
|
] }),
|
|
5662
5665
|
Pr ? /* @__PURE__ */ t("div", { className: "w-full max-w-content pt-2", children: /* @__PURE__ */ t(V2, { cards: V }) }) : null,
|
|
5663
|
-
k &&
|
|
5664
|
-
/* @__PURE__ */ t(L1, { mode: "wait", initial: !1, children:
|
|
5666
|
+
k && R && H ? /* @__PURE__ */ t("div", { className: "w-full py-4 mx-auto flex max-w-content justify-center", children: k }) : null,
|
|
5667
|
+
/* @__PURE__ */ t(L1, { mode: "wait", initial: !1, children: x ? /* @__PURE__ */ i(
|
|
5665
5668
|
Y.div,
|
|
5666
5669
|
{
|
|
5667
5670
|
className: "flex w-full max-w-content flex-row flex-wrap items-center justify-center gap-x-3 gap-y-1 text-sm font-medium text-f1-foreground-tertiary",
|
|
@@ -5673,17 +5676,17 @@ const K2 = /[\\`*_{}[\]()#+\-.!|~>]/g, Q2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5673
5676
|
/* @__PURE__ */ i("span", { children: [
|
|
5674
5677
|
/* @__PURE__ */ t("kbd", { className: "font-sans", children: "↑↓" }),
|
|
5675
5678
|
" ",
|
|
5676
|
-
|
|
5679
|
+
N.ai.clarifyingQuestion.navHint.navigate
|
|
5677
5680
|
] }),
|
|
5678
5681
|
/* @__PURE__ */ i("span", { children: [
|
|
5679
5682
|
/* @__PURE__ */ t("kbd", { className: "font-sans", children: "Enter" }),
|
|
5680
5683
|
" ",
|
|
5681
|
-
|
|
5684
|
+
N.ai.clarifyingQuestion.navHint.select
|
|
5682
5685
|
] }),
|
|
5683
5686
|
/* @__PURE__ */ i("span", { children: [
|
|
5684
5687
|
/* @__PURE__ */ t("kbd", { className: "font-sans", children: "Esc" }),
|
|
5685
5688
|
" ",
|
|
5686
|
-
|
|
5689
|
+
N.ai.clarifyingQuestion.navHint.cancel
|
|
5687
5690
|
] })
|
|
5688
5691
|
]
|
|
5689
5692
|
},
|
|
@@ -6712,25 +6715,25 @@ function ar({
|
|
|
6712
6715
|
h.current = k, z(() => {
|
|
6713
6716
|
typeof window > "u" || window.innerWidth < Sl || Ie.has(e) || (Ie.add(e), h.current());
|
|
6714
6717
|
}, [e]);
|
|
6715
|
-
const
|
|
6716
|
-
const E = c[
|
|
6717
|
-
fieldType:
|
|
6718
|
-
customFieldName:
|
|
6718
|
+
const R = a && c ? Object.entries(a).map(([S, L]) => {
|
|
6719
|
+
const E = c[S], V = g?.(S, E, {
|
|
6720
|
+
fieldType: L.fieldType,
|
|
6721
|
+
customFieldName: L.customFieldName
|
|
6719
6722
|
});
|
|
6720
|
-
if (!V &&
|
|
6723
|
+
if (!V && L.fieldType === "custom" && typeof E == "object" && E !== null)
|
|
6721
6724
|
return null;
|
|
6722
|
-
const P = V ?? sr(E,
|
|
6725
|
+
const P = V ?? sr(E, L.fieldType), F = ["richtext", "textarea"];
|
|
6723
6726
|
return {
|
|
6724
|
-
label:
|
|
6727
|
+
label: L.label,
|
|
6725
6728
|
content: P,
|
|
6726
|
-
verticalLayout:
|
|
6729
|
+
verticalLayout: F.includes(L.fieldType ?? "")
|
|
6727
6730
|
};
|
|
6728
|
-
}).filter((
|
|
6729
|
-
if (!
|
|
6731
|
+
}).filter((S) => {
|
|
6732
|
+
if (!S)
|
|
6730
6733
|
return !1;
|
|
6731
|
-
const
|
|
6732
|
-
return !(
|
|
6733
|
-
}) : [], H =
|
|
6734
|
+
const L = Array.isArray(S.content) ? S.content[0] : S.content;
|
|
6735
|
+
return !(L?.type === "item" && L.text === "—");
|
|
6736
|
+
}) : [], H = R.slice(0, Be), T = R.length > Be;
|
|
6734
6737
|
return /* @__PURE__ */ t(
|
|
6735
6738
|
or,
|
|
6736
6739
|
{
|
|
@@ -6747,10 +6750,10 @@ function ar({
|
|
|
6747
6750
|
children: H.length > 0 && !p ? /* @__PURE__ */ t("div", { className: "-mx-3 flex w-full flex-col overflow-hidden pb-1", children: /* @__PURE__ */ t(
|
|
6748
6751
|
is,
|
|
6749
6752
|
{
|
|
6750
|
-
details: H.map((
|
|
6751
|
-
title:
|
|
6752
|
-
content:
|
|
6753
|
-
...
|
|
6753
|
+
details: H.map((S) => ({
|
|
6754
|
+
title: S.label,
|
|
6755
|
+
content: S.content,
|
|
6756
|
+
...S.verticalLayout && { verticalLayout: !0 }
|
|
6754
6757
|
})),
|
|
6755
6758
|
showSeeMore: T,
|
|
6756
6759
|
onClickSeeMore: k,
|
|
@@ -7248,24 +7251,24 @@ const fr = (e) => /* @__PURE__ */ t(Et, { content: e, format: "markdown" }), Gl
|
|
|
7248
7251
|
}, [w]), z(() => {
|
|
7249
7252
|
if (g)
|
|
7250
7253
|
return;
|
|
7251
|
-
let
|
|
7254
|
+
let R;
|
|
7252
7255
|
if (u === "starting")
|
|
7253
|
-
|
|
7256
|
+
R = setTimeout(() => C("writing"), Yl);
|
|
7254
7257
|
else if (u === "writing")
|
|
7255
|
-
l < h.length ?
|
|
7258
|
+
l < h.length ? R = setTimeout(() => f((H) => H + 1), ql) : C("holding");
|
|
7256
7259
|
else if (u === "holding") {
|
|
7257
7260
|
if (e.length <= 1)
|
|
7258
7261
|
return;
|
|
7259
|
-
|
|
7260
|
-
} else u === "erasing" && (l > 0 ?
|
|
7262
|
+
R = setTimeout(() => C("erasing"), Kl);
|
|
7263
|
+
} else u === "erasing" && (l > 0 ? R = setTimeout(() => f((H) => H - 1), Xl) : R = setTimeout(() => {
|
|
7261
7264
|
d((H) => (H + 1) % e.length), C("starting");
|
|
7262
7265
|
}, Ql));
|
|
7263
7266
|
return () => {
|
|
7264
|
-
|
|
7267
|
+
R && clearTimeout(R);
|
|
7265
7268
|
};
|
|
7266
7269
|
}, [u, l, h.length, e.length, g]);
|
|
7267
|
-
const p = !!s, k = p ? (
|
|
7268
|
-
(
|
|
7270
|
+
const p = !!s, k = p ? (R) => {
|
|
7271
|
+
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), s?.());
|
|
7269
7272
|
} : void 0;
|
|
7270
7273
|
return /* @__PURE__ */ t(
|
|
7271
7274
|
"div",
|
|
@@ -7347,8 +7350,8 @@ function e6({
|
|
|
7347
7350
|
const w = e.current;
|
|
7348
7351
|
if (!w)
|
|
7349
7352
|
return;
|
|
7350
|
-
const { scrollTop: v, scrollHeight: p, clientHeight: k } = w,
|
|
7351
|
-
f(
|
|
7353
|
+
const { scrollTop: v, scrollHeight: p, clientHeight: k } = w, R = p - v - k;
|
|
7354
|
+
f(R > k);
|
|
7352
7355
|
}, [e]);
|
|
7353
7356
|
return z(() => {
|
|
7354
7357
|
const w = e.current;
|
|
@@ -7360,8 +7363,8 @@ function e6({
|
|
|
7360
7363
|
const w = e.current, v = o.current;
|
|
7361
7364
|
if (!w || !v)
|
|
7362
7365
|
return;
|
|
7363
|
-
const p = w.getBoundingClientRect(), k = v.getBoundingClientRect(),
|
|
7364
|
-
w.scrollTo({ top:
|
|
7366
|
+
const p = w.getBoundingClientRect(), k = v.getBoundingClientRect(), R = w.scrollTop + (k.top - p.top);
|
|
7367
|
+
w.scrollTo({ top: R, behavior: "smooth" });
|
|
7365
7368
|
});
|
|
7366
7369
|
}), s === 0 && f(!1), u.current = s;
|
|
7367
7370
|
}, [s, o, e]), { showScrollBtn: l, turnMinHeight: c, scrollToBottom: g };
|
|
@@ -7391,14 +7394,14 @@ const t6 = {
|
|
|
7391
7394
|
noShadows: v = !1,
|
|
7392
7395
|
fullscreen: p = !1,
|
|
7393
7396
|
children: k,
|
|
7394
|
-
AssistantMessage:
|
|
7397
|
+
AssistantMessage: R,
|
|
7395
7398
|
UserMessage: H,
|
|
7396
7399
|
onRegenerate: T,
|
|
7397
|
-
onCopy:
|
|
7400
|
+
onCopy: S
|
|
7398
7401
|
}) => {
|
|
7399
|
-
const { modal:
|
|
7402
|
+
const { modal: L, handleSubmit: E, handleClose: V } = _l(
|
|
7400
7403
|
h ?? t6
|
|
7401
|
-
), P = G(),
|
|
7404
|
+
), P = G(), F = R ?? Il, N = H ?? Wl, B = X(() => {
|
|
7402
7405
|
const q = o ?? P.ai.defaultInitialMessage;
|
|
7403
7406
|
return (Array.isArray(q) ? q : [q]).filter((a1) => typeof a1 == "string" && a1.length > 0);
|
|
7404
7407
|
}, [o, P.ai.defaultInitialMessage]), j = !r && e.length === 0 && B.length > 0, O = $(null), W = $(null), e1 = $(null), t1 = $(null), K = $(null), { showScrollBtn: Q, turnMinHeight: s1, scrollToBottom: p1 } = e6({
|
|
@@ -7415,45 +7418,45 @@ const t6 = {
|
|
|
7415
7418
|
onRendered: u,
|
|
7416
7419
|
autoScrollIntoView: C,
|
|
7417
7420
|
renderMarkdown: g
|
|
7418
|
-
}, x1 = (
|
|
7421
|
+
}, x1 = (x, y) => {
|
|
7419
7422
|
const M = {
|
|
7420
|
-
message:
|
|
7423
|
+
message: x,
|
|
7421
7424
|
inProgress: q.isInProgress,
|
|
7422
7425
|
index: y,
|
|
7423
7426
|
isCurrentMessage: !1,
|
|
7424
|
-
AssistantMessage:
|
|
7425
|
-
UserMessage:
|
|
7427
|
+
AssistantMessage: F,
|
|
7428
|
+
UserMessage: N,
|
|
7426
7429
|
onRegenerate: T,
|
|
7427
|
-
onCopy:
|
|
7428
|
-
rawData:
|
|
7430
|
+
onCopy: S,
|
|
7431
|
+
rawData: x.rawData || {},
|
|
7429
7432
|
...J
|
|
7430
7433
|
};
|
|
7431
7434
|
return /* @__PURE__ */ t(
|
|
7432
|
-
|
|
7435
|
+
N,
|
|
7433
7436
|
{
|
|
7434
7437
|
...M
|
|
7435
7438
|
},
|
|
7436
7439
|
`${d1}-u-${y}`
|
|
7437
7440
|
);
|
|
7438
|
-
}, b1 = (
|
|
7441
|
+
}, b1 = (x, y) => {
|
|
7439
7442
|
const M = a1 && y === q.assistantMessages.length - 1, D = q.userMessages.length + y, A = {
|
|
7440
|
-
message:
|
|
7443
|
+
message: x,
|
|
7441
7444
|
inProgress: q.isInProgress,
|
|
7442
7445
|
index: D,
|
|
7443
7446
|
isCurrentMessage: M,
|
|
7444
|
-
AssistantMessage:
|
|
7445
|
-
UserMessage:
|
|
7447
|
+
AssistantMessage: F,
|
|
7448
|
+
UserMessage: N,
|
|
7446
7449
|
onRegenerate: T,
|
|
7447
|
-
onCopy:
|
|
7448
|
-
rawData:
|
|
7450
|
+
onCopy: S,
|
|
7451
|
+
rawData: x.rawData || {},
|
|
7449
7452
|
...J
|
|
7450
7453
|
};
|
|
7451
7454
|
return /* @__PURE__ */ t(
|
|
7452
|
-
|
|
7455
|
+
F,
|
|
7453
7456
|
{
|
|
7454
7457
|
...A,
|
|
7455
7458
|
isGenerating: q.isInProgress && M,
|
|
7456
|
-
isLoading: q.isInProgress && M && !
|
|
7459
|
+
isLoading: q.isInProgress && M && !x.content
|
|
7457
7460
|
},
|
|
7458
7461
|
`${d1}-a-${y}`
|
|
7459
7462
|
);
|
|
@@ -7471,7 +7474,7 @@ const t6 = {
|
|
|
7471
7474
|
},
|
|
7472
7475
|
children: [
|
|
7473
7476
|
q.userMessages.map(
|
|
7474
|
-
(
|
|
7477
|
+
(x, y) => x1(x, y)
|
|
7475
7478
|
),
|
|
7476
7479
|
q.thinking && q.thinking.titles.length > 0 ? /* @__PURE__ */ t(
|
|
7477
7480
|
Zl,
|
|
@@ -7483,7 +7486,7 @@ const t6 = {
|
|
|
7483
7486
|
}
|
|
7484
7487
|
) : null,
|
|
7485
7488
|
q.assistantMessages.map(
|
|
7486
|
-
(
|
|
7489
|
+
(x, y) => b1(x, y)
|
|
7487
7490
|
),
|
|
7488
7491
|
q.endIndicator === "thinking" ? /* @__PURE__ */ t(J1, { title: P.ai.thinking, status: "executing" }) : null,
|
|
7489
7492
|
q.endIndicator === "activity" ? /* @__PURE__ */ t(J1, { status: "writing" }) : null,
|
|
@@ -7492,7 +7495,7 @@ const t6 = {
|
|
|
7492
7495
|
{
|
|
7493
7496
|
content: q.feedback.content,
|
|
7494
7497
|
targetMessage: q.feedback.targetMessage,
|
|
7495
|
-
onCopy:
|
|
7498
|
+
onCopy: S
|
|
7496
7499
|
}
|
|
7497
7500
|
) : null,
|
|
7498
7501
|
a1 ? /* @__PURE__ */ t(Al, {}) : null
|
|
@@ -7578,13 +7581,13 @@ const t6 = {
|
|
|
7578
7581
|
/* @__PURE__ */ t(Ae, { position: "bottom" }, "shadow-bottom")
|
|
7579
7582
|
] }) : null
|
|
7580
7583
|
] }),
|
|
7581
|
-
|
|
7584
|
+
L.isOpen ? /* @__PURE__ */ t(
|
|
7582
7585
|
Pl,
|
|
7583
7586
|
{
|
|
7584
7587
|
onSubmit: E,
|
|
7585
7588
|
onClose: V,
|
|
7586
|
-
reactionType:
|
|
7587
|
-
message:
|
|
7589
|
+
reactionType: L.currentReaction,
|
|
7590
|
+
message: L.currentMessage
|
|
7588
7591
|
}
|
|
7589
7592
|
) : null
|
|
7590
7593
|
] });
|
|
@@ -7792,41 +7795,41 @@ const i6 = [0.23, 1, 0.32, 1], l6 = 0.2, c6 = 0.03, d6 = 4, u6 = ({
|
|
|
7792
7795
|
onToggleCustomActive: v,
|
|
7793
7796
|
onConfirm: p
|
|
7794
7797
|
}) => {
|
|
7795
|
-
const k = C1(),
|
|
7798
|
+
const k = C1(), R = (() => {
|
|
7796
7799
|
if (e !== "single")
|
|
7797
7800
|
return 0;
|
|
7798
7801
|
const V = n.findIndex((P) => o.includes(P.id));
|
|
7799
7802
|
return V >= 0 ? V : 0;
|
|
7800
|
-
})(), [H, T] = I(
|
|
7803
|
+
})(), [H, T] = I(R), S = $([]);
|
|
7801
7804
|
z(() => {
|
|
7802
|
-
C && e === "single" &&
|
|
7805
|
+
C && e === "single" && S.current[H]?.focus();
|
|
7803
7806
|
}, []);
|
|
7804
|
-
const
|
|
7807
|
+
const L = (V) => {
|
|
7805
7808
|
if (e !== "single")
|
|
7806
7809
|
return;
|
|
7807
7810
|
const P = n.length - 1;
|
|
7808
7811
|
if (P < 0)
|
|
7809
7812
|
return;
|
|
7810
|
-
let
|
|
7813
|
+
let F;
|
|
7811
7814
|
switch (V.key) {
|
|
7812
7815
|
case "ArrowDown":
|
|
7813
7816
|
case "ArrowRight":
|
|
7814
|
-
|
|
7817
|
+
F = H >= P ? 0 : H + 1;
|
|
7815
7818
|
break;
|
|
7816
7819
|
case "ArrowUp":
|
|
7817
7820
|
case "ArrowLeft":
|
|
7818
|
-
|
|
7821
|
+
F = H <= 0 ? P : H - 1;
|
|
7819
7822
|
break;
|
|
7820
7823
|
case "Home":
|
|
7821
|
-
|
|
7824
|
+
F = 0;
|
|
7822
7825
|
break;
|
|
7823
7826
|
case "End":
|
|
7824
|
-
|
|
7827
|
+
F = P;
|
|
7825
7828
|
break;
|
|
7826
7829
|
default:
|
|
7827
7830
|
return;
|
|
7828
7831
|
}
|
|
7829
|
-
V.preventDefault(), T(
|
|
7832
|
+
V.preventDefault(), T(F), S.current[F]?.focus();
|
|
7830
7833
|
}, E = (V) => ({
|
|
7831
7834
|
initial: k ? !1 : { opacity: 0, y: d6 },
|
|
7832
7835
|
animate: { opacity: 1, y: 0 },
|
|
@@ -7846,15 +7849,15 @@ const i6 = [0.23, 1, 0.32, 1], l6 = 0.2, c6 = 0.03, d6 = 4, u6 = ({
|
|
|
7846
7849
|
n.map((V, P) => /* @__PURE__ */ t(Y.div, { ...E(P), children: /* @__PURE__ */ t(
|
|
7847
7850
|
pr,
|
|
7848
7851
|
{
|
|
7849
|
-
ref: (
|
|
7850
|
-
|
|
7852
|
+
ref: (F) => {
|
|
7853
|
+
S.current[P] = F;
|
|
7851
7854
|
},
|
|
7852
7855
|
option: V,
|
|
7853
7856
|
isSelected: o.includes(V.id),
|
|
7854
7857
|
mode: e,
|
|
7855
7858
|
isTabStop: e === "single" ? P === H : void 0,
|
|
7856
7859
|
onToggle: g,
|
|
7857
|
-
onKeyNavigate:
|
|
7860
|
+
onKeyNavigate: L
|
|
7858
7861
|
}
|
|
7859
7862
|
) }, V.id)),
|
|
7860
7863
|
s ? /* @__PURE__ */ t(Y.div, { ...E(n.length), children: /* @__PURE__ */ t(
|
|
@@ -7967,22 +7970,22 @@ const i6 = [0.23, 1, 0.32, 1], l6 = 0.2, c6 = 0.03, d6 = 4, u6 = ({
|
|
|
7967
7970
|
question: v,
|
|
7968
7971
|
options: p,
|
|
7969
7972
|
selectedOptionIds: k,
|
|
7970
|
-
selectionMode:
|
|
7973
|
+
selectionMode: R,
|
|
7971
7974
|
optional: H,
|
|
7972
7975
|
allowCustomAnswer: T,
|
|
7973
|
-
customAnswerText:
|
|
7974
|
-
isCustomAnswerActive:
|
|
7975
|
-
} = s, E = $(null), V =
|
|
7976
|
+
customAnswerText: S,
|
|
7977
|
+
isCustomAnswerActive: L
|
|
7978
|
+
} = s, E = $(null), V = R ?? "single", P = c > 1, F = a === 0, N = a === c - 1, B = P ? n.t("ai.clarifyingQuestion.stepOf", {
|
|
7976
7979
|
current: String(a + 1),
|
|
7977
7980
|
total: String(c)
|
|
7978
|
-
}) : void 0, j = k.length > 0, O = (
|
|
7981
|
+
}) : void 0, j = k.length > 0, O = (S ?? "").trim().length > 0, W = j || L && O || H === !0, e1 = r === !0 && N, t1 = () => {
|
|
7979
7982
|
e1 || l();
|
|
7980
7983
|
}, K = () => {
|
|
7981
7984
|
e1 || f();
|
|
7982
7985
|
}, Q = (J) => {
|
|
7983
7986
|
const x1 = V === "single" && k.includes(J);
|
|
7984
|
-
d(J), V === "single" && !
|
|
7985
|
-
}, s1 =
|
|
7987
|
+
d(J), V === "single" && !N && !x1 && Promise.resolve().then(l);
|
|
7988
|
+
}, s1 = N ? n.ai.clarifyingQuestion.submit : n.ai.clarifyingQuestion.next, p1 = H === !0 && !j && !(L && O), c1 = () => {
|
|
7986
7989
|
w(), requestAnimationFrame(() => {
|
|
7987
7990
|
E.current?.focus();
|
|
7988
7991
|
});
|
|
@@ -8006,8 +8009,8 @@ const i6 = [0.23, 1, 0.32, 1], l6 = 0.2, c6 = 0.03, d6 = 4, u6 = ({
|
|
|
8006
8009
|
{
|
|
8007
8010
|
question: v,
|
|
8008
8011
|
stepLabel: B,
|
|
8009
|
-
isFirstStep:
|
|
8010
|
-
isFinalStep:
|
|
8012
|
+
isFirstStep: F,
|
|
8013
|
+
isFinalStep: N,
|
|
8011
8014
|
canProceed: W,
|
|
8012
8015
|
onBack: C,
|
|
8013
8016
|
onNext: l,
|
|
@@ -8024,8 +8027,8 @@ const i6 = [0.23, 1, 0.32, 1], l6 = 0.2, c6 = 0.03, d6 = 4, u6 = ({
|
|
|
8024
8027
|
allowCustomAnswer: T,
|
|
8025
8028
|
hasSelection: j,
|
|
8026
8029
|
hasCustomText: O,
|
|
8027
|
-
customAnswerText:
|
|
8028
|
-
isCustomAnswerActive:
|
|
8030
|
+
customAnswerText: S,
|
|
8031
|
+
isCustomAnswerActive: L,
|
|
8029
8032
|
canProceed: W,
|
|
8030
8033
|
customInputRef: E,
|
|
8031
8034
|
onToggleOption: Q,
|
|
@@ -8053,59 +8056,59 @@ const i6 = [0.23, 1, 0.32, 1], l6 = 0.2, c6 = 0.03, d6 = 4, u6 = ({
|
|
|
8053
8056
|
] });
|
|
8054
8057
|
};
|
|
8055
8058
|
function Ue(e, r, n, o) {
|
|
8056
|
-
const s = Math.max(1, Math.min(e, r)), a = Math.min(n, 20), d = Math.min(a + o, s), l = Math.min(d, Math.floor(e / 2)), f = Math.min(d, Math.floor(r / 2)), u = (c1) => c1 / e * 2 - 1, C = (c1) => c1 / r * 2 - 1, g = 0, h = e, w = 0, v = r, p = l, k = e - l,
|
|
8059
|
+
const s = Math.max(1, Math.min(e, r)), a = Math.min(n, 20), d = Math.min(a + o, s), l = Math.min(d, Math.floor(e / 2)), f = Math.min(d, Math.floor(r / 2)), u = (c1) => c1 / e * 2 - 1, C = (c1) => c1 / r * 2 - 1, g = 0, h = e, w = 0, v = r, p = l, k = e - l, R = f, H = r - f, T = u(g), S = u(h), L = C(w), E = C(v), V = u(p), P = u(k), F = C(R), N = C(H), B = 0, j = 0, O = 1, W = 1, e1 = l / e, t1 = 1 - l / e, K = f / r, Q = 1 - f / r, s1 = new Float32Array([
|
|
8057
8060
|
// Top strip
|
|
8058
8061
|
T,
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
+
L,
|
|
8063
|
+
S,
|
|
8064
|
+
L,
|
|
8062
8065
|
T,
|
|
8063
|
-
|
|
8066
|
+
F,
|
|
8064
8067
|
T,
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8068
|
+
F,
|
|
8069
|
+
S,
|
|
8070
|
+
L,
|
|
8071
|
+
S,
|
|
8072
|
+
F,
|
|
8070
8073
|
// Bottom strip
|
|
8071
8074
|
T,
|
|
8075
|
+
N,
|
|
8072
8076
|
S,
|
|
8073
|
-
|
|
8074
|
-
S,
|
|
8077
|
+
N,
|
|
8075
8078
|
T,
|
|
8076
8079
|
E,
|
|
8077
8080
|
T,
|
|
8078
8081
|
E,
|
|
8079
|
-
R,
|
|
8080
8082
|
S,
|
|
8081
|
-
|
|
8083
|
+
N,
|
|
8084
|
+
S,
|
|
8082
8085
|
E,
|
|
8083
8086
|
// Left strip
|
|
8084
8087
|
T,
|
|
8085
|
-
|
|
8088
|
+
F,
|
|
8086
8089
|
V,
|
|
8087
|
-
|
|
8090
|
+
F,
|
|
8088
8091
|
T,
|
|
8089
|
-
|
|
8092
|
+
N,
|
|
8090
8093
|
T,
|
|
8091
|
-
S,
|
|
8092
|
-
V,
|
|
8093
8094
|
N,
|
|
8094
8095
|
V,
|
|
8095
|
-
|
|
8096
|
+
F,
|
|
8097
|
+
V,
|
|
8098
|
+
N,
|
|
8096
8099
|
// Right strip
|
|
8097
8100
|
P,
|
|
8098
|
-
|
|
8099
|
-
|
|
8101
|
+
F,
|
|
8102
|
+
S,
|
|
8103
|
+
F,
|
|
8104
|
+
P,
|
|
8100
8105
|
N,
|
|
8101
8106
|
P,
|
|
8107
|
+
N,
|
|
8102
8108
|
S,
|
|
8103
|
-
|
|
8109
|
+
F,
|
|
8104
8110
|
S,
|
|
8105
|
-
|
|
8106
|
-
N,
|
|
8107
|
-
R,
|
|
8108
|
-
S
|
|
8111
|
+
N
|
|
8109
8112
|
]), p1 = new Float32Array([
|
|
8110
8113
|
// Top strip
|
|
8111
8114
|
B,
|
|
@@ -8501,8 +8504,8 @@ class G4 {
|
|
|
8501
8504
|
s.enableVertexAttribArray(p), s.vertexAttribPointer(p, 2, s.FLOAT, !1, 0, 0), this.checkGLError(s, "resize: after UV buffer update"), s.useProgram(a), s.uniform2f(f, this.canvas.width, this.canvas.height), s.uniform1f(this.glr.uBorderWidth, this.options.borderWidth * u), s.uniform1f(this.glr.uGlowWidth, this.options.glowWidth * u), s.uniform1f(this.glr.uBorderRadius, this.options.borderRadius * u), this.checkGLError(s, "resize: after uniform updates");
|
|
8502
8505
|
const k = performance.now();
|
|
8503
8506
|
this.lastTime = k;
|
|
8504
|
-
const
|
|
8505
|
-
this.render(
|
|
8507
|
+
const R = (k - this.startTime) * 1e-3;
|
|
8508
|
+
this.render(R);
|
|
8506
8509
|
}
|
|
8507
8510
|
/**
|
|
8508
8511
|
* Automatically resizes the canvas to match the dimensions of the given element.
|
|
@@ -8592,13 +8595,13 @@ class G4 {
|
|
|
8592
8595
|
r.bindBuffer(r.ARRAY_BUFFER, u), r.bufferData(r.ARRAY_BUFFER, d, r.STATIC_DRAW);
|
|
8593
8596
|
const C = r.getAttribLocation(n, "aUV");
|
|
8594
8597
|
r.enableVertexAttribArray(C), r.vertexAttribPointer(C, 2, r.FLOAT, !1, 0, 0), this.checkGLError(r, "setupGL: after UV buffer setup");
|
|
8595
|
-
const g = r.getUniformLocation(n, "uResolution"), h = r.getUniformLocation(n, "uTime"), w = r.getUniformLocation(n, "uBorderWidth"), v = r.getUniformLocation(n, "uGlowWidth"), p = r.getUniformLocation(n, "uBorderRadius"), k = r.getUniformLocation(n, "uColors"),
|
|
8596
|
-
r.useProgram(n), r.uniform1f(w, this.options.borderWidth), r.uniform1f(v, this.options.glowWidth), r.uniform1f(p, this.options.borderRadius), this.options.mode === "dark" ? (r.uniform1f(
|
|
8598
|
+
const g = r.getUniformLocation(n, "uResolution"), h = r.getUniformLocation(n, "uTime"), w = r.getUniformLocation(n, "uBorderWidth"), v = r.getUniformLocation(n, "uGlowWidth"), p = r.getUniformLocation(n, "uBorderRadius"), k = r.getUniformLocation(n, "uColors"), R = r.getUniformLocation(n, "uGlowExponent"), H = r.getUniformLocation(n, "uGlowFactor");
|
|
8599
|
+
r.useProgram(n), r.uniform1f(w, this.options.borderWidth), r.uniform1f(v, this.options.glowWidth), r.uniform1f(p, this.options.borderRadius), this.options.mode === "dark" ? (r.uniform1f(R, 2), r.uniform1f(H, 1.8)) : (r.uniform1f(R, 1), r.uniform1f(H, 1));
|
|
8597
8600
|
const T = (this.options.colors || v6).map(L6);
|
|
8598
|
-
for (let
|
|
8601
|
+
for (let S = 0; S < T.length; S++)
|
|
8599
8602
|
r.uniform3f(
|
|
8600
|
-
r.getUniformLocation(n, `uColors[${
|
|
8601
|
-
...T[
|
|
8603
|
+
r.getUniformLocation(n, `uColors[${S}]`),
|
|
8604
|
+
...T[S]
|
|
8602
8605
|
);
|
|
8603
8606
|
this.checkGLError(r, "setupGL: after uniform setup"), r.bindVertexArray(null), r.bindBuffer(r.ARRAY_BUFFER, null), this.glr = {
|
|
8604
8607
|
gl: r,
|
|
@@ -8894,7 +8897,7 @@ class B6 {
|
|
|
8894
8897
|
)
|
|
8895
8898
|
);
|
|
8896
8899
|
Object.assign(this, { url: o, wrapS: s, wrapT: a, minFilter: c, magFilter: d, flipY: l });
|
|
8897
|
-
const C = 0, g = n.RGBA, h = 1, w = 1, v = 0, p = n.RGBA, k = n.UNSIGNED_BYTE,
|
|
8900
|
+
const C = 0, g = n.RGBA, h = 1, w = 1, v = 0, p = n.RGBA, k = n.UNSIGNED_BYTE, R = new Uint8Array([255, 255, 255, 0]), H = n.createTexture();
|
|
8898
8901
|
if (n.bindTexture(n.TEXTURE_2D, H), n.texImage2D(
|
|
8899
8902
|
n.TEXTURE_2D,
|
|
8900
8903
|
C,
|
|
@@ -8904,7 +8907,7 @@ class B6 {
|
|
|
8904
8907
|
v,
|
|
8905
8908
|
p,
|
|
8906
8909
|
k,
|
|
8907
|
-
|
|
8910
|
+
R
|
|
8908
8911
|
), u) {
|
|
8909
8912
|
const E = this.setupVideo(o);
|
|
8910
8913
|
return n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.LINEAR), this._webglTexture = H, this.source = E, this.isVideo = !0, E.play().then(() => this);
|
|
@@ -8919,15 +8922,15 @@ class B6 {
|
|
|
8919
8922
|
}, P.src = o ?? "";
|
|
8920
8923
|
});
|
|
8921
8924
|
}
|
|
8922
|
-
let
|
|
8923
|
-
return (r.wrapS !== ot || r.wrapT !== ot || r.minFilter !== nt && r.minFilter !== Q1) && !
|
|
8925
|
+
let S = await T(), L = (S.width & S.width - 1) === 0 && (S.height & S.height - 1) === 0;
|
|
8926
|
+
return (r.wrapS !== ot || r.wrapT !== ot || r.minFilter !== nt && r.minFilter !== Q1) && !L && (S = this.makePowerOf2(S), L = !0), n.bindTexture(n.TEXTURE_2D, H), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, l), n.texImage2D(
|
|
8924
8927
|
n.TEXTURE_2D,
|
|
8925
8928
|
C,
|
|
8926
8929
|
g,
|
|
8927
8930
|
p,
|
|
8928
8931
|
k,
|
|
8929
|
-
|
|
8930
|
-
),
|
|
8932
|
+
S
|
|
8933
|
+
), L && r.minFilter !== nt && r.minFilter !== Q1 && n.generateMipmap(n.TEXTURE_2D), n.texParameteri(
|
|
8931
8934
|
n.TEXTURE_2D,
|
|
8932
8935
|
n.TEXTURE_WRAP_S,
|
|
8933
8936
|
this.wrapS || st
|
|
@@ -8943,7 +8946,7 @@ class B6 {
|
|
|
8943
8946
|
n.TEXTURE_2D,
|
|
8944
8947
|
n.TEXTURE_MAG_FILTER,
|
|
8945
8948
|
this.magFilter || Q1
|
|
8946
|
-
), this._webglTexture = H, this.source =
|
|
8949
|
+
), this._webglTexture = H, this.source = S, this.isVideo = !1, this.isLoaded = !0, this.width = S.width || 0, this.height = S.height || 0, this;
|
|
8947
8950
|
};
|
|
8948
8951
|
}
|
|
8949
8952
|
const k1 = (e) => `react-shaders: ${e}`, at = (e) => {
|
|
@@ -8968,7 +8971,7 @@ function P6({
|
|
|
8968
8971
|
onError: C = console.error,
|
|
8969
8972
|
onWarning: g = console.warn
|
|
8970
8973
|
}) {
|
|
8971
|
-
const h = $(null), w = $(null), v = $(null), p = $(null), k = $(void 0),
|
|
8974
|
+
const h = $(null), w = $(null), v = $(null), p = $(null), k = $(void 0), R = $(void 0), H = $(!1), T = $(void 0), S = $(0), L = $([0, 0]), E = $([]), V = $(0), P = $(void 0), F = $({
|
|
8972
8975
|
[Xe]: { type: "float", isNeeded: !1, value: 0 },
|
|
8973
8976
|
[Ye]: { type: "float", isNeeded: !1, value: 0 },
|
|
8974
8977
|
[Ke]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
|
|
@@ -8980,8 +8983,8 @@ function P6({
|
|
|
8980
8983
|
isNeeded: !1,
|
|
8981
8984
|
value: [0, 0, 0, 0]
|
|
8982
8985
|
}
|
|
8983
|
-
}),
|
|
8984
|
-
const M = "width" in
|
|
8986
|
+
}), N = $(o), B = (x, y) => {
|
|
8987
|
+
const M = "width" in x ? x.width ?? 0 : 0, D = "height" in x ? x.height ?? 0 : 0, A = F.current.iChannelResolution;
|
|
8985
8988
|
if (!A)
|
|
8986
8989
|
return;
|
|
8987
8990
|
Array.isArray(A.value) || (A.value = []);
|
|
@@ -8993,8 +8996,8 @@ function P6({
|
|
|
8993
8996
|
d
|
|
8994
8997
|
), w.current?.getExtension("OES_standard_derivatives"), w.current?.getExtension("EXT_shader_texture_lod"));
|
|
8995
8998
|
}, O = () => {
|
|
8996
|
-
const
|
|
8997
|
-
v.current =
|
|
8999
|
+
const x = w.current;
|
|
9000
|
+
v.current = x?.createBuffer() ?? null, x?.bindBuffer(x.ARRAY_BUFFER, v.current);
|
|
8998
9001
|
const y = [
|
|
8999
9002
|
1,
|
|
9000
9003
|
1,
|
|
@@ -9009,38 +9012,38 @@ function P6({
|
|
|
9009
9012
|
-1,
|
|
9010
9013
|
0
|
|
9011
9014
|
];
|
|
9012
|
-
|
|
9015
|
+
x?.bufferData(x.ARRAY_BUFFER, new Float32Array(y), x.STATIC_DRAW);
|
|
9013
9016
|
}, W = ({
|
|
9014
|
-
alpha:
|
|
9017
|
+
alpha: x,
|
|
9015
9018
|
beta: y,
|
|
9016
9019
|
gamma: M
|
|
9017
9020
|
}) => {
|
|
9018
|
-
|
|
9019
|
-
|
|
9021
|
+
F.current.iDeviceOrientation.value = [
|
|
9022
|
+
x ?? 0,
|
|
9020
9023
|
y ?? 0,
|
|
9021
9024
|
M ?? 0,
|
|
9022
9025
|
window.orientation ?? 0
|
|
9023
9026
|
];
|
|
9024
|
-
}, e1 = (
|
|
9025
|
-
const [y = 0, M = 0] = at(
|
|
9027
|
+
}, e1 = (x) => {
|
|
9028
|
+
const [y = 0, M = 0] = at(x), D = y - (T.current?.left ?? 0) - window.pageXOffset, A = (T.current?.height ?? 0) - M - (T.current?.top ?? 0) - window.pageYOffset;
|
|
9026
9029
|
H.current = !0;
|
|
9027
|
-
const U = Array.isArray(
|
|
9028
|
-
U && (U[2] = D, U[3] = A),
|
|
9029
|
-
}, t1 = (
|
|
9030
|
+
const U = Array.isArray(F.current.iMouse?.value) ? F.current.iMouse.value : void 0;
|
|
9031
|
+
U && (U[2] = D, U[3] = A), L.current[0] = D, L.current[1] = A;
|
|
9032
|
+
}, t1 = (x) => {
|
|
9030
9033
|
T.current = h.current?.getBoundingClientRect();
|
|
9031
|
-
const [y = 0, M = 0] = at(
|
|
9034
|
+
const [y = 0, M = 0] = at(x), D = y - (T.current?.left ?? 0), A = (T.current?.height ?? 0) - M - (T.current?.top ?? 0);
|
|
9032
9035
|
if (l !== 1)
|
|
9033
|
-
|
|
9036
|
+
L.current[0] = D, L.current[1] = A;
|
|
9034
9037
|
else {
|
|
9035
|
-
const U = Array.isArray(
|
|
9038
|
+
const U = Array.isArray(F.current.iMouse?.value) ? F.current.iMouse.value : void 0;
|
|
9036
9039
|
U && (U[0] = D, U[1] = A);
|
|
9037
9040
|
}
|
|
9038
9041
|
}, K = () => {
|
|
9039
|
-
const
|
|
9040
|
-
|
|
9042
|
+
const x = Array.isArray(F.current.iMouse?.value) ? F.current.iMouse.value : void 0;
|
|
9043
|
+
x && (x[2] = 0, x[3] = 0);
|
|
9041
9044
|
}, Q = () => {
|
|
9042
|
-
const
|
|
9043
|
-
if (!
|
|
9045
|
+
const x = w.current;
|
|
9046
|
+
if (!x)
|
|
9044
9047
|
return;
|
|
9045
9048
|
T.current = h.current?.getBoundingClientRect();
|
|
9046
9049
|
const y = f, M = Math.floor(
|
|
@@ -9048,18 +9051,18 @@ function P6({
|
|
|
9048
9051
|
), D = Math.floor(
|
|
9049
9052
|
(T.current?.height ?? 1) * y
|
|
9050
9053
|
);
|
|
9051
|
-
if (
|
|
9052
|
-
const A =
|
|
9054
|
+
if (x.canvas.width = M, x.canvas.height = D, F.current.iResolution?.isNeeded && p.current) {
|
|
9055
|
+
const A = x.getUniformLocation(
|
|
9053
9056
|
p.current,
|
|
9054
9057
|
et
|
|
9055
9058
|
);
|
|
9056
|
-
|
|
9059
|
+
x.uniform2fv(A, [x.canvas.width, x.canvas.height]);
|
|
9057
9060
|
}
|
|
9058
|
-
}, s1 = (
|
|
9061
|
+
}, s1 = (x, y) => {
|
|
9059
9062
|
const M = w.current;
|
|
9060
9063
|
if (!M)
|
|
9061
9064
|
return null;
|
|
9062
|
-
const D = M.createShader(
|
|
9065
|
+
const D = M.createShader(x);
|
|
9063
9066
|
if (!D)
|
|
9064
9067
|
return null;
|
|
9065
9068
|
if (M.shaderSource(D, y), M.compileShader(D), !M.getShaderParameter(D, M.COMPILE_STATUS)) {
|
|
@@ -9069,11 +9072,11 @@ ${y}`));
|
|
|
9069
9072
|
M.deleteShader(D), C?.(k1(`Shader compiler log: ${A}`));
|
|
9070
9073
|
}
|
|
9071
9074
|
return D;
|
|
9072
|
-
}, p1 = (
|
|
9075
|
+
}, p1 = (x, y) => {
|
|
9073
9076
|
const M = w.current;
|
|
9074
9077
|
if (!M)
|
|
9075
9078
|
return;
|
|
9076
|
-
const D = s1(M.FRAGMENT_SHADER,
|
|
9079
|
+
const D = s1(M.FRAGMENT_SHADER, x), A = s1(M.VERTEX_SHADER, y);
|
|
9077
9080
|
if (p.current = M.createProgram(), !(!p.current || !A || !D)) {
|
|
9078
9081
|
if (M.attachShader(p.current, A), M.attachShader(p.current, D), M.linkProgram(p.current), !M.getProgramParameter(p.current, M.LINK_STATUS)) {
|
|
9079
9082
|
C?.(
|
|
@@ -9092,8 +9095,8 @@ ${y}`));
|
|
|
9092
9095
|
}
|
|
9093
9096
|
}, c1 = () => {
|
|
9094
9097
|
if (o)
|
|
9095
|
-
for (const
|
|
9096
|
-
const y = o[
|
|
9098
|
+
for (const x of Object.keys(o)) {
|
|
9099
|
+
const y = o[x];
|
|
9097
9100
|
if (!y)
|
|
9098
9101
|
continue;
|
|
9099
9102
|
const { value: M, type: D } = y, A = E6(D);
|
|
@@ -9104,7 +9107,7 @@ ${y}`));
|
|
|
9104
9107
|
const i1 = D.length, m1 = Number.parseInt(D.charAt(i1 - 3), 10), M1 = Math.floor(M.length / (m1 * m1));
|
|
9105
9108
|
M.length > m1 * m1 && (U.arraySize = `[${M1}]`);
|
|
9106
9109
|
} else T6(D, M) && (U.arraySize = `[${Math.floor(M.length / Number.parseInt(D.charAt(0), 10))}]`);
|
|
9107
|
-
|
|
9110
|
+
F.current[x] = {
|
|
9108
9111
|
type: A,
|
|
9109
9112
|
isNeeded: !1,
|
|
9110
9113
|
value: M,
|
|
@@ -9112,20 +9115,20 @@ ${y}`));
|
|
|
9112
9115
|
};
|
|
9113
9116
|
}
|
|
9114
9117
|
}, q = () => {
|
|
9115
|
-
const
|
|
9116
|
-
if (
|
|
9118
|
+
const x = w.current;
|
|
9119
|
+
if (x)
|
|
9117
9120
|
if (n && n.length > 0) {
|
|
9118
|
-
|
|
9121
|
+
F.current[tt] = {
|
|
9119
9122
|
type: "vec3",
|
|
9120
9123
|
isNeeded: !1,
|
|
9121
9124
|
arraySize: `[${n.length}]`,
|
|
9122
9125
|
value: []
|
|
9123
9126
|
};
|
|
9124
9127
|
const y = n.map(
|
|
9125
|
-
(M, D) => (
|
|
9128
|
+
(M, D) => (F.current[`${S6}${D}`] = {
|
|
9126
9129
|
type: "sampler2D",
|
|
9127
9130
|
isNeeded: !1
|
|
9128
|
-
}, B(M, D), E.current[D] = new B6(
|
|
9131
|
+
}, B(M, D), E.current[D] = new B6(x), E.current[D]?.load(M).then((A) => B(A, D)))
|
|
9129
9132
|
);
|
|
9130
9133
|
Promise.all(y).then(() => {
|
|
9131
9134
|
u && u();
|
|
@@ -9133,7 +9136,7 @@ ${y}`));
|
|
|
9133
9136
|
C?.(M instanceof Error ? M.message : String(M)), u && u();
|
|
9134
9137
|
});
|
|
9135
9138
|
} else u && u();
|
|
9136
|
-
}, d1 = (
|
|
9139
|
+
}, d1 = (x) => {
|
|
9137
9140
|
const y = We.includes(a ?? "highp"), M = `precision ${y ? a : We[1]} float;
|
|
9138
9141
|
`;
|
|
9139
9142
|
y || g?.(
|
|
@@ -9142,10 +9145,10 @@ ${y}`));
|
|
|
9142
9145
|
)
|
|
9143
9146
|
);
|
|
9144
9147
|
let D = M.concat(`#define DPR ${f.toFixed(1)}
|
|
9145
|
-
`).concat(
|
|
9146
|
-
for (const U of Object.keys(
|
|
9147
|
-
if (
|
|
9148
|
-
const i1 =
|
|
9148
|
+
`).concat(x.replace(/texture\(/g, "texture2D("));
|
|
9149
|
+
for (const U of Object.keys(F.current))
|
|
9150
|
+
if (x.includes(U)) {
|
|
9151
|
+
const i1 = F.current[U];
|
|
9149
9152
|
if (!i1)
|
|
9150
9153
|
continue;
|
|
9151
9154
|
D = I6(
|
|
@@ -9155,18 +9158,18 @@ ${y}`));
|
|
|
9155
9158
|
D.lastIndexOf(M) + M.length
|
|
9156
9159
|
), i1.isNeeded = !0;
|
|
9157
9160
|
}
|
|
9158
|
-
return
|
|
9159
|
-
}, a1 = (
|
|
9161
|
+
return x.includes("mainImage") && (D = D.concat(F6)), D;
|
|
9162
|
+
}, a1 = (x) => {
|
|
9160
9163
|
const y = w.current;
|
|
9161
9164
|
if (!y || !p.current)
|
|
9162
9165
|
return;
|
|
9163
|
-
const M = V.current ? (
|
|
9164
|
-
V.current =
|
|
9165
|
-
const D =
|
|
9166
|
+
const M = V.current ? (x - V.current) / 1e3 : 0;
|
|
9167
|
+
V.current = x;
|
|
9168
|
+
const D = N.current;
|
|
9166
9169
|
if (D)
|
|
9167
9170
|
for (const A of Object.keys(D)) {
|
|
9168
9171
|
const U = D[A];
|
|
9169
|
-
if (U &&
|
|
9172
|
+
if (U && F.current[A]?.isNeeded) {
|
|
9170
9173
|
if (!p.current)
|
|
9171
9174
|
return;
|
|
9172
9175
|
const i1 = y.getUniformLocation(
|
|
@@ -9183,60 +9186,60 @@ ${y}`));
|
|
|
9183
9186
|
);
|
|
9184
9187
|
}
|
|
9185
9188
|
}
|
|
9186
|
-
if (
|
|
9189
|
+
if (F.current.iMouse?.isNeeded) {
|
|
9187
9190
|
const A = y.getUniformLocation(
|
|
9188
9191
|
p.current,
|
|
9189
9192
|
Je
|
|
9190
9193
|
);
|
|
9191
|
-
y.uniform4fv(A,
|
|
9194
|
+
y.uniform4fv(A, F.current.iMouse.value);
|
|
9192
9195
|
}
|
|
9193
|
-
if (
|
|
9196
|
+
if (F.current.iChannelResolution?.isNeeded) {
|
|
9194
9197
|
const A = y.getUniformLocation(
|
|
9195
9198
|
p.current,
|
|
9196
9199
|
tt
|
|
9197
9200
|
);
|
|
9198
9201
|
y.uniform3fv(
|
|
9199
9202
|
A,
|
|
9200
|
-
|
|
9203
|
+
F.current.iChannelResolution.value
|
|
9201
9204
|
);
|
|
9202
9205
|
}
|
|
9203
|
-
if (
|
|
9206
|
+
if (F.current.iDeviceOrientation?.isNeeded) {
|
|
9204
9207
|
const A = y.getUniformLocation(
|
|
9205
9208
|
p.current,
|
|
9206
9209
|
rt
|
|
9207
9210
|
);
|
|
9208
9211
|
y.uniform4fv(
|
|
9209
9212
|
A,
|
|
9210
|
-
|
|
9213
|
+
F.current.iDeviceOrientation.value
|
|
9211
9214
|
);
|
|
9212
9215
|
}
|
|
9213
|
-
if (
|
|
9216
|
+
if (F.current.iTime?.isNeeded) {
|
|
9214
9217
|
const A = y.getUniformLocation(
|
|
9215
9218
|
p.current,
|
|
9216
9219
|
Xe
|
|
9217
9220
|
);
|
|
9218
|
-
|
|
9221
|
+
S.current += M, y.uniform1f(A, S.current);
|
|
9219
9222
|
}
|
|
9220
|
-
if (
|
|
9223
|
+
if (F.current.iTimeDelta?.isNeeded) {
|
|
9221
9224
|
const A = y.getUniformLocation(
|
|
9222
9225
|
p.current,
|
|
9223
9226
|
Ye
|
|
9224
9227
|
);
|
|
9225
9228
|
y.uniform1f(A, M);
|
|
9226
9229
|
}
|
|
9227
|
-
if (
|
|
9230
|
+
if (F.current.iDate?.isNeeded) {
|
|
9228
9231
|
const A = /* @__PURE__ */ new Date(), U = A.getMonth() + 1, i1 = A.getDate(), m1 = A.getFullYear(), M1 = A.getHours() * 60 * 60 + A.getMinutes() * 60 + A.getSeconds() + A.getMilliseconds() * 1e-3, V1 = y.getUniformLocation(
|
|
9229
9232
|
p.current,
|
|
9230
9233
|
Ke
|
|
9231
9234
|
);
|
|
9232
9235
|
y.uniform4fv(V1, [m1, U, i1, M1]);
|
|
9233
9236
|
}
|
|
9234
|
-
if (
|
|
9237
|
+
if (F.current.iFrame?.isNeeded) {
|
|
9235
9238
|
const A = y.getUniformLocation(
|
|
9236
9239
|
p.current,
|
|
9237
9240
|
Qe
|
|
9238
|
-
), U =
|
|
9239
|
-
y.uniform1i(A, U),
|
|
9241
|
+
), U = F.current.iFrame.value;
|
|
9242
|
+
y.uniform1i(A, U), F.current.iFrame.value = U + 1;
|
|
9240
9243
|
}
|
|
9241
9244
|
if (E.current.length > 0)
|
|
9242
9245
|
for (let A = 0; A < E.current.length; A++) {
|
|
@@ -9246,7 +9249,7 @@ ${y}`));
|
|
|
9246
9249
|
const { isVideo: i1, _webglTexture: m1, source: M1, flipY: V1, isLoaded: I1 } = U;
|
|
9247
9250
|
if (!I1 || !m1 || !M1)
|
|
9248
9251
|
return;
|
|
9249
|
-
if (
|
|
9252
|
+
if (F.current[`iChannel${A}`]?.isNeeded) {
|
|
9250
9253
|
if (!p.current)
|
|
9251
9254
|
return;
|
|
9252
9255
|
const W1 = y.getUniformLocation(
|
|
@@ -9260,7 +9263,7 @@ ${y}`));
|
|
|
9260
9263
|
);
|
|
9261
9264
|
}
|
|
9262
9265
|
}
|
|
9263
|
-
}, J = (
|
|
9266
|
+
}, J = (x) => {
|
|
9264
9267
|
const y = w.current;
|
|
9265
9268
|
if (!y)
|
|
9266
9269
|
return;
|
|
@@ -9271,32 +9274,32 @@ ${y}`));
|
|
|
9271
9274
|
!1,
|
|
9272
9275
|
0,
|
|
9273
9276
|
0
|
|
9274
|
-
), a1(
|
|
9275
|
-
const M =
|
|
9276
|
-
if (
|
|
9277
|
+
), a1(x), y.drawArrays(y.TRIANGLE_STRIP, 0, 4);
|
|
9278
|
+
const M = F.current.iMouse?.value;
|
|
9279
|
+
if (F.current.iMouse?.isNeeded && l !== 1 && Array.isArray(M)) {
|
|
9277
9280
|
const D = M[0] ?? 0, A = M[1] ?? 0;
|
|
9278
|
-
M[0] = it(D,
|
|
9281
|
+
M[0] = it(D, L.current[0] ?? 0, l), M[1] = it(A, L.current[1] ?? 0, l);
|
|
9279
9282
|
}
|
|
9280
|
-
|
|
9283
|
+
R.current = requestAnimationFrame(J);
|
|
9281
9284
|
}, x1 = () => {
|
|
9282
|
-
const
|
|
9283
|
-
|
|
9285
|
+
const x = { passive: !0 };
|
|
9286
|
+
F.current.iMouse?.isNeeded && h.current && (h.current.addEventListener("mousemove", t1, x), h.current.addEventListener("mouseout", K, x), h.current.addEventListener("mouseup", K, x), h.current.addEventListener("mousedown", e1, x), h.current.addEventListener("touchmove", t1, x), h.current.addEventListener("touchend", K, x), h.current.addEventListener("touchstart", e1, x)), F.current.iDeviceOrientation?.isNeeded && window.addEventListener(
|
|
9284
9287
|
"deviceorientation",
|
|
9285
9288
|
W,
|
|
9286
|
-
|
|
9287
|
-
), h.current && (P.current = new ResizeObserver(Q), P.current.observe(h.current), window.addEventListener("resize", Q,
|
|
9289
|
+
x
|
|
9290
|
+
), h.current && (P.current = new ResizeObserver(Q), P.current.observe(h.current), window.addEventListener("resize", Q, x));
|
|
9288
9291
|
}, b1 = () => {
|
|
9289
|
-
const
|
|
9290
|
-
|
|
9292
|
+
const x = { passive: !0 };
|
|
9293
|
+
F.current.iMouse?.isNeeded && h.current && (h.current.removeEventListener("mousemove", t1, x), h.current.removeEventListener("mouseout", K, x), h.current.removeEventListener("mouseup", K, x), h.current.removeEventListener("mousedown", e1, x), h.current.removeEventListener("touchmove", t1, x), h.current.removeEventListener("touchend", K, x), h.current.removeEventListener("touchstart", e1, x)), F.current.iDeviceOrientation?.isNeeded && window.removeEventListener(
|
|
9291
9294
|
"deviceorientation",
|
|
9292
9295
|
W,
|
|
9293
|
-
|
|
9294
|
-
), P.current && (P.current.disconnect(), window.removeEventListener("resize", Q,
|
|
9296
|
+
x
|
|
9297
|
+
), P.current && (P.current.disconnect(), window.removeEventListener("resize", Q, x));
|
|
9295
9298
|
};
|
|
9296
9299
|
return z(() => {
|
|
9297
|
-
|
|
9300
|
+
N.current = o;
|
|
9298
9301
|
}, [o]), z(() => {
|
|
9299
|
-
const
|
|
9302
|
+
const x = E.current;
|
|
9300
9303
|
function y() {
|
|
9301
9304
|
j();
|
|
9302
9305
|
const M = w.current;
|
|
@@ -9305,12 +9308,12 @@ ${y}`));
|
|
|
9305
9308
|
return requestAnimationFrame(y), () => {
|
|
9306
9309
|
const M = w.current;
|
|
9307
9310
|
if (M) {
|
|
9308
|
-
if (M.getExtension("WEBGL_lose_context")?.loseContext(), M.useProgram(null), M.deleteProgram(p.current ?? null),
|
|
9309
|
-
for (const D of
|
|
9311
|
+
if (M.getExtension("WEBGL_lose_context")?.loseContext(), M.useProgram(null), M.deleteProgram(p.current ?? null), x.length > 0)
|
|
9312
|
+
for (const D of x)
|
|
9310
9313
|
M.deleteTexture(D._webglTexture);
|
|
9311
9314
|
p.current = null;
|
|
9312
9315
|
}
|
|
9313
|
-
b1(), cancelAnimationFrame(
|
|
9316
|
+
b1(), cancelAnimationFrame(R.current ?? 0);
|
|
9314
9317
|
};
|
|
9315
9318
|
}, []), /* @__PURE__ */ t(
|
|
9316
9319
|
"canvas",
|
|
@@ -9892,7 +9895,7 @@ const X6 = ({
|
|
|
9892
9895
|
} = e, [u, C] = I(!1), [g, h] = I(!1), w = u || g, v = C1(), p = w && !!d, k = {
|
|
9893
9896
|
duration: v ? 0 : 0.2,
|
|
9894
9897
|
ease: [0.33, 1, 0.68, 1]
|
|
9895
|
-
},
|
|
9898
|
+
}, R = () => {
|
|
9896
9899
|
c?.();
|
|
9897
9900
|
}, H = (T) => {
|
|
9898
9901
|
T.currentTarget === T.target && (T.key === "Enter" || T.key === " ") && (T.preventDefault(), c?.());
|
|
@@ -9937,7 +9940,7 @@ const X6 = ({
|
|
|
9937
9940
|
c && f1(),
|
|
9938
9941
|
l
|
|
9939
9942
|
),
|
|
9940
|
-
onClick: c ?
|
|
9943
|
+
onClick: c ? R : void 0,
|
|
9941
9944
|
onKeyDown: c ? H : void 0,
|
|
9942
9945
|
onMouseEnter: () => C(!0),
|
|
9943
9946
|
onMouseLeave: () => C(!1),
|
|
@@ -10578,7 +10581,7 @@ const te = ({
|
|
|
10578
10581
|
icon: o ? bt : Lt,
|
|
10579
10582
|
onClick: a
|
|
10580
10583
|
}
|
|
10581
|
-
),
|
|
10584
|
+
), R = /* @__PURE__ */ t(
|
|
10582
10585
|
r1,
|
|
10583
10586
|
{
|
|
10584
10587
|
variant: "ghost",
|
|
@@ -10625,7 +10628,7 @@ const te = ({
|
|
|
10625
10628
|
children: [
|
|
10626
10629
|
H,
|
|
10627
10630
|
k,
|
|
10628
|
-
|
|
10631
|
+
R
|
|
10629
10632
|
]
|
|
10630
10633
|
}
|
|
10631
10634
|
)
|
|
@@ -10671,7 +10674,7 @@ const te = ({
|
|
|
10671
10674
|
),
|
|
10672
10675
|
H,
|
|
10673
10676
|
k,
|
|
10674
|
-
|
|
10677
|
+
R
|
|
10675
10678
|
]
|
|
10676
10679
|
}
|
|
10677
10680
|
)
|
|
@@ -10709,7 +10712,7 @@ const te = ({
|
|
|
10709
10712
|
),
|
|
10710
10713
|
H,
|
|
10711
10714
|
k,
|
|
10712
|
-
|
|
10715
|
+
R
|
|
10713
10716
|
]
|
|
10714
10717
|
}
|
|
10715
10718
|
)
|
|
@@ -10939,10 +10942,10 @@ const J4 = ({
|
|
|
10939
10942
|
}) => {
|
|
10940
10943
|
const u = G(), [C, g] = I("");
|
|
10941
10944
|
z(() => {
|
|
10942
|
-
const
|
|
10945
|
+
const L = (E) => {
|
|
10943
10946
|
E.key === "Escape" && e();
|
|
10944
10947
|
};
|
|
10945
|
-
return document.addEventListener("keydown",
|
|
10948
|
+
return document.addEventListener("keydown", L), () => document.removeEventListener("keydown", L);
|
|
10946
10949
|
}, [e]);
|
|
10947
10950
|
const h = X(
|
|
10948
10951
|
() => ({
|
|
@@ -10960,30 +10963,30 @@ const J4 = ({
|
|
|
10960
10963
|
), w = X(() => {
|
|
10961
10964
|
if (!C.trim())
|
|
10962
10965
|
return o;
|
|
10963
|
-
const
|
|
10964
|
-
return o.filter((E) => E.title.toLowerCase().includes(
|
|
10966
|
+
const L = C.toLowerCase();
|
|
10967
|
+
return o.filter((E) => E.title.toLowerCase().includes(L));
|
|
10965
10968
|
}, [o, C]), v = X(
|
|
10966
|
-
() => w.filter((
|
|
10969
|
+
() => w.filter((L) => c.has(L.id)),
|
|
10967
10970
|
[w, c]
|
|
10968
10971
|
), p = X(
|
|
10969
|
-
() => w.filter((
|
|
10972
|
+
() => w.filter((L) => !c.has(L.id)),
|
|
10970
10973
|
[w, c]
|
|
10971
10974
|
), k = X(
|
|
10972
10975
|
() => m4(p),
|
|
10973
10976
|
[p]
|
|
10974
|
-
),
|
|
10975
|
-
(
|
|
10976
|
-
r(
|
|
10977
|
+
), R = _(
|
|
10978
|
+
(L, E) => {
|
|
10979
|
+
r(L, E), e();
|
|
10977
10980
|
},
|
|
10978
10981
|
[r, e]
|
|
10979
10982
|
), H = _(() => {
|
|
10980
10983
|
n(), e();
|
|
10981
10984
|
}, [n, e]), T = _(
|
|
10982
|
-
(
|
|
10983
|
-
f(
|
|
10985
|
+
(L) => {
|
|
10986
|
+
f(L);
|
|
10984
10987
|
},
|
|
10985
10988
|
[f]
|
|
10986
|
-
),
|
|
10989
|
+
), S = v.length > 0 || k.length > 0;
|
|
10987
10990
|
return Ot(
|
|
10988
10991
|
/* @__PURE__ */ i(F1, { children: [
|
|
10989
10992
|
/* @__PURE__ */ t(
|
|
@@ -11021,7 +11024,7 @@ const J4 = ({
|
|
|
11021
11024
|
{
|
|
11022
11025
|
type: "text",
|
|
11023
11026
|
value: C,
|
|
11024
|
-
onChange: (
|
|
11027
|
+
onChange: (L) => g(L.target.value),
|
|
11025
11028
|
placeholder: u.ai.searchChats,
|
|
11026
11029
|
className: b(
|
|
11027
11030
|
"w-full",
|
|
@@ -11048,31 +11051,31 @@ const J4 = ({
|
|
|
11048
11051
|
),
|
|
11049
11052
|
s ? /* @__PURE__ */ t(v4, {}) : null,
|
|
11050
11053
|
!s && a ? /* @__PURE__ */ t("p", { className: "py-8 text-center text-base text-f1-foreground-tertiary", children: a }) : null,
|
|
11051
|
-
!s && !a && !
|
|
11054
|
+
!s && !a && !S ? /* @__PURE__ */ t("p", { className: "py-8 text-center text-base text-f1-foreground-tertiary", children: u.ai.noPreviousChats }) : null,
|
|
11052
11055
|
!s && !a && v.length > 0 ? /* @__PURE__ */ t(
|
|
11053
11056
|
lt,
|
|
11054
11057
|
{
|
|
11055
11058
|
label: u.ai.pinnedChats,
|
|
11056
11059
|
threads: v,
|
|
11057
11060
|
pinnedIds: c,
|
|
11058
|
-
onSelect:
|
|
11061
|
+
onSelect: R,
|
|
11059
11062
|
onPin: d,
|
|
11060
11063
|
onUnpin: l,
|
|
11061
11064
|
onDelete: T
|
|
11062
11065
|
}
|
|
11063
11066
|
) : null,
|
|
11064
|
-
!s && !a ? k.map((
|
|
11067
|
+
!s && !a ? k.map((L) => /* @__PURE__ */ t(
|
|
11065
11068
|
lt,
|
|
11066
11069
|
{
|
|
11067
|
-
label: h[
|
|
11068
|
-
threads:
|
|
11070
|
+
label: h[L.key],
|
|
11071
|
+
threads: L.threads,
|
|
11069
11072
|
pinnedIds: c,
|
|
11070
|
-
onSelect:
|
|
11073
|
+
onSelect: R,
|
|
11071
11074
|
onPin: d,
|
|
11072
11075
|
onUnpin: l,
|
|
11073
11076
|
onDelete: T
|
|
11074
11077
|
},
|
|
11075
|
-
|
|
11078
|
+
L.key
|
|
11076
11079
|
)) : null
|
|
11077
11080
|
] })
|
|
11078
11081
|
]
|
|
@@ -11101,10 +11104,10 @@ function e9({
|
|
|
11101
11104
|
const [a, c] = I([]), [d, l] = I(!1), [f, u] = I(null), [C, g] = I(L4), [h, w] = I(() => /* @__PURE__ */ new Set()), v = _(async () => {
|
|
11102
11105
|
l(!0), u(null);
|
|
11103
11106
|
try {
|
|
11104
|
-
const
|
|
11105
|
-
c(
|
|
11106
|
-
} catch (
|
|
11107
|
-
const E =
|
|
11107
|
+
const L = await r();
|
|
11108
|
+
c(L);
|
|
11109
|
+
} catch (L) {
|
|
11110
|
+
const E = L instanceof Error ? L.message : "Failed to fetch chat history";
|
|
11108
11111
|
u(E), c([]);
|
|
11109
11112
|
} finally {
|
|
11110
11113
|
l(!1);
|
|
@@ -11113,43 +11116,43 @@ function e9({
|
|
|
11113
11116
|
z(() => {
|
|
11114
11117
|
e && v();
|
|
11115
11118
|
}, [e, v]);
|
|
11116
|
-
const p = _((
|
|
11119
|
+
const p = _((L, E) => {
|
|
11117
11120
|
g((V) => {
|
|
11118
|
-
if (E === V.has(
|
|
11121
|
+
if (E === V.has(L))
|
|
11119
11122
|
return V;
|
|
11120
11123
|
const P = new Set(V);
|
|
11121
|
-
return E ? P.add(
|
|
11124
|
+
return E ? P.add(L) : P.delete(L), ut(P), P;
|
|
11122
11125
|
});
|
|
11123
|
-
}, []), k = _((
|
|
11126
|
+
}, []), k = _((L, E) => {
|
|
11124
11127
|
w((V) => {
|
|
11125
|
-
if (E === V.has(
|
|
11128
|
+
if (E === V.has(L))
|
|
11126
11129
|
return V;
|
|
11127
11130
|
const P = new Set(V);
|
|
11128
|
-
return E ? P.add(
|
|
11131
|
+
return E ? P.add(L) : P.delete(L), P;
|
|
11129
11132
|
});
|
|
11130
|
-
}, []),
|
|
11131
|
-
(
|
|
11133
|
+
}, []), R = _(
|
|
11134
|
+
(L, E) => {
|
|
11132
11135
|
const V = E ? o : s;
|
|
11133
|
-
p(
|
|
11136
|
+
p(L, E), V && (k(L, !0), V(L).catch(() => p(L, !E)).finally(() => k(L, !1)));
|
|
11134
11137
|
},
|
|
11135
11138
|
[o, s, p, k]
|
|
11136
|
-
), H = _((
|
|
11137
|
-
(
|
|
11138
|
-
[
|
|
11139
|
-
),
|
|
11140
|
-
async (
|
|
11141
|
-
k(
|
|
11139
|
+
), H = _((L) => R(L, !0), [R]), T = _(
|
|
11140
|
+
(L) => R(L, !1),
|
|
11141
|
+
[R]
|
|
11142
|
+
), S = _(
|
|
11143
|
+
async (L) => {
|
|
11144
|
+
k(L, !0);
|
|
11142
11145
|
try {
|
|
11143
|
-
await n(
|
|
11144
|
-
if (!E.has(
|
|
11146
|
+
await n(L), c((E) => E.filter((V) => V.id !== L)), g((E) => {
|
|
11147
|
+
if (!E.has(L))
|
|
11145
11148
|
return E;
|
|
11146
11149
|
const V = new Set(E);
|
|
11147
|
-
return V.delete(
|
|
11150
|
+
return V.delete(L), ut(V), V;
|
|
11148
11151
|
});
|
|
11149
11152
|
} catch {
|
|
11150
11153
|
v();
|
|
11151
11154
|
} finally {
|
|
11152
|
-
k(
|
|
11155
|
+
k(L, !1);
|
|
11153
11156
|
}
|
|
11154
11157
|
},
|
|
11155
11158
|
[n, v, k]
|
|
@@ -11163,7 +11166,7 @@ function e9({
|
|
|
11163
11166
|
pendingIds: h,
|
|
11164
11167
|
pinThread: H,
|
|
11165
11168
|
unpinThread: T,
|
|
11166
|
-
deleteThread:
|
|
11169
|
+
deleteThread: S
|
|
11167
11170
|
};
|
|
11168
11171
|
}
|
|
11169
11172
|
const x4 = Y.create(Tt), b4 = ({
|