@factorialco/f0-react 6.88.0 → 6.88.2
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/{ChatDocxThumbnail-DzNPNFya.js → ChatDocxThumbnail-DhzoVI1K.js} +11 -8
- package/dist/{ChatPdfThumbnail-BFul62a4.js → ChatPdfThumbnail-BHa-zmGt.js} +1 -1
- package/dist/{ChatSheetThumbnail-CxGL5ukQ.js → ChatSheetThumbnail-D8aN1W_0.js} +3 -2
- package/dist/{ChatTextThumbnail-FVwMzn0I.js → ChatTextThumbnail-B53pSYUy.js} +2 -1
- package/dist/{CoachmarkProvider-2_pMSJdO.js → CoachmarkProvider-Dl0ullRd.js} +11948 -11697
- package/dist/{DocumentToolbar-BR442e_P.js → DocumentToolbar-CbvxX6_A.js} +2 -2
- package/dist/{DocxViewer-YweHIcvR.js → DocxViewer-D0ywzo9E.js} +11 -9
- package/dist/{F0AiProcessingOverlay-Dpen_hcq.js → F0AiProcessingOverlay-CwJG6TgU.js} +492 -405
- package/dist/{F0CanvasPanel-DjWQhvxj.js → F0CanvasPanel-CpgOQnbI.js} +7475 -7355
- package/dist/F0CanvasPanel.css +1 -1
- package/dist/{F0VideoPlayer-CYnKHXXD.js → F0VideoPlayer-CXAjfSnS.js} +447 -429
- package/dist/{LocationMap-YcfJrfST.js → LocationMap-BHPvamUV.js} +5 -3
- package/dist/{SheetViewer-CPr0Xea_.js → SheetViewer-B0xNsuOQ.js} +3 -3
- package/dist/{TextViewer-Cu9mNx0F.js → TextViewer-DDrr3xIG.js} +4 -3
- package/dist/ai.d.ts +13 -13
- package/dist/ai.js +2 -2
- package/dist/component-status.d.ts +8 -8
- package/dist/component-status.js +3 -2
- package/dist/{experimental-Q9kMJ9wE.js → experimental-B-SPgEj_.js} +3070 -2859
- package/dist/experimental.d.ts +65 -54
- package/dist/experimental.js +3 -3
- package/dist/f0.d.ts +84 -73
- package/dist/f0.js +8070 -7967
- package/dist/i18n-provider-defaults.d.ts +4 -4
- package/dist/{index-O6DySIGj.js → index-D1wOJXWr.js} +23 -13
- package/dist/index-uG8opRj1.js +4 -0
- package/dist/{pdfWorker-CrkERbwq.js → pdfWorker-mxUZLnlP.js} +2 -2
- package/dist/{sheetPreview-5qeAOp0W.js → sheetPreview-Djc-YyVs.js} +4 -2
- package/icons/app/CursorClick.d.ts.map +1 -1
- package/icons/app/FitView.d.ts.map +1 -1
- package/icons/modules/Benefits.d.ts.map +1 -1
- package/icons/modules/Calendar.d.ts.map +1 -1
- package/icons/modules/Cards.d.ts.map +1 -1
- package/icons/modules/ClockIn.d.ts.map +1 -1
- package/icons/modules/Communities.d.ts.map +1 -1
- package/icons/modules/Complaints.d.ts.map +1 -1
- package/icons/modules/Discover.d.ts.map +1 -1
- package/icons/modules/Documents.d.ts.map +1 -1
- package/icons/modules/Engagement.d.ts.map +1 -1
- package/icons/modules/Finance.d.ts.map +1 -1
- package/icons/modules/Goals.d.ts.map +1 -1
- package/icons/modules/Home.d.ts.map +1 -1
- package/icons/modules/Hub.d.ts.map +1 -1
- package/icons/modules/Inbox.d.ts.map +1 -1
- package/icons/modules/ItManagement.d.ts.map +1 -1
- package/icons/modules/Kudos.d.ts.map +1 -1
- package/icons/modules/LMS.d.ts.map +1 -1
- package/icons/modules/Marketplace.d.ts.map +1 -1
- package/icons/modules/Meetings.d.ts.map +1 -1
- package/icons/modules/MyDocuments.d.ts.map +1 -1
- package/icons/modules/Organization.d.ts.map +1 -1
- package/icons/modules/Overviews.d.ts.map +1 -1
- package/icons/modules/Pages.d.ts.map +1 -1
- package/icons/modules/Payroll.d.ts.map +1 -1
- package/icons/modules/Performance.d.ts.map +1 -1
- package/icons/modules/Profile.d.ts.map +1 -1
- package/icons/modules/Projects.d.ts.map +1 -1
- package/icons/modules/Recruitment.d.ts.map +1 -1
- package/icons/modules/Reports.d.ts.map +1 -1
- package/icons/modules/Rocket.d.ts.map +1 -1
- package/icons/modules/SalaryAdvance.d.ts.map +1 -1
- package/icons/modules/Sales.d.ts.map +1 -1
- package/icons/modules/Settings.d.ts.map +1 -1
- package/icons/modules/Shifts.d.ts.map +1 -1
- package/icons/modules/Social.d.ts.map +1 -1
- package/icons/modules/Software.d.ts.map +1 -1
- package/icons/modules/Spaces.d.ts.map +1 -1
- package/icons/modules/Spending.d.ts.map +1 -1
- package/icons/modules/Tasks.d.ts.map +1 -1
- package/icons/modules/TimeOff.d.ts.map +1 -1
- package/icons/modules/TimeTracking.d.ts.map +1 -1
- package/icons/modules/Trainings.d.ts.map +1 -1
- package/icons/modules/Treasury.d.ts.map +1 -1
- package/icons/modules/Workflows.d.ts.map +1 -1
- package/icons/special/One.d.ts.map +1 -1
- package/package.json +6 -3
- package/dist/index-N_SH9qr4.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, o as oe, aj as pt, ak as G1, n as mt, al as un, am as fn, an as hn, ao as Cn, ap as pn, aq as mn, ar as N1, as as gn, at as gt, au as wn, av as vn, l as R1, aw as Ln, ax as xn, ay as wt, az as bn, aA as kn, aB as yn, aC as Mn, aD as Rn, aE as Fn, aF as vt, aG as Nn, 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, E as _n, aS 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, U as Lt, b8 as so, b9 as ao, ba as io, bb as lo, bc as xt, R as bt, bd as co, i as uo, be as fo, bf as ho, bg as Co, bh as po, bi as mo, bj as kt, bk as go, bl as wo, bm as vo, bn as Lo, bo as xo, bp as bo, j as ko, bq as yt, br as Mt, bs as yo, bt as Rt, bu as Mo, bv as se, q as Ro, bw as ae, bx as Fo, by as No, bz as ie, O as So, Q as Vo, bA as Ft, bB as To, 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 Nt, bM as jo, bN as Oo, bO as Zo, bP as Uo, u as G, bQ as r1, bR as zo, S as u1, bS as St, V as n1, bT as Go, m as w1, bU as Wo, bV as o1, bW as C1, bX as L1, bY as Y, bZ as Vt, t as le, b_ as qo, x as ce, b as y1, b$ as Xo, c0 as Yo, c1 as Ko, d as Tt, c2 as Qo, c3 as Jo, c4 as de, c5 as es, c6 as ts, c7 as rs, c8 as He, c9 as ns, ca as Ht, cb as At, cc as os, cd as ss, ce as as, cf as is, cg as ls, ch as Et, ci as cs, cj as ds, ck as us, cl as E1, cm as $t, cn as Bt, co as It, c as J1, cp as Ae, cq as Pt, cr as fs, cs as hs, ct as B1, cu as Cs, cv as ps, cw as ms, cx as ue, cy as gs, cz as ws, cA as vs, cB as Ls, cC as xs, cD as bs, w as ks, s as ys, cE as K1, v as Dt, cF as Ms, cG as Rs, cH as Ee, cI as _t, cJ as jt, cK as Fs, cL as Ns, cM as Ss, cN as Vs, cO as Ts, cP as Hs } 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, o as oe, aj as pt, ak as G1, n as mt, al as un, am as fn, an as hn, ao as Cn, ap as pn, aq as mn, ar as N1, as as gn, at as gt, au as wn, av as vn, l as R1, aw as Ln, ax as xn, ay as wt, az as bn, aA as kn, aB as yn, aC as Mn, aD as Rn, aE as Fn, aF as vt, aG as Nn, 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, E as _n, aS 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, U as Lt, b8 as so, b9 as ao, ba as io, bb as lo, bc as xt, R as bt, bd as co, i as uo, be as fo, bf as ho, bg as Co, bh as po, bi as mo, bj as kt, bk as go, bl as wo, bm as vo, bn as Lo, bo as xo, bp as bo, j as ko, bq as yt, br as Mt, bs as yo, bt as Rt, bu as Mo, bv as se, q as Ro, bw as ae, bx as Fo, by as No, bz as ie, O as So, Q as Vo, bA as Ft, bB as To, 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 Nt, bM as jo, bN as Oo, bO as Zo, bP as Uo, u as G, bQ as r1, bR as zo, S as u1, bS as St, V as n1, bT as Go, m as w1, bU as Wo, bV as o1, bW as C1, bX as L1, bY as Y, bZ as Vt, t as le, b_ as qo, x as ce, b as y1, b$ as Xo, c0 as Yo, c1 as Ko, d as Tt, c2 as Qo, c3 as Jo, c4 as de, c5 as es, c6 as ts, c7 as rs, c8 as He, c9 as ns, ca as Ht, cb as At, cc as os, cd as ss, ce as as, cf as is, cg as ls, ch as Et, ci as cs, cj as ds, ck as us, cl as E1, cm as $t, cn as Bt, co as It, c as J1, cp as Ae, cq as Pt, cr as fs, cs as hs, ct as B1, cu as Cs, cv as ps, cw as ms, cx as ue, cy as gs, cz as ws, cA as vs, cB as Ls, cC as xs, cD as bs, w as ks, s as ys, cE as K1, v as Dt, cF as Ms, cG as Rs, cH as Ee, cI as _t, cJ as jt, cK as Fs, cL as Ns, cM as Ss, cN as Vs, cO as Ts, cP as Hs } from "./F0CanvasPanel-CpgOQnbI.js";
|
|
4
4
|
import { d as b, f as f1, u as As } from "./tooltip-CMBdJvJA.js";
|
|
5
5
|
import { createPortal as Ot } from "react-dom";
|
|
6
6
|
import { defaultTranslations as Es } from "./i18n-provider-defaults.js";
|
|
@@ -4129,8 +4129,8 @@ const _0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4129
4129
|
variant: "outline",
|
|
4130
4130
|
size: "md",
|
|
4131
4131
|
disabled: o || g === "transcribing",
|
|
4132
|
-
onClick: (
|
|
4133
|
-
|
|
4132
|
+
onClick: (F) => {
|
|
4133
|
+
F.preventDefault(), c.current?.click();
|
|
4134
4134
|
}
|
|
4135
4135
|
}
|
|
4136
4136
|
),
|
|
@@ -4153,7 +4153,7 @@ const _0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4153
4153
|
"div",
|
|
4154
4154
|
{
|
|
4155
4155
|
className: "min-w-0 cursor-default",
|
|
4156
|
-
onClick: (
|
|
4156
|
+
onClick: (F) => F.stopPropagation(),
|
|
4157
4157
|
children: r
|
|
4158
4158
|
}
|
|
4159
4159
|
)
|
|
@@ -4255,7 +4255,8 @@ const y2 = {
|
|
|
4255
4255
|
children: r
|
|
4256
4256
|
}) => {
|
|
4257
4257
|
const n = G();
|
|
4258
|
-
if (!e)
|
|
4258
|
+
if (!e)
|
|
4259
|
+
return r;
|
|
4259
4260
|
const o = {
|
|
4260
4261
|
...y2[e.level],
|
|
4261
4262
|
text: n.ai.creditWarning.soft
|
|
@@ -4316,7 +4317,8 @@ function R2({
|
|
|
4316
4317
|
d.current?.scrollIntoView({ block: "nearest" });
|
|
4317
4318
|
}, [o]), re(() => {
|
|
4318
4319
|
const u = c.current, C = u?.offsetParent;
|
|
4319
|
-
if (!u || !C)
|
|
4320
|
+
if (!u || !C)
|
|
4321
|
+
return;
|
|
4320
4322
|
const g = u.offsetLeft + u.offsetWidth - C.clientWidth;
|
|
4321
4323
|
g > 0 && (u.style.left = `${Math.max(0, u.offsetLeft - g)}px`);
|
|
4322
4324
|
}, [s]);
|
|
@@ -4444,22 +4446,22 @@ const F2 = ({
|
|
|
4444
4446
|
}
|
|
4445
4447
|
if (s)
|
|
4446
4448
|
return u(!1), c(w), v(), C.current = setTimeout(() => {
|
|
4447
|
-
const
|
|
4448
|
-
l(
|
|
4449
|
+
const R = (d + 1) % Math.max(e.length, 1);
|
|
4450
|
+
l(R);
|
|
4449
4451
|
}, 4e3), () => {
|
|
4450
4452
|
v();
|
|
4451
4453
|
};
|
|
4452
4454
|
u(!0), c("");
|
|
4453
4455
|
let p = 0;
|
|
4454
|
-
const k = 50,
|
|
4456
|
+
const k = 50, F = 30, H = 2e3, T = 1e3;
|
|
4455
4457
|
return g.current = setInterval(() => {
|
|
4456
4458
|
p < w.length ? (c(w.slice(0, p + 1)), p++) : (g.current && (clearInterval(g.current), g.current = null), C.current = setTimeout(() => {
|
|
4457
4459
|
h.current = setInterval(() => {
|
|
4458
4460
|
p > 0 ? (p--, c(w.slice(0, p))) : (h.current && (clearInterval(h.current), h.current = null), C.current = setTimeout(() => {
|
|
4459
|
-
const
|
|
4460
|
-
l(
|
|
4461
|
+
const R = (d + 1) % Math.max(e.length, 1);
|
|
4462
|
+
l(R);
|
|
4461
4463
|
}, T));
|
|
4462
|
-
},
|
|
4464
|
+
}, F);
|
|
4463
4465
|
}, H));
|
|
4464
4466
|
}, k), () => {
|
|
4465
4467
|
v();
|
|
@@ -4641,7 +4643,8 @@ const F2 = ({
|
|
|
4641
4643
|
function A2(e = H2) {
|
|
4642
4644
|
const [r, n] = I(null), [o, s] = I({ start: !1, end: !1 });
|
|
4643
4645
|
z(() => {
|
|
4644
|
-
if (!r)
|
|
4646
|
+
if (!r)
|
|
4647
|
+
return;
|
|
4645
4648
|
const c = () => {
|
|
4646
4649
|
const l = r.scrollWidth > r.clientWidth + 1;
|
|
4647
4650
|
s({
|
|
@@ -4652,13 +4655,15 @@ function A2(e = H2) {
|
|
|
4652
4655
|
c(), r.addEventListener("scroll", c, { passive: !0 });
|
|
4653
4656
|
const d = typeof ResizeObserver == "function" ? new ResizeObserver(c) : null;
|
|
4654
4657
|
d?.observe(r);
|
|
4655
|
-
for (const l of Array.from(r.children))
|
|
4658
|
+
for (const l of Array.from(r.children))
|
|
4659
|
+
d?.observe(l);
|
|
4656
4660
|
return () => {
|
|
4657
4661
|
r.removeEventListener("scroll", c), d?.disconnect();
|
|
4658
4662
|
};
|
|
4659
4663
|
}, [r]);
|
|
4660
4664
|
const a = X(() => {
|
|
4661
|
-
if (!o.start && !o.end)
|
|
4665
|
+
if (!o.start && !o.end)
|
|
4666
|
+
return {};
|
|
4662
4667
|
const c = o.start ? `transparent 0, black ${e}px` : "black 0", d = o.end ? `black calc(100% - ${e}px), transparent 100%` : "black 100%", l = `linear-gradient(to right, ${c}, ${d})`;
|
|
4663
4668
|
return { maskImage: l, WebkitMaskImage: l };
|
|
4664
4669
|
}, [o, e]);
|
|
@@ -4725,8 +4730,8 @@ const _2 = ({
|
|
|
4725
4730
|
"aria-haspopup": "dialog",
|
|
4726
4731
|
"aria-expanded": c === k,
|
|
4727
4732
|
"aria-controls": c === k ? h : void 0,
|
|
4728
|
-
onClick: (
|
|
4729
|
-
C.current =
|
|
4733
|
+
onClick: (F) => {
|
|
4734
|
+
C.current = F.currentTarget, g.current = !1, d((H) => H === k ? null : k), n?.(null);
|
|
4730
4735
|
}
|
|
4731
4736
|
},
|
|
4732
4737
|
`${p.label}-${k}`
|
|
@@ -4775,8 +4780,8 @@ const _2 = ({
|
|
|
4775
4780
|
{
|
|
4776
4781
|
item: p,
|
|
4777
4782
|
onHover: n,
|
|
4778
|
-
onSelect: (
|
|
4779
|
-
r(p, v), g.current = document.activeElement ===
|
|
4783
|
+
onSelect: (F) => {
|
|
4784
|
+
r(p, v), g.current = document.activeElement === F.currentTarget, d(null), n?.(null);
|
|
4780
4785
|
}
|
|
4781
4786
|
},
|
|
4782
4787
|
k
|
|
@@ -4796,9 +4801,11 @@ function j2({ item: e, onSelect: r, onHover: n }) {
|
|
|
4796
4801
|
}, []), l = _(() => {
|
|
4797
4802
|
c || (a.current = window.setTimeout(() => {
|
|
4798
4803
|
const C = s.current, g = o.current;
|
|
4799
|
-
if (!C || !g)
|
|
4804
|
+
if (!C || !g)
|
|
4805
|
+
return;
|
|
4800
4806
|
const h = C.scrollWidth - C.clientWidth;
|
|
4801
|
-
if (h <= 0)
|
|
4807
|
+
if (h <= 0)
|
|
4808
|
+
return;
|
|
4802
4809
|
const w = h + I2, v = w / $2 * 1e3;
|
|
4803
4810
|
C.style.overflow = "visible";
|
|
4804
4811
|
const p = `linear-gradient(90deg, transparent 0, #000 ${P2}px)`;
|
|
@@ -4851,7 +4858,8 @@ function O2(e, r, n) {
|
|
|
4851
4858
|
let g = 0;
|
|
4852
4859
|
for (; ; ) {
|
|
4853
4860
|
const h = e.indexOf(C, g);
|
|
4854
|
-
if (h === -1)
|
|
4861
|
+
if (h === -1)
|
|
4862
|
+
break;
|
|
4855
4863
|
a.push({ start: h, end: h + C.length }), g = h + C.length;
|
|
4856
4864
|
}
|
|
4857
4865
|
}
|
|
@@ -4870,7 +4878,8 @@ function O2(e, r, n) {
|
|
|
4870
4878
|
return f(e.length), !l && s && o >= d && c.push({ type: "ghost", text: s }), c.length === 0 ? [{ type: "text", text: e }] : c;
|
|
4871
4879
|
}
|
|
4872
4880
|
function Z2(e, r) {
|
|
4873
|
-
if (r === "*/*")
|
|
4881
|
+
if (r === "*/*")
|
|
4882
|
+
return !0;
|
|
4874
4883
|
if (r.endsWith("/*")) {
|
|
4875
4884
|
const n = r.slice(0, r.indexOf("/"));
|
|
4876
4885
|
return e.startsWith(n + "/");
|
|
@@ -4878,7 +4887,8 @@ function Z2(e, r) {
|
|
|
4878
4887
|
return e === r;
|
|
4879
4888
|
}
|
|
4880
4889
|
function U2(e, r) {
|
|
4881
|
-
if (!r)
|
|
4890
|
+
if (!r)
|
|
4891
|
+
return e;
|
|
4882
4892
|
const n = Array.isArray(r) ? r : [r];
|
|
4883
4893
|
return n.length === 0 ? e : e.filter(
|
|
4884
4894
|
(o) => n.some((s) => Z2(o.type, s))
|
|
@@ -4908,9 +4918,11 @@ function G2(e) {
|
|
|
4908
4918
|
);
|
|
4909
4919
|
const v = _(
|
|
4910
4920
|
async (H) => {
|
|
4911
|
-
if (H.length === 0 || !l)
|
|
4921
|
+
if (H.length === 0 || !l)
|
|
4922
|
+
return;
|
|
4912
4923
|
const T = U2(H, f);
|
|
4913
|
-
if (T.length === 0)
|
|
4924
|
+
if (T.length === 0)
|
|
4925
|
+
return;
|
|
4914
4926
|
if (u !== void 0 && h.current + T.length > u) {
|
|
4915
4927
|
w(
|
|
4916
4928
|
d.ai.tooManyFilesError.replace(
|
|
@@ -4920,12 +4932,12 @@ function G2(e) {
|
|
|
4920
4932
|
);
|
|
4921
4933
|
return;
|
|
4922
4934
|
}
|
|
4923
|
-
const
|
|
4935
|
+
const R = T.map((V) => ({
|
|
4924
4936
|
id: crypto.randomUUID(),
|
|
4925
4937
|
file: V,
|
|
4926
4938
|
status: "uploading"
|
|
4927
|
-
})), x =
|
|
4928
|
-
n((V) => [...V, ...
|
|
4939
|
+
})), x = R.map((V) => V.id);
|
|
4940
|
+
n((V) => [...V, ...R]);
|
|
4929
4941
|
const E = (V) => n(
|
|
4930
4942
|
(P) => P.map(
|
|
4931
4943
|
(N) => x.includes(N.id) ? { ...N, status: "error", errorMessage: V } : N
|
|
@@ -4939,7 +4951,7 @@ function G2(e) {
|
|
|
4939
4951
|
}
|
|
4940
4952
|
n(
|
|
4941
4953
|
(P) => P.map((N) => {
|
|
4942
|
-
const S =
|
|
4954
|
+
const S = R.findIndex((B) => B.id === N.id);
|
|
4943
4955
|
return S === -1 ? N : V[S] ? {
|
|
4944
4956
|
...N,
|
|
4945
4957
|
status: "uploaded",
|
|
@@ -4970,8 +4982,8 @@ function G2(e) {
|
|
|
4970
4982
|
},
|
|
4971
4983
|
[v]
|
|
4972
4984
|
), k = _((H) => {
|
|
4973
|
-
n((T) => T.filter((
|
|
4974
|
-
}, []),
|
|
4985
|
+
n((T) => T.filter((R) => R.id !== H));
|
|
4986
|
+
}, []), F = _(() => {
|
|
4975
4987
|
n([]);
|
|
4976
4988
|
}, []);
|
|
4977
4989
|
return {
|
|
@@ -4984,14 +4996,15 @@ function G2(e) {
|
|
|
4984
4996
|
processFiles: v,
|
|
4985
4997
|
handleFileSelect: p,
|
|
4986
4998
|
handleRemoveFile: k,
|
|
4987
|
-
clearFiles:
|
|
4999
|
+
clearFiles: F,
|
|
4988
5000
|
transientError: o,
|
|
4989
5001
|
showTransientError: w
|
|
4990
5002
|
};
|
|
4991
5003
|
}
|
|
4992
5004
|
function W2(e, r, n) {
|
|
4993
5005
|
const s = e.slice(0, r).lastIndexOf("@");
|
|
4994
|
-
if (s === -1)
|
|
5006
|
+
if (s === -1)
|
|
5007
|
+
return null;
|
|
4995
5008
|
if (s > 0) {
|
|
4996
5009
|
const c = e[s - 1];
|
|
4997
5010
|
if (c !== " " && c !== `
|
|
@@ -5000,7 +5013,8 @@ function W2(e, r, n) {
|
|
|
5000
5013
|
}
|
|
5001
5014
|
const a = e.slice(s + 1, r);
|
|
5002
5015
|
if (a.includes(`
|
|
5003
|
-
`))
|
|
5016
|
+
`))
|
|
5017
|
+
return null;
|
|
5004
5018
|
for (const c of n) {
|
|
5005
5019
|
const d = e.slice(s + 1), l = s + 1 + c.name.length;
|
|
5006
5020
|
if (d.startsWith(c.name) && r >= l) {
|
|
@@ -5067,7 +5081,7 @@ function K2({
|
|
|
5067
5081
|
searchPersons: o,
|
|
5068
5082
|
textareaRef: s
|
|
5069
5083
|
}) {
|
|
5070
|
-
const [a, c] = I(!1), [d, l] = I(""), [f, u] = I([]), [C, g] = I(!1), [h, w] = I(0), [v, p] = I([]), k = $(-1),
|
|
5084
|
+
const [a, c] = I(!1), [d, l] = I(""), [f, u] = I([]), [C, g] = I(!1), [h, w] = I(0), [v, p] = I([]), k = $(-1), F = $(null), H = $(0), T = $(-1);
|
|
5071
5085
|
z(() => {
|
|
5072
5086
|
if (!o) {
|
|
5073
5087
|
c(!1);
|
|
@@ -5080,9 +5094,9 @@ function K2({
|
|
|
5080
5094
|
}
|
|
5081
5095
|
if (S.atIndex === T.current)
|
|
5082
5096
|
return;
|
|
5083
|
-
k.current = S.atIndex, l(S.query), c(!0), w(0), g(!0),
|
|
5097
|
+
k.current = S.atIndex, l(S.query), c(!0), w(0), g(!0), F.current && clearTimeout(F.current);
|
|
5084
5098
|
const B = ++H.current;
|
|
5085
|
-
return
|
|
5099
|
+
return F.current = setTimeout(() => {
|
|
5086
5100
|
o(S.query).then((j) => {
|
|
5087
5101
|
B === H.current && (u(j), w(0), j.length === 0 && S.query.length > 0 && (T.current = S.atIndex, c(!1)));
|
|
5088
5102
|
}).catch(() => {
|
|
@@ -5091,28 +5105,31 @@ function K2({
|
|
|
5091
5105
|
B === H.current && g(!1);
|
|
5092
5106
|
});
|
|
5093
5107
|
}, Y2), () => {
|
|
5094
|
-
|
|
5108
|
+
F.current && clearTimeout(F.current);
|
|
5095
5109
|
};
|
|
5096
5110
|
}, [e, n, o, v]);
|
|
5097
|
-
const
|
|
5111
|
+
const R = _(() => {
|
|
5098
5112
|
c(!1), l(""), u([]), w(0), k.current = -1;
|
|
5099
5113
|
}, []), x = _(
|
|
5100
5114
|
(S) => {
|
|
5101
5115
|
const B = k.current;
|
|
5102
|
-
if (B === -1)
|
|
5116
|
+
if (B === -1)
|
|
5117
|
+
return;
|
|
5103
5118
|
const j = `${S.firstName} ${S.lastName}`.trim(), O = String(S.id), W = e.slice(0, B), e1 = e.slice(n), t1 = `@${j} `, K = W + t1 + e1, Q = W.length + t1.length;
|
|
5104
|
-
r(K), p((s1) => [...s1.filter((c1) => !(c1.id === O && c1.name === j)), { id: O, name: j }]),
|
|
5119
|
+
r(K), p((s1) => [...s1.filter((c1) => !(c1.id === O && c1.name === j)), { id: O, name: j }]), R(), requestAnimationFrame(() => {
|
|
5105
5120
|
const s1 = s.current;
|
|
5106
5121
|
s1 && (s1.focus(), s1.setSelectionRange(Q, Q));
|
|
5107
5122
|
});
|
|
5108
5123
|
},
|
|
5109
|
-
[e, n, r, s,
|
|
5124
|
+
[e, n, r, s, R]
|
|
5110
5125
|
), E = _(
|
|
5111
5126
|
(S) => {
|
|
5112
|
-
if (!a)
|
|
5127
|
+
if (!a)
|
|
5128
|
+
return !1;
|
|
5113
5129
|
if (S.key === "Escape")
|
|
5114
|
-
return S.preventDefault(),
|
|
5115
|
-
if (f.length === 0)
|
|
5130
|
+
return S.preventDefault(), R(), !0;
|
|
5131
|
+
if (f.length === 0)
|
|
5132
|
+
return !1;
|
|
5116
5133
|
switch (S.key) {
|
|
5117
5134
|
case "ArrowDown":
|
|
5118
5135
|
return S.preventDefault(), w((B) => (B + 1) % f.length), !0;
|
|
@@ -5135,10 +5152,11 @@ function K2({
|
|
|
5135
5152
|
return !1;
|
|
5136
5153
|
}
|
|
5137
5154
|
},
|
|
5138
|
-
[a, f, h, d, x,
|
|
5155
|
+
[a, f, h, d, x, R]
|
|
5139
5156
|
), V = _(
|
|
5140
5157
|
(S) => {
|
|
5141
|
-
if (v.length === 0)
|
|
5158
|
+
if (v.length === 0)
|
|
5159
|
+
return S;
|
|
5142
5160
|
let B = S;
|
|
5143
5161
|
const j = [...v].sort((O, W) => W.name.length - O.name.length);
|
|
5144
5162
|
for (const O of j) {
|
|
@@ -5154,7 +5172,8 @@ function K2({
|
|
|
5154
5172
|
p(
|
|
5155
5173
|
(S) => S.filter((B) => {
|
|
5156
5174
|
const j = `@${B.name}`, O = e.indexOf(j);
|
|
5157
|
-
if (O === -1)
|
|
5175
|
+
if (O === -1)
|
|
5176
|
+
return !1;
|
|
5158
5177
|
const W = e[O + j.length];
|
|
5159
5178
|
return W === " " || W === `
|
|
5160
5179
|
` || W === " ";
|
|
@@ -5162,15 +5181,19 @@ function K2({
|
|
|
5162
5181
|
);
|
|
5163
5182
|
}, [e]);
|
|
5164
5183
|
const P = X(() => {
|
|
5165
|
-
if (!a || k.current === -1)
|
|
5184
|
+
if (!a || k.current === -1)
|
|
5185
|
+
return null;
|
|
5166
5186
|
const S = s.current;
|
|
5167
|
-
if (!S)
|
|
5187
|
+
if (!S)
|
|
5188
|
+
return null;
|
|
5168
5189
|
const B = X2(S, k.current), j = S.offsetLeft + B.left, W = (S.offsetParent ? S.offsetParent.offsetHeight : 0) - (S.offsetTop + B.top);
|
|
5169
5190
|
return { left: j, bottom: W };
|
|
5170
5191
|
}, [a, e, n, s]), N = X(() => {
|
|
5171
|
-
if (!a || f.length === 0)
|
|
5192
|
+
if (!a || f.length === 0)
|
|
5193
|
+
return null;
|
|
5172
5194
|
const S = f[h];
|
|
5173
|
-
if (!S)
|
|
5195
|
+
if (!S)
|
|
5196
|
+
return null;
|
|
5174
5197
|
const B = `${S.firstName} ${S.lastName}`.trim();
|
|
5175
5198
|
return d.length === 0 ? B : B.toLowerCase().startsWith(d.toLowerCase()) ? B.slice(d.length) : null;
|
|
5176
5199
|
}, [a, f, h, d]);
|
|
@@ -5186,7 +5209,7 @@ function K2({
|
|
|
5186
5209
|
handleKeyDown: E,
|
|
5187
5210
|
selectPerson: x,
|
|
5188
5211
|
transformMentions: V,
|
|
5189
|
-
close:
|
|
5212
|
+
close: R
|
|
5190
5213
|
};
|
|
5191
5214
|
}
|
|
5192
5215
|
const Q2 = /[\\`*_{}[\]()#+\-.!|~>]/g, J2 = (e) => e.split(/(<entity-ref\b[^>]*>[\s\S]*?<\/entity-ref>)/g).map((r, n) => n % 2 === 1 ? r : r.replace(/&/g, "&").replace(/</g, "<").replace(Q2, "\\$&")).join(""), B4 = ({
|
|
@@ -5208,10 +5231,10 @@ const Q2 = /[\\`*_{}[\]()#+\-.!|~>]/g, J2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5208
5231
|
onProcessFilesRef: v,
|
|
5209
5232
|
disclaimer: p,
|
|
5210
5233
|
footer: k,
|
|
5211
|
-
isWelcomeScreen:
|
|
5234
|
+
isWelcomeScreen: F = !1,
|
|
5212
5235
|
fullscreen: H = !1,
|
|
5213
5236
|
welcomeScreenSuggestions: T,
|
|
5214
|
-
onSuggestionClick:
|
|
5237
|
+
onSuggestionClick: R,
|
|
5215
5238
|
welcomeScreenSuggestionsPlacement: x = "above",
|
|
5216
5239
|
welcomeScreenSuggestionsCollapsedByDefault: E = !1,
|
|
5217
5240
|
welcomeScreenCards: V,
|
|
@@ -5231,9 +5254,9 @@ const Q2 = /[\\`*_{}[\]()#+\-.!|~>]/g, J2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5231
5254
|
item: Z,
|
|
5232
5255
|
group: v1,
|
|
5233
5256
|
prompt: Z.prompt || Z.title
|
|
5234
|
-
}),
|
|
5257
|
+
}), R?.(Z, v1);
|
|
5235
5258
|
},
|
|
5236
|
-
[y,
|
|
5259
|
+
[y, R]
|
|
5237
5260
|
), {
|
|
5238
5261
|
attachedFiles: A,
|
|
5239
5262
|
fileInputRef: U,
|
|
@@ -5347,7 +5370,7 @@ const Q2 = /[\\`*_{}[\]()#+\-.!|~>]/g, J2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5347
5370
|
}, be = p1 ? p1.prompt ?? p1.title : null, ke = ve ? [S.ai.listening] : be ? [be] : s ?? [], Hr = ke.length > 1, Ar = X(() => O2(j, l1.mentions, {
|
|
5348
5371
|
cursorPosition: W,
|
|
5349
5372
|
inlineCompletion: l1.inlineCompletion
|
|
5350
|
-
}), [j, l1.mentions, W, l1.inlineCompletion]), Er = l1.mentions.length > 0 || l1.inlineCompletion !== null, T1 = x === "inside", H1 =
|
|
5373
|
+
}), [j, l1.mentions, W, l1.inlineCompletion]), Er = l1.mentions.length > 0 || l1.inlineCompletion !== null, T1 = x === "inside", H1 = F && !!T && T.length > 0 && !!R ? /* @__PURE__ */ t(
|
|
5351
5374
|
_2,
|
|
5352
5375
|
{
|
|
5353
5376
|
suggestions: T,
|
|
@@ -5391,8 +5414,8 @@ const Q2 = /[\\`*_{}[\]()#+\-.!|~>]/g, J2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5391
5414
|
onStopRecording: g1.stop,
|
|
5392
5415
|
onCancelRecording: Rr
|
|
5393
5416
|
}
|
|
5394
|
-
), Pr =
|
|
5395
|
-
|
|
5417
|
+
), Pr = F && H && !!V && V.length > 0, Ne = H && F, { motionProps: Dr } = Yo(
|
|
5418
|
+
F,
|
|
5396
5419
|
160,
|
|
5397
5420
|
0.5
|
|
5398
5421
|
);
|
|
@@ -5654,7 +5677,7 @@ const Q2 = /[\\`*_{}[\]()#+\-.!|~>]/g, J2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5654
5677
|
) })
|
|
5655
5678
|
] }),
|
|
5656
5679
|
Pr && /* @__PURE__ */ t("div", { className: "w-full max-w-content pt-2", children: /* @__PURE__ */ t(T2, { cards: V }) }),
|
|
5657
|
-
k &&
|
|
5680
|
+
k && F && H && /* @__PURE__ */ t("div", { className: "w-full py-4 mx-auto flex max-w-content justify-center", children: k }),
|
|
5658
5681
|
/* @__PURE__ */ t(L1, { mode: "wait", initial: !1, children: L ? /* @__PURE__ */ i(
|
|
5659
5682
|
Y.div,
|
|
5660
5683
|
{
|
|
@@ -5884,7 +5907,8 @@ function d6({
|
|
|
5884
5907
|
}) {
|
|
5885
5908
|
const o = G(), s = $(null), a = _(
|
|
5886
5909
|
(c) => {
|
|
5887
|
-
if (!s.current)
|
|
5910
|
+
if (!s.current)
|
|
5911
|
+
return;
|
|
5888
5912
|
const d = r?.replace(/\s+/g, "_").toLowerCase() || "table";
|
|
5889
5913
|
c6(s.current, c, d);
|
|
5890
5914
|
},
|
|
@@ -6050,7 +6074,8 @@ function S1({
|
|
|
6050
6074
|
g.current = !1;
|
|
6051
6075
|
}, []);
|
|
6052
6076
|
const h = _(() => {
|
|
6053
|
-
if (c || l)
|
|
6077
|
+
if (c || l)
|
|
6078
|
+
return;
|
|
6054
6079
|
const v = a.current.get(e);
|
|
6055
6080
|
if (v) {
|
|
6056
6081
|
d(v);
|
|
@@ -6273,13 +6298,74 @@ function x6({
|
|
|
6273
6298
|
}
|
|
6274
6299
|
) : /* @__PURE__ */ t("span", { children: r });
|
|
6275
6300
|
}
|
|
6276
|
-
|
|
6301
|
+
const tr = m(
|
|
6302
|
+
({ label: e, ...r }, n) => /* @__PURE__ */ i(
|
|
6303
|
+
"button",
|
|
6304
|
+
{
|
|
6305
|
+
ref: n,
|
|
6306
|
+
type: "button",
|
|
6307
|
+
className: b(
|
|
6308
|
+
"cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground",
|
|
6309
|
+
f1()
|
|
6310
|
+
),
|
|
6311
|
+
...r,
|
|
6312
|
+
children: [
|
|
6313
|
+
"@",
|
|
6314
|
+
e
|
|
6315
|
+
]
|
|
6316
|
+
}
|
|
6317
|
+
)
|
|
6318
|
+
);
|
|
6319
|
+
tr.displayName = "PersonTrigger";
|
|
6320
|
+
function b6({ id: e, label: r }) {
|
|
6321
|
+
const { entityRefs: n } = y1(), o = n?.resolvers?.person, s = G(), a = n?.urls?.person?.(e), c = X(
|
|
6322
|
+
() => (l) => ({
|
|
6323
|
+
avatar: {
|
|
6324
|
+
type: "person",
|
|
6325
|
+
firstName: l.firstName,
|
|
6326
|
+
lastName: l.lastName,
|
|
6327
|
+
src: l.avatarUrl
|
|
6328
|
+
},
|
|
6329
|
+
title: `${l.firstName} ${l.lastName}`,
|
|
6330
|
+
description: l.jobTitle,
|
|
6331
|
+
...a && {
|
|
6332
|
+
secondaryActions: {
|
|
6333
|
+
label: s.t("ai.view"),
|
|
6334
|
+
href: a
|
|
6335
|
+
}
|
|
6336
|
+
}
|
|
6337
|
+
}),
|
|
6338
|
+
[s, a]
|
|
6339
|
+
), d = X(
|
|
6340
|
+
() => ({
|
|
6341
|
+
title: r,
|
|
6342
|
+
...a && {
|
|
6343
|
+
secondaryActions: {
|
|
6344
|
+
label: s.t("ai.view"),
|
|
6345
|
+
href: a
|
|
6346
|
+
}
|
|
6347
|
+
}
|
|
6348
|
+
}),
|
|
6349
|
+
[r, s, a]
|
|
6350
|
+
);
|
|
6351
|
+
return o ? /* @__PURE__ */ t(
|
|
6352
|
+
S1,
|
|
6353
|
+
{
|
|
6354
|
+
id: e,
|
|
6355
|
+
trigger: /* @__PURE__ */ t(tr, { label: r }),
|
|
6356
|
+
resolver: o,
|
|
6357
|
+
mapToCard: c,
|
|
6358
|
+
fallbackCard: d
|
|
6359
|
+
}
|
|
6360
|
+
) : /* @__PURE__ */ t("span", { children: r });
|
|
6361
|
+
}
|
|
6362
|
+
function k6({ rows: e }) {
|
|
6277
6363
|
return e.length === 0 ? null : /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children: e.map((r, n) => /* @__PURE__ */ i("div", { className: "flex flex-col", children: [
|
|
6278
6364
|
r.label && /* @__PURE__ */ t("p", { className: "text-f1-foreground-secondary", children: r.label }),
|
|
6279
6365
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1.5 font-medium text-f1-foreground", children: r.value })
|
|
6280
6366
|
] }, r.label ?? n)) });
|
|
6281
6367
|
}
|
|
6282
|
-
const
|
|
6368
|
+
const rr = m(
|
|
6283
6369
|
({ label: e, ...r }, n) => /* @__PURE__ */ t(
|
|
6284
6370
|
"button",
|
|
6285
6371
|
{
|
|
@@ -6294,8 +6380,8 @@ const tr = m(
|
|
|
6294
6380
|
}
|
|
6295
6381
|
)
|
|
6296
6382
|
);
|
|
6297
|
-
|
|
6298
|
-
function
|
|
6383
|
+
rr.displayName = "RequisitionTrigger";
|
|
6384
|
+
function y6({
|
|
6299
6385
|
id: e,
|
|
6300
6386
|
label: r
|
|
6301
6387
|
}) {
|
|
@@ -6338,7 +6424,7 @@ function k6({
|
|
|
6338
6424
|
title: l.title,
|
|
6339
6425
|
...l.location && { description: l.location },
|
|
6340
6426
|
...C.length > 0 && {
|
|
6341
|
-
children: /* @__PURE__ */ t(
|
|
6427
|
+
children: /* @__PURE__ */ t(k6, { rows: C })
|
|
6342
6428
|
},
|
|
6343
6429
|
...a && {
|
|
6344
6430
|
secondaryActions: {
|
|
@@ -6361,67 +6447,6 @@ function k6({
|
|
|
6361
6447
|
}),
|
|
6362
6448
|
[r, s, a]
|
|
6363
6449
|
);
|
|
6364
|
-
return o ? /* @__PURE__ */ t(
|
|
6365
|
-
S1,
|
|
6366
|
-
{
|
|
6367
|
-
id: e,
|
|
6368
|
-
trigger: /* @__PURE__ */ t(tr, { label: r }),
|
|
6369
|
-
resolver: o,
|
|
6370
|
-
mapToCard: c,
|
|
6371
|
-
fallbackCard: d
|
|
6372
|
-
}
|
|
6373
|
-
) : /* @__PURE__ */ t("span", { children: r });
|
|
6374
|
-
}
|
|
6375
|
-
const rr = m(
|
|
6376
|
-
({ label: e, ...r }, n) => /* @__PURE__ */ i(
|
|
6377
|
-
"button",
|
|
6378
|
-
{
|
|
6379
|
-
ref: n,
|
|
6380
|
-
type: "button",
|
|
6381
|
-
className: b(
|
|
6382
|
-
"cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground",
|
|
6383
|
-
f1()
|
|
6384
|
-
),
|
|
6385
|
-
...r,
|
|
6386
|
-
children: [
|
|
6387
|
-
"@",
|
|
6388
|
-
e
|
|
6389
|
-
]
|
|
6390
|
-
}
|
|
6391
|
-
)
|
|
6392
|
-
);
|
|
6393
|
-
rr.displayName = "PersonTrigger";
|
|
6394
|
-
function y6({ id: e, label: r }) {
|
|
6395
|
-
const { entityRefs: n } = y1(), o = n?.resolvers?.person, s = G(), a = n?.urls?.person?.(e), c = X(
|
|
6396
|
-
() => (l) => ({
|
|
6397
|
-
avatar: {
|
|
6398
|
-
type: "person",
|
|
6399
|
-
firstName: l.firstName,
|
|
6400
|
-
lastName: l.lastName,
|
|
6401
|
-
src: l.avatarUrl
|
|
6402
|
-
},
|
|
6403
|
-
title: `${l.firstName} ${l.lastName}`,
|
|
6404
|
-
description: l.jobTitle,
|
|
6405
|
-
...a && {
|
|
6406
|
-
secondaryActions: {
|
|
6407
|
-
label: s.t("ai.view"),
|
|
6408
|
-
href: a
|
|
6409
|
-
}
|
|
6410
|
-
}
|
|
6411
|
-
}),
|
|
6412
|
-
[s, a]
|
|
6413
|
-
), d = X(
|
|
6414
|
-
() => ({
|
|
6415
|
-
title: r,
|
|
6416
|
-
...a && {
|
|
6417
|
-
secondaryActions: {
|
|
6418
|
-
label: s.t("ai.view"),
|
|
6419
|
-
href: a
|
|
6420
|
-
}
|
|
6421
|
-
}
|
|
6422
|
-
}),
|
|
6423
|
-
[r, s, a]
|
|
6424
|
-
);
|
|
6425
6450
|
return o ? /* @__PURE__ */ t(
|
|
6426
6451
|
S1,
|
|
6427
6452
|
{
|
|
@@ -6486,11 +6511,11 @@ function M6({ id: e, label: r }) {
|
|
|
6486
6511
|
) : /* @__PURE__ */ t("span", { children: r });
|
|
6487
6512
|
}
|
|
6488
6513
|
const R6 = {
|
|
6489
|
-
person:
|
|
6514
|
+
person: b6,
|
|
6490
6515
|
candidate: v6,
|
|
6491
6516
|
expense: L6,
|
|
6492
6517
|
"job-posting": x6,
|
|
6493
|
-
requisition:
|
|
6518
|
+
requisition: y6,
|
|
6494
6519
|
vacancy: M6
|
|
6495
6520
|
};
|
|
6496
6521
|
function F6(e) {
|
|
@@ -6612,7 +6637,8 @@ function S6(e) {
|
|
|
6612
6637
|
let c, d = -1;
|
|
6613
6638
|
for (const l of n) {
|
|
6614
6639
|
const f = l.formName === void 0 || l.formName === e, u = l.customFieldName === void 0 || l.customFieldName === a.customFieldName;
|
|
6615
|
-
if (!f || !u)
|
|
6640
|
+
if (!f || !u)
|
|
6641
|
+
continue;
|
|
6616
6642
|
let C = 0;
|
|
6617
6643
|
l.formName !== void 0 && (C += 2), l.customFieldName !== void 0 && (C += 1), C > d && (d = C, c = l);
|
|
6618
6644
|
}
|
|
@@ -6640,8 +6666,10 @@ function A6(e) {
|
|
|
6640
6666
|
return r > 0 && a.push(`${r}d`), n > 0 && a.push(`${n}h`), o > 0 && a.push(`${o}m`), (s > 0 || a.length === 0) && a.push(`${s}s`), a.join(" ");
|
|
6641
6667
|
}
|
|
6642
6668
|
function Pe(e) {
|
|
6643
|
-
if (e instanceof Date)
|
|
6644
|
-
|
|
6669
|
+
if (e instanceof Date)
|
|
6670
|
+
return !0;
|
|
6671
|
+
if (typeof e != "string")
|
|
6672
|
+
return !1;
|
|
6645
6673
|
const r = new Date(e);
|
|
6646
6674
|
return !Number.isNaN(r.getTime());
|
|
6647
6675
|
}
|
|
@@ -6652,7 +6680,8 @@ function _e(e) {
|
|
|
6652
6680
|
return e.type === "item" ? e.text : "";
|
|
6653
6681
|
}
|
|
6654
6682
|
function sr(e, r) {
|
|
6655
|
-
if (e == null || e === "")
|
|
6683
|
+
if (e == null || e === "")
|
|
6684
|
+
return { type: "item", text: "—" };
|
|
6656
6685
|
if (r === "duration" && typeof e == "number")
|
|
6657
6686
|
return { type: "item", text: A6(e) };
|
|
6658
6687
|
if (r === "richtext" && typeof e == "object" && e !== null && "value" in e) {
|
|
@@ -6700,8 +6729,8 @@ function ar({
|
|
|
6700
6729
|
h.current = k, z(() => {
|
|
6701
6730
|
typeof window > "u" || window.innerWidth < V6 || Ie.has(e) || (Ie.add(e), h.current());
|
|
6702
6731
|
}, [e]);
|
|
6703
|
-
const
|
|
6704
|
-
const E = c[
|
|
6732
|
+
const F = a && c ? Object.entries(a).map(([R, x]) => {
|
|
6733
|
+
const E = c[R], V = g?.(R, E, {
|
|
6705
6734
|
fieldType: x.fieldType,
|
|
6706
6735
|
customFieldName: x.customFieldName
|
|
6707
6736
|
});
|
|
@@ -6713,11 +6742,12 @@ function ar({
|
|
|
6713
6742
|
content: P,
|
|
6714
6743
|
verticalLayout: N.includes(x.fieldType ?? "")
|
|
6715
6744
|
};
|
|
6716
|
-
}).filter((
|
|
6717
|
-
if (!
|
|
6718
|
-
|
|
6745
|
+
}).filter((R) => {
|
|
6746
|
+
if (!R)
|
|
6747
|
+
return !1;
|
|
6748
|
+
const x = Array.isArray(R.content) ? R.content[0] : R.content;
|
|
6719
6749
|
return !(x?.type === "item" && x.text === "—");
|
|
6720
|
-
}) : [], H =
|
|
6750
|
+
}) : [], H = F.slice(0, Be), T = F.length > Be;
|
|
6721
6751
|
return /* @__PURE__ */ t(
|
|
6722
6752
|
or,
|
|
6723
6753
|
{
|
|
@@ -6734,10 +6764,10 @@ function ar({
|
|
|
6734
6764
|
children: H.length > 0 && !p && /* @__PURE__ */ t("div", { className: "-mx-3 flex w-full flex-col overflow-hidden pb-1", children: /* @__PURE__ */ t(
|
|
6735
6765
|
as,
|
|
6736
6766
|
{
|
|
6737
|
-
details: H.map((
|
|
6738
|
-
title:
|
|
6739
|
-
content:
|
|
6740
|
-
...
|
|
6767
|
+
details: H.map((R) => ({
|
|
6768
|
+
title: R.label,
|
|
6769
|
+
content: R.content,
|
|
6770
|
+
...R.verticalLayout && { verticalLayout: !0 }
|
|
6741
6771
|
})),
|
|
6742
6772
|
showSeeMore: T,
|
|
6743
6773
|
onClickSeeMore: k,
|
|
@@ -6750,7 +6780,8 @@ function ar({
|
|
|
6750
6780
|
ar.displayName = "FormCard";
|
|
6751
6781
|
function E6() {
|
|
6752
6782
|
const e = ls(), r = e?.activeForm;
|
|
6753
|
-
if (!r)
|
|
6783
|
+
if (!r)
|
|
6784
|
+
return null;
|
|
6754
6785
|
const n = r.cardTitle, o = r.cardDescription, s = (e?.getFillVersion(r.formName) ?? 0) > 0;
|
|
6755
6786
|
return !n || !o || !s ? null : /* @__PURE__ */ t("div", { className: "mt-2 w-full", children: /* @__PURE__ */ t(
|
|
6756
6787
|
ar,
|
|
@@ -6767,13 +6798,15 @@ function E6() {
|
|
|
6767
6798
|
}
|
|
6768
6799
|
const $6 = 2;
|
|
6769
6800
|
function B6(e, r) {
|
|
6770
|
-
if (!e.intersectsNode(r))
|
|
6801
|
+
if (!e.intersectsNode(r))
|
|
6802
|
+
return null;
|
|
6771
6803
|
const n = document.createRange();
|
|
6772
6804
|
n.selectNodeContents(r);
|
|
6773
6805
|
const o = e.cloneRange();
|
|
6774
6806
|
o.compareBoundaryPoints(Range.START_TO_START, n) < 0 && o.setStart(n.startContainer, n.startOffset), o.compareBoundaryPoints(Range.END_TO_END, n) > 0 && o.setEnd(n.endContainer, n.endOffset);
|
|
6775
6807
|
const s = o.toString().trim();
|
|
6776
|
-
if (s.length < $6)
|
|
6808
|
+
if (s.length < $6)
|
|
6809
|
+
return null;
|
|
6777
6810
|
const a = o.getBoundingClientRect();
|
|
6778
6811
|
return { rect: a.width > 0 || a.height > 0 ? a : r.getBoundingClientRect(), text: s };
|
|
6779
6812
|
}
|
|
@@ -6783,9 +6816,11 @@ function ir({
|
|
|
6783
6816
|
}) {
|
|
6784
6817
|
const [n, o] = I(null), s = _(() => o(null), []);
|
|
6785
6818
|
return z(() => {
|
|
6786
|
-
if (!r || typeof window > "u")
|
|
6819
|
+
if (!r || typeof window > "u")
|
|
6820
|
+
return;
|
|
6787
6821
|
const a = e.current;
|
|
6788
|
-
if (!a)
|
|
6822
|
+
if (!a)
|
|
6823
|
+
return;
|
|
6789
6824
|
const c = () => {
|
|
6790
6825
|
const f = window.getSelection();
|
|
6791
6826
|
if (!f || f.isCollapsed || f.rangeCount === 0) {
|
|
@@ -6815,7 +6850,8 @@ function lr({ anchor: e, onReply: r }) {
|
|
|
6815
6850
|
return;
|
|
6816
6851
|
}
|
|
6817
6852
|
const d = o.current;
|
|
6818
|
-
if (!d)
|
|
6853
|
+
if (!d)
|
|
6854
|
+
return;
|
|
6819
6855
|
const l = d.offsetWidth, f = d.offsetHeight, u = window.innerWidth, C = window.innerHeight;
|
|
6820
6856
|
let g = e.rect.top - f - je;
|
|
6821
6857
|
g < A1 && (g = e.rect.bottom + je), g = Math.min(
|
|
@@ -6827,7 +6863,8 @@ function lr({ anchor: e, onReply: r }) {
|
|
|
6827
6863
|
u - l - A1
|
|
6828
6864
|
);
|
|
6829
6865
|
a({ top: g, left: w });
|
|
6830
|
-
}, [e]), typeof document > "u" || !e)
|
|
6866
|
+
}, [e]), typeof document > "u" || !e)
|
|
6867
|
+
return null;
|
|
6831
6868
|
const c = n.ai.reply;
|
|
6832
6869
|
return Ot(
|
|
6833
6870
|
/* @__PURE__ */ t(
|
|
@@ -7131,7 +7168,8 @@ const O6 = ({
|
|
|
7131
7168
|
);
|
|
7132
7169
|
};
|
|
7133
7170
|
function z6(e) {
|
|
7134
|
-
if (typeof e == "string")
|
|
7171
|
+
if (typeof e == "string")
|
|
7172
|
+
return e;
|
|
7135
7173
|
if (Array.isArray(e)) {
|
|
7136
7174
|
const r = e.filter((n) => n.type === "text").map((n) => n.text).filter((n) => typeof n == "string");
|
|
7137
7175
|
return r[r.length - 1];
|
|
@@ -7225,24 +7263,26 @@ const fr = (e) => /* @__PURE__ */ t(Et, { content: e, format: "markdown" }), W6
|
|
|
7225
7263
|
}
|
|
7226
7264
|
d(0), f(0), C("writing");
|
|
7227
7265
|
}, [w]), z(() => {
|
|
7228
|
-
if (g)
|
|
7229
|
-
|
|
7266
|
+
if (g)
|
|
7267
|
+
return;
|
|
7268
|
+
let F;
|
|
7230
7269
|
if (u === "starting")
|
|
7231
|
-
|
|
7270
|
+
F = setTimeout(() => C("writing"), K6);
|
|
7232
7271
|
else if (u === "writing")
|
|
7233
|
-
l < h.length ?
|
|
7272
|
+
l < h.length ? F = setTimeout(() => f((H) => H + 1), X6) : C("holding");
|
|
7234
7273
|
else if (u === "holding") {
|
|
7235
|
-
if (e.length <= 1)
|
|
7236
|
-
|
|
7237
|
-
|
|
7274
|
+
if (e.length <= 1)
|
|
7275
|
+
return;
|
|
7276
|
+
F = setTimeout(() => C("erasing"), Q6);
|
|
7277
|
+
} else u === "erasing" && (l > 0 ? F = setTimeout(() => f((H) => H - 1), Y6) : F = setTimeout(() => {
|
|
7238
7278
|
d((H) => (H + 1) % e.length), C("starting");
|
|
7239
7279
|
}, J6));
|
|
7240
7280
|
return () => {
|
|
7241
|
-
|
|
7281
|
+
F && clearTimeout(F);
|
|
7242
7282
|
};
|
|
7243
7283
|
}, [u, l, h.length, e.length, g]);
|
|
7244
|
-
const p = !!s, k = p ? (
|
|
7245
|
-
(
|
|
7284
|
+
const p = !!s, k = p ? (F) => {
|
|
7285
|
+
(F.key === "Enter" || F.key === " ") && (F.preventDefault(), s?.());
|
|
7246
7286
|
} : void 0;
|
|
7247
7287
|
return /* @__PURE__ */ t(
|
|
7248
7288
|
"div",
|
|
@@ -7310,9 +7350,11 @@ function tl({
|
|
|
7310
7350
|
);
|
|
7311
7351
|
z(() => {
|
|
7312
7352
|
const w = e.current, v = r.current;
|
|
7313
|
-
if (!w || !v)
|
|
7353
|
+
if (!w || !v)
|
|
7354
|
+
return;
|
|
7314
7355
|
const p = new ResizeObserver(() => {
|
|
7315
|
-
if (C.current)
|
|
7356
|
+
if (C.current)
|
|
7357
|
+
return;
|
|
7316
7358
|
const k = parseFloat(getComputedStyle(v).paddingTop) + parseFloat(getComputedStyle(v).paddingBottom) + 1;
|
|
7317
7359
|
d(w.clientHeight - k);
|
|
7318
7360
|
});
|
|
@@ -7320,9 +7362,10 @@ function tl({
|
|
|
7320
7362
|
}, [e, r]);
|
|
7321
7363
|
const h = _(() => {
|
|
7322
7364
|
const w = e.current;
|
|
7323
|
-
if (!w)
|
|
7324
|
-
|
|
7325
|
-
|
|
7365
|
+
if (!w)
|
|
7366
|
+
return;
|
|
7367
|
+
const { scrollTop: v, scrollHeight: p, clientHeight: k } = w, F = p - v - k;
|
|
7368
|
+
f(F > k);
|
|
7326
7369
|
}, [e]);
|
|
7327
7370
|
return z(() => {
|
|
7328
7371
|
const w = e.current;
|
|
@@ -7332,9 +7375,10 @@ function tl({
|
|
|
7332
7375
|
s > u.current && requestAnimationFrame(() => {
|
|
7333
7376
|
requestAnimationFrame(() => {
|
|
7334
7377
|
const w = e.current, v = o.current;
|
|
7335
|
-
if (!w || !v)
|
|
7336
|
-
|
|
7337
|
-
w.
|
|
7378
|
+
if (!w || !v)
|
|
7379
|
+
return;
|
|
7380
|
+
const p = w.getBoundingClientRect(), k = v.getBoundingClientRect(), F = w.scrollTop + (k.top - p.top);
|
|
7381
|
+
w.scrollTo({ top: F, behavior: "smooth" });
|
|
7338
7382
|
});
|
|
7339
7383
|
}), s === 0 && f(!1), u.current = s;
|
|
7340
7384
|
}, [s, o, e]), { showScrollBtn: l, turnMinHeight: c, scrollToBottom: g };
|
|
@@ -7364,14 +7408,14 @@ const rl = {
|
|
|
7364
7408
|
noShadows: v = !1,
|
|
7365
7409
|
fullscreen: p = !1,
|
|
7366
7410
|
children: k,
|
|
7367
|
-
AssistantMessage:
|
|
7411
|
+
AssistantMessage: F,
|
|
7368
7412
|
UserMessage: H,
|
|
7369
7413
|
onRegenerate: T,
|
|
7370
|
-
onCopy:
|
|
7414
|
+
onCopy: R
|
|
7371
7415
|
}) => {
|
|
7372
7416
|
const { modal: x, handleSubmit: E, handleClose: V } = j6(
|
|
7373
7417
|
h ?? rl
|
|
7374
|
-
), P = G(), N =
|
|
7418
|
+
), P = G(), N = F ?? P6, S = H ?? q6, B = X(() => {
|
|
7375
7419
|
const q = o ?? P.ai.defaultInitialMessage;
|
|
7376
7420
|
return (Array.isArray(q) ? q : [q]).filter((a1) => typeof a1 == "string" && a1.length > 0);
|
|
7377
7421
|
}, [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 } = tl({
|
|
@@ -7397,7 +7441,7 @@ const rl = {
|
|
|
7397
7441
|
AssistantMessage: N,
|
|
7398
7442
|
UserMessage: S,
|
|
7399
7443
|
onRegenerate: T,
|
|
7400
|
-
onCopy:
|
|
7444
|
+
onCopy: R,
|
|
7401
7445
|
rawData: L.rawData || {},
|
|
7402
7446
|
...J
|
|
7403
7447
|
};
|
|
@@ -7417,7 +7461,7 @@ const rl = {
|
|
|
7417
7461
|
AssistantMessage: N,
|
|
7418
7462
|
UserMessage: S,
|
|
7419
7463
|
onRegenerate: T,
|
|
7420
|
-
onCopy:
|
|
7464
|
+
onCopy: R,
|
|
7421
7465
|
rawData: L.rawData || {},
|
|
7422
7466
|
...J
|
|
7423
7467
|
};
|
|
@@ -7465,7 +7509,7 @@ const rl = {
|
|
|
7465
7509
|
{
|
|
7466
7510
|
content: q.feedback.content,
|
|
7467
7511
|
targetMessage: q.feedback.targetMessage,
|
|
7468
|
-
onCopy:
|
|
7512
|
+
onCopy: R
|
|
7469
7513
|
}
|
|
7470
7514
|
),
|
|
7471
7515
|
a1 && /* @__PURE__ */ t(E6, {})
|
|
@@ -7648,7 +7692,8 @@ const al = ({
|
|
|
7648
7692
|
const g = G().ai.clarifyingQuestion.typeYourAnswer, h = $(null), w = As(h, c);
|
|
7649
7693
|
re(() => {
|
|
7650
7694
|
const p = h.current;
|
|
7651
|
-
if (!p)
|
|
7695
|
+
if (!p)
|
|
7696
|
+
return;
|
|
7652
7697
|
p.style.height = "auto";
|
|
7653
7698
|
const k = Math.min(p.scrollHeight, Oe);
|
|
7654
7699
|
p.style.height = `${k}px`, p.style.overflowY = p.scrollHeight > Oe ? "auto" : "hidden";
|
|
@@ -7764,19 +7809,22 @@ const ll = [0.23, 1, 0.32, 1], cl = 0.2, dl = 0.03, ul = 4, fl = ({
|
|
|
7764
7809
|
onToggleCustomActive: v,
|
|
7765
7810
|
onConfirm: p
|
|
7766
7811
|
}) => {
|
|
7767
|
-
const k = C1(),
|
|
7768
|
-
if (e !== "single")
|
|
7812
|
+
const k = C1(), F = (() => {
|
|
7813
|
+
if (e !== "single")
|
|
7814
|
+
return 0;
|
|
7769
7815
|
const V = n.findIndex((P) => o.includes(P.id));
|
|
7770
7816
|
return V >= 0 ? V : 0;
|
|
7771
|
-
})(), [H, T] = I(
|
|
7817
|
+
})(), [H, T] = I(F), R = $([]);
|
|
7772
7818
|
z(() => {
|
|
7773
|
-
C && e === "single" &&
|
|
7819
|
+
C && e === "single" && R.current[H]?.focus();
|
|
7774
7820
|
}, []);
|
|
7775
7821
|
const x = (V) => {
|
|
7776
|
-
if (e !== "single")
|
|
7822
|
+
if (e !== "single")
|
|
7823
|
+
return;
|
|
7777
7824
|
const P = n.length - 1;
|
|
7778
|
-
if (P < 0)
|
|
7779
|
-
|
|
7825
|
+
if (P < 0)
|
|
7826
|
+
return;
|
|
7827
|
+
let N;
|
|
7780
7828
|
switch (V.key) {
|
|
7781
7829
|
case "ArrowDown":
|
|
7782
7830
|
case "ArrowRight":
|
|
@@ -7795,7 +7843,7 @@ const ll = [0.23, 1, 0.32, 1], cl = 0.2, dl = 0.03, ul = 4, fl = ({
|
|
|
7795
7843
|
default:
|
|
7796
7844
|
return;
|
|
7797
7845
|
}
|
|
7798
|
-
V.preventDefault(), T(N),
|
|
7846
|
+
V.preventDefault(), T(N), R.current[N]?.focus();
|
|
7799
7847
|
}, E = (V) => ({
|
|
7800
7848
|
initial: k ? !1 : { opacity: 0, y: ul },
|
|
7801
7849
|
animate: { opacity: 1, y: 0 },
|
|
@@ -7816,7 +7864,7 @@ const ll = [0.23, 1, 0.32, 1], cl = 0.2, dl = 0.03, ul = 4, fl = ({
|
|
|
7816
7864
|
pr,
|
|
7817
7865
|
{
|
|
7818
7866
|
ref: (N) => {
|
|
7819
|
-
|
|
7867
|
+
R.current[P] = N;
|
|
7820
7868
|
},
|
|
7821
7869
|
option: V,
|
|
7822
7870
|
isSelected: o.includes(V.id),
|
|
@@ -7936,15 +7984,15 @@ const ll = [0.23, 1, 0.32, 1], cl = 0.2, dl = 0.03, ul = 4, fl = ({
|
|
|
7936
7984
|
question: v,
|
|
7937
7985
|
options: p,
|
|
7938
7986
|
selectedOptionIds: k,
|
|
7939
|
-
selectionMode:
|
|
7987
|
+
selectionMode: F,
|
|
7940
7988
|
optional: H,
|
|
7941
7989
|
allowCustomAnswer: T,
|
|
7942
|
-
customAnswerText:
|
|
7990
|
+
customAnswerText: R,
|
|
7943
7991
|
isCustomAnswerActive: x
|
|
7944
|
-
} = s, E = $(null), V =
|
|
7992
|
+
} = s, E = $(null), V = F ?? "single", P = c > 1, N = a === 0, S = a === c - 1, B = P ? n.t("ai.clarifyingQuestion.stepOf", {
|
|
7945
7993
|
current: String(a + 1),
|
|
7946
7994
|
total: String(c)
|
|
7947
|
-
}) : void 0, j = k.length > 0, O = (
|
|
7995
|
+
}) : void 0, j = k.length > 0, O = (R ?? "").trim().length > 0, W = j || x && O || H === !0, e1 = r === !0 && S, t1 = () => {
|
|
7948
7996
|
e1 || l();
|
|
7949
7997
|
}, K = () => {
|
|
7950
7998
|
e1 || f();
|
|
@@ -7993,7 +8041,7 @@ const ll = [0.23, 1, 0.32, 1], cl = 0.2, dl = 0.03, ul = 4, fl = ({
|
|
|
7993
8041
|
allowCustomAnswer: T,
|
|
7994
8042
|
hasSelection: j,
|
|
7995
8043
|
hasCustomText: O,
|
|
7996
|
-
customAnswerText:
|
|
8044
|
+
customAnswerText: R,
|
|
7997
8045
|
isCustomAnswerActive: x,
|
|
7998
8046
|
canProceed: W,
|
|
7999
8047
|
customInputRef: E,
|
|
@@ -8022,32 +8070,32 @@ const ll = [0.23, 1, 0.32, 1], cl = 0.2, dl = 0.03, ul = 4, fl = ({
|
|
|
8022
8070
|
] });
|
|
8023
8071
|
};
|
|
8024
8072
|
function Ue(e, r, n, o) {
|
|
8025
|
-
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,
|
|
8073
|
+
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, F = f, H = r - f, T = u(g), R = u(h), x = C(w), E = C(v), V = u(p), P = u(k), N = C(F), S = 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([
|
|
8026
8074
|
// Top strip
|
|
8027
8075
|
T,
|
|
8028
8076
|
x,
|
|
8029
|
-
|
|
8077
|
+
R,
|
|
8030
8078
|
x,
|
|
8031
8079
|
T,
|
|
8032
8080
|
N,
|
|
8033
8081
|
T,
|
|
8034
8082
|
N,
|
|
8035
|
-
|
|
8083
|
+
R,
|
|
8036
8084
|
x,
|
|
8037
|
-
|
|
8085
|
+
R,
|
|
8038
8086
|
N,
|
|
8039
8087
|
// Bottom strip
|
|
8040
8088
|
T,
|
|
8041
8089
|
S,
|
|
8042
|
-
|
|
8090
|
+
R,
|
|
8043
8091
|
S,
|
|
8044
8092
|
T,
|
|
8045
8093
|
E,
|
|
8046
8094
|
T,
|
|
8047
8095
|
E,
|
|
8048
|
-
|
|
8096
|
+
R,
|
|
8049
8097
|
S,
|
|
8050
|
-
|
|
8098
|
+
R,
|
|
8051
8099
|
E,
|
|
8052
8100
|
// Left strip
|
|
8053
8101
|
T,
|
|
@@ -8065,15 +8113,15 @@ function Ue(e, r, n, o) {
|
|
|
8065
8113
|
// Right strip
|
|
8066
8114
|
P,
|
|
8067
8115
|
N,
|
|
8068
|
-
|
|
8116
|
+
R,
|
|
8069
8117
|
N,
|
|
8070
8118
|
P,
|
|
8071
8119
|
S,
|
|
8072
8120
|
P,
|
|
8073
8121
|
S,
|
|
8074
|
-
|
|
8122
|
+
R,
|
|
8075
8123
|
N,
|
|
8076
|
-
|
|
8124
|
+
R,
|
|
8077
8125
|
S
|
|
8078
8126
|
]), p1 = new Float32Array([
|
|
8079
8127
|
// Top strip
|
|
@@ -8133,7 +8181,8 @@ function Ue(e, r, n, o) {
|
|
|
8133
8181
|
}
|
|
8134
8182
|
function ze(e, r, n) {
|
|
8135
8183
|
const o = e.createShader(r);
|
|
8136
|
-
if (!o)
|
|
8184
|
+
if (!o)
|
|
8185
|
+
throw new Error("Failed to create shader");
|
|
8137
8186
|
if (e.shaderSource(o, n), e.compileShader(o), !e.getShaderParameter(o, e.COMPILE_STATUS)) {
|
|
8138
8187
|
const s = e.getShaderInfoLog(o) || "Unknown shader error";
|
|
8139
8188
|
throw e.deleteShader(o), new Error(s);
|
|
@@ -8142,7 +8191,8 @@ function ze(e, r, n) {
|
|
|
8142
8191
|
}
|
|
8143
8192
|
function gl(e, r, n) {
|
|
8144
8193
|
const o = ze(e, e.VERTEX_SHADER, r), s = ze(e, e.FRAGMENT_SHADER, n), a = e.createProgram();
|
|
8145
|
-
if (!a)
|
|
8194
|
+
if (!a)
|
|
8195
|
+
throw new Error("Failed to create program");
|
|
8146
8196
|
if (e.attachShader(a, o), e.attachShader(a, s), e.linkProgram(a), !e.getProgramParameter(a, e.LINK_STATUS)) {
|
|
8147
8197
|
const c = e.getProgramInfoLog(a) || "Unknown link error";
|
|
8148
8198
|
throw e.deleteProgram(a), e.deleteShader(o), e.deleteShader(s), new Error(c);
|
|
@@ -8406,8 +8456,10 @@ class W4 {
|
|
|
8406
8456
|
}, this.canvas = document.createElement("canvas"), this.options.classNames && (this.canvas.className = this.options.classNames), this.options.styles && Object.assign(this.canvas.style, this.options.styles), this.canvas.style.display = "block", this.canvas.style.transformOrigin = "center", this.canvas.style.pointerEvents = "none", this.element = this.canvas, this.setupGL();
|
|
8407
8457
|
}
|
|
8408
8458
|
start() {
|
|
8409
|
-
if (this.disposed)
|
|
8410
|
-
|
|
8459
|
+
if (this.disposed)
|
|
8460
|
+
throw new Error("Mask instance has been disposed.");
|
|
8461
|
+
if (this.running)
|
|
8462
|
+
return;
|
|
8411
8463
|
if (!this.glr) {
|
|
8412
8464
|
console.error("WebGL resources are not initialized.");
|
|
8413
8465
|
return;
|
|
@@ -8422,10 +8474,12 @@ class W4 {
|
|
|
8422
8474
|
this.canvas.height
|
|
8423
8475
|
), this.checkGLError(this.glr.gl, "start: after initial setup");
|
|
8424
8476
|
const r = () => {
|
|
8425
|
-
if (!this.running || !this.glr)
|
|
8477
|
+
if (!this.running || !this.glr)
|
|
8478
|
+
return;
|
|
8426
8479
|
this.rafId = requestAnimationFrame(r);
|
|
8427
8480
|
const n = performance.now();
|
|
8428
|
-
if (n - this.lastTime < 1e3 / 32)
|
|
8481
|
+
if (n - this.lastTime < 1e3 / 32)
|
|
8482
|
+
return;
|
|
8429
8483
|
this.lastTime = n;
|
|
8430
8484
|
const s = (n - this.startTime) * 1e-3;
|
|
8431
8485
|
this.render(s);
|
|
@@ -8433,18 +8487,22 @@ class W4 {
|
|
|
8433
8487
|
this.rafId = requestAnimationFrame(r);
|
|
8434
8488
|
}
|
|
8435
8489
|
pause() {
|
|
8436
|
-
if (this.disposed)
|
|
8490
|
+
if (this.disposed)
|
|
8491
|
+
throw new Error("Mask instance has been disposed.");
|
|
8437
8492
|
this.running = !1, this.rafId !== null && cancelAnimationFrame(this.rafId);
|
|
8438
8493
|
}
|
|
8439
8494
|
dispose() {
|
|
8440
|
-
if (this.disposed)
|
|
8495
|
+
if (this.disposed)
|
|
8496
|
+
return;
|
|
8441
8497
|
this.disposed = !0, this.running = !1, this.rafId !== null && cancelAnimationFrame(this.rafId);
|
|
8442
8498
|
const { gl: r, vao: n, positionBuffer: o, uvBuffer: s, program: a } = this.glr;
|
|
8443
8499
|
n && r.deleteVertexArray(n), o && r.deleteBuffer(o), s && r.deleteBuffer(s), r.deleteProgram(a), this.observer && this.observer.disconnect(), this.canvas.remove();
|
|
8444
8500
|
}
|
|
8445
8501
|
resize(r, n, o) {
|
|
8446
|
-
if (this.disposed)
|
|
8447
|
-
|
|
8502
|
+
if (this.disposed)
|
|
8503
|
+
throw new Error("Mask instance has been disposed.");
|
|
8504
|
+
if (this.options.width = r, this.options.height = n, o && (this.options.ratio = o), !this.running)
|
|
8505
|
+
return;
|
|
8448
8506
|
const { gl: s, program: a, vao: c, positionBuffer: d, uvBuffer: l, uResolution: f } = this.glr, u = o ?? this.options.ratio ?? window.devicePixelRatio ?? 1, C = Math.max(1, Math.floor(r * u)), g = Math.max(1, Math.floor(n * u));
|
|
8449
8507
|
this.canvas.style.width = `${r}px`, this.canvas.style.height = `${n}px`, (this.canvas.width !== C || this.canvas.height !== g) && (this.canvas.width = C, this.canvas.height = g), s.viewport(0, 0, this.canvas.width, this.canvas.height), this.checkGLError(s, "resize: after viewport setup");
|
|
8450
8508
|
const { positions: h, uvs: w } = Ue(
|
|
@@ -8460,8 +8518,8 @@ class W4 {
|
|
|
8460
8518
|
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");
|
|
8461
8519
|
const k = performance.now();
|
|
8462
8520
|
this.lastTime = k;
|
|
8463
|
-
const
|
|
8464
|
-
this.render(
|
|
8521
|
+
const F = (k - this.startTime) * 1e-3;
|
|
8522
|
+
this.render(F);
|
|
8465
8523
|
}
|
|
8466
8524
|
/**
|
|
8467
8525
|
* Automatically resizes the canvas to match the dimensions of the given element.
|
|
@@ -8474,7 +8532,8 @@ class W4 {
|
|
|
8474
8532
|
}), this.observer.observe(r);
|
|
8475
8533
|
}
|
|
8476
8534
|
fadeIn() {
|
|
8477
|
-
if (this.disposed)
|
|
8535
|
+
if (this.disposed)
|
|
8536
|
+
throw new Error("Mask instance has been disposed.");
|
|
8478
8537
|
return new Promise((r, n) => {
|
|
8479
8538
|
const o = this.canvas.animate(
|
|
8480
8539
|
[
|
|
@@ -8483,11 +8542,12 @@ class W4 {
|
|
|
8483
8542
|
],
|
|
8484
8543
|
{ duration: 300, easing: "ease-out", fill: "forwards" }
|
|
8485
8544
|
);
|
|
8486
|
-
o.onfinish = () => r(), o.oncancel = () => n("canceled");
|
|
8545
|
+
o.onfinish = () => r(), o.oncancel = () => n(new Error("canceled"));
|
|
8487
8546
|
});
|
|
8488
8547
|
}
|
|
8489
8548
|
fadeOut() {
|
|
8490
|
-
if (this.disposed)
|
|
8549
|
+
if (this.disposed)
|
|
8550
|
+
throw new Error("Mask instance has been disposed.");
|
|
8491
8551
|
return new Promise((r, n) => {
|
|
8492
8552
|
const o = this.canvas.animate(
|
|
8493
8553
|
[
|
|
@@ -8496,7 +8556,7 @@ class W4 {
|
|
|
8496
8556
|
],
|
|
8497
8557
|
{ duration: 300, easing: "ease-in", fill: "forwards" }
|
|
8498
8558
|
);
|
|
8499
|
-
o.onfinish = () => r(), o.oncancel = () => n("canceled");
|
|
8559
|
+
o.onfinish = () => r(), o.oncancel = () => n(new Error("canceled"));
|
|
8500
8560
|
});
|
|
8501
8561
|
}
|
|
8502
8562
|
checkGLError(r, n) {
|
|
@@ -8549,13 +8609,13 @@ class W4 {
|
|
|
8549
8609
|
r.bindBuffer(r.ARRAY_BUFFER, u), r.bufferData(r.ARRAY_BUFFER, d, r.STATIC_DRAW);
|
|
8550
8610
|
const C = r.getAttribLocation(n, "aUV");
|
|
8551
8611
|
r.enableVertexAttribArray(C), r.vertexAttribPointer(C, 2, r.FLOAT, !1, 0, 0), this.checkGLError(r, "setupGL: after UV buffer setup");
|
|
8552
|
-
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"),
|
|
8553
|
-
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(
|
|
8612
|
+
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"), F = r.getUniformLocation(n, "uGlowExponent"), H = r.getUniformLocation(n, "uGlowFactor");
|
|
8613
|
+
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(F, 2), r.uniform1f(H, 1.8)) : (r.uniform1f(F, 1), r.uniform1f(H, 1));
|
|
8554
8614
|
const T = (this.options.colors || Ll).map(xl);
|
|
8555
|
-
for (let
|
|
8615
|
+
for (let R = 0; R < T.length; R++)
|
|
8556
8616
|
r.uniform3f(
|
|
8557
|
-
r.getUniformLocation(n, `uColors[${
|
|
8558
|
-
...T[
|
|
8617
|
+
r.getUniformLocation(n, `uColors[${R}]`),
|
|
8618
|
+
...T[R]
|
|
8559
8619
|
);
|
|
8560
8620
|
this.checkGLError(r, "setupGL: after uniform setup"), r.bindVertexArray(null), r.bindBuffer(r.ARRAY_BUFFER, null), this.glr = {
|
|
8561
8621
|
gl: r,
|
|
@@ -8572,35 +8632,109 @@ class W4 {
|
|
|
8572
8632
|
};
|
|
8573
8633
|
}
|
|
8574
8634
|
render(r) {
|
|
8575
|
-
if (!this.glr)
|
|
8635
|
+
if (!this.glr)
|
|
8636
|
+
return;
|
|
8576
8637
|
const { gl: n, program: o, vao: s, uTime: a } = this.glr;
|
|
8577
8638
|
n.useProgram(o), n.bindVertexArray(s), n.uniform1f(a, r), n.disable(n.DEPTH_TEST), n.disable(n.CULL_FACE), n.disable(n.BLEND), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.drawArrays(n.TRIANGLES, 0, 24), this.checkGLError(n, "render: after draw call"), n.bindVertexArray(null);
|
|
8578
8639
|
}
|
|
8579
8640
|
}
|
|
8580
|
-
const
|
|
8641
|
+
const bl = 10, kl = 2, yl = 0.5, Ml = 0.2, Rl = 1.5, h1 = {
|
|
8642
|
+
duration: 0.5,
|
|
8643
|
+
ease: "easeOut"
|
|
8644
|
+
}, Ge = {
|
|
8645
|
+
duration: 0.35,
|
|
8646
|
+
ease: "easeOut",
|
|
8647
|
+
repeat: 1 / 0,
|
|
8648
|
+
repeatType: "mirror"
|
|
8649
|
+
};
|
|
8650
|
+
function O1(e) {
|
|
8651
|
+
const [r, n] = I(e), o = fs(e), s = $(null);
|
|
8652
|
+
js(o, "change", (c) => n(c));
|
|
8653
|
+
const a = _(
|
|
8654
|
+
(c, d) => {
|
|
8655
|
+
s.current = hs(o, c, d);
|
|
8656
|
+
},
|
|
8657
|
+
[o]
|
|
8658
|
+
);
|
|
8659
|
+
return { value: r, motionValue: o, controls: s, animate: a };
|
|
8660
|
+
}
|
|
8661
|
+
function Fl(e, r) {
|
|
8662
|
+
const [n, o] = I(bl), {
|
|
8663
|
+
value: s,
|
|
8664
|
+
animate: a,
|
|
8665
|
+
motionValue: c
|
|
8666
|
+
} = O1(Ml), { value: d, animate: l } = O1(kl), { value: f, animate: u } = O1(yl), { value: C, animate: g } = O1(Rl), h = $s(r, {
|
|
8667
|
+
fftSize: 512,
|
|
8668
|
+
smoothingTimeConstant: 0.55
|
|
8669
|
+
});
|
|
8670
|
+
return z(() => {
|
|
8671
|
+
switch (e) {
|
|
8672
|
+
case "idle":
|
|
8673
|
+
case "failed":
|
|
8674
|
+
case "disconnected":
|
|
8675
|
+
o(10), a(0.2, h1), l(1.2, h1), u(0.4, h1), g(1, h1);
|
|
8676
|
+
return;
|
|
8677
|
+
case "listening":
|
|
8678
|
+
case "pre-connect-buffering":
|
|
8679
|
+
o(20), a(0.3, { type: "spring", duration: 1, bounce: 0.35 }), l(1, h1), u(0.7, h1), g([1.5, 2], Ge);
|
|
8680
|
+
return;
|
|
8681
|
+
case "thinking":
|
|
8682
|
+
case "connecting":
|
|
8683
|
+
case "initializing":
|
|
8684
|
+
o(30), a(0.3, h1), l(0.5, h1), u(1, h1), g([0.5, 2.5], Ge);
|
|
8685
|
+
return;
|
|
8686
|
+
case "speaking":
|
|
8687
|
+
o(70), a(0.3, h1), l(0.75, h1), u(1.25, h1), g(1.5, h1);
|
|
8688
|
+
return;
|
|
8689
|
+
}
|
|
8690
|
+
}, [
|
|
8691
|
+
e,
|
|
8692
|
+
a,
|
|
8693
|
+
l,
|
|
8694
|
+
u,
|
|
8695
|
+
g
|
|
8696
|
+
]), z(() => {
|
|
8697
|
+
e === "speaking" && h > 0 && !c.isAnimating() && a(0.2 + 0.2 * h, { duration: 0 });
|
|
8698
|
+
}, [
|
|
8699
|
+
e,
|
|
8700
|
+
h,
|
|
8701
|
+
c,
|
|
8702
|
+
a,
|
|
8703
|
+
l,
|
|
8704
|
+
u,
|
|
8705
|
+
g
|
|
8706
|
+
]), {
|
|
8707
|
+
speed: n,
|
|
8708
|
+
scale: s,
|
|
8709
|
+
amplitude: d,
|
|
8710
|
+
frequency: f,
|
|
8711
|
+
brightness: C
|
|
8712
|
+
};
|
|
8713
|
+
}
|
|
8714
|
+
const We = ["lowp", "mediump", "highp"], Nl = `
|
|
8581
8715
|
void main(void){
|
|
8582
8716
|
vec4 color = vec4(0.0,0.0,0.0,1.0);
|
|
8583
8717
|
mainImage( color, gl_FragCoord.xy );
|
|
8584
8718
|
gl_FragColor = color;
|
|
8585
|
-
}`,
|
|
8719
|
+
}`, Sl = `void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
|
|
8586
8720
|
vec2 uv = fragCoord/iResolution.xy;
|
|
8587
8721
|
vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4));
|
|
8588
8722
|
fragColor = vec4(col,1.0);
|
|
8589
|
-
}`,
|
|
8723
|
+
}`, qe = `attribute vec3 aVertexPosition;
|
|
8590
8724
|
void main(void) {
|
|
8591
8725
|
gl_Position = vec4(aVertexPosition, 1.0);
|
|
8592
|
-
}`,
|
|
8593
|
-
function
|
|
8726
|
+
}`, Xe = "iTime", Ye = "iTimeDelta", Ke = "iDate", Qe = "iFrame", Je = "iMouse", et = "iResolution", Vl = "iChannel", tt = "iChannelResolution", rt = "iDeviceOrientation";
|
|
8727
|
+
function Tl(e, r) {
|
|
8594
8728
|
return e.includes("Matrix") && Array.isArray(r);
|
|
8595
8729
|
}
|
|
8596
|
-
function
|
|
8730
|
+
function Hl(e, r) {
|
|
8597
8731
|
return e.includes("v") && Array.isArray(r) && r.length > Number.parseInt(e.charAt(0));
|
|
8598
8732
|
}
|
|
8599
|
-
function
|
|
8733
|
+
function Al(e, r) {
|
|
8600
8734
|
return !e.includes("v") && Array.isArray(r) && r.length > Number.parseInt(e.charAt(0));
|
|
8601
8735
|
}
|
|
8602
|
-
const
|
|
8603
|
-
if (
|
|
8736
|
+
const El = (e, r, n, o) => {
|
|
8737
|
+
if (Al(n, o))
|
|
8604
8738
|
switch (n) {
|
|
8605
8739
|
case "2f":
|
|
8606
8740
|
return e.uniform2f(r, o[0], o[1]);
|
|
@@ -8641,7 +8775,7 @@ const Nl = (e, r, n, o) => {
|
|
|
8641
8775
|
case "Matrix4fv":
|
|
8642
8776
|
return e.uniformMatrix4fv(r, !1, o);
|
|
8643
8777
|
}
|
|
8644
|
-
},
|
|
8778
|
+
}, $l = (e) => {
|
|
8645
8779
|
switch (e) {
|
|
8646
8780
|
case "1f":
|
|
8647
8781
|
return "float";
|
|
@@ -8688,8 +8822,8 @@ const Nl = (e, r, n, o) => {
|
|
|
8688
8822
|
)
|
|
8689
8823
|
);
|
|
8690
8824
|
}
|
|
8691
|
-
}, Q1 = 9729,
|
|
8692
|
-
class
|
|
8825
|
+
}, Q1 = 9729, nt = 9728, Bl = 9987, ot = 33071, st = 10497;
|
|
8826
|
+
class Il {
|
|
8693
8827
|
gl;
|
|
8694
8828
|
url;
|
|
8695
8829
|
wrapS;
|
|
@@ -8777,7 +8911,7 @@ class Tl {
|
|
|
8777
8911
|
)
|
|
8778
8912
|
);
|
|
8779
8913
|
Object.assign(this, { url: o, wrapS: s, wrapT: a, minFilter: c, magFilter: d, flipY: l });
|
|
8780
|
-
const C = 0, g = n.RGBA, h = 1, w = 1, v = 0, p = n.RGBA, k = n.UNSIGNED_BYTE,
|
|
8914
|
+
const C = 0, g = n.RGBA, h = 1, w = 1, v = 0, p = n.RGBA, k = n.UNSIGNED_BYTE, F = new Uint8Array([255, 255, 255, 0]), H = n.createTexture();
|
|
8781
8915
|
if (n.bindTexture(n.TEXTURE_2D, H), n.texImage2D(
|
|
8782
8916
|
n.TEXTURE_2D,
|
|
8783
8917
|
C,
|
|
@@ -8787,7 +8921,7 @@ class Tl {
|
|
|
8787
8921
|
v,
|
|
8788
8922
|
p,
|
|
8789
8923
|
k,
|
|
8790
|
-
|
|
8924
|
+
F
|
|
8791
8925
|
), u) {
|
|
8792
8926
|
const E = this.setupVideo(o);
|
|
8793
8927
|
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);
|
|
@@ -8802,43 +8936,43 @@ class Tl {
|
|
|
8802
8936
|
}, P.src = o ?? "";
|
|
8803
8937
|
});
|
|
8804
8938
|
}
|
|
8805
|
-
let
|
|
8806
|
-
return (r.wrapS !==
|
|
8939
|
+
let R = await T(), x = (R.width & R.width - 1) === 0 && (R.height & R.height - 1) === 0;
|
|
8940
|
+
return (r.wrapS !== ot || r.wrapT !== ot || r.minFilter !== nt && r.minFilter !== Q1) && !x && (R = this.makePowerOf2(R), x = !0), n.bindTexture(n.TEXTURE_2D, H), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, l), n.texImage2D(
|
|
8807
8941
|
n.TEXTURE_2D,
|
|
8808
8942
|
C,
|
|
8809
8943
|
g,
|
|
8810
8944
|
p,
|
|
8811
8945
|
k,
|
|
8812
|
-
|
|
8813
|
-
), x && r.minFilter !==
|
|
8946
|
+
R
|
|
8947
|
+
), x && r.minFilter !== nt && r.minFilter !== Q1 && n.generateMipmap(n.TEXTURE_2D), n.texParameteri(
|
|
8814
8948
|
n.TEXTURE_2D,
|
|
8815
8949
|
n.TEXTURE_WRAP_S,
|
|
8816
|
-
this.wrapS ||
|
|
8950
|
+
this.wrapS || st
|
|
8817
8951
|
), n.texParameteri(
|
|
8818
8952
|
n.TEXTURE_2D,
|
|
8819
8953
|
n.TEXTURE_WRAP_T,
|
|
8820
|
-
this.wrapT ||
|
|
8954
|
+
this.wrapT || st
|
|
8821
8955
|
), n.texParameteri(
|
|
8822
8956
|
n.TEXTURE_2D,
|
|
8823
8957
|
n.TEXTURE_MIN_FILTER,
|
|
8824
|
-
this.minFilter ||
|
|
8958
|
+
this.minFilter || Bl
|
|
8825
8959
|
), n.texParameteri(
|
|
8826
8960
|
n.TEXTURE_2D,
|
|
8827
8961
|
n.TEXTURE_MAG_FILTER,
|
|
8828
8962
|
this.magFilter || Q1
|
|
8829
|
-
), this._webglTexture = H, this.source =
|
|
8963
|
+
), this._webglTexture = H, this.source = R, this.isVideo = !1, this.isLoaded = !0, this.width = R.width || 0, this.height = R.height || 0, this;
|
|
8830
8964
|
};
|
|
8831
8965
|
}
|
|
8832
|
-
const k1 = (e) => `react-shaders: ${e}`,
|
|
8966
|
+
const k1 = (e) => `react-shaders: ${e}`, at = (e) => {
|
|
8833
8967
|
if ("changedTouches" in e) {
|
|
8834
8968
|
const r = e.changedTouches[0];
|
|
8835
8969
|
return [r?.clientX ?? 0, r?.clientY ?? 0];
|
|
8836
8970
|
}
|
|
8837
8971
|
return [e.clientX, e.clientY];
|
|
8838
|
-
},
|
|
8839
|
-
function
|
|
8972
|
+
}, it = (e, r, n) => e * (1 - n) + r * n, Pl = (e, r, n) => n > 0 ? e.substring(0, n) + r + e.substring(n, e.length) : r + e;
|
|
8973
|
+
function Dl({
|
|
8840
8974
|
fs: e,
|
|
8841
|
-
vs: r =
|
|
8975
|
+
vs: r = qe,
|
|
8842
8976
|
textures: n = [],
|
|
8843
8977
|
uniforms: o,
|
|
8844
8978
|
clearColor: s = [0, 0, 0, 1],
|
|
@@ -8851,22 +8985,24 @@ function Al({
|
|
|
8851
8985
|
onError: C = console.error,
|
|
8852
8986
|
onWarning: g = console.warn
|
|
8853
8987
|
}) {
|
|
8854
|
-
const h = $(null), w = $(null), v = $(null), p = $(null), k = $(void 0),
|
|
8855
|
-
[qe]: { type: "float", isNeeded: !1, value: 0 },
|
|
8988
|
+
const h = $(null), w = $(null), v = $(null), p = $(null), k = $(void 0), F = $(void 0), H = $(!1), T = $(void 0), R = $(0), x = $([0, 0]), E = $([]), V = $(0), P = $(void 0), N = $({
|
|
8856
8989
|
[Xe]: { type: "float", isNeeded: !1, value: 0 },
|
|
8857
|
-
[Ye]: { type: "
|
|
8858
|
-
[
|
|
8859
|
-
[Je]: { type: "
|
|
8860
|
-
[
|
|
8861
|
-
[
|
|
8990
|
+
[Ye]: { type: "float", isNeeded: !1, value: 0 },
|
|
8991
|
+
[Ke]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
|
|
8992
|
+
[Je]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
|
|
8993
|
+
[et]: { type: "vec2", isNeeded: !1, value: [0, 0] },
|
|
8994
|
+
[Qe]: { type: "int", isNeeded: !1, value: 0 },
|
|
8995
|
+
[rt]: {
|
|
8862
8996
|
type: "vec4",
|
|
8863
8997
|
isNeeded: !1,
|
|
8864
8998
|
value: [0, 0, 0, 0]
|
|
8865
8999
|
}
|
|
8866
9000
|
}), S = $(o), B = (L, y) => {
|
|
8867
9001
|
const M = "width" in L ? L.width ?? 0 : 0, D = "height" in L ? L.height ?? 0 : 0, A = N.current.iChannelResolution;
|
|
8868
|
-
if (!A)
|
|
8869
|
-
|
|
9002
|
+
if (!A)
|
|
9003
|
+
return;
|
|
9004
|
+
Array.isArray(A.value) || (A.value = []);
|
|
9005
|
+
const U = A.value;
|
|
8870
9006
|
U[y * 3] = M * f, U[y * 3 + 1] = D * f, U[y * 3 + 2] = 0;
|
|
8871
9007
|
}, j = () => {
|
|
8872
9008
|
h.current && (w.current = h.current.getContext("webgl", d) || h.current.getContext(
|
|
@@ -8903,13 +9039,13 @@ function Al({
|
|
|
8903
9039
|
window.orientation ?? 0
|
|
8904
9040
|
];
|
|
8905
9041
|
}, e1 = (L) => {
|
|
8906
|
-
const [y = 0, M = 0] =
|
|
9042
|
+
const [y = 0, M = 0] = at(L), D = y - (T.current?.left ?? 0) - window.pageXOffset, A = (T.current?.height ?? 0) - M - (T.current?.top ?? 0) - window.pageYOffset;
|
|
8907
9043
|
H.current = !0;
|
|
8908
9044
|
const U = Array.isArray(N.current.iMouse?.value) ? N.current.iMouse.value : void 0;
|
|
8909
9045
|
U && (U[2] = D, U[3] = A), x.current[0] = D, x.current[1] = A;
|
|
8910
9046
|
}, t1 = (L) => {
|
|
8911
9047
|
T.current = h.current?.getBoundingClientRect();
|
|
8912
|
-
const [y = 0, M = 0] =
|
|
9048
|
+
const [y = 0, M = 0] = at(L), D = y - (T.current?.left ?? 0), A = (T.current?.height ?? 0) - M - (T.current?.top ?? 0);
|
|
8913
9049
|
if (l !== 1)
|
|
8914
9050
|
x.current[0] = D, x.current[1] = A;
|
|
8915
9051
|
else {
|
|
@@ -8921,7 +9057,8 @@ function Al({
|
|
|
8921
9057
|
L && (L[2] = 0, L[3] = 0);
|
|
8922
9058
|
}, Q = () => {
|
|
8923
9059
|
const L = w.current;
|
|
8924
|
-
if (!L)
|
|
9060
|
+
if (!L)
|
|
9061
|
+
return;
|
|
8925
9062
|
T.current = h.current?.getBoundingClientRect();
|
|
8926
9063
|
const y = f, M = Math.floor(
|
|
8927
9064
|
(T.current?.width ?? 1) * y
|
|
@@ -8931,15 +9068,17 @@ function Al({
|
|
|
8931
9068
|
if (L.canvas.width = M, L.canvas.height = D, N.current.iResolution?.isNeeded && p.current) {
|
|
8932
9069
|
const A = L.getUniformLocation(
|
|
8933
9070
|
p.current,
|
|
8934
|
-
|
|
9071
|
+
et
|
|
8935
9072
|
);
|
|
8936
9073
|
L.uniform2fv(A, [L.canvas.width, L.canvas.height]);
|
|
8937
9074
|
}
|
|
8938
9075
|
}, s1 = (L, y) => {
|
|
8939
9076
|
const M = w.current;
|
|
8940
|
-
if (!M)
|
|
9077
|
+
if (!M)
|
|
9078
|
+
return null;
|
|
8941
9079
|
const D = M.createShader(L);
|
|
8942
|
-
if (!D)
|
|
9080
|
+
if (!D)
|
|
9081
|
+
return null;
|
|
8943
9082
|
if (M.shaderSource(D, y), M.compileShader(D), !M.getShaderParameter(D, M.COMPILE_STATUS)) {
|
|
8944
9083
|
g?.(k1(`Error compiling the shader:
|
|
8945
9084
|
${y}`));
|
|
@@ -8949,7 +9088,8 @@ ${y}`));
|
|
|
8949
9088
|
return D;
|
|
8950
9089
|
}, p1 = (L, y) => {
|
|
8951
9090
|
const M = w.current;
|
|
8952
|
-
if (!M)
|
|
9091
|
+
if (!M)
|
|
9092
|
+
return;
|
|
8953
9093
|
const D = s1(M.FRAGMENT_SHADER, L), A = s1(M.VERTEX_SHADER, y);
|
|
8954
9094
|
if (p.current = M.createProgram(), !(!p.current || !A || !D)) {
|
|
8955
9095
|
if (M.attachShader(p.current, A), M.attachShader(p.current, D), M.linkProgram(p.current), !M.getProgramParameter(p.current, M.LINK_STATUS)) {
|
|
@@ -8971,14 +9111,16 @@ ${y}`));
|
|
|
8971
9111
|
if (o)
|
|
8972
9112
|
for (const L of Object.keys(o)) {
|
|
8973
9113
|
const y = o[L];
|
|
8974
|
-
if (!y)
|
|
8975
|
-
|
|
8976
|
-
|
|
9114
|
+
if (!y)
|
|
9115
|
+
continue;
|
|
9116
|
+
const { value: M, type: D } = y, A = $l(D);
|
|
9117
|
+
if (!A)
|
|
9118
|
+
continue;
|
|
8977
9119
|
const U = {};
|
|
8978
|
-
if (
|
|
9120
|
+
if (Tl(D, M)) {
|
|
8979
9121
|
const i1 = D.length, m1 = Number.parseInt(D.charAt(i1 - 3)), M1 = Math.floor(M.length / (m1 * m1));
|
|
8980
9122
|
M.length > m1 * m1 && (U.arraySize = `[${M1}]`);
|
|
8981
|
-
} else
|
|
9123
|
+
} else Hl(D, M) && (U.arraySize = `[${Math.floor(M.length / Number.parseInt(D.charAt(0)))}]`);
|
|
8982
9124
|
N.current[L] = {
|
|
8983
9125
|
type: A,
|
|
8984
9126
|
isNeeded: !1,
|
|
@@ -8990,28 +9132,28 @@ ${y}`));
|
|
|
8990
9132
|
const L = w.current;
|
|
8991
9133
|
if (L)
|
|
8992
9134
|
if (n && n.length > 0) {
|
|
8993
|
-
N.current[
|
|
9135
|
+
N.current[tt] = {
|
|
8994
9136
|
type: "vec3",
|
|
8995
9137
|
isNeeded: !1,
|
|
8996
9138
|
arraySize: `[${n.length}]`,
|
|
8997
9139
|
value: []
|
|
8998
9140
|
};
|
|
8999
9141
|
const y = n.map(
|
|
9000
|
-
(M, D) => (N.current[`${
|
|
9142
|
+
(M, D) => (N.current[`${Vl}${D}`] = {
|
|
9001
9143
|
type: "sampler2D",
|
|
9002
9144
|
isNeeded: !1
|
|
9003
|
-
}, B(M, D), E.current[D] = new
|
|
9145
|
+
}, B(M, D), E.current[D] = new Il(L), E.current[D]?.load(M).then((A) => {
|
|
9004
9146
|
B(A, D);
|
|
9005
9147
|
}))
|
|
9006
9148
|
);
|
|
9007
9149
|
Promise.all(y).then(() => {
|
|
9008
9150
|
u && u();
|
|
9009
9151
|
}).catch((M) => {
|
|
9010
|
-
C?.(M), u && u();
|
|
9152
|
+
C?.(M instanceof Error ? M.message : String(M)), u && u();
|
|
9011
9153
|
});
|
|
9012
9154
|
} else u && u();
|
|
9013
9155
|
}, d1 = (L) => {
|
|
9014
|
-
const y =
|
|
9156
|
+
const y = We.includes(a ?? "highp"), M = `precision ${y ? a : We[1]} float;
|
|
9015
9157
|
`;
|
|
9016
9158
|
y || g?.(
|
|
9017
9159
|
k1(
|
|
@@ -9023,18 +9165,20 @@ ${y}`));
|
|
|
9023
9165
|
for (const U of Object.keys(N.current))
|
|
9024
9166
|
if (L.includes(U)) {
|
|
9025
9167
|
const i1 = N.current[U];
|
|
9026
|
-
if (!i1)
|
|
9027
|
-
|
|
9168
|
+
if (!i1)
|
|
9169
|
+
continue;
|
|
9170
|
+
D = Pl(
|
|
9028
9171
|
D,
|
|
9029
9172
|
`uniform ${i1.type} ${U}${i1.arraySize || ""};
|
|
9030
9173
|
`,
|
|
9031
9174
|
D.lastIndexOf(M) + M.length
|
|
9032
9175
|
), i1.isNeeded = !0;
|
|
9033
9176
|
}
|
|
9034
|
-
return L.includes("mainImage") && (D = D.concat(
|
|
9177
|
+
return L.includes("mainImage") && (D = D.concat(Nl)), D;
|
|
9035
9178
|
}, a1 = (L) => {
|
|
9036
9179
|
const y = w.current;
|
|
9037
|
-
if (!y || !p.current)
|
|
9180
|
+
if (!y || !p.current)
|
|
9181
|
+
return;
|
|
9038
9182
|
const M = V.current ? (L - V.current) / 1e3 : 0;
|
|
9039
9183
|
V.current = L;
|
|
9040
9184
|
const D = S.current;
|
|
@@ -9042,13 +9186,15 @@ ${y}`));
|
|
|
9042
9186
|
for (const A of Object.keys(D)) {
|
|
9043
9187
|
const U = D[A];
|
|
9044
9188
|
if (U && N.current[A]?.isNeeded) {
|
|
9045
|
-
if (!p.current)
|
|
9189
|
+
if (!p.current)
|
|
9190
|
+
return;
|
|
9046
9191
|
const i1 = y.getUniformLocation(
|
|
9047
9192
|
p.current,
|
|
9048
9193
|
A
|
|
9049
9194
|
);
|
|
9050
|
-
if (!i1)
|
|
9051
|
-
|
|
9195
|
+
if (!i1)
|
|
9196
|
+
return;
|
|
9197
|
+
El(
|
|
9052
9198
|
y,
|
|
9053
9199
|
i1,
|
|
9054
9200
|
U.type,
|
|
@@ -9059,14 +9205,14 @@ ${y}`));
|
|
|
9059
9205
|
if (N.current.iMouse?.isNeeded) {
|
|
9060
9206
|
const A = y.getUniformLocation(
|
|
9061
9207
|
p.current,
|
|
9062
|
-
|
|
9208
|
+
Je
|
|
9063
9209
|
);
|
|
9064
9210
|
y.uniform4fv(A, N.current.iMouse.value);
|
|
9065
9211
|
}
|
|
9066
9212
|
if (N.current.iChannelResolution?.isNeeded) {
|
|
9067
9213
|
const A = y.getUniformLocation(
|
|
9068
9214
|
p.current,
|
|
9069
|
-
|
|
9215
|
+
tt
|
|
9070
9216
|
);
|
|
9071
9217
|
y.uniform3fv(
|
|
9072
9218
|
A,
|
|
@@ -9076,7 +9222,7 @@ ${y}`));
|
|
|
9076
9222
|
if (N.current.iDeviceOrientation?.isNeeded) {
|
|
9077
9223
|
const A = y.getUniformLocation(
|
|
9078
9224
|
p.current,
|
|
9079
|
-
|
|
9225
|
+
rt
|
|
9080
9226
|
);
|
|
9081
9227
|
y.uniform4fv(
|
|
9082
9228
|
A,
|
|
@@ -9086,39 +9232,42 @@ ${y}`));
|
|
|
9086
9232
|
if (N.current.iTime?.isNeeded) {
|
|
9087
9233
|
const A = y.getUniformLocation(
|
|
9088
9234
|
p.current,
|
|
9089
|
-
|
|
9235
|
+
Xe
|
|
9090
9236
|
);
|
|
9091
|
-
y.uniform1f(A,
|
|
9237
|
+
R.current += M, y.uniform1f(A, R.current);
|
|
9092
9238
|
}
|
|
9093
9239
|
if (N.current.iTimeDelta?.isNeeded) {
|
|
9094
9240
|
const A = y.getUniformLocation(
|
|
9095
9241
|
p.current,
|
|
9096
|
-
|
|
9242
|
+
Ye
|
|
9097
9243
|
);
|
|
9098
9244
|
y.uniform1f(A, M);
|
|
9099
9245
|
}
|
|
9100
9246
|
if (N.current.iDate?.isNeeded) {
|
|
9101
9247
|
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(
|
|
9102
9248
|
p.current,
|
|
9103
|
-
|
|
9249
|
+
Ke
|
|
9104
9250
|
);
|
|
9105
9251
|
y.uniform4fv(V1, [m1, U, i1, M1]);
|
|
9106
9252
|
}
|
|
9107
9253
|
if (N.current.iFrame?.isNeeded) {
|
|
9108
9254
|
const A = y.getUniformLocation(
|
|
9109
9255
|
p.current,
|
|
9110
|
-
|
|
9256
|
+
Qe
|
|
9111
9257
|
), U = N.current.iFrame.value;
|
|
9112
9258
|
y.uniform1i(A, U), N.current.iFrame.value = U + 1;
|
|
9113
9259
|
}
|
|
9114
9260
|
if (E.current.length > 0)
|
|
9115
9261
|
for (let A = 0; A < E.current.length; A++) {
|
|
9116
9262
|
const U = E.current[A];
|
|
9117
|
-
if (!U)
|
|
9263
|
+
if (!U)
|
|
9264
|
+
return;
|
|
9118
9265
|
const { isVideo: i1, _webglTexture: m1, source: M1, flipY: V1, isLoaded: I1 } = U;
|
|
9119
|
-
if (!I1 || !m1 || !M1)
|
|
9266
|
+
if (!I1 || !m1 || !M1)
|
|
9267
|
+
return;
|
|
9120
9268
|
if (N.current[`iChannel${A}`]?.isNeeded) {
|
|
9121
|
-
if (!p.current)
|
|
9269
|
+
if (!p.current)
|
|
9270
|
+
return;
|
|
9122
9271
|
const W1 = y.getUniformLocation(
|
|
9123
9272
|
p.current,
|
|
9124
9273
|
`iChannel${A}`
|
|
@@ -9132,7 +9281,8 @@ ${y}`));
|
|
|
9132
9281
|
}
|
|
9133
9282
|
}, J = (L) => {
|
|
9134
9283
|
const y = w.current;
|
|
9135
|
-
if (!y)
|
|
9284
|
+
if (!y)
|
|
9285
|
+
return;
|
|
9136
9286
|
y.viewport(0, 0, y.drawingBufferWidth, y.drawingBufferHeight), y.clear(y.COLOR_BUFFER_BIT | y.DEPTH_BUFFER_BIT), y.bindBuffer(y.ARRAY_BUFFER, v.current), y.vertexAttribPointer(
|
|
9137
9287
|
k.current ?? 0,
|
|
9138
9288
|
3,
|
|
@@ -9144,9 +9294,9 @@ ${y}`));
|
|
|
9144
9294
|
const M = N.current.iMouse?.value;
|
|
9145
9295
|
if (N.current.iMouse?.isNeeded && l !== 1 && Array.isArray(M)) {
|
|
9146
9296
|
const D = M[0] ?? 0, A = M[1] ?? 0;
|
|
9147
|
-
M[0] =
|
|
9297
|
+
M[0] = it(D, x.current[0] ?? 0, l), M[1] = it(A, x.current[1] ?? 0, l);
|
|
9148
9298
|
}
|
|
9149
|
-
|
|
9299
|
+
F.current = requestAnimationFrame(J);
|
|
9150
9300
|
}, x1 = () => {
|
|
9151
9301
|
const L = { passive: !0 };
|
|
9152
9302
|
N.current.iMouse?.isNeeded && h.current && (h.current.addEventListener("mousemove", t1, L), h.current.addEventListener("mouseout", K, L), h.current.addEventListener("mouseup", K, L), h.current.addEventListener("mousedown", e1, L), h.current.addEventListener("touchmove", t1, L), h.current.addEventListener("touchend", K, L), h.current.addEventListener("touchstart", e1, L)), N.current.iDeviceOrientation?.isNeeded && window.addEventListener(
|
|
@@ -9169,7 +9319,7 @@ ${y}`));
|
|
|
9169
9319
|
function y() {
|
|
9170
9320
|
j();
|
|
9171
9321
|
const M = w.current;
|
|
9172
|
-
M && h.current && (M.clearColor(...s), M.clearDepth(1), M.enable(M.DEPTH_TEST), M.depthFunc(M.LEQUAL), M.viewport(0, 0, h.current.width, h.current.height), h.current.height = h.current.clientHeight, h.current.width = h.current.clientWidth, c1(), q(), p1(d1(e ||
|
|
9322
|
+
M && h.current && (M.clearColor(...s), M.clearDepth(1), M.enable(M.DEPTH_TEST), M.depthFunc(M.LEQUAL), M.viewport(0, 0, h.current.width, h.current.height), h.current.height = h.current.clientHeight, h.current.width = h.current.clientWidth, c1(), q(), p1(d1(e || Sl), r || qe), O(), requestAnimationFrame(J), x1(), Q());
|
|
9173
9323
|
}
|
|
9174
9324
|
return requestAnimationFrame(y), () => {
|
|
9175
9325
|
const M = w.current;
|
|
@@ -9179,7 +9329,7 @@ ${y}`));
|
|
|
9179
9329
|
M.deleteTexture(D._webglTexture);
|
|
9180
9330
|
p.current = null;
|
|
9181
9331
|
}
|
|
9182
|
-
b1(), cancelAnimationFrame(
|
|
9332
|
+
b1(), cancelAnimationFrame(F.current ?? 0);
|
|
9183
9333
|
};
|
|
9184
9334
|
}, []), /* @__PURE__ */ t(
|
|
9185
9335
|
"canvas",
|
|
@@ -9189,7 +9339,7 @@ ${y}`));
|
|
|
9189
9339
|
}
|
|
9190
9340
|
);
|
|
9191
9341
|
}
|
|
9192
|
-
const
|
|
9342
|
+
const _l = `
|
|
9193
9343
|
const float TAU = 6.283185;
|
|
9194
9344
|
|
|
9195
9345
|
// Noise for dithering
|
|
@@ -9356,80 +9506,7 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
|
9356
9506
|
float alpha = mappedBrightness * clamp(uMix, 1.0, 2.0);
|
|
9357
9507
|
fragColor = vec4(color, alpha);
|
|
9358
9508
|
}
|
|
9359
|
-
}`,
|
|
9360
|
-
duration: 0.5,
|
|
9361
|
-
ease: "easeOut"
|
|
9362
|
-
}, it = {
|
|
9363
|
-
duration: 0.35,
|
|
9364
|
-
ease: "easeOut",
|
|
9365
|
-
repeat: 1 / 0,
|
|
9366
|
-
repeatType: "mirror"
|
|
9367
|
-
};
|
|
9368
|
-
function O1(e) {
|
|
9369
|
-
const [r, n] = I(e), o = fs(e), s = $(null);
|
|
9370
|
-
js(o, "change", (c) => n(c));
|
|
9371
|
-
const a = _(
|
|
9372
|
-
(c, d) => {
|
|
9373
|
-
s.current = hs(o, c, d);
|
|
9374
|
-
},
|
|
9375
|
-
[o]
|
|
9376
|
-
);
|
|
9377
|
-
return { value: r, motionValue: o, controls: s, animate: a };
|
|
9378
|
-
}
|
|
9379
|
-
function _l(e, r) {
|
|
9380
|
-
const [n, o] = I($l), {
|
|
9381
|
-
value: s,
|
|
9382
|
-
animate: a,
|
|
9383
|
-
motionValue: c
|
|
9384
|
-
} = O1(Pl), { value: d, animate: l } = O1(Bl), { value: f, animate: u } = O1(Il), { value: C, animate: g } = O1(Dl), h = $s(r, {
|
|
9385
|
-
fftSize: 512,
|
|
9386
|
-
smoothingTimeConstant: 0.55
|
|
9387
|
-
});
|
|
9388
|
-
return z(() => {
|
|
9389
|
-
switch (e) {
|
|
9390
|
-
case "idle":
|
|
9391
|
-
case "failed":
|
|
9392
|
-
case "disconnected":
|
|
9393
|
-
o(10), a(0.2, h1), l(1.2, h1), u(0.4, h1), g(1, h1);
|
|
9394
|
-
return;
|
|
9395
|
-
case "listening":
|
|
9396
|
-
case "pre-connect-buffering":
|
|
9397
|
-
o(20), a(0.3, { type: "spring", duration: 1, bounce: 0.35 }), l(1, h1), u(0.7, h1), g([1.5, 2], it);
|
|
9398
|
-
return;
|
|
9399
|
-
case "thinking":
|
|
9400
|
-
case "connecting":
|
|
9401
|
-
case "initializing":
|
|
9402
|
-
o(30), a(0.3, h1), l(0.5, h1), u(1, h1), g([0.5, 2.5], it);
|
|
9403
|
-
return;
|
|
9404
|
-
case "speaking":
|
|
9405
|
-
o(70), a(0.3, h1), l(0.75, h1), u(1.25, h1), g(1.5, h1);
|
|
9406
|
-
return;
|
|
9407
|
-
}
|
|
9408
|
-
}, [
|
|
9409
|
-
e,
|
|
9410
|
-
a,
|
|
9411
|
-
l,
|
|
9412
|
-
u,
|
|
9413
|
-
g
|
|
9414
|
-
]), z(() => {
|
|
9415
|
-
e === "speaking" && h > 0 && !c.isAnimating() && a(0.2 + 0.2 * h, { duration: 0 });
|
|
9416
|
-
}, [
|
|
9417
|
-
e,
|
|
9418
|
-
h,
|
|
9419
|
-
c,
|
|
9420
|
-
a,
|
|
9421
|
-
l,
|
|
9422
|
-
u,
|
|
9423
|
-
g
|
|
9424
|
-
]), {
|
|
9425
|
-
speed: n,
|
|
9426
|
-
scale: s,
|
|
9427
|
-
amplitude: d,
|
|
9428
|
-
frequency: f,
|
|
9429
|
-
brightness: C
|
|
9430
|
-
};
|
|
9431
|
-
}
|
|
9432
|
-
const jl = B1({
|
|
9509
|
+
}`, jl = B1({
|
|
9433
9510
|
base: "aspect-square",
|
|
9434
9511
|
variants: {
|
|
9435
9512
|
size: {
|
|
@@ -9470,9 +9547,9 @@ function mr({
|
|
|
9470
9547
|
}) {
|
|
9471
9548
|
const h = X(() => Ol(c), [c]);
|
|
9472
9549
|
return /* @__PURE__ */ t("div", { ref: u, className: C, ...g, children: /* @__PURE__ */ t(
|
|
9473
|
-
|
|
9550
|
+
Dl,
|
|
9474
9551
|
{
|
|
9475
|
-
fs:
|
|
9552
|
+
fs: _l,
|
|
9476
9553
|
devicePixelRatio: globalThis.devicePixelRatio ?? 1,
|
|
9477
9554
|
uniforms: {
|
|
9478
9555
|
// Aurora wave speed
|
|
@@ -9526,7 +9603,7 @@ function q4({
|
|
|
9526
9603
|
ref: d,
|
|
9527
9604
|
...l
|
|
9528
9605
|
}) {
|
|
9529
|
-
const { speed: f, scale: u, amplitude: C, frequency: g, brightness: h } =
|
|
9606
|
+
const { speed: f, scale: u, amplitude: C, frequency: g, brightness: h } = Fl(r, s);
|
|
9530
9607
|
return /* @__PURE__ */ t(
|
|
9531
9608
|
mr,
|
|
9532
9609
|
{
|
|
@@ -9834,7 +9911,7 @@ const Yl = ({
|
|
|
9834
9911
|
} = e, [u, C] = I(!1), [g, h] = I(!1), w = u || g, v = C1(), p = w && !!d, k = {
|
|
9835
9912
|
duration: v ? 0 : 0.2,
|
|
9836
9913
|
ease: [0.33, 1, 0.68, 1]
|
|
9837
|
-
},
|
|
9914
|
+
}, F = () => {
|
|
9838
9915
|
c?.();
|
|
9839
9916
|
}, H = (T) => {
|
|
9840
9917
|
T.currentTarget === T.target && (T.key === "Enter" || T.key === " ") && (T.preventDefault(), c?.());
|
|
@@ -9879,7 +9956,7 @@ const Yl = ({
|
|
|
9879
9956
|
c && f1(),
|
|
9880
9957
|
l
|
|
9881
9958
|
),
|
|
9882
|
-
onClick: c ?
|
|
9959
|
+
onClick: c ? F : void 0,
|
|
9883
9960
|
onKeyDown: c ? H : void 0,
|
|
9884
9961
|
onMouseEnter: () => C(!0),
|
|
9885
9962
|
onMouseLeave: () => C(!1),
|
|
@@ -10142,7 +10219,8 @@ function u4({
|
|
|
10142
10219
|
}) {
|
|
10143
10220
|
const o = G(), s = $(null), a = r ?? o.ai.aiTable.title, c = _(
|
|
10144
10221
|
(d) => {
|
|
10145
|
-
if (!s.current)
|
|
10222
|
+
if (!s.current)
|
|
10223
|
+
return;
|
|
10146
10224
|
const l = n ?? (a.replace(/\s+/g, "_").toLowerCase() || "table");
|
|
10147
10225
|
d4(s.current, d, l);
|
|
10148
10226
|
},
|
|
@@ -10250,7 +10328,8 @@ function f4({ credits: e, trigger: r }) {
|
|
|
10250
10328
|
},
|
|
10251
10329
|
[e]
|
|
10252
10330
|
);
|
|
10253
|
-
if (!e)
|
|
10331
|
+
if (!e)
|
|
10332
|
+
return null;
|
|
10254
10333
|
const g = f ? Math.min(100, Math.round(f.used / f.total * 100)) : 0, h = e.companyName;
|
|
10255
10334
|
return /* @__PURE__ */ i(le, { open: o, onOpenChange: C, children: [
|
|
10256
10335
|
/* @__PURE__ */ t(Dt, { asChild: !0, children: r ?? /* @__PURE__ */ t(
|
|
@@ -10379,7 +10458,8 @@ function C4({
|
|
|
10379
10458
|
},
|
|
10380
10459
|
[e]
|
|
10381
10460
|
);
|
|
10382
|
-
if (!e)
|
|
10461
|
+
if (!e)
|
|
10462
|
+
return null;
|
|
10383
10463
|
const h = !!e.companyName, w = u && u.total > 0 ? Math.min(100, Math.round(u.used / u.total * 100)) : 0, v = u ? Math.max(0, u.total - u.used) : 0;
|
|
10384
10464
|
return /* @__PURE__ */ i(le, { open: s, onOpenChange: g, children: [
|
|
10385
10465
|
/* @__PURE__ */ t(Dt, { asChild: !0, children: r ?? /* @__PURE__ */ t(
|
|
@@ -10517,7 +10597,7 @@ const te = ({
|
|
|
10517
10597
|
icon: o ? bt : Lt,
|
|
10518
10598
|
onClick: a
|
|
10519
10599
|
}
|
|
10520
|
-
),
|
|
10600
|
+
), F = /* @__PURE__ */ t(
|
|
10521
10601
|
r1,
|
|
10522
10602
|
{
|
|
10523
10603
|
variant: "ghost",
|
|
@@ -10564,7 +10644,7 @@ const te = ({
|
|
|
10564
10644
|
children: [
|
|
10565
10645
|
H,
|
|
10566
10646
|
k,
|
|
10567
|
-
|
|
10647
|
+
F
|
|
10568
10648
|
]
|
|
10569
10649
|
}
|
|
10570
10650
|
)
|
|
@@ -10610,7 +10690,7 @@ const te = ({
|
|
|
10610
10690
|
),
|
|
10611
10691
|
H,
|
|
10612
10692
|
k,
|
|
10613
|
-
|
|
10693
|
+
F
|
|
10614
10694
|
]
|
|
10615
10695
|
}
|
|
10616
10696
|
)
|
|
@@ -10648,7 +10728,7 @@ const te = ({
|
|
|
10648
10728
|
),
|
|
10649
10729
|
H,
|
|
10650
10730
|
k,
|
|
10651
|
-
|
|
10731
|
+
F
|
|
10652
10732
|
]
|
|
10653
10733
|
}
|
|
10654
10734
|
)
|
|
@@ -10660,8 +10740,10 @@ function p4(e) {
|
|
|
10660
10740
|
}
|
|
10661
10741
|
function m4(e, r, n) {
|
|
10662
10742
|
const o = new Date(e), s = Ee(o, "p", { locale: n });
|
|
10663
|
-
if (_t(o))
|
|
10664
|
-
|
|
10743
|
+
if (_t(o))
|
|
10744
|
+
return `${r.today}, ${s}`;
|
|
10745
|
+
if (jt(o))
|
|
10746
|
+
return `${r.yesterday}, ${s}`;
|
|
10665
10747
|
const a = !Fs(o, /* @__PURE__ */ new Date());
|
|
10666
10748
|
return `${Ee(o, a ? "MMM d yyyy" : "MMM d", {
|
|
10667
10749
|
locale: n
|
|
@@ -10895,7 +10977,8 @@ const e9 = ({
|
|
|
10895
10977
|
u.ai.older
|
|
10896
10978
|
]
|
|
10897
10979
|
), w = X(() => {
|
|
10898
|
-
if (!C.trim())
|
|
10980
|
+
if (!C.trim())
|
|
10981
|
+
return o;
|
|
10899
10982
|
const x = C.toLowerCase();
|
|
10900
10983
|
return o.filter((E) => E.title.toLowerCase().includes(x));
|
|
10901
10984
|
}, [o, C]), v = X(
|
|
@@ -10907,7 +10990,7 @@ const e9 = ({
|
|
|
10907
10990
|
), k = X(
|
|
10908
10991
|
() => g4(p),
|
|
10909
10992
|
[p]
|
|
10910
|
-
),
|
|
10993
|
+
), F = _(
|
|
10911
10994
|
(x, E) => {
|
|
10912
10995
|
r(x, E), e();
|
|
10913
10996
|
},
|
|
@@ -10919,7 +11002,7 @@ const e9 = ({
|
|
|
10919
11002
|
f(x);
|
|
10920
11003
|
},
|
|
10921
11004
|
[f]
|
|
10922
|
-
),
|
|
11005
|
+
), R = v.length > 0 || k.length > 0;
|
|
10923
11006
|
return Ot(
|
|
10924
11007
|
/* @__PURE__ */ i(F1, { children: [
|
|
10925
11008
|
/* @__PURE__ */ t(
|
|
@@ -10984,14 +11067,14 @@ const e9 = ({
|
|
|
10984
11067
|
),
|
|
10985
11068
|
s && /* @__PURE__ */ t(L4, {}),
|
|
10986
11069
|
!s && a && /* @__PURE__ */ t("p", { className: "py-8 text-center text-base text-f1-foreground-tertiary", children: a }),
|
|
10987
|
-
!s && !a && !
|
|
11070
|
+
!s && !a && !R && /* @__PURE__ */ t("p", { className: "py-8 text-center text-base text-f1-foreground-tertiary", children: u.ai.noPreviousChats }),
|
|
10988
11071
|
!s && !a && v.length > 0 && /* @__PURE__ */ t(
|
|
10989
11072
|
lt,
|
|
10990
11073
|
{
|
|
10991
11074
|
label: u.ai.pinnedChats,
|
|
10992
11075
|
threads: v,
|
|
10993
11076
|
pinnedIds: c,
|
|
10994
|
-
onSelect:
|
|
11077
|
+
onSelect: F,
|
|
10995
11078
|
onPin: d,
|
|
10996
11079
|
onUnpin: l,
|
|
10997
11080
|
onDelete: T
|
|
@@ -11003,7 +11086,7 @@ const e9 = ({
|
|
|
11003
11086
|
label: h[x.key],
|
|
11004
11087
|
threads: x.threads,
|
|
11005
11088
|
pinnedIds: c,
|
|
11006
|
-
onSelect:
|
|
11089
|
+
onSelect: F,
|
|
11007
11090
|
onPin: d,
|
|
11008
11091
|
onUnpin: l,
|
|
11009
11092
|
onDelete: T
|
|
@@ -11051,31 +11134,34 @@ function t9({
|
|
|
11051
11134
|
}, [e, v]);
|
|
11052
11135
|
const p = _((x, E) => {
|
|
11053
11136
|
g((V) => {
|
|
11054
|
-
if (E === V.has(x))
|
|
11137
|
+
if (E === V.has(x))
|
|
11138
|
+
return V;
|
|
11055
11139
|
const P = new Set(V);
|
|
11056
11140
|
return E ? P.add(x) : P.delete(x), ut(P), P;
|
|
11057
11141
|
});
|
|
11058
11142
|
}, []), k = _((x, E) => {
|
|
11059
11143
|
w((V) => {
|
|
11060
|
-
if (E === V.has(x))
|
|
11144
|
+
if (E === V.has(x))
|
|
11145
|
+
return V;
|
|
11061
11146
|
const P = new Set(V);
|
|
11062
11147
|
return E ? P.add(x) : P.delete(x), P;
|
|
11063
11148
|
});
|
|
11064
|
-
}, []),
|
|
11149
|
+
}, []), F = _(
|
|
11065
11150
|
(x, E) => {
|
|
11066
11151
|
const V = E ? o : s;
|
|
11067
11152
|
p(x, E), V && (k(x, !0), V(x).catch(() => p(x, !E)).finally(() => k(x, !1)));
|
|
11068
11153
|
},
|
|
11069
11154
|
[o, s, p, k]
|
|
11070
|
-
), H = _((x) =>
|
|
11071
|
-
(x) =>
|
|
11072
|
-
[
|
|
11073
|
-
),
|
|
11155
|
+
), H = _((x) => F(x, !0), [F]), T = _(
|
|
11156
|
+
(x) => F(x, !1),
|
|
11157
|
+
[F]
|
|
11158
|
+
), R = _(
|
|
11074
11159
|
async (x) => {
|
|
11075
11160
|
k(x, !0);
|
|
11076
11161
|
try {
|
|
11077
11162
|
await n(x), c((E) => E.filter((V) => V.id !== x)), g((E) => {
|
|
11078
|
-
if (!E.has(x))
|
|
11163
|
+
if (!E.has(x))
|
|
11164
|
+
return E;
|
|
11079
11165
|
const V = new Set(E);
|
|
11080
11166
|
return V.delete(x), ut(V), V;
|
|
11081
11167
|
});
|
|
@@ -11096,7 +11182,7 @@ function t9({
|
|
|
11096
11182
|
pendingIds: h,
|
|
11097
11183
|
pinThread: H,
|
|
11098
11184
|
unpinThread: T,
|
|
11099
|
-
deleteThread:
|
|
11185
|
+
deleteThread: R
|
|
11100
11186
|
};
|
|
11101
11187
|
}
|
|
11102
11188
|
const b4 = Y.create(Tt), k4 = ({
|
|
@@ -11156,7 +11242,8 @@ const b4 = Y.create(Tt), k4 = ({
|
|
|
11156
11242
|
}) {
|
|
11157
11243
|
const { t: a } = G(), c = C1(), d = n ?? a("ai.applyingChanges");
|
|
11158
11244
|
return z(() => {
|
|
11159
|
-
if (!r)
|
|
11245
|
+
if (!r)
|
|
11246
|
+
return;
|
|
11160
11247
|
const l = document.activeElement;
|
|
11161
11248
|
l && l.getAttribute("name") !== "one-ai-input" && l.blur();
|
|
11162
11249
|
}, [r]), /* @__PURE__ */ i("div", { className: b("relative flex flex-1 flex-col", o), children: [
|