@factorialco/f0-react 3.2.4 → 3.2.6
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/{F0CanvasPanel-C3fJQSVe.js → F0CanvasPanel-BIiLn_fA.js} +13078 -13066
- package/dist/ai.js +2 -2
- package/dist/experimental.js +4 -4
- package/dist/f0.js +6 -6
- package/dist/styles.css +1 -1
- package/dist/{useChatHistory-shjDpEO2.js → useChatHistory-Cr-xjwIK.js} +580 -568
- package/dist/{useDataCollectionSource-DAyA5jD3.js → useDataCollectionSource-BKkv1Qwq.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as c, jsx as r, Fragment as xe } from "react/jsx-runtime";
|
|
2
2
|
import { useInsertionEffect as to, forwardRef as p, createElement as $e, useRef as I, useMemo as ee, useEffect as X, useLayoutEffect as vt, useState as P, useCallback as q, createContext as Ye, useContext as Pe, useId as wt } from "react";
|
|
3
|
-
import { cj as ro, ck as oo, cl as no, cm as so, cn as xt, co as io, cp as ao, cq as co, cr as lo, cs as fo, ct as kt, cu as uo, cv as ho, cw as go, cx as po, cy as mo, cz as Co, cA as vo, cB as We, cC as wo, cD as xo, cE as ko, cF as bo, cG as Lo, Z as bt, cH as yo, cI as Mo, cJ as Eo, cK as Ro, cL as Fo, cM as Lt, cN as No, cO as So, a6 as m1, cP as Vo, aJ as To, cQ as Ho, cR as Ao, cS as Bo, ag as $o, cT as Io, bO as Po, aa as C1, ad as jo, cU as Do, ba as v1, a1 as yt, S as Ke, cV as Mt, b9 as Zo, cW as _o, cX as Oo, b2 as Uo, bN as zo, $ as Le, au as Go, be as Et, cY as Wo, bL as qo, cZ as Re, bH as Xo, c_ as Yo, c$ as Rt, b1 as Ft, d0 as Ko, d1 as Qo, d2 as Jo, d3 as en, d4 as tn, d5 as Nt, bz as rn, bA as on, d6 as nn, d7 as sn, d8 as an, d9 as cn, da as ln, db as dn, dc as fn, dd as un, de as hn, df as gn, dg as pn, dh as mn, di as Cn, bM as vn, ab as wn, bv as xn, dj as kn, dk as bn, dl as Ln, dm as yn, dn as Mn, dp as En, dq as Rn, ap as Fn, dr as St, M as Nn, a0 as Sn, ds as Vt, dt as Tt, du as Vn, bd as Tn, bc as Hn, dv as An, dw as Ht, dx as Bn, b0 as $n, ay as In, dy as Pn, as as jn, b7 as Dn, dz as At, b6 as Zn, dA as _n, bi as w1, dB as On, dC as x1, bJ as Un, bI as zn, bK as Bt, dD as Gn, G as Wn, E as qn, dE as Xn, dF as Yn, dG as Kn, dH as Qn, dI as Jn, dJ as $t, dK as es, ac as ts, dL as rs, L as fe, q as Fe, o as x, ae as ce, dM as os, bp as ns, bC as ss, y as It, dN as is, a5 as Qe, b$ as as, at as cs, Q as pe, H as le, a8 as Pt, af as jt, bq as Dt, dO as ls, dP as ds, dQ as fs, U as ue, u as Y, dR as us, cg as Zt, v as me, a2 as hs, dS as gs, aP as ye, A as Ne, p as ne, aD as k1, dT as ps, aE as b1, aF as L1, b as Me, dU as ms, dV as Cs, bD as vs, V as ws, a$ as xs, dW as ks, dX as bs, dY as Ls, dZ as $1, a3 as ys, ak as _t, aS as Ot, d_ as Ms, b_ as Es, d$ as Rs, e0 as Fs, aX as Ut, e1 as Ns, bU as Ss, e2 as Vs, aU as Ie, bg as zt, e3 as Gt, bh as Wt, c as u1, e4 as qt, e5 as Ts, bk as Hs, e6 as As, b8 as y1, bw as Bs, e7 as $s, e8 as Is, e9 as Ps, ea as js, eb as Ds, z as Zs, ec as Xt, ed as Yt, ee as _s, aj as I1, ef as Os, ai as Us, eg as zs, eh as Gs } from "./F0CanvasPanel-
|
|
3
|
+
import { cj as ro, ck as oo, cl as no, cm as so, cn as xt, co as io, cp as ao, cq as co, cr as lo, cs as fo, ct as kt, cu as uo, cv as ho, cw as go, cx as po, cy as mo, cz as Co, cA as vo, cB as We, cC as wo, cD as xo, cE as ko, cF as bo, cG as Lo, Z as bt, cH as yo, cI as Mo, cJ as Eo, cK as Ro, cL as Fo, cM as Lt, cN as No, cO as So, a6 as m1, cP as Vo, aJ as To, cQ as Ho, cR as Ao, cS as Bo, ag as $o, cT as Io, bO as Po, aa as C1, ad as jo, cU as Do, ba as v1, a1 as yt, S as Ke, cV as Mt, b9 as Zo, cW as _o, cX as Oo, b2 as Uo, bN as zo, $ as Le, au as Go, be as Et, cY as Wo, bL as qo, cZ as Re, bH as Xo, c_ as Yo, c$ as Rt, b1 as Ft, d0 as Ko, d1 as Qo, d2 as Jo, d3 as en, d4 as tn, d5 as Nt, bz as rn, bA as on, d6 as nn, d7 as sn, d8 as an, d9 as cn, da as ln, db as dn, dc as fn, dd as un, de as hn, df as gn, dg as pn, dh as mn, di as Cn, bM as vn, ab as wn, bv as xn, dj as kn, dk as bn, dl as Ln, dm as yn, dn as Mn, dp as En, dq as Rn, ap as Fn, dr as St, M as Nn, a0 as Sn, ds as Vt, dt as Tt, du as Vn, bd as Tn, bc as Hn, dv as An, dw as Ht, dx as Bn, b0 as $n, ay as In, dy as Pn, as as jn, b7 as Dn, dz as At, b6 as Zn, dA as _n, bi as w1, dB as On, dC as x1, bJ as Un, bI as zn, bK as Bt, dD as Gn, G as Wn, E as qn, dE as Xn, dF as Yn, dG as Kn, dH as Qn, dI as Jn, dJ as $t, dK as es, ac as ts, dL as rs, L as fe, q as Fe, o as x, ae as ce, dM as os, bp as ns, bC as ss, y as It, dN as is, a5 as Qe, b$ as as, at as cs, Q as pe, H as le, a8 as Pt, af as jt, bq as Dt, dO as ls, dP as ds, dQ as fs, U as ue, u as Y, dR as us, cg as Zt, v as me, a2 as hs, dS as gs, aP as ye, A as Ne, p as ne, aD as k1, dT as ps, aE as b1, aF as L1, b as Me, dU as ms, dV as Cs, bD as vs, V as ws, a$ as xs, dW as ks, dX as bs, dY as Ls, dZ as $1, a3 as ys, ak as _t, aS as Ot, d_ as Ms, b_ as Es, d$ as Rs, e0 as Fs, aX as Ut, e1 as Ns, bU as Ss, e2 as Vs, aU as Ie, bg as zt, e3 as Gt, bh as Wt, c as u1, e4 as qt, e5 as Ts, bk as Hs, e6 as As, b8 as y1, bw as Bs, e7 as $s, e8 as Is, e9 as Ps, ea as js, eb as Ds, z as Zs, ec as Xt, ed as Yt, ee as _s, aj as I1, ef as Os, ai as Us, eg as zs, eh as Gs } from "./F0CanvasPanel-BIiLn_fA.js";
|
|
4
4
|
import { createPortal as Kt } from "react-dom";
|
|
5
5
|
import { defaultTranslations as Ws } from "./i18n-provider-defaults.js";
|
|
6
6
|
import { useTrackVolume as qs } from "@livekit/components-react";
|
|
@@ -63,15 +63,15 @@ function ni(e, { defaultTransition: t = {}, ...o } = {}, n, s) {
|
|
|
63
63
|
}
|
|
64
64
|
let [v, w, k = {}] = C;
|
|
65
65
|
k.at !== void 0 && (g = P1(g, k.at, f, u));
|
|
66
|
-
let
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
let { ease: K = t.ease || "easeOut", duration: O } =
|
|
70
|
-
const Z = typeof
|
|
66
|
+
let T = 0;
|
|
67
|
+
const H = (R, L, b, A = 0, V = 0) => {
|
|
68
|
+
const y = si(R), { delay: E = 0, times: F = io(y), type: $ = "keyframes", repeat: _, repeatType: z, repeatDelay: G = 0, ...re } = L;
|
|
69
|
+
let { ease: K = t.ease || "easeOut", duration: O } = L;
|
|
70
|
+
const Z = typeof E == "function" ? E(A, V) : E, D = y.length, Q = lo($) ? $ : s?.[$];
|
|
71
71
|
if (D <= 2 && Q) {
|
|
72
72
|
let ie = 100;
|
|
73
|
-
if (D === 2 && ci(
|
|
74
|
-
const de =
|
|
73
|
+
if (D === 2 && ci(y)) {
|
|
74
|
+
const de = y[1] - y[0];
|
|
75
75
|
ie = Math.abs(de);
|
|
76
76
|
}
|
|
77
77
|
const oe = { ...re };
|
|
@@ -81,56 +81,56 @@ function ni(e, { defaultTransition: t = {}, ...o } = {}, n, s) {
|
|
|
81
81
|
}
|
|
82
82
|
O ?? (O = i);
|
|
83
83
|
const W = g + Z;
|
|
84
|
-
|
|
85
|
-
const he =
|
|
86
|
-
if (he > 0 && co(
|
|
84
|
+
F.length === 1 && F[0] === 0 && (F[1] = 1);
|
|
85
|
+
const he = F.length - y.length;
|
|
86
|
+
if (he > 0 && co(F, he), y.length === 1 && y.unshift(null), _) {
|
|
87
87
|
kt(_ < oi, "Repeat count too high, must be less than 20"), O = Ys(O, _);
|
|
88
|
-
const ie = [...
|
|
88
|
+
const ie = [...y], oe = [...F];
|
|
89
89
|
K = Array.isArray(K) ? [...K] : [K];
|
|
90
90
|
const se = [...K];
|
|
91
91
|
for (let de = 0; de < _; de++) {
|
|
92
|
-
|
|
92
|
+
y.push(...ie);
|
|
93
93
|
for (let M = 0; M < ie.length; M++)
|
|
94
|
-
|
|
94
|
+
F.push(oe[M] + (de + 1)), K.push(M === 0 ? "linear" : Jt(se, M - 1));
|
|
95
95
|
}
|
|
96
|
-
ei(
|
|
96
|
+
ei(F, _);
|
|
97
97
|
}
|
|
98
98
|
const ge = W + O;
|
|
99
|
-
Js(
|
|
99
|
+
Js(b, y, K, F, W, ge), T = Math.max(Z + O, T), m = Math.max(ge, m);
|
|
100
100
|
};
|
|
101
101
|
if (xt(v)) {
|
|
102
|
-
const
|
|
103
|
-
|
|
102
|
+
const R = j1(v, d);
|
|
103
|
+
H(w, k, D1("default", R));
|
|
104
104
|
} else {
|
|
105
|
-
const
|
|
106
|
-
for (let
|
|
105
|
+
const R = Qt(v, w, n, l), L = R.length;
|
|
106
|
+
for (let b = 0; b < L; b++) {
|
|
107
107
|
w = w, k = k;
|
|
108
|
-
const
|
|
109
|
-
for (const
|
|
110
|
-
|
|
108
|
+
const A = R[b], V = j1(A, d);
|
|
109
|
+
for (const y in w)
|
|
110
|
+
H(w[y], ii(k, y), D1(y, V), b, L);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
f = g, g +=
|
|
113
|
+
f = g, g += T;
|
|
114
114
|
}
|
|
115
115
|
return d.forEach((h, C) => {
|
|
116
116
|
for (const v in h) {
|
|
117
117
|
const w = h[v];
|
|
118
118
|
w.sort(ti);
|
|
119
|
-
const k = [],
|
|
120
|
-
for (let
|
|
121
|
-
const { at:
|
|
122
|
-
k.push(
|
|
119
|
+
const k = [], T = [], H = [];
|
|
120
|
+
for (let L = 0; L < w.length; L++) {
|
|
121
|
+
const { at: b, value: A, easing: V } = w[L];
|
|
122
|
+
k.push(A), T.push(uo(0, m, b)), H.push(V || "easeOut");
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
T[0] !== 0 && (T.unshift(0), k.unshift(k[0]), H.unshift(ri)), T[T.length - 1] !== 1 && (T.push(1), k.push(null)), a.has(C) || a.set(C, {
|
|
125
125
|
keyframes: {},
|
|
126
126
|
transition: {}
|
|
127
127
|
});
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const R = a.get(C);
|
|
129
|
+
R.keyframes[v] = k, R.transition[v] = {
|
|
130
130
|
...t,
|
|
131
131
|
duration: m,
|
|
132
|
-
ease:
|
|
133
|
-
times:
|
|
132
|
+
ease: H,
|
|
133
|
+
times: T,
|
|
134
134
|
...o
|
|
135
135
|
};
|
|
136
136
|
}
|
|
@@ -7140,19 +7140,19 @@ const Jl = Fe({
|
|
|
7140
7140
|
marginX: v,
|
|
7141
7141
|
marginY: w,
|
|
7142
7142
|
marginTop: k,
|
|
7143
|
-
marginBottom:
|
|
7144
|
-
marginLeft:
|
|
7145
|
-
marginRight:
|
|
7143
|
+
marginBottom: T,
|
|
7144
|
+
marginLeft: H,
|
|
7145
|
+
marginRight: R,
|
|
7146
7146
|
// Gap
|
|
7147
|
-
gap:
|
|
7147
|
+
gap: L,
|
|
7148
7148
|
// Grid
|
|
7149
|
-
columns:
|
|
7150
|
-
rows:
|
|
7151
|
-
colSpan:
|
|
7152
|
-
colStart:
|
|
7153
|
-
rowSpan:
|
|
7149
|
+
columns: b,
|
|
7150
|
+
rows: A,
|
|
7151
|
+
colSpan: V,
|
|
7152
|
+
colStart: y,
|
|
7153
|
+
rowSpan: E,
|
|
7154
7154
|
// Dimensions
|
|
7155
|
-
width:
|
|
7155
|
+
width: F,
|
|
7156
7156
|
height: $,
|
|
7157
7157
|
minWidth: _,
|
|
7158
7158
|
minHeight: z,
|
|
@@ -7174,8 +7174,8 @@ const Jl = Fe({
|
|
|
7174
7174
|
borderRadiusBottomRight: de,
|
|
7175
7175
|
borderStyle: M,
|
|
7176
7176
|
// Overflow
|
|
7177
|
-
overflow:
|
|
7178
|
-
overflowX:
|
|
7177
|
+
overflow: S,
|
|
7178
|
+
overflowX: N,
|
|
7179
7179
|
overflowY: j,
|
|
7180
7180
|
// Divider
|
|
7181
7181
|
divider: B,
|
|
@@ -7224,16 +7224,16 @@ const Jl = Fe({
|
|
|
7224
7224
|
marginX: v,
|
|
7225
7225
|
marginY: w,
|
|
7226
7226
|
marginTop: k,
|
|
7227
|
-
marginBottom:
|
|
7228
|
-
marginLeft:
|
|
7229
|
-
marginRight:
|
|
7230
|
-
gap:
|
|
7231
|
-
columns:
|
|
7232
|
-
rows:
|
|
7233
|
-
colSpan:
|
|
7234
|
-
colStart:
|
|
7235
|
-
rowSpan:
|
|
7236
|
-
width:
|
|
7227
|
+
marginBottom: T,
|
|
7228
|
+
marginLeft: H,
|
|
7229
|
+
marginRight: R,
|
|
7230
|
+
gap: L,
|
|
7231
|
+
columns: b,
|
|
7232
|
+
rows: A,
|
|
7233
|
+
colSpan: V,
|
|
7234
|
+
colStart: y,
|
|
7235
|
+
rowSpan: E,
|
|
7236
|
+
width: F,
|
|
7237
7237
|
height: $,
|
|
7238
7238
|
minWidth: _,
|
|
7239
7239
|
minHeight: z,
|
|
@@ -7252,8 +7252,8 @@ const Jl = Fe({
|
|
|
7252
7252
|
borderRadiusBottomLeft: se,
|
|
7253
7253
|
borderRadiusBottomRight: de,
|
|
7254
7254
|
borderStyle: M,
|
|
7255
|
-
overflow:
|
|
7256
|
-
overflowX:
|
|
7255
|
+
overflow: S,
|
|
7256
|
+
overflowX: N,
|
|
7257
7257
|
overflowY: j,
|
|
7258
7258
|
divider: B,
|
|
7259
7259
|
dividerColor: U,
|
|
@@ -7405,40 +7405,47 @@ function Z1({
|
|
|
7405
7405
|
stack: a = "none",
|
|
7406
7406
|
fullWidthOnStack: d = !1,
|
|
7407
7407
|
reverseOnStack: l = !1,
|
|
7408
|
-
|
|
7408
|
+
canOverflow: u = !0,
|
|
7409
|
+
className: f
|
|
7409
7410
|
}) {
|
|
7410
|
-
const
|
|
7411
|
-
ref:
|
|
7411
|
+
const g = I(null), { width: m = 0 } = ss({
|
|
7412
|
+
ref: g,
|
|
7412
7413
|
box: "border-box"
|
|
7413
|
-
}),
|
|
7414
|
+
}), h = a === "sm" || a === "md" ? c1[a] : c1.md, C = It(`(min-width: ${h}px)`, {
|
|
7414
7415
|
initializeWithValue: !1
|
|
7415
|
-
}),
|
|
7416
|
+
}), v = a === "none" ? !0 : a === "container-md" ? m >= c1["container-md"] : C, w = typeof n == "string" ? n : n.base, k = typeof n == "string" ? n : n.md, T = v ? k : w, H = Array.isArray(
|
|
7416
7417
|
t
|
|
7417
|
-
) ? t : [],
|
|
7418
|
+
) ? t : [], R = t != null && !Array.isArray(t) ? t : void 0, L = {
|
|
7418
7419
|
primaryAction: e,
|
|
7419
|
-
secondaryItems:
|
|
7420
|
-
secondaryLink:
|
|
7420
|
+
secondaryItems: H,
|
|
7421
|
+
secondaryLink: R,
|
|
7421
7422
|
otherActions: o,
|
|
7422
|
-
size:
|
|
7423
|
+
size: T,
|
|
7423
7424
|
gap: s,
|
|
7424
|
-
align: i
|
|
7425
|
+
align: i,
|
|
7426
|
+
canOverflow: u
|
|
7425
7427
|
};
|
|
7426
7428
|
return /* @__PURE__ */ r(
|
|
7427
7429
|
"div",
|
|
7428
7430
|
{
|
|
7429
|
-
ref:
|
|
7431
|
+
ref: g,
|
|
7430
7432
|
role: "group",
|
|
7431
7433
|
className: x(
|
|
7432
|
-
|
|
7434
|
+
v ? (
|
|
7435
|
+
// Keep the pinned trailing items (splits, divider, primary) at their
|
|
7436
|
+
// natural width; only the first child — the flex-1 cluster — shrinks,
|
|
7437
|
+
// so the title truncates against it rather than squeezing the buttons.
|
|
7438
|
+
"flex w-full items-center [&>*:not(:first-child)]:shrink-0"
|
|
7439
|
+
) : t2({
|
|
7433
7440
|
align: i,
|
|
7434
7441
|
stack: a,
|
|
7435
7442
|
fullWidthOnStack: d,
|
|
7436
7443
|
reverseOnStack: l
|
|
7437
7444
|
}),
|
|
7438
|
-
|
|
7445
|
+
f
|
|
7439
7446
|
),
|
|
7440
7447
|
style: { gap: s },
|
|
7441
|
-
children:
|
|
7448
|
+
children: v ? /* @__PURE__ */ r(n2, { ...L }, "row") : /* @__PURE__ */ r(o2, { ...L }, "stacked")
|
|
7442
7449
|
}
|
|
7443
7450
|
);
|
|
7444
7451
|
}
|
|
@@ -7468,86 +7475,90 @@ function n2({
|
|
|
7468
7475
|
otherActions: n,
|
|
7469
7476
|
size: s,
|
|
7470
7477
|
gap: i,
|
|
7471
|
-
align: a
|
|
7478
|
+
align: a,
|
|
7479
|
+
canOverflow: d
|
|
7472
7480
|
}) {
|
|
7473
|
-
const
|
|
7481
|
+
const l = ee(
|
|
7474
7482
|
() => t.filter(r2),
|
|
7475
7483
|
[t]
|
|
7476
7484
|
), {
|
|
7477
|
-
containerRef:
|
|
7478
|
-
measurementContainerRef:
|
|
7479
|
-
customOverflowIndicatorRef:
|
|
7480
|
-
visibleItems:
|
|
7481
|
-
overflowItems:
|
|
7482
|
-
isInitialized:
|
|
7483
|
-
} = is(
|
|
7485
|
+
containerRef: u,
|
|
7486
|
+
measurementContainerRef: f,
|
|
7487
|
+
customOverflowIndicatorRef: g,
|
|
7488
|
+
visibleItems: m,
|
|
7489
|
+
overflowItems: h,
|
|
7490
|
+
isInitialized: C
|
|
7491
|
+
} = is(l, i);
|
|
7484
7492
|
X(() => {
|
|
7485
|
-
|
|
7486
|
-
}, [
|
|
7487
|
-
const
|
|
7488
|
-
t.forEach((
|
|
7489
|
-
if (!qe(
|
|
7490
|
-
if (g1(
|
|
7491
|
-
|
|
7493
|
+
f.current?.setAttribute("inert", "");
|
|
7494
|
+
}, [f]);
|
|
7495
|
+
const v = d && C ? m : l, w = d ? C ? h : [] : [], k = new Set(v.map((y) => y.id)), T = e ? yr(e, s) : null, H = t.filter(qe), R = t[t.length - 1], L = R != null && g1(R) && (H.length > 0 || T != null), b = [];
|
|
7496
|
+
t.forEach((y, E) => {
|
|
7497
|
+
if (!qe(y)) {
|
|
7498
|
+
if (g1(y)) {
|
|
7499
|
+
b.push({ kind: "sep", key: `sep-${E}` });
|
|
7492
7500
|
return;
|
|
7493
7501
|
}
|
|
7494
|
-
|
|
7502
|
+
k.has(y.id) && b.push({
|
|
7495
7503
|
kind: "node",
|
|
7496
|
-
node: Xe(
|
|
7504
|
+
node: Xe(y, s, "outline")
|
|
7497
7505
|
});
|
|
7498
7506
|
}
|
|
7499
7507
|
});
|
|
7500
|
-
const
|
|
7501
|
-
(
|
|
7502
|
-
),
|
|
7503
|
-
...
|
|
7504
|
-
(
|
|
7505
|
-
label:
|
|
7506
|
-
icon:
|
|
7507
|
-
onClick:
|
|
7508
|
-
href:
|
|
7509
|
-
critical:
|
|
7508
|
+
const A = b.filter(
|
|
7509
|
+
(y, E) => y.kind === "node" || b[E - 1]?.kind === "node" && b[E + 1]?.kind === "node"
|
|
7510
|
+
), V = [
|
|
7511
|
+
...w.map(
|
|
7512
|
+
(y) => ({
|
|
7513
|
+
label: y.label,
|
|
7514
|
+
icon: y.icon,
|
|
7515
|
+
onClick: y.onClick,
|
|
7516
|
+
href: y.href,
|
|
7517
|
+
critical: y.critical
|
|
7510
7518
|
})
|
|
7511
7519
|
),
|
|
7512
|
-
...
|
|
7520
|
+
...w.length > 0 && n.length > 0 ? [{ type: "separator" }] : [],
|
|
7513
7521
|
...n
|
|
7514
7522
|
];
|
|
7515
7523
|
return /* @__PURE__ */ c(xe, { children: [
|
|
7516
7524
|
/* @__PURE__ */ c(
|
|
7517
7525
|
"div",
|
|
7518
7526
|
{
|
|
7519
|
-
ref:
|
|
7527
|
+
ref: u,
|
|
7520
7528
|
className: x(
|
|
7521
|
-
|
|
7529
|
+
// `[&>*]:shrink-0` keeps each rendered secondary, separator, link and
|
|
7530
|
+
// the "⋯" trigger at its natural width: the row overflows by shedding
|
|
7531
|
+
// into the menu, never by squeezing a button to nothing.
|
|
7532
|
+
"relative flex min-w-0 flex-1 items-center [&>*]:shrink-0",
|
|
7522
7533
|
a === "end" && "justify-end"
|
|
7523
7534
|
),
|
|
7524
7535
|
style: { gap: i },
|
|
7525
7536
|
children: [
|
|
7526
|
-
/* @__PURE__ */ r(
|
|
7537
|
+
d && /* @__PURE__ */ r(
|
|
7527
7538
|
"div",
|
|
7528
7539
|
{
|
|
7529
|
-
ref:
|
|
7540
|
+
ref: f,
|
|
7530
7541
|
"aria-hidden": "true",
|
|
7531
7542
|
className: "pointer-events-none invisible absolute left-0 top-0 flex items-center whitespace-nowrap",
|
|
7532
7543
|
style: { gap: i },
|
|
7533
|
-
children:
|
|
7534
|
-
(
|
|
7544
|
+
children: l.map(
|
|
7545
|
+
(y) => Xe(y, s, "outline")
|
|
7535
7546
|
)
|
|
7536
7547
|
}
|
|
7537
7548
|
),
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
(
|
|
7549
|
+
V.length > 0 && /* @__PURE__ */ r("div", { ref: g, children: /* @__PURE__ */ r(Qe, { items: V, icon: Rt, size: s }) }),
|
|
7550
|
+
A.map(
|
|
7551
|
+
(y) => y.kind === "sep" ? /* @__PURE__ */ r(_1, {}, y.key) : y.node
|
|
7541
7552
|
),
|
|
7542
7553
|
o && Lr(o, s)
|
|
7543
7554
|
]
|
|
7544
7555
|
}
|
|
7545
7556
|
),
|
|
7546
|
-
|
|
7547
|
-
(
|
|
7557
|
+
H.map(
|
|
7558
|
+
(y) => F1(y, s, "outline")
|
|
7548
7559
|
),
|
|
7549
|
-
|
|
7550
|
-
|
|
7560
|
+
L && /* @__PURE__ */ r(_1, {}),
|
|
7561
|
+
T
|
|
7551
7562
|
] });
|
|
7552
7563
|
}
|
|
7553
7564
|
function _1() {
|
|
@@ -7638,7 +7649,7 @@ function d2({
|
|
|
7638
7649
|
hideLabel: w,
|
|
7639
7650
|
disabled: s.disabled,
|
|
7640
7651
|
onClick: s.onClick
|
|
7641
|
-
} : void 0,
|
|
7652
|
+
} : void 0, T = n ? {
|
|
7642
7653
|
id: "confirm",
|
|
7643
7654
|
icon: C1,
|
|
7644
7655
|
label: n.label ?? "Confirm",
|
|
@@ -7649,10 +7660,11 @@ function d2({
|
|
|
7649
7660
|
return /* @__PURE__ */ r(
|
|
7650
7661
|
Z1,
|
|
7651
7662
|
{
|
|
7652
|
-
primaryAction:
|
|
7663
|
+
primaryAction: T,
|
|
7653
7664
|
secondaryActions: k ? [k] : void 0,
|
|
7654
7665
|
size: l,
|
|
7655
|
-
gap: O1
|
|
7666
|
+
gap: O1,
|
|
7667
|
+
canOverflow: !1
|
|
7656
7668
|
}
|
|
7657
7669
|
);
|
|
7658
7670
|
}, v = (
|
|
@@ -8198,23 +8210,23 @@ const w2 = ({
|
|
|
8198
8210
|
}
|
|
8199
8211
|
if (s)
|
|
8200
8212
|
return f(!1), a(C), v(), g.current = setTimeout(() => {
|
|
8201
|
-
const
|
|
8202
|
-
l(
|
|
8213
|
+
const L = (d + 1) % Math.max(e.length, 1);
|
|
8214
|
+
l(L);
|
|
8203
8215
|
}, 4e3), () => {
|
|
8204
8216
|
v();
|
|
8205
8217
|
};
|
|
8206
8218
|
f(!0), a("");
|
|
8207
8219
|
let w = 0;
|
|
8208
|
-
const k = 50,
|
|
8220
|
+
const k = 50, T = 30, H = 2e3, R = 1e3;
|
|
8209
8221
|
return m.current = setInterval(() => {
|
|
8210
8222
|
w < C.length ? (a(C.slice(0, w + 1)), w++) : (m.current && (clearInterval(m.current), m.current = null), g.current = setTimeout(() => {
|
|
8211
8223
|
h.current = setInterval(() => {
|
|
8212
8224
|
w > 0 ? (w--, a(C.slice(0, w))) : (h.current && (clearInterval(h.current), h.current = null), g.current = setTimeout(() => {
|
|
8213
|
-
const
|
|
8214
|
-
l(
|
|
8215
|
-
},
|
|
8216
|
-
},
|
|
8217
|
-
},
|
|
8225
|
+
const L = (d + 1) % Math.max(e.length, 1);
|
|
8226
|
+
l(L);
|
|
8227
|
+
}, R));
|
|
8228
|
+
}, T);
|
|
8229
|
+
}, H));
|
|
8218
8230
|
}, k), () => {
|
|
8219
8231
|
v();
|
|
8220
8232
|
};
|
|
@@ -8507,8 +8519,8 @@ function N2(e) {
|
|
|
8507
8519
|
X(() => {
|
|
8508
8520
|
h.current = t.length;
|
|
8509
8521
|
}, [t]);
|
|
8510
|
-
const C = q((
|
|
8511
|
-
i.current && clearTimeout(i.current), s(
|
|
8522
|
+
const C = q((H) => {
|
|
8523
|
+
i.current && clearTimeout(i.current), s(H), i.current = setTimeout(() => {
|
|
8512
8524
|
s(null), i.current = null;
|
|
8513
8525
|
}, F2);
|
|
8514
8526
|
}, []);
|
|
@@ -8519,11 +8531,11 @@ function N2(e) {
|
|
|
8519
8531
|
[]
|
|
8520
8532
|
);
|
|
8521
8533
|
const v = q(
|
|
8522
|
-
async (
|
|
8523
|
-
if (
|
|
8524
|
-
const
|
|
8525
|
-
if (
|
|
8526
|
-
if (f !== void 0 && h.current +
|
|
8534
|
+
async (H) => {
|
|
8535
|
+
if (H.length === 0 || !l) return;
|
|
8536
|
+
const R = R2(H, u);
|
|
8537
|
+
if (R.length === 0) return;
|
|
8538
|
+
if (f !== void 0 && h.current + R.length > f) {
|
|
8527
8539
|
C(
|
|
8528
8540
|
d.ai.tooManyFilesError.replace(
|
|
8529
8541
|
"{{maxFiles}}",
|
|
@@ -8532,40 +8544,40 @@ function N2(e) {
|
|
|
8532
8544
|
);
|
|
8533
8545
|
return;
|
|
8534
8546
|
}
|
|
8535
|
-
const
|
|
8547
|
+
const L = R.map((V) => ({
|
|
8536
8548
|
id: crypto.randomUUID(),
|
|
8537
|
-
file:
|
|
8549
|
+
file: V,
|
|
8538
8550
|
status: "uploading"
|
|
8539
|
-
})),
|
|
8540
|
-
o((
|
|
8541
|
-
const
|
|
8542
|
-
(
|
|
8543
|
-
(
|
|
8551
|
+
})), b = L.map((V) => V.id);
|
|
8552
|
+
o((V) => [...V, ...L]);
|
|
8553
|
+
const A = (V) => o(
|
|
8554
|
+
(y) => y.map(
|
|
8555
|
+
(E) => b.includes(E.id) ? { ...E, status: "error", errorMessage: V } : E
|
|
8544
8556
|
)
|
|
8545
8557
|
);
|
|
8546
8558
|
try {
|
|
8547
|
-
const
|
|
8548
|
-
if (!Array.isArray(
|
|
8549
|
-
|
|
8559
|
+
const V = await l(R);
|
|
8560
|
+
if (!Array.isArray(V) || V.length !== R.length) {
|
|
8561
|
+
A(d.ai.fileUploadError);
|
|
8550
8562
|
return;
|
|
8551
8563
|
}
|
|
8552
8564
|
o(
|
|
8553
|
-
(
|
|
8554
|
-
const
|
|
8555
|
-
return
|
|
8556
|
-
...
|
|
8565
|
+
(y) => y.map((E) => {
|
|
8566
|
+
const F = L.findIndex(($) => $.id === E.id);
|
|
8567
|
+
return F === -1 ? E : V[F] ? {
|
|
8568
|
+
...E,
|
|
8557
8569
|
status: "uploaded",
|
|
8558
|
-
uploadedFile:
|
|
8570
|
+
uploadedFile: V[F]
|
|
8559
8571
|
} : {
|
|
8560
|
-
...
|
|
8572
|
+
...E,
|
|
8561
8573
|
status: "error",
|
|
8562
8574
|
errorMessage: d.ai.fileUploadError
|
|
8563
8575
|
};
|
|
8564
8576
|
})
|
|
8565
8577
|
);
|
|
8566
|
-
} catch (
|
|
8567
|
-
const
|
|
8568
|
-
|
|
8578
|
+
} catch (V) {
|
|
8579
|
+
const y = V instanceof Error && V.message ? V.message : d.ai.fileUploadError;
|
|
8580
|
+
A(y);
|
|
8569
8581
|
}
|
|
8570
8582
|
},
|
|
8571
8583
|
[
|
|
@@ -8577,13 +8589,13 @@ function N2(e) {
|
|
|
8577
8589
|
C
|
|
8578
8590
|
]
|
|
8579
8591
|
), w = q(
|
|
8580
|
-
async (
|
|
8581
|
-
await v(Array.from(
|
|
8592
|
+
async (H) => {
|
|
8593
|
+
await v(Array.from(H.target.files ?? [])), H.target.value = "";
|
|
8582
8594
|
},
|
|
8583
8595
|
[v]
|
|
8584
|
-
), k = q((
|
|
8585
|
-
o((
|
|
8586
|
-
}, []),
|
|
8596
|
+
), k = q((H) => {
|
|
8597
|
+
o((R) => R.filter((L) => L.id !== H));
|
|
8598
|
+
}, []), T = q(() => {
|
|
8587
8599
|
o([]);
|
|
8588
8600
|
}, []);
|
|
8589
8601
|
return {
|
|
@@ -8596,7 +8608,7 @@ function N2(e) {
|
|
|
8596
8608
|
processFiles: v,
|
|
8597
8609
|
handleFileSelect: w,
|
|
8598
8610
|
handleRemoveFile: k,
|
|
8599
|
-
clearFiles:
|
|
8611
|
+
clearFiles: T,
|
|
8600
8612
|
transientError: n,
|
|
8601
8613
|
showTransientError: C
|
|
8602
8614
|
};
|
|
@@ -8679,57 +8691,57 @@ function A2({
|
|
|
8679
8691
|
searchPersons: n,
|
|
8680
8692
|
textareaRef: s
|
|
8681
8693
|
}) {
|
|
8682
|
-
const [i, a] = P(!1), [d, l] = P(""), [u, f] = P([]), [g, m] = P(!1), [h, C] = P(0), [v, w] = P([]), k = I(-1),
|
|
8694
|
+
const [i, a] = P(!1), [d, l] = P(""), [u, f] = P([]), [g, m] = P(!1), [h, C] = P(0), [v, w] = P([]), k = I(-1), T = I(null), H = I(0), R = I(-1);
|
|
8683
8695
|
X(() => {
|
|
8684
8696
|
if (!n) {
|
|
8685
8697
|
a(!1);
|
|
8686
8698
|
return;
|
|
8687
8699
|
}
|
|
8688
|
-
const
|
|
8689
|
-
if (!
|
|
8690
|
-
a(!1), l(""), f([]), C(0), k.current = -1,
|
|
8700
|
+
const F = S2(e, o, v);
|
|
8701
|
+
if (!F) {
|
|
8702
|
+
a(!1), l(""), f([]), C(0), k.current = -1, R.current = -1;
|
|
8691
8703
|
return;
|
|
8692
8704
|
}
|
|
8693
|
-
if (
|
|
8705
|
+
if (F.atIndex === R.current)
|
|
8694
8706
|
return;
|
|
8695
|
-
k.current =
|
|
8696
|
-
const $ = ++
|
|
8697
|
-
return
|
|
8698
|
-
n(
|
|
8699
|
-
$ ===
|
|
8707
|
+
k.current = F.atIndex, l(F.query), a(!0), C(0), m(!0), T.current && clearTimeout(T.current);
|
|
8708
|
+
const $ = ++H.current;
|
|
8709
|
+
return T.current = setTimeout(() => {
|
|
8710
|
+
n(F.query).then((_) => {
|
|
8711
|
+
$ === H.current && (f(_), C(0), _.length === 0 && F.query.length > 0 && (R.current = F.atIndex, a(!1)));
|
|
8700
8712
|
}).catch(() => {
|
|
8701
|
-
$ ===
|
|
8713
|
+
$ === H.current && f([]);
|
|
8702
8714
|
}).finally(() => {
|
|
8703
|
-
$ ===
|
|
8715
|
+
$ === H.current && m(!1);
|
|
8704
8716
|
});
|
|
8705
8717
|
}, H2), () => {
|
|
8706
|
-
|
|
8718
|
+
T.current && clearTimeout(T.current);
|
|
8707
8719
|
};
|
|
8708
8720
|
}, [e, o, n, v]);
|
|
8709
|
-
const
|
|
8721
|
+
const L = q(() => {
|
|
8710
8722
|
a(!1), l(""), f([]), C(0), k.current = -1;
|
|
8711
|
-
}, []),
|
|
8712
|
-
(
|
|
8723
|
+
}, []), b = q(
|
|
8724
|
+
(F) => {
|
|
8713
8725
|
const $ = k.current;
|
|
8714
8726
|
if ($ === -1) return;
|
|
8715
|
-
const _ = `${
|
|
8716
|
-
t(O), w((D) => [...D.filter((W) => !(W.id === z && W.name === _)), { id: z, name: _ }]),
|
|
8727
|
+
const _ = `${F.firstName} ${F.lastName}`.trim(), z = String(F.id), G = e.slice(0, $), re = e.slice(o), K = `@${_} `, O = G + K + re, Z = G.length + K.length;
|
|
8728
|
+
t(O), w((D) => [...D.filter((W) => !(W.id === z && W.name === _)), { id: z, name: _ }]), L(), requestAnimationFrame(() => {
|
|
8717
8729
|
const D = s.current;
|
|
8718
8730
|
D && (D.focus(), D.setSelectionRange(Z, Z));
|
|
8719
8731
|
});
|
|
8720
8732
|
},
|
|
8721
|
-
[e, o, t, s,
|
|
8722
|
-
),
|
|
8723
|
-
(
|
|
8733
|
+
[e, o, t, s, L]
|
|
8734
|
+
), A = q(
|
|
8735
|
+
(F) => {
|
|
8724
8736
|
if (!i) return !1;
|
|
8725
|
-
if (
|
|
8726
|
-
return
|
|
8737
|
+
if (F.key === "Escape")
|
|
8738
|
+
return F.preventDefault(), L(), !0;
|
|
8727
8739
|
if (u.length === 0) return !1;
|
|
8728
|
-
switch (
|
|
8740
|
+
switch (F.key) {
|
|
8729
8741
|
case "ArrowDown":
|
|
8730
|
-
return
|
|
8742
|
+
return F.preventDefault(), C(($) => ($ + 1) % u.length), !0;
|
|
8731
8743
|
case "ArrowUp":
|
|
8732
|
-
return
|
|
8744
|
+
return F.preventDefault(), C(
|
|
8733
8745
|
($) => ($ + u.length - 1) % u.length
|
|
8734
8746
|
), !0;
|
|
8735
8747
|
case "Tab": {
|
|
@@ -8737,21 +8749,21 @@ function A2({
|
|
|
8737
8749
|
if ($) {
|
|
8738
8750
|
const _ = `${$.firstName} ${$.lastName}`.trim();
|
|
8739
8751
|
if (d.length === 0 || _.toLowerCase().startsWith(d.toLowerCase()))
|
|
8740
|
-
return
|
|
8752
|
+
return F.preventDefault(), b($), !0;
|
|
8741
8753
|
}
|
|
8742
8754
|
return !1;
|
|
8743
8755
|
}
|
|
8744
8756
|
case "Enter":
|
|
8745
|
-
return
|
|
8757
|
+
return F.preventDefault(), u[h] && b(u[h]), !0;
|
|
8746
8758
|
default:
|
|
8747
8759
|
return !1;
|
|
8748
8760
|
}
|
|
8749
8761
|
},
|
|
8750
|
-
[i, u, h, d,
|
|
8751
|
-
),
|
|
8752
|
-
(
|
|
8753
|
-
if (v.length === 0) return
|
|
8754
|
-
let $ =
|
|
8762
|
+
[i, u, h, d, b, L]
|
|
8763
|
+
), V = q(
|
|
8764
|
+
(F) => {
|
|
8765
|
+
if (v.length === 0) return F;
|
|
8766
|
+
let $ = F;
|
|
8755
8767
|
const _ = [...v].sort((z, G) => G.name.length - z.name.length);
|
|
8756
8768
|
for (const z of _) {
|
|
8757
8769
|
const G = `@${z.name}`, re = `<entity-ref type="person" id="${U1(z.id)}">${U1(z.name)}</entity-ref>`;
|
|
@@ -8764,7 +8776,7 @@ function A2({
|
|
|
8764
8776
|
);
|
|
8765
8777
|
X(() => {
|
|
8766
8778
|
w(
|
|
8767
|
-
(
|
|
8779
|
+
(F) => F.filter(($) => {
|
|
8768
8780
|
const _ = `@${$.name}`, z = e.indexOf(_);
|
|
8769
8781
|
if (z === -1) return !1;
|
|
8770
8782
|
const G = e[z + _.length];
|
|
@@ -8773,17 +8785,17 @@ function A2({
|
|
|
8773
8785
|
})
|
|
8774
8786
|
);
|
|
8775
8787
|
}, [e]);
|
|
8776
|
-
const
|
|
8788
|
+
const y = ee(() => {
|
|
8777
8789
|
if (!i || k.current === -1) return null;
|
|
8778
|
-
const
|
|
8779
|
-
if (!
|
|
8780
|
-
const $ = T2(
|
|
8790
|
+
const F = s.current;
|
|
8791
|
+
if (!F) return null;
|
|
8792
|
+
const $ = T2(F, k.current), _ = F.offsetLeft + $.left, G = (F.offsetParent ? F.offsetParent.offsetHeight : 0) - (F.offsetTop + $.top);
|
|
8781
8793
|
return { left: _, bottom: G };
|
|
8782
|
-
}, [i, e, o, s]),
|
|
8794
|
+
}, [i, e, o, s]), E = ee(() => {
|
|
8783
8795
|
if (!i || u.length === 0) return null;
|
|
8784
|
-
const
|
|
8785
|
-
if (!
|
|
8786
|
-
const $ = `${
|
|
8796
|
+
const F = u[h];
|
|
8797
|
+
if (!F) return null;
|
|
8798
|
+
const $ = `${F.firstName} ${F.lastName}`.trim();
|
|
8787
8799
|
return d.length === 0 ? $ : $.toLowerCase().startsWith(d.toLowerCase()) ? $.slice(d.length) : null;
|
|
8788
8800
|
}, [i, u, h, d]);
|
|
8789
8801
|
return {
|
|
@@ -8793,12 +8805,12 @@ function A2({
|
|
|
8793
8805
|
isLoading: g,
|
|
8794
8806
|
selectedIndex: h,
|
|
8795
8807
|
mentions: v,
|
|
8796
|
-
popoverPosition:
|
|
8797
|
-
inlineCompletion:
|
|
8798
|
-
handleKeyDown:
|
|
8799
|
-
selectPerson:
|
|
8800
|
-
transformMentions:
|
|
8801
|
-
close:
|
|
8808
|
+
popoverPosition: y,
|
|
8809
|
+
inlineCompletion: E,
|
|
8810
|
+
handleKeyDown: A,
|
|
8811
|
+
selectPerson: b,
|
|
8812
|
+
transformMentions: V,
|
|
8813
|
+
close: L
|
|
8802
8814
|
};
|
|
8803
8815
|
}
|
|
8804
8816
|
const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>[\s\S]*?<\/entity-ref>)/g).map((t, o) => o % 2 === 1 ? t : t.replace(/&/g, "&").replace(/</g, "<").replace(B2, "\\$&")).join(""), d9 = ({
|
|
@@ -8820,20 +8832,20 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
8820
8832
|
disclaimer: v,
|
|
8821
8833
|
footer: w,
|
|
8822
8834
|
isWelcomeScreen: k = !1,
|
|
8823
|
-
fullscreen:
|
|
8824
|
-
welcomeScreenSuggestions:
|
|
8825
|
-
onSuggestionClick:
|
|
8826
|
-
ref:
|
|
8835
|
+
fullscreen: T = !1,
|
|
8836
|
+
welcomeScreenSuggestions: H,
|
|
8837
|
+
onSuggestionClick: R,
|
|
8838
|
+
ref: L
|
|
8827
8839
|
}) => {
|
|
8828
|
-
const
|
|
8840
|
+
const b = Y(), A = ye(), [V, y] = P(""), [E, F] = P(0), [$, _] = P(!1), [z, G] = P(!1), [re, K] = P(null), O = I(null), Z = I(null), D = I(null), Q = a != null, { tracking: W } = Me(), he = q(
|
|
8829
8841
|
(te, ke) => {
|
|
8830
8842
|
W?.onWelcomeSuggestionClick?.({
|
|
8831
8843
|
item: te,
|
|
8832
8844
|
group: ke,
|
|
8833
8845
|
prompt: te.prompt || te.title
|
|
8834
|
-
}),
|
|
8846
|
+
}), R?.(te, ke);
|
|
8835
8847
|
},
|
|
8836
|
-
[W,
|
|
8848
|
+
[W, R]
|
|
8837
8849
|
), {
|
|
8838
8850
|
attachedFiles: ge,
|
|
8839
8851
|
fileInputRef: ie,
|
|
@@ -8841,25 +8853,25 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
8841
8853
|
acceptValue: se,
|
|
8842
8854
|
isAtMaxFiles: de,
|
|
8843
8855
|
maxFiles: M,
|
|
8844
|
-
processFiles:
|
|
8845
|
-
handleFileSelect:
|
|
8856
|
+
processFiles: S,
|
|
8857
|
+
handleFileSelect: N,
|
|
8846
8858
|
handleRemoveFile: j,
|
|
8847
8859
|
clearFiles: B,
|
|
8848
8860
|
transientError: U,
|
|
8849
8861
|
showTransientError: ae
|
|
8850
8862
|
} = N2(g), J = A2({
|
|
8851
|
-
inputValue:
|
|
8852
|
-
setInputValue:
|
|
8853
|
-
cursorPosition:
|
|
8863
|
+
inputValue: V,
|
|
8864
|
+
setInputValue: y,
|
|
8865
|
+
cursorPosition: E,
|
|
8854
8866
|
searchPersons: h,
|
|
8855
8867
|
textareaRef: Z
|
|
8856
8868
|
}), we = I(""), Ee = q((te) => {
|
|
8857
8869
|
const ke = we.current, i1 = ke && !/\s$/.test(ke) ? " " : "", Ue = `${ke}${i1}${te}`;
|
|
8858
|
-
|
|
8870
|
+
y(Ue), F(Ue.length);
|
|
8859
8871
|
}, []), Te = {
|
|
8860
|
-
"permission-denied":
|
|
8861
|
-
"device-error":
|
|
8862
|
-
"transcription-failed":
|
|
8872
|
+
"permission-denied": b.ai.micPermissionDenied,
|
|
8873
|
+
"device-error": b.ai.micError,
|
|
8874
|
+
"transcription-failed": b.ai.transcriptionError
|
|
8863
8875
|
}, Ce = ms({
|
|
8864
8876
|
onTranscribe: m,
|
|
8865
8877
|
onPartial: Ee,
|
|
@@ -8868,8 +8880,8 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
8868
8880
|
},
|
|
8869
8881
|
onError: (te) => ae(Te[te])
|
|
8870
8882
|
}), Je = !!m && Ce.isSupported, e1 = q(() => {
|
|
8871
|
-
W?.onDictationStart?.(), we.current =
|
|
8872
|
-
}, [
|
|
8883
|
+
W?.onDictationStart?.(), we.current = V, Ce.start();
|
|
8884
|
+
}, [V, Ce, W]), t1 = q(() => {
|
|
8873
8885
|
W?.onDictationCancel?.(), Ce.cancel();
|
|
8874
8886
|
}, [Ce, W]);
|
|
8875
8887
|
X(() => {
|
|
@@ -8877,16 +8889,16 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
8877
8889
|
}, []), X(() => {
|
|
8878
8890
|
if (C)
|
|
8879
8891
|
return C((te) => {
|
|
8880
|
-
|
|
8892
|
+
S(te);
|
|
8881
8893
|
}), () => {
|
|
8882
8894
|
C(null);
|
|
8883
8895
|
};
|
|
8884
|
-
}, [C,
|
|
8885
|
-
const je = Ce.status === "recording", r1 = je ?
|
|
8896
|
+
}, [C, S]);
|
|
8897
|
+
const je = Ce.status === "recording", r1 = je ? b.ai.listening : b.ai.inputPlaceholder, o1 = ge.filter((te) => te.status === "uploaded"), Se = ge.some((te) => te.status === "uploading"), He = ge.some((te) => te.status === "error"), De = V.trim().length > 0;
|
|
8886
8898
|
X(() => {
|
|
8887
8899
|
if (!(!z || Se)) {
|
|
8888
8900
|
if (G(!1), He) {
|
|
8889
|
-
ae(
|
|
8901
|
+
ae(b.ai.fileUploadBlockedSubmit);
|
|
8890
8902
|
return;
|
|
8891
8903
|
}
|
|
8892
8904
|
O.current?.requestSubmit();
|
|
@@ -8896,7 +8908,7 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
8896
8908
|
Se,
|
|
8897
8909
|
He,
|
|
8898
8910
|
ae,
|
|
8899
|
-
|
|
8911
|
+
b.ai.fileUploadBlockedSubmit
|
|
8900
8912
|
]);
|
|
8901
8913
|
const n1 = async (te) => {
|
|
8902
8914
|
if (te.preventDefault(), !Q) {
|
|
@@ -8918,7 +8930,7 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
8918
8930
|
_(!1);
|
|
8919
8931
|
}
|
|
8920
8932
|
}
|
|
8921
|
-
const ke = J.transformMentions(
|
|
8933
|
+
const ke = J.transformMentions(V.trim()), i1 = $2(ke), Ue = o1.flatMap(
|
|
8922
8934
|
(B1) => B1.uploadedFile ? [B1.uploadedFile] : []
|
|
8923
8935
|
), H1 = d, A1 = u;
|
|
8924
8936
|
H1 && l?.(null), A1 && f?.(null), await e({
|
|
@@ -8926,28 +8938,28 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
8926
8938
|
files: Ue,
|
|
8927
8939
|
context: H1,
|
|
8928
8940
|
quote: A1
|
|
8929
|
-
}),
|
|
8941
|
+
}), y(""), B();
|
|
8930
8942
|
}
|
|
8931
8943
|
Z.current?.focus();
|
|
8932
8944
|
}
|
|
8933
8945
|
}, s1 = (te) => {
|
|
8934
8946
|
Q || J.handleKeyDown(te) || te.key === "Enter" && !te.shiftKey && (te.preventDefault(), o || O.current?.requestSubmit());
|
|
8935
8947
|
}, Ze = () => {
|
|
8936
|
-
|
|
8948
|
+
F(Z.current?.selectionStart ?? 0);
|
|
8937
8949
|
}, _e = () => {
|
|
8938
8950
|
D.current && Z.current && (D.current.scrollTop = Z.current.scrollTop);
|
|
8939
|
-
}, S1 = re ? re.prompt ?? re.title : null, V1 = je ? [
|
|
8940
|
-
cursorPosition:
|
|
8951
|
+
}, S1 = re ? re.prompt ?? re.title : null, V1 = je ? [b.ai.listening] : S1 ? [S1] : s ?? [], Kr = V1.length > 1, Qr = ee(() => M2(V, J.mentions, {
|
|
8952
|
+
cursorPosition: E,
|
|
8941
8953
|
inlineCompletion: J.inlineCompletion
|
|
8942
|
-
}), [
|
|
8954
|
+
}), [V, J.mentions, E, J.inlineCompletion]), Jr = J.mentions.length > 0 || J.inlineCompletion !== null, Oe = k && !!H && H.length > 0 && !!R ? /* @__PURE__ */ r(
|
|
8943
8955
|
y2,
|
|
8944
8956
|
{
|
|
8945
|
-
suggestions:
|
|
8957
|
+
suggestions: H,
|
|
8946
8958
|
onItemClick: he,
|
|
8947
8959
|
onItemHover: K,
|
|
8948
|
-
side:
|
|
8960
|
+
side: T ? "bottom" : "top"
|
|
8949
8961
|
}
|
|
8950
|
-
) : null, T1 =
|
|
8962
|
+
) : null, T1 = T && k, { motionProps: eo } = Cs(
|
|
8951
8963
|
k,
|
|
8952
8964
|
160,
|
|
8953
8965
|
0.5
|
|
@@ -8955,15 +8967,15 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
8955
8967
|
return /* @__PURE__ */ c(
|
|
8956
8968
|
ne.div,
|
|
8957
8969
|
{
|
|
8958
|
-
ref:
|
|
8970
|
+
ref: L,
|
|
8959
8971
|
className: x(
|
|
8960
8972
|
"flex flex-col items-center gap-2 px-4 pb-3 pt-2",
|
|
8961
8973
|
T1 && "min-h-0 flex-1 justify-start -mt-20"
|
|
8962
8974
|
),
|
|
8963
|
-
...
|
|
8975
|
+
...T ? eo : {},
|
|
8964
8976
|
children: [
|
|
8965
8977
|
/* @__PURE__ */ c("div", { className: "flex w-full max-w-content flex-col gap-2", children: [
|
|
8966
|
-
Oe && !
|
|
8978
|
+
Oe && !T && /* @__PURE__ */ r("div", { children: Oe }),
|
|
8967
8979
|
/* @__PURE__ */ r(C2, { creditWarning: i, children: /* @__PURE__ */ c(
|
|
8968
8980
|
ne.form,
|
|
8969
8981
|
{
|
|
@@ -9023,12 +9035,12 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9023
9035
|
height: 0,
|
|
9024
9036
|
opacity: 0,
|
|
9025
9037
|
transition: {
|
|
9026
|
-
duration:
|
|
9038
|
+
duration: A ? 0 : 0.22,
|
|
9027
9039
|
ease: [0.4, 0, 1, 1]
|
|
9028
9040
|
}
|
|
9029
9041
|
},
|
|
9030
9042
|
transition: {
|
|
9031
|
-
duration:
|
|
9043
|
+
duration: A ? 0 : 0.4,
|
|
9032
9044
|
ease: [0.4, 0, 0.2, 1]
|
|
9033
9045
|
},
|
|
9034
9046
|
children: a
|
|
@@ -9044,12 +9056,12 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9044
9056
|
height: 0,
|
|
9045
9057
|
opacity: 0,
|
|
9046
9058
|
transition: {
|
|
9047
|
-
duration:
|
|
9059
|
+
duration: A ? 0 : 0.15,
|
|
9048
9060
|
ease: [0.55, 0, 1, 0.45]
|
|
9049
9061
|
}
|
|
9050
9062
|
},
|
|
9051
9063
|
transition: {
|
|
9052
|
-
duration:
|
|
9064
|
+
duration: A ? 0 : 0.4,
|
|
9053
9065
|
ease: [0.4, 0, 0.2, 1]
|
|
9054
9066
|
},
|
|
9055
9067
|
children: [
|
|
@@ -9070,7 +9082,7 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9070
9082
|
animate: { opacity: 1, y: 0 },
|
|
9071
9083
|
exit: { opacity: 0, y: -4 },
|
|
9072
9084
|
transition: {
|
|
9073
|
-
duration:
|
|
9085
|
+
duration: A ? 0 : 0.2,
|
|
9074
9086
|
ease: "easeOut"
|
|
9075
9087
|
},
|
|
9076
9088
|
children: /* @__PURE__ */ c(
|
|
@@ -9095,7 +9107,7 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9095
9107
|
attachedFiles: ge,
|
|
9096
9108
|
isUploading: Se,
|
|
9097
9109
|
onRemove: j,
|
|
9098
|
-
removeLabel:
|
|
9110
|
+
removeLabel: b.ai.removeFile
|
|
9099
9111
|
}
|
|
9100
9112
|
),
|
|
9101
9113
|
/* @__PURE__ */ r(
|
|
@@ -9103,9 +9115,9 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9103
9115
|
{
|
|
9104
9116
|
textareaRef: Z,
|
|
9105
9117
|
highlightRef: D,
|
|
9106
|
-
inputValue:
|
|
9118
|
+
inputValue: V,
|
|
9107
9119
|
onInputChange: (te, ke) => {
|
|
9108
|
-
|
|
9120
|
+
y(te), F(ke);
|
|
9109
9121
|
},
|
|
9110
9122
|
onKeyDown: s1,
|
|
9111
9123
|
onCursorUpdate: Ze,
|
|
@@ -9126,7 +9138,7 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9126
9138
|
maxFiles: M,
|
|
9127
9139
|
acceptValue: se,
|
|
9128
9140
|
fileInputRef: ie,
|
|
9129
|
-
handleFileSelect:
|
|
9141
|
+
handleFileSelect: N,
|
|
9130
9142
|
inProgress: o,
|
|
9131
9143
|
hasDataToSend: De,
|
|
9132
9144
|
isPreSending: $ || z,
|
|
@@ -9146,8 +9158,8 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9146
9158
|
}
|
|
9147
9159
|
) })
|
|
9148
9160
|
] }),
|
|
9149
|
-
Oe &&
|
|
9150
|
-
w && k &&
|
|
9161
|
+
Oe && T && /* @__PURE__ */ r("div", { className: "w-full max-w-content", children: Oe }),
|
|
9162
|
+
w && k && T && /* @__PURE__ */ r("div", { className: "w-full py-4 mx-auto flex max-w-content justify-center", children: w }),
|
|
9151
9163
|
/* @__PURE__ */ r(Ne, { mode: "wait", initial: !1, children: Q ? /* @__PURE__ */ c(
|
|
9152
9164
|
ne.div,
|
|
9153
9165
|
{
|
|
@@ -9160,17 +9172,17 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9160
9172
|
/* @__PURE__ */ c("span", { children: [
|
|
9161
9173
|
/* @__PURE__ */ r("kbd", { className: "font-sans", children: "↑↓" }),
|
|
9162
9174
|
" ",
|
|
9163
|
-
|
|
9175
|
+
b.ai.clarifyingQuestion.navHint.navigate
|
|
9164
9176
|
] }),
|
|
9165
9177
|
/* @__PURE__ */ c("span", { children: [
|
|
9166
9178
|
/* @__PURE__ */ r("kbd", { className: "font-sans", children: "Enter" }),
|
|
9167
9179
|
" ",
|
|
9168
|
-
|
|
9180
|
+
b.ai.clarifyingQuestion.navHint.select
|
|
9169
9181
|
] }),
|
|
9170
9182
|
/* @__PURE__ */ c("span", { children: [
|
|
9171
9183
|
/* @__PURE__ */ r("kbd", { className: "font-sans", children: "Esc" }),
|
|
9172
9184
|
" ",
|
|
9173
|
-
|
|
9185
|
+
b.ai.clarifyingQuestion.navHint.cancel
|
|
9174
9186
|
] })
|
|
9175
9187
|
]
|
|
9176
9188
|
},
|
|
@@ -9183,7 +9195,7 @@ const B2 = /[\\`*_{}[\]()#+\-.!|~>]/g, $2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
9183
9195
|
animate: { opacity: 1 },
|
|
9184
9196
|
exit: { opacity: 0 },
|
|
9185
9197
|
transition: {
|
|
9186
|
-
duration:
|
|
9198
|
+
duration: A ? 0 : 0.3,
|
|
9187
9199
|
ease: "easeOut"
|
|
9188
9200
|
},
|
|
9189
9201
|
children: [
|
|
@@ -10192,24 +10204,24 @@ function Ar({
|
|
|
10192
10204
|
h.current = k, X(() => {
|
|
10193
10205
|
typeof window > "u" || window.innerWidth < h4 || G1.has(e) || (G1.add(e), h.current());
|
|
10194
10206
|
}, [e]);
|
|
10195
|
-
const
|
|
10196
|
-
const
|
|
10197
|
-
fieldType:
|
|
10198
|
-
customFieldName:
|
|
10207
|
+
const T = i && a ? Object.entries(i).map(([L, b]) => {
|
|
10208
|
+
const A = a[L], V = m?.(L, A, {
|
|
10209
|
+
fieldType: b.fieldType,
|
|
10210
|
+
customFieldName: b.customFieldName
|
|
10199
10211
|
});
|
|
10200
|
-
if (!
|
|
10212
|
+
if (!V && b.fieldType === "custom" && typeof A == "object" && A !== null)
|
|
10201
10213
|
return null;
|
|
10202
|
-
const
|
|
10214
|
+
const y = V ?? Hr(A, b.fieldType), E = ["richtext", "textarea"];
|
|
10203
10215
|
return {
|
|
10204
|
-
label:
|
|
10205
|
-
content:
|
|
10206
|
-
verticalLayout:
|
|
10216
|
+
label: b.label,
|
|
10217
|
+
content: y,
|
|
10218
|
+
verticalLayout: E.includes(b.fieldType ?? "")
|
|
10207
10219
|
};
|
|
10208
|
-
}).filter((
|
|
10209
|
-
if (!
|
|
10210
|
-
const
|
|
10211
|
-
return !(
|
|
10212
|
-
}) : [],
|
|
10220
|
+
}).filter((L) => {
|
|
10221
|
+
if (!L) return !1;
|
|
10222
|
+
const b = Array.isArray(L.content) ? L.content[0] : L.content;
|
|
10223
|
+
return !(b?.type === "item" && b.text === "—");
|
|
10224
|
+
}) : [], H = T.slice(0, z1), R = T.length > z1;
|
|
10213
10225
|
return /* @__PURE__ */ r(
|
|
10214
10226
|
Tr,
|
|
10215
10227
|
{
|
|
@@ -10223,15 +10235,15 @@ function Ar({
|
|
|
10223
10235
|
onClose: f,
|
|
10224
10236
|
showButton: w
|
|
10225
10237
|
},
|
|
10226
|
-
children:
|
|
10238
|
+
children: H.length > 0 && !w && /* @__PURE__ */ r("div", { className: "-mx-3 flex w-full flex-col overflow-hidden pb-1", children: /* @__PURE__ */ r(
|
|
10227
10239
|
Es,
|
|
10228
10240
|
{
|
|
10229
|
-
details:
|
|
10230
|
-
title:
|
|
10231
|
-
content:
|
|
10232
|
-
...
|
|
10241
|
+
details: H.map((L) => ({
|
|
10242
|
+
title: L.label,
|
|
10243
|
+
content: L.content,
|
|
10244
|
+
...L.verticalLayout && { verticalLayout: !0 }
|
|
10233
10245
|
})),
|
|
10234
|
-
showSeeMore:
|
|
10246
|
+
showSeeMore: R,
|
|
10235
10247
|
onClickSeeMore: k,
|
|
10236
10248
|
tableView: !0
|
|
10237
10249
|
}
|
|
@@ -10814,8 +10826,8 @@ function P4({
|
|
|
10814
10826
|
const h = q(() => {
|
|
10815
10827
|
const C = e.current;
|
|
10816
10828
|
if (!C) return;
|
|
10817
|
-
const { scrollTop: v, scrollHeight: w, clientHeight: k } = C,
|
|
10818
|
-
u(
|
|
10829
|
+
const { scrollTop: v, scrollHeight: w, clientHeight: k } = C, T = w - v - k;
|
|
10830
|
+
u(T > k);
|
|
10819
10831
|
}, [e]);
|
|
10820
10832
|
return X(() => {
|
|
10821
10833
|
const C = e.current;
|
|
@@ -10826,8 +10838,8 @@ function P4({
|
|
|
10826
10838
|
requestAnimationFrame(() => {
|
|
10827
10839
|
const C = e.current, v = n.current;
|
|
10828
10840
|
if (!C || !v) return;
|
|
10829
|
-
const w = C.getBoundingClientRect(), k = v.getBoundingClientRect(),
|
|
10830
|
-
C.scrollTo({ top:
|
|
10841
|
+
const w = C.getBoundingClientRect(), k = v.getBoundingClientRect(), T = C.scrollTop + (k.top - w.top);
|
|
10842
|
+
C.scrollTo({ top: T, behavior: "smooth" });
|
|
10831
10843
|
});
|
|
10832
10844
|
}), s === 0 && u(!1), f.current = s;
|
|
10833
10845
|
}, [s, n, e]), { showScrollBtn: l, turnMinHeight: a, scrollToBottom: m };
|
|
@@ -10857,15 +10869,15 @@ const j4 = {
|
|
|
10857
10869
|
AssistantMessage: v,
|
|
10858
10870
|
UserMessage: w,
|
|
10859
10871
|
onRegenerate: k,
|
|
10860
|
-
onCopy:
|
|
10872
|
+
onCopy: T
|
|
10861
10873
|
}) => {
|
|
10862
|
-
const { modal:
|
|
10874
|
+
const { modal: H, handleSubmit: R, handleClose: L } = y4(
|
|
10863
10875
|
f ?? j4
|
|
10864
|
-
),
|
|
10865
|
-
const D = n ??
|
|
10876
|
+
), b = Y(), A = v ?? k4, V = w ?? V4, y = ee(() => {
|
|
10877
|
+
const D = n ?? b.ai.defaultInitialMessage;
|
|
10866
10878
|
return (Array.isArray(D) ? D : [D]).filter((W) => typeof W == "string" && W.length > 0);
|
|
10867
|
-
}, [n,
|
|
10868
|
-
viewportRef:
|
|
10879
|
+
}, [n, b.ai.defaultInitialMessage]), E = !t && e.length === 0 && y.length > 0, F = I(null), $ = I(null), _ = I(null), z = I(null), G = I(null), { showScrollBtn: re, turnMinHeight: K, scrollToBottom: O } = P4({
|
|
10880
|
+
viewportRef: F,
|
|
10869
10881
|
contentRef: $,
|
|
10870
10882
|
endRef: _,
|
|
10871
10883
|
lastTurnRef: G,
|
|
@@ -10884,37 +10896,37 @@ const j4 = {
|
|
|
10884
10896
|
inProgress: D.isInProgress,
|
|
10885
10897
|
index: se,
|
|
10886
10898
|
isCurrentMessage: !1,
|
|
10887
|
-
AssistantMessage:
|
|
10888
|
-
UserMessage:
|
|
10899
|
+
AssistantMessage: A,
|
|
10900
|
+
UserMessage: V,
|
|
10889
10901
|
onRegenerate: k,
|
|
10890
|
-
onCopy:
|
|
10902
|
+
onCopy: T,
|
|
10891
10903
|
rawData: oe.rawData || {},
|
|
10892
10904
|
...he
|
|
10893
10905
|
};
|
|
10894
10906
|
return /* @__PURE__ */ r(
|
|
10895
|
-
|
|
10907
|
+
V,
|
|
10896
10908
|
{
|
|
10897
10909
|
...de
|
|
10898
10910
|
},
|
|
10899
10911
|
`${Q}-u-${se}`
|
|
10900
10912
|
);
|
|
10901
10913
|
}, ie = (oe, se) => {
|
|
10902
|
-
const de = W && se === D.assistantMessages.length - 1, M = D.userMessages.length + se,
|
|
10914
|
+
const de = W && se === D.assistantMessages.length - 1, M = D.userMessages.length + se, S = {
|
|
10903
10915
|
message: oe,
|
|
10904
10916
|
inProgress: D.isInProgress,
|
|
10905
10917
|
index: M,
|
|
10906
10918
|
isCurrentMessage: de,
|
|
10907
|
-
AssistantMessage:
|
|
10908
|
-
UserMessage:
|
|
10919
|
+
AssistantMessage: A,
|
|
10920
|
+
UserMessage: V,
|
|
10909
10921
|
onRegenerate: k,
|
|
10910
|
-
onCopy:
|
|
10922
|
+
onCopy: T,
|
|
10911
10923
|
rawData: oe.rawData || {},
|
|
10912
10924
|
...he
|
|
10913
10925
|
};
|
|
10914
10926
|
return /* @__PURE__ */ r(
|
|
10915
|
-
|
|
10927
|
+
A,
|
|
10916
10928
|
{
|
|
10917
|
-
...
|
|
10929
|
+
...S,
|
|
10918
10930
|
isGenerating: D.isInProgress && de,
|
|
10919
10931
|
isLoading: D.isInProgress && de && !oe.content
|
|
10920
10932
|
},
|
|
@@ -10940,7 +10952,7 @@ const j4 = {
|
|
|
10940
10952
|
R4,
|
|
10941
10953
|
{
|
|
10942
10954
|
titles: D.thinking.titles,
|
|
10943
|
-
title:
|
|
10955
|
+
title: b.ai.thoughtsGroupTitle,
|
|
10944
10956
|
inProgress: D.thinking.inProgress,
|
|
10945
10957
|
isWriting: D.thinking.isWriting
|
|
10946
10958
|
}
|
|
@@ -10948,14 +10960,14 @@ const j4 = {
|
|
|
10948
10960
|
D.assistantMessages.map(
|
|
10949
10961
|
(oe, se) => ie(oe, se)
|
|
10950
10962
|
),
|
|
10951
|
-
D.endIndicator === "thinking" && /* @__PURE__ */ r(u1, { title:
|
|
10963
|
+
D.endIndicator === "thinking" && /* @__PURE__ */ r(u1, { title: b.ai.thinking, status: "executing" }),
|
|
10952
10964
|
D.endIndicator === "activity" && /* @__PURE__ */ r(u1, { status: "writing" }),
|
|
10953
10965
|
D.feedback && /* @__PURE__ */ r(
|
|
10954
10966
|
M4,
|
|
10955
10967
|
{
|
|
10956
10968
|
content: D.feedback.content,
|
|
10957
10969
|
targetMessage: D.feedback.targetMessage,
|
|
10958
|
-
onCopy:
|
|
10970
|
+
onCopy: T
|
|
10959
10971
|
}
|
|
10960
10972
|
),
|
|
10961
10973
|
W && /* @__PURE__ */ r(C4, {})
|
|
@@ -10969,7 +10981,7 @@ const j4 = {
|
|
|
10969
10981
|
/* @__PURE__ */ r(
|
|
10970
10982
|
"div",
|
|
10971
10983
|
{
|
|
10972
|
-
ref:
|
|
10984
|
+
ref: F,
|
|
10973
10985
|
className: x(
|
|
10974
10986
|
"flex-1 overflow-y-scroll",
|
|
10975
10987
|
"[scrollbar-width:thin] [scrollbar-color:transparent_transparent]",
|
|
@@ -10988,15 +11000,15 @@ const j4 = {
|
|
|
10988
11000
|
"div",
|
|
10989
11001
|
{
|
|
10990
11002
|
className: x(
|
|
10991
|
-
|
|
11003
|
+
E ? "flex flex-1" : "flex flex-col gap-6",
|
|
10992
11004
|
"w-full max-w-content"
|
|
10993
11005
|
),
|
|
10994
11006
|
children: [
|
|
10995
11007
|
t && /* @__PURE__ */ r(Z4, {}),
|
|
10996
|
-
|
|
11008
|
+
E && /* @__PURE__ */ r(
|
|
10997
11009
|
I4,
|
|
10998
11010
|
{
|
|
10999
|
-
messages:
|
|
11011
|
+
messages: y,
|
|
11000
11012
|
onClick: s,
|
|
11001
11013
|
fullscreen: h
|
|
11002
11014
|
}
|
|
@@ -11020,7 +11032,7 @@ const j4 = {
|
|
|
11020
11032
|
fe,
|
|
11021
11033
|
{
|
|
11022
11034
|
onClick: () => O(),
|
|
11023
|
-
label:
|
|
11035
|
+
label: b.ai.scrollToBottom,
|
|
11024
11036
|
variant: "neutral",
|
|
11025
11037
|
icon: Lt,
|
|
11026
11038
|
hideLabel: !0
|
|
@@ -11033,18 +11045,18 @@ const j4 = {
|
|
|
11033
11045
|
)
|
|
11034
11046
|
}
|
|
11035
11047
|
),
|
|
11036
|
-
!m && !
|
|
11048
|
+
!m && !E && /* @__PURE__ */ c(xe, { children: [
|
|
11037
11049
|
/* @__PURE__ */ r(K1, { position: "top" }, "shadow-top"),
|
|
11038
11050
|
/* @__PURE__ */ r(K1, { position: "bottom" }, "shadow-bottom")
|
|
11039
11051
|
] })
|
|
11040
11052
|
] }),
|
|
11041
|
-
|
|
11053
|
+
H.isOpen && /* @__PURE__ */ r(
|
|
11042
11054
|
b4,
|
|
11043
11055
|
{
|
|
11044
|
-
onSubmit:
|
|
11045
|
-
onClose:
|
|
11046
|
-
reactionType:
|
|
11047
|
-
message:
|
|
11056
|
+
onSubmit: R,
|
|
11057
|
+
onClose: L,
|
|
11058
|
+
reactionType: H.currentReaction,
|
|
11059
|
+
message: H.currentMessage
|
|
11048
11060
|
}
|
|
11049
11061
|
)
|
|
11050
11062
|
] });
|
|
@@ -11241,38 +11253,38 @@ const z4 = ({
|
|
|
11241
11253
|
onToggleCustomActive: v,
|
|
11242
11254
|
onConfirm: w
|
|
11243
11255
|
}) => {
|
|
11244
|
-
const k = ye(),
|
|
11256
|
+
const k = ye(), T = (() => {
|
|
11245
11257
|
if (e !== "single") return 0;
|
|
11246
|
-
const
|
|
11247
|
-
return
|
|
11248
|
-
})(), [
|
|
11258
|
+
const A = o.findIndex((V) => n.includes(V.id));
|
|
11259
|
+
return A >= 0 ? A : 0;
|
|
11260
|
+
})(), [H, R] = P(T), L = I([]);
|
|
11249
11261
|
X(() => {
|
|
11250
|
-
g && e === "single" &&
|
|
11262
|
+
g && e === "single" && L.current[H]?.focus();
|
|
11251
11263
|
}, []);
|
|
11252
|
-
const
|
|
11264
|
+
const b = (A) => {
|
|
11253
11265
|
if (e !== "single") return;
|
|
11254
|
-
const
|
|
11255
|
-
if (
|
|
11256
|
-
let
|
|
11257
|
-
switch (
|
|
11266
|
+
const V = o.length - 1;
|
|
11267
|
+
if (V < 0) return;
|
|
11268
|
+
let y = H;
|
|
11269
|
+
switch (A.key) {
|
|
11258
11270
|
case "ArrowDown":
|
|
11259
11271
|
case "ArrowRight":
|
|
11260
|
-
|
|
11272
|
+
y = H >= V ? 0 : H + 1;
|
|
11261
11273
|
break;
|
|
11262
11274
|
case "ArrowUp":
|
|
11263
11275
|
case "ArrowLeft":
|
|
11264
|
-
|
|
11276
|
+
y = H <= 0 ? V : H - 1;
|
|
11265
11277
|
break;
|
|
11266
11278
|
case "Home":
|
|
11267
|
-
|
|
11279
|
+
y = 0;
|
|
11268
11280
|
break;
|
|
11269
11281
|
case "End":
|
|
11270
|
-
|
|
11282
|
+
y = V;
|
|
11271
11283
|
break;
|
|
11272
11284
|
default:
|
|
11273
11285
|
return;
|
|
11274
11286
|
}
|
|
11275
|
-
|
|
11287
|
+
A.preventDefault(), R(y), L.current[y]?.focus();
|
|
11276
11288
|
};
|
|
11277
11289
|
return /* @__PURE__ */ c(
|
|
11278
11290
|
"div",
|
|
@@ -11281,7 +11293,7 @@ const z4 = ({
|
|
|
11281
11293
|
role: e === "single" ? "radiogroup" : "group",
|
|
11282
11294
|
"aria-label": t,
|
|
11283
11295
|
children: [
|
|
11284
|
-
o.map((
|
|
11296
|
+
o.map((A, V) => /* @__PURE__ */ r(
|
|
11285
11297
|
ne.div,
|
|
11286
11298
|
{
|
|
11287
11299
|
initial: k ? !1 : { opacity: 0, y: 4 },
|
|
@@ -11289,24 +11301,24 @@ const z4 = ({
|
|
|
11289
11301
|
transition: {
|
|
11290
11302
|
duration: k ? 0 : 0.2,
|
|
11291
11303
|
ease: [0.4, 0, 0.2, 1],
|
|
11292
|
-
delay: k ? 0 : 0.12 +
|
|
11304
|
+
delay: k ? 0 : 0.12 + V * 0.06
|
|
11293
11305
|
},
|
|
11294
11306
|
children: /* @__PURE__ */ r(
|
|
11295
11307
|
Or,
|
|
11296
11308
|
{
|
|
11297
|
-
ref: (
|
|
11298
|
-
|
|
11309
|
+
ref: (y) => {
|
|
11310
|
+
L.current[V] = y;
|
|
11299
11311
|
},
|
|
11300
|
-
option:
|
|
11301
|
-
isSelected: n.includes(
|
|
11312
|
+
option: A,
|
|
11313
|
+
isSelected: n.includes(A.id),
|
|
11302
11314
|
mode: e,
|
|
11303
|
-
isTabStop: e === "single" ?
|
|
11315
|
+
isTabStop: e === "single" ? V === H : void 0,
|
|
11304
11316
|
onToggle: m,
|
|
11305
|
-
onKeyNavigate:
|
|
11317
|
+
onKeyNavigate: b
|
|
11306
11318
|
}
|
|
11307
11319
|
)
|
|
11308
11320
|
},
|
|
11309
|
-
|
|
11321
|
+
A.id
|
|
11310
11322
|
)),
|
|
11311
11323
|
s && /* @__PURE__ */ r(
|
|
11312
11324
|
U4,
|
|
@@ -11415,24 +11427,24 @@ const z4 = ({
|
|
|
11415
11427
|
question: v,
|
|
11416
11428
|
options: w,
|
|
11417
11429
|
selectedOptionIds: k,
|
|
11418
|
-
selectionMode:
|
|
11419
|
-
optional:
|
|
11420
|
-
allowCustomAnswer:
|
|
11421
|
-
customAnswerText:
|
|
11422
|
-
isCustomAnswerActive:
|
|
11423
|
-
} = s,
|
|
11430
|
+
selectionMode: T,
|
|
11431
|
+
optional: H,
|
|
11432
|
+
allowCustomAnswer: R,
|
|
11433
|
+
customAnswerText: L,
|
|
11434
|
+
isCustomAnswerActive: b
|
|
11435
|
+
} = s, A = I(null), V = T ?? "single", y = a > 1, E = i === 0, F = i === a - 1, $ = y ? o.t("ai.clarifyingQuestion.stepOf", {
|
|
11424
11436
|
current: String(i + 1),
|
|
11425
11437
|
total: String(a)
|
|
11426
|
-
}) : void 0, _ = k.length > 0, z = (
|
|
11438
|
+
}) : void 0, _ = k.length > 0, z = (L ?? "").trim().length > 0, G = _ || b && z || H === !0, re = t === !0 && F, K = () => {
|
|
11427
11439
|
re || l();
|
|
11428
11440
|
}, O = () => {
|
|
11429
11441
|
re || u();
|
|
11430
11442
|
}, Z = (ie) => {
|
|
11431
|
-
const oe =
|
|
11432
|
-
d(ie),
|
|
11433
|
-
}, D =
|
|
11443
|
+
const oe = V === "single" && k.includes(ie);
|
|
11444
|
+
d(ie), V === "single" && !F && !oe && Promise.resolve().then(l);
|
|
11445
|
+
}, D = F ? o.ai.clarifyingQuestion.submit : o.ai.clarifyingQuestion.next, Q = H === !0 && !_ && !(b && z), W = () => {
|
|
11434
11446
|
C(), requestAnimationFrame(() => {
|
|
11435
|
-
|
|
11447
|
+
A.current?.focus();
|
|
11436
11448
|
});
|
|
11437
11449
|
}, he = (ie) => {
|
|
11438
11450
|
ie.key === "Escape" && (ie.preventDefault(), f());
|
|
@@ -11452,8 +11464,8 @@ const z4 = ({
|
|
|
11452
11464
|
{
|
|
11453
11465
|
question: v,
|
|
11454
11466
|
stepLabel: $,
|
|
11455
|
-
isFirstStep:
|
|
11456
|
-
isFinalStep:
|
|
11467
|
+
isFirstStep: E,
|
|
11468
|
+
isFinalStep: F,
|
|
11457
11469
|
canProceed: G,
|
|
11458
11470
|
onBack: g,
|
|
11459
11471
|
onNext: l,
|
|
@@ -11463,17 +11475,17 @@ const z4 = ({
|
|
|
11463
11475
|
/* @__PURE__ */ r(
|
|
11464
11476
|
z4,
|
|
11465
11477
|
{
|
|
11466
|
-
mode:
|
|
11478
|
+
mode: V,
|
|
11467
11479
|
question: v,
|
|
11468
11480
|
options: w,
|
|
11469
11481
|
selectedOptionIds: k,
|
|
11470
|
-
allowCustomAnswer:
|
|
11482
|
+
allowCustomAnswer: R,
|
|
11471
11483
|
hasSelection: _,
|
|
11472
11484
|
hasCustomText: z,
|
|
11473
|
-
customAnswerText:
|
|
11474
|
-
isCustomAnswerActive:
|
|
11485
|
+
customAnswerText: L,
|
|
11486
|
+
isCustomAnswerActive: b,
|
|
11475
11487
|
canProceed: G,
|
|
11476
|
-
customInputRef:
|
|
11488
|
+
customInputRef: A,
|
|
11477
11489
|
onToggleOption: Z,
|
|
11478
11490
|
onActivateCustom: W,
|
|
11479
11491
|
onChangeCustomText: m,
|
|
@@ -11499,59 +11511,59 @@ const z4 = ({
|
|
|
11499
11511
|
] });
|
|
11500
11512
|
};
|
|
11501
11513
|
function Q1(e, t, o, n) {
|
|
11502
|
-
const s = Math.max(1, Math.min(e, t)), i = Math.min(o, 20), d = Math.min(i + n, s), l = Math.min(d, Math.floor(e / 2)), u = Math.min(d, Math.floor(t / 2)), f = (W) => W / e * 2 - 1, g = (W) => W / t * 2 - 1, m = 0, h = e, C = 0, v = t, w = l, k = e - l,
|
|
11514
|
+
const s = Math.max(1, Math.min(e, t)), i = Math.min(o, 20), d = Math.min(i + n, s), l = Math.min(d, Math.floor(e / 2)), u = Math.min(d, Math.floor(t / 2)), f = (W) => W / e * 2 - 1, g = (W) => W / t * 2 - 1, m = 0, h = e, C = 0, v = t, w = l, k = e - l, T = u, H = t - u, R = f(m), L = f(h), b = g(C), A = g(v), V = f(w), y = f(k), E = g(T), F = g(H), $ = 0, _ = 0, z = 1, G = 1, re = l / e, K = 1 - l / e, O = u / t, Z = 1 - u / t, D = new Float32Array([
|
|
11503
11515
|
// Top strip
|
|
11504
|
-
|
|
11505
|
-
|
|
11506
|
-
y,
|
|
11516
|
+
R,
|
|
11517
|
+
b,
|
|
11507
11518
|
L,
|
|
11519
|
+
b,
|
|
11520
|
+
R,
|
|
11508
11521
|
E,
|
|
11509
|
-
|
|
11522
|
+
R,
|
|
11510
11523
|
E,
|
|
11511
|
-
S,
|
|
11512
|
-
y,
|
|
11513
11524
|
L,
|
|
11514
|
-
|
|
11515
|
-
|
|
11516
|
-
// Bottom strip
|
|
11525
|
+
b,
|
|
11526
|
+
L,
|
|
11517
11527
|
E,
|
|
11528
|
+
// Bottom strip
|
|
11518
11529
|
R,
|
|
11519
|
-
|
|
11530
|
+
F,
|
|
11531
|
+
L,
|
|
11532
|
+
F,
|
|
11520
11533
|
R,
|
|
11521
|
-
|
|
11522
|
-
H,
|
|
11523
|
-
E,
|
|
11524
|
-
H,
|
|
11525
|
-
y,
|
|
11534
|
+
A,
|
|
11526
11535
|
R,
|
|
11527
|
-
|
|
11528
|
-
|
|
11536
|
+
A,
|
|
11537
|
+
L,
|
|
11538
|
+
F,
|
|
11539
|
+
L,
|
|
11540
|
+
A,
|
|
11529
11541
|
// Left strip
|
|
11530
|
-
E,
|
|
11531
|
-
S,
|
|
11532
|
-
b,
|
|
11533
|
-
S,
|
|
11534
|
-
E,
|
|
11535
11542
|
R,
|
|
11536
11543
|
E,
|
|
11544
|
+
V,
|
|
11545
|
+
E,
|
|
11537
11546
|
R,
|
|
11538
|
-
|
|
11539
|
-
S,
|
|
11540
|
-
b,
|
|
11547
|
+
F,
|
|
11541
11548
|
R,
|
|
11549
|
+
F,
|
|
11550
|
+
V,
|
|
11551
|
+
E,
|
|
11552
|
+
V,
|
|
11553
|
+
F,
|
|
11542
11554
|
// Right strip
|
|
11543
|
-
A,
|
|
11544
|
-
S,
|
|
11545
11555
|
y,
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11549
|
-
A,
|
|
11550
|
-
R,
|
|
11556
|
+
E,
|
|
11557
|
+
L,
|
|
11558
|
+
E,
|
|
11551
11559
|
y,
|
|
11552
|
-
|
|
11560
|
+
F,
|
|
11553
11561
|
y,
|
|
11554
|
-
|
|
11562
|
+
F,
|
|
11563
|
+
L,
|
|
11564
|
+
E,
|
|
11565
|
+
L,
|
|
11566
|
+
F
|
|
11555
11567
|
]), Q = new Float32Array([
|
|
11556
11568
|
// Top strip
|
|
11557
11569
|
$,
|
|
@@ -11937,8 +11949,8 @@ class k9 {
|
|
|
11937
11949
|
s.enableVertexAttribArray(w), s.vertexAttribPointer(w, 2, s.FLOAT, !1, 0, 0), this.checkGLError(s, "resize: after UV buffer update"), s.useProgram(i), s.uniform2f(u, this.canvas.width, this.canvas.height), s.uniform1f(this.glr.uBorderWidth, this.options.borderWidth * f), s.uniform1f(this.glr.uGlowWidth, this.options.glowWidth * f), s.uniform1f(this.glr.uBorderRadius, this.options.borderRadius * f), this.checkGLError(s, "resize: after uniform updates");
|
|
11938
11950
|
const k = performance.now();
|
|
11939
11951
|
this.lastTime = k;
|
|
11940
|
-
const
|
|
11941
|
-
this.render(
|
|
11952
|
+
const T = (k - this.startTime) * 1e-3;
|
|
11953
|
+
this.render(T);
|
|
11942
11954
|
}
|
|
11943
11955
|
/**
|
|
11944
11956
|
* Automatically resizes the canvas to match the dimensions of the given element.
|
|
@@ -12026,13 +12038,13 @@ class k9 {
|
|
|
12026
12038
|
t.bindBuffer(t.ARRAY_BUFFER, f), t.bufferData(t.ARRAY_BUFFER, d, t.STATIC_DRAW);
|
|
12027
12039
|
const g = t.getAttribLocation(o, "aUV");
|
|
12028
12040
|
t.enableVertexAttribArray(g), t.vertexAttribPointer(g, 2, t.FLOAT, !1, 0, 0), this.checkGLError(t, "setupGL: after UV buffer setup");
|
|
12029
|
-
const m = t.getUniformLocation(o, "uResolution"), h = t.getUniformLocation(o, "uTime"), C = t.getUniformLocation(o, "uBorderWidth"), v = t.getUniformLocation(o, "uGlowWidth"), w = t.getUniformLocation(o, "uBorderRadius"), k = t.getUniformLocation(o, "uColors"),
|
|
12030
|
-
t.useProgram(o), t.uniform1f(C, this.options.borderWidth), t.uniform1f(v, this.options.glowWidth), t.uniform1f(w, this.options.borderRadius), this.options.mode === "dark" ? (t.uniform1f(
|
|
12031
|
-
const
|
|
12032
|
-
for (let
|
|
12041
|
+
const m = t.getUniformLocation(o, "uResolution"), h = t.getUniformLocation(o, "uTime"), C = t.getUniformLocation(o, "uBorderWidth"), v = t.getUniformLocation(o, "uGlowWidth"), w = t.getUniformLocation(o, "uBorderRadius"), k = t.getUniformLocation(o, "uColors"), T = t.getUniformLocation(o, "uGlowExponent"), H = t.getUniformLocation(o, "uGlowFactor");
|
|
12042
|
+
t.useProgram(o), t.uniform1f(C, this.options.borderWidth), t.uniform1f(v, this.options.glowWidth), t.uniform1f(w, this.options.borderRadius), this.options.mode === "dark" ? (t.uniform1f(T, 2), t.uniform1f(H, 1.8)) : (t.uniform1f(T, 1), t.uniform1f(H, 1));
|
|
12043
|
+
const R = (this.options.colors || J4).map(e6);
|
|
12044
|
+
for (let L = 0; L < R.length; L++)
|
|
12033
12045
|
t.uniform3f(
|
|
12034
|
-
t.getUniformLocation(o, `uColors[${
|
|
12035
|
-
...
|
|
12046
|
+
t.getUniformLocation(o, `uColors[${L}]`),
|
|
12047
|
+
...R[L]
|
|
12036
12048
|
);
|
|
12037
12049
|
this.checkGLError(t, "setupGL: after uniform setup"), t.bindVertexArray(null), t.bindBuffer(t.ARRAY_BUFFER, null), this.glr = {
|
|
12038
12050
|
gl: t,
|
|
@@ -12254,8 +12266,8 @@ class d6 {
|
|
|
12254
12266
|
)
|
|
12255
12267
|
);
|
|
12256
12268
|
Object.assign(this, { url: n, wrapS: s, wrapT: i, minFilter: a, magFilter: d, flipY: l });
|
|
12257
|
-
const g = 0, m = o.RGBA, h = 1, C = 1, v = 0, w = o.RGBA, k = o.UNSIGNED_BYTE,
|
|
12258
|
-
if (o.bindTexture(o.TEXTURE_2D,
|
|
12269
|
+
const g = 0, m = o.RGBA, h = 1, C = 1, v = 0, w = o.RGBA, k = o.UNSIGNED_BYTE, T = new Uint8Array([255, 255, 255, 0]), H = o.createTexture();
|
|
12270
|
+
if (o.bindTexture(o.TEXTURE_2D, H), o.texImage2D(
|
|
12259
12271
|
o.TEXTURE_2D,
|
|
12260
12272
|
g,
|
|
12261
12273
|
m,
|
|
@@ -12264,30 +12276,30 @@ class d6 {
|
|
|
12264
12276
|
v,
|
|
12265
12277
|
w,
|
|
12266
12278
|
k,
|
|
12267
|
-
|
|
12279
|
+
T
|
|
12268
12280
|
), f) {
|
|
12269
|
-
const
|
|
12270
|
-
return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, o.CLAMP_TO_EDGE), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, o.CLAMP_TO_EDGE), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR), this._webglTexture =
|
|
12281
|
+
const A = this.setupVideo(n);
|
|
12282
|
+
return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, o.CLAMP_TO_EDGE), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, o.CLAMP_TO_EDGE), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR), this._webglTexture = H, this.source = A, this.isVideo = !0, A.play().then(() => this);
|
|
12271
12283
|
}
|
|
12272
|
-
async function
|
|
12273
|
-
return new Promise((
|
|
12274
|
-
const
|
|
12275
|
-
|
|
12276
|
-
|
|
12277
|
-
},
|
|
12278
|
-
|
|
12279
|
-
},
|
|
12284
|
+
async function R() {
|
|
12285
|
+
return new Promise((A, V) => {
|
|
12286
|
+
const y = new Image();
|
|
12287
|
+
y.crossOrigin = "anonymous", y.onload = () => {
|
|
12288
|
+
A(y);
|
|
12289
|
+
}, y.onerror = () => {
|
|
12290
|
+
V(new Error(be(`failed loading url: ${n}`)));
|
|
12291
|
+
}, y.src = n ?? "";
|
|
12280
12292
|
});
|
|
12281
12293
|
}
|
|
12282
|
-
let
|
|
12283
|
-
return (t.wrapS !== ft || t.wrapT !== ft || t.minFilter !== dt && t.minFilter !== d1) && !
|
|
12294
|
+
let L = await R(), b = (L.width & L.width - 1) === 0 && (L.height & L.height - 1) === 0;
|
|
12295
|
+
return (t.wrapS !== ft || t.wrapT !== ft || t.minFilter !== dt && t.minFilter !== d1) && !b && (L = this.makePowerOf2(L), b = !0), o.bindTexture(o.TEXTURE_2D, H), o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, l), o.texImage2D(
|
|
12284
12296
|
o.TEXTURE_2D,
|
|
12285
12297
|
g,
|
|
12286
12298
|
m,
|
|
12287
12299
|
w,
|
|
12288
12300
|
k,
|
|
12289
|
-
|
|
12290
|
-
),
|
|
12301
|
+
L
|
|
12302
|
+
), b && t.minFilter !== dt && t.minFilter !== d1 && o.generateMipmap(o.TEXTURE_2D), o.texParameteri(
|
|
12291
12303
|
o.TEXTURE_2D,
|
|
12292
12304
|
o.TEXTURE_WRAP_S,
|
|
12293
12305
|
this.wrapS || ut
|
|
@@ -12303,7 +12315,7 @@ class d6 {
|
|
|
12303
12315
|
o.TEXTURE_2D,
|
|
12304
12316
|
o.TEXTURE_MAG_FILTER,
|
|
12305
12317
|
this.magFilter || d1
|
|
12306
|
-
), this._webglTexture =
|
|
12318
|
+
), this._webglTexture = H, this.source = L, this.isVideo = !1, this.isLoaded = !0, this.width = L.width || 0, this.height = L.height || 0, this;
|
|
12307
12319
|
};
|
|
12308
12320
|
}
|
|
12309
12321
|
const be = (e) => `react-shaders: ${e}`, ht = (e) => {
|
|
@@ -12328,7 +12340,7 @@ function u6({
|
|
|
12328
12340
|
onError: g = console.error,
|
|
12329
12341
|
onWarning: m = console.warn
|
|
12330
12342
|
}) {
|
|
12331
|
-
const h = I(null), C = I(null), v = I(null), w = I(null), k = I(void 0),
|
|
12343
|
+
const h = I(null), C = I(null), v = I(null), w = I(null), k = I(void 0), T = I(void 0), H = I(!1), R = I(void 0), L = I(0), b = I([0, 0]), A = I([]), V = I(0), y = I(void 0), E = I({
|
|
12332
12344
|
[rt]: { type: "float", isNeeded: !1, value: 0 },
|
|
12333
12345
|
[ot]: { type: "float", isNeeded: !1, value: 0 },
|
|
12334
12346
|
[nt]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
|
|
@@ -12340,11 +12352,11 @@ function u6({
|
|
|
12340
12352
|
isNeeded: !1,
|
|
12341
12353
|
value: [0, 0, 0, 0]
|
|
12342
12354
|
}
|
|
12343
|
-
}),
|
|
12344
|
-
const
|
|
12355
|
+
}), F = I(n), $ = (M, S) => {
|
|
12356
|
+
const N = "width" in M ? M.width ?? 0 : 0, j = "height" in M ? M.height ?? 0 : 0, B = E.current.iChannelResolution;
|
|
12345
12357
|
if (!B) return;
|
|
12346
12358
|
const U = Array.isArray(B.value) ? B.value : B.value = [];
|
|
12347
|
-
U[
|
|
12359
|
+
U[S * 3] = N * u, U[S * 3 + 1] = j * u, U[S * 3 + 2] = 0;
|
|
12348
12360
|
}, _ = () => {
|
|
12349
12361
|
h.current && (C.current = h.current.getContext("webgl", d) || h.current.getContext(
|
|
12350
12362
|
"experimental-webgl",
|
|
@@ -12353,7 +12365,7 @@ function u6({
|
|
|
12353
12365
|
}, z = () => {
|
|
12354
12366
|
const M = C.current;
|
|
12355
12367
|
v.current = M?.createBuffer() ?? null, M?.bindBuffer(M.ARRAY_BUFFER, v.current);
|
|
12356
|
-
const
|
|
12368
|
+
const S = [
|
|
12357
12369
|
1,
|
|
12358
12370
|
1,
|
|
12359
12371
|
0,
|
|
@@ -12367,99 +12379,99 @@ function u6({
|
|
|
12367
12379
|
-1,
|
|
12368
12380
|
0
|
|
12369
12381
|
];
|
|
12370
|
-
M?.bufferData(M.ARRAY_BUFFER, new Float32Array(
|
|
12382
|
+
M?.bufferData(M.ARRAY_BUFFER, new Float32Array(S), M.STATIC_DRAW);
|
|
12371
12383
|
}, G = ({
|
|
12372
12384
|
alpha: M,
|
|
12373
|
-
beta:
|
|
12374
|
-
gamma:
|
|
12385
|
+
beta: S,
|
|
12386
|
+
gamma: N
|
|
12375
12387
|
}) => {
|
|
12376
|
-
|
|
12388
|
+
E.current.iDeviceOrientation.value = [
|
|
12377
12389
|
M ?? 0,
|
|
12390
|
+
S ?? 0,
|
|
12378
12391
|
N ?? 0,
|
|
12379
|
-
F ?? 0,
|
|
12380
12392
|
window.orientation ?? 0
|
|
12381
12393
|
];
|
|
12382
12394
|
}, re = (M) => {
|
|
12383
|
-
const [
|
|
12384
|
-
|
|
12385
|
-
const U = Array.isArray(
|
|
12386
|
-
U && (U[2] = j, U[3] = B),
|
|
12395
|
+
const [S = 0, N = 0] = ht(M), j = S - (R.current?.left ?? 0) - window.pageXOffset, B = (R.current?.height ?? 0) - N - (R.current?.top ?? 0) - window.pageYOffset;
|
|
12396
|
+
H.current = !0;
|
|
12397
|
+
const U = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
12398
|
+
U && (U[2] = j, U[3] = B), b.current[0] = j, b.current[1] = B;
|
|
12387
12399
|
}, K = (M) => {
|
|
12388
|
-
|
|
12389
|
-
const [
|
|
12400
|
+
R.current = h.current?.getBoundingClientRect();
|
|
12401
|
+
const [S = 0, N = 0] = ht(M), j = S - (R.current?.left ?? 0), B = (R.current?.height ?? 0) - N - (R.current?.top ?? 0);
|
|
12390
12402
|
if (l !== 1)
|
|
12391
|
-
|
|
12403
|
+
b.current[0] = j, b.current[1] = B;
|
|
12392
12404
|
else {
|
|
12393
|
-
const U = Array.isArray(
|
|
12405
|
+
const U = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
12394
12406
|
U && (U[0] = j, U[1] = B);
|
|
12395
12407
|
}
|
|
12396
12408
|
}, O = () => {
|
|
12397
|
-
const M = Array.isArray(
|
|
12409
|
+
const M = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
12398
12410
|
M && (M[2] = 0, M[3] = 0);
|
|
12399
12411
|
}, Z = () => {
|
|
12400
12412
|
const M = C.current;
|
|
12401
12413
|
if (!M) return;
|
|
12402
|
-
|
|
12403
|
-
const
|
|
12404
|
-
(
|
|
12414
|
+
R.current = h.current?.getBoundingClientRect();
|
|
12415
|
+
const S = u, N = Math.floor(
|
|
12416
|
+
(R.current?.width ?? 1) * S
|
|
12405
12417
|
), j = Math.floor(
|
|
12406
|
-
(
|
|
12418
|
+
(R.current?.height ?? 1) * S
|
|
12407
12419
|
);
|
|
12408
|
-
if (M.canvas.width =
|
|
12420
|
+
if (M.canvas.width = N, M.canvas.height = j, E.current.iResolution?.isNeeded && w.current) {
|
|
12409
12421
|
const B = M.getUniformLocation(
|
|
12410
12422
|
w.current,
|
|
12411
12423
|
at
|
|
12412
12424
|
);
|
|
12413
12425
|
M.uniform2fv(B, [M.canvas.width, M.canvas.height]);
|
|
12414
12426
|
}
|
|
12415
|
-
}, D = (M,
|
|
12416
|
-
const
|
|
12417
|
-
if (!
|
|
12418
|
-
const j =
|
|
12427
|
+
}, D = (M, S) => {
|
|
12428
|
+
const N = C.current;
|
|
12429
|
+
if (!N) return null;
|
|
12430
|
+
const j = N.createShader(M);
|
|
12419
12431
|
if (!j) return null;
|
|
12420
|
-
if (
|
|
12432
|
+
if (N.shaderSource(j, S), N.compileShader(j), !N.getShaderParameter(j, N.COMPILE_STATUS)) {
|
|
12421
12433
|
m?.(be(`Error compiling the shader:
|
|
12422
|
-
${
|
|
12423
|
-
const B =
|
|
12424
|
-
|
|
12434
|
+
${S}`));
|
|
12435
|
+
const B = N.getShaderInfoLog(j);
|
|
12436
|
+
N.deleteShader(j), g?.(be(`Shader compiler log: ${B}`));
|
|
12425
12437
|
}
|
|
12426
12438
|
return j;
|
|
12427
|
-
}, Q = (M,
|
|
12428
|
-
const
|
|
12429
|
-
if (!
|
|
12430
|
-
const j = D(
|
|
12431
|
-
if (w.current =
|
|
12432
|
-
if (
|
|
12439
|
+
}, Q = (M, S) => {
|
|
12440
|
+
const N = C.current;
|
|
12441
|
+
if (!N) return;
|
|
12442
|
+
const j = D(N.FRAGMENT_SHADER, M), B = D(N.VERTEX_SHADER, S);
|
|
12443
|
+
if (w.current = N.createProgram(), !(!w.current || !B || !j)) {
|
|
12444
|
+
if (N.attachShader(w.current, B), N.attachShader(w.current, j), N.linkProgram(w.current), !N.getProgramParameter(w.current, N.LINK_STATUS)) {
|
|
12433
12445
|
g?.(
|
|
12434
12446
|
be(
|
|
12435
|
-
`Unable to initialize the shader program: ${
|
|
12447
|
+
`Unable to initialize the shader program: ${N.getProgramInfoLog(
|
|
12436
12448
|
w.current
|
|
12437
12449
|
)}`
|
|
12438
12450
|
)
|
|
12439
12451
|
);
|
|
12440
12452
|
return;
|
|
12441
12453
|
}
|
|
12442
|
-
|
|
12454
|
+
N.useProgram(w.current), k.current = N.getAttribLocation(
|
|
12443
12455
|
w.current,
|
|
12444
12456
|
"aVertexPosition"
|
|
12445
|
-
),
|
|
12457
|
+
), N.enableVertexAttribArray(k.current);
|
|
12446
12458
|
}
|
|
12447
12459
|
}, W = () => {
|
|
12448
12460
|
if (n)
|
|
12449
12461
|
for (const M of Object.keys(n)) {
|
|
12450
|
-
const
|
|
12451
|
-
if (!
|
|
12452
|
-
const { value:
|
|
12462
|
+
const S = n[M];
|
|
12463
|
+
if (!S) continue;
|
|
12464
|
+
const { value: N, type: j } = S, B = c6(j);
|
|
12453
12465
|
if (!B) continue;
|
|
12454
12466
|
const U = {};
|
|
12455
|
-
if (n6(j,
|
|
12456
|
-
const ae = j.length, J = Number.parseInt(j.charAt(ae - 3)), we = Math.floor(
|
|
12457
|
-
|
|
12458
|
-
} else s6(j,
|
|
12459
|
-
|
|
12467
|
+
if (n6(j, N)) {
|
|
12468
|
+
const ae = j.length, J = Number.parseInt(j.charAt(ae - 3)), we = Math.floor(N.length / (J * J));
|
|
12469
|
+
N.length > J * J && (U.arraySize = `[${we}]`);
|
|
12470
|
+
} else s6(j, N) && (U.arraySize = `[${Math.floor(N.length / Number.parseInt(j.charAt(0)))}]`);
|
|
12471
|
+
E.current[M] = {
|
|
12460
12472
|
type: B,
|
|
12461
12473
|
isNeeded: !1,
|
|
12462
|
-
value:
|
|
12474
|
+
value: N,
|
|
12463
12475
|
...U
|
|
12464
12476
|
};
|
|
12465
12477
|
}
|
|
@@ -12467,140 +12479,140 @@ ${N}`));
|
|
|
12467
12479
|
const M = C.current;
|
|
12468
12480
|
if (M)
|
|
12469
12481
|
if (o && o.length > 0) {
|
|
12470
|
-
|
|
12482
|
+
E.current[`${ct}`] = {
|
|
12471
12483
|
type: "vec3",
|
|
12472
12484
|
isNeeded: !1,
|
|
12473
12485
|
arraySize: `[${o.length}]`,
|
|
12474
12486
|
value: []
|
|
12475
12487
|
};
|
|
12476
|
-
const
|
|
12477
|
-
(
|
|
12488
|
+
const S = o.map(
|
|
12489
|
+
(N, j) => (E.current[`${o6}${j}`] = {
|
|
12478
12490
|
type: "sampler2D",
|
|
12479
12491
|
isNeeded: !1
|
|
12480
|
-
}, $(
|
|
12492
|
+
}, $(N, j), A.current[j] = new d6(M), A.current[j]?.load(N).then((B) => {
|
|
12481
12493
|
$(B, j);
|
|
12482
12494
|
}))
|
|
12483
12495
|
);
|
|
12484
|
-
Promise.all(
|
|
12496
|
+
Promise.all(S).then(() => {
|
|
12485
12497
|
f && f();
|
|
12486
|
-
}).catch((
|
|
12487
|
-
g?.(
|
|
12498
|
+
}).catch((N) => {
|
|
12499
|
+
g?.(N), f && f();
|
|
12488
12500
|
});
|
|
12489
12501
|
} else f && f();
|
|
12490
12502
|
}, ge = (M) => {
|
|
12491
|
-
const
|
|
12503
|
+
const S = et.includes(i ?? "highp"), N = `precision ${S ? i : et[1]} float;
|
|
12492
12504
|
`;
|
|
12493
|
-
|
|
12505
|
+
S || m?.(
|
|
12494
12506
|
be(
|
|
12495
12507
|
`wrong precision type ${i}, please make sure to pass one of a valid precision lowp, mediump, highp, by default you shader precision will be set to highp.`
|
|
12496
12508
|
)
|
|
12497
12509
|
);
|
|
12498
|
-
let j =
|
|
12510
|
+
let j = N.concat(`#define DPR ${u.toFixed(1)}
|
|
12499
12511
|
`).concat(M.replace(/texture\(/g, "texture2D("));
|
|
12500
|
-
for (const U of Object.keys(
|
|
12512
|
+
for (const U of Object.keys(E.current))
|
|
12501
12513
|
if (M.includes(U)) {
|
|
12502
|
-
const ae =
|
|
12514
|
+
const ae = E.current[U];
|
|
12503
12515
|
if (!ae) continue;
|
|
12504
12516
|
j = f6(
|
|
12505
12517
|
j,
|
|
12506
12518
|
`uniform ${ae.type} ${U}${ae.arraySize || ""};
|
|
12507
12519
|
`,
|
|
12508
|
-
j.lastIndexOf(
|
|
12520
|
+
j.lastIndexOf(N) + N.length
|
|
12509
12521
|
), ae.isNeeded = !0;
|
|
12510
12522
|
}
|
|
12511
12523
|
return M.includes("mainImage") && (j = j.concat(t6)), j;
|
|
12512
12524
|
}, ie = (M) => {
|
|
12513
|
-
const
|
|
12514
|
-
if (!
|
|
12515
|
-
const
|
|
12516
|
-
|
|
12517
|
-
const j =
|
|
12525
|
+
const S = C.current;
|
|
12526
|
+
if (!S || !w.current) return;
|
|
12527
|
+
const N = V.current ? (M - V.current) / 1e3 : 0;
|
|
12528
|
+
V.current = M;
|
|
12529
|
+
const j = F.current;
|
|
12518
12530
|
if (j)
|
|
12519
12531
|
for (const B of Object.keys(j)) {
|
|
12520
12532
|
const U = j[B];
|
|
12521
|
-
if (U &&
|
|
12533
|
+
if (U && E.current[B]?.isNeeded) {
|
|
12522
12534
|
if (!w.current) return;
|
|
12523
|
-
const ae =
|
|
12535
|
+
const ae = S.getUniformLocation(
|
|
12524
12536
|
w.current,
|
|
12525
12537
|
B
|
|
12526
12538
|
);
|
|
12527
12539
|
if (!ae) return;
|
|
12528
12540
|
a6(
|
|
12529
|
-
|
|
12541
|
+
S,
|
|
12530
12542
|
ae,
|
|
12531
12543
|
U.type,
|
|
12532
12544
|
U.value
|
|
12533
12545
|
);
|
|
12534
12546
|
}
|
|
12535
12547
|
}
|
|
12536
|
-
if (
|
|
12537
|
-
const B =
|
|
12548
|
+
if (E.current.iMouse?.isNeeded) {
|
|
12549
|
+
const B = S.getUniformLocation(
|
|
12538
12550
|
w.current,
|
|
12539
12551
|
it
|
|
12540
12552
|
);
|
|
12541
|
-
|
|
12553
|
+
S.uniform4fv(B, E.current.iMouse.value);
|
|
12542
12554
|
}
|
|
12543
|
-
if (
|
|
12544
|
-
const B =
|
|
12555
|
+
if (E.current.iChannelResolution?.isNeeded) {
|
|
12556
|
+
const B = S.getUniformLocation(
|
|
12545
12557
|
w.current,
|
|
12546
12558
|
ct
|
|
12547
12559
|
);
|
|
12548
|
-
|
|
12560
|
+
S.uniform3fv(
|
|
12549
12561
|
B,
|
|
12550
|
-
|
|
12562
|
+
E.current.iChannelResolution.value
|
|
12551
12563
|
);
|
|
12552
12564
|
}
|
|
12553
|
-
if (
|
|
12554
|
-
const B =
|
|
12565
|
+
if (E.current.iDeviceOrientation?.isNeeded) {
|
|
12566
|
+
const B = S.getUniformLocation(
|
|
12555
12567
|
w.current,
|
|
12556
12568
|
lt
|
|
12557
12569
|
);
|
|
12558
|
-
|
|
12570
|
+
S.uniform4fv(
|
|
12559
12571
|
B,
|
|
12560
|
-
|
|
12572
|
+
E.current.iDeviceOrientation.value
|
|
12561
12573
|
);
|
|
12562
12574
|
}
|
|
12563
|
-
if (
|
|
12564
|
-
const B =
|
|
12575
|
+
if (E.current.iTime?.isNeeded) {
|
|
12576
|
+
const B = S.getUniformLocation(
|
|
12565
12577
|
w.current,
|
|
12566
12578
|
rt
|
|
12567
12579
|
);
|
|
12568
|
-
|
|
12580
|
+
S.uniform1f(B, L.current += N);
|
|
12569
12581
|
}
|
|
12570
|
-
if (
|
|
12571
|
-
const B =
|
|
12582
|
+
if (E.current.iTimeDelta?.isNeeded) {
|
|
12583
|
+
const B = S.getUniformLocation(
|
|
12572
12584
|
w.current,
|
|
12573
12585
|
ot
|
|
12574
12586
|
);
|
|
12575
|
-
|
|
12587
|
+
S.uniform1f(B, N);
|
|
12576
12588
|
}
|
|
12577
|
-
if (
|
|
12578
|
-
const B = /* @__PURE__ */ new Date(), U = B.getMonth() + 1, ae = B.getDate(), J = B.getFullYear(), we = B.getHours() * 60 * 60 + B.getMinutes() * 60 + B.getSeconds() + B.getMilliseconds() * 1e-3, Ee =
|
|
12589
|
+
if (E.current.iDate?.isNeeded) {
|
|
12590
|
+
const B = /* @__PURE__ */ new Date(), U = B.getMonth() + 1, ae = B.getDate(), J = B.getFullYear(), we = B.getHours() * 60 * 60 + B.getMinutes() * 60 + B.getSeconds() + B.getMilliseconds() * 1e-3, Ee = S.getUniformLocation(
|
|
12579
12591
|
w.current,
|
|
12580
12592
|
nt
|
|
12581
12593
|
);
|
|
12582
|
-
|
|
12594
|
+
S.uniform4fv(Ee, [J, U, ae, we]);
|
|
12583
12595
|
}
|
|
12584
|
-
if (
|
|
12585
|
-
const B =
|
|
12596
|
+
if (E.current.iFrame?.isNeeded) {
|
|
12597
|
+
const B = S.getUniformLocation(
|
|
12586
12598
|
w.current,
|
|
12587
12599
|
st
|
|
12588
|
-
), U =
|
|
12589
|
-
|
|
12600
|
+
), U = E.current.iFrame.value;
|
|
12601
|
+
S.uniform1i(B, U), E.current.iFrame.value = U + 1;
|
|
12590
12602
|
}
|
|
12591
|
-
if (
|
|
12592
|
-
for (let B = 0; B <
|
|
12593
|
-
const U =
|
|
12603
|
+
if (A.current.length > 0)
|
|
12604
|
+
for (let B = 0; B < A.current.length; B++) {
|
|
12605
|
+
const U = A.current[B];
|
|
12594
12606
|
if (!U) return;
|
|
12595
12607
|
const { isVideo: ae, _webglTexture: J, source: we, flipY: Ee, isLoaded: Te } = U;
|
|
12596
12608
|
if (!Te || !J || !we) return;
|
|
12597
|
-
if (
|
|
12609
|
+
if (E.current[`iChannel${B}`]?.isNeeded) {
|
|
12598
12610
|
if (!w.current) return;
|
|
12599
|
-
const Ce =
|
|
12611
|
+
const Ce = S.getUniformLocation(
|
|
12600
12612
|
w.current,
|
|
12601
12613
|
`iChannel${B}`
|
|
12602
12614
|
);
|
|
12603
|
-
|
|
12615
|
+
S.activeTexture(S.TEXTURE0 + B), S.bindTexture(S.TEXTURE_2D, J), S.uniform1i(Ce, B), ae && U.updateTexture(
|
|
12604
12616
|
J,
|
|
12605
12617
|
we,
|
|
12606
12618
|
Ee
|
|
@@ -12608,55 +12620,55 @@ ${N}`));
|
|
|
12608
12620
|
}
|
|
12609
12621
|
}
|
|
12610
12622
|
}, oe = (M) => {
|
|
12611
|
-
const
|
|
12612
|
-
if (!
|
|
12613
|
-
|
|
12623
|
+
const S = C.current;
|
|
12624
|
+
if (!S) return;
|
|
12625
|
+
S.viewport(0, 0, S.drawingBufferWidth, S.drawingBufferHeight), S.clear(S.COLOR_BUFFER_BIT | S.DEPTH_BUFFER_BIT), S.bindBuffer(S.ARRAY_BUFFER, v.current), S.vertexAttribPointer(
|
|
12614
12626
|
k.current ?? 0,
|
|
12615
12627
|
3,
|
|
12616
|
-
|
|
12628
|
+
S.FLOAT,
|
|
12617
12629
|
!1,
|
|
12618
12630
|
0,
|
|
12619
12631
|
0
|
|
12620
|
-
), ie(M),
|
|
12621
|
-
const
|
|
12622
|
-
if (
|
|
12623
|
-
const j =
|
|
12624
|
-
|
|
12632
|
+
), ie(M), S.drawArrays(S.TRIANGLE_STRIP, 0, 4);
|
|
12633
|
+
const N = E.current.iMouse?.value;
|
|
12634
|
+
if (E.current.iMouse?.isNeeded && l !== 1 && Array.isArray(N)) {
|
|
12635
|
+
const j = N[0] ?? 0, B = N[1] ?? 0;
|
|
12636
|
+
N[0] = gt(j, b.current[0] ?? 0, l), N[1] = gt(B, b.current[1] ?? 0, l);
|
|
12625
12637
|
}
|
|
12626
|
-
|
|
12638
|
+
T.current = requestAnimationFrame(oe);
|
|
12627
12639
|
}, se = () => {
|
|
12628
12640
|
const M = { passive: !0 };
|
|
12629
|
-
|
|
12641
|
+
E.current.iMouse?.isNeeded && h.current && (h.current.addEventListener("mousemove", K, M), h.current.addEventListener("mouseout", O, M), h.current.addEventListener("mouseup", O, M), h.current.addEventListener("mousedown", re, M), h.current.addEventListener("touchmove", K, M), h.current.addEventListener("touchend", O, M), h.current.addEventListener("touchstart", re, M)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener(
|
|
12630
12642
|
"deviceorientation",
|
|
12631
12643
|
G,
|
|
12632
12644
|
M
|
|
12633
|
-
), h.current && (
|
|
12645
|
+
), h.current && (y.current = new ResizeObserver(Z), y.current.observe(h.current), window.addEventListener("resize", Z, M));
|
|
12634
12646
|
}, de = () => {
|
|
12635
12647
|
const M = { passive: !0 };
|
|
12636
|
-
|
|
12648
|
+
E.current.iMouse?.isNeeded && h.current && (h.current.removeEventListener("mousemove", K, M), h.current.removeEventListener("mouseout", O, M), h.current.removeEventListener("mouseup", O, M), h.current.removeEventListener("mousedown", re, M), h.current.removeEventListener("touchmove", K, M), h.current.removeEventListener("touchend", O, M), h.current.removeEventListener("touchstart", re, M)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener(
|
|
12637
12649
|
"deviceorientation",
|
|
12638
12650
|
G,
|
|
12639
12651
|
M
|
|
12640
|
-
),
|
|
12652
|
+
), y.current && (y.current.disconnect(), window.removeEventListener("resize", Z, M));
|
|
12641
12653
|
};
|
|
12642
12654
|
return X(() => {
|
|
12643
|
-
|
|
12655
|
+
F.current = n;
|
|
12644
12656
|
}, [n]), X(() => {
|
|
12645
|
-
const M =
|
|
12646
|
-
function
|
|
12657
|
+
const M = A.current;
|
|
12658
|
+
function S() {
|
|
12647
12659
|
_();
|
|
12648
|
-
const
|
|
12649
|
-
|
|
12660
|
+
const N = C.current;
|
|
12661
|
+
N && h.current && (N.clearColor(...s), N.clearDepth(1), N.enable(N.DEPTH_TEST), N.depthFunc(N.LEQUAL), N.viewport(0, 0, h.current.width, h.current.height), h.current.height = h.current.clientHeight, h.current.width = h.current.clientWidth, W(), he(), Q(ge(e || r6), t || tt), z(), requestAnimationFrame(oe), se(), Z());
|
|
12650
12662
|
}
|
|
12651
|
-
return requestAnimationFrame(
|
|
12652
|
-
const
|
|
12653
|
-
if (
|
|
12654
|
-
if (
|
|
12663
|
+
return requestAnimationFrame(S), () => {
|
|
12664
|
+
const N = C.current;
|
|
12665
|
+
if (N) {
|
|
12666
|
+
if (N.getExtension("WEBGL_lose_context")?.loseContext(), N.useProgram(null), N.deleteProgram(w.current ?? null), M.length > 0)
|
|
12655
12667
|
for (const j of M)
|
|
12656
|
-
|
|
12668
|
+
N.deleteTexture(j._webglTexture);
|
|
12657
12669
|
w.current = null;
|
|
12658
12670
|
}
|
|
12659
|
-
de(), cancelAnimationFrame(
|
|
12671
|
+
de(), cancelAnimationFrame(T.current ?? 0);
|
|
12660
12672
|
};
|
|
12661
12673
|
}, []), /* @__PURE__ */ r(
|
|
12662
12674
|
"canvas",
|
|
@@ -13311,10 +13323,10 @@ const N6 = ({
|
|
|
13311
13323
|
} = e, [f, g] = P(!1), [m, h] = P(!1), C = f || m, v = ye(), w = C && !!d, k = {
|
|
13312
13324
|
duration: v ? 0 : 0.2,
|
|
13313
13325
|
ease: [0.33, 1, 0.68, 1]
|
|
13314
|
-
},
|
|
13326
|
+
}, T = () => {
|
|
13315
13327
|
a?.();
|
|
13316
|
-
},
|
|
13317
|
-
|
|
13328
|
+
}, H = (R) => {
|
|
13329
|
+
R.currentTarget === R.target && (R.key === "Enter" || R.key === " ") && (R.preventDefault(), a?.());
|
|
13318
13330
|
};
|
|
13319
13331
|
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
13320
13332
|
i && /* @__PURE__ */ c(xe, { children: [
|
|
@@ -13356,8 +13368,8 @@ const N6 = ({
|
|
|
13356
13368
|
a && me(),
|
|
13357
13369
|
l
|
|
13358
13370
|
),
|
|
13359
|
-
onClick: a ?
|
|
13360
|
-
onKeyDown: a ?
|
|
13371
|
+
onClick: a ? T : void 0,
|
|
13372
|
+
onKeyDown: a ? H : void 0,
|
|
13361
13373
|
onMouseEnter: () => g(!0),
|
|
13362
13374
|
onMouseLeave: () => g(!1),
|
|
13363
13375
|
onFocus: () => h(!0),
|
|
@@ -14259,10 +14271,10 @@ const R9 = ({
|
|
|
14259
14271
|
}) => {
|
|
14260
14272
|
const f = Y(), [g, m] = P("");
|
|
14261
14273
|
X(() => {
|
|
14262
|
-
const
|
|
14263
|
-
|
|
14274
|
+
const b = (A) => {
|
|
14275
|
+
A.key === "Escape" && e();
|
|
14264
14276
|
};
|
|
14265
|
-
return document.addEventListener("keydown",
|
|
14277
|
+
return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
|
|
14266
14278
|
}, [e]);
|
|
14267
14279
|
const h = ee(
|
|
14268
14280
|
() => ({
|
|
@@ -14279,30 +14291,30 @@ const R9 = ({
|
|
|
14279
14291
|
]
|
|
14280
14292
|
), C = ee(() => {
|
|
14281
14293
|
if (!g.trim()) return n;
|
|
14282
|
-
const
|
|
14283
|
-
return n.filter((
|
|
14294
|
+
const b = g.toLowerCase();
|
|
14295
|
+
return n.filter((A) => A.title.toLowerCase().includes(b));
|
|
14284
14296
|
}, [n, g]), v = ee(
|
|
14285
|
-
() => C.filter((
|
|
14297
|
+
() => C.filter((b) => a.has(b.id)),
|
|
14286
14298
|
[C, a]
|
|
14287
14299
|
), w = ee(
|
|
14288
|
-
() => C.filter((
|
|
14300
|
+
() => C.filter((b) => !a.has(b.id)),
|
|
14289
14301
|
[C, a]
|
|
14290
14302
|
), k = ee(
|
|
14291
14303
|
() => K6(w),
|
|
14292
14304
|
[w]
|
|
14293
|
-
),
|
|
14294
|
-
(
|
|
14295
|
-
t(
|
|
14305
|
+
), T = q(
|
|
14306
|
+
(b, A) => {
|
|
14307
|
+
t(b, A), e();
|
|
14296
14308
|
},
|
|
14297
14309
|
[t, e]
|
|
14298
|
-
),
|
|
14310
|
+
), H = q(() => {
|
|
14299
14311
|
o(), e();
|
|
14300
|
-
}, [o, e]),
|
|
14301
|
-
(
|
|
14302
|
-
u(
|
|
14312
|
+
}, [o, e]), R = q(
|
|
14313
|
+
(b) => {
|
|
14314
|
+
u(b);
|
|
14303
14315
|
},
|
|
14304
14316
|
[u]
|
|
14305
|
-
),
|
|
14317
|
+
), L = v.length > 0 || k.length > 0;
|
|
14306
14318
|
return Kt(
|
|
14307
14319
|
/* @__PURE__ */ c(xe, { children: [
|
|
14308
14320
|
/* @__PURE__ */ r(
|
|
@@ -14340,7 +14352,7 @@ const R9 = ({
|
|
|
14340
14352
|
{
|
|
14341
14353
|
type: "text",
|
|
14342
14354
|
value: g,
|
|
14343
|
-
onChange: (
|
|
14355
|
+
onChange: (b) => m(b.target.value),
|
|
14344
14356
|
placeholder: f.ai.searchChats,
|
|
14345
14357
|
className: x(
|
|
14346
14358
|
"w-full",
|
|
@@ -14358,7 +14370,7 @@ const R9 = ({
|
|
|
14358
14370
|
variant: "ghost",
|
|
14359
14371
|
size: "md",
|
|
14360
14372
|
className: "py-1 [&>div>span>span]:w-full",
|
|
14361
|
-
onClick:
|
|
14373
|
+
onClick: H,
|
|
14362
14374
|
children: /* @__PURE__ */ c("div", { className: "flex w-full items-center gap-2", children: [
|
|
14363
14375
|
/* @__PURE__ */ r(le, { icon: E1, color: "default", size: "md" }),
|
|
14364
14376
|
/* @__PURE__ */ r(ce, { lines: 1, className: "text-left", children: f.ai.startNewChat })
|
|
@@ -14367,31 +14379,31 @@ const R9 = ({
|
|
|
14367
14379
|
),
|
|
14368
14380
|
s && /* @__PURE__ */ r(J6, {}),
|
|
14369
14381
|
!s && i && /* @__PURE__ */ r("p", { className: "py-8 text-center text-base text-f1-foreground-tertiary", children: i }),
|
|
14370
|
-
!s && !i && !
|
|
14382
|
+
!s && !i && !L && /* @__PURE__ */ r("p", { className: "py-8 text-center text-base text-f1-foreground-tertiary", children: f.ai.noPreviousChats }),
|
|
14371
14383
|
!s && !i && v.length > 0 && /* @__PURE__ */ r(
|
|
14372
14384
|
Ct,
|
|
14373
14385
|
{
|
|
14374
14386
|
label: f.ai.pinnedChats,
|
|
14375
14387
|
threads: v,
|
|
14376
14388
|
pinnedIds: a,
|
|
14377
|
-
onSelect:
|
|
14389
|
+
onSelect: T,
|
|
14378
14390
|
onPin: d,
|
|
14379
14391
|
onUnpin: l,
|
|
14380
|
-
onDelete:
|
|
14392
|
+
onDelete: R
|
|
14381
14393
|
}
|
|
14382
14394
|
),
|
|
14383
|
-
!s && !i && k.map((
|
|
14395
|
+
!s && !i && k.map((b) => /* @__PURE__ */ r(
|
|
14384
14396
|
Ct,
|
|
14385
14397
|
{
|
|
14386
|
-
label: h[
|
|
14387
|
-
threads:
|
|
14398
|
+
label: h[b.key],
|
|
14399
|
+
threads: b.threads,
|
|
14388
14400
|
pinnedIds: a,
|
|
14389
|
-
onSelect:
|
|
14401
|
+
onSelect: T,
|
|
14390
14402
|
onPin: d,
|
|
14391
14403
|
onUnpin: l,
|
|
14392
|
-
onDelete:
|
|
14404
|
+
onDelete: R
|
|
14393
14405
|
},
|
|
14394
|
-
|
|
14406
|
+
b.key
|
|
14395
14407
|
))
|
|
14396
14408
|
] })
|
|
14397
14409
|
]
|