@factorialco/f0-react 6.30.0 → 6.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ChatPdfThumbnail-BqPV5N9R.js → ChatPdfThumbnail-BkQGjlBS.js} +1 -1
- package/dist/{CoachmarkProvider-tv1wGkTz.js → CoachmarkProvider-BTRLsfAt.js} +1 -1
- package/dist/{DocumentToolbar-T48vsH6k.js → DocumentToolbar-LoUjsLjI.js} +2 -2
- package/dist/{DocxViewer-Ba4s-GLL.js → DocxViewer-B4lFTH6a.js} +2 -2
- package/dist/{F0AiProcessingOverlay-CBidGqkB.js → F0AiProcessingOverlay-aXf8JKg4.js} +799 -785
- package/dist/{F0CanvasPanel-Bbzfq-Se.js → F0CanvasPanel-BqgELcDY.js} +2 -2
- package/dist/{F0VideoPlayer-CIrwyt6i.js → F0VideoPlayer-DQ_UC26u.js} +1 -1
- package/dist/{LocationMap-Bg11OoaV.js → LocationMap-Dnc7-QF8.js} +1 -1
- package/dist/{SheetViewer-B6O-ITCW.js → SheetViewer-CpkDaocD.js} +2 -2
- package/dist/{TextViewer-Di_dkofC.js → TextViewer-Dr0RM4jX.js} +2 -2
- package/dist/ai.d.ts +14 -0
- package/dist/ai.js +2 -2
- package/dist/component-status.js +1 -1
- package/dist/{experimental-Dokue7Zf.js → experimental-Cf3ltnmp.js} +6 -6
- package/dist/experimental.js +3 -3
- package/dist/f0.d.ts +14 -0
- package/dist/f0.js +10 -10
- package/dist/index-492gT6xK.js +4 -0
- package/dist/{index-CZ90KKcw.js → index-CrVeLOHB.js} +3 -3
- package/dist/{pdfWorker-b81okSFL.js → pdfWorker-COXEzNc6.js} +2 -2
- package/package.json +1 -1
- package/dist/index-C8udz5Ds.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t, Fragment as R1 } from "react/jsx-runtime";
|
|
2
|
-
import { useInsertionEffect as Fr, forwardRef as p, useRef as
|
|
3
|
-
import { X as Vr, Y as Tr, Z as Hr, _ as rt, $ as Ar, a0 as Er, a1 as $r, a2 as Br, a3 as Ir, a4 as Pr, a5 as ot, a6 as Dr, a7 as jr, a8 as te, a9 as _r, aa as Zr, ab as Or, ac as Ur, ad as zr, ae as Gr, af as Wr, ag as qr, y as nt, ah as Xr, ai as Yr, o as re, aj as st, ak as z1, n as at, al as Kr, am as Qr, an as Jr, ao as eo, ap as to, aq as F1, ar as ro, as as it, at as oo, au as no, l as y1, av as so, aw as ao, ax as lt, ay as io, az as lo, aA as co, aB as uo, aC as fo, aD as ho, aE as ct, aF as Co, aG as po, aH as mo, aI as go, aJ as wo, aK as vo, aL as Lo, aM as xo, aN as bo, aO as ko, aP as yo, aQ as Mo, E as Ro, aR as Fo, aS as No, aT as So, aU as Vo, aV as To, aW as Ho, aX as Ao, aY as Eo, aZ as $o, a_ as Bo, a$ as Io, b0 as Po, b1 as Do, b2 as jo, b3 as _o, b4 as Zo, b5 as Oo, b6 as Uo, U as dt, b7 as zo, b8 as Go, b9 as Wo, ba as ut, R as ft, bb as qo, i as Xo, bc as Yo, bd as Ko, be as Qo, bf as Jo, bg as en, bh as ht, bi as tn, bj as rn, bk as on, bl as nn, bm as sn, bn as an, j as ln, bo as Ct, bp as pt, bq as cn, br as mt, bs as dn, bt as oe, q as un, bu as ne, bv as fn, bw as hn, bx as se, O as Cn, Q as pn, by as gt, bz as mn, bA as gn, bB as wn, bC as vn, bD as Ln, bE as xn, bF as bn, bG as kn, bH as yn, bI as Mn, bJ as wt, bK as Rn, bL as Fn, bM as Nn, bN as Sn, u as z, bO as
|
|
2
|
+
import { useInsertionEffect as Fr, forwardRef as p, useRef as $, useEffect as W, useLayoutEffect as ee, useState as I, useId as O1, useCallback as _, useMemo as Y, createContext as U1, useContext as B1, createElement as Nr, memo as Sr } from "react";
|
|
3
|
+
import { X as Vr, Y as Tr, Z as Hr, _ as rt, $ as Ar, a0 as Er, a1 as $r, a2 as Br, a3 as Ir, a4 as Pr, a5 as ot, a6 as Dr, a7 as jr, a8 as te, a9 as _r, aa as Zr, ab as Or, ac as Ur, ad as zr, ae as Gr, af as Wr, ag as qr, y as nt, ah as Xr, ai as Yr, o as re, aj as st, ak as z1, n as at, al as Kr, am as Qr, an as Jr, ao as eo, ap as to, aq as F1, ar as ro, as as it, at as oo, au as no, l as y1, av as so, aw as ao, ax as lt, ay as io, az as lo, aA as co, aB as uo, aC as fo, aD as ho, aE as ct, aF as Co, aG as po, aH as mo, aI as go, aJ as wo, aK as vo, aL as Lo, aM as xo, aN as bo, aO as ko, aP as yo, aQ as Mo, E as Ro, aR as Fo, aS as No, aT as So, aU as Vo, aV as To, aW as Ho, aX as Ao, aY as Eo, aZ as $o, a_ as Bo, a$ as Io, b0 as Po, b1 as Do, b2 as jo, b3 as _o, b4 as Zo, b5 as Oo, b6 as Uo, U as dt, b7 as zo, b8 as Go, b9 as Wo, ba as ut, R as ft, bb as qo, i as Xo, bc as Yo, bd as Ko, be as Qo, bf as Jo, bg as en, bh as ht, bi as tn, bj as rn, bk as on, bl as nn, bm as sn, bn as an, j as ln, bo as Ct, bp as pt, bq as cn, br as mt, bs as dn, bt as oe, q as un, bu as ne, bv as fn, bw as hn, bx as se, O as Cn, Q as pn, by as gt, bz as mn, bA as gn, bB as wn, bC as vn, bD as Ln, bE as xn, bF as bn, bG as kn, bH as yn, bI as Mn, bJ as wt, bK as Rn, bL as Fn, bM as Nn, bN as Sn, u as z, bO as o1, bP as Vn, S as u1, bQ as vt, V as n1, bR as Tn, m as m1, bS as Hn, bT as s1, bU as C1, bV as M1, bW as K, bX as Lt, t as ae, bY as An, x as ie, b as x1, bZ as En, b_ as $n, b$ as Bn, d as xt, c0 as In, c1 as Pn, c2 as le, c3 as Dn, c4 as jn, c5 as _n, c6 as ke, c7 as Zn, c8 as bt, c9 as kt, ca as On, cb as Un, cc as zn, cd as Gn, ce as Wn, cf as yt, cg as qn, ch as Xn, ci as Yn, cj as $1, ck as Mt, cl as Rt, cm as Ft, c as K1, cn as ye, co as Nt, cp as Kn, cq as Qn, cr as I1, cs as Jn, ct as es, cu as ts, cv as ce, cw as rs, cx as os, cy as ns, cz as ss, cA as as, cB as is, w as ls, s as cs, cC as X1, v as St, cD as ds, cE as us, cF as Me, cG as Vt, cH as Tt, cI as fs, cJ as hs, cK as Cs, cL as ps, cM as ms, cN as gs } from "./F0CanvasPanel-BqgELcDY.js";
|
|
4
4
|
import { f as f1, d as x, u as ws } from "./tooltip-DTpaXpXW.js";
|
|
5
5
|
import { createPortal as Ht } from "react-dom";
|
|
6
6
|
import { defaultTranslations as vs } from "./i18n-provider-defaults.js";
|
|
@@ -4050,7 +4050,7 @@ const S0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4050
4050
|
}) => {
|
|
4051
4051
|
const a = z();
|
|
4052
4052
|
return n !== "transcribing" && e ? /* @__PURE__ */ t(
|
|
4053
|
-
|
|
4053
|
+
o1,
|
|
4054
4054
|
{
|
|
4055
4055
|
type: "submit",
|
|
4056
4056
|
variant: "neutral",
|
|
@@ -4060,7 +4060,7 @@ const S0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4060
4060
|
hideLabel: !0
|
|
4061
4061
|
}
|
|
4062
4062
|
) : /* @__PURE__ */ t(
|
|
4063
|
-
|
|
4063
|
+
o1,
|
|
4064
4064
|
{
|
|
4065
4065
|
type: "submit",
|
|
4066
4066
|
size: s,
|
|
@@ -4090,7 +4090,7 @@ const S0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4090
4090
|
onCancelRecording: v,
|
|
4091
4091
|
showSubmit: w = !0
|
|
4092
4092
|
}) => {
|
|
4093
|
-
const
|
|
4093
|
+
const M = z();
|
|
4094
4094
|
return C === "recording" ? /* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-3 p-3", children: [
|
|
4095
4095
|
/* @__PURE__ */ t(
|
|
4096
4096
|
Vn,
|
|
@@ -4101,9 +4101,9 @@ const S0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4101
4101
|
),
|
|
4102
4102
|
/* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
4103
4103
|
/* @__PURE__ */ t(
|
|
4104
|
-
|
|
4104
|
+
o1,
|
|
4105
4105
|
{
|
|
4106
|
-
label:
|
|
4106
|
+
label: M.ai.cancelRecording,
|
|
4107
4107
|
hideLabel: !0,
|
|
4108
4108
|
type: "button",
|
|
4109
4109
|
icon: F1,
|
|
@@ -4113,9 +4113,9 @@ const S0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4113
4113
|
}
|
|
4114
4114
|
),
|
|
4115
4115
|
/* @__PURE__ */ t(
|
|
4116
|
-
|
|
4116
|
+
o1,
|
|
4117
4117
|
{
|
|
4118
|
-
label:
|
|
4118
|
+
label: M.ai.stopRecording,
|
|
4119
4119
|
hideLabel: !0,
|
|
4120
4120
|
type: "button",
|
|
4121
4121
|
icon: nt,
|
|
@@ -4129,17 +4129,17 @@ const S0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4129
4129
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
4130
4130
|
e && /* @__PURE__ */ i(R1, { children: [
|
|
4131
4131
|
/* @__PURE__ */ t(
|
|
4132
|
-
|
|
4132
|
+
o1,
|
|
4133
4133
|
{
|
|
4134
|
-
label:
|
|
4134
|
+
label: M.ai.attachFile,
|
|
4135
4135
|
hideLabel: !0,
|
|
4136
4136
|
type: "button",
|
|
4137
4137
|
icon: ht,
|
|
4138
4138
|
variant: "outline",
|
|
4139
4139
|
size: "md",
|
|
4140
4140
|
disabled: o || C === "transcribing",
|
|
4141
|
-
onClick: (
|
|
4142
|
-
|
|
4141
|
+
onClick: (N) => {
|
|
4142
|
+
N.preventDefault(), a.current?.click();
|
|
4143
4143
|
}
|
|
4144
4144
|
}
|
|
4145
4145
|
),
|
|
@@ -4162,16 +4162,16 @@ const S0 = (e, r) => /* @__PURE__ */ i(
|
|
|
4162
4162
|
"div",
|
|
4163
4163
|
{
|
|
4164
4164
|
className: "min-w-0 cursor-default",
|
|
4165
|
-
onClick: (
|
|
4165
|
+
onClick: (N) => N.stopPropagation(),
|
|
4166
4166
|
children: r
|
|
4167
4167
|
}
|
|
4168
4168
|
)
|
|
4169
4169
|
] }),
|
|
4170
4170
|
/* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
4171
4171
|
d && /* @__PURE__ */ t(
|
|
4172
|
-
|
|
4172
|
+
o1,
|
|
4173
4173
|
{
|
|
4174
|
-
label:
|
|
4174
|
+
label: M.ai.recordAudio,
|
|
4175
4175
|
hideLabel: !0,
|
|
4176
4176
|
type: "button",
|
|
4177
4177
|
icon: ut,
|
|
@@ -4237,7 +4237,7 @@ function f2({
|
|
|
4237
4237
|
removeLabel: o
|
|
4238
4238
|
}) {
|
|
4239
4239
|
const n = /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 rounded-lg border border-f1-border-critical bg-f1-background-critical/10 px-2.5 py-1.5", children: [
|
|
4240
|
-
/* @__PURE__ */ t(
|
|
4240
|
+
/* @__PURE__ */ t(n1, { icon: rt, size: "md", color: "critical" }),
|
|
4241
4241
|
/* @__PURE__ */ t("span", { className: "max-w-40 truncate text-sm font-medium text-f1-foreground-critical", children: e.file.name }),
|
|
4242
4242
|
/* @__PURE__ */ t(
|
|
4243
4243
|
"button",
|
|
@@ -4248,7 +4248,7 @@ function f2({
|
|
|
4248
4248
|
"rounded-full text-f1-foreground-critical hover:text-f1-foreground-critical/80"
|
|
4249
4249
|
),
|
|
4250
4250
|
onClick: () => r(e.id),
|
|
4251
|
-
children: /* @__PURE__ */ t(
|
|
4251
|
+
children: /* @__PURE__ */ t(n1, { icon: F1, size: "md", "aria-hidden": "true" })
|
|
4252
4252
|
}
|
|
4253
4253
|
)
|
|
4254
4254
|
] });
|
|
@@ -4286,7 +4286,7 @@ const h2 = {
|
|
|
4286
4286
|
),
|
|
4287
4287
|
/* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
4288
4288
|
e.onGetCredits && /* @__PURE__ */ t(
|
|
4289
|
-
|
|
4289
|
+
m1,
|
|
4290
4290
|
{
|
|
4291
4291
|
label: o.ai.creditWarning.getCredits ?? "",
|
|
4292
4292
|
size: "sm",
|
|
@@ -4296,7 +4296,7 @@ const h2 = {
|
|
|
4296
4296
|
}
|
|
4297
4297
|
),
|
|
4298
4298
|
e.onDismiss && /* @__PURE__ */ t(
|
|
4299
|
-
|
|
4299
|
+
m1,
|
|
4300
4300
|
{
|
|
4301
4301
|
label: o.ai.creditWarning.dismiss ?? "",
|
|
4302
4302
|
size: "sm",
|
|
@@ -4321,7 +4321,7 @@ function p2({
|
|
|
4321
4321
|
position: s,
|
|
4322
4322
|
onSelect: a
|
|
4323
4323
|
}) {
|
|
4324
|
-
const c =
|
|
4324
|
+
const c = $(null), u = $(null);
|
|
4325
4325
|
W(() => {
|
|
4326
4326
|
u.current?.scrollIntoView({ block: "nearest" });
|
|
4327
4327
|
}, [n]), ee(() => {
|
|
@@ -4392,7 +4392,7 @@ function p2({
|
|
|
4392
4392
|
size: "xsmall"
|
|
4393
4393
|
}
|
|
4394
4394
|
),
|
|
4395
|
-
/* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 flex-col", children: /* @__PURE__ */ t(
|
|
4395
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 flex-col", children: /* @__PURE__ */ t(s1, { className: "text-base font-medium text-f1-foreground", children: h }) })
|
|
4396
4396
|
]
|
|
4397
4397
|
},
|
|
4398
4398
|
String(d.id)
|
|
@@ -4414,9 +4414,9 @@ const m2 = ({
|
|
|
4414
4414
|
"rounded-[10px] bg-f1-background-hover pl-2 py-1.5 pr-1.5"
|
|
4415
4415
|
),
|
|
4416
4416
|
children: [
|
|
4417
|
-
/* @__PURE__ */ t("div", { className: "flex items-center py-0.5", children: /* @__PURE__ */ t(
|
|
4417
|
+
/* @__PURE__ */ t("div", { className: "flex items-center py-0.5", children: /* @__PURE__ */ t(n1, { icon: oe, size: "md", color: "default" }) }),
|
|
4418
4418
|
/* @__PURE__ */ t(
|
|
4419
|
-
|
|
4419
|
+
s1,
|
|
4420
4420
|
{
|
|
4421
4421
|
className: "h-full flex-1 py-0.5 text-[12px] font-medium text-f1-foreground-secondary",
|
|
4422
4422
|
lines: 1,
|
|
@@ -4424,7 +4424,7 @@ const m2 = ({
|
|
|
4424
4424
|
}
|
|
4425
4425
|
),
|
|
4426
4426
|
/* @__PURE__ */ t(
|
|
4427
|
-
|
|
4427
|
+
o1,
|
|
4428
4428
|
{
|
|
4429
4429
|
variant: "ghost",
|
|
4430
4430
|
label: o.ai.removeQuote,
|
|
@@ -4443,7 +4443,7 @@ const m2 = ({
|
|
|
4443
4443
|
inputValue: o,
|
|
4444
4444
|
inProgress: n
|
|
4445
4445
|
}) => {
|
|
4446
|
-
const s =
|
|
4446
|
+
const s = C1(), [a, c] = I(""), [u, l] = I(0), [f, d] = I(!1), C = $(null), m = $(null), h = $(null), g = e[u] ?? r;
|
|
4447
4447
|
return W(() => {
|
|
4448
4448
|
const v = () => {
|
|
4449
4449
|
m.current && (clearInterval(m.current), m.current = null), h.current && (clearInterval(h.current), h.current = null), C.current && (clearTimeout(C.current), C.current = null);
|
|
@@ -4461,7 +4461,7 @@ const m2 = ({
|
|
|
4461
4461
|
};
|
|
4462
4462
|
d(!0), c("");
|
|
4463
4463
|
let w = 0;
|
|
4464
|
-
const
|
|
4464
|
+
const M = 50, N = 30, A = 2e3, S = 1e3;
|
|
4465
4465
|
return m.current = setInterval(() => {
|
|
4466
4466
|
w < g.length ? (c(g.slice(0, w + 1)), w++) : (m.current && (clearInterval(m.current), m.current = null), C.current = setTimeout(() => {
|
|
4467
4467
|
h.current = setInterval(() => {
|
|
@@ -4469,9 +4469,9 @@ const m2 = ({
|
|
|
4469
4469
|
const F = (u + 1) % Math.max(e.length, 1);
|
|
4470
4470
|
l(F);
|
|
4471
4471
|
}, S));
|
|
4472
|
-
},
|
|
4473
|
-
},
|
|
4474
|
-
},
|
|
4472
|
+
}, N);
|
|
4473
|
+
}, A));
|
|
4474
|
+
}, M), () => {
|
|
4475
4475
|
v();
|
|
4476
4476
|
};
|
|
4477
4477
|
}, [
|
|
@@ -4648,7 +4648,7 @@ const F2 = ({
|
|
|
4648
4648
|
side: n = "top",
|
|
4649
4649
|
reserveTwoRows: s = !0
|
|
4650
4650
|
}) => {
|
|
4651
|
-
const [a, c] = I(null), u =
|
|
4651
|
+
const [a, c] = I(null), u = $(null), l = $(null), f = $(!1), d = O1(), C = O1(), m = a !== null ? e[a] : null;
|
|
4652
4652
|
return e.length === 0 ? null : /* @__PURE__ */ i(
|
|
4653
4653
|
ae,
|
|
4654
4654
|
{
|
|
@@ -4670,7 +4670,7 @@ const F2 = ({
|
|
|
4670
4670
|
ref: u,
|
|
4671
4671
|
className: "flex w-full flex-wrap items-center gap-2",
|
|
4672
4672
|
children: e.map((h, g) => /* @__PURE__ */ t(
|
|
4673
|
-
|
|
4673
|
+
o1,
|
|
4674
4674
|
{
|
|
4675
4675
|
variant: "outline",
|
|
4676
4676
|
label: h.label,
|
|
@@ -4719,7 +4719,7 @@ const F2 = ({
|
|
|
4719
4719
|
id: C,
|
|
4720
4720
|
className: "flex items-center gap-1.5 p-2 pb-1 text-sm font-medium text-f1-foreground-secondary",
|
|
4721
4721
|
children: [
|
|
4722
|
-
/* @__PURE__ */ t(
|
|
4722
|
+
/* @__PURE__ */ t(n1, { "aria-hidden": !0, icon: m.icon, size: "sm" }),
|
|
4723
4723
|
/* @__PURE__ */ t("span", { children: m.label })
|
|
4724
4724
|
]
|
|
4725
4725
|
}
|
|
@@ -4743,11 +4743,11 @@ const F2 = ({
|
|
|
4743
4743
|
);
|
|
4744
4744
|
};
|
|
4745
4745
|
function N2({ item: e, onSelect: r, onHover: o }) {
|
|
4746
|
-
const n =
|
|
4746
|
+
const n = $(null), s = $(null), a = $(null), c = C1(), u = _(() => {
|
|
4747
4747
|
a.current != null && (clearTimeout(a.current), a.current = null);
|
|
4748
4748
|
const C = s.current, m = n.current;
|
|
4749
4749
|
C && (C.style.transition = "none", C.style.transform = "translateX(0)", C.style.overflow = ""), m && (m.style.removeProperty("mask-image"), m.style.removeProperty("-webkit-mask-image"));
|
|
4750
|
-
}, []), l =
|
|
4750
|
+
}, []), l = _(() => {
|
|
4751
4751
|
c || (a.current = window.setTimeout(() => {
|
|
4752
4752
|
const C = s.current, m = n.current;
|
|
4753
4753
|
if (!C || !m) return;
|
|
@@ -4758,9 +4758,9 @@ function N2({ item: e, onSelect: r, onHover: o }) {
|
|
|
4758
4758
|
const w = `linear-gradient(90deg, transparent 0, #000 ${M2}px)`;
|
|
4759
4759
|
m.style.setProperty("mask-image", w), m.style.setProperty("-webkit-mask-image", w), C.style.transition = `transform ${v}ms linear`, C.style.transform = `translateX(-${g}px)`;
|
|
4760
4760
|
}, k2));
|
|
4761
|
-
}, [c]), f =
|
|
4761
|
+
}, [c]), f = _(() => {
|
|
4762
4762
|
o?.(e), l();
|
|
4763
|
-
}, [e, o, l]), d =
|
|
4763
|
+
}, [e, o, l]), d = _(() => {
|
|
4764
4764
|
o?.(null), u();
|
|
4765
4765
|
}, [o, u]);
|
|
4766
4766
|
return W(
|
|
@@ -4788,7 +4788,7 @@ function N2({ item: e, onSelect: r, onHover: o }) {
|
|
|
4788
4788
|
{
|
|
4789
4789
|
"aria-hidden": !0,
|
|
4790
4790
|
className: "flex flex-shrink-0 items-center text-f1-foreground-secondary opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
4791
|
-
children: /* @__PURE__ */ t(
|
|
4791
|
+
children: /* @__PURE__ */ t(n1, { icon: te, size: "sm" })
|
|
4792
4792
|
}
|
|
4793
4793
|
)
|
|
4794
4794
|
]
|
|
@@ -4840,17 +4840,17 @@ function T2(e, r) {
|
|
|
4840
4840
|
}
|
|
4841
4841
|
const H2 = 4e3;
|
|
4842
4842
|
function A2(e) {
|
|
4843
|
-
const [r, o] = I([]), [n, s] = I(null), a =
|
|
4843
|
+
const [r, o] = I([]), [n, s] = I(null), a = $(
|
|
4844
4844
|
null
|
|
4845
|
-
), c =
|
|
4845
|
+
), c = $(null), u = z(), l = e?.onUploadFiles, f = e?.allowedMimeTypes, d = e?.maxFiles, C = Y(() => {
|
|
4846
4846
|
if (f)
|
|
4847
4847
|
return Array.isArray(f) ? f.join(",") : f;
|
|
4848
|
-
}, [f]), m = d !== void 0 && r.length >= d, h =
|
|
4848
|
+
}, [f]), m = d !== void 0 && r.length >= d, h = $(0);
|
|
4849
4849
|
W(() => {
|
|
4850
4850
|
h.current = r.length;
|
|
4851
4851
|
}, [r]);
|
|
4852
|
-
const g =
|
|
4853
|
-
a.current && clearTimeout(a.current), s(
|
|
4852
|
+
const g = _((A) => {
|
|
4853
|
+
a.current && clearTimeout(a.current), s(A), a.current = setTimeout(() => {
|
|
4854
4854
|
s(null), a.current = null;
|
|
4855
4855
|
}, H2);
|
|
4856
4856
|
}, []);
|
|
@@ -4860,10 +4860,10 @@ function A2(e) {
|
|
|
4860
4860
|
},
|
|
4861
4861
|
[]
|
|
4862
4862
|
);
|
|
4863
|
-
const v =
|
|
4864
|
-
async (
|
|
4865
|
-
if (
|
|
4866
|
-
const S = T2(
|
|
4863
|
+
const v = _(
|
|
4864
|
+
async (A) => {
|
|
4865
|
+
if (A.length === 0 || !l) return;
|
|
4866
|
+
const S = T2(A, f);
|
|
4867
4867
|
if (S.length === 0) return;
|
|
4868
4868
|
if (d !== void 0 && h.current + S.length > d) {
|
|
4869
4869
|
g(
|
|
@@ -4874,40 +4874,40 @@ function A2(e) {
|
|
|
4874
4874
|
);
|
|
4875
4875
|
return;
|
|
4876
4876
|
}
|
|
4877
|
-
const F = S.map((
|
|
4877
|
+
const F = S.map((H) => ({
|
|
4878
4878
|
id: crypto.randomUUID(),
|
|
4879
|
-
file:
|
|
4879
|
+
file: H,
|
|
4880
4880
|
status: "uploading"
|
|
4881
|
-
})), L = F.map((
|
|
4882
|
-
o((
|
|
4883
|
-
const V = (
|
|
4884
|
-
(
|
|
4885
|
-
(
|
|
4881
|
+
})), L = F.map((H) => H.id);
|
|
4882
|
+
o((H) => [...H, ...F]);
|
|
4883
|
+
const V = (H) => o(
|
|
4884
|
+
(P) => P.map(
|
|
4885
|
+
(R) => L.includes(R.id) ? { ...R, status: "error", errorMessage: H } : R
|
|
4886
4886
|
)
|
|
4887
4887
|
);
|
|
4888
4888
|
try {
|
|
4889
|
-
const
|
|
4890
|
-
if (!Array.isArray(
|
|
4889
|
+
const H = await l(S);
|
|
4890
|
+
if (!Array.isArray(H) || H.length !== S.length) {
|
|
4891
4891
|
V(u.ai.fileUploadError);
|
|
4892
4892
|
return;
|
|
4893
4893
|
}
|
|
4894
4894
|
o(
|
|
4895
|
-
(
|
|
4896
|
-
const T = F.findIndex((
|
|
4897
|
-
return T === -1 ?
|
|
4898
|
-
...
|
|
4895
|
+
(P) => P.map((R) => {
|
|
4896
|
+
const T = F.findIndex((B) => B.id === R.id);
|
|
4897
|
+
return T === -1 ? R : H[T] ? {
|
|
4898
|
+
...R,
|
|
4899
4899
|
status: "uploaded",
|
|
4900
|
-
uploadedFile:
|
|
4900
|
+
uploadedFile: H[T]
|
|
4901
4901
|
} : {
|
|
4902
|
-
...
|
|
4902
|
+
...R,
|
|
4903
4903
|
status: "error",
|
|
4904
4904
|
errorMessage: u.ai.fileUploadError
|
|
4905
4905
|
};
|
|
4906
4906
|
})
|
|
4907
4907
|
);
|
|
4908
|
-
} catch (
|
|
4909
|
-
const
|
|
4910
|
-
V(
|
|
4908
|
+
} catch (H) {
|
|
4909
|
+
const P = H instanceof Error && H.message ? H.message : u.ai.fileUploadError;
|
|
4910
|
+
V(P);
|
|
4911
4911
|
}
|
|
4912
4912
|
},
|
|
4913
4913
|
[
|
|
@@ -4918,14 +4918,14 @@ function A2(e) {
|
|
|
4918
4918
|
u.ai.fileUploadError,
|
|
4919
4919
|
g
|
|
4920
4920
|
]
|
|
4921
|
-
), w =
|
|
4922
|
-
async (
|
|
4923
|
-
await v(Array.from(
|
|
4921
|
+
), w = _(
|
|
4922
|
+
async (A) => {
|
|
4923
|
+
await v(Array.from(A.target.files ?? [])), A.target.value = "";
|
|
4924
4924
|
},
|
|
4925
4925
|
[v]
|
|
4926
|
-
),
|
|
4927
|
-
o((S) => S.filter((F) => F.id !==
|
|
4928
|
-
}, []),
|
|
4926
|
+
), M = _((A) => {
|
|
4927
|
+
o((S) => S.filter((F) => F.id !== A));
|
|
4928
|
+
}, []), N = _(() => {
|
|
4929
4929
|
o([]);
|
|
4930
4930
|
}, []);
|
|
4931
4931
|
return {
|
|
@@ -4937,8 +4937,8 @@ function A2(e) {
|
|
|
4937
4937
|
maxFiles: d,
|
|
4938
4938
|
processFiles: v,
|
|
4939
4939
|
handleFileSelect: w,
|
|
4940
|
-
handleRemoveFile:
|
|
4941
|
-
clearFiles:
|
|
4940
|
+
handleRemoveFile: M,
|
|
4941
|
+
clearFiles: N,
|
|
4942
4942
|
transientError: n,
|
|
4943
4943
|
showTransientError: g
|
|
4944
4944
|
};
|
|
@@ -5021,7 +5021,7 @@ function P2({
|
|
|
5021
5021
|
searchPersons: n,
|
|
5022
5022
|
textareaRef: s
|
|
5023
5023
|
}) {
|
|
5024
|
-
const [a, c] = I(!1), [u, l] = I(""), [f, d] = I([]), [C, m] = I(!1), [h, g] = I(0), [v, w] = I([]),
|
|
5024
|
+
const [a, c] = I(!1), [u, l] = I(""), [f, d] = I([]), [C, m] = I(!1), [h, g] = I(0), [v, w] = I([]), M = $(-1), N = $(null), A = $(0), S = $(-1);
|
|
5025
5025
|
W(() => {
|
|
5026
5026
|
if (!n) {
|
|
5027
5027
|
c(!1);
|
|
@@ -5029,39 +5029,39 @@ function P2({
|
|
|
5029
5029
|
}
|
|
5030
5030
|
const T = E2(e, o, v);
|
|
5031
5031
|
if (!T) {
|
|
5032
|
-
c(!1), l(""), d([]), g(0),
|
|
5032
|
+
c(!1), l(""), d([]), g(0), M.current = -1, S.current = -1;
|
|
5033
5033
|
return;
|
|
5034
5034
|
}
|
|
5035
5035
|
if (T.atIndex === S.current)
|
|
5036
5036
|
return;
|
|
5037
|
-
|
|
5038
|
-
const
|
|
5039
|
-
return
|
|
5037
|
+
M.current = T.atIndex, l(T.query), c(!0), g(0), m(!0), N.current && clearTimeout(N.current);
|
|
5038
|
+
const B = ++A.current;
|
|
5039
|
+
return N.current = setTimeout(() => {
|
|
5040
5040
|
n(T.query).then((U) => {
|
|
5041
|
-
|
|
5041
|
+
B === A.current && (d(U), g(0), U.length === 0 && T.query.length > 0 && (S.current = T.atIndex, c(!1)));
|
|
5042
5042
|
}).catch(() => {
|
|
5043
|
-
|
|
5043
|
+
B === A.current && d([]);
|
|
5044
5044
|
}).finally(() => {
|
|
5045
|
-
|
|
5045
|
+
B === A.current && m(!1);
|
|
5046
5046
|
});
|
|
5047
5047
|
}, I2), () => {
|
|
5048
|
-
|
|
5048
|
+
N.current && clearTimeout(N.current);
|
|
5049
5049
|
};
|
|
5050
5050
|
}, [e, o, n, v]);
|
|
5051
|
-
const F =
|
|
5052
|
-
c(!1), l(""), d([]), g(0),
|
|
5053
|
-
}, []), L =
|
|
5051
|
+
const F = _(() => {
|
|
5052
|
+
c(!1), l(""), d([]), g(0), M.current = -1;
|
|
5053
|
+
}, []), L = _(
|
|
5054
5054
|
(T) => {
|
|
5055
|
-
const
|
|
5056
|
-
if (
|
|
5057
|
-
const U = `${T.firstName} ${T.lastName}`.trim(), Z = String(T.id), G = e.slice(0,
|
|
5058
|
-
r(X), w((r1) => [...r1.filter((
|
|
5055
|
+
const B = M.current;
|
|
5056
|
+
if (B === -1) return;
|
|
5057
|
+
const U = `${T.firstName} ${T.lastName}`.trim(), Z = String(T.id), G = e.slice(0, B), J = e.slice(o), t1 = `@${U} `, X = G + t1 + J, Q = G.length + t1.length;
|
|
5058
|
+
r(X), w((r1) => [...r1.filter((i1) => !(i1.id === Z && i1.name === U)), { id: Z, name: U }]), F(), requestAnimationFrame(() => {
|
|
5059
5059
|
const r1 = s.current;
|
|
5060
5060
|
r1 && (r1.focus(), r1.setSelectionRange(Q, Q));
|
|
5061
5061
|
});
|
|
5062
5062
|
},
|
|
5063
5063
|
[e, o, r, s, F]
|
|
5064
|
-
), V =
|
|
5064
|
+
), V = _(
|
|
5065
5065
|
(T) => {
|
|
5066
5066
|
if (!a) return !1;
|
|
5067
5067
|
if (T.key === "Escape")
|
|
@@ -5069,17 +5069,17 @@ function P2({
|
|
|
5069
5069
|
if (f.length === 0) return !1;
|
|
5070
5070
|
switch (T.key) {
|
|
5071
5071
|
case "ArrowDown":
|
|
5072
|
-
return T.preventDefault(), g((
|
|
5072
|
+
return T.preventDefault(), g((B) => (B + 1) % f.length), !0;
|
|
5073
5073
|
case "ArrowUp":
|
|
5074
5074
|
return T.preventDefault(), g(
|
|
5075
|
-
(
|
|
5075
|
+
(B) => (B + f.length - 1) % f.length
|
|
5076
5076
|
), !0;
|
|
5077
5077
|
case "Tab": {
|
|
5078
|
-
const
|
|
5079
|
-
if (
|
|
5080
|
-
const U = `${
|
|
5078
|
+
const B = f[h];
|
|
5079
|
+
if (B) {
|
|
5080
|
+
const U = `${B.firstName} ${B.lastName}`.trim();
|
|
5081
5081
|
if (u.length === 0 || U.toLowerCase().startsWith(u.toLowerCase()))
|
|
5082
|
-
return T.preventDefault(), L(
|
|
5082
|
+
return T.preventDefault(), L(B), !0;
|
|
5083
5083
|
}
|
|
5084
5084
|
return !1;
|
|
5085
5085
|
}
|
|
@@ -5090,24 +5090,24 @@ function P2({
|
|
|
5090
5090
|
}
|
|
5091
5091
|
},
|
|
5092
5092
|
[a, f, h, u, L, F]
|
|
5093
|
-
),
|
|
5093
|
+
), H = _(
|
|
5094
5094
|
(T) => {
|
|
5095
5095
|
if (v.length === 0) return T;
|
|
5096
|
-
let
|
|
5096
|
+
let B = T;
|
|
5097
5097
|
const U = [...v].sort((Z, G) => G.name.length - Z.name.length);
|
|
5098
5098
|
for (const Z of U) {
|
|
5099
|
-
const G = `@${Z.name}`,
|
|
5100
|
-
for (;
|
|
5101
|
-
|
|
5099
|
+
const G = `@${Z.name}`, J = `<entity-ref type="person" id="${Re(Z.id)}">${Re(Z.name)}</entity-ref>`;
|
|
5100
|
+
for (; B.includes(G); )
|
|
5101
|
+
B = B.replace(G, J);
|
|
5102
5102
|
}
|
|
5103
|
-
return
|
|
5103
|
+
return B;
|
|
5104
5104
|
},
|
|
5105
5105
|
[v]
|
|
5106
5106
|
);
|
|
5107
5107
|
W(() => {
|
|
5108
5108
|
w(
|
|
5109
|
-
(T) => T.filter((
|
|
5110
|
-
const U = `@${
|
|
5109
|
+
(T) => T.filter((B) => {
|
|
5110
|
+
const U = `@${B.name}`, Z = e.indexOf(U);
|
|
5111
5111
|
if (Z === -1) return !1;
|
|
5112
5112
|
const G = e[Z + U.length];
|
|
5113
5113
|
return G === " " || G === `
|
|
@@ -5115,18 +5115,18 @@ function P2({
|
|
|
5115
5115
|
})
|
|
5116
5116
|
);
|
|
5117
5117
|
}, [e]);
|
|
5118
|
-
const
|
|
5119
|
-
if (!a ||
|
|
5118
|
+
const P = Y(() => {
|
|
5119
|
+
if (!a || M.current === -1) return null;
|
|
5120
5120
|
const T = s.current;
|
|
5121
5121
|
if (!T) return null;
|
|
5122
|
-
const
|
|
5122
|
+
const B = B2(T, M.current), U = T.offsetLeft + B.left, G = (T.offsetParent ? T.offsetParent.offsetHeight : 0) - (T.offsetTop + B.top);
|
|
5123
5123
|
return { left: U, bottom: G };
|
|
5124
|
-
}, [a, e, o, s]),
|
|
5124
|
+
}, [a, e, o, s]), R = Y(() => {
|
|
5125
5125
|
if (!a || f.length === 0) return null;
|
|
5126
5126
|
const T = f[h];
|
|
5127
5127
|
if (!T) return null;
|
|
5128
|
-
const
|
|
5129
|
-
return u.length === 0 ?
|
|
5128
|
+
const B = `${T.firstName} ${T.lastName}`.trim();
|
|
5129
|
+
return u.length === 0 ? B : B.toLowerCase().startsWith(u.toLowerCase()) ? B.slice(u.length) : null;
|
|
5130
5130
|
}, [a, f, h, u]);
|
|
5131
5131
|
return {
|
|
5132
5132
|
isOpen: a,
|
|
@@ -5135,11 +5135,11 @@ function P2({
|
|
|
5135
5135
|
isLoading: C,
|
|
5136
5136
|
selectedIndex: h,
|
|
5137
5137
|
mentions: v,
|
|
5138
|
-
popoverPosition:
|
|
5139
|
-
inlineCompletion:
|
|
5138
|
+
popoverPosition: P,
|
|
5139
|
+
inlineCompletion: R,
|
|
5140
5140
|
handleKeyDown: V,
|
|
5141
5141
|
selectPerson: L,
|
|
5142
|
-
transformMentions:
|
|
5142
|
+
transformMentions: H,
|
|
5143
5143
|
close: F
|
|
5144
5144
|
};
|
|
5145
5145
|
}
|
|
@@ -5161,65 +5161,65 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5161
5161
|
searchPersons: g,
|
|
5162
5162
|
onProcessFilesRef: v,
|
|
5163
5163
|
disclaimer: w,
|
|
5164
|
-
footer:
|
|
5165
|
-
isWelcomeScreen:
|
|
5166
|
-
fullscreen:
|
|
5164
|
+
footer: M,
|
|
5165
|
+
isWelcomeScreen: N = !1,
|
|
5166
|
+
fullscreen: A = !1,
|
|
5167
5167
|
welcomeScreenSuggestions: S,
|
|
5168
5168
|
onSuggestionClick: F,
|
|
5169
5169
|
welcomeScreenSuggestionsPlacement: L = "above",
|
|
5170
5170
|
welcomeScreenCards: V,
|
|
5171
|
-
padding:
|
|
5172
|
-
ref:
|
|
5171
|
+
padding: H = "default",
|
|
5172
|
+
ref: P
|
|
5173
5173
|
}) => {
|
|
5174
|
-
const
|
|
5175
|
-
(q,
|
|
5176
|
-
|
|
5174
|
+
const R = z(), T = C1(), [B, U] = I(""), [Z, G] = I(0), [J, t1] = I(!1), [X, Q] = I(!1), [r1, g1] = I(null), i1 = $(null), j = $(null), l1 = $(null), e1 = c != null, { tracking: d1 } = x1(), V1 = _(
|
|
5175
|
+
(q, v1) => {
|
|
5176
|
+
d1?.onWelcomeSuggestionClick?.({
|
|
5177
5177
|
item: q,
|
|
5178
|
-
group:
|
|
5178
|
+
group: v1,
|
|
5179
5179
|
prompt: q.prompt || q.title
|
|
5180
|
-
}), F?.(q,
|
|
5180
|
+
}), F?.(q, v1);
|
|
5181
5181
|
},
|
|
5182
|
-
[
|
|
5182
|
+
[d1, F]
|
|
5183
5183
|
), {
|
|
5184
|
-
attachedFiles:
|
|
5185
|
-
fileInputRef:
|
|
5186
|
-
onUploadFiles:
|
|
5187
|
-
acceptValue:
|
|
5188
|
-
isAtMaxFiles:
|
|
5189
|
-
maxFiles:
|
|
5184
|
+
attachedFiles: b1,
|
|
5185
|
+
fileInputRef: b,
|
|
5186
|
+
onUploadFiles: k,
|
|
5187
|
+
acceptValue: y,
|
|
5188
|
+
isAtMaxFiles: D,
|
|
5189
|
+
maxFiles: E,
|
|
5190
5190
|
processFiles: O,
|
|
5191
|
-
handleFileSelect:
|
|
5192
|
-
handleRemoveFile:
|
|
5191
|
+
handleFileSelect: c1,
|
|
5192
|
+
handleRemoveFile: p1,
|
|
5193
5193
|
clearFiles: k1,
|
|
5194
5194
|
transientError: N1,
|
|
5195
5195
|
showTransientError: T1
|
|
5196
|
-
} = A2(C),
|
|
5197
|
-
inputValue:
|
|
5196
|
+
} = A2(C), a1 = P2({
|
|
5197
|
+
inputValue: B,
|
|
5198
5198
|
setInputValue: U,
|
|
5199
5199
|
cursorPosition: Z,
|
|
5200
5200
|
searchPersons: g,
|
|
5201
|
-
textareaRef:
|
|
5202
|
-
}), fe =
|
|
5203
|
-
const
|
|
5201
|
+
textareaRef: j
|
|
5202
|
+
}), fe = $(""), he = _((q) => {
|
|
5203
|
+
const v1 = fe.current, q1 = v1 && !/\s$/.test(v1) ? " " : "", j1 = `${v1}${q1}${q}`;
|
|
5204
5204
|
U(j1), G(j1.length);
|
|
5205
5205
|
}, []), fr = {
|
|
5206
|
-
"permission-denied":
|
|
5207
|
-
"device-error":
|
|
5208
|
-
"transcription-failed":
|
|
5209
|
-
},
|
|
5206
|
+
"permission-denied": R.ai.micPermissionDenied,
|
|
5207
|
+
"device-error": R.ai.micError,
|
|
5208
|
+
"transcription-failed": R.ai.transcriptionError
|
|
5209
|
+
}, w1 = En({
|
|
5210
5210
|
onTranscribe: h,
|
|
5211
5211
|
onPartial: he,
|
|
5212
5212
|
onFinal: (q) => {
|
|
5213
|
-
he(q),
|
|
5213
|
+
he(q), j.current?.focus();
|
|
5214
5214
|
},
|
|
5215
5215
|
onError: (q) => T1(fr[q])
|
|
5216
|
-
}), Ce = !!h &&
|
|
5217
|
-
|
|
5218
|
-
}, [
|
|
5219
|
-
|
|
5220
|
-
}, [
|
|
5216
|
+
}), Ce = !!h && w1.isSupported, hr = _(() => {
|
|
5217
|
+
d1?.onDictationStart?.(), fe.current = B, w1.start();
|
|
5218
|
+
}, [B, w1, d1]), Cr = _(() => {
|
|
5219
|
+
d1?.onDictationCancel?.(), w1.cancel();
|
|
5220
|
+
}, [w1, d1]);
|
|
5221
5221
|
W(() => {
|
|
5222
|
-
typeof window < "u" && window.location.hash.length === 0 &&
|
|
5222
|
+
typeof window < "u" && window.location.hash.length === 0 && j.current?.focus();
|
|
5223
5223
|
}, []), W(() => {
|
|
5224
5224
|
if (v)
|
|
5225
5225
|
return v((q) => {
|
|
@@ -5228,43 +5228,43 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5228
5228
|
v(null);
|
|
5229
5229
|
};
|
|
5230
5230
|
}, [v, O]);
|
|
5231
|
-
const G1 =
|
|
5231
|
+
const G1 = w1.status === "recording", pr = G1 ? R.ai.listening : R.ai.inputPlaceholder, pe = b1.filter((q) => q.status === "uploaded"), P1 = b1.some((q) => q.status === "uploading"), me = b1.some((q) => q.status === "error"), W1 = B.trim().length > 0 || pe.length > 0;
|
|
5232
5232
|
W(() => {
|
|
5233
5233
|
if (!(!X || P1)) {
|
|
5234
5234
|
if (Q(!1), me) {
|
|
5235
|
-
T1(
|
|
5235
|
+
T1(R.ai.fileUploadBlockedSubmit);
|
|
5236
5236
|
return;
|
|
5237
5237
|
}
|
|
5238
|
-
|
|
5238
|
+
i1.current?.requestSubmit();
|
|
5239
5239
|
}
|
|
5240
5240
|
}, [
|
|
5241
5241
|
X,
|
|
5242
5242
|
P1,
|
|
5243
5243
|
me,
|
|
5244
5244
|
T1,
|
|
5245
|
-
|
|
5245
|
+
R.ai.fileUploadBlockedSubmit
|
|
5246
5246
|
]);
|
|
5247
5247
|
const mr = async (q) => {
|
|
5248
|
-
if (q.preventDefault(), !
|
|
5249
|
-
if (
|
|
5248
|
+
if (q.preventDefault(), !e1) {
|
|
5249
|
+
if (a1.close(), o)
|
|
5250
5250
|
r?.();
|
|
5251
|
-
else if (W1 && !
|
|
5251
|
+
else if (W1 && !J) {
|
|
5252
5252
|
if (P1) {
|
|
5253
|
-
Q(!0),
|
|
5253
|
+
Q(!0), j.current?.focus();
|
|
5254
5254
|
return;
|
|
5255
5255
|
}
|
|
5256
5256
|
if (n) {
|
|
5257
5257
|
t1(!0);
|
|
5258
5258
|
try {
|
|
5259
5259
|
if (await n() === !1) {
|
|
5260
|
-
|
|
5260
|
+
j.current?.focus();
|
|
5261
5261
|
return;
|
|
5262
5262
|
}
|
|
5263
5263
|
} finally {
|
|
5264
5264
|
t1(!1);
|
|
5265
5265
|
}
|
|
5266
5266
|
}
|
|
5267
|
-
const
|
|
5267
|
+
const v1 = a1.transformMentions(B.trim()), q1 = j2(v1), j1 = pe.flatMap(
|
|
5268
5268
|
(be) => be.uploadedFile ? [be.uploadedFile] : []
|
|
5269
5269
|
), Le = u, xe = f;
|
|
5270
5270
|
Le && l?.(null), xe && d?.(null), await e({
|
|
@@ -5274,43 +5274,43 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5274
5274
|
quote: xe
|
|
5275
5275
|
}), U(""), k1();
|
|
5276
5276
|
}
|
|
5277
|
-
|
|
5277
|
+
j.current?.focus();
|
|
5278
5278
|
}
|
|
5279
5279
|
}, gr = (q) => {
|
|
5280
|
-
|
|
5280
|
+
e1 || a1.handleKeyDown(q) || q.key === "Enter" && !q.shiftKey && (q.preventDefault(), o || i1.current?.requestSubmit());
|
|
5281
5281
|
}, wr = () => {
|
|
5282
|
-
G(
|
|
5282
|
+
G(j.current?.selectionStart ?? 0);
|
|
5283
5283
|
}, vr = () => {
|
|
5284
|
-
|
|
5285
|
-
}, ge = r1 ? r1.prompt ?? r1.title : null, we = G1 ? [
|
|
5284
|
+
l1.current && j.current && (l1.current.scrollTop = j.current.scrollTop);
|
|
5285
|
+
}, ge = r1 ? r1.prompt ?? r1.title : null, we = G1 ? [R.ai.listening] : ge ? [ge] : s ?? [], Lr = we.length > 1, xr = Y(() => S2(B, a1.mentions, {
|
|
5286
5286
|
cursorPosition: Z,
|
|
5287
|
-
inlineCompletion:
|
|
5288
|
-
}), [
|
|
5287
|
+
inlineCompletion: a1.inlineCompletion
|
|
5288
|
+
}), [B, a1.mentions, Z, a1.inlineCompletion]), br = a1.mentions.length > 0 || a1.inlineCompletion !== null, H1 = L === "inside", D1 = N && !!S && S.length > 0 && !!F ? /* @__PURE__ */ t(
|
|
5289
5289
|
F2,
|
|
5290
5290
|
{
|
|
5291
5291
|
suggestions: S,
|
|
5292
5292
|
onItemClick: V1,
|
|
5293
|
-
onItemHover:
|
|
5293
|
+
onItemHover: g1,
|
|
5294
5294
|
side: H1 ? "bottom" : "top",
|
|
5295
5295
|
reserveTwoRows: !H1
|
|
5296
5296
|
}
|
|
5297
|
-
) : null, A1 = H1, kr = !A1 || (!!
|
|
5298
|
-
|
|
5297
|
+
) : null, A1 = H1, kr = !A1 || (!!k || !!m || Ce), yr = A1 && !G1, Mr = N && A && !!V && V.length > 0, ve = A && N, { motionProps: Rr } = $n(
|
|
5298
|
+
N,
|
|
5299
5299
|
160,
|
|
5300
5300
|
0.5
|
|
5301
5301
|
);
|
|
5302
5302
|
return /* @__PURE__ */ i(
|
|
5303
5303
|
K.div,
|
|
5304
5304
|
{
|
|
5305
|
-
ref:
|
|
5305
|
+
ref: P,
|
|
5306
5306
|
className: x(
|
|
5307
5307
|
"flex flex-col items-center gap-2",
|
|
5308
5308
|
// The chat window's gutter. `padding="none"` hands it to the host —
|
|
5309
5309
|
// see the prop's doc for what the host takes on with it.
|
|
5310
|
-
|
|
5310
|
+
H === "default" && "px-4 pb-3 pt-2",
|
|
5311
5311
|
ve && "min-h-0 flex-1 justify-start -mt-20"
|
|
5312
5312
|
),
|
|
5313
|
-
...
|
|
5313
|
+
...A ? Rr : {},
|
|
5314
5314
|
children: [
|
|
5315
5315
|
/* @__PURE__ */ i("div", { className: "flex w-full max-w-content flex-col gap-2", children: [
|
|
5316
5316
|
D1 && !H1 && /* @__PURE__ */ t("div", { children: D1 }),
|
|
@@ -5318,7 +5318,7 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5318
5318
|
K.form,
|
|
5319
5319
|
{
|
|
5320
5320
|
"aria-busy": o,
|
|
5321
|
-
ref:
|
|
5321
|
+
ref: i1,
|
|
5322
5322
|
className: x(
|
|
5323
5323
|
"relative isolate z-20",
|
|
5324
5324
|
"flex flex-col items-stretch md:gap-3 gap-2",
|
|
@@ -5334,7 +5334,7 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5334
5334
|
"from-[#E55619] via-[#A1ADE5] to-[#E51943]",
|
|
5335
5335
|
"after:transition-all after:delay-200 after:duration-300",
|
|
5336
5336
|
"has-[textarea:focus]:after:scale-100 has-[textarea:focus]:after:opacity-100",
|
|
5337
|
-
|
|
5337
|
+
e1 && "after:scale-100 after:opacity-100 border-f1-background-tertiary"
|
|
5338
5338
|
),
|
|
5339
5339
|
animate: {
|
|
5340
5340
|
"--gradient-angle": ["0deg", "360deg"]
|
|
@@ -5348,22 +5348,22 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5348
5348
|
"--gradient-angle": "180deg"
|
|
5349
5349
|
},
|
|
5350
5350
|
onClick: () => {
|
|
5351
|
-
|
|
5351
|
+
e1 || j.current?.focus();
|
|
5352
5352
|
},
|
|
5353
5353
|
onSubmit: mr,
|
|
5354
5354
|
children: [
|
|
5355
5355
|
/* @__PURE__ */ t(
|
|
5356
5356
|
p2,
|
|
5357
5357
|
{
|
|
5358
|
-
isOpen:
|
|
5359
|
-
results:
|
|
5360
|
-
isLoading:
|
|
5361
|
-
selectedIndex:
|
|
5362
|
-
position:
|
|
5363
|
-
onSelect:
|
|
5358
|
+
isOpen: a1.isOpen,
|
|
5359
|
+
results: a1.results,
|
|
5360
|
+
isLoading: a1.isLoading,
|
|
5361
|
+
selectedIndex: a1.selectedIndex,
|
|
5362
|
+
position: a1.popoverPosition,
|
|
5363
|
+
onSelect: a1.selectPerson
|
|
5364
5364
|
}
|
|
5365
5365
|
),
|
|
5366
|
-
/* @__PURE__ */ t(M1, { initial: !1, children:
|
|
5366
|
+
/* @__PURE__ */ t(M1, { initial: !1, children: e1 ? /* @__PURE__ */ t(
|
|
5367
5367
|
K.div,
|
|
5368
5368
|
{
|
|
5369
5369
|
className: "overflow-hidden",
|
|
@@ -5442,10 +5442,10 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5442
5442
|
/* @__PURE__ */ t(
|
|
5443
5443
|
u2,
|
|
5444
5444
|
{
|
|
5445
|
-
attachedFiles:
|
|
5445
|
+
attachedFiles: b1,
|
|
5446
5446
|
isUploading: P1,
|
|
5447
|
-
onRemove:
|
|
5448
|
-
removeLabel:
|
|
5447
|
+
onRemove: p1,
|
|
5448
|
+
removeLabel: R.ai.removeFile
|
|
5449
5449
|
}
|
|
5450
5450
|
),
|
|
5451
5451
|
/* @__PURE__ */ i(
|
|
@@ -5457,11 +5457,11 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5457
5457
|
/* @__PURE__ */ t(
|
|
5458
5458
|
w2,
|
|
5459
5459
|
{
|
|
5460
|
-
textareaRef:
|
|
5461
|
-
highlightRef:
|
|
5462
|
-
inputValue:
|
|
5463
|
-
onInputChange: (q,
|
|
5464
|
-
U(q), G(
|
|
5460
|
+
textareaRef: j,
|
|
5461
|
+
highlightRef: l1,
|
|
5462
|
+
inputValue: B,
|
|
5463
|
+
onInputChange: (q, v1) => {
|
|
5464
|
+
U(q), G(v1);
|
|
5465
5465
|
},
|
|
5466
5466
|
onKeyDown: gr,
|
|
5467
5467
|
onCursorUpdate: wr,
|
|
@@ -5479,8 +5479,8 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5479
5479
|
{
|
|
5480
5480
|
inProgress: o,
|
|
5481
5481
|
hasDataToSend: W1,
|
|
5482
|
-
isPreSending:
|
|
5483
|
-
recordingStatus:
|
|
5482
|
+
isPreSending: J || X,
|
|
5483
|
+
recordingStatus: w1.status,
|
|
5484
5484
|
size: "sm"
|
|
5485
5485
|
}
|
|
5486
5486
|
) })
|
|
@@ -5498,21 +5498,21 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5498
5498
|
kr && /* @__PURE__ */ t(
|
|
5499
5499
|
d2,
|
|
5500
5500
|
{
|
|
5501
|
-
onUploadFiles:
|
|
5501
|
+
onUploadFiles: k,
|
|
5502
5502
|
toolbarStart: m,
|
|
5503
|
-
isAtMaxFiles:
|
|
5504
|
-
maxFiles:
|
|
5505
|
-
acceptValue:
|
|
5506
|
-
fileInputRef:
|
|
5507
|
-
handleFileSelect:
|
|
5503
|
+
isAtMaxFiles: D,
|
|
5504
|
+
maxFiles: E,
|
|
5505
|
+
acceptValue: y,
|
|
5506
|
+
fileInputRef: b,
|
|
5507
|
+
handleFileSelect: c1,
|
|
5508
5508
|
inProgress: o,
|
|
5509
5509
|
hasDataToSend: W1,
|
|
5510
|
-
isPreSending:
|
|
5510
|
+
isPreSending: J || X,
|
|
5511
5511
|
canRecord: Ce,
|
|
5512
|
-
recordingStatus:
|
|
5513
|
-
recordingStream:
|
|
5512
|
+
recordingStatus: w1.status,
|
|
5513
|
+
recordingStream: w1.stream,
|
|
5514
5514
|
onStartRecording: hr,
|
|
5515
|
-
onStopRecording:
|
|
5515
|
+
onStopRecording: w1.stop,
|
|
5516
5516
|
onCancelRecording: Cr,
|
|
5517
5517
|
showSubmit: !A1
|
|
5518
5518
|
}
|
|
@@ -5526,8 +5526,8 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5526
5526
|
) })
|
|
5527
5527
|
] }),
|
|
5528
5528
|
Mr && /* @__PURE__ */ t("div", { className: "w-full max-w-content pt-2", children: /* @__PURE__ */ t(L2, { cards: V }) }),
|
|
5529
|
-
|
|
5530
|
-
/* @__PURE__ */ t(M1, { mode: "wait", initial: !1, children:
|
|
5529
|
+
M && N && A && /* @__PURE__ */ t("div", { className: "w-full py-4 mx-auto flex max-w-content justify-center", children: M }),
|
|
5530
|
+
/* @__PURE__ */ t(M1, { mode: "wait", initial: !1, children: e1 ? /* @__PURE__ */ i(
|
|
5531
5531
|
K.div,
|
|
5532
5532
|
{
|
|
5533
5533
|
className: "flex w-full max-w-content flex-row flex-wrap items-center justify-center gap-x-3 gap-y-1 text-sm font-medium text-f1-foreground-tertiary",
|
|
@@ -5539,17 +5539,17 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5539
5539
|
/* @__PURE__ */ i("span", { children: [
|
|
5540
5540
|
/* @__PURE__ */ t("kbd", { className: "font-sans", children: "↑↓" }),
|
|
5541
5541
|
" ",
|
|
5542
|
-
|
|
5542
|
+
R.ai.clarifyingQuestion.navHint.navigate
|
|
5543
5543
|
] }),
|
|
5544
5544
|
/* @__PURE__ */ i("span", { children: [
|
|
5545
5545
|
/* @__PURE__ */ t("kbd", { className: "font-sans", children: "Enter" }),
|
|
5546
5546
|
" ",
|
|
5547
|
-
|
|
5547
|
+
R.ai.clarifyingQuestion.navHint.select
|
|
5548
5548
|
] }),
|
|
5549
5549
|
/* @__PURE__ */ i("span", { children: [
|
|
5550
5550
|
/* @__PURE__ */ t("kbd", { className: "font-sans", children: "Esc" }),
|
|
5551
5551
|
" ",
|
|
5552
|
-
|
|
5552
|
+
R.ai.clarifyingQuestion.navHint.cancel
|
|
5553
5553
|
] })
|
|
5554
5554
|
]
|
|
5555
5555
|
},
|
|
@@ -5578,7 +5578,7 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5578
5578
|
"motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:focus-visible:scale-100"
|
|
5579
5579
|
),
|
|
5580
5580
|
children: /* @__PURE__ */ t(
|
|
5581
|
-
|
|
5581
|
+
s1,
|
|
5582
5582
|
{
|
|
5583
5583
|
className: x(
|
|
5584
5584
|
"text-sm font-medium text-f1-foreground-tertiary transition-colors duration-700 ease-out",
|
|
@@ -5589,7 +5589,7 @@ const D2 = /[\\`*_{}[\]()#+\-.!|~>]/g, j2 = (e) => e.split(/(<entity-ref\b[^>]*>
|
|
|
5589
5589
|
}
|
|
5590
5590
|
)
|
|
5591
5591
|
}
|
|
5592
|
-
) : /* @__PURE__ */ t(
|
|
5592
|
+
) : /* @__PURE__ */ t(s1, { className: "text-sm font-medium text-f1-foreground-tertiary", children: w.text }),
|
|
5593
5593
|
w.link && w.linkText && /* @__PURE__ */ t(
|
|
5594
5594
|
In,
|
|
5595
5595
|
{
|
|
@@ -5690,7 +5690,7 @@ function z2({
|
|
|
5690
5690
|
}
|
|
5691
5691
|
),
|
|
5692
5692
|
/* @__PURE__ */ t("div", { className: "absolute right-2 top-2 rounded", children: /* @__PURE__ */ t(
|
|
5693
|
-
|
|
5693
|
+
m1,
|
|
5694
5694
|
{
|
|
5695
5695
|
variant: "neutral",
|
|
5696
5696
|
label: "Download",
|
|
@@ -5754,7 +5754,7 @@ function K2({
|
|
|
5754
5754
|
title: r,
|
|
5755
5755
|
...o
|
|
5756
5756
|
}) {
|
|
5757
|
-
const n = z(), s =
|
|
5757
|
+
const n = z(), s = $(null), a = _(
|
|
5758
5758
|
(c) => {
|
|
5759
5759
|
if (!s.current) return;
|
|
5760
5760
|
const u = r?.replace(/\s+/g, "_").toLowerCase() || "table";
|
|
@@ -5765,7 +5765,7 @@ function K2({
|
|
|
5765
5765
|
return /* @__PURE__ */ i("div", { className: "group/table relative flex flex-col gap-2 rounded-md border border-solid border-f1-border-secondary", children: [
|
|
5766
5766
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-3 border-0 border-b border-solid border-f1-border-secondary px-3 py-2", children: [
|
|
5767
5767
|
/* @__PURE__ */ t(
|
|
5768
|
-
|
|
5768
|
+
s1,
|
|
5769
5769
|
{
|
|
5770
5770
|
tag: "h2",
|
|
5771
5771
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
@@ -5915,13 +5915,13 @@ function S1({
|
|
|
5915
5915
|
mapToCard: n,
|
|
5916
5916
|
fallbackCard: s
|
|
5917
5917
|
}) {
|
|
5918
|
-
const a =
|
|
5918
|
+
const a = $(/* @__PURE__ */ new Map()), [c, u] = I(
|
|
5919
5919
|
() => a.current.get(e) ?? null
|
|
5920
|
-
), [l, f] = I(!1), [d, C] = I(!1), m =
|
|
5920
|
+
), [l, f] = I(!1), [d, C] = I(!1), m = $(!0);
|
|
5921
5921
|
W(() => () => {
|
|
5922
5922
|
m.current = !1;
|
|
5923
5923
|
}, []);
|
|
5924
|
-
const h =
|
|
5924
|
+
const h = _(() => {
|
|
5925
5925
|
if (c || l) return;
|
|
5926
5926
|
const v = a.current.get(e);
|
|
5927
5927
|
if (v) {
|
|
@@ -5979,7 +5979,7 @@ function a6({
|
|
|
5979
5979
|
id: e,
|
|
5980
5980
|
label: r
|
|
5981
5981
|
}) {
|
|
5982
|
-
const { entityRefs: o } =
|
|
5982
|
+
const { entityRefs: o } = x1(), n = o?.resolvers?.candidate, s = z(), a = o?.urls?.candidate?.(e), c = Y(
|
|
5983
5983
|
() => (l) => {
|
|
5984
5984
|
const f = [];
|
|
5985
5985
|
return l.source && f.push({
|
|
@@ -6051,7 +6051,7 @@ const Zt = p(
|
|
|
6051
6051
|
);
|
|
6052
6052
|
Zt.displayName = "ExpenseTrigger";
|
|
6053
6053
|
function i6({ id: e, label: r }) {
|
|
6054
|
-
const { entityRefs: o } =
|
|
6054
|
+
const { entityRefs: o } = x1(), n = o?.resolvers?.expense, s = z(), a = o?.urls?.expense?.(e), c = Y(
|
|
6055
6055
|
() => (l) => ({
|
|
6056
6056
|
avatar: {
|
|
6057
6057
|
type: "icon",
|
|
@@ -6110,7 +6110,7 @@ function l6({
|
|
|
6110
6110
|
id: e,
|
|
6111
6111
|
label: r
|
|
6112
6112
|
}) {
|
|
6113
|
-
const { entityRefs: o } =
|
|
6113
|
+
const { entityRefs: o } = x1(), n = o?.resolvers?.jobPosting, s = z(), a = o?.urls?.jobPosting?.(e), c = Y(
|
|
6114
6114
|
() => (l) => ({
|
|
6115
6115
|
title: l.title,
|
|
6116
6116
|
description: [l.status, l.location].filter(Boolean).join(" · "),
|
|
@@ -6171,7 +6171,7 @@ function d6({
|
|
|
6171
6171
|
id: e,
|
|
6172
6172
|
label: r
|
|
6173
6173
|
}) {
|
|
6174
|
-
const { entityRefs: o } =
|
|
6174
|
+
const { entityRefs: o } = x1(), n = o?.resolvers?.requisition, s = z(), a = o?.urls?.requisition?.(e), c = Y(
|
|
6175
6175
|
() => (l) => {
|
|
6176
6176
|
const f = l.lineManager ? `${l.lineManager.firstName} ${l.lineManager.lastName}` : void 0, C = [
|
|
6177
6177
|
l.status ? {
|
|
@@ -6264,7 +6264,7 @@ const zt = p(
|
|
|
6264
6264
|
);
|
|
6265
6265
|
zt.displayName = "PersonTrigger";
|
|
6266
6266
|
function u6({ id: e, label: r }) {
|
|
6267
|
-
const { entityRefs: o } =
|
|
6267
|
+
const { entityRefs: o } = x1(), n = o?.resolvers?.person, s = z(), a = o?.urls?.person?.(e), c = Y(
|
|
6268
6268
|
() => (l) => ({
|
|
6269
6269
|
avatar: {
|
|
6270
6270
|
type: "person",
|
|
@@ -6322,7 +6322,7 @@ const Gt = p(
|
|
|
6322
6322
|
);
|
|
6323
6323
|
Gt.displayName = "VacancyTrigger";
|
|
6324
6324
|
function f6({ id: e, label: r }) {
|
|
6325
|
-
const { entityRefs: o } =
|
|
6325
|
+
const { entityRefs: o } = x1(), n = o?.resolvers?.vacancy, s = z(), a = o?.urls?.vacancy?.(e), c = Y(
|
|
6326
6326
|
() => (l) => ({
|
|
6327
6327
|
title: l.name,
|
|
6328
6328
|
description: [l.status, l.vacancyType].filter(Boolean).join(" · "),
|
|
@@ -6426,11 +6426,11 @@ function Wt({
|
|
|
6426
6426
|
e?.type === "file" && /* @__PURE__ */ t(On, { file: e.file, size: "lg" }),
|
|
6427
6427
|
e?.type === "icon" && /* @__PURE__ */ t(Un, { icon: e.icon, size: "md" }),
|
|
6428
6428
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
6429
|
-
/* @__PURE__ */ t(
|
|
6430
|
-
o && /* @__PURE__ */ t(
|
|
6429
|
+
/* @__PURE__ */ t(s1, { className: "text-lg font-semibold text-f1-foreground", children: r }),
|
|
6430
|
+
o && /* @__PURE__ */ t(s1, { className: "text-base text-f1-foreground-secondary", children: o })
|
|
6431
6431
|
] }),
|
|
6432
6432
|
s.type === "open" && s.showButton !== !1 && /* @__PURE__ */ t(
|
|
6433
|
-
|
|
6433
|
+
m1,
|
|
6434
6434
|
{
|
|
6435
6435
|
variant: "outline",
|
|
6436
6436
|
size: "md",
|
|
@@ -6439,7 +6439,7 @@ function Wt({
|
|
|
6439
6439
|
}
|
|
6440
6440
|
),
|
|
6441
6441
|
s.type === "custom" && /* @__PURE__ */ t(
|
|
6442
|
-
|
|
6442
|
+
m1,
|
|
6443
6443
|
{
|
|
6444
6444
|
variant: "outline",
|
|
6445
6445
|
size: "md",
|
|
@@ -6460,7 +6460,7 @@ const ue = U1(null);
|
|
|
6460
6460
|
function b9({
|
|
6461
6461
|
children: e
|
|
6462
6462
|
}) {
|
|
6463
|
-
const [r, o] = I(0), n =
|
|
6463
|
+
const [r, o] = I(0), n = $([]), s = _(
|
|
6464
6464
|
(c) => {
|
|
6465
6465
|
const u = n.current, l = u.findIndex(
|
|
6466
6466
|
(d) => d.formName === c.formName && d.customFieldName === c.customFieldName
|
|
@@ -6560,8 +6560,8 @@ function Xt({
|
|
|
6560
6560
|
formValues: c,
|
|
6561
6561
|
valueFormatter: u
|
|
6562
6562
|
}) {
|
|
6563
|
-
const { canvasContent: l, openCanvas: f, closeCanvas: d } =
|
|
6564
|
-
}), g = n ?? e, v = s ?? r ?? "", w = l?.type === "form" && l.formName === e,
|
|
6563
|
+
const { canvasContent: l, openCanvas: f, closeCanvas: d } = x1(), C = m6(e), m = u ?? C, h = $(() => {
|
|
6564
|
+
}), g = n ?? e, v = s ?? r ?? "", w = l?.type === "form" && l.formName === e, M = () => f({
|
|
6565
6565
|
type: "form",
|
|
6566
6566
|
title: g,
|
|
6567
6567
|
description: v,
|
|
@@ -6569,27 +6569,27 @@ function Xt({
|
|
|
6569
6569
|
formDescription: r,
|
|
6570
6570
|
formModule: o
|
|
6571
6571
|
});
|
|
6572
|
-
h.current =
|
|
6572
|
+
h.current = M, W(() => {
|
|
6573
6573
|
typeof window > "u" || window.innerWidth < g6 || Ne.has(e) || (Ne.add(e), h.current());
|
|
6574
6574
|
}, [e]);
|
|
6575
|
-
const
|
|
6576
|
-
const V = c[F],
|
|
6575
|
+
const N = a && c ? Object.entries(a).map(([F, L]) => {
|
|
6576
|
+
const V = c[F], H = m?.(F, V, {
|
|
6577
6577
|
fieldType: L.fieldType,
|
|
6578
6578
|
customFieldName: L.customFieldName
|
|
6579
6579
|
});
|
|
6580
|
-
if (!
|
|
6580
|
+
if (!H && L.fieldType === "custom" && typeof V == "object" && V !== null)
|
|
6581
6581
|
return null;
|
|
6582
|
-
const
|
|
6582
|
+
const P = H ?? qt(V, L.fieldType), R = ["richtext", "textarea"];
|
|
6583
6583
|
return {
|
|
6584
6584
|
label: L.label,
|
|
6585
|
-
content:
|
|
6586
|
-
verticalLayout:
|
|
6585
|
+
content: P,
|
|
6586
|
+
verticalLayout: R.includes(L.fieldType ?? "")
|
|
6587
6587
|
};
|
|
6588
6588
|
}).filter((F) => {
|
|
6589
6589
|
if (!F) return !1;
|
|
6590
6590
|
const L = Array.isArray(F.content) ? F.content[0] : F.content;
|
|
6591
6591
|
return !(L?.type === "item" && L.text === "—");
|
|
6592
|
-
}) : [],
|
|
6592
|
+
}) : [], A = N.slice(0, Fe), S = N.length > Fe;
|
|
6593
6593
|
return /* @__PURE__ */ t(
|
|
6594
6594
|
Wt,
|
|
6595
6595
|
{
|
|
@@ -6599,20 +6599,20 @@ function Xt({
|
|
|
6599
6599
|
isActive: w,
|
|
6600
6600
|
action: {
|
|
6601
6601
|
type: "open",
|
|
6602
|
-
onOpen:
|
|
6602
|
+
onOpen: M,
|
|
6603
6603
|
onClose: d,
|
|
6604
6604
|
showButton: w
|
|
6605
6605
|
},
|
|
6606
|
-
children:
|
|
6606
|
+
children: A.length > 0 && !w && /* @__PURE__ */ t("div", { className: "-mx-3 flex w-full flex-col overflow-hidden pb-1", children: /* @__PURE__ */ t(
|
|
6607
6607
|
zn,
|
|
6608
6608
|
{
|
|
6609
|
-
details:
|
|
6609
|
+
details: A.map((F) => ({
|
|
6610
6610
|
title: F.label,
|
|
6611
6611
|
content: F.content,
|
|
6612
6612
|
...F.verticalLayout && { verticalLayout: !0 }
|
|
6613
6613
|
})),
|
|
6614
6614
|
showSeeMore: S,
|
|
6615
|
-
onClickSeeMore:
|
|
6615
|
+
onClickSeeMore: M,
|
|
6616
6616
|
tableView: !0
|
|
6617
6617
|
}
|
|
6618
6618
|
) })
|
|
@@ -6653,7 +6653,7 @@ function Yt({
|
|
|
6653
6653
|
containerRef: e,
|
|
6654
6654
|
enabled: r = !0
|
|
6655
6655
|
}) {
|
|
6656
|
-
const [o, n] = I(null), s =
|
|
6656
|
+
const [o, n] = I(null), s = _(() => n(null), []);
|
|
6657
6657
|
return W(() => {
|
|
6658
6658
|
if (!r || typeof window > "u") return;
|
|
6659
6659
|
const a = e.current;
|
|
@@ -6678,7 +6678,7 @@ function Yt({
|
|
|
6678
6678
|
}
|
|
6679
6679
|
const He = 8, E1 = 8;
|
|
6680
6680
|
function Kt({ anchor: e, onReply: r }) {
|
|
6681
|
-
const o = z(), n =
|
|
6681
|
+
const o = z(), n = $(null), [s, a] = I(
|
|
6682
6682
|
null
|
|
6683
6683
|
);
|
|
6684
6684
|
if (ee(() => {
|
|
@@ -6716,7 +6716,7 @@ function Kt({ anchor: e, onReply: r }) {
|
|
|
6716
6716
|
"drop-shadow"
|
|
6717
6717
|
),
|
|
6718
6718
|
children: /* @__PURE__ */ t(
|
|
6719
|
-
|
|
6719
|
+
o1,
|
|
6720
6720
|
{
|
|
6721
6721
|
ref: n,
|
|
6722
6722
|
type: "button",
|
|
@@ -6742,7 +6742,7 @@ const Qt = U1(void 0), y9 = () => B1(Qt), y6 = (e) => /* @__PURE__ */ t(yt, { co
|
|
|
6742
6742
|
onRendered: a,
|
|
6743
6743
|
renderMarkdown: c
|
|
6744
6744
|
}) => {
|
|
6745
|
-
const u = typeof o?.content == "string" ? o.content : "", l = (o && n?.(o)) ?? o?.generativeUI?.() ?? null, f = o?.toolCalls?.[0]?.id, d = !u && !l, C =
|
|
6745
|
+
const u = typeof o?.content == "string" ? o.content : "", l = (o && n?.(o)) ?? o?.generativeUI?.() ?? null, f = o?.toolCalls?.[0]?.id, d = !u && !l, C = $(null), { anchor: m, clear: h } = Yt({
|
|
6746
6746
|
containerRef: C,
|
|
6747
6747
|
enabled: !!(o?.id && u)
|
|
6748
6748
|
});
|
|
@@ -6774,7 +6774,7 @@ const Qt = U1(void 0), y9 = () => B1(Qt), y6 = (e) => /* @__PURE__ */ t(yt, { co
|
|
|
6774
6774
|
reactionType: o,
|
|
6775
6775
|
message: n
|
|
6776
6776
|
}) => {
|
|
6777
|
-
const [s, a] = I(""), c = z(), { title: u, label: l, placeholder: f } = o === "like" ? c.ai.feedbackModal.positive : c.ai.feedbackModal.negative, d =
|
|
6777
|
+
const [s, a] = I(""), c = z(), { title: u, label: l, placeholder: f } = o === "like" ? c.ai.feedbackModal.positive : c.ai.feedbackModal.negative, d = _(() => {
|
|
6778
6778
|
r(n, s);
|
|
6779
6779
|
}, [s, n, r]), C = () => {
|
|
6780
6780
|
e(n);
|
|
@@ -6878,7 +6878,7 @@ const S6 = ({
|
|
|
6878
6878
|
variant: "ghost",
|
|
6879
6879
|
"aria-label": n.actions.thumbsUp,
|
|
6880
6880
|
children: /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-center justify-center gap-1", children: /* @__PURE__ */ t(
|
|
6881
|
-
|
|
6881
|
+
n1,
|
|
6882
6882
|
{
|
|
6883
6883
|
size: "md",
|
|
6884
6884
|
icon: a === "like" ? Dt : Pt,
|
|
@@ -6899,7 +6899,7 @@ const S6 = ({
|
|
|
6899
6899
|
variant: "ghost",
|
|
6900
6900
|
"aria-label": n.actions.thumbsDown,
|
|
6901
6901
|
children: /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-center justify-center gap-1", children: /* @__PURE__ */ t(
|
|
6902
|
-
|
|
6902
|
+
n1,
|
|
6903
6903
|
{
|
|
6904
6904
|
size: "md",
|
|
6905
6905
|
icon: a === "dislike" ? It : Bt,
|
|
@@ -6918,7 +6918,7 @@ const S6 = ({
|
|
|
6918
6918
|
onOpenChange: a,
|
|
6919
6919
|
lockOpen: c = !1
|
|
6920
6920
|
}) => {
|
|
6921
|
-
const [u, l] = I(s), f =
|
|
6921
|
+
const [u, l] = I(s), f = C1(), d = n !== void 0, C = d ? n : u;
|
|
6922
6922
|
return /* @__PURE__ */ i(
|
|
6923
6923
|
Mt,
|
|
6924
6924
|
{
|
|
@@ -6937,9 +6937,9 @@ const S6 = ({
|
|
|
6937
6937
|
c ? "flex w-full items-center text-base text-f1-foreground-secondary" : "flex w-full items-center text-base text-f1-foreground-secondary transition-colors duration-150 hover:text-f1-foreground [&[data-state=open]>svg]:rotate-90"
|
|
6938
6938
|
),
|
|
6939
6939
|
children: [
|
|
6940
|
-
/* @__PURE__ */ t("span", { className: "flex items-center justify-start h-6 w-6", children: /* @__PURE__ */ t(
|
|
6940
|
+
/* @__PURE__ */ t("span", { className: "flex items-center justify-start h-6 w-6", children: /* @__PURE__ */ t(n1, { icon: e, className: "block" }) }),
|
|
6941
6941
|
/* @__PURE__ */ t("div", { className: "min-h-6 flex items-center", children: /* @__PURE__ */ t("span", { children: r }) }),
|
|
6942
|
-
!c && /* @__PURE__ */ t(
|
|
6942
|
+
!c && /* @__PURE__ */ t(n1, { icon: z1 })
|
|
6943
6943
|
]
|
|
6944
6944
|
}
|
|
6945
6945
|
),
|
|
@@ -6969,7 +6969,7 @@ const S6 = ({
|
|
|
6969
6969
|
inProgress: o,
|
|
6970
6970
|
isWriting: n
|
|
6971
6971
|
}) => {
|
|
6972
|
-
const s = z(), [a, c] = I(!!o), u =
|
|
6972
|
+
const s = z(), [a, c] = I(!!o), u = $(o);
|
|
6973
6973
|
W(() => {
|
|
6974
6974
|
u.current && !o ? c(!1) : o && !a && c(!0), u.current = o;
|
|
6975
6975
|
}, [o, a]);
|
|
@@ -7025,7 +7025,7 @@ const tr = (e) => /* @__PURE__ */ t(yt, { content: e, format: "markdown" }), E6
|
|
|
7025
7025
|
text: e,
|
|
7026
7026
|
renderMarkdown: r
|
|
7027
7027
|
}) => /* @__PURE__ */ i("div", { className: "flex max-w-[90%] items-start gap-2 self-end pb-1 pr-2 text-f1-foreground-tertiary", children: [
|
|
7028
|
-
/* @__PURE__ */ t("div", { className: "flex h-5 items-center", children: /* @__PURE__ */ t(
|
|
7028
|
+
/* @__PURE__ */ t("div", { className: "flex h-5 items-center", children: /* @__PURE__ */ t(n1, { icon: oe }) }),
|
|
7029
7029
|
/* @__PURE__ */ t("div", { className: "min-w-0 whitespace-pre-wrap text-base leading-5 [&>div]:flex [&>div]:flex-col [&>div]:gap-1 [&_p]:m-0", children: (r ?? tr)(e) })
|
|
7030
7030
|
] }), $6 = ({
|
|
7031
7031
|
message: e,
|
|
@@ -7033,7 +7033,7 @@ const tr = (e) => /* @__PURE__ */ t(yt, { content: e, format: "markdown" }), E6
|
|
|
7033
7033
|
autoScrollIntoView: o = !0,
|
|
7034
7034
|
renderMarkdown: n
|
|
7035
7035
|
}) => {
|
|
7036
|
-
const s =
|
|
7036
|
+
const s = $(null), a = $(null);
|
|
7037
7037
|
W(() => {
|
|
7038
7038
|
!s.current || !o || s.current.scrollIntoView({
|
|
7039
7039
|
behavior: "smooth"
|
|
@@ -7085,67 +7085,79 @@ const tr = (e) => /* @__PURE__ */ t(yt, { content: e, format: "markdown" }), E6
|
|
|
7085
7085
|
messages: e,
|
|
7086
7086
|
caption: r,
|
|
7087
7087
|
subtitle: o,
|
|
7088
|
-
|
|
7089
|
-
|
|
7088
|
+
cta: n,
|
|
7089
|
+
onClick: s,
|
|
7090
|
+
fullscreen: a = !1
|
|
7090
7091
|
}) => {
|
|
7091
|
-
const [
|
|
7092
|
+
const [c, u] = I(0), [l, f] = I(0), [d, C] = I("starting"), m = C1(), h = e[c] ?? "", g = e.join("\0"), v = $(!0);
|
|
7092
7093
|
W(() => {
|
|
7093
|
-
if (
|
|
7094
|
-
|
|
7094
|
+
if (v.current) {
|
|
7095
|
+
v.current = !1;
|
|
7095
7096
|
return;
|
|
7096
7097
|
}
|
|
7097
|
-
|
|
7098
|
-
}, [
|
|
7099
|
-
if (
|
|
7100
|
-
let
|
|
7101
|
-
if (
|
|
7102
|
-
|
|
7103
|
-
else if (
|
|
7104
|
-
|
|
7105
|
-
else if (
|
|
7098
|
+
u(0), f(0), C("writing");
|
|
7099
|
+
}, [g]), W(() => {
|
|
7100
|
+
if (m) return;
|
|
7101
|
+
let N;
|
|
7102
|
+
if (d === "starting")
|
|
7103
|
+
N = setTimeout(() => C("writing"), P6);
|
|
7104
|
+
else if (d === "writing")
|
|
7105
|
+
l < h.length ? N = setTimeout(() => f((A) => A + 1), B6) : C("holding");
|
|
7106
|
+
else if (d === "holding") {
|
|
7106
7107
|
if (e.length <= 1) return;
|
|
7107
|
-
|
|
7108
|
-
} else
|
|
7109
|
-
|
|
7108
|
+
N = setTimeout(() => C("erasing"), D6);
|
|
7109
|
+
} else d === "erasing" && (l > 0 ? N = setTimeout(() => f((A) => A - 1), I6) : N = setTimeout(() => {
|
|
7110
|
+
u((A) => (A + 1) % e.length), C("starting");
|
|
7110
7111
|
}, j6));
|
|
7111
7112
|
return () => {
|
|
7112
|
-
|
|
7113
|
+
N && clearTimeout(N);
|
|
7113
7114
|
};
|
|
7114
|
-
}, [
|
|
7115
|
-
const
|
|
7116
|
-
(
|
|
7115
|
+
}, [d, l, h.length, e.length, m]);
|
|
7116
|
+
const w = !!s, M = w ? (N) => {
|
|
7117
|
+
(N.key === "Enter" || N.key === " ") && (N.preventDefault(), s?.());
|
|
7117
7118
|
} : void 0;
|
|
7118
7119
|
return /* @__PURE__ */ t(
|
|
7119
7120
|
"div",
|
|
7120
7121
|
{
|
|
7121
7122
|
className: x(
|
|
7122
7123
|
"flex w-full flex-1 justify-center px-4",
|
|
7123
|
-
|
|
7124
|
+
a ? "items-end pb-24" : "items-center"
|
|
7124
7125
|
),
|
|
7125
7126
|
children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center", children: [
|
|
7127
|
+
n && /* @__PURE__ */ t(
|
|
7128
|
+
o1,
|
|
7129
|
+
{
|
|
7130
|
+
variant: "neutral",
|
|
7131
|
+
size: "sm",
|
|
7132
|
+
className: "mb-4",
|
|
7133
|
+
label: n.label,
|
|
7134
|
+
icon: n.icon,
|
|
7135
|
+
onClick: n.onClick
|
|
7136
|
+
}
|
|
7137
|
+
),
|
|
7126
7138
|
r && /* @__PURE__ */ t("p", { className: "animate-in fade-in-0 text-center text-2xl font-semibold leading-[28px] text-f1-foreground-secondary duration-500", children: r }),
|
|
7127
7139
|
/* @__PURE__ */ i(
|
|
7128
7140
|
"p",
|
|
7129
7141
|
{
|
|
7130
|
-
role:
|
|
7131
|
-
tabIndex:
|
|
7132
|
-
onClick:
|
|
7133
|
-
onKeyDown:
|
|
7142
|
+
role: w ? "button" : void 0,
|
|
7143
|
+
tabIndex: w ? 0 : void 0,
|
|
7144
|
+
onClick: s,
|
|
7145
|
+
onKeyDown: M,
|
|
7134
7146
|
className: x(
|
|
7135
7147
|
"min-h-[28px] bg-gradient-to-r from-[#E55619] via-[#E51943] to-[#A1ADE5] bg-clip-text text-center text-2xl font-semibold leading-[28px] text-transparent",
|
|
7136
|
-
|
|
7148
|
+
w && x(
|
|
7137
7149
|
"cursor-pointer transition-transform duration-200",
|
|
7138
7150
|
"hover:scale-[1.02] focus-visible:scale-[1.02]",
|
|
7139
7151
|
"motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:focus-visible:scale-100"
|
|
7140
7152
|
)
|
|
7141
7153
|
),
|
|
7142
|
-
"aria-label":
|
|
7154
|
+
"aria-label": w ? h : void 0,
|
|
7143
7155
|
children: [
|
|
7144
|
-
/* @__PURE__ */ t("span", { "aria-hidden": "true", children:
|
|
7145
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children:
|
|
7156
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: m ? h : h.slice(0, l) }),
|
|
7157
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: h })
|
|
7146
7158
|
]
|
|
7147
7159
|
},
|
|
7148
|
-
|
|
7160
|
+
c
|
|
7149
7161
|
),
|
|
7150
7162
|
o && /* @__PURE__ */ t("p", { className: "animate-in fade-in-0 mt-3 text-center text-base leading-snug text-f1-foreground-secondary duration-500", children: o })
|
|
7151
7163
|
] })
|
|
@@ -7160,9 +7172,9 @@ function Z6({
|
|
|
7160
7172
|
turnsCount: s,
|
|
7161
7173
|
freezeTurnMinHeight: a = !1
|
|
7162
7174
|
}) {
|
|
7163
|
-
const [c, u] = I(0), [l, f] = I(!1), d =
|
|
7175
|
+
const [c, u] = I(0), [l, f] = I(!1), d = $(s), C = $(a);
|
|
7164
7176
|
C.current = a;
|
|
7165
|
-
const m =
|
|
7177
|
+
const m = _(
|
|
7166
7178
|
(g = "smooth") => {
|
|
7167
7179
|
o.current?.scrollIntoView({ behavior: g });
|
|
7168
7180
|
},
|
|
@@ -7173,16 +7185,16 @@ function Z6({
|
|
|
7173
7185
|
if (!g || !v) return;
|
|
7174
7186
|
const w = new ResizeObserver(() => {
|
|
7175
7187
|
if (C.current) return;
|
|
7176
|
-
const
|
|
7177
|
-
u(g.clientHeight -
|
|
7188
|
+
const M = parseFloat(getComputedStyle(v).paddingTop) + parseFloat(getComputedStyle(v).paddingBottom) + 1;
|
|
7189
|
+
u(g.clientHeight - M);
|
|
7178
7190
|
});
|
|
7179
7191
|
return w.observe(g), w.observe(v), () => w.disconnect();
|
|
7180
7192
|
}, [e, r]);
|
|
7181
|
-
const h =
|
|
7193
|
+
const h = _(() => {
|
|
7182
7194
|
const g = e.current;
|
|
7183
7195
|
if (!g) return;
|
|
7184
|
-
const { scrollTop: v, scrollHeight: w, clientHeight:
|
|
7185
|
-
f(
|
|
7196
|
+
const { scrollTop: v, scrollHeight: w, clientHeight: M } = g, N = w - v - M;
|
|
7197
|
+
f(N > M);
|
|
7186
7198
|
}, [e]);
|
|
7187
7199
|
return W(() => {
|
|
7188
7200
|
const g = e.current;
|
|
@@ -7193,8 +7205,8 @@ function Z6({
|
|
|
7193
7205
|
requestAnimationFrame(() => {
|
|
7194
7206
|
const g = e.current, v = n.current;
|
|
7195
7207
|
if (!g || !v) return;
|
|
7196
|
-
const w = g.getBoundingClientRect(),
|
|
7197
|
-
g.scrollTo({ top:
|
|
7208
|
+
const w = g.getBoundingClientRect(), M = v.getBoundingClientRect(), N = g.scrollTop + (M.top - w.top);
|
|
7209
|
+
g.scrollTo({ top: N, behavior: "smooth" });
|
|
7198
7210
|
});
|
|
7199
7211
|
}), s === 0 && f(!1), d.current = s;
|
|
7200
7212
|
}, [s, n, e]), { showScrollBtn: l, turnMinHeight: c, scrollToBottom: m };
|
|
@@ -7212,125 +7224,126 @@ const O6 = {
|
|
|
7212
7224
|
initialMessage: n,
|
|
7213
7225
|
initialMessageCaption: s,
|
|
7214
7226
|
initialMessageSubtitle: a,
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7227
|
+
initialMessageCta: c,
|
|
7228
|
+
onWelcomeClick: u,
|
|
7229
|
+
renderToolCall: l,
|
|
7230
|
+
onReplyQuote: f,
|
|
7231
|
+
onAssistantMessageRendered: d,
|
|
7232
|
+
autoScrollUserIntoView: C = !0,
|
|
7233
|
+
renderMarkdown: m,
|
|
7234
|
+
feedback: h,
|
|
7235
|
+
freezeLayout: g = !1,
|
|
7236
|
+
noShadows: v = !1,
|
|
7237
|
+
fullscreen: w = !1,
|
|
7238
|
+
children: M,
|
|
7239
|
+
AssistantMessage: N,
|
|
7240
|
+
UserMessage: A,
|
|
7241
|
+
onRegenerate: S,
|
|
7242
|
+
onCopy: F
|
|
7230
7243
|
}) => {
|
|
7231
|
-
const { modal:
|
|
7232
|
-
|
|
7233
|
-
),
|
|
7234
|
-
const
|
|
7235
|
-
return (Array.isArray(
|
|
7236
|
-
}, [n,
|
|
7237
|
-
viewportRef:
|
|
7238
|
-
contentRef:
|
|
7239
|
-
endRef:
|
|
7240
|
-
lastTurnRef:
|
|
7244
|
+
const { modal: L, handleSubmit: V, handleClose: H } = N6(
|
|
7245
|
+
h ?? O6
|
|
7246
|
+
), P = z(), R = N ?? M6, T = A ?? $6, B = Y(() => {
|
|
7247
|
+
const j = n ?? P.ai.defaultInitialMessage;
|
|
7248
|
+
return (Array.isArray(j) ? j : [j]).filter((e1) => typeof e1 == "string" && e1.length > 0);
|
|
7249
|
+
}, [n, P.ai.defaultInitialMessage]), U = !r && e.length === 0 && B.length > 0, Z = $(null), G = $(null), J = $(null), t1 = $(null), X = $(null), { showScrollBtn: Q, turnMinHeight: r1, scrollToBottom: g1 } = Z6({
|
|
7250
|
+
viewportRef: Z,
|
|
7251
|
+
contentRef: G,
|
|
7252
|
+
endRef: J,
|
|
7253
|
+
lastTurnRef: X,
|
|
7241
7254
|
turnsCount: e.length,
|
|
7242
|
-
freezeTurnMinHeight:
|
|
7243
|
-
}),
|
|
7244
|
-
const
|
|
7245
|
-
renderToolCall:
|
|
7246
|
-
onReplyQuote:
|
|
7247
|
-
onRendered:
|
|
7248
|
-
autoScrollIntoView:
|
|
7249
|
-
renderMarkdown:
|
|
7250
|
-
},
|
|
7251
|
-
const
|
|
7252
|
-
message:
|
|
7253
|
-
inProgress:
|
|
7255
|
+
freezeTurnMinHeight: g
|
|
7256
|
+
}), i1 = (j, l1) => {
|
|
7257
|
+
const e1 = l1 === e.length - 1, d1 = {
|
|
7258
|
+
renderToolCall: l,
|
|
7259
|
+
onReplyQuote: f,
|
|
7260
|
+
onRendered: d,
|
|
7261
|
+
autoScrollIntoView: C,
|
|
7262
|
+
renderMarkdown: m
|
|
7263
|
+
}, V1 = (b, k) => {
|
|
7264
|
+
const y = {
|
|
7265
|
+
message: b,
|
|
7266
|
+
inProgress: j.isInProgress,
|
|
7254
7267
|
index: k,
|
|
7255
7268
|
isCurrentMessage: !1,
|
|
7256
|
-
AssistantMessage:
|
|
7257
|
-
UserMessage:
|
|
7258
|
-
onRegenerate:
|
|
7259
|
-
onCopy:
|
|
7260
|
-
rawData:
|
|
7261
|
-
...
|
|
7269
|
+
AssistantMessage: R,
|
|
7270
|
+
UserMessage: T,
|
|
7271
|
+
onRegenerate: S,
|
|
7272
|
+
onCopy: F,
|
|
7273
|
+
rawData: b.rawData || {},
|
|
7274
|
+
...d1
|
|
7262
7275
|
};
|
|
7263
7276
|
return /* @__PURE__ */ t(
|
|
7264
|
-
|
|
7277
|
+
T,
|
|
7265
7278
|
{
|
|
7266
|
-
...
|
|
7279
|
+
...y
|
|
7267
7280
|
},
|
|
7268
|
-
`${
|
|
7281
|
+
`${l1}-u-${k}`
|
|
7269
7282
|
);
|
|
7270
|
-
},
|
|
7271
|
-
const
|
|
7272
|
-
message:
|
|
7273
|
-
inProgress:
|
|
7274
|
-
index:
|
|
7275
|
-
isCurrentMessage:
|
|
7276
|
-
AssistantMessage:
|
|
7277
|
-
UserMessage:
|
|
7278
|
-
onRegenerate:
|
|
7279
|
-
onCopy:
|
|
7280
|
-
rawData:
|
|
7281
|
-
...
|
|
7283
|
+
}, b1 = (b, k) => {
|
|
7284
|
+
const y = e1 && k === j.assistantMessages.length - 1, D = j.userMessages.length + k, E = {
|
|
7285
|
+
message: b,
|
|
7286
|
+
inProgress: j.isInProgress,
|
|
7287
|
+
index: D,
|
|
7288
|
+
isCurrentMessage: y,
|
|
7289
|
+
AssistantMessage: R,
|
|
7290
|
+
UserMessage: T,
|
|
7291
|
+
onRegenerate: S,
|
|
7292
|
+
onCopy: F,
|
|
7293
|
+
rawData: b.rawData || {},
|
|
7294
|
+
...d1
|
|
7282
7295
|
};
|
|
7283
7296
|
return /* @__PURE__ */ t(
|
|
7284
|
-
|
|
7297
|
+
R,
|
|
7285
7298
|
{
|
|
7286
|
-
...
|
|
7287
|
-
isGenerating:
|
|
7288
|
-
isLoading:
|
|
7299
|
+
...E,
|
|
7300
|
+
isGenerating: j.isInProgress && y,
|
|
7301
|
+
isLoading: j.isInProgress && y && !b.content
|
|
7289
7302
|
},
|
|
7290
|
-
`${
|
|
7303
|
+
`${l1}-a-${k}`
|
|
7291
7304
|
);
|
|
7292
7305
|
};
|
|
7293
7306
|
return /* @__PURE__ */ i(
|
|
7294
7307
|
"div",
|
|
7295
7308
|
{
|
|
7296
|
-
ref:
|
|
7309
|
+
ref: e1 ? X : void 0,
|
|
7297
7310
|
className: x(
|
|
7298
7311
|
"flex flex-col items-start justify-start gap-2 px-1",
|
|
7299
|
-
|
|
7312
|
+
e1 && "pb-5"
|
|
7300
7313
|
),
|
|
7301
7314
|
style: {
|
|
7302
|
-
minHeight:
|
|
7315
|
+
minHeight: e1 && r1 || void 0
|
|
7303
7316
|
},
|
|
7304
7317
|
children: [
|
|
7305
|
-
|
|
7306
|
-
(
|
|
7318
|
+
j.userMessages.map(
|
|
7319
|
+
(b, k) => V1(b, k)
|
|
7307
7320
|
),
|
|
7308
|
-
|
|
7321
|
+
j.thinking && j.thinking.titles.length > 0 && /* @__PURE__ */ t(
|
|
7309
7322
|
T6,
|
|
7310
7323
|
{
|
|
7311
|
-
titles:
|
|
7312
|
-
title:
|
|
7313
|
-
inProgress:
|
|
7314
|
-
isWriting:
|
|
7324
|
+
titles: j.thinking.titles,
|
|
7325
|
+
title: P.ai.thoughtsGroupTitle,
|
|
7326
|
+
inProgress: j.thinking.inProgress,
|
|
7327
|
+
isWriting: j.thinking.isWriting
|
|
7315
7328
|
}
|
|
7316
7329
|
),
|
|
7317
|
-
|
|
7318
|
-
(
|
|
7330
|
+
j.assistantMessages.map(
|
|
7331
|
+
(b, k) => b1(b, k)
|
|
7319
7332
|
),
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7333
|
+
j.endIndicator === "thinking" && /* @__PURE__ */ t(K1, { title: P.ai.thinking, status: "executing" }),
|
|
7334
|
+
j.endIndicator === "activity" && /* @__PURE__ */ t(K1, { status: "writing" }),
|
|
7335
|
+
j.feedback && /* @__PURE__ */ t(
|
|
7323
7336
|
S6,
|
|
7324
7337
|
{
|
|
7325
|
-
content:
|
|
7326
|
-
targetMessage:
|
|
7327
|
-
onCopy:
|
|
7338
|
+
content: j.feedback.content,
|
|
7339
|
+
targetMessage: j.feedback.targetMessage,
|
|
7340
|
+
onCopy: F
|
|
7328
7341
|
}
|
|
7329
7342
|
),
|
|
7330
|
-
|
|
7343
|
+
e1 && /* @__PURE__ */ t(x6, {})
|
|
7331
7344
|
]
|
|
7332
7345
|
},
|
|
7333
|
-
`turn-${
|
|
7346
|
+
`turn-${l1}`
|
|
7334
7347
|
);
|
|
7335
7348
|
};
|
|
7336
7349
|
return /* @__PURE__ */ i(R1, { children: [
|
|
@@ -7338,7 +7351,7 @@ const O6 = {
|
|
|
7338
7351
|
/* @__PURE__ */ t(
|
|
7339
7352
|
"div",
|
|
7340
7353
|
{
|
|
7341
|
-
ref:
|
|
7354
|
+
ref: Z,
|
|
7342
7355
|
className: x(
|
|
7343
7356
|
"flex-1 overflow-y-scroll",
|
|
7344
7357
|
"[scrollbar-width:thin] [scrollbar-color:transparent_transparent]",
|
|
@@ -7350,36 +7363,37 @@ const O6 = {
|
|
|
7350
7363
|
children: /* @__PURE__ */ i(
|
|
7351
7364
|
"div",
|
|
7352
7365
|
{
|
|
7353
|
-
ref:
|
|
7366
|
+
ref: G,
|
|
7354
7367
|
className: x("flex h-full flex-col items-center p-4"),
|
|
7355
7368
|
children: [
|
|
7356
7369
|
/* @__PURE__ */ i(
|
|
7357
7370
|
"div",
|
|
7358
7371
|
{
|
|
7359
7372
|
className: x(
|
|
7360
|
-
|
|
7373
|
+
U ? "flex flex-1" : "flex flex-col gap-6",
|
|
7361
7374
|
"w-full max-w-content"
|
|
7362
7375
|
),
|
|
7363
7376
|
children: [
|
|
7364
7377
|
r && /* @__PURE__ */ t(z6, {}),
|
|
7365
|
-
|
|
7378
|
+
U && /* @__PURE__ */ t(
|
|
7366
7379
|
_6,
|
|
7367
7380
|
{
|
|
7368
|
-
messages:
|
|
7381
|
+
messages: B,
|
|
7369
7382
|
caption: s,
|
|
7370
7383
|
subtitle: a,
|
|
7371
|
-
|
|
7372
|
-
|
|
7384
|
+
cta: c,
|
|
7385
|
+
onClick: u,
|
|
7386
|
+
fullscreen: w
|
|
7373
7387
|
}
|
|
7374
7388
|
),
|
|
7375
|
-
!r && e.map((
|
|
7389
|
+
!r && e.map((j, l1) => i1(j, l1)),
|
|
7376
7390
|
o
|
|
7377
7391
|
]
|
|
7378
7392
|
}
|
|
7379
7393
|
),
|
|
7380
|
-
/* @__PURE__ */ t("div", { ref:
|
|
7381
|
-
/* @__PURE__ */ t("footer", { className: "copilotKitMessagesFooter", ref:
|
|
7382
|
-
/* @__PURE__ */ t(M1, { children:
|
|
7394
|
+
/* @__PURE__ */ t("div", { ref: t1, className: "h-px shrink-0", "aria-hidden": !0 }),
|
|
7395
|
+
/* @__PURE__ */ t("footer", { className: "copilotKitMessagesFooter", ref: J, children: M }),
|
|
7396
|
+
/* @__PURE__ */ t(M1, { children: Q && /* @__PURE__ */ t(
|
|
7383
7397
|
K.div,
|
|
7384
7398
|
{
|
|
7385
7399
|
className: "sticky bottom-2 z-10 flex justify-center",
|
|
@@ -7388,10 +7402,10 @@ const O6 = {
|
|
|
7388
7402
|
exit: { opacity: 0, scale: 0.8 },
|
|
7389
7403
|
transition: { duration: 0.2 },
|
|
7390
7404
|
children: /* @__PURE__ */ t("div", { className: "rounded bg-f1-background", children: /* @__PURE__ */ t(
|
|
7391
|
-
|
|
7405
|
+
o1,
|
|
7392
7406
|
{
|
|
7393
|
-
onClick: () =>
|
|
7394
|
-
label:
|
|
7407
|
+
onClick: () => g1(),
|
|
7408
|
+
label: P.ai.scrollToBottom,
|
|
7395
7409
|
variant: "neutral",
|
|
7396
7410
|
icon: ot,
|
|
7397
7411
|
hideLabel: !0
|
|
@@ -7404,18 +7418,18 @@ const O6 = {
|
|
|
7404
7418
|
)
|
|
7405
7419
|
}
|
|
7406
7420
|
),
|
|
7407
|
-
!
|
|
7421
|
+
!v && !U && /* @__PURE__ */ i(R1, { children: [
|
|
7408
7422
|
/* @__PURE__ */ t(ye, { position: "top" }, "shadow-top"),
|
|
7409
7423
|
/* @__PURE__ */ t(ye, { position: "bottom" }, "shadow-bottom")
|
|
7410
7424
|
] })
|
|
7411
7425
|
] }),
|
|
7412
|
-
|
|
7426
|
+
L.isOpen && /* @__PURE__ */ t(
|
|
7413
7427
|
R6,
|
|
7414
7428
|
{
|
|
7415
|
-
onSubmit:
|
|
7416
|
-
onClose:
|
|
7417
|
-
reactionType:
|
|
7418
|
-
message:
|
|
7429
|
+
onSubmit: V,
|
|
7430
|
+
onClose: H,
|
|
7431
|
+
reactionType: L.currentReaction,
|
|
7432
|
+
message: L.currentMessage
|
|
7419
7433
|
}
|
|
7420
7434
|
)
|
|
7421
7435
|
] });
|
|
@@ -7442,7 +7456,7 @@ function N9() {
|
|
|
7442
7456
|
return e;
|
|
7443
7457
|
}
|
|
7444
7458
|
function G6() {
|
|
7445
|
-
const { canvasEntities: e } =
|
|
7459
|
+
const { canvasEntities: e } = x1();
|
|
7446
7460
|
return e;
|
|
7447
7461
|
}
|
|
7448
7462
|
function S9(e) {
|
|
@@ -7461,7 +7475,7 @@ const W6 = ({
|
|
|
7461
7475
|
const c = z();
|
|
7462
7476
|
return /* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-3 p-3", children: [
|
|
7463
7477
|
/* @__PURE__ */ t("div", { className: "flex items-center", children: a && s && /* @__PURE__ */ t(
|
|
7464
|
-
|
|
7478
|
+
m1,
|
|
7465
7479
|
{
|
|
7466
7480
|
variant: "outline",
|
|
7467
7481
|
label: c.ai.clarifyingQuestion.skip,
|
|
@@ -7470,7 +7484,7 @@ const W6 = ({
|
|
|
7470
7484
|
}
|
|
7471
7485
|
) }),
|
|
7472
7486
|
/* @__PURE__ */ t(
|
|
7473
|
-
|
|
7487
|
+
m1,
|
|
7474
7488
|
{
|
|
7475
7489
|
disabled: !e || r,
|
|
7476
7490
|
variant: "default",
|
|
@@ -7501,13 +7515,13 @@ const W6 = ({
|
|
|
7501
7515
|
onToggleActive: f,
|
|
7502
7516
|
onConfirm: d
|
|
7503
7517
|
}) => {
|
|
7504
|
-
const m = z().ai.clarifyingQuestion.typeYourAnswer, h =
|
|
7518
|
+
const m = z().ai.clarifyingQuestion.typeYourAnswer, h = $(null), g = ws(h, c);
|
|
7505
7519
|
ee(() => {
|
|
7506
7520
|
const w = h.current;
|
|
7507
7521
|
if (!w) return;
|
|
7508
7522
|
w.style.height = "auto";
|
|
7509
|
-
const
|
|
7510
|
-
w.style.height = `${
|
|
7523
|
+
const M = Math.min(w.scrollHeight, Ae);
|
|
7524
|
+
w.style.height = `${M}px`, w.style.overflowY = w.scrollHeight > Ae ? "auto" : "hidden";
|
|
7511
7525
|
}, [n]);
|
|
7512
7526
|
const v = e === "single" ? /* @__PURE__ */ t(or, { isSelected: o && !r }) : /* @__PURE__ */ t(
|
|
7513
7527
|
Nt,
|
|
@@ -7620,38 +7634,38 @@ const X6 = ({
|
|
|
7620
7634
|
onToggleCustomActive: v,
|
|
7621
7635
|
onConfirm: w
|
|
7622
7636
|
}) => {
|
|
7623
|
-
const
|
|
7637
|
+
const M = C1(), N = (() => {
|
|
7624
7638
|
if (e !== "single") return 0;
|
|
7625
|
-
const V = o.findIndex((
|
|
7639
|
+
const V = o.findIndex((H) => n.includes(H.id));
|
|
7626
7640
|
return V >= 0 ? V : 0;
|
|
7627
|
-
})(), [
|
|
7641
|
+
})(), [A, S] = I(N), F = $([]);
|
|
7628
7642
|
W(() => {
|
|
7629
|
-
C && e === "single" && F.current[
|
|
7643
|
+
C && e === "single" && F.current[A]?.focus();
|
|
7630
7644
|
}, []);
|
|
7631
7645
|
const L = (V) => {
|
|
7632
7646
|
if (e !== "single") return;
|
|
7633
|
-
const
|
|
7634
|
-
if (
|
|
7635
|
-
let
|
|
7647
|
+
const H = o.length - 1;
|
|
7648
|
+
if (H < 0) return;
|
|
7649
|
+
let P = A;
|
|
7636
7650
|
switch (V.key) {
|
|
7637
7651
|
case "ArrowDown":
|
|
7638
7652
|
case "ArrowRight":
|
|
7639
|
-
|
|
7653
|
+
P = A >= H ? 0 : A + 1;
|
|
7640
7654
|
break;
|
|
7641
7655
|
case "ArrowUp":
|
|
7642
7656
|
case "ArrowLeft":
|
|
7643
|
-
|
|
7657
|
+
P = A <= 0 ? H : A - 1;
|
|
7644
7658
|
break;
|
|
7645
7659
|
case "Home":
|
|
7646
|
-
|
|
7660
|
+
P = 0;
|
|
7647
7661
|
break;
|
|
7648
7662
|
case "End":
|
|
7649
|
-
|
|
7663
|
+
P = H;
|
|
7650
7664
|
break;
|
|
7651
7665
|
default:
|
|
7652
7666
|
return;
|
|
7653
7667
|
}
|
|
7654
|
-
V.preventDefault(), S(
|
|
7668
|
+
V.preventDefault(), S(P), F.current[P]?.focus();
|
|
7655
7669
|
};
|
|
7656
7670
|
return /* @__PURE__ */ i(
|
|
7657
7671
|
"div",
|
|
@@ -7660,26 +7674,26 @@ const X6 = ({
|
|
|
7660
7674
|
role: e === "single" ? "radiogroup" : "group",
|
|
7661
7675
|
"aria-label": r,
|
|
7662
7676
|
children: [
|
|
7663
|
-
o.map((V,
|
|
7677
|
+
o.map((V, H) => /* @__PURE__ */ t(
|
|
7664
7678
|
K.div,
|
|
7665
7679
|
{
|
|
7666
|
-
initial:
|
|
7680
|
+
initial: M ? !1 : { opacity: 0, y: 4 },
|
|
7667
7681
|
animate: { opacity: 1, y: 0 },
|
|
7668
7682
|
transition: {
|
|
7669
|
-
duration:
|
|
7683
|
+
duration: M ? 0 : 0.2,
|
|
7670
7684
|
ease: [0.4, 0, 0.2, 1],
|
|
7671
|
-
delay:
|
|
7685
|
+
delay: M ? 0 : 0.12 + H * 0.06
|
|
7672
7686
|
},
|
|
7673
7687
|
children: /* @__PURE__ */ t(
|
|
7674
7688
|
nr,
|
|
7675
7689
|
{
|
|
7676
|
-
ref: (
|
|
7677
|
-
F.current[
|
|
7690
|
+
ref: (P) => {
|
|
7691
|
+
F.current[H] = P;
|
|
7678
7692
|
},
|
|
7679
7693
|
option: V,
|
|
7680
7694
|
isSelected: n.includes(V.id),
|
|
7681
7695
|
mode: e,
|
|
7682
|
-
isTabStop: e === "single" ?
|
|
7696
|
+
isTabStop: e === "single" ? H === A : void 0,
|
|
7683
7697
|
onToggle: m,
|
|
7684
7698
|
onKeyNavigate: L
|
|
7685
7699
|
}
|
|
@@ -7719,7 +7733,7 @@ const X6 = ({
|
|
|
7719
7733
|
const l = z();
|
|
7720
7734
|
return /* @__PURE__ */ i("div", { className: "flex items-start gap-0.5 pl-4 pr-3", children: [
|
|
7721
7735
|
/* @__PURE__ */ t(
|
|
7722
|
-
|
|
7736
|
+
s1,
|
|
7723
7737
|
{
|
|
7724
7738
|
className: "min-w-0 flex-1 text-lg font-semibold text-f1-foreground",
|
|
7725
7739
|
lines: 3,
|
|
@@ -7728,7 +7742,7 @@ const X6 = ({
|
|
|
7728
7742
|
),
|
|
7729
7743
|
r && /* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
7730
7744
|
/* @__PURE__ */ t(
|
|
7731
|
-
|
|
7745
|
+
m1,
|
|
7732
7746
|
{
|
|
7733
7747
|
variant: "ghost",
|
|
7734
7748
|
size: "sm",
|
|
@@ -7741,7 +7755,7 @@ const X6 = ({
|
|
|
7741
7755
|
),
|
|
7742
7756
|
/* @__PURE__ */ t("span", { className: "text-sm font-semibold text-f1-foreground-tertiary", children: r }),
|
|
7743
7757
|
/* @__PURE__ */ t(
|
|
7744
|
-
|
|
7758
|
+
m1,
|
|
7745
7759
|
{
|
|
7746
7760
|
variant: "ghost",
|
|
7747
7761
|
size: "sm",
|
|
@@ -7754,7 +7768,7 @@ const X6 = ({
|
|
|
7754
7768
|
)
|
|
7755
7769
|
] }),
|
|
7756
7770
|
/* @__PURE__ */ t(
|
|
7757
|
-
|
|
7771
|
+
m1,
|
|
7758
7772
|
{
|
|
7759
7773
|
variant: "ghost",
|
|
7760
7774
|
size: "sm",
|
|
@@ -7778,7 +7792,7 @@ const X6 = ({
|
|
|
7778
7792
|
clarifyingQuestion: e,
|
|
7779
7793
|
isSubmitDisabled: r
|
|
7780
7794
|
}) => {
|
|
7781
|
-
const o = z(), n =
|
|
7795
|
+
const o = z(), n = C1(), {
|
|
7782
7796
|
currentStep: s,
|
|
7783
7797
|
currentStepIndex: a,
|
|
7784
7798
|
totalSteps: c,
|
|
@@ -7793,30 +7807,30 @@ const X6 = ({
|
|
|
7793
7807
|
} = e, {
|
|
7794
7808
|
question: v,
|
|
7795
7809
|
options: w,
|
|
7796
|
-
selectedOptionIds:
|
|
7797
|
-
selectionMode:
|
|
7798
|
-
optional:
|
|
7810
|
+
selectedOptionIds: M,
|
|
7811
|
+
selectionMode: N,
|
|
7812
|
+
optional: A,
|
|
7799
7813
|
allowCustomAnswer: S,
|
|
7800
7814
|
customAnswerText: F,
|
|
7801
7815
|
isCustomAnswerActive: L
|
|
7802
|
-
} = s, V =
|
|
7816
|
+
} = s, V = $(null), H = N ?? "single", P = c > 1, R = a === 0, T = a === c - 1, B = P ? o.t("ai.clarifyingQuestion.stepOf", {
|
|
7803
7817
|
current: String(a + 1),
|
|
7804
7818
|
total: String(c)
|
|
7805
|
-
}) : void 0, U =
|
|
7806
|
-
|
|
7819
|
+
}) : void 0, U = M.length > 0, Z = (F ?? "").trim().length > 0, G = U || L && Z || A === !0, J = r === !0 && T, t1 = () => {
|
|
7820
|
+
J || l();
|
|
7807
7821
|
}, X = () => {
|
|
7808
|
-
|
|
7809
|
-
}, Q = (
|
|
7810
|
-
const
|
|
7811
|
-
u(
|
|
7812
|
-
}, r1 = T ? o.ai.clarifyingQuestion.submit : o.ai.clarifyingQuestion.next,
|
|
7822
|
+
J || f();
|
|
7823
|
+
}, Q = (e1) => {
|
|
7824
|
+
const d1 = H === "single" && M.includes(e1);
|
|
7825
|
+
u(e1), H === "single" && !T && !d1 && Promise.resolve().then(l);
|
|
7826
|
+
}, r1 = T ? o.ai.clarifyingQuestion.submit : o.ai.clarifyingQuestion.next, g1 = A === !0 && !U && !(L && Z), i1 = () => {
|
|
7813
7827
|
g(), requestAnimationFrame(() => {
|
|
7814
7828
|
V.current?.focus();
|
|
7815
7829
|
});
|
|
7816
|
-
},
|
|
7817
|
-
|
|
7818
|
-
},
|
|
7819
|
-
return /* @__PURE__ */ i("div", { className: "flex flex-col", onKeyDown:
|
|
7830
|
+
}, j = (e1) => {
|
|
7831
|
+
e1.key === "Escape" && (e1.preventDefault(), d());
|
|
7832
|
+
}, l1 = n ? 0 : Q6 / 2;
|
|
7833
|
+
return /* @__PURE__ */ i("div", { className: "flex flex-col", onKeyDown: j, children: [
|
|
7820
7834
|
/* @__PURE__ */ t("div", { className: "flex flex-col gap-3 pt-3", children: /* @__PURE__ */ t(M1, { mode: "wait", initial: !1, children: /* @__PURE__ */ i(
|
|
7821
7835
|
K.div,
|
|
7822
7836
|
{
|
|
@@ -7824,14 +7838,14 @@ const X6 = ({
|
|
|
7824
7838
|
initial: { opacity: 0 },
|
|
7825
7839
|
animate: { opacity: 1 },
|
|
7826
7840
|
exit: { opacity: 0 },
|
|
7827
|
-
transition: { duration:
|
|
7841
|
+
transition: { duration: l1, ease: K6 },
|
|
7828
7842
|
children: [
|
|
7829
7843
|
/* @__PURE__ */ t(
|
|
7830
7844
|
Y6,
|
|
7831
7845
|
{
|
|
7832
7846
|
question: v,
|
|
7833
|
-
stepLabel:
|
|
7834
|
-
isFirstStep:
|
|
7847
|
+
stepLabel: B,
|
|
7848
|
+
isFirstStep: R,
|
|
7835
7849
|
isFinalStep: T,
|
|
7836
7850
|
canProceed: G,
|
|
7837
7851
|
onBack: C,
|
|
@@ -7842,10 +7856,10 @@ const X6 = ({
|
|
|
7842
7856
|
/* @__PURE__ */ t(
|
|
7843
7857
|
X6,
|
|
7844
7858
|
{
|
|
7845
|
-
mode:
|
|
7859
|
+
mode: H,
|
|
7846
7860
|
question: v,
|
|
7847
7861
|
options: w,
|
|
7848
|
-
selectedOptionIds:
|
|
7862
|
+
selectedOptionIds: M,
|
|
7849
7863
|
allowCustomAnswer: S,
|
|
7850
7864
|
hasSelection: U,
|
|
7851
7865
|
hasCustomText: Z,
|
|
@@ -7854,7 +7868,7 @@ const X6 = ({
|
|
|
7854
7868
|
canProceed: G,
|
|
7855
7869
|
customInputRef: V,
|
|
7856
7870
|
onToggleOption: Q,
|
|
7857
|
-
onActivateCustom:
|
|
7871
|
+
onActivateCustom: i1,
|
|
7858
7872
|
onChangeCustomText: m,
|
|
7859
7873
|
onToggleCustomActive: h,
|
|
7860
7874
|
onConfirm: t1
|
|
@@ -7868,30 +7882,30 @@ const X6 = ({
|
|
|
7868
7882
|
W6,
|
|
7869
7883
|
{
|
|
7870
7884
|
canProceed: G,
|
|
7871
|
-
submitDisabled:
|
|
7885
|
+
submitDisabled: J,
|
|
7872
7886
|
label: r1,
|
|
7873
7887
|
onConfirm: t1,
|
|
7874
7888
|
onSkip: X,
|
|
7875
|
-
showSkip:
|
|
7889
|
+
showSkip: g1
|
|
7876
7890
|
}
|
|
7877
7891
|
)
|
|
7878
7892
|
] });
|
|
7879
7893
|
};
|
|
7880
7894
|
function Ee(e, r, o, n) {
|
|
7881
|
-
const s = Math.max(1, Math.min(e, r)), a = Math.min(o, 20), u = Math.min(a + n, s), l = Math.min(u, Math.floor(e / 2)), f = Math.min(u, Math.floor(r / 2)), d = (
|
|
7895
|
+
const s = Math.max(1, Math.min(e, r)), a = Math.min(o, 20), u = Math.min(a + n, s), l = Math.min(u, Math.floor(e / 2)), f = Math.min(u, Math.floor(r / 2)), d = (i1) => i1 / e * 2 - 1, C = (i1) => i1 / r * 2 - 1, m = 0, h = e, g = 0, v = r, w = l, M = e - l, N = f, A = r - f, S = d(m), F = d(h), L = C(g), V = C(v), H = d(w), P = d(M), R = C(N), T = C(A), B = 0, U = 0, Z = 1, G = 1, J = l / e, t1 = 1 - l / e, X = f / r, Q = 1 - f / r, r1 = new Float32Array([
|
|
7882
7896
|
// Top strip
|
|
7883
7897
|
S,
|
|
7884
7898
|
L,
|
|
7885
7899
|
F,
|
|
7886
7900
|
L,
|
|
7887
7901
|
S,
|
|
7888
|
-
|
|
7902
|
+
R,
|
|
7889
7903
|
S,
|
|
7890
|
-
|
|
7904
|
+
R,
|
|
7891
7905
|
F,
|
|
7892
7906
|
L,
|
|
7893
7907
|
F,
|
|
7894
|
-
|
|
7908
|
+
R,
|
|
7895
7909
|
// Bottom strip
|
|
7896
7910
|
S,
|
|
7897
7911
|
T,
|
|
@@ -7907,69 +7921,69 @@ function Ee(e, r, o, n) {
|
|
|
7907
7921
|
V,
|
|
7908
7922
|
// Left strip
|
|
7909
7923
|
S,
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7924
|
+
R,
|
|
7925
|
+
H,
|
|
7926
|
+
R,
|
|
7913
7927
|
S,
|
|
7914
7928
|
T,
|
|
7915
7929
|
S,
|
|
7916
7930
|
T,
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7931
|
+
H,
|
|
7932
|
+
R,
|
|
7933
|
+
H,
|
|
7920
7934
|
T,
|
|
7921
7935
|
// Right strip
|
|
7922
|
-
|
|
7923
|
-
|
|
7936
|
+
P,
|
|
7937
|
+
R,
|
|
7924
7938
|
F,
|
|
7925
|
-
|
|
7926
|
-
|
|
7939
|
+
R,
|
|
7940
|
+
P,
|
|
7927
7941
|
T,
|
|
7928
|
-
|
|
7942
|
+
P,
|
|
7929
7943
|
T,
|
|
7930
7944
|
F,
|
|
7931
|
-
|
|
7945
|
+
R,
|
|
7932
7946
|
F,
|
|
7933
7947
|
T
|
|
7934
|
-
]),
|
|
7948
|
+
]), g1 = new Float32Array([
|
|
7935
7949
|
// Top strip
|
|
7936
|
-
|
|
7950
|
+
B,
|
|
7937
7951
|
U,
|
|
7938
7952
|
Z,
|
|
7939
7953
|
U,
|
|
7940
|
-
|
|
7954
|
+
B,
|
|
7941
7955
|
X,
|
|
7942
|
-
|
|
7956
|
+
B,
|
|
7943
7957
|
X,
|
|
7944
7958
|
Z,
|
|
7945
7959
|
U,
|
|
7946
7960
|
Z,
|
|
7947
7961
|
X,
|
|
7948
7962
|
// Bottom strip
|
|
7949
|
-
|
|
7963
|
+
B,
|
|
7950
7964
|
Q,
|
|
7951
7965
|
Z,
|
|
7952
7966
|
Q,
|
|
7953
|
-
|
|
7967
|
+
B,
|
|
7954
7968
|
G,
|
|
7955
|
-
|
|
7969
|
+
B,
|
|
7956
7970
|
G,
|
|
7957
7971
|
Z,
|
|
7958
7972
|
Q,
|
|
7959
7973
|
Z,
|
|
7960
7974
|
G,
|
|
7961
7975
|
// Left strip
|
|
7962
|
-
|
|
7976
|
+
B,
|
|
7963
7977
|
X,
|
|
7964
|
-
|
|
7978
|
+
J,
|
|
7965
7979
|
X,
|
|
7966
|
-
|
|
7980
|
+
B,
|
|
7967
7981
|
Q,
|
|
7968
|
-
|
|
7982
|
+
B,
|
|
7969
7983
|
Q,
|
|
7970
|
-
|
|
7984
|
+
J,
|
|
7971
7985
|
X,
|
|
7972
|
-
|
|
7986
|
+
J,
|
|
7973
7987
|
Q,
|
|
7974
7988
|
// Right strip
|
|
7975
7989
|
t1,
|
|
@@ -7985,7 +7999,7 @@ function Ee(e, r, o, n) {
|
|
|
7985
7999
|
Z,
|
|
7986
8000
|
Q
|
|
7987
8001
|
]);
|
|
7988
|
-
return { positions: r1, uvs:
|
|
8002
|
+
return { positions: r1, uvs: g1 };
|
|
7989
8003
|
}
|
|
7990
8004
|
function $e(e, r, o) {
|
|
7991
8005
|
const n = e.createShader(r);
|
|
@@ -8314,10 +8328,10 @@ class T9 {
|
|
|
8314
8328
|
s.enableVertexAttribArray(v), s.vertexAttribPointer(v, 2, s.FLOAT, !1, 0, 0), this.checkGLError(s, "resize: after position buffer update"), s.bindBuffer(s.ARRAY_BUFFER, l), s.bufferData(s.ARRAY_BUFFER, g, s.STATIC_DRAW);
|
|
8315
8329
|
const w = s.getAttribLocation(a, "aUV");
|
|
8316
8330
|
s.enableVertexAttribArray(w), s.vertexAttribPointer(w, 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 * d), s.uniform1f(this.glr.uGlowWidth, this.options.glowWidth * d), s.uniform1f(this.glr.uBorderRadius, this.options.borderRadius * d), this.checkGLError(s, "resize: after uniform updates");
|
|
8317
|
-
const
|
|
8318
|
-
this.lastTime =
|
|
8319
|
-
const
|
|
8320
|
-
this.render(
|
|
8331
|
+
const M = performance.now();
|
|
8332
|
+
this.lastTime = M;
|
|
8333
|
+
const N = (M - this.startTime) * 1e-3;
|
|
8334
|
+
this.render(N);
|
|
8321
8335
|
}
|
|
8322
8336
|
/**
|
|
8323
8337
|
* Automatically resizes the canvas to match the dimensions of the given element.
|
|
@@ -8405,8 +8419,8 @@ class T9 {
|
|
|
8405
8419
|
r.bindBuffer(r.ARRAY_BUFFER, d), r.bufferData(r.ARRAY_BUFFER, u, r.STATIC_DRAW);
|
|
8406
8420
|
const C = r.getAttribLocation(o, "aUV");
|
|
8407
8421
|
r.enableVertexAttribArray(C), r.vertexAttribPointer(C, 2, r.FLOAT, !1, 0, 0), this.checkGLError(r, "setupGL: after UV buffer setup");
|
|
8408
|
-
const m = r.getUniformLocation(o, "uResolution"), h = r.getUniformLocation(o, "uTime"), g = r.getUniformLocation(o, "uBorderWidth"), v = r.getUniformLocation(o, "uGlowWidth"), w = r.getUniformLocation(o, "uBorderRadius"),
|
|
8409
|
-
r.useProgram(o), r.uniform1f(g, this.options.borderWidth), r.uniform1f(v, this.options.glowWidth), r.uniform1f(w, this.options.borderRadius), this.options.mode === "dark" ? (r.uniform1f(
|
|
8422
|
+
const m = r.getUniformLocation(o, "uResolution"), h = r.getUniformLocation(o, "uTime"), g = r.getUniformLocation(o, "uBorderWidth"), v = r.getUniformLocation(o, "uGlowWidth"), w = r.getUniformLocation(o, "uBorderRadius"), M = r.getUniformLocation(o, "uColors"), N = r.getUniformLocation(o, "uGlowExponent"), A = r.getUniformLocation(o, "uGlowFactor");
|
|
8423
|
+
r.useProgram(o), r.uniform1f(g, this.options.borderWidth), r.uniform1f(v, this.options.glowWidth), r.uniform1f(w, this.options.borderRadius), this.options.mode === "dark" ? (r.uniform1f(N, 2), r.uniform1f(A, 1.8)) : (r.uniform1f(N, 1), r.uniform1f(A, 1));
|
|
8410
8424
|
const S = (this.options.colors || o4).map(n4);
|
|
8411
8425
|
for (let F = 0; F < S.length; F++)
|
|
8412
8426
|
r.uniform3f(
|
|
@@ -8424,7 +8438,7 @@ class T9 {
|
|
|
8424
8438
|
uBorderWidth: g,
|
|
8425
8439
|
uGlowWidth: v,
|
|
8426
8440
|
uBorderRadius: w,
|
|
8427
|
-
uColors:
|
|
8441
|
+
uColors: M
|
|
8428
8442
|
};
|
|
8429
8443
|
}
|
|
8430
8444
|
render(r) {
|
|
@@ -8539,7 +8553,7 @@ const u4 = (e, r, o, n) => {
|
|
|
8539
8553
|
return "mat4";
|
|
8540
8554
|
default:
|
|
8541
8555
|
console.error(
|
|
8542
|
-
|
|
8556
|
+
L1(
|
|
8543
8557
|
`The uniform type "${e}" is not valid, please make sure your uniform type is valid`
|
|
8544
8558
|
)
|
|
8545
8559
|
);
|
|
@@ -8602,7 +8616,7 @@ class C4 {
|
|
|
8602
8616
|
this.pow2canvas.width,
|
|
8603
8617
|
this.pow2canvas.height
|
|
8604
8618
|
), console.warn(
|
|
8605
|
-
|
|
8619
|
+
L1(
|
|
8606
8620
|
`Image is not power of two ${r.width} x ${r.height}. Resized to ${this.pow2canvas.width} x ${this.pow2canvas.height};`
|
|
8607
8621
|
)
|
|
8608
8622
|
), this.pow2canvas) : r;
|
|
@@ -8618,7 +8632,7 @@ class C4 {
|
|
|
8618
8632
|
if (!n)
|
|
8619
8633
|
return Promise.reject(
|
|
8620
8634
|
new Error(
|
|
8621
|
-
|
|
8635
|
+
L1(
|
|
8622
8636
|
"Missing url, please make sure to pass the url of your texture { url: ... }"
|
|
8623
8637
|
)
|
|
8624
8638
|
)
|
|
@@ -8627,14 +8641,14 @@ class C4 {
|
|
|
8627
8641
|
if (f === null && d === null)
|
|
8628
8642
|
return Promise.reject(
|
|
8629
8643
|
new Error(
|
|
8630
|
-
|
|
8644
|
+
L1(
|
|
8631
8645
|
`Please upload a video or an image with a valid format (url: ${n})`
|
|
8632
8646
|
)
|
|
8633
8647
|
)
|
|
8634
8648
|
);
|
|
8635
8649
|
Object.assign(this, { url: n, wrapS: s, wrapT: a, minFilter: c, magFilter: u, flipY: l });
|
|
8636
|
-
const C = 0, m = o.RGBA, h = 1, g = 1, v = 0, w = o.RGBA,
|
|
8637
|
-
if (o.bindTexture(o.TEXTURE_2D,
|
|
8650
|
+
const C = 0, m = o.RGBA, h = 1, g = 1, v = 0, w = o.RGBA, M = o.UNSIGNED_BYTE, N = new Uint8Array([255, 255, 255, 0]), A = o.createTexture();
|
|
8651
|
+
if (o.bindTexture(o.TEXTURE_2D, A), o.texImage2D(
|
|
8638
8652
|
o.TEXTURE_2D,
|
|
8639
8653
|
C,
|
|
8640
8654
|
m,
|
|
@@ -8642,29 +8656,29 @@ class C4 {
|
|
|
8642
8656
|
g,
|
|
8643
8657
|
v,
|
|
8644
8658
|
w,
|
|
8645
|
-
|
|
8646
|
-
|
|
8659
|
+
M,
|
|
8660
|
+
N
|
|
8647
8661
|
), d) {
|
|
8648
8662
|
const V = this.setupVideo(n);
|
|
8649
|
-
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 =
|
|
8663
|
+
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 = A, this.source = V, this.isVideo = !0, V.play().then(() => this);
|
|
8650
8664
|
}
|
|
8651
8665
|
async function S() {
|
|
8652
|
-
return new Promise((V,
|
|
8653
|
-
const
|
|
8654
|
-
|
|
8655
|
-
V(
|
|
8656
|
-
},
|
|
8657
|
-
|
|
8658
|
-
},
|
|
8666
|
+
return new Promise((V, H) => {
|
|
8667
|
+
const P = new Image();
|
|
8668
|
+
P.crossOrigin = "anonymous", P.onload = () => {
|
|
8669
|
+
V(P);
|
|
8670
|
+
}, P.onerror = () => {
|
|
8671
|
+
H(new Error(L1(`failed loading url: ${n}`)));
|
|
8672
|
+
}, P.src = n ?? "";
|
|
8659
8673
|
});
|
|
8660
8674
|
}
|
|
8661
8675
|
let F = await S(), L = (F.width & F.width - 1) === 0 && (F.height & F.height - 1) === 0;
|
|
8662
|
-
return (r.wrapS !== We || r.wrapT !== We || r.minFilter !== Ge && r.minFilter !== Y1) && !L && (F = this.makePowerOf2(F), L = !0), o.bindTexture(o.TEXTURE_2D,
|
|
8676
|
+
return (r.wrapS !== We || r.wrapT !== We || r.minFilter !== Ge && r.minFilter !== Y1) && !L && (F = this.makePowerOf2(F), L = !0), o.bindTexture(o.TEXTURE_2D, A), o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, l), o.texImage2D(
|
|
8663
8677
|
o.TEXTURE_2D,
|
|
8664
8678
|
C,
|
|
8665
8679
|
m,
|
|
8666
8680
|
w,
|
|
8667
|
-
|
|
8681
|
+
M,
|
|
8668
8682
|
F
|
|
8669
8683
|
), L && r.minFilter !== Ge && r.minFilter !== Y1 && o.generateMipmap(o.TEXTURE_2D), o.texParameteri(
|
|
8670
8684
|
o.TEXTURE_2D,
|
|
@@ -8682,10 +8696,10 @@ class C4 {
|
|
|
8682
8696
|
o.TEXTURE_2D,
|
|
8683
8697
|
o.TEXTURE_MAG_FILTER,
|
|
8684
8698
|
this.magFilter || Y1
|
|
8685
|
-
), this._webglTexture =
|
|
8699
|
+
), this._webglTexture = A, this.source = F, this.isVideo = !1, this.isLoaded = !0, this.width = F.width || 0, this.height = F.height || 0, this;
|
|
8686
8700
|
};
|
|
8687
8701
|
}
|
|
8688
|
-
const
|
|
8702
|
+
const L1 = (e) => `react-shaders: ${e}`, Xe = (e) => {
|
|
8689
8703
|
if ("changedTouches" in e) {
|
|
8690
8704
|
const r = e.changedTouches[0];
|
|
8691
8705
|
return [r?.clientX ?? 0, r?.clientY ?? 0];
|
|
@@ -8707,7 +8721,7 @@ function m4({
|
|
|
8707
8721
|
onError: C = console.error,
|
|
8708
8722
|
onWarning: m = console.warn
|
|
8709
8723
|
}) {
|
|
8710
|
-
const h =
|
|
8724
|
+
const h = $(null), g = $(null), v = $(null), w = $(null), M = $(void 0), N = $(void 0), A = $(!1), S = $(void 0), F = $(0), L = $([0, 0]), V = $([]), H = $(0), P = $(void 0), R = $({
|
|
8711
8725
|
[Pe]: { type: "float", isNeeded: !1, value: 0 },
|
|
8712
8726
|
[De]: { type: "float", isNeeded: !1, value: 0 },
|
|
8713
8727
|
[je]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
|
|
@@ -8719,20 +8733,20 @@ function m4({
|
|
|
8719
8733
|
isNeeded: !1,
|
|
8720
8734
|
value: [0, 0, 0, 0]
|
|
8721
8735
|
}
|
|
8722
|
-
}), T =
|
|
8723
|
-
const
|
|
8724
|
-
if (!
|
|
8725
|
-
const O = Array.isArray(
|
|
8726
|
-
O[
|
|
8736
|
+
}), T = $(n), B = (b, k) => {
|
|
8737
|
+
const y = "width" in b ? b.width ?? 0 : 0, D = "height" in b ? b.height ?? 0 : 0, E = R.current.iChannelResolution;
|
|
8738
|
+
if (!E) return;
|
|
8739
|
+
const O = Array.isArray(E.value) ? E.value : E.value = [];
|
|
8740
|
+
O[k * 3] = y * f, O[k * 3 + 1] = D * f, O[k * 3 + 2] = 0;
|
|
8727
8741
|
}, U = () => {
|
|
8728
8742
|
h.current && (g.current = h.current.getContext("webgl", u) || h.current.getContext(
|
|
8729
8743
|
"experimental-webgl",
|
|
8730
8744
|
u
|
|
8731
8745
|
), g.current?.getExtension("OES_standard_derivatives"), g.current?.getExtension("EXT_shader_texture_lod"));
|
|
8732
8746
|
}, Z = () => {
|
|
8733
|
-
const
|
|
8734
|
-
v.current =
|
|
8735
|
-
const
|
|
8747
|
+
const b = g.current;
|
|
8748
|
+
v.current = b?.createBuffer() ?? null, b?.bindBuffer(b.ARRAY_BUFFER, v.current);
|
|
8749
|
+
const k = [
|
|
8736
8750
|
1,
|
|
8737
8751
|
1,
|
|
8738
8752
|
0,
|
|
@@ -8746,296 +8760,296 @@ function m4({
|
|
|
8746
8760
|
-1,
|
|
8747
8761
|
0
|
|
8748
8762
|
];
|
|
8749
|
-
|
|
8763
|
+
b?.bufferData(b.ARRAY_BUFFER, new Float32Array(k), b.STATIC_DRAW);
|
|
8750
8764
|
}, G = ({
|
|
8751
|
-
alpha:
|
|
8752
|
-
beta:
|
|
8753
|
-
gamma:
|
|
8765
|
+
alpha: b,
|
|
8766
|
+
beta: k,
|
|
8767
|
+
gamma: y
|
|
8754
8768
|
}) => {
|
|
8755
|
-
|
|
8769
|
+
R.current.iDeviceOrientation.value = [
|
|
8770
|
+
b ?? 0,
|
|
8756
8771
|
k ?? 0,
|
|
8757
|
-
|
|
8758
|
-
R ?? 0,
|
|
8772
|
+
y ?? 0,
|
|
8759
8773
|
window.orientation ?? 0
|
|
8760
8774
|
];
|
|
8761
|
-
},
|
|
8762
|
-
const [
|
|
8763
|
-
|
|
8764
|
-
const O = Array.isArray(
|
|
8765
|
-
O && (O[2] =
|
|
8766
|
-
}, t1 = (
|
|
8775
|
+
}, J = (b) => {
|
|
8776
|
+
const [k = 0, y = 0] = Xe(b), D = k - (S.current?.left ?? 0) - window.pageXOffset, E = (S.current?.height ?? 0) - y - (S.current?.top ?? 0) - window.pageYOffset;
|
|
8777
|
+
A.current = !0;
|
|
8778
|
+
const O = Array.isArray(R.current.iMouse?.value) ? R.current.iMouse.value : void 0;
|
|
8779
|
+
O && (O[2] = D, O[3] = E), L.current[0] = D, L.current[1] = E;
|
|
8780
|
+
}, t1 = (b) => {
|
|
8767
8781
|
S.current = h.current?.getBoundingClientRect();
|
|
8768
|
-
const [
|
|
8782
|
+
const [k = 0, y = 0] = Xe(b), D = k - (S.current?.left ?? 0), E = (S.current?.height ?? 0) - y - (S.current?.top ?? 0);
|
|
8769
8783
|
if (l !== 1)
|
|
8770
|
-
L.current[0] =
|
|
8784
|
+
L.current[0] = D, L.current[1] = E;
|
|
8771
8785
|
else {
|
|
8772
|
-
const O = Array.isArray(
|
|
8773
|
-
O && (O[0] =
|
|
8786
|
+
const O = Array.isArray(R.current.iMouse?.value) ? R.current.iMouse.value : void 0;
|
|
8787
|
+
O && (O[0] = D, O[1] = E);
|
|
8774
8788
|
}
|
|
8775
8789
|
}, X = () => {
|
|
8776
|
-
const
|
|
8777
|
-
|
|
8790
|
+
const b = Array.isArray(R.current.iMouse?.value) ? R.current.iMouse.value : void 0;
|
|
8791
|
+
b && (b[2] = 0, b[3] = 0);
|
|
8778
8792
|
}, Q = () => {
|
|
8779
|
-
const
|
|
8780
|
-
if (!
|
|
8793
|
+
const b = g.current;
|
|
8794
|
+
if (!b) return;
|
|
8781
8795
|
S.current = h.current?.getBoundingClientRect();
|
|
8782
|
-
const
|
|
8783
|
-
(S.current?.width ?? 1) *
|
|
8784
|
-
),
|
|
8785
|
-
(S.current?.height ?? 1) *
|
|
8796
|
+
const k = f, y = Math.floor(
|
|
8797
|
+
(S.current?.width ?? 1) * k
|
|
8798
|
+
), D = Math.floor(
|
|
8799
|
+
(S.current?.height ?? 1) * k
|
|
8786
8800
|
);
|
|
8787
|
-
if (
|
|
8788
|
-
const
|
|
8801
|
+
if (b.canvas.width = y, b.canvas.height = D, R.current.iResolution?.isNeeded && w.current) {
|
|
8802
|
+
const E = b.getUniformLocation(
|
|
8789
8803
|
w.current,
|
|
8790
8804
|
Oe
|
|
8791
8805
|
);
|
|
8792
|
-
|
|
8806
|
+
b.uniform2fv(E, [b.canvas.width, b.canvas.height]);
|
|
8793
8807
|
}
|
|
8794
|
-
}, r1 = (
|
|
8795
|
-
const
|
|
8796
|
-
if (!
|
|
8797
|
-
const
|
|
8798
|
-
if (!
|
|
8799
|
-
if (
|
|
8800
|
-
m?.(
|
|
8801
|
-
${
|
|
8802
|
-
const
|
|
8803
|
-
|
|
8808
|
+
}, r1 = (b, k) => {
|
|
8809
|
+
const y = g.current;
|
|
8810
|
+
if (!y) return null;
|
|
8811
|
+
const D = y.createShader(b);
|
|
8812
|
+
if (!D) return null;
|
|
8813
|
+
if (y.shaderSource(D, k), y.compileShader(D), !y.getShaderParameter(D, y.COMPILE_STATUS)) {
|
|
8814
|
+
m?.(L1(`Error compiling the shader:
|
|
8815
|
+
${k}`));
|
|
8816
|
+
const E = y.getShaderInfoLog(D);
|
|
8817
|
+
y.deleteShader(D), C?.(L1(`Shader compiler log: ${E}`));
|
|
8804
8818
|
}
|
|
8805
|
-
return
|
|
8806
|
-
},
|
|
8807
|
-
const
|
|
8808
|
-
if (!
|
|
8809
|
-
const
|
|
8810
|
-
if (w.current =
|
|
8811
|
-
if (
|
|
8819
|
+
return D;
|
|
8820
|
+
}, g1 = (b, k) => {
|
|
8821
|
+
const y = g.current;
|
|
8822
|
+
if (!y) return;
|
|
8823
|
+
const D = r1(y.FRAGMENT_SHADER, b), E = r1(y.VERTEX_SHADER, k);
|
|
8824
|
+
if (w.current = y.createProgram(), !(!w.current || !E || !D)) {
|
|
8825
|
+
if (y.attachShader(w.current, E), y.attachShader(w.current, D), y.linkProgram(w.current), !y.getProgramParameter(w.current, y.LINK_STATUS)) {
|
|
8812
8826
|
C?.(
|
|
8813
|
-
|
|
8814
|
-
`Unable to initialize the shader program: ${
|
|
8827
|
+
L1(
|
|
8828
|
+
`Unable to initialize the shader program: ${y.getProgramInfoLog(
|
|
8815
8829
|
w.current
|
|
8816
8830
|
)}`
|
|
8817
8831
|
)
|
|
8818
8832
|
);
|
|
8819
8833
|
return;
|
|
8820
8834
|
}
|
|
8821
|
-
|
|
8835
|
+
y.useProgram(w.current), M.current = y.getAttribLocation(
|
|
8822
8836
|
w.current,
|
|
8823
8837
|
"aVertexPosition"
|
|
8824
|
-
),
|
|
8838
|
+
), y.enableVertexAttribArray(M.current);
|
|
8825
8839
|
}
|
|
8826
|
-
},
|
|
8840
|
+
}, i1 = () => {
|
|
8827
8841
|
if (n)
|
|
8828
|
-
for (const
|
|
8829
|
-
const
|
|
8830
|
-
if (!
|
|
8831
|
-
const { value:
|
|
8832
|
-
if (!
|
|
8842
|
+
for (const b of Object.keys(n)) {
|
|
8843
|
+
const k = n[b];
|
|
8844
|
+
if (!k) continue;
|
|
8845
|
+
const { value: y, type: D } = k, E = f4(D);
|
|
8846
|
+
if (!E) continue;
|
|
8833
8847
|
const O = {};
|
|
8834
|
-
if (l4(
|
|
8835
|
-
const
|
|
8836
|
-
|
|
8837
|
-
} else c4(
|
|
8838
|
-
|
|
8839
|
-
type:
|
|
8848
|
+
if (l4(D, y)) {
|
|
8849
|
+
const c1 = D.length, p1 = Number.parseInt(D.charAt(c1 - 3)), k1 = Math.floor(y.length / (p1 * p1));
|
|
8850
|
+
y.length > p1 * p1 && (O.arraySize = `[${k1}]`);
|
|
8851
|
+
} else c4(D, y) && (O.arraySize = `[${Math.floor(y.length / Number.parseInt(D.charAt(0)))}]`);
|
|
8852
|
+
R.current[b] = {
|
|
8853
|
+
type: E,
|
|
8840
8854
|
isNeeded: !1,
|
|
8841
|
-
value:
|
|
8855
|
+
value: y,
|
|
8842
8856
|
...O
|
|
8843
8857
|
};
|
|
8844
8858
|
}
|
|
8845
|
-
},
|
|
8846
|
-
const
|
|
8847
|
-
if (
|
|
8859
|
+
}, j = () => {
|
|
8860
|
+
const b = g.current;
|
|
8861
|
+
if (b)
|
|
8848
8862
|
if (o && o.length > 0) {
|
|
8849
|
-
|
|
8863
|
+
R.current[`${Ue}`] = {
|
|
8850
8864
|
type: "vec3",
|
|
8851
8865
|
isNeeded: !1,
|
|
8852
8866
|
arraySize: `[${o.length}]`,
|
|
8853
8867
|
value: []
|
|
8854
8868
|
};
|
|
8855
|
-
const
|
|
8856
|
-
(
|
|
8869
|
+
const k = o.map(
|
|
8870
|
+
(y, D) => (R.current[`${i4}${D}`] = {
|
|
8857
8871
|
type: "sampler2D",
|
|
8858
8872
|
isNeeded: !1
|
|
8859
|
-
},
|
|
8860
|
-
|
|
8873
|
+
}, B(y, D), V.current[D] = new C4(b), V.current[D]?.load(y).then((E) => {
|
|
8874
|
+
B(E, D);
|
|
8861
8875
|
}))
|
|
8862
8876
|
);
|
|
8863
|
-
Promise.all(
|
|
8877
|
+
Promise.all(k).then(() => {
|
|
8864
8878
|
d && d();
|
|
8865
|
-
}).catch((
|
|
8866
|
-
C?.(
|
|
8879
|
+
}).catch((y) => {
|
|
8880
|
+
C?.(y), d && d();
|
|
8867
8881
|
});
|
|
8868
8882
|
} else d && d();
|
|
8869
|
-
},
|
|
8870
|
-
const
|
|
8883
|
+
}, l1 = (b) => {
|
|
8884
|
+
const k = Be.includes(a ?? "highp"), y = `precision ${k ? a : Be[1]} float;
|
|
8871
8885
|
`;
|
|
8872
|
-
|
|
8873
|
-
|
|
8886
|
+
k || m?.(
|
|
8887
|
+
L1(
|
|
8874
8888
|
`wrong precision type ${a}, please make sure to pass one of a valid precision lowp, mediump, highp, by default you shader precision will be set to highp.`
|
|
8875
8889
|
)
|
|
8876
8890
|
);
|
|
8877
|
-
let
|
|
8878
|
-
`).concat(
|
|
8879
|
-
for (const O of Object.keys(
|
|
8880
|
-
if (
|
|
8881
|
-
const
|
|
8882
|
-
if (!
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
`uniform ${
|
|
8891
|
+
let D = y.concat(`#define DPR ${f.toFixed(1)}
|
|
8892
|
+
`).concat(b.replace(/texture\(/g, "texture2D("));
|
|
8893
|
+
for (const O of Object.keys(R.current))
|
|
8894
|
+
if (b.includes(O)) {
|
|
8895
|
+
const c1 = R.current[O];
|
|
8896
|
+
if (!c1) continue;
|
|
8897
|
+
D = p4(
|
|
8898
|
+
D,
|
|
8899
|
+
`uniform ${c1.type} ${O}${c1.arraySize || ""};
|
|
8886
8900
|
`,
|
|
8887
|
-
|
|
8888
|
-
),
|
|
8901
|
+
D.lastIndexOf(y) + y.length
|
|
8902
|
+
), c1.isNeeded = !0;
|
|
8889
8903
|
}
|
|
8890
|
-
return
|
|
8891
|
-
},
|
|
8892
|
-
const
|
|
8893
|
-
if (!
|
|
8894
|
-
const
|
|
8895
|
-
|
|
8896
|
-
const
|
|
8897
|
-
if (
|
|
8898
|
-
for (const
|
|
8899
|
-
const O =
|
|
8900
|
-
if (O &&
|
|
8904
|
+
return b.includes("mainImage") && (D = D.concat(s4)), D;
|
|
8905
|
+
}, e1 = (b) => {
|
|
8906
|
+
const k = g.current;
|
|
8907
|
+
if (!k || !w.current) return;
|
|
8908
|
+
const y = H.current ? (b - H.current) / 1e3 : 0;
|
|
8909
|
+
H.current = b;
|
|
8910
|
+
const D = T.current;
|
|
8911
|
+
if (D)
|
|
8912
|
+
for (const E of Object.keys(D)) {
|
|
8913
|
+
const O = D[E];
|
|
8914
|
+
if (O && R.current[E]?.isNeeded) {
|
|
8901
8915
|
if (!w.current) return;
|
|
8902
|
-
const
|
|
8916
|
+
const c1 = k.getUniformLocation(
|
|
8903
8917
|
w.current,
|
|
8904
|
-
|
|
8918
|
+
E
|
|
8905
8919
|
);
|
|
8906
|
-
if (!
|
|
8920
|
+
if (!c1) return;
|
|
8907
8921
|
u4(
|
|
8908
|
-
|
|
8909
|
-
|
|
8922
|
+
k,
|
|
8923
|
+
c1,
|
|
8910
8924
|
O.type,
|
|
8911
8925
|
O.value
|
|
8912
8926
|
);
|
|
8913
8927
|
}
|
|
8914
8928
|
}
|
|
8915
|
-
if (
|
|
8916
|
-
const
|
|
8929
|
+
if (R.current.iMouse?.isNeeded) {
|
|
8930
|
+
const E = k.getUniformLocation(
|
|
8917
8931
|
w.current,
|
|
8918
8932
|
Ze
|
|
8919
8933
|
);
|
|
8920
|
-
|
|
8934
|
+
k.uniform4fv(E, R.current.iMouse.value);
|
|
8921
8935
|
}
|
|
8922
|
-
if (
|
|
8923
|
-
const
|
|
8936
|
+
if (R.current.iChannelResolution?.isNeeded) {
|
|
8937
|
+
const E = k.getUniformLocation(
|
|
8924
8938
|
w.current,
|
|
8925
8939
|
Ue
|
|
8926
8940
|
);
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8941
|
+
k.uniform3fv(
|
|
8942
|
+
E,
|
|
8943
|
+
R.current.iChannelResolution.value
|
|
8930
8944
|
);
|
|
8931
8945
|
}
|
|
8932
|
-
if (
|
|
8933
|
-
const
|
|
8946
|
+
if (R.current.iDeviceOrientation?.isNeeded) {
|
|
8947
|
+
const E = k.getUniformLocation(
|
|
8934
8948
|
w.current,
|
|
8935
8949
|
ze
|
|
8936
8950
|
);
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8951
|
+
k.uniform4fv(
|
|
8952
|
+
E,
|
|
8953
|
+
R.current.iDeviceOrientation.value
|
|
8940
8954
|
);
|
|
8941
8955
|
}
|
|
8942
|
-
if (
|
|
8943
|
-
const
|
|
8956
|
+
if (R.current.iTime?.isNeeded) {
|
|
8957
|
+
const E = k.getUniformLocation(
|
|
8944
8958
|
w.current,
|
|
8945
8959
|
Pe
|
|
8946
8960
|
);
|
|
8947
|
-
|
|
8961
|
+
k.uniform1f(E, F.current += y);
|
|
8948
8962
|
}
|
|
8949
|
-
if (
|
|
8950
|
-
const
|
|
8963
|
+
if (R.current.iTimeDelta?.isNeeded) {
|
|
8964
|
+
const E = k.getUniformLocation(
|
|
8951
8965
|
w.current,
|
|
8952
8966
|
De
|
|
8953
8967
|
);
|
|
8954
|
-
|
|
8968
|
+
k.uniform1f(E, y);
|
|
8955
8969
|
}
|
|
8956
|
-
if (
|
|
8957
|
-
const
|
|
8970
|
+
if (R.current.iDate?.isNeeded) {
|
|
8971
|
+
const E = /* @__PURE__ */ new Date(), O = E.getMonth() + 1, c1 = E.getDate(), p1 = E.getFullYear(), k1 = E.getHours() * 60 * 60 + E.getMinutes() * 60 + E.getSeconds() + E.getMilliseconds() * 1e-3, N1 = k.getUniformLocation(
|
|
8958
8972
|
w.current,
|
|
8959
8973
|
je
|
|
8960
8974
|
);
|
|
8961
|
-
|
|
8975
|
+
k.uniform4fv(N1, [p1, O, c1, k1]);
|
|
8962
8976
|
}
|
|
8963
|
-
if (
|
|
8964
|
-
const
|
|
8977
|
+
if (R.current.iFrame?.isNeeded) {
|
|
8978
|
+
const E = k.getUniformLocation(
|
|
8965
8979
|
w.current,
|
|
8966
8980
|
_e
|
|
8967
|
-
), O =
|
|
8968
|
-
|
|
8981
|
+
), O = R.current.iFrame.value;
|
|
8982
|
+
k.uniform1i(E, O), R.current.iFrame.value = O + 1;
|
|
8969
8983
|
}
|
|
8970
8984
|
if (V.current.length > 0)
|
|
8971
|
-
for (let
|
|
8972
|
-
const O = V.current[
|
|
8985
|
+
for (let E = 0; E < V.current.length; E++) {
|
|
8986
|
+
const O = V.current[E];
|
|
8973
8987
|
if (!O) return;
|
|
8974
|
-
const { isVideo:
|
|
8975
|
-
if (!T1 || !
|
|
8976
|
-
if (
|
|
8988
|
+
const { isVideo: c1, _webglTexture: p1, source: k1, flipY: N1, isLoaded: T1 } = O;
|
|
8989
|
+
if (!T1 || !p1 || !k1) return;
|
|
8990
|
+
if (R.current[`iChannel${E}`]?.isNeeded) {
|
|
8977
8991
|
if (!w.current) return;
|
|
8978
|
-
const
|
|
8992
|
+
const a1 = k.getUniformLocation(
|
|
8979
8993
|
w.current,
|
|
8980
|
-
`iChannel${
|
|
8994
|
+
`iChannel${E}`
|
|
8981
8995
|
);
|
|
8982
|
-
|
|
8983
|
-
|
|
8996
|
+
k.activeTexture(k.TEXTURE0 + E), k.bindTexture(k.TEXTURE_2D, p1), k.uniform1i(a1, E), c1 && O.updateTexture(
|
|
8997
|
+
p1,
|
|
8984
8998
|
k1,
|
|
8985
8999
|
N1
|
|
8986
9000
|
);
|
|
8987
9001
|
}
|
|
8988
9002
|
}
|
|
8989
|
-
},
|
|
8990
|
-
const
|
|
8991
|
-
if (!
|
|
8992
|
-
|
|
8993
|
-
|
|
9003
|
+
}, d1 = (b) => {
|
|
9004
|
+
const k = g.current;
|
|
9005
|
+
if (!k) return;
|
|
9006
|
+
k.viewport(0, 0, k.drawingBufferWidth, k.drawingBufferHeight), k.clear(k.COLOR_BUFFER_BIT | k.DEPTH_BUFFER_BIT), k.bindBuffer(k.ARRAY_BUFFER, v.current), k.vertexAttribPointer(
|
|
9007
|
+
M.current ?? 0,
|
|
8994
9008
|
3,
|
|
8995
|
-
|
|
9009
|
+
k.FLOAT,
|
|
8996
9010
|
!1,
|
|
8997
9011
|
0,
|
|
8998
9012
|
0
|
|
8999
|
-
),
|
|
9000
|
-
const
|
|
9001
|
-
if (
|
|
9002
|
-
const
|
|
9003
|
-
|
|
9013
|
+
), e1(b), k.drawArrays(k.TRIANGLE_STRIP, 0, 4);
|
|
9014
|
+
const y = R.current.iMouse?.value;
|
|
9015
|
+
if (R.current.iMouse?.isNeeded && l !== 1 && Array.isArray(y)) {
|
|
9016
|
+
const D = y[0] ?? 0, E = y[1] ?? 0;
|
|
9017
|
+
y[0] = Ye(D, L.current[0] ?? 0, l), y[1] = Ye(E, L.current[1] ?? 0, l);
|
|
9004
9018
|
}
|
|
9005
|
-
|
|
9019
|
+
N.current = requestAnimationFrame(d1);
|
|
9006
9020
|
}, V1 = () => {
|
|
9007
|
-
const
|
|
9008
|
-
|
|
9021
|
+
const b = { passive: !0 };
|
|
9022
|
+
R.current.iMouse?.isNeeded && h.current && (h.current.addEventListener("mousemove", t1, b), h.current.addEventListener("mouseout", X, b), h.current.addEventListener("mouseup", X, b), h.current.addEventListener("mousedown", J, b), h.current.addEventListener("touchmove", t1, b), h.current.addEventListener("touchend", X, b), h.current.addEventListener("touchstart", J, b)), R.current.iDeviceOrientation?.isNeeded && window.addEventListener(
|
|
9009
9023
|
"deviceorientation",
|
|
9010
9024
|
G,
|
|
9011
|
-
|
|
9012
|
-
), h.current && (
|
|
9013
|
-
},
|
|
9014
|
-
const
|
|
9015
|
-
|
|
9025
|
+
b
|
|
9026
|
+
), h.current && (P.current = new ResizeObserver(Q), P.current.observe(h.current), window.addEventListener("resize", Q, b));
|
|
9027
|
+
}, b1 = () => {
|
|
9028
|
+
const b = { passive: !0 };
|
|
9029
|
+
R.current.iMouse?.isNeeded && h.current && (h.current.removeEventListener("mousemove", t1, b), h.current.removeEventListener("mouseout", X, b), h.current.removeEventListener("mouseup", X, b), h.current.removeEventListener("mousedown", J, b), h.current.removeEventListener("touchmove", t1, b), h.current.removeEventListener("touchend", X, b), h.current.removeEventListener("touchstart", J, b)), R.current.iDeviceOrientation?.isNeeded && window.removeEventListener(
|
|
9016
9030
|
"deviceorientation",
|
|
9017
9031
|
G,
|
|
9018
|
-
|
|
9019
|
-
),
|
|
9032
|
+
b
|
|
9033
|
+
), P.current && (P.current.disconnect(), window.removeEventListener("resize", Q, b));
|
|
9020
9034
|
};
|
|
9021
9035
|
return W(() => {
|
|
9022
9036
|
T.current = n;
|
|
9023
9037
|
}, [n]), W(() => {
|
|
9024
|
-
const
|
|
9025
|
-
function
|
|
9038
|
+
const b = V.current;
|
|
9039
|
+
function k() {
|
|
9026
9040
|
U();
|
|
9027
|
-
const
|
|
9028
|
-
|
|
9041
|
+
const y = g.current;
|
|
9042
|
+
y && h.current && (y.clearColor(...s), y.clearDepth(1), y.enable(y.DEPTH_TEST), y.depthFunc(y.LEQUAL), y.viewport(0, 0, h.current.width, h.current.height), h.current.height = h.current.clientHeight, h.current.width = h.current.clientWidth, i1(), j(), g1(l1(e || a4), r || Ie), Z(), requestAnimationFrame(d1), V1(), Q());
|
|
9029
9043
|
}
|
|
9030
|
-
return requestAnimationFrame(
|
|
9031
|
-
const
|
|
9032
|
-
if (
|
|
9033
|
-
if (
|
|
9034
|
-
for (const
|
|
9035
|
-
|
|
9044
|
+
return requestAnimationFrame(k), () => {
|
|
9045
|
+
const y = g.current;
|
|
9046
|
+
if (y) {
|
|
9047
|
+
if (y.getExtension("WEBGL_lose_context")?.loseContext(), y.useProgram(null), y.deleteProgram(w.current ?? null), b.length > 0)
|
|
9048
|
+
for (const D of b)
|
|
9049
|
+
y.deleteTexture(D._webglTexture);
|
|
9036
9050
|
w.current = null;
|
|
9037
9051
|
}
|
|
9038
|
-
|
|
9052
|
+
b1(), cancelAnimationFrame(N.current ?? 0);
|
|
9039
9053
|
};
|
|
9040
9054
|
}, []), /* @__PURE__ */ t(
|
|
9041
9055
|
"canvas",
|
|
@@ -9212,7 +9226,7 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
|
9212
9226
|
float alpha = mappedBrightness * clamp(uMix, 1.0, 2.0);
|
|
9213
9227
|
fragColor = vec4(color, alpha);
|
|
9214
9228
|
}
|
|
9215
|
-
}`, w4 = 10, v4 = 2, L4 = 0.5, x4 = 0.2, b4 = 1.5,
|
|
9229
|
+
}`, w4 = 10, v4 = 2, L4 = 0.5, x4 = 0.2, b4 = 1.5, h1 = {
|
|
9216
9230
|
duration: 0.5,
|
|
9217
9231
|
ease: "easeOut"
|
|
9218
9232
|
}, Ke = {
|
|
@@ -9222,9 +9236,9 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
|
9222
9236
|
repeatType: "mirror"
|
|
9223
9237
|
};
|
|
9224
9238
|
function _1(e) {
|
|
9225
|
-
const [r, o] = I(e), n = Kn(e), s =
|
|
9239
|
+
const [r, o] = I(e), n = Kn(e), s = $(null);
|
|
9226
9240
|
Rs(n, "change", (c) => o(c));
|
|
9227
|
-
const a =
|
|
9241
|
+
const a = _(
|
|
9228
9242
|
(c, u) => {
|
|
9229
9243
|
s.current = Qn(n, c, u);
|
|
9230
9244
|
},
|
|
@@ -9246,19 +9260,19 @@ function k4(e, r) {
|
|
|
9246
9260
|
case "idle":
|
|
9247
9261
|
case "failed":
|
|
9248
9262
|
case "disconnected":
|
|
9249
|
-
n(10), a(0.2,
|
|
9263
|
+
n(10), a(0.2, h1), l(1.2, h1), d(0.4, h1), m(1, h1);
|
|
9250
9264
|
return;
|
|
9251
9265
|
case "listening":
|
|
9252
9266
|
case "pre-connect-buffering":
|
|
9253
|
-
n(20), a(0.3, { type: "spring", duration: 1, bounce: 0.35 }), l(1,
|
|
9267
|
+
n(20), a(0.3, { type: "spring", duration: 1, bounce: 0.35 }), l(1, h1), d(0.7, h1), m([1.5, 2], Ke);
|
|
9254
9268
|
return;
|
|
9255
9269
|
case "thinking":
|
|
9256
9270
|
case "connecting":
|
|
9257
9271
|
case "initializing":
|
|
9258
|
-
n(30), a(0.3,
|
|
9272
|
+
n(30), a(0.3, h1), l(0.5, h1), d(1, h1), m([0.5, 2.5], Ke);
|
|
9259
9273
|
return;
|
|
9260
9274
|
case "speaking":
|
|
9261
|
-
n(70), a(0.3,
|
|
9275
|
+
n(70), a(0.3, h1), l(0.75, h1), d(1.25, h1), m(1.5, h1);
|
|
9262
9276
|
return;
|
|
9263
9277
|
}
|
|
9264
9278
|
}, [
|
|
@@ -9457,7 +9471,7 @@ const A9 = ({
|
|
|
9457
9471
|
isRevealed: r,
|
|
9458
9472
|
onAskOne: o
|
|
9459
9473
|
}) => {
|
|
9460
|
-
const n = z(), s =
|
|
9474
|
+
const n = z(), s = C1();
|
|
9461
9475
|
return /* @__PURE__ */ i(R1, { children: [
|
|
9462
9476
|
e && /* @__PURE__ */ t("span", { className: x(F4(), "truncate"), children: e }),
|
|
9463
9477
|
/* @__PURE__ */ t(M1, { children: o && r && /* @__PURE__ */ t(
|
|
@@ -9687,12 +9701,12 @@ const A4 = ({
|
|
|
9687
9701
|
onAskOne: u,
|
|
9688
9702
|
className: l,
|
|
9689
9703
|
...f
|
|
9690
|
-
} = e, [d, C] = I(!1), [m, h] = I(!1), g = d || m, v =
|
|
9704
|
+
} = e, [d, C] = I(!1), [m, h] = I(!1), g = d || m, v = C1(), w = g && !!u, M = {
|
|
9691
9705
|
duration: v ? 0 : 0.2,
|
|
9692
9706
|
ease: [0.33, 1, 0.68, 1]
|
|
9693
|
-
},
|
|
9707
|
+
}, N = () => {
|
|
9694
9708
|
c?.();
|
|
9695
|
-
},
|
|
9709
|
+
}, A = (S) => {
|
|
9696
9710
|
S.currentTarget === S.target && (S.key === "Enter" || S.key === " ") && (S.preventDefault(), c?.());
|
|
9697
9711
|
};
|
|
9698
9712
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
@@ -9735,8 +9749,8 @@ const A4 = ({
|
|
|
9735
9749
|
c && f1(),
|
|
9736
9750
|
l
|
|
9737
9751
|
),
|
|
9738
|
-
onClick: c ?
|
|
9739
|
-
onKeyDown: c ?
|
|
9752
|
+
onClick: c ? N : void 0,
|
|
9753
|
+
onKeyDown: c ? A : void 0,
|
|
9740
9754
|
onMouseEnter: () => C(!0),
|
|
9741
9755
|
onMouseLeave: () => C(!1),
|
|
9742
9756
|
onFocus: () => h(!0),
|
|
@@ -9757,7 +9771,7 @@ const A4 = ({
|
|
|
9757
9771
|
{
|
|
9758
9772
|
className: "-ml-4 flex flex-1 flex-col",
|
|
9759
9773
|
animate: { opacity: w ? 0 : 1 },
|
|
9760
|
-
transition:
|
|
9774
|
+
transition: M,
|
|
9761
9775
|
children: /* @__PURE__ */ t(
|
|
9762
9776
|
$4,
|
|
9763
9777
|
{
|
|
@@ -9774,7 +9788,7 @@ const A4 = ({
|
|
|
9774
9788
|
heading: n,
|
|
9775
9789
|
label: s,
|
|
9776
9790
|
shouldFadeContent: w,
|
|
9777
|
-
fadeTransition:
|
|
9791
|
+
fadeTransition: M,
|
|
9778
9792
|
...f
|
|
9779
9793
|
}
|
|
9780
9794
|
)
|
|
@@ -9836,7 +9850,7 @@ function Z4(e) {
|
|
|
9836
9850
|
description: a,
|
|
9837
9851
|
seeMoreLabel: c,
|
|
9838
9852
|
maxCollapsedDescriptionLength: u = dr
|
|
9839
|
-
} = e, [l, f] = I(!1), d = O1(), C =
|
|
9853
|
+
} = e, [l, f] = I(!1), d = O1(), C = $(null), m = P4(
|
|
9840
9854
|
u
|
|
9841
9855
|
), h = a.length > m, g = l ? a : D4(a, m), v = j4(e) ? e : null, w = _4(e);
|
|
9842
9856
|
return W(() => {
|
|
@@ -9891,7 +9905,7 @@ function Z4(e) {
|
|
|
9891
9905
|
)
|
|
9892
9906
|
] }),
|
|
9893
9907
|
v && /* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-3 border-0 border-t border-solid border-f1-border-secondary px-4 py-3", children: /* @__PURE__ */ t(
|
|
9894
|
-
|
|
9908
|
+
m1,
|
|
9895
9909
|
{
|
|
9896
9910
|
type: "button",
|
|
9897
9911
|
label: v.primaryActionLabel,
|
|
@@ -9909,7 +9923,7 @@ const O4 = ({
|
|
|
9909
9923
|
title: r,
|
|
9910
9924
|
children: o
|
|
9911
9925
|
}) => {
|
|
9912
|
-
const [n, s] = I(!1), a =
|
|
9926
|
+
const [n, s] = I(!1), a = C1();
|
|
9913
9927
|
return /* @__PURE__ */ i(
|
|
9914
9928
|
Mt,
|
|
9915
9929
|
{
|
|
@@ -9918,10 +9932,10 @@ const O4 = ({
|
|
|
9918
9932
|
onOpenChange: s,
|
|
9919
9933
|
children: [
|
|
9920
9934
|
/* @__PURE__ */ i(Rt, { className: "flex w-full items-center text-base text-f1-foreground-secondary transition-colors duration-150 hover:text-f1-foreground [&[data-state=open]>svg]:rotate-90", children: [
|
|
9921
|
-
/* @__PURE__ */ t("span", { className: "mr-2 *:block", children: /* @__PURE__ */ t(
|
|
9935
|
+
/* @__PURE__ */ t("span", { className: "mr-2 *:block", children: /* @__PURE__ */ t(n1, { icon: e, className: "block" }) }),
|
|
9922
9936
|
/* @__PURE__ */ t("span", { className: "mr-[2px]", children: r }),
|
|
9923
9937
|
/* @__PURE__ */ t(
|
|
9924
|
-
|
|
9938
|
+
n1,
|
|
9925
9939
|
{
|
|
9926
9940
|
icon: z1,
|
|
9927
9941
|
className: "h-4 w-4 transition-transform duration-200"
|
|
@@ -9948,7 +9962,7 @@ const O4 = ({
|
|
|
9948
9962
|
]
|
|
9949
9963
|
}
|
|
9950
9964
|
);
|
|
9951
|
-
}, U4 = (e) => c2[e] ?? ct, z4 = ({ iconName: e }) => e ? /* @__PURE__ */ t("div", { className: "mr-1 flex items-center justify-center", children: /* @__PURE__ */ t(
|
|
9965
|
+
}, U4 = (e) => c2[e] ?? ct, z4 = ({ iconName: e }) => e ? /* @__PURE__ */ t("div", { className: "mr-1 flex items-center justify-center", children: /* @__PURE__ */ t(n1, { icon: U4(e), size: "md", color: "default" }) }) : null;
|
|
9952
9966
|
function G4({
|
|
9953
9967
|
sources: e,
|
|
9954
9968
|
title: r
|
|
@@ -9996,7 +10010,7 @@ function q4({
|
|
|
9996
10010
|
title: r,
|
|
9997
10011
|
filename: o
|
|
9998
10012
|
}) {
|
|
9999
|
-
const n = z(), s =
|
|
10013
|
+
const n = z(), s = $(null), a = r ?? n.ai.aiTable.title, c = _(
|
|
10000
10014
|
(u) => {
|
|
10001
10015
|
if (!s.current) return;
|
|
10002
10016
|
const l = o ?? (a.replace(/\s+/g, "_").toLowerCase() || "table");
|
|
@@ -10028,7 +10042,7 @@ function q4({
|
|
|
10028
10042
|
paddingY: "sm",
|
|
10029
10043
|
children: [
|
|
10030
10044
|
/* @__PURE__ */ t(
|
|
10031
|
-
|
|
10045
|
+
s1,
|
|
10032
10046
|
{
|
|
10033
10047
|
tag: "h2",
|
|
10034
10048
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
@@ -10080,7 +10094,7 @@ function q4({
|
|
|
10080
10094
|
"td",
|
|
10081
10095
|
{
|
|
10082
10096
|
className: "max-w-72 border-0 border-b border-solid border-f1-border-secondary px-3 py-2 text-f1-foreground",
|
|
10083
|
-
children: /* @__PURE__ */ t(
|
|
10097
|
+
children: /* @__PURE__ */ t(s1, { children: d == null ? "" : String(d) })
|
|
10084
10098
|
},
|
|
10085
10099
|
f
|
|
10086
10100
|
);
|
|
@@ -10094,7 +10108,7 @@ function q4({
|
|
|
10094
10108
|
}
|
|
10095
10109
|
q4.displayName = "F0AiTableCard";
|
|
10096
10110
|
function X4({ credits: e, trigger: r }) {
|
|
10097
|
-
const o = z(), [n, s] = I(!1), [a, c] = I(!1), [u, l] = I(!1), [f, d] = I(null), C =
|
|
10111
|
+
const o = z(), [n, s] = I(!1), [a, c] = I(!1), [u, l] = I(!1), [f, d] = I(null), C = _(
|
|
10098
10112
|
(g) => {
|
|
10099
10113
|
s(g), g && e?.fetchUsage && (c(!0), l(!1), e.fetchUsage().then((v) => {
|
|
10100
10114
|
d(v), l(!1);
|
|
@@ -10110,7 +10124,7 @@ function X4({ credits: e, trigger: r }) {
|
|
|
10110
10124
|
const m = f ? Math.min(100, Math.round(f.used / f.total * 100)) : 0, h = e.companyName;
|
|
10111
10125
|
return /* @__PURE__ */ i(ae, { open: n, onOpenChange: C, children: [
|
|
10112
10126
|
/* @__PURE__ */ t(St, { asChild: !0, children: r ?? /* @__PURE__ */ t(
|
|
10113
|
-
|
|
10127
|
+
o1,
|
|
10114
10128
|
{
|
|
10115
10129
|
variant: "ghost",
|
|
10116
10130
|
hideLabel: !0,
|
|
@@ -10139,9 +10153,9 @@ function X4({ credits: e, trigger: r }) {
|
|
|
10139
10153
|
}
|
|
10140
10154
|
),
|
|
10141
10155
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 flex-col", children: [
|
|
10142
|
-
/* @__PURE__ */ t(
|
|
10156
|
+
/* @__PURE__ */ t(s1, { tag: "span", className: "font-medium", children: e.companyName ?? "" }),
|
|
10143
10157
|
e.planName && /* @__PURE__ */ t(
|
|
10144
|
-
|
|
10158
|
+
s1,
|
|
10145
10159
|
{
|
|
10146
10160
|
tag: "span",
|
|
10147
10161
|
className: "text-sm font-medium text-f1-foreground-secondary",
|
|
@@ -10203,7 +10217,7 @@ function X4({ credits: e, trigger: r }) {
|
|
|
10203
10217
|
e.upgradePlanUrl && /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-0 border-t border-solid border-f1-border-secondary p-3", children: [
|
|
10204
10218
|
/* @__PURE__ */ t("span", { children: o.t("ai.credits.needMoreCredits") }),
|
|
10205
10219
|
/* @__PURE__ */ t(
|
|
10206
|
-
|
|
10220
|
+
m1,
|
|
10207
10221
|
{
|
|
10208
10222
|
variant: "outlinePromote",
|
|
10209
10223
|
href: e.upgradePlanUrl,
|
|
@@ -10223,10 +10237,10 @@ function K4({
|
|
|
10223
10237
|
employeeCredits: e,
|
|
10224
10238
|
trigger: r
|
|
10225
10239
|
}) {
|
|
10226
|
-
const o = z(), n =
|
|
10240
|
+
const o = z(), n = C1(), [s, a] = I(!1), [c, u] = I(!1), [l, f] = I(!1), [d, C] = I(null), m = _(
|
|
10227
10241
|
(w) => {
|
|
10228
|
-
a(w), w && e?.fetchUsage && (u(!0), f(!1), e.fetchUsage().then((
|
|
10229
|
-
C(
|
|
10242
|
+
a(w), w && e?.fetchUsage && (u(!0), f(!1), e.fetchUsage().then((M) => {
|
|
10243
|
+
C(M), f(!1);
|
|
10230
10244
|
}).catch(() => {
|
|
10231
10245
|
f(!0);
|
|
10232
10246
|
}).finally(() => {
|
|
@@ -10239,7 +10253,7 @@ function K4({
|
|
|
10239
10253
|
const h = !!e.companyName, g = d && d.total > 0 ? Math.min(100, Math.round(d.used / d.total * 100)) : 0, v = d ? Math.max(0, d.total - d.used) : 0;
|
|
10240
10254
|
return /* @__PURE__ */ i(ae, { open: s, onOpenChange: m, children: [
|
|
10241
10255
|
/* @__PURE__ */ t(St, { asChild: !0, children: r ?? /* @__PURE__ */ t(
|
|
10242
|
-
|
|
10256
|
+
o1,
|
|
10243
10257
|
{
|
|
10244
10258
|
variant: "ghost",
|
|
10245
10259
|
hideLabel: !0,
|
|
@@ -10268,9 +10282,9 @@ function K4({
|
|
|
10268
10282
|
}
|
|
10269
10283
|
),
|
|
10270
10284
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 flex-col", children: [
|
|
10271
|
-
/* @__PURE__ */ t(
|
|
10285
|
+
/* @__PURE__ */ t(s1, { tag: "span", className: "font-medium", children: e.companyName ?? "" }),
|
|
10272
10286
|
e.planName && /* @__PURE__ */ t(
|
|
10273
|
-
|
|
10287
|
+
s1,
|
|
10274
10288
|
{
|
|
10275
10289
|
tag: "span",
|
|
10276
10290
|
className: "text-sm font-medium text-f1-foreground-secondary",
|
|
@@ -10362,10 +10376,10 @@ const J1 = ({
|
|
|
10362
10376
|
compact: m = !1,
|
|
10363
10377
|
actions: h
|
|
10364
10378
|
}) => {
|
|
10365
|
-
const g = z(), v =
|
|
10379
|
+
const g = z(), v = C1(), w = ds(`(max-width: ${us.md}px)`, {
|
|
10366
10380
|
initializeWithValue: !0
|
|
10367
|
-
}),
|
|
10368
|
-
|
|
10381
|
+
}), M = !s && !w && /* @__PURE__ */ t(
|
|
10382
|
+
o1,
|
|
10369
10383
|
{
|
|
10370
10384
|
variant: "ghost",
|
|
10371
10385
|
hideLabel: !0,
|
|
@@ -10373,8 +10387,8 @@ const J1 = ({
|
|
|
10373
10387
|
icon: n ? ft : dt,
|
|
10374
10388
|
onClick: a
|
|
10375
10389
|
}
|
|
10376
|
-
),
|
|
10377
|
-
|
|
10390
|
+
), N = /* @__PURE__ */ t(
|
|
10391
|
+
o1,
|
|
10378
10392
|
{
|
|
10379
10393
|
variant: "ghost",
|
|
10380
10394
|
hideLabel: !0,
|
|
@@ -10382,8 +10396,8 @@ const J1 = ({
|
|
|
10382
10396
|
icon: F1,
|
|
10383
10397
|
onClick: c
|
|
10384
10398
|
}
|
|
10385
|
-
),
|
|
10386
|
-
|
|
10399
|
+
), A = h?.map((S) => /* @__PURE__ */ t(
|
|
10400
|
+
o1,
|
|
10387
10401
|
{
|
|
10388
10402
|
variant: "ghost",
|
|
10389
10403
|
hideLabel: !0,
|
|
@@ -10400,7 +10414,7 @@ const J1 = ({
|
|
|
10400
10414
|
className: x("flex items-center justify-between gap-3 pr-4 pl-5 py-3"),
|
|
10401
10415
|
children: [
|
|
10402
10416
|
/* @__PURE__ */ t(
|
|
10403
|
-
|
|
10417
|
+
s1,
|
|
10404
10418
|
{
|
|
10405
10419
|
lines: 1,
|
|
10406
10420
|
className: "min-w-0 flex-1 text-left font-semibold text-f1-foreground",
|
|
@@ -10418,9 +10432,9 @@ const J1 = ({
|
|
|
10418
10432
|
ease: "easeOut"
|
|
10419
10433
|
},
|
|
10420
10434
|
children: [
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10435
|
+
A,
|
|
10436
|
+
M,
|
|
10437
|
+
N
|
|
10424
10438
|
]
|
|
10425
10439
|
}
|
|
10426
10440
|
)
|
|
@@ -10441,8 +10455,8 @@ const J1 = ({
|
|
|
10441
10455
|
className: "min-w-0 max-w-full [&>div>span>span]:w-full",
|
|
10442
10456
|
onClick: l,
|
|
10443
10457
|
children: /* @__PURE__ */ i("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
10444
|
-
/* @__PURE__ */ t(
|
|
10445
|
-
/* @__PURE__ */ t(
|
|
10458
|
+
/* @__PURE__ */ t(s1, { lines: 1, className: "min-w-0 text-left", children: o ?? g.ai.newConversation }),
|
|
10459
|
+
/* @__PURE__ */ t(n1, { icon: re, color: "default", size: "md" })
|
|
10446
10460
|
] })
|
|
10447
10461
|
}
|
|
10448
10462
|
) }),
|
|
@@ -10464,9 +10478,9 @@ const J1 = ({
|
|
|
10464
10478
|
employeeCredits: C
|
|
10465
10479
|
}
|
|
10466
10480
|
),
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10481
|
+
A,
|
|
10482
|
+
M,
|
|
10483
|
+
N
|
|
10470
10484
|
]
|
|
10471
10485
|
}
|
|
10472
10486
|
)
|
|
@@ -10486,7 +10500,7 @@ const J1 = ({
|
|
|
10486
10500
|
},
|
|
10487
10501
|
children: [
|
|
10488
10502
|
f && !s && /* @__PURE__ */ t(
|
|
10489
|
-
|
|
10503
|
+
o1,
|
|
10490
10504
|
{
|
|
10491
10505
|
variant: "ghost",
|
|
10492
10506
|
hideLabel: !0,
|
|
@@ -10502,9 +10516,9 @@ const J1 = ({
|
|
|
10502
10516
|
employeeCredits: C
|
|
10503
10517
|
}
|
|
10504
10518
|
),
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10519
|
+
A,
|
|
10520
|
+
M,
|
|
10521
|
+
N
|
|
10508
10522
|
]
|
|
10509
10523
|
}
|
|
10510
10524
|
)
|
|
@@ -10597,7 +10611,7 @@ function t9({
|
|
|
10597
10611
|
onClick: () => s(e.id, e.title),
|
|
10598
10612
|
children: [
|
|
10599
10613
|
e.icon && /* @__PURE__ */ t(
|
|
10600
|
-
|
|
10614
|
+
n1,
|
|
10601
10615
|
{
|
|
10602
10616
|
icon: e.icon,
|
|
10603
10617
|
size: "sm",
|
|
@@ -10605,7 +10619,7 @@ function t9({
|
|
|
10605
10619
|
"aria-hidden": !0
|
|
10606
10620
|
}
|
|
10607
10621
|
),
|
|
10608
|
-
/* @__PURE__ */ t(
|
|
10622
|
+
/* @__PURE__ */ t(s1, { lines: 1, className: "py-0.5 text-left font-medium", children: e.title }),
|
|
10609
10623
|
/* @__PURE__ */ t("span", { className: "hidden shrink-0 text-sm font-medium text-f1-foreground-tertiary group-focus-within:inline group-hover:inline", children: m })
|
|
10610
10624
|
]
|
|
10611
10625
|
}
|
|
@@ -10634,7 +10648,7 @@ function t9({
|
|
|
10634
10648
|
"has-[[aria-expanded=true]]:flex"
|
|
10635
10649
|
),
|
|
10636
10650
|
children: /* @__PURE__ */ t(le, { items: C, children: /* @__PURE__ */ t(
|
|
10637
|
-
|
|
10651
|
+
o1,
|
|
10638
10652
|
{
|
|
10639
10653
|
icon: lt,
|
|
10640
10654
|
variant: "ghost",
|
|
@@ -10658,9 +10672,9 @@ function Qe({
|
|
|
10658
10672
|
onUnpin: a,
|
|
10659
10673
|
onDelete: c
|
|
10660
10674
|
}) {
|
|
10661
|
-
const [u, l] = I(!0), f =
|
|
10675
|
+
const [u, l] = I(!0), f = _(() => {
|
|
10662
10676
|
l((C) => !C);
|
|
10663
|
-
}, []), d =
|
|
10677
|
+
}, []), d = _(
|
|
10664
10678
|
(C) => {
|
|
10665
10679
|
(C.key === "Enter" || C.key === " ") && (C.preventDefault(), f());
|
|
10666
10680
|
},
|
|
@@ -10681,7 +10695,7 @@ function Qe({
|
|
|
10681
10695
|
children: [
|
|
10682
10696
|
/* @__PURE__ */ t("span", { className: "text-sm font-medium capitalize tracking-wide text-f1-foreground-secondary", children: e }),
|
|
10683
10697
|
/* @__PURE__ */ t(
|
|
10684
|
-
|
|
10698
|
+
n1,
|
|
10685
10699
|
{
|
|
10686
10700
|
icon: u ? re : at,
|
|
10687
10701
|
color: "secondary",
|
|
@@ -10760,22 +10774,22 @@ const P9 = ({
|
|
|
10760
10774
|
), w = Y(
|
|
10761
10775
|
() => g.filter((L) => !c.has(L.id)),
|
|
10762
10776
|
[g, c]
|
|
10763
|
-
),
|
|
10777
|
+
), M = Y(
|
|
10764
10778
|
() => e9(w),
|
|
10765
10779
|
[w]
|
|
10766
|
-
),
|
|
10780
|
+
), N = _(
|
|
10767
10781
|
(L, V) => {
|
|
10768
10782
|
r(L, V), e();
|
|
10769
10783
|
},
|
|
10770
10784
|
[r, e]
|
|
10771
|
-
),
|
|
10785
|
+
), A = _(() => {
|
|
10772
10786
|
o(), e();
|
|
10773
|
-
}, [o, e]), S =
|
|
10787
|
+
}, [o, e]), S = _(
|
|
10774
10788
|
(L) => {
|
|
10775
10789
|
f(L);
|
|
10776
10790
|
},
|
|
10777
10791
|
[f]
|
|
10778
|
-
), F = v.length > 0 ||
|
|
10792
|
+
), F = v.length > 0 || M.length > 0;
|
|
10779
10793
|
return Ht(
|
|
10780
10794
|
/* @__PURE__ */ i(R1, { children: [
|
|
10781
10795
|
/* @__PURE__ */ t(
|
|
@@ -10807,7 +10821,7 @@ const P9 = ({
|
|
|
10807
10821
|
),
|
|
10808
10822
|
children: [
|
|
10809
10823
|
/* @__PURE__ */ i("div", { className: "flex flex-shrink-0 items-center gap-2 border-0 border-b border-solid border-f1-border-secondary py-2 pl-5 pr-3", children: [
|
|
10810
|
-
/* @__PURE__ */ t(
|
|
10824
|
+
/* @__PURE__ */ t(n1, { icon: ne, color: "secondary", size: "md" }),
|
|
10811
10825
|
/* @__PURE__ */ t(
|
|
10812
10826
|
"input",
|
|
10813
10827
|
{
|
|
@@ -10831,10 +10845,10 @@ const P9 = ({
|
|
|
10831
10845
|
variant: "ghost",
|
|
10832
10846
|
size: "md",
|
|
10833
10847
|
className: "py-1 [&>div>span>span]:w-full",
|
|
10834
|
-
onClick:
|
|
10848
|
+
onClick: A,
|
|
10835
10849
|
children: /* @__PURE__ */ i("div", { className: "flex w-full items-center gap-2", children: [
|
|
10836
|
-
/* @__PURE__ */ t(
|
|
10837
|
-
/* @__PURE__ */ t(
|
|
10850
|
+
/* @__PURE__ */ t(n1, { icon: de, color: "default", size: "md" }),
|
|
10851
|
+
/* @__PURE__ */ t(s1, { lines: 1, className: "text-left", children: d.ai.startNewChat })
|
|
10838
10852
|
] })
|
|
10839
10853
|
}
|
|
10840
10854
|
),
|
|
@@ -10847,19 +10861,19 @@ const P9 = ({
|
|
|
10847
10861
|
label: d.ai.pinnedChats,
|
|
10848
10862
|
threads: v,
|
|
10849
10863
|
pinnedIds: c,
|
|
10850
|
-
onSelect:
|
|
10864
|
+
onSelect: N,
|
|
10851
10865
|
onPin: u,
|
|
10852
10866
|
onUnpin: l,
|
|
10853
10867
|
onDelete: S
|
|
10854
10868
|
}
|
|
10855
10869
|
),
|
|
10856
|
-
!s && !a &&
|
|
10870
|
+
!s && !a && M.map((L) => /* @__PURE__ */ t(
|
|
10857
10871
|
Qe,
|
|
10858
10872
|
{
|
|
10859
10873
|
label: h[L.key],
|
|
10860
10874
|
threads: L.threads,
|
|
10861
10875
|
pinnedIds: c,
|
|
10862
|
-
onSelect:
|
|
10876
|
+
onSelect: N,
|
|
10863
10877
|
onPin: u,
|
|
10864
10878
|
onUnpin: l,
|
|
10865
10879
|
onDelete: S
|
|
@@ -10890,7 +10904,7 @@ function D9({
|
|
|
10890
10904
|
pinThread: n,
|
|
10891
10905
|
unpinThread: s
|
|
10892
10906
|
}) {
|
|
10893
|
-
const [a, c] = I([]), [u, l] = I(!1), [f, d] = I(null), [C, m] = I(n9), [h, g] = I(() => /* @__PURE__ */ new Set()), v =
|
|
10907
|
+
const [a, c] = I([]), [u, l] = I(!1), [f, d] = I(null), [C, m] = I(n9), [h, g] = I(() => /* @__PURE__ */ new Set()), v = _(async () => {
|
|
10894
10908
|
l(!0), d(null);
|
|
10895
10909
|
try {
|
|
10896
10910
|
const L = await r();
|
|
@@ -10905,43 +10919,43 @@ function D9({
|
|
|
10905
10919
|
W(() => {
|
|
10906
10920
|
e && v();
|
|
10907
10921
|
}, [e, v]);
|
|
10908
|
-
const w =
|
|
10909
|
-
m((
|
|
10910
|
-
if (V ===
|
|
10911
|
-
const
|
|
10912
|
-
return V ?
|
|
10922
|
+
const w = _((L, V) => {
|
|
10923
|
+
m((H) => {
|
|
10924
|
+
if (V === H.has(L)) return H;
|
|
10925
|
+
const P = new Set(H);
|
|
10926
|
+
return V ? P.add(L) : P.delete(L), tt(P), P;
|
|
10913
10927
|
});
|
|
10914
|
-
}, []),
|
|
10915
|
-
g((
|
|
10916
|
-
if (V ===
|
|
10917
|
-
const
|
|
10918
|
-
return V ?
|
|
10928
|
+
}, []), M = _((L, V) => {
|
|
10929
|
+
g((H) => {
|
|
10930
|
+
if (V === H.has(L)) return H;
|
|
10931
|
+
const P = new Set(H);
|
|
10932
|
+
return V ? P.add(L) : P.delete(L), P;
|
|
10919
10933
|
});
|
|
10920
|
-
}, []),
|
|
10934
|
+
}, []), N = _(
|
|
10921
10935
|
(L, V) => {
|
|
10922
|
-
const
|
|
10923
|
-
w(L, V),
|
|
10936
|
+
const H = V ? n : s;
|
|
10937
|
+
w(L, V), H && (M(L, !0), H(L).catch(() => w(L, !V)).finally(() => M(L, !1)));
|
|
10924
10938
|
},
|
|
10925
|
-
[n, s, w,
|
|
10926
|
-
),
|
|
10927
|
-
(L) =>
|
|
10928
|
-
[
|
|
10929
|
-
), F =
|
|
10939
|
+
[n, s, w, M]
|
|
10940
|
+
), A = _((L) => N(L, !0), [N]), S = _(
|
|
10941
|
+
(L) => N(L, !1),
|
|
10942
|
+
[N]
|
|
10943
|
+
), F = _(
|
|
10930
10944
|
async (L) => {
|
|
10931
|
-
|
|
10945
|
+
M(L, !0);
|
|
10932
10946
|
try {
|
|
10933
|
-
await o(L), c((V) => V.filter((
|
|
10947
|
+
await o(L), c((V) => V.filter((H) => H.id !== L)), m((V) => {
|
|
10934
10948
|
if (!V.has(L)) return V;
|
|
10935
|
-
const
|
|
10936
|
-
return
|
|
10949
|
+
const H = new Set(V);
|
|
10950
|
+
return H.delete(L), tt(H), H;
|
|
10937
10951
|
});
|
|
10938
10952
|
} catch {
|
|
10939
10953
|
v();
|
|
10940
10954
|
} finally {
|
|
10941
|
-
|
|
10955
|
+
M(L, !1);
|
|
10942
10956
|
}
|
|
10943
10957
|
},
|
|
10944
|
-
[o, v,
|
|
10958
|
+
[o, v, M]
|
|
10945
10959
|
);
|
|
10946
10960
|
return {
|
|
10947
10961
|
threads: a,
|
|
@@ -10950,7 +10964,7 @@ function D9({
|
|
|
10950
10964
|
refetch: v,
|
|
10951
10965
|
pinnedIds: C,
|
|
10952
10966
|
pendingIds: h,
|
|
10953
|
-
pinThread:
|
|
10967
|
+
pinThread: A,
|
|
10954
10968
|
unpinThread: S,
|
|
10955
10969
|
deleteThread: F
|
|
10956
10970
|
};
|
|
@@ -11010,7 +11024,7 @@ const s9 = K.create(xt), a9 = ({
|
|
|
11010
11024
|
className: n,
|
|
11011
11025
|
children: s
|
|
11012
11026
|
}) {
|
|
11013
|
-
const { t: a } = z(), c =
|
|
11027
|
+
const { t: a } = z(), c = C1(), u = o ?? a("ai.applyingChanges");
|
|
11014
11028
|
return W(() => {
|
|
11015
11029
|
if (!r) return;
|
|
11016
11030
|
const l = document.activeElement;
|